[
  {
    "path": ".gitignore",
    "content": "node_modules\n.DS_Store\nelectron-vue/node_modules\nelectron-vue/dist\nelectron-vue/build\ncalllib-v3/server/node_modules\ncalllib-v3/server/package-lock.json\ncalllib-v3/web/node_modules\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 融云 RongCloud\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# 引导说明\n\n写给前端新手的工程管理建议: [https://support.rongcloud.cn/kb/NzUx](https://support.rongcloud.cn/kb/NzUx)\n\n开发 IM 的基本思路: [https://support.rongcloud.cn/kb/NzQ4](https://support.rongcloud.cn/kb/NzQ4)\n\n消息类型与文件格式: [http://support.rongcloud.cn/kb/NjE0](http://support.rongcloud.cn/kb/NjE0)\n\n用信息处理: [http://support.rongcloud.cn/kb/NjQ5](http://support.rongcloud.cn/kb/NjQ5) \n\n\n\n# WebSDK demo\n\nWebSDK API 示例(基于 IM SDK V4): [https://rongcloud.github.io/websdk-demo/api-test-v4](https://rongcloud.github.io/websdk-demo/api-test-v4/)\n\nWebSDK API 示例(基于 IM SDK V3): [https://rongcloud.github.io/websdk-demo/api-test](https://rongcloud.github.io/websdk-demo/api-test/)\n\nSDK源码: [https://github.com/rongcloud/rongcloud-web-im-sdk-v2](https://github.com/rongcloud/rongcloud-web-im-sdk-v2)\n\n常见问题: [https://github.com/rongcloud/websdk-demo/blob/master/faq.md](https://github.com/rongcloud/websdk-demo/blob/master/faq.md)\n\nRequire SDK: [https://rongcloud.github.io/websdk-demo/require.html](https://rongcloud.github.io/websdk-demo/require.html)\n\nRequire SDK in Electron: [https://github.com/rongcloud/websdk-demo/tree/master/electron/requirejs-in-node.html](https://github.com/rongcloud/websdk-demo/tree/master/electron/requirejs-in-node.html)\n\nNormal SDK in Electron: [https://github.com/rongcloud/websdk-demo/tree/master/electron/normal.html](https://github.com/rongcloud/websdk-demo/tree/master/electron/normal.html)\n\nWebSDK in electron-vue: [https://github.com/rongcloud/websdk-demo/tree/master/electron-vue](https://github.com/rongcloud/websdk-demo/tree/master/electron-vue)\n\n引用本地 SDK: 将 [WebSDK](https://cdn.ronghub.com/RongIMLib-2.3.0.js) 下载至本地引用即可，[初始化示例](https://github.com/rongcloud/websdk-demo/tree/master/local-sdks)\n\n初始化、消息监听: [https://rongcloud.github.io/websdk-demo/connect-check.html](https://rongcloud.github.io/websdk-demo/connect-check.html)\n\n消息监听回调队列: [https://rongcloud.github.io/websdk-demo/init-muti.html](https://rongcloud.github.io/websdk-demo/init-muti.html)\n\n获取历史消息: [https://rongcloud.github.io/websdk-demo/histroy-messages.html](https://rongcloud.github.io/websdk-demo/histroy-messages.html)\n\n聊天室自定义属性: [https://github.com/rongcloud/websdk-demo/tree/master/chrm-kv-demo](https://github.com/rongcloud/websdk-demo/tree/master/chrm-kv-demo)\n\nWebSDK Vue Require 示例: [https://rongcloud.github.io/websdk-demo/vue/require.html](https://rongcloud.github.io/websdk-demo/vue/require.html)\n\nWebSDK Vue Normal 示例: [https://rongcloud.github.io/websdk-demo/vue/normal.html](https://rongcloud.github.io/websdk-demo/vue/normal.html)\n\nWebSDK Vue CLI 3.x 示例: [https://github.com/rongcloud/websdk-demo/tree/master/vue-cli](https://github.com/rongcloud/websdk-demo/tree/master/vue-cli)\n\nWebSDK Vue CLI 4.x 示例: [https://github.com/rongcloud/websdk-demo/tree/master/vue-cli-4](https://github.com/rongcloud/websdk-demo/tree/master/vue-cli-4)\n\nWebSDK React 示例: [https://rongcloud.github.io/websdk-demo/react/im.html](https://rongcloud.github.io/websdk-demo/react/im.html)\n\nWebSDK SeaJS 示例: [https://rongcloud.github.io/websdk-demo/seajs.html](https://rongcloud.github.io/websdk-demo/seajs.html)\n\n\n# 扩展组件 Component\n\nEmoji: [https://rongcloud.github.io/websdk-demo/emoji.html](https://rongcloud.github.io/websdk-demo/emoji.html)\n\n视频播放(Video + Flash): [https://rongcloud.github.io/websdk-demo/video/player.html](https://rongcloud.github.io/websdk-demo/video/player.html)\n\n声音播放: [https://rongcloud.github.io/websdk-demo/voice.html](https://rongcloud.github.io/websdk-demo/voice.html)\n\n上传组件: [https://github.com/rongcloud/rongcloud-web-im-upload](https://github.com/rongcloud/rongcloud-web-im-upload)\n\n\n# 集成项目\n\n集成指南: [https://rongcloud.github.io/websdk-demo/integrate/guide.html](https://rongcloud.github.io/websdk-demo/integrate/guide.html)\n\nWeb 聊天室 (弹幕效果)：[https://rongcloud.github.io/websdk-demo/chatroom/chatroom.html](https://rongcloud.github.io/websdk-demo/chatroom/chatroom.html)\n\nWeb IM(无框架依赖): [https://rongcloud.github.io/websdk-demo/im/im.html](https://rongcloud.github.io/websdk-demo/im/im.html)\n\nWeb IM(Angular): [https://github.com/rongcloud/rongcloud-web-im-widget](https://github.com/rongcloud/rongcloud-web-im-widget)\n\nWeb IM H5(Angular): [https://github.com/rongcloud/rongcloud-web-im-widget-h5](https://github.com/rongcloud/rongcloud-web-im-widget-h5)\n\nWeb 对接佳信客服(无框架依赖): [https://rongcloud.github.io/websdk-demo/cs/jx/cs.html](https://rongcloud.github.io/websdk-demo/cs/jx/cs.html)\n\nWeb 对接智齿客服(无框架依赖): [https://rongcloud.github.io/websdk-demo/cs/sobot/cs.html](https://rongcloud.github.io/websdk-demo/cs/sobot/cs.html)\n\n\n# SealTalk 项目源码\n\nSealTalk Server: [https://github.com/sealtalk/sealtalk-server](https://github.com/sealtalk/sealtalk-server)\n\nSealTalk Web: [https://github.com/sealtalk/sealtalk-web](https://github.com/sealtalk/sealtalk-web)\n\nSealTalk Desktop: [https://github.com/sealtalk/sealtalk-desktop](https://github.com/sealtalk/sealtalk-desktop)\n\n\n\n"
  },
  {
    "path": "api-test/.gitignore",
    "content": ".node_modules\n.sass-cache\n*.css.map"
  },
  {
    "path": "api-test/README.md",
    "content": "# api-test\n"
  },
  {
    "path": "api-test/config.js",
    "content": "(function (win) {\n\n  var isDebug = false;\n\n  var im = {\n    appkey: 'n19jmcy59f1q9',\n    token: 'Kn2p4uokgY5AZOFVsKTbKq+YsUIoF3ojin3K277sfOnEb+B6ZpahsTOCVisdS43pwz7SnsSF0xxiLfygEojZP7ywLi39+nOPq12llTIt1oc=',\n    navi: '',\n    targetId: 'api_test_target',\n    // customCMP: '',\n    isPolling: false,\n  };\n\n  if (!isDebug) {\n    delete im.cmpUrl;\n  }\n\n  var config = {\n    im: im,\n    isDebug: isDebug,\n    debugConf: {\n      autoRun: false,\n      isShowMsg: false\n    }\n  };\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM = {\n    config: config,\n    components: {}\n  };\n\n})(window);"
  },
  {
    "path": "api-test/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n\n  <title>Api Test v3</title>\n  \n  <link rel=\"stylesheet\" href=\"./lib/styles/iview.css\">\n  <!-- <link rel=\"stylesheet\" href=\"./lib/styles/dragula-3.7.2.css\"> -->\n  <link rel=\"stylesheet\" href=\"./styles/main.css\">\n  \n  <!-- <script src=\"//mstatic.secooimg.com/activity2018/js/sdk/weixin.sdk1.3.2.js\"></script> -->\n  <script src=\"./lib/js/vue-2.6.10.js\"></script>\n  <script src=\"./lib/js/iview-4.0.2.min.js\"></script>\n  <script src=\"./lib/js/vue-json-pretty.js\"></script>\n  <script src=\"./lib/js/es6-promise.js\"></script>\n  <script src=\"./lib/js/Sortable.min.js\"></script>\n  <script src=\"./lib/js/vuedraggable.umd.min.js\"></script>\n\n  <script src=\"https://cdn.ronghub.com/RongIMLib-3.0.6-dev.js\"></script>\n  <script src=\"./config.js\"></script>\n  <script src=\"./js/common/utils.js\"></script>\n  <script src=\"./js/common/service.js\"></script>\n  <script src=\"./js/common/api-list.js\"></script>\n\n  <script id=\"rong-global-config\" type=\"text/x-template\">\n    <div class=\"rong-login\">\n      <i-form :label-width=\"80\" class=\"rong-input-form\">\n        <FormItem class=\"rong-login-formitem\" v-for=\"item in configList\" v-bind:key=\"item.name\" :label=\"item.name\">\n          <i-input class=\"rong-login-input-item\" :class=\"'rong-input-' + item.name\" v-if=\"item.type === 'string'\" v-model=\"config[item.name]\" type=\"text\" :placeholder=\"prompt[item.name] || item.name\" />\n          <i-switch v-else-if=\"item.type === 'boolean'\" v-model=\"config[item.name]\" />\n          <span class=\"rong-prompt\" v-if=\"prompt[item.name]\">{{prompt[item.name]}}</span>\n        </FormItem>\n        <div class=\"rong-connect-btn-box\">\n          <i-button @click=\"login(config)\" type=\"primary\">开始链接</i-button>\n          <i-button @click=\"clearStorage()\" type=\"warning\">清空缓存</i-button>\n        </div>\n      </i-form>\n    </div>\n  </script>\n\n  <script id=\"rong-tpl-apibtn\" type=\"text/x-template\">\n    <div class=\"rong-api-btn\" :value=\"apiValue\">\n      <Tooltip placement=\"bottom\" :transfer=\"true\" :disabled=\"isdragging\">\n        <i-button class=\"rong-api-btn-box\" size=\"small\" @click=\"run()\">\n          <span class=\"rong-api-btn-name\">{{selfApi.name}}</span>\n          <!-- <div class=\"rong-api-btn-set\">\n            <button class=\"rong-api-btn-run\" @click=\"run()\">运行</button\n            ><button class=\"rong-api-btn-config\" @click=\"showEditDialog()\">设置</button\n            >\n          </div> -->\n        </i-button>\n        <div slot=\"content\" class=\"rong-prompt-box\">\n            <i-button v-if=\"hasParams\" size=\"small\" type=\"info\" @click=\"showEditDialog()\">修改配置</i-button>\n            <i-button size=\"small\" type=\"success\" @click=\"openUrl(selfApi.doc)\">查看文档</i-button>\n            <!-- <p><a class=\"rong-api-btn-link\" :href=\"selfApi.doc\" target=\"_blank\">点击查看文档</a></p>\n            <p><a class=\"rong-api-btn-link\" :href=\"selfApi.doc\" target=\"_blank\">点击配置参数</a></p> -->\n            <p>方法: {{selfApi.eventName}}</p>\n            <p>描述: {{selfApi.desc}}</p>\n            <p v-if=\"hasParams\">参数:</p>\n            <ul class=\"rong-tip-params\">\n              <li v-for=\"param in selfApi.params\" v-bind:key=\"param.name\">\n                {{param.name}} ({{param.type}})\n              </li>\n            </ul>\n        </div>\n      </Tooltip>\n\n      <Modal v-model=\"isShowEditDialog\" draggable scrollable title=\"参数设置\" width=\"395\">\n        <i-form :label-width=\"90\">\n          <FormItem v-for=\"param in paramList\" v-bind:key=\"param.name\" :label=\"param.name\" class=\"rong-api-set-item\">\n            <i-input v-if=\"param.type === 'string'\" v-model=\"param.value\" type=\"text\" :placeholder=\"param.name\" />\n            <i-input v-else-if=\"param.type === 'number'\" v-model=\"param.value\" type=\"number\" :placeholder=\"param.name\" />\n            <i-switch v-else-if=\"param.type === 'boolean'\" v-model=\"param.value\" @on-change=\"change\" />\n          </FormItem>\n        </i-form>\n        <div slot=\"footer\">\n            <i-button type=\"success\" @click=\"run()\">运行</i-button>\n            <i-button type=\"primary\" @click=\"hideEditDialog()\">确定</i-button>\n        </div>\n      </Modal>\n\n    </div>\n  </script>\n\n  <script id=\"rong-json-alert\" type=\"text/x-template\">\n    <Modal class=\"rong-json-alert\" v-model=\"isShow\">\n      <prettyjson class=\"rong-json-content\" :showLength=\"true\" :highlight-mouseover-node=\"true\" selectable-type=\"single\" :path=\"'res'\" :data=\"data\">\n      </prettyjson>\n      <div slot=\"footer\">\n          <i-button type=\"primary\" @click=\"hide()\">确定</i-button>\n      </div>\n    </Modal>\n  </script>\n\n  <script src=\"./js/components/button.js\"></script>\n  <script src=\"./js/components/json-alert.js\"></script>\n  <script src=\"./js/login.js\"></script>\n</head>\n<body>\n  <div id=\"app\" class=\"rong-box rong-hidden\" :class=\"{ 'rong-drag': isDragging, 'rong-show': 1  }\">\n\n    <h1>\n      Web SDK Demo\n      <a target=\"_blank\" href=\"https://github.com/rongcloud/websdk-demo/blob/master/api-test.html\" title=\"点击查看源码\" class=\"get-source\">示例源码</a>\n    </h1>\n\n    <template v-if=\"isLogged\">\n      <div class=\"rong-run-info\" v-if=\"isDebug\">\n        <p>成功次数: <b>{{runInfo.runCount}}</b></p>\n        <p>成功 Api 个数: <b>{{runInfo.successApiCount}}</b></p>\n        <p>失败 Api 个数: <b>{{runInfo.failApiList.length}}</b></p>\n      </div>\n\n      <!-- <div class=\"rong-global-opt\">\n        <i-button class=\"rong-runall-btn\" size=\"small\" @click=\"runAllApi()\">运行全部</i-button>\n      </div> -->\n\n      <div class=\"rong-user-title\">\n        <h4>当前用户 id： {{currentUserId}}</h4>\n        <i-button class=\"rong-runall-btn\" size=\"small\" @click=\"isShowRunType=true\">运行全部</i-button>\n        <components class=\"rong-changeuser-btn\" is=\"apiBtn\"\n          :api=\"changeUserApi\" :isdragging=\"isDragging\"></components>\n        <i-button v-if=\"isDebug\" class=\"rong-runall-btn\" size=\"small\" type=\"error\" @click=\"isAlarmMuted=!isAlarmMuted\">{{ isAlarmMuted ? '取消静音' : '点击静音' }}</i-button>\n      </div>\n\n      <p class=\"rong-api-prompt\">\n        <b>注:</b>\n        <span>以下 Api 按钮可拖拽移动顺序, 点击运行全部按钮, 按当前展示顺序运行 Api</span>\n      </p>\n\n      <div class=\"rong-opt-list\">\n          <div v-for=\"(readyList, index) in readyApiQueue\" v-bind:key=\"readyList.id\" class=\"rong-ready-box\">\n            <draggable :list=\"readyList\" group=\"people\" @start=\"startDragging()\" @end=\"isDragging=false\">\n                <!-- <span>{{index + 1}}</span> -->\n                <components :ref=\"'readyApi' + index\" v-for=\"api in readyList\" v-bind:key=\"api.name\" class=\"rong-ready-btn\" is=\"apiBtn\" :api=\"api\" :isdragging=\"isDragging\"></components>\n            </draggable>\n          </div>\n      </div>\n\n      <div class=\"rong-current-output\" v-if=\"currentOutput\">\n        <p><b>{{currentOutput.title}}</b></p>\n        <p><b>耗时:</b> {{currentOutput.consumedTime}} ms</p>\n        <p><b>参数:</b> {{toJSON(currentOutput.params)}}</p>\n        <template v-if=\"currentOutput.result\">\n          <p><b>返回值:</b></p>\n          <prettyjson :showLength=\"true\" :highlight-mouseover-node=\"true\" selectable-type=\"single\" :path=\"'res'\"\n            :data=\"currentOutput.result\"></prettyjson>\n        </template>\n      </div>\n      \n      <!-- <div class=\"rong-api-list\">\n        <components class=\"rong-api-source\" v-for=\"api in apiList\" v-bind:key=\"api.name\" is=\"apiBtn\" :api=\"api\"></components>\n      </div> -->\n      \n      <div class=\"rong-out-list\">\n        <div class=\"rong-out-list-head\">\n          <h4>调用结果如下:</h4>\n          <div class=\"rong-out-btn-list\">\n            <i-button size=\"small\" @click=\"clearOutput()\">清空</i-button>\n            <i-button size=\"small\" @click=\"showAllOutput()\">显示全部</i-button>\n            <i-button class=\"rong-out-list-display\" size=\"small\" @click=\"isShowOutList=!isShowOutList\">{{ isShowOutList ? '隐藏' : '展开' }}</i-button>\n          </div>\n        </div>\n        <Collapse class=\"rong-out-list-content\" v-if=\"displayedOutputList.length\" v-show=\"isShowOutList\">\n          <Panel v-for=\"(output, index) in reverse(displayedOutputList)\" class=\"rong-out-panel\" v-bind:key=\"output.id\" :name=\"index + ''\" :style=\"{ color: output.config.color }\">\n            <span :title=\"output.title\" class=\"rong-out-title\">{{displayedOutputList.length - index}}. {{output.title}}</span>\n            <div slot=\"content\" class=\"rong-out-item\">\n              <p><b>时间:</b> {{output.time}}</p>\n              <p v-if=\"output.consumedTime\"><b>耗时:</b> {{output.consumedTime}} ms</p>\n              <p v-if=\"output.params && output.params.length\"><b>参数:</b> {{toJSON(output.params)}}</p>\n              <p v-if=\"output.result\"><b>返回值:</b> {{toJSON(output.result)}}</p>\n              <i-button v-if=\"output.result\" class=\"rong-parse-json-btn\" size=\"small\" type=\"primary\" @click=\"showJSONAlert(output.result)\">点击解析返回值\n              </i-button>\n            </div>\n          </Panel>\n        </Collapse>\n      </div>\n\n    </template>\n\n    <components v-else is=\"login\" :login=\"login\" :config=\"globalConfig\"></components>\n\n    <Modal v-model=\"isShowRunType\" draggable scrollable title=\"运行方式\" width=\"395\">\n      <i-form :label-width=\"90\">\n          <i-select v-model=\"runType\">\n            <i-option v-for=\"opt, key in RunType\" v-bind:key=\"key\" :value=\"key\">{{opt.name}}</i-option>\n          </i-select>\n          <p class=\"rong-run-sel-prompt\">\n            <b>提示:</b>\n            <span>{{RunType[runType].prompt}}</span>\n          </p>\n      </i-form>\n      <div slot=\"footer\">\n        <i-button type=\"success\" @click=\"runAllApi();isShowRunType=false;\">运行</i-button>\n      </div>\n    </Modal>\n\n    <audio ref=\"alarm\" style=\"opacity: 0; position: absolute;\" src=\"./styles/alarm.mp3\"></audio>\n\n  </div>\n</body>\n\n<script src=\"./js/main.js\"></script>\n\n</html>"
  },
  {
    "path": "api-test/js/common/api-list.js",
    "content": "(function (win, dependencies) {\n  var RongIMLib = win.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient;\n\n  var RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    Service = RongIM.Service,\n    config = RongIM.config.im,\n    urlQueryConfig = utils.getUrlQuery();\n\n  var MiniUnSupportEventList = [\n    'sendRecallMessage', 'deleteRemoteMessages', 'clearRemoteHistoryMessages'\n  ];\n\n  var disconnect = {\n    name: '断开链接',\n    event: Service.disconnect,\n    eventName: 'disconnect',\n    desc: '断开链接',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/connection/disconnect/web3.html',\n    params: []\n  };\n\n  var reconnect = {\n    name: '重新链接',\n    event: Service.reconnect,\n    eventName: 'reconnect',\n    desc: '重新链接',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/connection/reconnect/web3.html',\n    params: [\n      // { name: '是否嗅探', type: 'boolean', value: true },\n      // { name: '嗅探 url', type: 'string', value: 'https://cdn.ronghub.com/RongIMLib-2.2.6.min.js?d=' + Date.now() },\n      // { name: '嗅探频率', type: 'string', value: '100,1000,3000,3000,3000' }\n    ]\n  };\n\n  var changeUser = {\n    name: '切换用户',\n    evnet: utils.noop,\n    eventName: 'logout',\n    desc: '切换用户',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/connection/disconnect/web3.html#logout',\n    params: [\n      { name: 'Token', type: 'string', value: '5JQlp5czM31GNl99DOZyI3xpRjANxKgfakOnYLFljI+TMvOF0hGaVtR1n9Qp4baLgKBGsyl3w5j4gAWBbNZ3nOKrvnVo8Ldl' }\n    ]\n  };\n\n  var registerMessage = {\n    name: '注册自定义消息',\n    event: Service.registerMessage,\n    eventName: 'registerMessageType',\n    desc: '注册自定义消息',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/message-send/#custom-register',\n    params: [\n      { name: 'messageType', type: 'string', value: 'PersonMessage' },\n      { name: 'objectName', type: 'string', value: 's:person' },\n      { name: '是否计数', type: 'boolean', value: true },\n      { name: '是否存储', type: 'boolean', value: true },\n      { name: '属性', type: 'string', value: 'name,age' },\n    ]\n  };\n\n  var getConversationList = {\n    name: '获取会话列表',\n    event: Service.getConversationList,\n    eventName: 'getConversationList',\n    desc: '获取会话列表',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/conversation/getall/web3.html',\n    params: [\n      { name: '数量', type: 'number', value: 1000 }\n    ]\n  };\n\n  var removeConversation = {\n    name: '删除会话列表',\n    event: Service.removeConversation,\n    eventName: 'removeConversation',\n    desc: '删除会话列表',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/conversation/clear/web3.html',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getHistoryMessages = {\n    name: '获取历史消息',\n    event: Service.getHistoryMessages,\n    eventName: 'getHistoryMessages',\n    desc: '获取历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/storage/web3.html',\n    params: [\n      { name: '时间戳', type: 'number', value: 0 },\n      { name: '数量', type: 'number', value: 20 },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setConversationStatus = {\n    name: '设置会话状态',\n    event: Service.setConversationStatus,\n    eventName: 'setConversationStatus',\n    desc: '设置会话状态',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/conversation/notify/web3.html',\n    params: [\n      { name: '免打扰', type: 'number', value: 1 },\n      { name: '置顶', type: 'boolean', value: true },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var deleteRemoteMessages = {\n    name: '删除历史消息(按消息)',\n    event: Service.deleteRemoteMessages,\n    eventName: 'deleteRemoteMessages',\n    desc: '按消息删除指定历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/delete/web3.html#deletebyid',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '消息方向', type: 'number', value: 1, event: Service.getLastCacheMsgDirection },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var clearHistoryMessages = {\n    name: '删除历史消息(按时间)',\n    event: Service.clearHistoryMessages,\n    eventName: 'clearRemoteHistoryMessages',\n    desc: '按时间删除历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/delete/web3.html#deletebyid',\n    params: [\n      { name: '删除时间戳', type: 'number', value: Date.now()  },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var sendTextMessage = {\n    name: '发送文字消息',\n    event: Service.sendTextMessage,\n    eventName: 'sendMessage',\n    desc: '发送文字消息(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web3.html#TxtMsg',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文字消息' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '状态消息', type: 'boolean', value: false },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendImageMessage = {\n    name: '发送图片消息',\n    event: Service.sendImageMessage,\n    eventName: 'sendMessage',\n    desc: '发送图片消息(ImageMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web3.html#ImgTextMsg',\n    params: [\n      { name: '缩略图', type: 'string', value: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCABkAPADASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAECAwQGBwX/xAA7EAABAwEHAQYDBQcFAQAAAAABAAIDEQQFEiExUZETFiJBVGHRI3GTBhSBobEVM1Ji4fDxJEJDU3LB/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAEDAv/EABwRAQEBAQACAwAAAAAAAAAAAAABEwIRMQNRYf/aAAwDAQACEQMRAD8ArBct7wBwbZWkOoc5G5EaHVSLnvoRCIQgNAoO+2ozrrVdY9tpNoqx7BDQZeNc/TTMceqwMivFrm4p43NqcVRmR4Uy11/Jb638ZZxzxu6/nPL3QtJJqQSyhOeo08StR/2dvV7sX3YVJqfiN912NLYZ8TSwREjuu1A/DxOfj4D1Wdgko3GW1/3UGvyU2s+jOVxTbivhgAbCQ2tadVtP1UTXBe81S6zguIp+8b7rsZ22rrNdA+PAKVa/x1r/APFEf3t9mlEmCObMRluY0yPj4qb9efRnHIw3HfEDsUdnaDUGpcw0/NQ+4b2eBis4y0+I33XUGG8uqCLVH0w5hphzIqMQ02r/AEWeZlqM7XQyNEWGjmkamvyXW3X4Zxhu2yPjueGy2hpa4No4A6Z7hbENlihdiZUHxO6iyNtLICLU8PlrkQcv0H6LXskF4iOMWq1MxtcC4xtBxCmmYyWNnm+Xb4l+XNb7Xess8EAdG4NocbRoBuVrfsi++/8ACpjbhdSRoqKU3XaItJ8tk8Ob8ct8uD7OXriB+7DT/sb7rajuu/Y8GGIdymGr2GlPmf7ouyRXbr6Mo4R32dvUkH7tXOp+I33WWO5b5iaAyGgDsQ+I3I8+i7ZE26Mo4WX7P3tIHE2epIP/ACN91qdl748qPqM916KibdGceddl748qPqM907L3x5UfUZ7r0VFNujOPOuy98eVH1Ge6dl748qPqM916KibdGceddl748qPqM907L3x5UfUZ7r0VE26M4867L3x5UfUZ7p2Xvjyo+oz3XoqJt0Zx512Xvjyo+oz3TsvfHlR9RnuvRUTbozjzrsvfHlR9RnunZe+PKj6jPdeiom3RnGV0UTRV2Q3Liqn7sK1ezLXv/P19DwrytbKzCXkA/wAJodKLAbFCS49SSrjUnH8+NSs2jJMLPBC+aU4Y4wXOcScgNVVr7I5xa2VhcDhID866U1V5YYp7NJZ5u/HI0tcCaVB10Wsy6bAy0/eBH8Tu5l5NS2tCc8zmcz7oMjJ7C9mNs8Zbv1P6qRLYnFwE0dWOLXfE0I1Gqwtue7mTGZkDWyurV7XkE1BGtdiomua7Z3h8sAe5shkDi91Q4nEaZ6Vzpog2OpZC9jBI0uecLQHE1NCf0B4UdSx4XO6rMLa4j1NKGh8d8lSz3XYbNKJIYg1weZK4ye8QRXX+Z3KC67CBJSL96AH/ABHZ0pTx9Px8UGQyWNpAMrAXEAfE1rSnj6hYHXhdjBMXWqL4BAk75OAkkUPrUFP2NdvUhk6Axw06Zxu7tKU8fQfnuU/Y120nHQAFofjlAe4YzUnPPcnJBW0Xnddm6vWtLWdJwa+pd3Sa0H5HhTJeF3RMe983djNHuAcQ3XWn/k8KZbnu+ZsrXxEiZ2N9JXCpz9ch3nZaZlXddtifHJGY+5IHB4xuzxYq+P8AO7n0CDHaLwu6yyOZPKWOa0OILX6EgA8kBS233a6EzC0MwBodUuIyJoMvmNFe13bY7aXG0Nc7FStJXN0II0O4Cwm4rrNKwVoMNeq7eu+Z9UFo7wuyQAstLHVoBRx8cgrMtl3vja8TDA4E4iSAKEg1rpmDqsYuK6w0tFnGEginUdTP8dchn4UCvFc9ggjayJj2taSRSd9RWtc6+p5QXbarC9jnslxsa0vLm4iKfMf3rskNpsU72sic9znad14/XRY3XNd7nRudG9zowQwumeSAdfFZIrssUNrbamNf1m1o4zPOuuRNP8DZBs9GPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIMi15rbZoOp1ZWt6YxOr4DdZzqFozXfd8tqklmaHTSt6bwZD3hTSlaaBQXlvOxQsc+S0Na1oBcTXKulVtNcHtDmmoIqCtEXZdtphdSJsrH4QTjLqhtKCtdMhkt5rQxoa3QCgQWREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQQdQtK0ywtklbJG5+VXVc0DT1K3TqFpTtvA2z4Do2WfDSrhU13UqVe7HQvsgfA1zWOOKjnYjnnrUrbWGzdbpf6jDjrXu6D0/DT8FmSeiehERVRERAREQEREBERAREQEREBERAREQEREBERAREQEREEEE6GiijtxwpPgtG02W2yzSGK2GONwoG0zbpmDz+SDdo7ccJR244URtc2Noe7E4DN1KVVkEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQD4Ii07VLbmOlFngY8BowEnU8oNxF8ya0XuC8RWSI4Wijia4jlWgqNM9f87mKfrMBADKd70OWn5oM6LFG6Qvo4CnzWVAREQEREBERAREQEREBERAREQEREBERAREQEREBERAOoUoiAiIgIiIC+VaLymiksrWtjImjxuqDkaeGaIgXfeU1qbZS9sY6wcXYQcqGmWazR22R0sTS1lHuAOR/gr+qIg30REBERAREQEREBERAREQEREBERAREQEREH//Z' },\n      { name: '原图 url', type: 'string', value: 'https://nfsprodrcx.cn.ronghub.com/v3/BGSPKH501EG0K6MI/base64.png?token=Um9uZ2Nsb3VkMTQyMDIwMDMxNzAzMzk1OTM2MDBtZXNzYWdlOzs7MjczMTk5NDg4OA==' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendFileMessage = {\n    name: '发送文件消息',\n    event: Service.sendFileMessage,\n    eventName: 'sendMessage',\n    desc: '发送文件消息(FileMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web3.html#FileMsg',\n    params: [\n      { name: '文件名', type: 'string', value: 'logo_wx' },\n      { name: '文件大小', type: 'number', value: 20000 },\n      { name: '文件类型', type: 'string', value: 'png' },\n      { name: '文件 url', type: 'string', value: 'http://rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendVoiceMessage = {\n    name: '发送语音消息',\n    event: Service.sendVoiceMessage,\n    eventName: 'sendMessage',\n    desc: '发送语音消息(HQVoiceMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web3.html#HQVCMsg',\n    params: [\n      { name: '语音 url', type: 'string', value: 'https://rongcloud-audio.cn.ronghub.com/audio_amr__RC-2020-03-17_42_1584413950049.aac?e=1599965952&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:CDngyWj7ZApNmAfoecng7L_3SaU=' },\n      { name: '语音类型', type: 'string', value: 'aac' },\n      { name: '语音时长', type: 'number', value: 6 },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendRecallMessage = {\n    name: '发送撤回消息',\n    event: Service.sendRecallMessage,\n    eventName: 'sendRecallMessage',\n    desc: '发送撤回消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgrecall/web3.html',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendAtMessage = {\n    name: '发送 @ 消息',\n    event: Service.sendAtMessage,\n    eventName: 'sendMessage',\n    desc: '发送 @ 消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web3.html#at',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文本消息, 我 @ 了其他人' },\n      { name: '@ 对象 id', type: 'string', value: config.targetId },\n      { name: '会话类型', type: 'number', value: 3 },\n      { name: '群组 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendAtMessageByErrorParamField = {\n    name: '发送 @ 消息 ErrorParams',\n    event: Service.sendAtMessageByErrorParamField,\n    eventName: 'sendMessage',\n    desc: '发送 @ 消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web3.html#at',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文本消息, 我 @ 了其他人' },\n      { name: '@ 对象 id', type: 'string', value: config.targetId },\n      { name: '会话类型', type: 'number', value: 3 },\n      { name: '群组 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendRegisterMessage = {\n    name: '发送自定义消息',\n    event: Service.sendRegisterMessage,\n    eventName: 'sendMessage',\n    desc: '发送自定义消息(RegisterMessage)',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/message-send/#custom-send',\n    params: [\n      { name: '消息类型', type: 'string', value: 'PersonMessage' },\n      { name: '属性值', type: 'string', value: 'name,age' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendLocationMessage = {\n    name: '发送位置消息',\n    event: Service.sendLocationMessage,\n    eventName: 'sendMessage',\n    desc: '发送位置消息(sendLocationMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web3.html#LBSMsg',\n    params: [\n      { name: '位置缩略图', type: 'string', value: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABsSFBcUERsXFhceHBsgKEIrKCUlKFE6PTBCYFVlZF9VXVtqeJmBanGQc1tdhbWGkJ6jq62rZ4C8ybqmx5moq6T/2wBDARweHigjKE4rK06kbl1upKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKT/wAARCADwAZgDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAIDAQQF/8QAQRAAAgIBAwEFBQQIBAUFAQAAAQIAAxEEEiExEzJBUXEUImGBkQVSobEVIzNCU2LB0TRykuEkVXOi8ENjZJOkZf/EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/8QAHxEBAQEBAQACAwEBAAAAAAAAAAERAjEhQQMTcRIy/9oADAMBAAIRAxEAPwD3YQhKohCEAhCEAhCEAhCbtbyP0gZCNtb7phsbygLCaVI6iZAIQm9TiBkYIx8MesYKEG5jFZyenAgN2YHVofqx8ZOECm5B0X8IdqPBZOEYKdr/AC/jN9x/gZKEYGZCvxEWOLCOvIjYVxxwYCMLRUDTs3k/v5xj5TnX7RCUhr1O7cVIQeI9Z2rwoE8rU0sbLqzXdtNm9WRNw5HM3xJfii/6W0/3LPoP7zpWxb6FtUEA8jPWeR7J/Lqf/o/3nsVKE0iKAQAgHIwZe+eZ4EhCE5ghCEAl5CWHSSjG7p9I8WancHpIjB4j4xLn7Opn8QOPWMSAxyfjAtwdpBOOBmFjmyXoZAVKL7u9j1OOfzhTZvVHLuzYHCr/AF/3hWMUEMVJCn3scA+vnEV2XvBxXncCAeT5emZt0d0IiPlFLYDEcjym7l85hzavfPpNfoD8YoILjHlGfuH6wghCEKJJuplZJu8ZYzWQhCVGQhNAJ6CG2Qj9m3wikEdRAyEJoGTgdYGR1rJ68RjtrHTJiF2br0gPlE4HJi9o3wiQgP2jfCBsbziQgUVw3usIrLtOIucc+UpaMlQPGAnU4lABWMnkwwKxnqZMkk5MALFjkzIQgEIQgEIQgEIQgEIDkkAgkdQDyJu0+R+kBkswcN084g02dZ7SLD0xt8JuDnGJinoyMCPgeDHngbV0e0U7C5TnOZhPuqgJIUYyepjNsfOGG4DJGecRI34wEIEgYyQMnAycZMIBCEIBLDoJGWXuj0ko2CdPmYRGfs0dsZxziRFIYBGCBFY52kHAMMH7xlGlVOMgcdOJz6E4WxCclXIl8H7xnHV7v2jauTgjP5GWNT5ld0IuPifrDb8T9TMsmgRkYiEYBIJ4+MeUKvKibMXxHkZsiiSbvGVkm78sSjb8YRoRphAMkCJrdWNJUAmDYegP5mVq7/ynN9pLVX2eosrNhB27c4B6nmb5y9fKuX9Laj7lf0P953aLVDV1EOALB1A/MTy/1XZ9p7Hbszndv49M4nofZq1WdpqK6zWSdu3OQOh4nXvnnPCrkYJEk2rSm0p2V1jYz7i5wJ0ON1uPhzODUEj7QfbqVo9xe8Ac/WcEbXq7CpN2m1BYsT7tXQeAlqLlvDbVdSpwQ4wZDc//ADOr/Qn94aRTYupXttxZ8dooHl4QA6u3fcyUiylOh3hcY6nzMd9Um+gLbWm/O8Eg7fd8fnItStlwpGw1Vd6wcYH3T5xrKl1FnbVVIVTke6B2pzz8pBZdQi0dpdbXwdpKHcCflJJ9o0G20PcNmRs90+XPh5yo1GlpqDqyVox6KuOfiAJCrXaddTexuwHK4O084HPhKGT7Ro7ewPcOzG3Z7p8ufCX1erupXtKqA9e3dvLY/DrOenX6ZNVqHNvusE2kqecA58In2iy2U9pXdad4yFDYXA6nEg6TqLK69+pQZLBVWrk8zF1al0Vqb03ttBdMDP1kMYFQL3FxegZbWzjr0nVrOun/AOuv5GBJ77u1sCtpkRG2g2kgniZ7Rf8Ax9B/rM0VvY2oCV0uwt/9UZGMTm7O2u+7NGlOCoI2EgZHhA7NPbbZc1dvZHChg1WcHM6Cp8JCldmtZSFUilchRgA5PSdMCcJRuknLFEPA4xnwzGUeM1uhOMkeHnJo8+ntrNZdXZ2BBCiwAtyMeH1kex0q6O6w1hmR2Ue8eOePGX09IW657uHXbYWB6Hkn+0VHOipS8g4sHvrnBzyR+eIRfT21JpVNO+5a8KdiknPoZypqwmhRf1lbAjBIxuG7nHnO3TL2NQaxhljvds8ZM4ltrs0SIASyMOdvAy3nKKJqbG1lj6ekvlAPf93HXmWFtr6NLUVd+AxXHUeImWpqDqrDSFG5ANzg48emPGU0hzp1VR+zJTPnjxkErrFtTSuhyrXKR+MobWOpFVeMLzYT4eQ9Zz2INQ+3TYVKSW3Dozzp07V2Vl61CknLr4hvHMopCEIUSq90SUqndElDSdoYq4UZJWUmfvj0MiJ0lmoQnHBwPylYP3D8OYQCcbjb9p1n7y/3nZOXVLi6iz+cLLG+fXVCEJGWTU5UQgnQjyMIz98/WbMbvD0mwCTbvykm3flhWwhCQIDggjwktdRdq1VazWKxzznOeZSAJByDibly7Fc3smr9k9mzRs88nPXMroaLtIrLYazWeeM5zxLdo/w+kFBdveOcS3u2YHHClz1M8+5LDrGf2QXgoOWIAH1nc5LNgcgQFbHrxMI4dr/8rq/1p/aPpEZRfvoNYZs7B5Y8MTs2IveMO0Ud0QORUur0aYqGcgtWF/dJ6To2WC7Bx2RXg9NpjGxj8InXrzKJpbbXSc6ffdu2kqAA383pNp7YFnts3M37q91fSPCMVKw6ity9ZNqE5NZ6j0P9Jmqq36e51RjY6AEdT6S0deklRHWVWW11rUcMtitnj3fjzJPp9SbKS2o7VVsDEbAuPjOyEg862l3uuDaI3LvyCbNngPrF9kH/ACv/APRPTPSEo49HW6ah92nNKhAFG7cOp8Z2QhIAjMUqY0IAvSbMHQQgQfTCyx2LnbZt3KB1AzxmaNMpsNlp7RugBHCjyAloQOYaOtFZDl6ichG5CmPZUllRqYYQ+A4xLNyDJzUVD2TjHtOq/wDt/wBo1mjU6eutXdah3lB72fMysoTmmESRVRQqAKo6ASVmnD2dojtVZ4svj6jxloQrZkIQCVTuiSla+7FDTD3l9ZsxunzEyGYZUj4RQcgGNEXuj4cQhpza/wDYBvusDOmQ1ozpbB8P6yz1rn2LwiVndWjeagx5EExe8Zsz98fSED+B8jNg/dMyBsm/eEpJv3hEK2EIQJwHPTmV2IvX8YGwAe6JrVKKyevEf3a1k9zMQCesa09BIgNvkIuXbxMEHOY0BCuJkpFYY9IlUsIQlBCEIBKDgRB1EeSghCEiA+EIeMIBCEIBA9DCB6QCE0AmNt+MBITSCJkAiHgx4rdZYFlFwaj8JOUq7pEtVOEIQCEIQCUr7snKV9DFDxW7p9I0yZDRR4j4zU7g9Jn7zfWEbJ3jNFg/lP5SkwjIwfGFS0rbtNWf5cS05tAc6VR5Ej8Z0y31evRMPgfIzZjcqZENEXuiODkZijqR8YRsR+8I8R+CDEKITN3whKEhCEqnqGWz5THOWJjJ7qFvOTA6CBRRgQhCZQQhCArDHpFlIjDEsqshCaAScASgXvCPBa2BzxNII6yVGQhCQHiYQEIBCEIBNAycTJq96Bz/AGk5TTqA+xXbaxxngg5nn6RhVepquyWsCY29Vz1nf9p5NVQVQx7UYB6HrPOzZV+salAEvySOCCP3fSd+P+WL692IRg4nBd9pXCxqFoCWjBJZshR8pzLq9SbmUaoPYg95GrAH4c/jPP1ZLldueLZsevMfwkdJqRqaydux1OHU+Blm6SxkkpV1MnHq7/ymqFIwSJk1uHPrMgEIQgEpX4ycevxiikIQmQJ3fmZh7/qIJ+96wbvD6QjYQhCubR4AuT7thnTObTjbqtQvxBnTLfV69EIQkQJ3R8OJh75+Ignj6wbvD0MI2JZ4R4lnhEKSEZekJdTCQhNUZOOflK0569WzO6Gu5k34RlT3cDjr6xa9Wz7LA+mVCOUa7nP04kNO4S9wfbFrTopHCjH7wlFsNI09deouKHgnsfDHh7v95EdCarfp7rAFzXuHDbgcDPXictX2ja9la7tO25gCqhs8n48SjJWdPentDYLh7CyEEA446fCciXICgbWMQCNw7RyCPLG3+sDrbWaoMzey4ROHXtBnPhL2vY1VaBTVbacYByVHic+n5zxm7HeuPZ8c5x2mPn4/SdlyaZdFQGCBnyFYFsKM8nnmBbWazFdbUvtHaEbmzg49Ooi6bW2X6hay1LqQSdgYEcfGZcKzUG0916pjC4Yqg/DJPpJ0otrVg36o3YIb38bPPw/CB6XXiLZqk077GrsxkDft93n4x074/rF+0U36KweIGfpNTNyqo2opUkNdWCOoLCA1FDEKLqyT0AYTxdRWbbmsRq8Phv2ijkjnxj6HTt7XWWNeAc8OpP4GdP1zN0x7BGDiZGfqIp6TggHSEIQCEAwJIDAkdQD0grBlDKQwPQg5EAgenHWbiGD5QJajTpq1UOzrt5wp6yP6Jo+/Z9R/adW3I5EMHzM1OrEyPGetdLqtRWAxxh1zyWGP7gzlprvreu8ovvE7wM5w3n6cT1/tKkGg3A7bK+6fP4fOcD35pRq+9ZwvwPx9Jx6l3+vTxZef46/s3B1OoZemFUn4jP8AcTvPIM4NOyU1itOg6nxJ8zOiu0HksAPMnE3Jkcert1SNWffERXRyQjoxHUBgYy94es2jbO+Yse3vD0iQCEIQCPX1MSPX1MUUhCZMgXvH5Qf931gO/wDKa/T5iEEIQhXMox9oP/MgP9J0zms419R+8hH9Z0y1b9CEISIxe80G6r6wHfPpNfoPWEESzoI8SzpEKxYTF6wloWPV3/lElKuplVx2U3tqNQQ1a12DHPJPu4+Ua2uweyisAsmRnBwDt8fhLk5JMcdJEcqJqK1usZVstswNtbbQAOOpnI+n1jIV2ajkY51KkflPVhA8ldPrlCgLeFAwQNQB9PKdrLqbUrO2uphkHf77D0M6YQOG6vUJljl8DmxFy5+Cjwi00v2TNUhrcWbq1fr0AOfWehJxAdOR1lWPaVMFAJIIw3TPxkoDIOQcGVSaTTfqf+Joq358EHSC0PXrty1VLSB1CgHp9ZXtH+H0mglu8Zb1RucnMD0hA9DMIJK+/scfqrbM/wANc4lYlt1dK7rXCj4+MDn0T9pfqX2MmWXhxgjiS0Wpc6Wqqio2Mo94nhV585XRWC2/UuAwBZcBhg9IaWwU/ZaWEZCoTj5yjNVSl+srV03gVsQucZMh7J//AC//ANErqK69VqQHXIWndjPQk8Tm9m06abT3umQf2g3HJHn8oHVpdIq27m0PYlRkN2u7n0lPtFqhpttpXk+7v3Yz8uZHR6RDcNQtIrrAygLEk/HrLmqyioppiPeYlmsbO3MDxn7IsoHs4Gclh2mPQ5nLcRuevNbKp9wDdjnnjx4wevnPXewaenUVrcr2MNwsU+8eehlhut1Vl+mepXHu7DyXx4nyg1B9Kg+zTZntCQuMcDqI3YbAT+i1wPO4GW1NXbNSLWtQ2HBRLPdBAz5RbdMVvpq9q1JWzduzZ5CA2lZiVZdEtSOO+HXp9MzpnKNOKrq6lv1OMEj9ZwMY4xidR5zKqlvhJyl3UScQEIQgEevvRI9Xf+UBrLEprL2NhR4yH6R0n8X/ALT/AGkftOmy2ysGxUp8SxAwf6zz/ZW/i09cftB9Z1445s+aPdqdLlFlbZU9DGfuGcH2ZTZVZYBYr0+BUg5P9J3tyCPhOfUkuRBCYORmbMK5tSduo07fzEfWdM5tcdqVv92wGdMt8W+QQhCRGDvj0M1+6frM/eX1mtyp9IQRLOkYciY/diFIvWEwdYS1IyUr4UmTlF/Yn5y1pOUk5SSghCEiCEIQCIepjxG6mWKyEISgmg4MyECkIqnwjEgTKAdBFaqtnV2QFl6EjpGXkQgJXVsuts3Z7Qg4x0wMTn/R1WNvaXdnnPZ7/d+k64QJLQqtawY7rep8hjHEXT6OqgDguwGNzc8fDyl4QIV6YU2BqrHSvxr6j/aVsRLUKOoZT1EaGIHLboQ/upYK6jjci1jn5yl2lpvO50w33l4Mt6wgT1FC3hcu6FTkFDgyJ0Clgx1OpJXoe06fhOqB4EDlr0wruFnbWvgEYsO7rLryw9ZkavviaVtp94D4RIznLmLAIQhAIyHDiLGXvCByfbNidktWff3BsY8OZx/8J7B/8j5+f06T2wSOvIm7x/4Jvn8mTB5/2NYnZNVn39xbGPDiegOcxWYkccCPM9df6uoRe6PSNFXp8zGmFc+uGdK/wwfxl1O5Qw8RmT1K7tPYP5TDTNu09Z/lEv0v0rCEJEYfA/GNEbp8xHhCKw2jkdJjkbeojbl8j9IblHgfpAlkecJTen/ghNamJSg/Yycov7I/OK0nKScoOgkoIQhIghCEAiv4RpjdICQhCaUQhCAQhA8AnygMp5xGkkYOodc4PPMqORJQQkjqqFJBs5HHQzPbNP8AxPwMZTFoQhIghCEAik4PEaIeplgYMPHiYzZ4EWEuKJSrxMnKLxUT5xQh5OfOZCEAi2OK13MGPBPCk/kOI0jqveCJsVy5IANYY5x4ZIxA1dTWaRa25QVBwVP0BxzGovV3RSGSwjJRlPH4TnoU1g1Csq1YXJStA3wOSxEmtlqO9w7Ut2orOQmMZHHr6cSI7L/tDT1F0Ng7RfDaesj+lKPZt29e22Z27TjdjpOjV3CunG3L2e6qE9SZlpWqqqg15Wz9WQD0GICV/aGmtVV7Ub2HI2nrMs+1tKqgo+85HGCP6S9V9TOaaiTsHJHIHwzOW46i9rNnZGmrAPaZ7w5J4gM32ppVI2vuy3PBGB59J0UaqjUEil9xHJ4InH2up1TVhUpyqrb7+4YPPkZ16S2y1H7UIGRyp2Zxx6wLMNylT4jEhoTnSp8Mj8Z0Tm0Q2pYv3bCI+mp46YQhIhW6fOPEbpNssWpNzZx8BCMXp8zB+6YtNi2oSucAkciYXdndFQELjJLY/pAyEViyldyDDMF4b/aE0mNjK+MJjvk8+XEWI7FXTC554itHjr0iDpzNBxFDwmbhNyD4zKCEIQCB6QhAnCaepmTSiEIQCY3db0M2DA7W9DA56XtFKAU5GODvAzOip2K++mw56ZzE04/UJ6QvJWlyMggdZb8qSm7YHXs7G988quR1hqL91Dr2VoyOpXiDI1YRhbafeHBbiMENt1v62xQCMBWx4R8ejoXoIhci9UwMFSYmnG+llclhuK8nwkzpKu3UCs7NpzyesmRHXMmIi1qFQYAmzKA9JOVAyYwUDwlghCdBAPUSTpt5HSVSSjjFYEQDJAj2n3gIE4QhAJDVJvs064U5c99cjofCXmgkdCYHJpxWH1B31iv3PerOxfHyP9YaeiuwO2XK9sWU7zggY5+M68nzMM88wjn1lIF1VxYsxuQDP7o8hJayuwtS2rtXszZgqowBx5z0HrSzbvGdrBh6ia6K67XUMPIjImRyG+tbKKNK9eGY7gmDgYkGrS6xaNIzAAbbXB4I8j5meglNVZzXUiHzVQI9YABwAOT0Eo4LsV610F66f9Uu1jjHBPnH0DAPbWri1R7zWDxYzqtqrscdpWj4HG5QZqIlYwiKo8lGIDTn0nW//qtOic2k79//AFDH01PK6YQhIhW7seI3dM2xO0TbuZfipwYRHTdLcfxGk3U9s29EbIB3dkW/rKU6cVtuFlh5OQW4Ms2dpxjPxGYHLtQMvCKdwwewYc/WEcqWK7mGAc4C45+sJRsesAk5AOOREj1H3vWVSnqfWNtHlMfhjGXoJKM2iGwec2EiF2kdDN94fGbCBm7zE0EHxh1mFfKUY/WLNIImSxRCEIAyhlKsMg9ZL2Wj+H+JlYS6Jey0fw/xM0UVBWVV27hg4MpCNpqQ01IIIUgg5zma2nqdyzLkn4yuD5GZG00Uota7FyBnPMpJzQSJmwPCYG85oOZEDVpbUUcZVuonm2M+j9probaFZWHGeD6/Keoh8Jw6xV9tVRbsa1QpBrDA8+OZ1/HfpY4v0jq/4v8A2j+09PQWWX6Tfa24knBxjic92jNNTWPdXtXy06zq0rj2NGDbhg4O0L4+Qmu7zefiBq++IWHLmbV3vlMfvH1nILCEIBCEIBCEIFpswdBNmQQTofWExOresIG749DNmN3h85sAnNpP2moH/uGdM5tJ+11H+eWeNTyumEISIV+6fSPEbun0jwhV6H1P5wgvj6mbCowgesJazGTQcEHymQlaUtHQzE6TQN1WPKKvWRDTnv1qUuyGu1tgBYquQM/OdE8/U/tdSD3Cat58l5zIOhtYAcDTalh5ivI/OZXrVe5auwvVj95MYHn16RLm1DW6g13italBC7Ac8Z6zamZtYrcFjpgefPMotXqEc2Bv1bVn3gx6Dz9IrayhbUQWVkMDlt4wuJz22WPptWty1h0UDKA8gjPjJO9HtFJGhsAw2V7Ee908PGB6JtU1M9WLceCsDk+UKrEvrFicg/hOXSFzRcdOio3bHC2AjAwPAR6qzq6KrTZZSSORU20dYFK37Q2AKRscr1zmJqNVVptgsPeP0Hiek5tHQlpu26q8EWHhbMEjzMrrx2OmpHbMNto/WN7xHXn4wNTXaey4Vq+crndg9fLGJg1qPxTVbb8QMD6yent7XUWt7R2+KT72zbjnpCnU3pTQnspO5QFPagZ4/CUehtEA9KPtaxA/kSMzE7y5GPMZkftKpfZ3tVALFIO4DmJNuVXZMZQ3UTw9XqLl1L7brApOQAxHB5jaG6+3V1qbrCM5ILE8Tp+q5umPWKYMUjHWVfqIs5aicI+0E8cTjXWo4ylGpYea15H5y6rq3Ecxt6MwZ0G4dCR0kmtVXqVgwNvQY6cZ5jQKsysCCNwPhiTbwAAAA4A8JJtTXXelJLb36YHEa61aq2tfO1RzgcwiiHDibYMN6yVVi3VLZWcqenwjC5LrHRQQayAc/GFEJzLrkZdy06gr94V8fnLVW13JurYMPygPCEIBCEIFl7omzF7omzIJi9WmzF7x9BCBuq+s2Y/7vrNgE5tL+21H+edM5tL+31H+eWeNTyumEISIVu6fSb2i9p2fjjMxu6fST2L7X0/d3dfHMIqPH1mzB1PrNhUm7xhB+8YS1ksIQlaPUfeI85hG1vSYDtIMe0cgwM3CcNxta/VJVUH3oqklsbeDOuGBknAyepxyYwcz6W0do3tS1Vsqq2VBzgY8ek2hqzrcJYrqmnClgeOs6CAQQQCD1BGQZtSVoCERUz12qBmRHn2Xo66rqouA7MsMBsDHWabbmsrsOo0OUBAG8+M9EorLtZQV8iOIns2n/gVf6BA5tJetddzW2VljYWxWc5zjGJOm4pp00pdaXUYdnIGPTznelVdedlaLnyUCD1V2ftK0fH3lBgclo03Zp2GoqrsrHuMHH0MXUtZetHZ2jtMg7a1DDI6nPwzOr2XT/wACr/QJRFVF2ooVfIDAgebqK9WlljNa1hKbFIrGGB8PhyZ02J2dmkTwUkfRZ1wgTBwQfKPeFfTuCCVKnu9flFZfETFYr05HlKrm0dAvoDi7U1gHAHaflxNq/V/aAp36h8DOWfKnjynX2w+6Yby3HSavfo1jlvSZCE5o0dZ5mgt1C6ULXpe0XJ97tAM8+U9MdZ5+l9r09Iq9k3YJOe1USimqH/F6TjHvN+U6PXic+pS9n01qU7mTJZN4GMgeMy5tXbTYg0uxiuAe1U/+cQOYtVdRfcbUWxm3ICwBAXp/WX1dgt+zHsHRlB/ESy6ahFC9jWdoxkoOZznTWjR6ihVBBbNfvDkZBxKNUeyagDpRd/2t/vLaIZ1WrH86/lGtqW2o1P0Ix6RPsym6pru3xuYjByDnHjIE+zf8GnqfzgRs+0ht47Sslh8QesTTjV6ekVeygkE+8bQPwlqKXWxrrmDWsMe70UeQlFoQhCiEIQKp3RGip3RGmQTB3z6TZg749IRr9B6wg/dhAJzaX/Ean/MP6zpnNpv8Tqf8w/rLPGp5XTCEJEY3dPpNCjdvx72MZ+Exu6fSMOkIUdT6zZg6t6zYVN+9CFnWEqEhKnbYgdCDkZBHjJSqJTvVfEScpUeSPOKJwmsMMRMgEdRgQUeJmyVBCEJAQhCAQhCAQhCARWXxEaECc0HBzNYYOYs0qkJiHwmzKCEIQCEIQMYZ5ESUisMGWKWMhwwiwlD2DD+sSWZd4BziL2X834QJwlOy/m/CHZfzfhGicJTsv5vwh2X834QNr7saYqFfHPym4Oeox6TKCZ+8JpB8CPpDb056QB+4fSE08gxR0EDZzaf/ABOp9VnTOej/ABWo9V/KWNTyuiEISIxu6fSMOkVu6fSMOkIUdW9ZswdW9ZsKSzwhCzpCVH//2Q==' },\n      { name: '维度', type: 'number', value: 40.03190424323978 },\n      { name: '经度', type: 'number', value: 116.41731465378871 },\n      { name: '位置信息', type: 'string', value: '奥运村街道麦当劳(上品奥运村店)上品+(奥运村店)' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendRichContentMessage = {\n    name: '发送富文本消息',\n    event: Service.sendRichContentMessage,\n    eventName: 'sendMessage',\n    desc: '发送富文本(图文)消息(sendRichContentMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web3.html#ImgTextMsg',\n    params: [\n      { name: '图文标题', type: 'string', value: '标题: 融云' },\n      { name: '图文内容', type: 'string', value: '为用户提供 IM 即时通讯和音视频通讯云服务' },\n      { name: '图片信息', type: 'string', value: 'https://www.rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '图文链接', type: 'string', value: 'https://developer.rongcloud.cn' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var getUnreadCount = {\n    name: '获取会话未读数',\n    event: Service.getUnreadCount,\n    eventName: 'getUnreadCount',\n    desc: '获取指定会话未读数',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/conversation/unreadcount/web3.html#clear',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getTotalUnreadCount = {\n    name: '获取会话未读数总数',\n    event: Service.getTotalUnreadCount,\n    eventName: 'getTotalUnreadCount',\n    desc: '获取会话未读总数',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/conversation/unreadcount/web3.html#total',\n    params: [\n    ]\n  };\n\n  var clearUnreadCount = {\n    name: '清除会话未读数',\n    event: Service.clearUnreadCount,\n    eventName: 'clearUnreadCount',\n    desc: '清除指定会话未读数',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/conversation/unreadcount/web3.html#clearcode',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var joinChatRoom = {\n    name: '加入聊天室',\n    event: Service.joinChatRoom,\n    eventName: 'joinChatRoom',\n    desc: '加入指定聊天室, 并拉取消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/basic/join/web3.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '拉取消息数', type: 'number', value: 2 }\n    ]\n  };\n\n  var joinExistChatRoom = {\n    name: '加入已存在的聊天室',\n    event: Service.joinExistChatRoom,\n    eventName: 'joinExistChatRoom',\n    desc: '加入已存在的聊天室，若聊天室不存在，则加入失败',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/basic/join/web3.html#jion-exist',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '拉取消息数', type: 'number', value: 2 }\n    ]\n  };\n\n  var quitChatRoom = {\n    name: '退出聊天室',\n    event: Service.quitChatRoom,\n    eventName: 'quitChatRoom',\n    desc: '退出聊天室',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/basic/quit/web3.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getChatRoomInfo = {\n    name: '获取聊天室信息',\n    event: Service.getChatRoomInfo,\n    eventName: 'getChatRoomInfo',\n    desc: '获取聊天室信息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/basic/info/web3.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '获取人数', type: 'number', value: 20 },\n      { name: '排序方式', type: 'number', value: 1 }\n    ]\n  };\n\n  var getChatRoomHistoryMessages = {\n    name: '获取聊天室历史消息',\n    event: Service.getChatRoomHistoryMessages,\n    eventName: 'getChatRoomHistoryMessages',\n    desc: '获取聊天室历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/msgmanage/storage/web3.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '获取时间', type: 'number', value: 0 },\n      { name: '获取个数', type: 'number', value: 20 },\n      { name: '排序方式', type: 'number', value: 0 }\n    ]\n  };\n\n  var setChatRoomEntry = {\n    name: '设置聊天室属性',\n    event: Service.setChatRoomEntry,\n    eventName: 'setChatRoomEntry',\n    desc: '设置聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/key/set/web3.html',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '属性 value', type: 'string', value: '我是一个聊天室 value' },\n      { name: '是否退出清除', type: 'boolean', value: true },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var forceSetChatRoomEntry = {\n    name: '设置聊天室属性(强制)',\n    event: Service.forceSetChatRoomEntry,\n    eventName: 'forceSetChatRoomEntry',\n    desc: '强制设置聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/key/set/web3.html#force',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey2' },\n      { name: '属性 value', type: 'string', value: '我是一个聊天室 value' },\n      { name: '是否退出清除', type: 'boolean', value: true },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var removeChatRoomEntry = {\n    name: '删除聊天室属性',\n    event: Service.removeChatRoomEntry,\n    eventName: 'removeChatRoomEntry',\n    desc: '删除聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/key/remove/web3.html#del',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var forceRemoveChatRoomEntry = {\n    name: '删除聊天室属性(强制)',\n    event: Service.forceRemoveChatRoomEntry,\n    eventName: 'forceRemoveChatRoomEntry',\n    desc: '强制删除聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/key/remove/web3.html#forcedel',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey2' },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getChatRoomEntry = {\n    name: '获取聊天室属性',\n    event: Service.getChatRoomEntry,\n    eventName: 'getChatRoomEntry',\n    desc: '获取指定聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/key/query/web3.html',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getAllChatRoomEntries = {\n    name: '获取聊天室属性(所有)',\n    event: Service.getAllChatRoomEntries,\n    eventName: 'getAllChatRoomEntries',\n    desc: '获取所有聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/chatroom/manage/key/query/web3.html#getall',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var sendChatRoomMessage = {\n    name: '发送聊天室消息',\n    event: Service.sendChatRoomMessage,\n    eventName: 'sendMessage',\n    desc: '发送聊天室消息, 以文本消息为例(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/message-send/#example',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条聊天室的文字消息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var joinRTCRoom = {\n    name: '加入 RTC 房间',\n    event: Service.joinRTCRoom,\n    eventName: 'rtc.join',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: '模式', type: 'number', value: 0 }\n    ]\n  };\n\n  var pingRTCRoom = {\n    name: 'Ping RTC',\n    event: Service.pingRTCRoom,\n    eventName: 'rtc.ping',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setRTCData = {\n    name: '设置 RTC 数据',\n    event: Service.setRTCData,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: 'key', type: 'string', value: 'key' },\n      { name: 'value', type: 'string', value: 'value' },\n      { name: 'isInner', type: 'boolean', value: false },\n      { name: 'apiType', type: 'number', value: 1 }\n    ]\n  };\n\n  var getRTCData = {\n    name: '获取 RTC 数据',\n    event: Service.getRTCData,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: 'key', type: 'string', value: 'key' },\n      { name: 'isInner', type: 'boolean', value: false },\n      { name: 'apiType', type: 'number', value: 1 }\n    ]\n  };\n\n  var removeRTCData = {\n    name: '删除 RTC 数据',\n    event: Service.removeRTCData,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: 'key', type: 'string', value: 'key' },\n      { name: 'isInner', type: 'boolean', value: false },\n      { name: 'apiType', type: 'number', value: 1 }\n    ]\n  };\n\n  var getRTCToken = {\n    name: '获取 RTC Token',\n    event: Service.getRTCToken,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getRTCRoomInfo = {\n    name: '获取 RTC 房间信息',\n    event: Service.getRTCRoomInfo,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setRTCUserInfo = {\n    name: '设置 RTC 人员信息',\n    event: Service.setRTCUserInfo,\n    eventName: 'rtc.getRTCUserInfoList',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getRTCUserInfoList = {\n    name: '获取 RTC 人员列表',\n    event: Service.getRTCUserInfoList,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var removeRTCUserInfo = {\n    name: '删除 RTC 人员信息',\n    event: Service.removeRTCUserInfo,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var quitRTCRoom = {\n    name: '退出 RTC 房间',\n    event: Service.quitRTCRoom,\n    eventName: 'rtc.quit',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  win.RongIM = win.RongIM || {};\n  \n  var DefailtReadyApiQueue = [\n    [disconnect, reconnect],\n    [getConversationList, removeConversation, setConversationStatus, getUnreadCount, getTotalUnreadCount, clearUnreadCount],\n    [sendTextMessage, sendImageMessage, sendRecallMessage, sendFileMessage, sendVoiceMessage, sendRegisterMessage, sendAtMessage, /*sendAtMessageByErrorParamField,*/ sendLocationMessage, sendRichContentMessage],\n    [getHistoryMessages, deleteRemoteMessages, clearHistoryMessages],\n    [joinChatRoom, joinExistChatRoom, getChatRoomInfo, sendChatRoomMessage, getChatRoomHistoryMessages],\n    [setChatRoomEntry, getChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, removeChatRoomEntry, forceRemoveChatRoomEntry],\n    [quitChatRoom],\n    [joinRTCRoom, pingRTCRoom, setRTCData, getRTCData, removeRTCData, getRTCToken, getRTCRoomInfo, getRTCUserInfoList, setRTCUserInfo, removeRTCUserInfo],\n    [quitRTCRoom],\n  ];\n  urlQueryConfig.isMini && utils.forEach(DefailtReadyApiQueue, function (list, i) {\n    utils.forEach(list, function (item, j) {\n      if (MiniUnSupportEventList.indexOf(item.eventName) !== -1) {\n        list.splice(j, 1);\n      }\n    }, { isReverse: true })\n  });\n  win.RongIM.DefailtReadyApiQueue = DefailtReadyApiQueue;\n  \n  win.RongIM.ApiList = [\n    getConversationList\n  ];\n\n  window.RongIM.Api = {\n    changeUser: changeUser\n  }\n\n})(window, {\n  RongIM: RongIM\n});"
  },
  {
    "path": "api-test/js/common/service.js",
    "content": "(function(win) {\n  var RongIMLib = win.RongIMLib,\n    RongIM = win.RongIM,\n    RongIMClient = RongIMLib.RongIMClient,\n    utils = RongIM.Utils;\n\n  var im;\n\n  // var sendMsgTimeout = RongIM.config.isDebug ? 300 : 0;\n\n  var selfUserId;\n\n  // 缓存消息, 用作撤回、删除等操作的参数\n  var CacheMsg = {\n    eventEmitter: new utils.EventEmitter(),\n    _list: [],\n    set: function (msg) {\n      this._list.push(msg);\n      this.eventEmitter.emit('msgChanged');\n    },\n    remove: function (msg) {\n      var list = this._list;\n      utils.forEach(list, function(child, index) {\n        if (child.messageUId === msg.messageUId) {\n          list.splice(index, 1);\n        }\n      }, { isReverse: true });\n      this.eventEmitter.emit('msgChanged');\n    },\n    getLast: function () {\n      var list = this._list, length = list.length;\n      var msg = {};\n      if (length) {\n        msg = list[length - 1];\n      }\n      return msg;\n    }\n  };\n\n  /**\n   * 初始化以及链接\n   * @param {object} config \n   * @param {string} config.appkey 融云颁发的 appkey\n   * @param {string} config.token 融云颁发的 token(代表某一个用户)\n   * @param {Object} watcher \n   * @param {Object} watcher.status 监听链接状态的变化\n   * @param {Object} watcher.message 监听消息的接收\n   */\n  function init(config, watcher) {\n    watcher = watcher || {};\n    config = utils.clearUndefKey(config);\n    config = utils.copy(config);\n    var navi = config.navi;\n    if (config.isPolling) {\n      config.connectType = 'comet';\n    }\n    if (navi) {\n      var navigators;\n      navi = navi.replace(/\\s/g, '');\n      if (navi.indexOf(',') !== -1) {\n        navigators = navi.split(',');\n      } else {\n        navigators = [navi];\n      }\n      config.navigators = navigators;\n    }\n    // config.customCMP = ['120.92.13.84:80']\n    // config.isDebug = true;\n    im = RongIMLib.init(config);\n    \n    im.watch({\n      conversation: function (event) {\n        console.log('watch conversation', event);\n      },\n      message: function (event) {\n        var message = event.message;\n        var hasMore = event.hasMore;\n        watcher.message(message);\n        console.warn('received messages', event);\n        // message.xxx.xxx;\n      },\n      status: function (event) {\n        var status = event.status;\n        console.log('status changed', event);\n        // 不处理的状态码\n        var unHandleStatus = [];\n        if (unHandleStatus.indexOf(status) === -1) {\n          watcher.status(status);\n        }\n      },\n      chatroom: function (event) {\n        console.warn('chatroom', event);\n        var updatedEntries = event.updatedEntries;\n        watcher.chatroom(updatedEntries);\n      }\n    });\n    if(!config.customCMP){\n      delete config.customCMP;\n    }\n    \n    return im.connect(config);\n  }\n\n  /**\n   * 断开链接\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/connect/#disconnect\n   */\n  function disconnect() {\n    return im.disconnect();\n  }\n\n  function changeUser(config) {\n    return im.changeUser(config);\n  }\n\n  /**\n   * 重新链接\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/connect/#reconnect\n   */\n  function reconnect() {\n    return im.reconnect();\n  }\n\n  /**\n   * 获取会话列表\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/get-list/\n   *\n   * @param {number} count 获取会话的数量\n   */\n  function getConversationList(count) {\n    return im.Conversation.getList({\n      count: count\n    });\n  }\n\n  /**\n   * 删除会话列表\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/remove/\n   */\n  function removeConversation(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return im.Conversation.remove({\n      type: conversationType,\n      targetId: targetId\n    });\n  }\n\n  /**\n   * 获取历史消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-list/get-list/\n   * \n   * @param {number} timestrap 时间戳\n   * @param {number} count 数量\n   */\n  function getHistoryMessages(timestrap, count, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    count = Number(count);\n    timestrap = Number(timestrap);\n    \n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.getMessages({\n      timestrap: timestrap,\n      count: count\n    });\n  }\n\n  /**\n   * 按时间删除历史消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-list/remove-list/#_1\n   *\n   * @param {number} timestrap 时间戳\n   */\n  function clearHistoryMessages(timestamp, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    timestamp = Number(timestamp);\n    \n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.clearMessages({\n      timestrap: timestamp\n    });\n  }\n\n  /**\n   * 按消息删除历史消息\n   * @param {string} messageUId 消息在 server 的唯一标识\n   * @param {number} sentTime 消息发送时间\n   * @param {number} messageDirection 消息方向\n   */\n  function deleteRemoteMessages(messageUId, sentTime, messageDirection, conversationType, targetId) {\n    var lastMsg = CacheMsg.getLast() || {};\n    conversationType = Number(conversationType) || lastMsg.type;\n    sentTime = Number(sentTime) || lastMsg.sentTime;\n    messageDirection = Number(messageDirection) || lastMsg.direction;\n    \n    var deleteMsg = { \n      messageUId: messageUId,\n      sentTime: sentTime,\n      messageDirection: messageDirection\n    };\n    var messages = [ deleteMsg ];\n\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.deleteMessages(messages);\n  }\n\n  /**\n   * 获取指定会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#get-one\n   * \n   * @param {number} conversationType 会话类型\n   * @param {string} targetId 目标 id (对方 id、群组 id、聊天室 id 等)\n   */\n  function getUnreadCount(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.getUnreadCount()\n    // console.log(conversationType, targetId);\n    // return utils.Defer.resolve('TODO');\n  }\n\n  /**\n   * 获取所有会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#get-all\n   */\n  function getTotalUnreadCount() {\n    return im.Conversation.getTotalUnreadCount();\n  }\n\n  /**\n   * 清除指定会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#clear\n   */\n  function clearUnreadCount(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.read();\n  }\n\n  function sendMessage(conversationType, targetId, msg) {\n    conversationType = Number(conversationType);\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.send(msg).then(function (msg) {\n      CacheMsg.set(msg);\n      return msg;\n    });\n  }\n\n  /**\n   * 发送文本消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#text\n   * 注意事项:\n   *    1: 单条消息整体不得大于128K\n   *    2: conversationType 类型是 number，targetId 类型是 string\n   * \n   * @param {string} text 文字内容\n   * @param {number} conversationType 会话类型\n   * @param {string} targetId 目标 id (对方 id、群组 id、聊天室 id 等)\n   * @param {booleam} disableNotification 是否推送消息\n   */\n  function sendTextMessage(text, conversationType, targetId, isStatusMessage, disableNotification) {\n    var content = {\n      content: text // 文本内容\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:TxtMsg',\n      isStatusMessage: isStatusMessage,\n      disableNotification: disableNotification\n    });\n  }\n\n  /**\n   * 发送图片消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#image\n   * 注意事项:\n   *    1. 略缩图(content 字段)必须是 base64 字符串, 类型必须为 jpg\n   *    2. base64 略缩图必须不带前缀\n   *    3. base64 字符串大小不可超过 100 k\n   *    4. 可通过 FileReader 或者 canvas 对图片进行压缩, 生成压缩后的 base64 字符串\n   * imageUri 为上传至服务器的原图 url, 用来展示高清图片\n   * 上传图片需开发者实现. 可参考上传插件: https://docs.rongcloud.cn/im/imlib/web/plugin/upload\n   * \n   * @param {string} base64 图片 base64 缩略图\n   * @param {string} imageUri 图片上传后的 url\n   */\n  function sendImageMessage(base64, imageUri, conversationType, targetId, disableNotification) {\n    var content = {\n      content: base64, // 压缩后的 base64 略缩图, 用来快速展示图片\n      imageUri: imageUri // 上传到服务器的 url. 用来展示高清图片\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:ImgMsg',\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送文件消息\n   * 文档：https://docs.rongcloud.cn/im/imlib/web/message-send/#file\n   * \n   * @param {string} fileName 文件名\n   * @param {string} fileSize 文件大小\n   * @param {string} fileType 文件类型\n   * @param {string} fileUrl 文件上传后的 url\n   */\n  function sendFileMessage(fileName, fileSize, fileType, fileUrl, conversationType, targetId, disableNotification) {\n    var content = {\n      name: fileName, // 文件名\n      size: fileSize, // 文件大小\n      type: fileType, // 文件类型\n      fileUrl: fileUrl // 文件地址\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:FileMsg',\n      disableNotification\n    });\n  }\n\n  /**\n   * 高质量语音消息: https://docs.rongcloud.cn/im/introduction/message_structure/#hqvoice_message\n   * 注意事项:\n   *   融云不提供声音录制的方法. remoteUrl 的生成需开发者实现\n   * \n   * @param {string} remoteUrl 语音上传后的 url\n   * @param {number} duration 语音时长\n   */\n  function sendVoiceMessage(remoteUrl, type, duration, conversationType, targetId, disableNotification) {\n    var content = {\n      remoteUrl: remoteUrl, // 音频 url, 建议格式: aac\n      duration: duration, // 音频时长\n      type: type\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:HQVCMsg',\n      disableNotification\n    });\n  }\n\n  /**\n   * 撤回消息: https://docs.rongcloud.cn/im/imlib/web/message-send/#recall\n   * 注意事项:\n   *   消息撤回操作服务器端没有撤回时间范围的限制，由客户端决定\n   *\n   * @param {string} messageUId 撤回的消息 Uid\n   * @param {number} sentTime 撤回的消息 sentTime\n   */\n  function sendRecallMessage(messageUId, sentTime, conversationType, targetId, disableNotification) {\n    var recallMsg;\n    if (messageUId && sentTime && conversationType && targetId) {\n      recallMsg = {\n        messageUId: messageUId,\n        sentTime: sentTime,\n        disableNotification: disableNotification\n      };\n    } else {\n      var lastMsg = CacheMsg.getLast() || {};\n      recallMsg = lastMsg;\n      recallMsg.disableNotification = disableNotification;\n    }\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId,\n      \n    }).recall(recallMsg);\n  }\n\n  /**\n   * 发送 @ 消息(此处以文本消息举例)\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#example\n   * \n   * @param {string} text 文字内容\n   * @param {string} methiondId @ 对象的 id\n   */\n  function sendAtMessage(text, methiondId, conversationType, targetId, disableNotification) {\n    conversationType = Number(conversationType);\n\n    var isMentioned = true;\n\n    var content = {\n      content: text\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      content: content,\n      messageType: 'RC:TxtMsg',\n      isMentioned: isMentioned,\n      mentionedUserIdList: [methiondId], // @ 人 id 列表\n      mentionedType: 2,\n      disableNotification\n    });\n  }\n\n  //测试错误参数下发送 @  消息\n  function sendAtMessageByErrorParamField(text, methiondId, conversationType, targetId, disableNotification) {\n    conversationType = Number(conversationType);\n\n    var isMentioned = true;\n\n    var content = {\n      content: text\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      content: content,\n      messageType: 'RC:TxtMsg',\n      isMentiond: isMentioned,\n      mentiondUserIdList: [methiondId], // @ 人 id 列表\n      mentiondType: 1,\n      disableNotification\n    });\n  }\n\n  /**\n   * 注册自定义消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#custom\n   *\n   * @param {string} messageName 注册消息的 Web 端类型名\n   * @param {string} messageType 注册消息的唯一名称. 注: 此名称需多端一致\n   * @param {boolean} isCounted 是否计数\n   * @param {boolean} isPersited 是否存储\n   * @param {Array<string>} props 消息包含的字段集合\n   */\n  function registerMessage(/* messageName, messageType, isCounted, isPersited, props */) {\n    // var mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited); //true true 保存且计数，false false 不保存不计数。\n    // props = props.split(','); // 将字符串截取为数组. 此处为 Demo 逻辑, 与融云无关\n    // RongIMClient.registerMessageType(messageName, messageType, mesasgeTag, props);\n    // 废弃此概念\n    return utils.Defer.resolve();\n  }\n\n  /**\n   * 发送自定义消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#custom\n   * \n   * @param {string} messageType 注册消息的 Web 端类型名\n   * @param {*} props 消息包含的字段集合\n   */\n  function sendRegisterMessage(messageType, props, conversationType, targetId, disableNotification) {\n    var content = props.split(',');\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: messageType,\n      content: {\n        content: content\n      },\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送位置消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#location\n   * 注意事项:\n   *   1. 缩略图必须是base64码的jpg图, 而且不带前缀\"data:image/jpeg;base64,\", 不得超过100K\n   *   2. 需要开发者做显示效果, 一般显示逻辑: 图片加链接, 传入经纬度并跳转进入地图网站\n   * \n   * @param {string} base64 位置缩略图\n   * @param {number} latitude 维度\n   * @param {number} longitude 经度\n   * @param {string} poi 位置信息\n   */\n  function sendLocationMessage(base64, latitude, longitude, poi, conversationType, targetId, disableNotification) {\n    var content = {\n      latitude: latitude,\n      longitude: longitude,\n      poi: poi,\n      content: base64\n    };\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: 'RC:LBSMsg',\n      content: content,\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送富文本(图文)消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#rich-content\n   *\n   * @param {string} title 图文标题\n   * @param {number} content 图文内容\n   * @param {number} imageUri 显示图片的 url(图片信息)\n   * @param {string} url 点击图文后打开的 url\n   */\n  function sendRichContentMessage(title, content, imageUri, url, conversationType, targetId, disableNotification) {\n    content = {\n      title: title,\n      content: content,\n      imageUri: imageUri,\n      url: url\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: 'RC:ImgTextMsg',\n      content: content,\n      disableNotification\n    });\n  }\n\n  /**\n   * 加入聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#join\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {number} count 拉取消息数量\n   */\n  function joinChatRoom(chatRoomId, count) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).join({\n      count: count\n    });\n  }\n\n  /**\n   * 加入已存在的聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#join\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {number} count 拉取消息数量\n   */\n  function joinExistChatRoom(chatRoomId, count) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).joinExist({\n      count: count\n    });\n  }\n\n  /**\n   * 退出聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#quit\n   *\n   * @param {string} chatRoomId 聊天室 id\n   */\n  function quitChatRoom(chatRoomId) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).quit();\n  }\n\n  /**\n   * 获取聊天室信息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#get\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {string} count 获取人数\n   * @param {string} order 排序方式\n   */\n  function getChatRoomInfo(chatRoomId, count, order) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getInfo({\n      count: count,\n      order: order\n    });\n  }\n\n  function getChatRoomHistoryMessages(chatRoomId, timestrap, count, order) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getMessages({\n      timestrap: timestrap,\n      count: count,\n      order: order\n    });\n  }\n\n  /**\n   * 发送聊天室消息(以文本消息为例)\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#text\n   *\n   * @param {string} text 文字内容\n   */\n  function sendChatRoomMessage(text, targetId) {\n    var content = {\n      content: text // 文本内容\n    };\n    return im.ChatRoom.get({\n      id: targetId\n    }).send({\n      messageType: 'RC:TxtMsg',\n      content: content\n    })\n  }\n\n  function setChatRoomEntry(key, value, isAutoDelete, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      value: value,\n      notificationExtra: extra,\n      isAutoDelete: isAutoDelete,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).setEntry(entry);\n  }\n\n  function forceSetChatRoomEntry(key, value, isAutoDelete, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      value: value,\n      notificationExtra: extra,\n      isAutoDelete: isAutoDelete,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).forceSetEntry(entry);\n  }\n\n  function removeChatRoomEntry(key, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      notificationExtra: extra,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).removeEntry(entry);\n  }\n\n  function forceRemoveChatRoomEntry(key, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      notificationExtra: extra,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).forceRemoveEntry(entry);\n  }\n\n  function getChatRoomEntry(key, chatRoomId) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getEntry(key);\n  }\n\n  function getAllChatRoomEntries(chatRoomId) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getAllEntries();\n  }\n\n  function joinRTCRoom(roomId, mode) {\n    return im.RTC.get({\n      roomId: roomId,\n      mode: mode\n    }).join();\n  }\n\n  function pingRTCRoom(roomId, mode) {\n    return im.RTC.get({\n      roomId: roomId\n    }).ping();\n  }\n\n  function setRTCData(roomId, key, value, isInner, apiType, message) {\n    return im.RTC.get({\n      roomId: roomId\n    }).setData(key, value, isInner, apiType, message);\n  }\n\n  function getRTCData(roomId, key, isInner, apiType) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getData([key], isInner, apiType);\n  }\n\n  function removeRTCData(roomId, key, isInner, apiType) {\n    return im.RTC.get({\n      roomId: roomId\n    }).removeData([key], isInner, apiType);\n  }\n\n  function getRTCToken(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getToken();\n  }\n\n  function getRTCRoomInfo(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getRoomInfo();\n  }\n\n  function getRTCUserInfoList(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getUserInfoList();\n  }\n\n  function setRTCUserInfo(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).setUserInfo({\n      key: 'test',\n      value: 'test hahahah'\n    });\n  }\n\n  function removeRTCUserInfo(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).removeUserInfo({\n      key: 'test'\n    });\n  }\n\n  function quitRTCRoom(roomId, mode) {\n    return im.RTC.get({\n      roomId: roomId,\n      mode: mode\n    }).quit();\n  }\n\n  function setConversationStatus(isNotification, isTop, conversationType, targetId) {\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).setStatus({\n      notificationStatus: isNotification,\n      isTop: isTop\n    });\n  }\n\n  function getLastCacheMsgUId() {\n    return CacheMsg.getLast().messageUId;\n  }\n  function getLastCacheMsgSentTime() {\n    return CacheMsg.getLast().sentTime;\n  }\n  function getLastCacheMsgDirection() {\n    return CacheMsg.getLast().direction;\n  }\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.Service = {\n    init: init,\n    disconnect: disconnect,\n    reconnect: reconnect,\n\n    registerMessage: registerMessage,\n    sendRegisterMessage: sendRegisterMessage,\n\n    getConversationList: getConversationList,\n    removeConversation: removeConversation,\n\n    getHistoryMessages: getHistoryMessages,\n    clearHistoryMessages: clearHistoryMessages,\n    deleteRemoteMessages: deleteRemoteMessages,\n\n    sendTextMessage: sendTextMessage,\n    sendImageMessage: sendImageMessage,\n    sendFileMessage: sendFileMessage,\n    sendVoiceMessage: sendVoiceMessage,\n    sendAtMessage: sendAtMessage,\n    sendAtMessageByErrorParamField: sendAtMessageByErrorParamField,\n    sendLocationMessage: sendLocationMessage,\n    sendRichContentMessage: sendRichContentMessage,\n    sendRecallMessage: sendRecallMessage,\n    \n    getUnreadCount: getUnreadCount,\n    getTotalUnreadCount: getTotalUnreadCount,\n    clearUnreadCount: clearUnreadCount,\n\n    joinChatRoom: joinChatRoom,\n    joinExistChatRoom: joinExistChatRoom,\n    quitChatRoom: quitChatRoom,\n    getChatRoomInfo: getChatRoomInfo,\n    getChatRoomHistoryMessages: getChatRoomHistoryMessages,\n    sendChatRoomMessage: sendChatRoomMessage,\n    setChatRoomEntry: setChatRoomEntry,\n    forceSetChatRoomEntry: forceSetChatRoomEntry,\n    removeChatRoomEntry: removeChatRoomEntry,\n    forceRemoveChatRoomEntry: forceRemoveChatRoomEntry,\n    getChatRoomEntry: getChatRoomEntry,\n    getAllChatRoomEntries: getAllChatRoomEntries,\n\n    getLastCacheMsgSentTime: getLastCacheMsgSentTime,\n    getLastCacheMsgUId: getLastCacheMsgUId,\n    getLastCacheMsgDirection: getLastCacheMsgDirection,\n    msgEmitter: CacheMsg.eventEmitter,\n\n    changeUser: changeUser,\n\n    joinRTCRoom: joinRTCRoom,\n    quitRTCRoom: quitRTCRoom,\n    pingRTCRoom: pingRTCRoom,\n    setRTCData: setRTCData,\n    getRTCData: getRTCData,\n    removeRTCData: removeRTCData,\n    getRTCToken: getRTCToken,\n    getRTCRoomInfo: getRTCRoomInfo,\n    getRTCUserInfoList: getRTCUserInfoList,\n    setRTCUserInfo: setRTCUserInfo,\n    removeRTCUserInfo: removeRTCUserInfo,\n    setConversationStatus: setConversationStatus\n  };\n  \n})(window);"
  },
  {
    "path": "api-test/js/common/utils.js",
    "content": "(function (win) {\n\n  var Defer = win.Promise || ES6Promise;\n  var Vue = win.Vue;\n\n  var TypeColor = {\n    FAILED: '#ed4014',\n    MSG: '#2db7f5',\n    STATUS: '#ff9900'\n  };\n\n  var ConversationName = {\n    1: '单聊',\n    3: '群聊',\n    4: '聊天室',\n    5: '客服',\n    6: '系统',\n    7: '公众号',\n    8: '公众号'\n  };\n\n  var StatusName = {\n    0: '已连接',\n    1: '正在链接',\n    2: '主动断开链接',\n    3: '网络不可用',\n    4: '链接关闭',\n    5: 'Socket Error',\n    6: '其他设备登录, 被踢',\n    12: '被封禁',\n    20: 'AppKey 错误',\n    201: '正在请求 Navi',\n    202: '请求 Navi 成功',\n    203: '请求 Navi 错误',\n    204: '请求 Navi 超时'\n  };\n\n  var SuccessStatus = [0, 1, 2, 4, 201, 202, 203, 204];\n\n  var noop = function () {};\n\n  function isObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  }\n  function isArray(arr) {\n    return Object.prototype.toString.call(arr) === '[object Array]';\n  }\n  function isNodeList(arr) {\n    return Object.prototype.toString.call(arr) === '[object NodeList]' || \n      Object.prototype.toString.call(arr) === '[object HTMLCollection]';\n  }\n  function isFunction(arr) {\n    return Object.prototype.toString.call(arr) === '[object Function]';\n  }\n  function isString(str) {\n    return Object.prototype.toString.call(str) === '[object String]';\n  }\n  function isBoolean(str) {\n    return Object.prototype.toString.call(str) === '[object Boolean]';\n  }\n  function isUndefined(str) {\n    return Object.prototype.toString.call(str) === '[object Undefined]';\n  }\n  function isNull(str) {\n    return Object.prototype.toString.call(str) === '[object Null]';\n  }\n  function isNumber(str) {\n    return Object.prototype.toString.call(str) === '[object Number]';\n  }\n\n  function defered(callback) {\n    return new Defer(callback);\n  }\n\n  function tplEngine(temp, data, regexp) {\n    var replaceAction = function (object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n      });\n    };\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  }\n\n  function forEach(obj, callback, options) {\n    options = options || {};\n    callback = callback || noop;\n    var isReverse = options.isReverse;\n    var loopObj = function() {\n      for (var key in obj) {\n        callback(obj[key], key, obj);\n      }\n    };\n    var loopArr = function() {\n      if (isReverse) {\n        for (var i = obj.length - 1; i >= 0; i--) {\n          callback(obj[i], i);\n        }\n      } else {\n        for (var j = 0, len = obj.length; j < len; j++) {\n          callback(obj[j], j);\n        }\n      }\n    };\n    if (isObject(obj)) {\n      loopObj();\n    }\n    if (isArray(obj) || isNodeList(obj)) {\n      loopArr();\n    }\n  };\n\n  function clearUndefKey(obj) {\n    forEach(obj, function (key, val) {\n      if (isUndefined(val)) {\n        delete obj[key];\n      }\n    });\n    return obj;\n  }\n\n  function map(arr, event) {\n    forEach(arr, function(item, index) {\n      arr[index] = event(item, index);\n    });\n    return arr;\n  }\n\n  function deepMap(arr, event) {\n    forEach(arr, function (item, index) {\n      if (isArray(item) || isObject(item)) {\n        arr[index] = deepMap(item, event);\n      } else {\n        arr[index] = event(item, index);\n      }\n    });\n    return arr;\n  }\n\n  function isEqual(obj1, obj2) {\n    if (isObject(obj1) && isObject(obj2)) {\n      var isEq = true;\n      forEach(obj1, function (val, key) {\n        if (obj2[key] !== val) {\n          isEq = false;\n        }\n      });\n      return isEq;\n    } else {\n      return obj1 == obj2;\n    }\n  }\n\n  function getDom(id) {\n    return document.getElementById(id);\n  }\n\n  function queryAllDom(sel) {\n    return document.querySelectorAll(sel);\n  }\n\n  function queryDom(sel) {\n    return document.querySelector(sel);\n  }\n\n  function removeDom(dom) {\n    var parent = dom.parentNode || dom.parentElement;\n    parent.removeChild(dom);\n  }\n\n  function getParent(dom) {\n    return dom.parentNode || dom.parentElement;\n  }\n\n  function getChildren(dom) {\n    return dom.children;\n  }\n\n  function getTemp(id) {\n    var dom = getDom(id);\n    return dom.innerHTML;\n  }\n\n  function getDomIndex(dom) {\n    var parent = getParent(dom);\n    var children = parent.children;\n    for (var i = 0, max = children.length; i < max; i++) {\n      var child = children[i];\n      if (dom === child) {\n        return i;\n      }\n    }\n    return -1;\n  }\n\n  function toJSON(obj) {\n    return JSON.stringify(obj);\n  }\n\n  function parseJSON(str) {\n    var val;\n    try {\n      val = JSON.parse(str);\n    } catch(e) {}\n    return val;\n  }\n\n  function copy(obj) {\n    var copyObj = parseJSON(toJSON(obj));\n    return copyObj;\n  }\n\n  function hasClass(el, className) {\n    if (!el) {\n      return false;\n    }\n    var classList = el.classList;\n    for (var i = 0, max = classList.length; i < max; i++) {\n      if (classList[i] === className) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  function timestampToString(timestamp) {\n    var date = timestamp ? new Date(timestamp) : new Date();\n    Y = date.getFullYear() + '-';\n    M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';\n    D = date.getDate() + ' ';\n    h = date.getHours() + ':';\n    m = date.getMinutes() + ':';\n    s = date.getSeconds();\n    return Y + M + D + h + m + s;\n  }\n\n  function extend(destination, sources) {\n    for (var key in sources) {\n      var value = sources[key];\n      if (!isUndefined(value)) {\n        destination[key] = value;\n      }\n    }\n    return destination;\n  };\n\n  /**\n  * 封装弹框组件\n  * @param {object} options\n  */\n  function mountDialog(options, instance) {\n    options.parent = instance;\n    var Dialog = Vue.extend(options);\n    var instance = new Dialog({\n      el: document.createElement('div')\n    });\n    var wrap = document.getElementsByTagName('body')[0];\n    wrap.appendChild(instance.$el);\n    return instance;\n  }\n\n  function reverse(obj) {\n    var newObj = copy(obj);\n    return newObj.reverse();\n  }\n\n  function openUrl(url) {\n    window.open(url);\n  }\n\n  function getBase64Image() {\n    var canvas = document.createElement('canvas');\n    canvas.width = 100;\n    canvas.height = 100;\n    var context = canvas.getContext('2d');\n    context.font = '20pt Arial';\n    context.fillStyle = 'blue';\n    context.fillText('RongCloud.cn', 10, 20);\n    var content = canvas.toDataURL('image/jpeg');\n    content = content.replace('data:image/jpeg;base64,', '');\n    return content;\n  }\n\n  var increaseNumber = 0;\n  function getIncreasNumber() {\n    return ++increaseNumber;\n  }\n\n  var EventEmitter = function () {\n    this._events = {};\n    \n    this.on = function (name, event) {\n      var _events = this._events[name] || [];\n      _events.push(event);\n      this._events[name] = _events;\n    };\n\n    this.emit = function (name, data) {\n      var _events = this._events[name];\n      forEach(_events, function(event) {\n        event(data);\n      });\n    };\n  };\n\n  var Storage = {\n    ConfigKey: 'config',\n    get: function (key) {\n      var str = localStorage.getItem(key);\n      return parseJSON(str);\n    },\n    set: function (key, val) {\n      var str = toJSON(val);\n      localStorage.setItem(key, str);\n    }\n  };\n\n  function getUrlQuery() {\n    var url = location.search; //获取url中\"?\"符后的字串\n    var theRequest = new Object();\n    if (url.indexOf('?') != -1) {\n      var str = url.substr(1);\n      strs = str.split('&');\n      for (var i = 0; i < strs.length; i++) {\n        theRequest[strs[i].split('=')[0]] = unescape(strs[i].split('=')[1]);\n      }\n    }\n    return theRequest;\n  }\n\n  function getRCUrlQuery() {\n    var theRequest = getUrlQuery();\n    var transMap = {\n      'true': true, 'false': false\n    };\n    map(theRequest, function (val, key) {\n      var transVal = transMap[val];\n      if (!isUndefined(transVal)) {\n        val = transVal;\n      }\n      return val;\n    });\n    forEach(theRequest, function (val, key) {\n      if (key === 'encodeToken') {\n        theRequest.token = decodeURIComponent(val);\n        delete theRequest.encodeToken;\n      }\n      if (key === 'isMini') {\n        delete theRequest.isMini;\n      }\n    });\n    return theRequest;\n  }\n\n  function deferNoop() {\n    return Defer.resolve();\n  }\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.Utils = {\n    Storage: Storage,\n\n    TypeColor: TypeColor,\n    ConversationName: ConversationName,\n    StatusName: StatusName,\n    SuccessStatus: SuccessStatus,\n\n    EventEmitter: EventEmitter,\n\n    noop: noop,\n    isNumber: isNumber,\n    isFunction: isFunction,\n    map: map,\n    deepMap: deepMap,\n    isEqual: isEqual,\n    clearUndefKey: clearUndefKey,\n    Defer: Defer,\n    defered: defered,\n    tplEngine: tplEngine,\n    forEach: forEach,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    removeDom: removeDom,\n    getParent: getParent,\n    getChildren: getChildren,\n    hasClass: hasClass,\n    getDomIndex: getDomIndex,\n    timestampToString: timestampToString,\n    extend: extend,\n    reverse: reverse,\n    openUrl: openUrl,\n    getBase64Image: getBase64Image,\n    getIncreasNumber: getIncreasNumber,\n\n    getDom: getDom,\n    queryDom: queryDom,\n    queryAllDom: queryAllDom,\n    getTemp: getTemp,\n    mountDialog: mountDialog,\n    getUrlQuery: getUrlQuery,\n    getRCUrlQuery: getRCUrlQuery,\n    deferNoop: deferNoop\n  };\n\n})(window);"
  },
  {
    "path": "api-test/js/components/button.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    Service = RongIM.Service;\n\n  var OutputMark = {\n    SUCCESS: '成功',\n    FAILED: '失败'\n  };\n\n  var copyApi = function (api) {\n    var params = api.params || [];\n    var copyParams = utils.copy(params);\n    utils.forEach(params, function (item, index) {\n      utils.forEach(item, function (val, key) {\n        if (utils.isFunction(val)) {\n          copyParams[index][key] = val;\n        }\n      });\n    });\n    api.params = copyParams;\n    return api;\n  };\n\n  components.apiBtn = Vue.component('api-btn', {\n    template: utils.getTemp('rong-tpl-apibtn'),\n    props: ['api', 'isdragging'],\n    data: function() {\n      return {\n        isShowEditDialog: false,\n        selfApi: copyApi(this.api)\n      }\n    },\n    watch: {\n      markMessage: function (newMsg) {\n        console.log(newMsg);\n      }\n    },\n    computed: {\n      tip: function() {\n        var api = this.selfApi;\n        return utils.tplEngine(TipTpl, api);\n      },\n      apiValue: function() {\n        var api = this.selfApi;\n        return utils.toJSON(api);\n      },\n      paramList: function () {\n        var paramList = this.selfApi.params;\n        return paramList;\n      },\n      hasParams: function () {\n        var params = this.selfApi.params;\n        return params && params.length;\n      }\n    },\n    methods: {\n      openUrl: utils.openUrl,\n      showEditDialog: function() {\n        this.isShowEditDialog = true;\n      },\n      hideEditDialog: function() {\n        this.isShowEditDialog = false;\n      },\n      change: function() {\n      },\n      run: function() {\n        var self = this;\n        var params = [];\n        var startTime = +new Date();\n        utils.forEach(self.selfApi.params, function(item) {\n          if (item.type === 'number') {\n            item.value = Number(item.value);\n          }\n          params.push(item.value);\n        });\n        var imInstance = RongIM.vueInstance;\n\n        var addOutput = function(data, isSuccess) {\n          var currentTime = +new Date();\n          var consumedTime = currentTime - startTime;\n          var title = self.api.name + (isSuccess ? OutputMark.SUCCESS : OutputMark.FAILED);\n          var config = {};\n          if (!isSuccess) {\n            config.color = utils.TypeColor.FAILED;\n          }\n          self.hideEditDialog();\n          return imInstance.addOutput(title, data, consumedTime, params, config);\n        };\n        return self.api.event.apply(void 0, params).then(function(data) {\n          data = addOutput(data, true);\n          return {\n            isSuccess: true,\n            data: data\n          };\n        }).catch(function(errorInfo) {\n          // TODO 报警\n          // error = utils.isNumber(error) ? error : error.toString();\n          var data = addOutput(errorInfo, false);\n          return {\n            isSuccess: false,\n            data: data\n          };\n        });\n      }\n    },\n    mounted: function() {\n      var self = this;\n\n      var setParams = function () {\n        var paramList = self.selfApi.params;\n        utils.forEach(paramList, function (item) {\n          if (item.event) {\n            item.value = item.value || item.event();\n          }\n        });\n      };\n\n      setParams();\n      Service.msgEmitter.on('msgChanged', setParams);\n    }\n  });\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test/js/components/json-alert.js",
    "content": "(function (win, dependencies) {\n  var RongIM = dependencies.RongIM;\n  var utils = RongIM.Utils;\n\n  RongIM.dialog = RongIM.dialog || {};\n  RongIM.dialog.jsonAlert = function(options) {\n    var vueInstance = RongIM.vueInstance;\n\n    options = options || {};\n\n    utils.mountDialog({\n      name: 'json-alert',\n      template: '#rong-json-alert',\n      data: function () {\n        return {\n          isShow: true,\n          data: options.data\n        };\n      },\n      watch: {\n        isShow: function(isShow) {\n          if (!isShow) {\n            utils.removeDom(this.$el);\n          }\n        }\n      },\n      methods: {\n        hide: function() {\n          this.isShow = false;\n        }\n      }\n    }, vueInstance);\n  };\n\n})(window, {\n  RongIM: RongIM\n});"
  },
  {
    "path": "api-test/js/components/msg-expansion.js",
    "content": "(function (win, dependencies, components) {\n    var Vue = dependencies.Vue,\n      RongIM = dependencies.RongIM,\n      utils = RongIM.Utils,\n      Service = RongIM.Service;\n  \n    components.apiExpansion = Vue.component('api-expansion', {\n      template: utils.getTemp('rong-tpl-expansion'),\n      props: ['isOpen'],\n      data: function() {\n        return {\n            isOpen: true,\n        }\n      },\n      watch: {\n        isOpen: function (val, newval) {\n          console.warn(val, newval);\n        }\n      },\n      computed: {\n        \n      },\n      methods: {\n        \n      },\n      mounted: function() {\n        console.warn('msg-expansion');\n      }\n    });\n  \n  })(window, {\n    Vue: Vue,\n    iview: iview,\n    RongIM: RongIM\n  }, window.RongIM.components);"
  },
  {
    "path": "api-test/js/login.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    isDebug = RongIM.config.isDebug,\n    debugConf = RongIM.config.debugConf;\n\n  var ConfigPlacehoder = {\n    appkey: '开发者的融云 AppKey',\n    token: '开发者的用户 Token',\n    targetId: '对方 id. 发消息、获取历史消息等都默认对此用户操作. 默认聊天室、群组、个人 id 都为此 id',\n    navi: '导航地址. 注: 国内数据中心可不填',\n    customCMP: '链接地址(开发者忽略此项)',\n    isPolling: '若使用长轮训链接方式, 可选择此项(开发者可忽略)'\n  };\n\n  components.login = Vue.component('login', {\n    template: utils.getTemp('rong-global-config'),\n    props: ['config', 'login'],\n    computed: {\n      configList: function() {\n        var items = [];\n        utils.forEach(this.config, function(val, key) {\n          items.push({\n            type: typeof val,\n            name: key\n          });\n        });\n        return items;\n      },\n      prompt: function() {\n        return ConfigPlacehoder;\n      }\n    },\n    methods: {\n      clearStorage: function () {\n        window.localStorage.clear();\n        this.$Message.success({\n          background: true,\n          content: '清空本地缓存成功'\n        });\n      }\n    },\n    mounted: function () {\n      if (isDebug && debugConf.autoRun) {\n        var self = this;\n        Vue.nextTick(function () {\n          self.login(self.config);\n        });\n      }\n    }\n  });\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test/js/main.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    iview = dependencies.iview,\n    VueJsonPretty = dependencies.VueJsonPretty,\n    RongIM = dependencies.RongIM,\n    Service = RongIM.Service,\n    utils = RongIM.Utils,\n    ApiList = RongIM.ApiList,\n    DefailtReadyApiQueue = RongIM.DefailtReadyApiQueue,\n    DefaultConfig = RongIM.config.im,\n    Config = utils.copy(DefaultConfig),\n    Storage = utils.Storage,\n    StorageConfig = Storage.get(Storage.ConfigKey),\n    DefaultTargetId = Config.targetId,\n    isDebug = RongIM.config.isDebug,\n    debugConf = RongIM.config.debugConf;\n\n  DefailtReadyApiQueue.push([]);\n\n  var ValidStatus = [0, 1, 2, 6, 201, 202];\n  var ValidErrorCode = [23424, 23427, 23426, 23423];\n  var isStop = false;\n\n  var isStorageConfig = false;\n  if (StorageConfig && !isDebug) {\n    isStorageConfig = true;\n    Config = utils.copy(StorageConfig);\n  }\n  var urlQueryConfig = utils.getRCUrlQuery();\n  Config = utils.extend(Config, urlQueryConfig);\n\n  var ReceiveMsgTextTpl = '监听到{typeName} ({conversationType})消息. 发送者: {senderUserId}';\n  var StatusTextTpl = '链接状态: {statusName} ({status})';\n\n  var OptBoxClass = 'rong-ready-box';\n  var ApiBoxClass = 'rong-api-list';\n  var ApiSourceClass = 'rong-api-source';\n\n  var RunType = {\n    OneByOne: { name: '逐个运行', prompt: 'Api 逐个执行' },\n    LineByLine: { name: '逐行运行', prompt: '每行 Api 并行. 执行完一行后执行下一行' }\n  };\n  \n  var vueInstance;\n\n  function runAllApi(allRefs, currentIndex, finishCallback) {\n    var total = allRefs.length;\n    var isFinished = total === currentIndex || isStop;\n    if (isFinished) {\n      return finishCallback && finishCallback();\n    }\n    var refList = allRefs[currentIndex];\n    var deferArr = [];\n    utils.forEach(refList, function (instance) {\n      deferArr.push(instance.run());\n    });\n    return utils.Defer.all(deferArr).then(function (result) {\n      result = result[0];\n      var isSuccess = result.isSuccess || ValidErrorCode.indexOf(result.data.result) !== -1;\n      if (isSuccess) {\n        vueInstance.runInfo.successApiCount++;\n      } else {\n        vueInstance.runInfo.failApiList.push(result.data);\n      }\n      currentIndex++;\n      runAllApi(allRefs, currentIndex, finishCallback);\n    });\n  }\n\n  function runOneByOne(finishCallback) {\n    var refs = vueInstance.$refs;\n    var allRefs = [];\n    utils.forEach(refs, function (subRefList) {\n      utils.forEach(subRefList, function (ref) {\n        allRefs.push([ ref ]);\n      });\n    });\n    runAllApi(allRefs, 0, finishCallback);\n  }\n\n  function runLineByLine(finishCallback) {\n    var refs = vueInstance.$refs;\n    var allRefs = [];\n    utils.forEach(refs, function (ins) {\n      allRefs.push(ins);\n    });\n    runAllApi(allRefs, 0, finishCallback);\n  }\n\n  function setConfig(config) {\n    var currentTargetId = config.targetId;\n    vueInstance.globalConfig = config;\n    vueInstance.readyApiQueue = utils.deepMap(vueInstance.readyApiQueue, function (item) {\n      if (item === DefaultTargetId) {\n        item = currentTargetId;\n      }\n      return item;\n    });\n  }\n\n  function watchStatus(status) {\n    var title = utils.tplEngine(StatusTextTpl, {\n      status: status,\n      statusName: utils.StatusName[status]\n    });\n    var output = vueInstance.addOutput(title, status, 0, [], {\n      color: utils.TypeColor.STATUS\n    });\n    if (ValidStatus.indexOf(status) === -1) {\n      vueInstance.runInfo.failApiList.push(output);\n    }\n    var isSuccess = utils.SuccessStatus.indexOf(status) !== -1;\n    var event = isSuccess ? vueInstance.$Message.success : vueInstance.$Message.error;\n    event.call(vueInstance.$Message, {\n      background: true,\n      content: title\n    });\n  }\n\n  function watchMessage(message) {\n    if (RongIM.config.isDebug && !RongIM.config.debugConf.isShowMsg) {\n      return;\n    }\n    var title = utils.tplEngine(ReceiveMsgTextTpl, {\n      typeName: utils.ConversationName[message.type],\n      conversationType: message.type,\n      senderUserId: message.senderUserId\n    });\n    vueInstance.addOutput(title, message, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n    console.log('Reveice Msg', utils.toJSON(message));\n  }\n\n  function watchChatroom(entries) {\n    vueInstance.addOutput('监听到聊天室 KV 更新', entries, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n  }\n\n  function autoRun() {\n    Vue.nextTick(function () {\n      runOneByOne(function () {\n        vueInstance.runInfo.runCount++;\n        localStorage.removeItem('rong_servers');\n        localStorage.removeItem('rong_fullnavi');\n        vueInstance.outputList = [];\n        vueInstance.allOutputList = [];\n        !isStop && autoRun();\n      });\n    });\n  }\n\n  function loginSuccessEvent(userId, config) {\n    vueInstance.$Message.success({\n      background: true,\n      content: '链接成功 ' + userId\n    });\n    vueInstance.currentUserId = userId;\n    vueInstance.isLogged = true;\n    if (isDebug && debugConf.autoRun) {\n      Vue.nextTick(autoRun);\n    }\n  }\n\n  function login(config) {\n    setConfig(config);\n    return Service.init(config, {\n      status: watchStatus,\n      message: watchMessage,\n      chatroom: watchChatroom\n    }).then(function ({ id }) {\n      Storage.set(Storage.ConfigKey, config);\n      loginSuccessEvent(id, config);\n    }).catch(function (error) {\n      console.log(error);\n      vueInstance.$Message.error({\n        background: true,\n        content: '链接失败 ' + JSON.stringify(error)\n      });\n      return utils.Defer.reject();\n    });\n  }\n\n  function getApiListMethods() {\n    return {\n      addOutput: function (title, result, consumedTime, params, config) {\n        config = config || {};\n        var output = {\n          id: utils.getIncreasNumber(),\n          title: title,\n          result: result,\n          consumedTime: consumedTime,\n          params: params,\n          config: config\n        };\n        output.time = utils.timestampToString();\n        vueInstance.allOutputList.push(output);\n        vueInstance.outputList.push(output);\n        return output;\n      },\n      clearOutput: function () {\n        vueInstance.outputList = [];\n      },\n      showAllOutput: function () {\n        vueInstance.outputList = vueInstance.allOutputList;\n      },\n      toJSON: function (data) {\n        return utils.toJSON(data);\n      },\n      showJSONAlert: function(data) {\n        RongIM.dialog.jsonAlert({\n          data: data\n        });\n      },\n      runAllApi: function() {\n        if (vueInstance.runType === 'OneByOne') {\n          runOneByOne();\n        } else {\n          runLineByLine();\n        }\n      },\n      startDragging: function () {\n        setTimeout(function() {\n          vueInstance.isDragging = true;\n        }, 100);\n      }\n    };\n  }\n\n  function getServiceMethods() {\n    return {\n      openUrl: utils.openUrl,\n      reverse: utils.reverse,\n      login: function(config) {\n        var isEqualStorage = utils.isEqual(config, StorageConfig);\n        var isEqualDefault = utils.isEqual(config, DefaultConfig);\n        if (isStorageConfig && isEqualStorage && !isEqualDefault && !isDebug) {\n          vueInstance.$Modal.confirm({\n            title: '注意',\n            content: '您目前使用的为上一次链接配置, 请确定配置是否可用 ?',\n            onOk: function () {\n              login(config);\n            }\n          });\n        } else {\n          return login(config);\n        }\n      },\n      alarm: function () {\n        if (!this.isAlarmMuted) {\n          vueInstance.$refs.alarm.play();\n        }\n      },\n      mute: function () {\n        vueInstance.$refs.alarm.pause();\n      }\n    };\n  }\n\n\n  Vue.use(iview);\n\n  vueInstance = new Vue({\n    el: '#app',\n    data: function() {\n      return {\n        currentUserId: '',\n        isLogged: false,\n        readyApiQueue: DefailtReadyApiQueue,\n        allOutputList: [],\n        outputList: [],\n        globalConfig: Config,\n        RunType: RunType,\n        runType: 'OneByOne',\n\n        alertJSON: null,\n        isDragging: false,\n        isShowRunType: false,\n        isShowOutList: false,\n\n        isDebug: RongIM.config.isDebug,\n        runInfo: {\n          runCount: 0,\n          successApiCount: 0,\n          failApiList: []\n        },\n        isAlarmMuted: false\n      };\n    },\n    computed: {\n      apiList: function() {\n        return ApiList;\n      },\n      changeUserApi: function () {\n        var self = this;\n        var changeUserApi = RongIM.Api.changeUser;\n        var changeUserEvent = changeUserApi.event;\n        changeUserApi.event = function (token) {\n          var globalConfig = self.globalConfig\n          globalConfig.token = token;\n          return Service.changeUser(globalConfig, {\n            status: watchStatus,\n            message: watchMessage\n          }).then(function (userId) {\n            loginSuccessEvent(userId, globalConfig);\n          }).catch(function () {\n            vueInstance.$Message.error({\n              background: true,\n              content: '切换用户失败 ' + error\n            });\n          });\n        };\n        return changeUserApi;\n      },\n      currentOutput: function() {\n        var outputList = this.outputList;\n        if (outputList.length) {\n          return outputList[outputList.length - 1];\n        }\n      },\n      displayedOutputList: function () {\n        if (isDebug) {\n          return this.runInfo.failApiList;\n        } else {\n          return this.outputList;\n        }\n      }\n    },\n    watch: {\n      'runInfo.failApiList': function (newList) {\n        if (newList.length > 20) {\n          this.alarm();\n        }\n      },\n      isAlarmMuted: function (isMuted) {\n        if (isMuted) {\n          this.mute();\n        }\n      }\n    },\n    components: {\n      apiBtn: components.apiBtn,\n      login: components.login,\n      prettyjson: Vue.component('prettyjson', VueJsonPretty.default)\n    },\n    mounted: function() {\n      this.isPageLoaded = true;\n    },\n    methods: utils.extend(getApiListMethods(), getServiceMethods())\n  });\n\n  RongIM.vueInstance = vueInstance;\n\n  (function () {\n    function start() {\n      isStop = false;\n      if (vueInstance.isLogged) {\n        autoRun();\n      } else {\n        vueInstance.login(vueInstance.globalConfig).then(autoRun);\n      }\n    }\n    window.addEventListener(\"message\", function (event) {\n      var type = event.data;\n      if (type === 'start') {\n        start();\n      } else if (type === 'pause') {\n        isStop = true;\n      }\n    }, false);\n  })();\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  VueJsonPretty: VueJsonPretty,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test/lib/js/RongIMLib-3.0.0.js",
    "content": "/*\n* RongIMLib.js v3.0.0\n* Release Date: Fri Mar 27 2020 09:51:18 GMT+0800 (China Standard Time)\n* Copyright 2020 RongCloud\n* Released under the MIT License.\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongIMLib = factory());\n}(this, (function () { 'use strict';\nconsole.log('----------------------');\nconsole.log(window);\n\n  var version = \"3.0.0\";\n\n  var SDK_VERSION = version;\n\n  var ERROR_INFO = {\n    TIMEOUT: {\n      code: -1,\n      msg: 'Network timeout'\n    },\n    SDK_INTERNAL_ERROR: {\n      code: -2,\n      msg: 'SDK internal error'\n    },\n    PARAMETER_ERROR: {\n      code: -3,\n      msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n    },\n    REJECTED_BY_BLACKLIST: {\n      code: 405,\n      msg: 'Blacklisted by the other party'\n    },\n    SEND_TOO_FAST: {\n      code: 20604,\n      msg: 'Sending messages too quickly'\n    },\n    NOT_IN_GROUP: {\n      code: 22406,\n      msg: 'Not in group'\n    },\n    FORBIDDEN_IN_GROUP: {\n      code: 22408,\n      msg: 'Forbbiden from speaking in the group'\n    },\n    NOT_IN_CHATROOM: {\n      code: 23406,\n      msg: 'Not in chatroom'\n    },\n    FORBIDDEN_IN_CHATROOM: {\n      code: 23408,\n      msg: 'Forbbiden from speaking in the chatroom'\n    },\n    KICKED_FROM_CHATROOM: {\n      code: 23409,\n      msg: 'Kicked out and forbbiden from joining the chatroom'\n    },\n    CHATROOM_NOT_EXIST: {\n      code: 23410,\n      msg: 'ChatRoom does not exist'\n    },\n    CHATROOM_IS_FULL: {\n      code: 23411,\n      msg: 'ChatRoom members exceeded'\n    },\n    PARAMETER_INVALID_CHATROOM: {\n      code: 23412,\n      msg: 'Invalid chatroom parameters'\n    },\n    ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n      code: 23414,\n      msg: 'ChatRoom message roaming service is not open'\n    },\n    RECALLMESSAGE_PARAMETER_INVALID: {\n      code: 25101,\n      msg: 'Invalid recall message parameter'\n    },\n    PUSHSETTING_PARAMETER_INVALID: {\n      code: 26001,\n      msg: 'Invalid push parameter'\n    },\n    OPERATION_BLOCKED: {\n      code: 20605,\n      msg: 'Operation is blocked'\n    },\n    OPERATION_NOT_SUPPORT: {\n      code: 20606,\n      msg: 'Operation is not supported'\n    },\n    MSG_BLOCKED_SENSITIVE_WORD: {\n      code: 21501,\n      msg: 'The sent message contains sensitive words'\n    },\n    REPLACED_SENSITIVE_WORD: {\n      code: 21502,\n      msg: 'Sensitive words in the message have been replaced'\n    },\n    NOT_CONNECTED: {\n      code: 30001,\n      msg: 'Please connect successfully first'\n    },\n    NAVI_REQUEST_ERROR: {\n      code: 30007,\n      msg: 'Navigation http request failed'\n    },\n    CMP_REQUEST_ERROR: {\n      code: 30010,\n      msg: 'CMP sniff http request failed'\n    },\n    CONN_APPKEY_FAKE: {\n      code: 31002,\n      msg: 'Your appkey is fake'\n    },\n    CONN_SERVER_UNAVAILABLE: {\n      code: 31003,\n      msg: 'The server is currently unavailable'\n    },\n    CONN_TOKEN_INCORRECT: {\n      code: 31004,\n      msg: 'Your token is not valid or expired'\n    },\n    CONN_NOT_AUTHRORIZED: {\n      code: 31005,\n      msg: 'AppKey and Token do not match'\n    },\n    CONN_REDIRECTED: {\n      code: 31006,\n      msg: 'Connection redirection'\n    },\n    CONN_APP_BLOCKED_OR_DELETED: {\n      code: 31008,\n      msg: 'AppKey is banned or deleted'\n    },\n    CONN_USER_BLOCKED: {\n      code: 31009,\n      msg: 'User blocked'\n    },\n    RC_CONNECTION_EXIST: {\n      code: 34001,\n      msg: 'Connection already exists'\n    }\n  };\n  var ERROR_CODE = {};\n  var ERROR_CODE_TO_INFO = {};\n\n  for (var name$1 in ERROR_INFO) {\n    var info = ERROR_INFO[name$1];\n    var code = info.code;\n    ERROR_CODE[name$1] = code;\n    ERROR_CODE[code] = name$1;\n    ERROR_CODE_TO_INFO[code] = info;\n  }\n\n  var _CONNECT_SERVER_STATU, _SERVER_DISCONNECT_ST, _TRANSPORTER_STATUS_T;\n  var NAVI_ERROR_INFO = {\n    '401': ERROR_INFO.CONN_TOKEN_INCORRECT,\n    '403': ERROR_INFO.CONN_APPKEY_FAKE\n  };\n  var CONNECTION_STATUS = {\n    CONNECTED: 0,\n    CONNECTING: 1,\n    DISCONNECTED: 2,\n    NETWORK_UNAVAILABLE: 3,\n    SOCKET_CLOSE: 4,\n    SOCKET_ERROR: 5,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 6\n  };\n  var SERVER_DISCONNECT_STATUS = {\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 1\n  };\n  var CONNECT_SERVER_STATUS = {\n    IDENTIFIER_REJECTED: 2,\n    SERVER_UNAVAILABLE: 3,\n    TOKEN_INCORRECT: 4,\n    NOT_AUTHORIZED: 5,\n    REDIRECT: 6,\n    PACKAGE_ERROR: 7,\n    APP_BLOCK_OR_DELETE: 8,\n    BLOCK: 9,\n    TOKEN_EXPIRE: 10,\n    DEVICE_ERROR: 11\n  };\n  var CONNECT_SERVER_STATUS_MAP_ERROR_INFO = (_CONNECT_SERVER_STATU = {}, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.IDENTIFIER_REJECTED] = ERROR_INFO.CONN_APPKEY_FAKE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.SERVER_UNAVAILABLE] = ERROR_INFO.CONN_SERVER_UNAVAILABLE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_INCORRECT] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.NOT_AUTHORIZED] = ERROR_INFO.CONN_NOT_AUTHRORIZED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.REDIRECT] = ERROR_INFO.CONN_REDIRECTED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.APP_BLOCK_OR_DELETE] = ERROR_INFO.CONN_APP_BLOCKED_OR_DELETED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.BLOCK] = ERROR_INFO.CONN_USER_BLOCKED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_EXPIRE] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU);\n  var TRANSPORTER_STATUS = {\n    CONNECTED: CONNECTION_STATUS.CONNECTED,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT,\n    CLOSE_GOING_AWAY: 1001,\n    CLOSE_PROTOCOL_ERROR: 1002,\n    CLOSE_UNSUPPORTED: 1003,\n    CLOSE_NO_STATUS: 1005,\n    CLOSE_ABNORMAL: 1006,\n    UNSUPPORTED_DATA: 1007,\n    POLICY_VIOLATION: 1008,\n    CLOSE_TOO_LARGE: 1009,\n    MISSING_EXTENSION: 1010,\n    INTERNAL_ERROR: 1011,\n    SERVICE_RESTART: 1012,\n    TRY_AGAIN_LATER: 1013,\n    TSL_HANDSHAKE: 1015,\n    PING_FIRST_TIMEOUT: 2001,\n    PING_TIMEOUT: 2002,\n    DISCONNECT_TOO_FAST: 2003,\n    EXCEED_MESSAGE_ID_LIMIT: 2004\n  };\n  var SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS = (_SERVER_DISCONNECT_ST = {}, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT] = TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, _SERVER_DISCONNECT_ST);\n  var TRANSPORTER_STATUS_NEED_UPDATE_CMP = [TRANSPORTER_STATUS.CLOSE_GOING_AWAY, TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR, TRANSPORTER_STATUS.CLOSE_UNSUPPORTED, TRANSPORTER_STATUS.UNSUPPORTED_DATA, TRANSPORTER_STATUS.POLICY_VIOLATION, TRANSPORTER_STATUS.MISSING_EXTENSION, TRANSPORTER_STATUS.INTERNAL_ERROR, TRANSPORTER_STATUS.SERVICE_RESTART, TRANSPORTER_STATUS.TRY_AGAIN_LATER, TRANSPORTER_STATUS.TSL_HANDSHAKE, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST];\n  var TRANSPORTER_STATUS_NEED_RECONNECT = TRANSPORTER_STATUS_NEED_UPDATE_CMP.concat([TRANSPORTER_STATUS.PING_TIMEOUT, TRANSPORTER_STATUS.CLOSE_ABNORMAL, TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT]);\n  var TRANSPORTER_STATUS_TO_CONNECTION_STATUS = (_TRANSPORTER_STATUS_T = {}, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_GOING_AWAY] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_UNSUPPORTED] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_NO_STATUS] = CONNECTION_STATUS.DISCONNECTED, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_ABNORMAL] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.DISCONNECT_TOO_FAST] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.UNSUPPORTED_DATA] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.POLICY_VIOLATION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_TOO_LARGE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.MISSING_EXTENSION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.INTERNAL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.SERVICE_RESTART] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TRY_AGAIN_LATER] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TSL_HANDSHAKE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_FIRST_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T);\n\n  var CONNECT_TYPE = {\n    COMET: 'comet',\n    WEBSOCKET: 'websocket'\n  };\n  var CONVERSATION_TYPE = {\n    PRIVATE: 1,\n    GROUP: 3,\n    CHATROOM: 4,\n    CUSTOMER_SERVICE: 5,\n    SYSTEM: 6\n  };\n  var MESSAGE_DIRECTION = {\n    SEND: 1,\n    RECEIVE: 2\n  };\n  var MESSAGS_TIME_ORDER = {\n    DESC: 0,\n    ASC: 1\n  };\n  var CHATROOM_ORDER = {\n    ASC: 1,\n    DESC: 2\n  };\n  var RECALL_OBJECT_NAME = 'RC:RcCmd';\n  var MENTIOND_TYPE = {\n    ALL: 1,\n    SINGAL: 2\n  };\n  var CONST = {\n    CONNECT_TYPE: CONNECT_TYPE,\n    CONNECTION_STATUS: CONNECTION_STATUS,\n    CONVERSATION_TYPE: CONVERSATION_TYPE,\n    MESSAGE_DIRECTION: MESSAGE_DIRECTION,\n    MESSAGS_TIME_ORDER: MESSAGS_TIME_ORDER,\n    CHATROOM_ORDER: CHATROOM_ORDER,\n    RECALL_OBJECT_NAME: RECALL_OBJECT_NAME\n  };\n\n  var IM_TIMEOUT = 30000;\n  var IM_PING_INTERVAL_TIME = 30000;\n  var IM_PING_MAX_TIMEOUT = 6000;\n  var IM_PING_MIN_TIMEOUT = 2000;\n  var HTTP_TIMEOUT = 60000;\n  var PULL_MSG_TIME = 180000;\n  var NAVI_EXPIRED_TIME = 10800000;\n  var CMP_SNIFF_INTERNAL_TIME = 1000;\n  var FIRST_PING_TIMEOUT = 100;\n  var NAVI_REQUEST_SUCCESS_CODE = 200;\n  var NAVI_SEPARATOR_IN_TOKEN = '@';\n  var DOMAIN_SEPARATOR_IN_NAVLIST = ';';\n  var DOMAIN_SEPARATOR_IN_CMPLIST = ',';\n  var MAX_SINGAL_ID = 65535;\n  var MINIMUM_CONNECT_DURATION = 5000;\n  var TYPE_HAS_CONVERSATION = [CONVERSATION_TYPE.PRIVATE, CONVERSATION_TYPE.GROUP, CONVERSATION_TYPE.SYSTEM];\n  var PLATFORM = {\n    WEB: 'web',\n    WX: 'wx',\n    ZFB: 'zfb',\n    TT: 'tt',\n    BAIDU: 'baidu',\n    QUICK_APP: 'quick_app'\n  };\n  var REQUEST_METHOD = {\n    POST: 'post',\n    GET: 'get'\n  };\n  var STORAGE_ROOT_KEY = 'rc-';\n  var STORAGE_NAVI = {\n    ROOT_KEY_TPL: 'nav-{appkey}-{UID}',\n    SUB_KEY: {\n      CONNECT_TYPE: 'connettype',\n      TIME_WHEN_SAVED: 'time',\n      RESPONSE: 'resp'\n    }\n  };\n  var STORAGE_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      SENDBOX: 'send',\n      INBOX: 'in'\n    }\n  };\n  var STORAGE_CONVERSATION = {\n    ROOT_KEY_TPL: 'con-{appkey}-{userId}',\n    SUB_KEY: {\n      ROOT_TPL: '{type}-{id}',\n      UNREAD_COUNT: 'c',\n      UNREAD_LAST_TIME: 't',\n      HAS_MENTIOND: 'hm',\n      MENTIOND_INFO: 'm'\n    }\n  };\n  var HTTP_PROTOCOL = {\n    HTTP: 'http:',\n    HTTPS: 'https:'\n  };\n  var WS_PROTOCOL = {\n    WSS: 'wss:',\n    WS: 'ws:'\n  };\n  var NAVI_CALLBACK_NAME = 'getServerEndpoint';\n  var NAVI_TYPE = {\n    COMET: 'cometnavi',\n    WEBSOCKET: 'navi'\n  };\n  var NAVI_URL_TPL = '{url}/{type}.js?appId={appkey}&token={token}&callBack=' + NAVI_CALLBACK_NAME + '&r={random}&v=' + SDK_VERSION;\n  var CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION;\n  var COMET_REQ_HAS_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&topic={topic}&targetid={targetId}&pid={pid}';\n  var COMET_REQ_NO_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&pid={pid}';\n  var COMET_PULL_URL_TPL = '{protocol}//{domain}/pullmsg.js?sessionid={sessionId}&timestamp={timestamp}&pid={pid}';\n  var TIMER_TYPE = {\n    INTERVAL: 'interval',\n    TIMEOUT: 'timeout'\n  };\n  var TIMER_STATUS = {\n    PENNDING: 'pendding',\n    BUSY: 'busy',\n    ENDING: 'ending'\n  };\n\n  var UnKown = 'UnKown';\n\n  var isMiniEnv = function isMiniEnv(global) {\n    return global !== window;\n  };\n\n  var getEnvInfo = function getEnvInfo() {\n    if (typeof wx !== 'undefined') {\n      return {\n        platform: PLATFORM.WX,\n        global: wx\n      };\n    } else if (typeof swan !== 'undefined') {\n      return {\n        platform: PLATFORM.BAIDU,\n        global: swan\n      };\n    } else if (typeof tt !== 'undefined') {\n      return {\n        platform: PLATFORM.TT,\n        global: tt\n      };\n    } else if (typeof my !== 'undefined') {\n      return {\n        platform: PLATFORM.ZFB,\n        global: my\n      };\n    } else {\n      return {\n        platform: PLATFORM.WEB,\n        global: window\n      };\n    }\n  };\n\n  var getWebSystemInfo = function getWebSystemInfo() {\n    var userAgent = navigator.userAgent;\n    var version, type;\n    var condition = {\n      IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n      Edge: /Edge\\/([\\d.]+)/,\n      Firefox: /Firefox\\/([\\d.]+)/,\n      Opera: /(?:OPERA|OPR).([\\d.]+)/,\n      WeiXin: /MicroMessenger\\/([\\d.]+)/,\n      QQBrowser: /QQBrowser\\/([\\d.]+)/,\n      Chrome: /Chrome\\/([\\d.]+)/,\n      Safari: /Version\\/([\\d.]+).*Safari/\n    };\n\n    for (var key in condition) {\n      if (!condition.hasOwnProperty(key)) continue;\n      var browserContent = userAgent.match(condition[key]);\n\n      if (browserContent) {\n        type = key;\n        version = browserContent[1] || browserContent[2];\n        break;\n      }\n    }\n\n    return {\n      model: type || UnKown,\n      version: version || UnKown\n    };\n  };\n\n  var getMiniSystemInfo = function getMiniSystemInfo(global) {\n    var systemInfo = global.getSystemInfoSync() || {};\n    var model = systemInfo.model,\n        brand = systemInfo.brand;\n\n    if (model && brand) {\n      model = model + ' ' + brand;\n    }\n\n    systemInfo.model = model;\n    return systemInfo;\n  };\n\n  var getProtocol = function getProtocol(global) {\n    var protocol = {\n      http: global.location.protocol || HTTP_PROTOCOL.HTTPS,\n      ws: WS_PROTOCOL.WSS\n    };\n    var isHttp = protocol.http === HTTP_PROTOCOL.HTTP;\n\n    if (isHttp) {\n      protocol.ws = WS_PROTOCOL.WS;\n    }\n\n    return protocol;\n  };\n\n  var adaptGlobalObjectCreate = function adaptGlobalObjectCreate(global) {\n    if (!global.Object.create) {\n      global.Object.create = function (o, properties) {\n        if (typeof o !== 'object' && typeof o !== 'function') throw new TypeError('Object prototype may only be an Object: ' + o);else if (o === null) throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support \\'null\\' as the first argument.');\n        if (typeof properties !== 'undefined') throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support a second argument.');\n\n        function F() {}\n\n        F.prototype = o;\n        return new F();\n      };\n    }\n  };\n\n  var envInfo = getEnvInfo();\n  var platform = envInfo.platform,\n      global$1 = envInfo.global;\n  var isMini = isMiniEnv(global$1);\n  var protocol = getProtocol(global$1);\n  var system = isMini ? getMiniSystemInfo(global$1) : getWebSystemInfo();\n  system.name = platform;\n  adaptGlobalObjectCreate(global$1);\n  var env = {\n    global: global$1,\n    system: system,\n    isMini: isMini,\n    protocol: protocol\n  };\n\n  var CacheStorage = function () {\n    function CacheStorage(values) {\n      this.caches = {};\n\n      if (values) {\n        this.caches = values;\n      }\n    }\n\n    var _proto = CacheStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      this.caches[key] = value;\n    };\n\n    _proto.remove = function remove(key) {\n      var val = this.get(key);\n      delete this.caches[key];\n      return val;\n    };\n\n    _proto.get = function get(key) {\n      return this.caches[key];\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keys = [];\n\n      for (var key in this.caches) {\n        keys.push(key);\n      }\n\n      return keys;\n    };\n\n    return CacheStorage;\n  }();\n\n  var global$2 = env.global,\n      system$1 = env.system;\n  var isZFB = system$1.name === PLATFORM.ZFB;\n\n  var ZFBStorage = function () {\n    function ZFBStorage() {\n      this.cache = new CacheStorage();\n    }\n\n    var _proto = ZFBStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      this.cache.set(key, value);\n      global$2.setStorageSync({\n        key: key,\n        data: value\n      });\n    };\n\n    _proto.get = function get(key) {\n      return this.cache.get(key);\n    };\n\n    _proto.remove = function remove(key) {\n      global$2.removeStorageSync({\n        key: key\n      });\n      return this.cache.remove(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      return this.cache.getKeys();\n    };\n\n    return ZFBStorage;\n  }();\n\n  var MiniStorage = function () {\n    function MiniStorage() {\n      this.cache = new CacheStorage();\n    }\n\n    var _proto2 = MiniStorage.prototype;\n\n    _proto2.set = function set(key, value) {\n      this.cache.set(key, value);\n      global$2.setStorageSync(key, value);\n    };\n\n    _proto2.get = function get(key) {\n      return this.cache.get(key);\n    };\n\n    _proto2.remove = function remove(key) {\n      global$2.removeStorageSync(key);\n      return this.cache.remove(key);\n    };\n\n    _proto2.getKeys = function getKeys() {\n      return this.cache.getKeys();\n    };\n\n    return MiniStorage;\n  }();\n\n  var storage = isZFB ? ZFBStorage : MiniStorage;\n\n  var JSON$1 = {\n    parse: function parse(sJSON) {\n      return new Function('', 'return (' + sJSON + ')')();\n    },\n    stringify: function stringify(value) {\n      return JSON$1.str('', {\n        '': value\n      });\n    },\n    str: function str(key, holder) {\n      var i,\n          k,\n          v,\n          length,\n          partial,\n          value = holder[key],\n          self = JSON$1;\n\n      if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n        value = value.toJSON(key);\n      }\n\n      switch (typeof value) {\n        case 'string':\n          return self.quote(value);\n\n        case 'number':\n          return isFinite(value) ? String(value) : 'null';\n\n        case 'boolean':\n          return String(value);\n\n        case 'object':\n          if (!value) {\n            return 'null';\n          }\n\n          partial = [];\n\n          if (Object.prototype.toString.apply(value) === '[object Array]') {\n            length = value.length;\n\n            for (i = 0; i < length; i += 1) {\n              partial[i] = self.str(i, value) || 'null';\n            }\n\n            v = partial.length === 0 ? '[]' : '[' + partial.join(',') + ']';\n            return v;\n          }\n\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = self.str(k, value);\n\n              if (v) {\n                partial.push(self.quote(k) + ':' + v);\n              }\n            }\n          }\n\n          v = partial.length === 0 ? '{}' : '{' + partial.join(',') + '}';\n          return v;\n      }\n    },\n    quote: function quote(string) {\n      var self = JSON$1;\n      self.rx_escapable.lastIndex = 0;\n      return self.rx_escapable.test(string) ? '\"' + string.replace(self.rx_escapable, function (a) {\n        var c = self.meta[a];\n        return typeof c === 'string' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n      }) + '\"' : '\"' + string + '\"';\n    },\n    rx_escapable: new RegExp(\"[\\\\\\\"\\\\\\\\\\\"\\0-\\x1F\\x7F-\\x9F\\xAD\\u0600-\\u0604\\u070F\\u17B4\\u17B5\\u200C-\\u200F\\u2028-\\u202F\\u2060-\\u206F\\uFEFF\\uFFF0-\\uFFFF]\", 'g'),\n    meta: {\n      '\\b': '\\\\b',\n      '\t': '\\\\t',\n      '\\n': '\\\\n',\n      '\\f': '\\\\f',\n      '\\r': '\\\\r',\n      '\"': '\\\\\"',\n      '\\'\\'': '\\\\\\'\\'',\n      '\\\\': '\\\\\\\\'\n    }\n  };\n\n  var global$3 = env.global;\n  var TEST_KEY = 'RC_TEST_KEY';\n  var TEST_VALUE = 'RC_TEST_VALUE';\n\n  var isSupportLocalStorage = function isSupportLocalStorage() {\n    var isSupport = false;\n    var localStorage = global$3.localStorage;\n\n    if (localStorage) {\n      try {\n        localStorage.setItem(TEST_KEY, TEST_VALUE);\n        var testVal = localStorage.getItem(TEST_KEY);\n\n        if (testVal === TEST_VALUE) {\n          isSupport = true;\n        }\n\n        localStorage.removeItem(TEST_KEY);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebStorage = function () {\n    function WebStorage() {}\n\n    var _proto = WebStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$3.localStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$3.localStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$3.localStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$3.localStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebStorage;\n  }();\n\n  var WebStorage$1 = isSupportLocalStorage() ? WebStorage : CacheStorage;\n\n  var isMini$1 = env.isMini;\n  var Storage = isMini$1 ? storage : WebStorage$1,\n      storage$1 = new Storage();\n\n  var global$4 = env.global;\n\n  var Socket = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      this.socket = global$4.connectSocket(options);\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      this.socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.onOpen(callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.onMessage(callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.onError(callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.onClose(callback);\n    };\n\n    return Socket;\n  }();\n\n  var Socket$1 = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      var url = options.url;\n      this.socket = new WebSocket(url);\n      this.socket.binaryType = 'arraybuffer';\n      return this;\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      return this.socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.addEventListener('open', callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.addEventListener('message', callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.addEventListener('error', callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.addEventListener('close', callback);\n    };\n\n    return Socket;\n  }();\n\n  var isMini$2 = env.isMini;\n  var Socket$2 = isMini$2 ? Socket : Socket$1;\n\n  /*!\n   基于 es6-promise\n   * Github: https://github.com/stefanpenner/es6-promise\n   * @overview es6-promise - a tiny implementation of Promises/A+.\n   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n   * @license   Licensed under MIT license\n   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n   * @version   v4.2.8+1e68dce6\n   */\n  var SparePromise = (function(){function a(a){var b=typeof a;return null!==a&&(\"object\"===b||\"function\"===b)}function b(a){return \"function\"==typeof a}function c(a){P=a;}function d(a){Q=a;}function e(){return function(){return process.nextTick(j)}}function f(){return \"undefined\"!=typeof O?function(){O(j);}:i()}function g(){var a=0,b=new T(j),c=document.createTextNode(\"\");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2;}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.postMessage(0)}}function i(){var a=setTimeout;return function(){return a(j,1)}}function j(){var a,b,c;for(a=0;N>a;a+=2)b=W[a],c=W[a+1],b(c),W[a]=void 0,W[a+1]=void 0;N=0;}function k(){try{var a=Function(\"return this\")().require(\"vertx\");return O=a.runOnLoop||a.runOnContext,f()}catch(b){return i()}}function l(a,b){var e,f,c=this,d=new this.constructor(n);return void 0===d[Y]&&D(d),e=c._state,e?(f=arguments[e-1],Q(function(){return A(e,d,f,c._result)})):y(c,d,a,b),d}function m(a){var c,b=this;return a&&\"object\"==typeof a&&a.constructor===b?a:(c=new b(n),u(c,a),c)}function n(){}function o(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function q(a,b,c,d){try{a.call(b,c,d);}catch(e){return e}}function r(a,b,c){Q(function(a){var d=!1,e=q(c,b,function(c){d||(d=!0,b!==c?u(a,c):w(a,c));},function(b){d||(d=!0,x(a,b));},\"Settle: \"+(a._label||\" unknown promise\"));!d&&e&&(d=!0,x(a,e));},a);}function s(a,b){b._state===$?w(a,b._result):b._state===_?x(a,b._result):y(b,void 0,function(b){return u(a,b)},function(b){return x(a,b)});}function t(a,c,d){c.constructor===a.constructor&&d===l&&c.constructor.resolve===m?s(a,c):void 0===d?w(a,c):b(d)?r(a,c,d):w(a,c);}function u(b,c){if(b===c)x(b,o());else if(a(c)){var d=void 0;try{d=c.then;}catch(e){return void x(b,e)}t(b,c,d);}else w(b,c);}function v(a){a._onerror&&a._onerror(a._result),z(a);}function w(a,b){a._state===Z&&(a._result=b,a._state=$,0!==a._subscribers.length&&Q(z,a));}function x(a,b){a._state===Z&&(a._state=_,a._result=b,Q(v,a));}function y(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+$]=c,e[f+_]=d,0===f&&a._state&&Q(z,a);}function z(a){var d,e,f,g,b=a._subscribers,c=a._state;if(0!==b.length){for(d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0;}}function A(a,c,d,e){var f=b(d),g=void 0,h=void 0,i=!0;if(f){try{g=d(e);}catch(j){i=!1,h=j;}if(c===g)return void x(c,p())}else g=e;c._state!==Z||(f&&i?u(c,g):i===!1?x(c,h):a===$?w(c,g):a===_&&x(c,g));}function B(a,b){try{b(function(b){u(a,b);},function(b){x(a,b);});}catch(c){x(a,c);}}function C(){return ab++}function D(a){a[Y]=ab++,a._state=void 0,a._result=void 0,a._subscribers=[];}function E(){return new Error(\"Array Methods must be provided an Array\")}function F(a){return new bb(this,a).promise}function G(a){var b=this;return new b(M(a)?function(c,d){for(var e=a.length,f=0;e>f;f++)b.resolve(a[f]).then(c,d);}:function(a,b){return b(new TypeError(\"You must pass an array to race.\"))})}function H(a){var b=this,c=new b(n);return x(c,a),c}function I(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function J(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function K(){var c,d,a=void 0;if(\"undefined\"!=typeof global)a=global;else if(\"undefined\"!=typeof self)a=self;else try{a=Function(\"return this\")();}catch(b){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}if(c=a.Promise){d=null;try{d=Object.prototype.toString.call(c.resolve());}catch(b){}if(\"[object Promise]\"===d&&!c.cast)return}a.Promise=cb;}var M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,L=void 0;return L=Array.isArray?Array.isArray:function(a){return \"[object Array]\"===Object.prototype.toString.call(a)},M=L,N=0,O=void 0,P=void 0,Q=function(a,b){W[N]=a,W[N+1]=b,N+=2,2===N&&(P?P(j):X());},R=\"undefined\"!=typeof window?window:void 0,S=R||{},T=S.MutationObserver||S.WebKitMutationObserver,U=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),V=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,W=new Array(1e3),X=void 0,X=U?e():T?g():V?h():void 0===R&&\"function\"==typeof require?k():i(),Y=Math.random().toString(36).substring(2),Z=void 0,$=1,_=2,ab=0,bb=function(){function a(a,b){this._instanceConstructor=a,this.promise=new a(n),this.promise[Y]||D(this.promise),M(b)?(this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(b),0===this._remaining&&w(this.promise,this._result))):x(this.promise,E());}return a.prototype._enumerate=function(a){for(var b=0;this._state===Z&&b<a.length;b++)this._eachEntry(a[b],b);},a.prototype._eachEntry=function(a,b){var e,f,g,i,c=this._instanceConstructor,d=c.resolve;if(d===m){e=void 0,f=void 0,g=!1;try{e=a.then;}catch(h){g=!0,f=h;}e===l&&a._state!==Z?this._settledAt(a._state,b,a._result):\"function\"!=typeof e?(this._remaining--,this._result[b]=a):c===cb?(i=new c(n),g?x(i,f):t(i,a,e),this._willSettleAt(i,b)):this._willSettleAt(new c(function(b){return b(a)}),b);}else this._willSettleAt(d(a),b);},a.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===Z&&(this._remaining--,a===_?x(d,c):this._result[b]=c),0===this._remaining&&w(d,this._result);},a.prototype._willSettleAt=function(a,b){var c=this;y(a,void 0,function(a){return c._settledAt($,b,a)},function(a){return c._settledAt(_,b,a)});},a}(),cb=function(){function a(b){this[Y]=C(),this._result=this._state=void 0,this._subscribers=[],n!==b&&(\"function\"!=typeof b&&I(),this instanceof a?B(this,b):J());}return a.prototype[\"catch\"]=function(a){return this.then(null,a)},a.prototype[\"finally\"]=function(a){var c=this,d=c.constructor;return b(a)?c.then(function(b){return d.resolve(a()).then(function(){return b})},function(b){return d.resolve(a()).then(function(){throw b})}):c.then(a,a)},a}(),cb.prototype.then=l,cb.all=F,cb.race=G,cb.resolve=m,cb.reject=H,cb._setScheduler=c,cb._setAsap=d,cb._asap=Q,cb.polyfill=K,cb.Promise=cb,cb})();\n\n  var global$5 = env.global,\n      system$2 = env.system;\n  var isZFB$1 = system$2.name === PLATFORM.ZFB;\n\n  var zfbRequest = function zfbRequest(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    headers = headers || {};\n    timeout = timeout || HTTP_TIMEOUT;\n    return global$5.httpRequest({\n      url: url,\n      method: method,\n      data: body,\n      headers: headers,\n      timeout: timeout,\n      success: option.success,\n      fail: function fail(result) {\n        if (result.status === 202) {\n          option.success(result);\n        } else {\n          option.fail(result);\n        }\n      }\n    });\n  };\n\n  var request = isZFB$1 ? zfbRequest : global$5.request;\n\n  var global$6 = env.global;\n\n  var isValidRequest = function isValidRequest(obj) {\n    return typeof obj === 'function' || typeof obj === 'object';\n  };\n\n  var createXHR = function createXHR() {\n    var item = {\n      XMLHttpRequest: function (_XMLHttpRequest) {\n        function XMLHttpRequest() {\n          return _XMLHttpRequest.apply(this, arguments);\n        }\n\n        XMLHttpRequest.toString = function () {\n          return _XMLHttpRequest.toString();\n        };\n\n        return XMLHttpRequest;\n      }(function () {\n        return new XMLHttpRequest();\n      }),\n      XDomainRequest: function (_XDomainRequest) {\n        function XDomainRequest() {\n          return _XDomainRequest.apply(this, arguments);\n        }\n\n        XDomainRequest.toString = function () {\n          return _XDomainRequest.toString();\n        };\n\n        return XDomainRequest;\n      }(function () {\n        return new XDomainRequest();\n      }),\n      ActiveXObject: function (_ActiveXObject) {\n        function ActiveXObject() {\n          return _ActiveXObject.apply(this, arguments);\n        }\n\n        ActiveXObject.toString = function () {\n          return _ActiveXObject.toString();\n        };\n\n        return ActiveXObject;\n      }(function () {\n        return new ActiveXObject('Microsoft.XMLHTTP');\n      })\n    };\n    var isXHR = isValidRequest(global$6.XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest();\n    var isXDR = isValidRequest(global$6.XDomainRequest);\n    var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n    return item[key]();\n  };\n\n  var request$1 = function request(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        success = option.success,\n        fail = option.fail;\n    method = method || REQUEST_METHOD.GET;\n    var xhr = createXHR();\n    xhr.open(method, url);\n\n    if (headers && xhr.setRequestHeader) {\n      for (var key in headers) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n\n    if ('onload' in xhr) {\n      xhr.onload = function () {\n        success(xhr.responseText, xhr);\n      };\n\n      xhr.onerror = function () {\n        fail(xhr.responseText, xhr);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          var result = xhr.responseText,\n              status = xhr.status;\n\n          if (status === 0) {\n            fail(result, xhr, status);\n          } else {\n            success(result, xhr, status);\n          }\n        }\n      };\n    }\n\n    xhr.send(body);\n    return xhr;\n  };\n\n  var request$2 = env.isMini ? request : request$1;\n\n  /*\n   * JavaScript MD5\n   * https://github.com/blueimp/JavaScript-MD5\n   *\n   * Copyright 2011, Sebastian Tschan\n   * https://blueimp.net\n   *\n   * Licensed under the MIT license:\n   * https://opensource.org/licenses/MIT\n   *\n   * Based on\n   * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n   * Digest Algorithm, as defined in RFC 1321.\n   * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n   * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n   * Distributed under the BSD License\n   * See http://pajhome.org.uk/crypt/md5 for more info.\n   */\n  var md5 = (function(){function a(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){var h,i,j,k,l,m,n,o,p;for(b[c>>5]|=128<<c%32,b[(c+64>>>9<<4)+14]=c,m=1732584193,n=-271733879,o=-1732584194,p=271733878,h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return [m,n,o,p]}function i(a){var b,c=\"\",d=32*a.length;for(b=0;d>b;b+=8)c+=String.fromCharCode(255&a[b>>5]>>>b%32);return c}function j(a){var b,d,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(d=8*a.length,b=0;d>b;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,g,d=j(a),e=[],f=[];for(e[15]=f[15]=void 0,d.length>16&&(d=h(d,8*a.length)),c=0;16>c;c+=1)e[c]=909522486^d[c],f[c]=1549556828^d[c];return g=h(e.concat(j(b)),512+8*b.length),i(h(f.concat(g),640))}function m(a){var d,e,b=\"0123456789abcdef\",c=\"\";for(e=0;e<a.length;e+=1)d=a.charCodeAt(e),c+=b.charAt(15&d>>>4)+b.charAt(15&d);return c}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s})();\n\n  var global$7 = env.global;\n  var Promise$1 = global$7.Promise;\n\n  var isSupportPromise = function isSupportPromise() {\n    if (!global$7.Promise) return false;\n\n    var defer = function () {\n      return global$7.Promise.resolve();\n    }();\n\n    return defer.then && defer[\"catch\"] && defer[\"finally\"];\n  };\n\n  var Defer = isSupportPromise() ? global$7.Promise : SparePromise;\n\n  var noop = function noop(data) {\n    return data;\n  };\n\n  var deferNoop = function deferNoop(data) {\n    return Promise$1.resolve(data);\n  };\n\n  var JSON$2 = JSON$1;\n\n  var allowError = function allowError(event) {\n    var result;\n\n    try {\n      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n\n      result = event.apply(void 0, args);\n    } catch (e) {\n      result = null;\n    }\n\n    return result;\n  };\n\n  var toJSON = function toJSON(val) {\n    return allowError(JSON$2.stringify, val);\n  };\n\n  var parseJSON = function parseJSON(val) {\n    return allowError(JSON$2.parse, val);\n  };\n\n  var copy = function copy(val) {\n    return parseJSON(toJSON(val));\n  };\n\n  var isObject = function isObject(val) {\n    return Object.prototype.toString.call(val) === '[object Object]';\n  };\n\n  var isArray = function isArray(val) {\n    return Object.prototype.toString.call(val).indexOf('Array') !== -1;\n  };\n\n  var isFunction = function isFunction(val) {\n    return Object.prototype.toString.call(val) === '[object Function]';\n  };\n\n  var isString = function isString(val) {\n    return Object.prototype.toString.call(val) === '[object String]';\n  };\n\n  var isBoolean = function isBoolean(val) {\n    return Object.prototype.toString.call(val) === '[object Boolean]';\n  };\n\n  var isUndefined = function isUndefined(val) {\n    return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  };\n\n  var isNull = function isNull(val) {\n    return Object.prototype.toString.call(val) === '[object Null]';\n  };\n\n  var isNumber = function isNumber(val) {\n    return Object.prototype.toString.call(val) === '[object Number]';\n  };\n\n  var isArrayBuffer = function isArrayBuffer(val) {\n    return Object.prototype.toString.call(val) === '[object ArrayBuffer]';\n  };\n\n  var isPromise = function isPromise(val) {\n    var isTrue = false;\n\n    try {\n      isTrue = Object.prototype.toString.call(val) === '[object Promise]' || val && val.then && val[\"catch\"] && val[\"finally\"];\n    } catch (e) {\n      isTrue = false;\n    }\n\n    return isTrue;\n  };\n\n  var getTypeName = function getTypeName(data) {\n    var typeName = Object.prototype.toString.call(data);\n    return typeName.substring(8, typeName.length - 1);\n  };\n\n  var isEqual = function isEqual(source, target) {\n    return source === target;\n  };\n\n  var ArrayBufferToArray = function ArrayBufferToArray(data) {\n    if (isArrayBuffer(data)) {\n      return [].slice.call(new Int8Array(data));\n    }\n\n    return data;\n  };\n\n  var ArrayBufferToUint8Array = function ArrayBufferToUint8Array(data) {\n    if (isArrayBuffer(data)) {\n      return new Uint8Array(data);\n    }\n\n    return data;\n  };\n\n  var forEach = function forEach(source, event, options) {\n    options = options || {};\n    event = event || noop;\n    var _options = options,\n        isReverse = _options.isReverse;\n\n    var loopObj = function loopObj() {\n      for (var key in source) {\n        event(source[key], key, source);\n      }\n    };\n\n    var loopArr = function loopArr() {\n      if (isReverse) {\n        for (var i = source.length - 1; i >= 0; i--) {\n          event(source[i], i);\n        }\n      } else {\n        for (var j = 0, len = source.length; j < len; j++) {\n          event(source[j], j);\n        }\n      }\n    };\n\n    if (isObject(source)) {\n      loopObj();\n    }\n\n    if (isArray(source) || isString(source)) {\n      loopArr();\n    }\n  };\n\n  var isEmpty = function isEmpty(val) {\n    var result = true;\n\n    if (isObject(val)) {\n      forEach(val, function () {\n        result = false;\n      });\n    }\n\n    if (isString(val) || isArray(val)) {\n      result = val.length === 0;\n    }\n\n    if (isNumber(val)) {\n      result = val === 0;\n    }\n\n    return result;\n  };\n\n  var isNumberData = function isNumberData(val) {\n    var isEmptyVal = isEmpty(val);\n    val = Number(val);\n    return isNumber(val) && !isEmptyVal;\n  };\n\n  var getKeys = function getKeys(obj) {\n    var keyList = [];\n    forEach(obj, function (val, key) {\n      keyList.push(key);\n    });\n    return keyList;\n  };\n\n  var getValues = function getValues(obj) {\n    var valList = [];\n    forEach(obj, function (val) {\n      valList.push(val);\n    });\n    return valList;\n  };\n\n  var getTimestamp = function getTimestamp(time) {\n    return new Date(time).getTime();\n  };\n\n  var getCurrentTimestamp = function getCurrentTimestamp() {\n    return new Date().getTime();\n  };\n\n  var isValidJSON = function isValidJSON(jsonStr) {\n    var isValid = false;\n\n    try {\n      var obj = JSON$2.parse(jsonStr);\n      var str = JSON$2.stringify(obj);\n      isValid = str === jsonStr;\n    } catch (e) {\n      isValid = false;\n    }\n\n    return isValid;\n  };\n\n  var isSupportSocket = function isSupportSocket() {\n    var isMini = env.isMini;\n\n    if (isMini) {\n      return true;\n    }\n\n    var Socket = global$7.WebSocket;\n\n    if (isUndefined(Socket)) {\n      return false;\n    }\n\n    var hasWS = typeof Socket === 'object' || typeof Socket === 'function';\n    var isIntegrity = typeof Socket.OPEN === 'number';\n    return hasWS && isIntegrity;\n  };\n\n  var indexOf = function indexOf(source, searchVal) {\n    if (source.indexOf) {\n      return source.indexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    });\n    return index;\n  };\n\n  var lastIndexOf = function lastIndexOf(source, searchVal) {\n    if (source.lastIndexOf) {\n      return source.lastIndexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    }, {\n      isReverse: true\n    });\n    return index;\n  };\n\n  var isInclude = function isInclude(source, searchVal) {\n    var index = indexOf(source, searchVal);\n    return index !== -1;\n  };\n\n  var substring = function substring(source, start, end) {\n    return source.substring(start, end);\n  };\n\n  var spliceByChild = function spliceByChild(arr, item) {\n    forEach(arr, function (child, index) {\n      if (isEqual(child, item)) {\n        arr.splice(index, 1);\n      }\n    }, {\n      isReverse: true\n    });\n  };\n\n  var parse16To10 = function parse16To10(num) {\n    return parseInt(num, 16);\n  };\n\n  var isPlus = function isPlus(num) {\n    return +num === num;\n  };\n\n  var filter = function filter(source, event) {\n    var newArr = [];\n\n    for (var i = 0, max = source.length; i < max; i++) {\n      var data = source[i];\n\n      if (event(data, i)) {\n        newArr.push(data);\n      }\n    }\n\n    return newArr;\n  };\n\n  var map = function map(source, event) {\n    forEach(source, function (item, index) {\n      source[index] = event(item, index);\n    });\n    return source;\n  };\n\n  var extend = function extend(destination, sources) {\n    destination = destination || {};\n    sources = sources || {};\n\n    for (var key in sources) {\n      var value = sources[key];\n\n      if (!isUndefined(value)) {\n        destination[key] = value;\n      }\n    }\n\n    return destination;\n  };\n\n  var extendInShallow = function extendInShallow(destination, sources) {\n    destination = copy(destination);\n    sources = copy(sources);\n    return extend(destination, sources);\n  };\n\n  var deferred = function deferred(callbacks) {\n    return new Defer(callbacks);\n  };\n\n  var deferTimeout = function deferTimeout(timeout) {\n    return deferred(function (resolve) {\n      var timeouter = setTimeout(function () {\n        resolve(timeouter);\n      }, timeout);\n    });\n  };\n\n  var tplEngine = function tplEngine(temp, data, regexp) {\n    var replaceAction = function replaceAction(obj) {\n      return temp.replace(regexp || /{([^}]+)}/g, function (match, name) {\n        if (match.charAt(0) === '\\\\') {\n          return match.slice(1);\n        }\n\n        return obj[name] !== undefined ? obj[name] : '{' + name + '}';\n      });\n    };\n\n    if (!isArray(data)) {\n      data = [data];\n    }\n\n    var ret = [];\n    forEach(data, function (item) {\n      ret.push(replaceAction(item));\n    });\n    return ret.join('');\n  };\n\n  var getRandomNum = function getRandomNum(max, min) {\n    min = min || 0;\n    var range = max - min,\n        random = Math.random();\n    return min + Math.round(random * range);\n  };\n\n  var Timer = function () {\n    function Timer(options) {\n      this._timerId = void 0;\n      this._timerEvent = void 0;\n      this._timerClearEvent = void 0;\n      this.timeout = 0;\n      this.type = TIMER_TYPE.TIMEOUT;\n      this.status = TIMER_STATUS.PENNDING;\n      var self = this;\n      extend(self, options);\n      var type = self.type;\n      var isTimeout = type === TIMER_TYPE.TIMEOUT;\n\n      if (isTimeout) {\n        self._timerEvent = global$7.setTimeout;\n        self._timerClearEvent = clearTimeout;\n      } else {\n        self._timerEvent = global$7.setInterval;\n        self._timerClearEvent = clearInterval;\n      }\n\n      return self;\n    }\n\n    var _proto = Timer.prototype;\n\n    _proto.start = function start(event, options) {\n      options = options || {};\n      var self = this,\n          isTimeout = self.type === TIMER_TYPE.TIMEOUT;\n      var _options2 = options,\n          args = _options2.args,\n          thisArg = _options2.thisArg;\n      self.stop();\n      self._timerId = self._timerEvent.call(global$7, function () {\n        isTimeout && self.stop();\n        event.apply(thisArg, args);\n      }, self.timeout);\n      self.status = TIMER_STATUS.BUSY;\n    };\n\n    _proto.stop = function stop() {\n      var self = this;\n\n      if (self._timerId) {\n        self._timerClearEvent.call(global$7, self._timerId);\n\n        self.status = TIMER_STATUS.ENDING;\n      }\n    };\n\n    return Timer;\n  }();\n\n  var DeferHandler = function () {\n    function DeferHandler(options) {\n      this._list = {};\n      this.timeout = IM_TIMEOUT;\n      extend(this, options);\n    }\n\n    var _proto2 = DeferHandler.prototype;\n\n    _proto2._isInvalid = function _isInvalid(id) {\n      var handlers = this._list[id];\n      return !isArray(handlers) || isEmpty(handlers);\n    };\n\n    _proto2._exec = function _exec(id, isError, data) {\n      var self = this;\n\n      if (self._isInvalid(id)) {\n        return;\n      }\n\n      var handlers = self._list[id],\n          handler = handlers[0];\n      isError ? handler.reject(data) : handler.resolve(data);\n      handlers.splice(0, 1);\n    };\n\n    _proto2.add = function add(id, defer, options) {\n      options = options || {};\n      var self = this;\n      var resolve = defer.resolve,\n          reject = defer.reject;\n      var timeout = options.timeout || self.timeout;\n\n      if (self._isInvalid(id)) {\n        self._list[id] = [];\n      }\n\n      var timer = new Timer({\n        timeout: timeout\n      });\n      timer.start(function () {\n        self.reject(id, ERROR_INFO.TIMEOUT.code);\n      });\n\n      self._list[id].push({\n        resolve: resolve,\n        reject: reject,\n        timer: timer\n      });\n    };\n\n    _proto2.resolve = function resolve(id, data) {\n      this._exec(id, false, data);\n    };\n\n    _proto2.reject = function reject(id, error) {\n      this._exec(id, true, error);\n    };\n\n    return DeferHandler;\n  }();\n\n  var EventEmitter = function () {\n    function EventEmitter() {\n      this._events = void 0;\n      this._events = {};\n    }\n\n    var _proto3 = EventEmitter.prototype;\n\n    _proto3.on = function on(name, event) {\n      var _events = this._events[name] || [];\n\n      _events.push(event);\n\n      this._events[name] = _events;\n    };\n\n    _proto3.off = function off(name, offEvent) {\n      if (offEvent) {\n        var _events = this._events[name] || [];\n\n        spliceByChild(_events, offEvent);\n      } else {\n        delete this._events[name];\n      }\n    };\n\n    _proto3.emit = function emit(name, data, error) {\n      var _events = this._events[name];\n      forEach(_events, function (event) {\n        event(data, error);\n      });\n    };\n\n    _proto3.clear = function clear() {\n      this._events = {};\n    };\n\n    return EventEmitter;\n  }();\n\n  var decodeURI = function decodeURI(uri) {\n    return global$7.decodeURIComponent(uri);\n  };\n\n  var encodeURI = function encodeURI(uri) {\n    return global$7.encodeURIComponent(uri);\n  };\n\n  var int64ToTimestamp = function int64ToTimestamp(obj) {\n    if (obj.low === undefined) {\n      return obj;\n    }\n\n    var low = obj.low;\n\n    if (low < 0) {\n      low += 0xffffffff + 1;\n    }\n\n    low = low.toString(16);\n    var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n    return timestamp;\n  };\n\n  var batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n    forEach(data, function (item, key) {\n      if (isObject(item)) {\n        data[key] = int64ToTimestamp(item);\n      }\n    });\n    return data;\n  };\n\n  var Queue = function () {\n    function Queue(defaultConfig) {\n      this._isRunning = false;\n      this._list = [];\n      this._defaultConfig = void 0;\n      this._defaultConfig = defaultConfig;\n    }\n\n    var _proto4 = Queue.prototype;\n\n    _proto4.add = function add(params) {\n      params = params || this._defaultConfig;\n\n      this._list.push(params);\n\n      this.run();\n    };\n\n    _proto4.run = function run() {\n      var self = this;\n      var _isRunning = self._isRunning,\n          _list = self._list;\n      var isFinished = isEmpty(_list);\n\n      if (_isRunning || isFinished) {\n        return;\n      }\n\n      var firstItem = _list.splice(0, 1)[0];\n\n      var event = firstItem.event,\n          args = firstItem.args,\n          thisArg = firstItem.thisArg;\n\n      var next = function next() {\n        self._isRunning = false;\n        self.run();\n      };\n\n      if (!event) {\n        return next();\n      }\n\n      self._isRunning = true;\n      event.apply(thisArg, args)[\"finally\"](next);\n    };\n\n    return Queue;\n  }();\n\n  var secondsToMilliseconds = function secondsToMilliseconds(seconds) {\n    return seconds * 1000;\n  };\n\n  var request$3 = function request(url, options) {\n    options = options || {};\n    return deferred(function (resolve, reject) {\n      options = extend(options, {\n        url: url,\n        success: function success(responseText, xhr, status) {\n          resolve({\n            responseText: responseText,\n            xhr: xhr,\n            status: status\n          });\n        },\n        fail: function fail(result, xhr, status) {\n          reject({\n            result: result,\n            xhr: xhr,\n            status: status\n          });\n        }\n      });\n      request$2(options);\n    });\n  };\n\n  var requestByUrlList = function requestByUrlList(urlList, options) {\n    if (isEmpty(urlList)) {\n      return Defer.reject();\n    }\n\n    var url = urlList[0];\n    return request$3(url, options).then(function (result) {\n      result = result || {};\n      result.urlList = urlList;\n      return result;\n    })[\"catch\"](function (error) {\n      urlList.splice(0, 1);\n\n      if (isEmpty(urlList)) {\n        return Defer.reject(error);\n      } else {\n        return requestByUrlList(urlList, options);\n      }\n    });\n  };\n\n  var requestForFaster = function requestForFaster(urlList, option) {\n    option = option || {};\n    var timeInterval = option.timeInterval || 0;\n    var faildCount = 0,\n        totalCount = urlList.length;\n    var requestXhrs = [];\n    var totalTimer = new Timer({\n      timeout: 15 * 1000\n    });\n    var reqCountdownTimers = [];\n\n    var clearAll = function clearAll() {\n      forEach(reqCountdownTimers, function (timer) {\n        timer.stop();\n      });\n      forEach(requestXhrs, function (xhr) {\n        xhr.abort();\n      });\n      reqCountdownTimers.length = 0;\n      requestXhrs.length = 0;\n    };\n\n    var isAllFaild = function isAllFaild() {\n      return faildCount === totalCount;\n    };\n\n    return deferred(function (resolve, reject) {\n      var _success = function success(url, index) {\n        clearAll();\n        resolve({\n          url: url,\n          index: index\n        });\n      };\n\n      var _fail = function fail() {\n        clearAll();\n        reject();\n      };\n\n      forEach(urlList, function (url, index) {\n        var timer = new Timer({\n          timeout: timeInterval * index\n        });\n        timer.start(function () {\n          var xhr;\n          var opt = extend({\n            url: url,\n            success: function success() {\n              _success(url, index);\n            },\n            fail: function fail() {\n              faildCount++;\n              isAllFaild() && _fail();\n            }\n          }, option);\n          xhr = request$2(opt);\n          requestXhrs.push(xhr);\n        });\n        reqCountdownTimers.push(timer);\n      });\n      totalTimer.start(_fail);\n    });\n  };\n\n  var NetworkDetecter = function () {\n    function NetworkDetecter(option) {\n      this._option = void 0;\n      this._detectCount = 0;\n      this._timeoutId = void 0;\n      this._option = option;\n    }\n\n    var _proto5 = NetworkDetecter.prototype;\n\n    _proto5._detect = function _detect() {\n      var self = this;\n      var _detectCount = self._detectCount,\n          _option = self._option;\n      var url = _option.url,\n          timeout = _option.intervalTime,\n          max = _option.max;\n      _detectCount++;\n      return request$3(url).then(function () {\n        return;\n      }, function (_ref) {\n        var status = _ref.status;\n\n        if (isEqual(status, 404)) {\n          return;\n        }\n\n        var isAlreadyMax = max && isEqual(max, _detectCount);\n\n        if (isAlreadyMax) {\n          return Defer.reject();\n        }\n\n        return deferTimeout(timeout).then(function (timeoutId) {\n          self._detectCount = _detectCount;\n          self._timeoutId = timeoutId;\n          return self._detect();\n        });\n      });\n    };\n\n    _proto5.start = function start() {\n      return this._detect();\n    };\n\n    _proto5.stop = function stop() {\n      var timeoutId = this._timeoutId;\n\n      if (timeoutId) {\n        clearTimeout(timeoutId);\n      }\n    };\n\n    return NetworkDetecter;\n  }();\n\n  var toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n    if (isUndefined(startIndex) || isUndefined(endIndex)) {\n      return str.toUpperCase();\n    }\n\n    var sliceStr = str.slice(startIndex, endIndex);\n    str = str.replace(sliceStr, function (text) {\n      return text.toUpperCase();\n    });\n    return str;\n  };\n\n  var getDomainByUrl = function getDomainByUrl(url) {\n    var StartMark = '://',\n        EndMark = '/';\n    var urlProtocolIndex = indexOf(url, StartMark);\n    var hasProtocol = urlProtocolIndex > -1;\n\n    if (hasProtocol) {\n      urlProtocolIndex = urlProtocolIndex + StartMark.length;\n      url = substring(url, urlProtocolIndex, url.length);\n    }\n\n    var urlPathIndex = indexOf(url, EndMark);\n    var hasPath = urlPathIndex > -1;\n\n    if (hasPath) {\n      url = substring(url, 0, urlPathIndex);\n    }\n\n    return url;\n  };\n\n  var getValidUrl = function getValidUrl(url, option) {\n    option = option || {};\n    var ProtocolMark = '://';\n    var hasProtocol = isInclude(url, ProtocolMark);\n    var localProtocol = env.protocol.http;\n    var _option2 = option,\n        protocol = _option2.protocol;\n\n    if (protocol) {\n      var domain = getDomainByUrl(url);\n      url = protocol + \"//\" + domain;\n    }\n\n    if (hasProtocol) {\n      var urlProtocolIndex = indexOf(url, ProtocolMark) + 1;\n      var urlProtocol = substring(url, 0, urlProtocolIndex);\n      var isHttpUrl = urlProtocol === HTTP_PROTOCOL.HTTP;\n      var isLocalHttps = localProtocol === HTTP_PROTOCOL.HTTPS;\n\n      if (isHttpUrl && isLocalHttps) {\n        var _domain = getDomainByUrl(url);\n\n        return HTTP_PROTOCOL.HTTPS + \"//\" + _domain;\n      } else {\n        return url;\n      }\n    } else {\n      return localProtocol + \"//\" + url;\n    }\n  };\n\n  var quickSort = function quickSort(arr, event) {\n    var sort = function sort(array, left, right, event) {\n      event = event || function (a, b) {\n        return a <= b;\n      };\n\n      if (left < right) {\n        var x = array[right],\n            i = left - 1,\n            temp;\n\n        for (var j = left; j <= right; j++) {\n          if (event(array[j], x)) {\n            i++;\n            temp = array[i];\n            array[i] = array[j];\n            array[j] = temp;\n          }\n        }\n\n        sort(array, left, i - 1, event);\n        sort(array, i + 1, right, event);\n      }\n\n      return array;\n    };\n\n    return sort(arr, 0, arr.length - 1, event);\n  };\n\n  var unique = function unique(arr, event) {\n    var keyEvent = event || function (data) {\n      return data;\n    };\n\n    var hashTable = {};\n    var newArr = [];\n    forEach(arr, function (data) {\n      var key = keyEvent(data);\n\n      if (!hashTable[key]) {\n        hashTable[key] = true;\n        newArr.push(data);\n      }\n    });\n    return newArr;\n  };\n\n  var utils = {\n    Storage: storage$1,\n    Socket: Socket$2,\n    Cache: CacheStorage,\n    JSON: JSON$2,\n    Defer: Defer,\n    httpRequest: request$2,\n    request: request$3,\n    requestByUrlList: requestByUrlList,\n    requestForFaster: requestForFaster,\n    md5: md5,\n    DeferHandler: DeferHandler,\n    EventEmitter: EventEmitter,\n    Timer: Timer,\n    Queue: Queue,\n    noop: noop,\n    deferNoop: deferNoop,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    isObject: isObject,\n    isArray: isArray,\n    isFunction: isFunction,\n    isArrayBuffer: isArrayBuffer,\n    isString: isString,\n    isBoolean: isBoolean,\n    isUndefined: isUndefined,\n    isNull: isNull,\n    isNumber: isNumber,\n    isNumberData: isNumberData,\n    isPromise: isPromise,\n    getTypeName: getTypeName,\n    isPlus: isPlus,\n    isEmpty: isEmpty,\n    isEqual: isEqual,\n    isValidJSON: isValidJSON,\n    isSupportSocket: isSupportSocket,\n    ArrayBufferToArray: ArrayBufferToArray,\n    ArrayBufferToUint8Array: ArrayBufferToUint8Array,\n    indexOf: indexOf,\n    lastIndexOf: lastIndexOf,\n    isInclude: isInclude,\n    substring: substring,\n    getKeys: getKeys,\n    getValues: getValues,\n    getTimestamp: getTimestamp,\n    getCurrentTimestamp: getCurrentTimestamp,\n    parse16To10: parse16To10,\n    forEach: forEach,\n    map: map,\n    filter: filter,\n    extend: extend,\n    extendInShallow: extendInShallow,\n    deferred: deferred,\n    tplEngine: tplEngine,\n    getRandomNum: getRandomNum,\n    int64ToTimestamp: int64ToTimestamp,\n    batchInt64ToTimestamp: batchInt64ToTimestamp,\n    encodeURI: encodeURI,\n    decodeURI: decodeURI,\n    secondsToMilliseconds: secondsToMilliseconds,\n    NetworkDetecter: NetworkDetecter,\n    toUpperCase: toUpperCase,\n    getDomainByUrl: getDomainByUrl,\n    getValidUrl: getValidUrl,\n    quickSort: quickSort,\n    unique: unique\n  };\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__proto__ = superClass;\n  }\n\n  var _PUBLISH_TOPIC_TO_CON, _CONVERSATION_TYPE_TO, _CONVERSATION_TYPE_TO2, _CONVERSATION_TYPE_TO3;\n  var SUCCESS_CODE = 0;\n  var PULL_MSG_TYPE = {\n    NORMAL: 1,\n    CHATROOM: 2\n  };\n  var MESSAGE_NAME = {\n    CONN_ACK: 'ConnAckMessage',\n    DISCONNECT: 'DisconnectMessage',\n    PING_REQ: 'PingReqMessage',\n    PING_RESP: 'PingRespMessage',\n    PUBLISH: 'PublishMessage',\n    PUB_ACK: 'PubAckMessage',\n    QUERY: 'QueryMessage',\n    QUERY_CON: 'QueryConMessage',\n    QUERY_ACK: 'QueryAckMessage'\n  };\n  var QOS = {\n    AT_MOST_ONCE: 0,\n    AT_LEAST_ONCE: 1,\n    EXACTLY_ONCE: 2,\n    DEFAULT: 3,\n    '0': 'AT_MOST_ONCE',\n    '1': 'AT_LEAST_ONCE',\n    '2': 'EXACTLY_ONCE',\n    '3': 'DEFAULT'\n  };\n  var OPERATE_TYPE = {\n    CONNECT: 1,\n    '1': 'CONNECT',\n    CONNACK: 2,\n    '2': 'CONNACK',\n    PUBLISH: 3,\n    '3': 'PUBLISH',\n    PUBACK: 4,\n    '4': 'PUBACK',\n    QUERY: 5,\n    '5': 'QUERY',\n    QUERYACK: 6,\n    '6': 'QUERYACK',\n    QUERYCON: 7,\n    '7': 'QUERYCON',\n    SUBSCRIBE: 8,\n    '8': 'SUBSCRIBE',\n    SUBACK: 9,\n    '9': 'SUBACK',\n    UNSUBSCRIBE: 10,\n    '10': 'UNSUBSCRIBE',\n    UNSUBACK: 11,\n    '11': 'UNSUBACK',\n    PINGREQ: 12,\n    '12': 'PINGREQ',\n    PINGRESP: 13,\n    '13': 'PINGRESP',\n    DISCONNECT: 14,\n    '14': 'DISCONNECT'\n  };\n  var MESSAGE_TAG = {\n    NONE: 0,\n    PERSIT_ONLY: 1,\n    COUNT_ONLY: 2,\n    PERSIT_AND_COUNT: 3\n  };\n  var PUBLISH_TOPIC = {\n    PRIVATE: 'ppMsgP',\n    GROUP: 'pgMsgP',\n    CHATROOM: 'chatMsg',\n    CUSTOMER_SERVICE: 'pcMsgP',\n    RECALL: 'recallMsg',\n    NOTIFY_PULL_MSG: 's_ntf',\n    RECEIVE_MSG: 's_msg',\n    SYNC_STATUS: 's_stat',\n    SYNC_CHRM_KV: 's_cmd'\n  };\n  var QUERY_TOPIC = {\n    GET_SYNC_TIME: 'qrySessionsAtt',\n    PULL_MSG: 'pullMsg',\n    GET_CONVERSATION_LIST: 'qrySessions',\n    REMOVE_CONVERSATION_LIST: 'delSessions',\n    DELETE_MESSAGES: 'delMsg',\n    CLEAR_UNREAD_COUNT: 'updRRTime',\n    PULL_CHRM_MSG: 'chrmPull',\n    JOIN_CHATROOM: 'joinChrm',\n    QUIT_CHATROOM: 'exitChrm',\n    GET_CHATROOM_INFO: 'queryChrmI',\n    GET_OLD_CONVERSATION_LIST: 'qryRelation',\n    REMOVE_OLD_CONVERSATION: 'delRelation',\n    CLEAR_MESSAGES: {\n      PRIVATE: 'cleanPMsg',\n      GROUP: 'cleanGMsg',\n      CUSTOMER_SERVICE: 'cleanCMsg',\n      SYSTEM: 'cleanSMsg'\n    }\n  };\n  var QUERY_HISTORY_TOPIC = {\n    PRIVATE: 'qryPMsg',\n    GROUP: 'qryGMsg',\n    CHATROOM: 'qryCHMsg',\n    CUSTOMER_SERVICE: 'qryCMsg',\n    SYSTEM: 'qrySMsg'\n  };\n  var PUBLISH_TOPIC_TO_CONVERSATION_TYPE = (_PUBLISH_TOPIC_TO_CON = {}, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CUSTOMER_SERVICE] = CONVERSATION_TYPE.CUSTOMER_SERVICE, _PUBLISH_TOPIC_TO_CON);\n  var CONVERSATION_TYPE_TO_PUBLISH_TOPIC = (_CONVERSATION_TYPE_TO = {}, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.PRIVATE] = PUBLISH_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.GROUP] = PUBLISH_TOPIC.GROUP, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CHATROOM] = PUBLISH_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CUSTOMER_SERVICE] = PUBLISH_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO);\n  var CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC = (_CONVERSATION_TYPE_TO2 = {}, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.PRIVATE] = QUERY_HISTORY_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.GROUP] = QUERY_HISTORY_TOPIC.GROUP, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.CHATROOM] = QUERY_HISTORY_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_HISTORY_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.SYSTEM] = QUERY_HISTORY_TOPIC.SYSTEM, _CONVERSATION_TYPE_TO2);\n  var CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC = (_CONVERSATION_TYPE_TO3 = {}, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.PRIVATE] = QUERY_TOPIC.CLEAR_MESSAGES.PRIVATE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.GROUP] = QUERY_TOPIC.CLEAR_MESSAGES.GROUP, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_TOPIC.CLEAR_MESSAGES.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.SYSTEM] = QUERY_TOPIC.CLEAR_MESSAGES.SYSTEM, _CONVERSATION_TYPE_TO3);\n\n  var Header = function () {\n    function Header(_type, _retain, _qos, _dup) {\n      this.type = void 0;\n      this.retain = false;\n      this.qos = QOS.AT_LEAST_ONCE;\n      this.dup = false;\n      this.syncMsg = false;\n      var isPlusType = utils.isPlus(_type);\n\n      if (_type && isPlusType && arguments.length === 1) {\n        this.retain = (_type & 1) > 0;\n        this.qos = (_type & 6) >> 1;\n        this.dup = (_type & 8) > 0;\n        this.type = _type >> 4 & 15;\n        this.syncMsg = (_type & 8) === 8;\n      } else {\n        this.type = _type;\n        this.retain = _retain === undefined ? false : _retain;\n        this.qos = _qos === undefined ? QOS.AT_LEAST_ONCE : _qos;\n        this.dup = _dup === undefined ? false : _dup;\n      }\n    }\n\n    var _proto = Header.prototype;\n\n    _proto.encode = function encode() {\n      var self = this;\n      var validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT];\n      utils.forEach(validQosList, function (qos) {\n        if (self.qos === QOS[qos]) {\n          self.qos = qos;\n        }\n      });\n\n      var _byte = self.type << 4;\n\n      _byte |= self.retain ? 1 : 0;\n      _byte |= self.qos << 1;\n      _byte |= self.dup ? 8 : 0;\n      return _byte;\n    };\n\n    return Header;\n  }();\n\n  var BinaryHelper = {\n    writeUTF: function writeUTF(str, isGetBytes) {\n      var back = [],\n          byteSize = 0;\n      utils.forEach(str, function (_char, i) {\n        var code = str.charCodeAt(i);\n\n        if (code >= 0 && code <= 127) {\n          byteSize += 1;\n          back.push(code);\n        } else if (code >= 128 && code <= 2047) {\n          byteSize += 2;\n          back.push(192 | 31 & code >> 6);\n          back.push(128 | 63 & code);\n        } else if (code >= 2048 && code <= 65535) {\n          byteSize += 3;\n          back.push(224 | 15 & code >> 12);\n          back.push(128 | 63 & code >> 6);\n          back.push(128 | 63 & code);\n        }\n      });\n      utils.forEach(back, function (_char2, i) {\n        if (_char2 > 255) {\n          back[i] &= 255;\n        }\n      });\n\n      if (isGetBytes) {\n        return back;\n      }\n\n      if (byteSize <= 255) {\n        return [0, byteSize].concat(back);\n      } else {\n        return [byteSize >> 8, byteSize & 255].concat(back);\n      }\n    },\n    readUTF: function readUTF(arr) {\n      var UTF = '';\n\n      for (var i = 0, len = arr.length; i < len; i++) {\n        var _char3 = arr[i];\n\n        if (_char3 < 0) {\n          arr[i] += 256;\n        }\n\n        var one = arr[i].toString(2),\n            v = one.match(/^1+?(?=0)/);\n\n        if (v && one.length === 8) {\n          var bytesLength = v[0].length,\n              store = '';\n\n          for (var st = 0; st < bytesLength; st++) {\n            store += arr[st + i].toString(2).slice(2);\n          }\n\n          UTF += String.fromCharCode(parseInt(store, 2));\n          i += bytesLength - 1;\n        } else {\n          UTF += String.fromCharCode(arr[i]);\n        }\n      }\n\n      return UTF;\n    }\n  };\n\n  var RongStreamReader = function () {\n    function RongStreamReader(arr) {\n      this.pool = void 0;\n      this.position = 0;\n      this.poolLen = 0;\n      this.pool = arr;\n      this.poolLen = arr.length;\n    }\n\n    var _proto2 = RongStreamReader.prototype;\n\n    _proto2.check = function check() {\n      return this.position >= this.pool.length;\n    };\n\n    _proto2.readInt = function readInt() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 4; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t.toString();\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readLong = function readLong() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 8; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t;\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readByte = function readByte() {\n      if (this.check()) {\n        return -1;\n      }\n\n      var val = this.pool[this.position++];\n\n      if (val > 255) {\n        val &= 255;\n      }\n\n      return val;\n    };\n\n    _proto2.readUTF = function readUTF() {\n      if (this.check()) {\n        return '';\n      }\n\n      var big = this.readByte() << 8 | this.readByte();\n      var pool = this.pool.subarray(this.position, this.position += big);\n      return BinaryHelper.readUTF(pool);\n    };\n\n    _proto2.readAll = function readAll() {\n      return this.pool.subarray(this.position, this.poolLen);\n    };\n\n    return RongStreamReader;\n  }();\n\n  var RongStreamWriter = function () {\n    function RongStreamWriter() {\n      this.pool = [];\n      this.position = 0;\n      this.writen = 0;\n    }\n\n    var _proto3 = RongStreamWriter.prototype;\n\n    _proto3.write = function write(_byte2) {\n      if (utils.isArray(_byte2)) {\n        this.pool = this.pool.concat(_byte2);\n      } else if (utils.isPlus(_byte2)) {\n        if (_byte2 > 255) {\n          _byte2 &= 255;\n        }\n\n        this.pool.push(_byte2);\n        this.writen++;\n      }\n\n      return _byte2;\n    };\n\n    _proto3.writeArr = function writeArr(_byte3) {\n      this.pool = this.pool.concat(_byte3);\n      return _byte3;\n    };\n\n    _proto3.writeUTF = function writeUTF(str) {\n      var val = BinaryHelper.writeUTF(str);\n      this.pool = this.pool.concat(val);\n      this.writen += val.length;\n    };\n\n    _proto3.getBytesArray = function getBytesArray() {\n      return this.pool;\n    };\n\n    return RongStreamWriter;\n  }();\n\n  var IDENTIFIER = {\n    PUB: 'pub',\n    QUERY: 'qry'\n  };\n\n  var _getIdentifier = function getIdentifier(messageId, identifier) {\n    if (messageId && identifier) {\n      return identifier + '_' + messageId;\n    } else if (messageId) {\n      return messageId;\n    } else {\n      return utils.getCurrentTimestamp();\n    }\n  };\n\n  var BaseReader = function () {\n    function BaseReader(header) {\n      this._name = void 0;\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.messageId = void 0;\n      this.identifier = void 0;\n      this._header = header;\n    }\n\n    var _proto = BaseReader.prototype;\n\n    _proto.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto.read = function read(stream, length) {\n      this.readMessage(stream, length);\n    };\n\n    _proto.readMessage = function readMessage(stream, length) {\n      return {\n        stream: stream,\n        length: length\n      };\n    };\n\n    return BaseReader;\n  }();\n\n  var BaseWriter = function () {\n    function BaseWriter(headerType) {\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.data = void 0;\n      this.messageId = void 0;\n      this.topic = void 0;\n      this.targetId = void 0;\n      this.identifier = void 0;\n      this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n    }\n\n    var _proto2 = BaseWriter.prototype;\n\n    _proto2.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto2.write = function write(stream) {\n      var headerCode = this.getHeaderFlag();\n      stream.write(headerCode);\n      this.writeMessage(stream);\n    };\n\n    _proto2.writeMessage = function writeMessage(stream) {\n      return stream;\n    };\n\n    _proto2.setHeaderQos = function setHeaderQos(qos) {\n      this._header.qos = qos;\n    };\n\n    _proto2.getHeaderFlag = function getHeaderFlag() {\n      return this._header.encode();\n    };\n\n    _proto2.getLengthSize = function getLengthSize() {\n      return this.lengthSize;\n    };\n\n    _proto2.getBufferData = function getBufferData() {\n      var stream = new RongStreamWriter();\n      this.write(stream);\n      var val = stream.getBytesArray();\n      var binary = new Int8Array(val);\n      return binary;\n    };\n\n    _proto2.getCometData = function getCometData() {\n      var data = this.data || {};\n      return utils.toJSON(data);\n    };\n\n    return BaseWriter;\n  }();\n\n  var ConnAckReader = function (_BaseReader) {\n    _inheritsLoose(ConnAckReader, _BaseReader);\n\n    function ConnAckReader() {\n      var _this;\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this = _BaseReader.call.apply(_BaseReader, [this].concat(args)) || this;\n      _this._name = MESSAGE_NAME.CONN_ACK;\n      _this.status = void 0;\n      _this.userId = void 0;\n      _this.timestamp = void 0;\n      return _this;\n    }\n\n    var _proto3 = ConnAckReader.prototype;\n\n    _proto3.readMessage = function readMessage(stream, msgLength) {\n      stream.readByte();\n      this.status = +stream.readByte();\n\n      if (msgLength > ConnAckReader.MESSAGE_LENGTH) {\n        this.userId = stream.readUTF();\n        stream.readUTF();\n        this.timestamp = stream.readLong();\n      }\n    };\n\n    return ConnAckReader;\n  }(BaseReader);\n\n  ConnAckReader.MESSAGE_LENGTH = 2;\n\n  var DisconnectReader = function (_BaseReader2) {\n    _inheritsLoose(DisconnectReader, _BaseReader2);\n\n    function DisconnectReader() {\n      var _this2;\n\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      _this2 = _BaseReader2.call.apply(_BaseReader2, [this].concat(args)) || this;\n      _this2._name = MESSAGE_NAME.DISCONNECT;\n      _this2.status = void 0;\n      return _this2;\n    }\n\n    var _proto4 = DisconnectReader.prototype;\n\n    _proto4.readMessage = function readMessage(stream) {\n      stream.readByte();\n      this.status = +stream.readByte();\n    };\n\n    return DisconnectReader;\n  }(BaseReader);\n\n  DisconnectReader.MESSAGE_LENGTH = 2;\n\n  var PingReqWriter = function (_BaseWriter) {\n    _inheritsLoose(PingReqWriter, _BaseWriter);\n\n    function PingReqWriter() {\n      var _this3;\n\n      _this3 = _BaseWriter.call(this, OPERATE_TYPE.PINGREQ) || this;\n      _this3._name = MESSAGE_NAME.PING_REQ;\n      return _this3;\n    }\n\n    return PingReqWriter;\n  }(BaseWriter);\n\n  var PingRespReader = function (_BaseReader3) {\n    _inheritsLoose(PingRespReader, _BaseReader3);\n\n    function PingRespReader() {\n      var _this4;\n\n      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n        args[_key3] = arguments[_key3];\n      }\n\n      _this4 = _BaseReader3.call.apply(_BaseReader3, [this].concat(args)) || this;\n      _this4._name = MESSAGE_NAME.PING_RESP;\n      return _this4;\n    }\n\n    return PingRespReader;\n  }(BaseReader);\n\n  var RetryableReader = function (_BaseReader4) {\n    _inheritsLoose(RetryableReader, _BaseReader4);\n\n    function RetryableReader() {\n      var _this5;\n\n      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n        args[_key4] = arguments[_key4];\n      }\n\n      _this5 = _BaseReader4.call.apply(_BaseReader4, [this].concat(args)) || this;\n      _this5.messageId = void 0;\n      return _this5;\n    }\n\n    var _proto5 = RetryableReader.prototype;\n\n    _proto5.readMessage = function readMessage(stream) {\n      var msgId = stream.readByte() * 256 + stream.readByte();\n      this.messageId = parseInt(msgId, 10);\n    };\n\n    return RetryableReader;\n  }(BaseReader);\n\n  var RetryableWriter = function (_BaseWriter2) {\n    _inheritsLoose(RetryableWriter, _BaseWriter2);\n\n    function RetryableWriter() {\n      var _this6;\n\n      for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n        args[_key5] = arguments[_key5];\n      }\n\n      _this6 = _BaseWriter2.call.apply(_BaseWriter2, [this].concat(args)) || this;\n      _this6.messageId = void 0;\n      return _this6;\n    }\n\n    var _proto6 = RetryableWriter.prototype;\n\n    _proto6.writeMessage = function writeMessage(stream) {\n      var id = this.messageId;\n      var lsb = id & 255;\n      var msb = (id & 65280) >> 8;\n      stream.write(msb);\n      stream.write(lsb);\n    };\n\n    return RetryableWriter;\n  }(BaseWriter);\n\n  var PublishReader = function (_RetryableReader) {\n    _inheritsLoose(PublishReader, _RetryableReader);\n\n    function PublishReader() {\n      var _this7;\n\n      for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n        args[_key6] = arguments[_key6];\n      }\n\n      _this7 = _RetryableReader.call.apply(_RetryableReader, [this].concat(args)) || this;\n      _this7._name = MESSAGE_NAME.PUBLISH;\n      _this7.topic = void 0;\n      _this7.data = void 0;\n      _this7.targetId = void 0;\n      _this7.date = void 0;\n      _this7.syncMsg = false;\n      _this7.identifier = IDENTIFIER.PUB;\n      return _this7;\n    }\n\n    var _proto7 = PublishReader.prototype;\n\n    _proto7.readMessage = function readMessage(stream) {\n      this.date = stream.readInt();\n      this.topic = stream.readUTF();\n      this.targetId = stream.readUTF();\n      RetryableReader.prototype.readMessage.apply(this, arguments);\n      this.data = stream.readAll();\n    };\n\n    return PublishReader;\n  }(RetryableReader);\n\n  var PublishWriter = function (_RetryableWriter) {\n    _inheritsLoose(PublishWriter, _RetryableWriter);\n\n    function PublishWriter(topic, data, targetId) {\n      var _this8;\n\n      _this8 = _RetryableWriter.call(this, OPERATE_TYPE.PUBLISH) || this;\n      _this8._name = MESSAGE_NAME.PUBLISH;\n      _this8.topic = void 0;\n      _this8.data = void 0;\n      _this8.targetId = void 0;\n      _this8.date = void 0;\n      _this8.syncMsg = false;\n      _this8.identifier = IDENTIFIER.PUB;\n      _this8.topic = topic;\n      _this8.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this8.targetId = targetId;\n      return _this8;\n    }\n\n    var _proto8 = PublishWriter.prototype;\n\n    _proto8.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.apply(this, arguments);\n      stream.write(this.data);\n    };\n\n    return PublishWriter;\n  }(RetryableWriter);\n\n  var PubAckReader = function (_RetryableReader2) {\n    _inheritsLoose(PubAckReader, _RetryableReader2);\n\n    function PubAckReader() {\n      var _this9;\n\n      for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n        args[_key7] = arguments[_key7];\n      }\n\n      _this9 = _RetryableReader2.call.apply(_RetryableReader2, [this].concat(args)) || this;\n      _this9._name = MESSAGE_NAME.PUB_ACK;\n      _this9.status = void 0;\n      _this9.date = 0;\n      _this9.data = void 0;\n      _this9.millisecond = 0;\n      _this9.messageUId = void 0;\n      _this9.timestamp = 0;\n      _this9.identifier = IDENTIFIER.PUB;\n      return _this9;\n    }\n\n    var _proto9 = PubAckReader.prototype;\n\n    _proto9.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.millisecond = stream.readByte() * 256 + stream.readByte();\n      this.timestamp = this.date * 1000 + this.millisecond;\n      this.messageUId = stream.readUTF();\n    };\n\n    return PubAckReader;\n  }(RetryableReader);\n\n  var PubAckWriter = function (_RetryableWriter2) {\n    _inheritsLoose(PubAckWriter, _RetryableWriter2);\n\n    function PubAckWriter(messageId) {\n      var _this10;\n\n      _this10 = _RetryableWriter2.call(this, OPERATE_TYPE.PUBACK) || this;\n      _this10._name = MESSAGE_NAME.PUB_ACK;\n      _this10.status = void 0;\n      _this10.date = 0;\n      _this10.millisecond = 0;\n      _this10.messageUId = void 0;\n      _this10.timestamp = 0;\n      _this10.messageId = messageId;\n      return _this10;\n    }\n\n    var _proto10 = PubAckWriter.prototype;\n\n    _proto10.writeMessage = function writeMessage(stream) {\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n    };\n\n    return PubAckWriter;\n  }(RetryableWriter);\n\n  var QueryWriter = function (_RetryableWriter3) {\n    _inheritsLoose(QueryWriter, _RetryableWriter3);\n\n    function QueryWriter(topic, data, targetId) {\n      var _this11;\n\n      _this11 = _RetryableWriter3.call(this, OPERATE_TYPE.QUERY) || this;\n      _this11._name = MESSAGE_NAME.QUERY;\n      _this11.topic = void 0;\n      _this11.data = void 0;\n      _this11.targetId = void 0;\n      _this11.identifier = IDENTIFIER.QUERY;\n      _this11.topic = topic;\n      _this11.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this11.targetId = targetId;\n      return _this11;\n    }\n\n    var _proto11 = QueryWriter.prototype;\n\n    _proto11.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n      stream.write(this.data);\n    };\n\n    return QueryWriter;\n  }(RetryableWriter);\n\n  var QueryConWriter = function (_RetryableWriter4) {\n    _inheritsLoose(QueryConWriter, _RetryableWriter4);\n\n    function QueryConWriter(messageId) {\n      var _this12;\n\n      _this12 = _RetryableWriter4.call(this, OPERATE_TYPE.QUERYCON) || this;\n      _this12._name = MESSAGE_NAME.QUERY_CON;\n      _this12.messageId = messageId;\n      return _this12;\n    }\n\n    return QueryConWriter;\n  }(RetryableWriter);\n\n  var QueryAckReader = function (_RetryableReader3) {\n    _inheritsLoose(QueryAckReader, _RetryableReader3);\n\n    function QueryAckReader() {\n      var _this13;\n\n      for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n        args[_key8] = arguments[_key8];\n      }\n\n      _this13 = _RetryableReader3.call.apply(_RetryableReader3, [this].concat(args)) || this;\n      _this13._name = MESSAGE_NAME.QUERY_ACK;\n      _this13.data = void 0;\n      _this13.status = void 0;\n      _this13.date = void 0;\n      _this13.identifier = IDENTIFIER.QUERY;\n      return _this13;\n    }\n\n    var _proto12 = QueryAckReader.prototype;\n\n    _proto12.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.data = stream.readAll();\n    };\n\n    return QueryAckReader;\n  }(RetryableReader);\n\n  var getReaderByHeader = function getReaderByHeader(header) {\n    var type = header.type,\n        msg = new BaseReader(header);\n\n    switch (type) {\n      case OPERATE_TYPE.CONNACK:\n        msg = new ConnAckReader(header);\n        break;\n\n      case OPERATE_TYPE.PUBLISH:\n        msg = new PublishReader(header);\n        msg.syncMsg = header.syncMsg;\n        break;\n\n      case OPERATE_TYPE.PUBACK:\n        msg = new PubAckReader(header);\n        break;\n\n      case OPERATE_TYPE.QUERYACK:\n        msg = new QueryAckReader(header);\n        break;\n\n      case OPERATE_TYPE.SUBACK:\n      case OPERATE_TYPE.UNSUBACK:\n      case OPERATE_TYPE.PINGRESP:\n        msg = new PingRespReader(header);\n        break;\n\n      case OPERATE_TYPE.DISCONNECT:\n        msg = new DisconnectReader(header);\n        break;\n\n      default:\n        throw new Error('No support for deserializing ' + type + ' messages');\n    }\n\n    return msg;\n  };\n\n  var readWSBuffer = function readWSBuffer(data) {\n    var arr = new Uint8Array(data);\n    var stream = new RongStreamReader(arr);\n    var flags = stream.readByte(),\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    msg.read(stream, arr.length - 1);\n    return msg;\n  };\n\n  var readCometData = function readCometData(data) {\n    var flags = data.headerCode,\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    utils.forEach(data, function (item, key) {\n      if (key in msg) {\n        msg[key] = item;\n      }\n    });\n    return msg;\n  };\n\n  var _PUBLISH_TOPIC_MAP_SE;\n  var ENGINE_EVENT = {\n    WATCH: 'watch',\n    CONNECT: 'connect',\n    RECONNECT: 'reconnect',\n    DISCONNECT: 'disconnect',\n    CHANGE_USER: 'change_user',\n    GET_CONVERSATION_LIST: 'get_conversation_list',\n    REMOVE_CONVERSATION_LIST: 'remove_conversation_list',\n    REMOVE_CONVERSATION: 'remove_conversation',\n    GET_TOTAL_UNREAD_COUNT: 'get_total_unread_count',\n    CLEAR_UNREAD_COUNT: 'clear_unread_count',\n    SEND_MESSAGE: 'send_message',\n    GET_HISTORY_MSGS: 'get_history_msgs',\n    DELETE_MESSAGES: 'delete_history_msgs',\n    CLEAR_MESSAGES: 'clear_history_msgs',\n    RECALL_MESSAGE: 'recall_message',\n    JOIN_CHATROOM: 'join_chatroom',\n    QUIT_CHATROOM: 'quit_chatroom',\n    GET_CHATROOM_INFO: 'get_chatroom_info',\n    GET_CHATROOM_MSGS: 'get_chatroom_msgs'\n  };\n  var ENGINE_EVENT_NEED_CONNECTED = [ENGINE_EVENT.GET_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION, ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT, ENGINE_EVENT.CLEAR_UNREAD_COUNT, ENGINE_EVENT.SEND_MESSAGE, ENGINE_EVENT.GET_HISTORY_MSGS, ENGINE_EVENT.DELETE_MESSAGES, ENGINE_EVENT.CLEAR_MESSAGES, ENGINE_EVENT.RECALL_MESSAGE, ENGINE_EVENT.JOIN_CHATROOM, ENGINE_EVENT.QUIT_CHATROOM, ENGINE_EVENT.GET_CHATROOM_INFO, ENGINE_EVENT.GET_CHATROOM_MSGS];\n  var ENGINE_EVENT_NEED_DISCONNECTED = [ENGINE_EVENT.CONNECT, ENGINE_EVENT.RECONNECT];\n  var IM_EVENT = {\n    STATUS: 'status',\n    MESSAGE: 'message',\n    CONVERSATION: 'conversation'\n  };\n  var TRANSPORT_EVENT = {\n    SIGNAL: 'signal',\n    STATUS: 'status'\n  };\n  var SERVER_TASK = {\n    DISCONNECTED: 'disconnected',\n    SYNC_SELF_MSG: 'sync_self_other_client_msg',\n    NOTIFY_PULL: 'notify_pull_msg',\n    RECEIVE_MSG: 'receive_msg',\n    SYNC_STATUS: 'sync_status',\n    SYNC_CHRM_KV: 'sync_chrm_kv'\n  };\n  var PUBLISH_TOPIC_MAP_SERVER_TASK = (_PUBLISH_TOPIC_MAP_SE = {}, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.NOTIFY_PULL_MSG] = SERVER_TASK.NOTIFY_PULL, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.RECEIVE_MSG] = SERVER_TASK.RECEIVE_MSG, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.SYNC_STATUS] = SERVER_TASK.SYNC_STATUS, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.SYNC_CHRM_KV] = SERVER_TASK.SYNC_CHRM_KV, _PUBLISH_TOPIC_MAP_SE);\n\n  var isEmpty$1 = utils.isEmpty,\n      tplEngine$1 = utils.tplEngine,\n      getRandomNum$1 = utils.getRandomNum;\n\n  var getTransporterUrl = function getTransporterUrl(option) {\n    var domain = option.domain,\n        appkey = option.appkey,\n        token = option.token,\n        connectType = option.connectType,\n        protocol = option.protocol;\n    var isComet = connectType === CONNECT_TYPE.COMET;\n\n    if (isEmpty$1(protocol)) {\n      protocol = isComet ? env.protocol.http : env.protocol.ws;\n    }\n\n    return tplEngine$1(CMP_URL_TPL, {\n      domain: domain,\n      appkey: appkey,\n      protocol: protocol,\n      apiVer: getRandomNum$1(1e6),\n      token: utils.encodeURI(token)\n    });\n  };\n\n  var isGroup = function isGroup(type) {\n    return type === CONVERSATION_TYPE.GROUP;\n  };\n\n  var isChatRoom = function isChatRoom(type) {\n    return type === CONVERSATION_TYPE.CHATROOM;\n  };\n\n  var getConversationTypeList = function getConversationTypeList() {\n    return utils.getValues(CONVERSATION_TYPE);\n  };\n\n  var isValidConversationType = function isValidConversationType(type) {\n    var conversationTypeList = getConversationTypeList();\n    return utils.isNumber(type) && utils.isInclude(conversationTypeList, type);\n  };\n\n  var getSessionId = function getSessionId(option) {\n    var isPersited = option.isPersited,\n        isCounted = option.isCounted,\n        isMentiond = option.isMentiond;\n    var sessionId = 0;\n\n    if (isPersited) {\n      sessionId = sessionId | 0x01;\n    }\n\n    if (isCounted) {\n      sessionId = sessionId | 0x02;\n    }\n\n    if (isMentiond) {\n      sessionId = sessionId | 0x04;\n    }\n\n    return sessionId;\n  };\n\n  var getPersitedAndCountedBySessionId = function getPersitedAndCountedBySessionId(sessionId) {\n    var isPersited, isCounted;\n\n    switch (sessionId) {\n      case MESSAGE_TAG.COUNT_ONLY:\n        isPersited = false;\n        isCounted = true;\n        break;\n\n      case MESSAGE_TAG.PERSIT_ONLY:\n        isPersited = true;\n        isCounted = false;\n        break;\n\n      case MESSAGE_TAG.NONE:\n        isPersited = isCounted = false;\n        break;\n\n      case MESSAGE_TAG.PERSIT_AND_COUNT:\n      default:\n        isPersited = isCounted = true;\n        break;\n    }\n\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted\n    };\n  };\n\n  var getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n    var isPersited = true,\n        isCounted = true,\n        isMentiond = false;\n    isPersited = !!(status & 0x10);\n    isCounted = !!(status & 0x20);\n    isMentiond = !!(status & 0x40);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond\n    };\n  };\n\n  var SignalId = {\n    ids: {},\n    temp: '{appkey}_{userId}',\n    get: function get(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      var id = SignalId.ids[key] || 0;\n      id++;\n      SignalId.ids[key] = id;\n      return id;\n    },\n    clear: function clear(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      SignalId.ids[key] = 0;\n    },\n    isExceedLimit: function isExceedLimit(id) {\n      return id > MAX_SINGAL_ID;\n    }\n  };\n\n  var RCSocket = function () {\n    function RCSocket(options) {\n      this._socket = void 0;\n      this.eventEmitter = new utils.EventEmitter();\n      this.KEY = {\n        OPEN: 'open',\n        MSG: 'msg',\n        ERROR: 'error',\n        CLOSE: 'close'\n      };\n      var self = this;\n      var KEY = self.KEY;\n      self._socket = new utils.Socket(options);\n\n      self._socket.onOpen(function (data) {\n        self.eventEmitter.emit(KEY.OPEN, data);\n      });\n\n      self._socket.onMessage(function (data) {\n        self.eventEmitter.emit(KEY.MSG, data);\n      });\n\n      self._socket.onError(function (data) {\n        self.eventEmitter.emit(KEY.ERROR, data);\n      });\n\n      self._socket.onClose(function (data) {\n        self.eventEmitter.emit(KEY.CLOSE, data);\n      });\n    }\n\n    var _proto = RCSocket.prototype;\n\n    _proto.send = function send(data) {\n      return this._socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.eventEmitter.clear();\n\n      this._socket.close();\n    };\n\n    _proto.onOpen = function onOpen(event) {\n      this.eventEmitter.on(this.KEY.OPEN, event);\n    };\n\n    _proto.onMessage = function onMessage(event) {\n      this.eventEmitter.on(this.KEY.MSG, event);\n    };\n\n    _proto.onError = function onError(event) {\n      this.eventEmitter.on(this.KEY.ERROR, event);\n    };\n\n    _proto.onClose = function onClose(event) {\n      this.eventEmitter.on(this.KEY.CLOSE, event);\n    };\n\n    return RCSocket;\n  }();\n\n  var RCStorage = function () {\n    function RCStorage(suffix) {\n      var _ref;\n\n      this._cache = void 0;\n      this.STORAGE_KEY = void 0;\n      var storageKey = suffix ? STORAGE_ROOT_KEY + suffix : STORAGE_ROOT_KEY;\n      var localCache = utils.Storage.get(storageKey) || {};\n      this._cache = new utils.Cache((_ref = {}, _ref[storageKey] = localCache, _ref));\n      this.STORAGE_KEY = storageKey;\n    }\n\n    var _proto2 = RCStorage.prototype;\n\n    _proto2._get = function _get() {\n      var KEY = this.STORAGE_KEY;\n      return this._cache.get(KEY) || {};\n    };\n\n    _proto2._set = function _set(cache) {\n      var KEY = this.STORAGE_KEY;\n      cache = cache || {};\n\n      this._cache.set(KEY, cache);\n\n      utils.Storage.set(KEY, cache);\n    };\n\n    _proto2.set = function set(key, value) {\n      var localValue = this._get();\n\n      localValue[key] = value;\n\n      this._set(localValue);\n    };\n\n    _proto2.remove = function remove(key) {\n      var localValue = this._get();\n\n      delete localValue[key];\n\n      this._set(localValue);\n    };\n\n    _proto2.clear = function clear() {\n      var KEY = this.STORAGE_KEY;\n      utils.Storage.remove(KEY);\n\n      this._cache.remove(KEY);\n    };\n\n    _proto2.get = function get(key) {\n      var localValue = this._get();\n\n      return localValue[key];\n    };\n\n    _proto2.getKeys = function getKeys() {\n      var localValue = this._get();\n\n      return utils.getKeys(localValue);\n    };\n\n    _proto2.getValues = function getValues() {\n      return this._get() || {};\n    };\n\n    return RCStorage;\n  }();\n\n  var formatSyncTime = function formatSyncTime(_syncTime) {\n    _syncTime = _syncTime || {};\n    _syncTime.inboxTime = _syncTime.inboxTime || 0;\n    _syncTime.sendboxTime = _syncTime.sendboxTime || 0;\n    return _syncTime;\n  };\n\n  var MessageTimeSyner = function () {\n    function MessageTimeSyner(option) {\n      this._syncTime = void 0;\n      this._storage = void 0;\n      option = option || {};\n      var _option = option,\n          startSyncTime = _option.startSyncTime;\n\n      this._initStorage(option);\n\n      if (startSyncTime) {\n        this._syncTime = formatSyncTime(startSyncTime);\n      }\n    }\n\n    var _proto3 = MessageTimeSyner.prototype;\n\n    _proto3._initStorage = function _initStorage(option) {\n      var appkey = option.appkey,\n          userId = option.userId;\n      var ROOT_KEY = utils.tplEngine(STORAGE_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      var storage = new RCStorage(ROOT_KEY);\n      var syncTime = {\n        sendboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX),\n        inboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.INBOX)\n      };\n      this._storage = storage;\n      this._syncTime = formatSyncTime(syncTime);\n    };\n\n    _proto3.setInbox = function setInbox(time) {\n      this._syncTime.inboxTime = time;\n\n      this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.INBOX, time);\n    };\n\n    _proto3.setSendbox = function setSendbox(time) {\n      this._syncTime.sendboxTime = time;\n\n      this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX, time);\n    };\n\n    _proto3.setByMessage = function setByMessage(msg) {\n      var direction = msg.direction,\n          sentTime = msg.sentTime;\n      var isSelfSend = direction === MESSAGE_DIRECTION.SEND;\n      isSelfSend ? this.setSendbox(sentTime) : this.setInbox(sentTime);\n    };\n\n    _proto3.get = function get() {\n      return formatSyncTime(this._syncTime);\n    };\n\n    return MessageTimeSyner;\n  }();\n\n  var ChatRoomMessageTimeSyner = function () {\n    function ChatRoomMessageTimeSyner() {\n      this._pullTimes = {};\n    }\n\n    var _proto4 = ChatRoomMessageTimeSyner.prototype;\n\n    _proto4.set = function set(chrmId, time) {\n      this._pullTimes[chrmId] = time;\n    };\n\n    _proto4.get = function get(chrmId) {\n      return this._pullTimes[chrmId] || 0;\n    };\n\n    _proto4.setByMessage = function setByMessage(msg) {\n      var sentTime = msg.sentTime;\n      var chrmId = msg.targetId;\n      this.set(chrmId, sentTime);\n    };\n\n    return ChatRoomMessageTimeSyner;\n  }();\n\n  var getUIDByToken = function getUIDByToken(token) {\n    return utils.md5(token).slice(8, 16);\n  };\n\n  var isIncludeNavi = function isIncludeNavi(token) {\n    return utils.isInclude(token, NAVI_SEPARATOR_IN_TOKEN);\n  };\n\n  var getNaviListByToken = function getNaviListByToken(token) {\n    var navDomainList = [];\n\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      var navsText = token.substring(separatorIndex + 1, token.length);\n      var domainList = navsText.split(DOMAIN_SEPARATOR_IN_NAVLIST);\n      utils.forEach(domainList, function (domain) {\n        if (!isEmpty$1(domain)) {\n          navDomainList.push(domain);\n        }\n      });\n    }\n\n    return navDomainList;\n  };\n\n  var getCMPDomainList = function getCMPDomainList(option) {\n    var server = option.server,\n        backupServer = option.backupServer;\n    server = server || '';\n    backupServer = backupServer || '';\n    var backupCMPList = backupServer.split(DOMAIN_SEPARATOR_IN_CMPLIST);\n    var cmpList = [server];\n    utils.forEach(backupCMPList, function (cmp) {\n      if (!utils.isEmpty(cmp)) {\n        cmpList.push(cmp);\n      }\n    });\n    return cmpList;\n  };\n\n  var getValidToken = function getValidToken(token) {\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      token = token.substring(0, separatorIndex + 1);\n    }\n\n    return token;\n  };\n\n  var getConnectType = function getConnectType(option) {\n    var connectType = option.connectType;\n    var isSpecifiedSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var isSocket = isSpecifiedSocket && utils.isSupportSocket();\n    return isSocket ? CONNECT_TYPE.WEBSOCKET : CONNECT_TYPE.COMET;\n  };\n\n  var isConnected = function isConnected(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTED);\n  };\n\n  var isConnecting = function isConnecting(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTING);\n  };\n\n  var isDisconnected = function isDisconnected(status) {\n    return !isConnected(status) && !isConnecting(status);\n  };\n\n  var getNavReqOption = function getNavReqOption(option, user) {\n    option = utils.copy(option);\n    option.token = user.token;\n    return option;\n  };\n\n  var getPingTimeout = function getPingTimeout(timeSpentConnect) {\n    var timeout = timeSpentConnect * 3;\n\n    if (timeout < IM_PING_MIN_TIMEOUT) {\n      return IM_PING_MIN_TIMEOUT;\n    }\n\n    if (timeout > IM_PING_MAX_TIMEOUT) {\n      return IM_PING_MAX_TIMEOUT;\n    }\n\n    return timeout;\n  };\n\n  var fixConversationData = function fixConversationData(conversation) {\n    conversation = conversation || {};\n    conversation.latestMessage = conversation.latestMessage || {};\n    conversation.latestMessage.sentTime = conversation.latestMessage.sentTime || 0;\n    return conversation;\n  };\n\n  var sortConversationList = function sortConversationList(conversationList) {\n    return utils.quickSort(conversationList, function (before, after) {\n      before = fixConversationData(before);\n      after = fixConversationData(after);\n      return after.latestMessage.sentTime <= before.latestMessage.sentTime;\n    });\n  };\n\n  var common = {\n    isConnected: isConnected,\n    isConnecting: isConnecting,\n    isDisconnected: isDisconnected,\n    getConnectType: getConnectType,\n    getTransporterUrl: getTransporterUrl,\n    isGroup: isGroup,\n    isChatRoom: isChatRoom,\n    getConversationTypeList: getConversationTypeList,\n    isValidConversationType: isValidConversationType,\n    getUIDByToken: getUIDByToken,\n    getSessionId: getSessionId,\n    getMessageOptionByStatus: getMessageOptionByStatus,\n    getPersitedAndCountedBySessionId: getPersitedAndCountedBySessionId,\n    SignalId: SignalId,\n    MessageTimeSyner: MessageTimeSyner,\n    ChatRoomMessageTimeSyner: ChatRoomMessageTimeSyner,\n    getCMPDomainList: getCMPDomainList,\n    getNaviListByToken: getNaviListByToken,\n    getValidToken: getValidToken,\n    RCSocket: RCSocket,\n    RCStorage: RCStorage,\n    getNavReqOption: getNavReqOption,\n    getPingTimeout: getPingTimeout,\n    fixConversationData: fixConversationData,\n    sortConversationList: sortConversationList\n  };\n\n  var EventEmitter$1 = utils.EventEmitter,\n      DeferHandler$1 = utils.DeferHandler,\n      Timer$1 = utils.Timer;\n  var RCSocket$1 = common.RCSocket;\n  var TransHandlerID = {\n    CONNECT: 'connect',\n    PING: 'ping'\n  };\n\n  var Heartbeat = function () {\n    function Heartbeat(transporter, option) {\n      this._transporter = void 0;\n      this._timer = void 0;\n      option = option || {};\n      var timeout = option.timeout;\n      this._transporter = transporter;\n      this._timer = new Timer$1({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: timeout\n      });\n    }\n\n    var _proto = Heartbeat.prototype;\n\n    _proto.check = function check(timeout) {\n      var _transporter = this._transporter;\n      var _deferHandler = _transporter._deferHandler;\n      var pingReqSignal = new PingReqWriter();\n\n      _transporter.sendSignal(pingReqSignal);\n\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.PING, {\n          resolve: resolve,\n          reject: reject\n        }, {\n          timeout: timeout\n        });\n      });\n    };\n\n    _proto.start = function start(timeout, onError) {\n      var self = this;\n\n      self._timer.start(function () {\n        self.check(timeout).then(utils.noop)[\"catch\"](onError);\n      });\n    };\n\n    _proto.stop = function stop() {\n      this._timer && this._timer.stop();\n    };\n\n    return Heartbeat;\n  }();\n\n  var SocketTransporter = function () {\n    function SocketTransporter(option) {\n      this._socket = void 0;\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$1();\n      this._deferHandler = new DeferHandler$1();\n      this._heartbeat = new Heartbeat(this, {\n        timeout: IM_PING_INTERVAL_TIME\n      });\n      this._connectedTime = void 0;\n      this._option = option;\n    }\n\n    var _proto2 = SocketTransporter.prototype;\n\n    _proto2._createSocket = function _createSocket(url) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var socket = new RCSocket$1({\n        url: url\n      });\n\n      var onClose = function onClose(event) {\n        event = event || {};\n        var code = event.code || TRANSPORTER_STATUS.CLOSE_ABNORMAL;\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, code);\n\n        self.disconnect();\n      };\n\n      socket.onMessage(function (msg) {\n        var data = msg.data;\n\n        if (!utils.isArrayBuffer(data)) {\n          throw new Error('Error socket signal');\n        }\n\n        var signal = readWSBuffer(data);\n        self.handleSignal(signal);\n      });\n      socket.onError(onClose);\n      socket.onClose(onClose);\n      return socket;\n    };\n\n    _proto2._startHeartbeat = function _startHeartbeat(timeSpentConnect) {\n      var self = this;\n      var _heartbeat = self._heartbeat,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n\n      _heartbeat.check(FIRST_PING_TIMEOUT).then(utils.noop)[\"catch\"](function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT);\n\n        self.disconnect();\n      });\n\n      var pingTimeout = common.getPingTimeout(timeSpentConnect);\n\n      _heartbeat.start(pingTimeout, function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n        self.disconnect();\n      });\n    };\n\n    _proto2._stopHeartbeat = function _stopHeartbeat() {\n      this._heartbeat.stop();\n    };\n\n    _proto2.watchSignal = function watchSignal(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, watcher);\n    };\n\n    _proto2.watchStatus = function watchStatus(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, watcher);\n    };\n\n    _proto2.connect = function connect(user, option) {\n      var self = this;\n      var _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType,\n          _deferHandler = self._deferHandler;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        connectType: connectType,\n        token: token\n      });\n      var timeBeforeConnect = utils.getCurrentTimestamp();\n      self._socket = this._createSocket(url);\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.CONNECT, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (result) {\n        var timeAfterConnect = utils.getCurrentTimestamp();\n        var timeSpentConnect = timeAfterConnect - timeBeforeConnect;\n\n        self._startHeartbeat(timeSpentConnect);\n\n        return result;\n      });\n    };\n\n    _proto2.sendSignal = function sendSignal(writer) {\n      var binary = writer.getBufferData();\n\n      this._socket.send(binary.buffer);\n    };\n\n    _proto2.handleSignal = function handleSignal(signal) {\n      var _transporterEventEmiiter = this._transporterEventEmiiter,\n          _deferHandler = this._deferHandler;\n\n      if (signal instanceof ConnAckReader) {\n        this.handleConnAck(signal);\n      } else if (signal instanceof PingRespReader) {\n        _deferHandler.resolve(TransHandlerID.PING);\n      } else {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n      }\n    };\n\n    _proto2.handleConnAck = function handleConnAck(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n      var status = signal.status;\n      var isConnected = status === SUCCESS_CODE;\n      var event = isConnected ? _deferHandler.resolve : _deferHandler.reject;\n      event.call(_deferHandler, TransHandlerID.CONNECT, signal);\n\n      if (isConnected) {\n        self._connectedTime = utils.getCurrentTimestamp();\n      }\n\n      isConnected && _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.CONNECTED);\n    };\n\n    _proto2.disconnect = function disconnect() {\n      this._stopHeartbeat();\n\n      this._socket.close();\n    };\n\n    return SocketTransporter;\n  }();\n\n  var EventEmitter$2 = utils.EventEmitter,\n      DeferHandler$2 = utils.DeferHandler,\n      httpRequest = utils.httpRequest,\n      request$4 = utils.request,\n      Defer$1 = utils.Defer;\n\n  var CometTransporter = function () {\n    function CometTransporter(option) {\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$2();\n      this._deferHandler = new DeferHandler$2();\n      this._pid = utils.getCurrentTimestamp() + Math.random() + '';\n      this._domain = void 0;\n      this._sessionid = void 0;\n      this._xhrCache = new utils.Cache();\n      this._isDisconnected = true;\n      this._option = option;\n    }\n\n    var _proto = CometTransporter.prototype;\n\n    _proto._startPullSignal = function _startPullSignal() {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n      var timestamp = utils.getCurrentTimestamp();\n      var protocol = env.protocol.http;\n      var url = utils.tplEngine(COMET_PULL_URL_TPL, {\n        protocol: protocol,\n        timestamp: timestamp,\n        domain: _domain,\n        sessionId: _sessionid,\n        pid: _pid\n      });\n      var xhr = httpRequest({\n        url: url,\n        success: function success(responseText) {\n          self.handleCometResponse(responseText);\n          !self._isDisconnected && self._startPullSignal();\n\n          self._xhrCache.remove(url);\n        },\n        fail: function fail() {\n          if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, CONNECTION_STATUS.NETWORK_UNAVAILABLE);\n          }\n\n          self._xhrCache.remove(url);\n        }\n      });\n\n      self._xhrCache.set(url, xhr);\n    };\n\n    _proto.watchSignal = function watchSignal(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, event);\n    };\n\n    _proto.watchStatus = function watchStatus(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, function (status) {\n        event && event(status);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter,\n          _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        token: token,\n        connectType: connectType\n      });\n      self._domain = domain;\n      self._isDisconnected = false;\n\n      var success = function success(_ref) {\n        var responseText = _ref.responseText;\n\n        if (!utils.isValidJSON(responseText)) {\n          return Defer$1.reject();\n        }\n\n        var response = utils.parseJSON(responseText);\n        var isConnectSuccess = utils.isEqual(response.status, SUCCESS_CODE);\n        return isConnectSuccess ? Defer$1.resolve(response) : Defer$1.reject(response);\n      };\n\n      return request$4(url).then(success).then(function (response) {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, CONNECTION_STATUS.CONNECTED);\n\n        self._sessionid = response.sessionid;\n\n        self._startPullSignal();\n\n        return response;\n      });\n    };\n\n    _proto.sendSignal = function sendSignal(writer) {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid;\n      var messageId = writer.messageId,\n          topic = writer.topic,\n          targetId = writer.targetId;\n      var headerCode = writer.getHeaderFlag();\n      var protocol = env.protocol.http;\n      var TPL = topic ? COMET_REQ_HAS_TOPIC_URL_TPL : COMET_REQ_NO_TOPIC_URL_TPL;\n      var url = utils.tplEngine(TPL, {\n        protocol: protocol,\n        messageId: messageId,\n        headerCode: headerCode,\n        topic: topic,\n        targetId: targetId,\n        pid: _pid,\n        sessionId: _sessionid,\n        domain: _domain\n      });\n      var currentTime = utils.getCurrentTimestamp() + '';\n      var xhr = httpRequest({\n        url: url,\n        method: REQUEST_METHOD.POST,\n        body: writer.getCometData(),\n        success: function success(responseText) {\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (!isSuccess) {\n            self.handleError(messageId);\n          }\n\n          self._xhrCache.remove(currentTime);\n        },\n        fail: function fail(error) {\n          console.log('comet error', error);\n          self.handleError(messageId);\n\n          self._xhrCache.remove(currentTime);\n        }\n      });\n\n      self._xhrCache.set(currentTime, xhr);\n    };\n\n    _proto.handleCometResponse = function handleCometResponse(responseText) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var response = utils.parseJSON(responseText);\n\n      if (!response) {\n        return false;\n      }\n\n      if (!response || !utils.isArray(response)) {\n        return true;\n      }\n\n      utils.forEach(response, function (data) {\n        var sessionid = data.sessionid;\n\n        if (sessionid) {\n          self._sessionid = sessionid;\n        }\n\n        var signal = readCometData(data);\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n      });\n      return true;\n    };\n\n    _proto.handleError = function handleError(messageId, status) {\n      var signal = {\n        messageId: messageId,\n        status: status || ERROR_CODE.TIMEOUT\n      };\n\n      this._transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n    };\n\n    _proto.disconnect = function disconnect() {\n      var self = this;\n      self._isDisconnected = true;\n      var _xhrCache = self._xhrCache;\n\n      var xhrKeys = _xhrCache.getKeys();\n\n      utils.forEach(xhrKeys, function (key) {\n        var xhr = _xhrCache.get(key);\n\n        xhr.abort();\n\n        _xhrCache.remove(key);\n      });\n    };\n\n    return CometTransporter;\n  }();\n\n  var Transporter = (function (option) {\n    var connectType = option.connectType;\n    var isSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var Transporter = isSocket ? SocketTransporter : CometTransporter;\n    return new Transporter(option);\n  });\n\n  var PBName = {\n    UpStreamMessage: 'UpStreamMessage',\n    DownStreamMessage: 'DownStreamMessage',\n    DownStreamMessages: 'DownStreamMessages',\n    SessionsAttQryInput: 'SessionsAttQryInput',\n    SessionsAttOutput: 'SessionsAttOutput',\n    SyncRequestMsg: 'SyncRequestMsg',\n    ChrmPullMsg: 'ChrmPullMsg',\n    NotifyMsg: 'NotifyMsg',\n    HistoryMsgInput: 'HistoryMsgInput',\n    HistoryMsgOuput: 'HistoryMsgOuput',\n    RelationQryInput: 'RelationQryInput',\n    RelationsOutput: 'RelationsOutput',\n    DeleteSessionsInput: 'DeleteSessionsInput',\n    SessionInfo: 'SessionInfo',\n    DeleteSessionsOutput: 'DeleteSessionsOutput',\n    RelationsInput: 'RelationsInput',\n    DeleteMsgInput: 'DeleteMsgInput',\n    CleanHisMsgInput: 'CleanHisMsgInput',\n    SessionMsgReadInput: 'SessionMsgReadInput',\n    ChrmInput: 'ChrmInput',\n    QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n    QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput'\n  };\n\n  var _SSMsg;\n  var SSMsg = (_SSMsg = {}, _SSMsg[PBName.UpStreamMessage] = ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData'], _SSMsg[PBName.DownStreamMessages] = ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId'], _SSMsg[PBName.SessionsAttQryInput] = ['nothing'], _SSMsg[PBName.SessionsAttOutput] = ['inboxTime', 'sendboxTime', 'totalUnreadCount'], _SSMsg[PBName.SyncRequestMsg] = ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'], _SSMsg[PBName.ChrmPullMsg] = ['syncTime', 'count'], _SSMsg[PBName.NotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.HistoryMsgInput] = ['targetId', 'time', 'count', 'order'], _SSMsg[PBName.HistoryMsgOuput] = ['list', 'syncTime', 'hasMsg'], _SSMsg[PBName.RelationQryInput] = ['type', 'count', 'startTime', 'order'], _SSMsg[PBName.RelationsOutput] = ['info'], _SSMsg[PBName.DeleteSessionsInput] = ['sessions'], _SSMsg[PBName.SessionInfo] = ['type', 'channelId'], _SSMsg[PBName.DeleteSessionsOutput] = ['nothing'], _SSMsg[PBName.RelationsInput] = ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'], _SSMsg[PBName.DeleteMsgInput] = ['type', 'conversationId', 'msgs'], _SSMsg[PBName.CleanHisMsgInput] = ['targetId', 'dataTime', 'conversationType'], _SSMsg[PBName.SessionMsgReadInput] = ['type', 'msgTime', 'channelId'], _SSMsg[PBName.ChrmInput] = ['nothing'], _SSMsg[PBName.QueryChatRoomInfoInput] = ['count', 'order'], _SSMsg[PBName.QueryChatRoomInfoOutput] = ['userTotalNums', 'userInfos'], _SSMsg);\n\n  var Codec = {};\n  utils.forEach(SSMsg, function (paramList, name) {\n    Codec[name] = function () {};\n\n    Codec[name].prototype.data = {};\n\n    Codec[name].prototype.getData = function () {\n      return this.data;\n    };\n\n    utils.forEach(paramList, function (param) {\n      var setEventName = 'set' + utils.toUpperCase(param, 0, 1);\n\n      Codec[name].prototype[setEventName] = function (item) {\n        this.data[param] = item;\n      };\n    });\n\n    Codec[name].decode = function (data) {\n      var decodeResult = {};\n\n      if (utils.isString(data)) {\n        data = utils.parseJSON(data);\n      }\n\n      var _loop = function _loop(key) {\n        var getEventName = 'get' + utils.toUpperCase(key, 0, 1);\n        decodeResult[key] = data[key];\n\n        decodeResult[getEventName] = function () {\n          return data[key];\n        };\n      };\n\n      for (var key in data) {\n        _loop(key);\n      }\n\n      return decodeResult;\n    };\n  });\n\n  Codec.getModule = function (pbName) {\n    var modules = new Codec[pbName]();\n\n    modules.getArrayData = function () {\n      return modules.getData();\n    };\n\n    return modules;\n  };\n\n  function protobuf(a){var b=void 0,c=function(){function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c;}function b(a){return (a&&a.__isLong__)===!0}function e(a,b){var e,f,h;return b?(a>>>=0,(h=a>=0&&256>a)&&(f=d[a])?f:(e=g(a,0>(0|a)?-1:0,!0),h&&(d[a]=e),e)):(a|=0,(h=a>=-128&&128>a)&&(f=c[a])?f:(e=g(a,0>a?-1:0,!1),h&&(c[a]=e),e))}function f(a,b){if(isNaN(a)||!isFinite(a))return b?r:q;if(b){if(0>a)return r;if(a>=n)return w}else{if(-o>=a)return x;if(a+1>=o)return v}return 0>a?f(-a,b).neg():g(0|a%m,0|a/m,b)}function g(b,c,d){return new a(b,c,d)}function i(a,b,c){var d,e,g,j,k,l,m;if(0===a.length)throw Error(\"empty string\");if(\"NaN\"===a||\"Infinity\"===a||\"+Infinity\"===a||\"-Infinity\"===a)return q;if(\"number\"==typeof b?(c=b,b=!1):b=!!b,c=c||10,2>c||c>36)throw RangeError(\"radix\");if((d=a.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===d)return i(a.substring(1),b,c).neg();for(e=f(h(c,8)),g=q,j=0;j<a.length;j+=8)k=Math.min(8,a.length-j),l=parseInt(a.substring(j,j+k),c),8>k?(m=f(h(c,k)),g=g.mul(m).add(f(l))):(g=g.mul(e),g=g.add(f(l)));return g.unsigned=b,g}function j(b){return b instanceof a?b:\"number\"==typeof b?f(b):\"string\"==typeof b?i(b):g(b.low,b.high,b.unsigned)}var c,d,h,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return Object.defineProperty(a.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b,c={},d={},a.fromInt=e,a.fromNumber=f,a.fromBits=g,h=Math.pow,a.fromString=i,a.fromValue=j,k=65536,l=1<<24,m=k*k,n=m*m,o=n/2,p=e(l),q=e(0),a.ZERO=q,r=e(0,!0),a.UZERO=r,s=e(1),a.ONE=s,t=e(1,!0),a.UONE=t,u=e(-1),a.NEG_ONE=u,v=g(-1,2147483647,!1),a.MAX_VALUE=v,w=g(-1,-1,!0),a.MAX_UNSIGNED_VALUE=w,x=g(0,-2147483648,!1),a.MIN_VALUE=x,y=a.prototype,y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},y.toString=function(a){var b,c,d,e,g,i,j,k,l;if(a=a||10,2>a||a>36)throw RangeError(\"radix\");if(this.isZero())return \"0\";if(this.isNegative())return this.eq(x)?(b=f(a),c=this.div(b),d=c.mul(b).sub(this),c.toString(a)+d.toInt().toString(a)):\"-\"+this.neg().toString(a);for(e=f(h(a,6),this.unsigned),g=this,i=\"\";;){if(j=g.div(e),k=g.sub(j.mul(e)).toInt()>>>0,l=k.toString(a),g=j,g.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i;}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var a,b;if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return !this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1===(1&this.low)},y.isEven=function(){return 0===(1&this.low)},y.equals=function(a){return b(a)||(a=j(a)),this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low},y.eq=y.equals,y.notEquals=function(a){return !this.eq(a)},y.neq=y.notEquals,y.lessThan=function(a){return this.comp(a)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(a){return this.comp(a)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(a){return this.comp(a)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(a){return this.comp(a)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(a){if(b(a)||(a=j(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return !this.unsigned&&this.eq(x)?x:this.not().add(s)},y.neg=y.negate,y.add=function(a){var c,d,e,f,h,i,k,l,m,n,o,p;return b(a)||(a=j(a)),c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,h=a.high>>>16,i=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0,p+=f+l,o+=p>>>16,p&=65535,o+=e+k,n+=o>>>16,o&=65535,n+=d+i,m+=n>>>16,n&=65535,m+=c+h,m&=65535,g(o<<16|p,m<<16|n,this.unsigned)},y.subtract=function(a){return b(a)||(a=j(a)),this.add(a.neg())},y.sub=y.subtract,y.multiply=function(a){var c,d,e,h,i,k,l,m,n,o,r,s;return this.isZero()?q:(b(a)||(a=j(a)),a.isZero()?q:this.eq(x)?a.isOdd()?x:q:a.eq(x)?this.isOdd()?x:q:this.isNegative()?a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg():a.isNegative()?this.mul(a.neg()).neg():this.lt(p)&&a.lt(p)?f(this.toNumber()*a.toNumber(),this.unsigned):(c=this.high>>>16,d=65535&this.high,e=this.low>>>16,h=65535&this.low,i=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,o=0,r=0,s=0,s+=h*m,r+=s>>>16,s&=65535,r+=e*m,o+=r>>>16,r&=65535,r+=h*l,o+=r>>>16,r&=65535,o+=d*m,n+=o>>>16,o&=65535,o+=e*l,n+=o>>>16,o&=65535,o+=h*k,n+=o>>>16,o&=65535,n+=c*m+d*l+e*k+h*i,n&=65535,g(r<<16|s,n<<16|o,this.unsigned)))},y.mul=y.multiply,y.divide=function(a){var c,d,e,g,i,k,l,m;if(b(a)||(a=j(a)),a.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?r:q;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return r;if(a.gt(this.shru(1)))return t;e=r;}else{if(this.eq(x))return a.eq(s)||a.eq(u)?x:a.eq(x)?s:(g=this.shr(1),c=g.div(a).shl(1),c.eq(q)?a.isNegative()?s:u:(d=this.sub(a.mul(c)),e=c.add(d.div(a))));if(a.eq(x))return this.unsigned?r:q;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();e=q;}for(d=this;d.gte(a);){for(c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),i=Math.ceil(Math.log(c)/Math.LN2),k=48>=i?1:h(2,i-48),l=f(c),m=l.mul(a);m.isNegative()||m.gt(d);)c-=k,l=f(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=s),e=e.add(l),d=d.sub(m);}return e},y.div=y.divide,y.modulo=function(a){return b(a)||(a=j(a)),this.sub(this.div(a).mul(a))},y.mod=y.modulo,y.not=function(){return g(~this.low,~this.high,this.unsigned)},y.and=function(a){return b(a)||(a=j(a)),g(this.low&a.low,this.high&a.high,this.unsigned)},y.or=function(a){return b(a)||(a=j(a)),g(this.low|a.low,this.high|a.high,this.unsigned)},y.xor=function(a){return b(a)||(a=j(a)),g(this.low^a.low,this.high^a.high,this.unsigned)},y.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):g(0,this.low<<a-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):g(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(a){var c,d;return b(a)&&(a=a.toInt()),a&=63,0===a?this:(c=this.high,32>a?(d=this.low,g(d>>>a|c<<32-a,c>>>a,this.unsigned)):32===a?g(c,0,this.unsigned):g(c>>>a-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},y.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var a=this.high,b=this.low;return [255&b,255&b>>>8,255&b>>>16,255&b>>>24,255&a,255&a>>>8,255&a>>>16,255&a>>>24]},y.toBytesBE=function(){var a=this.high,b=this.low;return [255&a>>>24,255&a>>>16,255&a>>>8,255&a,255&b>>>24,255&b>>>16,255&b>>>8,255&b]},a}(),d=function(a){function f(a){var b=0;return function(){return b<a.length?a.charCodeAt(b++):null}}function g(){var a=[],b=[];return function(){return 0===arguments.length?b.join(\"\")+e.apply(String,a):(a.length+arguments.length>1024&&(b.push(e.apply(String,a)),a.length=0),Array.prototype.push.apply(a,arguments),void 0)}}function h(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j;}return (n?-1:1)*g*Math.pow(2,f-d)}function i(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p;}var c,d,e,j,k,b=function(a,c,e){if(\"undefined\"==typeof a&&(a=b.DEFAULT_CAPACITY),\"undefined\"==typeof c&&(c=b.DEFAULT_ENDIAN),\"undefined\"==typeof e&&(e=b.DEFAULT_NOASSERT),!e){if(a=0|a,0>a)throw RangeError(\"Illegal capacity\");c=!!c,e=!!e;}this.buffer=0===a?d:new ArrayBuffer(a),this.view=0===a?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=a,this.littleEndian=c,this.noAssert=e;};return b.VERSION=\"5.0.1\",b.LITTLE_ENDIAN=!0,b.BIG_ENDIAN=!1,b.DEFAULT_CAPACITY=16,b.DEFAULT_ENDIAN=b.BIG_ENDIAN,b.DEFAULT_NOASSERT=!1,b.Long=a||null,c=b.prototype,c.__isByteBuffer__,Object.defineProperty(c,\"__isByteBuffer__\",{value:!0,enumerable:!1,configurable:!1}),d=new ArrayBuffer(0),e=String.fromCharCode,b.accessor=function(){return Uint8Array},b.allocate=function(a,c,d){return new b(a,c,d)},b.concat=function(a,c,d,e){var f,i,g,h,k,j;for((\"boolean\"==typeof c||\"string\"!=typeof c)&&(e=d,d=c,c=void 0),f=0,g=0,h=a.length;h>g;++g)b.isByteBuffer(a[g])||(a[g]=b.wrap(a[g],c)),i=a[g].limit-a[g].offset,i>0&&(f+=i);if(0===f)return new b(0,d,e);for(j=new b(f,d,e),g=0;h>g;)k=a[g++],i=k.limit-k.offset,0>=i||(j.view.set(k.view.subarray(k.offset,k.limit),j.offset),j.offset+=i);return j.limit=j.offset,j.offset=0,j},b.isByteBuffer=function(a){return (a&&a.__isByteBuffer__)===!0},b.type=function(){return ArrayBuffer},b.wrap=function(a,d,e,f){var g,h;if(\"string\"!=typeof d&&(f=e,e=d,d=void 0),\"string\"==typeof a)switch(\"undefined\"==typeof d&&(d=\"utf8\"),d){case\"base64\":return b.fromBase64(a,e);case\"hex\":return b.fromHex(a,e);case\"binary\":return b.fromBinary(a,e);case\"utf8\":return b.fromUTF8(a,e);case\"debug\":return b.fromDebug(a,e);default:throw Error(\"Unsupported encoding: \"+d)}if(null===a||\"object\"!=typeof a)throw TypeError(\"Illegal buffer\");if(b.isByteBuffer(a))return g=c.clone.call(a),g.markedOffset=-1,g;if(a instanceof Uint8Array)g=new b(0,e,f),a.length>0&&(g.buffer=a.buffer,g.offset=a.byteOffset,g.limit=a.byteOffset+a.byteLength,g.view=new Uint8Array(a.buffer));else if(a instanceof ArrayBuffer)g=new b(0,e,f),a.byteLength>0&&(g.buffer=a,g.offset=0,g.limit=a.byteLength,g.view=a.byteLength>0?new Uint8Array(a):null);else{if(\"[object Array]\"!==Object.prototype.toString.call(a))throw TypeError(\"Illegal buffer\");for(g=new b(a.length,e,f),g.limit=a.length,h=0;h<a.length;++h)g.view[h]=a[h];}return g},c.writeBitSet=function(a,b){var h,d,e,f,g,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(!(a instanceof Array))throw TypeError(\"Illegal BitSet: Not an array\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(d=b,e=a.length,f=e>>3,g=0,b+=this.writeVarint32(e,b);f--;)h=1&!!a[g++]|(1&!!a[g++])<<1|(1&!!a[g++])<<2|(1&!!a[g++])<<3|(1&!!a[g++])<<4|(1&!!a[g++])<<5|(1&!!a[g++])<<6|(1&!!a[g++])<<7,this.writeByte(h,b++);if(e>g){for(i=0,h=0;e>g;)h|=(1&!!a[g++])<<i++;this.writeByte(h,b++);}return c?(this.offset=b,this):b-d},c.readBitSet=function(a){var h,c,d,e,f,g,i,b=\"undefined\"==typeof a;for(b&&(a=this.offset),c=this.readVarint32(a),d=c.value,e=d>>3,f=0,g=[],a+=c.length;e--;)h=this.readByte(a++),g[f++]=!!(1&h),g[f++]=!!(2&h),g[f++]=!!(4&h),g[f++]=!!(8&h),g[f++]=!!(16&h),g[f++]=!!(32&h),g[f++]=!!(64&h),g[f++]=!!(128&h);if(d>f)for(i=0,h=this.readByte(a++);d>f;)g[f++]=!!(1&h>>i++);return b&&(this.offset=a),g},c.readBytes=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+a+\") <= \"+this.buffer.byteLength)}return d=this.slice(b,b+a),c&&(this.offset+=a),d},c.writeBytes=c.append,c.writeInt8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeByte=c.writeInt8,c.readInt8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],128===(128&c)&&(c=-(255-c+1)),b&&(this.offset+=1),c},c.readByte=c.readInt8,c.writeUint8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeUInt8=c.writeUint8,c.readUint8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],b&&(this.offset+=1),c},c.readUInt8=c.readUint8,c.writeInt16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeShort=c.writeInt16,c.readInt16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),32768===(32768&c)&&(c=-(65535-c+1)),b&&(this.offset+=2),c},c.readShort=c.readInt16,c.writeUint16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeUInt16=c.writeUint16,c.readUint16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),b&&(this.offset+=2),c},c.readUInt16=c.readUint16,c.writeInt32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeInt=c.writeInt32,c.readInt32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),c|=0,b&&(this.offset+=4),c},c.readInt=c.readInt32,c.writeUint32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeUInt32=c.writeUint32,c.readUint32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),b&&(this.offset+=4),c},c.readUInt32=c.readUint32,a&&(c.writeInt64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeLong=c.writeInt64,c.readInt64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!1),c&&(this.offset+=8),f},c.readLong=c.readInt64,c.writeUint64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeUInt64=c.writeUint64,c.readUint64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!0),c&&(this.offset+=8),f},c.readUInt64=c.readUint64),c.writeFloat32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,i(this.view,a,b,this.littleEndian,23,4),c&&(this.offset+=4),this},c.writeFloat=c.writeFloat32,c.readFloat32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,23,4),b&&(this.offset+=4),c},c.readFloat=c.readFloat32,c.writeFloat64=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=8,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=8,i(this.view,a,b,this.littleEndian,52,8),c&&(this.offset+=8),this},c.writeDouble=c.writeFloat64,c.readFloat64=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,52,8),b&&(this.offset+=8),c},c.readDouble=c.readFloat64,b.MAX_VARINT32_BYTES=5,b.calculateVarint32=function(a){return a>>>=0,128>a?1:16384>a?2:1<<21>a?3:1<<28>a?4:5},b.zigZagEncode32=function(a){return ((a|=0)<<1^a>>31)>>>0},b.zigZagDecode32=function(a){return 0|a>>>1^-(1&a)},c.writeVarint32=function(a,c){var f,e,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(e=b.calculateVarint32(a),c+=e,g=this.buffer.byteLength,c>g&&this.resize((g*=2)>c?g:c),c-=e,a>>>=0;a>=128;)f=128|127&a,this.view[c++]=f,a>>>=7;return this.view[c++]=a,d?(this.offset=c,this):e},c.writeVarint32ZigZag=function(a,c){return this.writeVarint32(b.zigZagEncode32(a),c)},c.readVarint32=function(a){var e,c,d,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}c=0,d=0;do{if(!this.noAssert&&a>this.limit)throw f=Error(\"Truncated\"),f.truncated=!0,f;e=this.view[a++],5>c&&(d|=(127&e)<<7*c),++c;}while(0!==(128&e));return d|=0,b?(this.offset=a,d):{value:d,length:c}},c.readVarint32ZigZag=function(a){var c=this.readVarint32(a);return \"object\"==typeof c?c.value=b.zigZagDecode32(c.value):c=b.zigZagDecode32(c),c},a&&(b.MAX_VARINT64_BYTES=10,b.calculateVarint64=function(b){\"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b));var c=b.toInt()>>>0,d=b.shiftRightUnsigned(28).toInt()>>>0,e=b.shiftRightUnsigned(56).toInt()>>>0;return 0==e?0==d?16384>c?128>c?1:2:1<<21>c?3:4:16384>d?128>d?5:6:1<<21>d?7:8:128>e?9:10},b.zigZagEncode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned()},b.zigZagDecode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned()},c.writeVarint64=function(c,d){var f,g,h,i,j,e=\"undefined\"==typeof d;if(e&&(d=this.offset),!this.noAssert){if(\"number\"==typeof c)c=a.fromNumber(c);else if(\"string\"==typeof c)c=a.fromString(c);else if(!(c&&c instanceof a))throw TypeError(\"Illegal value: \"+c+\" (not an integer or Long)\");if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}switch(\"number\"==typeof c?c=a.fromNumber(c,!1):\"string\"==typeof c?c=a.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),f=b.calculateVarint64(c),g=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,i=c.shiftRightUnsigned(56).toInt()>>>0,d+=f,j=this.buffer.byteLength,d>j&&this.resize((j*=2)>d?j:d),d-=f,f){case 10:this.view[d+9]=1&i>>>7;case 9:this.view[d+8]=9!==f?128|i:127&i;case 8:this.view[d+7]=8!==f?128|h>>>21:127&h>>>21;case 7:this.view[d+6]=7!==f?128|h>>>14:127&h>>>14;case 6:this.view[d+5]=6!==f?128|h>>>7:127&h>>>7;case 5:this.view[d+4]=5!==f?128|h:127&h;case 4:this.view[d+3]=4!==f?128|g>>>21:127&g>>>21;case 3:this.view[d+2]=3!==f?128|g>>>14:127&g>>>14;case 2:this.view[d+1]=2!==f?128|g>>>7:127&g>>>7;case 1:this.view[d]=1!==f?128|g:127&g;}return e?(this.offset+=f,this):f},c.writeVarint64ZigZag=function(a,c){return this.writeVarint64(b.zigZagEncode64(a),c)},c.readVarint64=function(b){var d,e,f,g,h,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+1+\") <= \"+this.buffer.byteLength)}if(d=b,e=0,f=0,g=0,h=0,h=this.view[b++],e=127&h,128&h&&(h=this.view[b++],e|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g|=(127&h)<<7,128&h||this.noAssert&&\"undefined\"==typeof h))))))))))throw Error(\"Buffer overrun\");return i=a.fromBits(e|f<<28,f>>>4|g<<24,!1),c?(this.offset=b,i):{value:i,length:b-d}},c.readVarint64ZigZag=function(c){var d=this.readVarint64(c);return d&&d.value instanceof a?d.value=b.zigZagDecode64(d.value):d=b.zigZagDecode64(d),d}),c.writeCString=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),e=a.length,!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");for(d=0;e>d;++d)if(0===a.charCodeAt(d))throw RangeError(\"Illegal str: Contains NULL-characters\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=k.calculateUTF16asUTF8(f(a))[1],b+=e+1,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=e+1,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),this.view[b++]=0,c?(this.offset=b,this):e},c.readCString=function(a){var c,e,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=a,f=-1,k.decodeUTF8toUTF16(function(){if(0===f)return null;if(a>=this.limit)throw RangeError(\"Illegal range: Truncated data, \"+a+\" < \"+this.limit);return f=this.view[a++],0===f?null:f}.bind(this),e=g(),!0),b?(this.offset=a,e()):{string:e(),length:a-c}},c.writeIString=function(a,b){var e,d,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(d=b,e=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],b+=4+e,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=4+e,this.littleEndian?(this.view[b+3]=255&e>>>24,this.view[b+2]=255&e>>>16,this.view[b+1]=255&e>>>8,this.view[b]=255&e):(this.view[b]=255&e>>>24,this.view[b+1]=255&e>>>16,this.view[b+2]=255&e>>>8,this.view[b+3]=255&e),b+=4,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),b!==d+4+e)throw RangeError(\"Illegal range: Truncated data, \"+b+\" == \"+(b+4+e));return c?(this.offset=b,this):b-d},c.readIString=function(a){var d,e,f,c=\"undefined\"==typeof a;\n  if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readUint32(a),f=this.readUTF8String(e,b.METRICS_BYTES,a+=4),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},b.METRICS_CHARS=\"c\",b.METRICS_BYTES=\"b\",c.writeUTF8String=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=b,d=k.calculateUTF16asUTF8(f(a))[1],b+=d,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=d,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),c?(this.offset=b,this):b-e},c.writeString=c.writeUTF8String,b.calculateUTF8Chars=function(a){return k.calculateUTF16asUTF8(f(a))[0]},b.calculateUTF8Bytes=function(a){return k.calculateUTF16asUTF8(f(a))[1]},b.calculateString=b.calculateUTF8Bytes,c.readUTF8String=function(a,c,d){var e,i,f,h,j;if(\"number\"==typeof c&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),\"undefined\"==typeof c&&(c=b.METRICS_CHARS),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(f=0,h=d,c===b.METRICS_CHARS){if(i=g(),k.decodeUTF8(function(){return a>f&&d<this.limit?this.view[d++]:null}.bind(this),function(a){++f,k.UTF8toUTF16(a,i);}),f!==a)throw RangeError(\"Illegal range: Truncated data, \"+f+\" == \"+a);return e?(this.offset=d,i()):{string:i(),length:d-h}}if(c===b.METRICS_BYTES){if(!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+a+\") <= \"+this.buffer.byteLength)}if(j=d+a,k.decodeUTF8toUTF16(function(){return j>d?this.view[d++]:null}.bind(this),i=g(),this.noAssert),d!==j)throw RangeError(\"Illegal range: Truncated data, \"+d+\" == \"+j);return e?(this.offset=d,i()):{string:i(),length:d-h}}throw TypeError(\"Unsupported metrics: \"+c)},c.readString=c.readUTF8String,c.writeVString=function(a,c){var g,h,e,i,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(e=c,g=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],h=b.calculateVarint32(g),c+=h+g,i=this.buffer.byteLength,c>i&&this.resize((i*=2)>c?i:c),c-=h+g,c+=this.writeVarint32(g,c),k.encodeUTF16toUTF8(f(a),function(a){this.view[c++]=a;}.bind(this)),c!==e+g+h)throw RangeError(\"Illegal range: Truncated data, \"+c+\" == \"+(c+g+h));return d?(this.offset=c,this):c-e},c.readVString=function(a){var d,e,f,c=\"undefined\"==typeof a;if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readVarint32(a),f=this.readUTF8String(e.value,b.METRICS_BYTES,a+=e.length),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},c.append=function(a,c,d){var e,f,g;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(d+=f,g=this.buffer.byteLength,d>g&&this.resize((g*=2)>d?g:d),d-=f,this.view.set(a.view.subarray(a.offset,a.limit),d),a.offset+=f,e&&(this.offset+=f),this)},c.appendTo=function(a,b){return a.append(this,b),this},c.assert=function(a){return this.noAssert=!a,this},c.capacity=function(){return this.buffer.byteLength},c.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},c.clone=function(a){var c=new b(0,this.littleEndian,this.noAssert);return a?(c.buffer=new ArrayBuffer(this.buffer.byteLength),c.view=new Uint8Array(c.buffer)):(c.buffer=this.buffer,c.view=this.view),c.offset=this.offset,c.markedOffset=this.markedOffset,c.limit=this.limit,c},c.compact=function(a,b){var c,e,f;if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return 0===a&&b===this.buffer.byteLength?this:(c=b-a,0===c?(this.buffer=d,this.view=null,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=0,this):(e=new ArrayBuffer(c),f=new Uint8Array(e),f.set(this.view.subarray(a,b)),this.buffer=e,this.view=f,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=c,this))},c.copy=function(a,c){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>a||a>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(a===c)return new b(0,this.littleEndian,this.noAssert);var d=c-a,e=new b(d,this.littleEndian,this.noAssert);return e.offset=0,e.limit=d,e.markedOffset>=0&&(e.markedOffset-=a),this.copyTo(e,0,a,c),e},c.copyTo=function(a,c,d,e){var f,g,h;if(!this.noAssert&&!b.isByteBuffer(a))throw TypeError(\"Illegal target: Not a ByteBuffer\");if(c=(g=\"undefined\"==typeof c)?a.offset:0|c,d=(f=\"undefined\"==typeof d)?this.offset:0|d,e=\"undefined\"==typeof e?this.limit:0|e,0>c||c>a.buffer.byteLength)throw RangeError(\"Illegal target range: 0 <= \"+c+\" <= \"+a.buffer.byteLength);if(0>d||e>this.buffer.byteLength)throw RangeError(\"Illegal source range: 0 <= \"+d+\" <= \"+this.buffer.byteLength);return h=e-d,0===h?a:(a.ensureCapacity(c+h),a.view.set(this.view.subarray(d,e),c),f&&(this.offset+=h),g&&(a.offset+=h),this)},c.ensureCapacity=function(a){var b=this.buffer.byteLength;return a>b?this.resize((b*=2)>a?b:a):this},c.fill=function(a,b,c){var d=\"undefined\"==typeof b;if(d&&(b=this.offset),\"string\"==typeof a&&a.length>0&&(a=a.charCodeAt(0)),\"undefined\"==typeof b&&(b=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal begin: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(b>=c)return this;for(;c>b;)this.view[b++]=a;return d&&(this.offset=b),this},c.flip=function(){return this.limit=this.offset,this.offset=0,this},c.mark=function(a){if(a=\"undefined\"==typeof a?this.offset:a,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return this.markedOffset=a,this},c.order=function(a){if(!this.noAssert&&\"boolean\"!=typeof a)throw TypeError(\"Illegal littleEndian: Not a boolean\");return this.littleEndian=!!a,this},c.LE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!!a:!0,this},c.BE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!a:!1,this},c.prepend=function(a,c,d){var e,f,g,h,i;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(g=f-d,g>0?(h=new ArrayBuffer(this.buffer.byteLength+g),i=new Uint8Array(h),i.set(this.view.subarray(d,this.buffer.byteLength),f),this.buffer=h,this.view=i,this.offset+=g,this.markedOffset>=0&&(this.markedOffset+=g),this.limit+=g,d+=g):new Uint8Array(this.buffer),this.view.set(a.view.subarray(a.offset,a.limit),d-f),a.offset=a.limit,e&&(this.offset-=f),this)},c.prependTo=function(a,b){return a.prepend(this,b),this},c.printDebug=function(a){\"function\"!=typeof a&&(a=console.log.bind(console)),a(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(!0));},c.remaining=function(){return this.limit-this.offset},c.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},c.resize=function(a){var b,c;if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal capacity: \"+a+\" (not an integer)\");if(a|=0,0>a)throw RangeError(\"Illegal capacity: 0 <= \"+a)}return this.buffer.byteLength<a&&(b=new ArrayBuffer(a),c=new Uint8Array(b),c.set(this.view),this.buffer=b,this.view=c),this},c.reverse=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return a===b?this:(Array.prototype.reverse.call(this.view.subarray(a,b)),this)},c.skip=function(a){if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");a|=0;}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+a+\" <= \"+this.buffer.byteLength);return this.offset=b,this},c.slice=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c=this.clone();return c.offset=a,c.limit=b,c},c.toBuffer=function(a){var e,b=this.offset,c=this.limit;if(!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal limit: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}return a||0!==b||c!==this.buffer.byteLength?b===c?d:(e=new ArrayBuffer(c-b),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b,c),0),e):this.buffer},c.toArrayBuffer=c.toBuffer,c.toString=function(a,b,c){if(\"undefined\"==typeof a)return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";switch(\"number\"==typeof a&&(a=\"utf8\",b=a,c=b),a){case\"utf8\":return this.toUTF8(b,c);case\"base64\":return this.toBase64(b,c);case\"hex\":return this.toHex(b,c);case\"binary\":return this.toBinary(b,c);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+a)}},j=function(){var d,e,a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[];for(d=0,e=b.length;e>d;++d)c[b[d]]=d;return a.encode=function(a,c){for(var d,e;null!==(d=a());)c(b[63&d>>2]),e=(3&d)<<4,null!==(d=a())?(e|=15&d>>4,c(b[63&(e|15&d>>4)]),e=(15&d)<<2,null!==(d=a())?(c(b[63&(e|3&d>>6)]),c(b[63&d])):(c(b[63&e]),c(61))):(c(b[63&e]),c(61),c(61));},a.decode=function(a,b){function g(a){throw Error(\"Illegal character code: \"+a)}for(var d,e,f;null!==(d=a());)if(e=c[d],\"undefined\"==typeof e&&g(d),null!==(d=a())&&(f=c[d],\"undefined\"==typeof f&&g(d),b(e<<2>>>0|(48&f)>>4),null!==(d=a()))){if(e=c[d],\"undefined\"==typeof e){if(61===d)break;g(d);}if(b((15&f)<<4>>>0|(60&e)>>2),null!==(d=a())){if(f=c[d],\"undefined\"==typeof f){if(61===d)break;g(d);}b((3&e)<<6>>>0|f);}}},a.test=function(a){return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a)},a}(),c.toBase64=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a=0|a,b=0|b,0>a||b>this.capacity||a>b)throw RangeError(\"begin, end\");var c;return j.encode(function(){return b>a?this.view[a++]:null}.bind(this),c=g()),c()},b.fromBase64=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");var d=new b(3*(a.length/4),c),e=0;return j.decode(f(a),function(a){d.view[e++]=a;}),d.limit=e,d},b.btoa=function(a){return b.fromBinary(a).toBase64()},b.atob=function(a){return b.fromBase64(a).toBinary()},c.toBinary=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a|=0,b|=0,0>a||b>this.capacity()||a>b)throw RangeError(\"begin, end\");if(a===b)return \"\";for(var c=[],d=[];b>a;)c.push(this.view[a++]),c.length>=1024&&(d.push(String.fromCharCode.apply(String,c)),c=[]);return d.join(\"\")+String.fromCharCode.apply(String,c)},b.fromBinary=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");for(var f,d=0,e=a.length,g=new b(e,c);e>d;){if(f=a.charCodeAt(d),f>255)throw RangeError(\"illegal char code: \"+f);g.view[d++]=f;}return g.limit=e,g},c.toDebug=function(a){for(var d,b=-1,c=this.buffer.byteLength,e=\"\",f=\"\",g=\"\";c>b;){if(-1!==b&&(d=this.view[b],e+=16>d?\"0\"+d.toString(16).toUpperCase():d.toString(16).toUpperCase(),a&&(f+=d>32&&127>d?String.fromCharCode(d):\".\")),++b,a&&b>0&&0===b%16&&b!==c){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\",e=f=\"\";}e+=b===this.offset&&b===this.limit?b===this.markedOffset?\"!\":\"|\":b===this.offset?b===this.markedOffset?\"[\":\"<\":b===this.limit?b===this.markedOffset?\"]\":\">\":b===this.markedOffset?\"'\":a||0!==b&&b!==c?\" \":\"\";}if(a&&\" \"!==e){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\";}return a?g:e},b.fromDebug=function(a,c,d){for(var i,j,e=a.length,f=new b(0|(e+1)/3,c,d),g=0,h=0,k=!1,l=!1,m=!1,n=!1,o=!1;e>g;){switch(i=a.charAt(g++)){case\"!\":if(!d){if(l||m||n){o=!0;break}l=m=n=!0;}f.offset=f.markedOffset=f.limit=h,k=!1;break;case\"|\":if(!d){if(l||n){o=!0;break}l=n=!0;}f.offset=f.limit=h,k=!1;break;case\"[\":if(!d){if(l||m){o=!0;break}l=m=!0;}f.offset=f.markedOffset=h,k=!1;break;case\"<\":if(!d){if(l){o=!0;break}l=!0;}f.offset=h,k=!1;break;case\"]\":if(!d){if(n||m){o=!0;break}n=m=!0;}f.limit=f.markedOffset=h,k=!1;break;case\">\":if(!d){if(n){o=!0;break}n=!0;}f.limit=h,k=!1;break;case\"'\":if(!d){if(m){o=!0;break}m=!0;}f.markedOffset=h,k=!1;break;case\" \":k=!1;break;default:if(!d&&k){o=!0;break}if(j=parseInt(i+a.charAt(g++),16),!d&&(isNaN(j)||0>j||j>255))throw TypeError(\"Illegal str: Not a debug encoded string\");f.view[h++]=j,k=!0;}if(o)throw TypeError(\"Illegal str: Invalid symbol at \"+g)}if(!d){if(!l||!n)throw TypeError(\"Illegal str: Missing offset or limit\");if(h<f.buffer.byteLength)throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+h+\" < \"+e)}return f},c.toHex=function(a,b){if(a=\"undefined\"==typeof a?this.offset:a,b=\"undefined\"==typeof b?this.limit:b,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}for(var d,c=new Array(b-a);b>a;)d=this.view[a++],16>d?c.push(\"0\",d.toString(16)):c.push(d.toString(16));return c.join(\"\")},b.fromHex=function(a,c,d){var g,e,f,h,i;if(!d){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(0!==a.length%2)throw TypeError(\"Illegal str: Length not a multiple of 2\")}for(e=a.length,f=new b(0|e/2,c),h=0,i=0;e>h;h+=2){if(g=parseInt(a.substring(h,h+2),16),!d&&(!isFinite(g)||0>g||g>255))throw TypeError(\"Illegal str: Contains non-hex characters\");f.view[i++]=g;}return f.limit=i,f},k=function(){var a={};return a.MAX_CODEPOINT=1114111,a.encodeUTF8=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)128>c?b(127&c):2048>c?(b(192|31&c>>6),b(128|63&c)):65536>c?(b(224|15&c>>12),b(128|63&c>>6),b(128|63&c)):(b(240|7&c>>18),b(128|63&c>>12),b(128|63&c>>6),b(128|63&c)),c=null;},a.decodeUTF8=function(a,b){for(var c,d,e,f,g=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());throw b.name=\"TruncatedError\",b.bytes=a,b};null!==(c=a());)if(0===(128&c))b(c);else if(192===(224&c))null===(d=a())&&g([c,d]),b((31&c)<<6|63&d);else if(224===(240&c))(null===(d=a())||null===(e=a()))&&g([c,d,e]),b((15&c)<<12|(63&d)<<6|63&e);else{if(240!==(248&c))throw RangeError(\"Illegal starting byte: \"+c);(null===(d=a())||null===(e=a())||null===(f=a()))&&g([c,d,e,f]),b((7&c)<<18|(63&d)<<12|(63&e)<<6|63&f);}},a.UTF16toUTF8=function(a,b){for(var c,d=null;;){if(null===(c=null!==d?d:a()))break;c>=55296&&57343>=c&&null!==(d=a())&&d>=56320&&57343>=d?(b(1024*(c-55296)+d-56320+65536),d=null):b(c);}null!==d&&b(d);},a.UTF8toUTF16=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)),c=null;},a.encodeUTF16toUTF8=function(b,c){a.UTF16toUTF8(b,function(b){a.encodeUTF8(b,c);});},a.decodeUTF8toUTF16=function(b,c){a.decodeUTF8(b,function(b){a.UTF8toUTF16(b,c);});},a.calculateCodePoint=function(a){return 128>a?1:2048>a?2:65536>a?3:4},a.calculateUTF8=function(a){for(var b,c=0;null!==(b=a());)c+=128>b?1:2048>b?2:65536>b?3:4;return c},a.calculateUTF16asUTF8=function(b){var c=0,d=0;return a.UTF16toUTF8(b,function(a){++c,d+=128>a?1:2048>a?2:65536>a?3:4;}),[c,d]},a}(),c.toUTF8=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c;try{k.decodeUTF8toUTF16(function(){return b>a?this.view[a++]:null}.bind(this),c=g());}catch(d){if(a!==b)throw RangeError(\"Illegal range: Truncated data, \"+a+\" != \"+b)}return c()},b.fromUTF8=function(a,c,d){if(!d&&\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");var e=new b(k.calculateUTF16asUTF8(f(a),!0)[1],c,d),g=0;return k.encodeUTF16toUTF8(f(a),function(a){e.view[g++]=a;}),e.limit=g,e},b}(c),e=function(b,c){var f,h,i,e={};return e.ByteBuffer=b,e.c=b,f=b,e.Long=c||null,e.VERSION=\"5.0.1\",e.WIRE_TYPES={},e.WIRE_TYPES.VARINT=0,e.WIRE_TYPES.BITS64=1,e.WIRE_TYPES.LDELIM=2,e.WIRE_TYPES.STARTGROUP=3,e.WIRE_TYPES.ENDGROUP=4,e.WIRE_TYPES.BITS32=5,e.PACKABLE_WIRE_TYPES=[e.WIRE_TYPES.VARINT,e.WIRE_TYPES.BITS64,e.WIRE_TYPES.BITS32],e.TYPES={int32:{name:\"int32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},uint64:{name:\"uint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.UZERO:void 0},sint64:{name:\"sint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},bool:{name:\"bool\",wireType:e.WIRE_TYPES.VARINT,defaultValue:!1},\"double\":{name:\"double\",wireType:e.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.UZERO:void 0},sfixed64:{name:\"sfixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.ZERO:void 0},\"float\":{name:\"float\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:e.WIRE_TYPES.STARTGROUP,defaultValue:null}},e.MAP_KEY_TYPES=[e.TYPES.int32,e.TYPES.sint32,e.TYPES.sfixed32,e.TYPES.uint32,e.TYPES.fixed32,e.TYPES.int64,e.TYPES.sint64,e.TYPES.sfixed64,e.TYPES.uint64,e.TYPES.fixed64,e.TYPES.bool,e.TYPES.string,e.TYPES.bytes],e.ID_MIN=1,e.ID_MAX=536870911,e.convertFieldsToCamelCase=!1,e.populateAccessors=!0,e.populateDefaults=!0,e.Util=function(){var a={};return a.IS_NODE=!(\"object\"!=typeof process||\"[object process]\"!=process+\"\"||process.browser),a.XHR=function(){var c,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}],b=null;for(c=0;c<a.length;c++){try{b=a[c]();}catch(d){continue}break}if(!b)throw Error(\"XMLHttpRequest is not supported\");return b},a.fetch=function(b,c){if(c&&\"function\"!=typeof c&&(c=null),a.IS_NODE)if(c)g.readFile(b,function(a,b){a?c(null):c(\"\"+b);});else try{return g.readFileSync(b)}catch(d){return null}else{var e=a.XHR();if(e.open(\"GET\",b,c?!0:!1),e.setRequestHeader(\"Accept\",\"text/plain\"),\"function\"==typeof e.overrideMimeType&&e.overrideMimeType(\"text/plain\"),!c)return e.send(null),200==e.status||0==e.status&&\"string\"==typeof e.responseText?e.responseText:null;if(e.onreadystatechange=function(){4==e.readyState&&(200==e.status||0==e.status&&\"string\"==typeof e.responseText?c(e.responseText):c(null));},4==e.readyState)return;e.send(null);}},a.toCamelCase=function(a){return a.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},a}(),e.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g},e.DotProto=function(a,b){function h(a,c){var d=-1,e=1;if(\"-\"==a.charAt(0)&&(e=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))d=parseInt(a);else if(b.NUMBER_HEX.test(a))d=parseInt(a.substring(2),16);else{if(!b.NUMBER_OCT.test(a))throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);d=parseInt(a.substring(1),8);}if(d=0|e*d,!c&&0>d)throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);return d}function i(a){var c=1;if(\"-\"==a.charAt(0)&&(c=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))return c*parseInt(a,10);if(b.NUMBER_HEX.test(a))return c*parseInt(a.substring(2),16);if(b.NUMBER_OCT.test(a))return c*parseInt(a.substring(1),8);if(\"inf\"===a)return 1/0*c;if(\"nan\"===a)return 0/0;if(b.NUMBER_FLT.test(a))return c*parseFloat(a);throw Error(\"illegal number value: \"+(0>c?\"-\":\"\")+a)}function j(a,b,c){\"undefined\"==typeof a[b]?a[b]=c:(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(c));}var f,g,c={},d=function(a){this.source=a+\"\",this.index=0,this.line=1,this.stack=[],this._stringOpen=null;},e=d.prototype;return e._readString=function(){var c,a='\"'===this._stringOpen?b.STRING_DQ:b.STRING_SQ;if(a.lastIndex=this.index-1,c=a.exec(this.source),!c)throw Error(\"unterminated string\");return this.index=a.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,c[1]},e.next=function(){var a,c,d,e,f,g;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(a=!1;b.WHITESPACE.test(d=this.source.charAt(this.index));)if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;if(\"/\"===this.source.charAt(this.index))if(++this.index,\"/\"===this.source.charAt(this.index)){for(;\"\\n\"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,a=!0;}else{if(\"*\"!==(d=this.source.charAt(this.index)))return \"/\";do{if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;c=d,d=this.source.charAt(this.index);}while(\"*\"!==c||\"/\"!==d);++this.index,a=!0;}}while(a);if(this.index===this.source.length)return null;if(e=this.index,b.DELIM.lastIndex=0,f=b.DELIM.test(this.source.charAt(e++)),!f)for(;e<this.source.length&&!b.DELIM.test(this.source.charAt(e));)++e;return g=this.source.substring(this.index,this.index=e),('\"'===g||\"'\"===g)&&(this._stringOpen=g),g},e.peek=function(){if(0===this.stack.length){var a=this.next();if(null===a)return null;this.stack.push(a);}return this.stack[0]},e.skip=function(a){var b=this.next();if(b!==a)throw Error(\"illegal '\"+b+\"', '\"+a+\"' expected\")},e.omit=function(a){return this.peek()===a?(this.next(),!0):!1},e.toString=function(){return \"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"},c.Tokenizer=d,f=function(a){this.tn=new d(a),this.proto3=!1;},g=f.prototype,g.parse=function(){var c,a={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]},d=!0;try{for(;c=this.tn.next();)switch(c){case\"package\":if(!d||null!==a[\"package\"])throw Error(\"unexpected 'package'\");if(c=this.tn.next(),!b.TYPEREF.test(c))throw Error(\"illegal package name: \"+c);this.tn.skip(\";\"),a[\"package\"]=c;break;case\"import\":if(!d)throw Error(\"unexpected 'import'\");c=this.tn.peek(),\"public\"===c&&this.tn.next(),c=this._readString(),this.tn.skip(\";\"),a.imports.push(c);break;case\"syntax\":if(!d)throw Error(\"unexpected 'syntax'\");this.tn.skip(\"=\"),\"proto3\"===(a.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(\";\");break;case\"message\":this._parseMessage(a,null),d=!1;break;case\"enum\":this._parseEnum(a),d=!1;break;case\"option\":this._parseOption(a);break;case\"service\":this._parseService(a);break;case\"extend\":this._parseExtend(a);break;default:throw Error(\"unexpected '\"+c+\"'\")}}catch(e){throw e.message=\"Parse error at line \"+this.tn.line+\": \"+e.message,e}return delete a.name,a},f.parse=function(a){return new f(a).parse()},g._readString=function(){var b,c,a=\"\";do{if(c=this.tn.next(),\"'\"!==c&&'\"'!==c)throw Error(\"illegal string delimiter: \"+c);a+=this.tn.next(),this.tn.skip(c),b=this.tn.peek();}while('\"'===b||'\"'===b);return a},g._readValue=function(a){var c=this.tn.peek();if('\"'===c||\"'\"===c)return this._readString();if(this.tn.next(),b.NUMBER.test(c))return i(c);if(b.BOOL.test(c))return \"true\"===c.toLowerCase();if(a&&b.TYPEREF.test(c))return c;throw Error(\"illegal value: \"+c)},g._parseOption=function(a,c){var f,d=this.tn.next(),e=!1;if(\"(\"===d&&(e=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal option name: \"+d);f=d,e&&(this.tn.skip(\")\"),f=\"(\"+f+\")\",d=this.tn.peek(),b.FQTYPEREF.test(d)&&(f+=d,this.tn.next())),this.tn.skip(\"=\"),this._parseOptionValue(a,f),c||this.tn.skip(\";\");},g._parseOptionValue=function(a,c){var d=this.tn.peek();if(\"{\"!==d)j(a.options,c,this._readValue(!0));else for(this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());){if(!b.NAME.test(d))throw Error(\"illegal option name: \"+c+\".\"+d);this.tn.omit(\":\")?j(a.options,c+\".\"+d,this._readValue(!0)):this._parseOptionValue(a,c+\".\"+d);}},g._parseService=function(a){var d,e,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal service name at line \"+this.tn.line+\": \"+c);for(d=c,e={name:d,rpc:{},options:{}},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(\"option\"===c)this._parseOption(e);else{if(\"rpc\"!==c)throw Error(\"illegal service token: \"+c);this._parseServiceRPC(e);}this.tn.omit(\";\"),a.services.push(e);},g._parseServiceRPC=function(a){var e,f,c=\"rpc\",d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal rpc service method name: \"+d);if(e=d,f={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.request_stream=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal rpc service request type: \"+d);if(f.request=d,this.tn.skip(\")\"),d=this.tn.next(),\"returns\"!==d.toLowerCase())throw Error(\"illegal rpc service request type delimiter: \"+d);if(this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.response_stream=!0,d=this.tn.next()),f.response=d,this.tn.skip(\")\"),d=this.tn.peek(),\"{\"===d){for(this.tn.next();\"}\"!==(d=this.tn.next());){if(\"option\"!==d)throw Error(\"illegal rpc service token: \"+d);this._parseOption(f);}this.tn.omit(\";\");}else this.tn.skip(\";\");\"undefined\"==typeof a[c]&&(a[c]={}),a[c][e]=f;},g._parseMessage=function(a,c){var d=!!c,e=this.tn.next(),f={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!b.NAME.test(e))throw Error(\"illegal \"+(d?\"group\":\"message\")+\" name: \"+e);for(f.name=e,d&&(this.tn.skip(\"=\"),c.id=h(this.tn.next()),f.isGroup=!0),e=this.tn.peek(),\"[\"===e&&c&&this._parseFieldOptions(c),this.tn.skip(\"{\");\"}\"!==(e=this.tn.next());)if(b.RULE.test(e))this._parseMessageField(f,e);else if(\"oneof\"===e)this._parseMessageOneOf(f);else if(\"enum\"===e)this._parseEnum(f);else if(\"message\"===e)this._parseMessage(f);else if(\"option\"===e)this._parseOption(f);else if(\"service\"===e)this._parseService(f);else if(\"extensions\"===e)f.extensions=this._parseExtensionRanges();else if(\"reserved\"===e)this._parseIgnored();else if(\"extend\"===e)this._parseExtend(f);else{if(!b.TYPEREF.test(e))throw Error(\"illegal message token: \"+e);if(!this.proto3)throw Error(\"illegal field rule: \"+e);this._parseMessageField(f,\"optional\",e);}return this.tn.omit(\";\"),a.messages.push(f),f},g._parseIgnored=function(){for(;\";\"!==this.tn.peek();)this.tn.next();this.tn.skip(\";\");},g._parseMessageField=function(a,c,d){var e,f,g;if(!b.RULE.test(c))throw Error(\"illegal message field rule: \"+c);if(e={rule:c,type:\"\",name:\"\",options:{},id:0},\"map\"===c){if(d)throw Error(\"illegal type: \"+d);if(this.tn.skip(\"<\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field type: \"+f);if(e.keytype=f,this.tn.skip(\",\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field: \"+f);if(e.type=f,this.tn.skip(\">\"),f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}else if(d=\"undefined\"!=typeof d?d:this.tn.next(),\"group\"===d){if(g=this._parseMessage(a,e),!/^[A-Z]/.test(g.name))throw Error(\"illegal group name: \"+g.name);e.type=g.name,e.name=g.name.toLowerCase(),this.tn.omit(\";\");}else{if(!b.TYPE.test(d)&&!b.TYPEREF.test(d))throw Error(\"illegal message field type: \"+d);if(e.type=d,f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);\n  e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}return a.fields.push(e),e},g._parseMessageOneOf=function(a){var e,d,f,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal oneof name: \"+c);for(d=c,f=[],this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)e=this._parseMessageField(a,\"optional\",c),e.oneof=d,f.push(e.id);this.tn.omit(\";\"),a.oneofs[d]=f;},g._parseFieldOptions=function(a){this.tn.skip(\"[\");for(var b,c=!0;\"]\"!==(b=this.tn.peek());)c||this.tn.skip(\",\"),this._parseOption(a,!0),c=!1;this.tn.next();},g._parseEnum=function(a){var e,c={name:\"\",values:[],options:{}},d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);for(c.name=d,this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());)if(\"option\"===d)this._parseOption(c);else{if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);this.tn.skip(\"=\"),e={name:d,id:h(this.tn.next(),!0)},d=this.tn.peek(),\"[\"===d&&this._parseFieldOptions({options:{}}),this.tn.skip(\";\"),c.values.push(e);}this.tn.omit(\";\"),a.enums.push(c);},g._parseExtensionRanges=function(){var c,d,e,b=[];do{for(d=[];;){switch(c=this.tn.next()){case\"min\":e=a.ID_MIN;break;case\"max\":e=a.ID_MAX;break;default:e=i(c);}if(d.push(e),2===d.length)break;if(\"to\"!==this.tn.peek()){d.push(e);break}this.tn.next();}b.push(d);}while(this.tn.omit(\",\"));return this.tn.skip(\";\"),b},g._parseExtend=function(a){var d,c=this.tn.next();if(!b.TYPEREF.test(c))throw Error(\"illegal extend reference: \"+c);for(d={ref:c,fields:[]},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(b.RULE.test(c))this._parseMessageField(d,c);else{if(!b.TYPEREF.test(c))throw Error(\"illegal extend token: \"+c);if(!this.proto3)throw Error(\"illegal field rule: \"+c);this._parseMessageField(d,\"optional\",c);}return this.tn.omit(\";\"),a.messages.push(d),d},g.toString=function(){return \"Parser at line \"+this.tn.line},c.Parser=f,c}(e,e.Lang),e.Reflect=function(a){function k(b){if(\"string\"==typeof b&&(b=a.TYPES[b]),\"undefined\"==typeof b.defaultValue)throw Error(\"default value for type \"+b.name+\" is not supported\");return b==a.TYPES.bytes?new f(0):b.defaultValue}function l(b,c){if(b&&\"number\"==typeof b.low&&\"number\"==typeof b.high&&\"boolean\"==typeof b.unsigned&&b.low===b.low&&b.high===b.high)return new a.Long(b.low,b.high,\"undefined\"==typeof c?b.unsigned:c);if(\"string\"==typeof b)return a.Long.fromString(b,c||!1,10);if(\"number\"==typeof b)return a.Long.fromNumber(b,c||!1);throw Error(\"not convertible to Long\")}function o(b,c){var d=c.readVarint32(),e=7&d,f=d>>>3;switch(e){case a.WIRE_TYPES.VARINT:do d=c.readUint8();while(128===(128&d));break;case a.WIRE_TYPES.BITS64:c.offset+=8;break;case a.WIRE_TYPES.LDELIM:d=c.readVarint32(),c.offset+=d;break;case a.WIRE_TYPES.STARTGROUP:o(f,c);break;case a.WIRE_TYPES.ENDGROUP:if(f===b)return !1;throw Error(\"Illegal GROUPEND after unknown group: \"+f+\" (\"+b+\" expected)\");case a.WIRE_TYPES.BITS32:c.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+b+\": \"+e)}return !0}var g,h,i,j,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,c={},d=function(a,b,c){this.builder=a,this.parent=b,this.name=c,this.className;},e=d.prototype;return e.fqn=function(){for(var a=this.name,b=this;;){if(b=b.parent,null==b)break;a=b.name+\".\"+a;}return a},e.toString=function(a){return (a?this.className+\" \":\"\")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+\" cannot be built directly\")},c.T=d,g=function(a,b,c,e,f){d.call(this,a,b,c),this.className=\"Namespace\",this.children=[],this.options=e||{},this.syntax=f||\"proto2\";},h=g.prototype=Object.create(d.prototype),h.getChildren=function(a){var b,c,d;if(a=a||null,null==a)return this.children.slice();for(b=[],c=0,d=this.children.length;d>c;++c)this.children[c]instanceof a&&b.push(this.children[c]);return b},h.addChild=function(a){var b;if(b=this.getChild(a.name))if(b instanceof m.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else{if(!(a instanceof m.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName)))throw Error(\"Duplicate name in namespace \"+this.toString(!0)+\": \"+a.name);a.name=a.originalName;}this.children.push(a);},h.getChild=function(a){var c,d,b=\"number\"==typeof a?\"id\":\"name\";for(c=0,d=this.children.length;d>c;++c)if(this.children[c][b]===a)return this.children[c];return null},h.resolve=function(a,b){var g,d=\"string\"==typeof a?a.split(\".\"):a,e=this,f=0;if(\"\"===d[f]){for(;null!==e.parent;)e=e.parent;f++;}do{do{if(!(e instanceof c.Namespace)){e=null;break}if(g=e.getChild(d[f]),!(g&&g instanceof c.T&&(!b||g instanceof c.Namespace))){e=null;break}e=g,f++;}while(f<d.length);if(null!=e)break;if(null!==this.parent)return this.parent.resolve(a,b)}while(null!=e);return e},h.qn=function(a){var e,f,b=[],d=a;do b.unshift(d.name),d=d.parent;while(null!==d);for(e=1;e<=b.length;e++)if(f=b.slice(b.length-e),a===this.resolve(f,a instanceof c.Namespace))return f.join(\".\");return a.fqn()},h.build=function(){var e,c,d,a={},b=this.children;for(c=0,d=b.length;d>c;++c)e=b[c],e instanceof g&&(a[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(a,\"$options\",{value:this.buildOpt()}),a},h.buildOpt=function(){var c,d,e,f,a={},b=Object.keys(this.options);for(c=0,d=b.length;d>c;++c)e=b[c],f=this.options[b[c]],a[e]=f;return a},h.getOption=function(a){return \"undefined\"==typeof a?this.options:\"undefined\"!=typeof this.options[a]?this.options[a]:null},c.Namespace=g,i=function(b,c,d,e){if(this.type=b,this.resolvedType=c,this.isMapKey=d,this.syntax=e,d&&a.MAP_KEY_TYPES.indexOf(b)<0)throw Error(\"Invalid map key type: \"+b.name)},j=i.prototype,i.defaultFieldValue=k,j.verifyValue=function(c){var f,g,h,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this);switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),c>4294967295?0|c:c;case a.TYPES.uint32:case a.TYPES.fixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),0>c?c>>>0:c;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if(a.Long)try{return l(c,!1)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.uint64:case a.TYPES.fixed64:if(a.Long)try{return l(c,!0)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.bool:return \"boolean\"!=typeof c&&d(typeof c,\"not a boolean\"),c;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return \"number\"!=typeof c&&d(typeof c,\"not a number\"),c;case a.TYPES.string:return \"string\"==typeof c||c&&c instanceof String||d(typeof c,\"not a string\"),\"\"+c;case a.TYPES.bytes:return b.isByteBuffer(c)?c:b.wrap(c);case a.TYPES[\"enum\"]:for(f=this.resolvedType.getChildren(a.Reflect.Enum.Value),h=0;h<f.length;h++){if(f[h].name==c)return f[h].id;if(f[h].id==c)return f[h].id}if(\"proto3\"===this.syntax)return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),(c>4294967295||0>c)&&d(typeof c,\"not in range for uint32\"),c;d(c,\"not a valid enum value\");case a.TYPES.group:case a.TYPES.message:if(c&&\"object\"==typeof c||d(typeof c,\"object expected\"),c instanceof this.resolvedType.clazz)return c;if(c instanceof a.Builder.Message){g={};for(h in c)c.hasOwnProperty(h)&&(g[h]=c[h]);c=g;}return new this.resolvedType.clazz(c)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(!0)+\": \"+c+\" (undefined type \"+this.type+\")\")},j.calculateLength=function(b,c){if(null===c)return 0;var d;switch(this.type){case a.TYPES.int32:return 0>c?f.calculateVarint64(c):f.calculateVarint32(c);case a.TYPES.uint32:return f.calculateVarint32(c);case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c));case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES[\"float\"]:return 4;case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c);case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c));case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8;case a.TYPES.bool:return 1;case a.TYPES[\"enum\"]:return f.calculateVarint32(c);case a.TYPES[\"double\"]:return 8;case a.TYPES.string:return d=f.calculateUTF8Bytes(c),f.calculateVarint32(d)+d;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");return f.calculateVarint32(c.remaining())+c.remaining();case a.TYPES.message:return d=this.resolvedType.calculate(c),f.calculateVarint32(d)+d;case a.TYPES.group:return d=this.resolvedType.calculate(c),d+f.calculateVarint32(b<<3|a.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")},j.encodeValue=function(b,c,d){var e,g;if(null===c)return d;switch(this.type){case a.TYPES.int32:0>c?d.writeVarint64(c):d.writeVarint32(c);break;case a.TYPES.uint32:d.writeVarint32(c);break;case a.TYPES.sint32:d.writeVarint32ZigZag(c);break;case a.TYPES.fixed32:d.writeUint32(c);break;case a.TYPES.sfixed32:d.writeInt32(c);break;case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c);break;case a.TYPES.sint64:d.writeVarint64ZigZag(c);break;case a.TYPES.fixed64:d.writeUint64(c);break;case a.TYPES.sfixed64:d.writeInt64(c);break;case a.TYPES.bool:\"string\"==typeof c?d.writeVarint32(\"false\"===c.toLowerCase()?0:!!c):d.writeVarint32(c?1:0);break;case a.TYPES[\"enum\"]:d.writeVarint32(c);break;case a.TYPES[\"float\"]:d.writeFloat32(c);break;case a.TYPES[\"double\"]:d.writeFloat64(c);break;case a.TYPES.string:d.writeVString(c);break;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");e=c.offset,d.writeVarint32(c.remaining()),d.append(c),c.offset=e;break;case a.TYPES.message:g=(new f).LE(),this.resolvedType.encode(c,g),d.writeVarint32(g.offset),d.append(g.flip());break;case a.TYPES.group:this.resolvedType.encode(c,d),d.writeVarint32(b<<3|a.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")}return d},j.decode=function(b,c,d){if(c!=this.type.wireType)throw Error(\"Unexpected wire type for element\");var e,f;switch(this.type){case a.TYPES.int32:return 0|b.readVarint32();case a.TYPES.uint32:return b.readVarint32()>>>0;case a.TYPES.sint32:return 0|b.readVarint32ZigZag();case a.TYPES.fixed32:return b.readUint32()>>>0;case a.TYPES.sfixed32:return 0|b.readInt32();case a.TYPES.int64:return b.readVarint64();case a.TYPES.uint64:return b.readVarint64().toUnsigned();case a.TYPES.sint64:return b.readVarint64ZigZag();case a.TYPES.fixed64:return b.readUint64();case a.TYPES.sfixed64:return b.readInt64();case a.TYPES.bool:return !!b.readVarint32();case a.TYPES[\"enum\"]:return b.readVarint32();case a.TYPES[\"float\"]:return b.readFloat();case a.TYPES[\"double\"]:return b.readDouble();case a.TYPES.string:return b.readVString();case a.TYPES.bytes:if(f=b.readVarint32(),b.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+b.remaining());return e=b.clone(),e.limit=e.offset+f,b.offset+=f,e;case a.TYPES.message:return f=b.readVarint32(),this.resolvedType.decode(b,f);case a.TYPES.group:return this.resolvedType.decode(b,-1,d)}throw Error(\"[INTERNAL] Illegal decode type\")},j.valueFromString=function(b){if(!this.isMapKey)throw Error(\"valueFromString() called on non-map-key element\");switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b));case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b);case a.TYPES.bool:return \"true\"===b;case a.TYPES.string:return this.verifyValue(b);case a.TYPES.bytes:return f.fromBinary(b)}},j.valueToString=function(b){if(!this.isMapKey)throw Error(\"valueToString() called on non-map-key element\");return this.type===a.TYPES.bytes?b.toString(\"binary\"):b.toString()},c.Element=i,m=function(a,b,c,d,e,f){g.call(this,a,b,c,d,f),this.className=\"Message\",this.extensions=void 0,this.clazz=null,this.isGroup=!!e,this._fields=null,this._fieldsById=null,this._fieldsByName=null;},n=m.prototype=Object.create(g.prototype),n.build=function(c){var d,h,e,g;if(this.clazz&&!c)return this.clazz;for(d=function(a,c){function k(b,c,d,e){var g,h,i,j,l,m,n;if(null===b||\"object\"!=typeof b)return e&&e instanceof a.Reflect.Enum&&(g=a.Reflect.Enum.getName(e.object,b),null!==g)?g:b;if(f.isByteBuffer(b))return c?b.toBase64():b.toBuffer();if(a.Long.isLong(b))return d?b.toString():a.Long.fromValue(b);if(Array.isArray(b))return h=[],b.forEach(function(a,b){h[b]=k(a,c,d,e);}),h;if(h={},b instanceof a.Map){for(i=b.entries(),j=i.next();!j.done;j=i.next())h[b.keyElem.valueToString(j.value[0])]=k(j.value[1],c,d,b.valueElem.resolvedType);return h}l=b.$type,m=void 0;for(n in b)b.hasOwnProperty(n)&&(h[n]=l&&(m=l.getChild(n))?k(b[n],c,d,m.resolvedType):k(b[n],c,d));return h}var i,j,d=c.getChildren(a.Reflect.Message.Field),e=c.getChildren(a.Reflect.Message.OneOf),g=function(b){var i,j,k,l;for(a.Builder.Message.call(this),i=0,j=e.length;j>i;++i)this[e[i].name]=null;for(i=0,j=d.length;j>i;++i)k=d[i],this[k.name]=k.repeated?[]:k.map?new a.Map(k):null,!k.required&&\"proto3\"!==c.syntax||null===k.defaultValue||(this[k.name]=k.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===b||\"object\"!=typeof b||!(\"function\"!=typeof b.encode||b instanceof g)||Array.isArray(b)||b instanceof a.Map||f.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(i=0,j=arguments.length;j>i;++i)\"undefined\"!=typeof(l=arguments[i])&&this.$set(d[i].name,l);else this.$set(b);},h=g.prototype=Object.create(a.Builder.Message.prototype);for(h.add=function(b,d,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+\"#\"+b+\" is undefined\");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+f.toString(!0));if(!f.repeated)throw Error(this+\"#\"+b+\" is not a repeated field\");d=f.verifyValue(d,!0);}return null===this[b]&&(this[b]=[]),this[b].push(d),this},h.$add=h.add,h.set=function(b,d,e){var f,g,h;if(b&&\"object\"==typeof b){e=d;for(f in b)b.hasOwnProperty(f)&&\"undefined\"!=typeof(d=b[f])&&this.$set(f,d,e);return this}if(g=c._fieldsByName[b],e)this[b]=d;else{if(!g)throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(g instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+g.toString(!0));this[g.name]=d=g.verifyValue(d);}return g&&g.oneof&&(h=this[g.oneof.name],null!==d?(null!==h&&h!==g.name&&(this[h]=null),this[g.oneof.name]=g.name):h===b&&(this[g.oneof.name]=null)),this},h.$set=h.set,h.get=function(b,d){if(d)return this[b];var e=c._fieldsByName[b];if(!(e&&e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+e.toString(!0));return this[e.name]},h.$get=h.get,i=0;i<d.length;i++)j=d[i],j instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var d,e,f,b=a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace(\"_\",\"\")});b=b.substring(0,1).toUpperCase()+b.substring(1),d=a.originalName.replace(/([A-Z])/g,function(a){return \"_\"+a}),e=function(b,c){return this[a.name]=c?b:a.verifyValue(b),this},f=function(){return this[a.name]},null===c.getChild(\"set\"+b)&&(h[\"set\"+b]=e),null===c.getChild(\"set_\"+d)&&(h[\"set_\"+d]=e),null===c.getChild(\"get\"+b)&&(h[\"get\"+b]=f),null===c.getChild(\"get_\"+d)&&(h[\"get_\"+d]=f);}(j);return h.encode=function(a,d){var e,f;\"boolean\"==typeof a&&(d=a,a=void 0),e=!1,a||(a=new b,e=!0),f=a.littleEndian;try{return c.encode(this,a.LE(),d),(e?a.flip():a).LE(f)}catch(g){throw a.LE(f),g}},g.encode=function(a,b,c){return new g(a).encode(b,c)},h.calculate=function(){return c.calculate(this)},h.encodeDelimited=function(a){var d,b=!1;return a||(a=new f,b=!0),d=(new f).LE(),c.encode(this,d).flip(),a.writeVarint32(d.remaining()),a.append(d),b?a.flip():a},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toArrayBuffer()),a}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a}},h.toHex=h.encodeHex,h.toRaw=function(a,b){return k(this,!!a,!!b,this.$type)},h.encodeJSON=function(){return JSON.stringify(k(this,!0,!0,this.$type))},g.decode=function(a,b){var d,e;\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),d=a.littleEndian;try{return e=c.decode(a.LE()),a.LE(d),e}catch(g){throw a.LE(d),g}},g.decodeDelimited=function(a,b){var d,e,g;if(\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),a.remaining()<1)return null;if(d=a.offset,e=a.readVarint32(),a.remaining()<e)return a.offset=d,null;try{return g=c.decode(a.slice(a.offset,a.offset+e).LE()),a.offset+=e,g}catch(h){throw a.offset+=e,h}},g.decode64=function(a){return g.decode(a,\"base64\")},g.decodeHex=function(a){return g.decode(a,\"hex\")},g.decodeJSON=function(a){return new g(JSON.parse(a))},h.toString=function(){return c.toString()},Object.defineProperty&&(Object.defineProperty(g,\"$options\",{value:c.buildOpt()}),Object.defineProperty(h,\"$options\",{value:g[\"$options\"]}),Object.defineProperty(g,\"$type\",{value:c}),Object.defineProperty(h,\"$type\",{value:c})),g}(a,this),this._fields=[],this._fieldsById={},this._fieldsByName={},e=0,g=this.children.length;g>e;e++)if(h=this.children[e],h instanceof t||h instanceof m||h instanceof x){if(d.hasOwnProperty(h.name))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+h.toString(!0)+\" cannot override static property '\"+h.name+\"'\");d[h.name]=h.build();}else if(h instanceof m.Field)h.build(),this._fields.push(h),this._fieldsById[h.id]=h,this._fieldsByName[h.name]=h;else if(!(h instanceof m.OneOf||h instanceof w))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+this.children[e].toString(!0));return this.clazz=d},n.encode=function(a,b,c){var e,h,f,g,i,d=null;for(f=0,g=this._fields.length;g>f;++f)e=this._fields[f],h=a[e.name],e.required&&null===h?null===d&&(d=e):e.encode(c?h:e.verifyValue(h),b,a);if(null!==d)throw i=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+d),i.encoded=b,i;return b},n.calculate=function(a){for(var e,f,b=0,c=0,d=this._fields.length;d>c;++c){if(e=this._fields[c],f=a[e.name],e.required&&null===f)throw Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+e);b+=e.calculate(f,a);}return b},n.decode=function(b,c,d){var g,h,i,j,e,f,k,l,m,n,p,q;for(c=\"number\"==typeof c?c:-1,e=b.offset,f=new this.clazz;b.offset<e+c||-1===c&&b.remaining()>0;){if(g=b.readVarint32(),h=7&g,i=g>>>3,h===a.WIRE_TYPES.ENDGROUP){if(i!==d)throw Error(\"Illegal group end indicator for \"+this.toString(!0)+\": \"+i+\" (\"+(d?d+\" expected\":\"not a group\")+\")\");break}if(j=this._fieldsById[i])j.repeated&&!j.options.packed?f[j.name].push(j.decode(h,b)):j.map?(l=j.decode(h,b),f[j.name].set(l[0],l[1])):(f[j.name]=j.decode(h,b),j.oneof&&(m=f[j.oneof.name],null!==m&&m!==j.name&&(f[m]=null),f[j.oneof.name]=j.name));else switch(h){case a.WIRE_TYPES.VARINT:b.readVarint32();break;case a.WIRE_TYPES.BITS32:b.offset+=4;break;case a.WIRE_TYPES.BITS64:b.offset+=8;break;case a.WIRE_TYPES.LDELIM:k=b.readVarint32(),b.offset+=k;break;case a.WIRE_TYPES.STARTGROUP:for(;o(i,b););break;default:throw Error(\"Illegal wire type for unknown field \"+i+\" in \"+this.toString(!0)+\"#decode: \"+h)}}for(n=0,p=this._fields.length;p>n;++n)if(j=this._fields[n],null===f[j.name])if(\"proto3\"===this.syntax)f[j.name]=j.defaultValue;else{if(j.required)throw q=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+j.name),q.decoded=f,q;a.populateDefaults&&null!==j.defaultValue&&(f[j.name]=j.defaultValue);}return f},c.Message=m,p=function(b,c,e,f,g,h,i,j,k,l){d.call(this,b,c,h),this.className=\"Message.Field\",this.required=\"required\"===e,this.repeated=\"repeated\"===e,this.map=\"map\"===e,this.keyType=f||null,this.type=g,this.resolvedType=null,this.id=i,this.options=j||{},this.defaultValue=null,this.oneof=k||null,this.syntax=l||\"proto2\",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof m.ExtensionField||(this.name=a.Util.toCamelCase(this.name));},q=p.prototype=Object.create(d.prototype),q.build=function(){this.element=new i(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new i(this.keyType,void 0,!0,this.syntax)),\"proto3\"!==this.syntax||this.repeated||this.map?\"undefined\"!=typeof this.options[\"default\"]&&(this.defaultValue=this.verifyValue(this.options[\"default\"])):this.defaultValue=i.defaultFieldValue(this.type);},q.verifyValue=function(b,c){var d,e,f;if(c=c||!1,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this),null===b)return this.required&&d(typeof b,\"required\"),\"proto3\"===this.syntax&&this.type!==a.TYPES.message&&d(typeof b,\"proto3 field without field presence cannot be null\"),null;if(this.repeated&&!c){for(Array.isArray(b)||(b=[b]),f=[],e=0;e<b.length;e++)f.push(this.element.verifyValue(b[e]));return f}return this.map&&!c?b instanceof a.Map?b:(b instanceof Object||d(typeof b,\"expected ProtoBuf.Map or raw object for map field\"),new a.Map(this,b)):(!this.repeated&&Array.isArray(b)&&d(typeof b,\"no array expected\"),this.element.verifyValue(b))},q.hasWirePresence=function(b,c){if(\"proto3\"!==this.syntax)return null!==b;if(this.oneof&&c[this.oneof.name]===this.name)return !0;switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return 0!==b;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return 0!==b.low||0!==b.high;case a.TYPES.bool:return b;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return 0!==b;case a.TYPES.string:return b.length>0;case a.TYPES.bytes:return b.remaining()>0;case a.TYPES[\"enum\"]:return 0!==b;case a.TYPES.message:return null!==b;default:return !0}},q.encode=function(b,c,d){var e,g,h,i,j;if(null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return c;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.ensureCapacity(c.offset+=1),g=c.offset,e=0;e<b.length;e++)this.element.encodeValue(this.id,b[e],c);h=c.offset-g,i=f.calculateVarint32(h),i>1&&(j=c.slice(g,c.offset),g+=i-1,c.offset=g,c.append(j)),c.writeVarint32(h,g-i);}else for(e=0;e<b.length;e++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[e],c);else this.map?b.forEach(function(b,d){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.writeVarint32(g),c.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,d,c),c.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,b,c);},this):this.hasWirePresence(b,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,c));}catch(k){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+k+\")\")}return c},q.calculate=function(b,c){var d,e,g;if(b=this.verifyValue(b),null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return 0;d=0;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),g=0,e=0;e<b.length;e++)g+=this.element.calculateLength(this.id,b[e]);d+=f.calculateVarint32(g),d+=g;}else for(e=0;e<b.length;e++)d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b[e]);else this.map?b.forEach(function(b,c){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),d+=f.calculateVarint32(g),d+=g;},this):this.hasWirePresence(b,c)&&(d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b));}catch(h){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+h+\")\")}return d},q.decode=function(b,c,d){var e,f,h,j,k,l,m,g=!this.map&&b==this.type.wireType||!d&&this.repeated&&this.options.packed&&b==a.WIRE_TYPES.LDELIM||this.map&&b==a.WIRE_TYPES.LDELIM;if(!g)throw Error(\"Illegal wire type for field \"+this.toString(!0)+\": \"+b+\" (\"+this.type.wireType+\" expected)\");if(b==a.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!d){for(f=c.readVarint32(),f=c.offset+f,h=[];c.offset<f;)h.push(this.decode(this.type.wireType,c,!0));return h}if(this.map){if(j=i.defaultFieldValue(this.keyType),e=i.defaultFieldValue(this.type),f=c.readVarint32(),c.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+c.remaining());for(k=c.clone(),k.limit=k.offset+f,c.offset+=f;k.remaining()>0;)if(l=k.readVarint32(),b=7&l,m=l>>>3,1===m)j=this.keyElement.decode(k,b,m);else{if(2!==m)throw Error(\"Unexpected tag in map field key/value submessage\");e=this.element.decode(k,b,m);}return [j,e]}return this.element.decode(c,b,this.id)},c.Message.Field=p,r=function(a,b,c,d,e,f,g){p.call(this,a,b,c,null,d,e,f,g),this.extension;},r.prototype=Object.create(p.prototype),c.Message.ExtensionField=r,s=function(a,b,c){d.call(this,a,b,c),this.fields=[];},c.Message.OneOf=s,t=function(a,b,c,d,e){g.call(this,a,b,c,d,e),this.className=\"Enum\",this.object=null;},t.getName=function(a,b){var e,d,c=Object.keys(a);for(d=0;d<c.length;++d)if(a[e=c[d]]===b)return e;return null},u=t.prototype=Object.create(g.prototype),u.build=function(b){var c,d,e,f;if(this.object&&!b)return this.object;for(c=new a.Builder.Enum,d=this.getChildren(t.Value),e=0,f=d.length;f>e;++e)c[d[e][\"name\"]]=d[e][\"id\"];return Object.defineProperty&&Object.defineProperty(c,\"$options\",{value:this.buildOpt(),enumerable:!1}),this.object=c},c.Enum=t,v=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Enum.Value\",this.id=e;},v.prototype=Object.create(d.prototype),c.Enum.Value=v,w=function(a,b,c,e){d.call(this,a,b,c),this.field=e;},w.prototype=Object.create(d.prototype),c.Extension=w,x=function(a,b,c,d){g.call(this,a,b,c,d),this.className=\"Service\",this.clazz=null;},y=x.prototype=Object.create(g.prototype),y.build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(a,b){var g,c=function(b){a.Builder.Service.call(this),this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0);};},d=c.prototype=Object.create(a.Builder.Service.prototype),e=b.getChildren(a.Reflect.Service.RPCMethod);for(g=0;g<e.length;g++)!function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(f.wrap(c));}catch(e){if(!(e instanceof TypeError))throw e}if(null===c||\"object\"!=typeof c)throw Error(\"Illegal arguments\");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c)),this.rpcImpl(a.fqn(),c,function(c,e){if(c)return d(c),void 0;try{e=a.resolvedResponseType.clazz.decode(e);}catch(f){}return e&&e instanceof a.resolvedResponseType.clazz?(d(null,e),void 0):(d(Error(\"Illegal response type received in service method \"+b.name+\"#\"+a.name)),void 0)});}catch(e){setTimeout(d.bind(this,e),0);}},c[a.name]=function(b,d,e){new c(b)[a.name](d,e);},Object.defineProperty&&(Object.defineProperty(c[a.name],\"$options\",{value:a.buildOpt()}),Object.defineProperty(d[a.name],\"$options\",{value:c[a.name][\"$options\"]}));}(e[g]);return Object.defineProperty&&(Object.defineProperty(c,\"$options\",{value:b.buildOpt()}),Object.defineProperty(d,\"$options\",{value:c[\"$options\"]}),Object.defineProperty(c,\"$type\",{value:b}),Object.defineProperty(d,\"$type\",{value:b})),c}(a,this)},c.Service=x,z=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Service.Method\",this.options=e||{};},A=z.prototype=Object.create(d.prototype),A.buildOpt=h.buildOpt,c.Service.Method=z,B=function(a,b,c,d,e,f,g,h){z.call(this,a,b,c,h),this.className=\"Service.RPCMethod\",this.requestName=d,this.responseName=e,this.requestStream=f,this.responseStream=g,this.resolvedRequestType=null,this.resolvedResponseType=null;},B.prototype=Object.create(z.prototype),c.Service.RPCMethod=B,c}(e),e.Builder=function(a,b,c){function f(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax,f(b);}),a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax;});}var d=function(a){this.ns=new c.Namespace(this,null,\"\"),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=a||{};},e=d.prototype;return d.isMessage=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values||\"undefined\"!=typeof a.rpc?!1:!0},d.isMessageField=function(a){return \"string\"!=typeof a.rule||\"string\"!=typeof a.name||\"string\"!=typeof a.type||\"undefined\"==typeof a.id?!1:!0},d.isEnum=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1},d.isService=function(a){return \"string\"==typeof a.name&&\"object\"==typeof a.rpc&&a.rpc?!0:!1},d.isExtend=function(a){return \"string\"!=typeof a.ref?!1:!0},e.reset=function(){return this.ptr=this.ns,this},e.define=function(a){if(\"string\"!=typeof a||!b.TYPEREF.test(a))throw Error(\"illegal namespace: \"+a);return a.split(\".\").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new c.Namespace(this,this.ptr,a)),this.ptr=b;},this),this},e.create=function(b){var e,f,g,h,i;if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice();}else b=[b];for(e=[b];e.length>0;){if(b=e.pop(),!Array.isArray(b))throw Error(\"not a valid namespace: \"+JSON.stringify(b));for(;b.length>0;){if(f=b.shift(),d.isMessage(f)){if(g=new c.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),h={},f.oneofs&&Object.keys(f.oneofs).forEach(function(a){g.addChild(h[a]=new c.Message.OneOf(this,g,a));},this),f.fields&&f.fields.forEach(function(a){if(null!==g.getChild(0|a.id))throw Error(\"duplicate or invalid field id in \"+g.name+\": \"+a.id);if(a.options&&\"object\"!=typeof a.options)throw Error(\"illegal field options in \"+g.name+\"#\"+a.name);var b=null;if(\"string\"==typeof a.oneof&&!(b=h[a.oneof]))throw Error(\"illegal oneof in \"+g.name+\"#\"+a.name+\": \"+a.oneof);a=new c.Message.Field(this,g,a.rule,a.keytype,a.type,a.name,a.id,a.options,b,f.syntax),b&&b.fields.push(a),g.addChild(a);},this),i=[],f.enums&&f.enums.forEach(function(a){i.push(a);}),f.messages&&f.messages.forEach(function(a){i.push(a);}),f.services&&f.services.forEach(function(a){i.push(a);}),f.extensions&&(g.extensions=\"number\"==typeof f.extensions[0]?[f.extensions]:f.extensions),this.ptr.addChild(g),i.length>0){e.push(b),b=i,i=null,this.ptr=g,g=null;continue}i=null;}else if(d.isEnum(f))g=new c.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(a){g.addChild(new c.Enum.Value(this,g,a.name,a.id));},this),this.ptr.addChild(g);else if(d.isService(f))g=new c.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(a){var b=f.rpc[a];g.addChild(new c.Service.RPCMethod(this,g,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options));},this),this.ptr.addChild(g);else{if(!d.isExtend(f))throw Error(\"not a valid definition: \"+JSON.stringify(f));if(g=this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){var d,e,f,h;if(null!==g.getChild(0|b.id))throw Error(\"duplicate extended field id in \"+g.name+\": \"+b.id);\n  if(g.extensions&&(d=!1,g.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(d=!0);}),!d))throw Error(\"illegal extended field id in \"+g.name+\": \"+b.id+\" (not within valid ranges)\");e=b.name,this.options.convertFieldsToCamelCase&&(e=a.Util.toCamelCase(e)),f=new c.Message.ExtensionField(this,g,b.rule,b.type,this.ptr.fqn()+\".\"+e,b.id,b.options),h=new c.Extension(this,this.ptr,b.name,f),f.extension=h,this.ptr.addChild(h),g.addChild(f);},this);else if(!/\\.?google\\.protobuf\\./.test(f.ref))throw Error(\"extended message \"+f.ref+\" is not defined\")}f=null,g=null;}b=null,this.ptr=this.ptr.parent;}return this.resolved=!1,this.result=null,this},e[\"import\"]=function(b,c){var e,g,h,i,j,k,l,m,d=\"/\";if(\"string\"==typeof c){if(a.Util.IS_NODE,this.files[c]===!0)return this.reset();this.files[c]=!0;}else if(\"object\"==typeof c){if(e=c.root,a.Util.IS_NODE,(e.indexOf(\"\\\\\")>=0||c.file.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\"),g=e+d+c.file,this.files[g]===!0)return this.reset();this.files[g]=!0;}if(b.imports&&b.imports.length>0){for(i=!1,\"object\"==typeof c?(this.importRoot=c.root,i=!0,h=this.importRoot,c=c.file,(h.indexOf(\"\\\\\")>=0||c.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\")):\"string\"==typeof c?this.importRoot?h=this.importRoot:c.indexOf(\"/\")>=0?(h=c.replace(/\\/[^\\/]*$/,\"\"),\"\"===h&&(h=\"/\")):c.indexOf(\"\\\\\")>=0?(h=c.replace(/\\\\[^\\\\]*$/,\"\"),d=\"\\\\\"):h=\".\":h=null,j=0;j<b.imports.length;j++)if(\"string\"==typeof b.imports[j]){if(!h)throw Error(\"cannot determine import root\");if(k=b.imports[j],\"google/protobuf/descriptor.proto\"===k)continue;if(k=h+d+k,this.files[k]===!0)continue;if(/\\.proto$/i.test(k)&&!a.DotProto&&(k=k.replace(/\\.proto$/,\".json\")),l=a.Util.fetch(k),null===l)throw Error(\"failed to import '\"+k+\"' in '\"+c+\"': file not found\");/\\.json$/i.test(k)?this[\"import\"](JSON.parse(l+\"\"),k):this[\"import\"](a.DotProto.Parser.parse(l),k);}else c?/\\.(\\w+)$/.test(c)?this[\"import\"](b.imports[j],c.replace(/^(.+)\\.(\\w+)$/,function(a,b,c){return b+\"_import\"+j+\".\"+c})):this[\"import\"](b.imports[j],c+\"_import\"+j):this[\"import\"](b.imports[j]);i&&(this.importRoot=null);}return b[\"package\"]&&this.define(b[\"package\"]),b.syntax&&f(b),m=this.ptr,b.options&&Object.keys(b.options).forEach(function(a){m.options[a]=b.options[a];}),b.messages&&(this.create(b.messages),this.ptr=m),b.enums&&(this.create(b.enums),this.ptr=m),b.services&&(this.create(b.services),this.ptr=m),b[\"extends\"]&&this.create(b[\"extends\"]),this.reset()},e.resolveAll=function(){var d;if(null==this.ptr||\"object\"==typeof this.ptr.type)return this;if(this.ptr instanceof c.Namespace)this.ptr.children.forEach(function(a){this.ptr=a,this.resolveAll();},this);else if(this.ptr instanceof c.Message.Field){if(b.TYPE.test(this.ptr.type))this.ptr.type=a.TYPES[this.ptr.type];else{if(!b.TYPEREF.test(this.ptr.type))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(d=(this.ptr instanceof c.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!d)throw Error(\"unresolvable type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(this.ptr.resolvedType=d,d instanceof c.Enum){if(this.ptr.type=a.TYPES[\"enum\"],\"proto3\"===this.ptr.syntax&&\"proto3\"!==d.syntax)throw Error(\"proto3 message cannot reference proto2 enum\")}else{if(!(d instanceof c.Message))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);this.ptr.type=d.isGroup?a.TYPES.group:a.TYPES.message;}}if(this.ptr.map){if(!b.TYPE.test(this.ptr.keyType))throw Error(\"illegal key type for map field in \"+this.ptr.toString(!0)+\": \"+this.ptr.keyType);this.ptr.keyType=a.TYPES[this.ptr.keyType];}}else if(this.ptr instanceof a.Reflect.Service.Method){if(!(this.ptr instanceof a.Reflect.Service.RPCMethod))throw Error(\"illegal service type in \"+this.ptr.toString(!0));if(d=this.ptr.parent.resolve(this.ptr.requestName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.requestName);if(this.ptr.resolvedRequestType=d,d=this.ptr.parent.resolve(this.ptr.responseName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.responseName);this.ptr.resolvedResponseType=d;}else if(!(this.ptr instanceof a.Reflect.Message.OneOf||this.ptr instanceof a.Reflect.Extension||this.ptr instanceof a.Reflect.Enum.Value))throw Error(\"illegal object in namespace: \"+typeof this.ptr+\": \"+this.ptr);return this.reset()},e.build=function(a){var b,c,d;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!a)return this.result;for(b=\"string\"==typeof a?a.split(\".\"):a,c=this.result,d=0;d<b.length;d++){if(!c[b[d]]){c=null;break}c=c[b[d]];}return c},e.lookup=function(a,b){return a?this.ns.resolve(a,b):this.ns},e.toString=function(){return \"Builder\"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(e,e.Lang,e.Reflect),e.Map=function(a,b){function e(a){var b=0;return {next:function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}}var c=function(a,c){var d,e,f,g;if(!a.map)throw Error(\"field is not a map\");if(this.field=a,this.keyElem=new b.Element(a.keyType,null,!0,a.syntax),this.valueElem=new b.Element(a.type,a.resolvedType,!1,a.syntax),this.map={},Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}}),c)for(d=Object.keys(c),e=0;e<d.length;e++)f=this.keyElem.valueFromString(d[e]),g=this.valueElem.verifyValue(c[d[e]]),this.map[this.keyElem.valueToString(f)]={key:f,value:g};},d=c.prototype;return d.clear=function(){this.map={};},d[\"delete\"]=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a)),c=b in this.map;return delete this.map[b],c},d.entries=function(){var d,c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push([(d=this.map[b[c]]).key,d.value]);return e(a)},d.keys=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].key);return e(a)},d.values=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].value);return e(a)},d.forEach=function(a,b){var e,d,c=Object.keys(this.map);for(d=0;d<c.length;d++)a.call(b,(e=this.map[c[d]]).value,e.key,this);},d.set=function(a,b){var c=this.keyElem.verifyValue(a),d=this.valueElem.verifyValue(b);return this.map[this.keyElem.valueToString(c)]={key:c,value:d},this},d.get=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map?this.map[b].value:void 0},d.has=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map},c}(e,e.Reflect),e.loadProto=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=void 0),e.loadJson(e.DotProto.Parser.parse(a),b,c)},e.protoFromString=e.loadProto,e.loadProtoFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadProto(d,c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadProto(d,c,a)},e.protoFromFile=e.loadProtoFile,e.newBuilder=function(a){return a=a||{},\"undefined\"==typeof a.convertFieldsToCamelCase&&(a.convertFieldsToCamelCase=e.convertFieldsToCamelCase),\"undefined\"==typeof a.populateAccessors&&(a.populateAccessors=e.populateAccessors),new e.Builder(a)},e.loadJson=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=null),b&&\"object\"==typeof b||(b=e.newBuilder()),\"string\"==typeof a&&(a=JSON.parse(a)),b[\"import\"](a,c),b.resolveAll(),b},e.loadJsonFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadJson(JSON.parse(d),c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadJson(JSON.parse(d),c,a)},h=a,i=e.loadProto(h,void 0,\"\").build(\"Modules\").probuf}(d,c,b);return e}\n\n  var SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message SetUserStatusInput\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \" + PBName.NotifyMsg + \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SyncRequestMsg + \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \" + PBName.UpStreamMessage + \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n  }\\n  message \" + PBName.DownStreamMessages + \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \" + PBName.DownStreamMessage + \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = 1;\\n    audio = 2;\\n    video = 3;\\n    file = 4;\\n  }\\n  message GetQNupTokenInput {\\n    required FileType type = 1;\\n  }\\n  message GetQNdownloadUrlInput {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message GetQNupTokenOutput {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n  }\\n  message GetQNdownloadUrlOutput {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \" + PBName.ChrmInput + \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.ChrmPullMsg + \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.RelationQryInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \" + PBName.RelationsInput + \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \" + PBName.RelationsOutput + \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \" + PBName.CleanHisMsgInput + \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \" + PBName.QueryChatRoomInfoInput + \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \" + PBName.QueryChatRoomInfoOutput + \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MCFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \" + PBName.HistoryMsgInput + \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \" + PBName.HistoryMsgOuput + \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message RtcQueryListInput{\\n    optional int32 order=1;\\n  }\\n\\n  message RtcKeyDeleteInput{\\n    repeated string key=1;\\n  }\\n\\n  message RtcValueInfo{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated RtcValueInfo userData=2;\\n  }\\n\\n  message RtcUserListOutput{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated RtcValueInfo roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message RtcInput{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message RtcQryOutput{\\n    repeated RtcValueInfo outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message RtcDataInput{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message RtcSetDataInput{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message RtcTokenOutput{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message RtcSetOutDataInput{\\n    required targetType target=1;\\n    repeated RtcValueInfo valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message RtcQryUserOutDataInput{\\n    repeated string userId = 1;\\n  }\\n  message RtcUserOutDataOutput{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \" + PBName.SessionsAttQryInput + \"{\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.SessionsAttOutput + \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \" + PBName.SessionMsgReadInput + \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteSessionsInput + \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \" + PBName.SessionInfo + \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \" + PBName.DeleteSessionsOutput + \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteMsgInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n\\n}\\n\";\n\n  var Codec$1 = {};\n\n  try {\n    Codec$1 = protobuf(SSMsg$1);\n  } catch (e) {\n    Codec$1 = {};\n  }\n\n  Codec$1.getModule = function (pbName) {\n    var modules = new Codec$1[pbName]();\n\n    modules.getArrayData = function () {\n      var data = modules.toArrayBuffer();\n      data = utils.ArrayBufferToArray(data);\n      return data;\n    };\n\n    return modules;\n  };\n\n  var SocketCodec = Codec$1;\n\n  var isGroup$1 = common.isGroup,\n      isChatRoom$1 = common.isChatRoom;\n\n  var formatMessageContent = function formatMessageContent(content) {\n    var _content = content,\n        offset = _content.offset,\n        buffer = _content.buffer,\n        limit = _content.limit;\n\n    if (offset) {\n      content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit);\n      content = BinaryHelper.readUTF(content);\n    }\n\n    content = utils.parseJSON(content);\n    return content;\n  };\n\n  var formatSentMessage = function formatSentMessage(data, option) {\n    var content = data.content,\n        classname = data.classname,\n        sessionId = data.sessionId;\n    var signal = option.signal,\n        currentUserId = option.currentUserId;\n\n    var _common$getPersitedAn = common.getPersitedAndCountedBySessionId(sessionId),\n        isPersited = _common$getPersitedAn.isPersited,\n        isCounted = _common$getPersitedAn.isCounted;\n\n    var date = signal.date,\n        topic = signal.topic,\n        targetId = signal.targetId;\n    var type = PUBLISH_TOPIC_TO_CONVERSATION_TYPE[topic] || CONVERSATION_TYPE.PRIVATE;\n    return {\n      type: type,\n      targetId: targetId,\n      isPersited: isPersited,\n      isCounted: isCounted,\n      content: formatMessageContent(content),\n      senderUserId: currentUserId,\n      sentTime: utils.secondsToMilliseconds(date),\n      objectName: classname,\n      messageUId: data.msgId,\n      direction: MESSAGE_DIRECTION.SEND,\n      isOffLineMessage: false\n    };\n  };\n\n  var formatReceivedMessage = function formatReceivedMessage(data, option) {\n    var currentUserId = option.currentUserId,\n        connectedTime = option.connectedTime;\n    var content = data.content,\n        fromUserId = data.fromUserId,\n        type = data.type,\n        groupId = data.groupId,\n        direction = data.direction,\n        status = data.status,\n        dataTime = data.dataTime;\n    direction = direction || MESSAGE_DIRECTION.RECEIVE;\n    var isSelfSend = direction === MESSAGE_DIRECTION.SEND;\n\n    var _common$getMessageOpt = common.getMessageOptionByStatus(status),\n        isPersited = _common$getMessageOpt.isPersited,\n        isCounted = _common$getMessageOpt.isCounted,\n        isMentiond = _common$getMessageOpt.isMentiond;\n\n    var targetId = isGroup$1(type) || isChatRoom$1(type) ? groupId : fromUserId;\n    var senderUserId = isSelfSend ? currentUserId : fromUserId;\n    var sentTime = utils.int64ToTimestamp(dataTime);\n    var isOffLineMessage = sentTime < connectedTime;\n    direction = isSelfSend ? MESSAGE_DIRECTION.SEND : MESSAGE_DIRECTION.RECEIVE;\n    return {\n      type: type,\n      targetId: targetId,\n      direction: direction,\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond,\n      sentTime: sentTime,\n      isOffLineMessage: isOffLineMessage,\n      content: formatMessageContent(content),\n      senderUserId: senderUserId,\n      objectName: data.classname,\n      messageUId: data.msgId\n    };\n  };\n  var formatSyncMessages = function formatSyncMessages(data, option) {\n    option = option || {};\n    var onMessage = option.onMessage || utils.noop;\n    var list = data.list,\n        syncTime = data.syncTime,\n        finished = data.finished;\n    data.syncTime = utils.int64ToTimestamp(syncTime);\n    data.list = utils.map(list, function (msgData, index) {\n      var msg = formatReceivedMessage(msgData, option);\n      var isLastInAPull = utils.isEqual(index, list.length - 1);\n      var isFinished = isLastInAPull && finished;\n      onMessage({\n        isLastInAPull: isLastInAPull,\n        message: msg,\n        finished: isFinished\n      });\n      return msg;\n    });\n    return data;\n  };\n  var formatHistoryMessages = function formatHistoryMessages(data, option) {\n    var conversation = option.conversation || {};\n    var msgList = data.list,\n        syncTime = data.syncTime,\n        hasMsg = data.hasMsg;\n    var targetId = conversation.targetId;\n    syncTime = utils.int64ToTimestamp(syncTime);\n    var list = [];\n    utils.forEach(msgList, function (msgData) {\n      var msg = formatReceivedMessage(msgData, option);\n      msg.targetId = targetId;\n      list.push(msg);\n    }, {\n      isReverse: true\n    });\n    return {\n      syncTime: syncTime,\n      list: list,\n      hasMore: !!hasMsg\n    };\n  };\n  var formatConversationList = function formatConversationList(serverData, option) {\n    var conversationList = serverData.info;\n    var afterDecode = option.afterDecode || utils.noop;\n    conversationList = utils.map(conversationList, function (serverConversation) {\n      var msg = serverConversation.msg,\n          userId = serverConversation.userId,\n          type = serverConversation.type,\n          unreadCount = serverConversation.unreadCount;\n      msg = formatReceivedMessage(msg, option);\n      msg.targetId = userId;\n      var conversation = {\n        targetId: userId,\n        type: type,\n        unreadMessageCount: unreadCount,\n        latestMessage: msg\n      };\n      return afterDecode(conversation) || conversation;\n    });\n    return conversationList;\n  };\n  var formatChatRoomInfos = function formatChatRoomInfos(data) {\n    var userTotalNums = data.userTotalNums,\n        userInfos = data.userInfos;\n    userInfos = utils.map(userInfos, function (user) {\n      var id = user.id,\n          time = user.time;\n      time = utils.int64ToTimestamp(time);\n      return {\n        id: id,\n        time: time\n      };\n    });\n    return {\n      userCount: userTotalNums,\n      userInfos: userInfos\n    };\n  };\n  var formatServerConfig = function formatServerConfig(data) {\n    return utils.batchInt64ToTimestamp(data);\n  };\n  var formatNotifyPullConfig = function formatNotifyPullConfig(data) {\n    return utils.batchInt64ToTimestamp(data);\n  };\n\n  var Codec$2 = function () {\n    function Codec$$1(option) {\n      this.codec = SocketCodec;\n      option = option || {};\n      var type = option.connectType;\n      type && this.setCodecType(type);\n    }\n\n    var _proto = Codec$$1.prototype;\n\n    _proto.setCodecType = function setCodecType(type) {\n      this.codec = type === CONNECT_TYPE.COMET ? Codec : SocketCodec;\n    };\n\n    _proto.decodeByPBName = function decodeByPBName(data, pbName, option) {\n      var _PBName$SessionsAttOu;\n\n      var decodeEvent = (_PBName$SessionsAttOu = {}, _PBName$SessionsAttOu[PBName.SessionsAttOutput] = this.decodeServerConf, _PBName$SessionsAttOu[PBName.DownStreamMessages] = this.decodeSyncMessages, _PBName$SessionsAttOu[PBName.DownStreamMessage] = this.decodeReceiveMessage, _PBName$SessionsAttOu[PBName.UpStreamMessage] = this.decodeSentMessage, _PBName$SessionsAttOu[PBName.NotifyMsg] = this.decodeNotifyPullConfig, _PBName$SessionsAttOu[PBName.HistoryMsgOuput] = this.decodeHistoryMessages, _PBName$SessionsAttOu[PBName.RelationsOutput] = this.decodeConversationList, _PBName$SessionsAttOu[PBName.QueryChatRoomInfoOutput] = this.decodeChatRoomInfos, _PBName$SessionsAttOu)[pbName] || utils.noop;\n      return decodeEvent.call(this, data, option);\n    };\n\n    _proto.decodeServerConf = function decodeServerConf(data) {\n      var serverConfig = this.codec[PBName.SessionsAttOutput].decode(data);\n      return formatServerConfig(serverConfig);\n    };\n\n    _proto.decodeNotifyPullConfig = function decodeNotifyPullConfig(data) {\n      var notifyPullConfig = this.codec[PBName.NotifyMsg].decode(data);\n      return formatNotifyPullConfig(notifyPullConfig);\n    };\n\n    _proto.decodeSentMessage = function decodeSentMessage(data, option) {\n      var upMsg = this.codec[PBName.UpStreamMessage].decode(data);\n      return formatSentMessage(upMsg, option);\n    };\n\n    _proto.decodeReceiveMessage = function decodeReceiveMessage(data, option) {\n      var serverMsg = this.codec[PBName.DownStreamMessage].decode(data);\n      return formatReceivedMessage(serverMsg, option);\n    };\n\n    _proto.decodeSyncMessages = function decodeSyncMessages(data, option) {\n      var syncMsgInfo = this.codec[PBName.DownStreamMessages].decode(data);\n      return formatSyncMessages(syncMsgInfo, option);\n    };\n\n    _proto.decodeHistoryMessages = function decodeHistoryMessages(data, option) {\n      var historyInfo = this.codec[PBName.HistoryMsgOuput].decode(data);\n      return formatHistoryMessages(historyInfo, option);\n    };\n\n    _proto.decodeConversationList = function decodeConversationList(data, option) {\n      var serverData = this.codec[PBName.RelationsOutput].decode(data);\n      return formatConversationList(serverData, option);\n    };\n\n    _proto.decodeChatRoomInfos = function decodeChatRoomInfos(data) {\n      var chrmInfos = this.codec[PBName.QueryChatRoomInfoOutput].decode(data);\n      return formatChatRoomInfos(chrmInfos);\n    };\n\n    _proto.encodeServerConfParams = function encodeServerConfParams() {\n      var modules = this.codec.getModule(PBName.SessionsAttQryInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeUpMsg = function encodeUpMsg(conversation, option) {\n      var type = conversation.type;\n      var objectName = option.objectName,\n          isMentiond = option.isMentiond,\n          mentiondType = option.mentiondType,\n          mentiondUserIdList = option.mentiondUserIdList,\n          content = option.content,\n          pushContent = option.pushContent,\n          pushData = option.pushData,\n          orientationIds = option.orientationIds,\n          isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n          isVoipPush = option.isVoipPush;\n      var isGroupType = common.isGroup(type);\n      var flag = 0;\n      var modules = this.codec.getModule(PBName.UpStreamMessage);\n      var sessionId = common.getSessionId(option);\n      modules.setSessionId(sessionId);\n\n      if (isGroupType && isMentiond && content) {\n        content.mentionedInfo = {\n          userIdList: mentiondUserIdList,\n          type: mentiondType || MENTIOND_TYPE.ALL\n        };\n      }\n\n      pushContent && modules.setPushText(pushContent);\n      pushData && modules.setAppData(pushData);\n      orientationIds && modules.setUserId(orientationIds);\n      flag |= isVoipPush ? 0x01 : 0;\n      flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n      modules.setConfigFlag(flag);\n      modules.setClassname(objectName);\n      modules.setContent(utils.toJSON(content));\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSyncMsg = function encodeSyncMsg(syncMsgArgs) {\n      var sendboxTime = syncMsgArgs.sendboxTime,\n          inboxTime = syncMsgArgs.inboxTime;\n      var modules = this.codec.getModule(PBName.SyncRequestMsg);\n      modules.setIspolling(false);\n      modules.setIsPullSend(true);\n      modules.setSendBoxSyncTime(sendboxTime);\n      modules.setSyncTime(inboxTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeChrmSyncMsg = function encodeChrmSyncMsg(time, count) {\n      time = time || 0;\n      count = count || 0;\n      var modules = this.codec.getModule(PBName.ChrmPullMsg);\n      modules.setCount(count);\n      modules.setSyncTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetHistoryMsg = function encodeGetHistoryMsg(conversation, option) {\n      var targetId = conversation.targetId;\n      var count = option.count,\n          order = option.order,\n          timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.HistoryMsgInput);\n      modules.setTargetId(targetId);\n      modules.setTime(timestrap);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationList = function encodeGetConversationList(option) {\n      option = option || {};\n      var _option = option,\n          count = _option.count,\n          startTime = _option.startTime;\n      var modules = this.codec.getModule(PBName.RelationQryInput);\n      modules.setType(1);\n      modules.setCount(count);\n      modules.setStartTime(startTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeOldConversationList = function encodeOldConversationList(option) {\n      option = option || {};\n      var _option2 = option,\n          count = _option2.count,\n          type = _option2.type;\n      var modules = this.codec.getModule(PBName.RelationsInput);\n      type = type || CONVERSATION_TYPE.PRIVATE;\n      count = count || 0;\n      modules.setType(type);\n      modules.setCount(count);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveConversationList = function encodeRemoveConversationList(conversationList) {\n      var _this = this;\n\n      var modules = this.codec.getModule(PBName.DeleteSessionsInput);\n      var sessions = [];\n      utils.forEach(conversationList, function (conversation) {\n        var type = conversation.type,\n            targetId = conversation.targetId;\n\n        var session = _this.codec.getModule(PBName.SessionInfo);\n\n        session.setType(type);\n        session.setChannelId(targetId);\n        sessions.push(session);\n      });\n      modules.setSessions(sessions);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeDeleteMessages = function encodeDeleteMessages(conversation, messages) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var modules = this.codec.getModule(PBName.DeleteMsgInput);\n      var encodeMsgs = [];\n      utils.forEach(messages, function (message) {\n        encodeMsgs.push({\n          msgId: message.messageUId,\n          msgDataTime: message.sentTime,\n          direct: message.direction\n        });\n      });\n      modules.setType(type);\n      modules.setConversationId(targetId);\n      modules.setMsgs(encodeMsgs);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearMessages = function encodeClearMessages(conversation, option) {\n      var targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.CleanHisMsgInput);\n      timestrap = timestrap || utils.getCurrentTimestamp();\n      modules.setDataTime(timestrap);\n      modules.setTargetId(targetId);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearUnreadCount = function encodeClearUnreadCount(conversation, option) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.SessionMsgReadInput);\n      timestrap = timestrap || +new Date();\n      modules.setType(type);\n      modules.setChannelId(targetId);\n      modules.setMsgTime(timestrap);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinOrQuitChatRoom = function encodeJoinOrQuitChatRoom() {\n      var modules = this.codec.getModule(PBName.ChrmInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetChatRoomInfo = function encodeGetChatRoomInfo(option) {\n      option = option || {};\n      var _option3 = option,\n          count = _option3.count,\n          order = _option3.order;\n      var modules = this.codec.getModule(PBName.QueryChatRoomInfoInput);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    return Codec$$1;\n  }();\n\n  var Defer$2 = utils.Defer;\n  var MessageTimeSyner$1 = common.MessageTimeSyner,\n      ChatRoomMessageTimeSyner$1 = common.ChatRoomMessageTimeSyner;\n  var EVENT_NAME = {\n    MESSAGE_RECEIVED: 'msg-received'\n  };\n\n  var MessagePullManager = function () {\n    function MessagePullManager(serverEngine, option) {\n      this.isPulling = true;\n      this._serverEngine = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._messageTimeSyner = void 0;\n      this._chatroomMessageTimeSyner = new ChatRoomMessageTimeSyner$1();\n      this._pullMessageQueue = new utils.Queue();\n      this._pullMessageTimer = new utils.Timer({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: PULL_MSG_TIME\n      });\n      var self = this;\n      var startSyncTime = option.startSyncTime;\n      var appkey = serverEngine.option.appkey,\n          userId = serverEngine._selfUserId;\n      utils.extend(self, {\n        _serverEngine: serverEngine,\n        _messageTimeSyner: new MessageTimeSyner$1({\n          appkey: appkey,\n          userId: userId,\n          startSyncTime: startSyncTime\n        })\n      });\n      self.pull();\n\n      self._pullMessageTimer.start(self.pull, {\n        thisArg: self\n      });\n    }\n\n    var _proto = MessagePullManager.prototype;\n\n    _proto.watchMessage = function watchMessage(event) {\n      this._eventEmitter.on(EVENT_NAME.MESSAGE_RECEIVED, event);\n    };\n\n    _proto.pull = function pull(option) {\n      this._pullMessageQueue.add({\n        event: this._pullMessageList,\n        args: [option],\n        thisArg: this\n      });\n    };\n\n    _proto.setPullTimeByMessage = function setPullTimeByMessage(message) {\n      var isChatRoom = message.type === CONVERSATION_TYPE.CHATROOM;\n      isChatRoom ? this._chatroomMessageTimeSyner.setByMessage(message) : this._messageTimeSyner.setByMessage(message);\n    };\n\n    _proto.resetChrmTime = function resetChrmTime(id) {\n      this._chatroomMessageTimeSyner.set(id, 0);\n    };\n\n    _proto.close = function close() {\n      this._pullMessageTimer.stop();\n    };\n\n    _proto._displatchMessages = function _displatchMessages(option) {\n      var self = this;\n      var message = option.message,\n          finished = option.finished,\n          isPullChatRoomMsg = option.isPullChatRoomMsg,\n          normalSyncTime = option.normalSyncTime,\n          isLastInAPull = option.isLastInAPull;\n      var inboxTime = normalSyncTime.inboxTime,\n          sendboxTime = normalSyncTime.sendboxTime;\n      var sentTime = message.sentTime,\n          direction = message.direction;\n      var isSelfSend = direction === MESSAGE_DIRECTION.SEND;\n      var pullTime = isSelfSend ? sendboxTime : inboxTime;\n\n      if (sentTime < pullTime && !isPullChatRoomMsg) {\n        return;\n      }\n\n      if (utils.isUndefined(finished) || isPullChatRoomMsg) {\n        finished = true;\n      }\n\n      self._eventEmitter.emit(EVENT_NAME.MESSAGE_RECEIVED, {\n        message: message,\n        finished: finished,\n        isLastInAPull: isLastInAPull\n      });\n    };\n\n    _proto._pullMessageList = function _pullMessageList(option) {\n      var self = this;\n      self.isPulling = true;\n      var _serverEngine = self._serverEngine,\n          _messageTimeSyner = self._messageTimeSyner,\n          _chatroomMessageTimeSyner = self._chatroomMessageTimeSyner;\n\n      var _ref = option || {},\n          serverPullTime = _ref.time,\n          type = _ref.type,\n          chrmId = _ref.chrmId,\n          count = _ref.count;\n\n      var isPullChatRoomMsg = type === PULL_MSG_TYPE.CHATROOM;\n\n      var syncTime = _messageTimeSyner.get();\n\n      var currentReceiveTime = isPullChatRoomMsg ? _chatroomMessageTimeSyner.get(chrmId) : syncTime.inboxTime;\n      syncTime = utils.copy(syncTime);\n\n      if (serverPullTime && serverPullTime < currentReceiveTime) {\n        return Defer$2.resolve();\n      }\n\n      var onMessage = function onMessage(event) {\n        var message = event.message,\n            finished = event.finished,\n            isLastInAPull = event.isLastInAPull;\n\n        self._displatchMessages({\n          message: message,\n          finished: finished,\n          isPullChatRoomMsg: isPullChatRoomMsg,\n          isLastInAPull: isLastInAPull,\n          normalSyncTime: syncTime,\n          chatroomReceiveTime: currentReceiveTime\n        });\n      };\n\n      var pullOption = {\n        onMessage: onMessage\n      };\n      var defer = isPullChatRoomMsg ? _serverEngine.pullChrmMessageList(chrmId, currentReceiveTime, count, pullOption) : _serverEngine.pullMessageList(syncTime, pullOption);\n      return defer.then(function (result) {\n        self.isPulling = false;\n        return result;\n      })[\"catch\"](function (error) {\n        self.isPulling = false;\n        console.error('pull error', error);\n      });\n    };\n\n    return MessagePullManager;\n  }();\n\n  var DeferHandler$3 = utils.DeferHandler,\n      Defer$3 = utils.Defer;\n  var SignalId$1 = common.SignalId;\n  var EmitterName = IM_EVENT;\n\n  var ServerEngine = function () {\n    function ServerEngine(option) {\n      this._transporter = void 0;\n      this._serverEventEmitter = new utils.EventEmitter();\n      this._deferHandler = new DeferHandler$3();\n      this._messagePullManager = void 0;\n      this._serverDataCodec = void 0;\n      this._selfUserId = void 0;\n      this._connectedTime = void 0;\n      this.option = void 0;\n      var self = this;\n      var transporter = new Transporter(option);\n      transporter.watchSignal(function (signal) {\n        self._handleSignal(signal);\n      });\n      transporter.watchStatus(function (status) {\n        console.log('server status', status);\n\n        self._handleStatus(status);\n      });\n\n      self._watchServerTask();\n\n      self._serverDataCodec = new Codec$2(option);\n      utils.extend(self, {\n        _transporter: transporter,\n        option: option\n      });\n    }\n\n    var _proto = ServerEngine.prototype;\n\n    _proto._afterConnect = function _afterConnect(_ref) {\n      var userId = _ref.userId,\n          timestamp = _ref.timestamp;\n      var self = this;\n      var isOldServer = self.option.isOldServer;\n      var getServerConfig = isOldServer ? self.getOldServerConfig : self.getServerConfig;\n      self._selfUserId = userId;\n      self._connectedTime = timestamp;\n      return getServerConfig.call(self, userId).then(function (syncTime) {\n        var messagePullManager = new MessagePullManager(self, {\n          startSyncTime: syncTime\n        });\n        messagePullManager.watchMessage(function (_ref2) {\n          var message = _ref2.message,\n              finished = _ref2.finished,\n              isLastInAPull = _ref2.isLastInAPull;\n          messagePullManager.setPullTimeByMessage(message);\n\n          self._notifyMessage(message, finished, isLastInAPull);\n        });\n        self._messagePullManager = messagePullManager;\n        return {\n          userId: userId\n        };\n      });\n    };\n\n    _proto._handleStatus = function _handleStatus(status) {\n      if (common.isDisconnected(status)) {\n        this.disconnect();\n        var currentTime = utils.getCurrentTimestamp();\n        var isDisconnectTooFast = currentTime - this._connectedTime < MINIMUM_CONNECT_DURATION;\n        var NotSwitchStauts = [TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT];\n\n        if (isDisconnectTooFast && !utils.isInclude(NotSwitchStauts, status)) {\n          return this._serverEventEmitter.emit(EmitterName.STATUS, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST);\n        }\n      }\n\n      this._serverEventEmitter.emit(EmitterName.STATUS, status);\n    };\n\n    _proto._handleSignalAck = function _handleSignalAck(signal) {\n      var _transporter = this._transporter;\n      var messageId = signal.messageId;\n      var isQosNeedAck = signal._header && signal._header.qos !== QOS.AT_MOST_ONCE;\n\n      if (signal instanceof PublishReader && !signal.syncMsg && isQosNeedAck) {\n        var writer = new PubAckWriter(messageId);\n\n        _transporter.sendSignal(writer);\n      }\n\n      if (signal instanceof QueryAckReader && isQosNeedAck) {\n        var _writer = new QueryConWriter(messageId);\n\n        _transporter.sendSignal(_writer);\n      }\n    };\n\n    _proto._handleSignal = function _handleSignal(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var messageId = signal.messageId;\n\n      if (messageId && signal.getIdentifier) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.resolve(deferId, signal);\n      }\n\n      self._handleSignalAck(signal);\n\n      self._dispatchTask(signal);\n    };\n\n    _proto._watchServerTask = function _watchServerTask() {\n      var self = this;\n      var _serverEventEmitter = self._serverEventEmitter,\n          currentUserId = self._selfUserId,\n          connectedTime = self._connectedTime;\n\n      _serverEventEmitter.on(SERVER_TASK.SYNC_SELF_MSG, function (signal) {\n        self._receiveMsgFromOtherDevice(signal);\n      });\n\n      _serverEventEmitter.on(SERVER_TASK.NOTIFY_PULL, function (signal) {\n        var notifyPullConfig = self._serverDataCodec.decodeNotifyPullConfig(signal.data);\n\n        self._messagePullManager.pull(notifyPullConfig);\n      });\n\n      _serverEventEmitter.on(SERVER_TASK.RECEIVE_MSG, function (signal) {\n        var _messagePullManager = self._messagePullManager;\n\n        if (!_messagePullManager || _messagePullManager.isPulling) {\n          return;\n        }\n\n        var msg = self._serverDataCodec.decodeReceiveMessage(signal.data, {\n          currentUserId: currentUserId,\n          connectedTime: connectedTime\n        });\n\n        self._messagePullManager.setPullTimeByMessage(msg);\n\n        self._notifyMessage(msg);\n      });\n    };\n\n    _proto._dispatchTask = function _dispatchTask(signal) {\n      var _serverEventEmitter = this._serverEventEmitter;\n\n      if (signal instanceof DisconnectReader) {\n        var status = signal.status;\n        status = SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS[status];\n        return this._handleStatus(status);\n      }\n\n      if (signal instanceof PublishReader) {\n        var isSyncMsgSentBySelfOtherClient = signal.syncMsg,\n            topic = signal.topic;\n        var task = isSyncMsgSentBySelfOtherClient ? SERVER_TASK.SYNC_SELF_MSG : PUBLISH_TOPIC_MAP_SERVER_TASK[topic];\n        task && _serverEventEmitter.emit(task, signal);\n      }\n    };\n\n    _proto._sendSignal = function _sendSignal(writer, decodePBName, option) {\n      var appkey = this.option.appkey,\n          _serverDataCodec = this._serverDataCodec;\n      var _transporter = this._transporter,\n          _deferHandler = this._deferHandler,\n          currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n      var signalId = SignalId$1.get({\n        appkey: appkey,\n        userId: currentUserId\n      });\n\n      if (SignalId$1.isExceedLimit(signalId)) {\n        this._handleStatus(TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT);\n\n        return utils.Defer.reject(ERROR_INFO.TIMEOUT);\n      }\n\n      writer.messageId = signalId;\n      var deferId = writer.getIdentifier();\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n\n        _transporter.sendSignal(writer);\n      }).then(function (signal) {\n        var status = signal.status,\n            data = signal.data;\n        var isSuccess = utils.isEqual(status, SUCCESS_CODE);\n\n        if (!isSuccess) {\n          console.log('signal status', status);\n        }\n\n        var result = isSuccess ? signal : {\n          status: status\n        };\n\n        if (isSuccess && decodePBName) {\n          signal.data = _serverDataCodec.decodeByPBName(data, decodePBName, utils.extend({\n            signal: signal,\n            currentUserId: currentUserId,\n            connectedTime: connectedTime\n          }, option));\n        }\n\n        var exec = isSuccess ? Defer$3.resolve : Defer$3.reject;\n        return exec.call(Defer$3, result);\n      });\n    };\n\n    _proto._sendSignalForData = function _sendSignalForData(writer, decodePBName, option) {\n      return this._sendSignal(writer, decodePBName, option).then(function (successSignal) {\n        var data = decodePBName ? successSignal.data : undefined;\n        return data;\n      });\n    };\n\n    _proto._receiveMsgFromOtherDevice = function _receiveMsgFromOtherDevice(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          currentUserId = self._selfUserId,\n          connectType = self.option.connectType,\n          _serverDataCodec = self._serverDataCodec;\n      var isComet = connectType === CONNECT_TYPE.COMET;\n\n      var msg = _serverDataCodec.decodeSentMessage(signal.data, {\n        currentUserId: currentUserId,\n        signal: signal\n      });\n\n      if (isComet) {\n        msg.sentTime = utils.getCurrentTimestamp();\n\n        self._messagePullManager.setPullTimeByMessage(msg);\n\n        return self._notifyMessage(msg);\n      }\n\n      return utils.deferred(function (resolve, reject) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (ackSignal) {\n        msg.messageUId = ackSignal.messageUId;\n        msg.sentTime = ackSignal.timestamp;\n\n        self._messagePullManager.setPullTimeByMessage(msg);\n\n        self._notifyMessage(msg);\n      });\n    };\n\n    _proto._notifyMessage = function _notifyMessage(message, finished, isLastInAPull) {\n      var self = this;\n      var _serverEventEmitter = self._serverEventEmitter;\n      finished = utils.isUndefined(finished) ? true : finished;\n\n      _serverEventEmitter.emit(EmitterName.MESSAGE, {\n        message: message,\n        isLastInAPull: isLastInAPull,\n        hasMore: !finished\n      });\n    };\n\n    _proto.watchMessage = function watchMessage(watcher) {\n      this._serverEventEmitter.on(EmitterName.MESSAGE, watcher);\n    };\n\n    _proto.watchStatus = function watchStatus(watcher) {\n      this._serverEventEmitter.on(EmitterName.STATUS, watcher);\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporter = self._transporter;\n      return _transporter.connect(user, option).then(function (result) {\n        var isConnectSuccess = utils.isEqual(result.status, SUCCESS_CODE);\n        return isConnectSuccess ? Defer$3.resolve(result) : Defer$3.reject(result);\n      }).then(function (result) {\n        return self._afterConnect(result);\n      }, function (_ref3) {\n        var status = _ref3.status;\n        var errorInfo = CONNECT_SERVER_STATUS_MAP_ERROR_INFO[status] || {\n          code: status\n        };\n        return utils.Defer.reject(errorInfo);\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      var appkey = this.option.appkey,\n          _messagePullManager = this._messagePullManager;\n      var _transporter = this._transporter,\n          _selfUserId = this._selfUserId;\n      _messagePullManager && _messagePullManager.close();\n      _transporter && _transporter.disconnect();\n      SignalId$1.clear({\n        appkey: appkey,\n        userId: _selfUserId\n      });\n      return Defer$3.resolve(_selfUserId);\n    };\n\n    _proto.getServerConfig = function getServerConfig() {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeServerConfParams();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_SYNC_TIME, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.SessionsAttOutput);\n    };\n\n    _proto.pullMessageList = function pullMessageList(syncMsgArgs, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeSyncMsg(syncMsgArgs);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_MSG, data, _selfUserId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.pullChrmMessageList = function pullChrmMessageList(chatroomId, time, count, option) {\n      time = time || 0;\n      count = count || 0;\n\n      var data = this._serverDataCodec.encodeChrmSyncMsg(time, count);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_CHRM_MSG, data, chatroomId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, sendOption, topic) {\n      var self = this;\n      var currentUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec;\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var publishTopic = topic || CONVERSATION_TYPE_TO_PUBLISH_TOPIC[type] || PUBLISH_TOPIC.PRIVATE;\n\n      var data = _serverDataCodec.encodeUpMsg(conversation, sendOption);\n\n      var signal = new PublishWriter(publishTopic, data, targetId);\n      return self._sendSignal(signal).then(function (_ref4) {\n        var messageUId = _ref4.messageUId,\n            timestamp = _ref4.timestamp;\n\n        var msg = _serverDataCodec.decodeSentMessage(data, {\n          signal: signal,\n          currentUserId: currentUserId\n        });\n\n        msg.messageUId = messageUId;\n        msg.sentTime = timestamp;\n\n        self._messagePullManager.setPullTimeByMessage(msg);\n\n        return msg;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var upMsgArgs = utils.extend(option || {}, message);\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var messageUId = message.messageUId,\n          sentTime = message.sentTime;\n      upMsgArgs.objectName = RECALL_OBJECT_NAME;\n      upMsgArgs.content = {\n        conversationType: type,\n        targetId: targetId,\n        messageUId: messageUId,\n        sentTime: sentTime\n      };\n      return this.sendMessage({\n        type: type,\n        targetId: this._selfUserId\n      }, upMsgArgs, PUBLISH_TOPIC.RECALL);\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeGetConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.RelationsOutput);\n    };\n\n    _proto.removeConversationList = function removeConversationList(conversationList) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeRemoveConversationList(conversationList);\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.DeleteSessionsOutput);\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      return this.removeConversationList([conversation]);\n    };\n\n    _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var type = conversation.type;\n      var historyTopic = CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC[type] || QUERY_HISTORY_TOPIC.PRIVATE;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeDeleteMessages(conversation, messages);\n\n      var writer = new QueryWriter(QUERY_TOPIC.DELETE_MESSAGES, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId;\n      var type = conversation.type;\n\n      var data = this._serverDataCodec.encodeClearMessages(conversation, option);\n\n      var topic = CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC[type];\n      var writer = new QueryWriter(topic, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      return this.getServerConfig().then(function (_ref5) {\n        var totalUnreadCount = _ref5.totalUnreadCount;\n        return totalUnreadCount;\n      });\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeClearUnreadCount(conversation, option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.CLEAR_UNREAD_COUNT, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var id = chrm.id;\n      var count = option.count;\n\n      var data = self._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_CHATROOM, data, id);\n      return self._sendSignalForData(writer).then(function (result) {\n        self._messagePullManager.resetChrmTime(id);\n\n        self._messagePullManager.pull({\n          count: count,\n          type: PULL_MSG_TYPE.CHATROOM,\n          time: 0,\n          chrmId: id\n        });\n\n        return result;\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_CHATROOM, data, id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeGetChatRoomInfo(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CHATROOM_INFO, data, id);\n      return this._sendSignalForData(writer, PBName.QueryChatRoomInfoOutput);\n    };\n\n    _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n      console.log(chrm, option);\n    };\n\n    _proto.getOldServerConfig = function getOldServerConfig(userId) {\n      var appkey = this.option.appkey;\n      var syncTime = new common.MessageTimeSyner({\n        appkey: appkey,\n        userId: userId\n      }).get();\n      return Defer$3.resolve(syncTime);\n    };\n\n    _proto.getOldConversationList = function getOldConversationList(option, formatOpt) {\n      var self = this;\n      var _selfUserId = self._selfUserId;\n\n      var data = self._serverDataCodec.encodeOldConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_OLD_CONVERSATION_LIST, data, _selfUserId);\n      return self._sendSignalForData(writer, PBName.RelationsOutput, formatOpt);\n    };\n\n    _proto.removeOldConversation = function removeOldConversation(conversation) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n\n      var data = this._serverDataCodec.encodeOldConversationList({\n        type: type\n      });\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_OLD_CONVERSATION, data, targetId);\n      return this._sendSignalForData(writer);\n    };\n\n    return ServerEngine;\n  }();\n\n  var RCStorage$1 = common.RCStorage;\n\n  var LocalNaviHandler = function () {\n    function LocalNaviHandler(option) {\n      this.storage = void 0;\n      this.option = void 0;\n      var appkey = option.appkey,\n          token = option.token;\n      var UID = common.getUIDByToken(token);\n      var KEY = utils.tplEngine(STORAGE_NAVI.ROOT_KEY_TPL, {\n        appkey: appkey,\n        UID: UID\n      });\n      this.storage = new RCStorage$1(KEY);\n      this.option = option;\n    }\n\n    var _proto = LocalNaviHandler.prototype;\n\n    _proto.set = function set(resp) {\n      var connectType = this.option.connectType;\n      this.storage.set(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE, connectType);\n      this.storage.set(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED, utils.getCurrentTimestamp());\n      this.storage.set(STORAGE_NAVI.SUB_KEY.RESPONSE, resp);\n    };\n\n    _proto.clear = function clear() {\n      this.storage.clear();\n    };\n\n    _proto.getResp = function getResp() {\n      return this.storage.get(STORAGE_NAVI.SUB_KEY.RESPONSE);\n    };\n\n    _proto.isValid = function isValid() {\n      var storage = this.storage,\n          connectType = this.option.connectType;\n      var resp = this.getResp();\n\n      if (utils.isEmpty(resp)) {\n        return false;\n      }\n\n      var oldConnectType = storage.get(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE);\n      var timeWhenSaved = storage.get(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED);\n      var isSameConnectType = utils.isEqual(oldConnectType, connectType);\n      var isNotExpired = utils.getCurrentTimestamp() - timeWhenSaved < NAVI_EXPIRED_TIME;\n      return isSameConnectType && isNotExpired;\n    };\n\n    return LocalNaviHandler;\n  }();\n\n  var getNaviUrl = function getNaviUrl(url, option) {\n    var appkey = option.appkey,\n        connectType = option.connectType,\n        token = option.token;\n    var encodeToken = utils.encodeURI(token);\n    var protocol = env.protocol.http;\n    var type = connectType === CONNECT_TYPE.COMET ? NAVI_TYPE.COMET : NAVI_TYPE.WEBSOCKET;\n    var random = utils.getCurrentTimestamp();\n    url = utils.getValidUrl(url);\n    var naviUrlOption = {\n      protocol: protocol,\n      url: url,\n      type: type,\n      appkey: appkey,\n      random: random,\n      token: encodeToken\n    };\n    return utils.tplEngine(NAVI_URL_TPL, naviUrlOption);\n  };\n\n  var parseNaviResponse = function parseNaviResponse(responseText) {\n    var startText = NAVI_CALLBACK_NAME + '(';\n    var endText = ')';\n    var startIndex = utils.indexOf(responseText, startText) + startText.length;\n    var endIndex = utils.lastIndexOf(responseText, endText);\n\n    if (startIndex === -1 || endIndex === -1) {\n      return utils.parseJSON(responseText);\n    }\n\n    var response = utils.substring(responseText, startIndex, endIndex);\n\n    if (utils.isValidJSON(response)) {\n      return utils.parseJSON(response);\n    } else {\n      return {};\n    }\n  };\n\n  var NaviManager = function () {\n    function NaviManager(option) {\n      this.option = void 0;\n      this.localNaviHandler = void 0;\n      this.option = option;\n      this.localNaviHandler = new LocalNaviHandler(option);\n    }\n\n    var _proto2 = NaviManager.prototype;\n\n    _proto2.get = function get() {\n      var self = this;\n      var option = self.option,\n          localNaviHandler = self.localNaviHandler;\n      var navigators = option.navigators,\n          token = option.token;\n      var localConfigForNavi = self.getLocalConfig();\n\n      if (localNaviHandler.isValid()) {\n        return utils.Defer.resolve(localConfigForNavi);\n      }\n\n      var naviListInToken = common.getNaviListByToken(token);\n      navigators = naviListInToken.concat(navigators);\n      option.token = common.getValidToken(token);\n      var urlList = utils.map(navigators, function (url) {\n        return getNaviUrl(url, option);\n      });\n      return utils.requestByUrlList(urlList).then(function (_ref) {\n        var responseText = _ref.responseText;\n        var resp = parseNaviResponse(responseText);\n        var code = resp.code;\n        var isSuccess = code === NAVI_REQUEST_SUCCESS_CODE;\n\n        if (isSuccess) {\n          localNaviHandler.set(resp);\n          return resp;\n        } else if (resp && code) {\n          return utils.Defer.reject({\n            code: NAVI_ERROR_INFO[code],\n            msg: resp.errorMessage\n          });\n        } else {\n          return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n            error: responseText\n          }));\n        }\n      }, function (error) {\n        return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n          error: error\n        }));\n      });\n    };\n\n    _proto2.getLocalConfig = function getLocalConfig() {\n      return this.localNaviHandler.getResp();\n    };\n\n    _proto2.clear = function clear() {\n      var option = this.option;\n      var localNaviHanlder = new LocalNaviHandler(option);\n      localNaviHanlder.clear();\n    };\n\n    return NaviManager;\n  }();\n\n  var CMPManager = function () {\n    function CMPManager() {\n      this.cmpDomainList = [];\n      this.invalidDomainList = [];\n      this.option = void 0;\n    }\n\n    var _proto = CMPManager.prototype;\n\n    _proto.setDomainList = function setDomainList(cmpDomainList, option) {\n      this.cmpDomainList = cmpDomainList;\n      this.option = option || {};\n    };\n\n    _proto.getFaster = function getFaster() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList,\n          option = this.option;\n      var sniffUrlList = utils.filter(cmpDomainList, function (domain) {\n        return !utils.isInclude(invalidDomainList, domain);\n      });\n      sniffUrlList = utils.map(sniffUrlList, function (domain) {\n        var timestamp = utils.getCurrentTimestamp();\n        var url = domain + \"/ping?r=\" + timestamp;\n        return utils.getValidUrl(url, option);\n      });\n\n      if (utils.isEmpty(sniffUrlList)) {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      }\n\n      return utils.requestForFaster(sniffUrlList, {\n        timeInterval: CMP_SNIFF_INTERNAL_TIME\n      }).then(function (_ref) {\n        var url = _ref.url,\n            index = _ref.index;\n        return {\n          url: url,\n          index: index,\n          domain: utils.getDomainByUrl(url)\n        };\n      })[\"catch\"](function () {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      });\n    };\n\n    _proto.addInvalid = function addInvalid(domain) {\n      this.invalidDomainList.push(domain);\n    };\n\n    _proto.clearInvalid = function clearInvalid() {\n      this.invalidDomainList.length = 0;\n    };\n\n    _proto.isAllInvalid = function isAllInvalid() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList;\n      return utils.isEqual(cmpDomainList.length, invalidDomainList.length);\n    };\n\n    return CMPManager;\n  }();\n\n  var RCStorage$2 = common.RCStorage;\n  var SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n\n  var ConversationManager = function () {\n    function ConversationManager(option) {\n      this._storage = void 0;\n      this._onChanged = void 0;\n      this.updatedConversations = {};\n      var StorageKey = utils.tplEngine(STORAGE_CONVERSATION.ROOT_KEY_TPL, option);\n      this._storage = new RCStorage$2(StorageKey);\n      this._onChanged = option.onChanged || utils.noop;\n    }\n\n    var _proto = ConversationManager.prototype;\n\n    _proto._getConversationKey = function _getConversationKey(option) {\n      var type = option.type,\n          targetId = option.targetId;\n      return type + '_' + targetId;\n    };\n\n    _proto._getUpdatedConversationList = function _getUpdatedConversationList() {\n      var self = this;\n      var updatedConversations = self.updatedConversations;\n      var updatedConversationList = [];\n      utils.forEach(updatedConversations, function (conversation) {\n        var storageConversation = self.get(conversation);\n        conversation.unreadMessageCount = storageConversation[SUB_KEY.UNREAD_COUNT] || 0, conversation.hasMentiond = storageConversation[SUB_KEY.HAS_MENTIOND] || false, conversation.mentiondInfo = storageConversation[SUB_KEY.MENTIOND_INFO];\n        updatedConversationList.push(conversation);\n      });\n\n      if (utils.isEmpty(updatedConversationList)) {\n        return [];\n      }\n\n      return common.sortConversationList(updatedConversationList);\n    };\n\n    _proto.update = function update() {\n      var updatedConversationList = this._getUpdatedConversationList();\n\n      if (!utils.isEmpty(updatedConversationList)) {\n        this._onChanged(updatedConversationList);\n\n        this.updatedConversations = {};\n      }\n    };\n\n    _proto.addMessage = function addMessage(message, option) {\n      option = option || {};\n      var self = this;\n      var _option = option,\n          isLastInAPull = _option.isLastInAPull;\n      var type = message.type,\n          sentTime = message.sentTime,\n          direction = message.direction,\n          targetId = message.targetId,\n          content = message.content,\n          objectName = message.objectName,\n          isMentiond = message.isMentiond,\n          isPersited = message.isPersited,\n          isCounted = message.isCounted;\n      var isTypeNoConversation = !utils.isInclude(TYPE_HAS_CONVERSATION, type);\n\n      if (isTypeNoConversation) {\n        return;\n      }\n\n      var isRecall = utils.isEqual(objectName, RECALL_OBJECT_NAME);\n      var hasContent = utils.isObject(content);\n      var isOtherSend = direction === MESSAGE_DIRECTION.RECEIVE;\n      var storageConversation = self.get({\n        type: type,\n        targetId: targetId\n      });\n      var hasChanged = false;\n      var lastUnreadTime = storageConversation[SUB_KEY.UNREAD_LAST_TIME] || 0;\n      var isNotAdded = sentTime > lastUnreadTime;\n\n      if (isOtherSend && isCounted && isNotAdded && (hasChanged = true)) {\n        storageConversation[SUB_KEY.UNREAD_COUNT] = storageConversation[SUB_KEY.UNREAD_COUNT] || 0;\n        storageConversation[SUB_KEY.UNREAD_COUNT]++;\n        storageConversation[SUB_KEY.UNREAD_LAST_TIME] = sentTime;\n      } else if (isOtherSend && isRecall && hasContent) {\n        var isRecallMsgNotRead = lastUnreadTime >= content.sentTime;\n\n        if (isRecallMsgNotRead) {\n          storageConversation[SUB_KEY.UNREAD_COUNT] = storageConversation[SUB_KEY.UNREAD_COUNT] || 0;\n          storageConversation[SUB_KEY.UNREAD_COUNT]--;\n        }\n      }\n\n      if (isOtherSend && isMentiond && hasContent && content.mentionedInfo && (hasChanged = true)) {\n        storageConversation[SUB_KEY.HAS_MENTIOND] = true;\n        storageConversation[SUB_KEY.MENTIOND_INFO] = content.mentionedInfo;\n      }\n\n      if (hasChanged) {\n        var _key = self._getConversationKey({\n          type: type,\n          targetId: targetId\n        });\n\n        self._storage.set(_key, storageConversation);\n      }\n\n      var key = self._getConversationKey(message);\n\n      var cacheConversation = self.updatedConversations[key] || {};\n      cacheConversation = common.fixConversationData(cacheConversation);\n      var isMsgNotAdded = (cacheConversation.latestMessage.sentTime || 0) <= sentTime;\n\n      if (isPersited && isMsgNotAdded) {\n        cacheConversation = {\n          type: type,\n          targetId: targetId,\n          latestMessage: message\n        };\n        self.updatedConversations[key] = cacheConversation;\n      }\n\n      var isNotifyUpdate = utils.isUndefined(isLastInAPull) ? true : isLastInAPull;\n\n      if (isNotifyUpdate) {\n        self.update();\n      }\n    };\n\n    _proto.get = function get(option) {\n      var key = this._getConversationKey(option);\n\n      return this._storage.get(key) || {};\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var allVals = this._storage.getValues() || {};\n      var totalCount = 0;\n      utils.forEach(allVals, function (val) {\n        var count = val[SUB_KEY.UNREAD_COUNT] || 0;\n        totalCount += count;\n      });\n      return totalCount;\n    };\n\n    _proto.read = function read(option) {\n      var key = this._getConversationKey(option);\n\n      var localConversation = this._storage.get(key) || {};\n      var localUnread = localConversation[SUB_KEY.UNREAD_COUNT];\n\n      if (localUnread) {\n        this._storage.remove(key);\n\n        var cacheConversation = this.updatedConversations[key];\n\n        if (cacheConversation) ; else {\n          this.updatedConversations[key] = option;\n        }\n\n        this.update();\n      }\n    };\n\n    return ConversationManager;\n  }();\n\n  var CONVERSATION_SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n\n  var WebIMEngine = function () {\n    function WebIMEngine(option) {\n      this._option = void 0;\n      this._user = void 0;\n      this._naviManager = void 0;\n      this._cmpManager = new CMPManager();\n      this._conversationManager = void 0;\n      this._serverEngine = void 0;\n      this._imEventEmitter = new utils.EventEmitter();\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      this._connectedDomain = void 0;\n      this._networkDetecter = void 0;\n      var self = this;\n      var _imEventEmitter = self._imEventEmitter;\n      var detect = option.detect;\n      var serverEngine = new ServerEngine(option);\n      serverEngine.watchStatus(function (status) {\n        self._handleConnectionStatus(status);\n      });\n      serverEngine.watchMessage(function (event) {\n        var message = event.message,\n            hasMore = event.hasMore,\n            isLastInAPull = event.isLastInAPull;\n\n        self._conversationManager.addMessage(message, {\n          hasMore: hasMore,\n          isLastInAPull: isLastInAPull\n        });\n\n        _imEventEmitter.emit(IM_EVENT.MESSAGE, {\n          message: message,\n          hasMore: hasMore\n        });\n      });\n      this._serverEngine = serverEngine;\n      this._option = option;\n      this._networkDetecter = new utils.NetworkDetecter(detect);\n    }\n\n    var _proto = WebIMEngine.prototype;\n\n    _proto._handleConnectionStatus = function _handleConnectionStatus(status) {\n      var _cmpManager = this._cmpManager,\n          _naviManager = this._naviManager,\n          _connectedDomain = this._connectedDomain;\n      var isNeedUpdateCMPList = utils.isInclude(TRANSPORTER_STATUS_NEED_UPDATE_CMP, status);\n      var isNeedReconnect = utils.isInclude(TRANSPORTER_STATUS_NEED_RECONNECT, status);\n\n      if (isNeedUpdateCMPList) {\n        _cmpManager.addInvalid(_connectedDomain);\n\n        if (_cmpManager.isAllInvalid()) {\n          _naviManager.clear();\n\n          _cmpManager.clearInvalid();\n        }\n      }\n\n      if (isNeedReconnect) {\n        this.reconnect();\n      }\n\n      var connectionStatus = TRANSPORTER_STATUS_TO_CONNECTION_STATUS[status] || status;\n      this._connectionStatus = connectionStatus;\n\n      this._imEventEmitter.emit(IM_EVENT.STATUS, {\n        status: connectionStatus\n      });\n    };\n\n    _proto._handleConnectError = function _handleConnectError(errorInfo) {\n      var _user = this._user;\n      var code = errorInfo.code || errorInfo.status;\n\n      if (code === ERROR_INFO.CONN_REDIRECTED.code) {\n        this._naviManager.clear();\n\n        return this.connect(_user);\n      }\n\n      console.log('throw error', errorInfo);\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      return utils.Defer.reject(errorInfo);\n    };\n\n    _proto.watch = function watch(watchers) {\n      var statusWatcher = watchers.status,\n          messageWatcher = watchers.message,\n          conversationWatcher = watchers.conversation;\n\n      this._imEventEmitter.on(IM_EVENT.STATUS, function (event) {\n        statusWatcher && statusWatcher(event);\n      });\n\n      this._imEventEmitter.on(IM_EVENT.MESSAGE, function (event) {\n        messageWatcher && messageWatcher(event);\n      });\n\n      this._imEventEmitter.on(IM_EVENT.CONVERSATION, function (event) {\n        conversationWatcher && conversationWatcher(event);\n      });\n    };\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._connectionStatus;\n    };\n\n    _proto.connect = function connect(user) {\n      this._handleConnectionStatus(CONNECTION_STATUS.CONNECTING);\n\n      var self = this;\n      var _option = self._option,\n          _serverEngine = self._serverEngine,\n          _cmpManager = self._cmpManager,\n          _imEventEmitter = self._imEventEmitter;\n      var naviOpt = common.getNavReqOption(_option, user);\n      var naviManager = new NaviManager(naviOpt);\n      self._user = utils.copy(user);\n      self._naviManager = naviManager;\n      return naviManager.get().then(function (configForNavi) {\n        var cmpDomainList = common.getCMPDomainList(configForNavi);\n\n        _cmpManager.setDomainList(cmpDomainList);\n\n        return _cmpManager.getFaster();\n      }).then(function (_ref) {\n        var domain = _ref.domain;\n        self._connectedDomain = domain;\n        return _serverEngine.connect(user, {\n          domain: domain\n        });\n      }).then(function (connectUser) {\n        self._conversationManager = new ConversationManager({\n          appkey: _option.appkey,\n          userId: connectUser.userId,\n          onChanged: function onChanged(updatedConversationList) {\n            _imEventEmitter.emit(IM_EVENT.CONVERSATION, {\n              updatedConversationList: updatedConversationList\n            });\n          }\n        });\n        return connectUser;\n      }, function (error) {\n        return self._handleConnectError(error);\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      var self = this;\n      var _user = self._user;\n\n      if (utils.isUndefined(_user)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      return self._networkDetecter.start().then(function () {\n        return self.connect(_user);\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      this._handleConnectionStatus(CONNECTION_STATUS.DISCONNECTED);\n\n      this._networkDetecter.stop();\n\n      return this._serverEngine.disconnect();\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      this.disconnect();\n      return this.connect(user);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, option) {\n      var self = this;\n      return self._serverEngine.sendMessage(conversation, option).then(function (message) {\n        self._conversationManager.addMessage(message);\n\n        return message;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var self = this;\n      return self._serverEngine.recallMessage(conversation, message, option).then(function (message) {\n        self._conversationManager.addMessage(message);\n\n        return message;\n      });\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine,\n          _conversationManager = this._conversationManager;\n      var func = isOldServer ? _serverEngine.getOldConversationList : _serverEngine.getConversationList;\n      return func.call(_serverEngine, option, {\n        afterDecode: function afterDecode(conversation) {\n          var localConversation = _conversationManager.get(conversation);\n\n          conversation.unreadMessageCount = localConversation[CONVERSATION_SUB_KEY.UNREAD_COUNT] || 0;\n          conversation.hasMentiond = localConversation[CONVERSATION_SUB_KEY.HAS_MENTIOND] || false;\n          conversation.mentiondInfo = localConversation[CONVERSATION_SUB_KEY.MENTIOND_INFO];\n          return conversation;\n        }\n      });\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n      var func = isOldServer ? _serverEngine.removeOldConversation : _serverEngine.removeConversation;\n      return func.call(_serverEngine, conversation);\n    };\n\n    _proto.removeConversationList = function removeConversationList(conversationList) {\n      return this._serverEngine.removeConversationList(conversationList);\n    };\n\n    _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n      return this._serverEngine.getHistoryMessages(conversation, option);\n    };\n\n    _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n      return this._serverEngine.deleteHistoryMessages(conversation, messages);\n    };\n\n    _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n      return this._serverEngine.clearHistoryMessages(conversation, option);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        var totalCount = this._conversationManager.getTotalUnreadCount();\n\n        return utils.Defer.resolve(totalCount);\n      } else {\n        return _serverEngine.getTotalUnreadCount();\n      }\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        this._conversationManager.read(conversation);\n\n        return utils.Defer.resolve();\n      } else {\n        return _serverEngine.clearUnreadCount(conversation, option);\n      }\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      return this._serverEngine.joinChatRoom(chrm, option);\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      return this._serverEngine.quitChatRoom(chrm);\n    };\n\n    _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n      return this._serverEngine.getChatRoomInfo(chrm, option);\n    };\n\n    _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n      return this._serverEngine.getChatRoomHistoryMessages(chrm, option);\n    };\n\n    return WebIMEngine;\n  }();\n\n  var Engine = (function (imArg) {\n    return new WebIMEngine(imArg);\n  });\n\n  var execEngineByEvent = function execEngineByEvent(params, engine) {\n    var _ENGINE_EVENT$WATCH$E;\n\n    var event = params.event,\n        args = params.args;\n    args = args || [];\n\n    var engineEvent = (_ENGINE_EVENT$WATCH$E = {}, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.WATCH] = engine.watch, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.CONNECT] = engine.connect, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.DISCONNECT] = engine.disconnect, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.RECONNECT] = engine.reconnect, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.CHANGE_USER] = engine.changeUser, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.GET_CONVERSATION_LIST] = engine.getConversationList, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.REMOVE_CONVERSATION] = engine.removeConversation, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.REMOVE_CONVERSATION_LIST] = engine.removeConversationList, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT] = engine.getTotalUnreadCount, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.CLEAR_UNREAD_COUNT] = engine.clearUnreadCount, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.SEND_MESSAGE] = engine.sendMessage, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.RECALL_MESSAGE] = engine.recallMessage, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.GET_HISTORY_MSGS] = engine.getHistoryMessages, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.DELETE_MESSAGES] = engine.deleteHistoryMessages, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.CLEAR_MESSAGES] = engine.clearHistoryMessages, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.JOIN_CHATROOM] = engine.joinChatRoom, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.QUIT_CHATROOM] = engine.quitChatRoom, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.GET_CHATROOM_INFO] = engine.getChatRoomInfo, _ENGINE_EVENT$WATCH$E[ENGINE_EVENT.GET_CHATROOM_MSGS] = engine.getChatRoomHistoryMessages, _ENGINE_EVENT$WATCH$E)[event] || function () {\n      return utils.Defer.reject(ERROR_INFO.SDK_INTERNAL_ERROR);\n    };\n\n    return engineEvent.apply(engine, args);\n  };\n\n  var EngineDispatcher = function () {\n    function EngineDispatcher(option) {\n      this._engine = void 0;\n      this._engine = new Engine(option);\n    }\n\n    var _proto = EngineDispatcher.prototype;\n\n    _proto.exec = function exec(params) {\n      var event = params.event;\n      var engine = this._engine;\n      var connectionStatus = engine.getConnectionStatus();\n      var isNotConnected = connectionStatus !== CONNECTION_STATUS.CONNECTED;\n      var isEventNeedConnected = utils.isInclude(ENGINE_EVENT_NEED_CONNECTED, event);\n\n      if (isNotConnected && isEventNeedConnected) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      var isConnecting = common.isConnected(connectionStatus) || common.isConnecting(connectionStatus);\n      var isEventNeedDisconnected = utils.isInclude(ENGINE_EVENT_NEED_DISCONNECTED, event);\n\n      if (isConnecting && isEventNeedDisconnected) {\n        return utils.Defer.reject(ERROR_INFO.RC_CONNECTION_EXIST);\n      }\n\n      var execResult = execEngineByEvent(params, engine);\n      return utils.isPromise(execResult) ? execResult[\"catch\"](function (error) {\n        console.log('SDK Error', error);\n        var errorCode = error.status || error.code || error;\n        var errorInfo = ERROR_CODE_TO_INFO[errorCode] || {\n          code: errorCode\n        };\n        var isValidErrorCode = utils.isNumberData(errorCode);\n\n        if (!isValidErrorCode) {\n          errorInfo = utils.extendInShallow(ERROR_INFO.SDK_INTERNAL_ERROR, {\n            error: error\n          });\n        }\n\n        return utils.Defer.reject(errorInfo);\n      }) : execResult;\n    };\n\n    return EngineDispatcher;\n  }();\n\n  var Type = function Type(name, validator) {\n    var self = this;\n    self.validate = validator;\n    self.name = name;\n\n    self.canBeNull = function () {\n      self.validate = function (data) {\n        return utils.isUndefined(data) || utils.isNull(data) || validator(data);\n      };\n\n      return self;\n    };\n  };\n\n  Type.isType = function (type) {\n    return type instanceof Type;\n  };\n\n  Type.String = new Type('String', utils.isString);\n  Type.Number = new Type('Number', utils.isNumber);\n  Type.Boolean = new Type('Boolean', utils.isBoolean);\n  Type.Function = new Type('Function', utils.isFunction);\n  Type.Object = new Type('Object', utils.isObject);\n  Type.Array = new Type('Array', utils.isArray);\n  var conversationType = common.getConversationTypeList().join('、');\n  Type.ConversationType = new Type(conversationType, common.isValidConversationType);\n\n  var Struct = function () {\n    function Struct(structure, funcName, paths) {\n      if (paths === void 0) {\n        paths = [];\n      }\n\n      if (!(this instanceof Struct)) {\n        return new Struct(structure, funcName, paths);\n      }\n\n      var self = this;\n      self.structure = structure;\n      self.paths = paths;\n      self.funcName = funcName;\n\n      if (Type.isType(structure)) {\n        self.validate = self._validateType;\n      } else if (utils.isArray(structure)) {\n        self.validate = self._validateArray;\n      } else if (utils.isObject(structure)) {\n        self.validate = self._validateObject;\n      } else {\n        self.validate = self._validateOther;\n      }\n    }\n\n    var _proto = Struct.prototype;\n\n    _proto._validateType = function _validateType(data) {\n      var structure = this.structure;\n      var isValid = structure.validate(data);\n      return isValid ? this._getSuccess() : this._getError(data);\n    };\n\n    _proto._validateArray = function _validateArray(data) {\n      var structure = this.structure;\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isArray(data)) {\n        return this._getError(data);\n      }\n\n      var typer = structure[0];\n\n      for (var filed in data) {\n        var val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateObject = function _validateObject(data) {\n      var structure = this.structure,\n          paths = this.paths;\n      data = data || {};\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isObject(data)) {\n        return this._getError(data);\n      }\n\n      var checkedField = [];\n\n      for (var filed in data) {\n        var typer = structure[filed],\n            val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n\n        checkedField.push(filed);\n      }\n\n      for (var checkField in structure) {\n        var _typer = structure[checkField];\n        var unCheckData = data[checkField];\n\n        if (!utils.isInclude(checkedField, checkField) && !_typer.validate(unCheckData)) {\n          var errPaths = utils.copy(paths);\n          errPaths.push(checkField);\n          return this._getError(unCheckData, {\n            paths: errPaths,\n            expect: _typer.name\n          });\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateOther = function _validateOther(data) {\n      var self = this;\n      var structure = self.structure;\n\n      if (utils.isEqual(structure, data) || utils.isEmpty(structure)) {\n        return self._getSuccess();\n      } else {\n        return self._getError(data, {\n          current: data,\n          expect: structure\n        });\n      }\n    };\n\n    _proto._validateField = function _validateField(typer, filed, value) {\n      var paths = this.paths,\n          funcName = this.funcName;\n      var newPaths = utils.copy(paths);\n      newPaths.push(filed);\n      return new Struct(typer, funcName, newPaths).validate(value);\n    };\n\n    _proto._getError = function _getError(data, options) {\n      if (options === void 0) {\n        options = [];\n      }\n\n      var structure = this.structure,\n          paths = this.paths,\n          funcName = this.funcName;\n      options = utils.extend({\n        current: data,\n        expect: structure.name || utils.getTypeName(structure),\n        paths: paths\n      }, options);\n      paths = options.paths;\n      var _options = options,\n          current = _options.current,\n          expect = _options.expect;\n      var param = utils.isEmpty(paths) ? 'param' : paths.join('.');\n      var currentType = utils.getTypeName(current);\n      current = utils.toJSON(current) || current;\n      current = current + \"(\" + currentType + \")\";\n      var msg = utils.tplEngine(ERROR_INFO.PARAMETER_ERROR.msg, {\n        param: param,\n        expect: expect,\n        current: current\n      });\n      var info = {\n        code: ERROR_INFO.PARAMETER_ERROR.code,\n        funcName: funcName,\n        msg: msg\n      };\n      var jsonInfo = utils.toJSON(info);\n      if (utils.isEmpty(funcName)) delete info[funcName];\n      return {\n        isError: true,\n        info: info,\n        jsonInfo: jsonInfo\n      };\n    };\n\n    _proto._getSuccess = function _getSuccess() {\n      return {\n        isError: false\n      };\n    };\n\n    return Struct;\n  }();\n\n  var validate = (function (struct, params, eventName) {\n    return Struct(struct, eventName).validate(params);\n  });\n\n  var NAVIGATORS = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n  var NETWORK_DETECT_OPTION = {\n    url: 'https://cdn.ronghub.com/im_detecting',\n    intervalTime: 1500\n  };\n  var IM_OPTION = {\n    connectType: CONNECT_TYPE.WEBSOCKET,\n    navigators: NAVIGATORS,\n    detect: NETWORK_DETECT_OPTION,\n    isOldServer: true\n  };\n  var GET_MESSAGES_OPTION = {\n    count: 10,\n    order: MESSAGS_TIME_ORDER.DESC,\n    timestrap: 0\n  };\n  var SEND_MESSAGE_OPTION = {\n    isMentiond: false,\n    isCounted: true,\n    isPersited: true\n  };\n  var GET_CHATROOM_INFO_OPTION = {\n    count: 20,\n    order: CHATROOM_ORDER.DESC\n  };\n  var JOIN_CHATROOM_OPTION = {\n    count: -1\n  };\n  var SEND_MESSAGE_TYPE_OPTION = {\n    'RC:TxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:VcMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgTextMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:FileMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:HQVCMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:LBSMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSMultiImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpOpendMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:CombineMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:InfoNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ContactNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ProfileNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:GrpNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:RcCmd': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:TypSts': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:PSCmd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:SRSMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRReqMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRRspMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsChaR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CSCha': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEva': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsContact': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHs': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHsR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsSp': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEnd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsUpdate': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:ReadNtf': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:chrmKVNotiMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCAccept': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCRinging': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCSummary': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCHangup': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCInvite': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMedia': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMem': {\n      isCounted: false,\n      isPersited: false\n    }\n  };\n\n  var Conversation = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      Conversation.create = function create(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.get = function get(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.merge = function merge(option) {\n        var conversationList = option.conversationList,\n            updatedConversationList = option.updatedConversationList;\n        conversationList = updatedConversationList.concat(conversationList);\n        conversationList = common.sortConversationList(conversationList);\n        var hashTable = {};\n        var newList = [];\n        utils.forEach(conversationList, function (conversation) {\n          var type = conversation.type,\n              targetId = conversation.targetId;\n          var key = type + '_' + targetId;\n          var hashItem = hashTable[key];\n\n          if (hashItem) {\n            var index = hashItem.index,\n                val = hashItem.val;\n            val = utils.extend(conversation, val);\n            newList[index] = val;\n            hashTable[key].val = val;\n          } else {\n            newList.push(conversation);\n            hashTable[key] = {\n              index: newList.length - 1,\n              val: conversation\n            };\n          }\n        });\n        return newList;\n      };\n\n      Conversation.remove = function remove(option) {\n        var _validate = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'Conversation.remove'),\n            isError = _validate.isError,\n            info = _validate.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [option]\n        });\n      };\n\n      Conversation.getList = function getList(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull(),\n          startTime: Type.Number.canBeNull()\n        }, option, 'Conversation.getList'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CONVERSATION_LIST,\n          args: [option]\n        });\n      };\n\n      Conversation.getTotalUnreadCount = function getTotalUnreadCount() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT\n        });\n      };\n\n      function Conversation(option) {\n        this.type = void 0;\n        this.targetId = void 0;\n\n        var _validate3 = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'new Conversation'),\n            isError = _validate3.isError,\n            jsonInfo = _validate3.jsonInfo;\n\n        if (isError) {\n          return console.error(jsonInfo);\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = Conversation.prototype;\n\n      _proto.send = function send(option) {\n        var _validate4 = validate({\n          objectName: Type.String,\n          content: Type.Object\n        }, option, 'conversation.send'),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var _option = option,\n            objectName = _option.objectName;\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[objectName], option);\n        option = utils.extendInShallow(SEND_MESSAGE_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [this, option]\n        });\n      };\n\n      _proto.recall = function recall(message, option) {\n        var _validate5 = validate({\n          sentTime: Type.Number,\n          messageUId: Type.String\n        }, message, 'conversation.recall'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.RECALL_MESSAGE,\n          args: [this, message, option]\n        });\n      };\n\n      _proto.read = function read(option) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_UNREAD_COUNT,\n          args: [this, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          order: Type.Number.canBeNull(),\n          count: Type.Number.canBeNull(),\n          timestrap: Type.Number.canBeNull()\n        }, option, 'conversation.getMessages'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_MESSAGES_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_HISTORY_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.deleteMessages = function deleteMessages(messages) {\n        var _validate7 = validate([{\n          sentTime: Type.Number,\n          messageUId: Type.String,\n          direction: Type.Number\n        }], messages, 'conversation.deleteMessages'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DELETE_MESSAGES,\n          args: [this, messages]\n        });\n      };\n\n      _proto.clearMessages = function clearMessages(option) {\n        var _validate8 = validate({\n          timestrap: Type.Number\n        }, option, 'conversation.clearMessages'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_MESSAGES,\n          args: [this, option]\n        });\n      };\n\n      _proto.destory = function destory() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [conversation]\n        });\n      };\n\n      return Conversation;\n    }(), _temp;\n  });\n\n  var ChatRoom = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      ChatRoom.get = function get(option) {\n        return new ChatRoom(option);\n      };\n\n      function ChatRoom(option) {\n        this.id = void 0;\n\n        var _validate = validate({\n          id: Type.String\n        }, option, 'new ChatRoom'),\n            isError = _validate.isError,\n            jsonInfo = _validate.jsonInfo;\n\n        if (isError) {\n          return console.error(jsonInfo);\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = ChatRoom.prototype;\n\n      _proto.join = function join(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatroom.join'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_CHATROOM,\n          args: [this]\n        });\n      };\n\n      _proto.getInfo = function getInfo(option) {\n        var _validate3 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull()\n        }, option, 'chatroom.getInfo'),\n            isError = _validate3.isError,\n            info = _validate3.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_INFO_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_INFO,\n          args: [this, option]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var id = this.id;\n        var _option = option,\n            objectName = _option.objectName;\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: id\n        };\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[objectName], option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_MSGS,\n          args: [this, option]\n        });\n      };\n\n      return ChatRoom;\n    }(), _temp;\n  });\n\n  var IM = function () {\n    function IM(option) {\n      this._engineDispatcher = void 0;\n\n      var _validate = validate({\n        appkey: Type.String\n      }, option, 'RongIMLib.init'),\n          isError = _validate.isError,\n          jsonInfo = _validate.jsonInfo;\n\n      if (isError) {\n        throw Error(jsonInfo);\n      }\n\n      option = utils.extendInShallow(IM_OPTION, option);\n      option.connectType = common.getConnectType(option);\n      var engineHandler = new EngineDispatcher(option);\n      this._engineDispatcher = engineHandler;\n      var Modules = {\n        Conversation: Conversation(engineHandler),\n        ChatRoom: ChatRoom(engineHandler)\n      };\n      utils.extend(this, Modules);\n    }\n\n    var _proto = IM.prototype;\n\n    _proto.watch = function watch(watchers) {\n      var _validate2 = validate({\n        conversation: Type.Function.canBeNull(),\n        message: Type.Function.canBeNull(),\n        status: Type.Function.canBeNull()\n      }, watchers, 'im.watch'),\n          isError = _validate2.isError,\n          jsonInfo = _validate2.jsonInfo;\n\n      if (isError) {\n        return console.error(jsonInfo);\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.connect = function connect(user) {\n      var _validate3 = validate({\n        token: Type.String\n      }, user, 'im.connect'),\n          isError = _validate3.isError,\n          info = _validate3.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.CONNECT,\n        args: [user]\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.RECONNECT\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.DISCONNECT\n      });\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      var _validate4 = validate({\n        token: Type.String\n      }, user, 'im.changeUser'),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var self = this;\n      return self.disconnect().then(function () {\n        return self.connect(user);\n      });\n    };\n\n    return IM;\n  }();\n\n  var imInstance;\n\n  var init = function init(option) {\n    if (!imInstance) {\n      imInstance = new IM(option);\n    }\n\n    return imInstance;\n  };\n\n  var index = utils.extend({\n    init: init,\n    env: env,\n    common: common,\n    ERROR_CODE: ERROR_CODE\n  }, CONST);\n\n  return index;\n\n})));\n"
  },
  {
    "path": "api-test/lib/js/RongIMLib-3.0.3.js",
    "content": "/*\n* RongIMLib.js v3.0.3-dev\n* Release Date: Tue Jun 09 2020 15:21:33 GMT+0800 (China Standard Time)\n* Copyright 2020 RongCloud\n* Released under the MIT License.\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongIMLib = factory());\n}(this, (function () { 'use strict';\n\n  var versionToServer = \"3.0.3\";\n\n  var SDK_VERSION = versionToServer;\n\n  var ERROR_INFO = {\n    TIMEOUT: {\n      code: -1,\n      msg: 'Network timeout'\n    },\n    SDK_INTERNAL_ERROR: {\n      code: -2,\n      msg: 'SDK internal error'\n    },\n    PARAMETER_ERROR: {\n      code: -3,\n      msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n    },\n    REJECTED_BY_BLACKLIST: {\n      code: 405,\n      msg: 'Blacklisted by the other party'\n    },\n    SEND_TOO_FAST: {\n      code: 20604,\n      msg: 'Sending messages too quickly'\n    },\n    NOT_IN_GROUP: {\n      code: 22406,\n      msg: 'Not in group'\n    },\n    FORBIDDEN_IN_GROUP: {\n      code: 22408,\n      msg: 'Forbbiden from speaking in the group'\n    },\n    NOT_IN_CHATROOM: {\n      code: 23406,\n      msg: 'Not in chatRoom'\n    },\n    FORBIDDEN_IN_CHATROOM: {\n      code: 23408,\n      msg: 'Forbbiden from speaking in the chatRoom'\n    },\n    KICKED_FROM_CHATROOM: {\n      code: 23409,\n      msg: 'Kicked out and forbbiden from joining the chatRoom'\n    },\n    CHATROOM_NOT_EXIST: {\n      code: 23410,\n      msg: 'ChatRoom does not exist'\n    },\n    CHATROOM_IS_FULL: {\n      code: 23411,\n      msg: 'ChatRoom members exceeded'\n    },\n    PARAMETER_INVALID_CHATROOM: {\n      code: 23412,\n      msg: 'Invalid chatRoom parameters'\n    },\n    ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n      code: 23414,\n      msg: 'ChatRoom message roaming service is not open, Please go to the developer to open this service'\n    },\n    RECALLMESSAGE_PARAMETER_INVALID: {\n      code: 25101,\n      msg: 'Invalid recall message parameter'\n    },\n    PUSHSETTING_PARAMETER_INVALID: {\n      code: 26001,\n      msg: 'Invalid push parameter'\n    },\n    OPERATION_BLOCKED: {\n      code: 20605,\n      msg: 'Operation is blocked'\n    },\n    OPERATION_NOT_SUPPORT: {\n      code: 20606,\n      msg: 'Operation is not supported'\n    },\n    MSG_BLOCKED_SENSITIVE_WORD: {\n      code: 21501,\n      msg: 'The sent message contains sensitive words'\n    },\n    REPLACED_SENSITIVE_WORD: {\n      code: 21502,\n      msg: 'Sensitive words in the message have been replaced'\n    },\n    NOT_CONNECTED: {\n      code: 30001,\n      msg: 'Please connect successfully first'\n    },\n    NAVI_REQUEST_ERROR: {\n      code: 30007,\n      msg: 'Navigation http request failed'\n    },\n    CMP_REQUEST_ERROR: {\n      code: 30010,\n      msg: 'CMP sniff http request failed'\n    },\n    CONN_APPKEY_FAKE: {\n      code: 31002,\n      msg: 'Your appkey is fake'\n    },\n    CONN_MINI_SERVICE_NOT_OPEN: {\n      code: 31003,\n      msg: 'Mini program service is not open, Please go to the developer to open this service'\n    },\n    CONN_TOKEN_INCORRECT: {\n      code: 31004,\n      msg: 'Your token is not valid or expired'\n    },\n    CONN_NOT_AUTHRORIZED: {\n      code: 31005,\n      msg: 'AppKey and Token do not match'\n    },\n    CONN_REDIRECTED: {\n      code: 31006,\n      msg: 'Connection redirection'\n    },\n    CONN_APP_BLOCKED_OR_DELETED: {\n      code: 31008,\n      msg: 'AppKey is banned or deleted'\n    },\n    CONN_USER_BLOCKED: {\n      code: 31009,\n      msg: 'User blocked'\n    },\n    CONN_DOMAIN_INCORRECT: {\n      code: 31012,\n      msg: 'Connect domain error, Please check the set security domain'\n    },\n    ROAMING_SERVICE_UNAVAILABLE: {\n      code: 33007,\n      msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n    },\n    RC_CONNECTION_EXIST: {\n      code: 34001,\n      msg: 'Connection already exists'\n    },\n    CHATROOM_KV_EXCEED: {\n      code: 23423,\n      msg: 'ChatRoom KV setting exceeds maximum'\n    },\n    CHATROOM_KV_OVERWRITE_INVALID: {\n      code: 23424,\n      msg: 'ChatRoom KV already exists'\n    },\n    CHATROOM_KV_STORE_NOT_OPEN: {\n      code: 23426,\n      msg: 'ChatRoom KV storage service is not open, Please go to the developer to open this service'\n    },\n    CHATROOM_KEY_NOT_EXIST: {\n      code: 23427,\n      msg: 'ChatRoom key does not exist'\n    }\n  };\n  var ERROR_CODE = {};\n  var ERROR_CODE_TO_INFO = {};\n\n  for (var name$1 in ERROR_INFO) {\n    var info = ERROR_INFO[name$1];\n    var code = info.code;\n    ERROR_CODE[name$1] = code;\n    ERROR_CODE[code] = name$1;\n    ERROR_CODE_TO_INFO[code] = info;\n  }\n\n  var SERVER_ERROR_TO_CODE = {\n    '1': ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n  };\n\n  var _CONNECT_SERVER_STATU, _SERVER_DISCONNECT_ST, _TRANSPORTER_STATUS_T;\n  var NAVI_ERROR_INFO = {\n    '401': ERROR_INFO.CONN_TOKEN_INCORRECT,\n    '403': ERROR_INFO.CONN_APPKEY_FAKE\n  };\n  var CONNECTION_STATUS = {\n    CONNECTED: 0,\n    CONNECTING: 1,\n    DISCONNECTED: 2,\n    NETWORK_UNAVAILABLE: 3,\n    SOCKET_ERROR: 4,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n    BLOCKED: 12\n  };\n  var SERVER_DISCONNECT_STATUS = {\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 1,\n    BLOCKED: 2\n  };\n  var CONNECT_SERVER_STATUS = {\n    IDENTIFIER_REJECTED: 2,\n    CONN_MINI_SERVICE_NOT_OPEN: 3,\n    TOKEN_INCORRECT: 4,\n    NOT_AUTHORIZED: 5,\n    REDIRECT: 6,\n    PACKAGE_ERROR: 7,\n    APP_BLOCK_OR_DELETE: 8,\n    BLOCK: 9,\n    TOKEN_EXPIRE: 10,\n    DEVICE_ERROR: 11,\n    DOMAIN_INCORRECT: 12\n  };\n  var CONNECT_SERVER_STATUS_MAP_ERROR_INFO = (_CONNECT_SERVER_STATU = {}, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.IDENTIFIER_REJECTED] = ERROR_INFO.CONN_APPKEY_FAKE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.CONN_MINI_SERVICE_NOT_OPEN] = ERROR_INFO.CONN_MINI_SERVICE_NOT_OPEN, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_INCORRECT] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.NOT_AUTHORIZED] = ERROR_INFO.CONN_NOT_AUTHRORIZED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.REDIRECT] = ERROR_INFO.CONN_REDIRECTED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.APP_BLOCK_OR_DELETE] = ERROR_INFO.CONN_APP_BLOCKED_OR_DELETED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.BLOCK] = ERROR_INFO.CONN_USER_BLOCKED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_EXPIRE] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.DOMAIN_INCORRECT] = ERROR_INFO.CONN_DOMAIN_INCORRECT, _CONNECT_SERVER_STATU);\n  var TRANSPORTER_STATUS = {\n    CONNECTED: CONNECTION_STATUS.CONNECTED,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT,\n    BLOCKED: CONNECTION_STATUS.BLOCKED,\n    CLOSE_NORMAL: 1000,\n    CLOSE_GOING_AWAY: 1001,\n    CLOSE_PROTOCOL_ERROR: 1002,\n    CLOSE_UNSUPPORTED: 1003,\n    CLOSE_NO_STATUS: 1005,\n    CLOSE_ABNORMAL: 1006,\n    UNSUPPORTED_DATA: 1007,\n    POLICY_VIOLATION: 1008,\n    CLOSE_TOO_LARGE: 1009,\n    MISSING_EXTENSION: 1010,\n    INTERNAL_ERROR: 1011,\n    SERVICE_RESTART: 1012,\n    TRY_AGAIN_LATER: 1013,\n    TSL_HANDSHAKE: 1015,\n    PING_FIRST_TIMEOUT: 2001,\n    PING_TIMEOUT: 2002,\n    DISCONNECT_TOO_FAST: 2003,\n    EXCEED_MESSAGE_ID_LIMIT: 2004,\n    COMET_REQUEST_ERROR: 2005,\n    MINI_URL_NOT_IN_DOMAIN_LIST: 2006\n  };\n  var MINI_ERROR_MSG_TO_STATUS = {\n    'url not in domain list': TRANSPORTER_STATUS.MINI_URL_NOT_IN_DOMAIN_LIST\n  };\n  var SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS = (_SERVER_DISCONNECT_ST = {}, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT] = TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.BLOCKED] = TRANSPORTER_STATUS.BLOCKED, _SERVER_DISCONNECT_ST);\n  var TRANSPORTER_STATUS_NEED_UPDATE_CMP = [TRANSPORTER_STATUS.CLOSE_NORMAL, TRANSPORTER_STATUS.CLOSE_GOING_AWAY, TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR, TRANSPORTER_STATUS.CLOSE_UNSUPPORTED, TRANSPORTER_STATUS.UNSUPPORTED_DATA, TRANSPORTER_STATUS.POLICY_VIOLATION, TRANSPORTER_STATUS.MISSING_EXTENSION, TRANSPORTER_STATUS.INTERNAL_ERROR, TRANSPORTER_STATUS.SERVICE_RESTART, TRANSPORTER_STATUS.TRY_AGAIN_LATER, TRANSPORTER_STATUS.TSL_HANDSHAKE, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST, TRANSPORTER_STATUS.COMET_REQUEST_ERROR];\n  var TRANSPORTER_STATUS_NEED_RECONNECT = TRANSPORTER_STATUS_NEED_UPDATE_CMP.concat([TRANSPORTER_STATUS.PING_TIMEOUT, TRANSPORTER_STATUS.CLOSE_ABNORMAL, TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT, TRANSPORTER_STATUS.COMET_REQUEST_ERROR]);\n  var TRANSPORTER_STATUS_TO_CONNECTION_STATUS = (_TRANSPORTER_STATUS_T = {}, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_GOING_AWAY] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_UNSUPPORTED] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_NO_STATUS] = CONNECTION_STATUS.DISCONNECTED, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_ABNORMAL] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.DISCONNECT_TOO_FAST] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.UNSUPPORTED_DATA] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.POLICY_VIOLATION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_TOO_LARGE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.MISSING_EXTENSION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.INTERNAL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.SERVICE_RESTART] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TRY_AGAIN_LATER] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TSL_HANDSHAKE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_FIRST_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.COMET_REQUEST_ERROR] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T);\n\n  var CONNECT_TYPE = {\n    COMET: 'comet',\n    WEBSOCKET: 'websocket'\n  };\n  var CONVERSATION_TYPE = {\n    PRIVATE: 1,\n    GROUP: 3,\n    CHATROOM: 4,\n    CUSTOMER_SERVICE: 5,\n    SYSTEM: 6,\n    RTC_ROOM: 12\n  };\n  var MESSAGE_DIRECTION = {\n    SEND: 1,\n    RECEIVE: 2\n  };\n  var MESSAGS_TIME_ORDER = {\n    DESC: 0,\n    ASC: 1\n  };\n  var CHATROOM_ORDER = {\n    ASC: 1,\n    DESC: 2\n  };\n  var RECALL_MESSAGE_TYPE = 'RC:RcCmd';\n  var MENTIOND_TYPE = {\n    ALL: 1,\n    SINGAL: 2\n  };\n  var MESSAGE_TYPE = {\n    TEXT: 'RC:TxtMsg',\n    VOICE: 'RC:VcMsg',\n    HQ_VOICE: 'RC:HQVCMsg',\n    IMAGE: 'RC:ImgMsg',\n    GIF: 'RC:GIFMsg',\n    RICH_CONTENT: 'RC:ImgTextMsg',\n    LOCATION: 'RC:LBSMsg',\n    FILE: 'RC:FileMsg',\n    SIGHT: 'RC:SightMsg',\n    COMBINE: 'RC:CombineMsg',\n    CHRM_KV_NOTIFY: 'RC:chrmKVNotiMsg',\n    LOG_COMMAND: 'RC:LogCmdMsg'\n  };\n  var RTC_API_TYPE = {\n    ROOM: 1,\n    PERSON: 2\n  };\n  var FILE_TYPE = {\n    IMAGE: 1,\n    AUDIO: 2,\n    VIDEO: 3,\n    FILE: 4\n  };\n  var CHATROOM_ENTRY_TYPE = {\n    UPDATE: 1,\n    DELETE: 2\n  };\n  var product = {\n    CONNECT_TYPE: CONNECT_TYPE,\n    CONNECTION_STATUS: CONNECTION_STATUS,\n    CONVERSATION_TYPE: CONVERSATION_TYPE,\n    MESSAGE_DIRECTION: MESSAGE_DIRECTION,\n    MESSAGS_TIME_ORDER: MESSAGS_TIME_ORDER,\n    CHATROOM_ORDER: CHATROOM_ORDER,\n    RECALL_MESSAGE_TYPE: RECALL_MESSAGE_TYPE,\n    MESSAGE_TYPE: MESSAGE_TYPE,\n    MENTIOND_TYPE: MENTIOND_TYPE,\n    SDK_VERSION: SDK_VERSION,\n    FILE_TYPE: FILE_TYPE\n  };\n\n  var IM_TIMEOUT = 30000;\n  var IM_PING_INTERVAL_TIME = 30000;\n  var IM_COMET_PULLMSG_TIMEOUT = 45000;\n  var IM_PING_MAX_TIMEOUT = 6000;\n  var IM_PING_MIN_TIMEOUT = 2000;\n  var HTTP_TIMEOUT = 60000;\n  var PULL_MSG_TIME = 180000;\n  var NAVI_EXPIRED_TIME = 7200000;\n  var CMP_SNIFF_INTERNAL_TIME = 1000;\n  var FIRST_PING_TIMEOUT = 1000;\n  var NAVI_REQUEST_SUCCESS_CODE = 200;\n  var NAVI_SEPARATOR_IN_TOKEN = '@';\n  var DOMAIN_SEPARATOR_IN_NAVLIST = ';';\n  var DOMAIN_SEPARATOR_IN_CMPLIST = ',';\n  var MAX_SINGAL_ID = 65535;\n  var MINIMUM_CONNECT_DURATION = 5000;\n  var CHATROOM_KEY_LENGTH = {\n    MAX: 128,\n    MIN: 1\n  };\n  var CHATROOM_VALUE_LENGTH = {\n    MAX: 4096,\n    MIN: 1\n  };\n  var TYPE_HAS_CONVERSATION = [CONVERSATION_TYPE.PRIVATE, CONVERSATION_TYPE.GROUP, CONVERSATION_TYPE.SYSTEM];\n  var PLATFORM = {\n    WEB: 'web',\n    WX: 'wx',\n    ZFB: 'zfb',\n    TT: 'tt',\n    BAIDU: 'baidu',\n    QUICK_APP: 'quick_app'\n  };\n  var REQUEST_METHOD = {\n    POST: 'post',\n    GET: 'get'\n  };\n  var STORAGE_ROOT_KEY = 'rc-';\n  var STORAGE_DEVICE_ID_KEY = STORAGE_ROOT_KEY + 'deviceId';\n  var STORAGE_SESSION_ID_KEY = STORAGE_ROOT_KEY + 'sessionId';\n  var STORAGE_NAVI = {\n    ROOT_KEY_TPL: 'nav-{appkey}-{UID}',\n    SUB_KEY: {\n      CONNECT_TYPE: 'connettype',\n      TIME_WHEN_SAVED: 'time',\n      RESPONSE: 'resp'\n    }\n  };\n  var STORAGE_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      SENDBOX: 'send',\n      INBOX: 'in'\n    }\n  };\n  var STORAGE_CONVERSATION = {\n    ROOT_KEY_TPL: 'con-{appkey}-{userId}',\n    SUB_KEY: {\n      ROOT_TPL: '{type}-{id}',\n      UNREAD_COUNT: 'c',\n      UNREAD_LAST_TIME: 't',\n      HAS_MENTIOND: 'hm',\n      MENTIOND_INFO: 'm'\n    }\n  };\n  var HTTP_PROTOCOL = {\n    HTTP: 'http:',\n    HTTPS: 'https:',\n    FILE: 'file:'\n  };\n  var WS_PROTOCOL = {\n    WSS: 'wss:',\n    WS: 'ws:'\n  };\n  var NAVI_CALLBACK_NAME = 'getServerEndpoint';\n  var NAVI_TYPE = {\n    COMET: 'cometnavi',\n    WEBSOCKET: 'navi'\n  };\n  var NAVI_URL_TPL = '{url}/{type}.js?appId={appkey}&token={token}&callBack=' + NAVI_CALLBACK_NAME + '&r={random}&v=' + SDK_VERSION;\n  var CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION;\n  var MINI_CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION + '&platform={platform}';\n  var COMET_REQ_HAS_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&topic={topic}&targetid={targetId}&pid={pid}';\n  var COMET_REQ_NO_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&pid={pid}';\n  var COMET_PULL_URL_TPL = '{protocol}//{domain}/pullmsg.js?sessionid={sessionId}&timestrap={timestamp}&pid={pid}';\n  var TIMER_TYPE = {\n    INTERVAL: 'interval',\n    TIMEOUT: 'timeout'\n  };\n  var TIMER_STATUS = {\n    PENNDING: 'pendding',\n    BUSY: 'busy',\n    ENDING: 'ending'\n  };\n  var PLATFORM_TYPE = {\n    MINI: 'Miniprogram',\n    WEB: 'Web'\n  };\n\n  var UnKown = 'UnKown';\n\n  var isMiniEnv = function isMiniEnv(global) {\n    return global !== window;\n  };\n\n  var hasMiniBaseEvent = function hasMiniBaseEvent(miniGlobal) {\n    var baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n\n    for (var i = 0, max = baseMiniEventNames.length; i < max; i++) {\n      var baseEventName = baseMiniEventNames[i];\n\n      if (!miniGlobal[baseEventName]) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n  var getEnvInfo = function getEnvInfo() {\n    if (typeof wx !== 'undefined' && hasMiniBaseEvent(wx)) {\n      return {\n        platform: PLATFORM.WX,\n        global: wx\n      };\n    } else if (typeof swan !== 'undefined' && hasMiniBaseEvent(swan)) {\n      return {\n        platform: PLATFORM.BAIDU,\n        global: swan\n      };\n    } else if (typeof tt !== 'undefined' && hasMiniBaseEvent(tt)) {\n      return {\n        platform: PLATFORM.TT,\n        global: tt\n      };\n    } else if (typeof my !== 'undefined' && hasMiniBaseEvent(my)) {\n      return {\n        platform: PLATFORM.ZFB,\n        global: my\n      };\n    } else {\n      return {\n        platform: PLATFORM.WEB,\n        global: window\n      };\n    }\n  };\n\n  var getWebSystemInfo = function getWebSystemInfo() {\n    var userAgent = navigator.userAgent;\n    var version, type;\n    var condition = {\n      IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n      Edge: /Edge\\/([\\d.]+)/,\n      Firefox: /Firefox\\/([\\d.]+)/,\n      Opera: /(?:OPERA|OPR).([\\d.]+)/,\n      WeiXin: /MicroMessenger\\/([\\d.]+)/,\n      QQBrowser: /QQBrowser\\/([\\d.]+)/,\n      Chrome: /Chrome\\/([\\d.]+)/,\n      Safari: /Version\\/([\\d.]+).*Safari/\n    };\n\n    for (var key in condition) {\n      if (!condition.hasOwnProperty(key)) continue;\n      var browserContent = userAgent.match(condition[key]);\n\n      if (browserContent) {\n        type = key;\n        version = browserContent[1] || browserContent[2];\n        break;\n      }\n    }\n\n    return {\n      model: type || UnKown,\n      version: version || UnKown\n    };\n  };\n\n  var getMiniSystemInfo = function getMiniSystemInfo(global) {\n    var systemInfo = global.getSystemInfoSync() || {};\n    var model = systemInfo.model,\n        brand = systemInfo.brand;\n\n    if (model && brand) {\n      model = model + ' ' + brand;\n    }\n\n    systemInfo.model = model;\n    return systemInfo;\n  };\n\n  var getProtocol = function getProtocol(global) {\n    var location = global.location || {};\n    var isHttp = location.protocol === HTTP_PROTOCOL.HTTP || location.protocol === HTTP_PROTOCOL.FILE;\n    var protocol = {\n      http: isHttp ? HTTP_PROTOCOL.HTTP : HTTP_PROTOCOL.HTTPS,\n      ws: WS_PROTOCOL.WSS\n    };\n\n    if (isHttp) {\n      protocol.ws = WS_PROTOCOL.WS;\n    }\n\n    return protocol;\n  };\n\n  var adaptGlobalObjectCreate = function adaptGlobalObjectCreate(global, isMini) {\n    if (!isMini && !global.Object.create) {\n      global.Object.create = function (o, properties) {\n        if (typeof o !== 'object' && typeof o !== 'function') throw new TypeError('Object prototype may only be an Object: ' + o);else if (o === null) throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support \\'null\\' as the first argument.');\n        if (typeof properties !== 'undefined') throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support a second argument.');\n\n        function F() {}\n\n        F.prototype = o;\n        return new F();\n      };\n    }\n  };\n\n  var getMiniGlobal = function getMiniGlobal(global) {\n    return Object.assign(global, {\n      JSON: JSON,\n      Promise: Promise,\n      setTimeout: setTimeout,\n      setInterval: setInterval,\n      encodeURIComponent: encodeURIComponent,\n      clearTimeout: function (_clearTimeout) {\n        function clearTimeout(_x) {\n          return _clearTimeout.apply(this, arguments);\n        }\n\n        clearTimeout.toString = function () {\n          return _clearTimeout.toString();\n        };\n\n        return clearTimeout;\n      }(function (id) {\n        clearTimeout(id);\n      }),\n      clearInterval: function (_clearInterval) {\n        function clearInterval(_x2) {\n          return _clearInterval.apply(this, arguments);\n        }\n\n        clearInterval.toString = function () {\n          return _clearInterval.toString();\n        };\n\n        return clearInterval;\n      }(function (id) {\n        clearInterval(id);\n      })\n    });\n  };\n\n  var envInfo = getEnvInfo();\n  var platform = envInfo.platform,\n      global$1 = envInfo.global;\n  var isMini = isMiniEnv(global$1);\n  var protocol = getProtocol(global$1);\n  var system = isMini ? getMiniSystemInfo(global$1) : getWebSystemInfo();\n  system.name = platform;\n  adaptGlobalObjectCreate(global$1, isMini);\n  global$1 = isMini ? getMiniGlobal(global$1) : global$1;\n  var env = {\n    global: global$1,\n    system: system,\n    isMini: isMini,\n    protocol: protocol\n  };\n\n  var global$2 = env.global,\n      system$1 = env.system;\n  var isZFB = system$1.name === PLATFORM.ZFB;\n\n  var ZFBStorage = function () {\n    function ZFBStorage() {}\n\n    var _proto = ZFBStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$2.setStorageSync({\n        key: key,\n        data: value\n      });\n    };\n\n    _proto.get = function get(key) {\n      return global$2.getStorageSync({\n        key: key\n      });\n    };\n\n    _proto.remove = function remove(key) {\n      return global$2.removeStorageSync({\n        key: key\n      });\n    };\n\n    _proto.getKeys = function getKeys() {\n      var res = my.getStorageInfoSync();\n      return res.keys;\n    };\n\n    return ZFBStorage;\n  }();\n\n  var MiniStorage = function () {\n    function MiniStorage() {}\n\n    var _proto2 = MiniStorage.prototype;\n\n    _proto2.set = function set(key, value) {\n      global$2.setStorageSync(key, value);\n    };\n\n    _proto2.get = function get(key) {\n      try {\n        return global$2.getStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.remove = function remove(key) {\n      try {\n        return global$2.removeStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.getKeys = function getKeys() {\n      try {\n        var res = global$2.getStorageInfoSync();\n        return res.keys;\n      } catch (e) {\n        return [];\n      }\n    };\n\n    return MiniStorage;\n  }();\n\n  var storage = isZFB ? ZFBStorage : MiniStorage;\n\n  var JSON$1 = {\n    parse: function parse(sJSON) {\n      return new Function('', 'return (' + sJSON + ')')();\n    },\n    stringify: function stringify(value) {\n      return JSON$1.str('', {\n        '': value\n      });\n    },\n    str: function str(key, holder) {\n      var i,\n          k,\n          v,\n          length,\n          partial,\n          value = holder[key],\n          self = JSON$1;\n\n      if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n        value = value.toJSON(key);\n      }\n\n      switch (typeof value) {\n        case 'string':\n          return self.quote(value);\n\n        case 'number':\n          return isFinite(value) ? String(value) : 'null';\n\n        case 'boolean':\n          return String(value);\n\n        case 'object':\n          if (!value) {\n            return 'null';\n          }\n\n          partial = [];\n\n          if (Object.prototype.toString.apply(value) === '[object Array]') {\n            length = value.length;\n\n            for (i = 0; i < length; i += 1) {\n              partial[i] = self.str(i, value) || 'null';\n            }\n\n            v = partial.length === 0 ? '[]' : '[' + partial.join(',') + ']';\n            return v;\n          }\n\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = self.str(k, value);\n\n              if (v) {\n                partial.push(self.quote(k) + ':' + v);\n              }\n            }\n          }\n\n          v = partial.length === 0 ? '{}' : '{' + partial.join(',') + '}';\n          return v;\n      }\n    },\n    quote: function quote(string) {\n      var self = JSON$1;\n      self.rx_escapable.lastIndex = 0;\n      return self.rx_escapable.test(string) ? '\"' + string.replace(self.rx_escapable, function (a) {\n        var c = self.meta[a];\n        return typeof c === 'string' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n      }) + '\"' : '\"' + string + '\"';\n    },\n    rx_escapable: new RegExp(\"[\\\\\\\"\\\\\\\\\\\"\\0-\\x1F\\x7F-\\x9F\\xAD\\u0600-\\u0604\\u070F\\u17B4\\u17B5\\u200C-\\u200F\\u2028-\\u202F\\u2060-\\u206F\\uFEFF\\uFFF0-\\uFFFF]\", 'g'),\n    meta: {\n      '\\b': '\\\\b',\n      '\t': '\\\\t',\n      '\\n': '\\\\n',\n      '\\f': '\\\\f',\n      '\\r': '\\\\r',\n      '\"': '\\\\\"',\n      '\\'\\'': '\\\\\\'\\'',\n      '\\\\': '\\\\\\\\'\n    }\n  };\n\n  var CacheStorage = function () {\n    function CacheStorage(values) {\n      this.caches = {};\n\n      if (values) {\n        this.caches = values;\n      }\n    }\n\n    var _proto = CacheStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      this.caches[key] = value;\n    };\n\n    _proto.remove = function remove(key) {\n      var val = this.get(key);\n      delete this.caches[key];\n      return val;\n    };\n\n    _proto.get = function get(key) {\n      return this.caches[key];\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keys = [];\n\n      for (var key in this.caches) {\n        keys.push(key);\n      }\n\n      return keys;\n    };\n\n    return CacheStorage;\n  }();\n\n  var global$3 = env.global;\n  var TEST_KEY = 'RC_TEST_KEY';\n  var TEST_VALUE = 'RC_TEST_VALUE';\n\n  var isSupportLocalStorage = function isSupportLocalStorage() {\n    var isSupport = false;\n    var localStorage = global$3.localStorage;\n\n    if (localStorage) {\n      try {\n        localStorage.setItem(TEST_KEY, TEST_VALUE);\n        var testVal = localStorage.getItem(TEST_KEY);\n\n        if (testVal === TEST_VALUE) {\n          isSupport = true;\n        }\n\n        localStorage.removeItem(TEST_KEY);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebStorage = function () {\n    function WebStorage() {}\n\n    var _proto = WebStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$3.localStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$3.localStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$3.localStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$3.localStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebStorage;\n  }();\n\n  var WebStorage$1 = isSupportLocalStorage() ? WebStorage : CacheStorage;\n\n  var isMini$1 = env.isMini;\n  var Storage = isMini$1 ? storage : WebStorage$1,\n      storage$1 = new Storage();\n\n  var global$4 = env.global;\n  var TEST_KEY$1 = 'RC_TEST_KEY';\n  var TEST_VALUE$1 = 'RC_TEST_VALUE';\n\n  var isSupportSessionStorage = function isSupportSessionStorage() {\n    var isSupport = false;\n    var sessionStorage = global$4.sessionStorage;\n\n    if (sessionStorage) {\n      try {\n        sessionStorage.setItem(TEST_KEY$1, TEST_VALUE$1);\n        var testVal = sessionStorage.getItem(TEST_KEY$1);\n\n        if (testVal === TEST_VALUE$1) {\n          isSupport = true;\n        }\n\n        sessionStorage.removeItem(TEST_KEY$1);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebSession = function () {\n    function WebSession() {}\n\n    var _proto = WebSession.prototype;\n\n    _proto.set = function set(key, value) {\n      global$4.sessionStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$4.sessionStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$4.sessionStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$4.sessionStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebSession;\n  }();\n\n  var WebSession$1 = isSupportSessionStorage() ? WebSession : CacheStorage;\n\n  var isMini$2 = env.isMini;\n  var Session = isMini$2 ? CacheStorage : WebSession$1,\n      session = new Session();\n\n  var global$5 = env.global;\n\n  var Socket = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      this.socket = global$5.connectSocket(options);\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      this.socket.send({\n        data: data\n      });\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.onOpen(callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.onMessage(callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.onError(callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.onClose(callback);\n    };\n\n    return Socket;\n  }();\n\n  var Socket$1 = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      var url = options.url;\n      this.socket = new WebSocket(url);\n      this.socket.binaryType = 'arraybuffer';\n      return this;\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      return this.socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.addEventListener('open', callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.addEventListener('message', callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.addEventListener('error', callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.addEventListener('close', callback);\n    };\n\n    return Socket;\n  }();\n\n  var isMini$3 = env.isMini;\n  var Socket$2 = isMini$3 ? Socket : Socket$1;\n\n  /*!\n   åŸºäºŽ es6-promise\n   * Github: https://github.com/stefanpenner/es6-promise\n   * @overview es6-promise - a tiny implementation of Promises/A+.\n   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n   * @license   Licensed under MIT license\n   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n   * @version   v4.2.8+1e68dce6\n   */\n  var SparePromise = (function(){function a(a){var b=typeof a;return null!==a&&(\"object\"===b||\"function\"===b)}function b(a){return \"function\"==typeof a}function c(a){P=a;}function d(a){Q=a;}function e(){return function(){return process.nextTick(j)}}function f(){return \"undefined\"!=typeof O?function(){O(j);}:i()}function g(){var a=0,b=new T(j),c=document.createTextNode(\"\");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2;}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.postMessage(0)}}function i(){var a=setTimeout;return function(){return a(j,1)}}function j(){var a,b,c;for(a=0;N>a;a+=2)b=W[a],c=W[a+1],b(c),W[a]=void 0,W[a+1]=void 0;N=0;}function k(){try{var a=Function(\"return this\")().require(\"vertx\");return O=a.runOnLoop||a.runOnContext,f()}catch(b){return i()}}function l(a,b){var e,f,c=this,d=new this.constructor(n);return void 0===d[Y]&&D(d),e=c._state,e?(f=arguments[e-1],Q(function(){return A(e,d,f,c._result)})):y(c,d,a,b),d}function m(a){var c,b=this;return a&&\"object\"==typeof a&&a.constructor===b?a:(c=new b(n),u(c,a),c)}function n(){}function o(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function q(a,b,c,d){try{a.call(b,c,d);}catch(e){return e}}function r(a,b,c){Q(function(a){var d=!1,e=q(c,b,function(c){d||(d=!0,b!==c?u(a,c):w(a,c));},function(b){d||(d=!0,x(a,b));},\"Settle: \"+(a._label||\" unknown promise\"));!d&&e&&(d=!0,x(a,e));},a);}function s(a,b){b._state===$?w(a,b._result):b._state===_?x(a,b._result):y(b,void 0,function(b){return u(a,b)},function(b){return x(a,b)});}function t(a,c,d){c.constructor===a.constructor&&d===l&&c.constructor.resolve===m?s(a,c):void 0===d?w(a,c):b(d)?r(a,c,d):w(a,c);}function u(b,c){if(b===c)x(b,o());else if(a(c)){var d=void 0;try{d=c.then;}catch(e){return void x(b,e)}t(b,c,d);}else w(b,c);}function v(a){a._onerror&&a._onerror(a._result),z(a);}function w(a,b){a._state===Z&&(a._result=b,a._state=$,0!==a._subscribers.length&&Q(z,a));}function x(a,b){a._state===Z&&(a._state=_,a._result=b,Q(v,a));}function y(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+$]=c,e[f+_]=d,0===f&&a._state&&Q(z,a);}function z(a){var d,e,f,g,b=a._subscribers,c=a._state;if(0!==b.length){for(d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0;}}function A(a,c,d,e){var f=b(d),g=void 0,h=void 0,i=!0;if(f){try{g=d(e);}catch(j){i=!1,h=j;}if(c===g)return void x(c,p())}else g=e;c._state!==Z||(f&&i?u(c,g):i===!1?x(c,h):a===$?w(c,g):a===_&&x(c,g));}function B(a,b){try{b(function(b){u(a,b);},function(b){x(a,b);});}catch(c){x(a,c);}}function C(){return ab++}function D(a){a[Y]=ab++,a._state=void 0,a._result=void 0,a._subscribers=[];}function E(){return new Error(\"Array Methods must be provided an Array\")}function F(a){return new bb(this,a).promise}function G(a){var b=this;return new b(M(a)?function(c,d){for(var e=a.length,f=0;e>f;f++)b.resolve(a[f]).then(c,d);}:function(a,b){return b(new TypeError(\"You must pass an array to race.\"))})}function H(a){var b=this,c=new b(n);return x(c,a),c}function I(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function J(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function K(){var c,d,a=void 0;if(\"undefined\"!=typeof global)a=global;else if(\"undefined\"!=typeof self)a=self;else try{a=Function(\"return this\")();}catch(b){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}if(c=a.Promise){d=null;try{d=Object.prototype.toString.call(c.resolve());}catch(b){}if(\"[object Promise]\"===d&&!c.cast)return}a.Promise=cb;}var M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,L=void 0;return L=Array.isArray?Array.isArray:function(a){return \"[object Array]\"===Object.prototype.toString.call(a)},M=L,N=0,O=void 0,P=void 0,Q=function(a,b){W[N]=a,W[N+1]=b,N+=2,2===N&&(P?P(j):X());},R=\"undefined\"!=typeof window?window:void 0,S=R||{},T=S.MutationObserver||S.WebKitMutationObserver,U=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),V=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,W=new Array(1e3),X=void 0,X=U?e():T?g():V?h():void 0===R&&\"function\"==typeof require?k():i(),Y=Math.random().toString(36).substring(2),Z=void 0,$=1,_=2,ab=0,bb=function(){function a(a,b){this._instanceConstructor=a,this.promise=new a(n),this.promise[Y]||D(this.promise),M(b)?(this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(b),0===this._remaining&&w(this.promise,this._result))):x(this.promise,E());}return a.prototype._enumerate=function(a){for(var b=0;this._state===Z&&b<a.length;b++)this._eachEntry(a[b],b);},a.prototype._eachEntry=function(a,b){var e,f,g,i,c=this._instanceConstructor,d=c.resolve;if(d===m){e=void 0,f=void 0,g=!1;try{e=a.then;}catch(h){g=!0,f=h;}e===l&&a._state!==Z?this._settledAt(a._state,b,a._result):\"function\"!=typeof e?(this._remaining--,this._result[b]=a):c===cb?(i=new c(n),g?x(i,f):t(i,a,e),this._willSettleAt(i,b)):this._willSettleAt(new c(function(b){return b(a)}),b);}else this._willSettleAt(d(a),b);},a.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===Z&&(this._remaining--,a===_?x(d,c):this._result[b]=c),0===this._remaining&&w(d,this._result);},a.prototype._willSettleAt=function(a,b){var c=this;y(a,void 0,function(a){return c._settledAt($,b,a)},function(a){return c._settledAt(_,b,a)});},a}(),cb=function(){function a(b){this[Y]=C(),this._result=this._state=void 0,this._subscribers=[],n!==b&&(\"function\"!=typeof b&&I(),this instanceof a?B(this,b):J());}return a.prototype[\"catch\"]=function(a){return this.then(null,a)},a.prototype[\"finally\"]=function(a){var c=this,d=c.constructor;return b(a)?c.then(function(b){return d.resolve(a()).then(function(){return b})},function(b){return d.resolve(a()).then(function(){throw b})}):c.then(a,a)},a}(),cb.prototype.then=l,cb.all=F,cb.race=G,cb.resolve=m,cb.reject=H,cb._setScheduler=c,cb._setAsap=d,cb._asap=Q,cb.polyfill=K,cb.Promise=cb,cb})();\n\n  var global$6 = env.global,\n      system$2 = env.system;\n  var isZFB$1 = system$2.name === PLATFORM.ZFB;\n\n  var zfbRequest = function zfbRequest(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    headers = headers || {};\n    timeout = timeout || HTTP_TIMEOUT;\n    return global$6.httpRequest({\n      url: url,\n      method: method,\n      data: body,\n      headers: headers,\n      timeout: timeout,\n      success: option.success,\n      fail: function fail(result) {\n        if (result.status === 202) {\n          option.success(result);\n        } else {\n          option.fail(result);\n        }\n      }\n    });\n  };\n\n  var request = isZFB$1 ? zfbRequest : global$6.request;\n  var MiniRequest = (function (option) {\n    var success = option.success,\n        fail = option.fail,\n        body = option.body;\n    option.data = option.data || body;\n    var xhr;\n\n    option.success = function (result) {\n      success(result.data, result.statusCode);\n    };\n\n    option.fail = function (result) {\n      fail(result.data, result.statusCode);\n    };\n\n    xhr = request(option);\n    return xhr;\n  });\n\n  var global$7 = env.global;\n\n  var isXDomainRequest = function isXDomainRequest(xhr) {\n    return Object.prototype.toString.call(xhr) === '[object XDomainRequest]' || typeof XDomainRequest === 'object';\n  };\n\n  var isValidRequest = function isValidRequest(obj) {\n    return typeof obj === 'function' || typeof obj === 'object';\n  };\n\n  var createXHR = function createXHR() {\n    var item = {\n      XMLHttpRequest: function (_XMLHttpRequest) {\n        function XMLHttpRequest() {\n          return _XMLHttpRequest.apply(this, arguments);\n        }\n\n        XMLHttpRequest.toString = function () {\n          return _XMLHttpRequest.toString();\n        };\n\n        return XMLHttpRequest;\n      }(function () {\n        return new XMLHttpRequest();\n      }),\n      XDomainRequest: function (_XDomainRequest) {\n        function XDomainRequest() {\n          return _XDomainRequest.apply(this, arguments);\n        }\n\n        XDomainRequest.toString = function () {\n          return _XDomainRequest.toString();\n        };\n\n        return XDomainRequest;\n      }(function () {\n        return new XDomainRequest();\n      }),\n      ActiveXObject: function (_ActiveXObject) {\n        function ActiveXObject() {\n          return _ActiveXObject.apply(this, arguments);\n        }\n\n        ActiveXObject.toString = function () {\n          return _ActiveXObject.toString();\n        };\n\n        return ActiveXObject;\n      }(function () {\n        return new ActiveXObject('Microsoft.XMLHTTP');\n      })\n    };\n    var isXHR = isValidRequest(global$7.XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest();\n    var isXDR = isValidRequest(global$7.XDomainRequest);\n    var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n    return item[key]();\n  };\n\n  var request$1 = function request(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        success = option.success,\n        fail = option.fail,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    var xhr = createXHR();\n    xhr.open(method, url);\n\n    if (headers && xhr.setRequestHeader) {\n      for (var key in headers) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n\n    if ('onload' in xhr) {\n      xhr.onload = function () {\n        success(xhr.responseText, xhr);\n      };\n\n      xhr.onerror = function () {\n        fail(xhr.responseText, xhr);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          var result = xhr.responseText,\n              status = xhr.status;\n\n          if (status === 0) {\n            fail(result, xhr, status);\n          } else {\n            success(result, xhr, status);\n          }\n        }\n      };\n    }\n\n    if (timeout) {\n      xhr.timeout = timeout;\n    }\n\n    if (isXDomainRequest(xhr) && typeof body === 'object') {\n      body = JSON$1.stringify(body);\n    }\n\n    xhr.send(body);\n    return xhr;\n  };\n\n  var request$2 = env.isMini ? MiniRequest : request$1;\n\n  /*\n   * JavaScript MD5\n   * https://github.com/blueimp/JavaScript-MD5\n   *\n   * Copyright 2011, Sebastian Tschan\n   * https://blueimp.net\n   *\n   * Licensed under the MIT license:\n   * https://opensource.org/licenses/MIT\n   *\n   * Based on\n   * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n   * Digest Algorithm, as defined in RFC 1321.\n   * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n   * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n   * Distributed under the BSD License\n   * See http://pajhome.org.uk/crypt/md5 for more info.\n   */\n  var md5 = (function(){function a(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){var h,i,j,k,l,m,n,o,p;for(b[c>>5]|=128<<c%32,b[(c+64>>>9<<4)+14]=c,m=1732584193,n=-271733879,o=-1732584194,p=271733878,h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return [m,n,o,p]}function i(a){var b,c=\"\",d=32*a.length;for(b=0;d>b;b+=8)c+=String.fromCharCode(255&a[b>>5]>>>b%32);return c}function j(a){var b,d,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(d=8*a.length,b=0;d>b;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,g,d=j(a),e=[],f=[];for(e[15]=f[15]=void 0,d.length>16&&(d=h(d,8*a.length)),c=0;16>c;c+=1)e[c]=909522486^d[c],f[c]=1549556828^d[c];return g=h(e.concat(j(b)),512+8*b.length),i(h(f.concat(g),640))}function m(a){var d,e,b=\"0123456789abcdef\",c=\"\";for(e=0;e<a.length;e+=1)d=a.charCodeAt(e),c+=b.charAt(15&d>>>4)+b.charAt(15&d);return c}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s})();\n\n  var global$8 = env.global;\n  var Promise$1 = global$8.Promise;\n\n  var isSupportPromise = function isSupportPromise() {\n    if (!global$8.Promise) return false;\n\n    var defer = function () {\n      return global$8.Promise.resolve();\n    }();\n\n    return defer.then && defer[\"catch\"] && defer[\"finally\"];\n  };\n\n  var setTimeout$1 = function setTimeout(event, timeout) {\n    return global$8.setTimeout(event, timeout);\n  };\n\n  var clearTimeout$1 = function clearTimeout(id) {\n    return global$8.clearTimeout(id);\n  };\n\n  var setInterval$1 = function setInterval(event, timeout) {\n    return global$8.setInterval(event, timeout);\n  };\n\n  var clearInterval$1 = function clearInterval(id) {\n    return global$8.clearInterval(id);\n  };\n\n  var Defer = isSupportPromise() ? global$8.Promise : SparePromise;\n\n  var noop = function noop(data) {\n    return data;\n  };\n\n  var deferNoop = function deferNoop(data) {\n    return Promise$1.resolve(data);\n  };\n\n  var JSON$2 = global$8.JSON || JSON$1;\n\n  var allowError = function allowError(event) {\n    var result;\n\n    try {\n      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n\n      result = event.apply(void 0, args);\n    } catch (e) {\n      result = null;\n    }\n\n    return result;\n  };\n\n  var toJSON = function toJSON(val) {\n    return allowError(JSON$2.stringify, val);\n  };\n\n  var parseJSON = function parseJSON(val) {\n    return allowError(JSON$2.parse, val);\n  };\n\n  var copy = function copy(val) {\n    return parseJSON(toJSON(val));\n  };\n\n  var isObject = function isObject(val) {\n    return Object.prototype.toString.call(val) === '[object Object]';\n  };\n\n  var isArray = function isArray(val) {\n    return Object.prototype.toString.call(val).indexOf('Array') !== -1;\n  };\n\n  var isFunction = function isFunction(val) {\n    return Object.prototype.toString.call(val) === '[object Function]';\n  };\n\n  var isString = function isString(val) {\n    return Object.prototype.toString.call(val) === '[object String]';\n  };\n\n  var isBoolean = function isBoolean(val) {\n    return Object.prototype.toString.call(val) === '[object Boolean]';\n  };\n\n  var isUndefined = function isUndefined(val) {\n    return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  };\n\n  var isNull = function isNull(val) {\n    return Object.prototype.toString.call(val) === '[object Null]';\n  };\n\n  var isNumber = function isNumber(val) {\n    return Object.prototype.toString.call(val) === '[object Number]';\n  };\n\n  var isArrayBuffer = function isArrayBuffer(val) {\n    return Object.prototype.toString.call(val) === '[object ArrayBuffer]';\n  };\n\n  var isPromise = function isPromise(val) {\n    var isTrue = false;\n\n    try {\n      isTrue = Object.prototype.toString.call(val) === '[object Promise]' || val && val.then && val[\"catch\"] && val[\"finally\"];\n    } catch (e) {\n      isTrue = false;\n    }\n\n    return isTrue;\n  };\n\n  var getTypeName = function getTypeName(data) {\n    var typeName = Object.prototype.toString.call(data);\n    return typeName.substring(8, typeName.length - 1);\n  };\n\n  var isEqual = function isEqual(source, target) {\n    return source === target;\n  };\n\n  var ArrayBufferToArray = function ArrayBufferToArray(data) {\n    if (isArrayBuffer(data)) {\n      return [].slice.call(new Int8Array(data));\n    }\n\n    return data;\n  };\n\n  var ArrayBufferToUint8Array = function ArrayBufferToUint8Array(data) {\n    if (isArrayBuffer(data)) {\n      return new Uint8Array(data);\n    }\n\n    return data;\n  };\n\n  var forEach = function forEach(source, event, options) {\n    options = options || {};\n    event = event || noop;\n    var _options = options,\n        isReverse = _options.isReverse;\n\n    var loopObj = function loopObj() {\n      for (var key in source) {\n        event(source[key], key, source);\n      }\n    };\n\n    var loopArr = function loopArr() {\n      if (isReverse) {\n        for (var i = source.length - 1; i >= 0; i--) {\n          event(source[i], i);\n        }\n      } else {\n        for (var j = 0, len = source.length; j < len; j++) {\n          event(source[j], j);\n        }\n      }\n    };\n\n    if (isObject(source)) {\n      loopObj();\n    }\n\n    if (isArray(source) || isString(source)) {\n      loopArr();\n    }\n  };\n\n  var isEmpty = function isEmpty(val) {\n    var result = true;\n\n    if (isObject(val)) {\n      forEach(val, function () {\n        result = false;\n      });\n    }\n\n    if (isString(val) || isArray(val)) {\n      result = val.length === 0;\n    }\n\n    if (isNumber(val)) {\n      result = val === 0;\n    }\n\n    return result;\n  };\n\n  var isNumberData = function isNumberData(val) {\n    var isEmptyVal = isEmpty(val);\n    val = Number(val);\n    return isNumber(val) && !isEmptyVal;\n  };\n\n  var getKeys = function getKeys(obj) {\n    var keyList = [];\n    forEach(obj, function (val, key) {\n      keyList.push(key);\n    });\n    return keyList;\n  };\n\n  var getValues = function getValues(obj) {\n    var valList = [];\n    forEach(obj, function (val) {\n      valList.push(val);\n    });\n    return valList;\n  };\n\n  var getTimestamp = function getTimestamp(time) {\n    return new Date(time).getTime();\n  };\n\n  var getCurrentTimestamp = function getCurrentTimestamp() {\n    return new Date().getTime();\n  };\n\n  var formatTime = function formatTime(timestamp, options) {\n    timestamp = timestamp || getCurrentTimestamp();\n    options = options || {};\n    var temp = options.temp;\n    var date = new Date(timestamp),\n        formateds = {};\n    formateds['YY'] = date.getFullYear();\n    formateds['MM'] = date.getMonth() + 1;\n    formateds['DD'] = date.getDate();\n    formateds['hh'] = date.getHours();\n    formateds['mm'] = date.getMinutes();\n    formateds['ss'] = date.getSeconds();\n    forEach(formateds, function (val, key) {\n      formateds[key] = val >= 10 ? val : '0' + val;\n    });\n\n    if (temp) {\n      var formatedText = temp;\n      forEach(formateds, function (val, key) {\n        formatedText = formatedText.replace(key, val);\n      });\n      return formatedText;\n    }\n\n    return formateds.YY + '-' + formateds.MM + '-' + formateds.DD + ' ' + formateds.hh + ':' + formateds.mm + ':' + formateds.ss;\n  };\n\n  var isValidJSON = function isValidJSON(jsonStr) {\n    if (isObject(jsonStr)) {\n      return true;\n    }\n\n    var isValid = false;\n\n    try {\n      var obj = JSON$2.parse(jsonStr);\n      var str = JSON$2.stringify(obj);\n      isValid = str === jsonStr;\n    } catch (e) {\n      isValid = false;\n    }\n\n    return isValid;\n  };\n\n  var isSupportSocket = function isSupportSocket() {\n    var isMini = env.isMini;\n\n    if (isMini) {\n      return true;\n    }\n\n    var Socket = global$8.WebSocket;\n\n    if (isUndefined(Socket)) {\n      return false;\n    }\n\n    var hasWS = false,\n        isIntegrity = false;\n\n    try {\n      hasWS = typeof Socket === 'object' || typeof Socket === 'function';\n      isIntegrity = typeof Socket.OPEN === 'number';\n    } catch (e) {}\n\n    return hasWS && isIntegrity;\n  };\n\n  var indexOf = function indexOf(source, searchVal) {\n    if (source.indexOf) {\n      return source.indexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    });\n    return index;\n  };\n\n  var lastIndexOf = function lastIndexOf(source, searchVal) {\n    if (source.lastIndexOf) {\n      return source.lastIndexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    }, {\n      isReverse: true\n    });\n    return index;\n  };\n\n  var isInclude = function isInclude(source, searchVal) {\n    var index = indexOf(source, searchVal);\n    return index !== -1;\n  };\n\n  var substring = function substring(source, start, end) {\n    return source.substring(start, end);\n  };\n\n  var spliceByChild = function spliceByChild(arr, item) {\n    forEach(arr, function (child, index) {\n      if (isEqual(child, item)) {\n        arr.splice(index, 1);\n      }\n    }, {\n      isReverse: true\n    });\n  };\n\n  var parse16To10 = function parse16To10(num) {\n    return parseInt(num, 16);\n  };\n\n  var isPlus = function isPlus(num) {\n    return +num === num;\n  };\n\n  var filter = function filter(source, event) {\n    var newArr = [];\n\n    for (var i = 0, max = source.length; i < max; i++) {\n      var data = source[i];\n\n      if (event(data, i)) {\n        newArr.push(data);\n      }\n    }\n\n    return newArr;\n  };\n\n  var map = function map(source, event) {\n    forEach(source, function (item, index) {\n      source[index] = event(item, index);\n    });\n    return source;\n  };\n\n  var extend = function extend(destination, sources) {\n    destination = destination || {};\n    sources = sources || {};\n\n    for (var key in sources) {\n      var value = sources[key];\n\n      if (!isUndefined(value)) {\n        destination[key] = value;\n      }\n    }\n\n    return destination;\n  };\n\n  var extendInShallow = function extendInShallow(destination, sources) {\n    destination = destination || {};\n    sources = sources || {};\n    destination = copy(destination);\n    sources = copy(sources);\n    return extend(destination, sources);\n  };\n\n  var deferred = function deferred(callbacks) {\n    return new Defer(callbacks);\n  };\n\n  var deferTimeout = function deferTimeout(timeout) {\n    return deferred(function (resolve) {\n      var timeouter = setTimeout$1(function () {\n        resolve(timeouter);\n      }, timeout);\n    });\n  };\n\n  var tplEngine = function tplEngine(temp, data, regexp) {\n    var replaceAction = function replaceAction(obj) {\n      return temp.replace(regexp || /{([^}]+)}/g, function (match, name) {\n        if (match.charAt(0) === '\\\\') {\n          return match.slice(1);\n        }\n\n        return obj[name] !== undefined ? obj[name] : '{' + name + '}';\n      });\n    };\n\n    if (!isArray(data)) {\n      data = [data];\n    }\n\n    var ret = [];\n    forEach(data, function (item) {\n      ret.push(replaceAction(item));\n    });\n    return ret.join('');\n  };\n\n  var getRandomNum = function getRandomNum(max, min) {\n    min = min || 0;\n    var range = max - min,\n        random = Math.random();\n    return min + Math.round(random * range);\n  };\n\n  var Timer = function () {\n    function Timer(options) {\n      this._timerId = void 0;\n      this._timerEvent = void 0;\n      this._timerClearEvent = void 0;\n      this.timeout = 0;\n      this.type = TIMER_TYPE.TIMEOUT;\n      this.status = TIMER_STATUS.PENNDING;\n      var self = this;\n      extend(self, options);\n      var type = self.type;\n      var isTimeout = type === TIMER_TYPE.TIMEOUT;\n\n      if (isTimeout) {\n        self._timerEvent = setTimeout$1;\n        self._timerClearEvent = clearTimeout$1;\n      } else {\n        self._timerEvent = setInterval$1;\n        self._timerClearEvent = clearInterval$1;\n      }\n\n      return self;\n    }\n\n    var _proto = Timer.prototype;\n\n    _proto.start = function start(event, options) {\n      options = options || {};\n      var self = this,\n          isTimeout = self.type === TIMER_TYPE.TIMEOUT;\n      var _options2 = options,\n          args = _options2.args,\n          thisArg = _options2.thisArg;\n      self.stop();\n      self._timerId = self._timerEvent.call(global$8, function () {\n        isTimeout && self.stop();\n\n        if (thisArg) {\n          event.apply(thisArg, args);\n        } else {\n          event(args);\n        }\n      }, self.timeout);\n      self.status = TIMER_STATUS.BUSY;\n    };\n\n    _proto.stop = function stop() {\n      var self = this;\n\n      if (self._timerId) {\n        self._timerClearEvent.call(global$8, self._timerId);\n\n        self.status = TIMER_STATUS.ENDING;\n      }\n    };\n\n    return Timer;\n  }();\n\n  var DeferHandler = function () {\n    function DeferHandler(options) {\n      this._list = {};\n      this.timeout = IM_TIMEOUT;\n      extend(this, options);\n    }\n\n    var _proto2 = DeferHandler.prototype;\n\n    _proto2._isInvalid = function _isInvalid(id) {\n      var handlers = this._list[id];\n      return !isArray(handlers) || isEmpty(handlers);\n    };\n\n    _proto2._exec = function _exec(id, isError, data) {\n      var self = this;\n\n      if (self._isInvalid(id)) {\n        return;\n      }\n\n      var handlers = self._list[id],\n          handler = handlers[0];\n      isError ? handler.reject(data) : handler.resolve(data);\n      handlers.splice(0, 1);\n    };\n\n    _proto2.add = function add(id, defer, options) {\n      options = options || {};\n      var self = this;\n      var resolve = defer.resolve,\n          reject = defer.reject;\n      var timeout = options.timeout || self.timeout;\n\n      if (self._isInvalid(id)) {\n        self._list[id] = [];\n      }\n\n      var timer = new Timer({\n        timeout: timeout\n      });\n      timer.start(function () {\n        self.reject(id, ERROR_INFO.TIMEOUT.code);\n      });\n\n      self._list[id].push({\n        resolve: resolve,\n        reject: reject,\n        timer: timer\n      });\n    };\n\n    _proto2.resolve = function resolve(id, data) {\n      this._exec(id, false, data);\n    };\n\n    _proto2.reject = function reject(id, error) {\n      this._exec(id, true, error);\n    };\n\n    return DeferHandler;\n  }();\n\n  var EventEmitter = function () {\n    function EventEmitter() {\n      this._events = void 0;\n      this._events = {};\n    }\n\n    var _proto3 = EventEmitter.prototype;\n\n    _proto3.on = function on(name, event) {\n      var _events = this._events[name] || [];\n\n      _events.push(event);\n\n      this._events[name] = _events;\n    };\n\n    _proto3.off = function off(name, offEvent) {\n      if (offEvent) {\n        var _events = this._events[name] || [];\n\n        spliceByChild(_events, offEvent);\n      } else {\n        delete this._events[name];\n      }\n    };\n\n    _proto3.emit = function emit(name, data, error) {\n      var _events = this._events[name];\n      forEach(_events, function (event) {\n        event(data, error);\n      });\n    };\n\n    _proto3.clear = function clear() {\n      this._events = {};\n    };\n\n    return EventEmitter;\n  }();\n\n  var decodeURI = function decodeURI(uri) {\n    return global$8.decodeURIComponent(uri);\n  };\n\n  var encodeURI = function encodeURI(uri) {\n    return global$8.encodeURIComponent(uri);\n  };\n\n  var int64ToTimestamp = function int64ToTimestamp(obj) {\n    if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n      return obj;\n    }\n\n    var low = obj.low;\n\n    if (low < 0) {\n      low += 0xffffffff + 1;\n    }\n\n    low = low.toString(16);\n    var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n    return timestamp;\n  };\n\n  var batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n    forEach(data, function (item, key) {\n      if (isObject(item)) {\n        data[key] = int64ToTimestamp(item);\n      }\n    });\n    return data;\n  };\n\n  var Queue = function () {\n    function Queue(defaultConfig) {\n      this._isRunning = false;\n      this._list = [];\n      this._defaultConfig = void 0;\n      this._defaultConfig = defaultConfig;\n    }\n\n    var _proto4 = Queue.prototype;\n\n    _proto4.add = function add(params) {\n      params = params || this._defaultConfig;\n\n      this._list.push(params);\n\n      this.run();\n    };\n\n    _proto4.run = function run() {\n      var self = this;\n      var _isRunning = self._isRunning,\n          _list = self._list;\n      var isFinished = isEmpty(_list);\n\n      if (_isRunning || isFinished) {\n        return;\n      }\n\n      var firstItem = _list.splice(0, 1)[0];\n\n      var event = firstItem.event,\n          args = firstItem.args,\n          thisArg = firstItem.thisArg;\n\n      var next = function next() {\n        self._isRunning = false;\n        self.run();\n      };\n\n      if (!event) {\n        return next();\n      }\n\n      self._isRunning = true;\n      event.apply(thisArg, args).then(next)[\"catch\"](next);\n    };\n\n    return Queue;\n  }();\n\n  var secondsToMilliseconds = function secondsToMilliseconds(seconds) {\n    return seconds * 1000;\n  };\n\n  var request$3 = function request(url, options) {\n    options = options || {};\n    return deferred(function (resolve, reject) {\n      options = extend(options, {\n        url: url,\n        success: function success(responseText, xhr, status) {\n          resolve({\n            responseText: responseText,\n            xhr: xhr,\n            status: status\n          });\n        },\n        fail: function fail(result, xhr, status) {\n          reject({\n            result: result,\n            xhr: xhr,\n            status: status\n          });\n        }\n      });\n      request$2(options);\n    });\n  };\n\n  var requestByUrlList = function requestByUrlList(urlList, options) {\n    if (isEmpty(urlList)) {\n      return Defer.reject();\n    }\n\n    var url = urlList[0];\n    return request$3(url, options).then(function (result) {\n      result = result || {};\n      result.urlList = urlList;\n      return result;\n    })[\"catch\"](function (error) {\n      urlList.splice(0, 1);\n\n      if (isEmpty(urlList)) {\n        return Defer.reject(error);\n      } else {\n        return requestByUrlList(urlList, options);\n      }\n    });\n  };\n\n  var requestForFaster = function requestForFaster(urlList, option) {\n    option = option || {};\n    var timeInterval = option.timeInterval || 0;\n    var faildCount = 0,\n        totalCount = urlList.length;\n    var requestXhrs = [];\n    var totalTimer = new Timer({\n      timeout: 15 * 1000\n    });\n    var reqCountdownTimers = [];\n\n    var clearAll = function clearAll() {\n      forEach(reqCountdownTimers, function (timer) {\n        timer.stop();\n      });\n      forEach(requestXhrs, function (xhr) {\n        xhr.abort();\n      });\n      reqCountdownTimers.length = 0;\n      requestXhrs.length = 0;\n    };\n\n    var isAllFaild = function isAllFaild() {\n      return faildCount === totalCount;\n    };\n\n    return deferred(function (resolve, reject) {\n      var _success = function success(url, index) {\n        clearAll();\n        resolve({\n          url: url,\n          index: index\n        });\n      };\n\n      var _fail = function fail() {\n        clearAll();\n        reject();\n      };\n\n      forEach(urlList, function (url, index) {\n        var timer = new Timer({\n          timeout: timeInterval * index\n        });\n        timer.start(function () {\n          var xhr;\n          var opt = extend({\n            url: url,\n            success: function success() {\n              _success(url, index);\n            },\n            fail: function fail() {\n              faildCount++;\n              isAllFaild() && _fail();\n            }\n          }, option);\n          xhr = request$2(opt);\n          requestXhrs.push(xhr);\n        });\n        reqCountdownTimers.push(timer);\n      });\n      totalTimer.start(_fail);\n    });\n  };\n\n  var NetworkDetecter = function () {\n    function NetworkDetecter(option) {\n      this._option = void 0;\n      this._detectCount = 0;\n      this._timeoutId = void 0;\n      this._option = option;\n    }\n\n    var _proto5 = NetworkDetecter.prototype;\n\n    _proto5._detect = function _detect() {\n      var self = this;\n      var _detectCount = self._detectCount,\n          _option = self._option;\n      var url = _option.url,\n          timeout = _option.intervalTime,\n          max = _option.max;\n      _detectCount++;\n      return request$3(url).then(function () {\n        return;\n      }, function (_ref) {\n        var status = _ref.status;\n\n        if (isEqual(status, 404)) {\n          return;\n        }\n\n        var isAlreadyMax = max && isEqual(max, _detectCount);\n\n        if (isAlreadyMax) {\n          return Defer.reject();\n        }\n\n        return deferTimeout(timeout).then(function (timeoutId) {\n          self._detectCount = _detectCount;\n          self._timeoutId = timeoutId;\n          return self._detect();\n        });\n      });\n    };\n\n    _proto5.start = function start() {\n      return this._detect();\n    };\n\n    _proto5.stop = function stop() {\n      var timeoutId = this._timeoutId;\n\n      if (timeoutId) {\n        clearTimeout$1(timeoutId);\n      }\n    };\n\n    return NetworkDetecter;\n  }();\n\n  var toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n    if (isUndefined(startIndex) || isUndefined(endIndex)) {\n      return str.toUpperCase();\n    }\n\n    var sliceStr = str.slice(startIndex, endIndex);\n    str = str.replace(sliceStr, function (text) {\n      return text.toUpperCase();\n    });\n    return str;\n  };\n\n  var getDomainByUrl = function getDomainByUrl(url) {\n    var StartMark = '://',\n        EndMark = '/';\n    var urlProtocolIndex = indexOf(url, StartMark);\n    var hasProtocol = urlProtocolIndex > -1;\n\n    if (hasProtocol) {\n      urlProtocolIndex = urlProtocolIndex + StartMark.length;\n      url = substring(url, urlProtocolIndex, url.length);\n    }\n\n    var urlPathIndex = indexOf(url, EndMark);\n    var hasPath = urlPathIndex > -1;\n\n    if (hasPath) {\n      url = substring(url, 0, urlPathIndex);\n    }\n\n    return url;\n  };\n\n  var getValidUrl = function getValidUrl(url, option) {\n    option = option || {};\n    var ProtocolMark = '://';\n    var hasProtocol = isInclude(url, ProtocolMark);\n    var localProtocol = env.protocol.http;\n    var _option2 = option,\n        protocol = _option2.protocol;\n\n    if (protocol) {\n      var domain = getDomainByUrl(url);\n      url = protocol + \"//\" + domain;\n    }\n\n    if (hasProtocol) {\n      var urlProtocolIndex = indexOf(url, ProtocolMark) + 1;\n      var urlProtocol = substring(url, 0, urlProtocolIndex);\n      var isHttpUrl = urlProtocol === HTTP_PROTOCOL.HTTP;\n      var isLocalHttps = localProtocol === HTTP_PROTOCOL.HTTPS;\n\n      if (isHttpUrl && isLocalHttps) {\n        var _domain = getDomainByUrl(url);\n\n        return HTTP_PROTOCOL.HTTPS + \"//\" + _domain;\n      } else {\n        return url;\n      }\n    } else {\n      return localProtocol + \"//\" + url;\n    }\n  };\n\n  var quickSort = function quickSort(arr, event) {\n    var sort = function sort(array, left, right, event) {\n      event = event || function (a, b) {\n        return a <= b;\n      };\n\n      if (left < right) {\n        var x = array[right],\n            i = left - 1,\n            temp;\n\n        for (var j = left; j <= right; j++) {\n          if (event(array[j], x)) {\n            i++;\n            temp = array[i];\n            array[i] = array[j];\n            array[j] = temp;\n          }\n        }\n\n        sort(array, left, i - 1, event);\n        sort(array, i + 1, right, event);\n      }\n\n      return array;\n    };\n\n    return sort(arr, 0, arr.length - 1, event);\n  };\n\n  var unique = function unique(arr, event) {\n    var keyEvent = event || function (data) {\n      return data;\n    };\n\n    var hashTable = {};\n    var newArr = [];\n    forEach(arr, function (data) {\n      var key = keyEvent(data);\n\n      if (!hashTable[key]) {\n        hashTable[key] = true;\n        newArr.push(data);\n      }\n    });\n    return newArr;\n  };\n\n  var isStackError = function isStackError(error) {\n    error = error || {};\n    return error.stack && error.stack.toString;\n  };\n\n  var consoleError = function consoleError() {\n    var _console;\n\n    return (_console = console).error.apply(_console, arguments);\n  };\n\n  var consoleLog = function consoleLog() {\n    var _console2;\n\n    return (_console2 = console).log.apply(_console2, arguments);\n  };\n\n  var string10to64 = function string10to64(number) {\n    var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''),\n        radix = chars.length + 1,\n        qutient = +number,\n        arr = [];\n\n    do {\n      var mod = qutient % radix;\n      qutient = (qutient - mod) / radix;\n      arr.unshift(chars[mod]);\n    } while (qutient);\n\n    return arr.join('');\n  };\n\n  var getUUID = function getUUID() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      var r = Math.random() * 16 | 0,\n          v = c === 'x' ? r : r & 0x3 | 0x8;\n      return v.toString(16);\n    });\n  };\n\n  var getUUID22 = function getUUID22() {\n    var uuid = getUUID();\n    uuid = uuid.replace(/-/g, '') + 'a';\n    uuid = parseInt(uuid, 16);\n    uuid = string10to64(uuid);\n\n    if (uuid.length > 22) {\n      uuid = uuid.slice(0, 22);\n    } else {\n      var len = 22 - uuid.length;\n\n      for (var i = 0; i < len; i++) {\n        uuid = uuid + '0';\n      }\n    }\n\n    return uuid;\n  };\n\n  var isValidTimestamp = function isValidTimestamp(time) {\n    return isNumber(time) && time !== 0;\n  };\n\n  var utils = {\n    Storage: storage$1,\n    Session: session,\n    Socket: Socket$2,\n    Cache: CacheStorage,\n    JSON: JSON$2,\n    Defer: Defer,\n    httpRequest: request$2,\n    request: request$3,\n    requestByUrlList: requestByUrlList,\n    requestForFaster: requestForFaster,\n    md5: md5,\n    DeferHandler: DeferHandler,\n    EventEmitter: EventEmitter,\n    Timer: Timer,\n    Queue: Queue,\n    consoleError: consoleError,\n    consoleLog: consoleLog,\n    noop: noop,\n    deferNoop: deferNoop,\n    setTimeout: setTimeout$1,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    isObject: isObject,\n    isArray: isArray,\n    isFunction: isFunction,\n    isArrayBuffer: isArrayBuffer,\n    isString: isString,\n    isBoolean: isBoolean,\n    isUndefined: isUndefined,\n    isNull: isNull,\n    isNumber: isNumber,\n    isNumberData: isNumberData,\n    isPromise: isPromise,\n    getTypeName: getTypeName,\n    isPlus: isPlus,\n    isEmpty: isEmpty,\n    isEqual: isEqual,\n    isValidJSON: isValidJSON,\n    isSupportSocket: isSupportSocket,\n    ArrayBufferToArray: ArrayBufferToArray,\n    ArrayBufferToUint8Array: ArrayBufferToUint8Array,\n    indexOf: indexOf,\n    lastIndexOf: lastIndexOf,\n    isInclude: isInclude,\n    substring: substring,\n    getKeys: getKeys,\n    getValues: getValues,\n    getTimestamp: getTimestamp,\n    getCurrentTimestamp: getCurrentTimestamp,\n    formatTime: formatTime,\n    parse16To10: parse16To10,\n    forEach: forEach,\n    map: map,\n    filter: filter,\n    extend: extend,\n    extendInShallow: extendInShallow,\n    deferred: deferred,\n    tplEngine: tplEngine,\n    getRandomNum: getRandomNum,\n    int64ToTimestamp: int64ToTimestamp,\n    batchInt64ToTimestamp: batchInt64ToTimestamp,\n    encodeURI: encodeURI,\n    decodeURI: decodeURI,\n    secondsToMilliseconds: secondsToMilliseconds,\n    NetworkDetecter: NetworkDetecter,\n    toUpperCase: toUpperCase,\n    getDomainByUrl: getDomainByUrl,\n    getValidUrl: getValidUrl,\n    quickSort: quickSort,\n    unique: unique,\n    isStackError: isStackError,\n    getUUID: getUUID,\n    getUUID22: getUUID22,\n    isValidTimestamp: isValidTimestamp\n  };\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__proto__ = superClass;\n  }\n\n  var _PUBLISH_TOPIC_TO_CON, _CONVERSATION_TYPE_TO, _CONVERSATION_TYPE_TO2, _CONVERSATION_TYPE_TO3, _CONVERSATION_TYPE_TO4;\n  var SUCCESS_CODE = 0;\n  var PULL_MSG_TYPE = {\n    NORMAL: 1,\n    CHATROOM: 2\n  };\n  var MESSAGE_NAME = {\n    CONN_ACK: 'ConnAckMessage',\n    DISCONNECT: 'DisconnectMessage',\n    PING_REQ: 'PingReqMessage',\n    PING_RESP: 'PingRespMessage',\n    PUBLISH: 'PublishMessage',\n    PUB_ACK: 'PubAckMessage',\n    QUERY: 'QueryMessage',\n    QUERY_CON: 'QueryConMessage',\n    QUERY_ACK: 'QueryAckMessage'\n  };\n  var QOS = {\n    AT_MOST_ONCE: 0,\n    AT_LEAST_ONCE: 1,\n    EXACTLY_ONCE: 2,\n    DEFAULT: 3,\n    '0': 'AT_MOST_ONCE',\n    '1': 'AT_LEAST_ONCE',\n    '2': 'EXACTLY_ONCE',\n    '3': 'DEFAULT'\n  };\n  var OPERATE_TYPE = {\n    CONNECT: 1,\n    '1': 'CONNECT',\n    CONNACK: 2,\n    '2': 'CONNACK',\n    PUBLISH: 3,\n    '3': 'PUBLISH',\n    PUBACK: 4,\n    '4': 'PUBACK',\n    QUERY: 5,\n    '5': 'QUERY',\n    QUERYACK: 6,\n    '6': 'QUERYACK',\n    QUERYCON: 7,\n    '7': 'QUERYCON',\n    SUBSCRIBE: 8,\n    '8': 'SUBSCRIBE',\n    SUBACK: 9,\n    '9': 'SUBACK',\n    UNSUBSCRIBE: 10,\n    '10': 'UNSUBSCRIBE',\n    UNSUBACK: 11,\n    '11': 'UNSUBACK',\n    PINGREQ: 12,\n    '12': 'PINGREQ',\n    PINGRESP: 13,\n    '13': 'PINGRESP',\n    DISCONNECT: 14,\n    '14': 'DISCONNECT'\n  };\n  var MESSAGE_TAG = {\n    NONE: 0,\n    PERSIT_ONLY: 1,\n    COUNT_ONLY: 2,\n    PERSIT_AND_COUNT: 3\n  };\n  var PUBLISH_TOPIC = {\n    PRIVATE: 'ppMsgP',\n    GROUP: 'pgMsgP',\n    CHATROOM: 'chatMsg',\n    CUSTOMER_SERVICE: 'pcMsgP',\n    RECALL: 'recallMsg',\n    NOTIFY_PULL_MSG: 's_ntf',\n    RECEIVE_MSG: 's_msg',\n    SYNC_STATUS: 's_stat',\n    SERVER_NOTIFY: 's_cmd'\n  };\n  var PUBLISH_STATUS_TOPIC = {\n    PRIVATE: 'ppMsgS',\n    GROUP: 'pgMsgS'\n  };\n  var QUERY_TOPIC = {\n    GET_SYNC_TIME: 'qrySessionsAtt',\n    PULL_MSG: 'pullMsg',\n    GET_CONVERSATION_LIST: 'qrySessions',\n    REMOVE_CONVERSATION_LIST: 'delSessions',\n    DELETE_MESSAGES: 'delMsg',\n    CLEAR_UNREAD_COUNT: 'updRRTime',\n    PULL_CHRM_MSG: 'chrmPull',\n    JOIN_CHATROOM: 'joinChrm',\n    QUIT_CHATROOM: 'exitChrm',\n    GET_CHATROOM_INFO: 'queryChrmI',\n    UPDATE_CHATROOM_KV: 'setKV',\n    DELETE_CHATROOM_KV: 'delKV',\n    PULL_CHATROOM_KV: 'pullKV',\n    GET_OLD_CONVERSATION_LIST: 'qryRelation',\n    REMOVE_OLD_CONVERSATION: 'delRelation',\n    GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n    GET_UPLOAD_FILE_URL: 'qnUrl',\n    CLEAR_MESSAGES: {\n      PRIVATE: 'cleanPMsg',\n      GROUP: 'cleanGMsg',\n      CUSTOMER_SERVICE: 'cleanCMsg',\n      SYSTEM: 'cleanSMsg'\n    },\n    JOIN_RTC_ROOM: 'rtcRJoin_data',\n    QUIT_RTC_ROOM: 'rtcRExit',\n    PING_RTC: 'rtcPing',\n    SET_RTC_DATA: 'rtcSetData',\n    GET_RTC_DATA: 'rtcQryData',\n    DEL_RTC_DATA: 'rtcDelData',\n    SET_RTC_OUT_DATA: 'rtcSetOutData',\n    GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n    GET_RTC_TOKEN: 'rtcToken',\n    SET_RTC_STATE: 'rtcUserState',\n    GET_RTC_ROOM_INFO: 'rtcRInfo',\n    GET_RTC_USER_INFO_LIST: 'rtcUData',\n    SET_RTC_USER_INFO: 'rtcUPut',\n    DEL_RTC_USER_INFO: 'rtcUDel',\n    GET_RTC_USER_LIST: 'rtcUList'\n  };\n  var QUERY_HISTORY_TOPIC = {\n    PRIVATE: 'qryPMsg',\n    GROUP: 'qryGMsg',\n    CHATROOM: 'qryCHMsg',\n    CUSTOMER_SERVICE: 'qryCMsg',\n    SYSTEM: 'qrySMsg'\n  };\n  var CHATROOM_NOTIFY_TYPE = {\n    KV_CHANGED: 2\n  };\n  var CHATROOM_KV_STATUS_CODE = {\n    AUTO_DELETE: 0x0001,\n    OVERWRITE: 0x0002,\n    OPERATE: 0x0004\n  };\n  var PUBLISH_TOPIC_TO_CONVERSATION_TYPE = (_PUBLISH_TOPIC_TO_CON = {}, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CUSTOMER_SERVICE] = CONVERSATION_TYPE.CUSTOMER_SERVICE, _PUBLISH_TOPIC_TO_CON);\n  var CONVERSATION_TYPE_TO_PUBLISH_TOPIC = (_CONVERSATION_TYPE_TO = {}, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.PRIVATE] = PUBLISH_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.GROUP] = PUBLISH_TOPIC.GROUP, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CHATROOM] = PUBLISH_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CUSTOMER_SERVICE] = PUBLISH_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO);\n  var CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC = (_CONVERSATION_TYPE_TO2 = {}, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.PRIVATE] = PUBLISH_STATUS_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.GROUP] = PUBLISH_STATUS_TOPIC.GROUP, _CONVERSATION_TYPE_TO2);\n  var CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC = (_CONVERSATION_TYPE_TO3 = {}, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.PRIVATE] = QUERY_HISTORY_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.GROUP] = QUERY_HISTORY_TOPIC.GROUP, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CHATROOM] = QUERY_HISTORY_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_HISTORY_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.SYSTEM] = QUERY_HISTORY_TOPIC.SYSTEM, _CONVERSATION_TYPE_TO3);\n  var CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC = (_CONVERSATION_TYPE_TO4 = {}, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.PRIVATE] = QUERY_TOPIC.CLEAR_MESSAGES.PRIVATE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.GROUP] = QUERY_TOPIC.CLEAR_MESSAGES.GROUP, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_TOPIC.CLEAR_MESSAGES.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.SYSTEM] = QUERY_TOPIC.CLEAR_MESSAGES.SYSTEM, _CONVERSATION_TYPE_TO4);\n\n  var Header = function () {\n    function Header(_type, _retain, _qos, _dup) {\n      this.type = void 0;\n      this.retain = false;\n      this.qos = QOS.AT_LEAST_ONCE;\n      this.dup = false;\n      this.syncMsg = false;\n      var isPlusType = utils.isPlus(_type);\n\n      if (_type && isPlusType && arguments.length === 1) {\n        this.retain = (_type & 1) > 0;\n        this.qos = (_type & 6) >> 1;\n        this.dup = (_type & 8) > 0;\n        this.type = _type >> 4 & 15;\n        this.syncMsg = (_type & 8) === 8;\n      } else {\n        this.type = _type;\n        this.retain = _retain === undefined ? false : _retain;\n        this.qos = _qos === undefined ? QOS.AT_LEAST_ONCE : _qos;\n        this.dup = _dup === undefined ? false : _dup;\n      }\n    }\n\n    var _proto = Header.prototype;\n\n    _proto.encode = function encode() {\n      var self = this;\n      var validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT];\n      utils.forEach(validQosList, function (qos) {\n        if (self.qos === QOS[qos]) {\n          self.qos = qos;\n        }\n      });\n\n      var _byte = self.type << 4;\n\n      _byte |= self.retain ? 1 : 0;\n      _byte |= self.qos << 1;\n      _byte |= self.dup ? 8 : 0;\n      return _byte;\n    };\n\n    return Header;\n  }();\n\n  var BinaryHelper = {\n    writeUTF: function writeUTF(str, isGetBytes) {\n      var back = [],\n          byteSize = 0;\n      utils.forEach(str, function (_char, i) {\n        var code = str.charCodeAt(i);\n\n        if (code >= 0 && code <= 127) {\n          byteSize += 1;\n          back.push(code);\n        } else if (code >= 128 && code <= 2047) {\n          byteSize += 2;\n          back.push(192 | 31 & code >> 6);\n          back.push(128 | 63 & code);\n        } else if (code >= 2048 && code <= 65535) {\n          byteSize += 3;\n          back.push(224 | 15 & code >> 12);\n          back.push(128 | 63 & code >> 6);\n          back.push(128 | 63 & code);\n        }\n      });\n      utils.forEach(back, function (_char2, i) {\n        if (_char2 > 255) {\n          back[i] &= 255;\n        }\n      });\n\n      if (isGetBytes) {\n        return back;\n      }\n\n      if (byteSize <= 255) {\n        return [0, byteSize].concat(back);\n      } else {\n        return [byteSize >> 8, byteSize & 255].concat(back);\n      }\n    },\n    readUTF: function readUTF(arr) {\n      var UTF = '';\n\n      for (var i = 0, len = arr.length; i < len; i++) {\n        var _char3 = arr[i];\n\n        if (_char3 < 0) {\n          arr[i] += 256;\n        }\n\n        var one = arr[i].toString(2),\n            v = one.match(/^1+?(?=0)/);\n\n        if (v && one.length === 8) {\n          var bytesLength = v[0].length,\n              store = '';\n\n          for (var st = 0; st < bytesLength; st++) {\n            store += arr[st + i].toString(2).slice(2);\n          }\n\n          UTF += String.fromCharCode(parseInt(store, 2));\n          i += bytesLength - 1;\n        } else {\n          UTF += String.fromCharCode(arr[i]);\n        }\n      }\n\n      return UTF;\n    }\n  };\n\n  var RongStreamReader = function () {\n    function RongStreamReader(arr) {\n      this.pool = void 0;\n      this.position = 0;\n      this.poolLen = 0;\n      this.pool = arr;\n      this.poolLen = arr.length;\n    }\n\n    var _proto2 = RongStreamReader.prototype;\n\n    _proto2.check = function check() {\n      return this.position >= this.pool.length;\n    };\n\n    _proto2.readInt = function readInt() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 4; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t.toString();\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readLong = function readLong() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 8; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t;\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readByte = function readByte() {\n      if (this.check()) {\n        return -1;\n      }\n\n      var val = this.pool[this.position++];\n\n      if (val > 255) {\n        val &= 255;\n      }\n\n      return val;\n    };\n\n    _proto2.readUTF = function readUTF() {\n      if (this.check()) {\n        return '';\n      }\n\n      var big = this.readByte() << 8 | this.readByte();\n      var pool = this.pool.subarray(this.position, this.position += big);\n      return BinaryHelper.readUTF(pool);\n    };\n\n    _proto2.readAll = function readAll() {\n      return this.pool.subarray(this.position, this.poolLen);\n    };\n\n    return RongStreamReader;\n  }();\n\n  var RongStreamWriter = function () {\n    function RongStreamWriter() {\n      this.pool = [];\n      this.position = 0;\n      this.writen = 0;\n    }\n\n    var _proto3 = RongStreamWriter.prototype;\n\n    _proto3.write = function write(_byte2) {\n      if (utils.isArray(_byte2)) {\n        this.pool = this.pool.concat(_byte2);\n      } else if (utils.isPlus(_byte2)) {\n        if (_byte2 > 255) {\n          _byte2 &= 255;\n        }\n\n        this.pool.push(_byte2);\n        this.writen++;\n      }\n\n      return _byte2;\n    };\n\n    _proto3.writeArr = function writeArr(_byte3) {\n      this.pool = this.pool.concat(_byte3);\n      return _byte3;\n    };\n\n    _proto3.writeUTF = function writeUTF(str) {\n      var val = BinaryHelper.writeUTF(str);\n      this.pool = this.pool.concat(val);\n      this.writen += val.length;\n    };\n\n    _proto3.getBytesArray = function getBytesArray() {\n      return this.pool;\n    };\n\n    return RongStreamWriter;\n  }();\n\n  var IDENTIFIER = {\n    PUB: 'pub',\n    QUERY: 'qry'\n  };\n\n  var _getIdentifier = function getIdentifier(messageId, identifier) {\n    if (messageId && identifier) {\n      return identifier + '_' + messageId;\n    } else if (messageId) {\n      return messageId;\n    } else {\n      return utils.getCurrentTimestamp();\n    }\n  };\n\n  var BaseReader = function () {\n    function BaseReader(header) {\n      this._name = void 0;\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.messageId = void 0;\n      this.timestamp = void 0;\n      this.identifier = void 0;\n      this._header = header;\n    }\n\n    var _proto = BaseReader.prototype;\n\n    _proto.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto.read = function read(stream, length) {\n      this.readMessage(stream, length);\n    };\n\n    _proto.readMessage = function readMessage(stream, length) {\n      return {\n        stream: stream,\n        length: length\n      };\n    };\n\n    return BaseReader;\n  }();\n\n  var BaseWriter = function () {\n    function BaseWriter(headerType) {\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.data = void 0;\n      this.messageId = void 0;\n      this.topic = void 0;\n      this.targetId = void 0;\n      this.identifier = void 0;\n      this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n    }\n\n    var _proto2 = BaseWriter.prototype;\n\n    _proto2.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto2.write = function write(stream) {\n      var headerCode = this.getHeaderFlag();\n      stream.write(headerCode);\n      this.writeMessage(stream);\n    };\n\n    _proto2.writeMessage = function writeMessage(stream) {\n      return stream;\n    };\n\n    _proto2.setHeaderQos = function setHeaderQos(qos) {\n      this._header.qos = qos;\n    };\n\n    _proto2.getHeaderFlag = function getHeaderFlag() {\n      return this._header.encode();\n    };\n\n    _proto2.getLengthSize = function getLengthSize() {\n      return this.lengthSize;\n    };\n\n    _proto2.getBufferData = function getBufferData() {\n      var stream = new RongStreamWriter();\n      this.write(stream);\n      var val = stream.getBytesArray();\n      var binary = new Int8Array(val);\n      return binary;\n    };\n\n    _proto2.getCometData = function getCometData() {\n      var data = this.data || {};\n      return utils.toJSON(data);\n    };\n\n    return BaseWriter;\n  }();\n\n  var ConnAckReader = function (_BaseReader) {\n    _inheritsLoose(ConnAckReader, _BaseReader);\n\n    function ConnAckReader() {\n      var _this;\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this = _BaseReader.call.apply(_BaseReader, [this].concat(args)) || this;\n      _this._name = MESSAGE_NAME.CONN_ACK;\n      _this.status = void 0;\n      _this.userId = void 0;\n      _this.timestamp = void 0;\n      return _this;\n    }\n\n    var _proto3 = ConnAckReader.prototype;\n\n    _proto3.readMessage = function readMessage(stream, msgLength) {\n      stream.readByte();\n      this.status = +stream.readByte();\n\n      if (msgLength > ConnAckReader.MESSAGE_LENGTH) {\n        this.userId = stream.readUTF();\n        stream.readUTF();\n        this.timestamp = stream.readLong();\n      }\n    };\n\n    return ConnAckReader;\n  }(BaseReader);\n\n  ConnAckReader.MESSAGE_LENGTH = 2;\n\n  var DisconnectReader = function (_BaseReader2) {\n    _inheritsLoose(DisconnectReader, _BaseReader2);\n\n    function DisconnectReader() {\n      var _this2;\n\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      _this2 = _BaseReader2.call.apply(_BaseReader2, [this].concat(args)) || this;\n      _this2._name = MESSAGE_NAME.DISCONNECT;\n      _this2.status = void 0;\n      return _this2;\n    }\n\n    var _proto4 = DisconnectReader.prototype;\n\n    _proto4.readMessage = function readMessage(stream) {\n      stream.readByte();\n      this.status = +stream.readByte();\n    };\n\n    return DisconnectReader;\n  }(BaseReader);\n\n  DisconnectReader.MESSAGE_LENGTH = 2;\n\n  var PingReqWriter = function (_BaseWriter) {\n    _inheritsLoose(PingReqWriter, _BaseWriter);\n\n    function PingReqWriter() {\n      var _this3;\n\n      _this3 = _BaseWriter.call(this, OPERATE_TYPE.PINGREQ) || this;\n      _this3._name = MESSAGE_NAME.PING_REQ;\n      return _this3;\n    }\n\n    return PingReqWriter;\n  }(BaseWriter);\n\n  var PingRespReader = function (_BaseReader3) {\n    _inheritsLoose(PingRespReader, _BaseReader3);\n\n    function PingRespReader() {\n      var _this4;\n\n      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n        args[_key3] = arguments[_key3];\n      }\n\n      _this4 = _BaseReader3.call.apply(_BaseReader3, [this].concat(args)) || this;\n      _this4._name = MESSAGE_NAME.PING_RESP;\n      return _this4;\n    }\n\n    return PingRespReader;\n  }(BaseReader);\n\n  var RetryableReader = function (_BaseReader4) {\n    _inheritsLoose(RetryableReader, _BaseReader4);\n\n    function RetryableReader() {\n      var _this5;\n\n      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n        args[_key4] = arguments[_key4];\n      }\n\n      _this5 = _BaseReader4.call.apply(_BaseReader4, [this].concat(args)) || this;\n      _this5.messageId = void 0;\n      return _this5;\n    }\n\n    var _proto5 = RetryableReader.prototype;\n\n    _proto5.readMessage = function readMessage(stream) {\n      var msgId = stream.readByte() * 256 + stream.readByte();\n      this.messageId = parseInt(msgId, 10);\n    };\n\n    return RetryableReader;\n  }(BaseReader);\n\n  var RetryableWriter = function (_BaseWriter2) {\n    _inheritsLoose(RetryableWriter, _BaseWriter2);\n\n    function RetryableWriter() {\n      var _this6;\n\n      for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n        args[_key5] = arguments[_key5];\n      }\n\n      _this6 = _BaseWriter2.call.apply(_BaseWriter2, [this].concat(args)) || this;\n      _this6.messageId = void 0;\n      return _this6;\n    }\n\n    var _proto6 = RetryableWriter.prototype;\n\n    _proto6.writeMessage = function writeMessage(stream) {\n      var id = this.messageId;\n      var lsb = id & 255;\n      var msb = (id & 65280) >> 8;\n      stream.write(msb);\n      stream.write(lsb);\n    };\n\n    return RetryableWriter;\n  }(BaseWriter);\n\n  var PublishReader = function (_RetryableReader) {\n    _inheritsLoose(PublishReader, _RetryableReader);\n\n    function PublishReader() {\n      var _this7;\n\n      for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n        args[_key6] = arguments[_key6];\n      }\n\n      _this7 = _RetryableReader.call.apply(_RetryableReader, [this].concat(args)) || this;\n      _this7._name = MESSAGE_NAME.PUBLISH;\n      _this7.topic = void 0;\n      _this7.data = void 0;\n      _this7.targetId = void 0;\n      _this7.date = void 0;\n      _this7.syncMsg = false;\n      _this7.identifier = IDENTIFIER.PUB;\n      return _this7;\n    }\n\n    var _proto7 = PublishReader.prototype;\n\n    _proto7.readMessage = function readMessage(stream) {\n      this.date = stream.readInt();\n      this.topic = stream.readUTF();\n      this.targetId = stream.readUTF();\n      RetryableReader.prototype.readMessage.apply(this, arguments);\n      this.data = stream.readAll();\n    };\n\n    return PublishReader;\n  }(RetryableReader);\n\n  var PublishWriter = function (_RetryableWriter) {\n    _inheritsLoose(PublishWriter, _RetryableWriter);\n\n    function PublishWriter(topic, data, targetId) {\n      var _this8;\n\n      _this8 = _RetryableWriter.call(this, OPERATE_TYPE.PUBLISH) || this;\n      _this8._name = MESSAGE_NAME.PUBLISH;\n      _this8.topic = void 0;\n      _this8.data = void 0;\n      _this8.targetId = void 0;\n      _this8.date = void 0;\n      _this8.syncMsg = false;\n      _this8.identifier = IDENTIFIER.PUB;\n      _this8.topic = topic;\n      _this8.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this8.targetId = targetId;\n      return _this8;\n    }\n\n    var _proto8 = PublishWriter.prototype;\n\n    _proto8.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.apply(this, arguments);\n      stream.write(this.data);\n    };\n\n    return PublishWriter;\n  }(RetryableWriter);\n\n  var PubAckReader = function (_RetryableReader2) {\n    _inheritsLoose(PubAckReader, _RetryableReader2);\n\n    function PubAckReader() {\n      var _this9;\n\n      for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n        args[_key7] = arguments[_key7];\n      }\n\n      _this9 = _RetryableReader2.call.apply(_RetryableReader2, [this].concat(args)) || this;\n      _this9._name = MESSAGE_NAME.PUB_ACK;\n      _this9.status = void 0;\n      _this9.date = 0;\n      _this9.data = void 0;\n      _this9.millisecond = 0;\n      _this9.messageUId = void 0;\n      _this9.timestamp = 0;\n      _this9.identifier = IDENTIFIER.PUB;\n      return _this9;\n    }\n\n    var _proto9 = PubAckReader.prototype;\n\n    _proto9.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.millisecond = stream.readByte() * 256 + stream.readByte();\n      this.timestamp = this.date * 1000 + this.millisecond;\n      this.messageUId = stream.readUTF();\n    };\n\n    return PubAckReader;\n  }(RetryableReader);\n\n  var PubAckWriter = function (_RetryableWriter2) {\n    _inheritsLoose(PubAckWriter, _RetryableWriter2);\n\n    function PubAckWriter(messageId) {\n      var _this10;\n\n      _this10 = _RetryableWriter2.call(this, OPERATE_TYPE.PUBACK) || this;\n      _this10._name = MESSAGE_NAME.PUB_ACK;\n      _this10.status = void 0;\n      _this10.date = 0;\n      _this10.millisecond = 0;\n      _this10.messageUId = void 0;\n      _this10.timestamp = 0;\n      _this10.messageId = messageId;\n      return _this10;\n    }\n\n    var _proto10 = PubAckWriter.prototype;\n\n    _proto10.writeMessage = function writeMessage(stream) {\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n    };\n\n    return PubAckWriter;\n  }(RetryableWriter);\n\n  var QueryWriter = function (_RetryableWriter3) {\n    _inheritsLoose(QueryWriter, _RetryableWriter3);\n\n    function QueryWriter(topic, data, targetId) {\n      var _this11;\n\n      _this11 = _RetryableWriter3.call(this, OPERATE_TYPE.QUERY) || this;\n      _this11._name = MESSAGE_NAME.QUERY;\n      _this11.topic = void 0;\n      _this11.data = void 0;\n      _this11.targetId = void 0;\n      _this11.identifier = IDENTIFIER.QUERY;\n      _this11.topic = topic;\n      _this11.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this11.targetId = targetId;\n      return _this11;\n    }\n\n    var _proto11 = QueryWriter.prototype;\n\n    _proto11.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n      stream.write(this.data);\n    };\n\n    return QueryWriter;\n  }(RetryableWriter);\n\n  var QueryConWriter = function (_RetryableWriter4) {\n    _inheritsLoose(QueryConWriter, _RetryableWriter4);\n\n    function QueryConWriter(messageId) {\n      var _this12;\n\n      _this12 = _RetryableWriter4.call(this, OPERATE_TYPE.QUERYCON) || this;\n      _this12._name = MESSAGE_NAME.QUERY_CON;\n      _this12.messageId = messageId;\n      return _this12;\n    }\n\n    return QueryConWriter;\n  }(RetryableWriter);\n\n  var QueryAckReader = function (_RetryableReader3) {\n    _inheritsLoose(QueryAckReader, _RetryableReader3);\n\n    function QueryAckReader() {\n      var _this13;\n\n      for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n        args[_key8] = arguments[_key8];\n      }\n\n      _this13 = _RetryableReader3.call.apply(_RetryableReader3, [this].concat(args)) || this;\n      _this13._name = MESSAGE_NAME.QUERY_ACK;\n      _this13.data = void 0;\n      _this13.status = void 0;\n      _this13.date = void 0;\n      _this13.identifier = IDENTIFIER.QUERY;\n      return _this13;\n    }\n\n    var _proto12 = QueryAckReader.prototype;\n\n    _proto12.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.data = stream.readAll();\n    };\n\n    return QueryAckReader;\n  }(RetryableReader);\n\n  var getReaderByHeader = function getReaderByHeader(header) {\n    var type = header.type,\n        msg = new BaseReader(header);\n\n    switch (type) {\n      case OPERATE_TYPE.CONNACK:\n        msg = new ConnAckReader(header);\n        break;\n\n      case OPERATE_TYPE.PUBLISH:\n        msg = new PublishReader(header);\n        msg.syncMsg = header.syncMsg;\n        break;\n\n      case OPERATE_TYPE.PUBACK:\n        msg = new PubAckReader(header);\n        break;\n\n      case OPERATE_TYPE.QUERYACK:\n        msg = new QueryAckReader(header);\n        break;\n\n      case OPERATE_TYPE.SUBACK:\n      case OPERATE_TYPE.UNSUBACK:\n      case OPERATE_TYPE.PINGRESP:\n        msg = new PingRespReader(header);\n        break;\n\n      case OPERATE_TYPE.DISCONNECT:\n        msg = new DisconnectReader(header);\n        break;\n\n      default:\n        throw new Error('No support for deserializing ' + type + ' messages');\n    }\n\n    return msg;\n  };\n\n  var readWSBuffer = function readWSBuffer(data) {\n    var arr = new Uint8Array(data);\n    var stream = new RongStreamReader(arr);\n    var flags = stream.readByte(),\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    msg.read(stream, arr.length - 1);\n    return msg;\n  };\n\n  var readCometData = function readCometData(data) {\n    var flags = data.headerCode,\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    utils.forEach(data, function (item, key) {\n      if (key in msg) {\n        msg[key] = item;\n      }\n    });\n    return msg;\n  };\n\n  var ENGINE_EVENT = {\n    WATCH: 'watch',\n    UN_WATCH: 'unwatch',\n    CONNECT: 'connect',\n    RECONNECT: 'reconnect',\n    DISCONNECT: 'disconnect',\n    CHANGE_USER: 'changeUser',\n    GET_CONNECTION_STATUS: 'getConnectionStatus',\n    GET_CONNECTION_USER_ID: 'getConnectionUserId',\n    GET_CONNECTED_TIME: 'getConnectedTime',\n    GET_APP_INFO: 'getAppInfo',\n    GET_CONVERSATION_LIST: 'getConversationList',\n    REMOVE_CONVERSATION_LIST: 'removeConversationList',\n    REMOVE_CONVERSATION: 'removeConversation',\n    GET_TOTAL_UNREAD_COUNT: 'getTotalUnreadCount',\n    CLEAR_UNREAD_COUNT: 'clearUnreadCount',\n    GET_LOCAL_CONVERSATION: 'getLocalConversation',\n    SEND_MESSAGE: 'sendMessage',\n    GET_HISTORY_MSGS: 'getHistoryMessages',\n    DELETE_MESSAGES: 'deleteHistoryMessages',\n    CLEAR_MESSAGES: 'clearHistoryMessages',\n    RECALL_MESSAGE: 'recallMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    QUIT_CHATROOM: 'quitChatRoom',\n    GET_CHATROOM_INFO: 'getChatRoomInfo',\n    GET_CHATROOM_MSGS: 'getChatRoomHistoryMessages',\n    SET_KV: 'setChatRoomKV',\n    FORCE_SET_KV: 'forceSetChatRoomKV',\n    DEL_KV: 'removeChatRoomKV',\n    FORCE_DEL_KV: 'forceRemoveChatRoomKV',\n    GET_KV: 'getChatRoomKV',\n    GET_ALL_KV: 'getAllChatRoomKV',\n    JOIN_RTC: 'joinRTCRoom',\n    QUIT_RTC: 'quitRTCRoom',\n    PING_RTC: 'RTCPing',\n    GET_RTC_ROOM_INFO: 'getRTCRoomInfo',\n    SET_RTC_DATA: 'setRTCData',\n    GET_RTC_DATA: 'getRTCData',\n    DEL_RTC_DATA: 'removeRTCData',\n    SET_RTC_OUT_DATA: 'setRTCOutData',\n    GET_RTC_OUT_DATA: 'getRTCOutData',\n    GET_RTC_TOKEN: 'getRTCToken',\n    SET_RTC_STATE: 'setRTCState',\n    GET_RTC_USER_INFO_LIST: 'getRTCUserInfoList',\n    SET_RTC_USER_INFO: 'setRTCUserInfo',\n    DEL_RTC_USER_INFO: 'removeRTCUserInfo',\n    GET_RTC_USER_LIST: 'getRTCUserList',\n    GET_UPLOAD_TOKEN: 'getFileToken',\n    GET_UPLOAD_URL: 'getFileUrl'\n  };\n  var ENGINE_EVENT_NEED_CONNECTED = [ENGINE_EVENT.GET_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION, ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT, ENGINE_EVENT.CLEAR_UNREAD_COUNT, ENGINE_EVENT.SEND_MESSAGE, ENGINE_EVENT.GET_HISTORY_MSGS, ENGINE_EVENT.DELETE_MESSAGES, ENGINE_EVENT.CLEAR_MESSAGES, ENGINE_EVENT.RECALL_MESSAGE, ENGINE_EVENT.JOIN_CHATROOM, ENGINE_EVENT.QUIT_CHATROOM, ENGINE_EVENT.GET_CHATROOM_INFO, ENGINE_EVENT.GET_CHATROOM_MSGS];\n  var ENGINE_EVENT_NEED_DISCONNECTED = [ENGINE_EVENT.CONNECT, ENGINE_EVENT.RECONNECT];\n  var IM_EVENT = {\n    STATUS: 'status',\n    MESSAGE: 'message',\n    CONVERSATION: 'conversation'\n  };\n  var TRANSPORT_EVENT = {\n    SIGNAL: 'signal',\n    STATUS: 'status'\n  };\n  var SERVER_EVENT_NAME = {\n    STATUS: 'status',\n    NOTIFY_PULL: 'notifyPull',\n    DIRECT_MSG: 'directMessage',\n    CHRM_KV_CHANGED: 'chatRoomKV',\n    CHRM_KV_SET: 'chatRoomKVSet',\n    MESSAGE_SEND: 'sendMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    BEFORE_JOIN_CHATROOM: 'beforeJoinChatRoom'\n  };\n\n  var _APP_ENGINE_EVENT_LOG;\n  var PLATFORM$1 = 'Web';\n  var LEVEL = {\n    FATAL: 0,\n    ERROR: 1,\n    WARN: 2,\n    INFO: 3,\n    DEBUG: 4\n  };\n  var STORE_SIZE = {\n    ADVANCED: 500,\n    LOW: 500\n  };\n  var LOG_TYPE = {\n    'IM': 'IM',\n    'RTC': 'RTC'\n  };\n  var TAG = {\n    L_GET_NAVI_T: 'L-get_navi-T',\n    L_GET_NAVI_R: 'L-get_navi-R',\n    L_PING_WS_T: 'L-ping_ws-T',\n    L_PING_WS_R: 'L-ping_ws-R',\n    L_NETWORK_CHANGED_S: 'L-network_changed-S',\n    L_DECODE_MSG_E: 'L-decode_msg-E',\n    L_RECONNECT_T: 'L-reconnect-T',\n    L_RECONNECT_R: 'L-reconnect-R',\n    L_PULL_CHRM_KV_T: 'L-pull-chrm-kv-T',\n    L_PULL_CHRM_KV_R: 'L-pull-chrm-kv-R',\n    L_PING_S: 'L-ping-S',\n    L_CRASH_F: 'L-crash_web-F',\n    A_INIT_O: 'A-init-O',\n    A_CONNECT_T: 'A-connect-T',\n    A_CONNECT_R: 'A-connect-R',\n    A_DISCONNECT_T: 'A-disconnect-T',\n    A_DISCONNECT_R: 'A-disconnect-R',\n    A_RECONNECT_T: 'A-reconnect-T',\n    A_RECONNECT_R: 'A-reconnect-R',\n    A_JOIN_CHATROOM_T: 'A-join_chatroom-T',\n    A_JOIN_CHATROOM_R: 'A-join_chatroom-R',\n    A_QUIT_CHATROOM_T: 'A-quit_chatroom-T',\n    A_QUIT_CHATROOM_R: 'A-quit_chatroom-R',\n    P_NOTIFY_CHRM_KV_S: 'P-notify-chrm-kv-R',\n    G_CRASH_E: 'G-crash-E',\n    G_UPLOAD_LOG_S: 'G-upload_log-S',\n    G_UPLOAD_LOG_E: 'G-upload_log-E'\n  };\n  var APP_ENGINE_EVENT_LOG_TAG = (_APP_ENGINE_EVENT_LOG = {}, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.CONNECT] = {\n    req: TAG.A_CONNECT_T,\n    resp: TAG.A_CONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.DISCONNECT] = {\n    req: TAG.A_DISCONNECT_T,\n    resp: TAG.A_DISCONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.RECONNECT] = {\n    req: TAG.A_RECONNECT_T,\n    resp: TAG.A_RECONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.JOIN_CHATROOM] = {\n    req: TAG.A_JOIN_CHATROOM_T,\n    resp: TAG.A_JOIN_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.QUIT_CHATROOM] = {\n    req: TAG.A_QUIT_CHATROOM_T,\n    resp: TAG.A_QUIT_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG);\n  var REPORT_TYPE = {\n    REALTIME: 0,\n    FULL: 1\n  };\n  var CSV_LOG_TPL = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n  var REALTIME_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var MSGNOTIF_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var LOG_CMD_MSG_SENDER = 'rongcloudsystem';\n  var NO_FULL_LOG = 'nodata';\n  var REQUEST_TIMEOUT = 15000;\n  var DEFAULT_SERVER_OPTION = {\n    isOpen: true,\n    url: 'logcollection.ronghub.com',\n    realtimeLevel: LEVEL.ERROR,\n    realtimeInterval: 20000,\n    realtimeMaxTimes: 5,\n    fullInterval: 5000,\n    fullMaxTimes: 3,\n    fullLevel: LEVEL.DEBUG\n  };\n\n  var isEmpty$1 = utils.isEmpty,\n      tplEngine$1 = utils.tplEngine,\n      getRandomNum$1 = utils.getRandomNum;\n\n  var getTransporterUrl = function getTransporterUrl(option) {\n    var domain = option.domain,\n        appkey = option.appkey,\n        token = option.token,\n        connectType = option.connectType,\n        protocol = option.protocol;\n    var isComet = connectType === CONNECT_TYPE.COMET;\n    var cmpTpl = CMP_URL_TPL;\n\n    if (isEmpty$1(protocol)) {\n      protocol = isComet ? env.protocol.http : env.protocol.ws;\n    }\n\n    var tplOption = {\n      domain: domain,\n      appkey: appkey,\n      protocol: protocol,\n      apiVer: getRandomNum$1(1e6),\n      token: utils.encodeURI(token)\n    };\n\n    if (env.isMini) {\n      cmpTpl = MINI_CMP_URL_TPL;\n      utils.extend(tplOption, {\n        platform: PLATFORM_TYPE.MINI\n      });\n    }\n\n    return tplEngine$1(cmpTpl, tplOption);\n  };\n\n  var isGroup = function isGroup(type) {\n    return type === CONVERSATION_TYPE.GROUP;\n  };\n\n  var isChatRoom = function isChatRoom(type) {\n    return type === CONVERSATION_TYPE.CHATROOM;\n  };\n\n  var getConversationTypeList = function getConversationTypeList() {\n    return utils.getValues(CONVERSATION_TYPE);\n  };\n\n  var isValidConversationType = function isValidConversationType(type) {\n    var conversationTypeList = getConversationTypeList();\n    return utils.isNumber(type) && utils.isInclude(conversationTypeList, type);\n  };\n\n  var getSessionId = function getSessionId(option) {\n    var isStatusMessage = option.isStatusMessage;\n    var isPersited = option.isPersited,\n        isCounted = option.isCounted,\n        isMentiond = option.isMentiond;\n\n    if (isStatusMessage) {\n      isPersited = isCounted = false;\n    }\n\n    var sessionId = 0;\n\n    if (isPersited) {\n      sessionId = sessionId | 0x01;\n    }\n\n    if (isCounted) {\n      sessionId = sessionId | 0x02;\n    }\n\n    if (isMentiond) {\n      sessionId = sessionId | 0x04;\n    }\n\n    return sessionId;\n  };\n\n  var getPersitedAndCountedBySessionId = function getPersitedAndCountedBySessionId(sessionId) {\n    var isPersited, isCounted;\n\n    switch (sessionId) {\n      case MESSAGE_TAG.COUNT_ONLY:\n        isPersited = false;\n        isCounted = true;\n        break;\n\n      case MESSAGE_TAG.PERSIT_ONLY:\n        isPersited = true;\n        isCounted = false;\n        break;\n\n      case MESSAGE_TAG.NONE:\n        isPersited = isCounted = false;\n        break;\n\n      case MESSAGE_TAG.PERSIT_AND_COUNT:\n      default:\n        isPersited = isCounted = true;\n        break;\n    }\n\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted\n    };\n  };\n\n  var getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n    var isPersited = true,\n        isCounted = true,\n        isMentiond = false;\n    isPersited = !!(status & 0x10);\n    isCounted = !!(status & 0x20);\n    isMentiond = !!(status & 0x40);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond\n    };\n  };\n\n  var SignalId = {\n    ids: {},\n    temp: '{appkey}_{userId}',\n    get: function get(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      var id = SignalId.ids[key] || 0;\n      id++;\n      SignalId.ids[key] = id;\n      return id;\n    },\n    clear: function clear(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      SignalId.ids[key] = 0;\n    },\n    isExceedLimit: function isExceedLimit(id) {\n      return id > MAX_SINGAL_ID;\n    }\n  };\n\n  var RCSocket = function () {\n    function RCSocket(options) {\n      this._socket = void 0;\n      this.eventEmitter = new utils.EventEmitter();\n      this.KEY = {\n        OPEN: 'open',\n        MSG: 'msg',\n        ERROR: 'error',\n        CLOSE: 'close'\n      };\n      var self = this;\n      var KEY = self.KEY;\n      self._socket = new utils.Socket(options);\n\n      self._socket.onOpen(function (data) {\n        self.eventEmitter.emit(KEY.OPEN, data);\n      });\n\n      self._socket.onMessage(function (data) {\n        self.eventEmitter.emit(KEY.MSG, data);\n      });\n\n      self._socket.onError(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.ERROR, data);\n      });\n\n      self._socket.onClose(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.CLOSE, data);\n      });\n    }\n\n    var _proto = RCSocket.prototype;\n\n    _proto._formatCloseData = function _formatCloseData(data) {\n      if (env.isMini) {\n        data = data || {};\n        var _data = data,\n            errMsg = _data.errMsg;\n        data.code = MINI_ERROR_MSG_TO_STATUS[errMsg];\n      }\n\n      return data;\n    };\n\n    _proto.send = function send(data) {\n      return this._socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.eventEmitter.clear();\n\n      this._socket.close();\n    };\n\n    _proto.onOpen = function onOpen(event) {\n      this.eventEmitter.on(this.KEY.OPEN, event);\n    };\n\n    _proto.onMessage = function onMessage(event) {\n      this.eventEmitter.on(this.KEY.MSG, event);\n    };\n\n    _proto.onError = function onError(event) {\n      this.eventEmitter.on(this.KEY.ERROR, event);\n    };\n\n    _proto.onClose = function onClose(event) {\n      this.eventEmitter.on(this.KEY.CLOSE, event);\n    };\n\n    return RCSocket;\n  }();\n\n  var RCStorage = function () {\n    function RCStorage(suffix) {\n      var _ref;\n\n      this._cache = void 0;\n      this.STORAGE_KEY = void 0;\n      var storageKey = suffix ? STORAGE_ROOT_KEY + suffix : STORAGE_ROOT_KEY;\n      var localCache = utils.Storage.get(storageKey) || {};\n      this._cache = new utils.Cache((_ref = {}, _ref[storageKey] = localCache, _ref));\n      this.STORAGE_KEY = storageKey;\n    }\n\n    var _proto2 = RCStorage.prototype;\n\n    _proto2._get = function _get() {\n      var KEY = this.STORAGE_KEY;\n      return this._cache.get(KEY) || {};\n    };\n\n    _proto2._set = function _set(cache) {\n      var KEY = this.STORAGE_KEY;\n      cache = cache || {};\n\n      this._cache.set(KEY, cache);\n\n      utils.Storage.set(KEY, cache);\n    };\n\n    _proto2.set = function set(key, value) {\n      var localValue = this._get();\n\n      localValue[key] = value;\n\n      this._set(localValue);\n    };\n\n    _proto2.remove = function remove(key) {\n      var localValue = this._get();\n\n      delete localValue[key];\n\n      this._set(localValue);\n    };\n\n    _proto2.clear = function clear() {\n      var KEY = this.STORAGE_KEY;\n      utils.Storage.remove(KEY);\n\n      this._cache.remove(KEY);\n    };\n\n    _proto2.get = function get(key) {\n      var localValue = this._get();\n\n      return localValue[key];\n    };\n\n    _proto2.getKeys = function getKeys() {\n      var localValue = this._get();\n\n      return utils.getKeys(localValue);\n    };\n\n    _proto2.getValues = function getValues() {\n      return this._get() || {};\n    };\n\n    return RCStorage;\n  }();\n\n  var formatSyncTime = function formatSyncTime(_syncTime) {\n    _syncTime = _syncTime || {};\n    _syncTime.inboxTime = _syncTime.inboxTime || 0;\n    _syncTime.sendboxTime = _syncTime.sendboxTime || 0;\n    return _syncTime;\n  };\n\n  var MessageTimeSyner = function () {\n    function MessageTimeSyner(option) {\n      this._syncTime = void 0;\n      this._storage = void 0;\n      option = option || {};\n      var _option = option,\n          startSyncTime = _option.startSyncTime;\n\n      this._initStorage(option);\n\n      if (startSyncTime) {\n        this._syncTime = formatSyncTime(startSyncTime);\n      }\n    }\n\n    var _proto3 = MessageTimeSyner.prototype;\n\n    _proto3._initStorage = function _initStorage(option) {\n      var appkey = option.appkey,\n          userId = option.userId;\n      var ROOT_KEY = utils.tplEngine(STORAGE_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      var storage = new RCStorage(ROOT_KEY);\n      var syncTime = {\n        sendboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX),\n        inboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.INBOX)\n      };\n      this._storage = storage;\n      this._syncTime = formatSyncTime(syncTime);\n    };\n\n    _proto3.setInbox = function setInbox(time) {\n      var beforeTime = this._syncTime.inboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.inboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.INBOX, time);\n      }\n    };\n\n    _proto3.setSendbox = function setSendbox(time) {\n      var beforeTime = this._syncTime.sendboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.sendboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX, time);\n      }\n    };\n\n    _proto3.setByMessage = function setByMessage(msg) {\n      var messageDirection = msg.messageDirection,\n          sentTime = msg.sentTime;\n      var isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND;\n      isSelfSend ? this.setSendbox(sentTime) : this.setInbox(sentTime);\n    };\n\n    _proto3.get = function get() {\n      return formatSyncTime(this._syncTime);\n    };\n\n    return MessageTimeSyner;\n  }();\n\n  var ChatRoomMessageTimeSyner = function () {\n    function ChatRoomMessageTimeSyner() {\n      this._pullTimes = {};\n    }\n\n    var _proto4 = ChatRoomMessageTimeSyner.prototype;\n\n    _proto4.set = function set(chrmId, time) {\n      this._pullTimes[chrmId] = time;\n    };\n\n    _proto4.get = function get(chrmId) {\n      return this._pullTimes[chrmId] || 0;\n    };\n\n    _proto4.setByMessage = function setByMessage(msg) {\n      var sentTime = msg.sentTime;\n      var chrmId = msg.targetId;\n      var beforeTime = this.get(chrmId);\n\n      if (beforeTime < sentTime) {\n        this.set(chrmId, sentTime);\n      }\n    };\n\n    return ChatRoomMessageTimeSyner;\n  }();\n\n  var getUIDByToken = function getUIDByToken(token) {\n    return utils.md5(token).slice(8, 16);\n  };\n\n  var isIncludeNavi = function isIncludeNavi(token) {\n    return utils.isInclude(token, NAVI_SEPARATOR_IN_TOKEN);\n  };\n\n  var getNaviListByToken = function getNaviListByToken(token) {\n    var navDomainList = [];\n\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      var navsText = token.substring(separatorIndex + 1, token.length);\n      var domainList = navsText.split(DOMAIN_SEPARATOR_IN_NAVLIST);\n      utils.forEach(domainList, function (domain) {\n        if (!isEmpty$1(domain)) {\n          navDomainList.push(domain);\n        }\n      });\n    }\n\n    return navDomainList;\n  };\n\n  var getCMPDomainList = function getCMPDomainList(option, customOption) {\n    var server = option.server,\n        backupServer = option.backupServer;\n    server = server || '';\n    backupServer = backupServer || '';\n    var backupCMPList = backupServer.split(DOMAIN_SEPARATOR_IN_CMPLIST);\n    var cmpList = [];\n\n    if (!utils.isEmpty(server)) {\n      cmpList.push(server);\n    }\n\n    utils.forEach(backupCMPList, function (cmp) {\n      if (!utils.isEmpty(cmp)) {\n        cmpList.push(cmp);\n      }\n    });\n\n    if (!utils.isUndefined(customOption.customCMP)) {\n      cmpList = customOption.customCMP;\n    }\n\n    return cmpList;\n  };\n\n  var getValidToken = function getValidToken(token) {\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      token = token.substring(0, separatorIndex + 1);\n    }\n\n    return token;\n  };\n\n  var getConnectType = function getConnectType(option) {\n    var connectType = option.connectType;\n    var isSpecifiedSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var isSocket = isSpecifiedSocket && utils.isSupportSocket();\n    return isSocket ? CONNECT_TYPE.WEBSOCKET : CONNECT_TYPE.COMET;\n  };\n\n  var isConnected = function isConnected(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTED);\n  };\n\n  var isConnecting = function isConnecting(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTING);\n  };\n\n  var isDisconnected = function isDisconnected(status) {\n    return !isConnected(status) && !isConnecting(status);\n  };\n\n  var getNavReqOption = function getNavReqOption(option, user) {\n    option = utils.copy(option);\n    option.token = user.token;\n    return option;\n  };\n\n  var getPingTimeout = function getPingTimeout(timeSpentConnect) {\n    var timeout = timeSpentConnect * 3;\n\n    if (timeout < IM_PING_MIN_TIMEOUT) {\n      return IM_PING_MIN_TIMEOUT;\n    }\n\n    if (timeout > IM_PING_MAX_TIMEOUT) {\n      return IM_PING_MAX_TIMEOUT;\n    }\n\n    return timeout;\n  };\n\n  var fixConversationData = function fixConversationData(conversation) {\n    conversation = conversation || {};\n    conversation.latestMessage = conversation.latestMessage || {};\n    conversation.latestMessage.sentTime = conversation.latestMessage.sentTime || 0;\n    return conversation;\n  };\n\n  var sortConversationList = function sortConversationList(conversationList) {\n    return utils.quickSort(conversationList, function (before, after) {\n      before = fixConversationData(before);\n      after = fixConversationData(after);\n      return after.latestMessage.sentTime <= before.latestMessage.sentTime;\n    });\n  };\n\n  var DelayTimer = {\n    _delayTime: 0,\n    setTime: function setTime(time) {\n      var currentTime = utils.getCurrentTimestamp();\n      DelayTimer._delayTime = currentTime - time;\n    },\n    getTime: function getTime() {\n      var delayTime = DelayTimer._delayTime;\n      var currentTime = utils.getCurrentTimestamp();\n      return currentTime - delayTime;\n    }\n  };\n\n  var isSupportStatusMessage = function isSupportStatusMessage(type) {\n    return !!CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n  };\n\n  var getConversationKey = function getConversationKey(option) {\n    var type = option.type,\n        targetId = option.targetId;\n    return type + '_' + targetId;\n  };\n\n  var getChatRoomKVOptStatus = function getChatRoomKVOptStatus(entity, action) {\n    var status = 0;\n\n    if (entity.isAutoDelete) {\n      status = status | CHATROOM_KV_STATUS_CODE.AUTO_DELETE;\n    }\n\n    if (entity.isOverwrite) {\n      status = status | CHATROOM_KV_STATUS_CODE.OVERWRITE;\n    }\n\n    if (utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE)) {\n      status = status | CHATROOM_KV_STATUS_CODE.OPERATE;\n    }\n\n    return status;\n  };\n\n  var getChatRoomKVByStatus = function getChatRoomKVByStatus(status) {\n    var isDeleteOpt = !!(status & CHATROOM_KV_STATUS_CODE.OPERATE);\n    return {\n      isAutoDelete: !!(status & CHATROOM_KV_STATUS_CODE.AUTO_DELETE),\n      isOverwrite: !!(status & CHATROOM_KV_STATUS_CODE.OVERWRITE),\n      type: isDeleteOpt ? CHATROOM_ENTRY_TYPE.DELETE : CHATROOM_ENTRY_TYPE.UPDATE\n    };\n  };\n\n  var TextCompressor = {\n    _dataType: {\n      Tail: 0x30,\n      Compressed: 0x40,\n      NormalExt: 0x50,\n      Normal: 0x60,\n      Mark: 0x70\n    },\n    _chars: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n    _scale: 62,\n    _max: 238327,\n    _indexOf: function _indexOf(map, source, fromIndex) {\n      var result = {\n        length: 0,\n        offset: -1\n      };\n\n      if (fromIndex >= source.length - 1) {\n        return result;\n      }\n\n      var c1 = source.charAt(fromIndex);\n      var c2 = source.charAt(fromIndex + 1);\n      var items = map[c1 + c2];\n\n      if (items[0] === fromIndex) {\n        return result;\n      }\n\n      var space1 = source.length - fromIndex;\n\n      for (var i = 0, len = items.length; i < len; i++) {\n        var item = items[i];\n        var space2 = fromIndex - item;\n\n        if (space2 > TextCompressor._max) {\n          continue;\n        }\n\n        var end = Math.min(space1, space2);\n\n        if (end <= result.length) {\n          break;\n        }\n\n        if (result.length > 2) {\n          if (source.charAt(item + result.length - 1) !== source.charAt(fromIndex + result.length - 1)) {\n            continue;\n          }\n        }\n\n        var m = 2;\n\n        for (var j = m; j < end; j++) {\n          if (source.charAt(item + j) === source.charAt(fromIndex + j)) {\n            m++;\n          } else {\n            break;\n          }\n        }\n\n        if (m >= result.length) {\n          result.length = m;\n          result.offset = item;\n        }\n      }\n\n      return result;\n    },\n    _numberEncode: function _numberEncode(num) {\n      var result = [],\n          remainder = 0;\n\n      do {\n        remainder = num % TextCompressor._scale;\n        result.push(TextCompressor._chars.charAt(remainder));\n        num = (num - remainder) / TextCompressor._scale;\n      } while (num > 0);\n\n      return result.join('');\n    },\n    _numberDecode: function _numberDecode(str) {\n      var num = 0,\n          index = 0;\n\n      for (var i = str.length - 1; i >= 0; i--) {\n        index = TextCompressor._chars.indexOf(str.charAt(i));\n\n        if (index === -1) {\n          throw new Error('decode number error, data is \\'' + str + '\\'');\n        }\n\n        num = num * TextCompressor._scale + index;\n      }\n\n      return num;\n    },\n    compress: function compress(data) {\n      var map = {};\n\n      for (var p = 0; p < data.length - 1; p++) {\n        var c1 = data.charAt(p);\n        var c2 = data.charAt(p + 1);\n        var c = c1 + c2;\n\n        if (!map.hasOwnProperty(c)) {\n          map[c] = [p];\n          continue;\n        }\n\n        map[c].push(p);\n      }\n\n      var compressedData = [],\n          normalBlockBuffer = [];\n\n      var encodeNormalBlock = function encodeNormalBlock() {\n        if (normalBlockBuffer.length > 0) {\n          var normalBlock = normalBlockBuffer.join('');\n          normalBlockBuffer = [];\n\n          if (normalBlock.length > 26) {\n            var normalExtBlockLength = TextCompressor._numberEncode(normalBlock.length);\n\n            var normalExtBlockHeader = String.fromCharCode(TextCompressor._dataType.NormalExt | normalExtBlockLength.length);\n            compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n          } else {\n            var normalBlockHeader = String.fromCharCode(TextCompressor._dataType.Normal | normalBlock.length);\n            compressedData.push(normalBlockHeader);\n          }\n\n          compressedData.push(normalBlock);\n        }\n      };\n\n      var i = 0;\n\n      while (i < data.length) {\n        var r = TextCompressor._indexOf(map, data, i);\n\n        if (r.length < 2) {\n          normalBlockBuffer.push(data.charAt(i++));\n          continue;\n        }\n\n        if (r.length < 4) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        var offset = TextCompressor._numberEncode(i - r.offset);\n\n        var length = TextCompressor._numberEncode(r.length);\n\n        if (offset.length + length.length >= r.length) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        encodeNormalBlock();\n        var compressedBlockHeader = String.fromCharCode(TextCompressor._dataType.Compressed | offset.length << 2 | length.length);\n        compressedData.push(compressedBlockHeader + offset + length);\n        i += r.length;\n      }\n\n      encodeNormalBlock();\n\n      var dataLengthTo62 = TextCompressor._numberEncode(data.length);\n\n      var tailBlockHeader = String.fromCharCode(TextCompressor._dataType.Tail | dataLengthTo62.length);\n      compressedData.push(tailBlockHeader + dataLengthTo62);\n      return compressedData.join('');\n    },\n    uncompress: function uncompress(data) {\n      var i = 0;\n      var result = '';\n\n      label1: do {\n        var header = data.charCodeAt(i++);\n        var headerType = header & TextCompressor._dataType.Mark;\n        var headerVal = header & 0xF;\n\n        switch (headerType) {\n          case TextCompressor._dataType.Compressed:\n            var p1 = headerVal >> 2;\n            var p2 = headerVal & 3;\n\n            if (p1 === 0 || p2 === 0) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            var offset = TextCompressor._numberDecode(data.substr(i, p1));\n\n            var len = TextCompressor._numberDecode(data.substr(i += p1, p2));\n\n            offset = result.length - offset;\n\n            if (offset + len > result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += p2;\n            result += result.substr(offset, len);\n            break;\n\n          case TextCompressor._dataType.Tail:\n            var num = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            if (num !== result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += headerVal;\n            break label1;\n\n          case TextCompressor._dataType.NormalExt:\n            var normalNum = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            result += data.substr(i += headerVal, normalNum);\n            i += normalNum;\n            break;\n\n          case TextCompressor._dataType.Normal:\n            result += data.substr(i, headerVal);\n            i += headerVal;\n            break;\n\n          case TextCompressor._dataType.Mark:\n            if (headerVal > 10) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            result += data.substr(i, 16 + headerVal);\n            i += 16 + headerVal;\n            break;\n\n          default:\n            throw new Error('Data parsing error,at ' + i + ' header:' + headerType);\n        }\n      } while (i < data.length);\n\n      return result;\n    }\n  };\n\n  var isBelowIE = function isBelowIE(version) {\n    var system = env.system;\n    var flag = system.model === 'IE' && Number(system.version) < version ? true : false;\n    return flag;\n  };\n\n  var stringToCsv = function stringToCsv(str) {\n    var csvStr = str.replace(/\"/g, '\"\"');\n    var tpl = '\"{csvStr}\"';\n    return tplEngine$1(tpl, {\n      csvStr: csvStr\n    });\n  };\n\n  var getWebSessionId = function getWebSessionId() {\n    var sessionId = utils.Session.get(STORAGE_SESSION_ID_KEY);\n\n    if (utils.isEmpty(sessionId)) {\n      sessionId = utils.getUUID22().slice(0, 10);\n      utils.Session.set(STORAGE_SESSION_ID_KEY, sessionId);\n    }\n\n    return sessionId;\n  };\n\n  var getDeviceId = function getDeviceId() {\n    var deviceId = utils.Storage.get(STORAGE_DEVICE_ID_KEY);\n\n    if (utils.isEmpty(deviceId)) {\n      deviceId = utils.getUUID22();\n      utils.Storage.set(STORAGE_DEVICE_ID_KEY, deviceId);\n    }\n\n    return deviceId;\n  };\n\n  var getDeviceInfo = function getDeviceInfo() {\n    var tpl = '{brower}|{version}|{sessionId}';\n    return tplEngine$1(tpl, {\n      brower: env.system.model,\n      version: env.system.version,\n      sessionId: getWebSessionId()\n    });\n  };\n\n  var getReportLogUrl = function getReportLogUrl(params) {\n    var entireUrl = '',\n        protocol = env.protocol.http + '//';\n    var urlConf = {\n      protocol: protocol,\n      url: params.url,\n      version: SDK_VERSION,\n      appkey: params.appkey,\n      deviceId: getDeviceId(),\n      deviceInfo: getDeviceInfo(),\n      platform: PLATFORM$1,\n      userId: params.userId\n    };\n\n    switch (params.type) {\n      case REPORT_TYPE.REALTIME:\n        entireUrl = tplEngine$1(REALTIME_URL_TPL, urlConf);\n        break;\n\n      case REPORT_TYPE.FULL:\n        entireUrl = tplEngine$1(MSGNOTIF_URL_TPL, utils.extend(urlConf, {\n          logId: params.logId\n        }));\n        break;\n\n      default:\n        break;\n    }\n\n    return entireUrl;\n  };\n\n  var isLogCommandMsg = function isLogCommandMsg(msg) {\n    var content = msg.content;\n    return msg.messageType === MESSAGE_TYPE.LOG_COMMAND && msg.senderUserId === LOG_CMD_MSG_SENDER && content.platform === 'Web';\n  };\n\n  var isValidChatRoomKey = function isValidChatRoomKey(key) {\n    if (!utils.isString(key)) {\n      return;\n    }\n\n    var isValid = /^[A-Za-z0-9_=+-]+$/.test(key),\n        keyLen = key.length,\n        isLimit = keyLen <= CHATROOM_KEY_LENGTH.MAX && keyLen >= CHATROOM_KEY_LENGTH.MIN;\n    return isValid && isLimit;\n  };\n\n  var isValidChatRoomValue = function isValidChatRoomValue(value) {\n    if (!utils.isString(value)) {\n      return;\n    }\n\n    var valLen = value.length;\n    return valLen <= CHATROOM_VALUE_LENGTH.MAX && valLen >= CHATROOM_VALUE_LENGTH.MIN;\n  };\n\n  var common = {\n    isConnected: isConnected,\n    isConnecting: isConnecting,\n    isDisconnected: isDisconnected,\n    getConnectType: getConnectType,\n    getTransporterUrl: getTransporterUrl,\n    isGroup: isGroup,\n    isChatRoom: isChatRoom,\n    getConversationTypeList: getConversationTypeList,\n    isValidConversationType: isValidConversationType,\n    getUIDByToken: getUIDByToken,\n    getSessionId: getSessionId,\n    getMessageOptionByStatus: getMessageOptionByStatus,\n    getPersitedAndCountedBySessionId: getPersitedAndCountedBySessionId,\n    SignalId: SignalId,\n    MessageTimeSyner: MessageTimeSyner,\n    ChatRoomMessageTimeSyner: ChatRoomMessageTimeSyner,\n    getCMPDomainList: getCMPDomainList,\n    getNaviListByToken: getNaviListByToken,\n    getValidToken: getValidToken,\n    RCSocket: RCSocket,\n    RCStorage: RCStorage,\n    getNavReqOption: getNavReqOption,\n    getPingTimeout: getPingTimeout,\n    fixConversationData: fixConversationData,\n    sortConversationList: sortConversationList,\n    DelayTimer: DelayTimer,\n    isSupportStatusMessage: isSupportStatusMessage,\n    getConversationKey: getConversationKey,\n    getChatRoomKVOptStatus: getChatRoomKVOptStatus,\n    getChatRoomKVByStatus: getChatRoomKVByStatus,\n    TextCompressor: TextCompressor,\n    isBelowIE: isBelowIE,\n    getReportLogUrl: getReportLogUrl,\n    isLogCommandMsg: isLogCommandMsg,\n    getWebSessionId: getWebSessionId,\n    getDeviceId: getDeviceId,\n    stringToCsv: stringToCsv,\n    isValidChatRoomKey: isValidChatRoomKey,\n    isValidChatRoomValue: isValidChatRoomValue\n  };\n\n  var EventEmitter$1 = utils.EventEmitter,\n      DeferHandler$1 = utils.DeferHandler,\n      Timer$1 = utils.Timer;\n  var RCSocket$1 = common.RCSocket;\n  var TransHandlerID = {\n    CONNECT: 'connect',\n    PING: 'ping'\n  };\n\n  var Heartbeat = function () {\n    function Heartbeat(transporter, option) {\n      this._transporter = void 0;\n      this._timer = void 0;\n      option = option || {};\n      var timeout = option.timeout;\n      this._transporter = transporter;\n      this._timer = new Timer$1({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: timeout\n      });\n    }\n\n    var _proto = Heartbeat.prototype;\n\n    _proto.check = function check(timeout) {\n      var _transporter = this._transporter;\n      var _deferHandler = _transporter._deferHandler;\n      var pingReqSignal = new PingReqWriter();\n\n      _transporter.sendSignal(pingReqSignal);\n\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.PING, {\n          resolve: resolve,\n          reject: reject\n        }, {\n          timeout: timeout\n        });\n      });\n    };\n\n    _proto.start = function start(timeout, onError) {\n      var self = this;\n\n      self._timer.start(function () {\n        self.check(timeout).then(utils.noop)[\"catch\"](onError);\n      });\n    };\n\n    _proto.stop = function stop() {\n      this._timer && this._timer.stop();\n    };\n\n    return Heartbeat;\n  }();\n\n  var SocketTransporter = function () {\n    function SocketTransporter(option) {\n      this._socket = void 0;\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$1();\n      this._deferHandler = new DeferHandler$1();\n      this._heartbeat = new Heartbeat(this, {\n        timeout: IM_PING_INTERVAL_TIME\n      });\n      this._connectedTime = void 0;\n      this._option = option;\n    }\n\n    var _proto2 = SocketTransporter.prototype;\n\n    _proto2._createSocket = function _createSocket(url) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var socket = new RCSocket$1({\n        url: url\n      });\n\n      var onClose = function onClose(event) {\n        event = event || {};\n        var code = event.code || TRANSPORTER_STATUS.CLOSE_ABNORMAL;\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, code);\n\n        self.disconnect();\n      };\n\n      socket.onMessage(function (msg) {\n        var data = msg.data;\n\n        if (!utils.isArrayBuffer(data)) {\n          throw new Error('Error socket signal');\n        }\n\n        var signal = readWSBuffer(data);\n        self.handleSignal(signal);\n      });\n      socket.onError(onClose);\n      socket.onClose(onClose);\n      return socket;\n    };\n\n    _proto2._startHeartbeat = function _startHeartbeat(timeSpentConnect) {\n      var self = this;\n      var _heartbeat = self._heartbeat,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n\n      _heartbeat.check(FIRST_PING_TIMEOUT).then(utils.noop)[\"catch\"](function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT);\n\n        self.disconnect();\n      });\n\n      var pingTimeout = common.getPingTimeout(timeSpentConnect);\n\n      _heartbeat.start(pingTimeout, function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n        self.disconnect();\n      });\n    };\n\n    _proto2._stopHeartbeat = function _stopHeartbeat() {\n      this._heartbeat.stop();\n    };\n\n    _proto2.watchSignal = function watchSignal(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, watcher);\n    };\n\n    _proto2.watchStatus = function watchStatus(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, watcher);\n    };\n\n    _proto2.connect = function connect(user, option) {\n      var self = this;\n      var _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType,\n          _deferHandler = self._deferHandler;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        connectType: connectType,\n        token: token\n      });\n      var timeBeforeConnect = utils.getCurrentTimestamp();\n      self._socket = this._createSocket(url);\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.CONNECT, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (result) {\n        var timeAfterConnect = utils.getCurrentTimestamp();\n        var timeSpentConnect = timeAfterConnect - timeBeforeConnect;\n\n        self._startHeartbeat(timeSpentConnect);\n\n        return result;\n      });\n    };\n\n    _proto2.sendSignal = function sendSignal(writer) {\n      var binary = writer.getBufferData();\n\n      this._socket.send(binary.buffer);\n    };\n\n    _proto2.handleSignal = function handleSignal(signal) {\n      var _transporterEventEmiiter = this._transporterEventEmiiter,\n          _deferHandler = this._deferHandler;\n\n      if (signal instanceof ConnAckReader) {\n        this.handleConnAck(signal);\n      } else if (signal instanceof PingRespReader) {\n        _deferHandler.resolve(TransHandlerID.PING);\n      } else {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n      }\n\n      if (signal && utils.isValidTimestamp(signal.timestamp)) {\n        common.DelayTimer.setTime(signal.timestamp);\n      }\n    };\n\n    _proto2.handleConnAck = function handleConnAck(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n      var status = signal.status;\n      var isConnected = status === SUCCESS_CODE;\n      var event = isConnected ? _deferHandler.resolve : _deferHandler.reject;\n      event.call(_deferHandler, TransHandlerID.CONNECT, signal);\n\n      if (isConnected) {\n        self._connectedTime = utils.getCurrentTimestamp();\n      }\n\n      isConnected && _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.CONNECTED);\n    };\n\n    _proto2.disconnect = function disconnect() {\n      this._stopHeartbeat();\n\n      this._socket && this._socket.close();\n    };\n\n    return SocketTransporter;\n  }();\n\n  var logEventEmitter = new utils.EventEmitter();\n  var LogEventName = 'log';\n  var LocalLogPrefix = '[Rong]';\n  var ServerOption = DEFAULT_SERVER_OPTION;\n  var Option = {\n    isDebug: false,\n    isUploadToServer: false,\n    appkey: '',\n    userId: '',\n    isNetworkUnavailable: true\n  };\n  var realTimeUploadHasStarted = false,\n      RealtimeUploadTimes = 1,\n      isRealtimeUploading = false,\n      fullLogId = '';\n\n  var isFirstDefaultUpload = function isFirstDefaultUpload(interval) {\n    return interval === 20000;\n  };\n\n  var getRealtimeUploadInterval = function getRealtimeUploadInterval(uploadTimes) {\n    var realtimeInterval = ServerOption.realtimeInterval;\n    return realtimeInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getFullUploadInterval = function getFullUploadInterval(uploadTimes) {\n    var fullInterval = ServerOption.fullInterval;\n    return fullInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getCSVForLog = function getCSVForLog(log) {\n    log = log || {};\n    var content = log.content || {};\n    utils.forEach(content, function (val, key) {\n      if (utils.isObject(val) || utils.isArray(val)) {\n        content[key] = utils.toJSON(val);\n      }\n    });\n    content = utils.toJSON(content) || '\"\"';\n    content = common.stringToCsv(content);\n    return utils.tplEngine(CSV_LOG_TPL, {\n      sessionId: common.getWebSessionId(),\n      time: log.time,\n      type: log.type,\n      level: log.level,\n      tag: log.tag,\n      content: content\n    });\n  };\n\n  var setServerOption = function setServerOption(serverData) {\n    var logSwitch = serverData.logSwitch,\n        logPolicy = serverData.logPolicy;\n    var isOpen = !!logSwitch;\n    if (utils.isEmpty(serverData)) return;\n    ServerOption.isOpen = isOpen;\n\n    if (!isOpen) {\n      return;\n    }\n\n    var logConf = utils.parseJSON(logPolicy || '') || {};\n    var url = logConf.url,\n        level = logConf.level,\n        itv = logConf.itv,\n        times = logConf.times;\n    utils.extend(ServerOption, {\n      url: url,\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(itv) * 1000,\n      realtimeMaxTimes: Number(times)\n    });\n  };\n\n  var setServerResponseOption = function setServerResponseOption(resText) {\n    var resConf = utils.parseJSON(resText || '');\n    var nextTime = resConf.nextTime,\n        level = resConf.level,\n        logSwitch = resConf.logSwitch;\n    if (utils.isEmpty(resConf)) return;\n    var isOpen = !!logSwitch;\n    ServerOption.isOpen = isOpen;\n    if (!isOpen) return;\n    utils.extend(ServerOption, {\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(nextTime) * 1000\n    });\n  };\n\n  var getLogLevel = function getLogLevel(log) {\n    log = log || {};\n    var _Option = Option,\n        isNetworkUnavailable = _Option.isNetworkUnavailable,\n        _log = log,\n        level = _log.level,\n        isLevelToDegrad = utils.isEqual(level, LEVEL.ERROR) || utils.isEqual(level, LEVEL.WARN);\n\n    if (isNetworkUnavailable && isLevelToDegrad) {\n      log.level = LEVEL.INFO;\n    }\n\n    return log;\n  };\n\n  var LogStore = {\n    _list: [],\n    MaxSize: common.isBelowIE(9) ? STORE_SIZE.LOW : STORE_SIZE.ADVANCED,\n    add: function add(log) {\n      log = getLogLevel(log);\n\n      LogStore._list.push(log);\n\n      var currentSize = LogStore._list.length,\n          maxSize = LogStore.MaxSize;\n\n      if (currentSize > maxSize) {\n        LogStore._list.splice(0, currentSize - maxSize);\n      }\n    },\n    get: function get(option) {\n      var type = option.type,\n          uploadLevel = option.level;\n      var _list = LogStore._list;\n      var uploadList = [];\n      utils.forEach(_list, function (log, index) {\n        var logTime = log.time || 0,\n            logLevel = log.level || LEVEL.DEBUG,\n            isUploadLevel = logLevel <= uploadLevel,\n            fullUploadOption = option.fullUploadOption || {},\n            startTime = fullUploadOption.startTime || 0,\n            endTime = fullUploadOption.endTime || common.DelayTimer.getTime();\n        var isUpload = isUploadLevel;\n\n        switch (type) {\n          case REPORT_TYPE.REALTIME:\n            isUpload = isUpload && !log.isUploaded;\n            isUpload && (LogStore._list[index].isUploaded = true);\n            break;\n\n          case REPORT_TYPE.FULL:\n            isUpload = isUpload && logTime >= startTime && logTime <= endTime;\n            break;\n\n          default:\n        }\n\n        if (isUpload) {\n          uploadList.push(log);\n        }\n      });\n      return uploadList;\n    },\n    clear: function clear() {\n      LogStore._list = [];\n    }\n  };\n\n  var upload = function upload(option) {\n    var url = option.url,\n        logList = option.logList,\n        type = option.type;\n    var requestUrl = common.getReportLogUrl({\n      type: type,\n      appkey: Option.appkey || '',\n      userId: Option.userId || '',\n      url: url || ServerOption.url || DEFAULT_SERVER_OPTION.url,\n      logId: option.logId\n    });\n    var csvLog = '';\n    utils.forEach(logList, function (log) {\n      csvLog += getCSVForLog(log);\n    });\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.REALTIME) {\n      return utils.Defer.reject();\n    }\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.FULL) {\n      csvLog = NO_FULL_LOG;\n    }\n\n    csvLog = common.TextCompressor.compress(csvLog);\n    return utils.request(requestUrl, {\n      method: REQUEST_METHOD.POST,\n      body: csvLog,\n      timeout: REQUEST_TIMEOUT\n    });\n  };\n\n  var uploadRealtime = function uploadRealtime() {\n    if (isRealtimeUploading) {\n      return;\n    }\n\n    var interval = getRealtimeUploadInterval(RealtimeUploadTimes);\n    var realtimeMaxTimes = ServerOption.realtimeMaxTimes,\n        realtimeLevel = ServerOption.realtimeLevel;\n\n    if (RealtimeUploadTimes < realtimeMaxTimes) {\n      RealtimeUploadTimes++;\n    }\n\n    if (isFirstDefaultUpload(interval)) {\n      RealtimeUploadTimes = 1;\n    }\n\n    utils.setTimeout(function () {\n      var logList = LogStore.get({\n        type: REPORT_TYPE.REALTIME,\n        level: realtimeLevel\n      });\n      isRealtimeUploading = true;\n      upload({\n        logList: logList,\n        type: REPORT_TYPE.REALTIME\n      }).then(function (response) {\n        isRealtimeUploading = false;\n        var responseText = response.responseText || '{}';\n        var conf = response.responseText || {};\n        setServerResponseOption(responseText);\n\n        if (ServerOption.isOpen) {\n          RealtimeUploadTimes = utils.isEmpty(conf) ? RealtimeUploadTimes : 1;\n          uploadRealtime();\n        }\n      })[\"catch\"](function () {\n        isRealtimeUploading = false;\n        uploadRealtime();\n      });\n    }, interval);\n  };\n\n  var uploadFull = function uploadFull(uploadTimes, option, connectedTime) {\n    if (!Option.isUploadToServer) {\n      return;\n    }\n\n    uploadTimes = uploadTimes || 0;\n    option = option || {};\n    var _option = option,\n        uri = _option.uri,\n        logId = _option.logId;\n    var isFirst = uploadTimes === 0;\n    var interval = isFirst ? 0 : getFullUploadInterval(uploadTimes);\n    var fullMaxTimes = ServerOption.fullMaxTimes,\n        fullLevel = ServerOption.fullLevel;\n    if (fullLogId === logId) return;\n\n    if (uploadTimes <= fullMaxTimes) {\n      uploadTimes++;\n    } else {\n      return;\n    }\n\n    fullLogId = logId;\n\n    (function (option) {\n      utils.setTimeout(function () {\n        var logList = LogStore.get({\n          type: REPORT_TYPE.FULL,\n          level: fullLevel,\n          fullUploadOption: option\n        });\n        if (logList.length === 0 && Number(option.endTime) < connectedTime) return;\n        upload({\n          logId: logId,\n          url: uri,\n          logList: logList,\n          type: REPORT_TYPE.FULL\n        }).then(function () {})[\"catch\"](function () {\n          uploadFull(uploadTimes, option, connectedTime);\n        });\n      }, interval);\n    })(option);\n  };\n\n  var writeLocalLog = function writeLocalLog(log) {\n    var time = log.time;\n    var formatedTime = utils.formatTime(time);\n    var localLog = LocalLogPrefix + \":\" + formatedTime + \": \" + utils.toJSON(log);\n    logEventEmitter.emit(LogEventName, localLog);\n\n    if (Option.isDebug) {\n      utils.consoleLog(localLog);\n    }\n  };\n\n  var Logger = {\n    _events: [],\n    LogStore: LogStore,\n    setOption: function setOption(option) {\n      Option = utils.extend(Option, option);\n    },\n    setServerOption: setServerOption,\n    watchLog: function watchLog(event) {\n      logEventEmitter.on(LogEventName, event);\n\n      Logger._events.push(event);\n    },\n    write: function write(log) {\n      log = log || {};\n      log.tag = log.tag || TAG.L_CRASH_F;\n      log.time = log.time || common.DelayTimer.getTime();\n      log.type = log.type || LOG_TYPE.IM;\n      LogStore.add(log);\n      writeLocalLog(log);\n    },\n    fatal: function fatal(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.FATAL\n      });\n    },\n    error: function error(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.ERROR\n      });\n    },\n    warn: function warn(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.WARN\n      });\n    },\n    info: function info(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.INFO\n      });\n    },\n    debug: function debug(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.DEBUG\n      });\n    },\n    startRealtimeUpload: function startRealtimeUpload() {\n      if (realTimeUploadHasStarted) return;\n      Option.isUploadToServer && uploadRealtime();\n      realTimeUploadHasStarted = true;\n    },\n    resetRealtimeUpload: function resetRealtimeUpload() {\n      RealtimeUploadTimes = 1;\n    },\n    uploadFull: uploadFull\n  };\n\n  var EventEmitter$2 = utils.EventEmitter,\n      DeferHandler$2 = utils.DeferHandler,\n      httpRequest = utils.httpRequest,\n      request$4 = utils.request,\n      Defer$1 = utils.Defer;\n\n  var CometTransporter = function () {\n    function CometTransporter(option) {\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$2();\n      this._deferHandler = new DeferHandler$2();\n      this._pid = utils.encodeURI(utils.getCurrentTimestamp() + Math.random() + '');\n      this._domain = void 0;\n      this._sessionid = void 0;\n      this._xhrCache = new utils.Cache();\n      this._pullSignalTimer = new utils.Timer({\n        timeout: IM_COMET_PULLMSG_TIMEOUT\n      });\n      this._isDisconnected = true;\n      this._option = option;\n    }\n\n    var _proto = CometTransporter.prototype;\n\n    _proto._startPullSignal = function _startPullSignal() {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid,\n          _transporterEventEmiiter = self._transporterEventEmiiter,\n          _pullSignalTimer = self._pullSignalTimer;\n      var timestamp = utils.getCurrentTimestamp();\n      var protocol = env.protocol.http;\n      var url = utils.tplEngine(COMET_PULL_URL_TPL, {\n        protocol: protocol,\n        timestamp: timestamp,\n        domain: _domain,\n        sessionId: _sessionid,\n        pid: _pid\n      });\n      var xhr = httpRequest({\n        url: url,\n        body: {\n          pid: _pid\n        },\n        timeout: IM_COMET_PULLMSG_TIMEOUT,\n        success: function success(responseText) {\n          _pullSignalTimer.stop();\n\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (isSuccess) {\n            !self._isDisconnected && self._startPullSignal();\n          } else if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        },\n        fail: function fail() {\n          _pullSignalTimer.stop();\n\n          if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        }\n      });\n\n      _pullSignalTimer.start(function () {\n        if (!self._isDisconnected) {\n          _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n          self.disconnect();\n        }\n      });\n\n      self._xhrCache.set(url, xhr);\n    };\n\n    _proto.watchSignal = function watchSignal(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, event);\n    };\n\n    _proto.watchStatus = function watchStatus(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, function (status) {\n        event && event(status);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter,\n          _pid = self._pid,\n          _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        token: token,\n        connectType: connectType\n      });\n      self._domain = domain;\n      self._isDisconnected = false;\n\n      var success = function success(_ref) {\n        var responseText = _ref.responseText;\n\n        if (!utils.isValidJSON(responseText)) {\n          return Defer$1.reject();\n        }\n\n        var response = utils.isObject(responseText) ? responseText : utils.parseJSON(responseText);\n        var isConnectSuccess = utils.isEqual(response.status, SUCCESS_CODE);\n\n        if (isConnectSuccess && utils.isObject(response) && utils.isValidTimestamp(response.timestamp)) {\n          common.DelayTimer.setTime(response.timestamp);\n        }\n\n        return isConnectSuccess ? Defer$1.resolve(response) : Defer$1.reject(response);\n      };\n\n      return request$4(url, {\n        body: {\n          pid: _pid\n        }\n      }).then(success).then(function (response) {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, CONNECTION_STATUS.CONNECTED);\n\n        self._sessionid = response.sessionid;\n\n        self._startPullSignal();\n\n        return response;\n      });\n    };\n\n    _proto.sendSignal = function sendSignal(writer) {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid;\n      var messageId = writer.messageId,\n          topic = writer.topic,\n          targetId = writer.targetId;\n      var headerCode = writer.getHeaderFlag();\n      var protocol = env.protocol.http;\n      var TPL = topic ? COMET_REQ_HAS_TOPIC_URL_TPL : COMET_REQ_NO_TOPIC_URL_TPL;\n      var url = utils.tplEngine(TPL, {\n        protocol: protocol,\n        messageId: messageId,\n        headerCode: headerCode,\n        topic: topic,\n        targetId: targetId,\n        pid: _pid,\n        sessionId: _sessionid,\n        domain: _domain\n      });\n      var currentTime = utils.getCurrentTimestamp() + '';\n      var xhr = httpRequest({\n        url: url,\n        method: REQUEST_METHOD.POST,\n        body: writer.getCometData(),\n        success: function success(responseText) {\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (!isSuccess) {\n            self.handleError(messageId);\n          }\n\n          self._xhrCache.remove(currentTime);\n        },\n        fail: function fail(error) {\n          self.handleError(messageId);\n\n          self._xhrCache.remove(currentTime);\n\n          Logger.error(TAG.L_CRASH_F, {\n            content: {\n              info: 'comet error',\n              error: error\n            }\n          });\n        }\n      });\n\n      self._xhrCache.set(currentTime, xhr);\n    };\n\n    _proto.handleCometResponse = function handleCometResponse(responseText) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var response = utils.isString(responseText) ? utils.parseJSON(responseText) : responseText;\n\n      if (!response) {\n        return false;\n      }\n\n      if (!response || !utils.isArray(response)) {\n        return true;\n      }\n\n      utils.forEach(response, function (data) {\n        var sessionid = data.sessionid;\n\n        if (sessionid) {\n          self._sessionid = sessionid;\n        }\n\n        var signal = readCometData(data);\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n\n        if (signal && utils.isValidTimestamp(signal.timestamp)) {\n          common.DelayTimer.setTime(signal.timestamp);\n        }\n      });\n      return true;\n    };\n\n    _proto.handleError = function handleError(messageId, status) {\n      var signal = {\n        messageId: messageId,\n        status: status || ERROR_CODE.TIMEOUT\n      };\n\n      this._transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n    };\n\n    _proto.disconnect = function disconnect() {\n      var self = this;\n      self._isDisconnected = true;\n      var _xhrCache = self._xhrCache,\n          _pullSignalTimer = self._pullSignalTimer;\n\n      var xhrKeys = _xhrCache.getKeys();\n\n      _pullSignalTimer.stop();\n\n      utils.forEach(xhrKeys, function (key) {\n        var xhr = _xhrCache.get(key);\n\n        xhr.abort();\n\n        _xhrCache.remove(key);\n      });\n    };\n\n    return CometTransporter;\n  }();\n\n  var Transporter = (function (option) {\n    var connectType = option.connectType;\n    var isSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var Transporter = isSocket ? SocketTransporter : CometTransporter;\n    return new Transporter(option);\n  });\n\n  var PBName = {\n    UpStreamMessage: 'UpStreamMessage',\n    DownStreamMessage: 'DownStreamMessage',\n    DownStreamMessages: 'DownStreamMessages',\n    SessionsAttQryInput: 'SessionsAttQryInput',\n    SessionsAttOutput: 'SessionsAttOutput',\n    SyncRequestMsg: 'SyncRequestMsg',\n    ChrmPullMsg: 'ChrmPullMsg',\n    NotifyMsg: 'NotifyMsg',\n    HistoryMsgInput: 'HistoryMsgInput',\n    HistoryMsgOuput: 'HistoryMsgOuput',\n    RelationQryInput: 'RelationQryInput',\n    RelationsOutput: 'RelationsOutput',\n    DeleteSessionsInput: 'DeleteSessionsInput',\n    SessionInfo: 'SessionInfo',\n    DeleteSessionsOutput: 'DeleteSessionsOutput',\n    RelationsInput: 'RelationsInput',\n    DeleteMsgInput: 'DeleteMsgInput',\n    CleanHisMsgInput: 'CleanHisMsgInput',\n    SessionMsgReadInput: 'SessionMsgReadInput',\n    ChrmInput: 'ChrmInput',\n    QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n    QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n    RtcInput: 'RtcInput',\n    RtcUserListOutput: 'RtcUserListOutput',\n    SetUserStatusInput: 'SetUserStatusInput',\n    RtcSetDataInput: 'RtcSetDataInput',\n    RtcDataInput: 'RtcDataInput',\n    RtcSetOutDataInput: 'RtcSetOutDataInput',\n    MCFollowInput: 'MCFollowInput',\n    RtcTokenOutput: 'RtcTokenOutput',\n    RtcQryOutput: 'RtcQryOutput',\n    RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n    RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n    RtcQueryListInput: 'RtcQueryListInput',\n    RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n    RtcValueInfo: 'RtcValueInfo',\n    RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n    GetQNupTokenInput: 'GetQNupTokenInput',\n    GetQNupTokenOutput: 'GetQNupTokenOutput',\n    GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n    GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput',\n    SetChrmKV: 'SetChrmKV',\n    ChrmKVOutput: 'ChrmKVOutput',\n    QueryChrmKV: 'QueryChrmKV',\n    ChrmNotifyMsg: 'ChrmNotifyMsg'\n  };\n\n  var _SSMsg;\n  var SSMsg = (_SSMsg = {}, _SSMsg[PBName.UpStreamMessage] = ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData'], _SSMsg[PBName.DownStreamMessages] = ['list', 'syncTime', 'finished'], _SSMsg[PBName.DownStreamMessage] = ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId'], _SSMsg[PBName.SessionsAttQryInput] = ['nothing'], _SSMsg[PBName.SessionsAttOutput] = ['inboxTime', 'sendboxTime', 'totalUnreadCount'], _SSMsg[PBName.SyncRequestMsg] = ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'], _SSMsg[PBName.ChrmPullMsg] = ['syncTime', 'count'], _SSMsg[PBName.NotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.HistoryMsgInput] = ['targetId', 'time', 'count', 'order'], _SSMsg[PBName.HistoryMsgOuput] = ['list', 'syncTime', 'hasMsg'], _SSMsg[PBName.RelationQryInput] = ['type', 'count', 'startTime', 'order'], _SSMsg[PBName.RelationsOutput] = ['info'], _SSMsg[PBName.DeleteSessionsInput] = ['sessions'], _SSMsg[PBName.SessionInfo] = ['type', 'channelId'], _SSMsg[PBName.DeleteSessionsOutput] = ['nothing'], _SSMsg[PBName.RelationsInput] = ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'], _SSMsg[PBName.DeleteMsgInput] = ['type', 'conversationId', 'msgs'], _SSMsg[PBName.CleanHisMsgInput] = ['targetId', 'dataTime', 'conversationType'], _SSMsg[PBName.SessionMsgReadInput] = ['type', 'msgTime', 'channelId'], _SSMsg[PBName.ChrmInput] = ['nothing'], _SSMsg[PBName.QueryChatRoomInfoInput] = ['count', 'order'], _SSMsg[PBName.QueryChatRoomInfoOutput] = ['userTotalNums', 'userInfos'], _SSMsg[PBName.GetQNupTokenInput] = ['type'], _SSMsg[PBName.GetQNdownloadUrlInput] = ['type', 'key', 'fileName'], _SSMsg[PBName.GetQNupTokenOutput] = ['deadline', 'token'], _SSMsg[PBName.GetQNdownloadUrlOutput] = ['downloadUrl'], _SSMsg[PBName.SetChrmKV] = ['entry', 'bNotify', 'notification', 'type'], _SSMsg[PBName.ChrmKVOutput] = ['entries', 'bFullUpdate', 'syncTime'], _SSMsg[PBName.QueryChrmKV] = ['timestamp'], _SSMsg[PBName.ChrmNotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg);\n\n  var Codec = {};\n  utils.forEach(SSMsg, function (paramList, name) {\n    Codec[name] = function () {};\n\n    Codec[name].prototype.data = {};\n\n    Codec[name].prototype.getData = function () {\n      return this.data;\n    };\n\n    utils.forEach(paramList, function (param) {\n      var setEventName = 'set' + utils.toUpperCase(param, 0, 1);\n\n      Codec[name].prototype[setEventName] = function (item) {\n        this.data[param] = item;\n      };\n    });\n\n    Codec[name].decode = function (data) {\n      var decodeResult = {};\n\n      if (utils.isString(data)) {\n        data = utils.parseJSON(data);\n      }\n\n      var _loop = function _loop(key) {\n        var getEventName = 'get' + utils.toUpperCase(key, 0, 1);\n        decodeResult[key] = data[key];\n\n        decodeResult[getEventName] = function () {\n          return data[key];\n        };\n      };\n\n      for (var key in data) {\n        _loop(key);\n      }\n\n      return decodeResult;\n    };\n  });\n\n  Codec.getModule = function (pbName) {\n    var modules = new Codec[pbName]();\n\n    modules.getArrayData = function () {\n      return modules.getData();\n    };\n\n    return modules;\n  };\n\n  function protobuf(a){var b=void 0,c=function(){function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c;}function b(a){return (a&&a.__isLong__)===!0}function e(a,b){var e,f,h;return b?(a>>>=0,(h=a>=0&&256>a)&&(f=d[a])?f:(e=g(a,0>(0|a)?-1:0,!0),h&&(d[a]=e),e)):(a|=0,(h=a>=-128&&128>a)&&(f=c[a])?f:(e=g(a,0>a?-1:0,!1),h&&(c[a]=e),e))}function f(a,b){if(isNaN(a)||!isFinite(a))return b?r:q;if(b){if(0>a)return r;if(a>=n)return w}else{if(-o>=a)return x;if(a+1>=o)return v}return 0>a?f(-a,b).neg():g(0|a%m,0|a/m,b)}function g(b,c,d){return new a(b,c,d)}function i(a,b,c){var d,e,g,j,k,l,m;if(0===a.length)throw Error(\"empty string\");if(\"NaN\"===a||\"Infinity\"===a||\"+Infinity\"===a||\"-Infinity\"===a)return q;if(\"number\"==typeof b?(c=b,b=!1):b=!!b,c=c||10,2>c||c>36)throw RangeError(\"radix\");if((d=a.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===d)return i(a.substring(1),b,c).neg();for(e=f(h(c,8)),g=q,j=0;j<a.length;j+=8)k=Math.min(8,a.length-j),l=parseInt(a.substring(j,j+k),c),8>k?(m=f(h(c,k)),g=g.mul(m).add(f(l))):(g=g.mul(e),g=g.add(f(l)));return g.unsigned=b,g}function j(b){return b instanceof a?b:\"number\"==typeof b?f(b):\"string\"==typeof b?i(b):g(b.low,b.high,b.unsigned)}var c,d,h,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return Object.defineProperty(a.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b,c={},d={},a.fromInt=e,a.fromNumber=f,a.fromBits=g,h=Math.pow,a.fromString=i,a.fromValue=j,k=65536,l=1<<24,m=k*k,n=m*m,o=n/2,p=e(l),q=e(0),a.ZERO=q,r=e(0,!0),a.UZERO=r,s=e(1),a.ONE=s,t=e(1,!0),a.UONE=t,u=e(-1),a.NEG_ONE=u,v=g(-1,2147483647,!1),a.MAX_VALUE=v,w=g(-1,-1,!0),a.MAX_UNSIGNED_VALUE=w,x=g(0,-2147483648,!1),a.MIN_VALUE=x,y=a.prototype,y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},y.toString=function(a){var b,c,d,e,g,i,j,k,l;if(a=a||10,2>a||a>36)throw RangeError(\"radix\");if(this.isZero())return \"0\";if(this.isNegative())return this.eq(x)?(b=f(a),c=this.div(b),d=c.mul(b).sub(this),c.toString(a)+d.toInt().toString(a)):\"-\"+this.neg().toString(a);for(e=f(h(a,6),this.unsigned),g=this,i=\"\";;){if(j=g.div(e),k=g.sub(j.mul(e)).toInt()>>>0,l=k.toString(a),g=j,g.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i;}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var a,b;if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return !this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1===(1&this.low)},y.isEven=function(){return 0===(1&this.low)},y.equals=function(a){return b(a)||(a=j(a)),this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low},y.eq=y.equals,y.notEquals=function(a){return !this.eq(a)},y.neq=y.notEquals,y.lessThan=function(a){return this.comp(a)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(a){return this.comp(a)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(a){return this.comp(a)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(a){return this.comp(a)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(a){if(b(a)||(a=j(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return !this.unsigned&&this.eq(x)?x:this.not().add(s)},y.neg=y.negate,y.add=function(a){var c,d,e,f,h,i,k,l,m,n,o,p;return b(a)||(a=j(a)),c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,h=a.high>>>16,i=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0,p+=f+l,o+=p>>>16,p&=65535,o+=e+k,n+=o>>>16,o&=65535,n+=d+i,m+=n>>>16,n&=65535,m+=c+h,m&=65535,g(o<<16|p,m<<16|n,this.unsigned)},y.subtract=function(a){return b(a)||(a=j(a)),this.add(a.neg())},y.sub=y.subtract,y.multiply=function(a){var c,d,e,h,i,k,l,m,n,o,r,s;return this.isZero()?q:(b(a)||(a=j(a)),a.isZero()?q:this.eq(x)?a.isOdd()?x:q:a.eq(x)?this.isOdd()?x:q:this.isNegative()?a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg():a.isNegative()?this.mul(a.neg()).neg():this.lt(p)&&a.lt(p)?f(this.toNumber()*a.toNumber(),this.unsigned):(c=this.high>>>16,d=65535&this.high,e=this.low>>>16,h=65535&this.low,i=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,o=0,r=0,s=0,s+=h*m,r+=s>>>16,s&=65535,r+=e*m,o+=r>>>16,r&=65535,r+=h*l,o+=r>>>16,r&=65535,o+=d*m,n+=o>>>16,o&=65535,o+=e*l,n+=o>>>16,o&=65535,o+=h*k,n+=o>>>16,o&=65535,n+=c*m+d*l+e*k+h*i,n&=65535,g(r<<16|s,n<<16|o,this.unsigned)))},y.mul=y.multiply,y.divide=function(a){var c,d,e,g,i,k,l,m;if(b(a)||(a=j(a)),a.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?r:q;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return r;if(a.gt(this.shru(1)))return t;e=r;}else{if(this.eq(x))return a.eq(s)||a.eq(u)?x:a.eq(x)?s:(g=this.shr(1),c=g.div(a).shl(1),c.eq(q)?a.isNegative()?s:u:(d=this.sub(a.mul(c)),e=c.add(d.div(a))));if(a.eq(x))return this.unsigned?r:q;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();e=q;}for(d=this;d.gte(a);){for(c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),i=Math.ceil(Math.log(c)/Math.LN2),k=48>=i?1:h(2,i-48),l=f(c),m=l.mul(a);m.isNegative()||m.gt(d);)c-=k,l=f(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=s),e=e.add(l),d=d.sub(m);}return e},y.div=y.divide,y.modulo=function(a){return b(a)||(a=j(a)),this.sub(this.div(a).mul(a))},y.mod=y.modulo,y.not=function(){return g(~this.low,~this.high,this.unsigned)},y.and=function(a){return b(a)||(a=j(a)),g(this.low&a.low,this.high&a.high,this.unsigned)},y.or=function(a){return b(a)||(a=j(a)),g(this.low|a.low,this.high|a.high,this.unsigned)},y.xor=function(a){return b(a)||(a=j(a)),g(this.low^a.low,this.high^a.high,this.unsigned)},y.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):g(0,this.low<<a-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):g(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(a){var c,d;return b(a)&&(a=a.toInt()),a&=63,0===a?this:(c=this.high,32>a?(d=this.low,g(d>>>a|c<<32-a,c>>>a,this.unsigned)):32===a?g(c,0,this.unsigned):g(c>>>a-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},y.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var a=this.high,b=this.low;return [255&b,255&b>>>8,255&b>>>16,255&b>>>24,255&a,255&a>>>8,255&a>>>16,255&a>>>24]},y.toBytesBE=function(){var a=this.high,b=this.low;return [255&a>>>24,255&a>>>16,255&a>>>8,255&a,255&b>>>24,255&b>>>16,255&b>>>8,255&b]},a}(),d=function(a){function f(a){var b=0;return function(){return b<a.length?a.charCodeAt(b++):null}}function g(){var a=[],b=[];return function(){return 0===arguments.length?b.join(\"\")+e.apply(String,a):(a.length+arguments.length>1024&&(b.push(e.apply(String,a)),a.length=0),Array.prototype.push.apply(a,arguments),void 0)}}function h(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j;}return (n?-1:1)*g*Math.pow(2,f-d)}function i(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p;}var c,d,e,j,k,b=function(a,c,e){if(\"undefined\"==typeof a&&(a=b.DEFAULT_CAPACITY),\"undefined\"==typeof c&&(c=b.DEFAULT_ENDIAN),\"undefined\"==typeof e&&(e=b.DEFAULT_NOASSERT),!e){if(a=0|a,0>a)throw RangeError(\"Illegal capacity\");c=!!c,e=!!e;}this.buffer=0===a?d:new ArrayBuffer(a),this.view=0===a?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=a,this.littleEndian=c,this.noAssert=e;};return b.VERSION=\"5.0.1\",b.LITTLE_ENDIAN=!0,b.BIG_ENDIAN=!1,b.DEFAULT_CAPACITY=16,b.DEFAULT_ENDIAN=b.BIG_ENDIAN,b.DEFAULT_NOASSERT=!1,b.Long=a||null,c=b.prototype,c.__isByteBuffer__,Object.defineProperty(c,\"__isByteBuffer__\",{value:!0,enumerable:!1,configurable:!1}),d=new ArrayBuffer(0),e=String.fromCharCode,b.accessor=function(){return Uint8Array},b.allocate=function(a,c,d){return new b(a,c,d)},b.concat=function(a,c,d,e){var f,i,g,h,k,j;for((\"boolean\"==typeof c||\"string\"!=typeof c)&&(e=d,d=c,c=void 0),f=0,g=0,h=a.length;h>g;++g)b.isByteBuffer(a[g])||(a[g]=b.wrap(a[g],c)),i=a[g].limit-a[g].offset,i>0&&(f+=i);if(0===f)return new b(0,d,e);for(j=new b(f,d,e),g=0;h>g;)k=a[g++],i=k.limit-k.offset,0>=i||(j.view.set(k.view.subarray(k.offset,k.limit),j.offset),j.offset+=i);return j.limit=j.offset,j.offset=0,j},b.isByteBuffer=function(a){return (a&&a.__isByteBuffer__)===!0},b.type=function(){return ArrayBuffer},b.wrap=function(a,d,e,f){var g,h;if(\"string\"!=typeof d&&(f=e,e=d,d=void 0),\"string\"==typeof a)switch(\"undefined\"==typeof d&&(d=\"utf8\"),d){case\"base64\":return b.fromBase64(a,e);case\"hex\":return b.fromHex(a,e);case\"binary\":return b.fromBinary(a,e);case\"utf8\":return b.fromUTF8(a,e);case\"debug\":return b.fromDebug(a,e);default:throw Error(\"Unsupported encoding: \"+d)}if(null===a||\"object\"!=typeof a)throw TypeError(\"Illegal buffer\");if(b.isByteBuffer(a))return g=c.clone.call(a),g.markedOffset=-1,g;if(a instanceof Uint8Array)g=new b(0,e,f),a.length>0&&(g.buffer=a.buffer,g.offset=a.byteOffset,g.limit=a.byteOffset+a.byteLength,g.view=new Uint8Array(a.buffer));else if(a instanceof ArrayBuffer)g=new b(0,e,f),a.byteLength>0&&(g.buffer=a,g.offset=0,g.limit=a.byteLength,g.view=a.byteLength>0?new Uint8Array(a):null);else{if(\"[object Array]\"!==Object.prototype.toString.call(a))throw TypeError(\"Illegal buffer\");for(g=new b(a.length,e,f),g.limit=a.length,h=0;h<a.length;++h)g.view[h]=a[h];}return g},c.writeBitSet=function(a,b){var h,d,e,f,g,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(!(a instanceof Array))throw TypeError(\"Illegal BitSet: Not an array\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(d=b,e=a.length,f=e>>3,g=0,b+=this.writeVarint32(e,b);f--;)h=1&!!a[g++]|(1&!!a[g++])<<1|(1&!!a[g++])<<2|(1&!!a[g++])<<3|(1&!!a[g++])<<4|(1&!!a[g++])<<5|(1&!!a[g++])<<6|(1&!!a[g++])<<7,this.writeByte(h,b++);if(e>g){for(i=0,h=0;e>g;)h|=(1&!!a[g++])<<i++;this.writeByte(h,b++);}return c?(this.offset=b,this):b-d},c.readBitSet=function(a){var h,c,d,e,f,g,i,b=\"undefined\"==typeof a;for(b&&(a=this.offset),c=this.readVarint32(a),d=c.value,e=d>>3,f=0,g=[],a+=c.length;e--;)h=this.readByte(a++),g[f++]=!!(1&h),g[f++]=!!(2&h),g[f++]=!!(4&h),g[f++]=!!(8&h),g[f++]=!!(16&h),g[f++]=!!(32&h),g[f++]=!!(64&h),g[f++]=!!(128&h);if(d>f)for(i=0,h=this.readByte(a++);d>f;)g[f++]=!!(1&h>>i++);return b&&(this.offset=a),g},c.readBytes=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+a+\") <= \"+this.buffer.byteLength)}return d=this.slice(b,b+a),c&&(this.offset+=a),d},c.writeBytes=c.append,c.writeInt8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeByte=c.writeInt8,c.readInt8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],128===(128&c)&&(c=-(255-c+1)),b&&(this.offset+=1),c},c.readByte=c.readInt8,c.writeUint8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeUInt8=c.writeUint8,c.readUint8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],b&&(this.offset+=1),c},c.readUInt8=c.readUint8,c.writeInt16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeShort=c.writeInt16,c.readInt16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),32768===(32768&c)&&(c=-(65535-c+1)),b&&(this.offset+=2),c},c.readShort=c.readInt16,c.writeUint16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeUInt16=c.writeUint16,c.readUint16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),b&&(this.offset+=2),c},c.readUInt16=c.readUint16,c.writeInt32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeInt=c.writeInt32,c.readInt32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),c|=0,b&&(this.offset+=4),c},c.readInt=c.readInt32,c.writeUint32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeUInt32=c.writeUint32,c.readUint32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),b&&(this.offset+=4),c},c.readUInt32=c.readUint32,a&&(c.writeInt64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeLong=c.writeInt64,c.readInt64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!1),c&&(this.offset+=8),f},c.readLong=c.readInt64,c.writeUint64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeUInt64=c.writeUint64,c.readUint64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!0),c&&(this.offset+=8),f},c.readUInt64=c.readUint64),c.writeFloat32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,i(this.view,a,b,this.littleEndian,23,4),c&&(this.offset+=4),this},c.writeFloat=c.writeFloat32,c.readFloat32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,23,4),b&&(this.offset+=4),c},c.readFloat=c.readFloat32,c.writeFloat64=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=8,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=8,i(this.view,a,b,this.littleEndian,52,8),c&&(this.offset+=8),this},c.writeDouble=c.writeFloat64,c.readFloat64=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,52,8),b&&(this.offset+=8),c},c.readDouble=c.readFloat64,b.MAX_VARINT32_BYTES=5,b.calculateVarint32=function(a){return a>>>=0,128>a?1:16384>a?2:1<<21>a?3:1<<28>a?4:5},b.zigZagEncode32=function(a){return ((a|=0)<<1^a>>31)>>>0},b.zigZagDecode32=function(a){return 0|a>>>1^-(1&a)},c.writeVarint32=function(a,c){var f,e,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(e=b.calculateVarint32(a),c+=e,g=this.buffer.byteLength,c>g&&this.resize((g*=2)>c?g:c),c-=e,a>>>=0;a>=128;)f=128|127&a,this.view[c++]=f,a>>>=7;return this.view[c++]=a,d?(this.offset=c,this):e},c.writeVarint32ZigZag=function(a,c){return this.writeVarint32(b.zigZagEncode32(a),c)},c.readVarint32=function(a){var e,c,d,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}c=0,d=0;do{if(!this.noAssert&&a>this.limit)throw f=Error(\"Truncated\"),f.truncated=!0,f;e=this.view[a++],5>c&&(d|=(127&e)<<7*c),++c;}while(0!==(128&e));return d|=0,b?(this.offset=a,d):{value:d,length:c}},c.readVarint32ZigZag=function(a){var c=this.readVarint32(a);return \"object\"==typeof c?c.value=b.zigZagDecode32(c.value):c=b.zigZagDecode32(c),c},a&&(b.MAX_VARINT64_BYTES=10,b.calculateVarint64=function(b){\"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b));var c=b.toInt()>>>0,d=b.shiftRightUnsigned(28).toInt()>>>0,e=b.shiftRightUnsigned(56).toInt()>>>0;return 0==e?0==d?16384>c?128>c?1:2:1<<21>c?3:4:16384>d?128>d?5:6:1<<21>d?7:8:128>e?9:10},b.zigZagEncode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned()},b.zigZagDecode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned()},c.writeVarint64=function(c,d){var f,g,h,i,j,e=\"undefined\"==typeof d;if(e&&(d=this.offset),!this.noAssert){if(\"number\"==typeof c)c=a.fromNumber(c);else if(\"string\"==typeof c)c=a.fromString(c);else if(!(c&&c instanceof a))throw TypeError(\"Illegal value: \"+c+\" (not an integer or Long)\");if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}switch(\"number\"==typeof c?c=a.fromNumber(c,!1):\"string\"==typeof c?c=a.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),f=b.calculateVarint64(c),g=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,i=c.shiftRightUnsigned(56).toInt()>>>0,d+=f,j=this.buffer.byteLength,d>j&&this.resize((j*=2)>d?j:d),d-=f,f){case 10:this.view[d+9]=1&i>>>7;case 9:this.view[d+8]=9!==f?128|i:127&i;case 8:this.view[d+7]=8!==f?128|h>>>21:127&h>>>21;case 7:this.view[d+6]=7!==f?128|h>>>14:127&h>>>14;case 6:this.view[d+5]=6!==f?128|h>>>7:127&h>>>7;case 5:this.view[d+4]=5!==f?128|h:127&h;case 4:this.view[d+3]=4!==f?128|g>>>21:127&g>>>21;case 3:this.view[d+2]=3!==f?128|g>>>14:127&g>>>14;case 2:this.view[d+1]=2!==f?128|g>>>7:127&g>>>7;case 1:this.view[d]=1!==f?128|g:127&g;}return e?(this.offset+=f,this):f},c.writeVarint64ZigZag=function(a,c){return this.writeVarint64(b.zigZagEncode64(a),c)},c.readVarint64=function(b){var d,e,f,g,h,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+1+\") <= \"+this.buffer.byteLength)}if(d=b,e=0,f=0,g=0,h=0,h=this.view[b++],e=127&h,128&h&&(h=this.view[b++],e|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g|=(127&h)<<7,128&h||this.noAssert&&\"undefined\"==typeof h))))))))))throw Error(\"Buffer overrun\");return i=a.fromBits(e|f<<28,f>>>4|g<<24,!1),c?(this.offset=b,i):{value:i,length:b-d}},c.readVarint64ZigZag=function(c){var d=this.readVarint64(c);return d&&d.value instanceof a?d.value=b.zigZagDecode64(d.value):d=b.zigZagDecode64(d),d}),c.writeCString=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),e=a.length,!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");for(d=0;e>d;++d)if(0===a.charCodeAt(d))throw RangeError(\"Illegal str: Contains NULL-characters\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=k.calculateUTF16asUTF8(f(a))[1],b+=e+1,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=e+1,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),this.view[b++]=0,c?(this.offset=b,this):e},c.readCString=function(a){var c,e,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=a,f=-1,k.decodeUTF8toUTF16(function(){if(0===f)return null;if(a>=this.limit)throw RangeError(\"Illegal range: Truncated data, \"+a+\" < \"+this.limit);return f=this.view[a++],0===f?null:f}.bind(this),e=g(),!0),b?(this.offset=a,e()):{string:e(),length:a-c}},c.writeIString=function(a,b){var e,d,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(d=b,e=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],b+=4+e,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=4+e,this.littleEndian?(this.view[b+3]=255&e>>>24,this.view[b+2]=255&e>>>16,this.view[b+1]=255&e>>>8,this.view[b]=255&e):(this.view[b]=255&e>>>24,this.view[b+1]=255&e>>>16,this.view[b+2]=255&e>>>8,this.view[b+3]=255&e),b+=4,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),b!==d+4+e)throw RangeError(\"Illegal range: Truncated data, \"+b+\" == \"+(b+4+e));return c?(this.offset=b,this):b-d},c.readIString=function(a){var d,e,f,c=\"undefined\"==typeof a;\n  if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readUint32(a),f=this.readUTF8String(e,b.METRICS_BYTES,a+=4),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},b.METRICS_CHARS=\"c\",b.METRICS_BYTES=\"b\",c.writeUTF8String=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=b,d=k.calculateUTF16asUTF8(f(a))[1],b+=d,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=d,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),c?(this.offset=b,this):b-e},c.writeString=c.writeUTF8String,b.calculateUTF8Chars=function(a){return k.calculateUTF16asUTF8(f(a))[0]},b.calculateUTF8Bytes=function(a){return k.calculateUTF16asUTF8(f(a))[1]},b.calculateString=b.calculateUTF8Bytes,c.readUTF8String=function(a,c,d){var e,i,f,h,j;if(\"number\"==typeof c&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),\"undefined\"==typeof c&&(c=b.METRICS_CHARS),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(f=0,h=d,c===b.METRICS_CHARS){if(i=g(),k.decodeUTF8(function(){return a>f&&d<this.limit?this.view[d++]:null}.bind(this),function(a){++f,k.UTF8toUTF16(a,i);}),f!==a)throw RangeError(\"Illegal range: Truncated data, \"+f+\" == \"+a);return e?(this.offset=d,i()):{string:i(),length:d-h}}if(c===b.METRICS_BYTES){if(!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+a+\") <= \"+this.buffer.byteLength)}if(j=d+a,k.decodeUTF8toUTF16(function(){return j>d?this.view[d++]:null}.bind(this),i=g(),this.noAssert),d!==j)throw RangeError(\"Illegal range: Truncated data, \"+d+\" == \"+j);return e?(this.offset=d,i()):{string:i(),length:d-h}}throw TypeError(\"Unsupported metrics: \"+c)},c.readString=c.readUTF8String,c.writeVString=function(a,c){var g,h,e,i,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(e=c,g=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],h=b.calculateVarint32(g),c+=h+g,i=this.buffer.byteLength,c>i&&this.resize((i*=2)>c?i:c),c-=h+g,c+=this.writeVarint32(g,c),k.encodeUTF16toUTF8(f(a),function(a){this.view[c++]=a;}.bind(this)),c!==e+g+h)throw RangeError(\"Illegal range: Truncated data, \"+c+\" == \"+(c+g+h));return d?(this.offset=c,this):c-e},c.readVString=function(a){var d,e,f,c=\"undefined\"==typeof a;if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readVarint32(a),f=this.readUTF8String(e.value,b.METRICS_BYTES,a+=e.length),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},c.append=function(a,c,d){var e,f,g;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(d+=f,g=this.buffer.byteLength,d>g&&this.resize((g*=2)>d?g:d),d-=f,this.view.set(a.view.subarray(a.offset,a.limit),d),a.offset+=f,e&&(this.offset+=f),this)},c.appendTo=function(a,b){return a.append(this,b),this},c.assert=function(a){return this.noAssert=!a,this},c.capacity=function(){return this.buffer.byteLength},c.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},c.clone=function(a){var c=new b(0,this.littleEndian,this.noAssert);return a?(c.buffer=new ArrayBuffer(this.buffer.byteLength),c.view=new Uint8Array(c.buffer)):(c.buffer=this.buffer,c.view=this.view),c.offset=this.offset,c.markedOffset=this.markedOffset,c.limit=this.limit,c},c.compact=function(a,b){var c,e,f;if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return 0===a&&b===this.buffer.byteLength?this:(c=b-a,0===c?(this.buffer=d,this.view=null,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=0,this):(e=new ArrayBuffer(c),f=new Uint8Array(e),f.set(this.view.subarray(a,b)),this.buffer=e,this.view=f,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=c,this))},c.copy=function(a,c){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>a||a>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(a===c)return new b(0,this.littleEndian,this.noAssert);var d=c-a,e=new b(d,this.littleEndian,this.noAssert);return e.offset=0,e.limit=d,e.markedOffset>=0&&(e.markedOffset-=a),this.copyTo(e,0,a,c),e},c.copyTo=function(a,c,d,e){var f,g,h;if(!this.noAssert&&!b.isByteBuffer(a))throw TypeError(\"Illegal target: Not a ByteBuffer\");if(c=(g=\"undefined\"==typeof c)?a.offset:0|c,d=(f=\"undefined\"==typeof d)?this.offset:0|d,e=\"undefined\"==typeof e?this.limit:0|e,0>c||c>a.buffer.byteLength)throw RangeError(\"Illegal target range: 0 <= \"+c+\" <= \"+a.buffer.byteLength);if(0>d||e>this.buffer.byteLength)throw RangeError(\"Illegal source range: 0 <= \"+d+\" <= \"+this.buffer.byteLength);return h=e-d,0===h?a:(a.ensureCapacity(c+h),a.view.set(this.view.subarray(d,e),c),f&&(this.offset+=h),g&&(a.offset+=h),this)},c.ensureCapacity=function(a){var b=this.buffer.byteLength;return a>b?this.resize((b*=2)>a?b:a):this},c.fill=function(a,b,c){var d=\"undefined\"==typeof b;if(d&&(b=this.offset),\"string\"==typeof a&&a.length>0&&(a=a.charCodeAt(0)),\"undefined\"==typeof b&&(b=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal begin: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(b>=c)return this;for(;c>b;)this.view[b++]=a;return d&&(this.offset=b),this},c.flip=function(){return this.limit=this.offset,this.offset=0,this},c.mark=function(a){if(a=\"undefined\"==typeof a?this.offset:a,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return this.markedOffset=a,this},c.order=function(a){if(!this.noAssert&&\"boolean\"!=typeof a)throw TypeError(\"Illegal littleEndian: Not a boolean\");return this.littleEndian=!!a,this},c.LE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!!a:!0,this},c.BE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!a:!1,this},c.prepend=function(a,c,d){var e,f,g,h,i;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(g=f-d,g>0?(h=new ArrayBuffer(this.buffer.byteLength+g),i=new Uint8Array(h),i.set(this.view.subarray(d,this.buffer.byteLength),f),this.buffer=h,this.view=i,this.offset+=g,this.markedOffset>=0&&(this.markedOffset+=g),this.limit+=g,d+=g):new Uint8Array(this.buffer),this.view.set(a.view.subarray(a.offset,a.limit),d-f),a.offset=a.limit,e&&(this.offset-=f),this)},c.prependTo=function(a,b){return a.prepend(this,b),this},c.printDebug=function(a){\"function\"!=typeof a&&(a=console.log.bind(console)),a(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(!0));},c.remaining=function(){return this.limit-this.offset},c.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},c.resize=function(a){var b,c;if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal capacity: \"+a+\" (not an integer)\");if(a|=0,0>a)throw RangeError(\"Illegal capacity: 0 <= \"+a)}return this.buffer.byteLength<a&&(b=new ArrayBuffer(a),c=new Uint8Array(b),c.set(this.view),this.buffer=b,this.view=c),this},c.reverse=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return a===b?this:(Array.prototype.reverse.call(this.view.subarray(a,b)),this)},c.skip=function(a){if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");a|=0;}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+a+\" <= \"+this.buffer.byteLength);return this.offset=b,this},c.slice=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c=this.clone();return c.offset=a,c.limit=b,c},c.toBuffer=function(a){var e,b=this.offset,c=this.limit;if(!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal limit: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}return a||0!==b||c!==this.buffer.byteLength?b===c?d:(e=new ArrayBuffer(c-b),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b,c),0),e):this.buffer},c.toArrayBuffer=c.toBuffer,c.toString=function(a,b,c){if(\"undefined\"==typeof a)return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";switch(\"number\"==typeof a&&(a=\"utf8\",b=a,c=b),a){case\"utf8\":return this.toUTF8(b,c);case\"base64\":return this.toBase64(b,c);case\"hex\":return this.toHex(b,c);case\"binary\":return this.toBinary(b,c);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+a)}},j=function(){var d,e,a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[];for(d=0,e=b.length;e>d;++d)c[b[d]]=d;return a.encode=function(a,c){for(var d,e;null!==(d=a());)c(b[63&d>>2]),e=(3&d)<<4,null!==(d=a())?(e|=15&d>>4,c(b[63&(e|15&d>>4)]),e=(15&d)<<2,null!==(d=a())?(c(b[63&(e|3&d>>6)]),c(b[63&d])):(c(b[63&e]),c(61))):(c(b[63&e]),c(61),c(61));},a.decode=function(a,b){function g(a){throw Error(\"Illegal character code: \"+a)}for(var d,e,f;null!==(d=a());)if(e=c[d],\"undefined\"==typeof e&&g(d),null!==(d=a())&&(f=c[d],\"undefined\"==typeof f&&g(d),b(e<<2>>>0|(48&f)>>4),null!==(d=a()))){if(e=c[d],\"undefined\"==typeof e){if(61===d)break;g(d);}if(b((15&f)<<4>>>0|(60&e)>>2),null!==(d=a())){if(f=c[d],\"undefined\"==typeof f){if(61===d)break;g(d);}b((3&e)<<6>>>0|f);}}},a.test=function(a){return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a)},a}(),c.toBase64=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a=0|a,b=0|b,0>a||b>this.capacity||a>b)throw RangeError(\"begin, end\");var c;return j.encode(function(){return b>a?this.view[a++]:null}.bind(this),c=g()),c()},b.fromBase64=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");var d=new b(3*(a.length/4),c),e=0;return j.decode(f(a),function(a){d.view[e++]=a;}),d.limit=e,d},b.btoa=function(a){return b.fromBinary(a).toBase64()},b.atob=function(a){return b.fromBase64(a).toBinary()},c.toBinary=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a|=0,b|=0,0>a||b>this.capacity()||a>b)throw RangeError(\"begin, end\");if(a===b)return \"\";for(var c=[],d=[];b>a;)c.push(this.view[a++]),c.length>=1024&&(d.push(String.fromCharCode.apply(String,c)),c=[]);return d.join(\"\")+String.fromCharCode.apply(String,c)},b.fromBinary=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");for(var f,d=0,e=a.length,g=new b(e,c);e>d;){if(f=a.charCodeAt(d),f>255)throw RangeError(\"illegal char code: \"+f);g.view[d++]=f;}return g.limit=e,g},c.toDebug=function(a){for(var d,b=-1,c=this.buffer.byteLength,e=\"\",f=\"\",g=\"\";c>b;){if(-1!==b&&(d=this.view[b],e+=16>d?\"0\"+d.toString(16).toUpperCase():d.toString(16).toUpperCase(),a&&(f+=d>32&&127>d?String.fromCharCode(d):\".\")),++b,a&&b>0&&0===b%16&&b!==c){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\",e=f=\"\";}e+=b===this.offset&&b===this.limit?b===this.markedOffset?\"!\":\"|\":b===this.offset?b===this.markedOffset?\"[\":\"<\":b===this.limit?b===this.markedOffset?\"]\":\">\":b===this.markedOffset?\"'\":a||0!==b&&b!==c?\" \":\"\";}if(a&&\" \"!==e){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\";}return a?g:e},b.fromDebug=function(a,c,d){for(var i,j,e=a.length,f=new b(0|(e+1)/3,c,d),g=0,h=0,k=!1,l=!1,m=!1,n=!1,o=!1;e>g;){switch(i=a.charAt(g++)){case\"!\":if(!d){if(l||m||n){o=!0;break}l=m=n=!0;}f.offset=f.markedOffset=f.limit=h,k=!1;break;case\"|\":if(!d){if(l||n){o=!0;break}l=n=!0;}f.offset=f.limit=h,k=!1;break;case\"[\":if(!d){if(l||m){o=!0;break}l=m=!0;}f.offset=f.markedOffset=h,k=!1;break;case\"<\":if(!d){if(l){o=!0;break}l=!0;}f.offset=h,k=!1;break;case\"]\":if(!d){if(n||m){o=!0;break}n=m=!0;}f.limit=f.markedOffset=h,k=!1;break;case\">\":if(!d){if(n){o=!0;break}n=!0;}f.limit=h,k=!1;break;case\"'\":if(!d){if(m){o=!0;break}m=!0;}f.markedOffset=h,k=!1;break;case\" \":k=!1;break;default:if(!d&&k){o=!0;break}if(j=parseInt(i+a.charAt(g++),16),!d&&(isNaN(j)||0>j||j>255))throw TypeError(\"Illegal str: Not a debug encoded string\");f.view[h++]=j,k=!0;}if(o)throw TypeError(\"Illegal str: Invalid symbol at \"+g)}if(!d){if(!l||!n)throw TypeError(\"Illegal str: Missing offset or limit\");if(h<f.buffer.byteLength)throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+h+\" < \"+e)}return f},c.toHex=function(a,b){if(a=\"undefined\"==typeof a?this.offset:a,b=\"undefined\"==typeof b?this.limit:b,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}for(var d,c=new Array(b-a);b>a;)d=this.view[a++],16>d?c.push(\"0\",d.toString(16)):c.push(d.toString(16));return c.join(\"\")},b.fromHex=function(a,c,d){var g,e,f,h,i;if(!d){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(0!==a.length%2)throw TypeError(\"Illegal str: Length not a multiple of 2\")}for(e=a.length,f=new b(0|e/2,c),h=0,i=0;e>h;h+=2){if(g=parseInt(a.substring(h,h+2),16),!d&&(!isFinite(g)||0>g||g>255))throw TypeError(\"Illegal str: Contains non-hex characters\");f.view[i++]=g;}return f.limit=i,f},k=function(){var a={};return a.MAX_CODEPOINT=1114111,a.encodeUTF8=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)128>c?b(127&c):2048>c?(b(192|31&c>>6),b(128|63&c)):65536>c?(b(224|15&c>>12),b(128|63&c>>6),b(128|63&c)):(b(240|7&c>>18),b(128|63&c>>12),b(128|63&c>>6),b(128|63&c)),c=null;},a.decodeUTF8=function(a,b){for(var c,d,e,f,g=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());throw b.name=\"TruncatedError\",b.bytes=a,b};null!==(c=a());)if(0===(128&c))b(c);else if(192===(224&c))null===(d=a())&&g([c,d]),b((31&c)<<6|63&d);else if(224===(240&c))(null===(d=a())||null===(e=a()))&&g([c,d,e]),b((15&c)<<12|(63&d)<<6|63&e);else{if(240!==(248&c))throw RangeError(\"Illegal starting byte: \"+c);(null===(d=a())||null===(e=a())||null===(f=a()))&&g([c,d,e,f]),b((7&c)<<18|(63&d)<<12|(63&e)<<6|63&f);}},a.UTF16toUTF8=function(a,b){for(var c,d=null;;){if(null===(c=null!==d?d:a()))break;c>=55296&&57343>=c&&null!==(d=a())&&d>=56320&&57343>=d?(b(1024*(c-55296)+d-56320+65536),d=null):b(c);}null!==d&&b(d);},a.UTF8toUTF16=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)),c=null;},a.encodeUTF16toUTF8=function(b,c){a.UTF16toUTF8(b,function(b){a.encodeUTF8(b,c);});},a.decodeUTF8toUTF16=function(b,c){a.decodeUTF8(b,function(b){a.UTF8toUTF16(b,c);});},a.calculateCodePoint=function(a){return 128>a?1:2048>a?2:65536>a?3:4},a.calculateUTF8=function(a){for(var b,c=0;null!==(b=a());)c+=128>b?1:2048>b?2:65536>b?3:4;return c},a.calculateUTF16asUTF8=function(b){var c=0,d=0;return a.UTF16toUTF8(b,function(a){++c,d+=128>a?1:2048>a?2:65536>a?3:4;}),[c,d]},a}(),c.toUTF8=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c;try{k.decodeUTF8toUTF16(function(){return b>a?this.view[a++]:null}.bind(this),c=g());}catch(d){if(a!==b)throw RangeError(\"Illegal range: Truncated data, \"+a+\" != \"+b)}return c()},b.fromUTF8=function(a,c,d){if(!d&&\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");var e=new b(k.calculateUTF16asUTF8(f(a),!0)[1],c,d),g=0;return k.encodeUTF16toUTF8(f(a),function(a){e.view[g++]=a;}),e.limit=g,e},b}(c),e=function(b,c){var f,h,i,e={};return e.ByteBuffer=b,e.c=b,f=b,e.Long=c||null,e.VERSION=\"5.0.1\",e.WIRE_TYPES={},e.WIRE_TYPES.VARINT=0,e.WIRE_TYPES.BITS64=1,e.WIRE_TYPES.LDELIM=2,e.WIRE_TYPES.STARTGROUP=3,e.WIRE_TYPES.ENDGROUP=4,e.WIRE_TYPES.BITS32=5,e.PACKABLE_WIRE_TYPES=[e.WIRE_TYPES.VARINT,e.WIRE_TYPES.BITS64,e.WIRE_TYPES.BITS32],e.TYPES={int32:{name:\"int32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},uint64:{name:\"uint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.UZERO:void 0},sint64:{name:\"sint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},bool:{name:\"bool\",wireType:e.WIRE_TYPES.VARINT,defaultValue:!1},\"double\":{name:\"double\",wireType:e.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.UZERO:void 0},sfixed64:{name:\"sfixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.ZERO:void 0},\"float\":{name:\"float\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:e.WIRE_TYPES.STARTGROUP,defaultValue:null}},e.MAP_KEY_TYPES=[e.TYPES.int32,e.TYPES.sint32,e.TYPES.sfixed32,e.TYPES.uint32,e.TYPES.fixed32,e.TYPES.int64,e.TYPES.sint64,e.TYPES.sfixed64,e.TYPES.uint64,e.TYPES.fixed64,e.TYPES.bool,e.TYPES.string,e.TYPES.bytes],e.ID_MIN=1,e.ID_MAX=536870911,e.convertFieldsToCamelCase=!1,e.populateAccessors=!0,e.populateDefaults=!0,e.Util=function(){var a={};return a.IS_NODE=!(\"object\"!=typeof process||\"[object process]\"!=process+\"\"||process.browser),a.XHR=function(){var c,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}],b=null;for(c=0;c<a.length;c++){try{b=a[c]();}catch(d){continue}break}if(!b)throw Error(\"XMLHttpRequest is not supported\");return b},a.fetch=function(b,c){if(c&&\"function\"!=typeof c&&(c=null),a.IS_NODE)if(c)g.readFile(b,function(a,b){a?c(null):c(\"\"+b);});else try{return g.readFileSync(b)}catch(d){return null}else{var e=a.XHR();if(e.open(\"GET\",b,c?!0:!1),e.setRequestHeader(\"Accept\",\"text/plain\"),\"function\"==typeof e.overrideMimeType&&e.overrideMimeType(\"text/plain\"),!c)return e.send(null),200==e.status||0==e.status&&\"string\"==typeof e.responseText?e.responseText:null;if(e.onreadystatechange=function(){4==e.readyState&&(200==e.status||0==e.status&&\"string\"==typeof e.responseText?c(e.responseText):c(null));},4==e.readyState)return;e.send(null);}},a.toCamelCase=function(a){return a.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},a}(),e.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g},e.DotProto=function(a,b){function h(a,c){var d=-1,e=1;if(\"-\"==a.charAt(0)&&(e=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))d=parseInt(a);else if(b.NUMBER_HEX.test(a))d=parseInt(a.substring(2),16);else{if(!b.NUMBER_OCT.test(a))throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);d=parseInt(a.substring(1),8);}if(d=0|e*d,!c&&0>d)throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);return d}function i(a){var c=1;if(\"-\"==a.charAt(0)&&(c=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))return c*parseInt(a,10);if(b.NUMBER_HEX.test(a))return c*parseInt(a.substring(2),16);if(b.NUMBER_OCT.test(a))return c*parseInt(a.substring(1),8);if(\"inf\"===a)return 1/0*c;if(\"nan\"===a)return 0/0;if(b.NUMBER_FLT.test(a))return c*parseFloat(a);throw Error(\"illegal number value: \"+(0>c?\"-\":\"\")+a)}function j(a,b,c){\"undefined\"==typeof a[b]?a[b]=c:(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(c));}var f,g,c={},d=function(a){this.source=a+\"\",this.index=0,this.line=1,this.stack=[],this._stringOpen=null;},e=d.prototype;return e._readString=function(){var c,a='\"'===this._stringOpen?b.STRING_DQ:b.STRING_SQ;if(a.lastIndex=this.index-1,c=a.exec(this.source),!c)throw Error(\"unterminated string\");return this.index=a.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,c[1]},e.next=function(){var a,c,d,e,f,g;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(a=!1;b.WHITESPACE.test(d=this.source.charAt(this.index));)if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;if(\"/\"===this.source.charAt(this.index))if(++this.index,\"/\"===this.source.charAt(this.index)){for(;\"\\n\"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,a=!0;}else{if(\"*\"!==(d=this.source.charAt(this.index)))return \"/\";do{if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;c=d,d=this.source.charAt(this.index);}while(\"*\"!==c||\"/\"!==d);++this.index,a=!0;}}while(a);if(this.index===this.source.length)return null;if(e=this.index,b.DELIM.lastIndex=0,f=b.DELIM.test(this.source.charAt(e++)),!f)for(;e<this.source.length&&!b.DELIM.test(this.source.charAt(e));)++e;return g=this.source.substring(this.index,this.index=e),('\"'===g||\"'\"===g)&&(this._stringOpen=g),g},e.peek=function(){if(0===this.stack.length){var a=this.next();if(null===a)return null;this.stack.push(a);}return this.stack[0]},e.skip=function(a){var b=this.next();if(b!==a)throw Error(\"illegal '\"+b+\"', '\"+a+\"' expected\")},e.omit=function(a){return this.peek()===a?(this.next(),!0):!1},e.toString=function(){return \"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"},c.Tokenizer=d,f=function(a){this.tn=new d(a),this.proto3=!1;},g=f.prototype,g.parse=function(){var c,a={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]},d=!0;try{for(;c=this.tn.next();)switch(c){case\"package\":if(!d||null!==a[\"package\"])throw Error(\"unexpected 'package'\");if(c=this.tn.next(),!b.TYPEREF.test(c))throw Error(\"illegal package name: \"+c);this.tn.skip(\";\"),a[\"package\"]=c;break;case\"import\":if(!d)throw Error(\"unexpected 'import'\");c=this.tn.peek(),\"public\"===c&&this.tn.next(),c=this._readString(),this.tn.skip(\";\"),a.imports.push(c);break;case\"syntax\":if(!d)throw Error(\"unexpected 'syntax'\");this.tn.skip(\"=\"),\"proto3\"===(a.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(\";\");break;case\"message\":this._parseMessage(a,null),d=!1;break;case\"enum\":this._parseEnum(a),d=!1;break;case\"option\":this._parseOption(a);break;case\"service\":this._parseService(a);break;case\"extend\":this._parseExtend(a);break;default:throw Error(\"unexpected '\"+c+\"'\")}}catch(e){throw e.message=\"Parse error at line \"+this.tn.line+\": \"+e.message,e}return delete a.name,a},f.parse=function(a){return new f(a).parse()},g._readString=function(){var b,c,a=\"\";do{if(c=this.tn.next(),\"'\"!==c&&'\"'!==c)throw Error(\"illegal string delimiter: \"+c);a+=this.tn.next(),this.tn.skip(c),b=this.tn.peek();}while('\"'===b||'\"'===b);return a},g._readValue=function(a){var c=this.tn.peek();if('\"'===c||\"'\"===c)return this._readString();if(this.tn.next(),b.NUMBER.test(c))return i(c);if(b.BOOL.test(c))return \"true\"===c.toLowerCase();if(a&&b.TYPEREF.test(c))return c;throw Error(\"illegal value: \"+c)},g._parseOption=function(a,c){var f,d=this.tn.next(),e=!1;if(\"(\"===d&&(e=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal option name: \"+d);f=d,e&&(this.tn.skip(\")\"),f=\"(\"+f+\")\",d=this.tn.peek(),b.FQTYPEREF.test(d)&&(f+=d,this.tn.next())),this.tn.skip(\"=\"),this._parseOptionValue(a,f),c||this.tn.skip(\";\");},g._parseOptionValue=function(a,c){var d=this.tn.peek();if(\"{\"!==d)j(a.options,c,this._readValue(!0));else for(this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());){if(!b.NAME.test(d))throw Error(\"illegal option name: \"+c+\".\"+d);this.tn.omit(\":\")?j(a.options,c+\".\"+d,this._readValue(!0)):this._parseOptionValue(a,c+\".\"+d);}},g._parseService=function(a){var d,e,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal service name at line \"+this.tn.line+\": \"+c);for(d=c,e={name:d,rpc:{},options:{}},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(\"option\"===c)this._parseOption(e);else{if(\"rpc\"!==c)throw Error(\"illegal service token: \"+c);this._parseServiceRPC(e);}this.tn.omit(\";\"),a.services.push(e);},g._parseServiceRPC=function(a){var e,f,c=\"rpc\",d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal rpc service method name: \"+d);if(e=d,f={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.request_stream=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal rpc service request type: \"+d);if(f.request=d,this.tn.skip(\")\"),d=this.tn.next(),\"returns\"!==d.toLowerCase())throw Error(\"illegal rpc service request type delimiter: \"+d);if(this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.response_stream=!0,d=this.tn.next()),f.response=d,this.tn.skip(\")\"),d=this.tn.peek(),\"{\"===d){for(this.tn.next();\"}\"!==(d=this.tn.next());){if(\"option\"!==d)throw Error(\"illegal rpc service token: \"+d);this._parseOption(f);}this.tn.omit(\";\");}else this.tn.skip(\";\");\"undefined\"==typeof a[c]&&(a[c]={}),a[c][e]=f;},g._parseMessage=function(a,c){var d=!!c,e=this.tn.next(),f={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!b.NAME.test(e))throw Error(\"illegal \"+(d?\"group\":\"message\")+\" name: \"+e);for(f.name=e,d&&(this.tn.skip(\"=\"),c.id=h(this.tn.next()),f.isGroup=!0),e=this.tn.peek(),\"[\"===e&&c&&this._parseFieldOptions(c),this.tn.skip(\"{\");\"}\"!==(e=this.tn.next());)if(b.RULE.test(e))this._parseMessageField(f,e);else if(\"oneof\"===e)this._parseMessageOneOf(f);else if(\"enum\"===e)this._parseEnum(f);else if(\"message\"===e)this._parseMessage(f);else if(\"option\"===e)this._parseOption(f);else if(\"service\"===e)this._parseService(f);else if(\"extensions\"===e)f.extensions=this._parseExtensionRanges();else if(\"reserved\"===e)this._parseIgnored();else if(\"extend\"===e)this._parseExtend(f);else{if(!b.TYPEREF.test(e))throw Error(\"illegal message token: \"+e);if(!this.proto3)throw Error(\"illegal field rule: \"+e);this._parseMessageField(f,\"optional\",e);}return this.tn.omit(\";\"),a.messages.push(f),f},g._parseIgnored=function(){for(;\";\"!==this.tn.peek();)this.tn.next();this.tn.skip(\";\");},g._parseMessageField=function(a,c,d){var e,f,g;if(!b.RULE.test(c))throw Error(\"illegal message field rule: \"+c);if(e={rule:c,type:\"\",name:\"\",options:{},id:0},\"map\"===c){if(d)throw Error(\"illegal type: \"+d);if(this.tn.skip(\"<\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field type: \"+f);if(e.keytype=f,this.tn.skip(\",\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field: \"+f);if(e.type=f,this.tn.skip(\">\"),f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}else if(d=\"undefined\"!=typeof d?d:this.tn.next(),\"group\"===d){if(g=this._parseMessage(a,e),!/^[A-Z]/.test(g.name))throw Error(\"illegal group name: \"+g.name);e.type=g.name,e.name=g.name.toLowerCase(),this.tn.omit(\";\");}else{if(!b.TYPE.test(d)&&!b.TYPEREF.test(d))throw Error(\"illegal message field type: \"+d);if(e.type=d,f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);\n  e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}return a.fields.push(e),e},g._parseMessageOneOf=function(a){var e,d,f,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal oneof name: \"+c);for(d=c,f=[],this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)e=this._parseMessageField(a,\"optional\",c),e.oneof=d,f.push(e.id);this.tn.omit(\";\"),a.oneofs[d]=f;},g._parseFieldOptions=function(a){this.tn.skip(\"[\");for(var b,c=!0;\"]\"!==(b=this.tn.peek());)c||this.tn.skip(\",\"),this._parseOption(a,!0),c=!1;this.tn.next();},g._parseEnum=function(a){var e,c={name:\"\",values:[],options:{}},d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);for(c.name=d,this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());)if(\"option\"===d)this._parseOption(c);else{if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);this.tn.skip(\"=\"),e={name:d,id:h(this.tn.next(),!0)},d=this.tn.peek(),\"[\"===d&&this._parseFieldOptions({options:{}}),this.tn.skip(\";\"),c.values.push(e);}this.tn.omit(\";\"),a.enums.push(c);},g._parseExtensionRanges=function(){var c,d,e,b=[];do{for(d=[];;){switch(c=this.tn.next()){case\"min\":e=a.ID_MIN;break;case\"max\":e=a.ID_MAX;break;default:e=i(c);}if(d.push(e),2===d.length)break;if(\"to\"!==this.tn.peek()){d.push(e);break}this.tn.next();}b.push(d);}while(this.tn.omit(\",\"));return this.tn.skip(\";\"),b},g._parseExtend=function(a){var d,c=this.tn.next();if(!b.TYPEREF.test(c))throw Error(\"illegal extend reference: \"+c);for(d={ref:c,fields:[]},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(b.RULE.test(c))this._parseMessageField(d,c);else{if(!b.TYPEREF.test(c))throw Error(\"illegal extend token: \"+c);if(!this.proto3)throw Error(\"illegal field rule: \"+c);this._parseMessageField(d,\"optional\",c);}return this.tn.omit(\";\"),a.messages.push(d),d},g.toString=function(){return \"Parser at line \"+this.tn.line},c.Parser=f,c}(e,e.Lang),e.Reflect=function(a){function k(b){if(\"string\"==typeof b&&(b=a.TYPES[b]),\"undefined\"==typeof b.defaultValue)throw Error(\"default value for type \"+b.name+\" is not supported\");return b==a.TYPES.bytes?new f(0):b.defaultValue}function l(b,c){if(b&&\"number\"==typeof b.low&&\"number\"==typeof b.high&&\"boolean\"==typeof b.unsigned&&b.low===b.low&&b.high===b.high)return new a.Long(b.low,b.high,\"undefined\"==typeof c?b.unsigned:c);if(\"string\"==typeof b)return a.Long.fromString(b,c||!1,10);if(\"number\"==typeof b)return a.Long.fromNumber(b,c||!1);throw Error(\"not convertible to Long\")}function o(b,c){var d=c.readVarint32(),e=7&d,f=d>>>3;switch(e){case a.WIRE_TYPES.VARINT:do d=c.readUint8();while(128===(128&d));break;case a.WIRE_TYPES.BITS64:c.offset+=8;break;case a.WIRE_TYPES.LDELIM:d=c.readVarint32(),c.offset+=d;break;case a.WIRE_TYPES.STARTGROUP:o(f,c);break;case a.WIRE_TYPES.ENDGROUP:if(f===b)return !1;throw Error(\"Illegal GROUPEND after unknown group: \"+f+\" (\"+b+\" expected)\");case a.WIRE_TYPES.BITS32:c.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+b+\": \"+e)}return !0}var g,h,i,j,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,c={},d=function(a,b,c){this.builder=a,this.parent=b,this.name=c,this.className;},e=d.prototype;return e.fqn=function(){for(var a=this.name,b=this;;){if(b=b.parent,null==b)break;a=b.name+\".\"+a;}return a},e.toString=function(a){return (a?this.className+\" \":\"\")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+\" cannot be built directly\")},c.T=d,g=function(a,b,c,e,f){d.call(this,a,b,c),this.className=\"Namespace\",this.children=[],this.options=e||{},this.syntax=f||\"proto2\";},h=g.prototype=Object.create(d.prototype),h.getChildren=function(a){var b,c,d;if(a=a||null,null==a)return this.children.slice();for(b=[],c=0,d=this.children.length;d>c;++c)this.children[c]instanceof a&&b.push(this.children[c]);return b},h.addChild=function(a){var b;if(b=this.getChild(a.name))if(b instanceof m.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else{if(!(a instanceof m.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName)))throw Error(\"Duplicate name in namespace \"+this.toString(!0)+\": \"+a.name);a.name=a.originalName;}this.children.push(a);},h.getChild=function(a){var c,d,b=\"number\"==typeof a?\"id\":\"name\";for(c=0,d=this.children.length;d>c;++c)if(this.children[c][b]===a)return this.children[c];return null},h.resolve=function(a,b){var g,d=\"string\"==typeof a?a.split(\".\"):a,e=this,f=0;if(\"\"===d[f]){for(;null!==e.parent;)e=e.parent;f++;}do{do{if(!(e instanceof c.Namespace)){e=null;break}if(g=e.getChild(d[f]),!(g&&g instanceof c.T&&(!b||g instanceof c.Namespace))){e=null;break}e=g,f++;}while(f<d.length);if(null!=e)break;if(null!==this.parent)return this.parent.resolve(a,b)}while(null!=e);return e},h.qn=function(a){var e,f,b=[],d=a;do b.unshift(d.name),d=d.parent;while(null!==d);for(e=1;e<=b.length;e++)if(f=b.slice(b.length-e),a===this.resolve(f,a instanceof c.Namespace))return f.join(\".\");return a.fqn()},h.build=function(){var e,c,d,a={},b=this.children;for(c=0,d=b.length;d>c;++c)e=b[c],e instanceof g&&(a[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(a,\"$options\",{value:this.buildOpt()}),a},h.buildOpt=function(){var c,d,e,f,a={},b=Object.keys(this.options);for(c=0,d=b.length;d>c;++c)e=b[c],f=this.options[b[c]],a[e]=f;return a},h.getOption=function(a){return \"undefined\"==typeof a?this.options:\"undefined\"!=typeof this.options[a]?this.options[a]:null},c.Namespace=g,i=function(b,c,d,e){if(this.type=b,this.resolvedType=c,this.isMapKey=d,this.syntax=e,d&&a.MAP_KEY_TYPES.indexOf(b)<0)throw Error(\"Invalid map key type: \"+b.name)},j=i.prototype,i.defaultFieldValue=k,j.verifyValue=function(c){var f,g,h,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this);switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),c>4294967295?0|c:c;case a.TYPES.uint32:case a.TYPES.fixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),0>c?c>>>0:c;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if(a.Long)try{return l(c,!1)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.uint64:case a.TYPES.fixed64:if(a.Long)try{return l(c,!0)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.bool:return \"boolean\"!=typeof c&&d(typeof c,\"not a boolean\"),c;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return \"number\"!=typeof c&&d(typeof c,\"not a number\"),c;case a.TYPES.string:return \"string\"==typeof c||c&&c instanceof String||d(typeof c,\"not a string\"),\"\"+c;case a.TYPES.bytes:return b.isByteBuffer(c)?c:b.wrap(c);case a.TYPES[\"enum\"]:for(f=this.resolvedType.getChildren(a.Reflect.Enum.Value),h=0;h<f.length;h++){if(f[h].name==c)return f[h].id;if(f[h].id==c)return f[h].id}if(\"proto3\"===this.syntax)return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),(c>4294967295||0>c)&&d(typeof c,\"not in range for uint32\"),c;d(c,\"not a valid enum value\");case a.TYPES.group:case a.TYPES.message:if(c&&\"object\"==typeof c||d(typeof c,\"object expected\"),c instanceof this.resolvedType.clazz)return c;if(c instanceof a.Builder.Message){g={};for(h in c)c.hasOwnProperty(h)&&(g[h]=c[h]);c=g;}return new this.resolvedType.clazz(c)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(!0)+\": \"+c+\" (undefined type \"+this.type+\")\")},j.calculateLength=function(b,c){if(null===c)return 0;var d;switch(this.type){case a.TYPES.int32:return 0>c?f.calculateVarint64(c):f.calculateVarint32(c);case a.TYPES.uint32:return f.calculateVarint32(c);case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c));case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES[\"float\"]:return 4;case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c);case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c));case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8;case a.TYPES.bool:return 1;case a.TYPES[\"enum\"]:return f.calculateVarint32(c);case a.TYPES[\"double\"]:return 8;case a.TYPES.string:return d=f.calculateUTF8Bytes(c),f.calculateVarint32(d)+d;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");return f.calculateVarint32(c.remaining())+c.remaining();case a.TYPES.message:return d=this.resolvedType.calculate(c),f.calculateVarint32(d)+d;case a.TYPES.group:return d=this.resolvedType.calculate(c),d+f.calculateVarint32(b<<3|a.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")},j.encodeValue=function(b,c,d){var e,g;if(null===c)return d;switch(this.type){case a.TYPES.int32:0>c?d.writeVarint64(c):d.writeVarint32(c);break;case a.TYPES.uint32:d.writeVarint32(c);break;case a.TYPES.sint32:d.writeVarint32ZigZag(c);break;case a.TYPES.fixed32:d.writeUint32(c);break;case a.TYPES.sfixed32:d.writeInt32(c);break;case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c);break;case a.TYPES.sint64:d.writeVarint64ZigZag(c);break;case a.TYPES.fixed64:d.writeUint64(c);break;case a.TYPES.sfixed64:d.writeInt64(c);break;case a.TYPES.bool:\"string\"==typeof c?d.writeVarint32(\"false\"===c.toLowerCase()?0:!!c):d.writeVarint32(c?1:0);break;case a.TYPES[\"enum\"]:d.writeVarint32(c);break;case a.TYPES[\"float\"]:d.writeFloat32(c);break;case a.TYPES[\"double\"]:d.writeFloat64(c);break;case a.TYPES.string:d.writeVString(c);break;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");e=c.offset,d.writeVarint32(c.remaining()),d.append(c),c.offset=e;break;case a.TYPES.message:g=(new f).LE(),this.resolvedType.encode(c,g),d.writeVarint32(g.offset),d.append(g.flip());break;case a.TYPES.group:this.resolvedType.encode(c,d),d.writeVarint32(b<<3|a.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")}return d},j.decode=function(b,c,d){if(c!=this.type.wireType)throw Error(\"Unexpected wire type for element\");var e,f;switch(this.type){case a.TYPES.int32:return 0|b.readVarint32();case a.TYPES.uint32:return b.readVarint32()>>>0;case a.TYPES.sint32:return 0|b.readVarint32ZigZag();case a.TYPES.fixed32:return b.readUint32()>>>0;case a.TYPES.sfixed32:return 0|b.readInt32();case a.TYPES.int64:return b.readVarint64();case a.TYPES.uint64:return b.readVarint64().toUnsigned();case a.TYPES.sint64:return b.readVarint64ZigZag();case a.TYPES.fixed64:return b.readUint64();case a.TYPES.sfixed64:return b.readInt64();case a.TYPES.bool:return !!b.readVarint32();case a.TYPES[\"enum\"]:return b.readVarint32();case a.TYPES[\"float\"]:return b.readFloat();case a.TYPES[\"double\"]:return b.readDouble();case a.TYPES.string:return b.readVString();case a.TYPES.bytes:if(f=b.readVarint32(),b.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+b.remaining());return e=b.clone(),e.limit=e.offset+f,b.offset+=f,e;case a.TYPES.message:return f=b.readVarint32(),this.resolvedType.decode(b,f);case a.TYPES.group:return this.resolvedType.decode(b,-1,d)}throw Error(\"[INTERNAL] Illegal decode type\")},j.valueFromString=function(b){if(!this.isMapKey)throw Error(\"valueFromString() called on non-map-key element\");switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b));case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b);case a.TYPES.bool:return \"true\"===b;case a.TYPES.string:return this.verifyValue(b);case a.TYPES.bytes:return f.fromBinary(b)}},j.valueToString=function(b){if(!this.isMapKey)throw Error(\"valueToString() called on non-map-key element\");return this.type===a.TYPES.bytes?b.toString(\"binary\"):b.toString()},c.Element=i,m=function(a,b,c,d,e,f){g.call(this,a,b,c,d,f),this.className=\"Message\",this.extensions=void 0,this.clazz=null,this.isGroup=!!e,this._fields=null,this._fieldsById=null,this._fieldsByName=null;},n=m.prototype=Object.create(g.prototype),n.build=function(c){var d,h,e,g;if(this.clazz&&!c)return this.clazz;for(d=function(a,c){function k(b,c,d,e){var g,h,i,j,l,m,n;if(null===b||\"object\"!=typeof b)return e&&e instanceof a.Reflect.Enum&&(g=a.Reflect.Enum.getName(e.object,b),null!==g)?g:b;if(f.isByteBuffer(b))return c?b.toBase64():b.toBuffer();if(a.Long.isLong(b))return d?b.toString():a.Long.fromValue(b);if(Array.isArray(b))return h=[],b.forEach(function(a,b){h[b]=k(a,c,d,e);}),h;if(h={},b instanceof a.Map){for(i=b.entries(),j=i.next();!j.done;j=i.next())h[b.keyElem.valueToString(j.value[0])]=k(j.value[1],c,d,b.valueElem.resolvedType);return h}l=b.$type,m=void 0;for(n in b)b.hasOwnProperty(n)&&(h[n]=l&&(m=l.getChild(n))?k(b[n],c,d,m.resolvedType):k(b[n],c,d));return h}var i,j,d=c.getChildren(a.Reflect.Message.Field),e=c.getChildren(a.Reflect.Message.OneOf),g=function(b){var i,j,k,l;for(a.Builder.Message.call(this),i=0,j=e.length;j>i;++i)this[e[i].name]=null;for(i=0,j=d.length;j>i;++i)k=d[i],this[k.name]=k.repeated?[]:k.map?new a.Map(k):null,!k.required&&\"proto3\"!==c.syntax||null===k.defaultValue||(this[k.name]=k.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===b||\"object\"!=typeof b||!(\"function\"!=typeof b.encode||b instanceof g)||Array.isArray(b)||b instanceof a.Map||f.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(i=0,j=arguments.length;j>i;++i)\"undefined\"!=typeof(l=arguments[i])&&this.$set(d[i].name,l);else this.$set(b);},h=g.prototype=Object.create(a.Builder.Message.prototype);for(h.add=function(b,d,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+\"#\"+b+\" is undefined\");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+f.toString(!0));if(!f.repeated)throw Error(this+\"#\"+b+\" is not a repeated field\");d=f.verifyValue(d,!0);}return null===this[b]&&(this[b]=[]),this[b].push(d),this},h.$add=h.add,h.set=function(b,d,e){var f,g,h;if(b&&\"object\"==typeof b){e=d;for(f in b)b.hasOwnProperty(f)&&\"undefined\"!=typeof(d=b[f])&&this.$set(f,d,e);return this}if(g=c._fieldsByName[b],e)this[b]=d;else{if(!g)throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(g instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+g.toString(!0));this[g.name]=d=g.verifyValue(d);}return g&&g.oneof&&(h=this[g.oneof.name],null!==d?(null!==h&&h!==g.name&&(this[h]=null),this[g.oneof.name]=g.name):h===b&&(this[g.oneof.name]=null)),this},h.$set=h.set,h.get=function(b,d){if(d)return this[b];var e=c._fieldsByName[b];if(!(e&&e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+e.toString(!0));return this[e.name]},h.$get=h.get,i=0;i<d.length;i++)j=d[i],j instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var d,e,f,b=a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace(\"_\",\"\")});b=b.substring(0,1).toUpperCase()+b.substring(1),d=a.originalName.replace(/([A-Z])/g,function(a){return \"_\"+a}),e=function(b,c){return this[a.name]=c?b:a.verifyValue(b),this},f=function(){return this[a.name]},null===c.getChild(\"set\"+b)&&(h[\"set\"+b]=e),null===c.getChild(\"set_\"+d)&&(h[\"set_\"+d]=e),null===c.getChild(\"get\"+b)&&(h[\"get\"+b]=f),null===c.getChild(\"get_\"+d)&&(h[\"get_\"+d]=f);}(j);return h.encode=function(a,d){var e,f;\"boolean\"==typeof a&&(d=a,a=void 0),e=!1,a||(a=new b,e=!0),f=a.littleEndian;try{return c.encode(this,a.LE(),d),(e?a.flip():a).LE(f)}catch(g){throw a.LE(f),g}},g.encode=function(a,b,c){return new g(a).encode(b,c)},h.calculate=function(){return c.calculate(this)},h.encodeDelimited=function(a){var d,b=!1;return a||(a=new f,b=!0),d=(new f).LE(),c.encode(this,d).flip(),a.writeVarint32(d.remaining()),a.append(d),b?a.flip():a},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toArrayBuffer()),a}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a}},h.toHex=h.encodeHex,h.toRaw=function(a,b){return k(this,!!a,!!b,this.$type)},h.encodeJSON=function(){return JSON.stringify(k(this,!0,!0,this.$type))},g.decode=function(a,b){var d,e;\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),d=a.littleEndian;try{return e=c.decode(a.LE()),a.LE(d),e}catch(g){throw a.LE(d),g}},g.decodeDelimited=function(a,b){var d,e,g;if(\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),a.remaining()<1)return null;if(d=a.offset,e=a.readVarint32(),a.remaining()<e)return a.offset=d,null;try{return g=c.decode(a.slice(a.offset,a.offset+e).LE()),a.offset+=e,g}catch(h){throw a.offset+=e,h}},g.decode64=function(a){return g.decode(a,\"base64\")},g.decodeHex=function(a){return g.decode(a,\"hex\")},g.decodeJSON=function(a){return new g(JSON.parse(a))},h.toString=function(){return c.toString()},Object.defineProperty&&(Object.defineProperty(g,\"$options\",{value:c.buildOpt()}),Object.defineProperty(h,\"$options\",{value:g[\"$options\"]}),Object.defineProperty(g,\"$type\",{value:c}),Object.defineProperty(h,\"$type\",{value:c})),g}(a,this),this._fields=[],this._fieldsById={},this._fieldsByName={},e=0,g=this.children.length;g>e;e++)if(h=this.children[e],h instanceof t||h instanceof m||h instanceof x){if(d.hasOwnProperty(h.name))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+h.toString(!0)+\" cannot override static property '\"+h.name+\"'\");d[h.name]=h.build();}else if(h instanceof m.Field)h.build(),this._fields.push(h),this._fieldsById[h.id]=h,this._fieldsByName[h.name]=h;else if(!(h instanceof m.OneOf||h instanceof w))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+this.children[e].toString(!0));return this.clazz=d},n.encode=function(a,b,c){var e,h,f,g,i,d=null;for(f=0,g=this._fields.length;g>f;++f)e=this._fields[f],h=a[e.name],e.required&&null===h?null===d&&(d=e):e.encode(c?h:e.verifyValue(h),b,a);if(null!==d)throw i=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+d),i.encoded=b,i;return b},n.calculate=function(a){for(var e,f,b=0,c=0,d=this._fields.length;d>c;++c){if(e=this._fields[c],f=a[e.name],e.required&&null===f)throw Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+e);b+=e.calculate(f,a);}return b},n.decode=function(b,c,d){var g,h,i,j,e,f,k,l,m,n,p,q;for(c=\"number\"==typeof c?c:-1,e=b.offset,f=new this.clazz;b.offset<e+c||-1===c&&b.remaining()>0;){if(g=b.readVarint32(),h=7&g,i=g>>>3,h===a.WIRE_TYPES.ENDGROUP){if(i!==d)throw Error(\"Illegal group end indicator for \"+this.toString(!0)+\": \"+i+\" (\"+(d?d+\" expected\":\"not a group\")+\")\");break}if(j=this._fieldsById[i])j.repeated&&!j.options.packed?f[j.name].push(j.decode(h,b)):j.map?(l=j.decode(h,b),f[j.name].set(l[0],l[1])):(f[j.name]=j.decode(h,b),j.oneof&&(m=f[j.oneof.name],null!==m&&m!==j.name&&(f[m]=null),f[j.oneof.name]=j.name));else switch(h){case a.WIRE_TYPES.VARINT:b.readVarint32();break;case a.WIRE_TYPES.BITS32:b.offset+=4;break;case a.WIRE_TYPES.BITS64:b.offset+=8;break;case a.WIRE_TYPES.LDELIM:k=b.readVarint32(),b.offset+=k;break;case a.WIRE_TYPES.STARTGROUP:for(;o(i,b););break;default:throw Error(\"Illegal wire type for unknown field \"+i+\" in \"+this.toString(!0)+\"#decode: \"+h)}}for(n=0,p=this._fields.length;p>n;++n)if(j=this._fields[n],null===f[j.name])if(\"proto3\"===this.syntax)f[j.name]=j.defaultValue;else{if(j.required)throw q=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+j.name),q.decoded=f,q;a.populateDefaults&&null!==j.defaultValue&&(f[j.name]=j.defaultValue);}return f},c.Message=m,p=function(b,c,e,f,g,h,i,j,k,l){d.call(this,b,c,h),this.className=\"Message.Field\",this.required=\"required\"===e,this.repeated=\"repeated\"===e,this.map=\"map\"===e,this.keyType=f||null,this.type=g,this.resolvedType=null,this.id=i,this.options=j||{},this.defaultValue=null,this.oneof=k||null,this.syntax=l||\"proto2\",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof m.ExtensionField||(this.name=a.Util.toCamelCase(this.name));},q=p.prototype=Object.create(d.prototype),q.build=function(){this.element=new i(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new i(this.keyType,void 0,!0,this.syntax)),\"proto3\"!==this.syntax||this.repeated||this.map?\"undefined\"!=typeof this.options[\"default\"]&&(this.defaultValue=this.verifyValue(this.options[\"default\"])):this.defaultValue=i.defaultFieldValue(this.type);},q.verifyValue=function(b,c){var d,e,f;if(c=c||!1,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this),null===b)return this.required&&d(typeof b,\"required\"),\"proto3\"===this.syntax&&this.type!==a.TYPES.message&&d(typeof b,\"proto3 field without field presence cannot be null\"),null;if(this.repeated&&!c){for(Array.isArray(b)||(b=[b]),f=[],e=0;e<b.length;e++)f.push(this.element.verifyValue(b[e]));return f}return this.map&&!c?b instanceof a.Map?b:(b instanceof Object||d(typeof b,\"expected ProtoBuf.Map or raw object for map field\"),new a.Map(this,b)):(!this.repeated&&Array.isArray(b)&&d(typeof b,\"no array expected\"),this.element.verifyValue(b))},q.hasWirePresence=function(b,c){if(\"proto3\"!==this.syntax)return null!==b;if(this.oneof&&c[this.oneof.name]===this.name)return !0;switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return 0!==b;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return 0!==b.low||0!==b.high;case a.TYPES.bool:return b;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return 0!==b;case a.TYPES.string:return b.length>0;case a.TYPES.bytes:return b.remaining()>0;case a.TYPES[\"enum\"]:return 0!==b;case a.TYPES.message:return null!==b;default:return !0}},q.encode=function(b,c,d){var e,g,h,i,j;if(null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return c;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.ensureCapacity(c.offset+=1),g=c.offset,e=0;e<b.length;e++)this.element.encodeValue(this.id,b[e],c);h=c.offset-g,i=f.calculateVarint32(h),i>1&&(j=c.slice(g,c.offset),g+=i-1,c.offset=g,c.append(j)),c.writeVarint32(h,g-i);}else for(e=0;e<b.length;e++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[e],c);else this.map?b.forEach(function(b,d){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.writeVarint32(g),c.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,d,c),c.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,b,c);},this):this.hasWirePresence(b,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,c));}catch(k){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+k+\")\")}return c},q.calculate=function(b,c){var d,e,g;if(b=this.verifyValue(b),null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return 0;d=0;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),g=0,e=0;e<b.length;e++)g+=this.element.calculateLength(this.id,b[e]);d+=f.calculateVarint32(g),d+=g;}else for(e=0;e<b.length;e++)d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b[e]);else this.map?b.forEach(function(b,c){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),d+=f.calculateVarint32(g),d+=g;},this):this.hasWirePresence(b,c)&&(d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b));}catch(h){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+h+\")\")}return d},q.decode=function(b,c,d){var e,f,h,j,k,l,m,g=!this.map&&b==this.type.wireType||!d&&this.repeated&&this.options.packed&&b==a.WIRE_TYPES.LDELIM||this.map&&b==a.WIRE_TYPES.LDELIM;if(!g)throw Error(\"Illegal wire type for field \"+this.toString(!0)+\": \"+b+\" (\"+this.type.wireType+\" expected)\");if(b==a.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!d){for(f=c.readVarint32(),f=c.offset+f,h=[];c.offset<f;)h.push(this.decode(this.type.wireType,c,!0));return h}if(this.map){if(j=i.defaultFieldValue(this.keyType),e=i.defaultFieldValue(this.type),f=c.readVarint32(),c.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+c.remaining());for(k=c.clone(),k.limit=k.offset+f,c.offset+=f;k.remaining()>0;)if(l=k.readVarint32(),b=7&l,m=l>>>3,1===m)j=this.keyElement.decode(k,b,m);else{if(2!==m)throw Error(\"Unexpected tag in map field key/value submessage\");e=this.element.decode(k,b,m);}return [j,e]}return this.element.decode(c,b,this.id)},c.Message.Field=p,r=function(a,b,c,d,e,f,g){p.call(this,a,b,c,null,d,e,f,g),this.extension;},r.prototype=Object.create(p.prototype),c.Message.ExtensionField=r,s=function(a,b,c){d.call(this,a,b,c),this.fields=[];},c.Message.OneOf=s,t=function(a,b,c,d,e){g.call(this,a,b,c,d,e),this.className=\"Enum\",this.object=null;},t.getName=function(a,b){var e,d,c=Object.keys(a);for(d=0;d<c.length;++d)if(a[e=c[d]]===b)return e;return null},u=t.prototype=Object.create(g.prototype),u.build=function(b){var c,d,e,f;if(this.object&&!b)return this.object;for(c=new a.Builder.Enum,d=this.getChildren(t.Value),e=0,f=d.length;f>e;++e)c[d[e][\"name\"]]=d[e][\"id\"];return Object.defineProperty&&Object.defineProperty(c,\"$options\",{value:this.buildOpt(),enumerable:!1}),this.object=c},c.Enum=t,v=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Enum.Value\",this.id=e;},v.prototype=Object.create(d.prototype),c.Enum.Value=v,w=function(a,b,c,e){d.call(this,a,b,c),this.field=e;},w.prototype=Object.create(d.prototype),c.Extension=w,x=function(a,b,c,d){g.call(this,a,b,c,d),this.className=\"Service\",this.clazz=null;},y=x.prototype=Object.create(g.prototype),y.build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(a,b){var g,c=function(b){a.Builder.Service.call(this),this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0);};},d=c.prototype=Object.create(a.Builder.Service.prototype),e=b.getChildren(a.Reflect.Service.RPCMethod);for(g=0;g<e.length;g++)!function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(f.wrap(c));}catch(e){if(!(e instanceof TypeError))throw e}if(null===c||\"object\"!=typeof c)throw Error(\"Illegal arguments\");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c)),this.rpcImpl(a.fqn(),c,function(c,e){if(c)return d(c),void 0;try{e=a.resolvedResponseType.clazz.decode(e);}catch(f){}return e&&e instanceof a.resolvedResponseType.clazz?(d(null,e),void 0):(d(Error(\"Illegal response type received in service method \"+b.name+\"#\"+a.name)),void 0)});}catch(e){setTimeout(d.bind(this,e),0);}},c[a.name]=function(b,d,e){new c(b)[a.name](d,e);},Object.defineProperty&&(Object.defineProperty(c[a.name],\"$options\",{value:a.buildOpt()}),Object.defineProperty(d[a.name],\"$options\",{value:c[a.name][\"$options\"]}));}(e[g]);return Object.defineProperty&&(Object.defineProperty(c,\"$options\",{value:b.buildOpt()}),Object.defineProperty(d,\"$options\",{value:c[\"$options\"]}),Object.defineProperty(c,\"$type\",{value:b}),Object.defineProperty(d,\"$type\",{value:b})),c}(a,this)},c.Service=x,z=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Service.Method\",this.options=e||{};},A=z.prototype=Object.create(d.prototype),A.buildOpt=h.buildOpt,c.Service.Method=z,B=function(a,b,c,d,e,f,g,h){z.call(this,a,b,c,h),this.className=\"Service.RPCMethod\",this.requestName=d,this.responseName=e,this.requestStream=f,this.responseStream=g,this.resolvedRequestType=null,this.resolvedResponseType=null;},B.prototype=Object.create(z.prototype),c.Service.RPCMethod=B,c}(e),e.Builder=function(a,b,c){function f(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax,f(b);}),a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax;});}var d=function(a){this.ns=new c.Namespace(this,null,\"\"),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=a||{};},e=d.prototype;return d.isMessage=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values||\"undefined\"!=typeof a.rpc?!1:!0},d.isMessageField=function(a){return \"string\"!=typeof a.rule||\"string\"!=typeof a.name||\"string\"!=typeof a.type||\"undefined\"==typeof a.id?!1:!0},d.isEnum=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1},d.isService=function(a){return \"string\"==typeof a.name&&\"object\"==typeof a.rpc&&a.rpc?!0:!1},d.isExtend=function(a){return \"string\"!=typeof a.ref?!1:!0},e.reset=function(){return this.ptr=this.ns,this},e.define=function(a){if(\"string\"!=typeof a||!b.TYPEREF.test(a))throw Error(\"illegal namespace: \"+a);return a.split(\".\").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new c.Namespace(this,this.ptr,a)),this.ptr=b;},this),this},e.create=function(b){var e,f,g,h,i;if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice();}else b=[b];for(e=[b];e.length>0;){if(b=e.pop(),!Array.isArray(b))throw Error(\"not a valid namespace: \"+JSON.stringify(b));for(;b.length>0;){if(f=b.shift(),d.isMessage(f)){if(g=new c.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),h={},f.oneofs&&Object.keys(f.oneofs).forEach(function(a){g.addChild(h[a]=new c.Message.OneOf(this,g,a));},this),f.fields&&f.fields.forEach(function(a){if(null!==g.getChild(0|a.id))throw Error(\"duplicate or invalid field id in \"+g.name+\": \"+a.id);if(a.options&&\"object\"!=typeof a.options)throw Error(\"illegal field options in \"+g.name+\"#\"+a.name);var b=null;if(\"string\"==typeof a.oneof&&!(b=h[a.oneof]))throw Error(\"illegal oneof in \"+g.name+\"#\"+a.name+\": \"+a.oneof);a=new c.Message.Field(this,g,a.rule,a.keytype,a.type,a.name,a.id,a.options,b,f.syntax),b&&b.fields.push(a),g.addChild(a);},this),i=[],f.enums&&f.enums.forEach(function(a){i.push(a);}),f.messages&&f.messages.forEach(function(a){i.push(a);}),f.services&&f.services.forEach(function(a){i.push(a);}),f.extensions&&(g.extensions=\"number\"==typeof f.extensions[0]?[f.extensions]:f.extensions),this.ptr.addChild(g),i.length>0){e.push(b),b=i,i=null,this.ptr=g,g=null;continue}i=null;}else if(d.isEnum(f))g=new c.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(a){g.addChild(new c.Enum.Value(this,g,a.name,a.id));},this),this.ptr.addChild(g);else if(d.isService(f))g=new c.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(a){var b=f.rpc[a];g.addChild(new c.Service.RPCMethod(this,g,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options));},this),this.ptr.addChild(g);else{if(!d.isExtend(f))throw Error(\"not a valid definition: \"+JSON.stringify(f));if(g=this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){var d,e,f,h;if(null!==g.getChild(0|b.id))throw Error(\"duplicate extended field id in \"+g.name+\": \"+b.id);\n  if(g.extensions&&(d=!1,g.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(d=!0);}),!d))throw Error(\"illegal extended field id in \"+g.name+\": \"+b.id+\" (not within valid ranges)\");e=b.name,this.options.convertFieldsToCamelCase&&(e=a.Util.toCamelCase(e)),f=new c.Message.ExtensionField(this,g,b.rule,b.type,this.ptr.fqn()+\".\"+e,b.id,b.options),h=new c.Extension(this,this.ptr,b.name,f),f.extension=h,this.ptr.addChild(h),g.addChild(f);},this);else if(!/\\.?google\\.protobuf\\./.test(f.ref))throw Error(\"extended message \"+f.ref+\" is not defined\")}f=null,g=null;}b=null,this.ptr=this.ptr.parent;}return this.resolved=!1,this.result=null,this},e[\"import\"]=function(b,c){var e,g,h,i,j,k,l,m,d=\"/\";if(\"string\"==typeof c){if(a.Util.IS_NODE,this.files[c]===!0)return this.reset();this.files[c]=!0;}else if(\"object\"==typeof c){if(e=c.root,a.Util.IS_NODE,(e.indexOf(\"\\\\\")>=0||c.file.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\"),g=e+d+c.file,this.files[g]===!0)return this.reset();this.files[g]=!0;}if(b.imports&&b.imports.length>0){for(i=!1,\"object\"==typeof c?(this.importRoot=c.root,i=!0,h=this.importRoot,c=c.file,(h.indexOf(\"\\\\\")>=0||c.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\")):\"string\"==typeof c?this.importRoot?h=this.importRoot:c.indexOf(\"/\")>=0?(h=c.replace(/\\/[^\\/]*$/,\"\"),\"\"===h&&(h=\"/\")):c.indexOf(\"\\\\\")>=0?(h=c.replace(/\\\\[^\\\\]*$/,\"\"),d=\"\\\\\"):h=\".\":h=null,j=0;j<b.imports.length;j++)if(\"string\"==typeof b.imports[j]){if(!h)throw Error(\"cannot determine import root\");if(k=b.imports[j],\"google/protobuf/descriptor.proto\"===k)continue;if(k=h+d+k,this.files[k]===!0)continue;if(/\\.proto$/i.test(k)&&!a.DotProto&&(k=k.replace(/\\.proto$/,\".json\")),l=a.Util.fetch(k),null===l)throw Error(\"failed to import '\"+k+\"' in '\"+c+\"': file not found\");/\\.json$/i.test(k)?this[\"import\"](JSON.parse(l+\"\"),k):this[\"import\"](a.DotProto.Parser.parse(l),k);}else c?/\\.(\\w+)$/.test(c)?this[\"import\"](b.imports[j],c.replace(/^(.+)\\.(\\w+)$/,function(a,b,c){return b+\"_import\"+j+\".\"+c})):this[\"import\"](b.imports[j],c+\"_import\"+j):this[\"import\"](b.imports[j]);i&&(this.importRoot=null);}return b[\"package\"]&&this.define(b[\"package\"]),b.syntax&&f(b),m=this.ptr,b.options&&Object.keys(b.options).forEach(function(a){m.options[a]=b.options[a];}),b.messages&&(this.create(b.messages),this.ptr=m),b.enums&&(this.create(b.enums),this.ptr=m),b.services&&(this.create(b.services),this.ptr=m),b[\"extends\"]&&this.create(b[\"extends\"]),this.reset()},e.resolveAll=function(){var d;if(null==this.ptr||\"object\"==typeof this.ptr.type)return this;if(this.ptr instanceof c.Namespace)this.ptr.children.forEach(function(a){this.ptr=a,this.resolveAll();},this);else if(this.ptr instanceof c.Message.Field){if(b.TYPE.test(this.ptr.type))this.ptr.type=a.TYPES[this.ptr.type];else{if(!b.TYPEREF.test(this.ptr.type))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(d=(this.ptr instanceof c.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!d)throw Error(\"unresolvable type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(this.ptr.resolvedType=d,d instanceof c.Enum){if(this.ptr.type=a.TYPES[\"enum\"],\"proto3\"===this.ptr.syntax&&\"proto3\"!==d.syntax)throw Error(\"proto3 message cannot reference proto2 enum\")}else{if(!(d instanceof c.Message))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);this.ptr.type=d.isGroup?a.TYPES.group:a.TYPES.message;}}if(this.ptr.map){if(!b.TYPE.test(this.ptr.keyType))throw Error(\"illegal key type for map field in \"+this.ptr.toString(!0)+\": \"+this.ptr.keyType);this.ptr.keyType=a.TYPES[this.ptr.keyType];}}else if(this.ptr instanceof a.Reflect.Service.Method){if(!(this.ptr instanceof a.Reflect.Service.RPCMethod))throw Error(\"illegal service type in \"+this.ptr.toString(!0));if(d=this.ptr.parent.resolve(this.ptr.requestName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.requestName);if(this.ptr.resolvedRequestType=d,d=this.ptr.parent.resolve(this.ptr.responseName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.responseName);this.ptr.resolvedResponseType=d;}else if(!(this.ptr instanceof a.Reflect.Message.OneOf||this.ptr instanceof a.Reflect.Extension||this.ptr instanceof a.Reflect.Enum.Value))throw Error(\"illegal object in namespace: \"+typeof this.ptr+\": \"+this.ptr);return this.reset()},e.build=function(a){var b,c,d;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!a)return this.result;for(b=\"string\"==typeof a?a.split(\".\"):a,c=this.result,d=0;d<b.length;d++){if(!c[b[d]]){c=null;break}c=c[b[d]];}return c},e.lookup=function(a,b){return a?this.ns.resolve(a,b):this.ns},e.toString=function(){return \"Builder\"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(e,e.Lang,e.Reflect),e.Map=function(a,b){function e(a){var b=0;return {next:function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}}var c=function(a,c){var d,e,f,g;if(!a.map)throw Error(\"field is not a map\");if(this.field=a,this.keyElem=new b.Element(a.keyType,null,!0,a.syntax),this.valueElem=new b.Element(a.type,a.resolvedType,!1,a.syntax),this.map={},Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}}),c)for(d=Object.keys(c),e=0;e<d.length;e++)f=this.keyElem.valueFromString(d[e]),g=this.valueElem.verifyValue(c[d[e]]),this.map[this.keyElem.valueToString(f)]={key:f,value:g};},d=c.prototype;return d.clear=function(){this.map={};},d[\"delete\"]=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a)),c=b in this.map;return delete this.map[b],c},d.entries=function(){var d,c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push([(d=this.map[b[c]]).key,d.value]);return e(a)},d.keys=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].key);return e(a)},d.values=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].value);return e(a)},d.forEach=function(a,b){var e,d,c=Object.keys(this.map);for(d=0;d<c.length;d++)a.call(b,(e=this.map[c[d]]).value,e.key,this);},d.set=function(a,b){var c=this.keyElem.verifyValue(a),d=this.valueElem.verifyValue(b);return this.map[this.keyElem.valueToString(c)]={key:c,value:d},this},d.get=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map?this.map[b].value:void 0},d.has=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map},c}(e,e.Reflect),e.loadProto=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=void 0),e.loadJson(e.DotProto.Parser.parse(a),b,c)},e.protoFromString=e.loadProto,e.loadProtoFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadProto(d,c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadProto(d,c,a)},e.protoFromFile=e.loadProtoFile,e.newBuilder=function(a){return a=a||{},\"undefined\"==typeof a.convertFieldsToCamelCase&&(a.convertFieldsToCamelCase=e.convertFieldsToCamelCase),\"undefined\"==typeof a.populateAccessors&&(a.populateAccessors=e.populateAccessors),new e.Builder(a)},e.loadJson=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=null),b&&\"object\"==typeof b||(b=e.newBuilder()),\"string\"==typeof a&&(a=JSON.parse(a)),b[\"import\"](a,c),b.resolveAll(),b},e.loadJsonFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadJson(JSON.parse(d),c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadJson(JSON.parse(d),c,a)},h=a,i=e.loadProto(h,void 0,\"\").build(\"Modules\").probuf}(d,c,b);return e}\n\n  var SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message \" + PBName.SetUserStatusInput + \"\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \" + PBName.NotifyMsg + \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SyncRequestMsg + \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \" + PBName.UpStreamMessage + \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n  }\\n  message \" + PBName.DownStreamMessages + \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \" + PBName.DownStreamMessage + \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = \" + FILE_TYPE.IMAGE + \";\\n    audio = \" + FILE_TYPE.AUDIO + \";\\n    video = \" + FILE_TYPE.VIDEO + \";\\n    file = \" + FILE_TYPE.FILE + \";\\n  }\\n  message \" + PBName.GetQNupTokenInput + \" {\\n    required FileType type = 1;\\n  }\\n  message \" + PBName.GetQNdownloadUrlInput + \" {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message \" + PBName.GetQNupTokenOutput + \" {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n  }\\n  message \" + PBName.GetQNdownloadUrlOutput + \" {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \" + PBName.ChrmInput + \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.ChrmPullMsg + \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.RelationQryInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \" + PBName.RelationsInput + \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \" + PBName.RelationsOutput + \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \" + PBName.CleanHisMsgInput + \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \" + PBName.QueryChatRoomInfoInput + \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \" + PBName.QueryChatRoomInfoOutput + \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message \" + PBName.MCFollowInput + \"\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \" + PBName.HistoryMsgInput + \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \" + PBName.HistoryMsgOuput + \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message \" + PBName.RtcQueryListInput + \"{\\n    optional int32 order=1;\\n  }\\n\\n  message \" + PBName.RtcKeyDeleteInput + \"{\\n    repeated string key=1;\\n  }\\n\\n  message \" + PBName.RtcValueInfo + \"{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated \" + PBName.RtcValueInfo + \" userData=2;\\n  }\\n\\n  message \" + PBName.RtcUserListOutput + \"{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated \" + PBName.RtcValueInfo + \" roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message \" + PBName.RtcInput + \"{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message \" + PBName.RtcQryOutput + \"{\\n    repeated \" + PBName.RtcValueInfo + \" outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message \" + PBName.RtcDataInput + \"{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message \" + PBName.RtcSetDataInput + \"{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.RtcTokenOutput + \"{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message \" + PBName.RtcSetOutDataInput + \"{\\n    required targetType target=1;\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message \" + PBName.RtcQryUserOutDataInput + \"{\\n    repeated string userId = 1;\\n  }\\n  message \" + PBName.RtcUserOutDataOutput + \"{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \" + PBName.SessionsAttQryInput + \"{\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.SessionsAttOutput + \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \" + PBName.SessionMsgReadInput + \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteSessionsInput + \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \" + PBName.SessionInfo + \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \" + PBName.DeleteSessionsOutput + \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteMsgInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n  message ChrmKVEntity {\\n    required string key = 1;\\n    required string value = 2;\\n    optional int32 status = 3;\\n    optional int64 timestamp = 4;\\n    optional string uid = 5;\\n  }\\n  message \" + PBName.SetChrmKV + \" {\\n    required ChrmKVEntity entry = 1;\\n    optional bool bNotify = 2;\\n    optional UpStreamMessage notification = 3;\\n    optional ChannelType type = 4;\\n  }\\n  message \" + PBName.ChrmKVOutput + \" {\\n    repeated ChrmKVEntity entries = 1;\\n    optional bool bFullUpdate = 2;\\n    optional int64 syncTime = 3;\\n  }\\n  message \" + PBName.QueryChrmKV + \" {\\n    required int64 timestamp = 1;\\n  }\\n  message \" + PBName.ChrmNotifyMsg + \" {\\t\\n    required int32 type= 1;\\n    optional int64 time= 2;\\n    optional string chrmId=3;\\n  }\\n}\\n\";\n\n  var Codec$1 = {};\n\n  try {\n    Codec$1 = protobuf(SSMsg$1);\n  } catch (e) {\n    Codec$1 = {};\n  }\n\n  Codec$1.getModule = function (pbName) {\n    var modules = new Codec$1[pbName]();\n\n    modules.getArrayData = function () {\n      var data = modules.toArrayBuffer();\n      data = utils.ArrayBufferToArray(data);\n      return data;\n    };\n\n    return modules;\n  };\n\n  var SocketCodec = Codec$1;\n\n  var isGroup$1 = common.isGroup,\n      isChatRoom$1 = common.isChatRoom;\n\n  var Codec$2 = function () {\n    function Codec$$1(option) {\n      this.codec = SocketCodec;\n      option = option || {};\n      var type = option.connectType;\n      type && this.setCodecType(type);\n    }\n\n    var _proto = Codec$$1.prototype;\n\n    _proto.setCodecType = function setCodecType(type) {\n      this.codec = type === CONNECT_TYPE.COMET ? Codec : SocketCodec;\n    };\n\n    _proto.decodeByPBName = function decodeByPBName(data, pbName, option) {\n      var _formatEventMap;\n\n      var self = this;\n      var formatEventMap = (_formatEventMap = {}, _formatEventMap[PBName.DownStreamMessages] = self.formatSyncMessages, _formatEventMap[PBName.DownStreamMessage] = self.formatReceivedMessage, _formatEventMap[PBName.UpStreamMessage] = self.formatSentMessage, _formatEventMap[PBName.HistoryMsgOuput] = self.formatHistoryMessages, _formatEventMap[PBName.RelationsOutput] = self.formatConversationList, _formatEventMap[PBName.QueryChatRoomInfoOutput] = self.formatChatRoomInfos, _formatEventMap[PBName.RtcUserListOutput] = self.formatRTCUserList, _formatEventMap[PBName.RtcQryOutput] = self.formatRTCData, _formatEventMap[PBName.ChrmKVOutput] = self.formatChatRoomKVList, _formatEventMap);\n      var decodedData = data;\n      var formatEvent = formatEventMap[pbName];\n\n      try {\n        decodedData = self.codec[pbName].decode(data);\n\n        if (utils.isObject(decodedData)) {\n          decodedData = utils.batchInt64ToTimestamp(decodedData);\n        }\n\n        if (utils.isFunction(formatEvent)) {\n          decodedData = formatEvent.call(self, decodedData, option);\n        }\n      } catch (e) {}\n\n      return decodedData;\n    };\n\n    _proto.formatMessageContent = function formatMessageContent(content) {\n      try {\n        var _content = content,\n            offset = _content.offset,\n            buffer = _content.buffer,\n            limit = _content.limit;\n\n        if (offset) {\n          content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit);\n          content = BinaryHelper.readUTF(content);\n        }\n\n        content = utils.parseJSON(content);\n      } catch (e) {}\n\n      return content;\n    };\n\n    _proto.formatSyncMessages = function formatSyncMessages(data, option) {\n      option = option || {};\n      var self = this,\n          onMessage = option.onMessage || utils.noop,\n          list = data.list,\n          syncTime = data.syncTime,\n          maxListIndex = list.length - 1;\n      var finished = data.finished;\n\n      if (utils.isUndefined(finished)) {\n        data.finished = finished = true;\n      }\n\n      data.syncTime = utils.int64ToTimestamp(syncTime);\n      data.list = utils.map(list, function (msgData, index) {\n        var message = self.formatReceivedMessage(msgData, option),\n            isLastInAPull = utils.isEqual(index, maxListIndex),\n            isFinished = isLastInAPull && finished;\n\n        try {\n          onMessage({\n            isLastInAPull: isLastInAPull,\n            message: message,\n            finished: isFinished\n          });\n        } catch (e) {\n          utils.consoleError(e);\n        }\n\n        return message;\n      });\n      return data;\n    };\n\n    _proto.formatReceivedMessage = function formatReceivedMessage(data, option) {\n      option = option || {};\n      var self = this;\n\n      var _option = option,\n          currentUserId = _option.currentUserId,\n          connectedTime = _option.connectedTime,\n          content = data.content,\n          fromUserId = data.fromUserId,\n          type = data.type,\n          groupId = data.groupId,\n          status = data.status,\n          dataTime = data.dataTime,\n          messageType = data.classname,\n          messageUId = data.msgId,\n          direction = data.direction || MESSAGE_DIRECTION.RECEIVE,\n          isSelfSend = utils.isEqual(direction, MESSAGE_DIRECTION.SEND),\n          _common$getMessageOpt = common.getMessageOptionByStatus(status),\n          isPersited = _common$getMessageOpt.isPersited,\n          isCounted = _common$getMessageOpt.isCounted,\n          isMentiond = _common$getMessageOpt.isMentiond,\n          targetId = isGroup$1(type) || isChatRoom$1(type) ? groupId : fromUserId,\n          senderUserId = isSelfSend ? currentUserId : fromUserId,\n          sentTime = utils.int64ToTimestamp(dataTime),\n          isOffLineMessage = sentTime < connectedTime,\n          isChatRoomMsg = common.isChatRoom(type);\n\n      var messageDirection = isSelfSend ? MESSAGE_DIRECTION.SEND : MESSAGE_DIRECTION.RECEIVE;\n\n      if (isChatRoomMsg && utils.isEqual(fromUserId, currentUserId)) {\n        messageDirection = MESSAGE_DIRECTION.SEND;\n      }\n\n      return {\n        type: type,\n        targetId: targetId,\n        senderUserId: senderUserId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        isMentiond: isMentiond,\n        sentTime: sentTime,\n        isOffLineMessage: isOffLineMessage,\n        messageDirection: messageDirection,\n        receivedTime: common.DelayTimer.getTime(),\n        content: self.formatMessageContent(content)\n      };\n    };\n\n    _proto.formatSentMessage = function formatSentMessage(data, option) {\n      var self = this;\n\n      var content = data.content,\n          messageType = data.classname,\n          sessionId = data.sessionId,\n          messageUId = data.msgId,\n          signal = option.signal,\n          currentUserId = option.currentUserId,\n          date = signal.date,\n          topic = signal.topic,\n          targetId = signal.targetId,\n          _common$getPersitedAn = common.getPersitedAndCountedBySessionId(sessionId),\n          isPersited = _common$getPersitedAn.isPersited,\n          isCounted = _common$getPersitedAn.isCounted,\n          type = PUBLISH_TOPIC_TO_CONVERSATION_TYPE[topic] || CONVERSATION_TYPE.PRIVATE;\n\n      return {\n        type: type,\n        targetId: targetId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        senderUserId: currentUserId,\n        content: self.formatMessageContent(content),\n        sentTime: utils.secondsToMilliseconds(date),\n        receivedTime: common.DelayTimer.getTime(),\n        messageDirection: MESSAGE_DIRECTION.SEND,\n        isOffLineMessage: false\n      };\n    };\n\n    _proto.formatHistoryMessages = function formatHistoryMessages(data, option) {\n      var self = this;\n      var conversation = option.conversation || {},\n          msgList = data.list,\n          hasMsg = data.hasMsg,\n          targetId = conversation.targetId,\n          syncTime = utils.int64ToTimestamp(data.syncTime);\n      var list = [];\n      utils.forEach(msgList, function (msgData) {\n        var msg = self.formatReceivedMessage(msgData, option);\n        msg.targetId = targetId;\n        list.push(msg);\n      }, {\n        isReverse: true\n      });\n      return {\n        syncTime: syncTime,\n        list: list,\n        hasMore: !!hasMsg\n      };\n    };\n\n    _proto.formatConversationList = function formatConversationList(serverData, option) {\n      var self = this;\n      var conversationList = serverData.info;\n      var afterDecode = option.afterDecode || utils.noop;\n      conversationList = utils.map(conversationList, function (serverConversation) {\n        var msg = serverConversation.msg,\n            userId = serverConversation.userId,\n            type = serverConversation.type,\n            unreadCount = serverConversation.unreadCount;\n        msg = self.formatReceivedMessage(msg, option);\n        msg.targetId = userId;\n        var conversation = {\n          targetId: userId,\n          type: type,\n          unreadMessageCount: unreadCount,\n          latestMessage: msg\n        };\n        return afterDecode(conversation) || conversation;\n      });\n      return conversationList || [];\n    };\n\n    _proto.formatChatRoomInfos = function formatChatRoomInfos(data) {\n      var userTotalNums = data.userTotalNums,\n          userInfos = data.userInfos;\n      userInfos = utils.map(userInfos, function (user) {\n        var id = user.id,\n            time = user.time;\n        time = utils.int64ToTimestamp(time);\n        return {\n          id: id,\n          time: time\n        };\n      });\n      return {\n        userCount: userTotalNums,\n        userInfos: userInfos\n      };\n    };\n\n    _proto.formatRTCUserList = function formatRTCUserList(rtcInfos) {\n      var list = rtcInfos.list,\n          token = rtcInfos.token,\n          sessionId = rtcInfos.sessionId;\n      var users = {};\n      utils.forEach(list, function (item) {\n        var userId = item.userId,\n            userData = item.userData;\n        var tmpData = {};\n        utils.forEach(userData, function (data) {\n          var key = data.key,\n              value = data.value;\n          tmpData[key] = value;\n        });\n        users[userId] = tmpData;\n      });\n      return {\n        users: users,\n        token: token,\n        sessionId: sessionId\n      };\n    };\n\n    _proto.formatRTCData = function formatRTCData(data) {\n      var list = data.outInfo;\n      var props = {};\n      utils.forEach(list, function (item) {\n        props[item.key] = item.value;\n      });\n      return props;\n    };\n\n    _proto.formatRTCRoomInfo = function formatRTCRoomInfo(data) {\n      var id = data.roomId,\n          total = data.userCount,\n          roomData = data.roomData;\n      var room = {\n        id: id,\n        total: total\n      };\n      utils.forEach(roomData, function (data) {\n        room[data.key] = data.value;\n      });\n      return room;\n    };\n\n    _proto.formatChatRoomKVList = function formatChatRoomKVList(data) {\n      var kvEntries = data.entries,\n          isFullUpdate = data.bFullUpdate,\n          syncTime = data.syncTime;\n      kvEntries = kvEntries || [];\n      kvEntries = utils.map(kvEntries, function (kv) {\n        var key = kv.key,\n            value = kv.value,\n            status = kv.status,\n            timestamp = kv.timestamp,\n            uid = kv.uid;\n\n        var _common$getChatRoomKV = common.getChatRoomKVByStatus(status),\n            isAutoDelete = _common$getChatRoomKV.isAutoDelete,\n            isOverwrite = _common$getChatRoomKV.isOverwrite,\n            type = _common$getChatRoomKV.type;\n\n        return {\n          key: key,\n          value: value,\n          isAutoDelete: isAutoDelete,\n          isOverwrite: isOverwrite,\n          type: type,\n          userId: uid,\n          timestamp: utils.int64ToTimestamp(timestamp)\n        };\n      });\n      return {\n        kvEntries: kvEntries,\n        isFullUpdate: isFullUpdate,\n        syncTime: syncTime\n      };\n    };\n\n    _proto.encodeServerConfParams = function encodeServerConfParams() {\n      var modules = this.codec.getModule(PBName.SessionsAttQryInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.getUpMsgModule = function getUpMsgModule(conversation, option) {\n      var type = conversation.type;\n      var messageType = option.messageType,\n          isMentiond = option.isMentiond,\n          mentiondType = option.mentiondType,\n          mentiondUserIdList = option.mentiondUserIdList,\n          content = option.content,\n          pushContent = option.pushContent,\n          pushData = option.pushData,\n          directionalUserIdList = option.directionalUserIdList,\n          isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n          isVoipPush = option.isVoipPush;\n      var isGroupType = common.isGroup(type);\n      var modules = this.codec.getModule(PBName.UpStreamMessage);\n      var sessionId = common.getSessionId(option);\n      var flag = 0;\n      modules.setSessionId(sessionId);\n\n      if (isGroupType && isMentiond && content) {\n        content.mentionedInfo = {\n          userIdList: mentiondUserIdList,\n          type: mentiondType || MENTIOND_TYPE.ALL\n        };\n      }\n\n      pushContent && modules.setPushText(pushContent);\n      pushData && modules.setAppData(pushData);\n      directionalUserIdList && modules.setUserId(directionalUserIdList);\n      flag |= isVoipPush ? 0x01 : 0;\n      flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n      modules.setConfigFlag(flag);\n      modules.setClassname(messageType);\n      modules.setContent(utils.toJSON(content));\n      return modules;\n    };\n\n    _proto.encodeUpMsg = function encodeUpMsg(conversation, option) {\n      var modules = this.getUpMsgModule(conversation, option);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSyncMsg = function encodeSyncMsg(syncMsgArgs) {\n      var sendboxTime = syncMsgArgs.sendboxTime,\n          inboxTime = syncMsgArgs.inboxTime;\n      var modules = this.codec.getModule(PBName.SyncRequestMsg);\n      modules.setIspolling(false);\n      modules.setIsPullSend(true);\n      modules.setSendBoxSyncTime(sendboxTime);\n      modules.setSyncTime(inboxTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeChrmSyncMsg = function encodeChrmSyncMsg(time, count) {\n      time = time || 0;\n      count = count || 0;\n      var modules = this.codec.getModule(PBName.ChrmPullMsg);\n      modules.setCount(count);\n      modules.setSyncTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetHistoryMsg = function encodeGetHistoryMsg(conversation, option) {\n      var targetId = conversation.targetId;\n      var count = option.count,\n          order = option.order,\n          timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.HistoryMsgInput);\n      modules.setTargetId(targetId);\n      modules.setTime(timestrap);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationList = function encodeGetConversationList(option) {\n      option = option || {};\n      var _option2 = option,\n          count = _option2.count,\n          startTime = _option2.startTime;\n      var modules = this.codec.getModule(PBName.RelationQryInput);\n      modules.setType(1);\n      modules.setCount(count);\n      modules.setStartTime(startTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeOldConversationList = function encodeOldConversationList(option) {\n      option = option || {};\n      var _option3 = option,\n          count = _option3.count,\n          type = _option3.type;\n      var modules = this.codec.getModule(PBName.RelationsInput);\n      type = type || CONVERSATION_TYPE.PRIVATE;\n      count = count || 0;\n      modules.setType(type);\n      modules.setCount(count);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveConversationList = function encodeRemoveConversationList(conversationList) {\n      var _this = this;\n\n      var modules = this.codec.getModule(PBName.DeleteSessionsInput);\n      var sessions = [];\n      utils.forEach(conversationList, function (conversation) {\n        var type = conversation.type,\n            targetId = conversation.targetId;\n\n        var session = _this.codec.getModule(PBName.SessionInfo);\n\n        session.setType(type);\n        session.setChannelId(targetId);\n        sessions.push(session);\n      });\n      modules.setSessions(sessions);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeDeleteMessages = function encodeDeleteMessages(conversation, messages) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var modules = this.codec.getModule(PBName.DeleteMsgInput);\n      var encodeMsgs = [];\n      utils.forEach(messages, function (message) {\n        encodeMsgs.push({\n          msgId: message.messageUId,\n          msgDataTime: message.sentTime,\n          direct: message.messageDirection\n        });\n      });\n      modules.setType(type);\n      modules.setConversationId(targetId);\n      modules.setMsgs(encodeMsgs);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearMessages = function encodeClearMessages(conversation, option) {\n      var targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.CleanHisMsgInput);\n      timestrap = timestrap || utils.getCurrentTimestamp();\n      modules.setDataTime(timestrap);\n      modules.setTargetId(targetId);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearUnreadCount = function encodeClearUnreadCount(conversation, option) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.SessionMsgReadInput);\n      timestrap = timestrap || +new Date();\n      modules.setType(type);\n      modules.setChannelId(targetId);\n      modules.setMsgTime(timestrap);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinOrQuitChatRoom = function encodeJoinOrQuitChatRoom() {\n      var modules = this.codec.getModule(PBName.ChrmInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetChatRoomInfo = function encodeGetChatRoomInfo(option) {\n      option = option || {};\n      var _option4 = option,\n          count = _option4.count,\n          order = _option4.order;\n      var modules = this.codec.getModule(PBName.QueryChatRoomInfoInput);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinRTCRoom = function encodeJoinRTCRoom(room) {\n      var mode = room.mode,\n          broadcastType = room.broadcastType;\n      var modules = this.codec.getModule(PBName.RtcInput);\n      mode = mode || 0;\n      modules.setRoomType(mode);\n      !utils.isUndefined(broadcastType) && modules.setBroadcastType(broadcastType);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeQuitRTCRoom = function encodeQuitRTCRoom() {\n      return this.codec.getModule(PBName.SetUserStatusInput).getArrayData();\n    };\n\n    _proto.encodeSetRTCData = function encodeSetRTCData(key, value, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcSetDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(key);\n      modules.setValue(value);\n      message = message || {};\n      var _message = message,\n          name = _message.name,\n          content = _message.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCData = function encodeGetRTCData(keys, isInner, apiType) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCData = function encodeRemoveRTCData(keys, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      message = message || {};\n      var _message2 = message,\n          name = _message2.name,\n          content = _message2.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCOutData = function encodeSetRTCOutData(data, type, message) {\n      var modules = this.codec.getModule(PBName.RtcSetOutDataInput);\n      modules.setTarget(type);\n\n      if (!utils.isArray(data)) {\n        data = [data];\n      }\n\n      utils.forEach(data, function (item, index) {\n        item.key = item.key ? item.key.toString() : item.key;\n        item.value = item.value ? item.value.toString() : item.value;\n        data[index] = item;\n      });\n      modules.setValueInfo(data);\n      message = message || {};\n      var _message3 = message,\n          name = _message3.name,\n          content = _message3.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.ecnodeGetRTCOutData = function ecnodeGetRTCOutData(userIds) {\n      var modules = this.codec.getModule(PBName.RtcQryUserOutDataInput);\n      modules.setUserId(userIds);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCState = function encodeSetRTCState(content) {\n      var modules = this.codec.getModule(PBName.MCFollowInput);\n      var report = content.report;\n      modules.setId(report);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCRoomInfo = function encodeGetRTCRoomInfo() {\n      var modules = this.codec.getModule(PBName.RtcQueryListInput);\n      modules.setOrder(2);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCUserInfo = function encodeSetRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcValueInfo);\n      var key = info.key,\n          value = info.value;\n      modules.setKey(key);\n      modules.setValue(value);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCUserInfo = function encodeRemoveRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcKeyDeleteInput);\n      var keys = info.keys || [];\n\n      if (!utils.isArray(keys)) {\n        keys = [keys];\n      }\n\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileToken = function encodeGetFileToken(fileType) {\n      var modules = this.codec.getModule(PBName.GetQNupTokenInput);\n      modules.setType(fileType);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileUrl = function encodeGetFileUrl(fileType, fileName, originName) {\n      var modules = this.codec.getModule(PBName.GetQNdownloadUrlInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n\n      if (originName) {\n        modules.setFileName(originName);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeModifyChatRoomKV = function encodeModifyChatRoomKV(chrm, entry, action, currentUserId) {\n      var modules = this.codec.getModule(PBName.SetChrmKV);\n      var key = entry.key,\n          value = entry.value,\n          extra = entry.notificationExtra,\n          isSendNotification = entry.isSendNotification;\n      var status = common.getChatRoomKVOptStatus(entry, action);\n      var serverEntry = {\n        key: key,\n        status: status,\n        value: value || '',\n        uid: currentUserId\n      };\n\n      if (utils.isEmpty(serverEntry.status)) {\n        delete serverEntry.status;\n      }\n\n      modules.setEntry(serverEntry);\n\n      if (isSendNotification) {\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: chrm.id\n        };\n        var msgContent = {\n          key: key,\n          value: value,\n          extra: extra,\n          type: action\n        };\n        var msgModule = this.getUpMsgModule(conversation, {\n          messageType: MESSAGE_TYPE.CHRM_KV_NOTIFY,\n          content: msgContent,\n          isPersited: false,\n          isCounted: false\n        });\n        modules.setNotification(msgModule);\n        modules.setBNotify(true);\n        modules.setType(CONVERSATION_TYPE.CHATROOM);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullChatRoomKV = function encodePullChatRoomKV(time) {\n      var modules = this.codec.getModule(PBName.QueryChrmKV);\n      modules.setTimestamp(time);\n      return modules.getArrayData();\n    };\n\n    return Codec$$1;\n  }();\n\n  var DeferHandler$3 = utils.DeferHandler,\n      Defer$2 = utils.Defer;\n  var SignalId$1 = common.SignalId;\n\n  var ServerEngine = function () {\n    function ServerEngine(option) {\n      this._transporter = void 0;\n      this._serverEventEmitter = new utils.EventEmitter();\n      this._deferHandler = new DeferHandler$3();\n      this._serverDataCodec = void 0;\n      this._selfUserId = void 0;\n      this._connectedTime = void 0;\n      this.option = void 0;\n      var self = this;\n      var transporter = new Transporter(option);\n      transporter.watchSignal(function (signal) {\n        self._handleSignal(signal);\n      });\n      transporter.watchStatus(function (status) {\n        Logger.info(TAG.L_NETWORK_CHANGED_S, status);\n\n        self._handleStatus(status);\n      });\n      self._serverDataCodec = new Codec$2(option);\n      utils.extend(self, {\n        _transporter: transporter,\n        option: option\n      });\n    }\n\n    var _proto = ServerEngine.prototype;\n\n    _proto._handleStatus = function _handleStatus(status) {\n      if (common.isDisconnected(status)) {\n        this.disconnect();\n        var currentTime = utils.getCurrentTimestamp();\n        var isDisconnectTooFast = currentTime - this._connectedTime < MINIMUM_CONNECT_DURATION;\n        var NotSwitchStauts = [TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT];\n\n        if (isDisconnectTooFast && !utils.isInclude(NotSwitchStauts, status)) {\n          return this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST);\n        }\n      }\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, status);\n    };\n\n    _proto._handleSignal = function _handleSignal(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var messageId = signal.messageId;\n\n      if (messageId && signal.getIdentifier) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.resolve(deferId, signal);\n      }\n\n      self._handleSignalAck(signal);\n\n      self._dispatchTask(signal);\n    };\n\n    _proto._handleSignalAck = function _handleSignalAck(signal) {\n      var _transporter = this._transporter;\n      var messageId = signal.messageId;\n      var isQosNeedAck = signal._header && signal._header.qos !== QOS.AT_MOST_ONCE;\n\n      if (signal instanceof PublishReader && !signal.syncMsg && isQosNeedAck) {\n        var writer = new PubAckWriter(messageId);\n\n        _transporter.sendSignal(writer);\n      }\n\n      if (signal instanceof QueryAckReader && isQosNeedAck) {\n        var _writer = new QueryConWriter(messageId);\n\n        _transporter.sendSignal(_writer);\n      }\n    };\n\n    _proto._dispatchTask = function _dispatchTask(signal) {\n      var self = this;\n\n      if (signal instanceof DisconnectReader) {\n        var status = signal.status;\n        status = SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS[status] || status;\n        return self._handleStatus(status);\n      }\n\n      if (signal instanceof PublishReader) {\n        var _PUBLISH_TOPIC$NOTIFY;\n\n        var isSyncMsgSentBySelfOtherClient = signal.syncMsg,\n            topic = signal.topic;\n\n        if (isSyncMsgSentBySelfOtherClient) {\n          return self._receiveMsgFromOtherDevice(signal);\n        }\n\n        var task = (_PUBLISH_TOPIC$NOTIFY = {}, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.NOTIFY_PULL_MSG] = self._notifyPullMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.RECEIVE_MSG] = self._notifyDirectMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SERVER_NOTIFY] = self._notifyForServer, _PUBLISH_TOPIC$NOTIFY)[topic] || utils.noop;\n        task.call(self, signal);\n      }\n    };\n\n    _proto._notifyPullMessage = function _notifyPullMessage(signal) {\n      var notifyPullConfig = this._serverDataCodec.decodeByPBName(signal.data, PBName.NotifyMsg);\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.NOTIFY_PULL, notifyPullConfig);\n    };\n\n    _proto._notifyDirectMessage = function _notifyDirectMessage(signal) {\n      var currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n\n      var msg = this._serverDataCodec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n        currentUserId: currentUserId,\n        connectedTime: connectedTime\n      });\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n    };\n\n    _proto._notifyForServer = function _notifyForServer(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.ChrmNotifyMsg),\n          type = notifyData.type;\n\n      switch (type) {\n        case CHATROOM_NOTIFY_TYPE.KV_CHANGED:\n          Logger.info(TAG.P_NOTIFY_CHRM_KV_S, notifyData);\n\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_CHANGED, notifyData);\n\n          break;\n\n        default:\n          break;\n      }\n    };\n\n    _proto._sendSignal = function _sendSignal(writer, decodePBName, option) {\n      var appkey = this.option.appkey,\n          _serverDataCodec = this._serverDataCodec;\n      var _transporter = this._transporter,\n          _deferHandler = this._deferHandler,\n          currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n      var signalId = SignalId$1.get({\n        appkey: appkey,\n        userId: currentUserId\n      });\n\n      if (SignalId$1.isExceedLimit(signalId)) {\n        this._handleStatus(TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT);\n\n        return utils.Defer.reject(ERROR_INFO.TIMEOUT);\n      }\n\n      writer.messageId = signalId;\n      var deferId = writer.getIdentifier();\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n\n        _transporter.sendSignal(writer);\n      }).then(function (signal) {\n        var status = signal.status,\n            data = signal.data;\n        var isSuccess = utils.isEqual(status, SUCCESS_CODE);\n        var result = isSuccess ? signal : {\n          status: SERVER_ERROR_TO_CODE[status] || status\n        };\n\n        if (isSuccess && decodePBName) {\n          signal.data = _serverDataCodec.decodeByPBName(data, decodePBName, utils.extend({\n            signal: signal,\n            currentUserId: currentUserId,\n            connectedTime: connectedTime\n          }, option));\n        }\n\n        var exec = isSuccess ? Defer$2.resolve : Defer$2.reject;\n        return exec.call(Defer$2, result);\n      });\n    };\n\n    _proto._sendSignalForData = function _sendSignalForData(writer, decodePBName, option) {\n      return this._sendSignal(writer, decodePBName, option).then(function (successSignal) {\n        var data = decodePBName ? successSignal.data : undefined;\n        return data;\n      });\n    };\n\n    _proto._receiveMsgFromOtherDevice = function _receiveMsgFromOtherDevice(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          currentUserId = self._selfUserId,\n          connectType = self.option.connectType,\n          _serverDataCodec = self._serverDataCodec;\n      var isComet = connectType === CONNECT_TYPE.COMET;\n\n      var msg = _serverDataCodec.decodeByPBName(signal.data, PBName.UpStreamMessage, {\n        currentUserId: currentUserId,\n        signal: signal\n      });\n\n      if (isComet) {\n        msg.sentTime = common.DelayTimer.getTime();\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      }\n\n      return utils.deferred(function (resolve, reject) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (ackSignal) {\n        msg.messageUId = ackSignal.messageUId;\n        msg.sentTime = ackSignal.timestamp;\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      })[\"catch\"](function (error) {\n        Logger.error(TAG.L_CRASH_F, {\n          content: {\n            info: 'received msg from other device error',\n            error: error,\n            msg: msg\n          }\n        });\n      });\n    };\n\n    _proto.watch = function watch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.off(eventName, event);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporter = self._transporter;\n      return _transporter.connect(user, option).then(function (result) {\n        var isConnectSuccess = utils.isEqual(result.status, SUCCESS_CODE);\n        return isConnectSuccess ? Defer$2.resolve(result) : Defer$2.reject(result);\n      }).then(function (_ref) {\n        var userId = _ref.userId,\n            timestamp = _ref.timestamp;\n        self._selfUserId = userId;\n        self._connectedTime = timestamp;\n        return {\n          id: userId\n        };\n      }, function (_ref2) {\n        var status = _ref2.status;\n        var errorInfo = CONNECT_SERVER_STATUS_MAP_ERROR_INFO[status] || {\n          code: status\n        };\n        return utils.Defer.reject(errorInfo);\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      var appkey = this.option.appkey;\n      var _transporter = this._transporter,\n          _selfUserId = this._selfUserId;\n      _transporter && _transporter.disconnect();\n      SignalId$1.clear({\n        appkey: appkey,\n        userId: _selfUserId\n      });\n      return Defer$2.resolve(_selfUserId);\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      var connectedTime = this._connectedTime;\n      return connectedTime;\n    };\n\n    _proto.getServerConfig = function getServerConfig() {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeServerConfParams();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_SYNC_TIME, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.SessionsAttOutput);\n    };\n\n    _proto.pullMessageList = function pullMessageList(syncMsgArgs, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeSyncMsg(syncMsgArgs);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_MSG, data, _selfUserId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.pullChrmMessageList = function pullChrmMessageList(chatRoomId, time, count, option) {\n      time = time || 0;\n      count = count || 0;\n\n      var data = this._serverDataCodec.encodeChrmSyncMsg(time, count);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_CHRM_MSG, data, chatRoomId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, sendOption, topic) {\n      var self = this;\n      var currentUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec;\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var isStatusMessage = sendOption.isStatusMessage;\n      isStatusMessage = isStatusMessage && common.isSupportStatusMessage(type);\n      var publishTopic = topic || CONVERSATION_TYPE_TO_PUBLISH_TOPIC[type] || PUBLISH_TOPIC.PRIVATE;\n\n      if (isStatusMessage && utils.isUndefined(topic)) {\n        publishTopic = CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n      }\n\n      var data = _serverDataCodec.encodeUpMsg(conversation, sendOption);\n\n      var signal = new PublishWriter(publishTopic, data, targetId);\n      signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n\n      var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n        signal: signal,\n        currentUserId: currentUserId\n      });\n\n      if (isStatusMessage) {\n        self._sendSignal(signal)[\"catch\"](function () {});\n\n        msg.sentTime = common.DelayTimer.getTime();\n        return utils.Defer.resolve(msg);\n      }\n\n      return self._sendSignal(signal).then(function (_ref3) {\n        var messageUId = _ref3.messageUId,\n            timestamp = _ref3.timestamp;\n        msg.messageUId = messageUId;\n        msg.sentTime = timestamp;\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.MESSAGE_SEND, msg);\n\n        return msg;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var upMsgArgs = utils.extend(option || {}, message);\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var messageUId = message.messageUId,\n          sentTime = message.sentTime;\n      upMsgArgs.messageType = RECALL_MESSAGE_TYPE;\n      upMsgArgs.content = {\n        conversationType: type,\n        targetId: targetId,\n        messageUId: messageUId,\n        sentTime: sentTime\n      };\n      return this.sendMessage({\n        type: type,\n        targetId: this._selfUserId\n      }, upMsgArgs, PUBLISH_TOPIC.RECALL);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType) {\n      var data = this._serverDataCodec.encodeGetFileToken(fileType);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_TOKEN, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNupTokenOutput);\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n      var data = this._serverDataCodec.encodeGetFileUrl(fileType, fileName, originName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_URL, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNdownloadUrlOutput);\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeGetConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.RelationsOutput);\n    };\n\n    _proto.removeConversationList = function removeConversationList(conversationList) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeRemoveConversationList(conversationList);\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.DeleteSessionsOutput);\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      return this.removeConversationList([conversation]);\n    };\n\n    _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var type = conversation.type;\n      var historyTopic = CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC[type] || QUERY_HISTORY_TOPIC.PRIVATE;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeDeleteMessages(conversation, messages);\n\n      var writer = new QueryWriter(QUERY_TOPIC.DELETE_MESSAGES, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId;\n      var type = conversation.type;\n\n      var data = this._serverDataCodec.encodeClearMessages(conversation, option);\n\n      var topic = CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC[type];\n      var writer = new QueryWriter(topic, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      return this.getServerConfig().then(function (_ref4) {\n        var totalUnreadCount = _ref4.totalUnreadCount;\n        return totalUnreadCount;\n      });\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeClearUnreadCount(conversation, option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.CLEAR_UNREAD_COUNT, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var id = chrm.id;\n      var count = option.count;\n\n      var data = self._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_CHATROOM, data, id);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM, {\n        id: id\n      });\n\n      return self._sendSignalForData(writer).then(function (result) {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.JOIN_CHATROOM, {\n          id: id,\n          count: count\n        });\n\n        return result;\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_CHATROOM, data, id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeGetChatRoomInfo(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CHATROOM_INFO, data, id);\n      return this._sendSignalForData(writer, PBName.QueryChatRoomInfoOutput);\n    };\n\n    _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var targetId = chrm.id;\n      var type = CONVERSATION_TYPE.CHATROOM;\n      var conversation = {\n        type: type,\n        targetId: targetId\n      };\n      var historyTopic = QUERY_HISTORY_TOPIC.CHATROOM;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.modifyChatRoomKV = function modifyChatRoomKV(chrm, entry) {\n      var self = this;\n\n      var _selfUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec,\n          chatRoomId = chrm.id,\n          action = entry.type || CHATROOM_ENTRY_TYPE.UPDATE,\n          data = _serverDataCodec.encodeModifyChatRoomKV(chrm, entry, action, _selfUserId),\n          topic = utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE) ? QUERY_TOPIC.DELETE_CHATROOM_KV : QUERY_TOPIC.UPDATE_CHATROOM_KV,\n          writer = new QueryWriter(topic, data, chatRoomId);\n\n      return this._sendSignalForData(writer).then(function () {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_SET, {\n          id: chatRoomId,\n          data: {\n            kvEntries: [entry],\n            syncTime: common.DelayTimer.getTime()\n          }\n        });\n      });\n    };\n\n    _proto.pullChatRoomKV = function pullChatRoomKV(chrm, time) {\n      var _serverDataCodec = this._serverDataCodec,\n          chatRoomId = chrm.id,\n          data = _serverDataCodec.encodePullChatRoomKV(time),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_CHATROOM_KV, data, chatRoomId);\n\n      return this._sendSignalForData(writer, PBName.ChrmKVOutput);\n    };\n\n    _proto.joinRTCRoom = function joinRTCRoom(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.quitRTCRoom = function quitRTCRoom(room) {\n      var data = this._serverDataCodec.encodeQuitRTCRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.RTCPing = function RTCPing(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new PublishWriter(QUERY_TOPIC.PING_RTC, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCRoomInfo = function getRTCRoomInfo(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_ROOM_INFO, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcRoomInfoOutput);\n    };\n\n    _proto.getRTCUserInfoList = function getRTCUserInfoList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_INFO_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.setRTCUserInfo = function setRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeSetRTCUserInfo(info);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.removeRTCUserInfo = function removeRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeRemoveRTCUserInfo(info);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCData = function setRTCData(roomId, key, value, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeSetRTCData(key, value, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCData = function getRTCData(roomId, keys, isInner, apiType) {\n      var data = this._serverDataCodec.encodeGetRTCData(keys, isInner, apiType);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcQryOutput);\n    };\n\n    _proto.removeRTCData = function removeRTCData(roomId, keys, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeRemoveRTCData(keys, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCOutData = function setRTCOutData(roomId, rtcData, type, message) {\n      var data = this._serverDataCodec.encodeSetRTCOutData(rtcData, type, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCOutData = function getRTCOutData(roomId, userIds) {\n      var data = this._serverDataCodec.ecnodeGetRTCOutData(userIds);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcUserOutDataOutput);\n    };\n\n    _proto.getRTCToken = function getRTCToken(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_TOKEN, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcTokenOutput);\n    };\n\n    _proto.setRTCState = function setRTCState(room, content) {\n      var data = this._serverDataCodec.encodeSetRTCState(content);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_STATE, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCUserList = function getRTCUserList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.getOldServerConfig = function getOldServerConfig(userId) {\n      var appkey = this.option.appkey;\n      var syncTime = new common.MessageTimeSyner({\n        appkey: appkey,\n        userId: userId\n      }).get();\n      return Defer$2.resolve(syncTime);\n    };\n\n    _proto.getOldConversationList = function getOldConversationList(option, formatOpt) {\n      var self = this;\n      var _selfUserId = self._selfUserId;\n\n      var data = self._serverDataCodec.encodeOldConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_OLD_CONVERSATION_LIST, data, _selfUserId);\n      return self._sendSignalForData(writer, PBName.RelationsOutput, formatOpt);\n    };\n\n    _proto.removeOldConversation = function removeOldConversation(conversation) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n\n      var data = this._serverDataCodec.encodeOldConversationList({\n        type: type\n      });\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_OLD_CONVERSATION, data, targetId);\n      return this._sendSignalForData(writer);\n    };\n\n    return ServerEngine;\n  }();\n\n  var NAVIGATORS = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n  var MINI_SOCKET_DOMAIN_LIST = ['wsproxy.cn.ronghub.com', 'wsap-cn.ronghub.com'];\n  var MINI_COMET_DOMAIN_LIST = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\n  var NETWORK_DETECT_OPTION = {\n    url: 'https://cdn.ronghub.com/im_detecting',\n    intervalTime: 1500\n  };\n  var IM_OPTION = {\n    connectType: CONNECT_TYPE.WEBSOCKET,\n    navigators: NAVIGATORS,\n    detect: NETWORK_DETECT_OPTION,\n    isOldServer: true,\n    isDebug: false\n  };\n  var GET_MESSAGES_OPTION = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC,\n    timestrap: 0\n  };\n  var SEND_MESSAGE_OPTION = {\n    isMentiond: false,\n    isCounted: true,\n    isPersited: true\n  };\n  var GET_CHATROOM_INFO_OPTION = {\n    count: 20,\n    order: CHATROOM_ORDER.DESC\n  };\n  var CHATROOM_NOT_PULL_MSG_COUNT = -1;\n  var JOIN_CHATROOM_OPTION = {\n    count: CHATROOM_NOT_PULL_MSG_COUNT\n  };\n  var GET_CHATROOM_MESSAGES = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC\n  };\n  var SEND_MESSAGE_TYPE_OPTION = {\n    'RC:TxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:VcMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgTextMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:FileMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:HQVCMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:LBSMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSMultiImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpOpendMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:CombineMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:InfoNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ContactNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ProfileNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:GrpNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:RcCmd': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:TypSts': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:PSCmd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:SRSMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRReqMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRRspMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsChaR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CSCha': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEva': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsContact': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHs': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHsR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsSp': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEnd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsUpdate': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:ReadNtf': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:chrmKVNotiMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCAccept': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCRinging': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCSummary': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCHangup': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCInvite': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMedia': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMem': {\n      isCounted: false,\n      isPersited: false\n    }\n  };\n\n  var RCStorage$1 = common.RCStorage;\n\n  var LocalNaviHandler = function () {\n    function LocalNaviHandler(option) {\n      this.storage = void 0;\n      this.option = void 0;\n      var appkey = option.appkey,\n          token = option.token;\n      var UID = common.getUIDByToken(token);\n      var KEY = utils.tplEngine(STORAGE_NAVI.ROOT_KEY_TPL, {\n        appkey: appkey,\n        UID: UID\n      });\n      this.storage = new RCStorage$1(KEY);\n      this.option = option;\n    }\n\n    var _proto = LocalNaviHandler.prototype;\n\n    _proto.set = function set(resp) {\n      var connectType = this.option.connectType;\n      this.storage.set(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE, connectType);\n      this.storage.set(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED, utils.getCurrentTimestamp());\n      this.storage.set(STORAGE_NAVI.SUB_KEY.RESPONSE, resp);\n    };\n\n    _proto.clear = function clear() {\n      this.storage.clear();\n    };\n\n    _proto.getResp = function getResp() {\n      return this.storage.get(STORAGE_NAVI.SUB_KEY.RESPONSE);\n    };\n\n    _proto.isValid = function isValid() {\n      var storage = this.storage,\n          connectType = this.option.connectType;\n      var resp = this.getResp();\n\n      if (utils.isEmpty(resp)) {\n        return false;\n      }\n\n      var oldConnectType = storage.get(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE);\n      var timeWhenSaved = storage.get(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED);\n      var isSameConnectType = utils.isEqual(oldConnectType, connectType);\n      var isNotExpired = utils.getCurrentTimestamp() - timeWhenSaved < NAVI_EXPIRED_TIME;\n      return isSameConnectType && isNotExpired;\n    };\n\n    return LocalNaviHandler;\n  }();\n\n  var getNaviUrl = function getNaviUrl(url, option) {\n    var appkey = option.appkey,\n        connectType = option.connectType,\n        token = option.token;\n    var encodeToken = utils.encodeURI(token);\n    var protocol = env.protocol.http;\n    var type = connectType === CONNECT_TYPE.COMET ? NAVI_TYPE.COMET : NAVI_TYPE.WEBSOCKET;\n    var random = utils.getCurrentTimestamp();\n    url = utils.getValidUrl(url);\n    var naviUrlOption = {\n      protocol: protocol,\n      url: url,\n      type: type,\n      appkey: appkey,\n      random: random,\n      token: encodeToken\n    };\n    return utils.tplEngine(NAVI_URL_TPL, naviUrlOption);\n  };\n\n  var parseNaviResponse = function parseNaviResponse(responseText) {\n    var startText = NAVI_CALLBACK_NAME + '(';\n    var endText = ')';\n    var startIndex = utils.indexOf(responseText, startText) + startText.length;\n    var endIndex = utils.lastIndexOf(responseText, endText);\n\n    if (startIndex === -1 || endIndex === -1) {\n      return utils.parseJSON(responseText);\n    }\n\n    var response = utils.substring(responseText, startIndex, endIndex);\n\n    if (utils.isValidJSON(response)) {\n      return utils.parseJSON(response);\n    } else {\n      return {};\n    }\n  };\n\n  var getMiniNavi = function getMiniNavi(option) {\n    var connectType = option.connectType;\n    var isComet = utils.isEqual(connectType, CONNECT_TYPE.COMET);\n    var CmpDomainList = isComet ? MINI_COMET_DOMAIN_LIST : MINI_SOCKET_DOMAIN_LIST;\n    var naviResp = {\n      backupServer: CmpDomainList.join(DOMAIN_SEPARATOR_IN_CMPLIST)\n    };\n    return utils.Defer.resolve(naviResp);\n  };\n\n  var NaviManager = function () {\n    function NaviManager(option) {\n      this.option = void 0;\n      this.localNaviHandler = void 0;\n      this.option = option;\n      this.localNaviHandler = new LocalNaviHandler(option);\n    }\n\n    var _proto2 = NaviManager.prototype;\n\n    _proto2.get = function get() {\n      var self = this;\n      var option = self.option,\n          localNaviHandler = self.localNaviHandler;\n      var navigators = option.navigators,\n          token = option.token;\n\n      if (env.isMini) {\n        return getMiniNavi(option);\n      }\n\n      Logger.info(TAG.L_GET_NAVI_T, {\n        navigators: navigators,\n        token: token\n      });\n      var localConfigForNavi = self.getLocalConfig();\n\n      if (localNaviHandler.isValid()) {\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'local navi',\n            localConfigForNavi: localConfigForNavi\n          }\n        });\n        return utils.Defer.resolve(localConfigForNavi);\n      }\n\n      var naviListInToken = common.getNaviListByToken(token);\n      navigators = naviListInToken.concat(navigators);\n      option.token = common.getValidToken(token);\n      var urlList = utils.map(navigators, function (url) {\n        return getNaviUrl(url, option);\n      });\n      return utils.requestByUrlList(urlList).then(function (_ref) {\n        var responseText = _ref.responseText;\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'remote navi',\n            responseText: responseText\n          }\n        });\n        var resp = parseNaviResponse(responseText);\n        var code = resp.code;\n        var isSuccess = code === NAVI_REQUEST_SUCCESS_CODE;\n\n        if (isSuccess) {\n          localNaviHandler.set(resp);\n          return resp;\n        } else if (resp && code) {\n          var error = utils.extendInShallow(NAVI_ERROR_INFO[code], {\n            msg: resp.errorMessage\n          });\n          return utils.Defer.reject(error);\n        } else {\n          return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n            error: responseText\n          }));\n        }\n      }, function (error) {\n        return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n          error: error\n        }));\n      });\n    };\n\n    _proto2.getLocalConfig = function getLocalConfig() {\n      return this.localNaviHandler.getResp();\n    };\n\n    _proto2.clear = function clear() {\n      var option = this.option;\n      var localNaviHanlder = new LocalNaviHandler(option);\n      localNaviHanlder.clear();\n    };\n\n    return NaviManager;\n  }();\n\n  var CMPManager = function () {\n    function CMPManager() {\n      this.cmpDomainList = [];\n      this.invalidDomainList = [];\n      this.option = void 0;\n    }\n\n    var _proto = CMPManager.prototype;\n\n    _proto.setDomainList = function setDomainList(cmpDomainList, option) {\n      this.cmpDomainList = cmpDomainList;\n      this.option = option || {};\n    };\n\n    _proto.getFaster = function getFaster() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList,\n          option = this.option;\n      var sniffUrlList = utils.filter(cmpDomainList, function (domain) {\n        return !utils.isInclude(invalidDomainList, domain);\n      });\n      sniffUrlList = utils.map(sniffUrlList, function (domain) {\n        var timestamp = utils.getCurrentTimestamp();\n        var url = domain + \"/ping?r=\" + timestamp;\n        return utils.getValidUrl(url, option);\n      });\n\n      if (utils.isEmpty(sniffUrlList)) {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      }\n\n      return utils.requestForFaster(sniffUrlList, {\n        timeInterval: CMP_SNIFF_INTERNAL_TIME\n      }).then(function (_ref) {\n        var url = _ref.url,\n            index = _ref.index;\n        return {\n          url: url,\n          index: index,\n          domain: utils.getDomainByUrl(url)\n        };\n      })[\"catch\"](function () {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      });\n    };\n\n    _proto.addInvalid = function addInvalid(domain) {\n      this.invalidDomainList.push(domain);\n    };\n\n    _proto.clearInvalid = function clearInvalid() {\n      this.invalidDomainList.length = 0;\n    };\n\n    _proto.isAllInvalid = function isAllInvalid() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList;\n      return utils.isEqual(cmpDomainList.length, invalidDomainList.length);\n    };\n\n    return CMPManager;\n  }();\n\n  var RCStorage$2 = common.RCStorage;\n  var SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n\n  var ConversationManager = function () {\n    function ConversationManager(option) {\n      this._storage = void 0;\n      this._onChanged = void 0;\n      this.updatedConversations = {};\n      var StorageKey = utils.tplEngine(STORAGE_CONVERSATION.ROOT_KEY_TPL, option);\n      this._storage = new RCStorage$2(StorageKey);\n      this._onChanged = option.onChanged || utils.noop;\n    }\n\n    var _proto = ConversationManager.prototype;\n\n    _proto._getUpdatedConversationList = function _getUpdatedConversationList() {\n      var self = this;\n      var updatedConversations = self.updatedConversations;\n      var updatedConversationList = [];\n      utils.forEach(updatedConversations, function (conversation) {\n        var storageConversation = self.get(conversation);\n        conversation.unreadMessageCount = storageConversation.unreadMessageCount || 0, conversation.hasMentiond = storageConversation.hasMentiond || false, conversation.mentiondInfo = storageConversation.mentiondInfo;\n        updatedConversationList.push(conversation);\n      });\n\n      if (utils.isEmpty(updatedConversationList)) {\n        return [];\n      }\n\n      return common.sortConversationList(updatedConversationList);\n    };\n\n    _proto._update = function _update() {\n      var self = this;\n\n      var updatedConversationList = self._getUpdatedConversationList();\n\n      if (!utils.isEmpty(updatedConversationList)) {\n        (function (list) {\n          utils.setTimeout(function () {\n            self._onChanged(list);\n\n            self.updatedConversations = {};\n          }, 0);\n        })(updatedConversationList);\n      }\n    };\n\n    _proto.addMessage = function addMessage(message, option) {\n      option = option || {};\n      var self = this,\n          _option = option,\n          isLastInAPull = _option.isLastInAPull,\n          type = message.type,\n          sentTime = message.sentTime,\n          messageDirection = message.messageDirection,\n          targetId = message.targetId,\n          content = message.content,\n          messageType = message.messageType,\n          isMentiond = message.isMentiond,\n          isCounted = message.isCounted,\n          isHasConversationType = utils.isInclude(TYPE_HAS_CONVERSATION, type);\n\n      if (!isHasConversationType) {\n        return;\n      }\n\n      var isRecall = utils.isEqual(messageType, RECALL_MESSAGE_TYPE);\n      var hasContent = utils.isObject(content);\n      var isOtherSend = messageDirection === MESSAGE_DIRECTION.RECEIVE;\n      var storageConversation = self.get({\n        type: type,\n        targetId: targetId\n      });\n      var hasChanged = false;\n      var lastUnreadTime = storageConversation.lastUnreadTime || 0;\n      var unreadMessageCount = storageConversation.unreadMessageCount || 0;\n      var isNotAdded = sentTime > lastUnreadTime;\n\n      if (isOtherSend && isCounted && isNotAdded && (hasChanged = true)) {\n        storageConversation.unreadMessageCount = unreadMessageCount + 1;\n        storageConversation.lastUnreadTime = sentTime;\n      } else if (isOtherSend && isRecall && hasContent && (hasChanged = true)) {\n        var isRecallMsgNotRead = lastUnreadTime >= content.sentTime;\n\n        if (isRecallMsgNotRead && unreadMessageCount) {\n          storageConversation.unreadMessageCount = unreadMessageCount - 1;\n        }\n      }\n\n      if (isOtherSend && isMentiond && hasContent && content.mentionedInfo && (hasChanged = true)) {\n        storageConversation.hasMentiond = true;\n        storageConversation.mentiondInfo = content.mentionedInfo;\n      }\n\n      if (hasChanged) {\n        self.set(message, storageConversation);\n      }\n\n      self._setCache(message);\n\n      var isNeedNotifyUpdate = utils.isUndefined(isLastInAPull) ? true : isLastInAPull;\n\n      if (isNeedNotifyUpdate) {\n        self._update();\n      }\n    };\n\n    _proto._setCache = function _setCache(message) {\n      var self = this;\n      var type = message.type,\n          targetId = message.targetId,\n          isPersited = message.isPersited;\n      var key = common.getConversationKey(message);\n      var cacheConversation = self.updatedConversations[key] || {};\n      cacheConversation = common.fixConversationData(cacheConversation);\n      var cacheMsgSentTime = cacheConversation.latestMessage.sentTime || 0;\n      var newMsgSentTime = message.sentTime;\n      var isMsgNotAdded = cacheMsgSentTime <= newMsgSentTime;\n\n      if (isPersited && isMsgNotAdded) {\n        cacheConversation = {\n          type: type,\n          targetId: targetId,\n          latestMessage: message\n        };\n        self.updatedConversations[key] = cacheConversation;\n      }\n    };\n\n    _proto.set = function set(option, storageConversationOption) {\n      var _setVals;\n\n      var unreadMessageCount = storageConversationOption.unreadMessageCount,\n          lastUnreadTime = storageConversationOption.lastUnreadTime,\n          hasMentiond = storageConversationOption.hasMentiond,\n          mentiondInfo = storageConversationOption.mentiondInfo,\n          key = common.getConversationKey(option),\n          storageConversation = this._storage.get(key) || {},\n          setVals = (_setVals = {}, _setVals[SUB_KEY.UNREAD_COUNT] = {\n        val: unreadMessageCount\n      }, _setVals[SUB_KEY.UNREAD_LAST_TIME] = {\n        val: lastUnreadTime\n      }, _setVals[SUB_KEY.HAS_MENTIOND] = {\n        val: hasMentiond,\n        checkEvent: function checkEvent(val) {\n          return val;\n        }\n      }, _setVals[SUB_KEY.MENTIOND_INFO] = {\n        val: mentiondInfo,\n        checkEvent: utils.isObject\n      }, _setVals);\n      utils.forEach(setVals, function (_ref, key) {\n        var val = _ref.val,\n            checkEvent = _ref.checkEvent;\n\n        checkEvent = checkEvent || function (val) {\n          return !utils.isEmpty(val);\n        };\n\n        if (utils.isUndefined(val)) {\n          return;\n        }\n\n        if (checkEvent(val)) {\n          storageConversation[key] = val;\n        } else {\n          delete storageConversation[key];\n        }\n      });\n\n      this._storage.set(key, storageConversation);\n    };\n\n    _proto.get = function get(option) {\n      var key = common.getConversationKey(option);\n      var storageConversation = this._storage.get(key) || {};\n      return {\n        unreadMessageCount: storageConversation[SUB_KEY.UNREAD_COUNT] || 0,\n        lastUnreadTime: storageConversation[SUB_KEY.UNREAD_LAST_TIME] || 0,\n        hasMentiond: storageConversation[SUB_KEY.HAS_MENTIOND] || false,\n        mentiondInfo: storageConversation[SUB_KEY.MENTIOND_INFO]\n      };\n    };\n\n    _proto.remove = function remove(option) {\n      var key = common.getConversationKey(option);\n\n      this._storage.remove(key);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var allVals = this._storage.getValues() || {};\n      var totalCount = 0;\n      utils.forEach(allVals, function (val) {\n        var count = val[SUB_KEY.UNREAD_COUNT] || 0;\n        totalCount += count;\n      });\n      return totalCount;\n    };\n\n    _proto.read = function read(option) {\n      var self = this;\n      var key = common.getConversationKey(option);\n      var localConversation = self.get(option) || {};\n      var localUnread = localConversation.unreadMessageCount;\n\n      if (localUnread) {\n        self.remove(option);\n        var cacheConversation = self.updatedConversations[key];\n\n        if (cacheConversation) ; else {\n          self.updatedConversations[key] = option;\n        }\n\n        self._update();\n      }\n    };\n\n    return ConversationManager;\n  }();\n\n  var PullQueueManager = function () {\n    function PullQueueManager(option) {\n      this.isLoading = false;\n      this._queue = new utils.Queue();\n      this._option = void 0;\n      option = option || {};\n      this._option = option;\n    }\n\n    var _proto = PullQueueManager.prototype;\n\n    _proto._execEvent = function _execEvent() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      var self = this;\n\n      var _this$_option = this._option,\n          event = _this$_option.event,\n          thisArg = _this$_option.thisArg,\n          onBefore = this._option.onBefore || function () {\n        return args;\n      },\n          onFinished = this._option.onFinished || utils.noop,\n          onError = this._option.onError || utils.noop;\n\n      onBefore.apply(void 0, args);\n      self.isLoading = true;\n      return event.apply(thisArg, args).then(function (result) {\n        self.isLoading = false;\n        onFinished.apply(void 0, [result].concat(args));\n      })[\"catch\"](function (error) {\n        self.isLoading = false;\n        onError(error);\n      });\n    };\n\n    _proto.pull = function pull() {\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      this._queue.add({\n        event: this._execEvent,\n        args: args,\n        thisArg: this\n      });\n    };\n\n    return PullQueueManager;\n  }();\n\n  var MessageTimeSyner$1 = common.MessageTimeSyner,\n      ChatRoomMessageTimeSyner$1 = common.ChatRoomMessageTimeSyner;\n  var EVENT_NAME$1 = {\n    MESSAGE_RECEIVED: 'msg-received'\n  };\n\n  var MessagePullManager = function () {\n    function MessagePullManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._messageTimeSyner = void 0;\n      this._chatRoomMessageTimeSyner = new ChatRoomMessageTimeSyner$1();\n      this._eventEmitter = new utils.EventEmitter();\n      this._pullMessageTimer = new utils.Timer({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: PULL_MSG_TIME\n      });\n      this._sentMsgCacheInPulling = {};\n      this._handleDirectMessage = void 0;\n      this._handleNotifyPull = void 0;\n      this._handleJoinChatRoom = void 0;\n      this._handleSendMessage = void 0;\n      var self = this;\n      var appkey = serverEngine.option.appkey,\n          userId = serverEngine._selfUserId;\n      var startSyncTime = option.startSyncTime;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished() {},\n        onError: function onError() {}\n      });\n\n      self._handleDirectMessage = function (message) {\n        !pullQueue.isLoading && self.notifyMessage({\n          message: message,\n          hasMore: false\n        });\n      };\n\n      self._handleNotifyPull = function (option) {\n        pullQueue.pull(option);\n      };\n\n      self._handleJoinChatRoom = function (_ref) {\n        var id = _ref.id,\n            count = _ref.count;\n\n        if (utils.isEqual(count, CHATROOM_NOT_PULL_MSG_COUNT)) {\n          self._chatRoomMessageTimeSyner.set(id, common.DelayTimer.getTime());\n        } else {\n          var type = PULL_MSG_TYPE.CHATROOM,\n              time = 0,\n              chrmId = id;\n\n          self._chatRoomMessageTimeSyner.set(id, time);\n\n          pullQueue.pull({\n            type: type,\n            time: time,\n            chrmId: chrmId,\n            count: count\n          });\n        }\n      };\n\n      self._handleSendMessage = function (message) {\n        pullQueue.isLoading ? self._setSentMsgCacheInPulling(message) : self._setPullTime(message);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.DIRECT_MSG] = self._handleDirectMessage, _serverEngine$watch[SERVER_EVENT_NAME.NOTIFY_PULL] = self._handleNotifyPull, _serverEngine$watch[SERVER_EVENT_NAME.JOIN_CHATROOM] = self._handleJoinChatRoom, _serverEngine$watch[SERVER_EVENT_NAME.MESSAGE_SEND] = self._handleSendMessage, _serverEngine$watch));\n      self._serverEngine = serverEngine;\n      self._pullQueue = pullQueue;\n      self._messageTimeSyner = new MessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId,\n        startSyncTime: startSyncTime\n      });\n\n      self._pullMessageTimer.start(pullQueue.pull, {\n        thisArg: pullQueue\n      });\n\n      pullQueue.pull();\n    }\n\n    var _proto = MessagePullManager.prototype;\n\n    _proto.watchMessage = function watchMessage(event) {\n      this._eventEmitter.on(EVENT_NAME$1.MESSAGE_RECEIVED, event);\n    };\n\n    _proto.notifyMessage = function notifyMessage(messageArgs) {\n      var message = messageArgs.message;\n\n      this._setPullTime(message);\n\n      this._eventEmitter.emit(EVENT_NAME$1.MESSAGE_RECEIVED, messageArgs);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._pullMessageTimer.stop();\n\n      this._sentMsgCacheInPulling = {};\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.DIRECT_MSG] = this._handleDirectMessage, _this$_serverEngine$u[SERVER_EVENT_NAME.NOTIFY_PULL] = this._handleNotifyPull, _this$_serverEngine$u[SERVER_EVENT_NAME.JOIN_CHATROOM] = this._handleJoinChatRoom, _this$_serverEngine$u[SERVER_EVENT_NAME.MESSAGE_SEND] = this._handleSendMessage, _this$_serverEngine$u));\n    };\n\n    _proto._pullEvent = function _pullEvent(option) {\n      option = option || {};\n\n      var self = this,\n          _serverEngine = self._serverEngine,\n          _messageTimeSyner = self._messageTimeSyner,\n          _chatRoomMessageTimeSyner = self._chatRoomMessageTimeSyner,\n          _option = option,\n          type = _option.type,\n          chrmId = _option.chrmId,\n          serverPullTime = _option.time,\n          count = _option.count,\n          isPullChrmMsg = utils.isEqual(type, PULL_MSG_TYPE.CHATROOM),\n          msgSyncTime = _messageTimeSyner.get(),\n          currentReceiveTime = isPullChrmMsg ? _chatRoomMessageTimeSyner.get(chrmId) : msgSyncTime.inboxTime,\n          syncTime = utils.copy(msgSyncTime);\n\n      if (serverPullTime && serverPullTime < currentReceiveTime) {\n        return utils.Defer.resolve();\n      }\n\n      var onMessage = function onMessage(_ref2) {\n        var message = _ref2.message,\n            finished = _ref2.finished,\n            isLastInAPull = _ref2.isLastInAPull;\n\n        self._displatchMessages({\n          message: message,\n          finished: finished,\n          isPullChrmMsg: isPullChrmMsg,\n          isLastInAPull: isLastInAPull,\n          normalSyncTime: syncTime,\n          chatRoomReceiveTime: currentReceiveTime\n        });\n      };\n\n      if (isPullChrmMsg) {\n        return _serverEngine.pullChrmMessageList(chrmId, currentReceiveTime, count, {\n          onMessage: onMessage\n        });\n      } else {\n        return _serverEngine.pullMessageList(syncTime, {\n          onMessage: onMessage\n        });\n      }\n    };\n\n    _proto._displatchMessages = function _displatchMessages(option) {\n      var self = this,\n          message = option.message,\n          finished = option.finished,\n          isPullChrmMsg = option.isPullChrmMsg,\n          isLastInAPull = option.isLastInAPull,\n          _ref3 = option.normalSyncTime || {},\n          inboxTime = _ref3.inboxTime,\n          sendboxTime = _ref3.sendboxTime,\n          sentTime = message.sentTime,\n          messageDirection = message.messageDirection,\n          messageUId = message.messageUId,\n          isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND,\n          pullTime = isSelfSend ? sendboxTime : inboxTime;\n\n      if (sentTime <= pullTime && !isPullChrmMsg) {\n        return;\n      }\n\n      if (self._sentMsgCacheInPulling[messageUId]) {\n        return;\n      }\n\n      self.notifyMessage({\n        message: message,\n        hasMore: !finished,\n        isLastInAPull: isLastInAPull\n      });\n    };\n\n    _proto._setPullTime = function _setPullTime(message) {\n      var isChatRoom = message.type === CONVERSATION_TYPE.CHATROOM;\n      isChatRoom ? this._chatRoomMessageTimeSyner.setByMessage(message) : this._messageTimeSyner.setByMessage(message);\n    };\n\n    _proto._setSentMsgCacheInPulling = function _setSentMsgCacheInPulling(message) {\n      var messageUId = message.messageUId;\n\n      if (utils.isUndefined(messageUId)) {\n        return;\n      }\n\n      this._sentMsgCacheInPulling[messageUId] = message;\n    };\n\n    _proto._consumeSentMsgCacheInPulling = function _consumeSentMsgCacheInPulling() {\n      var self = this;\n      var _sentMsgCacheInPulling = self._sentMsgCacheInPulling;\n      utils.forEach(_sentMsgCacheInPulling, function (message) {\n        self._setPullTime(message);\n      });\n      self._sentMsgCacheInPulling = {};\n    };\n\n    return MessagePullManager;\n  }();\n\n  var ChatRoomKVStore = function () {\n    function ChatRoomKVStore(chrmId, currentUserId) {\n      this._chatRoomId = void 0;\n      this._kvCaches = {};\n      this._currentUserId = void 0;\n      this._chatRoomId = chrmId;\n      this._currentUserId = currentUserId;\n    }\n\n    var _proto = ChatRoomKVStore.prototype;\n\n    _proto.setEntries = function setEntries(data) {\n      data = data || {};\n      var self = this;\n      var _data = data,\n          kvList = _data.kvEntries,\n          isFullUpdate = _data.isFullUpdate;\n      kvList = kvList || [];\n      isFullUpdate = isFullUpdate || false;\n      isFullUpdate && self.clear();\n      utils.forEach(kvList, function (kv) {\n        self.setEntry(kv, {\n          isFullUpdate: isFullUpdate\n        });\n      });\n    };\n\n    _proto.setEntry = function setEntry(kv, option) {\n      option = option || {};\n      var _option = option,\n          isFullUpdate = _option.isFullUpdate,\n          key = kv.key,\n          type = kv.type,\n          isOverwrite = kv.isOverwrite,\n          userId = kv.userId,\n          latestUserId = this.getSetUserId(key),\n          isDeleteOpt = utils.isEqual(type, CHATROOM_ENTRY_TYPE.DELETE),\n          isSameAtLastSetUser = utils.isEqual(latestUserId, userId),\n          isKeyNotExist = !this.isExisted(key);\n      var event = isDeleteOpt ? this.remove : this.add;\n\n      if (isFullUpdate) {\n        event.call(this, kv);\n      } else if (isOverwrite || isSameAtLastSetUser || isKeyNotExist) {\n        event.call(this, kv);\n      }\n    };\n\n    _proto.add = function add(kv) {\n      var key = kv.key;\n      kv.isDeleted = false;\n      this._kvCaches[key] = kv;\n    };\n\n    _proto.remove = function remove(kv) {\n      var key = kv.key;\n      var cacheKV = this.get(key) || {};\n      cacheKV.isDeleted = true;\n      this._kvCaches[key] = cacheKV;\n    };\n\n    _proto.clear = function clear() {\n      this._kvCaches = {};\n    };\n\n    _proto.get = function get(key) {\n      return this._kvCaches[key];\n    };\n\n    _proto.getSetUserId = function getSetUserId(key) {\n      var cache = this.get(key) || {};\n      return cache.userId;\n    };\n\n    _proto.getValue = function getValue(key) {\n      var kv = this._kvCaches[key] || {};\n      var isDeleted = kv.isDeleted;\n      return isDeleted ? null : kv.value;\n    };\n\n    _proto.getAll = function getAll() {\n      var kvEntries = {};\n      utils.forEach(this._kvCaches, function (kv, key) {\n        if (!kv.isDeleted) {\n          kvEntries[key] = kv.value;\n        }\n      });\n      return kvEntries;\n    };\n\n    _proto.getUpdatedTime = function getUpdatedTime() {\n      var maxTime = 0;\n      utils.forEach(this._kvCaches, function (entry) {\n        var timestamp = entry.timestamp || 0;\n\n        if (maxTime < timestamp) {\n          maxTime = timestamp;\n        }\n      });\n      return maxTime;\n    };\n\n    _proto.isExisted = function isExisted(key) {\n      var cache = this.get(key) || {};\n      var value = cache.value,\n          isDeletedOnLatestOperate = cache.isDeleted;\n      return value && !isDeletedOnLatestOperate;\n    };\n\n    return ChatRoomKVStore;\n  }();\n\n  var storeCaches = {};\n\n  var get = function get(chrmId) {\n    return storeCaches[chrmId];\n  };\n\n  var set$1 = function set(chrmId, data, currentUserId) {\n    var kvStore = get(chrmId);\n\n    if (utils.isEmpty(kvStore)) {\n      kvStore = new ChatRoomKVStore(chrmId, currentUserId);\n    }\n\n    kvStore.setEntries(data);\n    storeCaches[chrmId] = kvStore;\n  };\n\n  var getValue = function getValue(chrmId, key) {\n    var kvStore = get(chrmId);\n    var value = kvStore ? kvStore.getValue(key) : null;\n    return value;\n  };\n\n  var getAll = function getAll(chrmId) {\n    var kvStore = get(chrmId);\n    var kvs = {};\n\n    if (kvStore) {\n      kvs = kvStore.getAll();\n    }\n\n    return kvs;\n  };\n\n  var clear = function clear(chrmId) {\n    var kvStore = get(chrmId) || {};\n    kvStore.clear && kvStore.clear();\n  };\n\n  var ChatRoomKVStore$1 = {\n    get: get,\n    set: set$1,\n    getValue: getValue,\n    getAll: getAll,\n    clear: clear\n  };\n\n  var PullTimeCache = {\n    _caches: {},\n    set: function set(chrmId, time) {\n      PullTimeCache._caches[chrmId] = time;\n    },\n    get: function get(chrmId) {\n      return PullTimeCache._caches[chrmId] || 0;\n    },\n    clear: function clear(chrmId) {\n      PullTimeCache._caches[chrmId] = 0;\n    }\n  };\n\n  var ChatRoomKVManager = function () {\n    function ChatRoomKVManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._handleChrmKVSet = void 0;\n      this._handleChrmKVChanged = void 0;\n      this._handleBeforeJoinChrm = void 0;\n      var self = this;\n      var userId = serverEngine._selfUserId;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished(data, option) {\n          if (!data || !option.chrmId) {\n            return;\n          }\n\n          var chrmId = option.chrmId;\n\n          if (data.isFullUpdate) {\n            self._reset(chrmId);\n          }\n\n          Logger.info(TAG.L_PULL_CHRM_KV_R, {\n            data: data,\n            option: option\n          });\n          ChatRoomKVStore$1.set(chrmId, data, userId);\n          PullTimeCache.set(chrmId, data.syncTime || 0);\n        }\n      });\n\n      self._handleChrmKVSet = function (_ref) {\n        var id = _ref.id,\n            data = _ref.data;\n        ChatRoomKVStore$1.set(id, data, userId);\n      };\n\n      self._handleChrmKVChanged = function (data) {\n        self.pull(data);\n      };\n\n      self._handleBeforeJoinChrm = function (_ref2) {\n        var id = _ref2.id;\n\n        self._reset(id);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _serverEngine$watch[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _serverEngine$watch));\n      this._serverEngine = serverEngine;\n      this._pullQueue = pullQueue;\n    }\n\n    var _proto = ChatRoomKVManager.prototype;\n\n    _proto._reset = function _reset(chrmId) {\n      ChatRoomKVStore$1.clear(chrmId);\n      PullTimeCache.clear(chrmId);\n    };\n\n    _proto._pullEvent = function _pullEvent(data) {\n      var time = data.time,\n          chrmId = data.chrmId,\n          currentTime = PullTimeCache.get(chrmId),\n          isUpdated = currentTime > time;\n      Logger.info(TAG.L_PULL_CHRM_KV_T, {\n        currentTime: currentTime,\n        serverTime: time,\n        isUpdated: isUpdated,\n        data: data\n      });\n\n      if (isUpdated) {\n        Logger.info(TAG.L_PULL_CHRM_KV_R, {\n          info: 'kv is updated. not pull again'\n        });\n        return utils.Defer.resolve();\n      }\n\n      return this._serverEngine.pullChatRoomKV({\n        id: chrmId\n      }, currentTime);\n    };\n\n    _proto.pull = function pull(data) {\n      this._pullQueue.pull(data);\n    };\n\n    _proto.getValue = function getValue(chrmId, key) {\n      return ChatRoomKVStore$1.getValue(chrmId, key);\n    };\n\n    _proto.getAll = function getAll(chrmId) {\n      return ChatRoomKVStore$1.getAll(chrmId);\n    };\n\n    _proto.close = function close() {\n      var _self$_serverEngine$u;\n\n      var self = this;\n\n      self._serverEngine.unwatch((_self$_serverEngine$u = {}, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _self$_serverEngine$u[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _self$_serverEngine$u));\n    };\n\n    return ChatRoomKVManager;\n  }();\n\n  var WebIMEngine = function () {\n    function WebIMEngine(option) {\n      this._option = void 0;\n      this._user = void 0;\n      this._naviManager = void 0;\n      this._cmpManager = new CMPManager();\n      this._conversationManager = void 0;\n      this._messageManager = void 0;\n      this._chatRoomKVManager = void 0;\n      this._serverEngine = void 0;\n      this._imEventEmitter = new utils.EventEmitter();\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      this._connectedDomain = void 0;\n      this._networkDetecter = void 0;\n      var self = this;\n      var detect = option.detect;\n      var serverEngine = new ServerEngine(option);\n      serverEngine.watch({\n        status: function status(_status) {\n          self._handleConnectionStatus(_status);\n        }\n      });\n      this._serverEngine = serverEngine;\n      this._option = option;\n      this._networkDetecter = new utils.NetworkDetecter(detect);\n      utils.forEach(ServerEngine.prototype, function (event, eventName) {\n        var server = serverEngine,\n            web = self;\n        var selfEvent = web[eventName],\n            serverEvent = server[eventName];\n\n        if (!selfEvent && serverEvent && utils.isFunction(serverEvent)) {\n          web[eventName] = function () {\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n\n            return serverEvent.call.apply(serverEvent, [server].concat(args));\n          };\n        }\n      });\n    }\n\n    var _proto = WebIMEngine.prototype;\n\n    _proto._notifyMessage = function _notifyMessage(event) {\n      var self = this;\n      var message = event.message,\n          hasMore = event.hasMore,\n          isLastInAPull = event.isLastInAPull;\n      var _serverEngine = self._serverEngine;\n\n      var connectedTime = _serverEngine.getConnectedTime();\n\n      if (common.isLogCommandMsg(message)) {\n        var content = message.content;\n        Logger.uploadFull(0, content, connectedTime);\n        return;\n      }\n\n      this._conversationManager.addMessage(message, {\n        hasMore: hasMore,\n        isLastInAPull: isLastInAPull\n      });\n\n      this._imEventEmitter.emit(IM_EVENT.MESSAGE, event);\n    };\n\n    _proto._handleConnectionStatus = function _handleConnectionStatus(status) {\n      var _cmpManager = this._cmpManager,\n          _naviManager = this._naviManager,\n          _connectedDomain = this._connectedDomain;\n      var isNeedUpdateCMPList = utils.isInclude(TRANSPORTER_STATUS_NEED_UPDATE_CMP, status);\n      var isNeedReconnect = utils.isInclude(TRANSPORTER_STATUS_NEED_RECONNECT, status);\n\n      if (isNeedUpdateCMPList) {\n        _cmpManager.addInvalid(_connectedDomain);\n\n        if (_cmpManager.isAllInvalid()) {\n          _naviManager.clear();\n\n          _cmpManager.clearInvalid();\n        }\n      }\n\n      if (isNeedReconnect) {\n        this.disconnect();\n        this.reconnect();\n      }\n\n      var connectionStatus = TRANSPORTER_STATUS_TO_CONNECTION_STATUS[status] || status;\n      this._connectionStatus = connectionStatus;\n\n      this._imEventEmitter.emit(IM_EVENT.STATUS, {\n        status: connectionStatus\n      });\n    };\n\n    _proto._handleConnectError = function _handleConnectError(errorInfo) {\n      var _user = this._user;\n      var code = errorInfo.code || errorInfo.status;\n      this.disconnect();\n\n      if (code === ERROR_INFO.CONN_REDIRECTED.code) {\n        this._naviManager.clear();\n\n        return this.connect(_user);\n      }\n\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      return utils.Defer.reject(errorInfo);\n    };\n\n    _proto._afterConnect = function _afterConnect(connectUser, syncTime) {\n      var self = this;\n      var _serverEngine = self._serverEngine,\n          appkey = self._option.appkey,\n          _imEventEmitter = self._imEventEmitter;\n      var id = connectUser.id;\n      Logger.setOption({\n        userId: id\n      });\n      self._user.id = id;\n      self._conversationManager = new ConversationManager({\n        appkey: appkey,\n        userId: id,\n        onChanged: function onChanged(updatedConversationList) {\n          _imEventEmitter.emit(IM_EVENT.CONVERSATION, {\n            updatedConversationList: updatedConversationList\n          });\n        }\n      });\n      self._messageManager = new MessagePullManager(_serverEngine, {\n        startSyncTime: syncTime\n      });\n\n      self._messageManager.watchMessage(function (event) {\n        self._notifyMessage(event);\n      });\n\n      self._chatRoomKVManager = new ChatRoomKVManager(_serverEngine);\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _events;\n\n      var statusWatcher = watchers.status,\n          messageWatcher = watchers.message,\n          conversationWatcher = watchers.conversation;\n      var self = this;\n      var events = (_events = {}, _events[IM_EVENT.STATUS] = statusWatcher, _events[IM_EVENT.MESSAGE] = messageWatcher, _events[IM_EVENT.CONVERSATION] = conversationWatcher, _events);\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._imEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      var _imEventEmitter = this._imEventEmitter;\n      var offEventNameObj = {\n        status: 'IM_EVENT.STATUS',\n        message: 'IM_EVENT.MESSAGE',\n        conversation: 'IM_EVENT.CONVERSATION'\n      };\n\n      if (watchers) {\n        utils.forEach(watchers, function (val, key) {\n          if (offEventNameObj[key]) {\n            _imEventEmitter.off(key, val);\n          }\n        });\n      } else {\n        _imEventEmitter.clear();\n      }\n    };\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._connectionStatus;\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      var user = this._user || {};\n      return user.id;\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      var _option = this._option,\n          _naviManager = this._naviManager;\n      return utils.extend({\n        navi: _naviManager.getLocalConfig()\n      }, _option);\n    };\n\n    _proto.connect = function connect(user) {\n      Logger.startRealtimeUpload();\n      var self = this;\n      var _option = self._option,\n          _serverEngine = self._serverEngine,\n          _cmpManager = self._cmpManager;\n      var naviOpt = common.getNavReqOption(_option, user);\n      var naviManager = new NaviManager(naviOpt);\n      var getServerConfig = _option.isOldServer ? _serverEngine.getOldServerConfig : _serverEngine.getServerConfig;\n\n      self._handleConnectionStatus(CONNECTION_STATUS.CONNECTING);\n\n      self._user = utils.copy(user);\n      self._naviManager = naviManager;\n      var connectUser;\n      return naviManager.get().then(function (configForNavi) {\n        var cmpDomainList = common.getCMPDomainList(configForNavi, _option);\n        Logger.setServerOption(configForNavi);\n\n        _cmpManager.setDomainList(cmpDomainList);\n\n        return _cmpManager.getFaster();\n      }).then(function (_ref) {\n        var domain = _ref.domain;\n        self._connectedDomain = domain;\n        return _serverEngine.connect(user, {\n          domain: domain\n        });\n      }).then(function (user) {\n        connectUser = user;\n        return getServerConfig.call(_serverEngine, user.id);\n      }).then(function (serverConfig) {\n        self._afterConnect(connectUser, serverConfig);\n\n        return connectUser;\n      })[\"catch\"](function (error) {\n        return self._handleConnectError(error);\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      var self = this;\n      var _user = self._user;\n\n      if (utils.isUndefined(_user)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      return self._networkDetecter.start().then(function () {\n        return self.connect(_user);\n      });\n    };\n\n    _proto.disconnect = function disconnect(isNotify) {\n      isNotify && this._handleConnectionStatus(CONNECTION_STATUS.DISCONNECTED);\n      this._networkDetecter && this._networkDetecter.stop();\n      this._messageManager && this._messageManager.close();\n      this._chatRoomKVManager && this._chatRoomKVManager.close();\n      return this._serverEngine.disconnect();\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      this.disconnect(true);\n      return this.connect(user);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, option) {\n      var self = this;\n      return self._serverEngine.sendMessage(conversation, option).then(function (message) {\n        self._conversationManager.addMessage(message);\n\n        return message;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var self = this;\n      return self._serverEngine.recallMessage(conversation, message, option).then(function (message) {\n        self._conversationManager.addMessage(message);\n\n        return message;\n      });\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine,\n          _conversationManager = this._conversationManager;\n      var func = isOldServer ? _serverEngine.getOldConversationList : _serverEngine.getConversationList;\n      return func.call(_serverEngine, option, {\n        afterDecode: function afterDecode(conversation) {\n          var localConversation = _conversationManager.get(conversation);\n\n          conversation.unreadMessageCount = localConversation.unreadMessageCount || 0;\n          conversation.hasMentiond = localConversation.hasMentiond || false;\n          conversation.mentiondInfo = localConversation.mentiondInfo;\n          return conversation;\n        }\n      });\n    };\n\n    _proto.getLocalConversation = function getLocalConversation(conversation) {\n      var local = this._conversationManager.get(conversation);\n\n      return {\n        unreadMessageCount: local.unreadMessageCount || 0,\n        hasMentiond: local.hasMentiond || false,\n        mentiondInfo: local.mentiondInfo\n      };\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n      var func = isOldServer ? _serverEngine.removeOldConversation : _serverEngine.removeConversation;\n      return func.call(_serverEngine, conversation);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        var totalCount = this._conversationManager.getTotalUnreadCount();\n\n        return utils.Defer.resolve(totalCount);\n      } else {\n        return _serverEngine.getTotalUnreadCount();\n      }\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        this._conversationManager.read(conversation);\n\n        return utils.Defer.resolve();\n      } else {\n        return _serverEngine.clearUnreadCount(conversation, option);\n      }\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var _serverEngine = self._serverEngine,\n          _naviManager = self._naviManager,\n          _chatRoomKVManager = self._chatRoomKVManager;\n      return _serverEngine.joinChatRoom(chrm, option).then(function () {\n        return _naviManager.get();\n      }).then(function (configForNavi) {\n        var isOpenKVStorageService = configForNavi.kvStorage;\n        var initialTime = 0;\n        return isOpenKVStorageService ? _chatRoomKVManager.pull({\n          time: initialTime,\n          chrmId: chrm.id\n        }) : utils.Defer.resolve();\n      });\n    };\n\n    _proto.setChatRoomKV = function setChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.UPDATE,\n        userId: self._user.id\n      });\n      entry.type = CHATROOM_ENTRY_TYPE.UPDATE;\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceSetChatRoomKV = function forceSetChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.setChatRoomKV(chrm, entry);\n    };\n\n    _proto.removeChatRoomKV = function removeChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.DELETE,\n        userId: self._user.id\n      });\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceRemoveChatRoomKV = function forceRemoveChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.removeChatRoomKV(chrm, entry);\n    };\n\n    _proto.getChatRoomKV = function getChatRoomKV(chrm, key) {\n      var value = this._chatRoomKVManager.getValue(chrm.id, key);\n\n      if (utils.isEmpty(value)) {\n        return utils.Defer.reject(ERROR_INFO.CHATROOM_KEY_NOT_EXIST);\n      } else {\n        return utils.Defer.resolve(value);\n      }\n    };\n\n    _proto.getAllChatRoomKV = function getAllChatRoomKV(chrm) {\n      var kvs = this._chatRoomKVManager.getAll(chrm.id);\n\n      return utils.Defer.resolve(kvs);\n    };\n\n    return WebIMEngine;\n  }();\n\n  var Engine = (function (imArg) {\n    return new WebIMEngine(imArg);\n  });\n\n  var execEngineByEvent = function execEngineByEvent(params, engine) {\n    var eventName = params.event,\n        args = params.args;\n    args = args || [];\n\n    var engineEvent = engine[eventName] || function () {\n      return utils.Defer.reject(ERROR_INFO.SDK_INTERNAL_ERROR);\n    };\n\n    return engineEvent.apply(engine, args);\n  };\n\n  var EngineDispatcher = function () {\n    function EngineDispatcher(option) {\n      this._engine = void 0;\n      this._engine = new Engine(option);\n    }\n\n    var _proto = EngineDispatcher.prototype;\n\n    _proto._isEventNeedConnect = function _isEventNeedConnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isNotConnected = connectionStatus !== CONNECTION_STATUS.CONNECTED,\n          isEventNeedConnected = utils.isInclude(ENGINE_EVENT_NEED_CONNECTED, eventName);\n      return isNotConnected && isEventNeedConnected;\n    };\n\n    _proto._isEventNeedDisconnect = function _isEventNeedDisconnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isConnecting = common.isConnected(connectionStatus) || common.isConnecting(connectionStatus),\n          isEventNeedDisconnected = utils.isInclude(ENGINE_EVENT_NEED_DISCONNECTED, eventName);\n      return isConnecting && isEventNeedDisconnected;\n    };\n\n    _proto._exec = function _exec(params) {\n      var event = params.event;\n      var engine = this._engine;\n\n      if (this._isEventNeedConnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      if (this._isEventNeedDisconnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.RC_CONNECTION_EXIST);\n      }\n\n      var execResult = execEngineByEvent(params, engine);\n      return utils.isPromise(execResult) ? execResult[\"catch\"](function (error) {\n        var errorCode = error.status || error.code || error;\n        var msg = utils.isObject(error) ? error.msg : null;\n        var errorInfo = ERROR_CODE_TO_INFO[errorCode] || {\n          code: errorCode\n        };\n\n        if (msg) {\n          errorInfo.msg = msg;\n        }\n\n        var isValidErrorCode = utils.isNumberData(errorCode);\n\n        if (!isValidErrorCode) {\n          if (utils.isStackError(error)) {\n            error = error.stack.toString();\n          }\n\n          Logger.fatal(TAG.L_CRASH_F, {\n            content: {\n              desc: 'SDK Error',\n              error: error\n            }\n          });\n          errorInfo = utils.extendInShallow(ERROR_INFO.SDK_INTERNAL_ERROR, {\n            error: error\n          });\n        }\n\n        return utils.Defer.reject(errorInfo);\n      }) : execResult;\n    };\n\n    _proto.exec = function exec(params) {\n      var event = params.event;\n\n      var LOG_TAG = APP_ENGINE_EVENT_LOG_TAG[event],\n          isNeedLog = !utils.isEmpty(LOG_TAG),\n          _ref = LOG_TAG || {},\n          reqLogTag = _ref.req,\n          respLogTag = _ref.resp;\n\n      isNeedLog && Logger.info(reqLogTag, params);\n\n      var execResult = this._exec(params);\n\n      if (utils.isPromise(execResult)) {\n        return execResult.then(function (result) {\n          isNeedLog && Logger.info(respLogTag, result);\n          return result;\n        })[\"catch\"](function (error) {\n          isNeedLog && Logger.error(respLogTag, error);\n          return utils.Defer.reject(error);\n        });\n      } else {\n        isNeedLog && Logger.info(respLogTag, execResult);\n        return execResult;\n      }\n    };\n\n    return EngineDispatcher;\n  }();\n\n  var Type = function Type(name, validator, options) {\n    options = options || {};\n    var self = this;\n    self.validate = validator;\n    self.name = name;\n    self.errorInfo = options.errorInfo;\n\n    self.canBeNull = function () {\n      self.validate = function (data) {\n        return utils.isUndefined(data) || utils.isNull(data) || validator(data);\n      };\n\n      return self;\n    };\n  };\n\n  Type.isType = function (type) {\n    return type instanceof Type;\n  };\n\n  Type.String = new Type('String', utils.isString);\n  Type.Number = new Type('Number', utils.isNumber);\n  Type.Boolean = new Type('Boolean', utils.isBoolean);\n  Type.Function = new Type('Function', utils.isFunction);\n  Type.Object = new Type('Object', utils.isObject);\n  Type.Array = new Type('Array', utils.isArray);\n  var conversationType = common.getConversationTypeList().join('ã€');\n  Type.ConversationType = new Type(conversationType, common.isValidConversationType);\n  Type.ChatRoomEntryKey = new Type('ChatRoomEntryKey', common.isValidChatRoomKey, {\n    errorInfo: 'ChatRoom Key length must be 1 - 128, Only lettersã€numbersã€+ã€=ã€-ã€_ are supported'\n  });\n  Type.ChatRoomEntryValue = new Type('ChatRoomEntryValue', common.isValidChatRoomValue, {\n    errorInfo: 'ChatRoom Value length must be 1 - 4096'\n  });\n\n  var Struct = function () {\n    function Struct(structure, funcName, paths) {\n      if (paths === void 0) {\n        paths = [];\n      }\n\n      if (!(this instanceof Struct)) {\n        return new Struct(structure, funcName, paths);\n      }\n\n      var self = this;\n      self.structure = structure;\n      self.paths = paths;\n      self.funcName = funcName;\n\n      if (Type.isType(structure)) {\n        self.validate = self._validateType;\n      } else if (utils.isArray(structure)) {\n        self.validate = self._validateArray;\n      } else if (utils.isObject(structure)) {\n        self.validate = self._validateObject;\n      } else {\n        self.validate = self._validateOther;\n      }\n    }\n\n    var _proto = Struct.prototype;\n\n    _proto._validateType = function _validateType(data) {\n      var structure = this.structure;\n      var isValid = structure.validate(data);\n      return isValid ? this._getSuccess() : this._getError(data);\n    };\n\n    _proto._validateArray = function _validateArray(data) {\n      var structure = this.structure;\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isArray(data)) {\n        return this._getError(data);\n      }\n\n      var typer = structure[0];\n\n      for (var filed in data) {\n        var val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateObject = function _validateObject(data) {\n      var structure = this.structure,\n          paths = this.paths;\n      data = data || {};\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isObject(data)) {\n        return this._getError(data);\n      }\n\n      var checkedField = [];\n\n      for (var filed in data) {\n        var typer = structure[filed],\n            val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n\n        checkedField.push(filed);\n      }\n\n      for (var checkField in structure) {\n        var _typer = structure[checkField];\n        var unCheckData = data[checkField];\n\n        if (!utils.isInclude(checkedField, checkField) && !_typer.validate(unCheckData)) {\n          var errPaths = utils.copy(paths);\n          errPaths.push(checkField);\n          return this._getError(unCheckData, {\n            paths: errPaths,\n            expect: _typer.name\n          });\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateOther = function _validateOther(data) {\n      var self = this;\n      var structure = self.structure;\n\n      if (utils.isEqual(structure, data) || utils.isEmpty(structure)) {\n        return self._getSuccess();\n      } else {\n        return self._getError(data, {\n          current: data,\n          expect: structure\n        });\n      }\n    };\n\n    _proto._validateField = function _validateField(typer, filed, value) {\n      var paths = this.paths,\n          funcName = this.funcName;\n      var newPaths = utils.copy(paths);\n      newPaths.push(filed);\n      return new Struct(typer, funcName, newPaths).validate(value);\n    };\n\n    _proto._getError = function _getError(data, options) {\n      if (options === void 0) {\n        options = [];\n      }\n\n      var structure = this.structure,\n          paths = this.paths,\n          funcName = this.funcName;\n      options = utils.extend({\n        current: data,\n        expect: structure.name || utils.getTypeName(structure),\n        paths: paths\n      }, options);\n      paths = options.paths;\n      var _options = options,\n          current = _options.current,\n          expect = _options.expect;\n      var param = utils.isEmpty(paths) ? 'param' : paths.join('.');\n      var currentType = utils.getTypeName(current);\n      current = utils.toJSON(current) || current;\n      current = current + \"(\" + currentType + \")\";\n      var msg = utils.tplEngine(ERROR_INFO.PARAMETER_ERROR.msg, {\n        param: param,\n        expect: expect,\n        current: current\n      });\n      var info = {\n        code: ERROR_INFO.PARAMETER_ERROR.code,\n        funcName: funcName,\n        msg: msg\n      };\n      var jsonInfo = utils.toJSON(info);\n      if (utils.isEmpty(funcName)) delete info[funcName];\n\n      if (structure.errorInfo) {\n        info = structure.errorInfo;\n      }\n\n      return {\n        isError: true,\n        info: info,\n        jsonInfo: jsonInfo\n      };\n    };\n\n    _proto._getSuccess = function _getSuccess() {\n      return {\n        isError: false\n      };\n    };\n\n    return Struct;\n  }();\n\n  var validate = (function (struct, params, eventName) {\n    return Struct(struct, eventName).validate(params);\n  });\n\n  var _MESSAGE_TYPE_VALIDAT;\n  var MESSAGE_TYPE_VALIDATE = (_MESSAGE_TYPE_VALIDAT = {}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.TEXT] = {\n    content: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.VOICE] = {\n    content: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.HQ_VOICE] = {\n    remoteUrl: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.IMAGE] = {\n    content: Type.String,\n    imageUri: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.GIF] = {\n    gifDataSize: Type.Number,\n    width: Type.Number,\n    height: Type.Number,\n    remoteUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.RICH_CONTENT] = {\n    title: Type.String,\n    content: Type.String,\n    imageUri: Type.String,\n    url: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.LOCATION] = {\n    content: Type.String,\n    latitude: Type.Number,\n    longitude: Type.Number,\n    poi: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.FILE] = {\n    name: Type.String,\n    size: Type.Number,\n    type: Type.String,\n    fileUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.SIGHT] = {\n    sightUrl: Type.String,\n    content: Type.String,\n    duration: Type.Number,\n    size: Type.Number,\n    name: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.COMBINE] = {\n    remoteUrl: Type.String,\n    conversationType: Type.Number,\n    nameList: Type.Array,\n    summaryList: Type.Array\n  }, _MESSAGE_TYPE_VALIDAT);\n  var validateMsgContent = (function (objectName, option, eventName) {\n    var validateByObjectName = MESSAGE_TYPE_VALIDATE[objectName];\n\n    if (validateByObjectName) {\n      return validate(validateByObjectName, option, eventName);\n    } else {\n      return {\n        isError: false,\n        info: ''\n      };\n    }\n  });\n\n  var Conversation = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      Conversation.create = function create(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.get = function get(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.merge = function merge(option) {\n        try {\n          var conversationList = option.conversationList,\n              updatedConversationList = option.updatedConversationList;\n          conversationList = updatedConversationList.concat(conversationList);\n          conversationList = common.sortConversationList(conversationList);\n          var hashTable = {};\n          var newList = [];\n          utils.forEach(conversationList, function (conversation) {\n            if (!utils.isObject(conversation)) {\n              return;\n            }\n\n            var type = conversation.type,\n                targetId = conversation.targetId;\n            var localConversation = _engineDispatcher.exec({\n              event: ENGINE_EVENT.GET_LOCAL_CONVERSATION,\n              args: [conversation]\n            }) || {};\n            localConversation.unreadMessageCount = localConversation.unreadMessageCount || 0;\n            var key = type + '_' + targetId;\n            var hashItem = hashTable[key];\n\n            if (hashItem) {\n              var index = hashItem.index,\n                  val = hashItem.val;\n              val = utils.extend(conversation, val);\n              val.unreadMessageCount = localConversation.unreadMessageCount;\n              newList[index] = val;\n              hashTable[key].val = val;\n            } else {\n              conversation.unreadMessageCount = localConversation.unreadMessageCount;\n              newList.push(conversation);\n              hashTable[key] = {\n                index: newList.length - 1,\n                val: conversation\n              };\n            }\n          });\n          return newList;\n        } catch (e) {\n          utils.consoleError(e);\n        }\n      };\n\n      Conversation.remove = function remove(option) {\n        var _validate = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'Conversation.remove'),\n            isError = _validate.isError,\n            info = _validate.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [option]\n        });\n      };\n\n      Conversation.getList = function getList(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull(),\n          startTime: Type.Number.canBeNull()\n        }, option, 'Conversation.getList'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CONVERSATION_LIST,\n          args: [option]\n        });\n      };\n\n      Conversation.getTotalUnreadCount = function getTotalUnreadCount() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT\n        });\n      };\n\n      function Conversation(option) {\n        this.type = void 0;\n        this.targetId = void 0;\n\n        var _validate3 = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'new Conversation'),\n            isError = _validate3.isError,\n            jsonInfo = _validate3.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = Conversation.prototype;\n\n      _proto.send = function send(option) {\n        var eventName = 'conversation.send';\n\n        var _validate4 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        option = utils.extendInShallow(SEND_MESSAGE_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [this, option]\n        });\n      };\n\n      _proto.recall = function recall(message, option) {\n        var _validate5 = validate({\n          sentTime: Type.Number,\n          messageUId: Type.String\n        }, message, 'conversation.recall'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.RECALL_MESSAGE,\n          args: [this, message, option]\n        });\n      };\n\n      _proto.read = function read(option) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_UNREAD_COUNT,\n          args: [this, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          order: Type.Number.canBeNull(),\n          count: Type.Number.canBeNull(),\n          timestrap: Type.Number.canBeNull()\n        }, option, 'conversation.getMessages'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_MESSAGES_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_HISTORY_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.deleteMessages = function deleteMessages(messages) {\n        var _validate7 = validate([{\n          sentTime: Type.Number,\n          messageUId: Type.String,\n          messageDirection: Type.Number\n        }], messages, 'conversation.deleteMessages'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DELETE_MESSAGES,\n          args: [this, messages]\n        });\n      };\n\n      _proto.clearMessages = function clearMessages(option) {\n        var _validate8 = validate({\n          timestrap: Type.Number\n        }, option, 'conversation.clearMessages'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_MESSAGES,\n          args: [this, option]\n        });\n      };\n\n      _proto.destory = function destory() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [conversation]\n        });\n      };\n\n      return Conversation;\n    }(), _temp;\n  });\n\n  var ChatRoom = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      ChatRoom.get = function get(option) {\n        return new ChatRoom(option);\n      };\n\n      function ChatRoom(option) {\n        this.id = void 0;\n\n        var _validate = validate({\n          id: Type.String\n        }, option, 'new ChatRoom'),\n            isError = _validate.isError,\n            jsonInfo = _validate.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = ChatRoom.prototype;\n\n      _proto.join = function join(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatRoom.join'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_CHATROOM,\n          args: [this]\n        });\n      };\n\n      _proto.getInfo = function getInfo(option) {\n        var _validate3 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull()\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate3.isError,\n            info = _validate3.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_INFO_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_INFO,\n          args: [this, option]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var eventName = 'chatRoom.send';\n\n        var _validate4 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var id = this.id;\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: id\n        };\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate5 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull(),\n          timestrap: Type.Number\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_MESSAGES, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.setEntry = function setEntry(option) {\n        var _validate6 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.setEntry'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceSetEntry = function forceSetEntry(option) {\n        var _validate7 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.forceSetEntry'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.removeEntry = function removeEntry(option) {\n        var _validate8 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.removeEntry'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceRemoveEntry = function forceRemoveEntry(option) {\n        var _validate9 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.forceRemoveEntry'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.getEntry = function getEntry(key) {\n        var _validate10 = validate(Type.ChatRoomEntryKey, key, 'chatRoom.getEntry'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_KV,\n          args: [this, key]\n        });\n      };\n\n      _proto.getAllEntries = function getAllEntries() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_ALL_KV,\n          args: [this]\n        });\n      };\n\n      return ChatRoom;\n    }(), _temp;\n  });\n\n  var RTC = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      RTC.get = function get(option) {\n        return new RTC(option);\n      };\n\n      function RTC(option) {\n        this.roomId = void 0;\n        this.option = void 0;\n        this.roomId = option.id;\n        this.option = option;\n      }\n\n      var _proto = RTC.prototype;\n\n      _proto.join = function join() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.ping = function ping() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.PING_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.getRoomInfo = function getRoomInfo() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_ROOM_INFO,\n          args: [this.option]\n        });\n      };\n\n      _proto.getUserInfoList = function getUserInfoList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_INFO_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setUserInfo = function setUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.removeUserInfo = function removeUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.setData = function setData(key, value, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_DATA,\n          args: [this.roomId, key, value, isInner, apiType, message]\n        });\n      };\n\n      _proto.getData = function getData(keys, isInner, apiType) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType]\n        });\n      };\n\n      _proto.removeData = function removeData(keys, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType, message]\n        });\n      };\n\n      _proto.setUserData = function setUserData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.getUserData = function getUserData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.PERSON);\n      };\n\n      _proto.removeUserData = function removeUserData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.setRoomData = function setRoomData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getRoomData = function getRoomData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.ROOM);\n      };\n\n      _proto.removeRoomData = function removeRoomData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getUserList = function getUserList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setOutData = function setOutData(rtcData, type, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_OUT_DATA,\n          args: [this.roomId, rtcData, type, message]\n        });\n      };\n\n      _proto.getOutData = function getOutData(userIds) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_OUT_DATA,\n          args: [this.roomId, userIds]\n        });\n      };\n\n      _proto.getToken = function getToken() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_TOKEN,\n          args: [this.option]\n        });\n      };\n\n      _proto.setState = function setState(content) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_STATE,\n          args: [this.option, content]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var id = this.roomId;\n        var conversation = {\n          type: CONVERSATION_TYPE.RTC_ROOM,\n          targetId: id\n        };\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      return RTC;\n    }(), _temp;\n  });\n\n  var IM = function () {\n    function IM(option) {\n      this._engineDispatcher = void 0;\n\n      var _validate = validate({\n        appkey: Type.String\n      }, option, 'RongIMLib.init'),\n          isError = _validate.isError,\n          jsonInfo = _validate.jsonInfo;\n\n      if (isError) {\n        throw Error(jsonInfo);\n      }\n\n      var engineHandler = new EngineDispatcher(option);\n      this._engineDispatcher = engineHandler;\n      var Modules = {\n        Conversation: Conversation(engineHandler),\n        ChatRoom: ChatRoom(engineHandler),\n        RTC: RTC(engineHandler)\n      };\n      utils.extend(this, Modules);\n    }\n\n    var _proto = IM.prototype;\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_STATUS\n      });\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_USER_ID\n      });\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTED_TIME\n      });\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_APP_INFO\n      });\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _validate2 = validate({\n        conversation: Type.Function.canBeNull(),\n        message: Type.Function.canBeNull(),\n        status: Type.Function.canBeNull()\n      }, watchers, 'im.watch'),\n          isError = _validate2.isError,\n          jsonInfo = _validate2.jsonInfo;\n\n      if (isError) {\n        utils.consoleError(jsonInfo);\n        return jsonInfo;\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.UN_WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.connect = function connect(user) {\n      var _validate3 = validate({\n        token: Type.String\n      }, user, 'im.connect'),\n          isError = _validate3.isError,\n          info = _validate3.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.CONNECT,\n        args: [user]\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.RECONNECT\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.DISCONNECT,\n        args: [true]\n      });\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      var _validate4 = validate({\n        token: Type.String\n      }, user, 'im.changeUser'),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var self = this;\n      return self.disconnect().then(function () {\n        return self.connect(user);\n      });\n    };\n\n    _proto.getFileToken = function getFileToken(fileType) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_TOKEN,\n        args: [fileType]\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_URL,\n        args: [fileType, fileName, originName]\n      });\n    };\n\n    return IM;\n  }();\n\n  var imInstance;\n\n  var initLogger = function initLogger(option, im) {\n    var isDebug = option.isDebug,\n        appkey = option.appkey,\n        logCollectEvent = option.logger;\n    utils.isFunction(logCollectEvent) && Logger.watchLog(logCollectEvent);\n    Logger.setOption({\n      isDebug: isDebug,\n      appkey: appkey\n    });\n    Logger.info(TAG.A_INIT_O, {\n      content: option\n    });\n    im.watch({\n      status: function status(_ref) {\n        var _status = _ref.status;\n        Logger.setOption({\n          isNetworkUnavailable: utils.isEqual(_status, CONNECTION_STATUS.NETWORK_UNAVAILABLE)\n        });\n      }\n    });\n  };\n\n  var init = function init(option) {\n    option = utils.extendInShallow(IM_OPTION, option);\n    option.connectType = common.getConnectType(option);\n\n    if (!imInstance) {\n      imInstance = new IM(option);\n      initLogger(option, imInstance);\n    }\n\n    return imInstance;\n  };\n\n  var getInstance = function getInstance() {\n    return imInstance;\n  };\n\n  var index = utils.extend({\n    init: init,\n    getInstance: getInstance,\n    env: env,\n    common: common,\n    ERROR_CODE: ERROR_CODE,\n    Logger: Logger\n  }, product);\n\n  return index;\n\n})));\n"
  },
  {
    "path": "api-test/lib/js/RongIMLib-3.0.5-mentioned.js",
    "content": "/*\n* RongIMLib.js v3.0.5-dev\n* CodeVersion: 03caf1eb0aea5d9db625b9b939e52338de427ba1\n* Release Date: Wed Aug 12 2020 19:04:27 GMT+0800 (China Standard Time)\n* Copyright 2020 RongCloud\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongIMLib = factory());\n}(this, (function () { 'use strict';\n\n  var versionToServer = \"3.0.5\";\n\n  var SDK_VERSION = versionToServer;\n\n  var ERROR_INFO = {\n    TIMEOUT: {\n      code: -1,\n      msg: 'Network timeout'\n    },\n    SDK_INTERNAL_ERROR: {\n      code: -2,\n      msg: 'SDK internal error'\n    },\n    PARAMETER_ERROR: {\n      code: -3,\n      msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n    },\n    REJECTED_BY_BLACKLIST: {\n      code: 405,\n      msg: 'Blacklisted by the other party'\n    },\n    SEND_TOO_FAST: {\n      code: 20604,\n      msg: 'Sending messages too quickly'\n    },\n    NOT_IN_GROUP: {\n      code: 22406,\n      msg: 'Not in group'\n    },\n    FORBIDDEN_IN_GROUP: {\n      code: 22408,\n      msg: 'Forbbiden from speaking in the group'\n    },\n    NOT_IN_CHATROOM: {\n      code: 23406,\n      msg: 'Not in chatRoom'\n    },\n    FORBIDDEN_IN_CHATROOM: {\n      code: 23408,\n      msg: 'Forbbiden from speaking in the chatRoom'\n    },\n    KICKED_FROM_CHATROOM: {\n      code: 23409,\n      msg: 'Kicked out and forbbiden from joining the chatRoom'\n    },\n    CHATROOM_NOT_EXIST: {\n      code: 23410,\n      msg: 'ChatRoom does not exist'\n    },\n    CHATROOM_IS_FULL: {\n      code: 23411,\n      msg: 'ChatRoom members exceeded'\n    },\n    PARAMETER_INVALID_CHATROOM: {\n      code: 23412,\n      msg: 'Invalid chatRoom parameters'\n    },\n    ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n      code: 23414,\n      msg: 'ChatRoom message roaming service is not open, Please go to the developer to open this service'\n    },\n    RECALLMESSAGE_PARAMETER_INVALID: {\n      code: 25101,\n      msg: 'Invalid recall message parameter'\n    },\n    PUSHSETTING_PARAMETER_INVALID: {\n      code: 26001,\n      msg: 'Invalid push parameter'\n    },\n    OPERATION_BLOCKED: {\n      code: 20605,\n      msg: 'Operation is blocked'\n    },\n    OPERATION_NOT_SUPPORT: {\n      code: 20606,\n      msg: 'Operation is not supported'\n    },\n    MSG_BLOCKED_SENSITIVE_WORD: {\n      code: 21501,\n      msg: 'The sent message contains sensitive words'\n    },\n    REPLACED_SENSITIVE_WORD: {\n      code: 21502,\n      msg: 'Sensitive words in the message have been replaced'\n    },\n    NOT_CONNECTED: {\n      code: 30001,\n      msg: 'Please connect successfully first'\n    },\n    NAVI_REQUEST_ERROR: {\n      code: 30007,\n      msg: 'Navigation http request failed'\n    },\n    CMP_REQUEST_ERROR: {\n      code: 30010,\n      msg: 'CMP sniff http request failed'\n    },\n    CONN_APPKEY_FAKE: {\n      code: 31002,\n      msg: 'Your appkey is fake'\n    },\n    CONN_MINI_SERVICE_NOT_OPEN: {\n      code: 31003,\n      msg: 'Mini program service is not open, Please go to the developer to open this service'\n    },\n    CONN_TOKEN_INCORRECT: {\n      code: 31004,\n      msg: 'Your token is not valid or expired'\n    },\n    CONN_NOT_AUTHRORIZED: {\n      code: 31005,\n      msg: 'AppKey and Token do not match'\n    },\n    CONN_REDIRECTED: {\n      code: 31006,\n      msg: 'Connection redirection'\n    },\n    CONN_APP_BLOCKED_OR_DELETED: {\n      code: 31008,\n      msg: 'AppKey is banned or deleted'\n    },\n    CONN_USER_BLOCKED: {\n      code: 31009,\n      msg: 'User blocked'\n    },\n    CONN_DOMAIN_INCORRECT: {\n      code: 31012,\n      msg: 'Connect domain error, Please check the set security domain'\n    },\n    ROAMING_SERVICE_UNAVAILABLE: {\n      code: 33007,\n      msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n    },\n    RC_CONNECTION_EXIST: {\n      code: 34001,\n      msg: 'Connection already exists'\n    },\n    CHATROOM_KV_EXCEED: {\n      code: 23423,\n      msg: 'ChatRoom KV setting exceeds maximum'\n    },\n    CHATROOM_KV_OVERWRITE_INVALID: {\n      code: 23424,\n      msg: 'ChatRoom KV already exists'\n    },\n    CHATROOM_KV_STORE_NOT_OPEN: {\n      code: 23426,\n      msg: 'ChatRoom KV storage service is not open, Please go to the developer to open this service'\n    },\n    CHATROOM_KEY_NOT_EXIST: {\n      code: 23427,\n      msg: 'ChatRoom key does not exist'\n    }\n  };\n  var ERROR_CODE = {};\n  var ERROR_CODE_TO_INFO = {};\n\n  for (var name$1 in ERROR_INFO) {\n    var info = ERROR_INFO[name$1];\n    var code = info.code;\n    ERROR_CODE[name$1] = code;\n    ERROR_CODE[code] = name$1;\n    ERROR_CODE_TO_INFO[code] = info;\n  }\n\n  var SERVER_ERROR_TO_CODE = {\n    '1': ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n  };\n\n  var _CONNECT_SERVER_STATU, _SERVER_DISCONNECT_ST, _TRANSPORTER_STATUS_T;\n  var NAVI_ERROR_INFO = {\n    '401': ERROR_INFO.CONN_TOKEN_INCORRECT,\n    '403': ERROR_INFO.CONN_APPKEY_FAKE\n  };\n  var CONNECTION_STATUS = {\n    CONNECTED: 0,\n    CONNECTING: 1,\n    DISCONNECTED: 2,\n    NETWORK_UNAVAILABLE: 3,\n    SOCKET_ERROR: 4,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n    BLOCKED: 12\n  };\n  var SERVER_DISCONNECT_STATUS = {\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 1,\n    BLOCKED: 2\n  };\n  var CONNECT_SERVER_STATUS = {\n    IDENTIFIER_REJECTED: 2,\n    CONN_MINI_SERVICE_NOT_OPEN: 3,\n    TOKEN_INCORRECT: 4,\n    NOT_AUTHORIZED: 5,\n    REDIRECT: 6,\n    PACKAGE_ERROR: 7,\n    APP_BLOCK_OR_DELETE: 8,\n    BLOCK: 9,\n    TOKEN_EXPIRE: 10,\n    DEVICE_ERROR: 11,\n    DOMAIN_INCORRECT: 12\n  };\n  var CONNECT_SERVER_STATUS_MAP_ERROR_INFO = (_CONNECT_SERVER_STATU = {}, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.IDENTIFIER_REJECTED] = ERROR_INFO.CONN_APPKEY_FAKE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.CONN_MINI_SERVICE_NOT_OPEN] = ERROR_INFO.CONN_MINI_SERVICE_NOT_OPEN, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_INCORRECT] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.NOT_AUTHORIZED] = ERROR_INFO.CONN_NOT_AUTHRORIZED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.REDIRECT] = ERROR_INFO.CONN_REDIRECTED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.APP_BLOCK_OR_DELETE] = ERROR_INFO.CONN_APP_BLOCKED_OR_DELETED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.BLOCK] = ERROR_INFO.CONN_USER_BLOCKED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_EXPIRE] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.DOMAIN_INCORRECT] = ERROR_INFO.CONN_DOMAIN_INCORRECT, _CONNECT_SERVER_STATU);\n  var TRANSPORTER_STATUS = {\n    CONNECTED: CONNECTION_STATUS.CONNECTED,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT,\n    BLOCKED: CONNECTION_STATUS.BLOCKED,\n    CLOSE_NORMAL: 1000,\n    CLOSE_GOING_AWAY: 1001,\n    CLOSE_PROTOCOL_ERROR: 1002,\n    CLOSE_UNSUPPORTED: 1003,\n    CLOSE_NO_STATUS: 1005,\n    CLOSE_ABNORMAL: 1006,\n    UNSUPPORTED_DATA: 1007,\n    POLICY_VIOLATION: 1008,\n    CLOSE_TOO_LARGE: 1009,\n    MISSING_EXTENSION: 1010,\n    INTERNAL_ERROR: 1011,\n    SERVICE_RESTART: 1012,\n    TRY_AGAIN_LATER: 1013,\n    TSL_HANDSHAKE: 1015,\n    PING_FIRST_TIMEOUT: 2001,\n    PING_TIMEOUT: 2002,\n    DISCONNECT_TOO_FAST: 2003,\n    EXCEED_MESSAGE_ID_LIMIT: 2004,\n    COMET_REQUEST_ERROR: 2005,\n    MINI_URL_NOT_IN_DOMAIN_LIST: 2006\n  };\n  var MINI_ERROR_MSG_TO_STATUS = {\n    'url not in domain list': TRANSPORTER_STATUS.MINI_URL_NOT_IN_DOMAIN_LIST\n  };\n  var SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS = (_SERVER_DISCONNECT_ST = {}, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT] = TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.BLOCKED] = TRANSPORTER_STATUS.BLOCKED, _SERVER_DISCONNECT_ST);\n  var TRANSPORTER_STATUS_NEED_UPDATE_CMP = [TRANSPORTER_STATUS.CLOSE_NORMAL, TRANSPORTER_STATUS.CLOSE_GOING_AWAY, TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR, TRANSPORTER_STATUS.CLOSE_UNSUPPORTED, TRANSPORTER_STATUS.UNSUPPORTED_DATA, TRANSPORTER_STATUS.POLICY_VIOLATION, TRANSPORTER_STATUS.MISSING_EXTENSION, TRANSPORTER_STATUS.INTERNAL_ERROR, TRANSPORTER_STATUS.SERVICE_RESTART, TRANSPORTER_STATUS.TRY_AGAIN_LATER, TRANSPORTER_STATUS.TSL_HANDSHAKE, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST, TRANSPORTER_STATUS.COMET_REQUEST_ERROR];\n  var TRANSPORTER_STATUS_NEED_RECONNECT = TRANSPORTER_STATUS_NEED_UPDATE_CMP.concat([TRANSPORTER_STATUS.PING_TIMEOUT, TRANSPORTER_STATUS.CLOSE_ABNORMAL, TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT, TRANSPORTER_STATUS.COMET_REQUEST_ERROR]);\n  var TRANSPORTER_STATUS_TO_CONNECTION_STATUS = (_TRANSPORTER_STATUS_T = {}, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_GOING_AWAY] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_UNSUPPORTED] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_NO_STATUS] = CONNECTION_STATUS.DISCONNECTED, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_ABNORMAL] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.DISCONNECT_TOO_FAST] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.UNSUPPORTED_DATA] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.POLICY_VIOLATION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_TOO_LARGE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.MISSING_EXTENSION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.INTERNAL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.SERVICE_RESTART] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TRY_AGAIN_LATER] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TSL_HANDSHAKE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_FIRST_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.COMET_REQUEST_ERROR] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T);\n\n  var CONNECT_TYPE = {\n    COMET: 'comet',\n    WEBSOCKET: 'websocket'\n  };\n  var CONVERSATION_TYPE = {\n    PRIVATE: 1,\n    GROUP: 3,\n    CHATROOM: 4,\n    CUSTOMER_SERVICE: 5,\n    SYSTEM: 6,\n    RTC_ROOM: 12\n  };\n  var MESSAGE_DIRECTION = {\n    SEND: 1,\n    RECEIVE: 2\n  };\n  var MESSAGS_TIME_ORDER = {\n    DESC: 0,\n    ASC: 1\n  };\n  var CHATROOM_ORDER = {\n    ASC: 1,\n    DESC: 2\n  };\n  var RECALL_MESSAGE_TYPE = 'RC:RcCmd';\n  var MENTIOND_TYPE = {\n    ALL: 1,\n    SINGAL: 2\n  };\n  var MESSAGE_TYPE = {\n    TEXT: 'RC:TxtMsg',\n    VOICE: 'RC:VcMsg',\n    HQ_VOICE: 'RC:HQVCMsg',\n    IMAGE: 'RC:ImgMsg',\n    GIF: 'RC:GIFMsg',\n    RICH_CONTENT: 'RC:ImgTextMsg',\n    LOCATION: 'RC:LBSMsg',\n    FILE: 'RC:FileMsg',\n    SIGHT: 'RC:SightMsg',\n    COMBINE: 'RC:CombineMsg',\n    CHRM_KV_NOTIFY: 'RC:chrmKVNotiMsg',\n    LOG_COMMAND: 'RC:LogCmdMsg'\n  };\n  var RTC_API_TYPE = {\n    ROOM: 1,\n    PERSON: 2\n  };\n  var FILE_TYPE = {\n    IMAGE: 1,\n    AUDIO: 2,\n    VIDEO: 3,\n    FILE: 4\n  };\n  var CHATROOM_ENTRY_TYPE = {\n    UPDATE: 1,\n    DELETE: 2\n  };\n  var NOTIFICATION_STATUS = {\n    DO_NOT_DISTURB: 1,\n    NOTIFY: 2\n  };\n  var product = {\n    CONNECT_TYPE: CONNECT_TYPE,\n    CONNECTION_STATUS: CONNECTION_STATUS,\n    CONVERSATION_TYPE: CONVERSATION_TYPE,\n    MESSAGE_DIRECTION: MESSAGE_DIRECTION,\n    MESSAGS_TIME_ORDER: MESSAGS_TIME_ORDER,\n    CHATROOM_ORDER: CHATROOM_ORDER,\n    RECALL_MESSAGE_TYPE: RECALL_MESSAGE_TYPE,\n    MESSAGE_TYPE: MESSAGE_TYPE,\n    MENTIOND_TYPE: MENTIOND_TYPE,\n    SDK_VERSION: SDK_VERSION,\n    FILE_TYPE: FILE_TYPE,\n    CHATROOM_ENTRY_TYPE: CHATROOM_ENTRY_TYPE,\n    NOTIFICATION_STATUS: NOTIFICATION_STATUS\n  };\n\n  var IM_TIMEOUT = 30000;\n  var IM_PING_INTERVAL_TIME = 30000;\n  var IM_COMET_PULLMSG_TIMEOUT = 45000;\n  var IM_PING_MAX_TIMEOUT = 6000;\n  var IM_PING_MIN_TIMEOUT = 2000;\n  var PULL_MSG_TIME = 180000;\n  var NAVI_EXPIRED_TIME = 7200000;\n  var CMP_SNIFF_INTERNAL_TIME = 1000;\n  var FIRST_PING_TIMEOUT = 1000;\n  var NAVI_REQUEST_SUCCESS_CODE = 200;\n  var NAVI_SEPARATOR_IN_TOKEN = '@';\n  var DOMAIN_SEPARATOR_IN_NAVLIST = ';';\n  var DOMAIN_SEPARATOR_IN_CMPLIST = ',';\n  var MAX_SINGAL_ID = 65535;\n  var MINIMUM_CONNECT_DURATION = 5000;\n  var CHATROOM_KEY_LENGTH = {\n    MAX: 128,\n    MIN: 1\n  };\n  var CHATROOM_VALUE_LENGTH = {\n    MAX: 4096,\n    MIN: 1\n  };\n  var TYPE_HAS_CONVERSATION = [CONVERSATION_TYPE.PRIVATE, CONVERSATION_TYPE.GROUP, CONVERSATION_TYPE.SYSTEM];\n  var PLATFORM = {\n    WEB: 'web',\n    WX: 'wx',\n    ZFB: 'zfb',\n    TT: 'tt',\n    BAIDU: 'baidu',\n    QUICK_APP: 'quick_app',\n    UNI: 'uni'\n  };\n  var REQUEST_METHOD = {\n    POST: 'post',\n    GET: 'get'\n  };\n  var STORAGE_ROOT_KEY = 'rc-';\n  var STORAGE_DEVICE_ID_KEY = STORAGE_ROOT_KEY + 'deviceId';\n  var STORAGE_SESSION_ID_KEY = STORAGE_ROOT_KEY + 'sessionId';\n  var STORAGE_NAVI = {\n    ROOT_KEY_TPL: 'nav-{appkey}-{UID}',\n    SUB_KEY: {\n      CONNECT_TYPE: 'connettype',\n      TIME_WHEN_SAVED: 'time',\n      RESPONSE: 'resp'\n    }\n  };\n  var STORAGE_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      SENDBOX: 'send',\n      INBOX: 'in'\n    }\n  };\n  var SESSION_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      TIME: 't'\n    }\n  };\n  var STORAGE_CONVERSATION = {\n    ROOT_KEY_TPL: 'con-{appkey}-{userId}',\n    SUB_KEY: {\n      ROOT_TPL: '{type}-{id}',\n      UNREAD_COUNT: 'c',\n      UNREAD_LAST_TIME: 't',\n      HAS_MENTIOND: 'hm',\n      MENTIOND_INFO: 'm',\n      NOTIFICATION: 'no',\n      TOP: 'to'\n    }\n  };\n  var STORAGE_CONVERSATION_STATUS = {\n    ROOT_KEY_TPL: 'con-s-{appkey}-{userId}',\n    SUB_KEY: {\n      TIME: 't'\n    }\n  };\n  var STORAGE_USER_SETTING = {\n    ROOT_KEY_TPL: 'sett-{appkey}-{userId}',\n    SUB_KEY: {\n      VERSION: 'v',\n      SETTINGS: 's'\n    }\n  };\n  var HTTP_PROTOCOL = {\n    HTTP: 'http:',\n    HTTPS: 'https:',\n    FILE: 'file:'\n  };\n  var WS_PROTOCOL = {\n    WSS: 'wss:',\n    WS: 'ws:'\n  };\n  var NAVI_CALLBACK_NAME = 'getServerEndpoint';\n  var NAVI_TYPE = {\n    COMET: 'cometnavi',\n    WEBSOCKET: 'navi'\n  };\n  var NAVI_URL_TPL = '{url}/{type}.js?appId={appkey}&token={token}&callBack=' + NAVI_CALLBACK_NAME + '&r={random}&v=' + SDK_VERSION;\n  var CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION;\n  var MINI_CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION + '&platform={platform}';\n  var COMET_REQ_HAS_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&topic={topic}&targetid={targetId}&pid={pid}';\n  var COMET_REQ_NO_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&pid={pid}';\n  var COMET_PULL_URL_TPL = '{protocol}//{domain}/pullmsg.js?sessionid={sessionId}&timestrap={timestamp}&pid={pid}';\n  var TIMER_TYPE = {\n    INTERVAL: 'interval',\n    TIMEOUT: 'timeout'\n  };\n  var TIMER_STATUS = {\n    PENNDING: 'pendding',\n    BUSY: 'busy',\n    ENDING: 'ending'\n  };\n  var PLATFORM_TYPE = {\n    MINI: 'MiniProgram',\n    WEB: 'Web'\n  };\n  var SESSION_SYNC_CHATROOM = {\n    ROOT_KEY_TPL: 'sync-chrm-{appkey}-{userId}'\n  };\n\n  var UnKown = 'UnKown';\n\n  var hasMiniBaseEvent = function hasMiniBaseEvent(miniGlobal) {\n    var baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n\n    for (var i = 0, max = baseMiniEventNames.length; i < max; i++) {\n      var baseEventName = baseMiniEventNames[i];\n\n      if (!miniGlobal[baseEventName]) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n  var isFromUniappEnv = function isFromUniappEnv() {\n    if (typeof uni !== 'undefined' && hasMiniBaseEvent(uni)) {\n      return true;\n    }\n\n    return false;\n  };\n\n  var isFromUniapp = isFromUniappEnv();\n\n  var isAppPlusEnv = function isAppPlusEnv() {\n    if (isFromUniapp) {\n      var systemInfo = uni.getSystemInfoSync();\n\n      if (['ios', 'android'].includes(systemInfo.platform) && systemInfo.version) {\n        return true;\n      }\n    }\n\n    return false;\n  };\n\n  var isAppPlus = isAppPlusEnv();\n\n  var isMiniEnv = function isMiniEnv(global) {\n    if (isAppPlus) {\n      return false;\n    }\n\n    return global !== window;\n  };\n\n  var getEnvInfo = function getEnvInfo() {\n    if (isAppPlus) {\n      return {\n        platform: PLATFORM.UNI,\n        global: uni\n      };\n    } else if (typeof swan !== 'undefined' && hasMiniBaseEvent(swan)) {\n      return {\n        platform: PLATFORM.BAIDU,\n        global: swan\n      };\n    } else if (typeof tt !== 'undefined' && hasMiniBaseEvent(tt)) {\n      return {\n        platform: PLATFORM.TT,\n        global: tt\n      };\n    } else if (typeof my !== 'undefined' && hasMiniBaseEvent(my)) {\n      return {\n        platform: PLATFORM.ZFB,\n        global: my\n      };\n    } else if (typeof wx !== 'undefined' && hasMiniBaseEvent(wx) && !navigator) {\n      return {\n        platform: PLATFORM.WX,\n        global: wx\n      };\n    } else {\n      return {\n        platform: PLATFORM.WEB,\n        global: window\n      };\n    }\n  };\n\n  var getWebSystemInfo = function getWebSystemInfo() {\n    var userAgent = navigator.userAgent;\n    var version, type;\n    var condition = {\n      IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n      Edge: /Edge\\/([\\d.]+)/,\n      Firefox: /Firefox\\/([\\d.]+)/,\n      Opera: /(?:OPERA|OPR).([\\d.]+)/,\n      WeiXin: /MicroMessenger\\/([\\d.]+)/,\n      QQBrowser: /QQBrowser\\/([\\d.]+)/,\n      Chrome: /Chrome\\/([\\d.]+)/,\n      Safari: /Version\\/([\\d.]+).*Safari/\n    };\n\n    for (var key in condition) {\n      if (!condition.hasOwnProperty(key)) continue;\n      var browserContent = userAgent.match(condition[key]);\n\n      if (browserContent) {\n        type = key;\n        version = browserContent[1] || browserContent[2];\n        break;\n      }\n    }\n\n    return {\n      model: type || UnKown,\n      version: version || UnKown\n    };\n  };\n\n  var getMiniSystemInfo = function getMiniSystemInfo(global) {\n    var systemInfo = global.getSystemInfoSync() || {};\n    var model = systemInfo.model,\n        brand = systemInfo.brand;\n\n    if (model && brand) {\n      model = model + ' ' + brand;\n    }\n\n    systemInfo.model = model;\n    return systemInfo;\n  };\n\n  var getProtocol = function getProtocol(global) {\n    var location = global.location || {};\n    var isHttp = location.protocol === HTTP_PROTOCOL.HTTP || location.protocol === HTTP_PROTOCOL.FILE;\n    var protocol = {\n      http: isHttp ? HTTP_PROTOCOL.HTTP : HTTP_PROTOCOL.HTTPS,\n      ws: WS_PROTOCOL.WSS\n    };\n\n    if (isHttp) {\n      protocol.ws = WS_PROTOCOL.WS;\n    }\n\n    return protocol;\n  };\n\n  var adaptGlobalObjectCreate = function adaptGlobalObjectCreate(global, isMini) {\n    if (!isMini && !isAppPlus && !global.Object.create) {\n      global.Object.create = function (o, properties) {\n        if (typeof o !== 'object' && typeof o !== 'function') throw new TypeError('Object prototype may only be an Object: ' + o);else if (o === null) throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support \\'null\\' as the first argument.');\n        if (typeof properties !== 'undefined') throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support a second argument.');\n\n        function F() {}\n\n        F.prototype = o;\n        return new F();\n      };\n    }\n  };\n\n  var getMiniGlobal = function getMiniGlobal(global) {\n    return Object.assign(global, {\n      JSON: JSON,\n      Promise: Promise,\n      setTimeout: setTimeout,\n      setInterval: setInterval,\n      encodeURIComponent: encodeURIComponent,\n      clearTimeout: function (_clearTimeout) {\n        function clearTimeout(_x) {\n          return _clearTimeout.apply(this, arguments);\n        }\n\n        clearTimeout.toString = function () {\n          return _clearTimeout.toString();\n        };\n\n        return clearTimeout;\n      }(function (id) {\n        clearTimeout(id);\n      }),\n      clearInterval: function (_clearInterval) {\n        function clearInterval(_x2) {\n          return _clearInterval.apply(this, arguments);\n        }\n\n        clearInterval.toString = function () {\n          return _clearInterval.toString();\n        };\n\n        return clearInterval;\n      }(function (id) {\n        clearInterval(id);\n      })\n    });\n  };\n\n  var envInfo = getEnvInfo();\n  var platform = envInfo.platform,\n      global$1 = envInfo.global;\n  var isMini = isMiniEnv(global$1);\n  var protocol = getProtocol(global$1);\n  var system = isMini || isAppPlus ? getMiniSystemInfo(global$1) : getWebSystemInfo();\n  system.name = platform;\n  adaptGlobalObjectCreate(global$1, isMini);\n  global$1 = isMini || isAppPlus ? getMiniGlobal(global$1) : global$1;\n  var env = {\n    global: global$1,\n    system: system,\n    isMini: isMini,\n    protocol: protocol,\n    isAppPlus: isAppPlus,\n    isFromUniapp: isFromUniapp\n  };\n\n  var global$2 = env.global,\n      system$1 = env.system;\n  var isZFB = system$1.name === PLATFORM.ZFB;\n\n  var ZFBStorage = function () {\n    function ZFBStorage() {}\n\n    var _proto = ZFBStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$2.setStorageSync({\n        key: key,\n        data: value\n      });\n    };\n\n    _proto.get = function get(key) {\n      return global$2.getStorageSync({\n        key: key\n      });\n    };\n\n    _proto.remove = function remove(key) {\n      return global$2.removeStorageSync({\n        key: key\n      });\n    };\n\n    _proto.getKeys = function getKeys() {\n      var res = my.getStorageInfoSync();\n      return res.keys;\n    };\n\n    return ZFBStorage;\n  }();\n\n  var MiniStorage = function () {\n    function MiniStorage() {}\n\n    var _proto2 = MiniStorage.prototype;\n\n    _proto2.set = function set(key, value) {\n      global$2.setStorageSync(key, value);\n    };\n\n    _proto2.get = function get(key) {\n      try {\n        return global$2.getStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.remove = function remove(key) {\n      try {\n        return global$2.removeStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.getKeys = function getKeys() {\n      try {\n        var res = global$2.getStorageInfoSync();\n        return res.keys;\n      } catch (e) {\n        return [];\n      }\n    };\n\n    return MiniStorage;\n  }();\n\n  var storage = isZFB ? ZFBStorage : MiniStorage;\n\n  var JSON$1 = {\n    parse: function parse(sJSON) {\n      return new Function('', 'return (' + sJSON + ')')();\n    },\n    stringify: function stringify(value) {\n      return JSON$1.str('', {\n        '': value\n      });\n    },\n    str: function str(key, holder) {\n      var i,\n          k,\n          v,\n          length,\n          partial,\n          value = holder[key],\n          self = JSON$1;\n\n      if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n        value = value.toJSON(key);\n      }\n\n      switch (typeof value) {\n        case 'string':\n          return self.quote(value);\n\n        case 'number':\n          return isFinite(value) ? String(value) : 'null';\n\n        case 'boolean':\n          return String(value);\n\n        case 'object':\n          if (!value) {\n            return 'null';\n          }\n\n          partial = [];\n\n          if (Object.prototype.toString.apply(value) === '[object Array]') {\n            length = value.length;\n\n            for (i = 0; i < length; i += 1) {\n              partial[i] = self.str(i, value) || 'null';\n            }\n\n            v = partial.length === 0 ? '[]' : '[' + partial.join(',') + ']';\n            return v;\n          }\n\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = self.str(k, value);\n\n              if (v) {\n                partial.push(self.quote(k) + ':' + v);\n              }\n            }\n          }\n\n          v = partial.length === 0 ? '{}' : '{' + partial.join(',') + '}';\n          return v;\n      }\n    },\n    quote: function quote(string) {\n      var self = JSON$1;\n      self.rx_escapable.lastIndex = 0;\n      return self.rx_escapable.test(string) ? '\"' + string.replace(self.rx_escapable, function (a) {\n        var c = self.meta[a];\n        return typeof c === 'string' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n      }) + '\"' : '\"' + string + '\"';\n    },\n    rx_escapable: new RegExp(\"[\\\\\\\"\\\\\\\\\\\"\\0-\\x1F\\x7F-\\x9F\\xAD\\u0600-\\u0604\\u070F\\u17B4\\u17B5\\u200C-\\u200F\\u2028-\\u202F\\u2060-\\u206F\\uFEFF\\uFFF0-\\uFFFF]\", 'g'),\n    meta: {\n      '\\b': '\\\\b',\n      '\t': '\\\\t',\n      '\\n': '\\\\n',\n      '\\f': '\\\\f',\n      '\\r': '\\\\r',\n      '\"': '\\\\\"',\n      '\\'\\'': '\\\\\\'\\'',\n      '\\\\': '\\\\\\\\'\n    }\n  };\n\n  var CacheStorage = function () {\n    function CacheStorage(values) {\n      this.caches = {};\n\n      if (values) {\n        this.caches = values;\n      }\n    }\n\n    var _proto = CacheStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      this.caches[key] = value;\n    };\n\n    _proto.remove = function remove(key) {\n      var val = this.get(key);\n      delete this.caches[key];\n      return val;\n    };\n\n    _proto.get = function get(key) {\n      return this.caches[key];\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keys = [];\n\n      for (var key in this.caches) {\n        keys.push(key);\n      }\n\n      return keys;\n    };\n\n    return CacheStorage;\n  }();\n\n  var global$3 = env.global;\n  var TEST_KEY = 'RC_TEST_KEY';\n  var TEST_VALUE = 'RC_TEST_VALUE';\n\n  var isSupportLocalStorage = function isSupportLocalStorage() {\n    var isSupport = false;\n    var localStorage = global$3.localStorage;\n\n    if (localStorage) {\n      try {\n        localStorage.setItem(TEST_KEY, TEST_VALUE);\n        var testVal = localStorage.getItem(TEST_KEY);\n\n        if (testVal === TEST_VALUE) {\n          isSupport = true;\n        }\n\n        localStorage.removeItem(TEST_KEY);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebStorage = function () {\n    function WebStorage() {}\n\n    var _proto = WebStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$3.localStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$3.localStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$3.localStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$3.localStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebStorage;\n  }();\n\n  var WebStorage$1 = isSupportLocalStorage() ? WebStorage : CacheStorage;\n\n  var isMini$1 = env.isMini,\n      isAppPlus$1 = env.isAppPlus;\n  var Storage = isMini$1 || isAppPlus$1 ? storage : WebStorage$1,\n      storage$1 = new Storage();\n\n  var global$4 = env.global;\n  var TEST_KEY$1 = 'RC_TEST_KEY';\n  var TEST_VALUE$1 = 'RC_TEST_VALUE';\n\n  var isSupportSessionStorage = function isSupportSessionStorage() {\n    var isSupport = false;\n    var sessionStorage = global$4.sessionStorage;\n\n    if (sessionStorage) {\n      try {\n        sessionStorage.setItem(TEST_KEY$1, TEST_VALUE$1);\n        var testVal = sessionStorage.getItem(TEST_KEY$1);\n\n        if (testVal === TEST_VALUE$1) {\n          isSupport = true;\n        }\n\n        sessionStorage.removeItem(TEST_KEY$1);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebSession = function () {\n    function WebSession() {}\n\n    var _proto = WebSession.prototype;\n\n    _proto.set = function set(key, value) {\n      global$4.sessionStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$4.sessionStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$4.sessionStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$4.sessionStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebSession;\n  }();\n\n  var WebSession$1 = isSupportSessionStorage() ? WebSession : CacheStorage;\n\n  var isMini$2 = env.isMini,\n      isAppPlus$2 = env.isAppPlus;\n  var Session = isMini$2 || isAppPlus$2 ? CacheStorage : WebSession$1,\n      session = new Session();\n\n  var global$5 = env.global,\n      isAppPlus$3 = env.isAppPlus;\n\n  var Socket = function () {\n    function Socket(options) {\n      this.socket = void 0;\n\n      if (isAppPlus$3) {\n        options['complete'] = function () {};\n      }\n\n      this.socket = global$5.connectSocket(options);\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      this.socket.send({\n        data: data\n      });\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.onOpen(callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.onMessage(callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.onError(callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.onClose(callback);\n    };\n\n    return Socket;\n  }();\n\n  var Socket$1 = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      var url = options.url;\n      this.socket = new WebSocket(url);\n      this.socket.binaryType = 'arraybuffer';\n      return this;\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      return this.socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.addEventListener('open', callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.addEventListener('message', callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.addEventListener('error', callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.addEventListener('close', callback);\n    };\n\n    return Socket;\n  }();\n\n  var isMini$3 = env.isMini,\n      isAppPlus$4 = env.isAppPlus;\n  var Socket$2 = isMini$3 || isAppPlus$4 ? Socket : Socket$1;\n\n  /*!\n   基于 es6-promise\n   * Github: https://github.com/stefanpenner/es6-promise\n   * @overview es6-promise - a tiny implementation of Promises/A+.\n   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n   * @license   Licensed under MIT license\n   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n   * @version   v4.2.8+1e68dce6\n   */\n  var SparePromise = (function(){function a(a){var b=typeof a;return null!==a&&(\"object\"===b||\"function\"===b)}function b(a){return \"function\"==typeof a}function c(a){P=a;}function d(a){Q=a;}function e(){return function(){return process.nextTick(j)}}function f(){return \"undefined\"!=typeof O?function(){O(j);}:i()}function g(){var a=0,b=new T(j),c=document.createTextNode(\"\");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2;}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.postMessage(0)}}function i(){var a=setTimeout;return function(){return a(j,1)}}function j(){var a,b,c;for(a=0;N>a;a+=2)b=W[a],c=W[a+1],b(c),W[a]=void 0,W[a+1]=void 0;N=0;}function k(){try{var a=Function(\"return this\")().require(\"vertx\");return O=a.runOnLoop||a.runOnContext,f()}catch(b){return i()}}function l(a,b){var e,f,c=this,d=new this.constructor(n);return void 0===d[Y]&&D(d),e=c._state,e?(f=arguments[e-1],Q(function(){return A(e,d,f,c._result)})):y(c,d,a,b),d}function m(a){var c,b=this;return a&&\"object\"==typeof a&&a.constructor===b?a:(c=new b(n),u(c,a),c)}function n(){}function o(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function q(a,b,c,d){try{a.call(b,c,d);}catch(e){return e}}function r(a,b,c){Q(function(a){var d=!1,e=q(c,b,function(c){d||(d=!0,b!==c?u(a,c):w(a,c));},function(b){d||(d=!0,x(a,b));},\"Settle: \"+(a._label||\" unknown promise\"));!d&&e&&(d=!0,x(a,e));},a);}function s(a,b){b._state===$?w(a,b._result):b._state===_?x(a,b._result):y(b,void 0,function(b){return u(a,b)},function(b){return x(a,b)});}function t(a,c,d){c.constructor===a.constructor&&d===l&&c.constructor.resolve===m?s(a,c):void 0===d?w(a,c):b(d)?r(a,c,d):w(a,c);}function u(b,c){if(b===c)x(b,o());else if(a(c)){var d=void 0;try{d=c.then;}catch(e){return void x(b,e)}t(b,c,d);}else w(b,c);}function v(a){a._onerror&&a._onerror(a._result),z(a);}function w(a,b){a._state===Z&&(a._result=b,a._state=$,0!==a._subscribers.length&&Q(z,a));}function x(a,b){a._state===Z&&(a._state=_,a._result=b,Q(v,a));}function y(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+$]=c,e[f+_]=d,0===f&&a._state&&Q(z,a);}function z(a){var d,e,f,g,b=a._subscribers,c=a._state;if(0!==b.length){for(d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0;}}function A(a,c,d,e){var f=b(d),g=void 0,h=void 0,i=!0;if(f){try{g=d(e);}catch(j){i=!1,h=j;}if(c===g)return void x(c,p())}else g=e;c._state!==Z||(f&&i?u(c,g):i===!1?x(c,h):a===$?w(c,g):a===_&&x(c,g));}function B(a,b){try{b(function(b){u(a,b);},function(b){x(a,b);});}catch(c){x(a,c);}}function C(){return ab++}function D(a){a[Y]=ab++,a._state=void 0,a._result=void 0,a._subscribers=[];}function E(){return new Error(\"Array Methods must be provided an Array\")}function F(a){return new bb(this,a).promise}function G(a){var b=this;return new b(M(a)?function(c,d){for(var e=a.length,f=0;e>f;f++)b.resolve(a[f]).then(c,d);}:function(a,b){return b(new TypeError(\"You must pass an array to race.\"))})}function H(a){var b=this,c=new b(n);return x(c,a),c}function I(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function J(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function K(){var c,d,a=void 0;if(\"undefined\"!=typeof global)a=global;else if(\"undefined\"!=typeof self)a=self;else try{a=Function(\"return this\")();}catch(b){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}if(c=a.Promise){d=null;try{d=Object.prototype.toString.call(c.resolve());}catch(b){}if(\"[object Promise]\"===d&&!c.cast)return}a.Promise=cb;}var M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,L=void 0;return L=Array.isArray?Array.isArray:function(a){return \"[object Array]\"===Object.prototype.toString.call(a)},M=L,N=0,O=void 0,P=void 0,Q=function(a,b){W[N]=a,W[N+1]=b,N+=2,2===N&&(P?P(j):X());},R=\"undefined\"!=typeof window?window:void 0,S=R||{},T=S.MutationObserver||S.WebKitMutationObserver,U=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),V=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,W=new Array(1e3),X=void 0,X=U?e():T?g():V?h():void 0===R&&\"function\"==typeof require?k():i(),Y=Math.random().toString(36).substring(2),Z=void 0,$=1,_=2,ab=0,bb=function(){function a(a,b){this._instanceConstructor=a,this.promise=new a(n),this.promise[Y]||D(this.promise),M(b)?(this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(b),0===this._remaining&&w(this.promise,this._result))):x(this.promise,E());}return a.prototype._enumerate=function(a){for(var b=0;this._state===Z&&b<a.length;b++)this._eachEntry(a[b],b);},a.prototype._eachEntry=function(a,b){var e,f,g,i,c=this._instanceConstructor,d=c.resolve;if(d===m){e=void 0,f=void 0,g=!1;try{e=a.then;}catch(h){g=!0,f=h;}e===l&&a._state!==Z?this._settledAt(a._state,b,a._result):\"function\"!=typeof e?(this._remaining--,this._result[b]=a):c===cb?(i=new c(n),g?x(i,f):t(i,a,e),this._willSettleAt(i,b)):this._willSettleAt(new c(function(b){return b(a)}),b);}else this._willSettleAt(d(a),b);},a.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===Z&&(this._remaining--,a===_?x(d,c):this._result[b]=c),0===this._remaining&&w(d,this._result);},a.prototype._willSettleAt=function(a,b){var c=this;y(a,void 0,function(a){return c._settledAt($,b,a)},function(a){return c._settledAt(_,b,a)});},a}(),cb=function(){function a(b){this[Y]=C(),this._result=this._state=void 0,this._subscribers=[],n!==b&&(\"function\"!=typeof b&&I(),this instanceof a?B(this,b):J());}return a.prototype[\"catch\"]=function(a){return this.then(null,a)},a.prototype[\"finally\"]=function(a){var c=this,d=c.constructor;return b(a)?c.then(function(b){return d.resolve(a()).then(function(){return b})},function(b){return d.resolve(a()).then(function(){throw b})}):c.then(a,a)},a}(),cb.prototype.then=l,cb.all=F,cb.race=G,cb.resolve=m,cb.reject=H,cb._setScheduler=c,cb._setAsap=d,cb._asap=Q,cb.polyfill=K,cb.Promise=cb,cb})();\n\n  var global$6 = env.global;\n  var MiniRequest = (function (option) {\n    var success = option.success,\n        fail = option.fail,\n        body = option.body;\n    option.data = option.data || body;\n    var xhr;\n\n    option.success = function (result) {\n      success(result.data, result.statusCode);\n    };\n\n    option.fail = function (result) {\n      fail(result.data, result.statusCode);\n    };\n\n    xhr = global$6.request(option);\n    return xhr;\n  });\n\n  var global$7 = env.global;\n\n  var isXDomainRequest = function isXDomainRequest(xhr) {\n    return Object.prototype.toString.call(xhr) === '[object XDomainRequest]' || typeof XDomainRequest === 'object';\n  };\n\n  var isValidRequest = function isValidRequest(obj) {\n    return typeof obj === 'function' || typeof obj === 'object';\n  };\n\n  var createXHR = function createXHR() {\n    var item = {\n      XMLHttpRequest: function (_XMLHttpRequest) {\n        function XMLHttpRequest() {\n          return _XMLHttpRequest.apply(this, arguments);\n        }\n\n        XMLHttpRequest.toString = function () {\n          return _XMLHttpRequest.toString();\n        };\n\n        return XMLHttpRequest;\n      }(function () {\n        return new XMLHttpRequest();\n      }),\n      XDomainRequest: function (_XDomainRequest) {\n        function XDomainRequest() {\n          return _XDomainRequest.apply(this, arguments);\n        }\n\n        XDomainRequest.toString = function () {\n          return _XDomainRequest.toString();\n        };\n\n        return XDomainRequest;\n      }(function () {\n        return new XDomainRequest();\n      }),\n      ActiveXObject: function (_ActiveXObject) {\n        function ActiveXObject() {\n          return _ActiveXObject.apply(this, arguments);\n        }\n\n        ActiveXObject.toString = function () {\n          return _ActiveXObject.toString();\n        };\n\n        return ActiveXObject;\n      }(function () {\n        return new ActiveXObject('Microsoft.XMLHTTP');\n      })\n    };\n    var isXHR = isValidRequest(global$7.XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest();\n    var isXDR = isValidRequest(global$7.XDomainRequest);\n    var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n    return item[key]();\n  };\n\n  var request = function request(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        success = option.success,\n        fail = option.fail,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    var xhr = createXHR();\n    xhr.open(method, url);\n\n    if (headers && xhr.setRequestHeader) {\n      for (var key in headers) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n\n    if ('onload' in xhr) {\n      xhr.onload = function () {\n        success(xhr.responseText, xhr);\n      };\n\n      xhr.onerror = function () {\n        fail(xhr.responseText, xhr);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          var result = xhr.responseText,\n              status = xhr.status;\n\n          if (status === 0) {\n            fail(result, xhr, status);\n          } else {\n            success(result, xhr, status);\n          }\n        }\n      };\n    }\n\n    if (timeout) {\n      xhr.timeout = timeout;\n    }\n\n    if (isXDomainRequest(xhr) && typeof body === 'object') {\n      body = JSON$1.stringify(body);\n    }\n\n    xhr.send(body);\n    return xhr;\n  };\n\n  var request$1 = env.isMini || env.isAppPlus ? MiniRequest : request;\n\n  /*\n   * JavaScript MD5\n   * https://github.com/blueimp/JavaScript-MD5\n   *\n   * Copyright 2011, Sebastian Tschan\n   * https://blueimp.net\n   *\n   * Licensed under the MIT license:\n   * https://opensource.org/licenses/MIT\n   *\n   * Based on\n   * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n   * Digest Algorithm, as defined in RFC 1321.\n   * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n   * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n   * Distributed under the BSD License\n   * See http://pajhome.org.uk/crypt/md5 for more info.\n   */\n  var md5 = (function(){function a(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){var h,i,j,k,l,m,n,o,p;for(b[c>>5]|=128<<c%32,b[(c+64>>>9<<4)+14]=c,m=1732584193,n=-271733879,o=-1732584194,p=271733878,h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return [m,n,o,p]}function i(a){var b,c=\"\",d=32*a.length;for(b=0;d>b;b+=8)c+=String.fromCharCode(255&a[b>>5]>>>b%32);return c}function j(a){var b,d,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(d=8*a.length,b=0;d>b;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,g,d=j(a),e=[],f=[];for(e[15]=f[15]=void 0,d.length>16&&(d=h(d,8*a.length)),c=0;16>c;c+=1)e[c]=909522486^d[c],f[c]=1549556828^d[c];return g=h(e.concat(j(b)),512+8*b.length),i(h(f.concat(g),640))}function m(a){var d,e,b=\"0123456789abcdef\",c=\"\";for(e=0;e<a.length;e+=1)d=a.charCodeAt(e),c+=b.charAt(15&d>>>4)+b.charAt(15&d);return c}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s})();\n\n  var global$8 = env.global;\n  var Promise$1 = global$8.Promise;\n\n  var isSupportPromise = function isSupportPromise() {\n    if (!global$8.Promise) return false;\n\n    var defer = function () {\n      return global$8.Promise.resolve();\n    }();\n\n    return defer.then && defer[\"catch\"] && defer[\"finally\"];\n  };\n\n  var setTimeout$1 = function setTimeout(event, timeout) {\n    return global$8.setTimeout(event, timeout);\n  };\n\n  var clearTimeout$1 = function clearTimeout(id) {\n    return global$8.clearTimeout(id);\n  };\n\n  var setInterval$1 = function setInterval(event, timeout) {\n    return global$8.setInterval(event, timeout);\n  };\n\n  var clearInterval$1 = function clearInterval(id) {\n    return global$8.clearInterval(id);\n  };\n\n  var Defer = isSupportPromise() ? global$8.Promise : SparePromise;\n\n  var noop = function noop(data) {\n    return data;\n  };\n\n  var deferNoop = function deferNoop(data) {\n    return Promise$1.resolve(data);\n  };\n\n  var JSON$2 = global$8.JSON || JSON$1;\n\n  var allowError = function allowError(event) {\n    var result;\n\n    try {\n      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n\n      result = event.apply(void 0, args);\n    } catch (e) {\n      result = null;\n    }\n\n    return result;\n  };\n\n  var toJSON = function toJSON(val) {\n    return allowError(JSON$2.stringify, val);\n  };\n\n  var parseJSON = function parseJSON(val) {\n    return allowError(JSON$2.parse, val);\n  };\n\n  var copy = function copy(val) {\n    return parseJSON(toJSON(val));\n  };\n\n  var isObject = function isObject(val) {\n    return Object.prototype.toString.call(val) === '[object Object]';\n  };\n\n  var isArray = function isArray(val) {\n    return Object.prototype.toString.call(val).indexOf('Array') !== -1;\n  };\n\n  var isFunction = function isFunction(val) {\n    return Object.prototype.toString.call(val) === '[object Function]';\n  };\n\n  var isString = function isString(val) {\n    return Object.prototype.toString.call(val) === '[object String]';\n  };\n\n  var isBoolean = function isBoolean(val) {\n    return Object.prototype.toString.call(val) === '[object Boolean]';\n  };\n\n  var isUndefined = function isUndefined(val) {\n    return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  };\n\n  var isNull = function isNull(val) {\n    return Object.prototype.toString.call(val) === '[object Null]';\n  };\n\n  var isNumber = function isNumber(val) {\n    return Object.prototype.toString.call(val) === '[object Number]';\n  };\n\n  var isArrayBuffer = function isArrayBuffer(val) {\n    return Object.prototype.toString.call(val) === '[object ArrayBuffer]';\n  };\n\n  var isPromise = function isPromise(val) {\n    var isTrue = false;\n\n    try {\n      isTrue = Object.prototype.toString.call(val) === '[object Promise]' || val && val.then && val[\"catch\"] && val[\"finally\"];\n    } catch (e) {\n      isTrue = false;\n    }\n\n    return isTrue;\n  };\n\n  var getTypeName = function getTypeName(data) {\n    var typeName = Object.prototype.toString.call(data);\n    return typeName.substring(8, typeName.length - 1);\n  };\n\n  var isEqual = function isEqual(source, target) {\n    return source === target;\n  };\n\n  var ArrayBufferToArray = function ArrayBufferToArray(data) {\n    if (isArrayBuffer(data)) {\n      return [].slice.call(new Int8Array(data));\n    }\n\n    return data;\n  };\n\n  var ArrayBufferToUint8Array = function ArrayBufferToUint8Array(data) {\n    if (isArrayBuffer(data)) {\n      return new Uint8Array(data);\n    }\n\n    return data;\n  };\n\n  var forEach = function forEach(source, event, options) {\n    options = options || {};\n    event = event || noop;\n    var _options = options,\n        isReverse = _options.isReverse;\n\n    var loopObj = function loopObj() {\n      for (var key in source) {\n        event(source[key], key, source);\n      }\n    };\n\n    var loopArr = function loopArr() {\n      if (isReverse) {\n        for (var i = source.length - 1; i >= 0; i--) {\n          event(source[i], i);\n        }\n      } else {\n        for (var j = 0, len = source.length; j < len; j++) {\n          event(source[j], j);\n        }\n      }\n    };\n\n    if (isObject(source)) {\n      loopObj();\n    }\n\n    if (isArray(source) || isString(source)) {\n      loopArr();\n    }\n  };\n\n  var isFalse = function isFalse(val) {\n    return val === false;\n  };\n\n  var isEmpty = function isEmpty(val) {\n    var result = true;\n\n    if (isObject(val)) {\n      forEach(val, function () {\n        result = false;\n      });\n    }\n\n    if (isString(val) || isArray(val)) {\n      result = val.length === 0;\n    }\n\n    if (isNumber(val)) {\n      result = val === 0;\n    }\n\n    return result;\n  };\n\n  var isNumberData = function isNumberData(val) {\n    var isEmptyVal = isEmpty(val);\n    val = Number(val);\n    return isNumber(val) && !isEmptyVal;\n  };\n\n  var getKeys = function getKeys(obj) {\n    var keyList = [];\n    forEach(obj, function (val, key) {\n      keyList.push(key);\n    });\n    return keyList;\n  };\n\n  var getValues = function getValues(obj) {\n    var valList = [];\n    forEach(obj, function (val) {\n      valList.push(val);\n    });\n    return valList;\n  };\n\n  var getTimestamp = function getTimestamp(time) {\n    return new Date(time).getTime();\n  };\n\n  var getCurrentTimestamp = function getCurrentTimestamp() {\n    return new Date().getTime();\n  };\n\n  var formatTime = function formatTime(timestamp, options) {\n    timestamp = timestamp || getCurrentTimestamp();\n    options = options || {};\n    var temp = options.temp;\n    var date = new Date(timestamp),\n        formateds = {};\n    formateds['YY'] = date.getFullYear();\n    formateds['MM'] = date.getMonth() + 1;\n    formateds['DD'] = date.getDate();\n    formateds['hh'] = date.getHours();\n    formateds['mm'] = date.getMinutes();\n    formateds['ss'] = date.getSeconds();\n    forEach(formateds, function (val, key) {\n      formateds[key] = val >= 10 ? val : '0' + val;\n    });\n\n    if (temp) {\n      var formatedText = temp;\n      forEach(formateds, function (val, key) {\n        formatedText = formatedText.replace(key, val);\n      });\n      return formatedText;\n    }\n\n    return formateds.YY + '-' + formateds.MM + '-' + formateds.DD + ' ' + formateds.hh + ':' + formateds.mm + ':' + formateds.ss;\n  };\n\n  var isValidJSON = function isValidJSON(jsonStr) {\n    if (isObject(jsonStr)) {\n      return true;\n    }\n\n    var isValid = false;\n\n    try {\n      var obj = JSON$2.parse(jsonStr);\n      var str = JSON$2.stringify(obj);\n      isValid = str === jsonStr;\n    } catch (e) {\n      isValid = false;\n    }\n\n    return isValid;\n  };\n\n  var isSupportSocket = function isSupportSocket() {\n    var isMini = env.isMini;\n    var isAppPlus = env.isAppPlus;\n\n    if (isMini || isAppPlus) {\n      return true;\n    }\n\n    var Socket = global$8.WebSocket;\n\n    if (isUndefined(Socket)) {\n      return false;\n    }\n\n    var hasWS = false,\n        isIntegrity = false;\n\n    try {\n      hasWS = typeof Socket === 'object' || typeof Socket === 'function';\n      isIntegrity = typeof Socket.OPEN === 'number';\n    } catch (e) {}\n\n    return hasWS && isIntegrity;\n  };\n\n  var indexOf = function indexOf(source, searchVal) {\n    if (source.indexOf) {\n      return source.indexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    });\n    return index;\n  };\n\n  var lastIndexOf = function lastIndexOf(source, searchVal) {\n    if (source.lastIndexOf) {\n      return source.lastIndexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    }, {\n      isReverse: true\n    });\n    return index;\n  };\n\n  var isInclude = function isInclude(source, searchVal) {\n    if (isObject(source)) {\n      var arr = [];\n      forEach(source, function (val) {\n        arr.push(val);\n      });\n      source = arr;\n    }\n\n    var index = indexOf(source, searchVal);\n    return index !== -1;\n  };\n\n  var substring = function substring(source, start, end) {\n    return source.substring(start, end);\n  };\n\n  var spliceByChild = function spliceByChild(arr, item) {\n    forEach(arr, function (child, index) {\n      if (isEqual(child, item)) {\n        arr.splice(index, 1);\n      }\n    }, {\n      isReverse: true\n    });\n  };\n\n  var parse16To10 = function parse16To10(num) {\n    return parseInt(num, 16);\n  };\n\n  var isPlus = function isPlus(num) {\n    return +num === num;\n  };\n\n  var filter = function filter(source, event) {\n    var newArr = [];\n\n    for (var i = 0, max = source.length; i < max; i++) {\n      var data = source[i];\n\n      if (event(data, i)) {\n        newArr.push(data);\n      }\n    }\n\n    return newArr;\n  };\n\n  var map = function map(source, event) {\n    forEach(source, function (item, index) {\n      source[index] = event(item, index);\n    });\n    return source;\n  };\n\n  var extend = function extend(destination, sources, option) {\n    option = option || {};\n    var _option2 = option,\n        isAllowNull = _option2.isAllowNull;\n    destination = destination || {};\n    sources = sources || {};\n\n    for (var key in sources) {\n      var value = sources[key];\n\n      if (!isUndefined(value) || isAllowNull) {\n        destination[key] = value;\n      }\n    }\n\n    return destination;\n  };\n\n  var extendAllowNull = function extendAllowNull(destination, sources) {\n    return extend(destination, sources, {\n      isAllowNull: true\n    });\n  };\n\n  var extendInShallow = function extendInShallow(destination, sources) {\n    destination = destination || {};\n    sources = sources || {};\n    destination = copy(destination);\n    sources = copy(sources);\n    return extend(destination, sources);\n  };\n\n  var deferred = function deferred(callbacks) {\n    return new Defer(callbacks);\n  };\n\n  var deferTimeout = function deferTimeout(timeout) {\n    return deferred(function (resolve) {\n      var timeouter = setTimeout$1(function () {\n        resolve(timeouter);\n      }, timeout);\n    });\n  };\n\n  var tplEngine = function tplEngine(temp, data, regexp) {\n    var replaceAction = function replaceAction(obj) {\n      return temp.replace(regexp || /{([^}]+)}/g, function (match, name) {\n        if (match.charAt(0) === '\\\\') {\n          return match.slice(1);\n        }\n\n        return obj[name] !== undefined ? obj[name] : '{' + name + '}';\n      });\n    };\n\n    if (!isArray(data)) {\n      data = [data];\n    }\n\n    var ret = [];\n    forEach(data, function (item) {\n      ret.push(replaceAction(item));\n    });\n    return ret.join('');\n  };\n\n  var getRandomNum = function getRandomNum(max, min) {\n    min = min || 0;\n    var range = max - min,\n        random = Math.random();\n    return min + Math.round(random * range);\n  };\n\n  var Timer = function () {\n    function Timer(options) {\n      this._timerId = void 0;\n      this._timerEvent = void 0;\n      this._timerClearEvent = void 0;\n      this.timeout = 0;\n      this.type = TIMER_TYPE.TIMEOUT;\n      this.status = TIMER_STATUS.PENNDING;\n      var self = this;\n      extend(self, options);\n      var type = self.type;\n      var isTimeout = type === TIMER_TYPE.TIMEOUT;\n\n      if (isTimeout) {\n        self._timerEvent = setTimeout$1;\n        self._timerClearEvent = clearTimeout$1;\n      } else {\n        self._timerEvent = setInterval$1;\n        self._timerClearEvent = clearInterval$1;\n      }\n\n      return self;\n    }\n\n    var _proto = Timer.prototype;\n\n    _proto.start = function start(event, options) {\n      options = options || {};\n      var self = this,\n          isTimeout = self.type === TIMER_TYPE.TIMEOUT;\n      var _options2 = options,\n          args = _options2.args,\n          thisArg = _options2.thisArg;\n      self.stop();\n      self._timerId = self._timerEvent.call(global$8, function () {\n        isTimeout && self.stop();\n\n        if (thisArg) {\n          event.apply(thisArg, args);\n        } else {\n          event(args);\n        }\n      }, self.timeout);\n      self.status = TIMER_STATUS.BUSY;\n    };\n\n    _proto.stop = function stop() {\n      var self = this;\n\n      if (self._timerId) {\n        self._timerClearEvent.call(global$8, self._timerId);\n\n        self.status = TIMER_STATUS.ENDING;\n      }\n    };\n\n    return Timer;\n  }();\n\n  var DeferHandler = function () {\n    function DeferHandler(options) {\n      this._list = {};\n      this.timeout = IM_TIMEOUT;\n      extend(this, options);\n    }\n\n    var _proto2 = DeferHandler.prototype;\n\n    _proto2._isInvalid = function _isInvalid(id) {\n      var handlers = this._list[id];\n      return !isArray(handlers) || isEmpty(handlers);\n    };\n\n    _proto2._exec = function _exec(id, isError, data) {\n      var self = this;\n\n      if (self._isInvalid(id)) {\n        return;\n      }\n\n      var handlers = self._list[id],\n          handler = handlers[0];\n      isError ? handler.reject(data) : handler.resolve(data);\n      handlers.splice(0, 1);\n    };\n\n    _proto2.add = function add(id, defer, options) {\n      options = options || {};\n      var self = this;\n      var resolve = defer.resolve,\n          reject = defer.reject;\n      var timeout = options.timeout || self.timeout;\n\n      if (self._isInvalid(id)) {\n        self._list[id] = [];\n      }\n\n      var timer = new Timer({\n        timeout: timeout\n      });\n      timer.start(function () {\n        self.reject(id, ERROR_INFO.TIMEOUT.code);\n      });\n\n      self._list[id].push({\n        resolve: resolve,\n        reject: reject,\n        timer: timer\n      });\n    };\n\n    _proto2.resolve = function resolve(id, data) {\n      this._exec(id, false, data);\n    };\n\n    _proto2.reject = function reject(id, error) {\n      this._exec(id, true, error);\n    };\n\n    return DeferHandler;\n  }();\n\n  var EventEmitter = function () {\n    function EventEmitter() {\n      this._events = void 0;\n      this._events = {};\n    }\n\n    var _proto3 = EventEmitter.prototype;\n\n    _proto3.on = function on(name, event) {\n      var _events = this._events[name] || [];\n\n      _events.push(event);\n\n      this._events[name] = _events;\n    };\n\n    _proto3.off = function off(name, offEvent) {\n      if (offEvent) {\n        var _events = this._events[name] || [];\n\n        spliceByChild(_events, offEvent);\n      } else {\n        delete this._events[name];\n      }\n    };\n\n    _proto3.emit = function emit(name, data, error) {\n      var _events = this._events[name];\n      forEach(_events, function (event) {\n        isFunction(event) && event(data, error);\n      });\n    };\n\n    _proto3.clear = function clear() {\n      this._events = {};\n    };\n\n    return EventEmitter;\n  }();\n\n  var decodeURI = function decodeURI(uri) {\n    return global$8.decodeURIComponent(uri);\n  };\n\n  var encodeURI = function encodeURI(uri) {\n    return global$8.encodeURIComponent(uri);\n  };\n\n  var int64ToTimestamp = function int64ToTimestamp(obj) {\n    if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n      return obj;\n    }\n\n    var low = obj.low;\n\n    if (low < 0) {\n      low += 0xffffffff + 1;\n    }\n\n    low = low.toString(16);\n    var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n    return timestamp;\n  };\n\n  var batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n    forEach(data, function (item, key) {\n      if (isObject(item)) {\n        data[key] = int64ToTimestamp(item);\n      }\n    });\n    return data;\n  };\n\n  var Queue = function () {\n    function Queue(defaultConfig) {\n      this._isRunning = false;\n      this._list = [];\n      this._defaultConfig = void 0;\n      this._defaultConfig = defaultConfig;\n    }\n\n    var _proto4 = Queue.prototype;\n\n    _proto4.add = function add(params) {\n      params = params || this._defaultConfig;\n\n      this._list.push(params);\n\n      this.run();\n    };\n\n    _proto4.run = function run() {\n      var self = this;\n      var _isRunning = self._isRunning,\n          _list = self._list;\n      var isFinished = isEmpty(_list);\n\n      if (_isRunning || isFinished) {\n        return;\n      }\n\n      var firstItem = _list.splice(0, 1)[0];\n\n      var event = firstItem.event,\n          args = firstItem.args,\n          thisArg = firstItem.thisArg;\n\n      var next = function next() {\n        self._isRunning = false;\n        self.run();\n      };\n\n      if (!event) {\n        return next();\n      }\n\n      self._isRunning = true;\n      event.apply(thisArg, args).then(next)[\"catch\"](next);\n    };\n\n    return Queue;\n  }();\n\n  var secondsToMilliseconds = function secondsToMilliseconds(seconds) {\n    return seconds * 1000;\n  };\n\n  var request$2 = function request(url, options) {\n    options = options || {};\n    return deferred(function (resolve, reject) {\n      options = extend(options, {\n        url: url,\n        success: function success(responseText, xhr, status) {\n          resolve({\n            responseText: responseText,\n            xhr: xhr,\n            status: status\n          });\n        },\n        fail: function fail(result, xhr, status) {\n          reject({\n            result: result,\n            xhr: xhr,\n            status: status\n          });\n        }\n      });\n      request$1(options);\n    });\n  };\n\n  var requestByUrlList = function requestByUrlList(urlList, options) {\n    if (isEmpty(urlList)) {\n      return Defer.reject();\n    }\n\n    var url = urlList[0];\n    var fixedNaviResp = {\n      'responseText': '{\"isFixedNaviResp\":true}'\n    };\n    return request$2(url, options).then(function (result) {\n      result = result || {};\n      result.urlList = urlList;\n      return result;\n    })[\"catch\"](function () {\n      urlList.splice(0, 1);\n\n      if (isEmpty(urlList)) {\n        return fixedNaviResp;\n      } else {\n        return requestByUrlList(urlList, options);\n      }\n    });\n  };\n\n  var requestForFaster = function requestForFaster(urlList, option) {\n    option = option || {};\n    var timeInterval = option.timeInterval || 0;\n    var faildCount = 0,\n        totalCount = urlList.length;\n    var requestXhrs = [];\n    var totalTimer = new Timer({\n      timeout: 15 * 1000\n    });\n    var reqCountdownTimers = [];\n\n    var clearAll = function clearAll() {\n      forEach(reqCountdownTimers, function (timer) {\n        timer.stop();\n      });\n      forEach(requestXhrs, function (xhr) {\n        xhr.abort();\n      });\n      reqCountdownTimers.length = 0;\n      requestXhrs.length = 0;\n    };\n\n    var isAllFaild = function isAllFaild() {\n      return faildCount === totalCount;\n    };\n\n    return deferred(function (resolve, reject) {\n      var _success = function success(url, index) {\n        clearAll();\n        resolve({\n          url: url,\n          index: index\n        });\n      };\n\n      var _fail = function fail() {\n        clearAll();\n        reject();\n      };\n\n      forEach(urlList, function (url, index) {\n        var timer = new Timer({\n          timeout: timeInterval * index\n        });\n        timer.start(function () {\n          var xhr;\n          var opt = extend({\n            url: url,\n            success: function success() {\n              _success(url, index);\n            },\n            fail: function fail() {\n              faildCount++;\n              isAllFaild() && _fail();\n            }\n          }, option);\n          xhr = request$1(opt);\n          requestXhrs.push(xhr);\n        });\n        reqCountdownTimers.push(timer);\n      });\n      totalTimer.start(_fail);\n    });\n  };\n\n  var NetworkDetecter = function () {\n    function NetworkDetecter(option) {\n      this._option = void 0;\n      this._detectCount = 0;\n      this._timeoutId = void 0;\n      this._option = option;\n    }\n\n    var _proto5 = NetworkDetecter.prototype;\n\n    _proto5._detect = function _detect() {\n      var self = this;\n      var _detectCount = self._detectCount,\n          _option = self._option;\n      var url = _option.url,\n          timeout = _option.intervalTime,\n          max = _option.max;\n      _detectCount++;\n      return request$2(url).then(function () {\n        return;\n      }, function (_ref) {\n        var status = _ref.status;\n\n        if (isEqual(status, 404)) {\n          return;\n        }\n\n        var isAlreadyMax = max && isEqual(max, _detectCount);\n\n        if (isAlreadyMax) {\n          return Defer.reject();\n        }\n\n        return deferTimeout(timeout).then(function (timeoutId) {\n          self._detectCount = _detectCount;\n          self._timeoutId = timeoutId;\n          return self._detect();\n        });\n      });\n    };\n\n    _proto5.start = function start() {\n      return this._detect();\n    };\n\n    _proto5.stop = function stop() {\n      var timeoutId = this._timeoutId;\n\n      if (timeoutId) {\n        clearTimeout$1(timeoutId);\n      }\n    };\n\n    return NetworkDetecter;\n  }();\n\n  var toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n    if (isUndefined(startIndex) || isUndefined(endIndex)) {\n      return str.toUpperCase();\n    }\n\n    var sliceStr = str.slice(startIndex, endIndex);\n    str = str.replace(sliceStr, function (text) {\n      return text.toUpperCase();\n    });\n    return str;\n  };\n\n  var getDomainByUrl = function getDomainByUrl(url) {\n    var StartMark = '://',\n        EndMark = '/';\n    var urlProtocolIndex = indexOf(url, StartMark);\n    var hasProtocol = urlProtocolIndex > -1;\n\n    if (hasProtocol) {\n      urlProtocolIndex = urlProtocolIndex + StartMark.length;\n      url = substring(url, urlProtocolIndex, url.length);\n    }\n\n    var urlPathIndex = indexOf(url, EndMark);\n    var hasPath = urlPathIndex > -1;\n\n    if (hasPath) {\n      url = substring(url, 0, urlPathIndex);\n    }\n\n    return url;\n  };\n\n  var getValidUrl = function getValidUrl(url, option) {\n    option = option || {};\n    var ProtocolMark = '://';\n    var hasProtocol = isInclude(url, ProtocolMark);\n    var localProtocol = env.protocol.http;\n    var _option3 = option,\n        protocol = _option3.protocol;\n\n    if (protocol) {\n      var domain = getDomainByUrl(url);\n      url = protocol + \"//\" + domain;\n    }\n\n    if (hasProtocol) {\n      var urlProtocolIndex = indexOf(url, ProtocolMark) + 1;\n      var urlProtocol = substring(url, 0, urlProtocolIndex);\n      var isHttpUrl = urlProtocol === HTTP_PROTOCOL.HTTP;\n      var isLocalHttps = localProtocol === HTTP_PROTOCOL.HTTPS;\n\n      if (isHttpUrl && isLocalHttps) {\n        var _domain = getDomainByUrl(url);\n\n        return HTTP_PROTOCOL.HTTPS + \"//\" + _domain;\n      } else {\n        return url;\n      }\n    } else {\n      return localProtocol + \"//\" + url;\n    }\n  };\n\n  var quickSort = function quickSort(arr, event) {\n    var sort = function sort(array, left, right, event) {\n      event = event || function (a, b) {\n        return a <= b;\n      };\n\n      if (left < right) {\n        var x = array[right],\n            i = left - 1,\n            temp;\n\n        for (var j = left; j <= right; j++) {\n          if (event(array[j], x)) {\n            i++;\n            temp = array[i];\n            array[i] = array[j];\n            array[j] = temp;\n          }\n        }\n\n        sort(array, left, i - 1, event);\n        sort(array, i + 1, right, event);\n      }\n\n      return array;\n    };\n\n    return sort(arr, 0, arr.length - 1, event);\n  };\n\n  var unique = function unique(arr, event) {\n    var keyEvent = event || function (data) {\n      return data;\n    };\n\n    var hashTable = {};\n    var newArr = [];\n    forEach(arr, function (data) {\n      var key = keyEvent(data);\n\n      if (!hashTable[key]) {\n        hashTable[key] = true;\n        newArr.push(data);\n      }\n    });\n    return newArr;\n  };\n\n  var isStackError = function isStackError(error) {\n    error = error || {};\n    return error.stack && error.stack.toString;\n  };\n\n  var consoleError = function consoleError() {\n    var _console;\n\n    return (_console = console).error.apply(_console, arguments);\n  };\n\n  var consoleLog = function consoleLog() {\n    var _console2;\n\n    return (_console2 = console).log.apply(_console2, arguments);\n  };\n\n  var string10to64 = function string10to64(number) {\n    var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''),\n        radix = chars.length + 1,\n        qutient = +number,\n        arr = [];\n\n    do {\n      var mod = qutient % radix;\n      qutient = (qutient - mod) / radix;\n      arr.unshift(chars[mod]);\n    } while (qutient);\n\n    return arr.join('');\n  };\n\n  var getUUID = function getUUID() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      var r = Math.random() * 16 | 0,\n          v = c === 'x' ? r : r & 0x3 | 0x8;\n      return v.toString(16);\n    });\n  };\n\n  var getUUID22 = function getUUID22() {\n    var uuid = getUUID();\n    uuid = uuid.replace(/-/g, '') + 'a';\n    uuid = parseInt(uuid, 16);\n    uuid = string10to64(uuid);\n\n    if (uuid.length > 22) {\n      uuid = uuid.slice(0, 22);\n    } else {\n      var len = 22 - uuid.length;\n\n      for (var i = 0; i < len; i++) {\n        uuid = uuid + '0';\n      }\n    }\n\n    return uuid;\n  };\n\n  var isValidTimestamp = function isValidTimestamp(time) {\n    return isNumber(time) && time !== 0;\n  };\n\n  var formateDate = function formateDate(seperator) {\n    var date = new Date();\n    var year = date.getFullYear();\n    var month = date.getMonth() + 1;\n    var day = date.getDate();\n    return tplEngine('{year}{seperator}{month}{seperator}{day}', {\n      year: year,\n      month: month,\n      day: day,\n      seperator: seperator\n    });\n  };\n\n  var utils = {\n    Storage: storage$1,\n    Session: session,\n    Socket: Socket$2,\n    Cache: CacheStorage,\n    JSON: JSON$2,\n    Defer: Defer,\n    httpRequest: request$1,\n    request: request$2,\n    requestByUrlList: requestByUrlList,\n    requestForFaster: requestForFaster,\n    md5: md5,\n    DeferHandler: DeferHandler,\n    EventEmitter: EventEmitter,\n    Timer: Timer,\n    Queue: Queue,\n    consoleError: consoleError,\n    consoleLog: consoleLog,\n    noop: noop,\n    deferNoop: deferNoop,\n    setTimeout: setTimeout$1,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    isObject: isObject,\n    isArray: isArray,\n    isFunction: isFunction,\n    isArrayBuffer: isArrayBuffer,\n    isString: isString,\n    isBoolean: isBoolean,\n    isUndefined: isUndefined,\n    isNull: isNull,\n    isNumber: isNumber,\n    isNumberData: isNumberData,\n    isPromise: isPromise,\n    getTypeName: getTypeName,\n    isPlus: isPlus,\n    isEmpty: isEmpty,\n    isFalse: isFalse,\n    isEqual: isEqual,\n    isValidJSON: isValidJSON,\n    isSupportSocket: isSupportSocket,\n    ArrayBufferToArray: ArrayBufferToArray,\n    ArrayBufferToUint8Array: ArrayBufferToUint8Array,\n    indexOf: indexOf,\n    lastIndexOf: lastIndexOf,\n    isInclude: isInclude,\n    substring: substring,\n    getKeys: getKeys,\n    getValues: getValues,\n    getTimestamp: getTimestamp,\n    getCurrentTimestamp: getCurrentTimestamp,\n    formatTime: formatTime,\n    parse16To10: parse16To10,\n    forEach: forEach,\n    map: map,\n    filter: filter,\n    extend: extend,\n    extendAllowNull: extendAllowNull,\n    extendInShallow: extendInShallow,\n    deferred: deferred,\n    tplEngine: tplEngine,\n    getRandomNum: getRandomNum,\n    int64ToTimestamp: int64ToTimestamp,\n    batchInt64ToTimestamp: batchInt64ToTimestamp,\n    encodeURI: encodeURI,\n    decodeURI: decodeURI,\n    secondsToMilliseconds: secondsToMilliseconds,\n    NetworkDetecter: NetworkDetecter,\n    toUpperCase: toUpperCase,\n    getDomainByUrl: getDomainByUrl,\n    getValidUrl: getValidUrl,\n    quickSort: quickSort,\n    unique: unique,\n    isStackError: isStackError,\n    getUUID: getUUID,\n    getUUID22: getUUID22,\n    isValidTimestamp: isValidTimestamp,\n    formateDate: formateDate\n  };\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__proto__ = superClass;\n  }\n\n  var _PUBLISH_TOPIC_TO_CON, _CONVERSATION_TYPE_TO, _CONVERSATION_TYPE_TO2, _CONVERSATION_TYPE_TO3, _CONVERSATION_TYPE_TO4;\n  var SUCCESS_CODE = 0;\n  var PULL_MSG_TYPE = {\n    NORMAL: 1,\n    CHATROOM: 2\n  };\n  var MESSAGE_NAME = {\n    CONN_ACK: 'ConnAckMessage',\n    DISCONNECT: 'DisconnectMessage',\n    PING_REQ: 'PingReqMessage',\n    PING_RESP: 'PingRespMessage',\n    PUBLISH: 'PublishMessage',\n    PUB_ACK: 'PubAckMessage',\n    QUERY: 'QueryMessage',\n    QUERY_CON: 'QueryConMessage',\n    QUERY_ACK: 'QueryAckMessage'\n  };\n  var QOS = {\n    AT_MOST_ONCE: 0,\n    AT_LEAST_ONCE: 1,\n    EXACTLY_ONCE: 2,\n    DEFAULT: 3,\n    '0': 'AT_MOST_ONCE',\n    '1': 'AT_LEAST_ONCE',\n    '2': 'EXACTLY_ONCE',\n    '3': 'DEFAULT'\n  };\n  var OPERATE_TYPE = {\n    CONNECT: 1,\n    '1': 'CONNECT',\n    CONNACK: 2,\n    '2': 'CONNACK',\n    PUBLISH: 3,\n    '3': 'PUBLISH',\n    PUBACK: 4,\n    '4': 'PUBACK',\n    QUERY: 5,\n    '5': 'QUERY',\n    QUERYACK: 6,\n    '6': 'QUERYACK',\n    QUERYCON: 7,\n    '7': 'QUERYCON',\n    SUBSCRIBE: 8,\n    '8': 'SUBSCRIBE',\n    SUBACK: 9,\n    '9': 'SUBACK',\n    UNSUBSCRIBE: 10,\n    '10': 'UNSUBSCRIBE',\n    UNSUBACK: 11,\n    '11': 'UNSUBACK',\n    PINGREQ: 12,\n    '12': 'PINGREQ',\n    PINGRESP: 13,\n    '13': 'PINGRESP',\n    DISCONNECT: 14,\n    '14': 'DISCONNECT'\n  };\n  var MESSAGE_TAG = {\n    NONE: 0,\n    PERSIT_ONLY: 1,\n    COUNT_ONLY: 2,\n    PERSIT_AND_COUNT: 3\n  };\n  var PUBLISH_TOPIC = {\n    PRIVATE: 'ppMsgP',\n    GROUP: 'pgMsgP',\n    CHATROOM: 'chatMsg',\n    CUSTOMER_SERVICE: 'pcMsgP',\n    RECALL: 'recallMsg',\n    NOTIFY_PULL_MSG: 's_ntf',\n    RECEIVE_MSG: 's_msg',\n    SYNC_STATUS: 's_stat',\n    SERVER_NOTIFY: 's_cmd',\n    SETTING_NOTIFY: 's_us'\n  };\n  var PUBLISH_STATUS_TOPIC = {\n    PRIVATE: 'ppMsgS',\n    GROUP: 'pgMsgS',\n    CHATROOM: 'chatMsgS'\n  };\n  var QUERY_TOPIC = {\n    GET_SYNC_TIME: 'qrySessionsAtt',\n    PULL_MSG: 'pullMsg',\n    GET_CONVERSATION_LIST: 'qrySessions',\n    REMOVE_CONVERSATION_LIST: 'delSessions',\n    DELETE_MESSAGES: 'delMsg',\n    CLEAR_UNREAD_COUNT: 'updRRTime',\n    PULL_USER_SETTING: 'pullUS',\n    PULL_CHRM_MSG: 'chrmPull',\n    JOIN_CHATROOM: 'joinChrm',\n    JOIN_EXIST_CHATROOM: 'joinChrmR',\n    QUIT_CHATROOM: 'exitChrm',\n    GET_CHATROOM_INFO: 'queryChrmI',\n    UPDATE_CHATROOM_KV: 'setKV',\n    DELETE_CHATROOM_KV: 'delKV',\n    PULL_CHATROOM_KV: 'pullKV',\n    GET_OLD_CONVERSATION_LIST: 'qryRelation',\n    REMOVE_OLD_CONVERSATION: 'delRelation',\n    GET_CONVERSATION_STATUS: 'pullSeAtts',\n    SET_CONVERSATION_STATUS: 'setSeAtt',\n    GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n    GET_UPLOAD_FILE_URL: 'qnUrl',\n    CLEAR_MESSAGES: {\n      PRIVATE: 'cleanPMsg',\n      GROUP: 'cleanGMsg',\n      CUSTOMER_SERVICE: 'cleanCMsg',\n      SYSTEM: 'cleanSMsg'\n    },\n    JOIN_RTC_ROOM: 'rtcRJoin_data',\n    QUIT_RTC_ROOM: 'rtcRExit',\n    PING_RTC: 'rtcPing',\n    SET_RTC_DATA: 'rtcSetData',\n    USER_SET_RTC_DATA: 'userSetData',\n    GET_RTC_DATA: 'rtcQryData',\n    DEL_RTC_DATA: 'rtcDelData',\n    SET_RTC_OUT_DATA: 'rtcSetOutData',\n    GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n    GET_RTC_TOKEN: 'rtcToken',\n    SET_RTC_STATE: 'rtcUserState',\n    GET_RTC_ROOM_INFO: 'rtcRInfo',\n    GET_RTC_USER_INFO_LIST: 'rtcUData',\n    SET_RTC_USER_INFO: 'rtcUPut',\n    DEL_RTC_USER_INFO: 'rtcUDel',\n    GET_RTC_USER_LIST: 'rtcUList'\n  };\n  var QUERY_HISTORY_TOPIC = {\n    PRIVATE: 'qryPMsg',\n    GROUP: 'qryGMsg',\n    CHATROOM: 'qryCHMsg',\n    CUSTOMER_SERVICE: 'qryCMsg',\n    SYSTEM: 'qrySMsg'\n  };\n  var SERVER_NOTIFY_TYPE = {\n    KV_CHANGED: 2,\n    CONVERSATION_STATUS_CHANGED: 3\n  };\n  var CHATROOM_KV_STATUS_CODE = {\n    AUTO_DELETE: 0x0001,\n    OVERWRITE: 0x0002,\n    OPERATE: 0x0004\n  };\n  var PUBLISH_TOPIC_TO_CONVERSATION_TYPE = (_PUBLISH_TOPIC_TO_CON = {}, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CUSTOMER_SERVICE] = CONVERSATION_TYPE.CUSTOMER_SERVICE, _PUBLISH_TOPIC_TO_CON[PUBLISH_STATUS_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_STATUS_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_STATUS_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON);\n  var CONVERSATION_TYPE_TO_PUBLISH_TOPIC = (_CONVERSATION_TYPE_TO = {}, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.PRIVATE] = PUBLISH_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.GROUP] = PUBLISH_TOPIC.GROUP, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CHATROOM] = PUBLISH_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CUSTOMER_SERVICE] = PUBLISH_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO);\n  var CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC = (_CONVERSATION_TYPE_TO2 = {}, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.PRIVATE] = PUBLISH_STATUS_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.GROUP] = PUBLISH_STATUS_TOPIC.GROUP, _CONVERSATION_TYPE_TO2);\n  var CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC = (_CONVERSATION_TYPE_TO3 = {}, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.PRIVATE] = QUERY_HISTORY_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.GROUP] = QUERY_HISTORY_TOPIC.GROUP, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CHATROOM] = QUERY_HISTORY_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_HISTORY_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.SYSTEM] = QUERY_HISTORY_TOPIC.SYSTEM, _CONVERSATION_TYPE_TO3);\n  var CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC = (_CONVERSATION_TYPE_TO4 = {}, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.PRIVATE] = QUERY_TOPIC.CLEAR_MESSAGES.PRIVATE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.GROUP] = QUERY_TOPIC.CLEAR_MESSAGES.GROUP, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_TOPIC.CLEAR_MESSAGES.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.SYSTEM] = QUERY_TOPIC.CLEAR_MESSAGES.SYSTEM, _CONVERSATION_TYPE_TO4);\n  var USER_SETTING_STATUS = {\n    ADD: 1,\n    UPDATE: 2,\n    DELETE: 3\n  };\n  var CONVERSATION_STATUS_CONFIG = {\n    ENABLED: '1',\n    DISABLED: '0'\n  };\n  var CONVERSATION_STATUS_TYPE = {\n    DO_NOT_DISTURB: 1,\n    TOP: 2\n  };\n\n  var Header = function () {\n    function Header(_type, _retain, _qos, _dup) {\n      this.type = void 0;\n      this.retain = false;\n      this.qos = QOS.AT_LEAST_ONCE;\n      this.dup = false;\n      this.syncMsg = false;\n      var isPlusType = utils.isPlus(_type);\n\n      if (_type && isPlusType && arguments.length === 1) {\n        this.retain = (_type & 1) > 0;\n        this.qos = (_type & 6) >> 1;\n        this.dup = (_type & 8) > 0;\n        this.type = _type >> 4 & 15;\n        this.syncMsg = (_type & 8) === 8;\n      } else {\n        this.type = _type;\n        this.retain = _retain === undefined ? false : _retain;\n        this.qos = _qos === undefined ? QOS.AT_LEAST_ONCE : _qos;\n        this.dup = _dup === undefined ? false : _dup;\n      }\n    }\n\n    var _proto = Header.prototype;\n\n    _proto.encode = function encode() {\n      var self = this;\n      var validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT];\n      utils.forEach(validQosList, function (qos) {\n        if (self.qos === QOS[qos]) {\n          self.qos = qos;\n        }\n      });\n\n      var _byte = self.type << 4;\n\n      _byte |= self.retain ? 1 : 0;\n      _byte |= self.qos << 1;\n      _byte |= self.dup ? 8 : 0;\n      return _byte;\n    };\n\n    return Header;\n  }();\n\n  var BinaryHelper = {\n    writeUTF: function writeUTF(str, isGetBytes) {\n      var back = [],\n          byteSize = 0;\n      utils.forEach(str, function (_char, i) {\n        var code = str.charCodeAt(i);\n\n        if (code >= 0 && code <= 127) {\n          byteSize += 1;\n          back.push(code);\n        } else if (code >= 128 && code <= 2047) {\n          byteSize += 2;\n          back.push(192 | 31 & code >> 6);\n          back.push(128 | 63 & code);\n        } else if (code >= 2048 && code <= 65535) {\n          byteSize += 3;\n          back.push(224 | 15 & code >> 12);\n          back.push(128 | 63 & code >> 6);\n          back.push(128 | 63 & code);\n        }\n      });\n      utils.forEach(back, function (_char2, i) {\n        if (_char2 > 255) {\n          back[i] &= 255;\n        }\n      });\n\n      if (isGetBytes) {\n        return back;\n      }\n\n      if (byteSize <= 255) {\n        return [0, byteSize].concat(back);\n      } else {\n        return [byteSize >> 8, byteSize & 255].concat(back);\n      }\n    },\n    readUTF: function readUTF(arr) {\n      var UTF = '';\n\n      for (var i = 0, len = arr.length; i < len; i++) {\n        var _char3 = arr[i];\n\n        if (_char3 < 0) {\n          arr[i] += 256;\n        }\n\n        var one = arr[i].toString(2),\n            v = one.match(/^1+?(?=0)/);\n\n        if (v && one.length === 8) {\n          var bytesLength = v[0].length,\n              store = '';\n\n          for (var st = 0; st < bytesLength; st++) {\n            store += arr[st + i].toString(2).slice(2);\n          }\n\n          UTF += String.fromCharCode(parseInt(store, 2));\n          i += bytesLength - 1;\n        } else {\n          UTF += String.fromCharCode(arr[i]);\n        }\n      }\n\n      return UTF;\n    }\n  };\n\n  var RongStreamReader = function () {\n    function RongStreamReader(arr) {\n      this.pool = void 0;\n      this.position = 0;\n      this.poolLen = 0;\n      this.pool = arr;\n      this.poolLen = arr.length;\n    }\n\n    var _proto2 = RongStreamReader.prototype;\n\n    _proto2.check = function check() {\n      return this.position >= this.pool.length;\n    };\n\n    _proto2.readInt = function readInt() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 4; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t.toString();\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readLong = function readLong() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 8; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t;\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readByte = function readByte() {\n      if (this.check()) {\n        return -1;\n      }\n\n      var val = this.pool[this.position++];\n\n      if (val > 255) {\n        val &= 255;\n      }\n\n      return val;\n    };\n\n    _proto2.readUTF = function readUTF() {\n      if (this.check()) {\n        return '';\n      }\n\n      var big = this.readByte() << 8 | this.readByte();\n      var pool = this.pool.subarray(this.position, this.position += big);\n      return BinaryHelper.readUTF(pool);\n    };\n\n    _proto2.readAll = function readAll() {\n      return this.pool.subarray(this.position, this.poolLen);\n    };\n\n    return RongStreamReader;\n  }();\n\n  var RongStreamWriter = function () {\n    function RongStreamWriter() {\n      this.pool = [];\n      this.position = 0;\n      this.writen = 0;\n    }\n\n    var _proto3 = RongStreamWriter.prototype;\n\n    _proto3.write = function write(_byte2) {\n      if (utils.isArray(_byte2)) {\n        this.pool = this.pool.concat(_byte2);\n      } else if (utils.isPlus(_byte2)) {\n        if (_byte2 > 255) {\n          _byte2 &= 255;\n        }\n\n        this.pool.push(_byte2);\n        this.writen++;\n      }\n\n      return _byte2;\n    };\n\n    _proto3.writeArr = function writeArr(_byte3) {\n      this.pool = this.pool.concat(_byte3);\n      return _byte3;\n    };\n\n    _proto3.writeUTF = function writeUTF(str) {\n      var val = BinaryHelper.writeUTF(str);\n      this.pool = this.pool.concat(val);\n      this.writen += val.length;\n    };\n\n    _proto3.getBytesArray = function getBytesArray() {\n      return this.pool;\n    };\n\n    return RongStreamWriter;\n  }();\n\n  var IDENTIFIER = {\n    PUB: 'pub',\n    QUERY: 'qry'\n  };\n\n  var _getIdentifier = function getIdentifier(messageId, identifier) {\n    if (messageId && identifier) {\n      return identifier + '_' + messageId;\n    } else if (messageId) {\n      return messageId;\n    } else {\n      return utils.getCurrentTimestamp();\n    }\n  };\n\n  var BaseReader = function () {\n    function BaseReader(header) {\n      this._name = void 0;\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.messageId = void 0;\n      this.timestamp = void 0;\n      this.identifier = void 0;\n      this._header = header;\n    }\n\n    var _proto = BaseReader.prototype;\n\n    _proto.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto.read = function read(stream, length) {\n      this.readMessage(stream, length);\n    };\n\n    _proto.readMessage = function readMessage(stream, length) {\n      return {\n        stream: stream,\n        length: length\n      };\n    };\n\n    return BaseReader;\n  }();\n\n  var BaseWriter = function () {\n    function BaseWriter(headerType) {\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.data = void 0;\n      this.messageId = void 0;\n      this.topic = void 0;\n      this.targetId = void 0;\n      this.identifier = void 0;\n      this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n    }\n\n    var _proto2 = BaseWriter.prototype;\n\n    _proto2.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto2.write = function write(stream) {\n      var headerCode = this.getHeaderFlag();\n      stream.write(headerCode);\n      this.writeMessage(stream);\n    };\n\n    _proto2.writeMessage = function writeMessage(stream) {\n      return stream;\n    };\n\n    _proto2.setHeaderQos = function setHeaderQos(qos) {\n      this._header.qos = qos;\n    };\n\n    _proto2.getHeaderFlag = function getHeaderFlag() {\n      return this._header.encode();\n    };\n\n    _proto2.getLengthSize = function getLengthSize() {\n      return this.lengthSize;\n    };\n\n    _proto2.getBufferData = function getBufferData() {\n      var stream = new RongStreamWriter();\n      this.write(stream);\n      var val = stream.getBytesArray();\n      var binary = new Int8Array(val);\n      return binary;\n    };\n\n    _proto2.getCometData = function getCometData() {\n      var data = this.data || {};\n      return utils.toJSON(data);\n    };\n\n    return BaseWriter;\n  }();\n\n  var ConnAckReader = function (_BaseReader) {\n    _inheritsLoose(ConnAckReader, _BaseReader);\n\n    function ConnAckReader() {\n      var _this;\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this = _BaseReader.call.apply(_BaseReader, [this].concat(args)) || this;\n      _this._name = MESSAGE_NAME.CONN_ACK;\n      _this.status = void 0;\n      _this.userId = void 0;\n      _this.timestamp = void 0;\n      return _this;\n    }\n\n    var _proto3 = ConnAckReader.prototype;\n\n    _proto3.readMessage = function readMessage(stream, msgLength) {\n      stream.readByte();\n      this.status = +stream.readByte();\n\n      if (msgLength > ConnAckReader.MESSAGE_LENGTH) {\n        this.userId = stream.readUTF();\n        stream.readUTF();\n        this.timestamp = stream.readLong();\n      }\n    };\n\n    return ConnAckReader;\n  }(BaseReader);\n\n  ConnAckReader.MESSAGE_LENGTH = 2;\n\n  var DisconnectReader = function (_BaseReader2) {\n    _inheritsLoose(DisconnectReader, _BaseReader2);\n\n    function DisconnectReader() {\n      var _this2;\n\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      _this2 = _BaseReader2.call.apply(_BaseReader2, [this].concat(args)) || this;\n      _this2._name = MESSAGE_NAME.DISCONNECT;\n      _this2.status = void 0;\n      return _this2;\n    }\n\n    var _proto4 = DisconnectReader.prototype;\n\n    _proto4.readMessage = function readMessage(stream) {\n      stream.readByte();\n      this.status = +stream.readByte();\n    };\n\n    return DisconnectReader;\n  }(BaseReader);\n\n  DisconnectReader.MESSAGE_LENGTH = 2;\n\n  var PingReqWriter = function (_BaseWriter) {\n    _inheritsLoose(PingReqWriter, _BaseWriter);\n\n    function PingReqWriter() {\n      var _this3;\n\n      _this3 = _BaseWriter.call(this, OPERATE_TYPE.PINGREQ) || this;\n      _this3._name = MESSAGE_NAME.PING_REQ;\n      return _this3;\n    }\n\n    return PingReqWriter;\n  }(BaseWriter);\n\n  var PingRespReader = function (_BaseReader3) {\n    _inheritsLoose(PingRespReader, _BaseReader3);\n\n    function PingRespReader() {\n      var _this4;\n\n      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n        args[_key3] = arguments[_key3];\n      }\n\n      _this4 = _BaseReader3.call.apply(_BaseReader3, [this].concat(args)) || this;\n      _this4._name = MESSAGE_NAME.PING_RESP;\n      return _this4;\n    }\n\n    return PingRespReader;\n  }(BaseReader);\n\n  var RetryableReader = function (_BaseReader4) {\n    _inheritsLoose(RetryableReader, _BaseReader4);\n\n    function RetryableReader() {\n      var _this5;\n\n      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n        args[_key4] = arguments[_key4];\n      }\n\n      _this5 = _BaseReader4.call.apply(_BaseReader4, [this].concat(args)) || this;\n      _this5.messageId = void 0;\n      return _this5;\n    }\n\n    var _proto5 = RetryableReader.prototype;\n\n    _proto5.readMessage = function readMessage(stream) {\n      var msgId = stream.readByte() * 256 + stream.readByte();\n      this.messageId = parseInt(msgId, 10);\n    };\n\n    return RetryableReader;\n  }(BaseReader);\n\n  var RetryableWriter = function (_BaseWriter2) {\n    _inheritsLoose(RetryableWriter, _BaseWriter2);\n\n    function RetryableWriter() {\n      var _this6;\n\n      for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n        args[_key5] = arguments[_key5];\n      }\n\n      _this6 = _BaseWriter2.call.apply(_BaseWriter2, [this].concat(args)) || this;\n      _this6.messageId = void 0;\n      return _this6;\n    }\n\n    var _proto6 = RetryableWriter.prototype;\n\n    _proto6.writeMessage = function writeMessage(stream) {\n      var id = this.messageId;\n      var lsb = id & 255;\n      var msb = (id & 65280) >> 8;\n      stream.write(msb);\n      stream.write(lsb);\n    };\n\n    return RetryableWriter;\n  }(BaseWriter);\n\n  var PublishReader = function (_RetryableReader) {\n    _inheritsLoose(PublishReader, _RetryableReader);\n\n    function PublishReader() {\n      var _this7;\n\n      for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n        args[_key6] = arguments[_key6];\n      }\n\n      _this7 = _RetryableReader.call.apply(_RetryableReader, [this].concat(args)) || this;\n      _this7._name = MESSAGE_NAME.PUBLISH;\n      _this7.topic = void 0;\n      _this7.data = void 0;\n      _this7.targetId = void 0;\n      _this7.date = void 0;\n      _this7.syncMsg = false;\n      _this7.identifier = IDENTIFIER.PUB;\n      return _this7;\n    }\n\n    var _proto7 = PublishReader.prototype;\n\n    _proto7.readMessage = function readMessage(stream) {\n      this.date = stream.readInt();\n      this.topic = stream.readUTF();\n      this.targetId = stream.readUTF();\n      RetryableReader.prototype.readMessage.apply(this, arguments);\n      this.data = stream.readAll();\n    };\n\n    return PublishReader;\n  }(RetryableReader);\n\n  var PublishWriter = function (_RetryableWriter) {\n    _inheritsLoose(PublishWriter, _RetryableWriter);\n\n    function PublishWriter(topic, data, targetId) {\n      var _this8;\n\n      _this8 = _RetryableWriter.call(this, OPERATE_TYPE.PUBLISH) || this;\n      _this8._name = MESSAGE_NAME.PUBLISH;\n      _this8.topic = void 0;\n      _this8.data = void 0;\n      _this8.targetId = void 0;\n      _this8.date = void 0;\n      _this8.syncMsg = false;\n      _this8.identifier = IDENTIFIER.PUB;\n      _this8.topic = topic;\n      _this8.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this8.targetId = targetId;\n      return _this8;\n    }\n\n    var _proto8 = PublishWriter.prototype;\n\n    _proto8.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.apply(this, arguments);\n      stream.write(this.data);\n    };\n\n    return PublishWriter;\n  }(RetryableWriter);\n\n  var PubAckReader = function (_RetryableReader2) {\n    _inheritsLoose(PubAckReader, _RetryableReader2);\n\n    function PubAckReader() {\n      var _this9;\n\n      for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n        args[_key7] = arguments[_key7];\n      }\n\n      _this9 = _RetryableReader2.call.apply(_RetryableReader2, [this].concat(args)) || this;\n      _this9._name = MESSAGE_NAME.PUB_ACK;\n      _this9.status = void 0;\n      _this9.date = 0;\n      _this9.data = void 0;\n      _this9.millisecond = 0;\n      _this9.messageUId = void 0;\n      _this9.timestamp = 0;\n      _this9.identifier = IDENTIFIER.PUB;\n      return _this9;\n    }\n\n    var _proto9 = PubAckReader.prototype;\n\n    _proto9.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.millisecond = stream.readByte() * 256 + stream.readByte();\n      this.timestamp = this.date * 1000 + this.millisecond;\n      this.messageUId = stream.readUTF();\n    };\n\n    return PubAckReader;\n  }(RetryableReader);\n\n  var PubAckWriter = function (_RetryableWriter2) {\n    _inheritsLoose(PubAckWriter, _RetryableWriter2);\n\n    function PubAckWriter(messageId) {\n      var _this10;\n\n      _this10 = _RetryableWriter2.call(this, OPERATE_TYPE.PUBACK) || this;\n      _this10._name = MESSAGE_NAME.PUB_ACK;\n      _this10.status = void 0;\n      _this10.date = 0;\n      _this10.millisecond = 0;\n      _this10.messageUId = void 0;\n      _this10.timestamp = 0;\n      _this10.messageId = messageId;\n      return _this10;\n    }\n\n    var _proto10 = PubAckWriter.prototype;\n\n    _proto10.writeMessage = function writeMessage(stream) {\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n    };\n\n    return PubAckWriter;\n  }(RetryableWriter);\n\n  var QueryWriter = function (_RetryableWriter3) {\n    _inheritsLoose(QueryWriter, _RetryableWriter3);\n\n    function QueryWriter(topic, data, targetId) {\n      var _this11;\n\n      _this11 = _RetryableWriter3.call(this, OPERATE_TYPE.QUERY) || this;\n      _this11._name = MESSAGE_NAME.QUERY;\n      _this11.topic = void 0;\n      _this11.data = void 0;\n      _this11.targetId = void 0;\n      _this11.identifier = IDENTIFIER.QUERY;\n      _this11.topic = topic;\n      _this11.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this11.targetId = targetId;\n      return _this11;\n    }\n\n    var _proto11 = QueryWriter.prototype;\n\n    _proto11.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n      stream.write(this.data);\n    };\n\n    return QueryWriter;\n  }(RetryableWriter);\n\n  var QueryConWriter = function (_RetryableWriter4) {\n    _inheritsLoose(QueryConWriter, _RetryableWriter4);\n\n    function QueryConWriter(messageId) {\n      var _this12;\n\n      _this12 = _RetryableWriter4.call(this, OPERATE_TYPE.QUERYCON) || this;\n      _this12._name = MESSAGE_NAME.QUERY_CON;\n      _this12.messageId = messageId;\n      return _this12;\n    }\n\n    return QueryConWriter;\n  }(RetryableWriter);\n\n  var QueryAckReader = function (_RetryableReader3) {\n    _inheritsLoose(QueryAckReader, _RetryableReader3);\n\n    function QueryAckReader() {\n      var _this13;\n\n      for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n        args[_key8] = arguments[_key8];\n      }\n\n      _this13 = _RetryableReader3.call.apply(_RetryableReader3, [this].concat(args)) || this;\n      _this13._name = MESSAGE_NAME.QUERY_ACK;\n      _this13.data = void 0;\n      _this13.status = void 0;\n      _this13.date = void 0;\n      _this13.identifier = IDENTIFIER.QUERY;\n      return _this13;\n    }\n\n    var _proto12 = QueryAckReader.prototype;\n\n    _proto12.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.data = stream.readAll();\n    };\n\n    return QueryAckReader;\n  }(RetryableReader);\n\n  var getReaderByHeader = function getReaderByHeader(header) {\n    var type = header.type,\n        msg = new BaseReader(header);\n\n    switch (type) {\n      case OPERATE_TYPE.CONNACK:\n        msg = new ConnAckReader(header);\n        break;\n\n      case OPERATE_TYPE.PUBLISH:\n        msg = new PublishReader(header);\n        msg.syncMsg = header.syncMsg;\n        break;\n\n      case OPERATE_TYPE.PUBACK:\n        msg = new PubAckReader(header);\n        break;\n\n      case OPERATE_TYPE.QUERYACK:\n        msg = new QueryAckReader(header);\n        break;\n\n      case OPERATE_TYPE.SUBACK:\n      case OPERATE_TYPE.UNSUBACK:\n      case OPERATE_TYPE.PINGRESP:\n        msg = new PingRespReader(header);\n        break;\n\n      case OPERATE_TYPE.DISCONNECT:\n        msg = new DisconnectReader(header);\n        break;\n\n      default:\n        throw new Error('No support for deserializing ' + type + ' messages');\n    }\n\n    return msg;\n  };\n\n  var readWSBuffer = function readWSBuffer(data) {\n    var arr = new Uint8Array(data);\n    var stream = new RongStreamReader(arr);\n    var flags = stream.readByte(),\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    msg.read(stream, arr.length - 1);\n    return msg;\n  };\n\n  var readCometData = function readCometData(data) {\n    var flags = data.headerCode,\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    utils.forEach(data, function (item, key) {\n      if (key in msg) {\n        msg[key] = item;\n      }\n    });\n    return msg;\n  };\n\n  var ENGINE_EVENT = {\n    WATCH: 'watch',\n    UN_WATCH: 'unwatch',\n    CONNECT: 'connect',\n    RECONNECT: 'reconnect',\n    DISCONNECT: 'disconnect',\n    CHANGE_USER: 'changeUser',\n    GET_CONNECTION_STATUS: 'getConnectionStatus',\n    GET_CONNECTION_USER_ID: 'getConnectionUserId',\n    GET_CONNECTED_TIME: 'getConnectedTime',\n    GET_APP_INFO: 'getAppInfo',\n    GET_CONVERSATION_LIST: 'getConversationList',\n    REMOVE_CONVERSATION_LIST: 'removeConversationList',\n    REMOVE_CONVERSATION: 'removeConversation',\n    GET_TOTAL_UNREAD_COUNT: 'getTotalUnreadCount',\n    CLEAR_UNREAD_COUNT: 'clearUnreadCount',\n    GET_UNREAD_COUNT: 'getUnreadCount',\n    GET_LOCAL_CONVERSATION: 'getLocalConversation',\n    SET_CONVERSATION_STATUS_LIST: 'setConversationStatusList',\n    SEND_MESSAGE: 'sendMessage',\n    GET_HISTORY_MSGS: 'getHistoryMessages',\n    DELETE_MESSAGES: 'deleteHistoryMessages',\n    CLEAR_MESSAGES: 'clearHistoryMessages',\n    RECALL_MESSAGE: 'recallMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    QUIT_CHATROOM: 'quitChatRoom',\n    GET_CHATROOM_INFO: 'getChatRoomInfo',\n    GET_CHATROOM_MSGS: 'getChatRoomHistoryMessages',\n    SET_KV: 'setChatRoomKV',\n    FORCE_SET_KV: 'forceSetChatRoomKV',\n    DEL_KV: 'removeChatRoomKV',\n    FORCE_DEL_KV: 'forceRemoveChatRoomKV',\n    GET_KV: 'getChatRoomKV',\n    GET_ALL_KV: 'getAllChatRoomKV',\n    JOIN_RTC: 'joinRTCRoom',\n    QUIT_RTC: 'quitRTCRoom',\n    PING_RTC: 'RTCPing',\n    GET_RTC_ROOM_INFO: 'getRTCRoomInfo',\n    SET_RTC_DATA: 'setRTCData',\n    SET_RTC_USER_DATA: 'setRTCUserData',\n    GET_RTC_DATA: 'getRTCData',\n    DEL_RTC_DATA: 'removeRTCData',\n    SET_RTC_OUT_DATA: 'setRTCOutData',\n    GET_RTC_OUT_DATA: 'getRTCOutData',\n    GET_RTC_TOKEN: 'getRTCToken',\n    SET_RTC_STATE: 'setRTCState',\n    GET_RTC_USER_INFO_LIST: 'getRTCUserInfoList',\n    SET_RTC_USER_INFO: 'setRTCUserInfo',\n    DEL_RTC_USER_INFO: 'removeRTCUserInfo',\n    GET_RTC_USER_LIST: 'getRTCUserList',\n    GET_UPLOAD_TOKEN: 'getFileToken',\n    GET_UPLOAD_URL: 'getFileUrl'\n  };\n  var ENGINE_EVENT_NEED_CONNECTED = [ENGINE_EVENT.GET_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION, ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT, ENGINE_EVENT.CLEAR_UNREAD_COUNT, ENGINE_EVENT.SEND_MESSAGE, ENGINE_EVENT.GET_HISTORY_MSGS, ENGINE_EVENT.DELETE_MESSAGES, ENGINE_EVENT.CLEAR_MESSAGES, ENGINE_EVENT.RECALL_MESSAGE, ENGINE_EVENT.JOIN_CHATROOM, ENGINE_EVENT.QUIT_CHATROOM, ENGINE_EVENT.GET_CHATROOM_INFO, ENGINE_EVENT.GET_CHATROOM_MSGS];\n  var ENGINE_EVENT_NEED_DISCONNECTED = [ENGINE_EVENT.CONNECT, ENGINE_EVENT.RECONNECT];\n  var IM_EVENT = {\n    STATUS: 'status',\n    MESSAGE: 'message',\n    CONVERSATION: 'conversation',\n    SETTING: 'setting',\n    CHATROOM: 'chatroom'\n  };\n  var TRANSPORT_EVENT = {\n    SIGNAL: 'signal',\n    STATUS: 'status'\n  };\n  var SERVER_EVENT_NAME = {\n    STATUS: 'status',\n    NOTIFY_PULL: 'notifyPull',\n    DIRECT_MSG: 'directMessage',\n    CHRM_KV_CHANGED: 'chatRoomKV',\n    CHRM_KV_SET: 'chatRoomKVSet',\n    MESSAGE_SEND: 'sendMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    BEFORE_JOIN_CHATROOM: 'beforeJoinChatRoom',\n    USER_SETTING_CHANGED: 'userSetting',\n    CONVERSATION_STATUS_CHANGED: 'converStatusChanged',\n    CONVERSATION_STATUS_SETED: 'converStatusSeted'\n  };\n\n  var _APP_ENGINE_EVENT_LOG;\n  var PLATFORM$1 = 'Web';\n  var LEVEL = {\n    FATAL: 0,\n    ERROR: 1,\n    WARN: 2,\n    INFO: 3,\n    DEBUG: 4\n  };\n  var STORE_SIZE = {\n    ADVANCED: 500,\n    LOW: 500\n  };\n  var LOG_TYPE = {\n    'IM': 'IM',\n    'RTC': 'RTC'\n  };\n  var TAG = {\n    L_GET_NAVI_T: 'L-get_navi-T',\n    L_GET_NAVI_R: 'L-get_navi-R',\n    L_PING_WS_T: 'L-ping_ws-T',\n    L_PING_WS_R: 'L-ping_ws-R',\n    L_NETWORK_CHANGED_S: 'L-network_changed-S',\n    L_DECODE_MSG_E: 'L-decode_msg-E',\n    L_RECONNECT_T: 'L-reconnect-T',\n    L_RECONNECT_R: 'L-reconnect-R',\n    L_PULL_CHRM_KV_T: 'L-pull-chrm-kv-T',\n    L_PULL_CHRM_KV_R: 'L-pull-chrm-kv-R',\n    L_PING_S: 'L-ping-S',\n    L_CRASH_E: 'L-crash-E',\n    L_COMET_SEND_SIGNAL_E: 'L-comet_send_signal-E',\n    A_INIT_O: 'A-init-O',\n    A_CONNECT_T: 'A-connect-T',\n    A_CONNECT_R: 'A-connect-R',\n    A_DISCONNECT_T: 'A-disconnect-T',\n    A_DISCONNECT_R: 'A-disconnect-R',\n    A_RECONNECT_T: 'A-reconnect-T',\n    A_RECONNECT_R: 'A-reconnect-R',\n    A_JOIN_CHATROOM_T: 'A-join_chatroom-T',\n    A_JOIN_CHATROOM_R: 'A-join_chatroom-R',\n    A_QUIT_CHATROOM_T: 'A-quit_chatroom-T',\n    A_QUIT_CHATROOM_R: 'A-quit_chatroom-R',\n    P_NOTIFY_CHRM_KV_S: 'P-notify-chrm-kv-R',\n    G_CRASH_E: 'G-crash-E',\n    G_UPLOAD_LOG_S: 'G-upload_log-S',\n    G_UPLOAD_LOG_E: 'G-upload_log-E'\n  };\n  var APP_ENGINE_EVENT_LOG_TAG = (_APP_ENGINE_EVENT_LOG = {}, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.CONNECT] = {\n    req: TAG.A_CONNECT_T,\n    resp: TAG.A_CONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.DISCONNECT] = {\n    req: TAG.A_DISCONNECT_T,\n    resp: TAG.A_DISCONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.RECONNECT] = {\n    req: TAG.A_RECONNECT_T,\n    resp: TAG.A_RECONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.JOIN_CHATROOM] = {\n    req: TAG.A_JOIN_CHATROOM_T,\n    resp: TAG.A_JOIN_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.QUIT_CHATROOM] = {\n    req: TAG.A_QUIT_CHATROOM_T,\n    resp: TAG.A_QUIT_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG);\n  var REPORT_TYPE = {\n    REALTIME: 0,\n    FULL: 1\n  };\n  var CSV_LOG_TPL = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n  var REALTIME_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var MSGNOTIF_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var LOG_CMD_MSG_SENDER = 'rongcloudsystem';\n  var NO_FULL_LOG = 'nodata';\n  var REQUEST_TIMEOUT = 15000;\n  var DEFAULT_SERVER_OPTION = {\n    isOpen: true,\n    url: 'logcollection.ronghub.com',\n    realtimeLevel: LEVEL.ERROR,\n    realtimeInterval: 20000,\n    realtimeMaxTimes: 5,\n    fullInterval: 5000,\n    fullMaxTimes: 3,\n    fullLevel: LEVEL.DEBUG\n  };\n  var IGNORE_ERROR_CODE = [ERROR_CODE.RC_CONNECTION_EXIST];\n\n  var isEmpty$1 = utils.isEmpty,\n      tplEngine$1 = utils.tplEngine;\n\n  var getTransporterUrl = function getTransporterUrl(option) {\n    var domain = option.domain,\n        appkey = option.appkey,\n        token = option.token,\n        connectType = option.connectType,\n        protocol = option.protocol;\n    var isComet = connectType === CONNECT_TYPE.COMET;\n    var cmpTpl = CMP_URL_TPL;\n\n    if (isEmpty$1(protocol)) {\n      protocol = isComet ? env.protocol.http : env.protocol.ws;\n    }\n\n    var tplOption = {\n      domain: domain,\n      appkey: appkey,\n      protocol: protocol,\n      apiVer: env.isFromUniapp ? 'uniapp' : 'normal',\n      token: utils.encodeURI(token)\n    };\n\n    if (env.isMini) {\n      cmpTpl = MINI_CMP_URL_TPL;\n      utils.extend(tplOption, {\n        platform: PLATFORM_TYPE.MINI\n      });\n    }\n\n    return tplEngine$1(cmpTpl, tplOption);\n  };\n\n  var isGroup = function isGroup(type) {\n    return type === CONVERSATION_TYPE.GROUP;\n  };\n\n  var isChatRoom = function isChatRoom(type) {\n    return type === CONVERSATION_TYPE.CHATROOM;\n  };\n\n  var getConversationTypeList = function getConversationTypeList() {\n    return utils.getValues(CONVERSATION_TYPE);\n  };\n\n  var isValidConversationType = function isValidConversationType(type) {\n    var conversationTypeList = getConversationTypeList();\n    return utils.isNumber(type) && utils.isInclude(conversationTypeList, type);\n  };\n\n  var getSessionId = function getSessionId(option) {\n    var isStatusMessage = option.isStatusMessage;\n    var isPersited = option.isPersited,\n        isCounted = option.isCounted,\n        isMentiond = option.isMentiond,\n        disableNotification = option.disableNotification;\n\n    if (isStatusMessage) {\n      isPersited = isCounted = false;\n    }\n\n    var sessionId = 0;\n\n    if (isPersited) {\n      sessionId = sessionId | 0x01;\n    }\n\n    if (isCounted) {\n      sessionId = sessionId | 0x02;\n    }\n\n    if (isMentiond) {\n      sessionId = sessionId | 0x04;\n    }\n\n    if (disableNotification) {\n      sessionId = sessionId | 0x20;\n    }\n\n    return sessionId;\n  };\n\n  var getPersitedAndCountedBySessionId = function getPersitedAndCountedBySessionId(sessionId) {\n    var isPersited, isCounted;\n\n    switch (sessionId) {\n      case MESSAGE_TAG.COUNT_ONLY:\n        isPersited = false;\n        isCounted = true;\n        break;\n\n      case MESSAGE_TAG.PERSIT_ONLY:\n        isPersited = true;\n        isCounted = false;\n        break;\n\n      case MESSAGE_TAG.NONE:\n        isPersited = isCounted = false;\n        break;\n\n      case MESSAGE_TAG.PERSIT_AND_COUNT:\n      default:\n        isPersited = isCounted = true;\n        break;\n    }\n\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted\n    };\n  };\n\n  var getPersitedAndCountedAndSlientBySessionId = function getPersitedAndCountedAndSlientBySessionId(sessionId) {\n    var binaryNum = Number(sessionId).toString(2);\n    var sessionIdArr = [];\n\n    for (var i = 0; i < binaryNum.length; i++) {\n      var index = binaryNum.length - 1 - i;\n      sessionIdArr.push(Number(binaryNum[index]));\n    }\n\n    return {\n      isPersited: Boolean(sessionIdArr[0]),\n      isCounted: Boolean(sessionIdArr[1]),\n      disableNotification: Boolean(sessionIdArr[5])\n    };\n  };\n\n  var getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n    var isPersited = true,\n        isCounted = true,\n        isMentiond = false,\n        disableNotification = false;\n    isPersited = !!(status & 0x10);\n    isCounted = !!(status & 0x20);\n    isMentiond = !!(status & 0x40);\n    disableNotification = !!(status & 0x200);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond,\n      disableNotification: disableNotification\n    };\n  };\n\n  var SignalId = {\n    ids: {},\n    temp: '{appkey}_{userId}',\n    get: function get(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      var id = SignalId.ids[key] || 0;\n      id++;\n      SignalId.ids[key] = id;\n      return id;\n    },\n    clear: function clear(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      SignalId.ids[key] = 0;\n    },\n    isExceedLimit: function isExceedLimit(id) {\n      return id > MAX_SINGAL_ID;\n    }\n  };\n\n  var RCSocket = function () {\n    function RCSocket(options) {\n      this._socket = void 0;\n      this.eventEmitter = new utils.EventEmitter();\n      this.KEY = {\n        OPEN: 'open',\n        MSG: 'msg',\n        ERROR: 'error',\n        CLOSE: 'close'\n      };\n      var self = this;\n      var KEY = self.KEY;\n      self._socket = new utils.Socket(options);\n\n      self._socket.onOpen(function (data) {\n        self.eventEmitter.emit(KEY.OPEN, data);\n      });\n\n      self._socket.onMessage(function (data) {\n        self.eventEmitter.emit(KEY.MSG, data);\n      });\n\n      self._socket.onError(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.ERROR, data);\n      });\n\n      self._socket.onClose(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.CLOSE, data);\n      });\n    }\n\n    var _proto = RCSocket.prototype;\n\n    _proto._formatCloseData = function _formatCloseData(data) {\n      if (env.isMini || env.isAppPlus) {\n        data = data || {};\n        var _data = data,\n            errMsg = _data.errMsg;\n        data.code = MINI_ERROR_MSG_TO_STATUS[errMsg];\n      }\n\n      return data;\n    };\n\n    _proto.send = function send(data) {\n      return this._socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.eventEmitter.clear();\n\n      this._socket.close();\n    };\n\n    _proto.onOpen = function onOpen(event) {\n      this.eventEmitter.on(this.KEY.OPEN, event);\n    };\n\n    _proto.onMessage = function onMessage(event) {\n      this.eventEmitter.on(this.KEY.MSG, event);\n    };\n\n    _proto.onError = function onError(event) {\n      this.eventEmitter.on(this.KEY.ERROR, event);\n    };\n\n    _proto.onClose = function onClose(event) {\n      this.eventEmitter.on(this.KEY.CLOSE, event);\n    };\n\n    return RCSocket;\n  }();\n\n  var RCStorage = function () {\n    function RCStorage(suffix) {\n      var _ref;\n\n      this._cache = void 0;\n      this.STORAGE_KEY = void 0;\n      var storageKey = suffix ? STORAGE_ROOT_KEY + suffix : STORAGE_ROOT_KEY;\n      var localCache = utils.Storage.get(storageKey) || {};\n      this._cache = new utils.Cache((_ref = {}, _ref[storageKey] = localCache, _ref));\n      this.STORAGE_KEY = storageKey;\n    }\n\n    var _proto2 = RCStorage.prototype;\n\n    _proto2._get = function _get() {\n      var KEY = this.STORAGE_KEY;\n      return this._cache.get(KEY) || {};\n    };\n\n    _proto2._set = function _set(cache) {\n      var KEY = this.STORAGE_KEY;\n      cache = cache || {};\n\n      this._cache.set(KEY, cache);\n\n      utils.Storage.set(KEY, cache);\n    };\n\n    _proto2.set = function set(key, value) {\n      var localValue = this._get();\n\n      localValue[key] = value;\n\n      this._set(localValue);\n    };\n\n    _proto2.remove = function remove(key) {\n      var localValue = this._get();\n\n      delete localValue[key];\n\n      this._set(localValue);\n    };\n\n    _proto2.clear = function clear() {\n      var KEY = this.STORAGE_KEY;\n      utils.Storage.remove(KEY);\n\n      this._cache.remove(KEY);\n    };\n\n    _proto2.get = function get(key) {\n      var localValue = this._get();\n\n      return localValue[key];\n    };\n\n    _proto2.getKeys = function getKeys() {\n      var localValue = this._get();\n\n      return utils.getKeys(localValue);\n    };\n\n    _proto2.getValues = function getValues() {\n      return this._get() || {};\n    };\n\n    return RCStorage;\n  }();\n\n  var formatSyncTime = function formatSyncTime(_syncTime) {\n    _syncTime = _syncTime || {};\n    _syncTime.inboxTime = _syncTime.inboxTime || 0;\n    _syncTime.sendboxTime = _syncTime.sendboxTime || 0;\n    return _syncTime;\n  };\n\n  var MessageTimeSyner = function () {\n    function MessageTimeSyner(option) {\n      this._syncTime = void 0;\n      this._storage = void 0;\n      option = option || {};\n      var _option = option,\n          startSyncTime = _option.startSyncTime;\n\n      this._initStorage(option);\n\n      if (startSyncTime) {\n        this._syncTime = formatSyncTime(startSyncTime);\n      }\n    }\n\n    var _proto3 = MessageTimeSyner.prototype;\n\n    _proto3._initStorage = function _initStorage(option) {\n      var appkey = option.appkey,\n          userId = option.userId;\n      var ROOT_KEY = utils.tplEngine(STORAGE_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      var storage = new RCStorage(ROOT_KEY);\n      var syncTime = {\n        sendboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX),\n        inboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.INBOX)\n      };\n      this._storage = storage;\n      this._syncTime = formatSyncTime(syncTime);\n    };\n\n    _proto3.setInbox = function setInbox(time) {\n      var beforeTime = this._syncTime.inboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.inboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.INBOX, time);\n      }\n    };\n\n    _proto3.setSendbox = function setSendbox(time) {\n      var beforeTime = this._syncTime.sendboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.sendboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX, time);\n      }\n    };\n\n    _proto3.setByMessage = function setByMessage(msg) {\n      var messageDirection = msg.messageDirection,\n          sentTime = msg.sentTime;\n      var isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND;\n      isSelfSend ? this.setSendbox(sentTime) : this.setInbox(sentTime);\n    };\n\n    _proto3.get = function get() {\n      return formatSyncTime(this._syncTime);\n    };\n\n    return MessageTimeSyner;\n  }();\n\n  var ChatRoomMessageTimeSyner = function () {\n    function ChatRoomMessageTimeSyner(option) {\n      this._rootKey = void 0;\n      this._pullTimes = {};\n      option = option || {};\n      var _option2 = option,\n          appkey = _option2.appkey,\n          userId = _option2.userId;\n      this._rootKey = utils.tplEngine(SESSION_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n    }\n\n    var _proto4 = ChatRoomMessageTimeSyner.prototype;\n\n    _proto4.set = function set(chrmId, time) {\n      this._pullTimes[chrmId] = time;\n      utils.Session.set(this._rootKey, this._pullTimes);\n    };\n\n    _proto4.get = function get(chrmId) {\n      var pullTimes;\n\n      if (utils.isEmpty(this._pullTimes)) {\n        pullTimes = utils.Session.get(this._rootKey) || {};\n      } else {\n        pullTimes = this._pullTimes;\n      }\n\n      return pullTimes[chrmId] || 0;\n    };\n\n    _proto4.setByMessage = function setByMessage(msg) {\n      var sentTime = msg.sentTime;\n      var chrmId = msg.targetId;\n      var beforeTime = this.get(chrmId);\n\n      if (beforeTime < sentTime) {\n        this.set(chrmId, sentTime);\n      }\n    };\n\n    return ChatRoomMessageTimeSyner;\n  }();\n\n  var JoinedChatRoomSyner = function () {\n    function JoinedChatRoomSyner(option) {\n      this._rootKey = void 0;\n      this._joinedChatRoomInfos = [];\n      option = option || {};\n      var _option3 = option,\n          appkey = _option3.appkey,\n          userId = _option3.userId;\n      this._rootKey = utils.tplEngine(SESSION_SYNC_CHATROOM.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n    }\n\n    var _proto5 = JoinedChatRoomSyner.prototype;\n\n    _proto5.set = function set(option) {\n      var _this = this;\n\n      var chrmId = option.chrmId,\n          count = option.count,\n          isOpenJoinMulitpleChrmService = option.isOpenJoinMulitpleChrmService;\n      var backupJoinedChatRoomInfos = utils.copy(this._joinedChatRoomInfos);\n\n      if (isOpenJoinMulitpleChrmService) {\n        utils.forEach(backupJoinedChatRoomInfos, function (chrmInfo, index) {\n          if (chrmInfo.chrmId === option.chrmId) {\n            _this._joinedChatRoomInfos.splice(index, 1);\n          }\n        });\n\n        this._joinedChatRoomInfos.push({\n          chrmId: chrmId,\n          count: count\n        });\n      } else {\n        this._joinedChatRoomInfos = [{\n          chrmId: chrmId,\n          count: count\n        }];\n      }\n\n      utils.Session.set(this._rootKey, this._joinedChatRoomInfos);\n    };\n\n    _proto5.get = function get() {\n      if (utils.isEmpty(this._joinedChatRoomInfos)) {\n        return utils.Session.get(this._rootKey) || [];\n      } else {\n        return this._joinedChatRoomInfos;\n      }\n    };\n\n    _proto5.remove = function remove(chrmId) {\n      var joinedChatRoom = utils.isEmpty(this._joinedChatRoomInfos) ? this._joinedChatRoomInfos : utils.Session.get(this._rootKey);\n      if (utils.isEmpty(joinedChatRoom)) return;\n      utils.forEach(joinedChatRoom, function (chrmInfo, index) {\n        if (chrmInfo.chrmId === chrmId) {\n          return joinedChatRoom.splice(index, 1);\n        }\n      });\n      utils.Session.set(this._rootKey, joinedChatRoom);\n    };\n\n    _proto5.clear = function clear() {\n      this._joinedChatRoomInfos = [];\n      utils.Session.remove(this._rootKey);\n    };\n\n    return JoinedChatRoomSyner;\n  }();\n\n  var getUIDByToken = function getUIDByToken(token) {\n    return utils.md5(token).slice(8, 16);\n  };\n\n  var isIncludeNavi = function isIncludeNavi(token) {\n    return utils.isInclude(token, NAVI_SEPARATOR_IN_TOKEN);\n  };\n\n  var getNaviListByToken = function getNaviListByToken(token) {\n    var navDomainList = [];\n\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      var navsText = token.substring(separatorIndex + 1, token.length);\n      var domainList = navsText.split(DOMAIN_SEPARATOR_IN_NAVLIST);\n      utils.forEach(domainList, function (domain) {\n        if (!isEmpty$1(domain)) {\n          navDomainList.push(domain);\n        }\n      });\n    }\n\n    return navDomainList;\n  };\n\n  var getCMPDomainList = function getCMPDomainList(option, customOption) {\n    var server = option.server,\n        backupServer = option.backupServer;\n    server = server || '';\n    backupServer = backupServer || '';\n    var backupCMPList = backupServer.split(DOMAIN_SEPARATOR_IN_CMPLIST);\n    var cmpList = [];\n\n    if (!utils.isEmpty(server)) {\n      cmpList.push(server);\n    }\n\n    utils.forEach(backupCMPList, function (cmp) {\n      if (!utils.isEmpty(cmp)) {\n        cmpList.push(cmp);\n      }\n    });\n\n    if (!utils.isUndefined(customOption.customCMP) && !utils.isEmpty(customOption.customCMP)) {\n      cmpList = customOption.customCMP;\n    }\n\n    return cmpList;\n  };\n\n  var getValidToken = function getValidToken(token) {\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      token = token.substring(0, separatorIndex + 1);\n    }\n\n    return token;\n  };\n\n  var getConnectType = function getConnectType(option) {\n    var connectType = option.connectType;\n    var isSpecifiedSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var isSocket = isSpecifiedSocket && utils.isSupportSocket();\n    return isSocket ? CONNECT_TYPE.WEBSOCKET : CONNECT_TYPE.COMET;\n  };\n\n  var isConnected = function isConnected(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTED);\n  };\n\n  var isConnecting = function isConnecting(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTING);\n  };\n\n  var isDisconnected = function isDisconnected(status) {\n    return !isConnected(status) && !isConnecting(status);\n  };\n\n  var getNavReqOption = function getNavReqOption(option, user) {\n    option = utils.copy(option);\n    option.token = user.token;\n    return option;\n  };\n\n  var getPingTimeout = function getPingTimeout(timeSpentConnect) {\n    var timeout = timeSpentConnect * 3;\n\n    if (timeout < IM_PING_MIN_TIMEOUT) {\n      return IM_PING_MIN_TIMEOUT;\n    }\n\n    if (timeout > IM_PING_MAX_TIMEOUT) {\n      return IM_PING_MAX_TIMEOUT;\n    }\n\n    return timeout;\n  };\n\n  var DelayTimer = {\n    _delayTime: 0,\n    setTime: function setTime(time) {\n      var currentTime = utils.getCurrentTimestamp();\n      DelayTimer._delayTime = currentTime - time;\n    },\n    getTime: function getTime() {\n      var delayTime = DelayTimer._delayTime;\n      var currentTime = utils.getCurrentTimestamp();\n      return currentTime - delayTime;\n    }\n  };\n\n  var isInValidConversationData = function isInValidConversationData(conversation) {\n    return !conversation.type || !conversation.targetId || !utils.isObject(conversation.latestMessage) || utils.isUndefined(conversation.unreadMessageCount);\n  };\n\n  var fixConversationData = function fixConversationData(conversation) {\n    conversation = conversation || {};\n    var _conversation = conversation,\n        targetId = _conversation.targetId,\n        type = _conversation.type;\n    var defaultType = CONVERSATION_TYPE.PRIVATE,\n        defaultId = '',\n        defaultMsg = {\n      messageType: MESSAGE_TYPE.TEXT,\n      sentTime: DelayTimer.getTime(),\n      content: {\n        content: ''\n      },\n      senderUserId: targetId,\n      targetId: targetId,\n      type: type\n    };\n    conversation.type = type || defaultType;\n    conversation.targetId = targetId || defaultId;\n    conversation.latestMessage = conversation.latestMessage || defaultMsg;\n    return conversation;\n  };\n\n  var sortConversationList = function sortConversationList(conversationList) {\n    if (utils.isEmpty(conversationList)) {\n      return [];\n    }\n\n    return utils.quickSort(conversationList, function (before, after) {\n      before = before || {};\n      after = after || {};\n      var beforeLatestMessage = before.latestMessage || {},\n          afterLatestMessage = after.latestMessage || {},\n          beforeLatestSentTime = beforeLatestMessage.sentTime || 0,\n          afterLatestSentTime = afterLatestMessage.sentTime || 0;\n      var flag = false;\n\n      if (before.isTop && !after.isTop) {\n        flag = false;\n      } else if (!before.isTop && after.isTop) {\n        flag = true;\n      } else {\n        flag = afterLatestSentTime <= beforeLatestSentTime;\n      }\n\n      return flag;\n    });\n  };\n\n  var splitConversationListByIsTop = function splitConversationListByIsTop(conversationList) {\n    var topConversationList = [],\n        unToppedConversationList = [];\n    utils.forEach(conversationList, function (conversation) {\n      var hasMentiond = conversation.hasMentiond,\n          mentiondInfo = conversation.mentiondInfo;\n      conversation.hasMentioned = hasMentiond;\n      conversation.mentionedInfo = mentiondInfo;\n      var isTop = conversation.isTop || false;\n\n      if (isTop) {\n        topConversationList.push(conversation);\n      } else {\n        unToppedConversationList.push(conversation);\n      }\n    });\n    return {\n      topConversationList: topConversationList || [],\n      unToppedConversationList: unToppedConversationList || []\n    };\n  };\n\n  var sortConList = function sortConList(conversationList) {\n    if (utils.isEmpty(conversationList)) {\n      return [];\n    }\n\n    var splitConversationList = splitConversationListByIsTop(conversationList);\n\n    var _sortListBySentTime = function _sortListBySentTime(convers) {\n      return utils.quickSort(convers, function (before, after) {\n        before = before || {};\n        after = after || {};\n        var beforeLatestMessage = before.latestMessage || {},\n            afterLatestMessage = after.latestMessage || {},\n            beforeLatestSentTime = beforeLatestMessage.sentTime || 0,\n            afterLatestSentTime = afterLatestMessage.sentTime || 0;\n        return afterLatestSentTime <= beforeLatestSentTime;\n      });\n    };\n\n    var topConversationList = _sortListBySentTime(splitConversationList.topConversationList);\n\n    var unToppedConversationList = _sortListBySentTime(splitConversationList.unToppedConversationList);\n\n    topConversationList.push.apply(topConversationList, unToppedConversationList);\n    return topConversationList;\n  };\n\n  var isSupportStatusMessage = function isSupportStatusMessage(type) {\n    return !!CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n  };\n\n  var getConversationKey = function getConversationKey(option) {\n    var type = option.type,\n        targetId = option.targetId;\n    return type + '_' + targetId;\n  };\n\n  var getConversationByKey = function getConversationByKey(key) {\n    key = key || '';\n    var arr = key.split('_');\n\n    if (arr.length === 2) {\n      return {\n        type: arr[0],\n        targetId: arr[1]\n      };\n    } else {\n      return {\n        type: CONVERSATION_TYPE.PRIVATE,\n        targetId: ''\n      };\n    }\n  };\n\n  var getChatRoomKVOptStatus = function getChatRoomKVOptStatus(entity, action) {\n    var status = 0;\n\n    if (entity.isAutoDelete) {\n      status = status | CHATROOM_KV_STATUS_CODE.AUTO_DELETE;\n    }\n\n    if (entity.isOverwrite) {\n      status = status | CHATROOM_KV_STATUS_CODE.OVERWRITE;\n    }\n\n    if (utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE)) {\n      status = status | CHATROOM_KV_STATUS_CODE.OPERATE;\n    }\n\n    return status;\n  };\n\n  var getChatRoomKVByStatus = function getChatRoomKVByStatus(status) {\n    var isDeleteOpt = !!(status & CHATROOM_KV_STATUS_CODE.OPERATE);\n    return {\n      isAutoDelete: !!(status & CHATROOM_KV_STATUS_CODE.AUTO_DELETE),\n      isOverwrite: !!(status & CHATROOM_KV_STATUS_CODE.OVERWRITE),\n      type: isDeleteOpt ? CHATROOM_ENTRY_TYPE.DELETE : CHATROOM_ENTRY_TYPE.UPDATE\n    };\n  };\n\n  var TextCompressor = {\n    _dataType: {\n      Tail: 0x30,\n      Compressed: 0x40,\n      NormalExt: 0x50,\n      Normal: 0x60,\n      Mark: 0x70\n    },\n    _chars: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n    _scale: 62,\n    _max: 238327,\n    _indexOf: function _indexOf(map, source, fromIndex) {\n      var result = {\n        length: 0,\n        offset: -1\n      };\n\n      if (fromIndex >= source.length - 1) {\n        return result;\n      }\n\n      var c1 = source.charAt(fromIndex);\n      var c2 = source.charAt(fromIndex + 1);\n      var items = map[c1 + c2];\n\n      if (items[0] === fromIndex) {\n        return result;\n      }\n\n      var space1 = source.length - fromIndex;\n\n      for (var i = 0, len = items.length; i < len; i++) {\n        var item = items[i];\n        var space2 = fromIndex - item;\n\n        if (space2 > TextCompressor._max) {\n          continue;\n        }\n\n        var end = Math.min(space1, space2);\n\n        if (end <= result.length) {\n          break;\n        }\n\n        if (result.length > 2) {\n          if (source.charAt(item + result.length - 1) !== source.charAt(fromIndex + result.length - 1)) {\n            continue;\n          }\n        }\n\n        var m = 2;\n\n        for (var j = m; j < end; j++) {\n          if (source.charAt(item + j) === source.charAt(fromIndex + j)) {\n            m++;\n          } else {\n            break;\n          }\n        }\n\n        if (m >= result.length) {\n          result.length = m;\n          result.offset = item;\n        }\n      }\n\n      return result;\n    },\n    _numberEncode: function _numberEncode(num) {\n      var result = [],\n          remainder = 0;\n\n      do {\n        remainder = num % TextCompressor._scale;\n        result.push(TextCompressor._chars.charAt(remainder));\n        num = (num - remainder) / TextCompressor._scale;\n      } while (num > 0);\n\n      return result.join('');\n    },\n    _numberDecode: function _numberDecode(str) {\n      var num = 0,\n          index = 0;\n\n      for (var i = str.length - 1; i >= 0; i--) {\n        index = TextCompressor._chars.indexOf(str.charAt(i));\n\n        if (index === -1) {\n          throw new Error('decode number error, data is \\'' + str + '\\'');\n        }\n\n        num = num * TextCompressor._scale + index;\n      }\n\n      return num;\n    },\n    compress: function compress(data) {\n      var map = {};\n\n      for (var p = 0; p < data.length - 1; p++) {\n        var c1 = data.charAt(p);\n        var c2 = data.charAt(p + 1);\n        var c = c1 + c2;\n\n        if (!map.hasOwnProperty(c)) {\n          map[c] = [p];\n          continue;\n        }\n\n        map[c].push(p);\n      }\n\n      var compressedData = [],\n          normalBlockBuffer = [];\n\n      var encodeNormalBlock = function encodeNormalBlock() {\n        if (normalBlockBuffer.length > 0) {\n          var normalBlock = normalBlockBuffer.join('');\n          normalBlockBuffer = [];\n\n          if (normalBlock.length > 26) {\n            var normalExtBlockLength = TextCompressor._numberEncode(normalBlock.length);\n\n            var normalExtBlockHeader = String.fromCharCode(TextCompressor._dataType.NormalExt | normalExtBlockLength.length);\n            compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n          } else {\n            var normalBlockHeader = String.fromCharCode(TextCompressor._dataType.Normal | normalBlock.length);\n            compressedData.push(normalBlockHeader);\n          }\n\n          compressedData.push(normalBlock);\n        }\n      };\n\n      var i = 0;\n\n      while (i < data.length) {\n        var r = TextCompressor._indexOf(map, data, i);\n\n        if (r.length < 2) {\n          normalBlockBuffer.push(data.charAt(i++));\n          continue;\n        }\n\n        if (r.length < 4) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        var offset = TextCompressor._numberEncode(i - r.offset);\n\n        var length = TextCompressor._numberEncode(r.length);\n\n        if (offset.length + length.length >= r.length) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        encodeNormalBlock();\n        var compressedBlockHeader = String.fromCharCode(TextCompressor._dataType.Compressed | offset.length << 2 | length.length);\n        compressedData.push(compressedBlockHeader + offset + length);\n        i += r.length;\n      }\n\n      encodeNormalBlock();\n\n      var dataLengthTo62 = TextCompressor._numberEncode(data.length);\n\n      var tailBlockHeader = String.fromCharCode(TextCompressor._dataType.Tail | dataLengthTo62.length);\n      compressedData.push(tailBlockHeader + dataLengthTo62);\n      return compressedData.join('');\n    },\n    uncompress: function uncompress(data) {\n      var i = 0;\n      var result = '';\n\n      label1: do {\n        var header = data.charCodeAt(i++);\n        var headerType = header & TextCompressor._dataType.Mark;\n        var headerVal = header & 0xF;\n\n        switch (headerType) {\n          case TextCompressor._dataType.Compressed:\n            var p1 = headerVal >> 2;\n            var p2 = headerVal & 3;\n\n            if (p1 === 0 || p2 === 0) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            var offset = TextCompressor._numberDecode(data.substr(i, p1));\n\n            var len = TextCompressor._numberDecode(data.substr(i += p1, p2));\n\n            offset = result.length - offset;\n\n            if (offset + len > result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += p2;\n            result += result.substr(offset, len);\n            break;\n\n          case TextCompressor._dataType.Tail:\n            var num = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            if (num !== result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += headerVal;\n            break label1;\n\n          case TextCompressor._dataType.NormalExt:\n            var normalNum = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            result += data.substr(i += headerVal, normalNum);\n            i += normalNum;\n            break;\n\n          case TextCompressor._dataType.Normal:\n            result += data.substr(i, headerVal);\n            i += headerVal;\n            break;\n\n          case TextCompressor._dataType.Mark:\n            if (headerVal > 10) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            result += data.substr(i, 16 + headerVal);\n            i += 16 + headerVal;\n            break;\n\n          default:\n            throw new Error('Data parsing error,at ' + i + ' header:' + headerType);\n        }\n      } while (i < data.length);\n\n      return result;\n    }\n  };\n\n  var isBelowIE = function isBelowIE(version) {\n    var system = env.system;\n    var flag = system.model === 'IE' && Number(system.version) < version ? true : false;\n    return flag;\n  };\n\n  var stringToCsv = function stringToCsv(str) {\n    var csvStr = str.replace(/\"/g, '\"\"');\n    var tpl = '\"{csvStr}\"';\n    return tplEngine$1(tpl, {\n      csvStr: csvStr\n    });\n  };\n\n  var getWebSessionId = function getWebSessionId() {\n    var sessionId = utils.Session.get(STORAGE_SESSION_ID_KEY);\n\n    if (utils.isEmpty(sessionId)) {\n      sessionId = utils.getUUID22().slice(0, 10);\n      utils.Session.set(STORAGE_SESSION_ID_KEY, sessionId);\n    }\n\n    return sessionId;\n  };\n\n  var getDeviceId = function getDeviceId() {\n    var deviceId = utils.Storage.get(STORAGE_DEVICE_ID_KEY);\n\n    if (utils.isEmpty(deviceId)) {\n      deviceId = utils.getUUID22();\n      utils.Storage.set(STORAGE_DEVICE_ID_KEY, deviceId);\n    }\n\n    return deviceId;\n  };\n\n  var getDeviceInfo = function getDeviceInfo() {\n    var tpl = '{brower}|{version}|{sessionId}';\n    return tplEngine$1(tpl, {\n      brower: env.system.model,\n      version: env.system.version,\n      sessionId: getWebSessionId()\n    });\n  };\n\n  var getReportLogUrl = function getReportLogUrl(params) {\n    var entireUrl = '',\n        protocol = env.protocol.http + '//';\n    var urlConf = {\n      protocol: protocol,\n      url: params.url,\n      version: SDK_VERSION,\n      appkey: params.appkey,\n      deviceId: getDeviceId(),\n      deviceInfo: getDeviceInfo(),\n      platform: PLATFORM$1,\n      userId: params.userId\n    };\n\n    switch (params.type) {\n      case REPORT_TYPE.REALTIME:\n        entireUrl = tplEngine$1(REALTIME_URL_TPL, urlConf);\n        break;\n\n      case REPORT_TYPE.FULL:\n        entireUrl = tplEngine$1(MSGNOTIF_URL_TPL, utils.extend(urlConf, {\n          logId: params.logId\n        }));\n        break;\n\n      default:\n        break;\n    }\n\n    return entireUrl;\n  };\n\n  var isLogCommandMsg = function isLogCommandMsg(msg) {\n    var content = msg.content;\n    return msg.messageType === MESSAGE_TYPE.LOG_COMMAND && msg.senderUserId === LOG_CMD_MSG_SENDER && content.platform === 'Web';\n  };\n\n  var isValidChatRoomKey = function isValidChatRoomKey(key) {\n    if (!utils.isString(key)) {\n      return;\n    }\n\n    var isValid = /^[A-Za-z0-9_=+-]+$/.test(key),\n        keyLen = key.length,\n        isLimit = keyLen <= CHATROOM_KEY_LENGTH.MAX && keyLen >= CHATROOM_KEY_LENGTH.MIN;\n    return isValid && isLimit;\n  };\n\n  var isValidChatRoomValue = function isValidChatRoomValue(value) {\n    if (!utils.isString(value)) {\n      return;\n    }\n\n    var valLen = value.length;\n    return valLen <= CHATROOM_VALUE_LENGTH.MAX && valLen >= CHATROOM_VALUE_LENGTH.MIN;\n  };\n\n  var genUploadFileName = function genUploadFileName(type, fileName) {\n    var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n    var random = Math.floor(Math.random() * 1000 % 10000);\n    var uuid = utils.getUUID();\n    var fileNameArr, extension;\n\n    if (fileName) {\n      fileNameArr = fileName.split('.');\n      extension = '.' + fileNameArr[fileNameArr.length - 1];\n    }\n\n    return tplEngine$1(tpl, {\n      type: type,\n      date: utils.formateDate('-'),\n      random: random,\n      uuid: uuid,\n      timestamp: DelayTimer.getTime(),\n      extension: extension || ''\n    });\n  };\n\n  var getUploadFileDomains = function getUploadFileDomains(navi) {\n    var uploadServer = navi.uploadServer,\n        bosAddr = navi.bosAddr;\n    return {\n      qiniu: uploadServer,\n      bos: bosAddr\n    };\n  };\n\n  var mergeConversationList = function mergeConversationList(option) {\n    option = option || {};\n    var _option4 = option,\n        conversationList = _option4.conversationList,\n        updatedConversationList = _option4.updatedConversationList;\n    var allConversationList = updatedConversationList.concat(conversationList);\n    var hashTable = {};\n    var newList = [];\n    var invalidDataIndexList = [];\n    utils.forEach(allConversationList, function (conversation) {\n      if (!utils.isObject(conversation)) {\n        return;\n      }\n\n      var key = getConversationKey(conversation),\n          hashItem = hashTable[key] || {},\n          hashIndex = utils.isUndefined(hashItem.index) ? newList.length : hashItem.index,\n          hashVal = hashItem.val || {},\n          cacheUpdatedItems = hashVal.updatedItems || {},\n          updatedItems = conversation.updatedItems || {};\n      conversation = utils.extend(conversation, hashVal);\n      utils.forEach(cacheUpdatedItems, function (item, key) {\n        conversation[key] = item.val;\n      });\n      utils.forEach(updatedItems, function (item, key) {\n        var cacheItem = cacheUpdatedItems[key] || {},\n            cacheItemUpdatedTime = cacheItem.time || 0;\n\n        if (item.time > cacheItemUpdatedTime) {\n          conversation[key] = item.val;\n        }\n      });\n      hashTable[key] = {\n        index: hashIndex,\n        val: conversation\n      };\n      newList[hashIndex] = conversation;\n      isInValidConversationData(conversation) && invalidDataIndexList.push(hashIndex);\n    });\n    utils.forEach(invalidDataIndexList, function (invalidIndex) {\n      var conversation = newList[invalidIndex];\n      newList[invalidIndex] = fixConversationData(conversation);\n    });\n    newList = sortConList(newList);\n    return utils.map(newList, function (item) {\n      delete item.updatedItems;\n      return item;\n    });\n  };\n\n  var common = {\n    isConnected: isConnected,\n    isConnecting: isConnecting,\n    isDisconnected: isDisconnected,\n    getConnectType: getConnectType,\n    getTransporterUrl: getTransporterUrl,\n    isGroup: isGroup,\n    isChatRoom: isChatRoom,\n    getConversationTypeList: getConversationTypeList,\n    isValidConversationType: isValidConversationType,\n    getUIDByToken: getUIDByToken,\n    getSessionId: getSessionId,\n    getMessageOptionByStatus: getMessageOptionByStatus,\n    getPersitedAndCountedBySessionId: getPersitedAndCountedBySessionId,\n    SignalId: SignalId,\n    MessageTimeSyner: MessageTimeSyner,\n    ChatRoomMessageTimeSyner: ChatRoomMessageTimeSyner,\n    JoinedChatRoomSyner: JoinedChatRoomSyner,\n    getCMPDomainList: getCMPDomainList,\n    getNaviListByToken: getNaviListByToken,\n    getValidToken: getValidToken,\n    RCSocket: RCSocket,\n    RCStorage: RCStorage,\n    getNavReqOption: getNavReqOption,\n    getPingTimeout: getPingTimeout,\n    fixConversationData: fixConversationData,\n    sortConversationList: sortConversationList,\n    DelayTimer: DelayTimer,\n    isSupportStatusMessage: isSupportStatusMessage,\n    getConversationKey: getConversationKey,\n    getConversationByKey: getConversationByKey,\n    getChatRoomKVOptStatus: getChatRoomKVOptStatus,\n    getChatRoomKVByStatus: getChatRoomKVByStatus,\n    TextCompressor: TextCompressor,\n    isBelowIE: isBelowIE,\n    getReportLogUrl: getReportLogUrl,\n    isLogCommandMsg: isLogCommandMsg,\n    getWebSessionId: getWebSessionId,\n    getDeviceId: getDeviceId,\n    stringToCsv: stringToCsv,\n    isValidChatRoomKey: isValidChatRoomKey,\n    isValidChatRoomValue: isValidChatRoomValue,\n    genUploadFileName: genUploadFileName,\n    getUploadFileDomains: getUploadFileDomains,\n    mergeConversationList: mergeConversationList,\n    sortConList: sortConList,\n    getPersitedAndCountedAndSlientBySessionId: getPersitedAndCountedAndSlientBySessionId\n  };\n\n  var EventEmitter$1 = utils.EventEmitter,\n      DeferHandler$1 = utils.DeferHandler,\n      Timer$1 = utils.Timer;\n  var RCSocket$1 = common.RCSocket;\n  var TransHandlerID = {\n    CONNECT: 'connect',\n    PING: 'ping'\n  };\n\n  var Heartbeat = function () {\n    function Heartbeat(transporter, option) {\n      this._transporter = void 0;\n      this._timer = void 0;\n      option = option || {};\n      var timeout = option.timeout;\n      this._transporter = transporter;\n      this._timer = new Timer$1({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: timeout\n      });\n    }\n\n    var _proto = Heartbeat.prototype;\n\n    _proto.check = function check(timeout) {\n      var _transporter = this._transporter;\n      var _deferHandler = _transporter._deferHandler;\n      var pingReqSignal = new PingReqWriter();\n\n      _transporter.sendSignal(pingReqSignal);\n\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.PING, {\n          resolve: resolve,\n          reject: reject\n        }, {\n          timeout: timeout\n        });\n      });\n    };\n\n    _proto.start = function start(timeout, onError) {\n      var self = this;\n\n      self._timer.start(function () {\n        self.check(timeout).then(utils.noop)[\"catch\"](onError);\n      });\n    };\n\n    _proto.stop = function stop() {\n      this._timer && this._timer.stop();\n    };\n\n    return Heartbeat;\n  }();\n\n  var SocketTransporter = function () {\n    function SocketTransporter(option) {\n      this._socket = void 0;\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$1();\n      this._deferHandler = new DeferHandler$1();\n      this._heartbeat = new Heartbeat(this, {\n        timeout: IM_PING_INTERVAL_TIME\n      });\n      this._connectedTime = void 0;\n      this._option = option;\n    }\n\n    var _proto2 = SocketTransporter.prototype;\n\n    _proto2._createSocket = function _createSocket(url) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var socket = new RCSocket$1({\n        url: url\n      });\n\n      var onClose = function onClose(event) {\n        event = event || {};\n        var code = event.code || TRANSPORTER_STATUS.CLOSE_ABNORMAL;\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, code);\n\n        self.disconnect();\n      };\n\n      socket.onMessage(function (msg) {\n        var data = msg.data;\n\n        if (!utils.isArrayBuffer(data)) {\n          throw new Error('Error socket signal');\n        }\n\n        var signal = readWSBuffer(data);\n        self.handleSignal(signal);\n      });\n      socket.onError(onClose);\n      socket.onClose(onClose);\n      return socket;\n    };\n\n    _proto2._startHeartbeat = function _startHeartbeat(timeSpentConnect) {\n      var self = this;\n      var _heartbeat = self._heartbeat,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n\n      _heartbeat.check(FIRST_PING_TIMEOUT).then(utils.noop)[\"catch\"](function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT);\n\n        self.disconnect();\n      });\n\n      var pingTimeout = common.getPingTimeout(timeSpentConnect);\n\n      _heartbeat.start(pingTimeout, function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n        self.disconnect();\n      });\n    };\n\n    _proto2._stopHeartbeat = function _stopHeartbeat() {\n      this._heartbeat.stop();\n    };\n\n    _proto2.watchSignal = function watchSignal(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, watcher);\n    };\n\n    _proto2.watchStatus = function watchStatus(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, watcher);\n    };\n\n    _proto2.connect = function connect(user, option) {\n      var self = this;\n      var _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType,\n          _deferHandler = self._deferHandler;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        connectType: connectType,\n        token: token\n      });\n      var timeBeforeConnect = utils.getCurrentTimestamp();\n      self._socket = this._createSocket(url);\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.CONNECT, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (result) {\n        var timeAfterConnect = utils.getCurrentTimestamp();\n        var timeSpentConnect = timeAfterConnect - timeBeforeConnect;\n\n        self._startHeartbeat(timeSpentConnect);\n\n        return result;\n      });\n    };\n\n    _proto2.sendSignal = function sendSignal(writer) {\n      var binary = writer.getBufferData();\n\n      this._socket.send(binary.buffer);\n    };\n\n    _proto2.handleSignal = function handleSignal(signal) {\n      var _transporterEventEmiiter = this._transporterEventEmiiter,\n          _deferHandler = this._deferHandler;\n\n      if (signal instanceof ConnAckReader) {\n        this.handleConnAck(signal);\n      } else if (signal instanceof PingRespReader) {\n        _deferHandler.resolve(TransHandlerID.PING);\n      } else {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n      }\n\n      if (signal && utils.isValidTimestamp(signal.timestamp)) {\n        common.DelayTimer.setTime(signal.timestamp);\n      }\n    };\n\n    _proto2.handleConnAck = function handleConnAck(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var status = signal.status;\n      var isConnected = status === SUCCESS_CODE;\n      var event = isConnected ? _deferHandler.resolve : _deferHandler.reject;\n      event.call(_deferHandler, TransHandlerID.CONNECT, signal);\n\n      if (isConnected) {\n        self._connectedTime = utils.getCurrentTimestamp();\n      }\n    };\n\n    _proto2.disconnect = function disconnect() {\n      this._stopHeartbeat();\n\n      this._socket && this._socket.close();\n    };\n\n    return SocketTransporter;\n  }();\n\n  var logEventEmitter = new utils.EventEmitter();\n  var LogEventName = 'log';\n  var LocalLogPrefix = '[Rong]';\n  var ServerOption = DEFAULT_SERVER_OPTION;\n  var Option = {\n    isDebug: false,\n    isUploadToServer: true,\n    appkey: '',\n    userId: '',\n    isNetworkUnavailable: true\n  };\n  var realTimeUploadHasStarted = false,\n      RealtimeUploadTimes = 1,\n      isRealtimeUploading = false,\n      fullLogId = '';\n\n  var isFirstDefaultUpload = function isFirstDefaultUpload(interval) {\n    return interval === 20000;\n  };\n\n  var getRealtimeUploadInterval = function getRealtimeUploadInterval(uploadTimes) {\n    var realtimeInterval = ServerOption.realtimeInterval;\n    return realtimeInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getFullUploadInterval = function getFullUploadInterval(uploadTimes) {\n    var fullInterval = ServerOption.fullInterval;\n    return fullInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getCSVForLog = function getCSVForLog(log) {\n    log = log || {};\n    var content = log.content || {};\n    utils.forEach(content, function (val, key) {\n      if (utils.isObject(val) || utils.isArray(val)) {\n        content[key] = utils.toJSON(val);\n      }\n    });\n    content = utils.toJSON(content) || '\"\"';\n    content = common.stringToCsv(content);\n    return utils.tplEngine(CSV_LOG_TPL, {\n      sessionId: common.getWebSessionId(),\n      time: log.time,\n      type: log.type,\n      level: log.level,\n      tag: log.tag,\n      content: content\n    });\n  };\n\n  var setServerOption = function setServerOption(serverData) {\n    var logSwitch = serverData.logSwitch,\n        logPolicy = serverData.logPolicy;\n    var isOpen = !!logSwitch;\n    if (utils.isEmpty(serverData)) return;\n    ServerOption.isOpen = isOpen;\n\n    if (!isOpen) {\n      return;\n    }\n\n    var logConf = utils.parseJSON(logPolicy || '') || {};\n    var url = logConf.url,\n        level = logConf.level,\n        itv = logConf.itv,\n        times = logConf.times;\n    utils.extend(ServerOption, {\n      url: url,\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(itv) * 1000,\n      realtimeMaxTimes: Number(times)\n    });\n  };\n\n  var setServerResponseOption = function setServerResponseOption(resText) {\n    var resConf = utils.parseJSON(resText || '');\n    var nextTime = resConf.nextTime,\n        level = resConf.level,\n        logSwitch = resConf.logSwitch;\n    if (utils.isEmpty(resConf)) return;\n    var isOpen = !!logSwitch;\n    ServerOption.isOpen = isOpen;\n    if (!isOpen) return;\n    utils.extend(ServerOption, {\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(nextTime) * 1000\n    });\n  };\n\n  var getLogLevel = function getLogLevel(log) {\n    log = log || {};\n    var _Option = Option,\n        isNetworkUnavailable = _Option.isNetworkUnavailable,\n        _log = log,\n        level = _log.level,\n        isLevelToDegrad = utils.isEqual(level, LEVEL.ERROR) || utils.isEqual(level, LEVEL.WARN);\n\n    if (isNetworkUnavailable && isLevelToDegrad) {\n      log.level = LEVEL.INFO;\n    }\n\n    return log;\n  };\n\n  var LogStore = {\n    _list: [],\n    MaxSize: common.isBelowIE(9) ? STORE_SIZE.LOW : STORE_SIZE.ADVANCED,\n    add: function add(log) {\n      log = getLogLevel(log);\n\n      LogStore._list.push(log);\n\n      var currentSize = LogStore._list.length,\n          maxSize = LogStore.MaxSize;\n\n      if (currentSize > maxSize) {\n        LogStore._list.splice(0, currentSize - maxSize);\n      }\n    },\n    get: function get(option) {\n      var type = option.type,\n          uploadLevel = option.level;\n      var _list = LogStore._list;\n      var uploadList = [];\n      utils.forEach(_list, function (log, index) {\n        var logTime = log.time || 0,\n            logLevel = log.level || LEVEL.DEBUG,\n            isUploadLevel = logLevel <= uploadLevel,\n            fullUploadOption = option.fullUploadOption || {},\n            startTime = fullUploadOption.startTime || 0,\n            endTime = fullUploadOption.endTime || common.DelayTimer.getTime();\n        var isUpload = isUploadLevel;\n\n        switch (type) {\n          case REPORT_TYPE.REALTIME:\n            isUpload = isUpload && !log.isUploaded;\n            isUpload && (LogStore._list[index].isUploaded = true);\n            break;\n\n          case REPORT_TYPE.FULL:\n            isUpload = isUpload && logTime >= startTime && logTime <= endTime;\n            break;\n\n          default:\n        }\n\n        if (isUpload) {\n          uploadList.push(log);\n        }\n      });\n      return uploadList;\n    },\n    clear: function clear() {\n      LogStore._list = [];\n    }\n  };\n\n  var upload = function upload(option) {\n    var url = option.url,\n        logList = option.logList,\n        type = option.type;\n    var requestUrl = common.getReportLogUrl({\n      type: type,\n      appkey: Option.appkey || '',\n      userId: Option.userId || '',\n      url: url || ServerOption.url || DEFAULT_SERVER_OPTION.url,\n      logId: option.logId\n    });\n    var csvLog = '';\n    utils.forEach(logList, function (log) {\n      csvLog += getCSVForLog(log);\n    });\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.REALTIME) {\n      return utils.Defer.reject();\n    }\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.FULL) {\n      csvLog = NO_FULL_LOG;\n    }\n\n    csvLog = common.TextCompressor.compress(csvLog);\n    return utils.request(requestUrl, {\n      method: REQUEST_METHOD.POST,\n      body: csvLog,\n      timeout: REQUEST_TIMEOUT\n    });\n  };\n\n  var uploadRealtime = function uploadRealtime() {\n    if (isRealtimeUploading) {\n      return;\n    }\n\n    var interval = getRealtimeUploadInterval(RealtimeUploadTimes);\n    var realtimeMaxTimes = ServerOption.realtimeMaxTimes,\n        realtimeLevel = ServerOption.realtimeLevel;\n\n    if (RealtimeUploadTimes < realtimeMaxTimes) {\n      RealtimeUploadTimes++;\n    }\n\n    if (isFirstDefaultUpload(interval)) {\n      RealtimeUploadTimes = 1;\n    }\n\n    utils.setTimeout(function () {\n      var logList = LogStore.get({\n        type: REPORT_TYPE.REALTIME,\n        level: realtimeLevel\n      });\n      isRealtimeUploading = true;\n      upload({\n        logList: logList,\n        type: REPORT_TYPE.REALTIME\n      }).then(function (response) {\n        isRealtimeUploading = false;\n        var responseText = response.responseText || '{}';\n        var conf = response.responseText || {};\n        setServerResponseOption(responseText);\n\n        if (ServerOption.isOpen) {\n          RealtimeUploadTimes = utils.isEmpty(conf) ? RealtimeUploadTimes : 1;\n          uploadRealtime();\n        }\n      })[\"catch\"](function () {\n        isRealtimeUploading = false;\n        uploadRealtime();\n      });\n    }, interval);\n  };\n\n  var uploadFull = function uploadFull(uploadTimes, option, connectedTime) {\n    if (!Option.isUploadToServer || env.isMini) {\n      return;\n    }\n\n    uploadTimes = uploadTimes || 0;\n    option = option || {};\n    var _option = option,\n        uri = _option.uri,\n        logId = _option.logId;\n    var isFirst = uploadTimes === 0;\n    var interval = isFirst ? 0 : getFullUploadInterval(uploadTimes);\n    var fullMaxTimes = ServerOption.fullMaxTimes,\n        fullLevel = ServerOption.fullLevel;\n    if (fullLogId === logId) return;\n\n    if (uploadTimes <= fullMaxTimes) {\n      uploadTimes++;\n    } else {\n      return;\n    }\n\n    fullLogId = logId;\n\n    (function (option) {\n      utils.setTimeout(function () {\n        var logList = LogStore.get({\n          type: REPORT_TYPE.FULL,\n          level: fullLevel,\n          fullUploadOption: option\n        });\n        if (logList.length === 0 && Number(option.endTime) < connectedTime) return;\n        upload({\n          logId: logId,\n          url: uri,\n          logList: logList,\n          type: REPORT_TYPE.FULL\n        }).then(function () {})[\"catch\"](function () {\n          uploadFull(uploadTimes, option, connectedTime);\n        });\n      }, interval);\n    })(option);\n  };\n\n  var writeLocalLog = function writeLocalLog(log) {\n    var time = log.time;\n    var formatedTime = utils.formatTime(time);\n    var localLog = LocalLogPrefix + \":\" + formatedTime + \": \" + utils.toJSON(log);\n    logEventEmitter.emit(LogEventName, localLog);\n\n    if (Option.isDebug) {\n      utils.consoleLog(localLog);\n    }\n  };\n\n  var isIgnoreErrorCode = function isIgnoreErrorCode(code) {\n    return utils.indexOf(IGNORE_ERROR_CODE, code) > -1;\n  };\n\n  var Logger = {\n    _events: [],\n    LogStore: LogStore,\n    setOption: function setOption(option) {\n      Option = utils.extend(Option, option);\n    },\n    setServerOption: setServerOption,\n    watchLog: function watchLog(event) {\n      logEventEmitter.on(LogEventName, event);\n\n      Logger._events.push(event);\n    },\n    write: function write(log) {\n      log = log || {};\n      log.tag = log.tag || TAG.L_CRASH_E;\n      log.time = log.time || common.DelayTimer.getTime();\n      log.type = log.type || LOG_TYPE.IM;\n      LogStore.add(log);\n      writeLocalLog(log);\n    },\n    fatal: function fatal(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.FATAL\n      });\n    },\n    error: function error(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.ERROR\n      });\n    },\n    warn: function warn(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.WARN\n      });\n    },\n    info: function info(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.INFO\n      });\n    },\n    debug: function debug(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.DEBUG\n      });\n    },\n    startRealtimeUpload: function startRealtimeUpload() {\n      if (realTimeUploadHasStarted) return;\n\n      if (Option.isUploadToServer && !env.isMini) {\n        uploadRealtime();\n      }\n\n      realTimeUploadHasStarted = true;\n    },\n    resetRealtimeUpload: function resetRealtimeUpload() {\n      RealtimeUploadTimes = 1;\n    },\n    uploadFull: uploadFull,\n    isIgnoreErrorCode: isIgnoreErrorCode\n  };\n\n  var EventEmitter$2 = utils.EventEmitter,\n      DeferHandler$2 = utils.DeferHandler,\n      httpRequest = utils.httpRequest,\n      request$3 = utils.request,\n      Defer$1 = utils.Defer;\n\n  var CometTransporter = function () {\n    function CometTransporter(option) {\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$2();\n      this._deferHandler = new DeferHandler$2();\n      this._pid = utils.encodeURI(utils.getCurrentTimestamp() + Math.random() + '');\n      this._domain = void 0;\n      this._sessionid = void 0;\n      this._xhrCache = new utils.Cache();\n      this._pullSignalTimer = new utils.Timer({\n        timeout: IM_COMET_PULLMSG_TIMEOUT\n      });\n      this._isDisconnected = true;\n      this._option = option;\n    }\n\n    var _proto = CometTransporter.prototype;\n\n    _proto._startPullSignal = function _startPullSignal() {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid,\n          _transporterEventEmiiter = self._transporterEventEmiiter,\n          _pullSignalTimer = self._pullSignalTimer;\n      var timestamp = utils.getCurrentTimestamp();\n      var protocol = env.protocol.http;\n      var url = utils.tplEngine(COMET_PULL_URL_TPL, {\n        protocol: protocol,\n        timestamp: timestamp,\n        domain: _domain,\n        sessionId: _sessionid,\n        pid: _pid\n      });\n      var xhr = httpRequest({\n        url: url,\n        body: {\n          pid: _pid\n        },\n        timeout: IM_COMET_PULLMSG_TIMEOUT,\n        success: function success(responseText) {\n          _pullSignalTimer.stop();\n\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (isSuccess) {\n            !self._isDisconnected && self._startPullSignal();\n          } else if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        },\n        fail: function fail() {\n          _pullSignalTimer.stop();\n\n          if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        }\n      });\n\n      _pullSignalTimer.start(function () {\n        if (!self._isDisconnected) {\n          _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n          self.disconnect();\n        }\n      });\n\n      self._xhrCache.set(url, xhr);\n    };\n\n    _proto.watchSignal = function watchSignal(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, event);\n    };\n\n    _proto.watchStatus = function watchStatus(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, function (status) {\n        event && event(status);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _pid = self._pid,\n          _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        token: token,\n        connectType: connectType\n      });\n      self._domain = domain;\n      self._isDisconnected = false;\n\n      var success = function success(_ref) {\n        var responseText = _ref.responseText;\n\n        if (!utils.isValidJSON(responseText)) {\n          return Defer$1.reject();\n        }\n\n        var response = utils.isObject(responseText) ? responseText : utils.parseJSON(responseText);\n        var isConnectSuccess = utils.isEqual(response.status, SUCCESS_CODE);\n\n        if (isConnectSuccess && utils.isObject(response) && utils.isValidTimestamp(response.timestamp)) {\n          common.DelayTimer.setTime(response.timestamp);\n        }\n\n        return isConnectSuccess ? Defer$1.resolve(response) : Defer$1.reject(response);\n      };\n\n      return request$3(url, {\n        body: {\n          pid: _pid\n        }\n      }).then(success).then(function (response) {\n        self._sessionid = response.sessionid;\n\n        self._startPullSignal();\n\n        return response;\n      });\n    };\n\n    _proto.sendSignal = function sendSignal(writer) {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid;\n      var messageId = writer.messageId,\n          topic = writer.topic,\n          targetId = writer.targetId;\n      var headerCode = writer.getHeaderFlag();\n      var protocol = env.protocol.http;\n      var TPL = topic ? COMET_REQ_HAS_TOPIC_URL_TPL : COMET_REQ_NO_TOPIC_URL_TPL;\n      var url = utils.tplEngine(TPL, {\n        protocol: protocol,\n        messageId: messageId,\n        headerCode: headerCode,\n        topic: topic,\n        targetId: targetId,\n        pid: _pid,\n        sessionId: _sessionid,\n        domain: _domain\n      });\n      var currentTime = utils.getCurrentTimestamp() + '';\n      var xhr = httpRequest({\n        url: url,\n        method: REQUEST_METHOD.POST,\n        body: writer.getCometData(),\n        success: function success(responseText) {\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (!isSuccess) {\n            self.handleError(messageId);\n          }\n\n          self._xhrCache.remove(currentTime);\n        },\n        fail: function fail(error) {\n          self.handleError(messageId);\n\n          self._xhrCache.remove(currentTime);\n\n          Logger.error(TAG.L_COMET_SEND_SIGNAL_E, {\n            content: {\n              info: 'comet error',\n              error: error\n            }\n          });\n        }\n      });\n\n      self._xhrCache.set(currentTime, xhr);\n    };\n\n    _proto.handleCometResponse = function handleCometResponse(responseText) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var response = utils.isString(responseText) ? utils.parseJSON(responseText) : responseText;\n\n      if (!response) {\n        return false;\n      }\n\n      if (!response || !utils.isArray(response)) {\n        return true;\n      }\n\n      utils.forEach(response, function (data) {\n        var sessionid = data.sessionid;\n\n        if (sessionid) {\n          self._sessionid = sessionid;\n        }\n\n        var signal = readCometData(data);\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n\n        if (signal && utils.isValidTimestamp(signal.timestamp)) {\n          common.DelayTimer.setTime(signal.timestamp);\n        }\n      });\n      return true;\n    };\n\n    _proto.handleError = function handleError(messageId, status) {\n      var signal = {\n        messageId: messageId,\n        status: status || ERROR_CODE.TIMEOUT\n      };\n\n      this._transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n    };\n\n    _proto.disconnect = function disconnect() {\n      var self = this;\n      self._isDisconnected = true;\n      var _xhrCache = self._xhrCache,\n          _pullSignalTimer = self._pullSignalTimer;\n\n      var xhrKeys = _xhrCache.getKeys();\n\n      _pullSignalTimer.stop();\n\n      utils.forEach(xhrKeys, function (key) {\n        var xhr = _xhrCache.get(key);\n\n        xhr.abort();\n\n        _xhrCache.remove(key);\n      });\n    };\n\n    return CometTransporter;\n  }();\n\n  var Transporter = (function (option) {\n    var connectType = option.connectType;\n    var isSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var Transporter = isSocket ? SocketTransporter : CometTransporter;\n    return new Transporter(option);\n  });\n\n  var PBName = {\n    UpStreamMessage: 'UpStreamMessage',\n    DownStreamMessage: 'DownStreamMessage',\n    DownStreamMessages: 'DownStreamMessages',\n    SessionsAttQryInput: 'SessionsAttQryInput',\n    SessionsAttOutput: 'SessionsAttOutput',\n    SyncRequestMsg: 'SyncRequestMsg',\n    ChrmPullMsg: 'ChrmPullMsg',\n    NotifyMsg: 'NotifyMsg',\n    HistoryMsgInput: 'HistoryMsgInput',\n    HistoryMsgOuput: 'HistoryMsgOuput',\n    RelationQryInput: 'RelationQryInput',\n    RelationsOutput: 'RelationsOutput',\n    DeleteSessionsInput: 'DeleteSessionsInput',\n    SessionInfo: 'SessionInfo',\n    DeleteSessionsOutput: 'DeleteSessionsOutput',\n    RelationsInput: 'RelationsInput',\n    DeleteMsgInput: 'DeleteMsgInput',\n    CleanHisMsgInput: 'CleanHisMsgInput',\n    SessionMsgReadInput: 'SessionMsgReadInput',\n    ChrmInput: 'ChrmInput',\n    QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n    QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n    RtcInput: 'RtcInput',\n    RtcUserListOutput: 'RtcUserListOutput',\n    SetUserStatusInput: 'SetUserStatusInput',\n    RtcSetDataInput: 'RtcSetDataInput',\n    RtcUserSetDataInput: 'RtcUserSetDataInput',\n    RtcDataInput: 'RtcDataInput',\n    RtcSetOutDataInput: 'RtcSetOutDataInput',\n    MCFollowInput: 'MCFollowInput',\n    RtcTokenOutput: 'RtcTokenOutput',\n    RtcQryOutput: 'RtcQryOutput',\n    RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n    RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n    RtcQueryListInput: 'RtcQueryListInput',\n    RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n    RtcValueInfo: 'RtcValueInfo',\n    RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n    GetQNupTokenInput: 'GetQNupTokenInput',\n    GetQNupTokenOutput: 'GetQNupTokenOutput',\n    GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n    GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput',\n    SetChrmKV: 'SetChrmKV',\n    ChrmKVOutput: 'ChrmKVOutput',\n    QueryChrmKV: 'QueryChrmKV',\n    ChrmNotifyMsg: 'ChrmNotifyMsg',\n    SetUserSettingInput: 'SetUserSettingInput',\n    SetUserSettingOutput: 'SetUserSettingOutput',\n    PullUserSettingInput: 'PullUserSettingInput',\n    PullUserSettingOutput: 'PullUserSettingOutput',\n    UserSettingNotification: 'UserSettingNotification',\n    SessionReq: 'SessionReq',\n    SessionStates: 'SessionStates',\n    SessionState: 'SessionState',\n    SessionStateItem: 'SessionStateItem',\n    SessionStateModifyReq: 'SessionStateModifyReq',\n    SessionStateModifyResp: 'SessionStateModifyResp'\n  };\n\n  var _SSMsg;\n  var SSMsg = (_SSMsg = {}, _SSMsg[PBName.UpStreamMessage] = ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData'], _SSMsg[PBName.DownStreamMessages] = ['list', 'syncTime', 'finished'], _SSMsg[PBName.DownStreamMessage] = ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId'], _SSMsg[PBName.SessionsAttQryInput] = ['nothing'], _SSMsg[PBName.SessionsAttOutput] = ['inboxTime', 'sendboxTime', 'totalUnreadCount'], _SSMsg[PBName.SyncRequestMsg] = ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'], _SSMsg[PBName.ChrmPullMsg] = ['syncTime', 'count'], _SSMsg[PBName.NotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.HistoryMsgInput] = ['targetId', 'time', 'count', 'order'], _SSMsg[PBName.HistoryMsgOuput] = ['list', 'syncTime', 'hasMsg'], _SSMsg[PBName.RelationQryInput] = ['type', 'count', 'startTime', 'order'], _SSMsg[PBName.RelationsOutput] = ['info'], _SSMsg[PBName.DeleteSessionsInput] = ['sessions'], _SSMsg[PBName.SessionInfo] = ['type', 'channelId'], _SSMsg[PBName.DeleteSessionsOutput] = ['nothing'], _SSMsg[PBName.RelationsInput] = ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'], _SSMsg[PBName.DeleteMsgInput] = ['type', 'conversationId', 'msgs'], _SSMsg[PBName.CleanHisMsgInput] = ['targetId', 'dataTime', 'conversationType'], _SSMsg[PBName.SessionMsgReadInput] = ['type', 'msgTime', 'channelId'], _SSMsg[PBName.ChrmInput] = ['nothing'], _SSMsg[PBName.QueryChatRoomInfoInput] = ['count', 'order'], _SSMsg[PBName.QueryChatRoomInfoOutput] = ['userTotalNums', 'userInfos'], _SSMsg[PBName.GetQNupTokenInput] = ['type'], _SSMsg[PBName.GetQNdownloadUrlInput] = ['type', 'key', 'fileName'], _SSMsg[PBName.GetQNupTokenOutput] = ['deadline', 'token'], _SSMsg[PBName.GetQNdownloadUrlOutput] = ['downloadUrl'], _SSMsg[PBName.SetChrmKV] = ['entry', 'bNotify', 'notification', 'type'], _SSMsg[PBName.ChrmKVOutput] = ['entries', 'bFullUpdate', 'syncTime'], _SSMsg[PBName.QueryChrmKV] = ['timestamp'], _SSMsg[PBName.ChrmNotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.SetUserSettingInput] = ['version', 'value'], _SSMsg[PBName.SetUserSettingOutput] = ['version', 'reserve'], _SSMsg[PBName.PullUserSettingInput] = ['version', 'reserve'], _SSMsg[PBName.PullUserSettingOutput] = ['items', 'version'], _SSMsg);\n\n  var Codec = {};\n  utils.forEach(SSMsg, function (paramList, name) {\n    Codec[name] = function () {};\n\n    Codec[name].prototype.data = {};\n\n    Codec[name].prototype.getData = function () {\n      return this.data;\n    };\n\n    utils.forEach(paramList, function (param) {\n      var setEventName = 'set' + utils.toUpperCase(param, 0, 1);\n\n      Codec[name].prototype[setEventName] = function (item) {\n        this.data[param] = item;\n      };\n    });\n\n    Codec[name].decode = function (data) {\n      var decodeResult = {};\n\n      if (utils.isString(data)) {\n        data = utils.parseJSON(data);\n      }\n\n      var _loop = function _loop(key) {\n        var getEventName = 'get' + utils.toUpperCase(key, 0, 1);\n        decodeResult[key] = data[key];\n\n        decodeResult[getEventName] = function () {\n          return data[key];\n        };\n      };\n\n      for (var key in data) {\n        _loop(key);\n      }\n\n      return decodeResult;\n    };\n  });\n\n  Codec.getModule = function (pbName) {\n    var modules = new Codec[pbName]();\n\n    modules.getArrayData = function () {\n      return modules.getData();\n    };\n\n    return modules;\n  };\n\n  function protobuf(a){var b=void 0,c=function(){function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c;}function b(a){return (a&&a.__isLong__)===!0}function e(a,b){var e,f,h;return b?(a>>>=0,(h=a>=0&&256>a)&&(f=d[a])?f:(e=g(a,0>(0|a)?-1:0,!0),h&&(d[a]=e),e)):(a|=0,(h=a>=-128&&128>a)&&(f=c[a])?f:(e=g(a,0>a?-1:0,!1),h&&(c[a]=e),e))}function f(a,b){if(isNaN(a)||!isFinite(a))return b?r:q;if(b){if(0>a)return r;if(a>=n)return w}else{if(-o>=a)return x;if(a+1>=o)return v}return 0>a?f(-a,b).neg():g(0|a%m,0|a/m,b)}function g(b,c,d){return new a(b,c,d)}function i(a,b,c){var d,e,g,j,k,l,m;if(0===a.length)throw Error(\"empty string\");if(\"NaN\"===a||\"Infinity\"===a||\"+Infinity\"===a||\"-Infinity\"===a)return q;if(\"number\"==typeof b?(c=b,b=!1):b=!!b,c=c||10,2>c||c>36)throw RangeError(\"radix\");if((d=a.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===d)return i(a.substring(1),b,c).neg();for(e=f(h(c,8)),g=q,j=0;j<a.length;j+=8)k=Math.min(8,a.length-j),l=parseInt(a.substring(j,j+k),c),8>k?(m=f(h(c,k)),g=g.mul(m).add(f(l))):(g=g.mul(e),g=g.add(f(l)));return g.unsigned=b,g}function j(b){return b instanceof a?b:\"number\"==typeof b?f(b):\"string\"==typeof b?i(b):g(b.low,b.high,b.unsigned)}var c,d,h,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return Object.defineProperty(a.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b,c={},d={},a.fromInt=e,a.fromNumber=f,a.fromBits=g,h=Math.pow,a.fromString=i,a.fromValue=j,k=65536,l=1<<24,m=k*k,n=m*m,o=n/2,p=e(l),q=e(0),a.ZERO=q,r=e(0,!0),a.UZERO=r,s=e(1),a.ONE=s,t=e(1,!0),a.UONE=t,u=e(-1),a.NEG_ONE=u,v=g(-1,2147483647,!1),a.MAX_VALUE=v,w=g(-1,-1,!0),a.MAX_UNSIGNED_VALUE=w,x=g(0,-2147483648,!1),a.MIN_VALUE=x,y=a.prototype,y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},y.toString=function(a){var b,c,d,e,g,i,j,k,l;if(a=a||10,2>a||a>36)throw RangeError(\"radix\");if(this.isZero())return \"0\";if(this.isNegative())return this.eq(x)?(b=f(a),c=this.div(b),d=c.mul(b).sub(this),c.toString(a)+d.toInt().toString(a)):\"-\"+this.neg().toString(a);for(e=f(h(a,6),this.unsigned),g=this,i=\"\";;){if(j=g.div(e),k=g.sub(j.mul(e)).toInt()>>>0,l=k.toString(a),g=j,g.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i;}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var a,b;if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return !this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1===(1&this.low)},y.isEven=function(){return 0===(1&this.low)},y.equals=function(a){return b(a)||(a=j(a)),this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low},y.eq=y.equals,y.notEquals=function(a){return !this.eq(a)},y.neq=y.notEquals,y.lessThan=function(a){return this.comp(a)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(a){return this.comp(a)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(a){return this.comp(a)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(a){return this.comp(a)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(a){if(b(a)||(a=j(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return !this.unsigned&&this.eq(x)?x:this.not().add(s)},y.neg=y.negate,y.add=function(a){var c,d,e,f,h,i,k,l,m,n,o,p;return b(a)||(a=j(a)),c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,h=a.high>>>16,i=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0,p+=f+l,o+=p>>>16,p&=65535,o+=e+k,n+=o>>>16,o&=65535,n+=d+i,m+=n>>>16,n&=65535,m+=c+h,m&=65535,g(o<<16|p,m<<16|n,this.unsigned)},y.subtract=function(a){return b(a)||(a=j(a)),this.add(a.neg())},y.sub=y.subtract,y.multiply=function(a){var c,d,e,h,i,k,l,m,n,o,r,s;return this.isZero()?q:(b(a)||(a=j(a)),a.isZero()?q:this.eq(x)?a.isOdd()?x:q:a.eq(x)?this.isOdd()?x:q:this.isNegative()?a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg():a.isNegative()?this.mul(a.neg()).neg():this.lt(p)&&a.lt(p)?f(this.toNumber()*a.toNumber(),this.unsigned):(c=this.high>>>16,d=65535&this.high,e=this.low>>>16,h=65535&this.low,i=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,o=0,r=0,s=0,s+=h*m,r+=s>>>16,s&=65535,r+=e*m,o+=r>>>16,r&=65535,r+=h*l,o+=r>>>16,r&=65535,o+=d*m,n+=o>>>16,o&=65535,o+=e*l,n+=o>>>16,o&=65535,o+=h*k,n+=o>>>16,o&=65535,n+=c*m+d*l+e*k+h*i,n&=65535,g(r<<16|s,n<<16|o,this.unsigned)))},y.mul=y.multiply,y.divide=function(a){var c,d,e,g,i,k,l,m;if(b(a)||(a=j(a)),a.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?r:q;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return r;if(a.gt(this.shru(1)))return t;e=r;}else{if(this.eq(x))return a.eq(s)||a.eq(u)?x:a.eq(x)?s:(g=this.shr(1),c=g.div(a).shl(1),c.eq(q)?a.isNegative()?s:u:(d=this.sub(a.mul(c)),e=c.add(d.div(a))));if(a.eq(x))return this.unsigned?r:q;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();e=q;}for(d=this;d.gte(a);){for(c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),i=Math.ceil(Math.log(c)/Math.LN2),k=48>=i?1:h(2,i-48),l=f(c),m=l.mul(a);m.isNegative()||m.gt(d);)c-=k,l=f(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=s),e=e.add(l),d=d.sub(m);}return e},y.div=y.divide,y.modulo=function(a){return b(a)||(a=j(a)),this.sub(this.div(a).mul(a))},y.mod=y.modulo,y.not=function(){return g(~this.low,~this.high,this.unsigned)},y.and=function(a){return b(a)||(a=j(a)),g(this.low&a.low,this.high&a.high,this.unsigned)},y.or=function(a){return b(a)||(a=j(a)),g(this.low|a.low,this.high|a.high,this.unsigned)},y.xor=function(a){return b(a)||(a=j(a)),g(this.low^a.low,this.high^a.high,this.unsigned)},y.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):g(0,this.low<<a-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):g(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(a){var c,d;return b(a)&&(a=a.toInt()),a&=63,0===a?this:(c=this.high,32>a?(d=this.low,g(d>>>a|c<<32-a,c>>>a,this.unsigned)):32===a?g(c,0,this.unsigned):g(c>>>a-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},y.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var a=this.high,b=this.low;return [255&b,255&b>>>8,255&b>>>16,255&b>>>24,255&a,255&a>>>8,255&a>>>16,255&a>>>24]},y.toBytesBE=function(){var a=this.high,b=this.low;return [255&a>>>24,255&a>>>16,255&a>>>8,255&a,255&b>>>24,255&b>>>16,255&b>>>8,255&b]},a}(),d=function(a){function f(a){var b=0;return function(){return b<a.length?a.charCodeAt(b++):null}}function g(){var a=[],b=[];return function(){return 0===arguments.length?b.join(\"\")+e.apply(String,a):(a.length+arguments.length>1024&&(b.push(e.apply(String,a)),a.length=0),Array.prototype.push.apply(a,arguments),void 0)}}function h(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j;}return (n?-1:1)*g*Math.pow(2,f-d)}function i(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p;}var c,d,e,j,k,b=function(a,c,e){if(\"undefined\"==typeof a&&(a=b.DEFAULT_CAPACITY),\"undefined\"==typeof c&&(c=b.DEFAULT_ENDIAN),\"undefined\"==typeof e&&(e=b.DEFAULT_NOASSERT),!e){if(a=0|a,0>a)throw RangeError(\"Illegal capacity\");c=!!c,e=!!e;}this.buffer=0===a?d:new ArrayBuffer(a),this.view=0===a?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=a,this.littleEndian=c,this.noAssert=e;};return b.VERSION=\"5.0.1\",b.LITTLE_ENDIAN=!0,b.BIG_ENDIAN=!1,b.DEFAULT_CAPACITY=16,b.DEFAULT_ENDIAN=b.BIG_ENDIAN,b.DEFAULT_NOASSERT=!1,b.Long=a||null,c=b.prototype,c.__isByteBuffer__,Object.defineProperty(c,\"__isByteBuffer__\",{value:!0,enumerable:!1,configurable:!1}),d=new ArrayBuffer(0),e=String.fromCharCode,b.accessor=function(){return Uint8Array},b.allocate=function(a,c,d){return new b(a,c,d)},b.concat=function(a,c,d,e){var f,i,g,h,k,j;for((\"boolean\"==typeof c||\"string\"!=typeof c)&&(e=d,d=c,c=void 0),f=0,g=0,h=a.length;h>g;++g)b.isByteBuffer(a[g])||(a[g]=b.wrap(a[g],c)),i=a[g].limit-a[g].offset,i>0&&(f+=i);if(0===f)return new b(0,d,e);for(j=new b(f,d,e),g=0;h>g;)k=a[g++],i=k.limit-k.offset,0>=i||(j.view.set(k.view.subarray(k.offset,k.limit),j.offset),j.offset+=i);return j.limit=j.offset,j.offset=0,j},b.isByteBuffer=function(a){return (a&&a.__isByteBuffer__)===!0},b.type=function(){return ArrayBuffer},b.wrap=function(a,d,e,f){var g,h;if(\"string\"!=typeof d&&(f=e,e=d,d=void 0),\"string\"==typeof a)switch(\"undefined\"==typeof d&&(d=\"utf8\"),d){case\"base64\":return b.fromBase64(a,e);case\"hex\":return b.fromHex(a,e);case\"binary\":return b.fromBinary(a,e);case\"utf8\":return b.fromUTF8(a,e);case\"debug\":return b.fromDebug(a,e);default:throw Error(\"Unsupported encoding: \"+d)}if(null===a||\"object\"!=typeof a)throw TypeError(\"Illegal buffer\");if(b.isByteBuffer(a))return g=c.clone.call(a),g.markedOffset=-1,g;if(a instanceof Uint8Array)g=new b(0,e,f),a.length>0&&(g.buffer=a.buffer,g.offset=a.byteOffset,g.limit=a.byteOffset+a.byteLength,g.view=new Uint8Array(a.buffer));else if(a instanceof ArrayBuffer)g=new b(0,e,f),a.byteLength>0&&(g.buffer=a,g.offset=0,g.limit=a.byteLength,g.view=a.byteLength>0?new Uint8Array(a):null);else{if(\"[object Array]\"!==Object.prototype.toString.call(a))throw TypeError(\"Illegal buffer\");for(g=new b(a.length,e,f),g.limit=a.length,h=0;h<a.length;++h)g.view[h]=a[h];}return g},c.writeBitSet=function(a,b){var h,d,e,f,g,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(!(a instanceof Array))throw TypeError(\"Illegal BitSet: Not an array\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(d=b,e=a.length,f=e>>3,g=0,b+=this.writeVarint32(e,b);f--;)h=1&!!a[g++]|(1&!!a[g++])<<1|(1&!!a[g++])<<2|(1&!!a[g++])<<3|(1&!!a[g++])<<4|(1&!!a[g++])<<5|(1&!!a[g++])<<6|(1&!!a[g++])<<7,this.writeByte(h,b++);if(e>g){for(i=0,h=0;e>g;)h|=(1&!!a[g++])<<i++;this.writeByte(h,b++);}return c?(this.offset=b,this):b-d},c.readBitSet=function(a){var h,c,d,e,f,g,i,b=\"undefined\"==typeof a;for(b&&(a=this.offset),c=this.readVarint32(a),d=c.value,e=d>>3,f=0,g=[],a+=c.length;e--;)h=this.readByte(a++),g[f++]=!!(1&h),g[f++]=!!(2&h),g[f++]=!!(4&h),g[f++]=!!(8&h),g[f++]=!!(16&h),g[f++]=!!(32&h),g[f++]=!!(64&h),g[f++]=!!(128&h);if(d>f)for(i=0,h=this.readByte(a++);d>f;)g[f++]=!!(1&h>>i++);return b&&(this.offset=a),g},c.readBytes=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+a+\") <= \"+this.buffer.byteLength)}return d=this.slice(b,b+a),c&&(this.offset+=a),d},c.writeBytes=c.append,c.writeInt8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeByte=c.writeInt8,c.readInt8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],128===(128&c)&&(c=-(255-c+1)),b&&(this.offset+=1),c},c.readByte=c.readInt8,c.writeUint8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeUInt8=c.writeUint8,c.readUint8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],b&&(this.offset+=1),c},c.readUInt8=c.readUint8,c.writeInt16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeShort=c.writeInt16,c.readInt16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),32768===(32768&c)&&(c=-(65535-c+1)),b&&(this.offset+=2),c},c.readShort=c.readInt16,c.writeUint16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeUInt16=c.writeUint16,c.readUint16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),b&&(this.offset+=2),c},c.readUInt16=c.readUint16,c.writeInt32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeInt=c.writeInt32,c.readInt32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),c|=0,b&&(this.offset+=4),c},c.readInt=c.readInt32,c.writeUint32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeUInt32=c.writeUint32,c.readUint32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),b&&(this.offset+=4),c},c.readUInt32=c.readUint32,a&&(c.writeInt64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeLong=c.writeInt64,c.readInt64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!1),c&&(this.offset+=8),f},c.readLong=c.readInt64,c.writeUint64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeUInt64=c.writeUint64,c.readUint64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!0),c&&(this.offset+=8),f},c.readUInt64=c.readUint64),c.writeFloat32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,i(this.view,a,b,this.littleEndian,23,4),c&&(this.offset+=4),this},c.writeFloat=c.writeFloat32,c.readFloat32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,23,4),b&&(this.offset+=4),c},c.readFloat=c.readFloat32,c.writeFloat64=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=8,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=8,i(this.view,a,b,this.littleEndian,52,8),c&&(this.offset+=8),this},c.writeDouble=c.writeFloat64,c.readFloat64=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,52,8),b&&(this.offset+=8),c},c.readDouble=c.readFloat64,b.MAX_VARINT32_BYTES=5,b.calculateVarint32=function(a){return a>>>=0,128>a?1:16384>a?2:1<<21>a?3:1<<28>a?4:5},b.zigZagEncode32=function(a){return ((a|=0)<<1^a>>31)>>>0},b.zigZagDecode32=function(a){return 0|a>>>1^-(1&a)},c.writeVarint32=function(a,c){var f,e,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(e=b.calculateVarint32(a),c+=e,g=this.buffer.byteLength,c>g&&this.resize((g*=2)>c?g:c),c-=e,a>>>=0;a>=128;)f=128|127&a,this.view[c++]=f,a>>>=7;return this.view[c++]=a,d?(this.offset=c,this):e},c.writeVarint32ZigZag=function(a,c){return this.writeVarint32(b.zigZagEncode32(a),c)},c.readVarint32=function(a){var e,c,d,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}c=0,d=0;do{if(!this.noAssert&&a>this.limit)throw f=Error(\"Truncated\"),f.truncated=!0,f;e=this.view[a++],5>c&&(d|=(127&e)<<7*c),++c;}while(0!==(128&e));return d|=0,b?(this.offset=a,d):{value:d,length:c}},c.readVarint32ZigZag=function(a){var c=this.readVarint32(a);return \"object\"==typeof c?c.value=b.zigZagDecode32(c.value):c=b.zigZagDecode32(c),c},a&&(b.MAX_VARINT64_BYTES=10,b.calculateVarint64=function(b){\"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b));var c=b.toInt()>>>0,d=b.shiftRightUnsigned(28).toInt()>>>0,e=b.shiftRightUnsigned(56).toInt()>>>0;return 0==e?0==d?16384>c?128>c?1:2:1<<21>c?3:4:16384>d?128>d?5:6:1<<21>d?7:8:128>e?9:10},b.zigZagEncode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned()},b.zigZagDecode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned()},c.writeVarint64=function(c,d){var f,g,h,i,j,e=\"undefined\"==typeof d;if(e&&(d=this.offset),!this.noAssert){if(\"number\"==typeof c)c=a.fromNumber(c);else if(\"string\"==typeof c)c=a.fromString(c);else if(!(c&&c instanceof a))throw TypeError(\"Illegal value: \"+c+\" (not an integer or Long)\");if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}switch(\"number\"==typeof c?c=a.fromNumber(c,!1):\"string\"==typeof c?c=a.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),f=b.calculateVarint64(c),g=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,i=c.shiftRightUnsigned(56).toInt()>>>0,d+=f,j=this.buffer.byteLength,d>j&&this.resize((j*=2)>d?j:d),d-=f,f){case 10:this.view[d+9]=1&i>>>7;case 9:this.view[d+8]=9!==f?128|i:127&i;case 8:this.view[d+7]=8!==f?128|h>>>21:127&h>>>21;case 7:this.view[d+6]=7!==f?128|h>>>14:127&h>>>14;case 6:this.view[d+5]=6!==f?128|h>>>7:127&h>>>7;case 5:this.view[d+4]=5!==f?128|h:127&h;case 4:this.view[d+3]=4!==f?128|g>>>21:127&g>>>21;case 3:this.view[d+2]=3!==f?128|g>>>14:127&g>>>14;case 2:this.view[d+1]=2!==f?128|g>>>7:127&g>>>7;case 1:this.view[d]=1!==f?128|g:127&g;}return e?(this.offset+=f,this):f},c.writeVarint64ZigZag=function(a,c){return this.writeVarint64(b.zigZagEncode64(a),c)},c.readVarint64=function(b){var d,e,f,g,h,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+1+\") <= \"+this.buffer.byteLength)}if(d=b,e=0,f=0,g=0,h=0,h=this.view[b++],e=127&h,128&h&&(h=this.view[b++],e|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g|=(127&h)<<7,128&h||this.noAssert&&\"undefined\"==typeof h))))))))))throw Error(\"Buffer overrun\");return i=a.fromBits(e|f<<28,f>>>4|g<<24,!1),c?(this.offset=b,i):{value:i,length:b-d}},c.readVarint64ZigZag=function(c){var d=this.readVarint64(c);return d&&d.value instanceof a?d.value=b.zigZagDecode64(d.value):d=b.zigZagDecode64(d),d}),c.writeCString=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),e=a.length,!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");for(d=0;e>d;++d)if(0===a.charCodeAt(d))throw RangeError(\"Illegal str: Contains NULL-characters\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=k.calculateUTF16asUTF8(f(a))[1],b+=e+1,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=e+1,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),this.view[b++]=0,c?(this.offset=b,this):e},c.readCString=function(a){var c,e,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=a,f=-1,k.decodeUTF8toUTF16(function(){if(0===f)return null;if(a>=this.limit)throw RangeError(\"Illegal range: Truncated data, \"+a+\" < \"+this.limit);return f=this.view[a++],0===f?null:f}.bind(this),e=g(),!0),b?(this.offset=a,e()):{string:e(),length:a-c}},c.writeIString=function(a,b){var e,d,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(d=b,e=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],b+=4+e,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=4+e,this.littleEndian?(this.view[b+3]=255&e>>>24,this.view[b+2]=255&e>>>16,this.view[b+1]=255&e>>>8,this.view[b]=255&e):(this.view[b]=255&e>>>24,this.view[b+1]=255&e>>>16,this.view[b+2]=255&e>>>8,this.view[b+3]=255&e),b+=4,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),b!==d+4+e)throw RangeError(\"Illegal range: Truncated data, \"+b+\" == \"+(b+4+e));return c?(this.offset=b,this):b-d},c.readIString=function(a){var d,e,f,c=\"undefined\"==typeof a;\n  if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readUint32(a),f=this.readUTF8String(e,b.METRICS_BYTES,a+=4),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},b.METRICS_CHARS=\"c\",b.METRICS_BYTES=\"b\",c.writeUTF8String=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=b,d=k.calculateUTF16asUTF8(f(a))[1],b+=d,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=d,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),c?(this.offset=b,this):b-e},c.writeString=c.writeUTF8String,b.calculateUTF8Chars=function(a){return k.calculateUTF16asUTF8(f(a))[0]},b.calculateUTF8Bytes=function(a){return k.calculateUTF16asUTF8(f(a))[1]},b.calculateString=b.calculateUTF8Bytes,c.readUTF8String=function(a,c,d){var e,i,f,h,j;if(\"number\"==typeof c&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),\"undefined\"==typeof c&&(c=b.METRICS_CHARS),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(f=0,h=d,c===b.METRICS_CHARS){if(i=g(),k.decodeUTF8(function(){return a>f&&d<this.limit?this.view[d++]:null}.bind(this),function(a){++f,k.UTF8toUTF16(a,i);}),f!==a)throw RangeError(\"Illegal range: Truncated data, \"+f+\" == \"+a);return e?(this.offset=d,i()):{string:i(),length:d-h}}if(c===b.METRICS_BYTES){if(!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+a+\") <= \"+this.buffer.byteLength)}if(j=d+a,k.decodeUTF8toUTF16(function(){return j>d?this.view[d++]:null}.bind(this),i=g(),this.noAssert),d!==j)throw RangeError(\"Illegal range: Truncated data, \"+d+\" == \"+j);return e?(this.offset=d,i()):{string:i(),length:d-h}}throw TypeError(\"Unsupported metrics: \"+c)},c.readString=c.readUTF8String,c.writeVString=function(a,c){var g,h,e,i,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(e=c,g=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],h=b.calculateVarint32(g),c+=h+g,i=this.buffer.byteLength,c>i&&this.resize((i*=2)>c?i:c),c-=h+g,c+=this.writeVarint32(g,c),k.encodeUTF16toUTF8(f(a),function(a){this.view[c++]=a;}.bind(this)),c!==e+g+h)throw RangeError(\"Illegal range: Truncated data, \"+c+\" == \"+(c+g+h));return d?(this.offset=c,this):c-e},c.readVString=function(a){var d,e,f,c=\"undefined\"==typeof a;if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readVarint32(a),f=this.readUTF8String(e.value,b.METRICS_BYTES,a+=e.length),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},c.append=function(a,c,d){var e,f,g;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(d+=f,g=this.buffer.byteLength,d>g&&this.resize((g*=2)>d?g:d),d-=f,this.view.set(a.view.subarray(a.offset,a.limit),d),a.offset+=f,e&&(this.offset+=f),this)},c.appendTo=function(a,b){return a.append(this,b),this},c.assert=function(a){return this.noAssert=!a,this},c.capacity=function(){return this.buffer.byteLength},c.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},c.clone=function(a){var c=new b(0,this.littleEndian,this.noAssert);return a?(c.buffer=new ArrayBuffer(this.buffer.byteLength),c.view=new Uint8Array(c.buffer)):(c.buffer=this.buffer,c.view=this.view),c.offset=this.offset,c.markedOffset=this.markedOffset,c.limit=this.limit,c},c.compact=function(a,b){var c,e,f;if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return 0===a&&b===this.buffer.byteLength?this:(c=b-a,0===c?(this.buffer=d,this.view=null,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=0,this):(e=new ArrayBuffer(c),f=new Uint8Array(e),f.set(this.view.subarray(a,b)),this.buffer=e,this.view=f,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=c,this))},c.copy=function(a,c){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>a||a>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(a===c)return new b(0,this.littleEndian,this.noAssert);var d=c-a,e=new b(d,this.littleEndian,this.noAssert);return e.offset=0,e.limit=d,e.markedOffset>=0&&(e.markedOffset-=a),this.copyTo(e,0,a,c),e},c.copyTo=function(a,c,d,e){var f,g,h;if(!this.noAssert&&!b.isByteBuffer(a))throw TypeError(\"Illegal target: Not a ByteBuffer\");if(c=(g=\"undefined\"==typeof c)?a.offset:0|c,d=(f=\"undefined\"==typeof d)?this.offset:0|d,e=\"undefined\"==typeof e?this.limit:0|e,0>c||c>a.buffer.byteLength)throw RangeError(\"Illegal target range: 0 <= \"+c+\" <= \"+a.buffer.byteLength);if(0>d||e>this.buffer.byteLength)throw RangeError(\"Illegal source range: 0 <= \"+d+\" <= \"+this.buffer.byteLength);return h=e-d,0===h?a:(a.ensureCapacity(c+h),a.view.set(this.view.subarray(d,e),c),f&&(this.offset+=h),g&&(a.offset+=h),this)},c.ensureCapacity=function(a){var b=this.buffer.byteLength;return a>b?this.resize((b*=2)>a?b:a):this},c.fill=function(a,b,c){var d=\"undefined\"==typeof b;if(d&&(b=this.offset),\"string\"==typeof a&&a.length>0&&(a=a.charCodeAt(0)),\"undefined\"==typeof b&&(b=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal begin: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(b>=c)return this;for(;c>b;)this.view[b++]=a;return d&&(this.offset=b),this},c.flip=function(){return this.limit=this.offset,this.offset=0,this},c.mark=function(a){if(a=\"undefined\"==typeof a?this.offset:a,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return this.markedOffset=a,this},c.order=function(a){if(!this.noAssert&&\"boolean\"!=typeof a)throw TypeError(\"Illegal littleEndian: Not a boolean\");return this.littleEndian=!!a,this},c.LE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!!a:!0,this},c.BE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!a:!1,this},c.prepend=function(a,c,d){var e,f,g,h,i;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(g=f-d,g>0?(h=new ArrayBuffer(this.buffer.byteLength+g),i=new Uint8Array(h),i.set(this.view.subarray(d,this.buffer.byteLength),f),this.buffer=h,this.view=i,this.offset+=g,this.markedOffset>=0&&(this.markedOffset+=g),this.limit+=g,d+=g):new Uint8Array(this.buffer),this.view.set(a.view.subarray(a.offset,a.limit),d-f),a.offset=a.limit,e&&(this.offset-=f),this)},c.prependTo=function(a,b){return a.prepend(this,b),this},c.printDebug=function(a){\"function\"!=typeof a&&(a=console.log.bind(console)),a(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(!0));},c.remaining=function(){return this.limit-this.offset},c.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},c.resize=function(a){var b,c;if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal capacity: \"+a+\" (not an integer)\");if(a|=0,0>a)throw RangeError(\"Illegal capacity: 0 <= \"+a)}return this.buffer.byteLength<a&&(b=new ArrayBuffer(a),c=new Uint8Array(b),c.set(this.view),this.buffer=b,this.view=c),this},c.reverse=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return a===b?this:(Array.prototype.reverse.call(this.view.subarray(a,b)),this)},c.skip=function(a){if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");a|=0;}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+a+\" <= \"+this.buffer.byteLength);return this.offset=b,this},c.slice=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c=this.clone();return c.offset=a,c.limit=b,c},c.toBuffer=function(a){var e,b=this.offset,c=this.limit;if(!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal limit: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}return a||0!==b||c!==this.buffer.byteLength?b===c?d:(e=new ArrayBuffer(c-b),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b,c),0),e):this.buffer},c.toArrayBuffer=c.toBuffer,c.toString=function(a,b,c){if(\"undefined\"==typeof a)return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";switch(\"number\"==typeof a&&(a=\"utf8\",b=a,c=b),a){case\"utf8\":return this.toUTF8(b,c);case\"base64\":return this.toBase64(b,c);case\"hex\":return this.toHex(b,c);case\"binary\":return this.toBinary(b,c);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+a)}},j=function(){var d,e,a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[];for(d=0,e=b.length;e>d;++d)c[b[d]]=d;return a.encode=function(a,c){for(var d,e;null!==(d=a());)c(b[63&d>>2]),e=(3&d)<<4,null!==(d=a())?(e|=15&d>>4,c(b[63&(e|15&d>>4)]),e=(15&d)<<2,null!==(d=a())?(c(b[63&(e|3&d>>6)]),c(b[63&d])):(c(b[63&e]),c(61))):(c(b[63&e]),c(61),c(61));},a.decode=function(a,b){function g(a){throw Error(\"Illegal character code: \"+a)}for(var d,e,f;null!==(d=a());)if(e=c[d],\"undefined\"==typeof e&&g(d),null!==(d=a())&&(f=c[d],\"undefined\"==typeof f&&g(d),b(e<<2>>>0|(48&f)>>4),null!==(d=a()))){if(e=c[d],\"undefined\"==typeof e){if(61===d)break;g(d);}if(b((15&f)<<4>>>0|(60&e)>>2),null!==(d=a())){if(f=c[d],\"undefined\"==typeof f){if(61===d)break;g(d);}b((3&e)<<6>>>0|f);}}},a.test=function(a){return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a)},a}(),c.toBase64=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a=0|a,b=0|b,0>a||b>this.capacity||a>b)throw RangeError(\"begin, end\");var c;return j.encode(function(){return b>a?this.view[a++]:null}.bind(this),c=g()),c()},b.fromBase64=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");var d=new b(3*(a.length/4),c),e=0;return j.decode(f(a),function(a){d.view[e++]=a;}),d.limit=e,d},b.btoa=function(a){return b.fromBinary(a).toBase64()},b.atob=function(a){return b.fromBase64(a).toBinary()},c.toBinary=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a|=0,b|=0,0>a||b>this.capacity()||a>b)throw RangeError(\"begin, end\");if(a===b)return \"\";for(var c=[],d=[];b>a;)c.push(this.view[a++]),c.length>=1024&&(d.push(String.fromCharCode.apply(String,c)),c=[]);return d.join(\"\")+String.fromCharCode.apply(String,c)},b.fromBinary=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");for(var f,d=0,e=a.length,g=new b(e,c);e>d;){if(f=a.charCodeAt(d),f>255)throw RangeError(\"illegal char code: \"+f);g.view[d++]=f;}return g.limit=e,g},c.toDebug=function(a){for(var d,b=-1,c=this.buffer.byteLength,e=\"\",f=\"\",g=\"\";c>b;){if(-1!==b&&(d=this.view[b],e+=16>d?\"0\"+d.toString(16).toUpperCase():d.toString(16).toUpperCase(),a&&(f+=d>32&&127>d?String.fromCharCode(d):\".\")),++b,a&&b>0&&0===b%16&&b!==c){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\",e=f=\"\";}e+=b===this.offset&&b===this.limit?b===this.markedOffset?\"!\":\"|\":b===this.offset?b===this.markedOffset?\"[\":\"<\":b===this.limit?b===this.markedOffset?\"]\":\">\":b===this.markedOffset?\"'\":a||0!==b&&b!==c?\" \":\"\";}if(a&&\" \"!==e){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\";}return a?g:e},b.fromDebug=function(a,c,d){for(var i,j,e=a.length,f=new b(0|(e+1)/3,c,d),g=0,h=0,k=!1,l=!1,m=!1,n=!1,o=!1;e>g;){switch(i=a.charAt(g++)){case\"!\":if(!d){if(l||m||n){o=!0;break}l=m=n=!0;}f.offset=f.markedOffset=f.limit=h,k=!1;break;case\"|\":if(!d){if(l||n){o=!0;break}l=n=!0;}f.offset=f.limit=h,k=!1;break;case\"[\":if(!d){if(l||m){o=!0;break}l=m=!0;}f.offset=f.markedOffset=h,k=!1;break;case\"<\":if(!d){if(l){o=!0;break}l=!0;}f.offset=h,k=!1;break;case\"]\":if(!d){if(n||m){o=!0;break}n=m=!0;}f.limit=f.markedOffset=h,k=!1;break;case\">\":if(!d){if(n){o=!0;break}n=!0;}f.limit=h,k=!1;break;case\"'\":if(!d){if(m){o=!0;break}m=!0;}f.markedOffset=h,k=!1;break;case\" \":k=!1;break;default:if(!d&&k){o=!0;break}if(j=parseInt(i+a.charAt(g++),16),!d&&(isNaN(j)||0>j||j>255))throw TypeError(\"Illegal str: Not a debug encoded string\");f.view[h++]=j,k=!0;}if(o)throw TypeError(\"Illegal str: Invalid symbol at \"+g)}if(!d){if(!l||!n)throw TypeError(\"Illegal str: Missing offset or limit\");if(h<f.buffer.byteLength)throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+h+\" < \"+e)}return f},c.toHex=function(a,b){if(a=\"undefined\"==typeof a?this.offset:a,b=\"undefined\"==typeof b?this.limit:b,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}for(var d,c=new Array(b-a);b>a;)d=this.view[a++],16>d?c.push(\"0\",d.toString(16)):c.push(d.toString(16));return c.join(\"\")},b.fromHex=function(a,c,d){var g,e,f,h,i;if(!d){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(0!==a.length%2)throw TypeError(\"Illegal str: Length not a multiple of 2\")}for(e=a.length,f=new b(0|e/2,c),h=0,i=0;e>h;h+=2){if(g=parseInt(a.substring(h,h+2),16),!d&&(!isFinite(g)||0>g||g>255))throw TypeError(\"Illegal str: Contains non-hex characters\");f.view[i++]=g;}return f.limit=i,f},k=function(){var a={};return a.MAX_CODEPOINT=1114111,a.encodeUTF8=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)128>c?b(127&c):2048>c?(b(192|31&c>>6),b(128|63&c)):65536>c?(b(224|15&c>>12),b(128|63&c>>6),b(128|63&c)):(b(240|7&c>>18),b(128|63&c>>12),b(128|63&c>>6),b(128|63&c)),c=null;},a.decodeUTF8=function(a,b){for(var c,d,e,f,g=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());throw b.name=\"TruncatedError\",b.bytes=a,b};null!==(c=a());)if(0===(128&c))b(c);else if(192===(224&c))null===(d=a())&&g([c,d]),b((31&c)<<6|63&d);else if(224===(240&c))(null===(d=a())||null===(e=a()))&&g([c,d,e]),b((15&c)<<12|(63&d)<<6|63&e);else{if(240!==(248&c))throw RangeError(\"Illegal starting byte: \"+c);(null===(d=a())||null===(e=a())||null===(f=a()))&&g([c,d,e,f]),b((7&c)<<18|(63&d)<<12|(63&e)<<6|63&f);}},a.UTF16toUTF8=function(a,b){for(var c,d=null;;){if(null===(c=null!==d?d:a()))break;c>=55296&&57343>=c&&null!==(d=a())&&d>=56320&&57343>=d?(b(1024*(c-55296)+d-56320+65536),d=null):b(c);}null!==d&&b(d);},a.UTF8toUTF16=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)),c=null;},a.encodeUTF16toUTF8=function(b,c){a.UTF16toUTF8(b,function(b){a.encodeUTF8(b,c);});},a.decodeUTF8toUTF16=function(b,c){a.decodeUTF8(b,function(b){a.UTF8toUTF16(b,c);});},a.calculateCodePoint=function(a){return 128>a?1:2048>a?2:65536>a?3:4},a.calculateUTF8=function(a){for(var b,c=0;null!==(b=a());)c+=128>b?1:2048>b?2:65536>b?3:4;return c},a.calculateUTF16asUTF8=function(b){var c=0,d=0;return a.UTF16toUTF8(b,function(a){++c,d+=128>a?1:2048>a?2:65536>a?3:4;}),[c,d]},a}(),c.toUTF8=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c;try{k.decodeUTF8toUTF16(function(){return b>a?this.view[a++]:null}.bind(this),c=g());}catch(d){if(a!==b)throw RangeError(\"Illegal range: Truncated data, \"+a+\" != \"+b)}return c()},b.fromUTF8=function(a,c,d){if(!d&&\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");var e=new b(k.calculateUTF16asUTF8(f(a),!0)[1],c,d),g=0;return k.encodeUTF16toUTF8(f(a),function(a){e.view[g++]=a;}),e.limit=g,e},b}(c),e=function(b,c){var f,h,i,e={};return e.ByteBuffer=b,e.c=b,f=b,e.Long=c||null,e.VERSION=\"5.0.1\",e.WIRE_TYPES={},e.WIRE_TYPES.VARINT=0,e.WIRE_TYPES.BITS64=1,e.WIRE_TYPES.LDELIM=2,e.WIRE_TYPES.STARTGROUP=3,e.WIRE_TYPES.ENDGROUP=4,e.WIRE_TYPES.BITS32=5,e.PACKABLE_WIRE_TYPES=[e.WIRE_TYPES.VARINT,e.WIRE_TYPES.BITS64,e.WIRE_TYPES.BITS32],e.TYPES={int32:{name:\"int32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},uint64:{name:\"uint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.UZERO:void 0},sint64:{name:\"sint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},bool:{name:\"bool\",wireType:e.WIRE_TYPES.VARINT,defaultValue:!1},\"double\":{name:\"double\",wireType:e.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.UZERO:void 0},sfixed64:{name:\"sfixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.ZERO:void 0},\"float\":{name:\"float\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:e.WIRE_TYPES.STARTGROUP,defaultValue:null}},e.MAP_KEY_TYPES=[e.TYPES.int32,e.TYPES.sint32,e.TYPES.sfixed32,e.TYPES.uint32,e.TYPES.fixed32,e.TYPES.int64,e.TYPES.sint64,e.TYPES.sfixed64,e.TYPES.uint64,e.TYPES.fixed64,e.TYPES.bool,e.TYPES.string,e.TYPES.bytes],e.ID_MIN=1,e.ID_MAX=536870911,e.convertFieldsToCamelCase=!1,e.populateAccessors=!0,e.populateDefaults=!0,e.Util=function(){var a={};return a.IS_NODE=!(\"object\"!=typeof process||\"[object process]\"!=process+\"\"||process.browser),a.XHR=function(){var c,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}],b=null;for(c=0;c<a.length;c++){try{b=a[c]();}catch(d){continue}break}if(!b)throw Error(\"XMLHttpRequest is not supported\");return b},a.fetch=function(b,c){if(c&&\"function\"!=typeof c&&(c=null),a.IS_NODE)if(c)g.readFile(b,function(a,b){a?c(null):c(\"\"+b);});else try{return g.readFileSync(b)}catch(d){return null}else{var e=a.XHR();if(e.open(\"GET\",b,c?!0:!1),e.setRequestHeader(\"Accept\",\"text/plain\"),\"function\"==typeof e.overrideMimeType&&e.overrideMimeType(\"text/plain\"),!c)return e.send(null),200==e.status||0==e.status&&\"string\"==typeof e.responseText?e.responseText:null;if(e.onreadystatechange=function(){4==e.readyState&&(200==e.status||0==e.status&&\"string\"==typeof e.responseText?c(e.responseText):c(null));},4==e.readyState)return;e.send(null);}},a.toCamelCase=function(a){return a.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},a}(),e.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g},e.DotProto=function(a,b){function h(a,c){var d=-1,e=1;if(\"-\"==a.charAt(0)&&(e=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))d=parseInt(a);else if(b.NUMBER_HEX.test(a))d=parseInt(a.substring(2),16);else{if(!b.NUMBER_OCT.test(a))throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);d=parseInt(a.substring(1),8);}if(d=0|e*d,!c&&0>d)throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);return d}function i(a){var c=1;if(\"-\"==a.charAt(0)&&(c=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))return c*parseInt(a,10);if(b.NUMBER_HEX.test(a))return c*parseInt(a.substring(2),16);if(b.NUMBER_OCT.test(a))return c*parseInt(a.substring(1),8);if(\"inf\"===a)return 1/0*c;if(\"nan\"===a)return 0/0;if(b.NUMBER_FLT.test(a))return c*parseFloat(a);throw Error(\"illegal number value: \"+(0>c?\"-\":\"\")+a)}function j(a,b,c){\"undefined\"==typeof a[b]?a[b]=c:(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(c));}var f,g,c={},d=function(a){this.source=a+\"\",this.index=0,this.line=1,this.stack=[],this._stringOpen=null;},e=d.prototype;return e._readString=function(){var c,a='\"'===this._stringOpen?b.STRING_DQ:b.STRING_SQ;if(a.lastIndex=this.index-1,c=a.exec(this.source),!c)throw Error(\"unterminated string\");return this.index=a.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,c[1]},e.next=function(){var a,c,d,e,f,g;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(a=!1;b.WHITESPACE.test(d=this.source.charAt(this.index));)if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;if(\"/\"===this.source.charAt(this.index))if(++this.index,\"/\"===this.source.charAt(this.index)){for(;\"\\n\"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,a=!0;}else{if(\"*\"!==(d=this.source.charAt(this.index)))return \"/\";do{if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;c=d,d=this.source.charAt(this.index);}while(\"*\"!==c||\"/\"!==d);++this.index,a=!0;}}while(a);if(this.index===this.source.length)return null;if(e=this.index,b.DELIM.lastIndex=0,f=b.DELIM.test(this.source.charAt(e++)),!f)for(;e<this.source.length&&!b.DELIM.test(this.source.charAt(e));)++e;return g=this.source.substring(this.index,this.index=e),('\"'===g||\"'\"===g)&&(this._stringOpen=g),g},e.peek=function(){if(0===this.stack.length){var a=this.next();if(null===a)return null;this.stack.push(a);}return this.stack[0]},e.skip=function(a){var b=this.next();if(b!==a)throw Error(\"illegal '\"+b+\"', '\"+a+\"' expected\")},e.omit=function(a){return this.peek()===a?(this.next(),!0):!1},e.toString=function(){return \"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"},c.Tokenizer=d,f=function(a){this.tn=new d(a),this.proto3=!1;},g=f.prototype,g.parse=function(){var c,a={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]},d=!0;try{for(;c=this.tn.next();)switch(c){case\"package\":if(!d||null!==a[\"package\"])throw Error(\"unexpected 'package'\");if(c=this.tn.next(),!b.TYPEREF.test(c))throw Error(\"illegal package name: \"+c);this.tn.skip(\";\"),a[\"package\"]=c;break;case\"import\":if(!d)throw Error(\"unexpected 'import'\");c=this.tn.peek(),\"public\"===c&&this.tn.next(),c=this._readString(),this.tn.skip(\";\"),a.imports.push(c);break;case\"syntax\":if(!d)throw Error(\"unexpected 'syntax'\");this.tn.skip(\"=\"),\"proto3\"===(a.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(\";\");break;case\"message\":this._parseMessage(a,null),d=!1;break;case\"enum\":this._parseEnum(a),d=!1;break;case\"option\":this._parseOption(a);break;case\"service\":this._parseService(a);break;case\"extend\":this._parseExtend(a);break;default:throw Error(\"unexpected '\"+c+\"'\")}}catch(e){throw e.message=\"Parse error at line \"+this.tn.line+\": \"+e.message,e}return delete a.name,a},f.parse=function(a){return new f(a).parse()},g._readString=function(){var b,c,a=\"\";do{if(c=this.tn.next(),\"'\"!==c&&'\"'!==c)throw Error(\"illegal string delimiter: \"+c);a+=this.tn.next(),this.tn.skip(c),b=this.tn.peek();}while('\"'===b||'\"'===b);return a},g._readValue=function(a){var c=this.tn.peek();if('\"'===c||\"'\"===c)return this._readString();if(this.tn.next(),b.NUMBER.test(c))return i(c);if(b.BOOL.test(c))return \"true\"===c.toLowerCase();if(a&&b.TYPEREF.test(c))return c;throw Error(\"illegal value: \"+c)},g._parseOption=function(a,c){var f,d=this.tn.next(),e=!1;if(\"(\"===d&&(e=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal option name: \"+d);f=d,e&&(this.tn.skip(\")\"),f=\"(\"+f+\")\",d=this.tn.peek(),b.FQTYPEREF.test(d)&&(f+=d,this.tn.next())),this.tn.skip(\"=\"),this._parseOptionValue(a,f),c||this.tn.skip(\";\");},g._parseOptionValue=function(a,c){var d=this.tn.peek();if(\"{\"!==d)j(a.options,c,this._readValue(!0));else for(this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());){if(!b.NAME.test(d))throw Error(\"illegal option name: \"+c+\".\"+d);this.tn.omit(\":\")?j(a.options,c+\".\"+d,this._readValue(!0)):this._parseOptionValue(a,c+\".\"+d);}},g._parseService=function(a){var d,e,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal service name at line \"+this.tn.line+\": \"+c);for(d=c,e={name:d,rpc:{},options:{}},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(\"option\"===c)this._parseOption(e);else{if(\"rpc\"!==c)throw Error(\"illegal service token: \"+c);this._parseServiceRPC(e);}this.tn.omit(\";\"),a.services.push(e);},g._parseServiceRPC=function(a){var e,f,c=\"rpc\",d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal rpc service method name: \"+d);if(e=d,f={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.request_stream=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal rpc service request type: \"+d);if(f.request=d,this.tn.skip(\")\"),d=this.tn.next(),\"returns\"!==d.toLowerCase())throw Error(\"illegal rpc service request type delimiter: \"+d);if(this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.response_stream=!0,d=this.tn.next()),f.response=d,this.tn.skip(\")\"),d=this.tn.peek(),\"{\"===d){for(this.tn.next();\"}\"!==(d=this.tn.next());){if(\"option\"!==d)throw Error(\"illegal rpc service token: \"+d);this._parseOption(f);}this.tn.omit(\";\");}else this.tn.skip(\";\");\"undefined\"==typeof a[c]&&(a[c]={}),a[c][e]=f;},g._parseMessage=function(a,c){var d=!!c,e=this.tn.next(),f={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!b.NAME.test(e))throw Error(\"illegal \"+(d?\"group\":\"message\")+\" name: \"+e);for(f.name=e,d&&(this.tn.skip(\"=\"),c.id=h(this.tn.next()),f.isGroup=!0),e=this.tn.peek(),\"[\"===e&&c&&this._parseFieldOptions(c),this.tn.skip(\"{\");\"}\"!==(e=this.tn.next());)if(b.RULE.test(e))this._parseMessageField(f,e);else if(\"oneof\"===e)this._parseMessageOneOf(f);else if(\"enum\"===e)this._parseEnum(f);else if(\"message\"===e)this._parseMessage(f);else if(\"option\"===e)this._parseOption(f);else if(\"service\"===e)this._parseService(f);else if(\"extensions\"===e)f.extensions=this._parseExtensionRanges();else if(\"reserved\"===e)this._parseIgnored();else if(\"extend\"===e)this._parseExtend(f);else{if(!b.TYPEREF.test(e))throw Error(\"illegal message token: \"+e);if(!this.proto3)throw Error(\"illegal field rule: \"+e);this._parseMessageField(f,\"optional\",e);}return this.tn.omit(\";\"),a.messages.push(f),f},g._parseIgnored=function(){for(;\";\"!==this.tn.peek();)this.tn.next();this.tn.skip(\";\");},g._parseMessageField=function(a,c,d){var e,f,g;if(!b.RULE.test(c))throw Error(\"illegal message field rule: \"+c);if(e={rule:c,type:\"\",name:\"\",options:{},id:0},\"map\"===c){if(d)throw Error(\"illegal type: \"+d);if(this.tn.skip(\"<\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field type: \"+f);if(e.keytype=f,this.tn.skip(\",\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field: \"+f);if(e.type=f,this.tn.skip(\">\"),f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}else if(d=\"undefined\"!=typeof d?d:this.tn.next(),\"group\"===d){if(g=this._parseMessage(a,e),!/^[A-Z]/.test(g.name))throw Error(\"illegal group name: \"+g.name);e.type=g.name,e.name=g.name.toLowerCase(),this.tn.omit(\";\");}else{if(!b.TYPE.test(d)&&!b.TYPEREF.test(d))throw Error(\"illegal message field type: \"+d);if(e.type=d,f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);\n  e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}return a.fields.push(e),e},g._parseMessageOneOf=function(a){var e,d,f,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal oneof name: \"+c);for(d=c,f=[],this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)e=this._parseMessageField(a,\"optional\",c),e.oneof=d,f.push(e.id);this.tn.omit(\";\"),a.oneofs[d]=f;},g._parseFieldOptions=function(a){this.tn.skip(\"[\");for(var b,c=!0;\"]\"!==(b=this.tn.peek());)c||this.tn.skip(\",\"),this._parseOption(a,!0),c=!1;this.tn.next();},g._parseEnum=function(a){var e,c={name:\"\",values:[],options:{}},d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);for(c.name=d,this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());)if(\"option\"===d)this._parseOption(c);else{if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);this.tn.skip(\"=\"),e={name:d,id:h(this.tn.next(),!0)},d=this.tn.peek(),\"[\"===d&&this._parseFieldOptions({options:{}}),this.tn.skip(\";\"),c.values.push(e);}this.tn.omit(\";\"),a.enums.push(c);},g._parseExtensionRanges=function(){var c,d,e,b=[];do{for(d=[];;){switch(c=this.tn.next()){case\"min\":e=a.ID_MIN;break;case\"max\":e=a.ID_MAX;break;default:e=i(c);}if(d.push(e),2===d.length)break;if(\"to\"!==this.tn.peek()){d.push(e);break}this.tn.next();}b.push(d);}while(this.tn.omit(\",\"));return this.tn.skip(\";\"),b},g._parseExtend=function(a){var d,c=this.tn.next();if(!b.TYPEREF.test(c))throw Error(\"illegal extend reference: \"+c);for(d={ref:c,fields:[]},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(b.RULE.test(c))this._parseMessageField(d,c);else{if(!b.TYPEREF.test(c))throw Error(\"illegal extend token: \"+c);if(!this.proto3)throw Error(\"illegal field rule: \"+c);this._parseMessageField(d,\"optional\",c);}return this.tn.omit(\";\"),a.messages.push(d),d},g.toString=function(){return \"Parser at line \"+this.tn.line},c.Parser=f,c}(e,e.Lang),e.Reflect=function(a){function k(b){if(\"string\"==typeof b&&(b=a.TYPES[b]),\"undefined\"==typeof b.defaultValue)throw Error(\"default value for type \"+b.name+\" is not supported\");return b==a.TYPES.bytes?new f(0):b.defaultValue}function l(b,c){if(b&&\"number\"==typeof b.low&&\"number\"==typeof b.high&&\"boolean\"==typeof b.unsigned&&b.low===b.low&&b.high===b.high)return new a.Long(b.low,b.high,\"undefined\"==typeof c?b.unsigned:c);if(\"string\"==typeof b)return a.Long.fromString(b,c||!1,10);if(\"number\"==typeof b)return a.Long.fromNumber(b,c||!1);throw Error(\"not convertible to Long\")}function o(b,c){var d=c.readVarint32(),e=7&d,f=d>>>3;switch(e){case a.WIRE_TYPES.VARINT:do d=c.readUint8();while(128===(128&d));break;case a.WIRE_TYPES.BITS64:c.offset+=8;break;case a.WIRE_TYPES.LDELIM:d=c.readVarint32(),c.offset+=d;break;case a.WIRE_TYPES.STARTGROUP:o(f,c);break;case a.WIRE_TYPES.ENDGROUP:if(f===b)return !1;throw Error(\"Illegal GROUPEND after unknown group: \"+f+\" (\"+b+\" expected)\");case a.WIRE_TYPES.BITS32:c.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+b+\": \"+e)}return !0}var g,h,i,j,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,c={},d=function(a,b,c){this.builder=a,this.parent=b,this.name=c,this.className;},e=d.prototype;return e.fqn=function(){for(var a=this.name,b=this;;){if(b=b.parent,null==b)break;a=b.name+\".\"+a;}return a},e.toString=function(a){return (a?this.className+\" \":\"\")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+\" cannot be built directly\")},c.T=d,g=function(a,b,c,e,f){d.call(this,a,b,c),this.className=\"Namespace\",this.children=[],this.options=e||{},this.syntax=f||\"proto2\";},h=g.prototype=Object.create(d.prototype),h.getChildren=function(a){var b,c,d;if(a=a||null,null==a)return this.children.slice();for(b=[],c=0,d=this.children.length;d>c;++c)this.children[c]instanceof a&&b.push(this.children[c]);return b},h.addChild=function(a){var b;if(b=this.getChild(a.name))if(b instanceof m.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else{if(!(a instanceof m.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName)))throw Error(\"Duplicate name in namespace \"+this.toString(!0)+\": \"+a.name);a.name=a.originalName;}this.children.push(a);},h.getChild=function(a){var c,d,b=\"number\"==typeof a?\"id\":\"name\";for(c=0,d=this.children.length;d>c;++c)if(this.children[c][b]===a)return this.children[c];return null},h.resolve=function(a,b){var g,d=\"string\"==typeof a?a.split(\".\"):a,e=this,f=0;if(\"\"===d[f]){for(;null!==e.parent;)e=e.parent;f++;}do{do{if(!(e instanceof c.Namespace)){e=null;break}if(g=e.getChild(d[f]),!(g&&g instanceof c.T&&(!b||g instanceof c.Namespace))){e=null;break}e=g,f++;}while(f<d.length);if(null!=e)break;if(null!==this.parent)return this.parent.resolve(a,b)}while(null!=e);return e},h.qn=function(a){var e,f,b=[],d=a;do b.unshift(d.name),d=d.parent;while(null!==d);for(e=1;e<=b.length;e++)if(f=b.slice(b.length-e),a===this.resolve(f,a instanceof c.Namespace))return f.join(\".\");return a.fqn()},h.build=function(){var e,c,d,a={},b=this.children;for(c=0,d=b.length;d>c;++c)e=b[c],e instanceof g&&(a[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(a,\"$options\",{value:this.buildOpt()}),a},h.buildOpt=function(){var c,d,e,f,a={},b=Object.keys(this.options);for(c=0,d=b.length;d>c;++c)e=b[c],f=this.options[b[c]],a[e]=f;return a},h.getOption=function(a){return \"undefined\"==typeof a?this.options:\"undefined\"!=typeof this.options[a]?this.options[a]:null},c.Namespace=g,i=function(b,c,d,e){if(this.type=b,this.resolvedType=c,this.isMapKey=d,this.syntax=e,d&&a.MAP_KEY_TYPES.indexOf(b)<0)throw Error(\"Invalid map key type: \"+b.name)},j=i.prototype,i.defaultFieldValue=k,j.verifyValue=function(c){var f,g,h,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this);switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),c>4294967295?0|c:c;case a.TYPES.uint32:case a.TYPES.fixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),0>c?c>>>0:c;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if(a.Long)try{return l(c,!1)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.uint64:case a.TYPES.fixed64:if(a.Long)try{return l(c,!0)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.bool:return \"boolean\"!=typeof c&&d(typeof c,\"not a boolean\"),c;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return \"number\"!=typeof c&&d(typeof c,\"not a number\"),c;case a.TYPES.string:return \"string\"==typeof c||c&&c instanceof String||d(typeof c,\"not a string\"),\"\"+c;case a.TYPES.bytes:return b.isByteBuffer(c)?c:b.wrap(c);case a.TYPES[\"enum\"]:for(f=this.resolvedType.getChildren(a.Reflect.Enum.Value),h=0;h<f.length;h++){if(f[h].name==c)return f[h].id;if(f[h].id==c)return f[h].id}if(\"proto3\"===this.syntax)return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),(c>4294967295||0>c)&&d(typeof c,\"not in range for uint32\"),c;d(c,\"not a valid enum value\");case a.TYPES.group:case a.TYPES.message:if(c&&\"object\"==typeof c||d(typeof c,\"object expected\"),c instanceof this.resolvedType.clazz)return c;if(c instanceof a.Builder.Message){g={};for(h in c)c.hasOwnProperty(h)&&(g[h]=c[h]);c=g;}return new this.resolvedType.clazz(c)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(!0)+\": \"+c+\" (undefined type \"+this.type+\")\")},j.calculateLength=function(b,c){if(null===c)return 0;var d;switch(this.type){case a.TYPES.int32:return 0>c?f.calculateVarint64(c):f.calculateVarint32(c);case a.TYPES.uint32:return f.calculateVarint32(c);case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c));case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES[\"float\"]:return 4;case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c);case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c));case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8;case a.TYPES.bool:return 1;case a.TYPES[\"enum\"]:return f.calculateVarint32(c);case a.TYPES[\"double\"]:return 8;case a.TYPES.string:return d=f.calculateUTF8Bytes(c),f.calculateVarint32(d)+d;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");return f.calculateVarint32(c.remaining())+c.remaining();case a.TYPES.message:return d=this.resolvedType.calculate(c),f.calculateVarint32(d)+d;case a.TYPES.group:return d=this.resolvedType.calculate(c),d+f.calculateVarint32(b<<3|a.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")},j.encodeValue=function(b,c,d){var e,g;if(null===c)return d;switch(this.type){case a.TYPES.int32:0>c?d.writeVarint64(c):d.writeVarint32(c);break;case a.TYPES.uint32:d.writeVarint32(c);break;case a.TYPES.sint32:d.writeVarint32ZigZag(c);break;case a.TYPES.fixed32:d.writeUint32(c);break;case a.TYPES.sfixed32:d.writeInt32(c);break;case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c);break;case a.TYPES.sint64:d.writeVarint64ZigZag(c);break;case a.TYPES.fixed64:d.writeUint64(c);break;case a.TYPES.sfixed64:d.writeInt64(c);break;case a.TYPES.bool:\"string\"==typeof c?d.writeVarint32(\"false\"===c.toLowerCase()?0:!!c):d.writeVarint32(c?1:0);break;case a.TYPES[\"enum\"]:d.writeVarint32(c);break;case a.TYPES[\"float\"]:d.writeFloat32(c);break;case a.TYPES[\"double\"]:d.writeFloat64(c);break;case a.TYPES.string:d.writeVString(c);break;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");e=c.offset,d.writeVarint32(c.remaining()),d.append(c),c.offset=e;break;case a.TYPES.message:g=(new f).LE(),this.resolvedType.encode(c,g),d.writeVarint32(g.offset),d.append(g.flip());break;case a.TYPES.group:this.resolvedType.encode(c,d),d.writeVarint32(b<<3|a.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")}return d},j.decode=function(b,c,d){if(c!=this.type.wireType)throw Error(\"Unexpected wire type for element\");var e,f;switch(this.type){case a.TYPES.int32:return 0|b.readVarint32();case a.TYPES.uint32:return b.readVarint32()>>>0;case a.TYPES.sint32:return 0|b.readVarint32ZigZag();case a.TYPES.fixed32:return b.readUint32()>>>0;case a.TYPES.sfixed32:return 0|b.readInt32();case a.TYPES.int64:return b.readVarint64();case a.TYPES.uint64:return b.readVarint64().toUnsigned();case a.TYPES.sint64:return b.readVarint64ZigZag();case a.TYPES.fixed64:return b.readUint64();case a.TYPES.sfixed64:return b.readInt64();case a.TYPES.bool:return !!b.readVarint32();case a.TYPES[\"enum\"]:return b.readVarint32();case a.TYPES[\"float\"]:return b.readFloat();case a.TYPES[\"double\"]:return b.readDouble();case a.TYPES.string:return b.readVString();case a.TYPES.bytes:if(f=b.readVarint32(),b.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+b.remaining());return e=b.clone(),e.limit=e.offset+f,b.offset+=f,e;case a.TYPES.message:return f=b.readVarint32(),this.resolvedType.decode(b,f);case a.TYPES.group:return this.resolvedType.decode(b,-1,d)}throw Error(\"[INTERNAL] Illegal decode type\")},j.valueFromString=function(b){if(!this.isMapKey)throw Error(\"valueFromString() called on non-map-key element\");switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b));case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b);case a.TYPES.bool:return \"true\"===b;case a.TYPES.string:return this.verifyValue(b);case a.TYPES.bytes:return f.fromBinary(b)}},j.valueToString=function(b){if(!this.isMapKey)throw Error(\"valueToString() called on non-map-key element\");return this.type===a.TYPES.bytes?b.toString(\"binary\"):b.toString()},c.Element=i,m=function(a,b,c,d,e,f){g.call(this,a,b,c,d,f),this.className=\"Message\",this.extensions=void 0,this.clazz=null,this.isGroup=!!e,this._fields=null,this._fieldsById=null,this._fieldsByName=null;},n=m.prototype=Object.create(g.prototype),n.build=function(c){var d,h,e,g;if(this.clazz&&!c)return this.clazz;for(d=function(a,c){function k(b,c,d,e){var g,h,i,j,l,m,n;if(null===b||\"object\"!=typeof b)return e&&e instanceof a.Reflect.Enum&&(g=a.Reflect.Enum.getName(e.object,b),null!==g)?g:b;if(f.isByteBuffer(b))return c?b.toBase64():b.toBuffer();if(a.Long.isLong(b))return d?b.toString():a.Long.fromValue(b);if(Array.isArray(b))return h=[],b.forEach(function(a,b){h[b]=k(a,c,d,e);}),h;if(h={},b instanceof a.Map){for(i=b.entries(),j=i.next();!j.done;j=i.next())h[b.keyElem.valueToString(j.value[0])]=k(j.value[1],c,d,b.valueElem.resolvedType);return h}l=b.$type,m=void 0;for(n in b)b.hasOwnProperty(n)&&(h[n]=l&&(m=l.getChild(n))?k(b[n],c,d,m.resolvedType):k(b[n],c,d));return h}var i,j,d=c.getChildren(a.Reflect.Message.Field),e=c.getChildren(a.Reflect.Message.OneOf),g=function(b){var i,j,k,l;for(a.Builder.Message.call(this),i=0,j=e.length;j>i;++i)this[e[i].name]=null;for(i=0,j=d.length;j>i;++i)k=d[i],this[k.name]=k.repeated?[]:k.map?new a.Map(k):null,!k.required&&\"proto3\"!==c.syntax||null===k.defaultValue||(this[k.name]=k.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===b||\"object\"!=typeof b||!(\"function\"!=typeof b.encode||b instanceof g)||Array.isArray(b)||b instanceof a.Map||f.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(i=0,j=arguments.length;j>i;++i)\"undefined\"!=typeof(l=arguments[i])&&this.$set(d[i].name,l);else this.$set(b);},h=g.prototype=Object.create(a.Builder.Message.prototype);for(h.add=function(b,d,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+\"#\"+b+\" is undefined\");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+f.toString(!0));if(!f.repeated)throw Error(this+\"#\"+b+\" is not a repeated field\");d=f.verifyValue(d,!0);}return null===this[b]&&(this[b]=[]),this[b].push(d),this},h.$add=h.add,h.set=function(b,d,e){var f,g,h;if(b&&\"object\"==typeof b){e=d;for(f in b)b.hasOwnProperty(f)&&\"undefined\"!=typeof(d=b[f])&&this.$set(f,d,e);return this}if(g=c._fieldsByName[b],e)this[b]=d;else{if(!g)throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(g instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+g.toString(!0));this[g.name]=d=g.verifyValue(d);}return g&&g.oneof&&(h=this[g.oneof.name],null!==d?(null!==h&&h!==g.name&&(this[h]=null),this[g.oneof.name]=g.name):h===b&&(this[g.oneof.name]=null)),this},h.$set=h.set,h.get=function(b,d){if(d)return this[b];var e=c._fieldsByName[b];if(!(e&&e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+e.toString(!0));return this[e.name]},h.$get=h.get,i=0;i<d.length;i++)j=d[i],j instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var d,e,f,b=a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace(\"_\",\"\")});b=b.substring(0,1).toUpperCase()+b.substring(1),d=a.originalName.replace(/([A-Z])/g,function(a){return \"_\"+a}),e=function(b,c){return this[a.name]=c?b:a.verifyValue(b),this},f=function(){return this[a.name]},null===c.getChild(\"set\"+b)&&(h[\"set\"+b]=e),null===c.getChild(\"set_\"+d)&&(h[\"set_\"+d]=e),null===c.getChild(\"get\"+b)&&(h[\"get\"+b]=f),null===c.getChild(\"get_\"+d)&&(h[\"get_\"+d]=f);}(j);return h.encode=function(a,d){var e,f;\"boolean\"==typeof a&&(d=a,a=void 0),e=!1,a||(a=new b,e=!0),f=a.littleEndian;try{return c.encode(this,a.LE(),d),(e?a.flip():a).LE(f)}catch(g){throw a.LE(f),g}},g.encode=function(a,b,c){return new g(a).encode(b,c)},h.calculate=function(){return c.calculate(this)},h.encodeDelimited=function(a){var d,b=!1;return a||(a=new f,b=!0),d=(new f).LE(),c.encode(this,d).flip(),a.writeVarint32(d.remaining()),a.append(d),b?a.flip():a},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toArrayBuffer()),a}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a}},h.toHex=h.encodeHex,h.toRaw=function(a,b){return k(this,!!a,!!b,this.$type)},h.encodeJSON=function(){return JSON.stringify(k(this,!0,!0,this.$type))},g.decode=function(a,b){var d,e;\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),d=a.littleEndian;try{return e=c.decode(a.LE()),a.LE(d),e}catch(g){throw a.LE(d),g}},g.decodeDelimited=function(a,b){var d,e,g;if(\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),a.remaining()<1)return null;if(d=a.offset,e=a.readVarint32(),a.remaining()<e)return a.offset=d,null;try{return g=c.decode(a.slice(a.offset,a.offset+e).LE()),a.offset+=e,g}catch(h){throw a.offset+=e,h}},g.decode64=function(a){return g.decode(a,\"base64\")},g.decodeHex=function(a){return g.decode(a,\"hex\")},g.decodeJSON=function(a){return new g(JSON.parse(a))},h.toString=function(){return c.toString()},Object.defineProperty&&(Object.defineProperty(g,\"$options\",{value:c.buildOpt()}),Object.defineProperty(h,\"$options\",{value:g[\"$options\"]}),Object.defineProperty(g,\"$type\",{value:c}),Object.defineProperty(h,\"$type\",{value:c})),g}(a,this),this._fields=[],this._fieldsById={},this._fieldsByName={},e=0,g=this.children.length;g>e;e++)if(h=this.children[e],h instanceof t||h instanceof m||h instanceof x){if(d.hasOwnProperty(h.name))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+h.toString(!0)+\" cannot override static property '\"+h.name+\"'\");d[h.name]=h.build();}else if(h instanceof m.Field)h.build(),this._fields.push(h),this._fieldsById[h.id]=h,this._fieldsByName[h.name]=h;else if(!(h instanceof m.OneOf||h instanceof w))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+this.children[e].toString(!0));return this.clazz=d},n.encode=function(a,b,c){var e,h,f,g,i,d=null;for(f=0,g=this._fields.length;g>f;++f)e=this._fields[f],h=a[e.name],e.required&&null===h?null===d&&(d=e):e.encode(c?h:e.verifyValue(h),b,a);if(null!==d)throw i=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+d),i.encoded=b,i;return b},n.calculate=function(a){for(var e,f,b=0,c=0,d=this._fields.length;d>c;++c){if(e=this._fields[c],f=a[e.name],e.required&&null===f)throw Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+e);b+=e.calculate(f,a);}return b},n.decode=function(b,c,d){var g,h,i,j,e,f,k,l,m,n,p,q;for(c=\"number\"==typeof c?c:-1,e=b.offset,f=new this.clazz;b.offset<e+c||-1===c&&b.remaining()>0;){if(g=b.readVarint32(),h=7&g,i=g>>>3,h===a.WIRE_TYPES.ENDGROUP){if(i!==d)throw Error(\"Illegal group end indicator for \"+this.toString(!0)+\": \"+i+\" (\"+(d?d+\" expected\":\"not a group\")+\")\");break}if(j=this._fieldsById[i])j.repeated&&!j.options.packed?f[j.name].push(j.decode(h,b)):j.map?(l=j.decode(h,b),f[j.name].set(l[0],l[1])):(f[j.name]=j.decode(h,b),j.oneof&&(m=f[j.oneof.name],null!==m&&m!==j.name&&(f[m]=null),f[j.oneof.name]=j.name));else switch(h){case a.WIRE_TYPES.VARINT:b.readVarint32();break;case a.WIRE_TYPES.BITS32:b.offset+=4;break;case a.WIRE_TYPES.BITS64:b.offset+=8;break;case a.WIRE_TYPES.LDELIM:k=b.readVarint32(),b.offset+=k;break;case a.WIRE_TYPES.STARTGROUP:for(;o(i,b););break;default:throw Error(\"Illegal wire type for unknown field \"+i+\" in \"+this.toString(!0)+\"#decode: \"+h)}}for(n=0,p=this._fields.length;p>n;++n)if(j=this._fields[n],null===f[j.name])if(\"proto3\"===this.syntax)f[j.name]=j.defaultValue;else{if(j.required)throw q=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+j.name),q.decoded=f,q;a.populateDefaults&&null!==j.defaultValue&&(f[j.name]=j.defaultValue);}return f},c.Message=m,p=function(b,c,e,f,g,h,i,j,k,l){d.call(this,b,c,h),this.className=\"Message.Field\",this.required=\"required\"===e,this.repeated=\"repeated\"===e,this.map=\"map\"===e,this.keyType=f||null,this.type=g,this.resolvedType=null,this.id=i,this.options=j||{},this.defaultValue=null,this.oneof=k||null,this.syntax=l||\"proto2\",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof m.ExtensionField||(this.name=a.Util.toCamelCase(this.name));},q=p.prototype=Object.create(d.prototype),q.build=function(){this.element=new i(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new i(this.keyType,void 0,!0,this.syntax)),\"proto3\"!==this.syntax||this.repeated||this.map?\"undefined\"!=typeof this.options[\"default\"]&&(this.defaultValue=this.verifyValue(this.options[\"default\"])):this.defaultValue=i.defaultFieldValue(this.type);},q.verifyValue=function(b,c){var d,e,f;if(c=c||!1,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this),null===b)return this.required&&d(typeof b,\"required\"),\"proto3\"===this.syntax&&this.type!==a.TYPES.message&&d(typeof b,\"proto3 field without field presence cannot be null\"),null;if(this.repeated&&!c){for(Array.isArray(b)||(b=[b]),f=[],e=0;e<b.length;e++)f.push(this.element.verifyValue(b[e]));return f}return this.map&&!c?b instanceof a.Map?b:(b instanceof Object||d(typeof b,\"expected ProtoBuf.Map or raw object for map field\"),new a.Map(this,b)):(!this.repeated&&Array.isArray(b)&&d(typeof b,\"no array expected\"),this.element.verifyValue(b))},q.hasWirePresence=function(b,c){if(\"proto3\"!==this.syntax)return null!==b;if(this.oneof&&c[this.oneof.name]===this.name)return !0;switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return 0!==b;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return 0!==b.low||0!==b.high;case a.TYPES.bool:return b;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return 0!==b;case a.TYPES.string:return b.length>0;case a.TYPES.bytes:return b.remaining()>0;case a.TYPES[\"enum\"]:return 0!==b;case a.TYPES.message:return null!==b;default:return !0}},q.encode=function(b,c,d){var e,g,h,i,j;if(null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return c;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.ensureCapacity(c.offset+=1),g=c.offset,e=0;e<b.length;e++)this.element.encodeValue(this.id,b[e],c);h=c.offset-g,i=f.calculateVarint32(h),i>1&&(j=c.slice(g,c.offset),g+=i-1,c.offset=g,c.append(j)),c.writeVarint32(h,g-i);}else for(e=0;e<b.length;e++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[e],c);else this.map?b.forEach(function(b,d){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.writeVarint32(g),c.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,d,c),c.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,b,c);},this):this.hasWirePresence(b,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,c));}catch(k){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+k+\")\")}return c},q.calculate=function(b,c){var d,e,g;if(b=this.verifyValue(b),null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return 0;d=0;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),g=0,e=0;e<b.length;e++)g+=this.element.calculateLength(this.id,b[e]);d+=f.calculateVarint32(g),d+=g;}else for(e=0;e<b.length;e++)d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b[e]);else this.map?b.forEach(function(b,c){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),d+=f.calculateVarint32(g),d+=g;},this):this.hasWirePresence(b,c)&&(d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b));}catch(h){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+h+\")\")}return d},q.decode=function(b,c,d){var e,f,h,j,k,l,m,g=!this.map&&b==this.type.wireType||!d&&this.repeated&&this.options.packed&&b==a.WIRE_TYPES.LDELIM||this.map&&b==a.WIRE_TYPES.LDELIM;if(!g)throw Error(\"Illegal wire type for field \"+this.toString(!0)+\": \"+b+\" (\"+this.type.wireType+\" expected)\");if(b==a.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!d){for(f=c.readVarint32(),f=c.offset+f,h=[];c.offset<f;)h.push(this.decode(this.type.wireType,c,!0));return h}if(this.map){if(j=i.defaultFieldValue(this.keyType),e=i.defaultFieldValue(this.type),f=c.readVarint32(),c.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+c.remaining());for(k=c.clone(),k.limit=k.offset+f,c.offset+=f;k.remaining()>0;)if(l=k.readVarint32(),b=7&l,m=l>>>3,1===m)j=this.keyElement.decode(k,b,m);else{if(2!==m)throw Error(\"Unexpected tag in map field key/value submessage\");e=this.element.decode(k,b,m);}return [j,e]}return this.element.decode(c,b,this.id)},c.Message.Field=p,r=function(a,b,c,d,e,f,g){p.call(this,a,b,c,null,d,e,f,g),this.extension;},r.prototype=Object.create(p.prototype),c.Message.ExtensionField=r,s=function(a,b,c){d.call(this,a,b,c),this.fields=[];},c.Message.OneOf=s,t=function(a,b,c,d,e){g.call(this,a,b,c,d,e),this.className=\"Enum\",this.object=null;},t.getName=function(a,b){var e,d,c=Object.keys(a);for(d=0;d<c.length;++d)if(a[e=c[d]]===b)return e;return null},u=t.prototype=Object.create(g.prototype),u.build=function(b){var c,d,e,f;if(this.object&&!b)return this.object;for(c=new a.Builder.Enum,d=this.getChildren(t.Value),e=0,f=d.length;f>e;++e)c[d[e][\"name\"]]=d[e][\"id\"];return Object.defineProperty&&Object.defineProperty(c,\"$options\",{value:this.buildOpt(),enumerable:!1}),this.object=c},c.Enum=t,v=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Enum.Value\",this.id=e;},v.prototype=Object.create(d.prototype),c.Enum.Value=v,w=function(a,b,c,e){d.call(this,a,b,c),this.field=e;},w.prototype=Object.create(d.prototype),c.Extension=w,x=function(a,b,c,d){g.call(this,a,b,c,d),this.className=\"Service\",this.clazz=null;},y=x.prototype=Object.create(g.prototype),y.build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(a,b){var g,c=function(b){a.Builder.Service.call(this),this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0);};},d=c.prototype=Object.create(a.Builder.Service.prototype),e=b.getChildren(a.Reflect.Service.RPCMethod);for(g=0;g<e.length;g++)!function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(f.wrap(c));}catch(e){if(!(e instanceof TypeError))throw e}if(null===c||\"object\"!=typeof c)throw Error(\"Illegal arguments\");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c)),this.rpcImpl(a.fqn(),c,function(c,e){if(c)return d(c),void 0;try{e=a.resolvedResponseType.clazz.decode(e);}catch(f){}return e&&e instanceof a.resolvedResponseType.clazz?(d(null,e),void 0):(d(Error(\"Illegal response type received in service method \"+b.name+\"#\"+a.name)),void 0)});}catch(e){setTimeout(d.bind(this,e),0);}},c[a.name]=function(b,d,e){new c(b)[a.name](d,e);},Object.defineProperty&&(Object.defineProperty(c[a.name],\"$options\",{value:a.buildOpt()}),Object.defineProperty(d[a.name],\"$options\",{value:c[a.name][\"$options\"]}));}(e[g]);return Object.defineProperty&&(Object.defineProperty(c,\"$options\",{value:b.buildOpt()}),Object.defineProperty(d,\"$options\",{value:c[\"$options\"]}),Object.defineProperty(c,\"$type\",{value:b}),Object.defineProperty(d,\"$type\",{value:b})),c}(a,this)},c.Service=x,z=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Service.Method\",this.options=e||{};},A=z.prototype=Object.create(d.prototype),A.buildOpt=h.buildOpt,c.Service.Method=z,B=function(a,b,c,d,e,f,g,h){z.call(this,a,b,c,h),this.className=\"Service.RPCMethod\",this.requestName=d,this.responseName=e,this.requestStream=f,this.responseStream=g,this.resolvedRequestType=null,this.resolvedResponseType=null;},B.prototype=Object.create(z.prototype),c.Service.RPCMethod=B,c}(e),e.Builder=function(a,b,c){function f(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax,f(b);}),a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax;});}var d=function(a){this.ns=new c.Namespace(this,null,\"\"),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=a||{};},e=d.prototype;return d.isMessage=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values||\"undefined\"!=typeof a.rpc?!1:!0},d.isMessageField=function(a){return \"string\"!=typeof a.rule||\"string\"!=typeof a.name||\"string\"!=typeof a.type||\"undefined\"==typeof a.id?!1:!0},d.isEnum=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1},d.isService=function(a){return \"string\"==typeof a.name&&\"object\"==typeof a.rpc&&a.rpc?!0:!1},d.isExtend=function(a){return \"string\"!=typeof a.ref?!1:!0},e.reset=function(){return this.ptr=this.ns,this},e.define=function(a){if(\"string\"!=typeof a||!b.TYPEREF.test(a))throw Error(\"illegal namespace: \"+a);return a.split(\".\").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new c.Namespace(this,this.ptr,a)),this.ptr=b;},this),this},e.create=function(b){var e,f,g,h,i;if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice();}else b=[b];for(e=[b];e.length>0;){if(b=e.pop(),!Array.isArray(b))throw Error(\"not a valid namespace: \"+JSON.stringify(b));for(;b.length>0;){if(f=b.shift(),d.isMessage(f)){if(g=new c.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),h={},f.oneofs&&Object.keys(f.oneofs).forEach(function(a){g.addChild(h[a]=new c.Message.OneOf(this,g,a));},this),f.fields&&f.fields.forEach(function(a){if(null!==g.getChild(0|a.id))throw Error(\"duplicate or invalid field id in \"+g.name+\": \"+a.id);if(a.options&&\"object\"!=typeof a.options)throw Error(\"illegal field options in \"+g.name+\"#\"+a.name);var b=null;if(\"string\"==typeof a.oneof&&!(b=h[a.oneof]))throw Error(\"illegal oneof in \"+g.name+\"#\"+a.name+\": \"+a.oneof);a=new c.Message.Field(this,g,a.rule,a.keytype,a.type,a.name,a.id,a.options,b,f.syntax),b&&b.fields.push(a),g.addChild(a);},this),i=[],f.enums&&f.enums.forEach(function(a){i.push(a);}),f.messages&&f.messages.forEach(function(a){i.push(a);}),f.services&&f.services.forEach(function(a){i.push(a);}),f.extensions&&(g.extensions=\"number\"==typeof f.extensions[0]?[f.extensions]:f.extensions),this.ptr.addChild(g),i.length>0){e.push(b),b=i,i=null,this.ptr=g,g=null;continue}i=null;}else if(d.isEnum(f))g=new c.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(a){g.addChild(new c.Enum.Value(this,g,a.name,a.id));},this),this.ptr.addChild(g);else if(d.isService(f))g=new c.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(a){var b=f.rpc[a];g.addChild(new c.Service.RPCMethod(this,g,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options));},this),this.ptr.addChild(g);else{if(!d.isExtend(f))throw Error(\"not a valid definition: \"+JSON.stringify(f));if(g=this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){var d,e,f,h;if(null!==g.getChild(0|b.id))throw Error(\"duplicate extended field id in \"+g.name+\": \"+b.id);\n  if(g.extensions&&(d=!1,g.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(d=!0);}),!d))throw Error(\"illegal extended field id in \"+g.name+\": \"+b.id+\" (not within valid ranges)\");e=b.name,this.options.convertFieldsToCamelCase&&(e=a.Util.toCamelCase(e)),f=new c.Message.ExtensionField(this,g,b.rule,b.type,this.ptr.fqn()+\".\"+e,b.id,b.options),h=new c.Extension(this,this.ptr,b.name,f),f.extension=h,this.ptr.addChild(h),g.addChild(f);},this);else if(!/\\.?google\\.protobuf\\./.test(f.ref))throw Error(\"extended message \"+f.ref+\" is not defined\")}f=null,g=null;}b=null,this.ptr=this.ptr.parent;}return this.resolved=!1,this.result=null,this},e[\"import\"]=function(b,c){var e,g,h,i,j,k,l,m,d=\"/\";if(\"string\"==typeof c){if(a.Util.IS_NODE,this.files[c]===!0)return this.reset();this.files[c]=!0;}else if(\"object\"==typeof c){if(e=c.root,a.Util.IS_NODE,(e.indexOf(\"\\\\\")>=0||c.file.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\"),g=e+d+c.file,this.files[g]===!0)return this.reset();this.files[g]=!0;}if(b.imports&&b.imports.length>0){for(i=!1,\"object\"==typeof c?(this.importRoot=c.root,i=!0,h=this.importRoot,c=c.file,(h.indexOf(\"\\\\\")>=0||c.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\")):\"string\"==typeof c?this.importRoot?h=this.importRoot:c.indexOf(\"/\")>=0?(h=c.replace(/\\/[^\\/]*$/,\"\"),\"\"===h&&(h=\"/\")):c.indexOf(\"\\\\\")>=0?(h=c.replace(/\\\\[^\\\\]*$/,\"\"),d=\"\\\\\"):h=\".\":h=null,j=0;j<b.imports.length;j++)if(\"string\"==typeof b.imports[j]){if(!h)throw Error(\"cannot determine import root\");if(k=b.imports[j],\"google/protobuf/descriptor.proto\"===k)continue;if(k=h+d+k,this.files[k]===!0)continue;if(/\\.proto$/i.test(k)&&!a.DotProto&&(k=k.replace(/\\.proto$/,\".json\")),l=a.Util.fetch(k),null===l)throw Error(\"failed to import '\"+k+\"' in '\"+c+\"': file not found\");/\\.json$/i.test(k)?this[\"import\"](JSON.parse(l+\"\"),k):this[\"import\"](a.DotProto.Parser.parse(l),k);}else c?/\\.(\\w+)$/.test(c)?this[\"import\"](b.imports[j],c.replace(/^(.+)\\.(\\w+)$/,function(a,b,c){return b+\"_import\"+j+\".\"+c})):this[\"import\"](b.imports[j],c+\"_import\"+j):this[\"import\"](b.imports[j]);i&&(this.importRoot=null);}return b[\"package\"]&&this.define(b[\"package\"]),b.syntax&&f(b),m=this.ptr,b.options&&Object.keys(b.options).forEach(function(a){m.options[a]=b.options[a];}),b.messages&&(this.create(b.messages),this.ptr=m),b.enums&&(this.create(b.enums),this.ptr=m),b.services&&(this.create(b.services),this.ptr=m),b[\"extends\"]&&this.create(b[\"extends\"]),this.reset()},e.resolveAll=function(){var d;if(null==this.ptr||\"object\"==typeof this.ptr.type)return this;if(this.ptr instanceof c.Namespace)this.ptr.children.forEach(function(a){this.ptr=a,this.resolveAll();},this);else if(this.ptr instanceof c.Message.Field){if(b.TYPE.test(this.ptr.type))this.ptr.type=a.TYPES[this.ptr.type];else{if(!b.TYPEREF.test(this.ptr.type))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(d=(this.ptr instanceof c.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!d)throw Error(\"unresolvable type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(this.ptr.resolvedType=d,d instanceof c.Enum){if(this.ptr.type=a.TYPES[\"enum\"],\"proto3\"===this.ptr.syntax&&\"proto3\"!==d.syntax)throw Error(\"proto3 message cannot reference proto2 enum\")}else{if(!(d instanceof c.Message))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);this.ptr.type=d.isGroup?a.TYPES.group:a.TYPES.message;}}if(this.ptr.map){if(!b.TYPE.test(this.ptr.keyType))throw Error(\"illegal key type for map field in \"+this.ptr.toString(!0)+\": \"+this.ptr.keyType);this.ptr.keyType=a.TYPES[this.ptr.keyType];}}else if(this.ptr instanceof a.Reflect.Service.Method){if(!(this.ptr instanceof a.Reflect.Service.RPCMethod))throw Error(\"illegal service type in \"+this.ptr.toString(!0));if(d=this.ptr.parent.resolve(this.ptr.requestName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.requestName);if(this.ptr.resolvedRequestType=d,d=this.ptr.parent.resolve(this.ptr.responseName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.responseName);this.ptr.resolvedResponseType=d;}else if(!(this.ptr instanceof a.Reflect.Message.OneOf||this.ptr instanceof a.Reflect.Extension||this.ptr instanceof a.Reflect.Enum.Value))throw Error(\"illegal object in namespace: \"+typeof this.ptr+\": \"+this.ptr);return this.reset()},e.build=function(a){var b,c,d;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!a)return this.result;for(b=\"string\"==typeof a?a.split(\".\"):a,c=this.result,d=0;d<b.length;d++){if(!c[b[d]]){c=null;break}c=c[b[d]];}return c},e.lookup=function(a,b){return a?this.ns.resolve(a,b):this.ns},e.toString=function(){return \"Builder\"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(e,e.Lang,e.Reflect),e.Map=function(a,b){function e(a){var b=0;return {next:function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}}var c=function(a,c){var d,e,f,g;if(!a.map)throw Error(\"field is not a map\");if(this.field=a,this.keyElem=new b.Element(a.keyType,null,!0,a.syntax),this.valueElem=new b.Element(a.type,a.resolvedType,!1,a.syntax),this.map={},Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}}),c)for(d=Object.keys(c),e=0;e<d.length;e++)f=this.keyElem.valueFromString(d[e]),g=this.valueElem.verifyValue(c[d[e]]),this.map[this.keyElem.valueToString(f)]={key:f,value:g};},d=c.prototype;return d.clear=function(){this.map={};},d[\"delete\"]=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a)),c=b in this.map;return delete this.map[b],c},d.entries=function(){var d,c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push([(d=this.map[b[c]]).key,d.value]);return e(a)},d.keys=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].key);return e(a)},d.values=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].value);return e(a)},d.forEach=function(a,b){var e,d,c=Object.keys(this.map);for(d=0;d<c.length;d++)a.call(b,(e=this.map[c[d]]).value,e.key,this);},d.set=function(a,b){var c=this.keyElem.verifyValue(a),d=this.valueElem.verifyValue(b);return this.map[this.keyElem.valueToString(c)]={key:c,value:d},this},d.get=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map?this.map[b].value:void 0},d.has=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map},c}(e,e.Reflect),e.loadProto=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=void 0),e.loadJson(e.DotProto.Parser.parse(a),b,c)},e.protoFromString=e.loadProto,e.loadProtoFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadProto(d,c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadProto(d,c,a)},e.protoFromFile=e.loadProtoFile,e.newBuilder=function(a){return a=a||{},\"undefined\"==typeof a.convertFieldsToCamelCase&&(a.convertFieldsToCamelCase=e.convertFieldsToCamelCase),\"undefined\"==typeof a.populateAccessors&&(a.populateAccessors=e.populateAccessors),new e.Builder(a)},e.loadJson=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=null),b&&\"object\"==typeof b||(b=e.newBuilder()),\"string\"==typeof a&&(a=JSON.parse(a)),b[\"import\"](a,c),b.resolveAll(),b},e.loadJsonFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadJson(JSON.parse(d),c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadJson(JSON.parse(d),c,a)},h=a,i=e.loadProto(h,void 0,\"\").build(\"Modules\").probuf}(d,c,b);return e}\n\n  var SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message \" + PBName.SetUserStatusInput + \"\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \" + PBName.NotifyMsg + \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SyncRequestMsg + \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \" + PBName.UpStreamMessage + \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n  }\\n  message \" + PBName.DownStreamMessages + \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \" + PBName.DownStreamMessage + \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = \" + FILE_TYPE.IMAGE + \";\\n    audio = \" + FILE_TYPE.AUDIO + \";\\n    video = \" + FILE_TYPE.VIDEO + \";\\n    file = \" + FILE_TYPE.FILE + \";\\n  }\\n  message \" + PBName.GetQNupTokenInput + \" {\\n    required FileType type = 1;\\n    optional string key = 2;\\n  }\\n  message \" + PBName.GetQNdownloadUrlInput + \" {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message \" + PBName.GetQNupTokenOutput + \" {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n    optional string bosToken = 3;\\n    optional string bosDate = 4;\\n    optional string path = 5;\\n  }\\n  message \" + PBName.GetQNdownloadUrlOutput + \" {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \" + PBName.ChrmInput + \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.ChrmPullMsg + \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.RelationQryInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \" + PBName.RelationsInput + \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \" + PBName.RelationsOutput + \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \" + PBName.CleanHisMsgInput + \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \" + PBName.QueryChatRoomInfoInput + \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \" + PBName.QueryChatRoomInfoOutput + \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message \" + PBName.MCFollowInput + \"\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \" + PBName.HistoryMsgInput + \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \" + PBName.HistoryMsgOuput + \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message \" + PBName.RtcQueryListInput + \"{\\n    optional int32 order=1;\\n  }\\n\\n  message \" + PBName.RtcKeyDeleteInput + \"{\\n    repeated string key=1;\\n  }\\n\\n  message \" + PBName.RtcValueInfo + \"{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated \" + PBName.RtcValueInfo + \" userData=2;\\n  }\\n\\n  message \" + PBName.RtcUserListOutput + \"{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n    optional string sessionId=3;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated \" + PBName.RtcValueInfo + \" roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message \" + PBName.RtcInput + \"{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message \" + PBName.RtcQryOutput + \"{\\n    repeated \" + PBName.RtcValueInfo + \" outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message \" + PBName.RtcDataInput + \"{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message \" + PBName.RtcSetDataInput + \"{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message \" + PBName.RtcUserSetDataInput + \" {\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo = 1;\\n    required string objectName = 2;\\n    repeated \" + PBName.RtcValueInfo + \" content = 3;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.RtcTokenOutput + \"{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message \" + PBName.RtcSetOutDataInput + \"{\\n    required targetType target=1;\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message \" + PBName.RtcQryUserOutDataInput + \"{\\n    repeated string userId = 1;\\n  }\\n  message \" + PBName.RtcUserOutDataOutput + \"{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \" + PBName.SessionsAttQryInput + \"{\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.SessionsAttOutput + \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \" + PBName.SessionMsgReadInput + \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteSessionsInput + \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \" + PBName.SessionInfo + \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \" + PBName.DeleteSessionsOutput + \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteMsgInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n  message ChrmKVEntity {\\n    required string key = 1;\\n    required string value = 2;\\n    optional int32 status = 3;\\n    optional int64 timestamp = 4;\\n    optional string uid = 5;\\n  }\\n  message \" + PBName.SetChrmKV + \" {\\n    required ChrmKVEntity entry = 1;\\n    optional bool bNotify = 2;\\n    optional UpStreamMessage notification = 3;\\n    optional ChannelType type = 4;\\n  }\\n  message \" + PBName.ChrmKVOutput + \" {\\n    repeated ChrmKVEntity entries = 1;\\n    optional bool bFullUpdate = 2;\\n    optional int64 syncTime = 3;\\n  }\\n  message \" + PBName.QueryChrmKV + \" {\\n    required int64 timestamp = 1;\\n  }\\n  message \" + PBName.ChrmNotifyMsg + \" {\\t\\n    required int32 type= 1;\\n    optional int64 time= 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SetUserSettingInput + \" {\\n    required int64 version=1;\\n    required string value=2;\\n  }\\n  message \" + PBName.SetUserSettingOutput + \" {\\n    required int64 version=1;\\n    required bool reserve=2;\\n  }\\n  message \" + PBName.PullUserSettingInput + \" {\\n    required int64 version=1;//\\u5F53\\u524D\\u5BA2\\u6237\\u7AEF\\u7684\\u6700\\u5927\\u7248\\u672C\\u53F7\\n    optional bool reserve=2;\\n  }\\n  message \" + PBName.PullUserSettingOutput + \" {\\n    repeated UserSettingItem items = 1;\\n    required int64 version=2;\\n  }\\n  message UserSettingItem {\\n    required string targetId= 1;\\n    required ChannelType type = 2;\\n    required string key = 4;\\n    required bytes value = 5;\\n    required int64 version=6;\\n    required int32 status=7;\\n  }\\n  message \" + PBName.SessionReq + \" {\\n    required int64 time = 1;\\n  }\\n  message \" + PBName.SessionStates + \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \" + PBName.SessionState + \" {\\n    required ChannelType type = 1;\\n    required string channelId = 2;  \\n    optional int64 time = 3;\\n    repeated SessionStateItem stateItem = 4;\\n  }\\n  message \" + PBName.SessionStateItem + \" {\\n    required SessionStateType sessionStateType = 1;\\n    required string value = 2;\\n  }\\n  enum SessionStateType {\\n    IsSilent = 1;\\n    IsTop = 2;\\n  }\\n  message \" + PBName.SessionStateModifyReq + \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \" + PBName.SessionStateModifyResp + \" {\\n    required int64 version=1;\\n  }\\n}\\n\";\n\n  var Codec$1 = {};\n\n  try {\n    Codec$1 = protobuf(SSMsg$1);\n  } catch (e) {\n    Codec$1 = {};\n  }\n\n  Codec$1.getModule = function (pbName) {\n    var modules = new Codec$1[pbName]();\n\n    modules.getArrayData = function () {\n      var data = modules.toArrayBuffer();\n      data = utils.ArrayBufferToArray(data);\n      return data;\n    };\n\n    return modules;\n  };\n\n  var SocketCodec = Codec$1;\n\n  var isGroup$1 = common.isGroup,\n      isChatRoom$1 = common.isChatRoom;\n\n  var Codec$2 = function () {\n    function Codec$$1(option) {\n      this.codec = SocketCodec;\n      option = option || {};\n      var type = option.connectType;\n      type && this.setCodecType(type);\n    }\n\n    var _proto = Codec$$1.prototype;\n\n    _proto.setCodecType = function setCodecType(type) {\n      this.codec = type === CONNECT_TYPE.COMET ? Codec : SocketCodec;\n    };\n\n    _proto.decodeByPBName = function decodeByPBName(data, pbName, option) {\n      var _formatEventMap;\n\n      var self = this;\n      var formatEventMap = (_formatEventMap = {}, _formatEventMap[PBName.DownStreamMessages] = self.formatSyncMessages, _formatEventMap[PBName.DownStreamMessage] = self.formatReceivedMessage, _formatEventMap[PBName.UpStreamMessage] = self.formatSentMessage, _formatEventMap[PBName.HistoryMsgOuput] = self.formatHistoryMessages, _formatEventMap[PBName.RelationsOutput] = self.formatConversationList, _formatEventMap[PBName.QueryChatRoomInfoOutput] = self.formatChatRoomInfos, _formatEventMap[PBName.RtcUserListOutput] = self.formatRTCUserList, _formatEventMap[PBName.RtcQryOutput] = self.formatRTCData, _formatEventMap[PBName.ChrmKVOutput] = self.formatChatRoomKVList, _formatEventMap[PBName.PullUserSettingOutput] = self.formatUserSetting, _formatEventMap[PBName.SessionStates] = self.formatConversationStatus, _formatEventMap);\n      var decodedData = data;\n      var formatEvent = formatEventMap[pbName];\n\n      try {\n        decodedData = self.codec[pbName].decode(data);\n\n        if (utils.isObject(decodedData)) {\n          decodedData = utils.batchInt64ToTimestamp(decodedData);\n        }\n\n        if (utils.isFunction(formatEvent)) {\n          decodedData = formatEvent.call(self, decodedData, option);\n        }\n      } catch (e) {}\n\n      return decodedData;\n    };\n\n    _proto.formatBytes = function formatBytes(content) {\n      try {\n        var _content = content,\n            offset = _content.offset,\n            buffer = _content.buffer,\n            limit = _content.limit;\n\n        if (offset) {\n          content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit);\n          content = BinaryHelper.readUTF(content);\n        }\n\n        content = utils.parseJSON(content);\n      } catch (e) {}\n\n      return content;\n    };\n\n    _proto.formatSyncMessages = function formatSyncMessages(data, option) {\n      option = option || {};\n      var self = this,\n          onMessage = option.onMessage || utils.noop,\n          list = data.list,\n          syncTime = data.syncTime,\n          maxListIndex = list.length - 1;\n      var finished = data.finished;\n\n      if (utils.isUndefined(finished)) {\n        data.finished = finished = true;\n      }\n\n      data.syncTime = utils.int64ToTimestamp(syncTime);\n      data.list = utils.map(list, function (msgData, index) {\n        var message = self.formatReceivedMessage(msgData, option),\n            isLastInAPull = utils.isEqual(index, maxListIndex),\n            isFinished = isLastInAPull && finished;\n\n        try {\n          onMessage({\n            isLastInAPull: isLastInAPull,\n            message: message,\n            finished: isFinished\n          });\n        } catch (e) {\n          utils.consoleError(e);\n        }\n\n        return message;\n      });\n      return data;\n    };\n\n    _proto.formatReceivedMessage = function formatReceivedMessage(data, option) {\n      option = option || {};\n      var self = this;\n\n      var _option = option,\n          currentUserId = _option.currentUserId,\n          connectedTime = _option.connectedTime,\n          content = data.content,\n          fromUserId = data.fromUserId,\n          type = data.type,\n          groupId = data.groupId,\n          status = data.status,\n          dataTime = data.dataTime,\n          messageType = data.classname,\n          messageUId = data.msgId,\n          direction = data.direction || MESSAGE_DIRECTION.RECEIVE,\n          isSelfSend = utils.isEqual(direction, MESSAGE_DIRECTION.SEND),\n          _common$getMessageOpt = common.getMessageOptionByStatus(status),\n          isPersited = _common$getMessageOpt.isPersited,\n          isCounted = _common$getMessageOpt.isCounted,\n          isMentiond = _common$getMessageOpt.isMentiond,\n          disableNotification = _common$getMessageOpt.disableNotification,\n          targetId = isGroup$1(type) || isChatRoom$1(type) ? groupId : fromUserId,\n          senderUserId = isSelfSend ? currentUserId : fromUserId,\n          sentTime = utils.int64ToTimestamp(dataTime),\n          isOffLineMessage = sentTime < connectedTime,\n          isChatRoomMsg = common.isChatRoom(type);\n\n      var messageDirection = isSelfSend ? MESSAGE_DIRECTION.SEND : MESSAGE_DIRECTION.RECEIVE;\n\n      if (isChatRoomMsg && utils.isEqual(fromUserId, currentUserId)) {\n        messageDirection = MESSAGE_DIRECTION.SEND;\n      }\n\n      var isMentioned = isMentiond;\n      return {\n        type: type,\n        targetId: targetId,\n        senderUserId: senderUserId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        isMentiond: isMentiond,\n        isMentioned: isMentioned,\n        sentTime: sentTime,\n        isOffLineMessage: isOffLineMessage,\n        messageDirection: messageDirection,\n        receivedTime: common.DelayTimer.getTime(),\n        disableNotification: disableNotification,\n        content: self.formatBytes(content)\n      };\n    };\n\n    _proto.formatSentMessage = function formatSentMessage(data, option) {\n      var self = this;\n\n      var content = data.content,\n          messageType = data.classname,\n          sessionId = data.sessionId,\n          messageUId = data.msgId,\n          signal = option.signal,\n          currentUserId = option.currentUserId,\n          date = signal.date,\n          topic = signal.topic,\n          targetId = signal.targetId,\n          _common$getPersitedAn = common.getPersitedAndCountedAndSlientBySessionId(sessionId),\n          isPersited = _common$getPersitedAn.isPersited,\n          isCounted = _common$getPersitedAn.isCounted,\n          disableNotification = _common$getPersitedAn.disableNotification,\n          type = PUBLISH_TOPIC_TO_CONVERSATION_TYPE[topic] || CONVERSATION_TYPE.PRIVATE,\n          isStatusMessage = utils.isInclude(PUBLISH_STATUS_TOPIC, topic);\n\n      return {\n        type: type,\n        targetId: targetId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        isStatusMessage: isStatusMessage,\n        senderUserId: currentUserId,\n        content: self.formatBytes(content),\n        sentTime: utils.secondsToMilliseconds(date),\n        receivedTime: common.DelayTimer.getTime(),\n        messageDirection: MESSAGE_DIRECTION.SEND,\n        isOffLineMessage: false,\n        disableNotification: disableNotification\n      };\n    };\n\n    _proto.formatHistoryMessages = function formatHistoryMessages(data, option) {\n      var self = this;\n      var conversation = option.conversation || {},\n          msgList = data.list,\n          hasMsg = data.hasMsg,\n          targetId = conversation.targetId,\n          syncTime = utils.int64ToTimestamp(data.syncTime);\n      var list = [];\n      utils.forEach(msgList, function (msgData) {\n        var msg = self.formatReceivedMessage(msgData, option);\n        msg.targetId = targetId;\n        list.push(msg);\n      }, {\n        isReverse: true\n      });\n      return {\n        syncTime: syncTime,\n        list: list,\n        hasMore: !!hasMsg\n      };\n    };\n\n    _proto.formatConversationList = function formatConversationList(serverData, option) {\n      var self = this;\n      var conversationList = serverData.info;\n      var afterDecode = option.afterDecode || utils.noop;\n      conversationList = utils.map(conversationList, function (serverConversation) {\n        var msg = serverConversation.msg,\n            userId = serverConversation.userId,\n            type = serverConversation.type,\n            unreadCount = serverConversation.unreadCount;\n        msg = self.formatReceivedMessage(msg, option);\n        msg.targetId = userId;\n        var conversation = {\n          targetId: userId,\n          type: type,\n          unreadMessageCount: unreadCount,\n          latestMessage: msg\n        };\n        return afterDecode(conversation) || conversation;\n      });\n      return conversationList || [];\n    };\n\n    _proto.formatChatRoomInfos = function formatChatRoomInfos(data) {\n      var userTotalNums = data.userTotalNums,\n          userInfos = data.userInfos;\n      userInfos = utils.map(userInfos, function (user) {\n        var id = user.id,\n            time = user.time;\n        time = utils.int64ToTimestamp(time);\n        return {\n          id: id,\n          time: time\n        };\n      });\n      return {\n        userCount: userTotalNums,\n        userInfos: userInfos\n      };\n    };\n\n    _proto.formatRTCUserList = function formatRTCUserList(rtcInfos) {\n      var list = rtcInfos.list,\n          token = rtcInfos.token,\n          sessionId = rtcInfos.sessionId;\n      var users = {};\n      utils.forEach(list, function (item) {\n        var userId = item.userId,\n            userData = item.userData;\n        var tmpData = {};\n        utils.forEach(userData, function (data) {\n          var key = data.key,\n              value = data.value;\n          tmpData[key] = value;\n        });\n        users[userId] = tmpData;\n      });\n      return {\n        users: users,\n        token: token,\n        sessionId: sessionId\n      };\n    };\n\n    _proto.formatRTCData = function formatRTCData(data) {\n      var list = data.outInfo;\n      var props = {};\n      utils.forEach(list, function (item) {\n        props[item.key] = item.value;\n      });\n      return props;\n    };\n\n    _proto.formatRTCRoomInfo = function formatRTCRoomInfo(data) {\n      var id = data.roomId,\n          total = data.userCount,\n          roomData = data.roomData;\n      var room = {\n        id: id,\n        total: total\n      };\n      utils.forEach(roomData, function (data) {\n        room[data.key] = data.value;\n      });\n      return room;\n    };\n\n    _proto.formatChatRoomKVList = function formatChatRoomKVList(data) {\n      var kvEntries = data.entries,\n          isFullUpdate = data.bFullUpdate,\n          syncTime = data.syncTime;\n      kvEntries = kvEntries || [];\n      kvEntries = utils.map(kvEntries, function (kv) {\n        var key = kv.key,\n            value = kv.value,\n            status = kv.status,\n            timestamp = kv.timestamp,\n            uid = kv.uid;\n\n        var _common$getChatRoomKV = common.getChatRoomKVByStatus(status),\n            isAutoDelete = _common$getChatRoomKV.isAutoDelete,\n            isOverwrite = _common$getChatRoomKV.isOverwrite,\n            type = _common$getChatRoomKV.type;\n\n        return {\n          key: key,\n          value: value,\n          isAutoDelete: isAutoDelete,\n          isOverwrite: isOverwrite,\n          type: type,\n          userId: uid,\n          timestamp: utils.int64ToTimestamp(timestamp)\n        };\n      });\n      return {\n        kvEntries: kvEntries,\n        isFullUpdate: isFullUpdate,\n        syncTime: syncTime\n      };\n    };\n\n    _proto.formatUserSetting = function formatUserSetting(data) {\n      var self = this;\n      var items = data.items,\n          version = data.version;\n      var settings = {};\n      utils.forEach(items || [], function (setting) {\n        var key = setting.key,\n            version = setting.version,\n            value = setting.value;\n        setting.version = utils.int64ToTimestamp(version);\n        setting.value = self.formatBytes(value);\n        settings[key] = setting;\n      });\n      return {\n        settings: settings,\n        version: version\n      };\n    };\n\n    _proto.formatConversationStatus = function formatConversationStatus(data) {\n      var stateList = data.state;\n      var statusList = [];\n      utils.forEach(stateList, function (session) {\n        var type = session.type,\n            targetId = session.channelId,\n            updatedTime = session.time,\n            stateItem = session.stateItem;\n        var notificationStatus = NOTIFICATION_STATUS.NOTIFY,\n            isTop = false;\n        utils.forEach(stateItem, function (_ref) {\n          var sessionStateType = _ref.sessionStateType,\n              value = _ref.value;\n\n          switch (sessionStateType) {\n            case CONVERSATION_STATUS_TYPE.DO_NOT_DISTURB:\n              notificationStatus = utils.isEqual(value, CONVERSATION_STATUS_CONFIG.ENABLED) ? NOTIFICATION_STATUS.DO_NOT_DISTURB : NOTIFICATION_STATUS.NOTIFY;\n              break;\n\n            case CONVERSATION_STATUS_TYPE.TOP:\n              isTop = utils.isEqual(value, CONVERSATION_STATUS_CONFIG.ENABLED);\n              break;\n\n            default:\n              break;\n          }\n        });\n        statusList.push({\n          type: type,\n          targetId: targetId,\n          notificationStatus: notificationStatus,\n          isTop: isTop,\n          updatedTime: utils.int64ToTimestamp(updatedTime)\n        });\n      });\n      return statusList;\n    };\n\n    _proto.encodeServerConfParams = function encodeServerConfParams() {\n      var modules = this.codec.getModule(PBName.SessionsAttQryInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.getUpMsgModule = function getUpMsgModule(conversation, option) {\n      var type = conversation.type;\n      var messageType = option.messageType,\n          isMentiond = option.isMentiond,\n          mentiondType = option.mentiondType,\n          mentiondUserIdList = option.mentiondUserIdList,\n          content = option.content,\n          pushContent = option.pushContent,\n          pushData = option.pushData,\n          directionalUserIdList = option.directionalUserIdList,\n          isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n          isVoipPush = option.isVoipPush;\n      var isGroupType = common.isGroup(type);\n      var modules = this.codec.getModule(PBName.UpStreamMessage);\n      var sessionId = common.getSessionId(option);\n      var flag = 0;\n      modules.setSessionId(sessionId);\n\n      if (isGroupType && isMentiond && content) {\n        content.mentionedInfo = {\n          userIdList: mentiondUserIdList,\n          type: mentiondType || MENTIOND_TYPE.ALL\n        };\n      }\n\n      pushContent && modules.setPushText(pushContent);\n      pushData && modules.setAppData(pushData);\n      directionalUserIdList && modules.setUserId(directionalUserIdList);\n      flag |= isVoipPush ? 0x01 : 0;\n      flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n      modules.setConfigFlag(flag);\n      modules.setClassname(messageType);\n      modules.setContent(utils.toJSON(content));\n      return modules;\n    };\n\n    _proto.encodeUpMsg = function encodeUpMsg(conversation, option) {\n      var modules = this.getUpMsgModule(conversation, option);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSyncMsg = function encodeSyncMsg(syncMsgArgs) {\n      var sendboxTime = syncMsgArgs.sendboxTime,\n          inboxTime = syncMsgArgs.inboxTime;\n      var modules = this.codec.getModule(PBName.SyncRequestMsg);\n      modules.setIspolling(false);\n      modules.setIsPullSend(true);\n      modules.setSendBoxSyncTime(sendboxTime);\n      modules.setSyncTime(inboxTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeChrmSyncMsg = function encodeChrmSyncMsg(time, count) {\n      time = time || 0;\n      count = count || 0;\n      var modules = this.codec.getModule(PBName.ChrmPullMsg);\n      modules.setCount(count);\n      modules.setSyncTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetHistoryMsg = function encodeGetHistoryMsg(conversation, option) {\n      var targetId = conversation.targetId;\n      var count = option.count,\n          order = option.order,\n          timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.HistoryMsgInput);\n      modules.setTargetId(targetId);\n      modules.setTime(timestrap);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationList = function encodeGetConversationList(option) {\n      option = option || {};\n      var _option2 = option,\n          count = _option2.count,\n          startTime = _option2.startTime;\n      var modules = this.codec.getModule(PBName.RelationQryInput);\n      modules.setType(1);\n      modules.setCount(count);\n      modules.setStartTime(startTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeOldConversationList = function encodeOldConversationList(option) {\n      option = option || {};\n      var _option3 = option,\n          count = _option3.count,\n          type = _option3.type;\n      var modules = this.codec.getModule(PBName.RelationsInput);\n      type = type || CONVERSATION_TYPE.PRIVATE;\n      count = count || 0;\n      modules.setType(type);\n      modules.setCount(count);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveConversationList = function encodeRemoveConversationList(conversationList) {\n      var _this = this;\n\n      var modules = this.codec.getModule(PBName.DeleteSessionsInput);\n      var sessions = [];\n      utils.forEach(conversationList, function (conversation) {\n        var type = conversation.type,\n            targetId = conversation.targetId;\n\n        var session = _this.codec.getModule(PBName.SessionInfo);\n\n        session.setType(type);\n        session.setChannelId(targetId);\n        sessions.push(session);\n      });\n      modules.setSessions(sessions);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeDeleteMessages = function encodeDeleteMessages(conversation, messages) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var modules = this.codec.getModule(PBName.DeleteMsgInput);\n      var encodeMsgs = [];\n      utils.forEach(messages, function (message) {\n        encodeMsgs.push({\n          msgId: message.messageUId,\n          msgDataTime: message.sentTime,\n          direct: message.messageDirection\n        });\n      });\n      modules.setType(type);\n      modules.setConversationId(targetId);\n      modules.setMsgs(encodeMsgs);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearMessages = function encodeClearMessages(conversation, option) {\n      var targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.CleanHisMsgInput);\n      timestrap = timestrap || utils.getCurrentTimestamp();\n      modules.setDataTime(timestrap);\n      modules.setTargetId(targetId);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearUnreadCount = function encodeClearUnreadCount(conversation, option) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.SessionMsgReadInput);\n      timestrap = timestrap || +new Date();\n      modules.setType(type);\n      modules.setChannelId(targetId);\n      modules.setMsgTime(timestrap);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinOrQuitChatRoom = function encodeJoinOrQuitChatRoom() {\n      var modules = this.codec.getModule(PBName.ChrmInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetChatRoomInfo = function encodeGetChatRoomInfo(option) {\n      option = option || {};\n      var _option4 = option,\n          count = _option4.count,\n          order = _option4.order;\n      var modules = this.codec.getModule(PBName.QueryChatRoomInfoInput);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinRTCRoom = function encodeJoinRTCRoom(room) {\n      var mode = room.mode,\n          broadcastType = room.broadcastType;\n      var modules = this.codec.getModule(PBName.RtcInput);\n      mode = mode || 0;\n      modules.setRoomType(mode);\n      !utils.isUndefined(broadcastType) && modules.setBroadcastType(broadcastType);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeQuitRTCRoom = function encodeQuitRTCRoom() {\n      return this.codec.getModule(PBName.SetUserStatusInput).getArrayData();\n    };\n\n    _proto.encodeSetRTCData = function encodeSetRTCData(key, value, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcSetDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(key);\n      modules.setValue(value);\n      message = message || {};\n      var _message = message,\n          name = _message.name,\n          content = _message.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeUserSetRTCData = function encodeUserSetRTCData(message, valueInfo, objectName) {\n      var modules = this.codec.getModule(PBName.RtcUserSetDataInput);\n      modules.setObjectName(objectName);\n      var val = this.codec.getModule(PBName.RtcValueInfo);\n      val.setKey(message.name);\n      val.setValue(message.content);\n      modules.setContent(val);\n      val = this.codec.getModule(PBName.RtcValueInfo);\n      val.setKey('uris');\n      val.setValue(valueInfo);\n      modules.setValueInfo(val);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCData = function encodeGetRTCData(keys, isInner, apiType) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCData = function encodeRemoveRTCData(keys, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      message = message || {};\n      var _message2 = message,\n          name = _message2.name,\n          content = _message2.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCOutData = function encodeSetRTCOutData(data, type, message) {\n      var modules = this.codec.getModule(PBName.RtcSetOutDataInput);\n      modules.setTarget(type);\n\n      if (!utils.isArray(data)) {\n        data = [data];\n      }\n\n      utils.forEach(data, function (item, index) {\n        item.key = item.key ? item.key.toString() : item.key;\n        item.value = item.value ? item.value.toString() : item.value;\n        data[index] = item;\n      });\n      modules.setValueInfo(data);\n      message = message || {};\n      var _message3 = message,\n          name = _message3.name,\n          content = _message3.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.ecnodeGetRTCOutData = function ecnodeGetRTCOutData(userIds) {\n      var modules = this.codec.getModule(PBName.RtcQryUserOutDataInput);\n      modules.setUserId(userIds);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCState = function encodeSetRTCState(content) {\n      var modules = this.codec.getModule(PBName.MCFollowInput);\n      var report = content.report;\n      modules.setId(report);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCRoomInfo = function encodeGetRTCRoomInfo() {\n      var modules = this.codec.getModule(PBName.RtcQueryListInput);\n      modules.setOrder(2);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCUserInfo = function encodeSetRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcValueInfo);\n      var key = info.key,\n          value = info.value;\n      modules.setKey(key);\n      modules.setValue(value);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCUserInfo = function encodeRemoveRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcKeyDeleteInput);\n      var keys = info.keys || [];\n\n      if (!utils.isArray(keys)) {\n        keys = [keys];\n      }\n\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileToken = function encodeGetFileToken(fileType, fileName) {\n      var modules = this.codec.getModule(PBName.GetQNupTokenInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileUrl = function encodeGetFileUrl(fileType, fileName, originName) {\n      var modules = this.codec.getModule(PBName.GetQNdownloadUrlInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n\n      if (originName) {\n        modules.setFileName(originName);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeModifyChatRoomKV = function encodeModifyChatRoomKV(chrm, entry, action, currentUserId) {\n      var modules = this.codec.getModule(PBName.SetChrmKV);\n      var key = entry.key,\n          value = entry.value,\n          extra = entry.notificationExtra,\n          isSendNotification = entry.isSendNotification;\n      var status = common.getChatRoomKVOptStatus(entry, action);\n      var serverEntry = {\n        key: key,\n        status: status,\n        value: value || '',\n        uid: currentUserId\n      };\n\n      if (utils.isEmpty(serverEntry.status)) {\n        delete serverEntry.status;\n      }\n\n      modules.setEntry(serverEntry);\n\n      if (isSendNotification) {\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: chrm.id\n        };\n        var msgContent = {\n          key: key,\n          value: value,\n          extra: extra,\n          type: action\n        };\n        var msgModule = this.getUpMsgModule(conversation, {\n          messageType: MESSAGE_TYPE.CHRM_KV_NOTIFY,\n          content: msgContent,\n          isPersited: false,\n          isCounted: false\n        });\n        modules.setNotification(msgModule);\n        modules.setBNotify(true);\n        modules.setType(CONVERSATION_TYPE.CHATROOM);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullChatRoomKV = function encodePullChatRoomKV(time) {\n      var modules = this.codec.getModule(PBName.QueryChrmKV);\n      modules.setTimestamp(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullUserSetting = function encodePullUserSetting(version) {\n      var modules = this.codec.getModule(PBName.PullUserSettingInput);\n      modules.setVersion(version);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationStatus = function encodeGetConversationStatus(time) {\n      var modules = this.codec.getModule(PBName.SessionReq);\n      modules.setTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetConversationStatus = function encodeSetConversationStatus(statusList) {\n      var _this2 = this;\n\n      var modules = this.codec.getModule(PBName.SessionStateModifyReq),\n          currentTime = common.DelayTimer.getTime();\n      var stateModuleList = [];\n      utils.forEach(statusList, function (status) {\n        var stateModules = _this2.codec.getModule(PBName.SessionState);\n\n        var type = status.type,\n            targetId = status.targetId,\n            notificationStatus = status.notificationStatus,\n            isTop = status.isTop;\n        var stateItemModuleList = [];\n        stateModules.setType(type);\n        stateModules.setChannelId(targetId);\n        stateModules.setTime(currentTime);\n        var isNotDisturb = utils.isEqual(notificationStatus, NOTIFICATION_STATUS.DO_NOT_DISTURB);\n        var TypeToVal = {};\n\n        if (!utils.isUndefined(notificationStatus)) {\n          TypeToVal[CONVERSATION_STATUS_TYPE.DO_NOT_DISTURB] = isNotDisturb;\n        }\n\n        if (!utils.isUndefined(isTop)) {\n          TypeToVal[CONVERSATION_STATUS_TYPE.TOP] = isTop;\n        }\n\n        utils.forEach(TypeToVal, function (val, type) {\n          if (!utils.isUndefined(val)) {\n            var stateItemModules = _this2.codec.getModule(PBName.SessionStateItem);\n\n            val = val ? CONVERSATION_STATUS_CONFIG.ENABLED : CONVERSATION_STATUS_CONFIG.DISABLED;\n            stateItemModules.setSessionStateType(Number(type));\n            stateItemModules.setValue(val);\n            stateItemModuleList.push(stateItemModules);\n          }\n        });\n        stateModules.setStateItem(stateItemModuleList);\n        stateModuleList.push(stateModules);\n      });\n      modules.setVersion(currentTime);\n      modules.setState(stateModuleList);\n      return modules.getArrayData();\n    };\n\n    return Codec$$1;\n  }();\n\n  var DeferHandler$3 = utils.DeferHandler,\n      Defer$2 = utils.Defer;\n  var SignalId$1 = common.SignalId;\n\n  var ServerEngine = function () {\n    function ServerEngine(option) {\n      this._transporter = void 0;\n      this._serverEventEmitter = new utils.EventEmitter();\n      this._deferHandler = new DeferHandler$3();\n      this._serverDataCodec = void 0;\n      this._selfUserId = void 0;\n      this._connectedTime = void 0;\n      this.option = void 0;\n      var self = this;\n      var transporter = new Transporter(option);\n      transporter.watchSignal(function (signal) {\n        self._handleSignal(signal);\n      });\n      transporter.watchStatus(function (status) {\n        Logger.info(TAG.L_NETWORK_CHANGED_S, status);\n\n        self._handleStatus(status);\n      });\n      self._serverDataCodec = new Codec$2(option);\n      utils.extend(self, {\n        _transporter: transporter,\n        option: option\n      });\n    }\n\n    var _proto = ServerEngine.prototype;\n\n    _proto._handleStatus = function _handleStatus(status) {\n      if (common.isDisconnected(status)) {\n        this.disconnect();\n        var currentTime = utils.getCurrentTimestamp();\n        var isDisconnectTooFast = currentTime - this._connectedTime < MINIMUM_CONNECT_DURATION;\n        var NotSwitchStauts = [TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT];\n\n        if (isDisconnectTooFast && !utils.isInclude(NotSwitchStauts, status)) {\n          return this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST);\n        }\n      }\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, status);\n    };\n\n    _proto._handleSignal = function _handleSignal(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var messageId = signal.messageId;\n\n      if (messageId && signal.getIdentifier) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.resolve(deferId, signal);\n      }\n\n      self._handleSignalAck(signal);\n\n      self._dispatchTask(signal);\n    };\n\n    _proto._handleSignalAck = function _handleSignalAck(signal) {\n      var _transporter = this._transporter;\n      var messageId = signal.messageId;\n      var isQosNeedAck = signal._header && signal._header.qos !== QOS.AT_MOST_ONCE;\n\n      if (signal instanceof PublishReader && !signal.syncMsg && isQosNeedAck) {\n        var writer = new PubAckWriter(messageId);\n\n        _transporter.sendSignal(writer);\n      }\n\n      if (signal instanceof QueryAckReader && isQosNeedAck) {\n        var _writer = new QueryConWriter(messageId);\n\n        _transporter.sendSignal(_writer);\n      }\n    };\n\n    _proto._dispatchTask = function _dispatchTask(signal) {\n      var self = this;\n\n      if (signal instanceof DisconnectReader) {\n        var status = signal.status;\n        status = SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS[status] || status;\n        return self._handleStatus(status);\n      }\n\n      if (signal instanceof PublishReader) {\n        var _PUBLISH_TOPIC$NOTIFY;\n\n        var isSyncMsgSentBySelfOtherClient = signal.syncMsg,\n            topic = signal.topic;\n\n        if (isSyncMsgSentBySelfOtherClient) {\n          return self._receiveMsgFromOtherDevice(signal);\n        }\n\n        var task = (_PUBLISH_TOPIC$NOTIFY = {}, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.NOTIFY_PULL_MSG] = self._notifyPullMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.RECEIVE_MSG] = self._notifyDirectMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SERVER_NOTIFY] = self._notifyForServer, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SETTING_NOTIFY] = self._notifySettingChanged, _PUBLISH_TOPIC$NOTIFY)[topic] || utils.noop;\n        task.call(self, signal);\n      }\n    };\n\n    _proto._notifyPullMessage = function _notifyPullMessage(signal) {\n      var notifyPullConfig = this._serverDataCodec.decodeByPBName(signal.data, PBName.NotifyMsg);\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.NOTIFY_PULL, notifyPullConfig);\n    };\n\n    _proto._notifyDirectMessage = function _notifyDirectMessage(signal) {\n      var currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n\n      var msg = this._serverDataCodec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n        currentUserId: currentUserId,\n        connectedTime: connectedTime\n      });\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n    };\n\n    _proto._notifyForServer = function _notifyForServer(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.ChrmNotifyMsg),\n          type = notifyData.type;\n\n      Logger.info(TAG.P_NOTIFY_CHRM_KV_S, notifyData);\n\n      switch (type) {\n        case SERVER_NOTIFY_TYPE.KV_CHANGED:\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_CHANGED, notifyData);\n\n          break;\n\n        case SERVER_NOTIFY_TYPE.CONVERSATION_STATUS_CHANGED:\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED, notifyData.time);\n\n          break;\n\n        default:\n          break;\n      }\n    };\n\n    _proto._notifySettingChanged = function _notifySettingChanged(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.UserSettingNotification);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.USER_SETTING_CHANGED, notifyData);\n    };\n\n    _proto._sendSignal = function _sendSignal(writer, decodePBName, option) {\n      var appkey = this.option.appkey,\n          _serverDataCodec = this._serverDataCodec;\n      var _transporter = this._transporter,\n          _deferHandler = this._deferHandler,\n          currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n      var signalId = SignalId$1.get({\n        appkey: appkey,\n        userId: currentUserId\n      });\n\n      if (SignalId$1.isExceedLimit(signalId)) {\n        this._handleStatus(TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT);\n\n        return utils.Defer.reject(ERROR_INFO.TIMEOUT);\n      }\n\n      writer.messageId = signalId;\n      var deferId = writer.getIdentifier();\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n\n        _transporter.sendSignal(writer);\n      }).then(function (signal) {\n        var status = signal.status,\n            data = signal.data;\n        var isSuccess = utils.isEqual(status, SUCCESS_CODE);\n        var result = isSuccess ? signal : {\n          status: SERVER_ERROR_TO_CODE[status] || status\n        };\n\n        if (isSuccess && decodePBName) {\n          signal.data = _serverDataCodec.decodeByPBName(data, decodePBName, utils.extend({\n            signal: signal,\n            currentUserId: currentUserId,\n            connectedTime: connectedTime\n          }, option));\n        }\n\n        var exec = isSuccess ? Defer$2.resolve : Defer$2.reject;\n        return exec.call(Defer$2, result);\n      });\n    };\n\n    _proto._sendSignalForData = function _sendSignalForData(writer, decodePBName, option) {\n      return this._sendSignal(writer, decodePBName, option).then(function (successSignal) {\n        var data = decodePBName ? successSignal.data : undefined;\n        return data;\n      });\n    };\n\n    _proto._receiveMsgFromOtherDevice = function _receiveMsgFromOtherDevice(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          currentUserId = self._selfUserId,\n          connectType = self.option.connectType,\n          _serverDataCodec = self._serverDataCodec;\n      var isComet = connectType === CONNECT_TYPE.COMET;\n      var data = signal.data,\n          topic = signal.topic;\n\n      var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n        currentUserId: currentUserId,\n        signal: signal\n      });\n\n      if (isComet || msg.isStatusMessage) {\n        msg.sentTime = common.DelayTimer.getTime();\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      }\n\n      return utils.deferred(function (resolve, reject) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (ackSignal) {\n        msg.messageUId = ackSignal.messageUId;\n        msg.sentTime = ackSignal.timestamp;\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      })[\"catch\"](function (error) {\n        Logger.error(TAG.L_DECODE_MSG_E, {\n          content: {\n            info: 'received msg from other device error',\n            error: error,\n            topic: topic\n          }\n        });\n      });\n    };\n\n    _proto.watch = function watch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.off(eventName, event);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporter = self._transporter;\n      return _transporter.connect(user, option).then(function (result) {\n        var isConnectSuccess = utils.isEqual(result.status, SUCCESS_CODE);\n        return isConnectSuccess ? Defer$2.resolve(result) : Defer$2.reject(result);\n      }).then(function (_ref) {\n        var userId = _ref.userId,\n            timestamp = _ref.timestamp;\n        self._selfUserId = userId;\n        self._connectedTime = timestamp;\n        return {\n          id: userId\n        };\n      }, function (_ref2) {\n        var status = _ref2.status;\n        var errorInfo = CONNECT_SERVER_STATUS_MAP_ERROR_INFO[status] || {\n          code: status\n        };\n        return utils.Defer.reject(errorInfo);\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      var appkey = this.option.appkey;\n      var _transporter = this._transporter,\n          _selfUserId = this._selfUserId;\n      _transporter && _transporter.disconnect();\n      SignalId$1.clear({\n        appkey: appkey,\n        userId: _selfUserId\n      });\n      return Defer$2.resolve(_selfUserId);\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      var connectedTime = this._connectedTime;\n      return connectedTime;\n    };\n\n    _proto.getServerConfig = function getServerConfig() {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeServerConfParams();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_SYNC_TIME, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.SessionsAttOutput);\n    };\n\n    _proto.pullMessageList = function pullMessageList(syncMsgArgs, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeSyncMsg(syncMsgArgs);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_MSG, data, _selfUserId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.pullChrmMessageList = function pullChrmMessageList(chatRoomId, time, count, option) {\n      time = time || 0;\n      count = count || 0;\n\n      var data = this._serverDataCodec.encodeChrmSyncMsg(time, count);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_CHRM_MSG, data, chatRoomId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, sendOption, topic) {\n      var self = this;\n      var currentUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec;\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var isStatusMessage = sendOption.isStatusMessage;\n      isStatusMessage = isStatusMessage && common.isSupportStatusMessage(type);\n      var publishTopic = topic || CONVERSATION_TYPE_TO_PUBLISH_TOPIC[type] || PUBLISH_TOPIC.PRIVATE;\n\n      if (isStatusMessage && utils.isUndefined(topic)) {\n        publishTopic = CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n      }\n\n      var data = _serverDataCodec.encodeUpMsg(conversation, sendOption);\n\n      var signal = new PublishWriter(publishTopic, data, targetId);\n      signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n\n      var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n        signal: signal,\n        currentUserId: currentUserId\n      });\n\n      if (isStatusMessage) {\n        self._sendSignal(signal)[\"catch\"](function () {});\n\n        msg.sentTime = common.DelayTimer.getTime();\n        return utils.Defer.resolve(msg);\n      }\n\n      return self._sendSignal(signal).then(function (_ref3) {\n        var messageUId = _ref3.messageUId,\n            timestamp = _ref3.timestamp;\n        msg.messageUId = messageUId;\n        msg.sentTime = timestamp;\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.MESSAGE_SEND, msg);\n\n        return msg;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var upMsgArgs = utils.extend(option || {}, message);\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var messageUId = message.messageUId,\n          sentTime = message.sentTime;\n      upMsgArgs.messageType = RECALL_MESSAGE_TYPE;\n      upMsgArgs.content = {\n        conversationType: type,\n        targetId: targetId,\n        messageUId: messageUId,\n        sentTime: sentTime\n      };\n      return this.sendMessage({\n        type: type,\n        targetId: this._selfUserId\n      }, upMsgArgs, PUBLISH_TOPIC.RECALL);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, fileName) {\n      var data = this._serverDataCodec.encodeGetFileToken(fileType, fileName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_TOKEN, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNupTokenOutput);\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n      var data = this._serverDataCodec.encodeGetFileUrl(fileType, fileName, originName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_URL, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNdownloadUrlOutput);\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeGetConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.RelationsOutput);\n    };\n\n    _proto.removeConversationList = function removeConversationList(conversationList) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeRemoveConversationList(conversationList);\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.DeleteSessionsOutput);\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      return this.removeConversationList([conversation]);\n    };\n\n    _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var type = conversation.type;\n      var historyTopic = CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC[type] || QUERY_HISTORY_TOPIC.PRIVATE;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeDeleteMessages(conversation, messages);\n\n      var writer = new QueryWriter(QUERY_TOPIC.DELETE_MESSAGES, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId;\n      var type = conversation.type;\n\n      var data = this._serverDataCodec.encodeClearMessages(conversation, option);\n\n      var topic = CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC[type];\n      var writer = new QueryWriter(topic, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      return this.getServerConfig().then(function (_ref4) {\n        var totalUnreadCount = _ref4.totalUnreadCount;\n        return totalUnreadCount;\n      });\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeClearUnreadCount(conversation, option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.CLEAR_UNREAD_COUNT, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var id = chrm.id;\n      var count = option.count,\n          isJoinExist = option.isJoinExist,\n          isAutoRejoin = option.isAutoRejoin;\n\n      var data = self._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var topic = isJoinExist ? QUERY_TOPIC.JOIN_EXIST_CHATROOM : QUERY_TOPIC.JOIN_CHATROOM;\n      var writer = new QueryWriter(topic, data, id);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM, {\n        id: id\n      });\n\n      return self._sendSignalForData(writer).then(function (result) {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.JOIN_CHATROOM, {\n          id: id,\n          count: count,\n          isAutoRejoin: isAutoRejoin\n        });\n\n        return result;\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_CHATROOM, data, id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeGetChatRoomInfo(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CHATROOM_INFO, data, id);\n      return this._sendSignalForData(writer, PBName.QueryChatRoomInfoOutput);\n    };\n\n    _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var targetId = chrm.id;\n      var type = CONVERSATION_TYPE.CHATROOM;\n      var conversation = {\n        type: type,\n        targetId: targetId\n      };\n      var historyTopic = QUERY_HISTORY_TOPIC.CHATROOM;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.modifyChatRoomKV = function modifyChatRoomKV(chrm, entry) {\n      var self = this;\n\n      var _selfUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec,\n          chatRoomId = chrm.id,\n          action = entry.type || CHATROOM_ENTRY_TYPE.UPDATE,\n          data = _serverDataCodec.encodeModifyChatRoomKV(chrm, entry, action, _selfUserId),\n          topic = utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE) ? QUERY_TOPIC.DELETE_CHATROOM_KV : QUERY_TOPIC.UPDATE_CHATROOM_KV,\n          writer = new QueryWriter(topic, data, chatRoomId);\n\n      return this._sendSignalForData(writer).then(function () {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_SET, {\n          id: chatRoomId,\n          data: {\n            kvEntries: [entry],\n            syncTime: common.DelayTimer.getTime()\n          }\n        });\n      });\n    };\n\n    _proto.pullChatRoomKV = function pullChatRoomKV(chrm, time) {\n      var _serverDataCodec = this._serverDataCodec,\n          chatRoomId = chrm.id,\n          data = _serverDataCodec.encodePullChatRoomKV(time),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_CHATROOM_KV, data, chatRoomId);\n\n      return this._sendSignalForData(writer, PBName.ChrmKVOutput);\n    };\n\n    _proto.getUserSettings = function getUserSettings(version) {\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodePullUserSetting(version),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_USER_SETTING, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.PullUserSettingOutput);\n    };\n\n    _proto.getConversationStatus = function getConversationStatus(time) {\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodeGetConversationStatus(time),\n          writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_STATUS, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.SessionStates);\n    };\n\n    _proto.setConversationStatusList = function setConversationStatusList(statusList) {\n      var self = this;\n\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodeSetConversationStatus(statusList),\n          writer = new QueryWriter(QUERY_TOPIC.SET_CONVERSATION_STATUS, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.SessionStateModifyResp).then(function (_ref5) {\n        var version = _ref5.version;\n        statusList = utils.map(statusList, function (status) {\n          status.updatedTime = version;\n          return status;\n        });\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED, statusList);\n\n        return true;\n      });\n    };\n\n    _proto.joinRTCRoom = function joinRTCRoom(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.quitRTCRoom = function quitRTCRoom(room) {\n      var data = this._serverDataCodec.encodeQuitRTCRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.RTCPing = function RTCPing(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PING_RTC, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCRoomInfo = function getRTCRoomInfo(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_ROOM_INFO, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcRoomInfoOutput);\n    };\n\n    _proto.getRTCUserInfoList = function getRTCUserInfoList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_INFO_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.setRTCUserInfo = function setRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeSetRTCUserInfo(info);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.removeRTCUserInfo = function removeRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeRemoveRTCUserInfo(info);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCData = function setRTCData(roomId, key, value, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeSetRTCData(key, value, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCUserData = function setRTCUserData(roomId, message, valueInfo, objectName) {\n      var data = this._serverDataCodec.encodeUserSetRTCData(message, valueInfo, objectName);\n\n      var writer = new PublishWriter(QUERY_TOPIC.USER_SET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCData = function getRTCData(roomId, keys, isInner, apiType) {\n      var data = this._serverDataCodec.encodeGetRTCData(keys, isInner, apiType);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcQryOutput);\n    };\n\n    _proto.removeRTCData = function removeRTCData(roomId, keys, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeRemoveRTCData(keys, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCOutData = function setRTCOutData(roomId, rtcData, type, message) {\n      var data = this._serverDataCodec.encodeSetRTCOutData(rtcData, type, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCOutData = function getRTCOutData(roomId, userIds) {\n      var data = this._serverDataCodec.ecnodeGetRTCOutData(userIds);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcUserOutDataOutput);\n    };\n\n    _proto.getRTCToken = function getRTCToken(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_TOKEN, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcTokenOutput);\n    };\n\n    _proto.setRTCState = function setRTCState(room, content) {\n      var data = this._serverDataCodec.encodeSetRTCState(content);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_STATE, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCUserList = function getRTCUserList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.getOldServerConfig = function getOldServerConfig(userId) {\n      var appkey = this.option.appkey;\n      var syncTime = new common.MessageTimeSyner({\n        appkey: appkey,\n        userId: userId\n      }).get();\n      return Defer$2.resolve(syncTime);\n    };\n\n    _proto.getOldConversationList = function getOldConversationList(option, formatOpt) {\n      var self = this;\n      var _selfUserId = self._selfUserId;\n\n      var data = self._serverDataCodec.encodeOldConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_OLD_CONVERSATION_LIST, data, _selfUserId);\n      return self._sendSignalForData(writer, PBName.RelationsOutput, formatOpt);\n    };\n\n    _proto.removeOldConversation = function removeOldConversation(conversation) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n\n      var data = this._serverDataCodec.encodeOldConversationList({\n        type: type\n      });\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_OLD_CONVERSATION, data, targetId);\n      return this._sendSignalForData(writer);\n    };\n\n    return ServerEngine;\n  }();\n\n  var NAVIGATORS = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n  var MINI_SOCKET_DOMAIN_LIST = ['wsproxy.cn.ronghub.com', 'wsap-cn.ronghub.com'];\n  var MINI_COMET_DOMAIN_LIST = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\n  var MINI_UPLOAD_DOMAIN_QINIU = 'https://upload.qiniup.com';\n  var MINI_UPLOAD_DOMAIN_BOS = 'https://gz.bcebos.com';\n  var NETWORK_DETECT_OPTION = {\n    url: 'https://cdn.ronghub.com/im_detecting',\n    intervalTime: 1500\n  };\n  var IM_OPTION = {\n    connectType: CONNECT_TYPE.WEBSOCKET,\n    navigators: NAVIGATORS,\n    detect: NETWORK_DETECT_OPTION,\n    isOldServer: true,\n    isDebug: false\n  };\n  var GET_MESSAGES_OPTION = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC,\n    timestrap: 0\n  };\n  var SEND_MESSAGE_OPTION = {\n    isMentiond: false,\n    isCounted: true,\n    isPersited: true\n  };\n  var GET_CHATROOM_INFO_OPTION = {\n    count: 20,\n    order: CHATROOM_ORDER.DESC\n  };\n  var CHATROOM_NOT_PULL_MSG_COUNT = -1;\n  var JOIN_CHATROOM_OPTION = {\n    count: CHATROOM_NOT_PULL_MSG_COUNT\n  };\n  var GET_CHATROOM_MESSAGES = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC\n  };\n  var SEND_MESSAGE_TYPE_OPTION = {\n    'RC:TxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:VcMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgTextMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:FileMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:HQVCMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:LBSMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSMultiImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpOpendMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:CombineMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:InfoNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ContactNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ProfileNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:GrpNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:RcCmd': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:TypSts': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:PSCmd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:SRSMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRReqMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRRspMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsChaR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CSCha': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEva': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsContact': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHs': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHsR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsSp': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEnd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsUpdate': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:ReadNtf': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:chrmKVNotiMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCAccept': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCRinging': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCSummary': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCHangup': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCInvite': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMedia': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMem': {\n      isCounted: false,\n      isPersited: false\n    }\n  };\n  var BASE_NAVI_RESP = {\n    isFixedNaviResp: true,\n    code: 300,\n    userId: '',\n    server: '',\n    backupServer: '',\n    voipCallInfo: '{\"strategy\":1,\"callEngine\":[{\"engineType\":4,\"mediaServer\":\"https://rtc-info.ronghub.com\",\"maxStreamCount\":20},{\"engineType\":3,\"vendorKey\":\"\",\"signKey\":\"\",\"blinkCMPServer\":\"rtccmp.ronghub.com:80\",\"blinkSnifferServer\":\"rtccmp.ronghub.com:80\"}]}',\n    kvStorage: 1,\n    uploadServer: 'upload.qiniup.com',\n    openMp: 1,\n    openUS: 1,\n    logSwitch: 1,\n    logPolicy: '{\"url\": \"logcollection.ronghub.com\",\"level\": 1,\"itv\": 6,\"times\": 5}',\n    bosAddr: 'gz.bcebos.com',\n    joinMChrm: true,\n    activeServer: '',\n    alone: true,\n    chatroomMsg: true,\n    compDays: 0,\n    errorMessage: '',\n    extkitSwitch: 1,\n    gifSize: 2048,\n    grpMsgLimit: 1,\n    historyMsg: true,\n    isFormatted: 1,\n    location: '',\n    monitor: 0,\n    msgAck: '',\n    offlinelogserver: '',\n    onlinelogserver: '',\n    openHttpDNS: true,\n    qnAddr: '',\n    videoTimes: 120,\n    voipServer: ''\n  };\n  var CMP_HOST_HTTPS = {\n    backupServer: 'wsap-cn.ronghub.com:443'\n  };\n  var CMP_HOST_HTTP = {\n    backupServer: 'wsap-cn.ronghub.com:80'\n  };\n\n  var RCStorage$1 = common.RCStorage;\n\n  var LocalNaviHandler = function () {\n    function LocalNaviHandler(option) {\n      this.storage = void 0;\n      this.option = void 0;\n      var appkey = option.appkey,\n          token = option.token;\n      var UID = common.getUIDByToken(token);\n      var KEY = utils.tplEngine(STORAGE_NAVI.ROOT_KEY_TPL, {\n        appkey: appkey,\n        UID: UID\n      });\n      this.storage = new RCStorage$1(KEY);\n      this.option = option;\n    }\n\n    var _proto = LocalNaviHandler.prototype;\n\n    _proto.set = function set(resp) {\n      var connectType = this.option.connectType;\n      this.storage.set(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE, connectType);\n      this.storage.set(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED, utils.getCurrentTimestamp());\n      this.storage.set(STORAGE_NAVI.SUB_KEY.RESPONSE, resp);\n    };\n\n    _proto.clear = function clear() {\n      this.storage.clear();\n    };\n\n    _proto.getResp = function getResp() {\n      return this.storage.get(STORAGE_NAVI.SUB_KEY.RESPONSE);\n    };\n\n    _proto.isValid = function isValid() {\n      var storage = this.storage,\n          connectType = this.option.connectType;\n      var resp = this.getResp();\n\n      if (utils.isEmpty(resp)) {\n        return false;\n      }\n\n      var oldConnectType = storage.get(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE);\n      var timeWhenSaved = storage.get(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED);\n      var isSameConnectType = utils.isEqual(oldConnectType, connectType);\n      var isNotExpired = utils.getCurrentTimestamp() - timeWhenSaved < NAVI_EXPIRED_TIME;\n      return isSameConnectType && isNotExpired;\n    };\n\n    return LocalNaviHandler;\n  }();\n\n  var getNaviUrl = function getNaviUrl(url, option) {\n    var appkey = option.appkey,\n        connectType = option.connectType,\n        token = option.token;\n    var encodeToken = utils.encodeURI(token);\n    var protocol = env.protocol.http;\n    var type = connectType === CONNECT_TYPE.COMET ? NAVI_TYPE.COMET : NAVI_TYPE.WEBSOCKET;\n    var random = utils.getCurrentTimestamp();\n    url = utils.getValidUrl(url);\n    var naviUrlOption = {\n      protocol: protocol,\n      url: url,\n      type: type,\n      appkey: appkey,\n      random: random,\n      token: encodeToken\n    };\n    return utils.tplEngine(NAVI_URL_TPL, naviUrlOption);\n  };\n\n  var parseNaviResponse = function parseNaviResponse(responseText) {\n    var startText = NAVI_CALLBACK_NAME + '(';\n    var endText = ')';\n    var startIndex = utils.indexOf(responseText, startText) + startText.length;\n    var endIndex = utils.lastIndexOf(responseText, endText);\n\n    if (startIndex === -1 || endIndex === -1) {\n      return utils.parseJSON(responseText);\n    }\n\n    var response = utils.substring(responseText, startIndex, endIndex);\n\n    if (utils.isValidJSON(response)) {\n      return utils.parseJSON(response);\n    } else {\n      return {};\n    }\n  };\n\n  var getMiniNavi = function getMiniNavi(option) {\n    var connectType = option.connectType;\n    var isComet = utils.isEqual(connectType, CONNECT_TYPE.COMET);\n    var CmpDomainList = isComet ? MINI_COMET_DOMAIN_LIST : MINI_SOCKET_DOMAIN_LIST;\n    var naviResp = {\n      backupServer: CmpDomainList.join(DOMAIN_SEPARATOR_IN_CMPLIST),\n      uploadServer: MINI_UPLOAD_DOMAIN_QINIU,\n      bosAddr: MINI_UPLOAD_DOMAIN_BOS\n    };\n    return utils.Defer.resolve(naviResp);\n  };\n\n  var getNaviRespByWS = function getNaviRespByWS(navi) {\n    var protocol = env.protocol.http;\n    var optionCMP = protocol === HTTP_PROTOCOL.HTTP ? CMP_HOST_HTTP : CMP_HOST_HTTPS;\n    return utils.extend(navi, optionCMP);\n  };\n\n  var getPreparedNaviResp = function getPreparedNaviResp(option) {\n    var appkey = option.appkey;\n    var naviResp = BASE_NAVI_RESP;\n    var voipCallInfo = naviResp.voipCallInfo;\n\n    try {\n      var parseVoipCallInfo = utils.parseJSON(voipCallInfo);\n      utils.forEach(parseVoipCallInfo.callEngine, function (item) {\n        if (item.engineType === 3) {\n          item.vendorKey = appkey;\n        }\n      });\n      var jsonVoipCallInfo = utils.toJSON(parseVoipCallInfo);\n      naviResp.voipCallInfo = jsonVoipCallInfo;\n    } catch (error) {}\n\n    return getNaviRespByWS(naviResp);\n  };\n\n  var NaviManager = function () {\n    function NaviManager(option) {\n      this.option = void 0;\n      this.localNaviHandler = void 0;\n      this.option = option;\n      this.localNaviHandler = new LocalNaviHandler(option);\n    }\n\n    var _proto2 = NaviManager.prototype;\n\n    _proto2.get = function get() {\n      var self = this;\n      var option = self.option,\n          localNaviHandler = self.localNaviHandler;\n      var navigators = option.navigators,\n          token = option.token,\n          connectType = option.connectType;\n\n      if (env.isMini) {\n        return getMiniNavi(option).then(function (miniNaviResp) {\n          localNaviHandler.set(miniNaviResp);\n          return utils.Defer.resolve(miniNaviResp);\n        });\n      }\n\n      Logger.info(TAG.L_GET_NAVI_T, {\n        navigators: navigators,\n        token: token\n      });\n      var localConfigForNavi = self.getLocalConfig();\n\n      if (localNaviHandler.isValid()) {\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'local navi',\n            localConfigForNavi: localConfigForNavi\n          }\n        });\n        return utils.Defer.resolve(localConfigForNavi);\n      }\n\n      var naviListInToken = common.getNaviListByToken(token);\n      navigators = naviListInToken.concat(navigators);\n      option.token = common.getValidToken(token);\n      var urlList = utils.map(navigators, function (url) {\n        return getNaviUrl(url, option);\n      });\n      return utils.requestByUrlList(urlList).then(function (_ref) {\n        var responseText = _ref.responseText;\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'remote navi',\n            responseText: responseText\n          }\n        });\n        var resp = parseNaviResponse(responseText);\n        var code = resp.code,\n            isFixedNaviResp = resp.isFixedNaviResp;\n        var isSuccess = code === NAVI_REQUEST_SUCCESS_CODE;\n\n        if (isSuccess) {\n          localNaviHandler.set(resp);\n          return resp;\n        } else if (resp && code) {\n          var error = utils.extendInShallow(NAVI_ERROR_INFO[code], {\n            msg: resp.errorMessage\n          });\n          return utils.Defer.reject(error);\n        } else if (isFixedNaviResp) {\n          if (connectType === CONNECT_TYPE.COMET) {\n            return utils.Defer.reject(ERROR_INFO.NAVI_REQUEST_ERROR);\n          }\n\n          var naviResp = getPreparedNaviResp(option);\n          localNaviHandler.set(naviResp);\n          return naviResp;\n        } else {\n          return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n            error: responseText\n          }));\n        }\n      }, function (error) {\n        return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n          error: error\n        }));\n      });\n    };\n\n    _proto2.setLocalConfig = function setLocalConfig(config) {\n      if (utils.isObject(config)) {\n        var localConf = this.getLocalConfig() || {};\n        var newConf = utils.extend(localConf, config);\n        this.localNaviHandler.set(newConf);\n      }\n    };\n\n    _proto2.getLocalConfig = function getLocalConfig() {\n      return this.localNaviHandler.getResp();\n    };\n\n    _proto2.clear = function clear() {\n      var option = this.option;\n      var localNaviHanlder = new LocalNaviHandler(option);\n      localNaviHanlder.clear();\n    };\n\n    return NaviManager;\n  }();\n\n  var CMPManager = function () {\n    function CMPManager() {\n      this.cmpDomainList = [];\n      this.invalidDomainList = [];\n      this.option = void 0;\n    }\n\n    var _proto = CMPManager.prototype;\n\n    _proto.setDomainList = function setDomainList(cmpDomainList, option) {\n      this.cmpDomainList = cmpDomainList;\n      this.option = option || {};\n    };\n\n    _proto.getFaster = function getFaster() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList,\n          option = this.option;\n      var sniffUrlList = utils.filter(cmpDomainList, function (domain) {\n        return !utils.isInclude(invalidDomainList, domain);\n      });\n      sniffUrlList = utils.map(sniffUrlList, function (domain) {\n        var timestamp = utils.getCurrentTimestamp();\n        var url = domain + \"/ping?r=\" + timestamp;\n        return utils.getValidUrl(url, option);\n      });\n\n      if (utils.isEmpty(sniffUrlList)) {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      }\n\n      return utils.requestForFaster(sniffUrlList, {\n        timeInterval: CMP_SNIFF_INTERNAL_TIME\n      }).then(function (_ref) {\n        var url = _ref.url,\n            index = _ref.index;\n        return {\n          url: url,\n          index: index,\n          domain: utils.getDomainByUrl(url)\n        };\n      })[\"catch\"](function () {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      });\n    };\n\n    _proto.addInvalid = function addInvalid(domain) {\n      this.invalidDomainList.push(domain);\n    };\n\n    _proto.clearInvalid = function clearInvalid() {\n      this.invalidDomainList.length = 0;\n    };\n\n    _proto.isAllInvalid = function isAllInvalid() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList;\n      return utils.isEqual(cmpDomainList.length, invalidDomainList.length);\n    };\n\n    return CMPManager;\n  }();\n\n  var _STORAGE_KEY_MAP_CONV;\n  var SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n  var STORAGE_KEY_MAP_CONVERSATION = (_STORAGE_KEY_MAP_CONV = {}, _STORAGE_KEY_MAP_CONV[SUB_KEY.UNREAD_COUNT] = {\n    keyName: 'unreadMessageCount',\n    defaultVal: 0\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.HAS_MENTIOND] = {\n    keyName: 'hasMentiond',\n    defaultVal: false\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.MENTIOND_INFO] = {\n    keyName: 'mentiondInfo',\n    defaultVal: null\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.UNREAD_LAST_TIME] = {\n    keyName: 'lastUnreadTime',\n    defaultVal: 0\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.NOTIFICATION] = {\n    keyName: 'notificationStatus',\n    defaultVal: NOTIFICATION_STATUS.NOTIFY\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.TOP] = {\n    keyName: 'isTop',\n    defaultVal: false\n  }, _STORAGE_KEY_MAP_CONV);\n  var conversationKeyMapStorageKey = {};\n  utils.forEach(STORAGE_KEY_MAP_CONVERSATION, function (_ref, storeKey) {\n    var keyName = _ref.keyName;\n    conversationKeyMapStorageKey[keyName] = storeKey;\n  });\n  var CONVERSATION_KEY_MAP_STORAGE_KEY = conversationKeyMapStorageKey;\n\n  var ConversationStore = function () {\n    function ConversationStore(option) {\n      this._storage = void 0;\n      var StorageKey = utils.tplEngine(STORAGE_CONVERSATION.ROOT_KEY_TPL, option);\n      this._storage = new common.RCStorage(StorageKey);\n    }\n\n    var _proto = ConversationStore.prototype;\n\n    _proto.set = function set(option, conversation) {\n      conversation = conversation || {};\n      var key = common.getConversationKey(option);\n      var local = this._storage.get(key) || {};\n      utils.forEach(conversation, function (val, key) {\n        var storageKey = CONVERSATION_KEY_MAP_STORAGE_KEY[key];\n\n        if (utils.isUndefined(storageKey) || utils.isUndefined(val)) {\n          return;\n        }\n\n        var defaultVal = STORAGE_KEY_MAP_CONVERSATION[storageKey].defaultVal;\n\n        if (utils.isEqual(defaultVal, val)) {\n          delete local[storageKey];\n        } else {\n          local[storageKey] = val;\n        }\n      });\n\n      if (!local[SUB_KEY.UNREAD_COUNT]) {\n        delete local[SUB_KEY.UNREAD_LAST_TIME];\n      }\n\n      if (utils.isEmpty(local)) {\n        this._storage.remove(key);\n      } else {\n        this._storage.set(key, local);\n      }\n    };\n\n    _proto.get = function get(option) {\n      var key = common.getConversationKey(option),\n          local = this._storage.get(key) || {};\n      var conversation = {};\n      utils.forEach(STORAGE_KEY_MAP_CONVERSATION, function (val, key) {\n        var keyName = val.keyName,\n            defaultVal = val.defaultVal;\n        conversation[keyName] = local[key] || defaultVal;\n      });\n      return conversation;\n    };\n\n    _proto.getValues = function getValues(event) {\n      var setEvent = event || utils.noop;\n      var values = this._storage.getValues() || {};\n      var storeConversationList = [];\n      utils.forEach(values, function (store, key) {\n        var _common$getConversati = common.getConversationByKey(key),\n            type = _common$getConversati.type,\n            targetId = _common$getConversati.targetId;\n\n        var conversation = {};\n        utils.forEach(store, function (val, storeKey) {\n          var _ref2 = STORAGE_KEY_MAP_CONVERSATION[storeKey] || {},\n              keyName = _ref2.keyName,\n              defaultVal = _ref2.defaultVal;\n\n          conversation[keyName] = val || defaultVal;\n        });\n        conversation = utils.extend(conversation, {\n          type: type,\n          targetId: targetId\n        });\n        conversation = setEvent(conversation);\n        storeConversationList.push(conversation);\n      });\n      return storeConversationList;\n    };\n\n    return ConversationStore;\n  }();\n\n  var PullQueueManager = function () {\n    function PullQueueManager(option) {\n      this.isLoading = false;\n      this._queue = new utils.Queue();\n      this._option = void 0;\n      option = option || {};\n      this._option = option;\n    }\n\n    var _proto = PullQueueManager.prototype;\n\n    _proto._execEvent = function _execEvent() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      var self = this;\n\n      var _this$_option = this._option,\n          event = _this$_option.event,\n          thisArg = _this$_option.thisArg,\n          onBefore = this._option.onBefore || function () {\n        return args;\n      },\n          onFinished = this._option.onFinished || utils.noop,\n          onError = this._option.onError || utils.noop;\n\n      onBefore.apply(void 0, args);\n      self.isLoading = true;\n      return event.apply(thisArg, args).then(function (result) {\n        self.isLoading = false;\n        onFinished.apply(void 0, [result].concat(args));\n      })[\"catch\"](function (error) {\n        self.isLoading = false;\n        onError(error);\n      });\n    };\n\n    _proto.pull = function pull() {\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      this._queue.add({\n        event: this._execEvent,\n        args: args,\n        thisArg: this\n      });\n    };\n\n    return PullQueueManager;\n  }();\n\n  var EventName = {\n    CHANGED: 'changed'\n  };\n\n  var ConversationStatusManager = function () {\n    function ConversationStatusManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._timeStorage = void 0;\n      this._handleSetConversationStatus = void 0;\n      this._handleConversationStatusChanged = void 0;\n      var self = this,\n          userId = serverEngine._selfUserId,\n          appkey = serverEngine.option.appkey,\n          storageKey = utils.tplEngine(STORAGE_CONVERSATION_STATUS.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      }),\n          timeStorage = new common.RCStorage(storageKey),\n          firstPullTime = timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n      var pullQueue = new PullQueueManager({\n        event: self.pull,\n        thisArg: self,\n        onFinished: function onFinished(list) {\n          self._set(list);\n        }\n      });\n\n      self._handleConversationStatusChanged = function (time) {\n        pullQueue.pull(time);\n      };\n\n      self._handleSetConversationStatus = function (list) {\n        self._set(list);\n      };\n\n      self._timeStorage = timeStorage;\n      self._serverEngine = serverEngine;\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED] = self._handleConversationStatusChanged, _serverEngine$watch[SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED] = self._handleSetConversationStatus, _serverEngine$watch));\n      pullQueue.pull(firstPullTime);\n    }\n\n    var _proto = ConversationStatusManager.prototype;\n\n    _proto.watchChanged = function watchChanged(event) {\n      this._eventEmitter.on(EventName.CHANGED, event);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED] = this._handleConversationStatusChanged, _this$_serverEngine$u[SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED] = this._handleSetConversationStatus, _this$_serverEngine$u));\n    };\n\n    _proto.pull = function pull(newPullTime) {\n      if (common.getConnectType(this._serverEngine.option) === CONNECT_TYPE.COMET) {\n        return utils.Defer.reject();\n      }\n\n      var time = this._timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n\n      if (newPullTime >= time) {\n        return this._serverEngine.getConversationStatus(time);\n      } else {\n        return utils.Defer.reject();\n      }\n    };\n\n    _proto._set = function _set(list) {\n      var self = this;\n\n      if (utils.isUndefined(list)) {\n        return;\n      }\n\n      var time = self._timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n      var listCount = list.length;\n      utils.forEach(list, function (statusItem, index) {\n        var updatedTime = statusItem.updatedTime || 0;\n        time = updatedTime > time ? updatedTime : time;\n\n        self._eventEmitter.emit(EventName.CHANGED, {\n          statusItem: statusItem,\n          isLastInAPull: index === listCount - 1\n        });\n      });\n\n      self._timeStorage.set(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME, time);\n    };\n\n    return ConversationStatusManager;\n  }();\n\n  var EventName$1 = {\n    CHANGED: 'conversationChanged'\n  };\n\n  var ConversationManager = function () {\n    function ConversationManager(option, serverEngine) {\n      this._selfUserId = void 0;\n      this._store = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._statusManager = void 0;\n      this._allConversationList = [];\n      this._updatedConversations = {};\n      var self = this;\n      var statusManager = new ConversationStatusManager(serverEngine);\n      statusManager.watchChanged(function (_ref) {\n        var statusItem = _ref.statusItem,\n            isLastInAPull = _ref.isLastInAPull;\n\n        self._addStatus(statusItem, isLastInAPull);\n      });\n      self._store = new ConversationStore(option);\n      self._selfUserId = option.userId;\n      self._statusManager = statusManager;\n    }\n\n    var _proto = ConversationManager.prototype;\n\n    _proto.watch = function watch(events) {\n      var conversation = events.conversation;\n\n      this._eventEmitter.on(EventName$1.CHANGED, conversation);\n    };\n\n    _proto.addMessage = function addMessage(msgArgs) {\n      var self = this;\n      var message = msgArgs.message,\n          isLastInAPull = msgArgs.isLastInAPull,\n          type = message.type,\n          isPersited = message.isPersited,\n          isSaveConversationType = utils.isInclude(TYPE_HAS_CONVERSATION, type);\n\n      if (!isSaveConversationType) {\n        return;\n      }\n\n      var hasChanged = false;\n\n      var storageConversation = self._store.get(message);\n\n      var calcEvents = [self._setUnreadCount, self._setMentiondInfo];\n      utils.forEach(calcEvents, function (event) {\n        var _event$call = event.call(self, message, storageConversation),\n            hasCalcChanged = _event$call.hasChanged,\n            conversation = _event$call.conversation;\n\n        hasChanged = hasChanged || hasCalcChanged;\n        storageConversation = conversation;\n      });\n\n      if (hasChanged) {\n        self._store.set(message, storageConversation);\n      }\n\n      if (isPersited) {\n        var conversation = self._getConversationByMessage(message);\n\n        conversation.updatedItems = {\n          latestMessage: {\n            time: message.sentTime,\n            val: message\n          }\n        };\n\n        self._setUpdatedConversation(conversation);\n      }\n\n      var isNeedNotifyUpdate = utils.isUndefined(isLastInAPull) ? true : isLastInAPull;\n\n      if (isNeedNotifyUpdate) {\n        self._notifyConversationChanged();\n      }\n    };\n\n    _proto.get = function get(option) {\n      var conversation = this._store.get(option);\n\n      var notificationStatus = conversation.notificationStatus,\n          isNotDisturb = utils.isEqual(notificationStatus, NOTIFICATION_STATUS.DO_NOT_DISTURB);\n\n      if (isNotDisturb) {\n        conversation.unreadMessageCount = 0;\n      }\n\n      return conversation;\n    };\n\n    _proto.read = function read(option) {\n      var self = this,\n          type = option.type,\n          targetId = option.targetId,\n          _store = self._store,\n          _updatedConversations = self._updatedConversations,\n          key = common.getConversationKey(option),\n          updatedConversation = _updatedConversations[key] || {};\n      var storeConversation = _store.get(option) || {},\n          _storeConversation = storeConversation,\n          unreadMessageCount = _storeConversation.unreadMessageCount,\n          hasMentiond = _storeConversation.hasMentiond;\n\n      if (unreadMessageCount || hasMentiond) {\n        var updatedTime = common.DelayTimer.getTime();\n        var updatedValues = {\n          type: type,\n          targetId: targetId,\n          unreadMessageCount: 0,\n          hasMentiond: false,\n          mentiondInfo: null,\n          updatedItems: {\n            unreadMessageCount: {\n              time: updatedTime,\n              val: 0\n            },\n            hasMentiond: {\n              time: updatedTime,\n              val: false\n            },\n            mentiondInfo: {\n              time: updatedTime,\n              val: null\n            }\n          }\n        };\n        storeConversation = utils.extendAllowNull(storeConversation, updatedValues);\n\n        _store.set(option, storeConversation);\n\n        _updatedConversations[key] = utils.extendAllowNull(updatedConversation, updatedValues);\n\n        self._notifyConversationChanged();\n      }\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var _store = this._store,\n          conversationList = _store.getValues();\n\n      var totalCount = 0;\n      utils.forEach(conversationList, function (_ref2) {\n        var unreadMessageCount = _ref2.unreadMessageCount;\n        unreadMessageCount = utils.isNumber(unreadMessageCount) ? unreadMessageCount : 0;\n        totalCount += unreadMessageCount;\n      });\n      return totalCount;\n    };\n\n    _proto.getUnreadCount = function getUnreadCount(option) {\n      var _store = this._store;\n      var storeConversation = _store.get(option) || {};\n      var unreadMessageCount = storeConversation.unreadMessageCount;\n      var count = utils.isNumber(unreadMessageCount) ? unreadMessageCount : 0;\n      return count;\n    };\n\n    _proto.close = function close() {\n      this._statusManager.close();\n    };\n\n    _proto._getConversationByMessage = function _getConversationByMessage(message) {\n      var type = message.type,\n          targetId = message.targetId,\n          storeConversation = this._store.get(message);\n\n      var conversation = utils.extend(storeConversation, {\n        type: type,\n        targetId: targetId,\n        latestMessage: message\n      });\n      return conversation;\n    };\n\n    _proto._getUpdatedConversationList = function _getUpdatedConversationList() {\n      var self = this,\n          updatedConversations = self._updatedConversations,\n          list = [];\n      utils.forEach(updatedConversations, function (conversation) {\n        var storageItems = self._store.get(conversation);\n\n        utils.forEach(storageItems, function (val, key) {\n          conversation[key] = val;\n        });\n        list.push(conversation);\n      });\n      return common.sortConList(list);\n    };\n\n    _proto._setUnreadCount = function _setUnreadCount(message, conversation) {\n      var content = message.content,\n          messageType = message.messageType,\n          sentTime = message.sentTime,\n          isCounted = message.isCounted,\n          messageDirection = message.messageDirection,\n          senderUserId = message.senderUserId,\n          isSelfSend = utils.isEqual(messageDirection, MESSAGE_DIRECTION.SEND) || utils.isEqual(senderUserId, this._selfUserId),\n          isRecall = utils.isEqual(messageType, RECALL_MESSAGE_TYPE),\n          hasContent = utils.isObject(content);\n      var hasChanged = false;\n      var lastUnreadTime = conversation.lastUnreadTime || 0,\n          unreadMessageCount = conversation.unreadMessageCount || 0,\n          hasBeenAdded = lastUnreadTime > sentTime;\n\n      if (hasBeenAdded || isSelfSend) {\n        return {\n          hasChanged: hasChanged,\n          conversation: conversation\n        };\n      }\n\n      if (isCounted) {\n        conversation.unreadMessageCount = unreadMessageCount + 1;\n        conversation.lastUnreadTime = sentTime;\n        hasChanged = true;\n      }\n\n      if (isRecall && hasContent) {\n        var isNotRead = lastUnreadTime >= content.sentTime;\n\n        if (isNotRead && unreadMessageCount) {\n          conversation.unreadMessageCount = unreadMessageCount - 1;\n          hasChanged = true;\n        }\n      }\n\n      return {\n        hasChanged: hasChanged,\n        conversation: conversation\n      };\n    };\n\n    _proto._setMentiondInfo = function _setMentiondInfo(message, conversation) {\n      var content = message.content,\n          messageDirection = message.messageDirection,\n          isMentiond = message.isMentiond,\n          isSelfSend = utils.isEqual(messageDirection, MESSAGE_DIRECTION.SEND),\n          hasContent = utils.isObject(content);\n      var hasChanged = false;\n\n      if (isSelfSend) ; else if (isMentiond && hasContent && content.mentionedInfo) {\n        conversation.hasMentiond = true;\n        conversation.mentiondInfo = content.mentionedInfo;\n        hasChanged = true;\n      }\n\n      return {\n        hasChanged: hasChanged,\n        conversation: conversation\n      };\n    };\n\n    _proto._setUpdatedConversation = function _setUpdatedConversation(conversation) {\n      if (utils.isObject(conversation) && conversation.targetId && conversation.type) {\n        var self = this,\n            cacheKey = common.getConversationKey(conversation),\n            cacheConversation = self._updatedConversations[cacheKey];\n        self._updatedConversations[cacheKey] = utils.extendAllowNull(cacheConversation, conversation);\n      }\n    };\n\n    _proto._notifyConversationChanged = function _notifyConversationChanged() {\n      var self = this,\n          _eventEmitter = self._eventEmitter,\n          updatedConversationList = self._getUpdatedConversationList();\n\n      if (utils.isEmpty(updatedConversationList)) ; else {\n        utils.setTimeout(function () {\n          _eventEmitter.emit(EventName$1.CHANGED, {\n            updatedConversationList: updatedConversationList\n          });\n\n          self._updatedConversations = {};\n        }, 0);\n      }\n    };\n\n    _proto._addStatus = function _addStatus(conversationStatus, isLastInAPull) {\n      var type = conversationStatus.type,\n          targetId = conversationStatus.targetId,\n          updatedTime = conversationStatus.updatedTime,\n          notificationStatus = conversationStatus.notificationStatus,\n          isTop = conversationStatus.isTop,\n          option = {\n        type: type,\n        targetId: targetId\n      };\n      var updatedItems = {};\n\n      if (!utils.isUndefined(notificationStatus)) {\n        updatedItems['notificationStatus'] = {\n          time: updatedTime,\n          val: notificationStatus\n        };\n      }\n\n      if (!utils.isUndefined(isTop)) {\n        updatedItems['isTop'] = {\n          time: updatedTime,\n          val: isTop\n        };\n      }\n\n      this._setUpdatedConversation({\n        type: type,\n        targetId: targetId,\n        updatedItems: updatedItems\n      });\n\n      this._store.set(option, {\n        notificationStatus: notificationStatus,\n        isTop: isTop\n      });\n\n      if (isLastInAPull) {\n        this._notifyConversationChanged();\n      }\n    };\n\n    return ConversationManager;\n  }();\n\n  var MessageTimeSyner$1 = common.MessageTimeSyner,\n      ChatRoomMessageTimeSyner$1 = common.ChatRoomMessageTimeSyner;\n  var EVENT_NAME$1 = {\n    MESSAGE_RECEIVED: 'msg-received'\n  };\n\n  var MessagePullManager = function () {\n    function MessagePullManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._messageTimeSyner = void 0;\n      this._chatRoomMessageTimeSyner = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._pullMessageTimer = new utils.Timer({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: PULL_MSG_TIME\n      });\n      this._sentMsgCacheInPulling = {};\n      this._handleDirectMessage = void 0;\n      this._handleNotifyPull = void 0;\n      this._handleJoinChatRoom = void 0;\n      this._handleSendMessage = void 0;\n      var self = this;\n      var appkey = serverEngine.option.appkey,\n          userId = serverEngine._selfUserId;\n      var startSyncTime = option.startSyncTime;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished() {},\n        onError: function onError() {}\n      });\n\n      self._handleDirectMessage = function (message) {\n        !pullQueue.isLoading && self.notifyMessage({\n          message: message,\n          hasMore: false\n        });\n      };\n\n      self._handleNotifyPull = function (option) {\n        pullQueue.pull(option);\n      };\n\n      self._handleJoinChatRoom = function (_ref) {\n        var id = _ref.id,\n            count = _ref.count,\n            isAutoRejoin = _ref.isAutoRejoin;\n\n        if (utils.isEqual(count, CHATROOM_NOT_PULL_MSG_COUNT)) {\n          self._chatRoomMessageTimeSyner.set(id, common.DelayTimer.getTime());\n        } else {\n          var type = PULL_MSG_TYPE.CHATROOM,\n              chrmId = id;\n          var time = isAutoRejoin ? self._chatRoomMessageTimeSyner.get(id) + 1 : 0;\n\n          self._chatRoomMessageTimeSyner.set(id, time);\n\n          pullQueue.pull({\n            type: type,\n            time: time,\n            chrmId: chrmId,\n            count: count\n          });\n        }\n      };\n\n      self._handleSendMessage = function (message) {\n        pullQueue.isLoading ? self._setSentMsgCacheInPulling(message) : self._setPullTime(message);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.DIRECT_MSG] = self._handleDirectMessage, _serverEngine$watch[SERVER_EVENT_NAME.NOTIFY_PULL] = self._handleNotifyPull, _serverEngine$watch[SERVER_EVENT_NAME.JOIN_CHATROOM] = self._handleJoinChatRoom, _serverEngine$watch[SERVER_EVENT_NAME.MESSAGE_SEND] = self._handleSendMessage, _serverEngine$watch));\n      self._serverEngine = serverEngine;\n      self._pullQueue = pullQueue;\n      self._messageTimeSyner = new MessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId,\n        startSyncTime: startSyncTime\n      });\n      self._chatRoomMessageTimeSyner = new ChatRoomMessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId\n      });\n\n      self._pullMessageTimer.start(pullQueue.pull, {\n        thisArg: pullQueue\n      });\n\n      pullQueue.pull();\n    }\n\n    var _proto = MessagePullManager.prototype;\n\n    _proto.watchMessage = function watchMessage(event) {\n      this._eventEmitter.on(EVENT_NAME$1.MESSAGE_RECEIVED, event);\n    };\n\n    _proto.notifyMessage = function notifyMessage(messageArgs) {\n      var message = messageArgs.message;\n\n      this._setPullTime(message);\n\n      this._eventEmitter.emit(EVENT_NAME$1.MESSAGE_RECEIVED, messageArgs);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._pullMessageTimer.stop();\n\n      this._sentMsgCacheInPulling = {};\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.DIRECT_MSG] = this._handleDirectMessage, _this$_serverEngine$u[SERVER_EVENT_NAME.NOTIFY_PULL] = this._handleNotifyPull, _this$_serverEngine$u[SERVER_EVENT_NAME.JOIN_CHATROOM] = this._handleJoinChatRoom, _this$_serverEngine$u[SERVER_EVENT_NAME.MESSAGE_SEND] = this._handleSendMessage, _this$_serverEngine$u));\n    };\n\n    _proto._pullEvent = function _pullEvent(option) {\n      option = option || {};\n\n      var self = this,\n          _serverEngine = self._serverEngine,\n          _messageTimeSyner = self._messageTimeSyner,\n          _chatRoomMessageTimeSyner = self._chatRoomMessageTimeSyner,\n          _option = option,\n          type = _option.type,\n          chrmId = _option.chrmId,\n          serverPullTime = _option.time,\n          count = _option.count,\n          isPullChrmMsg = utils.isEqual(type, PULL_MSG_TYPE.CHATROOM),\n          msgSyncTime = _messageTimeSyner.get(),\n          currentReceiveTime = isPullChrmMsg ? _chatRoomMessageTimeSyner.get(chrmId) : msgSyncTime.inboxTime,\n          syncTime = utils.copy(msgSyncTime);\n\n      if (serverPullTime && serverPullTime < currentReceiveTime) {\n        return utils.Defer.resolve();\n      }\n\n      var onMessage = function onMessage(_ref2) {\n        var message = _ref2.message,\n            finished = _ref2.finished,\n            isLastInAPull = _ref2.isLastInAPull;\n\n        self._displatchMessages({\n          message: message,\n          finished: finished,\n          isPullChrmMsg: isPullChrmMsg,\n          isLastInAPull: isLastInAPull,\n          normalSyncTime: syncTime,\n          chatRoomReceiveTime: currentReceiveTime\n        });\n      };\n\n      if (isPullChrmMsg) {\n        return _serverEngine.pullChrmMessageList(chrmId, currentReceiveTime, count, {\n          onMessage: onMessage\n        });\n      } else {\n        return _serverEngine.pullMessageList(syncTime, {\n          onMessage: onMessage\n        });\n      }\n    };\n\n    _proto._displatchMessages = function _displatchMessages(option) {\n      var self = this,\n          message = option.message,\n          finished = option.finished,\n          isPullChrmMsg = option.isPullChrmMsg,\n          isLastInAPull = option.isLastInAPull,\n          _ref3 = option.normalSyncTime || {},\n          inboxTime = _ref3.inboxTime,\n          sendboxTime = _ref3.sendboxTime,\n          sentTime = message.sentTime,\n          messageDirection = message.messageDirection,\n          messageUId = message.messageUId,\n          isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND,\n          pullTime = isSelfSend ? sendboxTime : inboxTime;\n\n      if (sentTime <= pullTime && !isPullChrmMsg) {\n        return;\n      }\n\n      if (self._sentMsgCacheInPulling[messageUId]) {\n        return;\n      }\n\n      self.notifyMessage({\n        message: message,\n        hasMore: !finished,\n        isLastInAPull: isLastInAPull\n      });\n    };\n\n    _proto._setPullTime = function _setPullTime(message) {\n      var isChatRoom = message.type === CONVERSATION_TYPE.CHATROOM;\n      isChatRoom ? this._chatRoomMessageTimeSyner.setByMessage(message) : this._messageTimeSyner.setByMessage(message);\n    };\n\n    _proto._setSentMsgCacheInPulling = function _setSentMsgCacheInPulling(message) {\n      var messageUId = message.messageUId;\n\n      if (utils.isUndefined(messageUId)) {\n        return;\n      }\n\n      this._sentMsgCacheInPulling[messageUId] = message;\n    };\n\n    _proto._consumeSentMsgCacheInPulling = function _consumeSentMsgCacheInPulling() {\n      var self = this;\n      var _sentMsgCacheInPulling = self._sentMsgCacheInPulling;\n      utils.forEach(_sentMsgCacheInPulling, function (message) {\n        self._setPullTime(message);\n      });\n      self._sentMsgCacheInPulling = {};\n    };\n\n    return MessagePullManager;\n  }();\n\n  var ChatRoomKVStore = function () {\n    function ChatRoomKVStore(chrmId, currentUserId) {\n      this._chatRoomId = void 0;\n      this._kvCaches = {};\n      this._currentUserId = void 0;\n      this._chatRoomId = chrmId;\n      this._currentUserId = currentUserId;\n    }\n\n    var _proto = ChatRoomKVStore.prototype;\n\n    _proto.setEntries = function setEntries(data) {\n      data = data || {};\n      var self = this;\n      var _data = data,\n          kvList = _data.kvEntries,\n          isFullUpdate = _data.isFullUpdate;\n      kvList = kvList || [];\n      isFullUpdate = isFullUpdate || false;\n      isFullUpdate && self.clear();\n      utils.forEach(kvList, function (kv) {\n        self.setEntry(kv, {\n          isFullUpdate: isFullUpdate\n        });\n      });\n    };\n\n    _proto.setEntry = function setEntry(kv, option) {\n      option = option || {};\n      var _option = option,\n          isFullUpdate = _option.isFullUpdate,\n          key = kv.key,\n          type = kv.type,\n          isOverwrite = kv.isOverwrite,\n          userId = kv.userId,\n          latestUserId = this.getSetUserId(key),\n          isDeleteOpt = utils.isEqual(type, CHATROOM_ENTRY_TYPE.DELETE),\n          isSameAtLastSetUser = utils.isEqual(latestUserId, userId),\n          isKeyNotExist = !this.isExisted(key);\n      var event = isDeleteOpt ? this.remove : this.add;\n\n      if (isFullUpdate) {\n        event.call(this, kv);\n      } else if (isOverwrite || isSameAtLastSetUser || isKeyNotExist) {\n        event.call(this, kv);\n      }\n    };\n\n    _proto.add = function add(kv) {\n      var key = kv.key;\n      kv.isDeleted = false;\n      this._kvCaches[key] = kv;\n    };\n\n    _proto.remove = function remove(kv) {\n      var key = kv.key;\n      var cacheKV = this.get(key) || {};\n      cacheKV.isDeleted = true;\n      this._kvCaches[key] = cacheKV;\n    };\n\n    _proto.clear = function clear() {\n      this._kvCaches = {};\n    };\n\n    _proto.get = function get(key) {\n      return this._kvCaches[key];\n    };\n\n    _proto.getSetUserId = function getSetUserId(key) {\n      var cache = this.get(key) || {};\n      return cache.userId;\n    };\n\n    _proto.getValue = function getValue(key) {\n      var kv = this._kvCaches[key] || {};\n      var isDeleted = kv.isDeleted;\n      return isDeleted ? null : kv.value;\n    };\n\n    _proto.getAll = function getAll() {\n      var kvEntries = {};\n      utils.forEach(this._kvCaches, function (kv, key) {\n        if (!kv.isDeleted) {\n          kvEntries[key] = kv.value;\n        }\n      });\n      return kvEntries;\n    };\n\n    _proto.getUpdatedTime = function getUpdatedTime() {\n      var maxTime = 0;\n      utils.forEach(this._kvCaches, function (entry) {\n        var timestamp = entry.timestamp || 0;\n\n        if (maxTime < timestamp) {\n          maxTime = timestamp;\n        }\n      });\n      return maxTime;\n    };\n\n    _proto.isExisted = function isExisted(key) {\n      var cache = this.get(key) || {};\n      var value = cache.value,\n          isDeletedOnLatestOperate = cache.isDeleted;\n      return value && !isDeletedOnLatestOperate;\n    };\n\n    return ChatRoomKVStore;\n  }();\n\n  var storeCaches = {};\n\n  var get = function get(chrmId) {\n    return storeCaches[chrmId];\n  };\n\n  var set$1 = function set(chrmId, data, currentUserId) {\n    var kvStore = get(chrmId);\n\n    if (utils.isEmpty(kvStore)) {\n      kvStore = new ChatRoomKVStore(chrmId, currentUserId);\n    }\n\n    kvStore.setEntries(data);\n    storeCaches[chrmId] = kvStore;\n  };\n\n  var getValue = function getValue(chrmId, key) {\n    var kvStore = get(chrmId);\n    var value = kvStore ? kvStore.getValue(key) : null;\n    return value;\n  };\n\n  var getAll = function getAll(chrmId) {\n    var kvStore = get(chrmId);\n    var kvs = {};\n\n    if (kvStore) {\n      kvs = kvStore.getAll();\n    }\n\n    return kvs;\n  };\n\n  var clear = function clear(chrmId) {\n    var kvStore = get(chrmId) || {};\n    kvStore.clear && kvStore.clear();\n  };\n\n  var ChatRoomKVStore$1 = {\n    get: get,\n    set: set$1,\n    getValue: getValue,\n    getAll: getAll,\n    clear: clear\n  };\n\n  var PullTimeCache = {\n    _caches: {},\n    set: function set(chrmId, time) {\n      PullTimeCache._caches[chrmId] = time;\n    },\n    get: function get(chrmId) {\n      return PullTimeCache._caches[chrmId] || 0;\n    },\n    clear: function clear(chrmId) {\n      PullTimeCache._caches[chrmId] = 0;\n    }\n  };\n\n  var ChatRoomKVManager = function () {\n    function ChatRoomKVManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._handleChrmKVSet = void 0;\n      this._handleChrmKVChanged = void 0;\n      this._handleBeforeJoinChrm = void 0;\n      var self = this;\n      var userId = serverEngine._selfUserId;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished(data, option) {\n          if (!data || !option.chrmId) {\n            return;\n          }\n\n          var chrmId = option.chrmId;\n\n          if (data.isFullUpdate) {\n            self._reset(chrmId);\n          }\n\n          Logger.info(TAG.L_PULL_CHRM_KV_R, {\n            data: data,\n            option: option\n          });\n          ChatRoomKVStore$1.set(chrmId, data, userId);\n          PullTimeCache.set(chrmId, data.syncTime || 0);\n        }\n      });\n\n      self._handleChrmKVSet = function (_ref) {\n        var id = _ref.id,\n            data = _ref.data;\n        ChatRoomKVStore$1.set(id, data, userId);\n      };\n\n      self._handleChrmKVChanged = function (data) {\n        self.pull(data);\n      };\n\n      self._handleBeforeJoinChrm = function (_ref2) {\n        var id = _ref2.id;\n\n        self._reset(id);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _serverEngine$watch[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _serverEngine$watch));\n      this._serverEngine = serverEngine;\n      this._pullQueue = pullQueue;\n    }\n\n    var _proto = ChatRoomKVManager.prototype;\n\n    _proto._reset = function _reset(chrmId) {\n      ChatRoomKVStore$1.clear(chrmId);\n      PullTimeCache.clear(chrmId);\n    };\n\n    _proto._pullEvent = function _pullEvent(data) {\n      var time = data.time,\n          chrmId = data.chrmId,\n          currentTime = PullTimeCache.get(chrmId),\n          isUpdated = currentTime > time;\n      Logger.info(TAG.L_PULL_CHRM_KV_T, {\n        currentTime: currentTime,\n        serverTime: time,\n        isUpdated: isUpdated,\n        data: data\n      });\n\n      if (isUpdated) {\n        Logger.info(TAG.L_PULL_CHRM_KV_R, {\n          info: 'kv is updated. not pull again'\n        });\n        return utils.Defer.resolve();\n      }\n\n      return this._serverEngine.pullChatRoomKV({\n        id: chrmId\n      }, currentTime);\n    };\n\n    _proto.pull = function pull(data) {\n      this._pullQueue.pull(data);\n    };\n\n    _proto.getValue = function getValue(chrmId, key) {\n      return ChatRoomKVStore$1.getValue(chrmId, key);\n    };\n\n    _proto.getAll = function getAll(chrmId) {\n      return ChatRoomKVStore$1.getAll(chrmId);\n    };\n\n    _proto.close = function close() {\n      var _self$_serverEngine$u;\n\n      var self = this;\n\n      self._serverEngine.unwatch((_self$_serverEngine$u = {}, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _self$_serverEngine$u[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _self$_serverEngine$u));\n    };\n\n    return ChatRoomKVManager;\n  }();\n\n  var SettingStore = function () {\n    function SettingStore(appkey, userId) {\n      this._storage = void 0;\n      var storageKey = utils.tplEngine(STORAGE_USER_SETTING.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      this._storage = new common.RCStorage(storageKey);\n    }\n\n    var _proto = SettingStore.prototype;\n\n    _proto.set = function set(serverData) {\n      var self = this,\n          _storage = self._storage,\n          settings = serverData.settings,\n          oldSettingItems = _storage.get(STORAGE_USER_SETTING.SUB_KEY.SETTINGS) || {};\n      var newSettingItems = oldSettingItems,\n          isChanged = false;\n      utils.forEach(settings, function (newSetting, key) {\n        newSetting = newSetting || {};\n        var oldSetting = oldSettingItems[key] || {},\n            _newSetting = newSetting,\n            newVersion = _newSetting.version,\n            status = _newSetting.status,\n            newValue = _newSetting.value,\n            oldGlobalVersion = _storage.get(STORAGE_USER_SETTING.SUB_KEY.VERSION) || 0,\n            isNeedUpdateItem = newVersion > (oldSetting.version || 0),\n            isNeedUpdateVersion = newVersion > oldGlobalVersion;\n\n        if (!isNeedUpdateItem) {\n          return;\n        }\n\n        isChanged = true;\n\n        switch (status) {\n          case USER_SETTING_STATUS.ADD:\n          case USER_SETTING_STATUS.UPDATE:\n            newSettingItems[key] = {\n              value: newValue,\n              version: newVersion\n            };\n            break;\n\n          case USER_SETTING_STATUS.DELETE:\n            delete newSettingItems[key];\n            break;\n\n          default:\n        }\n\n        if (isNeedUpdateVersion) {\n          _storage.set(STORAGE_USER_SETTING.SUB_KEY.VERSION, newVersion);\n        }\n      });\n\n      if (!isChanged) {\n        return;\n      }\n\n      if (utils.isEmpty(newSettingItems)) {\n        _storage.remove(STORAGE_USER_SETTING.SUB_KEY.SETTINGS);\n      } else {\n        _storage.set(STORAGE_USER_SETTING.SUB_KEY.SETTINGS, newSettingItems);\n      }\n    };\n\n    _proto.getSetting = function getSetting() {\n      var settings = this._storage.get(STORAGE_USER_SETTING.SUB_KEY.SETTINGS) || {};\n      return utils.map(settings, function (set) {\n        set = set || {};\n        return set.value;\n      });\n    };\n\n    _proto.getVersion = function getVersion() {\n      return this._storage.get(STORAGE_USER_SETTING.SUB_KEY.VERSION) || 0;\n    };\n\n    return SettingStore;\n  }();\n\n  var EventNames = {\n    CHANGED: 'change'\n  };\n\n  var SettingManager = function () {\n    function SettingManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._settingStore = void 0;\n      this._pullQueue = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._handleNotifySettingChanged = void 0;\n      var self = this,\n          appkey = option.appkey,\n          userId = option.userId,\n          isAutoPull = option.isAutoPull,\n          settingStore = new SettingStore(appkey, userId),\n          localVersion = settingStore.getVersion() || 0;\n      var pullQueue = new PullQueueManager({\n        event: serverEngine.getUserSettings,\n        thisArg: serverEngine,\n        onFinished: function onFinished(serverData) {\n          if (serverData && serverData.version) {\n            self._settingStore.set(serverData);\n\n            self._eventEmitter.emit(EventNames.CHANGED, self.get());\n          }\n        }\n      });\n\n      self._handleNotifySettingChanged = function (notifyData) {\n        var version = notifyData.version,\n            localVersion = self._settingStore.getVersion();\n\n        if (version >= localVersion) {\n          pullQueue.pull(localVersion);\n        }\n      };\n\n      self._settingStore = new SettingStore(appkey, userId);\n      self._pullQueue = pullQueue;\n      self._serverEngine = serverEngine;\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.USER_SETTING_CHANGED] = self._handleNotifySettingChanged, _serverEngine$watch));\n      isAutoPull && pullQueue.pull(localVersion);\n    }\n\n    var _proto = SettingManager.prototype;\n\n    _proto.watchSettingChanged = function watchSettingChanged(event) {\n      this._eventEmitter.on(EventNames.CHANGED, event);\n    };\n\n    _proto.get = function get() {\n      return this._settingStore.getSetting() || {};\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.USER_SETTING_CHANGED] = this._handleNotifySettingChanged, _this$_serverEngine$u));\n    };\n\n    return SettingManager;\n  }();\n\n  var WebIMEngine = function () {\n    function WebIMEngine(option) {\n      this._option = void 0;\n      this._user = void 0;\n      this._naviManager = void 0;\n      this._cmpManager = new CMPManager();\n      this._conversationManager = void 0;\n      this._messageManager = void 0;\n      this._chatRoomKVManager = void 0;\n      this._userSettingManager = void 0;\n      this._serverEngine = void 0;\n      this._imEventEmitter = new utils.EventEmitter();\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      this._connectedDomain = void 0;\n      this._networkDetecter = void 0;\n      this._joinedChatRoomSyner = void 0;\n      var self = this;\n      var detect = option.detect;\n      var serverEngine = new ServerEngine(option);\n      serverEngine.watch({\n        status: function status(_status) {\n          self._handleConnectionStatus(_status);\n        }\n      });\n      this._serverEngine = serverEngine;\n      this._option = option;\n      this._networkDetecter = new utils.NetworkDetecter(detect);\n      utils.forEach(ServerEngine.prototype, function (event, eventName) {\n        var server = serverEngine,\n            web = self;\n        var selfEvent = web[eventName],\n            serverEvent = server[eventName];\n\n        if (!selfEvent && serverEvent && utils.isFunction(serverEvent)) {\n          web[eventName] = function () {\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n\n            return serverEvent.call.apply(serverEvent, [server].concat(args));\n          };\n        }\n      });\n    }\n\n    var _proto = WebIMEngine.prototype;\n\n    _proto._notifyMessage = function _notifyMessage(event) {\n      var self = this;\n      var message = event.message;\n      var _serverEngine = self._serverEngine;\n\n      var connectedTime = _serverEngine.getConnectedTime();\n\n      if (common.isLogCommandMsg(message)) {\n        var content = message.content;\n        Logger.uploadFull(0, content, connectedTime);\n        return;\n      }\n\n      this._conversationManager.addMessage(event);\n\n      this._imEventEmitter.emit(IM_EVENT.MESSAGE, event);\n    };\n\n    _proto._handleConnectionStatus = function _handleConnectionStatus(status) {\n      var _cmpManager = this._cmpManager,\n          _naviManager = this._naviManager,\n          _connectedDomain = this._connectedDomain;\n      var isNeedUpdateCMPList = utils.isInclude(TRANSPORTER_STATUS_NEED_UPDATE_CMP, status);\n      var isNeedReconnect = utils.isInclude(TRANSPORTER_STATUS_NEED_RECONNECT, status);\n      var isKickedOfflineByOtherClient = utils.isEqual(CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, status);\n\n      if (isNeedUpdateCMPList) {\n        _cmpManager.addInvalid(_connectedDomain);\n\n        if (_cmpManager.isAllInvalid()) {\n          _naviManager.clear();\n\n          _cmpManager.clearInvalid();\n        }\n      }\n\n      if (isNeedReconnect) {\n        this.disconnect();\n        this.reconnect(true);\n      }\n\n      if (isKickedOfflineByOtherClient) {\n        this.disconnect();\n      }\n\n      var connectionStatus = TRANSPORTER_STATUS_TO_CONNECTION_STATUS[status] || status;\n      this._connectionStatus = connectionStatus;\n\n      this._imEventEmitter.emit(IM_EVENT.STATUS, {\n        status: connectionStatus\n      });\n    };\n\n    _proto._handleConnectError = function _handleConnectError(errorInfo) {\n      var _user = this._user;\n      var code = errorInfo.code || errorInfo.status;\n      this.disconnect();\n\n      if (code === ERROR_INFO.CONN_REDIRECTED.code) {\n        this._naviManager.clear();\n\n        return this.connect(_user);\n      }\n\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      return utils.Defer.reject(errorInfo);\n    };\n\n    _proto._afterConnect = function _afterConnect(connectUser, syncTime) {\n      var self = this,\n          _serverEngine = self._serverEngine,\n          appkey = self._option.appkey,\n          _imEventEmitter = self._imEventEmitter,\n          _naviManager = self._naviManager,\n          id = connectUser.id,\n          localNavi = _naviManager.getLocalConfig() || {};\n      Logger.setOption({\n        userId: id\n      });\n      self._user.id = id;\n      var conversationManager = new ConversationManager({\n        appkey: appkey,\n        userId: id\n      }, _serverEngine);\n      conversationManager.watch({\n        conversation: function conversation(_ref) {\n          var updatedConversationList = _ref.updatedConversationList;\n\n          _imEventEmitter.emit(IM_EVENT.CONVERSATION, {\n            updatedConversationList: updatedConversationList\n          });\n        }\n      });\n      self._conversationManager = conversationManager;\n      var messageManager = new MessagePullManager(_serverEngine, {\n        startSyncTime: syncTime\n      });\n      messageManager.watchMessage(function (event) {\n        self._notifyMessage(event);\n      });\n      self._messageManager = messageManager;\n      self._chatRoomKVManager = new ChatRoomKVManager(_serverEngine);\n      var isAutoPull = !!Number(localNavi.openUS);\n      var userSettingManager = new SettingManager(_serverEngine, {\n        appkey: appkey,\n        userId: id,\n        isAutoPull: isAutoPull\n      });\n      self._joinedChatRoomSyner = new common.JoinedChatRoomSyner({\n        appkey: appkey,\n        userId: id\n      });\n      userSettingManager.watchSettingChanged(function (config) {\n        config = config || {};\n        var _config = config,\n            voipCallInfo = _config.VoipInfo;\n\n        _naviManager.setLocalConfig({\n          voipCallInfo: utils.toJSON(voipCallInfo)\n        });\n\n        self._imEventEmitter.emit(IM_EVENT.SETTING, config);\n      });\n      self._userSettingManager = userSettingManager;\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _events;\n\n      var statusWatcher = watchers.status,\n          messageWatcher = watchers.message,\n          conversationWatcher = watchers.conversation,\n          chatroomWatcher = watchers.chatroom;\n      var self = this;\n      var events = (_events = {}, _events[IM_EVENT.STATUS] = statusWatcher, _events[IM_EVENT.MESSAGE] = messageWatcher, _events[IM_EVENT.CONVERSATION] = conversationWatcher, _events[IM_EVENT.CHATROOM] = chatroomWatcher, _events);\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._imEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      var _imEventEmitter = this._imEventEmitter;\n      var offEventNameObj = {\n        status: 'IM_EVENT.STATUS',\n        message: 'IM_EVENT.MESSAGE',\n        conversation: 'IM_EVENT.CONVERSATION',\n        chatroom: 'IM_EVENT.CHATROOM'\n      };\n\n      if (watchers) {\n        utils.forEach(watchers, function (val, key) {\n          if (offEventNameObj[key]) {\n            _imEventEmitter.off(key, val);\n          }\n        });\n      } else {\n        _imEventEmitter.clear();\n      }\n    };\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._connectionStatus;\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      var user = this._user || {};\n      return user.id;\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      var _option = this._option,\n          _naviManager = this._naviManager,\n          _userSettingManager = this._userSettingManager;\n      return utils.extendInShallow(_option, {\n        navi: _naviManager.getLocalConfig(),\n        serverConfig: _userSettingManager ? _userSettingManager.get() : {}\n      });\n    };\n\n    _proto.connect = function connect(user, options) {\n      Logger.startRealtimeUpload();\n      var self = this;\n      var _option = self._option,\n          _serverEngine = self._serverEngine,\n          _cmpManager = self._cmpManager;\n      var naviOpt = common.getNavReqOption(_option, user);\n      var naviManager = new NaviManager(naviOpt);\n      var getServerConfig = _option.isOldServer ? _serverEngine.getOldServerConfig : _serverEngine.getServerConfig;\n      options = options || {};\n      var isAutoReconnect = options.isAutoReconnect;\n\n      self._handleConnectionStatus(CONNECTION_STATUS.CONNECTING);\n\n      self._user = utils.copy(user);\n      self._naviManager = naviManager;\n      var connectUser;\n      return naviManager.get().then(function (configForNavi) {\n        var cmpDomainList = common.getCMPDomainList(configForNavi, _option);\n        Logger.setServerOption(configForNavi);\n\n        _cmpManager.setDomainList(cmpDomainList);\n\n        return _cmpManager.getFaster();\n      }).then(function (_ref2) {\n        var domain = _ref2.domain;\n        self._connectedDomain = domain;\n        return _serverEngine.connect(user, {\n          domain: domain\n        });\n      }).then(function (user) {\n        connectUser = user;\n        isAutoReconnect && self.rejoinChatRoom();\n        return getServerConfig.call(_serverEngine, user.id);\n      }).then(function (serverConfig) {\n        self._afterConnect(connectUser, serverConfig);\n\n        self._handleConnectionStatus(CONNECTION_STATUS.CONNECTED);\n\n        return connectUser;\n      })[\"catch\"](function (error) {\n        return self._handleConnectError(error);\n      });\n    };\n\n    _proto.reconnect = function reconnect(isAutoReconnect) {\n      var self = this;\n      var _user = self._user;\n\n      if (utils.isUndefined(_user)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      return self._networkDetecter.start().then(function () {\n        return self.connect(_user, {\n          isAutoReconnect: isAutoReconnect\n        });\n      });\n    };\n\n    _proto.disconnect = function disconnect(isNotify) {\n      isNotify && this._handleConnectionStatus(CONNECTION_STATUS.DISCONNECTED);\n      this._networkDetecter && this._networkDetecter.stop();\n      this._messageManager && this._messageManager.close();\n      this._chatRoomKVManager && this._chatRoomKVManager.close();\n      this._userSettingManager && this._userSettingManager.close();\n      this._conversationManager && this._conversationManager.close();\n      return this._serverEngine.disconnect();\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      this.disconnect(true);\n      return this.connect(user);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, option) {\n      var self = this;\n      return self._serverEngine.sendMessage(conversation, option).then(function (message) {\n        self._conversationManager.addMessage({\n          message: message,\n          hasMore: false\n        });\n\n        return message;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var self = this;\n      return self._serverEngine.recallMessage(conversation, message, option).then(function (message) {\n        self._conversationManager.addMessage({\n          message: message,\n          hasMore: false\n        });\n\n        return message;\n      });\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine,\n          _conversationManager = this._conversationManager;\n      var func = isOldServer ? _serverEngine.getOldConversationList : _serverEngine.getConversationList;\n      return func.call(_serverEngine, option, {\n        afterDecode: function afterDecode(conversation) {\n          var localConversation = _conversationManager.get(conversation);\n\n          conversation = utils.extendAllowNull(conversation, localConversation);\n          return conversation;\n        }\n      }).then(function (list) {\n        return common.sortConList(list);\n      });\n    };\n\n    _proto.getLocalConversation = function getLocalConversation(conversation) {\n      var local = this._conversationManager.get(conversation);\n\n      return {\n        unreadMessageCount: local.unreadMessageCount || 0,\n        hasMentiond: local.hasMentiond || false,\n        mentiondInfo: local.mentiondInfo\n      };\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n      var func = isOldServer ? _serverEngine.removeOldConversation : _serverEngine.removeConversation;\n      return func.call(_serverEngine, conversation);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        var totalCount = this._conversationManager.getTotalUnreadCount();\n\n        return utils.Defer.resolve(totalCount);\n      } else {\n        return _serverEngine.getTotalUnreadCount();\n      }\n    };\n\n    _proto.getUnreadCount = function getUnreadCount(conversation) {\n      var isOldServer = this._option.isOldServer;\n\n      if (isOldServer) {\n        var count = this._conversationManager.getUnreadCount(conversation);\n\n        return utils.Defer.resolve(count);\n      }\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        this._conversationManager.read(conversation);\n\n        return utils.Defer.resolve();\n      } else {\n        return _serverEngine.clearUnreadCount(conversation, option);\n      }\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var _serverEngine = self._serverEngine,\n          _naviManager = self._naviManager,\n          _chatRoomKVManager = self._chatRoomKVManager,\n          _joinedChatRoomSyner = self._joinedChatRoomSyner;\n      var isAutoRejoin = option.isAutoRejoin;\n      return _serverEngine.joinChatRoom(chrm, option).then(function () {\n        return _naviManager.get();\n      }).then(function (configForNavi) {\n        var isOpenKVStorageService = configForNavi.kvStorage,\n            isOpenJoinMulitpleChrmService = configForNavi.joinMChrm;\n        !isAutoRejoin && _joinedChatRoomSyner.set({\n          chrmId: chrm.id,\n          count: option.count,\n          isOpenJoinMulitpleChrmService: isOpenJoinMulitpleChrmService\n        });\n        var initialTime = 0;\n        return isOpenKVStorageService ? _chatRoomKVManager.pull({\n          time: initialTime,\n          chrmId: chrm.id\n        }) : utils.Defer.resolve();\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var self = this;\n      var _serverEngine = self._serverEngine;\n      return _serverEngine.quitChatRoom(chrm).then(function () {\n        self._joinedChatRoomSyner.remove(chrm.id);\n\n        return utils.Defer.resolve();\n      });\n    };\n\n    _proto.rejoinChatRoom = function rejoinChatRoom() {\n      var self = this;\n      var _joinedChatRoomSyner = self._joinedChatRoomSyner,\n          _imEventEmitter = self._imEventEmitter;\n\n      var joinedChrmInfos = _joinedChatRoomSyner.get();\n\n      utils.forEach(joinedChrmInfos, function (chrmInfo) {\n        var chrmId = chrmInfo.chrmId,\n            count = chrmInfo.count;\n        var isAutoRejoin = true,\n            isJoinExist = true;\n        return self.joinChatRoom({\n          id: chrmId\n        }, {\n          count: count,\n          isAutoRejoin: isAutoRejoin,\n          isJoinExist: isJoinExist\n        }).then(function () {\n          _imEventEmitter.emit(IM_EVENT.CHATROOM, {\n            chatroomId: chrmId,\n            count: count\n          });\n        }, function (reason) {\n          _imEventEmitter.emit(IM_EVENT.CHATROOM, {\n            chatroomId: chrmId,\n            count: count,\n            errorCode: reason\n          });\n        });\n      });\n    };\n\n    _proto.setChatRoomKV = function setChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.UPDATE,\n        userId: self._user.id\n      });\n      entry.type = CHATROOM_ENTRY_TYPE.UPDATE;\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceSetChatRoomKV = function forceSetChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.setChatRoomKV(chrm, entry);\n    };\n\n    _proto.removeChatRoomKV = function removeChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.DELETE,\n        userId: self._user.id\n      });\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceRemoveChatRoomKV = function forceRemoveChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.removeChatRoomKV(chrm, entry);\n    };\n\n    _proto.getChatRoomKV = function getChatRoomKV(chrm, key) {\n      var value = this._chatRoomKVManager.getValue(chrm.id, key);\n\n      if (utils.isEmpty(value)) {\n        return utils.Defer.reject(ERROR_INFO.CHATROOM_KEY_NOT_EXIST);\n      } else {\n        return utils.Defer.resolve(value);\n      }\n    };\n\n    _proto.getAllChatRoomKV = function getAllChatRoomKV(chrm) {\n      var kvs = this._chatRoomKVManager.getAll(chrm.id);\n\n      return utils.Defer.resolve(kvs);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, originName) {\n      var self = this;\n      var fileName = common.genUploadFileName(fileType, originName);\n      var uploadDomains = common.getUploadFileDomains(self._naviManager.getLocalConfig());\n      return self._serverEngine.getFileToken(fileType, fileName).then(function (data) {\n        return utils.extendInShallow(uploadDomains, data);\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName, uploadResp) {\n      var self = this;\n      uploadResp = uploadResp || {};\n\n      if (uploadResp.isBosRes) {\n        return utils.Defer.resolve(uploadResp);\n      }\n\n      return self._serverEngine.getFileUrl(fileType, fileName, originName);\n    };\n\n    return WebIMEngine;\n  }();\n\n  var Engine = (function (imArg) {\n    return new WebIMEngine(imArg);\n  });\n\n  var execEngineByEvent = function execEngineByEvent(params, engine) {\n    var eventName = params.event,\n        args = params.args;\n    args = args || [];\n\n    var engineEvent = engine[eventName] || function () {\n      return utils.Defer.reject(ERROR_INFO.SDK_INTERNAL_ERROR);\n    };\n\n    return engineEvent.apply(engine, args);\n  };\n\n  var EngineDispatcher = function () {\n    function EngineDispatcher(option) {\n      this._engine = void 0;\n      this._engine = new Engine(option);\n    }\n\n    var _proto = EngineDispatcher.prototype;\n\n    _proto._isEventNeedConnect = function _isEventNeedConnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isNotConnected = connectionStatus !== CONNECTION_STATUS.CONNECTED,\n          isEventNeedConnected = utils.isInclude(ENGINE_EVENT_NEED_CONNECTED, eventName);\n      return isNotConnected && isEventNeedConnected;\n    };\n\n    _proto._isEventNeedDisconnect = function _isEventNeedDisconnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isConnecting = common.isConnected(connectionStatus) || common.isConnecting(connectionStatus),\n          isEventNeedDisconnected = utils.isInclude(ENGINE_EVENT_NEED_DISCONNECTED, eventName);\n      return isConnecting && isEventNeedDisconnected;\n    };\n\n    _proto._exec = function _exec(params) {\n      var event = params.event;\n      var engine = this._engine;\n\n      if (this._isEventNeedConnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      if (this._isEventNeedDisconnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.RC_CONNECTION_EXIST);\n      }\n\n      var execResult = execEngineByEvent(params, engine);\n      return utils.isPromise(execResult) ? execResult[\"catch\"](function (error) {\n        var errorCode = error.status || error.code || error;\n        var msg = utils.isObject(error) ? error.msg : null;\n        var errorInfo = ERROR_CODE_TO_INFO[errorCode] || {\n          code: errorCode\n        };\n\n        if (msg) {\n          errorInfo.msg = msg;\n        }\n\n        var isValidErrorCode = utils.isNumberData(errorCode);\n\n        if (!isValidErrorCode) {\n          if (utils.isStackError(error)) {\n            error = error.stack.toString();\n          }\n\n          Logger.fatal(TAG.L_CRASH_E, {\n            content: {\n              desc: 'SDK Error',\n              error: error\n            }\n          });\n          errorInfo = utils.extendInShallow(ERROR_INFO.SDK_INTERNAL_ERROR, {\n            error: error\n          });\n        }\n\n        return utils.Defer.reject(errorInfo);\n      }) : execResult;\n    };\n\n    _proto.exec = function exec(params) {\n      var event = params.event;\n\n      var LOG_TAG = APP_ENGINE_EVENT_LOG_TAG[event],\n          isNeedLog = !utils.isEmpty(LOG_TAG),\n          _ref = LOG_TAG || {},\n          reqLogTag = _ref.req,\n          respLogTag = _ref.resp;\n\n      isNeedLog && Logger.info(reqLogTag, params);\n\n      var execResult = this._exec(params);\n\n      if (utils.isPromise(execResult)) {\n        return execResult.then(function (result) {\n          isNeedLog && Logger.info(respLogTag, result);\n          return result;\n        })[\"catch\"](function (error) {\n          error = error || {};\n          var _error = error,\n              code = _error.code;\n\n          if (isNeedLog && !Logger.isIgnoreErrorCode(code)) {\n            Logger.error(respLogTag, error);\n          }\n\n          return utils.Defer.reject(error);\n        });\n      } else {\n        isNeedLog && Logger.info(respLogTag, execResult);\n        return execResult;\n      }\n    };\n\n    return EngineDispatcher;\n  }();\n\n  var Type = function Type(name, validator, options) {\n    options = options || {};\n    var self = this;\n    self.validate = validator;\n    self.name = name;\n    self.errorInfo = options.errorInfo;\n\n    self.canBeNull = function () {\n      self.validate = function (data) {\n        return utils.isUndefined(data) || utils.isNull(data) || validator(data);\n      };\n\n      return self;\n    };\n  };\n\n  Type.isType = function (type) {\n    return type instanceof Type;\n  };\n\n  Type.String = new Type('String', utils.isString);\n  Type.Number = new Type('Number', utils.isNumber);\n  Type.Boolean = new Type('Boolean', utils.isBoolean);\n  Type.Function = new Type('Function', utils.isFunction);\n  Type.Object = new Type('Object', utils.isObject);\n  Type.Array = new Type('Array', utils.isArray);\n  Type.NotAllUndefined = new Type('AllUndefined', function (obj) {\n    if (utils.isObject(obj) || utils.isArray(obj)) {\n      var isNotUndefined = false;\n      utils.forEach(obj, function (val) {\n        if (!utils.isUndefined(val)) {\n          isNotUndefined = true;\n        }\n      });\n      return isNotUndefined;\n    } else {\n      return !utils.isUndefined(obj);\n    }\n  });\n  var conversationType = common.getConversationTypeList().join('、');\n  Type.ConversationType = new Type(conversationType, common.isValidConversationType, {\n    errorInfo: 'Not all settings are empty'\n  });\n  Type.ChatRoomEntryKey = new Type('ChatRoomEntryKey', common.isValidChatRoomKey, {\n    errorInfo: 'ChatRoom Key length must be 1 - 128, Only letters、numbers、+、=、-、_ are supported'\n  });\n  Type.ChatRoomEntryValue = new Type('ChatRoomEntryValue', common.isValidChatRoomValue, {\n    errorInfo: 'ChatRoom Value length must be 1 - 4096'\n  });\n\n  var Struct = function () {\n    function Struct(structure, funcName, paths) {\n      if (paths === void 0) {\n        paths = [];\n      }\n\n      if (!(this instanceof Struct)) {\n        return new Struct(structure, funcName, paths);\n      }\n\n      var self = this;\n      self.structure = structure;\n      self.paths = paths;\n      self.funcName = funcName;\n\n      if (Type.isType(structure)) {\n        self.validate = self._validateType;\n      } else if (utils.isArray(structure)) {\n        self.validate = self._validateArray;\n      } else if (utils.isObject(structure)) {\n        self.validate = self._validateObject;\n      } else {\n        self.validate = self._validateOther;\n      }\n    }\n\n    var _proto = Struct.prototype;\n\n    _proto._validateType = function _validateType(data) {\n      var structure = this.structure;\n      var isValid = structure.validate(data);\n      return isValid ? this._getSuccess() : this._getError(data);\n    };\n\n    _proto._validateArray = function _validateArray(data) {\n      var structure = this.structure;\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isArray(data)) {\n        return this._getError(data);\n      }\n\n      var typer = structure[0];\n\n      for (var filed in data) {\n        var val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateObject = function _validateObject(data) {\n      var structure = this.structure,\n          paths = this.paths;\n      data = data || {};\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isObject(data)) {\n        return this._getError(data);\n      }\n\n      var checkedField = [];\n\n      for (var filed in data) {\n        var typer = structure[filed],\n            val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n\n        checkedField.push(filed);\n      }\n\n      for (var checkField in structure) {\n        var _typer = structure[checkField];\n        var unCheckData = data[checkField];\n\n        if (!utils.isInclude(checkedField, checkField) && !_typer.validate(unCheckData)) {\n          var errPaths = utils.copy(paths);\n          errPaths.push(checkField);\n          return this._getError(unCheckData, {\n            paths: errPaths,\n            expect: _typer.name\n          });\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateOther = function _validateOther(data) {\n      var self = this;\n      var structure = self.structure;\n\n      if (utils.isEqual(structure, data) || utils.isEmpty(structure)) {\n        return self._getSuccess();\n      } else {\n        return self._getError(data, {\n          current: data,\n          expect: structure\n        });\n      }\n    };\n\n    _proto._validateField = function _validateField(typer, filed, value) {\n      var paths = this.paths,\n          funcName = this.funcName;\n      var newPaths = utils.copy(paths);\n      newPaths.push(filed);\n      return new Struct(typer, funcName, newPaths).validate(value);\n    };\n\n    _proto._getError = function _getError(data, options) {\n      if (options === void 0) {\n        options = [];\n      }\n\n      var structure = this.structure,\n          paths = this.paths,\n          funcName = this.funcName;\n      options = utils.extend({\n        current: data,\n        expect: structure.name || utils.getTypeName(structure),\n        paths: paths\n      }, options);\n      paths = options.paths;\n      var _options = options,\n          current = _options.current,\n          expect = _options.expect;\n      var param = utils.isEmpty(paths) ? 'param' : paths.join('.');\n      var currentType = utils.getTypeName(current);\n      current = utils.toJSON(current) || current;\n      current = current + \"(\" + currentType + \")\";\n      var msg = utils.tplEngine(ERROR_INFO.PARAMETER_ERROR.msg, {\n        param: param,\n        expect: expect,\n        current: current\n      });\n      var info = {\n        code: ERROR_INFO.PARAMETER_ERROR.code,\n        funcName: funcName,\n        msg: msg\n      };\n      var jsonInfo = utils.toJSON(info);\n      if (utils.isEmpty(funcName)) delete info[funcName];\n\n      if (structure.errorInfo) {\n        info = structure.errorInfo;\n      }\n\n      return {\n        isError: true,\n        info: info,\n        jsonInfo: jsonInfo\n      };\n    };\n\n    _proto._getSuccess = function _getSuccess() {\n      return {\n        isError: false\n      };\n    };\n\n    return Struct;\n  }();\n\n  var validate = (function (struct, params, eventName) {\n    return Struct(struct, eventName).validate(params);\n  });\n\n  var _MESSAGE_TYPE_VALIDAT;\n  var MESSAGE_TYPE_VALIDATE = (_MESSAGE_TYPE_VALIDAT = {}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.TEXT] = {\n    content: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.VOICE] = {\n    content: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.HQ_VOICE] = {\n    remoteUrl: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.IMAGE] = {\n    content: Type.String,\n    imageUri: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.GIF] = {\n    gifDataSize: Type.Number,\n    width: Type.Number,\n    height: Type.Number,\n    remoteUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.RICH_CONTENT] = {\n    title: Type.String,\n    content: Type.String,\n    imageUri: Type.String,\n    url: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.LOCATION] = {\n    content: Type.String,\n    latitude: Type.Number,\n    longitude: Type.Number,\n    poi: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.FILE] = {\n    name: Type.String,\n    size: Type.Number,\n    type: Type.String,\n    fileUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.SIGHT] = {\n    sightUrl: Type.String,\n    content: Type.String,\n    duration: Type.Number,\n    size: Type.Number,\n    name: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.COMBINE] = {\n    remoteUrl: Type.String,\n    conversationType: Type.Number,\n    nameList: Type.Array,\n    summaryList: Type.Array\n  }, _MESSAGE_TYPE_VALIDAT);\n  var validateMsgContent = (function (objectName, option, eventName) {\n    var validateByObjectName = MESSAGE_TYPE_VALIDATE[objectName];\n\n    if (validateByObjectName) {\n      return validate(validateByObjectName, option, eventName);\n    } else {\n      return {\n        isError: false,\n        info: ''\n      };\n    }\n  });\n\n  var Conversation = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      Conversation.create = function create(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.get = function get(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.merge = function merge(option) {\n        try {\n          return common.mergeConversationList(option);\n        } catch (e) {\n          utils.consoleError(e);\n        }\n      };\n\n      Conversation.remove = function remove(option) {\n        var _validate = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'Conversation.remove'),\n            isError = _validate.isError,\n            info = _validate.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [option]\n        });\n      };\n\n      Conversation.getList = function getList(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull(),\n          startTime: Type.Number.canBeNull()\n        }, option, 'Conversation.getList'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CONVERSATION_LIST,\n          args: [option]\n        });\n      };\n\n      Conversation.getTotalUnreadCount = function getTotalUnreadCount() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT\n        });\n      };\n\n      function Conversation(option) {\n        this.type = void 0;\n        this.targetId = void 0;\n\n        var _validate3 = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'new Conversation'),\n            isError = _validate3.isError,\n            jsonInfo = _validate3.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = Conversation.prototype;\n\n      _proto.send = function send(option) {\n        var eventName = 'conversation.send';\n\n        var _validate4 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        var _option2 = option,\n            isMentiond = _option2.isMentiond,\n            mentiondType = _option2.mentiondType,\n            mentiondUserIdList = _option2.mentiondUserIdList;\n        isMentiond && (option.isMentioned = isMentiond);\n        mentiondType && (option.mentionedType = mentiondType);\n        mentiondUserIdList && (option.mentionedUserIdList = mentiondUserIdList);\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        option = utils.extendInShallow(SEND_MESSAGE_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [this, option]\n        });\n      };\n\n      _proto.recall = function recall(message, option) {\n        var _validate5 = validate({\n          sentTime: Type.Number,\n          messageUId: Type.String\n        }, message, 'conversation.recall'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.RECALL_MESSAGE,\n          args: [this, message, option]\n        });\n      };\n\n      _proto.read = function read(option) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_UNREAD_COUNT,\n          args: [this, option]\n        });\n      };\n\n      _proto.getUnreadCount = function getUnreadCount() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_UNREAD_COUNT,\n          args: [conversation]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          order: Type.Number.canBeNull(),\n          count: Type.Number.canBeNull(),\n          timestrap: Type.Number.canBeNull()\n        }, option, 'conversation.getMessages'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_MESSAGES_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_HISTORY_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.deleteMessages = function deleteMessages(messages) {\n        var _validate7 = validate([{\n          sentTime: Type.Number,\n          messageUId: Type.String,\n          messageDirection: Type.Number\n        }], messages, 'conversation.deleteMessages'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DELETE_MESSAGES,\n          args: [this, messages]\n        });\n      };\n\n      _proto.clearMessages = function clearMessages(option) {\n        var _validate8 = validate({\n          timestrap: Type.Number\n        }, option, 'conversation.clearMessages'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_MESSAGES,\n          args: [this, option]\n        });\n      };\n\n      _proto.setStatus = function setStatus(option) {\n        var _validate9 = validate({\n          notificationStatus: Type.Number.canBeNull(),\n          isTop: Type.Boolean.canBeNull()\n        }, option, 'conversation.setStatus'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var allUndefinedValidate = validate(Type.NotAllUndefined, option);\n        isError = allUndefinedValidate.isError;\n\n        if (isError) {\n          info = allUndefinedValidate.info;\n          return utils.Defer.reject(info);\n        }\n\n        var notificationStatus = option.notificationStatus,\n            isTop = option.isTop;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_CONVERSATION_STATUS_LIST,\n          args: [[{\n            type: this.type,\n            targetId: this.targetId,\n            notificationStatus: notificationStatus,\n            isTop: isTop\n          }]]\n        });\n      };\n\n      _proto.setStatusList = function setStatusList(statusList) {\n        var _validate10 = validate([{\n          notificationStatus: Type.Number.canBeNull(),\n          isTop: Type.Boolean.canBeNull()\n        }], statusList, 'conversation.setStatusList'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var self = this;\n        statusList = utils.map(statusList, function (status) {\n          return utils.extend(status, {\n            type: self.type,\n            targetId: self.targetId\n          });\n        });\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_CONVERSATION_STATUS_LIST,\n          args: [statusList]\n        });\n      };\n\n      _proto.destory = function destory() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [conversation]\n        });\n      };\n\n      return Conversation;\n    }(), _temp;\n  });\n\n  var ChatRoom = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      ChatRoom.get = function get(option) {\n        return new ChatRoom(option);\n      };\n\n      function ChatRoom(option) {\n        this.id = void 0;\n\n        var _validate = validate({\n          id: Type.String\n        }, option, 'new ChatRoom'),\n            isError = _validate.isError,\n            jsonInfo = _validate.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = ChatRoom.prototype;\n\n      _proto.join = function join(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatRoom.join'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.joinExist = function joinExist(option) {\n        var _validate3 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatRoom.joinExist'),\n            isError = _validate3.isError,\n            info = _validate3.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option['isJoinExist'] = true;\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_CHATROOM,\n          args: [this]\n        });\n      };\n\n      _proto.getInfo = function getInfo(option) {\n        var _validate4 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull()\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_INFO_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_INFO,\n          args: [this, option]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var eventName = 'chatRoom.send';\n\n        var _validate5 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var id = this.id;\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: id\n        };\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull(),\n          timestrap: Type.Number\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_MESSAGES, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.setEntry = function setEntry(option) {\n        var _validate7 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.setEntry'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceSetEntry = function forceSetEntry(option) {\n        var _validate8 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.forceSetEntry'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.removeEntry = function removeEntry(option) {\n        var _validate9 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.removeEntry'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceRemoveEntry = function forceRemoveEntry(option) {\n        var _validate10 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.forceRemoveEntry'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.getEntry = function getEntry(key) {\n        var _validate11 = validate(Type.ChatRoomEntryKey, key, 'chatRoom.getEntry'),\n            isError = _validate11.isError,\n            info = _validate11.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_KV,\n          args: [this, key]\n        });\n      };\n\n      _proto.getAllEntries = function getAllEntries() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_ALL_KV,\n          args: [this]\n        });\n      };\n\n      return ChatRoom;\n    }(), _temp;\n  });\n\n  var RTC = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      RTC.get = function get(option) {\n        return new RTC(option);\n      };\n\n      function RTC(option) {\n        this.roomId = void 0;\n        this.option = void 0;\n        this.roomId = option.id;\n        this.option = option;\n      }\n\n      var _proto = RTC.prototype;\n\n      _proto.join = function join() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.ping = function ping() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.PING_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.getRoomInfo = function getRoomInfo() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_ROOM_INFO,\n          args: [this.option]\n        });\n      };\n\n      _proto.getUserInfoList = function getUserInfoList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_INFO_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setUserInfo = function setUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.removeUserInfo = function removeUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.setData = function setData(key, value, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_DATA,\n          args: [this.roomId, key, value, isInner, apiType, message]\n        });\n      };\n\n      _proto.getData = function getData(keys, isInner, apiType) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType]\n        });\n      };\n\n      _proto.removeData = function removeData(keys, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType, message]\n        });\n      };\n\n      _proto.setUserData = function setUserData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.setRTCUserData = function setRTCUserData(message, valueInfo, objectName) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_USER_DATA,\n          args: [this.roomId, message, valueInfo, objectName]\n        });\n      };\n\n      _proto.getUserData = function getUserData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.PERSON);\n      };\n\n      _proto.removeUserData = function removeUserData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.setRoomData = function setRoomData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getRoomData = function getRoomData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.ROOM);\n      };\n\n      _proto.removeRoomData = function removeRoomData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getUserList = function getUserList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setOutData = function setOutData(rtcData, type, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_OUT_DATA,\n          args: [this.roomId, rtcData, type, message]\n        });\n      };\n\n      _proto.getOutData = function getOutData(userIds) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_OUT_DATA,\n          args: [this.roomId, userIds]\n        });\n      };\n\n      _proto.getToken = function getToken() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_TOKEN,\n          args: [this.option]\n        });\n      };\n\n      _proto.setState = function setState(content) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_STATE,\n          args: [this.option, content]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var id = this.roomId;\n        var conversation = {\n          type: CONVERSATION_TYPE.RTC_ROOM,\n          targetId: id\n        };\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      return RTC;\n    }(), _temp;\n  });\n\n  var IM = function () {\n    function IM(option) {\n      this._engineDispatcher = void 0;\n\n      var _validate = validate({\n        appkey: Type.String\n      }, option, 'RongIMLib.init'),\n          isError = _validate.isError,\n          jsonInfo = _validate.jsonInfo;\n\n      if (isError) {\n        throw Error(jsonInfo);\n      }\n\n      var engineHandler = new EngineDispatcher(option);\n      this._engineDispatcher = engineHandler;\n      var Modules = {\n        Conversation: Conversation(engineHandler),\n        ChatRoom: ChatRoom(engineHandler),\n        RTC: RTC(engineHandler)\n      };\n      utils.extend(this, Modules);\n    }\n\n    var _proto = IM.prototype;\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_STATUS\n      });\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_USER_ID\n      });\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTED_TIME\n      });\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_APP_INFO\n      });\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _validate2 = validate({\n        conversation: Type.Function.canBeNull(),\n        message: Type.Function.canBeNull(),\n        status: Type.Function.canBeNull(),\n        setting: Type.Function.canBeNull()\n      }, watchers, 'im.watch'),\n          isError = _validate2.isError,\n          jsonInfo = _validate2.jsonInfo;\n\n      if (isError) {\n        utils.consoleError(jsonInfo);\n        return jsonInfo;\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.UN_WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.connect = function connect(user) {\n      var _validate3 = validate({\n        token: Type.String\n      }, user, 'im.connect'),\n          isError = _validate3.isError,\n          info = _validate3.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.CONNECT,\n        args: [user]\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.RECONNECT\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.DISCONNECT,\n        args: [true]\n      });\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      var _validate4 = validate({\n        token: Type.String\n      }, user, 'im.changeUser'),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var self = this;\n      return self.disconnect().then(function () {\n        return self.connect(user);\n      });\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, originName) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_TOKEN,\n        args: [fileType, originName]\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName, uploadResp) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_URL,\n        args: [fileType, fileName, originName, uploadResp]\n      });\n    };\n\n    return IM;\n  }();\n\n  var imInstance;\n\n  var initLogger = function initLogger(option, im) {\n    var isDebug = option.isDebug,\n        appkey = option.appkey,\n        logCollectEvent = option.logger;\n    utils.isFunction(logCollectEvent) && Logger.watchLog(logCollectEvent);\n    Logger.setOption({\n      isDebug: isDebug,\n      appkey: appkey\n    });\n    Logger.info(TAG.A_INIT_O, {\n      content: option\n    });\n    im.watch({\n      status: function status(_ref) {\n        var _status = _ref.status;\n        Logger.setOption({\n          isNetworkUnavailable: utils.isEqual(_status, CONNECTION_STATUS.NETWORK_UNAVAILABLE)\n        });\n      }\n    });\n  };\n\n  var init = function init(option) {\n    option = utils.extendInShallow(IM_OPTION, option);\n    option.connectType = common.getConnectType(option);\n\n    if (!imInstance) {\n      imInstance = new IM(option);\n      initLogger(option, imInstance);\n    }\n\n    return imInstance;\n  };\n\n  var getInstance = function getInstance() {\n    return imInstance;\n  };\n\n  var index = utils.extend({\n    init: init,\n    getInstance: getInstance,\n    env: env,\n    common: common,\n    ERROR_CODE: ERROR_CODE,\n    Logger: Logger\n  }, product);\n\n  return index;\n\n})));\n"
  },
  {
    "path": "api-test/lib/js/RongIMLib-3.0.6.js",
    "content": "/*\n* RongIMLib.js v3.0.6-dev\n* CodeVersion: bd0b45c07bd62b49b88cfc01b0e0d37aca0ae91c\n* Release Date: Thu Aug 13 2020 18:01:59 GMT+0800 (China Standard Time)\n* Copyright 2020 RongCloud\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongIMLib = factory());\n}(this, (function () { 'use strict';\n\n  var versionToServer = \"3.0.6\";\n\n  var SDK_VERSION = versionToServer;\n\n  var ERROR_INFO = {\n    TIMEOUT: {\n      code: -1,\n      msg: 'Network timeout'\n    },\n    SDK_INTERNAL_ERROR: {\n      code: -2,\n      msg: 'SDK internal error'\n    },\n    PARAMETER_ERROR: {\n      code: -3,\n      msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n    },\n    REJECTED_BY_BLACKLIST: {\n      code: 405,\n      msg: 'Blacklisted by the other party'\n    },\n    SEND_TOO_FAST: {\n      code: 20604,\n      msg: 'Sending messages too quickly'\n    },\n    NOT_IN_GROUP: {\n      code: 22406,\n      msg: 'Not in group'\n    },\n    FORBIDDEN_IN_GROUP: {\n      code: 22408,\n      msg: 'Forbbiden from speaking in the group'\n    },\n    NOT_IN_CHATROOM: {\n      code: 23406,\n      msg: 'Not in chatRoom'\n    },\n    FORBIDDEN_IN_CHATROOM: {\n      code: 23408,\n      msg: 'Forbbiden from speaking in the chatRoom'\n    },\n    KICKED_FROM_CHATROOM: {\n      code: 23409,\n      msg: 'Kicked out and forbbiden from joining the chatRoom'\n    },\n    CHATROOM_NOT_EXIST: {\n      code: 23410,\n      msg: 'ChatRoom does not exist'\n    },\n    CHATROOM_IS_FULL: {\n      code: 23411,\n      msg: 'ChatRoom members exceeded'\n    },\n    PARAMETER_INVALID_CHATROOM: {\n      code: 23412,\n      msg: 'Invalid chatRoom parameters'\n    },\n    ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n      code: 23414,\n      msg: 'ChatRoom message roaming service is not open, Please go to the developer to open this service'\n    },\n    RECALLMESSAGE_PARAMETER_INVALID: {\n      code: 25101,\n      msg: 'Invalid recall message parameter'\n    },\n    PUSHSETTING_PARAMETER_INVALID: {\n      code: 26001,\n      msg: 'Invalid push parameter'\n    },\n    OPERATION_BLOCKED: {\n      code: 20605,\n      msg: 'Operation is blocked'\n    },\n    OPERATION_NOT_SUPPORT: {\n      code: 20606,\n      msg: 'Operation is not supported'\n    },\n    MSG_BLOCKED_SENSITIVE_WORD: {\n      code: 21501,\n      msg: 'The sent message contains sensitive words'\n    },\n    REPLACED_SENSITIVE_WORD: {\n      code: 21502,\n      msg: 'Sensitive words in the message have been replaced'\n    },\n    NOT_CONNECTED: {\n      code: 30001,\n      msg: 'Please connect successfully first'\n    },\n    NAVI_REQUEST_ERROR: {\n      code: 30007,\n      msg: 'Navigation http request failed'\n    },\n    CMP_REQUEST_ERROR: {\n      code: 30010,\n      msg: 'CMP sniff http request failed'\n    },\n    CONN_APPKEY_FAKE: {\n      code: 31002,\n      msg: 'Your appkey is fake'\n    },\n    CONN_MINI_SERVICE_NOT_OPEN: {\n      code: 31003,\n      msg: 'Mini program service is not open, Please go to the developer to open this service'\n    },\n    CONN_ACK_TIMEOUT: {\n      code: 31000,\n      msg: 'Connection ACK timeout'\n    },\n    CONN_TOKEN_INCORRECT: {\n      code: 31004,\n      msg: 'Your token is not valid or expired'\n    },\n    CONN_NOT_AUTHRORIZED: {\n      code: 31005,\n      msg: 'AppKey and Token do not match'\n    },\n    CONN_REDIRECTED: {\n      code: 31006,\n      msg: 'Connection redirection'\n    },\n    CONN_APP_BLOCKED_OR_DELETED: {\n      code: 31008,\n      msg: 'AppKey is banned or deleted'\n    },\n    CONN_USER_BLOCKED: {\n      code: 31009,\n      msg: 'User blocked'\n    },\n    CONN_DOMAIN_INCORRECT: {\n      code: 31012,\n      msg: 'Connect domain error, Please check the set security domain'\n    },\n    ROAMING_SERVICE_UNAVAILABLE: {\n      code: 33007,\n      msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n    },\n    RC_CONNECTION_EXIST: {\n      code: 34001,\n      msg: 'Connection already exists'\n    },\n    CHATROOM_KV_EXCEED: {\n      code: 23423,\n      msg: 'ChatRoom KV setting exceeds maximum'\n    },\n    CHATROOM_KV_OVERWRITE_INVALID: {\n      code: 23424,\n      msg: 'ChatRoom KV already exists'\n    },\n    CHATROOM_KV_STORE_NOT_OPEN: {\n      code: 23426,\n      msg: 'ChatRoom KV storage service is not open, Please go to the developer to open this service'\n    },\n    CHATROOM_KEY_NOT_EXIST: {\n      code: 23427,\n      msg: 'ChatRoom key does not exist'\n    }\n  };\n  var ERROR_CODE = {};\n  var ERROR_CODE_TO_INFO = {};\n\n  for (var name$1 in ERROR_INFO) {\n    var info = ERROR_INFO[name$1];\n    var code = info.code;\n    ERROR_CODE[name$1] = code;\n    ERROR_CODE[code] = name$1;\n    ERROR_CODE_TO_INFO[code] = info;\n  }\n\n  var SERVER_ERROR_TO_CODE = {\n    '1': ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n  };\n\n  var _CONNECT_SERVER_STATU, _SERVER_DISCONNECT_ST, _TRANSPORTER_STATUS_T;\n  var NAVI_ERROR_INFO = {\n    '401': ERROR_INFO.CONN_TOKEN_INCORRECT,\n    '403': ERROR_INFO.CONN_APPKEY_FAKE\n  };\n  var CONNECTION_STATUS = {\n    CONNECTED: 0,\n    CONNECTING: 1,\n    DISCONNECTED: 2,\n    NETWORK_UNAVAILABLE: 3,\n    SOCKET_ERROR: 4,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n    BLOCKED: 12\n  };\n  var SERVER_DISCONNECT_STATUS = {\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 1,\n    BLOCKED: 2\n  };\n  var CONNECT_SERVER_STATUS = {\n    IDENTIFIER_REJECTED: 2,\n    CONN_MINI_SERVICE_NOT_OPEN: 3,\n    TOKEN_INCORRECT: 4,\n    NOT_AUTHORIZED: 5,\n    REDIRECT: 6,\n    PACKAGE_ERROR: 7,\n    APP_BLOCK_OR_DELETE: 8,\n    BLOCK: 9,\n    TOKEN_EXPIRE: 10,\n    DEVICE_ERROR: 11,\n    DOMAIN_INCORRECT: 12\n  };\n  var TRANSPORTER_STATUS = {\n    CONNECTED: CONNECTION_STATUS.CONNECTED,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT,\n    BLOCKED: CONNECTION_STATUS.BLOCKED,\n    CLOSE_NORMAL: 1000,\n    CLOSE_GOING_AWAY: 1001,\n    CLOSE_PROTOCOL_ERROR: 1002,\n    CLOSE_UNSUPPORTED: 1003,\n    CLOSE_NO_STATUS: 1005,\n    CLOSE_ABNORMAL: 1006,\n    UNSUPPORTED_DATA: 1007,\n    POLICY_VIOLATION: 1008,\n    CLOSE_TOO_LARGE: 1009,\n    MISSING_EXTENSION: 1010,\n    INTERNAL_ERROR: 1011,\n    SERVICE_RESTART: 1012,\n    TRY_AGAIN_LATER: 1013,\n    TSL_HANDSHAKE: 1015,\n    PING_FIRST_TIMEOUT: 2001,\n    PING_TIMEOUT: 2002,\n    DISCONNECT_TOO_FAST: 2003,\n    EXCEED_MESSAGE_ID_LIMIT: 2004,\n    COMET_REQUEST_ERROR: 2005,\n    MINI_URL_NOT_IN_DOMAIN_LIST: 2006,\n    CMP_CONNECTION_TIMEOUT: 2007\n  };\n  var CONNECT_SERVER_STATUS_MAP_ERROR_INFO = (_CONNECT_SERVER_STATU = {}, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.IDENTIFIER_REJECTED] = ERROR_INFO.CONN_APPKEY_FAKE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.CONN_MINI_SERVICE_NOT_OPEN] = ERROR_INFO.CONN_MINI_SERVICE_NOT_OPEN, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_INCORRECT] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.NOT_AUTHORIZED] = ERROR_INFO.CONN_NOT_AUTHRORIZED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.REDIRECT] = ERROR_INFO.CONN_REDIRECTED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.APP_BLOCK_OR_DELETE] = ERROR_INFO.CONN_APP_BLOCKED_OR_DELETED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.BLOCK] = ERROR_INFO.CONN_USER_BLOCKED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_EXPIRE] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.DOMAIN_INCORRECT] = ERROR_INFO.CONN_DOMAIN_INCORRECT, _CONNECT_SERVER_STATU[TRANSPORTER_STATUS.CMP_CONNECTION_TIMEOUT] = ERROR_INFO.CONN_ACK_TIMEOUT, _CONNECT_SERVER_STATU);\n  var MINI_ERROR_MSG_TO_STATUS = {\n    'url not in domain list': TRANSPORTER_STATUS.MINI_URL_NOT_IN_DOMAIN_LIST\n  };\n  var SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS = (_SERVER_DISCONNECT_ST = {}, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT] = TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.BLOCKED] = TRANSPORTER_STATUS.BLOCKED, _SERVER_DISCONNECT_ST);\n  var TRANSPORTER_STATUS_NEED_UPDATE_CMP = [TRANSPORTER_STATUS.CLOSE_NORMAL, TRANSPORTER_STATUS.CLOSE_GOING_AWAY, TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR, TRANSPORTER_STATUS.CLOSE_UNSUPPORTED, TRANSPORTER_STATUS.UNSUPPORTED_DATA, TRANSPORTER_STATUS.POLICY_VIOLATION, TRANSPORTER_STATUS.MISSING_EXTENSION, TRANSPORTER_STATUS.INTERNAL_ERROR, TRANSPORTER_STATUS.SERVICE_RESTART, TRANSPORTER_STATUS.TRY_AGAIN_LATER, TRANSPORTER_STATUS.TSL_HANDSHAKE, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST, TRANSPORTER_STATUS.COMET_REQUEST_ERROR];\n  var TRANSPORTER_STATUS_NEED_RECONNECT = TRANSPORTER_STATUS_NEED_UPDATE_CMP.concat([TRANSPORTER_STATUS.PING_TIMEOUT, TRANSPORTER_STATUS.CLOSE_ABNORMAL, TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT, TRANSPORTER_STATUS.COMET_REQUEST_ERROR]);\n  var TRANSPORTER_STATUS_TO_CONNECTION_STATUS = (_TRANSPORTER_STATUS_T = {}, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_GOING_AWAY] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_UNSUPPORTED] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_NO_STATUS] = CONNECTION_STATUS.DISCONNECTED, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_ABNORMAL] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.DISCONNECT_TOO_FAST] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.UNSUPPORTED_DATA] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.POLICY_VIOLATION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_TOO_LARGE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.MISSING_EXTENSION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.INTERNAL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.SERVICE_RESTART] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TRY_AGAIN_LATER] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TSL_HANDSHAKE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_FIRST_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.COMET_REQUEST_ERROR] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T);\n\n  var CONNECT_TYPE = {\n    COMET: 'comet',\n    WEBSOCKET: 'websocket'\n  };\n  var CONVERSATION_TYPE = {\n    PRIVATE: 1,\n    GROUP: 3,\n    CHATROOM: 4,\n    CUSTOMER_SERVICE: 5,\n    SYSTEM: 6,\n    RTC_ROOM: 12\n  };\n  var MESSAGE_DIRECTION = {\n    SEND: 1,\n    RECEIVE: 2\n  };\n  var MESSAGS_TIME_ORDER = {\n    DESC: 0,\n    ASC: 1\n  };\n  var CHATROOM_ORDER = {\n    ASC: 1,\n    DESC: 2\n  };\n  var RECALL_MESSAGE_TYPE = 'RC:RcCmd';\n  var MENTIOND_TYPE = {\n    ALL: 1,\n    SINGAL: 2\n  };\n  var MESSAGE_TYPE = {\n    TEXT: 'RC:TxtMsg',\n    VOICE: 'RC:VcMsg',\n    HQ_VOICE: 'RC:HQVCMsg',\n    IMAGE: 'RC:ImgMsg',\n    GIF: 'RC:GIFMsg',\n    RICH_CONTENT: 'RC:ImgTextMsg',\n    LOCATION: 'RC:LBSMsg',\n    FILE: 'RC:FileMsg',\n    SIGHT: 'RC:SightMsg',\n    COMBINE: 'RC:CombineMsg',\n    CHRM_KV_NOTIFY: 'RC:chrmKVNotiMsg',\n    LOG_COMMAND: 'RC:LogCmdMsg'\n  };\n  var RTC_API_TYPE = {\n    ROOM: 1,\n    PERSON: 2\n  };\n  var FILE_TYPE = {\n    IMAGE: 1,\n    AUDIO: 2,\n    VIDEO: 3,\n    FILE: 4\n  };\n  var CHATROOM_ENTRY_TYPE = {\n    UPDATE: 1,\n    DELETE: 2\n  };\n  var NOTIFICATION_STATUS = {\n    DO_NOT_DISTURB: 1,\n    NOTIFY: 2\n  };\n  var RECEIVED_STATUS = {\n    READ: 0x1,\n    LISTENED: 0x2,\n    DOWNLOADED: 0x4,\n    RETRIEVED: 0x8,\n    UNREAD: 0\n  };\n  var product = {\n    CONNECT_TYPE: CONNECT_TYPE,\n    CONNECTION_STATUS: CONNECTION_STATUS,\n    CONVERSATION_TYPE: CONVERSATION_TYPE,\n    MESSAGE_DIRECTION: MESSAGE_DIRECTION,\n    MESSAGS_TIME_ORDER: MESSAGS_TIME_ORDER,\n    CHATROOM_ORDER: CHATROOM_ORDER,\n    RECALL_MESSAGE_TYPE: RECALL_MESSAGE_TYPE,\n    MESSAGE_TYPE: MESSAGE_TYPE,\n    MENTIOND_TYPE: MENTIOND_TYPE,\n    SDK_VERSION: SDK_VERSION,\n    FILE_TYPE: FILE_TYPE,\n    CHATROOM_ENTRY_TYPE: CHATROOM_ENTRY_TYPE,\n    NOTIFICATION_STATUS: NOTIFICATION_STATUS,\n    RECEIVED_STATUS: RECEIVED_STATUS\n  };\n\n  var IM_TIMEOUT = 30000;\n  var IM_PING_INTERVAL_TIME = 30000;\n  var IM_COMET_PULLMSG_TIMEOUT = 45000;\n  var IM_PING_MAX_TIMEOUT = 6000;\n  var IM_PING_MIN_TIMEOUT = 2000;\n  var PULL_MSG_TIME = 180000;\n  var NAVI_EXPIRED_TIME = 7200000;\n  var CMP_SNIFF_INTERNAL_TIME = 1000;\n  var CMP_CONNECT_TIMEOUT_TIME = 10000;\n  var FIRST_PING_TIMEOUT = 1000;\n  var NAVI_REQUEST_SUCCESS_CODE = 200;\n  var NAVI_SEPARATOR_IN_TOKEN = '@';\n  var NAVI_REQUEST_TIMEOUT = 10000;\n  var DOMAIN_SEPARATOR_IN_NAVLIST = ';';\n  var DOMAIN_SEPARATOR_IN_CMPLIST = ',';\n  var MAX_SINGAL_ID = 65535;\n  var MINIMUM_CONNECT_DURATION = 5000;\n  var CHATROOM_KEY_LENGTH = {\n    MAX: 128,\n    MIN: 1\n  };\n  var CHATROOM_VALUE_LENGTH = {\n    MAX: 4096,\n    MIN: 1\n  };\n  var TYPE_HAS_CONVERSATION = [CONVERSATION_TYPE.PRIVATE, CONVERSATION_TYPE.GROUP, CONVERSATION_TYPE.SYSTEM];\n  var PLATFORM = {\n    WEB: 'web',\n    WX: 'wx',\n    ZFB: 'zfb',\n    TT: 'tt',\n    BAIDU: 'baidu',\n    QUICK_APP: 'quick_app',\n    UNI: 'uni'\n  };\n  var REQUEST_METHOD = {\n    POST: 'post',\n    GET: 'get'\n  };\n  var STORAGE_ROOT_KEY = 'rc-';\n  var STORAGE_DEVICE_ID_KEY = STORAGE_ROOT_KEY + 'deviceId';\n  var STORAGE_SESSION_ID_KEY = STORAGE_ROOT_KEY + 'sessionId';\n  var STORAGE_NAVI = {\n    ROOT_KEY_TPL: 'nav-{appkey}-{UID}',\n    SUB_KEY: {\n      CONNECT_TYPE: 'connettype',\n      TIME_WHEN_SAVED: 'time',\n      RESPONSE: 'resp'\n    }\n  };\n  var STORAGE_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      SENDBOX: 'send',\n      INBOX: 'in'\n    }\n  };\n  var SESSION_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      TIME: 't'\n    }\n  };\n  var STORAGE_CONVERSATION = {\n    ROOT_KEY_TPL: 'con-{appkey}-{userId}',\n    SUB_KEY: {\n      ROOT_TPL: '{type}-{id}',\n      UNREAD_COUNT: 'c',\n      UNREAD_LAST_TIME: 't',\n      HAS_MENTIOND: 'hm',\n      MENTIOND_INFO: 'm',\n      NOTIFICATION: 'no',\n      TOP: 'to'\n    }\n  };\n  var STORAGE_CONVERSATION_STATUS = {\n    ROOT_KEY_TPL: 'con-s-{appkey}-{userId}',\n    SUB_KEY: {\n      TIME: 't'\n    }\n  };\n  var STORAGE_USER_SETTING = {\n    ROOT_KEY_TPL: 'sett-{appkey}-{userId}',\n    SUB_KEY: {\n      VERSION: 'v',\n      SETTINGS: 's'\n    }\n  };\n  var HTTP_PROTOCOL = {\n    HTTP: 'http:',\n    HTTPS: 'https:',\n    FILE: 'file:'\n  };\n  var WS_PROTOCOL = {\n    WSS: 'wss:',\n    WS: 'ws:'\n  };\n  var NAVI_CALLBACK_NAME = 'getServerEndpoint';\n  var NAVI_TYPE = {\n    COMET: 'cometnavi',\n    WEBSOCKET: 'navi'\n  };\n  var NAVI_URL_TPL = '{url}/{type}.js?appId={appkey}&token={token}&callBack=' + NAVI_CALLBACK_NAME + '&r={random}&v=' + SDK_VERSION;\n  var CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION;\n  var MINI_CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION + '&platform={platform}';\n  var COMET_REQ_HAS_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&topic={topic}&targetid={targetId}&pid={pid}';\n  var COMET_REQ_NO_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&pid={pid}';\n  var COMET_PULL_URL_TPL = '{protocol}//{domain}/pullmsg.js?sessionid={sessionId}&timestrap={timestamp}&pid={pid}';\n  var TIMER_TYPE = {\n    INTERVAL: 'interval',\n    TIMEOUT: 'timeout'\n  };\n  var TIMER_STATUS = {\n    PENNDING: 'pendding',\n    BUSY: 'busy',\n    ENDING: 'ending'\n  };\n  var PLATFORM_TYPE = {\n    MINI: 'MiniProgram',\n    WEB: 'Web'\n  };\n  var SESSION_SYNC_CHATROOM = {\n    ROOT_KEY_TPL: 'sync-chrm-{appkey}-{userId}'\n  };\n\n  var UnKown = 'UnKown';\n\n  var hasMiniBaseEvent = function hasMiniBaseEvent(miniGlobal) {\n    var baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n\n    for (var i = 0, max = baseMiniEventNames.length; i < max; i++) {\n      var baseEventName = baseMiniEventNames[i];\n\n      if (!miniGlobal[baseEventName]) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n  var isFromUniappEnv = function isFromUniappEnv() {\n    if (typeof uni !== 'undefined' && hasMiniBaseEvent(uni)) {\n      return true;\n    }\n\n    return false;\n  };\n\n  var isFromUniapp = isFromUniappEnv();\n  var isAppPlus = false;\n\n  var isMiniEnv = function isMiniEnv(global) {\n    if (isAppPlus) {\n      return false;\n    }\n\n    return global !== window;\n  };\n\n  var getEnvInfo = function getEnvInfo() {\n    if (typeof swan !== 'undefined' && hasMiniBaseEvent(swan)) {\n      return {\n        platform: PLATFORM.BAIDU,\n        global: swan\n      };\n    } else if (typeof tt !== 'undefined' && hasMiniBaseEvent(tt)) {\n      return {\n        platform: PLATFORM.TT,\n        global: tt\n      };\n    } else if (typeof my !== 'undefined' && hasMiniBaseEvent(my)) {\n      return {\n        platform: PLATFORM.ZFB,\n        global: my\n      };\n    } else if (typeof wx !== 'undefined' && hasMiniBaseEvent(wx)) {\n      return {\n        platform: PLATFORM.WX,\n        global: wx\n      };\n    } else {\n      return {\n        platform: PLATFORM.WEB,\n        global: window\n      };\n    }\n  };\n\n  var getFromUniEnvInfo = function getFromUniEnvInfo() {\n    var uniPlatform = process.env.VUE_APP_PLATFORM;\n\n    switch (uniPlatform) {\n      case 'app-plus':\n        isAppPlus = true;\n        return {\n          platform: PLATFORM.UNI,\n          global: uni\n        };\n\n      case 'mp-baidu':\n        return {\n          platform: PLATFORM.BAIDU,\n          global: swan\n        };\n\n      case 'mp-toutiao':\n        return {\n          platform: PLATFORM.TT,\n          global: tt\n        };\n\n      case 'mp-alipay':\n        return {\n          platform: PLATFORM.ZFB,\n          global: my\n        };\n\n      case 'mp-weixin':\n        return {\n          platform: PLATFORM.WX,\n          global: wx\n        };\n\n      case 'h5':\n        return {\n          platform: PLATFORM.WEB,\n          global: window\n        };\n\n      default:\n        return {\n          platform: 'not included platform',\n          global: window\n        };\n    }\n  };\n\n  var getWebSystemInfo = function getWebSystemInfo() {\n    var userAgent = navigator.userAgent;\n    var version, type;\n    var condition = {\n      IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n      Edge: /Edge\\/([\\d.]+)/,\n      Firefox: /Firefox\\/([\\d.]+)/,\n      Opera: /(?:OPERA|OPR).([\\d.]+)/,\n      WeiXin: /MicroMessenger\\/([\\d.]+)/,\n      QQBrowser: /QQBrowser\\/([\\d.]+)/,\n      Chrome: /Chrome\\/([\\d.]+)/,\n      Safari: /Version\\/([\\d.]+).*Safari/\n    };\n\n    for (var key in condition) {\n      if (!condition.hasOwnProperty(key)) continue;\n      var browserContent = userAgent.match(condition[key]);\n\n      if (browserContent) {\n        type = key;\n        version = browserContent[1] || browserContent[2];\n        break;\n      }\n    }\n\n    return {\n      model: type || UnKown,\n      version: version || UnKown\n    };\n  };\n\n  var getMiniSystemInfo = function getMiniSystemInfo(global) {\n    var systemInfo = global.getSystemInfoSync() || {};\n    var model = systemInfo.model,\n        brand = systemInfo.brand;\n\n    if (model && brand) {\n      model = model + ' ' + brand;\n    }\n\n    systemInfo.model = model;\n    return systemInfo;\n  };\n\n  var getProtocol = function getProtocol(global) {\n    var location = global.location || {};\n    var isHttp = location.protocol === HTTP_PROTOCOL.HTTP || location.protocol === HTTP_PROTOCOL.FILE;\n    var protocol = {\n      http: isHttp ? HTTP_PROTOCOL.HTTP : HTTP_PROTOCOL.HTTPS,\n      ws: WS_PROTOCOL.WSS\n    };\n\n    if (isHttp) {\n      protocol.ws = WS_PROTOCOL.WS;\n    }\n\n    return protocol;\n  };\n\n  var adaptGlobalObjectCreate = function adaptGlobalObjectCreate(global, isMini) {\n    if (!isMini && !isAppPlus && !global.Object.create) {\n      global.Object.create = function (o, properties) {\n        if (typeof o !== 'object' && typeof o !== 'function') throw new TypeError('Object prototype may only be an Object: ' + o);else if (o === null) throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support \\'null\\' as the first argument.');\n        if (typeof properties !== 'undefined') throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support a second argument.');\n\n        function F() {}\n\n        F.prototype = o;\n        return new F();\n      };\n    }\n  };\n\n  var getMiniGlobal = function getMiniGlobal(global) {\n    return Object.assign(global, {\n      JSON: JSON,\n      Promise: Promise,\n      setTimeout: setTimeout,\n      setInterval: setInterval,\n      encodeURIComponent: encodeURIComponent,\n      clearTimeout: function (_clearTimeout) {\n        function clearTimeout(_x) {\n          return _clearTimeout.apply(this, arguments);\n        }\n\n        clearTimeout.toString = function () {\n          return _clearTimeout.toString();\n        };\n\n        return clearTimeout;\n      }(function (id) {\n        clearTimeout(id);\n      }),\n      clearInterval: function (_clearInterval) {\n        function clearInterval(_x2) {\n          return _clearInterval.apply(this, arguments);\n        }\n\n        clearInterval.toString = function () {\n          return _clearInterval.toString();\n        };\n\n        return clearInterval;\n      }(function (id) {\n        clearInterval(id);\n      })\n    });\n  };\n\n  var envInfo = isFromUniapp ? getFromUniEnvInfo() : getEnvInfo();\n  var platform = envInfo.platform,\n      global$1 = envInfo.global;\n  var isMini = isMiniEnv(global$1);\n  var protocol = getProtocol(global$1);\n  var system = isMini || isAppPlus ? getMiniSystemInfo(global$1) : getWebSystemInfo();\n  system.name = platform;\n  adaptGlobalObjectCreate(global$1, isMini);\n  global$1 = isMini || isAppPlus ? getMiniGlobal(global$1) : global$1;\n  var env = {\n    global: global$1,\n    system: system,\n    isMini: isMini,\n    protocol: protocol,\n    isAppPlus: isAppPlus,\n    isFromUniapp: isFromUniapp\n  };\n\n  var global$2 = env.global,\n      system$1 = env.system;\n  var isZFB = system$1.name === PLATFORM.ZFB;\n\n  var ZFBStorage = function () {\n    function ZFBStorage() {}\n\n    var _proto = ZFBStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$2.setStorageSync({\n        key: key,\n        data: value\n      });\n    };\n\n    _proto.get = function get(key) {\n      return global$2.getStorageSync({\n        key: key\n      });\n    };\n\n    _proto.remove = function remove(key) {\n      return global$2.removeStorageSync({\n        key: key\n      });\n    };\n\n    _proto.getKeys = function getKeys() {\n      var res = my.getStorageInfoSync();\n      return res.keys;\n    };\n\n    return ZFBStorage;\n  }();\n\n  var MiniStorage = function () {\n    function MiniStorage() {}\n\n    var _proto2 = MiniStorage.prototype;\n\n    _proto2.set = function set(key, value) {\n      global$2.setStorageSync(key, value);\n    };\n\n    _proto2.get = function get(key) {\n      try {\n        return global$2.getStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.remove = function remove(key) {\n      try {\n        return global$2.removeStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.getKeys = function getKeys() {\n      try {\n        var res = global$2.getStorageInfoSync();\n        return res.keys;\n      } catch (e) {\n        return [];\n      }\n    };\n\n    return MiniStorage;\n  }();\n\n  var storage = isZFB ? ZFBStorage : MiniStorage;\n\n  var JSON$1 = {\n    parse: function parse(sJSON) {\n      return new Function('', 'return (' + sJSON + ')')();\n    },\n    stringify: function stringify(value) {\n      return JSON$1.str('', {\n        '': value\n      });\n    },\n    str: function str(key, holder) {\n      var i,\n          k,\n          v,\n          length,\n          partial,\n          value = holder[key],\n          self = JSON$1;\n\n      if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n        value = value.toJSON(key);\n      }\n\n      switch (typeof value) {\n        case 'string':\n          return self.quote(value);\n\n        case 'number':\n          return isFinite(value) ? String(value) : 'null';\n\n        case 'boolean':\n          return String(value);\n\n        case 'object':\n          if (!value) {\n            return 'null';\n          }\n\n          partial = [];\n\n          if (Object.prototype.toString.apply(value) === '[object Array]') {\n            length = value.length;\n\n            for (i = 0; i < length; i += 1) {\n              partial[i] = self.str(i, value) || 'null';\n            }\n\n            v = partial.length === 0 ? '[]' : '[' + partial.join(',') + ']';\n            return v;\n          }\n\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = self.str(k, value);\n\n              if (v) {\n                partial.push(self.quote(k) + ':' + v);\n              }\n            }\n          }\n\n          v = partial.length === 0 ? '{}' : '{' + partial.join(',') + '}';\n          return v;\n      }\n    },\n    quote: function quote(string) {\n      var self = JSON$1;\n      self.rx_escapable.lastIndex = 0;\n      return self.rx_escapable.test(string) ? '\"' + string.replace(self.rx_escapable, function (a) {\n        var c = self.meta[a];\n        return typeof c === 'string' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n      }) + '\"' : '\"' + string + '\"';\n    },\n    rx_escapable: new RegExp(\"[\\\\\\\"\\\\\\\\\\\"\\0-\\x1F\\x7F-\\x9F\\xAD\\u0600-\\u0604\\u070F\\u17B4\\u17B5\\u200C-\\u200F\\u2028-\\u202F\\u2060-\\u206F\\uFEFF\\uFFF0-\\uFFFF]\", 'g'),\n    meta: {\n      '\\b': '\\\\b',\n      '\t': '\\\\t',\n      '\\n': '\\\\n',\n      '\\f': '\\\\f',\n      '\\r': '\\\\r',\n      '\"': '\\\\\"',\n      '\\'\\'': '\\\\\\'\\'',\n      '\\\\': '\\\\\\\\'\n    }\n  };\n\n  var CacheStorage = function () {\n    function CacheStorage(values) {\n      this.caches = {};\n\n      if (values) {\n        this.caches = values;\n      }\n    }\n\n    var _proto = CacheStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      this.caches[key] = value;\n    };\n\n    _proto.remove = function remove(key) {\n      var val = this.get(key);\n      delete this.caches[key];\n      return val;\n    };\n\n    _proto.get = function get(key) {\n      return this.caches[key];\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keys = [];\n\n      for (var key in this.caches) {\n        keys.push(key);\n      }\n\n      return keys;\n    };\n\n    return CacheStorage;\n  }();\n\n  var global$3 = env.global;\n  var TEST_KEY = 'RC_TEST_KEY';\n  var TEST_VALUE = 'RC_TEST_VALUE';\n\n  var isSupportLocalStorage = function isSupportLocalStorage() {\n    var isSupport = false;\n    var localStorage = global$3.localStorage;\n\n    if (localStorage) {\n      try {\n        localStorage.setItem(TEST_KEY, TEST_VALUE);\n        var testVal = localStorage.getItem(TEST_KEY);\n\n        if (testVal === TEST_VALUE) {\n          isSupport = true;\n        }\n\n        localStorage.removeItem(TEST_KEY);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebStorage = function () {\n    function WebStorage() {}\n\n    var _proto = WebStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$3.localStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$3.localStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$3.localStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$3.localStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebStorage;\n  }();\n\n  var WebStorage$1 = isSupportLocalStorage() ? WebStorage : CacheStorage;\n\n  var isMini$1 = env.isMini,\n      isAppPlus$1 = env.isAppPlus;\n  var Storage = isMini$1 || isAppPlus$1 ? storage : WebStorage$1,\n      storage$1 = new Storage();\n\n  var global$4 = env.global;\n  var TEST_KEY$1 = 'RC_TEST_KEY';\n  var TEST_VALUE$1 = 'RC_TEST_VALUE';\n\n  var isSupportSessionStorage = function isSupportSessionStorage() {\n    var isSupport = false;\n    var sessionStorage = global$4.sessionStorage;\n\n    if (sessionStorage) {\n      try {\n        sessionStorage.setItem(TEST_KEY$1, TEST_VALUE$1);\n        var testVal = sessionStorage.getItem(TEST_KEY$1);\n\n        if (testVal === TEST_VALUE$1) {\n          isSupport = true;\n        }\n\n        sessionStorage.removeItem(TEST_KEY$1);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebSession = function () {\n    function WebSession() {}\n\n    var _proto = WebSession.prototype;\n\n    _proto.set = function set(key, value) {\n      global$4.sessionStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$4.sessionStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$4.sessionStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$4.sessionStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebSession;\n  }();\n\n  var WebSession$1 = isSupportSessionStorage() ? WebSession : CacheStorage;\n\n  var isMini$2 = env.isMini,\n      isAppPlus$2 = env.isAppPlus;\n  var Session = isMini$2 || isAppPlus$2 ? CacheStorage : WebSession$1,\n      session = new Session();\n\n  var global$5 = env.global,\n      isAppPlus$3 = env.isAppPlus;\n\n  var Socket = function () {\n    function Socket(options) {\n      this.socket = void 0;\n\n      if (isAppPlus$3) {\n        options['complete'] = function () {};\n      }\n\n      this.socket = global$5.connectSocket(options);\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      this.socket.send({\n        data: data\n      });\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.onOpen(callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.onMessage(callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.onError(callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.onClose(callback);\n    };\n\n    return Socket;\n  }();\n\n  var Socket$1 = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      var url = options.url;\n      this.socket = new WebSocket(url);\n      this.socket.binaryType = 'arraybuffer';\n      return this;\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      return this.socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.addEventListener('open', callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.addEventListener('message', callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.addEventListener('error', callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.addEventListener('close', callback);\n    };\n\n    return Socket;\n  }();\n\n  var isMini$3 = env.isMini,\n      isAppPlus$4 = env.isAppPlus;\n  var Socket$2 = isMini$3 || isAppPlus$4 ? Socket : Socket$1;\n\n  /*!\n   基于 es6-promise\n   * Github: https://github.com/stefanpenner/es6-promise\n   * @overview es6-promise - a tiny implementation of Promises/A+.\n   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n   * @license   Licensed under MIT license\n   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n   * @version   v4.2.8+1e68dce6\n   */\n  var SparePromise = (function(){function a(a){var b=typeof a;return null!==a&&(\"object\"===b||\"function\"===b)}function b(a){return \"function\"==typeof a}function c(a){P=a;}function d(a){Q=a;}function e(){return function(){return process.nextTick(j)}}function f(){return \"undefined\"!=typeof O?function(){O(j);}:i()}function g(){var a=0,b=new T(j),c=document.createTextNode(\"\");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2;}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.postMessage(0)}}function i(){var a=setTimeout;return function(){return a(j,1)}}function j(){var a,b,c;for(a=0;N>a;a+=2)b=W[a],c=W[a+1],b(c),W[a]=void 0,W[a+1]=void 0;N=0;}function k(){try{var a=Function(\"return this\")().require(\"vertx\");return O=a.runOnLoop||a.runOnContext,f()}catch(b){return i()}}function l(a,b){var e,f,c=this,d=new this.constructor(n);return void 0===d[Y]&&D(d),e=c._state,e?(f=arguments[e-1],Q(function(){return A(e,d,f,c._result)})):y(c,d,a,b),d}function m(a){var c,b=this;return a&&\"object\"==typeof a&&a.constructor===b?a:(c=new b(n),u(c,a),c)}function n(){}function o(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function q(a,b,c,d){try{a.call(b,c,d);}catch(e){return e}}function r(a,b,c){Q(function(a){var d=!1,e=q(c,b,function(c){d||(d=!0,b!==c?u(a,c):w(a,c));},function(b){d||(d=!0,x(a,b));},\"Settle: \"+(a._label||\" unknown promise\"));!d&&e&&(d=!0,x(a,e));},a);}function s(a,b){b._state===$?w(a,b._result):b._state===_?x(a,b._result):y(b,void 0,function(b){return u(a,b)},function(b){return x(a,b)});}function t(a,c,d){c.constructor===a.constructor&&d===l&&c.constructor.resolve===m?s(a,c):void 0===d?w(a,c):b(d)?r(a,c,d):w(a,c);}function u(b,c){if(b===c)x(b,o());else if(a(c)){var d=void 0;try{d=c.then;}catch(e){return void x(b,e)}t(b,c,d);}else w(b,c);}function v(a){a._onerror&&a._onerror(a._result),z(a);}function w(a,b){a._state===Z&&(a._result=b,a._state=$,0!==a._subscribers.length&&Q(z,a));}function x(a,b){a._state===Z&&(a._state=_,a._result=b,Q(v,a));}function y(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+$]=c,e[f+_]=d,0===f&&a._state&&Q(z,a);}function z(a){var d,e,f,g,b=a._subscribers,c=a._state;if(0!==b.length){for(d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0;}}function A(a,c,d,e){var f=b(d),g=void 0,h=void 0,i=!0;if(f){try{g=d(e);}catch(j){i=!1,h=j;}if(c===g)return void x(c,p())}else g=e;c._state!==Z||(f&&i?u(c,g):i===!1?x(c,h):a===$?w(c,g):a===_&&x(c,g));}function B(a,b){try{b(function(b){u(a,b);},function(b){x(a,b);});}catch(c){x(a,c);}}function C(){return ab++}function D(a){a[Y]=ab++,a._state=void 0,a._result=void 0,a._subscribers=[];}function E(){return new Error(\"Array Methods must be provided an Array\")}function F(a){return new bb(this,a).promise}function G(a){var b=this;return new b(M(a)?function(c,d){for(var e=a.length,f=0;e>f;f++)b.resolve(a[f]).then(c,d);}:function(a,b){return b(new TypeError(\"You must pass an array to race.\"))})}function H(a){var b=this,c=new b(n);return x(c,a),c}function I(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function J(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function K(){var c,d,a=void 0;if(\"undefined\"!=typeof global)a=global;else if(\"undefined\"!=typeof self)a=self;else try{a=Function(\"return this\")();}catch(b){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}if(c=a.Promise){d=null;try{d=Object.prototype.toString.call(c.resolve());}catch(b){}if(\"[object Promise]\"===d&&!c.cast)return}a.Promise=cb;}var M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,L=void 0;return L=Array.isArray?Array.isArray:function(a){return \"[object Array]\"===Object.prototype.toString.call(a)},M=L,N=0,O=void 0,P=void 0,Q=function(a,b){W[N]=a,W[N+1]=b,N+=2,2===N&&(P?P(j):X());},R=\"undefined\"!=typeof window?window:void 0,S=R||{},T=S.MutationObserver||S.WebKitMutationObserver,U=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),V=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,W=new Array(1e3),X=void 0,X=U?e():T?g():V?h():void 0===R&&\"function\"==typeof require?k():i(),Y=Math.random().toString(36).substring(2),Z=void 0,$=1,_=2,ab=0,bb=function(){function a(a,b){this._instanceConstructor=a,this.promise=new a(n),this.promise[Y]||D(this.promise),M(b)?(this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(b),0===this._remaining&&w(this.promise,this._result))):x(this.promise,E());}return a.prototype._enumerate=function(a){for(var b=0;this._state===Z&&b<a.length;b++)this._eachEntry(a[b],b);},a.prototype._eachEntry=function(a,b){var e,f,g,i,c=this._instanceConstructor,d=c.resolve;if(d===m){e=void 0,f=void 0,g=!1;try{e=a.then;}catch(h){g=!0,f=h;}e===l&&a._state!==Z?this._settledAt(a._state,b,a._result):\"function\"!=typeof e?(this._remaining--,this._result[b]=a):c===cb?(i=new c(n),g?x(i,f):t(i,a,e),this._willSettleAt(i,b)):this._willSettleAt(new c(function(b){return b(a)}),b);}else this._willSettleAt(d(a),b);},a.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===Z&&(this._remaining--,a===_?x(d,c):this._result[b]=c),0===this._remaining&&w(d,this._result);},a.prototype._willSettleAt=function(a,b){var c=this;y(a,void 0,function(a){return c._settledAt($,b,a)},function(a){return c._settledAt(_,b,a)});},a}(),cb=function(){function a(b){this[Y]=C(),this._result=this._state=void 0,this._subscribers=[],n!==b&&(\"function\"!=typeof b&&I(),this instanceof a?B(this,b):J());}return a.prototype[\"catch\"]=function(a){return this.then(null,a)},a.prototype[\"finally\"]=function(a){var c=this,d=c.constructor;return b(a)?c.then(function(b){return d.resolve(a()).then(function(){return b})},function(b){return d.resolve(a()).then(function(){throw b})}):c.then(a,a)},a}(),cb.prototype.then=l,cb.all=F,cb.race=G,cb.resolve=m,cb.reject=H,cb._setScheduler=c,cb._setAsap=d,cb._asap=Q,cb.polyfill=K,cb.Promise=cb,cb})();\n\n  var global$6 = env.global;\n  var MiniRequest = (function (option) {\n    var success = option.success,\n        fail = option.fail,\n        body = option.body;\n    option.data = option.data || body;\n    var xhr;\n\n    option.success = function (result) {\n      success(result.data, result.statusCode);\n    };\n\n    option.fail = function (result) {\n      fail(result.data, result.statusCode);\n    };\n\n    xhr = global$6.request(option);\n    return xhr;\n  });\n\n  var global$7 = env.global;\n\n  var isXDomainRequest = function isXDomainRequest(xhr) {\n    return Object.prototype.toString.call(xhr) === '[object XDomainRequest]' || typeof XDomainRequest === 'object';\n  };\n\n  var isValidRequest = function isValidRequest(obj) {\n    return typeof obj === 'function' || typeof obj === 'object';\n  };\n\n  var createXHR = function createXHR() {\n    var item = {\n      XMLHttpRequest: function (_XMLHttpRequest) {\n        function XMLHttpRequest() {\n          return _XMLHttpRequest.apply(this, arguments);\n        }\n\n        XMLHttpRequest.toString = function () {\n          return _XMLHttpRequest.toString();\n        };\n\n        return XMLHttpRequest;\n      }(function () {\n        return new XMLHttpRequest();\n      }),\n      XDomainRequest: function (_XDomainRequest) {\n        function XDomainRequest() {\n          return _XDomainRequest.apply(this, arguments);\n        }\n\n        XDomainRequest.toString = function () {\n          return _XDomainRequest.toString();\n        };\n\n        return XDomainRequest;\n      }(function () {\n        return new XDomainRequest();\n      }),\n      ActiveXObject: function (_ActiveXObject) {\n        function ActiveXObject() {\n          return _ActiveXObject.apply(this, arguments);\n        }\n\n        ActiveXObject.toString = function () {\n          return _ActiveXObject.toString();\n        };\n\n        return ActiveXObject;\n      }(function () {\n        return new ActiveXObject('Microsoft.XMLHTTP');\n      })\n    };\n    var isXHR = isValidRequest(global$7.XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest();\n    var isXDR = isValidRequest(global$7.XDomainRequest);\n    var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n    return item[key]();\n  };\n\n  var request = function request(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        success = option.success,\n        fail = option.fail,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    var xhr = createXHR();\n    xhr.open(method, url);\n\n    if (headers && xhr.setRequestHeader) {\n      for (var key in headers) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n\n    if ('onload' in xhr) {\n      xhr.onload = function () {\n        success(xhr.responseText, xhr);\n      };\n\n      xhr.onerror = function () {\n        fail(xhr.responseText, xhr);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          var result = xhr.responseText,\n              status = xhr.status;\n\n          if (status === 0) {\n            fail(result, xhr, status);\n          } else {\n            success(result, xhr, status);\n          }\n        }\n      };\n    }\n\n    if ('ontimeout' in xhr) {\n      xhr.ontimeout = function () {\n        fail(xhr.responseText, xhr);\n      };\n    }\n\n    if (timeout) {\n      xhr.timeout = timeout;\n    }\n\n    if (isXDomainRequest(xhr) && typeof body === 'object') {\n      body = JSON$1.stringify(body);\n    }\n\n    xhr.send(body);\n    return xhr;\n  };\n\n  var request$1 = env.isMini || env.isAppPlus ? MiniRequest : request;\n\n  /*\n   * JavaScript MD5\n   * https://github.com/blueimp/JavaScript-MD5\n   *\n   * Copyright 2011, Sebastian Tschan\n   * https://blueimp.net\n   *\n   * Licensed under the MIT license:\n   * https://opensource.org/licenses/MIT\n   *\n   * Based on\n   * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n   * Digest Algorithm, as defined in RFC 1321.\n   * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n   * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n   * Distributed under the BSD License\n   * See http://pajhome.org.uk/crypt/md5 for more info.\n   */\n  var md5 = (function(){function a(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){var h,i,j,k,l,m,n,o,p;for(b[c>>5]|=128<<c%32,b[(c+64>>>9<<4)+14]=c,m=1732584193,n=-271733879,o=-1732584194,p=271733878,h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return [m,n,o,p]}function i(a){var b,c=\"\",d=32*a.length;for(b=0;d>b;b+=8)c+=String.fromCharCode(255&a[b>>5]>>>b%32);return c}function j(a){var b,d,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(d=8*a.length,b=0;d>b;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,g,d=j(a),e=[],f=[];for(e[15]=f[15]=void 0,d.length>16&&(d=h(d,8*a.length)),c=0;16>c;c+=1)e[c]=909522486^d[c],f[c]=1549556828^d[c];return g=h(e.concat(j(b)),512+8*b.length),i(h(f.concat(g),640))}function m(a){var d,e,b=\"0123456789abcdef\",c=\"\";for(e=0;e<a.length;e+=1)d=a.charCodeAt(e),c+=b.charAt(15&d>>>4)+b.charAt(15&d);return c}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s})();\n\n  var global$8 = env.global;\n  var Promise$1 = global$8.Promise;\n\n  var isSupportPromise = function isSupportPromise() {\n    if (!global$8.Promise) return false;\n\n    var defer = function () {\n      return global$8.Promise.resolve();\n    }();\n\n    return defer.then && defer[\"catch\"] && defer[\"finally\"];\n  };\n\n  var setTimeout$1 = function setTimeout(event, timeout) {\n    return global$8.setTimeout(event, timeout);\n  };\n\n  var clearTimeout$1 = function clearTimeout(id) {\n    return global$8.clearTimeout(id);\n  };\n\n  var setInterval$1 = function setInterval(event, timeout) {\n    return global$8.setInterval(event, timeout);\n  };\n\n  var clearInterval$1 = function clearInterval(id) {\n    return global$8.clearInterval(id);\n  };\n\n  var Defer = isSupportPromise() ? global$8.Promise : SparePromise;\n\n  var noop = function noop(data) {\n    return data;\n  };\n\n  var deferNoop = function deferNoop(data) {\n    return Promise$1.resolve(data);\n  };\n\n  var JSON$2 = global$8.JSON || JSON$1;\n\n  var allowError = function allowError(event) {\n    var result;\n\n    try {\n      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n\n      result = event.apply(void 0, args);\n    } catch (e) {\n      result = null;\n    }\n\n    return result;\n  };\n\n  var toJSON = function toJSON(val) {\n    return allowError(JSON$2.stringify, val);\n  };\n\n  var parseJSON = function parseJSON(val) {\n    return allowError(JSON$2.parse, val);\n  };\n\n  var copy = function copy(val) {\n    return parseJSON(toJSON(val));\n  };\n\n  var isObject = function isObject(val) {\n    return Object.prototype.toString.call(val) === '[object Object]';\n  };\n\n  var isArray = function isArray(val) {\n    return Object.prototype.toString.call(val).indexOf('Array') !== -1;\n  };\n\n  var isFunction = function isFunction(val) {\n    return Object.prototype.toString.call(val) === '[object Function]';\n  };\n\n  var isString = function isString(val) {\n    return Object.prototype.toString.call(val) === '[object String]';\n  };\n\n  var isBoolean = function isBoolean(val) {\n    return Object.prototype.toString.call(val) === '[object Boolean]';\n  };\n\n  var isUndefined = function isUndefined(val) {\n    return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  };\n\n  var isNull = function isNull(val) {\n    return Object.prototype.toString.call(val) === '[object Null]';\n  };\n\n  var isNumber = function isNumber(val) {\n    return Object.prototype.toString.call(val) === '[object Number]';\n  };\n\n  var isArrayBuffer = function isArrayBuffer(val) {\n    return Object.prototype.toString.call(val) === '[object ArrayBuffer]';\n  };\n\n  var isPromise = function isPromise(val) {\n    var isTrue = false;\n\n    try {\n      isTrue = Object.prototype.toString.call(val) === '[object Promise]' || val && val.then && val[\"catch\"] && val[\"finally\"];\n    } catch (e) {\n      isTrue = false;\n    }\n\n    return isTrue;\n  };\n\n  var getTypeName = function getTypeName(data) {\n    var typeName = Object.prototype.toString.call(data);\n    return typeName.substring(8, typeName.length - 1);\n  };\n\n  var isEqual = function isEqual(source, target) {\n    return source === target;\n  };\n\n  var ArrayBufferToArray = function ArrayBufferToArray(data) {\n    if (isArrayBuffer(data)) {\n      return [].slice.call(new Int8Array(data));\n    }\n\n    return data;\n  };\n\n  var ArrayBufferToUint8Array = function ArrayBufferToUint8Array(data) {\n    if (isArrayBuffer(data)) {\n      return new Uint8Array(data);\n    }\n\n    return data;\n  };\n\n  var forEach = function forEach(source, event, options) {\n    options = options || {};\n    event = event || noop;\n    var _options = options,\n        isReverse = _options.isReverse;\n\n    var loopObj = function loopObj() {\n      for (var key in source) {\n        event(source[key], key, source);\n      }\n    };\n\n    var loopArr = function loopArr() {\n      if (isReverse) {\n        for (var i = source.length - 1; i >= 0; i--) {\n          event(source[i], i);\n        }\n      } else {\n        for (var j = 0, len = source.length; j < len; j++) {\n          event(source[j], j);\n        }\n      }\n    };\n\n    if (isObject(source)) {\n      loopObj();\n    }\n\n    if (isArray(source) || isString(source)) {\n      loopArr();\n    }\n  };\n\n  var isFalse = function isFalse(val) {\n    return val === false;\n  };\n\n  var isEmpty = function isEmpty(val) {\n    var result = true;\n\n    if (isObject(val)) {\n      forEach(val, function () {\n        result = false;\n      });\n    }\n\n    if (isString(val) || isArray(val)) {\n      result = val.length === 0;\n    }\n\n    if (isNumber(val)) {\n      result = val === 0;\n    }\n\n    return result;\n  };\n\n  var isNumberData = function isNumberData(val) {\n    var isEmptyVal = isEmpty(val);\n    val = Number(val);\n    return isNumber(val) && !isEmptyVal;\n  };\n\n  var getKeys = function getKeys(obj) {\n    var keyList = [];\n    forEach(obj, function (val, key) {\n      keyList.push(key);\n    });\n    return keyList;\n  };\n\n  var getValues = function getValues(obj) {\n    var valList = [];\n    forEach(obj, function (val) {\n      valList.push(val);\n    });\n    return valList;\n  };\n\n  var getTimestamp = function getTimestamp(time) {\n    return new Date(time).getTime();\n  };\n\n  var getCurrentTimestamp = function getCurrentTimestamp() {\n    return new Date().getTime();\n  };\n\n  var formatTime = function formatTime(timestamp, options) {\n    timestamp = timestamp || getCurrentTimestamp();\n    options = options || {};\n    var temp = options.temp;\n    var date = new Date(timestamp),\n        formateds = {};\n    formateds['YY'] = date.getFullYear();\n    formateds['MM'] = date.getMonth() + 1;\n    formateds['DD'] = date.getDate();\n    formateds['hh'] = date.getHours();\n    formateds['mm'] = date.getMinutes();\n    formateds['ss'] = date.getSeconds();\n    forEach(formateds, function (val, key) {\n      formateds[key] = val >= 10 ? val : '0' + val;\n    });\n\n    if (temp) {\n      var formatedText = temp;\n      forEach(formateds, function (val, key) {\n        formatedText = formatedText.replace(key, val);\n      });\n      return formatedText;\n    }\n\n    return formateds.YY + '-' + formateds.MM + '-' + formateds.DD + ' ' + formateds.hh + ':' + formateds.mm + ':' + formateds.ss;\n  };\n\n  var isValidJSON = function isValidJSON(jsonStr) {\n    if (isObject(jsonStr)) {\n      return true;\n    }\n\n    var isValid = false;\n\n    try {\n      var obj = JSON$2.parse(jsonStr);\n      var str = JSON$2.stringify(obj);\n      isValid = str === jsonStr;\n    } catch (e) {\n      isValid = false;\n    }\n\n    return isValid;\n  };\n\n  var isSupportSocket = function isSupportSocket() {\n    var isMini = env.isMini;\n    var isAppPlus = env.isAppPlus;\n\n    if (isMini || isAppPlus) {\n      return true;\n    }\n\n    var Socket = global$8.WebSocket;\n\n    if (isUndefined(Socket)) {\n      return false;\n    }\n\n    var hasWS = false,\n        isIntegrity = false;\n\n    try {\n      hasWS = typeof Socket === 'object' || typeof Socket === 'function';\n      isIntegrity = typeof Socket.OPEN === 'number';\n    } catch (e) {}\n\n    return hasWS && isIntegrity;\n  };\n\n  var indexOf = function indexOf(source, searchVal) {\n    if (source.indexOf) {\n      return source.indexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    });\n    return index;\n  };\n\n  var lastIndexOf = function lastIndexOf(source, searchVal) {\n    if (source.lastIndexOf) {\n      return source.lastIndexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    }, {\n      isReverse: true\n    });\n    return index;\n  };\n\n  var isInclude = function isInclude(source, searchVal) {\n    if (isObject(source)) {\n      var arr = [];\n      forEach(source, function (val) {\n        arr.push(val);\n      });\n      source = arr;\n    }\n\n    var index = indexOf(source, searchVal);\n    return index !== -1;\n  };\n\n  var substring = function substring(source, start, end) {\n    return source.substring(start, end);\n  };\n\n  var spliceByChild = function spliceByChild(arr, item) {\n    forEach(arr, function (child, index) {\n      if (isEqual(child, item)) {\n        arr.splice(index, 1);\n      }\n    }, {\n      isReverse: true\n    });\n  };\n\n  var parse16To10 = function parse16To10(num) {\n    return parseInt(num, 16);\n  };\n\n  var isPlus = function isPlus(num) {\n    return +num === num;\n  };\n\n  var filter = function filter(source, event) {\n    var newArr = [];\n\n    for (var i = 0, max = source.length; i < max; i++) {\n      var data = source[i];\n\n      if (event(data, i)) {\n        newArr.push(data);\n      }\n    }\n\n    return newArr;\n  };\n\n  var map = function map(source, event) {\n    forEach(source, function (item, index) {\n      source[index] = event(item, index);\n    });\n    return source;\n  };\n\n  var extend = function extend(destination, sources, option) {\n    option = option || {};\n    var _option2 = option,\n        isAllowNull = _option2.isAllowNull;\n    destination = destination || {};\n    sources = sources || {};\n\n    for (var key in sources) {\n      var value = sources[key];\n\n      if (!isUndefined(value) || isAllowNull) {\n        destination[key] = value;\n      }\n    }\n\n    return destination;\n  };\n\n  var extendAllowNull = function extendAllowNull(destination, sources) {\n    return extend(destination, sources, {\n      isAllowNull: true\n    });\n  };\n\n  var extendInShallow = function extendInShallow(destination, sources) {\n    destination = destination || {};\n    sources = sources || {};\n    destination = copy(destination);\n    sources = copy(sources);\n    return extend(destination, sources);\n  };\n\n  var deferred = function deferred(callbacks) {\n    return new Defer(callbacks);\n  };\n\n  var deferTimeout = function deferTimeout(timeout) {\n    return deferred(function (resolve) {\n      var timeouter = setTimeout$1(function () {\n        resolve(timeouter);\n      }, timeout);\n    });\n  };\n\n  var tplEngine = function tplEngine(temp, data, regexp) {\n    var replaceAction = function replaceAction(obj) {\n      return temp.replace(regexp || /{([^}]+)}/g, function (match, name) {\n        if (match.charAt(0) === '\\\\') {\n          return match.slice(1);\n        }\n\n        return obj[name] !== undefined ? obj[name] : '{' + name + '}';\n      });\n    };\n\n    if (!isArray(data)) {\n      data = [data];\n    }\n\n    var ret = [];\n    forEach(data, function (item) {\n      ret.push(replaceAction(item));\n    });\n    return ret.join('');\n  };\n\n  var getRandomNum = function getRandomNum(max, min) {\n    min = min || 0;\n    var range = max - min,\n        random = Math.random();\n    return min + Math.round(random * range);\n  };\n\n  var Timer = function () {\n    function Timer(options) {\n      this._timerId = void 0;\n      this._timerEvent = void 0;\n      this._timerClearEvent = void 0;\n      this.timeout = 0;\n      this.type = TIMER_TYPE.TIMEOUT;\n      this.status = TIMER_STATUS.PENNDING;\n      var self = this;\n      extend(self, options);\n      var type = self.type;\n      var isTimeout = type === TIMER_TYPE.TIMEOUT;\n\n      if (isTimeout) {\n        self._timerEvent = setTimeout$1;\n        self._timerClearEvent = clearTimeout$1;\n      } else {\n        self._timerEvent = setInterval$1;\n        self._timerClearEvent = clearInterval$1;\n      }\n\n      return self;\n    }\n\n    var _proto = Timer.prototype;\n\n    _proto.start = function start(event, options) {\n      options = options || {};\n      var self = this,\n          isTimeout = self.type === TIMER_TYPE.TIMEOUT;\n      var _options2 = options,\n          args = _options2.args,\n          thisArg = _options2.thisArg;\n      self.stop();\n      self._timerId = self._timerEvent.call(global$8, function () {\n        isTimeout && self.stop();\n\n        if (thisArg) {\n          event.apply(thisArg, args);\n        } else {\n          event(args);\n        }\n      }, self.timeout);\n      self.status = TIMER_STATUS.BUSY;\n    };\n\n    _proto.stop = function stop() {\n      var self = this;\n\n      if (self._timerId) {\n        self._timerClearEvent.call(global$8, self._timerId);\n\n        self.status = TIMER_STATUS.ENDING;\n      }\n    };\n\n    return Timer;\n  }();\n\n  var DeferHandler = function () {\n    function DeferHandler(options) {\n      this._list = {};\n      this.timeout = IM_TIMEOUT;\n      extend(this, options);\n    }\n\n    var _proto2 = DeferHandler.prototype;\n\n    _proto2._isInvalid = function _isInvalid(id) {\n      var handlers = this._list[id];\n      return !isArray(handlers) || isEmpty(handlers);\n    };\n\n    _proto2._exec = function _exec(id, isError, data) {\n      var self = this;\n\n      if (self._isInvalid(id)) {\n        return;\n      }\n\n      var handlers = self._list[id],\n          handler = handlers[0];\n      isError ? handler.reject(data) : handler.resolve(data);\n      handlers.splice(0, 1);\n    };\n\n    _proto2.add = function add(id, defer, options) {\n      options = options || {};\n      var self = this;\n      var resolve = defer.resolve,\n          reject = defer.reject;\n      var timeout = options.timeout || self.timeout;\n\n      if (self._isInvalid(id)) {\n        self._list[id] = [];\n      }\n\n      var timer = new Timer({\n        timeout: timeout\n      });\n      timer.start(function () {\n        self.reject(id, ERROR_INFO.TIMEOUT.code);\n      });\n\n      self._list[id].push({\n        resolve: resolve,\n        reject: reject,\n        timer: timer\n      });\n    };\n\n    _proto2.resolve = function resolve(id, data) {\n      this._exec(id, false, data);\n    };\n\n    _proto2.reject = function reject(id, error) {\n      this._exec(id, true, error);\n    };\n\n    return DeferHandler;\n  }();\n\n  var EventEmitter = function () {\n    function EventEmitter() {\n      this._events = void 0;\n      this._events = {};\n    }\n\n    var _proto3 = EventEmitter.prototype;\n\n    _proto3.on = function on(name, event) {\n      var _events = this._events[name] || [];\n\n      _events.push(event);\n\n      this._events[name] = _events;\n    };\n\n    _proto3.off = function off(name, offEvent) {\n      if (offEvent) {\n        var _events = this._events[name] || [];\n\n        spliceByChild(_events, offEvent);\n      } else {\n        delete this._events[name];\n      }\n    };\n\n    _proto3.emit = function emit(name, data, error) {\n      var _events = this._events[name];\n      forEach(_events, function (event) {\n        isFunction(event) && event(data, error);\n      });\n    };\n\n    _proto3.clear = function clear() {\n      this._events = {};\n    };\n\n    return EventEmitter;\n  }();\n\n  var decodeURI = function decodeURI(uri) {\n    return global$8.decodeURIComponent(uri);\n  };\n\n  var encodeURI = function encodeURI(uri) {\n    return global$8.encodeURIComponent(uri);\n  };\n\n  var int64ToTimestamp = function int64ToTimestamp(obj) {\n    if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n      return obj;\n    }\n\n    var low = obj.low;\n\n    if (low < 0) {\n      low += 0xffffffff + 1;\n    }\n\n    low = low.toString(16);\n    var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n    return timestamp;\n  };\n\n  var batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n    forEach(data, function (item, key) {\n      if (isObject(item)) {\n        data[key] = int64ToTimestamp(item);\n      }\n    });\n    return data;\n  };\n\n  var Queue = function () {\n    function Queue(defaultConfig) {\n      this._isRunning = false;\n      this._list = [];\n      this._defaultConfig = void 0;\n      this._defaultConfig = defaultConfig;\n    }\n\n    var _proto4 = Queue.prototype;\n\n    _proto4.add = function add(params) {\n      params = params || this._defaultConfig;\n\n      this._list.push(params);\n\n      this.run();\n    };\n\n    _proto4.run = function run() {\n      var self = this;\n      var _isRunning = self._isRunning,\n          _list = self._list;\n      var isFinished = isEmpty(_list);\n\n      if (_isRunning || isFinished) {\n        return;\n      }\n\n      var firstItem = _list.splice(0, 1)[0];\n\n      var event = firstItem.event,\n          args = firstItem.args,\n          thisArg = firstItem.thisArg;\n\n      var next = function next() {\n        self._isRunning = false;\n        self.run();\n      };\n\n      if (!event) {\n        return next();\n      }\n\n      self._isRunning = true;\n      event.apply(thisArg, args).then(next)[\"catch\"](next);\n    };\n\n    return Queue;\n  }();\n\n  var secondsToMilliseconds = function secondsToMilliseconds(seconds) {\n    return seconds * 1000;\n  };\n\n  var request$2 = function request(url, options) {\n    options = options || {};\n    return deferred(function (resolve, reject) {\n      options = extend(options, {\n        url: url,\n        success: function success(responseText, xhr, status) {\n          resolve({\n            responseText: responseText,\n            xhr: xhr,\n            status: status\n          });\n        },\n        fail: function fail(result, xhr, status) {\n          reject({\n            result: result,\n            xhr: xhr,\n            status: status\n          });\n        }\n      });\n      request$1(options);\n    });\n  };\n\n  var requestByUrlList = function requestByUrlList(urlList, options) {\n    if (isEmpty(urlList)) {\n      return Defer.reject();\n    }\n\n    var url = urlList[0];\n    return request$2(url, options).then(function (result) {\n      result = result || {};\n      result.urlList = urlList;\n      return result;\n    })[\"catch\"](function (error) {\n      urlList.splice(0, 1);\n\n      if (isEmpty(urlList)) {\n        return Defer.reject(error);\n      } else {\n        return requestByUrlList(urlList, options);\n      }\n    });\n  };\n\n  var requestForFaster = function requestForFaster(urlList, option) {\n    option = option || {};\n    var timeInterval = option.timeInterval || 0;\n    var faildCount = 0,\n        totalCount = urlList.length;\n    var requestXhrs = [];\n    var totalTimer = new Timer({\n      timeout: 15 * 1000\n    });\n    var reqCountdownTimers = [];\n\n    var clearAll = function clearAll() {\n      forEach(reqCountdownTimers, function (timer) {\n        timer.stop();\n      });\n      forEach(requestXhrs, function (xhr) {\n        xhr.abort();\n      });\n      reqCountdownTimers.length = 0;\n      requestXhrs.length = 0;\n    };\n\n    var isAllFaild = function isAllFaild() {\n      return faildCount === totalCount;\n    };\n\n    return deferred(function (resolve, reject) {\n      var _success = function success(url, index) {\n        clearAll();\n        resolve({\n          url: url,\n          index: index\n        });\n      };\n\n      var _fail = function fail() {\n        clearAll();\n        reject();\n      };\n\n      forEach(urlList, function (url, index) {\n        var timer = new Timer({\n          timeout: timeInterval * index\n        });\n        timer.start(function () {\n          var xhr;\n          var opt = extend({\n            url: url,\n            success: function success() {\n              _success(url, index);\n            },\n            fail: function fail() {\n              faildCount++;\n              isAllFaild() && _fail();\n            }\n          }, option);\n          xhr = request$1(opt);\n          requestXhrs.push(xhr);\n        });\n        reqCountdownTimers.push(timer);\n      });\n      totalTimer.start(_fail);\n    });\n  };\n\n  var NetworkDetecter = function () {\n    function NetworkDetecter(option) {\n      this._option = void 0;\n      this._detectCount = 0;\n      this._timeoutId = void 0;\n      this._option = option;\n    }\n\n    var _proto5 = NetworkDetecter.prototype;\n\n    _proto5._detect = function _detect() {\n      var self = this;\n      var _detectCount = self._detectCount,\n          _option = self._option;\n      var url = _option.url,\n          timeout = _option.intervalTime,\n          max = _option.max;\n      _detectCount++;\n      return request$2(url).then(function () {\n        return;\n      }, function (_ref) {\n        var status = _ref.status;\n\n        if (isEqual(status, 404)) {\n          return;\n        }\n\n        var isAlreadyMax = max && isEqual(max, _detectCount);\n\n        if (isAlreadyMax) {\n          return Defer.reject();\n        }\n\n        return deferTimeout(timeout).then(function (timeoutId) {\n          self._detectCount = _detectCount;\n          self._timeoutId = timeoutId;\n          return self._detect();\n        });\n      });\n    };\n\n    _proto5.start = function start() {\n      return this._detect();\n    };\n\n    _proto5.stop = function stop() {\n      var timeoutId = this._timeoutId;\n\n      if (timeoutId) {\n        clearTimeout$1(timeoutId);\n      }\n    };\n\n    return NetworkDetecter;\n  }();\n\n  var toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n    if (isUndefined(startIndex) || isUndefined(endIndex)) {\n      return str.toUpperCase();\n    }\n\n    var sliceStr = str.slice(startIndex, endIndex);\n    str = str.replace(sliceStr, function (text) {\n      return text.toUpperCase();\n    });\n    return str;\n  };\n\n  var getDomainByUrl = function getDomainByUrl(url) {\n    var StartMark = '://',\n        EndMark = '/';\n    var urlProtocolIndex = indexOf(url, StartMark);\n    var hasProtocol = urlProtocolIndex > -1;\n\n    if (hasProtocol) {\n      urlProtocolIndex = urlProtocolIndex + StartMark.length;\n      url = substring(url, urlProtocolIndex, url.length);\n    }\n\n    var urlPathIndex = indexOf(url, EndMark);\n    var hasPath = urlPathIndex > -1;\n\n    if (hasPath) {\n      url = substring(url, 0, urlPathIndex);\n    }\n\n    return url;\n  };\n\n  var getValidUrl = function getValidUrl(url, option) {\n    option = option || {};\n    var ProtocolMark = '://';\n    var hasProtocol = isInclude(url, ProtocolMark);\n    var localProtocol = env.protocol.http;\n    var _option3 = option,\n        protocol = _option3.protocol;\n\n    if (protocol) {\n      var domain = getDomainByUrl(url);\n      url = protocol + \"//\" + domain;\n    }\n\n    if (hasProtocol) {\n      var urlProtocolIndex = indexOf(url, ProtocolMark) + 1;\n      var urlProtocol = substring(url, 0, urlProtocolIndex);\n      var isHttpUrl = urlProtocol === HTTP_PROTOCOL.HTTP;\n      var isLocalHttps = localProtocol === HTTP_PROTOCOL.HTTPS;\n\n      if (isHttpUrl && isLocalHttps) {\n        var _domain = getDomainByUrl(url);\n\n        return HTTP_PROTOCOL.HTTPS + \"//\" + _domain;\n      } else {\n        return url;\n      }\n    } else {\n      return localProtocol + \"//\" + url;\n    }\n  };\n\n  var quickSort = function quickSort(arr, event) {\n    var sort = function sort(array, left, right, event) {\n      event = event || function (a, b) {\n        return a <= b;\n      };\n\n      if (left < right) {\n        var x = array[right],\n            i = left - 1,\n            temp;\n\n        for (var j = left; j <= right; j++) {\n          if (event(array[j], x)) {\n            i++;\n            temp = array[i];\n            array[i] = array[j];\n            array[j] = temp;\n          }\n        }\n\n        sort(array, left, i - 1, event);\n        sort(array, i + 1, right, event);\n      }\n\n      return array;\n    };\n\n    return sort(arr, 0, arr.length - 1, event);\n  };\n\n  var unique = function unique(arr, event) {\n    var keyEvent = event || function (data) {\n      return data;\n    };\n\n    var hashTable = {};\n    var newArr = [];\n    forEach(arr, function (data) {\n      var key = keyEvent(data);\n\n      if (!hashTable[key]) {\n        hashTable[key] = true;\n        newArr.push(data);\n      }\n    });\n    return newArr;\n  };\n\n  var isStackError = function isStackError(error) {\n    error = error || {};\n    return error.stack && error.stack.toString;\n  };\n\n  var consoleError = function consoleError() {\n    var _console;\n\n    return (_console = console).error.apply(_console, arguments);\n  };\n\n  var consoleLog = function consoleLog() {\n    var _console2;\n\n    return (_console2 = console).log.apply(_console2, arguments);\n  };\n\n  var string10to64 = function string10to64(number) {\n    var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''),\n        radix = chars.length + 1,\n        qutient = +number,\n        arr = [];\n\n    do {\n      var mod = qutient % radix;\n      qutient = (qutient - mod) / radix;\n      arr.unshift(chars[mod]);\n    } while (qutient);\n\n    return arr.join('');\n  };\n\n  var getUUID = function getUUID() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      var r = Math.random() * 16 | 0,\n          v = c === 'x' ? r : r & 0x3 | 0x8;\n      return v.toString(16);\n    });\n  };\n\n  var getUUID22 = function getUUID22() {\n    var uuid = getUUID();\n    uuid = uuid.replace(/-/g, '') + 'a';\n    uuid = parseInt(uuid, 16);\n    uuid = string10to64(uuid);\n\n    if (uuid.length > 22) {\n      uuid = uuid.slice(0, 22);\n    } else {\n      var len = 22 - uuid.length;\n\n      for (var i = 0; i < len; i++) {\n        uuid = uuid + '0';\n      }\n    }\n\n    return uuid;\n  };\n\n  var isValidTimestamp = function isValidTimestamp(time) {\n    return isNumber(time) && time !== 0;\n  };\n\n  var formateDate = function formateDate(seperator) {\n    var date = new Date();\n    var year = date.getFullYear();\n    var month = date.getMonth() + 1;\n    var day = date.getDate();\n    return tplEngine('{year}{seperator}{month}{seperator}{day}', {\n      year: year,\n      month: month,\n      day: day,\n      seperator: seperator\n    });\n  };\n\n  var utils = {\n    Storage: storage$1,\n    Session: session,\n    Socket: Socket$2,\n    Cache: CacheStorage,\n    JSON: JSON$2,\n    Defer: Defer,\n    httpRequest: request$1,\n    request: request$2,\n    requestByUrlList: requestByUrlList,\n    requestForFaster: requestForFaster,\n    md5: md5,\n    DeferHandler: DeferHandler,\n    EventEmitter: EventEmitter,\n    Timer: Timer,\n    Queue: Queue,\n    consoleError: consoleError,\n    consoleLog: consoleLog,\n    noop: noop,\n    deferNoop: deferNoop,\n    setTimeout: setTimeout$1,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    isObject: isObject,\n    isArray: isArray,\n    isFunction: isFunction,\n    isArrayBuffer: isArrayBuffer,\n    isString: isString,\n    isBoolean: isBoolean,\n    isUndefined: isUndefined,\n    isNull: isNull,\n    isNumber: isNumber,\n    isNumberData: isNumberData,\n    isPromise: isPromise,\n    getTypeName: getTypeName,\n    isPlus: isPlus,\n    isEmpty: isEmpty,\n    isFalse: isFalse,\n    isEqual: isEqual,\n    isValidJSON: isValidJSON,\n    isSupportSocket: isSupportSocket,\n    ArrayBufferToArray: ArrayBufferToArray,\n    ArrayBufferToUint8Array: ArrayBufferToUint8Array,\n    indexOf: indexOf,\n    lastIndexOf: lastIndexOf,\n    isInclude: isInclude,\n    substring: substring,\n    getKeys: getKeys,\n    getValues: getValues,\n    getTimestamp: getTimestamp,\n    getCurrentTimestamp: getCurrentTimestamp,\n    formatTime: formatTime,\n    parse16To10: parse16To10,\n    forEach: forEach,\n    map: map,\n    filter: filter,\n    extend: extend,\n    extendAllowNull: extendAllowNull,\n    extendInShallow: extendInShallow,\n    deferred: deferred,\n    tplEngine: tplEngine,\n    getRandomNum: getRandomNum,\n    int64ToTimestamp: int64ToTimestamp,\n    batchInt64ToTimestamp: batchInt64ToTimestamp,\n    encodeURI: encodeURI,\n    decodeURI: decodeURI,\n    secondsToMilliseconds: secondsToMilliseconds,\n    NetworkDetecter: NetworkDetecter,\n    toUpperCase: toUpperCase,\n    getDomainByUrl: getDomainByUrl,\n    getValidUrl: getValidUrl,\n    quickSort: quickSort,\n    unique: unique,\n    isStackError: isStackError,\n    getUUID: getUUID,\n    getUUID22: getUUID22,\n    isValidTimestamp: isValidTimestamp,\n    formateDate: formateDate\n  };\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__proto__ = superClass;\n  }\n\n  var _PUBLISH_TOPIC_TO_CON, _CONVERSATION_TYPE_TO, _CONVERSATION_TYPE_TO2, _CONVERSATION_TYPE_TO3, _CONVERSATION_TYPE_TO4;\n  var SUCCESS_CODE = 0;\n  var PULL_MSG_TYPE = {\n    NORMAL: 1,\n    CHATROOM: 2\n  };\n  var MESSAGE_NAME = {\n    CONN_ACK: 'ConnAckMessage',\n    DISCONNECT: 'DisconnectMessage',\n    PING_REQ: 'PingReqMessage',\n    PING_RESP: 'PingRespMessage',\n    PUBLISH: 'PublishMessage',\n    PUB_ACK: 'PubAckMessage',\n    QUERY: 'QueryMessage',\n    QUERY_CON: 'QueryConMessage',\n    QUERY_ACK: 'QueryAckMessage'\n  };\n  var QOS = {\n    AT_MOST_ONCE: 0,\n    AT_LEAST_ONCE: 1,\n    EXACTLY_ONCE: 2,\n    DEFAULT: 3,\n    '0': 'AT_MOST_ONCE',\n    '1': 'AT_LEAST_ONCE',\n    '2': 'EXACTLY_ONCE',\n    '3': 'DEFAULT'\n  };\n  var OPERATE_TYPE = {\n    CONNECT: 1,\n    '1': 'CONNECT',\n    CONNACK: 2,\n    '2': 'CONNACK',\n    PUBLISH: 3,\n    '3': 'PUBLISH',\n    PUBACK: 4,\n    '4': 'PUBACK',\n    QUERY: 5,\n    '5': 'QUERY',\n    QUERYACK: 6,\n    '6': 'QUERYACK',\n    QUERYCON: 7,\n    '7': 'QUERYCON',\n    SUBSCRIBE: 8,\n    '8': 'SUBSCRIBE',\n    SUBACK: 9,\n    '9': 'SUBACK',\n    UNSUBSCRIBE: 10,\n    '10': 'UNSUBSCRIBE',\n    UNSUBACK: 11,\n    '11': 'UNSUBACK',\n    PINGREQ: 12,\n    '12': 'PINGREQ',\n    PINGRESP: 13,\n    '13': 'PINGRESP',\n    DISCONNECT: 14,\n    '14': 'DISCONNECT'\n  };\n  var PUBLISH_TOPIC = {\n    PRIVATE: 'ppMsgP',\n    GROUP: 'pgMsgP',\n    CHATROOM: 'chatMsg',\n    CUSTOMER_SERVICE: 'pcMsgP',\n    RECALL: 'recallMsg',\n    RTC_MSG: 'prMsgS',\n    NOTIFY_PULL_MSG: 's_ntf',\n    RECEIVE_MSG: 's_msg',\n    SYNC_STATUS: 's_stat',\n    SERVER_NOTIFY: 's_cmd',\n    SETTING_NOTIFY: 's_us'\n  };\n  var PUBLISH_STATUS_TOPIC = {\n    PRIVATE: 'ppMsgS',\n    GROUP: 'pgMsgS',\n    CHATROOM: 'chatMsgS'\n  };\n  var QUERY_TOPIC = {\n    GET_SYNC_TIME: 'qrySessionsAtt',\n    PULL_MSG: 'pullMsg',\n    GET_CONVERSATION_LIST: 'qrySessions',\n    REMOVE_CONVERSATION_LIST: 'delSessions',\n    DELETE_MESSAGES: 'delMsg',\n    CLEAR_UNREAD_COUNT: 'updRRTime',\n    PULL_USER_SETTING: 'pullUS',\n    PULL_CHRM_MSG: 'chrmPull',\n    JOIN_CHATROOM: 'joinChrm',\n    JOIN_EXIST_CHATROOM: 'joinChrmR',\n    QUIT_CHATROOM: 'exitChrm',\n    GET_CHATROOM_INFO: 'queryChrmI',\n    UPDATE_CHATROOM_KV: 'setKV',\n    DELETE_CHATROOM_KV: 'delKV',\n    PULL_CHATROOM_KV: 'pullKV',\n    GET_OLD_CONVERSATION_LIST: 'qryRelation',\n    REMOVE_OLD_CONVERSATION: 'delRelation',\n    GET_CONVERSATION_STATUS: 'pullSeAtts',\n    SET_CONVERSATION_STATUS: 'setSeAtt',\n    GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n    GET_UPLOAD_FILE_URL: 'qnUrl',\n    CLEAR_MESSAGES: {\n      PRIVATE: 'cleanPMsg',\n      GROUP: 'cleanGMsg',\n      CUSTOMER_SERVICE: 'cleanCMsg',\n      SYSTEM: 'cleanSMsg'\n    },\n    JOIN_RTC_ROOM: 'rtcRJoin_data',\n    QUIT_RTC_ROOM: 'rtcRExit',\n    PING_RTC: 'rtcPing',\n    SET_RTC_DATA: 'rtcSetData',\n    USER_SET_RTC_DATA: 'userSetData',\n    GET_RTC_DATA: 'rtcQryData',\n    DEL_RTC_DATA: 'rtcDelData',\n    SET_RTC_OUT_DATA: 'rtcSetOutData',\n    GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n    GET_RTC_TOKEN: 'rtcToken',\n    SET_RTC_STATE: 'rtcUserState',\n    GET_RTC_ROOM_INFO: 'rtcRInfo',\n    GET_RTC_USER_INFO_LIST: 'rtcUData',\n    SET_RTC_USER_INFO: 'rtcUPut',\n    DEL_RTC_USER_INFO: 'rtcUDel',\n    GET_RTC_USER_LIST: 'rtcUList'\n  };\n  var QUERY_HISTORY_TOPIC = {\n    PRIVATE: 'qryPMsg',\n    GROUP: 'qryGMsg',\n    CHATROOM: 'qryCHMsg',\n    CUSTOMER_SERVICE: 'qryCMsg',\n    SYSTEM: 'qrySMsg'\n  };\n  var SERVER_NOTIFY_TYPE = {\n    KV_CHANGED: 2,\n    CONVERSATION_STATUS_CHANGED: 3\n  };\n  var CHATROOM_KV_STATUS_CODE = {\n    AUTO_DELETE: 0x0001,\n    OVERWRITE: 0x0002,\n    OPERATE: 0x0004\n  };\n  var PUBLISH_TOPIC_TO_CONVERSATION_TYPE = (_PUBLISH_TOPIC_TO_CON = {}, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CUSTOMER_SERVICE] = CONVERSATION_TYPE.CUSTOMER_SERVICE, _PUBLISH_TOPIC_TO_CON[PUBLISH_STATUS_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_STATUS_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_STATUS_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON);\n  var CONVERSATION_TYPE_TO_PUBLISH_TOPIC = (_CONVERSATION_TYPE_TO = {}, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.PRIVATE] = PUBLISH_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.GROUP] = PUBLISH_TOPIC.GROUP, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CHATROOM] = PUBLISH_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CUSTOMER_SERVICE] = PUBLISH_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.RTC_ROOM] = PUBLISH_TOPIC.RTC_MSG, _CONVERSATION_TYPE_TO);\n  var CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC = (_CONVERSATION_TYPE_TO2 = {}, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.PRIVATE] = PUBLISH_STATUS_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.GROUP] = PUBLISH_STATUS_TOPIC.GROUP, _CONVERSATION_TYPE_TO2);\n  var CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC = (_CONVERSATION_TYPE_TO3 = {}, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.PRIVATE] = QUERY_HISTORY_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.GROUP] = QUERY_HISTORY_TOPIC.GROUP, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CHATROOM] = QUERY_HISTORY_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_HISTORY_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.SYSTEM] = QUERY_HISTORY_TOPIC.SYSTEM, _CONVERSATION_TYPE_TO3);\n  var CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC = (_CONVERSATION_TYPE_TO4 = {}, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.PRIVATE] = QUERY_TOPIC.CLEAR_MESSAGES.PRIVATE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.GROUP] = QUERY_TOPIC.CLEAR_MESSAGES.GROUP, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_TOPIC.CLEAR_MESSAGES.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.SYSTEM] = QUERY_TOPIC.CLEAR_MESSAGES.SYSTEM, _CONVERSATION_TYPE_TO4);\n  var USER_SETTING_STATUS = {\n    ADD: 1,\n    UPDATE: 2,\n    DELETE: 3\n  };\n  var CONVERSATION_STATUS_CONFIG = {\n    ENABLED: '1',\n    DISABLED: '0'\n  };\n  var CONVERSATION_STATUS_TYPE = {\n    DO_NOT_DISTURB: 1,\n    TOP: 2\n  };\n\n  var Header = function () {\n    function Header(_type, _retain, _qos, _dup) {\n      this.type = void 0;\n      this.retain = false;\n      this.qos = QOS.AT_LEAST_ONCE;\n      this.dup = false;\n      this.syncMsg = false;\n      var isPlusType = utils.isPlus(_type);\n\n      if (_type && isPlusType && arguments.length === 1) {\n        this.retain = (_type & 1) > 0;\n        this.qos = (_type & 6) >> 1;\n        this.dup = (_type & 8) > 0;\n        this.type = _type >> 4 & 15;\n        this.syncMsg = (_type & 8) === 8;\n      } else {\n        this.type = _type;\n        this.retain = _retain === undefined ? false : _retain;\n        this.qos = _qos === undefined ? QOS.AT_LEAST_ONCE : _qos;\n        this.dup = _dup === undefined ? false : _dup;\n      }\n    }\n\n    var _proto = Header.prototype;\n\n    _proto.encode = function encode() {\n      var self = this;\n      var validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT];\n      utils.forEach(validQosList, function (qos) {\n        if (self.qos === QOS[qos]) {\n          self.qos = qos;\n        }\n      });\n\n      var _byte = self.type << 4;\n\n      _byte |= self.retain ? 1 : 0;\n      _byte |= self.qos << 1;\n      _byte |= self.dup ? 8 : 0;\n      return _byte;\n    };\n\n    return Header;\n  }();\n\n  var BinaryHelper = {\n    writeUTF: function writeUTF(str, isGetBytes) {\n      var back = [],\n          byteSize = 0;\n      utils.forEach(str, function (_char, i) {\n        var code = str.charCodeAt(i);\n\n        if (code >= 0 && code <= 127) {\n          byteSize += 1;\n          back.push(code);\n        } else if (code >= 128 && code <= 2047) {\n          byteSize += 2;\n          back.push(192 | 31 & code >> 6);\n          back.push(128 | 63 & code);\n        } else if (code >= 2048 && code <= 65535) {\n          byteSize += 3;\n          back.push(224 | 15 & code >> 12);\n          back.push(128 | 63 & code >> 6);\n          back.push(128 | 63 & code);\n        }\n      });\n      utils.forEach(back, function (_char2, i) {\n        if (_char2 > 255) {\n          back[i] &= 255;\n        }\n      });\n\n      if (isGetBytes) {\n        return back;\n      }\n\n      if (byteSize <= 255) {\n        return [0, byteSize].concat(back);\n      } else {\n        return [byteSize >> 8, byteSize & 255].concat(back);\n      }\n    },\n    readUTF: function readUTF(arr) {\n      var MAX_SIZE = 0x4000;\n      var codeUnits = [];\n      var highSurrogate;\n      var lowSurrogate;\n      var index = -1;\n      var strBytes = arr;\n      var result = '';\n\n      while (++index < strBytes.length) {\n        var codePoint = Number(strBytes[index]);\n\n        if (codePoint === (codePoint & 0x7F)) ; else if (0xF0 === (codePoint & 0xF0)) {\n          codePoint ^= 0xF0;\n          codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n          codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n          codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n        } else if (0xE0 === (codePoint & 0xE0)) {\n          codePoint ^= 0xE0;\n          codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n          codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n        } else if (0xC0 === (codePoint & 0xC0)) {\n          codePoint ^= 0xC0;\n          codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n        }\n\n        if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || Math.floor(codePoint) !== codePoint) throw RangeError('Invalid code point: ' + codePoint);\n        if (codePoint <= 0xFFFF) codeUnits.push(codePoint);else {\n          codePoint -= 0x10000;\n          highSurrogate = codePoint >> 10 | 0xD800;\n          lowSurrogate = codePoint % 0x400 | 0xDC00;\n          codeUnits.push(highSurrogate, lowSurrogate);\n        }\n\n        if (index + 1 === strBytes.length || codeUnits.length > MAX_SIZE) {\n          result += String.fromCharCode.apply(null, codeUnits);\n          codeUnits.length = 0;\n        }\n      }\n\n      return result;\n    }\n  };\n\n  var RongStreamReader = function () {\n    function RongStreamReader(arr) {\n      this.pool = void 0;\n      this.position = 0;\n      this.poolLen = 0;\n      this.pool = arr;\n      this.poolLen = arr.length;\n    }\n\n    var _proto2 = RongStreamReader.prototype;\n\n    _proto2.check = function check() {\n      return this.position >= this.pool.length;\n    };\n\n    _proto2.readInt = function readInt() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 4; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t.toString();\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readLong = function readLong() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 8; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t;\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readByte = function readByte() {\n      if (this.check()) {\n        return -1;\n      }\n\n      var val = this.pool[this.position++];\n\n      if (val > 255) {\n        val &= 255;\n      }\n\n      return val;\n    };\n\n    _proto2.readUTF = function readUTF() {\n      if (this.check()) {\n        return '';\n      }\n\n      var big = this.readByte() << 8 | this.readByte();\n      var pool = this.pool.subarray(this.position, this.position += big);\n      return BinaryHelper.readUTF(pool);\n    };\n\n    _proto2.readAll = function readAll() {\n      return this.pool.subarray(this.position, this.poolLen);\n    };\n\n    return RongStreamReader;\n  }();\n\n  var RongStreamWriter = function () {\n    function RongStreamWriter() {\n      this.pool = [];\n      this.position = 0;\n      this.writen = 0;\n    }\n\n    var _proto3 = RongStreamWriter.prototype;\n\n    _proto3.write = function write(_byte2) {\n      if (utils.isArray(_byte2)) {\n        this.pool = this.pool.concat(_byte2);\n      } else if (utils.isPlus(_byte2)) {\n        if (_byte2 > 255) {\n          _byte2 &= 255;\n        }\n\n        this.pool.push(_byte2);\n        this.writen++;\n      }\n\n      return _byte2;\n    };\n\n    _proto3.writeArr = function writeArr(_byte3) {\n      this.pool = this.pool.concat(_byte3);\n      return _byte3;\n    };\n\n    _proto3.writeUTF = function writeUTF(str) {\n      var val = BinaryHelper.writeUTF(str);\n      this.pool = this.pool.concat(val);\n      this.writen += val.length;\n    };\n\n    _proto3.getBytesArray = function getBytesArray() {\n      return this.pool;\n    };\n\n    return RongStreamWriter;\n  }();\n\n  var IDENTIFIER = {\n    PUB: 'pub',\n    QUERY: 'qry'\n  };\n\n  var _getIdentifier = function getIdentifier(messageId, identifier) {\n    if (messageId && identifier) {\n      return identifier + '_' + messageId;\n    } else if (messageId) {\n      return messageId;\n    } else {\n      return utils.getCurrentTimestamp();\n    }\n  };\n\n  var BaseReader = function () {\n    function BaseReader(header) {\n      this._name = void 0;\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.messageId = void 0;\n      this.timestamp = void 0;\n      this.identifier = void 0;\n      this._header = header;\n    }\n\n    var _proto = BaseReader.prototype;\n\n    _proto.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto.read = function read(stream, length) {\n      this.readMessage(stream, length);\n    };\n\n    _proto.readMessage = function readMessage(stream, length) {\n      return {\n        stream: stream,\n        length: length\n      };\n    };\n\n    return BaseReader;\n  }();\n\n  var BaseWriter = function () {\n    function BaseWriter(headerType) {\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.data = void 0;\n      this.messageId = void 0;\n      this.topic = void 0;\n      this.targetId = void 0;\n      this.identifier = void 0;\n      this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n    }\n\n    var _proto2 = BaseWriter.prototype;\n\n    _proto2.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto2.write = function write(stream) {\n      var headerCode = this.getHeaderFlag();\n      stream.write(headerCode);\n      this.writeMessage(stream);\n    };\n\n    _proto2.writeMessage = function writeMessage(stream) {\n      return stream;\n    };\n\n    _proto2.setHeaderQos = function setHeaderQos(qos) {\n      this._header.qos = qos;\n    };\n\n    _proto2.getHeaderFlag = function getHeaderFlag() {\n      return this._header.encode();\n    };\n\n    _proto2.getLengthSize = function getLengthSize() {\n      return this.lengthSize;\n    };\n\n    _proto2.getBufferData = function getBufferData() {\n      var stream = new RongStreamWriter();\n      this.write(stream);\n      var val = stream.getBytesArray();\n      var binary = new Int8Array(val);\n      return binary;\n    };\n\n    _proto2.getCometData = function getCometData() {\n      var data = this.data || {};\n      return utils.toJSON(data);\n    };\n\n    return BaseWriter;\n  }();\n\n  var ConnAckReader = function (_BaseReader) {\n    _inheritsLoose(ConnAckReader, _BaseReader);\n\n    function ConnAckReader() {\n      var _this;\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this = _BaseReader.call.apply(_BaseReader, [this].concat(args)) || this;\n      _this._name = MESSAGE_NAME.CONN_ACK;\n      _this.status = void 0;\n      _this.userId = void 0;\n      _this.timestamp = void 0;\n      return _this;\n    }\n\n    var _proto3 = ConnAckReader.prototype;\n\n    _proto3.readMessage = function readMessage(stream, msgLength) {\n      stream.readByte();\n      this.status = +stream.readByte();\n\n      if (msgLength > ConnAckReader.MESSAGE_LENGTH) {\n        this.userId = stream.readUTF();\n        stream.readUTF();\n        this.timestamp = stream.readLong();\n      }\n    };\n\n    return ConnAckReader;\n  }(BaseReader);\n\n  ConnAckReader.MESSAGE_LENGTH = 2;\n\n  var DisconnectReader = function (_BaseReader2) {\n    _inheritsLoose(DisconnectReader, _BaseReader2);\n\n    function DisconnectReader() {\n      var _this2;\n\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      _this2 = _BaseReader2.call.apply(_BaseReader2, [this].concat(args)) || this;\n      _this2._name = MESSAGE_NAME.DISCONNECT;\n      _this2.status = void 0;\n      return _this2;\n    }\n\n    var _proto4 = DisconnectReader.prototype;\n\n    _proto4.readMessage = function readMessage(stream) {\n      stream.readByte();\n      this.status = +stream.readByte();\n    };\n\n    return DisconnectReader;\n  }(BaseReader);\n\n  DisconnectReader.MESSAGE_LENGTH = 2;\n\n  var PingReqWriter = function (_BaseWriter) {\n    _inheritsLoose(PingReqWriter, _BaseWriter);\n\n    function PingReqWriter() {\n      var _this3;\n\n      _this3 = _BaseWriter.call(this, OPERATE_TYPE.PINGREQ) || this;\n      _this3._name = MESSAGE_NAME.PING_REQ;\n      return _this3;\n    }\n\n    return PingReqWriter;\n  }(BaseWriter);\n\n  var PingRespReader = function (_BaseReader3) {\n    _inheritsLoose(PingRespReader, _BaseReader3);\n\n    function PingRespReader() {\n      var _this4;\n\n      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n        args[_key3] = arguments[_key3];\n      }\n\n      _this4 = _BaseReader3.call.apply(_BaseReader3, [this].concat(args)) || this;\n      _this4._name = MESSAGE_NAME.PING_RESP;\n      return _this4;\n    }\n\n    return PingRespReader;\n  }(BaseReader);\n\n  var RetryableReader = function (_BaseReader4) {\n    _inheritsLoose(RetryableReader, _BaseReader4);\n\n    function RetryableReader() {\n      var _this5;\n\n      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n        args[_key4] = arguments[_key4];\n      }\n\n      _this5 = _BaseReader4.call.apply(_BaseReader4, [this].concat(args)) || this;\n      _this5.messageId = void 0;\n      return _this5;\n    }\n\n    var _proto5 = RetryableReader.prototype;\n\n    _proto5.readMessage = function readMessage(stream) {\n      var msgId = stream.readByte() * 256 + stream.readByte();\n      this.messageId = parseInt(msgId, 10);\n    };\n\n    return RetryableReader;\n  }(BaseReader);\n\n  var RetryableWriter = function (_BaseWriter2) {\n    _inheritsLoose(RetryableWriter, _BaseWriter2);\n\n    function RetryableWriter() {\n      var _this6;\n\n      for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n        args[_key5] = arguments[_key5];\n      }\n\n      _this6 = _BaseWriter2.call.apply(_BaseWriter2, [this].concat(args)) || this;\n      _this6.messageId = void 0;\n      return _this6;\n    }\n\n    var _proto6 = RetryableWriter.prototype;\n\n    _proto6.writeMessage = function writeMessage(stream) {\n      var id = this.messageId;\n      var lsb = id & 255;\n      var msb = (id & 65280) >> 8;\n      stream.write(msb);\n      stream.write(lsb);\n    };\n\n    return RetryableWriter;\n  }(BaseWriter);\n\n  var PublishReader = function (_RetryableReader) {\n    _inheritsLoose(PublishReader, _RetryableReader);\n\n    function PublishReader() {\n      var _this7;\n\n      for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n        args[_key6] = arguments[_key6];\n      }\n\n      _this7 = _RetryableReader.call.apply(_RetryableReader, [this].concat(args)) || this;\n      _this7._name = MESSAGE_NAME.PUBLISH;\n      _this7.topic = void 0;\n      _this7.data = void 0;\n      _this7.targetId = void 0;\n      _this7.date = void 0;\n      _this7.syncMsg = false;\n      _this7.identifier = IDENTIFIER.PUB;\n      return _this7;\n    }\n\n    var _proto7 = PublishReader.prototype;\n\n    _proto7.readMessage = function readMessage(stream) {\n      this.date = stream.readInt();\n      this.topic = stream.readUTF();\n      this.targetId = stream.readUTF();\n      RetryableReader.prototype.readMessage.apply(this, arguments);\n      this.data = stream.readAll();\n    };\n\n    return PublishReader;\n  }(RetryableReader);\n\n  var PublishWriter = function (_RetryableWriter) {\n    _inheritsLoose(PublishWriter, _RetryableWriter);\n\n    function PublishWriter(topic, data, targetId) {\n      var _this8;\n\n      _this8 = _RetryableWriter.call(this, OPERATE_TYPE.PUBLISH) || this;\n      _this8._name = MESSAGE_NAME.PUBLISH;\n      _this8.topic = void 0;\n      _this8.data = void 0;\n      _this8.targetId = void 0;\n      _this8.date = void 0;\n      _this8.syncMsg = false;\n      _this8.identifier = IDENTIFIER.PUB;\n      _this8.topic = topic;\n      _this8.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this8.targetId = targetId;\n      return _this8;\n    }\n\n    var _proto8 = PublishWriter.prototype;\n\n    _proto8.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.apply(this, arguments);\n      stream.write(this.data);\n    };\n\n    return PublishWriter;\n  }(RetryableWriter);\n\n  var PubAckReader = function (_RetryableReader2) {\n    _inheritsLoose(PubAckReader, _RetryableReader2);\n\n    function PubAckReader() {\n      var _this9;\n\n      for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n        args[_key7] = arguments[_key7];\n      }\n\n      _this9 = _RetryableReader2.call.apply(_RetryableReader2, [this].concat(args)) || this;\n      _this9._name = MESSAGE_NAME.PUB_ACK;\n      _this9.status = void 0;\n      _this9.date = 0;\n      _this9.data = void 0;\n      _this9.millisecond = 0;\n      _this9.messageUId = void 0;\n      _this9.timestamp = 0;\n      _this9.identifier = IDENTIFIER.PUB;\n      return _this9;\n    }\n\n    var _proto9 = PubAckReader.prototype;\n\n    _proto9.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.millisecond = stream.readByte() * 256 + stream.readByte();\n      this.timestamp = this.date * 1000 + this.millisecond;\n      this.messageUId = stream.readUTF();\n    };\n\n    return PubAckReader;\n  }(RetryableReader);\n\n  var PubAckWriter = function (_RetryableWriter2) {\n    _inheritsLoose(PubAckWriter, _RetryableWriter2);\n\n    function PubAckWriter(messageId) {\n      var _this10;\n\n      _this10 = _RetryableWriter2.call(this, OPERATE_TYPE.PUBACK) || this;\n      _this10._name = MESSAGE_NAME.PUB_ACK;\n      _this10.status = void 0;\n      _this10.date = 0;\n      _this10.millisecond = 0;\n      _this10.messageUId = void 0;\n      _this10.timestamp = 0;\n      _this10.messageId = messageId;\n      return _this10;\n    }\n\n    var _proto10 = PubAckWriter.prototype;\n\n    _proto10.writeMessage = function writeMessage(stream) {\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n    };\n\n    return PubAckWriter;\n  }(RetryableWriter);\n\n  var QueryWriter = function (_RetryableWriter3) {\n    _inheritsLoose(QueryWriter, _RetryableWriter3);\n\n    function QueryWriter(topic, data, targetId) {\n      var _this11;\n\n      _this11 = _RetryableWriter3.call(this, OPERATE_TYPE.QUERY) || this;\n      _this11._name = MESSAGE_NAME.QUERY;\n      _this11.topic = void 0;\n      _this11.data = void 0;\n      _this11.targetId = void 0;\n      _this11.identifier = IDENTIFIER.QUERY;\n      _this11.topic = topic;\n      _this11.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this11.targetId = targetId;\n      return _this11;\n    }\n\n    var _proto11 = QueryWriter.prototype;\n\n    _proto11.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n      stream.write(this.data);\n    };\n\n    return QueryWriter;\n  }(RetryableWriter);\n\n  var QueryConWriter = function (_RetryableWriter4) {\n    _inheritsLoose(QueryConWriter, _RetryableWriter4);\n\n    function QueryConWriter(messageId) {\n      var _this12;\n\n      _this12 = _RetryableWriter4.call(this, OPERATE_TYPE.QUERYCON) || this;\n      _this12._name = MESSAGE_NAME.QUERY_CON;\n      _this12.messageId = messageId;\n      return _this12;\n    }\n\n    return QueryConWriter;\n  }(RetryableWriter);\n\n  var QueryAckReader = function (_RetryableReader3) {\n    _inheritsLoose(QueryAckReader, _RetryableReader3);\n\n    function QueryAckReader() {\n      var _this13;\n\n      for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n        args[_key8] = arguments[_key8];\n      }\n\n      _this13 = _RetryableReader3.call.apply(_RetryableReader3, [this].concat(args)) || this;\n      _this13._name = MESSAGE_NAME.QUERY_ACK;\n      _this13.data = void 0;\n      _this13.status = void 0;\n      _this13.date = void 0;\n      _this13.identifier = IDENTIFIER.QUERY;\n      return _this13;\n    }\n\n    var _proto12 = QueryAckReader.prototype;\n\n    _proto12.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.data = stream.readAll();\n    };\n\n    return QueryAckReader;\n  }(RetryableReader);\n\n  var getReaderByHeader = function getReaderByHeader(header) {\n    var type = header.type,\n        msg = new BaseReader(header);\n\n    switch (type) {\n      case OPERATE_TYPE.CONNACK:\n        msg = new ConnAckReader(header);\n        break;\n\n      case OPERATE_TYPE.PUBLISH:\n        msg = new PublishReader(header);\n        msg.syncMsg = header.syncMsg;\n        break;\n\n      case OPERATE_TYPE.PUBACK:\n        msg = new PubAckReader(header);\n        break;\n\n      case OPERATE_TYPE.QUERYACK:\n        msg = new QueryAckReader(header);\n        break;\n\n      case OPERATE_TYPE.SUBACK:\n      case OPERATE_TYPE.UNSUBACK:\n      case OPERATE_TYPE.PINGRESP:\n        msg = new PingRespReader(header);\n        break;\n\n      case OPERATE_TYPE.DISCONNECT:\n        msg = new DisconnectReader(header);\n        break;\n\n      default:\n        throw new Error('No support for deserializing ' + type + ' messages');\n    }\n\n    return msg;\n  };\n\n  var readWSBuffer = function readWSBuffer(data) {\n    var arr = new Uint8Array(data);\n    var stream = new RongStreamReader(arr);\n    var flags = stream.readByte(),\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    msg.read(stream, arr.length - 1);\n    return msg;\n  };\n\n  var readCometData = function readCometData(data) {\n    var flags = data.headerCode,\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    utils.forEach(data, function (item, key) {\n      if (key in msg) {\n        msg[key] = item;\n      }\n    });\n    return msg;\n  };\n\n  var ENGINE_EVENT = {\n    WATCH: 'watch',\n    UN_WATCH: 'unwatch',\n    CONNECT: 'connect',\n    RECONNECT: 'reconnect',\n    DISCONNECT: 'disconnect',\n    CHANGE_USER: 'changeUser',\n    GET_CONNECTION_STATUS: 'getConnectionStatus',\n    GET_CONNECTION_USER_ID: 'getConnectionUserId',\n    GET_CONNECTED_TIME: 'getConnectedTime',\n    GET_APP_INFO: 'getAppInfo',\n    GET_CONVERSATION_LIST: 'getConversationList',\n    REMOVE_CONVERSATION_LIST: 'removeConversationList',\n    REMOVE_CONVERSATION: 'removeConversation',\n    GET_TOTAL_UNREAD_COUNT: 'getTotalUnreadCount',\n    CLEAR_UNREAD_COUNT: 'clearUnreadCount',\n    GET_UNREAD_COUNT: 'getUnreadCount',\n    GET_LOCAL_CONVERSATION: 'getLocalConversation',\n    SET_CONVERSATION_STATUS_LIST: 'setConversationStatusList',\n    SEND_MESSAGE: 'sendMessage',\n    GET_HISTORY_MSGS: 'getHistoryMessages',\n    DELETE_MESSAGES: 'deleteHistoryMessages',\n    CLEAR_MESSAGES: 'clearHistoryMessages',\n    RECALL_MESSAGE: 'recallMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    QUIT_CHATROOM: 'quitChatRoom',\n    GET_CHATROOM_INFO: 'getChatRoomInfo',\n    GET_CHATROOM_MSGS: 'getChatRoomHistoryMessages',\n    SET_KV: 'setChatRoomKV',\n    FORCE_SET_KV: 'forceSetChatRoomKV',\n    DEL_KV: 'removeChatRoomKV',\n    FORCE_DEL_KV: 'forceRemoveChatRoomKV',\n    GET_KV: 'getChatRoomKV',\n    GET_ALL_KV: 'getAllChatRoomKV',\n    JOIN_RTC: 'joinRTCRoom',\n    QUIT_RTC: 'quitRTCRoom',\n    PING_RTC: 'RTCPing',\n    GET_RTC_ROOM_INFO: 'getRTCRoomInfo',\n    SET_RTC_DATA: 'setRTCData',\n    SET_RTC_USER_DATA: 'setRTCUserData',\n    GET_RTC_DATA: 'getRTCData',\n    DEL_RTC_DATA: 'removeRTCData',\n    SET_RTC_OUT_DATA: 'setRTCOutData',\n    GET_RTC_OUT_DATA: 'getRTCOutData',\n    GET_RTC_TOKEN: 'getRTCToken',\n    SET_RTC_STATE: 'setRTCState',\n    GET_RTC_USER_INFO_LIST: 'getRTCUserInfoList',\n    SET_RTC_USER_INFO: 'setRTCUserInfo',\n    DEL_RTC_USER_INFO: 'removeRTCUserInfo',\n    GET_RTC_USER_LIST: 'getRTCUserList',\n    GET_UPLOAD_TOKEN: 'getFileToken',\n    GET_UPLOAD_URL: 'getFileUrl'\n  };\n  var ENGINE_EVENT_NEED_CONNECTED = [ENGINE_EVENT.GET_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION, ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT, ENGINE_EVENT.CLEAR_UNREAD_COUNT, ENGINE_EVENT.SEND_MESSAGE, ENGINE_EVENT.GET_HISTORY_MSGS, ENGINE_EVENT.DELETE_MESSAGES, ENGINE_EVENT.CLEAR_MESSAGES, ENGINE_EVENT.RECALL_MESSAGE, ENGINE_EVENT.JOIN_CHATROOM, ENGINE_EVENT.QUIT_CHATROOM, ENGINE_EVENT.GET_CHATROOM_INFO, ENGINE_EVENT.GET_CHATROOM_MSGS];\n  var ENGINE_EVENT_NEED_DISCONNECTED = [ENGINE_EVENT.CONNECT, ENGINE_EVENT.RECONNECT];\n  var IM_EVENT = {\n    STATUS: 'status',\n    MESSAGE: 'message',\n    CONVERSATION: 'conversation',\n    SETTING: 'setting',\n    CHATROOM: 'chatroom'\n  };\n  var TRANSPORT_EVENT = {\n    SIGNAL: 'signal',\n    STATUS: 'status'\n  };\n  var SERVER_EVENT_NAME = {\n    STATUS: 'status',\n    NOTIFY_PULL: 'notifyPull',\n    DIRECT_MSG: 'directMessage',\n    CHRM_KV_CHANGED: 'chatRoomKV',\n    CHRM_KV_SET: 'chatRoomKVSet',\n    MESSAGE_SEND: 'sendMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    BEFORE_JOIN_CHATROOM: 'beforeJoinChatRoom',\n    USER_SETTING_CHANGED: 'userSetting',\n    CONVERSATION_STATUS_CHANGED: 'converStatusChanged',\n    CONVERSATION_STATUS_SETED: 'converStatusSeted'\n  };\n\n  var _APP_ENGINE_EVENT_LOG;\n  var PLATFORM$1 = 'Web';\n  var LEVEL = {\n    FATAL: 0,\n    ERROR: 1,\n    WARN: 2,\n    INFO: 3,\n    DEBUG: 4\n  };\n  var STORE_SIZE = {\n    ADVANCED: 500,\n    LOW: 500\n  };\n  var LOG_TYPE = {\n    'IM': 'IM',\n    'RTC': 'RTC'\n  };\n  var TAG = {\n    L_GET_NAVI_T: 'L-get_navi-T',\n    L_GET_NAVI_R: 'L-get_navi-R',\n    L_PING_WS_T: 'L-ping_ws-T',\n    L_PING_WS_R: 'L-ping_ws-R',\n    L_NETWORK_CHANGED_S: 'L-network_changed-S',\n    L_DECODE_MSG_E: 'L-decode_msg-E',\n    L_RECONNECT_T: 'L-reconnect-T',\n    L_RECONNECT_R: 'L-reconnect-R',\n    L_PULL_CHRM_KV_T: 'L-pull-chrm-kv-T',\n    L_PULL_CHRM_KV_R: 'L-pull-chrm-kv-R',\n    L_PING_S: 'L-ping-S',\n    L_CRASH_E: 'L-crash-E',\n    L_COMET_SEND_SIGNAL_E: 'L-comet_send_signal-E',\n    A_INIT_O: 'A-init-O',\n    A_CONNECT_T: 'A-connect-T',\n    A_CONNECT_R: 'A-connect-R',\n    A_DISCONNECT_T: 'A-disconnect-T',\n    A_DISCONNECT_R: 'A-disconnect-R',\n    A_RECONNECT_T: 'A-reconnect-T',\n    A_RECONNECT_R: 'A-reconnect-R',\n    A_JOIN_CHATROOM_T: 'A-join_chatroom-T',\n    A_JOIN_CHATROOM_R: 'A-join_chatroom-R',\n    A_QUIT_CHATROOM_T: 'A-quit_chatroom-T',\n    A_QUIT_CHATROOM_R: 'A-quit_chatroom-R',\n    P_NOTIFY_CHRM_KV_S: 'P-notify-chrm-kv-R',\n    G_CRASH_E: 'G-crash-E',\n    G_UPLOAD_LOG_S: 'G-upload_log-S',\n    G_UPLOAD_LOG_E: 'G-upload_log-E'\n  };\n  var APP_ENGINE_EVENT_LOG_TAG = (_APP_ENGINE_EVENT_LOG = {}, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.CONNECT] = {\n    req: TAG.A_CONNECT_T,\n    resp: TAG.A_CONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.DISCONNECT] = {\n    req: TAG.A_DISCONNECT_T,\n    resp: TAG.A_DISCONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.RECONNECT] = {\n    req: TAG.A_RECONNECT_T,\n    resp: TAG.A_RECONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.JOIN_CHATROOM] = {\n    req: TAG.A_JOIN_CHATROOM_T,\n    resp: TAG.A_JOIN_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.QUIT_CHATROOM] = {\n    req: TAG.A_QUIT_CHATROOM_T,\n    resp: TAG.A_QUIT_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG);\n  var REPORT_TYPE = {\n    REALTIME: 0,\n    FULL: 1\n  };\n  var CSV_LOG_TPL = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n  var REALTIME_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var MSGNOTIF_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var LOG_CMD_MSG_SENDER = 'rongcloudsystem';\n  var NO_FULL_LOG = 'nodata';\n  var REQUEST_TIMEOUT = 15000;\n  var DEFAULT_SERVER_OPTION = {\n    isOpen: true,\n    url: 'logcollection.ronghub.com',\n    realtimeLevel: LEVEL.ERROR,\n    realtimeInterval: 20000,\n    realtimeMaxTimes: 5,\n    fullInterval: 5000,\n    fullMaxTimes: 3,\n    fullLevel: LEVEL.DEBUG\n  };\n  var IGNORE_ERROR_CODE = [ERROR_CODE.RC_CONNECTION_EXIST];\n\n  var isEmpty$1 = utils.isEmpty,\n      tplEngine$1 = utils.tplEngine;\n\n  var getTransporterUrl = function getTransporterUrl(option) {\n    var domain = option.domain,\n        appkey = option.appkey,\n        token = option.token,\n        connectType = option.connectType,\n        protocol = option.protocol;\n    var isComet = connectType === CONNECT_TYPE.COMET;\n    var cmpTpl = CMP_URL_TPL;\n\n    if (isEmpty$1(protocol)) {\n      protocol = isComet ? env.protocol.http : env.protocol.ws;\n    }\n\n    var tplOption = {\n      domain: domain,\n      appkey: appkey,\n      protocol: protocol,\n      apiVer: env.isFromUniapp ? 'uniapp' : 'normal',\n      token: utils.encodeURI(token)\n    };\n\n    if (env.isMini) {\n      cmpTpl = MINI_CMP_URL_TPL;\n      utils.extend(tplOption, {\n        platform: PLATFORM_TYPE.MINI\n      });\n    }\n\n    return tplEngine$1(cmpTpl, tplOption);\n  };\n\n  var isGroup = function isGroup(type) {\n    return type === CONVERSATION_TYPE.GROUP;\n  };\n\n  var isChatRoom = function isChatRoom(type) {\n    return type === CONVERSATION_TYPE.CHATROOM;\n  };\n\n  var getConversationTypeList = function getConversationTypeList() {\n    return utils.getValues(CONVERSATION_TYPE);\n  };\n\n  var isValidConversationType = function isValidConversationType(type) {\n    var conversationTypeList = getConversationTypeList();\n    return utils.isNumber(type) && utils.isInclude(conversationTypeList, type);\n  };\n\n  var getSessionId = function getSessionId(option) {\n    var isStatusMessage = option.isStatusMessage;\n    var isPersited = option.isPersited,\n        isCounted = option.isCounted,\n        isMentiond = option.isMentiond,\n        disableNotification = option.disableNotification;\n\n    if (isStatusMessage) {\n      isPersited = isCounted = false;\n    }\n\n    var sessionId = 0;\n\n    if (isPersited) {\n      sessionId = sessionId | 0x01;\n    }\n\n    if (isCounted) {\n      sessionId = sessionId | 0x02;\n    }\n\n    if (isMentiond) {\n      sessionId = sessionId | 0x04;\n    }\n\n    if (disableNotification) {\n      sessionId = sessionId | 0x20;\n    }\n\n    return sessionId;\n  };\n\n  var getUpMessageOptionBySessionId = function getUpMessageOptionBySessionId(sessionId) {\n    var isPersited = false,\n        isCounted = false,\n        disableNotification = false;\n    isPersited = !!(sessionId & 0x01);\n    isCounted = !!(sessionId & 0x02);\n    disableNotification = !!(sessionId & 0x10);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      disableNotification: disableNotification\n    };\n  };\n\n  var getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n    var isPersited = true,\n        isCounted = true,\n        isMentiond = false,\n        disableNotification = false,\n        receivedStatus = RECEIVED_STATUS.READ;\n    var isReceivedByOtherClient = false;\n    isPersited = !!(status & 0x10);\n    isCounted = !!(status & 0x20);\n    isMentiond = !!(status & 0x40);\n    disableNotification = !!(status & 0x100);\n    isReceivedByOtherClient = !!(status & 0x02);\n    receivedStatus = isReceivedByOtherClient ? RECEIVED_STATUS.RETRIEVED : receivedStatus;\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond,\n      disableNotification: disableNotification,\n      receivedStatus: receivedStatus\n    };\n  };\n\n  var SignalId = {\n    ids: {},\n    temp: '{appkey}_{userId}',\n    get: function get(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      var id = SignalId.ids[key] || 0;\n      id++;\n      SignalId.ids[key] = id;\n      return id;\n    },\n    clear: function clear(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      SignalId.ids[key] = 0;\n    },\n    isExceedLimit: function isExceedLimit(id) {\n      return id > MAX_SINGAL_ID;\n    }\n  };\n\n  var RCSocket = function () {\n    function RCSocket(options) {\n      this._socket = void 0;\n      this.eventEmitter = new utils.EventEmitter();\n      this.KEY = {\n        OPEN: 'open',\n        MSG: 'msg',\n        ERROR: 'error',\n        CLOSE: 'close'\n      };\n      var self = this;\n      var KEY = self.KEY;\n      self._socket = new utils.Socket(options);\n\n      self._socket.onOpen(function (data) {\n        self.eventEmitter.emit(KEY.OPEN, data);\n      });\n\n      self._socket.onMessage(function (data) {\n        self.eventEmitter.emit(KEY.MSG, data);\n      });\n\n      self._socket.onError(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.ERROR, data);\n      });\n\n      self._socket.onClose(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.CLOSE, data);\n      });\n    }\n\n    var _proto = RCSocket.prototype;\n\n    _proto._formatCloseData = function _formatCloseData(data) {\n      if (env.isMini || env.isAppPlus) {\n        data = data || {};\n        var _data = data,\n            errMsg = _data.errMsg;\n        data.code = MINI_ERROR_MSG_TO_STATUS[errMsg];\n      }\n\n      return data;\n    };\n\n    _proto.send = function send(data) {\n      return this._socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.eventEmitter.clear();\n\n      this._socket.close();\n    };\n\n    _proto.onOpen = function onOpen(event) {\n      this.eventEmitter.on(this.KEY.OPEN, event);\n    };\n\n    _proto.onMessage = function onMessage(event) {\n      this.eventEmitter.on(this.KEY.MSG, event);\n    };\n\n    _proto.onError = function onError(event) {\n      this.eventEmitter.on(this.KEY.ERROR, event);\n    };\n\n    _proto.onClose = function onClose(event) {\n      this.eventEmitter.on(this.KEY.CLOSE, event);\n    };\n\n    return RCSocket;\n  }();\n\n  var RCStorage = function () {\n    function RCStorage(suffix) {\n      var _ref;\n\n      this._cache = void 0;\n      this.STORAGE_KEY = void 0;\n      var storageKey = suffix ? STORAGE_ROOT_KEY + suffix : STORAGE_ROOT_KEY;\n      var localCache = utils.Storage.get(storageKey) || {};\n      this._cache = new utils.Cache((_ref = {}, _ref[storageKey] = localCache, _ref));\n      this.STORAGE_KEY = storageKey;\n    }\n\n    var _proto2 = RCStorage.prototype;\n\n    _proto2._get = function _get() {\n      var KEY = this.STORAGE_KEY;\n      return this._cache.get(KEY) || {};\n    };\n\n    _proto2._set = function _set(cache) {\n      var KEY = this.STORAGE_KEY;\n      cache = cache || {};\n\n      this._cache.set(KEY, cache);\n\n      utils.Storage.set(KEY, cache);\n    };\n\n    _proto2.set = function set(key, value) {\n      var localValue = this._get();\n\n      localValue[key] = value;\n\n      this._set(localValue);\n    };\n\n    _proto2.remove = function remove(key) {\n      var localValue = this._get();\n\n      delete localValue[key];\n\n      this._set(localValue);\n    };\n\n    _proto2.clear = function clear() {\n      var KEY = this.STORAGE_KEY;\n      utils.Storage.remove(KEY);\n\n      this._cache.remove(KEY);\n    };\n\n    _proto2.get = function get(key) {\n      var localValue = this._get();\n\n      return localValue[key];\n    };\n\n    _proto2.getKeys = function getKeys() {\n      var localValue = this._get();\n\n      return utils.getKeys(localValue);\n    };\n\n    _proto2.getValues = function getValues() {\n      return this._get() || {};\n    };\n\n    return RCStorage;\n  }();\n\n  var formatSyncTime = function formatSyncTime(_syncTime) {\n    _syncTime = _syncTime || {};\n    _syncTime.inboxTime = _syncTime.inboxTime || 0;\n    _syncTime.sendboxTime = _syncTime.sendboxTime || 0;\n    return _syncTime;\n  };\n\n  var MessageTimeSyner = function () {\n    function MessageTimeSyner(option) {\n      this._syncTime = void 0;\n      this._storage = void 0;\n      option = option || {};\n      var _option = option,\n          startSyncTime = _option.startSyncTime;\n\n      this._initStorage(option);\n\n      if (startSyncTime) {\n        this._syncTime = formatSyncTime(startSyncTime);\n      }\n    }\n\n    var _proto3 = MessageTimeSyner.prototype;\n\n    _proto3._initStorage = function _initStorage(option) {\n      var appkey = option.appkey,\n          userId = option.userId;\n      var ROOT_KEY = utils.tplEngine(STORAGE_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      var storage = new RCStorage(ROOT_KEY);\n      var syncTime = {\n        sendboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX),\n        inboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.INBOX)\n      };\n      this._storage = storage;\n      this._syncTime = formatSyncTime(syncTime);\n    };\n\n    _proto3.setInbox = function setInbox(time) {\n      var beforeTime = this._syncTime.inboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.inboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.INBOX, time);\n      }\n    };\n\n    _proto3.setSendbox = function setSendbox(time) {\n      var beforeTime = this._syncTime.sendboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.sendboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX, time);\n      }\n    };\n\n    _proto3.setByMessage = function setByMessage(msg) {\n      var messageDirection = msg.messageDirection,\n          sentTime = msg.sentTime;\n      var isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND;\n      isSelfSend ? this.setSendbox(sentTime) : this.setInbox(sentTime);\n    };\n\n    _proto3.get = function get() {\n      return formatSyncTime(this._syncTime);\n    };\n\n    return MessageTimeSyner;\n  }();\n\n  var ChatRoomMessageTimeSyner = function () {\n    function ChatRoomMessageTimeSyner(option) {\n      this._rootKey = void 0;\n      this._pullTimes = {};\n      option = option || {};\n      var _option2 = option,\n          appkey = _option2.appkey,\n          userId = _option2.userId;\n      this._rootKey = utils.tplEngine(SESSION_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n    }\n\n    var _proto4 = ChatRoomMessageTimeSyner.prototype;\n\n    _proto4.set = function set(chrmId, time) {\n      this._pullTimes[chrmId] = time;\n      utils.Session.set(this._rootKey, this._pullTimes);\n    };\n\n    _proto4.get = function get(chrmId) {\n      var pullTimes;\n\n      if (utils.isEmpty(this._pullTimes)) {\n        pullTimes = utils.Session.get(this._rootKey) || {};\n      } else {\n        pullTimes = this._pullTimes;\n      }\n\n      return pullTimes[chrmId] || 0;\n    };\n\n    _proto4.setByMessage = function setByMessage(msg) {\n      var sentTime = msg.sentTime;\n      var chrmId = msg.targetId;\n      var beforeTime = this.get(chrmId);\n\n      if (beforeTime < sentTime) {\n        this.set(chrmId, sentTime);\n      }\n    };\n\n    return ChatRoomMessageTimeSyner;\n  }();\n\n  var JoinedChatRoomSyner = function () {\n    function JoinedChatRoomSyner(option) {\n      this._rootKey = void 0;\n      this._joinedChatRoomInfos = [];\n      option = option || {};\n      var _option3 = option,\n          appkey = _option3.appkey,\n          userId = _option3.userId;\n      this._rootKey = utils.tplEngine(SESSION_SYNC_CHATROOM.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n    }\n\n    var _proto5 = JoinedChatRoomSyner.prototype;\n\n    _proto5.set = function set(option) {\n      var _this = this;\n\n      var chrmId = option.chrmId,\n          count = option.count,\n          isOpenJoinMulitpleChrmService = option.isOpenJoinMulitpleChrmService;\n      var backupJoinedChatRoomInfos = utils.copy(this._joinedChatRoomInfos);\n\n      if (isOpenJoinMulitpleChrmService) {\n        utils.forEach(backupJoinedChatRoomInfos, function (chrmInfo, index) {\n          if (chrmInfo.chrmId === option.chrmId) {\n            _this._joinedChatRoomInfos.splice(index, 1);\n          }\n        });\n\n        this._joinedChatRoomInfos.push({\n          chrmId: chrmId,\n          count: count\n        });\n      } else {\n        this._joinedChatRoomInfos = [{\n          chrmId: chrmId,\n          count: count\n        }];\n      }\n\n      utils.Session.set(this._rootKey, this._joinedChatRoomInfos);\n    };\n\n    _proto5.get = function get() {\n      if (utils.isEmpty(this._joinedChatRoomInfos)) {\n        return utils.Session.get(this._rootKey) || [];\n      } else {\n        return this._joinedChatRoomInfos;\n      }\n    };\n\n    _proto5.remove = function remove(chrmId) {\n      var joinedChatRoom = utils.isEmpty(this._joinedChatRoomInfos) ? this._joinedChatRoomInfos : utils.Session.get(this._rootKey);\n      if (utils.isEmpty(joinedChatRoom)) return;\n      utils.forEach(joinedChatRoom, function (chrmInfo, index) {\n        if (chrmInfo.chrmId === chrmId) {\n          return joinedChatRoom.splice(index, 1);\n        }\n      });\n      utils.Session.set(this._rootKey, joinedChatRoom);\n    };\n\n    _proto5.clear = function clear() {\n      this._joinedChatRoomInfos = [];\n      utils.Session.remove(this._rootKey);\n    };\n\n    return JoinedChatRoomSyner;\n  }();\n\n  var getUIDByToken = function getUIDByToken(token) {\n    return utils.md5(token).slice(8, 16);\n  };\n\n  var isIncludeNavi = function isIncludeNavi(token) {\n    return utils.isInclude(token, NAVI_SEPARATOR_IN_TOKEN);\n  };\n\n  var getNaviListByToken = function getNaviListByToken(token) {\n    var navDomainList = [];\n\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      var navsText = token.substring(separatorIndex + 1, token.length);\n      var domainList = navsText.split(DOMAIN_SEPARATOR_IN_NAVLIST);\n      utils.forEach(domainList, function (domain) {\n        if (!isEmpty$1(domain)) {\n          navDomainList.push(domain);\n        }\n      });\n    }\n\n    return navDomainList;\n  };\n\n  var getCMPDomainList = function getCMPDomainList(option, customOption) {\n    var server = option.server,\n        backupServer = option.backupServer;\n    server = server || '';\n    backupServer = backupServer || '';\n    var backupCMPList = backupServer.split(DOMAIN_SEPARATOR_IN_CMPLIST);\n    var cmpList = [];\n\n    if (!utils.isEmpty(server)) {\n      cmpList.push(server);\n    }\n\n    utils.forEach(backupCMPList, function (cmp) {\n      if (!utils.isEmpty(cmp)) {\n        cmpList.push(cmp);\n      }\n    });\n\n    if (!utils.isUndefined(customOption.customCMP) && !utils.isEmpty(customOption.customCMP)) {\n      cmpList = customOption.customCMP;\n    }\n\n    return cmpList;\n  };\n\n  var getValidToken = function getValidToken(token) {\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      token = token.substring(0, separatorIndex + 1);\n    }\n\n    return token;\n  };\n\n  var getConnectType = function getConnectType(option) {\n    var connectType = option.connectType;\n    var isSpecifiedSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var isSocket = isSpecifiedSocket && utils.isSupportSocket();\n    return isSocket ? CONNECT_TYPE.WEBSOCKET : CONNECT_TYPE.COMET;\n  };\n\n  var isConnected = function isConnected(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTED);\n  };\n\n  var isConnecting = function isConnecting(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTING);\n  };\n\n  var isDisconnected = function isDisconnected(status) {\n    return !isConnected(status) && !isConnecting(status);\n  };\n\n  var getNavReqOption = function getNavReqOption(option, user) {\n    option = utils.copy(option);\n    option.token = user.token;\n    return option;\n  };\n\n  var getPingTimeout = function getPingTimeout(timeSpentConnect) {\n    var timeout = timeSpentConnect * 3;\n\n    if (timeout < IM_PING_MIN_TIMEOUT) {\n      return IM_PING_MIN_TIMEOUT;\n    }\n\n    if (timeout > IM_PING_MAX_TIMEOUT) {\n      return IM_PING_MAX_TIMEOUT;\n    }\n\n    return timeout;\n  };\n\n  var DelayTimer = {\n    _delayTime: 0,\n    setTime: function setTime(time) {\n      var currentTime = utils.getCurrentTimestamp();\n      DelayTimer._delayTime = currentTime - time;\n    },\n    getTime: function getTime() {\n      var delayTime = DelayTimer._delayTime;\n      var currentTime = utils.getCurrentTimestamp();\n      return currentTime - delayTime;\n    }\n  };\n\n  var isInValidConversationData = function isInValidConversationData(conversation) {\n    return !conversation.type || !conversation.targetId || !utils.isObject(conversation.latestMessage) || utils.isUndefined(conversation.unreadMessageCount);\n  };\n\n  var fixConversationData = function fixConversationData(conversation) {\n    conversation = conversation || {};\n    var _conversation = conversation,\n        targetId = _conversation.targetId,\n        type = _conversation.type;\n    var defaultType = CONVERSATION_TYPE.PRIVATE,\n        defaultId = '',\n        defaultMsg = {\n      messageType: MESSAGE_TYPE.TEXT,\n      sentTime: DelayTimer.getTime(),\n      content: {\n        content: ''\n      },\n      senderUserId: targetId,\n      targetId: targetId,\n      type: type\n    };\n    conversation.type = type || defaultType;\n    conversation.targetId = targetId || defaultId;\n    conversation.latestMessage = conversation.latestMessage || defaultMsg;\n    return conversation;\n  };\n\n  var sortConversationList = function sortConversationList(conversationList) {\n    if (utils.isEmpty(conversationList)) {\n      return [];\n    }\n\n    return utils.quickSort(conversationList, function (before, after) {\n      before = before || {};\n      after = after || {};\n      var beforeLatestMessage = before.latestMessage || {},\n          afterLatestMessage = after.latestMessage || {},\n          beforeLatestSentTime = beforeLatestMessage.sentTime || 0,\n          afterLatestSentTime = afterLatestMessage.sentTime || 0;\n      var flag = false;\n\n      if (before.isTop && !after.isTop) {\n        flag = false;\n      } else if (!before.isTop && after.isTop) {\n        flag = true;\n      } else {\n        flag = afterLatestSentTime <= beforeLatestSentTime;\n      }\n\n      return flag;\n    });\n  };\n\n  var splitConversationListByIsTop = function splitConversationListByIsTop(conversationList) {\n    var topConversationList = [],\n        unToppedConversationList = [];\n    utils.forEach(conversationList, function (conversation) {\n      var hasMentiond = conversation.hasMentiond,\n          mentiondInfo = conversation.mentiondInfo;\n      conversation.hasMentioned = hasMentiond;\n      conversation.mentionedInfo = mentiondInfo;\n      var isTop = conversation.isTop || false;\n\n      if (isTop) {\n        topConversationList.push(conversation);\n      } else {\n        unToppedConversationList.push(conversation);\n      }\n    });\n    return {\n      topConversationList: topConversationList || [],\n      unToppedConversationList: unToppedConversationList || []\n    };\n  };\n\n  var sortConList = function sortConList(conversationList) {\n    if (utils.isEmpty(conversationList)) {\n      return [];\n    }\n\n    var splitConversationList = splitConversationListByIsTop(conversationList);\n\n    var _sortListBySentTime = function _sortListBySentTime(convers) {\n      return utils.quickSort(convers, function (before, after) {\n        before = before || {};\n        after = after || {};\n        var beforeLatestMessage = before.latestMessage || {},\n            afterLatestMessage = after.latestMessage || {},\n            beforeLatestSentTime = beforeLatestMessage.sentTime || 0,\n            afterLatestSentTime = afterLatestMessage.sentTime || 0;\n        return afterLatestSentTime <= beforeLatestSentTime;\n      });\n    };\n\n    var topConversationList = _sortListBySentTime(splitConversationList.topConversationList);\n\n    var unToppedConversationList = _sortListBySentTime(splitConversationList.unToppedConversationList);\n\n    topConversationList.push.apply(topConversationList, unToppedConversationList);\n    return topConversationList;\n  };\n\n  var isSupportStatusMessage = function isSupportStatusMessage(type) {\n    return !!CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n  };\n\n  var getConversationKey = function getConversationKey(option) {\n    var type = option.type,\n        targetId = option.targetId;\n    return type + '_' + targetId;\n  };\n\n  var getConversationByKey = function getConversationByKey(key) {\n    key = key || '';\n    var arr = key.split('_');\n\n    if (arr.length === 2) {\n      return {\n        type: arr[0],\n        targetId: arr[1]\n      };\n    } else {\n      return {\n        type: CONVERSATION_TYPE.PRIVATE,\n        targetId: ''\n      };\n    }\n  };\n\n  var getChatRoomKVOptStatus = function getChatRoomKVOptStatus(entity, action) {\n    var status = 0;\n\n    if (entity.isAutoDelete) {\n      status = status | CHATROOM_KV_STATUS_CODE.AUTO_DELETE;\n    }\n\n    if (entity.isOverwrite) {\n      status = status | CHATROOM_KV_STATUS_CODE.OVERWRITE;\n    }\n\n    if (utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE)) {\n      status = status | CHATROOM_KV_STATUS_CODE.OPERATE;\n    }\n\n    return status;\n  };\n\n  var getChatRoomKVByStatus = function getChatRoomKVByStatus(status) {\n    var isDeleteOpt = !!(status & CHATROOM_KV_STATUS_CODE.OPERATE);\n    return {\n      isAutoDelete: !!(status & CHATROOM_KV_STATUS_CODE.AUTO_DELETE),\n      isOverwrite: !!(status & CHATROOM_KV_STATUS_CODE.OVERWRITE),\n      type: isDeleteOpt ? CHATROOM_ENTRY_TYPE.DELETE : CHATROOM_ENTRY_TYPE.UPDATE\n    };\n  };\n\n  var TextCompressor = {\n    _dataType: {\n      Tail: 0x30,\n      Compressed: 0x40,\n      NormalExt: 0x50,\n      Normal: 0x60,\n      Mark: 0x70\n    },\n    _chars: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n    _scale: 62,\n    _max: 238327,\n    _indexOf: function _indexOf(map, source, fromIndex) {\n      var result = {\n        length: 0,\n        offset: -1\n      };\n\n      if (fromIndex >= source.length - 1) {\n        return result;\n      }\n\n      var c1 = source.charAt(fromIndex);\n      var c2 = source.charAt(fromIndex + 1);\n      var items = map[c1 + c2];\n\n      if (items[0] === fromIndex) {\n        return result;\n      }\n\n      var space1 = source.length - fromIndex;\n\n      for (var i = 0, len = items.length; i < len; i++) {\n        var item = items[i];\n        var space2 = fromIndex - item;\n\n        if (space2 > TextCompressor._max) {\n          continue;\n        }\n\n        var end = Math.min(space1, space2);\n\n        if (end <= result.length) {\n          break;\n        }\n\n        if (result.length > 2) {\n          if (source.charAt(item + result.length - 1) !== source.charAt(fromIndex + result.length - 1)) {\n            continue;\n          }\n        }\n\n        var m = 2;\n\n        for (var j = m; j < end; j++) {\n          if (source.charAt(item + j) === source.charAt(fromIndex + j)) {\n            m++;\n          } else {\n            break;\n          }\n        }\n\n        if (m >= result.length) {\n          result.length = m;\n          result.offset = item;\n        }\n      }\n\n      return result;\n    },\n    _numberEncode: function _numberEncode(num) {\n      var result = [],\n          remainder = 0;\n\n      do {\n        remainder = num % TextCompressor._scale;\n        result.push(TextCompressor._chars.charAt(remainder));\n        num = (num - remainder) / TextCompressor._scale;\n      } while (num > 0);\n\n      return result.join('');\n    },\n    _numberDecode: function _numberDecode(str) {\n      var num = 0,\n          index = 0;\n\n      for (var i = str.length - 1; i >= 0; i--) {\n        index = TextCompressor._chars.indexOf(str.charAt(i));\n\n        if (index === -1) {\n          throw new Error('decode number error, data is \\'' + str + '\\'');\n        }\n\n        num = num * TextCompressor._scale + index;\n      }\n\n      return num;\n    },\n    compress: function compress(data) {\n      var map = {};\n\n      for (var p = 0; p < data.length - 1; p++) {\n        var c1 = data.charAt(p);\n        var c2 = data.charAt(p + 1);\n        var c = c1 + c2;\n\n        if (!map.hasOwnProperty(c)) {\n          map[c] = [p];\n          continue;\n        }\n\n        map[c].push(p);\n      }\n\n      var compressedData = [],\n          normalBlockBuffer = [];\n\n      var encodeNormalBlock = function encodeNormalBlock() {\n        if (normalBlockBuffer.length > 0) {\n          var normalBlock = normalBlockBuffer.join('');\n          normalBlockBuffer = [];\n\n          if (normalBlock.length > 26) {\n            var normalExtBlockLength = TextCompressor._numberEncode(normalBlock.length);\n\n            var normalExtBlockHeader = String.fromCharCode(TextCompressor._dataType.NormalExt | normalExtBlockLength.length);\n            compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n          } else {\n            var normalBlockHeader = String.fromCharCode(TextCompressor._dataType.Normal | normalBlock.length);\n            compressedData.push(normalBlockHeader);\n          }\n\n          compressedData.push(normalBlock);\n        }\n      };\n\n      var i = 0;\n\n      while (i < data.length) {\n        var r = TextCompressor._indexOf(map, data, i);\n\n        if (r.length < 2) {\n          normalBlockBuffer.push(data.charAt(i++));\n          continue;\n        }\n\n        if (r.length < 4) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        var offset = TextCompressor._numberEncode(i - r.offset);\n\n        var length = TextCompressor._numberEncode(r.length);\n\n        if (offset.length + length.length >= r.length) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        encodeNormalBlock();\n        var compressedBlockHeader = String.fromCharCode(TextCompressor._dataType.Compressed | offset.length << 2 | length.length);\n        compressedData.push(compressedBlockHeader + offset + length);\n        i += r.length;\n      }\n\n      encodeNormalBlock();\n\n      var dataLengthTo62 = TextCompressor._numberEncode(data.length);\n\n      var tailBlockHeader = String.fromCharCode(TextCompressor._dataType.Tail | dataLengthTo62.length);\n      compressedData.push(tailBlockHeader + dataLengthTo62);\n      return compressedData.join('');\n    },\n    uncompress: function uncompress(data) {\n      var i = 0;\n      var result = '';\n\n      label1: do {\n        var header = data.charCodeAt(i++);\n        var headerType = header & TextCompressor._dataType.Mark;\n        var headerVal = header & 0xF;\n\n        switch (headerType) {\n          case TextCompressor._dataType.Compressed:\n            var p1 = headerVal >> 2;\n            var p2 = headerVal & 3;\n\n            if (p1 === 0 || p2 === 0) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            var offset = TextCompressor._numberDecode(data.substr(i, p1));\n\n            var len = TextCompressor._numberDecode(data.substr(i += p1, p2));\n\n            offset = result.length - offset;\n\n            if (offset + len > result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += p2;\n            result += result.substr(offset, len);\n            break;\n\n          case TextCompressor._dataType.Tail:\n            var num = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            if (num !== result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += headerVal;\n            break label1;\n\n          case TextCompressor._dataType.NormalExt:\n            var normalNum = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            result += data.substr(i += headerVal, normalNum);\n            i += normalNum;\n            break;\n\n          case TextCompressor._dataType.Normal:\n            result += data.substr(i, headerVal);\n            i += headerVal;\n            break;\n\n          case TextCompressor._dataType.Mark:\n            if (headerVal > 10) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            result += data.substr(i, 16 + headerVal);\n            i += 16 + headerVal;\n            break;\n\n          default:\n            throw new Error('Data parsing error,at ' + i + ' header:' + headerType);\n        }\n      } while (i < data.length);\n\n      return result;\n    }\n  };\n\n  var isBelowIE = function isBelowIE(version) {\n    var system = env.system;\n    var flag = system.model === 'IE' && Number(system.version) < version ? true : false;\n    return flag;\n  };\n\n  var stringToCsv = function stringToCsv(str) {\n    var csvStr = str.replace(/\"/g, '\"\"');\n    var tpl = '\"{csvStr}\"';\n    return tplEngine$1(tpl, {\n      csvStr: csvStr\n    });\n  };\n\n  var getWebSessionId = function getWebSessionId() {\n    var sessionId = utils.Session.get(STORAGE_SESSION_ID_KEY);\n\n    if (utils.isEmpty(sessionId)) {\n      sessionId = utils.getUUID22().slice(0, 10);\n      utils.Session.set(STORAGE_SESSION_ID_KEY, sessionId);\n    }\n\n    return sessionId;\n  };\n\n  var getDeviceId = function getDeviceId() {\n    var deviceId = utils.Storage.get(STORAGE_DEVICE_ID_KEY);\n\n    if (utils.isEmpty(deviceId)) {\n      deviceId = utils.getUUID22();\n      utils.Storage.set(STORAGE_DEVICE_ID_KEY, deviceId);\n    }\n\n    return deviceId;\n  };\n\n  var getDeviceInfo = function getDeviceInfo() {\n    var tpl = '{brower}|{version}|{sessionId}';\n    return tplEngine$1(tpl, {\n      brower: env.system.model,\n      version: env.system.version,\n      sessionId: getWebSessionId()\n    });\n  };\n\n  var getReportLogUrl = function getReportLogUrl(params) {\n    var entireUrl = '',\n        protocol = env.protocol.http + '//';\n    var urlConf = {\n      protocol: protocol,\n      url: params.url,\n      version: SDK_VERSION,\n      appkey: params.appkey,\n      deviceId: getDeviceId(),\n      deviceInfo: getDeviceInfo(),\n      platform: PLATFORM$1,\n      userId: params.userId\n    };\n\n    switch (params.type) {\n      case REPORT_TYPE.REALTIME:\n        entireUrl = tplEngine$1(REALTIME_URL_TPL, urlConf);\n        break;\n\n      case REPORT_TYPE.FULL:\n        entireUrl = tplEngine$1(MSGNOTIF_URL_TPL, utils.extend(urlConf, {\n          logId: params.logId\n        }));\n        break;\n\n      default:\n        break;\n    }\n\n    return entireUrl;\n  };\n\n  var isLogCommandMsg = function isLogCommandMsg(msg) {\n    var content = msg.content;\n    return msg.messageType === MESSAGE_TYPE.LOG_COMMAND && msg.senderUserId === LOG_CMD_MSG_SENDER && content.platform === 'Web';\n  };\n\n  var isValidChatRoomKey = function isValidChatRoomKey(key) {\n    if (!utils.isString(key)) {\n      return;\n    }\n\n    var isValid = /^[A-Za-z0-9_=+-]+$/.test(key),\n        keyLen = key.length,\n        isLimit = keyLen <= CHATROOM_KEY_LENGTH.MAX && keyLen >= CHATROOM_KEY_LENGTH.MIN;\n    return isValid && isLimit;\n  };\n\n  var isValidChatRoomValue = function isValidChatRoomValue(value) {\n    if (!utils.isString(value)) {\n      return;\n    }\n\n    var valLen = value.length;\n    return valLen <= CHATROOM_VALUE_LENGTH.MAX && valLen >= CHATROOM_VALUE_LENGTH.MIN;\n  };\n\n  var genUploadFileName = function genUploadFileName(type, fileName) {\n    var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n    var random = Math.floor(Math.random() * 1000 % 10000);\n    var uuid = utils.getUUID();\n    var fileNameArr, extension;\n\n    if (fileName) {\n      fileNameArr = fileName.split('.');\n      extension = '.' + fileNameArr[fileNameArr.length - 1];\n    }\n\n    return tplEngine$1(tpl, {\n      type: type,\n      date: utils.formateDate('-'),\n      random: random,\n      uuid: uuid,\n      timestamp: DelayTimer.getTime(),\n      extension: extension || ''\n    });\n  };\n\n  var getUploadFileDomains = function getUploadFileDomains(navi) {\n    var uploadServer = navi.uploadServer,\n        bosAddr = navi.bosAddr;\n    return {\n      qiniu: uploadServer,\n      bos: bosAddr\n    };\n  };\n\n  var mergeConversationList = function mergeConversationList(option) {\n    option = option || {};\n    var _option4 = option,\n        conversationList = _option4.conversationList,\n        updatedConversationList = _option4.updatedConversationList;\n    var allConversationList = updatedConversationList.concat(conversationList);\n    var hashTable = {};\n    var newList = [];\n    var invalidDataIndexList = [];\n    utils.forEach(allConversationList, function (conversation) {\n      if (!utils.isObject(conversation)) {\n        return;\n      }\n\n      var key = getConversationKey(conversation),\n          hashItem = hashTable[key] || {},\n          hashIndex = utils.isUndefined(hashItem.index) ? newList.length : hashItem.index,\n          hashVal = hashItem.val || {},\n          cacheUpdatedItems = hashVal.updatedItems || {},\n          updatedItems = conversation.updatedItems || {};\n      conversation = utils.extend(conversation, hashVal);\n      utils.forEach(cacheUpdatedItems, function (item, key) {\n        conversation[key] = item.val;\n      });\n      utils.forEach(updatedItems, function (item, key) {\n        var cacheItem = cacheUpdatedItems[key] || {},\n            cacheItemUpdatedTime = cacheItem.time || 0;\n\n        if (item.time > cacheItemUpdatedTime) {\n          conversation[key] = item.val;\n        }\n      });\n      hashTable[key] = {\n        index: hashIndex,\n        val: conversation\n      };\n      newList[hashIndex] = conversation;\n      isInValidConversationData(conversation) && invalidDataIndexList.push(hashIndex);\n    });\n    utils.forEach(invalidDataIndexList, function (invalidIndex) {\n      var conversation = newList[invalidIndex];\n      newList[invalidIndex] = fixConversationData(conversation);\n    });\n    newList = sortConList(newList);\n    return utils.map(newList, function (item) {\n      delete item.updatedItems;\n      return item;\n    });\n  };\n\n  var common = {\n    isConnected: isConnected,\n    isConnecting: isConnecting,\n    isDisconnected: isDisconnected,\n    getConnectType: getConnectType,\n    getTransporterUrl: getTransporterUrl,\n    isGroup: isGroup,\n    isChatRoom: isChatRoom,\n    getConversationTypeList: getConversationTypeList,\n    isValidConversationType: isValidConversationType,\n    getUIDByToken: getUIDByToken,\n    getSessionId: getSessionId,\n    getMessageOptionByStatus: getMessageOptionByStatus,\n    SignalId: SignalId,\n    MessageTimeSyner: MessageTimeSyner,\n    ChatRoomMessageTimeSyner: ChatRoomMessageTimeSyner,\n    JoinedChatRoomSyner: JoinedChatRoomSyner,\n    getCMPDomainList: getCMPDomainList,\n    getNaviListByToken: getNaviListByToken,\n    getValidToken: getValidToken,\n    RCSocket: RCSocket,\n    RCStorage: RCStorage,\n    getNavReqOption: getNavReqOption,\n    getPingTimeout: getPingTimeout,\n    fixConversationData: fixConversationData,\n    sortConversationList: sortConversationList,\n    DelayTimer: DelayTimer,\n    isSupportStatusMessage: isSupportStatusMessage,\n    getConversationKey: getConversationKey,\n    getConversationByKey: getConversationByKey,\n    getChatRoomKVOptStatus: getChatRoomKVOptStatus,\n    getChatRoomKVByStatus: getChatRoomKVByStatus,\n    TextCompressor: TextCompressor,\n    isBelowIE: isBelowIE,\n    getReportLogUrl: getReportLogUrl,\n    isLogCommandMsg: isLogCommandMsg,\n    getWebSessionId: getWebSessionId,\n    getDeviceId: getDeviceId,\n    stringToCsv: stringToCsv,\n    isValidChatRoomKey: isValidChatRoomKey,\n    isValidChatRoomValue: isValidChatRoomValue,\n    genUploadFileName: genUploadFileName,\n    getUploadFileDomains: getUploadFileDomains,\n    mergeConversationList: mergeConversationList,\n    sortConList: sortConList,\n    getUpMessageOptionBySessionId: getUpMessageOptionBySessionId\n  };\n\n  var EventEmitter$1 = utils.EventEmitter,\n      DeferHandler$1 = utils.DeferHandler,\n      Timer$1 = utils.Timer;\n  var RCSocket$1 = common.RCSocket;\n  var TransHandlerID = {\n    CONNECT: 'connect',\n    PING: 'ping'\n  };\n\n  var Heartbeat = function () {\n    function Heartbeat(transporter, option) {\n      this._transporter = void 0;\n      this._timer = void 0;\n      option = option || {};\n      var timeout = option.timeout;\n      this._transporter = transporter;\n      this._timer = new Timer$1({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: timeout\n      });\n    }\n\n    var _proto = Heartbeat.prototype;\n\n    _proto.check = function check(timeout) {\n      var _transporter = this._transporter;\n      var _deferHandler = _transporter._deferHandler;\n      var pingReqSignal = new PingReqWriter();\n\n      _transporter.sendSignal(pingReqSignal);\n\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.PING, {\n          resolve: resolve,\n          reject: reject\n        }, {\n          timeout: timeout\n        });\n      });\n    };\n\n    _proto.start = function start(timeout, onError) {\n      var self = this;\n\n      self._timer.start(function () {\n        self.check(timeout).then(utils.noop)[\"catch\"](onError);\n      });\n    };\n\n    _proto.stop = function stop() {\n      this._timer && this._timer.stop();\n    };\n\n    return Heartbeat;\n  }();\n\n  var SocketTransporter = function () {\n    function SocketTransporter(option) {\n      this._socket = void 0;\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$1();\n      this._deferHandler = new DeferHandler$1();\n      this._heartbeat = new Heartbeat(this, {\n        timeout: IM_PING_INTERVAL_TIME\n      });\n      this._connectedTime = void 0;\n      this._timer = void 0;\n      this._option = option;\n      this._timer = new Timer$1({\n        type: TIMER_TYPE.TIMEOUT,\n        timeout: CMP_CONNECT_TIMEOUT_TIME\n      });\n    }\n\n    var _proto2 = SocketTransporter.prototype;\n\n    _proto2._createSocket = function _createSocket(url) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var socket = new RCSocket$1({\n        url: url\n      });\n\n      var onClose = function onClose(event) {\n        event = event || {};\n        var code = event.code || TRANSPORTER_STATUS.CLOSE_ABNORMAL;\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, code);\n\n        self.disconnect();\n      };\n\n      socket.onMessage(function (msg) {\n        var data = msg.data;\n\n        if (!utils.isArrayBuffer(data)) {\n          throw new Error('Error socket signal');\n        }\n\n        var signal = readWSBuffer(data);\n        self.handleSignal(signal);\n      });\n      socket.onError(onClose);\n      socket.onClose(onClose);\n      return socket;\n    };\n\n    _proto2._startHeartbeat = function _startHeartbeat(timeSpentConnect) {\n      var self = this;\n      var _heartbeat = self._heartbeat,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n\n      _heartbeat.check(FIRST_PING_TIMEOUT).then(utils.noop)[\"catch\"](function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT);\n\n        self.disconnect();\n      });\n\n      var pingTimeout = common.getPingTimeout(timeSpentConnect);\n\n      _heartbeat.start(pingTimeout, function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n        self.disconnect();\n      });\n    };\n\n    _proto2._stopHeartbeat = function _stopHeartbeat() {\n      this._heartbeat.stop();\n    };\n\n    _proto2.watchSignal = function watchSignal(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, watcher);\n    };\n\n    _proto2.watchStatus = function watchStatus(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, watcher);\n    };\n\n    _proto2.connect = function connect(user, option) {\n      var self = this;\n      var _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType,\n          _deferHandler = self._deferHandler;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        connectType: connectType,\n        token: token\n      });\n      var timeBeforeConnect = utils.getCurrentTimestamp();\n      self._socket = this._createSocket(url);\n\n      self._timer.start(function () {\n        self.disconnect();\n\n        _deferHandler.reject(TransHandlerID.CONNECT, {\n          status: TRANSPORTER_STATUS.CMP_CONNECTION_TIMEOUT\n        });\n      });\n\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.CONNECT, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (result) {\n        var timeAfterConnect = utils.getCurrentTimestamp();\n        var timeSpentConnect = timeAfterConnect - timeBeforeConnect;\n\n        self._startHeartbeat(timeSpentConnect);\n\n        self._timer.stop();\n\n        return result;\n      });\n    };\n\n    _proto2.sendSignal = function sendSignal(writer) {\n      var binary = writer.getBufferData();\n\n      this._socket.send(binary.buffer);\n    };\n\n    _proto2.handleSignal = function handleSignal(signal) {\n      var _transporterEventEmiiter = this._transporterEventEmiiter,\n          _deferHandler = this._deferHandler;\n\n      if (signal instanceof ConnAckReader) {\n        this.handleConnAck(signal);\n      } else if (signal instanceof PingRespReader) {\n        _deferHandler.resolve(TransHandlerID.PING);\n      } else {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n      }\n\n      if (signal && utils.isValidTimestamp(signal.timestamp)) {\n        common.DelayTimer.setTime(signal.timestamp);\n      }\n    };\n\n    _proto2.handleConnAck = function handleConnAck(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var status = signal.status;\n      var isConnected = status === SUCCESS_CODE;\n      var event = isConnected ? _deferHandler.resolve : _deferHandler.reject;\n      event.call(_deferHandler, TransHandlerID.CONNECT, signal);\n\n      if (isConnected) {\n        self._connectedTime = utils.getCurrentTimestamp();\n      }\n    };\n\n    _proto2.disconnect = function disconnect() {\n      this._stopHeartbeat();\n\n      this._socket && this._socket.close();\n    };\n\n    return SocketTransporter;\n  }();\n\n  var logEventEmitter = new utils.EventEmitter();\n  var LogEventName = 'log';\n  var LocalLogPrefix = '[Rong]';\n  var ServerOption = DEFAULT_SERVER_OPTION;\n  var Option = {\n    isDebug: false,\n    isUploadToServer: true,\n    appkey: '',\n    userId: '',\n    isNetworkUnavailable: true\n  };\n  var realTimeUploadHasStarted = false,\n      RealtimeUploadTimes = 1,\n      isRealtimeUploading = false,\n      fullLogId = '';\n\n  var isFirstDefaultUpload = function isFirstDefaultUpload(interval) {\n    return interval === 20000;\n  };\n\n  var getRealtimeUploadInterval = function getRealtimeUploadInterval(uploadTimes) {\n    var realtimeInterval = ServerOption.realtimeInterval;\n    return realtimeInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getFullUploadInterval = function getFullUploadInterval(uploadTimes) {\n    var fullInterval = ServerOption.fullInterval;\n    return fullInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getCSVForLog = function getCSVForLog(log) {\n    log = log || {};\n    var content = log.content || {};\n    utils.forEach(content, function (val, key) {\n      if (utils.isObject(val) || utils.isArray(val)) {\n        content[key] = utils.toJSON(val);\n      }\n    });\n    content = utils.toJSON(content) || '\"\"';\n    content = common.stringToCsv(content);\n    return utils.tplEngine(CSV_LOG_TPL, {\n      sessionId: common.getWebSessionId(),\n      time: log.time,\n      type: log.type,\n      level: log.level,\n      tag: log.tag,\n      content: content\n    });\n  };\n\n  var setServerOption = function setServerOption(serverData) {\n    var logSwitch = serverData.logSwitch,\n        logPolicy = serverData.logPolicy;\n    var isOpen = !!logSwitch;\n    if (utils.isEmpty(serverData)) return;\n    ServerOption.isOpen = isOpen;\n\n    if (!isOpen) {\n      return;\n    }\n\n    var logConf = utils.parseJSON(logPolicy || '') || {};\n    var url = logConf.url,\n        level = logConf.level,\n        itv = logConf.itv,\n        times = logConf.times;\n    utils.extend(ServerOption, {\n      url: url,\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(itv) * 1000,\n      realtimeMaxTimes: Number(times)\n    });\n  };\n\n  var setServerResponseOption = function setServerResponseOption(resText) {\n    var resConf = utils.parseJSON(resText || '');\n    var nextTime = resConf.nextTime,\n        level = resConf.level,\n        logSwitch = resConf.logSwitch;\n    if (utils.isEmpty(resConf)) return;\n    var isOpen = !!logSwitch;\n    ServerOption.isOpen = isOpen;\n    if (!isOpen) return;\n    utils.extend(ServerOption, {\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(nextTime) * 1000\n    });\n  };\n\n  var getLogLevel = function getLogLevel(log) {\n    log = log || {};\n    var _Option = Option,\n        isNetworkUnavailable = _Option.isNetworkUnavailable,\n        _log = log,\n        level = _log.level,\n        isLevelToDegrad = utils.isEqual(level, LEVEL.ERROR) || utils.isEqual(level, LEVEL.WARN);\n\n    if (isNetworkUnavailable && isLevelToDegrad) {\n      log.level = LEVEL.INFO;\n    }\n\n    return log;\n  };\n\n  var LogStore = {\n    _list: [],\n    MaxSize: common.isBelowIE(9) ? STORE_SIZE.LOW : STORE_SIZE.ADVANCED,\n    add: function add(log) {\n      log = getLogLevel(log);\n\n      LogStore._list.push(log);\n\n      var currentSize = LogStore._list.length,\n          maxSize = LogStore.MaxSize;\n\n      if (currentSize > maxSize) {\n        LogStore._list.splice(0, currentSize - maxSize);\n      }\n    },\n    get: function get(option) {\n      var type = option.type,\n          uploadLevel = option.level;\n      var _list = LogStore._list;\n      var uploadList = [];\n      utils.forEach(_list, function (log, index) {\n        var logTime = log.time || 0,\n            logLevel = log.level || LEVEL.DEBUG,\n            isUploadLevel = logLevel <= uploadLevel,\n            fullUploadOption = option.fullUploadOption || {},\n            startTime = fullUploadOption.startTime || 0,\n            endTime = fullUploadOption.endTime || common.DelayTimer.getTime();\n        var isUpload = isUploadLevel;\n\n        switch (type) {\n          case REPORT_TYPE.REALTIME:\n            isUpload = isUpload && !log.isUploaded;\n            isUpload && (LogStore._list[index].isUploaded = true);\n            break;\n\n          case REPORT_TYPE.FULL:\n            isUpload = isUpload && logTime >= startTime && logTime <= endTime;\n            break;\n\n          default:\n        }\n\n        if (isUpload) {\n          uploadList.push(log);\n        }\n      });\n      return uploadList;\n    },\n    clear: function clear() {\n      LogStore._list = [];\n    }\n  };\n\n  var upload = function upload(option) {\n    var url = option.url,\n        logList = option.logList,\n        type = option.type;\n    var requestUrl = common.getReportLogUrl({\n      type: type,\n      appkey: Option.appkey || '',\n      userId: Option.userId || '',\n      url: url || ServerOption.url || DEFAULT_SERVER_OPTION.url,\n      logId: option.logId\n    });\n    var csvLog = '';\n    utils.forEach(logList, function (log) {\n      csvLog += getCSVForLog(log);\n    });\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.REALTIME) {\n      return utils.Defer.reject();\n    }\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.FULL) {\n      csvLog = NO_FULL_LOG;\n    }\n\n    csvLog = common.TextCompressor.compress(csvLog);\n    return utils.request(requestUrl, {\n      method: REQUEST_METHOD.POST,\n      body: csvLog,\n      timeout: REQUEST_TIMEOUT\n    });\n  };\n\n  var uploadRealtime = function uploadRealtime() {\n    if (isRealtimeUploading) {\n      return;\n    }\n\n    var interval = getRealtimeUploadInterval(RealtimeUploadTimes);\n    var realtimeMaxTimes = ServerOption.realtimeMaxTimes,\n        realtimeLevel = ServerOption.realtimeLevel;\n\n    if (RealtimeUploadTimes < realtimeMaxTimes) {\n      RealtimeUploadTimes++;\n    }\n\n    if (isFirstDefaultUpload(interval)) {\n      RealtimeUploadTimes = 1;\n    }\n\n    utils.setTimeout(function () {\n      var logList = LogStore.get({\n        type: REPORT_TYPE.REALTIME,\n        level: realtimeLevel\n      });\n      isRealtimeUploading = true;\n      upload({\n        logList: logList,\n        type: REPORT_TYPE.REALTIME\n      }).then(function (response) {\n        isRealtimeUploading = false;\n        var responseText = response.responseText || '{}';\n        var conf = response.responseText || {};\n        setServerResponseOption(responseText);\n\n        if (ServerOption.isOpen) {\n          RealtimeUploadTimes = utils.isEmpty(conf) ? RealtimeUploadTimes : 1;\n          uploadRealtime();\n        }\n      })[\"catch\"](function () {\n        isRealtimeUploading = false;\n        uploadRealtime();\n      });\n    }, interval);\n  };\n\n  var uploadFull = function uploadFull(uploadTimes, option, connectedTime) {\n    if (!Option.isUploadToServer || env.isMini) {\n      return;\n    }\n\n    uploadTimes = uploadTimes || 0;\n    option = option || {};\n    var _option = option,\n        uri = _option.uri,\n        logId = _option.logId;\n    var isFirst = uploadTimes === 0;\n    var interval = isFirst ? 0 : getFullUploadInterval(uploadTimes);\n    var fullMaxTimes = ServerOption.fullMaxTimes,\n        fullLevel = ServerOption.fullLevel;\n    if (fullLogId === logId) return;\n\n    if (uploadTimes <= fullMaxTimes) {\n      uploadTimes++;\n    } else {\n      return;\n    }\n\n    fullLogId = logId;\n\n    (function (option) {\n      utils.setTimeout(function () {\n        var logList = LogStore.get({\n          type: REPORT_TYPE.FULL,\n          level: fullLevel,\n          fullUploadOption: option\n        });\n        if (logList.length === 0 && Number(option.endTime) < connectedTime) return;\n        upload({\n          logId: logId,\n          url: uri,\n          logList: logList,\n          type: REPORT_TYPE.FULL\n        }).then(function () {})[\"catch\"](function () {\n          uploadFull(uploadTimes, option, connectedTime);\n        });\n      }, interval);\n    })(option);\n  };\n\n  var writeLocalLog = function writeLocalLog(log) {\n    var time = log.time;\n    var formatedTime = utils.formatTime(time);\n    var localLog = LocalLogPrefix + \":\" + formatedTime + \": \" + utils.toJSON(log);\n    logEventEmitter.emit(LogEventName, localLog);\n\n    if (Option.isDebug) {\n      utils.consoleLog(localLog);\n    }\n  };\n\n  var isIgnoreErrorCode = function isIgnoreErrorCode(code) {\n    return utils.indexOf(IGNORE_ERROR_CODE, code) > -1;\n  };\n\n  var Logger = {\n    _events: [],\n    LogStore: LogStore,\n    setOption: function setOption(option) {\n      Option = utils.extend(Option, option);\n    },\n    setServerOption: setServerOption,\n    watchLog: function watchLog(event) {\n      logEventEmitter.on(LogEventName, event);\n\n      Logger._events.push(event);\n    },\n    write: function write(log) {\n      log = log || {};\n      log.tag = log.tag || TAG.L_CRASH_E;\n      log.time = log.time || common.DelayTimer.getTime();\n      log.type = log.type || LOG_TYPE.IM;\n      LogStore.add(log);\n      writeLocalLog(log);\n    },\n    fatal: function fatal(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.FATAL\n      });\n    },\n    error: function error(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.ERROR\n      });\n    },\n    warn: function warn(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.WARN\n      });\n    },\n    info: function info(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.INFO\n      });\n    },\n    debug: function debug(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.DEBUG\n      });\n    },\n    startRealtimeUpload: function startRealtimeUpload() {\n      if (realTimeUploadHasStarted) return;\n\n      if (Option.isUploadToServer && !env.isMini) {\n        uploadRealtime();\n      }\n\n      realTimeUploadHasStarted = true;\n    },\n    resetRealtimeUpload: function resetRealtimeUpload() {\n      RealtimeUploadTimes = 1;\n    },\n    uploadFull: uploadFull,\n    isIgnoreErrorCode: isIgnoreErrorCode\n  };\n\n  var EventEmitter$2 = utils.EventEmitter,\n      DeferHandler$2 = utils.DeferHandler,\n      httpRequest = utils.httpRequest,\n      request$3 = utils.request,\n      Defer$1 = utils.Defer;\n\n  var CometTransporter = function () {\n    function CometTransporter(option) {\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$2();\n      this._deferHandler = new DeferHandler$2();\n      this._pid = utils.encodeURI(utils.getCurrentTimestamp() + Math.random() + '');\n      this._domain = void 0;\n      this._sessionid = void 0;\n      this._xhrCache = new utils.Cache();\n      this._pullSignalTimer = new utils.Timer({\n        timeout: IM_COMET_PULLMSG_TIMEOUT\n      });\n      this._isDisconnected = true;\n      this._option = option;\n    }\n\n    var _proto = CometTransporter.prototype;\n\n    _proto._startPullSignal = function _startPullSignal() {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid,\n          _transporterEventEmiiter = self._transporterEventEmiiter,\n          _pullSignalTimer = self._pullSignalTimer;\n      var timestamp = utils.getCurrentTimestamp();\n      var protocol = env.protocol.http;\n      var url = utils.tplEngine(COMET_PULL_URL_TPL, {\n        protocol: protocol,\n        timestamp: timestamp,\n        domain: _domain,\n        sessionId: _sessionid,\n        pid: _pid\n      });\n      var xhr = httpRequest({\n        url: url,\n        body: {\n          pid: _pid\n        },\n        timeout: IM_COMET_PULLMSG_TIMEOUT,\n        success: function success(responseText) {\n          _pullSignalTimer.stop();\n\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (isSuccess) {\n            !self._isDisconnected && self._startPullSignal();\n          } else if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        },\n        fail: function fail() {\n          _pullSignalTimer.stop();\n\n          if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        }\n      });\n\n      _pullSignalTimer.start(function () {\n        if (!self._isDisconnected) {\n          _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n          self.disconnect();\n        }\n      });\n\n      self._xhrCache.set(url, xhr);\n    };\n\n    _proto.watchSignal = function watchSignal(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, event);\n    };\n\n    _proto.watchStatus = function watchStatus(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, function (status) {\n        event && event(status);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _pid = self._pid,\n          _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        token: token,\n        connectType: connectType\n      });\n      self._domain = domain;\n      self._isDisconnected = false;\n\n      var success = function success(_ref) {\n        var responseText = _ref.responseText;\n\n        if (!utils.isValidJSON(responseText)) {\n          return Defer$1.reject();\n        }\n\n        var response = utils.isObject(responseText) ? responseText : utils.parseJSON(responseText);\n        var isConnectSuccess = utils.isEqual(response.status, SUCCESS_CODE);\n\n        if (isConnectSuccess && utils.isObject(response) && utils.isValidTimestamp(response.timestamp)) {\n          common.DelayTimer.setTime(response.timestamp);\n        }\n\n        return isConnectSuccess ? Defer$1.resolve(response) : Defer$1.reject(response);\n      };\n\n      return request$3(url, {\n        body: {\n          pid: _pid\n        }\n      }).then(success).then(function (response) {\n        self._sessionid = response.sessionid;\n\n        self._startPullSignal();\n\n        return response;\n      });\n    };\n\n    _proto.sendSignal = function sendSignal(writer) {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid;\n      var messageId = writer.messageId,\n          topic = writer.topic,\n          targetId = writer.targetId;\n      var headerCode = writer.getHeaderFlag();\n      var protocol = env.protocol.http;\n      var TPL = topic ? COMET_REQ_HAS_TOPIC_URL_TPL : COMET_REQ_NO_TOPIC_URL_TPL;\n      var url = utils.tplEngine(TPL, {\n        protocol: protocol,\n        messageId: messageId,\n        headerCode: headerCode,\n        topic: topic,\n        targetId: targetId,\n        pid: _pid,\n        sessionId: _sessionid,\n        domain: _domain\n      });\n      var currentTime = utils.getCurrentTimestamp() + '';\n      var xhr = httpRequest({\n        url: url,\n        method: REQUEST_METHOD.POST,\n        body: writer.getCometData(),\n        success: function success(responseText) {\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (!isSuccess) {\n            self.handleError(messageId);\n          }\n\n          self._xhrCache.remove(currentTime);\n        },\n        fail: function fail(error) {\n          self.handleError(messageId);\n\n          self._xhrCache.remove(currentTime);\n\n          Logger.error(TAG.L_COMET_SEND_SIGNAL_E, {\n            content: {\n              info: 'comet error',\n              error: error\n            }\n          });\n        }\n      });\n\n      self._xhrCache.set(currentTime, xhr);\n    };\n\n    _proto.handleCometResponse = function handleCometResponse(responseText) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var response = utils.isString(responseText) ? utils.parseJSON(responseText) : responseText;\n\n      if (!response) {\n        return false;\n      }\n\n      if (!response || !utils.isArray(response)) {\n        return true;\n      }\n\n      utils.forEach(response, function (data) {\n        var sessionid = data.sessionid;\n\n        if (sessionid) {\n          self._sessionid = sessionid;\n        }\n\n        var signal = readCometData(data);\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n\n        if (signal && utils.isValidTimestamp(signal.timestamp)) {\n          common.DelayTimer.setTime(signal.timestamp);\n        }\n      });\n      return true;\n    };\n\n    _proto.handleError = function handleError(messageId, status) {\n      var signal = {\n        messageId: messageId,\n        status: status || ERROR_CODE.TIMEOUT\n      };\n\n      this._transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n    };\n\n    _proto.disconnect = function disconnect() {\n      var self = this;\n      self._isDisconnected = true;\n      var _xhrCache = self._xhrCache,\n          _pullSignalTimer = self._pullSignalTimer;\n\n      var xhrKeys = _xhrCache.getKeys();\n\n      _pullSignalTimer.stop();\n\n      utils.forEach(xhrKeys, function (key) {\n        var xhr = _xhrCache.get(key);\n\n        xhr.abort();\n\n        _xhrCache.remove(key);\n      });\n    };\n\n    return CometTransporter;\n  }();\n\n  var Transporter = (function (option) {\n    var connectType = option.connectType;\n    var isSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var Transporter = isSocket ? SocketTransporter : CometTransporter;\n    return new Transporter(option);\n  });\n\n  var PBName = {\n    UpStreamMessage: 'UpStreamMessage',\n    DownStreamMessage: 'DownStreamMessage',\n    DownStreamMessages: 'DownStreamMessages',\n    SessionsAttQryInput: 'SessionsAttQryInput',\n    SessionsAttOutput: 'SessionsAttOutput',\n    SyncRequestMsg: 'SyncRequestMsg',\n    ChrmPullMsg: 'ChrmPullMsg',\n    NotifyMsg: 'NotifyMsg',\n    HistoryMsgInput: 'HistoryMsgInput',\n    HistoryMsgOuput: 'HistoryMsgOuput',\n    RelationQryInput: 'RelationQryInput',\n    RelationsOutput: 'RelationsOutput',\n    DeleteSessionsInput: 'DeleteSessionsInput',\n    SessionInfo: 'SessionInfo',\n    DeleteSessionsOutput: 'DeleteSessionsOutput',\n    RelationsInput: 'RelationsInput',\n    DeleteMsgInput: 'DeleteMsgInput',\n    CleanHisMsgInput: 'CleanHisMsgInput',\n    SessionMsgReadInput: 'SessionMsgReadInput',\n    ChrmInput: 'ChrmInput',\n    QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n    QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n    RtcInput: 'RtcInput',\n    RtcUserListOutput: 'RtcUserListOutput',\n    SetUserStatusInput: 'SetUserStatusInput',\n    RtcSetDataInput: 'RtcSetDataInput',\n    RtcUserSetDataInput: 'RtcUserSetDataInput',\n    RtcDataInput: 'RtcDataInput',\n    RtcSetOutDataInput: 'RtcSetOutDataInput',\n    MCFollowInput: 'MCFollowInput',\n    RtcTokenOutput: 'RtcTokenOutput',\n    RtcQryOutput: 'RtcQryOutput',\n    RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n    RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n    RtcQueryListInput: 'RtcQueryListInput',\n    RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n    RtcValueInfo: 'RtcValueInfo',\n    RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n    GetQNupTokenInput: 'GetQNupTokenInput',\n    GetQNupTokenOutput: 'GetQNupTokenOutput',\n    GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n    GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput',\n    SetChrmKV: 'SetChrmKV',\n    ChrmKVOutput: 'ChrmKVOutput',\n    QueryChrmKV: 'QueryChrmKV',\n    ChrmNotifyMsg: 'ChrmNotifyMsg',\n    SetUserSettingInput: 'SetUserSettingInput',\n    SetUserSettingOutput: 'SetUserSettingOutput',\n    PullUserSettingInput: 'PullUserSettingInput',\n    PullUserSettingOutput: 'PullUserSettingOutput',\n    UserSettingNotification: 'UserSettingNotification',\n    SessionReq: 'SessionReq',\n    SessionStates: 'SessionStates',\n    SessionState: 'SessionState',\n    SessionStateItem: 'SessionStateItem',\n    SessionStateModifyReq: 'SessionStateModifyReq',\n    SessionStateModifyResp: 'SessionStateModifyResp'\n  };\n\n  var _SSMsg;\n  var SSMsg = (_SSMsg = {}, _SSMsg[PBName.UpStreamMessage] = ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData'], _SSMsg[PBName.DownStreamMessages] = ['list', 'syncTime', 'finished'], _SSMsg[PBName.DownStreamMessage] = ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId'], _SSMsg[PBName.SessionsAttQryInput] = ['nothing'], _SSMsg[PBName.SessionsAttOutput] = ['inboxTime', 'sendboxTime', 'totalUnreadCount'], _SSMsg[PBName.SyncRequestMsg] = ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'], _SSMsg[PBName.ChrmPullMsg] = ['syncTime', 'count'], _SSMsg[PBName.NotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.HistoryMsgInput] = ['targetId', 'time', 'count', 'order'], _SSMsg[PBName.HistoryMsgOuput] = ['list', 'syncTime', 'hasMsg'], _SSMsg[PBName.RelationQryInput] = ['type', 'count', 'startTime', 'order'], _SSMsg[PBName.RelationsOutput] = ['info'], _SSMsg[PBName.DeleteSessionsInput] = ['sessions'], _SSMsg[PBName.SessionInfo] = ['type', 'channelId'], _SSMsg[PBName.DeleteSessionsOutput] = ['nothing'], _SSMsg[PBName.RelationsInput] = ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'], _SSMsg[PBName.DeleteMsgInput] = ['type', 'conversationId', 'msgs'], _SSMsg[PBName.CleanHisMsgInput] = ['targetId', 'dataTime', 'conversationType'], _SSMsg[PBName.SessionMsgReadInput] = ['type', 'msgTime', 'channelId'], _SSMsg[PBName.ChrmInput] = ['nothing'], _SSMsg[PBName.QueryChatRoomInfoInput] = ['count', 'order'], _SSMsg[PBName.QueryChatRoomInfoOutput] = ['userTotalNums', 'userInfos'], _SSMsg[PBName.GetQNupTokenInput] = ['type'], _SSMsg[PBName.GetQNdownloadUrlInput] = ['type', 'key', 'fileName'], _SSMsg[PBName.GetQNupTokenOutput] = ['deadline', 'token'], _SSMsg[PBName.GetQNdownloadUrlOutput] = ['downloadUrl'], _SSMsg[PBName.SetChrmKV] = ['entry', 'bNotify', 'notification', 'type'], _SSMsg[PBName.ChrmKVOutput] = ['entries', 'bFullUpdate', 'syncTime'], _SSMsg[PBName.QueryChrmKV] = ['timestamp'], _SSMsg[PBName.ChrmNotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.SetUserSettingInput] = ['version', 'value'], _SSMsg[PBName.SetUserSettingOutput] = ['version', 'reserve'], _SSMsg[PBName.PullUserSettingInput] = ['version', 'reserve'], _SSMsg[PBName.PullUserSettingOutput] = ['items', 'version'], _SSMsg);\n\n  var Codec = {};\n  utils.forEach(SSMsg, function (paramList, name) {\n    Codec[name] = function () {};\n\n    Codec[name].prototype.data = {};\n\n    Codec[name].prototype.getData = function () {\n      return this.data;\n    };\n\n    utils.forEach(paramList, function (param) {\n      var setEventName = 'set' + utils.toUpperCase(param, 0, 1);\n\n      Codec[name].prototype[setEventName] = function (item) {\n        this.data[param] = item;\n      };\n    });\n\n    Codec[name].decode = function (data) {\n      var decodeResult = {};\n\n      if (utils.isString(data)) {\n        data = utils.parseJSON(data);\n      }\n\n      var _loop = function _loop(key) {\n        var getEventName = 'get' + utils.toUpperCase(key, 0, 1);\n        decodeResult[key] = data[key];\n\n        decodeResult[getEventName] = function () {\n          return data[key];\n        };\n      };\n\n      for (var key in data) {\n        _loop(key);\n      }\n\n      return decodeResult;\n    };\n  });\n\n  Codec.getModule = function (pbName) {\n    var modules = new Codec[pbName]();\n\n    modules.getArrayData = function () {\n      return modules.getData();\n    };\n\n    return modules;\n  };\n\n  function protobuf(a){var b=void 0,c=function(){function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c;}function b(a){return (a&&a.__isLong__)===!0}function e(a,b){var e,f,h;return b?(a>>>=0,(h=a>=0&&256>a)&&(f=d[a])?f:(e=g(a,0>(0|a)?-1:0,!0),h&&(d[a]=e),e)):(a|=0,(h=a>=-128&&128>a)&&(f=c[a])?f:(e=g(a,0>a?-1:0,!1),h&&(c[a]=e),e))}function f(a,b){if(isNaN(a)||!isFinite(a))return b?r:q;if(b){if(0>a)return r;if(a>=n)return w}else{if(-o>=a)return x;if(a+1>=o)return v}return 0>a?f(-a,b).neg():g(0|a%m,0|a/m,b)}function g(b,c,d){return new a(b,c,d)}function i(a,b,c){var d,e,g,j,k,l,m;if(0===a.length)throw Error(\"empty string\");if(\"NaN\"===a||\"Infinity\"===a||\"+Infinity\"===a||\"-Infinity\"===a)return q;if(\"number\"==typeof b?(c=b,b=!1):b=!!b,c=c||10,2>c||c>36)throw RangeError(\"radix\");if((d=a.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===d)return i(a.substring(1),b,c).neg();for(e=f(h(c,8)),g=q,j=0;j<a.length;j+=8)k=Math.min(8,a.length-j),l=parseInt(a.substring(j,j+k),c),8>k?(m=f(h(c,k)),g=g.mul(m).add(f(l))):(g=g.mul(e),g=g.add(f(l)));return g.unsigned=b,g}function j(b){return b instanceof a?b:\"number\"==typeof b?f(b):\"string\"==typeof b?i(b):g(b.low,b.high,b.unsigned)}var c,d,h,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return Object.defineProperty(a.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b,c={},d={},a.fromInt=e,a.fromNumber=f,a.fromBits=g,h=Math.pow,a.fromString=i,a.fromValue=j,k=65536,l=1<<24,m=k*k,n=m*m,o=n/2,p=e(l),q=e(0),a.ZERO=q,r=e(0,!0),a.UZERO=r,s=e(1),a.ONE=s,t=e(1,!0),a.UONE=t,u=e(-1),a.NEG_ONE=u,v=g(-1,2147483647,!1),a.MAX_VALUE=v,w=g(-1,-1,!0),a.MAX_UNSIGNED_VALUE=w,x=g(0,-2147483648,!1),a.MIN_VALUE=x,y=a.prototype,y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},y.toString=function(a){var b,c,d,e,g,i,j,k,l;if(a=a||10,2>a||a>36)throw RangeError(\"radix\");if(this.isZero())return \"0\";if(this.isNegative())return this.eq(x)?(b=f(a),c=this.div(b),d=c.mul(b).sub(this),c.toString(a)+d.toInt().toString(a)):\"-\"+this.neg().toString(a);for(e=f(h(a,6),this.unsigned),g=this,i=\"\";;){if(j=g.div(e),k=g.sub(j.mul(e)).toInt()>>>0,l=k.toString(a),g=j,g.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i;}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var a,b;if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return !this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1===(1&this.low)},y.isEven=function(){return 0===(1&this.low)},y.equals=function(a){return b(a)||(a=j(a)),this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low},y.eq=y.equals,y.notEquals=function(a){return !this.eq(a)},y.neq=y.notEquals,y.lessThan=function(a){return this.comp(a)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(a){return this.comp(a)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(a){return this.comp(a)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(a){return this.comp(a)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(a){if(b(a)||(a=j(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return !this.unsigned&&this.eq(x)?x:this.not().add(s)},y.neg=y.negate,y.add=function(a){var c,d,e,f,h,i,k,l,m,n,o,p;return b(a)||(a=j(a)),c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,h=a.high>>>16,i=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0,p+=f+l,o+=p>>>16,p&=65535,o+=e+k,n+=o>>>16,o&=65535,n+=d+i,m+=n>>>16,n&=65535,m+=c+h,m&=65535,g(o<<16|p,m<<16|n,this.unsigned)},y.subtract=function(a){return b(a)||(a=j(a)),this.add(a.neg())},y.sub=y.subtract,y.multiply=function(a){var c,d,e,h,i,k,l,m,n,o,r,s;return this.isZero()?q:(b(a)||(a=j(a)),a.isZero()?q:this.eq(x)?a.isOdd()?x:q:a.eq(x)?this.isOdd()?x:q:this.isNegative()?a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg():a.isNegative()?this.mul(a.neg()).neg():this.lt(p)&&a.lt(p)?f(this.toNumber()*a.toNumber(),this.unsigned):(c=this.high>>>16,d=65535&this.high,e=this.low>>>16,h=65535&this.low,i=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,o=0,r=0,s=0,s+=h*m,r+=s>>>16,s&=65535,r+=e*m,o+=r>>>16,r&=65535,r+=h*l,o+=r>>>16,r&=65535,o+=d*m,n+=o>>>16,o&=65535,o+=e*l,n+=o>>>16,o&=65535,o+=h*k,n+=o>>>16,o&=65535,n+=c*m+d*l+e*k+h*i,n&=65535,g(r<<16|s,n<<16|o,this.unsigned)))},y.mul=y.multiply,y.divide=function(a){var c,d,e,g,i,k,l,m;if(b(a)||(a=j(a)),a.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?r:q;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return r;if(a.gt(this.shru(1)))return t;e=r;}else{if(this.eq(x))return a.eq(s)||a.eq(u)?x:a.eq(x)?s:(g=this.shr(1),c=g.div(a).shl(1),c.eq(q)?a.isNegative()?s:u:(d=this.sub(a.mul(c)),e=c.add(d.div(a))));if(a.eq(x))return this.unsigned?r:q;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();e=q;}for(d=this;d.gte(a);){for(c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),i=Math.ceil(Math.log(c)/Math.LN2),k=48>=i?1:h(2,i-48),l=f(c),m=l.mul(a);m.isNegative()||m.gt(d);)c-=k,l=f(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=s),e=e.add(l),d=d.sub(m);}return e},y.div=y.divide,y.modulo=function(a){return b(a)||(a=j(a)),this.sub(this.div(a).mul(a))},y.mod=y.modulo,y.not=function(){return g(~this.low,~this.high,this.unsigned)},y.and=function(a){return b(a)||(a=j(a)),g(this.low&a.low,this.high&a.high,this.unsigned)},y.or=function(a){return b(a)||(a=j(a)),g(this.low|a.low,this.high|a.high,this.unsigned)},y.xor=function(a){return b(a)||(a=j(a)),g(this.low^a.low,this.high^a.high,this.unsigned)},y.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):g(0,this.low<<a-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):g(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(a){var c,d;return b(a)&&(a=a.toInt()),a&=63,0===a?this:(c=this.high,32>a?(d=this.low,g(d>>>a|c<<32-a,c>>>a,this.unsigned)):32===a?g(c,0,this.unsigned):g(c>>>a-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},y.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var a=this.high,b=this.low;return [255&b,255&b>>>8,255&b>>>16,255&b>>>24,255&a,255&a>>>8,255&a>>>16,255&a>>>24]},y.toBytesBE=function(){var a=this.high,b=this.low;return [255&a>>>24,255&a>>>16,255&a>>>8,255&a,255&b>>>24,255&b>>>16,255&b>>>8,255&b]},a}(),d=function(a){function f(a){var b=0;return function(){return b<a.length?a.charCodeAt(b++):null}}function g(){var a=[],b=[];return function(){return 0===arguments.length?b.join(\"\")+e.apply(String,a):(a.length+arguments.length>1024&&(b.push(e.apply(String,a)),a.length=0),Array.prototype.push.apply(a,arguments),void 0)}}function h(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j;}return (n?-1:1)*g*Math.pow(2,f-d)}function i(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p;}var c,d,e,j,k,b=function(a,c,e){if(\"undefined\"==typeof a&&(a=b.DEFAULT_CAPACITY),\"undefined\"==typeof c&&(c=b.DEFAULT_ENDIAN),\"undefined\"==typeof e&&(e=b.DEFAULT_NOASSERT),!e){if(a=0|a,0>a)throw RangeError(\"Illegal capacity\");c=!!c,e=!!e;}this.buffer=0===a?d:new ArrayBuffer(a),this.view=0===a?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=a,this.littleEndian=c,this.noAssert=e;};return b.VERSION=\"5.0.1\",b.LITTLE_ENDIAN=!0,b.BIG_ENDIAN=!1,b.DEFAULT_CAPACITY=16,b.DEFAULT_ENDIAN=b.BIG_ENDIAN,b.DEFAULT_NOASSERT=!1,b.Long=a||null,c=b.prototype,c.__isByteBuffer__,Object.defineProperty(c,\"__isByteBuffer__\",{value:!0,enumerable:!1,configurable:!1}),d=new ArrayBuffer(0),e=String.fromCharCode,b.accessor=function(){return Uint8Array},b.allocate=function(a,c,d){return new b(a,c,d)},b.concat=function(a,c,d,e){var f,i,g,h,k,j;for((\"boolean\"==typeof c||\"string\"!=typeof c)&&(e=d,d=c,c=void 0),f=0,g=0,h=a.length;h>g;++g)b.isByteBuffer(a[g])||(a[g]=b.wrap(a[g],c)),i=a[g].limit-a[g].offset,i>0&&(f+=i);if(0===f)return new b(0,d,e);for(j=new b(f,d,e),g=0;h>g;)k=a[g++],i=k.limit-k.offset,0>=i||(j.view.set(k.view.subarray(k.offset,k.limit),j.offset),j.offset+=i);return j.limit=j.offset,j.offset=0,j},b.isByteBuffer=function(a){return (a&&a.__isByteBuffer__)===!0},b.type=function(){return ArrayBuffer},b.wrap=function(a,d,e,f){var g,h;if(\"string\"!=typeof d&&(f=e,e=d,d=void 0),\"string\"==typeof a)switch(\"undefined\"==typeof d&&(d=\"utf8\"),d){case\"base64\":return b.fromBase64(a,e);case\"hex\":return b.fromHex(a,e);case\"binary\":return b.fromBinary(a,e);case\"utf8\":return b.fromUTF8(a,e);case\"debug\":return b.fromDebug(a,e);default:throw Error(\"Unsupported encoding: \"+d)}if(null===a||\"object\"!=typeof a)throw TypeError(\"Illegal buffer\");if(b.isByteBuffer(a))return g=c.clone.call(a),g.markedOffset=-1,g;if(a instanceof Uint8Array)g=new b(0,e,f),a.length>0&&(g.buffer=a.buffer,g.offset=a.byteOffset,g.limit=a.byteOffset+a.byteLength,g.view=new Uint8Array(a.buffer));else if(a instanceof ArrayBuffer)g=new b(0,e,f),a.byteLength>0&&(g.buffer=a,g.offset=0,g.limit=a.byteLength,g.view=a.byteLength>0?new Uint8Array(a):null);else{if(\"[object Array]\"!==Object.prototype.toString.call(a))throw TypeError(\"Illegal buffer\");for(g=new b(a.length,e,f),g.limit=a.length,h=0;h<a.length;++h)g.view[h]=a[h];}return g},c.writeBitSet=function(a,b){var h,d,e,f,g,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(!(a instanceof Array))throw TypeError(\"Illegal BitSet: Not an array\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(d=b,e=a.length,f=e>>3,g=0,b+=this.writeVarint32(e,b);f--;)h=1&!!a[g++]|(1&!!a[g++])<<1|(1&!!a[g++])<<2|(1&!!a[g++])<<3|(1&!!a[g++])<<4|(1&!!a[g++])<<5|(1&!!a[g++])<<6|(1&!!a[g++])<<7,this.writeByte(h,b++);if(e>g){for(i=0,h=0;e>g;)h|=(1&!!a[g++])<<i++;this.writeByte(h,b++);}return c?(this.offset=b,this):b-d},c.readBitSet=function(a){var h,c,d,e,f,g,i,b=\"undefined\"==typeof a;for(b&&(a=this.offset),c=this.readVarint32(a),d=c.value,e=d>>3,f=0,g=[],a+=c.length;e--;)h=this.readByte(a++),g[f++]=!!(1&h),g[f++]=!!(2&h),g[f++]=!!(4&h),g[f++]=!!(8&h),g[f++]=!!(16&h),g[f++]=!!(32&h),g[f++]=!!(64&h),g[f++]=!!(128&h);if(d>f)for(i=0,h=this.readByte(a++);d>f;)g[f++]=!!(1&h>>i++);return b&&(this.offset=a),g},c.readBytes=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+a+\") <= \"+this.buffer.byteLength)}return d=this.slice(b,b+a),c&&(this.offset+=a),d},c.writeBytes=c.append,c.writeInt8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeByte=c.writeInt8,c.readInt8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],128===(128&c)&&(c=-(255-c+1)),b&&(this.offset+=1),c},c.readByte=c.readInt8,c.writeUint8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeUInt8=c.writeUint8,c.readUint8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],b&&(this.offset+=1),c},c.readUInt8=c.readUint8,c.writeInt16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeShort=c.writeInt16,c.readInt16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),32768===(32768&c)&&(c=-(65535-c+1)),b&&(this.offset+=2),c},c.readShort=c.readInt16,c.writeUint16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeUInt16=c.writeUint16,c.readUint16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),b&&(this.offset+=2),c},c.readUInt16=c.readUint16,c.writeInt32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeInt=c.writeInt32,c.readInt32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),c|=0,b&&(this.offset+=4),c},c.readInt=c.readInt32,c.writeUint32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeUInt32=c.writeUint32,c.readUint32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),b&&(this.offset+=4),c},c.readUInt32=c.readUint32,a&&(c.writeInt64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeLong=c.writeInt64,c.readInt64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!1),c&&(this.offset+=8),f},c.readLong=c.readInt64,c.writeUint64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeUInt64=c.writeUint64,c.readUint64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!0),c&&(this.offset+=8),f},c.readUInt64=c.readUint64),c.writeFloat32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,i(this.view,a,b,this.littleEndian,23,4),c&&(this.offset+=4),this},c.writeFloat=c.writeFloat32,c.readFloat32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,23,4),b&&(this.offset+=4),c},c.readFloat=c.readFloat32,c.writeFloat64=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=8,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=8,i(this.view,a,b,this.littleEndian,52,8),c&&(this.offset+=8),this},c.writeDouble=c.writeFloat64,c.readFloat64=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,52,8),b&&(this.offset+=8),c},c.readDouble=c.readFloat64,b.MAX_VARINT32_BYTES=5,b.calculateVarint32=function(a){return a>>>=0,128>a?1:16384>a?2:1<<21>a?3:1<<28>a?4:5},b.zigZagEncode32=function(a){return ((a|=0)<<1^a>>31)>>>0},b.zigZagDecode32=function(a){return 0|a>>>1^-(1&a)},c.writeVarint32=function(a,c){var f,e,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(e=b.calculateVarint32(a),c+=e,g=this.buffer.byteLength,c>g&&this.resize((g*=2)>c?g:c),c-=e,a>>>=0;a>=128;)f=128|127&a,this.view[c++]=f,a>>>=7;return this.view[c++]=a,d?(this.offset=c,this):e},c.writeVarint32ZigZag=function(a,c){return this.writeVarint32(b.zigZagEncode32(a),c)},c.readVarint32=function(a){var e,c,d,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}c=0,d=0;do{if(!this.noAssert&&a>this.limit)throw f=Error(\"Truncated\"),f.truncated=!0,f;e=this.view[a++],5>c&&(d|=(127&e)<<7*c),++c;}while(0!==(128&e));return d|=0,b?(this.offset=a,d):{value:d,length:c}},c.readVarint32ZigZag=function(a){var c=this.readVarint32(a);return \"object\"==typeof c?c.value=b.zigZagDecode32(c.value):c=b.zigZagDecode32(c),c},a&&(b.MAX_VARINT64_BYTES=10,b.calculateVarint64=function(b){\"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b));var c=b.toInt()>>>0,d=b.shiftRightUnsigned(28).toInt()>>>0,e=b.shiftRightUnsigned(56).toInt()>>>0;return 0==e?0==d?16384>c?128>c?1:2:1<<21>c?3:4:16384>d?128>d?5:6:1<<21>d?7:8:128>e?9:10},b.zigZagEncode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned()},b.zigZagDecode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned()},c.writeVarint64=function(c,d){var f,g,h,i,j,e=\"undefined\"==typeof d;if(e&&(d=this.offset),!this.noAssert){if(\"number\"==typeof c)c=a.fromNumber(c);else if(\"string\"==typeof c)c=a.fromString(c);else if(!(c&&c instanceof a))throw TypeError(\"Illegal value: \"+c+\" (not an integer or Long)\");if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}switch(\"number\"==typeof c?c=a.fromNumber(c,!1):\"string\"==typeof c?c=a.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),f=b.calculateVarint64(c),g=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,i=c.shiftRightUnsigned(56).toInt()>>>0,d+=f,j=this.buffer.byteLength,d>j&&this.resize((j*=2)>d?j:d),d-=f,f){case 10:this.view[d+9]=1&i>>>7;case 9:this.view[d+8]=9!==f?128|i:127&i;case 8:this.view[d+7]=8!==f?128|h>>>21:127&h>>>21;case 7:this.view[d+6]=7!==f?128|h>>>14:127&h>>>14;case 6:this.view[d+5]=6!==f?128|h>>>7:127&h>>>7;case 5:this.view[d+4]=5!==f?128|h:127&h;case 4:this.view[d+3]=4!==f?128|g>>>21:127&g>>>21;case 3:this.view[d+2]=3!==f?128|g>>>14:127&g>>>14;case 2:this.view[d+1]=2!==f?128|g>>>7:127&g>>>7;case 1:this.view[d]=1!==f?128|g:127&g;}return e?(this.offset+=f,this):f},c.writeVarint64ZigZag=function(a,c){return this.writeVarint64(b.zigZagEncode64(a),c)},c.readVarint64=function(b){var d,e,f,g,h,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+1+\") <= \"+this.buffer.byteLength)}if(d=b,e=0,f=0,g=0,h=0,h=this.view[b++],e=127&h,128&h&&(h=this.view[b++],e|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g|=(127&h)<<7,128&h||this.noAssert&&\"undefined\"==typeof h))))))))))throw Error(\"Buffer overrun\");return i=a.fromBits(e|f<<28,f>>>4|g<<24,!1),c?(this.offset=b,i):{value:i,length:b-d}},c.readVarint64ZigZag=function(c){var d=this.readVarint64(c);return d&&d.value instanceof a?d.value=b.zigZagDecode64(d.value):d=b.zigZagDecode64(d),d}),c.writeCString=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),e=a.length,!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");for(d=0;e>d;++d)if(0===a.charCodeAt(d))throw RangeError(\"Illegal str: Contains NULL-characters\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=k.calculateUTF16asUTF8(f(a))[1],b+=e+1,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=e+1,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),this.view[b++]=0,c?(this.offset=b,this):e},c.readCString=function(a){var c,e,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=a,f=-1,k.decodeUTF8toUTF16(function(){if(0===f)return null;if(a>=this.limit)throw RangeError(\"Illegal range: Truncated data, \"+a+\" < \"+this.limit);return f=this.view[a++],0===f?null:f}.bind(this),e=g(),!0),b?(this.offset=a,e()):{string:e(),length:a-c}},c.writeIString=function(a,b){var e,d,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(d=b,e=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],b+=4+e,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=4+e,this.littleEndian?(this.view[b+3]=255&e>>>24,this.view[b+2]=255&e>>>16,this.view[b+1]=255&e>>>8,this.view[b]=255&e):(this.view[b]=255&e>>>24,this.view[b+1]=255&e>>>16,this.view[b+2]=255&e>>>8,this.view[b+3]=255&e),b+=4,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),b!==d+4+e)throw RangeError(\"Illegal range: Truncated data, \"+b+\" == \"+(b+4+e));return c?(this.offset=b,this):b-d},c.readIString=function(a){var d,e,f,c=\"undefined\"==typeof a;\n  if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readUint32(a),f=this.readUTF8String(e,b.METRICS_BYTES,a+=4),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},b.METRICS_CHARS=\"c\",b.METRICS_BYTES=\"b\",c.writeUTF8String=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=b,d=k.calculateUTF16asUTF8(f(a))[1],b+=d,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=d,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),c?(this.offset=b,this):b-e},c.writeString=c.writeUTF8String,b.calculateUTF8Chars=function(a){return k.calculateUTF16asUTF8(f(a))[0]},b.calculateUTF8Bytes=function(a){return k.calculateUTF16asUTF8(f(a))[1]},b.calculateString=b.calculateUTF8Bytes,c.readUTF8String=function(a,c,d){var e,i,f,h,j;if(\"number\"==typeof c&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),\"undefined\"==typeof c&&(c=b.METRICS_CHARS),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(f=0,h=d,c===b.METRICS_CHARS){if(i=g(),k.decodeUTF8(function(){return a>f&&d<this.limit?this.view[d++]:null}.bind(this),function(a){++f,k.UTF8toUTF16(a,i);}),f!==a)throw RangeError(\"Illegal range: Truncated data, \"+f+\" == \"+a);return e?(this.offset=d,i()):{string:i(),length:d-h}}if(c===b.METRICS_BYTES){if(!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+a+\") <= \"+this.buffer.byteLength)}if(j=d+a,k.decodeUTF8toUTF16(function(){return j>d?this.view[d++]:null}.bind(this),i=g(),this.noAssert),d!==j)throw RangeError(\"Illegal range: Truncated data, \"+d+\" == \"+j);return e?(this.offset=d,i()):{string:i(),length:d-h}}throw TypeError(\"Unsupported metrics: \"+c)},c.readString=c.readUTF8String,c.writeVString=function(a,c){var g,h,e,i,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(e=c,g=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],h=b.calculateVarint32(g),c+=h+g,i=this.buffer.byteLength,c>i&&this.resize((i*=2)>c?i:c),c-=h+g,c+=this.writeVarint32(g,c),k.encodeUTF16toUTF8(f(a),function(a){this.view[c++]=a;}.bind(this)),c!==e+g+h)throw RangeError(\"Illegal range: Truncated data, \"+c+\" == \"+(c+g+h));return d?(this.offset=c,this):c-e},c.readVString=function(a){var d,e,f,c=\"undefined\"==typeof a;if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readVarint32(a),f=this.readUTF8String(e.value,b.METRICS_BYTES,a+=e.length),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},c.append=function(a,c,d){var e,f,g;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(d+=f,g=this.buffer.byteLength,d>g&&this.resize((g*=2)>d?g:d),d-=f,this.view.set(a.view.subarray(a.offset,a.limit),d),a.offset+=f,e&&(this.offset+=f),this)},c.appendTo=function(a,b){return a.append(this,b),this},c.assert=function(a){return this.noAssert=!a,this},c.capacity=function(){return this.buffer.byteLength},c.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},c.clone=function(a){var c=new b(0,this.littleEndian,this.noAssert);return a?(c.buffer=new ArrayBuffer(this.buffer.byteLength),c.view=new Uint8Array(c.buffer)):(c.buffer=this.buffer,c.view=this.view),c.offset=this.offset,c.markedOffset=this.markedOffset,c.limit=this.limit,c},c.compact=function(a,b){var c,e,f;if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return 0===a&&b===this.buffer.byteLength?this:(c=b-a,0===c?(this.buffer=d,this.view=null,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=0,this):(e=new ArrayBuffer(c),f=new Uint8Array(e),f.set(this.view.subarray(a,b)),this.buffer=e,this.view=f,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=c,this))},c.copy=function(a,c){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>a||a>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(a===c)return new b(0,this.littleEndian,this.noAssert);var d=c-a,e=new b(d,this.littleEndian,this.noAssert);return e.offset=0,e.limit=d,e.markedOffset>=0&&(e.markedOffset-=a),this.copyTo(e,0,a,c),e},c.copyTo=function(a,c,d,e){var f,g,h;if(!this.noAssert&&!b.isByteBuffer(a))throw TypeError(\"Illegal target: Not a ByteBuffer\");if(c=(g=\"undefined\"==typeof c)?a.offset:0|c,d=(f=\"undefined\"==typeof d)?this.offset:0|d,e=\"undefined\"==typeof e?this.limit:0|e,0>c||c>a.buffer.byteLength)throw RangeError(\"Illegal target range: 0 <= \"+c+\" <= \"+a.buffer.byteLength);if(0>d||e>this.buffer.byteLength)throw RangeError(\"Illegal source range: 0 <= \"+d+\" <= \"+this.buffer.byteLength);return h=e-d,0===h?a:(a.ensureCapacity(c+h),a.view.set(this.view.subarray(d,e),c),f&&(this.offset+=h),g&&(a.offset+=h),this)},c.ensureCapacity=function(a){var b=this.buffer.byteLength;return a>b?this.resize((b*=2)>a?b:a):this},c.fill=function(a,b,c){var d=\"undefined\"==typeof b;if(d&&(b=this.offset),\"string\"==typeof a&&a.length>0&&(a=a.charCodeAt(0)),\"undefined\"==typeof b&&(b=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal begin: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(b>=c)return this;for(;c>b;)this.view[b++]=a;return d&&(this.offset=b),this},c.flip=function(){return this.limit=this.offset,this.offset=0,this},c.mark=function(a){if(a=\"undefined\"==typeof a?this.offset:a,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return this.markedOffset=a,this},c.order=function(a){if(!this.noAssert&&\"boolean\"!=typeof a)throw TypeError(\"Illegal littleEndian: Not a boolean\");return this.littleEndian=!!a,this},c.LE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!!a:!0,this},c.BE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!a:!1,this},c.prepend=function(a,c,d){var e,f,g,h,i;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(g=f-d,g>0?(h=new ArrayBuffer(this.buffer.byteLength+g),i=new Uint8Array(h),i.set(this.view.subarray(d,this.buffer.byteLength),f),this.buffer=h,this.view=i,this.offset+=g,this.markedOffset>=0&&(this.markedOffset+=g),this.limit+=g,d+=g):new Uint8Array(this.buffer),this.view.set(a.view.subarray(a.offset,a.limit),d-f),a.offset=a.limit,e&&(this.offset-=f),this)},c.prependTo=function(a,b){return a.prepend(this,b),this},c.printDebug=function(a){\"function\"!=typeof a&&(a=console.log.bind(console)),a(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(!0));},c.remaining=function(){return this.limit-this.offset},c.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},c.resize=function(a){var b,c;if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal capacity: \"+a+\" (not an integer)\");if(a|=0,0>a)throw RangeError(\"Illegal capacity: 0 <= \"+a)}return this.buffer.byteLength<a&&(b=new ArrayBuffer(a),c=new Uint8Array(b),c.set(this.view),this.buffer=b,this.view=c),this},c.reverse=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return a===b?this:(Array.prototype.reverse.call(this.view.subarray(a,b)),this)},c.skip=function(a){if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");a|=0;}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+a+\" <= \"+this.buffer.byteLength);return this.offset=b,this},c.slice=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c=this.clone();return c.offset=a,c.limit=b,c},c.toBuffer=function(a){var e,b=this.offset,c=this.limit;if(!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal limit: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}return a||0!==b||c!==this.buffer.byteLength?b===c?d:(e=new ArrayBuffer(c-b),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b,c),0),e):this.buffer},c.toArrayBuffer=c.toBuffer,c.toString=function(a,b,c){if(\"undefined\"==typeof a)return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";switch(\"number\"==typeof a&&(a=\"utf8\",b=a,c=b),a){case\"utf8\":return this.toUTF8(b,c);case\"base64\":return this.toBase64(b,c);case\"hex\":return this.toHex(b,c);case\"binary\":return this.toBinary(b,c);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+a)}},j=function(){var d,e,a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[];for(d=0,e=b.length;e>d;++d)c[b[d]]=d;return a.encode=function(a,c){for(var d,e;null!==(d=a());)c(b[63&d>>2]),e=(3&d)<<4,null!==(d=a())?(e|=15&d>>4,c(b[63&(e|15&d>>4)]),e=(15&d)<<2,null!==(d=a())?(c(b[63&(e|3&d>>6)]),c(b[63&d])):(c(b[63&e]),c(61))):(c(b[63&e]),c(61),c(61));},a.decode=function(a,b){function g(a){throw Error(\"Illegal character code: \"+a)}for(var d,e,f;null!==(d=a());)if(e=c[d],\"undefined\"==typeof e&&g(d),null!==(d=a())&&(f=c[d],\"undefined\"==typeof f&&g(d),b(e<<2>>>0|(48&f)>>4),null!==(d=a()))){if(e=c[d],\"undefined\"==typeof e){if(61===d)break;g(d);}if(b((15&f)<<4>>>0|(60&e)>>2),null!==(d=a())){if(f=c[d],\"undefined\"==typeof f){if(61===d)break;g(d);}b((3&e)<<6>>>0|f);}}},a.test=function(a){return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a)},a}(),c.toBase64=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a=0|a,b=0|b,0>a||b>this.capacity||a>b)throw RangeError(\"begin, end\");var c;return j.encode(function(){return b>a?this.view[a++]:null}.bind(this),c=g()),c()},b.fromBase64=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");var d=new b(3*(a.length/4),c),e=0;return j.decode(f(a),function(a){d.view[e++]=a;}),d.limit=e,d},b.btoa=function(a){return b.fromBinary(a).toBase64()},b.atob=function(a){return b.fromBase64(a).toBinary()},c.toBinary=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a|=0,b|=0,0>a||b>this.capacity()||a>b)throw RangeError(\"begin, end\");if(a===b)return \"\";for(var c=[],d=[];b>a;)c.push(this.view[a++]),c.length>=1024&&(d.push(String.fromCharCode.apply(String,c)),c=[]);return d.join(\"\")+String.fromCharCode.apply(String,c)},b.fromBinary=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");for(var f,d=0,e=a.length,g=new b(e,c);e>d;){if(f=a.charCodeAt(d),f>255)throw RangeError(\"illegal char code: \"+f);g.view[d++]=f;}return g.limit=e,g},c.toDebug=function(a){for(var d,b=-1,c=this.buffer.byteLength,e=\"\",f=\"\",g=\"\";c>b;){if(-1!==b&&(d=this.view[b],e+=16>d?\"0\"+d.toString(16).toUpperCase():d.toString(16).toUpperCase(),a&&(f+=d>32&&127>d?String.fromCharCode(d):\".\")),++b,a&&b>0&&0===b%16&&b!==c){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\",e=f=\"\";}e+=b===this.offset&&b===this.limit?b===this.markedOffset?\"!\":\"|\":b===this.offset?b===this.markedOffset?\"[\":\"<\":b===this.limit?b===this.markedOffset?\"]\":\">\":b===this.markedOffset?\"'\":a||0!==b&&b!==c?\" \":\"\";}if(a&&\" \"!==e){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\";}return a?g:e},b.fromDebug=function(a,c,d){for(var i,j,e=a.length,f=new b(0|(e+1)/3,c,d),g=0,h=0,k=!1,l=!1,m=!1,n=!1,o=!1;e>g;){switch(i=a.charAt(g++)){case\"!\":if(!d){if(l||m||n){o=!0;break}l=m=n=!0;}f.offset=f.markedOffset=f.limit=h,k=!1;break;case\"|\":if(!d){if(l||n){o=!0;break}l=n=!0;}f.offset=f.limit=h,k=!1;break;case\"[\":if(!d){if(l||m){o=!0;break}l=m=!0;}f.offset=f.markedOffset=h,k=!1;break;case\"<\":if(!d){if(l){o=!0;break}l=!0;}f.offset=h,k=!1;break;case\"]\":if(!d){if(n||m){o=!0;break}n=m=!0;}f.limit=f.markedOffset=h,k=!1;break;case\">\":if(!d){if(n){o=!0;break}n=!0;}f.limit=h,k=!1;break;case\"'\":if(!d){if(m){o=!0;break}m=!0;}f.markedOffset=h,k=!1;break;case\" \":k=!1;break;default:if(!d&&k){o=!0;break}if(j=parseInt(i+a.charAt(g++),16),!d&&(isNaN(j)||0>j||j>255))throw TypeError(\"Illegal str: Not a debug encoded string\");f.view[h++]=j,k=!0;}if(o)throw TypeError(\"Illegal str: Invalid symbol at \"+g)}if(!d){if(!l||!n)throw TypeError(\"Illegal str: Missing offset or limit\");if(h<f.buffer.byteLength)throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+h+\" < \"+e)}return f},c.toHex=function(a,b){if(a=\"undefined\"==typeof a?this.offset:a,b=\"undefined\"==typeof b?this.limit:b,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}for(var d,c=new Array(b-a);b>a;)d=this.view[a++],16>d?c.push(\"0\",d.toString(16)):c.push(d.toString(16));return c.join(\"\")},b.fromHex=function(a,c,d){var g,e,f,h,i;if(!d){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(0!==a.length%2)throw TypeError(\"Illegal str: Length not a multiple of 2\")}for(e=a.length,f=new b(0|e/2,c),h=0,i=0;e>h;h+=2){if(g=parseInt(a.substring(h,h+2),16),!d&&(!isFinite(g)||0>g||g>255))throw TypeError(\"Illegal str: Contains non-hex characters\");f.view[i++]=g;}return f.limit=i,f},k=function(){var a={};return a.MAX_CODEPOINT=1114111,a.encodeUTF8=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)128>c?b(127&c):2048>c?(b(192|31&c>>6),b(128|63&c)):65536>c?(b(224|15&c>>12),b(128|63&c>>6),b(128|63&c)):(b(240|7&c>>18),b(128|63&c>>12),b(128|63&c>>6),b(128|63&c)),c=null;},a.decodeUTF8=function(a,b){for(var c,d,e,f,g=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());throw b.name=\"TruncatedError\",b.bytes=a,b};null!==(c=a());)if(0===(128&c))b(c);else if(192===(224&c))null===(d=a())&&g([c,d]),b((31&c)<<6|63&d);else if(224===(240&c))(null===(d=a())||null===(e=a()))&&g([c,d,e]),b((15&c)<<12|(63&d)<<6|63&e);else{if(240!==(248&c))throw RangeError(\"Illegal starting byte: \"+c);(null===(d=a())||null===(e=a())||null===(f=a()))&&g([c,d,e,f]),b((7&c)<<18|(63&d)<<12|(63&e)<<6|63&f);}},a.UTF16toUTF8=function(a,b){for(var c,d=null;;){if(null===(c=null!==d?d:a()))break;c>=55296&&57343>=c&&null!==(d=a())&&d>=56320&&57343>=d?(b(1024*(c-55296)+d-56320+65536),d=null):b(c);}null!==d&&b(d);},a.UTF8toUTF16=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)),c=null;},a.encodeUTF16toUTF8=function(b,c){a.UTF16toUTF8(b,function(b){a.encodeUTF8(b,c);});},a.decodeUTF8toUTF16=function(b,c){a.decodeUTF8(b,function(b){a.UTF8toUTF16(b,c);});},a.calculateCodePoint=function(a){return 128>a?1:2048>a?2:65536>a?3:4},a.calculateUTF8=function(a){for(var b,c=0;null!==(b=a());)c+=128>b?1:2048>b?2:65536>b?3:4;return c},a.calculateUTF16asUTF8=function(b){var c=0,d=0;return a.UTF16toUTF8(b,function(a){++c,d+=128>a?1:2048>a?2:65536>a?3:4;}),[c,d]},a}(),c.toUTF8=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c;try{k.decodeUTF8toUTF16(function(){return b>a?this.view[a++]:null}.bind(this),c=g());}catch(d){if(a!==b)throw RangeError(\"Illegal range: Truncated data, \"+a+\" != \"+b)}return c()},b.fromUTF8=function(a,c,d){if(!d&&\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");var e=new b(k.calculateUTF16asUTF8(f(a),!0)[1],c,d),g=0;return k.encodeUTF16toUTF8(f(a),function(a){e.view[g++]=a;}),e.limit=g,e},b}(c),e=function(b,c){var f,h,i,e={};return e.ByteBuffer=b,e.c=b,f=b,e.Long=c||null,e.VERSION=\"5.0.1\",e.WIRE_TYPES={},e.WIRE_TYPES.VARINT=0,e.WIRE_TYPES.BITS64=1,e.WIRE_TYPES.LDELIM=2,e.WIRE_TYPES.STARTGROUP=3,e.WIRE_TYPES.ENDGROUP=4,e.WIRE_TYPES.BITS32=5,e.PACKABLE_WIRE_TYPES=[e.WIRE_TYPES.VARINT,e.WIRE_TYPES.BITS64,e.WIRE_TYPES.BITS32],e.TYPES={int32:{name:\"int32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},uint64:{name:\"uint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.UZERO:void 0},sint64:{name:\"sint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},bool:{name:\"bool\",wireType:e.WIRE_TYPES.VARINT,defaultValue:!1},\"double\":{name:\"double\",wireType:e.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.UZERO:void 0},sfixed64:{name:\"sfixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.ZERO:void 0},\"float\":{name:\"float\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:e.WIRE_TYPES.STARTGROUP,defaultValue:null}},e.MAP_KEY_TYPES=[e.TYPES.int32,e.TYPES.sint32,e.TYPES.sfixed32,e.TYPES.uint32,e.TYPES.fixed32,e.TYPES.int64,e.TYPES.sint64,e.TYPES.sfixed64,e.TYPES.uint64,e.TYPES.fixed64,e.TYPES.bool,e.TYPES.string,e.TYPES.bytes],e.ID_MIN=1,e.ID_MAX=536870911,e.convertFieldsToCamelCase=!1,e.populateAccessors=!0,e.populateDefaults=!0,e.Util=function(){var a={};return a.IS_NODE=!(\"object\"!=typeof process||\"[object process]\"!=process+\"\"||process.browser),a.XHR=function(){var c,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}],b=null;for(c=0;c<a.length;c++){try{b=a[c]();}catch(d){continue}break}if(!b)throw Error(\"XMLHttpRequest is not supported\");return b},a.fetch=function(b,c){if(c&&\"function\"!=typeof c&&(c=null),a.IS_NODE)if(c)g.readFile(b,function(a,b){a?c(null):c(\"\"+b);});else try{return g.readFileSync(b)}catch(d){return null}else{var e=a.XHR();if(e.open(\"GET\",b,c?!0:!1),e.setRequestHeader(\"Accept\",\"text/plain\"),\"function\"==typeof e.overrideMimeType&&e.overrideMimeType(\"text/plain\"),!c)return e.send(null),200==e.status||0==e.status&&\"string\"==typeof e.responseText?e.responseText:null;if(e.onreadystatechange=function(){4==e.readyState&&(200==e.status||0==e.status&&\"string\"==typeof e.responseText?c(e.responseText):c(null));},4==e.readyState)return;e.send(null);}},a.toCamelCase=function(a){return a.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},a}(),e.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g},e.DotProto=function(a,b){function h(a,c){var d=-1,e=1;if(\"-\"==a.charAt(0)&&(e=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))d=parseInt(a);else if(b.NUMBER_HEX.test(a))d=parseInt(a.substring(2),16);else{if(!b.NUMBER_OCT.test(a))throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);d=parseInt(a.substring(1),8);}if(d=0|e*d,!c&&0>d)throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);return d}function i(a){var c=1;if(\"-\"==a.charAt(0)&&(c=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))return c*parseInt(a,10);if(b.NUMBER_HEX.test(a))return c*parseInt(a.substring(2),16);if(b.NUMBER_OCT.test(a))return c*parseInt(a.substring(1),8);if(\"inf\"===a)return 1/0*c;if(\"nan\"===a)return 0/0;if(b.NUMBER_FLT.test(a))return c*parseFloat(a);throw Error(\"illegal number value: \"+(0>c?\"-\":\"\")+a)}function j(a,b,c){\"undefined\"==typeof a[b]?a[b]=c:(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(c));}var f,g,c={},d=function(a){this.source=a+\"\",this.index=0,this.line=1,this.stack=[],this._stringOpen=null;},e=d.prototype;return e._readString=function(){var c,a='\"'===this._stringOpen?b.STRING_DQ:b.STRING_SQ;if(a.lastIndex=this.index-1,c=a.exec(this.source),!c)throw Error(\"unterminated string\");return this.index=a.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,c[1]},e.next=function(){var a,c,d,e,f,g;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(a=!1;b.WHITESPACE.test(d=this.source.charAt(this.index));)if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;if(\"/\"===this.source.charAt(this.index))if(++this.index,\"/\"===this.source.charAt(this.index)){for(;\"\\n\"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,a=!0;}else{if(\"*\"!==(d=this.source.charAt(this.index)))return \"/\";do{if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;c=d,d=this.source.charAt(this.index);}while(\"*\"!==c||\"/\"!==d);++this.index,a=!0;}}while(a);if(this.index===this.source.length)return null;if(e=this.index,b.DELIM.lastIndex=0,f=b.DELIM.test(this.source.charAt(e++)),!f)for(;e<this.source.length&&!b.DELIM.test(this.source.charAt(e));)++e;return g=this.source.substring(this.index,this.index=e),('\"'===g||\"'\"===g)&&(this._stringOpen=g),g},e.peek=function(){if(0===this.stack.length){var a=this.next();if(null===a)return null;this.stack.push(a);}return this.stack[0]},e.skip=function(a){var b=this.next();if(b!==a)throw Error(\"illegal '\"+b+\"', '\"+a+\"' expected\")},e.omit=function(a){return this.peek()===a?(this.next(),!0):!1},e.toString=function(){return \"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"},c.Tokenizer=d,f=function(a){this.tn=new d(a),this.proto3=!1;},g=f.prototype,g.parse=function(){var c,a={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]},d=!0;try{for(;c=this.tn.next();)switch(c){case\"package\":if(!d||null!==a[\"package\"])throw Error(\"unexpected 'package'\");if(c=this.tn.next(),!b.TYPEREF.test(c))throw Error(\"illegal package name: \"+c);this.tn.skip(\";\"),a[\"package\"]=c;break;case\"import\":if(!d)throw Error(\"unexpected 'import'\");c=this.tn.peek(),\"public\"===c&&this.tn.next(),c=this._readString(),this.tn.skip(\";\"),a.imports.push(c);break;case\"syntax\":if(!d)throw Error(\"unexpected 'syntax'\");this.tn.skip(\"=\"),\"proto3\"===(a.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(\";\");break;case\"message\":this._parseMessage(a,null),d=!1;break;case\"enum\":this._parseEnum(a),d=!1;break;case\"option\":this._parseOption(a);break;case\"service\":this._parseService(a);break;case\"extend\":this._parseExtend(a);break;default:throw Error(\"unexpected '\"+c+\"'\")}}catch(e){throw e.message=\"Parse error at line \"+this.tn.line+\": \"+e.message,e}return delete a.name,a},f.parse=function(a){return new f(a).parse()},g._readString=function(){var b,c,a=\"\";do{if(c=this.tn.next(),\"'\"!==c&&'\"'!==c)throw Error(\"illegal string delimiter: \"+c);a+=this.tn.next(),this.tn.skip(c),b=this.tn.peek();}while('\"'===b||'\"'===b);return a},g._readValue=function(a){var c=this.tn.peek();if('\"'===c||\"'\"===c)return this._readString();if(this.tn.next(),b.NUMBER.test(c))return i(c);if(b.BOOL.test(c))return \"true\"===c.toLowerCase();if(a&&b.TYPEREF.test(c))return c;throw Error(\"illegal value: \"+c)},g._parseOption=function(a,c){var f,d=this.tn.next(),e=!1;if(\"(\"===d&&(e=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal option name: \"+d);f=d,e&&(this.tn.skip(\")\"),f=\"(\"+f+\")\",d=this.tn.peek(),b.FQTYPEREF.test(d)&&(f+=d,this.tn.next())),this.tn.skip(\"=\"),this._parseOptionValue(a,f),c||this.tn.skip(\";\");},g._parseOptionValue=function(a,c){var d=this.tn.peek();if(\"{\"!==d)j(a.options,c,this._readValue(!0));else for(this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());){if(!b.NAME.test(d))throw Error(\"illegal option name: \"+c+\".\"+d);this.tn.omit(\":\")?j(a.options,c+\".\"+d,this._readValue(!0)):this._parseOptionValue(a,c+\".\"+d);}},g._parseService=function(a){var d,e,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal service name at line \"+this.tn.line+\": \"+c);for(d=c,e={name:d,rpc:{},options:{}},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(\"option\"===c)this._parseOption(e);else{if(\"rpc\"!==c)throw Error(\"illegal service token: \"+c);this._parseServiceRPC(e);}this.tn.omit(\";\"),a.services.push(e);},g._parseServiceRPC=function(a){var e,f,c=\"rpc\",d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal rpc service method name: \"+d);if(e=d,f={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.request_stream=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal rpc service request type: \"+d);if(f.request=d,this.tn.skip(\")\"),d=this.tn.next(),\"returns\"!==d.toLowerCase())throw Error(\"illegal rpc service request type delimiter: \"+d);if(this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.response_stream=!0,d=this.tn.next()),f.response=d,this.tn.skip(\")\"),d=this.tn.peek(),\"{\"===d){for(this.tn.next();\"}\"!==(d=this.tn.next());){if(\"option\"!==d)throw Error(\"illegal rpc service token: \"+d);this._parseOption(f);}this.tn.omit(\";\");}else this.tn.skip(\";\");\"undefined\"==typeof a[c]&&(a[c]={}),a[c][e]=f;},g._parseMessage=function(a,c){var d=!!c,e=this.tn.next(),f={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!b.NAME.test(e))throw Error(\"illegal \"+(d?\"group\":\"message\")+\" name: \"+e);for(f.name=e,d&&(this.tn.skip(\"=\"),c.id=h(this.tn.next()),f.isGroup=!0),e=this.tn.peek(),\"[\"===e&&c&&this._parseFieldOptions(c),this.tn.skip(\"{\");\"}\"!==(e=this.tn.next());)if(b.RULE.test(e))this._parseMessageField(f,e);else if(\"oneof\"===e)this._parseMessageOneOf(f);else if(\"enum\"===e)this._parseEnum(f);else if(\"message\"===e)this._parseMessage(f);else if(\"option\"===e)this._parseOption(f);else if(\"service\"===e)this._parseService(f);else if(\"extensions\"===e)f.extensions=this._parseExtensionRanges();else if(\"reserved\"===e)this._parseIgnored();else if(\"extend\"===e)this._parseExtend(f);else{if(!b.TYPEREF.test(e))throw Error(\"illegal message token: \"+e);if(!this.proto3)throw Error(\"illegal field rule: \"+e);this._parseMessageField(f,\"optional\",e);}return this.tn.omit(\";\"),a.messages.push(f),f},g._parseIgnored=function(){for(;\";\"!==this.tn.peek();)this.tn.next();this.tn.skip(\";\");},g._parseMessageField=function(a,c,d){var e,f,g;if(!b.RULE.test(c))throw Error(\"illegal message field rule: \"+c);if(e={rule:c,type:\"\",name:\"\",options:{},id:0},\"map\"===c){if(d)throw Error(\"illegal type: \"+d);if(this.tn.skip(\"<\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field type: \"+f);if(e.keytype=f,this.tn.skip(\",\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field: \"+f);if(e.type=f,this.tn.skip(\">\"),f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}else if(d=\"undefined\"!=typeof d?d:this.tn.next(),\"group\"===d){if(g=this._parseMessage(a,e),!/^[A-Z]/.test(g.name))throw Error(\"illegal group name: \"+g.name);e.type=g.name,e.name=g.name.toLowerCase(),this.tn.omit(\";\");}else{if(!b.TYPE.test(d)&&!b.TYPEREF.test(d))throw Error(\"illegal message field type: \"+d);if(e.type=d,f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);\n  e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}return a.fields.push(e),e},g._parseMessageOneOf=function(a){var e,d,f,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal oneof name: \"+c);for(d=c,f=[],this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)e=this._parseMessageField(a,\"optional\",c),e.oneof=d,f.push(e.id);this.tn.omit(\";\"),a.oneofs[d]=f;},g._parseFieldOptions=function(a){this.tn.skip(\"[\");for(var b,c=!0;\"]\"!==(b=this.tn.peek());)c||this.tn.skip(\",\"),this._parseOption(a,!0),c=!1;this.tn.next();},g._parseEnum=function(a){var e,c={name:\"\",values:[],options:{}},d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);for(c.name=d,this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());)if(\"option\"===d)this._parseOption(c);else{if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);this.tn.skip(\"=\"),e={name:d,id:h(this.tn.next(),!0)},d=this.tn.peek(),\"[\"===d&&this._parseFieldOptions({options:{}}),this.tn.skip(\";\"),c.values.push(e);}this.tn.omit(\";\"),a.enums.push(c);},g._parseExtensionRanges=function(){var c,d,e,b=[];do{for(d=[];;){switch(c=this.tn.next()){case\"min\":e=a.ID_MIN;break;case\"max\":e=a.ID_MAX;break;default:e=i(c);}if(d.push(e),2===d.length)break;if(\"to\"!==this.tn.peek()){d.push(e);break}this.tn.next();}b.push(d);}while(this.tn.omit(\",\"));return this.tn.skip(\";\"),b},g._parseExtend=function(a){var d,c=this.tn.next();if(!b.TYPEREF.test(c))throw Error(\"illegal extend reference: \"+c);for(d={ref:c,fields:[]},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(b.RULE.test(c))this._parseMessageField(d,c);else{if(!b.TYPEREF.test(c))throw Error(\"illegal extend token: \"+c);if(!this.proto3)throw Error(\"illegal field rule: \"+c);this._parseMessageField(d,\"optional\",c);}return this.tn.omit(\";\"),a.messages.push(d),d},g.toString=function(){return \"Parser at line \"+this.tn.line},c.Parser=f,c}(e,e.Lang),e.Reflect=function(a){function k(b){if(\"string\"==typeof b&&(b=a.TYPES[b]),\"undefined\"==typeof b.defaultValue)throw Error(\"default value for type \"+b.name+\" is not supported\");return b==a.TYPES.bytes?new f(0):b.defaultValue}function l(b,c){if(b&&\"number\"==typeof b.low&&\"number\"==typeof b.high&&\"boolean\"==typeof b.unsigned&&b.low===b.low&&b.high===b.high)return new a.Long(b.low,b.high,\"undefined\"==typeof c?b.unsigned:c);if(\"string\"==typeof b)return a.Long.fromString(b,c||!1,10);if(\"number\"==typeof b)return a.Long.fromNumber(b,c||!1);throw Error(\"not convertible to Long\")}function o(b,c){var d=c.readVarint32(),e=7&d,f=d>>>3;switch(e){case a.WIRE_TYPES.VARINT:do d=c.readUint8();while(128===(128&d));break;case a.WIRE_TYPES.BITS64:c.offset+=8;break;case a.WIRE_TYPES.LDELIM:d=c.readVarint32(),c.offset+=d;break;case a.WIRE_TYPES.STARTGROUP:o(f,c);break;case a.WIRE_TYPES.ENDGROUP:if(f===b)return !1;throw Error(\"Illegal GROUPEND after unknown group: \"+f+\" (\"+b+\" expected)\");case a.WIRE_TYPES.BITS32:c.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+b+\": \"+e)}return !0}var g,h,i,j,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,c={},d=function(a,b,c){this.builder=a,this.parent=b,this.name=c,this.className;},e=d.prototype;return e.fqn=function(){for(var a=this.name,b=this;;){if(b=b.parent,null==b)break;a=b.name+\".\"+a;}return a},e.toString=function(a){return (a?this.className+\" \":\"\")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+\" cannot be built directly\")},c.T=d,g=function(a,b,c,e,f){d.call(this,a,b,c),this.className=\"Namespace\",this.children=[],this.options=e||{},this.syntax=f||\"proto2\";},h=g.prototype=Object.create(d.prototype),h.getChildren=function(a){var b,c,d;if(a=a||null,null==a)return this.children.slice();for(b=[],c=0,d=this.children.length;d>c;++c)this.children[c]instanceof a&&b.push(this.children[c]);return b},h.addChild=function(a){var b;if(b=this.getChild(a.name))if(b instanceof m.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else{if(!(a instanceof m.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName)))throw Error(\"Duplicate name in namespace \"+this.toString(!0)+\": \"+a.name);a.name=a.originalName;}this.children.push(a);},h.getChild=function(a){var c,d,b=\"number\"==typeof a?\"id\":\"name\";for(c=0,d=this.children.length;d>c;++c)if(this.children[c][b]===a)return this.children[c];return null},h.resolve=function(a,b){var g,d=\"string\"==typeof a?a.split(\".\"):a,e=this,f=0;if(\"\"===d[f]){for(;null!==e.parent;)e=e.parent;f++;}do{do{if(!(e instanceof c.Namespace)){e=null;break}if(g=e.getChild(d[f]),!(g&&g instanceof c.T&&(!b||g instanceof c.Namespace))){e=null;break}e=g,f++;}while(f<d.length);if(null!=e)break;if(null!==this.parent)return this.parent.resolve(a,b)}while(null!=e);return e},h.qn=function(a){var e,f,b=[],d=a;do b.unshift(d.name),d=d.parent;while(null!==d);for(e=1;e<=b.length;e++)if(f=b.slice(b.length-e),a===this.resolve(f,a instanceof c.Namespace))return f.join(\".\");return a.fqn()},h.build=function(){var e,c,d,a={},b=this.children;for(c=0,d=b.length;d>c;++c)e=b[c],e instanceof g&&(a[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(a,\"$options\",{value:this.buildOpt()}),a},h.buildOpt=function(){var c,d,e,f,a={},b=Object.keys(this.options);for(c=0,d=b.length;d>c;++c)e=b[c],f=this.options[b[c]],a[e]=f;return a},h.getOption=function(a){return \"undefined\"==typeof a?this.options:\"undefined\"!=typeof this.options[a]?this.options[a]:null},c.Namespace=g,i=function(b,c,d,e){if(this.type=b,this.resolvedType=c,this.isMapKey=d,this.syntax=e,d&&a.MAP_KEY_TYPES.indexOf(b)<0)throw Error(\"Invalid map key type: \"+b.name)},j=i.prototype,i.defaultFieldValue=k,j.verifyValue=function(c){var f,g,h,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this);switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),c>4294967295?0|c:c;case a.TYPES.uint32:case a.TYPES.fixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),0>c?c>>>0:c;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if(a.Long)try{return l(c,!1)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.uint64:case a.TYPES.fixed64:if(a.Long)try{return l(c,!0)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.bool:return \"boolean\"!=typeof c&&d(typeof c,\"not a boolean\"),c;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return \"number\"!=typeof c&&d(typeof c,\"not a number\"),c;case a.TYPES.string:return \"string\"==typeof c||c&&c instanceof String||d(typeof c,\"not a string\"),\"\"+c;case a.TYPES.bytes:return b.isByteBuffer(c)?c:b.wrap(c);case a.TYPES[\"enum\"]:for(f=this.resolvedType.getChildren(a.Reflect.Enum.Value),h=0;h<f.length;h++){if(f[h].name==c)return f[h].id;if(f[h].id==c)return f[h].id}if(\"proto3\"===this.syntax)return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),(c>4294967295||0>c)&&d(typeof c,\"not in range for uint32\"),c;d(c,\"not a valid enum value\");case a.TYPES.group:case a.TYPES.message:if(c&&\"object\"==typeof c||d(typeof c,\"object expected\"),c instanceof this.resolvedType.clazz)return c;if(c instanceof a.Builder.Message){g={};for(h in c)c.hasOwnProperty(h)&&(g[h]=c[h]);c=g;}return new this.resolvedType.clazz(c)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(!0)+\": \"+c+\" (undefined type \"+this.type+\")\")},j.calculateLength=function(b,c){if(null===c)return 0;var d;switch(this.type){case a.TYPES.int32:return 0>c?f.calculateVarint64(c):f.calculateVarint32(c);case a.TYPES.uint32:return f.calculateVarint32(c);case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c));case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES[\"float\"]:return 4;case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c);case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c));case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8;case a.TYPES.bool:return 1;case a.TYPES[\"enum\"]:return f.calculateVarint32(c);case a.TYPES[\"double\"]:return 8;case a.TYPES.string:return d=f.calculateUTF8Bytes(c),f.calculateVarint32(d)+d;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");return f.calculateVarint32(c.remaining())+c.remaining();case a.TYPES.message:return d=this.resolvedType.calculate(c),f.calculateVarint32(d)+d;case a.TYPES.group:return d=this.resolvedType.calculate(c),d+f.calculateVarint32(b<<3|a.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")},j.encodeValue=function(b,c,d){var e,g;if(null===c)return d;switch(this.type){case a.TYPES.int32:0>c?d.writeVarint64(c):d.writeVarint32(c);break;case a.TYPES.uint32:d.writeVarint32(c);break;case a.TYPES.sint32:d.writeVarint32ZigZag(c);break;case a.TYPES.fixed32:d.writeUint32(c);break;case a.TYPES.sfixed32:d.writeInt32(c);break;case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c);break;case a.TYPES.sint64:d.writeVarint64ZigZag(c);break;case a.TYPES.fixed64:d.writeUint64(c);break;case a.TYPES.sfixed64:d.writeInt64(c);break;case a.TYPES.bool:\"string\"==typeof c?d.writeVarint32(\"false\"===c.toLowerCase()?0:!!c):d.writeVarint32(c?1:0);break;case a.TYPES[\"enum\"]:d.writeVarint32(c);break;case a.TYPES[\"float\"]:d.writeFloat32(c);break;case a.TYPES[\"double\"]:d.writeFloat64(c);break;case a.TYPES.string:d.writeVString(c);break;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");e=c.offset,d.writeVarint32(c.remaining()),d.append(c),c.offset=e;break;case a.TYPES.message:g=(new f).LE(),this.resolvedType.encode(c,g),d.writeVarint32(g.offset),d.append(g.flip());break;case a.TYPES.group:this.resolvedType.encode(c,d),d.writeVarint32(b<<3|a.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")}return d},j.decode=function(b,c,d){if(c!=this.type.wireType)throw Error(\"Unexpected wire type for element\");var e,f;switch(this.type){case a.TYPES.int32:return 0|b.readVarint32();case a.TYPES.uint32:return b.readVarint32()>>>0;case a.TYPES.sint32:return 0|b.readVarint32ZigZag();case a.TYPES.fixed32:return b.readUint32()>>>0;case a.TYPES.sfixed32:return 0|b.readInt32();case a.TYPES.int64:return b.readVarint64();case a.TYPES.uint64:return b.readVarint64().toUnsigned();case a.TYPES.sint64:return b.readVarint64ZigZag();case a.TYPES.fixed64:return b.readUint64();case a.TYPES.sfixed64:return b.readInt64();case a.TYPES.bool:return !!b.readVarint32();case a.TYPES[\"enum\"]:return b.readVarint32();case a.TYPES[\"float\"]:return b.readFloat();case a.TYPES[\"double\"]:return b.readDouble();case a.TYPES.string:return b.readVString();case a.TYPES.bytes:if(f=b.readVarint32(),b.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+b.remaining());return e=b.clone(),e.limit=e.offset+f,b.offset+=f,e;case a.TYPES.message:return f=b.readVarint32(),this.resolvedType.decode(b,f);case a.TYPES.group:return this.resolvedType.decode(b,-1,d)}throw Error(\"[INTERNAL] Illegal decode type\")},j.valueFromString=function(b){if(!this.isMapKey)throw Error(\"valueFromString() called on non-map-key element\");switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b));case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b);case a.TYPES.bool:return \"true\"===b;case a.TYPES.string:return this.verifyValue(b);case a.TYPES.bytes:return f.fromBinary(b)}},j.valueToString=function(b){if(!this.isMapKey)throw Error(\"valueToString() called on non-map-key element\");return this.type===a.TYPES.bytes?b.toString(\"binary\"):b.toString()},c.Element=i,m=function(a,b,c,d,e,f){g.call(this,a,b,c,d,f),this.className=\"Message\",this.extensions=void 0,this.clazz=null,this.isGroup=!!e,this._fields=null,this._fieldsById=null,this._fieldsByName=null;},n=m.prototype=Object.create(g.prototype),n.build=function(c){var d,h,e,g;if(this.clazz&&!c)return this.clazz;for(d=function(a,c){function k(b,c,d,e){var g,h,i,j,l,m,n;if(null===b||\"object\"!=typeof b)return e&&e instanceof a.Reflect.Enum&&(g=a.Reflect.Enum.getName(e.object,b),null!==g)?g:b;if(f.isByteBuffer(b))return c?b.toBase64():b.toBuffer();if(a.Long.isLong(b))return d?b.toString():a.Long.fromValue(b);if(Array.isArray(b))return h=[],b.forEach(function(a,b){h[b]=k(a,c,d,e);}),h;if(h={},b instanceof a.Map){for(i=b.entries(),j=i.next();!j.done;j=i.next())h[b.keyElem.valueToString(j.value[0])]=k(j.value[1],c,d,b.valueElem.resolvedType);return h}l=b.$type,m=void 0;for(n in b)b.hasOwnProperty(n)&&(h[n]=l&&(m=l.getChild(n))?k(b[n],c,d,m.resolvedType):k(b[n],c,d));return h}var i,j,d=c.getChildren(a.Reflect.Message.Field),e=c.getChildren(a.Reflect.Message.OneOf),g=function(b){var i,j,k,l;for(a.Builder.Message.call(this),i=0,j=e.length;j>i;++i)this[e[i].name]=null;for(i=0,j=d.length;j>i;++i)k=d[i],this[k.name]=k.repeated?[]:k.map?new a.Map(k):null,!k.required&&\"proto3\"!==c.syntax||null===k.defaultValue||(this[k.name]=k.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===b||\"object\"!=typeof b||!(\"function\"!=typeof b.encode||b instanceof g)||Array.isArray(b)||b instanceof a.Map||f.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(i=0,j=arguments.length;j>i;++i)\"undefined\"!=typeof(l=arguments[i])&&this.$set(d[i].name,l);else this.$set(b);},h=g.prototype=Object.create(a.Builder.Message.prototype);for(h.add=function(b,d,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+\"#\"+b+\" is undefined\");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+f.toString(!0));if(!f.repeated)throw Error(this+\"#\"+b+\" is not a repeated field\");d=f.verifyValue(d,!0);}return null===this[b]&&(this[b]=[]),this[b].push(d),this},h.$add=h.add,h.set=function(b,d,e){var f,g,h;if(b&&\"object\"==typeof b){e=d;for(f in b)b.hasOwnProperty(f)&&\"undefined\"!=typeof(d=b[f])&&this.$set(f,d,e);return this}if(g=c._fieldsByName[b],e)this[b]=d;else{if(!g)throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(g instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+g.toString(!0));this[g.name]=d=g.verifyValue(d);}return g&&g.oneof&&(h=this[g.oneof.name],null!==d?(null!==h&&h!==g.name&&(this[h]=null),this[g.oneof.name]=g.name):h===b&&(this[g.oneof.name]=null)),this},h.$set=h.set,h.get=function(b,d){if(d)return this[b];var e=c._fieldsByName[b];if(!(e&&e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+e.toString(!0));return this[e.name]},h.$get=h.get,i=0;i<d.length;i++)j=d[i],j instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var d,e,f,b=a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace(\"_\",\"\")});b=b.substring(0,1).toUpperCase()+b.substring(1),d=a.originalName.replace(/([A-Z])/g,function(a){return \"_\"+a}),e=function(b,c){return this[a.name]=c?b:a.verifyValue(b),this},f=function(){return this[a.name]},null===c.getChild(\"set\"+b)&&(h[\"set\"+b]=e),null===c.getChild(\"set_\"+d)&&(h[\"set_\"+d]=e),null===c.getChild(\"get\"+b)&&(h[\"get\"+b]=f),null===c.getChild(\"get_\"+d)&&(h[\"get_\"+d]=f);}(j);return h.encode=function(a,d){var e,f;\"boolean\"==typeof a&&(d=a,a=void 0),e=!1,a||(a=new b,e=!0),f=a.littleEndian;try{return c.encode(this,a.LE(),d),(e?a.flip():a).LE(f)}catch(g){throw a.LE(f),g}},g.encode=function(a,b,c){return new g(a).encode(b,c)},h.calculate=function(){return c.calculate(this)},h.encodeDelimited=function(a){var d,b=!1;return a||(a=new f,b=!0),d=(new f).LE(),c.encode(this,d).flip(),a.writeVarint32(d.remaining()),a.append(d),b?a.flip():a},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toArrayBuffer()),a}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a}},h.toHex=h.encodeHex,h.toRaw=function(a,b){return k(this,!!a,!!b,this.$type)},h.encodeJSON=function(){return JSON.stringify(k(this,!0,!0,this.$type))},g.decode=function(a,b){var d,e;\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),d=a.littleEndian;try{return e=c.decode(a.LE()),a.LE(d),e}catch(g){throw a.LE(d),g}},g.decodeDelimited=function(a,b){var d,e,g;if(\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),a.remaining()<1)return null;if(d=a.offset,e=a.readVarint32(),a.remaining()<e)return a.offset=d,null;try{return g=c.decode(a.slice(a.offset,a.offset+e).LE()),a.offset+=e,g}catch(h){throw a.offset+=e,h}},g.decode64=function(a){return g.decode(a,\"base64\")},g.decodeHex=function(a){return g.decode(a,\"hex\")},g.decodeJSON=function(a){return new g(JSON.parse(a))},h.toString=function(){return c.toString()},Object.defineProperty&&(Object.defineProperty(g,\"$options\",{value:c.buildOpt()}),Object.defineProperty(h,\"$options\",{value:g[\"$options\"]}),Object.defineProperty(g,\"$type\",{value:c}),Object.defineProperty(h,\"$type\",{value:c})),g}(a,this),this._fields=[],this._fieldsById={},this._fieldsByName={},e=0,g=this.children.length;g>e;e++)if(h=this.children[e],h instanceof t||h instanceof m||h instanceof x){if(d.hasOwnProperty(h.name))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+h.toString(!0)+\" cannot override static property '\"+h.name+\"'\");d[h.name]=h.build();}else if(h instanceof m.Field)h.build(),this._fields.push(h),this._fieldsById[h.id]=h,this._fieldsByName[h.name]=h;else if(!(h instanceof m.OneOf||h instanceof w))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+this.children[e].toString(!0));return this.clazz=d},n.encode=function(a,b,c){var e,h,f,g,i,d=null;for(f=0,g=this._fields.length;g>f;++f)e=this._fields[f],h=a[e.name],e.required&&null===h?null===d&&(d=e):e.encode(c?h:e.verifyValue(h),b,a);if(null!==d)throw i=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+d),i.encoded=b,i;return b},n.calculate=function(a){for(var e,f,b=0,c=0,d=this._fields.length;d>c;++c){if(e=this._fields[c],f=a[e.name],e.required&&null===f)throw Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+e);b+=e.calculate(f,a);}return b},n.decode=function(b,c,d){var g,h,i,j,e,f,k,l,m,n,p,q;for(c=\"number\"==typeof c?c:-1,e=b.offset,f=new this.clazz;b.offset<e+c||-1===c&&b.remaining()>0;){if(g=b.readVarint32(),h=7&g,i=g>>>3,h===a.WIRE_TYPES.ENDGROUP){if(i!==d)throw Error(\"Illegal group end indicator for \"+this.toString(!0)+\": \"+i+\" (\"+(d?d+\" expected\":\"not a group\")+\")\");break}if(j=this._fieldsById[i])j.repeated&&!j.options.packed?f[j.name].push(j.decode(h,b)):j.map?(l=j.decode(h,b),f[j.name].set(l[0],l[1])):(f[j.name]=j.decode(h,b),j.oneof&&(m=f[j.oneof.name],null!==m&&m!==j.name&&(f[m]=null),f[j.oneof.name]=j.name));else switch(h){case a.WIRE_TYPES.VARINT:b.readVarint32();break;case a.WIRE_TYPES.BITS32:b.offset+=4;break;case a.WIRE_TYPES.BITS64:b.offset+=8;break;case a.WIRE_TYPES.LDELIM:k=b.readVarint32(),b.offset+=k;break;case a.WIRE_TYPES.STARTGROUP:for(;o(i,b););break;default:throw Error(\"Illegal wire type for unknown field \"+i+\" in \"+this.toString(!0)+\"#decode: \"+h)}}for(n=0,p=this._fields.length;p>n;++n)if(j=this._fields[n],null===f[j.name])if(\"proto3\"===this.syntax)f[j.name]=j.defaultValue;else{if(j.required)throw q=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+j.name),q.decoded=f,q;a.populateDefaults&&null!==j.defaultValue&&(f[j.name]=j.defaultValue);}return f},c.Message=m,p=function(b,c,e,f,g,h,i,j,k,l){d.call(this,b,c,h),this.className=\"Message.Field\",this.required=\"required\"===e,this.repeated=\"repeated\"===e,this.map=\"map\"===e,this.keyType=f||null,this.type=g,this.resolvedType=null,this.id=i,this.options=j||{},this.defaultValue=null,this.oneof=k||null,this.syntax=l||\"proto2\",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof m.ExtensionField||(this.name=a.Util.toCamelCase(this.name));},q=p.prototype=Object.create(d.prototype),q.build=function(){this.element=new i(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new i(this.keyType,void 0,!0,this.syntax)),\"proto3\"!==this.syntax||this.repeated||this.map?\"undefined\"!=typeof this.options[\"default\"]&&(this.defaultValue=this.verifyValue(this.options[\"default\"])):this.defaultValue=i.defaultFieldValue(this.type);},q.verifyValue=function(b,c){var d,e,f;if(c=c||!1,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this),null===b)return this.required&&d(typeof b,\"required\"),\"proto3\"===this.syntax&&this.type!==a.TYPES.message&&d(typeof b,\"proto3 field without field presence cannot be null\"),null;if(this.repeated&&!c){for(Array.isArray(b)||(b=[b]),f=[],e=0;e<b.length;e++)f.push(this.element.verifyValue(b[e]));return f}return this.map&&!c?b instanceof a.Map?b:(b instanceof Object||d(typeof b,\"expected ProtoBuf.Map or raw object for map field\"),new a.Map(this,b)):(!this.repeated&&Array.isArray(b)&&d(typeof b,\"no array expected\"),this.element.verifyValue(b))},q.hasWirePresence=function(b,c){if(\"proto3\"!==this.syntax)return null!==b;if(this.oneof&&c[this.oneof.name]===this.name)return !0;switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return 0!==b;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return 0!==b.low||0!==b.high;case a.TYPES.bool:return b;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return 0!==b;case a.TYPES.string:return b.length>0;case a.TYPES.bytes:return b.remaining()>0;case a.TYPES[\"enum\"]:return 0!==b;case a.TYPES.message:return null!==b;default:return !0}},q.encode=function(b,c,d){var e,g,h,i,j;if(null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return c;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.ensureCapacity(c.offset+=1),g=c.offset,e=0;e<b.length;e++)this.element.encodeValue(this.id,b[e],c);h=c.offset-g,i=f.calculateVarint32(h),i>1&&(j=c.slice(g,c.offset),g+=i-1,c.offset=g,c.append(j)),c.writeVarint32(h,g-i);}else for(e=0;e<b.length;e++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[e],c);else this.map?b.forEach(function(b,d){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.writeVarint32(g),c.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,d,c),c.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,b,c);},this):this.hasWirePresence(b,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,c));}catch(k){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+k+\")\")}return c},q.calculate=function(b,c){var d,e,g;if(b=this.verifyValue(b),null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return 0;d=0;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),g=0,e=0;e<b.length;e++)g+=this.element.calculateLength(this.id,b[e]);d+=f.calculateVarint32(g),d+=g;}else for(e=0;e<b.length;e++)d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b[e]);else this.map?b.forEach(function(b,c){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),d+=f.calculateVarint32(g),d+=g;},this):this.hasWirePresence(b,c)&&(d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b));}catch(h){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+h+\")\")}return d},q.decode=function(b,c,d){var e,f,h,j,k,l,m,g=!this.map&&b==this.type.wireType||!d&&this.repeated&&this.options.packed&&b==a.WIRE_TYPES.LDELIM||this.map&&b==a.WIRE_TYPES.LDELIM;if(!g)throw Error(\"Illegal wire type for field \"+this.toString(!0)+\": \"+b+\" (\"+this.type.wireType+\" expected)\");if(b==a.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!d){for(f=c.readVarint32(),f=c.offset+f,h=[];c.offset<f;)h.push(this.decode(this.type.wireType,c,!0));return h}if(this.map){if(j=i.defaultFieldValue(this.keyType),e=i.defaultFieldValue(this.type),f=c.readVarint32(),c.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+c.remaining());for(k=c.clone(),k.limit=k.offset+f,c.offset+=f;k.remaining()>0;)if(l=k.readVarint32(),b=7&l,m=l>>>3,1===m)j=this.keyElement.decode(k,b,m);else{if(2!==m)throw Error(\"Unexpected tag in map field key/value submessage\");e=this.element.decode(k,b,m);}return [j,e]}return this.element.decode(c,b,this.id)},c.Message.Field=p,r=function(a,b,c,d,e,f,g){p.call(this,a,b,c,null,d,e,f,g),this.extension;},r.prototype=Object.create(p.prototype),c.Message.ExtensionField=r,s=function(a,b,c){d.call(this,a,b,c),this.fields=[];},c.Message.OneOf=s,t=function(a,b,c,d,e){g.call(this,a,b,c,d,e),this.className=\"Enum\",this.object=null;},t.getName=function(a,b){var e,d,c=Object.keys(a);for(d=0;d<c.length;++d)if(a[e=c[d]]===b)return e;return null},u=t.prototype=Object.create(g.prototype),u.build=function(b){var c,d,e,f;if(this.object&&!b)return this.object;for(c=new a.Builder.Enum,d=this.getChildren(t.Value),e=0,f=d.length;f>e;++e)c[d[e][\"name\"]]=d[e][\"id\"];return Object.defineProperty&&Object.defineProperty(c,\"$options\",{value:this.buildOpt(),enumerable:!1}),this.object=c},c.Enum=t,v=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Enum.Value\",this.id=e;},v.prototype=Object.create(d.prototype),c.Enum.Value=v,w=function(a,b,c,e){d.call(this,a,b,c),this.field=e;},w.prototype=Object.create(d.prototype),c.Extension=w,x=function(a,b,c,d){g.call(this,a,b,c,d),this.className=\"Service\",this.clazz=null;},y=x.prototype=Object.create(g.prototype),y.build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(a,b){var g,c=function(b){a.Builder.Service.call(this),this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0);};},d=c.prototype=Object.create(a.Builder.Service.prototype),e=b.getChildren(a.Reflect.Service.RPCMethod);for(g=0;g<e.length;g++)!function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(f.wrap(c));}catch(e){if(!(e instanceof TypeError))throw e}if(null===c||\"object\"!=typeof c)throw Error(\"Illegal arguments\");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c)),this.rpcImpl(a.fqn(),c,function(c,e){if(c)return d(c),void 0;try{e=a.resolvedResponseType.clazz.decode(e);}catch(f){}return e&&e instanceof a.resolvedResponseType.clazz?(d(null,e),void 0):(d(Error(\"Illegal response type received in service method \"+b.name+\"#\"+a.name)),void 0)});}catch(e){setTimeout(d.bind(this,e),0);}},c[a.name]=function(b,d,e){new c(b)[a.name](d,e);},Object.defineProperty&&(Object.defineProperty(c[a.name],\"$options\",{value:a.buildOpt()}),Object.defineProperty(d[a.name],\"$options\",{value:c[a.name][\"$options\"]}));}(e[g]);return Object.defineProperty&&(Object.defineProperty(c,\"$options\",{value:b.buildOpt()}),Object.defineProperty(d,\"$options\",{value:c[\"$options\"]}),Object.defineProperty(c,\"$type\",{value:b}),Object.defineProperty(d,\"$type\",{value:b})),c}(a,this)},c.Service=x,z=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Service.Method\",this.options=e||{};},A=z.prototype=Object.create(d.prototype),A.buildOpt=h.buildOpt,c.Service.Method=z,B=function(a,b,c,d,e,f,g,h){z.call(this,a,b,c,h),this.className=\"Service.RPCMethod\",this.requestName=d,this.responseName=e,this.requestStream=f,this.responseStream=g,this.resolvedRequestType=null,this.resolvedResponseType=null;},B.prototype=Object.create(z.prototype),c.Service.RPCMethod=B,c}(e),e.Builder=function(a,b,c){function f(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax,f(b);}),a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax;});}var d=function(a){this.ns=new c.Namespace(this,null,\"\"),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=a||{};},e=d.prototype;return d.isMessage=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values||\"undefined\"!=typeof a.rpc?!1:!0},d.isMessageField=function(a){return \"string\"!=typeof a.rule||\"string\"!=typeof a.name||\"string\"!=typeof a.type||\"undefined\"==typeof a.id?!1:!0},d.isEnum=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1},d.isService=function(a){return \"string\"==typeof a.name&&\"object\"==typeof a.rpc&&a.rpc?!0:!1},d.isExtend=function(a){return \"string\"!=typeof a.ref?!1:!0},e.reset=function(){return this.ptr=this.ns,this},e.define=function(a){if(\"string\"!=typeof a||!b.TYPEREF.test(a))throw Error(\"illegal namespace: \"+a);return a.split(\".\").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new c.Namespace(this,this.ptr,a)),this.ptr=b;},this),this},e.create=function(b){var e,f,g,h,i;if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice();}else b=[b];for(e=[b];e.length>0;){if(b=e.pop(),!Array.isArray(b))throw Error(\"not a valid namespace: \"+JSON.stringify(b));for(;b.length>0;){if(f=b.shift(),d.isMessage(f)){if(g=new c.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),h={},f.oneofs&&Object.keys(f.oneofs).forEach(function(a){g.addChild(h[a]=new c.Message.OneOf(this,g,a));},this),f.fields&&f.fields.forEach(function(a){if(null!==g.getChild(0|a.id))throw Error(\"duplicate or invalid field id in \"+g.name+\": \"+a.id);if(a.options&&\"object\"!=typeof a.options)throw Error(\"illegal field options in \"+g.name+\"#\"+a.name);var b=null;if(\"string\"==typeof a.oneof&&!(b=h[a.oneof]))throw Error(\"illegal oneof in \"+g.name+\"#\"+a.name+\": \"+a.oneof);a=new c.Message.Field(this,g,a.rule,a.keytype,a.type,a.name,a.id,a.options,b,f.syntax),b&&b.fields.push(a),g.addChild(a);},this),i=[],f.enums&&f.enums.forEach(function(a){i.push(a);}),f.messages&&f.messages.forEach(function(a){i.push(a);}),f.services&&f.services.forEach(function(a){i.push(a);}),f.extensions&&(g.extensions=\"number\"==typeof f.extensions[0]?[f.extensions]:f.extensions),this.ptr.addChild(g),i.length>0){e.push(b),b=i,i=null,this.ptr=g,g=null;continue}i=null;}else if(d.isEnum(f))g=new c.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(a){g.addChild(new c.Enum.Value(this,g,a.name,a.id));},this),this.ptr.addChild(g);else if(d.isService(f))g=new c.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(a){var b=f.rpc[a];g.addChild(new c.Service.RPCMethod(this,g,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options));},this),this.ptr.addChild(g);else{if(!d.isExtend(f))throw Error(\"not a valid definition: \"+JSON.stringify(f));if(g=this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){var d,e,f,h;if(null!==g.getChild(0|b.id))throw Error(\"duplicate extended field id in \"+g.name+\": \"+b.id);\n  if(g.extensions&&(d=!1,g.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(d=!0);}),!d))throw Error(\"illegal extended field id in \"+g.name+\": \"+b.id+\" (not within valid ranges)\");e=b.name,this.options.convertFieldsToCamelCase&&(e=a.Util.toCamelCase(e)),f=new c.Message.ExtensionField(this,g,b.rule,b.type,this.ptr.fqn()+\".\"+e,b.id,b.options),h=new c.Extension(this,this.ptr,b.name,f),f.extension=h,this.ptr.addChild(h),g.addChild(f);},this);else if(!/\\.?google\\.protobuf\\./.test(f.ref))throw Error(\"extended message \"+f.ref+\" is not defined\")}f=null,g=null;}b=null,this.ptr=this.ptr.parent;}return this.resolved=!1,this.result=null,this},e[\"import\"]=function(b,c){var e,g,h,i,j,k,l,m,d=\"/\";if(\"string\"==typeof c){if(a.Util.IS_NODE,this.files[c]===!0)return this.reset();this.files[c]=!0;}else if(\"object\"==typeof c){if(e=c.root,a.Util.IS_NODE,(e.indexOf(\"\\\\\")>=0||c.file.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\"),g=e+d+c.file,this.files[g]===!0)return this.reset();this.files[g]=!0;}if(b.imports&&b.imports.length>0){for(i=!1,\"object\"==typeof c?(this.importRoot=c.root,i=!0,h=this.importRoot,c=c.file,(h.indexOf(\"\\\\\")>=0||c.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\")):\"string\"==typeof c?this.importRoot?h=this.importRoot:c.indexOf(\"/\")>=0?(h=c.replace(/\\/[^\\/]*$/,\"\"),\"\"===h&&(h=\"/\")):c.indexOf(\"\\\\\")>=0?(h=c.replace(/\\\\[^\\\\]*$/,\"\"),d=\"\\\\\"):h=\".\":h=null,j=0;j<b.imports.length;j++)if(\"string\"==typeof b.imports[j]){if(!h)throw Error(\"cannot determine import root\");if(k=b.imports[j],\"google/protobuf/descriptor.proto\"===k)continue;if(k=h+d+k,this.files[k]===!0)continue;if(/\\.proto$/i.test(k)&&!a.DotProto&&(k=k.replace(/\\.proto$/,\".json\")),l=a.Util.fetch(k),null===l)throw Error(\"failed to import '\"+k+\"' in '\"+c+\"': file not found\");/\\.json$/i.test(k)?this[\"import\"](JSON.parse(l+\"\"),k):this[\"import\"](a.DotProto.Parser.parse(l),k);}else c?/\\.(\\w+)$/.test(c)?this[\"import\"](b.imports[j],c.replace(/^(.+)\\.(\\w+)$/,function(a,b,c){return b+\"_import\"+j+\".\"+c})):this[\"import\"](b.imports[j],c+\"_import\"+j):this[\"import\"](b.imports[j]);i&&(this.importRoot=null);}return b[\"package\"]&&this.define(b[\"package\"]),b.syntax&&f(b),m=this.ptr,b.options&&Object.keys(b.options).forEach(function(a){m.options[a]=b.options[a];}),b.messages&&(this.create(b.messages),this.ptr=m),b.enums&&(this.create(b.enums),this.ptr=m),b.services&&(this.create(b.services),this.ptr=m),b[\"extends\"]&&this.create(b[\"extends\"]),this.reset()},e.resolveAll=function(){var d;if(null==this.ptr||\"object\"==typeof this.ptr.type)return this;if(this.ptr instanceof c.Namespace)this.ptr.children.forEach(function(a){this.ptr=a,this.resolveAll();},this);else if(this.ptr instanceof c.Message.Field){if(b.TYPE.test(this.ptr.type))this.ptr.type=a.TYPES[this.ptr.type];else{if(!b.TYPEREF.test(this.ptr.type))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(d=(this.ptr instanceof c.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!d)throw Error(\"unresolvable type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(this.ptr.resolvedType=d,d instanceof c.Enum){if(this.ptr.type=a.TYPES[\"enum\"],\"proto3\"===this.ptr.syntax&&\"proto3\"!==d.syntax)throw Error(\"proto3 message cannot reference proto2 enum\")}else{if(!(d instanceof c.Message))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);this.ptr.type=d.isGroup?a.TYPES.group:a.TYPES.message;}}if(this.ptr.map){if(!b.TYPE.test(this.ptr.keyType))throw Error(\"illegal key type for map field in \"+this.ptr.toString(!0)+\": \"+this.ptr.keyType);this.ptr.keyType=a.TYPES[this.ptr.keyType];}}else if(this.ptr instanceof a.Reflect.Service.Method){if(!(this.ptr instanceof a.Reflect.Service.RPCMethod))throw Error(\"illegal service type in \"+this.ptr.toString(!0));if(d=this.ptr.parent.resolve(this.ptr.requestName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.requestName);if(this.ptr.resolvedRequestType=d,d=this.ptr.parent.resolve(this.ptr.responseName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.responseName);this.ptr.resolvedResponseType=d;}else if(!(this.ptr instanceof a.Reflect.Message.OneOf||this.ptr instanceof a.Reflect.Extension||this.ptr instanceof a.Reflect.Enum.Value))throw Error(\"illegal object in namespace: \"+typeof this.ptr+\": \"+this.ptr);return this.reset()},e.build=function(a){var b,c,d;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!a)return this.result;for(b=\"string\"==typeof a?a.split(\".\"):a,c=this.result,d=0;d<b.length;d++){if(!c[b[d]]){c=null;break}c=c[b[d]];}return c},e.lookup=function(a,b){return a?this.ns.resolve(a,b):this.ns},e.toString=function(){return \"Builder\"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(e,e.Lang,e.Reflect),e.Map=function(a,b){function e(a){var b=0;return {next:function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}}var c=function(a,c){var d,e,f,g;if(!a.map)throw Error(\"field is not a map\");if(this.field=a,this.keyElem=new b.Element(a.keyType,null,!0,a.syntax),this.valueElem=new b.Element(a.type,a.resolvedType,!1,a.syntax),this.map={},Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}}),c)for(d=Object.keys(c),e=0;e<d.length;e++)f=this.keyElem.valueFromString(d[e]),g=this.valueElem.verifyValue(c[d[e]]),this.map[this.keyElem.valueToString(f)]={key:f,value:g};},d=c.prototype;return d.clear=function(){this.map={};},d[\"delete\"]=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a)),c=b in this.map;return delete this.map[b],c},d.entries=function(){var d,c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push([(d=this.map[b[c]]).key,d.value]);return e(a)},d.keys=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].key);return e(a)},d.values=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].value);return e(a)},d.forEach=function(a,b){var e,d,c=Object.keys(this.map);for(d=0;d<c.length;d++)a.call(b,(e=this.map[c[d]]).value,e.key,this);},d.set=function(a,b){var c=this.keyElem.verifyValue(a),d=this.valueElem.verifyValue(b);return this.map[this.keyElem.valueToString(c)]={key:c,value:d},this},d.get=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map?this.map[b].value:void 0},d.has=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map},c}(e,e.Reflect),e.loadProto=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=void 0),e.loadJson(e.DotProto.Parser.parse(a),b,c)},e.protoFromString=e.loadProto,e.loadProtoFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadProto(d,c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadProto(d,c,a)},e.protoFromFile=e.loadProtoFile,e.newBuilder=function(a){return a=a||{},\"undefined\"==typeof a.convertFieldsToCamelCase&&(a.convertFieldsToCamelCase=e.convertFieldsToCamelCase),\"undefined\"==typeof a.populateAccessors&&(a.populateAccessors=e.populateAccessors),new e.Builder(a)},e.loadJson=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=null),b&&\"object\"==typeof b||(b=e.newBuilder()),\"string\"==typeof a&&(a=JSON.parse(a)),b[\"import\"](a,c),b.resolveAll(),b},e.loadJsonFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadJson(JSON.parse(d),c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadJson(JSON.parse(d),c,a)},h=a,i=e.loadProto(h,void 0,\"\").build(\"Modules\").probuf}(d,c,b);return e}\n\n  var SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message \" + PBName.SetUserStatusInput + \"\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \" + PBName.NotifyMsg + \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SyncRequestMsg + \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \" + PBName.UpStreamMessage + \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n  }\\n  message \" + PBName.DownStreamMessages + \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \" + PBName.DownStreamMessage + \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = \" + FILE_TYPE.IMAGE + \";\\n    audio = \" + FILE_TYPE.AUDIO + \";\\n    video = \" + FILE_TYPE.VIDEO + \";\\n    file = \" + FILE_TYPE.FILE + \";\\n  }\\n  message \" + PBName.GetQNupTokenInput + \" {\\n    required FileType type = 1;\\n    optional string key = 2;\\n  }\\n  message \" + PBName.GetQNdownloadUrlInput + \" {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message \" + PBName.GetQNupTokenOutput + \" {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n    optional string bosToken = 3;\\n    optional string bosDate = 4;\\n    optional string path = 5;\\n  }\\n  message \" + PBName.GetQNdownloadUrlOutput + \" {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \" + PBName.ChrmInput + \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.ChrmPullMsg + \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.RelationQryInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \" + PBName.RelationsInput + \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \" + PBName.RelationsOutput + \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \" + PBName.CleanHisMsgInput + \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \" + PBName.QueryChatRoomInfoInput + \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \" + PBName.QueryChatRoomInfoOutput + \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message \" + PBName.MCFollowInput + \"\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \" + PBName.HistoryMsgInput + \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \" + PBName.HistoryMsgOuput + \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message \" + PBName.RtcQueryListInput + \"{\\n    optional int32 order=1;\\n  }\\n\\n  message \" + PBName.RtcKeyDeleteInput + \"{\\n    repeated string key=1;\\n  }\\n\\n  message \" + PBName.RtcValueInfo + \"{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated \" + PBName.RtcValueInfo + \" userData=2;\\n  }\\n\\n  message \" + PBName.RtcUserListOutput + \"{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n    optional string sessionId=3;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated \" + PBName.RtcValueInfo + \" roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message \" + PBName.RtcInput + \"{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message \" + PBName.RtcQryOutput + \"{\\n    repeated \" + PBName.RtcValueInfo + \" outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message \" + PBName.RtcDataInput + \"{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message \" + PBName.RtcSetDataInput + \"{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message \" + PBName.RtcUserSetDataInput + \" {\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo = 1;\\n    required string objectName = 2;\\n    repeated \" + PBName.RtcValueInfo + \" content = 3;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.RtcTokenOutput + \"{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message \" + PBName.RtcSetOutDataInput + \"{\\n    required targetType target=1;\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message \" + PBName.RtcQryUserOutDataInput + \"{\\n    repeated string userId = 1;\\n  }\\n  message \" + PBName.RtcUserOutDataOutput + \"{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \" + PBName.SessionsAttQryInput + \"{\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.SessionsAttOutput + \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \" + PBName.SessionMsgReadInput + \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteSessionsInput + \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \" + PBName.SessionInfo + \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \" + PBName.DeleteSessionsOutput + \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteMsgInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n  message ChrmKVEntity {\\n    required string key = 1;\\n    required string value = 2;\\n    optional int32 status = 3;\\n    optional int64 timestamp = 4;\\n    optional string uid = 5;\\n  }\\n  message \" + PBName.SetChrmKV + \" {\\n    required ChrmKVEntity entry = 1;\\n    optional bool bNotify = 2;\\n    optional UpStreamMessage notification = 3;\\n    optional ChannelType type = 4;\\n  }\\n  message \" + PBName.ChrmKVOutput + \" {\\n    repeated ChrmKVEntity entries = 1;\\n    optional bool bFullUpdate = 2;\\n    optional int64 syncTime = 3;\\n  }\\n  message \" + PBName.QueryChrmKV + \" {\\n    required int64 timestamp = 1;\\n  }\\n  message \" + PBName.ChrmNotifyMsg + \" {\\t\\n    required int32 type= 1;\\n    optional int64 time= 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SetUserSettingInput + \" {\\n    required int64 version=1;\\n    required string value=2;\\n  }\\n  message \" + PBName.SetUserSettingOutput + \" {\\n    required int64 version=1;\\n    required bool reserve=2;\\n  }\\n  message \" + PBName.PullUserSettingInput + \" {\\n    required int64 version=1;//\\u5F53\\u524D\\u5BA2\\u6237\\u7AEF\\u7684\\u6700\\u5927\\u7248\\u672C\\u53F7\\n    optional bool reserve=2;\\n  }\\n  message \" + PBName.PullUserSettingOutput + \" {\\n    repeated UserSettingItem items = 1;\\n    required int64 version=2;\\n  }\\n  message UserSettingItem {\\n    required string targetId= 1;\\n    required ChannelType type = 2;\\n    required string key = 4;\\n    required bytes value = 5;\\n    required int64 version=6;\\n    required int32 status=7;\\n  }\\n  message \" + PBName.SessionReq + \" {\\n    required int64 time = 1;\\n  }\\n  message \" + PBName.SessionStates + \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \" + PBName.SessionState + \" {\\n    required ChannelType type = 1;\\n    required string channelId = 2;  \\n    optional int64 time = 3;\\n    repeated SessionStateItem stateItem = 4;\\n  }\\n  message \" + PBName.SessionStateItem + \" {\\n    required SessionStateType sessionStateType = 1;\\n    required string value = 2;\\n  }\\n  enum SessionStateType {\\n    IsSilent = 1;\\n    IsTop = 2;\\n  }\\n  message \" + PBName.SessionStateModifyReq + \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \" + PBName.SessionStateModifyResp + \" {\\n    required int64 version=1;\\n  }\\n}\\n\";\n\n  var Codec$1 = {};\n\n  try {\n    Codec$1 = protobuf(SSMsg$1);\n  } catch (e) {\n    Codec$1 = {};\n  }\n\n  Codec$1.getModule = function (pbName) {\n    var modules = new Codec$1[pbName]();\n\n    modules.getArrayData = function () {\n      var data = modules.toArrayBuffer();\n      data = utils.ArrayBufferToArray(data);\n      return data;\n    };\n\n    return modules;\n  };\n\n  var SocketCodec = Codec$1;\n\n  var isGroup$1 = common.isGroup,\n      isChatRoom$1 = common.isChatRoom;\n\n  var Codec$2 = function () {\n    function Codec$$1(option) {\n      this.codec = SocketCodec;\n      option = option || {};\n      var type = option.connectType;\n      type && this.setCodecType(type);\n    }\n\n    var _proto = Codec$$1.prototype;\n\n    _proto.setCodecType = function setCodecType(type) {\n      this.codec = type === CONNECT_TYPE.COMET ? Codec : SocketCodec;\n    };\n\n    _proto.decodeByPBName = function decodeByPBName(data, pbName, option) {\n      var _formatEventMap;\n\n      var self = this;\n      var formatEventMap = (_formatEventMap = {}, _formatEventMap[PBName.DownStreamMessages] = self.formatSyncMessages, _formatEventMap[PBName.DownStreamMessage] = self.formatReceivedMessage, _formatEventMap[PBName.UpStreamMessage] = self.formatSentMessage, _formatEventMap[PBName.HistoryMsgOuput] = self.formatHistoryMessages, _formatEventMap[PBName.RelationsOutput] = self.formatConversationList, _formatEventMap[PBName.QueryChatRoomInfoOutput] = self.formatChatRoomInfos, _formatEventMap[PBName.RtcUserListOutput] = self.formatRTCUserList, _formatEventMap[PBName.RtcQryOutput] = self.formatRTCData, _formatEventMap[PBName.ChrmKVOutput] = self.formatChatRoomKVList, _formatEventMap[PBName.PullUserSettingOutput] = self.formatUserSetting, _formatEventMap[PBName.SessionStates] = self.formatConversationStatus, _formatEventMap);\n      var decodedData = data;\n      var formatEvent = formatEventMap[pbName];\n\n      try {\n        decodedData = self.codec[pbName].decode(data);\n\n        if (utils.isObject(decodedData)) {\n          decodedData = utils.batchInt64ToTimestamp(decodedData);\n        }\n\n        if (utils.isFunction(formatEvent)) {\n          decodedData = formatEvent.call(self, decodedData, option);\n        }\n      } catch (e) {}\n\n      return decodedData;\n    };\n\n    _proto.formatBytes = function formatBytes(content) {\n      try {\n        var _content = content,\n            offset = _content.offset,\n            buffer = _content.buffer,\n            limit = _content.limit;\n\n        if (offset) {\n          content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit);\n          content = BinaryHelper.readUTF(content);\n        }\n\n        content = utils.parseJSON(content);\n      } catch (e) {}\n\n      return content;\n    };\n\n    _proto.formatSyncMessages = function formatSyncMessages(data, option) {\n      option = option || {};\n      var self = this,\n          onMessage = option.onMessage || utils.noop,\n          list = data.list,\n          syncTime = data.syncTime,\n          maxListIndex = list.length - 1;\n      var finished = data.finished;\n\n      if (utils.isUndefined(finished)) {\n        data.finished = finished = true;\n      }\n\n      data.syncTime = utils.int64ToTimestamp(syncTime);\n      data.list = utils.map(list, function (msgData, index) {\n        var message = self.formatReceivedMessage(msgData, option),\n            isLastInAPull = utils.isEqual(index, maxListIndex),\n            isFinished = isLastInAPull && finished;\n\n        try {\n          onMessage({\n            isLastInAPull: isLastInAPull,\n            message: message,\n            finished: isFinished\n          });\n        } catch (e) {\n          utils.consoleError(e);\n        }\n\n        return message;\n      });\n      return data;\n    };\n\n    _proto.formatReceivedMessage = function formatReceivedMessage(data, option) {\n      option = option || {};\n      var self = this;\n\n      var _option = option,\n          currentUserId = _option.currentUserId,\n          connectedTime = _option.connectedTime,\n          content = data.content,\n          fromUserId = data.fromUserId,\n          type = data.type,\n          groupId = data.groupId,\n          status = data.status,\n          dataTime = data.dataTime,\n          messageType = data.classname,\n          messageUId = data.msgId,\n          direction = data.direction || MESSAGE_DIRECTION.RECEIVE,\n          isSelfSend = utils.isEqual(direction, MESSAGE_DIRECTION.SEND),\n          _common$getMessageOpt = common.getMessageOptionByStatus(status),\n          isPersited = _common$getMessageOpt.isPersited,\n          isCounted = _common$getMessageOpt.isCounted,\n          isMentiond = _common$getMessageOpt.isMentiond,\n          disableNotification = _common$getMessageOpt.disableNotification,\n          receivedStatus = _common$getMessageOpt.receivedStatus,\n          targetId = isGroup$1(type) || isChatRoom$1(type) ? groupId : fromUserId,\n          senderUserId = isSelfSend ? currentUserId : fromUserId,\n          sentTime = utils.int64ToTimestamp(dataTime),\n          isOffLineMessage = sentTime < connectedTime,\n          isChatRoomMsg = common.isChatRoom(type);\n\n      var messageDirection = isSelfSend ? MESSAGE_DIRECTION.SEND : MESSAGE_DIRECTION.RECEIVE;\n\n      if (isChatRoomMsg && utils.isEqual(fromUserId, currentUserId)) {\n        messageDirection = MESSAGE_DIRECTION.SEND;\n      }\n\n      var isMentioned = isMentiond;\n      return {\n        type: type,\n        targetId: targetId,\n        senderUserId: senderUserId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        isMentiond: isMentiond,\n        isMentioned: isMentioned,\n        sentTime: sentTime,\n        isOffLineMessage: isOffLineMessage,\n        messageDirection: messageDirection,\n        receivedTime: common.DelayTimer.getTime(),\n        disableNotification: disableNotification,\n        receivedStatus: receivedStatus,\n        content: self.formatBytes(content)\n      };\n    };\n\n    _proto.formatSentMessage = function formatSentMessage(data, option) {\n      var self = this;\n\n      var content = data.content,\n          messageType = data.classname,\n          sessionId = data.sessionId,\n          messageUId = data.msgId,\n          signal = option.signal,\n          currentUserId = option.currentUserId,\n          date = signal.date,\n          topic = signal.topic,\n          targetId = signal.targetId,\n          _common$getUpMessageO = common.getUpMessageOptionBySessionId(sessionId),\n          isPersited = _common$getUpMessageO.isPersited,\n          isCounted = _common$getUpMessageO.isCounted,\n          disableNotification = _common$getUpMessageO.disableNotification,\n          type = PUBLISH_TOPIC_TO_CONVERSATION_TYPE[topic] || CONVERSATION_TYPE.PRIVATE,\n          isStatusMessage = utils.isInclude(PUBLISH_STATUS_TOPIC, topic);\n\n      return {\n        type: type,\n        targetId: targetId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        isStatusMessage: isStatusMessage,\n        senderUserId: currentUserId,\n        content: self.formatBytes(content),\n        sentTime: utils.secondsToMilliseconds(date),\n        receivedTime: common.DelayTimer.getTime(),\n        messageDirection: MESSAGE_DIRECTION.SEND,\n        isOffLineMessage: false,\n        disableNotification: disableNotification\n      };\n    };\n\n    _proto.formatHistoryMessages = function formatHistoryMessages(data, option) {\n      var self = this;\n      var conversation = option.conversation || {},\n          msgList = data.list,\n          hasMsg = data.hasMsg,\n          targetId = conversation.targetId,\n          syncTime = utils.int64ToTimestamp(data.syncTime);\n      var list = [];\n      utils.forEach(msgList, function (msgData) {\n        var msg = self.formatReceivedMessage(msgData, option);\n        msg.targetId = targetId;\n        list.push(msg);\n      }, {\n        isReverse: true\n      });\n      return {\n        syncTime: syncTime,\n        list: list,\n        hasMore: !!hasMsg\n      };\n    };\n\n    _proto.formatConversationList = function formatConversationList(serverData, option) {\n      var self = this;\n      var conversationList = serverData.info;\n      var afterDecode = option.afterDecode || utils.noop;\n      conversationList = utils.map(conversationList, function (serverConversation) {\n        var msg = serverConversation.msg,\n            userId = serverConversation.userId,\n            type = serverConversation.type,\n            unreadCount = serverConversation.unreadCount;\n        msg = self.formatReceivedMessage(msg, option);\n        msg.targetId = userId;\n        var conversation = {\n          targetId: userId,\n          type: type,\n          unreadMessageCount: unreadCount,\n          latestMessage: msg\n        };\n        return afterDecode(conversation) || conversation;\n      });\n      return conversationList || [];\n    };\n\n    _proto.formatChatRoomInfos = function formatChatRoomInfos(data) {\n      var userTotalNums = data.userTotalNums,\n          userInfos = data.userInfos;\n      userInfos = utils.map(userInfos, function (user) {\n        var id = user.id,\n            time = user.time;\n        time = utils.int64ToTimestamp(time);\n        return {\n          id: id,\n          time: time\n        };\n      });\n      return {\n        userCount: userTotalNums,\n        userInfos: userInfos\n      };\n    };\n\n    _proto.formatRTCUserList = function formatRTCUserList(rtcInfos) {\n      var list = rtcInfos.list,\n          token = rtcInfos.token,\n          sessionId = rtcInfos.sessionId;\n      var users = {};\n      utils.forEach(list, function (item) {\n        var userId = item.userId,\n            userData = item.userData;\n        var tmpData = {};\n        utils.forEach(userData, function (data) {\n          var key = data.key,\n              value = data.value;\n          tmpData[key] = value;\n        });\n        users[userId] = tmpData;\n      });\n      return {\n        users: users,\n        token: token,\n        sessionId: sessionId\n      };\n    };\n\n    _proto.formatRTCData = function formatRTCData(data) {\n      var list = data.outInfo;\n      var props = {};\n      utils.forEach(list, function (item) {\n        props[item.key] = item.value;\n      });\n      return props;\n    };\n\n    _proto.formatRTCRoomInfo = function formatRTCRoomInfo(data) {\n      var id = data.roomId,\n          total = data.userCount,\n          roomData = data.roomData;\n      var room = {\n        id: id,\n        total: total\n      };\n      utils.forEach(roomData, function (data) {\n        room[data.key] = data.value;\n      });\n      return room;\n    };\n\n    _proto.formatChatRoomKVList = function formatChatRoomKVList(data) {\n      var kvEntries = data.entries,\n          isFullUpdate = data.bFullUpdate,\n          syncTime = data.syncTime;\n      kvEntries = kvEntries || [];\n      kvEntries = utils.map(kvEntries, function (kv) {\n        var key = kv.key,\n            value = kv.value,\n            status = kv.status,\n            timestamp = kv.timestamp,\n            uid = kv.uid;\n\n        var _common$getChatRoomKV = common.getChatRoomKVByStatus(status),\n            isAutoDelete = _common$getChatRoomKV.isAutoDelete,\n            isOverwrite = _common$getChatRoomKV.isOverwrite,\n            type = _common$getChatRoomKV.type;\n\n        return {\n          key: key,\n          value: value,\n          isAutoDelete: isAutoDelete,\n          isOverwrite: isOverwrite,\n          type: type,\n          userId: uid,\n          timestamp: utils.int64ToTimestamp(timestamp)\n        };\n      });\n      return {\n        kvEntries: kvEntries,\n        isFullUpdate: isFullUpdate,\n        syncTime: syncTime\n      };\n    };\n\n    _proto.formatUserSetting = function formatUserSetting(data) {\n      var self = this;\n      var items = data.items,\n          version = data.version;\n      var settings = {};\n      utils.forEach(items || [], function (setting) {\n        var key = setting.key,\n            version = setting.version,\n            value = setting.value;\n        setting.version = utils.int64ToTimestamp(version);\n        setting.value = self.formatBytes(value);\n        settings[key] = setting;\n      });\n      return {\n        settings: settings,\n        version: version\n      };\n    };\n\n    _proto.formatConversationStatus = function formatConversationStatus(data) {\n      var stateList = data.state;\n      var statusList = [];\n      utils.forEach(stateList, function (session) {\n        var type = session.type,\n            targetId = session.channelId,\n            updatedTime = session.time,\n            stateItem = session.stateItem;\n        var notificationStatus = NOTIFICATION_STATUS.NOTIFY,\n            isTop = false;\n        utils.forEach(stateItem, function (_ref) {\n          var sessionStateType = _ref.sessionStateType,\n              value = _ref.value;\n\n          switch (sessionStateType) {\n            case CONVERSATION_STATUS_TYPE.DO_NOT_DISTURB:\n              notificationStatus = utils.isEqual(value, CONVERSATION_STATUS_CONFIG.ENABLED) ? NOTIFICATION_STATUS.DO_NOT_DISTURB : NOTIFICATION_STATUS.NOTIFY;\n              break;\n\n            case CONVERSATION_STATUS_TYPE.TOP:\n              isTop = utils.isEqual(value, CONVERSATION_STATUS_CONFIG.ENABLED);\n              break;\n\n            default:\n              break;\n          }\n        });\n        statusList.push({\n          type: type,\n          targetId: targetId,\n          notificationStatus: notificationStatus,\n          isTop: isTop,\n          updatedTime: utils.int64ToTimestamp(updatedTime)\n        });\n      });\n      return statusList;\n    };\n\n    _proto.encodeServerConfParams = function encodeServerConfParams() {\n      var modules = this.codec.getModule(PBName.SessionsAttQryInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.getUpMsgModule = function getUpMsgModule(conversation, option) {\n      var type = conversation.type;\n      var messageType = option.messageType,\n          isMentiond = option.isMentiond,\n          mentiondType = option.mentiondType,\n          mentiondUserIdList = option.mentiondUserIdList,\n          content = option.content,\n          pushContent = option.pushContent,\n          pushData = option.pushData,\n          directionalUserIdList = option.directionalUserIdList,\n          isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n          isVoipPush = option.isVoipPush;\n      var isGroupType = common.isGroup(type);\n      var modules = this.codec.getModule(PBName.UpStreamMessage);\n      var sessionId = common.getSessionId(option);\n      var flag = 0;\n      modules.setSessionId(sessionId);\n\n      if (isGroupType && isMentiond && content) {\n        content.mentionedInfo = {\n          userIdList: mentiondUserIdList,\n          type: mentiondType || MENTIOND_TYPE.ALL\n        };\n      }\n\n      pushContent && modules.setPushText(pushContent);\n      pushData && modules.setAppData(pushData);\n      directionalUserIdList && modules.setUserId(directionalUserIdList);\n      flag |= isVoipPush ? 0x01 : 0;\n      flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n      modules.setConfigFlag(flag);\n      modules.setClassname(messageType);\n      modules.setContent(utils.toJSON(content));\n      return modules;\n    };\n\n    _proto.encodeUpMsg = function encodeUpMsg(conversation, option) {\n      var modules = this.getUpMsgModule(conversation, option);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSyncMsg = function encodeSyncMsg(syncMsgArgs) {\n      var sendboxTime = syncMsgArgs.sendboxTime,\n          inboxTime = syncMsgArgs.inboxTime;\n      var modules = this.codec.getModule(PBName.SyncRequestMsg);\n      modules.setIspolling(false);\n      modules.setIsPullSend(true);\n      modules.setSendBoxSyncTime(sendboxTime);\n      modules.setSyncTime(inboxTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeChrmSyncMsg = function encodeChrmSyncMsg(time, count) {\n      time = time || 0;\n      count = count || 0;\n      var modules = this.codec.getModule(PBName.ChrmPullMsg);\n      modules.setCount(count);\n      modules.setSyncTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetHistoryMsg = function encodeGetHistoryMsg(conversation, option) {\n      var targetId = conversation.targetId;\n      var count = option.count,\n          order = option.order,\n          timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.HistoryMsgInput);\n      modules.setTargetId(targetId);\n      modules.setTime(timestrap);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationList = function encodeGetConversationList(option) {\n      option = option || {};\n      var _option2 = option,\n          count = _option2.count,\n          startTime = _option2.startTime;\n      var modules = this.codec.getModule(PBName.RelationQryInput);\n      modules.setType(1);\n      modules.setCount(count);\n      modules.setStartTime(startTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeOldConversationList = function encodeOldConversationList(option) {\n      option = option || {};\n      var _option3 = option,\n          count = _option3.count,\n          type = _option3.type;\n      var modules = this.codec.getModule(PBName.RelationsInput);\n      type = type || CONVERSATION_TYPE.PRIVATE;\n      count = count || 0;\n      modules.setType(type);\n      modules.setCount(count);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveConversationList = function encodeRemoveConversationList(conversationList) {\n      var _this = this;\n\n      var modules = this.codec.getModule(PBName.DeleteSessionsInput);\n      var sessions = [];\n      utils.forEach(conversationList, function (conversation) {\n        var type = conversation.type,\n            targetId = conversation.targetId;\n\n        var session = _this.codec.getModule(PBName.SessionInfo);\n\n        session.setType(type);\n        session.setChannelId(targetId);\n        sessions.push(session);\n      });\n      modules.setSessions(sessions);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeDeleteMessages = function encodeDeleteMessages(conversation, messages) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var modules = this.codec.getModule(PBName.DeleteMsgInput);\n      var encodeMsgs = [];\n      utils.forEach(messages, function (message) {\n        encodeMsgs.push({\n          msgId: message.messageUId,\n          msgDataTime: message.sentTime,\n          direct: message.messageDirection\n        });\n      });\n      modules.setType(type);\n      modules.setConversationId(targetId);\n      modules.setMsgs(encodeMsgs);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearMessages = function encodeClearMessages(conversation, option) {\n      var targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.CleanHisMsgInput);\n      timestrap = timestrap || utils.getCurrentTimestamp();\n      modules.setDataTime(timestrap);\n      modules.setTargetId(targetId);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearUnreadCount = function encodeClearUnreadCount(conversation, option) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.SessionMsgReadInput);\n      timestrap = timestrap || +new Date();\n      modules.setType(type);\n      modules.setChannelId(targetId);\n      modules.setMsgTime(timestrap);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinOrQuitChatRoom = function encodeJoinOrQuitChatRoom() {\n      var modules = this.codec.getModule(PBName.ChrmInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetChatRoomInfo = function encodeGetChatRoomInfo(option) {\n      option = option || {};\n      var _option4 = option,\n          count = _option4.count,\n          order = _option4.order;\n      var modules = this.codec.getModule(PBName.QueryChatRoomInfoInput);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinRTCRoom = function encodeJoinRTCRoom(room) {\n      var mode = room.mode,\n          broadcastType = room.broadcastType;\n      var modules = this.codec.getModule(PBName.RtcInput);\n      mode = mode || 0;\n      modules.setRoomType(mode);\n      !utils.isUndefined(broadcastType) && modules.setBroadcastType(broadcastType);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeQuitRTCRoom = function encodeQuitRTCRoom() {\n      return this.codec.getModule(PBName.SetUserStatusInput).getArrayData();\n    };\n\n    _proto.encodeSetRTCData = function encodeSetRTCData(key, value, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcSetDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(key);\n      modules.setValue(value);\n      message = message || {};\n      var _message = message,\n          name = _message.name,\n          content = _message.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeUserSetRTCData = function encodeUserSetRTCData(message, valueInfo, objectName) {\n      var modules = this.codec.getModule(PBName.RtcUserSetDataInput);\n      modules.setObjectName(objectName);\n      var val = this.codec.getModule(PBName.RtcValueInfo);\n      val.setKey(message.name);\n      val.setValue(message.content);\n      modules.setContent(val);\n      val = this.codec.getModule(PBName.RtcValueInfo);\n      val.setKey('uris');\n      val.setValue(valueInfo);\n      modules.setValueInfo(val);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCData = function encodeGetRTCData(keys, isInner, apiType) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCData = function encodeRemoveRTCData(keys, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      message = message || {};\n      var _message2 = message,\n          name = _message2.name,\n          content = _message2.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCOutData = function encodeSetRTCOutData(data, type, message) {\n      var modules = this.codec.getModule(PBName.RtcSetOutDataInput);\n      modules.setTarget(type);\n\n      if (!utils.isArray(data)) {\n        data = [data];\n      }\n\n      utils.forEach(data, function (item, index) {\n        item.key = item.key ? item.key.toString() : item.key;\n        item.value = item.value ? item.value.toString() : item.value;\n        data[index] = item;\n      });\n      modules.setValueInfo(data);\n      message = message || {};\n      var _message3 = message,\n          name = _message3.name,\n          content = _message3.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.ecnodeGetRTCOutData = function ecnodeGetRTCOutData(userIds) {\n      var modules = this.codec.getModule(PBName.RtcQryUserOutDataInput);\n      modules.setUserId(userIds);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCState = function encodeSetRTCState(content) {\n      var modules = this.codec.getModule(PBName.MCFollowInput);\n      var report = content.report;\n      modules.setId(report);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCRoomInfo = function encodeGetRTCRoomInfo() {\n      var modules = this.codec.getModule(PBName.RtcQueryListInput);\n      modules.setOrder(2);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCUserInfo = function encodeSetRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcValueInfo);\n      var key = info.key,\n          value = info.value;\n      modules.setKey(key);\n      modules.setValue(value);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCUserInfo = function encodeRemoveRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcKeyDeleteInput);\n      var keys = info.keys || [];\n\n      if (!utils.isArray(keys)) {\n        keys = [keys];\n      }\n\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileToken = function encodeGetFileToken(fileType, fileName) {\n      var modules = this.codec.getModule(PBName.GetQNupTokenInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileUrl = function encodeGetFileUrl(fileType, fileName, originName) {\n      var modules = this.codec.getModule(PBName.GetQNdownloadUrlInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n\n      if (originName) {\n        modules.setFileName(originName);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeModifyChatRoomKV = function encodeModifyChatRoomKV(chrm, entry, action, currentUserId) {\n      var modules = this.codec.getModule(PBName.SetChrmKV);\n      var key = entry.key,\n          value = entry.value,\n          extra = entry.notificationExtra,\n          isSendNotification = entry.isSendNotification;\n      var status = common.getChatRoomKVOptStatus(entry, action);\n      var serverEntry = {\n        key: key,\n        status: status,\n        value: value || '',\n        uid: currentUserId\n      };\n\n      if (utils.isEmpty(serverEntry.status)) {\n        delete serverEntry.status;\n      }\n\n      modules.setEntry(serverEntry);\n\n      if (isSendNotification) {\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: chrm.id\n        };\n        var msgContent = {\n          key: key,\n          value: value,\n          extra: extra,\n          type: action\n        };\n        var msgModule = this.getUpMsgModule(conversation, {\n          messageType: MESSAGE_TYPE.CHRM_KV_NOTIFY,\n          content: msgContent,\n          isPersited: false,\n          isCounted: false\n        });\n        modules.setNotification(msgModule);\n        modules.setBNotify(true);\n        modules.setType(CONVERSATION_TYPE.CHATROOM);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullChatRoomKV = function encodePullChatRoomKV(time) {\n      var modules = this.codec.getModule(PBName.QueryChrmKV);\n      modules.setTimestamp(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullUserSetting = function encodePullUserSetting(version) {\n      var modules = this.codec.getModule(PBName.PullUserSettingInput);\n      modules.setVersion(version);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationStatus = function encodeGetConversationStatus(time) {\n      var modules = this.codec.getModule(PBName.SessionReq);\n      modules.setTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetConversationStatus = function encodeSetConversationStatus(statusList) {\n      var _this2 = this;\n\n      var modules = this.codec.getModule(PBName.SessionStateModifyReq),\n          currentTime = common.DelayTimer.getTime();\n      var stateModuleList = [];\n      utils.forEach(statusList, function (status) {\n        var stateModules = _this2.codec.getModule(PBName.SessionState);\n\n        var type = status.type,\n            targetId = status.targetId,\n            notificationStatus = status.notificationStatus,\n            isTop = status.isTop;\n        var stateItemModuleList = [];\n        stateModules.setType(type);\n        stateModules.setChannelId(targetId);\n        stateModules.setTime(currentTime);\n        var isNotDisturb = utils.isEqual(notificationStatus, NOTIFICATION_STATUS.DO_NOT_DISTURB);\n        var TypeToVal = {};\n\n        if (!utils.isUndefined(notificationStatus)) {\n          TypeToVal[CONVERSATION_STATUS_TYPE.DO_NOT_DISTURB] = isNotDisturb;\n        }\n\n        if (!utils.isUndefined(isTop)) {\n          TypeToVal[CONVERSATION_STATUS_TYPE.TOP] = isTop;\n        }\n\n        utils.forEach(TypeToVal, function (val, type) {\n          if (!utils.isUndefined(val)) {\n            var stateItemModules = _this2.codec.getModule(PBName.SessionStateItem);\n\n            val = val ? CONVERSATION_STATUS_CONFIG.ENABLED : CONVERSATION_STATUS_CONFIG.DISABLED;\n            stateItemModules.setSessionStateType(Number(type));\n            stateItemModules.setValue(val);\n            stateItemModuleList.push(stateItemModules);\n          }\n        });\n        stateModules.setStateItem(stateItemModuleList);\n        stateModuleList.push(stateModules);\n      });\n      modules.setVersion(currentTime);\n      modules.setState(stateModuleList);\n      return modules.getArrayData();\n    };\n\n    return Codec$$1;\n  }();\n\n  var DeferHandler$3 = utils.DeferHandler,\n      Defer$2 = utils.Defer;\n  var SignalId$1 = common.SignalId;\n\n  var ServerEngine = function () {\n    function ServerEngine(option) {\n      this._transporter = void 0;\n      this._serverEventEmitter = new utils.EventEmitter();\n      this._deferHandler = new DeferHandler$3();\n      this._serverDataCodec = void 0;\n      this._selfUserId = void 0;\n      this._connectedTime = void 0;\n      this.option = void 0;\n      var self = this;\n      var transporter = new Transporter(option);\n      transporter.watchSignal(function (signal) {\n        self._handleSignal(signal);\n      });\n      transporter.watchStatus(function (status) {\n        Logger.info(TAG.L_NETWORK_CHANGED_S, status);\n\n        self._handleStatus(status);\n      });\n      self._serverDataCodec = new Codec$2(option);\n      utils.extend(self, {\n        _transporter: transporter,\n        option: option\n      });\n    }\n\n    var _proto = ServerEngine.prototype;\n\n    _proto._handleStatus = function _handleStatus(status) {\n      if (common.isDisconnected(status)) {\n        this.disconnect();\n        var currentTime = utils.getCurrentTimestamp();\n        var isDisconnectTooFast = currentTime - this._connectedTime < MINIMUM_CONNECT_DURATION;\n        var NotSwitchStauts = [TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT];\n\n        if (isDisconnectTooFast && !utils.isInclude(NotSwitchStauts, status)) {\n          return this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST);\n        }\n      }\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, status);\n    };\n\n    _proto._handleSignal = function _handleSignal(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var messageId = signal.messageId;\n\n      if (messageId && signal.getIdentifier) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.resolve(deferId, signal);\n      }\n\n      self._handleSignalAck(signal);\n\n      self._dispatchTask(signal);\n    };\n\n    _proto._handleSignalAck = function _handleSignalAck(signal) {\n      var _transporter = this._transporter;\n      var messageId = signal.messageId;\n      var isQosNeedAck = signal._header && signal._header.qos !== QOS.AT_MOST_ONCE;\n\n      if (signal instanceof PublishReader && !signal.syncMsg && isQosNeedAck) {\n        var writer = new PubAckWriter(messageId);\n\n        _transporter.sendSignal(writer);\n      }\n\n      if (signal instanceof QueryAckReader && isQosNeedAck) {\n        var _writer = new QueryConWriter(messageId);\n\n        _transporter.sendSignal(_writer);\n      }\n    };\n\n    _proto._dispatchTask = function _dispatchTask(signal) {\n      var self = this;\n\n      if (signal instanceof DisconnectReader) {\n        var status = signal.status;\n        status = SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS[status] || status;\n        return self._handleStatus(status);\n      }\n\n      if (signal instanceof PublishReader) {\n        var _PUBLISH_TOPIC$NOTIFY;\n\n        var isSyncMsgSentBySelfOtherClient = signal.syncMsg,\n            topic = signal.topic;\n\n        if (isSyncMsgSentBySelfOtherClient) {\n          return self._receiveMsgFromOtherDevice(signal);\n        }\n\n        var task = (_PUBLISH_TOPIC$NOTIFY = {}, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.NOTIFY_PULL_MSG] = self._notifyPullMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.RECEIVE_MSG] = self._notifyDirectMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SERVER_NOTIFY] = self._notifyForServer, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SETTING_NOTIFY] = self._notifySettingChanged, _PUBLISH_TOPIC$NOTIFY)[topic] || utils.noop;\n        task.call(self, signal);\n      }\n    };\n\n    _proto._notifyPullMessage = function _notifyPullMessage(signal) {\n      var notifyPullConfig = this._serverDataCodec.decodeByPBName(signal.data, PBName.NotifyMsg);\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.NOTIFY_PULL, notifyPullConfig);\n    };\n\n    _proto._notifyDirectMessage = function _notifyDirectMessage(signal) {\n      var currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n\n      var msg = this._serverDataCodec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n        currentUserId: currentUserId,\n        connectedTime: connectedTime\n      });\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n    };\n\n    _proto._notifyForServer = function _notifyForServer(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.ChrmNotifyMsg),\n          type = notifyData.type;\n\n      Logger.info(TAG.P_NOTIFY_CHRM_KV_S, notifyData);\n\n      switch (type) {\n        case SERVER_NOTIFY_TYPE.KV_CHANGED:\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_CHANGED, notifyData);\n\n          break;\n\n        case SERVER_NOTIFY_TYPE.CONVERSATION_STATUS_CHANGED:\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED, notifyData.time);\n\n          break;\n\n        default:\n          break;\n      }\n    };\n\n    _proto._notifySettingChanged = function _notifySettingChanged(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.UserSettingNotification);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.USER_SETTING_CHANGED, notifyData);\n    };\n\n    _proto._sendSignal = function _sendSignal(writer, decodePBName, option) {\n      var appkey = this.option.appkey,\n          _serverDataCodec = this._serverDataCodec;\n      var _transporter = this._transporter,\n          _deferHandler = this._deferHandler,\n          currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n      var signalId = SignalId$1.get({\n        appkey: appkey,\n        userId: currentUserId\n      });\n\n      if (SignalId$1.isExceedLimit(signalId)) {\n        this._handleStatus(TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT);\n\n        return utils.Defer.reject(ERROR_INFO.TIMEOUT);\n      }\n\n      writer.messageId = signalId;\n      var deferId = writer.getIdentifier();\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n\n        _transporter.sendSignal(writer);\n      }).then(function (signal) {\n        var status = signal.status,\n            data = signal.data;\n        var isSuccess = utils.isEqual(status, SUCCESS_CODE);\n        var result = isSuccess ? signal : {\n          status: SERVER_ERROR_TO_CODE[status] || status\n        };\n\n        if (isSuccess && decodePBName) {\n          signal.data = _serverDataCodec.decodeByPBName(data, decodePBName, utils.extend({\n            signal: signal,\n            currentUserId: currentUserId,\n            connectedTime: connectedTime\n          }, option));\n        }\n\n        var exec = isSuccess ? Defer$2.resolve : Defer$2.reject;\n        return exec.call(Defer$2, result);\n      });\n    };\n\n    _proto._sendSignalForData = function _sendSignalForData(writer, decodePBName, option) {\n      return this._sendSignal(writer, decodePBName, option).then(function (successSignal) {\n        var data = decodePBName ? successSignal.data : undefined;\n        return data;\n      });\n    };\n\n    _proto._receiveMsgFromOtherDevice = function _receiveMsgFromOtherDevice(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          currentUserId = self._selfUserId,\n          connectType = self.option.connectType,\n          _serverDataCodec = self._serverDataCodec;\n      var isComet = connectType === CONNECT_TYPE.COMET;\n      var data = signal.data,\n          topic = signal.topic;\n\n      var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n        currentUserId: currentUserId,\n        signal: signal\n      });\n\n      if (isComet || msg.isStatusMessage) {\n        msg.sentTime = common.DelayTimer.getTime();\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      }\n\n      return utils.deferred(function (resolve, reject) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (ackSignal) {\n        msg.messageUId = ackSignal.messageUId;\n        msg.sentTime = ackSignal.timestamp;\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      })[\"catch\"](function (error) {\n        Logger.error(TAG.L_DECODE_MSG_E, {\n          content: {\n            info: 'received msg from other device error',\n            error: error,\n            topic: topic\n          }\n        });\n      });\n    };\n\n    _proto.watch = function watch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.off(eventName, event);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporter = self._transporter;\n      return _transporter.connect(user, option).then(function (result) {\n        var isConnectSuccess = utils.isEqual(result.status, SUCCESS_CODE);\n        return isConnectSuccess ? Defer$2.resolve(result) : Defer$2.reject(result);\n      }).then(function (_ref) {\n        var userId = _ref.userId,\n            timestamp = _ref.timestamp;\n        self._selfUserId = userId;\n        self._connectedTime = timestamp;\n        return {\n          id: userId\n        };\n      }, function (_ref2) {\n        var status = _ref2.status;\n        var errorInfo = CONNECT_SERVER_STATUS_MAP_ERROR_INFO[status] || {\n          code: status\n        };\n        return utils.Defer.reject(errorInfo);\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      var appkey = this.option.appkey;\n      var _transporter = this._transporter,\n          _selfUserId = this._selfUserId;\n      _transporter && _transporter.disconnect();\n      SignalId$1.clear({\n        appkey: appkey,\n        userId: _selfUserId\n      });\n      return Defer$2.resolve(_selfUserId);\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      var connectedTime = this._connectedTime;\n      return connectedTime;\n    };\n\n    _proto.getServerConfig = function getServerConfig() {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeServerConfParams();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_SYNC_TIME, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.SessionsAttOutput);\n    };\n\n    _proto.pullMessageList = function pullMessageList(syncMsgArgs, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeSyncMsg(syncMsgArgs);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_MSG, data, _selfUserId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.pullChrmMessageList = function pullChrmMessageList(chatRoomId, time, count, option) {\n      time = time || 0;\n      count = count || 0;\n\n      var data = this._serverDataCodec.encodeChrmSyncMsg(time, count);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_CHRM_MSG, data, chatRoomId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, sendOption, topic) {\n      var self = this;\n      var currentUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec;\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var isStatusMessage = sendOption.isStatusMessage;\n      isStatusMessage = isStatusMessage && common.isSupportStatusMessage(type);\n      var publishTopic = topic || CONVERSATION_TYPE_TO_PUBLISH_TOPIC[type] || PUBLISH_TOPIC.PRIVATE;\n\n      if (isStatusMessage && utils.isUndefined(topic)) {\n        publishTopic = CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n      }\n\n      var data = _serverDataCodec.encodeUpMsg(conversation, sendOption);\n\n      var signal = new PublishWriter(publishTopic, data, targetId);\n      signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n\n      var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n        signal: signal,\n        currentUserId: currentUserId\n      });\n\n      if (isStatusMessage) {\n        self._sendSignal(signal)[\"catch\"](function () {});\n\n        msg.sentTime = common.DelayTimer.getTime();\n        return utils.Defer.resolve(msg);\n      }\n\n      return self._sendSignal(signal).then(function (_ref3) {\n        var messageUId = _ref3.messageUId,\n            timestamp = _ref3.timestamp;\n        msg.messageUId = messageUId;\n        msg.sentTime = timestamp;\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.MESSAGE_SEND, msg);\n\n        return msg;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var upMsgArgs = utils.extend(option || {}, message);\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var messageUId = message.messageUId,\n          sentTime = message.sentTime;\n      upMsgArgs.messageType = RECALL_MESSAGE_TYPE;\n      upMsgArgs.content = {\n        conversationType: type,\n        targetId: targetId,\n        messageUId: messageUId,\n        sentTime: sentTime\n      };\n      return this.sendMessage({\n        type: type,\n        targetId: this._selfUserId\n      }, upMsgArgs, PUBLISH_TOPIC.RECALL);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, fileName) {\n      var data = this._serverDataCodec.encodeGetFileToken(fileType, fileName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_TOKEN, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNupTokenOutput);\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n      var data = this._serverDataCodec.encodeGetFileUrl(fileType, fileName, originName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_URL, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNdownloadUrlOutput);\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeGetConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.RelationsOutput);\n    };\n\n    _proto.removeConversationList = function removeConversationList(conversationList) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeRemoveConversationList(conversationList);\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.DeleteSessionsOutput);\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      return this.removeConversationList([conversation]);\n    };\n\n    _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var type = conversation.type;\n      var historyTopic = CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC[type] || QUERY_HISTORY_TOPIC.PRIVATE;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeDeleteMessages(conversation, messages);\n\n      var writer = new QueryWriter(QUERY_TOPIC.DELETE_MESSAGES, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId;\n      var type = conversation.type;\n\n      var data = this._serverDataCodec.encodeClearMessages(conversation, option);\n\n      var topic = CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC[type];\n      var writer = new QueryWriter(topic, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      return this.getServerConfig().then(function (_ref4) {\n        var totalUnreadCount = _ref4.totalUnreadCount;\n        return totalUnreadCount;\n      });\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeClearUnreadCount(conversation, option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.CLEAR_UNREAD_COUNT, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var id = chrm.id;\n      var count = option.count,\n          isJoinExist = option.isJoinExist,\n          isAutoRejoin = option.isAutoRejoin;\n\n      var data = self._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var topic = isJoinExist ? QUERY_TOPIC.JOIN_EXIST_CHATROOM : QUERY_TOPIC.JOIN_CHATROOM;\n      var writer = new QueryWriter(topic, data, id);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM, {\n        id: id\n      });\n\n      return self._sendSignalForData(writer).then(function (result) {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.JOIN_CHATROOM, {\n          id: id,\n          count: count,\n          isAutoRejoin: isAutoRejoin\n        });\n\n        return result;\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_CHATROOM, data, id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeGetChatRoomInfo(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CHATROOM_INFO, data, id);\n      return this._sendSignalForData(writer, PBName.QueryChatRoomInfoOutput);\n    };\n\n    _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var targetId = chrm.id;\n      var type = CONVERSATION_TYPE.CHATROOM;\n      var conversation = {\n        type: type,\n        targetId: targetId\n      };\n      var historyTopic = QUERY_HISTORY_TOPIC.CHATROOM;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.modifyChatRoomKV = function modifyChatRoomKV(chrm, entry) {\n      var self = this;\n\n      var _selfUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec,\n          chatRoomId = chrm.id,\n          action = entry.type || CHATROOM_ENTRY_TYPE.UPDATE,\n          data = _serverDataCodec.encodeModifyChatRoomKV(chrm, entry, action, _selfUserId),\n          topic = utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE) ? QUERY_TOPIC.DELETE_CHATROOM_KV : QUERY_TOPIC.UPDATE_CHATROOM_KV,\n          writer = new QueryWriter(topic, data, chatRoomId);\n\n      return this._sendSignalForData(writer).then(function () {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_SET, {\n          id: chatRoomId,\n          data: {\n            kvEntries: [entry],\n            syncTime: common.DelayTimer.getTime()\n          }\n        });\n      });\n    };\n\n    _proto.pullChatRoomKV = function pullChatRoomKV(chrm, time) {\n      var _serverDataCodec = this._serverDataCodec,\n          chatRoomId = chrm.id,\n          data = _serverDataCodec.encodePullChatRoomKV(time),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_CHATROOM_KV, data, chatRoomId);\n\n      return this._sendSignalForData(writer, PBName.ChrmKVOutput);\n    };\n\n    _proto.getUserSettings = function getUserSettings(version) {\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodePullUserSetting(version),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_USER_SETTING, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.PullUserSettingOutput);\n    };\n\n    _proto.getConversationStatus = function getConversationStatus(time) {\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodeGetConversationStatus(time),\n          writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_STATUS, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.SessionStates);\n    };\n\n    _proto.setConversationStatusList = function setConversationStatusList(statusList) {\n      var self = this;\n\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodeSetConversationStatus(statusList),\n          writer = new QueryWriter(QUERY_TOPIC.SET_CONVERSATION_STATUS, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.SessionStateModifyResp).then(function (_ref5) {\n        var version = _ref5.version;\n        statusList = utils.map(statusList, function (status) {\n          status.updatedTime = version;\n          return status;\n        });\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED, statusList);\n\n        return true;\n      });\n    };\n\n    _proto.joinRTCRoom = function joinRTCRoom(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.quitRTCRoom = function quitRTCRoom(room) {\n      var data = this._serverDataCodec.encodeQuitRTCRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.RTCPing = function RTCPing(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PING_RTC, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCRoomInfo = function getRTCRoomInfo(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_ROOM_INFO, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcRoomInfoOutput);\n    };\n\n    _proto.getRTCUserInfoList = function getRTCUserInfoList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_INFO_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.setRTCUserInfo = function setRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeSetRTCUserInfo(info);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.removeRTCUserInfo = function removeRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeRemoveRTCUserInfo(info);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCData = function setRTCData(roomId, key, value, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeSetRTCData(key, value, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCUserData = function setRTCUserData(roomId, message, valueInfo, objectName) {\n      var data = this._serverDataCodec.encodeUserSetRTCData(message, valueInfo, objectName);\n\n      var writer = new PublishWriter(QUERY_TOPIC.USER_SET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCData = function getRTCData(roomId, keys, isInner, apiType) {\n      var data = this._serverDataCodec.encodeGetRTCData(keys, isInner, apiType);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcQryOutput);\n    };\n\n    _proto.removeRTCData = function removeRTCData(roomId, keys, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeRemoveRTCData(keys, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCOutData = function setRTCOutData(roomId, rtcData, type, message) {\n      var data = this._serverDataCodec.encodeSetRTCOutData(rtcData, type, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCOutData = function getRTCOutData(roomId, userIds) {\n      var data = this._serverDataCodec.ecnodeGetRTCOutData(userIds);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcUserOutDataOutput);\n    };\n\n    _proto.getRTCToken = function getRTCToken(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_TOKEN, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcTokenOutput);\n    };\n\n    _proto.setRTCState = function setRTCState(room, content) {\n      var data = this._serverDataCodec.encodeSetRTCState(content);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_STATE, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCUserList = function getRTCUserList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.getOldServerConfig = function getOldServerConfig(userId) {\n      var appkey = this.option.appkey;\n      var syncTime = new common.MessageTimeSyner({\n        appkey: appkey,\n        userId: userId\n      }).get();\n      return Defer$2.resolve(syncTime);\n    };\n\n    _proto.getOldConversationList = function getOldConversationList(option, formatOpt) {\n      var self = this;\n      var _selfUserId = self._selfUserId;\n\n      var data = self._serverDataCodec.encodeOldConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_OLD_CONVERSATION_LIST, data, _selfUserId);\n      return self._sendSignalForData(writer, PBName.RelationsOutput, formatOpt);\n    };\n\n    _proto.removeOldConversation = function removeOldConversation(conversation) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n\n      var data = this._serverDataCodec.encodeOldConversationList({\n        type: type\n      });\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_OLD_CONVERSATION, data, targetId);\n      return this._sendSignalForData(writer);\n    };\n\n    return ServerEngine;\n  }();\n\n  var NAVIGATORS = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n  var MINI_SOCKET_DOMAIN_LIST = ['wsproxy.cn.ronghub.com', 'wsap-cn.ronghub.com'];\n  var MINI_COMET_DOMAIN_LIST = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\n  var MINI_UPLOAD_DOMAIN_QINIU = 'https://upload.qiniup.com';\n  var MINI_UPLOAD_DOMAIN_BOS = 'https://gz.bcebos.com';\n  var NETWORK_DETECT_OPTION = {\n    url: 'https://cdn.ronghub.com/im_detecting',\n    intervalTime: 1500\n  };\n  var IM_OPTION = {\n    connectType: CONNECT_TYPE.WEBSOCKET,\n    navigators: NAVIGATORS,\n    detect: NETWORK_DETECT_OPTION,\n    isOldServer: true,\n    isDebug: false\n  };\n  var GET_MESSAGES_OPTION = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC,\n    timestrap: 0\n  };\n  var SEND_MESSAGE_OPTION = {\n    isMentiond: false,\n    isCounted: true,\n    isPersited: true\n  };\n  var GET_CHATROOM_INFO_OPTION = {\n    count: 20,\n    order: CHATROOM_ORDER.DESC\n  };\n  var CHATROOM_NOT_PULL_MSG_COUNT = -1;\n  var JOIN_CHATROOM_OPTION = {\n    count: CHATROOM_NOT_PULL_MSG_COUNT\n  };\n  var GET_CHATROOM_MESSAGES = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC\n  };\n  var SEND_MESSAGE_TYPE_OPTION = {\n    'RC:TxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:VcMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgTextMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:FileMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:HQVCMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:LBSMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSMultiImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpOpendMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:CombineMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:InfoNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ContactNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ProfileNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:GrpNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:RcCmd': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:TypSts': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:PSCmd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:SRSMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRReqMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRRspMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsChaR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CSCha': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEva': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsContact': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHs': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHsR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsSp': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEnd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsUpdate': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:ReadNtf': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:chrmKVNotiMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCAccept': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCRinging': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCSummary': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCHangup': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCInvite': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMedia': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMem': {\n      isCounted: false,\n      isPersited: false\n    }\n  };\n  var BASE_NAVI_RESP = {\n    isFixedNaviResp: true,\n    code: 300,\n    userId: '',\n    server: '',\n    backupServer: '',\n    voipCallInfo: '{\"strategy\":1,\"callEngine\":[{\"engineType\":4,\"mediaServer\":\"https://rtc-info.ronghub.com\",\"maxStreamCount\":20},{\"engineType\":3,\"vendorKey\":\"\",\"signKey\":\"\",\"blinkCMPServer\":\"rtccmp.ronghub.com:80\",\"blinkSnifferServer\":\"rtccmp.ronghub.com:80\"}]}',\n    kvStorage: 1,\n    uploadServer: 'upload.qiniup.com',\n    openMp: 1,\n    openUS: 1,\n    logSwitch: 1,\n    logPolicy: '{\"url\": \"logcollection.ronghub.com\",\"level\": 1,\"itv\": 6,\"times\": 5}',\n    bosAddr: 'gz.bcebos.com',\n    joinMChrm: true,\n    activeServer: '',\n    alone: true,\n    chatroomMsg: true,\n    compDays: 0,\n    errorMessage: '',\n    extkitSwitch: 1,\n    gifSize: 2048,\n    grpMsgLimit: 1,\n    historyMsg: true,\n    isFormatted: 1,\n    location: '',\n    monitor: 0,\n    msgAck: '',\n    offlinelogserver: '',\n    onlinelogserver: '',\n    openHttpDNS: true,\n    qnAddr: '',\n    videoTimes: 120,\n    voipServer: ''\n  };\n  var CMP_HOST_HTTPS = {\n    backupServer: 'wsap-cn.ronghub.com:443'\n  };\n  var CMP_HOST_HTTP = {\n    backupServer: 'wsap-cn.ronghub.com:80'\n  };\n\n  var RCStorage$1 = common.RCStorage;\n\n  var LocalNaviHandler = function () {\n    function LocalNaviHandler(option) {\n      this.storage = void 0;\n      this.option = void 0;\n      var appkey = option.appkey,\n          token = option.token;\n      var UID = common.getUIDByToken(token);\n      var KEY = utils.tplEngine(STORAGE_NAVI.ROOT_KEY_TPL, {\n        appkey: appkey,\n        UID: UID\n      });\n      this.storage = new RCStorage$1(KEY);\n      this.option = option;\n    }\n\n    var _proto = LocalNaviHandler.prototype;\n\n    _proto.set = function set(resp) {\n      var connectType = this.option.connectType;\n      this.storage.set(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE, connectType);\n      this.storage.set(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED, utils.getCurrentTimestamp());\n      this.storage.set(STORAGE_NAVI.SUB_KEY.RESPONSE, resp);\n    };\n\n    _proto.clear = function clear() {\n      this.storage.clear();\n    };\n\n    _proto.getResp = function getResp() {\n      return this.storage.get(STORAGE_NAVI.SUB_KEY.RESPONSE);\n    };\n\n    _proto.isValid = function isValid() {\n      var storage = this.storage,\n          connectType = this.option.connectType;\n      var resp = this.getResp();\n\n      if (utils.isEmpty(resp)) {\n        return false;\n      }\n\n      var oldConnectType = storage.get(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE);\n      var timeWhenSaved = storage.get(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED);\n      var isSameConnectType = utils.isEqual(oldConnectType, connectType);\n      var isNotExpired = utils.getCurrentTimestamp() - timeWhenSaved < NAVI_EXPIRED_TIME;\n      return isSameConnectType && isNotExpired;\n    };\n\n    return LocalNaviHandler;\n  }();\n\n  var getNaviUrl = function getNaviUrl(url, option) {\n    var appkey = option.appkey,\n        connectType = option.connectType,\n        token = option.token;\n    var encodeToken = utils.encodeURI(token);\n    var protocol = env.protocol.http;\n    var type = connectType === CONNECT_TYPE.COMET ? NAVI_TYPE.COMET : NAVI_TYPE.WEBSOCKET;\n    var random = utils.getCurrentTimestamp();\n    url = utils.getValidUrl(url);\n    var naviUrlOption = {\n      protocol: protocol,\n      url: url,\n      type: type,\n      appkey: appkey,\n      random: random,\n      token: encodeToken\n    };\n    return utils.tplEngine(NAVI_URL_TPL, naviUrlOption);\n  };\n\n  var parseNaviResponse = function parseNaviResponse(responseText) {\n    var startText = NAVI_CALLBACK_NAME + '(';\n    var endText = ')';\n    var startIndex = utils.indexOf(responseText, startText) + startText.length;\n    var endIndex = utils.lastIndexOf(responseText, endText);\n\n    if (startIndex === -1 || endIndex === -1) {\n      return utils.parseJSON(responseText);\n    }\n\n    var response = utils.substring(responseText, startIndex, endIndex);\n\n    if (utils.isValidJSON(response)) {\n      return utils.parseJSON(response);\n    } else {\n      return {};\n    }\n  };\n\n  var getMiniNavi = function getMiniNavi(option) {\n    var connectType = option.connectType;\n    var isComet = utils.isEqual(connectType, CONNECT_TYPE.COMET);\n    var CmpDomainList = isComet ? MINI_COMET_DOMAIN_LIST : MINI_SOCKET_DOMAIN_LIST;\n    var naviResp = {\n      backupServer: CmpDomainList.join(DOMAIN_SEPARATOR_IN_CMPLIST),\n      uploadServer: MINI_UPLOAD_DOMAIN_QINIU,\n      bosAddr: MINI_UPLOAD_DOMAIN_BOS\n    };\n    return utils.Defer.resolve(naviResp);\n  };\n\n  var getNaviRespByWS = function getNaviRespByWS(navi) {\n    var protocol = env.protocol.http;\n    var optionCMP = protocol === HTTP_PROTOCOL.HTTP ? CMP_HOST_HTTP : CMP_HOST_HTTPS;\n    return utils.extend(navi, optionCMP);\n  };\n\n  var getPreparedNaviResp = function getPreparedNaviResp(option) {\n    var appkey = option.appkey;\n    var naviResp = BASE_NAVI_RESP;\n    var voipCallInfo = naviResp.voipCallInfo;\n\n    try {\n      var parseVoipCallInfo = utils.parseJSON(voipCallInfo);\n      utils.forEach(parseVoipCallInfo.callEngine, function (item) {\n        if (item.engineType === 3) {\n          item.vendorKey = appkey;\n        }\n      });\n      var jsonVoipCallInfo = utils.toJSON(parseVoipCallInfo);\n      naviResp.voipCallInfo = jsonVoipCallInfo;\n    } catch (error) {}\n\n    return getNaviRespByWS(naviResp);\n  };\n\n  var NaviManager = function () {\n    function NaviManager(option) {\n      this.option = void 0;\n      this.localNaviHandler = void 0;\n      this.option = option;\n      this.localNaviHandler = new LocalNaviHandler(option);\n    }\n\n    var _proto2 = NaviManager.prototype;\n\n    _proto2.get = function get() {\n      var self = this;\n      var option = self.option,\n          localNaviHandler = self.localNaviHandler;\n      var navigators = option.navigators,\n          token = option.token,\n          connectType = option.connectType;\n\n      if (env.isMini) {\n        return getMiniNavi(option).then(function (miniNaviResp) {\n          localNaviHandler.set(miniNaviResp);\n          return utils.Defer.resolve(miniNaviResp);\n        });\n      }\n\n      Logger.info(TAG.L_GET_NAVI_T, {\n        navigators: navigators,\n        token: token\n      });\n      var localConfigForNavi = self.getLocalConfig();\n\n      if (localNaviHandler.isValid()) {\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'local navi',\n            localConfigForNavi: localConfigForNavi\n          }\n        });\n        return utils.Defer.resolve(localConfigForNavi);\n      }\n\n      var naviListInToken = common.getNaviListByToken(token);\n      navigators = naviListInToken.concat(navigators);\n      option.token = common.getValidToken(token);\n      var urlList = utils.map(navigators, function (url) {\n        return getNaviUrl(url, option);\n      });\n      var requestOptions = {\n        timeout: NAVI_REQUEST_TIMEOUT\n      };\n\n      var success = function success(_ref) {\n        var responseText = _ref.responseText;\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'remote navi',\n            responseText: responseText\n          }\n        });\n        var resp = parseNaviResponse(responseText);\n        var code = resp.code,\n            isFixedNaviResp = resp.isFixedNaviResp;\n        var isSuccess = code === NAVI_REQUEST_SUCCESS_CODE;\n\n        if (isSuccess) {\n          localNaviHandler.set(resp);\n          return resp;\n        } else if (resp && code) {\n          var error = utils.extendInShallow(NAVI_ERROR_INFO[code], {\n            msg: resp.errorMessage\n          });\n          return utils.Defer.reject(error);\n        } else if (isFixedNaviResp) {\n          if (connectType === CONNECT_TYPE.COMET) {\n            return utils.Defer.reject(ERROR_INFO.NAVI_REQUEST_ERROR);\n          }\n\n          var naviResp = getPreparedNaviResp(option);\n          localNaviHandler.set(naviResp);\n          return naviResp;\n        } else {\n          return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n            error: responseText\n          }));\n        }\n      };\n\n      return utils.requestByUrlList(urlList, requestOptions).then(success, function () {\n        var fixedNaviResp = {\n          'responseText': '{\"isFixedNaviResp\":true}'\n        };\n        return success(fixedNaviResp);\n      });\n    };\n\n    _proto2.setLocalConfig = function setLocalConfig(config) {\n      if (utils.isObject(config)) {\n        var localConf = this.getLocalConfig() || {};\n        var newConf = utils.extend(localConf, config);\n        this.localNaviHandler.set(newConf);\n      }\n    };\n\n    _proto2.getLocalConfig = function getLocalConfig() {\n      return this.localNaviHandler.getResp();\n    };\n\n    _proto2.clear = function clear() {\n      var option = this.option;\n      var localNaviHanlder = new LocalNaviHandler(option);\n      localNaviHanlder.clear();\n    };\n\n    return NaviManager;\n  }();\n\n  var CMPManager = function () {\n    function CMPManager() {\n      this.cmpDomainList = [];\n      this.invalidDomainList = [];\n      this.option = void 0;\n    }\n\n    var _proto = CMPManager.prototype;\n\n    _proto.setDomainList = function setDomainList(cmpDomainList, option) {\n      this.cmpDomainList = cmpDomainList;\n      this.option = option || {};\n    };\n\n    _proto.getFaster = function getFaster() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList,\n          option = this.option;\n      var sniffUrlList = utils.filter(cmpDomainList, function (domain) {\n        return !utils.isInclude(invalidDomainList, domain);\n      });\n      sniffUrlList = utils.map(sniffUrlList, function (domain) {\n        var timestamp = utils.getCurrentTimestamp();\n        var url = domain + \"/ping?r=\" + timestamp;\n        return utils.getValidUrl(url, option);\n      });\n\n      if (utils.isEmpty(sniffUrlList)) {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      }\n\n      return utils.requestForFaster(sniffUrlList, {\n        timeInterval: CMP_SNIFF_INTERNAL_TIME\n      }).then(function (_ref) {\n        var url = _ref.url,\n            index = _ref.index;\n        return {\n          url: url,\n          index: index,\n          domain: utils.getDomainByUrl(url)\n        };\n      })[\"catch\"](function () {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      });\n    };\n\n    _proto.addInvalid = function addInvalid(domain) {\n      this.invalidDomainList.push(domain);\n    };\n\n    _proto.clearInvalid = function clearInvalid() {\n      this.invalidDomainList.length = 0;\n    };\n\n    _proto.isAllInvalid = function isAllInvalid() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList;\n      return utils.isEqual(cmpDomainList.length, invalidDomainList.length);\n    };\n\n    return CMPManager;\n  }();\n\n  var _STORAGE_KEY_MAP_CONV;\n  var SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n  var STORAGE_KEY_MAP_CONVERSATION = (_STORAGE_KEY_MAP_CONV = {}, _STORAGE_KEY_MAP_CONV[SUB_KEY.UNREAD_COUNT] = {\n    keyName: 'unreadMessageCount',\n    defaultVal: 0\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.HAS_MENTIOND] = {\n    keyName: 'hasMentiond',\n    defaultVal: false\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.MENTIOND_INFO] = {\n    keyName: 'mentiondInfo',\n    defaultVal: null\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.UNREAD_LAST_TIME] = {\n    keyName: 'lastUnreadTime',\n    defaultVal: 0\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.NOTIFICATION] = {\n    keyName: 'notificationStatus',\n    defaultVal: NOTIFICATION_STATUS.NOTIFY\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.TOP] = {\n    keyName: 'isTop',\n    defaultVal: false\n  }, _STORAGE_KEY_MAP_CONV);\n  var conversationKeyMapStorageKey = {};\n  utils.forEach(STORAGE_KEY_MAP_CONVERSATION, function (_ref, storeKey) {\n    var keyName = _ref.keyName;\n    conversationKeyMapStorageKey[keyName] = storeKey;\n  });\n  var CONVERSATION_KEY_MAP_STORAGE_KEY = conversationKeyMapStorageKey;\n\n  var ConversationStore = function () {\n    function ConversationStore(option) {\n      this._storage = void 0;\n      var StorageKey = utils.tplEngine(STORAGE_CONVERSATION.ROOT_KEY_TPL, option);\n      this._storage = new common.RCStorage(StorageKey);\n    }\n\n    var _proto = ConversationStore.prototype;\n\n    _proto.set = function set(option, conversation) {\n      conversation = conversation || {};\n      var key = common.getConversationKey(option);\n      var local = this._storage.get(key) || {};\n      utils.forEach(conversation, function (val, key) {\n        var storageKey = CONVERSATION_KEY_MAP_STORAGE_KEY[key];\n\n        if (utils.isUndefined(storageKey) || utils.isUndefined(val)) {\n          return;\n        }\n\n        var defaultVal = STORAGE_KEY_MAP_CONVERSATION[storageKey].defaultVal;\n\n        if (utils.isEqual(defaultVal, val)) {\n          delete local[storageKey];\n        } else {\n          local[storageKey] = val;\n        }\n      });\n\n      if (!local[SUB_KEY.UNREAD_COUNT]) {\n        delete local[SUB_KEY.UNREAD_LAST_TIME];\n      }\n\n      if (utils.isEmpty(local)) {\n        this._storage.remove(key);\n      } else {\n        this._storage.set(key, local);\n      }\n    };\n\n    _proto.get = function get(option) {\n      var key = common.getConversationKey(option),\n          local = this._storage.get(key) || {};\n      var conversation = {};\n      utils.forEach(STORAGE_KEY_MAP_CONVERSATION, function (val, key) {\n        var keyName = val.keyName,\n            defaultVal = val.defaultVal;\n        conversation[keyName] = local[key] || defaultVal;\n      });\n      return conversation;\n    };\n\n    _proto.getValues = function getValues(event) {\n      var setEvent = event || utils.noop;\n      var values = this._storage.getValues() || {};\n      var storeConversationList = [];\n      utils.forEach(values, function (store, key) {\n        var _common$getConversati = common.getConversationByKey(key),\n            type = _common$getConversati.type,\n            targetId = _common$getConversati.targetId;\n\n        var conversation = {};\n        utils.forEach(store, function (val, storeKey) {\n          var _ref2 = STORAGE_KEY_MAP_CONVERSATION[storeKey] || {},\n              keyName = _ref2.keyName,\n              defaultVal = _ref2.defaultVal;\n\n          conversation[keyName] = val || defaultVal;\n        });\n        conversation = utils.extend(conversation, {\n          type: type,\n          targetId: targetId\n        });\n        conversation = setEvent(conversation);\n        storeConversationList.push(conversation);\n      });\n      return storeConversationList;\n    };\n\n    return ConversationStore;\n  }();\n\n  var PullQueueManager = function () {\n    function PullQueueManager(option) {\n      this.isLoading = false;\n      this._queue = new utils.Queue();\n      this._option = void 0;\n      option = option || {};\n      this._option = option;\n    }\n\n    var _proto = PullQueueManager.prototype;\n\n    _proto._execEvent = function _execEvent() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      var self = this;\n\n      var _this$_option = this._option,\n          event = _this$_option.event,\n          thisArg = _this$_option.thisArg,\n          onBefore = this._option.onBefore || function () {\n        return args;\n      },\n          onFinished = this._option.onFinished || utils.noop,\n          onError = this._option.onError || utils.noop;\n\n      onBefore.apply(void 0, args);\n      self.isLoading = true;\n      return event.apply(thisArg, args).then(function (result) {\n        self.isLoading = false;\n        onFinished.apply(void 0, [result].concat(args));\n      })[\"catch\"](function (error) {\n        self.isLoading = false;\n        onError(error);\n      });\n    };\n\n    _proto.pull = function pull() {\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      this._queue.add({\n        event: this._execEvent,\n        args: args,\n        thisArg: this\n      });\n    };\n\n    return PullQueueManager;\n  }();\n\n  var EventName = {\n    CHANGED: 'changed'\n  };\n\n  var ConversationStatusManager = function () {\n    function ConversationStatusManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._timeStorage = void 0;\n      this._handleSetConversationStatus = void 0;\n      this._handleConversationStatusChanged = void 0;\n      var self = this,\n          userId = serverEngine._selfUserId,\n          appkey = serverEngine.option.appkey,\n          storageKey = utils.tplEngine(STORAGE_CONVERSATION_STATUS.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      }),\n          timeStorage = new common.RCStorage(storageKey),\n          firstPullTime = timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n      var pullQueue = new PullQueueManager({\n        event: self.pull,\n        thisArg: self,\n        onFinished: function onFinished(list) {\n          self._set(list);\n        }\n      });\n\n      self._handleConversationStatusChanged = function (time) {\n        pullQueue.pull(time);\n      };\n\n      self._handleSetConversationStatus = function (list) {\n        self._set(list);\n      };\n\n      self._timeStorage = timeStorage;\n      self._serverEngine = serverEngine;\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED] = self._handleConversationStatusChanged, _serverEngine$watch[SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED] = self._handleSetConversationStatus, _serverEngine$watch));\n      pullQueue.pull(firstPullTime);\n    }\n\n    var _proto = ConversationStatusManager.prototype;\n\n    _proto.watchChanged = function watchChanged(event) {\n      this._eventEmitter.on(EventName.CHANGED, event);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED] = this._handleConversationStatusChanged, _this$_serverEngine$u[SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED] = this._handleSetConversationStatus, _this$_serverEngine$u));\n    };\n\n    _proto.pull = function pull(newPullTime) {\n      if (common.getConnectType(this._serverEngine.option) === CONNECT_TYPE.COMET) {\n        return utils.Defer.reject();\n      }\n\n      var time = this._timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n\n      if (newPullTime >= time) {\n        return this._serverEngine.getConversationStatus(time);\n      } else {\n        return utils.Defer.reject();\n      }\n    };\n\n    _proto._set = function _set(list) {\n      var self = this;\n\n      if (utils.isUndefined(list)) {\n        return;\n      }\n\n      var time = self._timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n      var listCount = list.length;\n      utils.forEach(list, function (statusItem, index) {\n        var updatedTime = statusItem.updatedTime || 0;\n        time = updatedTime > time ? updatedTime : time;\n\n        self._eventEmitter.emit(EventName.CHANGED, {\n          statusItem: statusItem,\n          isLastInAPull: index === listCount - 1\n        });\n      });\n\n      self._timeStorage.set(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME, time);\n    };\n\n    return ConversationStatusManager;\n  }();\n\n  var EventName$1 = {\n    CHANGED: 'conversationChanged'\n  };\n\n  var ConversationManager = function () {\n    function ConversationManager(option, serverEngine) {\n      this._selfUserId = void 0;\n      this._store = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._statusManager = void 0;\n      this._allConversationList = [];\n      this._updatedConversations = {};\n      var self = this;\n      var statusManager = new ConversationStatusManager(serverEngine);\n      statusManager.watchChanged(function (_ref) {\n        var statusItem = _ref.statusItem,\n            isLastInAPull = _ref.isLastInAPull;\n\n        self._addStatus(statusItem, isLastInAPull);\n      });\n      self._store = new ConversationStore(option);\n      self._selfUserId = option.userId;\n      self._statusManager = statusManager;\n    }\n\n    var _proto = ConversationManager.prototype;\n\n    _proto.watch = function watch(events) {\n      var conversation = events.conversation;\n\n      this._eventEmitter.on(EventName$1.CHANGED, conversation);\n    };\n\n    _proto.addMessage = function addMessage(msgArgs) {\n      var self = this;\n      var message = msgArgs.message,\n          isLastInAPull = msgArgs.isLastInAPull,\n          type = message.type,\n          isPersited = message.isPersited,\n          isSaveConversationType = utils.isInclude(TYPE_HAS_CONVERSATION, type);\n\n      if (!isSaveConversationType) {\n        return;\n      }\n\n      var hasChanged = false;\n\n      var storageConversation = self._store.get(message);\n\n      var calcEvents = [self._setUnreadCount, self._setMentiondInfo];\n      utils.forEach(calcEvents, function (event) {\n        var _event$call = event.call(self, message, storageConversation),\n            hasCalcChanged = _event$call.hasChanged,\n            conversation = _event$call.conversation;\n\n        hasChanged = hasChanged || hasCalcChanged;\n        storageConversation = conversation;\n      });\n\n      if (hasChanged) {\n        self._store.set(message, storageConversation);\n      }\n\n      if (isPersited) {\n        var conversation = self._getConversationByMessage(message);\n\n        conversation.updatedItems = {\n          latestMessage: {\n            time: message.sentTime,\n            val: message\n          }\n        };\n\n        self._setUpdatedConversation(conversation);\n      }\n\n      var isNeedNotifyUpdate = utils.isUndefined(isLastInAPull) ? true : isLastInAPull;\n\n      if (isNeedNotifyUpdate) {\n        self._notifyConversationChanged();\n      }\n    };\n\n    _proto.get = function get(option) {\n      var conversation = this._store.get(option);\n\n      var notificationStatus = conversation.notificationStatus,\n          isNotDisturb = utils.isEqual(notificationStatus, NOTIFICATION_STATUS.DO_NOT_DISTURB);\n\n      if (isNotDisturb) {\n        conversation.unreadMessageCount = 0;\n      }\n\n      return conversation;\n    };\n\n    _proto.read = function read(option) {\n      var self = this,\n          type = option.type,\n          targetId = option.targetId,\n          _store = self._store,\n          _updatedConversations = self._updatedConversations,\n          key = common.getConversationKey(option),\n          updatedConversation = _updatedConversations[key] || {};\n      var storeConversation = _store.get(option) || {},\n          _storeConversation = storeConversation,\n          unreadMessageCount = _storeConversation.unreadMessageCount,\n          hasMentiond = _storeConversation.hasMentiond;\n\n      if (unreadMessageCount || hasMentiond) {\n        var updatedTime = common.DelayTimer.getTime();\n        var updatedValues = {\n          type: type,\n          targetId: targetId,\n          unreadMessageCount: 0,\n          hasMentiond: false,\n          mentiondInfo: null,\n          updatedItems: {\n            unreadMessageCount: {\n              time: updatedTime,\n              val: 0\n            },\n            hasMentiond: {\n              time: updatedTime,\n              val: false\n            },\n            mentiondInfo: {\n              time: updatedTime,\n              val: null\n            }\n          }\n        };\n        storeConversation = utils.extendAllowNull(storeConversation, updatedValues);\n\n        _store.set(option, storeConversation);\n\n        _updatedConversations[key] = utils.extendAllowNull(updatedConversation, updatedValues);\n\n        self._notifyConversationChanged();\n      }\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var _store = this._store,\n          conversationList = _store.getValues();\n\n      var totalCount = 0;\n      utils.forEach(conversationList, function (_ref2) {\n        var unreadMessageCount = _ref2.unreadMessageCount;\n        unreadMessageCount = utils.isNumber(unreadMessageCount) ? unreadMessageCount : 0;\n        totalCount += unreadMessageCount;\n      });\n      return totalCount;\n    };\n\n    _proto.getUnreadCount = function getUnreadCount(option) {\n      var _store = this._store;\n      var storeConversation = _store.get(option) || {};\n      var unreadMessageCount = storeConversation.unreadMessageCount;\n      var count = utils.isNumber(unreadMessageCount) ? unreadMessageCount : 0;\n      return count;\n    };\n\n    _proto.close = function close() {\n      this._statusManager.close();\n    };\n\n    _proto._getConversationByMessage = function _getConversationByMessage(message) {\n      var type = message.type,\n          targetId = message.targetId,\n          storeConversation = this._store.get(message);\n\n      var conversation = utils.extend(storeConversation, {\n        type: type,\n        targetId: targetId,\n        latestMessage: message\n      });\n      return conversation;\n    };\n\n    _proto._getUpdatedConversationList = function _getUpdatedConversationList() {\n      var self = this,\n          updatedConversations = self._updatedConversations,\n          list = [];\n      utils.forEach(updatedConversations, function (conversation) {\n        var storageItems = self._store.get(conversation);\n\n        utils.forEach(storageItems, function (val, key) {\n          conversation[key] = val;\n        });\n        list.push(conversation);\n      });\n      return common.sortConList(list);\n    };\n\n    _proto._setUnreadCount = function _setUnreadCount(message, conversation) {\n      var content = message.content,\n          messageType = message.messageType,\n          sentTime = message.sentTime,\n          isCounted = message.isCounted,\n          messageDirection = message.messageDirection,\n          senderUserId = message.senderUserId,\n          isSelfSend = utils.isEqual(messageDirection, MESSAGE_DIRECTION.SEND) || utils.isEqual(senderUserId, this._selfUserId),\n          isRecall = utils.isEqual(messageType, RECALL_MESSAGE_TYPE),\n          hasContent = utils.isObject(content);\n      var hasChanged = false;\n      var lastUnreadTime = conversation.lastUnreadTime || 0,\n          unreadMessageCount = conversation.unreadMessageCount || 0,\n          hasBeenAdded = lastUnreadTime > sentTime;\n\n      if (hasBeenAdded || isSelfSend) {\n        return {\n          hasChanged: hasChanged,\n          conversation: conversation\n        };\n      }\n\n      if (isCounted) {\n        conversation.unreadMessageCount = unreadMessageCount + 1;\n        conversation.lastUnreadTime = sentTime;\n        hasChanged = true;\n      }\n\n      if (isRecall && hasContent) {\n        var isNotRead = lastUnreadTime >= content.sentTime;\n\n        if (isNotRead && unreadMessageCount) {\n          conversation.unreadMessageCount = unreadMessageCount - 1;\n          hasChanged = true;\n        }\n      }\n\n      return {\n        hasChanged: hasChanged,\n        conversation: conversation\n      };\n    };\n\n    _proto._setMentiondInfo = function _setMentiondInfo(message, conversation) {\n      var content = message.content,\n          messageDirection = message.messageDirection,\n          isMentiond = message.isMentiond,\n          isSelfSend = utils.isEqual(messageDirection, MESSAGE_DIRECTION.SEND),\n          hasContent = utils.isObject(content);\n      var hasChanged = false;\n\n      if (isSelfSend) ; else if (isMentiond && hasContent && content.mentionedInfo) {\n        conversation.hasMentiond = true;\n        conversation.mentiondInfo = content.mentionedInfo;\n        hasChanged = true;\n      }\n\n      return {\n        hasChanged: hasChanged,\n        conversation: conversation\n      };\n    };\n\n    _proto._setUpdatedConversation = function _setUpdatedConversation(conversation) {\n      if (utils.isObject(conversation) && conversation.targetId && conversation.type) {\n        var self = this,\n            cacheKey = common.getConversationKey(conversation),\n            cacheConversation = self._updatedConversations[cacheKey];\n        self._updatedConversations[cacheKey] = utils.extendAllowNull(cacheConversation, conversation);\n      }\n    };\n\n    _proto._notifyConversationChanged = function _notifyConversationChanged() {\n      var self = this,\n          _eventEmitter = self._eventEmitter,\n          updatedConversationList = self._getUpdatedConversationList();\n\n      if (utils.isEmpty(updatedConversationList)) ; else {\n        utils.setTimeout(function () {\n          _eventEmitter.emit(EventName$1.CHANGED, {\n            updatedConversationList: updatedConversationList\n          });\n\n          self._updatedConversations = {};\n        }, 0);\n      }\n    };\n\n    _proto._addStatus = function _addStatus(conversationStatus, isLastInAPull) {\n      var type = conversationStatus.type,\n          targetId = conversationStatus.targetId,\n          updatedTime = conversationStatus.updatedTime,\n          notificationStatus = conversationStatus.notificationStatus,\n          isTop = conversationStatus.isTop,\n          option = {\n        type: type,\n        targetId: targetId\n      };\n      var updatedItems = {};\n\n      if (!utils.isUndefined(notificationStatus)) {\n        updatedItems['notificationStatus'] = {\n          time: updatedTime,\n          val: notificationStatus\n        };\n      }\n\n      if (!utils.isUndefined(isTop)) {\n        updatedItems['isTop'] = {\n          time: updatedTime,\n          val: isTop\n        };\n      }\n\n      this._setUpdatedConversation({\n        type: type,\n        targetId: targetId,\n        updatedItems: updatedItems\n      });\n\n      this._store.set(option, {\n        notificationStatus: notificationStatus,\n        isTop: isTop\n      });\n\n      if (isLastInAPull) {\n        this._notifyConversationChanged();\n      }\n    };\n\n    return ConversationManager;\n  }();\n\n  var MessageTimeSyner$1 = common.MessageTimeSyner,\n      ChatRoomMessageTimeSyner$1 = common.ChatRoomMessageTimeSyner;\n  var EVENT_NAME$1 = {\n    MESSAGE_RECEIVED: 'msg-received'\n  };\n\n  var MessagePullManager = function () {\n    function MessagePullManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._messageTimeSyner = void 0;\n      this._chatRoomMessageTimeSyner = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._pullMessageTimer = new utils.Timer({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: PULL_MSG_TIME\n      });\n      this._sentMsgCacheInPulling = {};\n      this._handleDirectMessage = void 0;\n      this._handleNotifyPull = void 0;\n      this._handleJoinChatRoom = void 0;\n      this._handleSendMessage = void 0;\n      var self = this;\n      var appkey = serverEngine.option.appkey,\n          userId = serverEngine._selfUserId;\n      var startSyncTime = option.startSyncTime;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished() {},\n        onError: function onError() {}\n      });\n\n      self._handleDirectMessage = function (message) {\n        !pullQueue.isLoading && self.notifyMessage({\n          message: message,\n          hasMore: false\n        });\n      };\n\n      self._handleNotifyPull = function (option) {\n        pullQueue.pull(option);\n      };\n\n      self._handleJoinChatRoom = function (_ref) {\n        var id = _ref.id,\n            count = _ref.count,\n            isAutoRejoin = _ref.isAutoRejoin;\n\n        if (utils.isEqual(count, CHATROOM_NOT_PULL_MSG_COUNT)) {\n          self._chatRoomMessageTimeSyner.set(id, common.DelayTimer.getTime());\n        } else {\n          var type = PULL_MSG_TYPE.CHATROOM,\n              chrmId = id;\n          var time = isAutoRejoin ? self._chatRoomMessageTimeSyner.get(id) + 1 : 0;\n\n          self._chatRoomMessageTimeSyner.set(id, time);\n\n          pullQueue.pull({\n            type: type,\n            time: time,\n            chrmId: chrmId,\n            count: count\n          });\n        }\n      };\n\n      self._handleSendMessage = function (message) {\n        pullQueue.isLoading ? self._setSentMsgCacheInPulling(message) : self._setPullTime(message);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.DIRECT_MSG] = self._handleDirectMessage, _serverEngine$watch[SERVER_EVENT_NAME.NOTIFY_PULL] = self._handleNotifyPull, _serverEngine$watch[SERVER_EVENT_NAME.JOIN_CHATROOM] = self._handleJoinChatRoom, _serverEngine$watch[SERVER_EVENT_NAME.MESSAGE_SEND] = self._handleSendMessage, _serverEngine$watch));\n      self._serverEngine = serverEngine;\n      self._pullQueue = pullQueue;\n      self._messageTimeSyner = new MessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId,\n        startSyncTime: startSyncTime\n      });\n      self._chatRoomMessageTimeSyner = new ChatRoomMessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId\n      });\n\n      self._pullMessageTimer.start(pullQueue.pull, {\n        thisArg: pullQueue\n      });\n\n      pullQueue.pull();\n    }\n\n    var _proto = MessagePullManager.prototype;\n\n    _proto.watchMessage = function watchMessage(event) {\n      this._eventEmitter.on(EVENT_NAME$1.MESSAGE_RECEIVED, event);\n    };\n\n    _proto.notifyMessage = function notifyMessage(messageArgs) {\n      var message = messageArgs.message;\n\n      this._setPullTime(message);\n\n      this._eventEmitter.emit(EVENT_NAME$1.MESSAGE_RECEIVED, messageArgs);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._pullMessageTimer.stop();\n\n      this._sentMsgCacheInPulling = {};\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.DIRECT_MSG] = this._handleDirectMessage, _this$_serverEngine$u[SERVER_EVENT_NAME.NOTIFY_PULL] = this._handleNotifyPull, _this$_serverEngine$u[SERVER_EVENT_NAME.JOIN_CHATROOM] = this._handleJoinChatRoom, _this$_serverEngine$u[SERVER_EVENT_NAME.MESSAGE_SEND] = this._handleSendMessage, _this$_serverEngine$u));\n    };\n\n    _proto._pullEvent = function _pullEvent(option) {\n      option = option || {};\n\n      var self = this,\n          _serverEngine = self._serverEngine,\n          _messageTimeSyner = self._messageTimeSyner,\n          _chatRoomMessageTimeSyner = self._chatRoomMessageTimeSyner,\n          _option = option,\n          type = _option.type,\n          chrmId = _option.chrmId,\n          serverPullTime = _option.time,\n          count = _option.count,\n          isPullChrmMsg = utils.isEqual(type, PULL_MSG_TYPE.CHATROOM),\n          msgSyncTime = _messageTimeSyner.get(),\n          currentReceiveTime = isPullChrmMsg ? _chatRoomMessageTimeSyner.get(chrmId) : msgSyncTime.inboxTime,\n          syncTime = utils.copy(msgSyncTime);\n\n      if (serverPullTime && serverPullTime < currentReceiveTime) {\n        return utils.Defer.resolve();\n      }\n\n      var onMessage = function onMessage(_ref2) {\n        var message = _ref2.message,\n            finished = _ref2.finished,\n            isLastInAPull = _ref2.isLastInAPull;\n\n        self._displatchMessages({\n          message: message,\n          finished: finished,\n          isPullChrmMsg: isPullChrmMsg,\n          isLastInAPull: isLastInAPull,\n          normalSyncTime: syncTime,\n          chatRoomReceiveTime: currentReceiveTime\n        });\n      };\n\n      if (isPullChrmMsg) {\n        return _serverEngine.pullChrmMessageList(chrmId, currentReceiveTime, count, {\n          onMessage: onMessage\n        });\n      } else {\n        return _serverEngine.pullMessageList(syncTime, {\n          onMessage: onMessage\n        });\n      }\n    };\n\n    _proto._displatchMessages = function _displatchMessages(option) {\n      var self = this,\n          message = option.message,\n          finished = option.finished,\n          isPullChrmMsg = option.isPullChrmMsg,\n          isLastInAPull = option.isLastInAPull,\n          _ref3 = option.normalSyncTime || {},\n          inboxTime = _ref3.inboxTime,\n          sendboxTime = _ref3.sendboxTime,\n          sentTime = message.sentTime,\n          messageDirection = message.messageDirection,\n          messageUId = message.messageUId,\n          isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND,\n          pullTime = isSelfSend ? sendboxTime : inboxTime;\n\n      if (sentTime <= pullTime && !isPullChrmMsg) {\n        return;\n      }\n\n      if (self._sentMsgCacheInPulling[messageUId]) {\n        return;\n      }\n\n      self.notifyMessage({\n        message: message,\n        hasMore: !finished,\n        isLastInAPull: isLastInAPull\n      });\n    };\n\n    _proto._setPullTime = function _setPullTime(message) {\n      var isChatRoom = message.type === CONVERSATION_TYPE.CHATROOM;\n      isChatRoom ? this._chatRoomMessageTimeSyner.setByMessage(message) : this._messageTimeSyner.setByMessage(message);\n    };\n\n    _proto._setSentMsgCacheInPulling = function _setSentMsgCacheInPulling(message) {\n      var messageUId = message.messageUId;\n\n      if (utils.isUndefined(messageUId)) {\n        return;\n      }\n\n      this._sentMsgCacheInPulling[messageUId] = message;\n    };\n\n    _proto._consumeSentMsgCacheInPulling = function _consumeSentMsgCacheInPulling() {\n      var self = this;\n      var _sentMsgCacheInPulling = self._sentMsgCacheInPulling;\n      utils.forEach(_sentMsgCacheInPulling, function (message) {\n        self._setPullTime(message);\n      });\n      self._sentMsgCacheInPulling = {};\n    };\n\n    return MessagePullManager;\n  }();\n\n  var ChatRoomKVStore = function () {\n    function ChatRoomKVStore(chrmId, currentUserId) {\n      this._chatRoomId = void 0;\n      this._kvCaches = {};\n      this._currentUserId = void 0;\n      this._chatRoomId = chrmId;\n      this._currentUserId = currentUserId;\n    }\n\n    var _proto = ChatRoomKVStore.prototype;\n\n    _proto.setEntries = function setEntries(data) {\n      data = data || {};\n      var self = this;\n      var _data = data,\n          kvList = _data.kvEntries,\n          isFullUpdate = _data.isFullUpdate;\n      kvList = kvList || [];\n      isFullUpdate = isFullUpdate || false;\n      isFullUpdate && self.clear();\n      utils.forEach(kvList, function (kv) {\n        self.setEntry(kv, {\n          isFullUpdate: isFullUpdate\n        });\n      });\n    };\n\n    _proto.setEntry = function setEntry(kv, option) {\n      option = option || {};\n      var _option = option,\n          isFullUpdate = _option.isFullUpdate,\n          key = kv.key,\n          type = kv.type,\n          isOverwrite = kv.isOverwrite,\n          userId = kv.userId,\n          latestUserId = this.getSetUserId(key),\n          isDeleteOpt = utils.isEqual(type, CHATROOM_ENTRY_TYPE.DELETE),\n          isSameAtLastSetUser = utils.isEqual(latestUserId, userId),\n          isKeyNotExist = !this.isExisted(key);\n      var event = isDeleteOpt ? this.remove : this.add;\n\n      if (isFullUpdate) {\n        event.call(this, kv);\n      } else if (isOverwrite || isSameAtLastSetUser || isKeyNotExist) {\n        event.call(this, kv);\n      }\n    };\n\n    _proto.add = function add(kv) {\n      var key = kv.key;\n      kv.isDeleted = false;\n      this._kvCaches[key] = kv;\n    };\n\n    _proto.remove = function remove(kv) {\n      var key = kv.key;\n      var cacheKV = this.get(key) || {};\n      cacheKV.isDeleted = true;\n      this._kvCaches[key] = cacheKV;\n    };\n\n    _proto.clear = function clear() {\n      this._kvCaches = {};\n    };\n\n    _proto.get = function get(key) {\n      return this._kvCaches[key];\n    };\n\n    _proto.getSetUserId = function getSetUserId(key) {\n      var cache = this.get(key) || {};\n      return cache.userId;\n    };\n\n    _proto.getValue = function getValue(key) {\n      var kv = this._kvCaches[key] || {};\n      var isDeleted = kv.isDeleted;\n      return isDeleted ? null : kv.value;\n    };\n\n    _proto.getAll = function getAll() {\n      var kvEntries = {};\n      utils.forEach(this._kvCaches, function (kv, key) {\n        if (!kv.isDeleted) {\n          kvEntries[key] = kv.value;\n        }\n      });\n      return kvEntries;\n    };\n\n    _proto.getUpdatedTime = function getUpdatedTime() {\n      var maxTime = 0;\n      utils.forEach(this._kvCaches, function (entry) {\n        var timestamp = entry.timestamp || 0;\n\n        if (maxTime < timestamp) {\n          maxTime = timestamp;\n        }\n      });\n      return maxTime;\n    };\n\n    _proto.isExisted = function isExisted(key) {\n      var cache = this.get(key) || {};\n      var value = cache.value,\n          isDeletedOnLatestOperate = cache.isDeleted;\n      return value && !isDeletedOnLatestOperate;\n    };\n\n    return ChatRoomKVStore;\n  }();\n\n  var storeCaches = {};\n\n  var get = function get(chrmId) {\n    return storeCaches[chrmId];\n  };\n\n  var set$1 = function set(chrmId, data, currentUserId) {\n    var kvStore = get(chrmId);\n\n    if (utils.isEmpty(kvStore)) {\n      kvStore = new ChatRoomKVStore(chrmId, currentUserId);\n    }\n\n    kvStore.setEntries(data);\n    storeCaches[chrmId] = kvStore;\n  };\n\n  var getValue = function getValue(chrmId, key) {\n    var kvStore = get(chrmId);\n    var value = kvStore ? kvStore.getValue(key) : null;\n    return value;\n  };\n\n  var getAll = function getAll(chrmId) {\n    var kvStore = get(chrmId);\n    var kvs = {};\n\n    if (kvStore) {\n      kvs = kvStore.getAll();\n    }\n\n    return kvs;\n  };\n\n  var clear = function clear(chrmId) {\n    var kvStore = get(chrmId) || {};\n    kvStore.clear && kvStore.clear();\n  };\n\n  var ChatRoomKVStore$1 = {\n    get: get,\n    set: set$1,\n    getValue: getValue,\n    getAll: getAll,\n    clear: clear\n  };\n\n  var PullTimeCache = {\n    _caches: {},\n    set: function set(chrmId, time) {\n      PullTimeCache._caches[chrmId] = time;\n    },\n    get: function get(chrmId) {\n      return PullTimeCache._caches[chrmId] || 0;\n    },\n    clear: function clear(chrmId) {\n      PullTimeCache._caches[chrmId] = 0;\n    }\n  };\n  var KV_EVENT_NAME = {\n    KV_RECEIVED: 'kv-received'\n  };\n\n  var ChatRoomKVManager = function () {\n    function ChatRoomKVManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._handleChrmKVSet = void 0;\n      this._handleChrmKVChanged = void 0;\n      this._handleBeforeJoinChrm = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      var self = this;\n      var userId = serverEngine._selfUserId;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished(data, option) {\n          if (!data || !option.chrmId) {\n            return;\n          }\n\n          var chrmId = option.chrmId;\n\n          if (data.isFullUpdate) {\n            self._reset(chrmId);\n          }\n\n          Logger.info(TAG.L_PULL_CHRM_KV_R, {\n            data: data,\n            option: option\n          });\n          ChatRoomKVStore$1.set(chrmId, data, userId);\n          PullTimeCache.set(chrmId, data.syncTime || 0);\n\n          self._notifyReceivedKV(chrmId, data);\n        }\n      });\n\n      self._handleChrmKVSet = function (_ref) {\n        var id = _ref.id,\n            data = _ref.data;\n        ChatRoomKVStore$1.set(id, data, userId);\n      };\n\n      self._handleChrmKVChanged = function (data) {\n        self.pull(data);\n      };\n\n      self._handleBeforeJoinChrm = function (_ref2) {\n        var id = _ref2.id;\n\n        self._reset(id);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _serverEngine$watch[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _serverEngine$watch));\n      this._serverEngine = serverEngine;\n      this._pullQueue = pullQueue;\n    }\n\n    var _proto = ChatRoomKVManager.prototype;\n\n    _proto._reset = function _reset(chrmId) {\n      ChatRoomKVStore$1.clear(chrmId);\n      PullTimeCache.clear(chrmId);\n    };\n\n    _proto._pullEvent = function _pullEvent(data) {\n      var time = data.time,\n          chrmId = data.chrmId,\n          currentTime = PullTimeCache.get(chrmId),\n          isUpdated = currentTime > time;\n      Logger.info(TAG.L_PULL_CHRM_KV_T, {\n        currentTime: currentTime,\n        serverTime: time,\n        isUpdated: isUpdated,\n        data: data\n      });\n\n      if (isUpdated) {\n        Logger.info(TAG.L_PULL_CHRM_KV_R, {\n          info: 'kv is updated. not pull again'\n        });\n        return utils.Defer.resolve();\n      }\n\n      return this._serverEngine.pullChatRoomKV({\n        id: chrmId\n      }, currentTime);\n    };\n\n    _proto.pull = function pull(data) {\n      this._pullQueue.pull(data);\n    };\n\n    _proto.getValue = function getValue(chrmId, key) {\n      return ChatRoomKVStore$1.getValue(chrmId, key);\n    };\n\n    _proto.getAll = function getAll(chrmId) {\n      return ChatRoomKVStore$1.getAll(chrmId);\n    };\n\n    _proto._notifyReceivedKV = function _notifyReceivedKV(chrmId, data) {\n      var self = this;\n      var kvEntries = data.kvEntries,\n          updatedEntries = [];\n\n      if (kvEntries.length > 0) {\n        utils.forEach(kvEntries, function (entry) {\n          var key = entry.key,\n              value = entry.value,\n              type = entry.type,\n              timestamp = entry.timestamp;\n\n          if (utils.isEqual(type, CHATROOM_ENTRY_TYPE.UPDATE)) {\n            updatedEntries.push({\n              key: key,\n              value: value,\n              timestamp: timestamp,\n              chatroomId: chrmId\n            });\n          }\n        });\n\n        self._eventEmitter.emit(KV_EVENT_NAME.KV_RECEIVED, updatedEntries);\n      }\n    };\n\n    _proto.watchReceived = function watchReceived(event) {\n      this._eventEmitter.on(KV_EVENT_NAME.KV_RECEIVED, event);\n    };\n\n    _proto.close = function close() {\n      var _self$_serverEngine$u;\n\n      var self = this;\n\n      self._serverEngine.unwatch((_self$_serverEngine$u = {}, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _self$_serverEngine$u[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _self$_serverEngine$u));\n    };\n\n    return ChatRoomKVManager;\n  }();\n\n  var SettingStore = function () {\n    function SettingStore(appkey, userId) {\n      this._storage = void 0;\n      var storageKey = utils.tplEngine(STORAGE_USER_SETTING.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      this._storage = new common.RCStorage(storageKey);\n    }\n\n    var _proto = SettingStore.prototype;\n\n    _proto.set = function set(serverData) {\n      var self = this,\n          _storage = self._storage,\n          settings = serverData.settings,\n          oldSettingItems = _storage.get(STORAGE_USER_SETTING.SUB_KEY.SETTINGS) || {};\n      var newSettingItems = oldSettingItems,\n          isChanged = false;\n      utils.forEach(settings, function (newSetting, key) {\n        newSetting = newSetting || {};\n        var oldSetting = oldSettingItems[key] || {},\n            _newSetting = newSetting,\n            newVersion = _newSetting.version,\n            status = _newSetting.status,\n            newValue = _newSetting.value,\n            oldGlobalVersion = _storage.get(STORAGE_USER_SETTING.SUB_KEY.VERSION) || 0,\n            isNeedUpdateItem = newVersion > (oldSetting.version || 0),\n            isNeedUpdateVersion = newVersion > oldGlobalVersion;\n\n        if (!isNeedUpdateItem) {\n          return;\n        }\n\n        isChanged = true;\n\n        switch (status) {\n          case USER_SETTING_STATUS.ADD:\n          case USER_SETTING_STATUS.UPDATE:\n            newSettingItems[key] = {\n              value: newValue,\n              version: newVersion\n            };\n            break;\n\n          case USER_SETTING_STATUS.DELETE:\n            delete newSettingItems[key];\n            break;\n\n          default:\n        }\n\n        if (isNeedUpdateVersion) {\n          _storage.set(STORAGE_USER_SETTING.SUB_KEY.VERSION, newVersion);\n        }\n      });\n\n      if (!isChanged) {\n        return;\n      }\n\n      if (utils.isEmpty(newSettingItems)) {\n        _storage.remove(STORAGE_USER_SETTING.SUB_KEY.SETTINGS);\n      } else {\n        _storage.set(STORAGE_USER_SETTING.SUB_KEY.SETTINGS, newSettingItems);\n      }\n    };\n\n    _proto.getSetting = function getSetting() {\n      var settings = this._storage.get(STORAGE_USER_SETTING.SUB_KEY.SETTINGS) || {};\n      return utils.map(settings, function (set) {\n        set = set || {};\n        return set.value;\n      });\n    };\n\n    _proto.getVersion = function getVersion() {\n      return this._storage.get(STORAGE_USER_SETTING.SUB_KEY.VERSION) || 0;\n    };\n\n    return SettingStore;\n  }();\n\n  var EventNames = {\n    CHANGED: 'change'\n  };\n\n  var SettingManager = function () {\n    function SettingManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._settingStore = void 0;\n      this._pullQueue = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._handleNotifySettingChanged = void 0;\n      var self = this,\n          appkey = option.appkey,\n          userId = option.userId,\n          isAutoPull = option.isAutoPull,\n          settingStore = new SettingStore(appkey, userId),\n          localVersion = settingStore.getVersion() || 0;\n      var pullQueue = new PullQueueManager({\n        event: serverEngine.getUserSettings,\n        thisArg: serverEngine,\n        onFinished: function onFinished(serverData) {\n          if (serverData && serverData.version) {\n            self._settingStore.set(serverData);\n\n            self._eventEmitter.emit(EventNames.CHANGED, self.get());\n          }\n        }\n      });\n\n      self._handleNotifySettingChanged = function (notifyData) {\n        var version = notifyData.version,\n            localVersion = self._settingStore.getVersion();\n\n        if (version >= localVersion) {\n          pullQueue.pull(localVersion);\n        }\n      };\n\n      self._settingStore = new SettingStore(appkey, userId);\n      self._pullQueue = pullQueue;\n      self._serverEngine = serverEngine;\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.USER_SETTING_CHANGED] = self._handleNotifySettingChanged, _serverEngine$watch));\n      isAutoPull && pullQueue.pull(localVersion);\n    }\n\n    var _proto = SettingManager.prototype;\n\n    _proto.watchSettingChanged = function watchSettingChanged(event) {\n      this._eventEmitter.on(EventNames.CHANGED, event);\n    };\n\n    _proto.get = function get() {\n      return this._settingStore.getSetting() || {};\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.USER_SETTING_CHANGED] = this._handleNotifySettingChanged, _this$_serverEngine$u));\n    };\n\n    return SettingManager;\n  }();\n\n  var WebIMEngine = function () {\n    function WebIMEngine(option) {\n      this._option = void 0;\n      this._user = void 0;\n      this._naviManager = void 0;\n      this._cmpManager = new CMPManager();\n      this._conversationManager = void 0;\n      this._messageManager = void 0;\n      this._chatRoomKVManager = void 0;\n      this._userSettingManager = void 0;\n      this._serverEngine = void 0;\n      this._imEventEmitter = new utils.EventEmitter();\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      this._connectedDomain = void 0;\n      this._networkDetecter = void 0;\n      this._joinedChatRoomSyner = void 0;\n      var self = this;\n      var detect = option.detect;\n      var serverEngine = new ServerEngine(option);\n      serverEngine.watch({\n        status: function status(_status) {\n          self._handleConnectionStatus(_status);\n        }\n      });\n      this._serverEngine = serverEngine;\n      this._option = option;\n      this._networkDetecter = new utils.NetworkDetecter(detect);\n      utils.forEach(ServerEngine.prototype, function (event, eventName) {\n        var server = serverEngine,\n            web = self;\n        var selfEvent = web[eventName],\n            serverEvent = server[eventName];\n\n        if (!selfEvent && serverEvent && utils.isFunction(serverEvent)) {\n          web[eventName] = function () {\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n\n            return serverEvent.call.apply(serverEvent, [server].concat(args));\n          };\n        }\n      });\n    }\n\n    var _proto = WebIMEngine.prototype;\n\n    _proto._notifyMessage = function _notifyMessage(event) {\n      var self = this;\n      var message = event.message;\n      var _serverEngine = self._serverEngine;\n\n      var connectedTime = _serverEngine.getConnectedTime();\n\n      if (common.isLogCommandMsg(message)) {\n        var content = message.content;\n        Logger.uploadFull(0, content, connectedTime);\n        return;\n      }\n\n      this._conversationManager.addMessage(event);\n\n      this._imEventEmitter.emit(IM_EVENT.MESSAGE, event);\n    };\n\n    _proto._handleConnectionStatus = function _handleConnectionStatus(status) {\n      var _cmpManager = this._cmpManager,\n          _naviManager = this._naviManager,\n          _connectedDomain = this._connectedDomain;\n      var isNeedUpdateCMPList = utils.isInclude(TRANSPORTER_STATUS_NEED_UPDATE_CMP, status);\n      var isNeedReconnect = utils.isInclude(TRANSPORTER_STATUS_NEED_RECONNECT, status);\n      var isKickedOfflineByOtherClient = utils.isEqual(CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, status);\n\n      if (isNeedUpdateCMPList) {\n        _cmpManager.addInvalid(_connectedDomain);\n\n        if (_cmpManager.isAllInvalid()) {\n          _naviManager.clear();\n\n          _cmpManager.clearInvalid();\n        }\n      }\n\n      if (isNeedReconnect) {\n        this.disconnect();\n        this.reconnect(true);\n      }\n\n      if (isKickedOfflineByOtherClient) {\n        this.disconnect();\n      }\n\n      var connectionStatus = TRANSPORTER_STATUS_TO_CONNECTION_STATUS[status] || status;\n      this._connectionStatus = connectionStatus;\n\n      this._imEventEmitter.emit(IM_EVENT.STATUS, {\n        status: connectionStatus\n      });\n    };\n\n    _proto._handleConnectError = function _handleConnectError(errorInfo) {\n      var _user = this._user;\n      var code = errorInfo.code || errorInfo.status;\n      this.disconnect();\n\n      if (code === ERROR_INFO.CONN_REDIRECTED.code) {\n        this._naviManager.clear();\n\n        return this.connect(_user);\n      }\n\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      return utils.Defer.reject(errorInfo);\n    };\n\n    _proto._afterConnect = function _afterConnect(connectUser, syncTime) {\n      var self = this,\n          _serverEngine = self._serverEngine,\n          appkey = self._option.appkey,\n          _imEventEmitter = self._imEventEmitter,\n          _naviManager = self._naviManager,\n          id = connectUser.id,\n          localNavi = _naviManager.getLocalConfig() || {};\n      Logger.setOption({\n        userId: id\n      });\n      self._user.id = id;\n      var conversationManager = new ConversationManager({\n        appkey: appkey,\n        userId: id\n      }, _serverEngine);\n      conversationManager.watch({\n        conversation: function conversation(_ref) {\n          var updatedConversationList = _ref.updatedConversationList;\n\n          _imEventEmitter.emit(IM_EVENT.CONVERSATION, {\n            updatedConversationList: updatedConversationList\n          });\n        }\n      });\n      self._conversationManager = conversationManager;\n      var messageManager = new MessagePullManager(_serverEngine, {\n        startSyncTime: syncTime\n      });\n      messageManager.watchMessage(function (event) {\n        self._notifyMessage(event);\n      });\n      self._messageManager = messageManager;\n      self._chatRoomKVManager = new ChatRoomKVManager(_serverEngine);\n\n      self._chatRoomKVManager.watchReceived(function (updatedEntries) {\n        self._imEventEmitter.emit(IM_EVENT.CHATROOM, {\n          updatedEntries: updatedEntries\n        });\n      });\n\n      var isAutoPull = !!Number(localNavi.openUS);\n      var userSettingManager = new SettingManager(_serverEngine, {\n        appkey: appkey,\n        userId: id,\n        isAutoPull: isAutoPull\n      });\n      self._joinedChatRoomSyner = new common.JoinedChatRoomSyner({\n        appkey: appkey,\n        userId: id\n      });\n      userSettingManager.watchSettingChanged(function (config) {\n        config = config || {};\n        var _config = config,\n            voipCallInfo = _config.VoipInfo;\n\n        _naviManager.setLocalConfig({\n          voipCallInfo: utils.toJSON(voipCallInfo)\n        });\n\n        self._imEventEmitter.emit(IM_EVENT.SETTING, config);\n      });\n      self._userSettingManager = userSettingManager;\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _events;\n\n      var statusWatcher = watchers.status,\n          messageWatcher = watchers.message,\n          conversationWatcher = watchers.conversation,\n          chatroomWatcher = watchers.chatroom;\n      var self = this;\n      var events = (_events = {}, _events[IM_EVENT.STATUS] = statusWatcher, _events[IM_EVENT.MESSAGE] = messageWatcher, _events[IM_EVENT.CONVERSATION] = conversationWatcher, _events[IM_EVENT.CHATROOM] = chatroomWatcher, _events);\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._imEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      var _imEventEmitter = this._imEventEmitter;\n      var offEventNameObj = {\n        status: 'IM_EVENT.STATUS',\n        message: 'IM_EVENT.MESSAGE',\n        conversation: 'IM_EVENT.CONVERSATION',\n        chatroom: 'IM_EVENT.CHATROOM'\n      };\n\n      if (watchers) {\n        utils.forEach(watchers, function (val, key) {\n          if (offEventNameObj[key]) {\n            _imEventEmitter.off(key, val);\n          }\n        });\n      } else {\n        _imEventEmitter.clear();\n      }\n    };\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._connectionStatus;\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      var user = this._user || {};\n      return user.id;\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      var _option = this._option,\n          _naviManager = this._naviManager,\n          _userSettingManager = this._userSettingManager;\n      return utils.extendInShallow(_option, {\n        navi: _naviManager.getLocalConfig(),\n        serverConfig: _userSettingManager ? _userSettingManager.get() : {}\n      });\n    };\n\n    _proto.connect = function connect(user, options) {\n      Logger.startRealtimeUpload();\n      var self = this;\n      var _option = self._option,\n          _serverEngine = self._serverEngine,\n          _cmpManager = self._cmpManager;\n      var naviOpt = common.getNavReqOption(_option, user);\n      var naviManager = new NaviManager(naviOpt);\n      var getServerConfig = _option.isOldServer ? _serverEngine.getOldServerConfig : _serverEngine.getServerConfig;\n      options = options || {};\n      var isAutoReconnect = options.isAutoReconnect;\n\n      self._handleConnectionStatus(CONNECTION_STATUS.CONNECTING);\n\n      self._user = utils.copy(user);\n      self._naviManager = naviManager;\n      var connectUser;\n      return naviManager.get().then(function (configForNavi) {\n        var cmpDomainList = common.getCMPDomainList(configForNavi, _option);\n        Logger.setServerOption(configForNavi);\n\n        _cmpManager.setDomainList(cmpDomainList);\n\n        return _cmpManager.getFaster();\n      }).then(function (_ref2) {\n        var domain = _ref2.domain;\n        self._connectedDomain = domain;\n        return _serverEngine.connect(user, {\n          domain: domain\n        });\n      }).then(function (user) {\n        connectUser = user;\n        isAutoReconnect && self.rejoinChatRoom();\n        return getServerConfig.call(_serverEngine, user.id);\n      }).then(function (serverConfig) {\n        self._afterConnect(connectUser, serverConfig);\n\n        self._handleConnectionStatus(CONNECTION_STATUS.CONNECTED);\n\n        return connectUser;\n      })[\"catch\"](function (error) {\n        return self._handleConnectError(error);\n      });\n    };\n\n    _proto.reconnect = function reconnect(isAutoReconnect) {\n      var self = this;\n      var _user = self._user;\n\n      if (utils.isUndefined(_user)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      return self._networkDetecter.start().then(function () {\n        return self.connect(_user, {\n          isAutoReconnect: isAutoReconnect\n        });\n      });\n    };\n\n    _proto.disconnect = function disconnect(isNotify) {\n      isNotify && this._handleConnectionStatus(CONNECTION_STATUS.DISCONNECTED);\n      this._networkDetecter && this._networkDetecter.stop();\n      this._messageManager && this._messageManager.close();\n      this._chatRoomKVManager && this._chatRoomKVManager.close();\n      this._userSettingManager && this._userSettingManager.close();\n      this._conversationManager && this._conversationManager.close();\n      return this._serverEngine.disconnect();\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      this.disconnect(true);\n      return this.connect(user);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, option) {\n      var self = this;\n      return self._serverEngine.sendMessage(conversation, option).then(function (message) {\n        self._conversationManager.addMessage({\n          message: message,\n          hasMore: false\n        });\n\n        return message;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var self = this;\n      return self._serverEngine.recallMessage(conversation, message, option).then(function (message) {\n        self._conversationManager.addMessage({\n          message: message,\n          hasMore: false\n        });\n\n        return message;\n      });\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine,\n          _conversationManager = this._conversationManager;\n      var func = isOldServer ? _serverEngine.getOldConversationList : _serverEngine.getConversationList;\n      return func.call(_serverEngine, option, {\n        afterDecode: function afterDecode(conversation) {\n          var localConversation = _conversationManager.get(conversation);\n\n          conversation = utils.extendAllowNull(conversation, localConversation);\n          return conversation;\n        }\n      }).then(function (list) {\n        return common.sortConList(list);\n      });\n    };\n\n    _proto.getLocalConversation = function getLocalConversation(conversation) {\n      var local = this._conversationManager.get(conversation);\n\n      return {\n        unreadMessageCount: local.unreadMessageCount || 0,\n        hasMentiond: local.hasMentiond || false,\n        mentiondInfo: local.mentiondInfo\n      };\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n      var func = isOldServer ? _serverEngine.removeOldConversation : _serverEngine.removeConversation;\n      return func.call(_serverEngine, conversation);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        var totalCount = this._conversationManager.getTotalUnreadCount();\n\n        return utils.Defer.resolve(totalCount);\n      } else {\n        return _serverEngine.getTotalUnreadCount();\n      }\n    };\n\n    _proto.getUnreadCount = function getUnreadCount(conversation) {\n      var isOldServer = this._option.isOldServer;\n\n      if (isOldServer) {\n        var count = this._conversationManager.getUnreadCount(conversation);\n\n        return utils.Defer.resolve(count);\n      }\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        this._conversationManager.read(conversation);\n\n        return utils.Defer.resolve();\n      } else {\n        return _serverEngine.clearUnreadCount(conversation, option);\n      }\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var _serverEngine = self._serverEngine,\n          _naviManager = self._naviManager,\n          _chatRoomKVManager = self._chatRoomKVManager,\n          _joinedChatRoomSyner = self._joinedChatRoomSyner;\n      var isAutoRejoin = option.isAutoRejoin;\n      return _serverEngine.joinChatRoom(chrm, option).then(function () {\n        return _naviManager.get();\n      }).then(function (configForNavi) {\n        var isOpenKVStorageService = configForNavi.kvStorage,\n            isOpenJoinMulitpleChrmService = configForNavi.joinMChrm;\n        !isAutoRejoin && _joinedChatRoomSyner.set({\n          chrmId: chrm.id,\n          count: option.count,\n          isOpenJoinMulitpleChrmService: isOpenJoinMulitpleChrmService\n        });\n        var initialTime = 0;\n        return isOpenKVStorageService ? _chatRoomKVManager.pull({\n          time: initialTime,\n          chrmId: chrm.id\n        }) : utils.Defer.resolve();\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var self = this;\n      var _serverEngine = self._serverEngine;\n      return _serverEngine.quitChatRoom(chrm).then(function () {\n        self._joinedChatRoomSyner.remove(chrm.id);\n\n        return utils.Defer.resolve();\n      });\n    };\n\n    _proto.rejoinChatRoom = function rejoinChatRoom() {\n      var self = this;\n      var _joinedChatRoomSyner = self._joinedChatRoomSyner,\n          _imEventEmitter = self._imEventEmitter;\n\n      var joinedChrmInfos = _joinedChatRoomSyner.get();\n\n      utils.forEach(joinedChrmInfos, function (chrmInfo) {\n        var chrmId = chrmInfo.chrmId,\n            count = chrmInfo.count;\n        var isAutoRejoin = true,\n            isJoinExist = true;\n        var rejoinedRoom = {\n          chrmId: chrmId,\n          count: count\n        };\n        return self.joinChatRoom({\n          id: chrmId\n        }, {\n          count: count,\n          isAutoRejoin: isAutoRejoin,\n          isJoinExist: isJoinExist\n        }).then(function () {\n          _imEventEmitter.emit(IM_EVENT.CHATROOM, {\n            rejoinedRoom: rejoinedRoom\n          });\n        }, function (reason) {\n          _imEventEmitter.emit(IM_EVENT.CHATROOM, {\n            rejoinedRoom: utils.extend(rejoinedRoom, {\n              errorCode: reason\n            })\n          });\n        });\n      });\n    };\n\n    _proto.setChatRoomKV = function setChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.UPDATE,\n        userId: self._user.id\n      });\n      entry.type = CHATROOM_ENTRY_TYPE.UPDATE;\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceSetChatRoomKV = function forceSetChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.setChatRoomKV(chrm, entry);\n    };\n\n    _proto.removeChatRoomKV = function removeChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.DELETE,\n        userId: self._user.id\n      });\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceRemoveChatRoomKV = function forceRemoveChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.removeChatRoomKV(chrm, entry);\n    };\n\n    _proto.getChatRoomKV = function getChatRoomKV(chrm, key) {\n      var value = this._chatRoomKVManager.getValue(chrm.id, key);\n\n      if (utils.isEmpty(value)) {\n        return utils.Defer.reject(ERROR_INFO.CHATROOM_KEY_NOT_EXIST);\n      } else {\n        return utils.Defer.resolve(value);\n      }\n    };\n\n    _proto.getAllChatRoomKV = function getAllChatRoomKV(chrm) {\n      var kvs = this._chatRoomKVManager.getAll(chrm.id);\n\n      return utils.Defer.resolve(kvs);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, originName) {\n      var self = this;\n      var fileName = common.genUploadFileName(fileType, originName);\n      var uploadDomains = common.getUploadFileDomains(self._naviManager.getLocalConfig());\n      return self._serverEngine.getFileToken(fileType, fileName).then(function (data) {\n        return utils.extendInShallow(uploadDomains, data);\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName, uploadResp) {\n      var self = this;\n      uploadResp = uploadResp || {};\n\n      if (uploadResp.isBosRes) {\n        return utils.Defer.resolve(uploadResp);\n      }\n\n      return self._serverEngine.getFileUrl(fileType, fileName, originName);\n    };\n\n    return WebIMEngine;\n  }();\n\n  var Engine = (function (imArg) {\n    return new WebIMEngine(imArg);\n  });\n\n  var execEngineByEvent = function execEngineByEvent(params, engine) {\n    var eventName = params.event,\n        args = params.args;\n    args = args || [];\n\n    var engineEvent = engine[eventName] || function () {\n      return utils.Defer.reject(ERROR_INFO.SDK_INTERNAL_ERROR);\n    };\n\n    return engineEvent.apply(engine, args);\n  };\n\n  var EngineDispatcher = function () {\n    function EngineDispatcher(option) {\n      this._engine = void 0;\n      this._engine = new Engine(option);\n    }\n\n    var _proto = EngineDispatcher.prototype;\n\n    _proto._isEventNeedConnect = function _isEventNeedConnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isNotConnected = connectionStatus !== CONNECTION_STATUS.CONNECTED,\n          isEventNeedConnected = utils.isInclude(ENGINE_EVENT_NEED_CONNECTED, eventName);\n      return isNotConnected && isEventNeedConnected;\n    };\n\n    _proto._isEventNeedDisconnect = function _isEventNeedDisconnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isConnecting = common.isConnected(connectionStatus) || common.isConnecting(connectionStatus),\n          isEventNeedDisconnected = utils.isInclude(ENGINE_EVENT_NEED_DISCONNECTED, eventName);\n      return isConnecting && isEventNeedDisconnected;\n    };\n\n    _proto._exec = function _exec(params) {\n      var event = params.event;\n      var engine = this._engine;\n\n      if (this._isEventNeedConnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      if (this._isEventNeedDisconnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.RC_CONNECTION_EXIST);\n      }\n\n      var execResult = execEngineByEvent(params, engine);\n      return utils.isPromise(execResult) ? execResult[\"catch\"](function (error) {\n        var errorCode = error.status || error.code || error;\n        var msg = utils.isObject(error) ? error.msg : null;\n        var errorInfo = ERROR_CODE_TO_INFO[errorCode] || {\n          code: errorCode\n        };\n\n        if (msg) {\n          errorInfo.msg = msg;\n        }\n\n        var isValidErrorCode = utils.isNumberData(errorCode);\n\n        if (!isValidErrorCode) {\n          if (utils.isStackError(error)) {\n            error = error.stack.toString();\n          }\n\n          Logger.fatal(TAG.L_CRASH_E, {\n            content: {\n              desc: 'SDK Error',\n              error: error\n            }\n          });\n          errorInfo = utils.extendInShallow(ERROR_INFO.SDK_INTERNAL_ERROR, {\n            error: error\n          });\n        }\n\n        return utils.Defer.reject(errorInfo);\n      }) : execResult;\n    };\n\n    _proto.exec = function exec(params) {\n      var event = params.event;\n\n      var LOG_TAG = APP_ENGINE_EVENT_LOG_TAG[event],\n          isNeedLog = !utils.isEmpty(LOG_TAG),\n          _ref = LOG_TAG || {},\n          reqLogTag = _ref.req,\n          respLogTag = _ref.resp;\n\n      isNeedLog && Logger.info(reqLogTag, params);\n\n      var execResult = this._exec(params);\n\n      if (utils.isPromise(execResult)) {\n        return execResult.then(function (result) {\n          isNeedLog && Logger.info(respLogTag, result);\n          return result;\n        })[\"catch\"](function (error) {\n          error = error || {};\n          var _error = error,\n              code = _error.code;\n\n          if (isNeedLog && !Logger.isIgnoreErrorCode(code)) {\n            Logger.error(respLogTag, error);\n          }\n\n          return utils.Defer.reject(error);\n        });\n      } else {\n        isNeedLog && Logger.info(respLogTag, execResult);\n        return execResult;\n      }\n    };\n\n    return EngineDispatcher;\n  }();\n\n  var Type = function Type(name, validator, options) {\n    options = options || {};\n    var self = this;\n    self.validate = validator;\n    self.name = name;\n    self.errorInfo = options.errorInfo;\n\n    self.canBeNull = function () {\n      self.validate = function (data) {\n        return utils.isUndefined(data) || utils.isNull(data) || validator(data);\n      };\n\n      return self;\n    };\n  };\n\n  Type.isType = function (type) {\n    return type instanceof Type;\n  };\n\n  Type.String = new Type('String', utils.isString);\n  Type.Number = new Type('Number', utils.isNumber);\n  Type.Boolean = new Type('Boolean', utils.isBoolean);\n  Type.Function = new Type('Function', utils.isFunction);\n  Type.Object = new Type('Object', utils.isObject);\n  Type.Array = new Type('Array', utils.isArray);\n  Type.NotAllUndefined = new Type('AllUndefined', function (obj) {\n    if (utils.isObject(obj) || utils.isArray(obj)) {\n      var isNotUndefined = false;\n      utils.forEach(obj, function (val) {\n        if (!utils.isUndefined(val)) {\n          isNotUndefined = true;\n        }\n      });\n      return isNotUndefined;\n    } else {\n      return !utils.isUndefined(obj);\n    }\n  });\n  var conversationType = common.getConversationTypeList().join('、');\n  Type.ConversationType = new Type(conversationType, common.isValidConversationType, {\n    errorInfo: 'Not all settings are empty'\n  });\n  Type.ChatRoomEntryKey = new Type('ChatRoomEntryKey', common.isValidChatRoomKey, {\n    errorInfo: 'ChatRoom Key length must be 1 - 128, Only letters、numbers、+、=、-、_ are supported'\n  });\n  Type.ChatRoomEntryValue = new Type('ChatRoomEntryValue', common.isValidChatRoomValue, {\n    errorInfo: 'ChatRoom Value length must be 1 - 4096'\n  });\n\n  var Struct = function () {\n    function Struct(structure, funcName, paths) {\n      if (paths === void 0) {\n        paths = [];\n      }\n\n      if (!(this instanceof Struct)) {\n        return new Struct(structure, funcName, paths);\n      }\n\n      var self = this;\n      self.structure = structure;\n      self.paths = paths;\n      self.funcName = funcName;\n\n      if (Type.isType(structure)) {\n        self.validate = self._validateType;\n      } else if (utils.isArray(structure)) {\n        self.validate = self._validateArray;\n      } else if (utils.isObject(structure)) {\n        self.validate = self._validateObject;\n      } else {\n        self.validate = self._validateOther;\n      }\n    }\n\n    var _proto = Struct.prototype;\n\n    _proto._validateType = function _validateType(data) {\n      var structure = this.structure;\n      var isValid = structure.validate(data);\n      return isValid ? this._getSuccess() : this._getError(data);\n    };\n\n    _proto._validateArray = function _validateArray(data) {\n      var structure = this.structure;\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isArray(data)) {\n        return this._getError(data);\n      }\n\n      var typer = structure[0];\n\n      for (var filed in data) {\n        var val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateObject = function _validateObject(data) {\n      var structure = this.structure,\n          paths = this.paths;\n      data = data || {};\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isObject(data)) {\n        return this._getError(data);\n      }\n\n      var checkedField = [];\n\n      for (var filed in data) {\n        var typer = structure[filed],\n            val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n\n        checkedField.push(filed);\n      }\n\n      for (var checkField in structure) {\n        var _typer = structure[checkField];\n        var unCheckData = data[checkField];\n\n        if (!utils.isInclude(checkedField, checkField) && !_typer.validate(unCheckData)) {\n          var errPaths = utils.copy(paths);\n          errPaths.push(checkField);\n          return this._getError(unCheckData, {\n            paths: errPaths,\n            expect: _typer.name\n          });\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateOther = function _validateOther(data) {\n      var self = this;\n      var structure = self.structure;\n\n      if (utils.isEqual(structure, data) || utils.isEmpty(structure)) {\n        return self._getSuccess();\n      } else {\n        return self._getError(data, {\n          current: data,\n          expect: structure\n        });\n      }\n    };\n\n    _proto._validateField = function _validateField(typer, filed, value) {\n      var paths = this.paths,\n          funcName = this.funcName;\n      var newPaths = utils.copy(paths);\n      newPaths.push(filed);\n      return new Struct(typer, funcName, newPaths).validate(value);\n    };\n\n    _proto._getError = function _getError(data, options) {\n      if (options === void 0) {\n        options = [];\n      }\n\n      var structure = this.structure,\n          paths = this.paths,\n          funcName = this.funcName;\n      options = utils.extend({\n        current: data,\n        expect: structure.name || utils.getTypeName(structure),\n        paths: paths\n      }, options);\n      paths = options.paths;\n      var _options = options,\n          current = _options.current,\n          expect = _options.expect;\n      var param = utils.isEmpty(paths) ? 'param' : paths.join('.');\n      var currentType = utils.getTypeName(current);\n      current = utils.toJSON(current) || current;\n      current = current + \"(\" + currentType + \")\";\n      var msg = utils.tplEngine(ERROR_INFO.PARAMETER_ERROR.msg, {\n        param: param,\n        expect: expect,\n        current: current\n      });\n      var info = {\n        code: ERROR_INFO.PARAMETER_ERROR.code,\n        funcName: funcName,\n        msg: msg\n      };\n      var jsonInfo = utils.toJSON(info);\n      if (utils.isEmpty(funcName)) delete info[funcName];\n\n      if (structure.errorInfo) {\n        info = structure.errorInfo;\n      }\n\n      return {\n        isError: true,\n        info: info,\n        jsonInfo: jsonInfo\n      };\n    };\n\n    _proto._getSuccess = function _getSuccess() {\n      return {\n        isError: false\n      };\n    };\n\n    return Struct;\n  }();\n\n  var validate = (function (struct, params, eventName) {\n    return Struct(struct, eventName).validate(params);\n  });\n\n  var _MESSAGE_TYPE_VALIDAT;\n  var MESSAGE_TYPE_VALIDATE = (_MESSAGE_TYPE_VALIDAT = {}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.TEXT] = {\n    content: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.VOICE] = {\n    content: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.HQ_VOICE] = {\n    remoteUrl: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.IMAGE] = {\n    content: Type.String,\n    imageUri: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.GIF] = {\n    gifDataSize: Type.Number,\n    width: Type.Number,\n    height: Type.Number,\n    remoteUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.RICH_CONTENT] = {\n    title: Type.String,\n    content: Type.String,\n    imageUri: Type.String,\n    url: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.LOCATION] = {\n    content: Type.String,\n    latitude: Type.Number,\n    longitude: Type.Number,\n    poi: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.FILE] = {\n    name: Type.String,\n    size: Type.Number,\n    type: Type.String,\n    fileUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.SIGHT] = {\n    sightUrl: Type.String,\n    content: Type.String,\n    duration: Type.Number,\n    size: Type.Number,\n    name: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.COMBINE] = {\n    remoteUrl: Type.String,\n    conversationType: Type.Number,\n    nameList: Type.Array,\n    summaryList: Type.Array\n  }, _MESSAGE_TYPE_VALIDAT);\n  var validateMsgContent = (function (objectName, option, eventName) {\n    var validateByObjectName = MESSAGE_TYPE_VALIDATE[objectName];\n\n    if (validateByObjectName) {\n      return validate(validateByObjectName, option, eventName);\n    } else {\n      return {\n        isError: false,\n        info: ''\n      };\n    }\n  });\n\n  var Conversation = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      Conversation.create = function create(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.get = function get(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.merge = function merge(option) {\n        try {\n          return common.mergeConversationList(option);\n        } catch (e) {\n          utils.consoleError(e);\n        }\n      };\n\n      Conversation.remove = function remove(option) {\n        var _validate = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'Conversation.remove'),\n            isError = _validate.isError,\n            info = _validate.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [option]\n        });\n      };\n\n      Conversation.getList = function getList(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull(),\n          startTime: Type.Number.canBeNull()\n        }, option, 'Conversation.getList'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CONVERSATION_LIST,\n          args: [option]\n        });\n      };\n\n      Conversation.getTotalUnreadCount = function getTotalUnreadCount() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT\n        });\n      };\n\n      function Conversation(option) {\n        this.type = void 0;\n        this.targetId = void 0;\n\n        var _validate3 = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'new Conversation'),\n            isError = _validate3.isError,\n            jsonInfo = _validate3.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = Conversation.prototype;\n\n      _proto.send = function send(option) {\n        var eventName = 'conversation.send';\n\n        var _validate4 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        var _option2 = option,\n            isMentioned = _option2.isMentioned,\n            mentionedType = _option2.mentionedType,\n            mentionedUserIdList = _option2.mentionedUserIdList;\n        isMentioned && (option.isMentiond = isMentioned);\n        mentionedType && (option.mentiondType = mentionedType);\n        mentionedUserIdList && (option.mentiondUserIdList = mentionedUserIdList);\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        option = utils.extendInShallow(SEND_MESSAGE_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [this, option]\n        });\n      };\n\n      _proto.recall = function recall(message, option) {\n        var _validate5 = validate({\n          sentTime: Type.Number,\n          messageUId: Type.String\n        }, message, 'conversation.recall'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.RECALL_MESSAGE,\n          args: [this, message, option]\n        });\n      };\n\n      _proto.read = function read(option) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_UNREAD_COUNT,\n          args: [this, option]\n        });\n      };\n\n      _proto.getUnreadCount = function getUnreadCount() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_UNREAD_COUNT,\n          args: [conversation]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          order: Type.Number.canBeNull(),\n          count: Type.Number.canBeNull(),\n          timestrap: Type.Number.canBeNull()\n        }, option, 'conversation.getMessages'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_MESSAGES_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_HISTORY_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.deleteMessages = function deleteMessages(messages) {\n        var _validate7 = validate([{\n          sentTime: Type.Number,\n          messageUId: Type.String,\n          messageDirection: Type.Number\n        }], messages, 'conversation.deleteMessages'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DELETE_MESSAGES,\n          args: [this, messages]\n        });\n      };\n\n      _proto.clearMessages = function clearMessages(option) {\n        var _validate8 = validate({\n          timestrap: Type.Number\n        }, option, 'conversation.clearMessages'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_MESSAGES,\n          args: [this, option]\n        });\n      };\n\n      _proto.setStatus = function setStatus(option) {\n        var _validate9 = validate({\n          notificationStatus: Type.Number.canBeNull(),\n          isTop: Type.Boolean.canBeNull()\n        }, option, 'conversation.setStatus'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var allUndefinedValidate = validate(Type.NotAllUndefined, option);\n        isError = allUndefinedValidate.isError;\n\n        if (isError) {\n          info = allUndefinedValidate.info;\n          return utils.Defer.reject(info);\n        }\n\n        var notificationStatus = option.notificationStatus,\n            isTop = option.isTop;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_CONVERSATION_STATUS_LIST,\n          args: [[{\n            type: this.type,\n            targetId: this.targetId,\n            notificationStatus: notificationStatus,\n            isTop: isTop\n          }]]\n        });\n      };\n\n      _proto.setStatusList = function setStatusList(statusList) {\n        var _validate10 = validate([{\n          notificationStatus: Type.Number.canBeNull(),\n          isTop: Type.Boolean.canBeNull()\n        }], statusList, 'conversation.setStatusList'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var self = this;\n        statusList = utils.map(statusList, function (status) {\n          return utils.extend(status, {\n            type: self.type,\n            targetId: self.targetId\n          });\n        });\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_CONVERSATION_STATUS_LIST,\n          args: [statusList]\n        });\n      };\n\n      _proto.destory = function destory() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [conversation]\n        });\n      };\n\n      return Conversation;\n    }(), _temp;\n  });\n\n  var ChatRoom = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      ChatRoom.get = function get(option) {\n        return new ChatRoom(option);\n      };\n\n      function ChatRoom(option) {\n        this.id = void 0;\n\n        var _validate = validate({\n          id: Type.String\n        }, option, 'new ChatRoom'),\n            isError = _validate.isError,\n            jsonInfo = _validate.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = ChatRoom.prototype;\n\n      _proto.join = function join(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatRoom.join'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.joinExist = function joinExist(option) {\n        var _validate3 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatRoom.joinExist'),\n            isError = _validate3.isError,\n            info = _validate3.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option['isJoinExist'] = true;\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_CHATROOM,\n          args: [this]\n        });\n      };\n\n      _proto.getInfo = function getInfo(option) {\n        var _validate4 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull()\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_INFO_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_INFO,\n          args: [this, option]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var eventName = 'chatRoom.send';\n\n        var _validate5 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var id = this.id;\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: id\n        };\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull(),\n          timestrap: Type.Number\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_MESSAGES, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.setEntry = function setEntry(option) {\n        var _validate7 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.setEntry'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceSetEntry = function forceSetEntry(option) {\n        var _validate8 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.forceSetEntry'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.removeEntry = function removeEntry(option) {\n        var _validate9 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.removeEntry'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceRemoveEntry = function forceRemoveEntry(option) {\n        var _validate10 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.forceRemoveEntry'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.getEntry = function getEntry(key) {\n        var _validate11 = validate(Type.ChatRoomEntryKey, key, 'chatRoom.getEntry'),\n            isError = _validate11.isError,\n            info = _validate11.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_KV,\n          args: [this, key]\n        });\n      };\n\n      _proto.getAllEntries = function getAllEntries() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_ALL_KV,\n          args: [this]\n        });\n      };\n\n      return ChatRoom;\n    }(), _temp;\n  });\n\n  var RTC = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      RTC.get = function get(option) {\n        return new RTC(option);\n      };\n\n      function RTC(option) {\n        this.roomId = void 0;\n        this.option = void 0;\n        this.roomId = option.id;\n        this.option = option;\n      }\n\n      var _proto = RTC.prototype;\n\n      _proto.join = function join() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.ping = function ping() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.PING_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.getRoomInfo = function getRoomInfo() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_ROOM_INFO,\n          args: [this.option]\n        });\n      };\n\n      _proto.getUserInfoList = function getUserInfoList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_INFO_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setUserInfo = function setUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.removeUserInfo = function removeUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.setData = function setData(key, value, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_DATA,\n          args: [this.roomId, key, value, isInner, apiType, message]\n        });\n      };\n\n      _proto.getData = function getData(keys, isInner, apiType) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType]\n        });\n      };\n\n      _proto.removeData = function removeData(keys, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType, message]\n        });\n      };\n\n      _proto.setUserData = function setUserData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.setRTCUserData = function setRTCUserData(message, valueInfo, objectName) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_USER_DATA,\n          args: [this.roomId, message, valueInfo, objectName]\n        });\n      };\n\n      _proto.getUserData = function getUserData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.PERSON);\n      };\n\n      _proto.removeUserData = function removeUserData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.setRoomData = function setRoomData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getRoomData = function getRoomData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.ROOM);\n      };\n\n      _proto.removeRoomData = function removeRoomData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getUserList = function getUserList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setOutData = function setOutData(rtcData, type, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_OUT_DATA,\n          args: [this.roomId, rtcData, type, message]\n        });\n      };\n\n      _proto.getOutData = function getOutData(userIds) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_OUT_DATA,\n          args: [this.roomId, userIds]\n        });\n      };\n\n      _proto.getToken = function getToken() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_TOKEN,\n          args: [this.option]\n        });\n      };\n\n      _proto.setState = function setState(content) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_STATE,\n          args: [this.option, content]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var id = this.roomId;\n        var conversation = {\n          type: CONVERSATION_TYPE.RTC_ROOM,\n          targetId: id\n        };\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      return RTC;\n    }(), _temp;\n  });\n\n  var IM = function () {\n    function IM(option) {\n      this._engineDispatcher = void 0;\n\n      var _validate = validate({\n        appkey: Type.String\n      }, option, 'RongIMLib.init'),\n          isError = _validate.isError,\n          jsonInfo = _validate.jsonInfo;\n\n      if (isError) {\n        throw Error(jsonInfo);\n      }\n\n      var engineHandler = new EngineDispatcher(option);\n      this._engineDispatcher = engineHandler;\n      var Modules = {\n        Conversation: Conversation(engineHandler),\n        ChatRoom: ChatRoom(engineHandler),\n        RTC: RTC(engineHandler)\n      };\n      utils.extend(this, Modules);\n    }\n\n    var _proto = IM.prototype;\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_STATUS\n      });\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_USER_ID\n      });\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTED_TIME\n      });\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_APP_INFO\n      });\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _validate2 = validate({\n        conversation: Type.Function.canBeNull(),\n        message: Type.Function.canBeNull(),\n        status: Type.Function.canBeNull(),\n        setting: Type.Function.canBeNull()\n      }, watchers, 'im.watch'),\n          isError = _validate2.isError,\n          jsonInfo = _validate2.jsonInfo;\n\n      if (isError) {\n        utils.consoleError(jsonInfo);\n        return jsonInfo;\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.UN_WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.connect = function connect(user) {\n      var _validate3 = validate({\n        token: Type.String\n      }, user, 'im.connect'),\n          isError = _validate3.isError,\n          info = _validate3.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.CONNECT,\n        args: [user]\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.RECONNECT\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.DISCONNECT,\n        args: [true]\n      });\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      var _validate4 = validate({\n        token: Type.String\n      }, user, 'im.changeUser'),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var self = this;\n      return self.disconnect().then(function () {\n        return self.connect(user);\n      });\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, originName) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_TOKEN,\n        args: [fileType, originName]\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName, uploadResp) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_URL,\n        args: [fileType, fileName, originName, uploadResp]\n      });\n    };\n\n    return IM;\n  }();\n\n  var imInstance;\n\n  var initLogger = function initLogger(option, im) {\n    var isDebug = option.isDebug,\n        appkey = option.appkey,\n        logCollectEvent = option.logger;\n    utils.isFunction(logCollectEvent) && Logger.watchLog(logCollectEvent);\n    Logger.setOption({\n      isDebug: isDebug,\n      appkey: appkey\n    });\n    Logger.info(TAG.A_INIT_O, {\n      content: option\n    });\n    im.watch({\n      status: function status(_ref) {\n        var _status = _ref.status;\n        Logger.setOption({\n          isNetworkUnavailable: utils.isEqual(_status, CONNECTION_STATUS.NETWORK_UNAVAILABLE)\n        });\n      }\n    });\n  };\n\n  var init = function init(option) {\n    option = utils.extendInShallow(IM_OPTION, option);\n    option.connectType = common.getConnectType(option);\n\n    if (!imInstance) {\n      imInstance = new IM(option);\n      initLogger(option, imInstance);\n    }\n\n    return imInstance;\n  };\n\n  var getInstance = function getInstance() {\n    return imInstance;\n  };\n\n  var index = utils.extend({\n    init: init,\n    getInstance: getInstance,\n    env: env,\n    common: common,\n    ERROR_CODE: ERROR_CODE,\n    Logger: Logger\n  }, product);\n\n  return index;\n\n})));\n"
  },
  {
    "path": "api-test/lib/js/es6-promise.js",
    "content": "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){\"use strict\";function t(t){var e=typeof t;return null!==t&&(\"object\"===e||\"function\"===e)}function e(t){return\"function\"==typeof t}function n(t){W=t}function r(t){z=t}function o(){return function(){return process.nextTick(a)}}function i(){return\"undefined\"!=typeof U?function(){U(a)}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode(\"\");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<N;t+=2){var e=Q[t],n=Q[t+1];e(n),Q[t]=void 0,Q[t+1]=void 0}N=0}function f(){try{var t=Function(\"return this\")().require(\"vertx\");return U=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(v);void 0===r[V]&&x(r);var o=n._state;if(o){var i=arguments[o-1];z(function(){return T(o,r,i,n._result)})}else j(n,r,t,e);return r}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var n=new e(v);return w(n,t),n}function v(){}function p(){return new TypeError(\"You cannot resolve a promise with itself\")}function d(){return new TypeError(\"A promises callback cannot return that same promise.\")}function _(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function y(t,e,n){z(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n))},function(e){r||(r=!0,S(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!r&&o&&(r=!0,S(t,o))},t)}function m(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)})}function b(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void 0===r?A(t,n):e(r)?y(t,n,r):A(t,n)}function w(e,n){if(e===n)S(e,p());else if(t(n)){var r=void 0;try{r=n.then}catch(o){return void S(e,o)}b(e,n,r)}else A(e,n)}function g(t){t._onerror&&t._onerror(t._result),E(t)}function A(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t))}function S(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t))}function j(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t)}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?T(n,r,o,i):o(i);t._subscribers.length=0}}function T(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o)}catch(a){c=!1,u=a}if(n===s)return void S(n,d())}else s=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s))}function M(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(n){S(t,n)}}function P(){return tt++}function x(t){t[V]=tt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function C(){return new Error(\"Array Methods must be provided an Array\")}function O(t){return new et(this,t).promise}function k(t){var e=this;return new e(L(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function F(t){var e=this,n=new e(v);return S(n,t),n}function Y(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function q(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function D(){var t=void 0;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(e){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if(\"[object Promise]\"===r&&!n.cast)return}t.Promise=nt}var K=void 0;K=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var L=K,N=0,U=void 0,W=void 0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R())},B=\"undefined\"!=typeof window?window:void 0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),J=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,Q=new Array(1e3),R=void 0;R=I?o():H?s():J?u():void 0===B&&\"function\"==typeof require?f():c();var V=Math.random().toString(36).substring(2),X=void 0,Z=1,$=2,tt=0,et=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(v),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C())}return t.prototype._enumerate=function(t){for(var e=0;this._state===X&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(u){s=!0,i=u}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=t;else if(n===nt){var c=new n(v);s?S(c,i):b(c,t,o),this._willSettleAt(c,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){return n._settledAt(Z,e,t)},function(t){return n._settledAt($,e,t)})},t}(),nt=function(){function t(e){this[V]=P(),this._result=this._state=void 0,this._subscribers=[],v!==e&&(\"function\"!=typeof e&&Y(),this instanceof t?M(this,e):q())}return t.prototype[\"catch\"]=function(t){return this.then(null,t)},t.prototype[\"finally\"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):n.then(t,t)},t}();return nt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt});"
  },
  {
    "path": "api-test/lib/js/vue-2.6.10.js",
    "content": "/*!\n * Vue.js v2.6.11\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){\"use strict\";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return\"string\"==typeof e||\"number\"==typeof e||\"symbol\"==typeof e||\"boolean\"==typeof e}function o(e){return null!==e&&\"object\"==typeof e}var a=Object.prototype.toString;function s(e){return\"[object Object]\"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&\"function\"==typeof e.then&&\"function\"==typeof e.catch}function l(e){return null==e?\"\":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(\",\"),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var d=p(\"slot,component\",!0),v=p(\"key,ref,slot,slot-scope,is\");function h(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():\"\"})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\\B([A-Z])/g,C=g(function(e){return e.replace(w,\"-$1\").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n<e.length;n++)e[n]&&A(t,e[n]);return t}function S(e,t,n){}var T=function(e,t,n){return!1},E=function(e){return e};function N(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every(function(e,n){return N(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every(function(n){return N(e[n],t[n])})}catch(e){return!1}}function j(e,t){for(var n=0;n<e.length;n++)if(N(e[n],t))return n;return-1}function D(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var L=\"data-server-rendered\",M=[\"component\",\"directive\",\"filter\"],I=[\"beforeCreate\",\"created\",\"beforeMount\",\"mounted\",\"beforeUpdate\",\"updated\",\"beforeDestroy\",\"destroyed\",\"activated\",\"deactivated\",\"errorCaptured\",\"serverPrefetch\"],F={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:S,parsePlatformTagName:E,mustUseProp:T,async:!0,_lifecycleHooks:I},P=/a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;function R(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H=new RegExp(\"[^\"+P.source+\".$_\\\\d]\");var B,U=\"__proto__\"in{},z=\"undefined\"!=typeof window,V=\"undefined\"!=typeof WXEnvironment&&!!WXEnvironment.platform,K=V&&WXEnvironment.platform.toLowerCase(),J=z&&window.navigator.userAgent.toLowerCase(),q=J&&/msie|trident/.test(J),W=J&&J.indexOf(\"msie 9.0\")>0,Z=J&&J.indexOf(\"edge/\")>0,G=(J&&J.indexOf(\"android\"),J&&/iphone|ipad|ipod|ios/.test(J)||\"ios\"===K),X=(J&&/chrome\\/\\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\\/(\\d+)/)),Y={}.watch,Q=!1;if(z)try{var ee={};Object.defineProperty(ee,\"passive\",{get:function(){Q=!0}}),window.addEventListener(\"test-passive\",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!z&&!V&&\"undefined\"!=typeof global&&(global.process&&\"server\"===global.process.env.VUE_ENV)),B},ne=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return\"function\"==typeof e&&/native code/.test(e.toString())}var ie,oe=\"undefined\"!=typeof Symbol&&re(Symbol)&&\"undefined\"!=typeof Reflect&&re(Reflect.ownKeys);ie=\"undefined\"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},ce.target=null;var ue=[];function le(e){ue.push(e),ce.target=e}function fe(){ue.pop(),ce.target=ue[ue.length-1]}var pe=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},de={child:{configurable:!0}};de.child.get=function(){return this.componentInstance},Object.defineProperties(pe.prototype,de);var ve=function(e){void 0===e&&(e=\"\");var t=new pe;return t.text=e,t.isComment=!0,t};function he(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){var t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ye=Array.prototype,ge=Object.create(ye);[\"push\",\"pop\",\"shift\",\"unshift\",\"splice\",\"sort\",\"reverse\"].forEach(function(e){var t=ye[e];R(ge,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case\"push\":case\"unshift\":i=n;break;case\"splice\":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var _e=Object.getOwnPropertyNames(ge),be=!0;function $e(e){be=e}var we=function(e){var t;this.value=e,this.dep=new ce,this.vmCount=0,R(e,\"__ob__\",this),Array.isArray(e)?(U?(t=ge,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];R(e,o,t[o])}}(e,ge,_e),this.observeArray(e)):this.walk(e)};function Ce(e,t){var n;if(o(e)&&!(e instanceof pe))return y(e,\"__ob__\")&&e.__ob__ instanceof we?n=e.__ob__:be&&!te()&&(Array.isArray(e)||s(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new we(e)),t&&n&&n.vmCount++,n}function xe(e,t,n,r,i){var o=new ce,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Ce(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return ce.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Ce(t),o.notify())}})}}function ke(e,t,n){if(Array.isArray(e)&&c(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(xe(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Ae(e,t){if(Array.isArray(e)&&c(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||y(e,t)&&(delete e[t],n&&n.dep.notify())}}we.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)xe(e,t[n])},we.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ce(e[t])};var Oe=F.optionMergeStrategies;function Se(e,t){if(!t)return e;for(var n,r,i,o=oe?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)\"__ob__\"!==(n=o[a])&&(r=e[n],i=t[n],y(e,n)?r!==i&&s(r)&&s(i)&&Se(r,i):ke(e,n,i));return e}function Te(e,t,n){return n?function(){var r=\"function\"==typeof t?t.call(n,n):t,i=\"function\"==typeof e?e.call(n,n):e;return r?Se(r,i):i}:t?e?function(){return Se(\"function\"==typeof t?t.call(this,this):t,\"function\"==typeof e?e.call(this,this):e)}:t:e}function Ee(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ne(e,t,n,r){var i=Object.create(e||null);return t?A(i,t):i}Oe.data=function(e,t,n){return n?Te(e,t,n):t&&\"function\"!=typeof t?e:Te(e,t)},I.forEach(function(e){Oe[e]=Ee}),M.forEach(function(e){Oe[e+\"s\"]=Ne}),Oe.watch=function(e,t,n,r){if(e===Y&&(e=void 0),t===Y&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in A(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Oe.props=Oe.methods=Oe.inject=Oe.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return A(i,e),t&&A(i,t),i},Oe.provide=Te;var je=function(e,t){return void 0===t?e:t};function De(e,t,n){if(\"function\"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)\"string\"==typeof(i=n[r])&&(o[b(i)]={type:null});else if(s(n))for(var a in n)i=n[a],o[b(a)]=s(i)?i:{type:i};e.props=o}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(s(n))for(var o in n){var a=n[o];r[o]=s(a)?A({from:o},a):{from:a}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];\"function\"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=De(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=De(e,t.mixins[r],n);var o,a={};for(o in e)c(o);for(o in t)y(e,o)||c(o);function c(r){var i=Oe[r]||je;a[r]=i(e[r],t[r],n,r)}return a}function Le(e,t,n,r){if(\"string\"==typeof n){var i=e[t];if(y(i,n))return i[n];var o=b(n);if(y(i,o))return i[o];var a=$(o);return y(i,a)?i[a]:i[n]||i[o]||i[a]}}function Me(e,t,n,r){var i=t[e],o=!y(n,e),a=n[e],s=Pe(Boolean,i.type);if(s>-1)if(o&&!y(i,\"default\"))a=!1;else if(\"\"===a||a===C(e)){var c=Pe(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(!y(t,\"default\"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return\"function\"==typeof r&&\"Function\"!==Ie(t.type)?r.call(e):r}(r,i,e);var u=be;$e(!0),Ce(a),$e(u)}return a}function Ie(e){var t=e&&e.toString().match(/^\\s*function (\\w+)/);return t?t[1]:\"\"}function Fe(e,t){return Ie(e)===Ie(t)}function Pe(e,t){if(!Array.isArray(t))return Fe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Fe(t[n],e))return n;return-1}function Re(e,t,n){le();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){Be(e,r,\"errorCaptured hook\")}}Be(e,t,n)}finally{fe()}}function He(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&u(o)&&!o._handled&&(o.catch(function(e){return Re(e,r,i+\" (Promise/async)\")}),o._handled=!0)}catch(e){Re(e,r,i)}return o}function Be(e,t,n){if(F.errorHandler)try{return F.errorHandler.call(null,e,t,n)}catch(t){t!==e&&Ue(t,null,\"config.errorHandler\")}Ue(e,t,n)}function Ue(e,t,n){if(!z&&!V||\"undefined\"==typeof console)throw e;console.error(e)}var ze,Ve=!1,Ke=[],Je=!1;function qe(){Je=!1;var e=Ke.slice(0);Ke.length=0;for(var t=0;t<e.length;t++)e[t]()}if(\"undefined\"!=typeof Promise&&re(Promise)){var We=Promise.resolve();ze=function(){We.then(qe),G&&setTimeout(S)},Ve=!0}else if(q||\"undefined\"==typeof MutationObserver||!re(MutationObserver)&&\"[object MutationObserverConstructor]\"!==MutationObserver.toString())ze=\"undefined\"!=typeof setImmediate&&re(setImmediate)?function(){setImmediate(qe)}:function(){setTimeout(qe,0)};else{var Ze=1,Ge=new MutationObserver(qe),Xe=document.createTextNode(String(Ze));Ge.observe(Xe,{characterData:!0}),ze=function(){Ze=(Ze+1)%2,Xe.data=String(Ze)},Ve=!0}function Ye(e,t){var n;if(Ke.push(function(){if(e)try{e.call(t)}catch(e){Re(e,t,\"nextTick\")}else n&&n(t)}),Je||(Je=!0,ze()),!e&&\"undefined\"!=typeof Promise)return new Promise(function(e){n=e})}var Qe=new ie;function et(e){!function e(t,n){var r,i;var a=Array.isArray(t);if(!a&&!o(t)||Object.isFrozen(t)||t instanceof pe)return;if(t.__ob__){var s=t.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(a)for(r=t.length;r--;)e(t[r],n);else for(i=Object.keys(t),r=i.length;r--;)e(t[i[r]],n)}(e,Qe),Qe.clear()}var tt=g(function(e){var t=\"&\"===e.charAt(0),n=\"~\"===(e=t?e.slice(1):e).charAt(0),r=\"!\"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function nt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return He(r,null,arguments,t,\"v-on handler\");for(var i=r.slice(),o=0;o<i.length;o++)He(i[o],null,e,t,\"v-on handler\")}return n.fns=e,n}function rt(e,n,i,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=n[c],f=tt(c),t(u)||(t(l)?(t(u.fns)&&(u=e[c]=nt(u,s)),r(f.once)&&(u=e[c]=a(f.name,u,f.capture)),i(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in n)t(e[c])&&o((f=tt(c)).name,n[c],f.capture)}function it(e,i,o){var a;e instanceof pe&&(e=e.data.hook||(e.data.hook={}));var s=e[i];function c(){o.apply(this,arguments),h(a.fns,c)}t(s)?a=nt([c]):n(s.fns)&&r(s.merged)?(a=s).fns.push(c):a=nt([s,c]),a.merged=!0,e[i]=a}function ot(e,t,r,i,o){if(n(t)){if(y(t,r))return e[r]=t[r],o||delete t[r],!0;if(y(t,i))return e[r]=t[i],o||delete t[i],!0}return!1}function at(e){return i(e)?[he(e)]:Array.isArray(e)?function e(o,a){var s=[];var c,u,l,f;for(c=0;c<o.length;c++)t(u=o[c])||\"boolean\"==typeof u||(l=s.length-1,f=s[l],Array.isArray(u)?u.length>0&&(st((u=e(u,(a||\"\")+\"_\"+c))[0])&&st(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?st(f)?s[l]=he(f.text+u):\"\"!==u&&s.push(he(u)):st(u)&&st(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key=\"__vlist\"+a+\"_\"+c+\"__\"),s.push(u)));return s}(e):void 0}function st(e){return n(e)&&n(e.text)&&!1===e.isComment}function ct(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if(\"__ob__\"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&y(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&\"default\"in e[o]){var c=e[o].default;n[o]=\"function\"==typeof c?c.call(t):c}}}return n}}function ut(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);\"template\"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(lt)&&delete n[u];return n}function lt(e){return e.isComment&&!e.asyncFactory||\" \"===e.text}function ft(t,n,r){var i,o=Object.keys(n).length>0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&\"$\"!==c[0]&&(i[c]=pt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=dt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,\"$stable\",a),R(i,\"$key\",s),R(i,\"$hasNormal\",o),i}function pt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&\"object\"==typeof e&&!Array.isArray(e)?[e]:at(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function dt(e,t){return function(){return e[t]}}function vt(e,t){var r,i,a,s,c;if(Array.isArray(e)||\"string\"==typeof e)for(r=new Array(e.length),i=0,a=e.length;i<a;i++)r[i]=t(e[i],i);else if(\"number\"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=t(i+1,i);else if(o(e))if(oe&&e[Symbol.iterator]){r=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)r.push(t(l.value,r.length)),l=u.next()}else for(s=Object.keys(e),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=t(e[c],c,i);return n(r)||(r=[]),r._isVList=!0,r}function ht(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=A(A({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement(\"template\",{slot:a},i):i}function mt(e){return Le(this.$options,\"filters\",e)||E}function yt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function gt(e,t,n,r,i){var o=F.keyCodes[t]||n;return i&&r&&!F.keyCodes[t]?yt(i,r):o?yt(o,e):r?C(r)!==t:void 0}function _t(e,t,n,r,i){if(n)if(o(n)){var a;Array.isArray(n)&&(n=O(n));var s=function(o){if(\"class\"===o||\"style\"===o||v(o))a=e;else{var s=e.attrs&&e.attrs.type;a=r||F.mustUseProp(t,s,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=b(o),u=C(o);c in a||u in a||(a[o]=n[o],i&&((e.on||(e.on={}))[\"update:\"+o]=function(e){n[o]=e}))};for(var c in n)s(c)}else;return e}function bt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(wt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),\"__static__\"+e,!1),r)}function $t(e,t,n){return wt(e,\"__once__\"+t+(n?\"_\"+n:\"\"),!0),e}function wt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&\"string\"!=typeof e[r]&&Ct(e[r],t+\"_\"+r,n);else Ct(e,t,n)}function Ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function xt(e,t){if(t)if(s(t)){var n=e.on=e.on?A({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function kt(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?kt(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function At(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];\"string\"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Ot(e,t){return\"string\"==typeof e?t+e:e}function St(e){e._o=$t,e._n=f,e._s=l,e._l=vt,e._t=ht,e._q=N,e._i=j,e._m=bt,e._f=mt,e._k=gt,e._b=_t,e._v=he,e._e=ve,e._u=kt,e._g=xt,e._d=At,e._p=Ot}function Tt(t,n,i,o,a){var s,c=this,u=a.options;y(o,\"_uid\")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=r(u._compiled),f=!l;this.data=t,this.props=n,this.children=i,this.parent=o,this.listeners=t.on||e,this.injections=ct(u.inject,o),this.slots=function(){return c.$slots||ft(t.scopedSlots,c.$slots=ut(i,o)),c.$slots},Object.defineProperty(this,\"scopedSlots\",{enumerable:!0,get:function(){return ft(t.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=ft(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Pt(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Pt(s,e,t,n,r,f)}}function Et(e,t,n,r,i){var o=me(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Nt(e,t){for(var n in t)e[b(n)]=t[n]}St(Tt.prototype);var jt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;jt.prepatch(r,r)}else{(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;n(i)&&(r.render=i.render,r.staticRenderFns=i.staticRenderFns);return new e.componentOptions.Ctor(r)}(e,Wt)).$mount(t?e.elm:void 0,t)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,i,o){var a=i.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),u=!!(o||t.$options._renderChildren||c);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){$e(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=t.$options.props;l[d]=Me(d,v,n,t)}$e(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,qt(t,r,h),u&&(t.$slots=ut(o,i.context),t.$forceUpdate())}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Yt(r,\"mounted\")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,en.push(t)):Xt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(n&&(t._directInactive=!0,Gt(t)))return;if(!t._inactive){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);Yt(t,\"deactivated\")}}(t,!0):t.$destroy())}},Dt=Object.keys(jt);function Lt(i,a,s,c,l){if(!t(i)){var f=s.$options._base;if(o(i)&&(i=f.extend(i)),\"function\"==typeof i){var p;if(t(i.cid)&&void 0===(i=function(e,i){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var a=Ht;a&&n(e.owners)&&-1===e.owners.indexOf(a)&&e.owners.push(a);if(r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(a&&!n(e.owners)){var s=e.owners=[a],c=!0,l=null,f=null;a.$on(\"hook:destroyed\",function(){return h(s,a)});var p=function(e){for(var t=0,n=s.length;t<n;t++)s[t].$forceUpdate();e&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==f&&(clearTimeout(f),f=null))},d=D(function(t){e.resolved=Bt(t,i),c?s.length=0:p(!0)}),v=D(function(t){n(e.errorComp)&&(e.error=!0,p(!0))}),m=e(d,v);return o(m)&&(u(m)?t(e.resolved)&&m.then(d,v):u(m.component)&&(m.component.then(d,v),n(m.error)&&(e.errorComp=Bt(m.error,i)),n(m.loading)&&(e.loadingComp=Bt(m.loading,i),0===m.delay?e.loading=!0:l=setTimeout(function(){l=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,p(!1))},m.delay||200)),n(m.timeout)&&(f=setTimeout(function(){f=null,t(e.resolved)&&v(null)},m.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(p=i,f)))return function(e,t,n,r,i){var o=ve();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(p,a,s,c,l);a=a||{},$n(i),n(a.model)&&function(e,t){var r=e.model&&e.model.prop||\"value\",i=e.model&&e.model.event||\"input\";(t.attrs||(t.attrs={}))[r]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;n(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}(i.options,a);var d=function(e,r,i){var o=r.options.props;if(!t(o)){var a={},s=e.attrs,c=e.props;if(n(s)||n(c))for(var u in o){var l=C(u);ot(a,c,u,l,!0)||ot(a,s,u,l,!1)}return a}}(a,i);if(r(i.options.functional))return function(t,r,i,o,a){var s=t.options,c={},u=s.props;if(n(u))for(var l in u)c[l]=Me(l,u,r||e);else n(i.attrs)&&Nt(c,i.attrs),n(i.props)&&Nt(c,i.props);var f=new Tt(i,c,a,o,t),p=s.render.call(null,f._c,f);if(p instanceof pe)return Et(p,i,f.parent,s);if(Array.isArray(p)){for(var d=at(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Et(d[h],i,f.parent,s);return v}}(i,d,a,s,c);var v=a.on;if(a.on=a.nativeOn,r(i.options.abstract)){var m=a.slot;a={},m&&(a.slot=m)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Dt.length;n++){var r=Dt[n],i=t[r],o=jt[r];i===o||i&&i._merged||(t[r]=i?Mt(o,i):o)}}(a);var y=i.options.name||l;return new pe(\"vue-component-\"+i.cid+(y?\"-\"+y:\"\"),a,void 0,void 0,void 0,s,{Ctor:i,propsData:d,listeners:v,tag:l,children:c},p)}}}function Mt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}var It=1,Ft=2;function Pt(e,a,s,c,u,l){return(Array.isArray(s)||i(s))&&(u=c,c=s,s=void 0),r(l)&&(u=Ft),function(e,i,a,s,c){if(n(a)&&n(a.__ob__))return ve();n(a)&&n(a.is)&&(i=a.is);if(!i)return ve();Array.isArray(s)&&\"function\"==typeof s[0]&&((a=a||{}).scopedSlots={default:s[0]},s.length=0);c===Ft?s=at(s):c===It&&(s=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(s));var u,l;if(\"string\"==typeof i){var f;l=e.$vnode&&e.$vnode.ns||F.getTagNamespace(i),u=F.isReservedTag(i)?new pe(F.parsePlatformTagName(i),a,s,void 0,void 0,e):a&&a.pre||!n(f=Le(e.$options,\"components\",i))?new pe(i,a,s,void 0,void 0,e):Lt(f,a,e,s,i)}else u=Lt(i,a,e,s);return Array.isArray(u)?u:n(u)?(n(l)&&function e(i,o,a){i.ns=o;\"foreignObject\"===i.tag&&(o=void 0,a=!0);if(n(i.children))for(var s=0,c=i.children.length;s<c;s++){var u=i.children[s];n(u.tag)&&(t(u.ns)||r(a)&&\"svg\"!==u.tag)&&e(u,o,a)}}(u,l),n(a)&&function(e){o(e.style)&&et(e.style);o(e.class)&&et(e.class)}(a),u):ve()}(e,a,s,c,u)}var Rt,Ht=null;function Bt(e,t){return(e.__esModule||oe&&\"Module\"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function Ut(e){return e.isComment&&e.asyncFactory}function zt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||Ut(r)))return r}}function Vt(e,t){Rt.$on(e,t)}function Kt(e,t){Rt.$off(e,t)}function Jt(e,t){var n=Rt;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function qt(e,t,n){Rt=e,rt(t,n||{},Vt,Kt,Jt,e),Rt=void 0}var Wt=null;function Zt(e){var t=Wt;return Wt=e,function(){Wt=t}}function Gt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Xt(e,t){if(t){if(e._directInactive=!1,Gt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Xt(e.$children[n]);Yt(e,\"activated\")}}function Yt(e,t){le();var n=e.$options[t],r=t+\" hook\";if(n)for(var i=0,o=n.length;i<o;i++)He(n[i],e,null,e,r);e._hasHookEvent&&e.$emit(\"hook:\"+t),fe()}var Qt=[],en=[],tn={},nn=!1,rn=!1,on=0;var an=0,sn=Date.now;if(z&&!q){var cn=window.performance;cn&&\"function\"==typeof cn.now&&sn()>document.createEvent(\"Event\").timeStamp&&(sn=function(){return cn.now()})}function un(){var e,t;for(an=sn(),rn=!0,Qt.sort(function(e,t){return e.id-t.id}),on=0;on<Qt.length;on++)(e=Qt[on]).before&&e.before(),t=e.id,tn[t]=null,e.run();var n=en.slice(),r=Qt.slice();on=Qt.length=en.length=0,tn={},nn=rn=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Xt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Yt(r,\"updated\")}}(r),ne&&F.devtools&&ne.emit(\"flush\")}var ln=0,fn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ln,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ie,this.newDepIds=new ie,this.expression=\"\",\"function\"==typeof t?this.getter=t:(this.getter=function(e){if(!H.test(e)){var t=e.split(\".\");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=S)),this.value=this.lazy?void 0:this.get()};fn.prototype.get=function(){var e;le(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Re(e,t,'getter for watcher \"'+this.expression+'\"')}finally{this.deep&&et(e),fe(),this.cleanupDeps()}return e},fn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},fn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},fn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==tn[t]){if(tn[t]=!0,rn){for(var n=Qt.length-1;n>on&&Qt[n].id>e.id;)n--;Qt.splice(n+1,0,e)}else Qt.push(e);nn||(nn=!0,Ye(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher \"'+this.expression+'\"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:S,set:S};function dn(e,t,n){pn.get=function(){return this[t][n]},pn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,pn)}function vn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);xe(r,o,a),o in e||dn(e,\"_props\",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=\"function\"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data=\"function\"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return Re(e,t,\"data()\"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+\"\").charCodeAt(0))&&95!==a&&dn(e,\"_data\",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a=\"function\"==typeof o?o:o.get;r||(n[i]=new fn(e,a||S,S,hn)),i in e||mn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)_n(e,n,r[i]);else _n(e,n,r)}}(e,t.watch)}var hn={lazy:!0};function mn(e,t,n){var r=!te();\"function\"==typeof n?(pn.get=r?yn(t):gn(n),pn.set=S):(pn.get=n.get?r&&!1!==n.cache?yn(t):gn(n.get):S,pn.set=n.set||S),Object.defineProperty(e,t,pn)}function yn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ce.target&&t.depend(),t.value}}function gn(e){return function(){return e.call(this,this)}}function _n(e,t,n,r){return s(n)&&(r=n,n=n.handler),\"string\"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var bn=0;function $n(e){var t=e.options;if(e.super){var n=$n(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&A(e.extendOptions,r),(t=e.options=De(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function wn(e){this._init(e)}function Cn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=De(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)dn(e.prototype,\"_props\",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,M.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=A({},a.options),i[r]=a,a}}function xn(e){return e&&(e.Ctor.options.name||e.tag)}function kn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:\"string\"==typeof e?e.split(\",\").indexOf(t)>-1:(n=e,\"[object RegExp]\"===a.call(n)&&e.test(t));var n}function An(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=xn(a.componentOptions);s&&!t(s)&&On(n,o,r,i)}}}function On(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=bn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De($n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ut(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,\"$attrs\",o&&o.attrs||e,null,!0),xe(t,\"$listeners\",n._parentListeners||e,null,!0)}(n),Yt(n,\"beforeCreate\"),function(e){var t=ct(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),vn(n),function(e){var t=e.$options.provide;t&&(e._provided=\"function\"==typeof t?t.call(e):t)}(n),Yt(n,\"created\"),n.$options.el&&n.$mount(n.$options.el)}}(wn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,\"$data\",t),Object.defineProperty(e.prototype,\"$props\",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher \"'+r.expression+'\"')}return function(){r.teardown()}}}(wn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?k(t):t;for(var n=k(arguments,1),r='event handler for \"'+e+'\"',i=0,o=t.length;i<o;i++)He(t[i],this,n,this,r)}return this}}(wn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=Zt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Yt(e,\"beforeDestroy\"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||h(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Yt(e,\"destroyed\"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(wn),function(e){St(e.prototype),e.prototype.$nextTick=function(e){return Ye(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=ft(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Ht=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){Re(n,t,\"render\"),e=t._vnode}finally{Ht=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof pe||(e=ve()),e.parent=i,e}}(wn);var Sn=[String,RegExp,Array],Tn={KeepAlive:{name:\"keep-alive\",abstract:!0,props:{include:Sn,exclude:Sn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)On(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch(\"include\",function(t){An(e,function(e){return kn(t,e)})}),this.$watch(\"exclude\",function(t){An(e,function(e){return!kn(t,e)})})},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=xn(n),i=this.include,o=this.exclude;if(i&&(!r||!kn(i,r))||o&&r&&kn(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?\"::\"+n.tag:\"\"):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&On(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,\"config\",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Ye,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),M.forEach(function(t){e.options[t+\"s\"]=Object.create(null)}),e.options._base=e,A(e.options.components,Tn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),\"function\"==typeof e.install?e.install.apply(e,n):\"function\"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Cn(e),function(e){M.forEach(function(t){e[t]=function(e,n){return n?(\"component\"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),\"directive\"===t&&\"function\"==typeof n&&(n={bind:n,update:n}),this.options[t+\"s\"][e]=n,n):this.options[t+\"s\"][e]}})}(e)}(wn),Object.defineProperty(wn.prototype,\"$isServer\",{get:te}),Object.defineProperty(wn.prototype,\"$ssrContext\",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wn,\"FunctionalRenderContext\",{value:Tt}),wn.version=\"2.6.11\";var En=p(\"style,class\"),Nn=p(\"input,textarea,option,select,progress\"),jn=function(e,t,n){return\"value\"===n&&Nn(e)&&\"button\"!==t||\"selected\"===n&&\"option\"===e||\"checked\"===n&&\"input\"===e||\"muted\"===n&&\"video\"===e},Dn=p(\"contenteditable,draggable,spellcheck\"),Ln=p(\"events,caret,typing,plaintext-only\"),Mn=function(e,t){return Hn(t)||\"false\"===t?\"false\":\"contenteditable\"===e&&Ln(t)?t:\"true\"},In=p(\"allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible\"),Fn=\"http://www.w3.org/1999/xlink\",Pn=function(e){return\":\"===e.charAt(5)&&\"xlink\"===e.slice(0,5)},Rn=function(e){return Pn(e)?e.slice(6,e.length):\"\"},Hn=function(e){return null==e||!1===e};function Bn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Un(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Un(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Vn(t));return\"\"}(t.staticClass,t.class)}function Un(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+\" \"+t:e:t||\"\"}function Vn(e){return Array.isArray(e)?function(e){for(var t,r=\"\",i=0,o=e.length;i<o;i++)n(t=Vn(e[i]))&&\"\"!==t&&(r&&(r+=\" \"),r+=t);return r}(e):o(e)?function(e){var t=\"\";for(var n in e)e[n]&&(t&&(t+=\" \"),t+=n);return t}(e):\"string\"==typeof e?e:\"\"}var Kn={svg:\"http://www.w3.org/2000/svg\",math:\"http://www.w3.org/1998/Math/MathML\"},Jn=p(\"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot\"),qn=p(\"svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view\",!0),Wn=function(e){return Jn(e)||qn(e)};function Zn(e){return qn(e)?\"svg\":\"math\"===e?\"math\":void 0}var Gn=Object.create(null);var Xn=p(\"text,number,password,search,email,tel,url\");function Yn(e){if(\"string\"==typeof e){var t=document.querySelector(e);return t||document.createElement(\"div\")}return e}var Qn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return\"select\"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute(\"multiple\",\"multiple\"),n)},createElementNS:function(e,t){return document.createElementNS(Kn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,\"\")}}),er={create:function(e,t){tr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(tr(e,!0),tr(t))},destroy:function(e){tr(e,!0)}};function tr(e,t){var r=e.data.ref;if(n(r)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[r])?h(a[r],o):a[r]===o&&(a[r]=void 0):e.data.refInFor?Array.isArray(a[r])?a[r].indexOf(o)<0&&a[r].push(o):a[r]=[o]:a[r]=o}}var nr=new pe(\"\",{},[]),rr=[\"create\",\"activate\",\"update\",\"remove\",\"destroy\"];function ir(e,i){return e.key===i.key&&(e.tag===i.tag&&e.isComment===i.isComment&&n(e.data)===n(i.data)&&function(e,t){if(\"input\"!==e.tag)return!0;var r,i=n(r=e.data)&&n(r=r.attrs)&&r.type,o=n(r=t.data)&&n(r=r.attrs)&&r.type;return i===o||Xn(i)&&Xn(o)}(e,i)||r(e.isAsyncPlaceholder)&&e.asyncFactory===i.asyncFactory&&t(i.asyncFactory.error))}function or(e,t,r){var i,o,a={};for(i=t;i<=r;++i)n(o=e[i].key)&&(a[o]=i);return a}var ar={create:sr,update:sr,destroy:function(e){sr(e,nr)}};function sr(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===nr,a=t===nr,s=ur(e.data.directives,e.context),c=ur(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,fr(i,\"update\",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(fr(i,\"bind\",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)fr(u[n],\"inserted\",t,e)};o?it(t,\"insert\",f):f()}l.length&&it(t,\"postpatch\",function(){for(var n=0;n<l.length;n++)fr(l[n],\"componentUpdated\",t,e)});if(!o)for(n in s)c[n]||fr(s[n],\"unbind\",e,e,a)}(e,t)}var cr=Object.create(null);function ur(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=cr),i[lr(r)]=r,r.def=Le(t.$options,\"directives\",r.name);return i}function lr(e){return e.rawName||e.name+\".\"+Object.keys(e.modifiers||{}).join(\".\")}function fr(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){Re(r,n.context,\"directive \"+e.name+\" \"+t+\" hook\")}}var pr=[er,ar];function dr(e,r){var i=r.componentOptions;if(!(n(i)&&!1===i.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var o,a,s=r.elm,c=e.data.attrs||{},u=r.data.attrs||{};for(o in n(u.__ob__)&&(u=r.data.attrs=A({},u)),u)a=u[o],c[o]!==a&&vr(s,o,a);for(o in(q||Z)&&u.value!==c.value&&vr(s,\"value\",u.value),c)t(u[o])&&(Pn(o)?s.removeAttributeNS(Fn,Rn(o)):Dn(o)||s.removeAttribute(o))}}function vr(e,t,n){e.tagName.indexOf(\"-\")>-1?hr(e,t,n):In(t)?Hn(n)?e.removeAttribute(t):(n=\"allowfullscreen\"===t&&\"EMBED\"===e.tagName?\"true\":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Mn(t,n)):Pn(t)?Hn(n)?e.removeAttributeNS(Fn,Rn(t)):e.setAttributeNS(Fn,t,n):hr(e,t,n)}function hr(e,t,n){if(Hn(n))e.removeAttribute(t);else{if(q&&!W&&\"TEXTAREA\"===e.tagName&&\"placeholder\"===t&&\"\"!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener(\"input\",r)};e.addEventListener(\"input\",r),e.__ieph=!0}e.setAttribute(t,n)}}var mr={create:dr,update:dr};function yr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Bn(r),c=i._transitionClasses;n(c)&&(s=zn(s,Vn(c))),s!==i._prevClass&&(i.setAttribute(\"class\",s),i._prevClass=s)}}var gr,_r,br,$r,wr,Cr,xr={create:yr,update:yr},kr=/[\\w).+\\-_$\\]]/;function Ar(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&\" \"===(h=e.charAt(v));v--);h&&kr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Or(i,o[r]);return i}function Or(e,t){var n=t.indexOf(\"(\");if(n<0)return'_f(\"'+t+'\")('+e+\")\";var r=t.slice(0,n),i=t.slice(n+1);return'_f(\"'+r+'\")('+e+(\")\"!==i?\",\"+i:i)}function Sr(e,t){console.error(\"[Vue compiler]: \"+e)}function Tr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Er(e,t,n,r,i){(e.props||(e.props=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Nr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function jr(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Rr({name:t,value:n},r))}function Dr(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Rr({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Lr(e,t,n){return n?\"_p(\"+t+',\"'+e+'\")':e+t}function Mr(t,n,r,i,o,a,s,c){var u;(i=i||e).right?c?n=\"(\"+n+\")==='click'?'contextmenu':(\"+n+\")\":\"click\"===n&&(n=\"contextmenu\",delete i.right):i.middle&&(c?n=\"(\"+n+\")==='click'?'mouseup':(\"+n+\")\":\"click\"===n&&(n=\"mouseup\")),i.capture&&(delete i.capture,n=Lr(\"!\",n,c)),i.once&&(delete i.once,n=Lr(\"~\",n,c)),i.passive&&(delete i.passive,n=Lr(\"&\",n,c)),i.native?(delete i.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var l=Rr({value:r.trim(),dynamic:c},s);i!==e&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,t.plain=!1}function Ir(e,t,n){var r=Fr(e,\":\"+t)||Fr(e,\"v-bind:\"+t);if(null!=r)return Ar(r);if(!1!==n){var i=Fr(e,t);if(null!=i)return JSON.stringify(i)}}function Fr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Pr(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Rr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Hr(e,t,n){var r=n||{},i=r.number,o=\"$$v\";r.trim&&(o=\"(typeof $$v === 'string'? $$v.trim(): $$v)\"),i&&(o=\"_n(\"+o+\")\");var a=Br(t,o);e.model={value:\"(\"+t+\")\",expression:JSON.stringify(t),callback:\"function ($$v) {\"+a+\"}\"}}function Br(e,t){var n=function(e){if(e=e.trim(),gr=e.length,e.indexOf(\"[\")<0||e.lastIndexOf(\"]\")<gr-1)return($r=e.lastIndexOf(\".\"))>-1?{exp:e.slice(0,$r),key:'\"'+e.slice($r+1)+'\"'}:{exp:e,key:null};_r=e,$r=wr=Cr=0;for(;!zr();)Vr(br=Ur())?Jr(br):91===br&&Kr(br);return{exp:e.slice(0,wr),key:e.slice(wr+1,Cr)}}(e);return null===n.key?e+\"=\"+t:\"$set(\"+n.exp+\", \"+n.key+\", \"+t+\")\"}function Ur(){return _r.charCodeAt(++$r)}function zr(){return $r>=gr}function Vr(e){return 34===e||39===e}function Kr(e){var t=1;for(wr=$r;!zr();)if(Vr(e=Ur()))Jr(e);else if(91===e&&t++,93===e&&t--,0===t){Cr=$r;break}}function Jr(e){for(var t=e;!zr()&&(e=Ur())!==t;);}var qr,Wr=\"__r\",Zr=\"__c\";function Gr(e,t,n){var r=qr;return function i(){null!==t.apply(null,arguments)&&Qr(e,i,n,r)}}var Xr=Ve&&!(X&&Number(X[1])<=53);function Yr(e,t,n,r){if(Xr){var i=an,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}qr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function Qr(e,t,n,r){(r||qr).removeEventListener(e,t._wrapper||t,n)}function ei(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};qr=r.elm,function(e){if(n(e[Wr])){var t=q?\"change\":\"input\";e[t]=[].concat(e[Wr],e[t]||[]),delete e[Wr]}n(e[Zr])&&(e.change=[].concat(e[Zr],e.change||[]),delete e[Zr])}(i),rt(i,o,Yr,Qr,Gr,r.context),qr=void 0}}var ti,ni={create:ei,update:ei};function ri(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]=\"\");for(i in c){if(o=c[i],\"textContent\"===i||\"innerHTML\"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if(\"value\"===i&&\"PROGRESS\"!==a.tagName){a._value=o;var u=t(o)?\"\":String(o);ii(a,u)&&(a.value=u)}else if(\"innerHTML\"===i&&qn(a.tagName)&&t(a.innerHTML)){(ti=ti||document.createElement(\"div\")).innerHTML=\"<svg>\"+o+\"</svg>\";for(var l=ti.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function ii(e,t){return!e.composing&&(\"OPTION\"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var oi={create:ri,update:ri},ai=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function si(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?O(e):\"string\"==typeof e?ai(e):e}var ui,li=/^--/,fi=/\\s*!important$/,pi=function(e,t,n){if(li.test(t))e.style.setProperty(t,n);else if(fi.test(n))e.style.setProperty(C(t),n.replace(fi,\"\"),\"important\");else{var r=vi(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},di=[\"Webkit\",\"Moz\",\"ms\"],vi=g(function(e){if(ui=ui||document.createElement(\"div\").style,\"filter\"!==(e=b(e))&&e in ui)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<di.length;n++){var r=di[n]+t;if(r in ui)return r}});function hi(e,r){var i=r.data,o=e.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=ci(r.data.style)||{};r.data.normalizedStyle=n(p.__ob__)?A({},p):p;var d=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=si(i.data))&&A(r,n);(n=si(e.data))&&A(r,n);for(var o=e;o=o.parent;)o.data&&(n=si(o.data))&&A(r,n);return r}(r,!0);for(s in f)t(d[s])&&pi(c,s,\"\");for(s in d)(a=d[s])!==f[s]&&pi(c,s,null==a?\"\":a)}}var mi={create:hi,update:hi},yi=/\\s+/;function gi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(yi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \";n.indexOf(\" \"+t+\" \")<0&&e.setAttribute(\"class\",(n+t).trim())}}function _i(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(yi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute(\"class\");else{for(var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \",r=\" \"+t+\" \";n.indexOf(r)>=0;)n=n.replace(r,\" \");(n=n.trim())?e.setAttribute(\"class\",n):e.removeAttribute(\"class\")}}function bi(e){if(e){if(\"object\"==typeof e){var t={};return!1!==e.css&&A(t,$i(e.name||\"v\")),A(t,e),t}return\"string\"==typeof e?$i(e):void 0}}var $i=g(function(e){return{enterClass:e+\"-enter\",enterToClass:e+\"-enter-to\",enterActiveClass:e+\"-enter-active\",leaveClass:e+\"-leave\",leaveToClass:e+\"-leave-to\",leaveActiveClass:e+\"-leave-active\"}}),wi=z&&!W,Ci=\"transition\",xi=\"animation\",ki=\"transition\",Ai=\"transitionend\",Oi=\"animation\",Si=\"animationend\";wi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ki=\"WebkitTransition\",Ai=\"webkitTransitionEnd\"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi=\"WebkitAnimation\",Si=\"webkitAnimationEnd\"));var Ti=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ti(function(){Ti(e)})}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gi(e,t))}function ji(e,t){e._transitionClasses&&h(e._transitionClasses,t),_i(e,t)}function Di(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ci?Ai:Si,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var Li=/\\b(transform|all)(,|$)/;function Mi(e,t){var n,r=window.getComputedStyle(e),i=(r[ki+\"Delay\"]||\"\").split(\", \"),o=(r[ki+\"Duration\"]||\"\").split(\", \"),a=Ii(i,o),s=(r[Oi+\"Delay\"]||\"\").split(\", \"),c=(r[Oi+\"Duration\"]||\"\").split(\", \"),u=Ii(s,c),l=0,f=0;return t===Ci?a>0&&(n=Ci,l=a,f=o.length):t===xi?u>0&&(n=xi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ci:xi:null)?n===Ci?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ci&&Li.test(r[ki+\"Property\"])}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Fi(t)+Fi(e[n])}))}function Fi(e){return 1e3*Number(e.slice(0,-1).replace(\",\",\".\"))}function Pi(e,r){var i=e.elm;n(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=bi(e.data.transition);if(!t(a)&&!n(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,l=a.enterToClass,p=a.enterActiveClass,d=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,$=a.appear,w=a.afterAppear,C=a.appearCancelled,x=a.duration,k=Wt,A=Wt.$vnode;A&&A.parent;)k=A.context,A=A.parent;var O=!k._isMounted||!e.isRootInsert;if(!O||$||\"\"===$){var S=O&&d?d:u,T=O&&h?h:p,E=O&&v?v:l,N=O&&b||m,j=O&&\"function\"==typeof $?$:y,L=O&&w||g,M=O&&C||_,I=f(o(x)?x.enter:x),F=!1!==s&&!W,P=Bi(j),R=i._enterCb=D(function(){F&&(ji(i,E),ji(i,T)),R.cancelled?(F&&ji(i,S),M&&M(i)):L&&L(i),i._enterCb=null});e.data.show||it(e,\"insert\",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),j&&j(i,R)}),N&&N(i),F&&(Ni(i,S),Ni(i,T),Ei(function(){ji(i,S),R.cancelled||(Ni(i,E),P||(Hi(I)?setTimeout(R,I):Di(i,c,R)))})),e.data.show&&(r&&r(),j&&j(i,R)),F||P||R()}}}function Ri(e,r){var i=e.elm;n(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var a=bi(e.data.transition);if(t(a)||1!==i.nodeType)return r();if(!n(i._leaveCb)){var s=a.css,c=a.type,u=a.leaveClass,l=a.leaveToClass,p=a.leaveActiveClass,d=a.beforeLeave,v=a.leave,h=a.afterLeave,m=a.leaveCancelled,y=a.delayLeave,g=a.duration,_=!1!==s&&!W,b=Bi(v),$=f(o(g)?g.leave:g),w=i._leaveCb=D(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ji(i,l),ji(i,p)),w.cancelled?(_&&ji(i,u),m&&m(i)):(r(),h&&h(i)),i._leaveCb=null});y?y(C):C()}function C(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),d&&d(i),_&&(Ni(i,u),Ni(i,p),Ei(function(){ji(i,u),w.cancelled||(Ni(i,l),b||(Hi($)?setTimeout(w,$):Di(i,c,w)))})),v&&v(i,w),_||b||w())}}function Hi(e){return\"number\"==typeof e&&!isNaN(e)}function Bi(e){if(t(e))return!1;var r=e.fns;return n(r)?Bi(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function Ui(e,t){!0!==t.data.show&&Pi(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;o<rr.length;++o)for(s[rr[o]]=[],a=0;a<c.length;++a)n(c[a][rr[o]])&&s[rr[o]].push(c[a][rr[o]]);function l(e){var t=u.parentNode(e);n(t)&&u.removeChild(t,e)}function f(e,t,i,o,a,c,l){if(n(e.elm)&&n(c)&&(e=c[l]=me(e)),e.isRootInsert=!a,!function(e,t,i,o){var a=e.data;if(n(a)){var c=n(e.componentInstance)&&a.keepAlive;if(n(a=a.hook)&&n(a=a.init)&&a(e,!1),n(e.componentInstance))return d(e,t),v(i,e.elm,o),r(c)&&function(e,t,r,i){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,n(o=a.data)&&n(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](nr,a);t.push(a);break}v(r,e.elm,i)}(e,t,i,o),!0}}(e,t,i,o)){var f=e.data,p=e.children,m=e.tag;n(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),h(e,p,t),n(f)&&y(e,t),v(i,e.elm,o)):r(e.isComment)?(e.elm=u.createComment(e.text),v(i,e.elm,o)):(e.elm=u.createTextNode(e.text),v(i,e.elm,o))}}function d(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,m(e)?(y(e,t),g(e)):(tr(e),t.push(e))}function v(e,t,r){n(e)&&(n(r)?u.parentNode(r)===e&&u.insertBefore(e,t,r):u.appendChild(e,t))}function h(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r);else i(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function m(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function y(e,t){for(var r=0;r<s.create.length;++r)s.create[r](nr,e);n(o=e.data.hook)&&(n(o.create)&&o.create(nr,e),n(o.insert)&&t.push(e))}function g(e){var t;if(n(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),r=r.parent;n(t=Wt)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,r,i=e.data;if(n(i))for(n(t=i.hook)&&n(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)b(e.children[r])}function $(e,t,r){for(;t<=r;++t){var i=e[t];n(i)&&(n(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(n(t)||n(e.data)){var r,i=s.remove.length+1;for(n(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&w(r,t),r=0;r<s.remove.length;++r)s.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else l(e.elm)}function C(e,t,r,i){for(var o=r;o<i;o++){var a=t[o];if(n(a)&&ir(e,a))return o}}function x(e,i,o,a,c,l){if(e!==i){n(i.elm)&&n(a)&&(i=a[c]=me(i));var p=i.elm=e.elm;if(r(e.isAsyncPlaceholder))n(i.asyncFactory.resolved)?O(e.elm,i,o):i.isAsyncPlaceholder=!0;else if(r(i.isStatic)&&r(e.isStatic)&&i.key===e.key&&(r(i.isCloned)||r(i.isOnce)))i.componentInstance=e.componentInstance;else{var d,v=i.data;n(v)&&n(d=v.hook)&&n(d=d.prepatch)&&d(e,i);var h=e.children,y=i.children;if(n(v)&&m(i)){for(d=0;d<s.update.length;++d)s.update[d](e,i);n(d=v.hook)&&n(d=d.update)&&d(e,i)}t(i.text)?n(h)&&n(y)?h!==y&&function(e,r,i,o,a){for(var s,c,l,p=0,d=0,v=r.length-1,h=r[0],m=r[v],y=i.length-1,g=i[0],b=i[y],w=!a;p<=v&&d<=y;)t(h)?h=r[++p]:t(m)?m=r[--v]:ir(h,g)?(x(h,g,o,i,d),h=r[++p],g=i[++d]):ir(m,b)?(x(m,b,o,i,y),m=r[--v],b=i[--y]):ir(h,b)?(x(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=r[++p],b=i[--y]):ir(m,g)?(x(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=r[--v],g=i[++d]):(t(s)&&(s=or(r,p,v)),t(c=n(g.key)?s[g.key]:C(g,r,p,v))?f(g,o,e,h.elm,!1,i,d):ir(l=r[c],g)?(x(l,g,o,i,d),r[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,\"\"),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,\"\"):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var A=p(\"attrs,class,staticClass,staticStyle,key\");function O(e,t,i,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(n(c)&&(n(a=c.hook)&&n(a=a.init)&&a(t,!0),n(a=t.componentInstance)))return d(t,i),!0;if(n(s)){if(n(u))if(e.hasChildNodes())if(n(a=c)&&n(a=a.domProps)&&n(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,p=0;p<u.length;p++){if(!f||!O(f,u[p],i,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else h(t,u,i);if(n(c)){var v=!1;for(var m in c)if(!A(m)){v=!0,y(t,i);break}!v&&c.class&&et(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,i,o,a){if(!t(i)){var c,l=!1,p=[];if(t(e))l=!0,f(i,p);else{var d=n(e.nodeType);if(!d&&ir(e,i))x(e,i,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(L)&&(e.removeAttribute(L),o=!0),r(o)&&O(e,i,p))return k(i,p,!0),e;c=e,e=new pe(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,h=u.parentNode(v);if(f(i,p,v._leaveCb?null:h,u.nextSibling(v)),n(i.parent))for(var y=i.parent,g=m(i);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=i.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](nr,y);var C=y.data.hook.insert;if(C.merged)for(var A=1;A<C.fns.length;A++)C.fns[A]()}else tr(y);y=y.parent}n(h)?$([e],0,0):n(e.tag)&&b(e)}}return k(i,p,l),i.elm}n(e)&&b(e)}}({nodeOps:Qn,modules:[mr,xr,ni,oi,mi,z?{create:Ui,activate:Ui,remove:function(e,t){!0!==e.data.show?Ri(e,t):t()}}:{}].concat(pr)});W&&document.addEventListener(\"selectionchange\",function(){var e=document.activeElement;e&&e.vmodel&&Xi(e,\"input\")});var Vi={inserted:function(e,t,n,r){\"select\"===n.tag?(r.elm&&!r.elm._vOptions?it(n,\"postpatch\",function(){Vi.componentUpdated(e,t,n)}):Ki(e,t,n.context),e._vOptions=[].map.call(e.options,Wi)):(\"textarea\"===n.tag||Xn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener(\"compositionstart\",Zi),e.addEventListener(\"compositionend\",Gi),e.addEventListener(\"change\",Gi),W&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if(\"select\"===n.tag){Ki(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Wi);if(i.some(function(e,t){return!N(e,r[t])}))(e.multiple?t.value.some(function(e){return qi(e,i)}):t.value!==t.oldValue&&qi(t.value,i))&&Xi(e,\"change\")}}};function Ki(e,t,n){Ji(e,t,n),(q||Z)&&setTimeout(function(){Ji(e,t,n)},0)}function Ji(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=j(r,Wi(a))>-1,a.selected!==o&&(a.selected=o);else if(N(Wi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function qi(e,t){return t.every(function(t){return!N(t,e)})}function Wi(e){return\"_value\"in e?e._value:e.value}function Zi(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,\"input\"))}function Xi(e,t){var n=document.createEvent(\"HTMLEvents\");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Yi(e){return!e.componentInstance||e.data&&e.data.transition?e:Yi(e.componentInstance._vnode)}var Qi={model:Vi,show:{bind:function(e,t,n){var r=t.value,i=(n=Yi(n)).data&&n.data.transition,o=e.__vOriginalDisplay=\"none\"===e.style.display?\"\":e.style.display;r&&i?(n.data.show=!0,Pi(n,function(){e.style.display=o})):e.style.display=r?o:\"none\"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Yi(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,function(){e.style.display=e.__vOriginalDisplay}):Ri(n,function(){e.style.display=\"none\"})):e.style.display=r?e.__vOriginalDisplay:\"none\")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},eo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function to(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?to(zt(t.children)):e}function no(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function ro(e,t){if(/\\d-keep-alive$/.test(t.tag))return e(\"keep-alive\",{props:t.componentOptions.propsData})}var io=function(e){return e.tag||Ut(e)},oo=function(e){return\"show\"===e.name},ao={name:\"transition\",props:eo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(io)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=to(o);if(!a)return o;if(this._leaving)return ro(e,o);var s=\"__transition-\"+this._uid+\"-\";a.key=null==a.key?a.isComment?s+\"comment\":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=no(this),u=this._vnode,l=to(u);if(a.data.directives&&a.data.directives.some(oo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!Ut(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if(\"out-in\"===r)return this._leaving=!0,it(f,\"afterLeave\",function(){t._leaving=!1,t.$forceUpdate()}),ro(e,o);if(\"in-out\"===r){if(Ut(a))return u;var p,d=function(){p()};it(c,\"afterEnter\",d),it(c,\"enterCancelled\",d),it(f,\"delayLeave\",function(e){p=e})}}return o}}},so=A({tag:String,moveClass:String},eo);function co(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function uo(e){e.data.newPos=e.elm.getBoundingClientRect()}function lo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform=\"translate(\"+r+\"px,\"+i+\"px)\",o.transitionDuration=\"0s\"}}delete so.mode;var fo={Transition:ao,TransitionGroup:{props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||\"span\",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=no(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf(\"__vlist\")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||\"v\")+\"-move\";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(co),e.forEach(uo),e.forEach(lo),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Ni(n,t),r.transform=r.WebkitTransform=r.transitionDuration=\"\",n.addEventListener(Ai,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ai,e),n._moveCb=null,ji(n,t))})}}))},methods:{hasMove:function(e,t){if(!wi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){_i(n,e)}),gi(n,t),n.style.display=\"none\",this.$el.appendChild(n);var r=Mi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};wn.config.mustUseProp=jn,wn.config.isReservedTag=Wn,wn.config.isReservedAttr=En,wn.config.getTagNamespace=Zn,wn.config.isUnknownElement=function(e){if(!z)return!0;if(Wn(e))return!1;if(e=e.toLowerCase(),null!=Gn[e])return Gn[e];var t=document.createElement(e);return e.indexOf(\"-\")>-1?Gn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Gn[e]=/HTMLUnknownElement/.test(t.toString())},A(wn.options.directives,Qi),A(wn.options.components,fo),wn.prototype.__patch__=z?zi:S,wn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Yt(e,\"beforeMount\"),r=function(){e._update(e._render(),n)},new fn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Yt(e,\"beforeUpdate\")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Yt(e,\"mounted\")),e}(this,e=e&&z?Yn(e):void 0,t)},z&&setTimeout(function(){F.devtools&&ne&&ne.emit(\"init\",wn)},0);var po=/\\{\\{((?:.|\\r?\\n)+?)\\}\\}/g,vo=/[-.*+?^${}()|[\\]\\/\\\\]/g,ho=g(function(e){var t=e[0].replace(vo,\"\\\\$&\"),n=e[1].replace(vo,\"\\\\$&\");return new RegExp(t+\"((?:.|\\\\n)+?)\"+n,\"g\")});var mo={staticKeys:[\"staticClass\"],transformNode:function(e,t){t.warn;var n=Fr(e,\"class\");n&&(e.staticClass=JSON.stringify(n));var r=Ir(e,\"class\",!1);r&&(e.classBinding=r)},genData:function(e){var t=\"\";return e.staticClass&&(t+=\"staticClass:\"+e.staticClass+\",\"),e.classBinding&&(t+=\"class:\"+e.classBinding+\",\"),t}};var yo,go={staticKeys:[\"staticStyle\"],transformNode:function(e,t){t.warn;var n=Fr(e,\"style\");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Ir(e,\"style\",!1);r&&(e.styleBinding=r)},genData:function(e){var t=\"\";return e.staticStyle&&(t+=\"staticStyle:\"+e.staticStyle+\",\"),e.styleBinding&&(t+=\"style:(\"+e.styleBinding+\"),\"),t}},_o=function(e){return(yo=yo||document.createElement(\"div\")).innerHTML=e,yo.textContent},bo=p(\"area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr\"),$o=p(\"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source\"),wo=p(\"address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track\"),Co=/^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,xo=/^\\s*((?:v-[\\w-]+:|@|:|#)\\[[^=]+\\][^\\s\"'<>\\/=]*)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,ko=\"[a-zA-Z_][\\\\-\\\\.0-9_a-zA-Z\"+P.source+\"]*\",Ao=\"((?:\"+ko+\"\\\\:)?\"+ko+\")\",Oo=new RegExp(\"^<\"+Ao),So=/^\\s*(\\/?)>/,To=new RegExp(\"^<\\\\/\"+Ao+\"[^>]*>\"),Eo=/^<!DOCTYPE [^>]+>/i,No=/^<!\\--/,jo=/^<!\\[/,Do=p(\"script,style,textarea\",!0),Lo={},Mo={\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&amp;\":\"&\",\"&#10;\":\"\\n\",\"&#9;\":\"\\t\",\"&#39;\":\"'\"},Io=/&(?:lt|gt|quot|amp|#39);/g,Fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Po=p(\"pre,textarea\",!0),Ro=function(e,t){return e&&Po(e)&&\"\\n\"===t[0]};function Ho(e,t){var n=t?Fo:Io;return e.replace(n,function(e){return Mo[e]})}var Bo,Uo,zo,Vo,Ko,Jo,qo,Wo,Zo=/^@|^v-on:/,Go=/^v-|^@|^:|^#/,Xo=/([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/,Yo=/,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/,Qo=/^\\(|\\)$/g,ea=/^\\[.*\\]$/,ta=/:(.*)$/,na=/^:|^\\.|^v-bind:/,ra=/\\.[^.\\]]+(?=[^\\]]*$)/g,ia=/^v-slot(:|$)|^#/,oa=/[\\r\\n]/,aa=/\\s+/g,sa=g(_o),ca=\"_empty_\";function ua(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ma(t),rawAttrsMap:{},parent:n,children:[]}}function la(e,t){Bo=t.warn||Sr,Jo=t.isPreTag||T,qo=t.mustUseProp||T,Wo=t.getTagNamespace||T;t.isReservedTag;zo=Tr(t.modules,\"transformNode\"),Vo=Tr(t.modules,\"preTransformNode\"),Ko=Tr(t.modules,\"postTransformNode\"),Uo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=fa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&da(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&da(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'\"default\"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Jo(e.tag)&&(c=!1);for(var f=0;f<Ko.length;f++)Ko[f](e,t)}function l(e){if(!c)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&\" \"===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||T,s=t.canBeLeftOpenTag||T,c=0;e;){if(n=e,r&&Do(r)){var u=0,l=r.toLowerCase(),f=Lo[l]||(Lo[l]=new RegExp(\"([\\\\s\\\\S]*?)(</\"+l+\"[^>]*>)\",\"i\")),p=e.replace(f,function(e,n,r){return u=r.length,Do(l)||\"noscript\"===l||(n=n.replace(/<!\\--([\\s\\S]*?)-->/g,\"$1\").replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g,\"$1\")),Ro(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),\"\"});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf(\"<\");if(0===d){if(No.test(e)){var v=e.indexOf(\"--\\x3e\");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(jo.test(e)){var h=e.indexOf(\"]>\");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(To);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ro(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(To.test($)||Oo.test($)||No.test($)||jo.test($)||(w=$.indexOf(\"<\",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(Oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(So))&&(r=e.match(xo)||e.match(Co));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&(\"p\"===r&&wo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||\"\",h=\"a\"===n&&\"href\"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:Ho(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function A(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else\"br\"===s?t.start&&t.start(e,[],!0,n,o):\"p\"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Wo(e);q&&\"svg\"===p&&(o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];ya.test(r.name)||(r.name=r.name.replace(ga,\"\"),t.push(r))}return t}(o));var d,v=ua(e,o,r);p&&(v.ns=p),\"style\"!==(d=v).tag&&(\"script\"!==d.tag||d.attrsMap.type&&\"text/javascript\"!==d.attrsMap.type)||te()||(v.forbidden=!0);for(var h=0;h<Vo.length;h++)v=Vo[h](v,t)||v;s||(!function(e){null!=Fr(e,\"v-pre\")&&(e.pre=!0)}(v),v.pre&&(s=!0)),Jo(v.tag)&&(c=!0),s?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(v):v.processed||(pa(v),function(e){var t=Fr(e,\"v-if\");if(t)e.if=t,da(e,{exp:t,block:e});else{null!=Fr(e,\"v-else\")&&(e.else=!0);var n=Fr(e,\"v-else-if\");n&&(e.elseif=n)}}(v),function(e){null!=Fr(e,\"v-once\")&&(e.once=!0)}(v)),n||(n=v),a?u(v):(r=v,i.push(v))},end:function(e,t,n){var o=i[i.length-1];i.length-=1,r=i[i.length-1],u(o)},chars:function(e,t,n){if(r&&(!q||\"textarea\"!==r.tag||r.attrsMap.placeholder!==e)){var i,u,l,f=r.children;if(e=c||e.trim()?\"script\"===(i=r).tag||\"style\"===i.tag?e:sa(e):f.length?a?\"condense\"===a&&oa.test(e)?\"\":\" \":o?\" \":\"\":\"\")c||\"condense\"!==a||(e=e.replace(aa,\" \")),!s&&\" \"!==e&&(u=function(e,t){var n=t?ho(t):po;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Ar(r[1].trim());a.push(\"_s(\"+u+\")\"),s.push({\"@binding\":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join(\"+\"),tokens:s}}}(e,Uo))?l={type:2,expression:u.expression,tokens:u.tokens,text:e}:\" \"===e&&f.length&&\" \"===f[f.length-1].text||(l={type:3,text:e}),l&&f.push(l)}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}function fa(e,t){var n,r;(r=Ir(n=e,\"key\"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Ir(e,\"ref\");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;\"template\"===e.tag?(t=Fr(e,\"scope\"),e.slotScope=t||Fr(e,\"slot-scope\")):(t=Fr(e,\"slot-scope\"))&&(e.slotScope=t);var n=Ir(e,\"slot\");n&&(e.slotTarget='\"\"'===n?'\"default\"':n,e.slotTargetDynamic=!(!e.attrsMap[\":slot\"]&&!e.attrsMap[\"v-bind:slot\"]),\"template\"===e.tag||e.slotScope||Nr(e,\"slot\",n,function(e,t){return e.rawAttrsMap[\":\"+t]||e.rawAttrsMap[\"v-bind:\"+t]||e.rawAttrsMap[t]}(e,\"slot\")));if(\"template\"===e.tag){var r=Pr(e,ia);if(r){var i=va(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||ca}}else{var s=Pr(e,ia);if(s){var c=e.scopedSlots||(e.scopedSlots={}),u=va(s),l=u.name,f=u.dynamic,p=c[l]=ua(\"template\",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||ca,e.children=[],e.plain=!1}}}(e),function(e){\"slot\"===e.tag&&(e.slotName=Ir(e,\"name\"))}(e),function(e){var t;(t=Ir(e,\"is\"))&&(e.component=t);null!=Fr(e,\"inline-template\")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<zo.length;i++)e=zo[i](e,t)||e;return function(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=i=u[t].name,o=u[t].value,Go.test(r))if(e.hasBindings=!0,(a=ha(r.replace(Go,\"\")))&&(r=r.replace(ra,\"\")),na.test(r))r=r.replace(na,\"\"),o=Ar(o),(c=ea.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&\"innerHtml\"===(r=b(r))&&(r=\"innerHTML\"),a.camel&&!c&&(r=b(r)),a.sync&&(s=Br(o,\"$event\"),c?Mr(e,'\"update:\"+('+r+\")\",s,null,!1,0,u[t],!0):(Mr(e,\"update:\"+b(r),s,null,!1,0,u[t]),C(r)!==b(r)&&Mr(e,\"update:\"+C(r),s,null,!1,0,u[t])))),a&&a.prop||!e.component&&qo(e.tag,e.attrsMap.type,r)?Er(e,r,o,u[t],c):Nr(e,r,o,u[t],c);else if(Zo.test(r))r=r.replace(Zo,\"\"),(c=ea.test(r))&&(r=r.slice(1,-1)),Mr(e,r,o,a,!1,0,u[t],c);else{var l=(r=r.replace(Go,\"\")).match(ta),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),ea.test(f)&&(f=f.slice(1,-1),c=!0)),Dr(e,r,i,o,f,c,a,u[t])}else Nr(e,r,JSON.stringify(o),u[t]),!e.component&&\"muted\"===r&&qo(e.tag,e.attrsMap.type,r)&&Er(e,r,\"true\",u[t])}(e),e}function pa(e){var t;if(t=Fr(e,\"v-for\")){var n=function(e){var t=e.match(Xo);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Qo,\"\"),i=r.match(Yo);i?(n.alias=r.replace(Yo,\"\").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&A(e,n)}}function da(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function va(e){var t=e.name.replace(ia,\"\");return t||\"#\"!==e.name[0]&&(t=\"default\"),ea.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'\"'+t+'\"',dynamic:!1}}function ha(e){var t=e.match(ra);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function ma(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var ya=/^xmlns:NS\\d+/,ga=/^NS\\d+:/;function _a(e){return ua(e.tag,e.attrsList.slice(),e.parent)}var ba=[mo,go,{preTransformNode:function(e,t){if(\"input\"===e.tag){var n,r=e.attrsMap;if(!r[\"v-model\"])return;if((r[\":type\"]||r[\"v-bind:type\"])&&(n=Ir(e,\"type\")),r.type||n||!r[\"v-bind\"]||(n=\"(\"+r[\"v-bind\"]+\").type\"),n){var i=Fr(e,\"v-if\",!0),o=i?\"&&(\"+i+\")\":\"\",a=null!=Fr(e,\"v-else\",!0),s=Fr(e,\"v-else-if\",!0),c=_a(e);pa(c),jr(c,\"type\",\"checkbox\"),fa(c,t),c.processed=!0,c.if=\"(\"+n+\")==='checkbox'\"+o,da(c,{exp:c.if,block:c});var u=_a(e);Fr(u,\"v-for\",!0),jr(u,\"type\",\"radio\"),fa(u,t),da(c,{exp:\"(\"+n+\")==='radio'\"+o,block:u});var l=_a(e);return Fr(l,\"v-for\",!0),jr(l,\":type\",n),fa(l,t),da(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}];var $a,wa,Ca={expectHTML:!0,modules:ba,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Hr(e,r,i),!1;if(\"select\"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return '+(n&&n.number?\"_n(val)\":\"val\")+\"});\";r=r+\" \"+Br(t,\"$event.target.multiple ? $$selectedVal : $$selectedVal[0]\"),Mr(e,\"change\",r,null,!0)}(e,r,i);else if(\"input\"===o&&\"checkbox\"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,\"value\")||\"null\",o=Ir(e,\"true-value\")||\"true\",a=Ir(e,\"false-value\")||\"false\";Er(e,\"checked\",\"Array.isArray(\"+t+\")?_i(\"+t+\",\"+i+\")>-1\"+(\"true\"===o?\":(\"+t+\")\":\":_q(\"+t+\",\"+o+\")\")),Mr(e,\"change\",\"var $$a=\"+t+\",$$el=$event.target,$$c=$$el.checked?(\"+o+\"):(\"+a+\");if(Array.isArray($$a)){var $$v=\"+(r?\"_n(\"+i+\")\":i)+\",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&(\"+Br(t,\"$$a.concat([$$v])\")+\")}else{$$i>-1&&(\"+Br(t,\"$$a.slice(0,$$i).concat($$a.slice($$i+1))\")+\")}}else{\"+Br(t,\"$$c\")+\"}\",null,!0)}(e,r,i);else if(\"input\"===o&&\"radio\"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,\"value\")||\"null\";Er(e,\"checked\",\"_q(\"+t+\",\"+(i=r?\"_n(\"+i+\")\":i)+\")\"),Mr(e,\"change\",Br(t,i),null,!0)}(e,r,i);else if(\"input\"===o||\"textarea\"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&\"range\"!==r,u=o?\"change\":\"range\"===r?Wr:\"input\",l=\"$event.target.value\";s&&(l=\"$event.target.value.trim()\"),a&&(l=\"_n(\"+l+\")\");var f=Br(t,l);c&&(f=\"if($event.target.composing)return;\"+f),Er(e,\"value\",\"(\"+t+\")\"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,\"blur\",\"$forceUpdate()\")}(e,r,i);else if(!F.isReservedTag(o))return Hr(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,\"textContent\",\"_s(\"+t.value+\")\",t)},html:function(e,t){t.value&&Er(e,\"innerHTML\",\"_s(\"+t.value+\")\",t)}},isPreTag:function(e){return\"pre\"===e},isUnaryTag:bo,mustUseProp:jn,canBeLeftOpenTag:$o,isReservedTag:Wn,getTagNamespace:Zn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(\",\")}(ba)},xa=g(function(e){return p(\"type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap\"+(e?\",\"+e:\"\"))});function ka(e,t){e&&($a=xa(t.staticKeys||\"\"),wa=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!wa(e.tag)||function(e){for(;e.parent;){if(\"template\"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every($a)))}(t);if(1===t.type){if(!wa(t.tag)&&\"slot\"!==t.tag&&null==t.attrsMap[\"inline-template\"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++){var s=t.ifConditions[o].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++)e(t.ifConditions[o].block,n)}}(e,!1))}var Aa=/^([\\w$_]+|\\([^)]*?\\))\\s*=>|^function(?:\\s+[\\w$]+)?\\s*\\(/,Oa=/\\([^)]*?\\);*$/,Sa=/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?']|\\[\"[^\"]*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*$/,Ta={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:[\"Esc\",\"Escape\"],tab:\"Tab\",enter:\"Enter\",space:[\" \",\"Spacebar\"],up:[\"Up\",\"ArrowUp\"],left:[\"Left\",\"ArrowLeft\"],right:[\"Right\",\"ArrowRight\"],down:[\"Down\",\"ArrowDown\"],delete:[\"Backspace\",\"Delete\",\"Del\"]},Na=function(e){return\"if(\"+e+\")return null;\"},ja={stop:\"$event.stopPropagation();\",prevent:\"$event.preventDefault();\",self:Na(\"$event.target !== $event.currentTarget\"),ctrl:Na(\"!$event.ctrlKey\"),shift:Na(\"!$event.shiftKey\"),alt:Na(\"!$event.altKey\"),meta:Na(\"!$event.metaKey\"),left:Na(\"'button' in $event && $event.button !== 0\"),middle:Na(\"'button' in $event && $event.button !== 1\"),right:Na(\"'button' in $event && $event.button !== 2\")};function Da(e,t){var n=t?\"nativeOn:\":\"on:\",r=\"\",i=\"\";for(var o in e){var a=La(e[o]);e[o]&&e[o].dynamic?i+=o+\",\"+a+\",\":r+='\"'+o+'\":'+a+\",\"}return r=\"{\"+r.slice(0,-1)+\"}\",i?n+\"_d(\"+r+\",[\"+i.slice(0,-1)+\"])\":n+r}function La(e){if(!e)return\"function(){}\";if(Array.isArray(e))return\"[\"+e.map(function(e){return La(e)}).join(\",\")+\"]\";var t=Sa.test(e.value),n=Aa.test(e.value),r=Sa.test(e.value.replace(Oa,\"\"));if(e.modifiers){var i=\"\",o=\"\",a=[];for(var s in e.modifiers)if(ja[s])o+=ja[s],Ta[s]&&a.push(s);else if(\"exact\"===s){var c=e.modifiers;o+=Na([\"ctrl\",\"shift\",\"alt\",\"meta\"].filter(function(e){return!c[e]}).map(function(e){return\"$event.\"+e+\"Key\"}).join(\"||\"))}else a.push(s);return a.length&&(i+=function(e){return\"if(!$event.type.indexOf('key')&&\"+e.map(Ma).join(\"&&\")+\")return null;\"}(a)),o&&(i+=o),\"function($event){\"+i+(t?\"return \"+e.value+\"($event)\":n?\"return (\"+e.value+\")($event)\":r?\"return \"+e.value:e.value)+\"}\"}return t||n?e.value:\"function($event){\"+(r?\"return \"+e.value:e.value)+\"}\"}function Ma(e){var t=parseInt(e,10);if(t)return\"$event.keyCode!==\"+t;var n=Ta[e],r=Ea[e];return\"_k($event.keyCode,\"+JSON.stringify(e)+\",\"+JSON.stringify(n)+\",$event.key,\"+JSON.stringify(r)+\")\"}var Ia={on:function(e,t){e.wrapListeners=function(e){return\"_g(\"+e+\",\"+t.value+\")\"}},bind:function(e,t){e.wrapData=function(n){return\"_b(\"+n+\",'\"+e.tag+\"',\"+t.value+\",\"+(t.modifiers&&t.modifiers.prop?\"true\":\"false\")+(t.modifiers&&t.modifiers.sync?\",true\":\"\")+\")\"}},cloak:S},Fa=function(e){this.options=e,this.warn=e.warn||Sr,this.transforms=Tr(e.modules,\"transformCode\"),this.dataGenFns=Tr(e.modules,\"genData\"),this.directives=A(A({},Ia),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Pa(e,t){var n=new Fa(t);return{render:\"with(this){return \"+(e?Ra(e,n):'_c(\"div\")')+\"}\",staticRenderFns:n.staticRenderFns}}function Ra(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ha(e,t);if(e.once&&!e.onceProcessed)return Ba(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Ua(e,t);if(\"template\"!==e.tag||e.slotTarget||t.pre){if(\"slot\"===e.tag)return function(e,t){var n=e.slotName||'\"default\"',r=qa(e,t),i=\"_t(\"+n+(r?\",\"+r:\"\"),o=e.attrs||e.dynamicAttrs?Ga((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap[\"v-bind\"];!o&&!a||r||(i+=\",null\");o&&(i+=\",\"+o);a&&(i+=(o?\"\":\",null\")+\",\"+a);return i+\")\"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:qa(t,n,!0);return\"_c(\"+e+\",\"+Va(t,n)+(r?\",\"+r:\"\")+\")\"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Va(e,t));var i=e.inlineTemplate?null:qa(e,t,!0);n=\"_c('\"+e.tag+\"'\"+(r?\",\"+r:\"\")+(i?\",\"+i:\"\")+\")\"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return qa(e,t)||\"void 0\"}function Ha(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push(\"with(this){return \"+Ra(e,t)+\"}\"),t.pre=n,\"_m(\"+(t.staticRenderFns.length-1)+(e.staticInFor?\",true\":\"\")+\")\"}function Ba(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ua(e,t);if(e.staticInFor){for(var n=\"\",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?\"_o(\"+Ra(e,t)+\",\"+t.onceId+++\",\"+n+\")\":Ra(e,t)}return Ha(e,t)}function Ua(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||\"_e()\";var o=t.shift();return o.exp?\"(\"+o.exp+\")?\"+a(o.block)+\":\"+e(t,n,r,i):\"\"+a(o.block);function a(e){return r?r(e,n):e.once?Ba(e,n):Ra(e,n)}}(e.ifConditions.slice(),t,n,r)}function za(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?\",\"+e.iterator1:\"\",s=e.iterator2?\",\"+e.iterator2:\"\";return e.forProcessed=!0,(r||\"_l\")+\"((\"+i+\"),function(\"+o+a+s+\"){return \"+(n||Ra)(e,t)+\"})\"}function Va(e,t){var n=\"{\",r=function(e,t){var n=e.directives;if(!n)return;var r,i,o,a,s=\"directives:[\",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:\"'+o.name+'\",rawName:\"'+o.rawName+'\"'+(o.value?\",value:(\"+o.value+\"),expression:\"+JSON.stringify(o.value):\"\")+(o.arg?\",arg:\"+(o.isDynamicArg?o.arg:'\"'+o.arg+'\"'):\"\")+(o.modifiers?\",modifiers:\"+JSON.stringify(o.modifiers):\"\")+\"},\")}if(c)return s.slice(0,-1)+\"]\"}(e,t);r&&(n+=r+\",\"),e.key&&(n+=\"key:\"+e.key+\",\"),e.ref&&(n+=\"ref:\"+e.ref+\",\"),e.refInFor&&(n+=\"refInFor:true,\"),e.pre&&(n+=\"pre:true,\"),e.component&&(n+='tag:\"'+e.tag+'\",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+=\"attrs:\"+Ga(e.attrs)+\",\"),e.props&&(n+=\"domProps:\"+Ga(e.props)+\",\"),e.events&&(n+=Da(e.events,!1)+\",\"),e.nativeEvents&&(n+=Da(e.nativeEvents,!0)+\",\"),e.slotTarget&&!e.slotScope&&(n+=\"slot:\"+e.slotTarget+\",\"),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Ka(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==ca||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return Ja(t[e],n)}).join(\",\");return\"scopedSlots:_u([\"+a+\"]\"+(r?\",null,true\":\"\")+(!r&&i?\",null,false,\"+function(e){var t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):\"\")+\")\"}(e,e.scopedSlots,t)+\",\"),e.model&&(n+=\"model:{value:\"+e.model.value+\",callback:\"+e.model.callback+\",expression:\"+e.model.expression+\"},\"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Pa(n,t.options);return\"inlineTemplate:{render:function(){\"+r.render+\"},staticRenderFns:[\"+r.staticRenderFns.map(function(e){return\"function(){\"+e+\"}\"}).join(\",\")+\"]}\"}}(e,t);o&&(n+=o+\",\")}return n=n.replace(/,$/,\"\")+\"}\",e.dynamicAttrs&&(n=\"_b(\"+n+',\"'+e.tag+'\",'+Ga(e.dynamicAttrs)+\")\"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ka(e){return 1===e.type&&(\"slot\"===e.tag||e.children.some(Ka))}function Ja(e,t){var n=e.attrsMap[\"slot-scope\"];if(e.if&&!e.ifProcessed&&!n)return Ua(e,t,Ja,\"null\");if(e.for&&!e.forProcessed)return za(e,t,Ja);var r=e.slotScope===ca?\"\":String(e.slotScope),i=\"function(\"+r+\"){return \"+(\"template\"===e.tag?e.if&&n?\"(\"+e.if+\")?\"+(qa(e,t)||\"undefined\")+\":undefined\":qa(e,t)||\"undefined\":Ra(e,t))+\"}\",o=r?\"\":\",proxy:true\";return\"{key:\"+(e.slotTarget||'\"default\"')+\",fn:\"+i+o+\"}\"}function qa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&\"template\"!==a.tag&&\"slot\"!==a.tag){var s=n?t.maybeComponent(a)?\",1\":\",0\":\"\";return\"\"+(r||Ra)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Wa(i)||i.ifConditions&&i.ifConditions.some(function(e){return Wa(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,u=i||Za;return\"[\"+o.map(function(e){return u(e,t)}).join(\",\")+\"]\"+(c?\",\"+c:\"\")}}function Wa(e){return void 0!==e.for||\"template\"===e.tag||\"slot\"===e.tag}function Za(e,t){return 1===e.type?Ra(e,t):3===e.type&&e.isComment?(r=e,\"_e(\"+JSON.stringify(r.text)+\")\"):\"_v(\"+(2===(n=e).type?n.expression:Xa(JSON.stringify(n.text)))+\")\";var n,r}function Ga(e){for(var t=\"\",n=\"\",r=0;r<e.length;r++){var i=e[r],o=Xa(i.value);i.dynamic?n+=i.name+\",\"+o+\",\":t+='\"'+i.name+'\":'+o+\",\"}return t=\"{\"+t.slice(0,-1)+\"}\",n?\"_d(\"+t+\",[\"+n.slice(0,-1)+\"])\":t}function Xa(e){return e.replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}new RegExp(\"\\\\b\"+\"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments\".split(\",\").join(\"\\\\b|\\\\b\")+\"\\\\b\");function Ya(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),S}}function Qa(e){var t=Object.create(null);return function(n,r,i){(r=A({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=Ya(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Ya(e,c)}),t[o]=s}}var es,ts,ns=(es=function(e,t){var n=la(e.trim(),t);!1!==t.optimize&&ka(n,t);var r=Pa(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(n)for(var a in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=A(Object.create(e.directives||null),n.directives)),n)\"modules\"!==a&&\"directives\"!==a&&(r[a]=n[a]);r.warn=function(e,t,n){(n?o:i).push(e)};var s=es(t.trim(),r);return s.errors=i,s.tips=o,s}return{compile:t,compileToFunctions:Qa(t)}})(Ca),rs=(ns.compile,ns.compileToFunctions);function is(e){return(ts=ts||document.createElement(\"div\")).innerHTML=e?'<a href=\"\\n\"/>':'<div a=\"\\n\"/>',ts.innerHTML.indexOf(\"&#10;\")>0}var os=!!z&&is(!1),as=!!z&&is(!0),ss=g(function(e){var t=Yn(e);return t&&t.innerHTML}),cs=wn.prototype.$mount;return wn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if(\"string\"==typeof r)\"#\"===r.charAt(0)&&(r=ss(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement(\"div\");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=rs(r,{outputSourceRange:!1,shouldDecodeNewlines:os,shouldDecodeNewlinesForHref:as,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return cs.call(this,e,t)},wn.compile=rs,wn});"
  },
  {
    "path": "api-test/lib/js/vue-json-pretty.js",
    "content": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.VueJsonPretty=t():e.VueJsonPretty=t()}(\"undefined\"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=39)}([function(e,t){var n=e.exports={version:\"2.6.9\"};\"number\"==typeof __e&&(__e=n)},function(e,t,n){var r=n(25)(\"wks\"),o=n(27),i=n(3).Symbol,s=\"function\"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)(\"Symbol.\"+e))}).store=r},function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},c=typeof e.default;\"object\"!==c&&\"function\"!==c||(s=e,a=e.default);var u=\"function\"==typeof a?a.options:a;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var l;if(i?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=l):r&&(l=r),l){var f=u.functional,d=f?u.render:u.beforeCreate;f?(u._injectStyles=l,u.render=function(e,t){return l.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:s,exports:a,options:u}}},function(e,t){var n=e.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=n)},function(e,t,n){e.exports=!n(9)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(3),o=n(0),i=n(19),s=n(6),a=n(10),c=function(e,t,n){var u,l,f,d=e&c.F,p=e&c.G,h=e&c.S,v=e&c.P,b=e&c.B,m=e&c.W,y=p?o:o[t]||(o[t]={}),g=y.prototype,_=p?r:h?r[t]:(r[t]||{}).prototype;p&&(n=t);for(u in n)(l=!d&&_&&void 0!==_[u])&&a(y,u)||(f=l?_[u]:n[u],y[u]=p&&\"function\"!=typeof _[u]?n[u]:b&&l?i(f,r):m&&_[u]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&\"function\"==typeof f?i(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[u]=f,e&c.R&&g&&!g[u]&&s(g,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(7),o=n(13);e.exports=n(4)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(8),o=n(44),i=n(45),s=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return s(e,t,n)}catch(e){}if(\"get\"in n||\"set\"in n)throw TypeError(\"Accessors not supported!\");return\"value\"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(12);e.exports=function(e){if(!r(e))throw TypeError(e+\" is not an object!\");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(15);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return\"object\"==typeof e?null!==e:\"function\"==typeof e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(47),o=n(28);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError(\"Can't call method on  \"+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(25)(\"keys\"),o=n(27);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t){e.exports={}},function(e,t,n){var r=n(43);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(12),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(22),o=n(15);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(23);e.exports=Object(\"z\").propertyIsEnumerable(0)?Object:function(e){return\"String\"==r(e)?e.split(\"\"):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(16),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(0),o=n(3),i=o[\"__core-js_shared__\"]||(o[\"__core-js_shared__\"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})(\"versions\",[]).push({version:r.version,mode:n(26)?\"pure\":\"global\",copyright:\"© 2019 Denis Pushkarev (zloirock.ru)\"})},function(e,t){e.exports=!0},function(e,t){var n=0,r=Math.random();e.exports=function(e){return\"Symbol(\".concat(void 0===e?\"\":e,\")_\",(++n+r).toString(36))}},function(e,t){e.exports=\"constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf\".split(\",\")},function(e,t,n){\"use strict\";var r=n(53),o=n.n(r),i=n(31),s=n.n(i),a=n(75),c=n(77),u=n(79),l=n(81),f=n(83),d=n(33);t.a={name:\"vue-json-pretty\",components:{SimpleText:a.a,VueCheckbox:c.a,VueRadio:u.a,BracketsLeft:l.a,BracketsRight:f.a},props:{data:{},deep:{type:Number,default:1/0},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},path:{type:String,default:\"root\"},selectableType:{type:String,default:\"\"},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},value:{type:[Array,String],default:function(){return\"\"}},pathSelectable:{type:Function,default:function(){return!0}},highlightMouseoverNode:{type:Boolean,default:!1},highlightSelectedNode:{type:Boolean,default:!0},collapsedOnClickBrackets:{type:Boolean,default:!0},parentData:{},currentDeep:{type:Number,default:1},currentKey:[Number,String]},data:function(){return{visible:this.currentDeep<=this.deep,isMouseover:!1,currentCheckboxVal:!!Array.isArray(this.value)&&this.value.includes(this.path)}},computed:{model:{get:function(){var e=\"multiple\"===this.selectableType?[]:\"single\"===this.selectableType?\"\":null;return this.value||e},set:function(e){this.$emit(\"input\",e)}},lastKey:function(){if(Array.isArray(this.parentData))return this.parentData.length-1;if(this.isObject(this.parentData)){var e=s()(this.parentData);return e[e.length-1]}},notLastKey:function(){return this.currentKey!==this.lastKey},selectable:function(){return this.pathSelectable(this.path,this.data)&&(this.isMultiple||this.isSingle)},isMultiple:function(){return\"multiple\"===this.selectableType},isSingle:function(){return\"single\"===this.selectableType},isSelected:function(){return this.isMultiple?this.model.includes(this.path):!!this.isSingle&&this.model===this.path},propsError:function(){return!this.selectableType||this.selectOnClickNode||this.showSelectController?\"\":\"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail.\"}},methods:{handleValueChange:function(e){var t=this;if(!this.isMultiple||\"checkbox\"!==e&&\"tree\"!==e){if(this.isSingle&&(\"radio\"===e||\"tree\"===e)&&this.model!==this.path){var n=this.model,r=this.path;this.model=r,this.$emit(\"change\",r,n)}}else{var i=this.model.findIndex(function(e){return e===t.path}),s=[].concat(o()(this.model));-1!==i?this.model.splice(i,1):this.model.push(this.path),\"checkbox\"!==e&&(this.currentCheckboxVal=!this.currentCheckboxVal),this.$emit(\"change\",this.model,s)}},handleClick:function(e){e._uid&&e._uid!==this._uid||(e._uid=this._uid,this.$emit(\"click\",this.path,this.data),this.selectable&&this.selectOnClickNode&&this.handleValueChange(\"tree\"))},handleItemClick:function(e,t){this.$emit(\"click\",e,t)},handleItemChange:function(e,t){this.selectable&&this.$emit(\"change\",e,t)},handleMouseover:function(){this.highlightMouseoverNode&&(this.selectable||\"\"===this.selectableType)&&(this.isMouseover=!0)},handleMouseout:function(){this.highlightMouseoverNode&&(this.selectable||\"\"===this.selectableType)&&(this.isMouseover=!1)},isObject:function(e){return\"object\"===Object(d.a)(e)},keyFormatter:function(e){return this.showDoubleQuotes?'\"'+e+'\"':e}},errorCaptured:function(){return!1},watch:{deep:function(e){this.visible=this.currentDeep<=e},propsError:{handler:function(e){if(e)throw new Error(\"[vue-json-pretty] \"+e)},immediate:!0}}}},function(e,t,n){var r=n(7).f,o=n(10),i=n(1)(\"toStringTag\");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){e.exports={default:n(72),__esModule:!0}},function(e,t,n){\"use strict\";var r=n(33);t.a={props:{showDoubleQuotes:Boolean,parentData:{},data:{},showComma:Boolean,currentKey:[Number,String]},computed:{dataType:function(){return Object(r.a)(this.data)},parentDataType:function(){return Object(r.a)(this.parentData)}},methods:{textFormatter:function(e){var t=e+\"\";return\"string\"===this.dataType&&(t='\"'+t+'\"'),this.showComma&&(t+=\",\"),t}}}},function(e,t,n){\"use strict\";function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}t.a=r},function(e,t,n){\"use strict\";t.a={props:{value:{type:Boolean,default:!1}},data:function(){return{focus:!1}},computed:{model:{get:function(){return this.value},set:function(e){this.$emit(\"input\",e)}}}}},function(e,t,n){\"use strict\";t.a={props:{path:String,value:{type:String,default:\"\"}},data:function(){return{focus:!1}},computed:{currentPath:function(){return this.path},model:{get:function(){return this.value},set:function(e){this.$emit(\"input\",e)}}},methods:{change:function(){this.$emit(\"change\",this.model)}}}},function(e,t,n){\"use strict\";var r=n(31),o=n.n(r),i=n(37);t.a={mixins:[i.a],props:{showLength:Boolean},methods:{closedBracketsGenerator:function(e){var t=Array.isArray(e)?\"[...]\":\"{...}\";return this.bracketsFormatter(t)},lengthGenerator:function(e){return\" // \"+(Array.isArray(e)?e.length+\" items\":o()(e).length+\" keys\")}}}},function(e,t,n){\"use strict\";t.a={props:{visible:{required:!0,type:Boolean},data:{required:!0},showComma:Boolean,collapsedOnClickBrackets:Boolean},computed:{dataVisible:{get:function(){return this.visible},set:function(e){this.collapsedOnClickBrackets&&this.$emit(\"update:visible\",e)}}},methods:{toggleBrackets:function(){this.dataVisible=!this.dataVisible},bracketsFormatter:function(e){return this.showComma?e+\",\":e}}}},function(e,t,n){\"use strict\";var r=n(37);t.a={mixins:[r.a]}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(40),o=n.n(r),i=n(52),s=n(86);n.n(s);t.default=o()({},i.a,{version:\"1.6.2\"})},function(e,t,n){e.exports={default:n(41),__esModule:!0}},function(e,t,n){n(42),e.exports=n(0).Object.assign},function(e,t,n){var r=n(5);r(r.S+r.F,\"Object\",{assign:n(46)})},function(e,t){e.exports=function(e){if(\"function\"!=typeof e)throw TypeError(e+\" is not a function!\");return e}},function(e,t,n){e.exports=!n(4)&&!n(9)(function(){return 7!=Object.defineProperty(n(20)(\"div\"),\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(12);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&\"function\"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if(\"function\"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&\"function\"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError(\"Can't convert object to primitive value\")}},function(e,t,n){\"use strict\";var r=n(4),o=n(14),i=n(50),s=n(51),a=n(11),c=n(22),u=Object.assign;e.exports=!u||n(9)(function(){var e={},t={},n=Symbol(),r=\"abcdefghijklmnopqrst\";return e[n]=7,r.split(\"\").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join(\"\")!=r})?function(e,t){for(var n=a(e),u=arguments.length,l=1,f=i.f,d=s.f;u>l;)for(var p,h=c(arguments[l++]),v=f?o(h).concat(f(h)):o(h),b=v.length,m=0;b>m;)p=v[m++],r&&!d.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t,n){var r=n(10),o=n(21),i=n(48)(!1),s=n(17)(\"IE_PROTO\");e.exports=function(e,t){var n,a=o(e),c=0,u=[];for(n in a)n!=s&&r(a,n)&&u.push(n);for(;t.length>c;)r(a,n=t[c++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){var r=n(21),o=n(24),i=n(49);e.exports=function(e){return function(t,n,s){var a,c=r(t),u=o(c.length),l=i(s,u);if(e&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(16),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){\"use strict\";var r=n(29),o=n(85),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";t.__esModule=!0;var r=n(54),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,o.default)(e)}},function(e,t,n){e.exports={default:n(55),__esModule:!0}},function(e,t,n){n(56),n(65),e.exports=n(0).Array.from},function(e,t,n){\"use strict\";var r=n(57)(!0);n(58)(String,\"String\",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(16),o=n(15);e.exports=function(e){return function(t,n){var i,s,a=String(o(t)),c=r(n),u=a.length;return c<0||c>=u?e?\"\":void 0:(i=a.charCodeAt(c),i<55296||i>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?e?a.charAt(c):i:e?a.slice(c,c+2):s-56320+(i-55296<<10)+65536)}}},function(e,t,n){\"use strict\";var r=n(26),o=n(5),i=n(59),s=n(6),a=n(18),c=n(60),u=n(30),l=n(64),f=n(1)(\"iterator\"),d=!([].keys&&\"next\"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,v,b,m){c(n,t,h);var y,g,_,x=function(e){if(!d&&e in C)return C[e];switch(e){case\"keys\":case\"values\":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+\" Iterator\",j=\"values\"==v,w=!1,C=e.prototype,O=C[f]||C[\"@@iterator\"]||v&&C[v],S=O||x(v),A=v?j?x(\"entries\"):S:void 0,M=\"Array\"==t?C.entries||O:O;if(M&&(_=l(M.call(new e)))!==Object.prototype&&_.next&&(u(_,k,!0),r||\"function\"==typeof _[f]||s(_,f,p)),j&&O&&\"values\"!==O.name&&(w=!0,S=function(){return O.call(this)}),r&&!m||!d&&!w&&C[f]||s(C,f,S),a[t]=S,a[k]=p,v)if(y={values:j?S:x(\"values\"),keys:b?S:x(\"keys\"),entries:A},m)for(g in y)g in C||i(C,g,y[g]);else o(o.P+o.F*(d||w),t,y);return y}},function(e,t,n){e.exports=n(6)},function(e,t,n){\"use strict\";var r=n(61),o=n(13),i=n(30),s={};n(6)(s,n(1)(\"iterator\"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+\" Iterator\")}},function(e,t,n){var r=n(8),o=n(62),i=n(28),s=n(17)(\"IE_PROTO\"),a=function(){},c=function(){var e,t=n(20)(\"iframe\"),r=i.length;for(t.style.display=\"none\",n(63).appendChild(t),t.src=\"javascript:\",e=t.contentWindow.document,e.open(),e.write(\"<script>document.F=Object<\\/script>\"),e.close(),c=e.F;r--;)delete c.prototype[i[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=r(e),n=new a,a.prototype=null,n[s]=e):n=c(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(7),o=n(8),i=n(14);e.exports=n(4)?Object.defineProperties:function(e,t){o(e);for(var n,s=i(t),a=s.length,c=0;a>c;)r.f(e,n=s[c++],t[n]);return e}},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(10),o=n(11),i=n(17)(\"IE_PROTO\"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:\"function\"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){\"use strict\";var r=n(19),o=n(5),i=n(11),s=n(66),a=n(67),c=n(24),u=n(68),l=n(69);o(o.S+o.F*!n(71)(function(e){Array.from(e)}),\"Array\",{from:function(e){var t,n,o,f,d=i(e),p=\"function\"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,b=void 0!==v,m=0,y=l(d);if(b&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==y||p==Array&&a(y))for(t=c(d.length),n=new p(t);t>m;m++)u(n,m,b?v(d[m],m):d[m]);else for(f=y.call(d),n=new p;!(o=f.next()).done;m++)u(n,m,b?s(f,v,[o.value,m],!0):o.value);return n.length=m,n}})},function(e,t,n){var r=n(8);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(18),o=n(1)(\"iterator\"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){\"use strict\";var r=n(7),o=n(13);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(70),o=n(1)(\"iterator\"),i=n(18);e.exports=n(0).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e[\"@@iterator\"]||i[r(e)]}},function(e,t,n){var r=n(23),o=n(1)(\"toStringTag\"),i=\"Arguments\"==r(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,a;return void 0===e?\"Undefined\":null===e?\"Null\":\"string\"==typeof(n=s(t=Object(e),o))?n:i?r(t):\"Object\"==(a=r(t))&&\"function\"==typeof t.callee?\"Arguments\":a}},function(e,t,n){var r=n(1)(\"iterator\"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},e(i)}catch(e){}return n}},function(e,t,n){n(73),e.exports=n(0).Object.keys},function(e,t,n){var r=n(11),o=n(14);n(74)(\"keys\",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(5),o=n(0),i=n(9);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*i(function(){n(1)}),\"Object\",s)}},function(e,t,n){\"use strict\";var r=n(32),o=n(76),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",[e._t(\"default\"),e._v(\" \"),n(\"span\",{class:\"vjs-value vjs-value__\"+e.dataType},[e._v(\"\\n    \"+e._s(e.textFormatter(e.data))+\"\\n  \")])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(34),o=n(78),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"label\",{class:[\"vjs-checkbox\",e.value?\"is-checked\":\"\"],on:{click:function(e){e.stopPropagation()}}},[n(\"span\",{staticClass:\"vjs-checkbox__inner\"}),e._v(\" \"),n(\"input\",{directives:[{name:\"model\",rawName:\"v-model\",value:e.model,expression:\"model\"}],staticClass:\"vjs-checkbox__original\",attrs:{type:\"checkbox\"},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e.model},on:{change:[function(t){var n=e.model,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&(e.model=n.concat([null])):i>-1&&(e.model=n.slice(0,i).concat(n.slice(i+1)))}else e.model=o},function(t){return e.$emit(\"change\",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(35),o=n(80),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"label\",{class:[\"vjs-radio\",e.model===e.currentPath?\"is-checked\":\"\"],on:{click:function(e){e.stopPropagation()}}},[n(\"span\",{staticClass:\"vjs-radio__inner\"}),e._v(\" \"),n(\"input\",{directives:[{name:\"model\",rawName:\"v-model\",value:e.model,expression:\"model\"}],staticClass:\"vjs-radio__original\",attrs:{type:\"radio\"},domProps:{value:e.currentPath,checked:e._q(e.model,e.currentPath)},on:{change:[function(t){e.model=e.currentPath},e.change],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(36),o=n(82),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",[e._t(\"default\"),e._v(\" \"),n(\"span\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.dataVisible,expression:\"dataVisible\"}],staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n    \"+e._s(Array.isArray(e.data)?\"[\":\"{\")+\"\\n  \")]),e._v(\" \"),n(\"span\",{directives:[{name:\"show\",rawName:\"v-show\",value:!e.dataVisible,expression:\"!dataVisible\"}]},[n(\"span\",{staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n      \"+e._s(e.closedBracketsGenerator(e.data))+\"\\n    \")]),e._v(\" \"),e.showLength?n(\"span\",{staticClass:\"vjs-comment\"},[e._v(\"\\n      \"+e._s(e.lengthGenerator(e.data))+\"\\n    \")]):e._e()])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(38),o=n(84),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.dataVisible,expression:\"dataVisible\"}]},[n(\"span\",{staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n    \"+e._s(e.bracketsFormatter(Array.isArray(e.data)?\"]\":\"}\"))+\"\\n  \")])])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{class:{\"vjs-tree\":!0,\"has-selectable-control\":e.isMultiple||e.showSelectController,\"is-root\":1===e.currentDeep,\"is-selectable\":e.selectable,\"is-selected\":e.isSelected,\"is-highlight-selected\":e.isSelected&&e.highlightSelectedNode,\"is-mouseover\":e.isMouseover},on:{click:e.handleClick,mouseover:function(t){return t.stopPropagation(),e.handleMouseover(t)},mouseout:function(t){return t.stopPropagation(),e.handleMouseout(t)}}},[e.showSelectController&&e.selectable?[e.isMultiple?n(\"vue-checkbox\",{on:{change:function(t){return e.handleValueChange(\"checkbox\")}},model:{value:e.currentCheckboxVal,callback:function(t){e.currentCheckboxVal=t},expression:\"currentCheckboxVal\"}}):e.isSingle?n(\"vue-radio\",{attrs:{path:e.path},on:{change:function(t){return e.handleValueChange(\"radio\")}},model:{value:e.model,callback:function(t){e.model=t},expression:\"model\"}}):e._e()]:e._e(),e._v(\" \"),Array.isArray(e.data)||e.isObject(e.data)?[n(\"brackets-left\",{attrs:{visible:e.visible,data:e.data,\"show-length\":e.showLength,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"show-comma\":e.notLastKey},on:{\"update:visible\":function(t){e.visible=t}}},[e.currentDeep>1&&!Array.isArray(e.parentData)?n(\"span\",{staticClass:\"vjs-key\"},[e._v(e._s(e.keyFormatter(e.currentKey))+\":\")]):e._e()]),e._v(\" \"),e._l(e.data,function(t,r){return n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.visible,expression:\"visible\"}],key:r,class:{\"vjs-tree__content\":!0,\"has-line\":e.showLine}},[n(\"vue-json-pretty\",{attrs:{\"parent-data\":e.data,data:t,deep:e.deep,\"show-length\":e.showLength,\"show-double-quotes\":e.showDoubleQuotes,\"show-line\":e.showLine,\"highlight-mouseover-node\":e.highlightMouseoverNode,\"highlight-selected-node\":e.highlightSelectedNode,path:e.path+(Array.isArray(e.data)?\"[\"+r+\"]\":\".\"+r),\"path-selectable\":e.pathSelectable,\"selectable-type\":e.selectableType,\"show-select-controller\":e.showSelectController,\"select-on-click-node\":e.selectOnClickNode,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"current-key\":r,\"current-deep\":e.currentDeep+1},on:{click:e.handleItemClick,change:e.handleItemChange},model:{value:e.model,callback:function(t){e.model=t},expression:\"model\"}})],1)}),e._v(\" \"),n(\"brackets-right\",{attrs:{visible:e.visible,data:e.data,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"show-comma\":e.notLastKey},on:{\"update:visible\":function(t){e.visible=t}}})]:n(\"simple-text\",{attrs:{\"show-double-quotes\":e.showDoubleQuotes,\"show-comma\":e.notLastKey,\"parent-data\":e.parentData,data:e.data,\"current-key\":e.currentKey}},[e.parentData&&e.currentKey&&!Array.isArray(e.parentData)?n(\"span\",{staticClass:\"vjs-key\"},[e._v(\"\\n      \"+e._s(e.keyFormatter(e.currentKey))+\":\\n    \")]):e._e()])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){var r=n(87);\"string\"==typeof r&&(r=[[e.i,r,\"\"]]),r.locals&&(e.exports=r.locals);n(89)(\"bfa6fc9c\",r,!0,{})},function(e,t,n){t=e.exports=n(88)(!1),t.push([e.i,'.vjs-checkbox{position:absolute;left:-30px;color:#1f2d3d;user-select:none}.vjs-checkbox.is-checked .vjs-checkbox__inner{background-color:#1890ff;border-color:#0076e4}.vjs-checkbox.is-checked .vjs-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.vjs-checkbox .vjs-checkbox__inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-checkbox .vjs-checkbox__inner:after{box-sizing:content-box;content:\"\";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-checkbox .vjs-checkbox__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-radio{position:absolute;left:-30px;color:#1f2d3d;user-select:none}.vjs-radio.is-checked .vjs-radio__inner{background-color:#1890ff;border-color:#0076e4}.vjs-radio.is-checked .vjs-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.vjs-radio .vjs-radio__inner{border:1px solid #bfcbd9;border-radius:100%;width:16px;height:16px;vertical-align:middle;background-color:#fff;position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.vjs-radio .vjs-radio__inner:after{width:4px;height:4px;border-radius:100%;background-color:#fff;content:\"\";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.vjs-radio .vjs-radio__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px}.vjs-tree.is-root{position:relative}.vjs-tree.is-root.has-selectable-control{margin-left:30px}.vjs-tree.is-mouseover{background-color:#e6f7ff}.vjs-tree.is-highlight-selected{background-color:#ccefff}.vjs-tree .vjs-tree__content{padding-left:1em}.vjs-tree .vjs-tree__content.has-line{border-left:1px dotted #bfcbd9}.vjs-tree .vjs-tree__brackets{cursor:pointer}.vjs-tree .vjs-tree__brackets:hover{color:#1890ff}.vjs-tree .vjs-comment{color:#bfcbd9}.vjs-tree .vjs-value__null{color:#ff4949}.vjs-tree .vjs-value__boolean,.vjs-tree .vjs-value__number{color:#1d8ce0}.vjs-tree .vjs-value__string{color:#13ce66}',\"\"])},function(e,t){function n(e,t){var n=e[1]||\"\",o=e[3];if(!o)return n;if(t&&\"function\"==typeof btoa){var i=r(o);return[n].concat(o.sources.map(function(e){return\"/*# sourceURL=\"+o.sourceRoot+e+\" */\"})).concat([i]).join(\"\\n\")}return[n].join(\"\\n\")}function r(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?\"@media \"+t[2]+\"{\"+r+\"}\":r}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];\"number\"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var s=e[o];\"number\"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]=\"(\"+s[2]+\") and (\"+n+\")\"),t.push(s))}},t}},function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=l[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(i(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var s=[],o=0;o<n.parts.length;o++)s.push(i(n.parts[o]));l[n.id]={id:n.id,refs:1,parts:s}}}}function o(){var e=document.createElement(\"style\");return e.type=\"text/css\",f.appendChild(e),e}function i(e){var t,n,r=document.querySelector(\"style[\"+m+'~=\"'+e.id+'\"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(y){var i=p++;r=d||(d=o()),t=s.bind(null,r,i,!1),n=s.bind(null,r,i,!0)}else r=o(),t=a.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function s(e,t,n,r){var o=n?\"\":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function a(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute(\"media\",r),b.ssrId&&e.setAttribute(m,t.id),o&&(n+=\"\\n/*# sourceURL=\"+o.sources[0]+\" */\",n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+\" */\"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c=\"undefined\"!=typeof document;if(\"undefined\"!=typeof DEBUG&&DEBUG&&!c)throw new Error(\"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\");var u=n(90),l={},f=c&&(document.head||document.getElementsByTagName(\"head\")[0]),d=null,p=0,h=!1,v=function(){},b=null,m=\"data-vue-ssr-id\",y=\"undefined\"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,o){h=n,b=o||{};var i=u(e,t);return r(i),function(t){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=l[s.id];a.refs--,n.push(a)}t?(i=u(e,t),r(i)):i=[];for(var o=0;o<n.length;o++){var a=n[o];if(0===a.refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete l[a.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join(\"\\n\")}}()},function(e,t){e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],s=i[0],a=i[1],c=i[2],u=i[3],l={id:e+\":\"+o,css:a,media:c,sourceMap:u};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}}])});"
  },
  {
    "path": "api-test/lib/styles/dragula-3.7.2.css",
    "content": ".gu-mirror {\n  position: fixed !important;\n  margin: 0 !important;\n  z-index: 9999 !important;\n  opacity: 0.8;\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";\n  filter: alpha(opacity=80);\n}\n.gu-hide {\n  display: none !important;\n}\n.gu-unselectable {\n  -webkit-user-select: none !important;\n  -moz-user-select: none !important;\n  -ms-user-select: none !important;\n  user-select: none !important;\n}\n.gu-transit {\n  opacity: 0.2;\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";\n  filter: alpha(opacity=20);\n}"
  },
  {
    "path": "api-test/lib/styles/iview.css",
    "content": ".ivu-load-loop{-webkit-animation:ani-load-loop 1s linear infinite;animation:ani-load-loop 1s linear infinite}@-webkit-keyframes ani-load-loop{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes ani-load-loop{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.input-group-error-append,.input-group-error-prepend{background-color:#fff;border:1px solid #ed4014}.input-group-error-append .ivu-select-selection,.input-group-error-prepend .ivu-select-selection{background-color:inherit;border:1px solid transparent}.input-group-error-prepend{border-right:0}.input-group-error-append{border-left:0}/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto;resize:vertical}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}body{font-family:\"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;font-size:14px;line-height:1.5;color:#515a6e;background-color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}article,aside,blockquote,body,button,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,input,legend,li,menu,nav,ol,p,section,td,textarea,th,ul{margin:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}input::-ms-clear,input::-ms-reveal{display:none}a{color:#2d8cf0;background:0 0;text-decoration:none;outline:0;cursor:pointer;-webkit-transition:color .2s ease;transition:color .2s ease}a:hover{color:#57a3f3}a:active{color:#2b85e4}a:active,a:hover{outline:0;text-decoration:none}a[disabled]{color:#ccc;cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-family:Consolas,Menlo,Courier,monospace}@font-face{font-family:Ionicons;src:url(fonts/ionicons.woff2?v=3.0.0) format(\"woff2\"),url(fonts/ionicons.woff?v=3.0.0) format(\"woff\"),url(fonts/ionicons.ttf?v=3.0.0) format(\"truetype\"),url(fonts/ionicons.svg?v=3.0.0#Ionicons) format(\"svg\");font-weight:400;font-style:normal}.ivu-icon{display:inline-block;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:optimizeLegibility;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:-.125em;text-align:center}.ivu-icon-ios-add-circle-outline:before{content:\"\\f100\"}.ivu-icon-ios-add-circle:before{content:\"\\f101\"}.ivu-icon-ios-add:before{content:\"\\f102\"}.ivu-icon-ios-alarm-outline:before{content:\"\\f103\"}.ivu-icon-ios-alarm:before{content:\"\\f104\"}.ivu-icon-ios-albums-outline:before{content:\"\\f105\"}.ivu-icon-ios-albums:before{content:\"\\f106\"}.ivu-icon-ios-alert-outline:before{content:\"\\f107\"}.ivu-icon-ios-alert:before{content:\"\\f108\"}.ivu-icon-ios-american-football-outline:before{content:\"\\f109\"}.ivu-icon-ios-american-football:before{content:\"\\f10a\"}.ivu-icon-ios-analytics-outline:before{content:\"\\f10b\"}.ivu-icon-ios-analytics:before{content:\"\\f10c\"}.ivu-icon-ios-aperture-outline:before{content:\"\\f10d\"}.ivu-icon-ios-aperture:before{content:\"\\f10e\"}.ivu-icon-ios-apps-outline:before{content:\"\\f10f\"}.ivu-icon-ios-apps:before{content:\"\\f110\"}.ivu-icon-ios-appstore-outline:before{content:\"\\f111\"}.ivu-icon-ios-appstore:before{content:\"\\f112\"}.ivu-icon-ios-archive-outline:before{content:\"\\f113\"}.ivu-icon-ios-archive:before{content:\"\\f114\"}.ivu-icon-ios-arrow-back:before{content:\"\\f115\"}.ivu-icon-ios-arrow-down:before{content:\"\\f116\"}.ivu-icon-ios-arrow-dropdown-circle:before{content:\"\\f117\"}.ivu-icon-ios-arrow-dropdown:before{content:\"\\f118\"}.ivu-icon-ios-arrow-dropleft-circle:before{content:\"\\f119\"}.ivu-icon-ios-arrow-dropleft:before{content:\"\\f11a\"}.ivu-icon-ios-arrow-dropright-circle:before{content:\"\\f11b\"}.ivu-icon-ios-arrow-dropright:before{content:\"\\f11c\"}.ivu-icon-ios-arrow-dropup-circle:before{content:\"\\f11d\"}.ivu-icon-ios-arrow-dropup:before{content:\"\\f11e\"}.ivu-icon-ios-arrow-forward:before{content:\"\\f11f\"}.ivu-icon-ios-arrow-round-back:before{content:\"\\f120\"}.ivu-icon-ios-arrow-round-down:before{content:\"\\f121\"}.ivu-icon-ios-arrow-round-forward:before{content:\"\\f122\"}.ivu-icon-ios-arrow-round-up:before{content:\"\\f123\"}.ivu-icon-ios-arrow-up:before{content:\"\\f124\"}.ivu-icon-ios-at-outline:before{content:\"\\f125\"}.ivu-icon-ios-at:before{content:\"\\f126\"}.ivu-icon-ios-attach:before{content:\"\\f127\"}.ivu-icon-ios-backspace-outline:before{content:\"\\f128\"}.ivu-icon-ios-backspace:before{content:\"\\f129\"}.ivu-icon-ios-barcode-outline:before{content:\"\\f12a\"}.ivu-icon-ios-barcode:before{content:\"\\f12b\"}.ivu-icon-ios-baseball-outline:before{content:\"\\f12c\"}.ivu-icon-ios-baseball:before{content:\"\\f12d\"}.ivu-icon-ios-basket-outline:before{content:\"\\f12e\"}.ivu-icon-ios-basket:before{content:\"\\f12f\"}.ivu-icon-ios-basketball-outline:before{content:\"\\f130\"}.ivu-icon-ios-basketball:before{content:\"\\f131\"}.ivu-icon-ios-battery-charging:before{content:\"\\f132\"}.ivu-icon-ios-battery-dead:before{content:\"\\f133\"}.ivu-icon-ios-battery-full:before{content:\"\\f134\"}.ivu-icon-ios-beaker-outline:before{content:\"\\f135\"}.ivu-icon-ios-beaker:before{content:\"\\f136\"}.ivu-icon-ios-beer-outline:before{content:\"\\f137\"}.ivu-icon-ios-beer:before{content:\"\\f138\"}.ivu-icon-ios-bicycle:before{content:\"\\f139\"}.ivu-icon-ios-bluetooth:before{content:\"\\f13a\"}.ivu-icon-ios-boat-outline:before{content:\"\\f13b\"}.ivu-icon-ios-boat:before{content:\"\\f13c\"}.ivu-icon-ios-body-outline:before{content:\"\\f13d\"}.ivu-icon-ios-body:before{content:\"\\f13e\"}.ivu-icon-ios-bonfire-outline:before{content:\"\\f13f\"}.ivu-icon-ios-bonfire:before{content:\"\\f140\"}.ivu-icon-ios-book-outline:before{content:\"\\f141\"}.ivu-icon-ios-book:before{content:\"\\f142\"}.ivu-icon-ios-bookmark-outline:before{content:\"\\f143\"}.ivu-icon-ios-bookmark:before{content:\"\\f144\"}.ivu-icon-ios-bookmarks-outline:before{content:\"\\f145\"}.ivu-icon-ios-bookmarks:before{content:\"\\f146\"}.ivu-icon-ios-bowtie-outline:before{content:\"\\f147\"}.ivu-icon-ios-bowtie:before{content:\"\\f148\"}.ivu-icon-ios-briefcase-outline:before{content:\"\\f149\"}.ivu-icon-ios-briefcase:before{content:\"\\f14a\"}.ivu-icon-ios-browsers-outline:before{content:\"\\f14b\"}.ivu-icon-ios-browsers:before{content:\"\\f14c\"}.ivu-icon-ios-brush-outline:before{content:\"\\f14d\"}.ivu-icon-ios-brush:before{content:\"\\f14e\"}.ivu-icon-ios-bug-outline:before{content:\"\\f14f\"}.ivu-icon-ios-bug:before{content:\"\\f150\"}.ivu-icon-ios-build-outline:before{content:\"\\f151\"}.ivu-icon-ios-build:before{content:\"\\f152\"}.ivu-icon-ios-bulb-outline:before{content:\"\\f153\"}.ivu-icon-ios-bulb:before{content:\"\\f154\"}.ivu-icon-ios-bus-outline:before{content:\"\\f155\"}.ivu-icon-ios-bus:before{content:\"\\f156\"}.ivu-icon-ios-cafe-outline:before{content:\"\\f157\"}.ivu-icon-ios-cafe:before{content:\"\\f158\"}.ivu-icon-ios-calculator-outline:before{content:\"\\f159\"}.ivu-icon-ios-calculator:before{content:\"\\f15a\"}.ivu-icon-ios-calendar-outline:before{content:\"\\f15b\"}.ivu-icon-ios-calendar:before{content:\"\\f15c\"}.ivu-icon-ios-call-outline:before{content:\"\\f15d\"}.ivu-icon-ios-call:before{content:\"\\f15e\"}.ivu-icon-ios-camera-outline:before{content:\"\\f15f\"}.ivu-icon-ios-camera:before{content:\"\\f160\"}.ivu-icon-ios-car-outline:before{content:\"\\f161\"}.ivu-icon-ios-car:before{content:\"\\f162\"}.ivu-icon-ios-card-outline:before{content:\"\\f163\"}.ivu-icon-ios-card:before{content:\"\\f164\"}.ivu-icon-ios-cart-outline:before{content:\"\\f165\"}.ivu-icon-ios-cart:before{content:\"\\f166\"}.ivu-icon-ios-cash-outline:before{content:\"\\f167\"}.ivu-icon-ios-cash:before{content:\"\\f168\"}.ivu-icon-ios-chatboxes-outline:before{content:\"\\f169\"}.ivu-icon-ios-chatboxes:before{content:\"\\f16a\"}.ivu-icon-ios-chatbubbles-outline:before{content:\"\\f16b\"}.ivu-icon-ios-chatbubbles:before{content:\"\\f16c\"}.ivu-icon-ios-checkbox-outline:before{content:\"\\f16d\"}.ivu-icon-ios-checkbox:before{content:\"\\f16e\"}.ivu-icon-ios-checkmark-circle-outline:before{content:\"\\f16f\"}.ivu-icon-ios-checkmark-circle:before{content:\"\\f170\"}.ivu-icon-ios-checkmark:before{content:\"\\f171\"}.ivu-icon-ios-clipboard-outline:before{content:\"\\f172\"}.ivu-icon-ios-clipboard:before{content:\"\\f173\"}.ivu-icon-ios-clock-outline:before{content:\"\\f174\"}.ivu-icon-ios-clock:before{content:\"\\f175\"}.ivu-icon-ios-close-circle-outline:before{content:\"\\f176\"}.ivu-icon-ios-close-circle:before{content:\"\\f177\"}.ivu-icon-ios-close:before{content:\"\\f178\"}.ivu-icon-ios-closed-captioning-outline:before{content:\"\\f179\"}.ivu-icon-ios-closed-captioning:before{content:\"\\f17a\"}.ivu-icon-ios-cloud-circle-outline:before{content:\"\\f17b\"}.ivu-icon-ios-cloud-circle:before{content:\"\\f17c\"}.ivu-icon-ios-cloud-done-outline:before{content:\"\\f17d\"}.ivu-icon-ios-cloud-done:before{content:\"\\f17e\"}.ivu-icon-ios-cloud-download-outline:before{content:\"\\f17f\"}.ivu-icon-ios-cloud-download:before{content:\"\\f180\"}.ivu-icon-ios-cloud-outline:before{content:\"\\f181\"}.ivu-icon-ios-cloud-upload-outline:before{content:\"\\f182\"}.ivu-icon-ios-cloud-upload:before{content:\"\\f183\"}.ivu-icon-ios-cloud:before{content:\"\\f184\"}.ivu-icon-ios-cloudy-night-outline:before{content:\"\\f185\"}.ivu-icon-ios-cloudy-night:before{content:\"\\f186\"}.ivu-icon-ios-cloudy-outline:before{content:\"\\f187\"}.ivu-icon-ios-cloudy:before{content:\"\\f188\"}.ivu-icon-ios-code-download:before{content:\"\\f189\"}.ivu-icon-ios-code-working:before{content:\"\\f18a\"}.ivu-icon-ios-code:before{content:\"\\f18b\"}.ivu-icon-ios-cog-outline:before{content:\"\\f18c\"}.ivu-icon-ios-cog:before{content:\"\\f18d\"}.ivu-icon-ios-color-fill-outline:before{content:\"\\f18e\"}.ivu-icon-ios-color-fill:before{content:\"\\f18f\"}.ivu-icon-ios-color-filter-outline:before{content:\"\\f190\"}.ivu-icon-ios-color-filter:before{content:\"\\f191\"}.ivu-icon-ios-color-palette-outline:before{content:\"\\f192\"}.ivu-icon-ios-color-palette:before{content:\"\\f193\"}.ivu-icon-ios-color-wand-outline:before{content:\"\\f194\"}.ivu-icon-ios-color-wand:before{content:\"\\f195\"}.ivu-icon-ios-compass-outline:before{content:\"\\f196\"}.ivu-icon-ios-compass:before{content:\"\\f197\"}.ivu-icon-ios-construct-outline:before{content:\"\\f198\"}.ivu-icon-ios-construct:before{content:\"\\f199\"}.ivu-icon-ios-contact-outline:before{content:\"\\f19a\"}.ivu-icon-ios-contact:before{content:\"\\f19b\"}.ivu-icon-ios-contacts-outline:before{content:\"\\f19c\"}.ivu-icon-ios-contacts:before{content:\"\\f19d\"}.ivu-icon-ios-contract:before{content:\"\\f19e\"}.ivu-icon-ios-contrast:before{content:\"\\f19f\"}.ivu-icon-ios-copy-outline:before{content:\"\\f1a0\"}.ivu-icon-ios-copy:before{content:\"\\f1a1\"}.ivu-icon-ios-create-outline:before{content:\"\\f1a2\"}.ivu-icon-ios-create:before{content:\"\\f1a3\"}.ivu-icon-ios-crop-outline:before{content:\"\\f1a4\"}.ivu-icon-ios-crop:before{content:\"\\f1a5\"}.ivu-icon-ios-cube-outline:before{content:\"\\f1a6\"}.ivu-icon-ios-cube:before{content:\"\\f1a7\"}.ivu-icon-ios-cut-outline:before{content:\"\\f1a8\"}.ivu-icon-ios-cut:before{content:\"\\f1a9\"}.ivu-icon-ios-desktop-outline:before{content:\"\\f1aa\"}.ivu-icon-ios-desktop:before{content:\"\\f1ab\"}.ivu-icon-ios-disc-outline:before{content:\"\\f1ac\"}.ivu-icon-ios-disc:before{content:\"\\f1ad\"}.ivu-icon-ios-document-outline:before{content:\"\\f1ae\"}.ivu-icon-ios-document:before{content:\"\\f1af\"}.ivu-icon-ios-done-all:before{content:\"\\f1b0\"}.ivu-icon-ios-download-outline:before{content:\"\\f1b1\"}.ivu-icon-ios-download:before{content:\"\\f1b2\"}.ivu-icon-ios-easel-outline:before{content:\"\\f1b3\"}.ivu-icon-ios-easel:before{content:\"\\f1b4\"}.ivu-icon-ios-egg-outline:before{content:\"\\f1b5\"}.ivu-icon-ios-egg:before{content:\"\\f1b6\"}.ivu-icon-ios-exit-outline:before{content:\"\\f1b7\"}.ivu-icon-ios-exit:before{content:\"\\f1b8\"}.ivu-icon-ios-expand:before{content:\"\\f1b9\"}.ivu-icon-ios-eye-off-outline:before{content:\"\\f1ba\"}.ivu-icon-ios-eye-off:before{content:\"\\f1bb\"}.ivu-icon-ios-eye-outline:before{content:\"\\f1bc\"}.ivu-icon-ios-eye:before{content:\"\\f1bd\"}.ivu-icon-ios-fastforward-outline:before{content:\"\\f1be\"}.ivu-icon-ios-fastforward:before{content:\"\\f1bf\"}.ivu-icon-ios-female:before{content:\"\\f1c0\"}.ivu-icon-ios-filing-outline:before{content:\"\\f1c1\"}.ivu-icon-ios-filing:before{content:\"\\f1c2\"}.ivu-icon-ios-film-outline:before{content:\"\\f1c3\"}.ivu-icon-ios-film:before{content:\"\\f1c4\"}.ivu-icon-ios-finger-print:before{content:\"\\f1c5\"}.ivu-icon-ios-flag-outline:before{content:\"\\f1c6\"}.ivu-icon-ios-flag:before{content:\"\\f1c7\"}.ivu-icon-ios-flame-outline:before{content:\"\\f1c8\"}.ivu-icon-ios-flame:before{content:\"\\f1c9\"}.ivu-icon-ios-flash-outline:before{content:\"\\f1ca\"}.ivu-icon-ios-flash:before{content:\"\\f1cb\"}.ivu-icon-ios-flask-outline:before{content:\"\\f1cc\"}.ivu-icon-ios-flask:before{content:\"\\f1cd\"}.ivu-icon-ios-flower-outline:before{content:\"\\f1ce\"}.ivu-icon-ios-flower:before{content:\"\\f1cf\"}.ivu-icon-ios-folder-open-outline:before{content:\"\\f1d0\"}.ivu-icon-ios-folder-open:before{content:\"\\f1d1\"}.ivu-icon-ios-folder-outline:before{content:\"\\f1d2\"}.ivu-icon-ios-folder:before{content:\"\\f1d3\"}.ivu-icon-ios-football-outline:before{content:\"\\f1d4\"}.ivu-icon-ios-football:before{content:\"\\f1d5\"}.ivu-icon-ios-funnel-outline:before{content:\"\\f1d6\"}.ivu-icon-ios-funnel:before{content:\"\\f1d7\"}.ivu-icon-ios-game-controller-a-outline:before{content:\"\\f1d8\"}.ivu-icon-ios-game-controller-a:before{content:\"\\f1d9\"}.ivu-icon-ios-game-controller-b-outline:before{content:\"\\f1da\"}.ivu-icon-ios-game-controller-b:before{content:\"\\f1db\"}.ivu-icon-ios-git-branch:before{content:\"\\f1dc\"}.ivu-icon-ios-git-commit:before{content:\"\\f1dd\"}.ivu-icon-ios-git-compare:before{content:\"\\f1de\"}.ivu-icon-ios-git-merge:before{content:\"\\f1df\"}.ivu-icon-ios-git-network:before{content:\"\\f1e0\"}.ivu-icon-ios-git-pull-request:before{content:\"\\f1e1\"}.ivu-icon-ios-glasses-outline:before{content:\"\\f1e2\"}.ivu-icon-ios-glasses:before{content:\"\\f1e3\"}.ivu-icon-ios-globe-outline:before{content:\"\\f1e4\"}.ivu-icon-ios-globe:before{content:\"\\f1e5\"}.ivu-icon-ios-grid-outline:before{content:\"\\f1e6\"}.ivu-icon-ios-grid:before{content:\"\\f1e7\"}.ivu-icon-ios-hammer-outline:before{content:\"\\f1e8\"}.ivu-icon-ios-hammer:before{content:\"\\f1e9\"}.ivu-icon-ios-hand-outline:before{content:\"\\f1ea\"}.ivu-icon-ios-hand:before{content:\"\\f1eb\"}.ivu-icon-ios-happy-outline:before{content:\"\\f1ec\"}.ivu-icon-ios-happy:before{content:\"\\f1ed\"}.ivu-icon-ios-headset-outline:before{content:\"\\f1ee\"}.ivu-icon-ios-headset:before{content:\"\\f1ef\"}.ivu-icon-ios-heart-outline:before{content:\"\\f1f0\"}.ivu-icon-ios-heart:before{content:\"\\f1f1\"}.ivu-icon-ios-help-buoy-outline:before{content:\"\\f1f2\"}.ivu-icon-ios-help-buoy:before{content:\"\\f1f3\"}.ivu-icon-ios-help-circle-outline:before{content:\"\\f1f4\"}.ivu-icon-ios-help-circle:before{content:\"\\f1f5\"}.ivu-icon-ios-help:before{content:\"\\f1f6\"}.ivu-icon-ios-home-outline:before{content:\"\\f1f7\"}.ivu-icon-ios-home:before{content:\"\\f1f8\"}.ivu-icon-ios-ice-cream-outline:before{content:\"\\f1f9\"}.ivu-icon-ios-ice-cream:before{content:\"\\f1fa\"}.ivu-icon-ios-image-outline:before{content:\"\\f1fb\"}.ivu-icon-ios-image:before{content:\"\\f1fc\"}.ivu-icon-ios-images-outline:before{content:\"\\f1fd\"}.ivu-icon-ios-images:before{content:\"\\f1fe\"}.ivu-icon-ios-infinite-outline:before{content:\"\\f1ff\"}.ivu-icon-ios-infinite:before{content:\"\\f200\"}.ivu-icon-ios-information-circle-outline:before{content:\"\\f201\"}.ivu-icon-ios-information-circle:before{content:\"\\f202\"}.ivu-icon-ios-information:before{content:\"\\f203\"}.ivu-icon-ios-ionic-outline:before{content:\"\\f204\"}.ivu-icon-ios-ionic:before{content:\"\\f205\"}.ivu-icon-ios-ionitron-outline:before{content:\"\\f206\"}.ivu-icon-ios-ionitron:before{content:\"\\f207\"}.ivu-icon-ios-jet-outline:before{content:\"\\f208\"}.ivu-icon-ios-jet:before{content:\"\\f209\"}.ivu-icon-ios-key-outline:before{content:\"\\f20a\"}.ivu-icon-ios-key:before{content:\"\\f20b\"}.ivu-icon-ios-keypad-outline:before{content:\"\\f20c\"}.ivu-icon-ios-keypad:before{content:\"\\f20d\"}.ivu-icon-ios-laptop:before{content:\"\\f20e\"}.ivu-icon-ios-leaf-outline:before{content:\"\\f20f\"}.ivu-icon-ios-leaf:before{content:\"\\f210\"}.ivu-icon-ios-link-outline:before{content:\"\\f211\"}.ivu-icon-ios-link:before{content:\"\\f212\"}.ivu-icon-ios-list-box-outline:before{content:\"\\f213\"}.ivu-icon-ios-list-box:before{content:\"\\f214\"}.ivu-icon-ios-list:before{content:\"\\f215\"}.ivu-icon-ios-locate-outline:before{content:\"\\f216\"}.ivu-icon-ios-locate:before{content:\"\\f217\"}.ivu-icon-ios-lock-outline:before{content:\"\\f218\"}.ivu-icon-ios-lock:before{content:\"\\f219\"}.ivu-icon-ios-log-in:before{content:\"\\f21a\"}.ivu-icon-ios-log-out:before{content:\"\\f21b\"}.ivu-icon-ios-magnet-outline:before{content:\"\\f21c\"}.ivu-icon-ios-magnet:before{content:\"\\f21d\"}.ivu-icon-ios-mail-open-outline:before{content:\"\\f21e\"}.ivu-icon-ios-mail-open:before{content:\"\\f21f\"}.ivu-icon-ios-mail-outline:before{content:\"\\f220\"}.ivu-icon-ios-mail:before{content:\"\\f221\"}.ivu-icon-ios-male:before{content:\"\\f222\"}.ivu-icon-ios-man-outline:before{content:\"\\f223\"}.ivu-icon-ios-man:before{content:\"\\f224\"}.ivu-icon-ios-map-outline:before{content:\"\\f225\"}.ivu-icon-ios-map:before{content:\"\\f226\"}.ivu-icon-ios-medal-outline:before{content:\"\\f227\"}.ivu-icon-ios-medal:before{content:\"\\f228\"}.ivu-icon-ios-medical-outline:before{content:\"\\f229\"}.ivu-icon-ios-medical:before{content:\"\\f22a\"}.ivu-icon-ios-medkit-outline:before{content:\"\\f22b\"}.ivu-icon-ios-medkit:before{content:\"\\f22c\"}.ivu-icon-ios-megaphone-outline:before{content:\"\\f22d\"}.ivu-icon-ios-megaphone:before{content:\"\\f22e\"}.ivu-icon-ios-menu-outline:before{content:\"\\f22f\"}.ivu-icon-ios-menu:before{content:\"\\f230\"}.ivu-icon-ios-mic-off-outline:before{content:\"\\f231\"}.ivu-icon-ios-mic-off:before{content:\"\\f232\"}.ivu-icon-ios-mic-outline:before{content:\"\\f233\"}.ivu-icon-ios-mic:before{content:\"\\f234\"}.ivu-icon-ios-microphone-outline:before{content:\"\\f235\"}.ivu-icon-ios-microphone:before{content:\"\\f236\"}.ivu-icon-ios-moon-outline:before{content:\"\\f237\"}.ivu-icon-ios-moon:before{content:\"\\f238\"}.ivu-icon-ios-more-outline:before{content:\"\\f239\"}.ivu-icon-ios-more:before{content:\"\\f23a\"}.ivu-icon-ios-move:before{content:\"\\f23b\"}.ivu-icon-ios-musical-note-outline:before{content:\"\\f23c\"}.ivu-icon-ios-musical-note:before{content:\"\\f23d\"}.ivu-icon-ios-musical-notes-outline:before{content:\"\\f23e\"}.ivu-icon-ios-musical-notes:before{content:\"\\f23f\"}.ivu-icon-ios-navigate-outline:before{content:\"\\f240\"}.ivu-icon-ios-navigate:before{content:\"\\f241\"}.ivu-icon-ios-no-smoking-outline:before{content:\"\\f242\"}.ivu-icon-ios-no-smoking:before{content:\"\\f243\"}.ivu-icon-ios-notifications-off-outline:before{content:\"\\f244\"}.ivu-icon-ios-notifications-off:before{content:\"\\f245\"}.ivu-icon-ios-notifications-outline:before{content:\"\\f246\"}.ivu-icon-ios-notifications:before{content:\"\\f247\"}.ivu-icon-ios-nuclear-outline:before{content:\"\\f248\"}.ivu-icon-ios-nuclear:before{content:\"\\f249\"}.ivu-icon-ios-nutrition-outline:before{content:\"\\f24a\"}.ivu-icon-ios-nutrition:before{content:\"\\f24b\"}.ivu-icon-ios-open-outline:before{content:\"\\f24c\"}.ivu-icon-ios-open:before{content:\"\\f24d\"}.ivu-icon-ios-options-outline:before{content:\"\\f24e\"}.ivu-icon-ios-options:before{content:\"\\f24f\"}.ivu-icon-ios-outlet-outline:before{content:\"\\f250\"}.ivu-icon-ios-outlet:before{content:\"\\f251\"}.ivu-icon-ios-paper-outline:before{content:\"\\f252\"}.ivu-icon-ios-paper-plane-outline:before{content:\"\\f253\"}.ivu-icon-ios-paper-plane:before{content:\"\\f254\"}.ivu-icon-ios-paper:before{content:\"\\f255\"}.ivu-icon-ios-partly-sunny-outline:before{content:\"\\f256\"}.ivu-icon-ios-partly-sunny:before{content:\"\\f257\"}.ivu-icon-ios-pause-outline:before{content:\"\\f258\"}.ivu-icon-ios-pause:before{content:\"\\f259\"}.ivu-icon-ios-paw-outline:before{content:\"\\f25a\"}.ivu-icon-ios-paw:before{content:\"\\f25b\"}.ivu-icon-ios-people-outline:before{content:\"\\f25c\"}.ivu-icon-ios-people:before{content:\"\\f25d\"}.ivu-icon-ios-person-add-outline:before{content:\"\\f25e\"}.ivu-icon-ios-person-add:before{content:\"\\f25f\"}.ivu-icon-ios-person-outline:before{content:\"\\f260\"}.ivu-icon-ios-person:before{content:\"\\f261\"}.ivu-icon-ios-phone-landscape:before{content:\"\\f262\"}.ivu-icon-ios-phone-portrait:before{content:\"\\f263\"}.ivu-icon-ios-photos-outline:before{content:\"\\f264\"}.ivu-icon-ios-photos:before{content:\"\\f265\"}.ivu-icon-ios-pie-outline:before{content:\"\\f266\"}.ivu-icon-ios-pie:before{content:\"\\f267\"}.ivu-icon-ios-pin-outline:before{content:\"\\f268\"}.ivu-icon-ios-pin:before{content:\"\\f269\"}.ivu-icon-ios-pint-outline:before{content:\"\\f26a\"}.ivu-icon-ios-pint:before{content:\"\\f26b\"}.ivu-icon-ios-pizza-outline:before{content:\"\\f26c\"}.ivu-icon-ios-pizza:before{content:\"\\f26d\"}.ivu-icon-ios-plane-outline:before{content:\"\\f26e\"}.ivu-icon-ios-plane:before{content:\"\\f26f\"}.ivu-icon-ios-planet-outline:before{content:\"\\f270\"}.ivu-icon-ios-planet:before{content:\"\\f271\"}.ivu-icon-ios-play-outline:before{content:\"\\f272\"}.ivu-icon-ios-play:before{content:\"\\f273\"}.ivu-icon-ios-podium-outline:before{content:\"\\f274\"}.ivu-icon-ios-podium:before{content:\"\\f275\"}.ivu-icon-ios-power-outline:before{content:\"\\f276\"}.ivu-icon-ios-power:before{content:\"\\f277\"}.ivu-icon-ios-pricetag-outline:before{content:\"\\f278\"}.ivu-icon-ios-pricetag:before{content:\"\\f279\"}.ivu-icon-ios-pricetags-outline:before{content:\"\\f27a\"}.ivu-icon-ios-pricetags:before{content:\"\\f27b\"}.ivu-icon-ios-print-outline:before{content:\"\\f27c\"}.ivu-icon-ios-print:before{content:\"\\f27d\"}.ivu-icon-ios-pulse-outline:before{content:\"\\f27e\"}.ivu-icon-ios-pulse:before{content:\"\\f27f\"}.ivu-icon-ios-qr-scanner:before{content:\"\\f280\"}.ivu-icon-ios-quote-outline:before{content:\"\\f281\"}.ivu-icon-ios-quote:before{content:\"\\f282\"}.ivu-icon-ios-radio-button-off:before{content:\"\\f283\"}.ivu-icon-ios-radio-button-on:before{content:\"\\f284\"}.ivu-icon-ios-radio-outline:before{content:\"\\f285\"}.ivu-icon-ios-radio:before{content:\"\\f286\"}.ivu-icon-ios-rainy-outline:before{content:\"\\f287\"}.ivu-icon-ios-rainy:before{content:\"\\f288\"}.ivu-icon-ios-recording-outline:before{content:\"\\f289\"}.ivu-icon-ios-recording:before{content:\"\\f28a\"}.ivu-icon-ios-redo-outline:before{content:\"\\f28b\"}.ivu-icon-ios-redo:before{content:\"\\f28c\"}.ivu-icon-ios-refresh-circle-outline:before{content:\"\\f28d\"}.ivu-icon-ios-refresh-circle:before{content:\"\\f28e\"}.ivu-icon-ios-refresh:before{content:\"\\f28f\"}.ivu-icon-ios-remove-circle-outline:before{content:\"\\f290\"}.ivu-icon-ios-remove-circle:before{content:\"\\f291\"}.ivu-icon-ios-remove:before{content:\"\\f292\"}.ivu-icon-ios-reorder:before{content:\"\\f293\"}.ivu-icon-ios-repeat:before{content:\"\\f294\"}.ivu-icon-ios-resize:before{content:\"\\f295\"}.ivu-icon-ios-restaurant-outline:before{content:\"\\f296\"}.ivu-icon-ios-restaurant:before{content:\"\\f297\"}.ivu-icon-ios-return-left:before{content:\"\\f298\"}.ivu-icon-ios-return-right:before{content:\"\\f299\"}.ivu-icon-ios-reverse-camera-outline:before{content:\"\\f29a\"}.ivu-icon-ios-reverse-camera:before{content:\"\\f29b\"}.ivu-icon-ios-rewind-outline:before{content:\"\\f29c\"}.ivu-icon-ios-rewind:before{content:\"\\f29d\"}.ivu-icon-ios-ribbon-outline:before{content:\"\\f29e\"}.ivu-icon-ios-ribbon:before{content:\"\\f29f\"}.ivu-icon-ios-rose-outline:before{content:\"\\f2a0\"}.ivu-icon-ios-rose:before{content:\"\\f2a1\"}.ivu-icon-ios-sad-outline:before{content:\"\\f2a2\"}.ivu-icon-ios-sad:before{content:\"\\f2a3\"}.ivu-icon-ios-school-outline:before{content:\"\\f2a4\"}.ivu-icon-ios-school:before{content:\"\\f2a5\"}.ivu-icon-ios-search-outline:before{content:\"\\f2a6\"}.ivu-icon-ios-search:before{content:\"\\f2a7\"}.ivu-icon-ios-send-outline:before{content:\"\\f2a8\"}.ivu-icon-ios-send:before{content:\"\\f2a9\"}.ivu-icon-ios-settings-outline:before{content:\"\\f2aa\"}.ivu-icon-ios-settings:before{content:\"\\f2ab\"}.ivu-icon-ios-share-alt-outline:before{content:\"\\f2ac\"}.ivu-icon-ios-share-alt:before{content:\"\\f2ad\"}.ivu-icon-ios-share-outline:before{content:\"\\f2ae\"}.ivu-icon-ios-share:before{content:\"\\f2af\"}.ivu-icon-ios-shirt-outline:before{content:\"\\f2b0\"}.ivu-icon-ios-shirt:before{content:\"\\f2b1\"}.ivu-icon-ios-shuffle:before{content:\"\\f2b2\"}.ivu-icon-ios-skip-backward-outline:before{content:\"\\f2b3\"}.ivu-icon-ios-skip-backward:before{content:\"\\f2b4\"}.ivu-icon-ios-skip-forward-outline:before{content:\"\\f2b5\"}.ivu-icon-ios-skip-forward:before{content:\"\\f2b6\"}.ivu-icon-ios-snow-outline:before{content:\"\\f2b7\"}.ivu-icon-ios-snow:before{content:\"\\f2b8\"}.ivu-icon-ios-speedometer-outline:before{content:\"\\f2b9\"}.ivu-icon-ios-speedometer:before{content:\"\\f2ba\"}.ivu-icon-ios-square-outline:before{content:\"\\f2bb\"}.ivu-icon-ios-square:before{content:\"\\f2bc\"}.ivu-icon-ios-star-half:before{content:\"\\f2bd\"}.ivu-icon-ios-star-outline:before{content:\"\\f2be\"}.ivu-icon-ios-star:before{content:\"\\f2bf\"}.ivu-icon-ios-stats-outline:before{content:\"\\f2c0\"}.ivu-icon-ios-stats:before{content:\"\\f2c1\"}.ivu-icon-ios-stopwatch-outline:before{content:\"\\f2c2\"}.ivu-icon-ios-stopwatch:before{content:\"\\f2c3\"}.ivu-icon-ios-subway-outline:before{content:\"\\f2c4\"}.ivu-icon-ios-subway:before{content:\"\\f2c5\"}.ivu-icon-ios-sunny-outline:before{content:\"\\f2c6\"}.ivu-icon-ios-sunny:before{content:\"\\f2c7\"}.ivu-icon-ios-swap:before{content:\"\\f2c8\"}.ivu-icon-ios-switch-outline:before{content:\"\\f2c9\"}.ivu-icon-ios-switch:before{content:\"\\f2ca\"}.ivu-icon-ios-sync:before{content:\"\\f2cb\"}.ivu-icon-ios-tablet-landscape:before{content:\"\\f2cc\"}.ivu-icon-ios-tablet-portrait:before{content:\"\\f2cd\"}.ivu-icon-ios-tennisball-outline:before{content:\"\\f2ce\"}.ivu-icon-ios-tennisball:before{content:\"\\f2cf\"}.ivu-icon-ios-text-outline:before{content:\"\\f2d0\"}.ivu-icon-ios-text:before{content:\"\\f2d1\"}.ivu-icon-ios-thermometer-outline:before{content:\"\\f2d2\"}.ivu-icon-ios-thermometer:before{content:\"\\f2d3\"}.ivu-icon-ios-thumbs-down-outline:before{content:\"\\f2d4\"}.ivu-icon-ios-thumbs-down:before{content:\"\\f2d5\"}.ivu-icon-ios-thumbs-up-outline:before{content:\"\\f2d6\"}.ivu-icon-ios-thumbs-up:before{content:\"\\f2d7\"}.ivu-icon-ios-thunderstorm-outline:before{content:\"\\f2d8\"}.ivu-icon-ios-thunderstorm:before{content:\"\\f2d9\"}.ivu-icon-ios-time-outline:before{content:\"\\f2da\"}.ivu-icon-ios-time:before{content:\"\\f2db\"}.ivu-icon-ios-timer-outline:before{content:\"\\f2dc\"}.ivu-icon-ios-timer:before{content:\"\\f2dd\"}.ivu-icon-ios-train-outline:before{content:\"\\f2de\"}.ivu-icon-ios-train:before{content:\"\\f2df\"}.ivu-icon-ios-transgender:before{content:\"\\f2e0\"}.ivu-icon-ios-trash-outline:before{content:\"\\f2e1\"}.ivu-icon-ios-trash:before{content:\"\\f2e2\"}.ivu-icon-ios-trending-down:before{content:\"\\f2e3\"}.ivu-icon-ios-trending-up:before{content:\"\\f2e4\"}.ivu-icon-ios-trophy-outline:before{content:\"\\f2e5\"}.ivu-icon-ios-trophy:before{content:\"\\f2e6\"}.ivu-icon-ios-umbrella-outline:before{content:\"\\f2e7\"}.ivu-icon-ios-umbrella:before{content:\"\\f2e8\"}.ivu-icon-ios-undo-outline:before{content:\"\\f2e9\"}.ivu-icon-ios-undo:before{content:\"\\f2ea\"}.ivu-icon-ios-unlock-outline:before{content:\"\\f2eb\"}.ivu-icon-ios-unlock:before{content:\"\\f2ec\"}.ivu-icon-ios-videocam-outline:before{content:\"\\f2ed\"}.ivu-icon-ios-videocam:before{content:\"\\f2ee\"}.ivu-icon-ios-volume-down:before{content:\"\\f2ef\"}.ivu-icon-ios-volume-mute:before{content:\"\\f2f0\"}.ivu-icon-ios-volume-off:before{content:\"\\f2f1\"}.ivu-icon-ios-volume-up:before{content:\"\\f2f2\"}.ivu-icon-ios-walk:before{content:\"\\f2f3\"}.ivu-icon-ios-warning-outline:before{content:\"\\f2f4\"}.ivu-icon-ios-warning:before{content:\"\\f2f5\"}.ivu-icon-ios-watch:before{content:\"\\f2f6\"}.ivu-icon-ios-water-outline:before{content:\"\\f2f7\"}.ivu-icon-ios-water:before{content:\"\\f2f8\"}.ivu-icon-ios-wifi-outline:before{content:\"\\f2f9\"}.ivu-icon-ios-wifi:before{content:\"\\f2fa\"}.ivu-icon-ios-wine-outline:before{content:\"\\f2fb\"}.ivu-icon-ios-wine:before{content:\"\\f2fc\"}.ivu-icon-ios-woman-outline:before{content:\"\\f2fd\"}.ivu-icon-ios-woman:before{content:\"\\f2fe\"}.ivu-icon-logo-android:before{content:\"\\f2ff\"}.ivu-icon-logo-angular:before{content:\"\\f300\"}.ivu-icon-logo-apple:before{content:\"\\f301\"}.ivu-icon-logo-bitcoin:before{content:\"\\f302\"}.ivu-icon-logo-buffer:before{content:\"\\f303\"}.ivu-icon-logo-chrome:before{content:\"\\f304\"}.ivu-icon-logo-codepen:before{content:\"\\f305\"}.ivu-icon-logo-css3:before{content:\"\\f306\"}.ivu-icon-logo-designernews:before{content:\"\\f307\"}.ivu-icon-logo-dribbble:before{content:\"\\f308\"}.ivu-icon-logo-dropbox:before{content:\"\\f309\"}.ivu-icon-logo-euro:before{content:\"\\f30a\"}.ivu-icon-logo-facebook:before{content:\"\\f30b\"}.ivu-icon-logo-foursquare:before{content:\"\\f30c\"}.ivu-icon-logo-freebsd-devil:before{content:\"\\f30d\"}.ivu-icon-logo-github:before{content:\"\\f30e\"}.ivu-icon-logo-google:before{content:\"\\f30f\"}.ivu-icon-logo-googleplus:before{content:\"\\f310\"}.ivu-icon-logo-hackernews:before{content:\"\\f311\"}.ivu-icon-logo-html5:before{content:\"\\f312\"}.ivu-icon-logo-instagram:before{content:\"\\f313\"}.ivu-icon-logo-javascript:before{content:\"\\f314\"}.ivu-icon-logo-linkedin:before{content:\"\\f315\"}.ivu-icon-logo-markdown:before{content:\"\\f316\"}.ivu-icon-logo-nodejs:before{content:\"\\f317\"}.ivu-icon-logo-octocat:before{content:\"\\f318\"}.ivu-icon-logo-pinterest:before{content:\"\\f319\"}.ivu-icon-logo-playstation:before{content:\"\\f31a\"}.ivu-icon-logo-python:before{content:\"\\f31b\"}.ivu-icon-logo-reddit:before{content:\"\\f31c\"}.ivu-icon-logo-rss:before{content:\"\\f31d\"}.ivu-icon-logo-sass:before{content:\"\\f31e\"}.ivu-icon-logo-skype:before{content:\"\\f31f\"}.ivu-icon-logo-snapchat:before{content:\"\\f320\"}.ivu-icon-logo-steam:before{content:\"\\f321\"}.ivu-icon-logo-tumblr:before{content:\"\\f322\"}.ivu-icon-logo-tux:before{content:\"\\f323\"}.ivu-icon-logo-twitch:before{content:\"\\f324\"}.ivu-icon-logo-twitter:before{content:\"\\f325\"}.ivu-icon-logo-usd:before{content:\"\\f326\"}.ivu-icon-logo-vimeo:before{content:\"\\f327\"}.ivu-icon-logo-whatsapp:before{content:\"\\f328\"}.ivu-icon-logo-windows:before{content:\"\\f329\"}.ivu-icon-logo-wordpress:before{content:\"\\f32a\"}.ivu-icon-logo-xbox:before{content:\"\\f32b\"}.ivu-icon-logo-yahoo:before{content:\"\\f32c\"}.ivu-icon-logo-yen:before{content:\"\\f32d\"}.ivu-icon-logo-youtube:before{content:\"\\f32e\"}.ivu-icon-md-add-circle:before{content:\"\\f32f\"}.ivu-icon-md-add:before{content:\"\\f330\"}.ivu-icon-md-alarm:before{content:\"\\f331\"}.ivu-icon-md-albums:before{content:\"\\f332\"}.ivu-icon-md-alert:before{content:\"\\f333\"}.ivu-icon-md-american-football:before{content:\"\\f334\"}.ivu-icon-md-analytics:before{content:\"\\f335\"}.ivu-icon-md-aperture:before{content:\"\\f336\"}.ivu-icon-md-apps:before{content:\"\\f337\"}.ivu-icon-md-appstore:before{content:\"\\f338\"}.ivu-icon-md-archive:before{content:\"\\f339\"}.ivu-icon-md-arrow-back:before{content:\"\\f33a\"}.ivu-icon-md-arrow-down:before{content:\"\\f33b\"}.ivu-icon-md-arrow-dropdown-circle:before{content:\"\\f33c\"}.ivu-icon-md-arrow-dropdown:before{content:\"\\f33d\"}.ivu-icon-md-arrow-dropleft-circle:before{content:\"\\f33e\"}.ivu-icon-md-arrow-dropleft:before{content:\"\\f33f\"}.ivu-icon-md-arrow-dropright-circle:before{content:\"\\f340\"}.ivu-icon-md-arrow-dropright:before{content:\"\\f341\"}.ivu-icon-md-arrow-dropup-circle:before{content:\"\\f342\"}.ivu-icon-md-arrow-dropup:before{content:\"\\f343\"}.ivu-icon-md-arrow-forward:before{content:\"\\f344\"}.ivu-icon-md-arrow-round-back:before{content:\"\\f345\"}.ivu-icon-md-arrow-round-down:before{content:\"\\f346\"}.ivu-icon-md-arrow-round-forward:before{content:\"\\f347\"}.ivu-icon-md-arrow-round-up:before{content:\"\\f348\"}.ivu-icon-md-arrow-up:before{content:\"\\f349\"}.ivu-icon-md-at:before{content:\"\\f34a\"}.ivu-icon-md-attach:before{content:\"\\f34b\"}.ivu-icon-md-backspace:before{content:\"\\f34c\"}.ivu-icon-md-barcode:before{content:\"\\f34d\"}.ivu-icon-md-baseball:before{content:\"\\f34e\"}.ivu-icon-md-basket:before{content:\"\\f34f\"}.ivu-icon-md-basketball:before{content:\"\\f350\"}.ivu-icon-md-battery-charging:before{content:\"\\f351\"}.ivu-icon-md-battery-dead:before{content:\"\\f352\"}.ivu-icon-md-battery-full:before{content:\"\\f353\"}.ivu-icon-md-beaker:before{content:\"\\f354\"}.ivu-icon-md-beer:before{content:\"\\f355\"}.ivu-icon-md-bicycle:before{content:\"\\f356\"}.ivu-icon-md-bluetooth:before{content:\"\\f357\"}.ivu-icon-md-boat:before{content:\"\\f358\"}.ivu-icon-md-body:before{content:\"\\f359\"}.ivu-icon-md-bonfire:before{content:\"\\f35a\"}.ivu-icon-md-book:before{content:\"\\f35b\"}.ivu-icon-md-bookmark:before{content:\"\\f35c\"}.ivu-icon-md-bookmarks:before{content:\"\\f35d\"}.ivu-icon-md-bowtie:before{content:\"\\f35e\"}.ivu-icon-md-briefcase:before{content:\"\\f35f\"}.ivu-icon-md-browsers:before{content:\"\\f360\"}.ivu-icon-md-brush:before{content:\"\\f361\"}.ivu-icon-md-bug:before{content:\"\\f362\"}.ivu-icon-md-build:before{content:\"\\f363\"}.ivu-icon-md-bulb:before{content:\"\\f364\"}.ivu-icon-md-bus:before{content:\"\\f365\"}.ivu-icon-md-cafe:before{content:\"\\f366\"}.ivu-icon-md-calculator:before{content:\"\\f367\"}.ivu-icon-md-calendar:before{content:\"\\f368\"}.ivu-icon-md-call:before{content:\"\\f369\"}.ivu-icon-md-camera:before{content:\"\\f36a\"}.ivu-icon-md-car:before{content:\"\\f36b\"}.ivu-icon-md-card:before{content:\"\\f36c\"}.ivu-icon-md-cart:before{content:\"\\f36d\"}.ivu-icon-md-cash:before{content:\"\\f36e\"}.ivu-icon-md-chatboxes:before{content:\"\\f36f\"}.ivu-icon-md-chatbubbles:before{content:\"\\f370\"}.ivu-icon-md-checkbox-outline:before{content:\"\\f371\"}.ivu-icon-md-checkbox:before{content:\"\\f372\"}.ivu-icon-md-checkmark-circle-outline:before{content:\"\\f373\"}.ivu-icon-md-checkmark-circle:before{content:\"\\f374\"}.ivu-icon-md-checkmark:before{content:\"\\f375\"}.ivu-icon-md-clipboard:before{content:\"\\f376\"}.ivu-icon-md-clock:before{content:\"\\f377\"}.ivu-icon-md-close-circle:before{content:\"\\f378\"}.ivu-icon-md-close:before{content:\"\\f379\"}.ivu-icon-md-closed-captioning:before{content:\"\\f37a\"}.ivu-icon-md-cloud-circle:before{content:\"\\f37b\"}.ivu-icon-md-cloud-done:before{content:\"\\f37c\"}.ivu-icon-md-cloud-download:before{content:\"\\f37d\"}.ivu-icon-md-cloud-outline:before{content:\"\\f37e\"}.ivu-icon-md-cloud-upload:before{content:\"\\f37f\"}.ivu-icon-md-cloud:before{content:\"\\f380\"}.ivu-icon-md-cloudy-night:before{content:\"\\f381\"}.ivu-icon-md-cloudy:before{content:\"\\f382\"}.ivu-icon-md-code-download:before{content:\"\\f383\"}.ivu-icon-md-code-working:before{content:\"\\f384\"}.ivu-icon-md-code:before{content:\"\\f385\"}.ivu-icon-md-cog:before{content:\"\\f386\"}.ivu-icon-md-color-fill:before{content:\"\\f387\"}.ivu-icon-md-color-filter:before{content:\"\\f388\"}.ivu-icon-md-color-palette:before{content:\"\\f389\"}.ivu-icon-md-color-wand:before{content:\"\\f38a\"}.ivu-icon-md-compass:before{content:\"\\f38b\"}.ivu-icon-md-construct:before{content:\"\\f38c\"}.ivu-icon-md-contact:before{content:\"\\f38d\"}.ivu-icon-md-contacts:before{content:\"\\f38e\"}.ivu-icon-md-contract:before{content:\"\\f38f\"}.ivu-icon-md-contrast:before{content:\"\\f390\"}.ivu-icon-md-copy:before{content:\"\\f391\"}.ivu-icon-md-create:before{content:\"\\f392\"}.ivu-icon-md-crop:before{content:\"\\f393\"}.ivu-icon-md-cube:before{content:\"\\f394\"}.ivu-icon-md-cut:before{content:\"\\f395\"}.ivu-icon-md-desktop:before{content:\"\\f396\"}.ivu-icon-md-disc:before{content:\"\\f397\"}.ivu-icon-md-document:before{content:\"\\f398\"}.ivu-icon-md-done-all:before{content:\"\\f399\"}.ivu-icon-md-download:before{content:\"\\f39a\"}.ivu-icon-md-easel:before{content:\"\\f39b\"}.ivu-icon-md-egg:before{content:\"\\f39c\"}.ivu-icon-md-exit:before{content:\"\\f39d\"}.ivu-icon-md-expand:before{content:\"\\f39e\"}.ivu-icon-md-eye-off:before{content:\"\\f39f\"}.ivu-icon-md-eye:before{content:\"\\f3a0\"}.ivu-icon-md-fastforward:before{content:\"\\f3a1\"}.ivu-icon-md-female:before{content:\"\\f3a2\"}.ivu-icon-md-filing:before{content:\"\\f3a3\"}.ivu-icon-md-film:before{content:\"\\f3a4\"}.ivu-icon-md-finger-print:before{content:\"\\f3a5\"}.ivu-icon-md-flag:before{content:\"\\f3a6\"}.ivu-icon-md-flame:before{content:\"\\f3a7\"}.ivu-icon-md-flash:before{content:\"\\f3a8\"}.ivu-icon-md-flask:before{content:\"\\f3a9\"}.ivu-icon-md-flower:before{content:\"\\f3aa\"}.ivu-icon-md-folder-open:before{content:\"\\f3ab\"}.ivu-icon-md-folder:before{content:\"\\f3ac\"}.ivu-icon-md-football:before{content:\"\\f3ad\"}.ivu-icon-md-funnel:before{content:\"\\f3ae\"}.ivu-icon-md-game-controller-a:before{content:\"\\f3af\"}.ivu-icon-md-game-controller-b:before{content:\"\\f3b0\"}.ivu-icon-md-git-branch:before{content:\"\\f3b1\"}.ivu-icon-md-git-commit:before{content:\"\\f3b2\"}.ivu-icon-md-git-compare:before{content:\"\\f3b3\"}.ivu-icon-md-git-merge:before{content:\"\\f3b4\"}.ivu-icon-md-git-network:before{content:\"\\f3b5\"}.ivu-icon-md-git-pull-request:before{content:\"\\f3b6\"}.ivu-icon-md-glasses:before{content:\"\\f3b7\"}.ivu-icon-md-globe:before{content:\"\\f3b8\"}.ivu-icon-md-grid:before{content:\"\\f3b9\"}.ivu-icon-md-hammer:before{content:\"\\f3ba\"}.ivu-icon-md-hand:before{content:\"\\f3bb\"}.ivu-icon-md-happy:before{content:\"\\f3bc\"}.ivu-icon-md-headset:before{content:\"\\f3bd\"}.ivu-icon-md-heart-outline:before{content:\"\\f3be\"}.ivu-icon-md-heart:before{content:\"\\f3bf\"}.ivu-icon-md-help-buoy:before{content:\"\\f3c0\"}.ivu-icon-md-help-circle:before{content:\"\\f3c1\"}.ivu-icon-md-help:before{content:\"\\f3c2\"}.ivu-icon-md-home:before{content:\"\\f3c3\"}.ivu-icon-md-ice-cream:before{content:\"\\f3c4\"}.ivu-icon-md-image:before{content:\"\\f3c5\"}.ivu-icon-md-images:before{content:\"\\f3c6\"}.ivu-icon-md-infinite:before{content:\"\\f3c7\"}.ivu-icon-md-information-circle:before{content:\"\\f3c8\"}.ivu-icon-md-information:before{content:\"\\f3c9\"}.ivu-icon-md-ionic:before{content:\"\\f3ca\"}.ivu-icon-md-ionitron:before{content:\"\\f3cb\"}.ivu-icon-md-jet:before{content:\"\\f3cc\"}.ivu-icon-md-key:before{content:\"\\f3cd\"}.ivu-icon-md-keypad:before{content:\"\\f3ce\"}.ivu-icon-md-laptop:before{content:\"\\f3cf\"}.ivu-icon-md-leaf:before{content:\"\\f3d0\"}.ivu-icon-md-link:before{content:\"\\f3d1\"}.ivu-icon-md-list-box:before{content:\"\\f3d2\"}.ivu-icon-md-list:before{content:\"\\f3d3\"}.ivu-icon-md-locate:before{content:\"\\f3d4\"}.ivu-icon-md-lock:before{content:\"\\f3d5\"}.ivu-icon-md-log-in:before{content:\"\\f3d6\"}.ivu-icon-md-log-out:before{content:\"\\f3d7\"}.ivu-icon-md-magnet:before{content:\"\\f3d8\"}.ivu-icon-md-mail-open:before{content:\"\\f3d9\"}.ivu-icon-md-mail:before{content:\"\\f3da\"}.ivu-icon-md-male:before{content:\"\\f3db\"}.ivu-icon-md-man:before{content:\"\\f3dc\"}.ivu-icon-md-map:before{content:\"\\f3dd\"}.ivu-icon-md-medal:before{content:\"\\f3de\"}.ivu-icon-md-medical:before{content:\"\\f3df\"}.ivu-icon-md-medkit:before{content:\"\\f3e0\"}.ivu-icon-md-megaphone:before{content:\"\\f3e1\"}.ivu-icon-md-menu:before{content:\"\\f3e2\"}.ivu-icon-md-mic-off:before{content:\"\\f3e3\"}.ivu-icon-md-mic:before{content:\"\\f3e4\"}.ivu-icon-md-microphone:before{content:\"\\f3e5\"}.ivu-icon-md-moon:before{content:\"\\f3e6\"}.ivu-icon-md-more:before{content:\"\\f3e7\"}.ivu-icon-md-move:before{content:\"\\f3e8\"}.ivu-icon-md-musical-note:before{content:\"\\f3e9\"}.ivu-icon-md-musical-notes:before{content:\"\\f3ea\"}.ivu-icon-md-navigate:before{content:\"\\f3eb\"}.ivu-icon-md-no-smoking:before{content:\"\\f3ec\"}.ivu-icon-md-notifications-off:before{content:\"\\f3ed\"}.ivu-icon-md-notifications-outline:before{content:\"\\f3ee\"}.ivu-icon-md-notifications:before{content:\"\\f3ef\"}.ivu-icon-md-nuclear:before{content:\"\\f3f0\"}.ivu-icon-md-nutrition:before{content:\"\\f3f1\"}.ivu-icon-md-open:before{content:\"\\f3f2\"}.ivu-icon-md-options:before{content:\"\\f3f3\"}.ivu-icon-md-outlet:before{content:\"\\f3f4\"}.ivu-icon-md-paper-plane:before{content:\"\\f3f5\"}.ivu-icon-md-paper:before{content:\"\\f3f6\"}.ivu-icon-md-partly-sunny:before{content:\"\\f3f7\"}.ivu-icon-md-pause:before{content:\"\\f3f8\"}.ivu-icon-md-paw:before{content:\"\\f3f9\"}.ivu-icon-md-people:before{content:\"\\f3fa\"}.ivu-icon-md-person-add:before{content:\"\\f3fb\"}.ivu-icon-md-person:before{content:\"\\f3fc\"}.ivu-icon-md-phone-landscape:before{content:\"\\f3fd\"}.ivu-icon-md-phone-portrait:before{content:\"\\f3fe\"}.ivu-icon-md-photos:before{content:\"\\f3ff\"}.ivu-icon-md-pie:before{content:\"\\f400\"}.ivu-icon-md-pin:before{content:\"\\f401\"}.ivu-icon-md-pint:before{content:\"\\f402\"}.ivu-icon-md-pizza:before{content:\"\\f403\"}.ivu-icon-md-plane:before{content:\"\\f404\"}.ivu-icon-md-planet:before{content:\"\\f405\"}.ivu-icon-md-play:before{content:\"\\f406\"}.ivu-icon-md-podium:before{content:\"\\f407\"}.ivu-icon-md-power:before{content:\"\\f408\"}.ivu-icon-md-pricetag:before{content:\"\\f409\"}.ivu-icon-md-pricetags:before{content:\"\\f40a\"}.ivu-icon-md-print:before{content:\"\\f40b\"}.ivu-icon-md-pulse:before{content:\"\\f40c\"}.ivu-icon-md-qr-scanner:before{content:\"\\f40d\"}.ivu-icon-md-quote:before{content:\"\\f40e\"}.ivu-icon-md-radio-button-off:before{content:\"\\f40f\"}.ivu-icon-md-radio-button-on:before{content:\"\\f410\"}.ivu-icon-md-radio:before{content:\"\\f411\"}.ivu-icon-md-rainy:before{content:\"\\f412\"}.ivu-icon-md-recording:before{content:\"\\f413\"}.ivu-icon-md-redo:before{content:\"\\f414\"}.ivu-icon-md-refresh-circle:before{content:\"\\f415\"}.ivu-icon-md-refresh:before{content:\"\\f416\"}.ivu-icon-md-remove-circle:before{content:\"\\f417\"}.ivu-icon-md-remove:before{content:\"\\f418\"}.ivu-icon-md-reorder:before{content:\"\\f419\"}.ivu-icon-md-repeat:before{content:\"\\f41a\"}.ivu-icon-md-resize:before{content:\"\\f41b\"}.ivu-icon-md-restaurant:before{content:\"\\f41c\"}.ivu-icon-md-return-left:before{content:\"\\f41d\"}.ivu-icon-md-return-right:before{content:\"\\f41e\"}.ivu-icon-md-reverse-camera:before{content:\"\\f41f\"}.ivu-icon-md-rewind:before{content:\"\\f420\"}.ivu-icon-md-ribbon:before{content:\"\\f421\"}.ivu-icon-md-rose:before{content:\"\\f422\"}.ivu-icon-md-sad:before{content:\"\\f423\"}.ivu-icon-md-school:before{content:\"\\f424\"}.ivu-icon-md-search:before{content:\"\\f425\"}.ivu-icon-md-send:before{content:\"\\f426\"}.ivu-icon-md-settings:before{content:\"\\f427\"}.ivu-icon-md-share-alt:before{content:\"\\f428\"}.ivu-icon-md-share:before{content:\"\\f429\"}.ivu-icon-md-shirt:before{content:\"\\f42a\"}.ivu-icon-md-shuffle:before{content:\"\\f42b\"}.ivu-icon-md-skip-backward:before{content:\"\\f42c\"}.ivu-icon-md-skip-forward:before{content:\"\\f42d\"}.ivu-icon-md-snow:before{content:\"\\f42e\"}.ivu-icon-md-speedometer:before{content:\"\\f42f\"}.ivu-icon-md-square-outline:before{content:\"\\f430\"}.ivu-icon-md-square:before{content:\"\\f431\"}.ivu-icon-md-star-half:before{content:\"\\f432\"}.ivu-icon-md-star-outline:before{content:\"\\f433\"}.ivu-icon-md-star:before{content:\"\\f434\"}.ivu-icon-md-stats:before{content:\"\\f435\"}.ivu-icon-md-stopwatch:before{content:\"\\f436\"}.ivu-icon-md-subway:before{content:\"\\f437\"}.ivu-icon-md-sunny:before{content:\"\\f438\"}.ivu-icon-md-swap:before{content:\"\\f439\"}.ivu-icon-md-switch:before{content:\"\\f43a\"}.ivu-icon-md-sync:before{content:\"\\f43b\"}.ivu-icon-md-tablet-landscape:before{content:\"\\f43c\"}.ivu-icon-md-tablet-portrait:before{content:\"\\f43d\"}.ivu-icon-md-tennisball:before{content:\"\\f43e\"}.ivu-icon-md-text:before{content:\"\\f43f\"}.ivu-icon-md-thermometer:before{content:\"\\f440\"}.ivu-icon-md-thumbs-down:before{content:\"\\f441\"}.ivu-icon-md-thumbs-up:before{content:\"\\f442\"}.ivu-icon-md-thunderstorm:before{content:\"\\f443\"}.ivu-icon-md-time:before{content:\"\\f444\"}.ivu-icon-md-timer:before{content:\"\\f445\"}.ivu-icon-md-train:before{content:\"\\f446\"}.ivu-icon-md-transgender:before{content:\"\\f447\"}.ivu-icon-md-trash:before{content:\"\\f448\"}.ivu-icon-md-trending-down:before{content:\"\\f449\"}.ivu-icon-md-trending-up:before{content:\"\\f44a\"}.ivu-icon-md-trophy:before{content:\"\\f44b\"}.ivu-icon-md-umbrella:before{content:\"\\f44c\"}.ivu-icon-md-undo:before{content:\"\\f44d\"}.ivu-icon-md-unlock:before{content:\"\\f44e\"}.ivu-icon-md-videocam:before{content:\"\\f44f\"}.ivu-icon-md-volume-down:before{content:\"\\f450\"}.ivu-icon-md-volume-mute:before{content:\"\\f451\"}.ivu-icon-md-volume-off:before{content:\"\\f452\"}.ivu-icon-md-volume-up:before{content:\"\\f453\"}.ivu-icon-md-walk:before{content:\"\\f454\"}.ivu-icon-md-warning:before{content:\"\\f455\"}.ivu-icon-md-watch:before{content:\"\\f456\"}.ivu-icon-md-water:before{content:\"\\f457\"}.ivu-icon-md-wifi:before{content:\"\\f458\"}.ivu-icon-md-wine:before{content:\"\\f459\"}.ivu-icon-md-woman:before{content:\"\\f45a\"}.ivu-icon-ios-loading:before{content:\"\\f45b\"}.ivu-row{position:relative;margin-left:0;margin-right:0;height:auto;zoom:1;display:block}.ivu-row:after,.ivu-row:before{content:\"\";display:table}.ivu-row:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-row-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.ivu-row-flex:after,.ivu-row-flex:before{display:-webkit-box;display:-ms-flexbox;display:flex}.ivu-row-flex-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.ivu-row-flex-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ivu-row-flex-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.ivu-row-flex-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.ivu-row-flex-space-around{-ms-flex-pack:distribute;justify-content:space-around}.ivu-row-flex-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.ivu-row-flex-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-row-flex-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.ivu-col{position:relative;display:block}.ivu-col-span-1,.ivu-col-span-10,.ivu-col-span-11,.ivu-col-span-12,.ivu-col-span-13,.ivu-col-span-14,.ivu-col-span-15,.ivu-col-span-16,.ivu-col-span-17,.ivu-col-span-18,.ivu-col-span-19,.ivu-col-span-2,.ivu-col-span-20,.ivu-col-span-21,.ivu-col-span-22,.ivu-col-span-23,.ivu-col-span-24,.ivu-col-span-3,.ivu-col-span-4,.ivu-col-span-5,.ivu-col-span-6,.ivu-col-span-7,.ivu-col-span-8,.ivu-col-span-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-24{display:block;width:100%}.ivu-col-push-24{left:100%}.ivu-col-pull-24{right:100%}.ivu-col-offset-24{margin-left:100%}.ivu-col-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-23{display:block;width:95.83333333%}.ivu-col-push-23{left:95.83333333%}.ivu-col-pull-23{right:95.83333333%}.ivu-col-offset-23{margin-left:95.83333333%}.ivu-col-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-22{display:block;width:91.66666667%}.ivu-col-push-22{left:91.66666667%}.ivu-col-pull-22{right:91.66666667%}.ivu-col-offset-22{margin-left:91.66666667%}.ivu-col-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-21{display:block;width:87.5%}.ivu-col-push-21{left:87.5%}.ivu-col-pull-21{right:87.5%}.ivu-col-offset-21{margin-left:87.5%}.ivu-col-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-20{display:block;width:83.33333333%}.ivu-col-push-20{left:83.33333333%}.ivu-col-pull-20{right:83.33333333%}.ivu-col-offset-20{margin-left:83.33333333%}.ivu-col-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-19{display:block;width:79.16666667%}.ivu-col-push-19{left:79.16666667%}.ivu-col-pull-19{right:79.16666667%}.ivu-col-offset-19{margin-left:79.16666667%}.ivu-col-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-18{display:block;width:75%}.ivu-col-push-18{left:75%}.ivu-col-pull-18{right:75%}.ivu-col-offset-18{margin-left:75%}.ivu-col-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-17{display:block;width:70.83333333%}.ivu-col-push-17{left:70.83333333%}.ivu-col-pull-17{right:70.83333333%}.ivu-col-offset-17{margin-left:70.83333333%}.ivu-col-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-16{display:block;width:66.66666667%}.ivu-col-push-16{left:66.66666667%}.ivu-col-pull-16{right:66.66666667%}.ivu-col-offset-16{margin-left:66.66666667%}.ivu-col-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-15{display:block;width:62.5%}.ivu-col-push-15{left:62.5%}.ivu-col-pull-15{right:62.5%}.ivu-col-offset-15{margin-left:62.5%}.ivu-col-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-14{display:block;width:58.33333333%}.ivu-col-push-14{left:58.33333333%}.ivu-col-pull-14{right:58.33333333%}.ivu-col-offset-14{margin-left:58.33333333%}.ivu-col-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-13{display:block;width:54.16666667%}.ivu-col-push-13{left:54.16666667%}.ivu-col-pull-13{right:54.16666667%}.ivu-col-offset-13{margin-left:54.16666667%}.ivu-col-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-12{display:block;width:50%}.ivu-col-push-12{left:50%}.ivu-col-pull-12{right:50%}.ivu-col-offset-12{margin-left:50%}.ivu-col-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-11{display:block;width:45.83333333%}.ivu-col-push-11{left:45.83333333%}.ivu-col-pull-11{right:45.83333333%}.ivu-col-offset-11{margin-left:45.83333333%}.ivu-col-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-10{display:block;width:41.66666667%}.ivu-col-push-10{left:41.66666667%}.ivu-col-pull-10{right:41.66666667%}.ivu-col-offset-10{margin-left:41.66666667%}.ivu-col-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-9{display:block;width:37.5%}.ivu-col-push-9{left:37.5%}.ivu-col-pull-9{right:37.5%}.ivu-col-offset-9{margin-left:37.5%}.ivu-col-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-8{display:block;width:33.33333333%}.ivu-col-push-8{left:33.33333333%}.ivu-col-pull-8{right:33.33333333%}.ivu-col-offset-8{margin-left:33.33333333%}.ivu-col-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-7{display:block;width:29.16666667%}.ivu-col-push-7{left:29.16666667%}.ivu-col-pull-7{right:29.16666667%}.ivu-col-offset-7{margin-left:29.16666667%}.ivu-col-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-6{display:block;width:25%}.ivu-col-push-6{left:25%}.ivu-col-pull-6{right:25%}.ivu-col-offset-6{margin-left:25%}.ivu-col-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-5{display:block;width:20.83333333%}.ivu-col-push-5{left:20.83333333%}.ivu-col-pull-5{right:20.83333333%}.ivu-col-offset-5{margin-left:20.83333333%}.ivu-col-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-4{display:block;width:16.66666667%}.ivu-col-push-4{left:16.66666667%}.ivu-col-pull-4{right:16.66666667%}.ivu-col-offset-4{margin-left:16.66666667%}.ivu-col-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-3{display:block;width:12.5%}.ivu-col-push-3{left:12.5%}.ivu-col-pull-3{right:12.5%}.ivu-col-offset-3{margin-left:12.5%}.ivu-col-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-2{display:block;width:8.33333333%}.ivu-col-push-2{left:8.33333333%}.ivu-col-pull-2{right:8.33333333%}.ivu-col-offset-2{margin-left:8.33333333%}.ivu-col-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-1{display:block;width:4.16666667%}.ivu-col-push-1{left:4.16666667%}.ivu-col-pull-1{right:4.16666667%}.ivu-col-offset-1{margin-left:4.16666667%}.ivu-col-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-0{display:none}.ivu-col-push-0{left:auto}.ivu-col-pull-0{right:auto}.ivu-col-offset-0{margin-left:0}.ivu-col-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.ivu-col-span-xs-1,.ivu-col-span-xs-10,.ivu-col-span-xs-11,.ivu-col-span-xs-12,.ivu-col-span-xs-13,.ivu-col-span-xs-14,.ivu-col-span-xs-15,.ivu-col-span-xs-16,.ivu-col-span-xs-17,.ivu-col-span-xs-18,.ivu-col-span-xs-19,.ivu-col-span-xs-2,.ivu-col-span-xs-20,.ivu-col-span-xs-21,.ivu-col-span-xs-22,.ivu-col-span-xs-23,.ivu-col-span-xs-24,.ivu-col-span-xs-3,.ivu-col-span-xs-4,.ivu-col-span-xs-5,.ivu-col-span-xs-6,.ivu-col-span-xs-7,.ivu-col-span-xs-8,.ivu-col-span-xs-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xs-24{display:block;width:100%}.ivu-col-xs-push-24{left:100%}.ivu-col-xs-pull-24{right:100%}.ivu-col-xs-offset-24{margin-left:100%}.ivu-col-xs-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xs-23{display:block;width:95.83333333%}.ivu-col-xs-push-23{left:95.83333333%}.ivu-col-xs-pull-23{right:95.83333333%}.ivu-col-xs-offset-23{margin-left:95.83333333%}.ivu-col-xs-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xs-22{display:block;width:91.66666667%}.ivu-col-xs-push-22{left:91.66666667%}.ivu-col-xs-pull-22{right:91.66666667%}.ivu-col-xs-offset-22{margin-left:91.66666667%}.ivu-col-xs-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xs-21{display:block;width:87.5%}.ivu-col-xs-push-21{left:87.5%}.ivu-col-xs-pull-21{right:87.5%}.ivu-col-xs-offset-21{margin-left:87.5%}.ivu-col-xs-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xs-20{display:block;width:83.33333333%}.ivu-col-xs-push-20{left:83.33333333%}.ivu-col-xs-pull-20{right:83.33333333%}.ivu-col-xs-offset-20{margin-left:83.33333333%}.ivu-col-xs-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xs-19{display:block;width:79.16666667%}.ivu-col-xs-push-19{left:79.16666667%}.ivu-col-xs-pull-19{right:79.16666667%}.ivu-col-xs-offset-19{margin-left:79.16666667%}.ivu-col-xs-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xs-18{display:block;width:75%}.ivu-col-xs-push-18{left:75%}.ivu-col-xs-pull-18{right:75%}.ivu-col-xs-offset-18{margin-left:75%}.ivu-col-xs-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xs-17{display:block;width:70.83333333%}.ivu-col-xs-push-17{left:70.83333333%}.ivu-col-xs-pull-17{right:70.83333333%}.ivu-col-xs-offset-17{margin-left:70.83333333%}.ivu-col-xs-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xs-16{display:block;width:66.66666667%}.ivu-col-xs-push-16{left:66.66666667%}.ivu-col-xs-pull-16{right:66.66666667%}.ivu-col-xs-offset-16{margin-left:66.66666667%}.ivu-col-xs-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xs-15{display:block;width:62.5%}.ivu-col-xs-push-15{left:62.5%}.ivu-col-xs-pull-15{right:62.5%}.ivu-col-xs-offset-15{margin-left:62.5%}.ivu-col-xs-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xs-14{display:block;width:58.33333333%}.ivu-col-xs-push-14{left:58.33333333%}.ivu-col-xs-pull-14{right:58.33333333%}.ivu-col-xs-offset-14{margin-left:58.33333333%}.ivu-col-xs-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xs-13{display:block;width:54.16666667%}.ivu-col-xs-push-13{left:54.16666667%}.ivu-col-xs-pull-13{right:54.16666667%}.ivu-col-xs-offset-13{margin-left:54.16666667%}.ivu-col-xs-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xs-12{display:block;width:50%}.ivu-col-xs-push-12{left:50%}.ivu-col-xs-pull-12{right:50%}.ivu-col-xs-offset-12{margin-left:50%}.ivu-col-xs-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xs-11{display:block;width:45.83333333%}.ivu-col-xs-push-11{left:45.83333333%}.ivu-col-xs-pull-11{right:45.83333333%}.ivu-col-xs-offset-11{margin-left:45.83333333%}.ivu-col-xs-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xs-10{display:block;width:41.66666667%}.ivu-col-xs-push-10{left:41.66666667%}.ivu-col-xs-pull-10{right:41.66666667%}.ivu-col-xs-offset-10{margin-left:41.66666667%}.ivu-col-xs-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xs-9{display:block;width:37.5%}.ivu-col-xs-push-9{left:37.5%}.ivu-col-xs-pull-9{right:37.5%}.ivu-col-xs-offset-9{margin-left:37.5%}.ivu-col-xs-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xs-8{display:block;width:33.33333333%}.ivu-col-xs-push-8{left:33.33333333%}.ivu-col-xs-pull-8{right:33.33333333%}.ivu-col-xs-offset-8{margin-left:33.33333333%}.ivu-col-xs-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xs-7{display:block;width:29.16666667%}.ivu-col-xs-push-7{left:29.16666667%}.ivu-col-xs-pull-7{right:29.16666667%}.ivu-col-xs-offset-7{margin-left:29.16666667%}.ivu-col-xs-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xs-6{display:block;width:25%}.ivu-col-xs-push-6{left:25%}.ivu-col-xs-pull-6{right:25%}.ivu-col-xs-offset-6{margin-left:25%}.ivu-col-xs-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xs-5{display:block;width:20.83333333%}.ivu-col-xs-push-5{left:20.83333333%}.ivu-col-xs-pull-5{right:20.83333333%}.ivu-col-xs-offset-5{margin-left:20.83333333%}.ivu-col-xs-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xs-4{display:block;width:16.66666667%}.ivu-col-xs-push-4{left:16.66666667%}.ivu-col-xs-pull-4{right:16.66666667%}.ivu-col-xs-offset-4{margin-left:16.66666667%}.ivu-col-xs-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xs-3{display:block;width:12.5%}.ivu-col-xs-push-3{left:12.5%}.ivu-col-xs-pull-3{right:12.5%}.ivu-col-xs-offset-3{margin-left:12.5%}.ivu-col-xs-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xs-2{display:block;width:8.33333333%}.ivu-col-xs-push-2{left:8.33333333%}.ivu-col-xs-pull-2{right:8.33333333%}.ivu-col-xs-offset-2{margin-left:8.33333333%}.ivu-col-xs-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xs-1{display:block;width:4.16666667%}.ivu-col-xs-push-1{left:4.16666667%}.ivu-col-xs-pull-1{right:4.16666667%}.ivu-col-xs-offset-1{margin-left:4.16666667%}.ivu-col-xs-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xs-0{display:none}.ivu-col-xs-push-0{left:auto}.ivu-col-xs-pull-0{right:auto}.ivu-col-xs-offset-0{margin-left:0}.ivu-col-xs-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}@media (min-width:576px){.ivu-col-span-sm-1,.ivu-col-span-sm-10,.ivu-col-span-sm-11,.ivu-col-span-sm-12,.ivu-col-span-sm-13,.ivu-col-span-sm-14,.ivu-col-span-sm-15,.ivu-col-span-sm-16,.ivu-col-span-sm-17,.ivu-col-span-sm-18,.ivu-col-span-sm-19,.ivu-col-span-sm-2,.ivu-col-span-sm-20,.ivu-col-span-sm-21,.ivu-col-span-sm-22,.ivu-col-span-sm-23,.ivu-col-span-sm-24,.ivu-col-span-sm-3,.ivu-col-span-sm-4,.ivu-col-span-sm-5,.ivu-col-span-sm-6,.ivu-col-span-sm-7,.ivu-col-span-sm-8,.ivu-col-span-sm-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-sm-24{display:block;width:100%}.ivu-col-sm-push-24{left:100%}.ivu-col-sm-pull-24{right:100%}.ivu-col-sm-offset-24{margin-left:100%}.ivu-col-sm-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-sm-23{display:block;width:95.83333333%}.ivu-col-sm-push-23{left:95.83333333%}.ivu-col-sm-pull-23{right:95.83333333%}.ivu-col-sm-offset-23{margin-left:95.83333333%}.ivu-col-sm-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-sm-22{display:block;width:91.66666667%}.ivu-col-sm-push-22{left:91.66666667%}.ivu-col-sm-pull-22{right:91.66666667%}.ivu-col-sm-offset-22{margin-left:91.66666667%}.ivu-col-sm-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-sm-21{display:block;width:87.5%}.ivu-col-sm-push-21{left:87.5%}.ivu-col-sm-pull-21{right:87.5%}.ivu-col-sm-offset-21{margin-left:87.5%}.ivu-col-sm-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-sm-20{display:block;width:83.33333333%}.ivu-col-sm-push-20{left:83.33333333%}.ivu-col-sm-pull-20{right:83.33333333%}.ivu-col-sm-offset-20{margin-left:83.33333333%}.ivu-col-sm-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-sm-19{display:block;width:79.16666667%}.ivu-col-sm-push-19{left:79.16666667%}.ivu-col-sm-pull-19{right:79.16666667%}.ivu-col-sm-offset-19{margin-left:79.16666667%}.ivu-col-sm-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-sm-18{display:block;width:75%}.ivu-col-sm-push-18{left:75%}.ivu-col-sm-pull-18{right:75%}.ivu-col-sm-offset-18{margin-left:75%}.ivu-col-sm-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-sm-17{display:block;width:70.83333333%}.ivu-col-sm-push-17{left:70.83333333%}.ivu-col-sm-pull-17{right:70.83333333%}.ivu-col-sm-offset-17{margin-left:70.83333333%}.ivu-col-sm-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-sm-16{display:block;width:66.66666667%}.ivu-col-sm-push-16{left:66.66666667%}.ivu-col-sm-pull-16{right:66.66666667%}.ivu-col-sm-offset-16{margin-left:66.66666667%}.ivu-col-sm-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-sm-15{display:block;width:62.5%}.ivu-col-sm-push-15{left:62.5%}.ivu-col-sm-pull-15{right:62.5%}.ivu-col-sm-offset-15{margin-left:62.5%}.ivu-col-sm-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-sm-14{display:block;width:58.33333333%}.ivu-col-sm-push-14{left:58.33333333%}.ivu-col-sm-pull-14{right:58.33333333%}.ivu-col-sm-offset-14{margin-left:58.33333333%}.ivu-col-sm-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-sm-13{display:block;width:54.16666667%}.ivu-col-sm-push-13{left:54.16666667%}.ivu-col-sm-pull-13{right:54.16666667%}.ivu-col-sm-offset-13{margin-left:54.16666667%}.ivu-col-sm-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-sm-12{display:block;width:50%}.ivu-col-sm-push-12{left:50%}.ivu-col-sm-pull-12{right:50%}.ivu-col-sm-offset-12{margin-left:50%}.ivu-col-sm-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-sm-11{display:block;width:45.83333333%}.ivu-col-sm-push-11{left:45.83333333%}.ivu-col-sm-pull-11{right:45.83333333%}.ivu-col-sm-offset-11{margin-left:45.83333333%}.ivu-col-sm-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-sm-10{display:block;width:41.66666667%}.ivu-col-sm-push-10{left:41.66666667%}.ivu-col-sm-pull-10{right:41.66666667%}.ivu-col-sm-offset-10{margin-left:41.66666667%}.ivu-col-sm-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-sm-9{display:block;width:37.5%}.ivu-col-sm-push-9{left:37.5%}.ivu-col-sm-pull-9{right:37.5%}.ivu-col-sm-offset-9{margin-left:37.5%}.ivu-col-sm-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-sm-8{display:block;width:33.33333333%}.ivu-col-sm-push-8{left:33.33333333%}.ivu-col-sm-pull-8{right:33.33333333%}.ivu-col-sm-offset-8{margin-left:33.33333333%}.ivu-col-sm-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-sm-7{display:block;width:29.16666667%}.ivu-col-sm-push-7{left:29.16666667%}.ivu-col-sm-pull-7{right:29.16666667%}.ivu-col-sm-offset-7{margin-left:29.16666667%}.ivu-col-sm-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-sm-6{display:block;width:25%}.ivu-col-sm-push-6{left:25%}.ivu-col-sm-pull-6{right:25%}.ivu-col-sm-offset-6{margin-left:25%}.ivu-col-sm-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-sm-5{display:block;width:20.83333333%}.ivu-col-sm-push-5{left:20.83333333%}.ivu-col-sm-pull-5{right:20.83333333%}.ivu-col-sm-offset-5{margin-left:20.83333333%}.ivu-col-sm-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-sm-4{display:block;width:16.66666667%}.ivu-col-sm-push-4{left:16.66666667%}.ivu-col-sm-pull-4{right:16.66666667%}.ivu-col-sm-offset-4{margin-left:16.66666667%}.ivu-col-sm-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-sm-3{display:block;width:12.5%}.ivu-col-sm-push-3{left:12.5%}.ivu-col-sm-pull-3{right:12.5%}.ivu-col-sm-offset-3{margin-left:12.5%}.ivu-col-sm-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-sm-2{display:block;width:8.33333333%}.ivu-col-sm-push-2{left:8.33333333%}.ivu-col-sm-pull-2{right:8.33333333%}.ivu-col-sm-offset-2{margin-left:8.33333333%}.ivu-col-sm-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-sm-1{display:block;width:4.16666667%}.ivu-col-sm-push-1{left:4.16666667%}.ivu-col-sm-pull-1{right:4.16666667%}.ivu-col-sm-offset-1{margin-left:4.16666667%}.ivu-col-sm-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-sm-0{display:none}.ivu-col-sm-push-0{left:auto}.ivu-col-sm-pull-0{right:auto}.ivu-col-sm-offset-0{margin-left:0}.ivu-col-sm-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:768px){.ivu-col-span-md-1,.ivu-col-span-md-10,.ivu-col-span-md-11,.ivu-col-span-md-12,.ivu-col-span-md-13,.ivu-col-span-md-14,.ivu-col-span-md-15,.ivu-col-span-md-16,.ivu-col-span-md-17,.ivu-col-span-md-18,.ivu-col-span-md-19,.ivu-col-span-md-2,.ivu-col-span-md-20,.ivu-col-span-md-21,.ivu-col-span-md-22,.ivu-col-span-md-23,.ivu-col-span-md-24,.ivu-col-span-md-3,.ivu-col-span-md-4,.ivu-col-span-md-5,.ivu-col-span-md-6,.ivu-col-span-md-7,.ivu-col-span-md-8,.ivu-col-span-md-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-md-24{display:block;width:100%}.ivu-col-md-push-24{left:100%}.ivu-col-md-pull-24{right:100%}.ivu-col-md-offset-24{margin-left:100%}.ivu-col-md-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-md-23{display:block;width:95.83333333%}.ivu-col-md-push-23{left:95.83333333%}.ivu-col-md-pull-23{right:95.83333333%}.ivu-col-md-offset-23{margin-left:95.83333333%}.ivu-col-md-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-md-22{display:block;width:91.66666667%}.ivu-col-md-push-22{left:91.66666667%}.ivu-col-md-pull-22{right:91.66666667%}.ivu-col-md-offset-22{margin-left:91.66666667%}.ivu-col-md-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-md-21{display:block;width:87.5%}.ivu-col-md-push-21{left:87.5%}.ivu-col-md-pull-21{right:87.5%}.ivu-col-md-offset-21{margin-left:87.5%}.ivu-col-md-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-md-20{display:block;width:83.33333333%}.ivu-col-md-push-20{left:83.33333333%}.ivu-col-md-pull-20{right:83.33333333%}.ivu-col-md-offset-20{margin-left:83.33333333%}.ivu-col-md-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-md-19{display:block;width:79.16666667%}.ivu-col-md-push-19{left:79.16666667%}.ivu-col-md-pull-19{right:79.16666667%}.ivu-col-md-offset-19{margin-left:79.16666667%}.ivu-col-md-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-md-18{display:block;width:75%}.ivu-col-md-push-18{left:75%}.ivu-col-md-pull-18{right:75%}.ivu-col-md-offset-18{margin-left:75%}.ivu-col-md-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-md-17{display:block;width:70.83333333%}.ivu-col-md-push-17{left:70.83333333%}.ivu-col-md-pull-17{right:70.83333333%}.ivu-col-md-offset-17{margin-left:70.83333333%}.ivu-col-md-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-md-16{display:block;width:66.66666667%}.ivu-col-md-push-16{left:66.66666667%}.ivu-col-md-pull-16{right:66.66666667%}.ivu-col-md-offset-16{margin-left:66.66666667%}.ivu-col-md-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-md-15{display:block;width:62.5%}.ivu-col-md-push-15{left:62.5%}.ivu-col-md-pull-15{right:62.5%}.ivu-col-md-offset-15{margin-left:62.5%}.ivu-col-md-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-md-14{display:block;width:58.33333333%}.ivu-col-md-push-14{left:58.33333333%}.ivu-col-md-pull-14{right:58.33333333%}.ivu-col-md-offset-14{margin-left:58.33333333%}.ivu-col-md-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-md-13{display:block;width:54.16666667%}.ivu-col-md-push-13{left:54.16666667%}.ivu-col-md-pull-13{right:54.16666667%}.ivu-col-md-offset-13{margin-left:54.16666667%}.ivu-col-md-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-md-12{display:block;width:50%}.ivu-col-md-push-12{left:50%}.ivu-col-md-pull-12{right:50%}.ivu-col-md-offset-12{margin-left:50%}.ivu-col-md-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-md-11{display:block;width:45.83333333%}.ivu-col-md-push-11{left:45.83333333%}.ivu-col-md-pull-11{right:45.83333333%}.ivu-col-md-offset-11{margin-left:45.83333333%}.ivu-col-md-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-md-10{display:block;width:41.66666667%}.ivu-col-md-push-10{left:41.66666667%}.ivu-col-md-pull-10{right:41.66666667%}.ivu-col-md-offset-10{margin-left:41.66666667%}.ivu-col-md-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-md-9{display:block;width:37.5%}.ivu-col-md-push-9{left:37.5%}.ivu-col-md-pull-9{right:37.5%}.ivu-col-md-offset-9{margin-left:37.5%}.ivu-col-md-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-md-8{display:block;width:33.33333333%}.ivu-col-md-push-8{left:33.33333333%}.ivu-col-md-pull-8{right:33.33333333%}.ivu-col-md-offset-8{margin-left:33.33333333%}.ivu-col-md-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-md-7{display:block;width:29.16666667%}.ivu-col-md-push-7{left:29.16666667%}.ivu-col-md-pull-7{right:29.16666667%}.ivu-col-md-offset-7{margin-left:29.16666667%}.ivu-col-md-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-md-6{display:block;width:25%}.ivu-col-md-push-6{left:25%}.ivu-col-md-pull-6{right:25%}.ivu-col-md-offset-6{margin-left:25%}.ivu-col-md-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-md-5{display:block;width:20.83333333%}.ivu-col-md-push-5{left:20.83333333%}.ivu-col-md-pull-5{right:20.83333333%}.ivu-col-md-offset-5{margin-left:20.83333333%}.ivu-col-md-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-md-4{display:block;width:16.66666667%}.ivu-col-md-push-4{left:16.66666667%}.ivu-col-md-pull-4{right:16.66666667%}.ivu-col-md-offset-4{margin-left:16.66666667%}.ivu-col-md-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-md-3{display:block;width:12.5%}.ivu-col-md-push-3{left:12.5%}.ivu-col-md-pull-3{right:12.5%}.ivu-col-md-offset-3{margin-left:12.5%}.ivu-col-md-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-md-2{display:block;width:8.33333333%}.ivu-col-md-push-2{left:8.33333333%}.ivu-col-md-pull-2{right:8.33333333%}.ivu-col-md-offset-2{margin-left:8.33333333%}.ivu-col-md-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-md-1{display:block;width:4.16666667%}.ivu-col-md-push-1{left:4.16666667%}.ivu-col-md-pull-1{right:4.16666667%}.ivu-col-md-offset-1{margin-left:4.16666667%}.ivu-col-md-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-md-0{display:none}.ivu-col-md-push-0{left:auto}.ivu-col-md-pull-0{right:auto}.ivu-col-md-offset-0{margin-left:0}.ivu-col-md-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:992px){.ivu-col-span-lg-1,.ivu-col-span-lg-10,.ivu-col-span-lg-11,.ivu-col-span-lg-12,.ivu-col-span-lg-13,.ivu-col-span-lg-14,.ivu-col-span-lg-15,.ivu-col-span-lg-16,.ivu-col-span-lg-17,.ivu-col-span-lg-18,.ivu-col-span-lg-19,.ivu-col-span-lg-2,.ivu-col-span-lg-20,.ivu-col-span-lg-21,.ivu-col-span-lg-22,.ivu-col-span-lg-23,.ivu-col-span-lg-24,.ivu-col-span-lg-3,.ivu-col-span-lg-4,.ivu-col-span-lg-5,.ivu-col-span-lg-6,.ivu-col-span-lg-7,.ivu-col-span-lg-8,.ivu-col-span-lg-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-lg-24{display:block;width:100%}.ivu-col-lg-push-24{left:100%}.ivu-col-lg-pull-24{right:100%}.ivu-col-lg-offset-24{margin-left:100%}.ivu-col-lg-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-lg-23{display:block;width:95.83333333%}.ivu-col-lg-push-23{left:95.83333333%}.ivu-col-lg-pull-23{right:95.83333333%}.ivu-col-lg-offset-23{margin-left:95.83333333%}.ivu-col-lg-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-lg-22{display:block;width:91.66666667%}.ivu-col-lg-push-22{left:91.66666667%}.ivu-col-lg-pull-22{right:91.66666667%}.ivu-col-lg-offset-22{margin-left:91.66666667%}.ivu-col-lg-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-lg-21{display:block;width:87.5%}.ivu-col-lg-push-21{left:87.5%}.ivu-col-lg-pull-21{right:87.5%}.ivu-col-lg-offset-21{margin-left:87.5%}.ivu-col-lg-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-lg-20{display:block;width:83.33333333%}.ivu-col-lg-push-20{left:83.33333333%}.ivu-col-lg-pull-20{right:83.33333333%}.ivu-col-lg-offset-20{margin-left:83.33333333%}.ivu-col-lg-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-lg-19{display:block;width:79.16666667%}.ivu-col-lg-push-19{left:79.16666667%}.ivu-col-lg-pull-19{right:79.16666667%}.ivu-col-lg-offset-19{margin-left:79.16666667%}.ivu-col-lg-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-lg-18{display:block;width:75%}.ivu-col-lg-push-18{left:75%}.ivu-col-lg-pull-18{right:75%}.ivu-col-lg-offset-18{margin-left:75%}.ivu-col-lg-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-lg-17{display:block;width:70.83333333%}.ivu-col-lg-push-17{left:70.83333333%}.ivu-col-lg-pull-17{right:70.83333333%}.ivu-col-lg-offset-17{margin-left:70.83333333%}.ivu-col-lg-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-lg-16{display:block;width:66.66666667%}.ivu-col-lg-push-16{left:66.66666667%}.ivu-col-lg-pull-16{right:66.66666667%}.ivu-col-lg-offset-16{margin-left:66.66666667%}.ivu-col-lg-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-lg-15{display:block;width:62.5%}.ivu-col-lg-push-15{left:62.5%}.ivu-col-lg-pull-15{right:62.5%}.ivu-col-lg-offset-15{margin-left:62.5%}.ivu-col-lg-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-lg-14{display:block;width:58.33333333%}.ivu-col-lg-push-14{left:58.33333333%}.ivu-col-lg-pull-14{right:58.33333333%}.ivu-col-lg-offset-14{margin-left:58.33333333%}.ivu-col-lg-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-lg-13{display:block;width:54.16666667%}.ivu-col-lg-push-13{left:54.16666667%}.ivu-col-lg-pull-13{right:54.16666667%}.ivu-col-lg-offset-13{margin-left:54.16666667%}.ivu-col-lg-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-lg-12{display:block;width:50%}.ivu-col-lg-push-12{left:50%}.ivu-col-lg-pull-12{right:50%}.ivu-col-lg-offset-12{margin-left:50%}.ivu-col-lg-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-lg-11{display:block;width:45.83333333%}.ivu-col-lg-push-11{left:45.83333333%}.ivu-col-lg-pull-11{right:45.83333333%}.ivu-col-lg-offset-11{margin-left:45.83333333%}.ivu-col-lg-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-lg-10{display:block;width:41.66666667%}.ivu-col-lg-push-10{left:41.66666667%}.ivu-col-lg-pull-10{right:41.66666667%}.ivu-col-lg-offset-10{margin-left:41.66666667%}.ivu-col-lg-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-lg-9{display:block;width:37.5%}.ivu-col-lg-push-9{left:37.5%}.ivu-col-lg-pull-9{right:37.5%}.ivu-col-lg-offset-9{margin-left:37.5%}.ivu-col-lg-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-lg-8{display:block;width:33.33333333%}.ivu-col-lg-push-8{left:33.33333333%}.ivu-col-lg-pull-8{right:33.33333333%}.ivu-col-lg-offset-8{margin-left:33.33333333%}.ivu-col-lg-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-lg-7{display:block;width:29.16666667%}.ivu-col-lg-push-7{left:29.16666667%}.ivu-col-lg-pull-7{right:29.16666667%}.ivu-col-lg-offset-7{margin-left:29.16666667%}.ivu-col-lg-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-lg-6{display:block;width:25%}.ivu-col-lg-push-6{left:25%}.ivu-col-lg-pull-6{right:25%}.ivu-col-lg-offset-6{margin-left:25%}.ivu-col-lg-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-lg-5{display:block;width:20.83333333%}.ivu-col-lg-push-5{left:20.83333333%}.ivu-col-lg-pull-5{right:20.83333333%}.ivu-col-lg-offset-5{margin-left:20.83333333%}.ivu-col-lg-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-lg-4{display:block;width:16.66666667%}.ivu-col-lg-push-4{left:16.66666667%}.ivu-col-lg-pull-4{right:16.66666667%}.ivu-col-lg-offset-4{margin-left:16.66666667%}.ivu-col-lg-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-lg-3{display:block;width:12.5%}.ivu-col-lg-push-3{left:12.5%}.ivu-col-lg-pull-3{right:12.5%}.ivu-col-lg-offset-3{margin-left:12.5%}.ivu-col-lg-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-lg-2{display:block;width:8.33333333%}.ivu-col-lg-push-2{left:8.33333333%}.ivu-col-lg-pull-2{right:8.33333333%}.ivu-col-lg-offset-2{margin-left:8.33333333%}.ivu-col-lg-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-lg-1{display:block;width:4.16666667%}.ivu-col-lg-push-1{left:4.16666667%}.ivu-col-lg-pull-1{right:4.16666667%}.ivu-col-lg-offset-1{margin-left:4.16666667%}.ivu-col-lg-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-lg-0{display:none}.ivu-col-lg-push-0{left:auto}.ivu-col-lg-pull-0{right:auto}.ivu-col-lg-offset-0{margin-left:0}.ivu-col-lg-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:1200px){.ivu-col-span-xl-1,.ivu-col-span-xl-10,.ivu-col-span-xl-11,.ivu-col-span-xl-12,.ivu-col-span-xl-13,.ivu-col-span-xl-14,.ivu-col-span-xl-15,.ivu-col-span-xl-16,.ivu-col-span-xl-17,.ivu-col-span-xl-18,.ivu-col-span-xl-19,.ivu-col-span-xl-2,.ivu-col-span-xl-20,.ivu-col-span-xl-21,.ivu-col-span-xl-22,.ivu-col-span-xl-23,.ivu-col-span-xl-24,.ivu-col-span-xl-3,.ivu-col-span-xl-4,.ivu-col-span-xl-5,.ivu-col-span-xl-6,.ivu-col-span-xl-7,.ivu-col-span-xl-8,.ivu-col-span-xl-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xl-24{display:block;width:100%}.ivu-col-xl-push-24{left:100%}.ivu-col-xl-pull-24{right:100%}.ivu-col-xl-offset-24{margin-left:100%}.ivu-col-xl-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xl-23{display:block;width:95.83333333%}.ivu-col-xl-push-23{left:95.83333333%}.ivu-col-xl-pull-23{right:95.83333333%}.ivu-col-xl-offset-23{margin-left:95.83333333%}.ivu-col-xl-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xl-22{display:block;width:91.66666667%}.ivu-col-xl-push-22{left:91.66666667%}.ivu-col-xl-pull-22{right:91.66666667%}.ivu-col-xl-offset-22{margin-left:91.66666667%}.ivu-col-xl-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xl-21{display:block;width:87.5%}.ivu-col-xl-push-21{left:87.5%}.ivu-col-xl-pull-21{right:87.5%}.ivu-col-xl-offset-21{margin-left:87.5%}.ivu-col-xl-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xl-20{display:block;width:83.33333333%}.ivu-col-xl-push-20{left:83.33333333%}.ivu-col-xl-pull-20{right:83.33333333%}.ivu-col-xl-offset-20{margin-left:83.33333333%}.ivu-col-xl-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xl-19{display:block;width:79.16666667%}.ivu-col-xl-push-19{left:79.16666667%}.ivu-col-xl-pull-19{right:79.16666667%}.ivu-col-xl-offset-19{margin-left:79.16666667%}.ivu-col-xl-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xl-18{display:block;width:75%}.ivu-col-xl-push-18{left:75%}.ivu-col-xl-pull-18{right:75%}.ivu-col-xl-offset-18{margin-left:75%}.ivu-col-xl-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xl-17{display:block;width:70.83333333%}.ivu-col-xl-push-17{left:70.83333333%}.ivu-col-xl-pull-17{right:70.83333333%}.ivu-col-xl-offset-17{margin-left:70.83333333%}.ivu-col-xl-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xl-16{display:block;width:66.66666667%}.ivu-col-xl-push-16{left:66.66666667%}.ivu-col-xl-pull-16{right:66.66666667%}.ivu-col-xl-offset-16{margin-left:66.66666667%}.ivu-col-xl-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xl-15{display:block;width:62.5%}.ivu-col-xl-push-15{left:62.5%}.ivu-col-xl-pull-15{right:62.5%}.ivu-col-xl-offset-15{margin-left:62.5%}.ivu-col-xl-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xl-14{display:block;width:58.33333333%}.ivu-col-xl-push-14{left:58.33333333%}.ivu-col-xl-pull-14{right:58.33333333%}.ivu-col-xl-offset-14{margin-left:58.33333333%}.ivu-col-xl-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xl-13{display:block;width:54.16666667%}.ivu-col-xl-push-13{left:54.16666667%}.ivu-col-xl-pull-13{right:54.16666667%}.ivu-col-xl-offset-13{margin-left:54.16666667%}.ivu-col-xl-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xl-12{display:block;width:50%}.ivu-col-xl-push-12{left:50%}.ivu-col-xl-pull-12{right:50%}.ivu-col-xl-offset-12{margin-left:50%}.ivu-col-xl-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xl-11{display:block;width:45.83333333%}.ivu-col-xl-push-11{left:45.83333333%}.ivu-col-xl-pull-11{right:45.83333333%}.ivu-col-xl-offset-11{margin-left:45.83333333%}.ivu-col-xl-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xl-10{display:block;width:41.66666667%}.ivu-col-xl-push-10{left:41.66666667%}.ivu-col-xl-pull-10{right:41.66666667%}.ivu-col-xl-offset-10{margin-left:41.66666667%}.ivu-col-xl-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xl-9{display:block;width:37.5%}.ivu-col-xl-push-9{left:37.5%}.ivu-col-xl-pull-9{right:37.5%}.ivu-col-xl-offset-9{margin-left:37.5%}.ivu-col-xl-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xl-8{display:block;width:33.33333333%}.ivu-col-xl-push-8{left:33.33333333%}.ivu-col-xl-pull-8{right:33.33333333%}.ivu-col-xl-offset-8{margin-left:33.33333333%}.ivu-col-xl-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xl-7{display:block;width:29.16666667%}.ivu-col-xl-push-7{left:29.16666667%}.ivu-col-xl-pull-7{right:29.16666667%}.ivu-col-xl-offset-7{margin-left:29.16666667%}.ivu-col-xl-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xl-6{display:block;width:25%}.ivu-col-xl-push-6{left:25%}.ivu-col-xl-pull-6{right:25%}.ivu-col-xl-offset-6{margin-left:25%}.ivu-col-xl-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xl-5{display:block;width:20.83333333%}.ivu-col-xl-push-5{left:20.83333333%}.ivu-col-xl-pull-5{right:20.83333333%}.ivu-col-xl-offset-5{margin-left:20.83333333%}.ivu-col-xl-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xl-4{display:block;width:16.66666667%}.ivu-col-xl-push-4{left:16.66666667%}.ivu-col-xl-pull-4{right:16.66666667%}.ivu-col-xl-offset-4{margin-left:16.66666667%}.ivu-col-xl-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xl-3{display:block;width:12.5%}.ivu-col-xl-push-3{left:12.5%}.ivu-col-xl-pull-3{right:12.5%}.ivu-col-xl-offset-3{margin-left:12.5%}.ivu-col-xl-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xl-2{display:block;width:8.33333333%}.ivu-col-xl-push-2{left:8.33333333%}.ivu-col-xl-pull-2{right:8.33333333%}.ivu-col-xl-offset-2{margin-left:8.33333333%}.ivu-col-xl-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xl-1{display:block;width:4.16666667%}.ivu-col-xl-push-1{left:4.16666667%}.ivu-col-xl-pull-1{right:4.16666667%}.ivu-col-xl-offset-1{margin-left:4.16666667%}.ivu-col-xl-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xl-0{display:none}.ivu-col-xl-push-0{left:auto}.ivu-col-xl-pull-0{right:auto}.ivu-col-xl-offset-0{margin-left:0}.ivu-col-xl-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:1600px){.ivu-col-span-xxl-1,.ivu-col-span-xxl-10,.ivu-col-span-xxl-11,.ivu-col-span-xxl-12,.ivu-col-span-xxl-13,.ivu-col-span-xxl-14,.ivu-col-span-xxl-15,.ivu-col-span-xxl-16,.ivu-col-span-xxl-17,.ivu-col-span-xxl-18,.ivu-col-span-xxl-19,.ivu-col-span-xxl-2,.ivu-col-span-xxl-20,.ivu-col-span-xxl-21,.ivu-col-span-xxl-22,.ivu-col-span-xxl-23,.ivu-col-span-xxl-24,.ivu-col-span-xxl-3,.ivu-col-span-xxl-4,.ivu-col-span-xxl-5,.ivu-col-span-xxl-6,.ivu-col-span-xxl-7,.ivu-col-span-xxl-8,.ivu-col-span-xxl-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xxl-24{display:block;width:100%}.ivu-col-xxl-push-24{left:100%}.ivu-col-xxl-pull-24{right:100%}.ivu-col-xxl-offset-24{margin-left:100%}.ivu-col-xxl-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xxl-23{display:block;width:95.83333333%}.ivu-col-xxl-push-23{left:95.83333333%}.ivu-col-xxl-pull-23{right:95.83333333%}.ivu-col-xxl-offset-23{margin-left:95.83333333%}.ivu-col-xxl-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xxl-22{display:block;width:91.66666667%}.ivu-col-xxl-push-22{left:91.66666667%}.ivu-col-xxl-pull-22{right:91.66666667%}.ivu-col-xxl-offset-22{margin-left:91.66666667%}.ivu-col-xxl-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xxl-21{display:block;width:87.5%}.ivu-col-xxl-push-21{left:87.5%}.ivu-col-xxl-pull-21{right:87.5%}.ivu-col-xxl-offset-21{margin-left:87.5%}.ivu-col-xxl-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xxl-20{display:block;width:83.33333333%}.ivu-col-xxl-push-20{left:83.33333333%}.ivu-col-xxl-pull-20{right:83.33333333%}.ivu-col-xxl-offset-20{margin-left:83.33333333%}.ivu-col-xxl-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xxl-19{display:block;width:79.16666667%}.ivu-col-xxl-push-19{left:79.16666667%}.ivu-col-xxl-pull-19{right:79.16666667%}.ivu-col-xxl-offset-19{margin-left:79.16666667%}.ivu-col-xxl-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xxl-18{display:block;width:75%}.ivu-col-xxl-push-18{left:75%}.ivu-col-xxl-pull-18{right:75%}.ivu-col-xxl-offset-18{margin-left:75%}.ivu-col-xxl-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xxl-17{display:block;width:70.83333333%}.ivu-col-xxl-push-17{left:70.83333333%}.ivu-col-xxl-pull-17{right:70.83333333%}.ivu-col-xxl-offset-17{margin-left:70.83333333%}.ivu-col-xxl-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xxl-16{display:block;width:66.66666667%}.ivu-col-xxl-push-16{left:66.66666667%}.ivu-col-xxl-pull-16{right:66.66666667%}.ivu-col-xxl-offset-16{margin-left:66.66666667%}.ivu-col-xxl-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xxl-15{display:block;width:62.5%}.ivu-col-xxl-push-15{left:62.5%}.ivu-col-xxl-pull-15{right:62.5%}.ivu-col-xxl-offset-15{margin-left:62.5%}.ivu-col-xxl-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xxl-14{display:block;width:58.33333333%}.ivu-col-xxl-push-14{left:58.33333333%}.ivu-col-xxl-pull-14{right:58.33333333%}.ivu-col-xxl-offset-14{margin-left:58.33333333%}.ivu-col-xxl-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xxl-13{display:block;width:54.16666667%}.ivu-col-xxl-push-13{left:54.16666667%}.ivu-col-xxl-pull-13{right:54.16666667%}.ivu-col-xxl-offset-13{margin-left:54.16666667%}.ivu-col-xxl-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xxl-12{display:block;width:50%}.ivu-col-xxl-push-12{left:50%}.ivu-col-xxl-pull-12{right:50%}.ivu-col-xxl-offset-12{margin-left:50%}.ivu-col-xxl-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xxl-11{display:block;width:45.83333333%}.ivu-col-xxl-push-11{left:45.83333333%}.ivu-col-xxl-pull-11{right:45.83333333%}.ivu-col-xxl-offset-11{margin-left:45.83333333%}.ivu-col-xxl-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xxl-10{display:block;width:41.66666667%}.ivu-col-xxl-push-10{left:41.66666667%}.ivu-col-xxl-pull-10{right:41.66666667%}.ivu-col-xxl-offset-10{margin-left:41.66666667%}.ivu-col-xxl-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xxl-9{display:block;width:37.5%}.ivu-col-xxl-push-9{left:37.5%}.ivu-col-xxl-pull-9{right:37.5%}.ivu-col-xxl-offset-9{margin-left:37.5%}.ivu-col-xxl-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xxl-8{display:block;width:33.33333333%}.ivu-col-xxl-push-8{left:33.33333333%}.ivu-col-xxl-pull-8{right:33.33333333%}.ivu-col-xxl-offset-8{margin-left:33.33333333%}.ivu-col-xxl-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xxl-7{display:block;width:29.16666667%}.ivu-col-xxl-push-7{left:29.16666667%}.ivu-col-xxl-pull-7{right:29.16666667%}.ivu-col-xxl-offset-7{margin-left:29.16666667%}.ivu-col-xxl-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xxl-6{display:block;width:25%}.ivu-col-xxl-push-6{left:25%}.ivu-col-xxl-pull-6{right:25%}.ivu-col-xxl-offset-6{margin-left:25%}.ivu-col-xxl-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xxl-5{display:block;width:20.83333333%}.ivu-col-xxl-push-5{left:20.83333333%}.ivu-col-xxl-pull-5{right:20.83333333%}.ivu-col-xxl-offset-5{margin-left:20.83333333%}.ivu-col-xxl-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xxl-4{display:block;width:16.66666667%}.ivu-col-xxl-push-4{left:16.66666667%}.ivu-col-xxl-pull-4{right:16.66666667%}.ivu-col-xxl-offset-4{margin-left:16.66666667%}.ivu-col-xxl-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xxl-3{display:block;width:12.5%}.ivu-col-xxl-push-3{left:12.5%}.ivu-col-xxl-pull-3{right:12.5%}.ivu-col-xxl-offset-3{margin-left:12.5%}.ivu-col-xxl-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xxl-2{display:block;width:8.33333333%}.ivu-col-xxl-push-2{left:8.33333333%}.ivu-col-xxl-pull-2{right:8.33333333%}.ivu-col-xxl-offset-2{margin-left:8.33333333%}.ivu-col-xxl-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xxl-1{display:block;width:4.16666667%}.ivu-col-xxl-push-1{left:4.16666667%}.ivu-col-xxl-pull-1{right:4.16666667%}.ivu-col-xxl-offset-1{margin-left:4.16666667%}.ivu-col-xxl-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xxl-0{display:none}.ivu-col-xxl-push-0{left:auto}.ivu-col-xxl-pull-0{right:auto}.ivu-col-xxl-offset-0{margin-left:0}.ivu-col-xxl-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}.ivu-article h1{font-size:26px;font-weight:400}.ivu-article h2{font-size:20px;font-weight:400}.ivu-article h3{font-size:16px;font-weight:400}.ivu-article h4{font-size:14px;font-weight:400}.ivu-article h5{font-size:12px;font-weight:400}.ivu-article h6{font-size:12px;font-weight:400}.ivu-article blockquote{padding:5px 5px 3px 10px;line-height:1.5;border-left:4px solid #ddd;margin-bottom:20px;color:#666;font-size:14px}.ivu-article ul:not([class^=ivu-]){padding-left:40px;list-style-type:disc}.ivu-article li:not([class^=ivu-]){margin-bottom:5px;font-size:14px}.ivu-article ol ul:not([class^=ivu-]),.ivu-article ul ul:not([class^=ivu-]){list-style-type:circle}.ivu-article p{margin:5px;font-size:14px}.ivu-article a:not([class^=ivu-])[target=\"_blank\"]:after{content:\"\\F3F2\";font-family:Ionicons;color:#aaa;margin-left:3px}.fade-appear,.fade-enter-active{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-leave-active{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-appear,.fade-enter-active{-webkit-animation-name:ivuFadeIn;animation-name:ivuFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.fade-leave-active{-webkit-animation-name:ivuFadeOut;animation-name:ivuFadeOut;-webkit-animation-play-state:running;animation-play-state:running}.fade-appear,.fade-enter-active{opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear}.fade-leave-active{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes ivuFadeIn{0%{opacity:0}100%{opacity:1}}@keyframes ivuFadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes ivuFadeOut{0%{opacity:1}100%{opacity:0}}@keyframes ivuFadeOut{0%{opacity:1}100%{opacity:0}}.move-up-appear,.move-up-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-appear,.move-up-enter-active{-webkit-animation-name:ivuMoveUpIn;animation-name:ivuMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.move-up-leave-active{-webkit-animation-name:ivuMoveUpOut;animation-name:ivuMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running}.move-up-appear,.move-up-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-up-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-down-appear,.move-down-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-appear,.move-down-enter-active{-webkit-animation-name:ivuMoveDownIn;animation-name:ivuMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.move-down-leave-active{-webkit-animation-name:ivuMoveDownOut;animation-name:ivuMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running}.move-down-appear,.move-down-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-down-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-left-appear,.move-left-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-appear,.move-left-enter-active{-webkit-animation-name:ivuMoveLeftIn;animation-name:ivuMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.move-left-leave-active{-webkit-animation-name:ivuMoveLeftOut;animation-name:ivuMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running}.move-left-appear,.move-left-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-left-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-right-appear,.move-right-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-appear,.move-right-enter-active{-webkit-animation-name:ivuMoveRightIn;animation-name:ivuMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.move-right-leave-active{-webkit-animation-name:ivuMoveRightOut;animation-name:ivuMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running}.move-right-appear,.move-right-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-right-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes ivuMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes ivuMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@keyframes ivuMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@-webkit-keyframes ivuMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes ivuMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@-webkit-keyframes ivuMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes ivuMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@-webkit-keyframes ivuMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes ivuMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes ivuMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes ivuMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes ivuMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes ivuMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes ivuMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}@keyframes ivuMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}.move-notice-appear,.move-notice-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-notice-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-notice-appear,.move-notice-enter-active{-webkit-animation-name:ivuMoveNoticeIn;animation-name:ivuMoveNoticeIn;-webkit-animation-play-state:running;animation-play-state:running}.move-notice-leave-active{-webkit-animation-name:ivuMoveNoticeOut;animation-name:ivuMoveNoticeOut;-webkit-animation-play-state:running;animation-play-state:running}.move-notice-appear,.move-notice-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-notice-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuMoveNoticeIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes ivuMoveNoticeIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes ivuMoveNoticeOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}70%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:auto;padding:16px;margin-bottom:10px;opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:0;padding:0;margin-bottom:0;opacity:0}}@keyframes ivuMoveNoticeOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}70%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:auto;padding:16px;margin-bottom:10px;opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:0;padding:0;margin-bottom:0;opacity:0}}.ease-appear,.ease-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ease-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ease-appear,.ease-enter-active{-webkit-animation-name:ivuEaseIn;animation-name:ivuEaseIn;-webkit-animation-play-state:running;animation-play-state:running}.ease-leave-active{-webkit-animation-name:ivuEaseOut;animation-name:ivuEaseOut;-webkit-animation-play-state:running;animation-play-state:running}.ease-appear,.ease-enter-active{opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}.ease-leave-active{-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes ivuEaseIn{0%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes ivuEaseIn{0%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes ivuEaseOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}@keyframes ivuEaseOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}.transition-drop-appear,.transition-drop-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.transition-drop-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.transition-drop-appear,.transition-drop-enter-active{-webkit-animation-name:ivuTransitionDropIn;animation-name:ivuTransitionDropIn;-webkit-animation-play-state:running;animation-play-state:running}.transition-drop-leave-active{-webkit-animation-name:ivuTransitionDropOut;animation-name:ivuTransitionDropOut;-webkit-animation-play-state:running;animation-play-state:running}.transition-drop-appear,.transition-drop-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.transition-drop-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-up-appear,.slide-up-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-appear,.slide-up-enter-active{-webkit-animation-name:ivuSlideUpIn;animation-name:ivuSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-leave-active{-webkit-animation-name:ivuSlideUpOut;animation-name:ivuSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-appear,.slide-up-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-up-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-down-appear,.slide-down-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-appear,.slide-down-enter-active{-webkit-animation-name:ivuSlideDownIn;animation-name:ivuSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-leave-active{-webkit-animation-name:ivuSlideDownOut;animation-name:ivuSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-appear,.slide-down-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-down-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-left-appear,.slide-left-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-appear,.slide-left-enter-active{-webkit-animation-name:ivuSlideLeftIn;animation-name:ivuSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-leave-active{-webkit-animation-name:ivuSlideLeftOut;animation-name:ivuSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-appear,.slide-left-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-left-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-right-appear,.slide-right-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-appear,.slide-right-enter-active{-webkit-animation-name:ivuSlideRightIn;animation-name:ivuSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-leave-active{-webkit-animation-name:ivuSlideRightOut;animation-name:ivuSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-appear,.slide-right-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-right-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuTransitionDropIn{0%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuTransitionDropIn{0%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuTransitionDropOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuTransitionDropOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes ivuSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes ivuSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes ivuSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@-webkit-keyframes ivuSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes ivuSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes ivuSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes ivuSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}.collapse-transition{-webkit-transition:.2s height ease-in-out,.2s padding-top ease-in-out,.2s padding-bottom ease-in-out;transition:.2s height ease-in-out,.2s padding-top ease-in-out,.2s padding-bottom ease-in-out}.ivu-btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;line-height:1.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:32px;padding:0 15px;font-size:14px;border-radius:4px;-webkit-transition:color .2s linear,background-color .2s linear,border .2s linear,-webkit-box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,-webkit-box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear,-webkit-box-shadow .2s linear;color:#515a6e;background-color:#fff;border-color:#dcdee2}.ivu-btn>.ivu-icon{line-height:1.5}.ivu-btn-icon-only.ivu-btn-circle>.ivu-icon{vertical-align:baseline}.ivu-btn>i,.ivu-btn>span{display:inline-block}.ivu-btn,.ivu-btn:active,.ivu-btn:focus{outline:0}.ivu-btn:not([disabled]):hover{text-decoration:none}.ivu-btn:not([disabled]):active{outline:0}.ivu-btn.disabled,.ivu-btn[disabled]{cursor:not-allowed}.ivu-btn.disabled>*,.ivu-btn[disabled]>*{pointer-events:none}.ivu-btn-large{height:40px;padding:0 15px;font-size:16px;border-radius:4px}.ivu-btn-small{height:24px;padding:0 7px;font-size:14px;border-radius:3px}.ivu-btn-icon-only{width:32px;height:32px;padding:0;font-size:16px;border-radius:4px}.ivu-btn-icon-only.ivu-btn-large{width:40px;height:40px;padding:0;font-size:18px;border-radius:4px}.ivu-btn-icon-only.ivu-btn-small{width:24px;height:24px;padding:0;font-size:14px;border-radius:4px}.ivu-btn>a:only-child{color:currentColor}.ivu-btn>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:hover{color:#747b8b;background-color:#fff;border-color:#e3e5e8}.ivu-btn:hover>a:only-child{color:currentColor}.ivu-btn:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.active,.ivu-btn:active{color:#4d5669;background-color:#f2f2f2;border-color:#f2f2f2}.ivu-btn.active>a:only-child,.ivu-btn:active>a:only-child{color:currentColor}.ivu-btn.active>a:only-child:after,.ivu-btn:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.disabled,.ivu-btn.disabled.active,.ivu-btn.disabled:active,.ivu-btn.disabled:focus,.ivu-btn.disabled:hover,.ivu-btn[disabled],.ivu-btn[disabled].active,.ivu-btn[disabled]:active,.ivu-btn[disabled]:focus,.ivu-btn[disabled]:hover,fieldset[disabled] .ivu-btn,fieldset[disabled] .ivu-btn.active,fieldset[disabled] .ivu-btn:active,fieldset[disabled] .ivu-btn:focus,fieldset[disabled] .ivu-btn:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn.disabled.active>a:only-child,.ivu-btn.disabled:active>a:only-child,.ivu-btn.disabled:focus>a:only-child,.ivu-btn.disabled:hover>a:only-child,.ivu-btn.disabled>a:only-child,.ivu-btn[disabled].active>a:only-child,.ivu-btn[disabled]:active>a:only-child,.ivu-btn[disabled]:focus>a:only-child,.ivu-btn[disabled]:hover>a:only-child,.ivu-btn[disabled]>a:only-child,fieldset[disabled] .ivu-btn.active>a:only-child,fieldset[disabled] .ivu-btn:active>a:only-child,fieldset[disabled] .ivu-btn:focus>a:only-child,fieldset[disabled] .ivu-btn:hover>a:only-child,fieldset[disabled] .ivu-btn>a:only-child{color:currentColor}.ivu-btn.disabled.active>a:only-child:after,.ivu-btn.disabled:active>a:only-child:after,.ivu-btn.disabled:focus>a:only-child:after,.ivu-btn.disabled:hover>a:only-child:after,.ivu-btn.disabled>a:only-child:after,.ivu-btn[disabled].active>a:only-child:after,.ivu-btn[disabled]:active>a:only-child:after,.ivu-btn[disabled]:focus>a:only-child:after,.ivu-btn[disabled]:hover>a:only-child:after,.ivu-btn[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn.active>a:only-child:after,fieldset[disabled] .ivu-btn:active>a:only-child:after,fieldset[disabled] .ivu-btn:focus>a:only-child:after,fieldset[disabled] .ivu-btn:hover>a:only-child:after,fieldset[disabled] .ivu-btn>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:hover{color:#57a3f3;background-color:#fff;border-color:#57a3f3}.ivu-btn:hover>a:only-child{color:currentColor}.ivu-btn:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.active,.ivu-btn:active{color:#2b85e4;background-color:#fff;border-color:#2b85e4}.ivu-btn.active>a:only-child,.ivu-btn:active>a:only-child{color:currentColor}.ivu-btn.active>a:only-child:after,.ivu-btn:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-long{width:100%}.ivu-btn>.ivu-icon+span,.ivu-btn>span+.ivu-icon{margin-left:4px}.ivu-btn-primary{color:#fff;background-color:#2d8cf0;border-color:#2d8cf0}.ivu-btn-primary>a:only-child{color:currentColor}.ivu-btn-primary>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary:hover{color:#fff;background-color:#57a3f3;border-color:#57a3f3}.ivu-btn-primary:hover>a:only-child{color:currentColor}.ivu-btn-primary:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.active,.ivu-btn-primary:active{color:#f2f2f2;background-color:#2b85e4;border-color:#2b85e4}.ivu-btn-primary.active>a:only-child,.ivu-btn-primary:active>a:only-child{color:currentColor}.ivu-btn-primary.active>a:only-child:after,.ivu-btn-primary:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.disabled,.ivu-btn-primary.disabled.active,.ivu-btn-primary.disabled:active,.ivu-btn-primary.disabled:focus,.ivu-btn-primary.disabled:hover,.ivu-btn-primary[disabled],.ivu-btn-primary[disabled].active,.ivu-btn-primary[disabled]:active,.ivu-btn-primary[disabled]:focus,.ivu-btn-primary[disabled]:hover,fieldset[disabled] .ivu-btn-primary,fieldset[disabled] .ivu-btn-primary.active,fieldset[disabled] .ivu-btn-primary:active,fieldset[disabled] .ivu-btn-primary:focus,fieldset[disabled] .ivu-btn-primary:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-primary.disabled.active>a:only-child,.ivu-btn-primary.disabled:active>a:only-child,.ivu-btn-primary.disabled:focus>a:only-child,.ivu-btn-primary.disabled:hover>a:only-child,.ivu-btn-primary.disabled>a:only-child,.ivu-btn-primary[disabled].active>a:only-child,.ivu-btn-primary[disabled]:active>a:only-child,.ivu-btn-primary[disabled]:focus>a:only-child,.ivu-btn-primary[disabled]:hover>a:only-child,.ivu-btn-primary[disabled]>a:only-child,fieldset[disabled] .ivu-btn-primary.active>a:only-child,fieldset[disabled] .ivu-btn-primary:active>a:only-child,fieldset[disabled] .ivu-btn-primary:focus>a:only-child,fieldset[disabled] .ivu-btn-primary:hover>a:only-child,fieldset[disabled] .ivu-btn-primary>a:only-child{color:currentColor}.ivu-btn-primary.disabled.active>a:only-child:after,.ivu-btn-primary.disabled:active>a:only-child:after,.ivu-btn-primary.disabled:focus>a:only-child:after,.ivu-btn-primary.disabled:hover>a:only-child:after,.ivu-btn-primary.disabled>a:only-child:after,.ivu-btn-primary[disabled].active>a:only-child:after,.ivu-btn-primary[disabled]:active>a:only-child:after,.ivu-btn-primary[disabled]:focus>a:only-child:after,.ivu-btn-primary[disabled]:hover>a:only-child:after,.ivu-btn-primary[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-primary.active>a:only-child:after,fieldset[disabled] .ivu-btn-primary:active>a:only-child:after,fieldset[disabled] .ivu-btn-primary:focus>a:only-child:after,fieldset[disabled] .ivu-btn-primary:hover>a:only-child:after,fieldset[disabled] .ivu-btn-primary>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.active,.ivu-btn-primary:active,.ivu-btn-primary:hover{color:#fff}.ivu-btn-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:not(:first-child):not(:last-child){border-right-color:#2b85e4;border-left-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child){border-right-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#dcdee2}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary+.ivu-btn,.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:last-child:not(:first-child){border-left-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary+.ivu-btn[disabled],.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#dcdee2}.ivu-btn-group-vertical .ivu-btn-primary:not(:first-child):not(:last-child){border-top-color:#2b85e4;border-bottom-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary:first-child:not(:last-child){border-bottom-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary:first-child:not(:last-child)[disabled]{border-top-color:#dcdee2}.ivu-btn-group-vertical .ivu-btn-primary+.ivu-btn,.ivu-btn-group-vertical .ivu-btn-primary:last-child:not(:first-child){border-top-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary+.ivu-btn[disabled],.ivu-btn-group-vertical .ivu-btn-primary:last-child:not(:first-child)[disabled]{border-bottom-color:#dcdee2}.ivu-btn-dashed{color:#515a6e;background-color:#fff;border-color:#dcdee2;border-style:dashed}.ivu-btn-dashed>a:only-child{color:currentColor}.ivu-btn-dashed>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:hover{color:#747b8b;background-color:#fff;border-color:#e3e5e8}.ivu-btn-dashed:hover>a:only-child{color:currentColor}.ivu-btn-dashed:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.active,.ivu-btn-dashed:active{color:#4d5669;background-color:#f2f2f2;border-color:#f2f2f2}.ivu-btn-dashed.active>a:only-child,.ivu-btn-dashed:active>a:only-child{color:currentColor}.ivu-btn-dashed.active>a:only-child:after,.ivu-btn-dashed:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.disabled,.ivu-btn-dashed.disabled.active,.ivu-btn-dashed.disabled:active,.ivu-btn-dashed.disabled:focus,.ivu-btn-dashed.disabled:hover,.ivu-btn-dashed[disabled],.ivu-btn-dashed[disabled].active,.ivu-btn-dashed[disabled]:active,.ivu-btn-dashed[disabled]:focus,.ivu-btn-dashed[disabled]:hover,fieldset[disabled] .ivu-btn-dashed,fieldset[disabled] .ivu-btn-dashed.active,fieldset[disabled] .ivu-btn-dashed:active,fieldset[disabled] .ivu-btn-dashed:focus,fieldset[disabled] .ivu-btn-dashed:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-dashed.disabled.active>a:only-child,.ivu-btn-dashed.disabled:active>a:only-child,.ivu-btn-dashed.disabled:focus>a:only-child,.ivu-btn-dashed.disabled:hover>a:only-child,.ivu-btn-dashed.disabled>a:only-child,.ivu-btn-dashed[disabled].active>a:only-child,.ivu-btn-dashed[disabled]:active>a:only-child,.ivu-btn-dashed[disabled]:focus>a:only-child,.ivu-btn-dashed[disabled]:hover>a:only-child,.ivu-btn-dashed[disabled]>a:only-child,fieldset[disabled] .ivu-btn-dashed.active>a:only-child,fieldset[disabled] .ivu-btn-dashed:active>a:only-child,fieldset[disabled] .ivu-btn-dashed:focus>a:only-child,fieldset[disabled] .ivu-btn-dashed:hover>a:only-child,fieldset[disabled] .ivu-btn-dashed>a:only-child{color:currentColor}.ivu-btn-dashed.disabled.active>a:only-child:after,.ivu-btn-dashed.disabled:active>a:only-child:after,.ivu-btn-dashed.disabled:focus>a:only-child:after,.ivu-btn-dashed.disabled:hover>a:only-child:after,.ivu-btn-dashed.disabled>a:only-child:after,.ivu-btn-dashed[disabled].active>a:only-child:after,.ivu-btn-dashed[disabled]:active>a:only-child:after,.ivu-btn-dashed[disabled]:focus>a:only-child:after,.ivu-btn-dashed[disabled]:hover>a:only-child:after,.ivu-btn-dashed[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-dashed.active>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:active>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:focus>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:hover>a:only-child:after,fieldset[disabled] .ivu-btn-dashed>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:hover{color:#57a3f3;background-color:#fff;border-color:#57a3f3}.ivu-btn-dashed:hover>a:only-child{color:currentColor}.ivu-btn-dashed:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.active,.ivu-btn-dashed:active{color:#2b85e4;background-color:#fff;border-color:#2b85e4}.ivu-btn-dashed.active>a:only-child,.ivu-btn-dashed:active>a:only-child{color:currentColor}.ivu-btn-dashed.active>a:only-child:after,.ivu-btn-dashed:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-text{color:#515a6e;background-color:transparent;border-color:transparent}.ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:hover{color:#747b8b;background-color:rgba(255,255,255,.2);border-color:rgba(255,255,255,.2)}.ivu-btn-text:hover>a:only-child{color:currentColor}.ivu-btn-text:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.active,.ivu-btn-text:active{color:#4d5669;background-color:rgba(0,0,0,.05);border-color:rgba(0,0,0,.05)}.ivu-btn-text.active>a:only-child,.ivu-btn-text:active>a:only-child{color:currentColor}.ivu-btn-text.active>a:only-child:after,.ivu-btn-text:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.disabled,.ivu-btn-text.disabled.active,.ivu-btn-text.disabled:active,.ivu-btn-text.disabled:focus,.ivu-btn-text.disabled:hover,.ivu-btn-text[disabled],.ivu-btn-text[disabled].active,.ivu-btn-text[disabled]:active,.ivu-btn-text[disabled]:focus,.ivu-btn-text[disabled]:hover,fieldset[disabled] .ivu-btn-text,fieldset[disabled] .ivu-btn-text.active,fieldset[disabled] .ivu-btn-text:active,fieldset[disabled] .ivu-btn-text:focus,fieldset[disabled] .ivu-btn-text:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-text.disabled.active>a:only-child,.ivu-btn-text.disabled:active>a:only-child,.ivu-btn-text.disabled:focus>a:only-child,.ivu-btn-text.disabled:hover>a:only-child,.ivu-btn-text.disabled>a:only-child,.ivu-btn-text[disabled].active>a:only-child,.ivu-btn-text[disabled]:active>a:only-child,.ivu-btn-text[disabled]:focus>a:only-child,.ivu-btn-text[disabled]:hover>a:only-child,.ivu-btn-text[disabled]>a:only-child,fieldset[disabled] .ivu-btn-text.active>a:only-child,fieldset[disabled] .ivu-btn-text:active>a:only-child,fieldset[disabled] .ivu-btn-text:focus>a:only-child,fieldset[disabled] .ivu-btn-text:hover>a:only-child,fieldset[disabled] .ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text.disabled.active>a:only-child:after,.ivu-btn-text.disabled:active>a:only-child:after,.ivu-btn-text.disabled:focus>a:only-child:after,.ivu-btn-text.disabled:hover>a:only-child:after,.ivu-btn-text.disabled>a:only-child:after,.ivu-btn-text[disabled].active>a:only-child:after,.ivu-btn-text[disabled]:active>a:only-child:after,.ivu-btn-text[disabled]:focus>a:only-child:after,.ivu-btn-text[disabled]:hover>a:only-child:after,.ivu-btn-text[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-text.active>a:only-child:after,fieldset[disabled] .ivu-btn-text:active>a:only-child:after,fieldset[disabled] .ivu-btn-text:focus>a:only-child:after,fieldset[disabled] .ivu-btn-text:hover>a:only-child:after,fieldset[disabled] .ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.disabled,.ivu-btn-text.disabled.active,.ivu-btn-text.disabled:active,.ivu-btn-text.disabled:focus,.ivu-btn-text.disabled:hover,.ivu-btn-text[disabled],.ivu-btn-text[disabled].active,.ivu-btn-text[disabled]:active,.ivu-btn-text[disabled]:focus,.ivu-btn-text[disabled]:hover,fieldset[disabled] .ivu-btn-text,fieldset[disabled] .ivu-btn-text.active,fieldset[disabled] .ivu-btn-text:active,fieldset[disabled] .ivu-btn-text:focus,fieldset[disabled] .ivu-btn-text:hover{color:#c5c8ce;background-color:#fff;border-color:transparent}.ivu-btn-text.disabled.active>a:only-child,.ivu-btn-text.disabled:active>a:only-child,.ivu-btn-text.disabled:focus>a:only-child,.ivu-btn-text.disabled:hover>a:only-child,.ivu-btn-text.disabled>a:only-child,.ivu-btn-text[disabled].active>a:only-child,.ivu-btn-text[disabled]:active>a:only-child,.ivu-btn-text[disabled]:focus>a:only-child,.ivu-btn-text[disabled]:hover>a:only-child,.ivu-btn-text[disabled]>a:only-child,fieldset[disabled] .ivu-btn-text.active>a:only-child,fieldset[disabled] .ivu-btn-text:active>a:only-child,fieldset[disabled] .ivu-btn-text:focus>a:only-child,fieldset[disabled] .ivu-btn-text:hover>a:only-child,fieldset[disabled] .ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text.disabled.active>a:only-child:after,.ivu-btn-text.disabled:active>a:only-child:after,.ivu-btn-text.disabled:focus>a:only-child:after,.ivu-btn-text.disabled:hover>a:only-child:after,.ivu-btn-text.disabled>a:only-child:after,.ivu-btn-text[disabled].active>a:only-child:after,.ivu-btn-text[disabled]:active>a:only-child:after,.ivu-btn-text[disabled]:focus>a:only-child:after,.ivu-btn-text[disabled]:hover>a:only-child:after,.ivu-btn-text[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-text.active>a:only-child:after,fieldset[disabled] .ivu-btn-text:active>a:only-child:after,fieldset[disabled] .ivu-btn-text:focus>a:only-child:after,fieldset[disabled] .ivu-btn-text:hover>a:only-child:after,fieldset[disabled] .ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:hover{color:#57a3f3;background-color:#fff;border-color:transparent}.ivu-btn-text:hover>a:only-child{color:currentColor}.ivu-btn-text:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.active,.ivu-btn-text:active{color:#2b85e4;background-color:#fff;border-color:transparent}.ivu-btn-text.active>a:only-child,.ivu-btn-text:active>a:only-child{color:currentColor}.ivu-btn-text.active>a:only-child:after,.ivu-btn-text:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-success{color:#fff;background-color:#19be6b;border-color:#19be6b}.ivu-btn-success>a:only-child{color:currentColor}.ivu-btn-success>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success:hover{color:#fff;background-color:#47cb89;border-color:#47cb89}.ivu-btn-success:hover>a:only-child{color:currentColor}.ivu-btn-success:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.active,.ivu-btn-success:active{color:#f2f2f2;background-color:#18b566;border-color:#18b566}.ivu-btn-success.active>a:only-child,.ivu-btn-success:active>a:only-child{color:currentColor}.ivu-btn-success.active>a:only-child:after,.ivu-btn-success:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.disabled,.ivu-btn-success.disabled.active,.ivu-btn-success.disabled:active,.ivu-btn-success.disabled:focus,.ivu-btn-success.disabled:hover,.ivu-btn-success[disabled],.ivu-btn-success[disabled].active,.ivu-btn-success[disabled]:active,.ivu-btn-success[disabled]:focus,.ivu-btn-success[disabled]:hover,fieldset[disabled] .ivu-btn-success,fieldset[disabled] .ivu-btn-success.active,fieldset[disabled] .ivu-btn-success:active,fieldset[disabled] .ivu-btn-success:focus,fieldset[disabled] .ivu-btn-success:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-success.disabled.active>a:only-child,.ivu-btn-success.disabled:active>a:only-child,.ivu-btn-success.disabled:focus>a:only-child,.ivu-btn-success.disabled:hover>a:only-child,.ivu-btn-success.disabled>a:only-child,.ivu-btn-success[disabled].active>a:only-child,.ivu-btn-success[disabled]:active>a:only-child,.ivu-btn-success[disabled]:focus>a:only-child,.ivu-btn-success[disabled]:hover>a:only-child,.ivu-btn-success[disabled]>a:only-child,fieldset[disabled] .ivu-btn-success.active>a:only-child,fieldset[disabled] .ivu-btn-success:active>a:only-child,fieldset[disabled] .ivu-btn-success:focus>a:only-child,fieldset[disabled] .ivu-btn-success:hover>a:only-child,fieldset[disabled] .ivu-btn-success>a:only-child{color:currentColor}.ivu-btn-success.disabled.active>a:only-child:after,.ivu-btn-success.disabled:active>a:only-child:after,.ivu-btn-success.disabled:focus>a:only-child:after,.ivu-btn-success.disabled:hover>a:only-child:after,.ivu-btn-success.disabled>a:only-child:after,.ivu-btn-success[disabled].active>a:only-child:after,.ivu-btn-success[disabled]:active>a:only-child:after,.ivu-btn-success[disabled]:focus>a:only-child:after,.ivu-btn-success[disabled]:hover>a:only-child:after,.ivu-btn-success[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-success.active>a:only-child:after,fieldset[disabled] .ivu-btn-success:active>a:only-child:after,fieldset[disabled] .ivu-btn-success:focus>a:only-child:after,fieldset[disabled] .ivu-btn-success:hover>a:only-child:after,fieldset[disabled] .ivu-btn-success>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.active,.ivu-btn-success:active,.ivu-btn-success:hover{color:#fff}.ivu-btn-success:focus{-webkit-box-shadow:0 0 0 2px rgba(25,190,107,.2);box-shadow:0 0 0 2px rgba(25,190,107,.2)}.ivu-btn-warning{color:#fff;background-color:#f90;border-color:#f90}.ivu-btn-warning>a:only-child{color:currentColor}.ivu-btn-warning>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning:hover{color:#fff;background-color:#ffad33;border-color:#ffad33}.ivu-btn-warning:hover>a:only-child{color:currentColor}.ivu-btn-warning:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.active,.ivu-btn-warning:active{color:#f2f2f2;background-color:#f29100;border-color:#f29100}.ivu-btn-warning.active>a:only-child,.ivu-btn-warning:active>a:only-child{color:currentColor}.ivu-btn-warning.active>a:only-child:after,.ivu-btn-warning:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.disabled,.ivu-btn-warning.disabled.active,.ivu-btn-warning.disabled:active,.ivu-btn-warning.disabled:focus,.ivu-btn-warning.disabled:hover,.ivu-btn-warning[disabled],.ivu-btn-warning[disabled].active,.ivu-btn-warning[disabled]:active,.ivu-btn-warning[disabled]:focus,.ivu-btn-warning[disabled]:hover,fieldset[disabled] .ivu-btn-warning,fieldset[disabled] .ivu-btn-warning.active,fieldset[disabled] .ivu-btn-warning:active,fieldset[disabled] .ivu-btn-warning:focus,fieldset[disabled] .ivu-btn-warning:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-warning.disabled.active>a:only-child,.ivu-btn-warning.disabled:active>a:only-child,.ivu-btn-warning.disabled:focus>a:only-child,.ivu-btn-warning.disabled:hover>a:only-child,.ivu-btn-warning.disabled>a:only-child,.ivu-btn-warning[disabled].active>a:only-child,.ivu-btn-warning[disabled]:active>a:only-child,.ivu-btn-warning[disabled]:focus>a:only-child,.ivu-btn-warning[disabled]:hover>a:only-child,.ivu-btn-warning[disabled]>a:only-child,fieldset[disabled] .ivu-btn-warning.active>a:only-child,fieldset[disabled] .ivu-btn-warning:active>a:only-child,fieldset[disabled] .ivu-btn-warning:focus>a:only-child,fieldset[disabled] .ivu-btn-warning:hover>a:only-child,fieldset[disabled] .ivu-btn-warning>a:only-child{color:currentColor}.ivu-btn-warning.disabled.active>a:only-child:after,.ivu-btn-warning.disabled:active>a:only-child:after,.ivu-btn-warning.disabled:focus>a:only-child:after,.ivu-btn-warning.disabled:hover>a:only-child:after,.ivu-btn-warning.disabled>a:only-child:after,.ivu-btn-warning[disabled].active>a:only-child:after,.ivu-btn-warning[disabled]:active>a:only-child:after,.ivu-btn-warning[disabled]:focus>a:only-child:after,.ivu-btn-warning[disabled]:hover>a:only-child:after,.ivu-btn-warning[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-warning.active>a:only-child:after,fieldset[disabled] .ivu-btn-warning:active>a:only-child:after,fieldset[disabled] .ivu-btn-warning:focus>a:only-child:after,fieldset[disabled] .ivu-btn-warning:hover>a:only-child:after,fieldset[disabled] .ivu-btn-warning>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.active,.ivu-btn-warning:active,.ivu-btn-warning:hover{color:#fff}.ivu-btn-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(255,153,0,.2);box-shadow:0 0 0 2px rgba(255,153,0,.2)}.ivu-btn-error{color:#fff;background-color:#ed4014;border-color:#ed4014}.ivu-btn-error>a:only-child{color:currentColor}.ivu-btn-error>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error:hover{color:#fff;background-color:#f16643;border-color:#f16643}.ivu-btn-error:hover>a:only-child{color:currentColor}.ivu-btn-error:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.active,.ivu-btn-error:active{color:#f2f2f2;background-color:#e13d13;border-color:#e13d13}.ivu-btn-error.active>a:only-child,.ivu-btn-error:active>a:only-child{color:currentColor}.ivu-btn-error.active>a:only-child:after,.ivu-btn-error:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.disabled,.ivu-btn-error.disabled.active,.ivu-btn-error.disabled:active,.ivu-btn-error.disabled:focus,.ivu-btn-error.disabled:hover,.ivu-btn-error[disabled],.ivu-btn-error[disabled].active,.ivu-btn-error[disabled]:active,.ivu-btn-error[disabled]:focus,.ivu-btn-error[disabled]:hover,fieldset[disabled] .ivu-btn-error,fieldset[disabled] .ivu-btn-error.active,fieldset[disabled] .ivu-btn-error:active,fieldset[disabled] .ivu-btn-error:focus,fieldset[disabled] .ivu-btn-error:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-error.disabled.active>a:only-child,.ivu-btn-error.disabled:active>a:only-child,.ivu-btn-error.disabled:focus>a:only-child,.ivu-btn-error.disabled:hover>a:only-child,.ivu-btn-error.disabled>a:only-child,.ivu-btn-error[disabled].active>a:only-child,.ivu-btn-error[disabled]:active>a:only-child,.ivu-btn-error[disabled]:focus>a:only-child,.ivu-btn-error[disabled]:hover>a:only-child,.ivu-btn-error[disabled]>a:only-child,fieldset[disabled] .ivu-btn-error.active>a:only-child,fieldset[disabled] .ivu-btn-error:active>a:only-child,fieldset[disabled] .ivu-btn-error:focus>a:only-child,fieldset[disabled] .ivu-btn-error:hover>a:only-child,fieldset[disabled] .ivu-btn-error>a:only-child{color:currentColor}.ivu-btn-error.disabled.active>a:only-child:after,.ivu-btn-error.disabled:active>a:only-child:after,.ivu-btn-error.disabled:focus>a:only-child:after,.ivu-btn-error.disabled:hover>a:only-child:after,.ivu-btn-error.disabled>a:only-child:after,.ivu-btn-error[disabled].active>a:only-child:after,.ivu-btn-error[disabled]:active>a:only-child:after,.ivu-btn-error[disabled]:focus>a:only-child:after,.ivu-btn-error[disabled]:hover>a:only-child:after,.ivu-btn-error[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-error.active>a:only-child:after,fieldset[disabled] .ivu-btn-error:active>a:only-child:after,fieldset[disabled] .ivu-btn-error:focus>a:only-child:after,fieldset[disabled] .ivu-btn-error:hover>a:only-child:after,fieldset[disabled] .ivu-btn-error>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.active,.ivu-btn-error:active,.ivu-btn-error:hover{color:#fff}.ivu-btn-error:focus{-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-btn-info{color:#fff;background-color:#2db7f5;border-color:#2db7f5}.ivu-btn-info>a:only-child{color:currentColor}.ivu-btn-info>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info:hover{color:#fff;background-color:#57c5f7;border-color:#57c5f7}.ivu-btn-info:hover>a:only-child{color:currentColor}.ivu-btn-info:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.active,.ivu-btn-info:active{color:#f2f2f2;background-color:#2baee9;border-color:#2baee9}.ivu-btn-info.active>a:only-child,.ivu-btn-info:active>a:only-child{color:currentColor}.ivu-btn-info.active>a:only-child:after,.ivu-btn-info:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.disabled,.ivu-btn-info.disabled.active,.ivu-btn-info.disabled:active,.ivu-btn-info.disabled:focus,.ivu-btn-info.disabled:hover,.ivu-btn-info[disabled],.ivu-btn-info[disabled].active,.ivu-btn-info[disabled]:active,.ivu-btn-info[disabled]:focus,.ivu-btn-info[disabled]:hover,fieldset[disabled] .ivu-btn-info,fieldset[disabled] .ivu-btn-info.active,fieldset[disabled] .ivu-btn-info:active,fieldset[disabled] .ivu-btn-info:focus,fieldset[disabled] .ivu-btn-info:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-info.disabled.active>a:only-child,.ivu-btn-info.disabled:active>a:only-child,.ivu-btn-info.disabled:focus>a:only-child,.ivu-btn-info.disabled:hover>a:only-child,.ivu-btn-info.disabled>a:only-child,.ivu-btn-info[disabled].active>a:only-child,.ivu-btn-info[disabled]:active>a:only-child,.ivu-btn-info[disabled]:focus>a:only-child,.ivu-btn-info[disabled]:hover>a:only-child,.ivu-btn-info[disabled]>a:only-child,fieldset[disabled] .ivu-btn-info.active>a:only-child,fieldset[disabled] .ivu-btn-info:active>a:only-child,fieldset[disabled] .ivu-btn-info:focus>a:only-child,fieldset[disabled] .ivu-btn-info:hover>a:only-child,fieldset[disabled] .ivu-btn-info>a:only-child{color:currentColor}.ivu-btn-info.disabled.active>a:only-child:after,.ivu-btn-info.disabled:active>a:only-child:after,.ivu-btn-info.disabled:focus>a:only-child:after,.ivu-btn-info.disabled:hover>a:only-child:after,.ivu-btn-info.disabled>a:only-child:after,.ivu-btn-info[disabled].active>a:only-child:after,.ivu-btn-info[disabled]:active>a:only-child:after,.ivu-btn-info[disabled]:focus>a:only-child:after,.ivu-btn-info[disabled]:hover>a:only-child:after,.ivu-btn-info[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-info.active>a:only-child:after,fieldset[disabled] .ivu-btn-info:active>a:only-child:after,fieldset[disabled] .ivu-btn-info:focus>a:only-child:after,fieldset[disabled] .ivu-btn-info:hover>a:only-child:after,fieldset[disabled] .ivu-btn-info>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.active,.ivu-btn-info:active,.ivu-btn-info:hover{color:#fff}.ivu-btn-info:focus{-webkit-box-shadow:0 0 0 2px rgba(45,183,245,.2);box-shadow:0 0 0 2px rgba(45,183,245,.2)}.ivu-btn-circle,.ivu-btn-circle-outline{border-radius:32px}.ivu-btn-circle-outline.ivu-btn-large,.ivu-btn-circle.ivu-btn-large{border-radius:40px}.ivu-btn-circle-outline.ivu-btn-size,.ivu-btn-circle.ivu-btn-size{border-radius:24px}.ivu-btn-circle-outline.ivu-btn-icon-only,.ivu-btn-circle.ivu-btn-icon-only{width:32px;height:32px;padding:0;font-size:16px;border-radius:50%}.ivu-btn-circle-outline.ivu-btn-icon-only.ivu-btn-large,.ivu-btn-circle.ivu-btn-icon-only.ivu-btn-large{width:40px;height:40px;padding:0;font-size:18px;border-radius:50%}.ivu-btn-circle-outline.ivu-btn-icon-only.ivu-btn-small,.ivu-btn-circle.ivu-btn-icon-only.ivu-btn-small{width:24px;height:24px;padding:0;font-size:14px;border-radius:50%}.ivu-btn:before{position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;background:#fff;opacity:.35;content:'';border-radius:inherit;z-index:1;-webkit-transition:opacity .2s;transition:opacity .2s;pointer-events:none;display:none}.ivu-btn.ivu-btn-loading{pointer-events:none;position:relative}.ivu-btn.ivu-btn-loading:before{display:block}.ivu-btn-group{position:relative;display:inline-block;vertical-align:middle}.ivu-btn-group>.ivu-btn{position:relative;float:left}.ivu-btn-group>.ivu-btn.active,.ivu-btn-group>.ivu-btn:active,.ivu-btn-group>.ivu-btn:hover{z-index:2}.ivu-btn-group-circle .ivu-btn{border-radius:32px}.ivu-btn-group-large.ivu-btn-group-circle .ivu-btn{border-radius:40px}.ivu-btn-group-large>.ivu-btn{height:40px;padding:0 15px;font-size:16px;border-radius:4px}.ivu-btn-group-small.ivu-btn-group-circle .ivu-btn{border-radius:24px}.ivu-btn-group-small>.ivu-btn{height:24px;padding:0 7px;font-size:14px;border-radius:3px}.ivu-btn-group-small>.ivu-btn>.ivu-icon{font-size:14px}.ivu-btn-group-small .ivu-btn-icon-only{width:24px;height:24px;padding:0}.ivu-btn-group-large .ivu-btn-icon-only{width:40px;height:40px;padding:0}.ivu-btn+.ivu-btn-group,.ivu-btn-group .ivu-btn+.ivu-btn,.ivu-btn-group+.ivu-btn,.ivu-btn-group+.ivu-btn-group{margin-left:-1px}.ivu-btn-group .ivu-btn:not(:first-child):not(:last-child){border-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:first-child{margin-left:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ivu-btn-group>.ivu-btn-group{float:left}.ivu-btn-group>.ivu-btn-group:not(:first-child):not(:last-child)>.ivu-btn{border-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn-group:first-child:not(:last-child)>.ivu-btn:last-child{border-bottom-right-radius:0;border-top-right-radius:0;padding-right:8px}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn-group:last-child:not(:first-child)>.ivu-btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px}.ivu-btn-group-vertical{display:inline-block;vertical-align:middle}.ivu-btn-group-vertical>.ivu-btn{display:block;width:100%;max-width:100%;float:none;min-width:32px}.ivu-btn-group-vertical.ivu-btn-group-small>.ivu-btn{min-width:24px}.ivu-btn-group-vertical.ivu-btn-group-large>.ivu-btn{min-width:40px}.ivu-btn+.ivu-btn-group-vertical,.ivu-btn-group-vertical .ivu-btn+.ivu-btn,.ivu-btn-group-vertical+.ivu-btn,.ivu-btn-group-vertical+.ivu-btn-group-vertical{margin-top:-1px;margin-left:0}.ivu-btn-group-vertical>.ivu-btn:first-child{margin-top:0}.ivu-btn-group-vertical>.ivu-btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0}.ivu-btn-group-vertical>.ivu-btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.ivu-btn-group-vertical>.ivu-btn-group-vertical:first-child:not(:last-child)>.ivu-btn:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:8px}.ivu-btn-group-vertical>.ivu-btn-group-vertical:last-child:not(:first-child)>.ivu-btn:first-child{border-bottom-right-radius:0;border-bottom-left-radius:0;padding-top:8px}.ivu-btn-ghost{color:#fff;background:0 0}.ivu-btn-ghost:hover{background:0 0}.ivu-btn-ghost.ivu-btn-dashed,.ivu-btn-ghost.ivu-btn-default{color:#fff;border-color:#fff}.ivu-btn-ghost.ivu-btn-dashed:hover,.ivu-btn-ghost.ivu-btn-default:hover{color:#57a3f3;border-color:#57a3f3}.ivu-btn-ghost.ivu-btn-primary{color:#2d8cf0}.ivu-btn-ghost.ivu-btn-primary:hover{color:#57a3f3;background:rgba(245,249,254,.5)}.ivu-btn-ghost.ivu-btn-info{color:#2db7f5}.ivu-btn-ghost.ivu-btn-info:hover{color:#57c5f7;background:rgba(245,251,254,.5)}.ivu-btn-ghost.ivu-btn-success{color:#19be6b}.ivu-btn-ghost.ivu-btn-success:hover{color:#47cb89;background:rgba(244,252,248,.5)}.ivu-btn-ghost.ivu-btn-warning{color:#f90}.ivu-btn-ghost.ivu-btn-warning:hover{color:#ffad33;background:rgba(255,250,242,.5)}.ivu-btn-ghost.ivu-btn-error{color:#ed4014}.ivu-btn-ghost.ivu-btn-error:hover{color:#f16643;background:rgba(254,245,243,.5)}.ivu-btn-ghost.ivu-btn-dashed[disabled],.ivu-btn-ghost.ivu-btn-default[disabled],.ivu-btn-ghost.ivu-btn-error[disabled],.ivu-btn-ghost.ivu-btn-info[disabled],.ivu-btn-ghost.ivu-btn-primary[disabled],.ivu-btn-ghost.ivu-btn-success[disabled],.ivu-btn-ghost.ivu-btn-warning[disabled]{background:0 0;color:rgba(0,0,0,.25);border-color:#dcdee2}.ivu-btn-ghost.ivu-btn-text[disabled]{background:0 0;color:rgba(0,0,0,.25)}a.ivu-btn{padding-top:.1px;line-height:30px}a.ivu-btn-large{line-height:38px}a.ivu-btn-small{line-height:22px}.ivu-affix{position:fixed;z-index:10}.ivu-back-top{z-index:10;position:fixed;cursor:pointer;display:none}.ivu-back-top.ivu-back-top-show{display:block}.ivu-back-top-inner{background-color:rgba(0,0,0,.6);border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.2);box-shadow:0 1px 3px rgba(0,0,0,.2);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-back-top-inner:hover{background-color:rgba(0,0,0,.7)}.ivu-back-top i{color:#fff;font-size:24px;padding:8px 12px}.ivu-badge{position:relative;display:inline-block}.ivu-badge-count{font-family:\"Monospaced Number\";line-height:1;vertical-align:middle;position:absolute;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);top:-10px;right:0;height:20px;border-radius:10px;min-width:20px;background:#ed4014;border:1px solid transparent;color:#fff;line-height:18px;text-align:center;padding:0 6px;font-size:12px;white-space:nowrap;-webkit-transform-origin:-10% center;-ms-transform-origin:-10% center;transform-origin:-10% center;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ivu-badge-count-custom{background:0 0;color:inherit;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.ivu-badge-count a,.ivu-badge-count a:hover{color:#fff}.ivu-badge-count-alone{top:auto;display:block;position:relative;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ivu-badge-count-primary{background:#2d8cf0}.ivu-badge-count-success{background:#19be6b}.ivu-badge-count-error{background:#ed4014}.ivu-badge-count-warning{background:#f90}.ivu-badge-count-info{background:#2db7f5}.ivu-badge-count-normal{background:#e6ebf1;color:#808695}.ivu-badge-dot{position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);-webkit-transform-origin:0 center;-ms-transform-origin:0 center;transform-origin:0 center;top:-4px;right:-8px;height:8px;width:8px;border-radius:100%;background:#ed4014;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ivu-badge-status{line-height:inherit;vertical-align:baseline}.ivu-badge-status-dot{width:6px;height:6px;display:inline-block;border-radius:50%;vertical-align:middle;position:relative;top:-1px}.ivu-badge-status-success{background-color:#19be6b}.ivu-badge-status-processing{background-color:#2d8cf0;position:relative}.ivu-badge-status-processing:after{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;border:1px solid #2d8cf0;content:'';-webkit-animation:aniStatusProcessing 1.2s infinite ease-in-out;animation:aniStatusProcessing 1.2s infinite ease-in-out}.ivu-badge-status-default{background-color:#e6ebf1}.ivu-badge-status-error{background-color:#ed4014}.ivu-badge-status-warning{background-color:#f90}.ivu-badge-status-text{display:inline-block;color:#515a6e;font-size:14px;margin-left:6px}.ivu-badge-status-pink{background-color:#eb2f96}.ivu-badge-status-magenta{background-color:#eb2f96}.ivu-badge-status-red{background-color:#f5222d}.ivu-badge-status-volcano{background-color:#fa541c}.ivu-badge-status-orange{background-color:#fa8c16}.ivu-badge-status-yellow{background-color:#fadb14}.ivu-badge-status-gold{background-color:#faad14}.ivu-badge-status-cyan{background-color:#13c2c2}.ivu-badge-status-lime{background-color:#a0d911}.ivu-badge-status-green{background-color:#52c41a}.ivu-badge-status-blue{background-color:#1890ff}.ivu-badge-status-geekblue{background-color:#2f54eb}.ivu-badge-status-purple{background-color:#722ed1}@-webkit-keyframes aniStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}100%{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}@keyframes aniStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}100%{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}.ivu-chart-circle{display:inline-block;position:relative}.ivu-chart-circle-inner{width:100%;text-align:center;position:absolute;left:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);line-height:1}.ivu-spin{color:#2d8cf0;vertical-align:middle;text-align:center}.ivu-spin-dot{position:relative;display:block;border-radius:50%;background-color:#2d8cf0;width:20px;height:20px;-webkit-animation:ani-spin-bounce 1s 0s ease-in-out infinite;animation:ani-spin-bounce 1s 0s ease-in-out infinite}.ivu-spin-large .ivu-spin-dot{width:32px;height:32px}.ivu-spin-small .ivu-spin-dot{width:12px;height:12px}.ivu-spin-fix{position:absolute;top:0;left:0;z-index:8;width:100%;height:100%;background-color:rgba(255,255,255,.9)}.ivu-spin-fullscreen{z-index:2010}.ivu-spin-fullscreen-wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.ivu-spin-fix .ivu-spin-main{position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ivu-spin-fix .ivu-spin-dot{display:inline-block}.ivu-spin-show-text .ivu-spin-dot,.ivu-spin-text{display:none}.ivu-spin-show-text .ivu-spin-text{display:block}.ivu-table-wrapper>.ivu-spin-fix{border:1px solid #dcdee2;border-top:0;border-left:0}@-webkit-keyframes ani-spin-bounce{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@keyframes ani-spin-bounce{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.ivu-alert{position:relative;padding:8px 48px 8px 16px;border-radius:4px;color:#515a6e;font-size:14px;line-height:16px;margin-bottom:10px}.ivu-alert.ivu-alert-with-icon{padding:8px 48px 8px 38px}.ivu-alert-icon{font-size:16px;top:6px;left:12px;position:absolute}.ivu-alert-desc{font-size:14px;color:#515a6e;line-height:21px;display:none;text-align:justify}.ivu-alert-success{border:1px solid #8ce6b0;background-color:#edfff3}.ivu-alert-success .ivu-alert-icon{color:#19be6b}.ivu-alert-info{border:1px solid #abdcff;background-color:#f0faff}.ivu-alert-info .ivu-alert-icon{color:#2d8cf0}.ivu-alert-warning{border:1px solid #ffd77a;background-color:#fff9e6}.ivu-alert-warning .ivu-alert-icon{color:#f90}.ivu-alert-error{border:1px solid #ffb08f;background-color:#ffefe6}.ivu-alert-error .ivu-alert-icon{color:#ed4014}.ivu-alert-close{font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-alert-close .ivu-icon-ios-close{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-alert-close .ivu-icon-ios-close:hover{color:#444}.ivu-alert-with-desc{padding:16px;position:relative;border-radius:4px;margin-bottom:10px;color:#515a6e;line-height:1.5}.ivu-alert-with-desc.ivu-alert-with-icon{padding:16px 16px 16px 69px}.ivu-alert-with-desc .ivu-alert-desc{display:block}.ivu-alert-with-desc .ivu-alert-message{font-size:16px;color:#17233d;display:block;margin-bottom:4px}.ivu-alert-with-desc .ivu-alert-icon{top:50%;left:24px;margin-top:-24px;font-size:28px}.ivu-alert-with-banner{border-radius:0}.ivu-collapse{background-color:#f7f7f7;border-radius:3px;border:1px solid #dcdee2}.ivu-collapse-simple{border-left:none;border-right:none;background-color:#fff;border-radius:0}.ivu-collapse>.ivu-collapse-item{border-top:1px solid #dcdee2}.ivu-collapse>.ivu-collapse-item:first-child{border-top:0}.ivu-collapse>.ivu-collapse-item>.ivu-collapse-header{height:38px;line-height:38px;padding-left:16px;color:#666;cursor:pointer;position:relative;border-bottom:1px solid transparent;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-collapse>.ivu-collapse-item>.ivu-collapse-header>i{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;margin-right:14px}.ivu-collapse>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header{border-bottom:1px solid #dcdee2}.ivu-collapse-simple>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header{border-bottom:1px solid transparent}.ivu-collapse>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header>i{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-collapse-content{color:#515a6e;padding:0 16px;background-color:#fff}.ivu-collapse-content>.ivu-collapse-content-box{padding-top:16px;padding-bottom:16px}.ivu-collapse-simple>.ivu-collapse-item>.ivu-collapse-content>.ivu-collapse-content-box{padding-top:0}.ivu-collapse-item:last-child>.ivu-collapse-content{border-radius:0 0 3px 3px}.ivu-card{display:block;background:#fff;border-radius:4px;font-size:14px;position:relative;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-card-bordered{border:1px solid #dcdee2;border-color:#e8eaec}.ivu-card-shadow{-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.ivu-card:hover{-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);border-color:#eee}.ivu-card.ivu-card-dis-hover:hover{-webkit-box-shadow:none;box-shadow:none;border-color:transparent}.ivu-card.ivu-card-dis-hover.ivu-card-bordered:hover{border-color:#e8eaec}.ivu-card.ivu-card-shadow:hover{-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.ivu-card-head{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-card-head p,.ivu-card-head-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-card-extra{position:absolute;right:16px;top:14px}.ivu-card-body{padding:16px}.ivu-message{font-size:14px;position:fixed;z-index:1010;width:100%;top:16px;left:0;pointer-events:none}.ivu-message-notice{padding:8px;text-align:center;-webkit-transition:height .3s ease-in-out,padding .3s ease-in-out;transition:height .3s ease-in-out,padding .3s ease-in-out}.ivu-message-notice:first-child{margin-top:-8px}.ivu-message-notice-close{position:absolute;right:4px;top:10px;color:#999;outline:0}.ivu-message-notice-close i.ivu-icon{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-message-notice-close i.ivu-icon:hover{color:#444}.ivu-message-notice-content{display:inline-block;pointer-events:all;padding:8px 16px;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);background:#fff;position:relative}.ivu-message-notice-content-text{display:inline-block}.ivu-message-notice-closable .ivu-message-notice-content-text{padding-right:32px}.ivu-message-success .ivu-icon{color:#19be6b}.ivu-message-error .ivu-icon{color:#ed4014}.ivu-message-warning .ivu-icon{color:#f90}.ivu-message-info .ivu-icon,.ivu-message-loading .ivu-icon{color:#2d8cf0}.ivu-message .ivu-icon{margin-right:4px;font-size:16px;vertical-align:middle}.ivu-message-custom-content span{vertical-align:middle}.ivu-message-notice-with-background .ivu-message-notice-content-background{-webkit-box-shadow:none;box-shadow:none}.ivu-message-notice-with-background .ivu-message-notice-content-info{background:#f0faff;color:#2e8bf0;border:1px solid #d4eeff}.ivu-message-notice-with-background .ivu-message-notice-content-success{background:#edfff3;color:#19bf6c;border:1px solid #bbf2cf}.ivu-message-notice-with-background .ivu-message-notice-content-warning{background:#fff9e6;color:#f90;border:1px solid #ffe7a3}.ivu-message-notice-with-background .ivu-message-notice-content-error{background:#ffefe6;color:#ed3f13;border:1px solid #ffcfb8}.ivu-notice{width:335px;margin-right:24px;position:fixed;z-index:1010}.ivu-notice-content-with-icon{margin-left:51px}.ivu-notice-with-desc.ivu-notice-with-icon .ivu-notice-title{margin-left:51px}.ivu-notice-notice{margin-bottom:10px;padding:16px;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);background:#fff;line-height:1;position:relative;overflow:hidden}.ivu-notice-notice-close{position:absolute;right:8px;top:15px;color:#999;outline:0}.ivu-notice-notice-close i{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-notice-notice-close i:hover{color:#444}.ivu-notice-notice-content-with-render .ivu-notice-desc{display:none}.ivu-notice-notice-with-desc .ivu-notice-notice-close{top:11px}.ivu-notice-content-with-render-notitle{margin-left:26px}.ivu-notice-title{font-size:16px;line-height:19px;color:#17233d;padding-right:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-notice-with-desc .ivu-notice-title{margin-bottom:8px}.ivu-notice-desc{font-size:14px;color:#515a6e;text-align:justify;line-height:1.5}.ivu-notice-with-desc.ivu-notice-with-icon .ivu-notice-desc{margin-left:51px}.ivu-notice-with-icon .ivu-notice-title{margin-left:26px}.ivu-notice-icon{position:absolute;top:-2px;font-size:20px}.ivu-notice-icon-success{color:#19be6b}.ivu-notice-icon-info{color:#2d8cf0}.ivu-notice-icon-warning{color:#f90}.ivu-notice-icon-error{color:#ed4014}.ivu-notice-with-desc .ivu-notice-icon{font-size:36px;top:-6px}.ivu-notice-custom-content{position:relative}.ivu-radio-focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);z-index:1}.ivu-radio-group{display:inline-block;font-size:14px;vertical-align:middle}.ivu-radio-group-vertical .ivu-radio-wrapper{display:block;height:30px;line-height:30px}.ivu-radio-wrapper{font-size:14px;vertical-align:middle;display:inline-block;position:relative;white-space:nowrap;margin-right:8px;cursor:pointer}.ivu-radio-wrapper-disabled{cursor:not-allowed}.ivu-radio{display:inline-block;margin-right:4px;white-space:nowrap;position:relative;line-height:1;vertical-align:middle;cursor:pointer}.ivu-radio:hover .ivu-radio-inner{border-color:#bcbcbc}.ivu-radio-inner{display:inline-block;width:16px;height:16px;position:relative;top:0;left:0;background-color:#fff;border:1px solid #dcdee2;border-radius:50%;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-inner:after{position:absolute;width:10px;height:10px;left:2px;top:2px;border-radius:6px;display:table;border-top:0;border-left:0;content:' ';background-color:#2d8cf0;opacity:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.ivu-radio-large{font-size:16px}.ivu-radio-large .ivu-radio-inner{width:18px;height:18px}.ivu-radio-large .ivu-radio-inner:after{width:12px;height:12px}.ivu-radio-large .ivu-radio-wrapper,.ivu-radio-large.ivu-radio-wrapper{font-size:16px}.ivu-radio-small .ivu-radio-inner{width:14px;height:14px}.ivu-radio-small .ivu-radio-inner:after{width:8px;height:8px}.ivu-radio-input{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;opacity:0;cursor:pointer}.ivu-radio-border{border:1px solid #dcdee2;border-radius:4px;height:32px;line-height:30px;padding:0 15px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.ivu-radio-group-small .ivu-radio-border,.ivu-radio-small.ivu-radio-border{height:24px;line-height:22px;padding:0 7px}.ivu-radio-group-large .ivu-radio-border,.ivu-radio-large.ivu-radio-border{height:40px;line-height:36px;padding:0 15px}.ivu-radio-wrapper-checked.ivu-radio-border{border-color:#2d8cf0}.ivu-radio-wrapper-disabled.ivu-radio-border{border-color:#dcdee2}.ivu-radio-checked .ivu-radio-inner{border-color:#2d8cf0}.ivu-radio-checked .ivu-radio-inner:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-checked:hover .ivu-radio-inner{border-color:#2d8cf0}.ivu-radio-disabled{cursor:not-allowed}.ivu-radio-disabled .ivu-radio-input{cursor:not-allowed}.ivu-radio-disabled:hover .ivu-radio-inner{border-color:#dcdee2}.ivu-radio-disabled .ivu-radio-inner{border-color:#dcdee2;background-color:#f3f3f3}.ivu-radio-disabled .ivu-radio-inner:after{background-color:#ccc}.ivu-radio-disabled .ivu-radio-disabled+span{color:#ccc}span.ivu-radio+*{margin-left:2px;margin-right:2px}.ivu-radio-group-button{font-size:0;-webkit-text-size-adjust:none}.ivu-radio-group-button .ivu-radio{width:0;margin-right:0}.ivu-radio-group-button .ivu-radio-wrapper{display:inline-block;height:32px;line-height:30px;margin:0;padding:0 15px;font-size:14px;color:#515a6e;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer;border:1px solid #dcdee2;border-left:0;background:#fff;position:relative}.ivu-radio-group-button .ivu-radio-wrapper>span{margin-left:0}.ivu-radio-group-button .ivu-radio-wrapper:after,.ivu-radio-group-button .ivu-radio-wrapper:before{content:'';display:block;position:absolute;width:1px;height:100%;left:-1px;top:0;background:#dcdee2;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-group-button .ivu-radio-wrapper:after{height:36px;left:-1px;top:-3px;background:rgba(45,140,240,.2);opacity:0}.ivu-radio-group-button .ivu-radio-wrapper:first-child{border-radius:4px 0 0 4px;border-left:1px solid #dcdee2}.ivu-radio-group-button .ivu-radio-wrapper:first-child:after,.ivu-radio-group-button .ivu-radio-wrapper:first-child:before{display:none}.ivu-radio-group-button .ivu-radio-wrapper:last-child{border-radius:0 4px 4px 0}.ivu-radio-group-button .ivu-radio-wrapper:first-child:last-child{border-radius:4px}.ivu-radio-group-button .ivu-radio-wrapper:hover{position:relative;color:#2d8cf0}.ivu-radio-group-button .ivu-radio-wrapper:hover .ivu-radio{background-color:#000}.ivu-radio-group-button .ivu-radio-wrapper .ivu-radio-inner,.ivu-radio-group-button .ivu-radio-wrapper input{opacity:0;width:0;height:0}.ivu-radio-group-button .ivu-radio-wrapper-checked{background:#fff;border-color:#2d8cf0;color:#2d8cf0;-webkit-box-shadow:-1px 0 0 0 #2d8cf0;box-shadow:-1px 0 0 0 #2d8cf0;z-index:1}.ivu-radio-group-button .ivu-radio-wrapper-checked:before{background:#2d8cf0;opacity:.1}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus{-webkit-box-shadow:-1px 0 0 0 #2d8cf0,0 0 0 2px rgba(45,140,240,.2);box-shadow:-1px 0 0 0 #2d8cf0,0 0 0 2px rgba(45,140,240,.2);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus:after{left:-3px;top:-3px;opacity:1;background:rgba(45,140,240,.2)}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus:first-child{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-radio-group-button .ivu-radio-wrapper-checked:first-child{border-color:#2d8cf0;-webkit-box-shadow:none;box-shadow:none}.ivu-radio-group-button .ivu-radio-wrapper-checked:hover{border-color:#57a3f3;color:#57a3f3}.ivu-radio-group-button .ivu-radio-wrapper-checked:active{border-color:#2b85e4;color:#2b85e4}.ivu-radio-group-button .ivu-radio-wrapper-disabled{border-color:#dcdee2;background-color:#f7f7f7;cursor:not-allowed;color:#ccc}.ivu-radio-group-button .ivu-radio-wrapper-disabled:first-child,.ivu-radio-group-button .ivu-radio-wrapper-disabled:hover{border-color:#dcdee2;background-color:#f7f7f7;color:#ccc}.ivu-radio-group-button .ivu-radio-wrapper-disabled:first-child{border-left-color:#dcdee2}.ivu-radio-group-button .ivu-radio-wrapper-disabled.ivu-radio-wrapper-checked{color:#fff;background-color:#e6e6e6;border-color:#dcdee2;-webkit-box-shadow:none!important;box-shadow:none!important}.ivu-radio-group-button.ivu-radio-group-large .ivu-radio-wrapper{height:40px;line-height:38px;font-size:16px}.ivu-radio-group-button.ivu-radio-group-large .ivu-radio-wrapper:after{height:44px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper{height:24px;line-height:22px;padding:0 12px;font-size:14px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:after{height:28px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:first-child{border-radius:3px 0 0 3px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:last-child{border-radius:0 3px 3px 0}.ivu-checkbox-focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);z-index:1}.ivu-checkbox{display:inline-block;vertical-align:middle;white-space:nowrap;cursor:pointer;line-height:1;position:relative}.ivu-checkbox-disabled{cursor:not-allowed}.ivu-checkbox:hover .ivu-checkbox-inner{border-color:#bcbcbc}.ivu-checkbox-inner{display:inline-block;width:16px;height:16px;position:relative;top:0;left:0;border:1px solid #dcdee2;border-radius:2px;background-color:#fff;-webkit-transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-checkbox-inner:after{content:'';display:table;width:4px;height:8px;position:absolute;top:1px;left:4px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(0);-ms-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-checkbox-large .ivu-checkbox-inner{width:18px;height:18px}.ivu-checkbox-large .ivu-checkbox-inner:after{width:5px;height:9px}.ivu-checkbox-small{font-size:14px}.ivu-checkbox-small .ivu-checkbox-inner{width:14px;height:14px}.ivu-checkbox-small .ivu-checkbox-inner:after{top:0;left:3px}.ivu-checkbox-input{width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;cursor:pointer;opacity:0}.ivu-checkbox-input[disabled]{cursor:not-allowed}.ivu-checkbox-border{border:1px solid #dcdee2;border-radius:4px;height:32px;line-height:30px;padding:0 15px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.ivu-checkbox-group.ivu-checkbox-small .ivu-checkbox-border,.ivu-checkbox-small.ivu-checkbox-border{height:24px;line-height:22px;padding:0 7px}.ivu-checkbox-group.ivu-checkbox-large .ivu-checkbox-border,.ivu-checkbox-large.ivu-checkbox-border{height:40px;line-height:36px;padding:0 15px}.ivu-checkbox-wrapper-checked.ivu-checkbox-border{border-color:#2d8cf0}.ivu-checkbox-wrapper-disabled.ivu-checkbox-border{border-color:#dcdee2}.ivu-checkbox-checked:hover .ivu-checkbox-inner{border-color:#2d8cf0}.ivu-checkbox-checked .ivu-checkbox-inner{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-checkbox-checked .ivu-checkbox-inner:after{content:'';display:table;width:4px;height:8px;position:absolute;top:2px;left:5px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1);-ms-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-checkbox-large .ivu-checkbox-checked .ivu-checkbox-inner:after{width:6px;height:10px}.ivu-checkbox-small .ivu-checkbox-checked .ivu-checkbox-inner:after{top:1px;left:4px}.ivu-checkbox-disabled.ivu-checkbox-checked:hover .ivu-checkbox-inner{border-color:#dcdee2}.ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner{background-color:#f3f3f3;border-color:#dcdee2}.ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#ccc}.ivu-checkbox-disabled:hover .ivu-checkbox-inner{border-color:#dcdee2}.ivu-checkbox-disabled .ivu-checkbox-inner{border-color:#dcdee2;background-color:#f3f3f3}.ivu-checkbox-disabled .ivu-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#f3f3f3}.ivu-checkbox-disabled .ivu-checkbox-inner-input{cursor:default}.ivu-checkbox-disabled+span{color:#ccc;cursor:not-allowed}.ivu-checkbox-indeterminate .ivu-checkbox-inner:after{content:'';width:10px;height:1px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);position:absolute;left:2px;top:6px}.ivu-checkbox-indeterminate:hover .ivu-checkbox-inner{border-color:#2d8cf0}.ivu-checkbox-indeterminate .ivu-checkbox-inner{background-color:#2d8cf0;border-color:#2d8cf0}.ivu-checkbox-indeterminate.ivu-checkbox-disabled .ivu-checkbox-inner{background-color:#f3f3f3;border-color:#dcdee2}.ivu-checkbox-indeterminate.ivu-checkbox-disabled .ivu-checkbox-inner:after{border-color:#c5c8ce}.ivu-checkbox-large .ivu-checkbox-indeterminate .ivu-checkbox-inner:after{width:12px;top:7px}.ivu-checkbox-small .ivu-checkbox-indeterminate .ivu-checkbox-inner:after{width:8px;top:5px}.ivu-checkbox-wrapper{cursor:pointer;font-size:14px;display:inline-block;margin-right:8px}.ivu-checkbox-wrapper-disabled{cursor:not-allowed}.ivu-checkbox-wrapper.ivu-checkbox-large{font-size:16px}.ivu-checkbox+span,.ivu-checkbox-wrapper+span{margin-right:4px}.ivu-checkbox-group{font-size:14px}.ivu-checkbox-group-item{display:inline-block}.ivu-switch{display:inline-block;width:44px;height:22px;line-height:20px;border-radius:22px;vertical-align:middle;border:1px solid #ccc;background-color:#ccc;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-switch-loading{opacity:.4}.ivu-switch-inner{color:#fff;font-size:12px;position:absolute;left:23px}.ivu-switch-inner i{width:12px;height:12px;text-align:center;position:relative;top:-1px}.ivu-switch:after{content:'';width:18px;height:18px;border-radius:18px;background-color:#fff;position:absolute;left:1px;top:1px;cursor:pointer;-webkit-transition:left .2s ease-in-out,width .2s ease-in-out;transition:left .2s ease-in-out,width .2s ease-in-out}.ivu-switch:active:after{width:26px}.ivu-switch:before{content:'';display:none;width:14px;height:14px;border-radius:50%;background-color:transparent;position:absolute;left:3px;top:3px;z-index:1;border:1px solid #2d8cf0;border-color:transparent transparent transparent #2d8cf0;-webkit-animation:switch-loading 1s linear;animation:switch-loading 1s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.ivu-switch-loading:before{display:block}.ivu-switch:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);outline:0}.ivu-switch:focus:hover{-webkit-box-shadow:none;box-shadow:none}.ivu-switch-small{width:28px;height:16px;line-height:14px}.ivu-switch-small:after{width:12px;height:12px}.ivu-switch-small:active:after{width:14px}.ivu-switch-small:before{width:10px;height:10px;left:2px;top:2px}.ivu-switch-small.ivu-switch-checked:after{left:13px}.ivu-switch-small.ivu-switch-checked:before{left:14px}.ivu-switch-small:active.ivu-switch-checked:after{left:11px}.ivu-switch-large{width:56px}.ivu-switch-large:active:after{width:26px}.ivu-switch-large:active:after{width:30px}.ivu-switch-large.ivu-switch-checked:after{left:35px}.ivu-switch-large.ivu-switch-checked:before{left:37px}.ivu-switch-large:active.ivu-switch-checked:after{left:23px}.ivu-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-switch-checked .ivu-switch-inner{left:7px}.ivu-switch-checked:after{left:23px}.ivu-switch-checked:before{left:25px}.ivu-switch-checked:active:after{left:15px}.ivu-switch-disabled{cursor:not-allowed;opacity:.4}.ivu-switch-disabled:after{background:#fff;cursor:not-allowed}.ivu-switch-disabled .ivu-switch-inner{color:#fff}.ivu-switch-disabled.ivu-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0;opacity:.4}.ivu-switch-disabled.ivu-switch-checked:after{background:#fff}.ivu-switch-disabled.ivu-switch-checked .ivu-switch-inner{color:#fff}@-webkit-keyframes switch-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes switch-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ivu-input-number{display:inline-block;width:100%;line-height:1.5;padding:4px 7px;font-size:14px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;margin:0;padding:0;width:80px;height:32px;line-height:32px;vertical-align:middle;border:1px solid #dcdee2;border-radius:4px;overflow:hidden;cursor:default}.ivu-input-number::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-input-number:-ms-input-placeholder{color:#c5c8ce}.ivu-input-number::-webkit-input-placeholder{color:#c5c8ce}.ivu-input-number:hover{border-color:#57a3f3}.ivu-input-number:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input-number[disabled],fieldset[disabled] .ivu-input-number{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number[disabled]:hover,fieldset[disabled] .ivu-input-number:hover{border-color:#e3e5e8}textarea.ivu-input-number{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-input-number-large{font-size:16px;padding:6px 7px;height:40px}.ivu-input-number-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-input-number-handler-wrap{width:22px;height:100%;border-left:1px solid #dcdee2;border-radius:0 4px 4px 0;background:#fff;position:absolute;top:0;right:0;opacity:0;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out}.ivu-input-number:hover .ivu-input-number-handler-wrap{opacity:1}.ivu-input-number-handler-up{cursor:pointer}.ivu-input-number-handler-up-inner{top:1px}.ivu-input-number-handler-down{border-top:1px solid #dcdee2;top:-1px;cursor:pointer}.ivu-input-number-handler{display:block;width:100%;height:16px;line-height:0;text-align:center;overflow:hidden;color:#999;position:relative}.ivu-input-number-handler:hover .ivu-input-number-handler-down-inner,.ivu-input-number-handler:hover .ivu-input-number-handler-up-inner{color:#57a3f3}.ivu-input-number-handler-down-inner,.ivu-input-number-handler-up-inner{width:12px;height:12px;line-height:12px;font-size:14px;color:#999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;right:5px;-webkit-transition:all .2s linear;transition:all .2s linear}.ivu-input-number:hover{border-color:#57a3f3}.ivu-input-number-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input-number-disabled{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number-disabled:hover{border-color:#e3e5e8}.ivu-input-number-input-wrap{overflow:hidden;height:32px}.ivu-input-number-input{width:100%;height:32px;line-height:32px;padding:0 7px;text-align:left;outline:0;-moz-appearance:textfield;color:#666;border:0;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.ivu-input-number-input[disabled]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number-input[disabled]:hover{border-color:#e3e5e8}.ivu-input-number-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-input-number-input::-moz-placeholder{color:#c5c8ce}.ivu-input-number-input::-ms-input-placeholder{color:#c5c8ce}.ivu-input-number-input::placeholder{color:#c5c8ce}.ivu-input-number-large{padding:0}.ivu-input-number-large .ivu-input-number-input-wrap{height:40px}.ivu-input-number-large .ivu-input-number-handler{height:20px}.ivu-input-number-large input{height:40px;line-height:40px}.ivu-input-number-large .ivu-input-number-handler-up-inner{top:2px}.ivu-input-number-large .ivu-input-number-handler-down-inner{bottom:2px}.ivu-input-number-small{padding:0}.ivu-input-number-small .ivu-input-number-input-wrap{height:24px}.ivu-input-number-small .ivu-input-number-handler{height:12px}.ivu-input-number-small input{height:24px;line-height:24px;margin-top:-1px;vertical-align:top}.ivu-input-number-small .ivu-input-number-handler-up-inner{top:-1px}.ivu-input-number-small .ivu-input-number-handler-down-inner{bottom:-1px}.ivu-input-number-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-disabled .ivu-input-number-handler-up-inner,.ivu-input-number-handler-down-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-handler-down-disabled .ivu-input-number-handler-up-inner,.ivu-input-number-handler-up-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-handler-up-disabled .ivu-input-number-handler-up-inner{opacity:.72;color:#ccc!important;cursor:not-allowed}.ivu-input-number-disabled .ivu-input-number-input{opacity:.72;cursor:not-allowed;background-color:#f3f3f3}.ivu-input-number-disabled .ivu-input-number-handler-wrap{display:none}.ivu-input-number-disabled .ivu-input-number-handler{opacity:.72;color:#ccc!important;cursor:not-allowed}.ivu-form-item-error .ivu-input-number{border:1px solid #ed4014}.ivu-form-item-error .ivu-input-number:hover{border-color:#ed4014}.ivu-form-item-error .ivu-input-number:focus{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-form-item-error .ivu-input-number-focused{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-scroll-wrapper{width:auto;margin:0 auto;position:relative;outline:0}.ivu-scroll-container{overflow-y:scroll}.ivu-scroll-content{opacity:1;-webkit-transition:opacity .5s;transition:opacity .5s}.ivu-scroll-content-loading{opacity:.5}.ivu-scroll-loader{text-align:center;padding:0;-webkit-transition:padding .5s;transition:padding .5s}.ivu-scroll-loader-wrapper{padding:5px 0;height:0;background-color:inherit;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:opacity .3s,height .5s,-webkit-transform .5s;transition:opacity .3s,height .5s,-webkit-transform .5s;transition:opacity .3s,transform .5s,height .5s;transition:opacity .3s,transform .5s,height .5s,-webkit-transform .5s}.ivu-scroll-loader-wrapper-active{height:40px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}@-webkit-keyframes ani-demo-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes ani-demo-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ivu-scroll-loader-wrapper .ivu-scroll-spinner{position:relative}.ivu-scroll-loader-wrapper .ivu-scroll-spinner-icon{-webkit-animation:ani-demo-spin 1s linear infinite;animation:ani-demo-spin 1s linear infinite}.ivu-tag{display:inline-block;height:22px;line-height:22px;margin:2px 4px 2px 0;padding:0 8px;border:1px solid #e8eaec;border-radius:3px;background:#f7f7f7;font-size:12px;vertical-align:middle;opacity:1;overflow:hidden}.ivu-tag-size-large{height:32px;line-height:32px;padding:0 12px}.ivu-tag-size-medium{height:28px;line-height:28px;padding:0 10px}.ivu-tag:not(.ivu-tag-border):not(.ivu-tag-dot):not(.ivu-tag-checked){background:0 0;border:0;color:#515a6e}.ivu-tag:not(.ivu-tag-border):not(.ivu-tag-dot):not(.ivu-tag-checked) .ivu-icon-ios-close{color:#515a6e!important}.ivu-tag-color-error{color:#ed4014!important;border-color:#ed4014}.ivu-tag-color-success{color:#19be6b!important;border-color:#19be6b}.ivu-tag-color-primary{color:#2d8cf0!important;border-color:#2d8cf0}.ivu-tag-color-warning{color:#f90!important;border-color:#f90}.ivu-tag-color-white{color:#fff!important}.ivu-tag-dot{height:32px;line-height:32px;border:1px solid #e8eaec!important;color:#515a6e!important;background:#fff!important;padding:0 12px}.ivu-tag-dot-inner{display:inline-block;width:12px;height:12px;margin-right:8px;border-radius:50%;background:#e8eaec;position:relative;top:1px}.ivu-tag-dot .ivu-icon-ios-close{color:#666!important;margin-left:12px!important}.ivu-tag-border{height:24px;line-height:24px;border:1px solid #e8eaec;color:#e8eaec;background:#fff!important;position:relative}.ivu-tag-border .ivu-icon-ios-close{color:#666;margin-left:12px!important}.ivu-tag-border:after{content:\"\";display:none;width:1px;background:currentColor;position:absolute;top:0;bottom:0;right:22px}.ivu-tag-border.ivu-tag-closable:after{display:block}.ivu-tag-border.ivu-tag-closable .ivu-icon-ios-close{margin-left:18px!important;left:4px;top:-1px}.ivu-tag-border.ivu-tag-primary{color:#2d8cf0!important;border:1px solid #2d8cf0!important}.ivu-tag-border.ivu-tag-primary:after{background:#2d8cf0}.ivu-tag-border.ivu-tag-primary .ivu-icon-ios-close{color:#2d8cf0!important}.ivu-tag-border.ivu-tag-success{color:#19be6b!important;border:1px solid #19be6b!important}.ivu-tag-border.ivu-tag-success:after{background:#19be6b}.ivu-tag-border.ivu-tag-success .ivu-icon-ios-close{color:#19be6b!important}.ivu-tag-border.ivu-tag-warning{color:#f90!important;border:1px solid #f90!important}.ivu-tag-border.ivu-tag-warning:after{background:#f90}.ivu-tag-border.ivu-tag-warning .ivu-icon-ios-close{color:#f90!important}.ivu-tag-border.ivu-tag-error{color:#ed4014!important;border:1px solid #ed4014!important}.ivu-tag-border.ivu-tag-error:after{background:#ed4014}.ivu-tag-border.ivu-tag-error .ivu-icon-ios-close{color:#ed4014!important}.ivu-tag:hover{opacity:.85}.ivu-tag-text{color:#515a6e}.ivu-tag-text a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ivu-tag .ivu-icon-ios-close{display:inline-block;font-size:14px;-webkit-transform:scale(1.42857143) rotate(0);-ms-transform:scale(1.42857143) rotate(0);transform:scale(1.42857143) rotate(0);cursor:pointer;margin-left:2px;color:#666;opacity:.66;position:relative;top:-1px}:root .ivu-tag .ivu-icon-ios-close{font-size:14px}.ivu-tag .ivu-icon-ios-close:hover{opacity:1}.ivu-tag-error,.ivu-tag-primary,.ivu-tag-success,.ivu-tag-warning{border:0}.ivu-tag-error,.ivu-tag-error .ivu-icon-ios-close,.ivu-tag-error .ivu-icon-ios-close:hover,.ivu-tag-error a,.ivu-tag-error a:hover,.ivu-tag-primary,.ivu-tag-primary .ivu-icon-ios-close,.ivu-tag-primary .ivu-icon-ios-close:hover,.ivu-tag-primary a,.ivu-tag-primary a:hover,.ivu-tag-success,.ivu-tag-success .ivu-icon-ios-close,.ivu-tag-success .ivu-icon-ios-close:hover,.ivu-tag-success a,.ivu-tag-success a:hover,.ivu-tag-warning,.ivu-tag-warning .ivu-icon-ios-close,.ivu-tag-warning .ivu-icon-ios-close:hover,.ivu-tag-warning a,.ivu-tag-warning a:hover{color:#fff}.ivu-tag-primary,.ivu-tag-primary.ivu-tag-dot .ivu-tag-dot-inner{background:#2d8cf0}.ivu-tag-success,.ivu-tag-success.ivu-tag-dot .ivu-tag-dot-inner{background:#19be6b}.ivu-tag-warning,.ivu-tag-warning.ivu-tag-dot .ivu-tag-dot-inner{background:#f90}.ivu-tag-error,.ivu-tag-error.ivu-tag-dot .ivu-tag-dot-inner{background:#ed4014}.ivu-tag-pink{line-height:20px;background:#fff0f6;border-color:#ffadd2}.ivu-tag-pink .ivu-tag-text{color:#eb2f96!important}.ivu-tag-pink.ivu-tag-dot{line-height:32px}.ivu-tag-magenta{line-height:20px;background:#fff0f6;border-color:#ffadd2}.ivu-tag-magenta .ivu-tag-text{color:#eb2f96!important}.ivu-tag-magenta.ivu-tag-dot{line-height:32px}.ivu-tag-red{line-height:20px;background:#fff1f0;border-color:#ffa39e}.ivu-tag-red .ivu-tag-text{color:#f5222d!important}.ivu-tag-red.ivu-tag-dot{line-height:32px}.ivu-tag-volcano{line-height:20px;background:#fff2e8;border-color:#ffbb96}.ivu-tag-volcano .ivu-tag-text{color:#fa541c!important}.ivu-tag-volcano.ivu-tag-dot{line-height:32px}.ivu-tag-orange{line-height:20px;background:#fff7e6;border-color:#ffd591}.ivu-tag-orange .ivu-tag-text{color:#fa8c16!important}.ivu-tag-orange.ivu-tag-dot{line-height:32px}.ivu-tag-yellow{line-height:20px;background:#feffe6;border-color:#fffb8f}.ivu-tag-yellow .ivu-tag-text{color:#fadb14!important}.ivu-tag-yellow.ivu-tag-dot{line-height:32px}.ivu-tag-gold{line-height:20px;background:#fffbe6;border-color:#ffe58f}.ivu-tag-gold .ivu-tag-text{color:#faad14!important}.ivu-tag-gold.ivu-tag-dot{line-height:32px}.ivu-tag-cyan{line-height:20px;background:#e6fffb;border-color:#87e8de}.ivu-tag-cyan .ivu-tag-text{color:#13c2c2!important}.ivu-tag-cyan.ivu-tag-dot{line-height:32px}.ivu-tag-lime{line-height:20px;background:#fcffe6;border-color:#eaff8f}.ivu-tag-lime .ivu-tag-text{color:#a0d911!important}.ivu-tag-lime.ivu-tag-dot{line-height:32px}.ivu-tag-green{line-height:20px;background:#f6ffed;border-color:#b7eb8f}.ivu-tag-green .ivu-tag-text{color:#52c41a!important}.ivu-tag-green.ivu-tag-dot{line-height:32px}.ivu-tag-blue{line-height:20px;background:#e6f7ff;border-color:#91d5ff}.ivu-tag-blue .ivu-tag-text{color:#1890ff!important}.ivu-tag-blue.ivu-tag-dot{line-height:32px}.ivu-tag-geekblue{line-height:20px;background:#f0f5ff;border-color:#adc6ff}.ivu-tag-geekblue .ivu-tag-text{color:#2f54eb!important}.ivu-tag-geekblue.ivu-tag-dot{line-height:32px}.ivu-tag-purple{line-height:20px;background:#f9f0ff;border-color:#d3adf7}.ivu-tag-purple .ivu-tag-text{color:#722ed1!important}.ivu-tag-purple.ivu-tag-dot{line-height:32px}.ivu-layout{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex:auto;flex:auto;background:#f5f7f9}.ivu-layout.ivu-layout-has-sider{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.ivu-layout.ivu-layout-has-sider>.ivu-layout,.ivu-layout.ivu-layout-has-sider>.ivu-layout-content{overflow-x:hidden}.ivu-layout-footer,.ivu-layout-header{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-layout-header{background:#515a6e;padding:0 50px;height:64px;line-height:64px}.ivu-layout-sider{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;background:#515a6e;min-width:0}.ivu-layout-sider-children{height:100%;padding-top:.1px;margin-top:-.1px}.ivu-layout-sider-has-trigger{padding-bottom:48px}.ivu-layout-sider-trigger{position:fixed;bottom:0;text-align:center;cursor:pointer;height:48px;line-height:48px;color:#fff;background:#515a6e;z-index:1000;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-layout-sider-trigger .ivu-icon{font-size:16px}.ivu-layout-sider-trigger>*{-webkit-transition:all .2s;transition:all .2s}.ivu-layout-sider-trigger-collapsed .ivu-layout-sider-trigger-icon{-webkit-transform:rotateZ(180deg);-ms-transform:rotate(180deg);transform:rotateZ(180deg)}.ivu-layout-sider-zero-width>*{overflow:hidden}.ivu-layout-sider-zero-width-trigger{position:absolute;top:64px;right:-36px;text-align:center;width:36px;height:42px;line-height:42px;background:#515a6e;color:#fff;font-size:18px;border-radius:0 6px 6px 0;cursor:pointer;-webkit-transition:background .3s ease;transition:background .3s ease}.ivu-layout-sider-zero-width-trigger:hover{background:#626b7d}.ivu-layout-sider-zero-width-trigger.ivu-layout-sider-zero-width-trigger-left{right:0;left:-36px;border-radius:6px 0 0 6px}.ivu-layout-footer{background:#f5f7f9;padding:24px 50px;color:#515a6e;font-size:14px}.ivu-layout-content{-webkit-box-flex:1;-ms-flex:auto;flex:auto}.ivu-loading-bar{width:100%;position:fixed;top:0;left:0;right:0;z-index:2000}.ivu-loading-bar-inner{-webkit-transition:width .2s linear;transition:width .2s linear}.ivu-loading-bar-inner-color-primary{background-color:#2d8cf0}.ivu-loading-bar-inner-failed-color-error{background-color:#ed4014}.ivu-progress{display:inline-block;width:100%;font-size:12px;position:relative}.ivu-progress-vertical{height:100%;width:auto}.ivu-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0}.ivu-progress-show-info .ivu-progress-outer{padding-right:55px;margin-right:-55px}.ivu-progress-vertical .ivu-progress-outer{height:100%;width:auto}.ivu-progress-inner{display:inline-block;width:100%;background-color:#f3f3f3;border-radius:100px;vertical-align:middle;position:relative}.ivu-progress-inner-text{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 6px}.ivu-progress-vertical .ivu-progress-inner{height:100%;width:auto}.ivu-progress-vertical .ivu-progress-inner:after,.ivu-progress-vertical .ivu-progress-inner>*{display:inline-block;vertical-align:bottom}.ivu-progress-vertical .ivu-progress-inner:after{content:'';height:100%}.ivu-progress-bg{text-align:right;border-radius:100px;background-color:#2d8cf0;-webkit-transition:all .2s linear;transition:all .2s linear;position:relative}.ivu-progress-bg:after{content:'';display:inline-block;height:100%;vertical-align:middle}.ivu-progress-success-bg{border-radius:100px;background-color:#19be6b;-webkit-transition:all .2s linear;transition:all .2s linear;position:absolute;top:0;left:0}.ivu-progress-text{display:inline-block;margin-left:5px;text-align:left;font-size:1em;vertical-align:middle;color:#808695}.ivu-progress-active .ivu-progress-bg:before{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border-radius:10px;-webkit-animation:ivu-progress-active 2s ease-in-out infinite;animation:ivu-progress-active 2s ease-in-out infinite}.ivu-progress-vertical.ivu-progress-active .ivu-progress-bg:before{top:auto;-webkit-animation:ivu-progress-active-vertical 2s ease-in-out infinite;animation:ivu-progress-active-vertical 2s ease-in-out infinite}.ivu-progress-wrong .ivu-progress-bg{background-color:#ed4014}.ivu-progress-wrong .ivu-progress-text{color:#ed4014}.ivu-progress-success .ivu-progress-bg{background-color:#19be6b}.ivu-progress-success .ivu-progress-text{color:#19be6b}@-webkit-keyframes ivu-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@keyframes ivu-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@-webkit-keyframes ivu-progress-active-vertical{0%{opacity:.3;height:0}100%{opacity:0;height:100%}}@keyframes ivu-progress-active-vertical{0%{opacity:.3;height:0}100%{opacity:0;height:100%}}.ivu-timeline{list-style:none;margin:0;padding:0}.ivu-timeline-item{margin:0!important;padding:0 0 12px 0;list-style:none;position:relative}.ivu-timeline-item-tail{height:100%;border-left:1px solid #e8eaec;position:absolute;left:6px;top:0}.ivu-timeline-item-pending .ivu-timeline-item-tail{display:none}.ivu-timeline-item-head{width:13px;height:13px;background-color:#fff;border-radius:50%;border:1px solid transparent;position:absolute}.ivu-timeline-item-head-blue{border-color:#2d8cf0;color:#2d8cf0}.ivu-timeline-item-head-red{border-color:#ed4014;color:#ed4014}.ivu-timeline-item-head-green{border-color:#19be6b;color:#19be6b}.ivu-timeline-item-head-custom{width:40px;height:auto;margin-top:6px;padding:3px 0;text-align:center;line-height:1;border:0;border-radius:0;font-size:14px;position:absolute;left:-13px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-timeline-item-content{padding:1px 1px 10px 24px;font-size:14px;position:relative;top:-3px}.ivu-timeline-item:last-child .ivu-timeline-item-tail{display:none}.ivu-timeline.ivu-timeline-pending .ivu-timeline-item:nth-last-of-type(2) .ivu-timeline-item-tail{border-left:1px dotted #e8eaec}.ivu-timeline.ivu-timeline-pending .ivu-timeline-item:nth-last-of-type(2) .ivu-timeline-item-content{min-height:48px}.ivu-page:after{content:'';display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.ivu-page-item{display:inline-block;vertical-align:middle;min-width:32px;height:32px;line-height:30px;margin-right:4px;text-align:center;list-style:none;background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;font-family:Arial;font-weight:500;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:border .2s ease-in-out,color .2s ease-in-out;transition:border .2s ease-in-out,color .2s ease-in-out}.ivu-page-item a{margin:0 6px;text-decoration:none;color:#515a6e}.ivu-page-item:hover{border-color:#2d8cf0}.ivu-page-item:hover a{color:#2d8cf0}.ivu-page-item-active{border-color:#2d8cf0}.ivu-page-item-active a,.ivu-page-item-active:hover a{color:#2d8cf0}.ivu-page-with-disabled .ivu-page-disabled,.ivu-page-with-disabled .ivu-page-item{cursor:not-allowed;background-color:#f3f3f3}.ivu-page-with-disabled .ivu-page-disabled a,.ivu-page-with-disabled .ivu-page-item a{color:#ccc}.ivu-page-with-disabled .ivu-page-disabled:hover,.ivu-page-with-disabled .ivu-page-item:hover{border-color:#dcdee2}.ivu-page-with-disabled .ivu-page-disabled:hover a,.ivu-page-with-disabled .ivu-page-item:hover a{color:#ccc;cursor:not-allowed}.ivu-page-with-disabled .ivu-page-disabled-active,.ivu-page-with-disabled .ivu-page-item-active{background-color:#dcdee2;border-color:#dcdee2}.ivu-page-with-disabled .ivu-page-disabled-active a,.ivu-page-with-disabled .ivu-page-disabled-active:hover a,.ivu-page-with-disabled .ivu-page-item-active a,.ivu-page-with-disabled .ivu-page-item-active:hover a{color:#fff}.ivu-page-item-jump-next:after,.ivu-page-item-jump-prev:after{content:\"•••\";display:block;letter-spacing:1px;color:#ccc;text-align:center}.ivu-page-item-jump-next i,.ivu-page-item-jump-prev i{display:none}.ivu-page-item-jump-next:hover:after,.ivu-page-item-jump-prev:hover:after{display:none}.ivu-page-item-jump-next:hover i,.ivu-page-item-jump-prev:hover i{display:inline}.ivu-page-with-disabled .ivu-page-item-jump-next,.ivu-page-with-disabled .ivu-page-item-jump-prev{cursor:not-allowed}.ivu-page-with-disabled .ivu-page-item-jump-next:hover:after,.ivu-page-with-disabled .ivu-page-item-jump-prev:hover:after{display:block}.ivu-page-with-disabled .ivu-page-item-jump-next:hover i,.ivu-page-with-disabled .ivu-page-item-jump-prev:hover i{display:none}.ivu-page-item-jump-prev:hover i:after{content:\"\\F115\";margin-left:-8px}.ivu-page-item-jump-next:hover i:after{content:\"\\F11F\";margin-left:-8px}.ivu-page-prev{margin-right:4px}.ivu-page-item-jump-next,.ivu-page-item-jump-prev{margin-right:4px}.ivu-page-item-jump-next,.ivu-page-item-jump-prev,.ivu-page-next,.ivu-page-prev{display:inline-block;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-width:32px;height:32px;line-height:30px;list-style:none;text-align:center;cursor:pointer;color:#666;font-family:Arial;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-page-item-jump-next,.ivu-page-item-jump-prev{border-color:transparent}.ivu-page-next,.ivu-page-prev{background-color:#fff}.ivu-page-next a,.ivu-page-prev a{color:#666;font-size:14px}.ivu-page-next:hover,.ivu-page-prev:hover{border-color:#2d8cf0}.ivu-page-next:hover a,.ivu-page-prev:hover a{color:#2d8cf0}.ivu-page-disabled{cursor:not-allowed}.ivu-page-disabled a{color:#ccc}.ivu-page-disabled:hover{border-color:#dcdee2}.ivu-page-disabled:hover a{color:#ccc;cursor:not-allowed}.ivu-page-options{display:inline-block;vertical-align:middle;margin-left:15px}.ivu-page-options-sizer{display:inline-block;margin-right:10px}.ivu-page-options-elevator{display:inline-block;vertical-align:middle;height:32px;line-height:32px}.ivu-page-options-elevator input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;border-radius:4px;margin:0 8px;width:50px}.ivu-page-options-elevator input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-page-options-elevator input:-ms-input-placeholder{color:#c5c8ce}.ivu-page-options-elevator input::-webkit-input-placeholder{color:#c5c8ce}.ivu-page-options-elevator input:hover{border-color:#57a3f3}.ivu-page-options-elevator input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-page-options-elevator input[disabled],fieldset[disabled] .ivu-page-options-elevator input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-page-options-elevator input[disabled]:hover,fieldset[disabled] .ivu-page-options-elevator input:hover{border-color:#e3e5e8}textarea.ivu-page-options-elevator input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-page-options-elevator input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-page-options-elevator input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-page-total{display:inline-block;height:32px;line-height:32px;margin-right:10px}.ivu-page-simple .ivu-page-next,.ivu-page-simple .ivu-page-prev{margin:0;border:0;height:24px;line-height:normal;font-size:18px}.ivu-page-simple .ivu-page-simple-pager{display:inline-block;margin-right:8px;vertical-align:middle}.ivu-page-simple .ivu-page-simple-pager input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;color:#515a6e;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;width:30px;height:24px;margin:0 8px;padding:5px 8px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff;outline:0;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:border-color .2s ease-in-out;transition:border-color .2s ease-in-out}.ivu-page-simple .ivu-page-simple-pager input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-page-simple .ivu-page-simple-pager input:-ms-input-placeholder{color:#c5c8ce}.ivu-page-simple .ivu-page-simple-pager input::-webkit-input-placeholder{color:#c5c8ce}.ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#57a3f3}.ivu-page-simple .ivu-page-simple-pager input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-page-simple .ivu-page-simple-pager input[disabled],fieldset[disabled] .ivu-page-simple .ivu-page-simple-pager input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-page-simple .ivu-page-simple-pager input[disabled]:hover,fieldset[disabled] .ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#e3e5e8}textarea.ivu-page-simple .ivu-page-simple-pager input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-page-simple .ivu-page-simple-pager input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-page-simple .ivu-page-simple-pager input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#2d8cf0}.ivu-page-simple .ivu-page-simple-pager span{padding:0 8px 0 2px}.ivu-page-custom-text,.ivu-page-custom-text:hover{border-color:transparent}.ivu-page.mini .ivu-page-total{height:24px;line-height:24px}.ivu-page.mini .ivu-page-item{border:0;margin:0;min-width:24px;height:24px;line-height:24px;border-radius:3px}.ivu-page.mini .ivu-page-next,.ivu-page.mini .ivu-page-prev{margin:0;min-width:24px;height:24px;line-height:22px;border:0}.ivu-page.mini .ivu-page-next a i:after,.ivu-page.mini .ivu-page-prev a i:after{height:24px;line-height:24px}.ivu-page.mini .ivu-page-item-jump-next,.ivu-page.mini .ivu-page-item-jump-prev{height:24px;line-height:24px;border:none;margin-right:0}.ivu-page.mini .ivu-page-options{margin-left:8px}.ivu-page.mini .ivu-page-options-elevator{height:24px;line-height:24px}.ivu-page.mini .ivu-page-options-elevator input{padding:1px 7px;height:24px;border-radius:3px;width:44px}.ivu-steps{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;font-size:0;line-height:1.5}.ivu-steps-item{display:inline-block;position:relative;vertical-align:top;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.ivu-steps-item:last-child{-webkit-box-flex:0;-ms-flex:0;flex:none}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner{background-color:#fff}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner>.ivu-steps-icon{color:#ccc}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-title{color:#999}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-content{color:#999}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner>.ivu-steps-icon{color:#fff}.ivu-steps-item.ivu-steps-status-process .ivu-steps-title{color:#666}.ivu-steps-item.ivu-steps-status-process .ivu-steps-content{color:#666}.ivu-steps-item.ivu-steps-status-process .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner{background-color:#fff;border-color:#2d8cf0}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner>.ivu-steps-icon{color:#2d8cf0}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-tail>i:after{width:100%;background:#2d8cf0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;opacity:1}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-title{color:#999}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-content{color:#999}.ivu-steps-item.ivu-steps-status-error .ivu-steps-head-inner{background-color:#fff;border-color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-head-inner>.ivu-steps-icon{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-title{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-content{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-next-error .ivu-steps-tail>i,.ivu-steps-item.ivu-steps-next-error .ivu-steps-tail>i:after{background-color:#ed4014}.ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner{background:0 0;border:0;width:auto;height:auto}.ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner>.ivu-steps-icon{font-size:20px;top:2px;width:20px;height:20px}.ivu-steps-item.ivu-steps-custom.ivu-steps-status-process .ivu-steps-head-inner>.ivu-steps-icon{color:#2d8cf0}.ivu-steps-item:last-child .ivu-steps-tail{display:none}.ivu-steps .ivu-steps-head,.ivu-steps .ivu-steps-main{position:relative;display:inline-block;vertical-align:top}.ivu-steps .ivu-steps-head{background:#fff}.ivu-steps .ivu-steps-head-inner{display:block;width:26px;height:26px;line-height:24px;margin-right:8px;text-align:center;border:1px solid #ccc;border-radius:50%;font-size:14px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon{line-height:1;position:relative}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon{font-size:24px}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon-ios-checkmark-empty,.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon-ios-close-empty{font-weight:700}.ivu-steps .ivu-steps-main{margin-top:2.5px;display:inline}.ivu-steps .ivu-steps-custom .ivu-steps-title{margin-top:2.5px}.ivu-steps .ivu-steps-title{display:inline-block;margin-bottom:4px;padding-right:10px;font-size:14px;font-weight:700;color:#666;background:#fff}.ivu-steps .ivu-steps-title>a:first-child:last-child{color:#666}.ivu-steps .ivu-steps-item-last .ivu-steps-title{padding-right:0;width:100%}.ivu-steps .ivu-steps-content{font-size:12px;color:#999}.ivu-steps .ivu-steps-tail{width:100%;padding:0 10px;position:absolute;left:0;top:13px}.ivu-steps .ivu-steps-tail>i{display:inline-block;width:100%;height:1px;vertical-align:top;background:#e8eaec;border-radius:1px;position:relative}.ivu-steps .ivu-steps-tail>i:after{content:'';width:0;height:100%;background:#e8eaec;opacity:0;position:absolute;top:0}.ivu-steps.ivu-steps-small .ivu-steps-head-inner{width:18px;height:18px;line-height:16px;margin-right:10px;text-align:center;border-radius:50%;font-size:12px}.ivu-steps.ivu-steps-small .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon{font-size:16px;top:0}.ivu-steps.ivu-steps-small .ivu-steps-main{margin-top:0}.ivu-steps.ivu-steps-small .ivu-steps-title{margin-bottom:4px;margin-top:0;color:#666;font-size:12px;font-weight:700}.ivu-steps.ivu-steps-small .ivu-steps-content{font-size:12px;color:#999;padding-left:30px}.ivu-steps.ivu-steps-small .ivu-steps-tail{top:8px;padding:0 8px}.ivu-steps.ivu-steps-small .ivu-steps-tail>i{height:1px;width:100%;border-radius:1px}.ivu-steps .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner,.ivu-steps.ivu-steps-small .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner{width:inherit;height:inherit;line-height:inherit;border-radius:0;border:0;background:0 0}.ivu-steps-vertical{display:block}.ivu-steps-vertical .ivu-steps-item{display:block;overflow:visible}.ivu-steps-vertical .ivu-steps-tail{position:absolute;left:13px;top:0;height:100%;width:1px;padding:30px 0 4px 0}.ivu-steps-vertical .ivu-steps-tail>i{height:100%;width:1px}.ivu-steps-vertical .ivu-steps-tail>i:after{height:0;width:100%}.ivu-steps-vertical .ivu-steps-status-finish .ivu-steps-tail>i:after{height:100%}.ivu-steps-vertical .ivu-steps-head{float:left}.ivu-steps-vertical .ivu-steps-head-inner{margin-right:16px}.ivu-steps-vertical .ivu-steps-main{min-height:47px;overflow:hidden;display:block}.ivu-steps-vertical .ivu-steps-main .ivu-steps-title{line-height:26px}.ivu-steps-vertical .ivu-steps-main .ivu-steps-content{padding-bottom:12px;padding-left:0}.ivu-steps-vertical .ivu-steps-custom .ivu-steps-icon{left:4px}.ivu-steps-vertical.ivu-steps-small .ivu-steps-custom .ivu-steps-icon{left:0}.ivu-steps-vertical.ivu-steps-small .ivu-steps-tail{position:absolute;left:9px;top:0;padding:22px 0 4px 0}.ivu-steps-vertical.ivu-steps-small .ivu-steps-tail>i{height:100%}.ivu-steps-vertical.ivu-steps-small .ivu-steps-title{line-height:18px}.ivu-steps-horizontal.ivu-steps-hidden{visibility:hidden}.ivu-steps-horizontal .ivu-steps-content{padding-left:35px}.ivu-steps-horizontal .ivu-steps-item:not(:first-child) .ivu-steps-head{padding-left:10px;margin-left:-10px}.ivu-modal{width:auto;margin:0 auto;position:relative;outline:0;top:100px}.ivu-modal-hidden{display:none!important}.ivu-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1000;-webkit-overflow-scrolling:touch;outline:0}.ivu-modal-wrap *{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.ivu-modal-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1000}.ivu-modal-mask-hidden{display:none}.ivu-modal-content{position:relative;background-color:#fff;border:0;border-radius:6px;background-clip:padding-box;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}.ivu-modal-content-no-mask{pointer-events:auto}.ivu-modal-content-drag{position:absolute}.ivu-modal-content-drag .ivu-modal-header{cursor:move}.ivu-modal-content-dragging{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-modal-header{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-modal-header p,.ivu-modal-header-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-modal-close{z-index:1;font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-modal-close .ivu-icon-ios-close{font-size:31px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:1px}.ivu-modal-close .ivu-icon-ios-close:hover{color:#444}.ivu-modal-body{padding:16px;font-size:14px;line-height:1.5}.ivu-modal-footer{border-top:1px solid #e8eaec;padding:12px 18px 12px 18px;text-align:right}.ivu-modal-footer button+button{margin-left:8px;margin-bottom:0}.ivu-modal-fullscreen{width:100%!important;top:0;bottom:0;position:absolute}.ivu-modal-fullscreen .ivu-modal-content{width:100%;border-radius:0;position:absolute;top:0;bottom:0}.ivu-modal-fullscreen .ivu-modal-body{width:100%;overflow:auto;position:absolute;top:51px;bottom:61px}.ivu-modal-fullscreen-no-header .ivu-modal-body{top:0}.ivu-modal-fullscreen-no-footer .ivu-modal-body{bottom:0}.ivu-modal-fullscreen .ivu-modal-footer{position:absolute;width:100%;bottom:0}.ivu-modal-no-mask{pointer-events:none}@media (max-width:576px){.ivu-modal{width:auto!important;margin:10px}.ivu-modal-fullscreen{width:100%!important;margin:0}.vertical-center-modal .ivu-modal{-webkit-box-flex:1;-ms-flex:1;flex:1}}.ivu-modal-confirm{padding:6px 16px 8px}.ivu-modal-confirm-head{padding:0 12px 0 0}.ivu-modal-confirm-head-icon{display:inline-block;font-size:28px;vertical-align:middle;position:relative;top:-2px}.ivu-modal-confirm-head-icon-info{color:#2d8cf0}.ivu-modal-confirm-head-icon-success{color:#19be6b}.ivu-modal-confirm-head-icon-warning{color:#f90}.ivu-modal-confirm-head-icon-error{color:#ed4014}.ivu-modal-confirm-head-icon-confirm{color:#f90}.ivu-modal-confirm-head-title{display:inline-block;vertical-align:middle;margin-left:12px;font-size:16px;color:#17233d;font-weight:500}.ivu-modal-confirm-body{padding-left:40px;font-size:14px;color:#515a6e;position:relative}.ivu-modal-confirm-body-render{margin:0;padding:0}.ivu-modal-confirm-footer{margin-top:20px;text-align:right}.ivu-modal-confirm-footer button+button{margin-left:8px;margin-bottom:0}.ivu-select{display:inline-block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle;color:#515a6e;font-size:14px;line-height:normal}.ivu-select-selection{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative;background-color:#fff;border-radius:4px;border:1px solid #dcdee2;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-select-selection-focused,.ivu-select-selection:hover{border-color:#57a3f3}.ivu-select-selection-focused .ivu-select-arrow,.ivu-select-selection:hover .ivu-select-arrow{display:inline-block}.ivu-select-arrow{position:absolute;top:50%;right:8px;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);font-size:14px;color:#808695;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-select-visible .ivu-select-selection{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-select-visible .ivu-select-arrow{-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg);display:inline-block}.ivu-select-disabled .ivu-select-selection{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-select-disabled .ivu-select-selection:hover{border-color:#e3e5e8}.ivu-select-disabled .ivu-select-selection .ivu-select-arrow{color:#ccc}.ivu-select-disabled .ivu-select-selection:hover{border-color:#dcdee2;-webkit-box-shadow:none;box-shadow:none}.ivu-select-disabled .ivu-select-selection:hover .ivu-select-arrow{display:inline-block}.ivu-select-single .ivu-select-selection{height:32px;position:relative}.ivu-select-single .ivu-select-selection .ivu-select-placeholder{color:#c5c8ce}.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-single .ivu-select-selection .ivu-select-selected-value{display:block;height:30px;line-height:30px;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:8px;padding-right:24px}.ivu-select-multiple .ivu-select-selection{padding:0 24px 0 4px}.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder{display:block;height:30px;line-height:30px;color:#c5c8ce;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:4px;padding-right:22px}.ivu-select-default.ivu-select-multiple .ivu-select-selection{min-height:32px}.ivu-select-large.ivu-select-single .ivu-select-selection{height:40px}.ivu-select-large.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-large.ivu-select-single .ivu-select-selection .ivu-select-selected-value{height:38px;line-height:38px;font-size:16px}.ivu-select-large.ivu-select-multiple .ivu-select-selection{min-height:40px}.ivu-select-large.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,.ivu-select-large.ivu-select-multiple .ivu-select-selection .ivu-select-selected-value{min-height:38px;line-height:38px;font-size:16px}.ivu-select-small.ivu-select-single .ivu-select-selection{height:24px;border-radius:3px}.ivu-select-small.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-small.ivu-select-single .ivu-select-selection .ivu-select-selected-value{height:22px;line-height:22px}.ivu-select-small.ivu-select-multiple .ivu-select-selection{min-height:24px;border-radius:3px}.ivu-select-small.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,.ivu-select-small.ivu-select-multiple .ivu-select-selection .ivu-select-selected-value{height:auto;min-height:22px;line-height:22px}.ivu-select-input{display:inline-block;height:32px;line-height:32px;padding:0 24px 0 8px;font-size:14px;outline:0;border:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:#515a6e;background-color:transparent;position:relative;cursor:pointer}.ivu-select-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-select-input:-ms-input-placeholder{color:#c5c8ce}.ivu-select-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-select-input[disabled]{cursor:not-allowed;color:#ccc;-webkit-text-fill-color:#ccc}.ivu-select-single .ivu-select-input{width:100%}.ivu-select-large .ivu-select-input,.ivu-select-large.ivu-select-multiple .ivu-select-input{font-size:16px;height:32px;line-height:32px;top:3px}.ivu-select-small .ivu-select-input,.ivu-select-small.ivu-select-multiple .ivu-select-input{height:18px;line-height:18px;top:2px}.ivu-select-multiple .ivu-select-input{height:26px;line-height:26px;padding:0 0 0 4px;top:2px}.ivu-select-not-found{text-align:center;color:#c5c8ce}.ivu-select-not-found li:not([class^=ivu-]){margin-bottom:0}.ivu-select-loading{text-align:center;color:#c5c8ce}.ivu-select-multiple .ivu-tag{height:24px;line-height:22px;margin:3px 4px 3px 0;max-width:99%;position:relative}.ivu-select-multiple .ivu-tag span:not(.ivu-select-max-tag){display:block;margin-right:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-select-multiple .ivu-tag i{display:block;position:absolute;right:4px;top:4px}.ivu-select-large.ivu-select-multiple .ivu-tag{height:32px;line-height:30px;font-size:16px}.ivu-select-large.ivu-select-multiple .ivu-tag i{top:9px}.ivu-select-small.ivu-select-multiple .ivu-tag{height:17px;line-height:15px;font-size:12px;padding:0 6px;margin:3px 4px 2px 0}.ivu-select-small.ivu-select-multiple .ivu-tag span{margin-right:14px}.ivu-select-small.ivu-select-multiple .ivu-tag i{top:1px;right:2px}.ivu-select-dropdown-list{min-width:100%;list-style:none}.ivu-select .ivu-select-dropdown{width:auto}.ivu-select-prefix{display:inline-block;vertical-align:middle}.ivu-select-prefix i{vertical-align:top}.ivu-select-head-with-prefix{display:inline-block!important;vertical-align:middle}.ivu-select-single .ivu-select-prefix{padding-left:4px}.ivu-select-multiple .ivu-select-head-with-prefix,.ivu-select-single .ivu-select-head-with-prefix{padding-left:0!important}.ivu-select-head-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-select-multiple .ivu-select-head-flex .ivu-select-prefix{margin-right:4px}.ivu-select-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-select-item:hover{background:#f3f3f3}.ivu-select-item-focus{background:#f3f3f3}.ivu-select-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-select-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-select-item-selected,.ivu-select-item-selected:hover{color:#2d8cf0}.ivu-select-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-select-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-select-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-select-large .ivu-select-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-select-item{white-space:normal}}.ivu-select-multiple .ivu-select-item{position:relative}.ivu-select-multiple .ivu-select-item-selected{color:rgba(45,140,240,.9);background:#fff}.ivu-select-multiple .ivu-select-item-focus,.ivu-select-multiple .ivu-select-item-selected:hover{background:#f3f3f3}.ivu-select-multiple .ivu-select-item-selected.ivu-select-multiple .ivu-select-item-focus{color:rgba(40,123,211,.91);background:#fff}.ivu-select-multiple .ivu-select-item-selected:after{display:inline-block;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:optimizeLegibility;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:-.125em;text-align:center;font-size:24px;content:'\\F171';color:rgba(45,140,240,.9);position:absolute;top:2px;right:8px}.ivu-select-group{list-style:none;margin:0;padding:0}.ivu-select-group-title{padding-left:8px;font-size:14px;color:#999;height:30px;line-height:30px}.ivu-form-item-error .ivu-select-selection{border:1px solid #ed4014}.ivu-form-item-error .ivu-select-arrow{color:#ed4014}.ivu-form-item-error .ivu-select-visible .ivu-select-selection{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-select-dropdown{width:inherit;max-height:200px;overflow:auto;margin:5px 0;padding:5px 0;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);position:absolute;z-index:900}.ivu-select-dropdown-transfer{z-index:1060;width:auto}.ivu-select-dropdown.ivu-transfer-no-max-height{max-height:none}.ivu-modal .ivu-select-dropdown{position:absolute!important}.ivu-split-wrapper{position:relative;width:100%;height:100%}.ivu-split-pane{position:absolute}.ivu-split-pane.left-pane,.ivu-split-pane.right-pane{top:0;bottom:0}.ivu-split-pane.left-pane{left:0}.ivu-split-pane.right-pane{right:0}.ivu-split-pane.bottom-pane,.ivu-split-pane.top-pane{left:0;right:0}.ivu-split-pane.top-pane{top:0}.ivu-split-pane.bottom-pane{bottom:0}.ivu-split-pane-moving{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-split-trigger{border:1px solid #dcdee2}.ivu-split-trigger-con{position:absolute;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:10}.ivu-split-trigger-bar-con{position:absolute;overflow:hidden}.ivu-split-trigger-bar-con.vertical{left:1px;top:50%;height:32px;-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%)}.ivu-split-trigger-bar-con.horizontal{left:50%;top:1px;width:32px;-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0)}.ivu-split-trigger-vertical{width:6px;height:100%;background:#f8f8f9;border-top:none;border-bottom:none;cursor:col-resize}.ivu-split-trigger-vertical .ivu-split-trigger-bar{width:4px;height:1px;background:rgba(23,35,61,.25);float:left;margin-top:3px}.ivu-split-trigger-horizontal{height:6px;width:100%;background:#f8f8f9;border-left:none;border-right:none;cursor:row-resize}.ivu-split-trigger-horizontal .ivu-split-trigger-bar{height:4px;width:1px;background:rgba(23,35,61,.25);float:left;margin-right:3px}.ivu-split-horizontal .ivu-split-trigger-con{top:50%;height:100%;width:0}.ivu-split-vertical .ivu-split-trigger-con{left:50%;height:0;width:100%}.ivu-split .no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-tooltip{display:inline-block}.ivu-tooltip-rel{display:inline-block;position:relative;width:inherit}.ivu-tooltip-popper{display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-tooltip-popper[x-placement^=top]{padding:5px 0 8px 0}.ivu-tooltip-popper[x-placement^=right]{padding:0 5px 0 8px}.ivu-tooltip-popper[x-placement^=bottom]{padding:8px 0 5px 0}.ivu-tooltip-popper[x-placement^=left]{padding:0 8px 0 5px}.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow{bottom:3px;border-width:5px 5px 0;border-top-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=top] .ivu-tooltip-arrow{left:50%;margin-left:-5px}.ivu-tooltip-popper[x-placement=top-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-popper[x-placement=top-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow{left:3px;border-width:5px 5px 5px 0;border-right-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=right] .ivu-tooltip-arrow{top:50%;margin-top:-5px}.ivu-tooltip-popper[x-placement=right-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-popper[x-placement=right-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow{right:3px;border-width:5px 0 5px 5px;border-left-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=left] .ivu-tooltip-arrow{top:50%;margin-top:-5px}.ivu-tooltip-popper[x-placement=left-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-popper[x-placement=left-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow{top:3px;border-width:0 5px 5px;border-bottom-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=bottom] .ivu-tooltip-arrow{left:50%;margin-left:-5px}.ivu-tooltip-popper[x-placement=bottom-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-popper[x-placement=bottom-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper{display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top]{padding:7px 0 10px 0}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right]{padding:0 7px 0 10px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom]{padding:10px 0 7px 0}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left]{padding:0 10px 0 7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow{bottom:3px;border-width:7px 7px 0;border-top-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top] .ivu-tooltip-arrow{left:50%;margin-left:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow{left:3px;border-width:7px 7px 7px 0;border-right-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right] .ivu-tooltip-arrow{top:50%;margin-top:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow{right:3px;border-width:7px 0 7px 7px;border-left-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left] .ivu-tooltip-arrow{top:50%;margin-top:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow{top:3px;border-width:0 7px 7px;border-bottom-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom] .ivu-tooltip-arrow{left:50%;margin-left:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow:after{content:\" \";bottom:1px;margin-left:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow:after{content:\" \";left:1px;bottom:-7px;border-left-width:0;border-right-width:7px;border-right-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow:after{content:\" \";top:1px;margin-left:-7px;border-top-width:0;border-bottom-width:7px;border-bottom-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow:after{content:\" \";right:1px;border-right-width:0;border-left-width:7px;border-left-color:#fff;bottom:-7px}.ivu-tooltip-inner{max-width:250px;min-height:34px;padding:8px 12px;color:#fff;text-align:left;text-decoration:none;background-color:rgba(70,76,91,.9);border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);white-space:nowrap}.ivu-tooltip-inner-with-width{white-space:pre-wrap;text-align:justify}.ivu-tooltip-light .ivu-tooltip-inner{background-color:#fff;color:#515a6e}.ivu-tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.ivu-tooltip-light .ivu-tooltip-arrow{border-width:8px}.ivu-tooltip-light .ivu-tooltip-arrow:after{display:block;width:0;height:0;position:absolute;border-color:transparent;border-style:solid;content:\"\";border-width:7px}.ivu-poptip{display:inline-block}.ivu-poptip-rel{display:inline-block;position:relative}.ivu-poptip-title{margin:0;padding:8px 16px;position:relative}.ivu-poptip-title:after{content:'';display:block;height:1px;position:absolute;left:8px;right:8px;bottom:0;background-color:#e8eaec}.ivu-poptip-title-inner{color:#17233d;font-size:14px;font-weight:500}.ivu-poptip-body{padding:8px 16px}.ivu-poptip-body-content{overflow:auto}.ivu-poptip-body-content-word-wrap{white-space:pre-wrap;text-align:justify}.ivu-poptip-body-content-inner{color:#515a6e}.ivu-poptip-inner{width:100%;background-color:#fff;background-clip:padding-box;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);white-space:nowrap}.ivu-poptip-popper{min-width:150px;display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-poptip-popper[x-placement^=top]{padding:7px 0 10px 0}.ivu-poptip-popper[x-placement^=right]{padding:0 7px 0 10px}.ivu-poptip-popper[x-placement^=bottom]{padding:10px 0 7px 0}.ivu-poptip-popper[x-placement^=left]{padding:0 10px 0 7px}.ivu-poptip-popper[x-placement^=top] .ivu-poptip-arrow{bottom:3px;border-width:7px 7px 0;border-top-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=top] .ivu-poptip-arrow{left:50%;margin-left:-7px}.ivu-poptip-popper[x-placement=top-start] .ivu-poptip-arrow{left:16px}.ivu-poptip-popper[x-placement=top-end] .ivu-poptip-arrow{right:16px}.ivu-poptip-popper[x-placement^=right] .ivu-poptip-arrow{left:3px;border-width:7px 7px 7px 0;border-right-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=right] .ivu-poptip-arrow{top:50%;margin-top:-7px}.ivu-poptip-popper[x-placement=right-start] .ivu-poptip-arrow{top:8px}.ivu-poptip-popper[x-placement=right-end] .ivu-poptip-arrow{bottom:8px}.ivu-poptip-popper[x-placement^=left] .ivu-poptip-arrow{right:3px;border-width:7px 0 7px 7px;border-left-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=left] .ivu-poptip-arrow{top:50%;margin-top:-7px}.ivu-poptip-popper[x-placement=left-start] .ivu-poptip-arrow{top:8px}.ivu-poptip-popper[x-placement=left-end] .ivu-poptip-arrow{bottom:8px}.ivu-poptip-popper[x-placement^=bottom] .ivu-poptip-arrow{top:3px;border-width:0 7px 7px;border-bottom-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=bottom] .ivu-poptip-arrow{left:50%;margin-left:-7px}.ivu-poptip-popper[x-placement=bottom-start] .ivu-poptip-arrow{left:16px}.ivu-poptip-popper[x-placement=bottom-end] .ivu-poptip-arrow{right:16px}.ivu-poptip-popper[x-placement^=top] .ivu-poptip-arrow:after{content:\" \";bottom:1px;margin-left:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#fff}.ivu-poptip-popper[x-placement^=right] .ivu-poptip-arrow:after{content:\" \";left:1px;bottom:-7px;border-left-width:0;border-right-width:7px;border-right-color:#fff}.ivu-poptip-popper[x-placement^=bottom] .ivu-poptip-arrow:after{content:\" \";top:1px;margin-left:-7px;border-top-width:0;border-bottom-width:7px;border-bottom-color:#fff}.ivu-poptip-popper[x-placement^=left] .ivu-poptip-arrow:after{content:\" \";right:1px;border-right-width:0;border-left-width:7px;border-left-color:#fff;bottom:-7px}.ivu-poptip-arrow,.ivu-poptip-arrow:after{display:block;width:0;height:0;position:absolute;border-color:transparent;border-style:solid}.ivu-poptip-arrow{border-width:8px}.ivu-poptip-arrow:after{content:\"\";border-width:7px}.ivu-poptip-confirm .ivu-poptip-popper{max-width:300px}.ivu-poptip-confirm .ivu-poptip-inner{white-space:normal}.ivu-poptip-confirm .ivu-poptip-body{padding:16px 16px 8px}.ivu-poptip-confirm .ivu-poptip-body .ivu-icon{font-size:16px;color:#f90;line-height:18px;position:absolute}.ivu-poptip-confirm .ivu-poptip-body-message{padding-left:20px}.ivu-poptip-confirm .ivu-poptip-footer{text-align:right;padding:8px 16px 16px}.ivu-poptip-confirm .ivu-poptip-footer button{margin-left:4px}.ivu-input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;border-radius:4px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-input:-ms-input-placeholder{color:#c5c8ce}.ivu-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-input:hover{border-color:#57a3f3}.ivu-input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input[disabled],fieldset[disabled] .ivu-input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input[disabled]:hover,fieldset[disabled] .ivu-input:hover{border-color:#e3e5e8}textarea.ivu-input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-input-wrapper{display:inline-block;width:100%;position:relative;vertical-align:middle;line-height:normal}.ivu-input-icon{width:32px;height:32px;line-height:32px;font-size:16px;text-align:center;color:#808695;position:absolute;right:0;z-index:3}.ivu-input-hide-icon .ivu-input-icon{display:none}.ivu-input-icon-validate{display:none}.ivu-input-icon-clear{display:none}.ivu-input-wrapper:hover .ivu-input-icon-clear{display:inline-block}.ivu-input-icon-normal+.ivu-input{padding-right:32px}.ivu-input-hide-icon .ivu-input-icon-normal+.ivu-input{padding-right:7px}.ivu-input-wrapper-large .ivu-input-icon{font-size:18px;height:40px;line-height:40px}.ivu-input-wrapper-small .ivu-input-icon{width:24px;font-size:14px;height:24px;line-height:24px}.ivu-input-prefix,.ivu-input-suffix{width:32px;height:100%;text-align:center;position:absolute;left:0;top:0;z-index:1}.ivu-input-prefix i,.ivu-input-suffix i{font-size:16px;line-height:32px;color:#808695}.ivu-input-suffix{left:auto;right:0}.ivu-input-wrapper-small .ivu-input-prefix i,.ivu-input-wrapper-small .ivu-input-suffix i{font-size:14px;line-height:24px}.ivu-input-wrapper-large .ivu-input-prefix i,.ivu-input-wrapper-large .ivu-input-suffix i{font-size:18px;line-height:40px}.ivu-input-with-prefix{padding-left:32px}.ivu-input-with-suffix{padding-right:32px}.ivu-input-search{cursor:pointer;padding:0 16px!important;background:#2d8cf0!important;color:#fff!important;border-color:#2d8cf0!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;z-index:2}.ivu-input-search i{font-size:16px}.ivu-input-search:hover{background:#57a3f3!important;border-color:#57a3f3!important}.ivu-input-search:active{background:#2b85e4!important;border-color:#2b85e4!important}.ivu-input-search-icon{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-input-search-icon:hover{color:inherit}.ivu-input-search:before{content:'';display:block;width:1px;position:absolute;top:-1px;bottom:-1px;left:-1px;background:inherit}.ivu-input-wrapper-small .ivu-input-search{padding:0 12px!important}.ivu-input-wrapper-small .ivu-input-search i{font-size:14px}.ivu-input-wrapper-large .ivu-input-search{padding:0 20px!important}.ivu-input-wrapper-large .ivu-input-search i{font-size:18px}.ivu-input-with-search:hover .ivu-input{border-color:#57a3f3}.ivu-input-word-count{text-align:center;position:absolute;right:7px;top:1px;bottom:1px;padding-left:7px;background:#fff;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#808695;font-size:12px}.ivu-input-type-textarea .ivu-input-word-count{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;top:auto}.ivu-input-group{display:table;width:100%;border-collapse:separate;position:relative;font-size:14px;top:1px}.ivu-input-group-large{font-size:16px}.ivu-input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ivu-input-group>[class*=col-]{padding-right:8px}.ivu-input-group-append,.ivu-input-group-prepend,.ivu-input-group>.ivu-input{display:table-cell}.ivu-input-group-with-prepend .ivu-input,.ivu-input-group-with-prepend.ivu-input-group-small .ivu-input{border-top-left-radius:0;border-bottom-left-radius:0}.ivu-input-group-with-append .ivu-input,.ivu-input-group-with-append.ivu-input-group-small .ivu-input{border-top-right-radius:0;border-bottom-right-radius:0}.ivu-input-group-append .ivu-btn,.ivu-input-group-prepend .ivu-btn{border-color:transparent;background-color:transparent;color:inherit;margin:-6px -7px}.ivu-input-group-append,.ivu-input-group-prepend{width:1px;white-space:nowrap;vertical-align:middle}.ivu-input-group .ivu-input{width:100%;float:left;margin-bottom:0;position:relative;z-index:2}.ivu-input-group-append,.ivu-input-group-prepend{padding:4px 7px;font-size:inherit;font-weight:400;line-height:1;color:#515a6e;text-align:center;background-color:#f8f8f9;border:1px solid #dcdee2;border-radius:4px}.ivu-input-group-append .ivu-select,.ivu-input-group-prepend .ivu-select{margin:-5px -7px}.ivu-input-group-append .ivu-select-selection,.ivu-input-group-prepend .ivu-select-selection{background-color:inherit;margin:-1px;border:1px solid transparent}.ivu-input-group-append .ivu-select-visible .ivu-select-selection,.ivu-input-group-prepend .ivu-select-visible .ivu-select-selection{-webkit-box-shadow:none;box-shadow:none}.ivu-input-group-prepend,.ivu-input-group>.ivu-input:first-child,.ivu-input-group>span>.ivu-input:first-child{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.ivu-input-group-prepend .ivu--select .ivu--select-selection,.ivu-input-group>.ivu-input:first-child .ivu--select .ivu--select-selection,.ivu-input-group>span>.ivu-input:first-child .ivu--select .ivu--select-selection{border-bottom-right-radius:0;border-top-right-radius:0}.ivu-input-group-prepend{border-right:0}.ivu-input-group-append{border-left:0}.ivu-input-group-append,.ivu-input-group>.ivu-input:last-child{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.ivu-input-group-append .ivu--select .ivu--select-selection,.ivu-input-group>.ivu-input:last-child .ivu--select .ivu--select-selection{border-bottom-left-radius:0;border-top-left-radius:0}.ivu-input-group-large .ivu-input,.ivu-input-group-large>.ivu-input-group-append,.ivu-input-group-large>.ivu-input-group-prepend{font-size:16px;padding:6px 7px;height:40px}.ivu-input-group-small .ivu-input,.ivu-input-group-small>.ivu-input-group-append,.ivu-input-group-small>.ivu-input-group-prepend{padding:1px 7px;height:24px;border-radius:3px}.ivu-form-item-error .ivu-input{border:1px solid #ed4014}.ivu-form-item-error .ivu-input:hover{border-color:#ed4014}.ivu-form-item-error .ivu-input:focus{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-form-item-error .ivu-input-icon{color:#ed4014}.ivu-form-item-error .ivu-input-group-append,.ivu-form-item-error .ivu-input-group-prepend{background-color:#fff;border:1px solid #ed4014}.ivu-form-item-error .ivu-input-group-append .ivu-select-selection,.ivu-form-item-error .ivu-input-group-prepend .ivu-select-selection{background-color:inherit;border:1px solid transparent}.ivu-form-item-error .ivu-input-group-prepend{border-right:0}.ivu-form-item-error .ivu-input-group-append{border-left:0}.ivu-form-item-error .ivu-transfer .ivu-input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;border-radius:4px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-form-item-error .ivu-transfer .ivu-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-form-item-error .ivu-transfer .ivu-input:-ms-input-placeholder{color:#c5c8ce}.ivu-form-item-error .ivu-transfer .ivu-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-form-item-error .ivu-transfer .ivu-input:hover{border-color:#57a3f3}.ivu-form-item-error .ivu-transfer .ivu-input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-form-item-error .ivu-transfer .ivu-input[disabled],fieldset[disabled] .ivu-form-item-error .ivu-transfer .ivu-input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-form-item-error .ivu-transfer .ivu-input[disabled]:hover,fieldset[disabled] .ivu-form-item-error .ivu-transfer .ivu-input:hover{border-color:#e3e5e8}textarea.ivu-form-item-error .ivu-transfer .ivu-input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-form-item-error .ivu-transfer .ivu-input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-form-item-error .ivu-transfer .ivu-input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-form-item-error .ivu-transfer .ivu-input-icon{color:#808695}.ivu-form-item-validating .ivu-input-icon-validate{display:inline-block}.ivu-form-item-validating .ivu-input-icon+.ivu-input{padding-right:32px}.ivu-slider{line-height:normal}.ivu-slider-wrap{width:100%;height:4px;margin:16px 0;background-color:#e8eaec;border-radius:3px;vertical-align:middle;position:relative;cursor:pointer}.ivu-slider-button-wrap{width:18px;height:18px;text-align:center;background-color:transparent;position:absolute;top:-4px;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.ivu-slider-button-wrap .ivu-tooltip{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-slider-button{width:12px;height:12px;border:2px solid #57a3f3;border-radius:50%;background-color:#fff;-webkit-transition:all .2s linear;transition:all .2s linear;outline:0}.ivu-slider-button-dragging,.ivu-slider-button:focus,.ivu-slider-button:hover{border-color:#2d8cf0;-webkit-transform:scale(1.5);-ms-transform:scale(1.5);transform:scale(1.5)}.ivu-slider-button:hover{cursor:-webkit-grab;cursor:grab}.ivu-slider-button-dragging,.ivu-slider-button-dragging:hover{cursor:-webkit-grabbing;cursor:grabbing}.ivu-slider-bar{height:4px;background:#57a3f3;border-radius:3px;position:absolute}.ivu-slider-stop{position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.ivu-slider-marks{top:0;left:12px;width:18px;height:100%}.ivu-slider-marks-item{position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#808695;margin-top:15px}.ivu-slider-disabled{cursor:not-allowed}.ivu-slider-disabled .ivu-slider-wrap{background-color:#ccc;cursor:not-allowed}.ivu-slider-disabled .ivu-slider-bar{background-color:#ccc}.ivu-slider-disabled .ivu-slider-button{border-color:#ccc}.ivu-slider-disabled .ivu-slider-button-dragging,.ivu-slider-disabled .ivu-slider-button:hover{border-color:#ccc}.ivu-slider-disabled .ivu-slider-button:hover{cursor:not-allowed}.ivu-slider-disabled .ivu-slider-button-dragging,.ivu-slider-disabled .ivu-slider-button-dragging:hover{cursor:not-allowed}.ivu-slider-input .ivu-slider-wrap{width:auto;margin-right:100px}.ivu-slider-input .ivu-input-number{float:right;margin-top:-14px}.selectDropDown{width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader{line-height:normal}.ivu-cascader-rel{display:inline-block;width:100%;position:relative}.ivu-cascader .ivu-input{padding-right:24px;display:block;cursor:pointer}.ivu-cascader-disabled .ivu-input{cursor:not-allowed}.ivu-cascader-label{width:100%;height:100%;line-height:32px;padding:0 7px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;font-size:14px;position:absolute;left:0;top:0}.ivu-cascader-size-large .ivu-cascader-label{line-height:36px;font-size:14px}.ivu-cascader-size-small .ivu-cascader-label{line-height:26px}.ivu-cascader .ivu-cascader-arrow:nth-of-type(1){display:none;cursor:pointer}.ivu-cascader:hover .ivu-cascader-arrow:nth-of-type(1){display:inline-block}.ivu-cascader-show-clear:hover .ivu-cascader-arrow:nth-of-type(2){display:none}.ivu-cascader-arrow{position:absolute;top:50%;right:8px;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);font-size:14px;color:#808695;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-visible .ivu-cascader-arrow:nth-of-type(2){-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.ivu-cascader .ivu-select-dropdown{width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader .ivu-cascader-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cascader .ivu-cascader-menu-item:hover{background:#f3f3f3}.ivu-cascader .ivu-cascader-menu-item-focus{background:#f3f3f3}.ivu-cascader .ivu-cascader-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cascader .ivu-cascader-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cascader .ivu-cascader-menu-item-selected,.ivu-cascader .ivu-cascader-menu-item-selected:hover{color:#2d8cf0}.ivu-cascader .ivu-cascader-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cascader .ivu-cascader-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cascader .ivu-cascader-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cascader .ivu-cascader-large .ivu-cascader-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cascader .ivu-cascader-menu-item{white-space:normal}}.ivu-cascader .ivu-select-item span{color:#ed4014}.ivu-cascader-dropdown{padding:5px 0}.ivu-cascader-dropdown .ivu-select-dropdown-list{max-height:190px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto}.ivu-cascader-not-found-tip{padding:5px 0;text-align:center;color:#c5c8ce}.ivu-cascader-not-found-tip li:not([class^=ivu-]){list-style:none;margin-bottom:0}.ivu-cascader-not-found .ivu-select-dropdown{width:inherit}.ivu-cascader-menu{display:inline-block;min-width:100px;height:180px;margin:0;padding:5px 0!important;vertical-align:top;list-style:none;border-right:1px solid #e8eaec;overflow:auto}.ivu-cascader-menu:last-child{border-right-color:transparent;margin-right:-1px}.ivu-cascader-menu .ivu-cascader-menu-item{position:relative;padding-right:36px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-menu .ivu-cascader-menu-item i{font-size:12px;position:absolute;right:15px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-cascader-menu .ivu-cascader-menu-item-loading{margin-top:-6px}.ivu-cascader-menu .ivu-cascader-menu-item-active{background-color:#f3f3f3;color:#2d8cf0}.ivu-cascader-transfer{z-index:1060;width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader-transfer .ivu-cascader-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cascader-transfer .ivu-cascader-menu-item:hover{background:#f3f3f3}.ivu-cascader-transfer .ivu-cascader-menu-item-focus{background:#f3f3f3}.ivu-cascader-transfer .ivu-cascader-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cascader-transfer .ivu-cascader-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cascader-transfer .ivu-cascader-menu-item-selected,.ivu-cascader-transfer .ivu-cascader-menu-item-selected:hover{color:#2d8cf0}.ivu-cascader-transfer .ivu-cascader-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cascader-transfer .ivu-cascader-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cascader-transfer .ivu-cascader-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cascader-transfer .ivu-cascader-large .ivu-cascader-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cascader-transfer .ivu-cascader-menu-item{white-space:normal}}.ivu-cascader-transfer .ivu-select-item span{color:#ed4014}.ivu-cascader-transfer .ivu-cascader-menu-item{padding-right:24px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-transfer .ivu-cascader-menu-item-active{background-color:#f3f3f3;color:#2d8cf0}.ivu-form-item-error .ivu-cascader-arrow{color:#ed4014}.ivu-transfer{position:relative;line-height:1.5}.ivu-transfer-list{display:inline-block;width:180px;height:210px;font-size:14px;vertical-align:middle;position:relative;padding-top:35px}.ivu-transfer-list-with-footer{padding-bottom:35px}.ivu-transfer-list-header{padding:8px 16px;background:#f9fafc;color:#515a6e;border:1px solid #dcdee2;border-bottom:1px solid #e8eaec;border-radius:6px 6px 0 0;overflow:hidden;position:absolute;top:0;left:0;width:100%}.ivu-transfer-list-header-title{cursor:pointer}.ivu-transfer-list-header>span{padding-left:4px}.ivu-transfer-list-header-count{margin:0!important;float:right}.ivu-transfer-list-body{height:100%;border:1px solid #dcdee2;border-top:none;border-radius:0 0 6px 6px;position:relative;overflow:hidden}.ivu-transfer-list-body-with-search{padding-top:34px}.ivu-transfer-list-body-with-footer{border-radius:0}.ivu-transfer-list-content{height:100%;padding:4px 0;overflow:auto}.ivu-transfer-list-content-item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ivu-transfer-list-content-item>span{padding-left:4px}.ivu-transfer-list-content-not-found{display:none;text-align:center;color:#c5c8ce}li.ivu-transfer-list-content-not-found:only-child{display:block}.ivu-transfer-list-body-with-search .ivu-transfer-list-content{padding:6px 0 0}.ivu-transfer-list-body-search-wrapper{padding:8px 8px 0;position:absolute;top:0;left:0;right:0}.ivu-transfer-list-search{position:relative}.ivu-transfer-list-footer{border:1px solid #dcdee2;border-top:none;border-radius:0 0 6px 6px;position:absolute;bottom:0;left:0;right:0;zoom:1}.ivu-transfer-list-footer:after,.ivu-transfer-list-footer:before{content:\"\";display:table}.ivu-transfer-list-footer:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-transfer-operation{display:inline-block;margin:0 16px;vertical-align:middle}.ivu-transfer-operation .ivu-btn{display:block;min-width:24px}.ivu-transfer-operation .ivu-btn:first-child{margin-bottom:12px}.ivu-transfer-operation .ivu-btn span i,.ivu-transfer-operation .ivu-btn span span{vertical-align:middle}.ivu-transfer-list-content-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-transfer-list-content-item:hover{background:#f3f3f3}.ivu-transfer-list-content-item-focus{background:#f3f3f3}.ivu-transfer-list-content-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-transfer-list-content-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-transfer-list-content-item-selected,.ivu-transfer-list-content-item-selected:hover{color:#2d8cf0}.ivu-transfer-list-content-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-transfer-list-content-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-transfer-list-content-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-transfer-large .ivu-transfer-list-content-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-transfer-list-content-item{white-space:normal}}.ivu-table{width:inherit;height:100%;max-width:100%;overflow:hidden;color:#515a6e;font-size:14px;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-table-wrapper{position:relative;overflow:hidden}.ivu-table-wrapper-with-border{border:1px solid #dcdee2;border-bottom:0;border-right:0}.ivu-table-summary{border-top:1px solid #e8eaec}.ivu-table-summary tr td{background-color:#f8f8f9}.ivu-table-with-summary .ivu-table-tbody tr:last-child td{border-bottom:none}.ivu-table-resize-line{position:absolute;top:0;left:0;bottom:0;width:1px;border-right:1px dashed #e8eaec}.ivu-table-hide{opacity:0}.ivu-table:before{content:'';width:100%;height:1px;position:absolute;left:0;bottom:0;background-color:#dcdee2;z-index:1}.ivu-table-border:after{content:'';width:1px;height:100%;position:absolute;top:0;right:0;background-color:#dcdee2;z-index:3}.ivu-table-footer,.ivu-table-title{height:48px;line-height:48px;border-bottom:1px solid #e8eaec}.ivu-table-footer{border-bottom:none}.ivu-table-header{overflow:hidden}.ivu-table-header thead tr th{position:relative;height:100%;padding:8px 0}.ivu-table-header-resizable{position:absolute;width:10px;height:100%;bottom:0;right:-5px;cursor:col-resize;z-index:1}.ivu-table-overflowX{overflow-x:scroll}.ivu-table-overflowY{overflow-y:scroll}.ivu-table-tip{overflow-x:auto;overflow-y:hidden}.ivu-table-with-fixed-top.ivu-table-with-footer .ivu-table-footer{border-top:1px solid #dcdee2}.ivu-table-with-fixed-top.ivu-table-with-footer tbody tr:last-child td{border-bottom:none}.ivu-table td,.ivu-table th{min-width:0;height:48px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:left;text-overflow:ellipsis;vertical-align:middle;border-bottom:1px solid #e8eaec}.ivu-table th{height:40px;white-space:nowrap;overflow:hidden;background-color:#f8f8f9}.ivu-table td{background-color:#fff;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}td.ivu-table-column-left,th.ivu-table-column-left{text-align:left}td.ivu-table-column-center,th.ivu-table-column-center{text-align:center}td.ivu-table-column-right,th.ivu-table-column-right{text-align:right}.ivu-table table{table-layout:fixed}.ivu-table-border td,.ivu-table-border th{border-right:1px solid #e8eaec}.ivu-table-cell{padding-left:18px;padding-right:18px;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-table-cell-ellipsis{word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ivu-table-cell-tooltip{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-table-cell-tooltip-content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-table-cell-with-expand{height:47px;line-height:47px;padding:0;text-align:center}.ivu-table-cell-expand{cursor:pointer;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ivu-table-cell-expand i{font-size:14px}.ivu-table-cell-expand-expanded{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-table-cell-sort{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-table-cell-with-selection .ivu-checkbox-wrapper{margin-right:0}.ivu-table-hidden{visibility:hidden}th .ivu-table-cell{display:inline-block;word-wrap:normal;vertical-align:middle}td.ivu-table-expanded-cell{padding:20px 50px;background:#f8f8f9}.ivu-table-stripe .ivu-table-body tr:nth-child(2n) td,.ivu-table-stripe .ivu-table-fixed-body tr:nth-child(2n) td{background-color:#f8f8f9}.ivu-table-stripe .ivu-table-body tr.ivu-table-row-hover td,.ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-hover td{background-color:#ebf7ff}tr.ivu-table-row-hover td{background-color:#ebf7ff}.ivu-table-large{font-size:16px}.ivu-table-large th{height:48px}.ivu-table-large td{height:60px}.ivu-table-large-footer,.ivu-table-large-title{height:60px;line-height:60px}.ivu-table-large .ivu-table-cell-with-expand{height:59px;line-height:59px}.ivu-table-large .ivu-table-cell-with-expand i{font-size:16px}.ivu-table-small{font-size:12px}.ivu-table-small th{height:32px}.ivu-table-small td{height:40px}.ivu-table-small-footer,.ivu-table-small-title{height:40px;line-height:40px}.ivu-table-small .ivu-table-cell-with-expand{height:39px;line-height:39px}.ivu-table-row-highlight td,.ivu-table-stripe .ivu-table-body tr.ivu-table-row-highlight:nth-child(2n) td,.ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-highlight:nth-child(2n) td,tr.ivu-table-row-highlight.ivu-table-row-hover td{background-color:#ebf7ff}.ivu-table-fixed,.ivu-table-fixed-right{position:absolute;top:0;left:0;-webkit-box-shadow:2px 0 6px -2px rgba(0,0,0,.2);box-shadow:2px 0 6px -2px rgba(0,0,0,.2)}.ivu-table-fixed-right::before,.ivu-table-fixed::before{content:'';width:100%;height:1px;background-color:#dcdee2;position:absolute;left:0;bottom:0;z-index:4}.ivu-table-fixed-right{top:0;left:auto;right:0;-webkit-box-shadow:-2px 0 6px -2px rgba(0,0,0,.2);box-shadow:-2px 0 6px -2px rgba(0,0,0,.2)}.ivu-table-fixed-right-header{position:absolute;top:-1px;right:0;background-color:#f8f8f9;border-top:1px solid #dcdee2;border-bottom:1px solid #e8eaec}.ivu-table-fixed-header{overflow:hidden}.ivu-table-fixed-header thead tr th{position:relative;height:100%;padding:8px 0}.ivu-table-fixed-body{overflow:hidden;position:relative;z-index:3}.ivu-table-fixed-shadow{width:1px;height:100%;position:absolute;top:0;right:0;-webkit-box-shadow:1px 0 6px rgba(0,0,0,.2);box-shadow:1px 0 6px rgba(0,0,0,.2);overflow:hidden;z-index:1}.ivu-table-sort{display:inline-block;width:14px;height:12px;margin-top:-1px;vertical-align:middle;overflow:hidden;cursor:pointer;position:relative}.ivu-table-sort i{display:block;height:6px;line-height:6px;overflow:hidden;position:absolute;color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out;font-size:16px}.ivu-table-sort i:hover{color:inherit}.ivu-table-sort i.on{color:#2d8cf0}.ivu-table-sort i:first-child{top:0}.ivu-table-sort i:last-child{bottom:0}.ivu-table-filter{display:inline-block;cursor:pointer;position:relative}.ivu-table-filter i{color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-table-filter i:hover{color:inherit}.ivu-table-filter i.on{color:#2d8cf0}.ivu-table-filter-list{padding:8px 0 0}.ivu-table-filter-list-item{padding:0 12px 8px}.ivu-table-filter-list-item .ivu-checkbox-wrapper+.ivu-checkbox-wrapper{margin:0}.ivu-table-filter-list-item label{display:block}.ivu-table-filter-list-item label>span{margin-right:4px}.ivu-table-filter-list ul{padding-bottom:8px}.ivu-table-filter-list .ivu-table-filter-select-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-table-filter-list .ivu-table-filter-select-item:hover{background:#f3f3f3}.ivu-table-filter-list .ivu-table-filter-select-item-focus{background:#f3f3f3}.ivu-table-filter-list .ivu-table-filter-select-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-table-filter-list .ivu-table-filter-select-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-table-filter-list .ivu-table-filter-select-item-selected,.ivu-table-filter-list .ivu-table-filter-select-item-selected:hover{color:#2d8cf0}.ivu-table-filter-list .ivu-table-filter-select-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-table-filter-list .ivu-table-filter-select-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-table-filter-list .ivu-table-filter-select-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-table-filter-list .ivu-table-large .ivu-table-filter-select-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-table-filter-list .ivu-table-filter-select-item{white-space:normal}}.ivu-table-filter-footer{padding:4px;border-top:1px solid #e8eaec;overflow:hidden}.ivu-table-filter-footer button:first-child{float:left}.ivu-table-filter-footer button:last-child{float:right}.ivu-table-tip table{width:100%}.ivu-table-tip table td{text-align:center}.ivu-table-expanded-hidden{visibility:hidden}.ivu-table-popper{min-width:0;text-align:left}.ivu-table-popper .ivu-poptip-body{padding:0}.ivu-dropdown{display:inline-block}.ivu-dropdown .ivu-select-dropdown{overflow:visible;max-height:none}.ivu-dropdown .ivu-dropdown{width:100%}.ivu-dropdown-rel{position:relative}.ivu-dropdown-rel-user-select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-dropdown-menu{min-width:100px}.ivu-dropdown-transfer{width:auto}.ivu-dropdown-item-selected,.ivu-dropdown-item.ivu-dropdown-item-selected:hover{background:#f0faff}.ivu-dropdown-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-dropdown-item:hover{background:#f3f3f3}.ivu-dropdown-item-focus{background:#f3f3f3}.ivu-dropdown-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-dropdown-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-dropdown-item-selected,.ivu-dropdown-item-selected:hover{color:#2d8cf0}.ivu-dropdown-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-dropdown-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-dropdown-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-dropdown-large .ivu-dropdown-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-dropdown-item{white-space:normal}}.ivu-tabs{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;overflow:hidden;color:#515a6e;zoom:1}.ivu-tabs:after,.ivu-tabs:before{content:\"\";display:table}.ivu-tabs:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-tabs-bar{outline:0}.ivu-tabs-ink-bar{height:2px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#2d8cf0;position:absolute;left:0;bottom:1px;z-index:1;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.ivu-tabs-bar{border-bottom:1px solid #dcdee2;margin-bottom:16px}.ivu-tabs-nav-container{margin-bottom:-1px;line-height:1.5;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;overflow:hidden;position:relative;zoom:1}.ivu-tabs-nav-container:after,.ivu-tabs-nav-container:before{content:\"\";display:table}.ivu-tabs-nav-container:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-tabs-nav-container:focus{outline:0}.ivu-tabs-nav-container:focus .ivu-tabs-tab-focused{border-color:#57a3f3!important}.ivu-tabs-nav-container-scrolling{padding-left:32px;padding-right:32px}.ivu-tabs-nav-wrap{overflow:hidden;margin-bottom:-1px}.ivu-tabs-nav-scroll{overflow:hidden;white-space:nowrap}.ivu-tabs-nav-right{float:right;margin-left:5px}.ivu-tabs-nav-next,.ivu-tabs-nav-prev{width:32px;text-align:center;position:absolute;line-height:32px;cursor:pointer}.ivu-tabs-nav-next i,.ivu-tabs-nav-prev i{font-size:16px}.ivu-tabs-nav-prev{left:0}.ivu-tabs-nav-next{right:0}.ivu-tabs-nav-scrollable{padding:0 32px}.ivu-tabs-nav-scroll-disabled{display:none}.ivu-tabs-nav{padding-left:0;margin:0;float:left;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out,-webkit-transform .5s ease-in-out}.ivu-tabs-nav:after,.ivu-tabs-nav:before{display:table;content:\" \"}.ivu-tabs-nav:after{clear:both}.ivu-tabs-nav .ivu-tabs-tab-disabled{pointer-events:none;cursor:default;color:#ccc}.ivu-tabs-nav .ivu-tabs-tab{display:inline-block;height:100%;padding:8px 16px;margin-right:16px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;text-decoration:none;position:relative;-webkit-transition:color .3s ease-in-out;transition:color .3s ease-in-out}.ivu-tabs-nav .ivu-tabs-tab:hover{color:#57a3f3}.ivu-tabs-nav .ivu-tabs-tab:active{color:#2b85e4}.ivu-tabs-nav .ivu-tabs-tab .ivu-icon{width:14px;height:14px;margin-right:8px}.ivu-tabs-nav .ivu-tabs-tab-active{color:#2d8cf0}.ivu-tabs-mini .ivu-tabs-nav-container{font-size:14px}.ivu-tabs-mini .ivu-tabs-tab{margin-right:0;padding:8px 16px;font-size:12px}.ivu-tabs .ivu-tabs-content-animated{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;will-change:transform;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.ivu-tabs .ivu-tabs-tabpane{-ms-flex-negative:0;flex-shrink:0;width:100%;-webkit-transition:opacity .3s;transition:opacity .3s;opacity:1;outline:0}.ivu-tabs .ivu-tabs-tabpane-inactive{opacity:0;height:0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-nav-container{height:32px}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-ink-bar{visibility:hidden}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab{margin:0;margin-right:4px;height:31px;padding:5px 16px 4px;border:1px solid #dcdee2;border-bottom:0;border-radius:4px 4px 0 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:#f8f8f9}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab-active{height:32px;padding-bottom:5px;background:#fff;-webkit-transform:translateZ(0);transform:translateZ(0);border-color:#dcdee2;color:#2d8cf0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-nav-wrap{margin-bottom:0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab .ivu-tabs-close{width:0;height:22px;font-size:22px;margin-right:0;color:#999;text-align:right;vertical-align:middle;overflow:hidden;position:relative;top:-1px;-webkit-transform-origin:100% 50%;-ms-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab .ivu-tabs-close:hover{color:#444}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab-active .ivu-tabs-close,.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab:hover .ivu-tabs-close{width:22px;-webkit-transform:translateZ(0);transform:translateZ(0);margin-right:-6px}.ivu-tabs-no-animation>.ivu-tabs-content{-webkit-transform:none!important;-ms-transform:none!important;transform:none!important}.ivu-tabs-no-animation>.ivu-tabs-content>.ivu-tabs-tabpane-inactive{display:none}.ivu-menu{display:block;margin:0;padding:0;outline:0;list-style:none;color:#515a6e;font-size:14px;position:relative;z-index:900}.ivu-menu-horizontal{height:60px;line-height:60px}.ivu-menu-horizontal.ivu-menu-light:after{content:'';display:block;width:100%;height:1px;background:#dcdee2;position:absolute;bottom:0;left:0}.ivu-menu-vertical.ivu-menu-light:after{content:'';display:block;width:1px;height:100%;background:#dcdee2;position:absolute;top:0;bottom:0;right:0;z-index:1}.ivu-menu-light{background:#fff}.ivu-menu-dark{background:#515a6e}.ivu-menu-primary{background:#2d8cf0}.ivu-menu-item{display:block;outline:0;list-style:none;font-size:14px;position:relative;z-index:1;cursor:pointer;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.ivu-menu-item{color:inherit}a.ivu-menu-item:active,a.ivu-menu-item:hover{color:inherit}.ivu-menu-item>i{margin-right:6px}.ivu-menu-submenu-title span>i,.ivu-menu-submenu-title>i{margin-right:8px}.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-horizontal .ivu-menu-submenu{float:left;padding:0 20px;position:relative;cursor:pointer;z-index:3;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu{height:inherit;line-height:inherit;border-bottom:2px solid transparent;color:#515a6e}.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item-active,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item:hover,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu-active,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu:hover{color:#2d8cf0;border-bottom:2px solid #2d8cf0}.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu{color:rgba(255,255,255,.7)}.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item-active,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item:hover,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu-active,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu:hover{color:#fff}.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-submenu{color:#fff}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown{min-width:100%;width:auto;max-height:none}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{height:auto;line-height:normal;border-bottom:0;float:none}.ivu-menu-item-group{line-height:normal}.ivu-menu-item-group-title{height:30px;line-height:30px;padding-left:8px;font-size:12px;color:#999}.ivu-menu-item-group>ul{padding:0!important;list-style:none!important}.ivu-menu-vertical .ivu-menu-item,.ivu-menu-vertical .ivu-menu-submenu-title{padding:14px 24px;position:relative;cursor:pointer;z-index:1;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-menu-vertical .ivu-menu-item:hover,.ivu-menu-vertical .ivu-menu-submenu-title:hover{color:#2d8cf0}.ivu-menu-vertical .ivu-menu-submenu-title-icon{position:absolute;top:50%;right:24px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-menu-submenu-title-icon{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ivu-menu-horizontal .ivu-menu-opened>*>.ivu-menu-submenu-title-icon{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.ivu-menu-vertical .ivu-menu-opened>*>.ivu-menu-submenu-title-icon{-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.ivu-menu-vertical .ivu-menu-submenu-nested{padding-left:20px}.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item{padding-left:43px}.ivu-menu-vertical .ivu-menu-item-group-title{height:48px;line-height:48px;font-size:14px;padding-left:28px}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-group-title{color:rgba(255,255,255,.36)}.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu){color:#2d8cf0;background:#f0faff;z-index:2}.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):after{content:'';display:block;width:2px;position:absolute;top:0;bottom:0;right:0;background:#2d8cf0}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title{color:rgba(255,255,255,.7)}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):hover,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu):hover{background:#363e4f}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item:hover,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title:hover{color:#fff;background:#515a6e}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){color:#2d8cf0}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item:hover{color:#fff;background:0 0!important}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active:hover{border-right:none;color:#fff;background:#2d8cf0!important}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-child-item-active>.ivu-menu-submenu-title{color:#fff}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened{background:#363e4f}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-title{background:#515a6e}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-has-parent-submenu .ivu-menu-submenu-title{background:0 0}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item:hover{background:#f3f3f3}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-focus{background:#f3f3f3}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-selected,.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-selected:hover{color:#2d8cf0}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-menu-large .ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{white-space:normal}}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{padding:7px 16px 8px;font-size:14px!important}.ivu-date-picker{display:inline-block;line-height:normal}.ivu-date-picker-rel{position:relative}.ivu-date-picker .ivu-select-dropdown{width:auto;padding:0;overflow:visible;max-height:none}.ivu-date-picker-cells{width:196px;margin:10px;white-space:normal}.ivu-date-picker-cells span{display:inline-block;width:24px;height:24px}.ivu-date-picker-cells span em{display:inline-block;width:24px;height:24px;line-height:24px;margin:2px;font-style:normal;border-radius:3px;text-align:center;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-date-picker-cells-header span{line-height:24px;text-align:center;margin:2px;color:#c5c8ce}.ivu-date-picker-cells-cell:hover em{background:#e1f0fe}.ivu-date-picker-cells-focused em{-webkit-box-shadow:0 0 0 1px #2d8cf0 inset;box-shadow:0 0 0 1px #2d8cf0 inset}span.ivu-date-picker-cells-cell{width:28px;height:28px;cursor:pointer}.ivu-date-picker-cells-cell-next-month em,.ivu-date-picker-cells-cell-prev-month em{color:#c5c8ce}.ivu-date-picker-cells-cell-next-month:hover em,.ivu-date-picker-cells-cell-prev-month:hover em{background:0 0}span.ivu-date-picker-cells-cell-disabled,span.ivu-date-picker-cells-cell-disabled:hover,span.ivu-date-picker-cells-cell-week-label,span.ivu-date-picker-cells-cell-week-label:hover{cursor:not-allowed;color:#c5c8ce}span.ivu-date-picker-cells-cell-disabled em,span.ivu-date-picker-cells-cell-disabled:hover em,span.ivu-date-picker-cells-cell-week-label em,span.ivu-date-picker-cells-cell-week-label:hover em{color:inherit;background:inherit}span.ivu-date-picker-cells-cell-disabled,span.ivu-date-picker-cells-cell-disabled:hover{background:#f7f7f7}.ivu-date-picker-cells-cell-today em{position:relative}.ivu-date-picker-cells-cell-today em:after{content:'';display:block;width:6px;height:6px;border-radius:50%;background:#2d8cf0;position:absolute;top:1px;right:1px}.ivu-date-picker-cells-cell-range{position:relative}.ivu-date-picker-cells-cell-range em{position:relative;z-index:1}.ivu-date-picker-cells-cell-range:before{content:'';display:block;background:#e1f0fe;border-radius:0;border:0;position:absolute;top:2px;bottom:2px;left:0;right:0}.ivu-date-picker-cells-cell-selected em,.ivu-date-picker-cells-cell-selected:hover em{background:#2d8cf0;color:#fff}span.ivu-date-picker-cells-cell-disabled.ivu-date-picker-cells-cell-selected em{background:#c5c8ce;color:#f7f7f7}.ivu-date-picker-cells-cell-today.ivu-date-picker-cells-cell-selected em:after{background:#fff}.ivu-date-picker-cells-show-week-numbers{width:226px}.ivu-date-picker-cells-month,.ivu-date-picker-cells-year{margin-top:14px}.ivu-date-picker-cells-month span,.ivu-date-picker-cells-year span{width:40px;height:28px;line-height:28px;margin:10px 12px;border-radius:3px}.ivu-date-picker-cells-month span em,.ivu-date-picker-cells-year span em{width:40px;height:28px;line-height:28px;margin:0}.ivu-date-picker-cells-month .ivu-date-picker-cells-cell-focused,.ivu-date-picker-cells-year .ivu-date-picker-cells-cell-focused{background-color:#d5e8fc}.ivu-date-picker-header{height:32px;line-height:32px;text-align:center;border-bottom:1px solid #e8eaec}.ivu-date-picker-header-label{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-date-picker-header-label:hover{color:#2d8cf0}.ivu-date-picker-btn-pulse{background-color:#d5e8fc!important;border-radius:4px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.ivu-date-picker-prev-btn{float:left}.ivu-date-picker-prev-btn-arrow-double{margin-left:10px}.ivu-date-picker-prev-btn-arrow-double i:after{content:\"\\F115\";margin-left:-8px}.ivu-date-picker-next-btn{float:right}.ivu-date-picker-next-btn-arrow-double{margin-right:10px}.ivu-date-picker-next-btn-arrow-double i:after{content:\"\\F11F\";margin-left:-8px}.ivu-date-picker-with-range .ivu-picker-panel-body{min-width:432px}.ivu-date-picker-with-range .ivu-picker-panel-content{float:left}.ivu-date-picker-with-range .ivu-picker-cells-show-week-numbers{min-width:492px}.ivu-date-picker-with-week-numbers .ivu-picker-panel-body-date{min-width:492px}.ivu-date-picker-transfer{z-index:1060;max-height:none;width:auto}.ivu-date-picker-focused input{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-picker-panel-icon-btn{display:inline-block;width:20px;height:24px;line-height:26px;margin-top:2px;text-align:center;cursor:pointer;color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-picker-panel-icon-btn:hover{color:#2d8cf0}.ivu-picker-panel-icon-btn i{font-size:14px}.ivu-picker-panel-body-wrapper.ivu-picker-panel-with-sidebar{padding-left:92px}.ivu-picker-panel-sidebar{width:92px;float:left;margin-left:-92px;position:absolute;top:0;bottom:0;background:#f8f8f9;border-right:1px solid #e8eaec;border-radius:4px 0 0 4px;overflow:auto}.ivu-picker-panel-shortcut{padding:6px 16px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-picker-panel-shortcut:hover{background:#e8eaec}.ivu-picker-panel-body{float:left}.ivu-picker-confirm{border-top:1px solid #e8eaec;text-align:right;padding:8px;clear:both}.ivu-picker-confirm>span{color:#2d8cf0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;float:left;padding:2px 0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-picker-confirm>span:hover{color:#57a3f3}.ivu-picker-confirm>span:active{color:#2b85e4}.ivu-picker-confirm-time{float:left}.ivu-time-picker-cells{min-width:112px}.ivu-time-picker-cells-with-seconds{min-width:168px}.ivu-time-picker-cells-list{width:56px;max-height:144px;float:left;overflow:hidden;border-left:1px solid #e8eaec;position:relative}.ivu-time-picker-cells-list:hover{overflow-y:auto}.ivu-time-picker-cells-list:first-child{border-left:none;border-radius:4px 0 0 4px}.ivu-time-picker-cells-list:last-child{border-radius:0 4px 4px 0}.ivu-time-picker-cells-list ul{width:100%;margin:0;padding:0 0 120px 0;list-style:none}.ivu-time-picker-cells-list ul li{width:100%;height:24px;line-height:24px;margin:0;padding:0 0 0 16px;-webkit-box-sizing:content-box;box-sizing:content-box;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;list-style:none;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-time-picker-cells-cell:hover{background:#f3f3f3}.ivu-time-picker-cells-cell-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-time-picker-cells-cell-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-time-picker-cells-cell-selected,.ivu-time-picker-cells-cell-selected:hover{color:#2d8cf0;background:#f3f3f3}.ivu-time-picker-cells-cell-focused{background-color:#d5e8fc}.ivu-time-picker-header{height:32px;line-height:32px;text-align:center;border-bottom:1px solid #e8eaec}.ivu-time-picker-with-range .ivu-picker-panel-body{min-width:228px}.ivu-time-picker-with-range .ivu-picker-panel-content{float:left;position:relative}.ivu-time-picker-with-range .ivu-picker-panel-content:after{content:'';display:block;width:2px;position:absolute;top:31px;bottom:0;right:-2px;background:#e8eaec;z-index:1}.ivu-time-picker-with-range .ivu-picker-panel-content-right{float:right}.ivu-time-picker-with-range .ivu-picker-panel-content-right:after{right:auto;left:-2px}.ivu-time-picker-with-range .ivu-time-picker-cells-list:first-child{border-radius:0}.ivu-time-picker-with-range .ivu-time-picker-cells-list:last-child{border-radius:0}.ivu-time-picker-with-range.ivu-time-picker-with-seconds .ivu-picker-panel-body{min-width:340px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells{min-width:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds{min-width:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds .ivu-time-picker-cells-list{width:72px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds .ivu-time-picker-cells-list ul li{padding:0 0 0 28px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list{width:108px;max-height:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list:first-child{border-radius:0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list:last-child{border-radius:0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list ul{padding:0 0 192px 0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list ul li{padding:0 0 0 46px}.ivu-form .ivu-form-item-label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#515a6e;line-height:1;padding:10px 12px 10px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-form-label-left .ivu-form-item-label{text-align:left}.ivu-form-label-top .ivu-form-item-label{float:none;display:inline-block;padding:0 0 10px 0}.ivu-form-inline .ivu-form-item{display:inline-block;margin-right:10px;vertical-align:top}.ivu-form-item{margin-bottom:24px;vertical-align:top;zoom:1}.ivu-form-item:after,.ivu-form-item:before{content:\"\";display:table}.ivu-form-item:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-form-item-content{position:relative;line-height:32px;font-size:14px}.ivu-form-item .ivu-form-item{margin-bottom:0}.ivu-form-item .ivu-form-item .ivu-form-item-content{margin-left:0!important}.ivu-form-item-error-tip{position:absolute;top:100%;left:0;line-height:1;padding-top:6px;color:#ed4014}.ivu-form-item-required .ivu-form-item-label:before{content:'*';display:inline-block;margin-right:4px;line-height:1;font-family:SimSun;font-size:14px;color:#ed4014}.ivu-form-hide-required-mark .ivu-form-item-required .ivu-form-item-label:before{display:none}.ivu-carousel{position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.ivu-carousel-list,.ivu-carousel-track{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ivu-carousel-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.ivu-carousel-track{position:relative;top:0;left:0;display:block;overflow:hidden;z-index:1}.ivu-carousel-track.higher{z-index:2}.ivu-carousel-item{float:left;height:100%;min-height:1px;display:block}.ivu-carousel-arrow{border:none;outline:0;padding:0;margin:0;width:36px;height:36px;border-radius:50%;cursor:pointer;display:none;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.2s;transition:.2s;background-color:rgba(31,45,61,.11);color:#fff;text-align:center;font-size:1em;font-family:inherit;line-height:inherit}.ivu-carousel-arrow:hover{background-color:rgba(31,45,61,.5)}.ivu-carousel-arrow>*{vertical-align:baseline}.ivu-carousel-arrow.left{left:16px}.ivu-carousel-arrow.right{right:16px}.ivu-carousel-arrow-always{display:inherit}.ivu-carousel-arrow-hover{display:inherit;opacity:0}.ivu-carousel:hover .ivu-carousel-arrow-hover{opacity:1}.ivu-carousel-dots{z-index:10;display:none;position:relative;list-style:none;text-align:center;padding:0;width:100%;height:17px}.ivu-carousel-dots-inside{display:block;position:absolute;bottom:3px}.ivu-carousel-dots-outside{display:block;margin-top:3px}.ivu-carousel-dots li{position:relative;display:inline-block;vertical-align:top;text-align:center;margin:0 2px;padding:7px 0;cursor:pointer}.ivu-carousel-dots li button{border:0;cursor:pointer;background:#8391a5;opacity:.3;display:block;width:16px;height:3px;border-radius:1px;outline:0;font-size:0;color:transparent;-webkit-transition:all .5s;transition:all .5s}.ivu-carousel-dots li button.radius{width:6px;height:6px;border-radius:50%}.ivu-carousel-dots li:hover>button{opacity:.7}.ivu-carousel-dots li.ivu-carousel-active>button{opacity:1;width:24px}.ivu-carousel-dots li.ivu-carousel-active>button.radius{width:6px}.ivu-rate{display:inline-block;margin:0;padding:0;font-size:20px;vertical-align:middle;font-weight:400;font-style:normal}.ivu-rate-disabled .ivu-rate-star-content:before,.ivu-rate-disabled .ivu-rate-star:before{cursor:default}.ivu-rate-disabled .ivu-rate-star:hover{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ivu-rate-star-full,.ivu-rate-star-zero{position:relative}.ivu-rate-star-first{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden;opacity:0}.ivu-rate-star-first,.ivu-rate-star-second{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s ease;transition:all .3s ease;color:#e9e9e9;cursor:pointer}.ivu-rate-star-chart{display:inline-block;margin:0;padding:0;margin-right:8px;position:relative;font-family:Ionicons;-webkit-transition:all .3s ease;transition:all .3s ease}.ivu-rate-star-chart:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.ivu-rate-star-chart.ivu-rate-star-full .ivu-rate-star-first,.ivu-rate-star-chart.ivu-rate-star-full .ivu-rate-star-second{color:#f5a623}.ivu-rate-star-chart.ivu-rate-star-half .ivu-rate-star-first{opacity:1;color:#f5a623}.ivu-rate-star{display:inline-block;margin:0;padding:0;margin-right:8px;position:relative;font-family:Ionicons;-webkit-transition:all .3s ease;transition:all .3s ease}.ivu-rate-star:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.ivu-rate-star-content:before,.ivu-rate-star:before{color:#e9e9e9;cursor:pointer;content:\"\\F2BF\";-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:block}.ivu-rate-star-content{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden}.ivu-rate-star-content:before{color:transparent}.ivu-rate-star-full:before,.ivu-rate-star-half .ivu-rate-star-content:before{color:#f5a623}.ivu-rate-star-full:hover:before,.ivu-rate-star-half:hover .ivu-rate-star-content:before{color:#f7b84f}.ivu-rate-text{margin-left:8px;vertical-align:middle;display:inline-block;font-size:14px}.ivu-upload input[type=file]{display:none}.ivu-upload-list{margin-top:8px}.ivu-upload-list-file{padding:4px;color:#515a6e;border-radius:4px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;overflow:hidden;position:relative}.ivu-upload-list-file>span{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-upload-list-file>span i{display:inline-block;width:12px;height:12px;color:#515a6e;text-align:center}.ivu-upload-list-file:hover{background:#f3f3f3}.ivu-upload-list-file:hover>span{color:#2d8cf0}.ivu-upload-list-file:hover>span i{color:#515a6e}.ivu-upload-list-file:hover .ivu-upload-list-remove{opacity:1}.ivu-upload-list-remove{opacity:0;font-size:18px;cursor:pointer;float:right;margin-right:4px;color:#999;-webkit-transition:all .2s ease;transition:all .2s ease}.ivu-upload-list-remove:hover{color:#444}.ivu-upload-select{display:inline-block}.ivu-upload-drag{background:#fff;border:1px dashed #dcdee2;border-radius:4px;text-align:center;cursor:pointer;position:relative;overflow:hidden;-webkit-transition:border-color .2s ease;transition:border-color .2s ease}.ivu-upload-drag:hover{border:1px dashed #2d8cf0}.ivu-upload-dragOver{border:2px dashed #2d8cf0}.ivu-tree ul{list-style:none;margin:0;padding:0;font-size:14px}.ivu-tree ul.ivu-dropdown-menu{padding:0}.ivu-tree ul li{list-style:none;margin:8px 0;padding:0;white-space:nowrap;outline:0}.ivu-tree ul li.ivu-dropdown-item{margin:0;padding:7px 16px;white-space:nowrap}.ivu-tree li ul{margin:0;padding:0 0 0 18px}.ivu-tree-title{display:inline-block;margin:0;padding:0 4px;border-radius:3px;cursor:pointer;vertical-align:top;color:#515a6e;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-tree-title:hover{background-color:#eaf4fe}.ivu-tree-title-selected,.ivu-tree-title-selected:hover{background-color:#d5e8fc}.ivu-tree-arrow{cursor:pointer;width:12px;text-align:center;display:inline-block}.ivu-tree-arrow i{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;font-size:14px;vertical-align:middle}.ivu-tree-arrow-open i{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-tree-arrow-disabled{cursor:not-allowed}.ivu-tree .ivu-checkbox-wrapper{margin-right:4px;margin-left:4px}.ivu-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:50%}.ivu-avatar-image{background:0 0}.ivu-avatar .ivu-icon{position:relative;top:-1px}.ivu-avatar>*{line-height:32px}.ivu-avatar.ivu-avatar-icon{font-size:18px}.ivu-avatar-large{width:40px;height:40px;line-height:40px;border-radius:50%}.ivu-avatar-large>*{line-height:40px}.ivu-avatar-large.ivu-avatar-icon{font-size:24px}.ivu-avatar-large .ivu-icon{position:relative;top:-2px}.ivu-avatar-small{width:24px;height:24px;line-height:24px;border-radius:50%}.ivu-avatar-small>*{line-height:24px}.ivu-avatar-small.ivu-avatar-icon{font-size:14px}.ivu-avatar-square{border-radius:4px}.ivu-avatar>img{width:100%;height:100%}.ivu-color-picker{display:inline-block}.ivu-color-picker-hide{display:none}.ivu-color-picker-hide-drop{visibility:hidden}.ivu-color-picker-disabled{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-color-picker-disabled:hover{border-color:#e3e5e8}.ivu-color-picker>div:first-child:hover .ivu-input{border-color:#57a3f3}.ivu-color-picker>div:first-child.ivu-color-picker-disabled:hover .ivu-input{border-color:#e3e5e8}.ivu-color-picker .ivu-select-dropdown{padding:0}.ivu-color-picker-input.ivu-input:focus{-webkit-box-shadow:none;box-shadow:none}.ivu-color-picker-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-rel{line-height:0}.ivu-color-picker-color{width:18px;height:18px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px;position:relative;top:2px}.ivu-color-picker-color div{width:100%;height:100%;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);border-radius:2px}.ivu-color-picker-color-empty{background:#fff;overflow:hidden;text-align:center}.ivu-color-picker-color-empty i{font-size:18px;vertical-align:baseline}.ivu-color-picker-color-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-large .ivu-color-picker-color{width:20px;height:20px;top:1px}.ivu-color-picker-large .ivu-color-picker-color-empty i{font-size:20px}.ivu-color-picker-small .ivu-color-picker-color{width:14px;height:14px;top:3px}.ivu-color-picker-small .ivu-color-picker-color-empty i{font-size:14px}.ivu-color-picker-picker-wrapper{padding:8px 8px 0}.ivu-color-picker-picker-panel{width:240px;margin:0 auto;-webkit-box-sizing:initial;box-sizing:initial;position:relative}.ivu-color-picker-picker-alpha-slider,.ivu-color-picker-picker-hue-slider{height:10px;margin-top:8px;position:relative}.ivu-color-picker-picker-colors{margin-top:8px;overflow:hidden;border-radius:2px;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-picker-colors:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-picker-colors-wrapper{display:inline;width:20px;height:20px;float:left;position:relative}.ivu-color-picker-picker-colors-wrapper-color{outline:0;display:block;position:absolute;width:16px;height:16px;margin:2px;cursor:pointer;border-radius:2px;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.ivu-color-picker-picker-colors-wrapper-circle{width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);-ms-transform:translate(-2px,-2px);transform:translate(-2px,-2px);position:absolute;top:10px;left:10px;cursor:pointer}.ivu-color-picker-picker .ivu-picker-confirm{margin-top:8px}.ivu-color-picker-saturation-wrapper{width:100%;padding-bottom:75%;position:relative;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-saturation-wrapper:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-saturation,.ivu-color-picker-saturation--black,.ivu-color-picker-saturation--white{cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0}.ivu-color-picker-saturation--white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(rgba(255,255,255,0)));background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.ivu-color-picker-saturation--black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(rgba(0,0,0,0)));background:linear-gradient(to top,#000,rgba(0,0,0,0))}.ivu-color-picker-saturation-pointer{cursor:pointer;position:absolute}.ivu-color-picker-saturation-circle{width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);-ms-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.ivu-color-picker-hue{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-hue:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-hue-container{cursor:pointer;margin:0 2px;position:relative;height:100%}.ivu-color-picker-hue-pointer{z-index:2;position:absolute}.ivu-color-picker-hue-picker{cursor:pointer;margin-top:1px;width:4px;border-radius:1px;height:8px;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;-webkit-transform:translateX(-2px);-ms-transform:translateX(-2px);transform:translateX(-2px)}.ivu-color-picker-alpha{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-alpha:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-alpha-checkboard-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;border-radius:2px}.ivu-color-picker-alpha-checkerboard{position:absolute;top:0;right:0;bottom:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.ivu-color-picker-alpha-gradient{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px}.ivu-color-picker-alpha-container{cursor:pointer;position:relative;z-index:2;height:100%;margin:0 3px}.ivu-color-picker-alpha-pointer{z-index:2;position:absolute}.ivu-color-picker-alpha-picker{cursor:pointer;width:4px;border-radius:1px;height:8px;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;margin-top:1px;-webkit-transform:translateX(-2px);-ms-transform:translateX(-2px);transform:translateX(-2px)}.ivu-color-picker-confirm{margin-top:8px;position:relative;border-top:1px solid #e8eaec;text-align:right;padding:8px;clear:both}.ivu-color-picker-confirm-color{position:absolute;top:11px;left:8px}.ivu-color-picker-confirm-color-editable{top:8px;right:110px}.ivu-auto-complete .ivu-select-not-found{display:none}.ivu-auto-complete .ivu-icon-ios-close{display:none}.ivu-auto-complete:hover .ivu-icon-ios-close{display:inline-block}.ivu-auto-complete.ivu-select-dropdown{max-height:none}.ivu-auto-complete div,.ivu-auto-complete:focus{outline:0}.ivu-divider{font-family:\"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;font-size:14px;line-height:1.5;color:#515a6e;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;background:#e8eaec}.ivu-divider,.ivu-divider-vertical{margin:0 8px;display:inline-block;height:.9em;width:1px;vertical-align:middle;position:relative;top:-.06em}.ivu-divider-horizontal{display:block;height:1px;width:100%;min-width:100%;margin:24px 0;clear:both}.ivu-divider-horizontal.ivu-divider-with-text-center,.ivu-divider-horizontal.ivu-divider-with-text-left,.ivu-divider-horizontal.ivu-divider-with-text-right{display:table;white-space:nowrap;text-align:center;background:0 0;font-weight:500;color:#17233d;font-size:16px;margin:16px 0}.ivu-divider-horizontal.ivu-divider-with-text-center:after,.ivu-divider-horizontal.ivu-divider-with-text-center:before,.ivu-divider-horizontal.ivu-divider-with-text-left:after,.ivu-divider-horizontal.ivu-divider-with-text-left:before,.ivu-divider-horizontal.ivu-divider-with-text-right:after,.ivu-divider-horizontal.ivu-divider-with-text-right:before{content:'';display:table-cell;position:relative;top:50%;width:50%;border-top:1px solid #e8eaec;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%)}.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-center,.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-left,.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-right{font-size:14px;margin:8px 0}.ivu-divider-horizontal.ivu-divider-with-text-left .ivu-divider-inner-text,.ivu-divider-horizontal.ivu-divider-with-text-right .ivu-divider-inner-text{display:inline-block;padding:0 10px}.ivu-divider-horizontal.ivu-divider-with-text-left:before{top:50%;width:5%}.ivu-divider-horizontal.ivu-divider-with-text-left:after{top:50%;width:95%}.ivu-divider-horizontal.ivu-divider-with-text-right:before{top:50%;width:95%}.ivu-divider-horizontal.ivu-divider-with-text-right:after{top:50%;width:5%}.ivu-divider-inner-text{display:inline-block;padding:0 24px}.ivu-divider-dashed{background:0 0;border-top:1px dashed #e8eaec}.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed{border-top:0}.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed:before,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed:before,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed:before{border-style:dashed none none}.ivu-anchor{position:relative;padding-left:2px}.ivu-anchor-wrapper{overflow:auto;padding-left:4px;margin-left:-4px}.ivu-anchor-ink{position:absolute;height:100%;left:0;top:0}.ivu-anchor-ink:before{content:' ';position:relative;width:2px;height:100%;display:block;background-color:#e8eaec;margin:0 auto}.ivu-anchor-ink-ball{display:inline-block;position:absolute;width:8px;height:8px;border-radius:50%;border:2px solid #2d8cf0;background-color:#fff;left:50%;-webkit-transition:top .2s ease-in-out;transition:top .2s ease-in-out;-webkit-transform:translate(-50%,2px);-ms-transform:translate(-50%,2px);transform:translate(-50%,2px)}.ivu-anchor.fixed .ivu-anchor-ink .ivu-anchor-ink-ball{display:none}.ivu-anchor-link{padding:8px 0 8px 16px;line-height:1}.ivu-anchor-link-title{display:block;position:relative;-webkit-transition:all .3s;transition:all .3s;color:#515a6e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:8px}.ivu-anchor-link-title:only-child{margin-bottom:0}.ivu-anchor-link-active>.ivu-anchor-link-title{color:#2d8cf0}.ivu-anchor-link .ivu-anchor-link{padding-top:6px;padding-bottom:6px}.ivu-time-with-hash{cursor:pointer}.ivu-time-with-hash:hover{text-decoration:underline}.ivu-cell{position:relative;overflow:hidden}.ivu-cell-link,.ivu-cell-link:active,.ivu-cell-link:hover{color:inherit}.ivu-cell-icon{display:inline-block;margin-right:4px;font-size:14px;vertical-align:middle}.ivu-cell-icon:empty{display:none}.ivu-cell-main{display:inline-block;vertical-align:middle}.ivu-cell-title{line-height:24px;font-size:14px}.ivu-cell-label{line-height:1.2;font-size:12px;color:#808695}.ivu-cell-selected .ivu-cell-label{color:inherit}.ivu-cell-selected,.ivu-cell.ivu-cell-selected:hover{background:#f0faff}.ivu-cell-footer{display:inline-block;position:absolute;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%;right:16px;color:#515a6e}.ivu-cell-with-link .ivu-cell-footer{right:32px}.ivu-cell-selected .ivu-cell-footer{color:inherit}.ivu-cell-arrow{display:inline-block;position:absolute;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%;right:16px;font-size:14px}.ivu-cell:focus{background:#f3f3f3;outline:0}.ivu-cell-selected:focus{background:rgba(40,123,211,.91)}.ivu-cell{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cell:hover{background:#f3f3f3}.ivu-cell-focus{background:#f3f3f3}.ivu-cell-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cell-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cell-selected,.ivu-cell-selected:hover{color:#2d8cf0}.ivu-cell-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cell-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cell-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cell-large .ivu-cell{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cell{white-space:normal}}.ivu-drawer{width:auto;height:100%;position:fixed;top:0}.ivu-drawer-inner{position:absolute}.ivu-drawer-left{left:0}.ivu-drawer-right{right:0}.ivu-drawer-hidden{display:none!important}.ivu-drawer-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1000;-webkit-overflow-scrolling:touch;outline:0}.ivu-drawer-wrap-inner{position:absolute;overflow:hidden}.ivu-drawer-wrap-dragging{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-drawer-wrap *{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.ivu-drawer-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1000}.ivu-drawer-mask-hidden{display:none}.ivu-drawer-mask-inner{position:absolute}.ivu-drawer-content{width:100%;height:100%;position:absolute;top:0;bottom:0;background-color:#fff;border:0;background-clip:padding-box;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}.ivu-drawer-content-no-mask{pointer-events:auto}.ivu-drawer-header{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-drawer-header p,.ivu-drawer-header-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-drawer-close{z-index:1;font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-drawer-close .ivu-icon-ios-close{font-size:31px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:1px}.ivu-drawer-close .ivu-icon-ios-close:hover{color:#444}.ivu-drawer-body{width:100%;height:calc(100% - 51px);padding:16px;font-size:14px;line-height:1.5;word-wrap:break-word;position:absolute;overflow:auto}.ivu-drawer-no-header .ivu-drawer-body{height:100%}.ivu-drawer-no-mask{pointer-events:none}.ivu-drawer-no-mask .ivu-drawer-drag{pointer-events:auto}.ivu-drawer-drag{top:0;height:100%;width:0;position:absolute}.ivu-drawer-drag-left{right:0}.ivu-drawer-drag-move-trigger{width:8px;height:100px;line-height:100px;position:absolute;top:50%;background:#f3f3f3;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border-radius:4px/6px;-webkit-box-shadow:0 0 1px 1px rgba(0,0,0,.2);box-shadow:0 0 1px 1px rgba(0,0,0,.2);cursor:col-resize}.ivu-drawer-drag-move-trigger-point{display:inline-block;width:50%;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%)}.ivu-drawer-drag-move-trigger-point i{display:block;border-bottom:1px solid silver;padding-bottom:2px}.ivu-breadcrumb{color:#999;font-size:14px}.ivu-breadcrumb a{color:#515a6e;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-breadcrumb a:hover{color:#57a3f3}.ivu-breadcrumb>span:last-child{font-weight:700;color:#515a6e}.ivu-breadcrumb>span:last-child .ivu-breadcrumb-item-separator{display:none}.ivu-breadcrumb-item-separator{margin:0 8px;color:#dcdee2}.ivu-breadcrumb-item-link>.ivu-icon+span{margin-left:4px}.ivu-list{position:relative}.ivu-list-items{margin:0;padding:0;list-style:none}.ivu-list-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 0}.ivu-list-item-content{color:#515a6e}.ivu-list-item-meta{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;font-size:0}.ivu-list-item-meta-avatar{margin-right:16px}.ivu-list-item-meta-content{-webkit-box-flex:1;-ms-flex:1 0;flex:1 0}.ivu-list-item-meta-title{font-weight:500;margin-bottom:4px;color:#515a6e;font-size:14px;line-height:22px}.ivu-list-item-meta-title>a{color:#515a6e;-webkit-transition:all .2s;transition:all .2s}.ivu-list-item-meta-title>a:hover{color:#2d8cf0}.ivu-list-item-meta-description{color:rgba(0,0,0,.45);font-size:14px;line-height:22px}.ivu-list-item-action{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;margin-left:48px;padding:0;font-size:0;list-style:none}.ivu-list-item-action>li{position:relative;display:inline-block;padding:0 8px;color:rgba(0,0,0,.45);font-size:14px;line-height:22px;text-align:center;cursor:pointer}.ivu-list-item-action>li:after{content:'';position:absolute;top:50%;right:0;width:1px;height:14px;margin-top:-7px;background-color:#e8eaec}.ivu-list-item-action>li:first-child{padding-left:0}.ivu-list-item-action>li:last-child:after{display:none}.ivu-list-header{background:0 0}.ivu-list-footer{background:0 0}.ivu-list-footer,.ivu-list-header{padding-top:12px;padding-bottom:12px}.ivu-list-split .ivu-list-item{border-bottom:1px solid #e8eaec}.ivu-list-split .ivu-list-item:last-child{border-bottom:none}.ivu-list-split .ivu-list-header{border-bottom:1px solid #e8eaec}.ivu-list-split .ivu-list-footer{border-top:1px solid #e8eaec}.ivu-list-large .ivu-list-item{padding-top:16px;padding-bottom:16px}.ivu-list-small .ivu-list-item{padding-top:8px;padding-bottom:8px}.ivu-list-vertical .ivu-list-item{-webkit-box-align:initial;-ms-flex-align:initial;align-items:initial}.ivu-list-vertical .ivu-list-item-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1}.ivu-list-vertical .ivu-list-item-extra{margin-left:40px}.ivu-list-vertical .ivu-list-item-meta{margin-bottom:16px}.ivu-list-vertical .ivu-list-item-meta-title{margin-bottom:12px;color:rgba(0,0,0,.85);font-size:16px;line-height:24px}.ivu-list-vertical .ivu-list-item-action{margin-top:16px;margin-left:auto}.ivu-list-vertical .ivu-list-item-action>li{padding:0 16px}.ivu-list-vertical .ivu-list-item-action>li:first-child{padding-left:0}.ivu-list-item-no-flex{display:block}.ivu-list:not(.ivu-list-vertical) .ivu-list-item-no-flex .ivu-list-item-action{float:right}.ivu-list-bordered{border:1px solid #dcdee2;border-radius:6px}.ivu-list-bordered .ivu-list-header{padding-right:24px;padding-left:24px}.ivu-list-bordered .ivu-list-footer{padding-right:24px;padding-left:24px}.ivu-list-bordered .ivu-list-item{padding-right:24px;padding-left:24px;border-bottom:1px solid #e8eaec}.ivu-list-bordered .ivu-list-pagination{margin:16px 24px}.ivu-list-bordered.ivu-list-small .ivu-list-item{padding-right:16px;padding-left:16px}.ivu-list-bordered.ivu-list-small .ivu-list-footer,.ivu-list-bordered.ivu-list-small .ivu-list-header{padding:8px 16px}.ivu-list-bordered.ivu-list-large .ivu-list-footer,.ivu-list-bordered.ivu-list-large .ivu-list-header{padding:16px 24px}@media screen and (max-width:768px){.ivu-list-item-action{margin-left:24px}.ivu-list-vertical .ivu-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ivu-list-item{-ms-flex-wrap:wrap;flex-wrap:wrap}.ivu-list-item-action{margin-left:12px}.ivu-list-vertical .ivu-list-item{-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}.ivu-list-vertical .ivu-list-item-main{min-width:220px}.ivu-list-vertical .ivu-list-item-extra{margin:auto auto 16px}}"
  },
  {
    "path": "api-test/styles/main.css",
    "content": "html, body {\n  height: 100%;\n  margin: 0;\n  overflow: hidden;\n  padding: 10px; }\n\n.rong-box {\n  height: 100%;\n  overflow: auto; }\n\nh1 {\n  margin-bottom: 20px; }\n\n.rong-hidden {\n  display: none; }\n\n.rong-show {\n  display: block; }\n\n.rong-login .rong-input-form .rong-login-input-item {\n  max-width: 678px; }\n.rong-login .rong-input-form .rong-input-appkey, .rong-login .rong-input-form .rong-input-targetId {\n  max-width: 140px; }\n.rong-login .rong-connect-btn-box {\n  margin-left: 80px; }\n  .rong-login .rong-connect-btn-box button {\n    margin-right: 10px; }\n\n.rong-login-formitem .rong-prompt {\n  display: none;\n  font-size: 13px;\n  margin-left: 10px;\n  color: #484848; }\n\n.rong-login-formitem:hover .rong-prompt {\n  display: inline; }\n\n.rong-user-title {\n  background: #f5f5f5;\n  margin-bottom: 15px; }\n  .rong-user-title h4 {\n    padding: 15px 3px;\n    display: inline-block;\n    margin-right: 13px; }\n\n.rong-global-opt {\n  margin-bottom: 10px; }\n\n.rong-api-list {\n  position: absolute;\n  right: 50px;\n  width: 120px;\n  top: 30px; }\n  .rong-api-list button {\n    margin: 5px 0; }\n\n.rong-api-btn {\n  display: inline-block;\n  margin: 5px; }\n\n.rong-opt-list .rong-ready-box {\n  margin: 5px 0;\n  min-height: 40px; }\n\n.rong-api-btn-box {\n  position: relative; }\n  .rong-api-btn-box .rong-api-btn-set {\n    display: none; }\n  .rong-api-btn-box .rong-api-btn-run {\n    background-color: #2db7f5;\n    color: #fff; }\n  .rong-api-btn-box .rong-api-btn-config {\n    background-color: #47cb89;\n    color: #fff; }\n\n.rong-api-btn-box:active {\n  background-color: #fff;\n  border-color: #dcdee2;\n  color: #515a6e; }\n\n.rong-drag .rong-api-btn-box .rong-api-btn-set {\n  display: none; }\n.rong-drag .rong-api-btn-box .rong-api-btn-name {\n  z-index: 10; }\n\n.rong-tip-params {\n  padding-left: 20px; }\n\n.rong-current-output {\n  color: black;\n  overflow: auto; }\n\n.rong-out-list {\n  position: fixed;\n  right: 15px;\n  width: 200px;\n  top: 20px;\n  bottom: 25px;\n  overflow-y: auto;\n  overflow-x: auto; }\n  .rong-out-list .rong-out-item {\n    overflow-x: auto; }\n    .rong-out-list .rong-out-item p {\n      text-overflow: ellipsis;\n      white-space: nowrap; }\n\n.rong-parse-json-btn {\n  margin-top: 5px; }\n\n.rong-out-list-head {\n  margin-bottom: 7px; }\n\n.rong-json-content {\n  overflow: auto; }\n\n.rong-api-set-item .rong-api-set-name {\n  font-size: 12px; }\n\n.ivu-collapse > .rong-out-panel {\n  color: #19be6b; }\n  .ivu-collapse > .rong-out-panel .ivu-collapse-header {\n    color: inherit; }\n  .ivu-collapse > .rong-out-panel .rong-out-title {\n    position: absolute;\n    left: 35px;\n    right: 0;\n    height: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap; }\n\n.rong-api-btn-link {\n  color: #ff9900; }\n\n.rong-prompt-box button {\n  margin: 5px 2px;\n  font-size: 12px; }\n.rong-prompt-box p {\n  white-space: pre-wrap;\n  word-break: break-all; }\n\n.ivu-tooltip-popper {\n  z-index: 500 !important; }\n\n.rong-out-btn-list {\n  margin: 5px 0; }\n\n.rong-run-sel-prompt {\n  margin: 20px 0 0 5px; }\n\n.rong-api-prompt {\n  font-size: 12px;\n  color: #ff9900;\n  margin: -10px 0 10px 0; }\n\n.rong-out-list-display {\n  display: inline-block; }\n\n.rong-user-title h4 {\n  display: block; }\n\n.get-source {\n  display: none;\n  text-decoration: none;\n  background: #000;\n  color: #fff;\n  padding: 0.6rem 1.3rem;\n  border-radius: 5px;\n  z-index: 10;\n  font-size: 0.8rem;\n  position: relative;\n  margin-left: 1.4rem;\n  position: relative;\n  top: -0.2rem; }\n\n.get-source:hover {\n  color: #e9e9e9; }\n\n@media (min-width: 780px) {\n  .rong-opt-list {\n    padding-right: 300px; }\n\n  .rong-out-list {\n    width: 300px; }\n\n  .rong-user-title h4 {\n    display: inline-block; }\n\n  .rong-out-list-display {\n    display: none; }\n\n  .rong-out-list-content {\n    display: block !important; }\n\n  .get-source {\n    display: inline-block; } }\n.rong-run-info {\n  position: absolute;\n  left: 400px;\n  top: 12px;\n  color: red; }\n\n/*# sourceMappingURL=main.css.map */\n"
  },
  {
    "path": "api-test/styles/main.scss",
    "content": "@charset \"utf-8\";\n// sass-lint:disable nesting-depth\nhtml, body {\n  height: 100%;\n  margin: 0;\n  overflow: hidden;\n  padding: 10px;\n}\n.rong-box {\n  height: 100%;\n  overflow: auto;\n}\nh1 {\n  margin-bottom: 20px;\n}\n\n.rong-hidden {\n  display: none;\n}\n\n.rong-show {\n  display: block;\n}\n\n.rong-login {\n  .rong-input-form {\n    .rong-login-input-item {\n      // width: 50%;\n      max-width: 678px;\n    }\n    .rong-input-appkey, .rong-input-targetId {\n      // width: 10%;\n      max-width: 140px;\n    }\n  }\n  .rong-connect-btn-box {\n    margin-left: 80px;\n    button {\n      margin-right: 10px;\n    }\n  }\n}\n\n.rong-login-formitem {\n  .rong-prompt {\n    display: none;\n    font-size: 13px;\n    margin-left: 10px;\n    color: rgb(72, 72, 72);\n  }\n}\n.rong-login-formitem:hover {\n  .rong-prompt {\n    display: inline;\n  }\n}\n\n.rong-user-title {\n  background: #f5f5f5;\n  margin-bottom: 15px;\n  h4 {\n    padding: 15px 3px;\n    display: inline-block;\n    margin-right: 13px;\n  }\n  // button {\n  //   margin-left: 13px;\n  // }\n}\n\n.rong-global-opt {\n  margin-bottom: 10px;\n}\n.rong-api-list {\n  position: absolute;\n  right: 50px;\n  width: 120px;\n  top: 30px;\n  button {\n    margin: 5px 0;\n  }\n}\n.rong-api-btn {\n  display: inline-block;\n  margin: 5px;\n}\n\n.rong-opt-list {\n  .rong-ready-box {\n    margin: 5px 0;\n    min-height: 40px;\n  }\n  // .rong-api-btn:active {\n  //   .ivu-tooltip-popper {\n  //     display: none;\n  //   }\n  // }\n}\n.rong-api-btn-box {\n  position: relative;\n  .rong-api-btn-set {\n    display: none;\n  }\n  .rong-api-btn-run {\n    background-color: #2db7f5;\n    color: #fff;\n  }\n  .rong-api-btn-config {\n    background-color: #47cb89;\n    color: #fff;\n  }\n  // .rong-api-btn-doc {\n  //   background-color: #47cb89;\n  //   color: #fff;\n  // }\n}\n\n.rong-api-btn-box:active {\n  background-color: #fff;\n  border-color: #dcdee2;\n  color: #515a6e;\n}\n// .rong-api-btn-box:hover {\n//   .rong-api-btn-name {\n//     position: relative;\n//     z-index: -1;\n//   }\n//   .rong-api-btn-set {\n//     position: absolute;\n//     left: 0;\n//     top: 0;\n//     height: 100%;\n//     width: 100%;\n//     display: inline-block;\n//     border: none;\n//     padding: none;\n//     font-size: 12px;\n//     z-index: 100;\n//     button {\n//       width: 50%;\n//       height: 100%;\n//       border: none;\n//       cursor: pointer;\n//     }\n//   }\n// }\n\n.rong-drag .rong-api-btn-box {\n  .rong-api-btn-set {\n    display: none;\n  }\n  .rong-api-btn-name {\n    z-index: 10;\n  }\n}\n\n.rong-tip-params {\n  padding-left: 20px;\n}\n\n.rong-current-output {\n  color: black;\n  overflow: auto;\n}\n\n.rong-out-list {\n  position: fixed;\n  right: 15px;\n  width: 200px;\n  top: 20px;\n  bottom: 25px;\n  overflow-y: auto;\n  overflow-x: auto;\n  .rong-out-item {\n    overflow-x: auto;\n    p {\n      text-overflow:ellipsis;\n      white-space:nowrap;\n    }\n  }\n}\n\n.rong-parse-json-btn {\n  margin-top: 5px;\n}\n\n.rong-out-list-head {\n  margin-bottom: 7px;\n}\n.rong-json-content {\n  overflow: auto;\n}\n\n.rong-api-set-item {\n  .rong-api-set-name {\n    font-size: 12px;\n  }\n}\n.ivu-collapse>.rong-out-panel {\n  color: #19be6b;\n  .ivu-collapse-header {\n    color: inherit;\n  }\n  .rong-out-title {\n    position: absolute;\n    left: 35px;\n    right: 0;\n    height: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n}\n\n.rong-api-btn-link {\n  color: #ff9900;\n}\n\n.rong-prompt-box {\n  button {\n    margin: 5px 2px;\n    font-size: 12px;\n  }\n  p {\n    white-space: pre-wrap;\n    word-break: break-all;\n  }\n}\n\n.ivu-tooltip-popper {\n  z-index: 500 !important;\n}\n\n.rong-out-btn-list {\n  margin: 5px 0;\n}\n\n.rong-run-sel-prompt {\n  margin: 20px 0 0 5px;\n}\n\n.rong-api-prompt {\n  font-size: 12px;\n  color: #ff9900;\n  margin: -10px 0 10px 0;\n}\n\n.rong-out-list-display {\n  display: inline-block;\n}\n\n.rong-user-title h4 {\n  display: block;\n}\n\n.get-source {\n  display: none;\n  text-decoration: none;\n  background: #000;\n  color: #fff;\n  padding: 0.6rem 1.3rem;\n  border-radius: 5px;\n  z-index: 10;\n  font-size: 0.8rem;\n  position: relative;\n  margin-left: 1.4rem;\n  position: relative;\n  top: -0.2rem;\n}\n.get-source:hover {\n  color: rgb(233, 233, 233);\n}\n\n@media (min-width: 780px) {\n  .rong-opt-list {\n    padding-right: 300px;\n  }\n  .rong-out-list {\n    width: 300px;\n  }\n  .rong-user-title h4 {\n    display: inline-block;\n  }\n  .rong-out-list-display {\n    display: none;\n  }\n  .rong-out-list-content {\n    display: block !important;\n  }\n  .get-source {\n    display: inline-block;\n  }\n}\n\n.rong-run-info {\n  position: absolute;\n  left: 400px;\n  top: 12px;\n  color: red;\n}"
  },
  {
    "path": "api-test-v2/.gitignore",
    "content": ".node_modules\n.sass-cache\n*.css.map"
  },
  {
    "path": "api-test-v2/README.md",
    "content": "# api-test\n"
  },
  {
    "path": "api-test-v2/config.js",
    "content": "(function (win) {\n\n  var isDebug = false;\n\n  var im = {\n    appkey: 'n19jmcy59f1q9',\n    token: 'Kn2p4uokgY5AZOFVsKTbKq+YsUIoF3ojin3K277sfOnEb+B6ZpahsTOCVisdS43pwz7SnsSF0xxiLfygEojZP7ywLi39+nOPq12llTIt1oc=',\n    navi: '',\n    cmpUrl: '',\n    targetId: 'api_test_target',\n    isPolling: false\n  };\n\n  if (!isDebug) {\n    delete im.cmpUrl;\n  }\n\n  var config = {\n    im: im,\n    isDebug: isDebug,\n    debugConf: {\n      autoRun: false,\n      isShowMsg: false\n    }\n  };\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM = {\n    config: config,\n    components: {}\n  };\n\n})(window);"
  },
  {
    "path": "api-test-v2/debug.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>Api 测试合集</title>\n  <style>\n    button {\n      margin: 20px 5px;\n      cursor: pointer;\n      padding: 8px 13px;\n      font-size: 14px;\n      border-radius: 3px;\n    }\n    .rong-debug-box {\n      display: inline-block;\n      width: 620px;\n      height: 395px;\n      position: relative;\n      color: blue;\n      overflow: hidden;\n    }\n    .rong-debug-box iframe {\n      transform: scale(0.7) translate(-20%, -23%);\n      width: 120%;\n      height: 123%;\n    }\n  </style>\n</head>\n<body>\n  <div>\n    <button id=\"start\">运行所有</button>\n    <button id=\"stop\">停止所有</button>\n  </div>\n\n  <div class=\"rong-debug-box\">\n    <h3>导航 nav.cn.ronghub.com 测试</h3>\n    <iframe src=\"./index.html?navi=nav.cn.ronghub.com&encodeToken=pWpSohuml8zl31I89FO2Ya%2BYsUIoF3ojin3K277sfOmeZUaK52zRCqE2%2FMvHEnxtBfHuKrg2Jx%2FXWynmiU43mZYDJ4oFfrTzq12llTIt1oc%3D\" frameborder=\"0\"></iframe>\n  </div>\n\n  <div class=\"rong-debug-box\">\n    <h3>导航 nav2-cn.ronghub.com 测试</h3>\n    <iframe src=\"./index.html?navi=nav2-cn.ronghub.com&encodeToken=NmPNp6RZpNTw3mUpZl2%2Fn3xpRjANxKgfakOnYLFljI%2FVMkWXFzTBZetEqJUsTBd2%2FmZy8eMejlxoxhf%2Bz6pcVHrxyf4fSupp\" frameborder=\"0\"></iframe>\n  </div>\n\n  <div class=\"rong-debug-box\">\n    <h3>长轮训服务测试</h3>\n    <iframe src=\"./index.html?isPolling=true&encodeToken=Hm8Otq%2FG%2F2owz7vlMoRMcK%2BYsUIoF3ojin3K277sfOmeZUaK52zRCrvrhGPp1BQTQTst4S0rVibXWynmiU43mdfVsslWQf1Vq12llTIt1oc%3D\" frameborder=\"0\"></iframe>\n  </div>\n\n  <!-- <div class=\"rong-debug-box\">\n    <h3>小程序服务测试</h3>\n    <iframe src=\"./index.html?cmpUrl=cometproxy-cn.ronghub.com&isPolling=true&isMini=true\" frameborder=\"0\"></iframe>\n  </div> -->\n</body>\n\n<script>\n  function getAllIframe() {\n    return document.querySelectorAll('iframe');\n  }\n  function runAll() {\n    var iframeList = getAllIframe();\n    iframeList.forEach(function (iframe) {\n      iframe.contentWindow.postMessage('start');\n    });\n  }\n  function pauseAll() {\n    var iframeList = getAllIframe();\n    iframeList.forEach(function (iframe) {\n      iframe.contentWindow.postMessage('pause');\n    });\n  }\n\n  document.getElementById('start').onclick = runAll;\n  document.getElementById('stop').onclick = pauseAll;\n\n</script>\n\n</html>"
  },
  {
    "path": "api-test-v2/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  \n  <link rel=\"stylesheet\" href=\"./lib/styles/iview.css\">\n  <!-- <link rel=\"stylesheet\" href=\"./lib/styles/dragula-3.7.2.css\"> -->\n  <link rel=\"stylesheet\" href=\"./styles/main.css\">\n  \n  <script src=\"./lib/js/vue-2.6.10.js\"></script>\n  <script src=\"./lib/js/iview-4.0.2.min.js\"></script>\n  <script src=\"./lib/js/vue-json-pretty.js\"></script>\n  <script src=\"./lib/js/es6-promise.js\"></script>\n  <script src=\"./lib/js/Sortable.min.js\"></script>\n  <script src=\"./lib/js/vuedraggable.umd.min.js\"></script>\n  <script src=\"https://cdn.ronghub.com/RongIMLib-2.5.10.js\"></script>\n  <script src=\"./config.js\"></script>\n  <script src=\"./js/common/utils.js\"></script>\n  <script src=\"./js/common/service.js\"></script>\n  <script src=\"./js/common/api-list.js\"></script>\n\n  <script id=\"rong-global-config\" type=\"text/x-template\">\n    <div class=\"rong-login\">\n      <i-form :label-width=\"80\" class=\"rong-input-form\">\n        <FormItem class=\"rong-login-formitem\" v-for=\"item in configList\" v-bind:key=\"item.name\" :label=\"item.name\">\n          <i-input class=\"rong-login-input-item\" :class=\"'rong-input-' + item.name\" v-if=\"item.type === 'string'\" v-model=\"config[item.name]\" type=\"text\" :placeholder=\"prompt[item.name] || item.name\" />\n          <i-switch v-else-if=\"item.type === 'boolean'\" v-model=\"config[item.name]\" />\n          <span class=\"rong-prompt\" v-if=\"prompt[item.name]\">{{prompt[item.name]}}</span>\n        </FormItem>\n        <div class=\"rong-connect-btn-box\">\n          <i-button @click=\"login(config)\" type=\"primary\">开始链接</i-button>\n          <i-button @click=\"clearStorage()\" type=\"warning\">清空缓存</i-button>\n        </div>\n      </i-form>\n    </div>\n  </script>\n\n  <script id=\"rong-tpl-apibtn\" type=\"text/x-template\">\n    <div class=\"rong-api-btn\" :value=\"apiValue\">\n      <Tooltip placement=\"bottom\" :transfer=\"true\" :disabled=\"isdragging\">\n        <i-button class=\"rong-api-btn-box\" size=\"small\" @click=\"run()\">\n          <span class=\"rong-api-btn-name\">{{selfApi.name}}</span>\n          <!-- <div class=\"rong-api-btn-set\">\n            <button class=\"rong-api-btn-run\" @click=\"run()\">运行</button\n            ><button class=\"rong-api-btn-config\" @click=\"showEditDialog()\">设置</button\n            >\n          </div> -->\n        </i-button>\n        <div slot=\"content\" class=\"rong-prompt-box\">\n            <i-button v-if=\"hasParams\" size=\"small\" type=\"info\" @click=\"showEditDialog()\">修改配置</i-button>\n            <i-button size=\"small\" type=\"success\" @click=\"openUrl(selfApi.doc)\">查看文档</i-button>\n            <!-- <p><a class=\"rong-api-btn-link\" :href=\"selfApi.doc\" target=\"_blank\">点击查看文档</a></p>\n            <p><a class=\"rong-api-btn-link\" :href=\"selfApi.doc\" target=\"_blank\">点击配置参数</a></p> -->\n            <p>方法: {{selfApi.eventName}}</p>\n            <p>描述: {{selfApi.desc}}</p>\n            <p v-if=\"hasParams\">参数:</p>\n            <ul class=\"rong-tip-params\">\n              <li v-for=\"param in selfApi.params\" v-bind:key=\"param.name\">\n                {{param.name}} ({{param.type}})\n              </li>\n            </ul>\n        </div>\n      </Tooltip>\n\n      <Modal v-model=\"isShowEditDialog\" draggable scrollable title=\"参数设置\" width=\"395\">\n        <i-form :label-width=\"90\">\n          <FormItem v-for=\"param in paramList\" v-bind:key=\"param.name\" :label=\"param.name\" class=\"rong-api-set-item\">\n            <i-input v-if=\"param.type === 'string'\" v-model=\"param.value\" type=\"text\" :placeholder=\"param.name\" />\n            <i-input v-else-if=\"param.type === 'number'\" v-model=\"param.value\" type=\"number\" :placeholder=\"param.name\" />\n            <i-switch v-else-if=\"param.type === 'boolean'\" v-model=\"param.value\" @on-change=\"change\" />\n          </FormItem>\n        </i-form>\n        <div slot=\"footer\">\n            <i-button type=\"success\" @click=\"run()\">运行</i-button>\n            <i-button type=\"primary\" @click=\"hideEditDialog()\">确定</i-button>\n        </div>\n      </Modal>\n\n    </div>\n  </script>\n\n  <script id=\"rong-json-alert\" type=\"text/x-template\">\n    <Modal class=\"rong-json-alert\" v-model=\"isShow\">\n      <prettyjson class=\"rong-json-content\" :showLength=\"true\" :highlight-mouseover-node=\"true\" selectable-type=\"single\" :path=\"'res'\" :data=\"data\">\n      </prettyjson>\n      <div slot=\"footer\">\n          <i-button type=\"primary\" @click=\"hide()\">确定</i-button>\n      </div>\n    </Modal>\n  </script>\n\n  <script src=\"./js/components/button.js\"></script>\n  <script src=\"./js/components/json-alert.js\"></script>\n  <script src=\"./js/login.js\"></script>\n\n  <title>Api Test</title>\n</head>\n<body>\n  <div id=\"app\" class=\"rong-box rong-hidden\" :class=\"{ 'rong-drag': isDragging, 'rong-show': 1  }\">\n\n    <h1>\n      Web SDK Demo\n      <a target=\"_blank\" href=\"https://github.com/rongcloud/websdk-demo/blob/master/api-test.html\" title=\"点击查看源码\" class=\"get-source\">示例源码</a>\n    </h1>\n\n    <template v-if=\"isLogged\">\n      <div class=\"rong-run-info\" v-if=\"isDebug\">\n        <p>成功次数: <b>{{runInfo.runCount}}</b></p>\n        <p>成功 Api 个数: <b>{{runInfo.successApiCount}}</b></p>\n        <p>失败 Api 个数: <b>{{runInfo.failApiList.length}}</b></p>\n      </div>\n\n      <!-- <div class=\"rong-global-opt\">\n        <i-button class=\"rong-runall-btn\" size=\"small\" @click=\"runAllApi()\">运行全部</i-button>\n      </div> -->\n\n      <div class=\"rong-user-title\">\n        <h4>当前用户 id： {{currentUserId}}</h4>\n        <i-button class=\"rong-runall-btn\" size=\"small\" @click=\"isShowRunType=true\">运行全部</i-button>\n        <components class=\"rong-changeuser-btn\" is=\"apiBtn\"\n          :api=\"changeUserApi\" :isdragging=\"isDragging\"></components>\n        <i-button v-if=\"isDebug\" class=\"rong-runall-btn\" size=\"small\" type=\"error\" @click=\"isAlarmMuted=!isAlarmMuted\">{{ isAlarmMuted ? '取消静音' : '点击静音' }}</i-button>\n      </div>\n\n      <p class=\"rong-api-prompt\">\n        <b>注:</b>\n        <span>以下 Api 按钮可拖拽移动顺序, 点击运行全部按钮, 按当前展示顺序运行 Api</span>\n      </p>\n\n      <div class=\"rong-opt-list\">\n          <div v-for=\"(readyList, index) in readyApiQueue\" v-bind:key=\"readyList.id\" class=\"rong-ready-box\">\n            <draggable :list=\"readyList\" group=\"people\" @start=\"startDragging()\" @end=\"isDragging=false\">\n                <!-- <span>{{index + 1}}</span> -->\n                <components :ref=\"'readyApi' + index\" v-for=\"api in readyList\" v-bind:key=\"api.name\" class=\"rong-ready-btn\" is=\"apiBtn\" :api=\"api\" :isdragging=\"isDragging\"></components>\n            </draggable>\n          </div>\n      </div>\n\n      <div class=\"rong-current-output\" v-if=\"currentOutput\">\n        <p><b>{{currentOutput.title}}</b></p>\n        <p><b>耗时:</b> {{currentOutput.consumedTime}} ms</p>\n        <p><b>参数:</b> {{toJSON(currentOutput.params)}}</p>\n        <template v-if=\"currentOutput.result\">\n          <p><b>返回值:</b></p>\n          <prettyjson :showLength=\"true\" :highlight-mouseover-node=\"true\" selectable-type=\"single\" :path=\"'res'\"\n            :data=\"currentOutput.result\"></prettyjson>\n        </template>\n      </div>\n      \n      <!-- <div class=\"rong-api-list\">\n        <components class=\"rong-api-source\" v-for=\"api in apiList\" v-bind:key=\"api.name\" is=\"apiBtn\" :api=\"api\"></components>\n      </div> -->\n      \n      <div class=\"rong-out-list\">\n        <div class=\"rong-out-list-head\">\n          <h4>调用结果如下:</h4>\n          <div class=\"rong-out-btn-list\">\n            <i-button size=\"small\" @click=\"clearOutput()\">清空</i-button>\n            <i-button size=\"small\" @click=\"showAllOutput()\">显示全部</i-button>\n            <i-button class=\"rong-out-list-display\" size=\"small\" @click=\"isShowOutList=!isShowOutList\">{{ isShowOutList ? '隐藏' : '展开' }}</i-button>\n          </div>\n        </div>\n        <Collapse class=\"rong-out-list-content\" v-if=\"displayedOutputList.length\" v-show=\"isShowOutList\">\n          <Panel v-for=\"(output, index) in reverse(displayedOutputList)\" class=\"rong-out-panel\" v-bind:key=\"output.id\" :name=\"index + ''\" :style=\"{ color: output.config.color }\">\n            <span :title=\"output.title\" class=\"rong-out-title\">{{displayedOutputList.length - index}}. {{output.title}}</span>\n            <div slot=\"content\" class=\"rong-out-item\">\n              <p><b>时间:</b> {{output.time}}</p>\n              <p v-if=\"output.consumedTime\"><b>耗时:</b> {{output.consumedTime}} ms</p>\n              <p v-if=\"output.params && output.params.length\"><b>参数:</b> {{toJSON(output.params)}}</p>\n              <p v-if=\"output.result\"><b>返回值:</b> {{toJSON(output.result)}}</p>\n              <i-button v-if=\"output.result\" class=\"rong-parse-json-btn\" size=\"small\" type=\"primary\" @click=\"showJSONAlert(output.result)\">点击解析返回值\n              </i-button>\n            </div>\n          </Panel>\n        </Collapse>\n      </div>\n\n    </template>\n\n    <components v-else is=\"login\" :login=\"login\" :config=\"globalConfig\"></components>\n\n    <Modal v-model=\"isShowRunType\" draggable scrollable title=\"运行方式\" width=\"395\">\n      <i-form :label-width=\"90\">\n          <i-select v-model=\"runType\">\n            <i-option v-for=\"opt, key in RunType\" v-bind:key=\"key\" :value=\"key\">{{opt.name}}</i-option>\n          </i-select>\n          <p class=\"rong-run-sel-prompt\">\n            <b>提示:</b>\n            <span>{{RunType[runType].prompt}}</span>\n          </p>\n      </i-form>\n      <div slot=\"footer\">\n        <i-button type=\"success\" @click=\"runAllApi();isShowRunType=false;\">运行</i-button>\n      </div>\n    </Modal>\n\n    <audio ref=\"alarm\" style=\"opacity: 0; position: absolute;\" src=\"./styles/alarm.mp3\"></audio>\n\n  </div>\n</body>\n\n<script src=\"./js/main.js\"></script>\n\n</html>"
  },
  {
    "path": "api-test-v2/js/common/api-list.js",
    "content": "(function (win, dependencies) {\n  var RongIMLib = win.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient;\n\n  var RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    Service = RongIM.Service,\n    config = RongIM.config.im,\n    urlQueryConfig = utils.getUrlQuery();\n\n  var MiniUnSupportEventList = [\n    'sendRecallMessage', 'deleteRemoteMessages', 'clearRemoteHistoryMessages'\n  ];\n\n  var disconnect = {\n    name: '断开链接',\n    event: Service.disconnect,\n    eventName: 'disconnect',\n    desc: '断开链接',\n    doc: 'https://docs.rongcloud.cn/v2/views/im/noui/guide/private/connection/disconnect/web.html',\n    params: []\n  };\n\n  var reconnect = {\n    name: '重新链接',\n    event: Service.reconnect,\n    eventName: 'reconnect',\n    desc: '重新链接',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/connection/reconnect/web.html',\n    params: [\n      { name: '是否嗅探', type: 'boolean', value: true },\n      { name: '嗅探 url', type: 'string', value: 'https://cdn.ronghub.com/RongIMLib-2.2.6.min.js?d=' + Date.now() },\n      { name: '嗅探频率', type: 'string', value: '100,1000,3000,3000,3000' }\n    ]\n  };\n\n  var changeUser = {\n    name: '切换用户',\n    evnet: utils.noop,\n    eventName: 'logout',\n    desc: '切换用户',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/connection/disconnect/web.html#logout',\n    params: [\n      { name: 'Token', type: 'string', value: '5JQlp5czM31GNl99DOZyI3xpRjANxKgfakOnYLFljI+TMvOF0hGaVtR1n9Qp4baLgKBGsyl3w5j4gAWBbNZ3nOKrvnVo8Ldl' }\n    ]\n  };\n\n  var registerMessage = {\n    name: '注册自定义消息',\n    event: Service.registerMessage,\n    eventName: 'registerMessageType',\n    desc: '注册自定义消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web.html#createcustom',\n    params: [\n      { name: 'messageType', type: 'string', value: 'PersonMessage' },\n      { name: 'objectName', type: 'string', value: 's:person' },\n      { name: '是否计数', type: 'boolean', value: true },\n      { name: '是否存储', type: 'boolean', value: true },\n      { name: '属性', type: 'string', value: 'name,age' },\n    ]\n  };\n\n  var getConversationList = {\n    name: '获取会话列表',\n    event: Service.getConversationList,\n    eventName: 'getConversationList',\n    desc: '获取会话列表',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/conversation/getall/web.html',\n    params: [\n      { name: '数量', type: 'number', value: 1000 }\n    ]\n  };\n\n  var removeConversation = {\n    name: '删除会话列表',\n    event: Service.removeConversation,\n    eventName: 'removeConversation',\n    desc: '删除会话列表',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/conversation/clearall/web.html',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getHistoryMessages = {\n    name: '获取历史消息',\n    event: Service.getHistoryMessages,\n    eventName: 'getHistoryMessages',\n    desc: '获取历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/storage/web.html',\n    params: [\n      { name: '时间戳', type: 'number', value: 0 },\n      { name: '数量', type: 'number', value: 20 },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var deleteRemoteMessages = {\n    name: '删除历史消息(按消息)',\n    event: Service.deleteRemoteMessages,\n    eventName: 'deleteRemoteMessages',\n    desc: '按消息删除指定历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/delete/web.html#deletebyid',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '消息方向', type: 'number', value: 1, event: Service.getLastCacheMsgDirection },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var clearHistoryMessages = {\n    name: '删除历史消息(按时间)',\n    event: Service.clearHistoryMessages,\n    eventName: 'clearRemoteHistoryMessages',\n    desc: '按时间删除历史消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/delete/web.html#delete',\n    params: [\n      { name: '删除时间戳', type: 'number', value: Date.now()  },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var sendTextMessage = {\n    name: '发送文字消息',\n    event: Service.sendTextMessage,\n    eventName: 'sendMessage',\n    desc: '发送文字消息(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web.html#TxtMsg',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文字消息' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendImageMessage = {\n    name: '发送图片消息',\n    event: Service.sendImageMessage,\n    eventName: 'sendMessage',\n    desc: '发送图片消息(ImageMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web.html#ImgTextMsg',\n    params: [\n      { name: '缩略图', type: 'string', value: utils.getBase64Image() },\n      { name: '原图 url', type: 'string', value: 'http://rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendFileMessage = {\n    name: '发送文件消息',\n    event: Service.sendFileMessage,\n    eventName: 'sendMessage',\n    desc: '发送文件消息(FileMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web.html#FileMsg',\n    params: [\n      { name: '文件名', type: 'string', value: 'logo_wx' },\n      { name: '文件大小', type: 'number', value: 2000000000 },\n      { name: '文件类型', type: 'string', value: 'png' },\n      { name: '文件 url', type: 'string', value: 'http://rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendVoiceMessage = {\n    name: '发送语音消息',\n    event: Service.sendVoiceMessage,\n    eventName: 'sendMessage',\n    desc: '发送语音消息(HQVoiceMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgsend/web.html#HQVCMsg',\n    params: [\n      { name: '语音 url', type: 'string', value: 'https://rongcloud-audio.cn.ronghub.com/audio_amr__RC-2020-03-17_42_1584413950049.aac?e=1599965952&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:CDngyWj7ZApNmAfoecng7L_3SaU=' },\n      { name: '语音时长', type: 'number', value: 7 },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendRecallMessage = {\n    name: '发送撤回消息',\n    event: Service.sendRecallMessage,\n    eventName: 'sendRecallMessage',\n    desc: '发送撤回消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/msgmanage/msgrecall/web.html',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendAtMessage = {\n    name: '发送 @ 消息',\n    event: Service.sendAtMessage,\n    eventName: 'sendMessage',\n    desc: '发送 @ 消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web.html#at',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文本消息, 我 @ 了其他人' },\n      { name: '@ 对象 id', type: 'string', value: config.targetId },\n      { name: '会话类型', type: 'number', value: 3 },\n      { name: '群组 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n      \n    ]\n  };\n\n  var sendRegisterMessage = {\n    name: '发送自定义消息',\n    event: Service.sendRegisterMessage,\n    eventName: 'sendMessage',\n    desc: '发送自定义消息(RegisterMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web.html#send',\n    params: [\n      { name: '消息类型', type: 'string', value: 'PersonMessage' },\n      { name: '属性值', type: 'string', value: 'name,age' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendLocationMessage = {\n    name: '发送位置消息',\n    event: Service.sendLocationMessage,\n    eventName: 'sendMessage',\n    desc: '发送位置消息(sendLocationMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web.html#LBSMsg',\n    params: [\n      { name: '位置缩略图', type: 'string', value: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABsSFBcUERsXFhceHBsgKE' },\n      { name: '维度', type: 'number', value: 40.0317727 },\n      { name: '经度', type: 'number', value: 116.4175057 },\n      { name: '位置信息', type: 'string', value: '北苑路北辰·泰岳' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendRichContentMessage = {\n    name: '发送富文本消息',\n    event: Service.sendRichContentMessage,\n    eventName: 'sendMessage',\n    desc: '发送富文本(图文)消息(sendRichContentMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web.html#ImgTextMsg',\n    params: [\n      { name: '图文标题', type: 'string', value: '标题: 融云' },\n      { name: '图文内容', type: 'string', value: '为用户提供 IM 即时通讯和音视频通讯云服务' },\n      { name: '图片信息', type: 'string', value: 'https://www.rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '图文链接', type: 'string', value: 'https://developer.rongcloud.cn' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var sendTypingStatusMessage = {\n    name: '发送正在输入状态消息',\n    event: Service.sendTypingStatusMessage,\n    eventName: 'sendMessage',\n    desc: '发送正在输入状态消息(sendTypingStatusMessage)',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web.html#TypSts',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '消息 ObjectName', type: 'string', value: 'RC:TxtMsg' },\n      { name: '携带信息', type: 'string', value: '携带信息' },\n      { name: '静默消息', type: 'boolean', value: false }\n    ]\n  };\n\n  var getUnreadCount = {\n    name: '获取会话未读数',\n    event: Service.getUnreadCount,\n    eventName: 'getUnreadCount',\n    desc: '获取指定会话未读数',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/conversation/unreadcount/web.html#one',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getTotalUnreadCount = {\n    name: '获取会话未读数总数',\n    event: Service.getTotalUnreadCount,\n    eventName: 'getTotalUnreadCount',\n    desc: '获取会话未读总数',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/conversation/unreadcount/web.html',\n    params: [\n    ]\n  };\n\n  var clearUnreadCount = {\n    name: '清除会话未读数',\n    event: Service.clearUnreadCount,\n    eventName: 'clearUnreadCount',\n    desc: '清除指定会话未读数',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/conversation/unreadcount/web.html#clear',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var joinChatRoom = {\n    name: '加入聊天室',\n    event: Service.joinChatRoom,\n    eventName: 'joinChatRoom',\n    desc: '加入指定聊天室, 并拉取消息',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#join',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '拉取消息数', type: 'number', value: 2 }\n    ]\n  };\n\n  var quitChatRoom = {\n    name: '退出聊天室',\n    event: Service.quitChatRoom,\n    eventName: 'quitChatRoom',\n    desc: '退出聊天室',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#quit',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getChatRoomInfo = {\n    name: '获取聊天室信息',\n    event: Service.getChatRoomInfo,\n    eventName: 'getChatRoomInfo',\n    desc: '获取聊天室信息',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#get',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '获取人数', type: 'number', value: 20 },\n      { name: '排序方式', type: 'number', value: 1 }\n    ]\n  };\n\n  var setChatroomEntry = {\n    name: '设置聊天室属性',\n    event: Service.setChatroomEntry,\n    eventName: 'setChatroomEntry',\n    desc: '设置聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#_1',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '属性 value', type: 'string', value: '我是一个聊天室 value' },\n      { name: '是否退出清除', type: 'boolean', value: true },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var forceSetChatroomEntry = {\n    name: '设置聊天室属性(强制)',\n    event: Service.forceSetChatroomEntry,\n    eventName: 'forceSetChatroomEntry',\n    desc: '强制设置聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#_2',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey2' },\n      { name: '属性 value', type: 'string', value: '我是一个聊天室 value' },\n      { name: '是否退出清除', type: 'boolean', value: true },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var removeChatroomEntry = {\n    name: '删除聊天室属性',\n    event: Service.removeChatroomEntry,\n    eventName: 'removeChatroomEntry',\n    desc: '删除聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#_3',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var forceRemoveChatroomEntry = {\n    name: '删除聊天室属性(强制)',\n    event: Service.forceRemoveChatroomEntry,\n    eventName: 'forceRemoveChatroomEntry',\n    desc: '强制删除聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#_4',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey2' },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getChatroomEntry = {\n    name: '获取聊天室属性',\n    event: Service.getChatroomEntry,\n    eventName: 'getChatroomEntry',\n    desc: '获取指定聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#_5',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getAllChatroomEntries = {\n    name: '获取聊天室属性(所有)',\n    event: Service.getAllChatroomEntries,\n    eventName: 'getAllChatroomEntries',\n    desc: '获取所有聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/chatroom/#_6',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var sendChatroomMessage = {\n    name: '发送聊天室消息',\n    event: Service.sendChatroomMessage,\n    eventName: 'sendMessage',\n    desc: '发送聊天室消息, 以文本消息为例(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/message-send/#example',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条聊天室的文字消息' },\n      { name: '会话类型', type: 'number', value: 4 },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setConversationStatus = {\n    name: '设置会话状态',\n    event: Service.setConversationStatus,\n    eventName: 'setConversationStatus',\n    desc: '设置会话状态',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/conversation/notify/web.html',\n    params: [\n      { name: '免打扰', type: 'number', value: 1 },\n      { name: '置顶', type: 'boolean', value: true },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  win.RongIM = win.RongIM || {};\n  \n  var DefailtReadyApiQueue = [\n    [disconnect, reconnect],\n    [registerMessage],\n    [getConversationList, removeConversation, getUnreadCount, getTotalUnreadCount, clearUnreadCount, setConversationStatus],\n    [sendTextMessage, sendImageMessage, sendRecallMessage, sendFileMessage, sendVoiceMessage, sendRegisterMessage, sendAtMessage, sendLocationMessage, sendRichContentMessage, sendTypingStatusMessage],\n    [getHistoryMessages, deleteRemoteMessages, clearHistoryMessages],\n    [joinChatRoom, getChatRoomInfo, sendChatroomMessage],\n    [setChatroomEntry, getChatroomEntry, forceSetChatroomEntry, getAllChatroomEntries, removeChatroomEntry, forceRemoveChatroomEntry],\n    [quitChatRoom]\n  ];\n  urlQueryConfig.isMini && utils.forEach(DefailtReadyApiQueue, function (list, i) {\n    utils.forEach(list, function (item, j) {\n      if (MiniUnSupportEventList.indexOf(item.eventName) !== -1) {\n        list.splice(j, 1);\n      }\n    }, { isReverse: true })\n  });\n  win.RongIM.DefailtReadyApiQueue = DefailtReadyApiQueue;\n  \n  win.RongIM.ApiList = [\n    getConversationList\n  ];\n\n  window.RongIM.Api = {\n    changeUser: changeUser\n  }\n\n})(window, {\n  RongIM: RongIM\n});"
  },
  {
    "path": "api-test-v2/js/common/service.js",
    "content": "(function(win) {\n  var RongIMLib = win.RongIMLib,\n    RongIM = win.RongIM,\n    RongIMClient = RongIMLib.RongIMClient,\n    utils = RongIM.Utils;\n\n  var sendMsgTimeout = RongIM.config.isDebug ? 300 : 0;\n\n  var selfUserId;\n\n  // 缓存消息, 用作撤回、删除等操作的参数\n  var CacheMsg = {\n    eventEmitter: new utils.EventEmitter(),\n    _list: [],\n    set: function (msg) {\n      this._list.push(msg);\n      this.eventEmitter.emit('msgChanged');\n    },\n    remove: function (msg) {\n      var list = this._list;\n      utils.forEach(list, function(child, index) {\n        if (child.messageUId === msg.messageUId) {\n          list.splice(index, 1);\n        }\n      }, { isReverse: true });\n      this.eventEmitter.emit('msgChanged');\n    },\n    getLast: function () {\n      var list = this._list, length = list.length;\n      var msg = {};\n      if (length) {\n        msg = list[length - 1];\n      }\n      return msg;\n    }\n  };\n\n  /**\n   * 初始化以及链接\n   * @param {object} config \n   * @param {string} config.appkey 融云颁发的 appkey\n   * @param {string} config.token 融云颁发的 token(代表某一个用户)\n   * @param {Object} watcher \n   * @param {Object} watcher.status 监听链接状态的变化\n   * @param {Object} watcher.message 监听消息的接收\n   */\n  function init(config, watcher) {\n    watcher = watcher || {};\n    return utils.defered(function(resolve, reject) {\n      var appkey = config.appkey;\n      var token = config.token;\n      config = utils.clearUndefKey(config);\n      config = utils.copy(config);\n      // config.cmpUrl = 'wsap-cn.ronghub.com';\n      \n      /* \n        初始化\n        文档: https://docs.rongcloud.cn/im/imlib/web/init/\n       */\n      RongIMClient.init(appkey, null, config);\n      RongIMClient.setConnectionStatusListener({\n        onChanged: function (status) {\n          // 不处理的状态码\n          var unHandleStatus = [];\n          if (unHandleStatus.indexOf(status) === -1) {\n            watcher.status(status);\n          }\n        }\n      });\n      RongIMClient.setOnReceiveMessageListener({\n        onReceived: watcher.message\n      });\n\n      RongIMClient.setConversationStatusListener && RongIMClient.setConversationStatusListener({\n        onChanged: watcher.conversationStatus\n      });\n\n      /*\n        链接\n        文档: https://docs.rongcloud.cn/im/imlib/web/connect/\n       */\n      RongIMClient.connect(token, {\n        onSuccess: function (userId) {\n          selfUserId = userId;\n          resolve(userId);\n        },\n        onTokenIncorrect: function () {\n          reject('Token 错误');\n        },\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 断开链接\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/connect/#disconnect\n   */\n  function disconnect() {\n    return utils.defered(function (resolve) {\n      RongIMClient.getInstance().disconnect();\n      resolve();\n    });\n  }\n\n  function changeUser(config, watcher) {\n    RongIMClient.getInstance().clearCache();\n    RongIMClient.getInstance().logout();\n    return init(config, watcher);\n  }\n\n  /**\n   * 重新链接\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/connect/#reconnect\n   */\n  function reconnect(isAuto, url, rate) {\n    rate = rate.split(',');\n    utils.forEach(rate, function (rate, index) {\n      rate[index] = Number(rate);\n    });\n    var config = {\n      auto: isAuto,\n      url: url,\n      rate: rate\n    };\n    return utils.defered(function (resolve, reject) {\n      var callback = {\n        onSuccess: resolve,\n        onTokenIncorrect: reject,\n        onError: reject // 注: 此处因网络还不可用导致重连失败后, 可调用 reconnect(config) 继续重连\n      };\n      RongIMClient.reconnect(callback, config);\n    });\n  }\n\n  /**\n   * 获取会话列表\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/get-list/\n   *\n   * @param {number} count 获取会话的数量\n   */\n  function getConversationList(count) {\n    return utils.defered(function(resolve, reject) {\n      RongIMClient.getInstance().getConversationList({\n        onSuccess: resolve,\n        onError: reject\n      }, null, count);\n    });\n  }\n\n  /**\n   * 删除会话列表\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/remove/\n   */\n  function removeConversation(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().removeConversation(conversationType, targetId, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 获取历史消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-list/get-list/\n   * \n   * @param {number} timestrap 时间戳\n   * @param {number} count 数量\n   */\n  function getHistoryMessages(timestrap, count, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().getHistoryMessages(conversationType, targetId, timestrap, count, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 按时间删除历史消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-list/remove-list/#_1\n   *\n   * @param {number} timestrap 时间戳\n   */\n  function clearHistoryMessages(timestamp, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    var params = {\n      conversationType: conversationType,\n      targetId: targetId,\n      timestamp: timestamp\n    };\n\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().clearRemoteHistoryMessages(params, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 按消息删除历史消息\n   * @param {string} messageUId 消息在 server 的唯一标识\n   * @param {number} sentTime 消息发送时间\n   * @param {number} messageDirection 消息方向\n   */\n  function deleteRemoteMessages(messageUId, sentTime, messageDirection, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    if (!messageUId || !sentTime) {\n      return utils.Defer.reject('请先发送消息, 再进行删除历史消息操作');\n    }\n    \n    var deleteMsg = { \n      messageUId: messageUId,\n      sentTime: sentTime,\n      messageDirection: messageDirection\n    };\n    var messages = [ deleteMsg ];\n\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n\n  /**\n   * 获取指定会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#get-one\n   * \n   * @param {number} conversationType 会话类型\n   * @param {string} targetId 目标 id (对方 id、群组 id、聊天室 id 等)\n   */\n  function getUnreadCount(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().getUnreadCount(conversationType, targetId, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 获取所有会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#get-all\n   */\n  function getTotalUnreadCount() {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().getTotalUnreadCount({\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 清除指定会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#clear\n   */\n  function clearUnreadCount(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().clearUnreadCount(conversationType, targetId, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function sendMessage(conversationType, targetId, msg, disableNotification) {\n    conversationType = Number(conversationType);\n    return utils.defered(function (resolve, reject) {\n      let callbacks = {\n        onSuccess: function (message) {\n          CacheMsg.set(message);\n          resolve(message);\n        },\n        onError: reject\n      };\n      let config = {\n        disableNotification: disableNotification\n      };\n      setTimeout(function() { // 开发者忽略 setTimeout\n        RongIMClient.getInstance().sendMessage(conversationType, targetId, msg, callbacks, null, null, null, null, config);\n      }, sendMsgTimeout);\n    });\n  }\n\n  /**\n   * 发送文本消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#text\n   * 注意事项:\n   *    1: 单条消息整体不得大于128K\n   *    2: conversationType 类型是 number，targetId 类型是 string\n   * \n   * @param {string} text 文字内容\n   * @param {number} conversationType 会话类型\n   * @param {string} targetId 目标 id (对方 id、群组 id、聊天室 id 等)\n   */\n  function sendTextMessage(text, conversationType, targetId, disableNotification) {\n    var content = {\n      content: text // 文本内容\n    };\n    var msg = new RongIMLib.TextMessage(content);\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 发送图片消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#image\n   * 注意事项:\n   *    1. 略缩图(content 字段)必须是 base64 字符串, 类型必须为 jpg\n   *    2. base64 略缩图必须不带前缀\n   *    3. base64 字符串大小不可超过 100 k\n   *    4. 可通过 FileReader 或者 canvas 对图片进行压缩, 生成压缩后的 base64 字符串\n   * imageUri 为上传至服务器的原图 url, 用来展示高清图片\n   * 上传图片需开发者实现. 可参考上传插件: https://docs.rongcloud.cn/im/imlib/web/plugin/upload\n   * \n   * @param {string} base64 图片 base64 缩略图\n   * @param {string} imageUri 图片上传后的 url\n   */\n  function sendImageMessage(base64, imageUri, conversationType, targetId, disableNotification) {\n    var content = {\n      content: base64, // 压缩后的 base64 略缩图, 用来快速展示图片\n      imageUri: imageUri // 上传到服务器的 url. 用来展示高清图片\n    };\n    var msg = new RongIMLib.ImageMessage(content);\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 发送文件消息\n   * 文档：https://docs.rongcloud.cn/im/imlib/web/message-send/#file\n   * \n   * @param {string} fileName 文件名\n   * @param {string} fileSize 文件大小\n   * @param {string} fileType 文件类型\n   * @param {string} fileUrl 文件上传后的 url\n   */\n  function sendFileMessage(fileName, fileSize, fileType, fileUrl, conversationType, targetId, disableNotification) {\n    var content = {\n      name: fileName, // 文件名\n      size: fileSize, // 文件大小\n      type: fileType, // 文件类型\n      fileUrl: fileUrl // 文件地址\n    };\n    var msg = new RongIMLib.FileMessage(content);\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 高质量语音消息: https://docs.rongcloud.cn/im/introduction/message_structure/#hqvoice_message\n   * 注意事项:\n   *   融云不提供声音录制的方法. remoteUrl 的生成需开发者实现\n   * \n   * @param {string} remoteUrl 语音上传后的 url\n   * @param {number} duration 语音时长\n   */\n  function sendVoiceMessage(remoteUrl, duration, conversationType, targetId, disableNotification) {\n    var content = {\n      remoteUrl: remoteUrl, // 音频 url, 建议格式: aac\n      duration: duration // 音频时长\n    };\n    var msg = new RongIMLib.HQVoiceMessage(content);\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 撤回消息: https://docs.rongcloud.cn/im/imlib/web/message-send/#recall\n   * 注意事项:\n   *   消息撤回操作服务器端没有撤回时间范围的限制，由客户端决定\n   *\n   * @param {string} messageUId 撤回的消息 Uid\n   * @param {number} sentTime 撤回的消息 sentTime\n   */\n  function sendRecallMessage(messageUId, sentTime, conversationType, targetId, disableNotification) {\n    if (!messageUId || !sentTime) {\n      return utils.Defer.reject('请先发送消息, 再进行撤回操作');\n    }\n    var recallMessage = {\n      messageUId: messageUId,\n      sentTime: sentTime,\n      senderUserId: selfUserId,\n      conversationType: conversationType,\n      targetId: targetId\n    };\n    \n    var config = {\n      disableNotification\n    }\n    return utils.defered(function (resolve, reject) {\n      var callbacks = {\n        onSuccess: resolve,\n        onError: reject\n      }\n      RongIMClient.getInstance().sendRecallMessage(recallMessage, callbacks, config);\n    })\n  }\n\n  /**\n   * 发送 @ 消息(此处以文本消息举例)\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#example\n   * \n   * @param {string} text 文字内容\n   * @param {string} methiondId @ 对象的 id\n   */\n  function sendAtMessage(text, methiondId, conversationType, targetId, disableNotification) {\n    conversationType = Number(conversationType);\n\n    var isMentioned = true;\n\n    var mentioneds = new RongIMLib.MentionedInfo();\n    mentioneds.type = RongIMLib.MentionedType.PART;\n    mentioneds.userIdList = [methiondId]; // @ 人 id 列表\n\n    var content = {\n      content: text,\n      mentionedInfo: mentioneds\n    };\n    var msg = new RongIMLib.TextMessage(content);\n    let config = {\n      disableNotification: disableNotification\n    };\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().sendMessage(conversationType, targetId, msg, {\n        onSuccess: resolve,\n        onError: reject\n      }, isMentioned, null, null, null, config);\n    });\n  }\n\n  /**\n   * 注册自定义消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#custom\n   *\n   * @param {string} messageName 注册消息的 Web 端类型名\n   * @param {string} objectName 注册消息的唯一名称. 注: 此名称需多端一致\n   * @param {boolean} isCounted 是否计数\n   * @param {boolean} isPersited 是否存储\n   * @param {Array<string>} props 消息包含的字段集合\n   */\n  function registerMessage(messageName, objectName, isCounted, isPersited, props) {\n    var mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited); //true true 保存且计数，false false 不保存不计数。\n    props = props.split(','); // 将字符串截取为数组. 此处为 Demo 逻辑, 与融云无关\n    RongIMClient.registerMessageType(messageName, objectName, mesasgeTag, props);\n    return utils.Defer.resolve();\n  }\n\n  /**\n   * 发送自定义消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#custom\n   * \n   * @param {string} messageType 注册消息的 Web 端类型名\n   * @param {*} props 消息包含的字段集合\n   */\n  function sendRegisterMessage(messageType, props, conversationType, targetId, disableNotification) {\n    var content = props.split(',');\n    var msg = new RongIMClient.RegisterMessage[messageType](content);\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 发送位置消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#location\n   * 注意事项:\n   *   1. 缩略图必须是base64码的jpg图, 而且不带前缀\"data:image/jpeg;base64,\", 不得超过100K\n   *   2. 需要开发者做显示效果, 一般显示逻辑: 图片加链接, 传入经纬度并跳转进入地图网站\n   * \n   * @param {string} base64 位置缩略图\n   * @param {number} latitude 维度\n   * @param {number} longitude 经度\n   * @param {string} poi 位置信息\n   */\n  function sendLocationMessage(base64, latitude, longitude, poi, conversationType, targetId, disableNotification) {\n    var msg = new RongIMLib.LocationMessage({\n      latitude: latitude,\n      longitude: longitude,\n      poi: poi,\n      content: base64\n    });\n\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 发送富文本(图文)消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#rich-content\n   *\n   * @param {string} title 图文标题\n   * @param {number} content 图文内容\n   * @param {number} imageUri 显示图片的 url(图片信息)\n   * @param {string} url 点击图文后打开的 url\n   */\n  function sendRichContentMessage(title, content, imageUri, url, conversationType, targetId, disableNotification) {\n    var msg = new RongIMLib.RichContentMessage({\n      title: title,\n      content: content,\n      imageUri: imageUri,\n      url: url\n    });\n\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 发送正在输入状态消息\n   * @param {number} conversationType\n   * @param {string} targetId\n   * @param {string} data\n   * @param {string} typingContentType\n  */\n\n  function sendTypingStatusMessage(conversationType, targetId, typingContentType, data, disableNotification) {\n    var msg = new RongIMLib.TypingStatusMessage({ typingContentType: typingContentType, data: data });\n    return sendMessage(conversationType, targetId, msg, disableNotification);\n  }\n\n  /**\n   * 加入聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#join\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {number} count 拉取消息数量\n   */\n  function joinChatRoom(chatRoomId, count) {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().joinChatRoom(chatRoomId, count, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 退出聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#quit\n   *\n   * @param {string} chatRoomId 聊天室 id\n   */\n  function quitChatRoom(chatRoomId) {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().quitChatRoom(chatRoomId, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 获取聊天室信息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#get\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {string} count 获取人数\n   * @param {string} order 排序方式\n   */\n  function getChatRoomInfo(chatRoomId, count, order) {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().getChatRoomInfo(chatRoomId, count, order, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  /**\n   * 发送聊天室消息(以文本消息为例)\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#text\n   *\n   * @param {string} text 文字内容\n   */\n  function sendChatroomMessage(text, conversationType, targetId) {\n    var content = {\n      content: text // 文本内容\n    };\n    var msg = new RongIMLib.TextMessage(content);\n    return sendMessage(conversationType, targetId, msg);\n  }\n\n  function setChatroomEntry(key, value, isAutoDelete, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      value: value,\n      notificationExtra: extra,\n      isAutoDelete: isAutoDelete,\n      isSendNotification: isSendNotification\n    };\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().setChatroomEntry(chatRoomId, entry, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function forceSetChatroomEntry(key, value, isAutoDelete, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      value: value,\n      notificationExtra: extra,\n      isAutoDelete: isAutoDelete,\n      isSendNotification: isSendNotification\n    };\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().forceSetChatroomEntry(chatRoomId, entry, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function removeChatroomEntry(key, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      notificationExtra: extra,\n      isSendNotification: isSendNotification\n    };\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().removeChatroomEntry(chatRoomId, entry, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function forceRemoveChatroomEntry(key, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      notificationExtra: extra,\n      isSendNotification: isSendNotification\n    };\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().forceRemoveChatroomEntry(chatRoomId, entry, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function getChatroomEntry(key, chatRoomId) {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().getChatroomEntry(chatRoomId, key, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function getAllChatroomEntries(chatRoomId) {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().getAllChatroomEntries(chatRoomId, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function setConversationStatus(notificationStatus, isTop, conversationType, targetId) {\n    return utils.defered(function (resolve, reject) {\n      RongIMClient.getInstance().setConversationStatus(conversationType, targetId, {\n        notificationStatus: notificationStatus,\n        isTop: isTop\n      }, {\n        onSuccess: resolve,\n        onError: reject\n      });\n    });\n  }\n\n  function getLastCacheMsgUId() {\n    return CacheMsg.getLast().messageUId;\n  }\n  function getLastCacheMsgSentTime() {\n    return CacheMsg.getLast().sentTime;\n  }\n  function getLastCacheMsgDirection() {\n    return CacheMsg.getLast().messageDirection;\n  }\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.Service = {\n    init: init,\n    disconnect: disconnect,\n    reconnect: reconnect,\n\n    registerMessage: registerMessage,\n    sendRegisterMessage: sendRegisterMessage,\n\n    getConversationList: getConversationList,\n    removeConversation: removeConversation,\n\n    getHistoryMessages: getHistoryMessages,\n    clearHistoryMessages: clearHistoryMessages,\n    deleteRemoteMessages: deleteRemoteMessages,\n\n    sendTextMessage: sendTextMessage,\n    sendImageMessage: sendImageMessage,\n    sendFileMessage: sendFileMessage,\n    sendVoiceMessage: sendVoiceMessage,\n    sendAtMessage: sendAtMessage,\n    sendLocationMessage: sendLocationMessage,\n    sendRichContentMessage: sendRichContentMessage,\n    sendRecallMessage: sendRecallMessage,\n    sendTypingStatusMessage: sendTypingStatusMessage,\n    \n    getUnreadCount: getUnreadCount,\n    getTotalUnreadCount: getTotalUnreadCount,\n    clearUnreadCount: clearUnreadCount,\n\n    joinChatRoom: joinChatRoom,\n    quitChatRoom: quitChatRoom,\n    getChatRoomInfo: getChatRoomInfo,\n    sendChatroomMessage: sendChatroomMessage,\n    setChatroomEntry: setChatroomEntry,\n    forceSetChatroomEntry: forceSetChatroomEntry,\n    removeChatroomEntry: removeChatroomEntry,\n    forceRemoveChatroomEntry: forceRemoveChatroomEntry,\n    getChatroomEntry: getChatroomEntry,\n    getAllChatroomEntries: getAllChatroomEntries,\n\n    getLastCacheMsgSentTime: getLastCacheMsgSentTime,\n    getLastCacheMsgUId: getLastCacheMsgUId,\n    getLastCacheMsgDirection: getLastCacheMsgDirection,\n    setConversationStatus: setConversationStatus,\n    msgEmitter: CacheMsg.eventEmitter,\n\n    changeUser: changeUser\n  };\n  \n})(window);"
  },
  {
    "path": "api-test-v2/js/common/utils.js",
    "content": "(function (win) {\n\n  var Defer = win.Promise || ES6Promise;\n  var Vue = win.Vue;\n\n  var TypeColor = {\n    FAILED: '#ed4014',\n    MSG: '#2db7f5',\n    STATUS: '#ff9900'\n  };\n\n  var ConversationName = {\n    1: '单聊',\n    3: '群聊',\n    4: '聊天室',\n    5: '客服',\n    6: '系统',\n    7: '公众号',\n    8: '公众号'\n  };\n\n  var StatusName = {\n    0: '已连接',\n    1: '正在链接',\n    2: '主动断开链接',\n    3: '网络不可用',\n    4: '链接关闭',\n    6: '其他设备登录, 被踢',\n    7: 'Socket 不可用',\n    8: 'Socket 错误',\n    12: '安全域名错误',\n    20: 'AppKey 错误',\n    201: '正在请求 Navi',\n    202: '请求 Navi 成功',\n    203: '请求 Navi 错误',\n    204: '请求 Navi 超时'\n  };\n\n  var SuccessStatus = [0, 1, 2, 4, 201, 202, 203, 204];\n\n  var noop = function () {};\n\n  function isObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  }\n  function isArray(arr) {\n    return Object.prototype.toString.call(arr) === '[object Array]';\n  }\n  function isNodeList(arr) {\n    return Object.prototype.toString.call(arr) === '[object NodeList]' || \n      Object.prototype.toString.call(arr) === '[object HTMLCollection]';\n  }\n  function isFunction(arr) {\n    return Object.prototype.toString.call(arr) === '[object Function]';\n  }\n  function isString(str) {\n    return Object.prototype.toString.call(str) === '[object String]';\n  }\n  function isBoolean(str) {\n    return Object.prototype.toString.call(str) === '[object Boolean]';\n  }\n  function isUndefined(str) {\n    return Object.prototype.toString.call(str) === '[object Undefined]';\n  }\n  function isNull(str) {\n    return Object.prototype.toString.call(str) === '[object Null]';\n  }\n  function isNumber(str) {\n    return Object.prototype.toString.call(str) === '[object Number]';\n  }\n\n  function defered(callback) {\n    return new Defer(callback);\n  }\n\n  function tplEngine(temp, data, regexp) {\n    var replaceAction = function (object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n      });\n    };\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  }\n\n  function forEach(obj, callback, options) {\n    options = options || {};\n    callback = callback || noop;\n    var isReverse = options.isReverse;\n    var loopObj = function() {\n      for (var key in obj) {\n        callback(obj[key], key, obj);\n      }\n    };\n    var loopArr = function() {\n      if (isReverse) {\n        for (var i = obj.length - 1; i >= 0; i--) {\n          callback(obj[i], i);\n        }\n      } else {\n        for (var j = 0, len = obj.length; j < len; j++) {\n          callback(obj[j], j);\n        }\n      }\n    };\n    if (isObject(obj)) {\n      loopObj();\n    }\n    if (isArray(obj) || isNodeList(obj)) {\n      loopArr();\n    }\n  };\n\n  function clearUndefKey(obj) {\n    forEach(obj, function (key, val) {\n      if (isUndefined(val)) {\n        delete obj[key];\n      }\n    });\n    return obj;\n  }\n\n  function map(arr, event) {\n    forEach(arr, function(item, index) {\n      arr[index] = event(item, index);\n    });\n    return arr;\n  }\n\n  function deepMap(arr, event) {\n    forEach(arr, function (item, index) {\n      if (isArray(item) || isObject(item)) {\n        arr[index] = deepMap(item, event);\n      } else {\n        arr[index] = event(item, index);\n      }\n    });\n    return arr;\n  }\n\n  function isEqual(obj1, obj2) {\n    if (isObject(obj1) && isObject(obj2)) {\n      var isEq = true;\n      forEach(obj1, function (val, key) {\n        if (obj2[key] !== val) {\n          isEq = false;\n        }\n      });\n      return isEq;\n    } else {\n      return obj1 == obj2;\n    }\n  }\n\n  function getDom(id) {\n    return document.getElementById(id);\n  }\n\n  function queryAllDom(sel) {\n    return document.querySelectorAll(sel);\n  }\n\n  function queryDom(sel) {\n    return document.querySelector(sel);\n  }\n\n  function removeDom(dom) {\n    var parent = dom.parentNode || dom.parentElement;\n    parent.removeChild(dom);\n  }\n\n  function getParent(dom) {\n    return dom.parentNode || dom.parentElement;\n  }\n\n  function getChildren(dom) {\n    return dom.children;\n  }\n\n  function getTemp(id) {\n    var dom = getDom(id);\n    return dom.innerHTML;\n  }\n\n  function getDomIndex(dom) {\n    var parent = getParent(dom);\n    var children = parent.children;\n    for (var i = 0, max = children.length; i < max; i++) {\n      var child = children[i];\n      if (dom === child) {\n        return i;\n      }\n    }\n    return -1;\n  }\n\n  function toJSON(obj) {\n    return JSON.stringify(obj);\n  }\n\n  function parseJSON(str) {\n    var val;\n    try {\n      val = JSON.parse(str);\n    } catch(e) {}\n    return val;\n  }\n\n  function copy(obj) {\n    var copyObj = parseJSON(toJSON(obj));\n    return copyObj;\n  }\n\n  function hasClass(el, className) {\n    if (!el) {\n      return false;\n    }\n    var classList = el.classList;\n    for (var i = 0, max = classList.length; i < max; i++) {\n      if (classList[i] === className) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  function timestampToString(timestamp) {\n    var date = timestamp ? new Date(timestamp) : new Date();\n    Y = date.getFullYear() + '-';\n    M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';\n    D = date.getDate() + ' ';\n    h = date.getHours() + ':';\n    m = date.getMinutes() + ':';\n    s = date.getSeconds();\n    return Y + M + D + h + m + s;\n  }\n\n  function extend(destination, sources) {\n    for (var key in sources) {\n      var value = sources[key];\n      if (!isUndefined(value)) {\n        destination[key] = value;\n      }\n    }\n    return destination;\n  };\n\n  /**\n  * 封装弹框组件\n  * @param {object} options\n  */\n  function mountDialog(options, instance) {\n    options.parent = instance;\n    var Dialog = Vue.extend(options);\n    var instance = new Dialog({\n      el: document.createElement('div')\n    });\n    var wrap = document.getElementsByTagName('body')[0];\n    wrap.appendChild(instance.$el);\n    return instance;\n  }\n\n  function reverse(obj) {\n    var newObj = copy(obj);\n    return newObj.reverse();\n  }\n\n  function openUrl(url) {\n    window.open(url);\n  }\n\n  function getBase64Image() {\n    var canvas = document.createElement('canvas');\n    canvas.width = 100;\n    canvas.height = 100;\n    var context = canvas.getContext('2d');\n    context.font = '20pt Arial';\n    context.fillStyle = 'blue';\n    context.fillText('RongCloud.cn', 10, 20);\n    var content = canvas.toDataURL('image/jpeg');\n    content = content.replace('data:image/jpeg;base64,', '');\n    return content;\n  }\n\n  var increaseNumber = 0;\n  function getIncreasNumber() {\n    return ++increaseNumber;\n  }\n\n  var EventEmitter = function () {\n    this._events = {};\n    \n    this.on = function (name, event) {\n      var _events = this._events[name] || [];\n      _events.push(event);\n      this._events[name] = _events;\n    };\n\n    this.emit = function (name, data) {\n      var _events = this._events[name];\n      forEach(_events, function(event) {\n        event(data);\n      });\n    };\n  };\n\n  var Storage = {\n    ConfigKey: 'config',\n    get: function (key) {\n      var str = localStorage.getItem(key);\n      return parseJSON(str);\n    },\n    set: function (key, val) {\n      var str = toJSON(val);\n      localStorage.setItem(key, str);\n    }\n  };\n\n  function getUrlQuery() {\n    var url = location.search; //获取url中\"?\"符后的字串\n    var theRequest = new Object();\n    if (url.indexOf('?') != -1) {\n      var str = url.substr(1);\n      strs = str.split('&');\n      for (var i = 0; i < strs.length; i++) {\n        theRequest[strs[i].split('=')[0]] = unescape(strs[i].split('=')[1]);\n      }\n    }\n    return theRequest;\n  }\n\n  function getRCUrlQuery() {\n    var theRequest = getUrlQuery();\n    var transMap = {\n      'true': true, 'false': false\n    };\n    map(theRequest, function (val, key) {\n      var transVal = transMap[val];\n      if (!isUndefined(transVal)) {\n        val = transVal;\n      }\n      return val;\n    });\n    forEach(theRequest, function (val, key) {\n      if (key === 'encodeToken') {\n        theRequest.token = decodeURIComponent(val);\n        delete theRequest.encodeToken;\n      }\n      if (key === 'isMini') {\n        delete theRequest.isMini;\n      }\n    });\n    return theRequest;\n  }\n\n  function deferNoop() {\n    return Defer.resolve();\n  }\n\n  var request = (function () {\n    const isValidRequest = function(obj) {\n      return typeof obj === 'function' || typeof obj === 'object';\n    };\n\n    const createXHR = function() {\n      let item = {\n        XMLHttpRequest: function() {\n          return new XMLHttpRequest();\n        },\n        XDomainRequest: function() {\n          return new XDomainRequest();\n        },\n        ActiveXObject: function() {\n          return new ActiveXObject('Microsoft.XMLHTTP');\n        }\n      };\n      let isXHR = isValidRequest(window.XMLHttpRequest);\n      let isXDR = isValidRequest(window.XDomainRequest);\n      let key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n      return item[key]();\n    };\n\n    const isRequestSuccess = function(status) {\n      let responseStatus = status + ''; // test 仅 string 类型可调用\n      return /^(200|202)$/.test(responseStatus);\n    };\n\n    const request = function(option) {\n      var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        success = option.success,\n        fail = option.fail;\n      method = method || 'get';\n\n      let xhr = createXHR();\n      xhr.open(method, url);\n\n      if (headers && xhr.setRequestHeader) {\n        for (let key in headers) {\n          xhr.setRequestHeader(key, headers[key]);\n        }\n      }\n      xhr.onreadystatechange = function() {\n        if (xhr.readyState === 4) {\n          let result = xhr.responseText,\n            status = xhr.status;\n          if (isRequestSuccess(status)) {\n            success(result, xhr);\n          } else {\n            fail(result, xhr, status);\n          }\n        }\n      };\n\n      xhr.onerror = function(error) {\n        fail(error);\n      };\n\n      xhr.send(body);\n    };\n\n    return request;\n  })();\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.Utils = {\n    Storage: Storage,\n\n    TypeColor: TypeColor,\n    ConversationName: ConversationName,\n    StatusName: StatusName,\n    SuccessStatus: SuccessStatus,\n\n    request: request,\n\n    EventEmitter: EventEmitter,\n\n    noop: noop,\n    isNumber: isNumber,\n    isFunction: isFunction,\n    map: map,\n    deepMap: deepMap,\n    isEqual: isEqual,\n    clearUndefKey: clearUndefKey,\n    Defer: Defer,\n    defered: defered,\n    tplEngine: tplEngine,\n    forEach: forEach,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    removeDom: removeDom,\n    getParent: getParent,\n    getChildren: getChildren,\n    hasClass: hasClass,\n    getDomIndex: getDomIndex,\n    timestampToString: timestampToString,\n    extend: extend,\n    reverse: reverse,\n    openUrl: openUrl,\n    getBase64Image: getBase64Image,\n    getIncreasNumber: getIncreasNumber,\n\n    getDom: getDom,\n    queryDom: queryDom,\n    queryAllDom: queryAllDom,\n    getTemp: getTemp,\n    mountDialog: mountDialog,\n    getUrlQuery: getUrlQuery,\n    getRCUrlQuery: getRCUrlQuery,\n    deferNoop: deferNoop\n  };\n\n})(window);"
  },
  {
    "path": "api-test-v2/js/components/button.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    Service = RongIM.Service;\n\n  var OutputMark = {\n    SUCCESS: '成功',\n    FAILED: '失败'\n  };\n\n  var copyApi = function (api) {\n    var params = api.params || [];\n    var copyParams = utils.copy(params);\n    utils.forEach(params, function (item, index) {\n      utils.forEach(item, function (val, key) {\n        if (utils.isFunction(val)) {\n          copyParams[index][key] = val;\n        }\n      });\n    });\n    api.params = copyParams;\n    return api;\n  };\n\n  components.apiBtn = Vue.component('api-btn', {\n    template: utils.getTemp('rong-tpl-apibtn'),\n    props: ['api', 'isdragging'],\n    data: function() {\n      return {\n        isShowEditDialog: false,\n        selfApi: copyApi(this.api)\n      }\n    },\n    watch: {\n      markMessage: function (newMsg) {\n        console.log(newMsg);\n      }\n    },\n    computed: {\n      tip: function() {\n        var api = this.selfApi;\n        return utils.tplEngine(TipTpl, api);\n      },\n      apiValue: function() {\n        var api = this.selfApi;\n        return utils.toJSON(api);\n      },\n      paramList: function () {\n        var paramList = this.selfApi.params;\n        return paramList;\n      },\n      hasParams: function () {\n        var params = this.selfApi.params;\n        return params && params.length;\n      }\n    },\n    methods: {\n      openUrl: utils.openUrl,\n      showEditDialog: function() {\n        this.isShowEditDialog = true;\n      },\n      hideEditDialog: function() {\n        this.isShowEditDialog = false;\n      },\n      change: function() {\n      },\n      run: function() {\n        var self = this;\n        var params = [];\n        var startTime = +new Date();\n        utils.forEach(self.selfApi.params, function(item) {\n          if (item.type === 'number') {\n            item.value = Number(item.value);\n          }\n          params.push(item.value);\n        });\n        var imInstance = RongIM.vueInstance;\n\n        var addOutput = function(data, isSuccess) {\n          var currentTime = +new Date();\n          var consumedTime = currentTime - startTime;\n          var title = self.api.name + (isSuccess ? OutputMark.SUCCESS : OutputMark.FAILED);\n          var config = {};\n          if (!isSuccess) {\n            config.color = utils.TypeColor.FAILED;\n          }\n          self.hideEditDialog();\n          return imInstance.addOutput(title, data, consumedTime, params, config);\n        };\n        return self.api.event.apply(void 0, params).then(function(data) {\n          var data = addOutput(data, true);\n          return {\n            isSuccess: true,\n            data: data\n          };\n        }).catch(function(error) {\n          // TODO 报警\n          error = utils.isNumber(error) ? error : error.toString();\n          var data = addOutput(error, false);\n          return {\n            isSuccess: false,\n            data: data\n          };\n        });\n      }\n    },\n    mounted: function() {\n      var self = this;\n\n      var setParams = function () {\n        var paramList = self.selfApi.params;\n        utils.forEach(paramList, function (item) {\n          if (item.event) {\n            item.value = item.value || item.event();\n          }\n        });\n      };\n\n      setParams();\n      Service.msgEmitter.on('msgChanged', setParams);\n    }\n  });\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test-v2/js/components/json-alert.js",
    "content": "(function (win, dependencies) {\n  var RongIM = dependencies.RongIM;\n  var utils = RongIM.Utils;\n\n  RongIM.dialog = RongIM.dialog || {};\n  RongIM.dialog.jsonAlert = function(options) {\n    var vueInstance = RongIM.vueInstance;\n\n    options = options || {};\n\n    utils.mountDialog({\n      name: 'json-alert',\n      template: '#rong-json-alert',\n      data: function () {\n        return {\n          isShow: true,\n          data: options.data\n        };\n      },\n      watch: {\n        isShow: function(isShow) {\n          if (!isShow) {\n            utils.removeDom(this.$el);\n          }\n        }\n      },\n      methods: {\n        hide: function() {\n          this.isShow = false;\n        }\n      }\n    }, vueInstance);\n  };\n\n})(window, {\n  RongIM: RongIM\n});"
  },
  {
    "path": "api-test-v2/js/login.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    isDebug = RongIM.config.isDebug,\n    debugConf = RongIM.config.debugConf;\n\n  var ConfigPlacehoder = {\n    appkey: '开发者的融云 AppKey',\n    token: '开发者的用户 Token',\n    targetId: '对方 id. 发消息、获取历史消息等都默认对此用户操作. 默认聊天室、群组、个人 id 都为此 id',\n    navi: '导航地址. 注: 国内数据中心可不填',\n    cmpUrl: '链接地址(开发者忽略此项)',\n    isPolling: '若使用长轮训链接方式, 可选择此项(开发者可忽略)'\n  };\n\n  components.login = Vue.component('login', {\n    template: utils.getTemp('rong-global-config'),\n    props: ['config', 'login'],\n    computed: {\n      configList: function() {\n        var items = [];\n        utils.forEach(this.config, function(val, key) {\n          items.push({\n            type: typeof val,\n            name: key\n          });\n        });\n        return items;\n      },\n      prompt: function() {\n        return ConfigPlacehoder;\n      }\n    },\n    methods: {\n      clearStorage: function () {\n        window.localStorage.clear();\n        this.$Message.success({\n          background: true,\n          content: '清空本地缓存成功'\n        });\n      }\n    },\n    mounted: function () {\n      if (isDebug && debugConf.autoRun) {\n        var self = this;\n        Vue.nextTick(function () {\n          self.login(self.config);\n        });\n      }\n    }\n  });\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test-v2/js/main.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    iview = dependencies.iview,\n    VueJsonPretty = dependencies.VueJsonPretty,\n    RongIM = dependencies.RongIM,\n    Service = RongIM.Service,\n    utils = RongIM.Utils,\n    ApiList = RongIM.ApiList,\n    DefailtReadyApiQueue = RongIM.DefailtReadyApiQueue,\n    DefaultConfig = RongIM.config.im,\n    Config = utils.copy(DefaultConfig),\n    Storage = utils.Storage,\n    StorageConfig = Storage.get(Storage.ConfigKey),\n    DefaultTargetId = Config.targetId,\n    isDebug = RongIM.config.isDebug,\n    debugConf = RongIM.config.debugConf;\n\n  DefailtReadyApiQueue.push([]);\n\n  var ValidStatus = [0, 1, 2, 6, 201, 202];\n  var ValidErrorCode = [23424, 23427, 23426, 23423];\n  var isStop = false;\n\n  var isStorageConfig = false;\n  if (StorageConfig && !isDebug) {\n    isStorageConfig = true;\n    Config = utils.copy(StorageConfig);\n  }\n  var urlQueryConfig = utils.getRCUrlQuery();\n  Config = utils.extend(Config, urlQueryConfig);\n\n  var ReceiveMsgTextTpl = '监听到{typeName} ({conversationType})消息. 发送者: {senderUserId}';\n  var StatusTextTpl = '链接状态: {statusName} ({status})';\n\n  var OptBoxClass = 'rong-ready-box';\n  var ApiBoxClass = 'rong-api-list';\n  var ApiSourceClass = 'rong-api-source';\n\n  var RunType = {\n    OneByOne: { name: '逐个运行', prompt: 'Api 逐个执行' },\n    LineByLine: { name: '逐行运行', prompt: '每行 Api 并行. 执行完一行后执行下一行' }\n  };\n  \n  var vueInstance;\n\n  function runAllApi(allRefs, currentIndex, finishCallback) {\n    var total = allRefs.length;\n    var isFinished = total === currentIndex || isStop;\n    if (isFinished) {\n      return finishCallback && finishCallback();\n    }\n    var refList = allRefs[currentIndex];\n    var deferArr = [];\n    utils.forEach(refList, function (instance) {\n      deferArr.push(instance.run());\n    });\n    return utils.Defer.all(deferArr).then(function (result) {\n      result = result[0];\n      var isSuccess = result.isSuccess || ValidErrorCode.indexOf(result.data.result) !== -1;\n      if (isSuccess) {\n        vueInstance.runInfo.successApiCount++;\n      } else {\n        vueInstance.runInfo.failApiList.push(result.data);\n      }\n      currentIndex++;\n      runAllApi(allRefs, currentIndex, finishCallback);\n    });\n  }\n\n  function runOneByOne(finishCallback) {\n    var refs = vueInstance.$refs;\n    var allRefs = [];\n    utils.forEach(refs, function (subRefList) {\n      utils.forEach(subRefList, function (ref) {\n        allRefs.push([ ref ]);\n      });\n    });\n    runAllApi(allRefs, 0, finishCallback);\n  }\n\n  function runLineByLine(finishCallback) {\n    var refs = vueInstance.$refs;\n    var allRefs = [];\n    utils.forEach(refs, function (ins) {\n      allRefs.push(ins);\n    });\n    runAllApi(allRefs, 0, finishCallback);\n  }\n\n  function setConfig(config) {\n    var currentTargetId = config.targetId;\n    vueInstance.globalConfig = config;\n    vueInstance.readyApiQueue = utils.deepMap(vueInstance.readyApiQueue, function (item) {\n      if (item === DefaultTargetId) {\n        item = currentTargetId;\n      }\n      return item;\n    });\n  }\n\n  function watchStatus(status) {\n    var title = utils.tplEngine(StatusTextTpl, {\n      status: status,\n      statusName: utils.StatusName[status]\n    });\n    var output = vueInstance.addOutput(title, status, 0, [], {\n      color: utils.TypeColor.STATUS\n    });\n    if (ValidStatus.indexOf(status) === -1) {\n      vueInstance.runInfo.failApiList.push(output);\n    }\n    var isSuccess = utils.SuccessStatus.indexOf(status) !== -1;\n    var event = isSuccess ? vueInstance.$Message.success : vueInstance.$Message.error;\n    event.call(vueInstance.$Message, {\n      background: true,\n      content: title\n    });\n  }\n\n  function watchConversationStatus(status) {\n    vueInstance.addOutput('会话状态变更', status, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n  }\n\n  function watchMessage(message) {\n    if (RongIM.config.isDebug && !RongIM.config.debugConf.isShowMsg) {\n      return;\n    }\n    var title = utils.tplEngine(ReceiveMsgTextTpl, {\n      typeName: utils.ConversationName[message.conversationType],\n      conversationType: message.conversationType,\n      senderUserId: message.senderUserId\n    });\n    vueInstance.addOutput(title, message, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n    console.log('Reveice Msg', utils.toJSON(message));\n  }\n\n  function autoRun() {\n    Vue.nextTick(function () {\n      runOneByOne(function () {\n        vueInstance.runInfo.runCount++;\n        localStorage.removeItem('rong_servers');\n        localStorage.removeItem('rong_fullnavi');\n        vueInstance.outputList = [];\n        vueInstance.allOutputList = [];\n        !isStop && autoRun();\n      });\n    });\n  }\n\n  function loginSuccessEvent(userId, config) {\n    vueInstance.$Message.success({\n      background: true,\n      content: '链接成功 ' + userId\n    });\n    vueInstance.currentUserId = userId;\n    vueInstance.isLogged = true;\n    if (isDebug && debugConf.autoRun) {\n      Vue.nextTick(autoRun);\n    }\n  }\n\n  function login(config) {\n    setConfig(config);\n    return Service.init(config, {\n      status: watchStatus,\n      message: watchMessage,\n      conversationStatus: watchConversationStatus\n    }).then(function (userId) {\n      Storage.set(Storage.ConfigKey, config);\n      loginSuccessEvent(userId, config);\n    }).catch(function (error) {\n      vueInstance.$Message.error({\n        background: true,\n        content: '链接失败 ' + error\n      });\n      return utils.Defer.reject();\n    });\n  }\n\n  function getApiListMethods() {\n    return {\n      addOutput: function (title, result, consumedTime, params, config) {\n        config = config || {};\n        var output = {\n          id: utils.getIncreasNumber(),\n          title: title,\n          result: result,\n          consumedTime: consumedTime,\n          params: params,\n          config: config\n        };\n        output.time = utils.timestampToString();\n        vueInstance.allOutputList.push(output);\n        vueInstance.outputList.push(output);\n        return output;\n      },\n      clearOutput: function () {\n        vueInstance.outputList = [];\n      },\n      showAllOutput: function () {\n        vueInstance.outputList = vueInstance.allOutputList;\n      },\n      toJSON: function (data) {\n        return utils.toJSON(data);\n      },\n      showJSONAlert: function(data) {\n        RongIM.dialog.jsonAlert({\n          data: data\n        });\n      },\n      runAllApi: function() {\n        if (vueInstance.runType === 'OneByOne') {\n          runOneByOne();\n        } else {\n          runLineByLine();\n        }\n      },\n      startDragging: function () {\n        setTimeout(function() {\n          vueInstance.isDragging = true;\n        }, 100);\n      }\n    };\n  }\n\n  function getServiceMethods() {\n    return {\n      openUrl: utils.openUrl,\n      reverse: utils.reverse,\n      login: function(config) {\n        var isEqualStorage = utils.isEqual(config, StorageConfig);\n        var isEqualDefault = utils.isEqual(config, DefaultConfig);\n        if (isStorageConfig && isEqualStorage && !isEqualDefault && !isDebug) {\n          vueInstance.$Modal.confirm({\n            title: '注意',\n            content: '您目前使用的为上一次链接配置, 请确定配置是否可用 ?',\n            onOk: function () {\n              login(config);\n            }\n          });\n        } else {\n          return login(config);\n        }\n      },\n      alarm: function () {\n        if (!this.isAlarmMuted) {\n          vueInstance.$refs.alarm.play();\n        }\n      },\n      mute: function () {\n        vueInstance.$refs.alarm.pause();\n      }\n    };\n  }\n\n\n  Vue.use(iview);\n\n  vueInstance = new Vue({\n    el: '#app',\n    data: function() {\n      return {\n        currentUserId: '',\n        isLogged: false,\n        readyApiQueue: DefailtReadyApiQueue,\n        allOutputList: [],\n        outputList: [],\n        globalConfig: Config,\n        RunType: RunType,\n        runType: 'OneByOne',\n\n        alertJSON: null,\n        isDragging: false,\n        isShowRunType: false,\n        isShowOutList: false,\n\n        isDebug: RongIM.config.isDebug,\n        runInfo: {\n          runCount: 0,\n          successApiCount: 0,\n          failApiList: []\n        },\n        isAlarmMuted: false\n      };\n    },\n    computed: {\n      apiList: function() {\n        return ApiList;\n      },\n      changeUserApi: function () {\n        var self = this;\n        var changeUserApi = RongIM.Api.changeUser;\n        var changeUserEvent = changeUserApi.event;\n        changeUserApi.event = function (token) {\n          var globalConfig = self.globalConfig\n          globalConfig.token = token;\n          return Service.changeUser(globalConfig, {\n            status: watchStatus,\n            message: watchMessage\n          }).then(function (userId) {\n            loginSuccessEvent(userId, globalConfig);\n          }).catch(function () {\n            vueInstance.$Message.error({\n              background: true,\n              content: '切换用户失败 ' + error\n            });\n          });\n        };\n        return changeUserApi;\n      },\n      currentOutput: function() {\n        var outputList = this.outputList;\n        if (outputList.length) {\n          return outputList[outputList.length - 1];\n        }\n      },\n      displayedOutputList: function () {\n        if (isDebug) {\n          return this.runInfo.failApiList;\n        } else {\n          return this.outputList;\n        }\n      }\n    },\n    watch: {\n      'runInfo.failApiList': function (newList) {\n        if (newList.length > 20) {\n          this.alarm();\n        }\n      },\n      isAlarmMuted: function (isMuted) {\n        if (isMuted) {\n          this.mute();\n        }\n      }\n    },\n    components: {\n      apiBtn: components.apiBtn,\n      login: components.login,\n      prettyjson: Vue.component('prettyjson', VueJsonPretty.default)\n    },\n    mounted: function() {\n      this.isPageLoaded = true;\n    },\n    methods: utils.extend(getApiListMethods(), getServiceMethods())\n  });\n\n  RongIM.vueInstance = vueInstance;\n\n  (function () {\n    function start() {\n      isStop = false;\n      if (vueInstance.isLogged) {\n        autoRun();\n      } else {\n        vueInstance.login(vueInstance.globalConfig).then(autoRun);\n      }\n    }\n    window.addEventListener(\"message\", function (event) {\n      var type = event.data;\n      if (type === 'start') {\n        start();\n      } else if (type === 'pause') {\n        isStop = true;\n      }\n    }, false);\n  })();\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  VueJsonPretty: VueJsonPretty,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.3.1-revise-20200311-222.js",
    "content": "/*\n切换新版 SDK 检查记录：杨川\n\n修改红包消息命名错误\nJrmfReadPacketMessage => JrmfRedPacketMessage\nJrmfReadPacketOpenedMessage => JrmfRedPacketOpenedMessage\n\n缺失方法 clearData\n\nC++ 消息监听 VCDataProvider.prototype.setOnReceiveMessageListener 缺失音视频消息过滤\n_voipProvider.onReceived\n\nVCDataProvider.prototype.getRemoteConversationList obj 少了空字符串判断\n\nVCDataProvider.prototype.sendReceiptResponse 方法为空 RCE 未用到\n\nvoip 2018-3-10 修改\n    InviteMessage MemberModifyMessage 消息体重增加 observerUserIds 属性\n\n导航重定向修改\nsetConnectionStatusListener() 抛出一些状态码\n\n注册消息时增加搜索项 addon.registerMessageType\nsearchProp\n*/\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n/*\ndate: 2018-07-02\nauth: yangchuan\nbug: Web 端消息是否计数标识不生效\nupdate: Web 接收消息时判断消息是否需要计数\n\ndate: 2018-07-10\nauth: yangchuan\nupdate: 发送消息敏感词替换，触发成功回调并返回对应 code 码\n\n以上已合并至 SDK\n------------------------------------------------------\n\ndate: 2018-10-25\nauth: yuhongda\nfeat: 消息监听增加 `是否还有离线消息`\nfeature: 用此属性区分是否还有离线消息，待会补偿消息拉取完成后更新一次会话\n\ndate: 2018-10-26\nauth: yuhongda\nfeat: addon.getUnreadCount 支持同步获取\n\ndate: 2018-10-27\nauth: yuhongda\nfeat: 会话列表增加分页\nmemo: 仅 c++ 支持会话列表分页\n\ndate: 2018-12-3\nauth: yuhongda\nfeat: 增加获取公众号历史消息的信令\nmemo: 仅 web 端生效\n\nDate: 2019-05-05\nAuthor: YuHongDa\n增加获取服务端会话列表接口(getRemoteConversations)，此接口参会成功失败，C++ 层做数据合并，此接口仅在 Electron 中有效\n\ndate: 2019-05-08\nauth: LiuYuqi\nupdate: RCE 增加管理员撤回消息修改 RecallCommandMessage 增加属性\n        isDelete 是否仅删除不提示撤回消息\n        isAdmin 是否管理员撤回\n        adminId 管理员 Id\n\nDate: 2019-05-30\nauth: KongCong\nupdate: \n    1. getRemoteConversations 暂时不可用，因 c++ 协议栈接口变更\n    2. searchConversationByContent 新增 customMsgTypes 参数，参数为数组，直接透传给 c++ 协议栈，用于修复获取到的会话中 matchCount 匹配消息数量与 searchMessageByContent 实际获取的消息数不相等\nDate: 2019-06-05\nauth: kongcong\nupdate:\n    getRemoteConversations 适配 c++ 协议栈，此方法增加 beginTime, order 参数，用于获取指定时间点开始、向前或向后的会话\n    beginTime: 时间戳，若值为 0，则默认使用服务系统时间戳\n    order: 时间方向，0 获取指定时间点以前的会话，1 获取指定时间点以后的会话\nDate: 2019-07-24\nauth: LiuYuqi\nupdate:\n    增加 clearCache 方法，解决 web 端切换用户时，获取会话列表后，返回值为上一个用户的数据\n\nDate: 2020-03-11\nauth: WangYongHao\nupdate:\n    文字、图片、语音、高清语音消息增加阅后即焚 burnDuration 字段\n    */\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(this, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"//\", wsScheme = 'ws://';\n            var protocols = 'http:,https:';\n            if (protocols.indexOf(location.protocol) == -1) {\n                protocol = 'http://';\n            }\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.1.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProp) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProp);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, groupId) {\n            if (!custId || !callback)\n                return;\n            var msg;\n            if (typeof groupId == 'undefined') {\n                msg = new RongIMLib.HandShakeMessage();\n            }\n            else {\n                msg = new RongIMLib.HandShakeMessage({ groupid: groupId });\n            }\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"boolean|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, direction);\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName));\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            callback = callback || function(){};\n            return RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes, customMsgTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes, customMsgTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            return RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        /* \n            var conversation = {\n                // 会话类型\n                types: [1, 2, 3, 4, 5, 6, 7, 8],\n                // 获取会话的开始始时间， 0 ，按会话中最后一条消息最大 sentTime 倒序开始获取\n                sentTime: 0,\n                // 获取条数\n                count: 100\n            };\n\n            var callbacks = {\n                onSuccess: function(){\n\n                },\n                onError: function(){\n\n                }\n            };\n        */\n        RongIMClient.prototype.getConversationsByPage = function (conversation, callbacks) {\n            return RongIMClient._dataAccessProvider.getConversationsByPage(conversation, callbacks);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversations = function(count, beginTime, order, callback){\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"number\", \"object\"], \"getRemoteConversations\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversations(count, beginTime, order, callback);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQnTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getQnTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: true, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.3.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\", \"subUserStatus\", \"cleanHisMsg\"];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers);\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement(\"script\");\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        if (server) {\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            if (temp.type != 2) {\n                //普通消息\n                time = RongIMLib.RongIMClient._storageProvider.getItem(this.userId) || '0';\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    if (str == \"chrmPull\") {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //防止因离线消息造成会话列表不为空而无法从服务器拉取会话列表。\n                    //offlineMsg && (RongIMClient._memoryStore.isSyncRemoteConverList = true);\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        if (!(list[i].msgId in me.cacheMessageIds)) {\n                            count -= 1;\n                            var message = list[i];\n                            var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                            if (sentTime > time) {\n                                Bridge._client.handler.onReceived(message, undefined, offlineMsg, count);\n                                var arrLen = me.cacheMessageIds.unshift(list[i].msgId);\n                                if (arrLen > 20) {\n                                    me.cacheMessageIds.length = 20;\n                                }\n                            }\n                        }\n                    }\n                    var isPullFinished = collection.finished;\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    if (!RongIMLib.RongIMClient._memoryStore.isPullFinished) {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n            if (isSend) {\n                var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                var userId = RongIMLib.Bridge._client.userId;\n                var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                if (message.sentTime <= lastSentTime && !isSync) {\n                    return;\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳 \n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag;\n            var isPersited = msgTag.isPersited;\n            if (isPersited) {\n                RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function (con) {\n                        if (!con) {\n                            con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                        }\n                        if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                            var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                            var key = message.conversationType + '_' + message.targetId, info = {};\n                            if (message.content && message.content.mentionedInfo) {\n                                info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                                mentioneds = JSON.stringify(info);\n                            }\n                            if (mentioneds) {\n                                var info = JSON.parse(mentioneds);\n                                con.mentionedMsg = info[key];\n                            }\n                        }\n                      //  var isCounted = con.conversationType != 0 && message.senderUserId != Bridge._client.userId && message.receivedStatus != RongIMLib.ReceivedStatus.RETRIEVED && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]\n                        \n                        var isReceiver = message.messageDirection == 2;\n                        if (isReceiver && msgTag.getMessageTag() > 0) {\n                            con.unreadMessageCount = con.unreadMessageCount + 1;\n                            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                                var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, Number(count) + 1);\n                            }\n                        }\n                        con.receivedTime = new Date().getTime();\n                        con.receivedStatus = message.receivedStatus;\n                        con.senderUserId = message.sendUserId;\n                        con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                        con.latestMessageId = message.messageId;\n                        con.latestMessage = message;\n                        con.sentTime = message.sentTime;\n                        RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n                    },\n                    onError: function (error) { }\n                });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var lcount = leftCount || 0;\n                // TODO: Web 暂时未获取是否还有更多离线消息，所以复制 false 默认没有更多离线消息\n                var hasMore = false;\n                RongIMLib.RongIMClient._dataAccessProvider.addMessage(message.conversationType, message.targetId, message, {\n                    onSuccess: function (ret) {\n                        setTimeout(function () {\n                            that._onReceived(ret, lcount, hasMore);\n                        });\n                    },\n                    onError: function (error) {\n                        setTimeout(function () {\n                            that._onReceived(message, lcount, hasMore);\n                        });\n                    }\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(self.pottingProfile(item), 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0 || _status == 21502) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var userId = RongIMLib.Bridge._client.userId;\n                var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                stroageProvider.setItem(userId, timestamp);\n                stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                RongIMLib.RongIMClient._memoryStore.lastReadTime.get(userId, timestamp);\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId }, _status);\n            }\n            else {\n                this._timeout(_status, { messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                //重定向 连错 CMP\n                var x = {};\n                var me = this;\n                new RongIMLib.Navigation().getServerEndpoint(this._client.token, this._client.appId, function () {\n                    me._client.clearHeartbeat();\n                    new RongIMLib.Client(me._client.token, me._client.appId).__init.call(x, function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && me._client.keepLive();\n                    });\n                    me._client.channel.socket.fire(\"StatusChanged\", 2);\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.Bridge._client.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                if (isSameUser && isSameType) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    setTimeout(function () {\n                        _onsuccess();\n                    }, 300);\n                    return;\n                }\n            }\n            Navigation.clear();\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryMCMsg\",\n    8: \"qryMPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            message && (this.groupid = message.groupid);\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n\n            // RCE 增加\n            this.isDelete = message.isDelete;\n            this.isAdmin = message.isAdmin;\n            this.adminId = message.adminId;\n\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMessageInput(), self = this;\n            modules.setTargetId(targetId);\n            if (timestamp === 0 || timestamp > 0) {\n                modules.setDataTime(timestamp);\n            }\n            else {\n                modules.setDataTime(RongIMLib.RongIMClient._memoryStore.lastReadTime.get(conversationType + targetId));\n            }\n            modules.setSize(count);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(conversationType + targetId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + Date.now();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversations = function(count, beginTime, order, callback){\n            callback.onSuccess();\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    if (conversationTypes) {\n                        var convers = [];\n                        Array.forEach(conversationTypes, function (converType) {\n                            Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                                if (item.conversationType == converType) {\n                                    convers.push(item);\n                                }\n                            });\n                        });\n                        setTimeout(function () {\n                            callback.onSuccess(convers);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {},\n                onError: function(){}\n            });\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data, code) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = c || {};\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg, code);\n                    });\n                },\n                onError: function (errorCode, data) {\n                    msg.messageUId = data.messageUId || msg.messageUId;\n                    msg.sentTime = data.timestamp || msg.sentTime;\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        (c || {}).latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        /* WebSDK 不支持会话列表分页, 内部获取全量会话列表 */\n        ServerDataProvider.prototype.getConversationsByPage = function(conversation, callbacks){\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                setTimeout(function () {\n                    callbacks.onSuccess(list);\n                });\n                return;\n            }\n            var conversationTypes = null;\n            var count = conversation.count;\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callbacks.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callbacks.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count);\n        },\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                setTimeout(function () {\n                    callback.onSuccess(list);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            if (conversationTypes) {\n                for (var i = 0, len = conversationTypes.length; i < len; i++) {\n                    Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                        if (conver.conversationType == conversationTypes[i]) {\n                            count += conver.unreadMessageCount;\n                        }\n                    });\n                }\n            }\n            else {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    count += conver.unreadMessageCount;\n                });\n            }\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var conversation = this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver ? conver.unreadMessageCount : 0);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n            return conversation.unreadMessageCount || 0;\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        conver.mentionedMsg = null;\n                        var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                        if (mentioneds) {\n                            var info = JSON.parse(mentioneds);\n                            delete info[conversationType + \"_\" + targetId];\n                            if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                            }\n                            else {\n                                RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                            }\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes, customMsgTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, serverConf.version, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30004:\n                    case 30005:\n                    case 30006:\n                    case 30007:\n                    case 30008:\n                    case 30009:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;         \n                    if (isVoIPMsg) {\n                        RongIMClient._voipProvider && RongIMClient._voipProvider.onReceived(message);\n                    }else{\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                    // listener.onReceived(message, leftCount);\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteConversations = function(count, beginTime, order, callback){\n            this.addon.getRemoteConversations(count, beginTime, order, function(){\n                callback.onSuccess();\n            }, function(code){\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[i] = me.buildConversation(tmpObj);\n                    }\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n         /* \n            var conversation = {\n                // 会话类型\n                types: [1, 2, 3, 4, 5, 6, 7, 8],\n                // 获取会话的开始始时间， 0 ，按会话中最后一条消息最大 sentTime 倒序开始获取\n                sentTime: 0,\n                // 获取条数\n                count: 100\n            };\n\n            var callbacks = {\n                onSuccess: function(){\n\n                },\n                onError: function(){\n                    \n                }\n            };\n        */\n        VCDataProvider.prototype.getConversationsByPage = function (conversation, callbacks) {\n            var types = conversation.types || [1, 2, 3, 4, 5, 6, 7, 8];\n            var sentTime = conversation.sentTime || 0;\n            var count = conversation.count || 50;\n            var result = this.addon.getConversationListByPage(types, sentTime, count);\n            var list = JSON.parse(result).list, conversations = [];\n            for (var i = 0, len = list.length; i < len; i++) {\n                var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                if (obj != \"\") {\n                    conversations[i] = this.buildConversation(tmpObj);\n                }\n            }\n            callbacks.onSuccess(conversations);\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                sendCallback.onSuccess(me.buildMessage(message), code);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProp) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProp);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conversation = null;\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                conversation = this.buildConversation(ret);\n                callback.onSuccess(conversation);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return conversation;\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    // message.sentStatus = RongIMLib.SentStatus.READ;\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    count = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    count = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return count;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var count = 0;\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                count = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return count;\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes, customMsgTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            this.useConsole && console.log(\"searchConversationByContent\");\n            var me = this;\n            this.addon.searchConversationByContent(converTypes, keyword, customMsgTypes, function(result){\n                var list = JSON.parse(result).list, convers = [];\n                var index = 0;\n                for (var i = list.length - 1; i >=0; i--) {\n                    convers[index] = me.buildConversation(list[i].obj);\n                    index++;\n                }\n                callback.onSuccess(convers);\n            }, callback.onError);\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            conver.matchCount = c.matchCount;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key, obj);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.3.1-revise-20200311.js",
    "content": "/*\n切换新版 SDK 检查记录：杨川\n\n修改红包消息命名错误\nJrmfReadPacketMessage => JrmfRedPacketMessage\nJrmfReadPacketOpenedMessage => JrmfRedPacketOpenedMessage\n\n缺失方法 clearData\n\nC++ 消息监听 VCDataProvider.prototype.setOnReceiveMessageListener 缺失音视频消息过滤\n_voipProvider.onReceived\n\nVCDataProvider.prototype.getRemoteConversationList obj 少了空字符串判断\n\nVCDataProvider.prototype.sendReceiptResponse 方法为空 RCE 未用到\n\nvoip 2018-3-10 修改\n    InviteMessage MemberModifyMessage 消息体重增加 observerUserIds 属性\n\n导航重定向修改\nsetConnectionStatusListener() 抛出一些状态码\n\n注册消息时增加搜索项 addon.registerMessageType\nsearchProp\n*/\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n/*\ndate: 2018-07-02\nauth: yangchuan\nbug: Web 端消息是否计数标识不生效\nupdate: Web 接收消息时判断消息是否需要计数\n\ndate: 2018-07-10\nauth: yangchuan\nupdate: 发送消息敏感词替换，触发成功回调并返回对应 code 码\n\n以上已合并至 SDK\n------------------------------------------------------\n\ndate: 2018-10-25\nauth: yuhongda\nfeat: 消息监听增加 `是否还有离线消息`\nfeature: 用此属性区分是否还有离线消息，待会补偿消息拉取完成后更新一次会话\n\ndate: 2018-10-26\nauth: yuhongda\nfeat: addon.getUnreadCount 支持同步获取\n\ndate: 2018-10-27\nauth: yuhongda\nfeat: 会话列表增加分页\nmemo: 仅 c++ 支持会话列表分页\n\ndate: 2018-12-3\nauth: yuhongda\nfeat: 增加获取公众号历史消息的信令\nmemo: 仅 web 端生效\n\nDate: 2019-05-05\nAuthor: YuHongDa\n增加获取服务端会话列表接口(getRemoteConversations)，此接口参会成功失败，C++ 层做数据合并，此接口仅在 Electron 中有效\n\ndate: 2019-05-08\nauth: LiuYuqi\nupdate: RCE 增加管理员撤回消息修改 RecallCommandMessage 增加属性\n        isDelete 是否仅删除不提示撤回消息\n        isAdmin 是否管理员撤回\n        adminId 管理员 Id\n\nDate: 2019-05-30\nauth: KongCong\nupdate: \n    1. getRemoteConversations 暂时不可用，因 c++ 协议栈接口变更\n    2. searchConversationByContent 新增 customMsgTypes 参数，参数为数组，直接透传给 c++ 协议栈，用于修复获取到的会话中 matchCount 匹配消息数量与 searchMessageByContent 实际获取的消息数不相等\nDate: 2019-06-05\nauth: kongcong\nupdate:\n    getRemoteConversations 适配 c++ 协议栈，此方法增加 beginTime, order 参数，用于获取指定时间点开始、向前或向后的会话\n    beginTime: 时间戳，若值为 0，则默认使用服务系统时间戳\n    order: 时间方向，0 获取指定时间点以前的会话，1 获取指定时间点以后的会话\nDate: 2019-07-24\nauth: LiuYuqi\nupdate:\n    增加 clearCache 方法，解决 web 端切换用户时，获取会话列表后，返回值为上一个用户的数据\n\nDate: 2020-03-11\nauth: WangYongHao\nupdate:\n    1. 根据导航协议头匹配 navi、cmp\n    2. 文字、图片、语音、高清语音消息增加阅后即焚 burnDuration 字段\n\n    */\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(this, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var protocols = 'http:,https:';\n            if (protocols.indexOf(location.protocol) == -1) {\n                protocol = 'http://';\n            }\n            if (location.protocol == 'https:') {\n                protocol = 'https://';\n                wsScheme = 'wss://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            // RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n            //     _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            // });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                \n                var hasProto = (key in options) && options[key];\n                // var config = {\n                //     path: options[key],\n                //     tmpl: pathTmpl,\n                //     protocol: protocol,\n                //     sub: true\n                // };\n                path = hasProto ? options[key] : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.1.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var memoryStoreNavi = RongIMClient._memoryStore.depend.navi;\n            RongIMClient._memoryStore.depend.navi = RongIMLib.RongUtil.getValidNavi(memoryStoreNavi);\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        RongIMClient.setProtocol = function (protocol) {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var HttpProtocol = RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMClient.WsProtocol;\n            if (protocol === HttpProtocol.http) {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.http;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.ws;\n            }\n            else {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.https;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.wss;\n            }\n        };\n        RongIMClient.getProtocol = function () {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var depend = RongIMClient._memoryStore.depend;\n            var protocol = depend.protocol, wsScheme = depend.wsScheme;\n            if (!protocol || !wsScheme) {\n                protocol = RongIMClient.HttpProtocol.https;\n                wsScheme = RongIMClient.WsProtocol.wss;\n            }\n            return {\n                protocol: protocol,\n                wsScheme: wsScheme\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProp) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProp);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, groupId) {\n            if (!custId || !callback)\n                return;\n            var msg;\n            if (typeof groupId == 'undefined') {\n                msg = new RongIMLib.HandShakeMessage();\n            }\n            else {\n                msg = new RongIMLib.HandShakeMessage({ groupid: groupId });\n            }\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"boolean|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, direction);\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName));\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            callback = callback || function(){};\n            return RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes, customMsgTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes, customMsgTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            return RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        /* \n            var conversation = {\n                // 会话类型\n                types: [1, 2, 3, 4, 5, 6, 7, 8],\n                // 获取会话的开始始时间， 0 ，按会话中最后一条消息最大 sentTime 倒序开始获取\n                sentTime: 0,\n                // 获取条数\n                count: 100\n            };\n\n            var callbacks = {\n                onSuccess: function(){\n\n                },\n                onError: function(){\n\n                }\n            };\n        */\n        RongIMClient.prototype.getConversationsByPage = function (conversation, callbacks) {\n            return RongIMClient._dataAccessProvider.getConversationsByPage(conversation, callbacks);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversations = function(count, beginTime, order, callback){\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"number\", \"object\"], \"getRemoteConversations\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversations(count, beginTime, order, callback);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQnTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getQnTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        RongIMClient.HttpProtocol = {\n            http: 'http://',\n            https: 'https://'\n        };\n        RongIMClient.WsProtocol = {\n            ws: 'ws://',\n            wss: 'wss://'\n        };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: true, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.3.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\", \"subUserStatus\", \"cleanHisMsg\"];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers);\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement(\"script\");\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            protocol: RongIMLib.RongIMClient.getProtocol().protocol,\n                            server: servers[i],\n                            path: i\n                        });\n                        if (server) {\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            if (temp.type != 2) {\n                //普通消息\n                time = RongIMLib.RongIMClient._storageProvider.getItem(this.userId) || '0';\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    if (str == \"chrmPull\") {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //防止因离线消息造成会话列表不为空而无法从服务器拉取会话列表。\n                    //offlineMsg && (RongIMClient._memoryStore.isSyncRemoteConverList = true);\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        if (!(list[i].msgId in me.cacheMessageIds)) {\n                            count -= 1;\n                            var message = list[i];\n                            var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                            if (sentTime > time) {\n                                Bridge._client.handler.onReceived(message, undefined, offlineMsg, count);\n                                var arrLen = me.cacheMessageIds.unshift(list[i].msgId);\n                                if (arrLen > 20) {\n                                    me.cacheMessageIds.length = 20;\n                                }\n                            }\n                        }\n                    }\n                    var isPullFinished = collection.finished;\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    if (!RongIMLib.RongIMClient._memoryStore.isPullFinished) {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n            if (isSend) {\n                var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                var userId = RongIMLib.Bridge._client.userId;\n                var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                if (message.sentTime <= lastSentTime && !isSync) {\n                    return;\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳 \n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag;\n            var isPersited = msgTag.isPersited;\n            if (isPersited) {\n                RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function (con) {\n                        if (!con) {\n                            con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                        }\n                        if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                            var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                            var key = message.conversationType + '_' + message.targetId, info = {};\n                            if (message.content && message.content.mentionedInfo) {\n                                info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                                mentioneds = JSON.stringify(info);\n                            }\n                            if (mentioneds) {\n                                var info = JSON.parse(mentioneds);\n                                con.mentionedMsg = info[key];\n                            }\n                        }\n                      //  var isCounted = con.conversationType != 0 && message.senderUserId != Bridge._client.userId && message.receivedStatus != RongIMLib.ReceivedStatus.RETRIEVED && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]\n                        \n                        var isReceiver = message.messageDirection == 2;\n                        if (isReceiver && msgTag.getMessageTag() > 0) {\n                            con.unreadMessageCount = con.unreadMessageCount + 1;\n                            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                                var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, Number(count) + 1);\n                            }\n                        }\n                        con.receivedTime = new Date().getTime();\n                        con.receivedStatus = message.receivedStatus;\n                        con.senderUserId = message.sendUserId;\n                        con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                        con.latestMessageId = message.messageId;\n                        con.latestMessage = message;\n                        con.sentTime = message.sentTime;\n                        RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n                    },\n                    onError: function (error) { }\n                });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var lcount = leftCount || 0;\n                // TODO: Web 暂时未获取是否还有更多离线消息，所以复制 false 默认没有更多离线消息\n                var hasMore = false;\n                RongIMLib.RongIMClient._dataAccessProvider.addMessage(message.conversationType, message.targetId, message, {\n                    onSuccess: function (ret) {\n                        setTimeout(function () {\n                            that._onReceived(ret, lcount, hasMore);\n                        });\n                    },\n                    onError: function (error) {\n                        setTimeout(function () {\n                            that._onReceived(message, lcount, hasMore);\n                        });\n                    }\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(self.pottingProfile(item), 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0 || _status == 21502) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var userId = RongIMLib.Bridge._client.userId;\n                var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                stroageProvider.setItem(userId, timestamp);\n                stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                RongIMLib.RongIMClient._memoryStore.lastReadTime.get(userId, timestamp);\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId }, _status);\n            }\n            else {\n                this._timeout(_status, { messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                //重定向 连错 CMP\n                var x = {};\n                var me = this;\n                new RongIMLib.Navigation().getServerEndpoint(this._client.token, this._client.appId, function () {\n                    me._client.clearHeartbeat();\n                    new RongIMLib.Client(me._client.token, me._client.appId).__init.call(x, function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && me._client.keepLive();\n                    });\n                    me._client.channel.socket.fire(\"StatusChanged\", 2);\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var successNavi = RongIMLib.RongIMClient._memoryStore.depend.navi;\n                var successNaviProtocol = RongIMLib.RongUtil.getUrlProtocol(successNavi);\n                RongIMLib.RongIMClient.setProtocol(successNaviProtocol);\n                storage.setItem('navprotocol', successNaviProtocol);\n\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.Bridge._client.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                if (isSameUser && isSameType) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    var storageProtocol = storage.getItem('navprotocol');\n                    storageProtocol && RongIMLib.RongIMClient.setProtocol(storageProtocol);\n                    setTimeout(function () {\n                        _onsuccess();\n                    }, 300);\n                    return;\n                }\n            }\n            Navigation.clear();\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryMCMsg\",\n    8: \"qryMPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            message && (this.groupid = message.groupid);\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n\n            // RCE 增加\n            this.isDelete = message.isDelete;\n            this.isAdmin = message.isAdmin;\n            this.adminId = message.adminId;\n\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMessageInput(), self = this;\n            modules.setTargetId(targetId);\n            if (timestamp === 0 || timestamp > 0) {\n                modules.setDataTime(timestamp);\n            }\n            else {\n                modules.setDataTime(RongIMLib.RongIMClient._memoryStore.lastReadTime.get(conversationType + targetId));\n            }\n            modules.setSize(count);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(conversationType + targetId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + Date.now();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversations = function(count, beginTime, order, callback){\n            callback.onSuccess();\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    if (conversationTypes) {\n                        var convers = [];\n                        Array.forEach(conversationTypes, function (converType) {\n                            Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                                if (item.conversationType == converType) {\n                                    convers.push(item);\n                                }\n                            });\n                        });\n                        setTimeout(function () {\n                            callback.onSuccess(convers);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {},\n                onError: function(){}\n            });\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data, code) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = c || {};\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg, code);\n                    });\n                },\n                onError: function (errorCode, data) {\n                    msg.messageUId = data.messageUId || msg.messageUId;\n                    msg.sentTime = data.timestamp || msg.sentTime;\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        (c || {}).latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        /* WebSDK 不支持会话列表分页, 内部获取全量会话列表 */\n        ServerDataProvider.prototype.getConversationsByPage = function(conversation, callbacks){\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                setTimeout(function () {\n                    callbacks.onSuccess(list);\n                });\n                return;\n            }\n            var conversationTypes = null;\n            var count = conversation.count;\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callbacks.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callbacks.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count);\n        },\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                setTimeout(function () {\n                    callback.onSuccess(list);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            if (conversationTypes) {\n                for (var i = 0, len = conversationTypes.length; i < len; i++) {\n                    Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                        if (conver.conversationType == conversationTypes[i]) {\n                            count += conver.unreadMessageCount;\n                        }\n                    });\n                }\n            }\n            else {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    count += conver.unreadMessageCount;\n                });\n            }\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var conversation = this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver ? conver.unreadMessageCount : 0);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n            return conversation.unreadMessageCount || 0;\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        conver.mentionedMsg = null;\n                        var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                        if (mentioneds) {\n                            var info = JSON.parse(mentioneds);\n                            delete info[conversationType + \"_\" + targetId];\n                            if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                            }\n                            else {\n                                RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                            }\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes, customMsgTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, serverConf.version, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30004:\n                    case 30005:\n                    case 30006:\n                    case 30007:\n                    case 30008:\n                    case 30009:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;         \n                    if (isVoIPMsg) {\n                        RongIMClient._voipProvider && RongIMClient._voipProvider.onReceived(message);\n                    }else{\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                    // listener.onReceived(message, leftCount);\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteConversations = function(count, beginTime, order, callback){\n            this.addon.getRemoteConversations(count, beginTime, order, function(){\n                callback.onSuccess();\n            }, function(code){\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[i] = me.buildConversation(tmpObj);\n                    }\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n         /* \n            var conversation = {\n                // 会话类型\n                types: [1, 2, 3, 4, 5, 6, 7, 8],\n                // 获取会话的开始始时间， 0 ，按会话中最后一条消息最大 sentTime 倒序开始获取\n                sentTime: 0,\n                // 获取条数\n                count: 100\n            };\n\n            var callbacks = {\n                onSuccess: function(){\n\n                },\n                onError: function(){\n                    \n                }\n            };\n        */\n        VCDataProvider.prototype.getConversationsByPage = function (conversation, callbacks) {\n            var types = conversation.types || [1, 2, 3, 4, 5, 6, 7, 8];\n            var sentTime = conversation.sentTime || 0;\n            var count = conversation.count || 50;\n            var result = this.addon.getConversationListByPage(types, sentTime, count);\n            var list = JSON.parse(result).list, conversations = [];\n            for (var i = 0, len = list.length; i < len; i++) {\n                var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                if (obj != \"\") {\n                    conversations[i] = this.buildConversation(tmpObj);\n                }\n            }\n            callbacks.onSuccess(conversations);\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                sendCallback.onSuccess(me.buildMessage(message), code);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProp) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProp);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conversation = null;\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                conversation = this.buildConversation(ret);\n                callback.onSuccess(conversation);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return conversation;\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    // message.sentStatus = RongIMLib.SentStatus.READ;\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    count = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    count = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return count;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var count = 0;\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                count = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return count;\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes, customMsgTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            this.useConsole && console.log(\"searchConversationByContent\");\n            var me = this;\n            this.addon.searchConversationByContent(converTypes, keyword, customMsgTypes, function(result){\n                var list = JSON.parse(result).list, convers = [];\n                var index = 0;\n                for (var i = list.length - 1; i >=0; i--) {\n                    convers[index] = me.buildConversation(list[i].obj);\n                    index++;\n                }\n                callback.onSuccess(convers);\n            }, callback.onError);\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            conver.matchCount = c.matchCount;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key, obj);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.getLocalProtocol = function () {\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol === 'https:') {\n                return 'https://';\n            }\n            else {\n                return 'http://';\n            }\n        };\n        RongUtil.getValidNavi = function (naviHost) {\n            var HttpProtocol = RongIMLib.RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMLib.RongIMClient.WsProtocol;\n            var flag = '://';\n            var index = naviHost.indexOf(flag);\n            var hasProtocol = index > -1;\n            var navi = naviHost;\n            if (!hasProtocol) {\n                var protocol = RongIMLib.RongIMClient.getProtocol().protocol;\n                navi = protocol + naviHost;\n            }\n            var naviProtocol = RongUtil.getUrlProtocol(navi), localProtocol = RongUtil.getLocalProtocol();\n            // 本地为 https, 但却传入 http 时, 强制转化为 https\n            if (naviProtocol === HttpProtocol.http && localProtocol === 'https://') {\n                navi = RongUtil.formatProtoclPath({\n                    path: navi,\n                    tmpl: '{0}{1}',\n                    protocol: HttpProtocol.https,\n                    sub: true\n                });\n            }\n            return navi;\n        };\n        RongUtil.getUrlProtocol = function (url) {\n            var flag = '://';\n            var index = url.indexOf(flag);\n            if (index > -1) {\n                return url.substring(0, index + flag.length);\n            }\n            else {\n                return 'https://';\n            }\n            ;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.3.5-bugfix-zhiyuan-20190408.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n    bugfix: 自己给自己发消息, targetId 为 ''(搜索此句能看到修改内容), 且会连续收到两条离线消息\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.3.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.3.5';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\", \"subUserStatus\", \"cleanHisMsg\"];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                        timers.length = 0;\n                        elements.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var xss = document.createElement(\"script\");\n                            xss.src = url;\n                            document.body.appendChild(xss);\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = xss.src;\n                                callback(url);\n                            };\n                            xss.onload = onSuccess;\n                            xss.onerror = onSuccess;\n                            elements.push(xss);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            var isFirstConnect = true;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    var receivedMsgIdList = []; // 自己给自己发消息, 拉消息重复\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.fromUserId == Bridge._client.userId;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        var msgId = message.msgId;\n                        var hasReceived = receivedMsgIdList.indexOf(msgId) !== -1; // 自己给自己发消息, 拉消息重复\n                        if (sentTime > compareTime && !hasReceived) { // 自己给自己发消息, 拉消息重复\n                            receivedMsgIdList.push(msgId);\n                            var isSyncMessage = false;\n                            Bridge._client.handler.onReceived(message, undefined, offlineMsg, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con,\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().getServerEndpoint(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.RongIMClient._memoryStore.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId && !entity.groupId && entity.type !== RongIMLib.ConversationType.GROUP) {\n                message.targetId = entity.fromUserId;\n            }\n            // 自己给自己发消息, targetId 为 ''\n            else if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageDirection = entity.direction === 1 || entity.direction === -1 ? 1 : 2;\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    msg.messageUId = _msg.messageUId;\n                    msg.sentTime = _msg.sentTime;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key, obj);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.1.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.6.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                console.log('[RongCloud] ConnectAckTime:', timestamp);\n                console.log('[RongCloud] Local Time:', +new Date());\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                    console.log('[RongCloud] Delta Time:', 0);\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                    console.log('[RongCloud] Delta Time:', RongIMLib.RongIMClient._memoryStore.deltaTime);\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n            this.socket.fire(\"disconnect\", code);\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            modules.setRoomType(0);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            this.observers.push(observer);\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.3.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n    修改:\n        只走 wss 和 https\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.3';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                wsFromGet: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                wsFromEl: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            if (isPolling) {\n                connectMap['comet']();\n            }\n            else {\n                var connectType = isWSPingJSONP ? 'wsFromEl' : 'wsFromGet';\n                connectMap[connectType]();\n            }\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'ChrmNotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                if (data.type === 2) {\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                that._onReceived(message, count, hasMore);\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers)) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            console.log('url', url);\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                    script.onerror = function () {\n                        console.log('----------');\n                    }\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            if (window.navigator) {\n                var browserAgent = window.navigator.userAgent.toLowerCase();\n                var isIPhone = browserAgent.indexOf('iphone') > -1;\n                if (isIPhone && isXHR == false) {\n                    isXHR = (typeof XMLHttpRequest == 'object');\n                }\n            }\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.Prosumer = Prosumer;\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.4.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.3';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'ChrmNotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                if (data.type === 2) {\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                that._onReceived(message, count, hasMore);\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers)) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.Prosumer = Prosumer;\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.5-private.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: true,\n                isWSPingJSONP: true,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.5';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            if (depend.cmpUrl) {\n                servers = [depend.cmpUrl].concat(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'ChrmNotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                if (data.type === 2) {\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                that._onReceived(message, count, hasMore);\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers)) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.Prosumer = Prosumer;\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.5.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.4';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            if (depend.cmpUrl) {\n                servers = [depend.cmpUrl].concat(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            if (depend.cmpUrl) {\n                startConnect(depend.cmpUrl);\n            } else {\n                connectMap[connectType]();\n            }\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId)) {\n                // debugger;\n            }\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'ChrmNotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                if (data.type === 2) {\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                that._onReceived(message, count, hasMore);\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers)) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            // RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                // RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            // RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.Prosumer = Prosumer;\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.6.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * JSON 后的消息体超限, 目前最大 128kb\n         * */\n        ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ReferenceMessage: { objectName: \"RC:ReferenceMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                ReferenceMessage: \"ReferenceMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageSearchField(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.MaxMessageContentBytes = 131072; // 128kb\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.5';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            if (depend.cmpUrl) {\n                servers = [depend.cmpUrl].concat(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'ChrmNotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                if (data.type === 2) {\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                var receivedTime = new Date().getTime();\n                con.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                that._onReceived(message, count, hasMore);\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            if (msg && RongIMLib.RongUtil.isObject(msg) && msg.timestamp) {\n                RongIMLib.MessageUtil.setDeltaTime(msg.timestamp);\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                RongIMLib.MessageUtil.setDeltaTime(timestamp);\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers)) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                try {\n                    this.pool = this.pool.concat(b);\n                }\n                catch (e) {\n                    [].push.apply(this.pool, b);\n                }\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:ReferenceMsg\": \"ReferenceMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            var receivedTime = new Date().getTime();\n            message.messageUId = entity.msgId;\n            message.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        MessageUtil.setDeltaTime = function (serverTime) {\n            try {\n                RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - serverTime;\n            }\n            catch (e) { }\n        };\n        MessageUtil.getDeltaTime = function () {\n            var _memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            return _memoryStore.deltaTime || 0;\n        };\n        MessageUtil.getCheckedTime = function (time) {\n            var deltaTime = MessageUtil.getDeltaTime();\n            return time - deltaTime;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n    var ReferenceMessage = (function () {\n        function ReferenceMessage(message) {\n            this.messageName = \"ReferenceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.content = message.content;\n            this.referMsgUserId = message.referMsgUserId;\n            this.referMsgOjb = message.referMsgOjb;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ReferenceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReferenceMessage;\n    })();\n    RongIMLib.ReferenceMessage = ReferenceMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            var encodedContent = messageContent.encode();\n            if (RongIMLib.RongUtil.getByteLength(encodedContent) > RongIMLib.RongIMClient.MaxMessageContentBytes) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);\n                });\n                return;\n            }\n            modules.setContent(encodedContent);\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            this.addon.setMessageSearchField(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.getByteLength = function (str, charset) {\n            charset = charset || 'utf-8';\n            var total = 0, chatCode;\n            if (charset === 'utf-16') {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode <= 0xffff) {\n                        total += 2;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            else {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode < 0x007f) {\n                        total += 1;\n                    }\n                    else if (chatCode <= 0x07ff) {\n                        total += 2;\n                    }\n                    else if (chatCode <= 0xffff) {\n                        total += 3;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            return total;\n        };\n        RongUtil.Prosumer = Prosumer;\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.9-release.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n    Release Date: Tue Jul 14 2020 16:33:19 GMT+0800 (China Standard Time)\n    CodeVersion: 551c131e1273bd80ea99d41ca71b08df49f6b87a\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n// console.warn('SDK VERSION:', '551c131e1273bd80ea99d41ca71b08df49f6b87a')\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 1] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 2] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * JSON 后的消息体超限, 目前最大 128kb\n         * */\n        ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            RongIMClient.settingListeners = [];\n            RongIMClient.conversationStatusListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.9.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                isFullConversations: false,\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {},\n                networkUnavailable: false,\n                loggerSwitch: options.loggerSwitch || 'on',\n                autoReconnectTimer: null // 自动重连定时器编号\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ReferenceMessage: { objectName: \"RC:ReferenceMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GIFMessage: { objectName: \"RC:GIFMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                SightMessage: { objectName: \"RC:SightMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                LogCommandMessage: { objectName: 'RC:LogCmdMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                ReferenceMessage: \"ReferenceMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                GIFMessage: 'GIFMessage',\n                SightMessage: 'SightMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage',\n                LogCommandMessage: 'LogCommandMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    appKey: appKey\n                } });\n            return sdkInfo;\n        };\n        ;\n        RongIMClient.setProtocol = function (protocol) {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var HttpProtocol = RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMClient.WsProtocol;\n            if (protocol === HttpProtocol.http) {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.http;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.ws;\n            }\n            else {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.https;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.wss;\n            }\n        };\n        RongIMClient.getProtocol = function () {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var depend = RongIMClient._memoryStore.depend;\n            var protocol = depend.protocol, wsScheme = depend.wsScheme;\n            if (!protocol || !wsScheme) {\n                protocol = RongIMClient.HttpProtocol.https;\n                wsScheme = RongIMClient.WsProtocol.wss;\n            }\n            return {\n                protocol: protocol,\n                wsScheme: wsScheme\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            if (RongIMLib.IMHandler.isIncludeNavi(token)) {\n                var protocol = RongIMClient._memoryStore.depend.protocol;\n                var currentNavs = RongIMClient._memoryStore.depend.navigaters;\n                var navList = RongIMLib.IMHandler.getNavsByToken(token, protocol);\n                token = RongIMLib.IMHandler.getToken(token);\n                RongIMClient._memoryStore.depend.navigaters = RongIMLib.RongUtil.concat(navList, currentNavs, true);\n            }\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.setConversationStatusListener = function (listener) {\n            if (listener && listener.onChanged && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.conversationStatusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        RongIMClient.watch = function (watchers) {\n            watchers = watchers || {};\n            var setting = watchers.setting;\n            if (RongIMLib.RongUtil.isFunction(setting)) {\n                RongIMClient.settingListeners.push(setting);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_DISC_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM });\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback, version) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback, version);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global|boolean\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            RongIMClient._dataAccessProvider.setConversationStatus(type, targetId, statusItem, callback);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback, params);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageSearchField(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    if (tempConver.msg) {\n                        conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                        conver.latestMessageId = conver.latestMessage.messageId;\n                        conver.objectName = conver.latestMessage.objectName;\n                        conver.receivedStatus = conver.latestMessage.receivedStatus;\n                        conver.receivedTime = conver.latestMessage.receiveTime;\n                        conver.sentStatus = conver.latestMessage.sentStatus;\n                        conver.sentTime = conver.latestMessage.sentTime;\n                    }\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    var status = RongIMClient._dataAccessProvider.conversationStatusManager.get(tempConver.type, tempConver.userId);\n                    conver.notificationStatus = status.notificationStatus;\n                    conver.isTop = status.isTop;\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback, fileName) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\", \"undefined|null|string\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"), fileName);\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\", \"undefined|null|object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"), data);\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", 'object', \"string\", \"string\", \"object\"], \"setRTCUserTotalRes\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserTotalRes(roomId, message, valueInfo, objectName, callback);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.HttpProtocol = {\n            http: 'http://',\n            https: 'https://'\n        };\n        RongIMClient.WsProtocol = {\n            ws: 'ws://',\n            wss: 'wss://'\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.MaxMessageContentBytes = 131072; // 128kb\n        RongIMClient.NavMarkInToken = '@';\n        RongIMClient.NavSeparatorInToken = ';';\n        RongIMClient.NavExpiredTime = 7200000; // 2 小时\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.9';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.settingListeners = [];\n        RongIMClient.conversationStatusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    RongIMLib.StatusTopic = (function () {\n        var ConversationType = RongIMLib.ConversationType;\n        var topic = {};\n        topic[ConversationType.PRIVATE] = 'ppMsgS';\n        topic[ConversationType.GROUP] = 'pgMsgS';\n        return topic;\n    })();\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var customCmpUrl = depend.cmpUrl;\n            if (RongIMLib.RongUtil.isValidWsUrl(customCmpUrl)) {\n                servers = [customCmpUrl];\n            }\n            else {\n                servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                        url: url\n                                    } });\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                            url: url,\n                                            code: code\n                                        } });\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    url: server\n                                } });\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                                desc: 'all websocket addresses are unavailable',\n                                cmp: servers,\n                                ConnectionStatus: RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE,\n                                available: false\n                            } });\n                        clearHandler();\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        var storeServers = storage.getItem('servers');\n                        try {\n                            storeServers = JSON.parse(storeServers);\n                            !RongIMLib.RongUtil.getValidWsUrlList(storeServers).length && RongIMLib.Navigation.clear();\n                        }\n                        catch (e) { }\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    me.connectionStatus = code;\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                    var unReportCodes = [RongIMLib.ConnectionStatus.CONNECTING, RongIMLib.ConnectionStatus.REQUEST_NAVI, RongIMLib.ConnectionStatus.RESPONSE_NAVI];\n                    var isReportCode = RongIMLib.RongUtil.indexOf(unReportCodes, code) === -1;\n                    if (isReportCode) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_NETC_S, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                ConnectionStatus: code,\n                                available: false\n                            } });\n                    }\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    if (RongIMLib.RongUtil.getValidWsUrlList(servers).length) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", RongIMLib.Transportations._TransportType);\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                    else {\n                        me.changeConnectType();\n                        RongIMLib.RongIMClient.isFirstConnect = false;\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg, option) {\n            option = option || {};\n            var isNoAck = option.isNoAck;\n            var hasCallback = !!_callback;\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (isNoAck) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                _callback.onSuccess(msg);\n            }\n            else if (hasCallback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    var errorMsg = \"syncTime:Received messages of chatroom but was not init\";\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CHRM_PULL_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            msg: errorMsg\n                        } });\n                    throw new Error(errorMsg);\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            try {\n                                Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                            }\n                            catch (e) {\n                                console.log(e);\n                            }\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_QUERY_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'invoke -> queryMessage',\n                            error: error\n                        } });\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                    if (status == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE) {\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = true;\n                    }\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType, params) {\n            params = params || {};\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                var isStatusMessage = params.isStatus;\n                var statusTopic = RongIMLib.StatusTopic[topic];\n                if (isStatusMessage && statusTopic) {\n                    Bridge._client.publishMessage(statusTopic, content, targetId, callback, msg, {\n                        isNoAck: true\n                    });\n                }\n                else {\n                    Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg); // 非状态消息, 逻辑不变\n                }\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'NotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                if (data.type === 2) {\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n                else if (data.type === 3) {\n                    RongIMLib.RongIMClient._dataAccessProvider.conversationStatusManager.pull({\n                        time: timestamp\n                    });\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            if (!msg) {\n                return;\n            }\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    try {\n                        entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    }\n                    catch (e) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { stack: e, msg: 'MessageHandler -> onReceived' } });\n                        return;\n                    }\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                var receivedTime = new Date().getTime();\n                con.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.isTop = false;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            if (RongIMLib.LoggerUtil.isLogCmdMsg(message)) {\n                RongIMLib.Logger.reportMNLog(message.content);\n                return;\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content;\n                if (RongIMLib.RongUtil.isUndefined(receiptResponseMsg) || RongIMLib.RongUtil.isNull(receiptResponseMsg)) {\n                    receiptResponseMsg = new RongIMLib.ReadReceiptResponseMessage({});\n                }\n                var receiptMessageDic = receiptResponseMsg.receiptMessageDic || {}, uIds = receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                try {\n                    that._onReceived(message, count, hasMore);\n                }\n                catch (e) {\n                    console.error(e);\n                }\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            if (msg && RongIMLib.RongUtil.isObject(msg) && msg.timestamp) {\n                RongIMLib.MessageUtil.setDeltaTime(msg.timestamp);\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CATCH_UNKNOWN_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'MessageHandler -> handleMessage',\n                            msg: msg\n                        } });\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token,\n                        bosToken: entity.bosToken,\n                        bosDate: entity.bosDate,\n                        path: entity.path\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_QUERY_DATA_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            stack: e,\n                            msg: 'QueryCallback -> process'\n                        } });\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                RongIMLib.MessageUtil.setDeltaTime(timestamp);\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result, naviUrl) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var successNaviProtocol = RongIMLib.RongUtil.getUrlProtocol(naviUrl);\n            // navi 请求成功后, 根据 navi 协议头, 设置连接 websocket 协议头\n            RongIMLib.RongIMClient.setProtocol(successNaviProtocol);\n            storage.setItem(Navigation.StoreProtocolKey, successNaviProtocol);\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            storage.setItem('navi_time', RongIMLib.RongUtil.getTimestamp());\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            var uploadDomains = {\n                qiniu: result.uploadServer || '',\n                bos: result.bosAddr || ''\n            };\n            storage.setItem('upload_domains', JSON.stringify(uploadDomains));\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                var currentTime = RongIMLib.RongUtil.getTimestamp();\n                var naviSavedTime = Number(storage.getItem('navi_time')) || 0;\n                var isNotExpired = currentTime - naviSavedTime < RongIMLib.RongIMClient.NavExpiredTime;\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers) && isNotExpired) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    var storageProtocol = storage.getItem(Navigation.StoreProtocolKey);\n                    storageProtocol && RongIMLib.RongIMClient.setProtocol(storageProtocol);\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    if (isNaviJSONP && isWSPingJSONP) {\n                        return _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    }\n                    // 所有导航请求失败，及所有重试失败后，返回预埋导航配置信息，进行连接。预埋导航配置仅适用公有云环境，私有云仍直接抛出\n                    var naviResp = RongIMLib.FixedNaviRespHandler.getResp();\n                    var naviHost = navigaters[0];\n                    context.getNaviSuccess(naviResp, RongIMLib.RongUtil.getValidNavi(naviHost));\n                    _onsuccess();\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                navi = RongIMLib.RongUtil.getValidNavi(navi);\n                indexTools.add();\n                RongIMLib.LoggerUtil.recordFatalLogOfNavi(internalRetry, navigaters);\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result, navi);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n            RongIMLib.Logger.loggerCache.isNewNavi = true;\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            var requestType = \"HTTP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    result = JSON.parse(result);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                            code: 0,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                    success(result);\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            code: status,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            var requestType = \"JSONP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            var loggerResult = function (status, result) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        code: status,\n                        result: result,\n                        url: url,\n                        requestType: requestType\n                    } });\n            };\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                loggerResult(code, result);\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                loggerResult(RongIMLib.ConnectionState.TOKEN_INCORRECT, {});\n            };\n        };\n        Navigation.StoreProtocolKey = 'navprotocol';\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                try {\n                    this.pool = this.pool.concat(b);\n                }\n                catch (e) {\n                    [].push.apply(this.pool, b);\n                }\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (!me.connectedTime || (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime)) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_WS_ERR_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                    error: RongIMLib.ConnectionStatus.WEBSOCKET_ERROR,\n                    msg: 'SocketTransportation -> onError'\n                } });\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:ReferenceMsg\": \"ReferenceMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:GIFMsg\": \"GIFMessage\",\n    \"RC:SightMsg\": \"SightMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\",\n    \"RC:LogCmdMsg\": \"LogCommandMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    // 业务层公共方法处理\n    var IMHandler = (function () {\n        function IMHandler() {\n        }\n        IMHandler.isIncludeNavi = function (token) {\n            var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n            var hasNavMark = navMarkIndex !== -1;\n            return hasNavMark;\n        };\n        IMHandler.getToken = function (token) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                token = token.substring(0, navMarkIndex + 1);\n            }\n            return token;\n        };\n        IMHandler.getNavsByToken = function (token, protocol) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            var navUrlList = [];\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                var navsText = token.substring(navMarkIndex + 1, token.length);\n                var navDomains = navsText.split(RongIMLib.RongIMClient.NavSeparatorInToken);\n                RongIMLib.RongUtil.forEach(navDomains, function (domain) {\n                    if (RongIMLib.RongUtil.isEmpty(domain)) {\n                        return;\n                    }\n                    var navUrl = RongIMLib.RongUtil.formatProtoclPath({\n                        path: domain, protocol: protocol, sub: true\n                    });\n                    navUrlList.push(navUrl);\n                });\n            }\n            return navUrlList;\n        };\n        IMHandler.getConversationKey = function (type, id) {\n            return type + '_' + id;\n        };\n        return IMHandler;\n    })();\n    RongIMLib.IMHandler = IMHandler;\n    ;\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n            // 向缓存中也设置拉消息时间戳\n            SyncTimeUtil._syncTimeCache[key] = sentTime;\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            /**\n             * 先从缓存中获取时间戳，如果缓存中没有再从 localstorage 中取。\n             * 避免多端重连都从 localstorage 中取时间戳，重连成功时间不一致导致后重连的用户拉消息有断档情况\n            */\n            var pullMsgTimeBox = SyncTimeUtil._syncTimeCache;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            if (RongIMLib.RongUtil.isEmpty(pullMsgTimeBox)) {\n                pullMsgTimeBox[sent] = storage.getItem(sent);\n                pullMsgTimeBox[received] = storage.getItem(received);\n            }\n            return {\n                sent: Number(pullMsgTimeBox[sent] || 0),\n                received: Number(pullMsgTimeBox[received] || 0)\n            };\n        };\n        SyncTimeUtil._syncTimeCache = {};\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        // 下行消息状态位判断, 第 9 位为 disableNotification 开关（ 上行为第 5 位 ）\n        MessageUtil.isDisableNotification = function (status) {\n            return Boolean(status & 0x100);\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PARSE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: ex,\n                        msg: 'MessageUtil -> messageParser'\n                    } });\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            var receivedTime = new Date().getTime();\n            message.messageUId = entity.msgId;\n            message.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            try {\n                var status = MessageUtil.int64ToTimestamp(entity.status);\n                message.disableNotification = MessageUtil.isDisableNotification(status);\n            }\n            catch (error) {\n                message.disableNotification = false;\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        MessageUtil.setDeltaTime = function (serverTime) {\n            try {\n                RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - serverTime;\n            }\n            catch (e) { }\n        };\n        MessageUtil.getDeltaTime = function () {\n            var _memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            return _memoryStore.deltaTime || 0;\n        };\n        MessageUtil.getCheckedTime = function (time) {\n            var deltaTime = MessageUtil.getDeltaTime();\n            return time - deltaTime;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n    var ConversationStatusStoreUserKey = '{appkey}{userId}constas';\n    var ConversationStatusPullTimeStoreKey = 'time';\n    var ConversationStatusManager = (function () {\n        function ConversationStatusManager(option) {\n            this.updatedStatus = []; // 更新的会话状态\n            this.statusShangeObserver = new RongIMLib.Observer();\n            this.pullProsumer = new RongIMLib.RongUtil.Prosumer();\n            var appkey = option.appkey, userId = option.userId;\n            this.option = option;\n            this.storageKey = RongIMLib.RongUtil.tplEngine(ConversationStatusStoreUserKey, {\n                appkey: appkey, userId: userId\n            });\n        }\n        ConversationStatusManager.prototype._formatUpdatedStatus = function (status, type, targetId) {\n            var updatedStatus = {\n                conversationType: type,\n                targetId: targetId\n            };\n            delete status.isLastInAPull;\n            return RongIMLib.RongUtil.extend(updatedStatus, status);\n        };\n        ConversationStatusManager.prototype.watchChanged = function (event) {\n            this.statusShangeObserver.add(event);\n        };\n        ConversationStatusManager.prototype.set = function (type, targetId, status) {\n            var currentStatus = this.get(type, targetId);\n            var updateTime = status.updateTime, isLastInAPull = status.isLastInAPull;\n            if (updateTime >= currentStatus.updateTime) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n                var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n                var storeStatus = allStatus[conversationStoreKey] || {};\n                RongIMLib.RongUtil.forEach(status, function (val, key) {\n                    if (!RongIMLib.RongUtil.isUndefined(val)) {\n                        storeStatus[key] = val;\n                    }\n                });\n                allStatus[conversationStoreKey] = storeStatus;\n                RongIMLib.RongUtil.Storage.set(this.storageKey, allStatus);\n                var updatedStatusItem = this._formatUpdatedStatus(status, type, targetId);\n                this.updatedStatus.push(updatedStatusItem);\n                RongIMLib.RongIMClient.getInstance().pottingConversation({\n                    type: type,\n                    userId: targetId\n                });\n            }\n            isLastInAPull && this.statusShangeObserver.emit(this.updatedStatus);\n            this.updatedStatus = [];\n        };\n        ConversationStatusManager.prototype.get = function (type, targetId) {\n            var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n            var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n            var status = allStatus[conversationStoreKey] || {};\n            var notificationStatus = status.notificationStatus, isTop = status.isTop, updateTime = status.updateTime;\n            return {\n                notificationStatus: notificationStatus || RongIMLib.ConversationNotificationStatus.NOTIFY,\n                isTop: isTop || false,\n                updateTime: updateTime || 0\n            };\n        };\n        ConversationStatusManager.prototype.pull = function (option) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭会话状态设置\n            option = option || {};\n            var self = this;\n            var _a = this, server = _a.option.server, pullProsumer = _a.pullProsumer, storageKey = _a.storageKey;\n            pullProsumer.produce(option);\n            pullProsumer.consume(function (params, next) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                var lastUpdateTime = allStatus[ConversationStatusPullTimeStoreKey] || 0;\n                var updateTime = params.time, isForce = params.isForce;\n                if (lastUpdateTime > updateTime && !isForce) {\n                    return next();\n                }\n                server.pullConversationStatus(lastUpdateTime, {\n                    onStatus: function (type, id, conversationStatus) {\n                        self.set(type, id, conversationStatus);\n                    },\n                    onSuccess: function (updateTime) {\n                        var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                        allStatus[ConversationStatusPullTimeStoreKey] = updateTime; // 更新拉取时间戳\n                        RongIMLib.RongUtil.Storage.set(self.storageKey, allStatus);\n                        next();\n                    },\n                    onError: next\n                });\n            });\n        };\n        return ConversationStatusManager;\n    })();\n    RongIMLib.ConversationStatusManager = ConversationStatusManager;\n    var FixedNaviRespHandler = (function () {\n        function FixedNaviRespHandler() {\n        }\n        FixedNaviRespHandler.modifyVoipCallInfoByAppKey = function () {\n            var me = this;\n            try {\n                var naviResp = me.baseResp;\n                var appKey = RongIMLib.RongIMClient._memoryStore.appKey;\n                var voipCallInfo = naviResp.voipCallInfo;\n                var parseVoipCallInfo = JSON.parse(voipCallInfo);\n                RongIMLib.RongUtil.forEach(parseVoipCallInfo.callEngine, function (item) {\n                    if (item.engineType === 3) {\n                        item.vendorKey = appKey;\n                    }\n                });\n                var jsonVoipCallInfo = JSON.stringify(parseVoipCallInfo);\n                naviResp.voipCallInfo = jsonVoipCallInfo;\n            }\n            catch (error) {\n            }\n            return naviResp;\n        };\n        FixedNaviRespHandler.modifyCmpByProtocol = function () {\n            var me = this;\n            var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n            var isHTTP = protocol === RongIMLib.RongIMClient.HttpProtocol.http;\n            var cmpHost = isHTTP ? me.preparedCMP.WS : me.preparedCMP.WSS;\n            me.baseResp.backupServer = cmpHost;\n        };\n        FixedNaviRespHandler.genUserId = function () {\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            return uid;\n        };\n        FixedNaviRespHandler.getResp = function () {\n            var me = this;\n            me.modifyCmpByProtocol();\n            var naviResp = me.modifyVoipCallInfoByAppKey();\n            naviResp.userId = me.genUserId();\n            return naviResp;\n        };\n        FixedNaviRespHandler.baseResp = {\n            isFixedNaviResp: true,\n            code: 200,\n            userId: '',\n            server: '',\n            backupServer: '',\n            voipCallInfo: '{\"strategy\":1,\"callEngine\":[{\"engineType\":4,\"mediaServer\":\"https://rtc-info.ronghub.com\",\"maxStreamCount\":20},{\"engineType\":3,\"vendorKey\":\"\",\"signKey\":\"\",\"blinkCMPServer\":\"rtccmp.ronghub.com:80\",\"blinkSnifferServer\":\"rtccmp.ronghub.com:80\"}]}',\n            kvStorage: 1,\n            uploadServer: 'upload.qiniup.com',\n            openMp: 1,\n            openUS: 1,\n            logSwitch: 1,\n            logPolicy: '{\"url\": \"logcollection.ronghub.com\",\"level\": 1,\"itv\": 6,\"times\": 5}',\n            bosAddr: 'gz.bcebos.com'\n        };\n        FixedNaviRespHandler.preparedCMP = {\n            WSS: 'wsap-cn.ronghub.com:443',\n            WS: 'wsap-cn.ronghub.com:80'\n        };\n        return FixedNaviRespHandler;\n    })();\n    RongIMLib.FixedNaviRespHandler = FixedNaviRespHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_PROFILE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_NOTI_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            message.burnDuration && (this.burnDuration = message.burnDuration);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.conversationType = message.conversationType;\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList, conversationType) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList, conversationType: conversationType });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n    var LogCommandMessage = (function () {\n        function LogCommandMessage(message) {\n            this.messageName = \"LogCommandMessage\";\n            message.uri && (this.uri = message.uri);\n            message.logId && (this.logId = message.logId);\n            message.platform && (this.platform = message.platform);\n            message.packageName && (this.packageName = message.packageName);\n            message.startTime && (this.startTime = message.startTime);\n            message.endTime && (this.endTime = message.endTime);\n            message.user && (this.user = message.user);\n        }\n        LogCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LogCommandMessage;\n    })();\n    RongIMLib.LogCommandMessage = LogCommandMessage;\n    var ReferenceMessage = (function () {\n        function ReferenceMessage(message) {\n            this.messageName = \"ReferenceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.content = message.content;\n            this.referMsgUserId = message.referMsgUserId;\n            this.referMsg = message.referMsg;\n            this.objName = message.objName;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ReferenceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReferenceMessage;\n    })();\n    RongIMLib.ReferenceMessage = ReferenceMessage;\n    var GIFMessage = (function () {\n        function GIFMessage(message) {\n            this.messageName = \"GIFMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.gifDataSize = message.gifDataSize;\n            this.localPath = message.localPath;\n            this.remoteUrl = message.remoteUrl;\n            this.width = message.width;\n            this.height = message.height;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        GIFMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GIFMessage;\n    })();\n    RongIMLib.GIFMessage = GIFMessage;\n    var SightMessage = (function () {\n        function SightMessage(message) {\n            this.messageName = \"SightMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.sightUrl = message.sightUrl;\n            this.content = message.content;\n            this.duration = message.duration;\n            this.size = message.size;\n            this.name = message.name;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        SightMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SightMessage;\n    })();\n    RongIMLib.SightMessage = SightMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse, disableNotification) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n            this.disableNotification = disableNotification;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            var self = this;\n            RongIMLib.Logger.reportRTLog();\n            option = option || {};\n            var isReconnect = option.isReconnect;\n            var isIgnoreReportStart = option.isIgnoreReportStart;\n            var StartReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_T : RongIMLib.LoggerTag.IM.A_CONN_T;\n            var EndReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_R : RongIMLib.LoggerTag.IM.A_CONN_R;\n            !isIgnoreReportStart && RongIMLib.Logger.writeLog({ tag: StartReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { \"token\": token } });\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = false;\n                        RongIMLib.Logger.loggerCache.userId = data;\n                        RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { desc: 'connection succeeded' } });\n                        self.conversationStatusManager = new RongIMLib.ConversationStatusManager({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data,\n                            server: self\n                        });\n                        self.conversationStatusManager.watchChanged(function (status) {\n                            RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.conversationStatusListeners, function (event) {\n                                event(status);\n                            });\n                        });\n                        self.conversationStatusManager.pull({\n                            isForce: true\n                        });\n                    });\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var fullnavi = storage.getItem('fullnavi') || '{}';\n                    try {\n                        fullnavi = JSON.parse(fullnavi);\n                    }\n                    catch (e) {\n                        fullnavi = {};\n                    }\n                    var isAutoPull = fullnavi.openUS;\n                    isAutoPull && self.getVoipInfo({\n                        onSuccess: function (VoipInfo) {\n                            try {\n                                VoipInfo && RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.settingListeners, function (listener) {\n                                    listener({ VoipInfo: VoipInfo }); // 与 3.x 保持一致, 方便后续 3.x 兼容\n                                });\n                                if (VoipInfo) {\n                                    var fullnavi_1 = storage.getItem('fullnavi') || '{}';\n                                    fullnavi_1 = JSON.parse(fullnavi_1);\n                                    fullnavi_1.voipCallInfo = VoipInfo;\n                                    storage.setItem('fullnavi', JSON.stringify(fullnavi_1));\n                                }\n                            }\n                            catch (e) {\n                            }\n                        },\n                        onError: function () {\n                            // do nothing\n                        }\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { ConnectionState: RongIMLib.ConnectionState.TOKEN_INCORRECT } });\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { code: e } });\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                var timer = setTimeout(ping, next);\n                                RongIMLib.RongIMClient._memoryStore.autoReconnectTimer = timer;\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback, null, {\n                                    isIgnoreReportStart: true,\n                                    isReconnect: true\n                                });\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback, null, {\n                            isIgnoreReportStart: true,\n                            isReconnect: true\n                        });\n                    }\n                };\n                handler[key]();\n            }\n            else {\n                var _client = RongIMLib.Bridge._client || {};\n                var _channel = _client.channel || {};\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_RECO_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        msg: {\n                            connectionStatus: _channel.connectionStatus\n                        },\n                        action: 'reconnect'\n                    } });\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            var timer = RongIMLib.RongIMClient._memoryStore.autoReconnectTimer;\n            timer && clearTimeout(timer);\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            params = params || {};\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2, params);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId\n                                        } });\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId,\n                                            error: errorCode\n                                        } });\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    chatroomId: chatroomId\n                                } });\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: error\n                            } });\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId\n                            } });\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: errcode\n                            } });\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback, fileName) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var fileName = RongIMLib.RongUtil.generateUploadFileName(fileType, fileName);\n            // 获取上传地址\n            var domains = RongIMLib.RongIMClient._storageProvider.getItem('upload_domains') || '{}';\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (res) {\n                    setTimeout(function () {\n                        var data = RongIMLib.RongUtil.extend(JSON.parse(domains), res);\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            var data = data || {};\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            if (data.isBosRes) {\n                callback.onSuccess(data);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getVoipInfo = function (callback) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭实时配置，IE 现不支持音视频\n            // 获取最新值\n            return this.getPullSetting({\n                onSuccess: function (result) {\n                    result = result || {};\n                    var items = result.items || [];\n                    var voipInfo = null;\n                    for (var i = 0, max = items.length; i < max; i++) {\n                        var item = items[i];\n                        if (item.key === 'VoipInfo') {\n                            var value = item.value;\n                            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayForm(value.buffer).slice(value.offset, value.limit) : value);\n                            }\n                            else {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayFormInput(value.buffer).subarray(value.offset, value.limit) : value);\n                            }\n                            voipInfo = value;\n                        }\n                    }\n                    callback.onSuccess(voipInfo);\n                },\n                onError: callback.onError\n            }, 0);\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback, version) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            version = version || parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            var sessionId;\n            if (mentiondMsg && isGroup) {\n                sessionId = 7;\n                params.disableNotification && (sessionId = sessionId | 0x10);\n                modules.setSessionId(sessionId);\n            }\n            else {\n                sessionId = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag();\n                params.disableNotification && (sessionId = sessionId | 0x10);\n                modules.setSessionId(sessionId);\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            var encodedContent = messageContent.encode();\n            if (RongIMLib.RongUtil.getByteLength(encodedContent) > RongIMLib.RongIMClient.MaxMessageContentBytes) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);\n                });\n                return;\n            }\n            modules.setContent(encodedContent);\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            msg.disableNotification = params.disableNotification || false;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType, params);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        /**\n         * 向缓存会话列表内添加新会话或更新会话\n        */\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        /**\n         * 更新缓存会话字段\n        */\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        /**\n         * 移除 IM Server 端会话,并清除缓存内会话\n        */\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!RongIMLib.RongUtil.isNumber(count)) {\n                count = 200;\n            }\n            var isLocalInclude = list.length >= count;\n            if (!isSync && (isLocalInclude || RongIMLib.RongIMClient._memoryStore.isFullConversations)) {\n                setTimeout(function () {\n                    var _list = JSON.parse(JSON.stringify(list));\n                    var localList = _list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    var isFullConversations = count > list.length;\n                    RongIMLib.RongIMClient._memoryStore.isFullConversations = isFullConversations;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            var self = this;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionStateModifyReq();\n            var userId = RongIMLib.Bridge._client.userId;\n            var time = +new Date();\n            var stateItemModules = [];\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.notificationStatus)) {\n                var isNotDisturbe = statusItem.notificationStatus === RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                stateItemModules.push({\n                    sessionStateType: 1,\n                    value: isNotDisturbe ? '1' : '0'\n                });\n            }\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.isTop)) {\n                stateItemModules.push({\n                    sessionStateType: 2,\n                    value: statusItem.isTop ? '1' : '0'\n                });\n            }\n            var stateModules = {\n                type: type,\n                channelId: targetId,\n                time: time,\n                stateItem: stateItemModules\n            };\n            modules.setVersion(time);\n            modules.setState([stateModules]);\n            RongIMLib.RongIMClient.bridge.queryMsg('setSeAtt', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var time = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    statusItem.updateTime = time;\n                    statusItem.isLastInAPull = true;\n                    self.conversationStatusManager.set(type, targetId, statusItem);\n                    setTimeout(function () {\n                        callback.onSuccess(time);\n                    });\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStateModifyResp');\n        };\n        ServerDataProvider.prototype.pullConversationStatus = function (time, callback) {\n            time = time || 0;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionReq();\n            modules.setTime(time);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg('pullSeAtts', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var sessionStateList = result.state, lastTime = result.version;\n                    var sessionLength = sessionStateList.length;\n                    RongIMLib.RongUtil.forEach(sessionStateList, function (state, index) {\n                        var type = state.type, targetId = state.channelId, updateTime = state.time, stateItem = state.stateItem;\n                        var isSilent = false, isTop = false;\n                        RongIMLib.RongUtil.forEach(stateItem, function (item) {\n                            var sessionStateType = item.sessionStateType, value = item.value;\n                            if (sessionStateType === 1) {\n                                isSilent = !!Number(value);\n                            }\n                            if (sessionStateType === 2) {\n                                isTop = !!Number(value);\n                            }\n                        });\n                        var isLastInAPull = index === sessionLength - 1;\n                        callback.onStatus(type, targetId, {\n                            notificationStatus: isSilent ? RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB : RongIMLib.ConversationNotificationStatus.NOTIFY,\n                            isTop: isTop,\n                            updateTime: RongIMLib.MessageUtil.int64ToTimestamp(updateTime),\n                            isLastInAPull: isLastInAPull\n                        });\n                    });\n                    callback.onSuccess(RongIMLib.MessageUtil.int64ToTimestamp(lastTime));\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStates');\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        /**\n         * 全量订阅资源修改\n         * @param roomId 房间 Id\n         * @param message 增量数据\n         * @param valueInfo 全量资源信息\n         * @param objectName 消息名称\n         * @param callback\n         */\n        ServerDataProvider.prototype.setRTCTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            // 全量 URI 新增\n            // 全量发布中\n            // valueInfo: key 为 uris，值为 全量的订阅信息\n            // content: key 为增量数据消息 RCRTC:ModifyResource，value 为增量订阅信息\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcUserSetDataInput();\n            modules.setObjectName(objectName);\n            // content\n            var val = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            val.setKey(message.name);\n            val.setValue(message.content);\n            modules.setContent(val);\n            // valueInfo\n            val = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            val.setKey('uris');\n            val.setValue(valueInfo);\n            modules.setValueInfo(val);\n            var arrayBuff = RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer());\n            RongIMLib.RongIMClient.bridge.queryMsg(\"userSetData\", arrayBuff, roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            this.setRTCTotalRes(roomId, message, valueInfo, objectName, callback);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            this.addon.setMessageSearchField(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var result = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return result;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            // TODO\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (LoggerLevel) {\n        LoggerLevel[LoggerLevel[\"F\"] = 0] = \"F\";\n        LoggerLevel[LoggerLevel[\"E\"] = 1] = \"E\";\n        LoggerLevel[LoggerLevel[\"W\"] = 2] = \"W\";\n        LoggerLevel[LoggerLevel[\"I\"] = 3] = \"I\";\n        LoggerLevel[LoggerLevel[\"D\"] = 4] = \"D\"; //debug\n    })(RongIMLib.LoggerLevel || (RongIMLib.LoggerLevel = {}));\n    var LoggerLevel = RongIMLib.LoggerLevel;\n    (function (LoggerStoreSize) {\n        LoggerStoreSize[LoggerStoreSize[\"ADVANCED\"] = 500] = \"ADVANCED\";\n        LoggerStoreSize[LoggerStoreSize[\"LOW\"] = 500] = \"LOW\";\n    })(RongIMLib.LoggerStoreSize || (RongIMLib.LoggerStoreSize = {}));\n    var LoggerStoreSize = RongIMLib.LoggerStoreSize;\n    var LoggerType = (function () {\n        function LoggerType() {\n        }\n        LoggerType.IM = 'IM';\n        LoggerType.RTC = 'RTC';\n        return LoggerType;\n    })();\n    RongIMLib.LoggerType = LoggerType;\n    var LoggerTag = (function () {\n        function LoggerTag() {\n        }\n        /**\n         * 三段式关键字: \"发起方-任务类型-结果类型\"\n         * A: App 层，L: Lib 层，N: 调用 Native 层接口，P: Protocol 层\n         * O: 操作，S: 状态，T: 任务，R: 结果，E: 错误\n         */\n        LoggerTag.IM = {\n            A_INIT_O: 'A-init-O',\n            A_CONN_T: 'A-connect-T',\n            A_CONN_R: 'A-connect-R',\n            A_CONN_E: 'A-connect-E',\n            L_RECO_T: 'L-reconnect-T',\n            L_RECO_R: 'L-reconnect-R',\n            L_RECO_E: 'L-reconnect-E',\n            L_GETN_T: 'L-get_navi-T',\n            L_GETN_R: 'L-get_navi-R',\n            L_PING_WS_T: 'L-ping_ws-T',\n            L_PING_WS_R: 'L-ping_ws-R',\n            L_NETC_S: 'L-network_changed-S',\n            A_DISC_O: 'A-disconnect-O',\n            A_JCTR_T: 'A-join_chatroom-T',\n            A_JCTR_R: 'A-join_chatroom-R',\n            A_QCTR_T: 'A-quit_chatroom-T',\n            A_QCTR_R: 'A-quit_chatroom-R',\n            A_INIT_CMD_MSG_E: 'A-instantiate_command_message-E',\n            A_INIT_PROFILE_MSG_E: 'A-instantiate_profile_notify_message-E',\n            A_INIT_CMD_NOTI_MSG_E: 'A-instantiate_command_notify_message-E',\n            L_CHRM_PULL_E: 'L-chatroom_pull-E',\n            L_QUERY_MSG_E: 'L-query_message-E',\n            L_DECODE_MSG_E: 'L-decode_upstream_message-E',\n            L_CATCH_UNKNOWN_MSG_E: 'L-catch_unknown_message-E',\n            L_DECODE_QUERY_DATA_E: 'L-decode_query_data-E',\n            L_PARSE_MSG_E: 'L-parse_message-E',\n            L_WS_ERR_E: 'L-websocket-error-E',\n            G_CRAW_E: 'G-crash-E',\n            G_UP_LOG_S: 'G-upload_log-S',\n            G_UP_LOG_E: 'G-upload_log-E'\n        };\n        return LoggerTag;\n    })();\n    RongIMLib.LoggerTag = LoggerTag;\n    var LoggerReportType = (function () {\n        function LoggerReportType() {\n        }\n        LoggerReportType.REAL_TIME_LOG = 'RealTimeLog';\n        LoggerReportType.MSG_NOTIF_LOG = 'MessageNotificationLog';\n        return LoggerReportType;\n    })();\n    RongIMLib.LoggerReportType = LoggerReportType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Logger = (function () {\n        function Logger() {\n        }\n        Logger.writeLog = function (log) {\n            var self = this;\n            if (RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\") {\n                return;\n            }\n            var networkUnavailable = RongIMLib.RongIMClient._memoryStore.networkUnavailable;\n            var isLowLevelBro = RongIMLib.LoggerUtil.isLowLevelBro();\n            log.time = new Date().getTime();\n            log.sessionId = RongIMLib.LoggerUtil.getSessionId();\n            log.content = log.content && JSON.stringify(log.content);\n            if (networkUnavailable) {\n                if (log.level == RongIMLib.LoggerLevel.E || log.level == RongIMLib.LoggerLevel.W) {\n                    log.level = RongIMLib.LoggerLevel.I;\n                }\n            }\n            self.logStore.push(log);\n            var _handleOverflowLog = function (size) {\n                if (self.logStore.length > size) {\n                    var delLength = self.logStore.length - size;\n                    self.logStore.splice(0, delLength);\n                }\n            };\n            if (isLowLevelBro) {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.LOW);\n            }\n            else {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.ADVANCED);\n            }\n        };\n        Logger.reportRTLog = function () {\n            var self = this;\n            var isUserCloseLogger = RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\";\n            if (self.loggerCache.hasStarted || isUserCloseLogger) {\n                return;\n            }\n            self.loggerCache.hasStarted = true;\n            var policy = this.defaultLogPolicy;\n            var isDefaultUpload = true;\n            var currentTime = 1;\n            var _robustUpload = function () {\n                var isOpen = policy.logSwitch;\n                var itv = policy.itv * 1000;\n                var times = policy.times;\n                var url = policy.url;\n                var level = policy.level;\n                var realItv = itv * Math.pow(2, currentTime - 1);\n                if (currentTime < times) {\n                    currentTime++;\n                }\n                if (!isOpen) {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: level, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: url, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    if (self.loggerCache.isNewNavi) {\n                        currentTime = 1;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        self.loggerCache.isNewNavi = false;\n                    }\n                    if (isDefaultUpload) {\n                        currentTime = 1;\n                        isDefaultUpload = false;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy(); // 更新 navi 中配置下次用\n                    }\n                    if (csvLog.length == 0) {\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        _robustUpload();\n                        return;\n                    }\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: policy.timeout * 1000,\n                        success: function (data) {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log'\n                                } });\n                            //第一次成功后，如果导航有数据使用导航数据，导航无数据关闭上传。第二次上传成功后返回数据使用返回数据\n                            if (!isOpen) {\n                                return;\n                            }\n                            if (data) {\n                                data = JSON.parse(data);\n                                policy.itv = data.nextTime;\n                                policy.level = data.level;\n                                policy.logSwitch = data.logSwitch;\n                                currentTime = 1;\n                            }\n                            _robustUpload();\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, realItv);\n            };\n            _robustUpload();\n        };\n        Logger.reportMNLog = function (policy) {\n            var self = this;\n            var currentTime = 1;\n            var connectTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n            if (policy.platform !== 'Web' || policy.logId === self.loggerCache.logId) {\n                return;\n            }\n            self.loggerCache.logId = policy.logId;\n            var _robustUpload = function () {\n                var itv = 5000;\n                var times = 3;\n                itv = itv * Math.pow(2, currentTime - 2);\n                if (currentTime === 1) {\n                    itv = 0;\n                }\n                if (currentTime <= times) {\n                    currentTime++;\n                }\n                else {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: RongIMLib.LoggerLevel.D, startTime: policy.startTime, endTime: policy.endTime, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    if (csvLog.length === 0 && policy.endTime < connectTime) {\n                        //没有日志且连接时间大于日志消息结束时间，说明此日志消息过期，无需上传\n                        return;\n                    }\n                    else if (csvLog.length === 0 && policy.endTime > connectTime) {\n                        //没有日志且连接时间小于日志消息结束时间，说明用户连接时间在需要获取的时间内,没有日志上传 nodata\n                        csvLog = 'nodata';\n                    }\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: policy.uri, logId: policy.logId, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: self.defaultLogPolicy.timeout * 1000,\n                        success: function () {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log'\n                                } });\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, itv);\n            };\n            _robustUpload();\n        };\n        Logger.logStore = [];\n        Logger.defaultLogPolicy = {\n            \"logSwitch\": 1,\n            \"url\": 'logcollection.ronghub.com/',\n            \"level\": RongIMLib.LoggerLevel.E,\n            \"itv\": 20,\n            \"times\": 5,\n            \"timeout\": 15\n        };\n        Logger.loggerCache = {\n            userId: '',\n            logId: 'none',\n            isNewNavi: false,\n            hasStarted: false\n        };\n        return Logger;\n    })();\n    RongIMLib.Logger = Logger;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LoggerUtil = (function () {\n        function LoggerUtil() {\n        }\n        LoggerUtil.isLowLevelBro = function () {\n            var flag = false;\n            var bro = RongIMLib.RongUtil.getBrower();\n            if (bro.type == 'IE' && bro.version < 9) {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.isRealTimeLogType = function (type) {\n            return type === RongIMLib.LoggerReportType.REAL_TIME_LOG;\n        };\n        LoggerUtil.handleLog = function (conf) {\n            var self = this;\n            var csvLog = '';\n            var logs = RongIMLib.Logger.logStore;\n            var lastIndex = 0;\n            if (self.isRealTimeLogType(conf.type)) {\n                RongIMLib.RongUtil.forEach(logs, function (log, index) {\n                    if (log.time > self.lastTime && log.level <= conf.level) {\n                        csvLog += self.genCSVLog(log);\n                        lastIndex = index;\n                    }\n                });\n                if (csvLog.length !== 0) {\n                    self.lastTime = logs[lastIndex].time;\n                }\n            }\n            else {\n                RongIMLib.RongUtil.forEach(logs, function (log) {\n                    if (log.level <= conf.level && log.time >= conf.startTime && log.time <= conf.endTime) {\n                        csvLog += self.genCSVLog(log);\n                    }\n                });\n            }\n            return csvLog;\n        };\n        LoggerUtil.getNaviPolicy = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            var fullNavi = navi && JSON.parse(navi);\n            var policy = {};\n            var logPolicy = fullNavi.logPolicy || \"{}\";\n            var logSwitch = fullNavi.logSwitch;\n            policy = logPolicy && JSON.parse(logPolicy);\n            policy.logSwitch = logSwitch;\n            return policy;\n        };\n        LoggerUtil.genDeviceId = function () {\n            var deviceId = '';\n            var key = 'deviceId';\n            var isSupportLS = RongIMLib.RongUtil.supportLocalStorage();\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            var loggerStorage;\n            if (isSupportLS) {\n                loggerStorage = new RongIMLib.LocalStorageProvider();\n            }\n            else if (isSupportSS) {\n                loggerStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                loggerStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasDeviceId = loggerStorage.getItem(key);\n            if (hasDeviceId) {\n                deviceId = loggerStorage.getItem(key);\n            }\n            else {\n                loggerStorage.removeItem(key);\n                var uuid = RongIMLib.RongUtil.getUUID22();\n                loggerStorage.setItem(key, uuid);\n                deviceId = uuid;\n            }\n            return deviceId;\n        };\n        LoggerUtil.getSessionId = function () {\n            var sessionId = '';\n            var key = 'sessionId';\n            var sessionStorage;\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            if (isSupportSS) {\n                sessionStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                sessionStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasSessionId = sessionStorage.getItem(key);\n            if (hasSessionId) {\n                sessionId = sessionStorage.getItem(key);\n            }\n            else {\n                sessionStorage.removeItem(key);\n                var val = RongIMLib.RongUtil.getUUID22();\n                sessionStorage.setItem(key, val);\n                sessionId = val;\n            }\n            return sessionId;\n        };\n        LoggerUtil.getDeviceInfo = function () {\n            var self = this;\n            var browerInfo = RongIMLib.RongUtil.getBrower();\n            var sessionId = self.getSessionId().slice(0, 10);\n            var infoTpl = '{brower}|{version}|{sessionId}';\n            return RongIMLib.RongUtil.tplEngine(infoTpl, {\n                brower: browerInfo.type,\n                version: browerInfo.version,\n                sessionId: sessionId\n            });\n        };\n        LoggerUtil.getEntireUrl = function (opt) {\n            var self = this;\n            var tLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var mLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var entireUrl = '';\n            var protocol = \"https://\";\n            if (location.protocol == \"http:\") {\n                protocol = \"http://\";\n            }\n            var paramObj = {\n                protocol: protocol,\n                url: opt.url,\n                version: RongIMLib.RongIMClient.sdkver || 'Unknown version',\n                appkey: RongIMLib.RongIMClient._memoryStore.appKey || 'Unknown appkey',\n                deviceId: self.genDeviceId(),\n                deviceInfo: self.getDeviceInfo(),\n                platform: 'Web',\n                userId: RongIMLib.Logger.loggerCache.userId || ''\n            };\n            if (self.isRealTimeLogType(opt.type)) {\n                entireUrl = RongIMLib.RongUtil.tplEngine(tLogTpl, paramObj);\n            }\n            else {\n                entireUrl = RongIMLib.RongUtil.tplEngine(mLogTpl, RongIMLib.RongUtil.extend(paramObj, {\n                    logId: opt.logId\n                }));\n            }\n            return entireUrl;\n        };\n        LoggerUtil.genCSVLog = function (log) {\n            var tpl = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n            if (log.content) {\n                var content = '\"' + log.content.replace(/\\\"/g, '\"\"') + '\"';\n            }\n            var csvLog = RongIMLib.RongUtil.tplEngine(tpl, {\n                sessionId: log.sessionId,\n                time: log.time,\n                type: log.type,\n                level: log.level,\n                tag: log.tag,\n                content: content || '\"\"'\n            });\n            return csvLog;\n        };\n        LoggerUtil.isLogCmdMsg = function (message) {\n            var flag = false;\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"LogCommandMessage\"] && message.senderUserId === 'rongcloudsystem') {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.recordFatalLogOfNavi = function (internalRetry, navigators) {\n            if (internalRetry === 3) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                        desc: 'Request navigation failed 3 times',\n                        navigators: navigators\n                    } });\n            }\n        };\n        LoggerUtil.lastTime = 0;\n        return LoggerUtil;\n    })();\n    RongIMLib.LoggerUtil = LoggerUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var sessionStorageProvider = (function () {\n        function sessionStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n        }\n        sessionStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.setItem(composedKey, object);\n            }\n        };\n        sessionStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return sessionStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return '';\n        };\n        sessionStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        sessionStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        sessionStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.removeItem(composedKey.toString());\n            }\n        };\n        sessionStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in sessionStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        sessionStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(sessionStorage).length;\n        };\n        return sessionStorageProvider;\n    })();\n    RongIMLib.sessionStorageProvider = sessionStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback, null, {\n                                    isIgnoreReportStart: true\n                                });\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isNull = function (val) {\n            return Object.prototype.toString.call(val) == '[object Null]';\n        };\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function' || typeof XDomainRequest == 'object';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var body = opts.body;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var timeout = opts.timeout;\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            if (timeout) {\n                xhr.timeout = timeout;\n            }\n            if (body) {\n                xhr.send(body);\n                return xhr;\n            }\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.getLocalProtocol = function () {\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol === 'https:') {\n                return 'https://';\n            }\n            else {\n                return 'http://';\n            }\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getValidNavi = function (naviHost) {\n            var HttpProtocol = RongIMLib.RongIMClient.HttpProtocol;\n            var flag = '://';\n            var index = naviHost.indexOf(flag);\n            var hasProtocol = index > -1;\n            var navi = naviHost;\n            if (!hasProtocol) {\n                var protocol = RongIMLib.RongIMClient.getProtocol().protocol;\n                navi = protocol + naviHost;\n            }\n            var naviProtocol = RongUtil.getUrlProtocol(navi), localProtocol = RongUtil.getLocalProtocol();\n            // 本地为 https, 但却传入 http 时, 强制转化为 https\n            if (naviProtocol === HttpProtocol.http && localProtocol === 'https://') {\n                navi = RongUtil.formatProtoclPath({\n                    path: navi,\n                    tmpl: '{0}{1}',\n                    protocol: HttpProtocol.https,\n                    sub: true\n                });\n            }\n            return navi;\n        };\n        RongUtil.getUrlProtocol = function (url) {\n            var flag = '://';\n            var index = url.indexOf(flag);\n            if (index > -1) {\n                return url.substring(0, index + flag.length);\n            }\n            else {\n                return 'https://';\n            }\n            ;\n        };\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        RongUtil.supportSessionStorage = function () {\n            var support = false;\n            if (typeof sessionStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    sessionStorage.setItem(key, value);\n                    var localVal = sessionStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('sessionStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.isValidWsUrl = function (url) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            return invalidWsUrls.indexOf(url) === -1 && !RongUtil.isEmpty(url);\n        };\n        RongUtil.getBrower = function () {\n            var userAgent = navigator.userAgent;\n            var version;\n            var type;\n            /* 记录各浏览器名字和匹配条件 */\n            var condition = {\n                IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n                Edge: /Edge\\/([\\d.]+)/,\n                Firefox: /Firefox\\/([\\d.]+)/,\n                Opera: /(?:OPERA|OPR).([\\d.]+)/,\n                WeChat: /MicroMessenger\\/([\\d.]+)/,\n                QQBrowser: /QQBrowser\\/([\\d.]+)/,\n                Chrome: /Chrome\\/([\\d.]+)/,\n                Safari: /Version\\/([\\d.]+).*Safari/,\n                iOSChrome: /Mobile\\/([\\d.]+).*Safari/\n            };\n            for (var key in condition) {\n                if (!condition.hasOwnProperty(key))\n                    continue;\n                var browserContent;\n                if (browserContent = userAgent.match(condition[key])) {\n                    type = key;\n                    version = browserContent[1] || browserContent[2];\n                    break;\n                }\n            }\n            return {\n                type: type || 'UnKonw',\n                version: version || 'UnKonw'\n            };\n        };\n        RongUtil.string10to64 = function (number) {\n            var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''), radix = chars.length + 1, qutient = +number, arr = [];\n            do {\n                var mod = qutient % radix;\n                qutient = (qutient - mod) / radix;\n                arr.unshift(chars[mod]);\n            } while (qutient);\n            return arr.join('');\n        };\n        RongUtil.getUUID = function () {\n            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n                var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n                return v.toString(16);\n            });\n        };\n        /* 获取 22 位的 UUID */\n        RongUtil.getUUID22 = function () {\n            var uuid = this.getUUID();\n            uuid = uuid.replace(/-/g, '') + 'a';\n            uuid = parseInt(uuid, 16);\n            uuid = this.string10to64(uuid);\n            if (uuid.length > 22) {\n                uuid = uuid.slice(0, 22);\n            }\n            if (uuid.length < 22) {\n                var len = 22 - uuid.length;\n                for (var i = 0; i < len; i++) {\n                    uuid = uuid + '0';\n                }\n            }\n            return uuid;\n        };\n        RongUtil.getByteLength = function (str, charset) {\n            charset = charset || 'utf-8';\n            var total = 0, chatCode;\n            if (charset === 'utf-16') {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode <= 0xffff) {\n                        total += 2;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            else {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode < 0x007f) {\n                        total += 1;\n                    }\n                    else if (chatCode <= 0x07ff) {\n                        total += 2;\n                    }\n                    else if (chatCode <= 0xffff) {\n                        total += 3;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            return total;\n        };\n        RongUtil.concat = function (before, after, isDedup) {\n            RongUtil.forEach(after, function (item) {\n                if (!isDedup || RongUtil.indexOf(before, item) === -1) {\n                    before.push(item);\n                }\n            });\n            return before;\n        };\n        RongUtil.getCurrentDate = function (seperator) {\n            var date = new Date();\n            var year = date.getFullYear();\n            var month = date.getMonth() + 1;\n            var day = date.getDate();\n            return RongUtil.tplEngine('{year}{seperator}{month}{seperator}{day}', {\n                year: year,\n                month: month,\n                day: day,\n                seperator: seperator\n            });\n        };\n        RongUtil.generateUploadFileName = function (type, fileName) {\n            var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n            var random = Math.floor((Math.random() * 1000) % 10000);\n            var uuid = this.getUUID();\n            var fileNameArr, extension;\n            if (fileName) {\n                fileNameArr = fileName.split('.');\n                extension = '.' + fileNameArr[fileNameArr.length - 1];\n            }\n            return RongUtil.tplEngine(tpl, {\n                type: type,\n                date: RongUtil.getCurrentDate('-'),\n                random: random,\n                uuid: uuid,\n                timestamp: RongUtil.getTimestamp(),\n                extension: extension || ''\n            });\n        };\n        RongUtil.Prosumer = Prosumer;\n        RongUtil.Storage = {\n            set: function (key, value) {\n                try {\n                    RongIMLib.RongIMClient._storageProvider.setItem(key, JSON.stringify(value));\n                }\n                catch (e) { }\n            },\n            get: function (key) {\n                var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n                try {\n                    return JSON.parse(value);\n                }\n                catch (e) {\n                    return {};\n                }\n            }\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n    var Base64 = (function () {\n        function Base64() {\n        }\n        Base64.utf8_encode = function (string) {\n            string = string.replace(/\\r\\n/g, \"\\n\");\n            var utftext = \"\";\n            for (var n = 0; n < string.length; n++) {\n                var c = string.charCodeAt(n);\n                if (c < 128) {\n                    utftext += String.fromCharCode(c);\n                }\n                else if ((c > 127) && (c < 2048)) {\n                    utftext += String.fromCharCode((c >> 6) | 192);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n                else {\n                    utftext += String.fromCharCode((c >> 12) | 224);\n                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n            }\n            return utftext;\n        };\n        Base64.utf8_decode = function (utftext) {\n            var string = \"\";\n            var i = 0;\n            var c = 0, c1 = 0, c2 = 0, c3;\n            while (i < utftext.length) {\n                c = utftext.charCodeAt(i);\n                if (c < 128) {\n                    string += String.fromCharCode(c);\n                    i++;\n                }\n                else if ((c > 191) && (c < 224)) {\n                    c2 = utftext.charCodeAt(i + 1);\n                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n                    i += 2;\n                }\n                else {\n                    c2 = utftext.charCodeAt(i + 1);\n                    c3 = utftext.charCodeAt(i + 2);\n                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n                    i += 3;\n                }\n            }\n            return string;\n        };\n        Base64.encode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = this.utf8_encode(input);\n            while (i < input.length) {\n                chr1 = input.charCodeAt(i++);\n                chr2 = input.charCodeAt(i++);\n                chr3 = input.charCodeAt(i++);\n                enc1 = chr1 >> 2;\n                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n                enc4 = chr3 & 63;\n                if (isNaN(chr2)) {\n                    enc3 = enc4 = 64;\n                }\n                else if (isNaN(chr3)) {\n                    enc4 = 64;\n                }\n                output = output +\n                    this.keyStr.charAt(enc1) + this.keyStr.charAt(enc2) +\n                    this.keyStr.charAt(enc3) + this.keyStr.charAt(enc4);\n            }\n            return output;\n        };\n        Base64.decode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3;\n            var enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n            while (i < input.length) {\n                enc1 = this.keyStr.indexOf(input.charAt(i++));\n                enc2 = this.keyStr.indexOf(input.charAt(i++));\n                enc3 = this.keyStr.indexOf(input.charAt(i++));\n                enc4 = this.keyStr.indexOf(input.charAt(i++));\n                chr1 = (enc1 << 2) | (enc2 >> 4);\n                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n                chr3 = ((enc3 & 3) << 6) | enc4;\n                output = output + String.fromCharCode(chr1);\n                if (enc3 != 64) {\n                    output = output + String.fromCharCode(chr2);\n                }\n                if (enc4 != 64) {\n                    output = output + String.fromCharCode(chr3);\n                }\n            }\n            output = this.utf8_decode(output);\n            return output;\n        };\n        Base64.keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n        return Base64;\n    })();\n    RongIMLib.Base64 = Base64;\n    var TextCompressor = (function () {\n        function TextCompressor() {\n        }\n        TextCompressor.compress = function (data) {\n            var self = this;\n            var map = {};\n            //构建一个用于反向查询字符位置的 map\n            for (var p = 0; p < data.length - 1; p++) {\n                var c1 = data.charAt(p);\n                var c2 = data.charAt(p + 1);\n                var c = c1 + c2;\n                if (!map.hasOwnProperty(c)) {\n                    map[c] = [p];\n                    continue;\n                }\n                map[c].push(p);\n            }\n            var compressedData = [], normalBlockBuffer = [];\n            //编码未压缩数据块\n            var encodeNormalBlock = function () {\n                if (normalBlockBuffer.length > 0) {\n                    var normalBlock = normalBlockBuffer.join('');\n                    normalBlockBuffer = [];\n                    if (normalBlock.length > 26) {\n                        var normalExtBlockLength = self.numberEncode(normalBlock.length);\n                        var normalExtBlockHeader = String.fromCharCode(self.dataType.NormalExt | normalExtBlockLength.length);\n                        compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n                    }\n                    else {\n                        var normalBlockHeader = String.fromCharCode(self.dataType.Normal | normalBlock.length);\n                        compressedData.push(normalBlockHeader);\n                    }\n                    compressedData.push(normalBlock);\n                }\n            };\n            var i = 0;\n            while (i < data.length) {\n                var r = self.indexOf(map, data, i);\n                if (r.length < 2) {\n                    normalBlockBuffer.push(data.charAt(i++));\n                    continue;\n                }\n                if (r.length < 4) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                var offset = self.numberEncode(i - r.offset);\n                var length = self.numberEncode(r.length);\n                //欲压缩的数据与数据编码后的长度一致，则不进行压缩\n                if (offset.length + length.length >= r.length) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                //编码未压缩数据块\n                encodeNormalBlock();\n                //编码压缩数据块\n                var compressedBlockHeader = String.fromCharCode(self.dataType.Compressed | (offset.length << 2) | length.length);\n                compressedData.push(compressedBlockHeader + offset + length);\n                i += r.length;\n            }\n            //编码剩余未压缩数据块\n            encodeNormalBlock();\n            //在数据尾部添加校验和\n            var dataLengthTo62 = self.numberEncode(data.length);\n            var tailBlockHeader = String.fromCharCode(self.dataType.Tail | dataLengthTo62.length);\n            compressedData.push(tailBlockHeader + dataLengthTo62);\n            return compressedData.join('');\n        };\n        TextCompressor.uncompress = function (data) {\n            var self = this;\n            var i = 0;\n            var result = \"\";\n            label1: do {\n                var header = data.charCodeAt(i++);\n                var headerType = header & self.dataType.Mark;\n                var headerVal = header & 0xF;\n                switch (headerType) {\n                    case self.dataType.Compressed:\n                        var p1 = headerVal >> 2;\n                        var p2 = headerVal & 3;\n                        if (p1 == 0 || p2 == 0) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        var offset = self.numberDecode(data.substr(i, p1));\n                        var len = self.numberDecode(data.substr(i += p1, p2));\n                        offset = result.length - offset;\n                        if (offset + len > result.length) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += p2;\n                        result += result.substr(offset, len);\n                        break;\n                    case self.dataType.Tail:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        if (num != result.length) {\n                            console.log(result.length);\n                            console.log(num);\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += headerVal;\n                        break label1;\n                    case self.dataType.NormalExt:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        result += data.substr(i += headerVal, num);\n                        i += num;\n                        break;\n                    case self.dataType.Normal:\n                        result += data.substr(i, headerVal);\n                        i += headerVal;\n                        break;\n                    case self.dataType.Mark:\n                        if (headerVal > 10) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        result += data.substr(i, 16 + headerVal);\n                        i += (16 + headerVal);\n                        break;\n                    default:\n                        throw new Error(\"Data parsing error,at \" + i + \" header:\" + headerType);\n                }\n            } while (i < data.length);\n            return result;\n        };\n        TextCompressor.indexOf = function (map, source, fromIndex) {\n            var self = this;\n            var result = {\n                length: 0,\n                offset: -1\n            };\n            var sourceLength = source.length;\n            if (fromIndex >= source.length - 1) {\n                return result;\n            }\n            var c1 = source.charAt(fromIndex);\n            var c2 = source.charAt(fromIndex + 1);\n            var items = map[c1 + c2];\n            if (items[0] == fromIndex) {\n                return result;\n            }\n            var space1 = source.length - fromIndex;\n            var lastChar;\n            for (var i = 0, len = items.length; i < len; i++) {\n                var item = items[i];\n                var space2 = fromIndex - item;\n                if (space2 > self.max) {\n                    continue;\n                }\n                var end = Math.min(space1, space2);\n                if (end <= result.length) {\n                    break;\n                }\n                if (result.length > 2) {\n                    if (source.charAt(item + result.length - 1) != source.charAt(fromIndex + result.length - 1)) {\n                        continue;\n                    }\n                }\n                var m = 2;\n                for (var j = m; j < end; j++) {\n                    if (source.charAt(item + j) == source.charAt(fromIndex + j)) {\n                        m++;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                if (m >= result.length) {\n                    result.length = m;\n                    result.offset = item;\n                }\n            }\n            return result;\n        };\n        /*\n        * 将数字转化为 62 进制字符串。\n        */\n        TextCompressor.numberEncode = function (num) {\n            var self = this;\n            var result = [], remainder = 0;\n            do {\n                remainder = num % self.scale;\n                result.push(self.chars.charAt(remainder));\n                num = (num - remainder) / self.scale;\n            } while (num > 0);\n            return result.join('');\n        };\n        /*\n        * 将 62 进制字符串还原为数字。\n        */\n        TextCompressor.numberDecode = function (str) {\n            var self = this;\n            var num = 0, index = 0;\n            for (var i = str.length - 1; i >= 0; i--) {\n                index = self.chars.indexOf(str.charAt(i));\n                if (index == -1) {\n                    throw new Error(\"decode number error, data is \\\"\" + str + \"\\\"\");\n                }\n                num = num * self.scale + index;\n            }\n            return num;\n        };\n        TextCompressor.dataType = {\n            Tail: 0x30,\n            Compressed: 0x40,\n            NormalExt: 0x50,\n            Normal: 0x60,\n            Mark: 0x70\n        };\n        TextCompressor.chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n        TextCompressor.scale = TextCompressor.chars.length;\n        TextCompressor.max = 238327;\n        return TextCompressor;\n    })();\n    RongIMLib.TextCompressor = TextCompressor;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat    \n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib-2.5.9-silent.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n    Release Date: Mon Jul 06 2020 10:14:50 GMT+0800 (China Standard Time)\n    CodeVersion: 88160473e1cc2f0ef6ab3ca5954447d815cb8f51\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nconsole.warn('SDK VERSION:', '88160473e1cc2f0ef6ab3ca5954447d815cb8f51')\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 1] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 2] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * JSON 后的消息体超限, 目前最大 128kb\n         * */\n        ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            RongIMClient.settingListeners = [];\n            RongIMClient.conversationStatusListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.8.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                isFullConversations: false,\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {},\n                networkUnavailable: false,\n                loggerSwitch: options.loggerSwitch || 'on',\n                autoReconnectTimer: null // 自动重连定时器编号\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ReferenceMessage: { objectName: \"RC:ReferenceMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GIFMessage: { objectName: \"RC:GIFMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                SightMessage: { objectName: \"RC:SightMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                LogCommandMessage: { objectName: 'RC:LogCmdMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                ReferenceMessage: \"ReferenceMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                GIFMessage: 'GIFMessage',\n                SightMessage: 'SightMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage',\n                LogCommandMessage: 'LogCommandMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    appKey: appKey\n                } });\n            return sdkInfo;\n        };\n        ;\n        RongIMClient.setProtocol = function (protocol) {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var HttpProtocol = RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMClient.WsProtocol;\n            if (protocol === HttpProtocol.http) {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.http;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.ws;\n            }\n            else {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.https;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.wss;\n            }\n        };\n        RongIMClient.getProtocol = function () {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var depend = RongIMClient._memoryStore.depend;\n            var protocol = depend.protocol, wsScheme = depend.wsScheme;\n            if (!protocol || !wsScheme) {\n                protocol = RongIMClient.HttpProtocol.https;\n                wsScheme = RongIMClient.WsProtocol.wss;\n            }\n            return {\n                protocol: protocol,\n                wsScheme: wsScheme\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            if (RongIMLib.IMHandler.isIncludeNavi(token)) {\n                var protocol = RongIMClient._memoryStore.depend.protocol;\n                var currentNavs = RongIMClient._memoryStore.depend.navigaters;\n                var navList = RongIMLib.IMHandler.getNavsByToken(token, protocol);\n                token = RongIMLib.IMHandler.getToken(token);\n                RongIMClient._memoryStore.depend.navigaters = RongIMLib.RongUtil.concat(navList, currentNavs, true);\n            }\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.setConversationStatusListener = function (listener) {\n            if (listener && listener.onChanged && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.conversationStatusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        RongIMClient.watch = function (watchers) {\n            watchers = watchers || {};\n            var setting = watchers.setting;\n            if (RongIMLib.RongUtil.isFunction(setting)) {\n                RongIMClient.settingListeners.push(setting);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_DISC_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM });\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback, version) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback, version);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global|boolean\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            RongIMClient._dataAccessProvider.setConversationStatus(type, targetId, statusItem, callback);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback, params);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageSearchField(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    if (tempConver.msg) {\n                        conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                        conver.latestMessageId = conver.latestMessage.messageId;\n                        conver.objectName = conver.latestMessage.objectName;\n                        conver.receivedStatus = conver.latestMessage.receivedStatus;\n                        conver.receivedTime = conver.latestMessage.receiveTime;\n                        conver.sentStatus = conver.latestMessage.sentStatus;\n                        conver.sentTime = conver.latestMessage.sentTime;\n                    }\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    var status = RongIMClient._dataAccessProvider.conversationStatusManager.get(tempConver.type, tempConver.userId);\n                    conver.notificationStatus = status.notificationStatus;\n                    conver.isTop = status.isTop;\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback, fileName) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\", \"undefined|null|string\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"), fileName);\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\", \"undefined|null|object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"), data);\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.HttpProtocol = {\n            http: 'http://',\n            https: 'https://'\n        };\n        RongIMClient.WsProtocol = {\n            ws: 'ws://',\n            wss: 'wss://'\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.MaxMessageContentBytes = 131072; // 128kb\n        RongIMClient.NavMarkInToken = '@';\n        RongIMClient.NavSeparatorInToken = ';';\n        RongIMClient.NavExpiredTime = 7200000; // 2 小时\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.8.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.settingListeners = [];\n        RongIMClient.conversationStatusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    RongIMLib.StatusTopic = (function () {\n        var ConversationType = RongIMLib.ConversationType;\n        var topic = {};\n        topic[ConversationType.PRIVATE] = 'ppMsgS';\n        topic[ConversationType.GROUP] = 'pgMsgS';\n        return topic;\n    })();\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var customCmpUrl = depend.cmpUrl;\n            if (RongIMLib.RongUtil.isValidWsUrl(customCmpUrl)) {\n                servers = [customCmpUrl];\n            }\n            else {\n                servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                        url: url\n                                    } });\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                            url: url,\n                                            code: code\n                                        } });\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    url: server\n                                } });\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                                desc: 'all websocket addresses are unavailable',\n                                cmp: servers,\n                                ConnectionStatus: RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE,\n                                available: false\n                            } });\n                        clearHandler();\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        var storeServers = storage.getItem('servers');\n                        try {\n                            storeServers = JSON.parse(storeServers);\n                            !RongIMLib.RongUtil.getValidWsUrlList(storeServers).length && RongIMLib.Navigation.clear();\n                        }\n                        catch (e) { }\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    me.connectionStatus = code;\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                    var unReportCodes = [RongIMLib.ConnectionStatus.CONNECTING, RongIMLib.ConnectionStatus.REQUEST_NAVI, RongIMLib.ConnectionStatus.RESPONSE_NAVI];\n                    var isReportCode = RongIMLib.RongUtil.indexOf(unReportCodes, code) === -1;\n                    if (isReportCode) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_NETC_S, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                ConnectionStatus: code,\n                                available: false\n                            } });\n                    }\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    if (RongIMLib.RongUtil.getValidWsUrlList(servers).length) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", RongIMLib.Transportations._TransportType);\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                    else {\n                        me.changeConnectType();\n                        RongIMLib.RongIMClient.isFirstConnect = false;\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg, option) {\n            option = option || {};\n            var isNoAck = option.isNoAck;\n            var hasCallback = !!_callback;\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (isNoAck) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                _callback.onSuccess(msg);\n            }\n            else if (hasCallback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    var errorMsg = \"syncTime:Received messages of chatroom but was not init\";\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CHRM_PULL_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            msg: errorMsg\n                        } });\n                    throw new Error(errorMsg);\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_QUERY_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'invoke -> queryMessage',\n                            error: error\n                        } });\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                    if (status == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE) {\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = true;\n                    }\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType, params) {\n            params = params || {};\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                var isStatusMessage = params.isStatus;\n                var statusTopic = RongIMLib.StatusTopic[topic];\n                if (isStatusMessage && statusTopic) {\n                    Bridge._client.publishMessage(statusTopic, content, targetId, callback, msg, {\n                        isNoAck: true\n                    });\n                }\n                else {\n                    Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg); // 非状态消息, 逻辑不变\n                }\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'NotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                if (data.type === 2) {\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n                else if (data.type === 3) {\n                    RongIMLib.RongIMClient._dataAccessProvider.conversationStatusManager.pull({\n                        time: timestamp\n                    });\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            if (!msg) {\n                return;\n            }\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    try {\n                        entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    }\n                    catch (e) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { stack: e, msg: 'MessageHandler -> onReceived' } });\n                        return;\n                    }\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                var receivedTime = new Date().getTime();\n                con.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.isTop = false;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            if (RongIMLib.LoggerUtil.isLogCmdMsg(message)) {\n                RongIMLib.Logger.reportMNLog(message.content);\n                return;\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content;\n                if (RongIMLib.RongUtil.isUndefined(receiptResponseMsg) || RongIMLib.RongUtil.isNull(receiptResponseMsg)) {\n                    receiptResponseMsg = new RongIMLib.ReadReceiptResponseMessage({});\n                }\n                var receiptMessageDic = receiptResponseMsg.receiptMessageDic || {}, uIds = receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                try {\n                    that._onReceived(message, count, hasMore);\n                }\n                catch (e) {\n                    console.error(e);\n                }\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            if (msg && RongIMLib.RongUtil.isObject(msg) && msg.timestamp) {\n                RongIMLib.MessageUtil.setDeltaTime(msg.timestamp);\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CATCH_UNKNOWN_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'MessageHandler -> handleMessage',\n                            msg: msg\n                        } });\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token,\n                        bosToken: entity.bosToken,\n                        bosDate: entity.bosDate,\n                        path: entity.path\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_QUERY_DATA_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            stack: e,\n                            msg: 'QueryCallback -> process'\n                        } });\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                RongIMLib.MessageUtil.setDeltaTime(timestamp);\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result, naviUrl) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var successNaviProtocol = RongIMLib.RongUtil.getUrlProtocol(naviUrl);\n            // navi 请求成功后, 根据 navi 协议头, 设置连接 websocket 协议头\n            RongIMLib.RongIMClient.setProtocol(successNaviProtocol);\n            storage.setItem(Navigation.StoreProtocolKey, successNaviProtocol);\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            storage.setItem('navi_time', RongIMLib.RongUtil.getTimestamp());\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            var uploadDomains = {\n                qiniu: result.uploadServer || '',\n                bos: result.bosAddr || ''\n            };\n            storage.setItem('upload_domains', JSON.stringify(uploadDomains));\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                var currentTime = RongIMLib.RongUtil.getTimestamp();\n                var naviSavedTime = Number(storage.getItem('navi_time')) || 0;\n                var isNotExpired = currentTime - naviSavedTime < RongIMLib.RongIMClient.NavExpiredTime;\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers) && isNotExpired) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    var storageProtocol = storage.getItem(Navigation.StoreProtocolKey);\n                    storageProtocol && RongIMLib.RongIMClient.setProtocol(storageProtocol);\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                navi = RongIMLib.RongUtil.getValidNavi(navi);\n                indexTools.add();\n                RongIMLib.LoggerUtil.recordFatalLogOfNavi(internalRetry, navigaters);\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result, navi);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n            RongIMLib.Logger.loggerCache.isNewNavi = true;\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            var requestType = \"HTTP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    result = JSON.parse(result);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                            code: 0,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                    success(result);\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            code: status,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            var requestType = \"JSONP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            var loggerResult = function (status, result) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        code: status,\n                        result: result,\n                        url: url,\n                        requestType: requestType\n                    } });\n            };\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                loggerResult(code, result);\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                loggerResult(RongIMLib.ConnectionState.TOKEN_INCORRECT, {});\n            };\n        };\n        Navigation.StoreProtocolKey = 'navprotocol';\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                try {\n                    this.pool = this.pool.concat(b);\n                }\n                catch (e) {\n                    [].push.apply(this.pool, b);\n                }\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (!me.connectedTime || (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime)) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_WS_ERR_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                    error: RongIMLib.ConnectionStatus.WEBSOCKET_ERROR,\n                    msg: 'SocketTransportation -> onError'\n                } });\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:ReferenceMsg\": \"ReferenceMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:GIFMsg\": \"GIFMessage\",\n    \"RC:SightMsg\": \"SightMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\",\n    \"RC:LogCmdMsg\": \"LogCommandMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    // 业务层公共方法处理\n    var IMHandler = (function () {\n        function IMHandler() {\n        }\n        IMHandler.isIncludeNavi = function (token) {\n            var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n            var hasNavMark = navMarkIndex !== -1;\n            return hasNavMark;\n        };\n        IMHandler.getToken = function (token) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                token = token.substring(0, navMarkIndex + 1);\n            }\n            return token;\n        };\n        IMHandler.getNavsByToken = function (token, protocol) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            var navUrlList = [];\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                var navsText = token.substring(navMarkIndex + 1, token.length);\n                var navDomains = navsText.split(RongIMLib.RongIMClient.NavSeparatorInToken);\n                RongIMLib.RongUtil.forEach(navDomains, function (domain) {\n                    if (RongIMLib.RongUtil.isEmpty(domain)) {\n                        return;\n                    }\n                    var navUrl = RongIMLib.RongUtil.formatProtoclPath({\n                        path: domain, protocol: protocol, sub: true\n                    });\n                    navUrlList.push(navUrl);\n                });\n            }\n            return navUrlList;\n        };\n        IMHandler.getConversationKey = function (type, id) {\n            return type + '_' + id;\n        };\n        return IMHandler;\n    })();\n    RongIMLib.IMHandler = IMHandler;\n    ;\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        // 下行消息状态位判断, 第 9 位为 disableNotification 开关（ 上行为第 5 位 ）\n        MessageUtil.isDisableNotification = function (status) {\n            return Boolean(status & 0x100);\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PARSE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: ex,\n                        msg: 'MessageUtil -> messageParser'\n                    } });\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            var receivedTime = new Date().getTime();\n            message.messageUId = entity.msgId;\n            message.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            try {\n                var status = MessageUtil.int64ToTimestamp(entity.status);\n                message.disableNotification = MessageUtil.isDisableNotification(status);\n            }\n            catch (error) {\n                message.disableNotification = false;\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        MessageUtil.setDeltaTime = function (serverTime) {\n            try {\n                RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - serverTime;\n            }\n            catch (e) { }\n        };\n        MessageUtil.getDeltaTime = function () {\n            var _memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            return _memoryStore.deltaTime || 0;\n        };\n        MessageUtil.getCheckedTime = function (time) {\n            var deltaTime = MessageUtil.getDeltaTime();\n            return time - deltaTime;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n    var ConversationStatusStoreUserKey = '{appkey}{userId}constas';\n    var ConversationStatusPullTimeStoreKey = 'time';\n    var ConversationStatusManager = (function () {\n        function ConversationStatusManager(option) {\n            this.updatedStatus = []; // 更新的会话状态\n            this.statusShangeObserver = new RongIMLib.Observer();\n            this.pullProsumer = new RongIMLib.RongUtil.Prosumer();\n            var appkey = option.appkey, userId = option.userId;\n            this.option = option;\n            this.storageKey = RongIMLib.RongUtil.tplEngine(ConversationStatusStoreUserKey, {\n                appkey: appkey, userId: userId\n            });\n        }\n        ConversationStatusManager.prototype._formatUpdatedStatus = function (status, type, targetId) {\n            var updatedStatus = {\n                conversationType: type,\n                targetId: targetId\n            };\n            delete status.isLastInAPull;\n            return RongIMLib.RongUtil.extend(updatedStatus, status);\n        };\n        ConversationStatusManager.prototype.watchChanged = function (event) {\n            this.statusShangeObserver.add(event);\n        };\n        ConversationStatusManager.prototype.set = function (type, targetId, status) {\n            var currentStatus = this.get(type, targetId);\n            var updateTime = status.updateTime, isLastInAPull = status.isLastInAPull;\n            if (updateTime >= currentStatus.updateTime) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n                var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n                var storeStatus = allStatus[conversationStoreKey] || {};\n                RongIMLib.RongUtil.forEach(status, function (val, key) {\n                    if (!RongIMLib.RongUtil.isUndefined(val)) {\n                        storeStatus[key] = val;\n                    }\n                });\n                allStatus[conversationStoreKey] = storeStatus;\n                RongIMLib.RongUtil.Storage.set(this.storageKey, allStatus);\n                var updatedStatusItem = this._formatUpdatedStatus(status, type, targetId);\n                this.updatedStatus.push(updatedStatusItem);\n                RongIMLib.RongIMClient.getInstance().pottingConversation({\n                    type: type,\n                    userId: targetId\n                });\n            }\n            isLastInAPull && this.statusShangeObserver.emit(this.updatedStatus);\n            this.updatedStatus = [];\n        };\n        ConversationStatusManager.prototype.get = function (type, targetId) {\n            var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n            var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n            var status = allStatus[conversationStoreKey] || {};\n            var notificationStatus = status.notificationStatus, isTop = status.isTop, updateTime = status.updateTime;\n            return {\n                notificationStatus: notificationStatus || RongIMLib.ConversationNotificationStatus.NOTIFY,\n                isTop: isTop || false,\n                updateTime: updateTime || 0\n            };\n        };\n        ConversationStatusManager.prototype.pull = function (option) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭会话状态设置\n            option = option || {};\n            var self = this;\n            var _a = this, server = _a.option.server, pullProsumer = _a.pullProsumer, storageKey = _a.storageKey;\n            pullProsumer.produce(option);\n            pullProsumer.consume(function (params, next) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                var lastUpdateTime = allStatus[ConversationStatusPullTimeStoreKey] || 0;\n                var updateTime = params.time, isForce = params.isForce;\n                if (lastUpdateTime > updateTime && !isForce) {\n                    return next();\n                }\n                server.pullConversationStatus(lastUpdateTime, {\n                    onStatus: function (type, id, conversationStatus) {\n                        self.set(type, id, conversationStatus);\n                    },\n                    onSuccess: function (updateTime) {\n                        var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                        allStatus[ConversationStatusPullTimeStoreKey] = updateTime; // 更新拉取时间戳\n                        RongIMLib.RongUtil.Storage.set(self.storageKey, allStatus);\n                        next();\n                    },\n                    onError: next\n                });\n            });\n        };\n        return ConversationStatusManager;\n    })();\n    RongIMLib.ConversationStatusManager = ConversationStatusManager;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_PROFILE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_NOTI_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            message.burnDuration && (this.burnDuration = message.burnDuration);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n    var LogCommandMessage = (function () {\n        function LogCommandMessage(message) {\n            this.messageName = \"LogCommandMessage\";\n            message.uri && (this.uri = message.uri);\n            message.logId && (this.logId = message.logId);\n            message.platform && (this.platform = message.platform);\n            message.packageName && (this.packageName = message.packageName);\n            message.startTime && (this.startTime = message.startTime);\n            message.endTime && (this.endTime = message.endTime);\n            message.user && (this.user = message.user);\n        }\n        LogCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LogCommandMessage;\n    })();\n    RongIMLib.LogCommandMessage = LogCommandMessage;\n    var ReferenceMessage = (function () {\n        function ReferenceMessage(message) {\n            this.messageName = \"ReferenceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.content = message.content;\n            this.referMsgUserId = message.referMsgUserId;\n            this.referMsg = message.referMsg;\n            this.objName = message.objName;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ReferenceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReferenceMessage;\n    })();\n    RongIMLib.ReferenceMessage = ReferenceMessage;\n    var GIFMessage = (function () {\n        function GIFMessage(message) {\n            this.messageName = \"GIFMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.gifDataSize = message.gifDataSize;\n            this.localPath = message.localPath;\n            this.remoteUrl = message.remoteUrl;\n            this.width = message.width;\n            this.height = message.height;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        GIFMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GIFMessage;\n    })();\n    RongIMLib.GIFMessage = GIFMessage;\n    var SightMessage = (function () {\n        function SightMessage(message) {\n            this.messageName = \"SightMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.sightUrl = message.sightUrl;\n            this.content = message.content;\n            this.duration = message.duration;\n            this.size = message.size;\n            this.name = message.name;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        SightMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SightMessage;\n    })();\n    RongIMLib.SightMessage = SightMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse, disableNotification) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n            this.disableNotification = disableNotification;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            var self = this;\n            RongIMLib.Logger.reportRTLog();\n            option = option || {};\n            var isReconnect = option.isReconnect;\n            var isIgnoreReportStart = option.isIgnoreReportStart;\n            var StartReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_T : RongIMLib.LoggerTag.IM.A_CONN_T;\n            var EndReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_R : RongIMLib.LoggerTag.IM.A_CONN_R;\n            !isIgnoreReportStart && RongIMLib.Logger.writeLog({ tag: StartReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { \"token\": token } });\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = false;\n                        RongIMLib.Logger.loggerCache.userId = data;\n                        RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { desc: 'connection succeeded' } });\n                        self.conversationStatusManager = new RongIMLib.ConversationStatusManager({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data,\n                            server: self\n                        });\n                        self.conversationStatusManager.watchChanged(function (status) {\n                            RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.conversationStatusListeners, function (event) {\n                                event(status);\n                            });\n                        });\n                        self.conversationStatusManager.pull({\n                            isForce: true\n                        });\n                    });\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var fullnavi = storage.getItem('fullnavi') || '{}';\n                    try {\n                        fullnavi = JSON.parse(fullnavi);\n                    }\n                    catch (e) {\n                        fullnavi = {};\n                    }\n                    var isAutoPull = fullnavi.openUS;\n                    isAutoPull && self.getVoipInfo({\n                        onSuccess: function (VoipInfo) {\n                            try {\n                                VoipInfo && RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.settingListeners, function (listener) {\n                                    listener({ VoipInfo: VoipInfo }); // 与 3.x 保持一致, 方便后续 3.x 兼容\n                                });\n                                if (VoipInfo) {\n                                    var fullnavi_1 = storage.getItem('fullnavi') || '{}';\n                                    fullnavi_1 = JSON.parse(fullnavi_1);\n                                    fullnavi_1.voipCallInfo = VoipInfo;\n                                    storage.setItem('fullnavi', JSON.stringify(fullnavi_1));\n                                }\n                            }\n                            catch (e) {\n                            }\n                        },\n                        onError: function () {\n                            // do nothing\n                        }\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { ConnectionState: RongIMLib.ConnectionState.TOKEN_INCORRECT } });\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { code: e } });\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                var timer = setTimeout(ping, next);\n                                RongIMLib.RongIMClient._memoryStore.autoReconnectTimer = timer;\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback, null, {\n                                    isIgnoreReportStart: true,\n                                    isReconnect: true\n                                });\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback, null, {\n                            isIgnoreReportStart: true,\n                            isReconnect: true\n                        });\n                    }\n                };\n                handler[key]();\n            }\n            else {\n                var _client = RongIMLib.Bridge._client || {};\n                var _channel = _client.channel || {};\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_RECO_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        msg: {\n                            connectionStatus: _channel.connectionStatus\n                        },\n                        action: 'reconnect'\n                    } });\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            var timer = RongIMLib.RongIMClient._memoryStore.autoReconnectTimer;\n            timer && clearTimeout(timer);\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            params = params || {};\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2, params);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId\n                                        } });\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId,\n                                            error: errorCode\n                                        } });\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    chatroomId: chatroomId\n                                } });\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: error\n                            } });\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId\n                            } });\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: errcode\n                            } });\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback, fileName) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var fileName = RongIMLib.RongUtil.generateUploadFileName(fileType, fileName);\n            // 获取上传地址\n            var domains = RongIMLib.RongIMClient._storageProvider.getItem('upload_domains') || '{}';\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (res) {\n                    setTimeout(function () {\n                        var data = RongIMLib.RongUtil.extend(JSON.parse(domains), res);\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            var data = data || {};\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            if (data.isBosRes) {\n                callback.onSuccess(data);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getVoipInfo = function (callback) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭实时配置，IE 现不支持音视频\n            // 获取最新值\n            return this.getPullSetting({\n                onSuccess: function (result) {\n                    result = result || {};\n                    var items = result.items || [];\n                    var voipInfo = null;\n                    for (var i = 0, max = items.length; i < max; i++) {\n                        var item = items[i];\n                        if (item.key === 'VoipInfo') {\n                            var value = item.value;\n                            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayForm(value.buffer).slice(value.offset, value.limit) : value);\n                            }\n                            else {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayFormInput(value.buffer).subarray(value.offset, value.limit) : value);\n                            }\n                            voipInfo = value;\n                        }\n                    }\n                    callback.onSuccess(voipInfo);\n                },\n                onError: callback.onError\n            }, 0);\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback, version) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            version = version || parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            var sessionId;\n            if (mentiondMsg && isGroup) {\n                sessionId = 7;\n                params.disableNotification && (sessionId = sessionId | 0x10);\n                modules.setSessionId(sessionId);\n            }\n            else {\n                sessionId = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag();\n                params.disableNotification && (sessionId = sessionId | 0x10);\n                modules.setSessionId(sessionId);\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            var encodedContent = messageContent.encode();\n            if (RongIMLib.RongUtil.getByteLength(encodedContent) > RongIMLib.RongIMClient.MaxMessageContentBytes) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);\n                });\n                return;\n            }\n            modules.setContent(encodedContent);\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            msg.disableNotification = params.disableNotification || false;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType, params);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        /**\n         * 向缓存会话列表内添加新会话或更新会话\n        */\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        /**\n         * 更新缓存会话字段\n        */\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        /**\n         * 移除 IM Server 端会话,并清除缓存内会话\n        */\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!RongIMLib.RongUtil.isNumber(count)) {\n                count = 200;\n            }\n            var isLocalInclude = list.length >= count;\n            if (!isSync && (isLocalInclude || RongIMLib.RongIMClient._memoryStore.isFullConversations)) {\n                setTimeout(function () {\n                    var _list = JSON.parse(JSON.stringify(list));\n                    var localList = _list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    var isFullConversations = count > list.length;\n                    RongIMLib.RongIMClient._memoryStore.isFullConversations = isFullConversations;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            var self = this;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionStateModifyReq();\n            var userId = RongIMLib.Bridge._client.userId;\n            var time = +new Date();\n            var stateItemModules = [];\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.notificationStatus)) {\n                var isNotDisturbe = statusItem.notificationStatus === RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                stateItemModules.push({\n                    sessionStateType: 1,\n                    value: isNotDisturbe ? '1' : '0'\n                });\n            }\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.isTop)) {\n                stateItemModules.push({\n                    sessionStateType: 2,\n                    value: statusItem.isTop ? '1' : '0'\n                });\n            }\n            var stateModules = {\n                type: type,\n                channelId: targetId,\n                time: time,\n                stateItem: stateItemModules\n            };\n            modules.setVersion(time);\n            modules.setState([stateModules]);\n            RongIMLib.RongIMClient.bridge.queryMsg('setSeAtt', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var time = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    statusItem.updateTime = time;\n                    statusItem.isLastInAPull = true;\n                    self.conversationStatusManager.set(type, targetId, statusItem);\n                    setTimeout(function () {\n                        callback.onSuccess(time);\n                    });\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStateModifyResp');\n        };\n        ServerDataProvider.prototype.pullConversationStatus = function (time, callback) {\n            time = time || 0;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionReq();\n            modules.setTime(time);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg('pullSeAtts', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var sessionStateList = result.state, lastTime = result.version;\n                    var sessionLength = sessionStateList.length;\n                    RongIMLib.RongUtil.forEach(sessionStateList, function (state, index) {\n                        var type = state.type, targetId = state.channelId, updateTime = state.time, stateItem = state.stateItem;\n                        var isSilent = false, isTop = false;\n                        RongIMLib.RongUtil.forEach(stateItem, function (item) {\n                            var sessionStateType = item.sessionStateType, value = item.value;\n                            if (sessionStateType === 1) {\n                                isSilent = !!Number(value);\n                            }\n                            if (sessionStateType === 2) {\n                                isTop = !!Number(value);\n                            }\n                        });\n                        var isLastInAPull = index === sessionLength - 1;\n                        callback.onStatus(type, targetId, {\n                            notificationStatus: isSilent ? RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB : RongIMLib.ConversationNotificationStatus.NOTIFY,\n                            isTop: isTop,\n                            updateTime: RongIMLib.MessageUtil.int64ToTimestamp(updateTime),\n                            isLastInAPull: isLastInAPull\n                        });\n                    });\n                    callback.onSuccess(RongIMLib.MessageUtil.int64ToTimestamp(lastTime));\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStates');\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            this.addon.setMessageSearchField(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var result = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return result;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (LoggerLevel) {\n        LoggerLevel[LoggerLevel[\"F\"] = 0] = \"F\";\n        LoggerLevel[LoggerLevel[\"E\"] = 1] = \"E\";\n        LoggerLevel[LoggerLevel[\"W\"] = 2] = \"W\";\n        LoggerLevel[LoggerLevel[\"I\"] = 3] = \"I\";\n        LoggerLevel[LoggerLevel[\"D\"] = 4] = \"D\"; //debug\n    })(RongIMLib.LoggerLevel || (RongIMLib.LoggerLevel = {}));\n    var LoggerLevel = RongIMLib.LoggerLevel;\n    (function (LoggerStoreSize) {\n        LoggerStoreSize[LoggerStoreSize[\"ADVANCED\"] = 500] = \"ADVANCED\";\n        LoggerStoreSize[LoggerStoreSize[\"LOW\"] = 500] = \"LOW\";\n    })(RongIMLib.LoggerStoreSize || (RongIMLib.LoggerStoreSize = {}));\n    var LoggerStoreSize = RongIMLib.LoggerStoreSize;\n    var LoggerType = (function () {\n        function LoggerType() {\n        }\n        LoggerType.IM = 'IM';\n        LoggerType.RTC = 'RTC';\n        return LoggerType;\n    })();\n    RongIMLib.LoggerType = LoggerType;\n    var LoggerTag = (function () {\n        function LoggerTag() {\n        }\n        /**\n         * 三段式关键字: \"发起方-任务类型-结果类型\"\n         * A: App 层，L: Lib 层，N: 调用 Native 层接口，P: Protocol 层\n         * O: 操作，S: 状态，T: 任务，R: 结果，E: 错误\n         */\n        LoggerTag.IM = {\n            A_INIT_O: 'A-init-O',\n            A_CONN_T: 'A-connect-T',\n            A_CONN_R: 'A-connect-R',\n            A_CONN_E: 'A-connect-E',\n            L_RECO_T: 'L-reconnect-T',\n            L_RECO_R: 'L-reconnect-R',\n            L_RECO_E: 'L-reconnect-E',\n            L_GETN_T: 'L-get_navi-T',\n            L_GETN_R: 'L-get_navi-R',\n            L_PING_WS_T: 'L-ping_ws-T',\n            L_PING_WS_R: 'L-ping_ws-R',\n            L_NETC_S: 'L-network_changed-S',\n            A_DISC_O: 'A-disconnect-O',\n            A_JCTR_T: 'A-join_chatroom-T',\n            A_JCTR_R: 'A-join_chatroom-R',\n            A_QCTR_T: 'A-quit_chatroom-T',\n            A_QCTR_R: 'A-quit_chatroom-R',\n            A_INIT_CMD_MSG_E: 'A-instantiate_command_message-E',\n            A_INIT_PROFILE_MSG_E: 'A-instantiate_profile_notify_message-E',\n            A_INIT_CMD_NOTI_MSG_E: 'A-instantiate_command_notify_message-E',\n            L_CHRM_PULL_E: 'L-chatroom_pull-E',\n            L_QUERY_MSG_E: 'L-query_message-E',\n            L_DECODE_MSG_E: 'L-decode_upstream_message-E',\n            L_CATCH_UNKNOWN_MSG_E: 'L-catch_unknown_message-E',\n            L_DECODE_QUERY_DATA_E: 'L-decode_query_data-E',\n            L_PARSE_MSG_E: 'L-parse_message-E',\n            L_WS_ERR_E: 'L-websocket-error-E',\n            G_CRAW_E: 'G-crash-E',\n            G_UP_LOG_S: 'G-upload_log-S',\n            G_UP_LOG_E: 'G-upload_log-E'\n        };\n        return LoggerTag;\n    })();\n    RongIMLib.LoggerTag = LoggerTag;\n    var LoggerReportType = (function () {\n        function LoggerReportType() {\n        }\n        LoggerReportType.REAL_TIME_LOG = 'RealTimeLog';\n        LoggerReportType.MSG_NOTIF_LOG = 'MessageNotificationLog';\n        return LoggerReportType;\n    })();\n    RongIMLib.LoggerReportType = LoggerReportType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Logger = (function () {\n        function Logger() {\n        }\n        Logger.writeLog = function (log) {\n            var self = this;\n            if (RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\") {\n                return;\n            }\n            var networkUnavailable = RongIMLib.RongIMClient._memoryStore.networkUnavailable;\n            var isLowLevelBro = RongIMLib.LoggerUtil.isLowLevelBro();\n            log.time = new Date().getTime();\n            log.sessionId = RongIMLib.LoggerUtil.getSessionId();\n            log.content = log.content && JSON.stringify(log.content);\n            if (networkUnavailable) {\n                if (log.level == RongIMLib.LoggerLevel.E || log.level == RongIMLib.LoggerLevel.W) {\n                    log.level = RongIMLib.LoggerLevel.I;\n                }\n            }\n            self.logStore.push(log);\n            var _handleOverflowLog = function (size) {\n                if (self.logStore.length > size) {\n                    var delLength = self.logStore.length - size;\n                    self.logStore.splice(0, delLength);\n                }\n            };\n            if (isLowLevelBro) {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.LOW);\n            }\n            else {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.ADVANCED);\n            }\n        };\n        Logger.reportRTLog = function () {\n            var self = this;\n            var isUserCloseLogger = RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\";\n            if (self.loggerCache.hasStarted || isUserCloseLogger) {\n                return;\n            }\n            self.loggerCache.hasStarted = true;\n            var policy = this.defaultLogPolicy;\n            var isDefaultUpload = true;\n            var currentTime = 1;\n            var _robustUpload = function () {\n                var isOpen = policy.logSwitch;\n                var itv = policy.itv * 1000;\n                var times = policy.times;\n                var url = policy.url;\n                var level = policy.level;\n                var realItv = itv * Math.pow(2, currentTime - 1);\n                if (currentTime < times) {\n                    currentTime++;\n                }\n                if (!isOpen) {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: level, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: url, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    if (self.loggerCache.isNewNavi) {\n                        currentTime = 1;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        self.loggerCache.isNewNavi = false;\n                    }\n                    if (isDefaultUpload) {\n                        currentTime = 1;\n                        isDefaultUpload = false;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy(); // 更新 navi 中配置下次用\n                    }\n                    if (csvLog.length == 0) {\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        _robustUpload();\n                        return;\n                    }\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: policy.timeout * 1000,\n                        success: function (data) {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log'\n                                } });\n                            //第一次成功后，如果导航有数据使用导航数据，导航无数据关闭上传。第二次上传成功后返回数据使用返回数据\n                            if (!isOpen) {\n                                return;\n                            }\n                            if (data) {\n                                data = JSON.parse(data);\n                                policy.itv = data.nextTime;\n                                policy.level = data.level;\n                                policy.logSwitch = data.logSwitch;\n                                currentTime = 1;\n                            }\n                            _robustUpload();\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, realItv);\n            };\n            _robustUpload();\n        };\n        Logger.reportMNLog = function (policy) {\n            var self = this;\n            var currentTime = 1;\n            var connectTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n            if (policy.platform !== 'Web' || policy.logId === self.loggerCache.logId) {\n                return;\n            }\n            self.loggerCache.logId = policy.logId;\n            var _robustUpload = function () {\n                var itv = 5000;\n                var times = 3;\n                itv = itv * Math.pow(2, currentTime - 2);\n                if (currentTime === 1) {\n                    itv = 0;\n                }\n                if (currentTime <= times) {\n                    currentTime++;\n                }\n                else {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: RongIMLib.LoggerLevel.D, startTime: policy.startTime, endTime: policy.endTime, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    if (csvLog.length === 0 && policy.endTime < connectTime) {\n                        //没有日志且连接时间大于日志消息结束时间，说明此日志消息过期，无需上传\n                        return;\n                    }\n                    else if (csvLog.length === 0 && policy.endTime > connectTime) {\n                        //没有日志且连接时间小于日志消息结束时间，说明用户连接时间在需要获取的时间内,没有日志上传 nodata\n                        csvLog = 'nodata';\n                    }\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: policy.uri, logId: policy.logId, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: self.defaultLogPolicy.timeout * 1000,\n                        success: function () {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log'\n                                } });\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, itv);\n            };\n            _robustUpload();\n        };\n        Logger.logStore = [];\n        Logger.defaultLogPolicy = {\n            \"logSwitch\": 1,\n            \"url\": 'logcollection.ronghub.com/',\n            \"level\": RongIMLib.LoggerLevel.E,\n            \"itv\": 20,\n            \"times\": 5,\n            \"timeout\": 15\n        };\n        Logger.loggerCache = {\n            userId: '',\n            logId: 'none',\n            isNewNavi: false,\n            hasStarted: false\n        };\n        return Logger;\n    })();\n    RongIMLib.Logger = Logger;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LoggerUtil = (function () {\n        function LoggerUtil() {\n        }\n        LoggerUtil.isLowLevelBro = function () {\n            var flag = false;\n            var bro = RongIMLib.RongUtil.getBrower();\n            if (bro.type == 'IE' && bro.version < 9) {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.isRealTimeLogType = function (type) {\n            return type === RongIMLib.LoggerReportType.REAL_TIME_LOG;\n        };\n        LoggerUtil.handleLog = function (conf) {\n            var self = this;\n            var csvLog = '';\n            var logs = RongIMLib.Logger.logStore;\n            var lastIndex = 0;\n            if (self.isRealTimeLogType(conf.type)) {\n                RongIMLib.RongUtil.forEach(logs, function (log, index) {\n                    if (log.time > self.lastTime && log.level <= conf.level) {\n                        csvLog += self.genCSVLog(log);\n                        lastIndex = index;\n                    }\n                });\n                if (csvLog.length !== 0) {\n                    self.lastTime = logs[lastIndex].time;\n                }\n            }\n            else {\n                RongIMLib.RongUtil.forEach(logs, function (log) {\n                    if (log.level <= conf.level && log.time >= conf.startTime && log.time <= conf.endTime) {\n                        csvLog += self.genCSVLog(log);\n                    }\n                });\n            }\n            return csvLog;\n        };\n        LoggerUtil.getNaviPolicy = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            var fullNavi = navi && JSON.parse(navi);\n            var policy = {};\n            var logPolicy = fullNavi.logPolicy || \"{}\";\n            var logSwitch = fullNavi.logSwitch;\n            policy = logPolicy && JSON.parse(logPolicy);\n            policy.logSwitch = logSwitch;\n            return policy;\n        };\n        LoggerUtil.genDeviceId = function () {\n            var deviceId = '';\n            var key = 'deviceId';\n            var isSupportLS = RongIMLib.RongUtil.supportLocalStorage();\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            var loggerStorage;\n            if (isSupportLS) {\n                loggerStorage = new RongIMLib.LocalStorageProvider();\n            }\n            else if (isSupportSS) {\n                loggerStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                loggerStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasDeviceId = loggerStorage.getItem(key);\n            if (hasDeviceId) {\n                deviceId = loggerStorage.getItem(key);\n            }\n            else {\n                loggerStorage.removeItem(key);\n                var uuid = RongIMLib.RongUtil.getUUID22();\n                loggerStorage.setItem(key, uuid);\n                deviceId = uuid;\n            }\n            return deviceId;\n        };\n        LoggerUtil.getSessionId = function () {\n            var sessionId = '';\n            var key = 'sessionId';\n            var sessionStorage;\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            if (isSupportSS) {\n                sessionStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                sessionStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasSessionId = sessionStorage.getItem(key);\n            if (hasSessionId) {\n                sessionId = sessionStorage.getItem(key);\n            }\n            else {\n                sessionStorage.removeItem(key);\n                var val = RongIMLib.RongUtil.getUUID22();\n                sessionStorage.setItem(key, val);\n                sessionId = val;\n            }\n            return sessionId;\n        };\n        LoggerUtil.getDeviceInfo = function () {\n            var self = this;\n            var browerInfo = RongIMLib.RongUtil.getBrower();\n            var sessionId = self.getSessionId().slice(0, 10);\n            var infoTpl = '{brower}|{version}|{sessionId}';\n            return RongIMLib.RongUtil.tplEngine(infoTpl, {\n                brower: browerInfo.type,\n                version: browerInfo.version,\n                sessionId: sessionId\n            });\n        };\n        LoggerUtil.getEntireUrl = function (opt) {\n            var self = this;\n            var tLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var mLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var entireUrl = '';\n            var protocol = \"https://\";\n            if (location.protocol == \"http:\") {\n                protocol = \"http://\";\n            }\n            var paramObj = {\n                protocol: protocol,\n                url: opt.url,\n                version: RongIMLib.RongIMClient.sdkver || 'Unknown version',\n                appkey: RongIMLib.RongIMClient._memoryStore.appKey || 'Unknown appkey',\n                deviceId: self.genDeviceId(),\n                deviceInfo: self.getDeviceInfo(),\n                platform: 'Web',\n                userId: RongIMLib.Logger.loggerCache.userId || ''\n            };\n            if (self.isRealTimeLogType(opt.type)) {\n                entireUrl = RongIMLib.RongUtil.tplEngine(tLogTpl, paramObj);\n            }\n            else {\n                entireUrl = RongIMLib.RongUtil.tplEngine(mLogTpl, RongIMLib.RongUtil.extend(paramObj, {\n                    logId: opt.logId\n                }));\n            }\n            return entireUrl;\n        };\n        LoggerUtil.genCSVLog = function (log) {\n            var tpl = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n            if (log.content) {\n                var content = '\"' + log.content.replace(/\\\"/g, '\"\"') + '\"';\n            }\n            var csvLog = RongIMLib.RongUtil.tplEngine(tpl, {\n                sessionId: log.sessionId,\n                time: log.time,\n                type: log.type,\n                level: log.level,\n                tag: log.tag,\n                content: content || '\"\"'\n            });\n            return csvLog;\n        };\n        LoggerUtil.isLogCmdMsg = function (message) {\n            var flag = false;\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"LogCommandMessage\"] && message.senderUserId === 'rongcloudsystem') {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.recordFatalLogOfNavi = function (internalRetry, navigators) {\n            if (internalRetry === 3) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                        desc: 'Request navigation failed 3 times',\n                        navigators: navigators\n                    } });\n            }\n        };\n        LoggerUtil.lastTime = 0;\n        return LoggerUtil;\n    })();\n    RongIMLib.LoggerUtil = LoggerUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var sessionStorageProvider = (function () {\n        function sessionStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n        }\n        sessionStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.setItem(composedKey, object);\n            }\n        };\n        sessionStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return sessionStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return '';\n        };\n        sessionStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        sessionStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        sessionStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.removeItem(composedKey.toString());\n            }\n        };\n        sessionStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in sessionStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        sessionStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(sessionStorage).length;\n        };\n        return sessionStorageProvider;\n    })();\n    RongIMLib.sessionStorageProvider = sessionStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback, null, {\n                                    isIgnoreReportStart: true\n                                });\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isNull = function (val) {\n            return Object.prototype.toString.call(val) == '[object Null]';\n        };\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function' || typeof XDomainRequest == 'object';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var body = opts.body;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var timeout = opts.timeout;\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            if (timeout) {\n                xhr.timeout = timeout;\n            }\n            if (body) {\n                xhr.send(body);\n                return xhr;\n            }\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.getLocalProtocol = function () {\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol === 'https:') {\n                return 'https://';\n            }\n            else {\n                return 'http://';\n            }\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getValidNavi = function (naviHost) {\n            var HttpProtocol = RongIMLib.RongIMClient.HttpProtocol;\n            var flag = '://';\n            var index = naviHost.indexOf(flag);\n            var hasProtocol = index > -1;\n            var navi = naviHost;\n            if (!hasProtocol) {\n                var protocol = RongIMLib.RongIMClient.getProtocol().protocol;\n                navi = protocol + naviHost;\n            }\n            var naviProtocol = RongUtil.getUrlProtocol(navi), localProtocol = RongUtil.getLocalProtocol();\n            // 本地为 https, 但却传入 http 时, 强制转化为 https\n            if (naviProtocol === HttpProtocol.http && localProtocol === 'https://') {\n                navi = RongUtil.formatProtoclPath({\n                    path: navi,\n                    tmpl: '{0}{1}',\n                    protocol: HttpProtocol.https,\n                    sub: true\n                });\n            }\n            return navi;\n        };\n        RongUtil.getUrlProtocol = function (url) {\n            var flag = '://';\n            var index = url.indexOf(flag);\n            if (index > -1) {\n                return url.substring(0, index + flag.length);\n            }\n            else {\n                return 'https://';\n            }\n            ;\n        };\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        RongUtil.supportSessionStorage = function () {\n            var support = false;\n            if (typeof sessionStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    sessionStorage.setItem(key, value);\n                    var localVal = sessionStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('sessionStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.isValidWsUrl = function (url) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            return invalidWsUrls.indexOf(url) === -1 && !RongUtil.isEmpty(url);\n        };\n        RongUtil.getBrower = function () {\n            var userAgent = navigator.userAgent;\n            var version;\n            var type;\n            /* 记录各浏览器名字和匹配条件 */\n            var condition = {\n                IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n                Edge: /Edge\\/([\\d.]+)/,\n                Firefox: /Firefox\\/([\\d.]+)/,\n                Opera: /(?:OPERA|OPR).([\\d.]+)/,\n                WeChat: /MicroMessenger\\/([\\d.]+)/,\n                QQBrowser: /QQBrowser\\/([\\d.]+)/,\n                Chrome: /Chrome\\/([\\d.]+)/,\n                Safari: /Version\\/([\\d.]+).*Safari/,\n                iOSChrome: /Mobile\\/([\\d.]+).*Safari/\n            };\n            for (var key in condition) {\n                if (!condition.hasOwnProperty(key))\n                    continue;\n                var browserContent;\n                if (browserContent = userAgent.match(condition[key])) {\n                    type = key;\n                    version = browserContent[1] || browserContent[2];\n                    break;\n                }\n            }\n            return {\n                type: type || 'UnKonw',\n                version: version || 'UnKonw'\n            };\n        };\n        RongUtil.string10to64 = function (number) {\n            var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''), radix = chars.length + 1, qutient = +number, arr = [];\n            do {\n                var mod = qutient % radix;\n                qutient = (qutient - mod) / radix;\n                arr.unshift(chars[mod]);\n            } while (qutient);\n            return arr.join('');\n        };\n        RongUtil.getUUID = function () {\n            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n                var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n                return v.toString(16);\n            });\n        };\n        /* 获取 22 位的 UUID */\n        RongUtil.getUUID22 = function () {\n            var uuid = this.getUUID();\n            uuid = uuid.replace(/-/g, '') + 'a';\n            uuid = parseInt(uuid, 16);\n            uuid = this.string10to64(uuid);\n            if (uuid.length > 22) {\n                uuid = uuid.slice(0, 22);\n            }\n            if (uuid.length < 22) {\n                var len = 22 - uuid.length;\n                for (var i = 0; i < len; i++) {\n                    uuid = uuid + '0';\n                }\n            }\n            return uuid;\n        };\n        RongUtil.getByteLength = function (str, charset) {\n            charset = charset || 'utf-8';\n            var total = 0, chatCode;\n            if (charset === 'utf-16') {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode <= 0xffff) {\n                        total += 2;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            else {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode < 0x007f) {\n                        total += 1;\n                    }\n                    else if (chatCode <= 0x07ff) {\n                        total += 2;\n                    }\n                    else if (chatCode <= 0xffff) {\n                        total += 3;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            return total;\n        };\n        RongUtil.concat = function (before, after, isDedup) {\n            RongUtil.forEach(after, function (item) {\n                if (!isDedup || RongUtil.indexOf(before, item) === -1) {\n                    before.push(item);\n                }\n            });\n            return before;\n        };\n        RongUtil.getCurrentDate = function (seperator) {\n            var date = new Date();\n            var year = date.getFullYear();\n            var month = date.getMonth() + 1;\n            var day = date.getDate();\n            return RongUtil.tplEngine('{year}{seperator}{month}{seperator}{day}', {\n                year: year,\n                month: month,\n                day: day,\n                seperator: seperator\n            });\n        };\n        RongUtil.generateUploadFileName = function (type, fileName) {\n            var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n            var random = Math.floor((Math.random() * 1000) % 10000);\n            var uuid = this.getUUID();\n            var fileNameArr, extension;\n            if (fileName) {\n                fileNameArr = fileName.split('.');\n                extension = '.' + fileNameArr[fileNameArr.length - 1];\n            }\n            return RongUtil.tplEngine(tpl, {\n                type: type,\n                date: RongUtil.getCurrentDate('-'),\n                random: random,\n                uuid: uuid,\n                timestamp: RongUtil.getTimestamp(),\n                extension: extension || ''\n            });\n        };\n        RongUtil.Prosumer = Prosumer;\n        RongUtil.Storage = {\n            set: function (key, value) {\n                try {\n                    RongIMLib.RongIMClient._storageProvider.setItem(key, JSON.stringify(value));\n                }\n                catch (e) { }\n            },\n            get: function (key) {\n                var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n                try {\n                    return JSON.parse(value);\n                }\n                catch (e) {\n                    return {};\n                }\n            }\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n    var Base64 = (function () {\n        function Base64() {\n        }\n        Base64.utf8_encode = function (string) {\n            string = string.replace(/\\r\\n/g, \"\\n\");\n            var utftext = \"\";\n            for (var n = 0; n < string.length; n++) {\n                var c = string.charCodeAt(n);\n                if (c < 128) {\n                    utftext += String.fromCharCode(c);\n                }\n                else if ((c > 127) && (c < 2048)) {\n                    utftext += String.fromCharCode((c >> 6) | 192);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n                else {\n                    utftext += String.fromCharCode((c >> 12) | 224);\n                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n            }\n            return utftext;\n        };\n        Base64.utf8_decode = function (utftext) {\n            var string = \"\";\n            var i = 0;\n            var c = 0, c1 = 0, c2 = 0, c3;\n            while (i < utftext.length) {\n                c = utftext.charCodeAt(i);\n                if (c < 128) {\n                    string += String.fromCharCode(c);\n                    i++;\n                }\n                else if ((c > 191) && (c < 224)) {\n                    c2 = utftext.charCodeAt(i + 1);\n                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n                    i += 2;\n                }\n                else {\n                    c2 = utftext.charCodeAt(i + 1);\n                    c3 = utftext.charCodeAt(i + 2);\n                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n                    i += 3;\n                }\n            }\n            return string;\n        };\n        Base64.encode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = this.utf8_encode(input);\n            while (i < input.length) {\n                chr1 = input.charCodeAt(i++);\n                chr2 = input.charCodeAt(i++);\n                chr3 = input.charCodeAt(i++);\n                enc1 = chr1 >> 2;\n                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n                enc4 = chr3 & 63;\n                if (isNaN(chr2)) {\n                    enc3 = enc4 = 64;\n                }\n                else if (isNaN(chr3)) {\n                    enc4 = 64;\n                }\n                output = output +\n                    this.keyStr.charAt(enc1) + this.keyStr.charAt(enc2) +\n                    this.keyStr.charAt(enc3) + this.keyStr.charAt(enc4);\n            }\n            return output;\n        };\n        Base64.decode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3;\n            var enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n            while (i < input.length) {\n                enc1 = this.keyStr.indexOf(input.charAt(i++));\n                enc2 = this.keyStr.indexOf(input.charAt(i++));\n                enc3 = this.keyStr.indexOf(input.charAt(i++));\n                enc4 = this.keyStr.indexOf(input.charAt(i++));\n                chr1 = (enc1 << 2) | (enc2 >> 4);\n                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n                chr3 = ((enc3 & 3) << 6) | enc4;\n                output = output + String.fromCharCode(chr1);\n                if (enc3 != 64) {\n                    output = output + String.fromCharCode(chr2);\n                }\n                if (enc4 != 64) {\n                    output = output + String.fromCharCode(chr3);\n                }\n            }\n            output = this.utf8_decode(output);\n            return output;\n        };\n        Base64.keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n        return Base64;\n    })();\n    RongIMLib.Base64 = Base64;\n    var TextCompressor = (function () {\n        function TextCompressor() {\n        }\n        TextCompressor.compress = function (data) {\n            var self = this;\n            var map = {};\n            //构建一个用于反向查询字符位置的 map\n            for (var p = 0; p < data.length - 1; p++) {\n                var c1 = data.charAt(p);\n                var c2 = data.charAt(p + 1);\n                var c = c1 + c2;\n                if (!map.hasOwnProperty(c)) {\n                    map[c] = [p];\n                    continue;\n                }\n                map[c].push(p);\n            }\n            var compressedData = [], normalBlockBuffer = [];\n            //编码未压缩数据块\n            var encodeNormalBlock = function () {\n                if (normalBlockBuffer.length > 0) {\n                    var normalBlock = normalBlockBuffer.join('');\n                    normalBlockBuffer = [];\n                    if (normalBlock.length > 26) {\n                        var normalExtBlockLength = self.numberEncode(normalBlock.length);\n                        var normalExtBlockHeader = String.fromCharCode(self.dataType.NormalExt | normalExtBlockLength.length);\n                        compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n                    }\n                    else {\n                        var normalBlockHeader = String.fromCharCode(self.dataType.Normal | normalBlock.length);\n                        compressedData.push(normalBlockHeader);\n                    }\n                    compressedData.push(normalBlock);\n                }\n            };\n            var i = 0;\n            while (i < data.length) {\n                var r = self.indexOf(map, data, i);\n                if (r.length < 2) {\n                    normalBlockBuffer.push(data.charAt(i++));\n                    continue;\n                }\n                if (r.length < 4) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                var offset = self.numberEncode(i - r.offset);\n                var length = self.numberEncode(r.length);\n                //欲压缩的数据与数据编码后的长度一致，则不进行压缩\n                if (offset.length + length.length >= r.length) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                //编码未压缩数据块\n                encodeNormalBlock();\n                //编码压缩数据块\n                var compressedBlockHeader = String.fromCharCode(self.dataType.Compressed | (offset.length << 2) | length.length);\n                compressedData.push(compressedBlockHeader + offset + length);\n                i += r.length;\n            }\n            //编码剩余未压缩数据块\n            encodeNormalBlock();\n            //在数据尾部添加校验和\n            var dataLengthTo62 = self.numberEncode(data.length);\n            var tailBlockHeader = String.fromCharCode(self.dataType.Tail | dataLengthTo62.length);\n            compressedData.push(tailBlockHeader + dataLengthTo62);\n            return compressedData.join('');\n        };\n        TextCompressor.uncompress = function (data) {\n            var self = this;\n            var i = 0;\n            var result = \"\";\n            label1: do {\n                var header = data.charCodeAt(i++);\n                var headerType = header & self.dataType.Mark;\n                var headerVal = header & 0xF;\n                switch (headerType) {\n                    case self.dataType.Compressed:\n                        var p1 = headerVal >> 2;\n                        var p2 = headerVal & 3;\n                        if (p1 == 0 || p2 == 0) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        var offset = self.numberDecode(data.substr(i, p1));\n                        var len = self.numberDecode(data.substr(i += p1, p2));\n                        offset = result.length - offset;\n                        if (offset + len > result.length) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += p2;\n                        result += result.substr(offset, len);\n                        break;\n                    case self.dataType.Tail:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        if (num != result.length) {\n                            console.log(result.length);\n                            console.log(num);\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += headerVal;\n                        break label1;\n                    case self.dataType.NormalExt:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        result += data.substr(i += headerVal, num);\n                        i += num;\n                        break;\n                    case self.dataType.Normal:\n                        result += data.substr(i, headerVal);\n                        i += headerVal;\n                        break;\n                    case self.dataType.Mark:\n                        if (headerVal > 10) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        result += data.substr(i, 16 + headerVal);\n                        i += (16 + headerVal);\n                        break;\n                    default:\n                        throw new Error(\"Data parsing error,at \" + i + \" header:\" + headerType);\n                }\n            } while (i < data.length);\n            return result;\n        };\n        TextCompressor.indexOf = function (map, source, fromIndex) {\n            var self = this;\n            var result = {\n                length: 0,\n                offset: -1\n            };\n            var sourceLength = source.length;\n            if (fromIndex >= source.length - 1) {\n                return result;\n            }\n            var c1 = source.charAt(fromIndex);\n            var c2 = source.charAt(fromIndex + 1);\n            var items = map[c1 + c2];\n            if (items[0] == fromIndex) {\n                return result;\n            }\n            var space1 = source.length - fromIndex;\n            var lastChar;\n            for (var i = 0, len = items.length; i < len; i++) {\n                var item = items[i];\n                var space2 = fromIndex - item;\n                if (space2 > self.max) {\n                    continue;\n                }\n                var end = Math.min(space1, space2);\n                if (end <= result.length) {\n                    break;\n                }\n                if (result.length > 2) {\n                    if (source.charAt(item + result.length - 1) != source.charAt(fromIndex + result.length - 1)) {\n                        continue;\n                    }\n                }\n                var m = 2;\n                for (var j = m; j < end; j++) {\n                    if (source.charAt(item + j) == source.charAt(fromIndex + j)) {\n                        m++;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                if (m >= result.length) {\n                    result.length = m;\n                    result.offset = item;\n                }\n            }\n            return result;\n        };\n        /*\n        * 将数字转化为 62 进制字符串。\n        */\n        TextCompressor.numberEncode = function (num) {\n            var self = this;\n            var result = [], remainder = 0;\n            do {\n                remainder = num % self.scale;\n                result.push(self.chars.charAt(remainder));\n                num = (num - remainder) / self.scale;\n            } while (num > 0);\n            return result.join('');\n        };\n        /*\n        * 将 62 进制字符串还原为数字。\n        */\n        TextCompressor.numberDecode = function (str) {\n            var self = this;\n            var num = 0, index = 0;\n            for (var i = str.length - 1; i >= 0; i--) {\n                index = self.chars.indexOf(str.charAt(i));\n                if (index == -1) {\n                    throw new Error(\"decode number error, data is \\\"\" + str + \"\\\"\");\n                }\n                num = num * self.scale + index;\n            }\n            return num;\n        };\n        TextCompressor.dataType = {\n            Tail: 0x30,\n            Compressed: 0x40,\n            NormalExt: 0x50,\n            Normal: 0x60,\n            Mark: 0x70\n        };\n        TextCompressor.chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n        TextCompressor.scale = TextCompressor.chars.length;\n        TextCompressor.max = 238327;\n        return TextCompressor;\n    })();\n    RongIMLib.TextCompressor = TextCompressor;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat    \n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/RongIMLib.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 1] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 2] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * JSON 后的消息体超限, 目前最大 128kb\n         * */\n        ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                    errorCode: code,\n                    message: errorInfo.msg || errorInfo.funcName,\n                    parameter: params.parameter,\n                    action: errorInfo.funcName\n                } });\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            RongIMClient.conversationStatusListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {},\n                networkUnavailable: false,\n                loggerSwitch: options.loggerSwitch || 'on'\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ReferenceMessage: { objectName: \"RC:ReferenceMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GIFMessage: { objectName: \"RC:GIFMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                SightMessage: { objectName: \"RC:SightMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                LogCommandMessage: { objectName: 'RC:LogCmdMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                ReferenceMessage: \"ReferenceMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                GIFMessage: 'GIFMessage',\n                SightMessage: 'SightMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage',\n                LogCommandMessage: 'LogCommandMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    appKey: appKey\n                } });\n            return sdkInfo;\n        };\n        ;\n        RongIMClient.setProtocol = function (protocol) {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var HttpProtocol = RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMClient.WsProtocol;\n            if (protocol === HttpProtocol.http) {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.http;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.ws;\n            }\n            else {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.https;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.wss;\n            }\n        };\n        RongIMClient.getProtocol = function () {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var depend = RongIMClient._memoryStore.depend;\n            var protocol = depend.protocol, wsScheme = depend.wsScheme;\n            if (!protocol || !wsScheme) {\n                protocol = RongIMClient.HttpProtocol.https;\n                wsScheme = RongIMClient.WsProtocol.wss;\n            }\n            return {\n                protocol: protocol,\n                wsScheme: wsScheme\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            if (RongIMLib.IMHandler.isIncludeNavi(token)) {\n                var protocol = RongIMClient._memoryStore.depend.protocol;\n                var currentNavs = RongIMClient._memoryStore.depend.navigaters;\n                var navList = RongIMLib.IMHandler.getNavsByToken(token, protocol);\n                token = RongIMLib.IMHandler.getToken(token);\n                RongIMClient._memoryStore.depend.navigaters = RongIMLib.RongUtil.concat(navList, currentNavs, true);\n            }\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.setConversationStatusListener = function (listener) {\n            if (listener && listener.onChanged && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.conversationStatusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_DISC_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM });\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            RongIMClient._dataAccessProvider.setConversationStatus(type, targetId, statusItem, callback);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageSearchField(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    if (tempConver.msg) {\n                        conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                        conver.latestMessageId = conver.latestMessage.messageId;\n                        conver.objectName = conver.latestMessage.objectName;\n                        conver.receivedStatus = conver.latestMessage.receivedStatus;\n                        conver.receivedTime = conver.latestMessage.receiveTime;\n                        conver.sentStatus = conver.latestMessage.sentStatus;\n                        conver.sentTime = conver.latestMessage.sentTime;\n                    }\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    var status = RongIMClient._dataAccessProvider.conversationStatusManager.get(tempConver.type, tempConver.userId);\n                    conver.notificationStatus = status.notificationStatus;\n                    conver.isTop = status.isTop;\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.HttpProtocol = {\n            http: 'http://',\n            https: 'https://'\n        };\n        RongIMClient.WsProtocol = {\n            ws: 'ws://',\n            wss: 'wss://'\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.MaxMessageContentBytes = 131072; // 128kb\n        RongIMClient.NavMarkInToken = '@';\n        RongIMClient.NavSeparatorInToken = ';';\n        RongIMClient.NavExpiredTime = 7200000; // 2 小时\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.7';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.conversationStatusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    RongIMLib.StatusTopic = (function () {\n        var ConversationType = RongIMLib.ConversationType;\n        var topic = {};\n        topic[ConversationType.PRIVATE] = 'ppMsgS';\n        topic[ConversationType.GROUP] = 'pgMsgS';\n        return topic;\n    })();\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            if (depend.cmpUrl) {\n                servers = [depend.cmpUrl].concat(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                        url: url\n                                    } });\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                            url: url,\n                                            code: code\n                                        } });\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    url: server\n                                } });\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                                desc: 'all websocket addresses are unavailable',\n                                cmp: servers,\n                                ConnectionStatus: RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE,\n                                available: false\n                            } });\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    me.connectionStatus = code;\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                    var unReportCodes = [RongIMLib.ConnectionStatus.CONNECTING, RongIMLib.ConnectionStatus.REQUEST_NAVI, RongIMLib.ConnectionStatus.RESPONSE_NAVI];\n                    var isReportCode = RongIMLib.RongUtil.indexOf(unReportCodes, code) === -1;\n                    if (isReportCode) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_NETC_S, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                ConnectionStatus: code,\n                                available: false\n                            } });\n                    }\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg, option) {\n            option = option || {};\n            var isNoAck = option.isNoAck;\n            var hasCallback = !!_callback;\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (isNoAck) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                _callback.onSuccess(msg);\n            }\n            else if (hasCallback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    var errorMsg = \"syncTime:Received messages of chatroom but was not init\";\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            msg: errorMsg\n                        } });\n                    throw new Error(errorMsg);\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'invoke -> queryMessage',\n                            error: error\n                        } });\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                    if (status == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE) {\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = true;\n                    }\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType, params) {\n            params = params || {};\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                var isStatusMessage = params.isStatus;\n                var statusTopic = RongIMLib.StatusTopic[topic];\n                if (isStatusMessage && statusTopic) {\n                    Bridge._client.publishMessage(statusTopic, content, targetId, callback, msg, {\n                        isNoAck: true\n                    });\n                }\n                else {\n                    Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg); // 非状态消息, 逻辑不变\n                }\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'NotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                if (data.type === 2) {\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n                else if (data.type === 3) {\n                    RongIMLib.RongIMClient._dataAccessProvider.conversationStatusManager.pull({\n                        time: timestamp\n                    });\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                var receivedTime = new Date().getTime();\n                con.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            if (RongIMLib.LoggerUtil.isLogCmdMsg(message)) {\n                RongIMLib.Logger.reportMNLog(message.content);\n                return;\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                try {\n                    that._onReceived(message, count, hasMore);\n                }\n                catch (e) {\n                    console.error(e);\n                }\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            if (msg && RongIMLib.RongUtil.isObject(msg) && msg.timestamp) {\n                RongIMLib.MessageUtil.setDeltaTime(msg.timestamp);\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'MessageHandler -> handleMessage',\n                            msg: msg\n                        } });\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            stack: e,\n                            msg: 'QueryCallback -> process'\n                        } });\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                RongIMLib.MessageUtil.setDeltaTime(timestamp);\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result, naviUrl) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var successNaviProtocol = RongIMLib.RongUtil.getUrlProtocol(naviUrl);\n            // navi 请求成功后, 根据 navi 协议头, 设置连接 websocket 协议头\n            RongIMLib.RongIMClient.setProtocol(successNaviProtocol);\n            storage.setItem(Navigation.StoreProtocolKey, successNaviProtocol);\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            storage.setItem('navi_time', RongIMLib.RongUtil.getTimestamp());\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                var currentTime = RongIMLib.RongUtil.getTimestamp();\n                var naviSavedTime = Number(storage.getItem('navi_time')) || 0;\n                var isNotExpired = currentTime - naviSavedTime < RongIMLib.RongIMClient.NavExpiredTime;\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers) && isNotExpired) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    var storageProtocol = storage.getItem(Navigation.StoreProtocolKey);\n                    storageProtocol && RongIMLib.RongIMClient.setProtocol(storageProtocol);\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                navi = RongIMLib.RongUtil.getValidNavi(navi);\n                indexTools.add();\n                RongIMLib.LoggerUtil.recordFatalLogOfNavi(internalRetry, navigaters);\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result, navi);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n            RongIMLib.Logger.loggerCache.isNewNavi = true;\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            var requestType = \"HTTP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    result = JSON.parse(result);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                            code: 0,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                    success(result);\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            code: status,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            var requestType = \"JSONP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            var loggerResult = function (status, result) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        code: status,\n                        result: result,\n                        url: url,\n                        requestType: requestType\n                    } });\n            };\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                loggerResult(code, result);\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                loggerResult(RongIMLib.ConnectionState.TOKEN_INCORRECT, {});\n            };\n        };\n        Navigation.StoreProtocolKey = 'navprotocol';\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                try {\n                    this.pool = this.pool.concat(b);\n                }\n                catch (e) {\n                    [].push.apply(this.pool, b);\n                }\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                    error: RongIMLib.ConnectionStatus.WEBSOCKET_ERROR,\n                    msg: 'SocketTransportation -> onError'\n                } });\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:ReferenceMsg\": \"ReferenceMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:GIFMsg\": \"GIFMessage\",\n    \"RC:SightMsg\": \"SightMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\",\n    \"RC:LogCmdMsg\": \"LogCommandMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    // 业务层公共方法处理\n    var IMHandler = (function () {\n        function IMHandler() {\n        }\n        IMHandler.isIncludeNavi = function (token) {\n            var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n            var hasNavMark = navMarkIndex !== -1;\n            return hasNavMark;\n        };\n        IMHandler.getToken = function (token) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                token = token.substring(0, navMarkIndex + 1);\n            }\n            return token;\n        };\n        IMHandler.getNavsByToken = function (token, protocol) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            var navUrlList = [];\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                var navsText = token.substring(navMarkIndex + 1, token.length);\n                var navDomains = navsText.split(RongIMLib.RongIMClient.NavSeparatorInToken);\n                RongIMLib.RongUtil.forEach(navDomains, function (domain) {\n                    if (RongIMLib.RongUtil.isEmpty(domain)) {\n                        return;\n                    }\n                    var navUrl = RongIMLib.RongUtil.formatProtoclPath({\n                        path: domain, protocol: protocol, sub: true\n                    });\n                    navUrlList.push(navUrl);\n                });\n            }\n            return navUrlList;\n        };\n        IMHandler.getConversationKey = function (type, id) {\n            return type + '_' + id;\n        };\n        return IMHandler;\n    })();\n    RongIMLib.IMHandler = IMHandler;\n    ;\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: ex,\n                        msg: 'MessageUtil -> messageParser'\n                    } });\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            var receivedTime = new Date().getTime();\n            message.messageUId = entity.msgId;\n            message.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        MessageUtil.setDeltaTime = function (serverTime) {\n            try {\n                RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - serverTime;\n            }\n            catch (e) { }\n        };\n        MessageUtil.getDeltaTime = function () {\n            var _memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            return _memoryStore.deltaTime || 0;\n        };\n        MessageUtil.getCheckedTime = function (time) {\n            var deltaTime = MessageUtil.getDeltaTime();\n            return time - deltaTime;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n    var ConversationStatusStoreUserKey = '{appkey}{userId}constas';\n    var ConversationStatusPullTimeStoreKey = 'time';\n    var ConversationStatusManager = (function () {\n        function ConversationStatusManager(option) {\n            this.updatedStatus = {}; // 更新的会话状态\n            this.statusShangeObserver = new RongIMLib.Observer();\n            this.pullProsumer = new RongIMLib.RongUtil.Prosumer();\n            var appkey = option.appkey, userId = option.userId;\n            this.option = option;\n            this.storageKey = RongIMLib.RongUtil.tplEngine(ConversationStatusStoreUserKey, {\n                appkey: appkey, userId: userId\n            });\n        }\n        ConversationStatusManager.prototype.watchChanged = function (event) {\n            this.statusShangeObserver.add(event);\n        };\n        ConversationStatusManager.prototype.set = function (type, targetId, status) {\n            var currentStatus = this.get(type, targetId);\n            var updateTime = status.updateTime, isLastInAPull = status.isLastInAPull;\n            if (updateTime > currentStatus.updateTime) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n                var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n                var storeStatus = allStatus[conversationStoreKey] || {};\n                RongIMLib.RongUtil.forEach(status, function (val, key) {\n                    if (!RongIMLib.RongUtil.isUndefined(val)) {\n                        storeStatus[key] = val;\n                    }\n                });\n                allStatus[conversationStoreKey] = storeStatus;\n                RongIMLib.RongUtil.Storage.set(this.storageKey, allStatus);\n                this.updatedStatus[conversationStoreKey] = status;\n                RongIMLib.RongIMClient.getInstance().pottingConversation({\n                    type: type,\n                    userId: targetId\n                });\n            }\n            isLastInAPull && this.statusShangeObserver.emit(this.updatedStatus);\n            this.updatedStatus = {};\n        };\n        ConversationStatusManager.prototype.get = function (type, targetId) {\n            var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n            var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n            var status = allStatus[conversationStoreKey] || {};\n            var notificationStatus = status.notificationStatus, isTop = status.isTop, updateTime = status.updateTime;\n            return {\n                notificationStatus: notificationStatus || RongIMLib.ConversationNotificationStatus.NOTIFY,\n                isTop: isTop || false,\n                updateTime: updateTime || 0\n            };\n        };\n        ConversationStatusManager.prototype.pull = function (option) {\n            option = option || {};\n            var self = this;\n            var _a = this, server = _a.option.server, pullProsumer = _a.pullProsumer, storageKey = _a.storageKey;\n            pullProsumer.produce(option);\n            pullProsumer.consume(function (params, next) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                var lastUpdateTime = allStatus[ConversationStatusPullTimeStoreKey] || 0;\n                var updateTime = params.time, isForce = params.isForce;\n                if (lastUpdateTime > updateTime && !isForce) {\n                    return next();\n                }\n                server.pullConversationStatus(lastUpdateTime, {\n                    onStatus: function (type, id, conversationStatus) {\n                        self.set(type, id, conversationStatus);\n                    },\n                    onSuccess: function (updateTime) {\n                        var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                        allStatus[ConversationStatusPullTimeStoreKey] = updateTime; // 更新拉取时间戳\n                        RongIMLib.RongUtil.Storage.set(self.storageKey, allStatus);\n                        next();\n                    },\n                    onError: next\n                });\n            });\n        };\n        return ConversationStatusManager;\n    })();\n    RongIMLib.ConversationStatusManager = ConversationStatusManager;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            message.burnDuration && (this.burnDuration = message.burnDuration);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n    var LogCommandMessage = (function () {\n        function LogCommandMessage(message) {\n            this.messageName = \"LogCommandMessage\";\n            message.uri && (this.uri = message.uri);\n            message.logId && (this.logId = message.logId);\n            message.platform && (this.platform = message.platform);\n            message.packageName && (this.packageName = message.packageName);\n            message.startTime && (this.startTime = message.startTime);\n            message.endTime && (this.endTime = message.endTime);\n            message.user && (this.user = message.user);\n        }\n        LogCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LogCommandMessage;\n    })();\n    RongIMLib.LogCommandMessage = LogCommandMessage;\n    var ReferenceMessage = (function () {\n        function ReferenceMessage(message) {\n            this.messageName = \"ReferenceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.content = message.content;\n            this.referMsgUserId = message.referMsgUserId;\n            this.referMsg = message.referMsg;\n            this.objName = message.objName;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ReferenceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReferenceMessage;\n    })();\n    RongIMLib.ReferenceMessage = ReferenceMessage;\n    var GIFMessage = (function () {\n        function GIFMessage(message) {\n            this.messageName = \"GIFMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.gifDataSize = message.gifDataSize;\n            this.localPath = message.localPath;\n            this.remoteUrl = message.remoteUrl;\n            this.width = message.width;\n            this.height = message.height;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        GIFMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GIFMessage;\n    })();\n    RongIMLib.GIFMessage = GIFMessage;\n    var SightMessage = (function () {\n        function SightMessage(message) {\n            this.messageName = \"SightMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.sightUrl = message.sightUrl;\n            this.content = message.content;\n            this.duration = message.duration;\n            this.size = message.size;\n            this.name = message.name;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        SightMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SightMessage;\n    })();\n    RongIMLib.SightMessage = SightMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.Logger.reportRTLog();\n            option = option || {};\n            var self = this;\n            var isReconnect = option.isReconnect;\n            var isIgnoreReportStart = option.isIgnoreReportStart;\n            var StartReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_T : RongIMLib.LoggerTag.IM.A_CONN_T;\n            var EndReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_R : RongIMLib.LoggerTag.IM.A_CONN_R;\n            !isIgnoreReportStart && RongIMLib.Logger.writeLog({ tag: StartReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { \"token\": token } });\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = false;\n                        RongIMLib.Logger.loggerCache.userId = data;\n                        RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { desc: 'connection succeeded' } });\n                        self.conversationStatusManager = new RongIMLib.ConversationStatusManager({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data,\n                            server: self\n                        });\n                        self.conversationStatusManager.watchChanged(function (status) {\n                            RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.conversationStatusListeners, function (event) {\n                                event(status);\n                            });\n                        });\n                        self.conversationStatusManager.pull({\n                            isForce: true\n                        });\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { ConnectionState: RongIMLib.ConnectionState.TOKEN_INCORRECT } });\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { code: e } });\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback, null, {\n                                    isIgnoreReportStart: true,\n                                    isReconnect: true\n                                });\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback, null, {\n                            isIgnoreReportStart: true,\n                            isReconnect: true\n                        });\n                    }\n                };\n                handler[key]();\n            }\n            else {\n                var _client = RongIMLib.Bridge._client || {};\n                var _channel = _client.channel || {};\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CRAW_F, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        msg: {\n                            connectionStatus: _channel.connectionStatus\n                        },\n                        action: 'reconnect'\n                    } });\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId\n                                        } });\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId,\n                                            error: errorCode\n                                        } });\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    chatroomId: chatroomId\n                                } });\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: error\n                            } });\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId\n                            } });\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: errcode\n                            } });\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            var encodedContent = messageContent.encode();\n            if (RongIMLib.RongUtil.getByteLength(encodedContent) > RongIMLib.RongIMClient.MaxMessageContentBytes) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);\n                });\n                return;\n            }\n            modules.setContent(encodedContent);\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType, params);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            var self = this;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionStateModifyReq();\n            var userId = RongIMLib.Bridge._client.userId;\n            var time = +new Date();\n            var stateItemModules = [];\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.notificationStatus)) {\n                var isNotDisturbe = statusItem.notificationStatus === RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                stateItemModules.push({\n                    sessionStateType: 1,\n                    value: isNotDisturbe ? '1' : '0'\n                });\n            }\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.isTop)) {\n                stateItemModules.push({\n                    sessionStateType: 2,\n                    value: statusItem.isTop ? '1' : '0'\n                });\n            }\n            var stateModules = {\n                type: type,\n                channelId: targetId,\n                time: time,\n                stateItem: stateItemModules\n            };\n            modules.setVersion(time);\n            modules.setState([stateModules]);\n            RongIMLib.RongIMClient.bridge.queryMsg('setSeAtt', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var time = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    statusItem.updateTime = time;\n                    statusItem.isLastInAPull = true;\n                    self.conversationStatusManager.set(type, targetId, statusItem);\n                    setTimeout(function () {\n                        callback.onSuccess(time);\n                    });\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStateModifyResp');\n        };\n        ServerDataProvider.prototype.pullConversationStatus = function (time, callback) {\n            time = time || 0;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionReq();\n            modules.setTime(time);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg('pullSeAtts', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var sessionStateList = result.state, lastTime = result.version;\n                    var sessionLength = sessionStateList.length;\n                    RongIMLib.RongUtil.forEach(sessionStateList, function (state, index) {\n                        var type = state.type, targetId = state.channelId, updateTime = state.time, stateItem = state.stateItem;\n                        var isSilent = false, isTop = false;\n                        RongIMLib.RongUtil.forEach(stateItem, function (item) {\n                            var sessionStateType = item.sessionStateType, value = item.value;\n                            if (sessionStateType === 1) {\n                                isSilent = !!Number(value);\n                            }\n                            if (sessionStateType === 2) {\n                                isTop = !!Number(value);\n                            }\n                        });\n                        var isLastInAPull = index === sessionLength - 1;\n                        callback.onStatus(type, targetId, {\n                            notificationStatus: isSilent ? RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB : RongIMLib.ConversationNotificationStatus.NOTIFY,\n                            isTop: isTop,\n                            updateTime: RongIMLib.MessageUtil.int64ToTimestamp(updateTime),\n                            isLastInAPull: isLastInAPull\n                        });\n                    });\n                    callback.onSuccess(RongIMLib.MessageUtil.int64ToTimestamp(lastTime));\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStates');\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            this.addon.setMessageSearchField(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var result = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return result;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (LoggerLevel) {\n        LoggerLevel[LoggerLevel[\"F\"] = 0] = \"F\";\n        LoggerLevel[LoggerLevel[\"E\"] = 1] = \"E\";\n        LoggerLevel[LoggerLevel[\"W\"] = 2] = \"W\";\n        LoggerLevel[LoggerLevel[\"I\"] = 3] = \"I\";\n        LoggerLevel[LoggerLevel[\"D\"] = 4] = \"D\"; //debug\n    })(RongIMLib.LoggerLevel || (RongIMLib.LoggerLevel = {}));\n    var LoggerLevel = RongIMLib.LoggerLevel;\n    (function (LoggerStoreSize) {\n        LoggerStoreSize[LoggerStoreSize[\"ADVANCED\"] = 500] = \"ADVANCED\";\n        LoggerStoreSize[LoggerStoreSize[\"LOW\"] = 500] = \"LOW\";\n    })(RongIMLib.LoggerStoreSize || (RongIMLib.LoggerStoreSize = {}));\n    var LoggerStoreSize = RongIMLib.LoggerStoreSize;\n    var LoggerType = (function () {\n        function LoggerType() {\n        }\n        LoggerType.IM = 'IM';\n        LoggerType.RTC = 'RTC';\n        return LoggerType;\n    })();\n    RongIMLib.LoggerType = LoggerType;\n    var LoggerTag = (function () {\n        function LoggerTag() {\n        }\n        /**\n         * 三段式关键字: \"发起方-任务类型-结果类型\"\n         * A: App 层，L: Lib 层，N: 调用 Native 层接口，P: Protocol 层\n         * O: 操作，S: 状态，T: 任务，R: 结果，E: 错误\n         */\n        LoggerTag.IM = {\n            A_INIT_O: 'A-init-O',\n            A_CONN_T: 'A-connect-T',\n            A_CONN_R: 'A-connect-R',\n            L_RECO_T: 'L-reconnect-T',\n            L_RECO_R: 'L-reconnect-R',\n            L_GETN_T: 'L-get_navi-T',\n            L_GETN_R: 'L-get_navi-R',\n            L_PING_WS_T: 'L-ping_ws-T',\n            L_PING_WS_R: 'L-ping_ws-R',\n            L_NETC_S: 'L-network_changed-S',\n            A_DISC_O: 'A-disconnect-O',\n            A_JCTR_T: 'A-join_chatroom-T',\n            A_JCTR_R: 'A-join_chatroom-R',\n            A_QCTR_T: 'A-quit_chatroom-T',\n            A_QCTR_R: 'A-quit_chatroom-R',\n            L_CRAW_F: 'L-crash_web-F',\n            G_CRAW_E: 'G-crash-E',\n            G_UP_LOG_S: 'G-upload_log-S',\n            G_UP_LOG_E: 'G-upload_log-E'\n        };\n        return LoggerTag;\n    })();\n    RongIMLib.LoggerTag = LoggerTag;\n    var LoggerReportType = (function () {\n        function LoggerReportType() {\n        }\n        LoggerReportType.REAL_TIME_LOG = 'RealTimeLog';\n        LoggerReportType.MSG_NOTIF_LOG = 'MessageNotificationLog';\n        return LoggerReportType;\n    })();\n    RongIMLib.LoggerReportType = LoggerReportType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Logger = (function () {\n        function Logger() {\n        }\n        Logger.writeLog = function (log) {\n            var self = this;\n            if (RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\") {\n                return;\n            }\n            var networkUnavailable = RongIMLib.RongIMClient._memoryStore.networkUnavailable;\n            var isLowLevelBro = RongIMLib.LoggerUtil.isLowLevelBro();\n            log.time = new Date().getTime();\n            log.sessionId = RongIMLib.LoggerUtil.getSessionId();\n            log.content = log.content && JSON.stringify(log.content);\n            if (networkUnavailable) {\n                if (log.level == RongIMLib.LoggerLevel.E || log.level == RongIMLib.LoggerLevel.W) {\n                    log.level = RongIMLib.LoggerLevel.I;\n                }\n            }\n            self.logStore.push(log);\n            var _handleOverflowLog = function (size) {\n                if (self.logStore.length > size) {\n                    var delLength = self.logStore.length - size;\n                    self.logStore.splice(0, delLength);\n                }\n            };\n            if (isLowLevelBro) {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.LOW);\n            }\n            else {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.ADVANCED);\n            }\n        };\n        Logger.reportRTLog = function () {\n            var self = this;\n            if (self.loggerCache.hasStarted) {\n                return;\n            }\n            self.loggerCache.hasStarted = true;\n            var policy = this.defaultLogPolicy;\n            var isDefaultUpload = true;\n            var currentTime = 1;\n            var _robustUpload = function () {\n                var isOpen = policy.logSwitch;\n                var itv = policy.itv * 1000;\n                var times = policy.times;\n                var url = policy.url;\n                var level = policy.level;\n                var realItv = itv * Math.pow(2, currentTime - 1);\n                if (currentTime < times) {\n                    currentTime++;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: level, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: url, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    if (self.loggerCache.isNewNavi) {\n                        currentTime = 1;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        self.loggerCache.isNewNavi = false;\n                    }\n                    if (isDefaultUpload) {\n                        currentTime = 1;\n                        isDefaultUpload = false;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy(); // 更新 navi 中配置下次用\n                    }\n                    if (csvLog.length == 0) {\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        _robustUpload();\n                        return;\n                    }\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: policy.timeout * 1000,\n                        success: function (data) {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log'\n                                } });\n                            //第一次成功后，如果导航有数据使用导航数据，导航无数据关闭上传。第二次上传成功后返回数据使用返回数据\n                            if (!isOpen) {\n                                return;\n                            }\n                            if (data) {\n                                data = JSON.parse(data);\n                                policy.itv = data.nextTime;\n                                policy.level = data.level;\n                                policy.logSwitch = data.logSwitch;\n                                currentTime = 1;\n                            }\n                            _robustUpload();\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, realItv);\n            };\n            _robustUpload();\n        };\n        Logger.reportMNLog = function (policy) {\n            var self = this;\n            var currentTime = 1;\n            var connectTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n            if (policy.platform !== 'Web' || policy.logId === self.loggerCache.logId) {\n                return;\n            }\n            self.loggerCache.logId = policy.logId;\n            var _robustUpload = function () {\n                var itv = 5000;\n                var times = 3;\n                itv = itv * Math.pow(2, currentTime - 2);\n                if (currentTime === 1) {\n                    itv = 0;\n                }\n                if (currentTime <= times) {\n                    currentTime++;\n                }\n                else {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: RongIMLib.LoggerLevel.D, startTime: policy.startTime, endTime: policy.endTime, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    if (csvLog.length === 0 && policy.endTime < connectTime) {\n                        //没有日志且连接时间大于日志消息结束时间，说明此日志消息过期，无需上传\n                        return;\n                    }\n                    else if (csvLog.length === 0 && policy.endTime > connectTime) {\n                        //没有日志且连接时间小于日志消息结束时间，说明用户连接时间在需要获取的时间内,没有日志上传 nodata\n                        csvLog = 'nodata';\n                    }\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: policy.uri, logId: policy.logId, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: self.defaultLogPolicy.timeout * 1000,\n                        success: function () {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log'\n                                } });\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, itv);\n            };\n            _robustUpload();\n        };\n        Logger.logStore = [];\n        Logger.defaultLogPolicy = {\n            \"logSwitch\": 1,\n            \"url\": 'logcollection.ronghub.com/',\n            \"level\": RongIMLib.LoggerLevel.E,\n            \"itv\": 20,\n            \"times\": 5,\n            \"timeout\": 15\n        };\n        Logger.loggerCache = {\n            userId: '',\n            logId: 'none',\n            isNewNavi: false,\n            hasStarted: false\n        };\n        return Logger;\n    })();\n    RongIMLib.Logger = Logger;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LoggerUtil = (function () {\n        function LoggerUtil() {\n        }\n        LoggerUtil.isLowLevelBro = function () {\n            var flag = false;\n            var bro = RongIMLib.RongUtil.getBrower();\n            if (bro.type == 'IE' && bro.version < 9) {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.isRealTimeLogType = function (type) {\n            return type === RongIMLib.LoggerReportType.REAL_TIME_LOG;\n        };\n        LoggerUtil.handleLog = function (conf) {\n            var self = this;\n            var csvLog = '';\n            var logs = RongIMLib.Logger.logStore;\n            var lastIndex = 0;\n            if (self.isRealTimeLogType(conf.type)) {\n                RongIMLib.RongUtil.forEach(logs, function (log, index) {\n                    if (log.time > self.lastTime && log.level <= conf.level) {\n                        csvLog += self.genCSVLog(log);\n                        lastIndex = index;\n                    }\n                });\n                if (csvLog.length !== 0) {\n                    self.lastTime = logs[lastIndex].time;\n                }\n            }\n            else {\n                RongIMLib.RongUtil.forEach(logs, function (log) {\n                    if (log.level <= conf.level && log.time >= conf.startTime && log.time <= conf.endTime) {\n                        csvLog += self.genCSVLog(log);\n                    }\n                });\n            }\n            return csvLog;\n        };\n        LoggerUtil.getNaviPolicy = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            var fullNavi = navi && JSON.parse(navi);\n            var policy = {};\n            var logPolicy = fullNavi.logPolicy;\n            var logSwitch = fullNavi.logSwitch;\n            policy = logPolicy && JSON.parse(logPolicy);\n            policy.logSwitch = logSwitch;\n            return policy;\n        };\n        LoggerUtil.genDeviceId = function () {\n            var deviceId = '';\n            var key = 'deviceId';\n            var isSupportLS = RongIMLib.RongUtil.supportLocalStorage();\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            var loggerStorage;\n            if (isSupportLS) {\n                loggerStorage = new RongIMLib.LocalStorageProvider();\n            }\n            else if (isSupportSS) {\n                loggerStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                loggerStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasDeviceId = loggerStorage.getItem(key);\n            if (hasDeviceId) {\n                deviceId = loggerStorage.getItem(key);\n            }\n            else {\n                loggerStorage.removeItem(key);\n                var uuid = RongIMLib.RongUtil.getUUID22();\n                loggerStorage.setItem(key, uuid);\n                deviceId = uuid;\n            }\n            return deviceId;\n        };\n        LoggerUtil.getSessionId = function () {\n            var sessionId = '';\n            var key = 'sessionId';\n            var sessionStorage;\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            if (isSupportSS) {\n                sessionStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                sessionStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasSessionId = sessionStorage.getItem(key);\n            if (hasSessionId) {\n                sessionId = sessionStorage.getItem(key);\n            }\n            else {\n                sessionStorage.removeItem(key);\n                var val = RongIMLib.RongUtil.getUUID22();\n                sessionStorage.setItem(key, val);\n                sessionId = val;\n            }\n            return sessionId;\n        };\n        LoggerUtil.getDeviceInfo = function () {\n            var self = this;\n            var browerInfo = RongIMLib.RongUtil.getBrower();\n            var sessionId = self.getSessionId().slice(0, 10);\n            var infoTpl = '{brower}|{version}|{sessionId}';\n            return RongIMLib.RongUtil.tplEngine(infoTpl, {\n                brower: browerInfo.type,\n                version: browerInfo.version,\n                sessionId: sessionId\n            });\n        };\n        LoggerUtil.getEntireUrl = function (opt) {\n            var self = this;\n            var tLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var mLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var entireUrl = '';\n            var protocol = \"https://\";\n            if (location.protocol == \"http:\") {\n                protocol = \"http://\";\n            }\n            var paramObj = {\n                protocol: protocol,\n                url: opt.url,\n                version: RongIMLib.RongIMClient.sdkver || 'Unknown version',\n                appkey: RongIMLib.RongIMClient._memoryStore.appKey || 'Unknown appkey',\n                deviceId: self.genDeviceId(),\n                deviceInfo: self.getDeviceInfo(),\n                platform: 'Web',\n                userId: RongIMLib.Logger.loggerCache.userId || ''\n            };\n            if (self.isRealTimeLogType(opt.type)) {\n                entireUrl = RongIMLib.RongUtil.tplEngine(tLogTpl, paramObj);\n            }\n            else {\n                entireUrl = RongIMLib.RongUtil.tplEngine(mLogTpl, RongIMLib.RongUtil.extend(paramObj, {\n                    logId: opt.logId\n                }));\n            }\n            return entireUrl;\n        };\n        LoggerUtil.genCSVLog = function (log) {\n            var tpl = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n            if (log.content) {\n                var content = '\"' + log.content.replace(/\\\"/g, '\"\"') + '\"';\n            }\n            var csvLog = RongIMLib.RongUtil.tplEngine(tpl, {\n                sessionId: log.sessionId,\n                time: log.time,\n                type: log.type,\n                level: log.level,\n                tag: log.tag,\n                content: content || '\"\"'\n            });\n            return csvLog;\n        };\n        LoggerUtil.isLogCmdMsg = function (message) {\n            var flag = false;\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"LogCommandMessage\"] && message.senderUserId === 'rongcloudsystem') {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.recordFatalLogOfNavi = function (internalRetry, navigators) {\n            if (internalRetry === 3) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                        desc: 'Request navigation failed 3 times',\n                        navigators: navigators\n                    } });\n            }\n        };\n        LoggerUtil.lastTime = 0;\n        return LoggerUtil;\n    })();\n    RongIMLib.LoggerUtil = LoggerUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var sessionStorageProvider = (function () {\n        function sessionStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n        }\n        sessionStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.setItem(composedKey, object);\n            }\n        };\n        sessionStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return sessionStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return '';\n        };\n        sessionStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        sessionStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        sessionStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.removeItem(composedKey.toString());\n            }\n        };\n        sessionStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in sessionStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        sessionStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(sessionStorage).length;\n        };\n        return sessionStorageProvider;\n    })();\n    RongIMLib.sessionStorageProvider = sessionStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback, null, {\n                                    isIgnoreReportStart: true\n                                });\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function' || typeof XDomainRequest == 'object';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var body = opts.body;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var timeout = opts.timeout;\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            if (timeout) {\n                xhr.timeout = timeout;\n            }\n            if (body) {\n                xhr.send(body);\n                return xhr;\n            }\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.getLocalProtocol = function () {\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol === 'https:') {\n                return 'https://';\n            }\n            else {\n                return 'http://';\n            }\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getValidNavi = function (naviHost) {\n            var HttpProtocol = RongIMLib.RongIMClient.HttpProtocol;\n            var flag = '://';\n            var index = naviHost.indexOf(flag);\n            var hasProtocol = index > -1;\n            var navi = naviHost;\n            if (!hasProtocol) {\n                var protocol = RongIMLib.RongIMClient.getProtocol().protocol;\n                navi = protocol + naviHost;\n            }\n            var naviProtocol = RongUtil.getUrlProtocol(navi), localProtocol = RongUtil.getLocalProtocol();\n            // 本地为 https, 但却传入 http 时, 强制转化为 https\n            if (naviProtocol === HttpProtocol.http && localProtocol === 'https://') {\n                navi = RongUtil.formatProtoclPath({\n                    path: navi,\n                    tmpl: '{0}{1}',\n                    protocol: HttpProtocol.https,\n                    sub: true\n                });\n            }\n            return navi;\n        };\n        RongUtil.getUrlProtocol = function (url) {\n            var flag = '://';\n            var index = url.indexOf(flag);\n            if (index > -1) {\n                return url.substring(0, index + flag.length);\n            }\n            else {\n                return 'https://';\n            }\n            ;\n        };\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        RongUtil.supportSessionStorage = function () {\n            var support = false;\n            if (typeof sessionStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    sessionStorage.setItem(key, value);\n                    var localVal = sessionStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('sessionStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.getBrower = function () {\n            var userAgent = navigator.userAgent;\n            var version;\n            var type;\n            /* 记录各浏览器名字和匹配条件 */\n            var condition = {\n                IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n                Edge: /Edge\\/([\\d.]+)/,\n                Firefox: /Firefox\\/([\\d.]+)/,\n                Opera: /(?:OPERA|OPR).([\\d.]+)/,\n                WeChat: /MicroMessenger\\/([\\d.]+)/,\n                QQBrowser: /QQBrowser\\/([\\d.]+)/,\n                Chrome: /Chrome\\/([\\d.]+)/,\n                Safari: /Version\\/([\\d.]+).*Safari/,\n                iOSChrome: /Mobile\\/([\\d.]+).*Safari/\n            };\n            for (var key in condition) {\n                if (!condition.hasOwnProperty(key))\n                    continue;\n                var browserContent;\n                if (browserContent = userAgent.match(condition[key])) {\n                    type = key;\n                    version = browserContent[1] || browserContent[2];\n                    break;\n                }\n            }\n            return {\n                type: type || 'UnKonw',\n                version: version || 'UnKonw'\n            };\n        };\n        RongUtil.string10to64 = function (number) {\n            var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''), radix = chars.length + 1, qutient = +number, arr = [];\n            do {\n                var mod = qutient % radix;\n                qutient = (qutient - mod) / radix;\n                arr.unshift(chars[mod]);\n            } while (qutient);\n            return arr.join('');\n        };\n        RongUtil.getUUID = function () {\n            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n                var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n                return v.toString(16);\n            });\n        };\n        /* 获取 22 位的 UUID */\n        RongUtil.getUUID22 = function () {\n            var uuid = this.getUUID();\n            uuid = uuid.replace(/-/g, '') + 'a';\n            uuid = parseInt(uuid, 16);\n            uuid = this.string10to64(uuid);\n            if (uuid.length > 22) {\n                uuid = uuid.slice(0, 22);\n            }\n            if (uuid.length < 22) {\n                var len = 22 - uuid.length;\n                for (var i = 0; i < len; i++) {\n                    uuid = uuid + '0';\n                }\n            }\n            return uuid;\n        };\n        RongUtil.getByteLength = function (str, charset) {\n            charset = charset || 'utf-8';\n            var total = 0, chatCode;\n            if (charset === 'utf-16') {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode <= 0xffff) {\n                        total += 2;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            else {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode < 0x007f) {\n                        total += 1;\n                    }\n                    else if (chatCode <= 0x07ff) {\n                        total += 2;\n                    }\n                    else if (chatCode <= 0xffff) {\n                        total += 3;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            return total;\n        };\n        RongUtil.concat = function (before, after, isDedup) {\n            RongUtil.forEach(after, function (item) {\n                if (!isDedup || RongUtil.indexOf(before, item) === -1) {\n                    before.push(item);\n                }\n            });\n            return before;\n        };\n        RongUtil.Prosumer = Prosumer;\n        RongUtil.Storage = {\n            set: function (key, value) {\n                try {\n                    RongIMLib.RongIMClient._storageProvider.setItem(key, JSON.stringify(value));\n                }\n                catch (e) { }\n            },\n            get: function (key) {\n                var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n                try {\n                    return JSON.parse(value);\n                }\n                catch (e) {\n                    return {};\n                }\n            }\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n    var Base64 = (function () {\n        function Base64() {\n        }\n        Base64.utf8_encode = function (string) {\n            string = string.replace(/\\r\\n/g, \"\\n\");\n            var utftext = \"\";\n            for (var n = 0; n < string.length; n++) {\n                var c = string.charCodeAt(n);\n                if (c < 128) {\n                    utftext += String.fromCharCode(c);\n                }\n                else if ((c > 127) && (c < 2048)) {\n                    utftext += String.fromCharCode((c >> 6) | 192);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n                else {\n                    utftext += String.fromCharCode((c >> 12) | 224);\n                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n            }\n            return utftext;\n        };\n        Base64.utf8_decode = function (utftext) {\n            var string = \"\";\n            var i = 0;\n            var c = 0, c1 = 0, c2 = 0, c3;\n            while (i < utftext.length) {\n                c = utftext.charCodeAt(i);\n                if (c < 128) {\n                    string += String.fromCharCode(c);\n                    i++;\n                }\n                else if ((c > 191) && (c < 224)) {\n                    c2 = utftext.charCodeAt(i + 1);\n                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n                    i += 2;\n                }\n                else {\n                    c2 = utftext.charCodeAt(i + 1);\n                    c3 = utftext.charCodeAt(i + 2);\n                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n                    i += 3;\n                }\n            }\n            return string;\n        };\n        Base64.encode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = this.utf8_encode(input);\n            while (i < input.length) {\n                chr1 = input.charCodeAt(i++);\n                chr2 = input.charCodeAt(i++);\n                chr3 = input.charCodeAt(i++);\n                enc1 = chr1 >> 2;\n                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n                enc4 = chr3 & 63;\n                if (isNaN(chr2)) {\n                    enc3 = enc4 = 64;\n                }\n                else if (isNaN(chr3)) {\n                    enc4 = 64;\n                }\n                output = output +\n                    this.keyStr.charAt(enc1) + this.keyStr.charAt(enc2) +\n                    this.keyStr.charAt(enc3) + this.keyStr.charAt(enc4);\n            }\n            return output;\n        };\n        Base64.decode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3;\n            var enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n            while (i < input.length) {\n                enc1 = this.keyStr.indexOf(input.charAt(i++));\n                enc2 = this.keyStr.indexOf(input.charAt(i++));\n                enc3 = this.keyStr.indexOf(input.charAt(i++));\n                enc4 = this.keyStr.indexOf(input.charAt(i++));\n                chr1 = (enc1 << 2) | (enc2 >> 4);\n                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n                chr3 = ((enc3 & 3) << 6) | enc4;\n                output = output + String.fromCharCode(chr1);\n                if (enc3 != 64) {\n                    output = output + String.fromCharCode(chr2);\n                }\n                if (enc4 != 64) {\n                    output = output + String.fromCharCode(chr3);\n                }\n            }\n            output = this.utf8_decode(output);\n            return output;\n        };\n        Base64.keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n        return Base64;\n    })();\n    RongIMLib.Base64 = Base64;\n    var TextCompressor = (function () {\n        function TextCompressor() {\n        }\n        TextCompressor.compress = function (data) {\n            var self = this;\n            var map = {};\n            //构建一个用于反向查询字符位置的 map\n            for (var p = 0; p < data.length - 1; p++) {\n                var c1 = data.charAt(p);\n                var c2 = data.charAt(p + 1);\n                var c = c1 + c2;\n                if (!map.hasOwnProperty(c)) {\n                    map[c] = [p];\n                    continue;\n                }\n                map[c].push(p);\n            }\n            var compressedData = [], normalBlockBuffer = [];\n            //编码未压缩数据块\n            var encodeNormalBlock = function () {\n                if (normalBlockBuffer.length > 0) {\n                    var normalBlock = normalBlockBuffer.join('');\n                    normalBlockBuffer = [];\n                    if (normalBlock.length > 26) {\n                        var normalExtBlockLength = self.numberEncode(normalBlock.length);\n                        var normalExtBlockHeader = String.fromCharCode(self.dataType.NormalExt | normalExtBlockLength.length);\n                        compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n                    }\n                    else {\n                        var normalBlockHeader = String.fromCharCode(self.dataType.Normal | normalBlock.length);\n                        compressedData.push(normalBlockHeader);\n                    }\n                    compressedData.push(normalBlock);\n                }\n            };\n            var i = 0;\n            while (i < data.length) {\n                var r = self.indexOf(map, data, i);\n                if (r.length < 2) {\n                    normalBlockBuffer.push(data.charAt(i++));\n                    continue;\n                }\n                if (r.length < 4) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                var offset = self.numberEncode(i - r.offset);\n                var length = self.numberEncode(r.length);\n                //欲压缩的数据与数据编码后的长度一致，则不进行压缩\n                if (offset.length + length.length >= r.length) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                //编码未压缩数据块\n                encodeNormalBlock();\n                //编码压缩数据块\n                var compressedBlockHeader = String.fromCharCode(self.dataType.Compressed | (offset.length << 2) | length.length);\n                compressedData.push(compressedBlockHeader + offset + length);\n                i += r.length;\n            }\n            //编码剩余未压缩数据块\n            encodeNormalBlock();\n            //在数据尾部添加校验和\n            var dataLengthTo62 = self.numberEncode(data.length);\n            var tailBlockHeader = String.fromCharCode(self.dataType.Tail | dataLengthTo62.length);\n            compressedData.push(tailBlockHeader + dataLengthTo62);\n            return compressedData.join('');\n        };\n        TextCompressor.uncompress = function (data) {\n            var self = this;\n            var i = 0;\n            var result = \"\";\n            label1: do {\n                var header = data.charCodeAt(i++);\n                var headerType = header & self.dataType.Mark;\n                var headerVal = header & 0xF;\n                switch (headerType) {\n                    case self.dataType.Compressed:\n                        var p1 = headerVal >> 2;\n                        var p2 = headerVal & 3;\n                        if (p1 == 0 || p2 == 0) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        var offset = self.numberDecode(data.substr(i, p1));\n                        var len = self.numberDecode(data.substr(i += p1, p2));\n                        offset = result.length - offset;\n                        if (offset + len > result.length) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += p2;\n                        result += result.substr(offset, len);\n                        break;\n                    case self.dataType.Tail:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        if (num != result.length) {\n                            console.log(result.length);\n                            console.log(num);\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += headerVal;\n                        break label1;\n                    case self.dataType.NormalExt:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        result += data.substr(i += headerVal, num);\n                        i += num;\n                        break;\n                    case self.dataType.Normal:\n                        result += data.substr(i, headerVal);\n                        i += headerVal;\n                        break;\n                    case self.dataType.Mark:\n                        if (headerVal > 10) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        result += data.substr(i, 16 + headerVal);\n                        i += (16 + headerVal);\n                        break;\n                    default:\n                        throw new Error(\"Data parsing error,at \" + i + \" header:\" + headerType);\n                }\n            } while (i < data.length);\n            return result;\n        };\n        TextCompressor.indexOf = function (map, source, fromIndex) {\n            var self = this;\n            var result = {\n                length: 0,\n                offset: -1\n            };\n            var sourceLength = source.length;\n            if (fromIndex >= source.length - 1) {\n                return result;\n            }\n            var c1 = source.charAt(fromIndex);\n            var c2 = source.charAt(fromIndex + 1);\n            var items = map[c1 + c2];\n            if (items[0] == fromIndex) {\n                return result;\n            }\n            var space1 = source.length - fromIndex;\n            var lastChar;\n            for (var i = 0, len = items.length; i < len; i++) {\n                var item = items[i];\n                var space2 = fromIndex - item;\n                if (space2 > self.max) {\n                    continue;\n                }\n                var end = Math.min(space1, space2);\n                if (end <= result.length) {\n                    break;\n                }\n                if (result.length > 2) {\n                    if (source.charAt(item + result.length - 1) != source.charAt(fromIndex + result.length - 1)) {\n                        continue;\n                    }\n                }\n                var m = 2;\n                for (var j = m; j < end; j++) {\n                    if (source.charAt(item + j) == source.charAt(fromIndex + j)) {\n                        m++;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                if (m >= result.length) {\n                    result.length = m;\n                    result.offset = item;\n                }\n            }\n            return result;\n        };\n        /*\n        * 将数字转化为 62 进制字符串。\n        */\n        TextCompressor.numberEncode = function (num) {\n            var self = this;\n            var result = [], remainder = 0;\n            do {\n                remainder = num % self.scale;\n                result.push(self.chars.charAt(remainder));\n                num = (num - remainder) / self.scale;\n            } while (num > 0);\n            return result.join('');\n        };\n        /*\n        * 将 62 进制字符串还原为数字。\n        */\n        TextCompressor.numberDecode = function (str) {\n            var self = this;\n            var num = 0, index = 0;\n            for (var i = str.length - 1; i >= 0; i--) {\n                index = self.chars.indexOf(str.charAt(i));\n                if (index == -1) {\n                    throw new Error(\"decode number error, data is \\\"\" + str + \"\\\"\");\n                }\n                num = num * self.scale + index;\n            }\n            return num;\n        };\n        TextCompressor.dataType = {\n            Tail: 0x30,\n            Compressed: 0x40,\n            NormalExt: 0x50,\n            Normal: 0x60,\n            Mark: 0x70\n        };\n        TextCompressor.chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n        TextCompressor.scale = TextCompressor.chars.length;\n        TextCompressor.max = 238327;\n        return TextCompressor;\n    })();\n    RongIMLib.TextCompressor = TextCompressor;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "api-test-v2/lib/js/es6-promise.js",
    "content": "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){\"use strict\";function t(t){var e=typeof t;return null!==t&&(\"object\"===e||\"function\"===e)}function e(t){return\"function\"==typeof t}function n(t){W=t}function r(t){z=t}function o(){return function(){return process.nextTick(a)}}function i(){return\"undefined\"!=typeof U?function(){U(a)}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode(\"\");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<N;t+=2){var e=Q[t],n=Q[t+1];e(n),Q[t]=void 0,Q[t+1]=void 0}N=0}function f(){try{var t=Function(\"return this\")().require(\"vertx\");return U=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(v);void 0===r[V]&&x(r);var o=n._state;if(o){var i=arguments[o-1];z(function(){return T(o,r,i,n._result)})}else j(n,r,t,e);return r}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var n=new e(v);return w(n,t),n}function v(){}function p(){return new TypeError(\"You cannot resolve a promise with itself\")}function d(){return new TypeError(\"A promises callback cannot return that same promise.\")}function _(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function y(t,e,n){z(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n))},function(e){r||(r=!0,S(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!r&&o&&(r=!0,S(t,o))},t)}function m(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)})}function b(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void 0===r?A(t,n):e(r)?y(t,n,r):A(t,n)}function w(e,n){if(e===n)S(e,p());else if(t(n)){var r=void 0;try{r=n.then}catch(o){return void S(e,o)}b(e,n,r)}else A(e,n)}function g(t){t._onerror&&t._onerror(t._result),E(t)}function A(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t))}function S(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t))}function j(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t)}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?T(n,r,o,i):o(i);t._subscribers.length=0}}function T(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o)}catch(a){c=!1,u=a}if(n===s)return void S(n,d())}else s=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s))}function M(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(n){S(t,n)}}function P(){return tt++}function x(t){t[V]=tt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function C(){return new Error(\"Array Methods must be provided an Array\")}function O(t){return new et(this,t).promise}function k(t){var e=this;return new e(L(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function F(t){var e=this,n=new e(v);return S(n,t),n}function Y(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function q(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function D(){var t=void 0;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(e){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if(\"[object Promise]\"===r&&!n.cast)return}t.Promise=nt}var K=void 0;K=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var L=K,N=0,U=void 0,W=void 0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R())},B=\"undefined\"!=typeof window?window:void 0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),J=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,Q=new Array(1e3),R=void 0;R=I?o():H?s():J?u():void 0===B&&\"function\"==typeof require?f():c();var V=Math.random().toString(36).substring(2),X=void 0,Z=1,$=2,tt=0,et=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(v),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C())}return t.prototype._enumerate=function(t){for(var e=0;this._state===X&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(u){s=!0,i=u}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=t;else if(n===nt){var c=new n(v);s?S(c,i):b(c,t,o),this._willSettleAt(c,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){return n._settledAt(Z,e,t)},function(t){return n._settledAt($,e,t)})},t}(),nt=function(){function t(e){this[V]=P(),this._result=this._state=void 0,this._subscribers=[],v!==e&&(\"function\"!=typeof e&&Y(),this instanceof t?M(this,e):q())}return t.prototype[\"catch\"]=function(t){return this.then(null,t)},t.prototype[\"finally\"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):n.then(t,t)},t}();return nt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt});"
  },
  {
    "path": "api-test-v2/lib/js/vue-2.6.10.js",
    "content": "/*!\n * Vue.js v2.6.11\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){\"use strict\";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return\"string\"==typeof e||\"number\"==typeof e||\"symbol\"==typeof e||\"boolean\"==typeof e}function o(e){return null!==e&&\"object\"==typeof e}var a=Object.prototype.toString;function s(e){return\"[object Object]\"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&\"function\"==typeof e.then&&\"function\"==typeof e.catch}function l(e){return null==e?\"\":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(\",\"),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var d=p(\"slot,component\",!0),v=p(\"key,ref,slot,slot-scope,is\");function h(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():\"\"})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\\B([A-Z])/g,C=g(function(e){return e.replace(w,\"-$1\").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n<e.length;n++)e[n]&&A(t,e[n]);return t}function S(e,t,n){}var T=function(e,t,n){return!1},E=function(e){return e};function N(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every(function(e,n){return N(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every(function(n){return N(e[n],t[n])})}catch(e){return!1}}function j(e,t){for(var n=0;n<e.length;n++)if(N(e[n],t))return n;return-1}function D(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var L=\"data-server-rendered\",M=[\"component\",\"directive\",\"filter\"],I=[\"beforeCreate\",\"created\",\"beforeMount\",\"mounted\",\"beforeUpdate\",\"updated\",\"beforeDestroy\",\"destroyed\",\"activated\",\"deactivated\",\"errorCaptured\",\"serverPrefetch\"],F={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:S,parsePlatformTagName:E,mustUseProp:T,async:!0,_lifecycleHooks:I},P=/a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;function R(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H=new RegExp(\"[^\"+P.source+\".$_\\\\d]\");var B,U=\"__proto__\"in{},z=\"undefined\"!=typeof window,V=\"undefined\"!=typeof WXEnvironment&&!!WXEnvironment.platform,K=V&&WXEnvironment.platform.toLowerCase(),J=z&&window.navigator.userAgent.toLowerCase(),q=J&&/msie|trident/.test(J),W=J&&J.indexOf(\"msie 9.0\")>0,Z=J&&J.indexOf(\"edge/\")>0,G=(J&&J.indexOf(\"android\"),J&&/iphone|ipad|ipod|ios/.test(J)||\"ios\"===K),X=(J&&/chrome\\/\\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\\/(\\d+)/)),Y={}.watch,Q=!1;if(z)try{var ee={};Object.defineProperty(ee,\"passive\",{get:function(){Q=!0}}),window.addEventListener(\"test-passive\",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!z&&!V&&\"undefined\"!=typeof global&&(global.process&&\"server\"===global.process.env.VUE_ENV)),B},ne=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return\"function\"==typeof e&&/native code/.test(e.toString())}var ie,oe=\"undefined\"!=typeof Symbol&&re(Symbol)&&\"undefined\"!=typeof Reflect&&re(Reflect.ownKeys);ie=\"undefined\"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},ce.target=null;var ue=[];function le(e){ue.push(e),ce.target=e}function fe(){ue.pop(),ce.target=ue[ue.length-1]}var pe=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},de={child:{configurable:!0}};de.child.get=function(){return this.componentInstance},Object.defineProperties(pe.prototype,de);var ve=function(e){void 0===e&&(e=\"\");var t=new pe;return t.text=e,t.isComment=!0,t};function he(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){var t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ye=Array.prototype,ge=Object.create(ye);[\"push\",\"pop\",\"shift\",\"unshift\",\"splice\",\"sort\",\"reverse\"].forEach(function(e){var t=ye[e];R(ge,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case\"push\":case\"unshift\":i=n;break;case\"splice\":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var _e=Object.getOwnPropertyNames(ge),be=!0;function $e(e){be=e}var we=function(e){var t;this.value=e,this.dep=new ce,this.vmCount=0,R(e,\"__ob__\",this),Array.isArray(e)?(U?(t=ge,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];R(e,o,t[o])}}(e,ge,_e),this.observeArray(e)):this.walk(e)};function Ce(e,t){var n;if(o(e)&&!(e instanceof pe))return y(e,\"__ob__\")&&e.__ob__ instanceof we?n=e.__ob__:be&&!te()&&(Array.isArray(e)||s(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new we(e)),t&&n&&n.vmCount++,n}function xe(e,t,n,r,i){var o=new ce,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Ce(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return ce.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Ce(t),o.notify())}})}}function ke(e,t,n){if(Array.isArray(e)&&c(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(xe(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Ae(e,t){if(Array.isArray(e)&&c(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||y(e,t)&&(delete e[t],n&&n.dep.notify())}}we.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)xe(e,t[n])},we.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ce(e[t])};var Oe=F.optionMergeStrategies;function Se(e,t){if(!t)return e;for(var n,r,i,o=oe?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)\"__ob__\"!==(n=o[a])&&(r=e[n],i=t[n],y(e,n)?r!==i&&s(r)&&s(i)&&Se(r,i):ke(e,n,i));return e}function Te(e,t,n){return n?function(){var r=\"function\"==typeof t?t.call(n,n):t,i=\"function\"==typeof e?e.call(n,n):e;return r?Se(r,i):i}:t?e?function(){return Se(\"function\"==typeof t?t.call(this,this):t,\"function\"==typeof e?e.call(this,this):e)}:t:e}function Ee(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ne(e,t,n,r){var i=Object.create(e||null);return t?A(i,t):i}Oe.data=function(e,t,n){return n?Te(e,t,n):t&&\"function\"!=typeof t?e:Te(e,t)},I.forEach(function(e){Oe[e]=Ee}),M.forEach(function(e){Oe[e+\"s\"]=Ne}),Oe.watch=function(e,t,n,r){if(e===Y&&(e=void 0),t===Y&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in A(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Oe.props=Oe.methods=Oe.inject=Oe.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return A(i,e),t&&A(i,t),i},Oe.provide=Te;var je=function(e,t){return void 0===t?e:t};function De(e,t,n){if(\"function\"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)\"string\"==typeof(i=n[r])&&(o[b(i)]={type:null});else if(s(n))for(var a in n)i=n[a],o[b(a)]=s(i)?i:{type:i};e.props=o}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(s(n))for(var o in n){var a=n[o];r[o]=s(a)?A({from:o},a):{from:a}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];\"function\"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=De(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=De(e,t.mixins[r],n);var o,a={};for(o in e)c(o);for(o in t)y(e,o)||c(o);function c(r){var i=Oe[r]||je;a[r]=i(e[r],t[r],n,r)}return a}function Le(e,t,n,r){if(\"string\"==typeof n){var i=e[t];if(y(i,n))return i[n];var o=b(n);if(y(i,o))return i[o];var a=$(o);return y(i,a)?i[a]:i[n]||i[o]||i[a]}}function Me(e,t,n,r){var i=t[e],o=!y(n,e),a=n[e],s=Pe(Boolean,i.type);if(s>-1)if(o&&!y(i,\"default\"))a=!1;else if(\"\"===a||a===C(e)){var c=Pe(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(!y(t,\"default\"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return\"function\"==typeof r&&\"Function\"!==Ie(t.type)?r.call(e):r}(r,i,e);var u=be;$e(!0),Ce(a),$e(u)}return a}function Ie(e){var t=e&&e.toString().match(/^\\s*function (\\w+)/);return t?t[1]:\"\"}function Fe(e,t){return Ie(e)===Ie(t)}function Pe(e,t){if(!Array.isArray(t))return Fe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Fe(t[n],e))return n;return-1}function Re(e,t,n){le();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){Be(e,r,\"errorCaptured hook\")}}Be(e,t,n)}finally{fe()}}function He(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&u(o)&&!o._handled&&(o.catch(function(e){return Re(e,r,i+\" (Promise/async)\")}),o._handled=!0)}catch(e){Re(e,r,i)}return o}function Be(e,t,n){if(F.errorHandler)try{return F.errorHandler.call(null,e,t,n)}catch(t){t!==e&&Ue(t,null,\"config.errorHandler\")}Ue(e,t,n)}function Ue(e,t,n){if(!z&&!V||\"undefined\"==typeof console)throw e;console.error(e)}var ze,Ve=!1,Ke=[],Je=!1;function qe(){Je=!1;var e=Ke.slice(0);Ke.length=0;for(var t=0;t<e.length;t++)e[t]()}if(\"undefined\"!=typeof Promise&&re(Promise)){var We=Promise.resolve();ze=function(){We.then(qe),G&&setTimeout(S)},Ve=!0}else if(q||\"undefined\"==typeof MutationObserver||!re(MutationObserver)&&\"[object MutationObserverConstructor]\"!==MutationObserver.toString())ze=\"undefined\"!=typeof setImmediate&&re(setImmediate)?function(){setImmediate(qe)}:function(){setTimeout(qe,0)};else{var Ze=1,Ge=new MutationObserver(qe),Xe=document.createTextNode(String(Ze));Ge.observe(Xe,{characterData:!0}),ze=function(){Ze=(Ze+1)%2,Xe.data=String(Ze)},Ve=!0}function Ye(e,t){var n;if(Ke.push(function(){if(e)try{e.call(t)}catch(e){Re(e,t,\"nextTick\")}else n&&n(t)}),Je||(Je=!0,ze()),!e&&\"undefined\"!=typeof Promise)return new Promise(function(e){n=e})}var Qe=new ie;function et(e){!function e(t,n){var r,i;var a=Array.isArray(t);if(!a&&!o(t)||Object.isFrozen(t)||t instanceof pe)return;if(t.__ob__){var s=t.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(a)for(r=t.length;r--;)e(t[r],n);else for(i=Object.keys(t),r=i.length;r--;)e(t[i[r]],n)}(e,Qe),Qe.clear()}var tt=g(function(e){var t=\"&\"===e.charAt(0),n=\"~\"===(e=t?e.slice(1):e).charAt(0),r=\"!\"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function nt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return He(r,null,arguments,t,\"v-on handler\");for(var i=r.slice(),o=0;o<i.length;o++)He(i[o],null,e,t,\"v-on handler\")}return n.fns=e,n}function rt(e,n,i,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=n[c],f=tt(c),t(u)||(t(l)?(t(u.fns)&&(u=e[c]=nt(u,s)),r(f.once)&&(u=e[c]=a(f.name,u,f.capture)),i(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in n)t(e[c])&&o((f=tt(c)).name,n[c],f.capture)}function it(e,i,o){var a;e instanceof pe&&(e=e.data.hook||(e.data.hook={}));var s=e[i];function c(){o.apply(this,arguments),h(a.fns,c)}t(s)?a=nt([c]):n(s.fns)&&r(s.merged)?(a=s).fns.push(c):a=nt([s,c]),a.merged=!0,e[i]=a}function ot(e,t,r,i,o){if(n(t)){if(y(t,r))return e[r]=t[r],o||delete t[r],!0;if(y(t,i))return e[r]=t[i],o||delete t[i],!0}return!1}function at(e){return i(e)?[he(e)]:Array.isArray(e)?function e(o,a){var s=[];var c,u,l,f;for(c=0;c<o.length;c++)t(u=o[c])||\"boolean\"==typeof u||(l=s.length-1,f=s[l],Array.isArray(u)?u.length>0&&(st((u=e(u,(a||\"\")+\"_\"+c))[0])&&st(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?st(f)?s[l]=he(f.text+u):\"\"!==u&&s.push(he(u)):st(u)&&st(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key=\"__vlist\"+a+\"_\"+c+\"__\"),s.push(u)));return s}(e):void 0}function st(e){return n(e)&&n(e.text)&&!1===e.isComment}function ct(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if(\"__ob__\"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&y(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&\"default\"in e[o]){var c=e[o].default;n[o]=\"function\"==typeof c?c.call(t):c}}}return n}}function ut(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);\"template\"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(lt)&&delete n[u];return n}function lt(e){return e.isComment&&!e.asyncFactory||\" \"===e.text}function ft(t,n,r){var i,o=Object.keys(n).length>0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&\"$\"!==c[0]&&(i[c]=pt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=dt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,\"$stable\",a),R(i,\"$key\",s),R(i,\"$hasNormal\",o),i}function pt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&\"object\"==typeof e&&!Array.isArray(e)?[e]:at(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function dt(e,t){return function(){return e[t]}}function vt(e,t){var r,i,a,s,c;if(Array.isArray(e)||\"string\"==typeof e)for(r=new Array(e.length),i=0,a=e.length;i<a;i++)r[i]=t(e[i],i);else if(\"number\"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=t(i+1,i);else if(o(e))if(oe&&e[Symbol.iterator]){r=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)r.push(t(l.value,r.length)),l=u.next()}else for(s=Object.keys(e),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=t(e[c],c,i);return n(r)||(r=[]),r._isVList=!0,r}function ht(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=A(A({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement(\"template\",{slot:a},i):i}function mt(e){return Le(this.$options,\"filters\",e)||E}function yt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function gt(e,t,n,r,i){var o=F.keyCodes[t]||n;return i&&r&&!F.keyCodes[t]?yt(i,r):o?yt(o,e):r?C(r)!==t:void 0}function _t(e,t,n,r,i){if(n)if(o(n)){var a;Array.isArray(n)&&(n=O(n));var s=function(o){if(\"class\"===o||\"style\"===o||v(o))a=e;else{var s=e.attrs&&e.attrs.type;a=r||F.mustUseProp(t,s,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=b(o),u=C(o);c in a||u in a||(a[o]=n[o],i&&((e.on||(e.on={}))[\"update:\"+o]=function(e){n[o]=e}))};for(var c in n)s(c)}else;return e}function bt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(wt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),\"__static__\"+e,!1),r)}function $t(e,t,n){return wt(e,\"__once__\"+t+(n?\"_\"+n:\"\"),!0),e}function wt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&\"string\"!=typeof e[r]&&Ct(e[r],t+\"_\"+r,n);else Ct(e,t,n)}function Ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function xt(e,t){if(t)if(s(t)){var n=e.on=e.on?A({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function kt(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?kt(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function At(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];\"string\"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Ot(e,t){return\"string\"==typeof e?t+e:e}function St(e){e._o=$t,e._n=f,e._s=l,e._l=vt,e._t=ht,e._q=N,e._i=j,e._m=bt,e._f=mt,e._k=gt,e._b=_t,e._v=he,e._e=ve,e._u=kt,e._g=xt,e._d=At,e._p=Ot}function Tt(t,n,i,o,a){var s,c=this,u=a.options;y(o,\"_uid\")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=r(u._compiled),f=!l;this.data=t,this.props=n,this.children=i,this.parent=o,this.listeners=t.on||e,this.injections=ct(u.inject,o),this.slots=function(){return c.$slots||ft(t.scopedSlots,c.$slots=ut(i,o)),c.$slots},Object.defineProperty(this,\"scopedSlots\",{enumerable:!0,get:function(){return ft(t.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=ft(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Pt(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Pt(s,e,t,n,r,f)}}function Et(e,t,n,r,i){var o=me(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Nt(e,t){for(var n in t)e[b(n)]=t[n]}St(Tt.prototype);var jt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;jt.prepatch(r,r)}else{(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;n(i)&&(r.render=i.render,r.staticRenderFns=i.staticRenderFns);return new e.componentOptions.Ctor(r)}(e,Wt)).$mount(t?e.elm:void 0,t)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,i,o){var a=i.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),u=!!(o||t.$options._renderChildren||c);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){$e(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=t.$options.props;l[d]=Me(d,v,n,t)}$e(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,qt(t,r,h),u&&(t.$slots=ut(o,i.context),t.$forceUpdate())}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Yt(r,\"mounted\")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,en.push(t)):Xt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(n&&(t._directInactive=!0,Gt(t)))return;if(!t._inactive){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);Yt(t,\"deactivated\")}}(t,!0):t.$destroy())}},Dt=Object.keys(jt);function Lt(i,a,s,c,l){if(!t(i)){var f=s.$options._base;if(o(i)&&(i=f.extend(i)),\"function\"==typeof i){var p;if(t(i.cid)&&void 0===(i=function(e,i){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var a=Ht;a&&n(e.owners)&&-1===e.owners.indexOf(a)&&e.owners.push(a);if(r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(a&&!n(e.owners)){var s=e.owners=[a],c=!0,l=null,f=null;a.$on(\"hook:destroyed\",function(){return h(s,a)});var p=function(e){for(var t=0,n=s.length;t<n;t++)s[t].$forceUpdate();e&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==f&&(clearTimeout(f),f=null))},d=D(function(t){e.resolved=Bt(t,i),c?s.length=0:p(!0)}),v=D(function(t){n(e.errorComp)&&(e.error=!0,p(!0))}),m=e(d,v);return o(m)&&(u(m)?t(e.resolved)&&m.then(d,v):u(m.component)&&(m.component.then(d,v),n(m.error)&&(e.errorComp=Bt(m.error,i)),n(m.loading)&&(e.loadingComp=Bt(m.loading,i),0===m.delay?e.loading=!0:l=setTimeout(function(){l=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,p(!1))},m.delay||200)),n(m.timeout)&&(f=setTimeout(function(){f=null,t(e.resolved)&&v(null)},m.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(p=i,f)))return function(e,t,n,r,i){var o=ve();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(p,a,s,c,l);a=a||{},$n(i),n(a.model)&&function(e,t){var r=e.model&&e.model.prop||\"value\",i=e.model&&e.model.event||\"input\";(t.attrs||(t.attrs={}))[r]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;n(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}(i.options,a);var d=function(e,r,i){var o=r.options.props;if(!t(o)){var a={},s=e.attrs,c=e.props;if(n(s)||n(c))for(var u in o){var l=C(u);ot(a,c,u,l,!0)||ot(a,s,u,l,!1)}return a}}(a,i);if(r(i.options.functional))return function(t,r,i,o,a){var s=t.options,c={},u=s.props;if(n(u))for(var l in u)c[l]=Me(l,u,r||e);else n(i.attrs)&&Nt(c,i.attrs),n(i.props)&&Nt(c,i.props);var f=new Tt(i,c,a,o,t),p=s.render.call(null,f._c,f);if(p instanceof pe)return Et(p,i,f.parent,s);if(Array.isArray(p)){for(var d=at(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Et(d[h],i,f.parent,s);return v}}(i,d,a,s,c);var v=a.on;if(a.on=a.nativeOn,r(i.options.abstract)){var m=a.slot;a={},m&&(a.slot=m)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Dt.length;n++){var r=Dt[n],i=t[r],o=jt[r];i===o||i&&i._merged||(t[r]=i?Mt(o,i):o)}}(a);var y=i.options.name||l;return new pe(\"vue-component-\"+i.cid+(y?\"-\"+y:\"\"),a,void 0,void 0,void 0,s,{Ctor:i,propsData:d,listeners:v,tag:l,children:c},p)}}}function Mt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}var It=1,Ft=2;function Pt(e,a,s,c,u,l){return(Array.isArray(s)||i(s))&&(u=c,c=s,s=void 0),r(l)&&(u=Ft),function(e,i,a,s,c){if(n(a)&&n(a.__ob__))return ve();n(a)&&n(a.is)&&(i=a.is);if(!i)return ve();Array.isArray(s)&&\"function\"==typeof s[0]&&((a=a||{}).scopedSlots={default:s[0]},s.length=0);c===Ft?s=at(s):c===It&&(s=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(s));var u,l;if(\"string\"==typeof i){var f;l=e.$vnode&&e.$vnode.ns||F.getTagNamespace(i),u=F.isReservedTag(i)?new pe(F.parsePlatformTagName(i),a,s,void 0,void 0,e):a&&a.pre||!n(f=Le(e.$options,\"components\",i))?new pe(i,a,s,void 0,void 0,e):Lt(f,a,e,s,i)}else u=Lt(i,a,e,s);return Array.isArray(u)?u:n(u)?(n(l)&&function e(i,o,a){i.ns=o;\"foreignObject\"===i.tag&&(o=void 0,a=!0);if(n(i.children))for(var s=0,c=i.children.length;s<c;s++){var u=i.children[s];n(u.tag)&&(t(u.ns)||r(a)&&\"svg\"!==u.tag)&&e(u,o,a)}}(u,l),n(a)&&function(e){o(e.style)&&et(e.style);o(e.class)&&et(e.class)}(a),u):ve()}(e,a,s,c,u)}var Rt,Ht=null;function Bt(e,t){return(e.__esModule||oe&&\"Module\"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function Ut(e){return e.isComment&&e.asyncFactory}function zt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||Ut(r)))return r}}function Vt(e,t){Rt.$on(e,t)}function Kt(e,t){Rt.$off(e,t)}function Jt(e,t){var n=Rt;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function qt(e,t,n){Rt=e,rt(t,n||{},Vt,Kt,Jt,e),Rt=void 0}var Wt=null;function Zt(e){var t=Wt;return Wt=e,function(){Wt=t}}function Gt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Xt(e,t){if(t){if(e._directInactive=!1,Gt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Xt(e.$children[n]);Yt(e,\"activated\")}}function Yt(e,t){le();var n=e.$options[t],r=t+\" hook\";if(n)for(var i=0,o=n.length;i<o;i++)He(n[i],e,null,e,r);e._hasHookEvent&&e.$emit(\"hook:\"+t),fe()}var Qt=[],en=[],tn={},nn=!1,rn=!1,on=0;var an=0,sn=Date.now;if(z&&!q){var cn=window.performance;cn&&\"function\"==typeof cn.now&&sn()>document.createEvent(\"Event\").timeStamp&&(sn=function(){return cn.now()})}function un(){var e,t;for(an=sn(),rn=!0,Qt.sort(function(e,t){return e.id-t.id}),on=0;on<Qt.length;on++)(e=Qt[on]).before&&e.before(),t=e.id,tn[t]=null,e.run();var n=en.slice(),r=Qt.slice();on=Qt.length=en.length=0,tn={},nn=rn=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Xt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Yt(r,\"updated\")}}(r),ne&&F.devtools&&ne.emit(\"flush\")}var ln=0,fn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ln,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ie,this.newDepIds=new ie,this.expression=\"\",\"function\"==typeof t?this.getter=t:(this.getter=function(e){if(!H.test(e)){var t=e.split(\".\");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=S)),this.value=this.lazy?void 0:this.get()};fn.prototype.get=function(){var e;le(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Re(e,t,'getter for watcher \"'+this.expression+'\"')}finally{this.deep&&et(e),fe(),this.cleanupDeps()}return e},fn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},fn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},fn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==tn[t]){if(tn[t]=!0,rn){for(var n=Qt.length-1;n>on&&Qt[n].id>e.id;)n--;Qt.splice(n+1,0,e)}else Qt.push(e);nn||(nn=!0,Ye(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher \"'+this.expression+'\"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:S,set:S};function dn(e,t,n){pn.get=function(){return this[t][n]},pn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,pn)}function vn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);xe(r,o,a),o in e||dn(e,\"_props\",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=\"function\"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data=\"function\"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return Re(e,t,\"data()\"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+\"\").charCodeAt(0))&&95!==a&&dn(e,\"_data\",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a=\"function\"==typeof o?o:o.get;r||(n[i]=new fn(e,a||S,S,hn)),i in e||mn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)_n(e,n,r[i]);else _n(e,n,r)}}(e,t.watch)}var hn={lazy:!0};function mn(e,t,n){var r=!te();\"function\"==typeof n?(pn.get=r?yn(t):gn(n),pn.set=S):(pn.get=n.get?r&&!1!==n.cache?yn(t):gn(n.get):S,pn.set=n.set||S),Object.defineProperty(e,t,pn)}function yn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ce.target&&t.depend(),t.value}}function gn(e){return function(){return e.call(this,this)}}function _n(e,t,n,r){return s(n)&&(r=n,n=n.handler),\"string\"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var bn=0;function $n(e){var t=e.options;if(e.super){var n=$n(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&A(e.extendOptions,r),(t=e.options=De(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function wn(e){this._init(e)}function Cn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=De(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)dn(e.prototype,\"_props\",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,M.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=A({},a.options),i[r]=a,a}}function xn(e){return e&&(e.Ctor.options.name||e.tag)}function kn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:\"string\"==typeof e?e.split(\",\").indexOf(t)>-1:(n=e,\"[object RegExp]\"===a.call(n)&&e.test(t));var n}function An(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=xn(a.componentOptions);s&&!t(s)&&On(n,o,r,i)}}}function On(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=bn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De($n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ut(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,\"$attrs\",o&&o.attrs||e,null,!0),xe(t,\"$listeners\",n._parentListeners||e,null,!0)}(n),Yt(n,\"beforeCreate\"),function(e){var t=ct(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),vn(n),function(e){var t=e.$options.provide;t&&(e._provided=\"function\"==typeof t?t.call(e):t)}(n),Yt(n,\"created\"),n.$options.el&&n.$mount(n.$options.el)}}(wn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,\"$data\",t),Object.defineProperty(e.prototype,\"$props\",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher \"'+r.expression+'\"')}return function(){r.teardown()}}}(wn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?k(t):t;for(var n=k(arguments,1),r='event handler for \"'+e+'\"',i=0,o=t.length;i<o;i++)He(t[i],this,n,this,r)}return this}}(wn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=Zt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Yt(e,\"beforeDestroy\"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||h(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Yt(e,\"destroyed\"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(wn),function(e){St(e.prototype),e.prototype.$nextTick=function(e){return Ye(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=ft(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Ht=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){Re(n,t,\"render\"),e=t._vnode}finally{Ht=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof pe||(e=ve()),e.parent=i,e}}(wn);var Sn=[String,RegExp,Array],Tn={KeepAlive:{name:\"keep-alive\",abstract:!0,props:{include:Sn,exclude:Sn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)On(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch(\"include\",function(t){An(e,function(e){return kn(t,e)})}),this.$watch(\"exclude\",function(t){An(e,function(e){return!kn(t,e)})})},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=xn(n),i=this.include,o=this.exclude;if(i&&(!r||!kn(i,r))||o&&r&&kn(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?\"::\"+n.tag:\"\"):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&On(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,\"config\",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Ye,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),M.forEach(function(t){e.options[t+\"s\"]=Object.create(null)}),e.options._base=e,A(e.options.components,Tn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),\"function\"==typeof e.install?e.install.apply(e,n):\"function\"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Cn(e),function(e){M.forEach(function(t){e[t]=function(e,n){return n?(\"component\"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),\"directive\"===t&&\"function\"==typeof n&&(n={bind:n,update:n}),this.options[t+\"s\"][e]=n,n):this.options[t+\"s\"][e]}})}(e)}(wn),Object.defineProperty(wn.prototype,\"$isServer\",{get:te}),Object.defineProperty(wn.prototype,\"$ssrContext\",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wn,\"FunctionalRenderContext\",{value:Tt}),wn.version=\"2.6.11\";var En=p(\"style,class\"),Nn=p(\"input,textarea,option,select,progress\"),jn=function(e,t,n){return\"value\"===n&&Nn(e)&&\"button\"!==t||\"selected\"===n&&\"option\"===e||\"checked\"===n&&\"input\"===e||\"muted\"===n&&\"video\"===e},Dn=p(\"contenteditable,draggable,spellcheck\"),Ln=p(\"events,caret,typing,plaintext-only\"),Mn=function(e,t){return Hn(t)||\"false\"===t?\"false\":\"contenteditable\"===e&&Ln(t)?t:\"true\"},In=p(\"allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible\"),Fn=\"http://www.w3.org/1999/xlink\",Pn=function(e){return\":\"===e.charAt(5)&&\"xlink\"===e.slice(0,5)},Rn=function(e){return Pn(e)?e.slice(6,e.length):\"\"},Hn=function(e){return null==e||!1===e};function Bn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Un(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Un(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Vn(t));return\"\"}(t.staticClass,t.class)}function Un(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+\" \"+t:e:t||\"\"}function Vn(e){return Array.isArray(e)?function(e){for(var t,r=\"\",i=0,o=e.length;i<o;i++)n(t=Vn(e[i]))&&\"\"!==t&&(r&&(r+=\" \"),r+=t);return r}(e):o(e)?function(e){var t=\"\";for(var n in e)e[n]&&(t&&(t+=\" \"),t+=n);return t}(e):\"string\"==typeof e?e:\"\"}var Kn={svg:\"http://www.w3.org/2000/svg\",math:\"http://www.w3.org/1998/Math/MathML\"},Jn=p(\"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot\"),qn=p(\"svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view\",!0),Wn=function(e){return Jn(e)||qn(e)};function Zn(e){return qn(e)?\"svg\":\"math\"===e?\"math\":void 0}var Gn=Object.create(null);var Xn=p(\"text,number,password,search,email,tel,url\");function Yn(e){if(\"string\"==typeof e){var t=document.querySelector(e);return t||document.createElement(\"div\")}return e}var Qn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return\"select\"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute(\"multiple\",\"multiple\"),n)},createElementNS:function(e,t){return document.createElementNS(Kn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,\"\")}}),er={create:function(e,t){tr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(tr(e,!0),tr(t))},destroy:function(e){tr(e,!0)}};function tr(e,t){var r=e.data.ref;if(n(r)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[r])?h(a[r],o):a[r]===o&&(a[r]=void 0):e.data.refInFor?Array.isArray(a[r])?a[r].indexOf(o)<0&&a[r].push(o):a[r]=[o]:a[r]=o}}var nr=new pe(\"\",{},[]),rr=[\"create\",\"activate\",\"update\",\"remove\",\"destroy\"];function ir(e,i){return e.key===i.key&&(e.tag===i.tag&&e.isComment===i.isComment&&n(e.data)===n(i.data)&&function(e,t){if(\"input\"!==e.tag)return!0;var r,i=n(r=e.data)&&n(r=r.attrs)&&r.type,o=n(r=t.data)&&n(r=r.attrs)&&r.type;return i===o||Xn(i)&&Xn(o)}(e,i)||r(e.isAsyncPlaceholder)&&e.asyncFactory===i.asyncFactory&&t(i.asyncFactory.error))}function or(e,t,r){var i,o,a={};for(i=t;i<=r;++i)n(o=e[i].key)&&(a[o]=i);return a}var ar={create:sr,update:sr,destroy:function(e){sr(e,nr)}};function sr(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===nr,a=t===nr,s=ur(e.data.directives,e.context),c=ur(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,fr(i,\"update\",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(fr(i,\"bind\",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)fr(u[n],\"inserted\",t,e)};o?it(t,\"insert\",f):f()}l.length&&it(t,\"postpatch\",function(){for(var n=0;n<l.length;n++)fr(l[n],\"componentUpdated\",t,e)});if(!o)for(n in s)c[n]||fr(s[n],\"unbind\",e,e,a)}(e,t)}var cr=Object.create(null);function ur(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=cr),i[lr(r)]=r,r.def=Le(t.$options,\"directives\",r.name);return i}function lr(e){return e.rawName||e.name+\".\"+Object.keys(e.modifiers||{}).join(\".\")}function fr(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){Re(r,n.context,\"directive \"+e.name+\" \"+t+\" hook\")}}var pr=[er,ar];function dr(e,r){var i=r.componentOptions;if(!(n(i)&&!1===i.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var o,a,s=r.elm,c=e.data.attrs||{},u=r.data.attrs||{};for(o in n(u.__ob__)&&(u=r.data.attrs=A({},u)),u)a=u[o],c[o]!==a&&vr(s,o,a);for(o in(q||Z)&&u.value!==c.value&&vr(s,\"value\",u.value),c)t(u[o])&&(Pn(o)?s.removeAttributeNS(Fn,Rn(o)):Dn(o)||s.removeAttribute(o))}}function vr(e,t,n){e.tagName.indexOf(\"-\")>-1?hr(e,t,n):In(t)?Hn(n)?e.removeAttribute(t):(n=\"allowfullscreen\"===t&&\"EMBED\"===e.tagName?\"true\":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Mn(t,n)):Pn(t)?Hn(n)?e.removeAttributeNS(Fn,Rn(t)):e.setAttributeNS(Fn,t,n):hr(e,t,n)}function hr(e,t,n){if(Hn(n))e.removeAttribute(t);else{if(q&&!W&&\"TEXTAREA\"===e.tagName&&\"placeholder\"===t&&\"\"!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener(\"input\",r)};e.addEventListener(\"input\",r),e.__ieph=!0}e.setAttribute(t,n)}}var mr={create:dr,update:dr};function yr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Bn(r),c=i._transitionClasses;n(c)&&(s=zn(s,Vn(c))),s!==i._prevClass&&(i.setAttribute(\"class\",s),i._prevClass=s)}}var gr,_r,br,$r,wr,Cr,xr={create:yr,update:yr},kr=/[\\w).+\\-_$\\]]/;function Ar(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&\" \"===(h=e.charAt(v));v--);h&&kr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Or(i,o[r]);return i}function Or(e,t){var n=t.indexOf(\"(\");if(n<0)return'_f(\"'+t+'\")('+e+\")\";var r=t.slice(0,n),i=t.slice(n+1);return'_f(\"'+r+'\")('+e+(\")\"!==i?\",\"+i:i)}function Sr(e,t){console.error(\"[Vue compiler]: \"+e)}function Tr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Er(e,t,n,r,i){(e.props||(e.props=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Nr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function jr(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Rr({name:t,value:n},r))}function Dr(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Rr({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Lr(e,t,n){return n?\"_p(\"+t+',\"'+e+'\")':e+t}function Mr(t,n,r,i,o,a,s,c){var u;(i=i||e).right?c?n=\"(\"+n+\")==='click'?'contextmenu':(\"+n+\")\":\"click\"===n&&(n=\"contextmenu\",delete i.right):i.middle&&(c?n=\"(\"+n+\")==='click'?'mouseup':(\"+n+\")\":\"click\"===n&&(n=\"mouseup\")),i.capture&&(delete i.capture,n=Lr(\"!\",n,c)),i.once&&(delete i.once,n=Lr(\"~\",n,c)),i.passive&&(delete i.passive,n=Lr(\"&\",n,c)),i.native?(delete i.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var l=Rr({value:r.trim(),dynamic:c},s);i!==e&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,t.plain=!1}function Ir(e,t,n){var r=Fr(e,\":\"+t)||Fr(e,\"v-bind:\"+t);if(null!=r)return Ar(r);if(!1!==n){var i=Fr(e,t);if(null!=i)return JSON.stringify(i)}}function Fr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Pr(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Rr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Hr(e,t,n){var r=n||{},i=r.number,o=\"$$v\";r.trim&&(o=\"(typeof $$v === 'string'? $$v.trim(): $$v)\"),i&&(o=\"_n(\"+o+\")\");var a=Br(t,o);e.model={value:\"(\"+t+\")\",expression:JSON.stringify(t),callback:\"function ($$v) {\"+a+\"}\"}}function Br(e,t){var n=function(e){if(e=e.trim(),gr=e.length,e.indexOf(\"[\")<0||e.lastIndexOf(\"]\")<gr-1)return($r=e.lastIndexOf(\".\"))>-1?{exp:e.slice(0,$r),key:'\"'+e.slice($r+1)+'\"'}:{exp:e,key:null};_r=e,$r=wr=Cr=0;for(;!zr();)Vr(br=Ur())?Jr(br):91===br&&Kr(br);return{exp:e.slice(0,wr),key:e.slice(wr+1,Cr)}}(e);return null===n.key?e+\"=\"+t:\"$set(\"+n.exp+\", \"+n.key+\", \"+t+\")\"}function Ur(){return _r.charCodeAt(++$r)}function zr(){return $r>=gr}function Vr(e){return 34===e||39===e}function Kr(e){var t=1;for(wr=$r;!zr();)if(Vr(e=Ur()))Jr(e);else if(91===e&&t++,93===e&&t--,0===t){Cr=$r;break}}function Jr(e){for(var t=e;!zr()&&(e=Ur())!==t;);}var qr,Wr=\"__r\",Zr=\"__c\";function Gr(e,t,n){var r=qr;return function i(){null!==t.apply(null,arguments)&&Qr(e,i,n,r)}}var Xr=Ve&&!(X&&Number(X[1])<=53);function Yr(e,t,n,r){if(Xr){var i=an,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}qr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function Qr(e,t,n,r){(r||qr).removeEventListener(e,t._wrapper||t,n)}function ei(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};qr=r.elm,function(e){if(n(e[Wr])){var t=q?\"change\":\"input\";e[t]=[].concat(e[Wr],e[t]||[]),delete e[Wr]}n(e[Zr])&&(e.change=[].concat(e[Zr],e.change||[]),delete e[Zr])}(i),rt(i,o,Yr,Qr,Gr,r.context),qr=void 0}}var ti,ni={create:ei,update:ei};function ri(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]=\"\");for(i in c){if(o=c[i],\"textContent\"===i||\"innerHTML\"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if(\"value\"===i&&\"PROGRESS\"!==a.tagName){a._value=o;var u=t(o)?\"\":String(o);ii(a,u)&&(a.value=u)}else if(\"innerHTML\"===i&&qn(a.tagName)&&t(a.innerHTML)){(ti=ti||document.createElement(\"div\")).innerHTML=\"<svg>\"+o+\"</svg>\";for(var l=ti.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function ii(e,t){return!e.composing&&(\"OPTION\"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var oi={create:ri,update:ri},ai=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function si(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?O(e):\"string\"==typeof e?ai(e):e}var ui,li=/^--/,fi=/\\s*!important$/,pi=function(e,t,n){if(li.test(t))e.style.setProperty(t,n);else if(fi.test(n))e.style.setProperty(C(t),n.replace(fi,\"\"),\"important\");else{var r=vi(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},di=[\"Webkit\",\"Moz\",\"ms\"],vi=g(function(e){if(ui=ui||document.createElement(\"div\").style,\"filter\"!==(e=b(e))&&e in ui)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<di.length;n++){var r=di[n]+t;if(r in ui)return r}});function hi(e,r){var i=r.data,o=e.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=ci(r.data.style)||{};r.data.normalizedStyle=n(p.__ob__)?A({},p):p;var d=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=si(i.data))&&A(r,n);(n=si(e.data))&&A(r,n);for(var o=e;o=o.parent;)o.data&&(n=si(o.data))&&A(r,n);return r}(r,!0);for(s in f)t(d[s])&&pi(c,s,\"\");for(s in d)(a=d[s])!==f[s]&&pi(c,s,null==a?\"\":a)}}var mi={create:hi,update:hi},yi=/\\s+/;function gi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(yi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \";n.indexOf(\" \"+t+\" \")<0&&e.setAttribute(\"class\",(n+t).trim())}}function _i(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(yi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute(\"class\");else{for(var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \",r=\" \"+t+\" \";n.indexOf(r)>=0;)n=n.replace(r,\" \");(n=n.trim())?e.setAttribute(\"class\",n):e.removeAttribute(\"class\")}}function bi(e){if(e){if(\"object\"==typeof e){var t={};return!1!==e.css&&A(t,$i(e.name||\"v\")),A(t,e),t}return\"string\"==typeof e?$i(e):void 0}}var $i=g(function(e){return{enterClass:e+\"-enter\",enterToClass:e+\"-enter-to\",enterActiveClass:e+\"-enter-active\",leaveClass:e+\"-leave\",leaveToClass:e+\"-leave-to\",leaveActiveClass:e+\"-leave-active\"}}),wi=z&&!W,Ci=\"transition\",xi=\"animation\",ki=\"transition\",Ai=\"transitionend\",Oi=\"animation\",Si=\"animationend\";wi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ki=\"WebkitTransition\",Ai=\"webkitTransitionEnd\"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi=\"WebkitAnimation\",Si=\"webkitAnimationEnd\"));var Ti=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ti(function(){Ti(e)})}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gi(e,t))}function ji(e,t){e._transitionClasses&&h(e._transitionClasses,t),_i(e,t)}function Di(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ci?Ai:Si,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var Li=/\\b(transform|all)(,|$)/;function Mi(e,t){var n,r=window.getComputedStyle(e),i=(r[ki+\"Delay\"]||\"\").split(\", \"),o=(r[ki+\"Duration\"]||\"\").split(\", \"),a=Ii(i,o),s=(r[Oi+\"Delay\"]||\"\").split(\", \"),c=(r[Oi+\"Duration\"]||\"\").split(\", \"),u=Ii(s,c),l=0,f=0;return t===Ci?a>0&&(n=Ci,l=a,f=o.length):t===xi?u>0&&(n=xi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ci:xi:null)?n===Ci?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ci&&Li.test(r[ki+\"Property\"])}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Fi(t)+Fi(e[n])}))}function Fi(e){return 1e3*Number(e.slice(0,-1).replace(\",\",\".\"))}function Pi(e,r){var i=e.elm;n(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=bi(e.data.transition);if(!t(a)&&!n(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,l=a.enterToClass,p=a.enterActiveClass,d=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,$=a.appear,w=a.afterAppear,C=a.appearCancelled,x=a.duration,k=Wt,A=Wt.$vnode;A&&A.parent;)k=A.context,A=A.parent;var O=!k._isMounted||!e.isRootInsert;if(!O||$||\"\"===$){var S=O&&d?d:u,T=O&&h?h:p,E=O&&v?v:l,N=O&&b||m,j=O&&\"function\"==typeof $?$:y,L=O&&w||g,M=O&&C||_,I=f(o(x)?x.enter:x),F=!1!==s&&!W,P=Bi(j),R=i._enterCb=D(function(){F&&(ji(i,E),ji(i,T)),R.cancelled?(F&&ji(i,S),M&&M(i)):L&&L(i),i._enterCb=null});e.data.show||it(e,\"insert\",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),j&&j(i,R)}),N&&N(i),F&&(Ni(i,S),Ni(i,T),Ei(function(){ji(i,S),R.cancelled||(Ni(i,E),P||(Hi(I)?setTimeout(R,I):Di(i,c,R)))})),e.data.show&&(r&&r(),j&&j(i,R)),F||P||R()}}}function Ri(e,r){var i=e.elm;n(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var a=bi(e.data.transition);if(t(a)||1!==i.nodeType)return r();if(!n(i._leaveCb)){var s=a.css,c=a.type,u=a.leaveClass,l=a.leaveToClass,p=a.leaveActiveClass,d=a.beforeLeave,v=a.leave,h=a.afterLeave,m=a.leaveCancelled,y=a.delayLeave,g=a.duration,_=!1!==s&&!W,b=Bi(v),$=f(o(g)?g.leave:g),w=i._leaveCb=D(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ji(i,l),ji(i,p)),w.cancelled?(_&&ji(i,u),m&&m(i)):(r(),h&&h(i)),i._leaveCb=null});y?y(C):C()}function C(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),d&&d(i),_&&(Ni(i,u),Ni(i,p),Ei(function(){ji(i,u),w.cancelled||(Ni(i,l),b||(Hi($)?setTimeout(w,$):Di(i,c,w)))})),v&&v(i,w),_||b||w())}}function Hi(e){return\"number\"==typeof e&&!isNaN(e)}function Bi(e){if(t(e))return!1;var r=e.fns;return n(r)?Bi(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function Ui(e,t){!0!==t.data.show&&Pi(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;o<rr.length;++o)for(s[rr[o]]=[],a=0;a<c.length;++a)n(c[a][rr[o]])&&s[rr[o]].push(c[a][rr[o]]);function l(e){var t=u.parentNode(e);n(t)&&u.removeChild(t,e)}function f(e,t,i,o,a,c,l){if(n(e.elm)&&n(c)&&(e=c[l]=me(e)),e.isRootInsert=!a,!function(e,t,i,o){var a=e.data;if(n(a)){var c=n(e.componentInstance)&&a.keepAlive;if(n(a=a.hook)&&n(a=a.init)&&a(e,!1),n(e.componentInstance))return d(e,t),v(i,e.elm,o),r(c)&&function(e,t,r,i){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,n(o=a.data)&&n(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](nr,a);t.push(a);break}v(r,e.elm,i)}(e,t,i,o),!0}}(e,t,i,o)){var f=e.data,p=e.children,m=e.tag;n(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),h(e,p,t),n(f)&&y(e,t),v(i,e.elm,o)):r(e.isComment)?(e.elm=u.createComment(e.text),v(i,e.elm,o)):(e.elm=u.createTextNode(e.text),v(i,e.elm,o))}}function d(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,m(e)?(y(e,t),g(e)):(tr(e),t.push(e))}function v(e,t,r){n(e)&&(n(r)?u.parentNode(r)===e&&u.insertBefore(e,t,r):u.appendChild(e,t))}function h(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r);else i(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function m(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function y(e,t){for(var r=0;r<s.create.length;++r)s.create[r](nr,e);n(o=e.data.hook)&&(n(o.create)&&o.create(nr,e),n(o.insert)&&t.push(e))}function g(e){var t;if(n(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),r=r.parent;n(t=Wt)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,r,i=e.data;if(n(i))for(n(t=i.hook)&&n(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)b(e.children[r])}function $(e,t,r){for(;t<=r;++t){var i=e[t];n(i)&&(n(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(n(t)||n(e.data)){var r,i=s.remove.length+1;for(n(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&w(r,t),r=0;r<s.remove.length;++r)s.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else l(e.elm)}function C(e,t,r,i){for(var o=r;o<i;o++){var a=t[o];if(n(a)&&ir(e,a))return o}}function x(e,i,o,a,c,l){if(e!==i){n(i.elm)&&n(a)&&(i=a[c]=me(i));var p=i.elm=e.elm;if(r(e.isAsyncPlaceholder))n(i.asyncFactory.resolved)?O(e.elm,i,o):i.isAsyncPlaceholder=!0;else if(r(i.isStatic)&&r(e.isStatic)&&i.key===e.key&&(r(i.isCloned)||r(i.isOnce)))i.componentInstance=e.componentInstance;else{var d,v=i.data;n(v)&&n(d=v.hook)&&n(d=d.prepatch)&&d(e,i);var h=e.children,y=i.children;if(n(v)&&m(i)){for(d=0;d<s.update.length;++d)s.update[d](e,i);n(d=v.hook)&&n(d=d.update)&&d(e,i)}t(i.text)?n(h)&&n(y)?h!==y&&function(e,r,i,o,a){for(var s,c,l,p=0,d=0,v=r.length-1,h=r[0],m=r[v],y=i.length-1,g=i[0],b=i[y],w=!a;p<=v&&d<=y;)t(h)?h=r[++p]:t(m)?m=r[--v]:ir(h,g)?(x(h,g,o,i,d),h=r[++p],g=i[++d]):ir(m,b)?(x(m,b,o,i,y),m=r[--v],b=i[--y]):ir(h,b)?(x(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=r[++p],b=i[--y]):ir(m,g)?(x(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=r[--v],g=i[++d]):(t(s)&&(s=or(r,p,v)),t(c=n(g.key)?s[g.key]:C(g,r,p,v))?f(g,o,e,h.elm,!1,i,d):ir(l=r[c],g)?(x(l,g,o,i,d),r[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,\"\"),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,\"\"):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var A=p(\"attrs,class,staticClass,staticStyle,key\");function O(e,t,i,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(n(c)&&(n(a=c.hook)&&n(a=a.init)&&a(t,!0),n(a=t.componentInstance)))return d(t,i),!0;if(n(s)){if(n(u))if(e.hasChildNodes())if(n(a=c)&&n(a=a.domProps)&&n(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,p=0;p<u.length;p++){if(!f||!O(f,u[p],i,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else h(t,u,i);if(n(c)){var v=!1;for(var m in c)if(!A(m)){v=!0,y(t,i);break}!v&&c.class&&et(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,i,o,a){if(!t(i)){var c,l=!1,p=[];if(t(e))l=!0,f(i,p);else{var d=n(e.nodeType);if(!d&&ir(e,i))x(e,i,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(L)&&(e.removeAttribute(L),o=!0),r(o)&&O(e,i,p))return k(i,p,!0),e;c=e,e=new pe(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,h=u.parentNode(v);if(f(i,p,v._leaveCb?null:h,u.nextSibling(v)),n(i.parent))for(var y=i.parent,g=m(i);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=i.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](nr,y);var C=y.data.hook.insert;if(C.merged)for(var A=1;A<C.fns.length;A++)C.fns[A]()}else tr(y);y=y.parent}n(h)?$([e],0,0):n(e.tag)&&b(e)}}return k(i,p,l),i.elm}n(e)&&b(e)}}({nodeOps:Qn,modules:[mr,xr,ni,oi,mi,z?{create:Ui,activate:Ui,remove:function(e,t){!0!==e.data.show?Ri(e,t):t()}}:{}].concat(pr)});W&&document.addEventListener(\"selectionchange\",function(){var e=document.activeElement;e&&e.vmodel&&Xi(e,\"input\")});var Vi={inserted:function(e,t,n,r){\"select\"===n.tag?(r.elm&&!r.elm._vOptions?it(n,\"postpatch\",function(){Vi.componentUpdated(e,t,n)}):Ki(e,t,n.context),e._vOptions=[].map.call(e.options,Wi)):(\"textarea\"===n.tag||Xn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener(\"compositionstart\",Zi),e.addEventListener(\"compositionend\",Gi),e.addEventListener(\"change\",Gi),W&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if(\"select\"===n.tag){Ki(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Wi);if(i.some(function(e,t){return!N(e,r[t])}))(e.multiple?t.value.some(function(e){return qi(e,i)}):t.value!==t.oldValue&&qi(t.value,i))&&Xi(e,\"change\")}}};function Ki(e,t,n){Ji(e,t,n),(q||Z)&&setTimeout(function(){Ji(e,t,n)},0)}function Ji(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=j(r,Wi(a))>-1,a.selected!==o&&(a.selected=o);else if(N(Wi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function qi(e,t){return t.every(function(t){return!N(t,e)})}function Wi(e){return\"_value\"in e?e._value:e.value}function Zi(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,\"input\"))}function Xi(e,t){var n=document.createEvent(\"HTMLEvents\");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Yi(e){return!e.componentInstance||e.data&&e.data.transition?e:Yi(e.componentInstance._vnode)}var Qi={model:Vi,show:{bind:function(e,t,n){var r=t.value,i=(n=Yi(n)).data&&n.data.transition,o=e.__vOriginalDisplay=\"none\"===e.style.display?\"\":e.style.display;r&&i?(n.data.show=!0,Pi(n,function(){e.style.display=o})):e.style.display=r?o:\"none\"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Yi(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,function(){e.style.display=e.__vOriginalDisplay}):Ri(n,function(){e.style.display=\"none\"})):e.style.display=r?e.__vOriginalDisplay:\"none\")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},eo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function to(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?to(zt(t.children)):e}function no(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function ro(e,t){if(/\\d-keep-alive$/.test(t.tag))return e(\"keep-alive\",{props:t.componentOptions.propsData})}var io=function(e){return e.tag||Ut(e)},oo=function(e){return\"show\"===e.name},ao={name:\"transition\",props:eo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(io)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=to(o);if(!a)return o;if(this._leaving)return ro(e,o);var s=\"__transition-\"+this._uid+\"-\";a.key=null==a.key?a.isComment?s+\"comment\":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=no(this),u=this._vnode,l=to(u);if(a.data.directives&&a.data.directives.some(oo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!Ut(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if(\"out-in\"===r)return this._leaving=!0,it(f,\"afterLeave\",function(){t._leaving=!1,t.$forceUpdate()}),ro(e,o);if(\"in-out\"===r){if(Ut(a))return u;var p,d=function(){p()};it(c,\"afterEnter\",d),it(c,\"enterCancelled\",d),it(f,\"delayLeave\",function(e){p=e})}}return o}}},so=A({tag:String,moveClass:String},eo);function co(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function uo(e){e.data.newPos=e.elm.getBoundingClientRect()}function lo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform=\"translate(\"+r+\"px,\"+i+\"px)\",o.transitionDuration=\"0s\"}}delete so.mode;var fo={Transition:ao,TransitionGroup:{props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||\"span\",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=no(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf(\"__vlist\")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||\"v\")+\"-move\";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(co),e.forEach(uo),e.forEach(lo),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Ni(n,t),r.transform=r.WebkitTransform=r.transitionDuration=\"\",n.addEventListener(Ai,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ai,e),n._moveCb=null,ji(n,t))})}}))},methods:{hasMove:function(e,t){if(!wi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){_i(n,e)}),gi(n,t),n.style.display=\"none\",this.$el.appendChild(n);var r=Mi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};wn.config.mustUseProp=jn,wn.config.isReservedTag=Wn,wn.config.isReservedAttr=En,wn.config.getTagNamespace=Zn,wn.config.isUnknownElement=function(e){if(!z)return!0;if(Wn(e))return!1;if(e=e.toLowerCase(),null!=Gn[e])return Gn[e];var t=document.createElement(e);return e.indexOf(\"-\")>-1?Gn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Gn[e]=/HTMLUnknownElement/.test(t.toString())},A(wn.options.directives,Qi),A(wn.options.components,fo),wn.prototype.__patch__=z?zi:S,wn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Yt(e,\"beforeMount\"),r=function(){e._update(e._render(),n)},new fn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Yt(e,\"beforeUpdate\")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Yt(e,\"mounted\")),e}(this,e=e&&z?Yn(e):void 0,t)},z&&setTimeout(function(){F.devtools&&ne&&ne.emit(\"init\",wn)},0);var po=/\\{\\{((?:.|\\r?\\n)+?)\\}\\}/g,vo=/[-.*+?^${}()|[\\]\\/\\\\]/g,ho=g(function(e){var t=e[0].replace(vo,\"\\\\$&\"),n=e[1].replace(vo,\"\\\\$&\");return new RegExp(t+\"((?:.|\\\\n)+?)\"+n,\"g\")});var mo={staticKeys:[\"staticClass\"],transformNode:function(e,t){t.warn;var n=Fr(e,\"class\");n&&(e.staticClass=JSON.stringify(n));var r=Ir(e,\"class\",!1);r&&(e.classBinding=r)},genData:function(e){var t=\"\";return e.staticClass&&(t+=\"staticClass:\"+e.staticClass+\",\"),e.classBinding&&(t+=\"class:\"+e.classBinding+\",\"),t}};var yo,go={staticKeys:[\"staticStyle\"],transformNode:function(e,t){t.warn;var n=Fr(e,\"style\");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Ir(e,\"style\",!1);r&&(e.styleBinding=r)},genData:function(e){var t=\"\";return e.staticStyle&&(t+=\"staticStyle:\"+e.staticStyle+\",\"),e.styleBinding&&(t+=\"style:(\"+e.styleBinding+\"),\"),t}},_o=function(e){return(yo=yo||document.createElement(\"div\")).innerHTML=e,yo.textContent},bo=p(\"area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr\"),$o=p(\"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source\"),wo=p(\"address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track\"),Co=/^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,xo=/^\\s*((?:v-[\\w-]+:|@|:|#)\\[[^=]+\\][^\\s\"'<>\\/=]*)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,ko=\"[a-zA-Z_][\\\\-\\\\.0-9_a-zA-Z\"+P.source+\"]*\",Ao=\"((?:\"+ko+\"\\\\:)?\"+ko+\")\",Oo=new RegExp(\"^<\"+Ao),So=/^\\s*(\\/?)>/,To=new RegExp(\"^<\\\\/\"+Ao+\"[^>]*>\"),Eo=/^<!DOCTYPE [^>]+>/i,No=/^<!\\--/,jo=/^<!\\[/,Do=p(\"script,style,textarea\",!0),Lo={},Mo={\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&amp;\":\"&\",\"&#10;\":\"\\n\",\"&#9;\":\"\\t\",\"&#39;\":\"'\"},Io=/&(?:lt|gt|quot|amp|#39);/g,Fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Po=p(\"pre,textarea\",!0),Ro=function(e,t){return e&&Po(e)&&\"\\n\"===t[0]};function Ho(e,t){var n=t?Fo:Io;return e.replace(n,function(e){return Mo[e]})}var Bo,Uo,zo,Vo,Ko,Jo,qo,Wo,Zo=/^@|^v-on:/,Go=/^v-|^@|^:|^#/,Xo=/([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/,Yo=/,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/,Qo=/^\\(|\\)$/g,ea=/^\\[.*\\]$/,ta=/:(.*)$/,na=/^:|^\\.|^v-bind:/,ra=/\\.[^.\\]]+(?=[^\\]]*$)/g,ia=/^v-slot(:|$)|^#/,oa=/[\\r\\n]/,aa=/\\s+/g,sa=g(_o),ca=\"_empty_\";function ua(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ma(t),rawAttrsMap:{},parent:n,children:[]}}function la(e,t){Bo=t.warn||Sr,Jo=t.isPreTag||T,qo=t.mustUseProp||T,Wo=t.getTagNamespace||T;t.isReservedTag;zo=Tr(t.modules,\"transformNode\"),Vo=Tr(t.modules,\"preTransformNode\"),Ko=Tr(t.modules,\"postTransformNode\"),Uo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=fa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&da(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&da(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'\"default\"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Jo(e.tag)&&(c=!1);for(var f=0;f<Ko.length;f++)Ko[f](e,t)}function l(e){if(!c)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&\" \"===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||T,s=t.canBeLeftOpenTag||T,c=0;e;){if(n=e,r&&Do(r)){var u=0,l=r.toLowerCase(),f=Lo[l]||(Lo[l]=new RegExp(\"([\\\\s\\\\S]*?)(</\"+l+\"[^>]*>)\",\"i\")),p=e.replace(f,function(e,n,r){return u=r.length,Do(l)||\"noscript\"===l||(n=n.replace(/<!\\--([\\s\\S]*?)-->/g,\"$1\").replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g,\"$1\")),Ro(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),\"\"});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf(\"<\");if(0===d){if(No.test(e)){var v=e.indexOf(\"--\\x3e\");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(jo.test(e)){var h=e.indexOf(\"]>\");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(To);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ro(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(To.test($)||Oo.test($)||No.test($)||jo.test($)||(w=$.indexOf(\"<\",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(Oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(So))&&(r=e.match(xo)||e.match(Co));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&(\"p\"===r&&wo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||\"\",h=\"a\"===n&&\"href\"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:Ho(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function A(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else\"br\"===s?t.start&&t.start(e,[],!0,n,o):\"p\"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Wo(e);q&&\"svg\"===p&&(o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];ya.test(r.name)||(r.name=r.name.replace(ga,\"\"),t.push(r))}return t}(o));var d,v=ua(e,o,r);p&&(v.ns=p),\"style\"!==(d=v).tag&&(\"script\"!==d.tag||d.attrsMap.type&&\"text/javascript\"!==d.attrsMap.type)||te()||(v.forbidden=!0);for(var h=0;h<Vo.length;h++)v=Vo[h](v,t)||v;s||(!function(e){null!=Fr(e,\"v-pre\")&&(e.pre=!0)}(v),v.pre&&(s=!0)),Jo(v.tag)&&(c=!0),s?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(v):v.processed||(pa(v),function(e){var t=Fr(e,\"v-if\");if(t)e.if=t,da(e,{exp:t,block:e});else{null!=Fr(e,\"v-else\")&&(e.else=!0);var n=Fr(e,\"v-else-if\");n&&(e.elseif=n)}}(v),function(e){null!=Fr(e,\"v-once\")&&(e.once=!0)}(v)),n||(n=v),a?u(v):(r=v,i.push(v))},end:function(e,t,n){var o=i[i.length-1];i.length-=1,r=i[i.length-1],u(o)},chars:function(e,t,n){if(r&&(!q||\"textarea\"!==r.tag||r.attrsMap.placeholder!==e)){var i,u,l,f=r.children;if(e=c||e.trim()?\"script\"===(i=r).tag||\"style\"===i.tag?e:sa(e):f.length?a?\"condense\"===a&&oa.test(e)?\"\":\" \":o?\" \":\"\":\"\")c||\"condense\"!==a||(e=e.replace(aa,\" \")),!s&&\" \"!==e&&(u=function(e,t){var n=t?ho(t):po;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Ar(r[1].trim());a.push(\"_s(\"+u+\")\"),s.push({\"@binding\":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join(\"+\"),tokens:s}}}(e,Uo))?l={type:2,expression:u.expression,tokens:u.tokens,text:e}:\" \"===e&&f.length&&\" \"===f[f.length-1].text||(l={type:3,text:e}),l&&f.push(l)}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}function fa(e,t){var n,r;(r=Ir(n=e,\"key\"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Ir(e,\"ref\");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;\"template\"===e.tag?(t=Fr(e,\"scope\"),e.slotScope=t||Fr(e,\"slot-scope\")):(t=Fr(e,\"slot-scope\"))&&(e.slotScope=t);var n=Ir(e,\"slot\");n&&(e.slotTarget='\"\"'===n?'\"default\"':n,e.slotTargetDynamic=!(!e.attrsMap[\":slot\"]&&!e.attrsMap[\"v-bind:slot\"]),\"template\"===e.tag||e.slotScope||Nr(e,\"slot\",n,function(e,t){return e.rawAttrsMap[\":\"+t]||e.rawAttrsMap[\"v-bind:\"+t]||e.rawAttrsMap[t]}(e,\"slot\")));if(\"template\"===e.tag){var r=Pr(e,ia);if(r){var i=va(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||ca}}else{var s=Pr(e,ia);if(s){var c=e.scopedSlots||(e.scopedSlots={}),u=va(s),l=u.name,f=u.dynamic,p=c[l]=ua(\"template\",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||ca,e.children=[],e.plain=!1}}}(e),function(e){\"slot\"===e.tag&&(e.slotName=Ir(e,\"name\"))}(e),function(e){var t;(t=Ir(e,\"is\"))&&(e.component=t);null!=Fr(e,\"inline-template\")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<zo.length;i++)e=zo[i](e,t)||e;return function(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=i=u[t].name,o=u[t].value,Go.test(r))if(e.hasBindings=!0,(a=ha(r.replace(Go,\"\")))&&(r=r.replace(ra,\"\")),na.test(r))r=r.replace(na,\"\"),o=Ar(o),(c=ea.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&\"innerHtml\"===(r=b(r))&&(r=\"innerHTML\"),a.camel&&!c&&(r=b(r)),a.sync&&(s=Br(o,\"$event\"),c?Mr(e,'\"update:\"+('+r+\")\",s,null,!1,0,u[t],!0):(Mr(e,\"update:\"+b(r),s,null,!1,0,u[t]),C(r)!==b(r)&&Mr(e,\"update:\"+C(r),s,null,!1,0,u[t])))),a&&a.prop||!e.component&&qo(e.tag,e.attrsMap.type,r)?Er(e,r,o,u[t],c):Nr(e,r,o,u[t],c);else if(Zo.test(r))r=r.replace(Zo,\"\"),(c=ea.test(r))&&(r=r.slice(1,-1)),Mr(e,r,o,a,!1,0,u[t],c);else{var l=(r=r.replace(Go,\"\")).match(ta),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),ea.test(f)&&(f=f.slice(1,-1),c=!0)),Dr(e,r,i,o,f,c,a,u[t])}else Nr(e,r,JSON.stringify(o),u[t]),!e.component&&\"muted\"===r&&qo(e.tag,e.attrsMap.type,r)&&Er(e,r,\"true\",u[t])}(e),e}function pa(e){var t;if(t=Fr(e,\"v-for\")){var n=function(e){var t=e.match(Xo);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Qo,\"\"),i=r.match(Yo);i?(n.alias=r.replace(Yo,\"\").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&A(e,n)}}function da(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function va(e){var t=e.name.replace(ia,\"\");return t||\"#\"!==e.name[0]&&(t=\"default\"),ea.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'\"'+t+'\"',dynamic:!1}}function ha(e){var t=e.match(ra);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function ma(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var ya=/^xmlns:NS\\d+/,ga=/^NS\\d+:/;function _a(e){return ua(e.tag,e.attrsList.slice(),e.parent)}var ba=[mo,go,{preTransformNode:function(e,t){if(\"input\"===e.tag){var n,r=e.attrsMap;if(!r[\"v-model\"])return;if((r[\":type\"]||r[\"v-bind:type\"])&&(n=Ir(e,\"type\")),r.type||n||!r[\"v-bind\"]||(n=\"(\"+r[\"v-bind\"]+\").type\"),n){var i=Fr(e,\"v-if\",!0),o=i?\"&&(\"+i+\")\":\"\",a=null!=Fr(e,\"v-else\",!0),s=Fr(e,\"v-else-if\",!0),c=_a(e);pa(c),jr(c,\"type\",\"checkbox\"),fa(c,t),c.processed=!0,c.if=\"(\"+n+\")==='checkbox'\"+o,da(c,{exp:c.if,block:c});var u=_a(e);Fr(u,\"v-for\",!0),jr(u,\"type\",\"radio\"),fa(u,t),da(c,{exp:\"(\"+n+\")==='radio'\"+o,block:u});var l=_a(e);return Fr(l,\"v-for\",!0),jr(l,\":type\",n),fa(l,t),da(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}];var $a,wa,Ca={expectHTML:!0,modules:ba,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Hr(e,r,i),!1;if(\"select\"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return '+(n&&n.number?\"_n(val)\":\"val\")+\"});\";r=r+\" \"+Br(t,\"$event.target.multiple ? $$selectedVal : $$selectedVal[0]\"),Mr(e,\"change\",r,null,!0)}(e,r,i);else if(\"input\"===o&&\"checkbox\"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,\"value\")||\"null\",o=Ir(e,\"true-value\")||\"true\",a=Ir(e,\"false-value\")||\"false\";Er(e,\"checked\",\"Array.isArray(\"+t+\")?_i(\"+t+\",\"+i+\")>-1\"+(\"true\"===o?\":(\"+t+\")\":\":_q(\"+t+\",\"+o+\")\")),Mr(e,\"change\",\"var $$a=\"+t+\",$$el=$event.target,$$c=$$el.checked?(\"+o+\"):(\"+a+\");if(Array.isArray($$a)){var $$v=\"+(r?\"_n(\"+i+\")\":i)+\",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&(\"+Br(t,\"$$a.concat([$$v])\")+\")}else{$$i>-1&&(\"+Br(t,\"$$a.slice(0,$$i).concat($$a.slice($$i+1))\")+\")}}else{\"+Br(t,\"$$c\")+\"}\",null,!0)}(e,r,i);else if(\"input\"===o&&\"radio\"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,\"value\")||\"null\";Er(e,\"checked\",\"_q(\"+t+\",\"+(i=r?\"_n(\"+i+\")\":i)+\")\"),Mr(e,\"change\",Br(t,i),null,!0)}(e,r,i);else if(\"input\"===o||\"textarea\"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&\"range\"!==r,u=o?\"change\":\"range\"===r?Wr:\"input\",l=\"$event.target.value\";s&&(l=\"$event.target.value.trim()\"),a&&(l=\"_n(\"+l+\")\");var f=Br(t,l);c&&(f=\"if($event.target.composing)return;\"+f),Er(e,\"value\",\"(\"+t+\")\"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,\"blur\",\"$forceUpdate()\")}(e,r,i);else if(!F.isReservedTag(o))return Hr(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,\"textContent\",\"_s(\"+t.value+\")\",t)},html:function(e,t){t.value&&Er(e,\"innerHTML\",\"_s(\"+t.value+\")\",t)}},isPreTag:function(e){return\"pre\"===e},isUnaryTag:bo,mustUseProp:jn,canBeLeftOpenTag:$o,isReservedTag:Wn,getTagNamespace:Zn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(\",\")}(ba)},xa=g(function(e){return p(\"type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap\"+(e?\",\"+e:\"\"))});function ka(e,t){e&&($a=xa(t.staticKeys||\"\"),wa=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!wa(e.tag)||function(e){for(;e.parent;){if(\"template\"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every($a)))}(t);if(1===t.type){if(!wa(t.tag)&&\"slot\"!==t.tag&&null==t.attrsMap[\"inline-template\"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++){var s=t.ifConditions[o].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++)e(t.ifConditions[o].block,n)}}(e,!1))}var Aa=/^([\\w$_]+|\\([^)]*?\\))\\s*=>|^function(?:\\s+[\\w$]+)?\\s*\\(/,Oa=/\\([^)]*?\\);*$/,Sa=/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?']|\\[\"[^\"]*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*$/,Ta={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:[\"Esc\",\"Escape\"],tab:\"Tab\",enter:\"Enter\",space:[\" \",\"Spacebar\"],up:[\"Up\",\"ArrowUp\"],left:[\"Left\",\"ArrowLeft\"],right:[\"Right\",\"ArrowRight\"],down:[\"Down\",\"ArrowDown\"],delete:[\"Backspace\",\"Delete\",\"Del\"]},Na=function(e){return\"if(\"+e+\")return null;\"},ja={stop:\"$event.stopPropagation();\",prevent:\"$event.preventDefault();\",self:Na(\"$event.target !== $event.currentTarget\"),ctrl:Na(\"!$event.ctrlKey\"),shift:Na(\"!$event.shiftKey\"),alt:Na(\"!$event.altKey\"),meta:Na(\"!$event.metaKey\"),left:Na(\"'button' in $event && $event.button !== 0\"),middle:Na(\"'button' in $event && $event.button !== 1\"),right:Na(\"'button' in $event && $event.button !== 2\")};function Da(e,t){var n=t?\"nativeOn:\":\"on:\",r=\"\",i=\"\";for(var o in e){var a=La(e[o]);e[o]&&e[o].dynamic?i+=o+\",\"+a+\",\":r+='\"'+o+'\":'+a+\",\"}return r=\"{\"+r.slice(0,-1)+\"}\",i?n+\"_d(\"+r+\",[\"+i.slice(0,-1)+\"])\":n+r}function La(e){if(!e)return\"function(){}\";if(Array.isArray(e))return\"[\"+e.map(function(e){return La(e)}).join(\",\")+\"]\";var t=Sa.test(e.value),n=Aa.test(e.value),r=Sa.test(e.value.replace(Oa,\"\"));if(e.modifiers){var i=\"\",o=\"\",a=[];for(var s in e.modifiers)if(ja[s])o+=ja[s],Ta[s]&&a.push(s);else if(\"exact\"===s){var c=e.modifiers;o+=Na([\"ctrl\",\"shift\",\"alt\",\"meta\"].filter(function(e){return!c[e]}).map(function(e){return\"$event.\"+e+\"Key\"}).join(\"||\"))}else a.push(s);return a.length&&(i+=function(e){return\"if(!$event.type.indexOf('key')&&\"+e.map(Ma).join(\"&&\")+\")return null;\"}(a)),o&&(i+=o),\"function($event){\"+i+(t?\"return \"+e.value+\"($event)\":n?\"return (\"+e.value+\")($event)\":r?\"return \"+e.value:e.value)+\"}\"}return t||n?e.value:\"function($event){\"+(r?\"return \"+e.value:e.value)+\"}\"}function Ma(e){var t=parseInt(e,10);if(t)return\"$event.keyCode!==\"+t;var n=Ta[e],r=Ea[e];return\"_k($event.keyCode,\"+JSON.stringify(e)+\",\"+JSON.stringify(n)+\",$event.key,\"+JSON.stringify(r)+\")\"}var Ia={on:function(e,t){e.wrapListeners=function(e){return\"_g(\"+e+\",\"+t.value+\")\"}},bind:function(e,t){e.wrapData=function(n){return\"_b(\"+n+\",'\"+e.tag+\"',\"+t.value+\",\"+(t.modifiers&&t.modifiers.prop?\"true\":\"false\")+(t.modifiers&&t.modifiers.sync?\",true\":\"\")+\")\"}},cloak:S},Fa=function(e){this.options=e,this.warn=e.warn||Sr,this.transforms=Tr(e.modules,\"transformCode\"),this.dataGenFns=Tr(e.modules,\"genData\"),this.directives=A(A({},Ia),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Pa(e,t){var n=new Fa(t);return{render:\"with(this){return \"+(e?Ra(e,n):'_c(\"div\")')+\"}\",staticRenderFns:n.staticRenderFns}}function Ra(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ha(e,t);if(e.once&&!e.onceProcessed)return Ba(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Ua(e,t);if(\"template\"!==e.tag||e.slotTarget||t.pre){if(\"slot\"===e.tag)return function(e,t){var n=e.slotName||'\"default\"',r=qa(e,t),i=\"_t(\"+n+(r?\",\"+r:\"\"),o=e.attrs||e.dynamicAttrs?Ga((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap[\"v-bind\"];!o&&!a||r||(i+=\",null\");o&&(i+=\",\"+o);a&&(i+=(o?\"\":\",null\")+\",\"+a);return i+\")\"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:qa(t,n,!0);return\"_c(\"+e+\",\"+Va(t,n)+(r?\",\"+r:\"\")+\")\"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Va(e,t));var i=e.inlineTemplate?null:qa(e,t,!0);n=\"_c('\"+e.tag+\"'\"+(r?\",\"+r:\"\")+(i?\",\"+i:\"\")+\")\"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return qa(e,t)||\"void 0\"}function Ha(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push(\"with(this){return \"+Ra(e,t)+\"}\"),t.pre=n,\"_m(\"+(t.staticRenderFns.length-1)+(e.staticInFor?\",true\":\"\")+\")\"}function Ba(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ua(e,t);if(e.staticInFor){for(var n=\"\",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?\"_o(\"+Ra(e,t)+\",\"+t.onceId+++\",\"+n+\")\":Ra(e,t)}return Ha(e,t)}function Ua(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||\"_e()\";var o=t.shift();return o.exp?\"(\"+o.exp+\")?\"+a(o.block)+\":\"+e(t,n,r,i):\"\"+a(o.block);function a(e){return r?r(e,n):e.once?Ba(e,n):Ra(e,n)}}(e.ifConditions.slice(),t,n,r)}function za(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?\",\"+e.iterator1:\"\",s=e.iterator2?\",\"+e.iterator2:\"\";return e.forProcessed=!0,(r||\"_l\")+\"((\"+i+\"),function(\"+o+a+s+\"){return \"+(n||Ra)(e,t)+\"})\"}function Va(e,t){var n=\"{\",r=function(e,t){var n=e.directives;if(!n)return;var r,i,o,a,s=\"directives:[\",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:\"'+o.name+'\",rawName:\"'+o.rawName+'\"'+(o.value?\",value:(\"+o.value+\"),expression:\"+JSON.stringify(o.value):\"\")+(o.arg?\",arg:\"+(o.isDynamicArg?o.arg:'\"'+o.arg+'\"'):\"\")+(o.modifiers?\",modifiers:\"+JSON.stringify(o.modifiers):\"\")+\"},\")}if(c)return s.slice(0,-1)+\"]\"}(e,t);r&&(n+=r+\",\"),e.key&&(n+=\"key:\"+e.key+\",\"),e.ref&&(n+=\"ref:\"+e.ref+\",\"),e.refInFor&&(n+=\"refInFor:true,\"),e.pre&&(n+=\"pre:true,\"),e.component&&(n+='tag:\"'+e.tag+'\",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+=\"attrs:\"+Ga(e.attrs)+\",\"),e.props&&(n+=\"domProps:\"+Ga(e.props)+\",\"),e.events&&(n+=Da(e.events,!1)+\",\"),e.nativeEvents&&(n+=Da(e.nativeEvents,!0)+\",\"),e.slotTarget&&!e.slotScope&&(n+=\"slot:\"+e.slotTarget+\",\"),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Ka(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==ca||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return Ja(t[e],n)}).join(\",\");return\"scopedSlots:_u([\"+a+\"]\"+(r?\",null,true\":\"\")+(!r&&i?\",null,false,\"+function(e){var t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):\"\")+\")\"}(e,e.scopedSlots,t)+\",\"),e.model&&(n+=\"model:{value:\"+e.model.value+\",callback:\"+e.model.callback+\",expression:\"+e.model.expression+\"},\"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Pa(n,t.options);return\"inlineTemplate:{render:function(){\"+r.render+\"},staticRenderFns:[\"+r.staticRenderFns.map(function(e){return\"function(){\"+e+\"}\"}).join(\",\")+\"]}\"}}(e,t);o&&(n+=o+\",\")}return n=n.replace(/,$/,\"\")+\"}\",e.dynamicAttrs&&(n=\"_b(\"+n+',\"'+e.tag+'\",'+Ga(e.dynamicAttrs)+\")\"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ka(e){return 1===e.type&&(\"slot\"===e.tag||e.children.some(Ka))}function Ja(e,t){var n=e.attrsMap[\"slot-scope\"];if(e.if&&!e.ifProcessed&&!n)return Ua(e,t,Ja,\"null\");if(e.for&&!e.forProcessed)return za(e,t,Ja);var r=e.slotScope===ca?\"\":String(e.slotScope),i=\"function(\"+r+\"){return \"+(\"template\"===e.tag?e.if&&n?\"(\"+e.if+\")?\"+(qa(e,t)||\"undefined\")+\":undefined\":qa(e,t)||\"undefined\":Ra(e,t))+\"}\",o=r?\"\":\",proxy:true\";return\"{key:\"+(e.slotTarget||'\"default\"')+\",fn:\"+i+o+\"}\"}function qa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&\"template\"!==a.tag&&\"slot\"!==a.tag){var s=n?t.maybeComponent(a)?\",1\":\",0\":\"\";return\"\"+(r||Ra)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Wa(i)||i.ifConditions&&i.ifConditions.some(function(e){return Wa(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,u=i||Za;return\"[\"+o.map(function(e){return u(e,t)}).join(\",\")+\"]\"+(c?\",\"+c:\"\")}}function Wa(e){return void 0!==e.for||\"template\"===e.tag||\"slot\"===e.tag}function Za(e,t){return 1===e.type?Ra(e,t):3===e.type&&e.isComment?(r=e,\"_e(\"+JSON.stringify(r.text)+\")\"):\"_v(\"+(2===(n=e).type?n.expression:Xa(JSON.stringify(n.text)))+\")\";var n,r}function Ga(e){for(var t=\"\",n=\"\",r=0;r<e.length;r++){var i=e[r],o=Xa(i.value);i.dynamic?n+=i.name+\",\"+o+\",\":t+='\"'+i.name+'\":'+o+\",\"}return t=\"{\"+t.slice(0,-1)+\"}\",n?\"_d(\"+t+\",[\"+n.slice(0,-1)+\"])\":t}function Xa(e){return e.replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}new RegExp(\"\\\\b\"+\"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments\".split(\",\").join(\"\\\\b|\\\\b\")+\"\\\\b\");function Ya(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),S}}function Qa(e){var t=Object.create(null);return function(n,r,i){(r=A({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=Ya(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Ya(e,c)}),t[o]=s}}var es,ts,ns=(es=function(e,t){var n=la(e.trim(),t);!1!==t.optimize&&ka(n,t);var r=Pa(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(n)for(var a in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=A(Object.create(e.directives||null),n.directives)),n)\"modules\"!==a&&\"directives\"!==a&&(r[a]=n[a]);r.warn=function(e,t,n){(n?o:i).push(e)};var s=es(t.trim(),r);return s.errors=i,s.tips=o,s}return{compile:t,compileToFunctions:Qa(t)}})(Ca),rs=(ns.compile,ns.compileToFunctions);function is(e){return(ts=ts||document.createElement(\"div\")).innerHTML=e?'<a href=\"\\n\"/>':'<div a=\"\\n\"/>',ts.innerHTML.indexOf(\"&#10;\")>0}var os=!!z&&is(!1),as=!!z&&is(!0),ss=g(function(e){var t=Yn(e);return t&&t.innerHTML}),cs=wn.prototype.$mount;return wn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if(\"string\"==typeof r)\"#\"===r.charAt(0)&&(r=ss(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement(\"div\");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=rs(r,{outputSourceRange:!1,shouldDecodeNewlines:os,shouldDecodeNewlinesForHref:as,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return cs.call(this,e,t)},wn.compile=rs,wn});"
  },
  {
    "path": "api-test-v2/lib/js/vue-json-pretty.js",
    "content": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.VueJsonPretty=t():e.VueJsonPretty=t()}(\"undefined\"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=39)}([function(e,t){var n=e.exports={version:\"2.6.9\"};\"number\"==typeof __e&&(__e=n)},function(e,t,n){var r=n(25)(\"wks\"),o=n(27),i=n(3).Symbol,s=\"function\"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)(\"Symbol.\"+e))}).store=r},function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},c=typeof e.default;\"object\"!==c&&\"function\"!==c||(s=e,a=e.default);var u=\"function\"==typeof a?a.options:a;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var l;if(i?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=l):r&&(l=r),l){var f=u.functional,d=f?u.render:u.beforeCreate;f?(u._injectStyles=l,u.render=function(e,t){return l.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:s,exports:a,options:u}}},function(e,t){var n=e.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=n)},function(e,t,n){e.exports=!n(9)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(3),o=n(0),i=n(19),s=n(6),a=n(10),c=function(e,t,n){var u,l,f,d=e&c.F,p=e&c.G,h=e&c.S,v=e&c.P,b=e&c.B,m=e&c.W,y=p?o:o[t]||(o[t]={}),g=y.prototype,_=p?r:h?r[t]:(r[t]||{}).prototype;p&&(n=t);for(u in n)(l=!d&&_&&void 0!==_[u])&&a(y,u)||(f=l?_[u]:n[u],y[u]=p&&\"function\"!=typeof _[u]?n[u]:b&&l?i(f,r):m&&_[u]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&\"function\"==typeof f?i(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[u]=f,e&c.R&&g&&!g[u]&&s(g,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(7),o=n(13);e.exports=n(4)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(8),o=n(44),i=n(45),s=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return s(e,t,n)}catch(e){}if(\"get\"in n||\"set\"in n)throw TypeError(\"Accessors not supported!\");return\"value\"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(12);e.exports=function(e){if(!r(e))throw TypeError(e+\" is not an object!\");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(15);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return\"object\"==typeof e?null!==e:\"function\"==typeof e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(47),o=n(28);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError(\"Can't call method on  \"+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(25)(\"keys\"),o=n(27);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t){e.exports={}},function(e,t,n){var r=n(43);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(12),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(22),o=n(15);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(23);e.exports=Object(\"z\").propertyIsEnumerable(0)?Object:function(e){return\"String\"==r(e)?e.split(\"\"):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(16),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(0),o=n(3),i=o[\"__core-js_shared__\"]||(o[\"__core-js_shared__\"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})(\"versions\",[]).push({version:r.version,mode:n(26)?\"pure\":\"global\",copyright:\"© 2019 Denis Pushkarev (zloirock.ru)\"})},function(e,t){e.exports=!0},function(e,t){var n=0,r=Math.random();e.exports=function(e){return\"Symbol(\".concat(void 0===e?\"\":e,\")_\",(++n+r).toString(36))}},function(e,t){e.exports=\"constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf\".split(\",\")},function(e,t,n){\"use strict\";var r=n(53),o=n.n(r),i=n(31),s=n.n(i),a=n(75),c=n(77),u=n(79),l=n(81),f=n(83),d=n(33);t.a={name:\"vue-json-pretty\",components:{SimpleText:a.a,VueCheckbox:c.a,VueRadio:u.a,BracketsLeft:l.a,BracketsRight:f.a},props:{data:{},deep:{type:Number,default:1/0},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},path:{type:String,default:\"root\"},selectableType:{type:String,default:\"\"},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},value:{type:[Array,String],default:function(){return\"\"}},pathSelectable:{type:Function,default:function(){return!0}},highlightMouseoverNode:{type:Boolean,default:!1},highlightSelectedNode:{type:Boolean,default:!0},collapsedOnClickBrackets:{type:Boolean,default:!0},parentData:{},currentDeep:{type:Number,default:1},currentKey:[Number,String]},data:function(){return{visible:this.currentDeep<=this.deep,isMouseover:!1,currentCheckboxVal:!!Array.isArray(this.value)&&this.value.includes(this.path)}},computed:{model:{get:function(){var e=\"multiple\"===this.selectableType?[]:\"single\"===this.selectableType?\"\":null;return this.value||e},set:function(e){this.$emit(\"input\",e)}},lastKey:function(){if(Array.isArray(this.parentData))return this.parentData.length-1;if(this.isObject(this.parentData)){var e=s()(this.parentData);return e[e.length-1]}},notLastKey:function(){return this.currentKey!==this.lastKey},selectable:function(){return this.pathSelectable(this.path,this.data)&&(this.isMultiple||this.isSingle)},isMultiple:function(){return\"multiple\"===this.selectableType},isSingle:function(){return\"single\"===this.selectableType},isSelected:function(){return this.isMultiple?this.model.includes(this.path):!!this.isSingle&&this.model===this.path},propsError:function(){return!this.selectableType||this.selectOnClickNode||this.showSelectController?\"\":\"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail.\"}},methods:{handleValueChange:function(e){var t=this;if(!this.isMultiple||\"checkbox\"!==e&&\"tree\"!==e){if(this.isSingle&&(\"radio\"===e||\"tree\"===e)&&this.model!==this.path){var n=this.model,r=this.path;this.model=r,this.$emit(\"change\",r,n)}}else{var i=this.model.findIndex(function(e){return e===t.path}),s=[].concat(o()(this.model));-1!==i?this.model.splice(i,1):this.model.push(this.path),\"checkbox\"!==e&&(this.currentCheckboxVal=!this.currentCheckboxVal),this.$emit(\"change\",this.model,s)}},handleClick:function(e){e._uid&&e._uid!==this._uid||(e._uid=this._uid,this.$emit(\"click\",this.path,this.data),this.selectable&&this.selectOnClickNode&&this.handleValueChange(\"tree\"))},handleItemClick:function(e,t){this.$emit(\"click\",e,t)},handleItemChange:function(e,t){this.selectable&&this.$emit(\"change\",e,t)},handleMouseover:function(){this.highlightMouseoverNode&&(this.selectable||\"\"===this.selectableType)&&(this.isMouseover=!0)},handleMouseout:function(){this.highlightMouseoverNode&&(this.selectable||\"\"===this.selectableType)&&(this.isMouseover=!1)},isObject:function(e){return\"object\"===Object(d.a)(e)},keyFormatter:function(e){return this.showDoubleQuotes?'\"'+e+'\"':e}},errorCaptured:function(){return!1},watch:{deep:function(e){this.visible=this.currentDeep<=e},propsError:{handler:function(e){if(e)throw new Error(\"[vue-json-pretty] \"+e)},immediate:!0}}}},function(e,t,n){var r=n(7).f,o=n(10),i=n(1)(\"toStringTag\");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){e.exports={default:n(72),__esModule:!0}},function(e,t,n){\"use strict\";var r=n(33);t.a={props:{showDoubleQuotes:Boolean,parentData:{},data:{},showComma:Boolean,currentKey:[Number,String]},computed:{dataType:function(){return Object(r.a)(this.data)},parentDataType:function(){return Object(r.a)(this.parentData)}},methods:{textFormatter:function(e){var t=e+\"\";return\"string\"===this.dataType&&(t='\"'+t+'\"'),this.showComma&&(t+=\",\"),t}}}},function(e,t,n){\"use strict\";function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}t.a=r},function(e,t,n){\"use strict\";t.a={props:{value:{type:Boolean,default:!1}},data:function(){return{focus:!1}},computed:{model:{get:function(){return this.value},set:function(e){this.$emit(\"input\",e)}}}}},function(e,t,n){\"use strict\";t.a={props:{path:String,value:{type:String,default:\"\"}},data:function(){return{focus:!1}},computed:{currentPath:function(){return this.path},model:{get:function(){return this.value},set:function(e){this.$emit(\"input\",e)}}},methods:{change:function(){this.$emit(\"change\",this.model)}}}},function(e,t,n){\"use strict\";var r=n(31),o=n.n(r),i=n(37);t.a={mixins:[i.a],props:{showLength:Boolean},methods:{closedBracketsGenerator:function(e){var t=Array.isArray(e)?\"[...]\":\"{...}\";return this.bracketsFormatter(t)},lengthGenerator:function(e){return\" // \"+(Array.isArray(e)?e.length+\" items\":o()(e).length+\" keys\")}}}},function(e,t,n){\"use strict\";t.a={props:{visible:{required:!0,type:Boolean},data:{required:!0},showComma:Boolean,collapsedOnClickBrackets:Boolean},computed:{dataVisible:{get:function(){return this.visible},set:function(e){this.collapsedOnClickBrackets&&this.$emit(\"update:visible\",e)}}},methods:{toggleBrackets:function(){this.dataVisible=!this.dataVisible},bracketsFormatter:function(e){return this.showComma?e+\",\":e}}}},function(e,t,n){\"use strict\";var r=n(37);t.a={mixins:[r.a]}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(40),o=n.n(r),i=n(52),s=n(86);n.n(s);t.default=o()({},i.a,{version:\"1.6.2\"})},function(e,t,n){e.exports={default:n(41),__esModule:!0}},function(e,t,n){n(42),e.exports=n(0).Object.assign},function(e,t,n){var r=n(5);r(r.S+r.F,\"Object\",{assign:n(46)})},function(e,t){e.exports=function(e){if(\"function\"!=typeof e)throw TypeError(e+\" is not a function!\");return e}},function(e,t,n){e.exports=!n(4)&&!n(9)(function(){return 7!=Object.defineProperty(n(20)(\"div\"),\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(12);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&\"function\"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if(\"function\"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&\"function\"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError(\"Can't convert object to primitive value\")}},function(e,t,n){\"use strict\";var r=n(4),o=n(14),i=n(50),s=n(51),a=n(11),c=n(22),u=Object.assign;e.exports=!u||n(9)(function(){var e={},t={},n=Symbol(),r=\"abcdefghijklmnopqrst\";return e[n]=7,r.split(\"\").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join(\"\")!=r})?function(e,t){for(var n=a(e),u=arguments.length,l=1,f=i.f,d=s.f;u>l;)for(var p,h=c(arguments[l++]),v=f?o(h).concat(f(h)):o(h),b=v.length,m=0;b>m;)p=v[m++],r&&!d.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t,n){var r=n(10),o=n(21),i=n(48)(!1),s=n(17)(\"IE_PROTO\");e.exports=function(e,t){var n,a=o(e),c=0,u=[];for(n in a)n!=s&&r(a,n)&&u.push(n);for(;t.length>c;)r(a,n=t[c++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){var r=n(21),o=n(24),i=n(49);e.exports=function(e){return function(t,n,s){var a,c=r(t),u=o(c.length),l=i(s,u);if(e&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(16),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){\"use strict\";var r=n(29),o=n(85),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";t.__esModule=!0;var r=n(54),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,o.default)(e)}},function(e,t,n){e.exports={default:n(55),__esModule:!0}},function(e,t,n){n(56),n(65),e.exports=n(0).Array.from},function(e,t,n){\"use strict\";var r=n(57)(!0);n(58)(String,\"String\",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(16),o=n(15);e.exports=function(e){return function(t,n){var i,s,a=String(o(t)),c=r(n),u=a.length;return c<0||c>=u?e?\"\":void 0:(i=a.charCodeAt(c),i<55296||i>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?e?a.charAt(c):i:e?a.slice(c,c+2):s-56320+(i-55296<<10)+65536)}}},function(e,t,n){\"use strict\";var r=n(26),o=n(5),i=n(59),s=n(6),a=n(18),c=n(60),u=n(30),l=n(64),f=n(1)(\"iterator\"),d=!([].keys&&\"next\"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,v,b,m){c(n,t,h);var y,g,_,x=function(e){if(!d&&e in C)return C[e];switch(e){case\"keys\":case\"values\":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+\" Iterator\",j=\"values\"==v,w=!1,C=e.prototype,O=C[f]||C[\"@@iterator\"]||v&&C[v],S=O||x(v),A=v?j?x(\"entries\"):S:void 0,M=\"Array\"==t?C.entries||O:O;if(M&&(_=l(M.call(new e)))!==Object.prototype&&_.next&&(u(_,k,!0),r||\"function\"==typeof _[f]||s(_,f,p)),j&&O&&\"values\"!==O.name&&(w=!0,S=function(){return O.call(this)}),r&&!m||!d&&!w&&C[f]||s(C,f,S),a[t]=S,a[k]=p,v)if(y={values:j?S:x(\"values\"),keys:b?S:x(\"keys\"),entries:A},m)for(g in y)g in C||i(C,g,y[g]);else o(o.P+o.F*(d||w),t,y);return y}},function(e,t,n){e.exports=n(6)},function(e,t,n){\"use strict\";var r=n(61),o=n(13),i=n(30),s={};n(6)(s,n(1)(\"iterator\"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+\" Iterator\")}},function(e,t,n){var r=n(8),o=n(62),i=n(28),s=n(17)(\"IE_PROTO\"),a=function(){},c=function(){var e,t=n(20)(\"iframe\"),r=i.length;for(t.style.display=\"none\",n(63).appendChild(t),t.src=\"javascript:\",e=t.contentWindow.document,e.open(),e.write(\"<script>document.F=Object<\\/script>\"),e.close(),c=e.F;r--;)delete c.prototype[i[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=r(e),n=new a,a.prototype=null,n[s]=e):n=c(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(7),o=n(8),i=n(14);e.exports=n(4)?Object.defineProperties:function(e,t){o(e);for(var n,s=i(t),a=s.length,c=0;a>c;)r.f(e,n=s[c++],t[n]);return e}},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(10),o=n(11),i=n(17)(\"IE_PROTO\"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:\"function\"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){\"use strict\";var r=n(19),o=n(5),i=n(11),s=n(66),a=n(67),c=n(24),u=n(68),l=n(69);o(o.S+o.F*!n(71)(function(e){Array.from(e)}),\"Array\",{from:function(e){var t,n,o,f,d=i(e),p=\"function\"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,b=void 0!==v,m=0,y=l(d);if(b&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==y||p==Array&&a(y))for(t=c(d.length),n=new p(t);t>m;m++)u(n,m,b?v(d[m],m):d[m]);else for(f=y.call(d),n=new p;!(o=f.next()).done;m++)u(n,m,b?s(f,v,[o.value,m],!0):o.value);return n.length=m,n}})},function(e,t,n){var r=n(8);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(18),o=n(1)(\"iterator\"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){\"use strict\";var r=n(7),o=n(13);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(70),o=n(1)(\"iterator\"),i=n(18);e.exports=n(0).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e[\"@@iterator\"]||i[r(e)]}},function(e,t,n){var r=n(23),o=n(1)(\"toStringTag\"),i=\"Arguments\"==r(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,a;return void 0===e?\"Undefined\":null===e?\"Null\":\"string\"==typeof(n=s(t=Object(e),o))?n:i?r(t):\"Object\"==(a=r(t))&&\"function\"==typeof t.callee?\"Arguments\":a}},function(e,t,n){var r=n(1)(\"iterator\"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},e(i)}catch(e){}return n}},function(e,t,n){n(73),e.exports=n(0).Object.keys},function(e,t,n){var r=n(11),o=n(14);n(74)(\"keys\",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(5),o=n(0),i=n(9);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*i(function(){n(1)}),\"Object\",s)}},function(e,t,n){\"use strict\";var r=n(32),o=n(76),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",[e._t(\"default\"),e._v(\" \"),n(\"span\",{class:\"vjs-value vjs-value__\"+e.dataType},[e._v(\"\\n    \"+e._s(e.textFormatter(e.data))+\"\\n  \")])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(34),o=n(78),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"label\",{class:[\"vjs-checkbox\",e.value?\"is-checked\":\"\"],on:{click:function(e){e.stopPropagation()}}},[n(\"span\",{staticClass:\"vjs-checkbox__inner\"}),e._v(\" \"),n(\"input\",{directives:[{name:\"model\",rawName:\"v-model\",value:e.model,expression:\"model\"}],staticClass:\"vjs-checkbox__original\",attrs:{type:\"checkbox\"},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e.model},on:{change:[function(t){var n=e.model,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&(e.model=n.concat([null])):i>-1&&(e.model=n.slice(0,i).concat(n.slice(i+1)))}else e.model=o},function(t){return e.$emit(\"change\",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(35),o=n(80),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"label\",{class:[\"vjs-radio\",e.model===e.currentPath?\"is-checked\":\"\"],on:{click:function(e){e.stopPropagation()}}},[n(\"span\",{staticClass:\"vjs-radio__inner\"}),e._v(\" \"),n(\"input\",{directives:[{name:\"model\",rawName:\"v-model\",value:e.model,expression:\"model\"}],staticClass:\"vjs-radio__original\",attrs:{type:\"radio\"},domProps:{value:e.currentPath,checked:e._q(e.model,e.currentPath)},on:{change:[function(t){e.model=e.currentPath},e.change],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(36),o=n(82),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",[e._t(\"default\"),e._v(\" \"),n(\"span\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.dataVisible,expression:\"dataVisible\"}],staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n    \"+e._s(Array.isArray(e.data)?\"[\":\"{\")+\"\\n  \")]),e._v(\" \"),n(\"span\",{directives:[{name:\"show\",rawName:\"v-show\",value:!e.dataVisible,expression:\"!dataVisible\"}]},[n(\"span\",{staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n      \"+e._s(e.closedBracketsGenerator(e.data))+\"\\n    \")]),e._v(\" \"),e.showLength?n(\"span\",{staticClass:\"vjs-comment\"},[e._v(\"\\n      \"+e._s(e.lengthGenerator(e.data))+\"\\n    \")]):e._e()])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(38),o=n(84),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.dataVisible,expression:\"dataVisible\"}]},[n(\"span\",{staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n    \"+e._s(e.bracketsFormatter(Array.isArray(e.data)?\"]\":\"}\"))+\"\\n  \")])])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{class:{\"vjs-tree\":!0,\"has-selectable-control\":e.isMultiple||e.showSelectController,\"is-root\":1===e.currentDeep,\"is-selectable\":e.selectable,\"is-selected\":e.isSelected,\"is-highlight-selected\":e.isSelected&&e.highlightSelectedNode,\"is-mouseover\":e.isMouseover},on:{click:e.handleClick,mouseover:function(t){return t.stopPropagation(),e.handleMouseover(t)},mouseout:function(t){return t.stopPropagation(),e.handleMouseout(t)}}},[e.showSelectController&&e.selectable?[e.isMultiple?n(\"vue-checkbox\",{on:{change:function(t){return e.handleValueChange(\"checkbox\")}},model:{value:e.currentCheckboxVal,callback:function(t){e.currentCheckboxVal=t},expression:\"currentCheckboxVal\"}}):e.isSingle?n(\"vue-radio\",{attrs:{path:e.path},on:{change:function(t){return e.handleValueChange(\"radio\")}},model:{value:e.model,callback:function(t){e.model=t},expression:\"model\"}}):e._e()]:e._e(),e._v(\" \"),Array.isArray(e.data)||e.isObject(e.data)?[n(\"brackets-left\",{attrs:{visible:e.visible,data:e.data,\"show-length\":e.showLength,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"show-comma\":e.notLastKey},on:{\"update:visible\":function(t){e.visible=t}}},[e.currentDeep>1&&!Array.isArray(e.parentData)?n(\"span\",{staticClass:\"vjs-key\"},[e._v(e._s(e.keyFormatter(e.currentKey))+\":\")]):e._e()]),e._v(\" \"),e._l(e.data,function(t,r){return n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.visible,expression:\"visible\"}],key:r,class:{\"vjs-tree__content\":!0,\"has-line\":e.showLine}},[n(\"vue-json-pretty\",{attrs:{\"parent-data\":e.data,data:t,deep:e.deep,\"show-length\":e.showLength,\"show-double-quotes\":e.showDoubleQuotes,\"show-line\":e.showLine,\"highlight-mouseover-node\":e.highlightMouseoverNode,\"highlight-selected-node\":e.highlightSelectedNode,path:e.path+(Array.isArray(e.data)?\"[\"+r+\"]\":\".\"+r),\"path-selectable\":e.pathSelectable,\"selectable-type\":e.selectableType,\"show-select-controller\":e.showSelectController,\"select-on-click-node\":e.selectOnClickNode,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"current-key\":r,\"current-deep\":e.currentDeep+1},on:{click:e.handleItemClick,change:e.handleItemChange},model:{value:e.model,callback:function(t){e.model=t},expression:\"model\"}})],1)}),e._v(\" \"),n(\"brackets-right\",{attrs:{visible:e.visible,data:e.data,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"show-comma\":e.notLastKey},on:{\"update:visible\":function(t){e.visible=t}}})]:n(\"simple-text\",{attrs:{\"show-double-quotes\":e.showDoubleQuotes,\"show-comma\":e.notLastKey,\"parent-data\":e.parentData,data:e.data,\"current-key\":e.currentKey}},[e.parentData&&e.currentKey&&!Array.isArray(e.parentData)?n(\"span\",{staticClass:\"vjs-key\"},[e._v(\"\\n      \"+e._s(e.keyFormatter(e.currentKey))+\":\\n    \")]):e._e()])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){var r=n(87);\"string\"==typeof r&&(r=[[e.i,r,\"\"]]),r.locals&&(e.exports=r.locals);n(89)(\"bfa6fc9c\",r,!0,{})},function(e,t,n){t=e.exports=n(88)(!1),t.push([e.i,'.vjs-checkbox{position:absolute;left:-30px;color:#1f2d3d;user-select:none}.vjs-checkbox.is-checked .vjs-checkbox__inner{background-color:#1890ff;border-color:#0076e4}.vjs-checkbox.is-checked .vjs-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.vjs-checkbox .vjs-checkbox__inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-checkbox .vjs-checkbox__inner:after{box-sizing:content-box;content:\"\";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-checkbox .vjs-checkbox__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-radio{position:absolute;left:-30px;color:#1f2d3d;user-select:none}.vjs-radio.is-checked .vjs-radio__inner{background-color:#1890ff;border-color:#0076e4}.vjs-radio.is-checked .vjs-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.vjs-radio .vjs-radio__inner{border:1px solid #bfcbd9;border-radius:100%;width:16px;height:16px;vertical-align:middle;background-color:#fff;position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.vjs-radio .vjs-radio__inner:after{width:4px;height:4px;border-radius:100%;background-color:#fff;content:\"\";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.vjs-radio .vjs-radio__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px}.vjs-tree.is-root{position:relative}.vjs-tree.is-root.has-selectable-control{margin-left:30px}.vjs-tree.is-mouseover{background-color:#e6f7ff}.vjs-tree.is-highlight-selected{background-color:#ccefff}.vjs-tree .vjs-tree__content{padding-left:1em}.vjs-tree .vjs-tree__content.has-line{border-left:1px dotted #bfcbd9}.vjs-tree .vjs-tree__brackets{cursor:pointer}.vjs-tree .vjs-tree__brackets:hover{color:#1890ff}.vjs-tree .vjs-comment{color:#bfcbd9}.vjs-tree .vjs-value__null{color:#ff4949}.vjs-tree .vjs-value__boolean,.vjs-tree .vjs-value__number{color:#1d8ce0}.vjs-tree .vjs-value__string{color:#13ce66}',\"\"])},function(e,t){function n(e,t){var n=e[1]||\"\",o=e[3];if(!o)return n;if(t&&\"function\"==typeof btoa){var i=r(o);return[n].concat(o.sources.map(function(e){return\"/*# sourceURL=\"+o.sourceRoot+e+\" */\"})).concat([i]).join(\"\\n\")}return[n].join(\"\\n\")}function r(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?\"@media \"+t[2]+\"{\"+r+\"}\":r}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];\"number\"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var s=e[o];\"number\"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]=\"(\"+s[2]+\") and (\"+n+\")\"),t.push(s))}},t}},function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=l[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(i(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var s=[],o=0;o<n.parts.length;o++)s.push(i(n.parts[o]));l[n.id]={id:n.id,refs:1,parts:s}}}}function o(){var e=document.createElement(\"style\");return e.type=\"text/css\",f.appendChild(e),e}function i(e){var t,n,r=document.querySelector(\"style[\"+m+'~=\"'+e.id+'\"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(y){var i=p++;r=d||(d=o()),t=s.bind(null,r,i,!1),n=s.bind(null,r,i,!0)}else r=o(),t=a.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function s(e,t,n,r){var o=n?\"\":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function a(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute(\"media\",r),b.ssrId&&e.setAttribute(m,t.id),o&&(n+=\"\\n/*# sourceURL=\"+o.sources[0]+\" */\",n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+\" */\"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c=\"undefined\"!=typeof document;if(\"undefined\"!=typeof DEBUG&&DEBUG&&!c)throw new Error(\"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\");var u=n(90),l={},f=c&&(document.head||document.getElementsByTagName(\"head\")[0]),d=null,p=0,h=!1,v=function(){},b=null,m=\"data-vue-ssr-id\",y=\"undefined\"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,o){h=n,b=o||{};var i=u(e,t);return r(i),function(t){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=l[s.id];a.refs--,n.push(a)}t?(i=u(e,t),r(i)):i=[];for(var o=0;o<n.length;o++){var a=n[o];if(0===a.refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete l[a.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join(\"\\n\")}}()},function(e,t){e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],s=i[0],a=i[1],c=i[2],u=i[3],l={id:e+\":\"+o,css:a,media:c,sourceMap:u};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}}])});"
  },
  {
    "path": "api-test-v2/lib/styles/dragula-3.7.2.css",
    "content": ".gu-mirror {\n  position: fixed !important;\n  margin: 0 !important;\n  z-index: 9999 !important;\n  opacity: 0.8;\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";\n  filter: alpha(opacity=80);\n}\n.gu-hide {\n  display: none !important;\n}\n.gu-unselectable {\n  -webkit-user-select: none !important;\n  -moz-user-select: none !important;\n  -ms-user-select: none !important;\n  user-select: none !important;\n}\n.gu-transit {\n  opacity: 0.2;\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";\n  filter: alpha(opacity=20);\n}"
  },
  {
    "path": "api-test-v2/lib/styles/iview.css",
    "content": ".ivu-load-loop{-webkit-animation:ani-load-loop 1s linear infinite;animation:ani-load-loop 1s linear infinite}@-webkit-keyframes ani-load-loop{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes ani-load-loop{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.input-group-error-append,.input-group-error-prepend{background-color:#fff;border:1px solid #ed4014}.input-group-error-append .ivu-select-selection,.input-group-error-prepend .ivu-select-selection{background-color:inherit;border:1px solid transparent}.input-group-error-prepend{border-right:0}.input-group-error-append{border-left:0}/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto;resize:vertical}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}body{font-family:\"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;font-size:14px;line-height:1.5;color:#515a6e;background-color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}article,aside,blockquote,body,button,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,input,legend,li,menu,nav,ol,p,section,td,textarea,th,ul{margin:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}input::-ms-clear,input::-ms-reveal{display:none}a{color:#2d8cf0;background:0 0;text-decoration:none;outline:0;cursor:pointer;-webkit-transition:color .2s ease;transition:color .2s ease}a:hover{color:#57a3f3}a:active{color:#2b85e4}a:active,a:hover{outline:0;text-decoration:none}a[disabled]{color:#ccc;cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-family:Consolas,Menlo,Courier,monospace}@font-face{font-family:Ionicons;src:url(fonts/ionicons.woff2?v=3.0.0) format(\"woff2\"),url(fonts/ionicons.woff?v=3.0.0) format(\"woff\"),url(fonts/ionicons.ttf?v=3.0.0) format(\"truetype\"),url(fonts/ionicons.svg?v=3.0.0#Ionicons) format(\"svg\");font-weight:400;font-style:normal}.ivu-icon{display:inline-block;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:optimizeLegibility;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:-.125em;text-align:center}.ivu-icon-ios-add-circle-outline:before{content:\"\\f100\"}.ivu-icon-ios-add-circle:before{content:\"\\f101\"}.ivu-icon-ios-add:before{content:\"\\f102\"}.ivu-icon-ios-alarm-outline:before{content:\"\\f103\"}.ivu-icon-ios-alarm:before{content:\"\\f104\"}.ivu-icon-ios-albums-outline:before{content:\"\\f105\"}.ivu-icon-ios-albums:before{content:\"\\f106\"}.ivu-icon-ios-alert-outline:before{content:\"\\f107\"}.ivu-icon-ios-alert:before{content:\"\\f108\"}.ivu-icon-ios-american-football-outline:before{content:\"\\f109\"}.ivu-icon-ios-american-football:before{content:\"\\f10a\"}.ivu-icon-ios-analytics-outline:before{content:\"\\f10b\"}.ivu-icon-ios-analytics:before{content:\"\\f10c\"}.ivu-icon-ios-aperture-outline:before{content:\"\\f10d\"}.ivu-icon-ios-aperture:before{content:\"\\f10e\"}.ivu-icon-ios-apps-outline:before{content:\"\\f10f\"}.ivu-icon-ios-apps:before{content:\"\\f110\"}.ivu-icon-ios-appstore-outline:before{content:\"\\f111\"}.ivu-icon-ios-appstore:before{content:\"\\f112\"}.ivu-icon-ios-archive-outline:before{content:\"\\f113\"}.ivu-icon-ios-archive:before{content:\"\\f114\"}.ivu-icon-ios-arrow-back:before{content:\"\\f115\"}.ivu-icon-ios-arrow-down:before{content:\"\\f116\"}.ivu-icon-ios-arrow-dropdown-circle:before{content:\"\\f117\"}.ivu-icon-ios-arrow-dropdown:before{content:\"\\f118\"}.ivu-icon-ios-arrow-dropleft-circle:before{content:\"\\f119\"}.ivu-icon-ios-arrow-dropleft:before{content:\"\\f11a\"}.ivu-icon-ios-arrow-dropright-circle:before{content:\"\\f11b\"}.ivu-icon-ios-arrow-dropright:before{content:\"\\f11c\"}.ivu-icon-ios-arrow-dropup-circle:before{content:\"\\f11d\"}.ivu-icon-ios-arrow-dropup:before{content:\"\\f11e\"}.ivu-icon-ios-arrow-forward:before{content:\"\\f11f\"}.ivu-icon-ios-arrow-round-back:before{content:\"\\f120\"}.ivu-icon-ios-arrow-round-down:before{content:\"\\f121\"}.ivu-icon-ios-arrow-round-forward:before{content:\"\\f122\"}.ivu-icon-ios-arrow-round-up:before{content:\"\\f123\"}.ivu-icon-ios-arrow-up:before{content:\"\\f124\"}.ivu-icon-ios-at-outline:before{content:\"\\f125\"}.ivu-icon-ios-at:before{content:\"\\f126\"}.ivu-icon-ios-attach:before{content:\"\\f127\"}.ivu-icon-ios-backspace-outline:before{content:\"\\f128\"}.ivu-icon-ios-backspace:before{content:\"\\f129\"}.ivu-icon-ios-barcode-outline:before{content:\"\\f12a\"}.ivu-icon-ios-barcode:before{content:\"\\f12b\"}.ivu-icon-ios-baseball-outline:before{content:\"\\f12c\"}.ivu-icon-ios-baseball:before{content:\"\\f12d\"}.ivu-icon-ios-basket-outline:before{content:\"\\f12e\"}.ivu-icon-ios-basket:before{content:\"\\f12f\"}.ivu-icon-ios-basketball-outline:before{content:\"\\f130\"}.ivu-icon-ios-basketball:before{content:\"\\f131\"}.ivu-icon-ios-battery-charging:before{content:\"\\f132\"}.ivu-icon-ios-battery-dead:before{content:\"\\f133\"}.ivu-icon-ios-battery-full:before{content:\"\\f134\"}.ivu-icon-ios-beaker-outline:before{content:\"\\f135\"}.ivu-icon-ios-beaker:before{content:\"\\f136\"}.ivu-icon-ios-beer-outline:before{content:\"\\f137\"}.ivu-icon-ios-beer:before{content:\"\\f138\"}.ivu-icon-ios-bicycle:before{content:\"\\f139\"}.ivu-icon-ios-bluetooth:before{content:\"\\f13a\"}.ivu-icon-ios-boat-outline:before{content:\"\\f13b\"}.ivu-icon-ios-boat:before{content:\"\\f13c\"}.ivu-icon-ios-body-outline:before{content:\"\\f13d\"}.ivu-icon-ios-body:before{content:\"\\f13e\"}.ivu-icon-ios-bonfire-outline:before{content:\"\\f13f\"}.ivu-icon-ios-bonfire:before{content:\"\\f140\"}.ivu-icon-ios-book-outline:before{content:\"\\f141\"}.ivu-icon-ios-book:before{content:\"\\f142\"}.ivu-icon-ios-bookmark-outline:before{content:\"\\f143\"}.ivu-icon-ios-bookmark:before{content:\"\\f144\"}.ivu-icon-ios-bookmarks-outline:before{content:\"\\f145\"}.ivu-icon-ios-bookmarks:before{content:\"\\f146\"}.ivu-icon-ios-bowtie-outline:before{content:\"\\f147\"}.ivu-icon-ios-bowtie:before{content:\"\\f148\"}.ivu-icon-ios-briefcase-outline:before{content:\"\\f149\"}.ivu-icon-ios-briefcase:before{content:\"\\f14a\"}.ivu-icon-ios-browsers-outline:before{content:\"\\f14b\"}.ivu-icon-ios-browsers:before{content:\"\\f14c\"}.ivu-icon-ios-brush-outline:before{content:\"\\f14d\"}.ivu-icon-ios-brush:before{content:\"\\f14e\"}.ivu-icon-ios-bug-outline:before{content:\"\\f14f\"}.ivu-icon-ios-bug:before{content:\"\\f150\"}.ivu-icon-ios-build-outline:before{content:\"\\f151\"}.ivu-icon-ios-build:before{content:\"\\f152\"}.ivu-icon-ios-bulb-outline:before{content:\"\\f153\"}.ivu-icon-ios-bulb:before{content:\"\\f154\"}.ivu-icon-ios-bus-outline:before{content:\"\\f155\"}.ivu-icon-ios-bus:before{content:\"\\f156\"}.ivu-icon-ios-cafe-outline:before{content:\"\\f157\"}.ivu-icon-ios-cafe:before{content:\"\\f158\"}.ivu-icon-ios-calculator-outline:before{content:\"\\f159\"}.ivu-icon-ios-calculator:before{content:\"\\f15a\"}.ivu-icon-ios-calendar-outline:before{content:\"\\f15b\"}.ivu-icon-ios-calendar:before{content:\"\\f15c\"}.ivu-icon-ios-call-outline:before{content:\"\\f15d\"}.ivu-icon-ios-call:before{content:\"\\f15e\"}.ivu-icon-ios-camera-outline:before{content:\"\\f15f\"}.ivu-icon-ios-camera:before{content:\"\\f160\"}.ivu-icon-ios-car-outline:before{content:\"\\f161\"}.ivu-icon-ios-car:before{content:\"\\f162\"}.ivu-icon-ios-card-outline:before{content:\"\\f163\"}.ivu-icon-ios-card:before{content:\"\\f164\"}.ivu-icon-ios-cart-outline:before{content:\"\\f165\"}.ivu-icon-ios-cart:before{content:\"\\f166\"}.ivu-icon-ios-cash-outline:before{content:\"\\f167\"}.ivu-icon-ios-cash:before{content:\"\\f168\"}.ivu-icon-ios-chatboxes-outline:before{content:\"\\f169\"}.ivu-icon-ios-chatboxes:before{content:\"\\f16a\"}.ivu-icon-ios-chatbubbles-outline:before{content:\"\\f16b\"}.ivu-icon-ios-chatbubbles:before{content:\"\\f16c\"}.ivu-icon-ios-checkbox-outline:before{content:\"\\f16d\"}.ivu-icon-ios-checkbox:before{content:\"\\f16e\"}.ivu-icon-ios-checkmark-circle-outline:before{content:\"\\f16f\"}.ivu-icon-ios-checkmark-circle:before{content:\"\\f170\"}.ivu-icon-ios-checkmark:before{content:\"\\f171\"}.ivu-icon-ios-clipboard-outline:before{content:\"\\f172\"}.ivu-icon-ios-clipboard:before{content:\"\\f173\"}.ivu-icon-ios-clock-outline:before{content:\"\\f174\"}.ivu-icon-ios-clock:before{content:\"\\f175\"}.ivu-icon-ios-close-circle-outline:before{content:\"\\f176\"}.ivu-icon-ios-close-circle:before{content:\"\\f177\"}.ivu-icon-ios-close:before{content:\"\\f178\"}.ivu-icon-ios-closed-captioning-outline:before{content:\"\\f179\"}.ivu-icon-ios-closed-captioning:before{content:\"\\f17a\"}.ivu-icon-ios-cloud-circle-outline:before{content:\"\\f17b\"}.ivu-icon-ios-cloud-circle:before{content:\"\\f17c\"}.ivu-icon-ios-cloud-done-outline:before{content:\"\\f17d\"}.ivu-icon-ios-cloud-done:before{content:\"\\f17e\"}.ivu-icon-ios-cloud-download-outline:before{content:\"\\f17f\"}.ivu-icon-ios-cloud-download:before{content:\"\\f180\"}.ivu-icon-ios-cloud-outline:before{content:\"\\f181\"}.ivu-icon-ios-cloud-upload-outline:before{content:\"\\f182\"}.ivu-icon-ios-cloud-upload:before{content:\"\\f183\"}.ivu-icon-ios-cloud:before{content:\"\\f184\"}.ivu-icon-ios-cloudy-night-outline:before{content:\"\\f185\"}.ivu-icon-ios-cloudy-night:before{content:\"\\f186\"}.ivu-icon-ios-cloudy-outline:before{content:\"\\f187\"}.ivu-icon-ios-cloudy:before{content:\"\\f188\"}.ivu-icon-ios-code-download:before{content:\"\\f189\"}.ivu-icon-ios-code-working:before{content:\"\\f18a\"}.ivu-icon-ios-code:before{content:\"\\f18b\"}.ivu-icon-ios-cog-outline:before{content:\"\\f18c\"}.ivu-icon-ios-cog:before{content:\"\\f18d\"}.ivu-icon-ios-color-fill-outline:before{content:\"\\f18e\"}.ivu-icon-ios-color-fill:before{content:\"\\f18f\"}.ivu-icon-ios-color-filter-outline:before{content:\"\\f190\"}.ivu-icon-ios-color-filter:before{content:\"\\f191\"}.ivu-icon-ios-color-palette-outline:before{content:\"\\f192\"}.ivu-icon-ios-color-palette:before{content:\"\\f193\"}.ivu-icon-ios-color-wand-outline:before{content:\"\\f194\"}.ivu-icon-ios-color-wand:before{content:\"\\f195\"}.ivu-icon-ios-compass-outline:before{content:\"\\f196\"}.ivu-icon-ios-compass:before{content:\"\\f197\"}.ivu-icon-ios-construct-outline:before{content:\"\\f198\"}.ivu-icon-ios-construct:before{content:\"\\f199\"}.ivu-icon-ios-contact-outline:before{content:\"\\f19a\"}.ivu-icon-ios-contact:before{content:\"\\f19b\"}.ivu-icon-ios-contacts-outline:before{content:\"\\f19c\"}.ivu-icon-ios-contacts:before{content:\"\\f19d\"}.ivu-icon-ios-contract:before{content:\"\\f19e\"}.ivu-icon-ios-contrast:before{content:\"\\f19f\"}.ivu-icon-ios-copy-outline:before{content:\"\\f1a0\"}.ivu-icon-ios-copy:before{content:\"\\f1a1\"}.ivu-icon-ios-create-outline:before{content:\"\\f1a2\"}.ivu-icon-ios-create:before{content:\"\\f1a3\"}.ivu-icon-ios-crop-outline:before{content:\"\\f1a4\"}.ivu-icon-ios-crop:before{content:\"\\f1a5\"}.ivu-icon-ios-cube-outline:before{content:\"\\f1a6\"}.ivu-icon-ios-cube:before{content:\"\\f1a7\"}.ivu-icon-ios-cut-outline:before{content:\"\\f1a8\"}.ivu-icon-ios-cut:before{content:\"\\f1a9\"}.ivu-icon-ios-desktop-outline:before{content:\"\\f1aa\"}.ivu-icon-ios-desktop:before{content:\"\\f1ab\"}.ivu-icon-ios-disc-outline:before{content:\"\\f1ac\"}.ivu-icon-ios-disc:before{content:\"\\f1ad\"}.ivu-icon-ios-document-outline:before{content:\"\\f1ae\"}.ivu-icon-ios-document:before{content:\"\\f1af\"}.ivu-icon-ios-done-all:before{content:\"\\f1b0\"}.ivu-icon-ios-download-outline:before{content:\"\\f1b1\"}.ivu-icon-ios-download:before{content:\"\\f1b2\"}.ivu-icon-ios-easel-outline:before{content:\"\\f1b3\"}.ivu-icon-ios-easel:before{content:\"\\f1b4\"}.ivu-icon-ios-egg-outline:before{content:\"\\f1b5\"}.ivu-icon-ios-egg:before{content:\"\\f1b6\"}.ivu-icon-ios-exit-outline:before{content:\"\\f1b7\"}.ivu-icon-ios-exit:before{content:\"\\f1b8\"}.ivu-icon-ios-expand:before{content:\"\\f1b9\"}.ivu-icon-ios-eye-off-outline:before{content:\"\\f1ba\"}.ivu-icon-ios-eye-off:before{content:\"\\f1bb\"}.ivu-icon-ios-eye-outline:before{content:\"\\f1bc\"}.ivu-icon-ios-eye:before{content:\"\\f1bd\"}.ivu-icon-ios-fastforward-outline:before{content:\"\\f1be\"}.ivu-icon-ios-fastforward:before{content:\"\\f1bf\"}.ivu-icon-ios-female:before{content:\"\\f1c0\"}.ivu-icon-ios-filing-outline:before{content:\"\\f1c1\"}.ivu-icon-ios-filing:before{content:\"\\f1c2\"}.ivu-icon-ios-film-outline:before{content:\"\\f1c3\"}.ivu-icon-ios-film:before{content:\"\\f1c4\"}.ivu-icon-ios-finger-print:before{content:\"\\f1c5\"}.ivu-icon-ios-flag-outline:before{content:\"\\f1c6\"}.ivu-icon-ios-flag:before{content:\"\\f1c7\"}.ivu-icon-ios-flame-outline:before{content:\"\\f1c8\"}.ivu-icon-ios-flame:before{content:\"\\f1c9\"}.ivu-icon-ios-flash-outline:before{content:\"\\f1ca\"}.ivu-icon-ios-flash:before{content:\"\\f1cb\"}.ivu-icon-ios-flask-outline:before{content:\"\\f1cc\"}.ivu-icon-ios-flask:before{content:\"\\f1cd\"}.ivu-icon-ios-flower-outline:before{content:\"\\f1ce\"}.ivu-icon-ios-flower:before{content:\"\\f1cf\"}.ivu-icon-ios-folder-open-outline:before{content:\"\\f1d0\"}.ivu-icon-ios-folder-open:before{content:\"\\f1d1\"}.ivu-icon-ios-folder-outline:before{content:\"\\f1d2\"}.ivu-icon-ios-folder:before{content:\"\\f1d3\"}.ivu-icon-ios-football-outline:before{content:\"\\f1d4\"}.ivu-icon-ios-football:before{content:\"\\f1d5\"}.ivu-icon-ios-funnel-outline:before{content:\"\\f1d6\"}.ivu-icon-ios-funnel:before{content:\"\\f1d7\"}.ivu-icon-ios-game-controller-a-outline:before{content:\"\\f1d8\"}.ivu-icon-ios-game-controller-a:before{content:\"\\f1d9\"}.ivu-icon-ios-game-controller-b-outline:before{content:\"\\f1da\"}.ivu-icon-ios-game-controller-b:before{content:\"\\f1db\"}.ivu-icon-ios-git-branch:before{content:\"\\f1dc\"}.ivu-icon-ios-git-commit:before{content:\"\\f1dd\"}.ivu-icon-ios-git-compare:before{content:\"\\f1de\"}.ivu-icon-ios-git-merge:before{content:\"\\f1df\"}.ivu-icon-ios-git-network:before{content:\"\\f1e0\"}.ivu-icon-ios-git-pull-request:before{content:\"\\f1e1\"}.ivu-icon-ios-glasses-outline:before{content:\"\\f1e2\"}.ivu-icon-ios-glasses:before{content:\"\\f1e3\"}.ivu-icon-ios-globe-outline:before{content:\"\\f1e4\"}.ivu-icon-ios-globe:before{content:\"\\f1e5\"}.ivu-icon-ios-grid-outline:before{content:\"\\f1e6\"}.ivu-icon-ios-grid:before{content:\"\\f1e7\"}.ivu-icon-ios-hammer-outline:before{content:\"\\f1e8\"}.ivu-icon-ios-hammer:before{content:\"\\f1e9\"}.ivu-icon-ios-hand-outline:before{content:\"\\f1ea\"}.ivu-icon-ios-hand:before{content:\"\\f1eb\"}.ivu-icon-ios-happy-outline:before{content:\"\\f1ec\"}.ivu-icon-ios-happy:before{content:\"\\f1ed\"}.ivu-icon-ios-headset-outline:before{content:\"\\f1ee\"}.ivu-icon-ios-headset:before{content:\"\\f1ef\"}.ivu-icon-ios-heart-outline:before{content:\"\\f1f0\"}.ivu-icon-ios-heart:before{content:\"\\f1f1\"}.ivu-icon-ios-help-buoy-outline:before{content:\"\\f1f2\"}.ivu-icon-ios-help-buoy:before{content:\"\\f1f3\"}.ivu-icon-ios-help-circle-outline:before{content:\"\\f1f4\"}.ivu-icon-ios-help-circle:before{content:\"\\f1f5\"}.ivu-icon-ios-help:before{content:\"\\f1f6\"}.ivu-icon-ios-home-outline:before{content:\"\\f1f7\"}.ivu-icon-ios-home:before{content:\"\\f1f8\"}.ivu-icon-ios-ice-cream-outline:before{content:\"\\f1f9\"}.ivu-icon-ios-ice-cream:before{content:\"\\f1fa\"}.ivu-icon-ios-image-outline:before{content:\"\\f1fb\"}.ivu-icon-ios-image:before{content:\"\\f1fc\"}.ivu-icon-ios-images-outline:before{content:\"\\f1fd\"}.ivu-icon-ios-images:before{content:\"\\f1fe\"}.ivu-icon-ios-infinite-outline:before{content:\"\\f1ff\"}.ivu-icon-ios-infinite:before{content:\"\\f200\"}.ivu-icon-ios-information-circle-outline:before{content:\"\\f201\"}.ivu-icon-ios-information-circle:before{content:\"\\f202\"}.ivu-icon-ios-information:before{content:\"\\f203\"}.ivu-icon-ios-ionic-outline:before{content:\"\\f204\"}.ivu-icon-ios-ionic:before{content:\"\\f205\"}.ivu-icon-ios-ionitron-outline:before{content:\"\\f206\"}.ivu-icon-ios-ionitron:before{content:\"\\f207\"}.ivu-icon-ios-jet-outline:before{content:\"\\f208\"}.ivu-icon-ios-jet:before{content:\"\\f209\"}.ivu-icon-ios-key-outline:before{content:\"\\f20a\"}.ivu-icon-ios-key:before{content:\"\\f20b\"}.ivu-icon-ios-keypad-outline:before{content:\"\\f20c\"}.ivu-icon-ios-keypad:before{content:\"\\f20d\"}.ivu-icon-ios-laptop:before{content:\"\\f20e\"}.ivu-icon-ios-leaf-outline:before{content:\"\\f20f\"}.ivu-icon-ios-leaf:before{content:\"\\f210\"}.ivu-icon-ios-link-outline:before{content:\"\\f211\"}.ivu-icon-ios-link:before{content:\"\\f212\"}.ivu-icon-ios-list-box-outline:before{content:\"\\f213\"}.ivu-icon-ios-list-box:before{content:\"\\f214\"}.ivu-icon-ios-list:before{content:\"\\f215\"}.ivu-icon-ios-locate-outline:before{content:\"\\f216\"}.ivu-icon-ios-locate:before{content:\"\\f217\"}.ivu-icon-ios-lock-outline:before{content:\"\\f218\"}.ivu-icon-ios-lock:before{content:\"\\f219\"}.ivu-icon-ios-log-in:before{content:\"\\f21a\"}.ivu-icon-ios-log-out:before{content:\"\\f21b\"}.ivu-icon-ios-magnet-outline:before{content:\"\\f21c\"}.ivu-icon-ios-magnet:before{content:\"\\f21d\"}.ivu-icon-ios-mail-open-outline:before{content:\"\\f21e\"}.ivu-icon-ios-mail-open:before{content:\"\\f21f\"}.ivu-icon-ios-mail-outline:before{content:\"\\f220\"}.ivu-icon-ios-mail:before{content:\"\\f221\"}.ivu-icon-ios-male:before{content:\"\\f222\"}.ivu-icon-ios-man-outline:before{content:\"\\f223\"}.ivu-icon-ios-man:before{content:\"\\f224\"}.ivu-icon-ios-map-outline:before{content:\"\\f225\"}.ivu-icon-ios-map:before{content:\"\\f226\"}.ivu-icon-ios-medal-outline:before{content:\"\\f227\"}.ivu-icon-ios-medal:before{content:\"\\f228\"}.ivu-icon-ios-medical-outline:before{content:\"\\f229\"}.ivu-icon-ios-medical:before{content:\"\\f22a\"}.ivu-icon-ios-medkit-outline:before{content:\"\\f22b\"}.ivu-icon-ios-medkit:before{content:\"\\f22c\"}.ivu-icon-ios-megaphone-outline:before{content:\"\\f22d\"}.ivu-icon-ios-megaphone:before{content:\"\\f22e\"}.ivu-icon-ios-menu-outline:before{content:\"\\f22f\"}.ivu-icon-ios-menu:before{content:\"\\f230\"}.ivu-icon-ios-mic-off-outline:before{content:\"\\f231\"}.ivu-icon-ios-mic-off:before{content:\"\\f232\"}.ivu-icon-ios-mic-outline:before{content:\"\\f233\"}.ivu-icon-ios-mic:before{content:\"\\f234\"}.ivu-icon-ios-microphone-outline:before{content:\"\\f235\"}.ivu-icon-ios-microphone:before{content:\"\\f236\"}.ivu-icon-ios-moon-outline:before{content:\"\\f237\"}.ivu-icon-ios-moon:before{content:\"\\f238\"}.ivu-icon-ios-more-outline:before{content:\"\\f239\"}.ivu-icon-ios-more:before{content:\"\\f23a\"}.ivu-icon-ios-move:before{content:\"\\f23b\"}.ivu-icon-ios-musical-note-outline:before{content:\"\\f23c\"}.ivu-icon-ios-musical-note:before{content:\"\\f23d\"}.ivu-icon-ios-musical-notes-outline:before{content:\"\\f23e\"}.ivu-icon-ios-musical-notes:before{content:\"\\f23f\"}.ivu-icon-ios-navigate-outline:before{content:\"\\f240\"}.ivu-icon-ios-navigate:before{content:\"\\f241\"}.ivu-icon-ios-no-smoking-outline:before{content:\"\\f242\"}.ivu-icon-ios-no-smoking:before{content:\"\\f243\"}.ivu-icon-ios-notifications-off-outline:before{content:\"\\f244\"}.ivu-icon-ios-notifications-off:before{content:\"\\f245\"}.ivu-icon-ios-notifications-outline:before{content:\"\\f246\"}.ivu-icon-ios-notifications:before{content:\"\\f247\"}.ivu-icon-ios-nuclear-outline:before{content:\"\\f248\"}.ivu-icon-ios-nuclear:before{content:\"\\f249\"}.ivu-icon-ios-nutrition-outline:before{content:\"\\f24a\"}.ivu-icon-ios-nutrition:before{content:\"\\f24b\"}.ivu-icon-ios-open-outline:before{content:\"\\f24c\"}.ivu-icon-ios-open:before{content:\"\\f24d\"}.ivu-icon-ios-options-outline:before{content:\"\\f24e\"}.ivu-icon-ios-options:before{content:\"\\f24f\"}.ivu-icon-ios-outlet-outline:before{content:\"\\f250\"}.ivu-icon-ios-outlet:before{content:\"\\f251\"}.ivu-icon-ios-paper-outline:before{content:\"\\f252\"}.ivu-icon-ios-paper-plane-outline:before{content:\"\\f253\"}.ivu-icon-ios-paper-plane:before{content:\"\\f254\"}.ivu-icon-ios-paper:before{content:\"\\f255\"}.ivu-icon-ios-partly-sunny-outline:before{content:\"\\f256\"}.ivu-icon-ios-partly-sunny:before{content:\"\\f257\"}.ivu-icon-ios-pause-outline:before{content:\"\\f258\"}.ivu-icon-ios-pause:before{content:\"\\f259\"}.ivu-icon-ios-paw-outline:before{content:\"\\f25a\"}.ivu-icon-ios-paw:before{content:\"\\f25b\"}.ivu-icon-ios-people-outline:before{content:\"\\f25c\"}.ivu-icon-ios-people:before{content:\"\\f25d\"}.ivu-icon-ios-person-add-outline:before{content:\"\\f25e\"}.ivu-icon-ios-person-add:before{content:\"\\f25f\"}.ivu-icon-ios-person-outline:before{content:\"\\f260\"}.ivu-icon-ios-person:before{content:\"\\f261\"}.ivu-icon-ios-phone-landscape:before{content:\"\\f262\"}.ivu-icon-ios-phone-portrait:before{content:\"\\f263\"}.ivu-icon-ios-photos-outline:before{content:\"\\f264\"}.ivu-icon-ios-photos:before{content:\"\\f265\"}.ivu-icon-ios-pie-outline:before{content:\"\\f266\"}.ivu-icon-ios-pie:before{content:\"\\f267\"}.ivu-icon-ios-pin-outline:before{content:\"\\f268\"}.ivu-icon-ios-pin:before{content:\"\\f269\"}.ivu-icon-ios-pint-outline:before{content:\"\\f26a\"}.ivu-icon-ios-pint:before{content:\"\\f26b\"}.ivu-icon-ios-pizza-outline:before{content:\"\\f26c\"}.ivu-icon-ios-pizza:before{content:\"\\f26d\"}.ivu-icon-ios-plane-outline:before{content:\"\\f26e\"}.ivu-icon-ios-plane:before{content:\"\\f26f\"}.ivu-icon-ios-planet-outline:before{content:\"\\f270\"}.ivu-icon-ios-planet:before{content:\"\\f271\"}.ivu-icon-ios-play-outline:before{content:\"\\f272\"}.ivu-icon-ios-play:before{content:\"\\f273\"}.ivu-icon-ios-podium-outline:before{content:\"\\f274\"}.ivu-icon-ios-podium:before{content:\"\\f275\"}.ivu-icon-ios-power-outline:before{content:\"\\f276\"}.ivu-icon-ios-power:before{content:\"\\f277\"}.ivu-icon-ios-pricetag-outline:before{content:\"\\f278\"}.ivu-icon-ios-pricetag:before{content:\"\\f279\"}.ivu-icon-ios-pricetags-outline:before{content:\"\\f27a\"}.ivu-icon-ios-pricetags:before{content:\"\\f27b\"}.ivu-icon-ios-print-outline:before{content:\"\\f27c\"}.ivu-icon-ios-print:before{content:\"\\f27d\"}.ivu-icon-ios-pulse-outline:before{content:\"\\f27e\"}.ivu-icon-ios-pulse:before{content:\"\\f27f\"}.ivu-icon-ios-qr-scanner:before{content:\"\\f280\"}.ivu-icon-ios-quote-outline:before{content:\"\\f281\"}.ivu-icon-ios-quote:before{content:\"\\f282\"}.ivu-icon-ios-radio-button-off:before{content:\"\\f283\"}.ivu-icon-ios-radio-button-on:before{content:\"\\f284\"}.ivu-icon-ios-radio-outline:before{content:\"\\f285\"}.ivu-icon-ios-radio:before{content:\"\\f286\"}.ivu-icon-ios-rainy-outline:before{content:\"\\f287\"}.ivu-icon-ios-rainy:before{content:\"\\f288\"}.ivu-icon-ios-recording-outline:before{content:\"\\f289\"}.ivu-icon-ios-recording:before{content:\"\\f28a\"}.ivu-icon-ios-redo-outline:before{content:\"\\f28b\"}.ivu-icon-ios-redo:before{content:\"\\f28c\"}.ivu-icon-ios-refresh-circle-outline:before{content:\"\\f28d\"}.ivu-icon-ios-refresh-circle:before{content:\"\\f28e\"}.ivu-icon-ios-refresh:before{content:\"\\f28f\"}.ivu-icon-ios-remove-circle-outline:before{content:\"\\f290\"}.ivu-icon-ios-remove-circle:before{content:\"\\f291\"}.ivu-icon-ios-remove:before{content:\"\\f292\"}.ivu-icon-ios-reorder:before{content:\"\\f293\"}.ivu-icon-ios-repeat:before{content:\"\\f294\"}.ivu-icon-ios-resize:before{content:\"\\f295\"}.ivu-icon-ios-restaurant-outline:before{content:\"\\f296\"}.ivu-icon-ios-restaurant:before{content:\"\\f297\"}.ivu-icon-ios-return-left:before{content:\"\\f298\"}.ivu-icon-ios-return-right:before{content:\"\\f299\"}.ivu-icon-ios-reverse-camera-outline:before{content:\"\\f29a\"}.ivu-icon-ios-reverse-camera:before{content:\"\\f29b\"}.ivu-icon-ios-rewind-outline:before{content:\"\\f29c\"}.ivu-icon-ios-rewind:before{content:\"\\f29d\"}.ivu-icon-ios-ribbon-outline:before{content:\"\\f29e\"}.ivu-icon-ios-ribbon:before{content:\"\\f29f\"}.ivu-icon-ios-rose-outline:before{content:\"\\f2a0\"}.ivu-icon-ios-rose:before{content:\"\\f2a1\"}.ivu-icon-ios-sad-outline:before{content:\"\\f2a2\"}.ivu-icon-ios-sad:before{content:\"\\f2a3\"}.ivu-icon-ios-school-outline:before{content:\"\\f2a4\"}.ivu-icon-ios-school:before{content:\"\\f2a5\"}.ivu-icon-ios-search-outline:before{content:\"\\f2a6\"}.ivu-icon-ios-search:before{content:\"\\f2a7\"}.ivu-icon-ios-send-outline:before{content:\"\\f2a8\"}.ivu-icon-ios-send:before{content:\"\\f2a9\"}.ivu-icon-ios-settings-outline:before{content:\"\\f2aa\"}.ivu-icon-ios-settings:before{content:\"\\f2ab\"}.ivu-icon-ios-share-alt-outline:before{content:\"\\f2ac\"}.ivu-icon-ios-share-alt:before{content:\"\\f2ad\"}.ivu-icon-ios-share-outline:before{content:\"\\f2ae\"}.ivu-icon-ios-share:before{content:\"\\f2af\"}.ivu-icon-ios-shirt-outline:before{content:\"\\f2b0\"}.ivu-icon-ios-shirt:before{content:\"\\f2b1\"}.ivu-icon-ios-shuffle:before{content:\"\\f2b2\"}.ivu-icon-ios-skip-backward-outline:before{content:\"\\f2b3\"}.ivu-icon-ios-skip-backward:before{content:\"\\f2b4\"}.ivu-icon-ios-skip-forward-outline:before{content:\"\\f2b5\"}.ivu-icon-ios-skip-forward:before{content:\"\\f2b6\"}.ivu-icon-ios-snow-outline:before{content:\"\\f2b7\"}.ivu-icon-ios-snow:before{content:\"\\f2b8\"}.ivu-icon-ios-speedometer-outline:before{content:\"\\f2b9\"}.ivu-icon-ios-speedometer:before{content:\"\\f2ba\"}.ivu-icon-ios-square-outline:before{content:\"\\f2bb\"}.ivu-icon-ios-square:before{content:\"\\f2bc\"}.ivu-icon-ios-star-half:before{content:\"\\f2bd\"}.ivu-icon-ios-star-outline:before{content:\"\\f2be\"}.ivu-icon-ios-star:before{content:\"\\f2bf\"}.ivu-icon-ios-stats-outline:before{content:\"\\f2c0\"}.ivu-icon-ios-stats:before{content:\"\\f2c1\"}.ivu-icon-ios-stopwatch-outline:before{content:\"\\f2c2\"}.ivu-icon-ios-stopwatch:before{content:\"\\f2c3\"}.ivu-icon-ios-subway-outline:before{content:\"\\f2c4\"}.ivu-icon-ios-subway:before{content:\"\\f2c5\"}.ivu-icon-ios-sunny-outline:before{content:\"\\f2c6\"}.ivu-icon-ios-sunny:before{content:\"\\f2c7\"}.ivu-icon-ios-swap:before{content:\"\\f2c8\"}.ivu-icon-ios-switch-outline:before{content:\"\\f2c9\"}.ivu-icon-ios-switch:before{content:\"\\f2ca\"}.ivu-icon-ios-sync:before{content:\"\\f2cb\"}.ivu-icon-ios-tablet-landscape:before{content:\"\\f2cc\"}.ivu-icon-ios-tablet-portrait:before{content:\"\\f2cd\"}.ivu-icon-ios-tennisball-outline:before{content:\"\\f2ce\"}.ivu-icon-ios-tennisball:before{content:\"\\f2cf\"}.ivu-icon-ios-text-outline:before{content:\"\\f2d0\"}.ivu-icon-ios-text:before{content:\"\\f2d1\"}.ivu-icon-ios-thermometer-outline:before{content:\"\\f2d2\"}.ivu-icon-ios-thermometer:before{content:\"\\f2d3\"}.ivu-icon-ios-thumbs-down-outline:before{content:\"\\f2d4\"}.ivu-icon-ios-thumbs-down:before{content:\"\\f2d5\"}.ivu-icon-ios-thumbs-up-outline:before{content:\"\\f2d6\"}.ivu-icon-ios-thumbs-up:before{content:\"\\f2d7\"}.ivu-icon-ios-thunderstorm-outline:before{content:\"\\f2d8\"}.ivu-icon-ios-thunderstorm:before{content:\"\\f2d9\"}.ivu-icon-ios-time-outline:before{content:\"\\f2da\"}.ivu-icon-ios-time:before{content:\"\\f2db\"}.ivu-icon-ios-timer-outline:before{content:\"\\f2dc\"}.ivu-icon-ios-timer:before{content:\"\\f2dd\"}.ivu-icon-ios-train-outline:before{content:\"\\f2de\"}.ivu-icon-ios-train:before{content:\"\\f2df\"}.ivu-icon-ios-transgender:before{content:\"\\f2e0\"}.ivu-icon-ios-trash-outline:before{content:\"\\f2e1\"}.ivu-icon-ios-trash:before{content:\"\\f2e2\"}.ivu-icon-ios-trending-down:before{content:\"\\f2e3\"}.ivu-icon-ios-trending-up:before{content:\"\\f2e4\"}.ivu-icon-ios-trophy-outline:before{content:\"\\f2e5\"}.ivu-icon-ios-trophy:before{content:\"\\f2e6\"}.ivu-icon-ios-umbrella-outline:before{content:\"\\f2e7\"}.ivu-icon-ios-umbrella:before{content:\"\\f2e8\"}.ivu-icon-ios-undo-outline:before{content:\"\\f2e9\"}.ivu-icon-ios-undo:before{content:\"\\f2ea\"}.ivu-icon-ios-unlock-outline:before{content:\"\\f2eb\"}.ivu-icon-ios-unlock:before{content:\"\\f2ec\"}.ivu-icon-ios-videocam-outline:before{content:\"\\f2ed\"}.ivu-icon-ios-videocam:before{content:\"\\f2ee\"}.ivu-icon-ios-volume-down:before{content:\"\\f2ef\"}.ivu-icon-ios-volume-mute:before{content:\"\\f2f0\"}.ivu-icon-ios-volume-off:before{content:\"\\f2f1\"}.ivu-icon-ios-volume-up:before{content:\"\\f2f2\"}.ivu-icon-ios-walk:before{content:\"\\f2f3\"}.ivu-icon-ios-warning-outline:before{content:\"\\f2f4\"}.ivu-icon-ios-warning:before{content:\"\\f2f5\"}.ivu-icon-ios-watch:before{content:\"\\f2f6\"}.ivu-icon-ios-water-outline:before{content:\"\\f2f7\"}.ivu-icon-ios-water:before{content:\"\\f2f8\"}.ivu-icon-ios-wifi-outline:before{content:\"\\f2f9\"}.ivu-icon-ios-wifi:before{content:\"\\f2fa\"}.ivu-icon-ios-wine-outline:before{content:\"\\f2fb\"}.ivu-icon-ios-wine:before{content:\"\\f2fc\"}.ivu-icon-ios-woman-outline:before{content:\"\\f2fd\"}.ivu-icon-ios-woman:before{content:\"\\f2fe\"}.ivu-icon-logo-android:before{content:\"\\f2ff\"}.ivu-icon-logo-angular:before{content:\"\\f300\"}.ivu-icon-logo-apple:before{content:\"\\f301\"}.ivu-icon-logo-bitcoin:before{content:\"\\f302\"}.ivu-icon-logo-buffer:before{content:\"\\f303\"}.ivu-icon-logo-chrome:before{content:\"\\f304\"}.ivu-icon-logo-codepen:before{content:\"\\f305\"}.ivu-icon-logo-css3:before{content:\"\\f306\"}.ivu-icon-logo-designernews:before{content:\"\\f307\"}.ivu-icon-logo-dribbble:before{content:\"\\f308\"}.ivu-icon-logo-dropbox:before{content:\"\\f309\"}.ivu-icon-logo-euro:before{content:\"\\f30a\"}.ivu-icon-logo-facebook:before{content:\"\\f30b\"}.ivu-icon-logo-foursquare:before{content:\"\\f30c\"}.ivu-icon-logo-freebsd-devil:before{content:\"\\f30d\"}.ivu-icon-logo-github:before{content:\"\\f30e\"}.ivu-icon-logo-google:before{content:\"\\f30f\"}.ivu-icon-logo-googleplus:before{content:\"\\f310\"}.ivu-icon-logo-hackernews:before{content:\"\\f311\"}.ivu-icon-logo-html5:before{content:\"\\f312\"}.ivu-icon-logo-instagram:before{content:\"\\f313\"}.ivu-icon-logo-javascript:before{content:\"\\f314\"}.ivu-icon-logo-linkedin:before{content:\"\\f315\"}.ivu-icon-logo-markdown:before{content:\"\\f316\"}.ivu-icon-logo-nodejs:before{content:\"\\f317\"}.ivu-icon-logo-octocat:before{content:\"\\f318\"}.ivu-icon-logo-pinterest:before{content:\"\\f319\"}.ivu-icon-logo-playstation:before{content:\"\\f31a\"}.ivu-icon-logo-python:before{content:\"\\f31b\"}.ivu-icon-logo-reddit:before{content:\"\\f31c\"}.ivu-icon-logo-rss:before{content:\"\\f31d\"}.ivu-icon-logo-sass:before{content:\"\\f31e\"}.ivu-icon-logo-skype:before{content:\"\\f31f\"}.ivu-icon-logo-snapchat:before{content:\"\\f320\"}.ivu-icon-logo-steam:before{content:\"\\f321\"}.ivu-icon-logo-tumblr:before{content:\"\\f322\"}.ivu-icon-logo-tux:before{content:\"\\f323\"}.ivu-icon-logo-twitch:before{content:\"\\f324\"}.ivu-icon-logo-twitter:before{content:\"\\f325\"}.ivu-icon-logo-usd:before{content:\"\\f326\"}.ivu-icon-logo-vimeo:before{content:\"\\f327\"}.ivu-icon-logo-whatsapp:before{content:\"\\f328\"}.ivu-icon-logo-windows:before{content:\"\\f329\"}.ivu-icon-logo-wordpress:before{content:\"\\f32a\"}.ivu-icon-logo-xbox:before{content:\"\\f32b\"}.ivu-icon-logo-yahoo:before{content:\"\\f32c\"}.ivu-icon-logo-yen:before{content:\"\\f32d\"}.ivu-icon-logo-youtube:before{content:\"\\f32e\"}.ivu-icon-md-add-circle:before{content:\"\\f32f\"}.ivu-icon-md-add:before{content:\"\\f330\"}.ivu-icon-md-alarm:before{content:\"\\f331\"}.ivu-icon-md-albums:before{content:\"\\f332\"}.ivu-icon-md-alert:before{content:\"\\f333\"}.ivu-icon-md-american-football:before{content:\"\\f334\"}.ivu-icon-md-analytics:before{content:\"\\f335\"}.ivu-icon-md-aperture:before{content:\"\\f336\"}.ivu-icon-md-apps:before{content:\"\\f337\"}.ivu-icon-md-appstore:before{content:\"\\f338\"}.ivu-icon-md-archive:before{content:\"\\f339\"}.ivu-icon-md-arrow-back:before{content:\"\\f33a\"}.ivu-icon-md-arrow-down:before{content:\"\\f33b\"}.ivu-icon-md-arrow-dropdown-circle:before{content:\"\\f33c\"}.ivu-icon-md-arrow-dropdown:before{content:\"\\f33d\"}.ivu-icon-md-arrow-dropleft-circle:before{content:\"\\f33e\"}.ivu-icon-md-arrow-dropleft:before{content:\"\\f33f\"}.ivu-icon-md-arrow-dropright-circle:before{content:\"\\f340\"}.ivu-icon-md-arrow-dropright:before{content:\"\\f341\"}.ivu-icon-md-arrow-dropup-circle:before{content:\"\\f342\"}.ivu-icon-md-arrow-dropup:before{content:\"\\f343\"}.ivu-icon-md-arrow-forward:before{content:\"\\f344\"}.ivu-icon-md-arrow-round-back:before{content:\"\\f345\"}.ivu-icon-md-arrow-round-down:before{content:\"\\f346\"}.ivu-icon-md-arrow-round-forward:before{content:\"\\f347\"}.ivu-icon-md-arrow-round-up:before{content:\"\\f348\"}.ivu-icon-md-arrow-up:before{content:\"\\f349\"}.ivu-icon-md-at:before{content:\"\\f34a\"}.ivu-icon-md-attach:before{content:\"\\f34b\"}.ivu-icon-md-backspace:before{content:\"\\f34c\"}.ivu-icon-md-barcode:before{content:\"\\f34d\"}.ivu-icon-md-baseball:before{content:\"\\f34e\"}.ivu-icon-md-basket:before{content:\"\\f34f\"}.ivu-icon-md-basketball:before{content:\"\\f350\"}.ivu-icon-md-battery-charging:before{content:\"\\f351\"}.ivu-icon-md-battery-dead:before{content:\"\\f352\"}.ivu-icon-md-battery-full:before{content:\"\\f353\"}.ivu-icon-md-beaker:before{content:\"\\f354\"}.ivu-icon-md-beer:before{content:\"\\f355\"}.ivu-icon-md-bicycle:before{content:\"\\f356\"}.ivu-icon-md-bluetooth:before{content:\"\\f357\"}.ivu-icon-md-boat:before{content:\"\\f358\"}.ivu-icon-md-body:before{content:\"\\f359\"}.ivu-icon-md-bonfire:before{content:\"\\f35a\"}.ivu-icon-md-book:before{content:\"\\f35b\"}.ivu-icon-md-bookmark:before{content:\"\\f35c\"}.ivu-icon-md-bookmarks:before{content:\"\\f35d\"}.ivu-icon-md-bowtie:before{content:\"\\f35e\"}.ivu-icon-md-briefcase:before{content:\"\\f35f\"}.ivu-icon-md-browsers:before{content:\"\\f360\"}.ivu-icon-md-brush:before{content:\"\\f361\"}.ivu-icon-md-bug:before{content:\"\\f362\"}.ivu-icon-md-build:before{content:\"\\f363\"}.ivu-icon-md-bulb:before{content:\"\\f364\"}.ivu-icon-md-bus:before{content:\"\\f365\"}.ivu-icon-md-cafe:before{content:\"\\f366\"}.ivu-icon-md-calculator:before{content:\"\\f367\"}.ivu-icon-md-calendar:before{content:\"\\f368\"}.ivu-icon-md-call:before{content:\"\\f369\"}.ivu-icon-md-camera:before{content:\"\\f36a\"}.ivu-icon-md-car:before{content:\"\\f36b\"}.ivu-icon-md-card:before{content:\"\\f36c\"}.ivu-icon-md-cart:before{content:\"\\f36d\"}.ivu-icon-md-cash:before{content:\"\\f36e\"}.ivu-icon-md-chatboxes:before{content:\"\\f36f\"}.ivu-icon-md-chatbubbles:before{content:\"\\f370\"}.ivu-icon-md-checkbox-outline:before{content:\"\\f371\"}.ivu-icon-md-checkbox:before{content:\"\\f372\"}.ivu-icon-md-checkmark-circle-outline:before{content:\"\\f373\"}.ivu-icon-md-checkmark-circle:before{content:\"\\f374\"}.ivu-icon-md-checkmark:before{content:\"\\f375\"}.ivu-icon-md-clipboard:before{content:\"\\f376\"}.ivu-icon-md-clock:before{content:\"\\f377\"}.ivu-icon-md-close-circle:before{content:\"\\f378\"}.ivu-icon-md-close:before{content:\"\\f379\"}.ivu-icon-md-closed-captioning:before{content:\"\\f37a\"}.ivu-icon-md-cloud-circle:before{content:\"\\f37b\"}.ivu-icon-md-cloud-done:before{content:\"\\f37c\"}.ivu-icon-md-cloud-download:before{content:\"\\f37d\"}.ivu-icon-md-cloud-outline:before{content:\"\\f37e\"}.ivu-icon-md-cloud-upload:before{content:\"\\f37f\"}.ivu-icon-md-cloud:before{content:\"\\f380\"}.ivu-icon-md-cloudy-night:before{content:\"\\f381\"}.ivu-icon-md-cloudy:before{content:\"\\f382\"}.ivu-icon-md-code-download:before{content:\"\\f383\"}.ivu-icon-md-code-working:before{content:\"\\f384\"}.ivu-icon-md-code:before{content:\"\\f385\"}.ivu-icon-md-cog:before{content:\"\\f386\"}.ivu-icon-md-color-fill:before{content:\"\\f387\"}.ivu-icon-md-color-filter:before{content:\"\\f388\"}.ivu-icon-md-color-palette:before{content:\"\\f389\"}.ivu-icon-md-color-wand:before{content:\"\\f38a\"}.ivu-icon-md-compass:before{content:\"\\f38b\"}.ivu-icon-md-construct:before{content:\"\\f38c\"}.ivu-icon-md-contact:before{content:\"\\f38d\"}.ivu-icon-md-contacts:before{content:\"\\f38e\"}.ivu-icon-md-contract:before{content:\"\\f38f\"}.ivu-icon-md-contrast:before{content:\"\\f390\"}.ivu-icon-md-copy:before{content:\"\\f391\"}.ivu-icon-md-create:before{content:\"\\f392\"}.ivu-icon-md-crop:before{content:\"\\f393\"}.ivu-icon-md-cube:before{content:\"\\f394\"}.ivu-icon-md-cut:before{content:\"\\f395\"}.ivu-icon-md-desktop:before{content:\"\\f396\"}.ivu-icon-md-disc:before{content:\"\\f397\"}.ivu-icon-md-document:before{content:\"\\f398\"}.ivu-icon-md-done-all:before{content:\"\\f399\"}.ivu-icon-md-download:before{content:\"\\f39a\"}.ivu-icon-md-easel:before{content:\"\\f39b\"}.ivu-icon-md-egg:before{content:\"\\f39c\"}.ivu-icon-md-exit:before{content:\"\\f39d\"}.ivu-icon-md-expand:before{content:\"\\f39e\"}.ivu-icon-md-eye-off:before{content:\"\\f39f\"}.ivu-icon-md-eye:before{content:\"\\f3a0\"}.ivu-icon-md-fastforward:before{content:\"\\f3a1\"}.ivu-icon-md-female:before{content:\"\\f3a2\"}.ivu-icon-md-filing:before{content:\"\\f3a3\"}.ivu-icon-md-film:before{content:\"\\f3a4\"}.ivu-icon-md-finger-print:before{content:\"\\f3a5\"}.ivu-icon-md-flag:before{content:\"\\f3a6\"}.ivu-icon-md-flame:before{content:\"\\f3a7\"}.ivu-icon-md-flash:before{content:\"\\f3a8\"}.ivu-icon-md-flask:before{content:\"\\f3a9\"}.ivu-icon-md-flower:before{content:\"\\f3aa\"}.ivu-icon-md-folder-open:before{content:\"\\f3ab\"}.ivu-icon-md-folder:before{content:\"\\f3ac\"}.ivu-icon-md-football:before{content:\"\\f3ad\"}.ivu-icon-md-funnel:before{content:\"\\f3ae\"}.ivu-icon-md-game-controller-a:before{content:\"\\f3af\"}.ivu-icon-md-game-controller-b:before{content:\"\\f3b0\"}.ivu-icon-md-git-branch:before{content:\"\\f3b1\"}.ivu-icon-md-git-commit:before{content:\"\\f3b2\"}.ivu-icon-md-git-compare:before{content:\"\\f3b3\"}.ivu-icon-md-git-merge:before{content:\"\\f3b4\"}.ivu-icon-md-git-network:before{content:\"\\f3b5\"}.ivu-icon-md-git-pull-request:before{content:\"\\f3b6\"}.ivu-icon-md-glasses:before{content:\"\\f3b7\"}.ivu-icon-md-globe:before{content:\"\\f3b8\"}.ivu-icon-md-grid:before{content:\"\\f3b9\"}.ivu-icon-md-hammer:before{content:\"\\f3ba\"}.ivu-icon-md-hand:before{content:\"\\f3bb\"}.ivu-icon-md-happy:before{content:\"\\f3bc\"}.ivu-icon-md-headset:before{content:\"\\f3bd\"}.ivu-icon-md-heart-outline:before{content:\"\\f3be\"}.ivu-icon-md-heart:before{content:\"\\f3bf\"}.ivu-icon-md-help-buoy:before{content:\"\\f3c0\"}.ivu-icon-md-help-circle:before{content:\"\\f3c1\"}.ivu-icon-md-help:before{content:\"\\f3c2\"}.ivu-icon-md-home:before{content:\"\\f3c3\"}.ivu-icon-md-ice-cream:before{content:\"\\f3c4\"}.ivu-icon-md-image:before{content:\"\\f3c5\"}.ivu-icon-md-images:before{content:\"\\f3c6\"}.ivu-icon-md-infinite:before{content:\"\\f3c7\"}.ivu-icon-md-information-circle:before{content:\"\\f3c8\"}.ivu-icon-md-information:before{content:\"\\f3c9\"}.ivu-icon-md-ionic:before{content:\"\\f3ca\"}.ivu-icon-md-ionitron:before{content:\"\\f3cb\"}.ivu-icon-md-jet:before{content:\"\\f3cc\"}.ivu-icon-md-key:before{content:\"\\f3cd\"}.ivu-icon-md-keypad:before{content:\"\\f3ce\"}.ivu-icon-md-laptop:before{content:\"\\f3cf\"}.ivu-icon-md-leaf:before{content:\"\\f3d0\"}.ivu-icon-md-link:before{content:\"\\f3d1\"}.ivu-icon-md-list-box:before{content:\"\\f3d2\"}.ivu-icon-md-list:before{content:\"\\f3d3\"}.ivu-icon-md-locate:before{content:\"\\f3d4\"}.ivu-icon-md-lock:before{content:\"\\f3d5\"}.ivu-icon-md-log-in:before{content:\"\\f3d6\"}.ivu-icon-md-log-out:before{content:\"\\f3d7\"}.ivu-icon-md-magnet:before{content:\"\\f3d8\"}.ivu-icon-md-mail-open:before{content:\"\\f3d9\"}.ivu-icon-md-mail:before{content:\"\\f3da\"}.ivu-icon-md-male:before{content:\"\\f3db\"}.ivu-icon-md-man:before{content:\"\\f3dc\"}.ivu-icon-md-map:before{content:\"\\f3dd\"}.ivu-icon-md-medal:before{content:\"\\f3de\"}.ivu-icon-md-medical:before{content:\"\\f3df\"}.ivu-icon-md-medkit:before{content:\"\\f3e0\"}.ivu-icon-md-megaphone:before{content:\"\\f3e1\"}.ivu-icon-md-menu:before{content:\"\\f3e2\"}.ivu-icon-md-mic-off:before{content:\"\\f3e3\"}.ivu-icon-md-mic:before{content:\"\\f3e4\"}.ivu-icon-md-microphone:before{content:\"\\f3e5\"}.ivu-icon-md-moon:before{content:\"\\f3e6\"}.ivu-icon-md-more:before{content:\"\\f3e7\"}.ivu-icon-md-move:before{content:\"\\f3e8\"}.ivu-icon-md-musical-note:before{content:\"\\f3e9\"}.ivu-icon-md-musical-notes:before{content:\"\\f3ea\"}.ivu-icon-md-navigate:before{content:\"\\f3eb\"}.ivu-icon-md-no-smoking:before{content:\"\\f3ec\"}.ivu-icon-md-notifications-off:before{content:\"\\f3ed\"}.ivu-icon-md-notifications-outline:before{content:\"\\f3ee\"}.ivu-icon-md-notifications:before{content:\"\\f3ef\"}.ivu-icon-md-nuclear:before{content:\"\\f3f0\"}.ivu-icon-md-nutrition:before{content:\"\\f3f1\"}.ivu-icon-md-open:before{content:\"\\f3f2\"}.ivu-icon-md-options:before{content:\"\\f3f3\"}.ivu-icon-md-outlet:before{content:\"\\f3f4\"}.ivu-icon-md-paper-plane:before{content:\"\\f3f5\"}.ivu-icon-md-paper:before{content:\"\\f3f6\"}.ivu-icon-md-partly-sunny:before{content:\"\\f3f7\"}.ivu-icon-md-pause:before{content:\"\\f3f8\"}.ivu-icon-md-paw:before{content:\"\\f3f9\"}.ivu-icon-md-people:before{content:\"\\f3fa\"}.ivu-icon-md-person-add:before{content:\"\\f3fb\"}.ivu-icon-md-person:before{content:\"\\f3fc\"}.ivu-icon-md-phone-landscape:before{content:\"\\f3fd\"}.ivu-icon-md-phone-portrait:before{content:\"\\f3fe\"}.ivu-icon-md-photos:before{content:\"\\f3ff\"}.ivu-icon-md-pie:before{content:\"\\f400\"}.ivu-icon-md-pin:before{content:\"\\f401\"}.ivu-icon-md-pint:before{content:\"\\f402\"}.ivu-icon-md-pizza:before{content:\"\\f403\"}.ivu-icon-md-plane:before{content:\"\\f404\"}.ivu-icon-md-planet:before{content:\"\\f405\"}.ivu-icon-md-play:before{content:\"\\f406\"}.ivu-icon-md-podium:before{content:\"\\f407\"}.ivu-icon-md-power:before{content:\"\\f408\"}.ivu-icon-md-pricetag:before{content:\"\\f409\"}.ivu-icon-md-pricetags:before{content:\"\\f40a\"}.ivu-icon-md-print:before{content:\"\\f40b\"}.ivu-icon-md-pulse:before{content:\"\\f40c\"}.ivu-icon-md-qr-scanner:before{content:\"\\f40d\"}.ivu-icon-md-quote:before{content:\"\\f40e\"}.ivu-icon-md-radio-button-off:before{content:\"\\f40f\"}.ivu-icon-md-radio-button-on:before{content:\"\\f410\"}.ivu-icon-md-radio:before{content:\"\\f411\"}.ivu-icon-md-rainy:before{content:\"\\f412\"}.ivu-icon-md-recording:before{content:\"\\f413\"}.ivu-icon-md-redo:before{content:\"\\f414\"}.ivu-icon-md-refresh-circle:before{content:\"\\f415\"}.ivu-icon-md-refresh:before{content:\"\\f416\"}.ivu-icon-md-remove-circle:before{content:\"\\f417\"}.ivu-icon-md-remove:before{content:\"\\f418\"}.ivu-icon-md-reorder:before{content:\"\\f419\"}.ivu-icon-md-repeat:before{content:\"\\f41a\"}.ivu-icon-md-resize:before{content:\"\\f41b\"}.ivu-icon-md-restaurant:before{content:\"\\f41c\"}.ivu-icon-md-return-left:before{content:\"\\f41d\"}.ivu-icon-md-return-right:before{content:\"\\f41e\"}.ivu-icon-md-reverse-camera:before{content:\"\\f41f\"}.ivu-icon-md-rewind:before{content:\"\\f420\"}.ivu-icon-md-ribbon:before{content:\"\\f421\"}.ivu-icon-md-rose:before{content:\"\\f422\"}.ivu-icon-md-sad:before{content:\"\\f423\"}.ivu-icon-md-school:before{content:\"\\f424\"}.ivu-icon-md-search:before{content:\"\\f425\"}.ivu-icon-md-send:before{content:\"\\f426\"}.ivu-icon-md-settings:before{content:\"\\f427\"}.ivu-icon-md-share-alt:before{content:\"\\f428\"}.ivu-icon-md-share:before{content:\"\\f429\"}.ivu-icon-md-shirt:before{content:\"\\f42a\"}.ivu-icon-md-shuffle:before{content:\"\\f42b\"}.ivu-icon-md-skip-backward:before{content:\"\\f42c\"}.ivu-icon-md-skip-forward:before{content:\"\\f42d\"}.ivu-icon-md-snow:before{content:\"\\f42e\"}.ivu-icon-md-speedometer:before{content:\"\\f42f\"}.ivu-icon-md-square-outline:before{content:\"\\f430\"}.ivu-icon-md-square:before{content:\"\\f431\"}.ivu-icon-md-star-half:before{content:\"\\f432\"}.ivu-icon-md-star-outline:before{content:\"\\f433\"}.ivu-icon-md-star:before{content:\"\\f434\"}.ivu-icon-md-stats:before{content:\"\\f435\"}.ivu-icon-md-stopwatch:before{content:\"\\f436\"}.ivu-icon-md-subway:before{content:\"\\f437\"}.ivu-icon-md-sunny:before{content:\"\\f438\"}.ivu-icon-md-swap:before{content:\"\\f439\"}.ivu-icon-md-switch:before{content:\"\\f43a\"}.ivu-icon-md-sync:before{content:\"\\f43b\"}.ivu-icon-md-tablet-landscape:before{content:\"\\f43c\"}.ivu-icon-md-tablet-portrait:before{content:\"\\f43d\"}.ivu-icon-md-tennisball:before{content:\"\\f43e\"}.ivu-icon-md-text:before{content:\"\\f43f\"}.ivu-icon-md-thermometer:before{content:\"\\f440\"}.ivu-icon-md-thumbs-down:before{content:\"\\f441\"}.ivu-icon-md-thumbs-up:before{content:\"\\f442\"}.ivu-icon-md-thunderstorm:before{content:\"\\f443\"}.ivu-icon-md-time:before{content:\"\\f444\"}.ivu-icon-md-timer:before{content:\"\\f445\"}.ivu-icon-md-train:before{content:\"\\f446\"}.ivu-icon-md-transgender:before{content:\"\\f447\"}.ivu-icon-md-trash:before{content:\"\\f448\"}.ivu-icon-md-trending-down:before{content:\"\\f449\"}.ivu-icon-md-trending-up:before{content:\"\\f44a\"}.ivu-icon-md-trophy:before{content:\"\\f44b\"}.ivu-icon-md-umbrella:before{content:\"\\f44c\"}.ivu-icon-md-undo:before{content:\"\\f44d\"}.ivu-icon-md-unlock:before{content:\"\\f44e\"}.ivu-icon-md-videocam:before{content:\"\\f44f\"}.ivu-icon-md-volume-down:before{content:\"\\f450\"}.ivu-icon-md-volume-mute:before{content:\"\\f451\"}.ivu-icon-md-volume-off:before{content:\"\\f452\"}.ivu-icon-md-volume-up:before{content:\"\\f453\"}.ivu-icon-md-walk:before{content:\"\\f454\"}.ivu-icon-md-warning:before{content:\"\\f455\"}.ivu-icon-md-watch:before{content:\"\\f456\"}.ivu-icon-md-water:before{content:\"\\f457\"}.ivu-icon-md-wifi:before{content:\"\\f458\"}.ivu-icon-md-wine:before{content:\"\\f459\"}.ivu-icon-md-woman:before{content:\"\\f45a\"}.ivu-icon-ios-loading:before{content:\"\\f45b\"}.ivu-row{position:relative;margin-left:0;margin-right:0;height:auto;zoom:1;display:block}.ivu-row:after,.ivu-row:before{content:\"\";display:table}.ivu-row:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-row-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.ivu-row-flex:after,.ivu-row-flex:before{display:-webkit-box;display:-ms-flexbox;display:flex}.ivu-row-flex-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.ivu-row-flex-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ivu-row-flex-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.ivu-row-flex-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.ivu-row-flex-space-around{-ms-flex-pack:distribute;justify-content:space-around}.ivu-row-flex-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.ivu-row-flex-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-row-flex-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.ivu-col{position:relative;display:block}.ivu-col-span-1,.ivu-col-span-10,.ivu-col-span-11,.ivu-col-span-12,.ivu-col-span-13,.ivu-col-span-14,.ivu-col-span-15,.ivu-col-span-16,.ivu-col-span-17,.ivu-col-span-18,.ivu-col-span-19,.ivu-col-span-2,.ivu-col-span-20,.ivu-col-span-21,.ivu-col-span-22,.ivu-col-span-23,.ivu-col-span-24,.ivu-col-span-3,.ivu-col-span-4,.ivu-col-span-5,.ivu-col-span-6,.ivu-col-span-7,.ivu-col-span-8,.ivu-col-span-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-24{display:block;width:100%}.ivu-col-push-24{left:100%}.ivu-col-pull-24{right:100%}.ivu-col-offset-24{margin-left:100%}.ivu-col-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-23{display:block;width:95.83333333%}.ivu-col-push-23{left:95.83333333%}.ivu-col-pull-23{right:95.83333333%}.ivu-col-offset-23{margin-left:95.83333333%}.ivu-col-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-22{display:block;width:91.66666667%}.ivu-col-push-22{left:91.66666667%}.ivu-col-pull-22{right:91.66666667%}.ivu-col-offset-22{margin-left:91.66666667%}.ivu-col-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-21{display:block;width:87.5%}.ivu-col-push-21{left:87.5%}.ivu-col-pull-21{right:87.5%}.ivu-col-offset-21{margin-left:87.5%}.ivu-col-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-20{display:block;width:83.33333333%}.ivu-col-push-20{left:83.33333333%}.ivu-col-pull-20{right:83.33333333%}.ivu-col-offset-20{margin-left:83.33333333%}.ivu-col-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-19{display:block;width:79.16666667%}.ivu-col-push-19{left:79.16666667%}.ivu-col-pull-19{right:79.16666667%}.ivu-col-offset-19{margin-left:79.16666667%}.ivu-col-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-18{display:block;width:75%}.ivu-col-push-18{left:75%}.ivu-col-pull-18{right:75%}.ivu-col-offset-18{margin-left:75%}.ivu-col-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-17{display:block;width:70.83333333%}.ivu-col-push-17{left:70.83333333%}.ivu-col-pull-17{right:70.83333333%}.ivu-col-offset-17{margin-left:70.83333333%}.ivu-col-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-16{display:block;width:66.66666667%}.ivu-col-push-16{left:66.66666667%}.ivu-col-pull-16{right:66.66666667%}.ivu-col-offset-16{margin-left:66.66666667%}.ivu-col-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-15{display:block;width:62.5%}.ivu-col-push-15{left:62.5%}.ivu-col-pull-15{right:62.5%}.ivu-col-offset-15{margin-left:62.5%}.ivu-col-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-14{display:block;width:58.33333333%}.ivu-col-push-14{left:58.33333333%}.ivu-col-pull-14{right:58.33333333%}.ivu-col-offset-14{margin-left:58.33333333%}.ivu-col-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-13{display:block;width:54.16666667%}.ivu-col-push-13{left:54.16666667%}.ivu-col-pull-13{right:54.16666667%}.ivu-col-offset-13{margin-left:54.16666667%}.ivu-col-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-12{display:block;width:50%}.ivu-col-push-12{left:50%}.ivu-col-pull-12{right:50%}.ivu-col-offset-12{margin-left:50%}.ivu-col-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-11{display:block;width:45.83333333%}.ivu-col-push-11{left:45.83333333%}.ivu-col-pull-11{right:45.83333333%}.ivu-col-offset-11{margin-left:45.83333333%}.ivu-col-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-10{display:block;width:41.66666667%}.ivu-col-push-10{left:41.66666667%}.ivu-col-pull-10{right:41.66666667%}.ivu-col-offset-10{margin-left:41.66666667%}.ivu-col-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-9{display:block;width:37.5%}.ivu-col-push-9{left:37.5%}.ivu-col-pull-9{right:37.5%}.ivu-col-offset-9{margin-left:37.5%}.ivu-col-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-8{display:block;width:33.33333333%}.ivu-col-push-8{left:33.33333333%}.ivu-col-pull-8{right:33.33333333%}.ivu-col-offset-8{margin-left:33.33333333%}.ivu-col-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-7{display:block;width:29.16666667%}.ivu-col-push-7{left:29.16666667%}.ivu-col-pull-7{right:29.16666667%}.ivu-col-offset-7{margin-left:29.16666667%}.ivu-col-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-6{display:block;width:25%}.ivu-col-push-6{left:25%}.ivu-col-pull-6{right:25%}.ivu-col-offset-6{margin-left:25%}.ivu-col-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-5{display:block;width:20.83333333%}.ivu-col-push-5{left:20.83333333%}.ivu-col-pull-5{right:20.83333333%}.ivu-col-offset-5{margin-left:20.83333333%}.ivu-col-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-4{display:block;width:16.66666667%}.ivu-col-push-4{left:16.66666667%}.ivu-col-pull-4{right:16.66666667%}.ivu-col-offset-4{margin-left:16.66666667%}.ivu-col-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-3{display:block;width:12.5%}.ivu-col-push-3{left:12.5%}.ivu-col-pull-3{right:12.5%}.ivu-col-offset-3{margin-left:12.5%}.ivu-col-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-2{display:block;width:8.33333333%}.ivu-col-push-2{left:8.33333333%}.ivu-col-pull-2{right:8.33333333%}.ivu-col-offset-2{margin-left:8.33333333%}.ivu-col-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-1{display:block;width:4.16666667%}.ivu-col-push-1{left:4.16666667%}.ivu-col-pull-1{right:4.16666667%}.ivu-col-offset-1{margin-left:4.16666667%}.ivu-col-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-0{display:none}.ivu-col-push-0{left:auto}.ivu-col-pull-0{right:auto}.ivu-col-offset-0{margin-left:0}.ivu-col-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.ivu-col-span-xs-1,.ivu-col-span-xs-10,.ivu-col-span-xs-11,.ivu-col-span-xs-12,.ivu-col-span-xs-13,.ivu-col-span-xs-14,.ivu-col-span-xs-15,.ivu-col-span-xs-16,.ivu-col-span-xs-17,.ivu-col-span-xs-18,.ivu-col-span-xs-19,.ivu-col-span-xs-2,.ivu-col-span-xs-20,.ivu-col-span-xs-21,.ivu-col-span-xs-22,.ivu-col-span-xs-23,.ivu-col-span-xs-24,.ivu-col-span-xs-3,.ivu-col-span-xs-4,.ivu-col-span-xs-5,.ivu-col-span-xs-6,.ivu-col-span-xs-7,.ivu-col-span-xs-8,.ivu-col-span-xs-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xs-24{display:block;width:100%}.ivu-col-xs-push-24{left:100%}.ivu-col-xs-pull-24{right:100%}.ivu-col-xs-offset-24{margin-left:100%}.ivu-col-xs-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xs-23{display:block;width:95.83333333%}.ivu-col-xs-push-23{left:95.83333333%}.ivu-col-xs-pull-23{right:95.83333333%}.ivu-col-xs-offset-23{margin-left:95.83333333%}.ivu-col-xs-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xs-22{display:block;width:91.66666667%}.ivu-col-xs-push-22{left:91.66666667%}.ivu-col-xs-pull-22{right:91.66666667%}.ivu-col-xs-offset-22{margin-left:91.66666667%}.ivu-col-xs-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xs-21{display:block;width:87.5%}.ivu-col-xs-push-21{left:87.5%}.ivu-col-xs-pull-21{right:87.5%}.ivu-col-xs-offset-21{margin-left:87.5%}.ivu-col-xs-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xs-20{display:block;width:83.33333333%}.ivu-col-xs-push-20{left:83.33333333%}.ivu-col-xs-pull-20{right:83.33333333%}.ivu-col-xs-offset-20{margin-left:83.33333333%}.ivu-col-xs-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xs-19{display:block;width:79.16666667%}.ivu-col-xs-push-19{left:79.16666667%}.ivu-col-xs-pull-19{right:79.16666667%}.ivu-col-xs-offset-19{margin-left:79.16666667%}.ivu-col-xs-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xs-18{display:block;width:75%}.ivu-col-xs-push-18{left:75%}.ivu-col-xs-pull-18{right:75%}.ivu-col-xs-offset-18{margin-left:75%}.ivu-col-xs-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xs-17{display:block;width:70.83333333%}.ivu-col-xs-push-17{left:70.83333333%}.ivu-col-xs-pull-17{right:70.83333333%}.ivu-col-xs-offset-17{margin-left:70.83333333%}.ivu-col-xs-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xs-16{display:block;width:66.66666667%}.ivu-col-xs-push-16{left:66.66666667%}.ivu-col-xs-pull-16{right:66.66666667%}.ivu-col-xs-offset-16{margin-left:66.66666667%}.ivu-col-xs-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xs-15{display:block;width:62.5%}.ivu-col-xs-push-15{left:62.5%}.ivu-col-xs-pull-15{right:62.5%}.ivu-col-xs-offset-15{margin-left:62.5%}.ivu-col-xs-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xs-14{display:block;width:58.33333333%}.ivu-col-xs-push-14{left:58.33333333%}.ivu-col-xs-pull-14{right:58.33333333%}.ivu-col-xs-offset-14{margin-left:58.33333333%}.ivu-col-xs-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xs-13{display:block;width:54.16666667%}.ivu-col-xs-push-13{left:54.16666667%}.ivu-col-xs-pull-13{right:54.16666667%}.ivu-col-xs-offset-13{margin-left:54.16666667%}.ivu-col-xs-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xs-12{display:block;width:50%}.ivu-col-xs-push-12{left:50%}.ivu-col-xs-pull-12{right:50%}.ivu-col-xs-offset-12{margin-left:50%}.ivu-col-xs-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xs-11{display:block;width:45.83333333%}.ivu-col-xs-push-11{left:45.83333333%}.ivu-col-xs-pull-11{right:45.83333333%}.ivu-col-xs-offset-11{margin-left:45.83333333%}.ivu-col-xs-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xs-10{display:block;width:41.66666667%}.ivu-col-xs-push-10{left:41.66666667%}.ivu-col-xs-pull-10{right:41.66666667%}.ivu-col-xs-offset-10{margin-left:41.66666667%}.ivu-col-xs-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xs-9{display:block;width:37.5%}.ivu-col-xs-push-9{left:37.5%}.ivu-col-xs-pull-9{right:37.5%}.ivu-col-xs-offset-9{margin-left:37.5%}.ivu-col-xs-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xs-8{display:block;width:33.33333333%}.ivu-col-xs-push-8{left:33.33333333%}.ivu-col-xs-pull-8{right:33.33333333%}.ivu-col-xs-offset-8{margin-left:33.33333333%}.ivu-col-xs-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xs-7{display:block;width:29.16666667%}.ivu-col-xs-push-7{left:29.16666667%}.ivu-col-xs-pull-7{right:29.16666667%}.ivu-col-xs-offset-7{margin-left:29.16666667%}.ivu-col-xs-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xs-6{display:block;width:25%}.ivu-col-xs-push-6{left:25%}.ivu-col-xs-pull-6{right:25%}.ivu-col-xs-offset-6{margin-left:25%}.ivu-col-xs-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xs-5{display:block;width:20.83333333%}.ivu-col-xs-push-5{left:20.83333333%}.ivu-col-xs-pull-5{right:20.83333333%}.ivu-col-xs-offset-5{margin-left:20.83333333%}.ivu-col-xs-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xs-4{display:block;width:16.66666667%}.ivu-col-xs-push-4{left:16.66666667%}.ivu-col-xs-pull-4{right:16.66666667%}.ivu-col-xs-offset-4{margin-left:16.66666667%}.ivu-col-xs-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xs-3{display:block;width:12.5%}.ivu-col-xs-push-3{left:12.5%}.ivu-col-xs-pull-3{right:12.5%}.ivu-col-xs-offset-3{margin-left:12.5%}.ivu-col-xs-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xs-2{display:block;width:8.33333333%}.ivu-col-xs-push-2{left:8.33333333%}.ivu-col-xs-pull-2{right:8.33333333%}.ivu-col-xs-offset-2{margin-left:8.33333333%}.ivu-col-xs-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xs-1{display:block;width:4.16666667%}.ivu-col-xs-push-1{left:4.16666667%}.ivu-col-xs-pull-1{right:4.16666667%}.ivu-col-xs-offset-1{margin-left:4.16666667%}.ivu-col-xs-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xs-0{display:none}.ivu-col-xs-push-0{left:auto}.ivu-col-xs-pull-0{right:auto}.ivu-col-xs-offset-0{margin-left:0}.ivu-col-xs-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}@media (min-width:576px){.ivu-col-span-sm-1,.ivu-col-span-sm-10,.ivu-col-span-sm-11,.ivu-col-span-sm-12,.ivu-col-span-sm-13,.ivu-col-span-sm-14,.ivu-col-span-sm-15,.ivu-col-span-sm-16,.ivu-col-span-sm-17,.ivu-col-span-sm-18,.ivu-col-span-sm-19,.ivu-col-span-sm-2,.ivu-col-span-sm-20,.ivu-col-span-sm-21,.ivu-col-span-sm-22,.ivu-col-span-sm-23,.ivu-col-span-sm-24,.ivu-col-span-sm-3,.ivu-col-span-sm-4,.ivu-col-span-sm-5,.ivu-col-span-sm-6,.ivu-col-span-sm-7,.ivu-col-span-sm-8,.ivu-col-span-sm-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-sm-24{display:block;width:100%}.ivu-col-sm-push-24{left:100%}.ivu-col-sm-pull-24{right:100%}.ivu-col-sm-offset-24{margin-left:100%}.ivu-col-sm-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-sm-23{display:block;width:95.83333333%}.ivu-col-sm-push-23{left:95.83333333%}.ivu-col-sm-pull-23{right:95.83333333%}.ivu-col-sm-offset-23{margin-left:95.83333333%}.ivu-col-sm-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-sm-22{display:block;width:91.66666667%}.ivu-col-sm-push-22{left:91.66666667%}.ivu-col-sm-pull-22{right:91.66666667%}.ivu-col-sm-offset-22{margin-left:91.66666667%}.ivu-col-sm-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-sm-21{display:block;width:87.5%}.ivu-col-sm-push-21{left:87.5%}.ivu-col-sm-pull-21{right:87.5%}.ivu-col-sm-offset-21{margin-left:87.5%}.ivu-col-sm-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-sm-20{display:block;width:83.33333333%}.ivu-col-sm-push-20{left:83.33333333%}.ivu-col-sm-pull-20{right:83.33333333%}.ivu-col-sm-offset-20{margin-left:83.33333333%}.ivu-col-sm-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-sm-19{display:block;width:79.16666667%}.ivu-col-sm-push-19{left:79.16666667%}.ivu-col-sm-pull-19{right:79.16666667%}.ivu-col-sm-offset-19{margin-left:79.16666667%}.ivu-col-sm-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-sm-18{display:block;width:75%}.ivu-col-sm-push-18{left:75%}.ivu-col-sm-pull-18{right:75%}.ivu-col-sm-offset-18{margin-left:75%}.ivu-col-sm-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-sm-17{display:block;width:70.83333333%}.ivu-col-sm-push-17{left:70.83333333%}.ivu-col-sm-pull-17{right:70.83333333%}.ivu-col-sm-offset-17{margin-left:70.83333333%}.ivu-col-sm-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-sm-16{display:block;width:66.66666667%}.ivu-col-sm-push-16{left:66.66666667%}.ivu-col-sm-pull-16{right:66.66666667%}.ivu-col-sm-offset-16{margin-left:66.66666667%}.ivu-col-sm-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-sm-15{display:block;width:62.5%}.ivu-col-sm-push-15{left:62.5%}.ivu-col-sm-pull-15{right:62.5%}.ivu-col-sm-offset-15{margin-left:62.5%}.ivu-col-sm-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-sm-14{display:block;width:58.33333333%}.ivu-col-sm-push-14{left:58.33333333%}.ivu-col-sm-pull-14{right:58.33333333%}.ivu-col-sm-offset-14{margin-left:58.33333333%}.ivu-col-sm-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-sm-13{display:block;width:54.16666667%}.ivu-col-sm-push-13{left:54.16666667%}.ivu-col-sm-pull-13{right:54.16666667%}.ivu-col-sm-offset-13{margin-left:54.16666667%}.ivu-col-sm-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-sm-12{display:block;width:50%}.ivu-col-sm-push-12{left:50%}.ivu-col-sm-pull-12{right:50%}.ivu-col-sm-offset-12{margin-left:50%}.ivu-col-sm-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-sm-11{display:block;width:45.83333333%}.ivu-col-sm-push-11{left:45.83333333%}.ivu-col-sm-pull-11{right:45.83333333%}.ivu-col-sm-offset-11{margin-left:45.83333333%}.ivu-col-sm-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-sm-10{display:block;width:41.66666667%}.ivu-col-sm-push-10{left:41.66666667%}.ivu-col-sm-pull-10{right:41.66666667%}.ivu-col-sm-offset-10{margin-left:41.66666667%}.ivu-col-sm-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-sm-9{display:block;width:37.5%}.ivu-col-sm-push-9{left:37.5%}.ivu-col-sm-pull-9{right:37.5%}.ivu-col-sm-offset-9{margin-left:37.5%}.ivu-col-sm-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-sm-8{display:block;width:33.33333333%}.ivu-col-sm-push-8{left:33.33333333%}.ivu-col-sm-pull-8{right:33.33333333%}.ivu-col-sm-offset-8{margin-left:33.33333333%}.ivu-col-sm-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-sm-7{display:block;width:29.16666667%}.ivu-col-sm-push-7{left:29.16666667%}.ivu-col-sm-pull-7{right:29.16666667%}.ivu-col-sm-offset-7{margin-left:29.16666667%}.ivu-col-sm-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-sm-6{display:block;width:25%}.ivu-col-sm-push-6{left:25%}.ivu-col-sm-pull-6{right:25%}.ivu-col-sm-offset-6{margin-left:25%}.ivu-col-sm-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-sm-5{display:block;width:20.83333333%}.ivu-col-sm-push-5{left:20.83333333%}.ivu-col-sm-pull-5{right:20.83333333%}.ivu-col-sm-offset-5{margin-left:20.83333333%}.ivu-col-sm-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-sm-4{display:block;width:16.66666667%}.ivu-col-sm-push-4{left:16.66666667%}.ivu-col-sm-pull-4{right:16.66666667%}.ivu-col-sm-offset-4{margin-left:16.66666667%}.ivu-col-sm-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-sm-3{display:block;width:12.5%}.ivu-col-sm-push-3{left:12.5%}.ivu-col-sm-pull-3{right:12.5%}.ivu-col-sm-offset-3{margin-left:12.5%}.ivu-col-sm-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-sm-2{display:block;width:8.33333333%}.ivu-col-sm-push-2{left:8.33333333%}.ivu-col-sm-pull-2{right:8.33333333%}.ivu-col-sm-offset-2{margin-left:8.33333333%}.ivu-col-sm-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-sm-1{display:block;width:4.16666667%}.ivu-col-sm-push-1{left:4.16666667%}.ivu-col-sm-pull-1{right:4.16666667%}.ivu-col-sm-offset-1{margin-left:4.16666667%}.ivu-col-sm-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-sm-0{display:none}.ivu-col-sm-push-0{left:auto}.ivu-col-sm-pull-0{right:auto}.ivu-col-sm-offset-0{margin-left:0}.ivu-col-sm-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:768px){.ivu-col-span-md-1,.ivu-col-span-md-10,.ivu-col-span-md-11,.ivu-col-span-md-12,.ivu-col-span-md-13,.ivu-col-span-md-14,.ivu-col-span-md-15,.ivu-col-span-md-16,.ivu-col-span-md-17,.ivu-col-span-md-18,.ivu-col-span-md-19,.ivu-col-span-md-2,.ivu-col-span-md-20,.ivu-col-span-md-21,.ivu-col-span-md-22,.ivu-col-span-md-23,.ivu-col-span-md-24,.ivu-col-span-md-3,.ivu-col-span-md-4,.ivu-col-span-md-5,.ivu-col-span-md-6,.ivu-col-span-md-7,.ivu-col-span-md-8,.ivu-col-span-md-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-md-24{display:block;width:100%}.ivu-col-md-push-24{left:100%}.ivu-col-md-pull-24{right:100%}.ivu-col-md-offset-24{margin-left:100%}.ivu-col-md-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-md-23{display:block;width:95.83333333%}.ivu-col-md-push-23{left:95.83333333%}.ivu-col-md-pull-23{right:95.83333333%}.ivu-col-md-offset-23{margin-left:95.83333333%}.ivu-col-md-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-md-22{display:block;width:91.66666667%}.ivu-col-md-push-22{left:91.66666667%}.ivu-col-md-pull-22{right:91.66666667%}.ivu-col-md-offset-22{margin-left:91.66666667%}.ivu-col-md-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-md-21{display:block;width:87.5%}.ivu-col-md-push-21{left:87.5%}.ivu-col-md-pull-21{right:87.5%}.ivu-col-md-offset-21{margin-left:87.5%}.ivu-col-md-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-md-20{display:block;width:83.33333333%}.ivu-col-md-push-20{left:83.33333333%}.ivu-col-md-pull-20{right:83.33333333%}.ivu-col-md-offset-20{margin-left:83.33333333%}.ivu-col-md-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-md-19{display:block;width:79.16666667%}.ivu-col-md-push-19{left:79.16666667%}.ivu-col-md-pull-19{right:79.16666667%}.ivu-col-md-offset-19{margin-left:79.16666667%}.ivu-col-md-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-md-18{display:block;width:75%}.ivu-col-md-push-18{left:75%}.ivu-col-md-pull-18{right:75%}.ivu-col-md-offset-18{margin-left:75%}.ivu-col-md-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-md-17{display:block;width:70.83333333%}.ivu-col-md-push-17{left:70.83333333%}.ivu-col-md-pull-17{right:70.83333333%}.ivu-col-md-offset-17{margin-left:70.83333333%}.ivu-col-md-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-md-16{display:block;width:66.66666667%}.ivu-col-md-push-16{left:66.66666667%}.ivu-col-md-pull-16{right:66.66666667%}.ivu-col-md-offset-16{margin-left:66.66666667%}.ivu-col-md-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-md-15{display:block;width:62.5%}.ivu-col-md-push-15{left:62.5%}.ivu-col-md-pull-15{right:62.5%}.ivu-col-md-offset-15{margin-left:62.5%}.ivu-col-md-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-md-14{display:block;width:58.33333333%}.ivu-col-md-push-14{left:58.33333333%}.ivu-col-md-pull-14{right:58.33333333%}.ivu-col-md-offset-14{margin-left:58.33333333%}.ivu-col-md-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-md-13{display:block;width:54.16666667%}.ivu-col-md-push-13{left:54.16666667%}.ivu-col-md-pull-13{right:54.16666667%}.ivu-col-md-offset-13{margin-left:54.16666667%}.ivu-col-md-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-md-12{display:block;width:50%}.ivu-col-md-push-12{left:50%}.ivu-col-md-pull-12{right:50%}.ivu-col-md-offset-12{margin-left:50%}.ivu-col-md-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-md-11{display:block;width:45.83333333%}.ivu-col-md-push-11{left:45.83333333%}.ivu-col-md-pull-11{right:45.83333333%}.ivu-col-md-offset-11{margin-left:45.83333333%}.ivu-col-md-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-md-10{display:block;width:41.66666667%}.ivu-col-md-push-10{left:41.66666667%}.ivu-col-md-pull-10{right:41.66666667%}.ivu-col-md-offset-10{margin-left:41.66666667%}.ivu-col-md-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-md-9{display:block;width:37.5%}.ivu-col-md-push-9{left:37.5%}.ivu-col-md-pull-9{right:37.5%}.ivu-col-md-offset-9{margin-left:37.5%}.ivu-col-md-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-md-8{display:block;width:33.33333333%}.ivu-col-md-push-8{left:33.33333333%}.ivu-col-md-pull-8{right:33.33333333%}.ivu-col-md-offset-8{margin-left:33.33333333%}.ivu-col-md-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-md-7{display:block;width:29.16666667%}.ivu-col-md-push-7{left:29.16666667%}.ivu-col-md-pull-7{right:29.16666667%}.ivu-col-md-offset-7{margin-left:29.16666667%}.ivu-col-md-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-md-6{display:block;width:25%}.ivu-col-md-push-6{left:25%}.ivu-col-md-pull-6{right:25%}.ivu-col-md-offset-6{margin-left:25%}.ivu-col-md-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-md-5{display:block;width:20.83333333%}.ivu-col-md-push-5{left:20.83333333%}.ivu-col-md-pull-5{right:20.83333333%}.ivu-col-md-offset-5{margin-left:20.83333333%}.ivu-col-md-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-md-4{display:block;width:16.66666667%}.ivu-col-md-push-4{left:16.66666667%}.ivu-col-md-pull-4{right:16.66666667%}.ivu-col-md-offset-4{margin-left:16.66666667%}.ivu-col-md-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-md-3{display:block;width:12.5%}.ivu-col-md-push-3{left:12.5%}.ivu-col-md-pull-3{right:12.5%}.ivu-col-md-offset-3{margin-left:12.5%}.ivu-col-md-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-md-2{display:block;width:8.33333333%}.ivu-col-md-push-2{left:8.33333333%}.ivu-col-md-pull-2{right:8.33333333%}.ivu-col-md-offset-2{margin-left:8.33333333%}.ivu-col-md-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-md-1{display:block;width:4.16666667%}.ivu-col-md-push-1{left:4.16666667%}.ivu-col-md-pull-1{right:4.16666667%}.ivu-col-md-offset-1{margin-left:4.16666667%}.ivu-col-md-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-md-0{display:none}.ivu-col-md-push-0{left:auto}.ivu-col-md-pull-0{right:auto}.ivu-col-md-offset-0{margin-left:0}.ivu-col-md-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:992px){.ivu-col-span-lg-1,.ivu-col-span-lg-10,.ivu-col-span-lg-11,.ivu-col-span-lg-12,.ivu-col-span-lg-13,.ivu-col-span-lg-14,.ivu-col-span-lg-15,.ivu-col-span-lg-16,.ivu-col-span-lg-17,.ivu-col-span-lg-18,.ivu-col-span-lg-19,.ivu-col-span-lg-2,.ivu-col-span-lg-20,.ivu-col-span-lg-21,.ivu-col-span-lg-22,.ivu-col-span-lg-23,.ivu-col-span-lg-24,.ivu-col-span-lg-3,.ivu-col-span-lg-4,.ivu-col-span-lg-5,.ivu-col-span-lg-6,.ivu-col-span-lg-7,.ivu-col-span-lg-8,.ivu-col-span-lg-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-lg-24{display:block;width:100%}.ivu-col-lg-push-24{left:100%}.ivu-col-lg-pull-24{right:100%}.ivu-col-lg-offset-24{margin-left:100%}.ivu-col-lg-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-lg-23{display:block;width:95.83333333%}.ivu-col-lg-push-23{left:95.83333333%}.ivu-col-lg-pull-23{right:95.83333333%}.ivu-col-lg-offset-23{margin-left:95.83333333%}.ivu-col-lg-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-lg-22{display:block;width:91.66666667%}.ivu-col-lg-push-22{left:91.66666667%}.ivu-col-lg-pull-22{right:91.66666667%}.ivu-col-lg-offset-22{margin-left:91.66666667%}.ivu-col-lg-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-lg-21{display:block;width:87.5%}.ivu-col-lg-push-21{left:87.5%}.ivu-col-lg-pull-21{right:87.5%}.ivu-col-lg-offset-21{margin-left:87.5%}.ivu-col-lg-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-lg-20{display:block;width:83.33333333%}.ivu-col-lg-push-20{left:83.33333333%}.ivu-col-lg-pull-20{right:83.33333333%}.ivu-col-lg-offset-20{margin-left:83.33333333%}.ivu-col-lg-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-lg-19{display:block;width:79.16666667%}.ivu-col-lg-push-19{left:79.16666667%}.ivu-col-lg-pull-19{right:79.16666667%}.ivu-col-lg-offset-19{margin-left:79.16666667%}.ivu-col-lg-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-lg-18{display:block;width:75%}.ivu-col-lg-push-18{left:75%}.ivu-col-lg-pull-18{right:75%}.ivu-col-lg-offset-18{margin-left:75%}.ivu-col-lg-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-lg-17{display:block;width:70.83333333%}.ivu-col-lg-push-17{left:70.83333333%}.ivu-col-lg-pull-17{right:70.83333333%}.ivu-col-lg-offset-17{margin-left:70.83333333%}.ivu-col-lg-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-lg-16{display:block;width:66.66666667%}.ivu-col-lg-push-16{left:66.66666667%}.ivu-col-lg-pull-16{right:66.66666667%}.ivu-col-lg-offset-16{margin-left:66.66666667%}.ivu-col-lg-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-lg-15{display:block;width:62.5%}.ivu-col-lg-push-15{left:62.5%}.ivu-col-lg-pull-15{right:62.5%}.ivu-col-lg-offset-15{margin-left:62.5%}.ivu-col-lg-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-lg-14{display:block;width:58.33333333%}.ivu-col-lg-push-14{left:58.33333333%}.ivu-col-lg-pull-14{right:58.33333333%}.ivu-col-lg-offset-14{margin-left:58.33333333%}.ivu-col-lg-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-lg-13{display:block;width:54.16666667%}.ivu-col-lg-push-13{left:54.16666667%}.ivu-col-lg-pull-13{right:54.16666667%}.ivu-col-lg-offset-13{margin-left:54.16666667%}.ivu-col-lg-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-lg-12{display:block;width:50%}.ivu-col-lg-push-12{left:50%}.ivu-col-lg-pull-12{right:50%}.ivu-col-lg-offset-12{margin-left:50%}.ivu-col-lg-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-lg-11{display:block;width:45.83333333%}.ivu-col-lg-push-11{left:45.83333333%}.ivu-col-lg-pull-11{right:45.83333333%}.ivu-col-lg-offset-11{margin-left:45.83333333%}.ivu-col-lg-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-lg-10{display:block;width:41.66666667%}.ivu-col-lg-push-10{left:41.66666667%}.ivu-col-lg-pull-10{right:41.66666667%}.ivu-col-lg-offset-10{margin-left:41.66666667%}.ivu-col-lg-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-lg-9{display:block;width:37.5%}.ivu-col-lg-push-9{left:37.5%}.ivu-col-lg-pull-9{right:37.5%}.ivu-col-lg-offset-9{margin-left:37.5%}.ivu-col-lg-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-lg-8{display:block;width:33.33333333%}.ivu-col-lg-push-8{left:33.33333333%}.ivu-col-lg-pull-8{right:33.33333333%}.ivu-col-lg-offset-8{margin-left:33.33333333%}.ivu-col-lg-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-lg-7{display:block;width:29.16666667%}.ivu-col-lg-push-7{left:29.16666667%}.ivu-col-lg-pull-7{right:29.16666667%}.ivu-col-lg-offset-7{margin-left:29.16666667%}.ivu-col-lg-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-lg-6{display:block;width:25%}.ivu-col-lg-push-6{left:25%}.ivu-col-lg-pull-6{right:25%}.ivu-col-lg-offset-6{margin-left:25%}.ivu-col-lg-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-lg-5{display:block;width:20.83333333%}.ivu-col-lg-push-5{left:20.83333333%}.ivu-col-lg-pull-5{right:20.83333333%}.ivu-col-lg-offset-5{margin-left:20.83333333%}.ivu-col-lg-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-lg-4{display:block;width:16.66666667%}.ivu-col-lg-push-4{left:16.66666667%}.ivu-col-lg-pull-4{right:16.66666667%}.ivu-col-lg-offset-4{margin-left:16.66666667%}.ivu-col-lg-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-lg-3{display:block;width:12.5%}.ivu-col-lg-push-3{left:12.5%}.ivu-col-lg-pull-3{right:12.5%}.ivu-col-lg-offset-3{margin-left:12.5%}.ivu-col-lg-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-lg-2{display:block;width:8.33333333%}.ivu-col-lg-push-2{left:8.33333333%}.ivu-col-lg-pull-2{right:8.33333333%}.ivu-col-lg-offset-2{margin-left:8.33333333%}.ivu-col-lg-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-lg-1{display:block;width:4.16666667%}.ivu-col-lg-push-1{left:4.16666667%}.ivu-col-lg-pull-1{right:4.16666667%}.ivu-col-lg-offset-1{margin-left:4.16666667%}.ivu-col-lg-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-lg-0{display:none}.ivu-col-lg-push-0{left:auto}.ivu-col-lg-pull-0{right:auto}.ivu-col-lg-offset-0{margin-left:0}.ivu-col-lg-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:1200px){.ivu-col-span-xl-1,.ivu-col-span-xl-10,.ivu-col-span-xl-11,.ivu-col-span-xl-12,.ivu-col-span-xl-13,.ivu-col-span-xl-14,.ivu-col-span-xl-15,.ivu-col-span-xl-16,.ivu-col-span-xl-17,.ivu-col-span-xl-18,.ivu-col-span-xl-19,.ivu-col-span-xl-2,.ivu-col-span-xl-20,.ivu-col-span-xl-21,.ivu-col-span-xl-22,.ivu-col-span-xl-23,.ivu-col-span-xl-24,.ivu-col-span-xl-3,.ivu-col-span-xl-4,.ivu-col-span-xl-5,.ivu-col-span-xl-6,.ivu-col-span-xl-7,.ivu-col-span-xl-8,.ivu-col-span-xl-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xl-24{display:block;width:100%}.ivu-col-xl-push-24{left:100%}.ivu-col-xl-pull-24{right:100%}.ivu-col-xl-offset-24{margin-left:100%}.ivu-col-xl-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xl-23{display:block;width:95.83333333%}.ivu-col-xl-push-23{left:95.83333333%}.ivu-col-xl-pull-23{right:95.83333333%}.ivu-col-xl-offset-23{margin-left:95.83333333%}.ivu-col-xl-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xl-22{display:block;width:91.66666667%}.ivu-col-xl-push-22{left:91.66666667%}.ivu-col-xl-pull-22{right:91.66666667%}.ivu-col-xl-offset-22{margin-left:91.66666667%}.ivu-col-xl-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xl-21{display:block;width:87.5%}.ivu-col-xl-push-21{left:87.5%}.ivu-col-xl-pull-21{right:87.5%}.ivu-col-xl-offset-21{margin-left:87.5%}.ivu-col-xl-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xl-20{display:block;width:83.33333333%}.ivu-col-xl-push-20{left:83.33333333%}.ivu-col-xl-pull-20{right:83.33333333%}.ivu-col-xl-offset-20{margin-left:83.33333333%}.ivu-col-xl-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xl-19{display:block;width:79.16666667%}.ivu-col-xl-push-19{left:79.16666667%}.ivu-col-xl-pull-19{right:79.16666667%}.ivu-col-xl-offset-19{margin-left:79.16666667%}.ivu-col-xl-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xl-18{display:block;width:75%}.ivu-col-xl-push-18{left:75%}.ivu-col-xl-pull-18{right:75%}.ivu-col-xl-offset-18{margin-left:75%}.ivu-col-xl-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xl-17{display:block;width:70.83333333%}.ivu-col-xl-push-17{left:70.83333333%}.ivu-col-xl-pull-17{right:70.83333333%}.ivu-col-xl-offset-17{margin-left:70.83333333%}.ivu-col-xl-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xl-16{display:block;width:66.66666667%}.ivu-col-xl-push-16{left:66.66666667%}.ivu-col-xl-pull-16{right:66.66666667%}.ivu-col-xl-offset-16{margin-left:66.66666667%}.ivu-col-xl-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xl-15{display:block;width:62.5%}.ivu-col-xl-push-15{left:62.5%}.ivu-col-xl-pull-15{right:62.5%}.ivu-col-xl-offset-15{margin-left:62.5%}.ivu-col-xl-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xl-14{display:block;width:58.33333333%}.ivu-col-xl-push-14{left:58.33333333%}.ivu-col-xl-pull-14{right:58.33333333%}.ivu-col-xl-offset-14{margin-left:58.33333333%}.ivu-col-xl-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xl-13{display:block;width:54.16666667%}.ivu-col-xl-push-13{left:54.16666667%}.ivu-col-xl-pull-13{right:54.16666667%}.ivu-col-xl-offset-13{margin-left:54.16666667%}.ivu-col-xl-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xl-12{display:block;width:50%}.ivu-col-xl-push-12{left:50%}.ivu-col-xl-pull-12{right:50%}.ivu-col-xl-offset-12{margin-left:50%}.ivu-col-xl-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xl-11{display:block;width:45.83333333%}.ivu-col-xl-push-11{left:45.83333333%}.ivu-col-xl-pull-11{right:45.83333333%}.ivu-col-xl-offset-11{margin-left:45.83333333%}.ivu-col-xl-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xl-10{display:block;width:41.66666667%}.ivu-col-xl-push-10{left:41.66666667%}.ivu-col-xl-pull-10{right:41.66666667%}.ivu-col-xl-offset-10{margin-left:41.66666667%}.ivu-col-xl-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xl-9{display:block;width:37.5%}.ivu-col-xl-push-9{left:37.5%}.ivu-col-xl-pull-9{right:37.5%}.ivu-col-xl-offset-9{margin-left:37.5%}.ivu-col-xl-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xl-8{display:block;width:33.33333333%}.ivu-col-xl-push-8{left:33.33333333%}.ivu-col-xl-pull-8{right:33.33333333%}.ivu-col-xl-offset-8{margin-left:33.33333333%}.ivu-col-xl-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xl-7{display:block;width:29.16666667%}.ivu-col-xl-push-7{left:29.16666667%}.ivu-col-xl-pull-7{right:29.16666667%}.ivu-col-xl-offset-7{margin-left:29.16666667%}.ivu-col-xl-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xl-6{display:block;width:25%}.ivu-col-xl-push-6{left:25%}.ivu-col-xl-pull-6{right:25%}.ivu-col-xl-offset-6{margin-left:25%}.ivu-col-xl-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xl-5{display:block;width:20.83333333%}.ivu-col-xl-push-5{left:20.83333333%}.ivu-col-xl-pull-5{right:20.83333333%}.ivu-col-xl-offset-5{margin-left:20.83333333%}.ivu-col-xl-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xl-4{display:block;width:16.66666667%}.ivu-col-xl-push-4{left:16.66666667%}.ivu-col-xl-pull-4{right:16.66666667%}.ivu-col-xl-offset-4{margin-left:16.66666667%}.ivu-col-xl-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xl-3{display:block;width:12.5%}.ivu-col-xl-push-3{left:12.5%}.ivu-col-xl-pull-3{right:12.5%}.ivu-col-xl-offset-3{margin-left:12.5%}.ivu-col-xl-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xl-2{display:block;width:8.33333333%}.ivu-col-xl-push-2{left:8.33333333%}.ivu-col-xl-pull-2{right:8.33333333%}.ivu-col-xl-offset-2{margin-left:8.33333333%}.ivu-col-xl-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xl-1{display:block;width:4.16666667%}.ivu-col-xl-push-1{left:4.16666667%}.ivu-col-xl-pull-1{right:4.16666667%}.ivu-col-xl-offset-1{margin-left:4.16666667%}.ivu-col-xl-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xl-0{display:none}.ivu-col-xl-push-0{left:auto}.ivu-col-xl-pull-0{right:auto}.ivu-col-xl-offset-0{margin-left:0}.ivu-col-xl-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:1600px){.ivu-col-span-xxl-1,.ivu-col-span-xxl-10,.ivu-col-span-xxl-11,.ivu-col-span-xxl-12,.ivu-col-span-xxl-13,.ivu-col-span-xxl-14,.ivu-col-span-xxl-15,.ivu-col-span-xxl-16,.ivu-col-span-xxl-17,.ivu-col-span-xxl-18,.ivu-col-span-xxl-19,.ivu-col-span-xxl-2,.ivu-col-span-xxl-20,.ivu-col-span-xxl-21,.ivu-col-span-xxl-22,.ivu-col-span-xxl-23,.ivu-col-span-xxl-24,.ivu-col-span-xxl-3,.ivu-col-span-xxl-4,.ivu-col-span-xxl-5,.ivu-col-span-xxl-6,.ivu-col-span-xxl-7,.ivu-col-span-xxl-8,.ivu-col-span-xxl-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xxl-24{display:block;width:100%}.ivu-col-xxl-push-24{left:100%}.ivu-col-xxl-pull-24{right:100%}.ivu-col-xxl-offset-24{margin-left:100%}.ivu-col-xxl-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xxl-23{display:block;width:95.83333333%}.ivu-col-xxl-push-23{left:95.83333333%}.ivu-col-xxl-pull-23{right:95.83333333%}.ivu-col-xxl-offset-23{margin-left:95.83333333%}.ivu-col-xxl-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xxl-22{display:block;width:91.66666667%}.ivu-col-xxl-push-22{left:91.66666667%}.ivu-col-xxl-pull-22{right:91.66666667%}.ivu-col-xxl-offset-22{margin-left:91.66666667%}.ivu-col-xxl-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xxl-21{display:block;width:87.5%}.ivu-col-xxl-push-21{left:87.5%}.ivu-col-xxl-pull-21{right:87.5%}.ivu-col-xxl-offset-21{margin-left:87.5%}.ivu-col-xxl-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xxl-20{display:block;width:83.33333333%}.ivu-col-xxl-push-20{left:83.33333333%}.ivu-col-xxl-pull-20{right:83.33333333%}.ivu-col-xxl-offset-20{margin-left:83.33333333%}.ivu-col-xxl-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xxl-19{display:block;width:79.16666667%}.ivu-col-xxl-push-19{left:79.16666667%}.ivu-col-xxl-pull-19{right:79.16666667%}.ivu-col-xxl-offset-19{margin-left:79.16666667%}.ivu-col-xxl-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xxl-18{display:block;width:75%}.ivu-col-xxl-push-18{left:75%}.ivu-col-xxl-pull-18{right:75%}.ivu-col-xxl-offset-18{margin-left:75%}.ivu-col-xxl-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xxl-17{display:block;width:70.83333333%}.ivu-col-xxl-push-17{left:70.83333333%}.ivu-col-xxl-pull-17{right:70.83333333%}.ivu-col-xxl-offset-17{margin-left:70.83333333%}.ivu-col-xxl-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xxl-16{display:block;width:66.66666667%}.ivu-col-xxl-push-16{left:66.66666667%}.ivu-col-xxl-pull-16{right:66.66666667%}.ivu-col-xxl-offset-16{margin-left:66.66666667%}.ivu-col-xxl-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xxl-15{display:block;width:62.5%}.ivu-col-xxl-push-15{left:62.5%}.ivu-col-xxl-pull-15{right:62.5%}.ivu-col-xxl-offset-15{margin-left:62.5%}.ivu-col-xxl-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xxl-14{display:block;width:58.33333333%}.ivu-col-xxl-push-14{left:58.33333333%}.ivu-col-xxl-pull-14{right:58.33333333%}.ivu-col-xxl-offset-14{margin-left:58.33333333%}.ivu-col-xxl-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xxl-13{display:block;width:54.16666667%}.ivu-col-xxl-push-13{left:54.16666667%}.ivu-col-xxl-pull-13{right:54.16666667%}.ivu-col-xxl-offset-13{margin-left:54.16666667%}.ivu-col-xxl-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xxl-12{display:block;width:50%}.ivu-col-xxl-push-12{left:50%}.ivu-col-xxl-pull-12{right:50%}.ivu-col-xxl-offset-12{margin-left:50%}.ivu-col-xxl-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xxl-11{display:block;width:45.83333333%}.ivu-col-xxl-push-11{left:45.83333333%}.ivu-col-xxl-pull-11{right:45.83333333%}.ivu-col-xxl-offset-11{margin-left:45.83333333%}.ivu-col-xxl-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xxl-10{display:block;width:41.66666667%}.ivu-col-xxl-push-10{left:41.66666667%}.ivu-col-xxl-pull-10{right:41.66666667%}.ivu-col-xxl-offset-10{margin-left:41.66666667%}.ivu-col-xxl-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xxl-9{display:block;width:37.5%}.ivu-col-xxl-push-9{left:37.5%}.ivu-col-xxl-pull-9{right:37.5%}.ivu-col-xxl-offset-9{margin-left:37.5%}.ivu-col-xxl-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xxl-8{display:block;width:33.33333333%}.ivu-col-xxl-push-8{left:33.33333333%}.ivu-col-xxl-pull-8{right:33.33333333%}.ivu-col-xxl-offset-8{margin-left:33.33333333%}.ivu-col-xxl-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xxl-7{display:block;width:29.16666667%}.ivu-col-xxl-push-7{left:29.16666667%}.ivu-col-xxl-pull-7{right:29.16666667%}.ivu-col-xxl-offset-7{margin-left:29.16666667%}.ivu-col-xxl-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xxl-6{display:block;width:25%}.ivu-col-xxl-push-6{left:25%}.ivu-col-xxl-pull-6{right:25%}.ivu-col-xxl-offset-6{margin-left:25%}.ivu-col-xxl-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xxl-5{display:block;width:20.83333333%}.ivu-col-xxl-push-5{left:20.83333333%}.ivu-col-xxl-pull-5{right:20.83333333%}.ivu-col-xxl-offset-5{margin-left:20.83333333%}.ivu-col-xxl-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xxl-4{display:block;width:16.66666667%}.ivu-col-xxl-push-4{left:16.66666667%}.ivu-col-xxl-pull-4{right:16.66666667%}.ivu-col-xxl-offset-4{margin-left:16.66666667%}.ivu-col-xxl-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xxl-3{display:block;width:12.5%}.ivu-col-xxl-push-3{left:12.5%}.ivu-col-xxl-pull-3{right:12.5%}.ivu-col-xxl-offset-3{margin-left:12.5%}.ivu-col-xxl-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xxl-2{display:block;width:8.33333333%}.ivu-col-xxl-push-2{left:8.33333333%}.ivu-col-xxl-pull-2{right:8.33333333%}.ivu-col-xxl-offset-2{margin-left:8.33333333%}.ivu-col-xxl-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xxl-1{display:block;width:4.16666667%}.ivu-col-xxl-push-1{left:4.16666667%}.ivu-col-xxl-pull-1{right:4.16666667%}.ivu-col-xxl-offset-1{margin-left:4.16666667%}.ivu-col-xxl-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xxl-0{display:none}.ivu-col-xxl-push-0{left:auto}.ivu-col-xxl-pull-0{right:auto}.ivu-col-xxl-offset-0{margin-left:0}.ivu-col-xxl-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}.ivu-article h1{font-size:26px;font-weight:400}.ivu-article h2{font-size:20px;font-weight:400}.ivu-article h3{font-size:16px;font-weight:400}.ivu-article h4{font-size:14px;font-weight:400}.ivu-article h5{font-size:12px;font-weight:400}.ivu-article h6{font-size:12px;font-weight:400}.ivu-article blockquote{padding:5px 5px 3px 10px;line-height:1.5;border-left:4px solid #ddd;margin-bottom:20px;color:#666;font-size:14px}.ivu-article ul:not([class^=ivu-]){padding-left:40px;list-style-type:disc}.ivu-article li:not([class^=ivu-]){margin-bottom:5px;font-size:14px}.ivu-article ol ul:not([class^=ivu-]),.ivu-article ul ul:not([class^=ivu-]){list-style-type:circle}.ivu-article p{margin:5px;font-size:14px}.ivu-article a:not([class^=ivu-])[target=\"_blank\"]:after{content:\"\\F3F2\";font-family:Ionicons;color:#aaa;margin-left:3px}.fade-appear,.fade-enter-active{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-leave-active{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-appear,.fade-enter-active{-webkit-animation-name:ivuFadeIn;animation-name:ivuFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.fade-leave-active{-webkit-animation-name:ivuFadeOut;animation-name:ivuFadeOut;-webkit-animation-play-state:running;animation-play-state:running}.fade-appear,.fade-enter-active{opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear}.fade-leave-active{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes ivuFadeIn{0%{opacity:0}100%{opacity:1}}@keyframes ivuFadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes ivuFadeOut{0%{opacity:1}100%{opacity:0}}@keyframes ivuFadeOut{0%{opacity:1}100%{opacity:0}}.move-up-appear,.move-up-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-appear,.move-up-enter-active{-webkit-animation-name:ivuMoveUpIn;animation-name:ivuMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.move-up-leave-active{-webkit-animation-name:ivuMoveUpOut;animation-name:ivuMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running}.move-up-appear,.move-up-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-up-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-down-appear,.move-down-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-appear,.move-down-enter-active{-webkit-animation-name:ivuMoveDownIn;animation-name:ivuMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.move-down-leave-active{-webkit-animation-name:ivuMoveDownOut;animation-name:ivuMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running}.move-down-appear,.move-down-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-down-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-left-appear,.move-left-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-appear,.move-left-enter-active{-webkit-animation-name:ivuMoveLeftIn;animation-name:ivuMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.move-left-leave-active{-webkit-animation-name:ivuMoveLeftOut;animation-name:ivuMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running}.move-left-appear,.move-left-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-left-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-right-appear,.move-right-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-appear,.move-right-enter-active{-webkit-animation-name:ivuMoveRightIn;animation-name:ivuMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.move-right-leave-active{-webkit-animation-name:ivuMoveRightOut;animation-name:ivuMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running}.move-right-appear,.move-right-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-right-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes ivuMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes ivuMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@keyframes ivuMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@-webkit-keyframes ivuMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes ivuMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@-webkit-keyframes ivuMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes ivuMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@-webkit-keyframes ivuMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes ivuMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes ivuMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes ivuMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes ivuMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes ivuMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes ivuMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}@keyframes ivuMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}.move-notice-appear,.move-notice-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-notice-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-notice-appear,.move-notice-enter-active{-webkit-animation-name:ivuMoveNoticeIn;animation-name:ivuMoveNoticeIn;-webkit-animation-play-state:running;animation-play-state:running}.move-notice-leave-active{-webkit-animation-name:ivuMoveNoticeOut;animation-name:ivuMoveNoticeOut;-webkit-animation-play-state:running;animation-play-state:running}.move-notice-appear,.move-notice-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-notice-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuMoveNoticeIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes ivuMoveNoticeIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes ivuMoveNoticeOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}70%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:auto;padding:16px;margin-bottom:10px;opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:0;padding:0;margin-bottom:0;opacity:0}}@keyframes ivuMoveNoticeOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}70%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:auto;padding:16px;margin-bottom:10px;opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:0;padding:0;margin-bottom:0;opacity:0}}.ease-appear,.ease-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ease-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ease-appear,.ease-enter-active{-webkit-animation-name:ivuEaseIn;animation-name:ivuEaseIn;-webkit-animation-play-state:running;animation-play-state:running}.ease-leave-active{-webkit-animation-name:ivuEaseOut;animation-name:ivuEaseOut;-webkit-animation-play-state:running;animation-play-state:running}.ease-appear,.ease-enter-active{opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}.ease-leave-active{-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes ivuEaseIn{0%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes ivuEaseIn{0%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes ivuEaseOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}@keyframes ivuEaseOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}.transition-drop-appear,.transition-drop-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.transition-drop-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.transition-drop-appear,.transition-drop-enter-active{-webkit-animation-name:ivuTransitionDropIn;animation-name:ivuTransitionDropIn;-webkit-animation-play-state:running;animation-play-state:running}.transition-drop-leave-active{-webkit-animation-name:ivuTransitionDropOut;animation-name:ivuTransitionDropOut;-webkit-animation-play-state:running;animation-play-state:running}.transition-drop-appear,.transition-drop-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.transition-drop-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-up-appear,.slide-up-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-appear,.slide-up-enter-active{-webkit-animation-name:ivuSlideUpIn;animation-name:ivuSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-leave-active{-webkit-animation-name:ivuSlideUpOut;animation-name:ivuSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-appear,.slide-up-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-up-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-down-appear,.slide-down-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-appear,.slide-down-enter-active{-webkit-animation-name:ivuSlideDownIn;animation-name:ivuSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-leave-active{-webkit-animation-name:ivuSlideDownOut;animation-name:ivuSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-appear,.slide-down-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-down-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-left-appear,.slide-left-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-appear,.slide-left-enter-active{-webkit-animation-name:ivuSlideLeftIn;animation-name:ivuSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-leave-active{-webkit-animation-name:ivuSlideLeftOut;animation-name:ivuSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-appear,.slide-left-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-left-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-right-appear,.slide-right-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-appear,.slide-right-enter-active{-webkit-animation-name:ivuSlideRightIn;animation-name:ivuSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-leave-active{-webkit-animation-name:ivuSlideRightOut;animation-name:ivuSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-appear,.slide-right-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-right-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuTransitionDropIn{0%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuTransitionDropIn{0%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuTransitionDropOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuTransitionDropOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes ivuSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes ivuSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes ivuSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@-webkit-keyframes ivuSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes ivuSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes ivuSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes ivuSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}.collapse-transition{-webkit-transition:.2s height ease-in-out,.2s padding-top ease-in-out,.2s padding-bottom ease-in-out;transition:.2s height ease-in-out,.2s padding-top ease-in-out,.2s padding-bottom ease-in-out}.ivu-btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;line-height:1.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:32px;padding:0 15px;font-size:14px;border-radius:4px;-webkit-transition:color .2s linear,background-color .2s linear,border .2s linear,-webkit-box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,-webkit-box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear,-webkit-box-shadow .2s linear;color:#515a6e;background-color:#fff;border-color:#dcdee2}.ivu-btn>.ivu-icon{line-height:1.5}.ivu-btn-icon-only.ivu-btn-circle>.ivu-icon{vertical-align:baseline}.ivu-btn>i,.ivu-btn>span{display:inline-block}.ivu-btn,.ivu-btn:active,.ivu-btn:focus{outline:0}.ivu-btn:not([disabled]):hover{text-decoration:none}.ivu-btn:not([disabled]):active{outline:0}.ivu-btn.disabled,.ivu-btn[disabled]{cursor:not-allowed}.ivu-btn.disabled>*,.ivu-btn[disabled]>*{pointer-events:none}.ivu-btn-large{height:40px;padding:0 15px;font-size:16px;border-radius:4px}.ivu-btn-small{height:24px;padding:0 7px;font-size:14px;border-radius:3px}.ivu-btn-icon-only{width:32px;height:32px;padding:0;font-size:16px;border-radius:4px}.ivu-btn-icon-only.ivu-btn-large{width:40px;height:40px;padding:0;font-size:18px;border-radius:4px}.ivu-btn-icon-only.ivu-btn-small{width:24px;height:24px;padding:0;font-size:14px;border-radius:4px}.ivu-btn>a:only-child{color:currentColor}.ivu-btn>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:hover{color:#747b8b;background-color:#fff;border-color:#e3e5e8}.ivu-btn:hover>a:only-child{color:currentColor}.ivu-btn:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.active,.ivu-btn:active{color:#4d5669;background-color:#f2f2f2;border-color:#f2f2f2}.ivu-btn.active>a:only-child,.ivu-btn:active>a:only-child{color:currentColor}.ivu-btn.active>a:only-child:after,.ivu-btn:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.disabled,.ivu-btn.disabled.active,.ivu-btn.disabled:active,.ivu-btn.disabled:focus,.ivu-btn.disabled:hover,.ivu-btn[disabled],.ivu-btn[disabled].active,.ivu-btn[disabled]:active,.ivu-btn[disabled]:focus,.ivu-btn[disabled]:hover,fieldset[disabled] .ivu-btn,fieldset[disabled] .ivu-btn.active,fieldset[disabled] .ivu-btn:active,fieldset[disabled] .ivu-btn:focus,fieldset[disabled] .ivu-btn:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn.disabled.active>a:only-child,.ivu-btn.disabled:active>a:only-child,.ivu-btn.disabled:focus>a:only-child,.ivu-btn.disabled:hover>a:only-child,.ivu-btn.disabled>a:only-child,.ivu-btn[disabled].active>a:only-child,.ivu-btn[disabled]:active>a:only-child,.ivu-btn[disabled]:focus>a:only-child,.ivu-btn[disabled]:hover>a:only-child,.ivu-btn[disabled]>a:only-child,fieldset[disabled] .ivu-btn.active>a:only-child,fieldset[disabled] .ivu-btn:active>a:only-child,fieldset[disabled] .ivu-btn:focus>a:only-child,fieldset[disabled] .ivu-btn:hover>a:only-child,fieldset[disabled] .ivu-btn>a:only-child{color:currentColor}.ivu-btn.disabled.active>a:only-child:after,.ivu-btn.disabled:active>a:only-child:after,.ivu-btn.disabled:focus>a:only-child:after,.ivu-btn.disabled:hover>a:only-child:after,.ivu-btn.disabled>a:only-child:after,.ivu-btn[disabled].active>a:only-child:after,.ivu-btn[disabled]:active>a:only-child:after,.ivu-btn[disabled]:focus>a:only-child:after,.ivu-btn[disabled]:hover>a:only-child:after,.ivu-btn[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn.active>a:only-child:after,fieldset[disabled] .ivu-btn:active>a:only-child:after,fieldset[disabled] .ivu-btn:focus>a:only-child:after,fieldset[disabled] .ivu-btn:hover>a:only-child:after,fieldset[disabled] .ivu-btn>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:hover{color:#57a3f3;background-color:#fff;border-color:#57a3f3}.ivu-btn:hover>a:only-child{color:currentColor}.ivu-btn:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.active,.ivu-btn:active{color:#2b85e4;background-color:#fff;border-color:#2b85e4}.ivu-btn.active>a:only-child,.ivu-btn:active>a:only-child{color:currentColor}.ivu-btn.active>a:only-child:after,.ivu-btn:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-long{width:100%}.ivu-btn>.ivu-icon+span,.ivu-btn>span+.ivu-icon{margin-left:4px}.ivu-btn-primary{color:#fff;background-color:#2d8cf0;border-color:#2d8cf0}.ivu-btn-primary>a:only-child{color:currentColor}.ivu-btn-primary>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary:hover{color:#fff;background-color:#57a3f3;border-color:#57a3f3}.ivu-btn-primary:hover>a:only-child{color:currentColor}.ivu-btn-primary:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.active,.ivu-btn-primary:active{color:#f2f2f2;background-color:#2b85e4;border-color:#2b85e4}.ivu-btn-primary.active>a:only-child,.ivu-btn-primary:active>a:only-child{color:currentColor}.ivu-btn-primary.active>a:only-child:after,.ivu-btn-primary:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.disabled,.ivu-btn-primary.disabled.active,.ivu-btn-primary.disabled:active,.ivu-btn-primary.disabled:focus,.ivu-btn-primary.disabled:hover,.ivu-btn-primary[disabled],.ivu-btn-primary[disabled].active,.ivu-btn-primary[disabled]:active,.ivu-btn-primary[disabled]:focus,.ivu-btn-primary[disabled]:hover,fieldset[disabled] .ivu-btn-primary,fieldset[disabled] .ivu-btn-primary.active,fieldset[disabled] .ivu-btn-primary:active,fieldset[disabled] .ivu-btn-primary:focus,fieldset[disabled] .ivu-btn-primary:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-primary.disabled.active>a:only-child,.ivu-btn-primary.disabled:active>a:only-child,.ivu-btn-primary.disabled:focus>a:only-child,.ivu-btn-primary.disabled:hover>a:only-child,.ivu-btn-primary.disabled>a:only-child,.ivu-btn-primary[disabled].active>a:only-child,.ivu-btn-primary[disabled]:active>a:only-child,.ivu-btn-primary[disabled]:focus>a:only-child,.ivu-btn-primary[disabled]:hover>a:only-child,.ivu-btn-primary[disabled]>a:only-child,fieldset[disabled] .ivu-btn-primary.active>a:only-child,fieldset[disabled] .ivu-btn-primary:active>a:only-child,fieldset[disabled] .ivu-btn-primary:focus>a:only-child,fieldset[disabled] .ivu-btn-primary:hover>a:only-child,fieldset[disabled] .ivu-btn-primary>a:only-child{color:currentColor}.ivu-btn-primary.disabled.active>a:only-child:after,.ivu-btn-primary.disabled:active>a:only-child:after,.ivu-btn-primary.disabled:focus>a:only-child:after,.ivu-btn-primary.disabled:hover>a:only-child:after,.ivu-btn-primary.disabled>a:only-child:after,.ivu-btn-primary[disabled].active>a:only-child:after,.ivu-btn-primary[disabled]:active>a:only-child:after,.ivu-btn-primary[disabled]:focus>a:only-child:after,.ivu-btn-primary[disabled]:hover>a:only-child:after,.ivu-btn-primary[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-primary.active>a:only-child:after,fieldset[disabled] .ivu-btn-primary:active>a:only-child:after,fieldset[disabled] .ivu-btn-primary:focus>a:only-child:after,fieldset[disabled] .ivu-btn-primary:hover>a:only-child:after,fieldset[disabled] .ivu-btn-primary>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.active,.ivu-btn-primary:active,.ivu-btn-primary:hover{color:#fff}.ivu-btn-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:not(:first-child):not(:last-child){border-right-color:#2b85e4;border-left-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child){border-right-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#dcdee2}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary+.ivu-btn,.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:last-child:not(:first-child){border-left-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary+.ivu-btn[disabled],.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#dcdee2}.ivu-btn-group-vertical .ivu-btn-primary:not(:first-child):not(:last-child){border-top-color:#2b85e4;border-bottom-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary:first-child:not(:last-child){border-bottom-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary:first-child:not(:last-child)[disabled]{border-top-color:#dcdee2}.ivu-btn-group-vertical .ivu-btn-primary+.ivu-btn,.ivu-btn-group-vertical .ivu-btn-primary:last-child:not(:first-child){border-top-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary+.ivu-btn[disabled],.ivu-btn-group-vertical .ivu-btn-primary:last-child:not(:first-child)[disabled]{border-bottom-color:#dcdee2}.ivu-btn-dashed{color:#515a6e;background-color:#fff;border-color:#dcdee2;border-style:dashed}.ivu-btn-dashed>a:only-child{color:currentColor}.ivu-btn-dashed>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:hover{color:#747b8b;background-color:#fff;border-color:#e3e5e8}.ivu-btn-dashed:hover>a:only-child{color:currentColor}.ivu-btn-dashed:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.active,.ivu-btn-dashed:active{color:#4d5669;background-color:#f2f2f2;border-color:#f2f2f2}.ivu-btn-dashed.active>a:only-child,.ivu-btn-dashed:active>a:only-child{color:currentColor}.ivu-btn-dashed.active>a:only-child:after,.ivu-btn-dashed:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.disabled,.ivu-btn-dashed.disabled.active,.ivu-btn-dashed.disabled:active,.ivu-btn-dashed.disabled:focus,.ivu-btn-dashed.disabled:hover,.ivu-btn-dashed[disabled],.ivu-btn-dashed[disabled].active,.ivu-btn-dashed[disabled]:active,.ivu-btn-dashed[disabled]:focus,.ivu-btn-dashed[disabled]:hover,fieldset[disabled] .ivu-btn-dashed,fieldset[disabled] .ivu-btn-dashed.active,fieldset[disabled] .ivu-btn-dashed:active,fieldset[disabled] .ivu-btn-dashed:focus,fieldset[disabled] .ivu-btn-dashed:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-dashed.disabled.active>a:only-child,.ivu-btn-dashed.disabled:active>a:only-child,.ivu-btn-dashed.disabled:focus>a:only-child,.ivu-btn-dashed.disabled:hover>a:only-child,.ivu-btn-dashed.disabled>a:only-child,.ivu-btn-dashed[disabled].active>a:only-child,.ivu-btn-dashed[disabled]:active>a:only-child,.ivu-btn-dashed[disabled]:focus>a:only-child,.ivu-btn-dashed[disabled]:hover>a:only-child,.ivu-btn-dashed[disabled]>a:only-child,fieldset[disabled] .ivu-btn-dashed.active>a:only-child,fieldset[disabled] .ivu-btn-dashed:active>a:only-child,fieldset[disabled] .ivu-btn-dashed:focus>a:only-child,fieldset[disabled] .ivu-btn-dashed:hover>a:only-child,fieldset[disabled] .ivu-btn-dashed>a:only-child{color:currentColor}.ivu-btn-dashed.disabled.active>a:only-child:after,.ivu-btn-dashed.disabled:active>a:only-child:after,.ivu-btn-dashed.disabled:focus>a:only-child:after,.ivu-btn-dashed.disabled:hover>a:only-child:after,.ivu-btn-dashed.disabled>a:only-child:after,.ivu-btn-dashed[disabled].active>a:only-child:after,.ivu-btn-dashed[disabled]:active>a:only-child:after,.ivu-btn-dashed[disabled]:focus>a:only-child:after,.ivu-btn-dashed[disabled]:hover>a:only-child:after,.ivu-btn-dashed[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-dashed.active>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:active>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:focus>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:hover>a:only-child:after,fieldset[disabled] .ivu-btn-dashed>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:hover{color:#57a3f3;background-color:#fff;border-color:#57a3f3}.ivu-btn-dashed:hover>a:only-child{color:currentColor}.ivu-btn-dashed:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.active,.ivu-btn-dashed:active{color:#2b85e4;background-color:#fff;border-color:#2b85e4}.ivu-btn-dashed.active>a:only-child,.ivu-btn-dashed:active>a:only-child{color:currentColor}.ivu-btn-dashed.active>a:only-child:after,.ivu-btn-dashed:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-text{color:#515a6e;background-color:transparent;border-color:transparent}.ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:hover{color:#747b8b;background-color:rgba(255,255,255,.2);border-color:rgba(255,255,255,.2)}.ivu-btn-text:hover>a:only-child{color:currentColor}.ivu-btn-text:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.active,.ivu-btn-text:active{color:#4d5669;background-color:rgba(0,0,0,.05);border-color:rgba(0,0,0,.05)}.ivu-btn-text.active>a:only-child,.ivu-btn-text:active>a:only-child{color:currentColor}.ivu-btn-text.active>a:only-child:after,.ivu-btn-text:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.disabled,.ivu-btn-text.disabled.active,.ivu-btn-text.disabled:active,.ivu-btn-text.disabled:focus,.ivu-btn-text.disabled:hover,.ivu-btn-text[disabled],.ivu-btn-text[disabled].active,.ivu-btn-text[disabled]:active,.ivu-btn-text[disabled]:focus,.ivu-btn-text[disabled]:hover,fieldset[disabled] .ivu-btn-text,fieldset[disabled] .ivu-btn-text.active,fieldset[disabled] .ivu-btn-text:active,fieldset[disabled] .ivu-btn-text:focus,fieldset[disabled] .ivu-btn-text:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-text.disabled.active>a:only-child,.ivu-btn-text.disabled:active>a:only-child,.ivu-btn-text.disabled:focus>a:only-child,.ivu-btn-text.disabled:hover>a:only-child,.ivu-btn-text.disabled>a:only-child,.ivu-btn-text[disabled].active>a:only-child,.ivu-btn-text[disabled]:active>a:only-child,.ivu-btn-text[disabled]:focus>a:only-child,.ivu-btn-text[disabled]:hover>a:only-child,.ivu-btn-text[disabled]>a:only-child,fieldset[disabled] .ivu-btn-text.active>a:only-child,fieldset[disabled] .ivu-btn-text:active>a:only-child,fieldset[disabled] .ivu-btn-text:focus>a:only-child,fieldset[disabled] .ivu-btn-text:hover>a:only-child,fieldset[disabled] .ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text.disabled.active>a:only-child:after,.ivu-btn-text.disabled:active>a:only-child:after,.ivu-btn-text.disabled:focus>a:only-child:after,.ivu-btn-text.disabled:hover>a:only-child:after,.ivu-btn-text.disabled>a:only-child:after,.ivu-btn-text[disabled].active>a:only-child:after,.ivu-btn-text[disabled]:active>a:only-child:after,.ivu-btn-text[disabled]:focus>a:only-child:after,.ivu-btn-text[disabled]:hover>a:only-child:after,.ivu-btn-text[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-text.active>a:only-child:after,fieldset[disabled] .ivu-btn-text:active>a:only-child:after,fieldset[disabled] .ivu-btn-text:focus>a:only-child:after,fieldset[disabled] .ivu-btn-text:hover>a:only-child:after,fieldset[disabled] .ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.disabled,.ivu-btn-text.disabled.active,.ivu-btn-text.disabled:active,.ivu-btn-text.disabled:focus,.ivu-btn-text.disabled:hover,.ivu-btn-text[disabled],.ivu-btn-text[disabled].active,.ivu-btn-text[disabled]:active,.ivu-btn-text[disabled]:focus,.ivu-btn-text[disabled]:hover,fieldset[disabled] .ivu-btn-text,fieldset[disabled] .ivu-btn-text.active,fieldset[disabled] .ivu-btn-text:active,fieldset[disabled] .ivu-btn-text:focus,fieldset[disabled] .ivu-btn-text:hover{color:#c5c8ce;background-color:#fff;border-color:transparent}.ivu-btn-text.disabled.active>a:only-child,.ivu-btn-text.disabled:active>a:only-child,.ivu-btn-text.disabled:focus>a:only-child,.ivu-btn-text.disabled:hover>a:only-child,.ivu-btn-text.disabled>a:only-child,.ivu-btn-text[disabled].active>a:only-child,.ivu-btn-text[disabled]:active>a:only-child,.ivu-btn-text[disabled]:focus>a:only-child,.ivu-btn-text[disabled]:hover>a:only-child,.ivu-btn-text[disabled]>a:only-child,fieldset[disabled] .ivu-btn-text.active>a:only-child,fieldset[disabled] .ivu-btn-text:active>a:only-child,fieldset[disabled] .ivu-btn-text:focus>a:only-child,fieldset[disabled] .ivu-btn-text:hover>a:only-child,fieldset[disabled] .ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text.disabled.active>a:only-child:after,.ivu-btn-text.disabled:active>a:only-child:after,.ivu-btn-text.disabled:focus>a:only-child:after,.ivu-btn-text.disabled:hover>a:only-child:after,.ivu-btn-text.disabled>a:only-child:after,.ivu-btn-text[disabled].active>a:only-child:after,.ivu-btn-text[disabled]:active>a:only-child:after,.ivu-btn-text[disabled]:focus>a:only-child:after,.ivu-btn-text[disabled]:hover>a:only-child:after,.ivu-btn-text[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-text.active>a:only-child:after,fieldset[disabled] .ivu-btn-text:active>a:only-child:after,fieldset[disabled] .ivu-btn-text:focus>a:only-child:after,fieldset[disabled] .ivu-btn-text:hover>a:only-child:after,fieldset[disabled] .ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:hover{color:#57a3f3;background-color:#fff;border-color:transparent}.ivu-btn-text:hover>a:only-child{color:currentColor}.ivu-btn-text:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.active,.ivu-btn-text:active{color:#2b85e4;background-color:#fff;border-color:transparent}.ivu-btn-text.active>a:only-child,.ivu-btn-text:active>a:only-child{color:currentColor}.ivu-btn-text.active>a:only-child:after,.ivu-btn-text:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-success{color:#fff;background-color:#19be6b;border-color:#19be6b}.ivu-btn-success>a:only-child{color:currentColor}.ivu-btn-success>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success:hover{color:#fff;background-color:#47cb89;border-color:#47cb89}.ivu-btn-success:hover>a:only-child{color:currentColor}.ivu-btn-success:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.active,.ivu-btn-success:active{color:#f2f2f2;background-color:#18b566;border-color:#18b566}.ivu-btn-success.active>a:only-child,.ivu-btn-success:active>a:only-child{color:currentColor}.ivu-btn-success.active>a:only-child:after,.ivu-btn-success:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.disabled,.ivu-btn-success.disabled.active,.ivu-btn-success.disabled:active,.ivu-btn-success.disabled:focus,.ivu-btn-success.disabled:hover,.ivu-btn-success[disabled],.ivu-btn-success[disabled].active,.ivu-btn-success[disabled]:active,.ivu-btn-success[disabled]:focus,.ivu-btn-success[disabled]:hover,fieldset[disabled] .ivu-btn-success,fieldset[disabled] .ivu-btn-success.active,fieldset[disabled] .ivu-btn-success:active,fieldset[disabled] .ivu-btn-success:focus,fieldset[disabled] .ivu-btn-success:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-success.disabled.active>a:only-child,.ivu-btn-success.disabled:active>a:only-child,.ivu-btn-success.disabled:focus>a:only-child,.ivu-btn-success.disabled:hover>a:only-child,.ivu-btn-success.disabled>a:only-child,.ivu-btn-success[disabled].active>a:only-child,.ivu-btn-success[disabled]:active>a:only-child,.ivu-btn-success[disabled]:focus>a:only-child,.ivu-btn-success[disabled]:hover>a:only-child,.ivu-btn-success[disabled]>a:only-child,fieldset[disabled] .ivu-btn-success.active>a:only-child,fieldset[disabled] .ivu-btn-success:active>a:only-child,fieldset[disabled] .ivu-btn-success:focus>a:only-child,fieldset[disabled] .ivu-btn-success:hover>a:only-child,fieldset[disabled] .ivu-btn-success>a:only-child{color:currentColor}.ivu-btn-success.disabled.active>a:only-child:after,.ivu-btn-success.disabled:active>a:only-child:after,.ivu-btn-success.disabled:focus>a:only-child:after,.ivu-btn-success.disabled:hover>a:only-child:after,.ivu-btn-success.disabled>a:only-child:after,.ivu-btn-success[disabled].active>a:only-child:after,.ivu-btn-success[disabled]:active>a:only-child:after,.ivu-btn-success[disabled]:focus>a:only-child:after,.ivu-btn-success[disabled]:hover>a:only-child:after,.ivu-btn-success[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-success.active>a:only-child:after,fieldset[disabled] .ivu-btn-success:active>a:only-child:after,fieldset[disabled] .ivu-btn-success:focus>a:only-child:after,fieldset[disabled] .ivu-btn-success:hover>a:only-child:after,fieldset[disabled] .ivu-btn-success>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.active,.ivu-btn-success:active,.ivu-btn-success:hover{color:#fff}.ivu-btn-success:focus{-webkit-box-shadow:0 0 0 2px rgba(25,190,107,.2);box-shadow:0 0 0 2px rgba(25,190,107,.2)}.ivu-btn-warning{color:#fff;background-color:#f90;border-color:#f90}.ivu-btn-warning>a:only-child{color:currentColor}.ivu-btn-warning>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning:hover{color:#fff;background-color:#ffad33;border-color:#ffad33}.ivu-btn-warning:hover>a:only-child{color:currentColor}.ivu-btn-warning:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.active,.ivu-btn-warning:active{color:#f2f2f2;background-color:#f29100;border-color:#f29100}.ivu-btn-warning.active>a:only-child,.ivu-btn-warning:active>a:only-child{color:currentColor}.ivu-btn-warning.active>a:only-child:after,.ivu-btn-warning:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.disabled,.ivu-btn-warning.disabled.active,.ivu-btn-warning.disabled:active,.ivu-btn-warning.disabled:focus,.ivu-btn-warning.disabled:hover,.ivu-btn-warning[disabled],.ivu-btn-warning[disabled].active,.ivu-btn-warning[disabled]:active,.ivu-btn-warning[disabled]:focus,.ivu-btn-warning[disabled]:hover,fieldset[disabled] .ivu-btn-warning,fieldset[disabled] .ivu-btn-warning.active,fieldset[disabled] .ivu-btn-warning:active,fieldset[disabled] .ivu-btn-warning:focus,fieldset[disabled] .ivu-btn-warning:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-warning.disabled.active>a:only-child,.ivu-btn-warning.disabled:active>a:only-child,.ivu-btn-warning.disabled:focus>a:only-child,.ivu-btn-warning.disabled:hover>a:only-child,.ivu-btn-warning.disabled>a:only-child,.ivu-btn-warning[disabled].active>a:only-child,.ivu-btn-warning[disabled]:active>a:only-child,.ivu-btn-warning[disabled]:focus>a:only-child,.ivu-btn-warning[disabled]:hover>a:only-child,.ivu-btn-warning[disabled]>a:only-child,fieldset[disabled] .ivu-btn-warning.active>a:only-child,fieldset[disabled] .ivu-btn-warning:active>a:only-child,fieldset[disabled] .ivu-btn-warning:focus>a:only-child,fieldset[disabled] .ivu-btn-warning:hover>a:only-child,fieldset[disabled] .ivu-btn-warning>a:only-child{color:currentColor}.ivu-btn-warning.disabled.active>a:only-child:after,.ivu-btn-warning.disabled:active>a:only-child:after,.ivu-btn-warning.disabled:focus>a:only-child:after,.ivu-btn-warning.disabled:hover>a:only-child:after,.ivu-btn-warning.disabled>a:only-child:after,.ivu-btn-warning[disabled].active>a:only-child:after,.ivu-btn-warning[disabled]:active>a:only-child:after,.ivu-btn-warning[disabled]:focus>a:only-child:after,.ivu-btn-warning[disabled]:hover>a:only-child:after,.ivu-btn-warning[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-warning.active>a:only-child:after,fieldset[disabled] .ivu-btn-warning:active>a:only-child:after,fieldset[disabled] .ivu-btn-warning:focus>a:only-child:after,fieldset[disabled] .ivu-btn-warning:hover>a:only-child:after,fieldset[disabled] .ivu-btn-warning>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.active,.ivu-btn-warning:active,.ivu-btn-warning:hover{color:#fff}.ivu-btn-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(255,153,0,.2);box-shadow:0 0 0 2px rgba(255,153,0,.2)}.ivu-btn-error{color:#fff;background-color:#ed4014;border-color:#ed4014}.ivu-btn-error>a:only-child{color:currentColor}.ivu-btn-error>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error:hover{color:#fff;background-color:#f16643;border-color:#f16643}.ivu-btn-error:hover>a:only-child{color:currentColor}.ivu-btn-error:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.active,.ivu-btn-error:active{color:#f2f2f2;background-color:#e13d13;border-color:#e13d13}.ivu-btn-error.active>a:only-child,.ivu-btn-error:active>a:only-child{color:currentColor}.ivu-btn-error.active>a:only-child:after,.ivu-btn-error:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.disabled,.ivu-btn-error.disabled.active,.ivu-btn-error.disabled:active,.ivu-btn-error.disabled:focus,.ivu-btn-error.disabled:hover,.ivu-btn-error[disabled],.ivu-btn-error[disabled].active,.ivu-btn-error[disabled]:active,.ivu-btn-error[disabled]:focus,.ivu-btn-error[disabled]:hover,fieldset[disabled] .ivu-btn-error,fieldset[disabled] .ivu-btn-error.active,fieldset[disabled] .ivu-btn-error:active,fieldset[disabled] .ivu-btn-error:focus,fieldset[disabled] .ivu-btn-error:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-error.disabled.active>a:only-child,.ivu-btn-error.disabled:active>a:only-child,.ivu-btn-error.disabled:focus>a:only-child,.ivu-btn-error.disabled:hover>a:only-child,.ivu-btn-error.disabled>a:only-child,.ivu-btn-error[disabled].active>a:only-child,.ivu-btn-error[disabled]:active>a:only-child,.ivu-btn-error[disabled]:focus>a:only-child,.ivu-btn-error[disabled]:hover>a:only-child,.ivu-btn-error[disabled]>a:only-child,fieldset[disabled] .ivu-btn-error.active>a:only-child,fieldset[disabled] .ivu-btn-error:active>a:only-child,fieldset[disabled] .ivu-btn-error:focus>a:only-child,fieldset[disabled] .ivu-btn-error:hover>a:only-child,fieldset[disabled] .ivu-btn-error>a:only-child{color:currentColor}.ivu-btn-error.disabled.active>a:only-child:after,.ivu-btn-error.disabled:active>a:only-child:after,.ivu-btn-error.disabled:focus>a:only-child:after,.ivu-btn-error.disabled:hover>a:only-child:after,.ivu-btn-error.disabled>a:only-child:after,.ivu-btn-error[disabled].active>a:only-child:after,.ivu-btn-error[disabled]:active>a:only-child:after,.ivu-btn-error[disabled]:focus>a:only-child:after,.ivu-btn-error[disabled]:hover>a:only-child:after,.ivu-btn-error[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-error.active>a:only-child:after,fieldset[disabled] .ivu-btn-error:active>a:only-child:after,fieldset[disabled] .ivu-btn-error:focus>a:only-child:after,fieldset[disabled] .ivu-btn-error:hover>a:only-child:after,fieldset[disabled] .ivu-btn-error>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.active,.ivu-btn-error:active,.ivu-btn-error:hover{color:#fff}.ivu-btn-error:focus{-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-btn-info{color:#fff;background-color:#2db7f5;border-color:#2db7f5}.ivu-btn-info>a:only-child{color:currentColor}.ivu-btn-info>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info:hover{color:#fff;background-color:#57c5f7;border-color:#57c5f7}.ivu-btn-info:hover>a:only-child{color:currentColor}.ivu-btn-info:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.active,.ivu-btn-info:active{color:#f2f2f2;background-color:#2baee9;border-color:#2baee9}.ivu-btn-info.active>a:only-child,.ivu-btn-info:active>a:only-child{color:currentColor}.ivu-btn-info.active>a:only-child:after,.ivu-btn-info:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.disabled,.ivu-btn-info.disabled.active,.ivu-btn-info.disabled:active,.ivu-btn-info.disabled:focus,.ivu-btn-info.disabled:hover,.ivu-btn-info[disabled],.ivu-btn-info[disabled].active,.ivu-btn-info[disabled]:active,.ivu-btn-info[disabled]:focus,.ivu-btn-info[disabled]:hover,fieldset[disabled] .ivu-btn-info,fieldset[disabled] .ivu-btn-info.active,fieldset[disabled] .ivu-btn-info:active,fieldset[disabled] .ivu-btn-info:focus,fieldset[disabled] .ivu-btn-info:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-info.disabled.active>a:only-child,.ivu-btn-info.disabled:active>a:only-child,.ivu-btn-info.disabled:focus>a:only-child,.ivu-btn-info.disabled:hover>a:only-child,.ivu-btn-info.disabled>a:only-child,.ivu-btn-info[disabled].active>a:only-child,.ivu-btn-info[disabled]:active>a:only-child,.ivu-btn-info[disabled]:focus>a:only-child,.ivu-btn-info[disabled]:hover>a:only-child,.ivu-btn-info[disabled]>a:only-child,fieldset[disabled] .ivu-btn-info.active>a:only-child,fieldset[disabled] .ivu-btn-info:active>a:only-child,fieldset[disabled] .ivu-btn-info:focus>a:only-child,fieldset[disabled] .ivu-btn-info:hover>a:only-child,fieldset[disabled] .ivu-btn-info>a:only-child{color:currentColor}.ivu-btn-info.disabled.active>a:only-child:after,.ivu-btn-info.disabled:active>a:only-child:after,.ivu-btn-info.disabled:focus>a:only-child:after,.ivu-btn-info.disabled:hover>a:only-child:after,.ivu-btn-info.disabled>a:only-child:after,.ivu-btn-info[disabled].active>a:only-child:after,.ivu-btn-info[disabled]:active>a:only-child:after,.ivu-btn-info[disabled]:focus>a:only-child:after,.ivu-btn-info[disabled]:hover>a:only-child:after,.ivu-btn-info[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-info.active>a:only-child:after,fieldset[disabled] .ivu-btn-info:active>a:only-child:after,fieldset[disabled] .ivu-btn-info:focus>a:only-child:after,fieldset[disabled] .ivu-btn-info:hover>a:only-child:after,fieldset[disabled] .ivu-btn-info>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.active,.ivu-btn-info:active,.ivu-btn-info:hover{color:#fff}.ivu-btn-info:focus{-webkit-box-shadow:0 0 0 2px rgba(45,183,245,.2);box-shadow:0 0 0 2px rgba(45,183,245,.2)}.ivu-btn-circle,.ivu-btn-circle-outline{border-radius:32px}.ivu-btn-circle-outline.ivu-btn-large,.ivu-btn-circle.ivu-btn-large{border-radius:40px}.ivu-btn-circle-outline.ivu-btn-size,.ivu-btn-circle.ivu-btn-size{border-radius:24px}.ivu-btn-circle-outline.ivu-btn-icon-only,.ivu-btn-circle.ivu-btn-icon-only{width:32px;height:32px;padding:0;font-size:16px;border-radius:50%}.ivu-btn-circle-outline.ivu-btn-icon-only.ivu-btn-large,.ivu-btn-circle.ivu-btn-icon-only.ivu-btn-large{width:40px;height:40px;padding:0;font-size:18px;border-radius:50%}.ivu-btn-circle-outline.ivu-btn-icon-only.ivu-btn-small,.ivu-btn-circle.ivu-btn-icon-only.ivu-btn-small{width:24px;height:24px;padding:0;font-size:14px;border-radius:50%}.ivu-btn:before{position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;background:#fff;opacity:.35;content:'';border-radius:inherit;z-index:1;-webkit-transition:opacity .2s;transition:opacity .2s;pointer-events:none;display:none}.ivu-btn.ivu-btn-loading{pointer-events:none;position:relative}.ivu-btn.ivu-btn-loading:before{display:block}.ivu-btn-group{position:relative;display:inline-block;vertical-align:middle}.ivu-btn-group>.ivu-btn{position:relative;float:left}.ivu-btn-group>.ivu-btn.active,.ivu-btn-group>.ivu-btn:active,.ivu-btn-group>.ivu-btn:hover{z-index:2}.ivu-btn-group-circle .ivu-btn{border-radius:32px}.ivu-btn-group-large.ivu-btn-group-circle .ivu-btn{border-radius:40px}.ivu-btn-group-large>.ivu-btn{height:40px;padding:0 15px;font-size:16px;border-radius:4px}.ivu-btn-group-small.ivu-btn-group-circle .ivu-btn{border-radius:24px}.ivu-btn-group-small>.ivu-btn{height:24px;padding:0 7px;font-size:14px;border-radius:3px}.ivu-btn-group-small>.ivu-btn>.ivu-icon{font-size:14px}.ivu-btn-group-small .ivu-btn-icon-only{width:24px;height:24px;padding:0}.ivu-btn-group-large .ivu-btn-icon-only{width:40px;height:40px;padding:0}.ivu-btn+.ivu-btn-group,.ivu-btn-group .ivu-btn+.ivu-btn,.ivu-btn-group+.ivu-btn,.ivu-btn-group+.ivu-btn-group{margin-left:-1px}.ivu-btn-group .ivu-btn:not(:first-child):not(:last-child){border-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:first-child{margin-left:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ivu-btn-group>.ivu-btn-group{float:left}.ivu-btn-group>.ivu-btn-group:not(:first-child):not(:last-child)>.ivu-btn{border-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn-group:first-child:not(:last-child)>.ivu-btn:last-child{border-bottom-right-radius:0;border-top-right-radius:0;padding-right:8px}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn-group:last-child:not(:first-child)>.ivu-btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px}.ivu-btn-group-vertical{display:inline-block;vertical-align:middle}.ivu-btn-group-vertical>.ivu-btn{display:block;width:100%;max-width:100%;float:none;min-width:32px}.ivu-btn-group-vertical.ivu-btn-group-small>.ivu-btn{min-width:24px}.ivu-btn-group-vertical.ivu-btn-group-large>.ivu-btn{min-width:40px}.ivu-btn+.ivu-btn-group-vertical,.ivu-btn-group-vertical .ivu-btn+.ivu-btn,.ivu-btn-group-vertical+.ivu-btn,.ivu-btn-group-vertical+.ivu-btn-group-vertical{margin-top:-1px;margin-left:0}.ivu-btn-group-vertical>.ivu-btn:first-child{margin-top:0}.ivu-btn-group-vertical>.ivu-btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0}.ivu-btn-group-vertical>.ivu-btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.ivu-btn-group-vertical>.ivu-btn-group-vertical:first-child:not(:last-child)>.ivu-btn:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:8px}.ivu-btn-group-vertical>.ivu-btn-group-vertical:last-child:not(:first-child)>.ivu-btn:first-child{border-bottom-right-radius:0;border-bottom-left-radius:0;padding-top:8px}.ivu-btn-ghost{color:#fff;background:0 0}.ivu-btn-ghost:hover{background:0 0}.ivu-btn-ghost.ivu-btn-dashed,.ivu-btn-ghost.ivu-btn-default{color:#fff;border-color:#fff}.ivu-btn-ghost.ivu-btn-dashed:hover,.ivu-btn-ghost.ivu-btn-default:hover{color:#57a3f3;border-color:#57a3f3}.ivu-btn-ghost.ivu-btn-primary{color:#2d8cf0}.ivu-btn-ghost.ivu-btn-primary:hover{color:#57a3f3;background:rgba(245,249,254,.5)}.ivu-btn-ghost.ivu-btn-info{color:#2db7f5}.ivu-btn-ghost.ivu-btn-info:hover{color:#57c5f7;background:rgba(245,251,254,.5)}.ivu-btn-ghost.ivu-btn-success{color:#19be6b}.ivu-btn-ghost.ivu-btn-success:hover{color:#47cb89;background:rgba(244,252,248,.5)}.ivu-btn-ghost.ivu-btn-warning{color:#f90}.ivu-btn-ghost.ivu-btn-warning:hover{color:#ffad33;background:rgba(255,250,242,.5)}.ivu-btn-ghost.ivu-btn-error{color:#ed4014}.ivu-btn-ghost.ivu-btn-error:hover{color:#f16643;background:rgba(254,245,243,.5)}.ivu-btn-ghost.ivu-btn-dashed[disabled],.ivu-btn-ghost.ivu-btn-default[disabled],.ivu-btn-ghost.ivu-btn-error[disabled],.ivu-btn-ghost.ivu-btn-info[disabled],.ivu-btn-ghost.ivu-btn-primary[disabled],.ivu-btn-ghost.ivu-btn-success[disabled],.ivu-btn-ghost.ivu-btn-warning[disabled]{background:0 0;color:rgba(0,0,0,.25);border-color:#dcdee2}.ivu-btn-ghost.ivu-btn-text[disabled]{background:0 0;color:rgba(0,0,0,.25)}a.ivu-btn{padding-top:.1px;line-height:30px}a.ivu-btn-large{line-height:38px}a.ivu-btn-small{line-height:22px}.ivu-affix{position:fixed;z-index:10}.ivu-back-top{z-index:10;position:fixed;cursor:pointer;display:none}.ivu-back-top.ivu-back-top-show{display:block}.ivu-back-top-inner{background-color:rgba(0,0,0,.6);border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.2);box-shadow:0 1px 3px rgba(0,0,0,.2);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-back-top-inner:hover{background-color:rgba(0,0,0,.7)}.ivu-back-top i{color:#fff;font-size:24px;padding:8px 12px}.ivu-badge{position:relative;display:inline-block}.ivu-badge-count{font-family:\"Monospaced Number\";line-height:1;vertical-align:middle;position:absolute;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);top:-10px;right:0;height:20px;border-radius:10px;min-width:20px;background:#ed4014;border:1px solid transparent;color:#fff;line-height:18px;text-align:center;padding:0 6px;font-size:12px;white-space:nowrap;-webkit-transform-origin:-10% center;-ms-transform-origin:-10% center;transform-origin:-10% center;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ivu-badge-count-custom{background:0 0;color:inherit;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.ivu-badge-count a,.ivu-badge-count a:hover{color:#fff}.ivu-badge-count-alone{top:auto;display:block;position:relative;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ivu-badge-count-primary{background:#2d8cf0}.ivu-badge-count-success{background:#19be6b}.ivu-badge-count-error{background:#ed4014}.ivu-badge-count-warning{background:#f90}.ivu-badge-count-info{background:#2db7f5}.ivu-badge-count-normal{background:#e6ebf1;color:#808695}.ivu-badge-dot{position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);-webkit-transform-origin:0 center;-ms-transform-origin:0 center;transform-origin:0 center;top:-4px;right:-8px;height:8px;width:8px;border-radius:100%;background:#ed4014;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ivu-badge-status{line-height:inherit;vertical-align:baseline}.ivu-badge-status-dot{width:6px;height:6px;display:inline-block;border-radius:50%;vertical-align:middle;position:relative;top:-1px}.ivu-badge-status-success{background-color:#19be6b}.ivu-badge-status-processing{background-color:#2d8cf0;position:relative}.ivu-badge-status-processing:after{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;border:1px solid #2d8cf0;content:'';-webkit-animation:aniStatusProcessing 1.2s infinite ease-in-out;animation:aniStatusProcessing 1.2s infinite ease-in-out}.ivu-badge-status-default{background-color:#e6ebf1}.ivu-badge-status-error{background-color:#ed4014}.ivu-badge-status-warning{background-color:#f90}.ivu-badge-status-text{display:inline-block;color:#515a6e;font-size:14px;margin-left:6px}.ivu-badge-status-pink{background-color:#eb2f96}.ivu-badge-status-magenta{background-color:#eb2f96}.ivu-badge-status-red{background-color:#f5222d}.ivu-badge-status-volcano{background-color:#fa541c}.ivu-badge-status-orange{background-color:#fa8c16}.ivu-badge-status-yellow{background-color:#fadb14}.ivu-badge-status-gold{background-color:#faad14}.ivu-badge-status-cyan{background-color:#13c2c2}.ivu-badge-status-lime{background-color:#a0d911}.ivu-badge-status-green{background-color:#52c41a}.ivu-badge-status-blue{background-color:#1890ff}.ivu-badge-status-geekblue{background-color:#2f54eb}.ivu-badge-status-purple{background-color:#722ed1}@-webkit-keyframes aniStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}100%{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}@keyframes aniStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}100%{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}.ivu-chart-circle{display:inline-block;position:relative}.ivu-chart-circle-inner{width:100%;text-align:center;position:absolute;left:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);line-height:1}.ivu-spin{color:#2d8cf0;vertical-align:middle;text-align:center}.ivu-spin-dot{position:relative;display:block;border-radius:50%;background-color:#2d8cf0;width:20px;height:20px;-webkit-animation:ani-spin-bounce 1s 0s ease-in-out infinite;animation:ani-spin-bounce 1s 0s ease-in-out infinite}.ivu-spin-large .ivu-spin-dot{width:32px;height:32px}.ivu-spin-small .ivu-spin-dot{width:12px;height:12px}.ivu-spin-fix{position:absolute;top:0;left:0;z-index:8;width:100%;height:100%;background-color:rgba(255,255,255,.9)}.ivu-spin-fullscreen{z-index:2010}.ivu-spin-fullscreen-wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.ivu-spin-fix .ivu-spin-main{position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ivu-spin-fix .ivu-spin-dot{display:inline-block}.ivu-spin-show-text .ivu-spin-dot,.ivu-spin-text{display:none}.ivu-spin-show-text .ivu-spin-text{display:block}.ivu-table-wrapper>.ivu-spin-fix{border:1px solid #dcdee2;border-top:0;border-left:0}@-webkit-keyframes ani-spin-bounce{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@keyframes ani-spin-bounce{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.ivu-alert{position:relative;padding:8px 48px 8px 16px;border-radius:4px;color:#515a6e;font-size:14px;line-height:16px;margin-bottom:10px}.ivu-alert.ivu-alert-with-icon{padding:8px 48px 8px 38px}.ivu-alert-icon{font-size:16px;top:6px;left:12px;position:absolute}.ivu-alert-desc{font-size:14px;color:#515a6e;line-height:21px;display:none;text-align:justify}.ivu-alert-success{border:1px solid #8ce6b0;background-color:#edfff3}.ivu-alert-success .ivu-alert-icon{color:#19be6b}.ivu-alert-info{border:1px solid #abdcff;background-color:#f0faff}.ivu-alert-info .ivu-alert-icon{color:#2d8cf0}.ivu-alert-warning{border:1px solid #ffd77a;background-color:#fff9e6}.ivu-alert-warning .ivu-alert-icon{color:#f90}.ivu-alert-error{border:1px solid #ffb08f;background-color:#ffefe6}.ivu-alert-error .ivu-alert-icon{color:#ed4014}.ivu-alert-close{font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-alert-close .ivu-icon-ios-close{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-alert-close .ivu-icon-ios-close:hover{color:#444}.ivu-alert-with-desc{padding:16px;position:relative;border-radius:4px;margin-bottom:10px;color:#515a6e;line-height:1.5}.ivu-alert-with-desc.ivu-alert-with-icon{padding:16px 16px 16px 69px}.ivu-alert-with-desc .ivu-alert-desc{display:block}.ivu-alert-with-desc .ivu-alert-message{font-size:16px;color:#17233d;display:block;margin-bottom:4px}.ivu-alert-with-desc .ivu-alert-icon{top:50%;left:24px;margin-top:-24px;font-size:28px}.ivu-alert-with-banner{border-radius:0}.ivu-collapse{background-color:#f7f7f7;border-radius:3px;border:1px solid #dcdee2}.ivu-collapse-simple{border-left:none;border-right:none;background-color:#fff;border-radius:0}.ivu-collapse>.ivu-collapse-item{border-top:1px solid #dcdee2}.ivu-collapse>.ivu-collapse-item:first-child{border-top:0}.ivu-collapse>.ivu-collapse-item>.ivu-collapse-header{height:38px;line-height:38px;padding-left:16px;color:#666;cursor:pointer;position:relative;border-bottom:1px solid transparent;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-collapse>.ivu-collapse-item>.ivu-collapse-header>i{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;margin-right:14px}.ivu-collapse>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header{border-bottom:1px solid #dcdee2}.ivu-collapse-simple>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header{border-bottom:1px solid transparent}.ivu-collapse>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header>i{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-collapse-content{color:#515a6e;padding:0 16px;background-color:#fff}.ivu-collapse-content>.ivu-collapse-content-box{padding-top:16px;padding-bottom:16px}.ivu-collapse-simple>.ivu-collapse-item>.ivu-collapse-content>.ivu-collapse-content-box{padding-top:0}.ivu-collapse-item:last-child>.ivu-collapse-content{border-radius:0 0 3px 3px}.ivu-card{display:block;background:#fff;border-radius:4px;font-size:14px;position:relative;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-card-bordered{border:1px solid #dcdee2;border-color:#e8eaec}.ivu-card-shadow{-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.ivu-card:hover{-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);border-color:#eee}.ivu-card.ivu-card-dis-hover:hover{-webkit-box-shadow:none;box-shadow:none;border-color:transparent}.ivu-card.ivu-card-dis-hover.ivu-card-bordered:hover{border-color:#e8eaec}.ivu-card.ivu-card-shadow:hover{-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.ivu-card-head{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-card-head p,.ivu-card-head-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-card-extra{position:absolute;right:16px;top:14px}.ivu-card-body{padding:16px}.ivu-message{font-size:14px;position:fixed;z-index:1010;width:100%;top:16px;left:0;pointer-events:none}.ivu-message-notice{padding:8px;text-align:center;-webkit-transition:height .3s ease-in-out,padding .3s ease-in-out;transition:height .3s ease-in-out,padding .3s ease-in-out}.ivu-message-notice:first-child{margin-top:-8px}.ivu-message-notice-close{position:absolute;right:4px;top:10px;color:#999;outline:0}.ivu-message-notice-close i.ivu-icon{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-message-notice-close i.ivu-icon:hover{color:#444}.ivu-message-notice-content{display:inline-block;pointer-events:all;padding:8px 16px;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);background:#fff;position:relative}.ivu-message-notice-content-text{display:inline-block}.ivu-message-notice-closable .ivu-message-notice-content-text{padding-right:32px}.ivu-message-success .ivu-icon{color:#19be6b}.ivu-message-error .ivu-icon{color:#ed4014}.ivu-message-warning .ivu-icon{color:#f90}.ivu-message-info .ivu-icon,.ivu-message-loading .ivu-icon{color:#2d8cf0}.ivu-message .ivu-icon{margin-right:4px;font-size:16px;vertical-align:middle}.ivu-message-custom-content span{vertical-align:middle}.ivu-message-notice-with-background .ivu-message-notice-content-background{-webkit-box-shadow:none;box-shadow:none}.ivu-message-notice-with-background .ivu-message-notice-content-info{background:#f0faff;color:#2e8bf0;border:1px solid #d4eeff}.ivu-message-notice-with-background .ivu-message-notice-content-success{background:#edfff3;color:#19bf6c;border:1px solid #bbf2cf}.ivu-message-notice-with-background .ivu-message-notice-content-warning{background:#fff9e6;color:#f90;border:1px solid #ffe7a3}.ivu-message-notice-with-background .ivu-message-notice-content-error{background:#ffefe6;color:#ed3f13;border:1px solid #ffcfb8}.ivu-notice{width:335px;margin-right:24px;position:fixed;z-index:1010}.ivu-notice-content-with-icon{margin-left:51px}.ivu-notice-with-desc.ivu-notice-with-icon .ivu-notice-title{margin-left:51px}.ivu-notice-notice{margin-bottom:10px;padding:16px;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);background:#fff;line-height:1;position:relative;overflow:hidden}.ivu-notice-notice-close{position:absolute;right:8px;top:15px;color:#999;outline:0}.ivu-notice-notice-close i{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-notice-notice-close i:hover{color:#444}.ivu-notice-notice-content-with-render .ivu-notice-desc{display:none}.ivu-notice-notice-with-desc .ivu-notice-notice-close{top:11px}.ivu-notice-content-with-render-notitle{margin-left:26px}.ivu-notice-title{font-size:16px;line-height:19px;color:#17233d;padding-right:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-notice-with-desc .ivu-notice-title{margin-bottom:8px}.ivu-notice-desc{font-size:14px;color:#515a6e;text-align:justify;line-height:1.5}.ivu-notice-with-desc.ivu-notice-with-icon .ivu-notice-desc{margin-left:51px}.ivu-notice-with-icon .ivu-notice-title{margin-left:26px}.ivu-notice-icon{position:absolute;top:-2px;font-size:20px}.ivu-notice-icon-success{color:#19be6b}.ivu-notice-icon-info{color:#2d8cf0}.ivu-notice-icon-warning{color:#f90}.ivu-notice-icon-error{color:#ed4014}.ivu-notice-with-desc .ivu-notice-icon{font-size:36px;top:-6px}.ivu-notice-custom-content{position:relative}.ivu-radio-focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);z-index:1}.ivu-radio-group{display:inline-block;font-size:14px;vertical-align:middle}.ivu-radio-group-vertical .ivu-radio-wrapper{display:block;height:30px;line-height:30px}.ivu-radio-wrapper{font-size:14px;vertical-align:middle;display:inline-block;position:relative;white-space:nowrap;margin-right:8px;cursor:pointer}.ivu-radio-wrapper-disabled{cursor:not-allowed}.ivu-radio{display:inline-block;margin-right:4px;white-space:nowrap;position:relative;line-height:1;vertical-align:middle;cursor:pointer}.ivu-radio:hover .ivu-radio-inner{border-color:#bcbcbc}.ivu-radio-inner{display:inline-block;width:16px;height:16px;position:relative;top:0;left:0;background-color:#fff;border:1px solid #dcdee2;border-radius:50%;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-inner:after{position:absolute;width:10px;height:10px;left:2px;top:2px;border-radius:6px;display:table;border-top:0;border-left:0;content:' ';background-color:#2d8cf0;opacity:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.ivu-radio-large{font-size:16px}.ivu-radio-large .ivu-radio-inner{width:18px;height:18px}.ivu-radio-large .ivu-radio-inner:after{width:12px;height:12px}.ivu-radio-large .ivu-radio-wrapper,.ivu-radio-large.ivu-radio-wrapper{font-size:16px}.ivu-radio-small .ivu-radio-inner{width:14px;height:14px}.ivu-radio-small .ivu-radio-inner:after{width:8px;height:8px}.ivu-radio-input{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;opacity:0;cursor:pointer}.ivu-radio-border{border:1px solid #dcdee2;border-radius:4px;height:32px;line-height:30px;padding:0 15px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.ivu-radio-group-small .ivu-radio-border,.ivu-radio-small.ivu-radio-border{height:24px;line-height:22px;padding:0 7px}.ivu-radio-group-large .ivu-radio-border,.ivu-radio-large.ivu-radio-border{height:40px;line-height:36px;padding:0 15px}.ivu-radio-wrapper-checked.ivu-radio-border{border-color:#2d8cf0}.ivu-radio-wrapper-disabled.ivu-radio-border{border-color:#dcdee2}.ivu-radio-checked .ivu-radio-inner{border-color:#2d8cf0}.ivu-radio-checked .ivu-radio-inner:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-checked:hover .ivu-radio-inner{border-color:#2d8cf0}.ivu-radio-disabled{cursor:not-allowed}.ivu-radio-disabled .ivu-radio-input{cursor:not-allowed}.ivu-radio-disabled:hover .ivu-radio-inner{border-color:#dcdee2}.ivu-radio-disabled .ivu-radio-inner{border-color:#dcdee2;background-color:#f3f3f3}.ivu-radio-disabled .ivu-radio-inner:after{background-color:#ccc}.ivu-radio-disabled .ivu-radio-disabled+span{color:#ccc}span.ivu-radio+*{margin-left:2px;margin-right:2px}.ivu-radio-group-button{font-size:0;-webkit-text-size-adjust:none}.ivu-radio-group-button .ivu-radio{width:0;margin-right:0}.ivu-radio-group-button .ivu-radio-wrapper{display:inline-block;height:32px;line-height:30px;margin:0;padding:0 15px;font-size:14px;color:#515a6e;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer;border:1px solid #dcdee2;border-left:0;background:#fff;position:relative}.ivu-radio-group-button .ivu-radio-wrapper>span{margin-left:0}.ivu-radio-group-button .ivu-radio-wrapper:after,.ivu-radio-group-button .ivu-radio-wrapper:before{content:'';display:block;position:absolute;width:1px;height:100%;left:-1px;top:0;background:#dcdee2;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-group-button .ivu-radio-wrapper:after{height:36px;left:-1px;top:-3px;background:rgba(45,140,240,.2);opacity:0}.ivu-radio-group-button .ivu-radio-wrapper:first-child{border-radius:4px 0 0 4px;border-left:1px solid #dcdee2}.ivu-radio-group-button .ivu-radio-wrapper:first-child:after,.ivu-radio-group-button .ivu-radio-wrapper:first-child:before{display:none}.ivu-radio-group-button .ivu-radio-wrapper:last-child{border-radius:0 4px 4px 0}.ivu-radio-group-button .ivu-radio-wrapper:first-child:last-child{border-radius:4px}.ivu-radio-group-button .ivu-radio-wrapper:hover{position:relative;color:#2d8cf0}.ivu-radio-group-button .ivu-radio-wrapper:hover .ivu-radio{background-color:#000}.ivu-radio-group-button .ivu-radio-wrapper .ivu-radio-inner,.ivu-radio-group-button .ivu-radio-wrapper input{opacity:0;width:0;height:0}.ivu-radio-group-button .ivu-radio-wrapper-checked{background:#fff;border-color:#2d8cf0;color:#2d8cf0;-webkit-box-shadow:-1px 0 0 0 #2d8cf0;box-shadow:-1px 0 0 0 #2d8cf0;z-index:1}.ivu-radio-group-button .ivu-radio-wrapper-checked:before{background:#2d8cf0;opacity:.1}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus{-webkit-box-shadow:-1px 0 0 0 #2d8cf0,0 0 0 2px rgba(45,140,240,.2);box-shadow:-1px 0 0 0 #2d8cf0,0 0 0 2px rgba(45,140,240,.2);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus:after{left:-3px;top:-3px;opacity:1;background:rgba(45,140,240,.2)}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus:first-child{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-radio-group-button .ivu-radio-wrapper-checked:first-child{border-color:#2d8cf0;-webkit-box-shadow:none;box-shadow:none}.ivu-radio-group-button .ivu-radio-wrapper-checked:hover{border-color:#57a3f3;color:#57a3f3}.ivu-radio-group-button .ivu-radio-wrapper-checked:active{border-color:#2b85e4;color:#2b85e4}.ivu-radio-group-button .ivu-radio-wrapper-disabled{border-color:#dcdee2;background-color:#f7f7f7;cursor:not-allowed;color:#ccc}.ivu-radio-group-button .ivu-radio-wrapper-disabled:first-child,.ivu-radio-group-button .ivu-radio-wrapper-disabled:hover{border-color:#dcdee2;background-color:#f7f7f7;color:#ccc}.ivu-radio-group-button .ivu-radio-wrapper-disabled:first-child{border-left-color:#dcdee2}.ivu-radio-group-button .ivu-radio-wrapper-disabled.ivu-radio-wrapper-checked{color:#fff;background-color:#e6e6e6;border-color:#dcdee2;-webkit-box-shadow:none!important;box-shadow:none!important}.ivu-radio-group-button.ivu-radio-group-large .ivu-radio-wrapper{height:40px;line-height:38px;font-size:16px}.ivu-radio-group-button.ivu-radio-group-large .ivu-radio-wrapper:after{height:44px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper{height:24px;line-height:22px;padding:0 12px;font-size:14px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:after{height:28px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:first-child{border-radius:3px 0 0 3px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:last-child{border-radius:0 3px 3px 0}.ivu-checkbox-focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);z-index:1}.ivu-checkbox{display:inline-block;vertical-align:middle;white-space:nowrap;cursor:pointer;line-height:1;position:relative}.ivu-checkbox-disabled{cursor:not-allowed}.ivu-checkbox:hover .ivu-checkbox-inner{border-color:#bcbcbc}.ivu-checkbox-inner{display:inline-block;width:16px;height:16px;position:relative;top:0;left:0;border:1px solid #dcdee2;border-radius:2px;background-color:#fff;-webkit-transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-checkbox-inner:after{content:'';display:table;width:4px;height:8px;position:absolute;top:1px;left:4px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(0);-ms-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-checkbox-large .ivu-checkbox-inner{width:18px;height:18px}.ivu-checkbox-large .ivu-checkbox-inner:after{width:5px;height:9px}.ivu-checkbox-small{font-size:14px}.ivu-checkbox-small .ivu-checkbox-inner{width:14px;height:14px}.ivu-checkbox-small .ivu-checkbox-inner:after{top:0;left:3px}.ivu-checkbox-input{width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;cursor:pointer;opacity:0}.ivu-checkbox-input[disabled]{cursor:not-allowed}.ivu-checkbox-border{border:1px solid #dcdee2;border-radius:4px;height:32px;line-height:30px;padding:0 15px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.ivu-checkbox-group.ivu-checkbox-small .ivu-checkbox-border,.ivu-checkbox-small.ivu-checkbox-border{height:24px;line-height:22px;padding:0 7px}.ivu-checkbox-group.ivu-checkbox-large .ivu-checkbox-border,.ivu-checkbox-large.ivu-checkbox-border{height:40px;line-height:36px;padding:0 15px}.ivu-checkbox-wrapper-checked.ivu-checkbox-border{border-color:#2d8cf0}.ivu-checkbox-wrapper-disabled.ivu-checkbox-border{border-color:#dcdee2}.ivu-checkbox-checked:hover .ivu-checkbox-inner{border-color:#2d8cf0}.ivu-checkbox-checked .ivu-checkbox-inner{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-checkbox-checked .ivu-checkbox-inner:after{content:'';display:table;width:4px;height:8px;position:absolute;top:2px;left:5px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1);-ms-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-checkbox-large .ivu-checkbox-checked .ivu-checkbox-inner:after{width:6px;height:10px}.ivu-checkbox-small .ivu-checkbox-checked .ivu-checkbox-inner:after{top:1px;left:4px}.ivu-checkbox-disabled.ivu-checkbox-checked:hover .ivu-checkbox-inner{border-color:#dcdee2}.ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner{background-color:#f3f3f3;border-color:#dcdee2}.ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#ccc}.ivu-checkbox-disabled:hover .ivu-checkbox-inner{border-color:#dcdee2}.ivu-checkbox-disabled .ivu-checkbox-inner{border-color:#dcdee2;background-color:#f3f3f3}.ivu-checkbox-disabled .ivu-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#f3f3f3}.ivu-checkbox-disabled .ivu-checkbox-inner-input{cursor:default}.ivu-checkbox-disabled+span{color:#ccc;cursor:not-allowed}.ivu-checkbox-indeterminate .ivu-checkbox-inner:after{content:'';width:10px;height:1px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);position:absolute;left:2px;top:6px}.ivu-checkbox-indeterminate:hover .ivu-checkbox-inner{border-color:#2d8cf0}.ivu-checkbox-indeterminate .ivu-checkbox-inner{background-color:#2d8cf0;border-color:#2d8cf0}.ivu-checkbox-indeterminate.ivu-checkbox-disabled .ivu-checkbox-inner{background-color:#f3f3f3;border-color:#dcdee2}.ivu-checkbox-indeterminate.ivu-checkbox-disabled .ivu-checkbox-inner:after{border-color:#c5c8ce}.ivu-checkbox-large .ivu-checkbox-indeterminate .ivu-checkbox-inner:after{width:12px;top:7px}.ivu-checkbox-small .ivu-checkbox-indeterminate .ivu-checkbox-inner:after{width:8px;top:5px}.ivu-checkbox-wrapper{cursor:pointer;font-size:14px;display:inline-block;margin-right:8px}.ivu-checkbox-wrapper-disabled{cursor:not-allowed}.ivu-checkbox-wrapper.ivu-checkbox-large{font-size:16px}.ivu-checkbox+span,.ivu-checkbox-wrapper+span{margin-right:4px}.ivu-checkbox-group{font-size:14px}.ivu-checkbox-group-item{display:inline-block}.ivu-switch{display:inline-block;width:44px;height:22px;line-height:20px;border-radius:22px;vertical-align:middle;border:1px solid #ccc;background-color:#ccc;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-switch-loading{opacity:.4}.ivu-switch-inner{color:#fff;font-size:12px;position:absolute;left:23px}.ivu-switch-inner i{width:12px;height:12px;text-align:center;position:relative;top:-1px}.ivu-switch:after{content:'';width:18px;height:18px;border-radius:18px;background-color:#fff;position:absolute;left:1px;top:1px;cursor:pointer;-webkit-transition:left .2s ease-in-out,width .2s ease-in-out;transition:left .2s ease-in-out,width .2s ease-in-out}.ivu-switch:active:after{width:26px}.ivu-switch:before{content:'';display:none;width:14px;height:14px;border-radius:50%;background-color:transparent;position:absolute;left:3px;top:3px;z-index:1;border:1px solid #2d8cf0;border-color:transparent transparent transparent #2d8cf0;-webkit-animation:switch-loading 1s linear;animation:switch-loading 1s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.ivu-switch-loading:before{display:block}.ivu-switch:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);outline:0}.ivu-switch:focus:hover{-webkit-box-shadow:none;box-shadow:none}.ivu-switch-small{width:28px;height:16px;line-height:14px}.ivu-switch-small:after{width:12px;height:12px}.ivu-switch-small:active:after{width:14px}.ivu-switch-small:before{width:10px;height:10px;left:2px;top:2px}.ivu-switch-small.ivu-switch-checked:after{left:13px}.ivu-switch-small.ivu-switch-checked:before{left:14px}.ivu-switch-small:active.ivu-switch-checked:after{left:11px}.ivu-switch-large{width:56px}.ivu-switch-large:active:after{width:26px}.ivu-switch-large:active:after{width:30px}.ivu-switch-large.ivu-switch-checked:after{left:35px}.ivu-switch-large.ivu-switch-checked:before{left:37px}.ivu-switch-large:active.ivu-switch-checked:after{left:23px}.ivu-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-switch-checked .ivu-switch-inner{left:7px}.ivu-switch-checked:after{left:23px}.ivu-switch-checked:before{left:25px}.ivu-switch-checked:active:after{left:15px}.ivu-switch-disabled{cursor:not-allowed;opacity:.4}.ivu-switch-disabled:after{background:#fff;cursor:not-allowed}.ivu-switch-disabled .ivu-switch-inner{color:#fff}.ivu-switch-disabled.ivu-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0;opacity:.4}.ivu-switch-disabled.ivu-switch-checked:after{background:#fff}.ivu-switch-disabled.ivu-switch-checked .ivu-switch-inner{color:#fff}@-webkit-keyframes switch-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes switch-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ivu-input-number{display:inline-block;width:100%;line-height:1.5;padding:4px 7px;font-size:14px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;margin:0;padding:0;width:80px;height:32px;line-height:32px;vertical-align:middle;border:1px solid #dcdee2;border-radius:4px;overflow:hidden;cursor:default}.ivu-input-number::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-input-number:-ms-input-placeholder{color:#c5c8ce}.ivu-input-number::-webkit-input-placeholder{color:#c5c8ce}.ivu-input-number:hover{border-color:#57a3f3}.ivu-input-number:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input-number[disabled],fieldset[disabled] .ivu-input-number{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number[disabled]:hover,fieldset[disabled] .ivu-input-number:hover{border-color:#e3e5e8}textarea.ivu-input-number{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-input-number-large{font-size:16px;padding:6px 7px;height:40px}.ivu-input-number-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-input-number-handler-wrap{width:22px;height:100%;border-left:1px solid #dcdee2;border-radius:0 4px 4px 0;background:#fff;position:absolute;top:0;right:0;opacity:0;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out}.ivu-input-number:hover .ivu-input-number-handler-wrap{opacity:1}.ivu-input-number-handler-up{cursor:pointer}.ivu-input-number-handler-up-inner{top:1px}.ivu-input-number-handler-down{border-top:1px solid #dcdee2;top:-1px;cursor:pointer}.ivu-input-number-handler{display:block;width:100%;height:16px;line-height:0;text-align:center;overflow:hidden;color:#999;position:relative}.ivu-input-number-handler:hover .ivu-input-number-handler-down-inner,.ivu-input-number-handler:hover .ivu-input-number-handler-up-inner{color:#57a3f3}.ivu-input-number-handler-down-inner,.ivu-input-number-handler-up-inner{width:12px;height:12px;line-height:12px;font-size:14px;color:#999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;right:5px;-webkit-transition:all .2s linear;transition:all .2s linear}.ivu-input-number:hover{border-color:#57a3f3}.ivu-input-number-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input-number-disabled{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number-disabled:hover{border-color:#e3e5e8}.ivu-input-number-input-wrap{overflow:hidden;height:32px}.ivu-input-number-input{width:100%;height:32px;line-height:32px;padding:0 7px;text-align:left;outline:0;-moz-appearance:textfield;color:#666;border:0;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.ivu-input-number-input[disabled]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number-input[disabled]:hover{border-color:#e3e5e8}.ivu-input-number-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-input-number-input::-moz-placeholder{color:#c5c8ce}.ivu-input-number-input::-ms-input-placeholder{color:#c5c8ce}.ivu-input-number-input::placeholder{color:#c5c8ce}.ivu-input-number-large{padding:0}.ivu-input-number-large .ivu-input-number-input-wrap{height:40px}.ivu-input-number-large .ivu-input-number-handler{height:20px}.ivu-input-number-large input{height:40px;line-height:40px}.ivu-input-number-large .ivu-input-number-handler-up-inner{top:2px}.ivu-input-number-large .ivu-input-number-handler-down-inner{bottom:2px}.ivu-input-number-small{padding:0}.ivu-input-number-small .ivu-input-number-input-wrap{height:24px}.ivu-input-number-small .ivu-input-number-handler{height:12px}.ivu-input-number-small input{height:24px;line-height:24px;margin-top:-1px;vertical-align:top}.ivu-input-number-small .ivu-input-number-handler-up-inner{top:-1px}.ivu-input-number-small .ivu-input-number-handler-down-inner{bottom:-1px}.ivu-input-number-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-disabled .ivu-input-number-handler-up-inner,.ivu-input-number-handler-down-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-handler-down-disabled .ivu-input-number-handler-up-inner,.ivu-input-number-handler-up-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-handler-up-disabled .ivu-input-number-handler-up-inner{opacity:.72;color:#ccc!important;cursor:not-allowed}.ivu-input-number-disabled .ivu-input-number-input{opacity:.72;cursor:not-allowed;background-color:#f3f3f3}.ivu-input-number-disabled .ivu-input-number-handler-wrap{display:none}.ivu-input-number-disabled .ivu-input-number-handler{opacity:.72;color:#ccc!important;cursor:not-allowed}.ivu-form-item-error .ivu-input-number{border:1px solid #ed4014}.ivu-form-item-error .ivu-input-number:hover{border-color:#ed4014}.ivu-form-item-error .ivu-input-number:focus{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-form-item-error .ivu-input-number-focused{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-scroll-wrapper{width:auto;margin:0 auto;position:relative;outline:0}.ivu-scroll-container{overflow-y:scroll}.ivu-scroll-content{opacity:1;-webkit-transition:opacity .5s;transition:opacity .5s}.ivu-scroll-content-loading{opacity:.5}.ivu-scroll-loader{text-align:center;padding:0;-webkit-transition:padding .5s;transition:padding .5s}.ivu-scroll-loader-wrapper{padding:5px 0;height:0;background-color:inherit;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:opacity .3s,height .5s,-webkit-transform .5s;transition:opacity .3s,height .5s,-webkit-transform .5s;transition:opacity .3s,transform .5s,height .5s;transition:opacity .3s,transform .5s,height .5s,-webkit-transform .5s}.ivu-scroll-loader-wrapper-active{height:40px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}@-webkit-keyframes ani-demo-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes ani-demo-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ivu-scroll-loader-wrapper .ivu-scroll-spinner{position:relative}.ivu-scroll-loader-wrapper .ivu-scroll-spinner-icon{-webkit-animation:ani-demo-spin 1s linear infinite;animation:ani-demo-spin 1s linear infinite}.ivu-tag{display:inline-block;height:22px;line-height:22px;margin:2px 4px 2px 0;padding:0 8px;border:1px solid #e8eaec;border-radius:3px;background:#f7f7f7;font-size:12px;vertical-align:middle;opacity:1;overflow:hidden}.ivu-tag-size-large{height:32px;line-height:32px;padding:0 12px}.ivu-tag-size-medium{height:28px;line-height:28px;padding:0 10px}.ivu-tag:not(.ivu-tag-border):not(.ivu-tag-dot):not(.ivu-tag-checked){background:0 0;border:0;color:#515a6e}.ivu-tag:not(.ivu-tag-border):not(.ivu-tag-dot):not(.ivu-tag-checked) .ivu-icon-ios-close{color:#515a6e!important}.ivu-tag-color-error{color:#ed4014!important;border-color:#ed4014}.ivu-tag-color-success{color:#19be6b!important;border-color:#19be6b}.ivu-tag-color-primary{color:#2d8cf0!important;border-color:#2d8cf0}.ivu-tag-color-warning{color:#f90!important;border-color:#f90}.ivu-tag-color-white{color:#fff!important}.ivu-tag-dot{height:32px;line-height:32px;border:1px solid #e8eaec!important;color:#515a6e!important;background:#fff!important;padding:0 12px}.ivu-tag-dot-inner{display:inline-block;width:12px;height:12px;margin-right:8px;border-radius:50%;background:#e8eaec;position:relative;top:1px}.ivu-tag-dot .ivu-icon-ios-close{color:#666!important;margin-left:12px!important}.ivu-tag-border{height:24px;line-height:24px;border:1px solid #e8eaec;color:#e8eaec;background:#fff!important;position:relative}.ivu-tag-border .ivu-icon-ios-close{color:#666;margin-left:12px!important}.ivu-tag-border:after{content:\"\";display:none;width:1px;background:currentColor;position:absolute;top:0;bottom:0;right:22px}.ivu-tag-border.ivu-tag-closable:after{display:block}.ivu-tag-border.ivu-tag-closable .ivu-icon-ios-close{margin-left:18px!important;left:4px;top:-1px}.ivu-tag-border.ivu-tag-primary{color:#2d8cf0!important;border:1px solid #2d8cf0!important}.ivu-tag-border.ivu-tag-primary:after{background:#2d8cf0}.ivu-tag-border.ivu-tag-primary .ivu-icon-ios-close{color:#2d8cf0!important}.ivu-tag-border.ivu-tag-success{color:#19be6b!important;border:1px solid #19be6b!important}.ivu-tag-border.ivu-tag-success:after{background:#19be6b}.ivu-tag-border.ivu-tag-success .ivu-icon-ios-close{color:#19be6b!important}.ivu-tag-border.ivu-tag-warning{color:#f90!important;border:1px solid #f90!important}.ivu-tag-border.ivu-tag-warning:after{background:#f90}.ivu-tag-border.ivu-tag-warning .ivu-icon-ios-close{color:#f90!important}.ivu-tag-border.ivu-tag-error{color:#ed4014!important;border:1px solid #ed4014!important}.ivu-tag-border.ivu-tag-error:after{background:#ed4014}.ivu-tag-border.ivu-tag-error .ivu-icon-ios-close{color:#ed4014!important}.ivu-tag:hover{opacity:.85}.ivu-tag-text{color:#515a6e}.ivu-tag-text a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ivu-tag .ivu-icon-ios-close{display:inline-block;font-size:14px;-webkit-transform:scale(1.42857143) rotate(0);-ms-transform:scale(1.42857143) rotate(0);transform:scale(1.42857143) rotate(0);cursor:pointer;margin-left:2px;color:#666;opacity:.66;position:relative;top:-1px}:root .ivu-tag .ivu-icon-ios-close{font-size:14px}.ivu-tag .ivu-icon-ios-close:hover{opacity:1}.ivu-tag-error,.ivu-tag-primary,.ivu-tag-success,.ivu-tag-warning{border:0}.ivu-tag-error,.ivu-tag-error .ivu-icon-ios-close,.ivu-tag-error .ivu-icon-ios-close:hover,.ivu-tag-error a,.ivu-tag-error a:hover,.ivu-tag-primary,.ivu-tag-primary .ivu-icon-ios-close,.ivu-tag-primary .ivu-icon-ios-close:hover,.ivu-tag-primary a,.ivu-tag-primary a:hover,.ivu-tag-success,.ivu-tag-success .ivu-icon-ios-close,.ivu-tag-success .ivu-icon-ios-close:hover,.ivu-tag-success a,.ivu-tag-success a:hover,.ivu-tag-warning,.ivu-tag-warning .ivu-icon-ios-close,.ivu-tag-warning .ivu-icon-ios-close:hover,.ivu-tag-warning a,.ivu-tag-warning a:hover{color:#fff}.ivu-tag-primary,.ivu-tag-primary.ivu-tag-dot .ivu-tag-dot-inner{background:#2d8cf0}.ivu-tag-success,.ivu-tag-success.ivu-tag-dot .ivu-tag-dot-inner{background:#19be6b}.ivu-tag-warning,.ivu-tag-warning.ivu-tag-dot .ivu-tag-dot-inner{background:#f90}.ivu-tag-error,.ivu-tag-error.ivu-tag-dot .ivu-tag-dot-inner{background:#ed4014}.ivu-tag-pink{line-height:20px;background:#fff0f6;border-color:#ffadd2}.ivu-tag-pink .ivu-tag-text{color:#eb2f96!important}.ivu-tag-pink.ivu-tag-dot{line-height:32px}.ivu-tag-magenta{line-height:20px;background:#fff0f6;border-color:#ffadd2}.ivu-tag-magenta .ivu-tag-text{color:#eb2f96!important}.ivu-tag-magenta.ivu-tag-dot{line-height:32px}.ivu-tag-red{line-height:20px;background:#fff1f0;border-color:#ffa39e}.ivu-tag-red .ivu-tag-text{color:#f5222d!important}.ivu-tag-red.ivu-tag-dot{line-height:32px}.ivu-tag-volcano{line-height:20px;background:#fff2e8;border-color:#ffbb96}.ivu-tag-volcano .ivu-tag-text{color:#fa541c!important}.ivu-tag-volcano.ivu-tag-dot{line-height:32px}.ivu-tag-orange{line-height:20px;background:#fff7e6;border-color:#ffd591}.ivu-tag-orange .ivu-tag-text{color:#fa8c16!important}.ivu-tag-orange.ivu-tag-dot{line-height:32px}.ivu-tag-yellow{line-height:20px;background:#feffe6;border-color:#fffb8f}.ivu-tag-yellow .ivu-tag-text{color:#fadb14!important}.ivu-tag-yellow.ivu-tag-dot{line-height:32px}.ivu-tag-gold{line-height:20px;background:#fffbe6;border-color:#ffe58f}.ivu-tag-gold .ivu-tag-text{color:#faad14!important}.ivu-tag-gold.ivu-tag-dot{line-height:32px}.ivu-tag-cyan{line-height:20px;background:#e6fffb;border-color:#87e8de}.ivu-tag-cyan .ivu-tag-text{color:#13c2c2!important}.ivu-tag-cyan.ivu-tag-dot{line-height:32px}.ivu-tag-lime{line-height:20px;background:#fcffe6;border-color:#eaff8f}.ivu-tag-lime .ivu-tag-text{color:#a0d911!important}.ivu-tag-lime.ivu-tag-dot{line-height:32px}.ivu-tag-green{line-height:20px;background:#f6ffed;border-color:#b7eb8f}.ivu-tag-green .ivu-tag-text{color:#52c41a!important}.ivu-tag-green.ivu-tag-dot{line-height:32px}.ivu-tag-blue{line-height:20px;background:#e6f7ff;border-color:#91d5ff}.ivu-tag-blue .ivu-tag-text{color:#1890ff!important}.ivu-tag-blue.ivu-tag-dot{line-height:32px}.ivu-tag-geekblue{line-height:20px;background:#f0f5ff;border-color:#adc6ff}.ivu-tag-geekblue .ivu-tag-text{color:#2f54eb!important}.ivu-tag-geekblue.ivu-tag-dot{line-height:32px}.ivu-tag-purple{line-height:20px;background:#f9f0ff;border-color:#d3adf7}.ivu-tag-purple .ivu-tag-text{color:#722ed1!important}.ivu-tag-purple.ivu-tag-dot{line-height:32px}.ivu-layout{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex:auto;flex:auto;background:#f5f7f9}.ivu-layout.ivu-layout-has-sider{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.ivu-layout.ivu-layout-has-sider>.ivu-layout,.ivu-layout.ivu-layout-has-sider>.ivu-layout-content{overflow-x:hidden}.ivu-layout-footer,.ivu-layout-header{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-layout-header{background:#515a6e;padding:0 50px;height:64px;line-height:64px}.ivu-layout-sider{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;background:#515a6e;min-width:0}.ivu-layout-sider-children{height:100%;padding-top:.1px;margin-top:-.1px}.ivu-layout-sider-has-trigger{padding-bottom:48px}.ivu-layout-sider-trigger{position:fixed;bottom:0;text-align:center;cursor:pointer;height:48px;line-height:48px;color:#fff;background:#515a6e;z-index:1000;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-layout-sider-trigger .ivu-icon{font-size:16px}.ivu-layout-sider-trigger>*{-webkit-transition:all .2s;transition:all .2s}.ivu-layout-sider-trigger-collapsed .ivu-layout-sider-trigger-icon{-webkit-transform:rotateZ(180deg);-ms-transform:rotate(180deg);transform:rotateZ(180deg)}.ivu-layout-sider-zero-width>*{overflow:hidden}.ivu-layout-sider-zero-width-trigger{position:absolute;top:64px;right:-36px;text-align:center;width:36px;height:42px;line-height:42px;background:#515a6e;color:#fff;font-size:18px;border-radius:0 6px 6px 0;cursor:pointer;-webkit-transition:background .3s ease;transition:background .3s ease}.ivu-layout-sider-zero-width-trigger:hover{background:#626b7d}.ivu-layout-sider-zero-width-trigger.ivu-layout-sider-zero-width-trigger-left{right:0;left:-36px;border-radius:6px 0 0 6px}.ivu-layout-footer{background:#f5f7f9;padding:24px 50px;color:#515a6e;font-size:14px}.ivu-layout-content{-webkit-box-flex:1;-ms-flex:auto;flex:auto}.ivu-loading-bar{width:100%;position:fixed;top:0;left:0;right:0;z-index:2000}.ivu-loading-bar-inner{-webkit-transition:width .2s linear;transition:width .2s linear}.ivu-loading-bar-inner-color-primary{background-color:#2d8cf0}.ivu-loading-bar-inner-failed-color-error{background-color:#ed4014}.ivu-progress{display:inline-block;width:100%;font-size:12px;position:relative}.ivu-progress-vertical{height:100%;width:auto}.ivu-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0}.ivu-progress-show-info .ivu-progress-outer{padding-right:55px;margin-right:-55px}.ivu-progress-vertical .ivu-progress-outer{height:100%;width:auto}.ivu-progress-inner{display:inline-block;width:100%;background-color:#f3f3f3;border-radius:100px;vertical-align:middle;position:relative}.ivu-progress-inner-text{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 6px}.ivu-progress-vertical .ivu-progress-inner{height:100%;width:auto}.ivu-progress-vertical .ivu-progress-inner:after,.ivu-progress-vertical .ivu-progress-inner>*{display:inline-block;vertical-align:bottom}.ivu-progress-vertical .ivu-progress-inner:after{content:'';height:100%}.ivu-progress-bg{text-align:right;border-radius:100px;background-color:#2d8cf0;-webkit-transition:all .2s linear;transition:all .2s linear;position:relative}.ivu-progress-bg:after{content:'';display:inline-block;height:100%;vertical-align:middle}.ivu-progress-success-bg{border-radius:100px;background-color:#19be6b;-webkit-transition:all .2s linear;transition:all .2s linear;position:absolute;top:0;left:0}.ivu-progress-text{display:inline-block;margin-left:5px;text-align:left;font-size:1em;vertical-align:middle;color:#808695}.ivu-progress-active .ivu-progress-bg:before{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border-radius:10px;-webkit-animation:ivu-progress-active 2s ease-in-out infinite;animation:ivu-progress-active 2s ease-in-out infinite}.ivu-progress-vertical.ivu-progress-active .ivu-progress-bg:before{top:auto;-webkit-animation:ivu-progress-active-vertical 2s ease-in-out infinite;animation:ivu-progress-active-vertical 2s ease-in-out infinite}.ivu-progress-wrong .ivu-progress-bg{background-color:#ed4014}.ivu-progress-wrong .ivu-progress-text{color:#ed4014}.ivu-progress-success .ivu-progress-bg{background-color:#19be6b}.ivu-progress-success .ivu-progress-text{color:#19be6b}@-webkit-keyframes ivu-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@keyframes ivu-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@-webkit-keyframes ivu-progress-active-vertical{0%{opacity:.3;height:0}100%{opacity:0;height:100%}}@keyframes ivu-progress-active-vertical{0%{opacity:.3;height:0}100%{opacity:0;height:100%}}.ivu-timeline{list-style:none;margin:0;padding:0}.ivu-timeline-item{margin:0!important;padding:0 0 12px 0;list-style:none;position:relative}.ivu-timeline-item-tail{height:100%;border-left:1px solid #e8eaec;position:absolute;left:6px;top:0}.ivu-timeline-item-pending .ivu-timeline-item-tail{display:none}.ivu-timeline-item-head{width:13px;height:13px;background-color:#fff;border-radius:50%;border:1px solid transparent;position:absolute}.ivu-timeline-item-head-blue{border-color:#2d8cf0;color:#2d8cf0}.ivu-timeline-item-head-red{border-color:#ed4014;color:#ed4014}.ivu-timeline-item-head-green{border-color:#19be6b;color:#19be6b}.ivu-timeline-item-head-custom{width:40px;height:auto;margin-top:6px;padding:3px 0;text-align:center;line-height:1;border:0;border-radius:0;font-size:14px;position:absolute;left:-13px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-timeline-item-content{padding:1px 1px 10px 24px;font-size:14px;position:relative;top:-3px}.ivu-timeline-item:last-child .ivu-timeline-item-tail{display:none}.ivu-timeline.ivu-timeline-pending .ivu-timeline-item:nth-last-of-type(2) .ivu-timeline-item-tail{border-left:1px dotted #e8eaec}.ivu-timeline.ivu-timeline-pending .ivu-timeline-item:nth-last-of-type(2) .ivu-timeline-item-content{min-height:48px}.ivu-page:after{content:'';display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.ivu-page-item{display:inline-block;vertical-align:middle;min-width:32px;height:32px;line-height:30px;margin-right:4px;text-align:center;list-style:none;background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;font-family:Arial;font-weight:500;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:border .2s ease-in-out,color .2s ease-in-out;transition:border .2s ease-in-out,color .2s ease-in-out}.ivu-page-item a{margin:0 6px;text-decoration:none;color:#515a6e}.ivu-page-item:hover{border-color:#2d8cf0}.ivu-page-item:hover a{color:#2d8cf0}.ivu-page-item-active{border-color:#2d8cf0}.ivu-page-item-active a,.ivu-page-item-active:hover a{color:#2d8cf0}.ivu-page-with-disabled .ivu-page-disabled,.ivu-page-with-disabled .ivu-page-item{cursor:not-allowed;background-color:#f3f3f3}.ivu-page-with-disabled .ivu-page-disabled a,.ivu-page-with-disabled .ivu-page-item a{color:#ccc}.ivu-page-with-disabled .ivu-page-disabled:hover,.ivu-page-with-disabled .ivu-page-item:hover{border-color:#dcdee2}.ivu-page-with-disabled .ivu-page-disabled:hover a,.ivu-page-with-disabled .ivu-page-item:hover a{color:#ccc;cursor:not-allowed}.ivu-page-with-disabled .ivu-page-disabled-active,.ivu-page-with-disabled .ivu-page-item-active{background-color:#dcdee2;border-color:#dcdee2}.ivu-page-with-disabled .ivu-page-disabled-active a,.ivu-page-with-disabled .ivu-page-disabled-active:hover a,.ivu-page-with-disabled .ivu-page-item-active a,.ivu-page-with-disabled .ivu-page-item-active:hover a{color:#fff}.ivu-page-item-jump-next:after,.ivu-page-item-jump-prev:after{content:\"•••\";display:block;letter-spacing:1px;color:#ccc;text-align:center}.ivu-page-item-jump-next i,.ivu-page-item-jump-prev i{display:none}.ivu-page-item-jump-next:hover:after,.ivu-page-item-jump-prev:hover:after{display:none}.ivu-page-item-jump-next:hover i,.ivu-page-item-jump-prev:hover i{display:inline}.ivu-page-with-disabled .ivu-page-item-jump-next,.ivu-page-with-disabled .ivu-page-item-jump-prev{cursor:not-allowed}.ivu-page-with-disabled .ivu-page-item-jump-next:hover:after,.ivu-page-with-disabled .ivu-page-item-jump-prev:hover:after{display:block}.ivu-page-with-disabled .ivu-page-item-jump-next:hover i,.ivu-page-with-disabled .ivu-page-item-jump-prev:hover i{display:none}.ivu-page-item-jump-prev:hover i:after{content:\"\\F115\";margin-left:-8px}.ivu-page-item-jump-next:hover i:after{content:\"\\F11F\";margin-left:-8px}.ivu-page-prev{margin-right:4px}.ivu-page-item-jump-next,.ivu-page-item-jump-prev{margin-right:4px}.ivu-page-item-jump-next,.ivu-page-item-jump-prev,.ivu-page-next,.ivu-page-prev{display:inline-block;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-width:32px;height:32px;line-height:30px;list-style:none;text-align:center;cursor:pointer;color:#666;font-family:Arial;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-page-item-jump-next,.ivu-page-item-jump-prev{border-color:transparent}.ivu-page-next,.ivu-page-prev{background-color:#fff}.ivu-page-next a,.ivu-page-prev a{color:#666;font-size:14px}.ivu-page-next:hover,.ivu-page-prev:hover{border-color:#2d8cf0}.ivu-page-next:hover a,.ivu-page-prev:hover a{color:#2d8cf0}.ivu-page-disabled{cursor:not-allowed}.ivu-page-disabled a{color:#ccc}.ivu-page-disabled:hover{border-color:#dcdee2}.ivu-page-disabled:hover a{color:#ccc;cursor:not-allowed}.ivu-page-options{display:inline-block;vertical-align:middle;margin-left:15px}.ivu-page-options-sizer{display:inline-block;margin-right:10px}.ivu-page-options-elevator{display:inline-block;vertical-align:middle;height:32px;line-height:32px}.ivu-page-options-elevator input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;border-radius:4px;margin:0 8px;width:50px}.ivu-page-options-elevator input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-page-options-elevator input:-ms-input-placeholder{color:#c5c8ce}.ivu-page-options-elevator input::-webkit-input-placeholder{color:#c5c8ce}.ivu-page-options-elevator input:hover{border-color:#57a3f3}.ivu-page-options-elevator input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-page-options-elevator input[disabled],fieldset[disabled] .ivu-page-options-elevator input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-page-options-elevator input[disabled]:hover,fieldset[disabled] .ivu-page-options-elevator input:hover{border-color:#e3e5e8}textarea.ivu-page-options-elevator input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-page-options-elevator input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-page-options-elevator input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-page-total{display:inline-block;height:32px;line-height:32px;margin-right:10px}.ivu-page-simple .ivu-page-next,.ivu-page-simple .ivu-page-prev{margin:0;border:0;height:24px;line-height:normal;font-size:18px}.ivu-page-simple .ivu-page-simple-pager{display:inline-block;margin-right:8px;vertical-align:middle}.ivu-page-simple .ivu-page-simple-pager input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;color:#515a6e;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;width:30px;height:24px;margin:0 8px;padding:5px 8px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff;outline:0;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:border-color .2s ease-in-out;transition:border-color .2s ease-in-out}.ivu-page-simple .ivu-page-simple-pager input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-page-simple .ivu-page-simple-pager input:-ms-input-placeholder{color:#c5c8ce}.ivu-page-simple .ivu-page-simple-pager input::-webkit-input-placeholder{color:#c5c8ce}.ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#57a3f3}.ivu-page-simple .ivu-page-simple-pager input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-page-simple .ivu-page-simple-pager input[disabled],fieldset[disabled] .ivu-page-simple .ivu-page-simple-pager input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-page-simple .ivu-page-simple-pager input[disabled]:hover,fieldset[disabled] .ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#e3e5e8}textarea.ivu-page-simple .ivu-page-simple-pager input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-page-simple .ivu-page-simple-pager input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-page-simple .ivu-page-simple-pager input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#2d8cf0}.ivu-page-simple .ivu-page-simple-pager span{padding:0 8px 0 2px}.ivu-page-custom-text,.ivu-page-custom-text:hover{border-color:transparent}.ivu-page.mini .ivu-page-total{height:24px;line-height:24px}.ivu-page.mini .ivu-page-item{border:0;margin:0;min-width:24px;height:24px;line-height:24px;border-radius:3px}.ivu-page.mini .ivu-page-next,.ivu-page.mini .ivu-page-prev{margin:0;min-width:24px;height:24px;line-height:22px;border:0}.ivu-page.mini .ivu-page-next a i:after,.ivu-page.mini .ivu-page-prev a i:after{height:24px;line-height:24px}.ivu-page.mini .ivu-page-item-jump-next,.ivu-page.mini .ivu-page-item-jump-prev{height:24px;line-height:24px;border:none;margin-right:0}.ivu-page.mini .ivu-page-options{margin-left:8px}.ivu-page.mini .ivu-page-options-elevator{height:24px;line-height:24px}.ivu-page.mini .ivu-page-options-elevator input{padding:1px 7px;height:24px;border-radius:3px;width:44px}.ivu-steps{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;font-size:0;line-height:1.5}.ivu-steps-item{display:inline-block;position:relative;vertical-align:top;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.ivu-steps-item:last-child{-webkit-box-flex:0;-ms-flex:0;flex:none}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner{background-color:#fff}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner>.ivu-steps-icon{color:#ccc}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-title{color:#999}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-content{color:#999}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner>.ivu-steps-icon{color:#fff}.ivu-steps-item.ivu-steps-status-process .ivu-steps-title{color:#666}.ivu-steps-item.ivu-steps-status-process .ivu-steps-content{color:#666}.ivu-steps-item.ivu-steps-status-process .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner{background-color:#fff;border-color:#2d8cf0}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner>.ivu-steps-icon{color:#2d8cf0}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-tail>i:after{width:100%;background:#2d8cf0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;opacity:1}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-title{color:#999}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-content{color:#999}.ivu-steps-item.ivu-steps-status-error .ivu-steps-head-inner{background-color:#fff;border-color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-head-inner>.ivu-steps-icon{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-title{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-content{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-next-error .ivu-steps-tail>i,.ivu-steps-item.ivu-steps-next-error .ivu-steps-tail>i:after{background-color:#ed4014}.ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner{background:0 0;border:0;width:auto;height:auto}.ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner>.ivu-steps-icon{font-size:20px;top:2px;width:20px;height:20px}.ivu-steps-item.ivu-steps-custom.ivu-steps-status-process .ivu-steps-head-inner>.ivu-steps-icon{color:#2d8cf0}.ivu-steps-item:last-child .ivu-steps-tail{display:none}.ivu-steps .ivu-steps-head,.ivu-steps .ivu-steps-main{position:relative;display:inline-block;vertical-align:top}.ivu-steps .ivu-steps-head{background:#fff}.ivu-steps .ivu-steps-head-inner{display:block;width:26px;height:26px;line-height:24px;margin-right:8px;text-align:center;border:1px solid #ccc;border-radius:50%;font-size:14px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon{line-height:1;position:relative}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon{font-size:24px}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon-ios-checkmark-empty,.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon-ios-close-empty{font-weight:700}.ivu-steps .ivu-steps-main{margin-top:2.5px;display:inline}.ivu-steps .ivu-steps-custom .ivu-steps-title{margin-top:2.5px}.ivu-steps .ivu-steps-title{display:inline-block;margin-bottom:4px;padding-right:10px;font-size:14px;font-weight:700;color:#666;background:#fff}.ivu-steps .ivu-steps-title>a:first-child:last-child{color:#666}.ivu-steps .ivu-steps-item-last .ivu-steps-title{padding-right:0;width:100%}.ivu-steps .ivu-steps-content{font-size:12px;color:#999}.ivu-steps .ivu-steps-tail{width:100%;padding:0 10px;position:absolute;left:0;top:13px}.ivu-steps .ivu-steps-tail>i{display:inline-block;width:100%;height:1px;vertical-align:top;background:#e8eaec;border-radius:1px;position:relative}.ivu-steps .ivu-steps-tail>i:after{content:'';width:0;height:100%;background:#e8eaec;opacity:0;position:absolute;top:0}.ivu-steps.ivu-steps-small .ivu-steps-head-inner{width:18px;height:18px;line-height:16px;margin-right:10px;text-align:center;border-radius:50%;font-size:12px}.ivu-steps.ivu-steps-small .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon{font-size:16px;top:0}.ivu-steps.ivu-steps-small .ivu-steps-main{margin-top:0}.ivu-steps.ivu-steps-small .ivu-steps-title{margin-bottom:4px;margin-top:0;color:#666;font-size:12px;font-weight:700}.ivu-steps.ivu-steps-small .ivu-steps-content{font-size:12px;color:#999;padding-left:30px}.ivu-steps.ivu-steps-small .ivu-steps-tail{top:8px;padding:0 8px}.ivu-steps.ivu-steps-small .ivu-steps-tail>i{height:1px;width:100%;border-radius:1px}.ivu-steps .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner,.ivu-steps.ivu-steps-small .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner{width:inherit;height:inherit;line-height:inherit;border-radius:0;border:0;background:0 0}.ivu-steps-vertical{display:block}.ivu-steps-vertical .ivu-steps-item{display:block;overflow:visible}.ivu-steps-vertical .ivu-steps-tail{position:absolute;left:13px;top:0;height:100%;width:1px;padding:30px 0 4px 0}.ivu-steps-vertical .ivu-steps-tail>i{height:100%;width:1px}.ivu-steps-vertical .ivu-steps-tail>i:after{height:0;width:100%}.ivu-steps-vertical .ivu-steps-status-finish .ivu-steps-tail>i:after{height:100%}.ivu-steps-vertical .ivu-steps-head{float:left}.ivu-steps-vertical .ivu-steps-head-inner{margin-right:16px}.ivu-steps-vertical .ivu-steps-main{min-height:47px;overflow:hidden;display:block}.ivu-steps-vertical .ivu-steps-main .ivu-steps-title{line-height:26px}.ivu-steps-vertical .ivu-steps-main .ivu-steps-content{padding-bottom:12px;padding-left:0}.ivu-steps-vertical .ivu-steps-custom .ivu-steps-icon{left:4px}.ivu-steps-vertical.ivu-steps-small .ivu-steps-custom .ivu-steps-icon{left:0}.ivu-steps-vertical.ivu-steps-small .ivu-steps-tail{position:absolute;left:9px;top:0;padding:22px 0 4px 0}.ivu-steps-vertical.ivu-steps-small .ivu-steps-tail>i{height:100%}.ivu-steps-vertical.ivu-steps-small .ivu-steps-title{line-height:18px}.ivu-steps-horizontal.ivu-steps-hidden{visibility:hidden}.ivu-steps-horizontal .ivu-steps-content{padding-left:35px}.ivu-steps-horizontal .ivu-steps-item:not(:first-child) .ivu-steps-head{padding-left:10px;margin-left:-10px}.ivu-modal{width:auto;margin:0 auto;position:relative;outline:0;top:100px}.ivu-modal-hidden{display:none!important}.ivu-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1000;-webkit-overflow-scrolling:touch;outline:0}.ivu-modal-wrap *{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.ivu-modal-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1000}.ivu-modal-mask-hidden{display:none}.ivu-modal-content{position:relative;background-color:#fff;border:0;border-radius:6px;background-clip:padding-box;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}.ivu-modal-content-no-mask{pointer-events:auto}.ivu-modal-content-drag{position:absolute}.ivu-modal-content-drag .ivu-modal-header{cursor:move}.ivu-modal-content-dragging{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-modal-header{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-modal-header p,.ivu-modal-header-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-modal-close{z-index:1;font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-modal-close .ivu-icon-ios-close{font-size:31px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:1px}.ivu-modal-close .ivu-icon-ios-close:hover{color:#444}.ivu-modal-body{padding:16px;font-size:14px;line-height:1.5}.ivu-modal-footer{border-top:1px solid #e8eaec;padding:12px 18px 12px 18px;text-align:right}.ivu-modal-footer button+button{margin-left:8px;margin-bottom:0}.ivu-modal-fullscreen{width:100%!important;top:0;bottom:0;position:absolute}.ivu-modal-fullscreen .ivu-modal-content{width:100%;border-radius:0;position:absolute;top:0;bottom:0}.ivu-modal-fullscreen .ivu-modal-body{width:100%;overflow:auto;position:absolute;top:51px;bottom:61px}.ivu-modal-fullscreen-no-header .ivu-modal-body{top:0}.ivu-modal-fullscreen-no-footer .ivu-modal-body{bottom:0}.ivu-modal-fullscreen .ivu-modal-footer{position:absolute;width:100%;bottom:0}.ivu-modal-no-mask{pointer-events:none}@media (max-width:576px){.ivu-modal{width:auto!important;margin:10px}.ivu-modal-fullscreen{width:100%!important;margin:0}.vertical-center-modal .ivu-modal{-webkit-box-flex:1;-ms-flex:1;flex:1}}.ivu-modal-confirm{padding:6px 16px 8px}.ivu-modal-confirm-head{padding:0 12px 0 0}.ivu-modal-confirm-head-icon{display:inline-block;font-size:28px;vertical-align:middle;position:relative;top:-2px}.ivu-modal-confirm-head-icon-info{color:#2d8cf0}.ivu-modal-confirm-head-icon-success{color:#19be6b}.ivu-modal-confirm-head-icon-warning{color:#f90}.ivu-modal-confirm-head-icon-error{color:#ed4014}.ivu-modal-confirm-head-icon-confirm{color:#f90}.ivu-modal-confirm-head-title{display:inline-block;vertical-align:middle;margin-left:12px;font-size:16px;color:#17233d;font-weight:500}.ivu-modal-confirm-body{padding-left:40px;font-size:14px;color:#515a6e;position:relative}.ivu-modal-confirm-body-render{margin:0;padding:0}.ivu-modal-confirm-footer{margin-top:20px;text-align:right}.ivu-modal-confirm-footer button+button{margin-left:8px;margin-bottom:0}.ivu-select{display:inline-block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle;color:#515a6e;font-size:14px;line-height:normal}.ivu-select-selection{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative;background-color:#fff;border-radius:4px;border:1px solid #dcdee2;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-select-selection-focused,.ivu-select-selection:hover{border-color:#57a3f3}.ivu-select-selection-focused .ivu-select-arrow,.ivu-select-selection:hover .ivu-select-arrow{display:inline-block}.ivu-select-arrow{position:absolute;top:50%;right:8px;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);font-size:14px;color:#808695;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-select-visible .ivu-select-selection{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-select-visible .ivu-select-arrow{-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg);display:inline-block}.ivu-select-disabled .ivu-select-selection{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-select-disabled .ivu-select-selection:hover{border-color:#e3e5e8}.ivu-select-disabled .ivu-select-selection .ivu-select-arrow{color:#ccc}.ivu-select-disabled .ivu-select-selection:hover{border-color:#dcdee2;-webkit-box-shadow:none;box-shadow:none}.ivu-select-disabled .ivu-select-selection:hover .ivu-select-arrow{display:inline-block}.ivu-select-single .ivu-select-selection{height:32px;position:relative}.ivu-select-single .ivu-select-selection .ivu-select-placeholder{color:#c5c8ce}.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-single .ivu-select-selection .ivu-select-selected-value{display:block;height:30px;line-height:30px;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:8px;padding-right:24px}.ivu-select-multiple .ivu-select-selection{padding:0 24px 0 4px}.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder{display:block;height:30px;line-height:30px;color:#c5c8ce;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:4px;padding-right:22px}.ivu-select-default.ivu-select-multiple .ivu-select-selection{min-height:32px}.ivu-select-large.ivu-select-single .ivu-select-selection{height:40px}.ivu-select-large.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-large.ivu-select-single .ivu-select-selection .ivu-select-selected-value{height:38px;line-height:38px;font-size:16px}.ivu-select-large.ivu-select-multiple .ivu-select-selection{min-height:40px}.ivu-select-large.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,.ivu-select-large.ivu-select-multiple .ivu-select-selection .ivu-select-selected-value{min-height:38px;line-height:38px;font-size:16px}.ivu-select-small.ivu-select-single .ivu-select-selection{height:24px;border-radius:3px}.ivu-select-small.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-small.ivu-select-single .ivu-select-selection .ivu-select-selected-value{height:22px;line-height:22px}.ivu-select-small.ivu-select-multiple .ivu-select-selection{min-height:24px;border-radius:3px}.ivu-select-small.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,.ivu-select-small.ivu-select-multiple .ivu-select-selection .ivu-select-selected-value{height:auto;min-height:22px;line-height:22px}.ivu-select-input{display:inline-block;height:32px;line-height:32px;padding:0 24px 0 8px;font-size:14px;outline:0;border:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:#515a6e;background-color:transparent;position:relative;cursor:pointer}.ivu-select-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-select-input:-ms-input-placeholder{color:#c5c8ce}.ivu-select-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-select-input[disabled]{cursor:not-allowed;color:#ccc;-webkit-text-fill-color:#ccc}.ivu-select-single .ivu-select-input{width:100%}.ivu-select-large .ivu-select-input,.ivu-select-large.ivu-select-multiple .ivu-select-input{font-size:16px;height:32px;line-height:32px;top:3px}.ivu-select-small .ivu-select-input,.ivu-select-small.ivu-select-multiple .ivu-select-input{height:18px;line-height:18px;top:2px}.ivu-select-multiple .ivu-select-input{height:26px;line-height:26px;padding:0 0 0 4px;top:2px}.ivu-select-not-found{text-align:center;color:#c5c8ce}.ivu-select-not-found li:not([class^=ivu-]){margin-bottom:0}.ivu-select-loading{text-align:center;color:#c5c8ce}.ivu-select-multiple .ivu-tag{height:24px;line-height:22px;margin:3px 4px 3px 0;max-width:99%;position:relative}.ivu-select-multiple .ivu-tag span:not(.ivu-select-max-tag){display:block;margin-right:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-select-multiple .ivu-tag i{display:block;position:absolute;right:4px;top:4px}.ivu-select-large.ivu-select-multiple .ivu-tag{height:32px;line-height:30px;font-size:16px}.ivu-select-large.ivu-select-multiple .ivu-tag i{top:9px}.ivu-select-small.ivu-select-multiple .ivu-tag{height:17px;line-height:15px;font-size:12px;padding:0 6px;margin:3px 4px 2px 0}.ivu-select-small.ivu-select-multiple .ivu-tag span{margin-right:14px}.ivu-select-small.ivu-select-multiple .ivu-tag i{top:1px;right:2px}.ivu-select-dropdown-list{min-width:100%;list-style:none}.ivu-select .ivu-select-dropdown{width:auto}.ivu-select-prefix{display:inline-block;vertical-align:middle}.ivu-select-prefix i{vertical-align:top}.ivu-select-head-with-prefix{display:inline-block!important;vertical-align:middle}.ivu-select-single .ivu-select-prefix{padding-left:4px}.ivu-select-multiple .ivu-select-head-with-prefix,.ivu-select-single .ivu-select-head-with-prefix{padding-left:0!important}.ivu-select-head-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-select-multiple .ivu-select-head-flex .ivu-select-prefix{margin-right:4px}.ivu-select-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-select-item:hover{background:#f3f3f3}.ivu-select-item-focus{background:#f3f3f3}.ivu-select-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-select-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-select-item-selected,.ivu-select-item-selected:hover{color:#2d8cf0}.ivu-select-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-select-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-select-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-select-large .ivu-select-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-select-item{white-space:normal}}.ivu-select-multiple .ivu-select-item{position:relative}.ivu-select-multiple .ivu-select-item-selected{color:rgba(45,140,240,.9);background:#fff}.ivu-select-multiple .ivu-select-item-focus,.ivu-select-multiple .ivu-select-item-selected:hover{background:#f3f3f3}.ivu-select-multiple .ivu-select-item-selected.ivu-select-multiple .ivu-select-item-focus{color:rgba(40,123,211,.91);background:#fff}.ivu-select-multiple .ivu-select-item-selected:after{display:inline-block;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:optimizeLegibility;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:-.125em;text-align:center;font-size:24px;content:'\\F171';color:rgba(45,140,240,.9);position:absolute;top:2px;right:8px}.ivu-select-group{list-style:none;margin:0;padding:0}.ivu-select-group-title{padding-left:8px;font-size:14px;color:#999;height:30px;line-height:30px}.ivu-form-item-error .ivu-select-selection{border:1px solid #ed4014}.ivu-form-item-error .ivu-select-arrow{color:#ed4014}.ivu-form-item-error .ivu-select-visible .ivu-select-selection{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-select-dropdown{width:inherit;max-height:200px;overflow:auto;margin:5px 0;padding:5px 0;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);position:absolute;z-index:900}.ivu-select-dropdown-transfer{z-index:1060;width:auto}.ivu-select-dropdown.ivu-transfer-no-max-height{max-height:none}.ivu-modal .ivu-select-dropdown{position:absolute!important}.ivu-split-wrapper{position:relative;width:100%;height:100%}.ivu-split-pane{position:absolute}.ivu-split-pane.left-pane,.ivu-split-pane.right-pane{top:0;bottom:0}.ivu-split-pane.left-pane{left:0}.ivu-split-pane.right-pane{right:0}.ivu-split-pane.bottom-pane,.ivu-split-pane.top-pane{left:0;right:0}.ivu-split-pane.top-pane{top:0}.ivu-split-pane.bottom-pane{bottom:0}.ivu-split-pane-moving{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-split-trigger{border:1px solid #dcdee2}.ivu-split-trigger-con{position:absolute;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:10}.ivu-split-trigger-bar-con{position:absolute;overflow:hidden}.ivu-split-trigger-bar-con.vertical{left:1px;top:50%;height:32px;-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%)}.ivu-split-trigger-bar-con.horizontal{left:50%;top:1px;width:32px;-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0)}.ivu-split-trigger-vertical{width:6px;height:100%;background:#f8f8f9;border-top:none;border-bottom:none;cursor:col-resize}.ivu-split-trigger-vertical .ivu-split-trigger-bar{width:4px;height:1px;background:rgba(23,35,61,.25);float:left;margin-top:3px}.ivu-split-trigger-horizontal{height:6px;width:100%;background:#f8f8f9;border-left:none;border-right:none;cursor:row-resize}.ivu-split-trigger-horizontal .ivu-split-trigger-bar{height:4px;width:1px;background:rgba(23,35,61,.25);float:left;margin-right:3px}.ivu-split-horizontal .ivu-split-trigger-con{top:50%;height:100%;width:0}.ivu-split-vertical .ivu-split-trigger-con{left:50%;height:0;width:100%}.ivu-split .no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-tooltip{display:inline-block}.ivu-tooltip-rel{display:inline-block;position:relative;width:inherit}.ivu-tooltip-popper{display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-tooltip-popper[x-placement^=top]{padding:5px 0 8px 0}.ivu-tooltip-popper[x-placement^=right]{padding:0 5px 0 8px}.ivu-tooltip-popper[x-placement^=bottom]{padding:8px 0 5px 0}.ivu-tooltip-popper[x-placement^=left]{padding:0 8px 0 5px}.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow{bottom:3px;border-width:5px 5px 0;border-top-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=top] .ivu-tooltip-arrow{left:50%;margin-left:-5px}.ivu-tooltip-popper[x-placement=top-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-popper[x-placement=top-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow{left:3px;border-width:5px 5px 5px 0;border-right-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=right] .ivu-tooltip-arrow{top:50%;margin-top:-5px}.ivu-tooltip-popper[x-placement=right-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-popper[x-placement=right-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow{right:3px;border-width:5px 0 5px 5px;border-left-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=left] .ivu-tooltip-arrow{top:50%;margin-top:-5px}.ivu-tooltip-popper[x-placement=left-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-popper[x-placement=left-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow{top:3px;border-width:0 5px 5px;border-bottom-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=bottom] .ivu-tooltip-arrow{left:50%;margin-left:-5px}.ivu-tooltip-popper[x-placement=bottom-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-popper[x-placement=bottom-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper{display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top]{padding:7px 0 10px 0}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right]{padding:0 7px 0 10px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom]{padding:10px 0 7px 0}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left]{padding:0 10px 0 7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow{bottom:3px;border-width:7px 7px 0;border-top-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top] .ivu-tooltip-arrow{left:50%;margin-left:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow{left:3px;border-width:7px 7px 7px 0;border-right-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right] .ivu-tooltip-arrow{top:50%;margin-top:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow{right:3px;border-width:7px 0 7px 7px;border-left-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left] .ivu-tooltip-arrow{top:50%;margin-top:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow{top:3px;border-width:0 7px 7px;border-bottom-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom] .ivu-tooltip-arrow{left:50%;margin-left:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow:after{content:\" \";bottom:1px;margin-left:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow:after{content:\" \";left:1px;bottom:-7px;border-left-width:0;border-right-width:7px;border-right-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow:after{content:\" \";top:1px;margin-left:-7px;border-top-width:0;border-bottom-width:7px;border-bottom-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow:after{content:\" \";right:1px;border-right-width:0;border-left-width:7px;border-left-color:#fff;bottom:-7px}.ivu-tooltip-inner{max-width:250px;min-height:34px;padding:8px 12px;color:#fff;text-align:left;text-decoration:none;background-color:rgba(70,76,91,.9);border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);white-space:nowrap}.ivu-tooltip-inner-with-width{white-space:pre-wrap;text-align:justify}.ivu-tooltip-light .ivu-tooltip-inner{background-color:#fff;color:#515a6e}.ivu-tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.ivu-tooltip-light .ivu-tooltip-arrow{border-width:8px}.ivu-tooltip-light .ivu-tooltip-arrow:after{display:block;width:0;height:0;position:absolute;border-color:transparent;border-style:solid;content:\"\";border-width:7px}.ivu-poptip{display:inline-block}.ivu-poptip-rel{display:inline-block;position:relative}.ivu-poptip-title{margin:0;padding:8px 16px;position:relative}.ivu-poptip-title:after{content:'';display:block;height:1px;position:absolute;left:8px;right:8px;bottom:0;background-color:#e8eaec}.ivu-poptip-title-inner{color:#17233d;font-size:14px;font-weight:500}.ivu-poptip-body{padding:8px 16px}.ivu-poptip-body-content{overflow:auto}.ivu-poptip-body-content-word-wrap{white-space:pre-wrap;text-align:justify}.ivu-poptip-body-content-inner{color:#515a6e}.ivu-poptip-inner{width:100%;background-color:#fff;background-clip:padding-box;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);white-space:nowrap}.ivu-poptip-popper{min-width:150px;display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-poptip-popper[x-placement^=top]{padding:7px 0 10px 0}.ivu-poptip-popper[x-placement^=right]{padding:0 7px 0 10px}.ivu-poptip-popper[x-placement^=bottom]{padding:10px 0 7px 0}.ivu-poptip-popper[x-placement^=left]{padding:0 10px 0 7px}.ivu-poptip-popper[x-placement^=top] .ivu-poptip-arrow{bottom:3px;border-width:7px 7px 0;border-top-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=top] .ivu-poptip-arrow{left:50%;margin-left:-7px}.ivu-poptip-popper[x-placement=top-start] .ivu-poptip-arrow{left:16px}.ivu-poptip-popper[x-placement=top-end] .ivu-poptip-arrow{right:16px}.ivu-poptip-popper[x-placement^=right] .ivu-poptip-arrow{left:3px;border-width:7px 7px 7px 0;border-right-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=right] .ivu-poptip-arrow{top:50%;margin-top:-7px}.ivu-poptip-popper[x-placement=right-start] .ivu-poptip-arrow{top:8px}.ivu-poptip-popper[x-placement=right-end] .ivu-poptip-arrow{bottom:8px}.ivu-poptip-popper[x-placement^=left] .ivu-poptip-arrow{right:3px;border-width:7px 0 7px 7px;border-left-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=left] .ivu-poptip-arrow{top:50%;margin-top:-7px}.ivu-poptip-popper[x-placement=left-start] .ivu-poptip-arrow{top:8px}.ivu-poptip-popper[x-placement=left-end] .ivu-poptip-arrow{bottom:8px}.ivu-poptip-popper[x-placement^=bottom] .ivu-poptip-arrow{top:3px;border-width:0 7px 7px;border-bottom-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=bottom] .ivu-poptip-arrow{left:50%;margin-left:-7px}.ivu-poptip-popper[x-placement=bottom-start] .ivu-poptip-arrow{left:16px}.ivu-poptip-popper[x-placement=bottom-end] .ivu-poptip-arrow{right:16px}.ivu-poptip-popper[x-placement^=top] .ivu-poptip-arrow:after{content:\" \";bottom:1px;margin-left:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#fff}.ivu-poptip-popper[x-placement^=right] .ivu-poptip-arrow:after{content:\" \";left:1px;bottom:-7px;border-left-width:0;border-right-width:7px;border-right-color:#fff}.ivu-poptip-popper[x-placement^=bottom] .ivu-poptip-arrow:after{content:\" \";top:1px;margin-left:-7px;border-top-width:0;border-bottom-width:7px;border-bottom-color:#fff}.ivu-poptip-popper[x-placement^=left] .ivu-poptip-arrow:after{content:\" \";right:1px;border-right-width:0;border-left-width:7px;border-left-color:#fff;bottom:-7px}.ivu-poptip-arrow,.ivu-poptip-arrow:after{display:block;width:0;height:0;position:absolute;border-color:transparent;border-style:solid}.ivu-poptip-arrow{border-width:8px}.ivu-poptip-arrow:after{content:\"\";border-width:7px}.ivu-poptip-confirm .ivu-poptip-popper{max-width:300px}.ivu-poptip-confirm .ivu-poptip-inner{white-space:normal}.ivu-poptip-confirm .ivu-poptip-body{padding:16px 16px 8px}.ivu-poptip-confirm .ivu-poptip-body .ivu-icon{font-size:16px;color:#f90;line-height:18px;position:absolute}.ivu-poptip-confirm .ivu-poptip-body-message{padding-left:20px}.ivu-poptip-confirm .ivu-poptip-footer{text-align:right;padding:8px 16px 16px}.ivu-poptip-confirm .ivu-poptip-footer button{margin-left:4px}.ivu-input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;border-radius:4px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-input:-ms-input-placeholder{color:#c5c8ce}.ivu-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-input:hover{border-color:#57a3f3}.ivu-input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input[disabled],fieldset[disabled] .ivu-input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input[disabled]:hover,fieldset[disabled] .ivu-input:hover{border-color:#e3e5e8}textarea.ivu-input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-input-wrapper{display:inline-block;width:100%;position:relative;vertical-align:middle;line-height:normal}.ivu-input-icon{width:32px;height:32px;line-height:32px;font-size:16px;text-align:center;color:#808695;position:absolute;right:0;z-index:3}.ivu-input-hide-icon .ivu-input-icon{display:none}.ivu-input-icon-validate{display:none}.ivu-input-icon-clear{display:none}.ivu-input-wrapper:hover .ivu-input-icon-clear{display:inline-block}.ivu-input-icon-normal+.ivu-input{padding-right:32px}.ivu-input-hide-icon .ivu-input-icon-normal+.ivu-input{padding-right:7px}.ivu-input-wrapper-large .ivu-input-icon{font-size:18px;height:40px;line-height:40px}.ivu-input-wrapper-small .ivu-input-icon{width:24px;font-size:14px;height:24px;line-height:24px}.ivu-input-prefix,.ivu-input-suffix{width:32px;height:100%;text-align:center;position:absolute;left:0;top:0;z-index:1}.ivu-input-prefix i,.ivu-input-suffix i{font-size:16px;line-height:32px;color:#808695}.ivu-input-suffix{left:auto;right:0}.ivu-input-wrapper-small .ivu-input-prefix i,.ivu-input-wrapper-small .ivu-input-suffix i{font-size:14px;line-height:24px}.ivu-input-wrapper-large .ivu-input-prefix i,.ivu-input-wrapper-large .ivu-input-suffix i{font-size:18px;line-height:40px}.ivu-input-with-prefix{padding-left:32px}.ivu-input-with-suffix{padding-right:32px}.ivu-input-search{cursor:pointer;padding:0 16px!important;background:#2d8cf0!important;color:#fff!important;border-color:#2d8cf0!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;z-index:2}.ivu-input-search i{font-size:16px}.ivu-input-search:hover{background:#57a3f3!important;border-color:#57a3f3!important}.ivu-input-search:active{background:#2b85e4!important;border-color:#2b85e4!important}.ivu-input-search-icon{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-input-search-icon:hover{color:inherit}.ivu-input-search:before{content:'';display:block;width:1px;position:absolute;top:-1px;bottom:-1px;left:-1px;background:inherit}.ivu-input-wrapper-small .ivu-input-search{padding:0 12px!important}.ivu-input-wrapper-small .ivu-input-search i{font-size:14px}.ivu-input-wrapper-large .ivu-input-search{padding:0 20px!important}.ivu-input-wrapper-large .ivu-input-search i{font-size:18px}.ivu-input-with-search:hover .ivu-input{border-color:#57a3f3}.ivu-input-word-count{text-align:center;position:absolute;right:7px;top:1px;bottom:1px;padding-left:7px;background:#fff;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#808695;font-size:12px}.ivu-input-type-textarea .ivu-input-word-count{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;top:auto}.ivu-input-group{display:table;width:100%;border-collapse:separate;position:relative;font-size:14px;top:1px}.ivu-input-group-large{font-size:16px}.ivu-input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ivu-input-group>[class*=col-]{padding-right:8px}.ivu-input-group-append,.ivu-input-group-prepend,.ivu-input-group>.ivu-input{display:table-cell}.ivu-input-group-with-prepend .ivu-input,.ivu-input-group-with-prepend.ivu-input-group-small .ivu-input{border-top-left-radius:0;border-bottom-left-radius:0}.ivu-input-group-with-append .ivu-input,.ivu-input-group-with-append.ivu-input-group-small .ivu-input{border-top-right-radius:0;border-bottom-right-radius:0}.ivu-input-group-append .ivu-btn,.ivu-input-group-prepend .ivu-btn{border-color:transparent;background-color:transparent;color:inherit;margin:-6px -7px}.ivu-input-group-append,.ivu-input-group-prepend{width:1px;white-space:nowrap;vertical-align:middle}.ivu-input-group .ivu-input{width:100%;float:left;margin-bottom:0;position:relative;z-index:2}.ivu-input-group-append,.ivu-input-group-prepend{padding:4px 7px;font-size:inherit;font-weight:400;line-height:1;color:#515a6e;text-align:center;background-color:#f8f8f9;border:1px solid #dcdee2;border-radius:4px}.ivu-input-group-append .ivu-select,.ivu-input-group-prepend .ivu-select{margin:-5px -7px}.ivu-input-group-append .ivu-select-selection,.ivu-input-group-prepend .ivu-select-selection{background-color:inherit;margin:-1px;border:1px solid transparent}.ivu-input-group-append .ivu-select-visible .ivu-select-selection,.ivu-input-group-prepend .ivu-select-visible .ivu-select-selection{-webkit-box-shadow:none;box-shadow:none}.ivu-input-group-prepend,.ivu-input-group>.ivu-input:first-child,.ivu-input-group>span>.ivu-input:first-child{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.ivu-input-group-prepend .ivu--select .ivu--select-selection,.ivu-input-group>.ivu-input:first-child .ivu--select .ivu--select-selection,.ivu-input-group>span>.ivu-input:first-child .ivu--select .ivu--select-selection{border-bottom-right-radius:0;border-top-right-radius:0}.ivu-input-group-prepend{border-right:0}.ivu-input-group-append{border-left:0}.ivu-input-group-append,.ivu-input-group>.ivu-input:last-child{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.ivu-input-group-append .ivu--select .ivu--select-selection,.ivu-input-group>.ivu-input:last-child .ivu--select .ivu--select-selection{border-bottom-left-radius:0;border-top-left-radius:0}.ivu-input-group-large .ivu-input,.ivu-input-group-large>.ivu-input-group-append,.ivu-input-group-large>.ivu-input-group-prepend{font-size:16px;padding:6px 7px;height:40px}.ivu-input-group-small .ivu-input,.ivu-input-group-small>.ivu-input-group-append,.ivu-input-group-small>.ivu-input-group-prepend{padding:1px 7px;height:24px;border-radius:3px}.ivu-form-item-error .ivu-input{border:1px solid #ed4014}.ivu-form-item-error .ivu-input:hover{border-color:#ed4014}.ivu-form-item-error .ivu-input:focus{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-form-item-error .ivu-input-icon{color:#ed4014}.ivu-form-item-error .ivu-input-group-append,.ivu-form-item-error .ivu-input-group-prepend{background-color:#fff;border:1px solid #ed4014}.ivu-form-item-error .ivu-input-group-append .ivu-select-selection,.ivu-form-item-error .ivu-input-group-prepend .ivu-select-selection{background-color:inherit;border:1px solid transparent}.ivu-form-item-error .ivu-input-group-prepend{border-right:0}.ivu-form-item-error .ivu-input-group-append{border-left:0}.ivu-form-item-error .ivu-transfer .ivu-input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;border-radius:4px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-form-item-error .ivu-transfer .ivu-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-form-item-error .ivu-transfer .ivu-input:-ms-input-placeholder{color:#c5c8ce}.ivu-form-item-error .ivu-transfer .ivu-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-form-item-error .ivu-transfer .ivu-input:hover{border-color:#57a3f3}.ivu-form-item-error .ivu-transfer .ivu-input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-form-item-error .ivu-transfer .ivu-input[disabled],fieldset[disabled] .ivu-form-item-error .ivu-transfer .ivu-input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-form-item-error .ivu-transfer .ivu-input[disabled]:hover,fieldset[disabled] .ivu-form-item-error .ivu-transfer .ivu-input:hover{border-color:#e3e5e8}textarea.ivu-form-item-error .ivu-transfer .ivu-input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-form-item-error .ivu-transfer .ivu-input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-form-item-error .ivu-transfer .ivu-input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-form-item-error .ivu-transfer .ivu-input-icon{color:#808695}.ivu-form-item-validating .ivu-input-icon-validate{display:inline-block}.ivu-form-item-validating .ivu-input-icon+.ivu-input{padding-right:32px}.ivu-slider{line-height:normal}.ivu-slider-wrap{width:100%;height:4px;margin:16px 0;background-color:#e8eaec;border-radius:3px;vertical-align:middle;position:relative;cursor:pointer}.ivu-slider-button-wrap{width:18px;height:18px;text-align:center;background-color:transparent;position:absolute;top:-4px;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.ivu-slider-button-wrap .ivu-tooltip{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-slider-button{width:12px;height:12px;border:2px solid #57a3f3;border-radius:50%;background-color:#fff;-webkit-transition:all .2s linear;transition:all .2s linear;outline:0}.ivu-slider-button-dragging,.ivu-slider-button:focus,.ivu-slider-button:hover{border-color:#2d8cf0;-webkit-transform:scale(1.5);-ms-transform:scale(1.5);transform:scale(1.5)}.ivu-slider-button:hover{cursor:-webkit-grab;cursor:grab}.ivu-slider-button-dragging,.ivu-slider-button-dragging:hover{cursor:-webkit-grabbing;cursor:grabbing}.ivu-slider-bar{height:4px;background:#57a3f3;border-radius:3px;position:absolute}.ivu-slider-stop{position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.ivu-slider-marks{top:0;left:12px;width:18px;height:100%}.ivu-slider-marks-item{position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#808695;margin-top:15px}.ivu-slider-disabled{cursor:not-allowed}.ivu-slider-disabled .ivu-slider-wrap{background-color:#ccc;cursor:not-allowed}.ivu-slider-disabled .ivu-slider-bar{background-color:#ccc}.ivu-slider-disabled .ivu-slider-button{border-color:#ccc}.ivu-slider-disabled .ivu-slider-button-dragging,.ivu-slider-disabled .ivu-slider-button:hover{border-color:#ccc}.ivu-slider-disabled .ivu-slider-button:hover{cursor:not-allowed}.ivu-slider-disabled .ivu-slider-button-dragging,.ivu-slider-disabled .ivu-slider-button-dragging:hover{cursor:not-allowed}.ivu-slider-input .ivu-slider-wrap{width:auto;margin-right:100px}.ivu-slider-input .ivu-input-number{float:right;margin-top:-14px}.selectDropDown{width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader{line-height:normal}.ivu-cascader-rel{display:inline-block;width:100%;position:relative}.ivu-cascader .ivu-input{padding-right:24px;display:block;cursor:pointer}.ivu-cascader-disabled .ivu-input{cursor:not-allowed}.ivu-cascader-label{width:100%;height:100%;line-height:32px;padding:0 7px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;font-size:14px;position:absolute;left:0;top:0}.ivu-cascader-size-large .ivu-cascader-label{line-height:36px;font-size:14px}.ivu-cascader-size-small .ivu-cascader-label{line-height:26px}.ivu-cascader .ivu-cascader-arrow:nth-of-type(1){display:none;cursor:pointer}.ivu-cascader:hover .ivu-cascader-arrow:nth-of-type(1){display:inline-block}.ivu-cascader-show-clear:hover .ivu-cascader-arrow:nth-of-type(2){display:none}.ivu-cascader-arrow{position:absolute;top:50%;right:8px;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);font-size:14px;color:#808695;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-visible .ivu-cascader-arrow:nth-of-type(2){-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.ivu-cascader .ivu-select-dropdown{width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader .ivu-cascader-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cascader .ivu-cascader-menu-item:hover{background:#f3f3f3}.ivu-cascader .ivu-cascader-menu-item-focus{background:#f3f3f3}.ivu-cascader .ivu-cascader-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cascader .ivu-cascader-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cascader .ivu-cascader-menu-item-selected,.ivu-cascader .ivu-cascader-menu-item-selected:hover{color:#2d8cf0}.ivu-cascader .ivu-cascader-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cascader .ivu-cascader-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cascader .ivu-cascader-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cascader .ivu-cascader-large .ivu-cascader-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cascader .ivu-cascader-menu-item{white-space:normal}}.ivu-cascader .ivu-select-item span{color:#ed4014}.ivu-cascader-dropdown{padding:5px 0}.ivu-cascader-dropdown .ivu-select-dropdown-list{max-height:190px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto}.ivu-cascader-not-found-tip{padding:5px 0;text-align:center;color:#c5c8ce}.ivu-cascader-not-found-tip li:not([class^=ivu-]){list-style:none;margin-bottom:0}.ivu-cascader-not-found .ivu-select-dropdown{width:inherit}.ivu-cascader-menu{display:inline-block;min-width:100px;height:180px;margin:0;padding:5px 0!important;vertical-align:top;list-style:none;border-right:1px solid #e8eaec;overflow:auto}.ivu-cascader-menu:last-child{border-right-color:transparent;margin-right:-1px}.ivu-cascader-menu .ivu-cascader-menu-item{position:relative;padding-right:36px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-menu .ivu-cascader-menu-item i{font-size:12px;position:absolute;right:15px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-cascader-menu .ivu-cascader-menu-item-loading{margin-top:-6px}.ivu-cascader-menu .ivu-cascader-menu-item-active{background-color:#f3f3f3;color:#2d8cf0}.ivu-cascader-transfer{z-index:1060;width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader-transfer .ivu-cascader-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cascader-transfer .ivu-cascader-menu-item:hover{background:#f3f3f3}.ivu-cascader-transfer .ivu-cascader-menu-item-focus{background:#f3f3f3}.ivu-cascader-transfer .ivu-cascader-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cascader-transfer .ivu-cascader-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cascader-transfer .ivu-cascader-menu-item-selected,.ivu-cascader-transfer .ivu-cascader-menu-item-selected:hover{color:#2d8cf0}.ivu-cascader-transfer .ivu-cascader-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cascader-transfer .ivu-cascader-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cascader-transfer .ivu-cascader-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cascader-transfer .ivu-cascader-large .ivu-cascader-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cascader-transfer .ivu-cascader-menu-item{white-space:normal}}.ivu-cascader-transfer .ivu-select-item span{color:#ed4014}.ivu-cascader-transfer .ivu-cascader-menu-item{padding-right:24px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-transfer .ivu-cascader-menu-item-active{background-color:#f3f3f3;color:#2d8cf0}.ivu-form-item-error .ivu-cascader-arrow{color:#ed4014}.ivu-transfer{position:relative;line-height:1.5}.ivu-transfer-list{display:inline-block;width:180px;height:210px;font-size:14px;vertical-align:middle;position:relative;padding-top:35px}.ivu-transfer-list-with-footer{padding-bottom:35px}.ivu-transfer-list-header{padding:8px 16px;background:#f9fafc;color:#515a6e;border:1px solid #dcdee2;border-bottom:1px solid #e8eaec;border-radius:6px 6px 0 0;overflow:hidden;position:absolute;top:0;left:0;width:100%}.ivu-transfer-list-header-title{cursor:pointer}.ivu-transfer-list-header>span{padding-left:4px}.ivu-transfer-list-header-count{margin:0!important;float:right}.ivu-transfer-list-body{height:100%;border:1px solid #dcdee2;border-top:none;border-radius:0 0 6px 6px;position:relative;overflow:hidden}.ivu-transfer-list-body-with-search{padding-top:34px}.ivu-transfer-list-body-with-footer{border-radius:0}.ivu-transfer-list-content{height:100%;padding:4px 0;overflow:auto}.ivu-transfer-list-content-item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ivu-transfer-list-content-item>span{padding-left:4px}.ivu-transfer-list-content-not-found{display:none;text-align:center;color:#c5c8ce}li.ivu-transfer-list-content-not-found:only-child{display:block}.ivu-transfer-list-body-with-search .ivu-transfer-list-content{padding:6px 0 0}.ivu-transfer-list-body-search-wrapper{padding:8px 8px 0;position:absolute;top:0;left:0;right:0}.ivu-transfer-list-search{position:relative}.ivu-transfer-list-footer{border:1px solid #dcdee2;border-top:none;border-radius:0 0 6px 6px;position:absolute;bottom:0;left:0;right:0;zoom:1}.ivu-transfer-list-footer:after,.ivu-transfer-list-footer:before{content:\"\";display:table}.ivu-transfer-list-footer:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-transfer-operation{display:inline-block;margin:0 16px;vertical-align:middle}.ivu-transfer-operation .ivu-btn{display:block;min-width:24px}.ivu-transfer-operation .ivu-btn:first-child{margin-bottom:12px}.ivu-transfer-operation .ivu-btn span i,.ivu-transfer-operation .ivu-btn span span{vertical-align:middle}.ivu-transfer-list-content-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-transfer-list-content-item:hover{background:#f3f3f3}.ivu-transfer-list-content-item-focus{background:#f3f3f3}.ivu-transfer-list-content-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-transfer-list-content-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-transfer-list-content-item-selected,.ivu-transfer-list-content-item-selected:hover{color:#2d8cf0}.ivu-transfer-list-content-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-transfer-list-content-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-transfer-list-content-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-transfer-large .ivu-transfer-list-content-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-transfer-list-content-item{white-space:normal}}.ivu-table{width:inherit;height:100%;max-width:100%;overflow:hidden;color:#515a6e;font-size:14px;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-table-wrapper{position:relative;overflow:hidden}.ivu-table-wrapper-with-border{border:1px solid #dcdee2;border-bottom:0;border-right:0}.ivu-table-summary{border-top:1px solid #e8eaec}.ivu-table-summary tr td{background-color:#f8f8f9}.ivu-table-with-summary .ivu-table-tbody tr:last-child td{border-bottom:none}.ivu-table-resize-line{position:absolute;top:0;left:0;bottom:0;width:1px;border-right:1px dashed #e8eaec}.ivu-table-hide{opacity:0}.ivu-table:before{content:'';width:100%;height:1px;position:absolute;left:0;bottom:0;background-color:#dcdee2;z-index:1}.ivu-table-border:after{content:'';width:1px;height:100%;position:absolute;top:0;right:0;background-color:#dcdee2;z-index:3}.ivu-table-footer,.ivu-table-title{height:48px;line-height:48px;border-bottom:1px solid #e8eaec}.ivu-table-footer{border-bottom:none}.ivu-table-header{overflow:hidden}.ivu-table-header thead tr th{position:relative;height:100%;padding:8px 0}.ivu-table-header-resizable{position:absolute;width:10px;height:100%;bottom:0;right:-5px;cursor:col-resize;z-index:1}.ivu-table-overflowX{overflow-x:scroll}.ivu-table-overflowY{overflow-y:scroll}.ivu-table-tip{overflow-x:auto;overflow-y:hidden}.ivu-table-with-fixed-top.ivu-table-with-footer .ivu-table-footer{border-top:1px solid #dcdee2}.ivu-table-with-fixed-top.ivu-table-with-footer tbody tr:last-child td{border-bottom:none}.ivu-table td,.ivu-table th{min-width:0;height:48px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:left;text-overflow:ellipsis;vertical-align:middle;border-bottom:1px solid #e8eaec}.ivu-table th{height:40px;white-space:nowrap;overflow:hidden;background-color:#f8f8f9}.ivu-table td{background-color:#fff;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}td.ivu-table-column-left,th.ivu-table-column-left{text-align:left}td.ivu-table-column-center,th.ivu-table-column-center{text-align:center}td.ivu-table-column-right,th.ivu-table-column-right{text-align:right}.ivu-table table{table-layout:fixed}.ivu-table-border td,.ivu-table-border th{border-right:1px solid #e8eaec}.ivu-table-cell{padding-left:18px;padding-right:18px;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-table-cell-ellipsis{word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ivu-table-cell-tooltip{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-table-cell-tooltip-content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-table-cell-with-expand{height:47px;line-height:47px;padding:0;text-align:center}.ivu-table-cell-expand{cursor:pointer;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ivu-table-cell-expand i{font-size:14px}.ivu-table-cell-expand-expanded{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-table-cell-sort{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-table-cell-with-selection .ivu-checkbox-wrapper{margin-right:0}.ivu-table-hidden{visibility:hidden}th .ivu-table-cell{display:inline-block;word-wrap:normal;vertical-align:middle}td.ivu-table-expanded-cell{padding:20px 50px;background:#f8f8f9}.ivu-table-stripe .ivu-table-body tr:nth-child(2n) td,.ivu-table-stripe .ivu-table-fixed-body tr:nth-child(2n) td{background-color:#f8f8f9}.ivu-table-stripe .ivu-table-body tr.ivu-table-row-hover td,.ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-hover td{background-color:#ebf7ff}tr.ivu-table-row-hover td{background-color:#ebf7ff}.ivu-table-large{font-size:16px}.ivu-table-large th{height:48px}.ivu-table-large td{height:60px}.ivu-table-large-footer,.ivu-table-large-title{height:60px;line-height:60px}.ivu-table-large .ivu-table-cell-with-expand{height:59px;line-height:59px}.ivu-table-large .ivu-table-cell-with-expand i{font-size:16px}.ivu-table-small{font-size:12px}.ivu-table-small th{height:32px}.ivu-table-small td{height:40px}.ivu-table-small-footer,.ivu-table-small-title{height:40px;line-height:40px}.ivu-table-small .ivu-table-cell-with-expand{height:39px;line-height:39px}.ivu-table-row-highlight td,.ivu-table-stripe .ivu-table-body tr.ivu-table-row-highlight:nth-child(2n) td,.ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-highlight:nth-child(2n) td,tr.ivu-table-row-highlight.ivu-table-row-hover td{background-color:#ebf7ff}.ivu-table-fixed,.ivu-table-fixed-right{position:absolute;top:0;left:0;-webkit-box-shadow:2px 0 6px -2px rgba(0,0,0,.2);box-shadow:2px 0 6px -2px rgba(0,0,0,.2)}.ivu-table-fixed-right::before,.ivu-table-fixed::before{content:'';width:100%;height:1px;background-color:#dcdee2;position:absolute;left:0;bottom:0;z-index:4}.ivu-table-fixed-right{top:0;left:auto;right:0;-webkit-box-shadow:-2px 0 6px -2px rgba(0,0,0,.2);box-shadow:-2px 0 6px -2px rgba(0,0,0,.2)}.ivu-table-fixed-right-header{position:absolute;top:-1px;right:0;background-color:#f8f8f9;border-top:1px solid #dcdee2;border-bottom:1px solid #e8eaec}.ivu-table-fixed-header{overflow:hidden}.ivu-table-fixed-header thead tr th{position:relative;height:100%;padding:8px 0}.ivu-table-fixed-body{overflow:hidden;position:relative;z-index:3}.ivu-table-fixed-shadow{width:1px;height:100%;position:absolute;top:0;right:0;-webkit-box-shadow:1px 0 6px rgba(0,0,0,.2);box-shadow:1px 0 6px rgba(0,0,0,.2);overflow:hidden;z-index:1}.ivu-table-sort{display:inline-block;width:14px;height:12px;margin-top:-1px;vertical-align:middle;overflow:hidden;cursor:pointer;position:relative}.ivu-table-sort i{display:block;height:6px;line-height:6px;overflow:hidden;position:absolute;color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out;font-size:16px}.ivu-table-sort i:hover{color:inherit}.ivu-table-sort i.on{color:#2d8cf0}.ivu-table-sort i:first-child{top:0}.ivu-table-sort i:last-child{bottom:0}.ivu-table-filter{display:inline-block;cursor:pointer;position:relative}.ivu-table-filter i{color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-table-filter i:hover{color:inherit}.ivu-table-filter i.on{color:#2d8cf0}.ivu-table-filter-list{padding:8px 0 0}.ivu-table-filter-list-item{padding:0 12px 8px}.ivu-table-filter-list-item .ivu-checkbox-wrapper+.ivu-checkbox-wrapper{margin:0}.ivu-table-filter-list-item label{display:block}.ivu-table-filter-list-item label>span{margin-right:4px}.ivu-table-filter-list ul{padding-bottom:8px}.ivu-table-filter-list .ivu-table-filter-select-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-table-filter-list .ivu-table-filter-select-item:hover{background:#f3f3f3}.ivu-table-filter-list .ivu-table-filter-select-item-focus{background:#f3f3f3}.ivu-table-filter-list .ivu-table-filter-select-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-table-filter-list .ivu-table-filter-select-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-table-filter-list .ivu-table-filter-select-item-selected,.ivu-table-filter-list .ivu-table-filter-select-item-selected:hover{color:#2d8cf0}.ivu-table-filter-list .ivu-table-filter-select-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-table-filter-list .ivu-table-filter-select-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-table-filter-list .ivu-table-filter-select-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-table-filter-list .ivu-table-large .ivu-table-filter-select-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-table-filter-list .ivu-table-filter-select-item{white-space:normal}}.ivu-table-filter-footer{padding:4px;border-top:1px solid #e8eaec;overflow:hidden}.ivu-table-filter-footer button:first-child{float:left}.ivu-table-filter-footer button:last-child{float:right}.ivu-table-tip table{width:100%}.ivu-table-tip table td{text-align:center}.ivu-table-expanded-hidden{visibility:hidden}.ivu-table-popper{min-width:0;text-align:left}.ivu-table-popper .ivu-poptip-body{padding:0}.ivu-dropdown{display:inline-block}.ivu-dropdown .ivu-select-dropdown{overflow:visible;max-height:none}.ivu-dropdown .ivu-dropdown{width:100%}.ivu-dropdown-rel{position:relative}.ivu-dropdown-rel-user-select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-dropdown-menu{min-width:100px}.ivu-dropdown-transfer{width:auto}.ivu-dropdown-item-selected,.ivu-dropdown-item.ivu-dropdown-item-selected:hover{background:#f0faff}.ivu-dropdown-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-dropdown-item:hover{background:#f3f3f3}.ivu-dropdown-item-focus{background:#f3f3f3}.ivu-dropdown-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-dropdown-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-dropdown-item-selected,.ivu-dropdown-item-selected:hover{color:#2d8cf0}.ivu-dropdown-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-dropdown-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-dropdown-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-dropdown-large .ivu-dropdown-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-dropdown-item{white-space:normal}}.ivu-tabs{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;overflow:hidden;color:#515a6e;zoom:1}.ivu-tabs:after,.ivu-tabs:before{content:\"\";display:table}.ivu-tabs:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-tabs-bar{outline:0}.ivu-tabs-ink-bar{height:2px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#2d8cf0;position:absolute;left:0;bottom:1px;z-index:1;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.ivu-tabs-bar{border-bottom:1px solid #dcdee2;margin-bottom:16px}.ivu-tabs-nav-container{margin-bottom:-1px;line-height:1.5;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;overflow:hidden;position:relative;zoom:1}.ivu-tabs-nav-container:after,.ivu-tabs-nav-container:before{content:\"\";display:table}.ivu-tabs-nav-container:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-tabs-nav-container:focus{outline:0}.ivu-tabs-nav-container:focus .ivu-tabs-tab-focused{border-color:#57a3f3!important}.ivu-tabs-nav-container-scrolling{padding-left:32px;padding-right:32px}.ivu-tabs-nav-wrap{overflow:hidden;margin-bottom:-1px}.ivu-tabs-nav-scroll{overflow:hidden;white-space:nowrap}.ivu-tabs-nav-right{float:right;margin-left:5px}.ivu-tabs-nav-next,.ivu-tabs-nav-prev{width:32px;text-align:center;position:absolute;line-height:32px;cursor:pointer}.ivu-tabs-nav-next i,.ivu-tabs-nav-prev i{font-size:16px}.ivu-tabs-nav-prev{left:0}.ivu-tabs-nav-next{right:0}.ivu-tabs-nav-scrollable{padding:0 32px}.ivu-tabs-nav-scroll-disabled{display:none}.ivu-tabs-nav{padding-left:0;margin:0;float:left;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out,-webkit-transform .5s ease-in-out}.ivu-tabs-nav:after,.ivu-tabs-nav:before{display:table;content:\" \"}.ivu-tabs-nav:after{clear:both}.ivu-tabs-nav .ivu-tabs-tab-disabled{pointer-events:none;cursor:default;color:#ccc}.ivu-tabs-nav .ivu-tabs-tab{display:inline-block;height:100%;padding:8px 16px;margin-right:16px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;text-decoration:none;position:relative;-webkit-transition:color .3s ease-in-out;transition:color .3s ease-in-out}.ivu-tabs-nav .ivu-tabs-tab:hover{color:#57a3f3}.ivu-tabs-nav .ivu-tabs-tab:active{color:#2b85e4}.ivu-tabs-nav .ivu-tabs-tab .ivu-icon{width:14px;height:14px;margin-right:8px}.ivu-tabs-nav .ivu-tabs-tab-active{color:#2d8cf0}.ivu-tabs-mini .ivu-tabs-nav-container{font-size:14px}.ivu-tabs-mini .ivu-tabs-tab{margin-right:0;padding:8px 16px;font-size:12px}.ivu-tabs .ivu-tabs-content-animated{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;will-change:transform;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.ivu-tabs .ivu-tabs-tabpane{-ms-flex-negative:0;flex-shrink:0;width:100%;-webkit-transition:opacity .3s;transition:opacity .3s;opacity:1;outline:0}.ivu-tabs .ivu-tabs-tabpane-inactive{opacity:0;height:0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-nav-container{height:32px}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-ink-bar{visibility:hidden}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab{margin:0;margin-right:4px;height:31px;padding:5px 16px 4px;border:1px solid #dcdee2;border-bottom:0;border-radius:4px 4px 0 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:#f8f8f9}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab-active{height:32px;padding-bottom:5px;background:#fff;-webkit-transform:translateZ(0);transform:translateZ(0);border-color:#dcdee2;color:#2d8cf0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-nav-wrap{margin-bottom:0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab .ivu-tabs-close{width:0;height:22px;font-size:22px;margin-right:0;color:#999;text-align:right;vertical-align:middle;overflow:hidden;position:relative;top:-1px;-webkit-transform-origin:100% 50%;-ms-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab .ivu-tabs-close:hover{color:#444}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab-active .ivu-tabs-close,.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab:hover .ivu-tabs-close{width:22px;-webkit-transform:translateZ(0);transform:translateZ(0);margin-right:-6px}.ivu-tabs-no-animation>.ivu-tabs-content{-webkit-transform:none!important;-ms-transform:none!important;transform:none!important}.ivu-tabs-no-animation>.ivu-tabs-content>.ivu-tabs-tabpane-inactive{display:none}.ivu-menu{display:block;margin:0;padding:0;outline:0;list-style:none;color:#515a6e;font-size:14px;position:relative;z-index:900}.ivu-menu-horizontal{height:60px;line-height:60px}.ivu-menu-horizontal.ivu-menu-light:after{content:'';display:block;width:100%;height:1px;background:#dcdee2;position:absolute;bottom:0;left:0}.ivu-menu-vertical.ivu-menu-light:after{content:'';display:block;width:1px;height:100%;background:#dcdee2;position:absolute;top:0;bottom:0;right:0;z-index:1}.ivu-menu-light{background:#fff}.ivu-menu-dark{background:#515a6e}.ivu-menu-primary{background:#2d8cf0}.ivu-menu-item{display:block;outline:0;list-style:none;font-size:14px;position:relative;z-index:1;cursor:pointer;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.ivu-menu-item{color:inherit}a.ivu-menu-item:active,a.ivu-menu-item:hover{color:inherit}.ivu-menu-item>i{margin-right:6px}.ivu-menu-submenu-title span>i,.ivu-menu-submenu-title>i{margin-right:8px}.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-horizontal .ivu-menu-submenu{float:left;padding:0 20px;position:relative;cursor:pointer;z-index:3;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu{height:inherit;line-height:inherit;border-bottom:2px solid transparent;color:#515a6e}.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item-active,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item:hover,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu-active,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu:hover{color:#2d8cf0;border-bottom:2px solid #2d8cf0}.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu{color:rgba(255,255,255,.7)}.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item-active,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item:hover,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu-active,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu:hover{color:#fff}.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-submenu{color:#fff}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown{min-width:100%;width:auto;max-height:none}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{height:auto;line-height:normal;border-bottom:0;float:none}.ivu-menu-item-group{line-height:normal}.ivu-menu-item-group-title{height:30px;line-height:30px;padding-left:8px;font-size:12px;color:#999}.ivu-menu-item-group>ul{padding:0!important;list-style:none!important}.ivu-menu-vertical .ivu-menu-item,.ivu-menu-vertical .ivu-menu-submenu-title{padding:14px 24px;position:relative;cursor:pointer;z-index:1;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-menu-vertical .ivu-menu-item:hover,.ivu-menu-vertical .ivu-menu-submenu-title:hover{color:#2d8cf0}.ivu-menu-vertical .ivu-menu-submenu-title-icon{position:absolute;top:50%;right:24px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-menu-submenu-title-icon{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ivu-menu-horizontal .ivu-menu-opened>*>.ivu-menu-submenu-title-icon{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.ivu-menu-vertical .ivu-menu-opened>*>.ivu-menu-submenu-title-icon{-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.ivu-menu-vertical .ivu-menu-submenu-nested{padding-left:20px}.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item{padding-left:43px}.ivu-menu-vertical .ivu-menu-item-group-title{height:48px;line-height:48px;font-size:14px;padding-left:28px}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-group-title{color:rgba(255,255,255,.36)}.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu){color:#2d8cf0;background:#f0faff;z-index:2}.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):after{content:'';display:block;width:2px;position:absolute;top:0;bottom:0;right:0;background:#2d8cf0}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title{color:rgba(255,255,255,.7)}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):hover,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu):hover{background:#363e4f}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item:hover,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title:hover{color:#fff;background:#515a6e}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){color:#2d8cf0}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item:hover{color:#fff;background:0 0!important}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active:hover{border-right:none;color:#fff;background:#2d8cf0!important}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-child-item-active>.ivu-menu-submenu-title{color:#fff}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened{background:#363e4f}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-title{background:#515a6e}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-has-parent-submenu .ivu-menu-submenu-title{background:0 0}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item:hover{background:#f3f3f3}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-focus{background:#f3f3f3}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-selected,.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-selected:hover{color:#2d8cf0}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-menu-large .ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{white-space:normal}}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{padding:7px 16px 8px;font-size:14px!important}.ivu-date-picker{display:inline-block;line-height:normal}.ivu-date-picker-rel{position:relative}.ivu-date-picker .ivu-select-dropdown{width:auto;padding:0;overflow:visible;max-height:none}.ivu-date-picker-cells{width:196px;margin:10px;white-space:normal}.ivu-date-picker-cells span{display:inline-block;width:24px;height:24px}.ivu-date-picker-cells span em{display:inline-block;width:24px;height:24px;line-height:24px;margin:2px;font-style:normal;border-radius:3px;text-align:center;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-date-picker-cells-header span{line-height:24px;text-align:center;margin:2px;color:#c5c8ce}.ivu-date-picker-cells-cell:hover em{background:#e1f0fe}.ivu-date-picker-cells-focused em{-webkit-box-shadow:0 0 0 1px #2d8cf0 inset;box-shadow:0 0 0 1px #2d8cf0 inset}span.ivu-date-picker-cells-cell{width:28px;height:28px;cursor:pointer}.ivu-date-picker-cells-cell-next-month em,.ivu-date-picker-cells-cell-prev-month em{color:#c5c8ce}.ivu-date-picker-cells-cell-next-month:hover em,.ivu-date-picker-cells-cell-prev-month:hover em{background:0 0}span.ivu-date-picker-cells-cell-disabled,span.ivu-date-picker-cells-cell-disabled:hover,span.ivu-date-picker-cells-cell-week-label,span.ivu-date-picker-cells-cell-week-label:hover{cursor:not-allowed;color:#c5c8ce}span.ivu-date-picker-cells-cell-disabled em,span.ivu-date-picker-cells-cell-disabled:hover em,span.ivu-date-picker-cells-cell-week-label em,span.ivu-date-picker-cells-cell-week-label:hover em{color:inherit;background:inherit}span.ivu-date-picker-cells-cell-disabled,span.ivu-date-picker-cells-cell-disabled:hover{background:#f7f7f7}.ivu-date-picker-cells-cell-today em{position:relative}.ivu-date-picker-cells-cell-today em:after{content:'';display:block;width:6px;height:6px;border-radius:50%;background:#2d8cf0;position:absolute;top:1px;right:1px}.ivu-date-picker-cells-cell-range{position:relative}.ivu-date-picker-cells-cell-range em{position:relative;z-index:1}.ivu-date-picker-cells-cell-range:before{content:'';display:block;background:#e1f0fe;border-radius:0;border:0;position:absolute;top:2px;bottom:2px;left:0;right:0}.ivu-date-picker-cells-cell-selected em,.ivu-date-picker-cells-cell-selected:hover em{background:#2d8cf0;color:#fff}span.ivu-date-picker-cells-cell-disabled.ivu-date-picker-cells-cell-selected em{background:#c5c8ce;color:#f7f7f7}.ivu-date-picker-cells-cell-today.ivu-date-picker-cells-cell-selected em:after{background:#fff}.ivu-date-picker-cells-show-week-numbers{width:226px}.ivu-date-picker-cells-month,.ivu-date-picker-cells-year{margin-top:14px}.ivu-date-picker-cells-month span,.ivu-date-picker-cells-year span{width:40px;height:28px;line-height:28px;margin:10px 12px;border-radius:3px}.ivu-date-picker-cells-month span em,.ivu-date-picker-cells-year span em{width:40px;height:28px;line-height:28px;margin:0}.ivu-date-picker-cells-month .ivu-date-picker-cells-cell-focused,.ivu-date-picker-cells-year .ivu-date-picker-cells-cell-focused{background-color:#d5e8fc}.ivu-date-picker-header{height:32px;line-height:32px;text-align:center;border-bottom:1px solid #e8eaec}.ivu-date-picker-header-label{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-date-picker-header-label:hover{color:#2d8cf0}.ivu-date-picker-btn-pulse{background-color:#d5e8fc!important;border-radius:4px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.ivu-date-picker-prev-btn{float:left}.ivu-date-picker-prev-btn-arrow-double{margin-left:10px}.ivu-date-picker-prev-btn-arrow-double i:after{content:\"\\F115\";margin-left:-8px}.ivu-date-picker-next-btn{float:right}.ivu-date-picker-next-btn-arrow-double{margin-right:10px}.ivu-date-picker-next-btn-arrow-double i:after{content:\"\\F11F\";margin-left:-8px}.ivu-date-picker-with-range .ivu-picker-panel-body{min-width:432px}.ivu-date-picker-with-range .ivu-picker-panel-content{float:left}.ivu-date-picker-with-range .ivu-picker-cells-show-week-numbers{min-width:492px}.ivu-date-picker-with-week-numbers .ivu-picker-panel-body-date{min-width:492px}.ivu-date-picker-transfer{z-index:1060;max-height:none;width:auto}.ivu-date-picker-focused input{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-picker-panel-icon-btn{display:inline-block;width:20px;height:24px;line-height:26px;margin-top:2px;text-align:center;cursor:pointer;color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-picker-panel-icon-btn:hover{color:#2d8cf0}.ivu-picker-panel-icon-btn i{font-size:14px}.ivu-picker-panel-body-wrapper.ivu-picker-panel-with-sidebar{padding-left:92px}.ivu-picker-panel-sidebar{width:92px;float:left;margin-left:-92px;position:absolute;top:0;bottom:0;background:#f8f8f9;border-right:1px solid #e8eaec;border-radius:4px 0 0 4px;overflow:auto}.ivu-picker-panel-shortcut{padding:6px 16px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-picker-panel-shortcut:hover{background:#e8eaec}.ivu-picker-panel-body{float:left}.ivu-picker-confirm{border-top:1px solid #e8eaec;text-align:right;padding:8px;clear:both}.ivu-picker-confirm>span{color:#2d8cf0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;float:left;padding:2px 0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-picker-confirm>span:hover{color:#57a3f3}.ivu-picker-confirm>span:active{color:#2b85e4}.ivu-picker-confirm-time{float:left}.ivu-time-picker-cells{min-width:112px}.ivu-time-picker-cells-with-seconds{min-width:168px}.ivu-time-picker-cells-list{width:56px;max-height:144px;float:left;overflow:hidden;border-left:1px solid #e8eaec;position:relative}.ivu-time-picker-cells-list:hover{overflow-y:auto}.ivu-time-picker-cells-list:first-child{border-left:none;border-radius:4px 0 0 4px}.ivu-time-picker-cells-list:last-child{border-radius:0 4px 4px 0}.ivu-time-picker-cells-list ul{width:100%;margin:0;padding:0 0 120px 0;list-style:none}.ivu-time-picker-cells-list ul li{width:100%;height:24px;line-height:24px;margin:0;padding:0 0 0 16px;-webkit-box-sizing:content-box;box-sizing:content-box;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;list-style:none;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-time-picker-cells-cell:hover{background:#f3f3f3}.ivu-time-picker-cells-cell-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-time-picker-cells-cell-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-time-picker-cells-cell-selected,.ivu-time-picker-cells-cell-selected:hover{color:#2d8cf0;background:#f3f3f3}.ivu-time-picker-cells-cell-focused{background-color:#d5e8fc}.ivu-time-picker-header{height:32px;line-height:32px;text-align:center;border-bottom:1px solid #e8eaec}.ivu-time-picker-with-range .ivu-picker-panel-body{min-width:228px}.ivu-time-picker-with-range .ivu-picker-panel-content{float:left;position:relative}.ivu-time-picker-with-range .ivu-picker-panel-content:after{content:'';display:block;width:2px;position:absolute;top:31px;bottom:0;right:-2px;background:#e8eaec;z-index:1}.ivu-time-picker-with-range .ivu-picker-panel-content-right{float:right}.ivu-time-picker-with-range .ivu-picker-panel-content-right:after{right:auto;left:-2px}.ivu-time-picker-with-range .ivu-time-picker-cells-list:first-child{border-radius:0}.ivu-time-picker-with-range .ivu-time-picker-cells-list:last-child{border-radius:0}.ivu-time-picker-with-range.ivu-time-picker-with-seconds .ivu-picker-panel-body{min-width:340px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells{min-width:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds{min-width:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds .ivu-time-picker-cells-list{width:72px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds .ivu-time-picker-cells-list ul li{padding:0 0 0 28px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list{width:108px;max-height:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list:first-child{border-radius:0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list:last-child{border-radius:0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list ul{padding:0 0 192px 0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list ul li{padding:0 0 0 46px}.ivu-form .ivu-form-item-label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#515a6e;line-height:1;padding:10px 12px 10px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-form-label-left .ivu-form-item-label{text-align:left}.ivu-form-label-top .ivu-form-item-label{float:none;display:inline-block;padding:0 0 10px 0}.ivu-form-inline .ivu-form-item{display:inline-block;margin-right:10px;vertical-align:top}.ivu-form-item{margin-bottom:24px;vertical-align:top;zoom:1}.ivu-form-item:after,.ivu-form-item:before{content:\"\";display:table}.ivu-form-item:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-form-item-content{position:relative;line-height:32px;font-size:14px}.ivu-form-item .ivu-form-item{margin-bottom:0}.ivu-form-item .ivu-form-item .ivu-form-item-content{margin-left:0!important}.ivu-form-item-error-tip{position:absolute;top:100%;left:0;line-height:1;padding-top:6px;color:#ed4014}.ivu-form-item-required .ivu-form-item-label:before{content:'*';display:inline-block;margin-right:4px;line-height:1;font-family:SimSun;font-size:14px;color:#ed4014}.ivu-form-hide-required-mark .ivu-form-item-required .ivu-form-item-label:before{display:none}.ivu-carousel{position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.ivu-carousel-list,.ivu-carousel-track{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ivu-carousel-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.ivu-carousel-track{position:relative;top:0;left:0;display:block;overflow:hidden;z-index:1}.ivu-carousel-track.higher{z-index:2}.ivu-carousel-item{float:left;height:100%;min-height:1px;display:block}.ivu-carousel-arrow{border:none;outline:0;padding:0;margin:0;width:36px;height:36px;border-radius:50%;cursor:pointer;display:none;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.2s;transition:.2s;background-color:rgba(31,45,61,.11);color:#fff;text-align:center;font-size:1em;font-family:inherit;line-height:inherit}.ivu-carousel-arrow:hover{background-color:rgba(31,45,61,.5)}.ivu-carousel-arrow>*{vertical-align:baseline}.ivu-carousel-arrow.left{left:16px}.ivu-carousel-arrow.right{right:16px}.ivu-carousel-arrow-always{display:inherit}.ivu-carousel-arrow-hover{display:inherit;opacity:0}.ivu-carousel:hover .ivu-carousel-arrow-hover{opacity:1}.ivu-carousel-dots{z-index:10;display:none;position:relative;list-style:none;text-align:center;padding:0;width:100%;height:17px}.ivu-carousel-dots-inside{display:block;position:absolute;bottom:3px}.ivu-carousel-dots-outside{display:block;margin-top:3px}.ivu-carousel-dots li{position:relative;display:inline-block;vertical-align:top;text-align:center;margin:0 2px;padding:7px 0;cursor:pointer}.ivu-carousel-dots li button{border:0;cursor:pointer;background:#8391a5;opacity:.3;display:block;width:16px;height:3px;border-radius:1px;outline:0;font-size:0;color:transparent;-webkit-transition:all .5s;transition:all .5s}.ivu-carousel-dots li button.radius{width:6px;height:6px;border-radius:50%}.ivu-carousel-dots li:hover>button{opacity:.7}.ivu-carousel-dots li.ivu-carousel-active>button{opacity:1;width:24px}.ivu-carousel-dots li.ivu-carousel-active>button.radius{width:6px}.ivu-rate{display:inline-block;margin:0;padding:0;font-size:20px;vertical-align:middle;font-weight:400;font-style:normal}.ivu-rate-disabled .ivu-rate-star-content:before,.ivu-rate-disabled .ivu-rate-star:before{cursor:default}.ivu-rate-disabled .ivu-rate-star:hover{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ivu-rate-star-full,.ivu-rate-star-zero{position:relative}.ivu-rate-star-first{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden;opacity:0}.ivu-rate-star-first,.ivu-rate-star-second{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s ease;transition:all .3s ease;color:#e9e9e9;cursor:pointer}.ivu-rate-star-chart{display:inline-block;margin:0;padding:0;margin-right:8px;position:relative;font-family:Ionicons;-webkit-transition:all .3s ease;transition:all .3s ease}.ivu-rate-star-chart:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.ivu-rate-star-chart.ivu-rate-star-full .ivu-rate-star-first,.ivu-rate-star-chart.ivu-rate-star-full .ivu-rate-star-second{color:#f5a623}.ivu-rate-star-chart.ivu-rate-star-half .ivu-rate-star-first{opacity:1;color:#f5a623}.ivu-rate-star{display:inline-block;margin:0;padding:0;margin-right:8px;position:relative;font-family:Ionicons;-webkit-transition:all .3s ease;transition:all .3s ease}.ivu-rate-star:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.ivu-rate-star-content:before,.ivu-rate-star:before{color:#e9e9e9;cursor:pointer;content:\"\\F2BF\";-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:block}.ivu-rate-star-content{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden}.ivu-rate-star-content:before{color:transparent}.ivu-rate-star-full:before,.ivu-rate-star-half .ivu-rate-star-content:before{color:#f5a623}.ivu-rate-star-full:hover:before,.ivu-rate-star-half:hover .ivu-rate-star-content:before{color:#f7b84f}.ivu-rate-text{margin-left:8px;vertical-align:middle;display:inline-block;font-size:14px}.ivu-upload input[type=file]{display:none}.ivu-upload-list{margin-top:8px}.ivu-upload-list-file{padding:4px;color:#515a6e;border-radius:4px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;overflow:hidden;position:relative}.ivu-upload-list-file>span{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-upload-list-file>span i{display:inline-block;width:12px;height:12px;color:#515a6e;text-align:center}.ivu-upload-list-file:hover{background:#f3f3f3}.ivu-upload-list-file:hover>span{color:#2d8cf0}.ivu-upload-list-file:hover>span i{color:#515a6e}.ivu-upload-list-file:hover .ivu-upload-list-remove{opacity:1}.ivu-upload-list-remove{opacity:0;font-size:18px;cursor:pointer;float:right;margin-right:4px;color:#999;-webkit-transition:all .2s ease;transition:all .2s ease}.ivu-upload-list-remove:hover{color:#444}.ivu-upload-select{display:inline-block}.ivu-upload-drag{background:#fff;border:1px dashed #dcdee2;border-radius:4px;text-align:center;cursor:pointer;position:relative;overflow:hidden;-webkit-transition:border-color .2s ease;transition:border-color .2s ease}.ivu-upload-drag:hover{border:1px dashed #2d8cf0}.ivu-upload-dragOver{border:2px dashed #2d8cf0}.ivu-tree ul{list-style:none;margin:0;padding:0;font-size:14px}.ivu-tree ul.ivu-dropdown-menu{padding:0}.ivu-tree ul li{list-style:none;margin:8px 0;padding:0;white-space:nowrap;outline:0}.ivu-tree ul li.ivu-dropdown-item{margin:0;padding:7px 16px;white-space:nowrap}.ivu-tree li ul{margin:0;padding:0 0 0 18px}.ivu-tree-title{display:inline-block;margin:0;padding:0 4px;border-radius:3px;cursor:pointer;vertical-align:top;color:#515a6e;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-tree-title:hover{background-color:#eaf4fe}.ivu-tree-title-selected,.ivu-tree-title-selected:hover{background-color:#d5e8fc}.ivu-tree-arrow{cursor:pointer;width:12px;text-align:center;display:inline-block}.ivu-tree-arrow i{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;font-size:14px;vertical-align:middle}.ivu-tree-arrow-open i{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-tree-arrow-disabled{cursor:not-allowed}.ivu-tree .ivu-checkbox-wrapper{margin-right:4px;margin-left:4px}.ivu-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:50%}.ivu-avatar-image{background:0 0}.ivu-avatar .ivu-icon{position:relative;top:-1px}.ivu-avatar>*{line-height:32px}.ivu-avatar.ivu-avatar-icon{font-size:18px}.ivu-avatar-large{width:40px;height:40px;line-height:40px;border-radius:50%}.ivu-avatar-large>*{line-height:40px}.ivu-avatar-large.ivu-avatar-icon{font-size:24px}.ivu-avatar-large .ivu-icon{position:relative;top:-2px}.ivu-avatar-small{width:24px;height:24px;line-height:24px;border-radius:50%}.ivu-avatar-small>*{line-height:24px}.ivu-avatar-small.ivu-avatar-icon{font-size:14px}.ivu-avatar-square{border-radius:4px}.ivu-avatar>img{width:100%;height:100%}.ivu-color-picker{display:inline-block}.ivu-color-picker-hide{display:none}.ivu-color-picker-hide-drop{visibility:hidden}.ivu-color-picker-disabled{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-color-picker-disabled:hover{border-color:#e3e5e8}.ivu-color-picker>div:first-child:hover .ivu-input{border-color:#57a3f3}.ivu-color-picker>div:first-child.ivu-color-picker-disabled:hover .ivu-input{border-color:#e3e5e8}.ivu-color-picker .ivu-select-dropdown{padding:0}.ivu-color-picker-input.ivu-input:focus{-webkit-box-shadow:none;box-shadow:none}.ivu-color-picker-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-rel{line-height:0}.ivu-color-picker-color{width:18px;height:18px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px;position:relative;top:2px}.ivu-color-picker-color div{width:100%;height:100%;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);border-radius:2px}.ivu-color-picker-color-empty{background:#fff;overflow:hidden;text-align:center}.ivu-color-picker-color-empty i{font-size:18px;vertical-align:baseline}.ivu-color-picker-color-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-large .ivu-color-picker-color{width:20px;height:20px;top:1px}.ivu-color-picker-large .ivu-color-picker-color-empty i{font-size:20px}.ivu-color-picker-small .ivu-color-picker-color{width:14px;height:14px;top:3px}.ivu-color-picker-small .ivu-color-picker-color-empty i{font-size:14px}.ivu-color-picker-picker-wrapper{padding:8px 8px 0}.ivu-color-picker-picker-panel{width:240px;margin:0 auto;-webkit-box-sizing:initial;box-sizing:initial;position:relative}.ivu-color-picker-picker-alpha-slider,.ivu-color-picker-picker-hue-slider{height:10px;margin-top:8px;position:relative}.ivu-color-picker-picker-colors{margin-top:8px;overflow:hidden;border-radius:2px;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-picker-colors:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-picker-colors-wrapper{display:inline;width:20px;height:20px;float:left;position:relative}.ivu-color-picker-picker-colors-wrapper-color{outline:0;display:block;position:absolute;width:16px;height:16px;margin:2px;cursor:pointer;border-radius:2px;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.ivu-color-picker-picker-colors-wrapper-circle{width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);-ms-transform:translate(-2px,-2px);transform:translate(-2px,-2px);position:absolute;top:10px;left:10px;cursor:pointer}.ivu-color-picker-picker .ivu-picker-confirm{margin-top:8px}.ivu-color-picker-saturation-wrapper{width:100%;padding-bottom:75%;position:relative;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-saturation-wrapper:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-saturation,.ivu-color-picker-saturation--black,.ivu-color-picker-saturation--white{cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0}.ivu-color-picker-saturation--white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(rgba(255,255,255,0)));background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.ivu-color-picker-saturation--black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(rgba(0,0,0,0)));background:linear-gradient(to top,#000,rgba(0,0,0,0))}.ivu-color-picker-saturation-pointer{cursor:pointer;position:absolute}.ivu-color-picker-saturation-circle{width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);-ms-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.ivu-color-picker-hue{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-hue:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-hue-container{cursor:pointer;margin:0 2px;position:relative;height:100%}.ivu-color-picker-hue-pointer{z-index:2;position:absolute}.ivu-color-picker-hue-picker{cursor:pointer;margin-top:1px;width:4px;border-radius:1px;height:8px;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;-webkit-transform:translateX(-2px);-ms-transform:translateX(-2px);transform:translateX(-2px)}.ivu-color-picker-alpha{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-alpha:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-alpha-checkboard-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;border-radius:2px}.ivu-color-picker-alpha-checkerboard{position:absolute;top:0;right:0;bottom:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.ivu-color-picker-alpha-gradient{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px}.ivu-color-picker-alpha-container{cursor:pointer;position:relative;z-index:2;height:100%;margin:0 3px}.ivu-color-picker-alpha-pointer{z-index:2;position:absolute}.ivu-color-picker-alpha-picker{cursor:pointer;width:4px;border-radius:1px;height:8px;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;margin-top:1px;-webkit-transform:translateX(-2px);-ms-transform:translateX(-2px);transform:translateX(-2px)}.ivu-color-picker-confirm{margin-top:8px;position:relative;border-top:1px solid #e8eaec;text-align:right;padding:8px;clear:both}.ivu-color-picker-confirm-color{position:absolute;top:11px;left:8px}.ivu-color-picker-confirm-color-editable{top:8px;right:110px}.ivu-auto-complete .ivu-select-not-found{display:none}.ivu-auto-complete .ivu-icon-ios-close{display:none}.ivu-auto-complete:hover .ivu-icon-ios-close{display:inline-block}.ivu-auto-complete.ivu-select-dropdown{max-height:none}.ivu-auto-complete div,.ivu-auto-complete:focus{outline:0}.ivu-divider{font-family:\"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;font-size:14px;line-height:1.5;color:#515a6e;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;background:#e8eaec}.ivu-divider,.ivu-divider-vertical{margin:0 8px;display:inline-block;height:.9em;width:1px;vertical-align:middle;position:relative;top:-.06em}.ivu-divider-horizontal{display:block;height:1px;width:100%;min-width:100%;margin:24px 0;clear:both}.ivu-divider-horizontal.ivu-divider-with-text-center,.ivu-divider-horizontal.ivu-divider-with-text-left,.ivu-divider-horizontal.ivu-divider-with-text-right{display:table;white-space:nowrap;text-align:center;background:0 0;font-weight:500;color:#17233d;font-size:16px;margin:16px 0}.ivu-divider-horizontal.ivu-divider-with-text-center:after,.ivu-divider-horizontal.ivu-divider-with-text-center:before,.ivu-divider-horizontal.ivu-divider-with-text-left:after,.ivu-divider-horizontal.ivu-divider-with-text-left:before,.ivu-divider-horizontal.ivu-divider-with-text-right:after,.ivu-divider-horizontal.ivu-divider-with-text-right:before{content:'';display:table-cell;position:relative;top:50%;width:50%;border-top:1px solid #e8eaec;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%)}.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-center,.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-left,.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-right{font-size:14px;margin:8px 0}.ivu-divider-horizontal.ivu-divider-with-text-left .ivu-divider-inner-text,.ivu-divider-horizontal.ivu-divider-with-text-right .ivu-divider-inner-text{display:inline-block;padding:0 10px}.ivu-divider-horizontal.ivu-divider-with-text-left:before{top:50%;width:5%}.ivu-divider-horizontal.ivu-divider-with-text-left:after{top:50%;width:95%}.ivu-divider-horizontal.ivu-divider-with-text-right:before{top:50%;width:95%}.ivu-divider-horizontal.ivu-divider-with-text-right:after{top:50%;width:5%}.ivu-divider-inner-text{display:inline-block;padding:0 24px}.ivu-divider-dashed{background:0 0;border-top:1px dashed #e8eaec}.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed{border-top:0}.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed:before,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed:before,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed:before{border-style:dashed none none}.ivu-anchor{position:relative;padding-left:2px}.ivu-anchor-wrapper{overflow:auto;padding-left:4px;margin-left:-4px}.ivu-anchor-ink{position:absolute;height:100%;left:0;top:0}.ivu-anchor-ink:before{content:' ';position:relative;width:2px;height:100%;display:block;background-color:#e8eaec;margin:0 auto}.ivu-anchor-ink-ball{display:inline-block;position:absolute;width:8px;height:8px;border-radius:50%;border:2px solid #2d8cf0;background-color:#fff;left:50%;-webkit-transition:top .2s ease-in-out;transition:top .2s ease-in-out;-webkit-transform:translate(-50%,2px);-ms-transform:translate(-50%,2px);transform:translate(-50%,2px)}.ivu-anchor.fixed .ivu-anchor-ink .ivu-anchor-ink-ball{display:none}.ivu-anchor-link{padding:8px 0 8px 16px;line-height:1}.ivu-anchor-link-title{display:block;position:relative;-webkit-transition:all .3s;transition:all .3s;color:#515a6e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:8px}.ivu-anchor-link-title:only-child{margin-bottom:0}.ivu-anchor-link-active>.ivu-anchor-link-title{color:#2d8cf0}.ivu-anchor-link .ivu-anchor-link{padding-top:6px;padding-bottom:6px}.ivu-time-with-hash{cursor:pointer}.ivu-time-with-hash:hover{text-decoration:underline}.ivu-cell{position:relative;overflow:hidden}.ivu-cell-link,.ivu-cell-link:active,.ivu-cell-link:hover{color:inherit}.ivu-cell-icon{display:inline-block;margin-right:4px;font-size:14px;vertical-align:middle}.ivu-cell-icon:empty{display:none}.ivu-cell-main{display:inline-block;vertical-align:middle}.ivu-cell-title{line-height:24px;font-size:14px}.ivu-cell-label{line-height:1.2;font-size:12px;color:#808695}.ivu-cell-selected .ivu-cell-label{color:inherit}.ivu-cell-selected,.ivu-cell.ivu-cell-selected:hover{background:#f0faff}.ivu-cell-footer{display:inline-block;position:absolute;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%;right:16px;color:#515a6e}.ivu-cell-with-link .ivu-cell-footer{right:32px}.ivu-cell-selected .ivu-cell-footer{color:inherit}.ivu-cell-arrow{display:inline-block;position:absolute;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%;right:16px;font-size:14px}.ivu-cell:focus{background:#f3f3f3;outline:0}.ivu-cell-selected:focus{background:rgba(40,123,211,.91)}.ivu-cell{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cell:hover{background:#f3f3f3}.ivu-cell-focus{background:#f3f3f3}.ivu-cell-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cell-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cell-selected,.ivu-cell-selected:hover{color:#2d8cf0}.ivu-cell-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cell-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cell-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cell-large .ivu-cell{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cell{white-space:normal}}.ivu-drawer{width:auto;height:100%;position:fixed;top:0}.ivu-drawer-inner{position:absolute}.ivu-drawer-left{left:0}.ivu-drawer-right{right:0}.ivu-drawer-hidden{display:none!important}.ivu-drawer-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1000;-webkit-overflow-scrolling:touch;outline:0}.ivu-drawer-wrap-inner{position:absolute;overflow:hidden}.ivu-drawer-wrap-dragging{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-drawer-wrap *{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.ivu-drawer-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1000}.ivu-drawer-mask-hidden{display:none}.ivu-drawer-mask-inner{position:absolute}.ivu-drawer-content{width:100%;height:100%;position:absolute;top:0;bottom:0;background-color:#fff;border:0;background-clip:padding-box;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}.ivu-drawer-content-no-mask{pointer-events:auto}.ivu-drawer-header{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-drawer-header p,.ivu-drawer-header-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-drawer-close{z-index:1;font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-drawer-close .ivu-icon-ios-close{font-size:31px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:1px}.ivu-drawer-close .ivu-icon-ios-close:hover{color:#444}.ivu-drawer-body{width:100%;height:calc(100% - 51px);padding:16px;font-size:14px;line-height:1.5;word-wrap:break-word;position:absolute;overflow:auto}.ivu-drawer-no-header .ivu-drawer-body{height:100%}.ivu-drawer-no-mask{pointer-events:none}.ivu-drawer-no-mask .ivu-drawer-drag{pointer-events:auto}.ivu-drawer-drag{top:0;height:100%;width:0;position:absolute}.ivu-drawer-drag-left{right:0}.ivu-drawer-drag-move-trigger{width:8px;height:100px;line-height:100px;position:absolute;top:50%;background:#f3f3f3;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border-radius:4px/6px;-webkit-box-shadow:0 0 1px 1px rgba(0,0,0,.2);box-shadow:0 0 1px 1px rgba(0,0,0,.2);cursor:col-resize}.ivu-drawer-drag-move-trigger-point{display:inline-block;width:50%;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%)}.ivu-drawer-drag-move-trigger-point i{display:block;border-bottom:1px solid silver;padding-bottom:2px}.ivu-breadcrumb{color:#999;font-size:14px}.ivu-breadcrumb a{color:#515a6e;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-breadcrumb a:hover{color:#57a3f3}.ivu-breadcrumb>span:last-child{font-weight:700;color:#515a6e}.ivu-breadcrumb>span:last-child .ivu-breadcrumb-item-separator{display:none}.ivu-breadcrumb-item-separator{margin:0 8px;color:#dcdee2}.ivu-breadcrumb-item-link>.ivu-icon+span{margin-left:4px}.ivu-list{position:relative}.ivu-list-items{margin:0;padding:0;list-style:none}.ivu-list-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 0}.ivu-list-item-content{color:#515a6e}.ivu-list-item-meta{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;font-size:0}.ivu-list-item-meta-avatar{margin-right:16px}.ivu-list-item-meta-content{-webkit-box-flex:1;-ms-flex:1 0;flex:1 0}.ivu-list-item-meta-title{font-weight:500;margin-bottom:4px;color:#515a6e;font-size:14px;line-height:22px}.ivu-list-item-meta-title>a{color:#515a6e;-webkit-transition:all .2s;transition:all .2s}.ivu-list-item-meta-title>a:hover{color:#2d8cf0}.ivu-list-item-meta-description{color:rgba(0,0,0,.45);font-size:14px;line-height:22px}.ivu-list-item-action{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;margin-left:48px;padding:0;font-size:0;list-style:none}.ivu-list-item-action>li{position:relative;display:inline-block;padding:0 8px;color:rgba(0,0,0,.45);font-size:14px;line-height:22px;text-align:center;cursor:pointer}.ivu-list-item-action>li:after{content:'';position:absolute;top:50%;right:0;width:1px;height:14px;margin-top:-7px;background-color:#e8eaec}.ivu-list-item-action>li:first-child{padding-left:0}.ivu-list-item-action>li:last-child:after{display:none}.ivu-list-header{background:0 0}.ivu-list-footer{background:0 0}.ivu-list-footer,.ivu-list-header{padding-top:12px;padding-bottom:12px}.ivu-list-split .ivu-list-item{border-bottom:1px solid #e8eaec}.ivu-list-split .ivu-list-item:last-child{border-bottom:none}.ivu-list-split .ivu-list-header{border-bottom:1px solid #e8eaec}.ivu-list-split .ivu-list-footer{border-top:1px solid #e8eaec}.ivu-list-large .ivu-list-item{padding-top:16px;padding-bottom:16px}.ivu-list-small .ivu-list-item{padding-top:8px;padding-bottom:8px}.ivu-list-vertical .ivu-list-item{-webkit-box-align:initial;-ms-flex-align:initial;align-items:initial}.ivu-list-vertical .ivu-list-item-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1}.ivu-list-vertical .ivu-list-item-extra{margin-left:40px}.ivu-list-vertical .ivu-list-item-meta{margin-bottom:16px}.ivu-list-vertical .ivu-list-item-meta-title{margin-bottom:12px;color:rgba(0,0,0,.85);font-size:16px;line-height:24px}.ivu-list-vertical .ivu-list-item-action{margin-top:16px;margin-left:auto}.ivu-list-vertical .ivu-list-item-action>li{padding:0 16px}.ivu-list-vertical .ivu-list-item-action>li:first-child{padding-left:0}.ivu-list-item-no-flex{display:block}.ivu-list:not(.ivu-list-vertical) .ivu-list-item-no-flex .ivu-list-item-action{float:right}.ivu-list-bordered{border:1px solid #dcdee2;border-radius:6px}.ivu-list-bordered .ivu-list-header{padding-right:24px;padding-left:24px}.ivu-list-bordered .ivu-list-footer{padding-right:24px;padding-left:24px}.ivu-list-bordered .ivu-list-item{padding-right:24px;padding-left:24px;border-bottom:1px solid #e8eaec}.ivu-list-bordered .ivu-list-pagination{margin:16px 24px}.ivu-list-bordered.ivu-list-small .ivu-list-item{padding-right:16px;padding-left:16px}.ivu-list-bordered.ivu-list-small .ivu-list-footer,.ivu-list-bordered.ivu-list-small .ivu-list-header{padding:8px 16px}.ivu-list-bordered.ivu-list-large .ivu-list-footer,.ivu-list-bordered.ivu-list-large .ivu-list-header{padding:16px 24px}@media screen and (max-width:768px){.ivu-list-item-action{margin-left:24px}.ivu-list-vertical .ivu-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ivu-list-item{-ms-flex-wrap:wrap;flex-wrap:wrap}.ivu-list-item-action{margin-left:12px}.ivu-list-vertical .ivu-list-item{-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}.ivu-list-vertical .ivu-list-item-main{min-width:220px}.ivu-list-vertical .ivu-list-item-extra{margin:auto auto 16px}}"
  },
  {
    "path": "api-test-v2/styles/main.css",
    "content": "html, body {\n  height: 100%;\n  margin: 0;\n  overflow: hidden;\n  padding: 10px; }\n\n.rong-box {\n  height: 100%;\n  overflow: auto; }\n\nh1 {\n  margin-bottom: 20px; }\n\n.rong-hidden {\n  display: none; }\n\n.rong-show {\n  display: block; }\n\n.rong-login .rong-input-form .rong-login-input-item {\n  max-width: 678px; }\n.rong-login .rong-input-form .rong-input-appkey, .rong-login .rong-input-form .rong-input-targetId {\n  max-width: 140px; }\n.rong-login .rong-connect-btn-box {\n  margin-left: 80px; }\n  .rong-login .rong-connect-btn-box button {\n    margin-right: 10px; }\n\n.rong-login-formitem .rong-prompt {\n  display: none;\n  font-size: 13px;\n  margin-left: 10px;\n  color: #484848; }\n\n.rong-login-formitem:hover .rong-prompt {\n  display: inline; }\n\n.rong-user-title {\n  background: #f5f5f5;\n  margin-bottom: 15px; }\n  .rong-user-title h4 {\n    padding: 15px 3px;\n    display: inline-block;\n    margin-right: 13px; }\n\n.rong-global-opt {\n  margin-bottom: 10px; }\n\n.rong-api-list {\n  position: absolute;\n  right: 50px;\n  width: 120px;\n  top: 30px; }\n  .rong-api-list button {\n    margin: 5px 0; }\n\n.rong-api-btn {\n  display: inline-block;\n  margin: 5px; }\n\n.rong-opt-list .rong-ready-box {\n  margin: 5px 0;\n  min-height: 40px; }\n\n.rong-api-btn-box {\n  position: relative; }\n  .rong-api-btn-box .rong-api-btn-set {\n    display: none; }\n  .rong-api-btn-box .rong-api-btn-run {\n    background-color: #2db7f5;\n    color: #fff; }\n  .rong-api-btn-box .rong-api-btn-config {\n    background-color: #47cb89;\n    color: #fff; }\n\n.rong-api-btn-box:active {\n  background-color: #fff;\n  border-color: #dcdee2;\n  color: #515a6e; }\n\n.rong-drag .rong-api-btn-box .rong-api-btn-set {\n  display: none; }\n.rong-drag .rong-api-btn-box .rong-api-btn-name {\n  z-index: 10; }\n\n.rong-tip-params {\n  padding-left: 20px; }\n\n.rong-current-output {\n  color: black;\n  overflow: auto; }\n\n.rong-out-list {\n  position: fixed;\n  right: 15px;\n  width: 200px;\n  top: 20px;\n  bottom: 25px;\n  overflow-y: auto;\n  overflow-x: auto; }\n  .rong-out-list .rong-out-item {\n    overflow-x: auto; }\n    .rong-out-list .rong-out-item p {\n      text-overflow: ellipsis;\n      white-space: nowrap; }\n\n.rong-parse-json-btn {\n  margin-top: 5px; }\n\n.rong-out-list-head {\n  margin-bottom: 7px; }\n\n.rong-json-content {\n  overflow: auto; }\n\n.rong-api-set-item .rong-api-set-name {\n  font-size: 12px; }\n\n.ivu-collapse > .rong-out-panel {\n  color: #19be6b; }\n  .ivu-collapse > .rong-out-panel .ivu-collapse-header {\n    color: inherit; }\n  .ivu-collapse > .rong-out-panel .rong-out-title {\n    position: absolute;\n    left: 35px;\n    right: 0;\n    height: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap; }\n\n.rong-api-btn-link {\n  color: #ff9900; }\n\n.rong-prompt-box button {\n  margin: 5px 2px;\n  font-size: 12px; }\n.rong-prompt-box p {\n  white-space: pre-wrap;\n  word-break: break-all; }\n\n.ivu-tooltip-popper {\n  z-index: 500 !important; }\n\n.rong-out-btn-list {\n  margin: 5px 0; }\n\n.rong-run-sel-prompt {\n  margin: 20px 0 0 5px; }\n\n.rong-api-prompt {\n  font-size: 12px;\n  color: #ff9900;\n  margin: -10px 0 10px 0; }\n\n.rong-out-list-display {\n  display: inline-block; }\n\n.rong-user-title h4 {\n  display: block; }\n\n.get-source {\n  display: none;\n  text-decoration: none;\n  background: #000;\n  color: #fff;\n  padding: 0.6rem 1.3rem;\n  border-radius: 5px;\n  z-index: 10;\n  font-size: 0.8rem;\n  position: relative;\n  margin-left: 1.4rem;\n  position: relative;\n  top: -0.2rem; }\n\n.get-source:hover {\n  color: #e9e9e9; }\n\n@media (min-width: 780px) {\n  .rong-opt-list {\n    padding-right: 300px; }\n\n  .rong-out-list {\n    width: 300px; }\n\n  .rong-user-title h4 {\n    display: inline-block; }\n\n  .rong-out-list-display {\n    display: none; }\n\n  .rong-out-list-content {\n    display: block !important; }\n\n  .get-source {\n    display: inline-block; } }\n.rong-run-info {\n  position: absolute;\n  left: 400px;\n  top: 12px;\n  color: red; }\n\n/*# sourceMappingURL=main.css.map */\n"
  },
  {
    "path": "api-test-v2/styles/main.scss",
    "content": "@charset \"utf-8\";\n// sass-lint:disable nesting-depth\nhtml, body {\n  height: 100%;\n  margin: 0;\n  overflow: hidden;\n  padding: 10px;\n}\n.rong-box {\n  height: 100%;\n  overflow: auto;\n}\nh1 {\n  margin-bottom: 20px;\n}\n\n.rong-hidden {\n  display: none;\n}\n\n.rong-show {\n  display: block;\n}\n\n.rong-login {\n  .rong-input-form {\n    .rong-login-input-item {\n      // width: 50%;\n      max-width: 678px;\n    }\n    .rong-input-appkey, .rong-input-targetId {\n      // width: 10%;\n      max-width: 140px;\n    }\n  }\n  .rong-connect-btn-box {\n    margin-left: 80px;\n    button {\n      margin-right: 10px;\n    }\n  }\n}\n\n.rong-login-formitem {\n  .rong-prompt {\n    display: none;\n    font-size: 13px;\n    margin-left: 10px;\n    color: rgb(72, 72, 72);\n  }\n}\n.rong-login-formitem:hover {\n  .rong-prompt {\n    display: inline;\n  }\n}\n\n.rong-user-title {\n  background: #f5f5f5;\n  margin-bottom: 15px;\n  h4 {\n    padding: 15px 3px;\n    display: inline-block;\n    margin-right: 13px;\n  }\n  // button {\n  //   margin-left: 13px;\n  // }\n}\n\n.rong-global-opt {\n  margin-bottom: 10px;\n}\n.rong-api-list {\n  position: absolute;\n  right: 50px;\n  width: 120px;\n  top: 30px;\n  button {\n    margin: 5px 0;\n  }\n}\n.rong-api-btn {\n  display: inline-block;\n  margin: 5px;\n}\n\n.rong-opt-list {\n  .rong-ready-box {\n    margin: 5px 0;\n    min-height: 40px;\n  }\n  // .rong-api-btn:active {\n  //   .ivu-tooltip-popper {\n  //     display: none;\n  //   }\n  // }\n}\n.rong-api-btn-box {\n  position: relative;\n  .rong-api-btn-set {\n    display: none;\n  }\n  .rong-api-btn-run {\n    background-color: #2db7f5;\n    color: #fff;\n  }\n  .rong-api-btn-config {\n    background-color: #47cb89;\n    color: #fff;\n  }\n  // .rong-api-btn-doc {\n  //   background-color: #47cb89;\n  //   color: #fff;\n  // }\n}\n\n.rong-api-btn-box:active {\n  background-color: #fff;\n  border-color: #dcdee2;\n  color: #515a6e;\n}\n// .rong-api-btn-box:hover {\n//   .rong-api-btn-name {\n//     position: relative;\n//     z-index: -1;\n//   }\n//   .rong-api-btn-set {\n//     position: absolute;\n//     left: 0;\n//     top: 0;\n//     height: 100%;\n//     width: 100%;\n//     display: inline-block;\n//     border: none;\n//     padding: none;\n//     font-size: 12px;\n//     z-index: 100;\n//     button {\n//       width: 50%;\n//       height: 100%;\n//       border: none;\n//       cursor: pointer;\n//     }\n//   }\n// }\n\n.rong-drag .rong-api-btn-box {\n  .rong-api-btn-set {\n    display: none;\n  }\n  .rong-api-btn-name {\n    z-index: 10;\n  }\n}\n\n.rong-tip-params {\n  padding-left: 20px;\n}\n\n.rong-current-output {\n  color: black;\n  overflow: auto;\n}\n\n.rong-out-list {\n  position: fixed;\n  right: 15px;\n  width: 200px;\n  top: 20px;\n  bottom: 25px;\n  overflow-y: auto;\n  overflow-x: auto;\n  .rong-out-item {\n    overflow-x: auto;\n    p {\n      text-overflow:ellipsis;\n      white-space:nowrap;\n    }\n  }\n}\n\n.rong-parse-json-btn {\n  margin-top: 5px;\n}\n\n.rong-out-list-head {\n  margin-bottom: 7px;\n}\n.rong-json-content {\n  overflow: auto;\n}\n\n.rong-api-set-item {\n  .rong-api-set-name {\n    font-size: 12px;\n  }\n}\n.ivu-collapse>.rong-out-panel {\n  color: #19be6b;\n  .ivu-collapse-header {\n    color: inherit;\n  }\n  .rong-out-title {\n    position: absolute;\n    left: 35px;\n    right: 0;\n    height: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n}\n\n.rong-api-btn-link {\n  color: #ff9900;\n}\n\n.rong-prompt-box {\n  button {\n    margin: 5px 2px;\n    font-size: 12px;\n  }\n  p {\n    white-space: pre-wrap;\n    word-break: break-all;\n  }\n}\n\n.ivu-tooltip-popper {\n  z-index: 500 !important;\n}\n\n.rong-out-btn-list {\n  margin: 5px 0;\n}\n\n.rong-run-sel-prompt {\n  margin: 20px 0 0 5px;\n}\n\n.rong-api-prompt {\n  font-size: 12px;\n  color: #ff9900;\n  margin: -10px 0 10px 0;\n}\n\n.rong-out-list-display {\n  display: inline-block;\n}\n\n.rong-user-title h4 {\n  display: block;\n}\n\n.get-source {\n  display: none;\n  text-decoration: none;\n  background: #000;\n  color: #fff;\n  padding: 0.6rem 1.3rem;\n  border-radius: 5px;\n  z-index: 10;\n  font-size: 0.8rem;\n  position: relative;\n  margin-left: 1.4rem;\n  position: relative;\n  top: -0.2rem;\n}\n.get-source:hover {\n  color: rgb(233, 233, 233);\n}\n\n@media (min-width: 780px) {\n  .rong-opt-list {\n    padding-right: 300px;\n  }\n  .rong-out-list {\n    width: 300px;\n  }\n  .rong-user-title h4 {\n    display: inline-block;\n  }\n  .rong-out-list-display {\n    display: none;\n  }\n  .rong-out-list-content {\n    display: block !important;\n  }\n  .get-source {\n    display: inline-block;\n  }\n}\n\n.rong-run-info {\n  position: absolute;\n  left: 400px;\n  top: 12px;\n  color: red;\n}"
  },
  {
    "path": "api-test-v4/README.md",
    "content": "# api-test\n"
  },
  {
    "path": "api-test-v4/config.js",
    "content": "(function (win) {\n\n  var isDebug = false;\n\n  var im = {\n    appkey: 'n19jmcy59f1q9',\n    token: 'Kn2p4uokgY5AZOFVsKTbKq+YsUIoF3ojin3K277sfOnEb+B6ZpahsTOCVisdS43pwz7SnsSF0xxiLfygEojZP7ywLi39+nOPq12llTIt1oc=',\n    navi: '',\n    targetId: 'api_test_target',\n    customCMP: '',\n    isPolling: false,\n  };\n\n  if (!isDebug) {\n    delete im.cmpUrl;\n  }\n\n  var config = {\n    im: im,\n    isDebug: isDebug,\n    debugConf: {\n      autoRun: false,\n      isShowMsg: false\n    }\n  };\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM = {\n    config: config,\n    components: {}\n  };\n\n})(window);"
  },
  {
    "path": "api-test-v4/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=0.1\">\n  <!-- <meta name=\"viewport\" content=\"width=device-width target-densitydpi=device-api\"/>  -->\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n\n  <title>Api Test V4</title>\n  \n  <link rel=\"stylesheet\" href=\"./lib/styles/iview.css\">\n  <!-- <link rel=\"stylesheet\" href=\"./lib/styles/dragula-3.7.2.css\"> -->\n  <link rel=\"stylesheet\" href=\"./styles/main.css\">\n  \n  <!-- <script src=\"//mstatic.secooimg.com/activity2018/js/sdk/weixin.sdk1.3.2.js\"></script> -->\n  <script src=\"./lib/js/vue-2.6.10.js\"></script>\n  <script src=\"./lib/js/iview-4.0.2.min.js\"></script>\n  <script src=\"./lib/js/vue-json-pretty.js\"></script>\n  <script src=\"./lib/js/es6-promise.js\"></script>\n  <script src=\"./lib/js/Sortable.min.js\"></script>\n  <script src=\"./lib/js/vuedraggable.umd.min.js\"></script>\n\n  <script src=\"https://cdn.ronghub.com/RongIMLib-4.2.latest.js\"></script>\n  <script src=\"./config.js\"></script>\n  <script src=\"./js/common/utils.js\"></script>\n  <script src=\"./js/common/service.js\"></script>\n  <script src=\"./js/common/api-list.js\"></script>\n\n  <script id=\"rong-global-config\" type=\"text/x-template\">\n    <div class=\"rong-login\">\n      <i-form :label-width=\"80\" class=\"rong-input-form\">\n        <FormItem class=\"rong-login-formitem\" v-for=\"item in configList\" v-bind:key=\"item.name\" :label=\"item.name\">\n          <i-input class=\"rong-login-input-item\" :class=\"'rong-input-' + item.name\" v-if=\"item.type === 'string'\" v-model=\"config[item.name]\" type=\"text\" :placeholder=\"prompt[item.name] || item.name\" />\n          <i-switch v-else-if=\"item.type === 'boolean'\" v-model=\"config[item.name]\" />\n          <span class=\"rong-prompt\" v-if=\"prompt[item.name]\">{{prompt[item.name]}}</span>\n        </FormItem>\n        <div class=\"rong-connect-btn-box\">\n          <i-button @click=\"login(config)\" type=\"primary\">开始链接</i-button>\n          <i-button @click=\"clearStorage()\" type=\"warning\">清空缓存</i-button>\n        </div>\n      </i-form>\n    </div>\n  </script>\n\n  <script id=\"rong-tpl-apibtn\" type=\"text/x-template\">\n    <div class=\"rong-api-btn\" :value=\"apiValue\">\n      <Tooltip placement=\"bottom\" :transfer=\"true\" :disabled=\"isdragging\">\n        <i-button class=\"rong-api-btn-box\" size=\"small\" @click=\"run()\">\n          <span class=\"rong-api-btn-name\">{{selfApi.name}}</span>\n          <!-- <div class=\"rong-api-btn-set\">\n            <button class=\"rong-api-btn-run\" @click=\"run()\">运行</button\n            ><button class=\"rong-api-btn-config\" @click=\"showEditDialog()\">设置</button\n            >\n          </div> -->\n        </i-button>\n        <div slot=\"content\" class=\"rong-prompt-box\">\n            <i-button v-if=\"hasParams\" size=\"small\" type=\"info\" @click=\"showEditDialog()\">修改配置</i-button>\n            <i-button size=\"small\" type=\"success\" @click=\"openUrl(selfApi.doc)\">查看文档</i-button>\n            <!-- <p><a class=\"rong-api-btn-link\" :href=\"selfApi.doc\" target=\"_blank\">点击查看文档</a></p>\n            <p><a class=\"rong-api-btn-link\" :href=\"selfApi.doc\" target=\"_blank\">点击配置参数</a></p> -->\n            <p>方法: {{selfApi.eventName}}</p>\n            <p>描述: {{selfApi.desc}}</p>\n            <p v-if=\"hasParams\">参数:</p>\n            <ul class=\"rong-tip-params\">\n              <li v-for=\"param in selfApi.params\" v-bind:key=\"param.name\">\n                {{param.name}} ({{param.type}})\n              </li>\n            </ul>\n        </div>\n      </Tooltip>\n\n      <Modal v-model=\"isShowEditDialog\" draggable scrollable title=\"参数设置\" width=\"395\">\n        <i-form :label-width=\"90\">\n          <FormItem v-for=\"param in paramList\" v-bind:key=\"param.name\" :label=\"param.name\" class=\"rong-api-set-item\">\n            <i-input v-if=\"param.type === 'string'\" v-model=\"param.value\" type=\"text\" :placeholder=\"param.name\" />\n            <i-input v-else-if=\"param.type === 'number'\" v-model=\"param.value\" type=\"number\" :placeholder=\"param.name\" />\n            <i-switch v-else-if=\"param.type === 'boolean'\" v-model=\"param.value\" @on-change=\"change\" />\n          </FormItem>\n        </i-form>\n        <div slot=\"footer\">\n            <i-button type=\"success\" @click=\"run()\">运行</i-button>\n            <i-button type=\"primary\" @click=\"hideEditDialog()\">确定</i-button>\n        </div>\n      </Modal>\n\n    </div>\n  </script>\n\n  <script id=\"rong-json-alert\" type=\"text/x-template\">\n    <Modal class=\"rong-json-alert\" v-model=\"isShow\">\n      <prettyjson class=\"rong-json-content\" :showLength=\"true\" :highlight-mouseover-node=\"true\" selectable-type=\"single\" :path=\"'res'\" :data=\"data\">\n      </prettyjson>\n      <div slot=\"footer\">\n          <i-button type=\"primary\" @click=\"hide()\">确定</i-button>\n      </div>\n    </Modal>\n  </script>\n\n  <script id=\"rong-tpl-expansion\" type=\"text/x-template\">\n    <div class=\".rong-api-btn\">\n      <i-button type=\"primary\" @click=\"openModal1\">显示对话框</i-button>\n      <Modal :visible.sync=\"true\" draggable scrollable title=\"普通的Modal对话框标题\">\n        <p>对话框内容</p>\n        <p>对话框内容</p>\n        <p>对话框内容</p>\n      </Modal>\n    </div>\n  </script>\n\n  <script src=\"./js/components/button.js\"></script>\n  <script src=\"./js/components/json-alert.js\"></script>\n  <script src=\"./js/components/msg-expansion.js\"></script>\n  <script src=\"./js/login.js\"></script>\n</head>\n<body>\n  <div id=\"app\" class=\"rong-box rong-hidden\" :class=\"{ 'rong-drag': isDragging, 'rong-show': 1  }\">\n\n    <h1>\n      Web SDK Demo\n      <a target=\"_blank\" href=\"https://github.com/rongcloud/websdk-demo/blob/master/api-test.html\" title=\"点击查看源码\" class=\"get-source\">示例源码</a>\n    </h1>\n    \n    <template v-if=\"isLogged\">\n      <div class=\"rong-run-info\" v-if=\"isDebug\">\n        <p>成功次数: <b>{{runInfo.runCount}}</b></p>\n        <p>成功 Api 个数: <b>{{runInfo.successApiCount}}</b></p>\n        <p>失败 Api 个数: <b>{{runInfo.failApiList.length}}</b></p>\n      </div>\n\n      <!-- <div class=\"rong-global-opt\">\n        <i-button class=\"rong-runall-btn\" size=\"small\" @click=\"runAllApi()\">运行全部</i-button>\n      </div> -->\n      <div class=\"rong-msg-expansion\" v-if=\"openMsgEx\">\n        <p class=\"rong-ex-title\">消息扩展存储</p>\n        <div id=\"rong-ex-content\" class=\"rong-expansion-content\"></div>\n        <div class=\"rong-ex-input\">\n          <i-input v-show=\"exData.showId\" v-model=\"exData.targetId\" size=\"small\" placeholder=\"请输入目标 ID\" style=\"margin-bottom: 6px;\"></i-input>\n          <i-input v-show=\"exData.showUId\" v-model=\"exData.msgUId\" size=\"small\" placeholder=\"请输入 MessageUId\" style=\"margin-bottom: 6px;\"></i-input>\n          <i-input v-show=\"exData.showKey\" v-model=\"exData.msgKeys\" size=\"small\" placeholder=\"请输入 Key,多个以英文逗号分隔\" type=\"textarea\" style=\"margin-bottom: 6px;\"></i-input>\n          <i-input v-show=\"exData.showVal\" v-model=\"exData.msgValues\" size=\"small\" placeholder=\"请输入 Value,多个以英文逗号分隔\" type=\"textarea\" style=\"margin-bottom: 6px;\"></i-input>\n          <i-input v-show=\"exData.showMsg\" v-model=\"exData.msgContent\" size=\"small\" placeholder=\"请输入 Message\" style=\"margin-bottom: 6px;\"></i-input>\n          <i-button v-show=\"exData.showInputBtn\" type=\"primary\" size=\"small\" @click=\"exConfirm\">确定</i-button>\n          <i-button v-show=\"exData.showInputBtn\" type=\"primary\" size=\"small\" @click=\"exCancel\">取消</i-button>\n        </div>\n        <div class=\"rong-ex-join\" v-if=\"exData.joinBtn\">\n          <i-button type=\"primary\" size=\"small\" @click=\"exJoin(3)\">加入群组</i-button>\n          <i-button type=\"primary\" size=\"small\" @click=\"exJoin(1)\">加入单聊</i-button>\n        </div>\n        <div class=\"rong-ex-opt\" v-if=\"exData.setBtn\">\n          <i-button type=\"primary\" size=\"small\" @click=\"setKey\">设置 Key</i-button>\n          <i-button type=\"primary\" size=\"small\" @click=\"delKey\">删除 Key</i-button>\n          <Checkbox v-model=\"exData.canIncludeExpansion\">可扩展</Checkbox>\n          <!-- <i-button type=\"primary\" size=\"small\" @click=\"delAllKey\">删除所有 Key</i-button> -->\n          <!-- <i-button type=\"primary\" size=\"small\" @click=\"getList\">获取历史消息</i-button>\n          <i-button type=\"primary\" size=\"small\" @click=\"sendMsg\" style=\"margin-top: 6px;\" >发送消息</i-button> -->\n        </div>\n      </div>\n      <div class=\"rong-user-title\">\n        <h4>当前用户 id： {{currentUserId}}</h4>\n        <i-button class=\"rong-runall-btn\" size=\"small\" @click=\"isShowRunType=true\">运行全部</i-button>\n        <components class=\"rong-changeuser-btn\" is=\"apiBtn\"\n          :api=\"changeUserApi\" :isdragging=\"isDragging\"></components>\n          \n        <i-button v-if=\"isDebug\" class=\"rong-runall-btn\" size=\"small\" type=\"error\" @click=\"isAlarmMuted=!isAlarmMuted\">{{ isAlarmMuted ? '取消静音' : '点击静音' }}</i-button>\n      </div>\n\n      <p class=\"rong-api-prompt\">\n        <b>注:</b>\n        <span>以下 Api 按钮可拖拽移动顺序, 点击运行全部按钮, 按当前展示顺序运行 Api</span>\n      </p>\n\n      <div class=\"rong-opt-list\">\n          <i-button v-show=\"false\" size=\"small\" type=\"info\" @click=\"showMsgExpansion()\">消息扩展</i-button>\n          <div v-for=\"(readyList, index) in readyApiQueue\" v-bind:key=\"readyList.id\" class=\"rong-ready-box\">\n            <draggable :list=\"readyList\" group=\"people\" @start=\"startDragging()\" @end=\"isDragging=false\">\n                <!-- <span>{{index + 1}}</span> -->\n                <components :ref=\"'readyApi' + index\" v-for=\"api in readyList\" v-bind:key=\"api.name\" class=\"rong-ready-btn\" is=\"apiBtn\" :api=\"api\" :isdragging=\"isDragging\"></components>\n            </draggable>\n          </div>\n      </div>\n      \n      <div class=\"rong-current-output\" v-if=\"currentOutput\">\n        <p><b>{{currentOutput.title}}</b></p>\n        <p><b>耗时:</b> {{currentOutput.consumedTime}} ms</p>\n        <p><b>参数:</b> {{toJSON(currentOutput.params)}}</p>\n        <template v-if=\"currentOutput.result\">\n          <p><b>返回值:</b></p>\n          <prettyjson :showLength=\"true\" :highlight-mouseover-node=\"true\" selectable-type=\"single\" :path=\"'res'\"\n            :data=\"currentOutput.result\"></prettyjson>\n        </template>\n      </div>\n      \n      <!-- <div class=\"rong-api-list\">\n        <components class=\"rong-api-source\" v-for=\"api in apiList\" v-bind:key=\"api.name\" is=\"apiBtn\" :api=\"api\"></components>\n      </div> -->\n      \n      <div class=\"rong-out-list\">\n        <div class=\"rong-out-list-head\">\n          <h4>调用结果如下:</h4>\n          <div class=\"rong-out-btn-list\">\n            <i-button size=\"small\" @click=\"clearOutput()\">清空</i-button>\n            <i-button size=\"small\" @click=\"showAllOutput()\">显示全部</i-button>\n            <i-button class=\"rong-out-list-display\" size=\"small\" @click=\"isShowOutList=!isShowOutList\">{{ isShowOutList ? '隐藏' : '展开' }}</i-button>\n          </div>\n        </div>\n        <Collapse class=\"rong-out-list-content\" v-if=\"displayedOutputList.length\" v-show=\"isShowOutList\">\n          <Panel v-for=\"(output, index) in reverse(displayedOutputList)\" class=\"rong-out-panel\" v-bind:key=\"output.id\" :name=\"index + ''\" :style=\"{ color: output.config.color }\">\n            <span :title=\"output.title\" class=\"rong-out-title\">{{displayedOutputList.length - index}}. {{output.title}}</span>\n            <div slot=\"content\" class=\"rong-out-item\">\n              <p><b>时间:</b> {{output.time}}</p>\n              <p v-if=\"output.consumedTime\"><b>耗时:</b> {{output.consumedTime}} ms</p>\n              <p v-if=\"output.params && output.params.length\"><b>参数:</b> {{toJSON(output.params)}}</p>\n              <p v-if=\"output.result\"><b>返回值:</b> {{toJSON(output.result)}}</p>\n              <i-button v-if=\"output.result\" class=\"rong-parse-json-btn\" size=\"small\" type=\"primary\" @click=\"showJSONAlert(output.result)\">点击解析返回值\n              </i-button>\n            </div>\n          </Panel>\n        </Collapse>\n      </div>\n\n    </template>\n\n    <components v-else is=\"login\" :login=\"login\" :config=\"globalConfig\"></components>\n\n    <Modal v-model=\"isShowRunType\" draggable scrollable title=\"运行方式\" width=\"395\">\n      <i-form :label-width=\"90\">\n          <i-select v-model=\"runType\">\n            <i-option v-for=\"opt, key in RunType\" v-bind:key=\"key\" :value=\"key\">{{opt.name}}</i-option>\n          </i-select>\n          <p class=\"rong-run-sel-prompt\">\n            <b>提示:</b>\n            <span>{{RunType[runType].prompt}}</span>\n          </p>\n      </i-form>\n      <div slot=\"footer\">\n        <i-button type=\"success\" @click=\"runAllApi();isShowRunType=false;\">运行</i-button>\n      </div>\n    </Modal>\n\n    <audio ref=\"alarm\" style=\"opacity: 0; position: absolute;\" src=\"./styles/alarm.mp3\"></audio>\n\n  </div>\n</body>\n\n<script src=\"./js/main.js\"></script>\n\n</html>"
  },
  {
    "path": "api-test-v4/js/common/api-list.js",
    "content": "(function (win, dependencies) {\n  var RongIMLib = win.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient;\n\n  var RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    Service = RongIM.Service,\n    config = RongIM.config.im,\n    urlQueryConfig = utils.getUrlQuery();\n\n  var MiniUnSupportEventList = [\n    'sendRecallMessage', 'deleteRemoteMessages', 'clearRemoteHistoryMessages'\n  ];\n\n  var getConnectedTime = {\n    name: '连接时间',\n    event: Service.getConnectedTime,\n    eventName: 'getConnectedTime',\n    desc: '断开链接',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/connection/connect/web.html',\n    params: []\n  }\n\n  var disconnect = {\n    name: '断开链接',\n    event: Service.disconnect,\n    eventName: 'disconnect',\n    desc: '断开链接',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/connection/disconnect/web.html',\n    params: []\n  };\n\n  var reconnect = {\n    name: '重新链接',\n    event: Service.reconnect,\n    eventName: 'reconnect',\n    desc: '重新链接',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/private/connection/reconnect/web3.html',\n    params: [\n      // { name: '是否嗅探', type: 'boolean', value: true },\n      // { name: '嗅探 url', type: 'string', value: 'https://cdn.ronghub.com/RongIMLib-2.2.6.min.js?d=' + Date.now() },\n      // { name: '嗅探频率', type: 'string', value: '100,1000,3000,3000,3000' }\n    ]\n  };\n\n  var changeUser = {\n    name: '切换用户',\n    evnet: utils.noop,\n    eventName: 'logout',\n    desc: '切换用户',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/connection/disconnect/web.html#logout',\n    params: [\n      { name: 'Token', type: 'string', value: '5JQlp5czM31GNl99DOZyI3xpRjANxKgfakOnYLFljI+TMvOF0hGaVtR1n9Qp4baLgKBGsyl3w5j4gAWBbNZ3nOKrvnVo8Ldl' }\n    ]\n  };\n\n  var registerMessage = {\n    name: '注册自定义消息',\n    event: Service.registerMessage,\n    eventName: 'registerMessageType',\n    desc: '注册自定义消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#createcustom',\n    params: [\n      { name: 'messageType', type: 'string', value: 's:person' },\n      { name: '是否存储', type: 'boolean', value: true },\n      { name: '是否计数', type: 'boolean', value: true },\n      { name: '属性', type: 'string', value: 'name,age' },\n    ]\n  };\n\n  var sendRegisterMessage = {\n    name: '发送自定义消息',\n    event: Service.sendRegisterMessage,\n    eventName: 'conversation.send',\n    desc: '发送自定义消息(RegisterMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#createcustom',\n    params: [\n      { name: '消息类型', type: 'string', value: 's:person' },\n      { name: '属性值', type: 'string', value: 'name,age' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var getConversationList = {\n    name: '获取会话列表',\n    event: Service.getConversationList,\n    eventName: 'im.Conversation.getList',\n    desc: '获取会话列表',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/getall/web.html',\n    params: [\n      { name: '数量', type: 'number', value: 1000 },\n      { name: '时间戳', type: 'number', value: 0 },\n      { name: '时间戳前/后', type: 'number', value: 0 }\n    ]\n  };\n\n  var removeConversation = {\n    name: '删除会话列表',\n    event: Service.removeConversation,\n    eventName: 'conversation.destory',\n    desc: '删除会话列表',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/clear/web.html',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getHistoryMessages = {\n    name: '获取历史消息',\n    event: Service.getHistoryMessages,\n    eventName: 'conversation.getMessages',\n    desc: '获取历史消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/storage/web.html',\n    params: [\n      { name: '时间戳', type: 'number', value: 0 },\n      { name: '数量', type: 'number', value: 20 },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setConversationStatus = {\n    name: '设置会话状态',\n    event: Service.setConversationStatus,\n    eventName: 'conversation.setStatus',\n    desc: '设置会话状态',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/top/web.html',\n    params: [\n      { name: '免打扰', type: 'number', value: 1 },\n      { name: '置顶', type: 'boolean', value: true },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var deleteRemoteMessages = {\n    name: '删除历史消息(按消息)',\n    event: Service.deleteRemoteMessages,\n    eventName: 'conversation.deleteMessages',\n    desc: '按消息删除指定历史消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/delete/web.html#deletebyid',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '消息方向', type: 'number', value: 1, event: Service.getLastCacheMsgDirection },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var clearHistoryMessages = {\n    name: '删除历史消息(按时间)',\n    event: Service.clearHistoryMessages,\n    eventName: 'conversation.clearMessages',\n    desc: '按时间删除历史消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/delete/web.html#delete',\n    params: [\n      { name: '删除时间戳', type: 'number', value: Date.now()  },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var sendTextMessage = {\n    name: '发送文字消息',\n    event: Service.sendTextMessage,\n    eventName: 'conversation.send',\n    desc: '发送文字消息(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#TxtMsg',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文字消息' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '状态消息', type: 'boolean', value: false },\n      { name: '静默消息', type: 'boolean', value: false },\n      { name: '支持扩展', type: 'boolean', value: false },\n      { name: '扩展Key', type: 'string', value: 'key1' },\n      { name: '扩展Value', type: 'string', value: 'val1' }\n    ]\n  };\n\n  var sendImageMessage = {\n    name: '发送图片消息',\n    event: Service.sendImageMessage,\n    eventName: 'conversation.send',\n    desc: '发送图片消息(ImageMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#ImgTextMsg',\n    params: [\n      { name: '缩略图', type: 'string', value: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCABkAPADASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAECAwQGBwX/xAA7EAABAwEHAQYDBQcFAQAAAAABAAIDEQQFEiExUZETFiJBVGHRI3GTBhSBobEVM1Ji4fDxJEJDU3LB/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAEDAv/EABwRAQEBAQACAwAAAAAAAAAAAAABEwIRMQNRYf/aAAwDAQACEQMRAD8ArBct7wBwbZWkOoc5G5EaHVSLnvoRCIQgNAoO+2ozrrVdY9tpNoqx7BDQZeNc/TTMceqwMivFrm4p43NqcVRmR4Uy11/Jb638ZZxzxu6/nPL3QtJJqQSyhOeo08StR/2dvV7sX3YVJqfiN912NLYZ8TSwREjuu1A/DxOfj4D1Wdgko3GW1/3UGvyU2s+jOVxTbivhgAbCQ2tadVtP1UTXBe81S6zguIp+8b7rsZ22rrNdA+PAKVa/x1r/APFEf3t9mlEmCObMRluY0yPj4qb9efRnHIw3HfEDsUdnaDUGpcw0/NQ+4b2eBis4y0+I33XUGG8uqCLVH0w5hphzIqMQ02r/AEWeZlqM7XQyNEWGjmkamvyXW3X4Zxhu2yPjueGy2hpa4No4A6Z7hbENlihdiZUHxO6iyNtLICLU8PlrkQcv0H6LXskF4iOMWq1MxtcC4xtBxCmmYyWNnm+Xb4l+XNb7Xess8EAdG4NocbRoBuVrfsi++/8ACpjbhdSRoqKU3XaItJ8tk8Ob8ct8uD7OXriB+7DT/sb7rajuu/Y8GGIdymGr2GlPmf7ouyRXbr6Mo4R32dvUkH7tXOp+I33WWO5b5iaAyGgDsQ+I3I8+i7ZE26Mo4WX7P3tIHE2epIP/ACN91qdl748qPqM916KibdGceddl748qPqM907L3x5UfUZ7r0VFNujOPOuy98eVH1Ge6dl748qPqM916KibdGceddl748qPqM907L3x5UfUZ7r0VE26M4867L3x5UfUZ7p2Xvjyo+oz3XoqJt0Zx512Xvjyo+oz3TsvfHlR9RnuvRUTbozjzrsvfHlR9RnunZe+PKj6jPdeiom3RnGV0UTRV2Q3Liqn7sK1ezLXv/P19DwrytbKzCXkA/wAJodKLAbFCS49SSrjUnH8+NSs2jJMLPBC+aU4Y4wXOcScgNVVr7I5xa2VhcDhID866U1V5YYp7NJZ5u/HI0tcCaVB10Wsy6bAy0/eBH8Tu5l5NS2tCc8zmcz7oMjJ7C9mNs8Zbv1P6qRLYnFwE0dWOLXfE0I1Gqwtue7mTGZkDWyurV7XkE1BGtdiomua7Z3h8sAe5shkDi91Q4nEaZ6Vzpog2OpZC9jBI0uecLQHE1NCf0B4UdSx4XO6rMLa4j1NKGh8d8lSz3XYbNKJIYg1weZK4ye8QRXX+Z3KC67CBJSL96AH/ABHZ0pTx9Px8UGQyWNpAMrAXEAfE1rSnj6hYHXhdjBMXWqL4BAk75OAkkUPrUFP2NdvUhk6Axw06Zxu7tKU8fQfnuU/Y120nHQAFofjlAe4YzUnPPcnJBW0Xnddm6vWtLWdJwa+pd3Sa0H5HhTJeF3RMe983djNHuAcQ3XWn/k8KZbnu+ZsrXxEiZ2N9JXCpz9ch3nZaZlXddtifHJGY+5IHB4xuzxYq+P8AO7n0CDHaLwu6yyOZPKWOa0OILX6EgA8kBS233a6EzC0MwBodUuIyJoMvmNFe13bY7aXG0Nc7FStJXN0II0O4Cwm4rrNKwVoMNeq7eu+Z9UFo7wuyQAstLHVoBRx8cgrMtl3vja8TDA4E4iSAKEg1rpmDqsYuK6w0tFnGEginUdTP8dchn4UCvFc9ggjayJj2taSRSd9RWtc6+p5QXbarC9jnslxsa0vLm4iKfMf3rskNpsU72sic9znad14/XRY3XNd7nRudG9zowQwumeSAdfFZIrssUNrbamNf1m1o4zPOuuRNP8DZBs9GPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIKdGPY8lOjHseSr4huExDcIMi15rbZoOp1ZWt6YxOr4DdZzqFozXfd8tqklmaHTSt6bwZD3hTSlaaBQXlvOxQsc+S0Na1oBcTXKulVtNcHtDmmoIqCtEXZdtphdSJsrH4QTjLqhtKCtdMhkt5rQxoa3QCgQWREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQQdQtK0ywtklbJG5+VXVc0DT1K3TqFpTtvA2z4Do2WfDSrhU13UqVe7HQvsgfA1zWOOKjnYjnnrUrbWGzdbpf6jDjrXu6D0/DT8FmSeiehERVRERAREQEREBERAREQEREBERAREQEREBERAREQEREEEE6GiijtxwpPgtG02W2yzSGK2GONwoG0zbpmDz+SDdo7ccJR244URtc2Noe7E4DN1KVVkEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQRR244SjtxwpRBFHbjhKO3HClEEUduOEo7ccKUQD4Ii07VLbmOlFngY8BowEnU8oNxF8ya0XuC8RWSI4Wijia4jlWgqNM9f87mKfrMBADKd70OWn5oM6LFG6Qvo4CnzWVAREQEREBERAREQEREBERAREQEREBERAREQEREBERAOoUoiAiIgIiIC+VaLymiksrWtjImjxuqDkaeGaIgXfeU1qbZS9sY6wcXYQcqGmWazR22R0sTS1lHuAOR/gr+qIg30REBERAREQEREBERAREQEREBERAREQEREH//Z' },\n      { name: '原图 url', type: 'string', value: 'https://nfsprodrcx.cn.ronghub.com/v3/BGSPKH501EG0K6MI/base64.png?token=Um9uZ2Nsb3VkMTQyMDIwMDMxNzAzMzk1OTM2MDBtZXNzYWdlOzs7MjczMTk5NDg4OA==' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendFileMessage = {\n    name: '发送文件消息',\n    event: Service.sendFileMessage,\n    eventName: 'conversation.send',\n    desc: '发送文件消息(FileMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#FileMsg',\n    params: [\n      { name: '文件名', type: 'string', value: 'logo_wx' },\n      { name: '文件大小', type: 'number', value: 20000 },\n      { name: '文件类型', type: 'string', value: 'png' },\n      { name: '文件 url', type: 'string', value: 'http://rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendVoiceMessage = {\n    name: '发送语音消息',\n    event: Service.sendVoiceMessage,\n    eventName: 'conversation.send',\n    desc: '发送语音消息(HQVoiceMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#HQVCMsg',\n    params: [\n      { name: '语音 url', type: 'string', value: 'https://rongcloud-audio.cn.ronghub.com/audio_amr__RC-2020-03-17_42_1584413950049.aac?e=1599965952&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:CDngyWj7ZApNmAfoecng7L_3SaU=' },\n      { name: '语音类型', type: 'string', value: 'aac' },\n      { name: '语音时长', type: 'number', value: 6 },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendRecallMessage = {\n    name: '发送撤回消息',\n    event: Service.sendRecallMessage,\n    eventName: 'conversation.recall',\n    desc: '发送撤回消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgrecall/web.html',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendAtMessage = {\n    name: '发送 @ 消息',\n    event: Service.sendAtMessage,\n    eventName: 'conversation.send',\n    desc: '发送 @ 消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/group/msgmanage/msgsend/web.html#at',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文本消息, 我 @ 了其他人' },\n      { name: '@ 对象 id', type: 'string', value: config.targetId },\n      { name: '会话类型', type: 'number', value: 3 },\n      { name: '群组 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendAtMessageByErrorParamField = {\n    name: '发送 @ 消息 ErrorParams',\n    event: Service.sendAtMessageByErrorParamField,\n    eventName: 'sendMessage',\n    desc: '发送 @ 消息',\n    doc: 'https://docs.rongcloud.cn/v3/views/im/noui/guide/group/msgmanage/msgsend/web3.html#at',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条文本消息, 我 @ 了其他人' },\n      { name: '@ 对象 id', type: 'string', value: config.targetId },\n      { name: '会话类型', type: 'number', value: 3 },\n      { name: '群组 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendLocationMessage = {\n    name: '发送位置消息',\n    event: Service.sendLocationMessage,\n    eventName: 'conversation.send',\n    desc: '发送位置消息(sendLocationMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#LBSMsg',\n    params: [\n      { name: '位置缩略图', type: 'string', value: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABsSFBcUERsXFhceHBsgKEIrKCUlKFE6PTBCYFVlZF9VXVtqeJmBanGQc1tdhbWGkJ6jq62rZ4C8ybqmx5moq6T/2wBDARweHigjKE4rK06kbl1upKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKT/wAARCADwAZgDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAIDAQQF/8QAQRAAAgIBAwEFBQQIBAUFAQAAAQIAAxEEEiExEzJBUXEUImGBkQVSobEVIzNCU2LB0TRykuEkVXOi8ENjZJOkZf/EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/8QAHxEBAQEBAQACAwEBAAAAAAAAAAERAjEhQQMTcRIy/9oADAMBAAIRAxEAPwD3YQhKohCEAhCEAhCEAhCbtbyP0gZCNtb7phsbygLCaVI6iZAIQm9TiBkYIx8MesYKEG5jFZyenAgN2YHVofqx8ZOECm5B0X8IdqPBZOEYKdr/AC/jN9x/gZKEYGZCvxEWOLCOvIjYVxxwYCMLRUDTs3k/v5xj5TnX7RCUhr1O7cVIQeI9Z2rwoE8rU0sbLqzXdtNm9WRNw5HM3xJfii/6W0/3LPoP7zpWxb6FtUEA8jPWeR7J/Lqf/o/3nsVKE0iKAQAgHIwZe+eZ4EhCE5ghCEAl5CWHSSjG7p9I8WancHpIjB4j4xLn7Opn8QOPWMSAxyfjAtwdpBOOBmFjmyXoZAVKL7u9j1OOfzhTZvVHLuzYHCr/AF/3hWMUEMVJCn3scA+vnEV2XvBxXncCAeT5emZt0d0IiPlFLYDEcjym7l85hzavfPpNfoD8YoILjHlGfuH6wghCEKJJuplZJu8ZYzWQhCVGQhNAJ6CG2Qj9m3wikEdRAyEJoGTgdYGR1rJ68RjtrHTJiF2br0gPlE4HJi9o3wiQgP2jfCBsbziQgUVw3usIrLtOIucc+UpaMlQPGAnU4lABWMnkwwKxnqZMkk5MALFjkzIQgEIQgEIQgEIQgEIDkkAgkdQDyJu0+R+kBkswcN084g02dZ7SLD0xt8JuDnGJinoyMCPgeDHngbV0e0U7C5TnOZhPuqgJIUYyepjNsfOGG4DJGecRI34wEIEgYyQMnAycZMIBCEIBLDoJGWXuj0ko2CdPmYRGfs0dsZxziRFIYBGCBFY52kHAMMH7xlGlVOMgcdOJz6E4WxCclXIl8H7xnHV7v2jauTgjP5GWNT5ld0IuPifrDb8T9TMsmgRkYiEYBIJ4+MeUKvKibMXxHkZsiiSbvGVkm78sSjb8YRoRphAMkCJrdWNJUAmDYegP5mVq7/ynN9pLVX2eosrNhB27c4B6nmb5y9fKuX9Laj7lf0P953aLVDV1EOALB1A/MTy/1XZ9p7Hbszndv49M4nofZq1WdpqK6zWSdu3OQOh4nXvnnPCrkYJEk2rSm0p2V1jYz7i5wJ0ON1uPhzODUEj7QfbqVo9xe8Ac/WcEbXq7CpN2m1BYsT7tXQeAlqLlvDbVdSpwQ4wZDc//ADOr/Qn94aRTYupXttxZ8dooHl4QA6u3fcyUiylOh3hcY6nzMd9Um+gLbWm/O8Eg7fd8fnItStlwpGw1Vd6wcYH3T5xrKl1FnbVVIVTke6B2pzz8pBZdQi0dpdbXwdpKHcCflJJ9o0G20PcNmRs90+XPh5yo1GlpqDqyVox6KuOfiAJCrXaddTexuwHK4O084HPhKGT7Ro7ewPcOzG3Z7p8ufCX1erupXtKqA9e3dvLY/DrOenX6ZNVqHNvusE2kqecA58In2iy2U9pXdad4yFDYXA6nEg6TqLK69+pQZLBVWrk8zF1al0Vqb03ttBdMDP1kMYFQL3FxegZbWzjr0nVrOun/AOuv5GBJ77u1sCtpkRG2g2kgniZ7Rf8Ax9B/rM0VvY2oCV0uwt/9UZGMTm7O2u+7NGlOCoI2EgZHhA7NPbbZc1dvZHChg1WcHM6Cp8JCldmtZSFUilchRgA5PSdMCcJRuknLFEPA4xnwzGUeM1uhOMkeHnJo8+ntrNZdXZ2BBCiwAtyMeH1kex0q6O6w1hmR2Ue8eOePGX09IW657uHXbYWB6Hkn+0VHOipS8g4sHvrnBzyR+eIRfT21JpVNO+5a8KdiknPoZypqwmhRf1lbAjBIxuG7nHnO3TL2NQaxhljvds8ZM4ltrs0SIASyMOdvAy3nKKJqbG1lj6ekvlAPf93HXmWFtr6NLUVd+AxXHUeImWpqDqrDSFG5ANzg48emPGU0hzp1VR+zJTPnjxkErrFtTSuhyrXKR+MobWOpFVeMLzYT4eQ9Zz2INQ+3TYVKSW3Dozzp07V2Vl61CknLr4hvHMopCEIUSq90SUqndElDSdoYq4UZJWUmfvj0MiJ0lmoQnHBwPylYP3D8OYQCcbjb9p1n7y/3nZOXVLi6iz+cLLG+fXVCEJGWTU5UQgnQjyMIz98/WbMbvD0mwCTbvykm3flhWwhCQIDggjwktdRdq1VazWKxzznOeZSAJByDibly7Fc3smr9k9mzRs88nPXMroaLtIrLYazWeeM5zxLdo/w+kFBdveOcS3u2YHHClz1M8+5LDrGf2QXgoOWIAH1nc5LNgcgQFbHrxMI4dr/8rq/1p/aPpEZRfvoNYZs7B5Y8MTs2IveMO0Ud0QORUur0aYqGcgtWF/dJ6To2WC7Bx2RXg9NpjGxj8InXrzKJpbbXSc6ffdu2kqAA383pNp7YFnts3M37q91fSPCMVKw6ity9ZNqE5NZ6j0P9Jmqq36e51RjY6AEdT6S0deklRHWVWW11rUcMtitnj3fjzJPp9SbKS2o7VVsDEbAuPjOyEg862l3uuDaI3LvyCbNngPrF9kH/ACv/APRPTPSEo49HW6ah92nNKhAFG7cOp8Z2QhIAjMUqY0IAvSbMHQQgQfTCyx2LnbZt3KB1AzxmaNMpsNlp7RugBHCjyAloQOYaOtFZDl6ichG5CmPZUllRqYYQ+A4xLNyDJzUVD2TjHtOq/wDt/wBo1mjU6eutXdah3lB72fMysoTmmESRVRQqAKo6ASVmnD2dojtVZ4svj6jxloQrZkIQCVTuiSla+7FDTD3l9ZsxunzEyGYZUj4RQcgGNEXuj4cQhpza/wDYBvusDOmQ1ozpbB8P6yz1rn2LwiVndWjeagx5EExe8Zsz98fSED+B8jNg/dMyBsm/eEpJv3hEK2EIQJwHPTmV2IvX8YGwAe6JrVKKyevEf3a1k9zMQCesa09BIgNvkIuXbxMEHOY0BCuJkpFYY9IlUsIQlBCEIBKDgRB1EeSghCEiA+EIeMIBCEIBA9DCB6QCE0AmNt+MBITSCJkAiHgx4rdZYFlFwaj8JOUq7pEtVOEIQCEIQCUr7snKV9DFDxW7p9I0yZDRR4j4zU7g9Jn7zfWEbJ3jNFg/lP5SkwjIwfGFS0rbtNWf5cS05tAc6VR5Ej8Z0y31evRMPgfIzZjcqZENEXuiODkZijqR8YRsR+8I8R+CDEKITN3whKEhCEqnqGWz5THOWJjJ7qFvOTA6CBRRgQhCZQQhCArDHpFlIjDEsqshCaAScASgXvCPBa2BzxNII6yVGQhCQHiYQEIBCEIBNAycTJq96Bz/AGk5TTqA+xXbaxxngg5nn6RhVepquyWsCY29Vz1nf9p5NVQVQx7UYB6HrPOzZV+salAEvySOCCP3fSd+P+WL692IRg4nBd9pXCxqFoCWjBJZshR8pzLq9SbmUaoPYg95GrAH4c/jPP1ZLldueLZsevMfwkdJqRqaydux1OHU+Blm6SxkkpV1MnHq7/ymqFIwSJk1uHPrMgEIQgEpX4ycevxiikIQmQJ3fmZh7/qIJ+96wbvD6QjYQhCubR4AuT7thnTObTjbqtQvxBnTLfV69EIQkQJ3R8OJh75+Ignj6wbvD0MI2JZ4R4lnhEKSEZekJdTCQhNUZOOflK0569WzO6Gu5k34RlT3cDjr6xa9Wz7LA+mVCOUa7nP04kNO4S9wfbFrTopHCjH7wlFsNI09deouKHgnsfDHh7v95EdCarfp7rAFzXuHDbgcDPXictX2ja9la7tO25gCqhs8n48SjJWdPentDYLh7CyEEA446fCciXICgbWMQCNw7RyCPLG3+sDrbWaoMzey4ROHXtBnPhL2vY1VaBTVbacYByVHic+n5zxm7HeuPZ8c5x2mPn4/SdlyaZdFQGCBnyFYFsKM8nnmBbWazFdbUvtHaEbmzg49Ooi6bW2X6hay1LqQSdgYEcfGZcKzUG0916pjC4Yqg/DJPpJ0otrVg36o3YIb38bPPw/CB6XXiLZqk077GrsxkDft93n4x074/rF+0U36KweIGfpNTNyqo2opUkNdWCOoLCA1FDEKLqyT0AYTxdRWbbmsRq8Phv2ijkjnxj6HTt7XWWNeAc8OpP4GdP1zN0x7BGDiZGfqIp6TggHSEIQCEAwJIDAkdQD0grBlDKQwPQg5EAgenHWbiGD5QJajTpq1UOzrt5wp6yP6Jo+/Z9R/adW3I5EMHzM1OrEyPGetdLqtRWAxxh1zyWGP7gzlprvreu8ovvE7wM5w3n6cT1/tKkGg3A7bK+6fP4fOcD35pRq+9ZwvwPx9Jx6l3+vTxZef46/s3B1OoZemFUn4jP8AcTvPIM4NOyU1itOg6nxJ8zOiu0HksAPMnE3Jkcert1SNWffERXRyQjoxHUBgYy94es2jbO+Yse3vD0iQCEIQCPX1MSPX1MUUhCZMgXvH5Qf931gO/wDKa/T5iEEIQhXMox9oP/MgP9J0zms419R+8hH9Z0y1b9CEISIxe80G6r6wHfPpNfoPWEESzoI8SzpEKxYTF6wloWPV3/lElKuplVx2U3tqNQQ1a12DHPJPu4+Ua2uweyisAsmRnBwDt8fhLk5JMcdJEcqJqK1usZVstswNtbbQAOOpnI+n1jIV2ajkY51KkflPVhA8ldPrlCgLeFAwQNQB9PKdrLqbUrO2uphkHf77D0M6YQOG6vUJljl8DmxFy5+Cjwi00v2TNUhrcWbq1fr0AOfWehJxAdOR1lWPaVMFAJIIw3TPxkoDIOQcGVSaTTfqf+Joq358EHSC0PXrty1VLSB1CgHp9ZXtH+H0mglu8Zb1RucnMD0hA9DMIJK+/scfqrbM/wANc4lYlt1dK7rXCj4+MDn0T9pfqX2MmWXhxgjiS0Wpc6Wqqio2Mo94nhV585XRWC2/UuAwBZcBhg9IaWwU/ZaWEZCoTj5yjNVSl+srV03gVsQucZMh7J//AC//ANErqK69VqQHXIWndjPQk8Tm9m06abT3umQf2g3HJHn8oHVpdIq27m0PYlRkN2u7n0lPtFqhpttpXk+7v3Yz8uZHR6RDcNQtIrrAygLEk/HrLmqyioppiPeYlmsbO3MDxn7IsoHs4Gclh2mPQ5nLcRuevNbKp9wDdjnnjx4wevnPXewaenUVrcr2MNwsU+8eehlhut1Vl+mepXHu7DyXx4nyg1B9Kg+zTZntCQuMcDqI3YbAT+i1wPO4GW1NXbNSLWtQ2HBRLPdBAz5RbdMVvpq9q1JWzduzZ5CA2lZiVZdEtSOO+HXp9MzpnKNOKrq6lv1OMEj9ZwMY4xidR5zKqlvhJyl3UScQEIQgEevvRI9Xf+UBrLEprL2NhR4yH6R0n8X/ALT/AGkftOmy2ysGxUp8SxAwf6zz/ZW/i09cftB9Z1445s+aPdqdLlFlbZU9DGfuGcH2ZTZVZYBYr0+BUg5P9J3tyCPhOfUkuRBCYORmbMK5tSduo07fzEfWdM5tcdqVv92wGdMt8W+QQhCRGDvj0M1+6frM/eX1mtyp9IQRLOkYciY/diFIvWEwdYS1IyUr4UmTlF/Yn5y1pOUk5SSghCEiCEIQCIepjxG6mWKyEISgmg4MyECkIqnwjEgTKAdBFaqtnV2QFl6EjpGXkQgJXVsuts3Z7Qg4x0wMTn/R1WNvaXdnnPZ7/d+k64QJLQqtawY7rep8hjHEXT6OqgDguwGNzc8fDyl4QIV6YU2BqrHSvxr6j/aVsRLUKOoZT1EaGIHLboQ/upYK6jjci1jn5yl2lpvO50w33l4Mt6wgT1FC3hcu6FTkFDgyJ0Clgx1OpJXoe06fhOqB4EDlr0wruFnbWvgEYsO7rLryw9ZkavviaVtp94D4RIznLmLAIQhAIyHDiLGXvCByfbNidktWff3BsY8OZx/8J7B/8j5+f06T2wSOvIm7x/4Jvn8mTB5/2NYnZNVn39xbGPDiegOcxWYkccCPM9df6uoRe6PSNFXp8zGmFc+uGdK/wwfxl1O5Qw8RmT1K7tPYP5TDTNu09Z/lEv0v0rCEJEYfA/GNEbp8xHhCKw2jkdJjkbeojbl8j9IblHgfpAlkecJTen/ghNamJSg/Yycov7I/OK0nKScoOgkoIQhIghCEAiv4RpjdICQhCaUQhCAQhA8AnygMp5xGkkYOodc4PPMqORJQQkjqqFJBs5HHQzPbNP8AxPwMZTFoQhIghCEAik4PEaIeplgYMPHiYzZ4EWEuKJSrxMnKLxUT5xQh5OfOZCEAi2OK13MGPBPCk/kOI0jqveCJsVy5IANYY5x4ZIxA1dTWaRa25QVBwVP0BxzGovV3RSGSwjJRlPH4TnoU1g1Csq1YXJStA3wOSxEmtlqO9w7Ut2orOQmMZHHr6cSI7L/tDT1F0Ng7RfDaesj+lKPZt29e22Z27TjdjpOjV3CunG3L2e6qE9SZlpWqqqg15Wz9WQD0GICV/aGmtVV7Ub2HI2nrMs+1tKqgo+85HGCP6S9V9TOaaiTsHJHIHwzOW46i9rNnZGmrAPaZ7w5J4gM32ppVI2vuy3PBGB59J0UaqjUEil9xHJ4InH2up1TVhUpyqrb7+4YPPkZ16S2y1H7UIGRyp2Zxx6wLMNylT4jEhoTnSp8Mj8Z0Tm0Q2pYv3bCI+mp46YQhIhW6fOPEbpNssWpNzZx8BCMXp8zB+6YtNi2oSucAkciYXdndFQELjJLY/pAyEViyldyDDMF4b/aE0mNjK+MJjvk8+XEWI7FXTC554itHjr0iDpzNBxFDwmbhNyD4zKCEIQCB6QhAnCaepmTSiEIQCY3db0M2DA7W9DA56XtFKAU5GODvAzOip2K++mw56ZzE04/UJ6QvJWlyMggdZb8qSm7YHXs7G988quR1hqL91Dr2VoyOpXiDI1YRhbafeHBbiMENt1v62xQCMBWx4R8ejoXoIhci9UwMFSYmnG+llclhuK8nwkzpKu3UCs7NpzyesmRHXMmIi1qFQYAmzKA9JOVAyYwUDwlghCdBAPUSTpt5HSVSSjjFYEQDJAj2n3gIE4QhAJDVJvs064U5c99cjofCXmgkdCYHJpxWH1B31iv3PerOxfHyP9YaeiuwO2XK9sWU7zggY5+M68nzMM88wjn1lIF1VxYsxuQDP7o8hJayuwtS2rtXszZgqowBx5z0HrSzbvGdrBh6ia6K67XUMPIjImRyG+tbKKNK9eGY7gmDgYkGrS6xaNIzAAbbXB4I8j5meglNVZzXUiHzVQI9YABwAOT0Eo4LsV610F66f9Uu1jjHBPnH0DAPbWri1R7zWDxYzqtqrscdpWj4HG5QZqIlYwiKo8lGIDTn0nW//qtOic2k79//AFDH01PK6YQhIhW7seI3dM2xO0TbuZfipwYRHTdLcfxGk3U9s29EbIB3dkW/rKU6cVtuFlh5OQW4Ms2dpxjPxGYHLtQMvCKdwwewYc/WEcqWK7mGAc4C45+sJRsesAk5AOOREj1H3vWVSnqfWNtHlMfhjGXoJKM2iGwec2EiF2kdDN94fGbCBm7zE0EHxh1mFfKUY/WLNIImSxRCEIAyhlKsMg9ZL2Wj+H+JlYS6Jey0fw/xM0UVBWVV27hg4MpCNpqQ01IIIUgg5zma2nqdyzLkn4yuD5GZG00Uota7FyBnPMpJzQSJmwPCYG85oOZEDVpbUUcZVuonm2M+j9probaFZWHGeD6/Keoh8Jw6xV9tVRbsa1QpBrDA8+OZ1/HfpY4v0jq/4v8A2j+09PQWWX6Tfa24knBxjic92jNNTWPdXtXy06zq0rj2NGDbhg4O0L4+Qmu7zefiBq++IWHLmbV3vlMfvH1nILCEIBCEIBCEIFpswdBNmQQTofWExOresIG749DNmN3h85sAnNpP2moH/uGdM5tJ+11H+eWeNTyumEISIV+6fSPEbun0jwhV6H1P5wgvj6mbCowgesJazGTQcEHymQlaUtHQzE6TQN1WPKKvWRDTnv1qUuyGu1tgBYquQM/OdE8/U/tdSD3Cat58l5zIOhtYAcDTalh5ivI/OZXrVe5auwvVj95MYHn16RLm1DW6g13italBC7Ac8Z6zamZtYrcFjpgefPMotXqEc2Bv1bVn3gx6Dz9IrayhbUQWVkMDlt4wuJz22WPptWty1h0UDKA8gjPjJO9HtFJGhsAw2V7Ee908PGB6JtU1M9WLceCsDk+UKrEvrFicg/hOXSFzRcdOio3bHC2AjAwPAR6qzq6KrTZZSSORU20dYFK37Q2AKRscr1zmJqNVVptgsPeP0Hiek5tHQlpu26q8EWHhbMEjzMrrx2OmpHbMNto/WN7xHXn4wNTXaey4Vq+crndg9fLGJg1qPxTVbb8QMD6yent7XUWt7R2+KT72zbjnpCnU3pTQnspO5QFPagZ4/CUehtEA9KPtaxA/kSMzE7y5GPMZkftKpfZ3tVALFIO4DmJNuVXZMZQ3UTw9XqLl1L7brApOQAxHB5jaG6+3V1qbrCM5ILE8Tp+q5umPWKYMUjHWVfqIs5aicI+0E8cTjXWo4ylGpYea15H5y6rq3Ecxt6MwZ0G4dCR0kmtVXqVgwNvQY6cZ5jQKsysCCNwPhiTbwAAAA4A8JJtTXXelJLb36YHEa61aq2tfO1RzgcwiiHDibYMN6yVVi3VLZWcqenwjC5LrHRQQayAc/GFEJzLrkZdy06gr94V8fnLVW13JurYMPygPCEIBCEIFl7omzF7omzIJi9WmzF7x9BCBuq+s2Y/7vrNgE5tL+21H+edM5tL+31H+eWeNTyumEISIVu6fSb2i9p2fjjMxu6fST2L7X0/d3dfHMIqPH1mzB1PrNhUm7xhB+8YS1ksIQlaPUfeI85hG1vSYDtIMe0cgwM3CcNxta/VJVUH3oqklsbeDOuGBknAyepxyYwcz6W0do3tS1Vsqq2VBzgY8ek2hqzrcJYrqmnClgeOs6CAQQQCD1BGQZtSVoCERUz12qBmRHn2Xo66rqouA7MsMBsDHWabbmsrsOo0OUBAG8+M9EorLtZQV8iOIns2n/gVf6BA5tJetddzW2VljYWxWc5zjGJOm4pp00pdaXUYdnIGPTznelVdedlaLnyUCD1V2ftK0fH3lBgclo03Zp2GoqrsrHuMHH0MXUtZetHZ2jtMg7a1DDI6nPwzOr2XT/wACr/QJRFVF2ooVfIDAgebqK9WlljNa1hKbFIrGGB8PhyZ02J2dmkTwUkfRZ1wgTBwQfKPeFfTuCCVKnu9flFZfETFYr05HlKrm0dAvoDi7U1gHAHaflxNq/V/aAp36h8DOWfKnjynX2w+6Yby3HSavfo1jlvSZCE5o0dZ5mgt1C6ULXpe0XJ97tAM8+U9MdZ5+l9r09Iq9k3YJOe1USimqH/F6TjHvN+U6PXic+pS9n01qU7mTJZN4GMgeMy5tXbTYg0uxiuAe1U/+cQOYtVdRfcbUWxm3ICwBAXp/WX1dgt+zHsHRlB/ESy6ahFC9jWdoxkoOZznTWjR6ihVBBbNfvDkZBxKNUeyagDpRd/2t/vLaIZ1WrH86/lGtqW2o1P0Ix6RPsym6pru3xuYjByDnHjIE+zf8GnqfzgRs+0ht47Sslh8QesTTjV6ekVeygkE+8bQPwlqKXWxrrmDWsMe70UeQlFoQhCiEIQKp3RGip3RGmQTB3z6TZg749IRr9B6wg/dhAJzaX/Ean/MP6zpnNpv8Tqf8w/rLPGp5XTCEJEY3dPpNCjdvx72MZ+Exu6fSMOkIUdT6zZg6t6zYVN+9CFnWEqEhKnbYgdCDkZBHjJSqJTvVfEScpUeSPOKJwmsMMRMgEdRgQUeJmyVBCEJAQhCAQhCAQhCARWXxEaECc0HBzNYYOYs0qkJiHwmzKCEIQCEIQMYZ5ESUisMGWKWMhwwiwlD2DD+sSWZd4BziL2X834QJwlOy/m/CHZfzfhGicJTsv5vwh2X834QNr7saYqFfHPym4Oeox6TKCZ+8JpB8CPpDb056QB+4fSE08gxR0EDZzaf/ABOp9VnTOej/ABWo9V/KWNTyuiEISIxu6fSMOkVu6fSMOkIUdW9ZswdW9ZsKSzwhCzpCVH//2Q==' },\n      { name: '维度', type: 'number', value: 40.03190424323978 },\n      { name: '经度', type: 'number', value: 116.41731465378871 },\n      { name: '位置信息', type: 'string', value: '奥运村街道麦当劳(上品奥运村店)上品+(奥运村店)' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendRichContentMessage = {\n    name: '发送富文本消息',\n    event: Service.sendRichContentMessage,\n    eventName: 'conversation.send',\n    desc: '发送富文本(图文)消息(sendRichContentMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/msgmanage/msgsend/web.html#ImgTextMsg',\n    params: [\n      { name: '图文标题', type: 'string', value: '标题: 融云' },\n      { name: '图文内容', type: 'string', value: '为用户提供 IM 即时通讯和音视频通讯云服务' },\n      { name: '图片信息', type: 'string', value: 'https://www.rongcloud.cn/images/newVersion/log_wx.png' },\n      { name: '图文链接', type: 'string', value: 'https://developer.rongcloud.cn' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendReferenceMessage = {\n    name: '发送引用消息',\n    event: Service.sendReferenceMessage,\n    eventName: 'conversation.send',\n    desc: '发送引用消息(sendReferenceMessage)',\n    doc: 'https://docs.rongcloud.cn/im/imlib/web/message-send/#rich-content',\n    params: [\n      { name: '引用消息内容', type: 'string', value: '' },\n      { name: '引用消息用户 ID', type: 'string', value: '' },\n      { name: '引用消息类型', type: 'string', value: 'RC:TxtMsg' },\n      { name: '消息内容', type: 'string', value: '为用户提供 IM 即时通讯和音视频通讯云服务' },\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '静默消息', type: 'boolean', value: false },\n    ]\n  };\n\n  var sendSightMessage = {\n    name: '发送小视频消息',\n    event: Service.sendSightMessage,\n    eventName: 'conversation.send',\n    desc: '发送小视频消息(sendSightMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/group/msgmanage/msgsend/web.html#SightMsg',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: 'sightUrl', type: 'string', value: '123' },\n      { name: 'content', type: 'string', value: '123' },\n      { name: 'duration', type: 'number', value: 100 },\n      { name: 'size', type: 'number', value: '为用户提供 IM 即时通讯和音视频通讯云服务' },\n      { name: 'name', type: 'string', value: '123' }\n    ]\n  };\n\n  var getUnreadCount = {\n    name: '获取会话未读数',\n    event: Service.getUnreadCount,\n    eventName: 'conversation.getUnreadCount',\n    desc: '获取指定会话未读数',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/unreadcount/web.html#get',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getTotalUnreadCount = {\n    name: '获取会话未读数总数',\n    event: Service.getTotalUnreadCount,\n    eventName: 'im.Conversation.getTotalUnreadCount',\n    desc: '获取会话未读总数',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/unreadcount/web.html#total',\n    params: [\n    ]\n  };\n\n  var clearUnreadCount = {\n    name: '清除会话未读数',\n    event: Service.clearUnreadCount,\n    eventName: 'conversation.read',\n    desc: '清除指定会话未读数',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/unreadcount/web.html#clear',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setDraft = {\n    name: '设置会话草稿',\n    event: Service.setDraft,\n    eventName: 'conversation.setDraft',\n    desc: '设置会话草稿',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/draft/web.html#save',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '草稿内容', type: 'string', value: '这是会话草稿' }\n    ]\n  };\n\n  var getDraft = {\n    name: '获取会话草稿',\n    event: Service.getDraft,\n    eventName: 'conversation.getDraft',\n    desc: '获取会话草稿',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/draft/web.html#get',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var deleteDraft = {\n    name: '清除会话草稿',\n    event: Service.deleteDraft,\n    eventName: 'conversation.deleteDraft',\n    desc: '清除会话草稿',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/private/conversation/draft/web.html#remove',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var joinChatRoom = {\n    name: '加入聊天室',\n    event: Service.joinChatRoom,\n    eventName: 'chatRoom.join',\n    desc: '加入指定聊天室, 并拉取消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/basic/join/web.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '拉取消息数', type: 'number', value: 2 }\n    ]\n  };\n\n  var joinExistChatRoom = {\n    name: '加入已存在的聊天室',\n    event: Service.joinExistChatRoom,\n    eventName: 'chatRoom.joinExist',\n    desc: '加入已存在的聊天室，若聊天室不存在，则加入失败',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/basic/join/web.html#jion-exist',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '拉取消息数', type: 'number', value: 2 }\n    ]\n  };\n\n  var quitChatRoom = {\n    name: '退出聊天室',\n    event: Service.quitChatRoom,\n    eventName: 'chatRoom.quit',\n    desc: '退出聊天室',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/basic/quit/web.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getChatRoomInfo = {\n    name: '获取聊天室信息',\n    event: Service.getChatRoomInfo,\n    eventName: 'chatRoom.getInfo',\n    desc: '获取聊天室信息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/basic/info/web.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '获取人数', type: 'number', value: 20 },\n      { name: '排序方式', type: 'number', value: 1 }\n    ]\n  };\n\n  var getChatRoomHistoryMessages = {\n    name: '获取聊天室历史消息',\n    event: Service.getChatRoomHistoryMessages,\n    eventName: 'chatRoom.getMessages',\n    desc: '获取聊天室历史消息',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/msgmanage/storage/web.html',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId },\n      { name: '获取时间', type: 'number', value: 0 },\n      { name: '获取个数', type: 'number', value: 20 },\n      { name: '排序方式', type: 'number', value: 0 }\n    ]\n  };\n\n  var setChatRoomEntry = {\n    name: '设置聊天室属性',\n    event: Service.setChatRoomEntry,\n    eventName: 'chatRoom.setEntry',\n    desc: '设置聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/key/set/web.html#set',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '属性 value', type: 'string', value: '我是一个聊天室 value' },\n      { name: '是否退出清除', type: 'boolean', value: true },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var forceSetChatRoomEntry = {\n    name: '设置聊天室属性(强制)',\n    event: Service.forceSetChatRoomEntry,\n    eventName: 'chatRoom.forceSetEntry',\n    desc: '强制设置聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/key/set/web.html#force',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey2' },\n      { name: '属性 value', type: 'string', value: '我是一个聊天室 value' },\n      { name: '是否退出清除', type: 'boolean', value: true },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var removeChatRoomEntry = {\n    name: '删除聊天室属性',\n    event: Service.removeChatRoomEntry,\n    eventName: 'chatRoom.removeEntry',\n    desc: '删除聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/key/remove/web.html',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var forceRemoveChatRoomEntry = {\n    name: '删除聊天室属性(强制)',\n    event: Service.forceRemoveChatRoomEntry,\n    eventName: 'chatRoom.forceRemoveEntry',\n    desc: '强制删除聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/key/remove/web.html#forcedel',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey2' },\n      { name: '是否发送消息', type: 'boolean', value: true },\n      { name: '附加信息', type: 'string', value: '我是消息中的附加信息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getChatRoomEntry = {\n    name: '获取聊天室属性',\n    event: Service.getChatRoomEntry,\n    eventName: 'chatRoom.getEntry',\n    desc: '获取指定聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/key/query/web.html',\n    params: [\n      { name: '属性 key', type: 'string', value: 'chrmKey1' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getAllChatRoomEntries = {\n    name: '获取聊天室属性(所有)',\n    event: Service.getAllChatRoomEntries,\n    eventName: 'chatRoom.getAllEntries',\n    desc: '获取所有聊天室自定义属性',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/manage/key/query/web.html#getall',\n    params: [\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var sendChatRoomMessage = {\n    name: '发送聊天室消息',\n    event: Service.sendChatRoomMessage,\n    eventName: 'chatRoom.send',\n    desc: '发送聊天室消息, 以文本消息为例(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/msgmanage/msgsend/web.html',\n    params: [\n      { name: '文字内容', type: 'string', value: '我是一条聊天室的文字消息' },\n      { name: '聊天室 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var recallChatRoomMessage = {\n    name: '撤回聊天室消息',\n    event: Service.recallChatroomMessage,\n    eventName: 'chatRoom.recall',\n    desc: '撤回聊天室消息, 以文本消息为例(TextMessage)',\n    doc: 'https://docs.rongcloud.cn/v4/views/im/noui/guide/chatroom/msgmanage/msgrecall/web.html',\n    params: [\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: '发送时间', type: 'number', value: 0, event: Service.getLastCacheMsgSentTime },\n      { name: '对方 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var joinRTCRoom = {\n    name: '加入 RTC 房间',\n    event: Service.joinRTCRoom,\n    eventName: 'rtc.join',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: '模式', type: 'number', value: 0 }\n    ]\n  };\n\n  var pingRTCRoom = {\n    name: 'Ping RTC',\n    event: Service.pingRTCRoom,\n    eventName: 'rtc.ping',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setRTCData = {\n    name: '设置 RTC 数据',\n    event: Service.setRTCData,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: 'key', type: 'string', value: 'key' },\n      { name: 'value', type: 'string', value: 'value' },\n      { name: 'isInner', type: 'boolean', value: false },\n      { name: 'apiType', type: 'number', value: 1 }\n    ]\n  };\n\n  var getRTCData = {\n    name: '获取 RTC 数据',\n    event: Service.getRTCData,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: 'key', type: 'string', value: 'key' },\n      { name: 'isInner', type: 'boolean', value: false },\n      { name: 'apiType', type: 'number', value: 1 }\n    ]\n  };\n\n  var removeRTCData = {\n    name: '删除 RTC 数据',\n    event: Service.removeRTCData,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId },\n      { name: 'key', type: 'string', value: 'key' },\n      { name: 'isInner', type: 'boolean', value: false },\n      { name: 'apiType', type: 'number', value: 1 }\n    ]\n  };\n\n  var getRTCToken = {\n    name: '获取 RTC Token',\n    event: Service.getRTCToken,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getRTCRoomInfo = {\n    name: '获取 RTC 房间信息',\n    event: Service.getRTCRoomInfo,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var setRTCUserInfo = {\n    name: '设置 RTC 人员信息',\n    event: Service.setRTCUserInfo,\n    eventName: 'rtc.getRTCUserInfoList',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var getRTCUserInfoList = {\n    name: '获取 RTC 人员列表',\n    event: Service.getRTCUserInfoList,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var removeRTCUserInfo = {\n    name: '删除 RTC 人员信息',\n    event: Service.removeRTCUserInfo,\n    eventName: '',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var quitRTCRoom = {\n    name: '退出 RTC 房间',\n    event: Service.quitRTCRoom,\n    eventName: 'rtc.quit',\n    desc: '',\n    params: [\n      { name: '房间 id', type: 'string', value: config.targetId }\n    ]\n  };\n\n  var updateMessageExpansion = {\n    name: '设置消息扩展存储',\n    event: Service.updateMessageExpansion,\n    eventName: 'updateMessageExpansion',\n    desc: '',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n      { name: 'key', type: 'string', value: '多个以逗号区分', event: Service.getLastCacheMsgUId },\n      { name: 'value', type: 'string', value: '多个以逗号区分', event: Service.getLastCacheMsgUId },\n    ]\n  }\n  var removeMessageExpansion = {\n    name: '删除消息扩展存储',\n    event: Service.removeMessageExpansion,\n    eventName: 'removeMessageExpansion',\n    desc: '',\n    params: [\n      { name: '会话类型', type: 'number', value: 1 },\n      { name: '对方 id', type: 'string', value: config.targetId },\n      { name: '要移除的 keys', type: 'string', value: '', value: '' },\n      { name: '消息 Uid', type: 'string', value: '', event: Service.getLastCacheMsgUId },\n    ]\n  }\n\n  win.RongIM = win.RongIM || {};\n  \n  var DefailtReadyApiQueue = [\n    [disconnect, reconnect, getConnectedTime],\n    [getConversationList, removeConversation, setConversationStatus, getUnreadCount, getTotalUnreadCount, clearUnreadCount, setDraft, getDraft, deleteDraft],\n    [sendTextMessage, sendImageMessage, sendRecallMessage, sendFileMessage, sendVoiceMessage, sendAtMessage, sendLocationMessage, sendRichContentMessage, sendReferenceMessage, sendSightMessage],\n    [registerMessage, sendRegisterMessage],\n    [getHistoryMessages, deleteRemoteMessages, clearHistoryMessages],\n    [joinChatRoom, joinExistChatRoom, getChatRoomInfo, sendChatRoomMessage, getChatRoomHistoryMessages, recallChatRoomMessage],\n    [setChatRoomEntry, getChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, removeChatRoomEntry, forceRemoveChatRoomEntry],\n    [quitChatRoom],\n    [updateMessageExpansion, removeMessageExpansion],\n    [joinRTCRoom, pingRTCRoom, setRTCData, getRTCData, removeRTCData, getRTCToken, getRTCRoomInfo, getRTCUserInfoList, setRTCUserInfo, removeRTCUserInfo],\n    [quitRTCRoom],\n  ];\n  urlQueryConfig.isMini && utils.forEach(DefailtReadyApiQueue, function (list, i) {\n    utils.forEach(list, function (item, j) {\n      if (MiniUnSupportEventList.indexOf(item.eventName) !== -1) {\n        list.splice(j, 1);\n      }\n    }, { isReverse: true })\n  });\n  win.RongIM.DefailtReadyApiQueue = DefailtReadyApiQueue;\n  \n  win.RongIM.ApiList = [\n    getConversationList\n  ];\n\n  window.RongIM.Api = {\n    changeUser: changeUser\n  }\n\n})(window, {\n  RongIM: RongIM\n});"
  },
  {
    "path": "api-test-v4/js/common/service.js",
    "content": "(function(win) {\n  var RongIMLib = win.RongIMLib,\n    RongIM = win.RongIM,\n    RongIMClient = RongIMLib.RongIMClient,\n    utils = RongIM.Utils;\n\n  var im;\n\n  // var sendMsgTimeout = RongIM.config.isDebug ? 300 : 0;\n\n  var selfUserId;\n\n  // 缓存消息, 用作撤回、删除等操作的参数\n  var CacheMsg = {\n    eventEmitter: new utils.EventEmitter(),\n    _list: [],\n    set: function (msg) {\n      this._list.push(msg);\n      this.eventEmitter.emit('msgChanged');\n    },\n    remove: function (msg) {\n      var list = this._list;\n      utils.forEach(list, function(child, index) {\n        if (child.messageUId === msg.messageUId) {\n          list.splice(index, 1);\n        }\n      }, { isReverse: true });\n      this.eventEmitter.emit('msgChanged');\n    },\n    getLast: function () {\n      var list = this._list, length = list.length;\n      var msg = {};\n      if (length) {\n        msg = list[length - 1];\n      }\n      return msg;\n    }\n  };\n\n  /**\n   * 初始化以及链接\n   * @param {object} config \n   * @param {string} config.appkey 融云颁发的 appkey\n   * @param {string} config.token 融云颁发的 token(代表某一个用户)\n   * @param {Object} watcher \n   * @param {Object} watcher.status 监听链接状态的变化\n   * @param {Object} watcher.message 监听消息的接收\n   */\n  function init(config, watcher) {\n    watcher = watcher || {};\n    config = utils.clearUndefKey(config);\n    config = utils.copy(config);\n    var navi = config.navi;\n    if (config.isPolling) {\n      config.connectType = 'comet';\n    }\n    if (navi) {\n      var navigators;\n      navi = navi.replace(/\\s/g, '');\n      if (navi.indexOf(',') !== -1) {\n        navigators = navi.split(',');\n      } else {\n        navigators = [navi];\n      }\n      config.navigators = navigators;\n    }\n    // config.customCMP = ['120.92.13.84:80']\n    // config.isDebug = true;\n    im = RongIMLib.init(config);\n    RongIM.Service.im = im;\n    im.watch({\n      conversation: function (event) {\n        console.log('watch conversation', event);\n      },\n      message: function (event) {\n        var message = event.message;\n        var hasMore = event.hasMore;\n        watcher.message(message);\n        console.warn('received messages', event);\n        // message.xxx.xxx;\n      },\n      status: function (event) {\n        var status = event.status;\n        console.log('status changed', event);\n        // 不处理的状态码\n        var unHandleStatus = [];\n        if (unHandleStatus.indexOf(status) === -1) {\n          watcher.status(status);\n        }\n      },\n      chatroom: function (event) {\n        console.warn('chatroom', event);\n        var updatedEntries = event.updatedEntries;\n        watcher.chatroom(updatedEntries);\n        console.log('rejoin chatroom', event);\n      },\n      expansion: function(event) {\n        console.warn('----msg expansion----', event);\n        watcher.expansion(event);\n      }\n    });\n    if(!config.customCMP){\n      delete config.customCMP;\n    }\n    \n    return im.connect(config);\n  }\n\n  /**\n   * 断开链接\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/connect/#disconnect\n   */\n  function disconnect() {\n    return im.disconnect();\n  }\n\n  function changeUser(config) {\n    return im.changeUser(config);\n  }\n\n  function getConnectedTime() {\n    return Promise.resolve(im.getConnectedTime()) \n  }\n\n  /**\n   * 重新链接\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/connect/#reconnect\n   */\n  function reconnect() {\n    return im.reconnect();\n  }\n\n  /**\n   * 获取会话列表\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/get-list/\n   *\n   * @param {number} count 获取会话的数量\n   * @param {number} startTime 获取起始时间\t\n   * @param {number} order 获取顺序\n   */\n  function getConversationList(count, startTime, order) {\n    return im.Conversation.getList({\n      count: count,\n      startTime: startTime,\n      order: order\n    });\n  }\n\n  /**\n   * 删除会话列表\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/remove/\n   */\n  function removeConversation(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return im.Conversation.remove({\n      type: conversationType,\n      targetId: targetId\n    });\n  }\n\n  /**\n   * 获取历史消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-list/get-list/\n   * \n   * @param {number} timestrap 时间戳\n   * @param {number} count 数量\n   */\n  function getHistoryMessages(timestrap, count, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    count = Number(count);\n    timestrap = Number(timestrap);\n    \n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.getMessages({\n      timestrap: timestrap,\n      count: count\n    });\n  }\n\n  /**\n   * 按时间删除历史消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-list/remove-list/#_1\n   *\n   * @param {number} timestrap 时间戳\n   */\n  function clearHistoryMessages(timestamp, conversationType, targetId) {\n    conversationType = Number(conversationType);\n    timestamp = Number(timestamp);\n    \n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.clearMessages({\n      timestamp,\n    });\n  }\n\n  /**\n   * 按消息删除历史消息\n   * @param {string} messageUId 消息在 server 的唯一标识\n   * @param {number} sentTime 消息发送时间\n   * @param {number} messageDirection 消息方向\n   */\n  function deleteRemoteMessages(messageUId, sentTime, messageDirection, conversationType, targetId) {\n    var lastMsg = CacheMsg.getLast() || {};\n    conversationType = Number(conversationType) || lastMsg.type;\n    sentTime = Number(sentTime) || lastMsg.sentTime;\n    messageDirection = Number(messageDirection) || lastMsg.direction;\n    \n    var deleteMsg = { \n      messageUId: messageUId,\n      sentTime: sentTime,\n      messageDirection: messageDirection\n    };\n    var messages = [ deleteMsg ];\n\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.deleteMessages(messages);\n  }\n\n  /**\n   * 获取指定会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#get-one\n   * \n   * @param {number} conversationType 会话类型\n   * @param {string} targetId 目标 id (对方 id、群组 id、聊天室 id 等)\n   */\n  function getUnreadCount(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.getUnreadCount()\n  }\n\n  /**\n   * 获取所有会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#get-all\n   */\n  async function getTotalUnreadCount() {\n    return im.Conversation.getTotalUnreadCount();\n  }\n\n  /**\n   * 清除指定会话未读数\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/conversation/unreadcount/#clear\n   */\n  function clearUnreadCount(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.read();\n  }\n\n  /**\n   * 设置会话草稿\n  */\n  function setDraft(conversationType, targetId, draft) {\n    conversationType = Number(conversationType);\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).setDraft(draft)\n  }\n\n  /**\n   * 获取会话草稿\n  */\n  function getDraft(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).getDraft()\n  }\n\n  /**\n   * 删除会话草稿\n  */\n  function deleteDraft(conversationType, targetId) {\n    conversationType = Number(conversationType);\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).deleteDraft()\n  }\n\n  function sendMessage(conversationType, targetId, msg) {\n    conversationType = Number(conversationType);\n    var conversation = im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    });\n    return conversation.send(msg).then(function (msg) {\n      CacheMsg.set(msg);\n      return msg;\n    });\n  }\n\n  /**\n   * 发送文本消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#text\n   * 注意事项:\n   *    1: 单条消息整体不得大于128K\n   *    2: conversationType 类型是 number，targetId 类型是 string\n   * \n   * @param {string} text 文字内容\n   * @param {number} conversationType 会话类型\n   * @param {string} targetId 目标 id (对方 id、群组 id、聊天室 id 等)\n   * @param {booleam} disableNotification 是否推送消息\n   */\n  function sendTextMessage(text, conversationType, targetId, isStatusMessage, disableNotification, canIncludeExpansion, exKeys, exVals) {\n    var content = {\n      content: text, // 文本内容\n      user: {\n        \"id\" : \"user1\",\n        \"name\" : \"张三\",\n        \"portrait\" : \"https://cdn.ronghub.com/thinking-face.png\"\n      }\n    };\n    var expansion = {};\n    var exKeysArr = exKeys.split(','), exValsArr = exVals.split(',');\n    exKeysArr.forEach((item, idx) =>{\n      expansion[item] = exValsArr[idx];\n    })\n    expansion = expansion || {key: 'value'}\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:TxtMsg',\n      isStatusMessage: isStatusMessage,\n      disableNotification: disableNotification,\n      canIncludeExpansion,\n      expansion\n    });\n  }\n\n  /**\n   * 发送图片消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#image\n   * 注意事项:\n   *    1. 略缩图(content 字段)必须是 base64 字符串, 类型必须为 jpg\n   *    2. base64 略缩图必须不带前缀\n   *    3. base64 字符串大小不可超过 100 k\n   *    4. 可通过 FileReader 或者 canvas 对图片进行压缩, 生成压缩后的 base64 字符串\n   * imageUri 为上传至服务器的原图 url, 用来展示高清图片\n   * 上传图片需开发者实现. 可参考上传插件: https://docs.rongcloud.cn/im/imlib/web/plugin/upload\n   * \n   * @param {string} base64 图片 base64 缩略图\n   * @param {string} imageUri 图片上传后的 url\n   */\n  function sendImageMessage(base64, imageUri, conversationType, targetId, disableNotification) {\n    var content = {\n      content: base64, // 压缩后的 base64 略缩图, 用来快速展示图片\n      imageUri: imageUri // 上传到服务器的 url. 用来展示高清图片\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:ImgMsg',\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送文件消息\n   * 文档：https://docs.rongcloud.cn/im/imlib/web/message-send/#file\n   * \n   * @param {string} fileName 文件名\n   * @param {string} fileSize 文件大小\n   * @param {string} fileType 文件类型\n   * @param {string} fileUrl 文件上传后的 url\n   */\n  function sendFileMessage(fileName, fileSize, fileType, fileUrl, conversationType, targetId, disableNotification) {\n    var content = {\n      name: fileName, // 文件名\n      size: fileSize, // 文件大小\n      type: fileType, // 文件类型\n      fileUrl: fileUrl // 文件地址\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:FileMsg',\n      disableNotification\n    });\n  }\n\n  /**\n   * 高质量语音消息: https://docs.rongcloud.cn/im/introduction/message_structure/#hqvoice_message\n   * 注意事项:\n   *   融云不提供声音录制的方法. remoteUrl 的生成需开发者实现\n   * \n   * @param {string} remoteUrl 语音上传后的 url\n   * @param {number} duration 语音时长\n   */\n  function sendVoiceMessage(remoteUrl, type, duration, conversationType, targetId, disableNotification) {\n    var content = {\n      remoteUrl: remoteUrl, // 音频 url, 建议格式: aac\n      duration: duration, // 音频时长\n      type: type\n    };\n    return sendMessage(conversationType, targetId, {\n      content: content,\n      messageType: 'RC:HQVCMsg',\n      disableNotification\n    });\n  }\n\n  /**\n   * 撤回消息: https://docs.rongcloud.cn/im/imlib/web/message-send/#recall\n   * 注意事项:\n   *   消息撤回操作服务器端没有撤回时间范围的限制，由客户端决定\n   *\n   * @param {string} messageUId 撤回的消息 Uid\n   * @param {number} sentTime 撤回的消息 sentTime\n   */\n  // BKE3-39Q0-4ME7-QRCS\n  // 1599619898624\n  function sendRecallMessage(messageUId, sentTime, conversationType, targetId, disableNotification) {\n    var recallMsg;\n    if (messageUId && sentTime && conversationType && targetId) {\n      recallMsg = {\n        messageUId: messageUId,\n        sentTime: sentTime,\n        disableNotification: disableNotification\n      };\n    } else {\n      var lastMsg = CacheMsg.getLast() || {};\n      recallMsg = lastMsg;\n      recallMsg.disableNotification = disableNotification;\n    }\n    recallMsg.user = { // 携带用户信息\n      \"id\" : \"user1\",\n      \"name\" : \"张三\",\n      \"portrait\" : \"https://cdn.ronghub.com/thinking-face.png\"\n    }\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId,\n      \n    }).recall(recallMsg);\n  }\n\n  function recallChatroomMessage(messageUId, sentTime, targetId, disableNotification) {\n    var recallMsg;\n    if (messageUId && sentTime && targetId) {\n      recallMsg = {\n        messageUId: messageUId,\n        sentTime: sentTime,\n        disableNotification: disableNotification\n      };\n    } else {\n      var lastMsg = CacheMsg.getLast() || {};\n      recallMsg = lastMsg;\n      recallMsg.disableNotification = disableNotification;\n    }\n    recallMsg.user = {\n      \"id\" : \"user1\",\n      \"name\" : \"张三\",\n      \"portrait\" : \"https://cdn.ronghub.com/thinking-face.png\"\n    }\n    return im.ChatRoom.get({\n      id: targetId,\n      \n    }).recall(recallMsg);\n  }\n\n  /**\n   * 发送 @ 消息(此处以文本消息举例)\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#example\n   * \n   * @param {string} text 文字内容\n   * @param {string} methiondId @ 对象的 id\n   */\n  function sendAtMessage(text, methiondId, conversationType, targetId, disableNotification) {\n    conversationType = Number(conversationType);\n\n    var isMentioned = true;\n\n    var content = {\n      content: text\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      content: content,\n      messageType: 'RC:TxtMsg',\n      isMentioned: isMentioned,\n      mentionedUserIdList: [methiondId], // @ 人 id 列表\n      mentionedType: 2,\n      disableNotification\n    });\n  }\n\n  //测试错误参数下发送 @  消息\n  function sendAtMessageByErrorParamField(text, methiondId, conversationType, targetId, disableNotification) {\n    conversationType = Number(conversationType);\n\n    var isMentioned = true;\n\n    var content = {\n      content: text\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      content: content,\n      messageType: 'RC:TxtMsg',\n      isMentiond: isMentioned,\n      mentiondUserIdList: [methiondId], // @ 人 id 列表\n      mentiondType: 1,\n      disableNotification\n    });\n  }\n\n  /**\n   * 注册自定义消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#custom\n   *\n   * @param {string} messageName 注册消息的 Web 端类型名\n   * @param {string} messageType 注册消息的唯一名称. 注: 此名称需多端一致\n   * @param {boolean} isCounted 是否计数\n   * @param {boolean} isPersited 是否存储\n   * @param {Array<string>} props 消息包含的字段集合\n   */\n  function registerMessage(messageType, isPersited, isCounted, props) {\n    // var mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited); //true true 保存且计数，false false 不保存不计数。\n    // props = props.split(','); // 将字符串截取为数组. 此处为 Demo 逻辑, 与融云无关\n    // RongIMClient.registerMessageType(messageName, messageType, mesasgeTag, props);\n    // 废弃此概念\n\n    im.registerMessageType(messageType, isPersited, isCounted, props)\n    return utils.Defer.resolve();\n  }\n\n  /**\n   * 发送自定义消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#custom\n   * \n   * @param {string} messageType 注册消息的 Web 端类型名\n   * @param {*} props 消息包含的字段集合\n   */\n  function sendRegisterMessage(messageType, props, conversationType, targetId, disableNotification) {\n    var content = {}\n    props && (props = props.split(','))\n    props.forEach(item => {\n      content[item] = item\n    })\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: messageType,\n      content: {\n        content: content\n      },\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送位置消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#location\n   * 注意事项:\n   *   1. 缩略图必须是base64码的jpg图, 而且不带前缀\"data:image/jpeg;base64,\", 不得超过100K\n   *   2. 需要开发者做显示效果, 一般显示逻辑: 图片加链接, 传入经纬度并跳转进入地图网站\n   * \n   * @param {string} base64 位置缩略图\n   * @param {number} latitude 维度\n   * @param {number} longitude 经度\n   * @param {string} poi 位置信息\n   */\n  function sendLocationMessage(base64, latitude, longitude, poi, conversationType, targetId, disableNotification) {\n    var content = {\n      latitude: latitude,\n      longitude: longitude,\n      poi: poi,\n      content: base64\n    };\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: 'RC:LBSMsg',\n      content: content,\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送引用消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#location\n   * 注意事项:\n   * \n   * @param {string} referContent 引用消息内容\n   * @param {number} referMsgUserId 引用消息用户 ID\n   * @param {number} objName 引用消息类型\n   * @param {string} content 消息内容\n   */\n  function sendReferenceMessage(referContent, referMsgUserId, objName, content, conversationType, targetId, disableNotification) {\n    var content = {\n      referMsg: {\n        content: referContent\n      },\n      referMsgUserId: referMsgUserId,\n      objName: objName,\n      content: content,\n    };\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: RongIMLib.MESSAGE_TYPE.REFERENCE,\n      content: content,\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送富文本(图文)消息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#rich-content\n   *\n   * @param {string} title 图文标题\n   * @param {number} content 图文内容\n   * @param {number} imageUri 显示图片的 url(图片信息)\n   * @param {string} url 点击图文后打开的 url\n   */\n  function sendRichContentMessage(title, content, imageUri, url, conversationType, targetId, disableNotification) {\n    content = {\n      title: title,\n      content: content,\n      imageUri: imageUri,\n      url: url\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: 'RC:ImgTextMsg',\n      content: content,\n      disableNotification\n    });\n  }\n\n  /**\n   * 发送小视频消息\n  */\n  function sendSightMessage(conversationType, targetId, sightUrl, content, duration, size, name) {\n    content = {\n      sightUrl: sightUrl,\n      content: content,\n      duration: duration,\n      size: size,\n      name: name\n    };\n\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).send({\n      messageType: 'RC:SightMsg',\n      content: content\n    });\n  }\n\n  /**\n   * 加入聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#join\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {number} count 拉取消息数量\n   */\n  function joinChatRoom(chatRoomId, count) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).join({\n      count: count\n    });\n  }\n\n  /**\n   * 加入已存在的聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#join\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {number} count 拉取消息数量\n   */\n  function joinExistChatRoom(chatRoomId, count) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).joinExist({\n      count: count\n    });\n  }\n\n  /**\n   * 退出聊天室\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#quit\n   *\n   * @param {string} chatRoomId 聊天室 id\n   */\n  function quitChatRoom(chatRoomId) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).quit();\n  }\n\n  /**\n   * 获取聊天室信息\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/chatroom/#get\n   *\n   * @param {string} chatRoomId 聊天室 id\n   * @param {string} count 获取人数\n   * @param {string} order 排序方式\n   */\n  function getChatRoomInfo(chatRoomId, count, order) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getInfo({\n      count: count,\n      order: order\n    });\n  }\n\n  function getChatRoomHistoryMessages(chatRoomId, timestrap, count, order) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getMessages({\n      timestrap: timestrap,\n      timestamp: timestrap,\n      count: count,\n      order: order\n    });\n  }\n\n  function getFileToken(fileType, fileName) {\n    return im.getFileToken(fileType, fileName)\n  }\n\n  function getFileUrl(fileType, fileName, originName) {\n    return im.getFileUrl(fileType, fileName, originName)\n  }\n\n  /**\n   * 发送聊天室消息(以文本消息为例)\n   * 文档: https://docs.rongcloud.cn/im/imlib/web/message-send/#text\n   *\n   * @param {string} text 文字内容\n   */\n  function sendChatRoomMessage(text, targetId) {\n    var content = {\n      content: text // 文本内容\n    };\n    return im.ChatRoom.get({\n      id: targetId\n    }).send({\n      messageType: 'RC:TxtMsg',\n      content: content\n    })\n  }\n\n  function setChatRoomEntry(key, value, isAutoDelete, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      value: value,\n      notificationExtra: extra,\n      isAutoDelete: isAutoDelete,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).setEntry(entry);\n  }\n\n  function forceSetChatRoomEntry(key, value, isAutoDelete, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      value: value,\n      notificationExtra: extra,\n      isAutoDelete: isAutoDelete,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).forceSetEntry(entry);\n  }\n\n  function removeChatRoomEntry(key, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      notificationExtra: extra,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).removeEntry(entry);\n  }\n\n  function forceRemoveChatRoomEntry(key, isSendNotification, extra, chatRoomId) {\n    var entry = {\n      key: key,\n      notificationExtra: extra,\n      isSendNotification: isSendNotification\n    };\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).forceRemoveEntry(entry);\n  }\n\n  function getChatRoomEntry(key, chatRoomId) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getEntry(key);\n  }\n\n  function getAllChatRoomEntries(chatRoomId) {\n    return im.ChatRoom.get({\n      id: chatRoomId\n    }).getAllEntries();\n  }\n\n  function joinRTCRoom(roomId, mode) {\n    return im.RTC.get({\n      roomId: roomId,\n      mode: mode\n    }).join();\n  }\n\n  function pingRTCRoom(roomId, mode) {\n    return im.RTC.get({\n      roomId: roomId\n    }).ping();\n  }\n\n  function setRTCData(roomId, key, value, isInner, apiType, message) {\n    return im.RTC.get({\n      roomId: roomId\n    }).setData(key, value, isInner, apiType, message);\n  }\n\n  function getRTCData(roomId, key, isInner, apiType) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getData([key], isInner, apiType);\n  }\n\n  function removeRTCData(roomId, key, isInner, apiType) {\n    return im.RTC.get({\n      roomId: roomId\n    }).removeData([key], isInner, apiType);\n  }\n\n  function getRTCToken(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getToken();\n  }\n\n  function getRTCRoomInfo(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getRoomInfo();\n  }\n\n  function getRTCUserInfoList(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).getUserInfoList();\n  }\n\n  function setRTCUserInfo(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).setUserInfo({\n      key: 'test',\n      value: 'test hahahah'\n    });\n  }\n\n  function removeRTCUserInfo(roomId) {\n    return im.RTC.get({\n      roomId: roomId\n    }).removeUserInfo({\n      key: 'test'\n    });\n  }\n\n  function quitRTCRoom(roomId, mode) {\n    return im.RTC.get({\n      roomId: roomId,\n      mode: mode\n    }).quit();\n  }\n\n  function setConversationStatus(isNotification, isTop, conversationType, targetId) {\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).setStatus({\n      notificationStatus: isNotification,\n      isTop: isTop\n    });\n  }\n\n  function setMessageKV(){\n    console.log('setMessageKV');\n    return Promise.resolve('set message kv')\n  }\n\n  function updateMessageExpansion(conversationType, targetId, messageUId, key, value, canIncludeExpansion, isTest) {\n    \n    key && (key = key.split(','));\n    value && (value = value.split(','));\n    var expansion = {};\n    key.forEach((item,idx) => {\n      expansion[item] = value[idx];\n    })\n\n    let message;\n    if (isTest) {\n      message = {\n        canIncludeExpansion,\n        messageUId,\n        type: conversationType,\n        targetId\n      }\n    }else {\n      message = CacheMsg.getLast();\n      if(utils.isEmpty(message)) {\n        return utils.Defer.reject('请先发送一条消息')\n      }\n    }\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).updateMessageExpansion(expansion, message);\n  }\n\n  function removeMessageExpansion(conversationType, targetId, keys, messageUId, canIncludeExpansion, isTest) {\n    keys.length > 0 && (keys = keys.split(','));\n    let message;\n    if (isTest) {\n      message = {\n        canIncludeExpansion: canIncludeExpansion == undefined ? true : canIncludeExpansion,\n        messageUId,\n        type: conversationType,\n        targetId\n      }\n    }else {\n      message = CacheMsg.getLast();\n      if(utils.isEmpty(message)) {\n        return utils.Defer.reject('请先发送一条消息')\n      }\n    }\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).removeMessageExpansion(keys, message);\n  }\n\n  function removeMessageAllExpansion(conversationType, targetId, messageUId) {\n    return im.Conversation.get({\n      type: conversationType,\n      targetId: targetId\n    }).removeMessageAllExpansion(messageUId);\n  }\n \n\n  function getLastCacheMsgUId() {\n    return CacheMsg.getLast().messageUId;\n  }\n  function getLastCacheMsgSentTime() {\n    return CacheMsg.getLast().sentTime;\n  }\n  function getLastCacheMsgDirection() {\n    return CacheMsg.getLast().direction;\n  }\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.Service = {\n    init: init,\n    disconnect: disconnect,\n    reconnect: reconnect,\n    getConnectedTime: getConnectedTime,\n\n    registerMessage: registerMessage,\n    sendRegisterMessage: sendRegisterMessage,\n\n    getConversationList: getConversationList,\n    removeConversation: removeConversation,\n\n    getHistoryMessages: getHistoryMessages,\n    clearHistoryMessages: clearHistoryMessages,\n    deleteRemoteMessages: deleteRemoteMessages,\n\n    sendTextMessage: sendTextMessage,\n    sendImageMessage: sendImageMessage,\n    sendFileMessage: sendFileMessage,\n    sendVoiceMessage: sendVoiceMessage,\n    sendAtMessage: sendAtMessage,\n    sendAtMessageByErrorParamField: sendAtMessageByErrorParamField,\n    sendLocationMessage: sendLocationMessage,\n    sendRichContentMessage: sendRichContentMessage,\n    sendRecallMessage: sendRecallMessage,\n    sendReferenceMessage: sendReferenceMessage,\n    sendSightMessage: sendSightMessage,\n    \n    getUnreadCount: getUnreadCount,\n    getTotalUnreadCount: getTotalUnreadCount,\n    clearUnreadCount: clearUnreadCount,\n    setDraft: setDraft,\n    getDraft: getDraft,\n    deleteDraft: deleteDraft,\n\n    joinChatRoom: joinChatRoom,\n    joinExistChatRoom: joinExistChatRoom,\n    quitChatRoom: quitChatRoom,\n    getChatRoomInfo: getChatRoomInfo,\n    getChatRoomHistoryMessages: getChatRoomHistoryMessages,\n    sendChatRoomMessage: sendChatRoomMessage,\n    recallChatroomMessage: recallChatroomMessage,\n    setChatRoomEntry: setChatRoomEntry,\n    forceSetChatRoomEntry: forceSetChatRoomEntry,\n    removeChatRoomEntry: removeChatRoomEntry,\n    forceRemoveChatRoomEntry: forceRemoveChatRoomEntry,\n    getChatRoomEntry: getChatRoomEntry,\n    getAllChatRoomEntries: getAllChatRoomEntries,\n\n    getLastCacheMsgSentTime: getLastCacheMsgSentTime,\n    getLastCacheMsgUId: getLastCacheMsgUId,\n    getLastCacheMsgDirection: getLastCacheMsgDirection,\n    msgEmitter: CacheMsg.eventEmitter,\n\n    changeUser: changeUser,\n\n    joinRTCRoom: joinRTCRoom,\n    quitRTCRoom: quitRTCRoom,\n    pingRTCRoom: pingRTCRoom,\n    setRTCData: setRTCData,\n    getRTCData: getRTCData,\n    removeRTCData: removeRTCData,\n    getRTCToken: getRTCToken,\n    getRTCRoomInfo: getRTCRoomInfo,\n    getRTCUserInfoList: getRTCUserInfoList,\n    setRTCUserInfo: setRTCUserInfo,\n    removeRTCUserInfo: removeRTCUserInfo,\n    setConversationStatus: setConversationStatus,\n    setMessageKV,\n    updateMessageExpansion,\n    removeMessageExpansion,\n    removeMessageAllExpansion,\n    im\n  };\n  \n})(window);"
  },
  {
    "path": "api-test-v4/js/common/utils.js",
    "content": "(function (win) {\n\n  var Defer = win.Promise || ES6Promise;\n  var Vue = win.Vue;\n\n  var TypeColor = {\n    FAILED: '#ed4014',\n    MSG: '#2db7f5',\n    STATUS: '#ff9900'\n  };\n\n  var ConversationName = {\n    1: '单聊',\n    3: '群聊',\n    4: '聊天室',\n    5: '客服',\n    6: '系统',\n    7: '公众号',\n    8: '公众号'\n  };\n\n  var StatusName = {\n    0: '已连接',\n    1: '正在链接',\n    2: '主动断开链接',\n    3: '网络不可用',\n    4: '链接关闭',\n    5: 'Socket Error',\n    6: '其他设备登录, 被踢',\n    12: '被封禁',\n    20: 'AppKey 错误',\n    201: '正在请求 Navi',\n    202: '请求 Navi 成功',\n    203: '请求 Navi 错误',\n    204: '请求 Navi 超时'\n  };\n\n  var SuccessStatus = [0, 1, 2, 4, 201, 202, 203, 204];\n\n  var noop = function () {};\n\n  function isObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  }\n  function isArray(arr) {\n    return Object.prototype.toString.call(arr) === '[object Array]';\n  }\n  function isNodeList(arr) {\n    return Object.prototype.toString.call(arr) === '[object NodeList]' || \n      Object.prototype.toString.call(arr) === '[object HTMLCollection]';\n  }\n  function isFunction(arr) {\n    return Object.prototype.toString.call(arr) === '[object Function]';\n  }\n  function isString(str) {\n    return Object.prototype.toString.call(str) === '[object String]';\n  }\n  function isBoolean(str) {\n    return Object.prototype.toString.call(str) === '[object Boolean]';\n  }\n  function isUndefined(str) {\n    return Object.prototype.toString.call(str) === '[object Undefined]';\n  }\n  function isNull(str) {\n    return Object.prototype.toString.call(str) === '[object Null]';\n  }\n  function isNumber(str) {\n    return Object.prototype.toString.call(str) === '[object Number]';\n  }\n\n  function defered(callback) {\n    return new Defer(callback);\n  }\n  function isEmpty(val) {\n    let result = true;\n    if (isObject(val)) {\n      forEach(val, () => {\n        result = false;\n      });\n    }\n    if (isString(val) || isArray(val)) {\n      result = val.length === 0;\n    }\n    if (isNumber(val)) {\n      result = val === 0;\n    }\n    return result;\n  }\n\n  function tplEngine(temp, data, regexp) {\n    var replaceAction = function (object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n      });\n    };\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  }\n\n  function forEach(obj, callback, options) {\n    options = options || {};\n    callback = callback || noop;\n    var isReverse = options.isReverse;\n    var loopObj = function() {\n      for (var key in obj) {\n        callback(obj[key], key, obj);\n      }\n    };\n    var loopArr = function() {\n      if (isReverse) {\n        for (var i = obj.length - 1; i >= 0; i--) {\n          callback(obj[i], i);\n        }\n      } else {\n        for (var j = 0, len = obj.length; j < len; j++) {\n          callback(obj[j], j);\n        }\n      }\n    };\n    if (isObject(obj)) {\n      loopObj();\n    }\n    if (isArray(obj) || isNodeList(obj)) {\n      loopArr();\n    }\n  };\n\n  function clearUndefKey(obj) {\n    forEach(obj, function (key, val) {\n      if (isUndefined(val)) {\n        delete obj[key];\n      }\n    });\n    return obj;\n  }\n\n  function map(arr, event) {\n    forEach(arr, function(item, index) {\n      arr[index] = event(item, index);\n    });\n    return arr;\n  }\n\n  function deepMap(arr, event) {\n    forEach(arr, function (item, index) {\n      if (isArray(item) || isObject(item)) {\n        arr[index] = deepMap(item, event);\n      } else {\n        arr[index] = event(item, index);\n      }\n    });\n    return arr;\n  }\n\n  function isEqual(obj1, obj2) {\n    if (isObject(obj1) && isObject(obj2)) {\n      var isEq = true;\n      forEach(obj1, function (val, key) {\n        if (obj2[key] !== val) {\n          isEq = false;\n        }\n      });\n      return isEq;\n    } else {\n      return obj1 == obj2;\n    }\n  }\n\n  function getDom(id) {\n    return document.getElementById(id);\n  }\n\n  function queryAllDom(sel) {\n    return document.querySelectorAll(sel);\n  }\n\n  function queryDom(sel) {\n    return document.querySelector(sel);\n  }\n\n  function removeDom(dom) {\n    var parent = dom.parentNode || dom.parentElement;\n    parent.removeChild(dom);\n  }\n\n  function getParent(dom) {\n    return dom.parentNode || dom.parentElement;\n  }\n\n  function getChildren(dom) {\n    return dom.children;\n  }\n\n  function getTemp(id) {\n    var dom = getDom(id);\n    return dom.innerHTML;\n  }\n\n  function getDomIndex(dom) {\n    var parent = getParent(dom);\n    var children = parent.children;\n    for (var i = 0, max = children.length; i < max; i++) {\n      var child = children[i];\n      if (dom === child) {\n        return i;\n      }\n    }\n    return -1;\n  }\n\n  function toJSON(obj) {\n    return JSON.stringify(obj);\n  }\n\n  function parseJSON(str) {\n    var val;\n    try {\n      val = JSON.parse(str);\n    } catch(e) {}\n    return val;\n  }\n\n  function copy(obj) {\n    var copyObj = parseJSON(toJSON(obj));\n    return copyObj;\n  }\n\n  function hasClass(el, className) {\n    if (!el) {\n      return false;\n    }\n    var classList = el.classList;\n    for (var i = 0, max = classList.length; i < max; i++) {\n      if (classList[i] === className) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  function timestampToString(timestamp) {\n    var date = timestamp ? new Date(timestamp) : new Date();\n    Y = date.getFullYear() + '-';\n    M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';\n    D = date.getDate() + ' ';\n    h = date.getHours() + ':';\n    m = date.getMinutes() + ':';\n    s = date.getSeconds();\n    return Y + M + D + h + m + s;\n  }\n\n  function extend(destination, sources) {\n    for (var key in sources) {\n      var value = sources[key];\n      if (!isUndefined(value)) {\n        destination[key] = value;\n      }\n    }\n    return destination;\n  };\n\n  /**\n  * 封装弹框组件\n  * @param {object} options\n  */\n  function mountDialog(options, instance) {\n    options.parent = instance;\n    var Dialog = Vue.extend(options);\n    var instance = new Dialog({\n      el: document.createElement('div')\n    });\n    var wrap = document.getElementsByTagName('body')[0];\n    wrap.appendChild(instance.$el);\n    return instance;\n  }\n\n  function reverse(obj) {\n    var newObj = copy(obj);\n    return newObj.reverse();\n  }\n\n  function openUrl(url) {\n    window.open(url);\n  }\n\n  function getBase64Image() {\n    var canvas = document.createElement('canvas');\n    canvas.width = 100;\n    canvas.height = 100;\n    var context = canvas.getContext('2d');\n    context.font = '20pt Arial';\n    context.fillStyle = 'blue';\n    context.fillText('RongCloud.cn', 10, 20);\n    var content = canvas.toDataURL('image/jpeg');\n    content = content.replace('data:image/jpeg;base64,', '');\n    return content;\n  }\n\n  var increaseNumber = 0;\n  function getIncreasNumber() {\n    return ++increaseNumber;\n  }\n\n  var EventEmitter = function () {\n    this._events = {};\n    \n    this.on = function (name, event) {\n      var _events = this._events[name] || [];\n      _events.push(event);\n      this._events[name] = _events;\n    };\n\n    this.emit = function (name, data) {\n      var _events = this._events[name];\n      forEach(_events, function(event) {\n        event(data);\n      });\n    };\n  };\n\n  var Storage = {\n    ConfigKey: 'config',\n    get: function (key) {\n      var str = localStorage.getItem(key);\n      return parseJSON(str);\n    },\n    set: function (key, val) {\n      var str = toJSON(val);\n      localStorage.setItem(key, str);\n    }\n  };\n\n  function getUrlQuery() {\n    var url = location.search; //获取url中\"?\"符后的字串\n    var theRequest = new Object();\n    if (url.indexOf('?') != -1) {\n      var str = url.substr(1);\n      strs = str.split('&');\n      for (var i = 0; i < strs.length; i++) {\n        theRequest[strs[i].split('=')[0]] = unescape(strs[i].split('=')[1]);\n      }\n    }\n    return theRequest;\n  }\n\n  function getRCUrlQuery() {\n    var theRequest = getUrlQuery();\n    var transMap = {\n      'true': true, 'false': false\n    };\n    map(theRequest, function (val, key) {\n      var transVal = transMap[val];\n      if (!isUndefined(transVal)) {\n        val = transVal;\n      }\n      return val;\n    });\n    forEach(theRequest, function (val, key) {\n      if (key === 'encodeToken') {\n        theRequest.token = decodeURIComponent(val);\n        delete theRequest.encodeToken;\n      }\n      if (key === 'isMini') {\n        delete theRequest.isMini;\n      }\n    });\n    return theRequest;\n  }\n\n  function deferNoop() {\n    return Defer.resolve();\n  }\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.Utils = {\n    Storage: Storage,\n\n    TypeColor: TypeColor,\n    ConversationName: ConversationName,\n    StatusName: StatusName,\n    SuccessStatus: SuccessStatus,\n\n    EventEmitter: EventEmitter,\n\n    noop: noop,\n    isNumber: isNumber,\n    isFunction: isFunction,\n    map: map,\n    deepMap: deepMap,\n    isEqual: isEqual,\n    clearUndefKey: clearUndefKey,\n    Defer: Defer,\n    defered: defered,\n    tplEngine: tplEngine,\n    forEach: forEach,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    removeDom: removeDom,\n    getParent: getParent,\n    getChildren: getChildren,\n    hasClass: hasClass,\n    getDomIndex: getDomIndex,\n    timestampToString: timestampToString,\n    extend: extend,\n    reverse: reverse,\n    openUrl: openUrl,\n    getBase64Image: getBase64Image,\n    getIncreasNumber: getIncreasNumber,\n\n    getDom: getDom,\n    queryDom: queryDom,\n    queryAllDom: queryAllDom,\n    getTemp: getTemp,\n    mountDialog: mountDialog,\n    getUrlQuery: getUrlQuery,\n    getRCUrlQuery: getRCUrlQuery,\n    deferNoop: deferNoop,\n    isEmpty: isEmpty,\n  };\n\n})(window);"
  },
  {
    "path": "api-test-v4/js/components/button.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    Service = RongIM.Service;\n\n  var OutputMark = {\n    SUCCESS: '成功',\n    FAILED: '失败'\n  };\n\n  var copyApi = function (api) {\n    var params = api.params || [];\n    var copyParams = utils.copy(params);\n    utils.forEach(params, function (item, index) {\n      utils.forEach(item, function (val, key) {\n        if (utils.isFunction(val)) {\n          copyParams[index][key] = val;\n        }\n      });\n    });\n    api.params = copyParams;\n    return api;\n  };\n\n  components.apiBtn = Vue.component('api-btn', {\n    template: utils.getTemp('rong-tpl-apibtn'),\n    props: ['api', 'isdragging'],\n    data: function() {\n      return {\n        isShowEditDialog: false,\n        selfApi: copyApi(this.api),\n        isOpen: false\n      }\n    },\n    watch: {\n      markMessage: function (newMsg) {\n        console.log(newMsg);\n      }\n    },\n    computed: {\n      tip: function() {\n        var api = this.selfApi;\n        return utils.tplEngine(TipTpl, api);\n      },\n      apiValue: function() {\n        var api = this.selfApi;\n        return utils.toJSON(api);\n      },\n      paramList: function () {\n        var paramList = this.selfApi.params;\n        return paramList;\n      },\n      hasParams: function () {\n        var params = this.selfApi.params;\n        return params && params.length;\n      }\n    },\n    methods: {\n      openUrl: utils.openUrl,\n      showEditDialog: function() {\n        this.isShowEditDialog = true;\n      },\n      hideEditDialog: function() {\n        this.isShowEditDialog = false;\n      },\n      change: function() {\n      },\n      run: function() {\n        var self = this;\n        var params = [];\n        var startTime = +new Date();\n        if(self.api.eventName === \"setMessageKV\") {\n          console.warn('send msg kv');\n          this.isOpen = true;\n          return;\n        }\n        utils.forEach(self.selfApi.params, function(item) {\n          if (item.type === 'number') {\n            item.value = Number(item.value);\n          }\n          params.push(item.value);\n        });\n        var imInstance = RongIM.vueInstance;\n\n        var addOutput = function(data, isSuccess) {\n          var currentTime = +new Date();\n          var consumedTime = currentTime - startTime;\n          var title = self.api.name + (isSuccess ? OutputMark.SUCCESS : OutputMark.FAILED);\n          var config = {};\n          if (!isSuccess) {\n            config.color = utils.TypeColor.FAILED;\n          }\n          self.hideEditDialog();\n          return imInstance.addOutput(title, data, consumedTime, params, config);\n        };\n        return self.api.event.apply(void 0, params).then(function(data) {\n          data = addOutput(data, true);\n          return {\n            isSuccess: true,\n            data: data\n          };\n        }).catch(function(errorInfo) {\n          // TODO 报警\n          // error = utils.isNumber(error) ? error : error.toString();\n          var data = addOutput(errorInfo, false);\n          return {\n            isSuccess: false,\n            data: data\n          };\n        });\n      }\n    },\n    mounted: function() {\n      var self = this;\n\n      var setParams = function () {\n        var paramList = self.selfApi.params;\n        utils.forEach(paramList, function (item) {\n          if (item.event) {\n            item.value = item.value || item.event();\n          }\n        });\n      };\n\n      setParams();\n      Service.msgEmitter.on('msgChanged', setParams);\n    }\n  });\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test-v4/js/components/json-alert.js",
    "content": "(function (win, dependencies) {\n  var RongIM = dependencies.RongIM;\n  var utils = RongIM.Utils;\n\n  RongIM.dialog = RongIM.dialog || {};\n  RongIM.dialog.jsonAlert = function(options) {\n    var vueInstance = RongIM.vueInstance;\n\n    options = options || {};\n\n    utils.mountDialog({\n      name: 'json-alert',\n      template: '#rong-json-alert',\n      data: function () {\n        return {\n          isShow: true,\n          data: options.data\n        };\n      },\n      watch: {\n        isShow: function(isShow) {\n          if (!isShow) {\n            utils.removeDom(this.$el);\n          }\n        }\n      },\n      methods: {\n        hide: function() {\n          this.isShow = false;\n        }\n      }\n    }, vueInstance);\n  };\n\n})(window, {\n  RongIM: RongIM\n});"
  },
  {
    "path": "api-test-v4/js/components/msg-expansion.js",
    "content": "(function (win, dependencies, components) {\n    var Vue = dependencies.Vue,\n      RongIM = dependencies.RongIM,\n      utils = RongIM.Utils,\n      Service = RongIM.Service;\n  \n    components.apiExpansion = Vue.component('api-expansion', {\n      template: utils.getTemp('rong-tpl-expansion'),\n      props: ['isOpen'],\n      data: function() {\n        return {\n            isOpen: true,\n        }\n      },\n      watch: {\n        isOpen: function (val, newval) {\n          console.warn(val, newval);\n        }\n      },\n      computed: {\n        \n      },\n      methods: {\n        \n      },\n      mounted: function() {\n        console.warn('msg-expansion');\n      }\n    });\n  \n  })(window, {\n    Vue: Vue,\n    iview: iview,\n    RongIM: RongIM\n  }, window.RongIM.components);"
  },
  {
    "path": "api-test-v4/js/login.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    RongIM = dependencies.RongIM,\n    utils = RongIM.Utils,\n    isDebug = RongIM.config.isDebug,\n    debugConf = RongIM.config.debugConf;\n\n  var ConfigPlacehoder = {\n    appkey: '开发者的融云 AppKey',\n    token: '开发者的用户 Token',\n    targetId: '对方 id. 发消息、获取历史消息等都默认对此用户操作. 默认聊天室、群组、个人 id 都为此 id',\n    navi: '导航地址. 注: 国内数据中心可不填',\n    customCMP: '链接地址(开发者忽略此项)',\n    isPolling: '若使用长轮训链接方式, 可选择此项(开发者可忽略)'\n  };\n\n  components.login = Vue.component('login', {\n    template: utils.getTemp('rong-global-config'),\n    props: ['config', 'login'],\n    computed: {\n      configList: function() {\n        var items = [];\n        utils.forEach(this.config, function(val, key) {\n          items.push({\n            type: typeof val,\n            name: key\n          });\n        });\n        return items;\n      },\n      prompt: function() {\n        return ConfigPlacehoder;\n      }\n    },\n    methods: {\n      clearStorage: function () {\n        window.localStorage.clear();\n        this.$Message.success({\n          background: true,\n          content: '清空本地缓存成功'\n        });\n      }\n    },\n    mounted: function () {\n      if (isDebug && debugConf.autoRun) {\n        var self = this;\n        Vue.nextTick(function () {\n          self.login(self.config);\n        });\n      }\n    }\n  });\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test-v4/js/main.js",
    "content": "(function (win, dependencies, components) {\n  var Vue = dependencies.Vue,\n    iview = dependencies.iview,\n    VueJsonPretty = dependencies.VueJsonPretty,\n    RongIM = dependencies.RongIM,\n    Service = RongIM.Service,\n    utils = RongIM.Utils,\n    ApiList = RongIM.ApiList,\n    DefailtReadyApiQueue = RongIM.DefailtReadyApiQueue,\n    DefaultConfig = RongIM.config.im,\n    Config = utils.copy(DefaultConfig),\n    Storage = utils.Storage,\n    StorageConfig = Storage.get(Storage.ConfigKey),\n    DefaultTargetId = Config.targetId,\n    isDebug = RongIM.config.isDebug,\n    debugConf = RongIM.config.debugConf;\n\n  DefailtReadyApiQueue.push([]);\n\n  var ValidStatus = [0, 1, 2, 6, 201, 202];\n  var ValidErrorCode = [23424, 23427, 23426, 23423];\n  var isStop = false;\n\n  var isStorageConfig = false;\n  if (StorageConfig && !isDebug) {\n    isStorageConfig = true;\n    Config = utils.copy(StorageConfig);\n  }\n  var urlQueryConfig = utils.getRCUrlQuery();\n  Config = utils.extend(Config, urlQueryConfig);\n\n  var ReceiveMsgTextTpl = '监听到{typeName} ({conversationType})消息. 发送者: {senderUserId}';\n  var StatusTextTpl = '链接状态: {statusName} ({status})';\n\n  var OptBoxClass = 'rong-ready-box';\n  var ApiBoxClass = 'rong-api-list';\n  var ApiSourceClass = 'rong-api-source';\n\n  var RunType = {\n    OneByOne: { name: '逐个运行', prompt: 'Api 逐个执行' },\n    LineByLine: { name: '逐行运行', prompt: '每行 Api 并行. 执行完一行后执行下一行' }\n  };\n  \n  var vueInstance;\n\n  function runAllApi(allRefs, currentIndex, finishCallback) {\n    var total = allRefs.length;\n    var isFinished = total === currentIndex || isStop;\n    if (isFinished) {\n      return finishCallback && finishCallback();\n    }\n    var refList = allRefs[currentIndex];\n    var deferArr = [];\n    utils.forEach(refList, function (instance) {\n      deferArr.push(instance.run());\n    });\n    return utils.Defer.all(deferArr).then(function (result) {\n      result = result[0];\n      var isSuccess = result.isSuccess || ValidErrorCode.indexOf(result.data.result) !== -1;\n      if (isSuccess) {\n        vueInstance.runInfo.successApiCount++;\n      } else {\n        vueInstance.runInfo.failApiList.push(result.data);\n      }\n      currentIndex++;\n      runAllApi(allRefs, currentIndex, finishCallback);\n    });\n  }\n\n  function runOneByOne(finishCallback) {\n    var refs = vueInstance.$refs;\n    var allRefs = [];\n    utils.forEach(refs, function (subRefList) {\n      utils.forEach(subRefList, function (ref) {\n        allRefs.push([ ref ]);\n      });\n    });\n    runAllApi(allRefs, 0, finishCallback);\n  }\n\n  function runLineByLine(finishCallback) {\n    var refs = vueInstance.$refs;\n    var allRefs = [];\n    utils.forEach(refs, function (ins) {\n      allRefs.push(ins);\n    });\n    runAllApi(allRefs, 0, finishCallback);\n  }\n\n  function setConfig(config) {\n    var currentTargetId = config.targetId;\n    vueInstance.globalConfig = config;\n    vueInstance.readyApiQueue = utils.deepMap(vueInstance.readyApiQueue, function (item) {\n      if (item === DefaultTargetId) {\n        item = currentTargetId;\n      }\n      return item;\n    });\n  }\n\n  function watchStatus(status) {\n    var title = utils.tplEngine(StatusTextTpl, {\n      status: status,\n      statusName: utils.StatusName[status]\n    });\n    var output = vueInstance.addOutput(title, status, 0, [], {\n      color: utils.TypeColor.STATUS\n    });\n    if (ValidStatus.indexOf(status) === -1) {\n      vueInstance.runInfo.failApiList.push(output);\n    }\n    var isSuccess = utils.SuccessStatus.indexOf(status) !== -1;\n    var event = isSuccess ? vueInstance.$Message.success : vueInstance.$Message.error;\n    event.call(vueInstance.$Message, {\n      background: true,\n      content: title\n    });\n  }\n\n  function watchMessage(message) {\n    if (RongIM.config.isDebug && !RongIM.config.debugConf.isShowMsg) {\n      return;\n    }\n    var title = utils.tplEngine(ReceiveMsgTextTpl, {\n      typeName: utils.ConversationName[message.type],\n      conversationType: message.type,\n      senderUserId: message.senderUserId\n    });\n    vueInstance.addOutput(title, message, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n    console.log('Reveice Msg', utils.toJSON(message));\n  }\n\n  function watchChatroom(entries) {\n    vueInstance.addOutput('监听到聊天室 KV 更新', entries, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n  }\n\n  function innerEl(text) {\n    var newEl = document.createElement('p');\n    newEl.innerText = text;\n    newEl.style = \"border-bottom: 1px sloid #333\";\n    var exEl = document.getElementById('rong-ex-content');\n    if(exEl) {\n      var exElLen = exEl.childNodes.length;\n      if(exElLen == 0) {\n        exEl.appendChild(newEl);\n      }else {\n        exEl.insertBefore(newEl, exEl.childNodes[exElLen-1].nextSibling);\n      }\n    }\n  }\n\n  function watchExpansion(event) {\n    console.warn(event);\n    var updatedExpansion = event.updatedExpansion;\n    var deletedExpansion = event.deletedExpansion;\n    vueInstance.addOutput('监听到消息 KV 变更', event, 0, [], {\n      color: utils.TypeColor.MSG\n    });\n    if(updatedExpansion){\n      var time = utils.timestampToString(updatedExpansion.updatedTime),\n        expansion = updatedExpansion.expansion,\n        msgUId = updatedExpansion.messageUId;\n      innerEl(`${time}: 监听更新, msgUId: ${msgUId}, expansion: ${JSON.stringify(expansion)}`)\n    }\n    if(deletedExpansion){\n      var time = utils.timestampToString(deletedExpansion.updatedTime),\n        keys = deletedExpansion.deletedKeys,\n        msgUId = deletedExpansion.messageUId;\n      innerEl(`${time}: 监听删除, keys: ${keys} | msgUId: ${msgUId}`)\n    }\n  }\n\n  function autoRun() {\n    Vue.nextTick(function () {\n      runOneByOne(function () {\n        vueInstance.runInfo.runCount++;\n        localStorage.removeItem('rong_servers');\n        localStorage.removeItem('rong_fullnavi');\n        vueInstance.outputList = [];\n        vueInstance.allOutputList = [];\n        !isStop && autoRun();\n      });\n    });\n  }\n\n  function loginSuccessEvent(userId, config) {\n    vueInstance.$Message.success({\n      background: true,\n      content: '链接成功 ' + userId\n    });\n    vueInstance.currentUserId = userId;\n    vueInstance.isLogged = true;\n    if (isDebug && debugConf.autoRun) {\n      Vue.nextTick(autoRun);\n    }\n  }\n\n  function login(config) {\n    setConfig(config);\n    return Service.init(config, {\n      status: watchStatus,\n      message: watchMessage,\n      chatroom: watchChatroom,\n      expansion: watchExpansion\n    }).then(function (userId) {\n      Storage.set(Storage.ConfigKey, config);\n      loginSuccessEvent(userId.id, config);\n    }).catch(function (error) {\n      console.log(error);\n      vueInstance.$Message.error({\n        background: true,\n        content: '链接失败 ' + JSON.stringify(error)\n      });\n      return utils.Defer.reject();\n    });\n  }\n\n  function getApiListMethods() {\n    return {\n      addOutput: function (title, result, consumedTime, params, config) {\n        config = config || {};\n        var output = {\n          id: utils.getIncreasNumber(),\n          title: title,\n          result: result,\n          consumedTime: consumedTime,\n          params: params,\n          config: config\n        };\n        output.time = utils.timestampToString();\n        vueInstance.allOutputList.push(output);\n        vueInstance.outputList.push(output);\n        return output;\n      },\n      clearOutput: function () {\n        vueInstance.outputList = [];\n      },\n      showAllOutput: function () {\n        vueInstance.outputList = vueInstance.allOutputList;\n      },\n      toJSON: function (data) {\n        return utils.toJSON(data);\n      },\n      showJSONAlert: function(data) {\n        RongIM.dialog.jsonAlert({\n          data: data\n        });\n      },\n      runAllApi: function() {\n        if (vueInstance.runType === 'OneByOne') {\n          runOneByOne();\n        } else {\n          runLineByLine();\n        }\n      },\n      startDragging: function () {\n        setTimeout(function() {\n          vueInstance.isDragging = true;\n        }, 100);\n      }\n    };\n  }\n\n  function getServiceMethods() {\n    return {\n      openUrl: utils.openUrl,\n      reverse: utils.reverse,\n      login: function(config) {\n        var isEqualStorage = utils.isEqual(config, StorageConfig);\n        var isEqualDefault = utils.isEqual(config, DefaultConfig);\n        if (isStorageConfig && isEqualStorage && !isEqualDefault && !isDebug) {\n          vueInstance.$Modal.confirm({\n            title: '注意',\n            content: '您目前使用的为上一次链接配置, 请确定配置是否可用 ?',\n            onOk: function () {\n              login(config);\n            }\n          });\n        } else {\n          return login(config);\n        }\n      },\n      alarm: function () {\n        if (!this.isAlarmMuted) {\n          vueInstance.$refs.alarm.play();\n        }\n      },\n      mute: function () {\n        vueInstance.$refs.alarm.pause();\n      },\n      showMsgExpansion: function() {\n        if(vueInstance.openMsgEx) {\n          vueInstance.openMsgEx = false;\n        }else {\n          vueInstance.openMsgEx = true;\n        }\n        var data = vueInstance.exData;\n        data.joinBtn = true;\n        data.setBtn = data.showInputBtn = data.showId = data.showUId = data.showKey = data.showVal = data.showMsg = false;\n      },\n      exJoin(type) {\n        var data = vueInstance.exData;\n        data.type = type;\n        data.showInputBtn = data.showId = data.setBtn = true;\n        data.joinBtn = false;\n        data.exeEvent = () => {\n          var type = data.type === 1 ? '单聊' : '群聊';\n          var time = utils.timestampToString(new Date().getTime());\n          innerEl(`时间:${time}加入${type}${data.targetId}成功`)\n        }\n      },\n      setKey() {\n        var data = vueInstance.exData;\n        data.showId =  data.showMsg = false;\n        data.showUId = data.showKey =  data.showVal = true;\n        \n        var time = utils.timestampToString(new Date().getTime());\n        data.exeEvent = () => {\n          var type = data.type;\n          var targetId = data.targetId;\n          var msgUId = data.msgUId;\n          \n          Service.updateMessageExpansion(type, targetId, msgUId, data.msgKeys, data.msgValues, data.canIncludeExpansion, true).then(()=> {\n            innerEl(`时间:${time}设置成功`)\n          },(rea) => {\n            innerEl(`时间:${time}设置失败, ${JSON.stringify(rea)}`);\n          });\n        }\n      },\n      delKey() {\n        var data = vueInstance.exData;\n        data.showId = data.showVal = data.showMsg = false;\n        data.showUId = data.showKey = true;\n        data.exeEvent = () => {\n          var type = data.type;\n          var targetId = data.targetId;\n          var msgUId = data.msgUId;\n          var keys = data.msgKeys;\n          var time = utils.timestampToString(new Date().getTime());\n          Service.removeMessageExpansion(type, targetId, keys, msgUId, data.canIncludeExpansion, true).then(()=> {\n            innerEl(`时间:${time}删除成功`)\n          },(rea) => {\n            innerEl(`时间:${time}删除失败, ${JSON.stringify(rea)}`);\n          });\n        }\n      },\n      delAllKey() {\n        var data = vueInstance.exData;\n        data.showId = data.showVal = data.showMsg = false;\n        data.showUId = data.showKey = true;\n        data.exeEvent = () => {\n          var type = data.type;\n          var targetId = data.targetId;\n          var msgUId = data.msgUId;\n          var time = utils.timestampToString(new Date().getTime());\n          Service.removeMessageAllExpansion(type, targetId, msgUId).then(()=> {\n            innerEl(`时间:${time}删除成功`)\n          },(rea) => {\n            innerEl(`时间:${time}删除失败, ${JSON.stringify(rea)}`);\n          });\n        }\n      },\n      getList() {\n        var data = vueInstance.exData;\n        data.exeEvent = () => {\n          var type = data.type;\n          var targetId = data.targetId;\n          Service.getHistoryMessages(0, 20, type, targetId).then((list) => {\n            RongIM.dialog.jsonAlert({\n              data: list\n            });\n          },rea => {\n\n          })\n        }\n      },\n      sendMsg() {\n        var data = vueInstance.exData;\n        data.showId = data.showUId = data.showKey = data.showVal = false;\n        data.showMsg = true;\n        var data = vueInstance.exData;\n        data.exeEvent = () => {\n          console.log('发送消息成功', data.msgContent);\n        }\n      },\n      exConfirm() {\n        var data = vueInstance.exData;\n        data.exeEvent();\n      },\n      exCancel() {\n        //置空\n        console.log('取消成功');\n      },\n      \n    };\n  }\n\n\n  Vue.use(iview);\n\n  vueInstance = new Vue({\n    el: '#app',\n    data: function() {\n      return {\n        currentUserId: '',\n        isLogged: false,\n        readyApiQueue: DefailtReadyApiQueue,\n        allOutputList: [],\n        outputList: [],\n        globalConfig: Config,\n        RunType: RunType,\n        runType: 'OneByOne',\n\n        alertJSON: null,\n        isDragging: false,\n        isShowRunType: false,\n        isShowOutList: false,\n\n        isDebug: RongIM.config.isDebug,\n        runInfo: {\n          runCount: 0,\n          successApiCount: 0,\n          failApiList: []\n        },\n        isAlarmMuted: false,\n        openMsgEx: false,\n        exData: {\n          title: 'sdfsdf',\n          exeEvent: null,\n          type: null,\n          targetId: null,\n          joinBtn: true,\n          showInputBtn: false,\n          setBtn: false,\n          showId: false,\n          showUId: false,\n          showKey: false,\n          showVal: false,\n          showMsg: false,\n          targetId: null,\n          msgUId: null,\n          msgKeys: null,\n          msgValues: null,\n          msgContent: null,\n          canIncludeExpansion: true,\n        }\n      };\n    },\n    computed: {\n      apiList: function() {\n        return ApiList;\n      },\n      changeUserApi: function () {\n        var self = this;\n        var changeUserApi = RongIM.Api.changeUser;\n        var changeUserEvent = changeUserApi.event;\n        changeUserApi.event = function (token) {\n          var globalConfig = self.globalConfig\n          globalConfig.token = token;\n          return Service.changeUser(globalConfig, {\n            status: watchStatus,\n            message: watchMessage,\n            expansion: watchExpansion\n          }).then(function (userId) {\n            loginSuccessEvent(userId, globalConfig);\n          }).catch(function () {\n            vueInstance.$Message.error({\n              background: true,\n              content: '切换用户失败 ' + error\n            });\n          });\n        };\n        return changeUserApi;\n      },\n      currentOutput: function() {\n        var outputList = this.outputList;\n        if (outputList.length) {\n          return outputList[outputList.length - 1];\n        }\n      },\n      displayedOutputList: function () {\n        if (isDebug) {\n          return this.runInfo.failApiList;\n        } else {\n          return this.outputList;\n        }\n      }\n    },\n    watch: {\n      'runInfo.failApiList': function (newList) {\n        if (newList.length > 20) {\n          this.alarm();\n        }\n      },\n      isAlarmMuted: function (isMuted) {\n        if (isMuted) {\n          this.mute();\n        }\n      }\n    },\n    components: {\n      apiBtn: components.apiBtn,\n      login: components.login,\n      apiExpansion: components.apiExpansion,\n      prettyjson: Vue.component('prettyjson', VueJsonPretty.default)\n    },\n    mounted: function() {\n      this.isPageLoaded = true;\n    },\n    methods: utils.extend(getApiListMethods(), getServiceMethods())\n  });\n\n  RongIM.vueInstance = vueInstance;\n\n  (function () {\n    function start() {\n      isStop = false;\n      if (vueInstance.isLogged) {\n        autoRun();\n      } else {\n        vueInstance.login(vueInstance.globalConfig).then(autoRun);\n      }\n    }\n    window.addEventListener(\"message\", function (event) {\n      var type = event.data;\n      if (type === 'start') {\n        start();\n      } else if (type === 'pause') {\n        isStop = true;\n      }\n    }, false);\n  })();\n\n})(window, {\n  Vue: Vue,\n  iview: iview,\n  VueJsonPretty: VueJsonPretty,\n  RongIM: RongIM\n}, window.RongIM.components);"
  },
  {
    "path": "api-test-v4/lib/js/RongIMLib-4.1.0.js",
    "content": "/**\n * @rongcloud/imlib-v4\n * Version: v4.1.0\n * CommitId: 0012eb74bbf7318ea4a4e2ee3e3e858d6849090c\n * Date: Mon Dec 28 2020 11:08:22 GMT+0800 (China Standard Time)\n * ©2020 RongCloud, Inc. All rights reserved.\n */\nvar RongIMLib = (function (exports) {\n  'use strict';\n\n  /*! *****************************************************************************\n  Copyright (c) Microsoft Corporation.\n\n  Permission to use, copy, modify, and/or distribute this software for any\n  purpose with or without fee is hereby granted.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n  PERFORMANCE OF THIS SOFTWARE.\n  ***************************************************************************** */\n\n  function __awaiter(thisArg, _arguments, P, generator) {\n      function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n      return new (P || (P = Promise))(function (resolve, reject) {\n          function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n          function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n          function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n          step((generator = generator.apply(thisArg, _arguments || [])).next());\n      });\n  }\n\n  function _typeof(obj) {\n    \"@babel/helpers - typeof\";\n\n    if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n      _typeof = function (obj) {\n        return typeof obj;\n      };\n    } else {\n      _typeof = function (obj) {\n        return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n      };\n    }\n\n    return _typeof(obj);\n  }\n\n  function _classCallCheck(instance, Constructor) {\n    if (!(instance instanceof Constructor)) {\n      throw new TypeError(\"Cannot call a class as a function\");\n    }\n  }\n\n  function _defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n\n  function _createClass(Constructor, protoProps, staticProps) {\n    if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) _defineProperties(Constructor, staticProps);\n    return Constructor;\n  }\n\n  function _defineProperty(obj, key, value) {\n    if (key in obj) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      obj[key] = value;\n    }\n\n    return obj;\n  }\n\n  function _inherits(subClass, superClass) {\n    if (typeof superClass !== \"function\" && superClass !== null) {\n      throw new TypeError(\"Super expression must either be null or a function\");\n    }\n\n    subClass.prototype = Object.create(superClass && superClass.prototype, {\n      constructor: {\n        value: subClass,\n        writable: true,\n        configurable: true\n      }\n    });\n    if (superClass) _setPrototypeOf(subClass, superClass);\n  }\n\n  function _getPrototypeOf(o) {\n    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n      return o.__proto__ || Object.getPrototypeOf(o);\n    };\n    return _getPrototypeOf(o);\n  }\n\n  function _setPrototypeOf(o, p) {\n    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n      o.__proto__ = p;\n      return o;\n    };\n\n    return _setPrototypeOf(o, p);\n  }\n\n  function _isNativeReflectConstruct() {\n    if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n    if (Reflect.construct.sham) return false;\n    if (typeof Proxy === \"function\") return true;\n\n    try {\n      Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n      return true;\n    } catch (e) {\n      return false;\n    }\n  }\n\n  function _construct(Parent, args, Class) {\n    if (_isNativeReflectConstruct()) {\n      _construct = Reflect.construct;\n    } else {\n      _construct = function _construct(Parent, args, Class) {\n        var a = [null];\n        a.push.apply(a, args);\n        var Constructor = Function.bind.apply(Parent, a);\n        var instance = new Constructor();\n        if (Class) _setPrototypeOf(instance, Class.prototype);\n        return instance;\n      };\n    }\n\n    return _construct.apply(null, arguments);\n  }\n\n  function _isNativeFunction(fn) {\n    return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n  }\n\n  function _wrapNativeSuper(Class) {\n    var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n    _wrapNativeSuper = function _wrapNativeSuper(Class) {\n      if (Class === null || !_isNativeFunction(Class)) return Class;\n\n      if (typeof Class !== \"function\") {\n        throw new TypeError(\"Super expression must either be null or a function\");\n      }\n\n      if (typeof _cache !== \"undefined\") {\n        if (_cache.has(Class)) return _cache.get(Class);\n\n        _cache.set(Class, Wrapper);\n      }\n\n      function Wrapper() {\n        return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n      }\n\n      Wrapper.prototype = Object.create(Class.prototype, {\n        constructor: {\n          value: Wrapper,\n          enumerable: false,\n          writable: true,\n          configurable: true\n        }\n      });\n      return _setPrototypeOf(Wrapper, Class);\n    };\n\n    return _wrapNativeSuper(Class);\n  }\n\n  function _newArrowCheck(innerThis, boundThis) {\n    if (innerThis !== boundThis) {\n      throw new TypeError(\"Cannot instantiate an arrow function\");\n    }\n  }\n\n  function _assertThisInitialized(self) {\n    if (self === void 0) {\n      throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n    }\n\n    return self;\n  }\n\n  function _possibleConstructorReturn(self, call) {\n    if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n      return call;\n    }\n\n    return _assertThisInitialized(self);\n  }\n\n  function _createSuper(Derived) {\n    var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n    return function _createSuperInternal() {\n      var Super = _getPrototypeOf(Derived),\n          result;\n\n      if (hasNativeReflectConstruct) {\n        var NewTarget = _getPrototypeOf(this).constructor;\n\n        result = Reflect.construct(Super, arguments, NewTarget);\n      } else {\n        result = Super.apply(this, arguments);\n      }\n\n      return _possibleConstructorReturn(this, result);\n    };\n  }\n\n  function _superPropBase(object, property) {\n    while (!Object.prototype.hasOwnProperty.call(object, property)) {\n      object = _getPrototypeOf(object);\n      if (object === null) break;\n    }\n\n    return object;\n  }\n\n  function _get(target, property, receiver) {\n    if (typeof Reflect !== \"undefined\" && Reflect.get) {\n      _get = Reflect.get;\n    } else {\n      _get = function _get(target, property, receiver) {\n        var base = _superPropBase(target, property);\n\n        if (!base) return;\n        var desc = Object.getOwnPropertyDescriptor(base, property);\n\n        if (desc.get) {\n          return desc.get.call(receiver);\n        }\n\n        return desc.value;\n      };\n    }\n\n    return _get(target, property, receiver || target);\n  }\n\n  function _toConsumableArray(arr) {\n    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n  }\n\n  function _arrayWithoutHoles(arr) {\n    if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n  }\n\n  function _iterableToArray(iter) {\n    if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n  }\n\n  function _unsupportedIterableToArray(o, minLen) {\n    if (!o) return;\n    if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n    var n = Object.prototype.toString.call(o).slice(8, -1);\n    if (n === \"Object\" && o.constructor) n = o.constructor.name;\n    if (n === \"Map\" || n === \"Set\") return Array.from(o);\n    if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n  }\n\n  function _arrayLikeToArray(arr, len) {\n    if (len == null || len > arr.length) len = arr.length;\n\n    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n    return arr2;\n  }\n\n  function _nonIterableSpread() {\n    throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n  }\n\n  var runtime = function (exports) {\n\n    var Op = Object.prototype;\n    var hasOwn = Op.hasOwnProperty;\n    var undefined$1;\n    var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n    var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n    var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n    var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n    function define(obj, key, value) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n      return obj[key];\n    }\n\n    try {\n      define({}, \"\");\n    } catch (err) {\n      define = function define(obj, key, value) {\n        return obj[key] = value;\n      };\n    }\n\n    function wrap(innerFn, outerFn, self, tryLocsList) {\n      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n      var generator = Object.create(protoGenerator.prototype);\n      var context = new Context(tryLocsList || []);\n      generator._invoke = makeInvokeMethod(innerFn, self, context);\n      return generator;\n    }\n\n    exports.wrap = wrap;\n\n    function tryCatch(fn, obj, arg) {\n      try {\n        return {\n          type: \"normal\",\n          arg: fn.call(obj, arg)\n        };\n      } catch (err) {\n        return {\n          type: \"throw\",\n          arg: err\n        };\n      }\n    }\n\n    var GenStateSuspendedStart = \"suspendedStart\";\n    var GenStateSuspendedYield = \"suspendedYield\";\n    var GenStateExecuting = \"executing\";\n    var GenStateCompleted = \"completed\";\n    var ContinueSentinel = {};\n\n    function Generator() {}\n\n    function GeneratorFunction() {}\n\n    function GeneratorFunctionPrototype() {}\n\n    var IteratorPrototype = {};\n\n    IteratorPrototype[iteratorSymbol] = function () {\n      return this;\n    };\n\n    var getProto = Object.getPrototypeOf;\n    var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n\n    if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n      IteratorPrototype = NativeIteratorPrototype;\n    }\n\n    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n    GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n    GeneratorFunctionPrototype.constructor = GeneratorFunction;\n    GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\");\n\n    function defineIteratorMethods(prototype) {\n      [\"next\", \"throw\", \"return\"].forEach(function (method) {\n        define(prototype, method, function (arg) {\n          return this._invoke(method, arg);\n        });\n      });\n    }\n\n    exports.isGeneratorFunction = function (genFun) {\n      var ctor = typeof genFun === \"function\" && genFun.constructor;\n      return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === \"GeneratorFunction\" : false;\n    };\n\n    exports.mark = function (genFun) {\n      if (Object.setPrototypeOf) {\n        Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n      } else {\n        genFun.__proto__ = GeneratorFunctionPrototype;\n        define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n      }\n\n      genFun.prototype = Object.create(Gp);\n      return genFun;\n    };\n\n    exports.awrap = function (arg) {\n      return {\n        __await: arg\n      };\n    };\n\n    function AsyncIterator(generator, PromiseImpl) {\n      function invoke(method, arg, resolve, reject) {\n        var record = tryCatch(generator[method], generator, arg);\n\n        if (record.type === \"throw\") {\n          reject(record.arg);\n        } else {\n          var result = record.arg;\n          var value = result.value;\n\n          if (value && _typeof(value) === \"object\" && hasOwn.call(value, \"__await\")) {\n            return PromiseImpl.resolve(value.__await).then(function (value) {\n              invoke(\"next\", value, resolve, reject);\n            }, function (err) {\n              invoke(\"throw\", err, resolve, reject);\n            });\n          }\n\n          return PromiseImpl.resolve(value).then(function (unwrapped) {\n            result.value = unwrapped;\n            resolve(result);\n          }, function (error) {\n            return invoke(\"throw\", error, resolve, reject);\n          });\n        }\n      }\n\n      var previousPromise;\n\n      function enqueue(method, arg) {\n        function callInvokeWithMethodAndArg() {\n          return new PromiseImpl(function (resolve, reject) {\n            invoke(method, arg, resolve, reject);\n          });\n        }\n\n        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n      }\n\n      this._invoke = enqueue;\n    }\n\n    defineIteratorMethods(AsyncIterator.prototype);\n\n    AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n      return this;\n    };\n\n    exports.AsyncIterator = AsyncIterator;\n\n    exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n      if (PromiseImpl === void 0) PromiseImpl = Promise;\n      var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n        return result.done ? result.value : iter.next();\n      });\n    };\n\n    function makeInvokeMethod(innerFn, self, context) {\n      var state = GenStateSuspendedStart;\n      return function invoke(method, arg) {\n        if (state === GenStateExecuting) {\n          throw new Error(\"Generator is already running\");\n        }\n\n        if (state === GenStateCompleted) {\n          if (method === \"throw\") {\n            throw arg;\n          }\n\n          return doneResult();\n        }\n\n        context.method = method;\n        context.arg = arg;\n\n        while (true) {\n          var delegate = context.delegate;\n\n          if (delegate) {\n            var delegateResult = maybeInvokeDelegate(delegate, context);\n\n            if (delegateResult) {\n              if (delegateResult === ContinueSentinel) continue;\n              return delegateResult;\n            }\n          }\n\n          if (context.method === \"next\") {\n            context.sent = context._sent = context.arg;\n          } else if (context.method === \"throw\") {\n            if (state === GenStateSuspendedStart) {\n              state = GenStateCompleted;\n              throw context.arg;\n            }\n\n            context.dispatchException(context.arg);\n          } else if (context.method === \"return\") {\n            context.abrupt(\"return\", context.arg);\n          }\n\n          state = GenStateExecuting;\n          var record = tryCatch(innerFn, self, context);\n\n          if (record.type === \"normal\") {\n            state = context.done ? GenStateCompleted : GenStateSuspendedYield;\n\n            if (record.arg === ContinueSentinel) {\n              continue;\n            }\n\n            return {\n              value: record.arg,\n              done: context.done\n            };\n          } else if (record.type === \"throw\") {\n            state = GenStateCompleted;\n            context.method = \"throw\";\n            context.arg = record.arg;\n          }\n        }\n      };\n    }\n\n    function maybeInvokeDelegate(delegate, context) {\n      var method = delegate.iterator[context.method];\n\n      if (method === undefined$1) {\n        context.delegate = null;\n\n        if (context.method === \"throw\") {\n          if (delegate.iterator[\"return\"]) {\n            context.method = \"return\";\n            context.arg = undefined$1;\n            maybeInvokeDelegate(delegate, context);\n\n            if (context.method === \"throw\") {\n              return ContinueSentinel;\n            }\n          }\n\n          context.method = \"throw\";\n          context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n        }\n\n        return ContinueSentinel;\n      }\n\n      var record = tryCatch(method, delegate.iterator, context.arg);\n\n      if (record.type === \"throw\") {\n        context.method = \"throw\";\n        context.arg = record.arg;\n        context.delegate = null;\n        return ContinueSentinel;\n      }\n\n      var info = record.arg;\n\n      if (!info) {\n        context.method = \"throw\";\n        context.arg = new TypeError(\"iterator result is not an object\");\n        context.delegate = null;\n        return ContinueSentinel;\n      }\n\n      if (info.done) {\n        context[delegate.resultName] = info.value;\n        context.next = delegate.nextLoc;\n\n        if (context.method !== \"return\") {\n          context.method = \"next\";\n          context.arg = undefined$1;\n        }\n      } else {\n        return info;\n      }\n\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    defineIteratorMethods(Gp);\n    define(Gp, toStringTagSymbol, \"Generator\");\n\n    Gp[iteratorSymbol] = function () {\n      return this;\n    };\n\n    Gp.toString = function () {\n      return \"[object Generator]\";\n    };\n\n    function pushTryEntry(locs) {\n      var entry = {\n        tryLoc: locs[0]\n      };\n\n      if (1 in locs) {\n        entry.catchLoc = locs[1];\n      }\n\n      if (2 in locs) {\n        entry.finallyLoc = locs[2];\n        entry.afterLoc = locs[3];\n      }\n\n      this.tryEntries.push(entry);\n    }\n\n    function resetTryEntry(entry) {\n      var record = entry.completion || {};\n      record.type = \"normal\";\n      delete record.arg;\n      entry.completion = record;\n    }\n\n    function Context(tryLocsList) {\n      this.tryEntries = [{\n        tryLoc: \"root\"\n      }];\n      tryLocsList.forEach(pushTryEntry, this);\n      this.reset(true);\n    }\n\n    exports.keys = function (object) {\n      var keys = [];\n\n      for (var key in object) {\n        keys.push(key);\n      }\n\n      keys.reverse();\n      return function next() {\n        while (keys.length) {\n          var key = keys.pop();\n\n          if (key in object) {\n            next.value = key;\n            next.done = false;\n            return next;\n          }\n        }\n\n        next.done = true;\n        return next;\n      };\n    };\n\n    function values(iterable) {\n      if (iterable) {\n        var iteratorMethod = iterable[iteratorSymbol];\n\n        if (iteratorMethod) {\n          return iteratorMethod.call(iterable);\n        }\n\n        if (typeof iterable.next === \"function\") {\n          return iterable;\n        }\n\n        if (!isNaN(iterable.length)) {\n          var i = -1,\n              next = function next() {\n            while (++i < iterable.length) {\n              if (hasOwn.call(iterable, i)) {\n                next.value = iterable[i];\n                next.done = false;\n                return next;\n              }\n            }\n\n            next.value = undefined$1;\n            next.done = true;\n            return next;\n          };\n\n          return next.next = next;\n        }\n      }\n\n      return {\n        next: doneResult\n      };\n    }\n\n    exports.values = values;\n\n    function doneResult() {\n      return {\n        value: undefined$1,\n        done: true\n      };\n    }\n\n    Context.prototype = {\n      constructor: Context,\n      reset: function reset(skipTempReset) {\n        this.prev = 0;\n        this.next = 0;\n        this.sent = this._sent = undefined$1;\n        this.done = false;\n        this.delegate = null;\n        this.method = \"next\";\n        this.arg = undefined$1;\n        this.tryEntries.forEach(resetTryEntry);\n\n        if (!skipTempReset) {\n          for (var name in this) {\n            if (name.charAt(0) === \"t\" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {\n              this[name] = undefined$1;\n            }\n          }\n        }\n      },\n      stop: function stop() {\n        this.done = true;\n        var rootEntry = this.tryEntries[0];\n        var rootRecord = rootEntry.completion;\n\n        if (rootRecord.type === \"throw\") {\n          throw rootRecord.arg;\n        }\n\n        return this.rval;\n      },\n      dispatchException: function dispatchException(exception) {\n        if (this.done) {\n          throw exception;\n        }\n\n        var context = this;\n\n        function handle(loc, caught) {\n          record.type = \"throw\";\n          record.arg = exception;\n          context.next = loc;\n\n          if (caught) {\n            context.method = \"next\";\n            context.arg = undefined$1;\n          }\n\n          return !!caught;\n        }\n\n        for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n          var entry = this.tryEntries[i];\n          var record = entry.completion;\n\n          if (entry.tryLoc === \"root\") {\n            return handle(\"end\");\n          }\n\n          if (entry.tryLoc <= this.prev) {\n            var hasCatch = hasOwn.call(entry, \"catchLoc\");\n            var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n            if (hasCatch && hasFinally) {\n              if (this.prev < entry.catchLoc) {\n                return handle(entry.catchLoc, true);\n              } else if (this.prev < entry.finallyLoc) {\n                return handle(entry.finallyLoc);\n              }\n            } else if (hasCatch) {\n              if (this.prev < entry.catchLoc) {\n                return handle(entry.catchLoc, true);\n              }\n            } else if (hasFinally) {\n              if (this.prev < entry.finallyLoc) {\n                return handle(entry.finallyLoc);\n              }\n            } else {\n              throw new Error(\"try statement without catch or finally\");\n            }\n          }\n        }\n      },\n      abrupt: function abrupt(type, arg) {\n        for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n          var entry = this.tryEntries[i];\n\n          if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n            var finallyEntry = entry;\n            break;\n          }\n        }\n\n        if (finallyEntry && (type === \"break\" || type === \"continue\") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {\n          finallyEntry = null;\n        }\n\n        var record = finallyEntry ? finallyEntry.completion : {};\n        record.type = type;\n        record.arg = arg;\n\n        if (finallyEntry) {\n          this.method = \"next\";\n          this.next = finallyEntry.finallyLoc;\n          return ContinueSentinel;\n        }\n\n        return this.complete(record);\n      },\n      complete: function complete(record, afterLoc) {\n        if (record.type === \"throw\") {\n          throw record.arg;\n        }\n\n        if (record.type === \"break\" || record.type === \"continue\") {\n          this.next = record.arg;\n        } else if (record.type === \"return\") {\n          this.rval = this.arg = record.arg;\n          this.method = \"return\";\n          this.next = \"end\";\n        } else if (record.type === \"normal\" && afterLoc) {\n          this.next = afterLoc;\n        }\n\n        return ContinueSentinel;\n      },\n      finish: function finish(finallyLoc) {\n        for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n          var entry = this.tryEntries[i];\n\n          if (entry.finallyLoc === finallyLoc) {\n            this.complete(entry.completion, entry.afterLoc);\n            resetTryEntry(entry);\n            return ContinueSentinel;\n          }\n        }\n      },\n      \"catch\": function _catch(tryLoc) {\n        for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n          var entry = this.tryEntries[i];\n\n          if (entry.tryLoc === tryLoc) {\n            var record = entry.completion;\n\n            if (record.type === \"throw\") {\n              var thrown = record.arg;\n              resetTryEntry(entry);\n            }\n\n            return thrown;\n          }\n        }\n\n        throw new Error(\"illegal catch attempt\");\n      },\n      delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n        this.delegate = {\n          iterator: values(iterable),\n          resultName: resultName,\n          nextLoc: nextLoc\n        };\n\n        if (this.method === \"next\") {\n          this.arg = undefined$1;\n        }\n\n        return ContinueSentinel;\n      }\n    };\n    return exports;\n  }((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === \"object\" ? module.exports : {});\n\n  try {\n    regeneratorRuntime = runtime;\n  } catch (accidentalStrictMode) {\n    Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n  }\n\n  var _this = undefined,\n      _methods,\n      _validators,\n      _SSMsg,\n      _PublishTopicToConver,\n      _ConversationTypeToQu,\n      _ConversationTypeToCl;\n\n  var ReceivedStatus;\n\n  (function (ReceivedStatus) {\n    ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n    ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n    ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n    ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n    ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n  })(ReceivedStatus || (ReceivedStatus = {}));\n\n  var ReceivedStatus$1 = ReceivedStatus;\n  var NAVI_CACHE_DURATION = 2 * 60 * 60 * 1000;\n  var NAVI_REQ_TIMEOUT = 10 * 1000;\n  var PING_REQ_TIMEOUT = 5 * 1000;\n  var WEB_SOCKET_TIMEOUT = 5 * 1000;\n  var PUBLIC_CLOUD_NAVI_URIS = ['https://nav.cn.ronghub.com', 'https://nav2-cn.ronghub.com'];\n  var MINI_SOCKET_CONNECT_URIS = ['wsproxy.cn.ronghub.com', 'wsap-cn.ronghub.com'];\n  var MINI_COMET_CONNECT_URIS = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\n  var IM_SIGNAL_TIMEOUT = 30 * 1000;\n  var IM_PING_INTERVAL_TIME = 30 * 1000;\n  var MAX_MESSAGE_CONTENT_BYTES = 128 * 1024;\n  var IM_COMET_PULLMSG_TIMEOUT = 45000;\n  var STORAGE_ROOT_KEY = 'RCV4-';\n  var SEND_MESSAGE_TYPE_OPTION = {\n    'RC:TxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:VcMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgTextMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:FileMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:HQVCMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:LBSMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSMultiImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpOpendMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:CombineMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ReferenceMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:SightMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:InfoNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ContactNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ProfileNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:GrpNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:RcCmd': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:TypSts': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:PSCmd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:SRSMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRReqMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRRspMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsChaR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CSCha': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEva': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsContact': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHs': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHsR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsSp': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEnd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsUpdate': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:ReadNtf': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:chrmKVNotiMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCAccept': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCRinging': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCSummary': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCHangup': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCInvite': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMedia': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMem': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:MsgExMsg': {\n      isCounted: false,\n      isPersited: false\n    }\n  };\n  var rootStorage;\n\n  var createRootStorage = function createRootStorage(runtime) {\n    var _this2 = this;\n\n    _newArrowCheck(this, _this);\n\n    if (!rootStorage) {\n      rootStorage = {\n        set: function set(key, val) {\n          _newArrowCheck(this, _this2);\n\n          runtime.localStorage.setItem(key, JSON.stringify(val));\n        }.bind(this),\n        get: function get(key) {\n          _newArrowCheck(this, _this2);\n\n          var val;\n\n          try {\n            val = JSON.parse(runtime.localStorage.getItem(key));\n          } catch (e) {\n            val = null;\n          }\n\n          return val;\n        }.bind(this),\n        remove: function remove(key) {\n          _newArrowCheck(this, _this2);\n\n          return runtime.localStorage.removeItem(key);\n        }.bind(this),\n        getKeys: function getKeys() {\n          _newArrowCheck(this, _this2);\n\n          var keys = [];\n\n          for (var _key in runtime.localStorage) {\n            keys.push(_key);\n          }\n\n          return keys;\n        }.bind(this)\n      };\n    }\n\n    return rootStorage;\n  }.bind(undefined);\n\n  var AppCache = function () {\n    function AppCache(value) {\n      _classCallCheck(this, AppCache);\n\n      this._caches = {};\n\n      if (value) {\n        this._caches = value;\n      }\n    }\n\n    _createClass(AppCache, [{\n      key: \"set\",\n      value: function set(key, value) {\n        this._caches[key] = value;\n      }\n    }, {\n      key: \"remove\",\n      value: function remove(key) {\n        var val = this.get(key);\n        delete this._caches[key];\n        return val;\n      }\n    }, {\n      key: \"get\",\n      value: function get(key) {\n        return this._caches[key];\n      }\n    }, {\n      key: \"getKeys\",\n      value: function getKeys() {\n        var keys = [];\n\n        for (var _key2 in this._caches) {\n          keys.push(_key2);\n        }\n\n        return keys;\n      }\n    }]);\n\n    return AppCache;\n  }();\n\n  var AppStorage = function () {\n    function AppStorage(runtime, suffix) {\n      _classCallCheck(this, AppStorage);\n\n      var key = suffix ? \"\".concat(STORAGE_ROOT_KEY).concat(suffix) : STORAGE_ROOT_KEY;\n      this._rootStorage = createRootStorage(runtime);\n      var localCache = this._rootStorage.get(key) || {};\n      this._cache = new AppCache(_defineProperty({}, key, localCache));\n      this._storageKey = key;\n    }\n\n    _createClass(AppStorage, [{\n      key: \"_get\",\n      value: function _get() {\n        var key = this._storageKey;\n        return this._cache.get(key) || {};\n      }\n    }, {\n      key: \"_set\",\n      value: function _set(cache) {\n        var key = this._storageKey;\n        cache = cache || {};\n\n        this._cache.set(key, cache);\n\n        this._rootStorage.set(key, cache);\n      }\n    }, {\n      key: \"set\",\n      value: function set(key, value) {\n        var localValue = this._get();\n\n        localValue[key] = value;\n\n        this._set(localValue);\n      }\n    }, {\n      key: \"remove\",\n      value: function remove(key) {\n        var localValue = this._get();\n\n        delete localValue[key];\n\n        this._set(localValue);\n      }\n    }, {\n      key: \"clear\",\n      value: function clear() {\n        var key = this._storageKey;\n\n        this._rootStorage.remove(key);\n\n        this._cache.remove(key);\n      }\n    }, {\n      key: \"get\",\n      value: function get(key) {\n        var localValue = this._get();\n\n        return localValue[key];\n      }\n    }, {\n      key: \"getKeys\",\n      value: function getKeys() {\n        var localValue = this._get();\n\n        var keyList = [];\n\n        for (var _key3 in localValue) {\n          keyList.push(_key3);\n        }\n\n        return keyList;\n      }\n    }, {\n      key: \"getValues\",\n      value: function getValues() {\n        return this._get() || {};\n      }\n    }]);\n\n    return AppStorage;\n  }();\n\n  var Todo = function (_Error) {\n    _inherits(Todo, _Error);\n\n    var _super = _createSuper(Todo);\n\n    function Todo(message) {\n      _classCallCheck(this, Todo);\n\n      return _super.call(this, \"TODO => \".concat(message));\n    }\n\n    return Todo;\n  }(_wrapNativeSuper(Error));\n\n  var todo = function todo(message) {\n    _newArrowCheck(this, _this);\n\n    return new Todo(message);\n  }.bind(undefined);\n\n  var toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n    var _this3 = this;\n\n    _newArrowCheck(this, _this);\n\n    if (startIndex === undefined || endIndex === undefined) {\n      return str.toUpperCase();\n    }\n\n    var sliceStr = str.slice(startIndex, endIndex);\n    str = str.replace(sliceStr, function (text) {\n      _newArrowCheck(this, _this3);\n\n      return text.toUpperCase();\n    }.bind(this));\n    return str;\n  }.bind(undefined);\n\n  var getByteLength = function getByteLength(str) {\n    var charset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utf-8';\n    var total = 0;\n    var chatCode;\n\n    if (charset === 'utf-16') {\n      for (var i = 0, max = str.length; i < max; i++) {\n        chatCode = str.charCodeAt(i);\n\n        if (chatCode <= 0xffff) {\n          total += 2;\n        } else {\n          total += 4;\n        }\n      }\n    } else {\n      for (var _i = 0, _max = str.length; _i < _max; _i++) {\n        chatCode = str.charCodeAt(_i);\n\n        if (chatCode < 0x007f) {\n          total += 1;\n        } else if (chatCode <= 0x07ff) {\n          total += 2;\n        } else if (chatCode <= 0xffff) {\n          total += 3;\n        } else {\n          total += 4;\n        }\n      }\n    }\n\n    return total;\n  };\n\n  var appendUrl = function appendUrl(url, query) {\n    var _this4 = this;\n\n    _newArrowCheck(this, _this);\n\n    url = url.replace(/\\?$/, '');\n\n    if (!query) {\n      return url;\n    }\n\n    var searchArr = Object.keys(query).map(function (key) {\n      _newArrowCheck(this, _this4);\n\n      return \"\".concat(key, \"=\").concat(query[key]);\n    }.bind(this)).filter(function (item) {\n      _newArrowCheck(this, _this4);\n\n      return !!item;\n    }.bind(this));\n\n    if (searchArr.length) {\n      return [url, searchArr.join('&')].join('?');\n    }\n\n    return url;\n  }.bind(undefined);\n\n  var matchVersion = function matchVersion(apiVersion) {\n    _newArrowCheck(this, _this);\n\n    var matches = apiVersion.match(/\\d+(\\.\\d+){2}/);\n    return matches[0];\n  }.bind(undefined);\n\n\n\n  (function (LogLevel) {\n    LogLevel[LogLevel[\"LOG\"] = 0] = \"LOG\";\n    LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\n    LogLevel[LogLevel[\"INFO\"] = 1] = \"INFO\";\n    LogLevel[LogLevel[\"WARN\"] = 2] = \"WARN\";\n    LogLevel[LogLevel[\"ERROR\"] = 3] = \"ERROR\";\n    LogLevel[LogLevel[\"NONE\"] = 1000] = \"NONE\";\n  })(exports.LogLevel || (exports.LogLevel = {}));\n\n  var methods = (_methods = {}, _defineProperty(_methods, exports.LogLevel.DEBUG, console.debug.bind(console)), _defineProperty(_methods, exports.LogLevel.INFO, console.info.bind(console)), _defineProperty(_methods, exports.LogLevel.WARN, console.warn.bind(console)), _defineProperty(_methods, exports.LogLevel.ERROR, console.error.bind(console)), _methods);\n\n  var Logger = function () {\n    function Logger(_tag) {\n      _classCallCheck(this, Logger);\n\n      this._tag = _tag;\n      this._outLevel = exports.LogLevel.WARN;\n      this._stdout = this._defaultStdout;\n      this.log = this._out;\n      this.debug = this._out.bind(this, exports.LogLevel.DEBUG);\n      this.info = this._out.bind(this, exports.LogLevel.INFO);\n      this.warn = this._out.bind(this, exports.LogLevel.WARN);\n      this.error = this._out.bind(this, exports.LogLevel.ERROR);\n    }\n\n    _createClass(Logger, [{\n      key: \"_defaultStdout\",\n      value: function _defaultStdout(level) {\n        for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {\n          args[_key4 - 1] = arguments[_key4];\n        }\n\n        methods[level].apply(methods, [\"[\".concat(this._tag, \"](\").concat(new Date().toUTCString(), \"):\")].concat(args));\n      }\n    }, {\n      key: \"_out\",\n      value: function _out(level) {\n        for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {\n          args[_key5 - 1] = arguments[_key5];\n        }\n\n        level >= this._outLevel && this._stdout.apply(this, [level].concat(args));\n      }\n    }, {\n      key: \"set\",\n      value: function set(outLevel, stdout) {\n        this._outLevel = outLevel;\n        this._stdout = stdout || this._defaultStdout;\n      }\n    }]);\n\n    return Logger;\n  }();\n\n  var logger = new Logger('RCLog');\n  var ConversationType;\n\n  (function (ConversationType) {\n    ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n    ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n    ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n    ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n    ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n    ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n    ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n    ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n    ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    ConversationType[ConversationType[\"RTC_ROOM\"] = 12] = \"RTC_ROOM\";\n  })(ConversationType || (ConversationType = {}));\n\n  var ConversationType$1 = ConversationType;\n  var FileType;\n\n  (function (FileType) {\n    FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n    FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n    FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n    FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    FileType[FileType[\"SIGHT\"] = 5] = \"SIGHT\";\n    FileType[FileType[\"COMBINE_HTML\"] = 6] = \"COMBINE_HTML\";\n  })(FileType || (FileType = {}));\n\n  var FileType$1 = FileType;\n\n  var isString = function isString(value) {\n    _newArrowCheck(this, _this);\n\n    return typeof value === 'string';\n  }.bind(undefined);\n\n  var isNumber = function isNumber(value) {\n    _newArrowCheck(this, _this);\n\n    return typeof value === 'number' && !isNaN(value);\n  }.bind(undefined);\n\n  var isArray = function isArray(arr) {\n    _newArrowCheck(this, _this);\n\n    return Object.prototype.toString.call(arr).indexOf('Array') !== -1;\n  }.bind(undefined);\n\n  var isArrayBuffer = function isArrayBuffer(arr) {\n    _newArrowCheck(this, _this);\n\n    return Object.prototype.toString.call(arr) === '[object ArrayBuffer]';\n  }.bind(undefined);\n\n  var notEmptyString = function notEmptyString(str) {\n    _newArrowCheck(this, _this);\n\n    return isString(str) && str.length > 0;\n  }.bind(undefined);\n\n  var notEmptyArray = function notEmptyArray(arr) {\n    _newArrowCheck(this, _this);\n\n    return isArray(arr) && arr.length > 0;\n  }.bind(undefined);\n\n  var isObject = function isObject(val) {\n    _newArrowCheck(this, _this);\n\n    return Object.prototype.toString.call(val) === '[object Object]';\n  }.bind(undefined);\n\n  var isFunction = function isFunction(val) {\n    _newArrowCheck(this, _this);\n\n    return Object.prototype.toString.call(val) === '[object Function]';\n  }.bind(undefined);\n\n  var isUndefined = function isUndefined(val) {\n    _newArrowCheck(this, _this);\n\n    return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  }.bind(undefined);\n\n  var isNull = function isNull(val) {\n    _newArrowCheck(this, _this);\n\n    return Object.prototype.toString.call(val) === '[object Null]';\n  }.bind(undefined);\n\n  var isHttpUrl = function isHttpUrl(value) {\n    _newArrowCheck(this, _this);\n\n    return isString(value) && /https?:\\/\\//.test(value);\n  }.bind(undefined);\n\n  var notEmptyObject = function notEmptyObject(val) {\n    _newArrowCheck(this, _this);\n\n    for (var _key6 in val) {\n      return true;\n    }\n\n    return false;\n  }.bind(undefined);\n\n  var isValidConversationType = function isValidConversationType(conversation) {\n    _newArrowCheck(this, _this);\n\n    return isNumber(conversation) && Object.prototype.hasOwnProperty.call(ConversationType$1, conversation);\n  }.bind(undefined);\n\n  var isValidFileType = function isValidFileType(fileType) {\n    _newArrowCheck(this, _this);\n\n    return isNumber(fileType) && Object.prototype.hasOwnProperty.call(FileType$1, fileType);\n  }.bind(undefined);\n\n  var AssertRules;\n\n  (function (AssertRules) {\n    AssertRules[AssertRules[\"STRING\"] = 0] = \"STRING\";\n    AssertRules[AssertRules[\"ONLY_STRING\"] = 1] = \"ONLY_STRING\";\n    AssertRules[AssertRules[\"NUMBER\"] = 2] = \"NUMBER\";\n    AssertRules[AssertRules[\"BOOLEAN\"] = 3] = \"BOOLEAN\";\n    AssertRules[AssertRules[\"OBJECT\"] = 4] = \"OBJECT\";\n    AssertRules[AssertRules[\"ARRAY\"] = 5] = \"ARRAY\";\n    AssertRules[AssertRules[\"CALLBACK\"] = 6] = \"CALLBACK\";\n  })(AssertRules || (AssertRules = {}));\n\n  var validators = (_validators = {}, _defineProperty(_validators, AssertRules.STRING, notEmptyString), _defineProperty(_validators, AssertRules.ONLY_STRING, isString), _defineProperty(_validators, AssertRules.NUMBER, isNumber), _defineProperty(_validators, AssertRules.BOOLEAN, function (value) {\n    _newArrowCheck(this, _this);\n\n    return typeof value === 'boolean';\n  }.bind(undefined)), _defineProperty(_validators, AssertRules.OBJECT, isObject), _defineProperty(_validators, AssertRules.ARRAY, isArray), _defineProperty(_validators, AssertRules.CALLBACK, function (callback) {\n    _newArrowCheck(this, _this);\n\n    var flag = true;\n\n    if (!isObject(callback)) {\n      flag = false;\n    }\n\n    callback = callback || {};\n\n    if (callback.onSuccess && !isFunction(callback.onSuccess)) {\n      flag = false;\n    }\n\n    if (callback.onError && !isFunction(callback.onError)) {\n      flag = false;\n    }\n\n    return flag;\n  }.bind(undefined)), _validators);\n\n  var RCAssertError = function (_Error2) {\n    _inherits(RCAssertError, _Error2);\n\n    var _super2 = _createSuper(RCAssertError);\n\n    function RCAssertError(message) {\n      var _this5;\n\n      _classCallCheck(this, RCAssertError);\n\n      _this5 = _super2.call(this, message);\n      _this5.name = 'RCAssertError';\n      return _this5;\n    }\n\n    return RCAssertError;\n  }(_wrapNativeSuper(Error));\n\n  var assert = function assert(key, value, validator) {\n    var required = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n    if (!validate(key, value, validator, required)) {\n      throw new RCAssertError(\"\".concat(key, \" is invalid.\"));\n    }\n  };\n\n  var validate = function validate(key, value, validator) {\n    var required = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n    validator = validators[validator] || validator;\n    var invalid = required && !validator(value) || !required && !(isUndefined(value) || value === null || validator(value));\n\n    if (invalid) {\n      var msg = \"\".concat(key, \" is invalid.\");\n      logger.error(msg);\n    }\n\n    return !invalid;\n  };\n\n  var assertCPPMode = function assertCPPMode(isCPPMode, errorMsg) {\n    _newArrowCheck(this, _this);\n\n    errorMsg = errorMsg || 'Method is only available in cppProtocol mode';\n\n    if (!isCPPMode) {\n      throw new RCAssertError(errorMsg);\n    }\n  }.bind(undefined);\n\n  var forEach = function forEach(source, event, options) {\n    var _this6 = this;\n\n    _newArrowCheck(this, _this);\n\n    options = options || {};\n\n    event = event || function () {};\n\n    var _options2 = options,\n        isReverse = _options2.isReverse;\n\n    var loopObj = function loopObj() {\n      _newArrowCheck(this, _this6);\n\n      for (var _key7 in source) {\n        event(source[_key7], _key7, source);\n      }\n    }.bind(this);\n\n    var loopArr = function loopArr() {\n      _newArrowCheck(this, _this6);\n\n      if (isReverse) {\n        for (var i = source.length - 1; i >= 0; i--) {\n          event(source[i], i);\n        }\n      } else {\n        for (var j = 0, len = source.length; j < len; j++) {\n          event(source[j], j);\n        }\n      }\n    }.bind(this);\n\n    if (isObject(source)) {\n      loopObj();\n    }\n\n    if (isArray(source) || isString(source)) {\n      loopArr();\n    }\n  }.bind(undefined);\n\n  var map = function map(source, event) {\n    var _this7 = this;\n\n    _newArrowCheck(this, _this);\n\n    forEach(source, function (item, index) {\n      _newArrowCheck(this, _this7);\n\n      source[index] = event(item, index);\n    }.bind(this));\n    return source;\n  }.bind(undefined);\n\n  var indexOf = function indexOf(source, searchVal) {\n    var _this8 = this;\n\n    _newArrowCheck(this, _this);\n\n    if (source.indexOf) {\n      return source.indexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      _newArrowCheck(this, _this8);\n\n      if (searchVal === sub) {\n        index = i;\n      }\n    }.bind(this));\n    return index;\n  }.bind(undefined);\n\n  var isInclude = function isInclude(source, searchVal) {\n    _newArrowCheck(this, _this);\n\n    var index = indexOf(source, searchVal);\n    return index !== -1;\n  }.bind(undefined);\n\n  var isInObject = function isInObject(source, searchVal) {\n    var _this9 = this;\n\n    _newArrowCheck(this, _this);\n\n    var arr = [];\n    forEach(source, function (val) {\n      _newArrowCheck(this, _this9);\n\n      arr.push(val);\n    }.bind(this));\n    var index = indexOf(arr, searchVal);\n    return index !== -1;\n  }.bind(undefined);\n\n  var cloneByJSON = function cloneByJSON(sourceObj) {\n    _newArrowCheck(this, _this);\n\n    return JSON.parse(JSON.stringify(sourceObj));\n  }.bind(undefined);\n\n  var ChatroomEntryType;\n\n  (function (ChatroomEntryType) {\n    ChatroomEntryType[ChatroomEntryType[\"UPDATE\"] = 1] = \"UPDATE\";\n    ChatroomEntryType[ChatroomEntryType[\"DELETE\"] = 2] = \"DELETE\";\n  })(ChatroomEntryType || (ChatroomEntryType = {}));\n\n  var ChatroomEntryType$1 = ChatroomEntryType;\n\n  var getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n    _newArrowCheck(this, _this);\n\n    var isPersited = true;\n    var isCounted = true;\n    var isMentioned = false;\n    var disableNotification = false;\n    var receivedStatus = ReceivedStatus$1.READ;\n    var isReceivedByOtherClient = false;\n    var canIncludeExpansion = false;\n    isPersited = !!(status & 0x10);\n    isCounted = !!(status & 0x20);\n    isMentioned = !!(status & 0x40);\n    disableNotification = !!(status & 0x100);\n    isReceivedByOtherClient = !!(status & 0x02);\n    receivedStatus = isReceivedByOtherClient ? ReceivedStatus$1.RETRIEVED : receivedStatus;\n    canIncludeExpansion = !!(status & 0x400);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentioned: isMentioned,\n      disableNotification: disableNotification,\n      receivedStatus: receivedStatus,\n      canIncludeExpansion: canIncludeExpansion\n    };\n  }.bind(undefined);\n\n  var getUpMessageOptionBySessionId = function getUpMessageOptionBySessionId(sessionId) {\n    _newArrowCheck(this, _this);\n\n    var isPersited = false;\n    var isCounted = false;\n    var disableNotification = false;\n    var canIncludeExpansion = false;\n    isPersited = !!(sessionId & 0x01);\n    isCounted = !!(sessionId & 0x02);\n    disableNotification = !!(sessionId & 0x10);\n    canIncludeExpansion = !!(sessionId & 0x40);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      disableNotification: disableNotification,\n      canIncludeExpansion: canIncludeExpansion\n    };\n  }.bind(undefined);\n\n  var formatExtraContent = function formatExtraContent(extraContent) {\n    var _this10 = this;\n\n    _newArrowCheck(this, _this);\n\n    var expansion = {};\n    var parseExtraContent = JSON.parse(extraContent);\n    forEach(parseExtraContent, function (value, key) {\n      _newArrowCheck(this, _this10);\n\n      expansion[key] = value.v;\n    }.bind(this));\n    return expansion;\n  }.bind(undefined);\n\n  var DelayTimer = {\n    _delayTime: 0,\n    setTime: function setTime(time) {\n      _newArrowCheck(this, _this);\n\n      var currentTime = new Date().getTime();\n      DelayTimer._delayTime = currentTime - time;\n    }.bind(undefined),\n    getTime: function getTime() {\n      _newArrowCheck(this, _this);\n\n      var delayTime = DelayTimer._delayTime;\n      var currentTime = new Date().getTime();\n      return currentTime - delayTime;\n    }.bind(undefined)\n  };\n\n  var getChatRoomKVByStatus = function getChatRoomKVByStatus(status) {\n    _newArrowCheck(this, _this);\n\n    var isDeleteOpt = !!(status & 0x0004);\n    return {\n      isAutoDelete: !!(status & 0x0001),\n      isOverwrite: !!(status & 0x0002),\n      type: isDeleteOpt ? ChatroomEntryType$1.DELETE : ChatroomEntryType$1.UPDATE\n    };\n  }.bind(undefined);\n\n  var getChatRoomKVOptStatus = function getChatRoomKVOptStatus(entity, action) {\n    _newArrowCheck(this, _this);\n\n    var status = 0;\n\n    if (entity.isAutoDelete) {\n      status = status | 0x0001;\n    }\n\n    if (entity.isOverwrite) {\n      status = status | 0x0002;\n    }\n\n    if (action === 2) {\n      status = status | 0x0004;\n    }\n\n    return status;\n  }.bind(undefined);\n\n  var getSessionId = function getSessionId(option) {\n    _newArrowCheck(this, _this);\n\n    var isStatusMessage = option.isStatusMessage;\n    var isPersited = option.isPersited,\n        isCounted = option.isCounted,\n        isMentioned = option.isMentioned,\n        disableNotification = option.disableNotification,\n        canIncludeExpansion = option.canIncludeExpansion;\n\n    if (isStatusMessage) {\n      isPersited = isCounted = false;\n    }\n\n    var sessionId = 0;\n\n    if (isPersited) {\n      sessionId = sessionId | 0x01;\n    }\n\n    if (isCounted) {\n      sessionId = sessionId | 0x02;\n    }\n\n    if (isMentioned) {\n      sessionId = sessionId | 0x04;\n    }\n\n    if (disableNotification) {\n      sessionId = sessionId | 0x20;\n    }\n\n    if (canIncludeExpansion) {\n      sessionId = sessionId | 0x40;\n    }\n\n    return sessionId;\n  }.bind(undefined);\n\n  function __awaiter$1(thisArg, _arguments, P, generator) {\n    function adopt(value) {\n      return value instanceof P ? value : new P(function (resolve) {\n        resolve(value);\n      });\n    }\n\n    return new (P || (P = Promise))(function (resolve, reject) {\n      function fulfilled(value) {\n        try {\n          step(generator.next(value));\n        } catch (e) {\n          reject(e);\n        }\n      }\n\n      function rejected(value) {\n        try {\n          step(generator[\"throw\"](value));\n        } catch (e) {\n          reject(e);\n        }\n      }\n\n      function step(result) {\n        result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n      }\n\n      step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n  }\n\n  var QOS;\n\n  (function (QOS) {\n    QOS[QOS[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n    QOS[QOS[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n    QOS[QOS[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n    QOS[QOS[\"DEFAULT\"] = 3] = \"DEFAULT\";\n  })(QOS || (QOS = {}));\n\n  var OperationType;\n\n  (function (OperationType) {\n    OperationType[OperationType[\"SYMMETRIC\"] = 0] = \"SYMMETRIC\";\n    OperationType[OperationType[\"CONNECT\"] = 1] = \"CONNECT\";\n    OperationType[OperationType[\"CONN_ACK\"] = 2] = \"CONN_ACK\";\n    OperationType[OperationType[\"PUBLISH\"] = 3] = \"PUBLISH\";\n    OperationType[OperationType[\"PUB_ACK\"] = 4] = \"PUB_ACK\";\n    OperationType[OperationType[\"QUERY\"] = 5] = \"QUERY\";\n    OperationType[OperationType[\"QUERY_ACK\"] = 6] = \"QUERY_ACK\";\n    OperationType[OperationType[\"QUERY_CONFIRM\"] = 7] = \"QUERY_CONFIRM\";\n    OperationType[OperationType[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n    OperationType[OperationType[\"SUB_ACK\"] = 9] = \"SUB_ACK\";\n    OperationType[OperationType[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n    OperationType[OperationType[\"UNSUB_ACK\"] = 11] = \"UNSUB_ACK\";\n    OperationType[OperationType[\"PING_REQ\"] = 12] = \"PING_REQ\";\n    OperationType[OperationType[\"PING_RESP\"] = 13] = \"PING_RESP\";\n    OperationType[OperationType[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    OperationType[OperationType[\"RESERVER2\"] = 15] = \"RESERVER2\";\n  })(OperationType || (OperationType = {}));\n\n  var MessageName;\n\n  (function (MessageName) {\n    MessageName[\"CONN_ACK\"] = \"ConnAckMessage\";\n    MessageName[\"DISCONNECT\"] = \"DisconnectMessage\";\n    MessageName[\"PING_REQ\"] = \"PingReqMessage\";\n    MessageName[\"PING_RESP\"] = \"PingRespMessage\";\n    MessageName[\"PUBLISH\"] = \"PublishMessage\";\n    MessageName[\"PUB_ACK\"] = \"PubAckMessage\";\n    MessageName[\"QUERY\"] = \"QueryMessage\";\n    MessageName[\"QUERY_CON\"] = \"QueryConMessage\";\n    MessageName[\"QUERY_ACK\"] = \"QueryAckMessage\";\n  })(MessageName || (MessageName = {}));\n\n  var IDENTIFIER;\n\n  (function (IDENTIFIER) {\n    IDENTIFIER[\"PUB\"] = \"pub\";\n    IDENTIFIER[\"QUERY\"] = \"qry\";\n  })(IDENTIFIER || (IDENTIFIER = {}));\n\n  var Header = function () {\n    function Header(type) {\n      var retain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n      var qos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QOS.AT_LEAST_ONCE;\n      var dup = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n      _classCallCheck(this, Header);\n\n      this._retain = false;\n      this.qos = QOS.AT_LEAST_ONCE;\n      this._dup = false;\n      this.syncMsg = false;\n      var isPlusType = type > 0;\n\n      if (type && isPlusType && arguments.length === 1) {\n        this._retain = (type & 1) > 0;\n        this.qos = (type & 6) >> 1;\n        this._dup = (type & 8) > 0;\n        this.type = type >> 4 & 15;\n        this.syncMsg = (type & 8) === 8;\n      } else {\n        this.type = type;\n        this._retain = retain;\n        this.qos = qos;\n        this._dup = dup;\n      }\n    }\n\n    _createClass(Header, [{\n      key: \"encode\",\n      value: function encode() {\n        var byte = this.type << 4;\n        byte |= this._retain ? 1 : 0;\n        byte |= this.qos << 1;\n        byte |= this._dup ? 8 : 0;\n        return byte;\n      }\n    }]);\n\n    return Header;\n  }();\n\n  var BinaryHelper = function () {\n    function BinaryHelper() {\n      _classCallCheck(this, BinaryHelper);\n    }\n\n    _createClass(BinaryHelper, null, [{\n      key: \"writeUTF\",\n      value: function writeUTF(str, isGetBytes) {\n        var back = [];\n        var byteSize = 0;\n\n        if (isString(str)) {\n          for (var i = 0, len = str.length; i < len; i++) {\n            var code = str.charCodeAt(i);\n\n            if (code >= 0 && code <= 127) {\n              byteSize += 1;\n              back.push(code);\n            } else if (code >= 128 && code <= 2047) {\n              byteSize += 2;\n              back.push(192 | 31 & code >> 6);\n              back.push(128 | 63 & code);\n            } else if (code >= 2048 && code <= 65535) {\n              byteSize += 3;\n              back.push(224 | 15 & code >> 12);\n              back.push(128 | 63 & code >> 6);\n              back.push(128 | 63 & code);\n            }\n          }\n        }\n\n        for (var _i2 = 0, _len3 = back.length; _i2 < _len3; _i2++) {\n          if (back[_i2] > 255) {\n            back[_i2] &= 255;\n          }\n        }\n\n        if (isGetBytes) {\n          return back;\n        }\n\n        if (byteSize <= 255) {\n          return [0, byteSize].concat(back);\n        } else {\n          return [byteSize >> 8, byteSize & 255].concat(back);\n        }\n      }\n    }, {\n      key: \"readUTF\",\n      value: function readUTF(arr) {\n        var MAX_SIZE = 0x4000;\n        var codeUnits = [];\n        var highSurrogate;\n        var lowSurrogate;\n        var index = -1;\n        var strBytes = arr;\n        var result = '';\n\n        while (++index < strBytes.length) {\n          var codePoint = Number(strBytes[index]);\n          if (codePoint === (codePoint & 0x7F)) ;else if ((codePoint & 0xF0) === 0xF0) {\n            codePoint ^= 0xF0;\n            codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n            codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n            codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n          } else if ((codePoint & 0xE0) === 0xE0) {\n            codePoint ^= 0xE0;\n            codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n            codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n          } else if ((codePoint & 0xC0) === 0xC0) {\n            codePoint ^= 0xC0;\n            codePoint = codePoint << 6 | strBytes[++index] ^ 0x80;\n          }\n\n          if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || Math.floor(codePoint) !== codePoint) {\n            throw RangeError('Invalid code point: ' + codePoint);\n          }\n\n          if (codePoint <= 0xFFFF) {\n            codeUnits.push(codePoint);\n          } else {\n            codePoint -= 0x10000;\n            highSurrogate = codePoint >> 10 | 0xD800;\n            lowSurrogate = codePoint % 0x400 | 0xDC00;\n            codeUnits.push(highSurrogate, lowSurrogate);\n          }\n\n          if (index + 1 === strBytes.length || codeUnits.length > MAX_SIZE) {\n            result += String.fromCharCode.apply(null, codeUnits);\n            codeUnits.length = 0;\n          }\n        }\n\n        return result;\n      }\n    }]);\n\n    return BinaryHelper;\n  }();\n\n  var RongStreamReader = function () {\n    function RongStreamReader(arr) {\n      _classCallCheck(this, RongStreamReader);\n\n      this._position = 0;\n      this._poolLen = 0;\n      this._pool = arr;\n      this._poolLen = arr.length;\n    }\n\n    _createClass(RongStreamReader, [{\n      key: \"check\",\n      value: function check() {\n        return this._position >= this._pool.length;\n      }\n    }, {\n      key: \"readInt\",\n      value: function readInt() {\n        var self = this;\n\n        if (self.check()) {\n          return -1;\n        }\n\n        var end = '';\n\n        for (var i = 0; i < 4; i++) {\n          var t = self._pool[self._position++].toString(16);\n\n          if (t.length === 1) {\n            t = '0' + t;\n          }\n\n          end += t.toString();\n        }\n\n        return parseInt(end, 16);\n      }\n    }, {\n      key: \"readLong\",\n      value: function readLong() {\n        var self = this;\n\n        if (self.check()) {\n          return -1;\n        }\n\n        var end = '';\n\n        for (var i = 0; i < 8; i++) {\n          var t = self._pool[self._position++].toString(16);\n\n          if (t.length === 1) {\n            t = '0' + t;\n          }\n\n          end += t;\n        }\n\n        return parseInt(end, 16);\n      }\n    }, {\n      key: \"readByte\",\n      value: function readByte() {\n        if (this.check()) {\n          return -1;\n        }\n\n        var val = this._pool[this._position++];\n\n        if (val > 255) {\n          val &= 255;\n        }\n\n        return val;\n      }\n    }, {\n      key: \"readUTF\",\n      value: function readUTF() {\n        if (this.check()) {\n          return '';\n        }\n\n        var big = this.readByte() << 8 | this.readByte();\n\n        var pool = this._pool.subarray(this._position, this._position += big);\n\n        return BinaryHelper.readUTF(pool);\n      }\n    }, {\n      key: \"readAll\",\n      value: function readAll() {\n        return this._pool.subarray(this._position, this._poolLen);\n      }\n    }]);\n\n    return RongStreamReader;\n  }();\n\n  var RongStreamWriter = function () {\n    function RongStreamWriter() {\n      _classCallCheck(this, RongStreamWriter);\n\n      this._pool = [];\n      this._position = 0;\n      this._writen = 0;\n    }\n\n    _createClass(RongStreamWriter, [{\n      key: \"write\",\n      value: function write(byte) {\n        if (Object.prototype.toString.call(byte).indexOf('Array') !== -1) {\n          this._pool = this._pool.concat(byte);\n        } else if (byte >= 0) {\n          if (byte > 255) {\n            byte &= 255;\n          }\n\n          this._pool.push(byte);\n\n          this._writen++;\n        }\n\n        return byte;\n      }\n    }, {\n      key: \"writeArr\",\n      value: function writeArr(byte) {\n        this._pool = this._pool.concat(byte);\n        return byte;\n      }\n    }, {\n      key: \"writeUTF\",\n      value: function writeUTF(str) {\n        var val = BinaryHelper.writeUTF(str);\n        this._pool = this._pool.concat(val);\n        this._writen += val.length;\n      }\n    }, {\n      key: \"getBytesArray\",\n      value: function getBytesArray() {\n        return this._pool;\n      }\n    }]);\n\n    return RongStreamWriter;\n  }();\n\n  var PBName = {\n    UpStreamMessage: 'UpStreamMessage',\n    DownStreamMessage: 'DownStreamMessage',\n    DownStreamMessages: 'DownStreamMessages',\n    SessionsAttQryInput: 'SessionsAttQryInput',\n    SessionsAttOutput: 'SessionsAttOutput',\n    SyncRequestMsg: 'SyncRequestMsg',\n    ChrmPullMsg: 'ChrmPullMsg',\n    NotifyMsg: 'NotifyMsg',\n    HistoryMsgInput: 'HistoryMsgInput',\n    HistoryMsgOuput: 'HistoryMsgOuput',\n    RelationQryInput: 'RelationQryInput',\n    RelationsOutput: 'RelationsOutput',\n    DeleteSessionsInput: 'DeleteSessionsInput',\n    SessionInfo: 'SessionInfo',\n    DeleteSessionsOutput: 'DeleteSessionsOutput',\n    RelationsInput: 'RelationsInput',\n    DeleteMsgInput: 'DeleteMsgInput',\n    CleanHisMsgInput: 'CleanHisMsgInput',\n    SessionMsgReadInput: 'SessionMsgReadInput',\n    ChrmInput: 'ChrmInput',\n    QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n    QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n    RtcInput: 'RtcInput',\n    RtcUserListOutput: 'RtcUserListOutput',\n    SetUserStatusInput: 'SetUserStatusInput',\n    RtcSetDataInput: 'RtcSetDataInput',\n    RtcUserSetDataInput: 'RtcUserSetDataInput',\n    RtcDataInput: 'RtcDataInput',\n    RtcSetOutDataInput: 'RtcSetOutDataInput',\n    MCFollowInput: 'MCFollowInput',\n    RtcTokenOutput: 'RtcTokenOutput',\n    RtcQryOutput: 'RtcQryOutput',\n    RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n    RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n    RtcQueryListInput: 'RtcQueryListInput',\n    RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n    RtcValueInfo: 'RtcValueInfo',\n    RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n    GetQNupTokenInput: 'GetQNupTokenInput',\n    GetQNupTokenOutput: 'GetQNupTokenOutput',\n    GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n    GetDownloadUrlInput: 'GetDownloadUrlInput',\n    GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput',\n    GetDownloadUrlOutput: 'GetDownloadUrlOutput',\n    SetChrmKV: 'SetChrmKV',\n    ChrmKVOutput: 'ChrmKVOutput',\n    QueryChrmKV: 'QueryChrmKV',\n    SetUserSettingInput: 'SetUserSettingInput',\n    SetUserSettingOutput: 'SetUserSettingOutput',\n    PullUserSettingInput: 'PullUserSettingInput',\n    PullUserSettingOutput: 'PullUserSettingOutput',\n    UserSettingNotification: 'UserSettingNotification',\n    SessionReq: 'SessionReq',\n    SessionStates: 'SessionStates',\n    SessionState: 'SessionState',\n    SessionStateItem: 'SessionStateItem',\n    SessionStateModifyReq: 'SessionStateModifyReq',\n    SessionStateModifyResp: 'SessionStateModifyResp'\n  };\n  var SSMsg = (_SSMsg = {}, _defineProperty(_SSMsg, PBName.UpStreamMessage, ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData', 'extraContent']), _defineProperty(_SSMsg, PBName.DownStreamMessages, ['list', 'syncTime', 'finished']), _defineProperty(_SSMsg, PBName.DownStreamMessage, ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId', 'extraContent']), _defineProperty(_SSMsg, PBName.SessionsAttQryInput, ['nothing']), _defineProperty(_SSMsg, PBName.SessionsAttOutput, ['inboxTime', 'sendboxTime', 'totalUnreadCount']), _defineProperty(_SSMsg, PBName.SyncRequestMsg, ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime']), _defineProperty(_SSMsg, PBName.ChrmPullMsg, ['syncTime', 'count']), _defineProperty(_SSMsg, PBName.NotifyMsg, ['type', 'time', 'chrmId']), _defineProperty(_SSMsg, PBName.HistoryMsgInput, ['targetId', 'time', 'count', 'order']), _defineProperty(_SSMsg, PBName.HistoryMsgOuput, ['list', 'syncTime', 'hasMsg']), _defineProperty(_SSMsg, PBName.RelationQryInput, ['type', 'count', 'startTime', 'order']), _defineProperty(_SSMsg, PBName.RelationsOutput, ['info']), _defineProperty(_SSMsg, PBName.DeleteSessionsInput, ['sessions']), _defineProperty(_SSMsg, PBName.SessionInfo, ['type', 'channelId']), _defineProperty(_SSMsg, PBName.DeleteSessionsOutput, ['nothing']), _defineProperty(_SSMsg, PBName.RelationsInput, ['type', 'msg', 'count', 'offset', 'startTime', 'endTime']), _defineProperty(_SSMsg, PBName.DeleteMsgInput, ['type', 'conversationId', 'msgs']), _defineProperty(_SSMsg, PBName.CleanHisMsgInput, ['targetId', 'dataTime', 'conversationType']), _defineProperty(_SSMsg, PBName.SessionMsgReadInput, ['type', 'msgTime', 'channelId']), _defineProperty(_SSMsg, PBName.ChrmInput, ['nothing']), _defineProperty(_SSMsg, PBName.QueryChatRoomInfoInput, ['count', 'order']), _defineProperty(_SSMsg, PBName.QueryChatRoomInfoOutput, ['userTotalNums', 'userInfos']), _defineProperty(_SSMsg, PBName.GetQNupTokenInput, ['type', 'key']), _defineProperty(_SSMsg, PBName.GetQNdownloadUrlInput, ['type', 'key', 'fileName']), _defineProperty(_SSMsg, PBName.GetDownloadUrlInput, ['type', 'key', 'fileName']), _defineProperty(_SSMsg, PBName.GetQNupTokenOutput, ['deadline', 'token', 'bosToken', 'bosDate', 'path', 'osskeyId', 'ossPolicy', 'ossSign', 'ossBucketName']), _defineProperty(_SSMsg, PBName.GetQNdownloadUrlOutput, ['downloadUrl']), _defineProperty(_SSMsg, PBName.GetDownloadUrlOutput, ['downloadUrl']), _defineProperty(_SSMsg, PBName.SetChrmKV, ['entry', 'bNotify', 'notification', 'type']), _defineProperty(_SSMsg, PBName.ChrmKVOutput, ['entries', 'bFullUpdate', 'syncTime']), _defineProperty(_SSMsg, PBName.QueryChrmKV, ['timestamp']), _defineProperty(_SSMsg, PBName.SetUserSettingInput, ['version', 'value']), _defineProperty(_SSMsg, PBName.SetUserSettingOutput, ['version', 'reserve']), _defineProperty(_SSMsg, PBName.PullUserSettingInput, ['version', 'reserve']), _defineProperty(_SSMsg, PBName.PullUserSettingOutput, ['items', 'version']), _defineProperty(_SSMsg, PBName.SessionReq, ['time']), _defineProperty(_SSMsg, PBName.SessionStates, ['version', 'state']), _defineProperty(_SSMsg, PBName.SessionState, ['type', 'channelId', 'time', 'stateItem']), _defineProperty(_SSMsg, PBName.SessionStateItem, ['sessionStateType', 'value']), _defineProperty(_SSMsg, PBName.SessionStateModifyReq, ['version', 'state']), _defineProperty(_SSMsg, PBName.SessionStateModifyResp, ['version']), _SSMsg);\n  var Codec = {};\n\n  var _loop = function _loop() {\n    var _this165 = this;\n\n    var paramsList = SSMsg[key];\n\n    Codec[key] = function () {\n      _newArrowCheck(this, _this165);\n\n      var data = {};\n      var ins = {\n        getArrayData: function getArrayData() {\n          return data;\n        }\n      };\n\n      var _loop3 = function _loop3(i) {\n        var _this166 = this;\n\n        var param = paramsList[i];\n        var setEventName = \"set\".concat(toUpperCase(param, 0, 1));\n\n        ins[setEventName] = function (item) {\n          _newArrowCheck(this, _this166);\n\n          data[param] = item;\n        }.bind(this);\n      };\n\n      for (var i = 0; i < paramsList.length; i++) {\n        _loop3(i);\n      }\n\n      return ins;\n    }.bind(this);\n\n    Codec[key].decode = function (data) {\n      var decodeResult = {};\n\n      if (isString(data)) {\n        data = JSON.parse(data);\n      }\n\n      var _loop4 = function _loop4(_key21) {\n        var _this167 = this;\n\n        var getEventName = \"get\".concat(toUpperCase(_key21, 0, 1));\n        decodeResult[_key21] = data[_key21];\n\n        decodeResult[getEventName] = function () {\n          _newArrowCheck(this, _this167);\n\n          return data[_key21];\n        }.bind(this);\n      };\n\n      for (var _key21 in data) {\n        _loop4(_key21);\n      }\n\n      return decodeResult;\n    };\n  };\n\n  for (var key in SSMsg) {\n    _loop();\n  }\n\n  Codec.getModule = function (pbName) {\n    _newArrowCheck(this, _this);\n\n    return Codec[pbName]();\n  }.bind(undefined);\n\n  var SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message \".concat(PBName.SetUserStatusInput, \"\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \").concat(PBName.NotifyMsg, \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \").concat(PBName.SyncRequestMsg, \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \").concat(PBName.UpStreamMessage, \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n    optional int64 clientUniqueId = 10;\\n    optional string extraContent = 11;\\n  }\\n  message \").concat(PBName.DownStreamMessages, \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \").concat(PBName.DownStreamMessage, \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n    optional int32 plantform =11;\\n    optional int32 isRemoved = 12; \\n    optional string source = 13; \\n    optional int64 clientUniqueId = 14; \\n    optional string extraContent = 15; \\n\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = \").concat(FileType$1.IMAGE, \";\\n    audio = \").concat(FileType$1.AUDIO, \";\\n    video = \").concat(FileType$1.VIDEO, \";\\n    file = \").concat(FileType$1.FILE, \";\\n  }\\n  message \").concat(PBName.GetQNupTokenInput, \" {\\n    required FileType type = 1;\\n    optional string key = 2;\\n  }\\n  message \").concat(PBName.GetQNdownloadUrlInput, \" {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message \").concat(PBName.GetDownloadUrlInput, \" {\\n    required FileType type = 1;      // \\u4E0B\\u8F7D\\u7684\\u6587\\u4EF6\\u7C7B\\u578B\\n    required string key = 2;           // \\u8BF7\\u6C42\\u4E0B\\u8F7D\\u7684\\u6587\\u4EF6\\u540D\\n    optional string fileName = 3;     // \\u4E0B\\u8F7D\\u751F\\u6210\\u7684\\u6587\\u4EF6\\u540D\\u5B57\\n   }\\n  message \").concat(PBName.GetQNupTokenOutput, \" {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n    optional string bosToken = 3;\\n    optional string bosDate = 4;\\n    optional string path = 5;\\n    optional string osskeyId = 6;\\n    optional string ossPolicy = 7;\\n    optional string ossSign = 8;\\n    optional string ossBucketName = 9;\\n  }\\n  message \").concat(PBName.GetQNdownloadUrlOutput, \" {\\n    required string downloadUrl = 1;\\n  }\\n  message \").concat(PBName.GetDownloadUrlOutput, \" {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \").concat(PBName.ChrmInput, \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \").concat(PBName.ChrmPullMsg, \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \").concat(PBName.RelationQryInput, \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \").concat(PBName.RelationsInput, \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \").concat(PBName.RelationsOutput, \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \").concat(PBName.CleanHisMsgInput, \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \").concat(PBName.QueryChatRoomInfoInput, \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \").concat(PBName.QueryChatRoomInfoOutput, \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message \").concat(PBName.MCFollowInput, \"\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \").concat(PBName.HistoryMsgInput, \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \").concat(PBName.HistoryMsgOuput, \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message \").concat(PBName.RtcQueryListInput, \"{\\n    optional int32 order=1;\\n  }\\n\\n  message \").concat(PBName.RtcKeyDeleteInput, \"{\\n    repeated string key=1;\\n  }\\n\\n  message \").concat(PBName.RtcValueInfo, \"{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated \").concat(PBName.RtcValueInfo, \" userData=2;\\n  }\\n\\n  message \").concat(PBName.RtcUserListOutput, \"{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n    optional string sessionId=3;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated \").concat(PBName.RtcValueInfo, \" roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message \").concat(PBName.RtcInput, \"{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message \").concat(PBName.RtcQryOutput, \"{\\n    repeated \").concat(PBName.RtcValueInfo, \" outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message \").concat(PBName.RtcDataInput, \"{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message \").concat(PBName.RtcSetDataInput, \"{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message \").concat(PBName.RtcUserSetDataInput, \" {\\n    repeated \").concat(PBName.RtcValueInfo, \" valueInfo = 1;\\n    required string objectName = 2;\\n    repeated \").concat(PBName.RtcValueInfo, \" content = 3;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \").concat(PBName.RtcTokenOutput, \"{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message \").concat(PBName.RtcSetOutDataInput, \"{\\n    required targetType target=1;\\n    repeated \").concat(PBName.RtcValueInfo, \" valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message \").concat(PBName.RtcQryUserOutDataInput, \"{\\n    repeated string userId = 1;\\n  }\\n  message \").concat(PBName.RtcUserOutDataOutput, \"{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \").concat(PBName.SessionsAttQryInput, \"{\\n    required int32 nothing = 1;\\n  }\\n  message \").concat(PBName.SessionsAttOutput, \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \").concat(PBName.SessionMsgReadInput, \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \").concat(PBName.DeleteSessionsInput, \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \").concat(PBName.SessionInfo, \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \").concat(PBName.DeleteSessionsOutput, \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \").concat(PBName.DeleteMsgInput, \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n  message ChrmKVEntity {\\n    required string key = 1;\\n    required string value = 2;\\n    optional int32 status = 3;\\n    optional int64 timestamp = 4;\\n    optional string uid = 5;\\n  }\\n  message \").concat(PBName.SetChrmKV, \" {\\n    required ChrmKVEntity entry = 1;\\n    optional bool bNotify = 2;\\n    optional UpStreamMessage notification = 3;\\n    optional ChannelType type = 4;\\n  }\\n  message \").concat(PBName.ChrmKVOutput, \" {\\n    repeated ChrmKVEntity entries = 1;\\n    optional bool bFullUpdate = 2;\\n    optional int64 syncTime = 3;\\n  }\\n  message \").concat(PBName.QueryChrmKV, \" {\\n    required int64 timestamp = 1;\\n  }\\n  message \").concat(PBName.SetUserSettingInput, \" {\\n    required int64 version=1;\\n    required string value=2;\\n  }\\n  message \").concat(PBName.SetUserSettingOutput, \" {\\n    required int64 version=1;\\n    required bool reserve=2;\\n  }\\n  message \").concat(PBName.PullUserSettingInput, \" {\\n    required int64 version=1;//\\u5F53\\u524D\\u5BA2\\u6237\\u7AEF\\u7684\\u6700\\u5927\\u7248\\u672C\\u53F7\\n    optional bool reserve=2;\\n  }\\n  message \").concat(PBName.PullUserSettingOutput, \" {\\n    repeated UserSettingItem items = 1;\\n    required int64 version=2;\\n  }\\n  message UserSettingItem {\\n    required string targetId= 1;\\n    required ChannelType type = 2;\\n    required string key = 4;\\n    required bytes value = 5;\\n    required int64 version=6;\\n    required int32 status=7;\\n  }\\n  message \").concat(PBName.SessionReq, \" {\\n    required int64 time = 1;\\n  }\\n  message \").concat(PBName.SessionStates, \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \").concat(PBName.SessionState, \" {\\n    required ChannelType type = 1;\\n    required string channelId = 2;  \\n    optional int64 time = 3;\\n    repeated SessionStateItem stateItem = 4;\\n  }\\n  message \").concat(PBName.SessionStateItem, \" {\\n    required SessionStateType sessionStateType = 1;\\n    required string value = 2;\\n  }\\n  enum SessionStateType {\\n    IsSilent = 1;\\n    IsTop = 2;\\n  }\\n  message \").concat(PBName.SessionStateModifyReq, \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \").concat(PBName.SessionStateModifyResp, \" {\\n    required int64 version=1;\\n  }\\n}\\n\");\n\n  function protobuf(a) {\n    var c = function () {\n      function a(a, b, c) {\n        this.low = 0 | a, this.high = 0 | b, this.unsigned = !!c;\n      }\n\n      function b(a) {\n        return (a && a.__isLong__) === !0;\n      }\n\n      function e(a, b) {\n        var e, f, h;\n        return b ? (a >>>= 0, (h = a >= 0 && a < 256) && (f = d[a]) ? f : (e = g(a, (0 | a) < 0 ? -1 : 0, !0), h && (d[a] = e), e)) : (a |= 0, (h = a >= -128 && a < 128) && (f = c[a]) ? f : (e = g(a, a < 0 ? -1 : 0, !1), h && (c[a] = e), e));\n      }\n\n      function f(a, b) {\n        if (isNaN(a) || !isFinite(a)) return b ? r : q;\n\n        if (b) {\n          if (a < 0) return r;\n          if (a >= n) return w;\n        } else {\n          if (-o >= a) return x;\n          if (a + 1 >= o) return v;\n        }\n\n        return a < 0 ? f(-a, b).neg() : g(0 | a % m, 0 | a / m, b);\n      }\n\n      function g(b, c, d) {\n        return new a(b, c, d);\n      }\n\n      function i(a, b, c) {\n        var d, e, g, j, k, l, m;\n        if (a.length === 0) throw Error('empty string');\n        if (a === 'NaN' || a === 'Infinity' || a === '+Infinity' || a === '-Infinity') return q;\n        if (typeof b === 'number' ? (c = b, b = !1) : b = !!b, c = c || 10, c < 2 || c > 36) throw RangeError('radix');\n        if ((d = a.indexOf('-')) > 0) throw Error('interior hyphen');\n        if (d === 0) return i(a.substring(1), b, c).neg();\n\n        for (e = f(h(c, 8)), g = q, j = 0; j < a.length; j += 8) {\n          k = Math.min(8, a.length - j), l = parseInt(a.substring(j, j + k), c), k < 8 ? (m = f(h(c, k)), g = g.mul(m).add(f(l))) : (g = g.mul(e), g = g.add(f(l)));\n        }\n\n        return g.unsigned = b, g;\n      }\n\n      function j(b) {\n        return b instanceof a ? b : typeof b === 'number' ? f(b) : typeof b === 'string' ? i(b) : g(b.low, b.high, b.unsigned);\n      }\n\n      var c, d, h, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y;\n      return a.prototype.__isLong__, Object.defineProperty(a.prototype, '__isLong__', {\n        value: !0,\n        enumerable: !1,\n        configurable: !1\n      }), a.isLong = b, c = {}, d = {}, a.fromInt = e, a.fromNumber = f, a.fromBits = g, h = Math.pow, a.fromString = i, a.fromValue = j, k = 65536, l = 1 << 24, m = k * k, n = m * m, o = n / 2, p = e(l), q = e(0), a.ZERO = q, r = e(0, !0), a.UZERO = r, s = e(1), a.ONE = s, t = e(1, !0), a.UONE = t, u = e(-1), a.NEG_ONE = u, v = g(-1, 2147483647, !1), a.MAX_VALUE = v, w = g(-1, -1, !0), a.MAX_UNSIGNED_VALUE = w, x = g(0, -2147483648, !1), a.MIN_VALUE = x, y = a.prototype, y.toInt = function () {\n        return this.unsigned ? this.low >>> 0 : this.low;\n      }, y.toNumber = function () {\n        return this.unsigned ? (this.high >>> 0) * m + (this.low >>> 0) : this.high * m + (this.low >>> 0);\n      }, y.toString = function (a) {\n        var b, c, d, e, g, i, j, k, l;\n        if (a = a || 10, a < 2 || a > 36) throw RangeError('radix');\n        if (this.isZero()) return '0';\n        if (this.isNegative()) return this.eq(x) ? (b = f(a), c = this.div(b), d = c.mul(b).sub(this), c.toString(a) + d.toInt().toString(a)) : '-' + this.neg().toString(a);\n\n        for (e = f(h(a, 6), this.unsigned), g = this, i = '';;) {\n          if (j = g.div(e), k = g.sub(j.mul(e)).toInt() >>> 0, l = k.toString(a), g = j, g.isZero()) return l + i;\n\n          for (; l.length < 6;) {\n            l = '0' + l;\n          }\n\n          i = '' + l + i;\n        }\n      }, y.getHighBits = function () {\n        return this.high;\n      }, y.getHighBitsUnsigned = function () {\n        return this.high >>> 0;\n      }, y.getLowBits = function () {\n        return this.low;\n      }, y.getLowBitsUnsigned = function () {\n        return this.low >>> 0;\n      }, y.getNumBitsAbs = function () {\n        var a, b;\n        if (this.isNegative()) return this.eq(x) ? 64 : this.neg().getNumBitsAbs();\n\n        for (a = this.high != 0 ? this.high : this.low, b = 31; b > 0 && (a & 1 << b) == 0; b--) {\n        }\n\n        return this.high != 0 ? b + 33 : b + 1;\n      }, y.isZero = function () {\n        return this.high === 0 && this.low === 0;\n      }, y.isNegative = function () {\n        return !this.unsigned && this.high < 0;\n      }, y.isPositive = function () {\n        return this.unsigned || this.high >= 0;\n      }, y.isOdd = function () {\n        return (1 & this.low) === 1;\n      }, y.isEven = function () {\n        return (1 & this.low) === 0;\n      }, y.equals = function (a) {\n        return b(a) || (a = j(a)), this.unsigned !== a.unsigned && this.high >>> 31 === 1 && a.high >>> 31 === 1 ? !1 : this.high === a.high && this.low === a.low;\n      }, y.eq = y.equals, y.notEquals = function (a) {\n        return !this.eq(a);\n      }, y.neq = y.notEquals, y.lessThan = function (a) {\n        return this.comp(a) < 0;\n      }, y.lt = y.lessThan, y.lessThanOrEqual = function (a) {\n        return this.comp(a) <= 0;\n      }, y.lte = y.lessThanOrEqual, y.greaterThan = function (a) {\n        return this.comp(a) > 0;\n      }, y.gt = y.greaterThan, y.greaterThanOrEqual = function (a) {\n        return this.comp(a) >= 0;\n      }, y.gte = y.greaterThanOrEqual, y.compare = function (a) {\n        if (b(a) || (a = j(a)), this.eq(a)) return 0;\n        var c = this.isNegative();\n        var d = a.isNegative();\n        return c && !d ? -1 : !c && d ? 1 : this.unsigned ? a.high >>> 0 > this.high >>> 0 || a.high === this.high && a.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(a).isNegative() ? -1 : 1;\n      }, y.comp = y.compare, y.negate = function () {\n        return !this.unsigned && this.eq(x) ? x : this.not().add(s);\n      }, y.neg = y.negate, y.add = function (a) {\n        var c, d, e, f, h, i, k, l, m, n, o, p;\n        return b(a) || (a = j(a)), c = this.high >>> 16, d = 65535 & this.high, e = this.low >>> 16, f = 65535 & this.low, h = a.high >>> 16, i = 65535 & a.high, k = a.low >>> 16, l = 65535 & a.low, m = 0, n = 0, o = 0, p = 0, p += f + l, o += p >>> 16, p &= 65535, o += e + k, n += o >>> 16, o &= 65535, n += d + i, m += n >>> 16, n &= 65535, m += c + h, m &= 65535, g(o << 16 | p, m << 16 | n, this.unsigned);\n      }, y.subtract = function (a) {\n        return b(a) || (a = j(a)), this.add(a.neg());\n      }, y.sub = y.subtract, y.multiply = function (a) {\n        var c, d, e, h, i, k, l, m, n, o, r, s;\n        return this.isZero() ? q : (b(a) || (a = j(a)), a.isZero() ? q : this.eq(x) ? a.isOdd() ? x : q : a.eq(x) ? this.isOdd() ? x : q : this.isNegative() ? a.isNegative() ? this.neg().mul(a.neg()) : this.neg().mul(a).neg() : a.isNegative() ? this.mul(a.neg()).neg() : this.lt(p) && a.lt(p) ? f(this.toNumber() * a.toNumber(), this.unsigned) : (c = this.high >>> 16, d = 65535 & this.high, e = this.low >>> 16, h = 65535 & this.low, i = a.high >>> 16, k = 65535 & a.high, l = a.low >>> 16, m = 65535 & a.low, n = 0, o = 0, r = 0, s = 0, s += h * m, r += s >>> 16, s &= 65535, r += e * m, o += r >>> 16, r &= 65535, r += h * l, o += r >>> 16, r &= 65535, o += d * m, n += o >>> 16, o &= 65535, o += e * l, n += o >>> 16, o &= 65535, o += h * k, n += o >>> 16, o &= 65535, n += c * m + d * l + e * k + h * i, n &= 65535, g(r << 16 | s, n << 16 | o, this.unsigned)));\n      }, y.mul = y.multiply, y.divide = function (a) {\n        var c, d, e, g, i, k, l, m;\n        if (b(a) || (a = j(a)), a.isZero()) throw Error('division by zero');\n        if (this.isZero()) return this.unsigned ? r : q;\n\n        if (this.unsigned) {\n          if (a.unsigned || (a = a.toUnsigned()), a.gt(this)) return r;\n          if (a.gt(this.shru(1))) return t;\n          e = r;\n        } else {\n          if (this.eq(x)) return a.eq(s) || a.eq(u) ? x : a.eq(x) ? s : (g = this.shr(1), c = g.div(a).shl(1), c.eq(q) ? a.isNegative() ? s : u : (d = this.sub(a.mul(c)), e = c.add(d.div(a))));\n          if (a.eq(x)) return this.unsigned ? r : q;\n          if (this.isNegative()) return a.isNegative() ? this.neg().div(a.neg()) : this.neg().div(a).neg();\n          if (a.isNegative()) return this.div(a.neg()).neg();\n          e = q;\n        }\n\n        for (d = this; d.gte(a);) {\n          for (c = Math.max(1, Math.floor(d.toNumber() / a.toNumber())), i = Math.ceil(Math.log(c) / Math.LN2), k = i <= 48 ? 1 : h(2, i - 48), l = f(c), m = l.mul(a); m.isNegative() || m.gt(d);) {\n            c -= k, l = f(c, this.unsigned), m = l.mul(a);\n          }\n\n          l.isZero() && (l = s), e = e.add(l), d = d.sub(m);\n        }\n\n        return e;\n      }, y.div = y.divide, y.modulo = function (a) {\n        return b(a) || (a = j(a)), this.sub(this.div(a).mul(a));\n      }, y.mod = y.modulo, y.not = function () {\n        return g(~this.low, ~this.high, this.unsigned);\n      }, y.and = function (a) {\n        return b(a) || (a = j(a)), g(this.low & a.low, this.high & a.high, this.unsigned);\n      }, y.or = function (a) {\n        return b(a) || (a = j(a)), g(this.low | a.low, this.high | a.high, this.unsigned);\n      }, y.xor = function (a) {\n        return b(a) || (a = j(a)), g(this.low ^ a.low, this.high ^ a.high, this.unsigned);\n      }, y.shiftLeft = function (a) {\n        return b(a) && (a = a.toInt()), (a &= 63) === 0 ? this : a < 32 ? g(this.low << a, this.high << a | this.low >>> 32 - a, this.unsigned) : g(0, this.low << a - 32, this.unsigned);\n      }, y.shl = y.shiftLeft, y.shiftRight = function (a) {\n        return b(a) && (a = a.toInt()), (a &= 63) === 0 ? this : a < 32 ? g(this.low >>> a | this.high << 32 - a, this.high >> a, this.unsigned) : g(this.high >> a - 32, this.high >= 0 ? 0 : -1, this.unsigned);\n      }, y.shr = y.shiftRight, y.shiftRightUnsigned = function (a) {\n        var c, d;\n        return b(a) && (a = a.toInt()), a &= 63, a === 0 ? this : (c = this.high, a < 32 ? (d = this.low, g(d >>> a | c << 32 - a, c >>> a, this.unsigned)) : a === 32 ? g(c, 0, this.unsigned) : g(c >>> a - 32, 0, this.unsigned));\n      }, y.shru = y.shiftRightUnsigned, y.toSigned = function () {\n        return this.unsigned ? g(this.low, this.high, !1) : this;\n      }, y.toUnsigned = function () {\n        return this.unsigned ? this : g(this.low, this.high, !0);\n      }, y.toBytes = function (a) {\n        return a ? this.toBytesLE() : this.toBytesBE();\n      }, y.toBytesLE = function () {\n        var a = this.high;\n        var b = this.low;\n        return [255 & b, 255 & b >>> 8, 255 & b >>> 16, 255 & b >>> 24, 255 & a, 255 & a >>> 8, 255 & a >>> 16, 255 & a >>> 24];\n      }, y.toBytesBE = function () {\n        var a = this.high;\n        var b = this.low;\n        return [255 & a >>> 24, 255 & a >>> 16, 255 & a >>> 8, 255 & a, 255 & b >>> 24, 255 & b >>> 16, 255 & b >>> 8, 255 & b];\n      }, a;\n    }();\n\n    var d = function (a) {\n      function f(a) {\n        var b = 0;\n        return function () {\n          return b < a.length ? a.charCodeAt(b++) : null;\n        };\n      }\n\n      function g() {\n        var a = [];\n        var b = [];\n        return function () {\n          return arguments.length === 0 ? b.join('') + e.apply(String, a) : (a.length + arguments.length > 1024 && (b.push(e.apply(String, a)), a.length = 0), Array.prototype.push.apply(a, arguments), void 0);\n        };\n      }\n\n      function h(a, b, c, d, e) {\n        var f;\n        var g;\n        var h = 8 * e - d - 1;\n        var i = (1 << h) - 1;\n        var j = i >> 1;\n        var k = -7;\n        var l = c ? e - 1 : 0;\n        var m = c ? -1 : 1;\n        var n = a[b + l];\n\n        for (l += m, f = n & (1 << -k) - 1, n >>= -k, k += h; k > 0; f = 256 * f + a[b + l], l += m, k -= 8) {\n        }\n\n        for (g = f & (1 << -k) - 1, f >>= -k, k += d; k > 0; g = 256 * g + a[b + l], l += m, k -= 8) {\n        }\n\n        if (f === 0) f = 1 - j;else {\n          if (f === i) return g ? 0 / 0 : 1 / 0 * (n ? -1 : 1);\n          g += Math.pow(2, d), f -= j;\n        }\n        return (n ? -1 : 1) * g * Math.pow(2, f - d);\n      }\n\n      function i(a, b, c, d, e, f) {\n        var g;\n        var h;\n        var i;\n        var j = 8 * f - e - 1;\n        var k = (1 << j) - 1;\n        var l = k >> 1;\n        var m = e === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n        var n = d ? 0 : f - 1;\n        var o = d ? 1 : -1;\n        var p = b < 0 || b === 0 && 1 / b < 0 ? 1 : 0;\n\n        for (b = Math.abs(b), isNaN(b) || 1 / 0 === b ? (h = isNaN(b) ? 1 : 0, g = k) : (g = Math.floor(Math.log(b) / Math.LN2), b * (i = Math.pow(2, -g)) < 1 && (g--, i *= 2), b += g + l >= 1 ? m / i : m * Math.pow(2, 1 - l), b * i >= 2 && (g++, i /= 2), g + l >= k ? (h = 0, g = k) : g + l >= 1 ? (h = (b * i - 1) * Math.pow(2, e), g += l) : (h = b * Math.pow(2, l - 1) * Math.pow(2, e), g = 0)); e >= 8; a[c + n] = 255 & h, n += o, h /= 256, e -= 8) {\n        }\n\n        for (g = g << e | h, j += e; j > 0; a[c + n] = 255 & g, n += o, g /= 256, j -= 8) {\n        }\n\n        a[c + n - o] |= 128 * p;\n      }\n\n      var c;\n      var d;\n      var e;\n      var j;\n      var k;\n\n      var b = function b(a, c, e) {\n        if (typeof a === 'undefined' && (a = b.DEFAULT_CAPACITY), typeof c === 'undefined' && (c = b.DEFAULT_ENDIAN), typeof e === 'undefined' && (e = b.DEFAULT_NOASSERT), !e) {\n          if (a = 0 | a, a < 0) throw RangeError('Illegal capacity');\n          c = !!c, e = !!e;\n        }\n\n        this.buffer = a === 0 ? d : new ArrayBuffer(a), this.view = a === 0 ? null : new Uint8Array(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = a, this.littleEndian = c, this.noAssert = e;\n      };\n\n      return b.VERSION = '5.0.1', b.LITTLE_ENDIAN = !0, b.BIG_ENDIAN = !1, b.DEFAULT_CAPACITY = 16, b.DEFAULT_ENDIAN = b.BIG_ENDIAN, b.DEFAULT_NOASSERT = !1, b.Long = a || null, c = b.prototype, c.__isByteBuffer__, Object.defineProperty(c, '__isByteBuffer__', {\n        value: !0,\n        enumerable: !1,\n        configurable: !1\n      }), d = new ArrayBuffer(0), e = String.fromCharCode, b.accessor = function () {\n        return Uint8Array;\n      }, b.allocate = function (a, c, d) {\n        return new b(a, c, d);\n      }, b.concat = function (a, c, d, e) {\n        var f, i, g, h, k, j;\n\n        for ((typeof c === 'boolean' || typeof c !== 'string') && (e = d, d = c, c = void 0), f = 0, g = 0, h = a.length; h > g; ++g) {\n          b.isByteBuffer(a[g]) || (a[g] = b.wrap(a[g], c)), i = a[g].limit - a[g].offset, i > 0 && (f += i);\n        }\n\n        if (f === 0) return new b(0, d, e);\n\n        for (j = new b(f, d, e), g = 0; h > g;) {\n          k = a[g++], i = k.limit - k.offset, i <= 0 || (j.view.set(k.view.subarray(k.offset, k.limit), j.offset), j.offset += i);\n        }\n\n        return j.limit = j.offset, j.offset = 0, j;\n      }, b.isByteBuffer = function (a) {\n        return (a && a.__isByteBuffer__) === !0;\n      }, b.type = function () {\n        return ArrayBuffer;\n      }, b.wrap = function (a, d, e, f) {\n        var g, h;\n        if (typeof d !== 'string' && (f = e, e = d, d = void 0), typeof a === 'string') switch (typeof d === 'undefined' && (d = 'utf8'), d) {\n          case 'base64':\n            return b.fromBase64(a, e);\n\n          case 'hex':\n            return b.fromHex(a, e);\n\n          case 'binary':\n            return b.fromBinary(a, e);\n\n          case 'utf8':\n            return b.fromUTF8(a, e);\n\n          case 'debug':\n            return b.fromDebug(a, e);\n\n          default:\n            throw Error('Unsupported encoding: ' + d);\n        }\n        if (a === null || _typeof(a) !== 'object') throw TypeError('Illegal buffer');\n        if (b.isByteBuffer(a)) return g = c.clone.call(a), g.markedOffset = -1, g;\n        if (a instanceof Uint8Array) g = new b(0, e, f), a.length > 0 && (g.buffer = a.buffer, g.offset = a.byteOffset, g.limit = a.byteOffset + a.byteLength, g.view = new Uint8Array(a.buffer));else if (a instanceof ArrayBuffer) g = new b(0, e, f), a.byteLength > 0 && (g.buffer = a, g.offset = 0, g.limit = a.byteLength, g.view = a.byteLength > 0 ? new Uint8Array(a) : null);else {\n          if (Object.prototype.toString.call(a) !== '[object Array]') throw TypeError('Illegal buffer');\n\n          for (g = new b(a.length, e, f), g.limit = a.length, h = 0; h < a.length; ++h) {\n            g.view[h] = a[h];\n          }\n        }\n        return g;\n      }, c.writeBitSet = function (a, b) {\n        var h;\n        var d;\n        var e;\n        var f;\n        var g;\n        var i;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (!(a instanceof Array)) throw TypeError('Illegal BitSet: Not an array');\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        for (d = b, e = a.length, f = e >> 3, g = 0, b += this.writeVarint32(e, b); f--;) {\n          h = 1 & !!a[g++] | (1 & !!a[g++]) << 1 | (1 & !!a[g++]) << 2 | (1 & !!a[g++]) << 3 | (1 & !!a[g++]) << 4 | (1 & !!a[g++]) << 5 | (1 & !!a[g++]) << 6 | (1 & !!a[g++]) << 7, this.writeByte(h, b++);\n        }\n\n        if (e > g) {\n          for (i = 0, h = 0; e > g;) {\n            h |= (1 & !!a[g++]) << i++;\n          }\n\n          this.writeByte(h, b++);\n        }\n\n        return c ? (this.offset = b, this) : b - d;\n      }, c.readBitSet = function (a) {\n        var h;\n        var c;\n        var d;\n        var e;\n        var f;\n        var g;\n        var i;\n        var b = typeof a === 'undefined';\n\n        for (b && (a = this.offset), c = this.readVarint32(a), d = c.value, e = d >> 3, f = 0, g = [], a += c.length; e--;) {\n          h = this.readByte(a++), g[f++] = !!(1 & h), g[f++] = !!(2 & h), g[f++] = !!(4 & h), g[f++] = !!(8 & h), g[f++] = !!(16 & h), g[f++] = !!(32 & h), g[f++] = !!(64 & h), g[f++] = !!(128 & h);\n        }\n\n        if (d > f) for (i = 0, h = this.readByte(a++); d > f;) {\n          g[f++] = !!(1 & h >> i++);\n        }\n        return b && (this.offset = a), g;\n      }, c.readBytes = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + a > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + a + ') <= ' + this.buffer.byteLength);\n        }\n\n        return d = this.slice(b, b + a), c && (this.offset += a), d;\n      }, c.writeBytes = c.append, c.writeInt8 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 1, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 1, this.view[b] = a, c && (this.offset += 1), this;\n      }, c.writeByte = c.writeInt8, c.readInt8 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = this.view[a], (128 & c) === 128 && (c = -(255 - c + 1)), b && (this.offset += 1), c;\n      }, c.readByte = c.readInt8, c.writeUint8 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 1, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 1, this.view[b] = a, c && (this.offset += 1), this;\n      }, c.writeUInt8 = c.writeUint8, c.readUint8 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = this.view[a], b && (this.offset += 1), c;\n      }, c.readUInt8 = c.readUint8, c.writeInt16 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 2, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 2, this.littleEndian ? (this.view[b + 1] = (65280 & a) >>> 8, this.view[b] = 255 & a) : (this.view[b] = (65280 & a) >>> 8, this.view[b + 1] = 255 & a), c && (this.offset += 2), this;\n      }, c.writeShort = c.writeInt16, c.readInt16 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 2 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = 0, this.littleEndian ? (c = this.view[a], c |= this.view[a + 1] << 8) : (c = this.view[a] << 8, c |= this.view[a + 1]), (32768 & c) === 32768 && (c = -(65535 - c + 1)), b && (this.offset += 2), c;\n      }, c.readShort = c.readInt16, c.writeUint16 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 2, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 2, this.littleEndian ? (this.view[b + 1] = (65280 & a) >>> 8, this.view[b] = 255 & a) : (this.view[b] = (65280 & a) >>> 8, this.view[b + 1] = 255 & a), c && (this.offset += 2), this;\n      }, c.writeUInt16 = c.writeUint16, c.readUint16 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 2 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = 0, this.littleEndian ? (c = this.view[a], c |= this.view[a + 1] << 8) : (c = this.view[a] << 8, c |= this.view[a + 1]), b && (this.offset += 2), c;\n      }, c.readUInt16 = c.readUint16, c.writeInt32 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 4, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 4, this.littleEndian ? (this.view[b + 3] = 255 & a >>> 24, this.view[b + 2] = 255 & a >>> 16, this.view[b + 1] = 255 & a >>> 8, this.view[b] = 255 & a) : (this.view[b] = 255 & a >>> 24, this.view[b + 1] = 255 & a >>> 16, this.view[b + 2] = 255 & a >>> 8, this.view[b + 3] = 255 & a), c && (this.offset += 4), this;\n      }, c.writeInt = c.writeInt32, c.readInt32 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = 0, this.littleEndian ? (c = this.view[a + 2] << 16, c |= this.view[a + 1] << 8, c |= this.view[a], c += this.view[a + 3] << 24 >>> 0) : (c = this.view[a + 1] << 16, c |= this.view[a + 2] << 8, c |= this.view[a + 3], c += this.view[a] << 24 >>> 0), c |= 0, b && (this.offset += 4), c;\n      }, c.readInt = c.readInt32, c.writeUint32 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 4, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 4, this.littleEndian ? (this.view[b + 3] = 255 & a >>> 24, this.view[b + 2] = 255 & a >>> 16, this.view[b + 1] = 255 & a >>> 8, this.view[b] = 255 & a) : (this.view[b] = 255 & a >>> 24, this.view[b + 1] = 255 & a >>> 16, this.view[b + 2] = 255 & a >>> 8, this.view[b + 3] = 255 & a), c && (this.offset += 4), this;\n      }, c.writeUInt32 = c.writeUint32, c.readUint32 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = 0, this.littleEndian ? (c = this.view[a + 2] << 16, c |= this.view[a + 1] << 8, c |= this.view[a], c += this.view[a + 3] << 24 >>> 0) : (c = this.view[a + 1] << 16, c |= this.view[a + 2] << 8, c |= this.view[a + 3], c += this.view[a] << 24 >>> 0), b && (this.offset += 4), c;\n      }, c.readUInt32 = c.readUint32, a && (c.writeInt64 = function (b, c) {\n        var e;\n        var f;\n        var g;\n        var d = typeof c === 'undefined';\n\n        if (d && (c = this.offset), !this.noAssert) {\n          if (typeof b === 'number') b = a.fromNumber(b);else if (typeof b === 'string') b = a.fromString(b);else if (!(b && b instanceof a)) throw TypeError('Illegal value: ' + b + ' (not an integer or Long)');\n          if (typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)');\n          if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return typeof b === 'number' ? b = a.fromNumber(b) : typeof b === 'string' && (b = a.fromString(b)), c += 8, e = this.buffer.byteLength, c > e && this.resize((e *= 2) > c ? e : c), c -= 8, f = b.low, g = b.high, this.littleEndian ? (this.view[c + 3] = 255 & f >>> 24, this.view[c + 2] = 255 & f >>> 16, this.view[c + 1] = 255 & f >>> 8, this.view[c] = 255 & f, c += 4, this.view[c + 3] = 255 & g >>> 24, this.view[c + 2] = 255 & g >>> 16, this.view[c + 1] = 255 & g >>> 8, this.view[c] = 255 & g) : (this.view[c] = 255 & g >>> 24, this.view[c + 1] = 255 & g >>> 16, this.view[c + 2] = 255 & g >>> 8, this.view[c + 3] = 255 & g, c += 4, this.view[c] = 255 & f >>> 24, this.view[c + 1] = 255 & f >>> 16, this.view[c + 2] = 255 & f >>> 8, this.view[c + 3] = 255 & f), d && (this.offset += 8), this;\n      }, c.writeLong = c.writeInt64, c.readInt64 = function (b) {\n        var d;\n        var e;\n        var f;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 8 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return d = 0, e = 0, this.littleEndian ? (d = this.view[b + 2] << 16, d |= this.view[b + 1] << 8, d |= this.view[b], d += this.view[b + 3] << 24 >>> 0, b += 4, e = this.view[b + 2] << 16, e |= this.view[b + 1] << 8, e |= this.view[b], e += this.view[b + 3] << 24 >>> 0) : (e = this.view[b + 1] << 16, e |= this.view[b + 2] << 8, e |= this.view[b + 3], e += this.view[b] << 24 >>> 0, b += 4, d = this.view[b + 1] << 16, d |= this.view[b + 2] << 8, d |= this.view[b + 3], d += this.view[b] << 24 >>> 0), f = new a(d, e, !1), c && (this.offset += 8), f;\n      }, c.readLong = c.readInt64, c.writeUint64 = function (b, c) {\n        var e;\n        var f;\n        var g;\n        var d = typeof c === 'undefined';\n\n        if (d && (c = this.offset), !this.noAssert) {\n          if (typeof b === 'number') b = a.fromNumber(b);else if (typeof b === 'string') b = a.fromString(b);else if (!(b && b instanceof a)) throw TypeError('Illegal value: ' + b + ' (not an integer or Long)');\n          if (typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)');\n          if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return typeof b === 'number' ? b = a.fromNumber(b) : typeof b === 'string' && (b = a.fromString(b)), c += 8, e = this.buffer.byteLength, c > e && this.resize((e *= 2) > c ? e : c), c -= 8, f = b.low, g = b.high, this.littleEndian ? (this.view[c + 3] = 255 & f >>> 24, this.view[c + 2] = 255 & f >>> 16, this.view[c + 1] = 255 & f >>> 8, this.view[c] = 255 & f, c += 4, this.view[c + 3] = 255 & g >>> 24, this.view[c + 2] = 255 & g >>> 16, this.view[c + 1] = 255 & g >>> 8, this.view[c] = 255 & g) : (this.view[c] = 255 & g >>> 24, this.view[c + 1] = 255 & g >>> 16, this.view[c + 2] = 255 & g >>> 8, this.view[c + 3] = 255 & g, c += 4, this.view[c] = 255 & f >>> 24, this.view[c + 1] = 255 & f >>> 16, this.view[c + 2] = 255 & f >>> 8, this.view[c + 3] = 255 & f), d && (this.offset += 8), this;\n      }, c.writeUInt64 = c.writeUint64, c.readUint64 = function (b) {\n        var d;\n        var e;\n        var f;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 8 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return d = 0, e = 0, this.littleEndian ? (d = this.view[b + 2] << 16, d |= this.view[b + 1] << 8, d |= this.view[b], d += this.view[b + 3] << 24 >>> 0, b += 4, e = this.view[b + 2] << 16, e |= this.view[b + 1] << 8, e |= this.view[b], e += this.view[b + 3] << 24 >>> 0) : (e = this.view[b + 1] << 16, e |= this.view[b + 2] << 8, e |= this.view[b + 3], e += this.view[b] << 24 >>> 0, b += 4, d = this.view[b + 1] << 16, d |= this.view[b + 2] << 8, d |= this.view[b + 3], d += this.view[b] << 24 >>> 0), f = new a(d, e, !0), c && (this.offset += 8), f;\n      }, c.readUInt64 = c.readUint64), c.writeFloat32 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number') throw TypeError('Illegal value: ' + a + ' (not a number)');\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 4, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 4, i(this.view, a, b, this.littleEndian, 23, 4), c && (this.offset += 4), this;\n      }, c.writeFloat = c.writeFloat32, c.readFloat32 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = h(this.view, a, this.littleEndian, 23, 4), b && (this.offset += 4), c;\n      }, c.readFloat = c.readFloat32, c.writeFloat64 = function (a, b) {\n        var d;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'number') throw TypeError('Illegal value: ' + a + ' (not a number)');\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return b += 8, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 8, i(this.view, a, b, this.littleEndian, 52, 8), c && (this.offset += 8), this;\n      }, c.writeDouble = c.writeFloat64, c.readFloat64 = function (a) {\n        var c;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 8 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = h(this.view, a, this.littleEndian, 52, 8), b && (this.offset += 8), c;\n      }, c.readDouble = c.readFloat64, b.MAX_VARINT32_BYTES = 5, b.calculateVarint32 = function (a) {\n        return a >>>= 0, a < 128 ? 1 : a < 16384 ? 2 : 1 << 21 > a ? 3 : 1 << 28 > a ? 4 : 5;\n      }, b.zigZagEncode32 = function (a) {\n        return ((a |= 0) << 1 ^ a >> 31) >>> 0;\n      }, b.zigZagDecode32 = function (a) {\n        return 0 | a >>> 1 ^ -(1 & a);\n      }, c.writeVarint32 = function (a, c) {\n        var f;\n        var e;\n        var g;\n        var d = typeof c === 'undefined';\n\n        if (d && (c = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a |= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)');\n          if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        for (e = b.calculateVarint32(a), c += e, g = this.buffer.byteLength, c > g && this.resize((g *= 2) > c ? g : c), c -= e, a >>>= 0; a >= 128;) {\n          f = 128 | 127 & a, this.view[c++] = f, a >>>= 7;\n        }\n\n        return this.view[c++] = a, d ? (this.offset = c, this) : e;\n      }, c.writeVarint32ZigZag = function (a, c) {\n        return this.writeVarint32(b.zigZagEncode32(a), c);\n      }, c.readVarint32 = function (a) {\n        var e;\n        var c;\n        var d;\n        var f;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength);\n        }\n\n        c = 0, d = 0;\n\n        do {\n          if (!this.noAssert && a > this.limit) throw f = Error('Truncated'), f.truncated = !0, f;\n          e = this.view[a++], c < 5 && (d |= (127 & e) << 7 * c), ++c;\n        } while ((128 & e) !== 0);\n\n        return d |= 0, b ? (this.offset = a, d) : {\n          value: d,\n          length: c\n        };\n      }, c.readVarint32ZigZag = function (a) {\n        var c = this.readVarint32(a);\n        return _typeof(c) === 'object' ? c.value = b.zigZagDecode32(c.value) : c = b.zigZagDecode32(c), c;\n      }, a && (b.MAX_VARINT64_BYTES = 10, b.calculateVarint64 = function (b) {\n        typeof b === 'number' ? b = a.fromNumber(b) : typeof b === 'string' && (b = a.fromString(b));\n        var c = b.toInt() >>> 0;\n        var d = b.shiftRightUnsigned(28).toInt() >>> 0;\n        var e = b.shiftRightUnsigned(56).toInt() >>> 0;\n        return e == 0 ? d == 0 ? c < 16384 ? c < 128 ? 1 : 2 : 1 << 21 > c ? 3 : 4 : d < 16384 ? d < 128 ? 5 : 6 : 1 << 21 > d ? 7 : 8 : e < 128 ? 9 : 10;\n      }, b.zigZagEncode64 = function (b) {\n        return typeof b === 'number' ? b = a.fromNumber(b, !1) : typeof b === 'string' ? b = a.fromString(b, !1) : b.unsigned !== !1 && (b = b.toSigned()), b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned();\n      }, b.zigZagDecode64 = function (b) {\n        return typeof b === 'number' ? b = a.fromNumber(b, !1) : typeof b === 'string' ? b = a.fromString(b, !1) : b.unsigned !== !1 && (b = b.toSigned()), b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned();\n      }, c.writeVarint64 = function (c, d) {\n        var f;\n        var g;\n        var h;\n        var i;\n        var j;\n        var e = typeof d === 'undefined';\n\n        if (e && (d = this.offset), !this.noAssert) {\n          if (typeof c === 'number') c = a.fromNumber(c);else if (typeof c === 'string') c = a.fromString(c);else if (!(c && c instanceof a)) throw TypeError('Illegal value: ' + c + ' (not an integer or Long)');\n          if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)');\n          if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        switch (typeof c === 'number' ? c = a.fromNumber(c, !1) : typeof c === 'string' ? c = a.fromString(c, !1) : c.unsigned !== !1 && (c = c.toSigned()), f = b.calculateVarint64(c), g = c.toInt() >>> 0, h = c.shiftRightUnsigned(28).toInt() >>> 0, i = c.shiftRightUnsigned(56).toInt() >>> 0, d += f, j = this.buffer.byteLength, d > j && this.resize((j *= 2) > d ? j : d), d -= f, f) {\n          case 10:\n            this.view[d + 9] = 1 & i >>> 7;\n\n          case 9:\n            this.view[d + 8] = f !== 9 ? 128 | i : 127 & i;\n\n          case 8:\n            this.view[d + 7] = f !== 8 ? 128 | h >>> 21 : 127 & h >>> 21;\n\n          case 7:\n            this.view[d + 6] = f !== 7 ? 128 | h >>> 14 : 127 & h >>> 14;\n\n          case 6:\n            this.view[d + 5] = f !== 6 ? 128 | h >>> 7 : 127 & h >>> 7;\n\n          case 5:\n            this.view[d + 4] = f !== 5 ? 128 | h : 127 & h;\n\n          case 4:\n            this.view[d + 3] = f !== 4 ? 128 | g >>> 21 : 127 & g >>> 21;\n\n          case 3:\n            this.view[d + 2] = f !== 3 ? 128 | g >>> 14 : 127 & g >>> 14;\n\n          case 2:\n            this.view[d + 1] = f !== 2 ? 128 | g >>> 7 : 127 & g >>> 7;\n\n          case 1:\n            this.view[d] = f !== 1 ? 128 | g : 127 & g;\n        }\n\n        return e ? (this.offset += f, this) : f;\n      }, c.writeVarint64ZigZag = function (a, c) {\n        return this.writeVarint64(b.zigZagEncode64(a), c);\n      }, c.readVarint64 = function (b) {\n        var d;\n        var e;\n        var f;\n        var g;\n        var h;\n        var i;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 1 + ') <= ' + this.buffer.byteLength);\n        }\n\n        if (d = b, e = 0, f = 0, g = 0, h = 0, h = this.view[b++], e = 127 & h, 128 & h && (h = this.view[b++], e |= (127 & h) << 7, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], e |= (127 & h) << 14, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], e |= (127 & h) << 21, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f = 127 & h, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f |= (127 & h) << 7, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f |= (127 & h) << 14, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f |= (127 & h) << 21, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], g = 127 & h, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], g |= (127 & h) << 7, 128 & h || this.noAssert && typeof h === 'undefined')))))))))) throw Error('Buffer overrun');\n        return i = a.fromBits(e | f << 28, f >>> 4 | g << 24, !1), c ? (this.offset = b, i) : {\n          value: i,\n          length: b - d\n        };\n      }, c.readVarint64ZigZag = function (c) {\n        var d = this.readVarint64(c);\n        return d && d.value instanceof a ? d.value = b.zigZagDecode64(d.value) : d = b.zigZagDecode64(d), d;\n      }), c.writeCString = function (a, b) {\n        var d;\n        var e;\n        var g;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), e = a.length, !this.noAssert) {\n          if (typeof a !== 'string') throw TypeError('Illegal str: Not a string');\n\n          for (d = 0; e > d; ++d) {\n            if (a.charCodeAt(d) === 0) throw RangeError('Illegal str: Contains NULL-characters');\n          }\n\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return e = k.calculateUTF16asUTF8(f(a))[1], b += e + 1, g = this.buffer.byteLength, b > g && this.resize((g *= 2) > b ? g : b), b -= e + 1, k.encodeUTF16toUTF8(f(a), function (a) {\n          this.view[b++] = a;\n        }.bind(this)), this.view[b++] = 0, c ? (this.offset = b, this) : e;\n      }, c.readCString = function (a) {\n        var c;\n        var e;\n        var f;\n        var b = typeof a === 'undefined';\n\n        if (b && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return c = a, f = -1, k.decodeUTF8toUTF16(function () {\n          if (f === 0) return null;\n          if (a >= this.limit) throw RangeError('Illegal range: Truncated data, ' + a + ' < ' + this.limit);\n          return f = this.view[a++], f === 0 ? null : f;\n        }.bind(this), e = g(), !0), b ? (this.offset = a, e()) : {\n          string: e(),\n          length: a - c\n        };\n      }, c.writeIString = function (a, b) {\n        var e;\n        var d;\n        var g;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof a !== 'string') throw TypeError('Illegal str: Not a string');\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        if (d = b, e = k.calculateUTF16asUTF8(f(a), this.noAssert)[1], b += 4 + e, g = this.buffer.byteLength, b > g && this.resize((g *= 2) > b ? g : b), b -= 4 + e, this.littleEndian ? (this.view[b + 3] = 255 & e >>> 24, this.view[b + 2] = 255 & e >>> 16, this.view[b + 1] = 255 & e >>> 8, this.view[b] = 255 & e) : (this.view[b] = 255 & e >>> 24, this.view[b + 1] = 255 & e >>> 16, this.view[b + 2] = 255 & e >>> 8, this.view[b + 3] = 255 & e), b += 4, k.encodeUTF16toUTF8(f(a), function (a) {\n          this.view[b++] = a;\n        }.bind(this)), b !== d + 4 + e) throw RangeError('Illegal range: Truncated data, ' + b + ' == ' + (b + 4 + e));\n        return c ? (this.offset = b, this) : b - d;\n      }, c.readIString = function (a) {\n        var d;\n        var e;\n        var f;\n        var c = typeof a === 'undefined';\n\n        if (c && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return d = a, e = this.readUint32(a), f = this.readUTF8String(e, b.METRICS_BYTES, a += 4), a += f.length, c ? (this.offset = a, f.string) : {\n          string: f.string,\n          length: a - d\n        };\n      }, b.METRICS_CHARS = 'c', b.METRICS_BYTES = 'b', c.writeUTF8String = function (a, b) {\n        var d;\n        var e;\n        var g;\n        var c = typeof b === 'undefined';\n\n        if (c && (b = this.offset), !this.noAssert) {\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)');\n          if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return e = b, d = k.calculateUTF16asUTF8(f(a))[1], b += d, g = this.buffer.byteLength, b > g && this.resize((g *= 2) > b ? g : b), b -= d, k.encodeUTF16toUTF8(f(a), function (a) {\n          this.view[b++] = a;\n        }.bind(this)), c ? (this.offset = b, this) : b - e;\n      }, c.writeString = c.writeUTF8String, b.calculateUTF8Chars = function (a) {\n        return k.calculateUTF16asUTF8(f(a))[0];\n      }, b.calculateUTF8Bytes = function (a) {\n        return k.calculateUTF16asUTF8(f(a))[1];\n      }, b.calculateString = b.calculateUTF8Bytes, c.readUTF8String = function (a, c, d) {\n        var e, i, f, h, j;\n\n        if (typeof c === 'number' && (d = c, c = void 0), e = typeof d === 'undefined', e && (d = this.offset), typeof c === 'undefined' && (c = b.METRICS_CHARS), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal length: ' + a + ' (not an integer)');\n          if (a |= 0, typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)');\n          if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        if (f = 0, h = d, c === b.METRICS_CHARS) {\n          if (i = g(), k.decodeUTF8(function () {\n            return a > f && d < this.limit ? this.view[d++] : null;\n          }.bind(this), function (a) {\n            ++f, k.UTF8toUTF16(a, i);\n          }), f !== a) throw RangeError('Illegal range: Truncated data, ' + f + ' == ' + a);\n          return e ? (this.offset = d, i()) : {\n            string: i(),\n            length: d - h\n          };\n        }\n\n        if (c === b.METRICS_BYTES) {\n          if (!this.noAssert) {\n            if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)');\n            if (d >>>= 0, d < 0 || d + a > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + a + ') <= ' + this.buffer.byteLength);\n          }\n\n          if (j = d + a, k.decodeUTF8toUTF16(function () {\n            return j > d ? this.view[d++] : null;\n          }.bind(this), i = g(), this.noAssert), d !== j) throw RangeError('Illegal range: Truncated data, ' + d + ' == ' + j);\n          return e ? (this.offset = d, i()) : {\n            string: i(),\n            length: d - h\n          };\n        }\n\n        throw TypeError('Unsupported metrics: ' + c);\n      }, c.readString = c.readUTF8String, c.writeVString = function (a, c) {\n        var g;\n        var h;\n        var e;\n        var i;\n        var d = typeof c === 'undefined';\n\n        if (d && (c = this.offset), !this.noAssert) {\n          if (typeof a !== 'string') throw TypeError('Illegal str: Not a string');\n          if (typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)');\n          if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        if (e = c, g = k.calculateUTF16asUTF8(f(a), this.noAssert)[1], h = b.calculateVarint32(g), c += h + g, i = this.buffer.byteLength, c > i && this.resize((i *= 2) > c ? i : c), c -= h + g, c += this.writeVarint32(g, c), k.encodeUTF16toUTF8(f(a), function (a) {\n          this.view[c++] = a;\n        }.bind(this)), c !== e + g + h) throw RangeError('Illegal range: Truncated data, ' + c + ' == ' + (c + g + h));\n        return d ? (this.offset = c, this) : c - e;\n      }, c.readVString = function (a) {\n        var d;\n        var e;\n        var f;\n        var c = typeof a === 'undefined';\n\n        if (c && (a = this.offset), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return d = a, e = this.readVarint32(a), f = this.readUTF8String(e.value, b.METRICS_BYTES, a += e.length), a += f.length, c ? (this.offset = a, f.string) : {\n          string: f.string,\n          length: a - d\n        };\n      }, c.append = function (a, c, d) {\n        var e, f, g;\n\n        if ((typeof c === 'number' || typeof c !== 'string') && (d = c, c = void 0), e = typeof d === 'undefined', e && (d = this.offset), !this.noAssert) {\n          if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)');\n          if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return a instanceof b || (a = b.wrap(a, c)), f = a.limit - a.offset, f <= 0 ? this : (d += f, g = this.buffer.byteLength, d > g && this.resize((g *= 2) > d ? g : d), d -= f, this.view.set(a.view.subarray(a.offset, a.limit), d), a.offset += f, e && (this.offset += f), this);\n      }, c.appendTo = function (a, b) {\n        return a.append(this, b), this;\n      }, c.assert = function (a) {\n        return this.noAssert = !a, this;\n      }, c.capacity = function () {\n        return this.buffer.byteLength;\n      }, c.clear = function () {\n        return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this;\n      }, c.clone = function (a) {\n        var c = new b(0, this.littleEndian, this.noAssert);\n        return a ? (c.buffer = new ArrayBuffer(this.buffer.byteLength), c.view = new Uint8Array(c.buffer)) : (c.buffer = this.buffer, c.view = this.view), c.offset = this.offset, c.markedOffset = this.markedOffset, c.limit = this.limit, c;\n      }, c.compact = function (a, b) {\n        var c, e, f;\n\n        if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength);\n        }\n\n        return a === 0 && b === this.buffer.byteLength ? this : (c = b - a, c === 0 ? (this.buffer = d, this.view = null, this.markedOffset >= 0 && (this.markedOffset -= a), this.offset = 0, this.limit = 0, this) : (e = new ArrayBuffer(c), f = new Uint8Array(e), f.set(this.view.subarray(a, b)), this.buffer = e, this.view = f, this.markedOffset >= 0 && (this.markedOffset -= a), this.offset = 0, this.limit = c, this));\n      }, c.copy = function (a, c) {\n        if (typeof a === 'undefined' && (a = this.offset), typeof c === 'undefined' && (c = this.limit), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (a >>>= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (c >>>= 0, a < 0 || a > c || c > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + c + ' <= ' + this.buffer.byteLength);\n        }\n\n        if (a === c) return new b(0, this.littleEndian, this.noAssert);\n        var d = c - a;\n        var e = new b(d, this.littleEndian, this.noAssert);\n        return e.offset = 0, e.limit = d, e.markedOffset >= 0 && (e.markedOffset -= a), this.copyTo(e, 0, a, c), e;\n      }, c.copyTo = function (a, c, d, e) {\n        var f, g, h;\n        if (!this.noAssert && !b.isByteBuffer(a)) throw TypeError('Illegal target: Not a ByteBuffer');\n        if (c = (g = typeof c === 'undefined') ? a.offset : 0 | c, d = (f = typeof d === 'undefined') ? this.offset : 0 | d, e = typeof e === 'undefined' ? this.limit : 0 | e, c < 0 || c > a.buffer.byteLength) throw RangeError('Illegal target range: 0 <= ' + c + ' <= ' + a.buffer.byteLength);\n        if (d < 0 || e > this.buffer.byteLength) throw RangeError('Illegal source range: 0 <= ' + d + ' <= ' + this.buffer.byteLength);\n        return h = e - d, h === 0 ? a : (a.ensureCapacity(c + h), a.view.set(this.view.subarray(d, e), c), f && (this.offset += h), g && (a.offset += h), this);\n      }, c.ensureCapacity = function (a) {\n        var b = this.buffer.byteLength;\n        return a > b ? this.resize((b *= 2) > a ? b : a) : this;\n      }, c.fill = function (a, b, c) {\n        var d = typeof b === 'undefined';\n\n        if (d && (b = this.offset), typeof a === 'string' && a.length > 0 && (a = a.charCodeAt(0)), typeof b === 'undefined' && (b = this.offset), typeof c === 'undefined' && (c = this.limit), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)');\n          if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (b >>>= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (c >>>= 0, b < 0 || b > c || c > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + b + ' <= ' + c + ' <= ' + this.buffer.byteLength);\n        }\n\n        if (b >= c) return this;\n\n        for (; c > b;) {\n          this.view[b++] = a;\n        }\n\n        return d && (this.offset = b), this;\n      }, c.flip = function () {\n        return this.limit = this.offset, this.offset = 0, this;\n      }, c.mark = function (a) {\n        if (a = typeof a === 'undefined' ? this.offset : a, !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)');\n          if (a >>>= 0, a < 0 || a + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return this.markedOffset = a, this;\n      }, c.order = function (a) {\n        if (!this.noAssert && typeof a !== 'boolean') throw TypeError('Illegal littleEndian: Not a boolean');\n        return this.littleEndian = !!a, this;\n      }, c.LE = function (a) {\n        return this.littleEndian = typeof a !== 'undefined' ? !!a : !0, this;\n      }, c.BE = function (a) {\n        return this.littleEndian = typeof a !== 'undefined' ? !a : !1, this;\n      }, c.prepend = function (a, c, d) {\n        var e, f, g, h, i;\n\n        if ((typeof c === 'number' || typeof c !== 'string') && (d = c, c = void 0), e = typeof d === 'undefined', e && (d = this.offset), !this.noAssert) {\n          if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)');\n          if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength);\n        }\n\n        return a instanceof b || (a = b.wrap(a, c)), f = a.limit - a.offset, f <= 0 ? this : (g = f - d, g > 0 ? (h = new ArrayBuffer(this.buffer.byteLength + g), i = new Uint8Array(h), i.set(this.view.subarray(d, this.buffer.byteLength), f), this.buffer = h, this.view = i, this.offset += g, this.markedOffset >= 0 && (this.markedOffset += g), this.limit += g, d += g) : new Uint8Array(this.buffer), this.view.set(a.view.subarray(a.offset, a.limit), d - f), a.offset = a.limit, e && (this.offset -= f), this);\n      }, c.prependTo = function (a, b) {\n        return a.prepend(this, b), this;\n      }, c.printDebug = function (a) {\n        typeof a !== 'function' && (a = console.log.bind(console)), a(this.toString() + '\\n-------------------------------------------------------------------\\n' + this.toDebug(!0));\n      }, c.remaining = function () {\n        return this.limit - this.offset;\n      }, c.reset = function () {\n        return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this;\n      }, c.resize = function (a) {\n        var b, c;\n\n        if (!this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal capacity: ' + a + ' (not an integer)');\n          if (a |= 0, a < 0) throw RangeError('Illegal capacity: 0 <= ' + a);\n        }\n\n        return this.buffer.byteLength < a && (b = new ArrayBuffer(a), c = new Uint8Array(b), c.set(this.view), this.buffer = b, this.view = c), this;\n      }, c.reverse = function (a, b) {\n        if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength);\n        }\n\n        return a === b ? this : (Array.prototype.reverse.call(this.view.subarray(a, b)), this);\n      }, c.skip = function (a) {\n        if (!this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal length: ' + a + ' (not an integer)');\n          a |= 0;\n        }\n\n        var b = this.offset + a;\n        if (!this.noAssert && (b < 0 || b > this.buffer.byteLength)) throw RangeError('Illegal length: 0 <= ' + this.offset + ' + ' + a + ' <= ' + this.buffer.byteLength);\n        return this.offset = b, this;\n      }, c.slice = function (a, b) {\n        if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength);\n        }\n\n        var c = this.clone();\n        return c.offset = a, c.limit = b, c;\n      }, c.toBuffer = function (a) {\n        var e;\n        var b = this.offset;\n        var c = this.limit;\n\n        if (!this.noAssert) {\n          if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: Not an integer');\n          if (b >>>= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal limit: Not an integer');\n          if (c >>>= 0, b < 0 || b > c || c > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + b + ' <= ' + c + ' <= ' + this.buffer.byteLength);\n        }\n\n        return a || b !== 0 || c !== this.buffer.byteLength ? b === c ? d : (e = new ArrayBuffer(c - b), new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b, c), 0), e) : this.buffer;\n      }, c.toArrayBuffer = c.toBuffer, c.toString = function (a, b, c) {\n        if (typeof a === 'undefined') return 'ByteBufferAB(offset=' + this.offset + ',markedOffset=' + this.markedOffset + ',limit=' + this.limit + ',capacity=' + this.capacity() + ')';\n\n        switch (typeof a === 'number' && (a = 'utf8', b = a, c = b), a) {\n          case 'utf8':\n            return this.toUTF8(b, c);\n\n          case 'base64':\n            return this.toBase64(b, c);\n\n          case 'hex':\n            return this.toHex(b, c);\n\n          case 'binary':\n            return this.toBinary(b, c);\n\n          case 'debug':\n            return this.toDebug();\n\n          case 'columns':\n            return this.toColumns();\n\n          default:\n            throw Error('Unsupported encoding: ' + a);\n        }\n      }, j = function () {\n        var d;\n        var e;\n        var a = {};\n        var b = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47];\n        var c = [];\n\n        for (d = 0, e = b.length; e > d; ++d) {\n          c[b[d]] = d;\n        }\n\n        return a.encode = function (a, c) {\n          for (var d, e; (d = a()) !== null;) {\n            c(b[63 & d >> 2]), e = (3 & d) << 4, (d = a()) !== null ? (e |= 15 & d >> 4, c(b[63 & (e | 15 & d >> 4)]), e = (15 & d) << 2, (d = a()) !== null ? (c(b[63 & (e | 3 & d >> 6)]), c(b[63 & d])) : (c(b[63 & e]), c(61))) : (c(b[63 & e]), c(61), c(61));\n          }\n        }, a.decode = function (a, b) {\n          function g(a) {\n            throw Error('Illegal character code: ' + a);\n          }\n\n          for (var d, e, f; (d = a()) !== null;) {\n            if (e = c[d], typeof e === 'undefined' && g(d), (d = a()) !== null && (f = c[d], typeof f === 'undefined' && g(d), b(e << 2 >>> 0 | (48 & f) >> 4), (d = a()) !== null)) {\n              if (e = c[d], typeof e === 'undefined') {\n                if (d === 61) break;\n                g(d);\n              }\n\n              if (b((15 & f) << 4 >>> 0 | (60 & e) >> 2), (d = a()) !== null) {\n                if (f = c[d], typeof f === 'undefined') {\n                  if (d === 61) break;\n                  g(d);\n                }\n\n                b((3 & e) << 6 >>> 0 | f);\n              }\n            }\n          }\n        }, a.test = function (a) {\n          return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a);\n        }, a;\n      }(), c.toBase64 = function (a, b) {\n        if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), a = 0 | a, b = 0 | b, a < 0 || b > this.capacity || a > b) throw RangeError('begin, end');\n        var c;\n        return j.encode(function () {\n          return b > a ? this.view[a++] : null;\n        }.bind(this), c = g()), c();\n      }, b.fromBase64 = function (a, c) {\n        if (typeof a !== 'string') throw TypeError('str');\n        var d = new b(3 * (a.length / 4), c);\n        var e = 0;\n        return j.decode(f(a), function (a) {\n          d.view[e++] = a;\n        }), d.limit = e, d;\n      }, b.btoa = function (a) {\n        return b.fromBinary(a).toBase64();\n      }, b.atob = function (a) {\n        return b.fromBase64(a).toBinary();\n      }, c.toBinary = function (a, b) {\n        if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), a |= 0, b |= 0, a < 0 || b > this.capacity() || a > b) throw RangeError('begin, end');\n        if (a === b) return '';\n\n        for (var c = [], d = []; b > a;) {\n          c.push(this.view[a++]), c.length >= 1024 && (d.push(String.fromCharCode.apply(String, c)), c = []);\n        }\n\n        return d.join('') + String.fromCharCode.apply(String, c);\n      }, b.fromBinary = function (a, c) {\n        if (typeof a !== 'string') throw TypeError('str');\n\n        for (var f, d = 0, e = a.length, g = new b(e, c); e > d;) {\n          if (f = a.charCodeAt(d), f > 255) throw RangeError('illegal char code: ' + f);\n          g.view[d++] = f;\n        }\n\n        return g.limit = e, g;\n      }, c.toDebug = function (a) {\n        for (var d, b = -1, c = this.buffer.byteLength, e = '', f = '', g = ''; c > b;) {\n          if (b !== -1 && (d = this.view[b], e += d < 16 ? '0' + d.toString(16).toUpperCase() : d.toString(16).toUpperCase(), a && (f += d > 32 && d < 127 ? String.fromCharCode(d) : '.')), ++b, a && b > 0 && b % 16 === 0 && b !== c) {\n            for (; e.length < 51;) {\n              e += ' ';\n            }\n\n            g += e + f + '\\n', e = f = '';\n          }\n\n          e += b === this.offset && b === this.limit ? b === this.markedOffset ? '!' : '|' : b === this.offset ? b === this.markedOffset ? '[' : '<' : b === this.limit ? b === this.markedOffset ? ']' : '>' : b === this.markedOffset ? \"'\" : a || b !== 0 && b !== c ? ' ' : '';\n        }\n\n        if (a && e !== ' ') {\n          for (; e.length < 51;) {\n            e += ' ';\n          }\n\n          g += e + f + '\\n';\n        }\n\n        return a ? g : e;\n      }, b.fromDebug = function (a, c, d) {\n        for (var i, j, e = a.length, f = new b(0 | (e + 1) / 3, c, d), g = 0, h = 0, k = !1, l = !1, m = !1, n = !1, o = !1; e > g;) {\n          switch (i = a.charAt(g++)) {\n            case '!':\n              if (!d) {\n                if (l || m || n) {\n                  o = !0;\n                  break;\n                }\n\n                l = m = n = !0;\n              }\n\n              f.offset = f.markedOffset = f.limit = h, k = !1;\n              break;\n\n            case '|':\n              if (!d) {\n                if (l || n) {\n                  o = !0;\n                  break;\n                }\n\n                l = n = !0;\n              }\n\n              f.offset = f.limit = h, k = !1;\n              break;\n\n            case '[':\n              if (!d) {\n                if (l || m) {\n                  o = !0;\n                  break;\n                }\n\n                l = m = !0;\n              }\n\n              f.offset = f.markedOffset = h, k = !1;\n              break;\n\n            case '<':\n              if (!d) {\n                if (l) {\n                  o = !0;\n                  break;\n                }\n\n                l = !0;\n              }\n\n              f.offset = h, k = !1;\n              break;\n\n            case ']':\n              if (!d) {\n                if (n || m) {\n                  o = !0;\n                  break;\n                }\n\n                n = m = !0;\n              }\n\n              f.limit = f.markedOffset = h, k = !1;\n              break;\n\n            case '>':\n              if (!d) {\n                if (n) {\n                  o = !0;\n                  break;\n                }\n\n                n = !0;\n              }\n\n              f.limit = h, k = !1;\n              break;\n\n            case \"'\":\n              if (!d) {\n                if (m) {\n                  o = !0;\n                  break;\n                }\n\n                m = !0;\n              }\n\n              f.markedOffset = h, k = !1;\n              break;\n\n            case ' ':\n              k = !1;\n              break;\n\n            default:\n              if (!d && k) {\n                o = !0;\n                break;\n              }\n\n              if (j = parseInt(i + a.charAt(g++), 16), !d && (isNaN(j) || j < 0 || j > 255)) throw TypeError('Illegal str: Not a debug encoded string');\n              f.view[h++] = j, k = !0;\n          }\n\n          if (o) throw TypeError('Illegal str: Invalid symbol at ' + g);\n        }\n\n        if (!d) {\n          if (!l || !n) throw TypeError('Illegal str: Missing offset or limit');\n          if (h < f.buffer.byteLength) throw TypeError('Illegal str: Not a debug encoded string (is it hex?) ' + h + ' < ' + e);\n        }\n\n        return f;\n      }, c.toHex = function (a, b) {\n        if (a = typeof a === 'undefined' ? this.offset : a, b = typeof b === 'undefined' ? this.limit : b, !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength);\n        }\n\n        for (var d, c = new Array(b - a); b > a;) {\n          d = this.view[a++], d < 16 ? c.push('0', d.toString(16)) : c.push(d.toString(16));\n        }\n\n        return c.join('');\n      }, b.fromHex = function (a, c, d) {\n        var g, e, f, h, i;\n\n        if (!d) {\n          if (typeof a !== 'string') throw TypeError('Illegal str: Not a string');\n          if (a.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2');\n        }\n\n        for (e = a.length, f = new b(0 | e / 2, c), h = 0, i = 0; e > h; h += 2) {\n          if (g = parseInt(a.substring(h, h + 2), 16), !d && (!isFinite(g) || g < 0 || g > 255)) throw TypeError('Illegal str: Contains non-hex characters');\n          f.view[i++] = g;\n        }\n\n        return f.limit = i, f;\n      }, k = function () {\n        var a = {};\n        return a.MAX_CODEPOINT = 1114111, a.encodeUTF8 = function (a, b) {\n          var c = null;\n\n          for (typeof a === 'number' && (c = a, a = function a() {\n            return null;\n          }); c !== null || (c = a()) !== null;) {\n            c < 128 ? b(127 & c) : c < 2048 ? (b(192 | 31 & c >> 6), b(128 | 63 & c)) : c < 65536 ? (b(224 | 15 & c >> 12), b(128 | 63 & c >> 6), b(128 | 63 & c)) : (b(240 | 7 & c >> 18), b(128 | 63 & c >> 12), b(128 | 63 & c >> 6), b(128 | 63 & c)), c = null;\n          }\n        }, a.decodeUTF8 = function (a, b) {\n          for (var c, d, e, f, g = function g(a) {\n            a = a.slice(0, a.indexOf(null));\n            var b = Error(a.toString());\n            throw b.name = 'TruncatedError', b.bytes = a, b;\n          }; (c = a()) !== null;) {\n            if ((128 & c) === 0) b(c);else if ((224 & c) === 192) (d = a()) === null && g([c, d]), b((31 & c) << 6 | 63 & d);else if ((240 & c) === 224) ((d = a()) === null || (e = a()) === null) && g([c, d, e]), b((15 & c) << 12 | (63 & d) << 6 | 63 & e);else {\n              if ((248 & c) !== 240) throw RangeError('Illegal starting byte: ' + c);\n              ((d = a()) === null || (e = a()) === null || (f = a()) === null) && g([c, d, e, f]), b((7 & c) << 18 | (63 & d) << 12 | (63 & e) << 6 | 63 & f);\n            }\n          }\n        }, a.UTF16toUTF8 = function (a, b) {\n          for (var c, d = null;;) {\n            if ((c = d !== null ? d : a()) === null) break;\n            c >= 55296 && c <= 57343 && (d = a()) !== null && d >= 56320 && d <= 57343 ? (b(1024 * (c - 55296) + d - 56320 + 65536), d = null) : b(c);\n          }\n\n          d !== null && b(d);\n        }, a.UTF8toUTF16 = function (a, b) {\n          var c = null;\n\n          for (typeof a === 'number' && (c = a, a = function a() {\n            return null;\n          }); c !== null || (c = a()) !== null;) {\n            c <= 65535 ? b(c) : (c -= 65536, b((c >> 10) + 55296), b(c % 1024 + 56320)), c = null;\n          }\n        }, a.encodeUTF16toUTF8 = function (b, c) {\n          a.UTF16toUTF8(b, function (b) {\n            a.encodeUTF8(b, c);\n          });\n        }, a.decodeUTF8toUTF16 = function (b, c) {\n          a.decodeUTF8(b, function (b) {\n            a.UTF8toUTF16(b, c);\n          });\n        }, a.calculateCodePoint = function (a) {\n          return a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4;\n        }, a.calculateUTF8 = function (a) {\n          for (var b, c = 0; (b = a()) !== null;) {\n            c += b < 128 ? 1 : b < 2048 ? 2 : b < 65536 ? 3 : 4;\n          }\n\n          return c;\n        }, a.calculateUTF16asUTF8 = function (b) {\n          var c = 0;\n          var d = 0;\n          return a.UTF16toUTF8(b, function (a) {\n            ++c, d += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4;\n          }), [c, d];\n        }, a;\n      }(), c.toUTF8 = function (a, b) {\n        if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) {\n          if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer');\n          if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer');\n          if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength);\n        }\n\n        var c;\n\n        try {\n          k.decodeUTF8toUTF16(function () {\n            return b > a ? this.view[a++] : null;\n          }.bind(this), c = g());\n        } catch (d) {\n          if (a !== b) throw RangeError('Illegal range: Truncated data, ' + a + ' != ' + b);\n        }\n\n        return c();\n      }, b.fromUTF8 = function (a, c, d) {\n        if (!d && typeof a !== 'string') throw TypeError('Illegal str: Not a string');\n        var e = new b(k.calculateUTF16asUTF8(f(a), !0)[1], c, d);\n        var g = 0;\n        return k.encodeUTF16toUTF8(f(a), function (a) {\n          e.view[g++] = a;\n        }), e.limit = g, e;\n      }, b;\n    }(c);\n\n    var e = function (b, c) {\n      var f;\n      var h;\n      var i;\n      var e = {};\n      return e.ByteBuffer = b, e.c = b, f = b, e.Long = c || null, e.VERSION = '5.0.1', e.WIRE_TYPES = {}, e.WIRE_TYPES.VARINT = 0, e.WIRE_TYPES.BITS64 = 1, e.WIRE_TYPES.LDELIM = 2, e.WIRE_TYPES.STARTGROUP = 3, e.WIRE_TYPES.ENDGROUP = 4, e.WIRE_TYPES.BITS32 = 5, e.PACKABLE_WIRE_TYPES = [e.WIRE_TYPES.VARINT, e.WIRE_TYPES.BITS64, e.WIRE_TYPES.BITS32], e.TYPES = {\n        int32: {\n          name: 'int32',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: 0\n        },\n        uint32: {\n          name: 'uint32',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: 0\n        },\n        sint32: {\n          name: 'sint32',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: 0\n        },\n        int64: {\n          name: 'int64',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: e.Long ? e.Long.ZERO : void 0\n        },\n        uint64: {\n          name: 'uint64',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: e.Long ? e.Long.UZERO : void 0\n        },\n        sint64: {\n          name: 'sint64',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: e.Long ? e.Long.ZERO : void 0\n        },\n        bool: {\n          name: 'bool',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: !1\n        },\n        double: {\n          name: 'double',\n          wireType: e.WIRE_TYPES.BITS64,\n          defaultValue: 0\n        },\n        string: {\n          name: 'string',\n          wireType: e.WIRE_TYPES.LDELIM,\n          defaultValue: ''\n        },\n        bytes: {\n          name: 'bytes',\n          wireType: e.WIRE_TYPES.LDELIM,\n          defaultValue: null\n        },\n        fixed32: {\n          name: 'fixed32',\n          wireType: e.WIRE_TYPES.BITS32,\n          defaultValue: 0\n        },\n        sfixed32: {\n          name: 'sfixed32',\n          wireType: e.WIRE_TYPES.BITS32,\n          defaultValue: 0\n        },\n        fixed64: {\n          name: 'fixed64',\n          wireType: e.WIRE_TYPES.BITS64,\n          defaultValue: e.Long ? e.Long.UZERO : void 0\n        },\n        sfixed64: {\n          name: 'sfixed64',\n          wireType: e.WIRE_TYPES.BITS64,\n          defaultValue: e.Long ? e.Long.ZERO : void 0\n        },\n        float: {\n          name: 'float',\n          wireType: e.WIRE_TYPES.BITS32,\n          defaultValue: 0\n        },\n        enum: {\n          name: 'enum',\n          wireType: e.WIRE_TYPES.VARINT,\n          defaultValue: 0\n        },\n        message: {\n          name: 'message',\n          wireType: e.WIRE_TYPES.LDELIM,\n          defaultValue: null\n        },\n        group: {\n          name: 'group',\n          wireType: e.WIRE_TYPES.STARTGROUP,\n          defaultValue: null\n        }\n      }, e.MAP_KEY_TYPES = [e.TYPES.int32, e.TYPES.sint32, e.TYPES.sfixed32, e.TYPES.uint32, e.TYPES.fixed32, e.TYPES.int64, e.TYPES.sint64, e.TYPES.sfixed64, e.TYPES.uint64, e.TYPES.fixed64, e.TYPES.bool, e.TYPES.string, e.TYPES.bytes], e.ID_MIN = 1, e.ID_MAX = 536870911, e.convertFieldsToCamelCase = !1, e.populateAccessors = !0, e.populateDefaults = !0, e.Util = function () {\n        var a = {};\n        return a.IS_NODE = !((typeof process === \"undefined\" ? \"undefined\" : _typeof(process)) !== 'object' || process + '' != '[object process]' || process.browser), a.XHR = function () {\n          var c;\n          var a = [function () {\n            return new XMLHttpRequest();\n          }, function () {\n            return new ActiveXObject('Msxml2.XMLHTTP');\n          }, function () {\n            return new ActiveXObject('Msxml3.XMLHTTP');\n          }, function () {\n            return new ActiveXObject('Microsoft.XMLHTTP');\n          }];\n          var b = null;\n\n          for (c = 0; c < a.length; c++) {\n            try {\n              b = a[c]();\n            } catch (d) {\n              continue;\n            }\n\n            break;\n          }\n\n          if (!b) throw Error('XMLHttpRequest is not supported');\n          return b;\n        }, a.fetch = function (b, c) {\n          if (c && typeof c !== 'function' && (c = null), a.IS_NODE) {\n            if (c) g.readFile(b, function (a, b) {\n              a ? c(null) : c('' + b);\n            });else try {\n              return g.readFileSync(b);\n            } catch (d) {\n              return null;\n            }\n          } else {\n            var e = a.XHR();\n            if (e.open('GET', b, c ? !0 : !1), e.setRequestHeader('Accept', 'text/plain'), typeof e.overrideMimeType === 'function' && e.overrideMimeType('text/plain'), !c) return e.send(null), e.status == 200 || e.status == 0 && typeof e.responseText === 'string' ? e.responseText : null;\n            if (e.onreadystatechange = function () {\n              e.readyState == 4 && (e.status == 200 || e.status == 0 && typeof e.responseText === 'string' ? c(e.responseText) : c(null));\n            }, e.readyState == 4) return;\n            e.send(null);\n          }\n        }, a.toCamelCase = function (a) {\n          return a.replace(/_([a-zA-Z])/g, function (a, b) {\n            return b.toUpperCase();\n          });\n        }, a;\n      }(), e.Lang = {\n        DELIM: /[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,\n        RULE: /^(?:required|optional|repeated|map)$/,\n        TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\n        NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n        TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\n        TYPEREF: /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\n        FQTYPEREF: /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,\n        NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\n        NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\n        NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\n        NUMBER_OCT: /^0[0-7]+$/,\n        NUMBER_FLT: /^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\n        BOOL: /^(?:true|false)$/i,\n        ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\n        NEGID: /^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\n        WHITESPACE: /\\s/,\n        STRING: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,\n        STRING_DQ: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n        STRING_SQ: /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g\n      }, e.DotProto = function (a, b) {\n        function h(a, c) {\n          var d = -1;\n          var e = 1;\n          if (a.charAt(0) == '-' && (e = -1, a = a.substring(1)), b.NUMBER_DEC.test(a)) d = parseInt(a);else if (b.NUMBER_HEX.test(a)) d = parseInt(a.substring(2), 16);else {\n            if (!b.NUMBER_OCT.test(a)) throw Error('illegal id value: ' + (e < 0 ? '-' : '') + a);\n            d = parseInt(a.substring(1), 8);\n          }\n          if (d = 0 | e * d, !c && d < 0) throw Error('illegal id value: ' + (e < 0 ? '-' : '') + a);\n          return d;\n        }\n\n        function i(a) {\n          var c = 1;\n          if (a.charAt(0) == '-' && (c = -1, a = a.substring(1)), b.NUMBER_DEC.test(a)) return c * parseInt(a, 10);\n          if (b.NUMBER_HEX.test(a)) return c * parseInt(a.substring(2), 16);\n          if (b.NUMBER_OCT.test(a)) return c * parseInt(a.substring(1), 8);\n          if (a === 'inf') return 1 / 0 * c;\n          if (a === 'nan') return 0 / 0;\n          if (b.NUMBER_FLT.test(a)) return c * parseFloat(a);\n          throw Error('illegal number value: ' + (c < 0 ? '-' : '') + a);\n        }\n\n        function j(a, b, c) {\n          typeof a[b] === 'undefined' ? a[b] = c : (Array.isArray(a[b]) || (a[b] = [a[b]]), a[b].push(c));\n        }\n\n        var f;\n        var g;\n        var c = {};\n\n        var d = function d(a) {\n          this.source = a + '', this.index = 0, this.line = 1, this.stack = [], this._stringOpen = null;\n        };\n\n        var e = d.prototype;\n        return e._readString = function () {\n          var c;\n          var a = this._stringOpen === '\"' ? b.STRING_DQ : b.STRING_SQ;\n          if (a.lastIndex = this.index - 1, c = a.exec(this.source), !c) throw Error('unterminated string');\n          return this.index = a.lastIndex, this.stack.push(this._stringOpen), this._stringOpen = null, c[1];\n        }, e.next = function () {\n          var a, c, d, e, f, g;\n          if (this.stack.length > 0) return this.stack.shift();\n          if (this.index >= this.source.length) return null;\n          if (this._stringOpen !== null) return this._readString();\n\n          do {\n            for (a = !1; b.WHITESPACE.test(d = this.source.charAt(this.index));) {\n              if (d === '\\n' && ++this.line, ++this.index === this.source.length) return null;\n            }\n\n            if (this.source.charAt(this.index) === '/') if (++this.index, this.source.charAt(this.index) === '/') {\n              for (; this.source.charAt(++this.index) !== '\\n';) {\n                if (this.index == this.source.length) return null;\n              }\n\n              ++this.index, ++this.line, a = !0;\n            } else {\n              if ((d = this.source.charAt(this.index)) !== '*') return '/';\n\n              do {\n                if (d === '\\n' && ++this.line, ++this.index === this.source.length) return null;\n                c = d, d = this.source.charAt(this.index);\n              } while (c !== '*' || d !== '/');\n\n              ++this.index, a = !0;\n            }\n          } while (a);\n\n          if (this.index === this.source.length) return null;\n          if (e = this.index, b.DELIM.lastIndex = 0, f = b.DELIM.test(this.source.charAt(e++)), !f) for (; e < this.source.length && !b.DELIM.test(this.source.charAt(e));) {\n            ++e;\n          }\n          return g = this.source.substring(this.index, this.index = e), (g === '\"' || g === \"'\") && (this._stringOpen = g), g;\n        }, e.peek = function () {\n          if (this.stack.length === 0) {\n            var a = this.next();\n            if (a === null) return null;\n            this.stack.push(a);\n          }\n\n          return this.stack[0];\n        }, e.skip = function (a) {\n          var b = this.next();\n          if (b !== a) throw Error(\"illegal '\" + b + \"', '\" + a + \"' expected\");\n        }, e.omit = function (a) {\n          return this.peek() === a ? (this.next(), !0) : !1;\n        }, e.toString = function () {\n          return 'Tokenizer (' + this.index + '/' + this.source.length + ' at line ' + this.line + ')';\n        }, c.Tokenizer = d, f = function f(a) {\n          this.tn = new d(a), this.proto3 = !1;\n        }, g = f.prototype, g.parse = function () {\n          var c;\n          var a = {\n            name: '[ROOT]',\n            package: null,\n            messages: [],\n            enums: [],\n            imports: [],\n            options: {},\n            services: []\n          };\n          var d = !0;\n\n          try {\n            for (; c = this.tn.next();) {\n              switch (c) {\n                case 'package':\n                  if (!d || a.package !== null) throw Error(\"unexpected 'package'\");\n                  if (c = this.tn.next(), !b.TYPEREF.test(c)) throw Error('illegal package name: ' + c);\n                  this.tn.skip(';'), a.package = c;\n                  break;\n\n                case 'import':\n                  if (!d) throw Error(\"unexpected 'import'\");\n                  c = this.tn.peek(), c === 'public' && this.tn.next(), c = this._readString(), this.tn.skip(';'), a.imports.push(c);\n                  break;\n\n                case 'syntax':\n                  if (!d) throw Error(\"unexpected 'syntax'\");\n                  this.tn.skip('='), (a.syntax = this._readString()) === 'proto3' && (this.proto3 = !0), this.tn.skip(';');\n                  break;\n\n                case 'message':\n                  this._parseMessage(a, null), d = !1;\n                  break;\n\n                case 'enum':\n                  this._parseEnum(a), d = !1;\n                  break;\n\n                case 'option':\n                  this._parseOption(a);\n\n                  break;\n\n                case 'service':\n                  this._parseService(a);\n\n                  break;\n\n                case 'extend':\n                  this._parseExtend(a);\n\n                  break;\n\n                default:\n                  throw Error(\"unexpected '\" + c + \"'\");\n              }\n            }\n          } catch (e) {\n            throw e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message, e;\n          }\n\n          return delete a.name, a;\n        }, f.parse = function (a) {\n          return new f(a).parse();\n        }, g._readString = function () {\n          var b;\n          var c;\n          var a = '';\n\n          do {\n            if (c = this.tn.next(), c !== \"'\" && c !== '\"') throw Error('illegal string delimiter: ' + c);\n            a += this.tn.next(), this.tn.skip(c), b = this.tn.peek();\n          } while (b === '\"' || b === '\"');\n\n          return a;\n        }, g._readValue = function (a) {\n          var c = this.tn.peek();\n          if (c === '\"' || c === \"'\") return this._readString();\n          if (this.tn.next(), b.NUMBER.test(c)) return i(c);\n          if (b.BOOL.test(c)) return c.toLowerCase() === 'true';\n          if (a && b.TYPEREF.test(c)) return c;\n          throw Error('illegal value: ' + c);\n        }, g._parseOption = function (a, c) {\n          var f;\n          var d = this.tn.next();\n          var e = !1;\n          if (d === '(' && (e = !0, d = this.tn.next()), !b.TYPEREF.test(d)) throw Error('illegal option name: ' + d);\n          f = d, e && (this.tn.skip(')'), f = '(' + f + ')', d = this.tn.peek(), b.FQTYPEREF.test(d) && (f += d, this.tn.next())), this.tn.skip('='), this._parseOptionValue(a, f), c || this.tn.skip(';');\n        }, g._parseOptionValue = function (a, c) {\n          var d = this.tn.peek();\n          if (d !== '{') j(a.options, c, this._readValue(!0));else for (this.tn.skip('{'); (d = this.tn.next()) !== '}';) {\n            if (!b.NAME.test(d)) throw Error('illegal option name: ' + c + '.' + d);\n            this.tn.omit(':') ? j(a.options, c + '.' + d, this._readValue(!0)) : this._parseOptionValue(a, c + '.' + d);\n          }\n        }, g._parseService = function (a) {\n          var d;\n          var e;\n          var c = this.tn.next();\n          if (!b.NAME.test(c)) throw Error('illegal service name at line ' + this.tn.line + ': ' + c);\n\n          for (d = c, e = {\n            name: d,\n            rpc: {},\n            options: {}\n          }, this.tn.skip('{'); (c = this.tn.next()) !== '}';) {\n            if (c === 'option') this._parseOption(e);else {\n              if (c !== 'rpc') throw Error('illegal service token: ' + c);\n\n              this._parseServiceRPC(e);\n            }\n          }\n\n          this.tn.omit(';'), a.services.push(e);\n        }, g._parseServiceRPC = function (a) {\n          var e;\n          var f;\n          var c = 'rpc';\n          var d = this.tn.next();\n          if (!b.NAME.test(d)) throw Error('illegal rpc service method name: ' + d);\n          if (e = d, f = {\n            request: null,\n            response: null,\n            request_stream: !1,\n            response_stream: !1,\n            options: {}\n          }, this.tn.skip('('), d = this.tn.next(), d.toLowerCase() === 'stream' && (f.request_stream = !0, d = this.tn.next()), !b.TYPEREF.test(d)) throw Error('illegal rpc service request type: ' + d);\n          if (f.request = d, this.tn.skip(')'), d = this.tn.next(), d.toLowerCase() !== 'returns') throw Error('illegal rpc service request type delimiter: ' + d);\n\n          if (this.tn.skip('('), d = this.tn.next(), d.toLowerCase() === 'stream' && (f.response_stream = !0, d = this.tn.next()), f.response = d, this.tn.skip(')'), d = this.tn.peek(), d === '{') {\n            for (this.tn.next(); (d = this.tn.next()) !== '}';) {\n              if (d !== 'option') throw Error('illegal rpc service token: ' + d);\n\n              this._parseOption(f);\n            }\n\n            this.tn.omit(';');\n          } else this.tn.skip(';');\n\n          typeof a[c] === 'undefined' && (a[c] = {}), a[c][e] = f;\n        }, g._parseMessage = function (a, c) {\n          var d = !!c;\n          var e = this.tn.next();\n          var f = {\n            name: '',\n            fields: [],\n            enums: [],\n            messages: [],\n            options: {},\n            services: [],\n            oneofs: {}\n          };\n          if (!b.NAME.test(e)) throw Error('illegal ' + (d ? 'group' : 'message') + ' name: ' + e);\n\n          for (f.name = e, d && (this.tn.skip('='), c.id = h(this.tn.next()), f.isGroup = !0), e = this.tn.peek(), e === '[' && c && this._parseFieldOptions(c), this.tn.skip('{'); (e = this.tn.next()) !== '}';) {\n            if (b.RULE.test(e)) this._parseMessageField(f, e);else if (e === 'oneof') this._parseMessageOneOf(f);else if (e === 'enum') this._parseEnum(f);else if (e === 'message') this._parseMessage(f);else if (e === 'option') this._parseOption(f);else if (e === 'service') this._parseService(f);else if (e === 'extensions') f.extensions = this._parseExtensionRanges();else if (e === 'reserved') this._parseIgnored();else if (e === 'extend') this._parseExtend(f);else {\n              if (!b.TYPEREF.test(e)) throw Error('illegal message token: ' + e);\n              if (!this.proto3) throw Error('illegal field rule: ' + e);\n\n              this._parseMessageField(f, 'optional', e);\n            }\n          }\n\n          return this.tn.omit(';'), a.messages.push(f), f;\n        }, g._parseIgnored = function () {\n          for (; this.tn.peek() !== ';';) {\n            this.tn.next();\n          }\n\n          this.tn.skip(';');\n        }, g._parseMessageField = function (a, c, d) {\n          var e, f, g;\n          if (!b.RULE.test(c)) throw Error('illegal message field rule: ' + c);\n\n          if (e = {\n            rule: c,\n            type: '',\n            name: '',\n            options: {},\n            id: 0\n          }, c === 'map') {\n            if (d) throw Error('illegal type: ' + d);\n            if (this.tn.skip('<'), f = this.tn.next(), !b.TYPE.test(f) && !b.TYPEREF.test(f)) throw Error('illegal message field type: ' + f);\n            if (e.keytype = f, this.tn.skip(','), f = this.tn.next(), !b.TYPE.test(f) && !b.TYPEREF.test(f)) throw Error('illegal message field: ' + f);\n            if (e.type = f, this.tn.skip('>'), f = this.tn.next(), !b.NAME.test(f)) throw Error('illegal message field name: ' + f);\n            e.name = f, this.tn.skip('='), e.id = h(this.tn.next()), f = this.tn.peek(), f === '[' && this._parseFieldOptions(e), this.tn.skip(';');\n          } else if (d = typeof d !== 'undefined' ? d : this.tn.next(), d === 'group') {\n            if (g = this._parseMessage(a, e), !/^[A-Z]/.test(g.name)) throw Error('illegal group name: ' + g.name);\n            e.type = g.name, e.name = g.name.toLowerCase(), this.tn.omit(';');\n          } else {\n            if (!b.TYPE.test(d) && !b.TYPEREF.test(d)) throw Error('illegal message field type: ' + d);\n            if (e.type = d, f = this.tn.next(), !b.NAME.test(f)) throw Error('illegal message field name: ' + f);\n            e.name = f, this.tn.skip('='), e.id = h(this.tn.next()), f = this.tn.peek(), f === '[' && this._parseFieldOptions(e), this.tn.skip(';');\n          }\n\n          return a.fields.push(e), e;\n        }, g._parseMessageOneOf = function (a) {\n          var e;\n          var d;\n          var f;\n          var c = this.tn.next();\n          if (!b.NAME.test(c)) throw Error('illegal oneof name: ' + c);\n\n          for (d = c, f = [], this.tn.skip('{'); (c = this.tn.next()) !== '}';) {\n            e = this._parseMessageField(a, 'optional', c), e.oneof = d, f.push(e.id);\n          }\n\n          this.tn.omit(';'), a.oneofs[d] = f;\n        }, g._parseFieldOptions = function (a) {\n          this.tn.skip('[');\n\n          for (var b, c = !0; (b = this.tn.peek()) !== ']';) {\n            c || this.tn.skip(','), this._parseOption(a, !0), c = !1;\n          }\n\n          this.tn.next();\n        }, g._parseEnum = function (a) {\n          var e;\n          var c = {\n            name: '',\n            values: [],\n            options: {}\n          };\n          var d = this.tn.next();\n          if (!b.NAME.test(d)) throw Error('illegal name: ' + d);\n\n          for (c.name = d, this.tn.skip('{'); (d = this.tn.next()) !== '}';) {\n            if (d === 'option') this._parseOption(c);else {\n              if (!b.NAME.test(d)) throw Error('illegal name: ' + d);\n              this.tn.skip('='), e = {\n                name: d,\n                id: h(this.tn.next(), !0)\n              }, d = this.tn.peek(), d === '[' && this._parseFieldOptions({\n                options: {}\n              }), this.tn.skip(';'), c.values.push(e);\n            }\n          }\n\n          this.tn.omit(';'), a.enums.push(c);\n        }, g._parseExtensionRanges = function () {\n          var c;\n          var d;\n          var e;\n          var b = [];\n\n          do {\n            for (d = [];;) {\n              switch (c = this.tn.next()) {\n                case 'min':\n                  e = a.ID_MIN;\n                  break;\n\n                case 'max':\n                  e = a.ID_MAX;\n                  break;\n\n                default:\n                  e = i(c);\n              }\n\n              if (d.push(e), d.length === 2) break;\n\n              if (this.tn.peek() !== 'to') {\n                d.push(e);\n                break;\n              }\n\n              this.tn.next();\n            }\n\n            b.push(d);\n          } while (this.tn.omit(','));\n\n          return this.tn.skip(';'), b;\n        }, g._parseExtend = function (a) {\n          var d;\n          var c = this.tn.next();\n          if (!b.TYPEREF.test(c)) throw Error('illegal extend reference: ' + c);\n\n          for (d = {\n            ref: c,\n            fields: []\n          }, this.tn.skip('{'); (c = this.tn.next()) !== '}';) {\n            if (b.RULE.test(c)) this._parseMessageField(d, c);else {\n              if (!b.TYPEREF.test(c)) throw Error('illegal extend token: ' + c);\n              if (!this.proto3) throw Error('illegal field rule: ' + c);\n\n              this._parseMessageField(d, 'optional', c);\n            }\n          }\n\n          return this.tn.omit(';'), a.messages.push(d), d;\n        }, g.toString = function () {\n          return 'Parser at line ' + this.tn.line;\n        }, c.Parser = f, c;\n      }(e, e.Lang), e.Reflect = function (a) {\n        function k(b) {\n          if (typeof b === 'string' && (b = a.TYPES[b]), typeof b.defaultValue === 'undefined') throw Error('default value for type ' + b.name + ' is not supported');\n          return b == a.TYPES.bytes ? new f(0) : b.defaultValue;\n        }\n\n        function l(b, c) {\n          if (b && typeof b.low === 'number' && typeof b.high === 'number' && typeof b.unsigned === 'boolean' && b.low === b.low && b.high === b.high) return new a.Long(b.low, b.high, typeof c === 'undefined' ? b.unsigned : c);\n          if (typeof b === 'string') return a.Long.fromString(b, c || !1, 10);\n          if (typeof b === 'number') return a.Long.fromNumber(b, c || !1);\n          throw Error('not convertible to Long');\n        }\n\n        function o(b, c) {\n          var d = c.readVarint32();\n          var e = 7 & d;\n          var f = d >>> 3;\n\n          switch (e) {\n            case a.WIRE_TYPES.VARINT:\n              do {\n                d = c.readUint8();\n              } while ((128 & d) === 128);\n\n              break;\n\n            case a.WIRE_TYPES.BITS64:\n              c.offset += 8;\n              break;\n\n            case a.WIRE_TYPES.LDELIM:\n              d = c.readVarint32(), c.offset += d;\n              break;\n\n            case a.WIRE_TYPES.STARTGROUP:\n              o(f, c);\n              break;\n\n            case a.WIRE_TYPES.ENDGROUP:\n              if (f === b) return !1;\n              throw Error('Illegal GROUPEND after unknown group: ' + f + ' (' + b + ' expected)');\n\n            case a.WIRE_TYPES.BITS32:\n              c.offset += 4;\n              break;\n\n            default:\n              throw Error('Illegal wire type in unknown group ' + b + ': ' + e);\n          }\n\n          return !0;\n        }\n\n        var g;\n        var h;\n        var i;\n        var j;\n        var m;\n        var n;\n        var p;\n        var q;\n        var r;\n        var s;\n        var t;\n        var u;\n        var v;\n        var w;\n        var x;\n        var y;\n        var z;\n        var A;\n        var B;\n        var c = {};\n\n        var d = function d(a, b, c) {\n          this.builder = a, this.parent = b, this.name = c, this.className;\n        };\n\n        var e = d.prototype;\n        return e.fqn = function () {\n          for (var a = this.name, b = this;;) {\n            if (b = b.parent, b == null) break;\n            a = b.name + '.' + a;\n          }\n\n          return a;\n        }, e.toString = function (a) {\n          return (a ? this.className + ' ' : '') + this.fqn();\n        }, e.build = function () {\n          throw Error(this.toString(!0) + ' cannot be built directly');\n        }, c.T = d, g = function g(a, b, c, e, f) {\n          d.call(this, a, b, c), this.className = 'Namespace', this.children = [], this.options = e || {}, this.syntax = f || 'proto2';\n        }, h = g.prototype = Object.create(d.prototype), h.getChildren = function (a) {\n          var b, c, d;\n          if (a = a || null, a == null) return this.children.slice();\n\n          for (b = [], c = 0, d = this.children.length; d > c; ++c) {\n            this.children[c] instanceof a && b.push(this.children[c]);\n          }\n\n          return b;\n        }, h.addChild = function (a) {\n          var b;\n          if (b = this.getChild(a.name)) if (b instanceof m.Field && b.name !== b.originalName && this.getChild(b.originalName) === null) b.name = b.originalName;else {\n            if (!(a instanceof m.Field && a.name !== a.originalName && this.getChild(a.originalName) === null)) throw Error('Duplicate name in namespace ' + this.toString(!0) + ': ' + a.name);\n            a.name = a.originalName;\n          }\n          this.children.push(a);\n        }, h.getChild = function (a) {\n          var c;\n          var d;\n          var b = typeof a === 'number' ? 'id' : 'name';\n\n          for (c = 0, d = this.children.length; d > c; ++c) {\n            if (this.children[c][b] === a) return this.children[c];\n          }\n\n          return null;\n        }, h.resolve = function (a, b) {\n          var g;\n          var d = typeof a === 'string' ? a.split('.') : a;\n          var e = this;\n          var f = 0;\n\n          if (d[f] === '') {\n            for (; e.parent !== null;) {\n              e = e.parent;\n            }\n\n            f++;\n          }\n\n          do {\n            do {\n              if (!(e instanceof c.Namespace)) {\n                e = null;\n                break;\n              }\n\n              if (g = e.getChild(d[f]), !(g && g instanceof c.T && (!b || g instanceof c.Namespace))) {\n                e = null;\n                break;\n              }\n\n              e = g, f++;\n            } while (f < d.length);\n\n            if (e != null) break;\n            if (this.parent !== null) return this.parent.resolve(a, b);\n          } while (e != null);\n\n          return e;\n        }, h.qn = function (a) {\n          var e;\n          var f;\n          var b = [];\n          var d = a;\n\n          do {\n            b.unshift(d.name), d = d.parent;\n          } while (d !== null);\n\n          for (e = 1; e <= b.length; e++) {\n            if (f = b.slice(b.length - e), a === this.resolve(f, a instanceof c.Namespace)) return f.join('.');\n          }\n\n          return a.fqn();\n        }, h.build = function () {\n          var e;\n          var c;\n          var d;\n          var a = {};\n          var b = this.children;\n\n          for (c = 0, d = b.length; d > c; ++c) {\n            e = b[c], e instanceof g && (a[e.name] = e.build());\n          }\n\n          return Object.defineProperty && Object.defineProperty(a, '$options', {\n            value: this.buildOpt()\n          }), a;\n        }, h.buildOpt = function () {\n          var c;\n          var d;\n          var e;\n          var f;\n          var a = {};\n          var b = Object.keys(this.options);\n\n          for (c = 0, d = b.length; d > c; ++c) {\n            e = b[c], f = this.options[b[c]], a[e] = f;\n          }\n\n          return a;\n        }, h.getOption = function (a) {\n          return typeof a === 'undefined' ? this.options : typeof this.options[a] !== 'undefined' ? this.options[a] : null;\n        }, c.Namespace = g, i = function i(b, c, d, e) {\n          if (this.type = b, this.resolvedType = c, this.isMapKey = d, this.syntax = e, d && a.MAP_KEY_TYPES.indexOf(b) < 0) throw Error('Invalid map key type: ' + b.name);\n        }, j = i.prototype, i.defaultFieldValue = k, j.verifyValue = function (c) {\n          var f;\n          var g;\n          var h;\n\n          var d = function (a, b) {\n            throw Error('Illegal value for ' + this.toString(!0) + ' of type ' + this.type.name + ': ' + a + ' (' + b + ')');\n          }.bind(this);\n\n          switch (this.type) {\n            case a.TYPES.int32:\n            case a.TYPES.sint32:\n            case a.TYPES.sfixed32:\n              return (typeof c !== 'number' || c === c && c % 1 !== 0) && d(_typeof(c), 'not an integer'), c > 4294967295 ? 0 | c : c;\n\n            case a.TYPES.uint32:\n            case a.TYPES.fixed32:\n              return (typeof c !== 'number' || c === c && c % 1 !== 0) && d(_typeof(c), 'not an integer'), c < 0 ? c >>> 0 : c;\n\n            case a.TYPES.int64:\n            case a.TYPES.sint64:\n            case a.TYPES.sfixed64:\n              if (a.Long) try {\n                return l(c, !1);\n              } catch (e) {\n                d(_typeof(c), e.message);\n              } else d(_typeof(c), 'requires Long.js');\n\n            case a.TYPES.uint64:\n            case a.TYPES.fixed64:\n              if (a.Long) try {\n                return l(c, !0);\n              } catch (e) {\n                d(_typeof(c), e.message);\n              } else d(_typeof(c), 'requires Long.js');\n\n            case a.TYPES.bool:\n              return typeof c !== 'boolean' && d(_typeof(c), 'not a boolean'), c;\n\n            case a.TYPES.float:\n            case a.TYPES.double:\n              return typeof c !== 'number' && d(_typeof(c), 'not a number'), c;\n\n            case a.TYPES.string:\n              return typeof c === 'string' || c && c instanceof String || d(_typeof(c), 'not a string'), '' + c;\n\n            case a.TYPES.bytes:\n              return b.isByteBuffer(c) ? c : b.wrap(c);\n\n            case a.TYPES.enum:\n              for (f = this.resolvedType.getChildren(a.Reflect.Enum.Value), h = 0; h < f.length; h++) {\n                if (f[h].name == c) return f[h].id;\n                if (f[h].id == c) return f[h].id;\n              }\n\n              if (this.syntax === 'proto3') return (typeof c !== 'number' || c === c && c % 1 !== 0) && d(_typeof(c), 'not an integer'), (c > 4294967295 || c < 0) && d(_typeof(c), 'not in range for uint32'), c;\n              d(c, 'not a valid enum value');\n\n            case a.TYPES.group:\n            case a.TYPES.message:\n              if (c && _typeof(c) === 'object' || d(_typeof(c), 'object expected'), c instanceof this.resolvedType.clazz) return c;\n\n              if (c instanceof a.Builder.Message) {\n                g = {};\n\n                for (h in c) {\n                  c.hasOwnProperty(h) && (g[h] = c[h]);\n                }\n\n                c = g;\n              }\n\n              return new this.resolvedType.clazz(c);\n          }\n\n          throw Error('[INTERNAL] Illegal value for ' + this.toString(!0) + ': ' + c + ' (undefined type ' + this.type + ')');\n        }, j.calculateLength = function (b, c) {\n          if (c === null) return 0;\n          var d;\n\n          switch (this.type) {\n            case a.TYPES.int32:\n              return c < 0 ? f.calculateVarint64(c) : f.calculateVarint32(c);\n\n            case a.TYPES.uint32:\n              return f.calculateVarint32(c);\n\n            case a.TYPES.sint32:\n              return f.calculateVarint32(f.zigZagEncode32(c));\n\n            case a.TYPES.fixed32:\n            case a.TYPES.sfixed32:\n            case a.TYPES.float:\n              return 4;\n\n            case a.TYPES.int64:\n            case a.TYPES.uint64:\n              return f.calculateVarint64(c);\n\n            case a.TYPES.sint64:\n              return f.calculateVarint64(f.zigZagEncode64(c));\n\n            case a.TYPES.fixed64:\n            case a.TYPES.sfixed64:\n              return 8;\n\n            case a.TYPES.bool:\n              return 1;\n\n            case a.TYPES.enum:\n              return f.calculateVarint32(c);\n\n            case a.TYPES.double:\n              return 8;\n\n            case a.TYPES.string:\n              return d = f.calculateUTF8Bytes(c), f.calculateVarint32(d) + d;\n\n            case a.TYPES.bytes:\n              if (c.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + c.remaining() + ' bytes remaining');\n              return f.calculateVarint32(c.remaining()) + c.remaining();\n\n            case a.TYPES.message:\n              return d = this.resolvedType.calculate(c), f.calculateVarint32(d) + d;\n\n            case a.TYPES.group:\n              return d = this.resolvedType.calculate(c), d + f.calculateVarint32(b << 3 | a.WIRE_TYPES.ENDGROUP);\n          }\n\n          throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + c + ' (unknown type)');\n        }, j.encodeValue = function (b, c, d) {\n          var e, g;\n          if (c === null) return d;\n\n          switch (this.type) {\n            case a.TYPES.int32:\n              c < 0 ? d.writeVarint64(c) : d.writeVarint32(c);\n              break;\n\n            case a.TYPES.uint32:\n              d.writeVarint32(c);\n              break;\n\n            case a.TYPES.sint32:\n              d.writeVarint32ZigZag(c);\n              break;\n\n            case a.TYPES.fixed32:\n              d.writeUint32(c);\n              break;\n\n            case a.TYPES.sfixed32:\n              d.writeInt32(c);\n              break;\n\n            case a.TYPES.int64:\n            case a.TYPES.uint64:\n              d.writeVarint64(c);\n              break;\n\n            case a.TYPES.sint64:\n              d.writeVarint64ZigZag(c);\n              break;\n\n            case a.TYPES.fixed64:\n              d.writeUint64(c);\n              break;\n\n            case a.TYPES.sfixed64:\n              d.writeInt64(c);\n              break;\n\n            case a.TYPES.bool:\n              typeof c === 'string' ? d.writeVarint32(c.toLowerCase() === 'false' ? 0 : !!c) : d.writeVarint32(c ? 1 : 0);\n              break;\n\n            case a.TYPES.enum:\n              d.writeVarint32(c);\n              break;\n\n            case a.TYPES.float:\n              d.writeFloat32(c);\n              break;\n\n            case a.TYPES.double:\n              d.writeFloat64(c);\n              break;\n\n            case a.TYPES.string:\n              d.writeVString(c);\n              break;\n\n            case a.TYPES.bytes:\n              if (c.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + c.remaining() + ' bytes remaining');\n              e = c.offset, d.writeVarint32(c.remaining()), d.append(c), c.offset = e;\n              break;\n\n            case a.TYPES.message:\n              g = new f().LE(), this.resolvedType.encode(c, g), d.writeVarint32(g.offset), d.append(g.flip());\n              break;\n\n            case a.TYPES.group:\n              this.resolvedType.encode(c, d), d.writeVarint32(b << 3 | a.WIRE_TYPES.ENDGROUP);\n              break;\n\n            default:\n              throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + c + ' (unknown type)');\n          }\n\n          return d;\n        }, j.decode = function (b, c, d) {\n          if (c != this.type.wireType) throw Error('Unexpected wire type for element');\n          var e, f;\n\n          switch (this.type) {\n            case a.TYPES.int32:\n              return 0 | b.readVarint32();\n\n            case a.TYPES.uint32:\n              return b.readVarint32() >>> 0;\n\n            case a.TYPES.sint32:\n              return 0 | b.readVarint32ZigZag();\n\n            case a.TYPES.fixed32:\n              return b.readUint32() >>> 0;\n\n            case a.TYPES.sfixed32:\n              return 0 | b.readInt32();\n\n            case a.TYPES.int64:\n              return b.readVarint64();\n\n            case a.TYPES.uint64:\n              return b.readVarint64().toUnsigned();\n\n            case a.TYPES.sint64:\n              return b.readVarint64ZigZag();\n\n            case a.TYPES.fixed64:\n              return b.readUint64();\n\n            case a.TYPES.sfixed64:\n              return b.readInt64();\n\n            case a.TYPES.bool:\n              return !!b.readVarint32();\n\n            case a.TYPES.enum:\n              return b.readVarint32();\n\n            case a.TYPES.float:\n              return b.readFloat();\n\n            case a.TYPES.double:\n              return b.readDouble();\n\n            case a.TYPES.string:\n              return b.readVString();\n\n            case a.TYPES.bytes:\n              if (f = b.readVarint32(), b.remaining() < f) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + f + ' required but got only ' + b.remaining());\n              return e = b.clone(), e.limit = e.offset + f, b.offset += f, e;\n\n            case a.TYPES.message:\n              return f = b.readVarint32(), this.resolvedType.decode(b, f);\n\n            case a.TYPES.group:\n              return this.resolvedType.decode(b, -1, d);\n          }\n\n          throw Error('[INTERNAL] Illegal decode type');\n        }, j.valueFromString = function (b) {\n          if (!this.isMapKey) throw Error('valueFromString() called on non-map-key element');\n\n          switch (this.type) {\n            case a.TYPES.int32:\n            case a.TYPES.sint32:\n            case a.TYPES.sfixed32:\n            case a.TYPES.uint32:\n            case a.TYPES.fixed32:\n              return this.verifyValue(parseInt(b));\n\n            case a.TYPES.int64:\n            case a.TYPES.sint64:\n            case a.TYPES.sfixed64:\n            case a.TYPES.uint64:\n            case a.TYPES.fixed64:\n              return this.verifyValue(b);\n\n            case a.TYPES.bool:\n              return b === 'true';\n\n            case a.TYPES.string:\n              return this.verifyValue(b);\n\n            case a.TYPES.bytes:\n              return f.fromBinary(b);\n          }\n        }, j.valueToString = function (b) {\n          if (!this.isMapKey) throw Error('valueToString() called on non-map-key element');\n          return this.type === a.TYPES.bytes ? b.toString('binary') : b.toString();\n        }, c.Element = i, m = function m(a, b, c, d, e, f) {\n          g.call(this, a, b, c, d, f), this.className = 'Message', this.extensions = void 0, this.clazz = null, this.isGroup = !!e, this._fields = null, this._fieldsById = null, this._fieldsByName = null;\n        }, n = m.prototype = Object.create(g.prototype), n.build = function (c) {\n          var d, h, e, g;\n          if (this.clazz && !c) return this.clazz;\n\n          for (d = function (a, c) {\n            function k(b, c, d, e) {\n              var g, h, i, j, l, m, n;\n              if (b === null || _typeof(b) !== 'object') return e && e instanceof a.Reflect.Enum && (g = a.Reflect.Enum.getName(e.object, b), g !== null) ? g : b;\n              if (f.isByteBuffer(b)) return c ? b.toBase64() : b.toBuffer();\n              if (a.Long.isLong(b)) return d ? b.toString() : a.Long.fromValue(b);\n              if (Array.isArray(b)) return h = [], b.forEach(function (a, b) {\n                h[b] = k(a, c, d, e);\n              }), h;\n\n              if (h = {}, b instanceof a.Map) {\n                for (i = b.entries(), j = i.next(); !j.done; j = i.next()) {\n                  h[b.keyElem.valueToString(j.value[0])] = k(j.value[1], c, d, b.valueElem.resolvedType);\n                }\n\n                return h;\n              }\n\n              l = b.$type, m = void 0;\n\n              for (n in b) {\n                b.hasOwnProperty(n) && (h[n] = l && (m = l.getChild(n)) ? k(b[n], c, d, m.resolvedType) : k(b[n], c, d));\n              }\n\n              return h;\n            }\n\n            var i;\n            var j;\n            var d = c.getChildren(a.Reflect.Message.Field);\n            var e = c.getChildren(a.Reflect.Message.OneOf);\n\n            var g = function g(b) {\n              var i, j, k, l;\n\n              for (a.Builder.Message.call(this), i = 0, j = e.length; j > i; ++i) {\n                this[e[i].name] = null;\n              }\n\n              for (i = 0, j = d.length; j > i; ++i) {\n                k = d[i], this[k.name] = k.repeated ? [] : k.map ? new a.Map(k) : null, !k.required && c.syntax !== 'proto3' || k.defaultValue === null || (this[k.name] = k.defaultValue);\n              }\n\n              if (arguments.length > 0) if (arguments.length !== 1 || b === null || _typeof(b) !== 'object' || !(typeof b.encode !== 'function' || b instanceof g) || Array.isArray(b) || b instanceof a.Map || f.isByteBuffer(b) || b instanceof ArrayBuffer || a.Long && b instanceof a.Long) for (i = 0, j = arguments.length; j > i; ++i) {\n                typeof (l = arguments[i]) !== 'undefined' && this.$set(d[i].name, l);\n              } else this.$set(b);\n            };\n\n            var h = g.prototype = Object.create(a.Builder.Message.prototype);\n\n            for (h.add = function (b, d, e) {\n              var f = c._fieldsByName[b];\n\n              if (!e) {\n                if (!f) throw Error(this + '#' + b + ' is undefined');\n                if (!(f instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: ' + f.toString(!0));\n                if (!f.repeated) throw Error(this + '#' + b + ' is not a repeated field');\n                d = f.verifyValue(d, !0);\n              }\n\n              return this[b] === null && (this[b] = []), this[b].push(d), this;\n            }, h.$add = h.add, h.set = function (b, d, e) {\n              var f, g, h;\n\n              if (b && _typeof(b) === 'object') {\n                e = d;\n\n                for (f in b) {\n                  b.hasOwnProperty(f) && typeof (d = b[f]) !== 'undefined' && this.$set(f, d, e);\n                }\n\n                return this;\n              }\n\n              if (g = c._fieldsByName[b], e) this[b] = d;else {\n                if (!g) throw Error(this + '#' + b + ' is not a field: undefined');\n                if (!(g instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: ' + g.toString(!0));\n                this[g.name] = d = g.verifyValue(d);\n              }\n              return g && g.oneof && (h = this[g.oneof.name], d !== null ? (h !== null && h !== g.name && (this[h] = null), this[g.oneof.name] = g.name) : h === b && (this[g.oneof.name] = null)), this;\n            }, h.$set = h.set, h.get = function (b, d) {\n              if (d) return this[b];\n              var e = c._fieldsByName[b];\n              if (!(e && e instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: undefined');\n              if (!(e instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: ' + e.toString(!0));\n              return this[e.name];\n            }, h.$get = h.get, i = 0; i < d.length; i++) {\n              j = d[i], j instanceof a.Reflect.Message.ExtensionField || c.builder.options.populateAccessors && function (a) {\n                var d;\n                var e;\n                var f;\n                var b = a.originalName.replace(/(_[a-zA-Z])/g, function (a) {\n                  return a.toUpperCase().replace('_', '');\n                });\n                b = b.substring(0, 1).toUpperCase() + b.substring(1), d = a.originalName.replace(/([A-Z])/g, function (a) {\n                  return '_' + a;\n                }), e = function e(b, c) {\n                  return this[a.name] = c ? b : a.verifyValue(b), this;\n                }, f = function f() {\n                  return this[a.name];\n                }, c.getChild('set' + b) === null && (h['set' + b] = e), c.getChild('set_' + d) === null && (h['set_' + d] = e), c.getChild('get' + b) === null && (h['get' + b] = f), c.getChild('get_' + d) === null && (h['get_' + d] = f);\n              }(j);\n            }\n\n            return h.encode = function (a, d) {\n              var e, f;\n              typeof a === 'boolean' && (d = a, a = void 0), e = !1, a || (a = new b(), e = !0), f = a.littleEndian;\n\n              try {\n                return c.encode(this, a.LE(), d), (e ? a.flip() : a).LE(f);\n              } catch (g) {\n                throw a.LE(f), g;\n              }\n            }, g.encode = function (a, b, c) {\n              return new g(a).encode(b, c);\n            }, h.calculate = function () {\n              return c.calculate(this);\n            }, h.encodeDelimited = function (a) {\n              var d;\n              var b = !1;\n              return a || (a = new f(), b = !0), d = new f().LE(), c.encode(this, d).flip(), a.writeVarint32(d.remaining()), a.append(d), b ? a.flip() : a;\n            }, h.encodeAB = function () {\n              try {\n                return this.encode().toArrayBuffer();\n              } catch (a) {\n                throw a.encoded && (a.encoded = a.encoded.toArrayBuffer()), a;\n              }\n            }, h.toArrayBuffer = h.encodeAB, h.encodeNB = function () {\n              try {\n                return this.encode().toBuffer();\n              } catch (a) {\n                throw a.encoded && (a.encoded = a.encoded.toBuffer()), a;\n              }\n            }, h.toBuffer = h.encodeNB, h.encode64 = function () {\n              try {\n                return this.encode().toBase64();\n              } catch (a) {\n                throw a.encoded && (a.encoded = a.encoded.toBase64()), a;\n              }\n            }, h.toBase64 = h.encode64, h.encodeHex = function () {\n              try {\n                return this.encode().toHex();\n              } catch (a) {\n                throw a.encoded && (a.encoded = a.encoded.toHex()), a;\n              }\n            }, h.toHex = h.encodeHex, h.toRaw = function (a, b) {\n              return k(this, !!a, !!b, this.$type);\n            }, h.encodeJSON = function () {\n              return JSON.stringify(k(this, !0, !0, this.$type));\n            }, g.decode = function (a, b) {\n              var d, e;\n              typeof a === 'string' && (a = f.wrap(a, b || 'base64')), a = f.isByteBuffer(a) ? a : f.wrap(a), d = a.littleEndian;\n\n              try {\n                return e = c.decode(a.LE()), a.LE(d), e;\n              } catch (g) {\n                throw a.LE(d), g;\n              }\n            }, g.decodeDelimited = function (a, b) {\n              var d, e, g;\n              if (typeof a === 'string' && (a = f.wrap(a, b || 'base64')), a = f.isByteBuffer(a) ? a : f.wrap(a), a.remaining() < 1) return null;\n              if (d = a.offset, e = a.readVarint32(), a.remaining() < e) return a.offset = d, null;\n\n              try {\n                return g = c.decode(a.slice(a.offset, a.offset + e).LE()), a.offset += e, g;\n              } catch (h) {\n                throw a.offset += e, h;\n              }\n            }, g.decode64 = function (a) {\n              return g.decode(a, 'base64');\n            }, g.decodeHex = function (a) {\n              return g.decode(a, 'hex');\n            }, g.decodeJSON = function (a) {\n              return new g(JSON.parse(a));\n            }, h.toString = function () {\n              return c.toString();\n            }, Object.defineProperty && (Object.defineProperty(g, '$options', {\n              value: c.buildOpt()\n            }), Object.defineProperty(h, '$options', {\n              value: g.$options\n            }), Object.defineProperty(g, '$type', {\n              value: c\n            }), Object.defineProperty(h, '$type', {\n              value: c\n            })), g;\n          }(a, this), this._fields = [], this._fieldsById = {}, this._fieldsByName = {}, e = 0, g = this.children.length; g > e; e++) {\n            if (h = this.children[e], h instanceof t || h instanceof m || h instanceof x) {\n              if (d.hasOwnProperty(h.name)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + h.toString(!0) + \" cannot override static property '\" + h.name + \"'\");\n              d[h.name] = h.build();\n            } else if (h instanceof m.Field) h.build(), this._fields.push(h), this._fieldsById[h.id] = h, this._fieldsByName[h.name] = h;else if (!(h instanceof m.OneOf || h instanceof w)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + this.children[e].toString(!0));\n          }\n\n          return this.clazz = d;\n        }, n.encode = function (a, b, c) {\n          var e;\n          var h;\n          var f;\n          var g;\n          var i;\n          var d = null;\n\n          for (f = 0, g = this._fields.length; g > f; ++f) {\n            e = this._fields[f], h = a[e.name], e.required && h === null ? d === null && (d = e) : e.encode(c ? h : e.verifyValue(h), b, a);\n          }\n\n          if (d !== null) throw i = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + d), i.encoded = b, i;\n          return b;\n        }, n.calculate = function (a) {\n          for (var e, f, b = 0, c = 0, d = this._fields.length; d > c; ++c) {\n            if (e = this._fields[c], f = a[e.name], e.required && f === null) throw Error('Missing at least one required field for ' + this.toString(!0) + ': ' + e);\n            b += e.calculate(f, a);\n          }\n\n          return b;\n        }, n.decode = function (b, c, d) {\n          var g, h, i, j, e, f, k, l, m, n, p, q;\n\n          for (c = typeof c === 'number' ? c : -1, e = b.offset, f = new this.clazz(); b.offset < e + c || c === -1 && b.remaining() > 0;) {\n            if (g = b.readVarint32(), h = 7 & g, i = g >>> 3, h === a.WIRE_TYPES.ENDGROUP) {\n              if (i !== d) throw Error('Illegal group end indicator for ' + this.toString(!0) + ': ' + i + ' (' + (d ? d + ' expected' : 'not a group') + ')');\n              break;\n            }\n\n            if (j = this._fieldsById[i]) j.repeated && !j.options.packed ? f[j.name].push(j.decode(h, b)) : j.map ? (l = j.decode(h, b), f[j.name].set(l[0], l[1])) : (f[j.name] = j.decode(h, b), j.oneof && (m = f[j.oneof.name], m !== null && m !== j.name && (f[m] = null), f[j.oneof.name] = j.name));else switch (h) {\n              case a.WIRE_TYPES.VARINT:\n                b.readVarint32();\n                break;\n\n              case a.WIRE_TYPES.BITS32:\n                b.offset += 4;\n                break;\n\n              case a.WIRE_TYPES.BITS64:\n                b.offset += 8;\n                break;\n\n              case a.WIRE_TYPES.LDELIM:\n                k = b.readVarint32(), b.offset += k;\n                break;\n\n              case a.WIRE_TYPES.STARTGROUP:\n                for (; o(i, b);) {\n                }\n\n                break;\n\n              default:\n                throw Error('Illegal wire type for unknown field ' + i + ' in ' + this.toString(!0) + '#decode: ' + h);\n            }\n          }\n\n          for (n = 0, p = this._fields.length; p > n; ++n) {\n            if (j = this._fields[n], f[j.name] === null) if (this.syntax === 'proto3') f[j.name] = j.defaultValue;else {\n              if (j.required) throw q = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + j.name), q.decoded = f, q;\n              a.populateDefaults && j.defaultValue !== null && (f[j.name] = j.defaultValue);\n            }\n          }\n\n          return f;\n        }, c.Message = m, p = function p(b, c, e, f, g, h, i, j, k, l) {\n          d.call(this, b, c, h), this.className = 'Message.Field', this.required = e === 'required', this.repeated = e === 'repeated', this.map = e === 'map', this.keyType = f || null, this.type = g, this.resolvedType = null, this.id = i, this.options = j || {}, this.defaultValue = null, this.oneof = k || null, this.syntax = l || 'proto2', this.originalName = this.name, this.element = null, this.keyElement = null, !this.builder.options.convertFieldsToCamelCase || this instanceof m.ExtensionField || (this.name = a.Util.toCamelCase(this.name));\n        }, q = p.prototype = Object.create(d.prototype), q.build = function () {\n          this.element = new i(this.type, this.resolvedType, !1, this.syntax), this.map && (this.keyElement = new i(this.keyType, void 0, !0, this.syntax)), this.syntax !== 'proto3' || this.repeated || this.map ? typeof this.options.default !== 'undefined' && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = i.defaultFieldValue(this.type);\n        }, q.verifyValue = function (b, c) {\n          var d, e, f;\n          if (c = c || !1, d = function (a, b) {\n            throw Error('Illegal value for ' + this.toString(!0) + ' of type ' + this.type.name + ': ' + a + ' (' + b + ')');\n          }.bind(this), b === null) return this.required && d(_typeof(b), 'required'), this.syntax === 'proto3' && this.type !== a.TYPES.message && d(_typeof(b), 'proto3 field without field presence cannot be null'), null;\n\n          if (this.repeated && !c) {\n            for (Array.isArray(b) || (b = [b]), f = [], e = 0; e < b.length; e++) {\n              f.push(this.element.verifyValue(b[e]));\n            }\n\n            return f;\n          }\n\n          return this.map && !c ? b instanceof a.Map ? b : (b instanceof Object || d(_typeof(b), 'expected ProtoBuf.Map or raw object for map field'), new a.Map(this, b)) : (!this.repeated && Array.isArray(b) && d(_typeof(b), 'no array expected'), this.element.verifyValue(b));\n        }, q.hasWirePresence = function (b, c) {\n          if (this.syntax !== 'proto3') return b !== null;\n          if (this.oneof && c[this.oneof.name] === this.name) return !0;\n\n          switch (this.type) {\n            case a.TYPES.int32:\n            case a.TYPES.sint32:\n            case a.TYPES.sfixed32:\n            case a.TYPES.uint32:\n            case a.TYPES.fixed32:\n              return b !== 0;\n\n            case a.TYPES.int64:\n            case a.TYPES.sint64:\n            case a.TYPES.sfixed64:\n            case a.TYPES.uint64:\n            case a.TYPES.fixed64:\n              return b.low !== 0 || b.high !== 0;\n\n            case a.TYPES.bool:\n              return b;\n\n            case a.TYPES.float:\n            case a.TYPES.double:\n              return b !== 0;\n\n            case a.TYPES.string:\n              return b.length > 0;\n\n            case a.TYPES.bytes:\n              return b.remaining() > 0;\n\n            case a.TYPES.enum:\n              return b !== 0;\n\n            case a.TYPES.message:\n              return b !== null;\n\n            default:\n              return !0;\n          }\n        }, q.encode = function (b, c, d) {\n          var e, g, h, i, j;\n          if (this.type === null || _typeof(this.type) !== 'object') throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type);\n          if (b === null || this.repeated && b.length == 0) return c;\n\n          try {\n            if (this.repeated) {\n              if (this.options.packed && a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\n                for (c.writeVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), c.ensureCapacity(c.offset += 1), g = c.offset, e = 0; e < b.length; e++) {\n                  this.element.encodeValue(this.id, b[e], c);\n                }\n\n                h = c.offset - g, i = f.calculateVarint32(h), i > 1 && (j = c.slice(g, c.offset), g += i - 1, c.offset = g, c.append(j)), c.writeVarint32(h, g - i);\n              } else for (e = 0; e < b.length; e++) {\n                c.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, b[e], c);\n              }\n            } else this.map ? b.forEach(function (b, d) {\n              var g = f.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, d) + f.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, b);\n              c.writeVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), c.writeVarint32(g), c.writeVarint32(8 | this.keyType.wireType), this.keyElement.encodeValue(1, d, c), c.writeVarint32(16 | this.type.wireType), this.element.encodeValue(2, b, c);\n            }, this) : this.hasWirePresence(b, d) && (c.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, b, c));\n          } catch (k) {\n            throw Error('Illegal value for ' + this.toString(!0) + ': ' + b + ' (' + k + ')');\n          }\n\n          return c;\n        }, q.calculate = function (b, c) {\n          var d, e, g;\n          if (b = this.verifyValue(b), this.type === null || _typeof(this.type) !== 'object') throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type);\n          if (b === null || this.repeated && b.length == 0) return 0;\n          d = 0;\n\n          try {\n            if (this.repeated) {\n              if (this.options.packed && a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\n                for (d += f.calculateVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), g = 0, e = 0; e < b.length; e++) {\n                  g += this.element.calculateLength(this.id, b[e]);\n                }\n\n                d += f.calculateVarint32(g), d += g;\n              } else for (e = 0; e < b.length; e++) {\n                d += f.calculateVarint32(this.id << 3 | this.type.wireType), d += this.element.calculateLength(this.id, b[e]);\n              }\n            } else this.map ? b.forEach(function (b, c) {\n              var g = f.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, c) + f.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, b);\n              d += f.calculateVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), d += f.calculateVarint32(g), d += g;\n            }, this) : this.hasWirePresence(b, c) && (d += f.calculateVarint32(this.id << 3 | this.type.wireType), d += this.element.calculateLength(this.id, b));\n          } catch (h) {\n            throw Error('Illegal value for ' + this.toString(!0) + ': ' + b + ' (' + h + ')');\n          }\n\n          return d;\n        }, q.decode = function (b, c, d) {\n          var e;\n          var f;\n          var h;\n          var j;\n          var k;\n          var l;\n          var m;\n          var g = !this.map && b == this.type.wireType || !d && this.repeated && this.options.packed && b == a.WIRE_TYPES.LDELIM || this.map && b == a.WIRE_TYPES.LDELIM;\n          if (!g) throw Error('Illegal wire type for field ' + this.toString(!0) + ': ' + b + ' (' + this.type.wireType + ' expected)');\n\n          if (b == a.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !d) {\n            for (f = c.readVarint32(), f = c.offset + f, h = []; c.offset < f;) {\n              h.push(this.decode(this.type.wireType, c, !0));\n            }\n\n            return h;\n          }\n\n          if (this.map) {\n            if (j = i.defaultFieldValue(this.keyType), e = i.defaultFieldValue(this.type), f = c.readVarint32(), c.remaining() < f) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + f + ' required but got only ' + c.remaining());\n\n            for (k = c.clone(), k.limit = k.offset + f, c.offset += f; k.remaining() > 0;) {\n              if (l = k.readVarint32(), b = 7 & l, m = l >>> 3, m === 1) j = this.keyElement.decode(k, b, m);else {\n                if (m !== 2) throw Error('Unexpected tag in map field key/value submessage');\n                e = this.element.decode(k, b, m);\n              }\n            }\n\n            return [j, e];\n          }\n\n          return this.element.decode(c, b, this.id);\n        }, c.Message.Field = p, r = function r(a, b, c, d, e, f, g) {\n          p.call(this, a, b, c, null, d, e, f, g), this.extension;\n        }, r.prototype = Object.create(p.prototype), c.Message.ExtensionField = r, s = function s(a, b, c) {\n          d.call(this, a, b, c), this.fields = [];\n        }, c.Message.OneOf = s, t = function t(a, b, c, d, e) {\n          g.call(this, a, b, c, d, e), this.className = 'Enum', this.object = null;\n        }, t.getName = function (a, b) {\n          var e;\n          var d;\n          var c = Object.keys(a);\n\n          for (d = 0; d < c.length; ++d) {\n            if (a[e = c[d]] === b) return e;\n          }\n\n          return null;\n        }, u = t.prototype = Object.create(g.prototype), u.build = function (b) {\n          var c, d, e, f;\n          if (this.object && !b) return this.object;\n\n          for (c = new a.Builder.Enum(), d = this.getChildren(t.Value), e = 0, f = d.length; f > e; ++e) {\n            c[d[e].name] = d[e].id;\n          }\n\n          return Object.defineProperty && Object.defineProperty(c, '$options', {\n            value: this.buildOpt(),\n            enumerable: !1\n          }), this.object = c;\n        }, c.Enum = t, v = function v(a, b, c, e) {\n          d.call(this, a, b, c), this.className = 'Enum.Value', this.id = e;\n        }, v.prototype = Object.create(d.prototype), c.Enum.Value = v, w = function w(a, b, c, e) {\n          d.call(this, a, b, c), this.field = e;\n        }, w.prototype = Object.create(d.prototype), c.Extension = w, x = function x(a, b, c, d) {\n          g.call(this, a, b, c, d), this.className = 'Service', this.clazz = null;\n        }, y = x.prototype = Object.create(g.prototype), y.build = function (b) {\n          return this.clazz && !b ? this.clazz : this.clazz = function (a, b) {\n            var g;\n\n            var c = function c(b) {\n              a.Builder.Service.call(this), this.rpcImpl = b || function (a, b, c) {\n                setTimeout(c.bind(this, Error('Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services')), 0);\n              };\n            };\n\n            var d = c.prototype = Object.create(a.Builder.Service.prototype);\n            var e = b.getChildren(a.Reflect.Service.RPCMethod);\n\n            for (g = 0; g < e.length; g++) {\n              !function (a) {\n                d[a.name] = function (c, d) {\n                  try {\n                    try {\n                      c = a.resolvedRequestType.clazz.decode(f.wrap(c));\n                    } catch (e) {\n                      if (!(e instanceof TypeError)) throw e;\n                    }\n\n                    if (c === null || _typeof(c) !== 'object') throw Error('Illegal arguments');\n                    c instanceof a.resolvedRequestType.clazz || (c = new a.resolvedRequestType.clazz(c)), this.rpcImpl(a.fqn(), c, function (c, e) {\n                      if (c) return d(c), void 0;\n\n                      try {\n                        e = a.resolvedResponseType.clazz.decode(e);\n                      } catch (f) {}\n\n                      return e && e instanceof a.resolvedResponseType.clazz ? (d(null, e), void 0) : (d(Error('Illegal response type received in service method ' + b.name + '#' + a.name)), void 0);\n                    });\n                  } catch (e) {\n                    setTimeout(d.bind(this, e), 0);\n                  }\n                }, c[a.name] = function (b, d, e) {\n                  new c(b)[a.name](d, e);\n                }, Object.defineProperty && (Object.defineProperty(c[a.name], '$options', {\n                  value: a.buildOpt()\n                }), Object.defineProperty(d[a.name], '$options', {\n                  value: c[a.name].$options\n                }));\n              }(e[g]);\n            }\n\n            return Object.defineProperty && (Object.defineProperty(c, '$options', {\n              value: b.buildOpt()\n            }), Object.defineProperty(d, '$options', {\n              value: c.$options\n            }), Object.defineProperty(c, '$type', {\n              value: b\n            }), Object.defineProperty(d, '$type', {\n              value: b\n            })), c;\n          }(a, this);\n        }, c.Service = x, z = function z(a, b, c, e) {\n          d.call(this, a, b, c), this.className = 'Service.Method', this.options = e || {};\n        }, A = z.prototype = Object.create(d.prototype), A.buildOpt = h.buildOpt, c.Service.Method = z, B = function B(a, b, c, d, e, f, g, h) {\n          z.call(this, a, b, c, h), this.className = 'Service.RPCMethod', this.requestName = d, this.responseName = e, this.requestStream = f, this.responseStream = g, this.resolvedRequestType = null, this.resolvedResponseType = null;\n        }, B.prototype = Object.create(z.prototype), c.Service.RPCMethod = B, c;\n      }(e), e.Builder = function (a, b, c) {\n        function f(a) {\n          a.messages && a.messages.forEach(function (b) {\n            b.syntax = a.syntax, f(b);\n          }), a.enums && a.enums.forEach(function (b) {\n            b.syntax = a.syntax;\n          });\n        }\n\n        var d = function d(a) {\n          this.ns = new c.Namespace(this, null, ''), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = a || {};\n        };\n\n        var e = d.prototype;\n        return d.isMessage = function (a) {\n          return typeof a.name !== 'string' ? !1 : typeof a.values !== 'undefined' || typeof a.rpc !== 'undefined' ? !1 : !0;\n        }, d.isMessageField = function (a) {\n          return typeof a.rule !== 'string' || typeof a.name !== 'string' || typeof a.type !== 'string' || typeof a.id === 'undefined' ? !1 : !0;\n        }, d.isEnum = function (a) {\n          return typeof a.name !== 'string' ? !1 : typeof a.values !== 'undefined' && Array.isArray(a.values) && a.values.length !== 0 ? !0 : !1;\n        }, d.isService = function (a) {\n          return typeof a.name === 'string' && _typeof(a.rpc) === 'object' && a.rpc ? !0 : !1;\n        }, d.isExtend = function (a) {\n          return typeof a.ref !== 'string' ? !1 : !0;\n        }, e.reset = function () {\n          return this.ptr = this.ns, this;\n        }, e.define = function (a) {\n          if (typeof a !== 'string' || !b.TYPEREF.test(a)) throw Error('illegal namespace: ' + a);\n          return a.split('.').forEach(function (a) {\n            var b = this.ptr.getChild(a);\n            b === null && this.ptr.addChild(b = new c.Namespace(this, this.ptr, a)), this.ptr = b;\n          }, this), this;\n        }, e.create = function (b) {\n          var e, f, g, h, i;\n          if (!b) return this;\n\n          if (Array.isArray(b)) {\n            if (b.length === 0) return this;\n            b = b.slice();\n          } else b = [b];\n\n          for (e = [b]; e.length > 0;) {\n            if (b = e.pop(), !Array.isArray(b)) throw Error('not a valid namespace: ' + JSON.stringify(b));\n\n            for (; b.length > 0;) {\n              if (f = b.shift(), d.isMessage(f)) {\n                if (g = new c.Message(this, this.ptr, f.name, f.options, f.isGroup, f.syntax), h = {}, f.oneofs && Object.keys(f.oneofs).forEach(function (a) {\n                  g.addChild(h[a] = new c.Message.OneOf(this, g, a));\n                }, this), f.fields && f.fields.forEach(function (a) {\n                  if (g.getChild(0 | a.id) !== null) throw Error('duplicate or invalid field id in ' + g.name + ': ' + a.id);\n                  if (a.options && _typeof(a.options) !== 'object') throw Error('illegal field options in ' + g.name + '#' + a.name);\n                  var b = null;\n                  if (typeof a.oneof === 'string' && !(b = h[a.oneof])) throw Error('illegal oneof in ' + g.name + '#' + a.name + ': ' + a.oneof);\n                  a = new c.Message.Field(this, g, a.rule, a.keytype, a.type, a.name, a.id, a.options, b, f.syntax), b && b.fields.push(a), g.addChild(a);\n                }, this), i = [], f.enums && f.enums.forEach(function (a) {\n                  i.push(a);\n                }), f.messages && f.messages.forEach(function (a) {\n                  i.push(a);\n                }), f.services && f.services.forEach(function (a) {\n                  i.push(a);\n                }), f.extensions && (g.extensions = typeof f.extensions[0] === 'number' ? [f.extensions] : f.extensions), this.ptr.addChild(g), i.length > 0) {\n                  e.push(b), b = i, i = null, this.ptr = g, g = null;\n                  continue;\n                }\n\n                i = null;\n              } else if (d.isEnum(f)) g = new c.Enum(this, this.ptr, f.name, f.options, f.syntax), f.values.forEach(function (a) {\n                g.addChild(new c.Enum.Value(this, g, a.name, a.id));\n              }, this), this.ptr.addChild(g);else if (d.isService(f)) g = new c.Service(this, this.ptr, f.name, f.options), Object.keys(f.rpc).forEach(function (a) {\n                var b = f.rpc[a];\n                g.addChild(new c.Service.RPCMethod(this, g, a, b.request, b.response, !!b.request_stream, !!b.response_stream, b.options));\n              }, this), this.ptr.addChild(g);else {\n                if (!d.isExtend(f)) throw Error('not a valid definition: ' + JSON.stringify(f));\n\n                if (g = this.ptr.resolve(f.ref, !0)) {\n                  f.fields.forEach(function (b) {\n                    var d, e, f, h;\n                    if (g.getChild(0 | b.id) !== null) throw Error('duplicate extended field id in ' + g.name + ': ' + b.id);\n                    if (g.extensions && (d = !1, g.extensions.forEach(function (a) {\n                      b.id >= a[0] && b.id <= a[1] && (d = !0);\n                    }), !d)) throw Error('illegal extended field id in ' + g.name + ': ' + b.id + ' (not within valid ranges)');\n                    e = b.name, this.options.convertFieldsToCamelCase && (e = a.Util.toCamelCase(e)), f = new c.Message.ExtensionField(this, g, b.rule, b.type, this.ptr.fqn() + '.' + e, b.id, b.options), h = new c.Extension(this, this.ptr, b.name, f), f.extension = h, this.ptr.addChild(h), g.addChild(f);\n                  }, this);\n                } else if (!/\\.?google\\.protobuf\\./.test(f.ref)) throw Error('extended message ' + f.ref + ' is not defined');\n              }\n\n              f = null, g = null;\n            }\n\n            b = null, this.ptr = this.ptr.parent;\n          }\n\n          return this.resolved = !1, this.result = null, this;\n        }, e.import = function (b, c) {\n          var e;\n          var g;\n          var h;\n          var i;\n          var j;\n          var k;\n          var l;\n          var m;\n          var d = '/';\n\n          if (typeof c === 'string') {\n            if (a.Util.IS_NODE, this.files[c] === !0) return this.reset();\n            this.files[c] = !0;\n          } else if (_typeof(c) === 'object') {\n            if (e = c.root, a.Util.IS_NODE, (e.indexOf('\\\\') >= 0 || c.file.indexOf('\\\\') >= 0) && (d = '\\\\'), g = e + d + c.file, this.files[g] === !0) return this.reset();\n            this.files[g] = !0;\n          }\n\n          if (b.imports && b.imports.length > 0) {\n            for (i = !1, _typeof(c) === 'object' ? (this.importRoot = c.root, i = !0, h = this.importRoot, c = c.file, (h.indexOf('\\\\') >= 0 || c.indexOf('\\\\') >= 0) && (d = '\\\\')) : typeof c === 'string' ? this.importRoot ? h = this.importRoot : c.indexOf('/') >= 0 ? (h = c.replace(/\\/[^\\/]*$/, ''), h === '' && (h = '/')) : c.indexOf('\\\\') >= 0 ? (h = c.replace(/\\\\[^\\\\]*$/, ''), d = '\\\\') : h = '.' : h = null, j = 0; j < b.imports.length; j++) {\n              if (typeof b.imports[j] === 'string') {\n                if (!h) throw Error('cannot determine import root');\n                if (k = b.imports[j], k === 'google/protobuf/descriptor.proto') continue;\n                if (k = h + d + k, this.files[k] === !0) continue;\n                if (/\\.proto$/i.test(k) && !a.DotProto && (k = k.replace(/\\.proto$/, '.json')), l = a.Util.fetch(k), l === null) throw Error(\"failed to import '\" + k + \"' in '\" + c + \"': file not found\");\n                /\\.json$/i.test(k) ? this.import(JSON.parse(l + ''), k) : this.import(a.DotProto.Parser.parse(l), k);\n              } else c ? /\\.(\\w+)$/.test(c) ? this.import(b.imports[j], c.replace(/^(.+)\\.(\\w+)$/, function (a, b, c) {\n                return b + '_import' + j + '.' + c;\n              })) : this.import(b.imports[j], c + '_import' + j) : this.import(b.imports[j]);\n            }\n\n            i && (this.importRoot = null);\n          }\n\n          return b.package && this.define(b.package), b.syntax && f(b), m = this.ptr, b.options && Object.keys(b.options).forEach(function (a) {\n            m.options[a] = b.options[a];\n          }), b.messages && (this.create(b.messages), this.ptr = m), b.enums && (this.create(b.enums), this.ptr = m), b.services && (this.create(b.services), this.ptr = m), b.extends && this.create(b.extends), this.reset();\n        }, e.resolveAll = function () {\n          var d;\n          if (this.ptr == null || _typeof(this.ptr.type) === 'object') return this;\n          if (this.ptr instanceof c.Namespace) this.ptr.children.forEach(function (a) {\n            this.ptr = a, this.resolveAll();\n          }, this);else if (this.ptr instanceof c.Message.Field) {\n            if (b.TYPE.test(this.ptr.type)) this.ptr.type = a.TYPES[this.ptr.type];else {\n              if (!b.TYPEREF.test(this.ptr.type)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type);\n              if (d = (this.ptr instanceof c.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0), !d) throw Error('unresolvable type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type);\n\n              if (this.ptr.resolvedType = d, d instanceof c.Enum) {\n                if (this.ptr.type = a.TYPES.enum, this.ptr.syntax === 'proto3' && d.syntax !== 'proto3') throw Error('proto3 message cannot reference proto2 enum');\n              } else {\n                if (!(d instanceof c.Message)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type);\n                this.ptr.type = d.isGroup ? a.TYPES.group : a.TYPES.message;\n              }\n            }\n\n            if (this.ptr.map) {\n              if (!b.TYPE.test(this.ptr.keyType)) throw Error('illegal key type for map field in ' + this.ptr.toString(!0) + ': ' + this.ptr.keyType);\n              this.ptr.keyType = a.TYPES[this.ptr.keyType];\n            }\n          } else if (this.ptr instanceof a.Reflect.Service.Method) {\n            if (!(this.ptr instanceof a.Reflect.Service.RPCMethod)) throw Error('illegal service type in ' + this.ptr.toString(!0));\n            if (d = this.ptr.parent.resolve(this.ptr.requestName, !0), !(d && d instanceof a.Reflect.Message)) throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.requestName);\n            if (this.ptr.resolvedRequestType = d, d = this.ptr.parent.resolve(this.ptr.responseName, !0), !(d && d instanceof a.Reflect.Message)) throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.responseName);\n            this.ptr.resolvedResponseType = d;\n          } else if (!(this.ptr instanceof a.Reflect.Message.OneOf || this.ptr instanceof a.Reflect.Extension || this.ptr instanceof a.Reflect.Enum.Value)) throw Error('illegal object in namespace: ' + _typeof(this.ptr) + ': ' + this.ptr);\n          return this.reset();\n        }, e.build = function (a) {\n          var b, c, d;\n          if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), this.result === null && (this.result = this.ns.build()), !a) return this.result;\n\n          for (b = typeof a === 'string' ? a.split('.') : a, c = this.result, d = 0; d < b.length; d++) {\n            if (!c[b[d]]) {\n              c = null;\n              break;\n            }\n\n            c = c[b[d]];\n          }\n\n          return c;\n        }, e.lookup = function (a, b) {\n          return a ? this.ns.resolve(a, b) : this.ns;\n        }, e.toString = function () {\n          return 'Builder';\n        }, d.Message = function () {}, d.Enum = function () {}, d.Service = function () {}, d;\n      }(e, e.Lang, e.Reflect), e.Map = function (a, b) {\n        function e(a) {\n          var b = 0;\n          return {\n            next: function next() {\n              return b < a.length ? {\n                done: !1,\n                value: a[b++]\n              } : {\n                done: !0\n              };\n            }\n          };\n        }\n\n        var c = function c(a, _c) {\n          var d, e, f, g;\n          if (!a.map) throw Error('field is not a map');\n          if (this.field = a, this.keyElem = new b.Element(a.keyType, null, !0, a.syntax), this.valueElem = new b.Element(a.type, a.resolvedType, !1, a.syntax), this.map = {}, Object.defineProperty(this, 'size', {\n            get: function get() {\n              return Object.keys(this.map).length;\n            }\n          }), _c) for (d = Object.keys(_c), e = 0; e < d.length; e++) {\n            f = this.keyElem.valueFromString(d[e]), g = this.valueElem.verifyValue(_c[d[e]]), this.map[this.keyElem.valueToString(f)] = {\n              key: f,\n              value: g\n            };\n          }\n        };\n\n        var d = c.prototype;\n        return d.clear = function () {\n          this.map = {};\n        }, d.delete = function (a) {\n          var b = this.keyElem.valueToString(this.keyElem.verifyValue(a));\n          var c = (b in this.map);\n          return delete this.map[b], c;\n        }, d.entries = function () {\n          var d;\n          var c;\n          var a = [];\n          var b = Object.keys(this.map);\n\n          for (c = 0; c < b.length; c++) {\n            a.push([(d = this.map[b[c]]).key, d.value]);\n          }\n\n          return e(a);\n        }, d.keys = function () {\n          var c;\n          var a = [];\n          var b = Object.keys(this.map);\n\n          for (c = 0; c < b.length; c++) {\n            a.push(this.map[b[c]].key);\n          }\n\n          return e(a);\n        }, d.values = function () {\n          var c;\n          var a = [];\n          var b = Object.keys(this.map);\n\n          for (c = 0; c < b.length; c++) {\n            a.push(this.map[b[c]].value);\n          }\n\n          return e(a);\n        }, d.forEach = function (a, b) {\n          var e;\n          var d;\n          var c = Object.keys(this.map);\n\n          for (d = 0; d < c.length; d++) {\n            a.call(b, (e = this.map[c[d]]).value, e.key, this);\n          }\n        }, d.set = function (a, b) {\n          var c = this.keyElem.verifyValue(a);\n          var d = this.valueElem.verifyValue(b);\n          return this.map[this.keyElem.valueToString(c)] = {\n            key: c,\n            value: d\n          }, this;\n        }, d.get = function (a) {\n          var b = this.keyElem.valueToString(this.keyElem.verifyValue(a));\n          return b in this.map ? this.map[b].value : void 0;\n        }, d.has = function (a) {\n          var b = this.keyElem.valueToString(this.keyElem.verifyValue(a));\n          return b in this.map;\n        }, c;\n      }(e, e.Reflect), e.loadProto = function (a, b, c) {\n        return (typeof b === 'string' || b && typeof b.file === 'string' && typeof b.root === 'string') && (c = b, b = void 0), e.loadJson(e.DotProto.Parser.parse(a), b, c);\n      }, e.protoFromString = e.loadProto, e.loadProtoFile = function (a, b, c) {\n        if (b && _typeof(b) === 'object' ? (c = b, b = null) : b && typeof b === 'function' || (b = null), b) return e.Util.fetch(typeof a === 'string' ? a : a.root + '/' + a.file, function (d) {\n          if (d === null) return b(Error('Failed to fetch file')), void 0;\n\n          try {\n            b(null, e.loadProto(d, c, a));\n          } catch (f) {\n            b(f);\n          }\n        });\n        var d = e.Util.fetch(_typeof(a) === 'object' ? a.root + '/' + a.file : a);\n        return d === null ? null : e.loadProto(d, c, a);\n      }, e.protoFromFile = e.loadProtoFile, e.newBuilder = function (a) {\n        return a = a || {}, typeof a.convertFieldsToCamelCase === 'undefined' && (a.convertFieldsToCamelCase = e.convertFieldsToCamelCase), typeof a.populateAccessors === 'undefined' && (a.populateAccessors = e.populateAccessors), new e.Builder(a);\n      }, e.loadJson = function (a, b, c) {\n        return (typeof b === 'string' || b && typeof b.file === 'string' && typeof b.root === 'string') && (c = b, b = null), b && _typeof(b) === 'object' || (b = e.newBuilder()), typeof a === 'string' && (a = JSON.parse(a)), b.import(a, c), b.resolveAll(), b;\n      }, e.loadJsonFile = function (a, b, c) {\n        if (b && _typeof(b) === 'object' ? (c = b, b = null) : b && typeof b === 'function' || (b = null), b) return e.Util.fetch(typeof a === 'string' ? a : a.root + '/' + a.file, function (d) {\n          if (d === null) return b(Error('Failed to fetch file')), void 0;\n\n          try {\n            b(null, e.loadJson(JSON.parse(d), c, a));\n          } catch (f) {\n            b(f);\n          }\n        });\n        var d = e.Util.fetch(_typeof(a) === 'object' ? a.root + '/' + a.file : a);\n        return d === null ? null : e.loadJson(JSON.parse(d), c, a);\n      }, h = a, i = e.loadProto(h, void 0, '').build('Modules').probuf;\n    }(d, c);\n\n    return e;\n  }\n\n  var Codec$1 = protobuf(SSMsg$1);\n\n  Codec$1.getModule = function (pbName) {\n    var _this11 = this;\n\n    _newArrowCheck(this, _this);\n\n    var modules = new Codec$1[pbName]();\n\n    modules.getArrayData = function () {\n      _newArrowCheck(this, _this11);\n\n      var data = modules.toArrayBuffer();\n      data = isArrayBuffer(data) ? [].slice.call(new Int8Array(data)) : data;\n      return data;\n    }.bind(this);\n\n    return modules;\n  }.bind(undefined);\n\n  var ErrorCode;\n\n  (function (ErrorCode) {\n    ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n    ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n    ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n    ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n    ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n    ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n    ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n    ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n    ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n    ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n    ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n    ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n    ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n    ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n    ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n    ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n    ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n    ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n    ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n    ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n    ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n    ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n    ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n    ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n    ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n    ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n    ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n    ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n    ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n    ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n    ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n    ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n    ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n    ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n    ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n    ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n    ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n    ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n    ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n    ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n    ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n    ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n    ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n    ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n    ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n    ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n    ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n    ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n    ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n    ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n    ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n    ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n    ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n    ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n    ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n    ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n    ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n    ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n    ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n    ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n    ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n    ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n    ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n    ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n    ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n    ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n    ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n    ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n    ErrorCode[ErrorCode[\"EXPANSION_LIMIT_EXCEET\"] = 34010] = \"EXPANSION_LIMIT_EXCEET\";\n    ErrorCode[ErrorCode[\"MESSAGE_KV_NOT_SUPPORT\"] = 34008] = \"MESSAGE_KV_NOT_SUPPORT\";\n    ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n    ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n    ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n    ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n    ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n    ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n    ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n    ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n    ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n    ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n    ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n    ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n    ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n    ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n    ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n    ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n    ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n    ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n    ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n    ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n    ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n    ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n    ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n    ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n    ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n    ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n    ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n    ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n    ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n    ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n    ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n    ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n    ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n    ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n    ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n    ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n    ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n    ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n    ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n    ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n    ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n    ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n    ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n    ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n    ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n    ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n    ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n    ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n    ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n  })(ErrorCode || (ErrorCode = {}));\n\n  var ErrorCode$1 = ErrorCode;\n\n  var timerSetTimeout = function timerSetTimeout(fun, itv) {\n    _newArrowCheck(this, _this);\n\n    return setTimeout(fun, itv);\n  }.bind(undefined);\n\n  var int64ToTimestamp = function int64ToTimestamp(obj) {\n    _newArrowCheck(this, _this);\n\n    if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n      return obj;\n    }\n\n    var low = obj.low;\n\n    if (low < 0) {\n      low += 0xffffffff + 1;\n    }\n\n    low = low.toString(16);\n    var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n    return timestamp;\n  }.bind(undefined);\n\n  var batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n    _newArrowCheck(this, _this);\n\n    for (var _key8 in data) {\n      if (isObject(data[_key8])) {\n        data[_key8] = int64ToTimestamp(data[_key8]);\n      }\n    }\n\n    return data;\n  }.bind(undefined);\n\n  var formatDate = function formatDate(seperator) {\n    _newArrowCheck(this, _this);\n\n    seperator = seperator || '-';\n    var date = new Date();\n    var year = date.getFullYear();\n    var month = date.getMonth() + 1;\n    var day = date.getDate();\n    return \"\".concat(year).concat(seperator).concat(month).concat(seperator).concat(day);\n  }.bind(undefined);\n\n  var MentionedType;\n\n  (function (MentionedType) {\n    MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n    MentionedType[MentionedType[\"SINGAL\"] = 2] = \"SINGAL\";\n  })(MentionedType || (MentionedType = {}));\n\n  var MentionedType$1 = MentionedType;\n  var MessageType;\n\n  (function (MessageType) {\n    MessageType[\"TextMessage\"] = \"RC:TxtMsg\";\n    MessageType[\"VOICE\"] = \"RC:VcMsg\";\n    MessageType[\"HQ_VOICE\"] = \"RC:HQVCMsg\";\n    MessageType[\"IMAGE\"] = \"RC:ImgMsg\";\n    MessageType[\"GIF\"] = \"RC:GIFMsg\";\n    MessageType[\"RICH_CONTENT\"] = \"RC:ImgTextMsg\";\n    MessageType[\"LOCATION\"] = \"RC:LBSMsg\";\n    MessageType[\"FILE\"] = \"RC:FileMsg\";\n    MessageType[\"SIGHT\"] = \"RC:SightMsg\";\n    MessageType[\"COMBINE\"] = \"RC:CombineMsg\";\n    MessageType[\"CHRM_KV_NOTIFY\"] = \"RC:chrmKVNotiMsg\";\n    MessageType[\"LOG_COMMAND\"] = \"RC:LogCmdMsg\";\n    MessageType[\"EXPANSION_NOTIFY\"] = \"RC:MsgExMsg\";\n    MessageType[\"REFERENCE\"] = \"RC:ReferenceMsg\";\n    MessageType[\"RECALL\"] = \"RC:RcCmd\";\n    MessageType[\"READ_RECEIPT\"] = \"RC:ReadNtf\";\n    MessageType[\"READ_RECEIPT_REQUEST\"] = \"RC:RRReqMsg\";\n    MessageType[\"READ_RECEIPT_RESPONSE\"] = \"RC:RRRspMsg\";\n    MessageType[\"SYNC_READ_STATUS\"] = \"RC:SRSMsg\";\n  })(MessageType || (MessageType = {}));\n\n  var MessageType$1 = MessageType;\n  var NotificationStatus;\n\n  (function (NotificationStatus) {\n    NotificationStatus[NotificationStatus[\"OPEN\"] = 1] = \"OPEN\";\n    NotificationStatus[NotificationStatus[\"CLOSE\"] = 2] = \"CLOSE\";\n  })(NotificationStatus || (NotificationStatus = {}));\n\n  var NotificationStatus$1 = NotificationStatus;\n  var PublishTopic = {\n    PRIVATE: 'ppMsgP',\n    GROUP: 'pgMsgP',\n    CHATROOM: 'chatMsg',\n    CUSTOMER_SERVICE: 'pcMsgP',\n    RECALL: 'recallMsg',\n    RTC_MSG: 'prMsgS',\n    NOTIFY_PULL_MSG: 's_ntf',\n    RECEIVE_MSG: 's_msg',\n    SYNC_STATUS: 's_stat',\n    SERVER_NOTIFY: 's_cmd',\n    SETTING_NOTIFY: 's_us'\n  };\n  var PublishStatusTopic = {\n    PRIVATE: 'ppMsgS',\n    GROUP: 'pgMsgS',\n    CHATROOM: 'chatMsgS'\n  };\n  var QueryTopic = {\n    GET_SYNC_TIME: 'qrySessionsAtt',\n    PULL_MSG: 'pullMsg',\n    GET_CONVERSATION_LIST: 'qrySessions',\n    REMOVE_CONVERSATION_LIST: 'delSessions',\n    DELETE_MESSAGES: 'delMsg',\n    CLEAR_UNREAD_COUNT: 'updRRTime',\n    PULL_USER_SETTING: 'pullUS',\n    PULL_CHRM_MSG: 'chrmPull',\n    JOIN_CHATROOM: 'joinChrm',\n    JOIN_EXIST_CHATROOM: 'joinChrmR',\n    QUIT_CHATROOM: 'exitChrm',\n    GET_CHATROOM_INFO: 'queryChrmI',\n    UPDATE_CHATROOM_KV: 'setKV',\n    DELETE_CHATROOM_KV: 'delKV',\n    PULL_CHATROOM_KV: 'pullKV',\n    GET_OLD_CONVERSATION_LIST: 'qryRelationR',\n    REMOVE_OLD_CONVERSATION: 'delRelation',\n    GET_CONVERSATION_STATUS: 'pullSeAtts',\n    SET_CONVERSATION_STATUS: 'setSeAtt',\n    GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n    GET_UPLOAD_FILE_URL: 'qnUrl',\n    CLEAR_MESSAGES: {\n      PRIVATE: 'cleanPMsg',\n      GROUP: 'cleanGMsg',\n      CUSTOMER_SERVICE: 'cleanCMsg',\n      SYSTEM: 'cleanSMsg'\n    },\n    JOIN_RTC_ROOM: 'rtcRJoin_data',\n    QUIT_RTC_ROOM: 'rtcRExit',\n    PING_RTC: 'rtcPing',\n    SET_RTC_DATA: 'rtcSetData',\n    USER_SET_RTC_DATA: 'userSetData',\n    GET_RTC_DATA: 'rtcQryData',\n    DEL_RTC_DATA: 'rtcDelData',\n    SET_RTC_OUT_DATA: 'rtcSetOutData',\n    GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n    GET_RTC_TOKEN: 'rtcToken',\n    SET_RTC_STATE: 'rtcUserState',\n    GET_RTC_ROOM_INFO: 'rtcRInfo',\n    GET_RTC_USER_INFO_LIST: 'rtcUData',\n    SET_RTC_USER_INFO: 'rtcUPut',\n    DEL_RTC_USER_INFO: 'rtcUDel',\n    GET_RTC_USER_LIST: 'rtcUList'\n  };\n  var QueryHistoryTopic = {\n    PRIVATE: 'qryPMsg',\n    GROUP: 'qryGMsg',\n    CHATROOM: 'qryCHMsg',\n    CUSTOMER_SERVICE: 'qryCMsg',\n    SYSTEM: 'qrySMsg'\n  };\n  var PublishTopicToConversationType = (_PublishTopicToConver = {}, _defineProperty(_PublishTopicToConver, PublishTopic.PRIVATE, ConversationType$1.PRIVATE), _defineProperty(_PublishTopicToConver, PublishTopic.GROUP, ConversationType$1.GROUP), _defineProperty(_PublishTopicToConver, PublishTopic.CHATROOM, ConversationType$1.CHATROOM), _defineProperty(_PublishTopicToConver, PublishTopic.CUSTOMER_SERVICE, ConversationType$1.CUSTOMER_SERVICE), _PublishTopicToConver);\n  var ConversationTypeToQueryHistoryTopic = (_ConversationTypeToQu = {}, _defineProperty(_ConversationTypeToQu, ConversationType$1.PRIVATE, QueryHistoryTopic.PRIVATE), _defineProperty(_ConversationTypeToQu, ConversationType$1.GROUP, QueryHistoryTopic.GROUP), _defineProperty(_ConversationTypeToQu, ConversationType$1.CHATROOM, QueryHistoryTopic.CHATROOM), _defineProperty(_ConversationTypeToQu, ConversationType$1.CUSTOMER_SERVICE, QueryHistoryTopic.CUSTOMER_SERVICE), _defineProperty(_ConversationTypeToQu, ConversationType$1.SYSTEM, QueryHistoryTopic.SYSTEM), _ConversationTypeToQu);\n  var ConversationTypeToClearMessageTopic = (_ConversationTypeToCl = {}, _defineProperty(_ConversationTypeToCl, ConversationType$1.PRIVATE, QueryTopic.CLEAR_MESSAGES.PRIVATE), _defineProperty(_ConversationTypeToCl, ConversationType$1.GROUP, QueryTopic.CLEAR_MESSAGES.GROUP), _defineProperty(_ConversationTypeToCl, ConversationType$1.CUSTOMER_SERVICE, QueryTopic.CLEAR_MESSAGES.CUSTOMER_SERVICE), _defineProperty(_ConversationTypeToCl, ConversationType$1.SYSTEM, QueryTopic.CLEAR_MESSAGES.SYSTEM), _ConversationTypeToCl);\n  var ConversationStatusConfig = {\n    ENABLED: '1',\n    DISABLED: '0'\n  };\n  var ConversationStatusType = {\n    DO_NOT_DISTURB: 1,\n    TOP: 2\n  };\n  var MessageDirection;\n\n  (function (MessageDirection) {\n    MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n    MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n  })(MessageDirection || (MessageDirection = {}));\n\n  var MessageDirection$1 = MessageDirection;\n\n  var DataCodec = function () {\n    function DataCodec(connectType) {\n      _classCallCheck(this, DataCodec);\n\n      this._codec = connectType === 'websocket' ? Codec$1 : Codec;\n      this._connectType = connectType;\n    }\n\n    _createClass(DataCodec, [{\n      key: \"decodeByPBName\",\n      value: function decodeByPBName(data, pbName, option) {\n        var _formatEventMap;\n\n        var self = this;\n        var formatEventMap = (_formatEventMap = {}, _defineProperty(_formatEventMap, PBName.DownStreamMessages, self._formatSyncMessages), _defineProperty(_formatEventMap, PBName.DownStreamMessage, self._formatReceivedMessage), _defineProperty(_formatEventMap, PBName.UpStreamMessage, self._formatSentMessage), _defineProperty(_formatEventMap, PBName.HistoryMsgOuput, self._formatHistoryMessages), _defineProperty(_formatEventMap, PBName.RelationsOutput, self._formatConversationList), _defineProperty(_formatEventMap, PBName.QueryChatRoomInfoOutput, self._formatChatRoomInfos), _defineProperty(_formatEventMap, PBName.RtcUserListOutput, self._formatRTCUserList), _defineProperty(_formatEventMap, PBName.RtcQryOutput, self._formatRTCData), _defineProperty(_formatEventMap, PBName.ChrmKVOutput, self._formatChatRoomKVList), _defineProperty(_formatEventMap, PBName.PullUserSettingOutput, self._formatUserSetting), _defineProperty(_formatEventMap, PBName.SessionStates, self._formatConversationStatus), _formatEventMap);\n        var decodedData = data;\n        var formatEvent = formatEventMap[pbName];\n\n        try {\n          var hasData = data.length > 0;\n          decodedData = hasData && self._codec[pbName].decode(data);\n\n          if (isObject(decodedData)) {\n            decodedData = batchInt64ToTimestamp(decodedData);\n          }\n\n          if (isFunction(formatEvent)) {\n            decodedData = formatEvent.call(this, decodedData, option);\n          }\n        } catch (e) {\n          logger.error('PB parse error\\n', e);\n        }\n\n        return decodedData;\n      }\n    }, {\n      key: \"_readBytes\",\n      value: function _readBytes(content) {\n        var offset = content.offset,\n            buffer = content.buffer,\n            limit = content.limit;\n\n        if (offset) {\n          try {\n            var _content = isArrayBuffer(buffer) ? new Uint8Array(buffer) : buffer;\n\n            return BinaryHelper.readUTF(_content.subarray(offset, limit));\n          } catch (e) {\n            logger.info('readBytes error\\n', e);\n          }\n        }\n\n        return content;\n      }\n    }, {\n      key: \"_formatBytes\",\n      value: function _formatBytes(content) {\n        var formatRes = this._readBytes(content);\n\n        try {\n          formatRes = JSON.parse(formatRes);\n        } catch (e) {\n          logger.info('formatBytes error\\n', e);\n        }\n\n        return formatRes || content;\n      }\n    }, {\n      key: \"_formatSyncMessages\",\n      value: function _formatSyncMessages(data, option) {\n        var _this12 = this;\n\n        option = option || {};\n        var self = this;\n        var list = data.list,\n            syncTime = data.syncTime,\n            finished = data.finished;\n\n        if (isUndefined(finished) || finished === null) {\n          data.finished = true;\n        }\n\n        data.syncTime = int64ToTimestamp(syncTime);\n        data.list = map(list, function (msgData) {\n          _newArrowCheck(this, _this12);\n\n          var message = self._formatReceivedMessage(msgData, option);\n\n          return message;\n        }.bind(this));\n        return data;\n      }\n    }, {\n      key: \"_formatReceivedMessage\",\n      value: function _formatReceivedMessage(data, option) {\n        option = option || {};\n        var self = this;\n        var _option = option,\n            currentUserId = _option.currentUserId,\n            connectedTime = _option.connectedTime;\n        var content = data.content,\n            fromUserId = data.fromUserId,\n            type = data.type,\n            groupId = data.groupId,\n            status = data.status,\n            dataTime = data.dataTime,\n            messageType = data.classname,\n            messageUId = data.msgId,\n            extraContent = data.extraContent;\n        var direction = data.direction || MessageDirection$1.RECEIVE;\n        var isSelfSend = direction === MessageDirection$1.SEND;\n\n        var _getMessageOptionBySt = getMessageOptionByStatus(status),\n            isPersited = _getMessageOptionBySt.isPersited,\n            isCounted = _getMessageOptionBySt.isCounted,\n            isMentioned = _getMessageOptionBySt.isMentioned,\n            disableNotification = _getMessageOptionBySt.disableNotification,\n            receivedStatus = _getMessageOptionBySt.receivedStatus,\n            canIncludeExpansion = _getMessageOptionBySt.canIncludeExpansion;\n\n        var targetId = type === ConversationType$1.GROUP || type === ConversationType$1.CHATROOM ? groupId : fromUserId;\n        var senderUserId = isSelfSend ? currentUserId : fromUserId;\n        var sentTime = int64ToTimestamp(dataTime);\n        var isOffLineMessage = sentTime < connectedTime;\n        var isChatRoomMsg = type === ConversationType$1.CHATROOM;\n\n        var utfContent = self._formatBytes(content);\n\n        var messageDirection = isSelfSend ? MessageDirection$1.SEND : MessageDirection$1.RECEIVE;\n\n        if (isChatRoomMsg && fromUserId === currentUserId) {\n          messageDirection = MessageDirection$1.SEND;\n        }\n\n        var expansion;\n\n        if (extraContent) {\n          expansion = {};\n          expansion = formatExtraContent(extraContent);\n        }\n\n        return {\n          conversationType: type,\n          targetId: targetId,\n          senderUserId: senderUserId,\n          messageType: messageType,\n          messageUId: messageUId,\n          isPersited: isPersited,\n          isCounted: isCounted,\n          isMentioned: isMentioned,\n          sentTime: sentTime,\n          isOffLineMessage: isOffLineMessage,\n          messageDirection: messageDirection,\n          receivedTime: DelayTimer.getTime(),\n          disableNotification: disableNotification,\n          receivedStatus: receivedStatus,\n          canIncludeExpansion: canIncludeExpansion,\n          content: utfContent,\n          expansion: expansion\n        };\n      }\n    }, {\n      key: \"_formatSentMessage\",\n      value: function _formatSentMessage(data, option) {\n        var self = this;\n        var content = data.content,\n            messageType = data.classname,\n            sessionId = data.sessionId,\n            messageUId = data.msgId,\n            extraContent = data.extraContent;\n        var signal = option.signal,\n            currentUserId = option.currentUserId;\n        var date = signal.date,\n            topic = signal.topic,\n            targetId = signal.targetId;\n\n        var _getUpMessageOptionBy = getUpMessageOptionBySessionId(sessionId),\n            isPersited = _getUpMessageOptionBy.isPersited,\n            isCounted = _getUpMessageOptionBy.isCounted,\n            disableNotification = _getUpMessageOptionBy.disableNotification,\n            canIncludeExpansion = _getUpMessageOptionBy.canIncludeExpansion;\n\n        var type = PublishTopicToConversationType[topic] || ConversationType$1.PRIVATE;\n        var isStatusMessage = isInObject(PublishStatusTopic, topic);\n        var expansion;\n\n        if (extraContent) {\n          expansion = {};\n          expansion = formatExtraContent(extraContent);\n        }\n\n        return {\n          conversationType: type,\n          targetId: targetId,\n          messageType: messageType,\n          messageUId: messageUId,\n          isPersited: isPersited,\n          isCounted: isCounted,\n          isStatusMessage: isStatusMessage,\n          senderUserId: currentUserId,\n          content: self._formatBytes(content),\n          sentTime: date * 1000,\n          receivedTime: DelayTimer.getTime(),\n          messageDirection: MessageDirection$1.SEND,\n          isOffLineMessage: false,\n          disableNotification: disableNotification,\n          canIncludeExpansion: canIncludeExpansion,\n          expansion: expansion\n        };\n      }\n    }, {\n      key: \"_formatHistoryMessages\",\n      value: function _formatHistoryMessages(data, option) {\n        var _this13 = this;\n\n        var conversation = option.conversation || {};\n        var msgList = data.list,\n            hasMsg = data.hasMsg;\n        var targetId = conversation.targetId;\n        var syncTime = int64ToTimestamp(data.syncTime);\n        var list = [];\n        forEach(msgList, function (msgData) {\n          _newArrowCheck(this, _this13);\n\n          var msg = this._formatReceivedMessage(msgData, option);\n\n          msg.targetId = targetId;\n          list.push(msg);\n        }.bind(this), {\n          isReverse: true\n        });\n        return {\n          syncTime: syncTime,\n          list: list,\n          hasMore: !!hasMsg\n        };\n      }\n    }, {\n      key: \"_formatConversationList\",\n      value: function _formatConversationList(serverData, option) {\n        var _this14 = this;\n\n        var self = this;\n        var conversationList = serverData.info;\n\n        var afterDecode = option.afterDecode || function () {};\n\n        conversationList = map(conversationList, function (serverConversation) {\n          _newArrowCheck(this, _this14);\n\n          var msg = serverConversation.msg,\n              userId = serverConversation.userId,\n              type = serverConversation.type,\n              unreadCount = serverConversation.unreadCount;\n\n          var latestMessage = self._formatReceivedMessage(msg, option);\n\n          latestMessage.targetId = userId;\n          var conversation = {\n            targetId: userId,\n            conversationType: type,\n            unreadMessageCount: unreadCount,\n            latestMessage: latestMessage\n          };\n          return afterDecode(conversation) || conversation;\n        }.bind(this));\n        return conversationList || [];\n      }\n    }, {\n      key: \"_formatChatRoomInfos\",\n      value: function _formatChatRoomInfos(data) {\n        var _this15 = this;\n\n        var userTotalNums = data.userTotalNums,\n            userInfos = data.userInfos;\n        var chrmInfos = map(userInfos, function (user) {\n          _newArrowCheck(this, _this15);\n\n          var id = user.id,\n              time = user.time;\n          var timestamp = int64ToTimestamp(time);\n          return {\n            id: id,\n            time: timestamp\n          };\n        }.bind(this));\n        return {\n          userCount: userTotalNums,\n          userInfos: chrmInfos\n        };\n      }\n    }, {\n      key: \"_formatChatRoomKVList\",\n      value: function _formatChatRoomKVList(data) {\n        var _this16 = this;\n\n        var kvEntries = data.entries,\n            isFullUpdate = data.bFullUpdate,\n            syncTime = data.syncTime;\n        kvEntries = kvEntries || [];\n        kvEntries = map(kvEntries, function (kv) {\n          _newArrowCheck(this, _this16);\n\n          var key = kv.key,\n              value = kv.value,\n              status = kv.status,\n              timestamp = kv.timestamp,\n              uid = kv.uid;\n\n          var _getChatRoomKVByStatu = getChatRoomKVByStatus(status),\n              isAutoDelete = _getChatRoomKVByStatu.isAutoDelete,\n              isOverwrite = _getChatRoomKVByStatu.isOverwrite,\n              type = _getChatRoomKVByStatu.type;\n\n          return {\n            key: key,\n            value: value,\n            isAutoDelete: isAutoDelete,\n            isOverwrite: isOverwrite,\n            type: type,\n            userId: uid,\n            timestamp: int64ToTimestamp(timestamp)\n          };\n        }.bind(this));\n        return {\n          kvEntries: kvEntries,\n          isFullUpdate: isFullUpdate,\n          syncTime: syncTime\n        };\n      }\n    }, {\n      key: \"_formatUserSetting\",\n      value: function _formatUserSetting(data) {\n        var _this17 = this;\n\n        var items = data.items,\n            version = data.version;\n        var settings = {};\n        forEach(items || [], function (setting) {\n          _newArrowCheck(this, _this17);\n\n          var key = setting.key,\n              version = setting.version,\n              value = setting.value;\n          setting.version = int64ToTimestamp(version);\n          setting.value = this._readBytes(value);\n          settings[key] = setting;\n        }.bind(this));\n        return {\n          settings: settings,\n          version: version\n        };\n      }\n    }, {\n      key: \"_formatConversationStatus\",\n      value: function _formatConversationStatus(data) {\n        var _this18 = this;\n\n        var stateList = data.state;\n        var statusList = [];\n        forEach(stateList, function (session) {\n          var _this19 = this;\n\n          _newArrowCheck(this, _this18);\n\n          var type = session.type,\n              targetId = session.channelId,\n              updatedTime = session.time,\n              stateItem = session.stateItem;\n          var notificationStatus = NotificationStatus$1.CLOSE;\n          var isTop = false;\n          forEach(stateItem, function (item) {\n            _newArrowCheck(this, _this19);\n\n            var sessionStateType = item.sessionStateType,\n                value = item.value;\n\n            switch (sessionStateType) {\n              case ConversationStatusType.DO_NOT_DISTURB:\n                notificationStatus = value === ConversationStatusConfig.ENABLED ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE;\n                break;\n\n              case ConversationStatusType.TOP:\n                isTop = value === ConversationStatusConfig.ENABLED;\n                break;\n            }\n          }.bind(this));\n          statusList.push({\n            type: type,\n            targetId: targetId,\n            notificationStatus: notificationStatus,\n            isTop: isTop,\n            updatedTime: int64ToTimestamp(updatedTime)\n          });\n        }.bind(this));\n        return statusList;\n      }\n    }, {\n      key: \"_formatRTCUserList\",\n      value: function _formatRTCUserList(rtcInfos) {\n        var _this20 = this;\n\n        var list = rtcInfos.list,\n            token = rtcInfos.token,\n            sessionId = rtcInfos.sessionId;\n        var users = {};\n        forEach(list, function (item) {\n          var _this21 = this;\n\n          _newArrowCheck(this, _this20);\n\n          var userId = item.userId,\n              userData = item.userData;\n          var tmpData = {};\n          forEach(userData, function (data) {\n            _newArrowCheck(this, _this21);\n\n            var key = data.key,\n                value = data.value;\n            tmpData[key] = value;\n          }.bind(this));\n          users[userId] = tmpData;\n        }.bind(this));\n        return {\n          users: users,\n          token: token,\n          sessionId: sessionId\n        };\n      }\n    }, {\n      key: \"_formatRTCData\",\n      value: function _formatRTCData(data) {\n        var _this22 = this;\n\n        var list = data.outInfo;\n        var props = {};\n        forEach(list, function (item) {\n          _newArrowCheck(this, _this22);\n\n          props[item.key] = item.value;\n        }.bind(this));\n        return props;\n      }\n    }, {\n      key: \"_formatRTCRoomInfo\",\n      value: function _formatRTCRoomInfo(data) {\n        var _this23 = this;\n\n        var id = data.roomId,\n            total = data.userCount,\n            roomData = data.roomData;\n        var room = {\n          id: id,\n          total: total\n        };\n        forEach(roomData, function (data) {\n          _newArrowCheck(this, _this23);\n\n          room[data.key] = data.value;\n        }.bind(this));\n        return room;\n      }\n    }, {\n      key: \"encodeServerConfParams\",\n      value: function encodeServerConfParams() {\n        var modules = this._codec.getModule(PBName.SessionsAttQryInput);\n\n        modules.setNothing(1);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"_getUpMsgModule\",\n      value: function _getUpMsgModule(conversation, option) {\n        var _this24 = this;\n\n        var type = conversation.type;\n        var messageType = option.messageType,\n            isMentioned = option.isMentioned,\n            mentionedType = option.mentionedType,\n            mentionedUserIdList = option.mentionedUserIdList,\n            content = option.content,\n            pushContent = option.pushContent,\n            pushData = option.pushData,\n            directionalUserIdList = option.directionalUserIdList,\n            isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n            isVoipPush = option.isVoipPush,\n            canIncludeExpansion = option.canIncludeExpansion,\n            expansion = option.expansion;\n        var isGroupType = type === ConversationType$1.GROUP;\n\n        var modules = this._codec.getModule(PBName.UpStreamMessage);\n\n        var sessionId = getSessionId(option);\n        var flag = 0;\n        modules.setSessionId(sessionId);\n\n        if (isGroupType && isMentioned && content) {\n          content.mentionedInfo = {\n            userIdList: mentionedUserIdList,\n            type: mentionedType || MentionedType$1.ALL\n          };\n        }\n\n        pushContent && modules.setPushText(pushContent);\n        pushData && modules.setAppData(pushData);\n        directionalUserIdList && modules.setUserId(directionalUserIdList);\n        flag |= isVoipPush ? 0x01 : 0;\n        flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n        modules.setConfigFlag(flag);\n        modules.setClassname(messageType);\n        modules.setContent(JSON.stringify(content));\n\n        if (canIncludeExpansion && expansion) {\n          var extraContent = {};\n          forEach(expansion, function (val, key) {\n            _newArrowCheck(this, _this24);\n\n            extraContent[key] = {\n              v: val\n            };\n          }.bind(this));\n          modules.setExtraContent(JSON.stringify(extraContent));\n        }\n\n        return modules;\n      }\n    }, {\n      key: \"encodeUpMsg\",\n      value: function encodeUpMsg(conversation, option) {\n        var modules = this._getUpMsgModule(conversation, option);\n\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeSyncMsg\",\n      value: function encodeSyncMsg(syncMsgArgs) {\n        var sendboxTime = syncMsgArgs.sendboxTime,\n            inboxTime = syncMsgArgs.inboxTime;\n\n        var modules = this._codec.getModule(PBName.SyncRequestMsg);\n\n        modules.setIspolling(false);\n        modules.setIsPullSend(true);\n        modules.setSendBoxSyncTime(sendboxTime);\n        modules.setSyncTime(inboxTime);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeChrmSyncMsg\",\n      value: function encodeChrmSyncMsg(time, count) {\n        time = time || 0;\n        count = count || 0;\n\n        var modules = this._codec.getModule(PBName.ChrmPullMsg);\n\n        modules.setCount(count);\n        modules.setSyncTime(time);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetHistoryMsg\",\n      value: function encodeGetHistoryMsg(targetId, option) {\n        var count = option.count,\n            order = option.order,\n            timestamp = option.timestamp;\n\n        var modules = this._codec.getModule(PBName.HistoryMsgInput);\n\n        modules.setTargetId(targetId);\n        modules.setTime(timestamp);\n        modules.setCount(count);\n        modules.setOrder(order);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetConversationList\",\n      value: function encodeGetConversationList(option) {\n        option = option || {};\n        var _option2 = option,\n            count = _option2.count,\n            startTime = _option2.startTime;\n\n        var modules = this._codec.getModule(PBName.RelationQryInput);\n\n        modules.setType(1);\n        modules.setCount(count);\n        modules.setStartTime(startTime);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeOldConversationList\",\n      value: function encodeOldConversationList(option) {\n        option = option || {};\n        var _option3 = option,\n            count = _option3.count,\n            type = _option3.type,\n            startTime = _option3.startTime,\n            order = _option3.order;\n        count = count || 0;\n        startTime = startTime || 0;\n        order = order || 0;\n\n        var modules = this._codec.getModule(PBName.RelationQryInput);\n\n        modules.setType(type);\n        modules.setCount(count);\n        modules.setStartTime(startTime);\n        modules.setOrder(order);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeRemoveConversationList\",\n      value: function encodeRemoveConversationList(conversationList) {\n        var _this25 = this;\n\n        var modules = this._codec.getModule(PBName.DeleteSessionsInput);\n\n        var sessions = [];\n        forEach(conversationList, function (conversation) {\n          _newArrowCheck(this, _this25);\n\n          var type = conversation.type,\n              targetId = conversation.targetId;\n\n          var session = this._codec.getModule(PBName.SessionInfo);\n\n          session.setType(type);\n          session.setChannelId(targetId);\n          sessions.push(session);\n        }.bind(this));\n        modules.setSessions(sessions);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeDeleteMessages\",\n      value: function encodeDeleteMessages(conversationType, targetId, list) {\n        var _this26 = this;\n\n        var modules = this._codec.getModule(PBName.DeleteMsgInput);\n\n        var encodeMsgs = [];\n        forEach(list, function (message) {\n          _newArrowCheck(this, _this26);\n\n          encodeMsgs.push({\n            msgId: message.messageUId,\n            msgDataTime: message.sentTime,\n            direct: message.messageDirection\n          });\n        }.bind(this));\n        modules.setType(conversationType);\n        modules.setConversationId(targetId);\n        modules.setMsgs(encodeMsgs);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeClearMessages\",\n      value: function encodeClearMessages(targetId, timestamp) {\n        var modules = this._codec.getModule(PBName.CleanHisMsgInput);\n\n        timestamp = timestamp || new Date().getTime();\n        modules.setDataTime(timestamp);\n        modules.setTargetId(targetId);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeClearUnreadCount\",\n      value: function encodeClearUnreadCount(conversation, option) {\n        var type = conversation.type,\n            targetId = conversation.targetId;\n        var timestamp = option.timestamp;\n\n        var modules = this._codec.getModule(PBName.SessionMsgReadInput);\n\n        timestamp = timestamp || +new Date();\n        modules.setType(type);\n        modules.setChannelId(targetId);\n        modules.setMsgTime(timestamp);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeJoinOrQuitChatRoom\",\n      value: function encodeJoinOrQuitChatRoom() {\n        var modules = this._codec.getModule(PBName.ChrmInput);\n\n        modules.setNothing(1);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetChatRoomInfo\",\n      value: function encodeGetChatRoomInfo(count, order) {\n        var modules = this._codec.getModule(PBName.QueryChatRoomInfoInput);\n\n        modules.setCount(count);\n        modules.setOrder(order);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetFileToken\",\n      value: function encodeGetFileToken(fileType, fileName) {\n        var modules = this._codec.getModule(PBName.GetQNupTokenInput);\n\n        modules.setType(fileType);\n        modules.setKey(fileName);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetFileUrl\",\n      value: function encodeGetFileUrl(inputPBName, fileType, fileName, originName) {\n        var modules = this._codec.getModule(inputPBName);\n\n        modules.setType(fileType);\n        modules.setKey(fileName);\n\n        if (originName) {\n          modules.setFileName(originName);\n        }\n\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeModifyChatRoomKV\",\n      value: function encodeModifyChatRoomKV(chrmId, entry, currentUserId) {\n        var isComet = this._connectType === 'comet';\n\n        var modules = this._codec.getModule(PBName.SetChrmKV);\n\n        var key = entry.key,\n            value = entry.value,\n            extra = entry.notificationExtra,\n            isSendNotification = entry.isSendNotification,\n            type = entry.type;\n        var action = type || ChatroomEntryType$1.UPDATE;\n        var status = getChatRoomKVOptStatus(entry, action);\n        var serverEntry = {\n          key: key,\n          value: value || '',\n          uid: currentUserId\n        };\n\n        if (!isUndefined(status)) {\n          serverEntry.status = status;\n        }\n\n        modules.setEntry(serverEntry);\n\n        if (isSendNotification) {\n          var conversation = {\n            type: ConversationType$1.CHATROOM,\n            targetId: chrmId\n          };\n          var msgContent = {\n            key: key,\n            value: value,\n            extra: extra,\n            type: action\n          };\n\n          var msgModule = this._getUpMsgModule(conversation, {\n            messageType: MessageType$1.CHRM_KV_NOTIFY,\n            content: msgContent,\n            isPersited: false,\n            isCounted: false\n          });\n\n          isComet ? modules.setNotification(msgModule.getArrayData()) : modules.setNotification(msgModule);\n          modules.setBNotify(true);\n          modules.setType(ConversationType$1.CHATROOM);\n        }\n\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodePullChatRoomKV\",\n      value: function encodePullChatRoomKV(time) {\n        var modules = this._codec.getModule(PBName.QueryChrmKV);\n\n        modules.setTimestamp(time);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodePullUserSetting\",\n      value: function encodePullUserSetting(version) {\n        var modules = this._codec.getModule(PBName.PullUserSettingInput);\n\n        modules.setVersion(version);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetConversationStatus\",\n      value: function encodeGetConversationStatus(time) {\n        var modules = this._codec.getModule(PBName.SessionReq);\n\n        modules.setTime(time);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeSetConversationStatus\",\n      value: function encodeSetConversationStatus(statusList) {\n        var _this27 = this;\n\n        var isComet = this._connectType === 'comet';\n\n        var modules = this._codec.getModule(PBName.SessionStateModifyReq);\n\n        var currentTime = DelayTimer.getTime();\n        var stateModuleList = [];\n        forEach(statusList, function (status) {\n          var _this28 = this;\n\n          _newArrowCheck(this, _this27);\n\n          var stateModules = this._codec.getModule(PBName.SessionState);\n\n          var type = status.conversationType,\n              targetId = status.targetId,\n              notificationStatus = status.notificationStatus,\n              isTop = status.isTop;\n          var stateItemModuleList = [];\n          stateModules.setType(type);\n          stateModules.setChannelId(targetId);\n          stateModules.setTime(currentTime);\n          var isNotDisturb = notificationStatus === NotificationStatus$1.OPEN;\n          var TypeToVal = {};\n\n          if (!isUndefined(notificationStatus)) {\n            TypeToVal[ConversationStatusType.DO_NOT_DISTURB] = isNotDisturb;\n          }\n\n          if (!isUndefined(isTop)) {\n            TypeToVal[ConversationStatusType.TOP] = isTop;\n          }\n\n          forEach(TypeToVal, function (val, type) {\n            _newArrowCheck(this, _this28);\n\n            if (!isUndefined(val)) {\n              var stateItemModules = this._codec.getModule(PBName.SessionStateItem);\n\n              val = val ? ConversationStatusConfig.ENABLED : ConversationStatusConfig.DISABLED;\n              stateItemModules.setSessionStateType(Number(type));\n              stateItemModules.setValue(val);\n              var stateItemModulesData = isComet ? stateItemModules.getArrayData() : stateItemModules;\n              stateItemModuleList.push(stateItemModulesData);\n            }\n          }.bind(this));\n          stateModules.setStateItem(stateItemModuleList);\n          var stateModulesData = isComet ? stateModules.getArrayData() : stateModules;\n          stateModuleList.push(stateModulesData);\n        }.bind(this));\n        modules.setVersion(currentTime);\n        modules.setState(stateModuleList);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeJoinRTCRoom\",\n      value: function encodeJoinRTCRoom(mode, broadcastType) {\n        var modules = this._codec.getModule(PBName.RtcInput);\n\n        mode = mode || 0;\n        modules.setRoomType(mode);\n        isUndefined(broadcastType) || modules.setBroadcastType(broadcastType);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeQuitRTCRoom\",\n      value: function encodeQuitRTCRoom() {\n        return this._codec.getModule(PBName.SetUserStatusInput).getArrayData();\n      }\n    }, {\n      key: \"encodeSetRTCData\",\n      value: function encodeSetRTCData(key, value, isInner, apiType, message) {\n        var modules = this._codec.getModule(PBName.RtcSetDataInput);\n\n        modules.setInterior(isInner);\n        modules.setTarget(apiType);\n        modules.setKey(key);\n        modules.setValue(value);\n        message = message || {};\n        var _message = message,\n            name = _message.name,\n            content = _message.content;\n        !isUndefined(name) && modules.setObjectName(name);\n\n        if (!isUndefined(content)) {\n          if (isObject(content)) {\n            content = JSON.stringify(content);\n          }\n\n          modules.setContent(content);\n        }\n\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeUserSetRTCData\",\n      value: function encodeUserSetRTCData(message, valueInfo, objectName) {\n        var modules = this._codec.getModule(PBName.RtcUserSetDataInput);\n\n        modules.setObjectName(objectName);\n\n        var val = this._codec.getModule(PBName.RtcValueInfo);\n\n        val.setKey(message.name);\n        val.setValue(message.content);\n        modules.setContent(val);\n        val = this._codec.getModule(PBName.RtcValueInfo);\n        val.setKey('uris');\n        val.setValue(valueInfo);\n        modules.setValueInfo(val);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetRTCData\",\n      value: function encodeGetRTCData(keys, isInner, apiType) {\n        var modules = this._codec.getModule(PBName.RtcDataInput);\n\n        modules.setInterior(isInner);\n        modules.setTarget(apiType);\n        modules.setKey(keys);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeRemoveRTCData\",\n      value: function encodeRemoveRTCData(keys, isInner, apiType, message) {\n        var modules = this._codec.getModule(PBName.RtcDataInput);\n\n        modules.setInterior(isInner);\n        modules.setTarget(apiType);\n        modules.setKey(keys);\n        message = message || {};\n        var _message2 = message,\n            name = _message2.name,\n            content = _message2.content;\n        !isUndefined(name) && modules.setObjectName(name);\n\n        if (!isUndefined(content)) {\n          if (isObject(content)) {\n            content = JSON.stringify(content);\n          }\n\n          modules.setContent(content);\n        }\n\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeSetRTCOutData\",\n      value: function encodeSetRTCOutData(data, type, message) {\n        var _this29 = this;\n\n        var modules = this._codec.getModule(PBName.RtcSetOutDataInput);\n\n        modules.setTarget(type);\n\n        if (!isArray(data)) {\n          data = [data];\n        }\n\n        forEach(data, function (item, index) {\n          _newArrowCheck(this, _this29);\n\n          item.key = item.key ? item.key.toString() : item.key;\n          item.value = item.value ? item.value.toString() : item.value;\n          data[index] = item;\n        }.bind(this));\n        modules.setValueInfo(data);\n        message = message || {};\n        var _message3 = message,\n            name = _message3.name,\n            content = _message3.content;\n        !isUndefined(name) && modules.setObjectName(name);\n\n        if (!isUndefined(content)) {\n          if (isObject(content)) {\n            content = JSON.stringify(content);\n          }\n\n          modules.setContent(content);\n        }\n\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"ecnodeGetRTCOutData\",\n      value: function ecnodeGetRTCOutData(userIds) {\n        var modules = this._codec.getModule(PBName.RtcQryUserOutDataInput);\n\n        modules.setUserId(userIds);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeSetRTCState\",\n      value: function encodeSetRTCState(report) {\n        var modules = this._codec.getModule(PBName.MCFollowInput);\n\n        modules.setId(report);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeGetRTCRoomInfo\",\n      value: function encodeGetRTCRoomInfo() {\n        var modules = this._codec.getModule(PBName.RtcQueryListInput);\n\n        modules.setOrder(2);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeSetRTCUserInfo\",\n      value: function encodeSetRTCUserInfo(key, value) {\n        var modules = this._codec.getModule(PBName.RtcValueInfo);\n\n        modules.setKey(key);\n        modules.setValue(value);\n        return modules.getArrayData();\n      }\n    }, {\n      key: \"encodeRemoveRTCUserInfo\",\n      value: function encodeRemoveRTCUserInfo(keys) {\n        var modules = this._codec.getModule(PBName.RtcKeyDeleteInput);\n\n        modules.setKey(keys);\n        return modules.getArrayData();\n      }\n    }]);\n\n    return DataCodec;\n  }();\n\n  var ADataChannel = function ADataChannel(type, _watcher) {\n    _classCallCheck(this, ADataChannel);\n\n    this._watcher = _watcher;\n    this.codec = new DataCodec(type);\n  };\n\n  var _getIdentifier = function getIdentifier(messageId, identifier) {\n    _newArrowCheck(this, _this);\n\n    if (messageId && identifier) {\n      return identifier + '_' + messageId;\n    } else if (messageId) {\n      return messageId;\n    } else {\n      return Date.now();\n    }\n  }.bind(undefined);\n\n  var BaseReader = function () {\n    function BaseReader(header) {\n      _classCallCheck(this, BaseReader);\n\n      this.header = header;\n      this._name = null;\n      this.lengthSize = 0;\n      this.messageId = 0;\n      this.timestamp = 0;\n      this.syncMsg = false;\n      this.identifier = '';\n    }\n\n    _createClass(BaseReader, [{\n      key: \"getIdentifier\",\n      value: function getIdentifier() {\n        var messageId = this.messageId,\n            identifier = this.identifier;\n        return _getIdentifier(messageId, identifier);\n      }\n    }, {\n      key: \"read\",\n      value: function read(stream, length) {\n        this.readMessage(stream, length);\n      }\n    }, {\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return BaseReader;\n  }();\n\n  var BaseWriter = function () {\n    function BaseWriter(headerType) {\n      _classCallCheck(this, BaseWriter);\n\n      this.lengthSize = 0;\n      this.messageId = 0;\n      this.topic = '';\n      this.targetId = '';\n      this.identifier = '';\n      this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n    }\n\n    _createClass(BaseWriter, [{\n      key: \"getIdentifier\",\n      value: function getIdentifier() {\n        var messageId = this.messageId,\n            identifier = this.identifier;\n        return _getIdentifier(messageId, identifier);\n      }\n    }, {\n      key: \"write\",\n      value: function write(stream) {\n        var headerCode = this.getHeaderFlag();\n        stream.write(headerCode);\n        this.writeMessage(stream);\n      }\n    }, {\n      key: \"setHeaderQos\",\n      value: function setHeaderQos(qos) {\n        this._header.qos = qos;\n      }\n    }, {\n      key: \"getHeaderFlag\",\n      value: function getHeaderFlag() {\n        return this._header.encode();\n      }\n    }, {\n      key: \"getLengthSize\",\n      value: function getLengthSize() {\n        return this.lengthSize;\n      }\n    }, {\n      key: \"getBufferData\",\n      value: function getBufferData() {\n        var stream = new RongStreamWriter();\n        this.write(stream);\n        var val = stream.getBytesArray();\n        var binary = new Int8Array(val);\n        return binary;\n      }\n    }, {\n      key: \"getCometData\",\n      value: function getCometData() {\n        var data = this.data || {};\n        return JSON.stringify(data);\n      }\n    }]);\n\n    return BaseWriter;\n  }();\n\n  var ConnAckReader = function (_BaseReader) {\n    _inherits(ConnAckReader, _BaseReader);\n\n    var _super3 = _createSuper(ConnAckReader);\n\n    function ConnAckReader() {\n      var _this30;\n\n      _classCallCheck(this, ConnAckReader);\n\n      _this30 = _super3.apply(this, arguments);\n      _this30._name = MessageName.CONN_ACK;\n      _this30.status = null;\n      _this30.userId = null;\n      _this30.timestamp = 0;\n      return _this30;\n    }\n\n    _createClass(ConnAckReader, [{\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        stream.readByte();\n        this.status = +stream.readByte();\n\n        if (length > ConnAckReader.MESSAGE_LENGTH) {\n          this.userId = stream.readUTF();\n          stream.readUTF();\n          this.timestamp = stream.readLong();\n        }\n\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return ConnAckReader;\n  }(BaseReader);\n\n  ConnAckReader.MESSAGE_LENGTH = 2;\n\n  var DisconnectReader = function (_BaseReader2) {\n    _inherits(DisconnectReader, _BaseReader2);\n\n    var _super4 = _createSuper(DisconnectReader);\n\n    function DisconnectReader() {\n      var _this31;\n\n      _classCallCheck(this, DisconnectReader);\n\n      _this31 = _super4.apply(this, arguments);\n      _this31._name = MessageName.DISCONNECT;\n      _this31.status = 0;\n      return _this31;\n    }\n\n    _createClass(DisconnectReader, [{\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        stream.readByte();\n        this.status = +stream.readByte();\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return DisconnectReader;\n  }(BaseReader);\n\n  DisconnectReader.MESSAGE_LENGTH = 2;\n\n  var PingReqWriter = function (_BaseWriter) {\n    _inherits(PingReqWriter, _BaseWriter);\n\n    var _super5 = _createSuper(PingReqWriter);\n\n    function PingReqWriter() {\n      var _this32;\n\n      _classCallCheck(this, PingReqWriter);\n\n      _this32 = _super5.call(this, OperationType.PING_REQ);\n      _this32._name = MessageName.PING_REQ;\n      return _this32;\n    }\n\n    _createClass(PingReqWriter, [{\n      key: \"writeMessage\",\n      value: function writeMessage(stream) {}\n    }]);\n\n    return PingReqWriter;\n  }(BaseWriter);\n\n  var PingRespReader = function (_BaseReader3) {\n    _inherits(PingRespReader, _BaseReader3);\n\n    var _super6 = _createSuper(PingRespReader);\n\n    function PingRespReader(header) {\n      var _this33;\n\n      _classCallCheck(this, PingRespReader);\n\n      _this33 = _super6.call(this, header);\n      _this33._name = MessageName.PING_RESP;\n      return _this33;\n    }\n\n    return PingRespReader;\n  }(BaseReader);\n\n  var RetryableReader = function (_BaseReader4) {\n    _inherits(RetryableReader, _BaseReader4);\n\n    var _super7 = _createSuper(RetryableReader);\n\n    function RetryableReader() {\n      var _this34;\n\n      _classCallCheck(this, RetryableReader);\n\n      _this34 = _super7.apply(this, arguments);\n      _this34.messageId = 0;\n      return _this34;\n    }\n\n    _createClass(RetryableReader, [{\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        var msgId = stream.readByte() * 256 + stream.readByte();\n        this.messageId = parseInt(msgId.toString(), 10);\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return RetryableReader;\n  }(BaseReader);\n\n  var RetryableWriter = function (_BaseWriter2) {\n    _inherits(RetryableWriter, _BaseWriter2);\n\n    var _super8 = _createSuper(RetryableWriter);\n\n    function RetryableWriter() {\n      var _this35;\n\n      _classCallCheck(this, RetryableWriter);\n\n      _this35 = _super8.apply(this, arguments);\n      _this35.messageId = 0;\n      return _this35;\n    }\n\n    _createClass(RetryableWriter, [{\n      key: \"writeMessage\",\n      value: function writeMessage(stream) {\n        var id = this.messageId;\n        var lsb = id & 255;\n        var msb = (id & 65280) >> 8;\n        stream.write(msb);\n        stream.write(lsb);\n      }\n    }]);\n\n    return RetryableWriter;\n  }(BaseWriter);\n\n  var PublishReader = function (_RetryableReader) {\n    _inherits(PublishReader, _RetryableReader);\n\n    var _super9 = _createSuper(PublishReader);\n\n    function PublishReader() {\n      var _this36;\n\n      _classCallCheck(this, PublishReader);\n\n      _this36 = _super9.apply(this, arguments);\n      _this36._name = MessageName.PUBLISH;\n      _this36.topic = '';\n      _this36.targetId = '';\n      _this36.syncMsg = false;\n      _this36.identifier = IDENTIFIER.PUB;\n      return _this36;\n    }\n\n    _createClass(PublishReader, [{\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        this.date = stream.readInt();\n        this.topic = stream.readUTF();\n        this.targetId = stream.readUTF();\n\n        _get(_getPrototypeOf(PublishReader.prototype), \"readMessage\", this).call(this, stream, length);\n\n        this.data = stream.readAll();\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return PublishReader;\n  }(RetryableReader);\n\n  var PublishWriter = function (_RetryableWriter) {\n    _inherits(PublishWriter, _RetryableWriter);\n\n    var _super10 = _createSuper(PublishWriter);\n\n    function PublishWriter(topic, data, targetId) {\n      var _this37;\n\n      _classCallCheck(this, PublishWriter);\n\n      _this37 = _super10.call(this, OperationType.PUBLISH);\n      _this37._name = MessageName.PUBLISH;\n      _this37.syncMsg = false;\n      _this37.identifier = IDENTIFIER.PUB;\n      _this37.topic = topic;\n      _this37.data = isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this37.targetId = targetId;\n      return _this37;\n    }\n\n    _createClass(PublishWriter, [{\n      key: \"writeMessage\",\n      value: function writeMessage(stream) {\n        stream.writeUTF(this.topic);\n        stream.writeUTF(this.targetId);\n\n        _get(_getPrototypeOf(PublishWriter.prototype), \"writeMessage\", this).call(this, stream);\n\n        stream.write(this.data);\n      }\n    }]);\n\n    return PublishWriter;\n  }(RetryableWriter);\n\n  var PubAckReader = function (_RetryableReader2) {\n    _inherits(PubAckReader, _RetryableReader2);\n\n    var _super11 = _createSuper(PubAckReader);\n\n    function PubAckReader() {\n      var _this38;\n\n      _classCallCheck(this, PubAckReader);\n\n      _this38 = _super11.apply(this, arguments);\n      _this38._name = MessageName.PUB_ACK;\n      _this38.status = 0;\n      _this38.date = 0;\n      _this38.millisecond = 0;\n      _this38.messageUId = '';\n      _this38.timestamp = 0;\n      _this38.identifier = IDENTIFIER.PUB;\n      _this38.topic = '';\n      _this38.targetId = '';\n      return _this38;\n    }\n\n    _createClass(PubAckReader, [{\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        _get(_getPrototypeOf(PubAckReader.prototype), \"readMessage\", this).call(this, stream, length);\n\n        this.date = stream.readInt();\n        this.status = stream.readByte() * 256 + stream.readByte();\n        this.millisecond = stream.readByte() * 256 + stream.readByte();\n        this.timestamp = this.date * 1000 + this.millisecond;\n        this.messageUId = stream.readUTF();\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return PubAckReader;\n  }(RetryableReader);\n\n  var PubAckWriter = function (_RetryableWriter2) {\n    _inherits(PubAckWriter, _RetryableWriter2);\n\n    var _super12 = _createSuper(PubAckWriter);\n\n    function PubAckWriter(messageId) {\n      var _this39;\n\n      _classCallCheck(this, PubAckWriter);\n\n      _this39 = _super12.call(this, OperationType.PUB_ACK);\n      _this39._name = MessageName.PUB_ACK;\n      _this39.status = 0;\n      _this39.date = 0;\n      _this39.millisecond = 0;\n      _this39.messageUId = '';\n      _this39.timestamp = 0;\n      _this39.messageId = messageId;\n      return _this39;\n    }\n\n    _createClass(PubAckWriter, [{\n      key: \"writeMessage\",\n      value: function writeMessage(stream) {\n        _get(_getPrototypeOf(PubAckWriter.prototype), \"writeMessage\", this).call(this, stream);\n      }\n    }]);\n\n    return PubAckWriter;\n  }(RetryableWriter);\n\n  var QueryWriter = function (_RetryableWriter3) {\n    _inherits(QueryWriter, _RetryableWriter3);\n\n    var _super13 = _createSuper(QueryWriter);\n\n    function QueryWriter(topic, data, targetId) {\n      var _this40;\n\n      _classCallCheck(this, QueryWriter);\n\n      _this40 = _super13.call(this, OperationType.QUERY);\n      _this40.name = MessageName.QUERY;\n      _this40.identifier = IDENTIFIER.QUERY;\n      _this40.topic = topic;\n      _this40.data = isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this40.targetId = targetId;\n      return _this40;\n    }\n\n    _createClass(QueryWriter, [{\n      key: \"writeMessage\",\n      value: function writeMessage(stream) {\n        stream.writeUTF(this.topic);\n        stream.writeUTF(this.targetId);\n\n        _get(_getPrototypeOf(QueryWriter.prototype), \"writeMessage\", this).call(this, stream);\n\n        stream.write(this.data);\n      }\n    }]);\n\n    return QueryWriter;\n  }(RetryableWriter);\n\n  var QueryConWriter = function (_RetryableWriter4) {\n    _inherits(QueryConWriter, _RetryableWriter4);\n\n    var _super14 = _createSuper(QueryConWriter);\n\n    function QueryConWriter(messageId) {\n      var _this41;\n\n      _classCallCheck(this, QueryConWriter);\n\n      _this41 = _super14.call(this, OperationType.QUERY_CONFIRM);\n      _this41._name = MessageName.QUERY_CON;\n      _this41.messageId = messageId;\n      return _this41;\n    }\n\n    return QueryConWriter;\n  }(RetryableWriter);\n\n  var QueryAckReader = function (_RetryableReader3) {\n    _inherits(QueryAckReader, _RetryableReader3);\n\n    var _super15 = _createSuper(QueryAckReader);\n\n    function QueryAckReader() {\n      var _this42;\n\n      _classCallCheck(this, QueryAckReader);\n\n      _this42 = _super15.apply(this, arguments);\n      _this42._name = MessageName.QUERY_ACK;\n      _this42.status = 0;\n      _this42.identifier = IDENTIFIER.QUERY;\n      _this42.topic = '';\n      _this42.targetId = '';\n      return _this42;\n    }\n\n    _createClass(QueryAckReader, [{\n      key: \"readMessage\",\n      value: function readMessage(stream, length) {\n        _get(_getPrototypeOf(QueryAckReader.prototype), \"readMessage\", this).call(this, stream, length);\n\n        this.date = stream.readInt();\n        this.status = stream.readByte() * 256 + stream.readByte();\n        this.data = stream.readAll();\n        return {\n          stream: stream,\n          length: length\n        };\n      }\n    }]);\n\n    return QueryAckReader;\n  }(RetryableReader);\n\n  var getReaderByHeader = function getReaderByHeader(header) {\n    _newArrowCheck(this, _this);\n\n    var type = header.type;\n    var msg;\n\n    switch (type) {\n      case OperationType.CONN_ACK:\n        msg = new ConnAckReader(header);\n        break;\n\n      case OperationType.PUBLISH:\n        msg = new PublishReader(header);\n        msg.syncMsg = header.syncMsg;\n        break;\n\n      case OperationType.PUB_ACK:\n        msg = new PubAckReader(header);\n        break;\n\n      case OperationType.QUERY_ACK:\n        msg = new QueryAckReader(header);\n        break;\n\n      case OperationType.SUB_ACK:\n      case OperationType.UNSUB_ACK:\n      case OperationType.PING_RESP:\n        msg = new PingRespReader(header);\n        break;\n\n      case OperationType.DISCONNECT:\n        msg = new DisconnectReader(header);\n        break;\n\n      default:\n        msg = new BaseReader(header);\n        logger.error('No support for deserializing ' + type + ' messages');\n    }\n\n    return msg;\n  }.bind(undefined);\n\n  var readWSBuffer = function readWSBuffer(data) {\n    _newArrowCheck(this, _this);\n\n    var arr = new Uint8Array(data);\n    var stream = new RongStreamReader(arr);\n    var flags = stream.readByte();\n    var header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    msg.read(stream, arr.length - 1);\n    return msg;\n  }.bind(undefined);\n\n  var readCometData = function readCometData(data) {\n    _newArrowCheck(this, _this);\n\n    var flags = data.headerCode;\n    var header = new Header(flags);\n    var msg = getReaderByHeader(header);\n\n    for (var _key9 in data) {\n      msg[_key9] = data[_key9];\n    }\n\n    return msg;\n  }.bind(undefined);\n\n  var ConnectResultCode = {\n    ACCEPTED: 0,\n    UNACCEPTABLE_PROTOCOL_VERSION: 1,\n    IDENTIFIER_REJECTED: 2,\n    SERVER_UNAVAILABLE: 3,\n    TOKEN_INCORRECT: 4,\n    NOT_AUTHORIZED: 5,\n    REDIRECT: 6,\n    PACKAGE_ERROR: 7,\n    APP_BLOCK_OR_DELETE: 8,\n    BLOCK: 9,\n    TOKEN_EXPIRE: 10,\n    DEVICE_ERROR: 11,\n    HOSTNAME_ERROR: 12,\n    HASOHTERSAMECLIENTONLINE: 13\n  };\n  var ConnectionStatus;\n\n  (function (ConnectionStatus) {\n    ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n    ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n    ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n    ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n    ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n    ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n    ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n    ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n    ConnectionStatus[ConnectionStatus[\"BLOCKED\"] = 9] = \"BLOCKED\";\n    ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n    ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n    ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n    ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n    ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n    ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n    ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n  })(ConnectionStatus || (ConnectionStatus = {}));\n\n  var ConnectionStatus$1 = ConnectionStatus;\n\n  var randomNum = function randomNum(min, max) {\n    _newArrowCheck(this, _this);\n\n    return min + Math.floor(Math.random() * (max - min));\n  }.bind(undefined);\n\n  var getUUID = function getUUID() {\n    var _this43 = this;\n\n    _newArrowCheck(this, _this);\n\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      _newArrowCheck(this, _this43);\n\n      var r = Math.random() * 16 | 0;\n      var v = c === 'x' ? r : r & 0x3 | 0x8;\n      return v.toString(16);\n    }.bind(this));\n  }.bind(undefined);\n\n  var Topic;\n\n  (function (Topic) {\n    Topic[Topic[\"ppMsgP\"] = 1] = \"ppMsgP\";\n    Topic[Topic[\"ppMsgN\"] = 2] = \"ppMsgN\";\n    Topic[Topic[\"ppMsgS\"] = 3] = \"ppMsgS\";\n    Topic[Topic[\"pgMsgP\"] = 4] = \"pgMsgP\";\n    Topic[Topic[\"chatMsg\"] = 5] = \"chatMsg\";\n    Topic[Topic[\"pcMsgP\"] = 6] = \"pcMsgP\";\n    Topic[Topic[\"qryPMsg\"] = 7] = \"qryPMsg\";\n    Topic[Topic[\"qryGMsg\"] = 8] = \"qryGMsg\";\n    Topic[Topic[\"qryCHMsg\"] = 9] = \"qryCHMsg\";\n    Topic[Topic[\"qryCMsg\"] = 10] = \"qryCMsg\";\n    Topic[Topic[\"qrySMsg\"] = 11] = \"qrySMsg\";\n    Topic[Topic[\"recallMsg\"] = 12] = \"recallMsg\";\n    Topic[Topic[\"prMsgS\"] = 13] = \"prMsgS\";\n    Topic[Topic[\"s_ntf\"] = 14] = \"s_ntf\";\n    Topic[Topic[\"s_msg\"] = 15] = \"s_msg\";\n    Topic[Topic[\"s_stat\"] = 16] = \"s_stat\";\n    Topic[Topic[\"s_cmd\"] = 17] = \"s_cmd\";\n    Topic[Topic[\"s_us\"] = 18] = \"s_us\";\n    Topic[Topic[\"pullUS\"] = 19] = \"pullUS\";\n    Topic[Topic[\"pgMsgS\"] = 20] = \"pgMsgS\";\n    Topic[Topic[\"chatMsgS\"] = 21] = \"chatMsgS\";\n    Topic[Topic[\"qrySessionsAtt\"] = 22] = \"qrySessionsAtt\";\n    Topic[Topic[\"pullMsg\"] = 23] = \"pullMsg\";\n    Topic[Topic[\"qrySessions\"] = 24] = \"qrySessions\";\n    Topic[Topic[\"delSessions\"] = 25] = \"delSessions\";\n    Topic[Topic[\"delMsg\"] = 26] = \"delMsg\";\n    Topic[Topic[\"updRRTime\"] = 27] = \"updRRTime\";\n    Topic[Topic[\"chrmPull\"] = 28] = \"chrmPull\";\n    Topic[Topic[\"joinChrm\"] = 29] = \"joinChrm\";\n    Topic[Topic[\"joinChrmR\"] = 30] = \"joinChrmR\";\n    Topic[Topic[\"exitChrm\"] = 31] = \"exitChrm\";\n    Topic[Topic[\"queryChrmI\"] = 32] = \"queryChrmI\";\n    Topic[Topic[\"setKV\"] = 33] = \"setKV\";\n    Topic[Topic[\"delKV\"] = 34] = \"delKV\";\n    Topic[Topic[\"pullKV\"] = 35] = \"pullKV\";\n    Topic[Topic[\"qryRelation\"] = 36] = \"qryRelation\";\n    Topic[Topic[\"delRelation\"] = 37] = \"delRelation\";\n    Topic[Topic[\"pullSeAtts\"] = 38] = \"pullSeAtts\";\n    Topic[Topic[\"setSeAtt\"] = 39] = \"setSeAtt\";\n    Topic[Topic[\"qnTkn\"] = 40] = \"qnTkn\";\n    Topic[Topic[\"qnUrl\"] = 41] = \"qnUrl\";\n    Topic[Topic[\"aliUrl\"] = 42] = \"aliUrl\";\n    Topic[Topic[\"cleanPMsg\"] = 43] = \"cleanPMsg\";\n    Topic[Topic[\"cleanGMsg\"] = 44] = \"cleanGMsg\";\n    Topic[Topic[\"cleanCMsg\"] = 45] = \"cleanCMsg\";\n    Topic[Topic[\"cleanSMsg\"] = 46] = \"cleanSMsg\";\n    Topic[Topic[\"rtcRJoin_data\"] = 47] = \"rtcRJoin_data\";\n    Topic[Topic[\"rtcRExit\"] = 48] = \"rtcRExit\";\n    Topic[Topic[\"rtcPing\"] = 49] = \"rtcPing\";\n    Topic[Topic[\"rtcSetData\"] = 50] = \"rtcSetData\";\n    Topic[Topic[\"userSetData\"] = 51] = \"userSetData\";\n    Topic[Topic[\"rtcQryData\"] = 52] = \"rtcQryData\";\n    Topic[Topic[\"rtcDelData\"] = 53] = \"rtcDelData\";\n    Topic[Topic[\"rtcSetOutData\"] = 54] = \"rtcSetOutData\";\n    Topic[Topic[\"rtcQryUserOutData\"] = 55] = \"rtcQryUserOutData\";\n    Topic[Topic[\"rtcToken\"] = 56] = \"rtcToken\";\n    Topic[Topic[\"rtcUserState\"] = 57] = \"rtcUserState\";\n    Topic[Topic[\"rtcRInfo\"] = 58] = \"rtcRInfo\";\n    Topic[Topic[\"rtcUData\"] = 59] = \"rtcUData\";\n    Topic[Topic[\"rtcUPut\"] = 60] = \"rtcUPut\";\n    Topic[Topic[\"rtcUDel\"] = 61] = \"rtcUDel\";\n    Topic[Topic[\"rtcUList\"] = 62] = \"rtcUList\";\n  })(Topic || (Topic = {}));\n\n  var Topic$1 = Topic;\n\n  var getValidHosts = function getValidHosts(hosts, protocol, runtime) {\n    _newArrowCheck(this, _this);\n\n    return __awaiter$1(void 0, void 0, void 0, regeneratorRuntime.mark(function _callee2() {\n      var _this44 = this;\n\n      var pingRes;\n      return regeneratorRuntime.wrap(function _callee2$(_context3) {\n        while (1) {\n          switch (_context3.prev = _context3.next) {\n            case 0:\n              _context3.next = 2;\n              return Promise.all(hosts.map(function (host) {\n                _newArrowCheck(this, _this44);\n\n                return __awaiter$1(void 0, void 0, void 0, regeneratorRuntime.mark(function _callee() {\n                  var now, url, res;\n                  return regeneratorRuntime.wrap(function _callee$(_context2) {\n                    while (1) {\n                      switch (_context2.prev = _context2.next) {\n                        case 0:\n                          now = Date.now();\n                          url = \"\".concat(protocol, \"://\").concat(host, \"/ping?r=\").concat(randomNum(1000, 9999));\n                          _context2.next = 4;\n                          return runtime.httpReq({\n                            url: url,\n                            timeout: PING_REQ_TIMEOUT\n                          });\n\n                        case 4:\n                          res = _context2.sent;\n                          return _context2.abrupt(\"return\", {\n                            status: res.status,\n                            host: host,\n                            cost: Date.now() - now\n                          });\n\n                        case 6:\n                        case \"end\":\n                          return _context2.stop();\n                      }\n                    }\n                  }, _callee);\n                }));\n              }.bind(this)));\n\n            case 2:\n              pingRes = _context3.sent;\n              pingRes = pingRes.filter(function (item) {\n                _newArrowCheck(this, _this44);\n\n                return item.status === 200;\n              }.bind(this));\n\n              if (pingRes.length > 1) {\n                pingRes = pingRes.sort(function (a, b) {\n                  _newArrowCheck(this, _this44);\n\n                  return a.cost - b.cost;\n                }.bind(this));\n              }\n\n              return _context3.abrupt(\"return\", pingRes.map(function (item) {\n                _newArrowCheck(this, _this44);\n\n                return item.host;\n              }.bind(this)));\n\n            case 6:\n            case \"end\":\n              return _context3.stop();\n          }\n        }\n      }, _callee2, this);\n    }));\n  }.bind(undefined);\n\n  var formatWSUrl = function formatWSUrl(protocol, host, appkey, token, runtime, apiVersion, pid) {\n    _newArrowCheck(this, _this);\n\n    return \"\".concat(protocol, \"://\").concat(host, \"/websocket?appId=\").concat(appkey, \"&token=\").concat(encodeURIComponent(token), \"&sdkVer=\").concat(apiVersion, \"&pid=\").concat(pid, \"&apiVer=\").concat(runtime.isFromUniapp ? 'uniapp' : 'normal').concat(runtime.connectPlatform ? '&platform=' + runtime.connectPlatform : '');\n  }.bind(undefined);\n\n  var formatResolveKey = function formatResolveKey(messageId, identifier) {\n    _newArrowCheck(this, _this);\n\n    return [messageId, identifier].join('-');\n  }.bind(undefined);\n\n  var isStatusMessage = function isStatusMessage(topic) {\n    var _this45 = this;\n\n    _newArrowCheck(this, _this);\n\n    return [Topic$1.ppMsgS, Topic$1.pgMsgS, Topic$1.chatMsgS].map(function (item) {\n      _newArrowCheck(this, _this45);\n\n      return Topic$1[item];\n    }.bind(this)).indexOf(topic) >= 0;\n  }.bind(undefined);\n\n  var sendWSData = function sendWSData(writer, socket) {\n    _newArrowCheck(this, _this);\n\n    if (!(writer instanceof PingReqWriter)) {\n      logger.debug('Websocket ==>', writer);\n    }\n\n    var binary = writer.getBufferData();\n    socket.send(binary.buffer);\n  }.bind(undefined);\n\n  var WebSocketChannel = function (_ADataChannel) {\n    _inherits(WebSocketChannel, _ADataChannel);\n\n    var _super16 = _createSuper(WebSocketChannel);\n\n    function WebSocketChannel(_runtime, watcher) {\n      var _this47 = this;\n\n      var _this46;\n\n      _classCallCheck(this, WebSocketChannel);\n\n      _this46 = _super16.call(this, 'websocket', watcher);\n      _this46._runtime = _runtime;\n      _this46._socket = null;\n      _this46._messageIds = {};\n      _this46._syncMessageIds = {};\n      _this46._failedCount = 0;\n      _this46.ALLOW_FAILED_TIMES = 4;\n      _this46._idCount = 0;\n\n      _this46._generateMessageId = function () {\n        _newArrowCheck(this, _this47);\n\n        if (_this46._idCount >= 65535) {\n          _this46._idCount = 0;\n        }\n\n        return ++_this46._idCount;\n      }.bind(this);\n\n      return _this46;\n    }\n\n    _createClass(WebSocketChannel, [{\n      key: \"connect\",\n      value: function connect(appkey, token, hosts, protocol, apiVersion) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee3() {\n          var _this48 = this;\n\n          var validHosts, wsProtocol, _loop2, i, len, _ret;\n\n          return regeneratorRuntime.wrap(function _callee3$(_context5) {\n            while (1) {\n              switch (_context5.prev = _context5.next) {\n                case 0:\n                  apiVersion = matchVersion(apiVersion);\n\n                  this._watcher.status(ConnectionStatus$1.CONNECTING);\n\n                  _context5.next = 4;\n                  return getValidHosts(hosts, protocol, this._runtime);\n\n                case 4:\n                  validHosts = _context5.sent;\n\n                  if (!(validHosts.length === 0)) {\n                    _context5.next = 8;\n                    break;\n                  }\n\n                  logger.error('No valid websocket server hosts!');\n                  return _context5.abrupt(\"return\", ErrorCode$1.RC_SOCKET_NOT_CREATED);\n\n                case 8:\n                  wsProtocol = protocol.replace('http', 'ws');\n                  _loop2 = regeneratorRuntime.mark(function _loop2(i, len) {\n                    var _this49 = this;\n\n                    var url, socket, disconnected, code;\n                    return regeneratorRuntime.wrap(function _loop2$(_context4) {\n                      while (1) {\n                        switch (_context4.prev = _context4.next) {\n                          case 0:\n                            url = formatWSUrl(wsProtocol, validHosts[i], appkey, token, _this48._runtime, apiVersion);\n                            socket = _this48._runtime.createWebSocket(url);\n\n                            disconnected = function disconnected(code) {\n                              _newArrowCheck(this, _this49);\n\n                              if (_this48._socket === socket) {\n                                _this48._socket = null;\n\n                                _this48._watcher.status(code);\n                              }\n                            }.bind(this);\n\n                            _context4.next = 5;\n                            return new Promise(function (resolve) {\n                              var _this50 = this;\n\n                              _newArrowCheck(this, _this49);\n\n                              socket.onMessage(function (data) {\n                                _newArrowCheck(this, _this50);\n\n                                if (Object.prototype.toString.call(data) !== '[object ArrayBuffer]') {\n                                  logger.warn('Socket received invalid data:', data);\n                                  return;\n                                }\n\n                                var signal = readWSBuffer(data);\n\n                                if (signal instanceof PingRespReader && _this48._pingResolve) {\n                                  _this48._pingResolve(ErrorCode$1.SUCCESS);\n\n                                  _this48._pingResolve = undefined;\n                                  return;\n                                }\n\n                                logger.debug('Websocket <==', signal);\n\n                                if (signal instanceof ConnAckReader) {\n                                  if (signal.status !== ConnectResultCode.ACCEPTED) {\n                                    logger.error('Websocket connAck status:', signal.status);\n                                    resolve(signal.status);\n                                    return;\n                                  }\n\n                                  _this48.connectedTime = signal.timestamp;\n                                  _this48.userId = signal.userId || '';\n                                  resolve(ErrorCode$1.SUCCESS);\n                                  return;\n                                }\n\n                                if (signal instanceof DisconnectReader) {\n                                  var status = signal.status;\n                                  var connStatus = status === 1 ? ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT : status === 2 ? ConnectionStatus$1.BLOCKED : status;\n\n                                  _this48._watcher.status(connStatus);\n\n                                  return;\n                                }\n\n                                _this48._onReceiveSignal(signal);\n                              }.bind(this));\n                              socket.onClose(function (code, reason) {\n                                _newArrowCheck(this, _this50);\n\n                                logger.warn('websocket closed! code:', code, 'reason:', reason);\n                                disconnected(ConnectionStatus$1.CONNECTION_CLOSED);\n                                resolve(code);\n                              }.bind(this));\n                              socket.onError(function (error) {\n                                _newArrowCheck(this, _this50);\n\n                                logger.error('websocket error!', error);\n                                disconnected(ConnectionStatus$1.WEBSOCKET_ERROR);\n                                resolve(ErrorCode$1.NETWORK_ERROR);\n                              }.bind(this));\n                              socket.onOpen(function () {\n                                _newArrowCheck(this, _this50);\n\n                                return logger.debug('websocket open =>', url);\n                              }.bind(this));\n                              timerSetTimeout(function () {\n                                _newArrowCheck(this, _this50);\n\n                                resolve(ErrorCode$1.TIMEOUT);\n                              }.bind(this), WEB_SOCKET_TIMEOUT);\n                            }.bind(this));\n\n                          case 5:\n                            code = _context4.sent;\n\n                            if (!(code === ErrorCode$1.SUCCESS)) {\n                              _context4.next = 11;\n                              break;\n                            }\n\n                            _this48._socket = socket;\n\n                            _this48._checkAlive();\n\n                            _this48._watcher.status(ConnectionStatus$1.CONNECTED);\n\n                            return _context4.abrupt(\"return\", {\n                              v: code\n                            });\n\n                          case 11:\n                            socket.close();\n\n                          case 12:\n                          case \"end\":\n                            return _context4.stop();\n                        }\n                      }\n                    }, _loop2, this);\n                  });\n                  i = 0, len = validHosts.length;\n\n                case 11:\n                  if (!(i < len)) {\n                    _context5.next = 19;\n                    break;\n                  }\n\n                  return _context5.delegateYield(_loop2(i, len), \"t0\", 13);\n\n                case 13:\n                  _ret = _context5.t0;\n\n                  if (!(_typeof(_ret) === \"object\")) {\n                    _context5.next = 16;\n                    break;\n                  }\n\n                  return _context5.abrupt(\"return\", _ret.v);\n\n                case 16:\n                  i += 1;\n                  _context5.next = 11;\n                  break;\n\n                case 19:\n                  return _context5.abrupt(\"return\", ErrorCode$1.RC_NET_UNAVAILABLE);\n\n                case 20:\n                case \"end\":\n                  return _context5.stop();\n              }\n            }\n          }, _callee3, this);\n        }));\n      }\n    }, {\n      key: \"_checkAlive\",\n      value: function _checkAlive() {\n        var _a;\n\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee4() {\n          var _this51 = this;\n\n          var code;\n          return regeneratorRuntime.wrap(function _callee4$(_context6) {\n            while (1) {\n              switch (_context6.prev = _context6.next) {\n                case 0:\n                  if (this._socket) {\n                    _context6.next = 2;\n                    break;\n                  }\n\n                  return _context6.abrupt(\"return\");\n\n                case 2:\n                  this.sendOnly(new PingReqWriter());\n                  _context6.next = 5;\n                  return new Promise(function (resolve) {\n                    var _this52 = this;\n\n                    _newArrowCheck(this, _this51);\n\n                    this._pingResolve = resolve;\n                    setTimeout(function () {\n                      _newArrowCheck(this, _this52);\n\n                      this._pingResolve = undefined;\n                      resolve(ErrorCode$1.TIMEOUT);\n                    }.bind(this), IM_SIGNAL_TIMEOUT);\n                  }.bind(this));\n\n                case 5:\n                  code = _context6.sent;\n\n                  if (!(code !== ErrorCode$1.SUCCESS && ++this._failedCount >= this.ALLOW_FAILED_TIMES)) {\n                    _context6.next = 9;\n                    break;\n                  }\n\n                  (_a = this._socket) === null || _a === void 0 ? void 0 : _a.close();\n                  return _context6.abrupt(\"return\");\n\n                case 9:\n                  this._failedCount = 0;\n                  setTimeout(function () {\n                    _newArrowCheck(this, _this51);\n\n                    return this._checkAlive();\n                  }.bind(this), IM_PING_INTERVAL_TIME);\n\n                case 11:\n                case \"end\":\n                  return _context6.stop();\n              }\n            }\n          }, _callee4, this);\n        }));\n      }\n    }, {\n      key: \"_onReceiveSignal\",\n      value: function _onReceiveSignal(signal) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee5() {\n          var _this53 = this;\n\n          var messageId, identifier, isQosNeedAck, key, resolve, syncMsg, topic, ack;\n          return regeneratorRuntime.wrap(function _callee5$(_context7) {\n            while (1) {\n              switch (_context7.prev = _context7.next) {\n                case 0:\n                  messageId = signal.messageId, identifier = signal.identifier;\n                  isQosNeedAck = signal.header && signal.header.qos !== QOS.AT_MOST_ONCE;\n\n                  if (isQosNeedAck) {\n                    if (signal instanceof PublishReader && !signal.syncMsg) {\n                      this.sendOnly(new PubAckWriter(messageId));\n                    }\n\n                    if (signal instanceof QueryAckReader) {\n                      this.sendOnly(new QueryConWriter(messageId));\n                    }\n                  }\n\n                  key = formatResolveKey(messageId, identifier);\n\n                  if (messageId > 0) {\n                    resolve = this._messageIds[key];\n                    resolve && resolve(signal);\n                    this._syncMessageIds[key] && this._syncMessageIds[key](signal);\n                  }\n\n                  if (!(signal instanceof PublishReader)) {\n                    _context7.next = 15;\n                    break;\n                  }\n\n                  syncMsg = signal.syncMsg, topic = signal.topic;\n\n                  if (!(!syncMsg || isStatusMessage(topic))) {\n                    _context7.next = 10;\n                    break;\n                  }\n\n                  this._watcher.signal(signal);\n\n                  return _context7.abrupt(\"return\");\n\n                case 10:\n                  _context7.next = 12;\n                  return new Promise(function (resolve) {\n                    _newArrowCheck(this, _this53);\n\n                    this._syncMessageIds[key] = resolve;\n                  }.bind(this));\n\n                case 12:\n                  ack = _context7.sent;\n                  delete this._syncMessageIds[key];\n\n                  this._watcher.signal(signal, ack);\n\n                case 15:\n                case \"end\":\n                  return _context7.stop();\n              }\n            }\n          }, _callee5, this);\n        }));\n      }\n    }, {\n      key: \"sendOnly\",\n      value: function sendOnly(writer) {\n        if (this._socket) {\n          sendWSData(writer, this._socket);\n        }\n      }\n    }, {\n      key: \"send\",\n      value: function send(writer, respPBName, option) {\n        var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : IM_SIGNAL_TIMEOUT;\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee6() {\n          var _this54 = this;\n\n          var messageId, identifier, respSignal, data;\n          return regeneratorRuntime.wrap(function _callee6$(_context8) {\n            while (1) {\n              switch (_context8.prev = _context8.next) {\n                case 0:\n                  if (!this._socket) {\n                    _context8.next = 14;\n                    break;\n                  }\n\n                  messageId = this._generateMessageId();\n                  writer.messageId = messageId;\n                  identifier = writer.identifier;\n                  sendWSData(writer, this._socket);\n                  _context8.next = 7;\n                  return new Promise(function (resolve) {\n                    var _this55 = this;\n\n                    _newArrowCheck(this, _this54);\n\n                    var key = formatResolveKey(messageId, identifier);\n                    this._messageIds[key] = resolve;\n                    setTimeout(function () {\n                      _newArrowCheck(this, _this55);\n\n                      delete this._messageIds[key];\n                      resolve();\n                    }.bind(this), timeout);\n                  }.bind(this));\n\n                case 7:\n                  respSignal = _context8.sent;\n\n                  if (respSignal) {\n                    _context8.next = 10;\n                    break;\n                  }\n\n                  return _context8.abrupt(\"return\", {\n                    code: ErrorCode$1.TIMEOUT\n                  });\n\n                case 10:\n                  if (!(respSignal.status !== 0)) {\n                    _context8.next = 12;\n                    break;\n                  }\n\n                  return _context8.abrupt(\"return\", {\n                    code: respSignal.status\n                  });\n\n                case 12:\n                  data = respPBName ? this.codec.decodeByPBName(respSignal.data, respPBName, option) : respSignal;\n                  return _context8.abrupt(\"return\", {\n                    code: ErrorCode$1.SUCCESS,\n                    data: data\n                  });\n\n                case 14:\n                  return _context8.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 15:\n                case \"end\":\n                  return _context8.stop();\n              }\n            }\n          }, _callee6, this);\n        }));\n      }\n    }, {\n      key: \"close\",\n      value: function close() {\n        if (this._socket) {\n          this._socket.close();\n\n          this._socket = null;\n\n          this._watcher.status(ConnectionStatus$1.DISCONNECTED);\n        }\n      }\n    }]);\n\n    return WebSocketChannel;\n  }(ADataChannel);\n\n  var HttpMethod;\n\n  (function (HttpMethod) {\n    HttpMethod[\"GET\"] = \"GET\";\n    HttpMethod[\"POST\"] = \"POST\";\n  })(HttpMethod || (HttpMethod = {}));\n\n  var isValidJSON = function isValidJSON(jsonStr) {\n    _newArrowCheck(this, _this);\n\n    if (isObject(jsonStr)) {\n      return true;\n    }\n\n    var isValid = false;\n\n    try {\n      var obj = JSON.parse(jsonStr);\n      var str = JSON.stringify(obj);\n      isValid = str === jsonStr;\n    } catch (e) {\n      isValid = false;\n    }\n\n    return isValid;\n  }.bind(undefined);\n\n  var CometChannel = function (_ADataChannel2) {\n    _inherits(CometChannel, _ADataChannel2);\n\n    var _super17 = _createSuper(CometChannel);\n\n    function CometChannel(_runtime, watcher) {\n      var _this57 = this;\n\n      var _this56;\n\n      _classCallCheck(this, CometChannel);\n\n      _this56 = _super17.call(this, 'comet', watcher);\n      _this56._runtime = _runtime;\n      _this56._messageIds = {};\n      _this56._syncMessageIds = {};\n      _this56._idCount = 0;\n\n      _this56._generateMessageId = function () {\n        _newArrowCheck(this, _this57);\n\n        return ++_this56._idCount;\n      }.bind(this);\n\n      _this56._pid = encodeURIComponent(new Date().getTime() + Math.random() + '');\n      return _this56;\n    }\n\n    _createClass(CometChannel, [{\n      key: \"handleCometRes\",\n      value: function handleCometRes(res) {\n        var _this58 = this;\n\n        if (res.status !== 200 && res.status !== 202) {\n          return false;\n        }\n\n        var data = isString(res.data) ? JSON.parse(res.data) : res.data;\n\n        if (!data) {\n          logger.warn('received data is not a validJson', data);\n          return false;\n        }\n\n        if (!isArray(data)) {\n          return true;\n        }\n\n        forEach(data, function (item) {\n          _newArrowCheck(this, _this58);\n\n          return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee7() {\n            var _this59 = this;\n\n            var sessionid, signal, messageId, _header, status, identifier, isQosNeedAck, key, resolve, writer, _writer, connStatus, syncMsg, topic, ack;\n\n            return regeneratorRuntime.wrap(function _callee7$(_context9) {\n              while (1) {\n                switch (_context9.prev = _context9.next) {\n                  case 0:\n                    sessionid = item.sessionid;\n\n                    if (sessionid) {\n                      this._sessionid = sessionid;\n                    }\n\n                    signal = readCometData(item);\n                    messageId = signal.messageId, _header = signal._header, status = signal.status, identifier = signal.identifier;\n                    isQosNeedAck = _header && _header.qos !== QOS.AT_MOST_ONCE;\n                    key = formatResolveKey(messageId, identifier);\n\n                    if (messageId && signal.getIdentifier) {\n                      resolve = this._messageIds[key];\n                      resolve && resolve(signal);\n                      this._syncMessageIds[key] && this._syncMessageIds[key](signal);\n                    }\n\n                    if (isQosNeedAck) {\n                      if (signal instanceof PublishReader && !signal.syncMsg) {\n                        writer = new PubAckWriter(messageId);\n                        this.sendOnly(writer);\n                      }\n\n                      if (signal instanceof QueryAckReader) {\n                        _writer = new QueryConWriter(messageId);\n                        this.sendOnly(_writer);\n                      }\n                    }\n\n                    if (signal instanceof DisconnectReader) {\n                      connStatus = status === 1 ? ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT : status === 2 ? ConnectionStatus$1.BLOCKED : status;\n\n                      this._watcher.status(connStatus);\n                    }\n\n                    if (!(signal instanceof PublishReader)) {\n                      _context9.next = 19;\n                      break;\n                    }\n\n                    syncMsg = signal.syncMsg, topic = signal.topic;\n\n                    if (!(!syncMsg || isStatusMessage(topic))) {\n                      _context9.next = 14;\n                      break;\n                    }\n\n                    this._watcher.signal(signal);\n\n                    return _context9.abrupt(\"return\", false);\n\n                  case 14:\n                    _context9.next = 16;\n                    return new Promise(function (resolve) {\n                      _newArrowCheck(this, _this59);\n\n                      this._syncMessageIds[key] = resolve;\n                    }.bind(this));\n\n                  case 16:\n                    ack = _context9.sent;\n                    delete this._syncMessageIds[key];\n\n                    this._watcher.signal(signal, ack);\n\n                  case 19:\n                  case \"end\":\n                    return _context9.stop();\n                }\n              }\n            }, _callee7, this);\n          }));\n        }.bind(this));\n        return true;\n      }\n    }, {\n      key: \"_startPullSignal\",\n      value: function _startPullSignal(protocol) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee8() {\n          var timestamp, url, res, isSuccess;\n          return regeneratorRuntime.wrap(function _callee8$(_context10) {\n            while (1) {\n              switch (_context10.prev = _context10.next) {\n                case 0:\n                  timestamp = new Date().getTime();\n                  url = \"\".concat(protocol, \"://\").concat(this._domain, \"/pullmsg.js?sessionid=\").concat(this._sessionid, \"&timestrap=\").concat(timestamp, \"&pid=\").concat(this._pid);\n                  _context10.next = 4;\n                  return this._runtime.httpReq({\n                    url: url,\n                    body: {\n                      pid: this._pid\n                    },\n                    timeout: IM_COMET_PULLMSG_TIMEOUT\n                  });\n\n                case 4:\n                  res = _context10.sent;\n                  isSuccess = this.handleCometRes(res);\n\n                  if (!this._isDisconnected) {\n                    if (isSuccess) {\n                      this._startPullSignal(protocol);\n                    } else {\n                      this._watcher.status(ConnectionStatus$1.NETWORK_UNAVAILABLE);\n\n                      this.close();\n                    }\n                  }\n\n                case 7:\n                case \"end\":\n                  return _context10.stop();\n              }\n            }\n          }, _callee8, this);\n        }));\n      }\n    }, {\n      key: \"connect\",\n      value: function connect(appkey, token, hosts, protocol, apiVersion) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee9() {\n          var _this60 = this;\n\n          var validHosts, handleConnectRes, i, len, url, res, response;\n          return regeneratorRuntime.wrap(function _callee9$(_context11) {\n            while (1) {\n              switch (_context11.prev = _context11.next) {\n                case 0:\n                  apiVersion = matchVersion(apiVersion);\n                  this._protocol = protocol;\n                  this._isDisconnected = false;\n\n                  this._watcher.status(ConnectionStatus$1.CONNECTING);\n\n                  _context11.next = 6;\n                  return getValidHosts(hosts, protocol, this._runtime);\n\n                case 6:\n                  validHosts = _context11.sent;\n\n                  if (!(validHosts.length === 0)) {\n                    _context11.next = 10;\n                    break;\n                  }\n\n                  logger.error('No valid websocket server hosts!');\n                  return _context11.abrupt(\"return\", ErrorCode$1.RC_SOCKET_NOT_CREATED);\n\n                case 10:\n                  handleConnectRes = function handleConnectRes(res) {\n                    _newArrowCheck(this, _this60);\n\n                    if (res.status !== 200 && res.status !== 202) {\n                      return false;\n                    }\n\n                    if (res.data) {\n                      if (!isValidJSON(res.data)) {\n                        logger.warn('received data is not a validJson', res.data);\n                        return false;\n                      }\n\n                      return isObject(res.data) ? res.data : JSON.parse(res.data);\n                    }\n\n                    return false;\n                  }.bind(this);\n\n                  i = 0, len = validHosts.length;\n\n                case 12:\n                  if (!(i < len)) {\n                    _context11.next = 29;\n                    break;\n                  }\n\n                  url = formatWSUrl(protocol, validHosts[i], appkey, token, this._runtime, apiVersion, this._pid);\n                  _context11.next = 16;\n                  return this._runtime.httpReq({\n                    url: url,\n                    body: {\n                      pid: this._pid\n                    },\n                    timeout: WEB_SOCKET_TIMEOUT\n                  });\n\n                case 16:\n                  res = _context11.sent;\n                  response = handleConnectRes(res);\n                  this._domain = validHosts[i];\n\n                  if (!(response && response.status === 0)) {\n                    _context11.next = 26;\n                    break;\n                  }\n\n                  this._watcher.status(ConnectionStatus$1.CONNECTED);\n\n                  this._sessionid = response.sessionid;\n\n                  this._startPullSignal(protocol);\n\n                  this.userId = response.userId;\n                  this.connectedTime = response.timestamp;\n                  return _context11.abrupt(\"return\", response.status);\n\n                case 26:\n                  i += 1;\n                  _context11.next = 12;\n                  break;\n\n                case 29:\n                  return _context11.abrupt(\"return\", ErrorCode$1.RC_NET_UNAVAILABLE);\n\n                case 30:\n                case \"end\":\n                  return _context11.stop();\n              }\n            }\n          }, _callee9, this);\n        }));\n      }\n    }, {\n      key: \"sendCometData\",\n      value: function sendCometData(writer) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee10() {\n          var _domain, _sessionid, _pid, messageId, topic, targetId, identifier, headerCode, url, res;\n\n          return regeneratorRuntime.wrap(function _callee10$(_context12) {\n            while (1) {\n              switch (_context12.prev = _context12.next) {\n                case 0:\n                  _domain = this._domain, _sessionid = this._sessionid, _pid = this._pid;\n                  messageId = writer.messageId, topic = writer.topic, targetId = writer.targetId, identifier = writer.identifier;\n                  headerCode = writer.getHeaderFlag();\n\n                  if (topic) {\n                    url = \"\".concat(this._protocol, \"://\").concat(_domain, \"/websocket?messageid=\").concat(messageId, \"&header=\").concat(headerCode, \"&sessionid=\").concat(_sessionid, \"&topic=\").concat(topic, \"&targetid=\").concat(targetId, \"&pid=\").concat(_pid);\n                  } else {\n                    url = \"\".concat(this._protocol, \"://\").concat(_domain, \"/websocket?messageid=\").concat(messageId, \"&header=\").concat(headerCode, \"&sessionid=\").concat(_sessionid, \"&pid=\").concat(_pid);\n                  }\n\n                  _context12.next = 6;\n                  return this._runtime.httpReq({\n                    url: url,\n                    method: HttpMethod.POST,\n                    body: writer.getCometData()\n                  });\n\n                case 6:\n                  res = _context12.sent;\n                  this.handleCometRes(res);\n\n                case 8:\n                case \"end\":\n                  return _context12.stop();\n              }\n            }\n          }, _callee10, this);\n        }));\n      }\n    }, {\n      key: \"sendOnly\",\n      value: function sendOnly(writer) {\n        this.sendCometData(writer);\n      }\n    }, {\n      key: \"send\",\n      value: function send(writer, respPBName, option) {\n        var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : IM_SIGNAL_TIMEOUT;\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee11() {\n          var _this61 = this;\n\n          var messageId, identifier, respSignal, data;\n          return regeneratorRuntime.wrap(function _callee11$(_context13) {\n            while (1) {\n              switch (_context13.prev = _context13.next) {\n                case 0:\n                  messageId = this._generateMessageId();\n                  writer.messageId = messageId;\n                  this.sendCometData(writer);\n                  identifier = writer.identifier;\n                  _context13.next = 6;\n                  return new Promise(function (resolve) {\n                    var _this62 = this;\n\n                    _newArrowCheck(this, _this61);\n\n                    var key = formatResolveKey(messageId, identifier);\n                    this._messageIds[key] = resolve;\n                    setTimeout(function () {\n                      _newArrowCheck(this, _this62);\n\n                      delete this._messageIds[key];\n                      resolve();\n                    }.bind(this), timeout);\n                  }.bind(this));\n\n                case 6:\n                  respSignal = _context13.sent;\n\n                  if (respSignal) {\n                    _context13.next = 9;\n                    break;\n                  }\n\n                  return _context13.abrupt(\"return\", {\n                    code: ErrorCode$1.TIMEOUT\n                  });\n\n                case 9:\n                  if (!(respSignal.status !== 0)) {\n                    _context13.next = 11;\n                    break;\n                  }\n\n                  return _context13.abrupt(\"return\", {\n                    code: respSignal.status\n                  });\n\n                case 11:\n                  data = respPBName ? this.codec.decodeByPBName(respSignal.data, respPBName, option) : respSignal;\n                  return _context13.abrupt(\"return\", {\n                    code: ErrorCode$1.SUCCESS,\n                    data: data\n                  });\n\n                case 13:\n                case \"end\":\n                  return _context13.stop();\n              }\n            }\n          }, _callee11, this);\n        }));\n      }\n    }, {\n      key: \"close\",\n      value: function close() {\n        this._isDisconnected = true;\n\n        this._watcher.status(ConnectionStatus$1.DISCONNECTED);\n      }\n    }]);\n\n    return CometChannel;\n  }(ADataChannel);\n\n  var getKey = function getKey(appkey, token) {\n    _newArrowCheck(this, _this);\n\n    return ['navi', appkey, token].join('_');\n  }.bind(undefined);\n\n  var getNaviInfoFromCache = function getNaviInfoFromCache(appkey, token, storage) {\n    _newArrowCheck(this, _this);\n\n    var key = getKey(appkey, token);\n    var jsonStr = storage.getItem(key);\n\n    if (!jsonStr) {\n      return null;\n    }\n\n    var data;\n\n    try {\n      data = JSON.parse(jsonStr);\n    } catch (err) {\n      storage.removeItem(key);\n      return null;\n    }\n\n    if (Date.now() - data.timestamp >= NAVI_CACHE_DURATION) {\n      storage.removeItem(key);\n      return null;\n    }\n\n    return data.naviInfo;\n  }.bind(undefined);\n\n  var setNaviInfo2Cache = function setNaviInfo2Cache(appkey, token, naviInfo, storage) {\n    _newArrowCheck(this, _this);\n\n    var key = getKey(appkey, token);\n    var data = {\n      naviInfo: naviInfo,\n      timestamp: Date.now()\n    };\n    storage.setItem(key, JSON.stringify(data));\n  }.bind(undefined);\n\n  var clearCache = function clearCache(appkey, token, storage) {\n    _newArrowCheck(this, _this);\n\n    storage.removeItem(getKey(appkey, token));\n  }.bind(undefined);\n\n  var Navi = function () {\n    function Navi(_runtime, _appkey, _navigators) {\n      var _customCMP = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n      var _apiVersion = arguments.length > 4 ? arguments[4] : undefined;\n\n      var _connectType = arguments.length > 5 ? arguments[5] : undefined;\n\n      _classCallCheck(this, Navi);\n\n      this._runtime = _runtime;\n      this._appkey = _appkey;\n      this._navigators = _navigators;\n      this._customCMP = _customCMP;\n      this._apiVersion = _apiVersion;\n      this._connectType = _connectType;\n      this._apiVersion = matchVersion(this._apiVersion);\n    }\n\n    _createClass(Navi, [{\n      key: \"_formatNaviUrl\",\n      value: function _formatNaviUrl(url, token, appkey, jsonpFunc, connectType) {\n        var path = this._runtime.isSupportSocket() && connectType === 'websocket' ? 'navi' : 'cometnavi';\n        var tmpUrl = \"\".concat(url, \"/\").concat(path, \".js?appId=\").concat(appkey, \"&token=\").concat(encodeURIComponent(token), \"&callBack=\").concat(jsonpFunc, \"&v=\").concat(this._apiVersion, \"&r=\").concat(Date.now());\n        return tmpUrl;\n      }\n    }, {\n      key: \"_reqNavi\",\n      value: function _reqNavi(uris, appkey, token, connectType) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee12() {\n          var jsonpFunc, i, len, url, res, jsonStr, naviInfo, protocol;\n          return regeneratorRuntime.wrap(function _callee12$(_context14) {\n            while (1) {\n              switch (_context14.prev = _context14.next) {\n                case 0:\n                  jsonpFunc = 'getServerEndpoint';\n                  i = 0, len = uris.length;\n\n                case 2:\n                  if (!(i < len)) {\n                    _context14.next = 24;\n                    break;\n                  }\n\n                  url = this._formatNaviUrl(uris[i], token, appkey, jsonpFunc, connectType);\n                  logger.debug(\"req navi => \".concat(url));\n                  _context14.next = 7;\n                  return this._runtime.httpReq({\n                    url: url,\n                    timeout: NAVI_REQ_TIMEOUT\n                  });\n\n                case 7:\n                  res = _context14.sent;\n\n                  if (!(res.status !== 200)) {\n                    _context14.next = 10;\n                    break;\n                  }\n\n                  return _context14.abrupt(\"continue\", 21);\n\n                case 10:\n                  _context14.prev = 10;\n                  jsonStr = res.data.replace(\"\".concat(jsonpFunc, \"(\"), '').replace(/\\);?$/, '');\n                  naviInfo = JSON.parse(jsonStr);\n                  protocol = /^https/.test(url) ? 'https' : 'http';\n                  naviInfo.protocol = protocol;\n                  return _context14.abrupt(\"return\", naviInfo);\n\n                case 18:\n                  _context14.prev = 18;\n                  _context14.t0 = _context14[\"catch\"](10);\n                  logger.error('parse navi err =>', _context14.t0);\n\n                case 21:\n                  i += 1;\n                  _context14.next = 2;\n                  break;\n\n                case 24:\n                  return _context14.abrupt(\"return\", null);\n\n                case 25:\n                case \"end\":\n                  return _context14.stop();\n              }\n            }\n          }, _callee12, this, [[10, 18]]);\n        }));\n      }\n    }, {\n      key: \"getInfo\",\n      value: function getInfo(token, dynamicUris, force, isCppMode) {\n        var _a;\n\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee13() {\n          var _this63 = this;\n\n          var connectUrl, _naviInfo, naviInfo, uris;\n\n          return regeneratorRuntime.wrap(function _callee13$(_context15) {\n            while (1) {\n              switch (_context15.prev = _context15.next) {\n                case 0:\n                  if (!isCppMode) {\n                    _context15.next = 2;\n                    break;\n                  }\n\n                  return _context15.abrupt(\"return\", null);\n\n                case 2:\n                  if (this._runtime.useNavi) {\n                    _context15.next = 7;\n                    break;\n                  }\n\n                  if (this._runtime.isSupportSocket()) {\n                    connectUrl = MINI_SOCKET_CONNECT_URIS.join(',');\n                  } else {\n                    connectUrl = MINI_COMET_CONNECT_URIS.join(',');\n                  }\n\n                  _naviInfo = {\n                    code: 200,\n                    protocol: 'https',\n                    server: '',\n                    voipCallInfo: '',\n                    kvStorage: 0,\n                    openHttpDNS: false,\n                    historyMsg: false,\n                    chatroomMsg: false,\n                    uploadServer: 'https://upload.qiniup.com',\n                    bosAddr: 'https://gz.bcebos.com',\n                    location: '',\n                    monitor: 0,\n                    joinMChrm: false,\n                    openMp: 0,\n                    openUS: 0,\n                    grpMsgLimit: 0,\n                    isFormatted: 0,\n                    gifSize: 2048,\n                    logSwitch: 0,\n                    logPolicy: '',\n                    compDays: 0,\n                    msgAck: '',\n                    activeServer: '',\n                    qnAddr: '',\n                    extkitSwitch: 0,\n                    alone: false,\n                    voipServer: '',\n                    offlinelogserver: '',\n                    backupServer: ((_a = this._customCMP) === null || _a === void 0 ? void 0 : _a.length) ? this._customCMP.join(',') : connectUrl\n                  };\n                  setNaviInfo2Cache(this._appkey, token, _naviInfo, this._runtime.localStorage);\n                  return _context15.abrupt(\"return\", _naviInfo);\n\n                case 7:\n                  if (force) {\n                    this._clear(token);\n                  }\n\n                  naviInfo = getNaviInfoFromCache(this._appkey, token, this._runtime.localStorage);\n\n                  if (!naviInfo) {\n                    _context15.next = 11;\n                    break;\n                  }\n\n                  return _context15.abrupt(\"return\", naviInfo);\n\n                case 11:\n                  uris = this._navigators.slice();\n                  dynamicUris.length && dynamicUris.forEach(function (uri) {\n                    _newArrowCheck(this, _this63);\n\n                    uris.indexOf(uri) < 0 && uris.push(uri);\n                  }.bind(this));\n                  _context15.next = 15;\n                  return this._reqNavi(uris, this._appkey, token, this._connectType);\n\n                case 15:\n                  naviInfo = _context15.sent;\n\n                  if (!naviInfo) {\n                    _context15.next = 19;\n                    break;\n                  }\n\n                  setNaviInfo2Cache(this._appkey, token, naviInfo, this._runtime.localStorage);\n                  return _context15.abrupt(\"return\", naviInfo);\n\n                case 19:\n                  return _context15.abrupt(\"return\", naviInfo);\n\n                case 20:\n                case \"end\":\n                  return _context15.stop();\n              }\n            }\n          }, _callee13, this);\n        }));\n      }\n    }, {\n      key: \"getInfoFromCache\",\n      value: function getInfoFromCache(token) {\n        return getNaviInfoFromCache(this._appkey, token, this._runtime.localStorage);\n      }\n    }, {\n      key: \"_clear\",\n      value: function _clear(token) {\n        clearCache(this._appkey, token, this._runtime.localStorage);\n      }\n    }]);\n\n    return Navi;\n  }();\n\n  var AEngine = function AEngine(runtime, _appkey, _watcher, _apiVersion, _options) {\n    _classCallCheck(this, AEngine);\n\n    this.runtime = runtime;\n    this._appkey = _appkey;\n    this._watcher = _watcher;\n    this._apiVersion = _apiVersion;\n    this._options = _options;\n    this.currentUserId = '';\n    this.connectedTime = 0;\n  };\n\n  var OUTBOX_KEY = 'outbox';\n  var INBOX_KEY = 'inbox';\n\n  var generateKey = function generateKey(prefix, appkey, userId) {\n    _newArrowCheck(this, _this);\n\n    return [prefix, appkey, userId].join('_');\n  }.bind(undefined);\n\n  var Letterbox = function () {\n    function Letterbox(_runtime, _appkey) {\n      _classCallCheck(this, Letterbox);\n\n      this._runtime = _runtime;\n      this._appkey = _appkey;\n      this._inboxTime = 0;\n      this._outboxTime = 0;\n    }\n\n    _createClass(Letterbox, [{\n      key: \"setInboxTime\",\n      value: function setInboxTime(timestamp, userId) {\n        if (this._inboxTime > timestamp) {\n          return;\n        }\n\n        this._inboxTime = timestamp;\n        var key = generateKey(INBOX_KEY, this._appkey, userId);\n\n        this._runtime.localStorage.setItem(key, timestamp.toString());\n      }\n    }, {\n      key: \"getInboxTime\",\n      value: function getInboxTime(userId) {\n        if (this._inboxTime === 0) {\n          var _key10 = generateKey(INBOX_KEY, this._appkey, userId);\n\n          this._inboxTime = parseInt(this._runtime.localStorage.getItem(_key10)) || 0;\n        }\n\n        return this._inboxTime;\n      }\n    }, {\n      key: \"setOutboxTime\",\n      value: function setOutboxTime(timestamp, userId) {\n        if (this._outboxTime > timestamp) {\n          return;\n        }\n\n        this._outboxTime = timestamp;\n        var key = generateKey(OUTBOX_KEY, this._appkey, userId);\n\n        this._runtime.localStorage.setItem(key, timestamp.toString());\n      }\n    }, {\n      key: \"getOutboxTime\",\n      value: function getOutboxTime(userId) {\n        if (this._outboxTime === 0) {\n          var _key11 = generateKey(OUTBOX_KEY, this._appkey, userId);\n\n          this._outboxTime = parseInt(this._runtime.localStorage.getItem(_key11)) || 0;\n        }\n\n        return this._outboxTime;\n      }\n    }]);\n\n    return Letterbox;\n  }();\n\n  var PullTimeCache = {\n    _caches: {},\n    set: function set(chrmId, time) {\n      this._caches[chrmId] = time;\n    },\n    get: function get(chrmId) {\n      return this._caches[chrmId] || 0;\n    },\n    clear: function clear(chrmId) {\n      this._caches[chrmId] = 0;\n    }\n  };\n\n  var KVStore = function () {\n    function KVStore(chatroomId, currentUserId) {\n      _classCallCheck(this, KVStore);\n\n      this._kvCaches = {};\n      this._chatroomId = chatroomId;\n      this._currentUserId = currentUserId;\n    }\n\n    _createClass(KVStore, [{\n      key: \"_add\",\n      value: function _add(kv) {\n        var key = kv.key;\n        kv.isDeleted = false;\n        this._kvCaches[key] = kv;\n      }\n    }, {\n      key: \"_remove\",\n      value: function _remove(kv) {\n        var key = kv.key;\n        var cacheKV = this._kvCaches[key];\n        cacheKV.isDeleted = true;\n        this._kvCaches[key] = cacheKV;\n      }\n    }, {\n      key: \"_setEntry\",\n      value: function _setEntry(data, isFullUpdate) {\n        var key = data.key,\n            type = data.type,\n            isOverwrite = data.isOverwrite,\n            userId = data.userId;\n\n        var latestUserId = this._getSetUserId(key);\n\n        var isDeleteOpt = type === ChatroomEntryType$1.DELETE;\n        var isSameAtLastSetUser = latestUserId === userId;\n        var isKeyNotExist = !this._isExisted(key);\n        var event = isDeleteOpt ? this._remove : this._add;\n\n        if (isFullUpdate) {\n          event.call(this, data);\n        } else if (isOverwrite || isSameAtLastSetUser || isKeyNotExist) {\n          event.call(this, data);\n        } else ;\n      }\n    }, {\n      key: \"getValue\",\n      value: function getValue(key) {\n        var kv = this._kvCaches[key] || {};\n        var isDeleted = kv.isDeleted;\n        return isDeleted ? null : kv.value;\n      }\n    }, {\n      key: \"getAllValue\",\n      value: function getAllValue() {\n        var entries = {};\n\n        for (var _key12 in this._kvCaches) {\n          if (!this._kvCaches[_key12].isDeleted) {\n            entries[_key12] = this._kvCaches[_key12].value;\n          }\n        }\n\n        return entries;\n      }\n    }, {\n      key: \"_getSetUserId\",\n      value: function _getSetUserId(key) {\n        var cache = this._kvCaches[key] || {};\n        return cache.userId;\n      }\n    }, {\n      key: \"_isExisted\",\n      value: function _isExisted(key) {\n        var cache = this._kvCaches[key] || {};\n        var value = cache.value,\n            isDeleted = cache.isDeleted;\n        return value && !isDeleted;\n      }\n    }, {\n      key: \"setEntries\",\n      value: function setEntries(data) {\n        var _this64 = this;\n\n        var kvEntries = data.kvEntries,\n            isFullUpdate = data.isFullUpdate;\n        kvEntries = kvEntries || [];\n        isFullUpdate = isFullUpdate || false;\n        isFullUpdate && this.clear();\n        kvEntries.forEach(function (kv) {\n          _newArrowCheck(this, _this64);\n\n          this._setEntry(kv, isFullUpdate);\n        }.bind(this));\n      }\n    }, {\n      key: \"clear\",\n      value: function clear() {\n        this._kvCaches = {};\n      }\n    }]);\n\n    return KVStore;\n  }();\n\n  var ChrmEntryHandler = function () {\n    function ChrmEntryHandler(engine) {\n      _classCallCheck(this, ChrmEntryHandler);\n\n      this._pullQueue = [];\n      this._isPulling = false;\n      this._storeCaches = {};\n      this._engine = engine;\n    }\n\n    _createClass(ChrmEntryHandler, [{\n      key: \"_startPull\",\n      value: function _startPull() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee14() {\n          var _this$_pullQueue$spli, chrmId, timestamp, pulledUpTime, _yield$this$_engine$p, code, data;\n\n          return regeneratorRuntime.wrap(function _callee14$(_context16) {\n            while (1) {\n              switch (_context16.prev = _context16.next) {\n                case 0:\n                  if (!(this._isPulling || this._pullQueue.length === 0)) {\n                    _context16.next = 2;\n                    break;\n                  }\n\n                  return _context16.abrupt(\"return\");\n\n                case 2:\n                  this._isPulling = true;\n                  _this$_pullQueue$spli = this._pullQueue.splice(0, 1)[0], chrmId = _this$_pullQueue$spli.chrmId, timestamp = _this$_pullQueue$spli.timestamp;\n                  pulledUpTime = PullTimeCache.get(chrmId);\n\n                  if (!(pulledUpTime > timestamp)) {\n                    _context16.next = 8;\n                    break;\n                  }\n\n                  this._isPulling = false;\n                  return _context16.abrupt(\"return\");\n\n                case 8:\n                  _context16.next = 10;\n                  return this._engine.pullChatroomEntry(chrmId, timestamp);\n\n                case 10:\n                  _yield$this$_engine$p = _context16.sent;\n                  code = _yield$this$_engine$p.code;\n                  data = _yield$this$_engine$p.data;\n\n                  if (code === ErrorCode$1.SUCCESS) {\n                    this._isPulling = false;\n                    PullTimeCache.set(chrmId, data.syncTime || 0);\n\n                    this._startPull();\n                  } else {\n                    this._startPull();\n                  }\n\n                case 14:\n                case \"end\":\n                  return _context16.stop();\n              }\n            }\n          }, _callee14, this);\n        }));\n      }\n    }, {\n      key: \"reset\",\n      value: function reset(chrmId) {\n        PullTimeCache.clear(chrmId);\n        var kvStore = this._storeCaches[chrmId];\n        kvStore.clear();\n      }\n    }, {\n      key: \"pullEntry\",\n      value: function pullEntry(chrmId, timestamp) {\n        this._pullQueue.push({\n          chrmId: chrmId,\n          timestamp: timestamp\n        });\n\n        this._startPull();\n      }\n    }, {\n      key: \"setLocal\",\n      value: function setLocal(chrmId, data, userId) {\n        var kvStore = this._storeCaches[chrmId];\n\n        if (!notEmptyObject(kvStore)) {\n          kvStore = new KVStore(chrmId, userId);\n        }\n\n        kvStore.setEntries(data);\n        this._storeCaches[chrmId] = kvStore;\n      }\n    }, {\n      key: \"getValue\",\n      value: function getValue(chrmId, key) {\n        var kvStore = this._storeCaches[chrmId];\n        return kvStore ? kvStore.getValue(key) : null;\n      }\n    }, {\n      key: \"getAll\",\n      value: function getAll(chrmId) {\n        var kvStore = this._storeCaches[chrmId];\n        var entries = {};\n\n        if (kvStore) {\n          entries = kvStore.getAllValue();\n        }\n\n        return entries;\n      }\n    }]);\n\n    return ChrmEntryHandler;\n  }();\n\n  var JoinedChrmManager = function () {\n    function JoinedChrmManager(_runtime, _appkey, _userId, _canJoinMulipleChrm) {\n      _classCallCheck(this, JoinedChrmManager);\n\n      this._runtime = _runtime;\n      this._appkey = _appkey;\n      this._userId = _userId;\n      this._canJoinMulipleChrm = _canJoinMulipleChrm;\n      this._sessionKey = '';\n      this._joinedChrmsInfo = {};\n      this._sessionKey = \"sync-chrm-\".concat(this._appkey, \"-\").concat(this._userId);\n    }\n\n    _createClass(JoinedChrmManager, [{\n      key: \"set\",\n      value: function set(chrmId) {\n        var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n        !this._canJoinMulipleChrm && (this._joinedChrmsInfo = {});\n        this._joinedChrmsInfo[chrmId] = count;\n\n        this._runtime.sessionStorage.setItem(this._sessionKey, JSON.stringify(this._joinedChrmsInfo));\n      }\n    }, {\n      key: \"get\",\n      value: function get() {\n        var infos;\n\n        try {\n          infos = this._runtime.sessionStorage.getItem(this._sessionKey);\n        } catch (err) {\n          logger.error('parse rejoined chrm infos error', err);\n          infos = {};\n        }\n\n        return infos;\n      }\n    }, {\n      key: \"remove\",\n      value: function remove(chrmId) {\n        delete this._joinedChrmsInfo[chrmId];\n\n        if (notEmptyObject(this._joinedChrmsInfo)) {\n          this._runtime.sessionStorage.setItem(this._sessionKey, JSON.stringify(this._joinedChrmsInfo));\n        } else {\n          this.clear();\n        }\n      }\n    }, {\n      key: \"clear\",\n      value: function clear() {\n        this._joinedChrmsInfo = {};\n\n        this._runtime.sessionStorage.removeItem(this._sessionKey);\n      }\n    }]);\n\n    return JoinedChrmManager;\n  }();\n\n  var EventDispatcher = function () {\n    function EventDispatcher() {\n      _classCallCheck(this, EventDispatcher);\n\n      this._map = {};\n    }\n\n    _createClass(EventDispatcher, [{\n      key: \"on\",\n      value: function on(eventType, listener) {\n        var arr = this._map[eventType] || (this._map[eventType] = []);\n\n        if (arr.includes(listener)) {\n          return;\n        }\n\n        arr.push(listener);\n      }\n    }, {\n      key: \"off\",\n      value: function off(eventType, listener) {\n        var arr = this._map[eventType];\n\n        if (!arr) {\n          return;\n        }\n\n        var len = arr.length;\n\n        for (var i = len - 1; i >= 0; i -= 1) {\n          if (arr[i] === listener) {\n            arr.splice(i, 1);\n\n            if (len === 1) {\n              delete this._map[eventType];\n            }\n\n            break;\n          }\n        }\n      }\n    }, {\n      key: \"emit\",\n      value: function emit(eventType, data) {\n        var _this65 = this;\n\n        var arr = this._map[eventType];\n\n        if (!arr) {\n          return;\n        }\n\n        arr.forEach(function (item) {\n          _newArrowCheck(this, _this65);\n\n          return item(data);\n        }.bind(this));\n      }\n    }, {\n      key: \"removeAll\",\n      value: function removeAll(eventType) {\n        delete this._map[eventType];\n      }\n    }, {\n      key: \"clear\",\n      value: function clear() {\n        Object.keys(this._map).forEach(this.removeAll, this);\n      }\n    }]);\n\n    return EventDispatcher;\n  }();\n\n  var EventName = {\n    STATUS_CHANGED: 'converStatusChanged'\n  };\n\n  var ConversationStatus = function () {\n    function ConversationStatus(engine, appkey, currentUserId) {\n      _classCallCheck(this, ConversationStatus);\n\n      this._eventEmitter = new EventDispatcher();\n      this._pullQueue = [];\n      this._isPulling = false;\n      this._storage = createRootStorage(engine.runtime);\n      this._appkey = appkey;\n      this._currentUserId = currentUserId;\n      this._engine = engine;\n      this._storagePullTimeKey = \"con-s-\".concat(appkey, \"-\").concat(currentUserId);\n    }\n\n    _createClass(ConversationStatus, [{\n      key: \"_set\",\n      value: function _set(list) {\n        var _this66 = this;\n\n        if (isUndefined(list)) {\n          return;\n        }\n\n        var localTime = this._storage.get(this._storagePullTimeKey) || 0;\n        var listCount = list.length;\n        list.forEach(function (statusItem, index) {\n          _newArrowCheck(this, _this66);\n\n          var updatedTime = statusItem.updatedTime || 0;\n          localTime = updatedTime > localTime ? updatedTime : localTime;\n          statusItem.conversationType = statusItem.type;\n\n          this._eventEmitter.emit(EventName.STATUS_CHANGED, {\n            statusItem: statusItem,\n            isLastPull: index === listCount - 1\n          });\n        }.bind(this));\n\n        this._storage.set(this._storagePullTimeKey, localTime);\n      }\n    }, {\n      key: \"_startPull\",\n      value: function _startPull() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee15() {\n          var time, _yield$this$_engine$p2, code, data;\n\n          return regeneratorRuntime.wrap(function _callee15$(_context17) {\n            while (1) {\n              switch (_context17.prev = _context17.next) {\n                case 0:\n                  if (!(this._isPulling || this._pullQueue.length === 0)) {\n                    _context17.next = 2;\n                    break;\n                  }\n\n                  return _context17.abrupt(\"return\");\n\n                case 2:\n                  this._isPulling = true;\n                  time = this._pullQueue.splice(0, 1)[0];\n                  _context17.next = 6;\n                  return this._engine.pullConversationStatus(time);\n\n                case 6:\n                  _yield$this$_engine$p2 = _context17.sent;\n                  code = _yield$this$_engine$p2.code;\n                  data = _yield$this$_engine$p2.data;\n\n                  if (code === ErrorCode$1.SUCCESS) {\n                    this._isPulling = false;\n\n                    this._set(data);\n\n                    this._startPull();\n                  } else {\n                    this._startPull();\n                  }\n\n                case 10:\n                case \"end\":\n                  return _context17.stop();\n              }\n            }\n          }, _callee15, this);\n        }));\n      }\n    }, {\n      key: \"pull\",\n      value: function pull(newPullTime) {\n        var time = this._storage.get(this._storagePullTimeKey) || 0;\n\n        if (newPullTime > time || newPullTime === 0) {\n          this._pullQueue.push(time);\n\n          this._startPull();\n        }\n      }\n    }, {\n      key: \"watch\",\n      value: function watch(event) {\n        var _this67 = this;\n\n        this._eventEmitter.on(EventName.STATUS_CHANGED, function (data) {\n          _newArrowCheck(this, _this67);\n\n          event(data);\n        }.bind(this));\n      }\n    }, {\n      key: \"unwatch\",\n      value: function unwatch() {\n        var _this68 = this;\n\n        this._eventEmitter.off(EventName.STATUS_CHANGED, function (data) {\n          _newArrowCheck(this, _this68);\n        }.bind(this));\n      }\n    }]);\n\n    return ConversationStatus;\n  }();\n\n  var StorageKey2ConversationKey = {\n    c: {\n      keyName: 'unreadMessageCount',\n      defaultVal: 0\n    },\n    hm: {\n      keyName: 'hasMentioned',\n      defaultVal: false\n    },\n    m: {\n      keyName: 'mentionedInfo',\n      defaultVal: null\n    },\n    t: {\n      keyName: 'lastUnreadTime',\n      defaultVal: 0\n    },\n    nc: {\n      keyName: 'notificationStatus',\n      defaultVal: 2\n    },\n    to: {\n      keyName: 'isTop',\n      defaultVal: false\n    }\n  };\n  var ConversationKey2StorageKey = {};\n\n  for (var _key13 in StorageKey2ConversationKey) {\n    var keyName = StorageKey2ConversationKey[_key13].keyName;\n    ConversationKey2StorageKey[keyName] = _key13;\n  }\n\n  var ConversationStore = function () {\n    function ConversationStore(runtime, _appkey, _currentUserId) {\n      _classCallCheck(this, ConversationStore);\n\n      this._appkey = _appkey;\n      this._currentUserId = _currentUserId;\n      var suffix = \"con-\".concat(_appkey, \"-\").concat(_currentUserId);\n      this.storage = new AppStorage(runtime, suffix);\n    }\n\n    _createClass(ConversationStore, [{\n      key: \"_getStoreKey\",\n      value: function _getStoreKey(type, targetId) {\n        return \"\".concat(type, \"_\").concat(targetId);\n      }\n    }, {\n      key: \"_getConOptionByKey\",\n      value: function _getConOptionByKey(key) {\n        key = key || '';\n        var arr = key.split('_');\n\n        if (arr.length === 2) {\n          return {\n            conversationType: arr[0],\n            targetId: arr[1]\n          };\n        } else {\n          return {\n            conversationType: ConversationType$1.PRIVATE,\n            targetId: ''\n          };\n        }\n      }\n    }, {\n      key: \"updateMentionedData\",\n      value: function updateMentionedData(message) {\n        var _this69 = this;\n\n        var conversationType = message.conversationType,\n            targetId = message.targetId,\n            messageType = message.messageType,\n            isMentioned = message.isMentioned,\n            content = message.content,\n            senderUserId = message.senderUserId;\n\n        var key = this._getStoreKey(conversationType, targetId);\n\n        var local = this.storage.get(key) || {};\n        var storageMetionedInfoKey = ConversationKey2StorageKey.mentionedInfo;\n        var storageHasMentionedKey = ConversationKey2StorageKey.hasMentioned;\n        var updatedUserIdList = [];\n        var localMentionedInfo = local[storageMetionedInfoKey] || {};\n        var localUserIdList = localMentionedInfo.userIdList || [];\n        var mentionedInfo = content.mentionedInfo;\n\n        if (isMentioned && conversationType === ConversationType$1.GROUP && mentionedInfo.userIdList) {\n          var receiveUserIdList = mentionedInfo.userIdList;\n          var isNotIncludeSender = localUserIdList.indexOf(senderUserId) < 0;\n          receiveUserIdList.forEach(function (userId) {\n            _newArrowCheck(this, _this69);\n\n            if (userId === this._currentUserId && isNotIncludeSender) {\n              localUserIdList.push(senderUserId);\n            }\n          }.bind(this));\n\n          if (mentionedInfo.type === MentionedType$1.ALL && localUserIdList.indexOf(senderUserId) < 0) {\n            localUserIdList.push(senderUserId);\n          }\n\n          updatedUserIdList = localUserIdList;\n        }\n\n        if (messageType === MessageType$1.RECALL && conversationType === ConversationType$1.GROUP) {\n          var list = localUserIdList;\n          localUserIdList.forEach(function (userId, index) {\n            _newArrowCheck(this, _this69);\n\n            if (userId === senderUserId) {\n              list.splice(index, 1);\n            }\n          }.bind(this));\n          updatedUserIdList = list;\n        }\n\n        mentionedInfo = {\n          userIdList: updatedUserIdList,\n          type: mentionedInfo === null || mentionedInfo === void 0 ? void 0 : mentionedInfo.type\n        };\n\n        if (updatedUserIdList.length !== 0) {\n          local[storageMetionedInfoKey] = mentionedInfo;\n          local[storageHasMentionedKey] = true;\n        } else {\n          delete local[storageMetionedInfoKey];\n          delete local[storageHasMentionedKey];\n        }\n\n        if (notEmptyObject(local)) {\n          this.storage.set(key, local);\n        } else {\n          this.storage.remove(key);\n        }\n      }\n    }, {\n      key: \"set\",\n      value: function set(type, targetId, conversation) {\n        var key = this._getStoreKey(type, targetId);\n\n        var local = this.storage.get(key) || {};\n\n        for (var _key14 in conversation) {\n          var storageKey = ConversationKey2StorageKey[_key14];\n          var val = conversation[_key14];\n\n          if (isUndefined(storageKey) || isUndefined(val) || _key14 === 'hasMentioned' || _key14 === 'MentionedInfo') {\n            continue;\n          }\n\n          var defaultVal = StorageKey2ConversationKey[storageKey].defaultVal;\n\n          if (val === defaultVal) {\n            delete local[storageKey];\n          } else {\n            local[storageKey] = val;\n          }\n\n          if (!local.c) {\n            delete local.t;\n          }\n        }\n\n        if (notEmptyObject(local)) {\n          this.storage.set(key, local);\n        } else {\n          this.storage.remove(key);\n        }\n      }\n    }, {\n      key: \"get\",\n      value: function get(type, targetId) {\n        var key = this._getStoreKey(type, targetId);\n\n        var local = this.storage.get(key) || {};\n        var conversation = {};\n\n        for (var _key15 in StorageKey2ConversationKey) {\n          var _StorageKey2Conversat = StorageKey2ConversationKey[_key15],\n              _keyName = _StorageKey2Conversat.keyName,\n              defaultVal = _StorageKey2Conversat.defaultVal;\n          conversation[_keyName] = local[_key15] || defaultVal;\n        }\n\n        return conversation;\n      }\n    }, {\n      key: \"getValue\",\n      value: function getValue(func) {\n        var values = this.storage.getValues() || {};\n        var storageConversationList = [];\n\n        for (var _key16 in values) {\n          var _this$_getConOptionBy = this._getConOptionByKey(_key16),\n              conversationType = _this$_getConOptionBy.conversationType,\n              targetId = _this$_getConOptionBy.targetId;\n\n          var conversation = {};\n          var store = values[_key16];\n\n          for (var storeKey in store) {\n            var _StorageKey2Conversat2 = StorageKey2ConversationKey[storeKey],\n                _keyName2 = _StorageKey2Conversat2.keyName,\n                defaultVal = _StorageKey2Conversat2.defaultVal;\n            conversation[_keyName2] = store[storeKey] || defaultVal;\n          }\n\n          conversation = Object.assign(conversation, {\n            conversationType: conversationType,\n            targetId: targetId\n          });\n          conversation = func ? func(conversation) : conversation;\n          storageConversationList.push(conversation);\n        }\n\n        return storageConversationList;\n      }\n    }]);\n\n    return ConversationStore;\n  }();\n\n  var saveConversationType = [ConversationType$1.PRIVATE, ConversationType$1.GROUP, ConversationType$1.SYSTEM];\n  var EventName$1 = {\n    CHANGED: 'conversationChanged'\n  };\n\n  var ConversationManager = function () {\n    function ConversationManager(engine, appkey, userId, updatedConversationFunc) {\n      var _this70 = this;\n\n      _classCallCheck(this, ConversationManager);\n\n      this._updatedConversations = {};\n      this._eventEmitter = new EventDispatcher();\n      this._draftMap = {};\n      this._appkey = appkey;\n      this._loginUserId = userId;\n      this._store = new ConversationStore(engine.runtime, appkey, userId);\n      this._statusManager = new ConversationStatus(engine, appkey, userId);\n\n      this._statusManager.watch(function (data) {\n        _newArrowCheck(this, _this70);\n\n        var statusItem = data.statusItem,\n            isLastPull = data.isLastPull;\n        this.addStatus(statusItem, isLastPull);\n      }.bind(this));\n\n      this._eventEmitter.on(EventName$1.CHANGED, function (data) {\n        _newArrowCheck(this, _this70);\n\n        updatedConversationFunc(data);\n      }.bind(this));\n    }\n\n    _createClass(ConversationManager, [{\n      key: \"_calcUnreadCount\",\n      value: function _calcUnreadCount(message, localConversation) {\n        var content = message.content,\n            messageType = message.messageType,\n            sentTime = message.sentTime,\n            isCounted = message.isCounted,\n            messageDirection = message.messageDirection,\n            senderUserId = message.senderUserId;\n        var isSelfSend = messageDirection === MessageDirection$1.SEND && senderUserId === this._loginUserId;\n        var isRecall = messageType === MessageType$1.RECALL;\n        var hasContent = isObject(content);\n        var hasChanged = false;\n        var lastUnreadTime = localConversation.lastUnreadTime || 0;\n        var unreadMessageCount = localConversation.unreadMessageCount || 0;\n        var hasBeenAdded = lastUnreadTime > sentTime;\n\n        if (hasBeenAdded || isSelfSend) {\n          return {\n            hasChanged: hasChanged,\n            localConversation: localConversation\n          };\n        }\n\n        if (isCounted) {\n          localConversation.unreadMessageCount = unreadMessageCount + 1;\n          localConversation.lastUnreadTime = sentTime;\n          hasChanged = true;\n        }\n\n        if (isRecall && hasContent) {\n          var isNotRead = lastUnreadTime >= content.sentTime;\n\n          if (isNotRead && unreadMessageCount) {\n            localConversation.unreadMessageCount = unreadMessageCount - 1;\n            hasChanged = true;\n          }\n        }\n\n        return {\n          hasChanged: hasChanged,\n          localConversation: localConversation\n        };\n      }\n    }, {\n      key: \"_calcMentionedInfo\",\n      value: function _calcMentionedInfo(message, localConversation) {\n        var content = message.content,\n            messageDirection = message.messageDirection,\n            isMentioned = message.isMentioned;\n        var isSelfSend = messageDirection === MessageDirection$1.SEND;\n        var hasContent = isObject(content);\n        var hasChanged = false;\n\n        if (isMentioned && hasContent && content.mentionedInfo) {\n          localConversation.hasMentioned = true;\n          // localConversation.mentionedInfo = content.mentionedInfo;\n          hasChanged = true;\n        }\n\n        return {\n          hasChanged: hasChanged,\n          localConversation: localConversation\n        };\n      }\n    }, {\n      key: \"_setUpdatedConversation\",\n      value: function _setUpdatedConversation(updatedConOptions) {\n        if (isObject(updatedConOptions)) {\n          var conversationType = updatedConOptions.conversationType,\n              targetId = updatedConOptions.targetId;\n\n          var _key17 = \"\".concat(conversationType, \"_\").concat(targetId);\n\n          var cacheConversation = this._store.get(conversationType, targetId) || {};\n          this._updatedConversations[_key17] = Object.assign(cacheConversation, updatedConOptions);\n        }\n      }\n    }, {\n      key: \"addStatus\",\n      value: function addStatus(statusItem, isLastPull) {\n        var conversationType = statusItem.conversationType,\n            targetId = statusItem.targetId,\n            updatedTime = statusItem.updatedTime,\n            notificationStatus = statusItem.notificationStatus,\n            isTop = statusItem.isTop;\n        var updatedItems = {};\n\n        if (!isUndefined(notificationStatus)) {\n          updatedItems.notificationStatus = {\n            time: updatedTime,\n            val: notificationStatus\n          };\n        }\n\n        if (!isUndefined(isTop)) {\n          updatedItems.isTop = {\n            time: updatedTime,\n            val: isTop\n          };\n        }\n\n        this._store.set(conversationType, targetId, {\n          notificationStatus: notificationStatus,\n          isTop: isTop\n        });\n\n        this._setUpdatedConversation({\n          conversationType: conversationType,\n          targetId: targetId,\n          updatedItems: updatedItems\n        });\n\n        if (isLastPull) {\n          this._notifyConversationChanged();\n        }\n      }\n    }, {\n      key: \"_notifyConversationChanged\",\n      value: function _notifyConversationChanged() {\n        var list = [];\n\n        for (var _key18 in this._updatedConversations) {\n          list.push(this._updatedConversations[_key18]);\n        }\n\n        this._eventEmitter.emit(EventName$1.CHANGED, list);\n\n        this._updatedConversations = {};\n      }\n    }, {\n      key: \"setConversationCacheByMessage\",\n      value: function setConversationCacheByMessage(message, isPullMessageFinished) {\n        var _this71 = this;\n\n        var conversationType = message.conversationType,\n            isPersited = message.isPersited,\n            targetId = message.targetId;\n        var isSaveConversationType = saveConversationType.indexOf(conversationType) >= 0;\n\n        if (!isSaveConversationType) {\n          return;\n        }\n\n        var hasChanged = false;\n\n        var storageConversation = this._store.get(conversationType, targetId);\n\n        var CalcEvents = [this._calcUnreadCount, this._calcMentionedInfo];\n        CalcEvents.forEach(function (func) {\n          _newArrowCheck(this, _this71);\n\n          var _func$call = func.call(this, message, storageConversation),\n              hasCaclChanged = _func$call.hasChanged,\n              localConversation = _func$call.localConversation;\n\n          hasChanged = hasChanged || hasCaclChanged;\n          storageConversation = cloneByJSON(localConversation);\n        }.bind(this));\n\n        if (hasChanged) {\n          this._store.set(conversationType, targetId, storageConversation);\n        }\n\n        this._store.updateMentionedData(message);\n\n        if (isPersited) {\n          var conversation = this._store.get(conversationType, targetId);\n\n          conversation.updatedItems = {\n            latestMessage: {\n              time: message.sentTime,\n              val: message\n            }\n          };\n          conversation.latestMessage = message;\n          var updateConOptions = Object.assign(conversation, {\n            conversationType: conversationType,\n            targetId: targetId\n          });\n\n          this._setUpdatedConversation(updateConOptions);\n        }\n\n        if (isPullMessageFinished) {\n          this._notifyConversationChanged();\n        }\n      }\n    }, {\n      key: \"get\",\n      value: function get(conversationType, targetId) {\n        return this._store.get(conversationType, targetId);\n      }\n    }, {\n      key: \"getAllUnreadCount\",\n      value: function getAllUnreadCount() {\n        var _this72 = this;\n\n        var conversationList = this._store.getValue();\n\n        var totalCount = 0;\n        conversationList.forEach(function (_ref) {\n          _newArrowCheck(this, _this72);\n\n          var unreadMessageCount = _ref.unreadMessageCount;\n          unreadMessageCount = unreadMessageCount || 0;\n          totalCount += Number(unreadMessageCount);\n        }.bind(this));\n        return totalCount;\n      }\n    }, {\n      key: \"getUnreadCount\",\n      value: function getUnreadCount(conversationType, targetId) {\n        var conversation = this._store.get(conversationType, targetId);\n\n        return conversation.unreadMessageCount || 0;\n      }\n    }, {\n      key: \"clearUnreadCount\",\n      value: function clearUnreadCount(conversationType, targetId) {\n        var conversation = this._store.get(conversationType, targetId);\n\n        var unreadMessageCount = conversation.unreadMessageCount,\n            hasMentioned = conversation.hasMentioned;\n\n        if (unreadMessageCount || hasMentioned) {\n          conversation.unreadMessageCount = 0;\n          conversation.hasMentioned = false;\n        }\n\n        this._store.set(conversationType, targetId, conversation);\n\n        var updateConOptions = Object.assign(conversation, {\n          conversationType: conversationType,\n          targetId: targetId\n        });\n\n        this._setUpdatedConversation(updateConOptions);\n\n        this._notifyConversationChanged();\n      }\n    }, {\n      key: \"startPullConversationStatus\",\n      value: function startPullConversationStatus(time) {\n        this._statusManager.pull(time);\n      }\n    }, {\n      key: \"setDraft\",\n      value: function setDraft(conversationType, targetId, draft) {\n        var key = \"\".concat(conversationType, \"_\").concat(targetId);\n        this._draftMap[key] = draft;\n      }\n    }, {\n      key: \"getDraft\",\n      value: function getDraft(conversationType, targetId) {\n        var key = \"\".concat(conversationType, \"_\").concat(targetId);\n        return this._draftMap[key];\n      }\n    }, {\n      key: \"clearDraft\",\n      value: function clearDraft(conversationType, targetId) {\n        var key = \"\".concat(conversationType, \"_\").concat(targetId);\n        delete this._draftMap[key];\n      }\n    }]);\n\n    return ConversationManager;\n  }();\n\n  var UploadMethod;\n\n  (function (UploadMethod) {\n    UploadMethod[UploadMethod[\"QINIU\"] = 1] = \"QINIU\";\n    UploadMethod[UploadMethod[\"ALI\"] = 2] = \"ALI\";\n  })(UploadMethod || (UploadMethod = {}));\n\n  var UploadMethod$1 = UploadMethod;\n\n  var getUploadFileName = function getUploadFileName(type, fileName) {\n    _newArrowCheck(this, _this);\n\n    var random = Math.floor(Math.random() * 1000 % 10000);\n    var uuid = getUUID();\n    var date = formatDate();\n    var timestamp = new Date().getTime();\n    var extension = '';\n\n    if (fileName) {\n      var fileNameArr = fileName.split('.');\n      extension = '.' + fileNameArr[fileNameArr.length - 1];\n    }\n\n    return \"\".concat(type, \"__RC-\").concat(date, \"_\").concat(random, \"_\").concat(timestamp).concat(uuid).concat(extension);\n  }.bind(undefined);\n\n  var getMimeKey = function getMimeKey(fileType) {\n    _newArrowCheck(this, _this);\n\n    var mimeKey = 'application/octet-stream';\n\n    switch (fileType) {\n      case FileType$1.IMAGE:\n        mimeKey = 'image/jpeg';\n        break;\n\n      case FileType$1.AUDIO:\n        mimeKey = 'audio/amr';\n        break;\n\n      case FileType$1.VIDEO:\n        mimeKey = 'video/3gpp';\n        break;\n\n      case FileType$1.SIGHT:\n        mimeKey = 'video/mpeg4';\n        break;\n\n      case FileType$1.COMBINE_HTML:\n        mimeKey = 'text/html';\n        break;\n    }\n\n    return mimeKey;\n  }.bind(undefined);\n\n  var pushConfigsToJSON = function pushConfigsToJSON() {\n    var iOSConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var androidConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var threadId = iOSConfig.threadId,\n        apnsCollapseId = iOSConfig.apnsCollapseId;\n    var channelIdMi = androidConfig.channelIdMi,\n        channelIdHW = androidConfig.channelIdHW,\n        channelIdOPPO = androidConfig.channelIdOPPO,\n        typeVivo = androidConfig.typeVivo;\n    var APNS = {};\n    APNS['thread-id'] = threadId || '';\n    APNS['apns-collapse-id'] = apnsCollapseId || '';\n    var pushCongfigs = [{\n      HW: {\n        channelId: channelIdHW || ''\n      }\n    }, {\n      MI: {\n        channelId: channelIdMi || ''\n      }\n    }, {\n      OPPO: {\n        channelId: channelIdOPPO || ''\n      }\n    }, {\n      VIVO: {\n        classification: typeVivo || ''\n      }\n    }, {\n      APNS: APNS\n    }];\n    return JSON.stringify(pushCongfigs);\n  };\n\n  var getPubTopic = function getPubTopic(type) {\n    var _ConversationType$1$P;\n\n    _newArrowCheck(this, _this);\n\n    return (_ConversationType$1$P = {}, _defineProperty(_ConversationType$1$P, ConversationType$1.PRIVATE, Topic$1.ppMsgP), _defineProperty(_ConversationType$1$P, ConversationType$1.GROUP, Topic$1.pgMsgP), _defineProperty(_ConversationType$1$P, ConversationType$1.CHATROOM, Topic$1.chatMsg), _defineProperty(_ConversationType$1$P, ConversationType$1.CUSTOMER_SERVICE, Topic$1.pcMsgP), _defineProperty(_ConversationType$1$P, ConversationType$1.RTC_ROOM, Topic$1.prMsgS), _ConversationType$1$P)[type];\n  }.bind(undefined);\n\n  var getStatPubTopic = function getStatPubTopic(type) {\n    var _ConversationType$1$P2;\n\n    _newArrowCheck(this, _this);\n\n    return (_ConversationType$1$P2 = {}, _defineProperty(_ConversationType$1$P2, ConversationType$1.PRIVATE, Topic$1.ppMsgS), _defineProperty(_ConversationType$1$P2, ConversationType$1.GROUP, Topic$1.pgMsgS), _ConversationType$1$P2)[type];\n  }.bind(undefined);\n\n  var transSentAttrs2IReceivedMessage = function transSentAttrs2IReceivedMessage(conversationType, targetId, options, messageUId, sentTime, senderUserId) {\n    _newArrowCheck(this, _this);\n\n    return {\n      conversationType: conversationType,\n      targetId: targetId,\n      senderUserId: senderUserId,\n      messageDirection: MessageDirection$1.SEND,\n      isCounted: !!options.isCounted,\n      isMentioned: !!options.isMentioned,\n      content: options.content,\n      messageType: options.messageType,\n      isOffLineMessage: false,\n      isPersited: !!options.isPersited,\n      messageUId: messageUId,\n      sentTime: sentTime,\n      receivedTime: 0,\n      disableNotification: !!options.disableNotification,\n      isStatusMessage: !!options.isStatusMessage,\n      canIncludeExpansion: !!options.canIncludeExpansion,\n      expansion: options.canIncludeExpansion ? options.expansion : null,\n      receivedStatus: ReceivedStatus$1.UNREAD\n    };\n  }.bind(undefined);\n\n  var JSEngine = function (_AEngine) {\n    _inherits(JSEngine, _AEngine);\n\n    var _super18 = _createSuper(JSEngine);\n\n    function JSEngine(runtime, appkey, watcher, apiVersion) {\n      var _this73;\n\n      _classCallCheck(this, JSEngine);\n\n      _this73 = _super18.call(this, runtime, appkey, watcher, apiVersion, {});\n      _this73._customMessageType = {};\n      _this73._pullingMsg = false;\n      _this73._pullQueue = [];\n      _this73._chrmsQueue = {};\n      _this73._letterbox = new Letterbox(runtime, appkey);\n      _this73._chrmEntryHandler = new ChrmEntryHandler(_assertThisInitialized(_this73));\n      return _this73;\n    }\n\n    _createClass(JSEngine, [{\n      key: \"connect\",\n      value: function connect(token, naviInfo, connectType) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee16() {\n          var _this74 = this;\n\n          var hosts, backupServer, channel, code;\n          return regeneratorRuntime.wrap(function _callee16$(_context18) {\n            while (1) {\n              switch (_context18.prev = _context18.next) {\n                case 0:\n                  hosts = [];\n                  this._naviInfo = naviInfo;\n\n                  if (naviInfo.server) {\n                    hosts.push(naviInfo.server);\n                  } else {\n                    logger.warn('navi.server is invalid');\n                  }\n\n                  backupServer = naviInfo.backupServer;\n                  backupServer && backupServer.split(',').forEach(function (host) {\n                    _newArrowCheck(this, _this74);\n\n                    if (hosts.indexOf(host) < 0) {\n                      hosts.push(host);\n                    }\n                  }.bind(this));\n\n                  if (!(hosts.length === 0)) {\n                    _context18.next = 8;\n                    break;\n                  }\n\n                  logger.error('navi invaild.', hosts);\n                  return _context18.abrupt(\"return\", ErrorCode$1.UNKNOWN);\n\n                case 8:\n                  channel = this.runtime.createDataChannel({\n                    status: function status(_status) {\n                      _newArrowCheck(this, _this74);\n\n                      this._connectionStatusHandler(_status, token, hosts, naviInfo.protocol);\n                    }.bind(this),\n                    signal: this._signalHandler.bind(this)\n                  }, connectType);\n                  _context18.next = 11;\n                  return channel.connect(this._appkey, token, hosts, naviInfo.protocol, this._apiVersion);\n\n                case 11:\n                  code = _context18.sent;\n\n                  if (code === ErrorCode$1.SUCCESS) {\n                    this._channel = channel;\n                    this.currentUserId = channel.userId;\n                    this.connectedTime = channel.connectedTime;\n                    this._conversationManager = new ConversationManager(this, this._appkey, this.currentUserId, this._watcher.conversation);\n\n                    this._conversationManager.startPullConversationStatus(0);\n\n                    this._joinedChrmManager = new JoinedChrmManager(this.runtime, this._appkey, this.currentUserId, naviInfo.joinMChrm);\n\n                    this._syncMsg();\n                  } else {\n                    channel.close();\n                  }\n\n                  return _context18.abrupt(\"return\", code);\n\n                case 14:\n                case \"end\":\n                  return _context18.stop();\n              }\n            }\n          }, _callee16, this);\n        }));\n      }\n    }, {\n      key: \"_connectionStatusHandler\",\n      value: function _connectionStatusHandler(status, token, hosts, protocol) {\n        logger.warn('connection status changed:', status);\n\n        if (status === ConnectionStatus$1.CONNECTING || status === ConnectionStatus$1.CONNECTED) {\n          this._watcher.status(status);\n\n          return;\n        }\n\n        if (!this._channel || status === ConnectionStatus$1.DISCONNECTED) {\n          this._watcher.status(status);\n\n          return;\n        }\n\n        if (status === ConnectionStatus$1.BLOCKED || status === ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT) {\n          this.disconnect();\n\n          this._watcher.status(status);\n\n          return;\n        }\n\n        this._try2Reconnect(token, hosts, protocol);\n      }\n    }, {\n      key: \"_try2Reconnect\",\n      value: function _try2Reconnect(token, hosts, protocol) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee17() {\n          var _this75 = this;\n\n          var code;\n          return regeneratorRuntime.wrap(function _callee17$(_context19) {\n            while (1) {\n              switch (_context19.prev = _context19.next) {\n                case 0:\n                  if (this._channel) {\n                    _context19.next = 2;\n                    break;\n                  }\n\n                  return _context19.abrupt(\"return\");\n\n                case 2:\n                  _context19.next = 4;\n                  return this._channel.connect(this._appkey, token, hosts, protocol, this._apiVersion);\n\n                case 4:\n                  code = _context19.sent;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context19.next = 8;\n                    break;\n                  }\n\n                  this._rejoinChrm();\n\n                  return _context19.abrupt(\"return\");\n\n                case 8:\n                  this._watcher.status(ConnectionStatus$1.WEBSOCKET_UNAVAILABLE);\n\n                  setTimeout(function () {\n                    _newArrowCheck(this, _this75);\n\n                    this._try2Reconnect(token, hosts, protocol);\n                  }.bind(this), 5000);\n\n                case 10:\n                case \"end\":\n                  return _context19.stop();\n              }\n            }\n          }, _callee17, this);\n        }));\n      }\n    }, {\n      key: \"_signalHandler\",\n      value: function _signalHandler(signal, ack) {\n        var syncMsg = signal.syncMsg,\n            topic = signal.topic;\n\n        if (syncMsg) {\n          this._receiveSyncMsg(signal, ack);\n\n          return;\n        }\n\n        var tmpTopic = Topic$1[topic];\n\n        if (!tmpTopic) {\n          logger.error('unknown topic:', topic);\n          return;\n        }\n\n        switch (tmpTopic) {\n          case Topic$1.s_ntf:\n            this._pullMsg(signal);\n\n            break;\n\n          case Topic$1.s_msg:\n            this._receiveMsg(signal);\n\n            break;\n\n          case Topic$1.s_cmd:\n            this._receiveStateNotify(signal);\n\n            break;\n\n          case Topic$1.s_us:\n            this._receiveSettingNotify(signal);\n\n            break;\n        }\n      }\n    }, {\n      key: \"_receiveStateNotify\",\n      value: function _receiveStateNotify(signal) {\n        var _a;\n\n        var _ref2 = (_a = this._channel) === null || _a === void 0 ? void 0 : _a.codec.decodeByPBName(signal.data, PBName.NotifyMsg),\n            time = _ref2.time,\n            type = _ref2.type,\n            chrmId = _ref2.chrmId;\n\n        switch (type) {\n          case 2:\n            logger.warn('server notify chrm:', chrmId, time);\n\n            this._chrmEntryHandler.pullEntry(chrmId, time);\n\n            break;\n\n          case 3:\n            this._conversationManager.startPullConversationStatus(time);\n\n            break;\n        }\n      }\n    }, {\n      key: \"_receiveSettingNotify\",\n      value: function _receiveSettingNotify(signal) {}\n    }, {\n      key: \"_receiveMessageExpansion\",\n      value: function _receiveMessageExpansion(message) {\n        var content = message.content;\n        var put = content.put,\n            del = content.del,\n            mid = content.mid;\n\n        if (put) {\n          this._watcher.expansion({\n            updatedExpansion: {\n              messageUId: mid,\n              expansion: put\n            }\n          });\n        }\n\n        if (del) {\n          this._watcher.expansion({\n            deletedExpansion: {\n              messageUId: mid,\n              deletedKeys: del\n            }\n          });\n        }\n      }\n    }, {\n      key: \"_receiveSyncMsg\",\n      value: function _receiveSyncMsg(signal, ack) {\n        var _a;\n\n        var msg = (_a = this._channel) === null || _a === void 0 ? void 0 : _a.codec.decodeByPBName(signal.data, PBName.UpStreamMessage, {\n          currentUserId: this.currentUserId,\n          signal: signal\n        });\n        msg = this._handleMsgProperties(msg);\n        msg.sentTime = ack.timestamp;\n        msg.messageUId = ack.messageUId;\n\n        if (this._pullingMsg) {\n          this._pullQueue.push(ack.timestamp);\n\n          return;\n        }\n\n        this._letterbox.setOutboxTime(ack.timestamp, this.currentUserId);\n\n        if (msg.messageType === MessageType$1.EXPANSION_NOTIFY) {\n          this._receiveMessageExpansion(msg);\n\n          return;\n        }\n\n        this._watcher.message(msg);\n\n        this._conversationManager.setConversationCacheByMessage(msg, true);\n      }\n    }, {\n      key: \"_pullMsg\",\n      value: function _pullMsg(signal) {\n        if (!this._channel) {\n          return;\n        }\n\n        var _this$_channel$codec$ = this._channel.codec.decodeByPBName(signal.data, PBName.NotifyMsg),\n            type = _this$_channel$codec$.type,\n            chrmId = _this$_channel$codec$.chrmId,\n            time = _this$_channel$codec$.time;\n\n        if (type === 2) {\n          var info = this._chrmsQueue[chrmId];\n          info.queue.push(time);\n\n          this._pullChrmMsg(chrmId);\n        } else {\n          this._pullQueue.push(time);\n\n          this._syncMsg();\n        }\n      }\n    }, {\n      key: \"_syncMsg\",\n      value: function _syncMsg() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee18() {\n          var _this76 = this,\n              _this$_pullQueue;\n\n          var outboxTime, inboxTime, reqBody, writer, _yield$this$_channel$, code, data, list, finished, syncTime, newOutboxTime, tmpPullQueue;\n\n          return regeneratorRuntime.wrap(function _callee18$(_context20) {\n            while (1) {\n              switch (_context20.prev = _context20.next) {\n                case 0:\n                  if (!this._pullingMsg) {\n                    _context20.next = 2;\n                    break;\n                  }\n\n                  return _context20.abrupt(\"return\");\n\n                case 2:\n                  if (this._channel) {\n                    _context20.next = 5;\n                    break;\n                  }\n\n                  this._pullingMsg = false;\n                  return _context20.abrupt(\"return\");\n\n                case 5:\n                  this._pullingMsg = true;\n                  outboxTime = this._letterbox.getOutboxTime(this.currentUserId);\n                  inboxTime = this._letterbox.getInboxTime(this.currentUserId);\n                  logger.warn('outboxTime', outboxTime);\n                  logger.warn('inboxTime', inboxTime);\n                  reqBody = this._channel.codec.encodeSyncMsg({\n                    sendboxTime: outboxTime,\n                    inboxTime: inboxTime\n                  });\n                  writer = new QueryWriter(Topic$1[Topic$1.pullMsg], reqBody, this.currentUserId);\n                  _context20.next = 14;\n                  return this._channel.send(writer, PBName.DownStreamMessages, {\n                    connectedTime: this._channel.connectedTime,\n                    currentUserId: this.currentUserId\n                  });\n\n                case 14:\n                  _yield$this$_channel$ = _context20.sent;\n                  code = _yield$this$_channel$.code;\n                  data = _yield$this$_channel$.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS || !data)) {\n                    _context20.next = 21;\n                    break;\n                  }\n\n                  logger.warn('Pull msg failed, code:', code, ', data: ', data);\n                  this._pullingMsg = false;\n                  return _context20.abrupt(\"return\");\n\n                case 21:\n                  list = data.list, finished = data.finished, syncTime = data.syncTime;\n                  newOutboxTime = 0;\n                  list.forEach(function (item) {\n                    _newArrowCheck(this, _this76);\n\n                    if (item.messageDirection === MessageDirection$1.SEND) {\n                      newOutboxTime = Math.max(item.sentTime, newOutboxTime);\n                    }\n\n                    if (item.messageType === MessageType$1.EXPANSION_NOTIFY) {\n                      this._receiveMessageExpansion(item);\n\n                      return;\n                    }\n\n                    this._watcher.message(item);\n\n                    this._conversationManager.setConversationCacheByMessage(item, true);\n                  }.bind(this));\n\n                  this._letterbox.setInboxTime(syncTime, this.currentUserId);\n\n                  this._letterbox.setOutboxTime(newOutboxTime, this.currentUserId);\n\n                  this._pullingMsg = false;\n                  tmpPullQueue = this._pullQueue.filter(function (timestamp) {\n                    _newArrowCheck(this, _this76);\n\n                    return timestamp > syncTime;\n                  }.bind(this));\n                  this._pullQueue.length = 0;\n\n                  (_this$_pullQueue = this._pullQueue).push.apply(_this$_pullQueue, _toConsumableArray(tmpPullQueue));\n\n                  if (!finished || tmpPullQueue.length > 0) {\n                    this._syncMsg();\n                  }\n\n                case 31:\n                case \"end\":\n                  return _context20.stop();\n              }\n            }\n          }, _callee18, this);\n        }));\n      }\n    }, {\n      key: \"_receiveMsg\",\n      value: function _receiveMsg(signal) {\n        if (!this._channel) {\n          return;\n        }\n\n        var msg = this._channel.codec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n          currentUserId: this.currentUserId,\n          connectedTime: this._channel.connectedTime\n        });\n\n        msg = this._handleMsgProperties(msg);\n\n        if (this._pullingMsg) {\n          return;\n        }\n\n        this._letterbox.setInboxTime(msg.sentTime, this.currentUserId);\n\n        if (msg.messageType === MessageType$1.EXPANSION_NOTIFY) {\n          this._receiveMessageExpansion(msg);\n\n          return;\n        }\n\n        this._watcher.message(msg);\n\n        this._conversationManager.setConversationCacheByMessage(msg, true);\n      }\n    }, {\n      key: \"_handleMsgProperties\",\n      value: function _handleMsgProperties(msgOptions) {\n        var isSendMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n        var messageType = msgOptions.messageType,\n            isCounted = msgOptions.isCounted,\n            isPersited = msgOptions.isPersited,\n            isStatusMessage = msgOptions.isStatusMessage;\n        var options;\n        var inRCMessageType = (messageType in SEND_MESSAGE_TYPE_OPTION);\n        var inCustomMessageType = (messageType in this._customMessageType);\n\n        if (inRCMessageType) {\n          options = SEND_MESSAGE_TYPE_OPTION[messageType];\n        } else if (inCustomMessageType) {\n          options = this._customMessageType[messageType];\n        } else {\n          options = {\n            isCounted: isNull(isCounted) ? false : isCounted,\n            isPersited: isNull(isPersited) ? false : isPersited\n          };\n        }\n\n        Object.assign(msgOptions, {\n          isCounted: options.isCounted,\n          isPersited: options.isPersited,\n          isStatusMessage: !(msgOptions.isCounted && msgOptions.isPersited)\n        });\n        isSendMsg && (msgOptions.isStatusMessage = isStatusMessage);\n        return msgOptions;\n      }\n    }, {\n      key: \"getConnectTime\",\n      value: function getConnectTime() {\n        if (this._channel) {\n          return Promise.resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: this._channel.connectedTime\n          });\n        }\n\n        return Promise.resolve({\n          code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n        });\n      }\n    }, {\n      key: \"getHistoryMessage\",\n      value: function getHistoryMessage(conversationType, targetId, timestamp, count, order) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee19() {\n          var currentUserId, channel, hisTopic, data, resp, code, downstreamData;\n          return regeneratorRuntime.wrap(function _callee19$(_context21) {\n            while (1) {\n              switch (_context21.prev = _context21.next) {\n                case 0:\n                  currentUserId = this.currentUserId, channel = this._channel;\n                  hisTopic = ConversationTypeToQueryHistoryTopic[conversationType] || QueryHistoryTopic.PRIVATE;\n\n                  if (!channel) {\n                    _context21.next = 12;\n                    break;\n                  }\n\n                  data = channel.codec.encodeGetHistoryMsg(targetId, {\n                    timestamp: timestamp,\n                    count: count,\n                    order: order\n                  });\n                  _context21.next = 6;\n                  return channel.send(new QueryWriter(hisTopic, data, currentUserId), PBName.HistoryMsgOuput, {\n                    currentUserId: currentUserId,\n                    connectedTime: channel.connectedTime,\n                    conversation: {\n                      targetId: targetId\n                    }\n                  });\n\n                case 6:\n                  resp = _context21.sent;\n                  code = resp.code;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context21.next = 10;\n                    break;\n                  }\n\n                  return _context21.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 10:\n                  downstreamData = resp.data;\n                  return _context21.abrupt(\"return\", {\n                    code: code,\n                    data: {\n                      list: downstreamData.list,\n                      hasMore: downstreamData.hasMore\n                    }\n                  });\n\n                case 12:\n                  return _context21.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 13:\n                case \"end\":\n                  return _context21.stop();\n              }\n            }\n          }, _callee19, this);\n        }));\n      }\n    }, {\n      key: \"deleteRemoteMessage\",\n      value: function deleteRemoteMessage(conversationType, targetId, list) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee20() {\n          var currentUserId, channel, data, writer, resp, code;\n          return regeneratorRuntime.wrap(function _callee20$(_context22) {\n            while (1) {\n              switch (_context22.prev = _context22.next) {\n                case 0:\n                  currentUserId = this.currentUserId, channel = this._channel;\n\n                  if (!channel) {\n                    _context22.next = 11;\n                    break;\n                  }\n\n                  data = channel.codec.encodeDeleteMessages(conversationType, targetId, list);\n                  writer = new QueryWriter(QueryTopic.DELETE_MESSAGES, data, currentUserId);\n                  _context22.next = 6;\n                  return channel.send(writer);\n\n                case 6:\n                  resp = _context22.sent;\n                  code = resp.code;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context22.next = 10;\n                    break;\n                  }\n\n                  return _context22.abrupt(\"return\", code);\n\n                case 10:\n                  return _context22.abrupt(\"return\", code);\n\n                case 11:\n                  return _context22.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 12:\n                case \"end\":\n                  return _context22.stop();\n              }\n            }\n          }, _callee20, this);\n        }));\n      }\n    }, {\n      key: \"deleteRemoteMessageByTimestamp\",\n      value: function deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee21() {\n          var currentUserId, channel, data, topic, writer, resp, code;\n          return regeneratorRuntime.wrap(function _callee21$(_context23) {\n            while (1) {\n              switch (_context23.prev = _context23.next) {\n                case 0:\n                  currentUserId = this.currentUserId, channel = this._channel;\n\n                  if (!channel) {\n                    _context23.next = 12;\n                    break;\n                  }\n\n                  data = channel.codec.encodeClearMessages(targetId, timestamp);\n                  topic = ConversationTypeToClearMessageTopic[conversationType];\n                  writer = new QueryWriter(topic, data, currentUserId);\n                  _context23.next = 7;\n                  return channel.send(writer);\n\n                case 7:\n                  resp = _context23.sent;\n                  code = resp.code;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context23.next = 11;\n                    break;\n                  }\n\n                  return _context23.abrupt(\"return\", code);\n\n                case 11:\n                  return _context23.abrupt(\"return\", code);\n\n                case 12:\n                  return _context23.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 13:\n                case \"end\":\n                  return _context23.stop();\n              }\n            }\n          }, _callee21, this);\n        }));\n      }\n    }, {\n      key: \"getConversationList\",\n      value: function getConversationList() {\n        var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;\n        var conversationType = arguments.length > 1 ? arguments[1] : undefined;\n        var startTime = arguments.length > 2 ? arguments[2] : undefined;\n        var order = arguments.length > 3 ? arguments[3] : undefined;\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee22() {\n          var _this77 = this;\n\n          var currentUserId, channel, buff, writer, resp, code, data;\n          return regeneratorRuntime.wrap(function _callee22$(_context24) {\n            while (1) {\n              switch (_context24.prev = _context24.next) {\n                case 0:\n                  currentUserId = this.currentUserId, channel = this._channel;\n                  conversationType = conversationType || ConversationType$1.PRIVATE;\n\n                  if (!channel) {\n                    _context24.next = 13;\n                    break;\n                  }\n\n                  buff = channel.codec.encodeOldConversationList({\n                    count: count,\n                    type: conversationType,\n                    startTime: startTime,\n                    order: order\n                  });\n                  writer = new QueryWriter(QueryTopic.GET_OLD_CONVERSATION_LIST, buff, currentUserId);\n                  _context24.next = 7;\n                  return channel.send(writer, PBName.RelationsOutput, {\n                    currentUserId: currentUserId,\n                    connectedTime: channel.connectedTime,\n                    afterDecode: function afterDecode(conversation) {\n                      _newArrowCheck(this, _this77);\n\n                      var conversationType = conversation.conversationType,\n                          targetId = conversation.targetId;\n\n                      var localConversation = this._conversationManager.get(conversationType, targetId);\n\n                      Object.assign(conversation, localConversation);\n                      return conversation;\n                    }.bind(this)\n                  });\n\n                case 7:\n                  resp = _context24.sent;\n                  logger.info('GetConversationList =>', resp);\n                  code = resp.code, data = resp.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context24.next = 12;\n                    break;\n                  }\n\n                  return _context24.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 12:\n                  return _context24.abrupt(\"return\", {\n                    code: code,\n                    data: data\n                  });\n\n                case 13:\n                  return _context24.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 14:\n                case \"end\":\n                  return _context24.stop();\n              }\n            }\n          }, _callee22, this);\n        }));\n      }\n    }, {\n      key: \"removeConversation\",\n      value: function removeConversation(conversationType, targetId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee23() {\n          var channel, data, writer, resp, code;\n          return regeneratorRuntime.wrap(function _callee23$(_context25) {\n            while (1) {\n              switch (_context25.prev = _context25.next) {\n                case 0:\n                  channel = this._channel;\n\n                  if (!channel) {\n                    _context25.next = 12;\n                    break;\n                  }\n\n                  data = channel.codec.encodeOldConversationList({\n                    type: conversationType\n                  });\n                  writer = new QueryWriter(QueryTopic.REMOVE_OLD_CONVERSATION, data, targetId);\n                  _context25.next = 6;\n                  return channel.send(writer);\n\n                case 6:\n                  resp = _context25.sent;\n                  logger.info('RemoveConversation =>', resp);\n                  code = resp.code;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context25.next = 11;\n                    break;\n                  }\n\n                  return _context25.abrupt(\"return\", code);\n\n                case 11:\n                  return _context25.abrupt(\"return\", code);\n\n                case 12:\n                  return _context25.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 13:\n                case \"end\":\n                  return _context25.stop();\n              }\n            }\n          }, _callee23, this);\n        }));\n      }\n    }, {\n      key: \"getConversation\",\n      value: function getConversation(conversationType, targetId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getAllConversationUnreadCount\",\n      value: function getAllConversationUnreadCount() {\n        var allUnreadCount = this._conversationManager.getAllUnreadCount();\n\n        return Promise.resolve({\n          code: ErrorCode$1.SUCCESS,\n          data: allUnreadCount\n        });\n      }\n    }, {\n      key: \"getConversationUnreadCount\",\n      value: function getConversationUnreadCount(conversationType, targetId) {\n        var unreadCount = this._conversationManager.getUnreadCount(conversationType, targetId);\n\n        return Promise.resolve({\n          code: ErrorCode$1.SUCCESS,\n          data: unreadCount\n        });\n      }\n    }, {\n      key: \"clearConversationUnreadCount\",\n      value: function clearConversationUnreadCount(conversationType, targetId) {\n        this._conversationManager.clearUnreadCount(conversationType, targetId);\n\n        return Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n    }, {\n      key: \"saveConversationMessageDraft\",\n      value: function saveConversationMessageDraft(conversationType, targetId, draft) {\n        this._conversationManager.setDraft(conversationType, targetId, draft);\n\n        return Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n    }, {\n      key: \"getConversationMessageDraft\",\n      value: function getConversationMessageDraft(conversationType, targetId) {\n        var draft = this._conversationManager.getDraft(conversationType, targetId);\n\n        return Promise.resolve({\n          code: ErrorCode$1.SUCCESS,\n          data: draft\n        });\n      }\n    }, {\n      key: \"clearConversationMessageDraft\",\n      value: function clearConversationMessageDraft(conversationType, targetId) {\n        this._conversationManager.clearDraft(conversationType, targetId);\n\n        return Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n    }, {\n      key: \"pullConversationStatus\",\n      value: function pullConversationStatus(timestamp) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee24() {\n          var channel, currentUserId, buff, writer, resp, code, data;\n          return regeneratorRuntime.wrap(function _callee24$(_context26) {\n            while (1) {\n              switch (_context26.prev = _context26.next) {\n                case 0:\n                  channel = this._channel, currentUserId = this.currentUserId;\n\n                  if (!channel) {\n                    _context26.next = 11;\n                    break;\n                  }\n\n                  buff = channel.codec.encodeGetConversationStatus(timestamp);\n                  writer = new QueryWriter(Topic$1[Topic$1.pullSeAtts], buff, currentUserId);\n                  _context26.next = 6;\n                  return channel.send(writer, PBName.SessionStates);\n\n                case 6:\n                  resp = _context26.sent;\n                  code = resp.code, data = resp.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context26.next = 10;\n                    break;\n                  }\n\n                  return _context26.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 10:\n                  return _context26.abrupt(\"return\", {\n                    code: code,\n                    data: data\n                  });\n\n                case 11:\n                  return _context26.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 12:\n                case \"end\":\n                  return _context26.stop();\n              }\n            }\n          }, _callee24, this);\n        }));\n      }\n    }, {\n      key: \"batchSetConversationStatus\",\n      value: function batchSetConversationStatus(statusList) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee25() {\n          var _this78 = this;\n\n          var currentUserId, channel, buff, writer, resp, code, data, versionData;\n          return regeneratorRuntime.wrap(function _callee25$(_context27) {\n            while (1) {\n              switch (_context27.prev = _context27.next) {\n                case 0:\n                  currentUserId = this.currentUserId, channel = this._channel;\n\n                  if (!channel) {\n                    _context27.next = 13;\n                    break;\n                  }\n\n                  buff = channel.codec.encodeSetConversationStatus(statusList);\n                  writer = new QueryWriter(QueryTopic.SET_CONVERSATION_STATUS, buff, currentUserId);\n                  _context27.next = 6;\n                  return channel.send(writer, PBName.SessionStateModifyResp);\n\n                case 6:\n                  resp = _context27.sent;\n                  code = resp.code, data = resp.data;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context27.next = 12;\n                    break;\n                  }\n\n                  versionData = data;\n                  statusList.forEach(function (item) {\n                    _newArrowCheck(this, _this78);\n\n                    this._conversationManager.addStatus(Object.assign(Object.assign({}, item), {\n                      updatedTime: versionData.version\n                    }), true);\n                  }.bind(this));\n                  return _context27.abrupt(\"return\", code);\n\n                case 12:\n                  return _context27.abrupt(\"return\", code);\n\n                case 13:\n                  return _context27.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 14:\n                case \"end\":\n                  return _context27.stop();\n              }\n            }\n          }, _callee25, this);\n        }));\n      }\n    }, {\n      key: \"_joinChrm\",\n      value: function _joinChrm(chrmId, count, isJoinExist) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee26() {\n          var channel, buff, topic, writer, _yield$channel$send, code, data, info, isOpenKVService;\n\n          return regeneratorRuntime.wrap(function _callee26$(_context28) {\n            while (1) {\n              switch (_context28.prev = _context28.next) {\n                case 0:\n                  channel = this._channel;\n\n                  if (channel) {\n                    _context28.next = 3;\n                    break;\n                  }\n\n                  return _context28.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 3:\n                  buff = channel.codec.encodeJoinOrQuitChatRoom();\n                  topic = isJoinExist ? QueryTopic.JOIN_EXIST_CHATROOM : QueryTopic.JOIN_CHATROOM;\n                  writer = new QueryWriter(topic, buff, chrmId);\n                  _context28.next = 8;\n                  return channel.send(writer);\n\n                case 8:\n                  _yield$channel$send = _context28.sent;\n                  code = _yield$channel$send.code;\n                  data = _yield$channel$send.data;\n\n                  if (code === ErrorCode$1.SUCCESS) {\n                    info = this._chrmsQueue[chrmId];\n\n                    if (!info) {\n                      this._chrmsQueue[chrmId] = {\n                        pulling: false,\n                        queue: [],\n                        timestamp: 0\n                      };\n                    }\n\n                    this._pullChrmMsg(chrmId, count);\n\n                    isOpenKVService = this._naviInfo.kvStorage;\n\n                    if (isOpenKVService) {\n                      this._chrmEntryHandler.pullEntry(chrmId, 0);\n                    }\n\n                    this._joinedChrmManager.set(chrmId, count);\n                  }\n\n                  return _context28.abrupt(\"return\", code);\n\n                case 13:\n                case \"end\":\n                  return _context28.stop();\n              }\n            }\n          }, _callee26, this);\n        }));\n      }\n    }, {\n      key: \"_rejoinChrm\",\n      value: function _rejoinChrm() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee27() {\n          var joinedChrms, chrmId, code;\n          return regeneratorRuntime.wrap(function _callee27$(_context29) {\n            while (1) {\n              switch (_context29.prev = _context29.next) {\n                case 0:\n                  joinedChrms = this._joinedChrmManager.get();\n                  _context29.t0 = regeneratorRuntime.keys(joinedChrms);\n\n                case 2:\n                  if ((_context29.t1 = _context29.t0()).done) {\n                    _context29.next = 10;\n                    break;\n                  }\n\n                  chrmId = _context29.t1.value;\n                  _context29.next = 6;\n                  return this._joinChrm(chrmId, joinedChrms[chrmId], true);\n\n                case 6:\n                  code = _context29.sent;\n\n                  if (code === ErrorCode$1.SUCCESS) {\n                    this._watcher.chatroom({\n                      rejoinedRoom: {\n                        chatroomId: chrmId,\n                        count: joinedChrms[chrmId]\n                      }\n                    });\n                  } else {\n                    this._watcher.chatroom({\n                      rejoinedRoom: {\n                        chatroomId: chrmId,\n                        errorCode: code\n                      }\n                    });\n                  }\n\n                  _context29.next = 2;\n                  break;\n\n                case 10:\n                case \"end\":\n                  return _context29.stop();\n              }\n            }\n          }, _callee27, this);\n        }));\n      }\n    }, {\n      key: \"_pullChrmMsg\",\n      value: function _pullChrmMsg(chrmId) {\n        var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee28() {\n          var _this79 = this;\n\n          var chrmInfo, pulling, timestamp, reqBody, signal, _yield$this$_channel$2, code, data, list, syncTime, finished;\n\n          return regeneratorRuntime.wrap(function _callee28$(_context30) {\n            while (1) {\n              switch (_context30.prev = _context30.next) {\n                case 0:\n                  if (this._channel) {\n                    _context30.next = 2;\n                    break;\n                  }\n\n                  return _context30.abrupt(\"return\");\n\n                case 2:\n                  chrmInfo = this._chrmsQueue[chrmId];\n                  pulling = chrmInfo.pulling, timestamp = chrmInfo.timestamp;\n\n                  if (!pulling) {\n                    _context30.next = 6;\n                    break;\n                  }\n\n                  return _context30.abrupt(\"return\");\n\n                case 6:\n                  reqBody = this._channel.codec.encodeChrmSyncMsg(timestamp, count);\n                  signal = new QueryWriter(Topic$1[Topic$1.chrmPull], reqBody, chrmId);\n                  _context30.next = 10;\n                  return this._channel.send(signal, PBName.DownStreamMessages, {\n                    connectedTime: this._channel.connectedTime,\n                    currentUserId: this.currentUserId\n                  });\n\n                case 10:\n                  _yield$this$_channel$2 = _context30.sent;\n                  code = _yield$this$_channel$2.code;\n                  data = _yield$this$_channel$2.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS || !data)) {\n                    _context30.next = 16;\n                    break;\n                  }\n\n                  logger.warn('pull chatroom msg failed, code:', code, ', data:', data);\n                  return _context30.abrupt(\"return\");\n\n                case 16:\n                  list = data.list, syncTime = data.syncTime, finished = data.finished;\n                  chrmInfo.timestamp = syncTime;\n                  chrmInfo.pulling = false;\n                  chrmInfo.queue = chrmInfo.queue.filter(function (item) {\n                    _newArrowCheck(this, _this79);\n\n                    return item > timestamp;\n                  }.bind(this));\n                  list.forEach(function (item) {\n                    _newArrowCheck(this, _this79);\n\n                    if (item.sentTime < timestamp) {\n                      return;\n                    }\n\n                    this._watcher.message(item);\n                  }.bind(this));\n\n                  if (!finished || chrmInfo.queue.length > 0) {\n                    this._pullChrmMsg(chrmId);\n                  }\n\n                case 22:\n                case \"end\":\n                  return _context30.stop();\n              }\n            }\n          }, _callee28, this);\n        }));\n      }\n    }, {\n      key: \"joinChatroom\",\n      value: function joinChatroom(chatroomId, count) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee29() {\n          return regeneratorRuntime.wrap(function _callee29$(_context31) {\n            while (1) {\n              switch (_context31.prev = _context31.next) {\n                case 0:\n                  return _context31.abrupt(\"return\", this._joinChrm(chatroomId, count, false));\n\n                case 1:\n                case \"end\":\n                  return _context31.stop();\n              }\n            }\n          }, _callee29, this);\n        }));\n      }\n    }, {\n      key: \"joinExistChatroom\",\n      value: function joinExistChatroom(chatroomId, count) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee30() {\n          return regeneratorRuntime.wrap(function _callee30$(_context32) {\n            while (1) {\n              switch (_context32.prev = _context32.next) {\n                case 0:\n                  return _context32.abrupt(\"return\", this._joinChrm(chatroomId, count, true));\n\n                case 1:\n                case \"end\":\n                  return _context32.stop();\n              }\n            }\n          }, _callee30, this);\n        }));\n      }\n    }, {\n      key: \"quitChatroom\",\n      value: function quitChatroom(chrmId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee31() {\n          var channel, buff, writer, resp, code;\n          return regeneratorRuntime.wrap(function _callee31$(_context33) {\n            while (1) {\n              switch (_context33.prev = _context33.next) {\n                case 0:\n                  channel = this._channel;\n\n                  if (channel) {\n                    _context33.next = 3;\n                    break;\n                  }\n\n                  return _context33.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 3:\n                  buff = channel.codec.encodeJoinOrQuitChatRoom();\n                  writer = new QueryWriter(QueryTopic.QUIT_CHATROOM, buff, chrmId);\n                  _context33.next = 7;\n                  return channel.send(writer);\n\n                case 7:\n                  resp = _context33.sent;\n                  code = resp.code;\n\n                  if (code === ErrorCode$1.SUCCESS) {\n                    delete this._chrmsQueue[chrmId];\n\n                    this._chrmEntryHandler.reset(chrmId);\n\n                    this._joinedChrmManager.remove(chrmId);\n                  }\n\n                  return _context33.abrupt(\"return\", code);\n\n                case 11:\n                case \"end\":\n                  return _context33.stop();\n              }\n            }\n          }, _callee31, this);\n        }));\n      }\n    }, {\n      key: \"getChatroomInfo\",\n      value: function getChatroomInfo(chatroomId, count, order) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee32() {\n          var channel, buff, writer, resp, code, data;\n          return regeneratorRuntime.wrap(function _callee32$(_context34) {\n            while (1) {\n              switch (_context34.prev = _context34.next) {\n                case 0:\n                  channel = this._channel;\n\n                  if (channel) {\n                    _context34.next = 3;\n                    break;\n                  }\n\n                  return _context34.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 3:\n                  buff = channel.codec.encodeGetChatRoomInfo(count, order);\n                  writer = new QueryWriter(Topic$1[Topic$1.queryChrmI], buff, chatroomId);\n                  _context34.next = 7;\n                  return channel.send(writer, PBName.QueryChatRoomInfoOutput);\n\n                case 7:\n                  resp = _context34.sent;\n                  code = resp.code, data = resp.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context34.next = 11;\n                    break;\n                  }\n\n                  return _context34.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 11:\n                  return _context34.abrupt(\"return\", {\n                    code: code,\n                    data: data\n                  });\n\n                case 12:\n                case \"end\":\n                  return _context34.stop();\n              }\n            }\n          }, _callee32, this);\n        }));\n      }\n    }, {\n      key: \"getChatroomHistoryMessages\",\n      value: function getChatroomHistoryMessages(chatroomId, timestamp, count, order) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee33() {\n          var channel, buff, writer, resp, code, data;\n          return regeneratorRuntime.wrap(function _callee33$(_context35) {\n            while (1) {\n              switch (_context35.prev = _context35.next) {\n                case 0:\n                  channel = this._channel;\n\n                  if (channel) {\n                    _context35.next = 3;\n                    break;\n                  }\n\n                  return _context35.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 3:\n                  buff = channel.codec.encodeGetHistoryMsg(chatroomId, {\n                    timestamp: timestamp,\n                    count: count,\n                    order: order\n                  });\n                  writer = new QueryWriter(QueryHistoryTopic.CHATROOM, buff, chatroomId);\n                  _context35.next = 7;\n                  return channel.send(writer, PBName.HistoryMsgOuput, {\n                    conversation: {\n                      targetId: chatroomId\n                    }\n                  });\n\n                case 7:\n                  resp = _context35.sent;\n                  code = resp.code;\n                  data = resp.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context35.next = 12;\n                    break;\n                  }\n\n                  return _context35.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 12:\n                  return _context35.abrupt(\"return\", {\n                    code: code,\n                    data: {\n                      list: data.list,\n                      hasMore: data.hasMore\n                    }\n                  });\n\n                case 13:\n                case \"end\":\n                  return _context35.stop();\n              }\n            }\n          }, _callee33, this);\n        }));\n      }\n    }, {\n      key: \"_modifyChatroomKV\",\n      value: function _modifyChatroomKV(chatroomId, entry) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee34() {\n          var channel, currentUserId, buff, topic, writer, resp, code;\n          return regeneratorRuntime.wrap(function _callee34$(_context36) {\n            while (1) {\n              switch (_context36.prev = _context36.next) {\n                case 0:\n                  channel = this._channel, currentUserId = this.currentUserId;\n\n                  if (channel) {\n                    _context36.next = 3;\n                    break;\n                  }\n\n                  return _context36.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 3:\n                  buff = channel.codec.encodeModifyChatRoomKV(chatroomId, entry, currentUserId);\n                  topic = entry.type === ChatroomEntryType$1.UPDATE ? QueryTopic.UPDATE_CHATROOM_KV : QueryTopic.DELETE_CHATROOM_KV;\n                  writer = new QueryWriter(topic, buff, chatroomId);\n                  _context36.next = 8;\n                  return channel.send(writer);\n\n                case 8:\n                  resp = _context36.sent;\n                  code = resp.code;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context36.next = 13;\n                    break;\n                  }\n\n                  this._chrmEntryHandler.setLocal(chatroomId, {\n                    kvEntries: [entry],\n                    syncTime: new Date().getTime()\n                  }, currentUserId);\n\n                  return _context36.abrupt(\"return\", code);\n\n                case 13:\n                  return _context36.abrupt(\"return\", code);\n\n                case 14:\n                case \"end\":\n                  return _context36.stop();\n              }\n            }\n          }, _callee34, this);\n        }));\n      }\n    }, {\n      key: \"setChatroomEntry\",\n      value: function setChatroomEntry(chatroomId, entry) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee35() {\n          return regeneratorRuntime.wrap(function _callee35$(_context37) {\n            while (1) {\n              switch (_context37.prev = _context37.next) {\n                case 0:\n                  entry.type = ChatroomEntryType$1.UPDATE;\n                  return _context37.abrupt(\"return\", this._modifyChatroomKV(chatroomId, entry));\n\n                case 2:\n                case \"end\":\n                  return _context37.stop();\n              }\n            }\n          }, _callee35, this);\n        }));\n      }\n    }, {\n      key: \"forceSetChatroomEntry\",\n      value: function forceSetChatroomEntry(chatroomId, entry) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee36() {\n          return regeneratorRuntime.wrap(function _callee36$(_context38) {\n            while (1) {\n              switch (_context38.prev = _context38.next) {\n                case 0:\n                  entry.type = ChatroomEntryType$1.UPDATE;\n                  entry.isOverwrite = true;\n                  return _context38.abrupt(\"return\", this._modifyChatroomKV(chatroomId, entry));\n\n                case 3:\n                case \"end\":\n                  return _context38.stop();\n              }\n            }\n          }, _callee36, this);\n        }));\n      }\n    }, {\n      key: \"removeChatroomEntry\",\n      value: function removeChatroomEntry(chatroomId, entry) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee37() {\n          return regeneratorRuntime.wrap(function _callee37$(_context39) {\n            while (1) {\n              switch (_context39.prev = _context39.next) {\n                case 0:\n                  entry.type = ChatroomEntryType$1.DELETE;\n                  return _context39.abrupt(\"return\", this._modifyChatroomKV(chatroomId, entry));\n\n                case 2:\n                case \"end\":\n                  return _context39.stop();\n              }\n            }\n          }, _callee37, this);\n        }));\n      }\n    }, {\n      key: \"forceRemoveChatroomEntry\",\n      value: function forceRemoveChatroomEntry(chatroomId, entry) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee38() {\n          return regeneratorRuntime.wrap(function _callee38$(_context40) {\n            while (1) {\n              switch (_context40.prev = _context40.next) {\n                case 0:\n                  entry.type = ChatroomEntryType$1.DELETE;\n                  entry.isOverwrite = true;\n                  return _context40.abrupt(\"return\", this._modifyChatroomKV(chatroomId, entry));\n\n                case 3:\n                case \"end\":\n                  return _context40.stop();\n              }\n            }\n          }, _callee38, this);\n        }));\n      }\n    }, {\n      key: \"getChatroomEntry\",\n      value: function getChatroomEntry(chatroomId, key) {\n        var entry = this._chrmEntryHandler.getValue(chatroomId, key);\n\n        if (entry) {\n          return Promise.resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: entry\n          });\n        } else {\n          return Promise.resolve({\n            code: ErrorCode$1.CHATROOM_KEY_NOT_EXIST\n          });\n        }\n      }\n    }, {\n      key: \"getAllChatroomEntry\",\n      value: function getAllChatroomEntry(chatroomId) {\n        var entries = this._chrmEntryHandler.getAll(chatroomId);\n\n        return Promise.resolve({\n          code: ErrorCode$1.SUCCESS,\n          data: entries\n        });\n      }\n    }, {\n      key: \"pullChatroomEntry\",\n      value: function pullChatroomEntry(chatroomId, timestamp) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee39() {\n          var _this80 = this;\n\n          var channel, currentUserId, buff, writer, resp, code, data, kvEntries, updatedEntries;\n          return regeneratorRuntime.wrap(function _callee39$(_context41) {\n            while (1) {\n              switch (_context41.prev = _context41.next) {\n                case 0:\n                  channel = this._channel, currentUserId = this.currentUserId;\n\n                  if (channel) {\n                    _context41.next = 3;\n                    break;\n                  }\n\n                  return _context41.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 3:\n                  buff = channel.codec.encodePullChatRoomKV(timestamp);\n                  writer = new QueryWriter(Topic$1[Topic$1.pullKV], buff, chatroomId);\n                  _context41.next = 7;\n                  return channel.send(writer, PBName.ChrmKVOutput);\n\n                case 7:\n                  resp = _context41.sent;\n                  code = resp.code, data = resp.data;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context41.next = 15;\n                    break;\n                  }\n\n                  this._chrmEntryHandler.setLocal(chatroomId, data, currentUserId);\n\n                  kvEntries = data.kvEntries;\n                  updatedEntries = [];\n\n                  if (kvEntries.length > 0) {\n                    kvEntries.forEach(function (entry) {\n                      _newArrowCheck(this, _this80);\n\n                      var key = entry.key,\n                          value = entry.value,\n                          type = entry.type,\n                          timestamp = entry.timestamp;\n                      updatedEntries.push({\n                        key: key,\n                        value: value,\n                        type: type,\n                        timestamp: timestamp,\n                        chatroomId: chatroomId\n                      });\n                    }.bind(this));\n\n                    this._watcher.chatroom({\n                      updatedEntries: updatedEntries\n                    });\n                  }\n\n                  return _context41.abrupt(\"return\", {\n                    code: code,\n                    data: data\n                  });\n\n                case 15:\n                  return _context41.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 16:\n                case \"end\":\n                  return _context41.stop();\n              }\n            }\n          }, _callee39, this);\n        }));\n      }\n    }, {\n      key: \"sendMessage\",\n      value: function sendMessage(conversationType, targetId, options) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee40() {\n          var isStatusMessage, topic, data, signal, _yield$this$_channel$3, code, resp, pubAck, receivedMessage;\n\n          return regeneratorRuntime.wrap(function _callee40$(_context42) {\n            while (1) {\n              switch (_context42.prev = _context42.next) {\n                case 0:\n                  if (this._channel) {\n                    _context42.next = 2;\n                    break;\n                  }\n\n                  return _context42.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  options = this._handleMsgProperties(options, true);\n                  isStatusMessage = [ConversationType$1.PRIVATE, ConversationType$1.GROUP].includes(conversationType) ? options.isStatusMessage : false;\n                  topic = isStatusMessage ? getStatPubTopic(conversationType) : getPubTopic(conversationType) || Topic$1.ppMsgP;\n\n                  if (isStatusMessage) {\n                    options.isPersited = false;\n                    options.isCounted = false;\n                  }\n\n                  data = this._channel.codec.encodeUpMsg({\n                    type: conversationType,\n                    targetId: targetId\n                  }, options);\n                  signal = new PublishWriter(Topic$1[topic], data, targetId);\n                  signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n\n                  if (!isStatusMessage) {\n                    _context42.next = 12;\n                    break;\n                  }\n\n                  this._channel.sendOnly(signal);\n\n                  return _context42.abrupt(\"return\", {\n                    code: ErrorCode$1.SUCCESS,\n                    data: transSentAttrs2IReceivedMessage(conversationType, targetId, Object.assign({}, options), '', 0, this.currentUserId)\n                  });\n\n                case 12:\n                  _context42.next = 14;\n                  return this._channel.send(signal);\n\n                case 14:\n                  _yield$this$_channel$3 = _context42.sent;\n                  code = _yield$this$_channel$3.code;\n                  resp = _yield$this$_channel$3.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context42.next = 19;\n                    break;\n                  }\n\n                  return _context42.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 19:\n                  pubAck = resp;\n\n                  this._letterbox.setOutboxTime(pubAck.timestamp, this.currentUserId);\n\n                  receivedMessage = transSentAttrs2IReceivedMessage(conversationType, targetId, Object.assign({}, options), pubAck.messageUId, pubAck.timestamp, this.currentUserId);\n\n                  this._conversationManager.setConversationCacheByMessage(receivedMessage, true);\n\n                  return _context42.abrupt(\"return\", {\n                    code: ErrorCode$1.SUCCESS,\n                    data: receivedMessage\n                  });\n\n                case 24:\n                case \"end\":\n                  return _context42.stop();\n              }\n            }\n          }, _callee40, this);\n        }));\n      }\n    }, {\n      key: \"recallMsg\",\n      value: function recallMsg(conversationType, targetId, messageUId, sentTime, user) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee41() {\n          var msg, topic, data, signal, _yield$this$_channel$4, code, resp, pubAck;\n\n          return regeneratorRuntime.wrap(function _callee41$(_context43) {\n            while (1) {\n              switch (_context43.prev = _context43.next) {\n                case 0:\n                  if (this._channel) {\n                    _context43.next = 2;\n                    break;\n                  }\n\n                  return _context43.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  msg = {\n                    content: {\n                      conversationType: conversationType,\n                      targetId: targetId,\n                      messageUId: messageUId,\n                      sentTime: sentTime,\n                      user: user\n                    },\n                    messageType: 'RC:RcCmd'\n                  };\n                  topic = Topic$1[Topic$1.recallMsg];\n                  data = this._channel.codec.encodeUpMsg({\n                    type: conversationType,\n                    targetId: targetId\n                  }, msg);\n                  signal = new PublishWriter(topic, data, this.currentUserId);\n                  signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n                  _context43.next = 9;\n                  return this._channel.send(signal);\n\n                case 9:\n                  _yield$this$_channel$4 = _context43.sent;\n                  code = _yield$this$_channel$4.code;\n                  resp = _yield$this$_channel$4.data;\n\n                  if (!(code !== ErrorCode$1.SUCCESS)) {\n                    _context43.next = 14;\n                    break;\n                  }\n\n                  return _context43.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 14:\n                  pubAck = resp;\n                  return _context43.abrupt(\"return\", {\n                    code: ErrorCode$1.SUCCESS,\n                    data: transSentAttrs2IReceivedMessage(conversationType, targetId, Object.assign({}, msg), pubAck.messageUId, pubAck.timestamp, this.currentUserId)\n                  });\n\n                case 16:\n                case \"end\":\n                  return _context43.stop();\n              }\n            }\n          }, _callee41, this);\n        }));\n      }\n    }, {\n      key: \"pullUserSettings\",\n      value: function pullUserSettings(version) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee42() {\n          var buff, writer;\n          return regeneratorRuntime.wrap(function _callee42$(_context44) {\n            while (1) {\n              switch (_context44.prev = _context44.next) {\n                case 0:\n                  if (this._channel) {\n                    _context44.next = 2;\n                    break;\n                  }\n\n                  return _context44.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  buff = this._channel.codec.encodePullUserSetting(version);\n                  writer = new QueryWriter(Topic$1[Topic$1.pullUS], buff, this.currentUserId);\n                  return _context44.abrupt(\"return\", this._channel.send(writer, PBName.PullUserSettingOutput));\n\n                case 5:\n                case \"end\":\n                  return _context44.stop();\n              }\n            }\n          }, _callee42, this);\n        }));\n      }\n    }, {\n      key: \"getFileToken\",\n      value: function getFileToken(fileType, fileName) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee43() {\n          var uploadFileName, buff, writer, _yield$this$_channel$5, code, data;\n\n          return regeneratorRuntime.wrap(function _callee43$(_context45) {\n            while (1) {\n              switch (_context45.prev = _context45.next) {\n                case 0:\n                  if (this._channel) {\n                    _context45.next = 2;\n                    break;\n                  }\n\n                  return _context45.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  uploadFileName = getUploadFileName(fileType, fileName);\n                  buff = this._channel.codec.encodeGetFileToken(fileType, uploadFileName);\n                  writer = new QueryWriter(Topic$1[Topic$1.qnTkn], buff, this.currentUserId);\n                  _context45.next = 7;\n                  return this._channel.send(writer, PBName.GetQNupTokenOutput);\n\n                case 7:\n                  _yield$this$_channel$5 = _context45.sent;\n                  code = _yield$this$_channel$5.code;\n                  data = _yield$this$_channel$5.data;\n                  data = Object.assign(data, {\n                    fileName: uploadFileName\n                  });\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context45.next = 13;\n                    break;\n                  }\n\n                  return _context45.abrupt(\"return\", {\n                    code: code,\n                    data: data\n                  });\n\n                case 13:\n                  return _context45.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 14:\n                case \"end\":\n                  return _context45.stop();\n              }\n            }\n          }, _callee43, this);\n        }));\n      }\n    }, {\n      key: \"getFileUrl\",\n      value: function getFileUrl(fileType, uploadMethod, fileName, originName) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee44() {\n          var topic, inputPBName, outputPBName, buff, writer, _yield$this$_channel$6, code, data, resp;\n\n          return regeneratorRuntime.wrap(function _callee44$(_context46) {\n            while (1) {\n              switch (_context46.prev = _context46.next) {\n                case 0:\n                  if (this._channel) {\n                    _context46.next = 2;\n                    break;\n                  }\n\n                  return _context46.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  topic = '';\n                  inputPBName = '';\n                  outputPBName = '';\n\n                  if (uploadMethod === UploadMethod$1.QINIU) {\n                    topic = Topic$1[Topic$1.qnUrl];\n                    inputPBName = PBName.GetQNdownloadUrlInput;\n                    outputPBName = PBName.GetQNdownloadUrlOutput;\n                  } else {\n                    topic = Topic$1[Topic$1.aliUrl];\n                    inputPBName = PBName.GetDownloadUrlInput;\n                    outputPBName = PBName.GetDownloadUrlOutput;\n                  }\n\n                  buff = this._channel.codec.encodeGetFileUrl(inputPBName, fileType, fileName, originName);\n                  writer = new QueryWriter(topic, buff, this.currentUserId);\n                  _context46.next = 10;\n                  return this._channel.send(writer, outputPBName);\n\n                case 10:\n                  _yield$this$_channel$6 = _context46.sent;\n                  code = _yield$this$_channel$6.code;\n                  data = _yield$this$_channel$6.data;\n                  resp = data;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context46.next = 16;\n                    break;\n                  }\n\n                  return _context46.abrupt(\"return\", {\n                    code: code,\n                    data: resp\n                  });\n\n                case 16:\n                  return _context46.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 17:\n                case \"end\":\n                  return _context46.stop();\n              }\n            }\n          }, _callee44, this);\n        }));\n      }\n    }, {\n      key: \"disconnect\",\n      value: function disconnect() {\n        if (this._channel) {\n          this._channel.close();\n\n          this._channel = undefined;\n        }\n      }\n    }, {\n      key: \"destroy\",\n      value: function destroy() {\n        throw new Error('JSEngine\\'s method not implemented.');\n      }\n    }, {\n      key: \"registerMessageType\",\n      value: function registerMessageType(objectName, isPersited, isCounted, searchProps) {\n        this._customMessageType[objectName] = {\n          isPersited: isPersited,\n          isCounted: isCounted\n        };\n      }\n    }, {\n      key: \"joinRTCRoom\",\n      value: function joinRTCRoom(roomId, mode, broadcastType) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee45() {\n          var reqBody, writer;\n          return regeneratorRuntime.wrap(function _callee45$(_context47) {\n            while (1) {\n              switch (_context47.prev = _context47.next) {\n                case 0:\n                  if (this._channel) {\n                    _context47.next = 2;\n                    break;\n                  }\n\n                  return _context47.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  reqBody = this._channel.codec.encodeJoinRTCRoom(mode, broadcastType);\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcRJoin_data], reqBody, roomId);\n                  return _context47.abrupt(\"return\", this._channel.send(writer, PBName.RtcUserListOutput));\n\n                case 5:\n                case \"end\":\n                  return _context47.stop();\n              }\n            }\n          }, _callee45, this);\n        }));\n      }\n    }, {\n      key: \"quitRTCRoom\",\n      value: function quitRTCRoom(roomId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee46() {\n          var reqBody, writer, _yield$this$_channel$7, code;\n\n          return regeneratorRuntime.wrap(function _callee46$(_context48) {\n            while (1) {\n              switch (_context48.prev = _context48.next) {\n                case 0:\n                  if (this._channel) {\n                    _context48.next = 2;\n                    break;\n                  }\n\n                  return _context48.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeQuitRTCRoom();\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcRExit], reqBody, roomId);\n                  _context48.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$7 = _context48.sent;\n                  code = _yield$this$_channel$7.code;\n                  return _context48.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context48.stop();\n              }\n            }\n          }, _callee46, this);\n        }));\n      }\n    }, {\n      key: \"rtcPing\",\n      value: function rtcPing(roomId, mode, broadcastType) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee47() {\n          var reqBody, writer, _yield$this$_channel$8, code;\n\n          return regeneratorRuntime.wrap(function _callee47$(_context49) {\n            while (1) {\n              switch (_context49.prev = _context49.next) {\n                case 0:\n                  if (this._channel) {\n                    _context49.next = 2;\n                    break;\n                  }\n\n                  return _context49.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeJoinRTCRoom(mode, broadcastType);\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcPing], reqBody, roomId);\n                  _context49.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$8 = _context49.sent;\n                  code = _yield$this$_channel$8.code;\n                  return _context49.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context49.stop();\n              }\n            }\n          }, _callee47, this);\n        }));\n      }\n    }, {\n      key: \"getRTCRoomInfo\",\n      value: function getRTCRoomInfo(roomId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee48() {\n          var reqBody, writer;\n          return regeneratorRuntime.wrap(function _callee48$(_context50) {\n            while (1) {\n              switch (_context50.prev = _context50.next) {\n                case 0:\n                  if (this._channel) {\n                    _context50.next = 2;\n                    break;\n                  }\n\n                  return _context50.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  reqBody = this._channel.codec.encodeGetRTCRoomInfo();\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcRInfo], reqBody, roomId);\n                  return _context50.abrupt(\"return\", this._channel.send(writer, PBName.RtcRoomInfoOutput));\n\n                case 5:\n                case \"end\":\n                  return _context50.stop();\n              }\n            }\n          }, _callee48, this);\n        }));\n      }\n    }, {\n      key: \"getRTCUserInfoList\",\n      value: function getRTCUserInfoList(roomId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee49() {\n          var reqBody, writer, _yield$this$_channel$9, code, data;\n\n          return regeneratorRuntime.wrap(function _callee49$(_context51) {\n            while (1) {\n              switch (_context51.prev = _context51.next) {\n                case 0:\n                  if (this._channel) {\n                    _context51.next = 2;\n                    break;\n                  }\n\n                  return _context51.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  reqBody = this._channel.codec.encodeGetRTCRoomInfo();\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcUData], reqBody, roomId);\n                  _context51.next = 6;\n                  return this._channel.send(writer, PBName.RtcUserListOutput);\n\n                case 6:\n                  _yield$this$_channel$9 = _context51.sent;\n                  code = _yield$this$_channel$9.code;\n                  data = _yield$this$_channel$9.data;\n                  return _context51.abrupt(\"return\", {\n                    code: code,\n                    data: data ? {\n                      users: data.users\n                    } : data\n                  });\n\n                case 10:\n                case \"end\":\n                  return _context51.stop();\n              }\n            }\n          }, _callee49, this);\n        }));\n      }\n    }, {\n      key: \"setRTCUserInfo\",\n      value: function setRTCUserInfo(roomId, key, value) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee50() {\n          var reqBody, writer, _yield$this$_channel$10, code;\n\n          return regeneratorRuntime.wrap(function _callee50$(_context52) {\n            while (1) {\n              switch (_context52.prev = _context52.next) {\n                case 0:\n                  if (this._channel) {\n                    _context52.next = 2;\n                    break;\n                  }\n\n                  return _context52.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeSetRTCUserInfo(key, value);\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcUPut], reqBody, roomId);\n                  _context52.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$10 = _context52.sent;\n                  code = _yield$this$_channel$10.code;\n                  return _context52.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context52.stop();\n              }\n            }\n          }, _callee50, this);\n        }));\n      }\n    }, {\n      key: \"removeRTCUserInfo\",\n      value: function removeRTCUserInfo(roomId, keys) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee51() {\n          var reqBody, writer, _yield$this$_channel$11, code;\n\n          return regeneratorRuntime.wrap(function _callee51$(_context53) {\n            while (1) {\n              switch (_context53.prev = _context53.next) {\n                case 0:\n                  if (this._channel) {\n                    _context53.next = 2;\n                    break;\n                  }\n\n                  return _context53.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeRemoveRTCUserInfo(keys);\n                  writer = new PublishWriter(Topic$1[Topic$1.rtcUDel], reqBody, roomId);\n                  _context53.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$11 = _context53.sent;\n                  code = _yield$this$_channel$11.code;\n                  return _context53.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context53.stop();\n              }\n            }\n          }, _callee51, this);\n        }));\n      }\n    }, {\n      key: \"setRTCData\",\n      value: function setRTCData(roomId, key, value, isInner, apiType, message) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee52() {\n          var reqBody, writer, _yield$this$_channel$12, code;\n\n          return regeneratorRuntime.wrap(function _callee52$(_context54) {\n            while (1) {\n              switch (_context54.prev = _context54.next) {\n                case 0:\n                  if (this._channel) {\n                    _context54.next = 2;\n                    break;\n                  }\n\n                  return _context54.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeSetRTCData(key, value, isInner, apiType, message);\n                  writer = new PublishWriter(Topic$1[Topic$1.rtcSetData], reqBody, roomId);\n                  _context54.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$12 = _context54.sent;\n                  code = _yield$this$_channel$12.code;\n                  return _context54.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context54.stop();\n              }\n            }\n          }, _callee52, this);\n        }));\n      }\n    }, {\n      key: \"setRTCTotalRes\",\n      value: function setRTCTotalRes(roomId, message, valueInfo, objectName) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee53() {\n          var reqBody, writer, _yield$this$_channel$13, code;\n\n          return regeneratorRuntime.wrap(function _callee53$(_context55) {\n            while (1) {\n              switch (_context55.prev = _context55.next) {\n                case 0:\n                  if (this._channel) {\n                    _context55.next = 2;\n                    break;\n                  }\n\n                  return _context55.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeUserSetRTCData(message, valueInfo, objectName);\n                  writer = new PublishWriter(Topic$1[Topic$1.userSetData], reqBody, roomId);\n                  _context55.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$13 = _context55.sent;\n                  code = _yield$this$_channel$13.code;\n                  return _context55.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context55.stop();\n              }\n            }\n          }, _callee53, this);\n        }));\n      }\n    }, {\n      key: \"getRTCData\",\n      value: function getRTCData(roomId, keys, isInner, apiType) {\n        if (!this._channel) {\n          return Promise.resolve({\n            code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n          });\n        }\n\n        var reqBody = this._channel.codec.encodeGetRTCData(keys, isInner, apiType);\n\n        var writer = new QueryWriter(Topic$1[Topic$1.rtcQryData], reqBody, roomId);\n        return this._channel.send(writer, PBName.RtcQryOutput);\n      }\n    }, {\n      key: \"removeRTCData\",\n      value: function removeRTCData(roomId, keys, isInner, apiType, message) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee54() {\n          var reqBody, writer, _yield$this$_channel$14, code;\n\n          return regeneratorRuntime.wrap(function _callee54$(_context56) {\n            while (1) {\n              switch (_context56.prev = _context56.next) {\n                case 0:\n                  if (this._channel) {\n                    _context56.next = 2;\n                    break;\n                  }\n\n                  return _context56.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeRemoveRTCData(keys, isInner, apiType, message);\n                  writer = new PublishWriter(Topic$1[Topic$1.rtcDelData], reqBody, roomId);\n                  _context56.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$14 = _context56.sent;\n                  code = _yield$this$_channel$14.code;\n                  return _context56.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context56.stop();\n              }\n            }\n          }, _callee54, this);\n        }));\n      }\n    }, {\n      key: \"setRTCOutData\",\n      value: function setRTCOutData(roomId, rtcData, type, message) {\n        throw new Error('JSEngine\\'s method not implemented.');\n      }\n    }, {\n      key: \"getRTCOutData\",\n      value: function getRTCOutData(roomId, userIds) {\n        throw new Error('JSEngine\\'s method not implemented.');\n      }\n    }, {\n      key: \"getRTCToken\",\n      value: function getRTCToken(roomId, mode, broadcastType) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee55() {\n          var reqBody, writer;\n          return regeneratorRuntime.wrap(function _callee55$(_context57) {\n            while (1) {\n              switch (_context57.prev = _context57.next) {\n                case 0:\n                  if (this._channel) {\n                    _context57.next = 2;\n                    break;\n                  }\n\n                  return _context57.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n                  });\n\n                case 2:\n                  reqBody = this._channel.codec.encodeJoinRTCRoom(mode, broadcastType);\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcToken], reqBody, roomId);\n                  return _context57.abrupt(\"return\", this._channel.send(writer, PBName.RtcTokenOutput));\n\n                case 5:\n                case \"end\":\n                  return _context57.stop();\n              }\n            }\n          }, _callee55, this);\n        }));\n      }\n    }, {\n      key: \"setRTCState\",\n      value: function setRTCState(roomId, report) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee56() {\n          var reqBody, writer, _yield$this$_channel$15, code;\n\n          return regeneratorRuntime.wrap(function _callee56$(_context58) {\n            while (1) {\n              switch (_context58.prev = _context58.next) {\n                case 0:\n                  if (this._channel) {\n                    _context58.next = 2;\n                    break;\n                  }\n\n                  return _context58.abrupt(\"return\", ErrorCode$1.RC_NET_CHANNEL_INVALID);\n\n                case 2:\n                  reqBody = this._channel.codec.encodeSetRTCState(report);\n                  writer = new QueryWriter(Topic$1[Topic$1.rtcUserState], reqBody, roomId);\n                  _context58.next = 6;\n                  return this._channel.send(writer);\n\n                case 6:\n                  _yield$this$_channel$15 = _context58.sent;\n                  code = _yield$this$_channel$15.code;\n                  return _context58.abrupt(\"return\", code);\n\n                case 9:\n                case \"end\":\n                  return _context58.stop();\n              }\n            }\n          }, _callee56, this);\n        }));\n      }\n    }, {\n      key: \"getRTCUserInfo\",\n      value: function getRTCUserInfo(roomId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee57() {\n          return regeneratorRuntime.wrap(function _callee57$(_context59) {\n            while (1) {\n              switch (_context59.prev = _context59.next) {\n                case 0:\n                  throw new Error('Method not implemented.');\n\n                case 1:\n                case \"end\":\n                  return _context59.stop();\n              }\n            }\n          }, _callee57);\n        }));\n      }\n    }, {\n      key: \"getRTCUserList\",\n      value: function getRTCUserList(roomId) {\n        if (!this._channel) {\n          return Promise.resolve({\n            code: ErrorCode$1.RC_NET_CHANNEL_INVALID\n          });\n        }\n\n        var data = this._channel.codec.encodeGetRTCRoomInfo();\n\n        var writer = new QueryWriter(Topic$1[Topic$1.rtcUList], data, roomId);\n        return this._channel.send(writer, PBName.RtcUserListOutput);\n      }\n    }, {\n      key: \"clearConversations\",\n      value: function clearConversations() {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setUserStatusListener\",\n      value: function setUserStatusListener(config, listener) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setUserStatus\",\n      value: function setUserStatus(status) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"subscribeUserStatus\",\n      value: function subscribeUserStatus(userIds) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getUserStatus\",\n      value: function getUserStatus(userId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"addToBlacklist\",\n      value: function addToBlacklist(userId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"removeFromBlacklist\",\n      value: function removeFromBlacklist(userId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getBlacklist\",\n      value: function getBlacklist() {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getBlacklistStatus\",\n      value: function getBlacklistStatus(userId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"insertMessage\",\n      value: function insertMessage(conversationType, targetId, senderUserId, objectName, msgContent, direction) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"deleteMessages\",\n      value: function deleteMessages(timestamps) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"deleteMessagesByTimestamp\",\n      value: function deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getMessage\",\n      value: function getMessage(messageId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setMessageContent\",\n      value: function setMessageContent(messageId, content, objectName) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setMessageSearchField\",\n      value: function setMessageSearchField(messageId, content, searchFiles) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"searchConversationByContent\",\n      value: function searchConversationByContent(keyword, conversationTypes) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"searchMessageByContent\",\n      value: function searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getUnreadMentionedMessages\",\n      value: function getUnreadMentionedMessages(conversationType, targetId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setMessageSentStatus\",\n      value: function setMessageSentStatus(messageId, sentStatus) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setMessageReceivedStatus\",\n      value: function setMessageReceivedStatus(messageId, receivedStatus) {\n        throw new Error('Method not implemented.');\n      }\n    }]);\n\n    return JSEngine;\n  }(AEngine);\n\n  var RTCMode;\n\n  (function (RTCMode) {\n    RTCMode[RTCMode[\"RTC\"] = 0] = \"RTC\";\n    RTCMode[RTCMode[\"LIVE\"] = 2] = \"LIVE\";\n  })(RTCMode || (RTCMode = {}));\n\n  var LiveType;\n\n  (function (LiveType) {\n    LiveType[LiveType[\"AUDIO_AND_VIDEO\"] = 0] = \"AUDIO_AND_VIDEO\";\n    LiveType[LiveType[\"AUDIO\"] = 1] = \"AUDIO\";\n  })(LiveType || (LiveType = {}));\n\n  var LiveRole;\n\n  (function (LiveRole) {\n    LiveRole[LiveRole[\"ANCHOR\"] = 1] = \"ANCHOR\";\n    LiveRole[LiveRole[\"AUDIENCE\"] = 2] = \"AUDIENCE\";\n  })(LiveRole || (LiveRole = {}));\n\n  var CallLibMsgType = {\n    'RC:VCAccept': 'RC:VCAccept',\n    'RC:VCRinging': 'RC:VCRinging',\n    'RC:VCSummary': 'RC:VCSummary',\n    'RC:VCHangup': 'RC:VCHangup',\n    'RC:VCInvite': 'RC:VCInvite',\n    'RC:VCModifyMedia': 'RC:VCModifyMedia',\n    'RC:VCModifyMem': 'RC:VCModifyMem'\n  };\n  var RTCApiType;\n\n  (function (RTCApiType) {\n    RTCApiType[RTCApiType[\"ROOM\"] = 1] = \"ROOM\";\n    RTCApiType[RTCApiType[\"PERSON\"] = 2] = \"PERSON\";\n  })(RTCApiType || (RTCApiType = {}));\n\n  var Heartbeat = function () {\n    function Heartbeat(pongRes, connectionListener) {\n      _classCallCheck(this, Heartbeat);\n\n      this._timerId = 0;\n      this._heartbeatTimeoutId = 0;\n      this._isFirstPing = true;\n      this._hasPingRes = pongRes;\n      this._connectionListener = connectionListener;\n    }\n\n    _createClass(Heartbeat, [{\n      key: \"start\",\n      value: function start(cppHeartbeatFunc, cppEngine) {\n        var _this81 = this;\n\n        var self = this;\n\n        var _startHeartbeat = function startHeartbeat() {\n          var _this82 = this;\n\n          _newArrowCheck(this, _this81);\n\n          var time = this._isFirstPing ? 0 : 15 * 1000;\n          self._timerId = setTimeout(function () {\n            var _this83 = this;\n\n            _newArrowCheck(this, _this82);\n\n            self._isFirstPing = false;\n\n            if (self._hasPingRes) {\n              cppHeartbeatFunc.call(cppEngine);\n              self._hasPingRes = false;\n\n              _startHeartbeat();\n            } else {\n              self._heartbeatTimeoutId = setTimeout(function () {\n                _newArrowCheck(this, _this83);\n              }.bind(this), 90 * 1000);\n            }\n          }.bind(this), time);\n        }.bind(this);\n\n        _startHeartbeat();\n      }\n    }, {\n      key: \"stop\",\n      value: function stop() {\n        clearTimeout(this._timerId);\n      }\n    }, {\n      key: \"setHeartbeatRes\",\n      value: function setHeartbeatRes(hasRes) {\n        this._hasPingRes = hasRes;\n\n        if (this._hasPingRes) {\n          clearTimeout(this._heartbeatTimeoutId);\n        }\n      }\n    }]);\n\n    return Heartbeat;\n  }();\n\n  var CPPEngine = function (_AEngine2) {\n    _inherits(CPPEngine, _AEngine2);\n\n    var _super19 = _createSuper(CPPEngine);\n\n    function CPPEngine(_runtime, _appkey, _watcher, _apiVersion, _cppProtocol, _options) {\n      var _this85 = this;\n\n      var _this84;\n\n      _classCallCheck(this, CPPEngine);\n\n      _this84 = _super19.call(this, _runtime, _appkey, _watcher, _apiVersion, _options);\n      _this84._cppProtocol = _cppProtocol;\n      _this84._currentToken = '';\n      _this84._connectionStatus = ConnectionStatus$1.DISCONNECTED;\n      _this84._promiseHandler = {};\n      _this84._customMessageType = {};\n      _this84._heartbeat = {};\n\n      _this84._connectionListener = function (status) {\n        _newArrowCheck(this, _this85);\n      }.bind(this);\n\n      _this84._cppConnectionStatus = ConnectionStatus$1.DISCONNECTED;\n\n      _this84.init(_appkey, {\n        version: _apiVersion,\n        dbPath: _options.dbPath || '',\n        navi: _options.navigators[0] || ''\n      });\n\n      _this84._setConnectionStatusListener(_watcher.status);\n\n      _this84._setOnReceiveMessageListener(_watcher.message);\n\n      _this84._setConversationStatusListener(_watcher.conversation);\n\n      return _this84;\n    }\n\n    _createClass(CPPEngine, [{\n      key: \"_registerMsgTypes\",\n      value: function _registerMsgTypes() {\n        SEND_MESSAGE_TYPE_OPTION['RC:RcCmd'] = {\n          isCounted: false,\n          isPersited: false\n        };\n\n        for (var messageType in SEND_MESSAGE_TYPE_OPTION) {\n          var _SEND_MESSAGE_TYPE_OP = SEND_MESSAGE_TYPE_OPTION[messageType],\n              isCounted = _SEND_MESSAGE_TYPE_OP.isCounted,\n              isPersited = _SEND_MESSAGE_TYPE_OP.isPersited;\n          var msgOptions = 0;\n\n          if (isPersited) {\n            msgOptions = msgOptions | 0x01;\n          }\n\n          if (isCounted) {\n            msgOptions = msgOptions | 0x02;\n          }\n\n          this._cppProtocol.registerMessageType(messageType, msgOptions);\n        }\n      }\n    }, {\n      key: \"_buildMessage\",\n      value: function _buildMessage(result, isOffLineMessage) {\n        var receivedCppMessage = JSON.parse(result);\n        var conversationType = receivedCppMessage.conversationType,\n            targetId = receivedCppMessage.targetId,\n            senderUserId = receivedCppMessage.senderUserId,\n            content = receivedCppMessage.content,\n            objectName = receivedCppMessage.objectName,\n            messageUid = receivedCppMessage.messageUid,\n            direction = receivedCppMessage.direction,\n            status = receivedCppMessage.status,\n            source = receivedCppMessage.source,\n            messageId = receivedCppMessage.messageId,\n            sentTime = receivedCppMessage.sentTime;\n        var msgContent;\n\n        if (isObject(content)) {\n          msgContent = content;\n        } else {\n          msgContent = content ? JSON.parse(content) : content;\n        }\n\n        var msgOptions = {\n          isCounted: false,\n          isPersited: false\n        };\n\n        if (objectName in SEND_MESSAGE_TYPE_OPTION) {\n          msgOptions = SEND_MESSAGE_TYPE_OPTION[objectName];\n        } else if (objectName in this._customMessageType) {\n          msgOptions = this._customMessageType[objectName];\n        }\n\n        var isOffline = isUndefined(isOffLineMessage) ? sentTime < this.connectedTime : isOffLineMessage;\n        var msg = {\n          conversationType: conversationType,\n          targetId: targetId,\n          senderUserId: senderUserId,\n          content: msgContent || {},\n          messageType: objectName,\n          messageUId: messageUid,\n          messageDirection: direction,\n          isOffLineMessage: isOffline,\n          sentTime: sentTime,\n          receivedTime: 0,\n          isPersited: msgOptions.isPersited,\n          isCounted: msgOptions.isCounted,\n          isMentioned: false,\n          disableNotification: false,\n          isStatusMessage: false,\n          canIncludeExpansion: false,\n          expansion: null,\n          receivedStatus: status,\n          messageId: messageId\n        };\n\n        if (direction === MessageDirection$1.RECEIVE) {\n          msg.receivedStatus = status;\n        } else if (direction === MessageDirection$1.SEND) {\n          msg.sentStatus = status;\n        }\n\n        return msg;\n      }\n    }, {\n      key: \"_buildConversation\",\n      value: function _buildConversation(result) {\n        var conver = JSON.parse(result);\n        var conversationType = conver.conversationType,\n            targetId = conver.targetId,\n            unreadMessageCount = conver.unreadCount,\n            lastestMsg = conver.lastestMsg,\n            isTop = conver.isTop,\n            isBlocked = conver.isBlocked;\n        var isTopToBool = isTop === 1;\n        var isNotify = isBlocked === 1 ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE;\n        return {\n          conversationType: conversationType,\n          targetId: targetId,\n          unreadMessageCount: unreadMessageCount,\n          latestMessage: this._buildMessage(lastestMsg),\n          hasMentioned: false,\n          mentionedInfo: null,\n          notificationStatus: isNotify,\n          isTop: isTopToBool,\n          lastUnreadTime: 0\n        };\n      }\n    }, {\n      key: \"_setConnectionStatusListener\",\n      value: function _setConnectionStatusListener(listener) {\n        var _this86 = this;\n\n        this._connectionListener = listener;\n\n        this._cppProtocol.setConnectionStatusListener(function (status) {\n          var _this87 = this;\n\n          _newArrowCheck(this, _this86);\n\n          logger.warn('protocol connection status changed:', status);\n          this._cppConnectionStatus = status;\n          var connectionStatus;\n\n          switch (status) {\n            case 10:\n              connectionStatus = ConnectionStatus$1.CONNECTING;\n              break;\n\n            case 31004:\n              setTimeout(function () {\n                _newArrowCheck(this, _this87);\n\n                this._promiseHandler.connect && this._promiseHandler.connect.resolve(ErrorCode$1.RC_CONN_USER_OR_PASSWD_ERROR);\n              }.bind(this));\n              return;\n\n            case 12:\n              connectionStatus = ConnectionStatus$1.DISCONNECTED;\n              break;\n\n            case 13:\n              connectionStatus = ConnectionStatus$1.BLOCKED;\n              break;\n\n            case 1:\n            case 8:\n            case 9:\n            case 11:\n            case 31011:\n            case 30000:\n            case 30002:\n              connectionStatus = ConnectionStatus$1.NETWORK_UNAVAILABLE;\n              break;\n\n            case 30010:\n              this._try2Reconnect();\n\n              connectionStatus = ConnectionStatus$1.NETWORK_UNAVAILABLE;\n              break;\n\n            case 0:\n            case 33005:\n              connectionStatus = ConnectionStatus$1.CONNECTED;\n              this.connectedTime = new Date().getTime() - this._cppProtocol.getDeltaTime();\n              setTimeout(function () {\n                _newArrowCheck(this, _this87);\n\n                this._promiseHandler.connect && this._promiseHandler.connect.resolve(ErrorCode$1.SUCCESS);\n                this._heartbeat = new Heartbeat(true, listener);\n\n                this._heartbeat.start(this._sendHeartbeat, this);\n              }.bind(this));\n              break;\n\n            case ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT:\n              connectionStatus = ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT;\n              break;\n\n            case 30004:\n              return;\n\n            default:\n              connectionStatus = status;\n              break;\n          }\n\n          this._connectionStatus = connectionStatus;\n          setTimeout(function () {\n            _newArrowCheck(this, _this87);\n\n            listener(connectionStatus);\n          }.bind(this));\n        }.bind(this), this._dbInitCallback, function () {\n          _newArrowCheck(this, _this86);\n\n          this._heartbeat.setHeartbeatRes(true);\n        }.bind(this));\n      }\n    }, {\n      key: \"_dbInitCallback\",\n      value: function _dbInitCallback(code) {}\n    }, {\n      key: \"_sendHeartbeat\",\n      value: function _sendHeartbeat() {\n        this._cppProtocol.sendHeartbeat();\n      }\n    }, {\n      key: \"_try2Reconnect\",\n      value: function _try2Reconnect() {\n        var _this88 = this;\n\n        if (this._cppConnectionStatus !== 30010 && this._cppConnectionStatus !== 30004) {\n          return;\n        }\n\n        logger.warn('protocol reconnecting');\n\n        this._cppProtocol.connectWithToken(this._currentToken, '', function () {\n          _newArrowCheck(this, _this88);\n        }.bind(this));\n\n        setTimeout(function () {\n          _newArrowCheck(this, _this88);\n\n          this._try2Reconnect();\n        }.bind(this), 5000);\n      }\n    }, {\n      key: \"_setOnReceiveMessageListener\",\n      value: function _setOnReceiveMessageListener(listener) {\n        var _this89 = this;\n\n        this._cppProtocol.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n          _newArrowCheck(this, _this89);\n\n          var message = this._buildMessage(result, offline);\n\n          listener(message);\n        }.bind(this));\n      }\n    }, {\n      key: \"_setConversationStatusListener\",\n      value: function _setConversationStatusListener(listener) {\n        var _this90 = this;\n\n        this._cppProtocol.setConversationStatusListener(function (result) {\n          var _this91 = this;\n\n          _newArrowCheck(this, _this90);\n\n          var list = JSON.parse(result).list;\n          var updatedConvers = [];\n          list.forEach(function (conver) {\n            var _this92 = this;\n\n            _newArrowCheck(this, _this91);\n\n            var converData = JSON.parse(conver.obj);\n            var conversationType = converData.conversationType,\n                targetId = converData.targetId,\n                status = converData.status;\n            var statusObj = {\n              notificationStatus: 2,\n              isTop: false\n            };\n            status.forEach(function (status) {\n              _newArrowCheck(this, _this92);\n\n              var itemObj = JSON.parse(status.item);\n\n              if (itemObj.type === 1) {\n                statusObj.notificationStatus = Number(itemObj.value) === 1 ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE;\n              } else {\n                statusObj.isTop = Number(itemObj.value) === 1;\n              }\n            }.bind(this));\n            updatedConvers.push({\n              conversationType: conversationType,\n              targetId: targetId,\n              updatedItems: {\n                notificationStatus: {\n                  val: statusObj.notificationStatus,\n                  time: 0\n                },\n                isTop: {\n                  val: statusObj.isTop,\n                  time: 0\n                }\n              }\n            });\n          }.bind(this));\n          listener(updatedConvers);\n        }.bind(this));\n      }\n    }, {\n      key: \"_clearListener\",\n      value: function _clearListener() {\n        this._cppProtocol.setOnReceiveMessageListener();\n\n        this._cppProtocol.setConnectionStatusListener();\n\n        this._cppProtocol.setOnReceiveStatusListener();\n      }\n    }, {\n      key: \"init\",\n      value: function init(appkey, config) {\n        var sdkInfo = this._cppProtocol.initWithAppkey(appkey, config === null || config === void 0 ? void 0 : config.dbPath, config);\n\n        if (sdkInfo) {\n          sdkInfo = JSON.parse(sdkInfo);\n        }\n\n        this._registerMsgTypes();\n\n        return sdkInfo;\n      }\n    }, {\n      key: \"registerMessageType\",\n      value: function registerMessageType(messageType, isPersited, isCounted, searchProps) {\n        var msgOptions = 0;\n\n        if (isPersited) {\n          msgOptions = msgOptions | 0x01;\n        }\n\n        if (isCounted) {\n          msgOptions = msgOptions | 0x02;\n        }\n\n        this._customMessageType[messageType] = {\n          isCounted: isCounted,\n          isPersited: isPersited\n        };\n\n        this._cppProtocol.registerMessageType(messageType, msgOptions, searchProps);\n      }\n    }, {\n      key: \"connect\",\n      value: function connect(token, naviInfo, connectType, userId) {\n        var _this93 = this;\n\n        var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};\n        this._currentToken = token;\n\n        if (options.type) {\n          this._cppProtocol.setEnvironment(true);\n        }\n\n        this._cppProtocol.connectWithToken(token, userId, function (userId) {\n          _newArrowCheck(this, _this93);\n\n          this.currentUserId = userId;\n        }.bind(this));\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this93);\n\n          this._promiseHandler.connect = {\n            resolve: resolve,\n            reject: reject\n          };\n        }.bind(this));\n      }\n    }, {\n      key: \"disconnect\",\n      value: function disconnect() {\n        this._cppProtocol.disconnect(true);\n\n        this._heartbeat.stop();\n\n        this._connectionListener(ConnectionStatus$1.DISCONNECTED);\n      }\n    }, {\n      key: \"logout\",\n      value: function logout() {\n        this.disconnect();\n      }\n    }, {\n      key: \"getConnectTime\",\n      value: function getConnectTime() {\n        var _this94 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this94);\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: this.connectedTime\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"setUserStatusListener\",\n      value: function setUserStatusListener(config, listener) {\n        var _this95 = this;\n\n        this._cppProtocol.setOnReceiveStatusListener(function (userId, status) {\n          _newArrowCheck(this, _this95);\n\n          listener({\n            userId: userId,\n            status: status\n          });\n        }.bind(this));\n\n        var userIds = config.userIds || [];\n\n        if (userIds.length) {\n          this.subscribeUserStatus(userIds);\n        }\n      }\n    }, {\n      key: \"subscribeUserStatus\",\n      value: function subscribeUserStatus(userIds) {\n        var _this96 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this97 = this;\n\n          _newArrowCheck(this, _this96);\n\n          this._cppProtocol.subscribeUserStatus(userIds, function () {\n            _newArrowCheck(this, _this97);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"setUserStatus\",\n      value: function setUserStatus(status) {\n        var _this98 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this99 = this;\n\n          _newArrowCheck(this, _this98);\n\n          this._cppProtocol.setUserStatus(status, function () {\n            _newArrowCheck(this, _this99);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"getUserStatus\",\n      value: function getUserStatus(userId) {\n        var _this100 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this101 = this;\n\n          _newArrowCheck(this, _this100);\n\n          this._cppProtocol.getUserStatus(userId, function (status) {\n            _newArrowCheck(this, _this101);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: {\n                status: status\n              }\n            });\n          }.bind(this), function (code) {\n            _newArrowCheck(this, _this101);\n\n            resolve({\n              code: code\n            });\n          }.bind(this));\n        }.bind(this));\n      }\n    }, {\n      key: \"sendMessage\",\n      value: function sendMessage(conversationType, targetId, options) {\n        var _this102 = this;\n\n        var messageType = options.messageType,\n            content = options.content,\n            pushContent = options.pushContent,\n            pushData = options.pushData,\n            directionalUserIdList = options.directionalUserIdList,\n            disableNotification = options.disableNotification,\n            canIncludeExpansion = options.canIncludeExpansion,\n            expansion = options.expansion,\n            isVoipPush = options.isVoipPush,\n            pushConfig = options.pushConfig;\n\n        var _ref3 = pushConfig || {},\n            iOSConfig = _ref3.iOSConfig,\n            androidConfig = _ref3.androidConfig,\n            pushTitle = _ref3.pushTitle,\n            newPushContent = _ref3.pushContent,\n            newPushData = _ref3.pushData,\n            disablePushTitle = _ref3.disablePushTitle,\n            forceShowDetailContent = _ref3.forceShowDetailContent;\n\n        var serverPushConfigStr = pushConfigsToJSON(iOSConfig, androidConfig);\n        return new Promise(function (resolve, reject) {\n          var _this103 = this;\n\n          _newArrowCheck(this, _this102);\n\n          pushContent = pushContent || '';\n          pushData = pushData || '';\n          disableNotification = disableNotification || false;\n          expansion = expansion || '';\n          isVoipPush = isVoipPush || false;\n          pushTitle = pushTitle || '';\n          newPushContent = newPushContent || '';\n          newPushData = newPushData || '';\n          disablePushTitle = disablePushTitle || false;\n          forceShowDetailContent = forceShowDetailContent || false;\n          canIncludeExpansion = canIncludeExpansion || false;\n          var notificationId = (androidConfig === null || androidConfig === void 0 ? void 0 : androidConfig.notificationId) || '';\n          var isGroup = conversationType === ConversationType$1.GROUP;\n          directionalUserIdList = [];\n\n          if (isGroup && messageType === MessageType$1.READ_RECEIPT_RESPONSE) {\n            if (content.receiptMessageDic) {\n              for (var _key19 in content.receiptMessageDic) {\n                directionalUserIdList === null || directionalUserIdList === void 0 ? void 0 : directionalUserIdList.push(_key19);\n              }\n            }\n          }\n\n          if (isGroup && messageType === MessageType$1.READ_RECEIPT_REQUEST) {\n            directionalUserIdList === null || directionalUserIdList === void 0 ? void 0 : directionalUserIdList.push(this.currentUserId);\n          }\n\n          var onSuccess = function onSuccess(message, code) {\n            _newArrowCheck(this, _this103);\n\n            var msg = this._buildMessage(message, false);\n\n            if (code === ErrorCode$1.SENSITIVE_REPLACE) {\n              return resolve({\n                code: code\n              });\n            }\n\n            return resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: msg\n            });\n          }.bind(this);\n\n          var onError = function onError(message, code) {\n            _newArrowCheck(this, _this103);\n\n            var msg = this._buildMessage(message, false);\n\n            return resolve({\n              code: code,\n              data: msg\n            });\n          }.bind(this);\n\n          var pushTplId = '';\n\n          this._cppProtocol.sendMessage(onSuccess, onError, conversationType, targetId, messageType, JSON.stringify(content), directionalUserIdList, disableNotification, disablePushTitle, forceShowDetailContent, pushContent, pushData, notificationId, pushTitle, serverPushConfigStr, pushTplId, canIncludeExpansion, JSON.stringify(expansion), isVoipPush);\n        }.bind(this));\n      }\n    }, {\n      key: \"recallMsg\",\n      value: function recallMsg(conversationType, targetId, messageUId, sentTime, user, pushContent) {\n        var _this104 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this105 = this;\n\n          _newArrowCheck(this, _this104);\n\n          pushContent = pushContent || '';\n          var message = {\n            conversationType: conversationType,\n            targetId: targetId,\n            senderUserId: this.currentUserId,\n            content: null,\n            objectName: MessageType$1.RECALL,\n            messageUid: messageUId,\n            messageDirection: MessageDirection$1.SEND,\n            status: ReceivedStatus$1.UNREAD,\n            sentTime: sentTime\n          };\n\n          var returnMsg = this._buildMessage(JSON.stringify(message), false);\n\n          var disableNotification = false;\n          var disablePushTitle = false;\n          var forceShowDetailContent = false;\n          var pushData = '';\n          var notificationId = '';\n          var pushTitle = '';\n          var pushConfig = '';\n          var pushTemplateId = '';\n\n          var onSuccess = function onSuccess() {\n            _newArrowCheck(this, _this105);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: returnMsg\n            });\n          }.bind(this);\n\n          var onError = function onError(code) {\n            _newArrowCheck(this, _this105);\n\n            resolve({\n              code: code\n            });\n          }.bind(this);\n\n          this._cppProtocol.recallMessage(onSuccess, onError, MessageType$1.RECALL, JSON.stringify(returnMsg), disableNotification, disablePushTitle, forceShowDetailContent, pushContent, pushData, notificationId, pushTitle, pushConfig, pushTemplateId);\n        }.bind(this));\n      }\n    }, {\n      key: \"getHistoryMessage\",\n      value: function getHistoryMessage(conversationType, targetId, timestamp, count, order, messageType) {\n        var _this106 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this106);\n\n          timestamp = timestamp || 0;\n          messageType = messageType || '';\n          var desc = order === 0;\n\n          var cppMessagaes = this._cppProtocol.getHistoryMessages(conversationType, targetId, timestamp, count, messageType, desc);\n\n          var messages = JSON.parse(cppMessagaes).list;\n          var hisMessages = [];\n          messages.reverse();\n\n          for (var i = 0; i < messages.length; i++) {\n            var buildMsg = this._buildMessage(messages[i].obj);\n\n            hisMessages[i] = buildMsg;\n          }\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: {\n              list: hisMessages,\n              hasMore: messages.length === count\n            }\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"deleteRemoteMessage\",\n      value: function deleteRemoteMessage(conversationType, targetId, messages) {\n        var _this107 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this107);\n\n          this._cppProtocol.clearMessages(conversationType, targetId);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"deleteRemoteMessageByTimestamp\",\n      value: function deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp) {\n        var _this108 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this109 = this;\n\n          _newArrowCheck(this, _this108);\n\n          var onSuccess = function onSuccess() {\n            _newArrowCheck(this, _this109);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this);\n\n          var onError = function onError(code) {\n            _newArrowCheck(this, _this109);\n\n            resolve(code);\n          }.bind(this);\n\n          this._cppProtocol.clearRemoteHistoryMessages(conversationType, targetId, timestamp, onSuccess, onError);\n        }.bind(this));\n      }\n    }, {\n      key: \"getConversationList\",\n      value: function getConversationList(count, conversationType, startTime, order) {\n        var _this110 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this110);\n\n          var converTypes = [1, 3, 6, 7];\n\n          var result = this._cppProtocol.getConversationList(converTypes);\n\n          var resultList = JSON.parse(result);\n          var converList = resultList.list;\n          var convers = [];\n\n          for (var i = 0; i < converList.length; i++) {\n            convers.push(this._buildConversation(converList[i].obj));\n          }\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: convers\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"getConversation\",\n      value: function getConversation(conversationType, targetId) {\n        var _this111 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this111);\n\n          var result = this._cppProtocol.getConversation(conversationType, targetId);\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: this._buildConversation(result)\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"removeConversation\",\n      value: function removeConversation(conversationType, targetId) {\n        var _this112 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this112);\n\n          this._cppProtocol.removeConversation(conversationType, targetId);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"clearConversations\",\n      value: function clearConversations() {\n        var _this113 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this113);\n\n          this._cppProtocol.clearConversations();\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"getAllConversationUnreadCount\",\n      value: function getAllConversationUnreadCount() {\n        var _this114 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this114);\n\n          var count = this._cppProtocol.getTotalUnreadCount();\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: count\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"getConversationUnreadCount\",\n      value: function getConversationUnreadCount(conversationType, targetId) {\n        var _this115 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this115);\n\n          var count = this._cppProtocol.getUnreadCount(conversationType, targetId);\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: count\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"clearConversationUnreadCount\",\n      value: function clearConversationUnreadCount(conversationType, targetId) {\n        var _this116 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this116);\n\n          this._cppProtocol.clearUnreadCount(conversationType, targetId);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"clearUnreadCountByTimestamp\",\n      value: function clearUnreadCountByTimestamp(conversationType, targetId) {\n        var _this117 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this117);\n\n          this._cppProtocol.clearUnreadCountByTimestamp(conversationType, targetId);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"setConversationToTop\",\n      value: function setConversationToTop(conversationType, targetId, isTop) {\n        var _this118 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this118);\n\n          this._cppProtocol.setConversationToTop(conversationType, targetId, isTop);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"setConversationHidden\",\n      value: function setConversationHidden(conversationType, targetId, isHidden) {\n        var _this119 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this119);\n\n          this._cppProtocol.setConversationHidden(conversationType, targetId, isHidden);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"setConversationNotificationStatus\",\n      value: function setConversationNotificationStatus(conversationType, targetId, isNotify) {\n        var _this120 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this121 = this;\n\n          _newArrowCheck(this, _this120);\n\n          this._cppProtocol.setConversationNotificationStatus(conversationType, targetId, isNotify, function () {\n            _newArrowCheck(this, _this121);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"getConversationNotificationStatus\",\n      value: function getConversationNotificationStatus(conversationType, targetId) {\n        var _this122 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this122);\n\n          var notify = this._cppProtocol.getConversationNotificationStatus(conversationType, targetId);\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: notify\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"searchConversationByContent\",\n      value: function searchConversationByContent(keyword, conversationTypes) {\n        var _this123 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this123);\n\n          conversationTypes = conversationTypes || [1, 3, 6, 7];\n\n          var data = this._cppProtocol.searchConversationByContent(conversationTypes, keyword);\n\n          var list = JSON.parse(data).list;\n          var convers = [];\n\n          for (var i = 0; i < list.length; i++) {\n            convers[i] = this._buildConversation(list[i].obj);\n          }\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: convers\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"searchMessageByContent\",\n      value: function searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total) {\n        var _this124 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this125 = this;\n\n          _newArrowCheck(this, _this124);\n\n          this._cppProtocol.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (result, matched) {\n            _newArrowCheck(this, _this125);\n\n            var list = result ? JSON.parse(result).list : [];\n            var msgs = [];\n\n            for (var i = 0; i < list.length; i++) {\n              msgs[i] = this._buildMessage(list[i].obj);\n            }\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: msgs\n            });\n          }.bind(this), function (code) {\n            _newArrowCheck(this, _this125);\n\n            resolve({\n              code: code\n            });\n          }.bind(this));\n        }.bind(this));\n      }\n    }, {\n      key: \"getUnreadMentionedMessages\",\n      value: function getUnreadMentionedMessages(conversationType, targetId) {\n        var mentions = JSON.parse(this._cppProtocol.getUnreadMentionedMessages(conversationType, targetId)).list;\n\n        for (var i = 0; i < mentions.length; i++) {\n          mentions[i] = this._buildMessage(mentions[i].obj);\n        }\n\n        return mentions;\n      }\n    }, {\n      key: \"addToBlacklist\",\n      value: function addToBlacklist(userId) {\n        var _this126 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this127 = this;\n\n          _newArrowCheck(this, _this126);\n\n          this._cppProtocol.addToBlacklist(userId, function () {\n            _newArrowCheck(this, _this127);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"removeFromBlacklist\",\n      value: function removeFromBlacklist(userId) {\n        var _this128 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this129 = this;\n\n          _newArrowCheck(this, _this128);\n\n          this._cppProtocol.removeFromBlacklist(userId, function () {\n            _newArrowCheck(this, _this129);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"getBlacklist\",\n      value: function getBlacklist() {\n        var _this130 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this131 = this;\n\n          _newArrowCheck(this, _this130);\n\n          this._cppProtocol.getBlacklist(function (userIds) {\n            _newArrowCheck(this, _this131);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: userIds\n            });\n          }.bind(this), function (code) {\n            _newArrowCheck(this, _this131);\n\n            resolve({\n              code: code\n            });\n          }.bind(this));\n        }.bind(this));\n      }\n    }, {\n      key: \"getBlacklistStatus\",\n      value: function getBlacklistStatus(userId) {\n        var _this132 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this133 = this;\n\n          _newArrowCheck(this, _this132);\n\n          this._cppProtocol.getBlacklistStatus(userId, function (result) {\n            _newArrowCheck(this, _this133);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: result\n            });\n          }.bind(this), function (code) {\n            _newArrowCheck(this, _this133);\n\n            resolve({\n              code: code\n            });\n          }.bind(this));\n        }.bind(this));\n      }\n    }, {\n      key: \"insertMessage\",\n      value: function insertMessage(conversationType, targetId, senderUserId, messageType, msgContent, direction) {\n        var _this134 = this;\n\n        msgContent = JSON.stringify(msgContent);\n        return new Promise(function (resolve, reject) {\n          var _this135 = this;\n\n          _newArrowCheck(this, _this134);\n\n          var msg = this._cppProtocol.insertMessage(conversationType, targetId, senderUserId, messageType, msgContent, function () {\n            _newArrowCheck(this, _this135);\n          }.bind(this), function (error) {\n            _newArrowCheck(this, _this135);\n\n            resolve({\n              code: error\n            });\n          }.bind(this), direction);\n\n          var receivedMessage = this._buildMessage(msg, false);\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: receivedMessage\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"deleteMessages\",\n      value: function deleteMessages(timestamps) {\n        var _this136 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this136);\n\n          this._cppProtocol.deleteMessages(timestamps);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"deleteMessagesByTimestamp\",\n      value: function deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace) {\n        var _this137 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this137);\n\n          this._cppProtocol.deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"getMessage\",\n      value: function getMessage(messageId) {\n        var _this138 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this138);\n\n          var result = this._cppProtocol.getMessage(messageId);\n\n          var message = this._buildMessage(result, false);\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: message\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"setMessageContent\",\n      value: function setMessageContent(messageId, content, messageType) {\n        var _this139 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this139);\n\n          content = JSON.stringify(content);\n\n          this._cppProtocol.setMessageContent(messageId, content, messageType);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"setMessageSearchField\",\n      value: function setMessageSearchField(messageId, content, searchFiles) {\n        var _this140 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this140);\n\n          this._cppProtocol.setMessageSearchField(messageId, content, searchFiles);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"setMessageSentStatus\",\n      value: function setMessageSentStatus(messageId, sentStatus) {\n        var _this141 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this141);\n\n          this._cppProtocol.setMessageSentStatus(messageId, sentStatus);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"setMessageReceivedStatus\",\n      value: function setMessageReceivedStatus(messageId, receivedStatus) {\n        var _this142 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this142);\n\n          this._cppProtocol.setMessageReceivedStatus(messageId, receivedStatus);\n\n          resolve(ErrorCode$1.SUCCESS);\n        }.bind(this));\n      }\n    }, {\n      key: \"saveConversationMessageDraft\",\n      value: function saveConversationMessageDraft(conversationType, targetId, draft) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getConversationMessageDraft\",\n      value: function getConversationMessageDraft(conversationType, targetId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"clearConversationMessageDraft\",\n      value: function clearConversationMessageDraft(conversationType, targetId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"pullConversationStatus\",\n      value: function pullConversationStatus(timestamp) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"batchSetConversationStatus\",\n      value: function batchSetConversationStatus(statusList) {\n        var _statusList$ = statusList[0],\n            conversationType = _statusList$.conversationType,\n            targetId = _statusList$.targetId,\n            isTop = _statusList$.isTop,\n            notificationStatus = _statusList$.notificationStatus;\n\n        if (isTop !== undefined) {\n          return this.setConversationToTop(conversationType, targetId, isTop);\n        } else if (notificationStatus !== undefined) {\n          var isBlocked = notificationStatus === NotificationStatus$1.OPEN;\n          return this.setConversationNotificationStatus(conversationType, targetId, isBlocked);\n        } else {\n          this.setConversationToTop(conversationType, targetId, isTop);\n\n          var _isBlocked = notificationStatus === NotificationStatus$1.OPEN;\n\n          return this.setConversationNotificationStatus(conversationType, targetId, _isBlocked);\n        }\n      }\n    }, {\n      key: \"pullUserSettings\",\n      value: function pullUserSettings(version) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"joinChatroom\",\n      value: function joinChatroom(chatroomId, count) {\n        var _this143 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this144 = this;\n\n          _newArrowCheck(this, _this143);\n\n          this._cppProtocol.joinChatRoom(chatroomId, count, function () {\n            _newArrowCheck(this, _this144);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"joinExistChatroom\",\n      value: function joinExistChatroom(chatroomId, count) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"quitChatroom\",\n      value: function quitChatroom(chatroomId) {\n        var _this145 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this146 = this;\n\n          _newArrowCheck(this, _this145);\n\n          this._cppProtocol.quitChatRoom(chatroomId, function () {\n            _newArrowCheck(this, _this146);\n\n            resolve(ErrorCode$1.SUCCESS);\n          }.bind(this), resolve);\n        }.bind(this));\n      }\n    }, {\n      key: \"getChatroomInfo\",\n      value: function getChatroomInfo(chatroomId, count, order) {\n        var _this147 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this148 = this;\n\n          _newArrowCheck(this, _this147);\n\n          this._cppProtocol.getChatroomInfo(chatroomId, count, order, function (result, count) {\n            _newArrowCheck(this, _this148);\n\n            var list = result ? JSON.parse(result).list : [];\n            var userInfos = [];\n\n            if (list.length > 0) {\n              for (var i = 0; i < list.length; i++) {\n                userInfos.push(JSON.parse(list[i].obj));\n              }\n            }\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: {\n                userInfos: userInfos,\n                userCount: count\n              }\n            });\n          }.bind(this), function (code) {\n            _newArrowCheck(this, _this148);\n\n            resolve({\n              code: code\n            });\n          }.bind(this));\n        }.bind(this));\n      }\n    }, {\n      key: \"getChatroomHistoryMessages\",\n      value: function getChatroomHistoryMessages(chatroomId, timestamp, count, order) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setChatroomEntry\",\n      value: function setChatroomEntry(chatroomId, entry) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"forceSetChatroomEntry\",\n      value: function forceSetChatroomEntry(chatroomId, entry) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"removeChatroomEntry\",\n      value: function removeChatroomEntry(chatroomId, entry) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"forceRemoveChatroomEntry\",\n      value: function forceRemoveChatroomEntry(chatroomId, entry) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getChatroomEntry\",\n      value: function getChatroomEntry(chatroomId, key) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getAllChatroomEntry\",\n      value: function getAllChatroomEntry(chatroomId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getFileToken\",\n      value: function getFileToken(fileType, fileName) {\n        var _this149 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this150 = this;\n\n          _newArrowCheck(this, _this149);\n\n          var uploadFileName = getUploadFileName(fileType, fileName);\n\n          this._cppProtocol.getUploadToken(fileType, uploadFileName, function (token, bosToken, bosDate, bosPath, ossToken, ossPolicy, ossSignature, ossBucketName) {\n            _newArrowCheck(this, _this150);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: {\n                token: token,\n                deadline: 0,\n                bosToken: bosToken,\n                bosDate: bosDate,\n                path: bosPath,\n                osskeyId: ossToken,\n                ossPolicy: ossPolicy,\n                ossSign: ossSignature,\n                ossBucketName: ossBucketName,\n                fileName: uploadFileName\n              }\n            });\n          }.bind(this), function (code) {\n            _newArrowCheck(this, _this150);\n\n            resolve({\n              code: code\n            });\n          }.bind(this));\n        }.bind(this));\n      }\n    }, {\n      key: \"getFileUrl\",\n      value: function getFileUrl(fileType, uploadMethod, fileName, originName) {\n        var _this151 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this152 = this;\n\n          _newArrowCheck(this, _this151);\n\n          var onSuccess = function onSuccess(url) {\n            _newArrowCheck(this, _this152);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: {\n                downloadUrl: url\n              }\n            });\n          }.bind(this);\n\n          var onError = function onError(code) {\n            _newArrowCheck(this, _this152);\n\n            resolve({\n              code: code\n            });\n          }.bind(this);\n\n          var isOss = uploadMethod === UploadMethod$1.ALI;\n          var mimeKey = getMimeKey(fileType);\n\n          this._cppProtocol.getDownloadUrl(fileType, mimeKey, originName, isOss, onSuccess, onError);\n        }.bind(this));\n      }\n    }, {\n      key: \"clearData\",\n      value: function clearData() {\n        var _this153 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this153);\n\n          var result = this._cppProtocol.clearData();\n\n          resolve({\n            code: ErrorCode$1.SUCCESS,\n            data: result\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"setDeviceInfo\",\n      value: function setDeviceInfo(device) {\n        var _this154 = this;\n\n        return new Promise(function (resolve, reject) {\n          _newArrowCheck(this, _this154);\n\n          var id = device.id || '';\n\n          this._cppProtocol.setDeviceInfo({\n            id: id\n          });\n        }.bind(this));\n      }\n    }, {\n      key: \"getVoIPKey\",\n      value: function getVoIPKey(engineType, channelName) {\n        var _this155 = this;\n\n        return new Promise(function (resolve, reject) {\n          var _this156 = this;\n\n          _newArrowCheck(this, _this155);\n\n          var extra = '';\n\n          var onSuccess = function onSuccess(token) {\n            _newArrowCheck(this, _this156);\n\n            resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: token\n            });\n          }.bind(this);\n\n          var onError = function onError(code) {\n            _newArrowCheck(this, _this156);\n\n            resolve({\n              code: code\n            });\n          }.bind(this);\n\n          this._cppProtocol.getVoIPKey(engineType, channelName, extra, onSuccess, onError);\n        }.bind(this));\n      }\n    }, {\n      key: \"joinRTCRoom\",\n      value: function joinRTCRoom(roomId, mode, broadcastType) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"quitRTCRoom\",\n      value: function quitRTCRoom(roomId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"rtcPing\",\n      value: function rtcPing(roomId, mode, broadcastType) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCRoomInfo\",\n      value: function getRTCRoomInfo(roomId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCUserInfoList\",\n      value: function getRTCUserInfoList(roomId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCUserInfo\",\n      value: function getRTCUserInfo(roomId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setRTCUserInfo\",\n      value: function setRTCUserInfo(roomId, key, value) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"removeRTCUserInfo\",\n      value: function removeRTCUserInfo(roomId, keys) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setRTCData\",\n      value: function setRTCData(roomId, key, value, isInner, apiType, message) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setRTCTotalRes\",\n      value: function setRTCTotalRes(roomId, message, valueInfo, messageType) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCData\",\n      value: function getRTCData(roomId, keys, isInner, apiType) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"removeRTCData\",\n      value: function removeRTCData(roomId, keys, isInner, apiType, message) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setRTCOutData\",\n      value: function setRTCOutData(roomId, rtcData, type, message) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCOutData\",\n      value: function getRTCOutData(roomId, userIds) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCToken\",\n      value: function getRTCToken(roomId, mode, broadcastType) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"setRTCState\",\n      value: function setRTCState(roomId, reportId) {\n        throw new Error('Method not implemented.');\n      }\n    }, {\n      key: \"getRTCUserList\",\n      value: function getRTCUserList(roomId) {\n        throw new Error('Method not implemented.');\n      }\n    }]);\n\n    return CPPEngine;\n  }(AEngine);\n\n  var PluginContext = function () {\n    function PluginContext(_context) {\n      _classCallCheck(this, PluginContext);\n\n      this._context = _context;\n    }\n\n    _createClass(PluginContext, [{\n      key: \"getCoreVersion\",\n      value: function getCoreVersion() {\n        return this._context.coreVersion;\n      }\n    }, {\n      key: \"getAPIVersion\",\n      value: function getAPIVersion() {\n        return this._context.apiVersion;\n      }\n    }, {\n      key: \"getAppkey\",\n      value: function getAppkey() {\n        return this._context.appkey;\n      }\n    }, {\n      key: \"getCurrentId\",\n      value: function getCurrentId() {\n        return this._context.getCurrentUserId();\n      }\n    }, {\n      key: \"getConnectionStatus\",\n      value: function getConnectionStatus() {\n        return this._context.getConnectionStatus();\n      }\n    }, {\n      key: \"sendMessage\",\n      value: function sendMessage(conversationType, targetId, options) {\n        return this._context.sendMessage(conversationType, targetId, options);\n      }\n    }, {\n      key: \"registerMessageType\",\n      value: function registerMessageType(objectName, isPersited, isCounted) {\n        var searchProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n        this._context.registerMessageType(objectName, isPersited, isCounted, searchProps);\n      }\n    }]);\n\n    return PluginContext;\n  }();\n\n  var RTCPluginContext = function (_PluginContext) {\n    _inherits(RTCPluginContext, _PluginContext);\n\n    var _super20 = _createSuper(RTCPluginContext);\n\n    function RTCPluginContext() {\n      _classCallCheck(this, RTCPluginContext);\n\n      return _super20.apply(this, arguments);\n    }\n\n    _createClass(RTCPluginContext, [{\n      key: \"getNaviInfo\",\n      value: function getNaviInfo() {\n        return this._context.getInfoFromCache();\n      }\n    }, {\n      key: \"joinRTCRoom\",\n      value: function joinRTCRoom(roomId, mode, broadcastType) {\n        return this._context.joinRTCRoom(roomId, mode, broadcastType);\n      }\n    }, {\n      key: \"quitRTCRoom\",\n      value: function quitRTCRoom(roomId) {\n        return this._context.quitRTCRoom(roomId);\n      }\n    }, {\n      key: \"rtcPing\",\n      value: function rtcPing(roomId, mode, broadcastType) {\n        return this._context.rtcPing(roomId, mode, broadcastType);\n      }\n    }, {\n      key: \"getRTCRoomInfo\",\n      value: function getRTCRoomInfo(roomId) {\n        return this._context.getRTCRoomInfo(roomId);\n      }\n    }, {\n      key: \"getRTCUserInfoList\",\n      value: function getRTCUserInfoList(roomId) {\n        return this._context.getRTCUserInfoList(roomId);\n      }\n    }, {\n      key: \"getRTCUserInfo\",\n      value: function getRTCUserInfo(roomId) {\n        return this._context.getRTCUserInfo(roomId);\n      }\n    }, {\n      key: \"setRTCUserInfo\",\n      value: function setRTCUserInfo(roomId, key, value) {\n        return this._context.setRTCUserInfo(roomId, key, value);\n      }\n    }, {\n      key: \"removeRTCUserInfo\",\n      value: function removeRTCUserInfo(roomId, keys) {\n        return this._context.removeRTCUserInfo(roomId, keys);\n      }\n    }, {\n      key: \"setRTCData\",\n      value: function setRTCData(roomId, key, value, isInner, apiType, message) {\n        return this._context.setRTCData(roomId, key, value, isInner, apiType, message);\n      }\n    }, {\n      key: \"setRTCTotalRes\",\n      value: function setRTCTotalRes(roomId, message, valueInfo, objectName) {\n        return this._context.setRTCTotalRes(roomId, message, valueInfo, objectName);\n      }\n    }, {\n      key: \"getRTCData\",\n      value: function getRTCData(roomId, keys, isInner, apiType) {\n        return this._context.getRTCData(roomId, keys, isInner, apiType);\n      }\n    }, {\n      key: \"removeRTCData\",\n      value: function removeRTCData(roomId, keys, isInner, apiType, message) {\n        return this._context.removeRTCData(roomId, keys, isInner, apiType, message);\n      }\n    }, {\n      key: \"setRTCOutData\",\n      value: function setRTCOutData(roomId, rtcData, type, message) {\n        return this._context.setRTCOutData(roomId, rtcData, type, message);\n      }\n    }, {\n      key: \"getRTCOutData\",\n      value: function getRTCOutData(roomId, userIds) {\n        return this._context.getRTCOutData(roomId, userIds);\n      }\n    }, {\n      key: \"getRTCToken\",\n      value: function getRTCToken(roomId, mode, broadcastType) {\n        return this._context.getRTCToken(roomId, mode, broadcastType);\n      }\n    }, {\n      key: \"setRTCState\",\n      value: function setRTCState(roomId, report) {\n        return this._context.setRTCState(roomId, report);\n      }\n    }, {\n      key: \"getRTCUserList\",\n      value: function getRTCUserList(roomId) {\n        return this._context.getRTCUserList(roomId);\n      }\n    }]);\n\n    return RTCPluginContext;\n  }(PluginContext);\n\n  function cloneMessage(message) {\n    return Object.assign({}, message);\n  }\n\n  var APIContext = function () {\n    function APIContext(_runtime, options) {\n      var _this157 = this;\n\n      _classCallCheck(this, APIContext);\n\n      this._runtime = _runtime;\n      this._token = '';\n      this._pluginContextQueue = [];\n      this.coreVersion = \"4.1.0\";\n      this._connectionStatus = ConnectionStatus$1.DISCONNECTED;\n      this._watcher = {\n        message: undefined,\n        conversationState: undefined,\n        chatroomState: undefined,\n        connectionState: undefined,\n        rtcInnerWatcher: undefined,\n        expansion: undefined\n      };\n      this._options = Object.assign({}, options);\n      this.appkey = this._options.appkey;\n      this.apiVersion = this._options.apiVersion;\n      var _this$_options = this._options,\n          isEnterPrise = _this$_options.isEnterPrise,\n          appkey = _this$_options.appkey,\n          miniCMPProxy = _this$_options.miniCMPProxy,\n          apiVersion = _this$_options.apiVersion,\n          connectionType = _this$_options.connectionType;\n\n      if (_runtime.tag === \"electron\" && !this._options.cppProtocol) {\n        var msg = 'cppProtocol is required';\n        logger.error(msg);\n        throw new Error(msg);\n      }\n\n      if (isEnterPrise && this._options.navigators.length === 0) {\n        var _msg = 'private navigators is required';\n        logger.error(_msg);\n        throw new Error(_msg);\n      }\n\n      this._options.navigators = this._options.navigators.filter(function (item) {\n        _newArrowCheck(this, _this157);\n\n        return /^https?:\\/\\//.test(item);\n      }.bind(this));\n\n      if (this._options.navigators.length === 0) {\n        var _this$_options$naviga;\n\n        if (isEnterPrise) {\n          var _msg2 = 'navi urls is invalid';\n          logger.error(_msg2);\n          throw new Error(_msg2);\n        }\n\n        (_this$_options$naviga = this._options.navigators).push.apply(_this$_options$naviga, PUBLIC_CLOUD_NAVI_URIS);\n      }\n\n      this._navi = new Navi(_runtime, appkey, this._options.navigators, miniCMPProxy, apiVersion, connectionType);\n      var engineWatcher = {\n        status: this._connectionStatusListener.bind(this),\n        message: this._messageReceiver.bind(this),\n        chatroom: this._chatroomInfoListener.bind(this),\n        conversation: this._conversationInfoListener.bind(this),\n        expansion: this._expansionInfoListener.bind(this)\n      };\n      this._engine = this._options.cppProtocol ? new CPPEngine(_runtime, appkey, engineWatcher, apiVersion, this._options.cppProtocol, this._options) : new JSEngine(_runtime, appkey, engineWatcher, apiVersion);\n    }\n\n    _createClass(APIContext, [{\n      key: \"install\",\n      value: function install(plugin, options) {\n        var context = plugin.tag === 'RCRTC' ? new RTCPluginContext(this) : new PluginContext(this);\n        var pluginClient = null;\n\n        try {\n          if (!plugin.verify(this._runtime)) {\n            return null;\n          }\n\n          pluginClient = plugin.setup(context, this._runtime, options);\n        } catch (error) {\n          logger.error('install plugin error!\\n', error);\n        }\n\n        pluginClient && this._pluginContextQueue.push(context);\n        return pluginClient;\n      }\n    }, {\n      key: \"_connectionStatusListener\",\n      value: function _connectionStatusListener(status) {\n        var _this158 = this;\n\n        var _a;\n\n        this._connectionStatus = status;\n        ((_a = this._watcher.rtcInnerWatcher) === null || _a === void 0 ? void 0 : _a.status) && this._watcher.rtcInnerWatcher.status(status);\n\n        this._pluginContextQueue.forEach(function (item) {\n          _newArrowCheck(this, _this158);\n\n          item.onconnectionstatechange && item.onconnectionstatechange(status);\n        }.bind(this));\n\n        this._watcher.connectionState && this._watcher.connectionState(status);\n      }\n    }, {\n      key: \"_messageReceiver\",\n      value: function _messageReceiver(message) {\n        var _this159 = this;\n\n        if (message.conversationType === ConversationType$1.RTC_ROOM || Object.prototype.hasOwnProperty.call(CallLibMsgType, message.messageType)) {\n          if (this._watcher.rtcInnerWatcher && this._watcher.rtcInnerWatcher.message) {\n            this._watcher.rtcInnerWatcher.message(cloneMessage(message));\n\n            return;\n          }\n        }\n\n        if (this._pluginContextQueue.some(function (item) {\n          _newArrowCheck(this, _this159);\n\n          if (!item.onmessage) {\n            return false;\n          }\n\n          try {\n            return item.onmessage(cloneMessage(message));\n          } catch (err) {\n            logger.error('plugin error =>', err);\n            return false;\n          }\n        }.bind(this))) {\n          return;\n        }\n\n        this._watcher.message && this._watcher.message(cloneMessage(message));\n      }\n    }, {\n      key: \"_chatroomInfoListener\",\n      value: function _chatroomInfoListener(info) {\n        this._watcher.chatroomState && this._watcher.chatroomState(info);\n      }\n    }, {\n      key: \"_conversationInfoListener\",\n      value: function _conversationInfoListener(info) {\n        this._watcher.conversationState && this._watcher.conversationState(info);\n      }\n    }, {\n      key: \"_expansionInfoListener\",\n      value: function _expansionInfoListener(info) {\n        this._watcher.expansion && this._watcher.expansion(info);\n      }\n    }, {\n      key: \"assignWatcher\",\n      value: function assignWatcher(watcher) {\n        var _this160 = this;\n\n        Object.keys(this._watcher).forEach(function (key) {\n          _newArrowCheck(this, _this160);\n\n          if (Object.prototype.hasOwnProperty.call(watcher, key)) {\n            var value = watcher[key];\n            this._watcher[key] = isFunction(value) || isObject(value) ? value : undefined;\n          }\n        }.bind(this));\n      }\n    }, {\n      key: \"getConnectedTime\",\n      value: function getConnectedTime() {\n        return this._engine.connectedTime;\n      }\n    }, {\n      key: \"getCurrentUserId\",\n      value: function getCurrentUserId() {\n        return this._engine.currentUserId;\n      }\n    }, {\n      key: \"getConnectionStatus\",\n      value: function getConnectionStatus() {\n        return this._connectionStatus;\n      }\n    }, {\n      key: \"connect\",\n      value: function connect(token) {\n        var refreshNavi = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee58() {\n          var _this161 = this;\n\n          var tmpArr, dynamicUris, isCppMode, naviInfo, code;\n          return regeneratorRuntime.wrap(function _callee58$(_context60) {\n            while (1) {\n              switch (_context60.prev = _context60.next) {\n                case 0:\n                  if (!(this._connectionStatus === ConnectionStatus$1.CONNECTED)) {\n                    _context60.next = 2;\n                    break;\n                  }\n\n                  return _context60.abrupt(\"return\", {\n                    code: ErrorCode$1.SUCCESS,\n                    userId: this._engine.currentUserId\n                  });\n\n                case 2:\n                  if (!(this._connectionStatus === ConnectionStatus$1.CONNECTING)) {\n                    _context60.next = 4;\n                    break;\n                  }\n\n                  return _context60.abrupt(\"return\", {\n                    code: ErrorCode$1.BIZ_ERROR_CONNECTING\n                  });\n\n                case 4:\n                  if (!(typeof token !== 'string' || token.length === 0)) {\n                    _context60.next = 6;\n                    break;\n                  }\n\n                  return _context60.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_CONN_USER_OR_PASSWD_ERROR\n                  });\n\n                case 6:\n                  this._token = token;\n                  tmpArr = token.split('@');\n                  dynamicUris = tmpArr[1] ? tmpArr[1].split(';').map(function (item) {\n                    _newArrowCheck(this, _this161);\n\n                    return /^https?:/.test(item) ? item : \"https://\".concat(item);\n                  }.bind(this)) : [];\n                  isCppMode = !!this._options.cppProtocol;\n                  _context60.next = 12;\n                  return this._navi.getInfo(this._getTokenWithoutNavi(), dynamicUris, refreshNavi, isCppMode);\n\n                case 12:\n                  naviInfo = _context60.sent;\n\n                  if (!(!naviInfo && !isCppMode)) {\n                    _context60.next = 15;\n                    break;\n                  }\n\n                  return _context60.abrupt(\"return\", {\n                    code: ErrorCode$1.RC_NAVI_RESOURCE_ERROR\n                  });\n\n                case 15:\n                  _context60.next = 17;\n                  return this._engine.connect(this._getTokenWithoutNavi(), naviInfo, this._options.connectionType);\n\n                case 17:\n                  code = _context60.sent;\n\n                  if (code === ErrorCode$1.SUCCESS && !isCppMode) {\n                    naviInfo.openUS === 1 && this._pullUserSettings();\n                  }\n\n                  return _context60.abrupt(\"return\", {\n                    code: code,\n                    userId: this._engine.currentUserId\n                  });\n\n                case 20:\n                case \"end\":\n                  return _context60.stop();\n              }\n            }\n          }, _callee58, this);\n        }));\n      }\n    }, {\n      key: \"getConnectTime\",\n      value: function getConnectTime() {\n        return this._engine.getConnectTime();\n      }\n    }, {\n      key: \"_pullUserSettings\",\n      value: function _pullUserSettings() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee59() {\n          return regeneratorRuntime.wrap(function _callee59$(_context61) {\n            while (1) {\n              switch (_context61.prev = _context61.next) {\n                case 0:\n                case \"end\":\n                  return _context61.stop();\n              }\n            }\n          }, _callee59);\n        }));\n      }\n    }, {\n      key: \"disconnect\",\n      value: function disconnect() {\n        var _this162 = this;\n\n        this._engine.disconnect();\n\n        this._pluginContextQueue.forEach(function (item) {\n          _newArrowCheck(this, _this162);\n\n          if (!item.ondisconnect) {\n            return;\n          }\n\n          try {\n            item.ondisconnect();\n          } catch (err) {\n            logger.error('plugin error =>', err);\n          }\n        }.bind(this));\n\n        return Promise.resolve();\n      }\n    }, {\n      key: \"reconnect\",\n      value: function reconnect() {\n        return this.connect(this._getTokenWithoutNavi());\n      }\n    }, {\n      key: \"_getTokenWithoutNavi\",\n      value: function _getTokenWithoutNavi() {\n        return this._token.replace(/@.+$/, '@');\n      }\n    }, {\n      key: \"getInfoFromCache\",\n      value: function getInfoFromCache() {\n        return this._navi.getInfoFromCache(this._getTokenWithoutNavi());\n      }\n    }, {\n      key: \"registerMessageType\",\n      value: function registerMessageType(objectName, isPersited, isCounted) {\n        var searchProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];\n\n        this._engine.registerMessageType(objectName, isPersited, isCounted, searchProps);\n      }\n    }, {\n      key: \"sendMessage\",\n      value: function sendMessage(conversationType, targetId, options) {\n        var contentJson = JSON.stringify(options.content);\n\n        if (getByteLength(contentJson) > MAX_MESSAGE_CONTENT_BYTES) {\n          return Promise.resolve({\n            code: ErrorCode$1.RC_MSG_CONTENT_EXCEED_LIMIT\n          });\n        }\n\n        return this._engine.sendMessage(conversationType, targetId, options);\n      }\n    }, {\n      key: \"sendExpansionMessage\",\n      value: function sendExpansionMessage(options) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee60() {\n          var conversationType, targetId, messageUId, keys, expansion, originExpansion, removeAll, canIncludeExpansion, isExceedLimit, isIllgalEx, exKeysLength, totalExpansion, totalExKeysLength, _key20, val, content, _yield$this$_engine$s, code;\n\n          return regeneratorRuntime.wrap(function _callee60$(_context62) {\n            while (1) {\n              switch (_context62.prev = _context62.next) {\n                case 0:\n                  conversationType = options.conversationType, targetId = options.targetId, messageUId = options.messageUId, keys = options.keys, expansion = options.expansion, originExpansion = options.originExpansion, removeAll = options.removeAll, canIncludeExpansion = options.canIncludeExpansion;\n\n                  if (canIncludeExpansion) {\n                    _context62.next = 3;\n                    break;\n                  }\n\n                  return _context62.abrupt(\"return\", {\n                    code: ErrorCode$1.MESSAGE_KV_NOT_SUPPORT\n                  });\n\n                case 3:\n                  isExceedLimit = false;\n                  isIllgalEx = false;\n\n                  if (isObject(expansion)) {\n                    originExpansion = originExpansion || {};\n                    exKeysLength = Object.keys(expansion).length;\n                    totalExpansion = Object.assign(originExpansion, expansion);\n                    totalExKeysLength = Object.keys(totalExpansion).length;\n                    isExceedLimit = totalExKeysLength > 300 || exKeysLength > 20;\n\n                    for (_key20 in expansion) {\n                      val = expansion[_key20];\n                      isExceedLimit = _key20.length > 32 || val.length > 64;\n                      isIllgalEx = !/^[A-Za-z0-9_=+-]+$/.test(_key20);\n                    }\n                  }\n\n                  if (!isExceedLimit) {\n                    _context62.next = 8;\n                    break;\n                  }\n\n                  return _context62.abrupt(\"return\", {\n                    code: ErrorCode$1.EXPANSION_LIMIT_EXCEET\n                  });\n\n                case 8:\n                  if (!isIllgalEx) {\n                    _context62.next = 10;\n                    break;\n                  }\n\n                  return _context62.abrupt(\"return\", {\n                    code: ErrorCode$1.BIZ_ERROR_INVALID_PARAMETER\n                  });\n\n                case 10:\n                  content = {\n                    mid: messageUId\n                  };\n                  expansion && (content.put = expansion);\n                  keys && (content.del = keys);\n                  removeAll && (content.removeAll = 1);\n                  _context62.next = 16;\n                  return this._engine.sendMessage(conversationType, targetId, {\n                    content: content,\n                    messageType: MessageType$1.EXPANSION_NOTIFY\n                  });\n\n                case 16:\n                  _yield$this$_engine$s = _context62.sent;\n                  code = _yield$this$_engine$s.code;\n                  return _context62.abrupt(\"return\", {\n                    code: code\n                  });\n\n                case 19:\n                case \"end\":\n                  return _context62.stop();\n              }\n            }\n          }, _callee60, this);\n        }));\n      }\n    }, {\n      key: \"_destroy\",\n      value: function _destroy() {\n        var _this163 = this;\n\n        this._watcher = {};\n\n        this._engine.disconnect();\n\n        this._pluginContextQueue.forEach(function (item) {\n          _newArrowCheck(this, _this163);\n\n          if (!item.ondestroy) {\n            return;\n          }\n\n          try {\n            item.ondestroy();\n          } catch (err) {\n            logger.error('plugin error =>', err);\n          }\n        }.bind(this));\n\n        this._pluginContextQueue.length = 0;\n      }\n    }, {\n      key: \"getHistoryMessage\",\n      value: function getHistoryMessage(conversationType, targetId) {\n        var timestamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n        var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 20;\n        var order = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n        return this._engine.getHistoryMessage(conversationType, targetId, timestamp, count, order);\n      }\n    }, {\n      key: \"getConversationList\",\n      value: function getConversationList() {\n        var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;\n        var conversationType = arguments.length > 1 ? arguments[1] : undefined;\n        var startTime = arguments.length > 2 ? arguments[2] : undefined;\n        var order = arguments.length > 3 ? arguments[3] : undefined;\n        return this._engine.getConversationList(count, conversationType, startTime, order);\n      }\n    }, {\n      key: \"removeConversation\",\n      value: function removeConversation(conversationType, targetId) {\n        return this._engine.removeConversation(conversationType, targetId);\n      }\n    }, {\n      key: \"clearUnreadCount\",\n      value: function clearUnreadCount(conversationType, targetId) {\n        return this._engine.clearConversationUnreadCount(conversationType, targetId);\n      }\n    }, {\n      key: \"getUnreadCount\",\n      value: function getUnreadCount(conversationType, targetId) {\n        return this._engine.getConversationUnreadCount(conversationType, targetId);\n      }\n    }, {\n      key: \"getTotalUnreadCount\",\n      value: function getTotalUnreadCount() {\n        return this._engine.getAllConversationUnreadCount();\n      }\n    }, {\n      key: \"setConversationStatus\",\n      value: function setConversationStatus(conversationType, targetId, isTop, notificationStatus) {\n        var statusList = [{\n          conversationType: conversationType,\n          targetId: targetId,\n          isTop: isTop,\n          notificationStatus: notificationStatus\n        }];\n        return this._engine.batchSetConversationStatus(statusList);\n      }\n    }, {\n      key: \"saveConversationMessageDraft\",\n      value: function saveConversationMessageDraft(conversationType, targetId, draft) {\n        return this._engine.saveConversationMessageDraft(conversationType, targetId, draft);\n      }\n    }, {\n      key: \"getConversationMessageDraft\",\n      value: function getConversationMessageDraft(conversationType, targetId) {\n        return this._engine.getConversationMessageDraft(conversationType, targetId);\n      }\n    }, {\n      key: \"clearConversationMessageDraft\",\n      value: function clearConversationMessageDraft(conversationType, targetId) {\n        return this._engine.clearConversationMessageDraft(conversationType, targetId);\n      }\n    }, {\n      key: \"recallMessage\",\n      value: function recallMessage(conversationType, targetId, messageUId, sentTime, user) {\n        return this._engine.recallMsg(conversationType, targetId, messageUId, sentTime, user);\n      }\n    }, {\n      key: \"deleteRemoteMessage\",\n      value: function deleteRemoteMessage(conversationType, targetId, list) {\n        return this._engine.deleteRemoteMessage(conversationType, targetId, list);\n      }\n    }, {\n      key: \"deleteRemoteMessageByTimestamp\",\n      value: function deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp) {\n        return this._engine.deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp);\n      }\n    }, {\n      key: \"joinChatroom\",\n      value: function joinChatroom(roomId) {\n        var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n        return this._engine.joinChatroom(roomId, count);\n      }\n    }, {\n      key: \"joinExistChatroom\",\n      value: function joinExistChatroom(roomId) {\n        var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n        return this._engine.joinExistChatroom(roomId, count);\n      }\n    }, {\n      key: \"quitChatroom\",\n      value: function quitChatroom(roomId) {\n        return this._engine.quitChatroom(roomId);\n      }\n    }, {\n      key: \"getChatroomInfo\",\n      value: function getChatroomInfo(roomId) {\n        var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n        var order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n        return this._engine.getChatroomInfo(roomId, count, order);\n      }\n    }, {\n      key: \"setChatroomEntry\",\n      value: function setChatroomEntry(roomId, entry) {\n        return this._engine.setChatroomEntry(roomId, entry);\n      }\n    }, {\n      key: \"forceSetChatroomEntry\",\n      value: function forceSetChatroomEntry(roomId, entry) {\n        return this._engine.forceSetChatroomEntry(roomId, entry);\n      }\n    }, {\n      key: \"removeChatroomEntry\",\n      value: function removeChatroomEntry(roomId, entry) {\n        return this._engine.removeChatroomEntry(roomId, entry);\n      }\n    }, {\n      key: \"forceRemoveChatroomEntry\",\n      value: function forceRemoveChatroomEntry(roomId, entry) {\n        return this._engine.forceRemoveChatroomEntry(roomId, entry);\n      }\n    }, {\n      key: \"getChatroomEntry\",\n      value: function getChatroomEntry(roomId, key) {\n        return this._engine.getChatroomEntry(roomId, key);\n      }\n    }, {\n      key: \"getAllChatroomEntries\",\n      value: function getAllChatroomEntries(roomId) {\n        return this._engine.getAllChatroomEntry(roomId);\n      }\n    }, {\n      key: \"getChatRoomHistoryMessages\",\n      value: function getChatRoomHistoryMessages(roomId) {\n        var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;\n        var order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n        var timestamp = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n        return this._engine.getChatroomHistoryMessages(roomId, timestamp, count, order);\n      }\n    }, {\n      key: \"getFileToken\",\n      value: function getFileToken(fileType, fileName) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee61() {\n          var naviInfo, bos, qiniu, ossConfig, _yield$this$_engine$g, code, data;\n\n          return regeneratorRuntime.wrap(function _callee61$(_context63) {\n            while (1) {\n              switch (_context63.prev = _context63.next) {\n                case 0:\n                  naviInfo = this.getInfoFromCache();\n                  bos = (naviInfo === null || naviInfo === void 0 ? void 0 : naviInfo.bosAddr) || '';\n                  qiniu = (naviInfo === null || naviInfo === void 0 ? void 0 : naviInfo.uploadServer) || '';\n                  ossConfig = (naviInfo === null || naviInfo === void 0 ? void 0 : naviInfo.ossConfig) || '';\n                  _context63.next = 6;\n                  return this._engine.getFileToken(fileType, fileName);\n\n                case 6:\n                  _yield$this$_engine$g = _context63.sent;\n                  code = _yield$this$_engine$g.code;\n                  data = _yield$this$_engine$g.data;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context63.next = 11;\n                    break;\n                  }\n\n                  return _context63.abrupt(\"return\", Promise.resolve(Object.assign(data, {\n                    bos: bos,\n                    qiniu: qiniu,\n                    ossConfig: ossConfig\n                  })));\n\n                case 11:\n                  return _context63.abrupt(\"return\", Promise.reject(code));\n\n                case 12:\n                case \"end\":\n                  return _context63.stop();\n              }\n            }\n          }, _callee61, this);\n        }));\n      }\n    }, {\n      key: \"getFileUrl\",\n      value: function getFileUrl(fileType, fileName, originName, uploadRes) {\n        var uploadMethod = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : UploadMethod$1.QINIU;\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee62() {\n          var _yield$this$_engine$g2, code, data;\n\n          return regeneratorRuntime.wrap(function _callee62$(_context64) {\n            while (1) {\n              switch (_context64.prev = _context64.next) {\n                case 0:\n                  if (!(uploadRes === null || uploadRes === void 0 ? void 0 : uploadRes.isBosRes)) {\n                    _context64.next = 2;\n                    break;\n                  }\n\n                  return _context64.abrupt(\"return\", Promise.resolve(uploadRes));\n\n                case 2:\n                  _context64.next = 4;\n                  return this._engine.getFileUrl(fileType, uploadMethod, fileName, originName);\n\n                case 4:\n                  _yield$this$_engine$g2 = _context64.sent;\n                  code = _yield$this$_engine$g2.code;\n                  data = _yield$this$_engine$g2.data;\n\n                  if (!(code === ErrorCode$1.SUCCESS)) {\n                    _context64.next = 9;\n                    break;\n                  }\n\n                  return _context64.abrupt(\"return\", Promise.resolve(data));\n\n                case 9:\n                  return _context64.abrupt(\"return\", Promise.reject(code));\n\n                case 10:\n                case \"end\":\n                  return _context64.stop();\n              }\n            }\n          }, _callee62, this);\n        }));\n      }\n    }, {\n      key: \"clearConversations\",\n      value: function clearConversations() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee63() {\n          return regeneratorRuntime.wrap(function _callee63$(_context65) {\n            while (1) {\n              switch (_context65.prev = _context65.next) {\n                case 0:\n                  _context65.next = 2;\n                  return this._engine.clearConversations();\n\n                case 2:\n                  return _context65.abrupt(\"return\", _context65.sent);\n\n                case 3:\n                case \"end\":\n                  return _context65.stop();\n              }\n            }\n          }, _callee63, this);\n        }));\n      }\n    }, {\n      key: \"setUserStatusListener\",\n      value: function setUserStatusListener(config, listener) {\n        var _this164 = this;\n\n        return this._engine.setUserStatusListener(config, function (data) {\n          _newArrowCheck(this, _this164);\n\n          try {\n            listener(data);\n          } catch (error) {\n            logger.error(error);\n          }\n        }.bind(this));\n      }\n    }, {\n      key: \"addToBlacklist\",\n      value: function addToBlacklist(userId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee64() {\n          return regeneratorRuntime.wrap(function _callee64$(_context66) {\n            while (1) {\n              switch (_context66.prev = _context66.next) {\n                case 0:\n                  return _context66.abrupt(\"return\", this._engine.addToBlacklist(userId));\n\n                case 1:\n                case \"end\":\n                  return _context66.stop();\n              }\n            }\n          }, _callee64, this);\n        }));\n      }\n    }, {\n      key: \"removeFromBlacklist\",\n      value: function removeFromBlacklist(userId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee65() {\n          return regeneratorRuntime.wrap(function _callee65$(_context67) {\n            while (1) {\n              switch (_context67.prev = _context67.next) {\n                case 0:\n                  return _context67.abrupt(\"return\", this._engine.removeFromBlacklist(userId));\n\n                case 1:\n                case \"end\":\n                  return _context67.stop();\n              }\n            }\n          }, _callee65, this);\n        }));\n      }\n    }, {\n      key: \"getBlacklist\",\n      value: function getBlacklist() {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee66() {\n          return regeneratorRuntime.wrap(function _callee66$(_context68) {\n            while (1) {\n              switch (_context68.prev = _context68.next) {\n                case 0:\n                  return _context68.abrupt(\"return\", this._engine.getBlacklist());\n\n                case 1:\n                case \"end\":\n                  return _context68.stop();\n              }\n            }\n          }, _callee66, this);\n        }));\n      }\n    }, {\n      key: \"getBlacklistStatus\",\n      value: function getBlacklistStatus(userId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee67() {\n          return regeneratorRuntime.wrap(function _callee67$(_context69) {\n            while (1) {\n              switch (_context69.prev = _context69.next) {\n                case 0:\n                  return _context69.abrupt(\"return\", this._engine.getBlacklistStatus(userId));\n\n                case 1:\n                case \"end\":\n                  return _context69.stop();\n              }\n            }\n          }, _callee67, this);\n        }));\n      }\n    }, {\n      key: \"insertMessage\",\n      value: function insertMessage(conversationType, targetId, senderUserId, messageType, msgContent, direction) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee68() {\n          return regeneratorRuntime.wrap(function _callee68$(_context70) {\n            while (1) {\n              switch (_context70.prev = _context70.next) {\n                case 0:\n                  return _context70.abrupt(\"return\", this._engine.insertMessage(conversationType, targetId, senderUserId, messageType, msgContent, direction));\n\n                case 1:\n                case \"end\":\n                  return _context70.stop();\n              }\n            }\n          }, _callee68, this);\n        }));\n      }\n    }, {\n      key: \"deleteMessages\",\n      value: function deleteMessages(timestamp) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee69() {\n          return regeneratorRuntime.wrap(function _callee69$(_context71) {\n            while (1) {\n              switch (_context71.prev = _context71.next) {\n                case 0:\n                  return _context71.abrupt(\"return\", this._engine.deleteMessages(timestamp));\n\n                case 1:\n                case \"end\":\n                  return _context71.stop();\n              }\n            }\n          }, _callee69, this);\n        }));\n      }\n    }, {\n      key: \"deleteMessagesByTimestamp\",\n      value: function deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee70() {\n          return regeneratorRuntime.wrap(function _callee70$(_context72) {\n            while (1) {\n              switch (_context72.prev = _context72.next) {\n                case 0:\n                  return _context72.abrupt(\"return\", this._engine.deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace));\n\n                case 1:\n                case \"end\":\n                  return _context72.stop();\n              }\n            }\n          }, _callee70, this);\n        }));\n      }\n    }, {\n      key: \"getMessage\",\n      value: function getMessage(messageId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee71() {\n          return regeneratorRuntime.wrap(function _callee71$(_context73) {\n            while (1) {\n              switch (_context73.prev = _context73.next) {\n                case 0:\n                  return _context73.abrupt(\"return\", this._engine.getMessage(messageId));\n\n                case 1:\n                case \"end\":\n                  return _context73.stop();\n              }\n            }\n          }, _callee71, this);\n        }));\n      }\n    }, {\n      key: \"setMessageContent\",\n      value: function setMessageContent(messageId, content, messageType) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee72() {\n          return regeneratorRuntime.wrap(function _callee72$(_context74) {\n            while (1) {\n              switch (_context74.prev = _context74.next) {\n                case 0:\n                  return _context74.abrupt(\"return\", this._engine.setMessageContent(messageId, content, messageType));\n\n                case 1:\n                case \"end\":\n                  return _context74.stop();\n              }\n            }\n          }, _callee72, this);\n        }));\n      }\n    }, {\n      key: \"setMessageSearchField\",\n      value: function setMessageSearchField(messageId, content, searchFiles) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee73() {\n          return regeneratorRuntime.wrap(function _callee73$(_context75) {\n            while (1) {\n              switch (_context75.prev = _context75.next) {\n                case 0:\n                  return _context75.abrupt(\"return\", this._engine.setMessageSearchField(messageId, content, searchFiles));\n\n                case 1:\n                case \"end\":\n                  return _context75.stop();\n              }\n            }\n          }, _callee73, this);\n        }));\n      }\n    }, {\n      key: \"setMessageSentStatus\",\n      value: function setMessageSentStatus(messageId, sentStatus) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee74() {\n          return regeneratorRuntime.wrap(function _callee74$(_context76) {\n            while (1) {\n              switch (_context76.prev = _context76.next) {\n                case 0:\n                  return _context76.abrupt(\"return\", this._engine.setMessageSentStatus(messageId, sentStatus));\n\n                case 1:\n                case \"end\":\n                  return _context76.stop();\n              }\n            }\n          }, _callee74, this);\n        }));\n      }\n    }, {\n      key: \"setMessageReceivedStatus\",\n      value: function setMessageReceivedStatus(messageId, receivedStatus) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee75() {\n          return regeneratorRuntime.wrap(function _callee75$(_context77) {\n            while (1) {\n              switch (_context77.prev = _context77.next) {\n                case 0:\n                  return _context77.abrupt(\"return\", this._engine.setMessageReceivedStatus(messageId, receivedStatus));\n\n                case 1:\n                case \"end\":\n                  return _context77.stop();\n              }\n            }\n          }, _callee75, this);\n        }));\n      }\n    }, {\n      key: \"setUserStatus\",\n      value: function setUserStatus(status) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee76() {\n          return regeneratorRuntime.wrap(function _callee76$(_context78) {\n            while (1) {\n              switch (_context78.prev = _context78.next) {\n                case 0:\n                  return _context78.abrupt(\"return\", this._engine.setUserStatus(status));\n\n                case 1:\n                case \"end\":\n                  return _context78.stop();\n              }\n            }\n          }, _callee76, this);\n        }));\n      }\n    }, {\n      key: \"subscribeUserStatus\",\n      value: function subscribeUserStatus(userIds) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee77() {\n          return regeneratorRuntime.wrap(function _callee77$(_context79) {\n            while (1) {\n              switch (_context79.prev = _context79.next) {\n                case 0:\n                  return _context79.abrupt(\"return\", this._engine.subscribeUserStatus(userIds));\n\n                case 1:\n                case \"end\":\n                  return _context79.stop();\n              }\n            }\n          }, _callee77, this);\n        }));\n      }\n    }, {\n      key: \"getUserStatus\",\n      value: function getUserStatus(userId) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee78() {\n          return regeneratorRuntime.wrap(function _callee78$(_context80) {\n            while (1) {\n              switch (_context80.prev = _context80.next) {\n                case 0:\n                  return _context80.abrupt(\"return\", this._engine.getUserStatus(userId));\n\n                case 1:\n                case \"end\":\n                  return _context80.stop();\n              }\n            }\n          }, _callee78, this);\n        }));\n      }\n    }, {\n      key: \"searchConversationByContent\",\n      value: function searchConversationByContent(keyword, conversationTypes) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee79() {\n          return regeneratorRuntime.wrap(function _callee79$(_context81) {\n            while (1) {\n              switch (_context81.prev = _context81.next) {\n                case 0:\n                  return _context81.abrupt(\"return\", this._engine.searchConversationByContent(keyword, conversationTypes));\n\n                case 1:\n                case \"end\":\n                  return _context81.stop();\n              }\n            }\n          }, _callee79, this);\n        }));\n      }\n    }, {\n      key: \"searchMessageByContent\",\n      value: function searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total) {\n        return __awaiter$1(this, void 0, void 0, regeneratorRuntime.mark(function _callee80() {\n          return regeneratorRuntime.wrap(function _callee80$(_context82) {\n            while (1) {\n              switch (_context82.prev = _context82.next) {\n                case 0:\n                  return _context82.abrupt(\"return\", this._engine.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total));\n\n                case 1:\n                case \"end\":\n                  return _context82.stop();\n              }\n            }\n          }, _callee80, this);\n        }));\n      }\n    }, {\n      key: \"getUnreadMentionedMessages\",\n      value: function getUnreadMentionedMessages(conversationType, targetId) {\n        return this._engine.getUnreadMentionedMessages(conversationType, targetId);\n      }\n    }, {\n      key: \"joinRTCRoom\",\n      value: function joinRTCRoom(roomId, mode, mediaType) {\n        return this._engine.joinRTCRoom(roomId, mode, mediaType);\n      }\n    }, {\n      key: \"quitRTCRoom\",\n      value: function quitRTCRoom(roomId) {\n        return this._engine.quitRTCRoom(roomId);\n      }\n    }, {\n      key: \"rtcPing\",\n      value: function rtcPing(roomId, mode, mediaType) {\n        return this._engine.rtcPing(roomId, mode, mediaType);\n      }\n    }, {\n      key: \"getRTCRoomInfo\",\n      value: function getRTCRoomInfo(roomId) {\n        return this._engine.getRTCRoomInfo(roomId);\n      }\n    }, {\n      key: \"getRTCUserInfoList\",\n      value: function getRTCUserInfoList(roomId) {\n        return this._engine.getRTCUserInfoList(roomId);\n      }\n    }, {\n      key: \"getRTCUserInfo\",\n      value: function getRTCUserInfo(roomId) {\n        return this._engine.getRTCUserInfo(roomId);\n      }\n    }, {\n      key: \"setRTCUserInfo\",\n      value: function setRTCUserInfo(roomId, key, value) {\n        return this._engine.setRTCUserInfo(roomId, key, value);\n      }\n    }, {\n      key: \"removeRTCUserInfo\",\n      value: function removeRTCUserInfo(roomId, keys) {\n        return this._engine.removeRTCUserInfo(roomId, keys);\n      }\n    }, {\n      key: \"setRTCData\",\n      value: function setRTCData(roomId, key, value, isInner, apiType, message) {\n        return this._engine.setRTCData(roomId, key, value, isInner, apiType, message);\n      }\n    }, {\n      key: \"setRTCTotalRes\",\n      value: function setRTCTotalRes(roomId, message, valueInfo, objectName) {\n        return this._engine.setRTCTotalRes(roomId, message, valueInfo, objectName);\n      }\n    }, {\n      key: \"getRTCData\",\n      value: function getRTCData(roomId, keys, isInner, apiType) {\n        return this._engine.getRTCData(roomId, keys, isInner, apiType);\n      }\n    }, {\n      key: \"removeRTCData\",\n      value: function removeRTCData(roomId, keys, isInner, apiType, message) {\n        return this._engine.removeRTCData(roomId, keys, isInner, apiType, message);\n      }\n    }, {\n      key: \"setRTCOutData\",\n      value: function setRTCOutData(roomId, rtcData, type, message) {\n        return this._engine.setRTCOutData(roomId, rtcData, type, message);\n      }\n    }, {\n      key: \"getRTCOutData\",\n      value: function getRTCOutData(roomId, userIds) {\n        return this._engine.getRTCOutData(roomId, userIds);\n      }\n    }, {\n      key: \"getRTCToken\",\n      value: function getRTCToken(roomId, mode, broadcastType) {\n        return this._engine.getRTCToken(roomId, mode, broadcastType);\n      }\n    }, {\n      key: \"setRTCState\",\n      value: function setRTCState(roomId, report) {\n        return !this._options.isEnterPrise ? this._engine.setRTCState(roomId, report) : Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n    }, {\n      key: \"getRTCUserList\",\n      value: function getRTCUserList(roomId) {\n        return this._engine.getRTCUserList(roomId);\n      }\n    }], [{\n      key: \"init\",\n      value: function init(runtime, options) {\n        logger.debug('APIContext.init =>', options.appkey, options.navigators);\n\n        if (this._context) {\n          logger.error('Repeat initialize!');\n          return this._context;\n        }\n\n        this._context = new APIContext(runtime, options);\n        return this._context;\n      }\n    }, {\n      key: \"destroy\",\n      value: function destroy() {\n        if (this._context) {\n          this._context._destroy();\n\n          this._context = undefined;\n        }\n      }\n    }]);\n\n    return APIContext;\n  }();\n\n  {\n    logger.warn('RCEngineVersion:', \"4.1.0\");\n    logger.warn('VersionCode:', \"0012eb74bbf7318ea4a4e2ee3e3e858d6849090c\");\n  }\n\n  const logger$1 = new Logger('RCIM');\n  logger$1.set( exports.LogLevel.DEBUG );\n\n  const ERROR_INFO = {\n      // 超时\n      TIMEOUT: {\n          code: -1,\n          msg: 'Network timeout'\n      },\n      // SDK 内部错误\n      SDK_INTERNAL_ERROR: {\n          code: -2,\n          msg: 'SDK internal error'\n      },\n      // 开发者参数传入错误\n      PARAMETER_ERROR: {\n          code: -3,\n          msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n      },\n      REJECTED_BY_BLACKLIST: {\n          code: 405,\n          msg: 'Blacklisted by the other party'\n      },\n      // 发送频率过快\n      SEND_TOO_FAST: {\n          code: 20604,\n          msg: 'Sending messages too quickly'\n      },\n      // 不在群组中\n      NOT_IN_GROUP: {\n          code: 22406,\n          msg: 'Not in group'\n      },\n      // 在群组中被禁言\n      FORBIDDEN_IN_GROUP: {\n          code: 22408,\n          msg: 'Forbbiden from speaking in the group'\n      },\n      // 不在聊天室中\n      NOT_IN_CHATROOM: {\n          code: 23406,\n          msg: 'Not in chatRoom'\n      },\n      // 在聊天室中被禁言\n      FORBIDDEN_IN_CHATROOM: {\n          code: 23408,\n          msg: 'Forbbiden from speaking in the chatRoom'\n      },\n      // 已被踢出并禁止加入聊天室\n      KICKED_FROM_CHATROOM: {\n          code: 23409,\n          msg: 'Kicked out and forbbiden from joining the chatRoom'\n      },\n      // 聊天室不存在\n      CHATROOM_NOT_EXIST: {\n          code: 23410,\n          msg: 'ChatRoom does not exist'\n      },\n      // 聊天室成员超限\n      CHATROOM_IS_FULL: {\n          code: 23411,\n          msg: 'ChatRoom members exceeded'\n      },\n      // 聊天室参数无效\n      PARAMETER_INVALID_CHATROOM: {\n          code: 23412,\n          msg: 'Invalid chatRoom parameters'\n      },\n      // 聊天室云存储业务未开通\n      ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n          code: 23414,\n          msg: 'ChatRoom message roaming service is not open, Please go to the developer to open this service'\n      },\n      // 撤回消息失败\n      RECALLMESSAGE_PARAMETER_INVALID: {\n          code: 25101,\n          msg: 'Invalid recall message parameter'\n      },\n      // 未开通单群聊消息云存储服务\n      ROAMING_SERVICE_UNAVAILABLE_MESSAGE: {\n          code: 25102,\n          msg: 'Single group chat roaming service is not open, Please go to the developer to open this service'\n      },\n      // push 设置参数无效\n      PUSHSETTING_PARAMETER_INVALID: {\n          code: 26001,\n          msg: 'Invalid push parameter'\n      },\n      // 操作被禁止\n      OPERATION_BLOCKED: {\n          code: 20605,\n          msg: 'Operation is blocked'\n      },\n      // 操作不支持\n      OPERATION_NOT_SUPPORT: {\n          code: 20606,\n          msg: 'Operation is not supported'\n      },\n      // 发送的消息中包含敏感词 (发送方发送失败，接收方不会收到消息)\n      MSG_BLOCKED_SENSITIVE_WORD: {\n          code: 21501,\n          msg: 'The sent message contains sensitive words'\n      },\n      // 消息中敏感词已经被替换 (接收方可以收到被替换之后的消息)\n      REPLACED_SENSITIVE_WORD: {\n          code: 21502,\n          msg: 'Sensitive words in the message have been replaced'\n      },\n      // 用户未连接成功\n      NOT_CONNECTED: {\n          code: 30001,\n          msg: 'Please connect successfully first'\n      },\n      // 导航 http 请求失败\n      NAVI_REQUEST_ERROR: {\n          code: 30007,\n          msg: 'Navigation http request failed'\n      },\n      // CMP 嗅探 http 请求失败\n      CMP_REQUEST_ERROR: {\n          code: 30010,\n          msg: 'CMP sniff http request failed'\n      },\n      CONN_APPKEY_FAKE: {\n          code: 31002,\n          msg: 'Your appkey is fake'\n      },\n      CONN_MINI_SERVICE_NOT_OPEN: {\n          code: 31003,\n          msg: 'Mini program service is not open, Please go to the developer to open this service'\n      },\n      CONN_ACK_TIMEOUT: {\n          code: 31000,\n          msg: 'Connection ACK timeout'\n      },\n      CONN_TOKEN_INCORRECT: {\n          code: 31004,\n          msg: 'Your token is not valid or expired'\n      },\n      CONN_NOT_AUTHRORIZED: {\n          code: 31005,\n          msg: 'AppKey and Token do not match'\n      },\n      CONN_REDIRECTED: {\n          code: 31006,\n          msg: 'Connection redirection'\n      },\n      CONN_APP_BLOCKED_OR_DELETED: {\n          code: 31008,\n          msg: 'AppKey is banned or deleted'\n      },\n      CONN_USER_BLOCKED: {\n          code: 31009,\n          msg: 'User blocked'\n      },\n      // 域名无效\n      CONN_DOMAIN_INCORRECT: {\n          code: 31012,\n          msg: 'Connect domain error, Please check the set security domain'\n      },\n      // 未开通单群聊历史消息云存储\n      ROAMING_SERVICE_UNAVAILABLE: {\n          code: 33007,\n          msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n      },\n      // 已连接, 不可再次调用链接(错误码与移动端对齐)\n      RC_CONNECTION_EXIST: {\n          code: 34001,\n          msg: 'Connection already exists'\n      },\n      // 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n      CHATROOM_KV_EXCEED: {\n          code: 23423,\n          msg: 'ChatRoom KV setting exceeds maximum'\n      },\n      // 聊天室 KV 已存在\n      CHATROOM_KV_OVERWRITE_INVALID: {\n          code: 23424,\n          msg: 'ChatRoom KV already exists'\n      },\n      // 聊天室 KV 存储功能没有开通\n      CHATROOM_KV_STORE_NOT_OPEN: {\n          code: 23426,\n          msg: 'ChatRoom KV storage service is not open, Please go to the developer to open this service'\n      },\n      // 聊天室Key不存在\n      CHATROOM_KEY_NOT_EXIST: {\n          code: 23427,\n          msg: 'ChatRoom key does not exist'\n      },\n      // 消息不支持扩展存储(错误码与移动端对齐)\n      MSG_KV_NOT_SUPPORT: {\n          code: 34008,\n          msg: 'The message cannot be extended'\n      },\n      // 发送扩展存储消息失败(错误码与移动端对齐)\n      SEND_MESSAGE_KV_FAIL: {\n          code: 34009,\n          msg: 'Sending RC expansion message fail'\n      },\n      // 扩展存储 key value 超出限制(错误码与移动端对齐)\n      EXPANSION_LIMIT_EXCEET: {\n          code: 34010,\n          msg: 'The message expansion size is beyond the limit'\n      },\n      // 调用接口时传入的参数不正确(错误码与移动端对齐)\n      ILLGAL_PARAMS: {\n          code: 33003,\n          msg: 'Incorrect parameters passed in while calling the interface'\n      }\n  };\n  const ERROR_CODE = {};\n  for (const name in ERROR_INFO) {\n      const info = ERROR_INFO[name];\n      const { code } = info;\n      // ERROR_CODE[name] = code\n      ERROR_CODE[code] = name;\n  }\n  // 服务返回的错误码, 转化为 SDK 的 ErrorCode\n  const SERVER_ERROR_TO_CODE = {\n      // 未开通单群聊历史消息云存储\n      1: ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n  };\n\n  const CONNECTION_STATUS = {\n      CONNECTED: 0,\n      CONNECTING: 1,\n      DISCONNECTED: 2,\n      NETWORK_UNAVAILABLE: 3,\n      SOCKET_ERROR: 4,\n      KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n      BLOCKED: 12 // 用户被封禁(服务值为 2, 转为状态码后 + 10)\n  };\n\n  /**\n   * 业务层枚举, 此处枚举会暴露给开发者\n  */\n  const CONNECT_TYPE = {\n      COMET: 'comet',\n      WEBSOCKET: 'websocket'\n  };\n  const CONVERSATION_TYPE = ConversationType$1;\n  const MESSAGE_DIRECTION = MessageDirection$1;\n  const MESSAGS_TIME_ORDER = {\n      DESC: 0,\n      ASC: 1 // 正序\n  };\n  // 聊天室历史消息、聊天室用户信息排序\n  const CHATROOM_ORDER = {\n      ASC: 1,\n      DESC: 2\n  };\n  const RECALL_MESSAGE_TYPE = 'RC:RcCmd';\n  const MENTIONED_TYPE = {\n      ALL: 1,\n      SINGAL: 2\n  };\n  const MESSAGE_TYPE = {\n      TEXT: 'RC:TxtMsg',\n      VOICE: 'RC:VcMsg',\n      HQ_VOICE: 'RC:HQVCMsg',\n      IMAGE: 'RC:ImgMsg',\n      GIF: 'RC:GIFMsg',\n      RICH_CONTENT: 'RC:ImgTextMsg',\n      LOCATION: 'RC:LBSMsg',\n      FILE: 'RC:FileMsg',\n      SIGHT: 'RC:SightMsg',\n      COMBINE: 'RC:CombineMsg',\n      CHRM_KV_NOTIFY: 'RC:chrmKVNotiMsg',\n      LOG_COMMAND: 'RC:LogCmdMsg',\n      EXPANSION_NOTIFY: 'RC:MsgExMsg',\n      REFERENCE: 'RC:ReferenceMsg'\n  };\n  const FILE_TYPE = FileType$1;\n  // 聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新\n  const CHATROOM_ENTRY_TYPE = {\n      UPDATE: 1,\n      DELETE: 2\n  };\n  const NOTIFICATION_STATUS = {\n      DO_NOT_DISTURB: 1,\n      NOTIFY: 2 // 提醒(非免打扰)\n  };\n  const RECEIVED_STATUS = {\n      READ: 0x1,\n      LISTENED: 0x2,\n      DOWNLOADED: 0x4,\n      RETRIEVED: 0x8,\n      UNREAD: 0 // 未读\n  };\n  const SDK_VERSION = \"4.1.0\";\n\n  /**\n   * 转化 APIContext 传过来的消息数据\n   * @param msg APIContext 消息\n   * @returns V3 需要的消息数据\n   */\n  function tranReceivedMessage(msg) {\n      let { conversationType: type, messageType, content, senderUserId, targetId, sentTime, receivedTime, messageUId, messageDirection, isPersited, isCounted, isOffLineMessage, canIncludeExpansion, expansion, receivedStatus, disableNotification, isMentioned, isStatusMessage } = msg;\n      if (!receivedStatus) {\n          receivedStatus = ReceivedStatus$1.UNREAD;\n      }\n      return {\n          messageType,\n          content,\n          senderUserId,\n          targetId,\n          type,\n          sentTime,\n          receivedTime,\n          messageUId,\n          messageDirection,\n          isPersited,\n          isCounted,\n          isOffLineMessage,\n          isMentioned,\n          disableNotification,\n          isStatusMessage,\n          canIncludeExpansion,\n          expansion,\n          receivedStatus\n      };\n  }\n  /**\n   * 转化 APIContext 传过来的会话数据\n   * @param conversation APIContext 会话\n   * @returns V3 需要的会话数据\n   */\n  function tranReceiveConversation(conversation) {\n      const { conversationType: type, targetId, latestMessage, unreadMessageCount, hasMentioned, mentionedInfo, lastUnreadTime, notificationStatus, isTop } = conversation;\n      const latestMessageV3 = latestMessage && tranReceivedMessage(latestMessage);\n      const mentionedInfoV3 = {\n          type: mentionedInfo === null || mentionedInfo === void 0 ? void 0 : mentionedInfo.type,\n          userIdList: mentionedInfo === null || mentionedInfo === void 0 ? void 0 : mentionedInfo.userIdList\n      };\n      return {\n          type,\n          targetId,\n          latestMessage: latestMessageV3,\n          unreadMessageCount,\n          hasMentioned,\n          mentionedInfo: mentionedInfoV3,\n          lastUnreadTime,\n          notificationStatus,\n          isTop\n      };\n  }\n  function tranReceiveUpdateConversation(conversation) {\n      const { updatedItems, conversationType: type, targetId, latestMessage, unreadMessageCount, lastUnreadTime, notificationStatus, isTop, mentionedInfo, hasMentioned } = conversation;\n      const latestMessageV3 = latestMessage && tranReceivedMessage(latestMessage);\n      if (updatedItems && updatedItems.latestMessage) {\n          updatedItems.latestMessage.val = latestMessageV3;\n      }\n      return {\n          updatedItems,\n          type,\n          targetId,\n          latestMessage: latestMessageV3,\n          unreadMessageCount,\n          lastUnreadTime,\n          notificationStatus,\n          isTop,\n          mentionedInfo,\n          hasMentioned\n      };\n  }\n  /**\n   * 校验发消息的参数\n   */\n  function assertSendMsgOption(options) {\n      assert('options.messageType', options.messageType, AssertRules.STRING, true);\n      assert('options.content', options.content, (value) => {\n          return isObject(value);\n      }, true);\n      assert('options.isPersited', options.isPersited, AssertRules.BOOLEAN);\n      assert('options.isCounted', options.isCounted, AssertRules.BOOLEAN);\n      assert('options.pushContent', options.pushContent, AssertRules.STRING);\n      assert('options.pushData', options.pushData, AssertRules.STRING);\n      assert('options.isVoipPush', options.isVoipPush, AssertRules.BOOLEAN);\n      assert('options.isStatusMessage', options.isStatusMessage, AssertRules.BOOLEAN);\n      assert('options.isMentioned', options.isMentioned, AssertRules.BOOLEAN);\n      assert('options.mentionedType', options.mentionedType, AssertRules.NUMBER);\n      assert('options.mentionedUserIdList', options.mentionedUserIdList, (value) => {\n          return isArray(value) && (value.length === 0 || value.every(isString));\n      });\n      assert('options.directionalUserIdList', options.directionalUserIdList, (value) => {\n          return isArray(value) && (value.length === 0 || value.every(isString));\n      });\n      if (!isUndefined(options.isPersited) || !isUndefined(options.isCounted) || !isUndefined(options.isStatusMessage)) {\n          logger$1.warn('注意: 由于参数 isPersited、isCounted、isStatusMessage 的传入在接收消息时会导致移动端与 Web 端的 isPersited、isCounted、isStatusMessage 这三个参数值不一致。\\n故 isPersited、isCounted、isStatusMessage 即将废弃，非内置消息请使用 registerMessageType 方法注册自定义消息.');\n      }\n  }\n\n  // import { isObject, isUndefined } from '../../utils/validator'\n  /**\n   * 会话排序（拆分-排序-合并）\n   * 将会话列表拆分为置顶和非置顶的两个数组\n   * 再对两个数组按时间进行排序，时间戳大的说明是最近的消息排最上\n  */\n  const sortConList = (conversationList, order) => {\n      if (!conversationList) {\n          return [];\n      }\n      const splitConversationList = splitConversationListByIsTop(conversationList);\n      const topConversationList = _sortListBySentTime(splitConversationList.topConversationList, order);\n      const unToppedConversationList = _sortListBySentTime(splitConversationList.unToppedConversationList, order);\n      topConversationList.push.apply(topConversationList, unToppedConversationList);\n      return topConversationList;\n  };\n  const mergeConversationList = (option) => {\n      option = option || {};\n      let { conversationList, updatedConversationList } = option;\n      conversationList = conversationList || [];\n      updatedConversationList = updatedConversationList || [];\n      const allConversationList = [...updatedConversationList, ...conversationList];\n      // 按顺序合并相同会话的数值(顺序依然为上一步的排序, 只是数值合并, 顺序靠后的数值合并到顺序靠前数值中)\n      const hashTable = {};\n      let newList = [];\n      const invalidDataIndexList = [];\n      forEach(allConversationList, (conversation) => {\n          if (!isObject(conversation)) { // 会话格式错误, 不添加至新列表\n              return;\n          }\n          const { type, targetId } = conversation;\n          const key = getConversationKey({ type, targetId });\n          const hashItem = hashTable[key] || {};\n          const hashIndex = isUndefined(hashItem.index) ? newList.length : hashItem.index;\n          const hashVal = hashItem.val || {};\n          const cacheUpdatedItems = hashVal.updatedItems || {};\n          const updatedItems = conversation.updatedItems;\n          conversation = extend(conversation, hashVal);\n          forEach(cacheUpdatedItems, (item, key) => {\n              conversation[key] = item.val;\n          });\n          forEach(updatedItems, (item, key) => {\n              const cacheItem = cacheUpdatedItems[key] || {};\n              const cacheItemUpdatedTime = cacheItem.time || 0;\n              if (item.time > cacheItemUpdatedTime) {\n                  conversation[key] = item.val;\n              }\n          });\n          hashTable[key] = { index: hashIndex, val: conversation };\n          newList[hashIndex] = conversation;\n          isInValidConversationData(conversation) && invalidDataIndexList.push(hashIndex);\n      });\n      forEach(invalidDataIndexList, (invalidIndex) => {\n          const conversation = newList[invalidIndex];\n          newList[invalidIndex] = fixConversationData(conversation);\n      });\n      newList = sortConList(newList);\n      return map(newList, (item) => {\n          delete item.updatedItems;\n          return item;\n      });\n  };\n  const splitConversationListByIsTop = (conversationList) => {\n      const topConversationList = [];\n      const unToppedConversationList = [];\n      forEach(conversationList, (conversation) => {\n          // 兼容会话中单词拼写错误字段 hasMentiond、mentiondInfo\n          const { hasMentioned, mentionedInfo } = conversation;\n          conversation.hasMentioned = hasMentioned;\n          conversation.mentionedInfo = mentionedInfo;\n          // 兼容接收\n          const isTop = conversation.isTop || false;\n          if (isTop) {\n              topConversationList.push(conversation);\n          }\n          else {\n              unToppedConversationList.push(conversation);\n          }\n      });\n      return {\n          topConversationList: topConversationList || [],\n          unToppedConversationList: unToppedConversationList || []\n      };\n  };\n  const getConversationKey = (option) => {\n      const { type, targetId } = option;\n      return type + '_' + targetId;\n  };\n  const _sortListBySentTime = (convers, order = 0) => {\n      return quickSort(convers, (before, after) => {\n          before = before || {};\n          after = after || {};\n          const beforeLatestMessage = before.latestMessage || {};\n          const afterLatestMessage = after.latestMessage || {};\n          const beforeLatestSentTime = beforeLatestMessage.sentTime || 0;\n          const afterLatestSentTime = afterLatestMessage.sentTime || 0;\n          if (!order) {\n              return afterLatestSentTime <= beforeLatestSentTime;\n          }\n          return afterLatestSentTime >= beforeLatestSentTime;\n      });\n  };\n  const fixConversationData = (conversation) => {\n      conversation = conversation || {};\n      const { targetId, type } = conversation;\n      const defaultType = ConversationType$1.PRIVATE;\n      const defaultMsg = {\n          messageType: MessageType$1.TextMessage,\n          sentTime: DelayTimer.getTime(),\n          content: { content: '' },\n          senderUserId: targetId,\n          targetId,\n          type\n      };\n      conversation.type = type || defaultType;\n      conversation.targetId = targetId || '';\n      conversation.latestMessage = conversation.latestMessage || defaultMsg;\n      return conversation;\n  };\n  const quickSort = (arr, event) => {\n      const sort = (array, left, right, event) => {\n          event = event || ((a, b) => {\n              return a <= b;\n          });\n          if (left < right) {\n              const x = array[right];\n              let i = left - 1;\n              let temp;\n              for (let j = left; j <= right; j++) {\n                  if (event(array[j], x)) {\n                      i++;\n                      temp = array[i];\n                      array[i] = array[j];\n                      array[j] = temp;\n                  }\n              }\n              sort(array, left, i - 1, event);\n              sort(array, i + 1, right, event);\n          }\n          return array;\n      };\n      return sort(arr, 0, arr.length - 1, event);\n  };\n  const isInValidConversationData = (conversation) => {\n      return !conversation.type ||\n          !conversation.targetId ||\n          !isObject(conversation.latestMessage) ||\n          isUndefined(conversation.unreadMessageCount);\n  };\n  const extend = (destination, sources, option) => {\n      option = option || {};\n      const { isAllowNull } = option;\n      destination = destination || {};\n      sources = sources || {};\n      for (const key in sources) {\n          const value = sources[key];\n          if (!isUndefined(value) || isAllowNull) {\n              destination[key] = value;\n          }\n      }\n      return destination;\n  };\n\n  class Conversation {\n      constructor(_context, option) {\n          this._context = _context;\n          this.targetId = option.targetId;\n          this.type = option.type;\n      }\n      /**\n       * 删除指定会话\n       */\n      destory() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.removeConversation(this.type, this.targetId);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 清除会话未读数\n       */\n      read() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.clearUnreadCount(this.type, this.targetId);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取指定会话未读数\n       */\n      getUnreadCount() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getUnreadCount(this.type, this.targetId);\n              // 当未读数为空时，返回 0 故不校验 data 值\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 发送消息\n       * @param options\n       * @deprecated options.isPersited\n       * @deprecated options.isCounted\n       * @deprecated options.isStatusMessage\n       */\n      send(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSendMsgOption(options);\n              if (!Object.prototype.hasOwnProperty.call(options, 'isPersited')) {\n                  options.isPersited = true;\n              }\n              if (!Object.prototype.hasOwnProperty.call(options, 'isCounted')) {\n                  options.isCounted = true;\n              }\n              const { code, data } = yield this._context.sendMessage(this.type, this.targetId, options);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 设置会话状态\n       */\n      setStatus(status) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.notificationStatus', status.notificationStatus, (value) => {\n                  return (value === 1 || value === 2);\n              });\n              assert('options.isTop', status.isTop, AssertRules.BOOLEAN);\n              const code = yield this._context.setConversationStatus(this.type, this.targetId, status.isTop, status.notificationStatus);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取历史消息\n       */\n      getMessages(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.timestamp', options.timestamp, AssertRules.NUMBER);\n              assert('options.count', options.count, AssertRules.NUMBER);\n              assert('options.order', options.order, (value) => {\n                  return (value === 0 || value === 1);\n              });\n              const { code, data } = yield this._context.getHistoryMessage(this.type, this.targetId, options === null || options === void 0 ? void 0 : options.timestamp, options === null || options === void 0 ? void 0 : options.count, options === null || options === void 0 ? void 0 : options.order);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  const list = data.list.map(item => tranReceivedMessage(item));\n                  return Promise.resolve({\n                      list,\n                      hasMore: data.hasMore\n                  });\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 撤回消息\n       * @param options\n       */\n      recall(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.messageUId', options.messageUId, AssertRules.STRING, true);\n              assert('options.sentTime', options.sentTime, AssertRules.NUMBER, true);\n              const { code, data } = yield this._context.recallMessage(this.type, this.targetId, options.messageUId, options.sentTime, options.user);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 按消息 id 删除消息\n       */\n      deleteMessages(messages) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options', messages, (value) => {\n                  return isArray(value) && value.length;\n              }, true);\n              messages.forEach((item) => {\n                  assert('options.messageUId', item.messageUId, AssertRules.STRING, true);\n                  assert('options.sentTime', item.sentTime, AssertRules.NUMBER, true);\n                  assert('options.messageDirection', item.messageDirection, (value) => {\n                      return (value === 1 || value === 2);\n                  }, true);\n              });\n              const code = yield this._context.deleteRemoteMessage(this.type, this.targetId, messages);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 按时间戳删除消息\n       */\n      clearMessages(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.timestamp', options.timestamp, AssertRules.NUMBER, true);\n              const code = yield this._context.deleteRemoteMessageByTimestamp(this.type, this.targetId, options.timestamp);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 更新（添加、替换）消息扩展属性\n       * @param expansion 要更新的消息扩展信息键值对\n       * @param message 要更新的原始消息体\n      */\n      updateMessageExpansion(expansion, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('expansion', expansion, AssertRules.OBJECT, true);\n              assert('message', message, AssertRules.OBJECT, true);\n              const { type: conversationType, targetId, messageUId, canIncludeExpansion, expansion: originExpansion } = message;\n              const { code } = yield this._context.sendExpansionMessage({\n                  conversationType,\n                  targetId,\n                  messageUId,\n                  expansion,\n                  canIncludeExpansion,\n                  originExpansion\n              });\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 删除扩展存储\n       * @params keys 需删除消息扩展的 keys\n       * @params message 原始消息体\n      */\n      removeMessageExpansion(keys, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('keys', keys, AssertRules.ARRAY, true);\n              assert('message', message, AssertRules.OBJECT, true);\n              const { conversationType, targetId, messageUId, canIncludeExpansion } = message;\n              const { code } = yield this._context.sendExpansionMessage({\n                  conversationType,\n                  targetId,\n                  messageUId,\n                  canIncludeExpansion,\n                  keys\n              });\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 设置会话文本草稿\n       * @params conversationType 会话乐行\n       * @params targetId 目标 ID\n       * @params draft 草稿内容\n      */\n      setDraft(draft) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('draft', draft, AssertRules.STRING, true);\n              const code = yield this._context.saveConversationMessageDraft(this.type, this.targetId, draft);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return Promise.resolve();\n              }\n          });\n      }\n      /**\n       * 获取会话文本草稿\n       * @params conversationType 会话乐行\n       * @params targetId 目标 ID\n      */\n      getDraft() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getConversationMessageDraft(this.type, this.targetId);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return Promise.resolve(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 删除会话文本草稿\n       * @params conversationType 会话乐行\n       * @params targetId 目标 ID\n      */\n      deleteDraft() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.clearConversationMessageDraft(this.type, this.targetId);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return Promise.resolve();\n              }\n          });\n      }\n  }\n  class ConversationModule {\n      constructor(apiContext) {\n          this._context = apiContext;\n      }\n      /**\n       * 获取会话列表\n       * @param options\n       */\n      getList(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getConversationList(options === null || options === void 0 ? void 0 : options.count, undefined, options === null || options === void 0 ? void 0 : options.startTime, options === null || options === void 0 ? void 0 : options.order);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  const list = data.map(item => tranReceiveConversation(item));\n                  return sortConList(list);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 获取指定会话实例，通过实例可实现向指定会话收发消息等功能\n       * @description 通过该方法获取的会话可能并不存在于当前的会话列表中，此处只作为功能性封装语法糖\n       * @param options\n       */\n      get(options) {\n          assert('options.type', options.type, isValidConversationType, true);\n          return new Conversation(this._context, options);\n      }\n      remove(options) {\n          assert('options.type', options.type, isValidConversationType, true);\n          return new Conversation(this._context, options).destory();\n      }\n      /**\n       * 获取当前所有会话的消息未读数\n       */\n      getTotalUnreadCount() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getTotalUnreadCount();\n              // 当未读数为空时，返回 0 故不校验 data 值\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 合并会话\n       * @param option\n       */\n      merge(option) {\n          !option.conversationList && logger$1.warn('Parameter option.conversationList are required!');\n          return mergeConversationList(option);\n      }\n  }\n\n  /**\n   * 校验设置聊天室属性的参数\n   * @param options\n   */\n  const assertSetChatRoomEntryOption = (options) => {\n      assert('options.key', options.key, AssertRules.STRING, true);\n      assert('options.value', options.value, AssertRules.STRING, true);\n      assert('options.isAutoDelete', options.isAutoDelete, AssertRules.BOOLEAN);\n      assert('options.isSendNotification', options.isSendNotification, AssertRules.BOOLEAN);\n      assert('options.notificationExtra', options.notificationExtra, AssertRules.STRING);\n  };\n  /**\n   * 校验删除聊天室属性的参数\n   * @param options\n   */\n  const assertRemoveChatRoomEntryOption = (options) => {\n      assert('options.key', options.key, AssertRules.STRING, true);\n      assert('options.isSendNotification', options.isSendNotification, AssertRules.BOOLEAN);\n      assert('options.notificationExtra', options.notificationExtra, AssertRules.STRING);\n  };\n  class Chatroom {\n      constructor(context, id) {\n          this._context = context;\n          this._id = id;\n      }\n      /**\n       * 加入聊天室\n       */\n      join(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.count', options.count, AssertRules.NUMBER, true);\n              const code = yield this._context.joinChatroom(this._id, options.count);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 加入已存在的聊天室\n       */\n      joinExist(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.count', options.count, AssertRules.NUMBER, true);\n              const code = yield this._context.joinExistChatroom(this._id, options.count);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 退出聊天室\n       */\n      quit() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.quitChatroom(this._id);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取聊天室房间数据\n       * @description count 或 order 有一个为 0 时，只返回成员总数，不返回成员列表信息\n       */\n      getInfo(options = {}) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.count', options.count, AssertRules.NUMBER);\n              assert('options.order', options.order, (value) => {\n                  return [0, 1, 2].includes(value);\n              });\n              const { code, data: chatroomInfo } = yield this._context.getChatroomInfo(this._id, options.count, options.order);\n              if (code === ErrorCode$1.SUCCESS && chatroomInfo) {\n                  return chatroomInfo;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 设置聊天室自定义属性\n       * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功\n       */\n      setEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSetChatRoomEntryOption(options);\n              const code = yield this._context.setChatroomEntry(this._id, options);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 强制 增加/修改 任意聊天室属性\n       * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功\n       */\n      forceSetEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSetChatRoomEntryOption(options);\n              const code = yield this._context.forceSetChatroomEntry(this._id, options);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 删除聊天室属性\n       * @description 仅限于删除自己设置的聊天室属性\n       * @param key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符\n       * @param isSendNotification? 删除成功后是否发送通知消息\n       * @param notificationExtra? RC:chrmKVNotiMsg 通知消息中携带的附加信息\n       */\n      removeEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertRemoveChatRoomEntryOption(options);\n              const code = yield this._context.removeChatroomEntry(this._id, options);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 强制删除聊天室内的任意属性\n       * @description\n       */\n      forceRemoveEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertRemoveChatRoomEntryOption(options);\n              const code = yield this._context.forceRemoveChatroomEntry(this._id, options);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取聊天室的指定属性\n       */\n      getEntry(key\n      /**\n       * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符\n       */\n      ) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('key', key, (value) => {\n                  return isString(value) && /[\\w+=-]+/.test(value) && value.length <= 128;\n              }, true);\n              const { code, data } = yield this._context.getChatroomEntry(this._id, key);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 获取聊天室的所有属性\n       */\n      getAllEntries() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getAllChatroomEntries(this._id);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 发送消息\n       */\n      send(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSendMsgOption(options);\n              if (!Object.prototype.hasOwnProperty.call(options, 'isPersited')) {\n                  options.isPersited = true;\n              }\n              if (!Object.prototype.hasOwnProperty.call(options, 'isCounted')) {\n                  options.isCounted = true;\n              }\n              const { code, data } = yield this._context.sendMessage(ConversationType$1.CHATROOM, this._id, options);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 获取聊天室的历史消息\n       */\n      getMessages(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.timestamp', options.timestamp, AssertRules.NUMBER);\n              assert('options.count', options.count, AssertRules.NUMBER);\n              assert('options.order', options.order, (value) => {\n                  return (value === 0 || value === 1);\n              });\n              const { code, data } = yield this._context.getChatRoomHistoryMessages(this._id, options.count, options.order, options.timestamp);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  const list = data.list.map(item => tranReceivedMessage(item));\n                  return {\n                      list,\n                      hasMore: data.hasMore\n                  };\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 撤回聊天室消息\n      */\n      recall(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.messageUId', options.messageUId, AssertRules.STRING, true);\n              assert('options.sentTime', options.sentTime, AssertRules.NUMBER, true);\n              const conversationType = ConversationType$1.CHATROOM;\n              const { code, data } = yield this._context.recallMessage(conversationType, this._id, options.messageUId, options.sentTime, options.user);\n              if (code === ErrorCode$1.SUCCESS && data) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n  }\n  class ChatroomModule {\n      constructor(apiContext) {\n          this._context = apiContext;\n      }\n      /**\n       * 根据聊天室 id 初始化一个聊天室功能实例，以实现收发消息等聊天室相关功能\n       * @param option\n       */\n      get(option) {\n          assert('option.id', option.id, notEmptyString, true);\n          return new Chatroom(this._context, option.id);\n      }\n  }\n\n  class RTCClient {\n      constructor(_options, _context) {\n          this._options = _options;\n          this._context = _context;\n          this._roomId = _options.id;\n      }\n      join() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.joinRTCRoom(this._roomId, this._options.mode, this._options.broadcastType);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      quit() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.quitRTCRoom(this._roomId);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      getRoomInfo() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCRoomInfo(this._roomId);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      setUserInfo(info) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCUserInfo(this._roomId, info.key, info.value);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      removeUserInfo(info) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.removeRTCUserInfo(this._roomId, info.keys);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      setData(key, value, isInner, apiType, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCData(this._roomId, key, value, isInner, apiType, message);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      setUserData(key, value, isInner, message) {\n          return this.setData(key, value, isInner, RTCApiType.PERSON, message);\n      }\n      /**\n       * 全量 URI 资源发布\n       * @param message 旧版本消息，含消息名及消息内容\n       * @param valueInfo 全量消息数据\n       * @param objectName 全量 URI 消息名\n       */\n      setRTCUserData(message, valueInfo, objectName) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCTotalRes(this._roomId, message, valueInfo, objectName);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      getData(keys, isInner, apiType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCData(this._roomId, keys, isInner, apiType);\n              return code === ErrorCode$1.SUCCESS ? data : Promise.reject(code);\n          });\n      }\n      getUserData(keys, isInner) {\n          return this.getData(keys, isInner, RTCApiType.PERSON);\n      }\n      removeData(keys, isInner, apiType, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.removeRTCData(this._roomId, keys, isInner, apiType, message);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      removeUserData(keys, isInner, message) {\n          return this.removeData(keys, isInner, RTCApiType.PERSON, message);\n      }\n      setRoomData(key, value, isInner, message) {\n          return this.setData(key, value, isInner, RTCApiType.ROOM, message);\n      }\n      getRoomData(keys, isInner) {\n          return this.getData(keys, isInner, RTCApiType.ROOM);\n      }\n      removeRoomData(keys, isInner, message) {\n          return this.removeData(keys, isInner, RTCApiType.ROOM, message);\n      }\n      setState(content) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCState(this._roomId, content.report);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      getUserList() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCUserInfoList(this._roomId);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      getUserInfoList() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCUserInfoList(this._roomId);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      getToken() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { data, code } = yield this._context.getRTCToken(this._roomId, this._options.mode, this._options.broadcastType);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      ping() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.rtcPing(this._roomId, this._options.mode, this._options.broadcastType);\n              return code === ErrorCode$1.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      send(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.sendMessage(ConversationType$1.RTC_ROOM, this._roomId, {\n                  content: Object.assign({}, options.content),\n                  messageType: options.messageType\n              });\n              if (code === ErrorCode$1.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n  }\n  // export class RTCModule {\n  //   private _context: APIContext\n  //   constructor (apiContext: APIContext) {\n  //     this._context = apiContext\n  //   }\n  //   /**\n  //     * 为 RTCLib 提供的 API 接口，业务层不可使用\n  //     * @private\n  //     * @param options\n  //     */\n  //   get (options: RTCRoomOption) {\n  //     assert('options.id', options.id, notEmptyString, true)\n  //     return new RTCClient(options, this._context)\n  //   }\n  // }\n\n  const hasMiniBaseEvent = (miniGlobal) => {\n      const baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n      for (let i = 0, max = baseMiniEventNames.length; i < max; i++) {\n          const baseEventName = baseMiniEventNames[i];\n          if (!miniGlobal[baseEventName]) {\n              return false;\n          }\n      }\n      return true;\n  };\n  const isFromUniappEnv = () => {\n      if (typeof uni !== 'undefined' && hasMiniBaseEvent(uni)) {\n          return true;\n      }\n      return false;\n  };\n\n  const isFromUniapp = isFromUniappEnv();\n  const isValidRequest = (obj) => {\n      return typeof obj === 'function' || typeof obj === 'object';\n  };\n  const createXHR = () => {\n      if (isValidRequest(XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest()) {\n          return new XMLHttpRequest();\n      }\n      // IE 7-9 中的跨域请求方案\n      if (isValidRequest(XDomainRequest)) {\n          return new XDomainRequest();\n      }\n      // 更低版本 IE 使用 ActiveXObject 插件实现跨域请求\n      return new ActiveXObject('Microsoft.XMLHTTP');\n  };\n  function httpReq(options) {\n      const method = options.method || HttpMethod.GET;\n      const timeout = options.timeout || 60 * 1000;\n      const { headers, query, body } = options;\n      const url = appendUrl(options.url, query);\n      return new Promise((resolve) => {\n          const xhr = createXHR();\n          xhr.timeout = timeout;\n          xhr.open(method, url);\n          if (headers && xhr.setRequestHeader) {\n              for (const key in headers) {\n                  xhr.setRequestHeader(key, headers[key]);\n              }\n          }\n          if ('onload' in xhr) {\n              xhr.onload = function () {\n                  resolve({ data: xhr.responseText, status: xhr.status });\n              };\n              xhr.onerror = function () {\n                  resolve({ status: xhr.status });\n              };\n              xhr.ontimeout = function () {\n                  resolve({ status: xhr.status });\n              };\n          }\n          else {\n              xhr.onreadystatechange = () => {\n                  if (xhr.readyState === 4) {\n                      const { result, status } = xhr.responseText;\n                      resolve({ data: result, status });\n                  }\n              };\n              setTimeout(() => resolve({ status: xhr.responseText.status }), timeout);\n          }\n          const isXDomainRequest = Object.prototype.toString.call(xhr) === '[object XDomainRequest]';\n          const reqBody = isXDomainRequest && typeof body === 'object' ? JSON.stringify(body) : body;\n          xhr.send(reqBody);\n      });\n  }\n  function createWebSocket(url, protocols) {\n      const ws = new WebSocket(url, protocols);\n      ws.binaryType = 'arraybuffer';\n      return {\n          onClose(callback) {\n              ws.onclose = (evt) => {\n                  const { code, reason } = evt;\n                  callback(code, reason);\n              };\n          },\n          onError(callback) {\n              ws.onerror = callback;\n          },\n          onMessage(callback) {\n              ws.onmessage = (evt) => {\n                  callback(evt.data);\n              };\n          },\n          onOpen(callback) {\n              ws.onopen = callback;\n          },\n          send(data) {\n              ws.send(data);\n          },\n          close(code, reason) {\n              ws.close(code, reason);\n          }\n      };\n  }\n  const browser = {\n      tag: \"browser\",\n      httpReq,\n      localStorage: window === null || window === void 0 ? void 0 : window.localStorage,\n      sessionStorage: window === null || window === void 0 ? void 0 : window.sessionStorage,\n      isSupportSocket() {\n          const bool = typeof WebSocket !== 'undefined';\n          bool || logger$1.warn('websocket not support');\n          return bool;\n      },\n      useNavi: true,\n      connectPlatform: '',\n      isFromUniapp,\n      createWebSocket,\n      createDataChannel(watcher, connectType) {\n          if (this.isSupportSocket() && connectType === 'websocket') {\n              return new WebSocketChannel(this, watcher);\n          }\n          else {\n              return new CometChannel(this, watcher);\n          }\n      }\n  };\n\n  const isFromUniapp$1 = isFromUniappEnv();\n\n  const isFromUniapp$2 = isFromUniappEnv();\n\n  let runtime$1;\n  {\n      runtime$1 = browser;\n  }\n  var runtime$2 = runtime$1;\n\n  // RTCLib、CallLib 相关监听存储\n  const rtcInnerMsgWatcher = [];\n  const rtcInnerStatusWatcher = [];\n  const rtcInnerWatcher = {\n      message(message) {\n          rtcInnerMsgWatcher.forEach(item => item(message));\n      },\n      status(status) {\n          rtcInnerStatusWatcher.forEach(item => item(status));\n      }\n  };\n  class IMClient {\n      constructor(apiContext) {\n          this._token = '';\n          this._context = apiContext;\n          this.Conversation = new ConversationModule(apiContext);\n          this.ChatRoom = new ChatroomModule(apiContext);\n          this.RTC = function (options) {\n              assert('options.id', options.id, notEmptyString, true);\n              return new RTCClient(options, apiContext);\n          };\n      }\n      /**\n       * 装载 plugin 插件，并返回相应的插件实例，需在调用 `connect` 方法之前使用\n       * @param plugins\n       */\n      install(plugin, options) {\n          return this._context.install(plugin, options);\n      }\n      /**\n       * 添加全局事件监听，同一类型事件会覆盖添加，以避免多次监听引起的复杂问题\n       * @param options\n       */\n      watch(options) {\n          const { status: statusListener, conversation: conversationListener, message: messageListener, chatroom: chatroomListener, expansion: expansionListener } = options;\n          const watcher = {};\n          if (statusListener) {\n              watcher.connectionState = (status) => {\n                  // 对业务层的方法要增加 catch 捕获，避免影响内部调用栈的继续进行\n                  try {\n                      statusListener({ status });\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              };\n          }\n          if (conversationListener) {\n              watcher.conversationState = (conversations) => {\n                  try {\n                      const list = conversations.map((item) => tranReceiveUpdateConversation(item));\n                      conversationListener({\n                          updatedConversationList: list\n                      });\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              };\n          }\n          if (messageListener) {\n              watcher.message = (message) => {\n                  try {\n                      messageListener({ message: tranReceivedMessage(message) });\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              };\n          }\n          if (chatroomListener) {\n              watcher.chatroomState = (event) => {\n                  try {\n                      chatroomListener(event);\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              };\n          }\n          if (expansionListener) {\n              watcher.expansion = (event) => {\n                  try {\n                      expansionListener(event);\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              };\n          }\n          this._context.assignWatcher(watcher);\n      }\n      unwatch() {\n          this._context.assignWatcher({\n              message: undefined,\n              connectionState: undefined,\n              conversationState: undefined,\n              chatroomState: undefined,\n              expansion: undefined\n          });\n      }\n      rtcInnerWatch(attrs) {\n          const { message: messageListener, status: statusListener } = attrs;\n          if (messageListener) {\n              rtcInnerMsgWatcher.push((message) => {\n                  try {\n                      messageListener({ message: tranReceivedMessage(message) });\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              });\n          }\n          if (statusListener) {\n              rtcInnerStatusWatcher.push((status) => {\n                  try {\n                      statusListener({ status });\n                  }\n                  catch (err) {\n                      logger$1.error(err);\n                  }\n              });\n          }\n          this._context.assignWatcher({ rtcInnerWatcher });\n      }\n      rtcInnerUnwatch() {\n          rtcInnerStatusWatcher.length = rtcInnerStatusWatcher.length = 0;\n          this._context.assignWatcher({ rtcInnerWatcher: undefined });\n      }\n      /**\n       * 建立 IM 连接\n       * @param options\n       */\n      connect(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.token', options.token, AssertRules.STRING, true);\n              const token = options.token;\n              this._token = token;\n              const res = yield this._context.connect(token, true);\n              if (res.code === ErrorCode$1.SUCCESS) {\n                  return { id: res.userId };\n              }\n              return Promise.reject({ code: res.code, msg: ERROR_CODE[res.code] });\n          });\n      }\n      /**\n       * 使用上一次的链接 token 重新建立连接，该方法只需在主动调用 `disconnect` 方法之后有重连需求时调用\n       */\n      reconnect() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const res = yield this._context.reconnect();\n              if (res.code === ErrorCode$1.SUCCESS) {\n                  return { id: res.userId };\n              }\n              return Promise.reject({ code: res.code, msg: ERROR_CODE[res.code] });\n          });\n      }\n      /**\n       * 断开当前用户的连接\n       * @description 调用后将不再接收消息，不可发送消息，不可获取历史消息，不可获取会话列表\n       */\n      disconnect() {\n          return this._context.disconnect();\n      }\n      /**\n       * 获取当前 IM 环境信息\n       */\n      getAppInfo() {\n          return {\n              appkey: this._context.appkey,\n              token: this._token,\n              navi: this._context.getInfoFromCache()\n          };\n      }\n      /**\n       * 获取 IM 连接时间\n       */\n      getConnectedTime() {\n          return this._context.getConnectedTime();\n      }\n      /**\n       * 获取 IM 连接状态\n       */\n      getConnectionStatus() {\n          return this._context.getConnectionStatus();\n      }\n      /**\n       * 获取 IM 连接用户的 id\n       */\n      getConnectionUserId() {\n          return this._context.getCurrentUserId();\n      }\n      /**\n       * 获取文件 token\n       * @description 上传文件时，获取文件 token\n       * @param fileType 上传类型, 通过 RongIMLib.FILE_TYPE 获取\n       * @param fileName 上传文件名，Server 通过文件名生成百度上传认证, 若不传 engine 自动生成\n       */\n      getFileToken(fileType, fileName) {\n          assert('fileType', fileType, isValidFileType, true);\n          return this._context.getFileToken(fileType, fileName);\n      }\n      /**\n       * 获取文件上传后的下载地址\n       */\n      getFileUrl(\n      /**\n       * 上传类型, 通过 RongIMLib.FILE_TYPE 获取\n       */\n      fileType, \n      /**\n       * 上传后的文件名\n       */\n      filename, \n      /**\n       * 原始文件名\n       */\n      oriname, \n      /**\n       * 上传成功返回数据\n       * 百度 bos 上传地址即为下载地址，IM Server 不会返回百度 bos 下载地址，通过用户层传入再返回\n      */\n      uploadRes, \n      /**\n       * 上传方式，阿里或七牛，RongIMLib.UploadMethod 获取\n       */\n      uploadMethod) {\n          assert('fileType', fileType, isValidFileType, true);\n          assert('filename', filename, AssertRules.STRING);\n          assert('oriname', oriname, AssertRules.STRING);\n          assert('uploadMethod', uploadMethod, AssertRules.NUMBER);\n          return this._context.getFileUrl(fileType, filename, oriname, uploadRes, uploadMethod);\n      }\n      /**\n       * 切换用户，作用等同于断开当前用户连接，以新的 token 重新建立连接\n       * @param option\n       */\n      changeUser(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assert('options.token', options.token, AssertRules.STRING, true);\n              yield this.disconnect();\n              return this.connect(options);\n          });\n      }\n      /**\n       * 注册自定义消息\n       * @param messageType 消息类型\n       * @param isPersited  是否存储\n       * @param isCounted   是否计数\n       * @param prototypes  消息属性名称\n      */\n      registerMessageType(messageType, isPersited, isCounted, prototypes) {\n          this._context.registerMessageType(messageType, isPersited, isCounted, prototypes);\n      }\n  }\n  let imInstance;\n  /**\n   * 初始化\n   * @param {IInitOption} options\n   */\n  const init = (options) => {\n      if (imInstance) {\n          logger$1.error('The instance already exists. Do not repeatedly call the init method');\n          return imInstance;\n      }\n      assert('options.appkey', options.appkey, AssertRules.STRING, true);\n      assert('options.debug', options.debug, AssertRules.BOOLEAN);\n      assert('options.navigators', options.navigators, (value) => {\n          return isArray(value) && (value.length === 0 || value.every(isHttpUrl));\n      });\n      const context = APIContext.init(runtime$2, {\n          appkey: options.appkey,\n          apiVersion: \"4.1.0\",\n          navigators: options.navigators || [],\n          miniCMPProxy: options.customCMP || [],\n          isEnterPrise: !true,\n          connectionType: options.connectType || 'websocket',\n          cppProtocol: options.cppProtocol\n      });\n      imInstance = new IMClient(context);\n      return imInstance;\n  };\n  const getInstance = () => {\n      if (!imInstance) {\n          logger$1.error('Please call the init method first');\n      }\n      return imInstance;\n  };\n\n  exports.CHATROOM_ENTRY_TYPE = CHATROOM_ENTRY_TYPE;\n  exports.CHATROOM_ORDER = CHATROOM_ORDER;\n  exports.CONNECTION_STATUS = CONNECTION_STATUS;\n  exports.CONNECT_TYPE = CONNECT_TYPE;\n  exports.CONVERSATION_TYPE = CONVERSATION_TYPE;\n  exports.ConnectionStatus = ConnectionStatus$1;\n  exports.ERROR_CODE = ERROR_CODE;\n  exports.FILE_TYPE = FILE_TYPE;\n  exports.IMClient = IMClient;\n  exports.MENTIONED_TYPE = MENTIONED_TYPE;\n  exports.MESSAGE_DIRECTION = MESSAGE_DIRECTION;\n  exports.MESSAGE_TYPE = MESSAGE_TYPE;\n  exports.MESSAGS_TIME_ORDER = MESSAGS_TIME_ORDER;\n  exports.NOTIFICATION_STATUS = NOTIFICATION_STATUS;\n  exports.RECALL_MESSAGE_TYPE = RECALL_MESSAGE_TYPE;\n  exports.RECEIVED_STATUS = RECEIVED_STATUS;\n  exports.SDK_VERSION = SDK_VERSION;\n  exports.UploadMethod = UploadMethod$1;\n  exports.getInstance = getInstance;\n  exports.init = init;\n\n  return exports;\n\n}({}));\n"
  },
  {
    "path": "api-test-v4/lib/js/RongIMLib-4.2.0.js",
    "content": "/*\n * RCEngine - v4.2.0\n * CommitId - 1838ab715d966e65fa509d4d5e4ffd76827367a7\n * Tue Jan 12 2021 20:56:53 GMT+0800 (China Standard Time)\n * ©2020 RongCloud, Inc. All rights reserved.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n  typeof define === 'function' && define.amd ? define(['exports'], factory) :\n  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.RCEngine = {}));\n}(this, (function (exports) { 'use strict';\n\n  var ReceivedStatus;\n  (function (ReceivedStatus) {\n      /**\n       * 已读\n      */\n      ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n      /**\n       * 已听\n      */\n      ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n      /**\n       * 已下载\n      */\n      ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n      /**\n       * 该消息已经被其他登录的多端收取过。( 即该消息已经被其他端收取过后。当前端才登录，并重新拉取了这条消息。客户可以通过这个状态更新 UI，比如不再提示 )\n      */\n      ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n      /**\n       * 未读\n      */\n      ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n  })(ReceivedStatus || (ReceivedStatus = {}));\n  var ReceivedStatus$1 = ReceivedStatus;\n\n  /**\n   * Navi 缓存数据有效时长，单位毫秒\n   */\n  const NAVI_CACHE_DURATION = 2 * 60 * 60 * 1000;\n  /**\n   * 单个 Navi 请求的超时时间，单位毫秒\n   */\n  const NAVI_REQ_TIMEOUT = 10 * 1000;\n  /**\n   * /ping?r= 请求的超时时间，单位毫秒\n   */\n  const PING_REQ_TIMEOUT = 5 * 1000;\n  /**\n   * WebSocket 建立连接超时时间，单位毫秒\n   */\n  const WEB_SOCKET_TIMEOUT = 5 * 1000;\n  /**\n   * 公有云 Navi 请求地址\n   */\n  const PUBLIC_CLOUD_NAVI_URIS = ['https://nav.cn.ronghub.com', 'https://nav2-cn.ronghub.com'];\n  /**\n   * 小程序 websocket 连接地址\n   */\n  const MINI_SOCKET_CONNECT_URIS = ['wsproxy.cn.ronghub.com', 'wsap-cn.ronghub.com'];\n  /**\n   * 小程序 长轮询 连接地址\n   */\n  const MINI_COMET_CONNECT_URIS = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\n  /**\n   * IM 接口超时时间，单位毫秒\n   */\n  const IM_SIGNAL_TIMEOUT = 30 * 1000;\n  /**\n   * IM Ping 间隔时间，单位毫秒\n   */\n  const IM_PING_INTERVAL_TIME = 30 * 1000;\n  /**\n   * 消息 content 内容尺寸限制：128 KB\n   */\n  const MAX_MESSAGE_CONTENT_BYTES = 128 * 1024;\n  /**\n   * IM Comet 发送 pullmsg(嗅探 + 等待信令) 超时时间 45s\n   */\n  const IM_COMET_PULLMSG_TIMEOUT = 45000;\n  /**\n   * storage key 使用的前缀\n  */\n  const STORAGE_ROOT_KEY = 'RCV4-';\n  /*\n   * 内置消息的配置项. 发消息时, objectName 匹配到以下项时, 将覆盖用户传入值\n   * 内置消息文档: https://docs.rongcloud.cn/im/introduction/message_structure/#inherent\n   * 'RC:DizNtf' 为讨论组消息通知类型，讨论组已废弃\n  */\n  const SEND_MESSAGE_TYPE_OPTION = {\n      // 存储且计数\n      'RC:TxtMsg': { isCounted: true, isPersited: true },\n      'RC:ImgMsg': { isCounted: true, isPersited: true },\n      'RC:VcMsg': { isCounted: true, isPersited: true },\n      'RC:ImgTextMsg': { isCounted: true, isPersited: true },\n      'RC:FileMsg': { isCounted: true, isPersited: true },\n      'RC:HQVCMsg': { isCounted: true, isPersited: true },\n      'RC:LBSMsg': { isCounted: true, isPersited: true },\n      'RC:PSImgTxtMsg': { isCounted: true, isPersited: true },\n      'RC:PSMultiImgTxtMsg': { isCounted: true, isPersited: true },\n      'RCJrmf:RpMsg': { isCounted: true, isPersited: true },\n      'RCJrmf:RpOpendMsg': { isCounted: true, isPersited: true },\n      'RC:CombineMsg': { isCounted: true, isPersited: true },\n      'RC:ReferenceMsg': { isCounted: true, isPersited: true },\n      'RC:SightMsg': { isCounted: true, isPersited: true },\n      // 只存储 不计数\n      'RC:InfoNtf': { isCounted: false, isPersited: true },\n      'RC:ContactNtf': { isCounted: false, isPersited: true },\n      'RC:ProfileNtf': { isCounted: false, isPersited: true },\n      'RC:CmdNtf': { isCounted: false, isPersited: true },\n      'RC:GrpNtf': { isCounted: false, isPersited: true },\n      'RC:RcCmd': { isCounted: false, isPersited: true },\n      // 不存储 只计数 - 目前无\n      // 不存储 不计数\n      'RC:CmdMsg': { isCounted: false, isPersited: false },\n      'RC:TypSts': { isCounted: false, isPersited: false },\n      'RC:PSCmd': { isCounted: false, isPersited: false },\n      'RC:SRSMsg': { isCounted: false, isPersited: false },\n      'RC:RRReqMsg': { isCounted: false, isPersited: false },\n      'RC:RRRspMsg': { isCounted: false, isPersited: false },\n      'RC:CsChaR': { isCounted: false, isPersited: false },\n      'RC:CSCha': { isCounted: false, isPersited: false },\n      'RC:CsEva': { isCounted: false, isPersited: false },\n      'RC:CsContact': { isCounted: false, isPersited: false },\n      'RC:CsHs': { isCounted: false, isPersited: false },\n      'RC:CsHsR': { isCounted: false, isPersited: false },\n      'RC:CsSp': { isCounted: false, isPersited: false },\n      'RC:CsEnd': { isCounted: false, isPersited: false },\n      'RC:CsUpdate': { isCounted: false, isPersited: false },\n      'RC:ReadNtf': { isCounted: false, isPersited: false },\n      'RC:chrmKVNotiMsg': { isCounted: false, isPersited: false },\n      'RC:VCAccept': { isCounted: false, isPersited: false },\n      'RC:VCRinging': { isCounted: false, isPersited: false },\n      'RC:VCSummary': { isCounted: false, isPersited: false },\n      'RC:VCHangup': { isCounted: false, isPersited: false },\n      'RC:VCInvite': { isCounted: false, isPersited: false },\n      'RC:VCModifyMedia': { isCounted: false, isPersited: false },\n      'RC:VCModifyMem': { isCounted: false, isPersited: false },\n      'RC:MsgExMsg': { isCounted: false, isPersited: false }\n  };\n\n  let rootStorage;\n  const createRootStorage = (runtime) => {\n      if (!rootStorage) {\n          rootStorage = {\n              set: (key, val) => {\n                  runtime.localStorage.setItem(key, JSON.stringify(val));\n              },\n              get: (key) => {\n                  let val;\n                  try {\n                      val = JSON.parse(runtime.localStorage.getItem(key));\n                  }\n                  catch (e) {\n                      val = null;\n                  }\n                  return val;\n              },\n              remove: (key) => {\n                  return runtime.localStorage.removeItem(key);\n              },\n              getKeys: () => {\n                  const keys = [];\n                  for (const key in runtime.localStorage) {\n                      keys.push(key);\n                  }\n                  return keys;\n              }\n          };\n      }\n      return rootStorage;\n  };\n  class AppCache {\n      constructor(value) {\n          this._caches = {};\n          if (value) {\n              this._caches = value;\n          }\n      }\n      set(key, value) {\n          this._caches[key] = value;\n      }\n      remove(key) {\n          const val = this.get(key);\n          delete this._caches[key];\n          return val;\n      }\n      get(key) {\n          return this._caches[key];\n      }\n      getKeys() {\n          const keys = [];\n          for (const key in this._caches) {\n              keys.push(key);\n          }\n          return keys;\n      }\n  }\n  class AppStorage {\n      constructor(runtime, suffix) {\n          const key = suffix ? `${STORAGE_ROOT_KEY}${suffix}` : STORAGE_ROOT_KEY;\n          this._rootStorage = createRootStorage(runtime);\n          const localCache = this._rootStorage.get(key) || {};\n          this._cache = new AppCache({\n              [key]: localCache\n          });\n          this._storageKey = key;\n      }\n      _get() {\n          const key = this._storageKey;\n          return this._cache.get(key) || {};\n      }\n      _set(cache) {\n          const key = this._storageKey;\n          cache = cache || {};\n          this._cache.set(key, cache);\n          this._rootStorage.set(key, cache);\n      }\n      set(key, value) {\n          const localValue = this._get();\n          localValue[key] = value;\n          this._set(localValue);\n      }\n      remove(key) {\n          const localValue = this._get();\n          delete localValue[key];\n          this._set(localValue);\n      }\n      clear() {\n          const key = this._storageKey;\n          this._rootStorage.remove(key);\n          this._cache.remove(key);\n      }\n      get(key) {\n          const localValue = this._get();\n          return localValue[key];\n      }\n      getKeys() {\n          const localValue = this._get();\n          const keyList = [];\n          for (const key in localValue) {\n              keyList.push(key);\n          }\n          return keyList;\n      }\n      getValues() {\n          return this._get() || {};\n      }\n  }\n\n  class Todo extends Error {\n      constructor(message) {\n          super(`TODO => ${message}`);\n      }\n  }\n  const todo = (message) => new Todo(message);\n\n  /**\n   * 字符串转为大写形式并返回\n   * @todo 违反单一性原则，后续需分拆，以及需要评估是否过渡封装\n   * @param str\n   * @param startIndex 开始位置\n   * @param endIndex 结束位置\n  */\n  const toUpperCase = (str, startIndex, endIndex) => {\n      if (startIndex === undefined || endIndex === undefined) {\n          return str.toUpperCase();\n      }\n      const sliceStr = str.slice(startIndex, endIndex);\n      str = str.replace(sliceStr, (text) => {\n          return text.toUpperCase();\n      });\n      return str;\n  };\n  const getByteLength = (str, charset = 'utf-8') => {\n      let total = 0;\n      let chatCode;\n      if (charset === 'utf-16') {\n          for (let i = 0, max = str.length; i < max; i++) {\n              chatCode = str.charCodeAt(i);\n              if (chatCode <= 0xffff) {\n                  total += 2;\n              }\n              else {\n                  total += 4;\n              }\n          }\n      }\n      else {\n          for (let i = 0, max = str.length; i < max; i++) {\n              chatCode = str.charCodeAt(i);\n              if (chatCode < 0x007f) {\n                  total += 1;\n              }\n              else if (chatCode <= 0x07ff) {\n                  total += 2;\n              }\n              else if (chatCode <= 0xffff) {\n                  total += 3;\n              }\n              else {\n                  total += 4;\n              }\n          }\n      }\n      return total;\n  };\n  const appendUrl = (url, query) => {\n      url = url.replace(/\\?$/, '');\n      if (!query) {\n          return url;\n      }\n      const searchArr = Object.keys(query).map(key => `${key}=${query[key]}`).filter(item => !!item);\n      if (searchArr.length) {\n          return [url, searchArr.join('&')].join('?');\n      }\n      return url;\n  };\n  /**\n   * 建立连接时，apiVersion 需符合 `/\\d+(\\.\\d+){2}/` 规则，对于预发布版本号如 `3.1.0-alpha.1`，需解析定为 `3.1.0`\n   * @param apiVersion\n   */\n  const matchVersion = (apiVersion) => {\n      const matches = apiVersion.match(/\\d+(\\.\\d+){2}/);\n      return matches[0];\n  };\n\n  (function (LogLevel) {\n      /**\n       * 等同于 `LogLevel.DEBUG`\n       */\n      LogLevel[LogLevel[\"LOG\"] = 0] = \"LOG\";\n      LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\n      LogLevel[LogLevel[\"INFO\"] = 1] = \"INFO\";\n      LogLevel[LogLevel[\"WARN\"] = 2] = \"WARN\";\n      LogLevel[LogLevel[\"ERROR\"] = 3] = \"ERROR\";\n      LogLevel[LogLevel[\"NONE\"] = 1000] = \"NONE\";\n  })(exports.LogLevel || (exports.LogLevel = {}));\n\n  const methods = {\n      [exports.LogLevel.DEBUG]: console.debug.bind(console),\n      [exports.LogLevel.INFO]: console.info.bind(console),\n      [exports.LogLevel.WARN]: console.warn.bind(console),\n      [exports.LogLevel.ERROR]: console.error.bind(console)\n  };\n  class Logger {\n      constructor(_tag) {\n          this._tag = _tag;\n          /**\n           * 输出等级\n           */\n          this._outLevel = exports.LogLevel.WARN;\n          /**\n           * 输出函数\n           */\n          this._stdout = this._defaultStdout;\n          this.log = this._out;\n          this.debug = this._out.bind(this, exports.LogLevel.DEBUG);\n          this.info = this._out.bind(this, exports.LogLevel.INFO);\n          this.warn = this._out.bind(this, exports.LogLevel.WARN);\n          this.error = this._out.bind(this, exports.LogLevel.ERROR);\n      }\n      /**\n       * 默认输出函数\n       * @param level\n       * @param args\n       */\n      _defaultStdout(level, ...args) {\n          methods[level](`[${this._tag}](${new Date().toUTCString()}):`, ...args);\n      }\n      _out(level, ...args) {\n          level >= this._outLevel && this._stdout(level, ...args);\n      }\n      /**\n       * 设置默认输出等级及输出函数\n       * @param outLevel\n       * @param stdout\n       */\n      set(outLevel, stdout) {\n          this._outLevel = outLevel;\n          this._stdout = stdout || this._defaultStdout;\n      }\n  }\n  const logger = new Logger('RCLog');\n\n  /**\n   * 会话类型\n   */\n  var ConversationType;\n  (function (ConversationType) {\n      /**\n       * 无类型\n       */\n      ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n      /**\n       * 单聊\n       */\n      ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n      /**\n       * 讨论组\n       */\n      ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n      /**\n       * 群组聊天\n       */\n      ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n      /**\n       * 聊天室会话\n       */\n      ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n      /**\n       * 客服会话\n       */\n      ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n      /**\n       * 系统消息\n       */\n      ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n      /**\n       * 默认关注的公众号会话类型（MC)\n       */\n      ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n      /**\n       * 需手动关注的公众号会话类型（MP)\n       */\n      ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n      /**\n       * RTCLib 特有的会话类型\n       */\n      ConversationType[ConversationType[\"RTC_ROOM\"] = 12] = \"RTC_ROOM\";\n  })(ConversationType || (ConversationType = {}));\n  var ConversationType$1 = ConversationType;\n\n  /**\n   * 文件类型\n   */\n  var FileType;\n  (function (FileType) {\n      /**\n       * 图片文件\n       */\n      FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n      /**\n       * 声音文件\n       */\n      FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n      /**\n       * 视频文件\n       */\n      FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n      /**\n       * 非媒体文件\n       */\n      FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n      /**\n       * 小视频类型\n      */\n      FileType[FileType[\"SIGHT\"] = 5] = \"SIGHT\";\n      /**\n       * 合并转发\n      */\n      FileType[FileType[\"COMBINE_HTML\"] = 6] = \"COMBINE_HTML\";\n  })(FileType || (FileType = {}));\n  var FileType$1 = FileType;\n\n  /**\n   * 检查参数是否为字符串\n   * 只做类型检查，不做长度检查，故当字符串长度为 0，结果依然为 true\n   * @param str\n   */\n  const isString = (value) => typeof value === 'string';\n  /**\n   * 检查参数是否为 number 数据\n   * @param value\n   */\n  const isNumber = (value) => typeof value === 'number' && !isNaN(value);\n  /**\n   * 检查参数是否为数组\n   * 只做类型检查，不做长度检查\n   * 如 UnitArray、BufferArray 等也属于数组\n   * @param arr\n   */\n  const isArray = (arr) => Object.prototype.toString.call(arr).indexOf('Array') !== -1;\n  /**\n   * 检查参数是否为 ArrayBuffer\n   * @param arr\n   */\n  const isArrayBuffer = (arr) => Object.prototype.toString.call(arr) === '[object ArrayBuffer]';\n  /**\n   * 检查参数是否为长度非 0 的字符串\n   * @param str\n   */\n  const notEmptyString = (str) => isString(str) && str.length > 0;\n  /**\n   * 检查参数是否为长度非 0 的数组\n   * @param str\n   */\n  const notEmptyArray = (arr) => isArray(arr) && arr.length > 0;\n  /**\n   * 检查参数是否为对象\n   * @param val\n   */\n  const isObject = (val) => {\n      return Object.prototype.toString.call(val) === '[object Object]';\n  };\n  /**\n   * 检查参数是否为函数\n   * @param val\n   */\n  const isFunction = (val) => {\n      return Object.prototype.toString.call(val) === '[object Function]';\n  };\n  /**\n   * 检查参数是否为undefined\n   * @param val\n   */\n  const isUndefined = (val) => {\n      // IE 下 undefined 为 Object\n      return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  };\n  /**\n   * 检查参数是否为 null\n  */\n  const isNull = (val) => {\n      return Object.prototype.toString.call(val) === '[object Null]';\n  };\n  /**\n   * 检查参数是否为有效 http(s) 协议 url\n   * @param value\n   */\n  const isHttpUrl = (value) => isString(value) && /https?:\\/\\//.test(value);\n  /**\n   * 检查对象不为空\n   * @param val\n  */\n  const notEmptyObject = (val) => {\n      // eslint-disable-next-line no-unreachable-loop\n      for (const key in val) {\n          return true;\n      }\n      return false;\n  };\n  const isValidConversationType = (conversation) => {\n      return isNumber(conversation) && Object.prototype.hasOwnProperty.call(ConversationType$1, conversation);\n  };\n  /**\n   * 判断是否是一个有效的文件类型\n   */\n  const isValidFileType = (fileType) => {\n      return isNumber(fileType) && Object.prototype.hasOwnProperty.call(FileType$1, fileType);\n  };\n\n  class EventEmitter {\n      constructor() {\n          this._map = {};\n      }\n      /**\n       * 添加事件监听器\n       * @param eventType\n       * @param listener\n       */\n      on(eventType, listener) {\n          const arr = this._map[eventType] || (this._map[eventType] = []);\n          if (arr.includes(listener)) {\n              return;\n          }\n          arr.push(listener);\n      }\n      /**\n       * 移除事件监听器\n       * @param eventType\n       * @param listener\n       */\n      off(eventType, listener) {\n          const arr = this._map[eventType];\n          if (!arr) {\n              return;\n          }\n          const len = arr.length;\n          for (let i = len - 1; i >= 0; i -= 1) {\n              if (arr[i] === listener) {\n                  arr.splice(i, 1);\n                  if (len === 1) {\n                      delete this._map[eventType];\n                  }\n                  break;\n              }\n          }\n      }\n      /**\n       * 事件派发\n       * @param eventType\n       * @param data\n       */\n      emit(eventType, data) {\n          const arr = this._map[eventType];\n          if (!arr) {\n              return;\n          }\n          arr.forEach(item => item(data));\n      }\n      /**\n       * 清空所有指定类型的事件监听器\n       * @param eventType\n       */\n      removeAll(eventType) {\n          delete this._map[eventType];\n      }\n      /**\n       * 无差别清空所有事件监听器\n       */\n      clear() {\n          Object.keys(this._map).forEach(this.removeAll, this);\n      }\n  }\n\n  (function (AssertRules) {\n      /**\n       * 类型为字符串，且长度大于 0\n       */\n      AssertRules[AssertRules[\"STRING\"] = 0] = \"STRING\";\n      /**\n       * 类型仅为 String\n      */\n      AssertRules[AssertRules[\"ONLY_STRING\"] = 1] = \"ONLY_STRING\";\n      /**\n       * 类型为数字\n       */\n      AssertRules[AssertRules[\"NUMBER\"] = 2] = \"NUMBER\";\n      /**\n       * 类型为布尔值\n       */\n      AssertRules[AssertRules[\"BOOLEAN\"] = 3] = \"BOOLEAN\";\n      /**\n       * 类型为对象\n      */\n      AssertRules[AssertRules[\"OBJECT\"] = 4] = \"OBJECT\";\n      /**\n       * 类型为数组\n      */\n      AssertRules[AssertRules[\"ARRAY\"] = 5] = \"ARRAY\";\n      /**\n       * 类型为 callback 回调对象，包含 callback.onSuccess、callback.onError\n      */\n      AssertRules[AssertRules[\"CALLBACK\"] = 6] = \"CALLBACK\";\n  })(exports.AssertRules || (exports.AssertRules = {}));\n  const validators = {\n      [exports.AssertRules.STRING]: notEmptyString,\n      [exports.AssertRules.ONLY_STRING]: isString,\n      [exports.AssertRules.NUMBER]: isNumber,\n      [exports.AssertRules.BOOLEAN]: (value) => typeof value === 'boolean',\n      [exports.AssertRules.OBJECT]: isObject,\n      [exports.AssertRules.ARRAY]: isArray,\n      [exports.AssertRules.CALLBACK]: (callback) => {\n          let flag = true;\n          if (!isObject(callback)) {\n              flag = false;\n          }\n          callback = callback || {};\n          if (callback.onSuccess && !isFunction(callback.onSuccess)) {\n              flag = false;\n          }\n          if (callback.onError && !isFunction(callback.onError)) {\n              flag = false;\n          }\n          return flag;\n      }\n  };\n  class RCAssertError extends Error {\n      constructor(message) {\n          super(message);\n          this.name = 'RCAssertError';\n      }\n  }\n  /**\n   * 参数校验，该方法用于对业务层入参数据检查，及时抛出异常通知业务层进行修改\n   * @description\n   * 1. 必填参数，value 需符合 validator 验证规，否则抛出异常\n   * 2. 非必填参数，value 可为 undefined | null 或符合 validator 规则\n   * @param key 字段名，仅用于验证失败时给出提示信息\n   * @param value 待验证的值\n   * @param validator 期望类型或校验规则函数，若使用规则函数\n   * @param required 是否为必填参数，默认为 `false`\n   */\n  const assert = (key, value, validator, required = false) => {\n      if (!validate(key, value, validator, required)) {\n          throw new RCAssertError(`'${key}' is invalid: ${JSON.stringify(value)}`);\n      }\n  };\n  /**\n   * 参数校验，该方法用于对业务层入参数据检查，与 `assert` 函数不同的是其返回 boolean 值而非直接抛出异常\n   * @description\n   * 1. 必填参数，value 需符合 validator 验证规，否则抛出异常\n   * 2. 非必填参数，value 可为 undefined | null 或符合 validator 规则\n   * @param key 字段名，仅用于验证失败时给出提示信息\n   * @param value 待验证的值\n   * @param validator 期望类型或校验规则函数，若使用规则函数\n   * @param required 是否为必填参数，默认为 `false`\n   */\n  const validate = (key, value, validator, required = false) => {\n      validator = validators[validator] || validator;\n      const invalid = \n      // 必填参数校验\n      (required && !validator(value)) ||\n          // 非必填参数校验\n          (!required && !(isUndefined(value) || value === null || validator(value)));\n      if (invalid) {\n          // 打印无效参数到控制台便于定位问题\n          logger.error(`'${key}' is invalid: ${JSON.stringify(value)}`);\n      }\n      return !invalid;\n  };\n\n  /**\n   * @todo 后期禁用此方法，容易滥用，且会丢失上下文的数据类型跟踪\n   * @deprecated\n   * @param source\n   * @param event\n   * @param options\n   */\n  const forEach = (source, event, options) => {\n      options = options || {};\n      event = event || function () { };\n      const { isReverse } = options;\n      const loopObj = () => {\n          for (const key in source) {\n              event(source[key], key, source);\n          }\n      };\n      const loopArr = () => {\n          if (isReverse) {\n              for (let i = source.length - 1; i >= 0; i--) {\n                  event(source[i], i);\n              }\n          }\n          else {\n              for (let j = 0, len = source.length; j < len; j++) {\n                  event(source[j], j);\n              }\n          }\n      };\n      if (isObject(source)) {\n          loopObj();\n      }\n      if (isArray(source) || isString(source)) {\n          loopArr();\n      }\n  };\n  /**\n   * @deprecated\n   * @param source\n   * @param event\n   */\n  const map = (source, event) => {\n      forEach(source, (item, index) => {\n          source[index] = event(item, index);\n      });\n      return source;\n  };\n  const indexOf = (source, searchVal) => {\n      // 注: 字符串的 indexof 兼容至 IE3\n      if (source.indexOf) {\n          return source.indexOf(searchVal);\n      }\n      let index = -1;\n      forEach(source, (sub, i) => {\n          if (searchVal === sub) {\n              index = i;\n          }\n      });\n      return index;\n  };\n  const isInclude = (source, searchVal) => {\n      const index = indexOf(source, searchVal);\n      return index !== -1;\n  };\n  /**\n   * 判断对象里是否有某个值\n  */\n  const isInObject = (source, searchVal) => {\n      const arr = [];\n      forEach(source, (val) => {\n          arr.push(val);\n      });\n      const index = indexOf(arr, searchVal);\n      return index !== -1;\n  };\n  /**\n   * 通过 JSON 拷贝\n  */\n  const cloneByJSON = (sourceObj) => {\n      return JSON.parse(JSON.stringify(sourceObj));\n  };\n\n  /**\n   *  聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新\n  */\n  var ChatroomEntryType;\n  (function (ChatroomEntryType) {\n      ChatroomEntryType[ChatroomEntryType[\"UPDATE\"] = 1] = \"UPDATE\";\n      ChatroomEntryType[ChatroomEntryType[\"DELETE\"] = 2] = \"DELETE\";\n  })(ChatroomEntryType || (ChatroomEntryType = {}));\n  var ChatroomEntryType$1 = ChatroomEntryType;\n\n  /**\n   * 通过 status 计算接收到的消息的部分属性值\n   * @description\n   * status 转为二进制, 二进制的比特位存储消息的部分属性值\n   * 属性所占比特位:\n   * 0000-0010 该消息是否曾被该用户拉取过(其他端)\n   * 0001-0000 isPersited\n   * 0010-0000 isCounted\n   * 0100-0000 isMentioned\n   * 0010-0000-0000 disableNotification\n   * 0100-0000-0000 canIncludeExpansion\n  */\n  const getMessageOptionByStatus = (status) => {\n      let isPersited = true;\n      let isCounted = true;\n      let isMentioned = false;\n      let disableNotification = false;\n      let receivedStatus = ReceivedStatus$1.READ;\n      let isReceivedByOtherClient = false;\n      let canIncludeExpansion = false;\n      isPersited = !!(status & 0x10);\n      isCounted = !!(status & 0x20);\n      isMentioned = !!(status & 0x40);\n      disableNotification = !!(status & 0x200);\n      isReceivedByOtherClient = !!(status & 0x02);\n      receivedStatus = isReceivedByOtherClient ? ReceivedStatus$1.RETRIEVED : receivedStatus;\n      canIncludeExpansion = !!(status & 0x400);\n      return {\n          isPersited,\n          isCounted,\n          isMentioned,\n          disableNotification,\n          receivedStatus,\n          canIncludeExpansion\n      };\n  };\n  /**\n   * 通过 sessionId 计算发送消息成功后，发送消息的部分属性\n   * @description\n   * sessionId 转为二进制, 二进制的比特位存储消息的部分属性值\n   * 属性所占比特位:\n   * 0000-0001 isPersited\n   * 0000-0010 isCounted\n   * 0000-0100 isMentioned\n   * 0010-0000 disableNotification\n   * 0100-0000 canIncludeExpansion\n  */\n  const getUpMessageOptionBySessionId = (sessionId) => {\n      let isPersited = false;\n      let isCounted = false;\n      let disableNotification = false;\n      let canIncludeExpansion = false;\n      isPersited = !!(sessionId & 0x01);\n      isCounted = !!(sessionId & 0x02);\n      disableNotification = !!(sessionId & 0x10);\n      canIncludeExpansion = !!(sessionId & 0x40);\n      return {\n          isPersited,\n          isCounted,\n          disableNotification,\n          canIncludeExpansion\n      };\n  };\n  const formatExtraContent = (extraContent) => {\n      const expansion = {}; // 扩展为用户任意设置的键值对\n      const parseExtraContent = JSON.parse(extraContent);\n      forEach(parseExtraContent, (value, key) => {\n          expansion[key] = value.v;\n      });\n      return expansion;\n  };\n  /**\n   * TODO: 确定对外暴露的必要性\n   * @deprecated\n   */\n  const DelayTimer = {\n      _delayTime: 0,\n      /**\n       * 方法并未引用，getTimer 实际返回值始终为 Date.now()\n       * @deprecated\n       */\n      setTime: (time) => {\n          const currentTime = new Date().getTime();\n          DelayTimer._delayTime = currentTime - time;\n      },\n      getTime: () => {\n          const delayTime = DelayTimer._delayTime;\n          const currentTime = new Date().getTime();\n          return currentTime - delayTime;\n      }\n  };\n  const getChatRoomKVByStatus = (status) => {\n      const isDeleteOpt = !!(status & 0x0004);\n      return {\n          isAutoDelete: !!(status & 0x0001),\n          isOverwrite: !!(status & 0x0002),\n          type: isDeleteOpt ? ChatroomEntryType$1.DELETE : ChatroomEntryType$1.UPDATE\n      };\n  };\n  const getChatRoomKVOptStatus = (entity, action) => {\n      let status = 0;\n      // 是否自动清理\n      if (entity.isAutoDelete) {\n          status = status | 0x0001;\n      }\n      // 是否覆盖\n      if (entity.isOverwrite) {\n          status = status | 0x0002;\n      }\n      // 操作类型\n      if (action === 2) {\n          status = status | 0x0004;\n      }\n      return status;\n  };\n  const getSessionId = (option) => {\n      const { isStatusMessage } = option;\n      let { isPersited, isCounted, isMentioned, disableNotification, canIncludeExpansion } = option;\n      if (isStatusMessage) {\n          isPersited = isCounted = false;\n      }\n      let sessionId = 0;\n      if (isPersited) {\n          sessionId = sessionId | 0x01;\n      }\n      if (isCounted) {\n          sessionId = sessionId | 0x02;\n      }\n      if (isMentioned) {\n          sessionId = sessionId | 0x04;\n      }\n      if (disableNotification) {\n          sessionId = sessionId | 0x20;\n      }\n      if (canIncludeExpansion) {\n          sessionId = sessionId | 0x40;\n      }\n      return sessionId;\n  };\n\n  /*! *****************************************************************************\n  Copyright (c) Microsoft Corporation.\n\n  Permission to use, copy, modify, and/or distribute this software for any\n  purpose with or without fee is hereby granted.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n  PERFORMANCE OF THIS SOFTWARE.\n  ***************************************************************************** */\n\n  function __awaiter(thisArg, _arguments, P, generator) {\n      function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n      return new (P || (P = Promise))(function (resolve, reject) {\n          function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n          function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n          function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n          step((generator = generator.apply(thisArg, _arguments || [])).next());\n      });\n  }\n\n  /**\n   * 通信协议中 fixHeader 第一个字节中的 Qos 数据标识\n   * ```\n   * fixHeader：command(4 bit) | dup(1 bit) | Qos(2 bit) | retain(1 bit)\n   * ```\n   */\n  var QOS;\n  (function (QOS) {\n      QOS[QOS[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n      QOS[QOS[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n      QOS[QOS[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n      QOS[QOS[\"DEFAULT\"] = 3] = \"DEFAULT\";\n  })(QOS || (QOS = {}));\n  /**\n   * 通信协议中 fixHeader 第一个字节中的 command 数据标识，用于判断操作类型\n   * ```\n   * fixHeader：command(4 bit) | dup(1 bit) | Qos(2 bit) | retain(1 bit)\n   * ```\n   */\n  var OperationType;\n  (function (OperationType) {\n      /** 私有云专用，解密协商指令 */\n      OperationType[OperationType[\"SYMMETRIC\"] = 0] = \"SYMMETRIC\";\n      /** 连接请求 */\n      OperationType[OperationType[\"CONNECT\"] = 1] = \"CONNECT\";\n      /** 连接应答 */\n      OperationType[OperationType[\"CONN_ACK\"] = 2] = \"CONN_ACK\";\n      /** 上行发送消息 */\n      OperationType[OperationType[\"PUBLISH\"] = 3] = \"PUBLISH\";\n      /** 上行发送消息的应答 */\n      OperationType[OperationType[\"PUB_ACK\"] = 4] = \"PUB_ACK\";\n      /** 上行拉消息 */\n      OperationType[OperationType[\"QUERY\"] = 5] = \"QUERY\";\n      /** 上行拉消息的应答 */\n      OperationType[OperationType[\"QUERY_ACK\"] = 6] = \"QUERY_ACK\";\n      /** QueryConfirm */\n      OperationType[OperationType[\"QUERY_CONFIRM\"] = 7] = \"QUERY_CONFIRM\";\n      OperationType[OperationType[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n      OperationType[OperationType[\"SUB_ACK\"] = 9] = \"SUB_ACK\";\n      OperationType[OperationType[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n      OperationType[OperationType[\"UNSUB_ACK\"] = 11] = \"UNSUB_ACK\";\n      OperationType[OperationType[\"PING_REQ\"] = 12] = \"PING_REQ\";\n      OperationType[OperationType[\"PING_RESP\"] = 13] = \"PING_RESP\";\n      /** 连接挂断 */\n      OperationType[OperationType[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n      OperationType[OperationType[\"RESERVER2\"] = 15] = \"RESERVER2\";\n  })(OperationType || (OperationType = {}));\n  var MessageName;\n  (function (MessageName) {\n      MessageName[\"CONN_ACK\"] = \"ConnAckMessage\";\n      MessageName[\"DISCONNECT\"] = \"DisconnectMessage\";\n      MessageName[\"PING_REQ\"] = \"PingReqMessage\";\n      MessageName[\"PING_RESP\"] = \"PingRespMessage\";\n      MessageName[\"PUBLISH\"] = \"PublishMessage\";\n      MessageName[\"PUB_ACK\"] = \"PubAckMessage\";\n      MessageName[\"QUERY\"] = \"QueryMessage\";\n      MessageName[\"QUERY_CON\"] = \"QueryConMessage\";\n      MessageName[\"QUERY_ACK\"] = \"QueryAckMessage\";\n  })(MessageName || (MessageName = {}));\n  var IDENTIFIER;\n  (function (IDENTIFIER) {\n      IDENTIFIER[\"PUB\"] = \"pub\";\n      IDENTIFIER[\"QUERY\"] = \"qry\";\n  })(IDENTIFIER || (IDENTIFIER = {}));\n\n  /**\n   * @todo 注释补全\n   * @description\n   * Header 处理\n  */\n  class Header {\n      constructor(type, retain = false, qos = QOS.AT_LEAST_ONCE, dup = false) {\n          this._retain = false;\n          this.qos = QOS.AT_LEAST_ONCE;\n          this._dup = false;\n          this.syncMsg = false;\n          const isPlusType = type > 0; // 是否为正数\n          if (type && isPlusType && arguments.length === 1) {\n              this._retain = (type & 1) > 0;\n              this.qos = (type & 6) >> 1; // (_type & 0b110) >> 1\n              this._dup = (type & 8) > 0; // (_type & 0b1000) > 0\n              this.type = (type >> 4) & 15; // (_type >> 0b100) & 0b1111\n              this.syncMsg = (type & 8) === 8; // (_type & 0b1000) === 0b1000;\n          }\n          else {\n              this.type = type;\n              this._retain = retain;\n              this.qos = qos;\n              this._dup = dup;\n          }\n      }\n      encode() {\n          // const validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT]\n          // // 如果 qos 为字符串, 此处转为数字\n          // for (let i = 0; i < validQosList.length; i++) {\n          //   if (this.qos === validQosList[i]) {\n          //     this.qos = validQosList[i]\n          //   }\n          // }\n          let byte = (this.type << 4); // 4 -> 100\n          byte |= this._retain ? 1 : 0;\n          byte |= this.qos << 1;\n          byte |= this._dup ? 8 : 0; // 8 -> 1000\n          return byte;\n      }\n  }\n  /**\n   * @description\n   * 二进制处理\n  */\n  class BinaryHelper {\n      /**\n       * @description\n       * 将字符串转化为 utf8 编码组成的数组\n       * @param {string} str 待转化的字符串\n       * @param {boolean} isGetBytes 是否向前插入字符长度\n       */\n      static writeUTF(str, isGetBytes) {\n          const back = [];\n          let byteSize = 0;\n          if (isString(str)) {\n              for (let i = 0, len = str.length; i < len; i++) {\n                  const code = str.charCodeAt(i);\n                  if (code >= 0 && code <= 127) {\n                      byteSize += 1;\n                      back.push(code);\n                  }\n                  else if (code >= 128 && code <= 2047) {\n                      byteSize += 2;\n                      back.push((192 | (31 & (code >> 6))));\n                      back.push((128 | (63 & code)));\n                  }\n                  else if (code >= 2048 && code <= 65535) {\n                      byteSize += 3;\n                      back.push((224 | (15 & (code >> 12))));\n                      back.push((128 | (63 & (code >> 6))));\n                      back.push((128 | (63 & code)));\n                  }\n              }\n          }\n          for (let i = 0, len = back.length; i < len; i++) {\n              if (back[i] > 255) {\n                  back[i] &= 255;\n              }\n          }\n          if (isGetBytes) {\n              return back;\n          }\n          if (byteSize <= 255) {\n              return [0, byteSize].concat(back);\n          }\n          else {\n              return [byteSize >> 8, byteSize & 255].concat(back);\n          }\n      }\n      /**\n       * @description\n       * 获取二进制字节流的 utf8 编码结果\n       * @param {Array<number>} arr 二进制数据\n       */\n      static readUTF(arr) {\n          const MAX_SIZE = 0x4000;\n          const codeUnits = [];\n          let highSurrogate;\n          let lowSurrogate;\n          let index = -1;\n          const strBytes = arr;\n          let result = '';\n          while (++index < strBytes.length) {\n              let codePoint = Number(strBytes[index]);\n              if (codePoint === (codePoint & 0x7F)) ;\n              else if ((codePoint & 0xF0) === 0xF0) {\n                  codePoint ^= 0xF0;\n                  codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                  codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                  codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n              }\n              else if ((codePoint & 0xE0) === 0xE0) {\n                  codePoint ^= 0xE0;\n                  codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                  codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n              }\n              else if ((codePoint & 0xC0) === 0xC0) {\n                  codePoint ^= 0xC0;\n                  codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n              }\n              if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || Math.floor(codePoint) !== codePoint) {\n                  throw RangeError('Invalid code point: ' + codePoint);\n              }\n              if (codePoint <= 0xFFFF) {\n                  codeUnits.push(codePoint);\n              }\n              else {\n                  codePoint -= 0x10000;\n                  highSurrogate = (codePoint >> 10) | 0xD800;\n                  lowSurrogate = (codePoint % 0x400) | 0xDC00;\n                  codeUnits.push(highSurrogate, lowSurrogate);\n              }\n              if (index + 1 === strBytes.length || codeUnits.length > MAX_SIZE) {\n                  result += String.fromCharCode.apply(null, codeUnits);\n                  codeUnits.length = 0;\n              }\n          }\n          return result;\n      }\n  }\n  /**\n   * @description\n   * 融云读取二进制数据\n  */\n  class RongStreamReader {\n      constructor(arr) {\n          // 当前流已截取到的位置\n          this._position = 0;\n          // 待处理数据的总长度\n          this._poolLen = 0;\n          this._pool = arr;\n          this._poolLen = arr.length;\n      }\n      check() {\n          return this._position >= this._pool.length;\n      }\n      /**\n       * 读 4 位\n       */\n      readInt() {\n          const self = this;\n          if (self.check()) {\n              return -1;\n          }\n          let end = '';\n          for (let i = 0; i < 4; i++) {\n              let t = self._pool[self._position++].toString(16);\n              if (t.length === 1) {\n                  t = '0' + t;\n              }\n              end += t.toString();\n          }\n          return parseInt(end, 16);\n      }\n      /**\n       * 读 8 位\n       */\n      readLong() {\n          const self = this;\n          if (self.check()) {\n              return -1;\n          }\n          let end = '';\n          for (let i = 0; i < 8; i++) {\n              let t = self._pool[self._position++].toString(16);\n              if (t.length === 1) {\n                  t = '0' + t;\n              }\n              end += t;\n          }\n          return parseInt(end, 16);\n      }\n      /**\n       * 读 1 位\n       */\n      readByte() {\n          if (this.check()) {\n              return -1;\n          }\n          let val = this._pool[this._position++];\n          if (val > 255) {\n              val &= 255;\n          }\n          return val;\n      }\n      /**\n       * 获取数据\n       */\n      readUTF() {\n          if (this.check()) {\n              return '';\n          }\n          const big = (this.readByte() << 8) | this.readByte();\n          const pool = this._pool.subarray(this._position, this._position += big);\n          return BinaryHelper.readUTF(pool);\n      }\n      /**\n       * 读剩余的所有值\n       */\n      readAll() {\n          return this._pool.subarray(this._position, this._poolLen);\n      }\n  }\n  /**\n   * @description\n   * 融云写入二进制数据\n  */\n  class RongStreamWriter {\n      constructor() {\n          // 待处理的数据, 由 server 直接抛出的数据\n          this._pool = [];\n          // 当前流已截取到的位置\n          this._position = 0;\n          // 当前流写入的多少字节\n          this._writen = 0;\n      }\n      /**\n       * 写入缓存区, writen 值往后移\n       */\n      write(byte) {\n          // todo\n          if (Object.prototype.toString.call(byte).indexOf('Array') !== -1) {\n              this._pool = this._pool.concat(byte);\n          }\n          else if (byte >= 0) {\n              if (byte > 255) {\n                  byte &= 255;\n              }\n              this._pool.push(byte);\n              this._writen++;\n          }\n          return byte;\n      }\n      writeArr(byte) {\n          this._pool = this._pool.concat(byte);\n          return byte;\n      }\n      // PENDING. 用于 ConnectMessage, 暂未知此消息用途\n      // writeChat(v: number) {\n      //   if (+v != v) {\n      //     throw new Error(\"writeChar:arguments type is error\");\n      //   }\n      //   this.write(v >> 8 & 255);\n      //   this.write(v & 255);\n      //   this.writen += 2;\n      // }\n      writeUTF(str) {\n          const val = BinaryHelper.writeUTF(str);\n          this._pool = this._pool.concat(val);\n          this._writen += val.length;\n      }\n      // PENDING. 暂仅知道 write 时使用, 此时 this.poolLen 为 0, 调用无意义\n      // toComplements(): any {\n      //   var _tPool = this.pool;\n      //   for (var i = 0; i < this.poolLen; i++) {\n      //     if (_tPool[i] > 128) {\n      //       _tPool[i] -= 256;\n      //     }\n      //   }\n      //   return _tPool;\n      // }\n      getBytesArray() {\n          return this._pool;\n      }\n  }\n\n  var PBName = {\n      UpStreamMessage: 'UpStreamMessage',\n      DownStreamMessage: 'DownStreamMessage',\n      DownStreamMessages: 'DownStreamMessages',\n      SessionsAttQryInput: 'SessionsAttQryInput',\n      SessionsAttOutput: 'SessionsAttOutput',\n      SyncRequestMsg: 'SyncRequestMsg',\n      ChrmPullMsg: 'ChrmPullMsg',\n      NotifyMsg: 'NotifyMsg',\n      HistoryMsgInput: 'HistoryMsgInput',\n      HistoryMsgOuput: 'HistoryMsgOuput',\n      RelationQryInput: 'RelationQryInput',\n      RelationsOutput: 'RelationsOutput',\n      DeleteSessionsInput: 'DeleteSessionsInput',\n      SessionInfo: 'SessionInfo',\n      DeleteSessionsOutput: 'DeleteSessionsOutput',\n      RelationsInput: 'RelationsInput',\n      DeleteMsgInput: 'DeleteMsgInput',\n      CleanHisMsgInput: 'CleanHisMsgInput',\n      SessionMsgReadInput: 'SessionMsgReadInput',\n      ChrmInput: 'ChrmInput',\n      QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n      QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n      RtcInput: 'RtcInput',\n      RtcUserListOutput: 'RtcUserListOutput',\n      SetUserStatusInput: 'SetUserStatusInput',\n      RtcSetDataInput: 'RtcSetDataInput',\n      RtcUserSetDataInput: 'RtcUserSetDataInput',\n      RtcDataInput: 'RtcDataInput',\n      RtcSetOutDataInput: 'RtcSetOutDataInput',\n      MCFollowInput: 'MCFollowInput',\n      RtcTokenOutput: 'RtcTokenOutput',\n      RtcQryOutput: 'RtcQryOutput',\n      RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n      RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n      RtcQueryListInput: 'RtcQueryListInput',\n      RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n      RtcValueInfo: 'RtcValueInfo',\n      RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n      GetQNupTokenInput: 'GetQNupTokenInput',\n      GetQNupTokenOutput: 'GetQNupTokenOutput',\n      GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n      GetDownloadUrlInput: 'GetDownloadUrlInput',\n      GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput',\n      GetDownloadUrlOutput: 'GetDownloadUrlOutput',\n      SetChrmKV: 'SetChrmKV',\n      ChrmKVOutput: 'ChrmKVOutput',\n      QueryChrmKV: 'QueryChrmKV',\n      SetUserSettingInput: 'SetUserSettingInput',\n      SetUserSettingOutput: 'SetUserSettingOutput',\n      PullUserSettingInput: 'PullUserSettingInput',\n      PullUserSettingOutput: 'PullUserSettingOutput',\n      UserSettingNotification: 'UserSettingNotification',\n      SessionReq: 'SessionReq',\n      SessionStates: 'SessionStates',\n      SessionState: 'SessionState',\n      SessionStateItem: 'SessionStateItem',\n      SessionStateModifyReq: 'SessionStateModifyReq',\n      SessionStateModifyResp: 'SessionStateModifyResp' // 修改会话状态回执\n  };\n\n  const SSMsg = {\n      [PBName.UpStreamMessage]: ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData', 'extraContent'],\n      [PBName.DownStreamMessages]: ['list', 'syncTime', 'finished'],\n      [PBName.DownStreamMessage]: ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId', 'extraContent'],\n      [PBName.SessionsAttQryInput]: ['nothing'],\n      [PBName.SessionsAttOutput]: ['inboxTime', 'sendboxTime', 'totalUnreadCount'],\n      [PBName.SyncRequestMsg]: ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'],\n      [PBName.ChrmPullMsg]: ['syncTime', 'count'],\n      [PBName.NotifyMsg]: ['type', 'time', 'chrmId'],\n      [PBName.HistoryMsgInput]: ['targetId', 'time', 'count', 'order'],\n      [PBName.HistoryMsgOuput]: ['list', 'syncTime', 'hasMsg'],\n      [PBName.RelationQryInput]: ['type', 'count', 'startTime', 'order'],\n      [PBName.RelationsOutput]: ['info'],\n      [PBName.DeleteSessionsInput]: ['sessions'],\n      [PBName.SessionInfo]: ['type', 'channelId'],\n      [PBName.DeleteSessionsOutput]: ['nothing'],\n      [PBName.RelationsInput]: ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'],\n      [PBName.DeleteMsgInput]: ['type', 'conversationId', 'msgs'],\n      [PBName.CleanHisMsgInput]: ['targetId', 'dataTime', 'conversationType'],\n      [PBName.SessionMsgReadInput]: ['type', 'msgTime', 'channelId'],\n      [PBName.ChrmInput]: ['nothing'],\n      [PBName.QueryChatRoomInfoInput]: ['count', 'order'],\n      [PBName.QueryChatRoomInfoOutput]: ['userTotalNums', 'userInfos'],\n      [PBName.GetQNupTokenInput]: ['type', 'key'],\n      [PBName.GetQNdownloadUrlInput]: ['type', 'key', 'fileName'],\n      [PBName.GetDownloadUrlInput]: ['type', 'key', 'fileName'],\n      [PBName.GetQNupTokenOutput]: ['deadline', 'token', 'bosToken', 'bosDate', 'path', 'osskeyId', 'ossPolicy', 'ossSign', 'ossBucketName'],\n      [PBName.GetQNdownloadUrlOutput]: ['downloadUrl'],\n      [PBName.GetDownloadUrlOutput]: ['downloadUrl'],\n      [PBName.SetChrmKV]: ['entry', 'bNotify', 'notification', 'type'],\n      [PBName.ChrmKVOutput]: ['entries', 'bFullUpdate', 'syncTime'],\n      [PBName.QueryChrmKV]: ['timestamp'],\n      [PBName.SetUserSettingInput]: ['version', 'value'],\n      [PBName.SetUserSettingOutput]: ['version', 'reserve'],\n      [PBName.PullUserSettingInput]: ['version', 'reserve'],\n      [PBName.PullUserSettingOutput]: ['items', 'version'],\n      [PBName.SessionReq]: ['time'],\n      [PBName.SessionStates]: ['version', 'state'],\n      [PBName.SessionState]: ['type', 'channelId', 'time', 'stateItem'],\n      [PBName.SessionStateItem]: ['sessionStateType', 'value'],\n      [PBName.SessionStateModifyReq]: ['version', 'state'],\n      [PBName.SessionStateModifyResp]: ['version']\n  };\n\n  const Codec = {};\n  for (const key in SSMsg) {\n      const paramsList = SSMsg[key];\n      Codec[key] = () => {\n          const data = {};\n          const ins = {\n              getArrayData() {\n                  return data;\n              }\n          };\n          for (let i = 0; i < paramsList.length; i++) {\n              const param = paramsList[i];\n              const setEventName = `set${toUpperCase(param, 0, 1)}`;\n              ins[setEventName] = (item) => {\n                  data[param] = item;\n              };\n          }\n          return ins;\n      };\n      Codec[key].decode = function (data) {\n          const decodeResult = {};\n          if (isString(data)) {\n              data = JSON.parse(data);\n          }\n          for (const key in data) {\n              const getEventName = `get${toUpperCase(key, 0, 1)}`;\n              decodeResult[key] = data[key];\n              decodeResult[getEventName] = () => {\n                  return data[key];\n              };\n          }\n          return decodeResult;\n      };\n  }\n  Codec.getModule = (pbName) => {\n      return Codec[pbName]();\n  };\n\n  const SSMsg$1 = `\npackage Modules;\nmessage probuf {\nmessage ${PBName.SetUserStatusInput}\n{\n  optional int32 status=1;\n}\n\nmessage SetUserStatusOutput\n{\n  optional int32 nothing=1;\n}\n\nmessage GetUserStatusInput\n{\n  optional int32 nothing=1;\n}\n\nmessage GetUserStatusOutput\n{\n  optional string status=1;\n  optional string subUserId=2;\n}\n\nmessage SubUserStatusInput\n{\n  repeated string userid =1;\n}\n\nmessage SubUserStatusOutput\n{\n  optional int32 nothing=1; \n}\nmessage VoipDynamicInput\n{\n  required int32  engineType = 1;\n  required string channelName = 2;\n  optional string channelExtra = 3;\n}\n\nmessage VoipDynamicOutput\n{\n    required string dynamicKey=1;\n}\nmessage ${PBName.NotifyMsg} {\n  required int32 type = 1;\n  optional int64 time = 2;\n  optional string chrmId=3;\n}\nmessage ${PBName.SyncRequestMsg} {\n  required int64 syncTime = 1;\n  required bool ispolling = 2;\n  optional bool isweb=3;\n  optional bool isPullSend=4;\n  optional bool isKeeping=5;\n  optional int64 sendBoxSyncTime=6;\n}\nmessage ${PBName.UpStreamMessage} {\n  required int32 sessionId = 1;\n  required string classname = 2;\n  required bytes content = 3;\n  optional string pushText = 4;\n  optional string appData = 5;\n  repeated string userId = 6;\n  optional int64 delMsgTime = 7;\n  optional string delMsgId = 8;\n  optional int32 configFlag = 9;\n  optional int64 clientUniqueId = 10;\n  optional string extraContent = 11;\n}\nmessage ${PBName.DownStreamMessages} {\n  repeated DownStreamMessage list = 1;\n  required int64 syncTime = 2;\n  optional bool finished = 3;\n}\nmessage ${PBName.DownStreamMessage} {\n  required string fromUserId = 1;\n  required ChannelType type = 2;\n  optional string groupId = 3;\n  required string classname = 4;\n  required bytes content = 5;\n  required int64 dataTime = 6;\n  required int64 status = 7;\n  optional int64 extra = 8;\n  optional string msgId = 9;\n  optional int32 direction = 10;\n  optional int32 plantform =11;\n  optional int32 isRemoved = 12; \n  optional string source = 13; \n  optional int64 clientUniqueId = 14; \n  optional string extraContent = 15; \n\n}\nenum ChannelType {\n  PERSON = 1;\n  PERSONS = 2;\n  GROUP = 3;\n  TEMPGROUP = 4;\n  CUSTOMERSERVICE = 5;\n  NOTIFY = 6;\n  MC=7;\n  MP=8;\n}\nmessage CreateDiscussionInput {\n  optional string name = 1;\n}\nmessage CreateDiscussionOutput {\n  required string id = 1;\n}\nmessage ChannelInvitationInput {\n  repeated string users = 1;\n}\nmessage LeaveChannelInput {\n  required int32 nothing = 1;\n}\nmessage ChannelEvictionInput {\n  required string user = 1;\n}\nmessage RenameChannelInput {\n  required string name = 1;\n}\nmessage ChannelInfoInput {\n  required int32 nothing = 1;\n}\nmessage ChannelInfoOutput {\n  required ChannelType type = 1;\n  required string channelId = 2;\n  required string channelName = 3;\n  required string adminUserId = 4;\n  repeated string firstTenUserIds = 5;\n  required int32 openStatus = 6;\n}\nmessage ChannelInfosInput {\n  required int32 page = 1;\n  optional int32 number = 2;\n}\nmessage ChannelInfosOutput {\n  repeated ChannelInfoOutput channels = 1;\n  required int32 total = 2;\n}\nmessage MemberInfo {\n  required string userId = 1;\n  required string userName = 2;\n  required string userPortrait = 3;\n  required string extension = 4;\n}\nmessage GroupMembersInput {\n  required int32 page = 1;\n  optional int32 number = 2;\n}\nmessage GroupMembersOutput {\n  repeated MemberInfo members = 1;\n  required int32 total = 2;\n}\nmessage GetUserInfoInput {\n  required int32 nothing = 1;\n}\nmessage GetUserInfoOutput {\n  required string userId = 1;\n  required string userName = 2;\n  required string userPortrait = 3;\n}\nmessage GetSessionIdInput {\n  required int32 nothing = 1;\n}\nmessage GetSessionIdOutput {\n  required int32 sessionId = 1;\n}\nenum FileType {\n  image = ${FileType$1.IMAGE};\n  audio = ${FileType$1.AUDIO};\n  video = ${FileType$1.VIDEO};\n  file = ${FileType$1.FILE};\n}\nmessage ${PBName.GetQNupTokenInput} {\n  required FileType type = 1;\n  optional string key = 2;\n}\nmessage ${PBName.GetQNdownloadUrlInput} {\n  required FileType type = 1;\n  required string key = 2;\n  optional string  fileName = 3;\n}\nmessage ${PBName.GetDownloadUrlInput} {\n  required FileType type = 1;      // 下载的文件类型\n  required string key = 2;           // 请求下载的文件名\n  optional string fileName = 3;     // 下载生成的文件名字\n }\nmessage ${PBName.GetQNupTokenOutput} {\n  required int64 deadline = 1;\n  required string token = 2;\n  optional string bosToken = 3;\n  optional string bosDate = 4;\n  optional string path = 5;\n  optional string osskeyId = 6;\n  optional string ossPolicy = 7;\n  optional string ossSign = 8;\n  optional string ossBucketName = 9;\n}\nmessage ${PBName.GetQNdownloadUrlOutput} {\n  required string downloadUrl = 1;\n}\nmessage ${PBName.GetDownloadUrlOutput} {\n  required string downloadUrl = 1;\n}\nmessage Add2BlackListInput {\n  required string userId = 1;\n}\nmessage RemoveFromBlackListInput {\n  required string userId = 1;\n}\nmessage QueryBlackListInput {\n  required int32 nothing = 1;\n}\nmessage QueryBlackListOutput {\n  repeated string userIds = 1;\n}\nmessage BlackListStatusInput {\n  required string userId = 1;\n}\nmessage BlockPushInput {\n  required string blockeeId = 1;\n}\nmessage ModifyPermissionInput {\n  required int32 openStatus = 1;\n}\nmessage GroupInput {\n  repeated GroupInfo groupInfo = 1;\n}\nmessage GroupOutput {\n  required int32 nothing = 1;\n}\nmessage GroupInfo {\n  required string id = 1;\n  required string name = 2;\n}\nmessage GroupHashInput {\n  required string userId = 1;\n  required string groupHashCode = 2;\n}\nmessage GroupHashOutput {\n  required GroupHashType result = 1;\n}\nenum GroupHashType {\n  group_success = 0x00;\n  group_failure = 0x01;\n}\nmessage ${PBName.ChrmInput} {\n  required int32 nothing = 1;\n}\nmessage ChrmOutput {\n  required int32 nothing = 1;\n}\nmessage ${PBName.ChrmPullMsg} {\n  required int64 syncTime = 1;\n  required int32 count = 2;\n}\n\nmessage ChrmPullMsgNew \n{\n  required int32 count = 1;\n  required int64 syncTime = 2;\n  optional string chrmId=3;\n}\nmessage ${PBName.RelationQryInput}\n{\n  optional ChannelType type = 1;\n  optional int32 count = 2;\n  optional int64 startTime = 3;\n  optional int32 order = 4;\n}\nmessage ${PBName.RelationsInput}\n{\n  required ChannelType type = 1;\n  optional DownStreamMessage msg =2;\n  optional int32 count = 3;\n  optional int32 offset = 4;\n  optional int64 startTime = 5;\n  optional int64 endTime = 6;\n}\nmessage ${PBName.RelationsOutput}\n{\n  repeated RelationInfo info = 1;\n}\nmessage RelationInfo\n{\n  required ChannelType type = 1;\n  required string userId = 2;\n  optional DownStreamMessage msg =3;\n  optional int64 readMsgTime= 4;\n  optional int64 unreadCount= 5;\n}\nmessage RelationInfoReadTime\n{\n  required ChannelType type = 1;\n  required int64 readMsgTime= 2;\n  required string targetId = 3;\n}\nmessage ${PBName.CleanHisMsgInput}\n{\n    required string targetId = 1;\n    required int64 dataTime = 2;\n    optional int32 conversationType= 3;\n}\nmessage HistoryMessageInput\n{\n  required string targetId = 1;\n  required int64 dataTime =2;\n  required int32 size  = 3;\n}\n\nmessage HistoryMessagesOuput\n{\n  repeated DownStreamMessage list = 1;\n  required int64 syncTime = 2;\n  required int32 hasMsg = 3;\n}\nmessage ${PBName.QueryChatRoomInfoInput}\n{\n  required int32 count= 1;\n  optional int32 order= 2;\n}\n\nmessage ${PBName.QueryChatRoomInfoOutput}\n{\n  optional int32 userTotalNums = 1;\n  repeated ChrmMember userInfos = 2;\n}\nmessage ChrmMember\n{\n  required int64 time = 1;\n  required string id = 2;\n}\nmessage MPFollowInput\n{\n  required string id = 1;\n}\n\nmessage MPFollowOutput\n{\n  required int32 nothing = 1;\n  optional MpInfo info =2;\n}\n\nmessage ${PBName.MCFollowInput}\n{\n  required string id = 1;\n}\n\nmessage MCFollowOutput\n{\n  required int32 nothing = 1;\n  optional MpInfo info =2;\n}\n\nmessage MpInfo  \n{\n  required string mpid=1;\n  required string name = 2;\n  required string type = 3;\n  required int64 time=4;\n  optional string portraitUrl=5;\n  optional string extra =6;\n}\n\nmessage SearchMpInput\n{\n  required int32 type=1;\n  required string id=2;\n}\n\nmessage SearchMpOutput\n{\n  required int32 nothing=1;\n  repeated MpInfo info = 2;\n}\n\nmessage PullMpInput\n{\n  required int64 time=1;\n  required string mpid=2;\n}\n\nmessage PullMpOutput\n{\n  required int32 status=1;\n  repeated MpInfo info = 2;\n}\nmessage ${PBName.HistoryMsgInput}\n{\n  optional string targetId = 1;\n  optional int64 time = 2;\n  optional int32 count  = 3;\n  optional int32 order = 4;\n}\n\nmessage ${PBName.HistoryMsgOuput}\n{\n  repeated DownStreamMessage list=1;\n  required int64 syncTime=2;\n  required int32 hasMsg=3;\n}\nmessage ${PBName.RtcQueryListInput}{\n  optional int32 order=1;\n}\n\nmessage ${PBName.RtcKeyDeleteInput}{\n  repeated string key=1;\n}\n\nmessage ${PBName.RtcValueInfo}{\n  required string key=1;\n  required string value=2;\n}\n\nmessage RtcUserInfo{\n  required string userId=1;\n  repeated ${PBName.RtcValueInfo} userData=2;\n}\n\nmessage ${PBName.RtcUserListOutput}{\n  repeated RtcUserInfo list=1;\n  optional string token=2;\n  optional string sessionId=3;\n}\nmessage RtcRoomInfoOutput{\n  optional string roomId = 1;\n  repeated ${PBName.RtcValueInfo} roomData = 2;\n  optional int32 userCount = 3;\n  repeated RtcUserInfo list=4;\n}\nmessage ${PBName.RtcInput}{\n  required int32 roomType=1;\n  optional int32 broadcastType=2;\n}\nmessage RtcQryInput{ \n  required bool isInterior=1;\n  required targetType target=2;\n  repeated string key=3;\n}\nmessage ${PBName.RtcQryOutput}{\n  repeated ${PBName.RtcValueInfo} outInfo=1;\n}\nmessage RtcDelDataInput{\n  repeated string key=1;\n  required bool isInterior=2;\n  required targetType target=3;\n}\nmessage ${PBName.RtcDataInput}{ \n  required bool interior=1;\n  required targetType target=2;\n  repeated string key=3;\n  optional string objectName=4;\n  optional string content=5;\n}\nmessage ${PBName.RtcSetDataInput}{\n  required bool interior=1;\n  required targetType target=2;\n  required string key=3;\n  required string value=4;\n  optional string objectName=5;\n  optional string content=6;\n}\nmessage ${PBName.RtcUserSetDataInput} {\n  repeated ${PBName.RtcValueInfo} valueInfo = 1;\n  required string objectName = 2;\n  repeated ${PBName.RtcValueInfo} content = 3;\n}\nmessage RtcOutput\n{\n  optional int32 nothing=1; \n}\nmessage ${PBName.RtcTokenOutput}{\n  required string rtcToken=1;\n}\nenum targetType {\n  ROOM =1 ;\n  PERSON = 2;\n}\nmessage ${PBName.RtcSetOutDataInput}{\n  required targetType target=1;\n  repeated ${PBName.RtcValueInfo} valueInfo=2;\n  optional string objectName=3;\n  optional string content=4;\n}\nmessage ${PBName.RtcQryUserOutDataInput}{\n  repeated string userId = 1;\n}\nmessage ${PBName.RtcUserOutDataOutput}{\n  repeated RtcUserInfo user = 1;\n}\nmessage ${PBName.SessionsAttQryInput}{\n  required int32 nothing = 1;\n}\nmessage ${PBName.SessionsAttOutput}{\n  required int64 inboxTime = 1;\n  required int64 sendboxTime = 2;\n  required int64 totalUnreadCount = 3;\n}\nmessage ${PBName.SessionMsgReadInput}\n{\n  required ChannelType type = 1;\n  required int64 msgTime = 2;\n  required string channelId = 3;\n}\nmessage SessionMsgReadOutput\n{\n  optional int32 nothing=1; \n}\nmessage ${PBName.DeleteSessionsInput}\n{\n  repeated SessionInfo sessions = 1;\n}\nmessage ${PBName.SessionInfo}\n{\n  required ChannelType type = 1;\n  required string channelId = 2;\n}\nmessage ${PBName.DeleteSessionsOutput}\n{\n  optional int32 nothing=1; \n}\nmessage ${PBName.DeleteMsgInput}\n{\n  optional ChannelType type = 1;\n  optional string conversationId = 2;\n  repeated DeleteMsg msgs = 3;\n}\nmessage DeleteMsg\n{\n  optional string msgId = 1;\n  optional int64 msgDataTime = 2;\n  optional int32 direct = 3;\n}\nmessage ChrmKVEntity {\n  required string key = 1;\n  required string value = 2;\n  optional int32 status = 3;\n  optional int64 timestamp = 4;\n  optional string uid = 5;\n}\nmessage ${PBName.SetChrmKV} {\n  required ChrmKVEntity entry = 1;\n  optional bool bNotify = 2;\n  optional UpStreamMessage notification = 3;\n  optional ChannelType type = 4;\n}\nmessage ${PBName.ChrmKVOutput} {\n  repeated ChrmKVEntity entries = 1;\n  optional bool bFullUpdate = 2;\n  optional int64 syncTime = 3;\n}\nmessage ${PBName.QueryChrmKV} {\n  required int64 timestamp = 1;\n}\nmessage ${PBName.SetUserSettingInput} {\n  required int64 version=1;\n  required string value=2;\n}\nmessage ${PBName.SetUserSettingOutput} {\n  required int64 version=1;\n  required bool reserve=2;\n}\nmessage ${PBName.PullUserSettingInput} {\n  required int64 version=1;//当前客户端的最大版本号\n  optional bool reserve=2;\n}\nmessage ${PBName.PullUserSettingOutput} {\n  repeated UserSettingItem items = 1;\n  required int64 version=2;\n}\nmessage UserSettingItem {\n  required string targetId= 1;\n  required ChannelType type = 2;\n  required string key = 4;\n  required bytes value = 5;\n  required int64 version=6;\n  required int32 status=7;\n}\nmessage ${PBName.SessionReq} {\n  required int64 time = 1;\n}\nmessage ${PBName.SessionStates} {\n  required int64 version=1;\n  repeated SessionState state= 2;\n}\nmessage ${PBName.SessionState} {\n  required ChannelType type = 1;\n  required string channelId = 2;  \n  optional int64 time = 3;\n  repeated SessionStateItem stateItem = 4;\n}\nmessage ${PBName.SessionStateItem} {\n  required SessionStateType sessionStateType = 1;\n  required string value = 2;\n}\nenum SessionStateType {\n  IsSilent = 1;\n  IsTop = 2;\n}\nmessage ${PBName.SessionStateModifyReq} {\n  required int64 version=1;\n  repeated SessionState state= 2;\n}\nmessage ${PBName.SessionStateModifyResp} {\n  required int64 version=1;\n}\n}\n`;\n\n  function protobuf (a) {\n   var c = (function () { function a (a, b, c) { this.low = 0 | a, this.high = 0 | b, this.unsigned = !!c; } function b (a) { return (a && a.__isLong__) === !0 } function e (a, b) { var e, f, h; return b ? (a >>>= 0, (h = a >= 0 && a < 256) && (f = d[a]) ? f : (e = g(a, (0 | a) < 0 ? -1 : 0, !0), h && (d[a] = e), e)) : (a |= 0, (h = a >= -128 && a < 128) && (f = c[a]) ? f : (e = g(a, a < 0 ? -1 : 0, !1), h && (c[a] = e), e)) } function f (a, b) { if (isNaN(a) || !isFinite(a)) return b ? r : q; if (b) { if (a < 0) return r; if (a >= n) return w } else { if (-o >= a) return x; if (a + 1 >= o) return v } return a < 0 ? f(-a, b).neg() : g(0 | a % m, 0 | a / m, b) } function g (b, c, d) { return new a(b, c, d) } function i (a, b, c) { var d, e, g, j, k, l, m; if (a.length === 0) throw Error('empty string'); if (a === 'NaN' || a === 'Infinity' || a === '+Infinity' || a === '-Infinity') return q; if (typeof b === 'number' ? (c = b, b = !1) : b = !!b, c = c || 10, c < 2 || c > 36) throw RangeError('radix'); if ((d = a.indexOf('-')) > 0) throw Error('interior hyphen'); if (d === 0) return i(a.substring(1), b, c).neg(); for (e = f(h(c, 8)), g = q, j = 0; j < a.length; j += 8)k = Math.min(8, a.length - j), l = parseInt(a.substring(j, j + k), c), k < 8 ? (m = f(h(c, k)), g = g.mul(m).add(f(l))) : (g = g.mul(e), g = g.add(f(l))); return g.unsigned = b, g } function j (b) { return b instanceof a ? b : typeof b === 'number' ? f(b) : typeof b === 'string' ? i(b) : g(b.low, b.high, b.unsigned) } var c, d, h, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y; return a.prototype.__isLong__, Object.defineProperty(a.prototype, '__isLong__', { value: !0, enumerable: !1, configurable: !1 }), a.isLong = b, c = {}, d = {}, a.fromInt = e, a.fromNumber = f, a.fromBits = g, h = Math.pow, a.fromString = i, a.fromValue = j, k = 65536, l = 1 << 24, m = k * k, n = m * m, o = n / 2, p = e(l), q = e(0), a.ZERO = q, r = e(0, !0), a.UZERO = r, s = e(1), a.ONE = s, t = e(1, !0), a.UONE = t, u = e(-1), a.NEG_ONE = u, v = g(-1, 2147483647, !1), a.MAX_VALUE = v, w = g(-1, -1, !0), a.MAX_UNSIGNED_VALUE = w, x = g(0, -2147483648, !1), a.MIN_VALUE = x, y = a.prototype, y.toInt = function () { return this.unsigned ? this.low >>> 0 : this.low }, y.toNumber = function () { return this.unsigned ? (this.high >>> 0) * m + (this.low >>> 0) : this.high * m + (this.low >>> 0) }, y.toString = function (a) { var b, c, d, e, g, i, j, k, l; if (a = a || 10, a < 2 || a > 36) throw RangeError('radix'); if (this.isZero()) return '0'; if (this.isNegative()) return this.eq(x) ? (b = f(a), c = this.div(b), d = c.mul(b).sub(this), c.toString(a) + d.toInt().toString(a)) : '-' + this.neg().toString(a); for (e = f(h(a, 6), this.unsigned), g = this, i = ''; ;) { if (j = g.div(e), k = g.sub(j.mul(e)).toInt() >>> 0, l = k.toString(a), g = j, g.isZero()) return l + i; for (;l.length < 6;)l = '0' + l; i = '' + l + i; } }, y.getHighBits = function () { return this.high }, y.getHighBitsUnsigned = function () { return this.high >>> 0 }, y.getLowBits = function () { return this.low }, y.getLowBitsUnsigned = function () { return this.low >>> 0 }, y.getNumBitsAbs = function () { var a, b; if (this.isNegative()) return this.eq(x) ? 64 : this.neg().getNumBitsAbs(); for (a = this.high != 0 ? this.high : this.low, b = 31; b > 0 && (a & 1 << b) == 0; b--);return this.high != 0 ? b + 33 : b + 1 }, y.isZero = function () { return this.high === 0 && this.low === 0 }, y.isNegative = function () { return !this.unsigned && this.high < 0 }, y.isPositive = function () { return this.unsigned || this.high >= 0 }, y.isOdd = function () { return (1 & this.low) === 1 }, y.isEven = function () { return (1 & this.low) === 0 }, y.equals = function (a) { return b(a) || (a = j(a)), this.unsigned !== a.unsigned && this.high >>> 31 === 1 && a.high >>> 31 === 1 ? !1 : this.high === a.high && this.low === a.low }, y.eq = y.equals, y.notEquals = function (a) { return !this.eq(a) }, y.neq = y.notEquals, y.lessThan = function (a) { return this.comp(a) < 0 }, y.lt = y.lessThan, y.lessThanOrEqual = function (a) { return this.comp(a) <= 0 }, y.lte = y.lessThanOrEqual, y.greaterThan = function (a) { return this.comp(a) > 0 }, y.gt = y.greaterThan, y.greaterThanOrEqual = function (a) { return this.comp(a) >= 0 }, y.gte = y.greaterThanOrEqual, y.compare = function (a) { if (b(a) || (a = j(a)), this.eq(a)) return 0; var c = this.isNegative(); var d = a.isNegative(); return c && !d ? -1 : !c && d ? 1 : this.unsigned ? a.high >>> 0 > this.high >>> 0 || a.high === this.high && a.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(a).isNegative() ? -1 : 1 }, y.comp = y.compare, y.negate = function () { return !this.unsigned && this.eq(x) ? x : this.not().add(s) }, y.neg = y.negate, y.add = function (a) { var c, d, e, f, h, i, k, l, m, n, o, p; return b(a) || (a = j(a)), c = this.high >>> 16, d = 65535 & this.high, e = this.low >>> 16, f = 65535 & this.low, h = a.high >>> 16, i = 65535 & a.high, k = a.low >>> 16, l = 65535 & a.low, m = 0, n = 0, o = 0, p = 0, p += f + l, o += p >>> 16, p &= 65535, o += e + k, n += o >>> 16, o &= 65535, n += d + i, m += n >>> 16, n &= 65535, m += c + h, m &= 65535, g(o << 16 | p, m << 16 | n, this.unsigned) }, y.subtract = function (a) { return b(a) || (a = j(a)), this.add(a.neg()) }, y.sub = y.subtract, y.multiply = function (a) { var c, d, e, h, i, k, l, m, n, o, r, s; return this.isZero() ? q : (b(a) || (a = j(a)), a.isZero() ? q : this.eq(x) ? a.isOdd() ? x : q : a.eq(x) ? this.isOdd() ? x : q : this.isNegative() ? a.isNegative() ? this.neg().mul(a.neg()) : this.neg().mul(a).neg() : a.isNegative() ? this.mul(a.neg()).neg() : this.lt(p) && a.lt(p) ? f(this.toNumber() * a.toNumber(), this.unsigned) : (c = this.high >>> 16, d = 65535 & this.high, e = this.low >>> 16, h = 65535 & this.low, i = a.high >>> 16, k = 65535 & a.high, l = a.low >>> 16, m = 65535 & a.low, n = 0, o = 0, r = 0, s = 0, s += h * m, r += s >>> 16, s &= 65535, r += e * m, o += r >>> 16, r &= 65535, r += h * l, o += r >>> 16, r &= 65535, o += d * m, n += o >>> 16, o &= 65535, o += e * l, n += o >>> 16, o &= 65535, o += h * k, n += o >>> 16, o &= 65535, n += c * m + d * l + e * k + h * i, n &= 65535, g(r << 16 | s, n << 16 | o, this.unsigned))) }, y.mul = y.multiply, y.divide = function (a) { var c, d, e, g, i, k, l, m; if (b(a) || (a = j(a)), a.isZero()) throw Error('division by zero'); if (this.isZero()) return this.unsigned ? r : q; if (this.unsigned) { if (a.unsigned || (a = a.toUnsigned()), a.gt(this)) return r; if (a.gt(this.shru(1))) return t; e = r; } else { if (this.eq(x)) return a.eq(s) || a.eq(u) ? x : a.eq(x) ? s : (g = this.shr(1), c = g.div(a).shl(1), c.eq(q) ? a.isNegative() ? s : u : (d = this.sub(a.mul(c)), e = c.add(d.div(a)))); if (a.eq(x)) return this.unsigned ? r : q; if (this.isNegative()) return a.isNegative() ? this.neg().div(a.neg()) : this.neg().div(a).neg(); if (a.isNegative()) return this.div(a.neg()).neg(); e = q; } for (d = this; d.gte(a);) { for (c = Math.max(1, Math.floor(d.toNumber() / a.toNumber())), i = Math.ceil(Math.log(c) / Math.LN2), k = i <= 48 ? 1 : h(2, i - 48), l = f(c), m = l.mul(a); m.isNegative() || m.gt(d);)c -= k, l = f(c, this.unsigned), m = l.mul(a); l.isZero() && (l = s), e = e.add(l), d = d.sub(m); } return e }, y.div = y.divide, y.modulo = function (a) { return b(a) || (a = j(a)), this.sub(this.div(a).mul(a)) }, y.mod = y.modulo, y.not = function () { return g(~this.low, ~this.high, this.unsigned) }, y.and = function (a) { return b(a) || (a = j(a)), g(this.low & a.low, this.high & a.high, this.unsigned) }, y.or = function (a) { return b(a) || (a = j(a)), g(this.low | a.low, this.high | a.high, this.unsigned) }, y.xor = function (a) { return b(a) || (a = j(a)), g(this.low ^ a.low, this.high ^ a.high, this.unsigned) }, y.shiftLeft = function (a) { return b(a) && (a = a.toInt()), (a &= 63) === 0 ? this : a < 32 ? g(this.low << a, this.high << a | this.low >>> 32 - a, this.unsigned) : g(0, this.low << a - 32, this.unsigned) }, y.shl = y.shiftLeft, y.shiftRight = function (a) { return b(a) && (a = a.toInt()), (a &= 63) === 0 ? this : a < 32 ? g(this.low >>> a | this.high << 32 - a, this.high >> a, this.unsigned) : g(this.high >> a - 32, this.high >= 0 ? 0 : -1, this.unsigned) }, y.shr = y.shiftRight, y.shiftRightUnsigned = function (a) { var c, d; return b(a) && (a = a.toInt()), a &= 63, a === 0 ? this : (c = this.high, a < 32 ? (d = this.low, g(d >>> a | c << 32 - a, c >>> a, this.unsigned)) : a === 32 ? g(c, 0, this.unsigned) : g(c >>> a - 32, 0, this.unsigned)) }, y.shru = y.shiftRightUnsigned, y.toSigned = function () { return this.unsigned ? g(this.low, this.high, !1) : this }, y.toUnsigned = function () { return this.unsigned ? this : g(this.low, this.high, !0) }, y.toBytes = function (a) { return a ? this.toBytesLE() : this.toBytesBE() }, y.toBytesLE = function () { var a = this.high; var b = this.low; return [255 & b, 255 & b >>> 8, 255 & b >>> 16, 255 & b >>> 24, 255 & a, 255 & a >>> 8, 255 & a >>> 16, 255 & a >>> 24] }, y.toBytesBE = function () { var a = this.high; var b = this.low; return [255 & a >>> 24, 255 & a >>> 16, 255 & a >>> 8, 255 & a, 255 & b >>> 24, 255 & b >>> 16, 255 & b >>> 8, 255 & b] }, a }()); var d = (function (a) {\n      function f (a) { var b = 0; return function () { return b < a.length ? a.charCodeAt(b++) : null } } function g () { var a = []; var b = []; return function () { return arguments.length === 0 ? b.join('') + e.apply(String, a) : (a.length + arguments.length > 1024 && (b.push(e.apply(String, a)), a.length = 0), Array.prototype.push.apply(a, arguments), void 0) } } function h (a, b, c, d, e) { var f; var g; var h = 8 * e - d - 1; var i = (1 << h) - 1; var j = i >> 1; var k = -7; var l = c ? e - 1 : 0; var m = c ? -1 : 1; var n = a[b + l]; for (l += m, f = n & (1 << -k) - 1, n >>= -k, k += h; k > 0; f = 256 * f + a[b + l], l += m, k -= 8);for (g = f & (1 << -k) - 1, f >>= -k, k += d; k > 0; g = 256 * g + a[b + l], l += m, k -= 8);if (f === 0)f = 1 - j; else { if (f === i) return g ? 0 / 0 : 1 / 0 * (n ? -1 : 1); g += Math.pow(2, d), f -= j; } return (n ? -1 : 1) * g * Math.pow(2, f - d) } function i (a, b, c, d, e, f) { var g; var h; var i; var j = 8 * f - e - 1; var k = (1 << j) - 1; var l = k >> 1; var m = e === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; var n = d ? 0 : f - 1; var o = d ? 1 : -1; var p = b < 0 || b === 0 && 1 / b < 0 ? 1 : 0; for (b = Math.abs(b), isNaN(b) || 1 / 0 === b ? (h = isNaN(b) ? 1 : 0, g = k) : (g = Math.floor(Math.log(b) / Math.LN2), b * (i = Math.pow(2, -g)) < 1 && (g--, i *= 2), b += g + l >= 1 ? m / i : m * Math.pow(2, 1 - l), b * i >= 2 && (g++, i /= 2), g + l >= k ? (h = 0, g = k) : g + l >= 1 ? (h = (b * i - 1) * Math.pow(2, e), g += l) : (h = b * Math.pow(2, l - 1) * Math.pow(2, e), g = 0)); e >= 8; a[c + n] = 255 & h, n += o, h /= 256, e -= 8);for (g = g << e | h, j += e; j > 0; a[c + n] = 255 & g, n += o, g /= 256, j -= 8);a[c + n - o] |= 128 * p; } var c; var d; var e; var j; var k; var b = function (a, c, e) { if (typeof a === 'undefined' && (a = b.DEFAULT_CAPACITY), typeof c === 'undefined' && (c = b.DEFAULT_ENDIAN), typeof e === 'undefined' && (e = b.DEFAULT_NOASSERT), !e) { if (a = 0 | a, a < 0) throw RangeError('Illegal capacity'); c = !!c, e = !!e; } this.buffer = a === 0 ? d : new ArrayBuffer(a), this.view = a === 0 ? null : new Uint8Array(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = a, this.littleEndian = c, this.noAssert = e; }; return b.VERSION = '5.0.1', b.LITTLE_ENDIAN = !0, b.BIG_ENDIAN = !1, b.DEFAULT_CAPACITY = 16, b.DEFAULT_ENDIAN = b.BIG_ENDIAN, b.DEFAULT_NOASSERT = !1, b.Long = a || null, c = b.prototype, c.__isByteBuffer__, Object.defineProperty(c, '__isByteBuffer__', { value: !0, enumerable: !1, configurable: !1 }), d = new ArrayBuffer(0), e = String.fromCharCode, b.accessor = function () { return Uint8Array }, b.allocate = function (a, c, d) { return new b(a, c, d) }, b.concat = function (a, c, d, e) { var f, i, g, h, k, j; for ((typeof c === 'boolean' || typeof c !== 'string') && (e = d, d = c, c = void 0), f = 0, g = 0, h = a.length; h > g; ++g)b.isByteBuffer(a[g]) || (a[g] = b.wrap(a[g], c)), i = a[g].limit - a[g].offset, i > 0 && (f += i); if (f === 0) return new b(0, d, e); for (j = new b(f, d, e), g = 0; h > g;)k = a[g++], i = k.limit - k.offset, i <= 0 || (j.view.set(k.view.subarray(k.offset, k.limit), j.offset), j.offset += i); return j.limit = j.offset, j.offset = 0, j }, b.isByteBuffer = function (a) { return (a && a.__isByteBuffer__) === !0 }, b.type = function () { return ArrayBuffer }, b.wrap = function (a, d, e, f) { var g, h; if (typeof d !== 'string' && (f = e, e = d, d = void 0), typeof a === 'string') switch (typeof d === 'undefined' && (d = 'utf8'), d) { case 'base64':return b.fromBase64(a, e); case 'hex':return b.fromHex(a, e); case 'binary':return b.fromBinary(a, e); case 'utf8':return b.fromUTF8(a, e); case 'debug':return b.fromDebug(a, e); default:throw Error('Unsupported encoding: ' + d) } if (a === null || typeof a !== 'object') throw TypeError('Illegal buffer'); if (b.isByteBuffer(a)) return g = c.clone.call(a), g.markedOffset = -1, g; if (a instanceof Uint8Array)g = new b(0, e, f), a.length > 0 && (g.buffer = a.buffer, g.offset = a.byteOffset, g.limit = a.byteOffset + a.byteLength, g.view = new Uint8Array(a.buffer)); else if (a instanceof ArrayBuffer)g = new b(0, e, f), a.byteLength > 0 && (g.buffer = a, g.offset = 0, g.limit = a.byteLength, g.view = a.byteLength > 0 ? new Uint8Array(a) : null); else { if (Object.prototype.toString.call(a) !== '[object Array]') throw TypeError('Illegal buffer'); for (g = new b(a.length, e, f), g.limit = a.length, h = 0; h < a.length; ++h)g.view[h] = a[h]; } return g }, c.writeBitSet = function (a, b) { var h; var d; var e; var f; var g; var i; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (!(a instanceof Array)) throw TypeError('Illegal BitSet: Not an array'); if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } for (d = b, e = a.length, f = e >> 3, g = 0, b += this.writeVarint32(e, b); f--;)h = 1 & !!a[g++] | (1 & !!a[g++]) << 1 | (1 & !!a[g++]) << 2 | (1 & !!a[g++]) << 3 | (1 & !!a[g++]) << 4 | (1 & !!a[g++]) << 5 | (1 & !!a[g++]) << 6 | (1 & !!a[g++]) << 7, this.writeByte(h, b++); if (e > g) { for (i = 0, h = 0; e > g;)h |= (1 & !!a[g++]) << i++; this.writeByte(h, b++); } return c ? (this.offset = b, this) : b - d }, c.readBitSet = function (a) { var h; var c; var d; var e; var f; var g; var i; var b = typeof a === 'undefined'; for (b && (a = this.offset), c = this.readVarint32(a), d = c.value, e = d >> 3, f = 0, g = [], a += c.length; e--;)h = this.readByte(a++), g[f++] = !!(1 & h), g[f++] = !!(2 & h), g[f++] = !!(4 & h), g[f++] = !!(8 & h), g[f++] = !!(16 & h), g[f++] = !!(32 & h), g[f++] = !!(64 & h), g[f++] = !!(128 & h); if (d > f) for (i = 0, h = this.readByte(a++); d > f;)g[f++] = !!(1 & h >> i++); return b && (this.offset = a), g }, c.readBytes = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + a > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + a + ') <= ' + this.buffer.byteLength) } return d = this.slice(b, b + a), c && (this.offset += a), d }, c.writeBytes = c.append, c.writeInt8 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 1, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 1, this.view[b] = a, c && (this.offset += 1), this }, c.writeByte = c.writeInt8, c.readInt8 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength) } return c = this.view[a], (128 & c) === 128 && (c = -(255 - c + 1)), b && (this.offset += 1), c }, c.readByte = c.readInt8, c.writeUint8 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 1, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 1, this.view[b] = a, c && (this.offset += 1), this }, c.writeUInt8 = c.writeUint8, c.readUint8 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength) } return c = this.view[a], b && (this.offset += 1), c }, c.readUInt8 = c.readUint8, c.writeInt16 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 2, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 2, this.littleEndian ? (this.view[b + 1] = (65280 & a) >>> 8, this.view[b] = 255 & a) : (this.view[b] = (65280 & a) >>> 8, this.view[b + 1] = 255 & a), c && (this.offset += 2), this }, c.writeShort = c.writeInt16, c.readInt16 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 2 + ') <= ' + this.buffer.byteLength) } return c = 0, this.littleEndian ? (c = this.view[a], c |= this.view[a + 1] << 8) : (c = this.view[a] << 8, c |= this.view[a + 1]), (32768 & c) === 32768 && (c = -(65535 - c + 1)), b && (this.offset += 2), c }, c.readShort = c.readInt16, c.writeUint16 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 2, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 2, this.littleEndian ? (this.view[b + 1] = (65280 & a) >>> 8, this.view[b] = 255 & a) : (this.view[b] = (65280 & a) >>> 8, this.view[b + 1] = 255 & a), c && (this.offset += 2), this }, c.writeUInt16 = c.writeUint16, c.readUint16 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 2 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 2 + ') <= ' + this.buffer.byteLength) } return c = 0, this.littleEndian ? (c = this.view[a], c |= this.view[a + 1] << 8) : (c = this.view[a] << 8, c |= this.view[a + 1]), b && (this.offset += 2), c }, c.readUInt16 = c.readUint16, c.writeInt32 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 4, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 4, this.littleEndian ? (this.view[b + 3] = 255 & a >>> 24, this.view[b + 2] = 255 & a >>> 16, this.view[b + 1] = 255 & a >>> 8, this.view[b] = 255 & a) : (this.view[b] = 255 & a >>> 24, this.view[b + 1] = 255 & a >>> 16, this.view[b + 2] = 255 & a >>> 8, this.view[b + 3] = 255 & a), c && (this.offset += 4), this }, c.writeInt = c.writeInt32, c.readInt32 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength) } return c = 0, this.littleEndian ? (c = this.view[a + 2] << 16, c |= this.view[a + 1] << 8, c |= this.view[a], c += this.view[a + 3] << 24 >>> 0) : (c = this.view[a + 1] << 16, c |= this.view[a + 2] << 8, c |= this.view[a + 3], c += this.view[a] << 24 >>> 0), c |= 0, b && (this.offset += 4), c }, c.readInt = c.readInt32, c.writeUint32 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 4, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 4, this.littleEndian ? (this.view[b + 3] = 255 & a >>> 24, this.view[b + 2] = 255 & a >>> 16, this.view[b + 1] = 255 & a >>> 8, this.view[b] = 255 & a) : (this.view[b] = 255 & a >>> 24, this.view[b + 1] = 255 & a >>> 16, this.view[b + 2] = 255 & a >>> 8, this.view[b + 3] = 255 & a), c && (this.offset += 4), this }, c.writeUInt32 = c.writeUint32, c.readUint32 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength) } return c = 0, this.littleEndian ? (c = this.view[a + 2] << 16, c |= this.view[a + 1] << 8, c |= this.view[a], c += this.view[a + 3] << 24 >>> 0) : (c = this.view[a + 1] << 16, c |= this.view[a + 2] << 8, c |= this.view[a + 3], c += this.view[a] << 24 >>> 0), b && (this.offset += 4), c }, c.readUInt32 = c.readUint32, a && (c.writeInt64 = function (b, c) { var e; var f; var g; var d = typeof c === 'undefined'; if (d && (c = this.offset), !this.noAssert) { if (typeof b === 'number')b = a.fromNumber(b); else if (typeof b === 'string')b = a.fromString(b); else if (!(b && b instanceof a)) throw TypeError('Illegal value: ' + b + ' (not an integer or Long)'); if (typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)'); if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return typeof b === 'number' ? b = a.fromNumber(b) : typeof b === 'string' && (b = a.fromString(b)), c += 8, e = this.buffer.byteLength, c > e && this.resize((e *= 2) > c ? e : c), c -= 8, f = b.low, g = b.high, this.littleEndian ? (this.view[c + 3] = 255 & f >>> 24, this.view[c + 2] = 255 & f >>> 16, this.view[c + 1] = 255 & f >>> 8, this.view[c] = 255 & f, c += 4, this.view[c + 3] = 255 & g >>> 24, this.view[c + 2] = 255 & g >>> 16, this.view[c + 1] = 255 & g >>> 8, this.view[c] = 255 & g) : (this.view[c] = 255 & g >>> 24, this.view[c + 1] = 255 & g >>> 16, this.view[c + 2] = 255 & g >>> 8, this.view[c + 3] = 255 & g, c += 4, this.view[c] = 255 & f >>> 24, this.view[c + 1] = 255 & f >>> 16, this.view[c + 2] = 255 & f >>> 8, this.view[c + 3] = 255 & f), d && (this.offset += 8), this }, c.writeLong = c.writeInt64, c.readInt64 = function (b) { var d; var e; var f; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 8 + ') <= ' + this.buffer.byteLength) } return d = 0, e = 0, this.littleEndian ? (d = this.view[b + 2] << 16, d |= this.view[b + 1] << 8, d |= this.view[b], d += this.view[b + 3] << 24 >>> 0, b += 4, e = this.view[b + 2] << 16, e |= this.view[b + 1] << 8, e |= this.view[b], e += this.view[b + 3] << 24 >>> 0) : (e = this.view[b + 1] << 16, e |= this.view[b + 2] << 8, e |= this.view[b + 3], e += this.view[b] << 24 >>> 0, b += 4, d = this.view[b + 1] << 16, d |= this.view[b + 2] << 8, d |= this.view[b + 3], d += this.view[b] << 24 >>> 0), f = new a(d, e, !1), c && (this.offset += 8), f }, c.readLong = c.readInt64, c.writeUint64 = function (b, c) { var e; var f; var g; var d = typeof c === 'undefined'; if (d && (c = this.offset), !this.noAssert) { if (typeof b === 'number')b = a.fromNumber(b); else if (typeof b === 'string')b = a.fromString(b); else if (!(b && b instanceof a)) throw TypeError('Illegal value: ' + b + ' (not an integer or Long)'); if (typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)'); if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return typeof b === 'number' ? b = a.fromNumber(b) : typeof b === 'string' && (b = a.fromString(b)), c += 8, e = this.buffer.byteLength, c > e && this.resize((e *= 2) > c ? e : c), c -= 8, f = b.low, g = b.high, this.littleEndian ? (this.view[c + 3] = 255 & f >>> 24, this.view[c + 2] = 255 & f >>> 16, this.view[c + 1] = 255 & f >>> 8, this.view[c] = 255 & f, c += 4, this.view[c + 3] = 255 & g >>> 24, this.view[c + 2] = 255 & g >>> 16, this.view[c + 1] = 255 & g >>> 8, this.view[c] = 255 & g) : (this.view[c] = 255 & g >>> 24, this.view[c + 1] = 255 & g >>> 16, this.view[c + 2] = 255 & g >>> 8, this.view[c + 3] = 255 & g, c += 4, this.view[c] = 255 & f >>> 24, this.view[c + 1] = 255 & f >>> 16, this.view[c + 2] = 255 & f >>> 8, this.view[c + 3] = 255 & f), d && (this.offset += 8), this }, c.writeUInt64 = c.writeUint64, c.readUint64 = function (b) { var d; var e; var f; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 8 + ') <= ' + this.buffer.byteLength) } return d = 0, e = 0, this.littleEndian ? (d = this.view[b + 2] << 16, d |= this.view[b + 1] << 8, d |= this.view[b], d += this.view[b + 3] << 24 >>> 0, b += 4, e = this.view[b + 2] << 16, e |= this.view[b + 1] << 8, e |= this.view[b], e += this.view[b + 3] << 24 >>> 0) : (e = this.view[b + 1] << 16, e |= this.view[b + 2] << 8, e |= this.view[b + 3], e += this.view[b] << 24 >>> 0, b += 4, d = this.view[b + 1] << 16, d |= this.view[b + 2] << 8, d |= this.view[b + 3], d += this.view[b] << 24 >>> 0), f = new a(d, e, !0), c && (this.offset += 8), f }, c.readUInt64 = c.readUint64), c.writeFloat32 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number') throw TypeError('Illegal value: ' + a + ' (not a number)'); if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 4, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 4, i(this.view, a, b, this.littleEndian, 23, 4), c && (this.offset += 4), this }, c.writeFloat = c.writeFloat32, c.readFloat32 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength) } return c = h(this.view, a, this.littleEndian, 23, 4), b && (this.offset += 4), c }, c.readFloat = c.readFloat32, c.writeFloat64 = function (a, b) { var d; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'number') throw TypeError('Illegal value: ' + a + ' (not a number)'); if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return b += 8, d = this.buffer.byteLength, b > d && this.resize((d *= 2) > b ? d : b), b -= 8, i(this.view, a, b, this.littleEndian, 52, 8), c && (this.offset += 8), this }, c.writeDouble = c.writeFloat64, c.readFloat64 = function (a) { var c; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 8 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 8 + ') <= ' + this.buffer.byteLength) } return c = h(this.view, a, this.littleEndian, 52, 8), b && (this.offset += 8), c }, c.readDouble = c.readFloat64, b.MAX_VARINT32_BYTES = 5, b.calculateVarint32 = function (a) { return a >>>= 0, a < 128 ? 1 : a < 16384 ? 2 : 1 << 21 > a ? 3 : 1 << 28 > a ? 4 : 5 }, b.zigZagEncode32 = function (a) { return ((a |= 0) << 1 ^ a >> 31) >>> 0 }, b.zigZagDecode32 = function (a) { return 0 | a >>> 1 ^ -(1 & a) }, c.writeVarint32 = function (a, c) { var f; var e; var g; var d = typeof c === 'undefined'; if (d && (c = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a |= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)'); if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } for (e = b.calculateVarint32(a), c += e, g = this.buffer.byteLength, c > g && this.resize((g *= 2) > c ? g : c), c -= e, a >>>= 0; a >= 128;)f = 128 | 127 & a, this.view[c++] = f, a >>>= 7; return this.view[c++] = a, d ? (this.offset = c, this) : e }, c.writeVarint32ZigZag = function (a, c) { return this.writeVarint32(b.zigZagEncode32(a), c) }, c.readVarint32 = function (a) { var e; var c; var d; var f; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength) }c = 0, d = 0; do { if (!this.noAssert && a > this.limit) throw f = Error('Truncated'), f.truncated = !0, f; e = this.view[a++], c < 5 && (d |= (127 & e) << 7 * c), ++c; } while ((128 & e) !== 0); return d |= 0, b ? (this.offset = a, d) : { value: d, length: c } }, c.readVarint32ZigZag = function (a) { var c = this.readVarint32(a); return typeof c === 'object' ? c.value = b.zigZagDecode32(c.value) : c = b.zigZagDecode32(c), c }, a && (b.MAX_VARINT64_BYTES = 10, b.calculateVarint64 = function (b) { typeof b === 'number' ? b = a.fromNumber(b) : typeof b === 'string' && (b = a.fromString(b)); var c = b.toInt() >>> 0; var d = b.shiftRightUnsigned(28).toInt() >>> 0; var e = b.shiftRightUnsigned(56).toInt() >>> 0; return e == 0 ? d == 0 ? c < 16384 ? c < 128 ? 1 : 2 : 1 << 21 > c ? 3 : 4 : d < 16384 ? d < 128 ? 5 : 6 : 1 << 21 > d ? 7 : 8 : e < 128 ? 9 : 10 }, b.zigZagEncode64 = function (b) { return typeof b === 'number' ? b = a.fromNumber(b, !1) : typeof b === 'string' ? b = a.fromString(b, !1) : b.unsigned !== !1 && (b = b.toSigned()), b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned() }, b.zigZagDecode64 = function (b) { return typeof b === 'number' ? b = a.fromNumber(b, !1) : typeof b === 'string' ? b = a.fromString(b, !1) : b.unsigned !== !1 && (b = b.toSigned()), b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned() }, c.writeVarint64 = function (c, d) { var f; var g; var h; var i; var j; var e = typeof d === 'undefined'; if (e && (d = this.offset), !this.noAssert) { if (typeof c === 'number')c = a.fromNumber(c); else if (typeof c === 'string')c = a.fromString(c); else if (!(c && c instanceof a)) throw TypeError('Illegal value: ' + c + ' (not an integer or Long)'); if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)'); if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } switch (typeof c === 'number' ? c = a.fromNumber(c, !1) : typeof c === 'string' ? c = a.fromString(c, !1) : c.unsigned !== !1 && (c = c.toSigned()), f = b.calculateVarint64(c), g = c.toInt() >>> 0, h = c.shiftRightUnsigned(28).toInt() >>> 0, i = c.shiftRightUnsigned(56).toInt() >>> 0, d += f, j = this.buffer.byteLength, d > j && this.resize((j *= 2) > d ? j : d), d -= f, f) { case 10:this.view[d + 9] = 1 & i >>> 7; case 9:this.view[d + 8] = f !== 9 ? 128 | i : 127 & i; case 8:this.view[d + 7] = f !== 8 ? 128 | h >>> 21 : 127 & h >>> 21; case 7:this.view[d + 6] = f !== 7 ? 128 | h >>> 14 : 127 & h >>> 14; case 6:this.view[d + 5] = f !== 6 ? 128 | h >>> 7 : 127 & h >>> 7; case 5:this.view[d + 4] = f !== 5 ? 128 | h : 127 & h; case 4:this.view[d + 3] = f !== 4 ? 128 | g >>> 21 : 127 & g >>> 21; case 3:this.view[d + 2] = f !== 3 ? 128 | g >>> 14 : 127 & g >>> 14; case 2:this.view[d + 1] = f !== 2 ? 128 | g >>> 7 : 127 & g >>> 7; case 1:this.view[d] = f !== 1 ? 128 | g : 127 & g; } return e ? (this.offset += f, this) : f }, c.writeVarint64ZigZag = function (a, c) { return this.writeVarint64(b.zigZagEncode64(a), c) }, c.readVarint64 = function (b) { var d; var e; var f; var g; var h; var i; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 1 + ') <= ' + this.buffer.byteLength) } if (d = b, e = 0, f = 0, g = 0, h = 0, h = this.view[b++], e = 127 & h, 128 & h && (h = this.view[b++], e |= (127 & h) << 7, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], e |= (127 & h) << 14, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], e |= (127 & h) << 21, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f = 127 & h, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f |= (127 & h) << 7, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f |= (127 & h) << 14, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], f |= (127 & h) << 21, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], g = 127 & h, (128 & h || this.noAssert && typeof h === 'undefined') && (h = this.view[b++], g |= (127 & h) << 7, 128 & h || this.noAssert && typeof h === 'undefined')))))))))) throw Error('Buffer overrun'); return i = a.fromBits(e | f << 28, f >>> 4 | g << 24, !1), c ? (this.offset = b, i) : { value: i, length: b - d } }, c.readVarint64ZigZag = function (c) { var d = this.readVarint64(c); return d && d.value instanceof a ? d.value = b.zigZagDecode64(d.value) : d = b.zigZagDecode64(d), d }), c.writeCString = function (a, b) { var d; var e; var g; var c = typeof b === 'undefined'; if (c && (b = this.offset), e = a.length, !this.noAssert) { if (typeof a !== 'string') throw TypeError('Illegal str: Not a string'); for (d = 0; e > d; ++d) if (a.charCodeAt(d) === 0) throw RangeError('Illegal str: Contains NULL-characters'); if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return e = k.calculateUTF16asUTF8(f(a))[1], b += e + 1, g = this.buffer.byteLength, b > g && this.resize((g *= 2) > b ? g : b), b -= e + 1, k.encodeUTF16toUTF8(f(a), function (a) { this.view[b++] = a; }.bind(this)), this.view[b++] = 0, c ? (this.offset = b, this) : e }, c.readCString = function (a) { var c; var e; var f; var b = typeof a === 'undefined'; if (b && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength) } return c = a, f = -1, k.decodeUTF8toUTF16(function () { if (f === 0) return null; if (a >= this.limit) throw RangeError('Illegal range: Truncated data, ' + a + ' < ' + this.limit); return f = this.view[a++], f === 0 ? null : f }.bind(this), e = g(), !0), b ? (this.offset = a, e()) : { string: e(), length: a - c } }, c.writeIString = function (a, b) { var e; var d; var g; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof a !== 'string') throw TypeError('Illegal str: Not a string'); if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } if (d = b, e = k.calculateUTF16asUTF8(f(a), this.noAssert)[1], b += 4 + e, g = this.buffer.byteLength, b > g && this.resize((g *= 2) > b ? g : b), b -= 4 + e, this.littleEndian ? (this.view[b + 3] = 255 & e >>> 24, this.view[b + 2] = 255 & e >>> 16, this.view[b + 1] = 255 & e >>> 8, this.view[b] = 255 & e) : (this.view[b] = 255 & e >>> 24, this.view[b + 1] = 255 & e >>> 16, this.view[b + 2] = 255 & e >>> 8, this.view[b + 3] = 255 & e), b += 4, k.encodeUTF16toUTF8(f(a), function (a) { this.view[b++] = a; }.bind(this)), b !== d + 4 + e) throw RangeError('Illegal range: Truncated data, ' + b + ' == ' + (b + 4 + e)); return c ? (this.offset = b, this) : b - d }, c.readIString = function (a) {\n        var d; var e; var f; var c = typeof a === 'undefined';\n        if (c && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 4 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 4 + ') <= ' + this.buffer.byteLength) } return d = a, e = this.readUint32(a), f = this.readUTF8String(e, b.METRICS_BYTES, a += 4), a += f.length, c ? (this.offset = a, f.string) : { string: f.string, length: a - d }\n      }, b.METRICS_CHARS = 'c', b.METRICS_BYTES = 'b', c.writeUTF8String = function (a, b) { var d; var e; var g; var c = typeof b === 'undefined'; if (c && (b = this.offset), !this.noAssert) { if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: ' + b + ' (not an integer)'); if (b >>>= 0, b < 0 || b + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + b + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return e = b, d = k.calculateUTF16asUTF8(f(a))[1], b += d, g = this.buffer.byteLength, b > g && this.resize((g *= 2) > b ? g : b), b -= d, k.encodeUTF16toUTF8(f(a), function (a) { this.view[b++] = a; }.bind(this)), c ? (this.offset = b, this) : b - e }, c.writeString = c.writeUTF8String, b.calculateUTF8Chars = function (a) { return k.calculateUTF16asUTF8(f(a))[0] }, b.calculateUTF8Bytes = function (a) { return k.calculateUTF16asUTF8(f(a))[1] }, b.calculateString = b.calculateUTF8Bytes, c.readUTF8String = function (a, c, d) { var e, i, f, h, j; if (typeof c === 'number' && (d = c, c = void 0), e = typeof d === 'undefined', e && (d = this.offset), typeof c === 'undefined' && (c = b.METRICS_CHARS), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal length: ' + a + ' (not an integer)'); if (a |= 0, typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)'); if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } if (f = 0, h = d, c === b.METRICS_CHARS) { if (i = g(), k.decodeUTF8(function () { return a > f && d < this.limit ? this.view[d++] : null }.bind(this), function (a) { ++f, k.UTF8toUTF16(a, i); }), f !== a) throw RangeError('Illegal range: Truncated data, ' + f + ' == ' + a); return e ? (this.offset = d, i()) : { string: i(), length: d - h } } if (c === b.METRICS_BYTES) { if (!this.noAssert) { if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)'); if (d >>>= 0, d < 0 || d + a > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + a + ') <= ' + this.buffer.byteLength) } if (j = d + a, k.decodeUTF8toUTF16(function () { return j > d ? this.view[d++] : null }.bind(this), i = g(), this.noAssert), d !== j) throw RangeError('Illegal range: Truncated data, ' + d + ' == ' + j); return e ? (this.offset = d, i()) : { string: i(), length: d - h } } throw TypeError('Unsupported metrics: ' + c) }, c.readString = c.readUTF8String, c.writeVString = function (a, c) { var g; var h; var e; var i; var d = typeof c === 'undefined'; if (d && (c = this.offset), !this.noAssert) { if (typeof a !== 'string') throw TypeError('Illegal str: Not a string'); if (typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal offset: ' + c + ' (not an integer)'); if (c >>>= 0, c < 0 || c + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + c + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } if (e = c, g = k.calculateUTF16asUTF8(f(a), this.noAssert)[1], h = b.calculateVarint32(g), c += h + g, i = this.buffer.byteLength, c > i && this.resize((i *= 2) > c ? i : c), c -= h + g, c += this.writeVarint32(g, c), k.encodeUTF16toUTF8(f(a), function (a) { this.view[c++] = a; }.bind(this)), c !== e + g + h) throw RangeError('Illegal range: Truncated data, ' + c + ' == ' + (c + g + h)); return d ? (this.offset = c, this) : c - e }, c.readVString = function (a) { var d; var e; var f; var c = typeof a === 'undefined'; if (c && (a = this.offset), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 1 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 1 + ') <= ' + this.buffer.byteLength) } return d = a, e = this.readVarint32(a), f = this.readUTF8String(e.value, b.METRICS_BYTES, a += e.length), a += f.length, c ? (this.offset = a, f.string) : { string: f.string, length: a - d } }, c.append = function (a, c, d) { var e, f, g; if ((typeof c === 'number' || typeof c !== 'string') && (d = c, c = void 0), e = typeof d === 'undefined', e && (d = this.offset), !this.noAssert) { if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)'); if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return a instanceof b || (a = b.wrap(a, c)), f = a.limit - a.offset, f <= 0 ? this : (d += f, g = this.buffer.byteLength, d > g && this.resize((g *= 2) > d ? g : d), d -= f, this.view.set(a.view.subarray(a.offset, a.limit), d), a.offset += f, e && (this.offset += f), this) }, c.appendTo = function (a, b) { return a.append(this, b), this }, c.assert = function (a) { return this.noAssert = !a, this }, c.capacity = function () { return this.buffer.byteLength }, c.clear = function () { return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this }, c.clone = function (a) { var c = new b(0, this.littleEndian, this.noAssert); return a ? (c.buffer = new ArrayBuffer(this.buffer.byteLength), c.view = new Uint8Array(c.buffer)) : (c.buffer = this.buffer, c.view = this.view), c.offset = this.offset, c.markedOffset = this.markedOffset, c.limit = this.limit, c }, c.compact = function (a, b) { var c, e, f; if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength) } return a === 0 && b === this.buffer.byteLength ? this : (c = b - a, c === 0 ? (this.buffer = d, this.view = null, this.markedOffset >= 0 && (this.markedOffset -= a), this.offset = 0, this.limit = 0, this) : (e = new ArrayBuffer(c), f = new Uint8Array(e), f.set(this.view.subarray(a, b)), this.buffer = e, this.view = f, this.markedOffset >= 0 && (this.markedOffset -= a), this.offset = 0, this.limit = c, this)) }, c.copy = function (a, c) { if (typeof a === 'undefined' && (a = this.offset), typeof c === 'undefined' && (c = this.limit), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (a >>>= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (c >>>= 0, a < 0 || a > c || c > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + c + ' <= ' + this.buffer.byteLength) } if (a === c) return new b(0, this.littleEndian, this.noAssert); var d = c - a; var e = new b(d, this.littleEndian, this.noAssert); return e.offset = 0, e.limit = d, e.markedOffset >= 0 && (e.markedOffset -= a), this.copyTo(e, 0, a, c), e }, c.copyTo = function (a, c, d, e) { var f, g, h; if (!this.noAssert && !b.isByteBuffer(a)) throw TypeError('Illegal target: Not a ByteBuffer'); if (c = (g = typeof c === 'undefined') ? a.offset : 0 | c, d = (f = typeof d === 'undefined') ? this.offset : 0 | d, e = typeof e === 'undefined' ? this.limit : 0 | e, c < 0 || c > a.buffer.byteLength) throw RangeError('Illegal target range: 0 <= ' + c + ' <= ' + a.buffer.byteLength); if (d < 0 || e > this.buffer.byteLength) throw RangeError('Illegal source range: 0 <= ' + d + ' <= ' + this.buffer.byteLength); return h = e - d, h === 0 ? a : (a.ensureCapacity(c + h), a.view.set(this.view.subarray(d, e), c), f && (this.offset += h), g && (a.offset += h), this) }, c.ensureCapacity = function (a) { var b = this.buffer.byteLength; return a > b ? this.resize((b *= 2) > a ? b : a) : this }, c.fill = function (a, b, c) { var d = typeof b === 'undefined'; if (d && (b = this.offset), typeof a === 'string' && a.length > 0 && (a = a.charCodeAt(0)), typeof b === 'undefined' && (b = this.offset), typeof c === 'undefined' && (c = this.limit), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal value: ' + a + ' (not an integer)'); if (a |= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (b >>>= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (c >>>= 0, b < 0 || b > c || c > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + b + ' <= ' + c + ' <= ' + this.buffer.byteLength) } if (b >= c) return this; for (;c > b;) this.view[b++] = a; return d && (this.offset = b), this }, c.flip = function () { return this.limit = this.offset, this.offset = 0, this }, c.mark = function (a) { if (a = typeof a === 'undefined' ? this.offset : a, !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal offset: ' + a + ' (not an integer)'); if (a >>>= 0, a < 0 || a + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + a + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return this.markedOffset = a, this }, c.order = function (a) { if (!this.noAssert && typeof a !== 'boolean') throw TypeError('Illegal littleEndian: Not a boolean'); return this.littleEndian = !!a, this }, c.LE = function (a) { return this.littleEndian = typeof a !== 'undefined' ? !!a : !0, this }, c.BE = function (a) { return this.littleEndian = typeof a !== 'undefined' ? !a : !1, this }, c.prepend = function (a, c, d) { var e, f, g, h, i; if ((typeof c === 'number' || typeof c !== 'string') && (d = c, c = void 0), e = typeof d === 'undefined', e && (d = this.offset), !this.noAssert) { if (typeof d !== 'number' || d % 1 !== 0) throw TypeError('Illegal offset: ' + d + ' (not an integer)'); if (d >>>= 0, d < 0 || d + 0 > this.buffer.byteLength) throw RangeError('Illegal offset: 0 <= ' + d + ' (+' + 0 + ') <= ' + this.buffer.byteLength) } return a instanceof b || (a = b.wrap(a, c)), f = a.limit - a.offset, f <= 0 ? this : (g = f - d, g > 0 ? (h = new ArrayBuffer(this.buffer.byteLength + g), i = new Uint8Array(h), i.set(this.view.subarray(d, this.buffer.byteLength), f), this.buffer = h, this.view = i, this.offset += g, this.markedOffset >= 0 && (this.markedOffset += g), this.limit += g, d += g) : new Uint8Array(this.buffer), this.view.set(a.view.subarray(a.offset, a.limit), d - f), a.offset = a.limit, e && (this.offset -= f), this) }, c.prependTo = function (a, b) { return a.prepend(this, b), this }, c.printDebug = function (a) { typeof a !== 'function' && (a = console.log.bind(console)), a(this.toString() + '\\n-------------------------------------------------------------------\\n' + this.toDebug(!0)); }, c.remaining = function () { return this.limit - this.offset }, c.reset = function () { return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this }, c.resize = function (a) { var b, c; if (!this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal capacity: ' + a + ' (not an integer)'); if (a |= 0, a < 0) throw RangeError('Illegal capacity: 0 <= ' + a) } return this.buffer.byteLength < a && (b = new ArrayBuffer(a), c = new Uint8Array(b), c.set(this.view), this.buffer = b, this.view = c), this }, c.reverse = function (a, b) { if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength) } return a === b ? this : (Array.prototype.reverse.call(this.view.subarray(a, b)), this) }, c.skip = function (a) { if (!this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal length: ' + a + ' (not an integer)'); a |= 0; } var b = this.offset + a; if (!this.noAssert && (b < 0 || b > this.buffer.byteLength)) throw RangeError('Illegal length: 0 <= ' + this.offset + ' + ' + a + ' <= ' + this.buffer.byteLength); return this.offset = b, this }, c.slice = function (a, b) { if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength) } var c = this.clone(); return c.offset = a, c.limit = b, c }, c.toBuffer = function (a) { var e; var b = this.offset; var c = this.limit; if (!this.noAssert) { if (typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal offset: Not an integer'); if (b >>>= 0, typeof c !== 'number' || c % 1 !== 0) throw TypeError('Illegal limit: Not an integer'); if (c >>>= 0, b < 0 || b > c || c > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + b + ' <= ' + c + ' <= ' + this.buffer.byteLength) } return a || b !== 0 || c !== this.buffer.byteLength ? b === c ? d : (e = new ArrayBuffer(c - b), new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b, c), 0), e) : this.buffer }, c.toArrayBuffer = c.toBuffer, c.toString = function (a, b, c) { if (typeof a === 'undefined') return 'ByteBufferAB(offset=' + this.offset + ',markedOffset=' + this.markedOffset + ',limit=' + this.limit + ',capacity=' + this.capacity() + ')'; switch (typeof a === 'number' && (a = 'utf8', b = a, c = b), a) { case 'utf8':return this.toUTF8(b, c); case 'base64':return this.toBase64(b, c); case 'hex':return this.toHex(b, c); case 'binary':return this.toBinary(b, c); case 'debug':return this.toDebug(); case 'columns':return this.toColumns(); default:throw Error('Unsupported encoding: ' + a) } }, j = (function () { var d; var e; var a = {}; var b = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47]; var c = []; for (d = 0, e = b.length; e > d; ++d)c[b[d]] = d; return a.encode = function (a, c) { for (var d, e; (d = a()) !== null;)c(b[63 & d >> 2]), e = (3 & d) << 4, (d = a()) !== null ? (e |= 15 & d >> 4, c(b[63 & (e | 15 & d >> 4)]), e = (15 & d) << 2, (d = a()) !== null ? (c(b[63 & (e | 3 & d >> 6)]), c(b[63 & d])) : (c(b[63 & e]), c(61))) : (c(b[63 & e]), c(61), c(61)); }, a.decode = function (a, b) { function g (a) { throw Error('Illegal character code: ' + a) } for (var d, e, f; (d = a()) !== null;) if (e = c[d], typeof e === 'undefined' && g(d), (d = a()) !== null && (f = c[d], typeof f === 'undefined' && g(d), b(e << 2 >>> 0 | (48 & f) >> 4), (d = a()) !== null)) { if (e = c[d], typeof e === 'undefined') { if (d === 61) break; g(d); } if (b((15 & f) << 4 >>> 0 | (60 & e) >> 2), (d = a()) !== null) { if (f = c[d], typeof f === 'undefined') { if (d === 61) break; g(d); }b((3 & e) << 6 >>> 0 | f); } } }, a.test = function (a) { return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a) }, a }()), c.toBase64 = function (a, b) { if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), a = 0 | a, b = 0 | b, a < 0 || b > this.capacity || a > b) throw RangeError('begin, end'); var c; return j.encode(function () { return b > a ? this.view[a++] : null }.bind(this), c = g()), c() }, b.fromBase64 = function (a, c) { if (typeof a !== 'string') throw TypeError('str'); var d = new b(3 * (a.length / 4), c); var e = 0; return j.decode(f(a), function (a) { d.view[e++] = a; }), d.limit = e, d }, b.btoa = function (a) { return b.fromBinary(a).toBase64() }, b.atob = function (a) { return b.fromBase64(a).toBinary() }, c.toBinary = function (a, b) { if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), a |= 0, b |= 0, a < 0 || b > this.capacity() || a > b) throw RangeError('begin, end'); if (a === b) return ''; for (var c = [], d = []; b > a;)c.push(this.view[a++]), c.length >= 1024 && (d.push(String.fromCharCode.apply(String, c)), c = []); return d.join('') + String.fromCharCode.apply(String, c) }, b.fromBinary = function (a, c) { if (typeof a !== 'string') throw TypeError('str'); for (var f, d = 0, e = a.length, g = new b(e, c); e > d;) { if (f = a.charCodeAt(d), f > 255) throw RangeError('illegal char code: ' + f); g.view[d++] = f; } return g.limit = e, g }, c.toDebug = function (a) { for (var d, b = -1, c = this.buffer.byteLength, e = '', f = '', g = ''; c > b;) { if (b !== -1 && (d = this.view[b], e += d < 16 ? '0' + d.toString(16).toUpperCase() : d.toString(16).toUpperCase(), a && (f += d > 32 && d < 127 ? String.fromCharCode(d) : '.')), ++b, a && b > 0 && b % 16 === 0 && b !== c) { for (;e.length < 51;)e += ' '; g += e + f + '\\n', e = f = ''; }e += b === this.offset && b === this.limit ? b === this.markedOffset ? '!' : '|' : b === this.offset ? b === this.markedOffset ? '[' : '<' : b === this.limit ? b === this.markedOffset ? ']' : '>' : b === this.markedOffset ? \"'\" : a || b !== 0 && b !== c ? ' ' : ''; } if (a && e !== ' ') { for (;e.length < 51;)e += ' '; g += e + f + '\\n'; } return a ? g : e }, b.fromDebug = function (a, c, d) { for (var i, j, e = a.length, f = new b(0 | (e + 1) / 3, c, d), g = 0, h = 0, k = !1, l = !1, m = !1, n = !1, o = !1; e > g;) { switch (i = a.charAt(g++)) { case '!':if (!d) { if (l || m || n) { o = !0; break }l = m = n = !0; }f.offset = f.markedOffset = f.limit = h, k = !1; break; case '|':if (!d) { if (l || n) { o = !0; break }l = n = !0; }f.offset = f.limit = h, k = !1; break; case '[':if (!d) { if (l || m) { o = !0; break }l = m = !0; }f.offset = f.markedOffset = h, k = !1; break; case '<':if (!d) { if (l) { o = !0; break }l = !0; }f.offset = h, k = !1; break; case ']':if (!d) { if (n || m) { o = !0; break }n = m = !0; }f.limit = f.markedOffset = h, k = !1; break; case '>':if (!d) { if (n) { o = !0; break }n = !0; }f.limit = h, k = !1; break; case \"'\":if (!d) { if (m) { o = !0; break }m = !0; }f.markedOffset = h, k = !1; break; case ' ':k = !1; break; default:if (!d && k) { o = !0; break } if (j = parseInt(i + a.charAt(g++), 16), !d && (isNaN(j) || j < 0 || j > 255)) throw TypeError('Illegal str: Not a debug encoded string'); f.view[h++] = j, k = !0; } if (o) throw TypeError('Illegal str: Invalid symbol at ' + g) } if (!d) { if (!l || !n) throw TypeError('Illegal str: Missing offset or limit'); if (h < f.buffer.byteLength) throw TypeError('Illegal str: Not a debug encoded string (is it hex?) ' + h + ' < ' + e) } return f }, c.toHex = function (a, b) { if (a = typeof a === 'undefined' ? this.offset : a, b = typeof b === 'undefined' ? this.limit : b, !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength) } for (var d, c = new Array(b - a); b > a;)d = this.view[a++], d < 16 ? c.push('0', d.toString(16)) : c.push(d.toString(16)); return c.join('') }, b.fromHex = function (a, c, d) { var g, e, f, h, i; if (!d) { if (typeof a !== 'string') throw TypeError('Illegal str: Not a string'); if (a.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2') } for (e = a.length, f = new b(0 | e / 2, c), h = 0, i = 0; e > h; h += 2) { if (g = parseInt(a.substring(h, h + 2), 16), !d && (!isFinite(g) || g < 0 || g > 255)) throw TypeError('Illegal str: Contains non-hex characters'); f.view[i++] = g; } return f.limit = i, f }, k = (function () { var a = {}; return a.MAX_CODEPOINT = 1114111, a.encodeUTF8 = function (a, b) { var c = null; for (typeof a === 'number' && (c = a, a = function () { return null }); c !== null || (c = a()) !== null;)c < 128 ? b(127 & c) : c < 2048 ? (b(192 | 31 & c >> 6), b(128 | 63 & c)) : c < 65536 ? (b(224 | 15 & c >> 12), b(128 | 63 & c >> 6), b(128 | 63 & c)) : (b(240 | 7 & c >> 18), b(128 | 63 & c >> 12), b(128 | 63 & c >> 6), b(128 | 63 & c)), c = null; }, a.decodeUTF8 = function (a, b) { for (var c, d, e, f, g = function (a) { a = a.slice(0, a.indexOf(null)); var b = Error(a.toString()); throw b.name = 'TruncatedError', b.bytes = a, b }; (c = a()) !== null;) if ((128 & c) === 0)b(c); else if ((224 & c) === 192)(d = a()) === null && g([c, d]), b((31 & c) << 6 | 63 & d); else if ((240 & c) === 224)((d = a()) === null || (e = a()) === null) && g([c, d, e]), b((15 & c) << 12 | (63 & d) << 6 | 63 & e); else { if ((248 & c) !== 240) throw RangeError('Illegal starting byte: ' + c); ((d = a()) === null || (e = a()) === null || (f = a()) === null) && g([c, d, e, f]), b((7 & c) << 18 | (63 & d) << 12 | (63 & e) << 6 | 63 & f); } }, a.UTF16toUTF8 = function (a, b) { for (var c, d = null; ;) { if ((c = d !== null ? d : a()) === null) break; c >= 55296 && c <= 57343 && (d = a()) !== null && d >= 56320 && d <= 57343 ? (b(1024 * (c - 55296) + d - 56320 + 65536), d = null) : b(c); }d !== null && b(d); }, a.UTF8toUTF16 = function (a, b) { var c = null; for (typeof a === 'number' && (c = a, a = function () { return null }); c !== null || (c = a()) !== null;)c <= 65535 ? b(c) : (c -= 65536, b((c >> 10) + 55296), b(c % 1024 + 56320)), c = null; }, a.encodeUTF16toUTF8 = function (b, c) { a.UTF16toUTF8(b, function (b) { a.encodeUTF8(b, c); }); }, a.decodeUTF8toUTF16 = function (b, c) { a.decodeUTF8(b, function (b) { a.UTF8toUTF16(b, c); }); }, a.calculateCodePoint = function (a) { return a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4 }, a.calculateUTF8 = function (a) { for (var b, c = 0; (b = a()) !== null;)c += b < 128 ? 1 : b < 2048 ? 2 : b < 65536 ? 3 : 4; return c }, a.calculateUTF16asUTF8 = function (b) { var c = 0; var d = 0; return a.UTF16toUTF8(b, function (a) { ++c, d += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4; }), [c, d] }, a }()), c.toUTF8 = function (a, b) { if (typeof a === 'undefined' && (a = this.offset), typeof b === 'undefined' && (b = this.limit), !this.noAssert) { if (typeof a !== 'number' || a % 1 !== 0) throw TypeError('Illegal begin: Not an integer'); if (a >>>= 0, typeof b !== 'number' || b % 1 !== 0) throw TypeError('Illegal end: Not an integer'); if (b >>>= 0, a < 0 || a > b || b > this.buffer.byteLength) throw RangeError('Illegal range: 0 <= ' + a + ' <= ' + b + ' <= ' + this.buffer.byteLength) } var c; try { k.decodeUTF8toUTF16(function () { return b > a ? this.view[a++] : null }.bind(this), c = g()); } catch (d) { if (a !== b) throw RangeError('Illegal range: Truncated data, ' + a + ' != ' + b) } return c() }, b.fromUTF8 = function (a, c, d) { if (!d && typeof a !== 'string') throw TypeError('Illegal str: Not a string'); var e = new b(k.calculateUTF16asUTF8(f(a), !0)[1], c, d); var g = 0; return k.encodeUTF16toUTF8(f(a), function (a) { e.view[g++] = a; }), e.limit = g, e }, b\n    }(c)); var e = (function (b, c) {\n      var f; var h; var e = {}; return e.ByteBuffer = b, e.c = b, f = b, e.Long = c || null, e.VERSION = '5.0.1', e.WIRE_TYPES = {}, e.WIRE_TYPES.VARINT = 0, e.WIRE_TYPES.BITS64 = 1, e.WIRE_TYPES.LDELIM = 2, e.WIRE_TYPES.STARTGROUP = 3, e.WIRE_TYPES.ENDGROUP = 4, e.WIRE_TYPES.BITS32 = 5, e.PACKABLE_WIRE_TYPES = [e.WIRE_TYPES.VARINT, e.WIRE_TYPES.BITS64, e.WIRE_TYPES.BITS32], e.TYPES = { int32: { name: 'int32', wireType: e.WIRE_TYPES.VARINT, defaultValue: 0 }, uint32: { name: 'uint32', wireType: e.WIRE_TYPES.VARINT, defaultValue: 0 }, sint32: { name: 'sint32', wireType: e.WIRE_TYPES.VARINT, defaultValue: 0 }, int64: { name: 'int64', wireType: e.WIRE_TYPES.VARINT, defaultValue: e.Long ? e.Long.ZERO : void 0 }, uint64: { name: 'uint64', wireType: e.WIRE_TYPES.VARINT, defaultValue: e.Long ? e.Long.UZERO : void 0 }, sint64: { name: 'sint64', wireType: e.WIRE_TYPES.VARINT, defaultValue: e.Long ? e.Long.ZERO : void 0 }, bool: { name: 'bool', wireType: e.WIRE_TYPES.VARINT, defaultValue: !1 }, double: { name: 'double', wireType: e.WIRE_TYPES.BITS64, defaultValue: 0 }, string: { name: 'string', wireType: e.WIRE_TYPES.LDELIM, defaultValue: '' }, bytes: { name: 'bytes', wireType: e.WIRE_TYPES.LDELIM, defaultValue: null }, fixed32: { name: 'fixed32', wireType: e.WIRE_TYPES.BITS32, defaultValue: 0 }, sfixed32: { name: 'sfixed32', wireType: e.WIRE_TYPES.BITS32, defaultValue: 0 }, fixed64: { name: 'fixed64', wireType: e.WIRE_TYPES.BITS64, defaultValue: e.Long ? e.Long.UZERO : void 0 }, sfixed64: { name: 'sfixed64', wireType: e.WIRE_TYPES.BITS64, defaultValue: e.Long ? e.Long.ZERO : void 0 }, float: { name: 'float', wireType: e.WIRE_TYPES.BITS32, defaultValue: 0 }, enum: { name: 'enum', wireType: e.WIRE_TYPES.VARINT, defaultValue: 0 }, message: { name: 'message', wireType: e.WIRE_TYPES.LDELIM, defaultValue: null }, group: { name: 'group', wireType: e.WIRE_TYPES.STARTGROUP, defaultValue: null } }, e.MAP_KEY_TYPES = [e.TYPES.int32, e.TYPES.sint32, e.TYPES.sfixed32, e.TYPES.uint32, e.TYPES.fixed32, e.TYPES.int64, e.TYPES.sint64, e.TYPES.sfixed64, e.TYPES.uint64, e.TYPES.fixed64, e.TYPES.bool, e.TYPES.string, e.TYPES.bytes], e.ID_MIN = 1, e.ID_MAX = 536870911, e.convertFieldsToCamelCase = !1, e.populateAccessors = !0, e.populateDefaults = !0, e.Util = (function () { var a = {}; return a.IS_NODE = !(typeof process !== 'object' || process + '' != '[object process]' || process.browser), a.XHR = function () { var c; var a = [function () { return new XMLHttpRequest() }, function () { return new ActiveXObject('Msxml2.XMLHTTP') }, function () { return new ActiveXObject('Msxml3.XMLHTTP') }, function () { return new ActiveXObject('Microsoft.XMLHTTP') }]; var b = null; for (c = 0; c < a.length; c++) { try { b = a[c](); } catch (d) { continue } break } if (!b) throw Error('XMLHttpRequest is not supported'); return b }, a.fetch = function (b, c) { if (c && typeof c !== 'function' && (c = null), a.IS_NODE) if (c)g.readFile(b, function (a, b) { a ? c(null) : c('' + b); }); else try { return g.readFileSync(b) } catch (d) { return null } else { var e = a.XHR(); if (e.open('GET', b, c ? !0 : !1), e.setRequestHeader('Accept', 'text/plain'), typeof e.overrideMimeType === 'function' && e.overrideMimeType('text/plain'), !c) return e.send(null), e.status == 200 || e.status == 0 && typeof e.responseText === 'string' ? e.responseText : null; if (e.onreadystatechange = function () { e.readyState == 4 && (e.status == 200 || e.status == 0 && typeof e.responseText === 'string' ? c(e.responseText) : c(null)); }, e.readyState == 4) return; e.send(null); } }, a.toCamelCase = function (a) { return a.replace(/_([a-zA-Z])/g, function (a, b) { return b.toUpperCase() }) }, a }()), e.Lang = { DELIM: /[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g, RULE: /^(?:required|optional|repeated|map)$/, TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, TYPEREF: /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/, FQTYPEREF: /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/, NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, NUMBER_OCT: /^0[0-7]+$/, NUMBER_FLT: /^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, BOOL: /^(?:true|false)$/i, ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, NEGID: /^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, WHITESPACE: /\\s/, STRING: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g, STRING_DQ: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g, STRING_SQ: /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g }, e.DotProto = (function (a, b) {\n        function h (a, c) { var d = -1; var e = 1; if (a.charAt(0) == '-' && (e = -1, a = a.substring(1)), b.NUMBER_DEC.test(a))d = parseInt(a); else if (b.NUMBER_HEX.test(a))d = parseInt(a.substring(2), 16); else { if (!b.NUMBER_OCT.test(a)) throw Error('illegal id value: ' + (e < 0 ? '-' : '') + a); d = parseInt(a.substring(1), 8); } if (d = 0 | e * d, !c && d < 0) throw Error('illegal id value: ' + (e < 0 ? '-' : '') + a); return d } function i (a) { var c = 1; if (a.charAt(0) == '-' && (c = -1, a = a.substring(1)), b.NUMBER_DEC.test(a)) return c * parseInt(a, 10); if (b.NUMBER_HEX.test(a)) return c * parseInt(a.substring(2), 16); if (b.NUMBER_OCT.test(a)) return c * parseInt(a.substring(1), 8); if (a === 'inf') return 1 / 0 * c; if (a === 'nan') return 0 / 0; if (b.NUMBER_FLT.test(a)) return c * parseFloat(a); throw Error('illegal number value: ' + (c < 0 ? '-' : '') + a) } function j (a, b, c) { typeof a[b] === 'undefined' ? a[b] = c : (Array.isArray(a[b]) || (a[b] = [a[b]]), a[b].push(c)); } var f; var g; var c = {}; var d = function (a) { this.source = a + '', this.index = 0, this.line = 1, this.stack = [], this._stringOpen = null; }; var e = d.prototype; return e._readString = function () { var c; var a = this._stringOpen === '\"' ? b.STRING_DQ : b.STRING_SQ; if (a.lastIndex = this.index - 1, c = a.exec(this.source), !c) throw Error('unterminated string'); return this.index = a.lastIndex, this.stack.push(this._stringOpen), this._stringOpen = null, c[1] }, e.next = function () { var a, c, d, e, f, g; if (this.stack.length > 0) return this.stack.shift(); if (this.index >= this.source.length) return null; if (this._stringOpen !== null) return this._readString(); do { for (a = !1; b.WHITESPACE.test(d = this.source.charAt(this.index));) if (d === '\\n' && ++this.line, ++this.index === this.source.length) return null; if (this.source.charAt(this.index) === '/') if (++this.index, this.source.charAt(this.index) === '/') { for (;this.source.charAt(++this.index) !== '\\n';) if (this.index == this.source.length) return null; ++this.index, ++this.line, a = !0; } else { if ((d = this.source.charAt(this.index)) !== '*') return '/'; do { if (d === '\\n' && ++this.line, ++this.index === this.source.length) return null; c = d, d = this.source.charAt(this.index); } while (c !== '*' || d !== '/'); ++this.index, a = !0; } } while (a); if (this.index === this.source.length) return null; if (e = this.index, b.DELIM.lastIndex = 0, f = b.DELIM.test(this.source.charAt(e++)), !f) for (;e < this.source.length && !b.DELIM.test(this.source.charAt(e));)++e; return g = this.source.substring(this.index, this.index = e), (g === '\"' || g === \"'\") && (this._stringOpen = g), g }, e.peek = function () { if (this.stack.length === 0) { var a = this.next(); if (a === null) return null; this.stack.push(a); } return this.stack[0] }, e.skip = function (a) { var b = this.next(); if (b !== a) throw Error(\"illegal '\" + b + \"', '\" + a + \"' expected\") }, e.omit = function (a) { return this.peek() === a ? (this.next(), !0) : !1 }, e.toString = function () { return 'Tokenizer (' + this.index + '/' + this.source.length + ' at line ' + this.line + ')' }, c.Tokenizer = d, f = function (a) { this.tn = new d(a), this.proto3 = !1; }, g = f.prototype, g.parse = function () { var c; var a = { name: '[ROOT]', package: null, messages: [], enums: [], imports: [], options: {}, services: [] }; var d = !0; try { for (;c = this.tn.next();) switch (c) { case 'package':if (!d || a.package !== null) throw Error(\"unexpected 'package'\"); if (c = this.tn.next(), !b.TYPEREF.test(c)) throw Error('illegal package name: ' + c); this.tn.skip(';'), a.package = c; break; case 'import':if (!d) throw Error(\"unexpected 'import'\"); c = this.tn.peek(), c === 'public' && this.tn.next(), c = this._readString(), this.tn.skip(';'), a.imports.push(c); break; case 'syntax':if (!d) throw Error(\"unexpected 'syntax'\"); this.tn.skip('='), (a.syntax = this._readString()) === 'proto3' && (this.proto3 = !0), this.tn.skip(';'); break; case 'message':this._parseMessage(a, null), d = !1; break; case 'enum':this._parseEnum(a), d = !1; break; case 'option':this._parseOption(a); break; case 'service':this._parseService(a); break; case 'extend':this._parseExtend(a); break; default:throw Error(\"unexpected '\" + c + \"'\") } } catch (e) { throw e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message, e } return delete a.name, a }, f.parse = function (a) { return new f(a).parse() }, g._readString = function () { var b; var c; var a = ''; do { if (c = this.tn.next(), c !== \"'\" && c !== '\"') throw Error('illegal string delimiter: ' + c); a += this.tn.next(), this.tn.skip(c), b = this.tn.peek(); } while (b === '\"' || b === '\"'); return a }, g._readValue = function (a) { var c = this.tn.peek(); if (c === '\"' || c === \"'\") return this._readString(); if (this.tn.next(), b.NUMBER.test(c)) return i(c); if (b.BOOL.test(c)) return c.toLowerCase() === 'true'; if (a && b.TYPEREF.test(c)) return c; throw Error('illegal value: ' + c) }, g._parseOption = function (a, c) { var f; var d = this.tn.next(); var e = !1; if (d === '(' && (e = !0, d = this.tn.next()), !b.TYPEREF.test(d)) throw Error('illegal option name: ' + d); f = d, e && (this.tn.skip(')'), f = '(' + f + ')', d = this.tn.peek(), b.FQTYPEREF.test(d) && (f += d, this.tn.next())), this.tn.skip('='), this._parseOptionValue(a, f), c || this.tn.skip(';'); }, g._parseOptionValue = function (a, c) { var d = this.tn.peek(); if (d !== '{')j(a.options, c, this._readValue(!0)); else for (this.tn.skip('{'); (d = this.tn.next()) !== '}';) { if (!b.NAME.test(d)) throw Error('illegal option name: ' + c + '.' + d); this.tn.omit(':') ? j(a.options, c + '.' + d, this._readValue(!0)) : this._parseOptionValue(a, c + '.' + d); } }, g._parseService = function (a) { var d; var e; var c = this.tn.next(); if (!b.NAME.test(c)) throw Error('illegal service name at line ' + this.tn.line + ': ' + c); for (d = c, e = { name: d, rpc: {}, options: {} }, this.tn.skip('{'); (c = this.tn.next()) !== '}';) if (c === 'option') this._parseOption(e); else { if (c !== 'rpc') throw Error('illegal service token: ' + c); this._parseServiceRPC(e); } this.tn.omit(';'), a.services.push(e); }, g._parseServiceRPC = function (a) { var e; var f; var c = 'rpc'; var d = this.tn.next(); if (!b.NAME.test(d)) throw Error('illegal rpc service method name: ' + d); if (e = d, f = { request: null, response: null, request_stream: !1, response_stream: !1, options: {} }, this.tn.skip('('), d = this.tn.next(), d.toLowerCase() === 'stream' && (f.request_stream = !0, d = this.tn.next()), !b.TYPEREF.test(d)) throw Error('illegal rpc service request type: ' + d); if (f.request = d, this.tn.skip(')'), d = this.tn.next(), d.toLowerCase() !== 'returns') throw Error('illegal rpc service request type delimiter: ' + d); if (this.tn.skip('('), d = this.tn.next(), d.toLowerCase() === 'stream' && (f.response_stream = !0, d = this.tn.next()), f.response = d, this.tn.skip(')'), d = this.tn.peek(), d === '{') { for (this.tn.next(); (d = this.tn.next()) !== '}';) { if (d !== 'option') throw Error('illegal rpc service token: ' + d); this._parseOption(f); } this.tn.omit(';'); } else this.tn.skip(';'); typeof a[c] === 'undefined' && (a[c] = {}), a[c][e] = f; }, g._parseMessage = function (a, c) { var d = !!c; var e = this.tn.next(); var f = { name: '', fields: [], enums: [], messages: [], options: {}, services: [], oneofs: {} }; if (!b.NAME.test(e)) throw Error('illegal ' + (d ? 'group' : 'message') + ' name: ' + e); for (f.name = e, d && (this.tn.skip('='), c.id = h(this.tn.next()), f.isGroup = !0), e = this.tn.peek(), e === '[' && c && this._parseFieldOptions(c), this.tn.skip('{'); (e = this.tn.next()) !== '}';) if (b.RULE.test(e)) this._parseMessageField(f, e); else if (e === 'oneof') this._parseMessageOneOf(f); else if (e === 'enum') this._parseEnum(f); else if (e === 'message') this._parseMessage(f); else if (e === 'option') this._parseOption(f); else if (e === 'service') this._parseService(f); else if (e === 'extensions')f.extensions = this._parseExtensionRanges(); else if (e === 'reserved') this._parseIgnored(); else if (e === 'extend') this._parseExtend(f); else { if (!b.TYPEREF.test(e)) throw Error('illegal message token: ' + e); if (!this.proto3) throw Error('illegal field rule: ' + e); this._parseMessageField(f, 'optional', e); } return this.tn.omit(';'), a.messages.push(f), f }, g._parseIgnored = function () { for (;this.tn.peek() !== ';';) this.tn.next(); this.tn.skip(';'); }, g._parseMessageField = function (a, c, d) {\n          var e, f, g; if (!b.RULE.test(c)) throw Error('illegal message field rule: ' + c); if (e = { rule: c, type: '', name: '', options: {}, id: 0 }, c === 'map') { if (d) throw Error('illegal type: ' + d); if (this.tn.skip('<'), f = this.tn.next(), !b.TYPE.test(f) && !b.TYPEREF.test(f)) throw Error('illegal message field type: ' + f); if (e.keytype = f, this.tn.skip(','), f = this.tn.next(), !b.TYPE.test(f) && !b.TYPEREF.test(f)) throw Error('illegal message field: ' + f); if (e.type = f, this.tn.skip('>'), f = this.tn.next(), !b.NAME.test(f)) throw Error('illegal message field name: ' + f); e.name = f, this.tn.skip('='), e.id = h(this.tn.next()), f = this.tn.peek(), f === '[' && this._parseFieldOptions(e), this.tn.skip(';'); } else if (d = typeof d !== 'undefined' ? d : this.tn.next(), d === 'group') { if (g = this._parseMessage(a, e), !/^[A-Z]/.test(g.name)) throw Error('illegal group name: ' + g.name); e.type = g.name, e.name = g.name.toLowerCase(), this.tn.omit(';'); } else {\n            if (!b.TYPE.test(d) && !b.TYPEREF.test(d)) throw Error('illegal message field type: ' + d); if (e.type = d, f = this.tn.next(), !b.NAME.test(f)) throw Error('illegal message field name: ' + f)\n            e.name = f, this.tn.skip('='), e.id = h(this.tn.next()), f = this.tn.peek(), f === '[' && this._parseFieldOptions(e), this.tn.skip(';');\n          } return a.fields.push(e), e\n        }, g._parseMessageOneOf = function (a) { var e; var d; var f; var c = this.tn.next(); if (!b.NAME.test(c)) throw Error('illegal oneof name: ' + c); for (d = c, f = [], this.tn.skip('{'); (c = this.tn.next()) !== '}';)e = this._parseMessageField(a, 'optional', c), e.oneof = d, f.push(e.id); this.tn.omit(';'), a.oneofs[d] = f; }, g._parseFieldOptions = function (a) { this.tn.skip('['); for (var c = !0; (this.tn.peek()) !== ']';)c || this.tn.skip(','), this._parseOption(a, !0), c = !1; this.tn.next(); }, g._parseEnum = function (a) { var e; var c = { name: '', values: [], options: {} }; var d = this.tn.next(); if (!b.NAME.test(d)) throw Error('illegal name: ' + d); for (c.name = d, this.tn.skip('{'); (d = this.tn.next()) !== '}';) if (d === 'option') this._parseOption(c); else { if (!b.NAME.test(d)) throw Error('illegal name: ' + d); this.tn.skip('='), e = { name: d, id: h(this.tn.next(), !0) }, d = this.tn.peek(), d === '[' && this._parseFieldOptions({ options: {} }), this.tn.skip(';'), c.values.push(e); } this.tn.omit(';'), a.enums.push(c); }, g._parseExtensionRanges = function () { var c; var d; var e; var b = []; do { for (d = []; ;) { switch (c = this.tn.next()) { case 'min':e = a.ID_MIN; break; case 'max':e = a.ID_MAX; break; default:e = i(c); } if (d.push(e), d.length === 2) break; if (this.tn.peek() !== 'to') { d.push(e); break } this.tn.next(); }b.push(d); } while (this.tn.omit(',')); return this.tn.skip(';'), b }, g._parseExtend = function (a) { var d; var c = this.tn.next(); if (!b.TYPEREF.test(c)) throw Error('illegal extend reference: ' + c); for (d = { ref: c, fields: [] }, this.tn.skip('{'); (c = this.tn.next()) !== '}';) if (b.RULE.test(c)) this._parseMessageField(d, c); else { if (!b.TYPEREF.test(c)) throw Error('illegal extend token: ' + c); if (!this.proto3) throw Error('illegal field rule: ' + c); this._parseMessageField(d, 'optional', c); } return this.tn.omit(';'), a.messages.push(d), d }, g.toString = function () { return 'Parser at line ' + this.tn.line }, c.Parser = f, c\n      }(e, e.Lang)), e.Reflect = (function (a) { function k (b) { if (typeof b === 'string' && (b = a.TYPES[b]), typeof b.defaultValue === 'undefined') throw Error('default value for type ' + b.name + ' is not supported'); return b == a.TYPES.bytes ? new f(0) : b.defaultValue } function l (b, c) { if (b && typeof b.low === 'number' && typeof b.high === 'number' && typeof b.unsigned === 'boolean' && b.low === b.low && b.high === b.high) return new a.Long(b.low, b.high, typeof c === 'undefined' ? b.unsigned : c); if (typeof b === 'string') return a.Long.fromString(b, c || !1, 10); if (typeof b === 'number') return a.Long.fromNumber(b, c || !1); throw Error('not convertible to Long') } function o (b, c) { var d = c.readVarint32(); var e = 7 & d; var f = d >>> 3; switch (e) { case a.WIRE_TYPES.VARINT:do d = c.readUint8(); while ((128 & d) === 128); break; case a.WIRE_TYPES.BITS64:c.offset += 8; break; case a.WIRE_TYPES.LDELIM:d = c.readVarint32(), c.offset += d; break; case a.WIRE_TYPES.STARTGROUP:o(f, c); break; case a.WIRE_TYPES.ENDGROUP:if (f === b) return !1; throw Error('Illegal GROUPEND after unknown group: ' + f + ' (' + b + ' expected)'); case a.WIRE_TYPES.BITS32:c.offset += 4; break; default:throw Error('Illegal wire type in unknown group ' + b + ': ' + e) } return !0 } var g; var h; var i; var j; var m; var n; var p; var q; var r; var s; var t; var u; var v; var w; var x; var y; var z; var A; var B; var c = {}; var d = function (a, b, c) { this.builder = a, this.parent = b, this.name = c, this.className; }; var e = d.prototype; return e.fqn = function () { for (var a = this.name, b = this; ;) { if (b = b.parent, b == null) break; a = b.name + '.' + a; } return a }, e.toString = function (a) { return (a ? this.className + ' ' : '') + this.fqn() }, e.build = function () { throw Error(this.toString(!0) + ' cannot be built directly') }, c.T = d, g = function (a, b, c, e, f) { d.call(this, a, b, c), this.className = 'Namespace', this.children = [], this.options = e || {}, this.syntax = f || 'proto2'; }, h = g.prototype = Object.create(d.prototype), h.getChildren = function (a) { var b, c, d; if (a = a || null, a == null) return this.children.slice(); for (b = [], c = 0, d = this.children.length; d > c; ++c) this.children[c] instanceof a && b.push(this.children[c]); return b }, h.addChild = function (a) { var b; if (b = this.getChild(a.name)) if (b instanceof m.Field && b.name !== b.originalName && this.getChild(b.originalName) === null)b.name = b.originalName; else { if (!(a instanceof m.Field && a.name !== a.originalName && this.getChild(a.originalName) === null)) throw Error('Duplicate name in namespace ' + this.toString(!0) + ': ' + a.name); a.name = a.originalName; } this.children.push(a); }, h.getChild = function (a) { var c; var d; var b = typeof a === 'number' ? 'id' : 'name'; for (c = 0, d = this.children.length; d > c; ++c) if (this.children[c][b] === a) return this.children[c]; return null }, h.resolve = function (a, b) { var g; var d = typeof a === 'string' ? a.split('.') : a; var e = this; var f = 0; if (d[f] === '') { for (;e.parent !== null;)e = e.parent; f++; } do { do { if (!(e instanceof c.Namespace)) { e = null; break } if (g = e.getChild(d[f]), !(g && g instanceof c.T && (!b || g instanceof c.Namespace))) { e = null; break }e = g, f++; } while (f < d.length); if (e != null) break; if (this.parent !== null) return this.parent.resolve(a, b) } while (e != null); return e }, h.qn = function (a) { var e; var f; var b = []; var d = a; do b.unshift(d.name), d = d.parent; while (d !== null); for (e = 1; e <= b.length; e++) if (f = b.slice(b.length - e), a === this.resolve(f, a instanceof c.Namespace)) return f.join('.'); return a.fqn() }, h.build = function () { var e; var c; var d; var a = {}; var b = this.children; for (c = 0, d = b.length; d > c; ++c)e = b[c], e instanceof g && (a[e.name] = e.build()); return Object.defineProperty && Object.defineProperty(a, '$options', { value: this.buildOpt() }), a }, h.buildOpt = function () { var c; var d; var e; var f; var a = {}; var b = Object.keys(this.options); for (c = 0, d = b.length; d > c; ++c)e = b[c], f = this.options[b[c]], a[e] = f; return a }, h.getOption = function (a) { return typeof a === 'undefined' ? this.options : typeof this.options[a] !== 'undefined' ? this.options[a] : null }, c.Namespace = g, i = function (b, c, d, e) { if (this.type = b, this.resolvedType = c, this.isMapKey = d, this.syntax = e, d && a.MAP_KEY_TYPES.indexOf(b) < 0) throw Error('Invalid map key type: ' + b.name) }, j = i.prototype, i.defaultFieldValue = k, j.verifyValue = function (c) { var f; var g; var h; var d = function (a, b) { throw Error('Illegal value for ' + this.toString(!0) + ' of type ' + this.type.name + ': ' + a + ' (' + b + ')') }.bind(this); switch (this.type) { case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (typeof c !== 'number' || c === c && c % 1 !== 0) && d(typeof c, 'not an integer'), c > 4294967295 ? 0 | c : c; case a.TYPES.uint32:case a.TYPES.fixed32:return (typeof c !== 'number' || c === c && c % 1 !== 0) && d(typeof c, 'not an integer'), c < 0 ? c >>> 0 : c; case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if (a.Long) try { return l(c, !1) } catch (e) { d(typeof c, e.message); } else d(typeof c, 'requires Long.js'); case a.TYPES.uint64:case a.TYPES.fixed64:if (a.Long) try { return l(c, !0) } catch (e) { d(typeof c, e.message); } else d(typeof c, 'requires Long.js'); case a.TYPES.bool:return typeof c !== 'boolean' && d(typeof c, 'not a boolean'), c; case a.TYPES.float:case a.TYPES.double:return typeof c !== 'number' && d(typeof c, 'not a number'), c; case a.TYPES.string:return typeof c === 'string' || c && c instanceof String || d(typeof c, 'not a string'), '' + c; case a.TYPES.bytes:return b.isByteBuffer(c) ? c : b.wrap(c); case a.TYPES.enum:for (f = this.resolvedType.getChildren(a.Reflect.Enum.Value), h = 0; h < f.length; h++) { if (f[h].name == c) return f[h].id; if (f[h].id == c) return f[h].id } if (this.syntax === 'proto3') return (typeof c !== 'number' || c === c && c % 1 !== 0) && d(typeof c, 'not an integer'), (c > 4294967295 || c < 0) && d(typeof c, 'not in range for uint32'), c; d(c, 'not a valid enum value'); case a.TYPES.group:case a.TYPES.message:if (c && typeof c === 'object' || d(typeof c, 'object expected'), c instanceof this.resolvedType.clazz) return c; if (c instanceof a.Builder.Message) { g = {}; for (h in c)c.hasOwnProperty(h) && (g[h] = c[h]); c = g; } return new this.resolvedType.clazz(c) } throw Error('[INTERNAL] Illegal value for ' + this.toString(!0) + ': ' + c + ' (undefined type ' + this.type + ')') }, j.calculateLength = function (b, c) { if (c === null) return 0; var d; switch (this.type) { case a.TYPES.int32:return c < 0 ? f.calculateVarint64(c) : f.calculateVarint32(c); case a.TYPES.uint32:return f.calculateVarint32(c); case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c)); case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES.float:return 4; case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c); case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c)); case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8; case a.TYPES.bool:return 1; case a.TYPES.enum:return f.calculateVarint32(c); case a.TYPES.double:return 8; case a.TYPES.string:return d = f.calculateUTF8Bytes(c), f.calculateVarint32(d) + d; case a.TYPES.bytes:if (c.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + c.remaining() + ' bytes remaining'); return f.calculateVarint32(c.remaining()) + c.remaining(); case a.TYPES.message:return d = this.resolvedType.calculate(c), f.calculateVarint32(d) + d; case a.TYPES.group:return d = this.resolvedType.calculate(c), d + f.calculateVarint32(b << 3 | a.WIRE_TYPES.ENDGROUP) } throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + c + ' (unknown type)') }, j.encodeValue = function (b, c, d) { var e, g; if (c === null) return d; switch (this.type) { case a.TYPES.int32:c < 0 ? d.writeVarint64(c) : d.writeVarint32(c); break; case a.TYPES.uint32:d.writeVarint32(c); break; case a.TYPES.sint32:d.writeVarint32ZigZag(c); break; case a.TYPES.fixed32:d.writeUint32(c); break; case a.TYPES.sfixed32:d.writeInt32(c); break; case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c); break; case a.TYPES.sint64:d.writeVarint64ZigZag(c); break; case a.TYPES.fixed64:d.writeUint64(c); break; case a.TYPES.sfixed64:d.writeInt64(c); break; case a.TYPES.bool:typeof c === 'string' ? d.writeVarint32(c.toLowerCase() === 'false' ? 0 : !!c) : d.writeVarint32(c ? 1 : 0); break; case a.TYPES.enum:d.writeVarint32(c); break; case a.TYPES.float:d.writeFloat32(c); break; case a.TYPES.double:d.writeFloat64(c); break; case a.TYPES.string:d.writeVString(c); break; case a.TYPES.bytes:if (c.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + c.remaining() + ' bytes remaining'); e = c.offset, d.writeVarint32(c.remaining()), d.append(c), c.offset = e; break; case a.TYPES.message:g = (new f()).LE(), this.resolvedType.encode(c, g), d.writeVarint32(g.offset), d.append(g.flip()); break; case a.TYPES.group:this.resolvedType.encode(c, d), d.writeVarint32(b << 3 | a.WIRE_TYPES.ENDGROUP); break; default:throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + c + ' (unknown type)') } return d }, j.decode = function (b, c, d) { if (c != this.type.wireType) throw Error('Unexpected wire type for element'); var e, f; switch (this.type) { case a.TYPES.int32:return 0 | b.readVarint32(); case a.TYPES.uint32:return b.readVarint32() >>> 0; case a.TYPES.sint32:return 0 | b.readVarint32ZigZag(); case a.TYPES.fixed32:return b.readUint32() >>> 0; case a.TYPES.sfixed32:return 0 | b.readInt32(); case a.TYPES.int64:return b.readVarint64(); case a.TYPES.uint64:return b.readVarint64().toUnsigned(); case a.TYPES.sint64:return b.readVarint64ZigZag(); case a.TYPES.fixed64:return b.readUint64(); case a.TYPES.sfixed64:return b.readInt64(); case a.TYPES.bool:return !!b.readVarint32(); case a.TYPES.enum:return b.readVarint32(); case a.TYPES.float:return b.readFloat(); case a.TYPES.double:return b.readDouble(); case a.TYPES.string:return b.readVString(); case a.TYPES.bytes:if (f = b.readVarint32(), b.remaining() < f) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + f + ' required but got only ' + b.remaining()); return e = b.clone(), e.limit = e.offset + f, b.offset += f, e; case a.TYPES.message:return f = b.readVarint32(), this.resolvedType.decode(b, f); case a.TYPES.group:return this.resolvedType.decode(b, -1, d) } throw Error('[INTERNAL] Illegal decode type') }, j.valueFromString = function (b) { if (!this.isMapKey) throw Error('valueFromString() called on non-map-key element'); switch (this.type) { case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b)); case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b); case a.TYPES.bool:return b === 'true'; case a.TYPES.string:return this.verifyValue(b); case a.TYPES.bytes:return f.fromBinary(b) } }, j.valueToString = function (b) { if (!this.isMapKey) throw Error('valueToString() called on non-map-key element'); return this.type === a.TYPES.bytes ? b.toString('binary') : b.toString() }, c.Element = i, m = function (a, b, c, d, e, f) { g.call(this, a, b, c, d, f), this.className = 'Message', this.extensions = void 0, this.clazz = null, this.isGroup = !!e, this._fields = null, this._fieldsById = null, this._fieldsByName = null; }, n = m.prototype = Object.create(g.prototype), n.build = function (c) { var d, h, e, g; if (this.clazz && !c) return this.clazz; for (d = (function (a, c) { function k (b, c, d, e) { var g, h, i, j, l, m, n; if (b === null || typeof b !== 'object') return e && e instanceof a.Reflect.Enum && (g = a.Reflect.Enum.getName(e.object, b), g !== null) ? g : b; if (f.isByteBuffer(b)) return c ? b.toBase64() : b.toBuffer(); if (a.Long.isLong(b)) return d ? b.toString() : a.Long.fromValue(b); if (Array.isArray(b)) return h = [], b.forEach(function (a, b) { h[b] = k(a, c, d, e); }), h; if (h = {}, b instanceof a.Map) { for (i = b.entries(), j = i.next(); !j.done; j = i.next())h[b.keyElem.valueToString(j.value[0])] = k(j.value[1], c, d, b.valueElem.resolvedType); return h }l = b.$type, m = void 0; for (n in b)b.hasOwnProperty(n) && (h[n] = l && (m = l.getChild(n)) ? k(b[n], c, d, m.resolvedType) : k(b[n], c, d)); return h } var i; var j; var d = c.getChildren(a.Reflect.Message.Field); var e = c.getChildren(a.Reflect.Message.OneOf); var g = function (b) { var i, j, k, l; for (a.Builder.Message.call(this), i = 0, j = e.length; j > i; ++i) this[e[i].name] = null; for (i = 0, j = d.length; j > i; ++i)k = d[i], this[k.name] = k.repeated ? [] : k.map ? new a.Map(k) : null, !k.required && c.syntax !== 'proto3' || k.defaultValue === null || (this[k.name] = k.defaultValue); if (arguments.length > 0) if (arguments.length !== 1 || b === null || typeof b !== 'object' || !(typeof b.encode !== 'function' || b instanceof g) || Array.isArray(b) || b instanceof a.Map || f.isByteBuffer(b) || b instanceof ArrayBuffer || a.Long && b instanceof a.Long) for (i = 0, j = arguments.length; j > i; ++i) typeof (l = arguments[i]) !== 'undefined' && this.$set(d[i].name, l); else this.$set(b); }; var h = g.prototype = Object.create(a.Builder.Message.prototype); for (h.add = function (b, d, e) { var f = c._fieldsByName[b]; if (!e) { if (!f) throw Error(this + '#' + b + ' is undefined'); if (!(f instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: ' + f.toString(!0)); if (!f.repeated) throw Error(this + '#' + b + ' is not a repeated field'); d = f.verifyValue(d, !0); } return this[b] === null && (this[b] = []), this[b].push(d), this }, h.$add = h.add, h.set = function (b, d, e) { var f, g, h; if (b && typeof b === 'object') { e = d; for (f in b)b.hasOwnProperty(f) && typeof (d = b[f]) !== 'undefined' && this.$set(f, d, e); return this } if (g = c._fieldsByName[b], e) this[b] = d; else { if (!g) throw Error(this + '#' + b + ' is not a field: undefined'); if (!(g instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: ' + g.toString(!0)); this[g.name] = d = g.verifyValue(d); } return g && g.oneof && (h = this[g.oneof.name], d !== null ? (h !== null && h !== g.name && (this[h] = null), this[g.oneof.name] = g.name) : h === b && (this[g.oneof.name] = null)), this }, h.$set = h.set, h.get = function (b, d) { if (d) return this[b]; var e = c._fieldsByName[b]; if (!(e && e instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: undefined'); if (!(e instanceof a.Reflect.Message.Field)) throw Error(this + '#' + b + ' is not a field: ' + e.toString(!0)); return this[e.name] }, h.$get = h.get, i = 0; i < d.length; i++)j = d[i], j instanceof a.Reflect.Message.ExtensionField || c.builder.options.populateAccessors && (function (a) { var d; var e; var f; var b = a.originalName.replace(/(_[a-zA-Z])/g, function (a) { return a.toUpperCase().replace('_', '') }); b = b.substring(0, 1).toUpperCase() + b.substring(1), d = a.originalName.replace(/([A-Z])/g, function (a) { return '_' + a }), e = function (b, c) { return this[a.name] = c ? b : a.verifyValue(b), this }, f = function () { return this[a.name] }, c.getChild('set' + b) === null && (h['set' + b] = e), c.getChild('set_' + d) === null && (h['set_' + d] = e), c.getChild('get' + b) === null && (h['get' + b] = f), c.getChild('get_' + d) === null && (h['get_' + d] = f); }(j)); return h.encode = function (a, d) { var e, f; typeof a === 'boolean' && (d = a, a = void 0), e = !1, a || (a = new b(), e = !0), f = a.littleEndian; try { return c.encode(this, a.LE(), d), (e ? a.flip() : a).LE(f) } catch (g) { throw a.LE(f), g } }, g.encode = function (a, b, c) { return new g(a).encode(b, c) }, h.calculate = function () { return c.calculate(this) }, h.encodeDelimited = function (a) { var d; var b = !1; return a || (a = new f(), b = !0), d = (new f()).LE(), c.encode(this, d).flip(), a.writeVarint32(d.remaining()), a.append(d), b ? a.flip() : a }, h.encodeAB = function () { try { return this.encode().toArrayBuffer() } catch (a) { throw a.encoded && (a.encoded = a.encoded.toArrayBuffer()), a } }, h.toArrayBuffer = h.encodeAB, h.encodeNB = function () { try { return this.encode().toBuffer() } catch (a) { throw a.encoded && (a.encoded = a.encoded.toBuffer()), a } }, h.toBuffer = h.encodeNB, h.encode64 = function () { try { return this.encode().toBase64() } catch (a) { throw a.encoded && (a.encoded = a.encoded.toBase64()), a } }, h.toBase64 = h.encode64, h.encodeHex = function () { try { return this.encode().toHex() } catch (a) { throw a.encoded && (a.encoded = a.encoded.toHex()), a } }, h.toHex = h.encodeHex, h.toRaw = function (a, b) { return k(this, !!a, !!b, this.$type) }, h.encodeJSON = function () { return JSON.stringify(k(this, !0, !0, this.$type)) }, g.decode = function (a, b) { var d, e; typeof a === 'string' && (a = f.wrap(a, b || 'base64')), a = f.isByteBuffer(a) ? a : f.wrap(a), d = a.littleEndian; try { return e = c.decode(a.LE()), a.LE(d), e } catch (g) { throw a.LE(d), g } }, g.decodeDelimited = function (a, b) { var d, e, g; if (typeof a === 'string' && (a = f.wrap(a, b || 'base64')), a = f.isByteBuffer(a) ? a : f.wrap(a), a.remaining() < 1) return null; if (d = a.offset, e = a.readVarint32(), a.remaining() < e) return a.offset = d, null; try { return g = c.decode(a.slice(a.offset, a.offset + e).LE()), a.offset += e, g } catch (h) { throw a.offset += e, h } }, g.decode64 = function (a) { return g.decode(a, 'base64') }, g.decodeHex = function (a) { return g.decode(a, 'hex') }, g.decodeJSON = function (a) { return new g(JSON.parse(a)) }, h.toString = function () { return c.toString() }, Object.defineProperty && (Object.defineProperty(g, '$options', { value: c.buildOpt() }), Object.defineProperty(h, '$options', { value: g.$options }), Object.defineProperty(g, '$type', { value: c }), Object.defineProperty(h, '$type', { value: c })), g }(a, this)), this._fields = [], this._fieldsById = {}, this._fieldsByName = {}, e = 0, g = this.children.length; g > e; e++) if (h = this.children[e], h instanceof t || h instanceof m || h instanceof x) { if (d.hasOwnProperty(h.name)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + h.toString(!0) + \" cannot override static property '\" + h.name + \"'\"); d[h.name] = h.build(); } else if (h instanceof m.Field)h.build(), this._fields.push(h), this._fieldsById[h.id] = h, this._fieldsByName[h.name] = h; else if (!(h instanceof m.OneOf || h instanceof w)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + this.children[e].toString(!0)); return this.clazz = d }, n.encode = function (a, b, c) { var e; var h; var f; var g; var i; var d = null; for (f = 0, g = this._fields.length; g > f; ++f)e = this._fields[f], h = a[e.name], e.required && h === null ? d === null && (d = e) : e.encode(c ? h : e.verifyValue(h), b, a); if (d !== null) throw i = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + d), i.encoded = b, i; return b }, n.calculate = function (a) { for (var e, f, b = 0, c = 0, d = this._fields.length; d > c; ++c) { if (e = this._fields[c], f = a[e.name], e.required && f === null) throw Error('Missing at least one required field for ' + this.toString(!0) + ': ' + e); b += e.calculate(f, a); } return b }, n.decode = function (b, c, d) { var g, h, i, j, e, f, k, l, m, n, p, q; for (c = typeof c === 'number' ? c : -1, e = b.offset, f = new this.clazz(); b.offset < e + c || c === -1 && b.remaining() > 0;) { if (g = b.readVarint32(), h = 7 & g, i = g >>> 3, h === a.WIRE_TYPES.ENDGROUP) { if (i !== d) throw Error('Illegal group end indicator for ' + this.toString(!0) + ': ' + i + ' (' + (d ? d + ' expected' : 'not a group') + ')'); break } if (j = this._fieldsById[i])j.repeated && !j.options.packed ? f[j.name].push(j.decode(h, b)) : j.map ? (l = j.decode(h, b), f[j.name].set(l[0], l[1])) : (f[j.name] = j.decode(h, b), j.oneof && (m = f[j.oneof.name], m !== null && m !== j.name && (f[m] = null), f[j.oneof.name] = j.name)); else switch (h) { case a.WIRE_TYPES.VARINT:b.readVarint32(); break; case a.WIRE_TYPES.BITS32:b.offset += 4; break; case a.WIRE_TYPES.BITS64:b.offset += 8; break; case a.WIRE_TYPES.LDELIM:k = b.readVarint32(), b.offset += k; break; case a.WIRE_TYPES.STARTGROUP:for (;o(i, b););break; default:throw Error('Illegal wire type for unknown field ' + i + ' in ' + this.toString(!0) + '#decode: ' + h) } } for (n = 0, p = this._fields.length; p > n; ++n) if (j = this._fields[n], f[j.name] === null) if (this.syntax === 'proto3')f[j.name] = j.defaultValue; else { if (j.required) throw q = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + j.name), q.decoded = f, q; a.populateDefaults && j.defaultValue !== null && (f[j.name] = j.defaultValue); } return f }, c.Message = m, p = function (b, c, e, f, g, h, i, j, k, l) { d.call(this, b, c, h), this.className = 'Message.Field', this.required = e === 'required', this.repeated = e === 'repeated', this.map = e === 'map', this.keyType = f || null, this.type = g, this.resolvedType = null, this.id = i, this.options = j || {}, this.defaultValue = null, this.oneof = k || null, this.syntax = l || 'proto2', this.originalName = this.name, this.element = null, this.keyElement = null, !this.builder.options.convertFieldsToCamelCase || this instanceof m.ExtensionField || (this.name = a.Util.toCamelCase(this.name)); }, q = p.prototype = Object.create(d.prototype), q.build = function () { this.element = new i(this.type, this.resolvedType, !1, this.syntax), this.map && (this.keyElement = new i(this.keyType, void 0, !0, this.syntax)), this.syntax !== 'proto3' || this.repeated || this.map ? typeof this.options.default !== 'undefined' && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = i.defaultFieldValue(this.type); }, q.verifyValue = function (b, c) { var d, e, f; if (c = c || !1, d = function (a, b) { throw Error('Illegal value for ' + this.toString(!0) + ' of type ' + this.type.name + ': ' + a + ' (' + b + ')') }.bind(this), b === null) return this.required && d(typeof b, 'required'), this.syntax === 'proto3' && this.type !== a.TYPES.message && d(typeof b, 'proto3 field without field presence cannot be null'), null; if (this.repeated && !c) { for (Array.isArray(b) || (b = [b]), f = [], e = 0; e < b.length; e++)f.push(this.element.verifyValue(b[e])); return f } return this.map && !c ? b instanceof a.Map ? b : (b instanceof Object || d(typeof b, 'expected ProtoBuf.Map or raw object for map field'), new a.Map(this, b)) : (!this.repeated && Array.isArray(b) && d(typeof b, 'no array expected'), this.element.verifyValue(b)) }, q.hasWirePresence = function (b, c) { if (this.syntax !== 'proto3') return b !== null; if (this.oneof && c[this.oneof.name] === this.name) return !0; switch (this.type) { case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return b !== 0; case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return b.low !== 0 || b.high !== 0; case a.TYPES.bool:return b; case a.TYPES.float:case a.TYPES.double:return b !== 0; case a.TYPES.string:return b.length > 0; case a.TYPES.bytes:return b.remaining() > 0; case a.TYPES.enum:return b !== 0; case a.TYPES.message:return b !== null; default:return !0 } }, q.encode = function (b, c, d) { var e, g, h, i, j; if (this.type === null || typeof this.type !== 'object') throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type); if (b === null || this.repeated && b.length == 0) return c; try { if (this.repeated) if (this.options.packed && a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { for (c.writeVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), c.ensureCapacity(c.offset += 1), g = c.offset, e = 0; e < b.length; e++) this.element.encodeValue(this.id, b[e], c); h = c.offset - g, i = f.calculateVarint32(h), i > 1 && (j = c.slice(g, c.offset), g += i - 1, c.offset = g, c.append(j)), c.writeVarint32(h, g - i); } else for (e = 0; e < b.length; e++)c.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, b[e], c); else this.map ? b.forEach(function (b, d) { var g = f.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, d) + f.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, b); c.writeVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), c.writeVarint32(g), c.writeVarint32(8 | this.keyType.wireType), this.keyElement.encodeValue(1, d, c), c.writeVarint32(16 | this.type.wireType), this.element.encodeValue(2, b, c); }, this) : this.hasWirePresence(b, d) && (c.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, b, c)); } catch (k) { throw Error('Illegal value for ' + this.toString(!0) + ': ' + b + ' (' + k + ')') } return c }, q.calculate = function (b, c) { var d, e, g; if (b = this.verifyValue(b), this.type === null || typeof this.type !== 'object') throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type); if (b === null || this.repeated && b.length == 0) return 0; d = 0; try { if (this.repeated) if (this.options.packed && a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { for (d += f.calculateVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), g = 0, e = 0; e < b.length; e++)g += this.element.calculateLength(this.id, b[e]); d += f.calculateVarint32(g), d += g; } else for (e = 0; e < b.length; e++)d += f.calculateVarint32(this.id << 3 | this.type.wireType), d += this.element.calculateLength(this.id, b[e]); else this.map ? b.forEach(function (b, c) { var g = f.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, c) + f.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, b); d += f.calculateVarint32(this.id << 3 | a.WIRE_TYPES.LDELIM), d += f.calculateVarint32(g), d += g; }, this) : this.hasWirePresence(b, c) && (d += f.calculateVarint32(this.id << 3 | this.type.wireType), d += this.element.calculateLength(this.id, b)); } catch (h) { throw Error('Illegal value for ' + this.toString(!0) + ': ' + b + ' (' + h + ')') } return d }, q.decode = function (b, c, d) { var e; var f; var h; var j; var k; var l; var m; var g = !this.map && b == this.type.wireType || !d && this.repeated && this.options.packed && b == a.WIRE_TYPES.LDELIM || this.map && b == a.WIRE_TYPES.LDELIM; if (!g) throw Error('Illegal wire type for field ' + this.toString(!0) + ': ' + b + ' (' + this.type.wireType + ' expected)'); if (b == a.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !d) { for (f = c.readVarint32(), f = c.offset + f, h = []; c.offset < f;)h.push(this.decode(this.type.wireType, c, !0)); return h } if (this.map) { if (j = i.defaultFieldValue(this.keyType), e = i.defaultFieldValue(this.type), f = c.readVarint32(), c.remaining() < f) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + f + ' required but got only ' + c.remaining()); for (k = c.clone(), k.limit = k.offset + f, c.offset += f; k.remaining() > 0;) if (l = k.readVarint32(), b = 7 & l, m = l >>> 3, m === 1)j = this.keyElement.decode(k, b, m); else { if (m !== 2) throw Error('Unexpected tag in map field key/value submessage'); e = this.element.decode(k, b, m); } return [j, e] } return this.element.decode(c, b, this.id) }, c.Message.Field = p, r = function (a, b, c, d, e, f, g) { p.call(this, a, b, c, null, d, e, f, g), this.extension; }, r.prototype = Object.create(p.prototype), c.Message.ExtensionField = r, s = function (a, b, c) { d.call(this, a, b, c), this.fields = []; }, c.Message.OneOf = s, t = function (a, b, c, d, e) { g.call(this, a, b, c, d, e), this.className = 'Enum', this.object = null; }, t.getName = function (a, b) { var e; var d; var c = Object.keys(a); for (d = 0; d < c.length; ++d) if (a[e = c[d]] === b) return e; return null }, u = t.prototype = Object.create(g.prototype), u.build = function (b) { var c, d, e, f; if (this.object && !b) return this.object; for (c = new a.Builder.Enum(), d = this.getChildren(t.Value), e = 0, f = d.length; f > e; ++e)c[d[e].name] = d[e].id; return Object.defineProperty && Object.defineProperty(c, '$options', { value: this.buildOpt(), enumerable: !1 }), this.object = c }, c.Enum = t, v = function (a, b, c, e) { d.call(this, a, b, c), this.className = 'Enum.Value', this.id = e; }, v.prototype = Object.create(d.prototype), c.Enum.Value = v, w = function (a, b, c, e) { d.call(this, a, b, c), this.field = e; }, w.prototype = Object.create(d.prototype), c.Extension = w, x = function (a, b, c, d) { g.call(this, a, b, c, d), this.className = 'Service', this.clazz = null; }, y = x.prototype = Object.create(g.prototype), y.build = function (b) { return this.clazz && !b ? this.clazz : this.clazz = (function (a, b) { var g; var c = function (b) { a.Builder.Service.call(this), this.rpcImpl = b || function (a, b, c) { setTimeout(c.bind(this, Error('Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services')), 0); }; }; var d = c.prototype = Object.create(a.Builder.Service.prototype); var e = b.getChildren(a.Reflect.Service.RPCMethod); for (g = 0; g < e.length; g++)!(function (a) { d[a.name] = function (c, d) { try { try { c = a.resolvedRequestType.clazz.decode(f.wrap(c)); } catch (e) { if (!(e instanceof TypeError)) throw e } if (c === null || typeof c !== 'object') throw Error('Illegal arguments'); c instanceof a.resolvedRequestType.clazz || (c = new a.resolvedRequestType.clazz(c)), this.rpcImpl(a.fqn(), c, function (c, e) { if (c) return d(c), void 0; try { e = a.resolvedResponseType.clazz.decode(e); } catch (f) {} return e && e instanceof a.resolvedResponseType.clazz ? (d(null, e), void 0) : (d(Error('Illegal response type received in service method ' + b.name + '#' + a.name)), void 0) }); } catch (e) { setTimeout(d.bind(this, e), 0); } }, c[a.name] = function (b, d, e) { new c(b)[a.name](d, e); }, Object.defineProperty && (Object.defineProperty(c[a.name], '$options', { value: a.buildOpt() }), Object.defineProperty(d[a.name], '$options', { value: c[a.name].$options })); }(e[g])); return Object.defineProperty && (Object.defineProperty(c, '$options', { value: b.buildOpt() }), Object.defineProperty(d, '$options', { value: c.$options }), Object.defineProperty(c, '$type', { value: b }), Object.defineProperty(d, '$type', { value: b })), c }(a, this)) }, c.Service = x, z = function (a, b, c, e) { d.call(this, a, b, c), this.className = 'Service.Method', this.options = e || {}; }, A = z.prototype = Object.create(d.prototype), A.buildOpt = h.buildOpt, c.Service.Method = z, B = function (a, b, c, d, e, f, g, h) { z.call(this, a, b, c, h), this.className = 'Service.RPCMethod', this.requestName = d, this.responseName = e, this.requestStream = f, this.responseStream = g, this.resolvedRequestType = null, this.resolvedResponseType = null; }, B.prototype = Object.create(z.prototype), c.Service.RPCMethod = B, c }(e)), e.Builder = (function (a, b, c) {\n        function f (a) { a.messages && a.messages.forEach(function (b) { b.syntax = a.syntax, f(b); }), a.enums && a.enums.forEach(function (b) { b.syntax = a.syntax; }); } var d = function (a) { this.ns = new c.Namespace(this, null, ''), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = a || {}; }; var e = d.prototype; return d.isMessage = function (a) { return typeof a.name !== 'string' ? !1 : typeof a.values !== 'undefined' || typeof a.rpc !== 'undefined' ? !1 : !0 }, d.isMessageField = function (a) { return typeof a.rule !== 'string' || typeof a.name !== 'string' || typeof a.type !== 'string' || typeof a.id === 'undefined' ? !1 : !0 }, d.isEnum = function (a) { return typeof a.name !== 'string' ? !1 : typeof a.values !== 'undefined' && Array.isArray(a.values) && a.values.length !== 0 ? !0 : !1 }, d.isService = function (a) { return typeof a.name === 'string' && typeof a.rpc === 'object' && a.rpc ? !0 : !1 }, d.isExtend = function (a) { return typeof a.ref !== 'string' ? !1 : !0 }, e.reset = function () { return this.ptr = this.ns, this }, e.define = function (a) { if (typeof a !== 'string' || !b.TYPEREF.test(a)) throw Error('illegal namespace: ' + a); return a.split('.').forEach(function (a) { var b = this.ptr.getChild(a); b === null && this.ptr.addChild(b = new c.Namespace(this, this.ptr, a)), this.ptr = b; }, this), this }, e.create = function (b) {\n          var e, f, g, h, i; if (!b) return this; if (Array.isArray(b)) { if (b.length === 0) return this; b = b.slice(); } else b = [b]; for (e = [b]; e.length > 0;) {\n            if (b = e.pop(), !Array.isArray(b)) throw Error('not a valid namespace: ' + JSON.stringify(b)); for (;b.length > 0;) {\n              if (f = b.shift(), d.isMessage(f)) { if (g = new c.Message(this, this.ptr, f.name, f.options, f.isGroup, f.syntax), h = {}, f.oneofs && Object.keys(f.oneofs).forEach(function (a) { g.addChild(h[a] = new c.Message.OneOf(this, g, a)); }, this), f.fields && f.fields.forEach(function (a) { if (g.getChild(0 | a.id) !== null) throw Error('duplicate or invalid field id in ' + g.name + ': ' + a.id); if (a.options && typeof a.options !== 'object') throw Error('illegal field options in ' + g.name + '#' + a.name); var b = null; if (typeof a.oneof === 'string' && !(b = h[a.oneof])) throw Error('illegal oneof in ' + g.name + '#' + a.name + ': ' + a.oneof); a = new c.Message.Field(this, g, a.rule, a.keytype, a.type, a.name, a.id, a.options, b, f.syntax), b && b.fields.push(a), g.addChild(a); }, this), i = [], f.enums && f.enums.forEach(function (a) { i.push(a); }), f.messages && f.messages.forEach(function (a) { i.push(a); }), f.services && f.services.forEach(function (a) { i.push(a); }), f.extensions && (g.extensions = typeof f.extensions[0] === 'number' ? [f.extensions] : f.extensions), this.ptr.addChild(g), i.length > 0) { e.push(b), b = i, i = null, this.ptr = g, g = null; continue }i = null; } else if (d.isEnum(f))g = new c.Enum(this, this.ptr, f.name, f.options, f.syntax), f.values.forEach(function (a) { g.addChild(new c.Enum.Value(this, g, a.name, a.id)); }, this), this.ptr.addChild(g); else if (d.isService(f))g = new c.Service(this, this.ptr, f.name, f.options), Object.keys(f.rpc).forEach(function (a) { var b = f.rpc[a]; g.addChild(new c.Service.RPCMethod(this, g, a, b.request, b.response, !!b.request_stream, !!b.response_stream, b.options)); }, this), this.ptr.addChild(g); else {\n                if (!d.isExtend(f)) throw Error('not a valid definition: ' + JSON.stringify(f)); if (g = this.ptr.resolve(f.ref, !0)) {\n                  f.fields.forEach(function (b) {\n                    var d, e, f, h; if (g.getChild(0 | b.id) !== null) throw Error('duplicate extended field id in ' + g.name + ': ' + b.id)\n                    if (g.extensions && (d = !1, g.extensions.forEach(function (a) { b.id >= a[0] && b.id <= a[1] && (d = !0); }), !d)) throw Error('illegal extended field id in ' + g.name + ': ' + b.id + ' (not within valid ranges)'); e = b.name, this.options.convertFieldsToCamelCase && (e = a.Util.toCamelCase(e)), f = new c.Message.ExtensionField(this, g, b.rule, b.type, this.ptr.fqn() + '.' + e, b.id, b.options), h = new c.Extension(this, this.ptr, b.name, f), f.extension = h, this.ptr.addChild(h), g.addChild(f);\n                  }, this);\n                } else if (!/\\.?google\\.protobuf\\./.test(f.ref)) throw Error('extended message ' + f.ref + ' is not defined')\n              }f = null, g = null;\n            }b = null, this.ptr = this.ptr.parent;\n          } return this.resolved = !1, this.result = null, this\n        }, e.import = function (b, c) { var e; var g; var h; var i; var j; var k; var l; var m; var d = '/'; if (typeof c === 'string') { if (a.Util.IS_NODE, this.files[c] === !0) return this.reset(); this.files[c] = !0; } else if (typeof c === 'object') { if (e = c.root, a.Util.IS_NODE, (e.indexOf('\\\\') >= 0 || c.file.indexOf('\\\\') >= 0) && (d = '\\\\'), g = e + d + c.file, this.files[g] === !0) return this.reset(); this.files[g] = !0; } if (b.imports && b.imports.length > 0) { for (i = !1, typeof c === 'object' ? (this.importRoot = c.root, i = !0, h = this.importRoot, c = c.file, (h.indexOf('\\\\') >= 0 || c.indexOf('\\\\') >= 0) && (d = '\\\\')) : typeof c === 'string' ? this.importRoot ? h = this.importRoot : c.indexOf('/') >= 0 ? (h = c.replace(/\\/[^\\/]*$/, ''), h === '' && (h = '/')) : c.indexOf('\\\\') >= 0 ? (h = c.replace(/\\\\[^\\\\]*$/, ''), d = '\\\\') : h = '.' : h = null, j = 0; j < b.imports.length; j++) if (typeof b.imports[j] === 'string') { if (!h) throw Error('cannot determine import root'); if (k = b.imports[j], k === 'google/protobuf/descriptor.proto') continue; if (k = h + d + k, this.files[k] === !0) continue; if (/\\.proto$/i.test(k) && !a.DotProto && (k = k.replace(/\\.proto$/, '.json')), l = a.Util.fetch(k), l === null) throw Error(\"failed to import '\" + k + \"' in '\" + c + \"': file not found\"); /\\.json$/i.test(k) ? this.import(JSON.parse(l + ''), k) : this.import(a.DotProto.Parser.parse(l), k); } else c ? /\\.(\\w+)$/.test(c) ? this.import(b.imports[j], c.replace(/^(.+)\\.(\\w+)$/, function (a, b, c) { return b + '_import' + j + '.' + c })) : this.import(b.imports[j], c + '_import' + j) : this.import(b.imports[j]); i && (this.importRoot = null); } return b.package && this.define(b.package), b.syntax && f(b), m = this.ptr, b.options && Object.keys(b.options).forEach(function (a) { m.options[a] = b.options[a]; }), b.messages && (this.create(b.messages), this.ptr = m), b.enums && (this.create(b.enums), this.ptr = m), b.services && (this.create(b.services), this.ptr = m), b.extends && this.create(b.extends), this.reset() }, e.resolveAll = function () { var d; if (this.ptr == null || typeof this.ptr.type === 'object') return this; if (this.ptr instanceof c.Namespace) this.ptr.children.forEach(function (a) { this.ptr = a, this.resolveAll(); }, this); else if (this.ptr instanceof c.Message.Field) { if (b.TYPE.test(this.ptr.type)) this.ptr.type = a.TYPES[this.ptr.type]; else { if (!b.TYPEREF.test(this.ptr.type)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type); if (d = (this.ptr instanceof c.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0), !d) throw Error('unresolvable type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type); if (this.ptr.resolvedType = d, d instanceof c.Enum) { if (this.ptr.type = a.TYPES.enum, this.ptr.syntax === 'proto3' && d.syntax !== 'proto3') throw Error('proto3 message cannot reference proto2 enum') } else { if (!(d instanceof c.Message)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type); this.ptr.type = d.isGroup ? a.TYPES.group : a.TYPES.message; } } if (this.ptr.map) { if (!b.TYPE.test(this.ptr.keyType)) throw Error('illegal key type for map field in ' + this.ptr.toString(!0) + ': ' + this.ptr.keyType); this.ptr.keyType = a.TYPES[this.ptr.keyType]; } } else if (this.ptr instanceof a.Reflect.Service.Method) { if (!(this.ptr instanceof a.Reflect.Service.RPCMethod)) throw Error('illegal service type in ' + this.ptr.toString(!0)); if (d = this.ptr.parent.resolve(this.ptr.requestName, !0), !(d && d instanceof a.Reflect.Message)) throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.requestName); if (this.ptr.resolvedRequestType = d, d = this.ptr.parent.resolve(this.ptr.responseName, !0), !(d && d instanceof a.Reflect.Message)) throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.responseName); this.ptr.resolvedResponseType = d; } else if (!(this.ptr instanceof a.Reflect.Message.OneOf || this.ptr instanceof a.Reflect.Extension || this.ptr instanceof a.Reflect.Enum.Value)) throw Error('illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr); return this.reset() }, e.build = function (a) { var b, c, d; if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), this.result === null && (this.result = this.ns.build()), !a) return this.result; for (b = typeof a === 'string' ? a.split('.') : a, c = this.result, d = 0; d < b.length; d++) { if (!c[b[d]]) { c = null; break }c = c[b[d]]; } return c }, e.lookup = function (a, b) { return a ? this.ns.resolve(a, b) : this.ns }, e.toString = function () { return 'Builder' }, d.Message = function () {}, d.Enum = function () {}, d.Service = function () {}, d\n      }(e, e.Lang, e.Reflect)), e.Map = (function (a, b) { function e (a) { var b = 0; return { next: function () { return b < a.length ? { done: !1, value: a[b++] } : { done: !0 } } } } var c = function (a, c) { var d, e, f, g; if (!a.map) throw Error('field is not a map'); if (this.field = a, this.keyElem = new b.Element(a.keyType, null, !0, a.syntax), this.valueElem = new b.Element(a.type, a.resolvedType, !1, a.syntax), this.map = {}, Object.defineProperty(this, 'size', { get: function () { return Object.keys(this.map).length } }), c) for (d = Object.keys(c), e = 0; e < d.length; e++)f = this.keyElem.valueFromString(d[e]), g = this.valueElem.verifyValue(c[d[e]]), this.map[this.keyElem.valueToString(f)] = { key: f, value: g }; }; var d = c.prototype; return d.clear = function () { this.map = {}; }, d.delete = function (a) { var b = this.keyElem.valueToString(this.keyElem.verifyValue(a)); var c = b in this.map; return delete this.map[b], c }, d.entries = function () { var d; var c; var a = []; var b = Object.keys(this.map); for (c = 0; c < b.length; c++)a.push([(d = this.map[b[c]]).key, d.value]); return e(a) }, d.keys = function () { var c; var a = []; var b = Object.keys(this.map); for (c = 0; c < b.length; c++)a.push(this.map[b[c]].key); return e(a) }, d.values = function () { var c; var a = []; var b = Object.keys(this.map); for (c = 0; c < b.length; c++)a.push(this.map[b[c]].value); return e(a) }, d.forEach = function (a, b) { var e; var d; var c = Object.keys(this.map); for (d = 0; d < c.length; d++)a.call(b, (e = this.map[c[d]]).value, e.key, this); }, d.set = function (a, b) { var c = this.keyElem.verifyValue(a); var d = this.valueElem.verifyValue(b); return this.map[this.keyElem.valueToString(c)] = { key: c, value: d }, this }, d.get = function (a) { var b = this.keyElem.valueToString(this.keyElem.verifyValue(a)); return b in this.map ? this.map[b].value : void 0 }, d.has = function (a) { var b = this.keyElem.valueToString(this.keyElem.verifyValue(a)); return b in this.map }, c }(e, e.Reflect)), e.loadProto = function (a, b, c) { return (typeof b === 'string' || b && typeof b.file === 'string' && typeof b.root === 'string') && (c = b, b = void 0), e.loadJson(e.DotProto.Parser.parse(a), b, c) }, e.protoFromString = e.loadProto, e.loadProtoFile = function (a, b, c) { if (b && typeof b === 'object' ? (c = b, b = null) : b && typeof b === 'function' || (b = null), b) return e.Util.fetch(typeof a === 'string' ? a : a.root + '/' + a.file, function (d) { if (d === null) return b(Error('Failed to fetch file')), void 0; try { b(null, e.loadProto(d, c, a)); } catch (f) { b(f); } }); var d = e.Util.fetch(typeof a === 'object' ? a.root + '/' + a.file : a); return d === null ? null : e.loadProto(d, c, a) }, e.protoFromFile = e.loadProtoFile, e.newBuilder = function (a) { return a = a || {}, typeof a.convertFieldsToCamelCase === 'undefined' && (a.convertFieldsToCamelCase = e.convertFieldsToCamelCase), typeof a.populateAccessors === 'undefined' && (a.populateAccessors = e.populateAccessors), new e.Builder(a) }, e.loadJson = function (a, b, c) { return (typeof b === 'string' || b && typeof b.file === 'string' && typeof b.root === 'string') && (c = b, b = null), b && typeof b === 'object' || (b = e.newBuilder()), typeof a === 'string' && (a = JSON.parse(a)), b.import(a, c), b.resolveAll(), b }, e.loadJsonFile = function (a, b, c) { if (b && typeof b === 'object' ? (c = b, b = null) : b && typeof b === 'function' || (b = null), b) return e.Util.fetch(typeof a === 'string' ? a : a.root + '/' + a.file, function (d) { if (d === null) return b(Error('Failed to fetch file')), void 0; try { b(null, e.loadJson(JSON.parse(d), c, a)); } catch (f) { b(f); } }); var d = e.Util.fetch(typeof a === 'object' ? a.root + '/' + a.file : a); return d === null ? null : e.loadJson(JSON.parse(d), c, a) }, h = a, e.loadProto(h, void 0, '').build('Modules').probuf\n    }(d, c)); return e\n  }\n\n  const Codec$1 = protobuf(SSMsg$1);\n  Codec$1.getModule = (pbName) => {\n      const modules = new Codec$1[pbName]();\n      modules.getArrayData = () => {\n          let data = modules.toArrayBuffer();\n          data = isArrayBuffer(data) ? [].slice.call(new Int8Array(data)) : data;\n          return data;\n      };\n      return modules;\n  };\n\n  var ErrorCode;\n  (function (ErrorCode) {\n      /** 超时 */\n      ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n      /**\n       * 未知原因失败。\n       */\n      ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n      /** 参数错误 */\n      ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n      /**\n       * 成功\n       */\n      ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n      ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n      /**\n       * 群组 Id 无效\n       */\n      ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n      /**\n       * 发送频率过快\n       */\n      ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n      /**\n       * 不在讨论组。\n       */\n      ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n      /**\n       * 群组被禁言\n       */\n      ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n      ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n      /**\n       * 不在群组。\n       */\n      ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n      /**\n       * 不在聊天室。\n       */\n      ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n      /**\n       *聊天室被禁言\n       */\n      ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n      /**\n       * 聊天室中成员被踢出\n       */\n      ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n      /**\n       * 聊天室不存在\n       */\n      ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n      /**\n       * 聊天室成员已满\n       */\n      ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n      /**\n       * 获取聊天室信息参数无效\n       */\n      ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n      /**\n       * 聊天室异常\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n      /**\n       * 没有打开聊天室消息存储\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n      /**\n       * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n      /**\n       * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n      /**\n       * 聊天室 KV 存储功能没有开通\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n      /**\n       * 聊天室Key不存在\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n      /**\n       * 敏感词屏蔽\n       */\n      ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n      ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n      /**\n       * 加入讨论失败\n       */\n      ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n      /**\n       * 创建讨论组失败\n       */\n      ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n      /**\n       * 设置讨论组邀请状态失败\n       */\n      ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n      /**\n       *获取用户失败\n       */\n      ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n      /**\n       * 在黑名单中。\n       */\n      ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n      /**\n       * 通信过程中，当前 Socket 不存在。\n       */\n      ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n      /**\n       * Socket 连接不可用。\n       */\n      ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n      /**\n       * 通信超时。\n       */\n      ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n      /**\n       * 导航操作时，Http 请求失败。\n       */\n      ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n      /**\n       * HTTP 请求失败。\n       */\n      ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n      /**\n       * HTTP 接收失败。\n       */\n      ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n      /**\n       * 导航操作的 HTTP 请求，返回不是200。\n       */\n      ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n      /**\n       * 导航数据解析后，其中不存在有效数据。\n       */\n      ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n      /**\n       * 导航数据解析后，其中不存在有效 IP 地址。\n       */\n      ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n      /**\n       * 创建 Socket 失败。\n       */\n      ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n      /**\n       * Socket 被断开。\n       */\n      ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n      /**\n       * PING 操作失败。\n       */\n      ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n      /**\n       * PING 超时。\n       */\n      ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n      /**\n       * 消息发送失败。\n       */\n      ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n      /**\n       * JSON 后的消息体超限, 目前最大 128kb\n       */\n      ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n      /**\n       * 做 connect 连接时，收到的 ACK 超时。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n      /**\n       * 参数错误。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n      /**\n       * 参数错误，App Id 错误。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n      /**\n       * 服务器不可用。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n      /**\n       * Token 错误。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n      /**\n       * websocket 鉴权失败，通常为连接后未及时发送 Ping 或接收到 Pong\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n      /**\n       * 重定向，地址错误。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n      /**\n       * NAME 与后台注册信息不一致。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n      /**\n       * APP 被屏蔽、删除或不存在。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n      /**\n       * 用户被屏蔽。\n       */\n      ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n      /**\n       * Disconnect，由服务器返回，比如用户互踢。\n       */\n      ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n      /**\n       * Disconnect，由服务器返回，比如用户互踢。\n       */\n      ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n      /**\n       * 协议层内部错误。query，上传下载过程中数据错误。\n       */\n      ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n      /**\n       * 协议层内部错误。\n       */\n      ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n      /**\n       * 未调用 init 初始化函数。\n       */\n      ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n      /**\n       * 数据库初始化失败。\n       */\n      ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n      /**\n       * 传入参数无效。\n       */\n      ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n      /**\n       * 通道无效。\n       */\n      ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n      /**\n       * 重新连接成功。\n       */\n      ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n      /**\n       * 连接中，再调用 connect 被拒绝。\n       */\n      ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n      /**\n       * 消息漫游服务未开通\n       */\n      ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n      ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n      ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n      /**\n       * 删除会话失败\n       */\n      ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n      /**\n       *拉取历史消息\n       */\n      ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n      /**\n       * 会话指定异常\n       */\n      ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n      /**\n       * 获取会话未读消息总数失败\n       */\n      ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n      /**\n       * 获取指定会话类型未读消息数异常\n       */\n      ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n      /**\n       * 获取指定用户ID&会话类型未读消息数异常\n       */\n      ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n      ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n      /**\n       * 扩展存储 key value 超出限制 (错误码与移动端对齐)\n      */\n      ErrorCode[ErrorCode[\"EXPANSION_LIMIT_EXCEET\"] = 34010] = \"EXPANSION_LIMIT_EXCEET\";\n      /**\n       * 消息不支持扩展 (错误码与移动端对齐)\n      */\n      ErrorCode[ErrorCode[\"MESSAGE_KV_NOT_SUPPORT\"] = 34008] = \"MESSAGE_KV_NOT_SUPPORT\";\n      ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n      ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n      /**\n       * 群组信息异常\n       */\n      ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n      /**\n       * 匹配群信息异常\n       */\n      ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n      // 聊天室异常\n      /**\n       * 加入聊天室Id为空\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n      /**\n       * 加入聊天室失败\n       */\n      ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n      /**\n       * 拉取聊天室历史消息失败\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n      /**\n       * 聊天室 kv 未找到\n       */\n      ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n      // 黑名单异常\n      /**\n       * 加入黑名单异常\n       */\n      ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n      /**\n       * 获得指定人员再黑名单中的状态异常\n       */\n      ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n      /**\n       * 移除黑名单异常\n       */\n      ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n      /**\n       * 获取草稿失败\n       */\n      ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n      /**\n       * 保存草稿失败\n       */\n      ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n      /**\n       * 删除草稿失败\n       */\n      ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n      /**\n       * 关注公众号失败\n       */\n      ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n      /**\n       * 方法未支持\n       */\n      ErrorCode[ErrorCode[\"NOT_SUPPORT\"] = 39002] = \"NOT_SUPPORT\";\n      /**\n       * 关注公众号失败\n       */\n      ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n      /**\n       * 获取七牛token失败\n       */\n      ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n      /**\n       * cookie被禁用\n       */\n      ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n      ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n      // 没有注册DeviveId 也就是用户没有登陆\n      ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n      // 已经存在\n      ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n      // 没有对应的用户或token\n      ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n      // voip为空\n      ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n      // 不支持的Voip引擎\n      ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n      // channleName 是空\n      ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n      // 生成Voipkey失败\n      ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n      // 没有配置voip\n      ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n      // 服务器内部错误\n      ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n      // VOIP close\n      ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n      ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n      ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n      ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n      ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n      /**\n       * 删除消息数组长度为 0 .\n       */\n      ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n      /**\n       * 己方取消已发出的通话请求\n       */\n      ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n      /**\n       * 己方拒绝收到的通话请求\n       */\n      ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n      /**\n       * 己方挂断\n       */\n      ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n      /**\n       * 己方忙碌\n       */\n      ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n      /**\n       * 己方未接听\n       */\n      ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n      /**\n       * 己方不支持当前引擎\n       */\n      ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n      /**\n       * 己方网络出错\n       */\n      ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n      /**\n       * 对方取消已发出的通话请求\n       */\n      ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n      /**\n       * 对方拒绝收到的通话请求\n       */\n      ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n      /**\n       * 通话过程对方挂断\n       */\n      ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n      /**\n       * 对方忙碌\n       */\n      ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n      /**\n       * 对方未接听\n       */\n      ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n      /**\n       * 对方网络错误\n       */\n      ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n      /**\n       * 对方网络错误\n       */\n      ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n      /**\n       * VoIP 不可用\n       */\n      ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n  })(ErrorCode || (ErrorCode = {}));\n  var ErrorCode$1 = ErrorCode;\n\n  const timerSetTimeout = (fun, itv) => {\n      return setTimeout(fun, itv);\n  };\n  const int64ToTimestamp = (obj) => {\n      if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n          return obj;\n      }\n      let low = obj.low;\n      if (low < 0) {\n          low += 0xffffffff + 1;\n      }\n      low = low.toString(16);\n      const timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n      return timestamp;\n  };\n  const batchInt64ToTimestamp = (data) => {\n      for (const key in data) {\n          if (isObject(data[key])) {\n              data[key] = int64ToTimestamp(data[key]);\n          }\n      }\n      return data;\n  };\n  const formatDate = (seperator) => {\n      seperator = seperator || '-';\n      const date = new Date();\n      const year = date.getFullYear();\n      const month = date.getMonth() + 1;\n      const day = date.getDate();\n      return `${year}${seperator}${month}${seperator}${day}`;\n  };\n\n  /**\n   * 群组 @ 类型\n  */\n  var MentionedType;\n  (function (MentionedType) {\n      /**\n       * 所有人\n      */\n      MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n      /**\n       * 部分人\n      */\n      MentionedType[MentionedType[\"SINGAL\"] = 2] = \"SINGAL\";\n  })(MentionedType || (MentionedType = {}));\n  var MentionedType$1 = MentionedType;\n\n  /**\n   * 内置消息类型\n   */\n  var MessageType;\n  (function (MessageType) {\n      /**\n       * 文字消息\n      */\n      MessageType[\"TextMessage\"] = \"RC:TxtMsg\";\n      /**\n       * 语音消息\n      */\n      MessageType[\"VOICE\"] = \"RC:VcMsg\";\n      /**\n       * 高质量消息\n      */\n      MessageType[\"HQ_VOICE\"] = \"RC:HQVCMsg\";\n      /**\n       * 图片消息\n      */\n      MessageType[\"IMAGE\"] = \"RC:ImgMsg\";\n      /**\n       * GIF 消息\n      */\n      MessageType[\"GIF\"] = \"RC:GIFMsg\";\n      /**\n       * 图文消息\n      */\n      MessageType[\"RICH_CONTENT\"] = \"RC:ImgTextMsg\";\n      /**\n       * 位置消息\n      */\n      MessageType[\"LOCATION\"] = \"RC:LBSMsg\";\n      /**\n       * 文件消息\n      */\n      MessageType[\"FILE\"] = \"RC:FileMsg\";\n      /**\n       * 小视频消息\n      */\n      MessageType[\"SIGHT\"] = \"RC:SightMsg\";\n      /**\n       * 合并转发消息\n      */\n      MessageType[\"COMBINE\"] = \"RC:CombineMsg\";\n      /**\n       * 聊天室 KV 通知消息\n      */\n      MessageType[\"CHRM_KV_NOTIFY\"] = \"RC:chrmKVNotiMsg\";\n      /**\n       * 日志通知消息\n      */\n      MessageType[\"LOG_COMMAND\"] = \"RC:LogCmdMsg\";\n      /**\n       * 消息扩展\n      */\n      MessageType[\"EXPANSION_NOTIFY\"] = \"RC:MsgExMsg\";\n      /**\n       * 引用消息\n      */\n      MessageType[\"REFERENCE\"] = \"RC:ReferenceMsg\";\n      /**\n       * 撤回消息\n      */\n      MessageType[\"RECALL\"] = \"RC:RcCmd\";\n      /**\n       * 已读同步状态消息\n      */\n      MessageType[\"READ_RECEIPT\"] = \"RC:ReadNtf\";\n      /**\n       * 群已读请求回执消息\n      */\n      MessageType[\"READ_RECEIPT_REQUEST\"] = \"RC:RRReqMsg\";\n      /**\n       * 群已读响应回执消息\n      */\n      MessageType[\"READ_RECEIPT_RESPONSE\"] = \"RC:RRRspMsg\";\n      /**\n       * TODO\n      */\n      MessageType[\"SYNC_READ_STATUS\"] = \"RC:SRSMsg\";\n  })(MessageType || (MessageType = {}));\n  var MessageType$1 = MessageType;\n\n  var NotificationStatus;\n  (function (NotificationStatus) {\n      /**\n       * 免打扰已开启\n      */\n      NotificationStatus[NotificationStatus[\"OPEN\"] = 1] = \"OPEN\";\n      /**\n       * 免打扰已关闭\n      */\n      NotificationStatus[NotificationStatus[\"CLOSE\"] = 2] = \"CLOSE\";\n  })(NotificationStatus || (NotificationStatus = {}));\n  var NotificationStatus$1 = NotificationStatus;\n\n  const PublishTopic = {\n      // 以下为发送消息操作, 本端发送、其他端同步都为以下值\n      PRIVATE: 'ppMsgP',\n      GROUP: 'pgMsgP',\n      CHATROOM: 'chatMsg',\n      CUSTOMER_SERVICE: 'pcMsgP',\n      RECALL: 'recallMsg',\n      // RTC 消息\n      RTC_MSG: 'prMsgS',\n      // 以下为服务端通知操作\n      NOTIFY_PULL_MSG: 's_ntf',\n      RECEIVE_MSG: 's_msg',\n      SYNC_STATUS: 's_stat',\n      SERVER_NOTIFY: 's_cmd',\n      SETTING_NOTIFY: 's_us' // 服务端配置变更通知\n  };\n  // 状态消息\n  const PublishStatusTopic = {\n      PRIVATE: 'ppMsgS',\n      GROUP: 'pgMsgS',\n      CHATROOM: 'chatMsgS'\n  };\n  const QueryTopic = {\n      GET_SYNC_TIME: 'qrySessionsAtt',\n      PULL_MSG: 'pullMsg',\n      GET_CONVERSATION_LIST: 'qrySessions',\n      REMOVE_CONVERSATION_LIST: 'delSessions',\n      DELETE_MESSAGES: 'delMsg',\n      CLEAR_UNREAD_COUNT: 'updRRTime',\n      PULL_USER_SETTING: 'pullUS',\n      PULL_CHRM_MSG: 'chrmPull',\n      JOIN_CHATROOM: 'joinChrm',\n      JOIN_EXIST_CHATROOM: 'joinChrmR',\n      QUIT_CHATROOM: 'exitChrm',\n      GET_CHATROOM_INFO: 'queryChrmI',\n      UPDATE_CHATROOM_KV: 'setKV',\n      DELETE_CHATROOM_KV: 'delKV',\n      PULL_CHATROOM_KV: 'pullKV',\n      GET_OLD_CONVERSATION_LIST: 'qryRelationR',\n      REMOVE_OLD_CONVERSATION: 'delRelation',\n      GET_CONVERSATION_STATUS: 'pullSeAtts',\n      SET_CONVERSATION_STATUS: 'setSeAtt',\n      GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n      GET_UPLOAD_FILE_URL: 'qnUrl',\n      CLEAR_MESSAGES: {\n          PRIVATE: 'cleanPMsg',\n          GROUP: 'cleanGMsg',\n          CUSTOMER_SERVICE: 'cleanCMsg',\n          SYSTEM: 'cleanSMsg'\n      },\n      // 以下为 RTC 操作\n      JOIN_RTC_ROOM: 'rtcRJoin_data',\n      QUIT_RTC_ROOM: 'rtcRExit',\n      PING_RTC: 'rtcPing',\n      SET_RTC_DATA: 'rtcSetData',\n      USER_SET_RTC_DATA: 'userSetData',\n      GET_RTC_DATA: 'rtcQryData',\n      DEL_RTC_DATA: 'rtcDelData',\n      SET_RTC_OUT_DATA: 'rtcSetOutData',\n      GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n      GET_RTC_TOKEN: 'rtcToken',\n      SET_RTC_STATE: 'rtcUserState',\n      GET_RTC_ROOM_INFO: 'rtcRInfo',\n      GET_RTC_USER_INFO_LIST: 'rtcUData',\n      SET_RTC_USER_INFO: 'rtcUPut',\n      DEL_RTC_USER_INFO: 'rtcUDel',\n      GET_RTC_USER_LIST: 'rtcUList'\n  };\n  const QueryHistoryTopic = {\n      PRIVATE: 'qryPMsg',\n      GROUP: 'qryGMsg',\n      CHATROOM: 'qryCHMsg',\n      CUSTOMER_SERVICE: 'qryCMsg',\n      SYSTEM: 'qrySMsg'\n  };\n  const PublishTopicToConversationType = {\n      [PublishTopic.PRIVATE]: ConversationType$1.PRIVATE,\n      [PublishTopic.GROUP]: ConversationType$1.GROUP,\n      [PublishTopic.CHATROOM]: ConversationType$1.CHATROOM,\n      [PublishTopic.CUSTOMER_SERVICE]: ConversationType$1.CUSTOMER_SERVICE\n  };\n  const ConversationTypeToQueryHistoryTopic = {\n      [ConversationType$1.PRIVATE]: QueryHistoryTopic.PRIVATE,\n      [ConversationType$1.GROUP]: QueryHistoryTopic.GROUP,\n      [ConversationType$1.CHATROOM]: QueryHistoryTopic.CHATROOM,\n      [ConversationType$1.CUSTOMER_SERVICE]: QueryHistoryTopic.CUSTOMER_SERVICE,\n      [ConversationType$1.SYSTEM]: QueryHistoryTopic.SYSTEM\n  };\n  const ConversationTypeToClearMessageTopic = {\n      [ConversationType$1.PRIVATE]: QueryTopic.CLEAR_MESSAGES.PRIVATE,\n      [ConversationType$1.GROUP]: QueryTopic.CLEAR_MESSAGES.GROUP,\n      [ConversationType$1.CUSTOMER_SERVICE]: QueryTopic.CLEAR_MESSAGES.CUSTOMER_SERVICE,\n      [ConversationType$1.SYSTEM]: QueryTopic.CLEAR_MESSAGES.SYSTEM\n  };\n  const ConversationStatusConfig = {\n      ENABLED: '1',\n      DISABLED: '0'\n  };\n  const ConversationStatusType = {\n      DO_NOT_DISTURB: 1,\n      TOP: 2\n  };\n\n  var MessageDirection;\n  (function (MessageDirection) {\n      /**\n       * 己方发送消息\n       */\n      MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n      /**\n       * 己方接收消息\n       */\n      MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n  })(MessageDirection || (MessageDirection = {}));\n  var MessageDirection$1 = MessageDirection;\n\n  /**\n   * 序列化、反序列化数据通道\n  */\n  class DataCodec {\n      constructor(connectType) {\n          this._codec = connectType === 'websocket' ? Codec$1 : Codec;\n          this._connectType = connectType;\n      }\n      /**\n       * PB 数据 转为 rmtp 数据 反序列化 通用数据\n       * 根据解析的 PBName 分配解码方法. 如果没有单独的解码方法定义. 直接返回 pb 解析后的结果\n      */\n      decodeByPBName(data, pbName, option) {\n          const self = this;\n          const formatEventMap = {\n              [PBName.DownStreamMessages]: self._formatSyncMessages,\n              [PBName.DownStreamMessage]: self._formatReceivedMessage,\n              [PBName.UpStreamMessage]: self._formatSentMessage,\n              [PBName.HistoryMsgOuput]: self._formatHistoryMessages,\n              [PBName.RelationsOutput]: self._formatConversationList,\n              [PBName.QueryChatRoomInfoOutput]: self._formatChatRoomInfos,\n              [PBName.RtcUserListOutput]: self._formatRTCUserList,\n              [PBName.RtcQryOutput]: self._formatRTCData,\n              [PBName.ChrmKVOutput]: self._formatChatRoomKVList,\n              [PBName.PullUserSettingOutput]: self._formatUserSetting,\n              [PBName.SessionStates]: self._formatConversationStatus\n          };\n          let decodedData = data;\n          const formatEvent = formatEventMap[pbName];\n          try {\n              const hasData = data.length > 0; // 判断是否有数据, 防止无数据 pb 解析报错\n              decodedData = hasData && self._codec[pbName].decode(data); // pb 解析\n              if (isObject(decodedData)) {\n                  decodedData = batchInt64ToTimestamp(decodedData); // 时间转化\n              }\n              if (isFunction(formatEvent)) {\n                  decodedData = formatEvent.call(this, decodedData, option); // 数据格式化\n              }\n          }\n          catch (e) {\n              logger.error('PB parse error\\n', e);\n          }\n          return decodedData;\n      }\n      _readBytes(content) {\n          const { offset, buffer, limit } = content;\n          if (offset) {\n              try {\n                  const content = isArrayBuffer(buffer) ? new Uint8Array(buffer) : buffer;\n                  // content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit)\n                  return BinaryHelper.readUTF(content.subarray(offset, limit));\n              }\n              catch (e) {\n                  logger.info('readBytes error\\n', e);\n              }\n          }\n          return content;\n      }\n      /**\n       * ====== 以下为 rmtp 数据 反序列化为 可用数据 ======\n       */\n      _formatBytes(content) {\n          // 1. socket 下, content.buffer 为二进制 ArrayBuffer, 需调用 ArrayBufferToUint8Array 转换\n          // 2. comet 下, content 为 JSON 字符串. socket、comet 解析后都需要 JSON to Object\n          let formatRes = this._readBytes(content);\n          try {\n              formatRes = JSON.parse(formatRes);\n          }\n          catch (e) {\n              logger.info('formatBytes error\\n', e);\n          }\n          return formatRes || content;\n      }\n      /**\n       * 格式化多端同步消息\n      */\n      _formatSyncMessages(data, option) {\n          option = option || {};\n          const self = this;\n          const { list, syncTime, finished } = data;\n          // Comet 与 聊天室没有 finished 字段定义，默认为 true\n          if (isUndefined(finished) || finished === null) {\n              data.finished = true;\n          }\n          data.syncTime = int64ToTimestamp(syncTime);\n          data.list = map(list, (msgData) => {\n              const message = self._formatReceivedMessage(msgData, option);\n              return message;\n          });\n          return data;\n      }\n      /**\n       * 格式化接收消息\n      */\n      _formatReceivedMessage(data, option) {\n          // TODO: 需杜绝此类传参，参数在进入方法前进行类型值确认\n          option = option || {};\n          const self = this;\n          const { currentUserId, connectedTime } = option;\n          const { content, fromUserId, type, groupId, status, dataTime, classname: messageType, msgId: messageUId, extraContent } = data;\n          const direction = data.direction || MessageDirection$1.RECEIVE; // null || 0 都为收件箱\n          const isSelfSend = direction === MessageDirection$1.SEND;\n          const { isPersited, isCounted, isMentioned, disableNotification, receivedStatus, canIncludeExpansion } = getMessageOptionByStatus(status);\n          const targetId = type === ConversationType$1.GROUP || type === ConversationType$1.CHATROOM ? groupId : fromUserId;\n          const senderUserId = isSelfSend ? currentUserId : fromUserId;\n          const sentTime = int64ToTimestamp(dataTime);\n          const isOffLineMessage = sentTime < connectedTime;\n          const isChatRoomMsg = type === ConversationType$1.CHATROOM;\n          const utfContent = self._formatBytes(content);\n          let messageDirection = isSelfSend ? MessageDirection$1.SEND : MessageDirection$1.RECEIVE;\n          // 聊天室拉消息时, 自己发送的消息, direction 也为 null\n          if (isChatRoomMsg && (fromUserId === currentUserId)) {\n              messageDirection = MessageDirection$1.SEND;\n          }\n          let expansion;\n          if (extraContent) {\n              expansion = {};\n              expansion = formatExtraContent(extraContent);\n          }\n          return {\n              conversationType: type,\n              targetId,\n              senderUserId,\n              messageType,\n              messageUId,\n              isPersited,\n              isCounted,\n              isMentioned,\n              sentTime,\n              isOffLineMessage,\n              messageDirection,\n              receivedTime: DelayTimer.getTime(),\n              disableNotification,\n              receivedStatus,\n              canIncludeExpansion,\n              content: utfContent,\n              expansion\n          };\n      }\n      /**\n       * 格式化发送消息\n      */\n      _formatSentMessage(data, option) {\n          const self = this;\n          const { content, classname: messageType, sessionId, msgId: messageUId, extraContent } = data;\n          const { signal, currentUserId } = option;\n          const { date, topic, targetId } = signal;\n          const { isPersited, isCounted, disableNotification, canIncludeExpansion } = getUpMessageOptionBySessionId(sessionId);\n          const type = PublishTopicToConversationType[topic] || ConversationType$1.PRIVATE;\n          const isStatusMessage = isInObject(PublishStatusTopic, topic);\n          let expansion;\n          if (extraContent) {\n              expansion = {};\n              expansion = formatExtraContent(extraContent);\n          }\n          return {\n              conversationType: type,\n              targetId,\n              messageType,\n              messageUId,\n              isPersited,\n              isCounted,\n              isStatusMessage,\n              senderUserId: currentUserId,\n              content: self._formatBytes(content),\n              sentTime: date * 1000,\n              receivedTime: DelayTimer.getTime(),\n              messageDirection: MessageDirection$1.SEND,\n              isOffLineMessage: false,\n              disableNotification,\n              canIncludeExpansion,\n              expansion // 消息携带的 KV 字段\n          };\n      }\n      /**\n       * 格式化历史消息\n      */\n      _formatHistoryMessages(data, option) {\n          const conversation = option.conversation || {};\n          const { list: msgList, hasMsg } = data;\n          const targetId = conversation.targetId;\n          const syncTime = int64ToTimestamp(data.syncTime);\n          const list = [];\n          forEach(msgList, (msgData) => {\n              const msg = this._formatReceivedMessage(msgData, option);\n              msg.targetId = targetId;\n              list.push(msg);\n          }, {\n              isReverse: true\n          });\n          return { syncTime, list, hasMore: !!hasMsg };\n      }\n      /**\n       * 格式化会话列表\n      */\n      _formatConversationList(serverData, option) {\n          const self = this;\n          let { info: conversationList } = serverData;\n          const afterDecode = option.afterDecode || function () { };\n          conversationList = map(conversationList, (serverConversation) => {\n              const { msg, userId, type, unreadCount } = serverConversation;\n              const latestMessage = self._formatReceivedMessage(msg, option);\n              latestMessage.targetId = userId;\n              const conversation = {\n                  targetId: userId,\n                  conversationType: type,\n                  unreadMessageCount: unreadCount,\n                  latestMessage\n              };\n              return afterDecode(conversation) || conversation;\n          });\n          return conversationList || [];\n      }\n      /**\n       * 格式化聊天室信息\n      */\n      _formatChatRoomInfos(data) {\n          const { userTotalNums, userInfos } = data;\n          const chrmInfos = map(userInfos, (user) => {\n              const { id, time } = user;\n              const timestamp = int64ToTimestamp(time);\n              return { id, time: timestamp };\n          });\n          return {\n              userCount: userTotalNums,\n              userInfos: chrmInfos\n          };\n      }\n      /**\n       * 格式化 聊天室 KV 列表\n      */\n      _formatChatRoomKVList(data) {\n          let { entries: kvEntries, bFullUpdate: isFullUpdate, syncTime } = data;\n          kvEntries = kvEntries || [];\n          kvEntries = map(kvEntries, (kv) => {\n              const { key, value, status, timestamp, uid } = kv;\n              const { isAutoDelete, isOverwrite, type } = getChatRoomKVByStatus(status);\n              return {\n                  key,\n                  value,\n                  isAutoDelete,\n                  isOverwrite,\n                  type,\n                  userId: uid,\n                  timestamp: int64ToTimestamp(timestamp)\n              };\n          });\n          return {\n              kvEntries, isFullUpdate, syncTime\n          };\n      }\n      /**\n       * 格式化 用户设置\n      */\n      _formatUserSetting(data) {\n          const { items, version } = data;\n          const settings = {};\n          forEach(items || [], (setting) => {\n              const { key, version, value } = setting;\n              setting.version = int64ToTimestamp(version);\n              setting.value = this._readBytes(value);\n              settings[key] = setting;\n          });\n          return { settings, version };\n      }\n      /**\n       * 格式化 会话状态 置顶、免打扰）\n      */\n      _formatConversationStatus(data) {\n          const { state: stateList } = data;\n          const statusList = [];\n          forEach(stateList, (session) => {\n              const { type, channelId: targetId, time: updatedTime, stateItem } = session;\n              let notificationStatus = NotificationStatus$1.CLOSE;\n              let isTop = false;\n              forEach(stateItem, (item) => {\n                  const { sessionStateType, value } = item;\n                  switch (sessionStateType) {\n                      case ConversationStatusType.DO_NOT_DISTURB:\n                          notificationStatus = value === ConversationStatusConfig.ENABLED ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE;\n                          break;\n                      case ConversationStatusType.TOP:\n                          isTop = value === ConversationStatusConfig.ENABLED;\n                          break;\n                  }\n              });\n              statusList.push({\n                  type,\n                  targetId,\n                  notificationStatus,\n                  isTop,\n                  updatedTime: int64ToTimestamp(updatedTime)\n              });\n          });\n          return statusList;\n      }\n      /**\n       * 格式化 RTC 用户列表\n      */\n      _formatRTCUserList(rtcInfos) {\n          const { list, token, sessionId } = rtcInfos;\n          const users = {};\n          forEach(list, (item) => {\n              const { userId, userData } = item;\n              const tmpData = {};\n              forEach(userData, (data) => {\n                  const { key, value } = data;\n                  tmpData[key] = value;\n              });\n              users[userId] = tmpData;\n          });\n          return { users, token, sessionId };\n      }\n      /**\n        * 格式化 RTC 数据\n      */\n      _formatRTCData(data) {\n          const { outInfo: list } = data;\n          const props = {};\n          forEach(list, (item) => {\n              props[item.key] = item.value;\n          });\n          return props;\n      }\n      /**\n        * 格式化 RTC 房间信息\n      */\n      _formatRTCRoomInfo(data) {\n          const { roomId: id, userCount: total, roomData } = data;\n          const room = {\n              id, total\n          };\n          forEach(roomData, (data) => {\n              room[data.key] = data.value;\n          });\n          return room;\n      }\n      /**\n       * ===== 以下为通用数据 序列化为 PB 数据 =====\n       * Engine Index 调用处理数据\n      */\n      /**\n       * ? 待补全注释\n      */\n      encodeServerConfParams() {\n          const modules = this._codec.getModule(PBName.SessionsAttQryInput);\n          modules.setNothing(1);\n          return modules.getArrayData();\n      }\n      /**\n       * 上行消息基础配置\n      */\n      _getUpMsgModule(conversation, option) {\n          const { type } = conversation;\n          const { messageType, isMentioned, mentionedType, mentionedUserIdList, content, pushContent, pushData, directionalUserIdList, isFilerWhiteBlacklist, isVoipPush, canIncludeExpansion, expansion } = option;\n          const isGroupType = type === ConversationType$1.GROUP;\n          const modules = this._codec.getModule(PBName.UpStreamMessage);\n          const sessionId = getSessionId(option);\n          let flag = 0;\n          modules.setSessionId(sessionId);\n          if (isGroupType && isMentioned && content) {\n              content.mentionedInfo = {\n                  userIdList: mentionedUserIdList,\n                  type: mentionedType || MentionedType$1.ALL\n              };\n          }\n          pushContent && modules.setPushText(pushContent); // 设置 pushContent\n          pushData && modules.setAppData(pushData); // 设置 pushData\n          directionalUserIdList && modules.setUserId(directionalUserIdList); // 设置群定向消息人员\n          // 设置 flag. 涉及业务: 1、iOS VoipPush  2、过滤黑/白名单\n          flag |= (isVoipPush ? 0x01 : 0);\n          flag |= (isFilerWhiteBlacklist ? 0x02 : 0);\n          modules.setConfigFlag(flag);\n          modules.setClassname(messageType); // 设置 objectName\n          modules.setContent(JSON.stringify(content));\n          if (canIncludeExpansion && expansion) {\n              const extraContent = {};\n              forEach(expansion, (val, key) => {\n                  extraContent[key] = { v: val };\n              });\n              modules.setExtraContent(JSON.stringify(extraContent)); // 设置消息扩展内容\n          }\n          return modules;\n      }\n      /**\n       * 序列化上行消息\n      */\n      encodeUpMsg(conversation, option) {\n          const modules = this._getUpMsgModule(conversation, option);\n          return modules.getArrayData();\n      }\n      /**\n       * 序列化拉取多端消息\n      */\n      encodeSyncMsg(syncMsgArgs) {\n          const { sendboxTime, inboxTime } = syncMsgArgs;\n          const modules = this._codec.getModule(PBName.SyncRequestMsg);\n          modules.setIspolling(false);\n          modules.setIsPullSend(true);\n          modules.setSendBoxSyncTime(sendboxTime);\n          modules.setSyncTime(inboxTime);\n          return modules.getArrayData();\n      }\n      /**\n       * 序列化拉取聊天室消息\n      */\n      encodeChrmSyncMsg(time, count) {\n          time = time || 0;\n          count = count || 0;\n          const modules = this._codec.getModule(PBName.ChrmPullMsg);\n          modules.setCount(count);\n          modules.setSyncTime(time);\n          return modules.getArrayData();\n      }\n      /**\n       * 序列化历史消息\n      */\n      encodeGetHistoryMsg(targetId, option) {\n          const { count, order, timestamp } = option;\n          const modules = this._codec.getModule(PBName.HistoryMsgInput);\n          modules.setTargetId(targetId);\n          modules.setTime(timestamp);\n          modules.setCount(count);\n          modules.setOrder(order);\n          return modules.getArrayData();\n      }\n      /**\n       * 序列化会话列表\n      */\n      encodeGetConversationList(option) {\n          option = option || {};\n          const { count, startTime } = option;\n          const modules = this._codec.getModule(PBName.RelationQryInput);\n          // 默认值已在 modules 暴露层赋值. 传入此处, 必有值\n          modules.setType(1); // type 可传任意值\n          modules.setCount(count);\n          modules.setStartTime(startTime);\n          return modules.getArrayData();\n      }\n      /**\n       * 旧会话列表. 获取、删除都调用此方法\n      */\n      encodeOldConversationList(option) {\n          option = option || {};\n          let { count, type, startTime, order } = option;\n          count = count || 0; // 删除会话列表 count 传 0 , setCount 形参 count 为必填参数\n          startTime = startTime || 0;\n          order = order || 0;\n          const modules = this._codec.getModule(PBName.RelationQryInput);\n          modules.setType(type);\n          modules.setCount(count);\n          modules.setStartTime(startTime);\n          modules.setOrder(order);\n          return modules.getArrayData();\n      }\n      /**\n       * 旧会话列表删除\n      */\n      encodeRemoveConversationList(conversationList) {\n          const modules = this._codec.getModule(PBName.DeleteSessionsInput);\n          const sessions = [];\n          forEach(conversationList, (conversation) => {\n              const { type, targetId } = conversation;\n              const session = this._codec.getModule(PBName.SessionInfo);\n              session.setType(type);\n              session.setChannelId(targetId);\n              sessions.push(session);\n          });\n          modules.setSessions(sessions);\n          return modules.getArrayData();\n      }\n      /**\n       * 批量删除消息通过消息 ID\n      */\n      encodeDeleteMessages(conversationType, targetId, list) {\n          const modules = this._codec.getModule(PBName.DeleteMsgInput);\n          const encodeMsgs = [];\n          forEach(list, (message) => {\n              encodeMsgs.push({\n                  msgId: message.messageUId,\n                  msgDataTime: message.sentTime,\n                  direct: message.messageDirection\n              });\n          });\n          modules.setType(conversationType);\n          modules.setConversationId(targetId);\n          modules.setMsgs(encodeMsgs);\n          return modules.getArrayData();\n      }\n      /**\n       * 批量删除消息通过时间\n      */\n      encodeClearMessages(targetId, timestamp) {\n          const modules = this._codec.getModule(PBName.CleanHisMsgInput);\n          timestamp = timestamp || new Date().getTime(); // 默认当前时间\n          modules.setDataTime(timestamp);\n          modules.setTargetId(targetId);\n          return modules.getArrayData();\n      }\n      /**\n       * 未读数清除\n      */\n      encodeClearUnreadCount(conversation, option) {\n          const { type, targetId } = conversation;\n          let { timestamp } = option;\n          const modules = this._codec.getModule(PBName.SessionMsgReadInput);\n          timestamp = timestamp || +new Date();\n          modules.setType(type);\n          modules.setChannelId(targetId);\n          modules.setMsgTime(timestamp);\n          return modules.getArrayData();\n      }\n      /**\n       * 加入退出聊天室\n      */\n      encodeJoinOrQuitChatRoom() {\n          const modules = this._codec.getModule(PBName.ChrmInput);\n          modules.setNothing(1);\n          return modules.getArrayData();\n      }\n      /**\n       * 获取聊天室信息\n       * @param count 获取人数\n       * @param order 排序方式\n      */\n      encodeGetChatRoomInfo(count, order) {\n          const modules = this._codec.getModule(PBName.QueryChatRoomInfoInput);\n          modules.setCount(count);\n          modules.setOrder(order);\n          return modules.getArrayData();\n      }\n      /**\n       * 上传文件认证信息获取\n      */\n      encodeGetFileToken(fileType, fileName) {\n          const modules = this._codec.getModule(PBName.GetQNupTokenInput);\n          modules.setType(fileType);\n          modules.setKey(fileName);\n          return modules.getArrayData();\n      }\n      /**\n        * 获取七牛上传url\n      */\n      encodeGetFileUrl(inputPBName, fileType, fileName, originName) {\n          const modules = this._codec.getModule(inputPBName);\n          modules.setType(fileType);\n          modules.setKey(fileName);\n          if (originName) {\n              modules.setFileName(originName);\n          }\n          return modules.getArrayData();\n      }\n      /**\n        * 聊天室 KV 存储\n      */\n      encodeModifyChatRoomKV(chrmId, entry, currentUserId) {\n          const isComet = this._connectType === 'comet';\n          const modules = this._codec.getModule(PBName.SetChrmKV);\n          const { key, value, notificationExtra: extra, isSendNotification, type } = entry;\n          const action = type || ChatroomEntryType$1.UPDATE;\n          const status = getChatRoomKVOptStatus(entry, action);\n          const serverEntry = {\n              key,\n              value: value || '',\n              uid: currentUserId\n          };\n          // 若 status 传空, server 会出问题\n          if (!isUndefined(status)) {\n              serverEntry.status = status;\n          }\n          modules.setEntry(serverEntry);\n          if (isSendNotification) { // 如果需要发送通知, 设置通知消息\n              const conversation = {\n                  type: ConversationType$1.CHATROOM,\n                  targetId: chrmId\n              };\n              const msgContent = { key, value, extra, type: action };\n              // 通知消息内置, 由 Server 自动发送\n              const msgModule = this._getUpMsgModule(conversation, {\n                  messageType: MessageType$1.CHRM_KV_NOTIFY,\n                  content: msgContent,\n                  isPersited: false,\n                  isCounted: false\n              });\n              isComet ? modules.setNotification(msgModule.getArrayData()) : modules.setNotification(msgModule);\n              modules.setBNotify(true);\n              modules.setType(ConversationType$1.CHATROOM);\n          }\n          return modules.getArrayData();\n      }\n      /**\n        * KV 存储拉取\n      */\n      encodePullChatRoomKV(time) {\n          const modules = this._codec.getModule(PBName.QueryChrmKV);\n          modules.setTimestamp(time);\n          return modules.getArrayData();\n      }\n      /**\n        * 用户实时配置更新\n      */\n      encodePullUserSetting(version) {\n          const modules = this._codec.getModule(PBName.PullUserSettingInput);\n          modules.setVersion(version);\n          return modules.getArrayData();\n      }\n      /**\n        * 获取会话状态 (置顶、免打扰)\n      */\n      encodeGetConversationStatus(time) {\n          const modules = this._codec.getModule(PBName.SessionReq);\n          modules.setTime(time);\n          return modules.getArrayData();\n      }\n      /**\n        * 设置会话状态 (置顶、免打扰)\n      */\n      encodeSetConversationStatus(statusList) {\n          const isComet = this._connectType === 'comet';\n          const modules = this._codec.getModule(PBName.SessionStateModifyReq);\n          const currentTime = DelayTimer.getTime();\n          const stateModuleList = [];\n          forEach(statusList, (status) => {\n              const stateModules = this._codec.getModule(PBName.SessionState);\n              const { conversationType: type, targetId, notificationStatus, isTop } = status;\n              const stateItemModuleList = [];\n              stateModules.setType(type);\n              stateModules.setChannelId(targetId);\n              stateModules.setTime(currentTime);\n              const isNotDisturb = notificationStatus === NotificationStatus$1.OPEN;\n              const TypeToVal = {};\n              if (!isUndefined(notificationStatus)) {\n                  TypeToVal[ConversationStatusType.DO_NOT_DISTURB] = isNotDisturb;\n              }\n              if (!isUndefined(isTop)) {\n                  TypeToVal[ConversationStatusType.TOP] = isTop;\n              }\n              forEach(TypeToVal, (val, type) => {\n                  if (!isUndefined(val)) {\n                      const stateItemModules = this._codec.getModule(PBName.SessionStateItem);\n                      val = val ? ConversationStatusConfig.ENABLED : ConversationStatusConfig.DISABLED;\n                      stateItemModules.setSessionStateType(Number(type)); // TODO 暂时写死\n                      stateItemModules.setValue(val);\n                      const stateItemModulesData = isComet ? stateItemModules.getArrayData() : stateItemModules;\n                      stateItemModuleList.push(stateItemModulesData);\n                  }\n              });\n              stateModules.setStateItem(stateItemModuleList);\n              const stateModulesData = isComet ? stateModules.getArrayData() : stateModules;\n              stateModuleList.push(stateModulesData);\n          });\n          modules.setVersion(currentTime);\n          modules.setState(stateModuleList);\n          return modules.getArrayData();\n      }\n      /**\n       * ============ 以下为 RTC 相关 ============\n       */\n      /**\n       * 加入 RTC 房间\n       */\n      encodeJoinRTCRoom(mode, broadcastType) {\n          const modules = this._codec.getModule(PBName.RtcInput);\n          mode = mode || 0;\n          modules.setRoomType(mode);\n          isUndefined(broadcastType) || modules.setBroadcastType(broadcastType);\n          return modules.getArrayData();\n      }\n      /**\n       * 退出 RTC 房间\n      */\n      encodeQuitRTCRoom() {\n          return this._codec.getModule(PBName.SetUserStatusInput).getArrayData();\n      }\n      /**\n       * 房间数据\n      */\n      encodeSetRTCData(key, value, isInner, apiType, message) {\n          const modules = this._codec.getModule(PBName.RtcSetDataInput);\n          modules.setInterior(isInner);\n          modules.setTarget(apiType);\n          modules.setKey(key);\n          modules.setValue(value);\n          if (message) {\n              message.name && modules.setObjectName(message.name);\n              let content = message.content;\n              if (content) {\n                  if (isObject(content)) {\n                      content = JSON.stringify(content);\n                  }\n                  modules.setContent(content);\n              }\n          }\n          return modules.getArrayData();\n      }\n      /**\n       * 全量 URI\n      */\n      encodeUserSetRTCData(message, valueInfo, objectName) {\n          const modules = this._codec.getModule(PBName.RtcUserSetDataInput);\n          // 全量 URI 新增\n          // 全量发布中\n          // valueInfo: key 为 uris，值为 全量的订阅信息\n          // content: key 为增量数据消息 RCRTC:ModifyResource，value 为增量订阅信息\n          modules.setObjectName(objectName);\n          // content\n          let val = this._codec.getModule(PBName.RtcValueInfo);\n          val.setKey(message.name);\n          val.setValue(message.content);\n          modules.setContent(val);\n          // valueInfo\n          val = this._codec.getModule(PBName.RtcValueInfo);\n          val.setKey('uris');\n          val.setValue(valueInfo);\n          modules.setValueInfo(val);\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      encodeGetRTCData(keys, isInner, apiType) {\n          const modules = this._codec.getModule(PBName.RtcDataInput);\n          modules.setInterior(isInner);\n          modules.setTarget(apiType);\n          modules.setKey(keys);\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      encodeRemoveRTCData(keys, isInner, apiType, message) {\n          const modules = this._codec.getModule(PBName.RtcDataInput);\n          modules.setInterior(isInner);\n          modules.setTarget(apiType);\n          modules.setKey(keys);\n          message = message || {};\n          let { name, content } = message;\n          !isUndefined(name) && modules.setObjectName(name);\n          if (!isUndefined(content)) {\n              if (isObject(content)) {\n                  content = JSON.stringify(content);\n              }\n              modules.setContent(content);\n          }\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      encodeSetRTCOutData(data, type, message) {\n          const modules = this._codec.getModule(PBName.RtcSetOutDataInput);\n          modules.setTarget(type);\n          if (!isArray(data)) {\n              data = [data];\n          }\n          forEach(data, (item, index) => {\n              item.key = item.key ? item.key.toString() : item.key;\n              item.value = item.value ? item.value.toString() : item.value;\n              data[index] = item;\n          });\n          modules.setValueInfo(data);\n          message = message || {};\n          let { name, content } = message;\n          !isUndefined(name) && modules.setObjectName(name);\n          if (!isUndefined(content)) {\n              if (isObject(content)) {\n                  content = JSON.stringify(content);\n              }\n              modules.setContent(content);\n          }\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      ecnodeGetRTCOutData(userIds) {\n          const modules = this._codec.getModule(PBName.RtcQryUserOutDataInput);\n          modules.setUserId(userIds);\n          return modules.getArrayData();\n      }\n      encodeSetRTCState(report) {\n          const modules = this._codec.getModule(PBName.MCFollowInput);\n          modules.setId(report);\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      encodeGetRTCRoomInfo() {\n          const modules = this._codec.getModule(PBName.RtcQueryListInput);\n          modules.setOrder(2);\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      encodeSetRTCUserInfo(key, value) {\n          const modules = this._codec.getModule(PBName.RtcValueInfo);\n          modules.setKey(key);\n          modules.setValue(value);\n          return modules.getArrayData();\n      }\n      /**\n       * 待完善注释\n      */\n      encodeRemoveRTCUserInfo(keys) {\n          const modules = this._codec.getModule(PBName.RtcKeyDeleteInput);\n          modules.setKey(keys);\n          return modules.getArrayData();\n      }\n  }\n\n  /**\n   * 数据通道接口，为 long-polling 与 websocket 提供公共抽象\n   */\n  class ADataChannel {\n      constructor(type, _watcher) {\n          this._watcher = _watcher;\n          this.codec = new DataCodec(type);\n      }\n  }\n\n  const getIdentifier = (messageId, identifier) => {\n      if (messageId && identifier) {\n          return identifier + '_' + messageId;\n      }\n      else if (messageId) {\n          return messageId;\n      }\n      else {\n          return Date.now(); // 若无 messageId、identifer, 直接返回时间戳, 避免返回空造成唯一标识重复\n      }\n  };\n  /**\n   * @description\n   * 与 Server 交互的信令封装\n  */\n  /**\n   * @description\n   * 读数据处理基类\n  */\n  class BaseReader {\n      constructor(header) {\n          this.header = header;\n          this._name = null;\n          this.lengthSize = 0;\n          this.messageId = 0;\n          this.timestamp = 0;\n          this.syncMsg = false;\n          this.identifier = ''; // string + messageId 作为唯一标识, 目前用处: 方便 Pub、Query 回执定位对应 Promise, 且增加前缀避免 Pub、Query 回执错乱\n      }\n      getIdentifier() {\n          const { messageId, identifier } = this;\n          return getIdentifier(messageId, identifier);\n      }\n      read(stream, length) {\n          this.readMessage(stream, length);\n          // return { stream, length }\n      }\n      readMessage(stream, length) {\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  /**\n   * @description\n   * 写数据处理基类\n   */\n  class BaseWriter {\n      constructor(headerType) {\n          this.lengthSize = 0;\n          this.messageId = 0;\n          this.topic = '';\n          this.targetId = '';\n          this.identifier = '';\n          this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n      }\n      getIdentifier() {\n          const { messageId, identifier } = this;\n          return getIdentifier(messageId, identifier);\n      }\n      write(stream) {\n          const headerCode = this.getHeaderFlag();\n          stream.write(headerCode); // 写入 Header\n          this.writeMessage(stream);\n      }\n      setHeaderQos(qos) {\n          this._header.qos = qos;\n      }\n      getHeaderFlag() {\n          return this._header.encode();\n      }\n      getLengthSize() {\n          return this.lengthSize;\n      }\n      getBufferData() {\n          const stream = new RongStreamWriter();\n          this.write(stream);\n          const val = stream.getBytesArray();\n          const binary = new Int8Array(val);\n          return binary;\n      }\n      getCometData() {\n          const data = this.data || {};\n          return JSON.stringify(data);\n      }\n  }\n  /**\n   * @description\n   * 连接成功后服务端的回执\n   */\n  class ConnAckReader extends BaseReader {\n      constructor() {\n          super(...arguments);\n          this._name = MessageName.CONN_ACK;\n          this.status = null; // 链接状态\n          this.userId = null; // 用户 id\n          // sessionId: string;\n          this.timestamp = 0;\n      }\n      readMessage(stream, length) {\n          stream.readByte(); // 去除 Header\n          this.status = +stream.readByte();\n          if (length > ConnAckReader.MESSAGE_LENGTH) {\n              this.userId = stream.readUTF();\n              stream.readUTF(); // 此处为取 sessionId, ws 未用到此值, 但也需执行, 否则读取后面数值时会不准\n              this.timestamp = stream.readLong();\n          }\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  ConnAckReader.MESSAGE_LENGTH = 2;\n  /**\n   * @description\n   * 服务端断开链接. 比如: 被踢\n   */\n  class DisconnectReader extends BaseReader {\n      constructor() {\n          super(...arguments);\n          this._name = MessageName.DISCONNECT;\n          this.status = 0;\n      }\n      readMessage(stream, length) {\n          stream.readByte();\n          // (1)、此处未转换为链接状态码  (2)、2.0 代码限制了 status 为 0 - 5, 不在范围内则报错. 此处去掉此判断\n          this.status = +stream.readByte();\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  DisconnectReader.MESSAGE_LENGTH = 2;\n  /**\n   * @description\n   * ping 请求\n   */\n  class PingReqWriter extends BaseWriter {\n      constructor() {\n          super(OperationType.PING_REQ);\n          this._name = MessageName.PING_REQ;\n      }\n      writeMessage(stream) { }\n  }\n  /**\n   * @description\n   * ping 响应\n   */\n  class PingRespReader extends BaseReader {\n      constructor(header) {\n          super(header);\n          this._name = MessageName.PING_RESP;\n      }\n  }\n  class RetryableReader extends BaseReader {\n      constructor() {\n          super(...arguments);\n          this.messageId = 0;\n      }\n      readMessage(stream, length) {\n          const msgId = stream.readByte() * 256 + stream.readByte();\n          this.messageId = parseInt(msgId.toString(), 10);\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  class RetryableWriter extends BaseWriter {\n      constructor() {\n          super(...arguments);\n          this.messageId = 0;\n      }\n      writeMessage(stream) {\n          const id = this.messageId;\n          const lsb = id & 255;\n          const msb = (id & 65280) >> 8; // 65280 -> 1111111100000000\n          stream.write(msb);\n          stream.write(lsb);\n      }\n  }\n  class PublishReader extends RetryableReader {\n      constructor() {\n          super(...arguments);\n          this._name = MessageName.PUBLISH;\n          this.topic = '';\n          this.targetId = '';\n          this.syncMsg = false;\n          this.identifier = IDENTIFIER.PUB;\n      }\n      readMessage(stream, length) {\n          // let pos = 6;\n          this.date = stream.readInt();\n          this.topic = stream.readUTF();\n          // pos += BinaryHelper.writeUTF(this.topic).length;\n          this.targetId = stream.readUTF();\n          // pos += BinaryHelper.writeUTF(this.targetId).length;\n          // RetryableReader.prototype.readMessage.apply(this, arguments)\n          super.readMessage(stream, length);\n          // this.data = new Array(msgLength - pos);\n          this.data = stream.readAll();\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  /**\n   * @description\n   * 发消息使用\n   */\n  class PublishWriter extends RetryableWriter {\n      constructor(topic, data, targetId) {\n          super(OperationType.PUBLISH);\n          this._name = MessageName.PUBLISH;\n          this.syncMsg = false;\n          this.identifier = IDENTIFIER.PUB;\n          this.topic = topic;\n          this.data = isString(data) ? BinaryHelper.writeUTF(data) : data;\n          this.targetId = targetId;\n      }\n      writeMessage(stream) {\n          stream.writeUTF(this.topic);\n          stream.writeUTF(this.targetId);\n          super.writeMessage(stream);\n          stream.write(this.data);\n      }\n  }\n  /**\n   * @description\n   * 发消息, Server 给的 Ack 回执\n   */\n  class PubAckReader extends RetryableReader {\n      constructor() {\n          super(...arguments);\n          this._name = MessageName.PUB_ACK;\n          this.status = 0;\n          this.date = 0;\n          this.millisecond = 0;\n          this.messageUId = '';\n          this.timestamp = 0;\n          this.identifier = IDENTIFIER.PUB;\n          this.topic = '';\n          this.targetId = '';\n      }\n      readMessage(stream, length) {\n          super.readMessage(stream, length);\n          this.date = stream.readInt();\n          this.status = stream.readByte() * 256 + stream.readByte();\n          this.millisecond = stream.readByte() * 256 + stream.readByte();\n          this.timestamp = this.date * 1000 + this.millisecond;\n          this.messageUId = stream.readUTF();\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  /**\n   * @description\n   * Server 下发 Pub, Web 给 Server 发送回执\n   */\n  class PubAckWriter extends RetryableWriter {\n      constructor(messageId) {\n          super(OperationType.PUB_ACK);\n          this._name = MessageName.PUB_ACK;\n          this.status = 0;\n          this.date = 0;\n          this.millisecond = 0;\n          this.messageUId = '';\n          this.timestamp = 0;\n          this.messageId = messageId;\n      }\n      writeMessage(stream) {\n          super.writeMessage(stream);\n      }\n  }\n  /**\n   * @description\n   * Web 主动查询\n   */\n  class QueryWriter extends RetryableWriter {\n      constructor(topic, data, targetId) {\n          super(OperationType.QUERY);\n          this.name = MessageName.QUERY;\n          this.identifier = IDENTIFIER.QUERY;\n          this.topic = topic;\n          this.data = isString(data) ? BinaryHelper.writeUTF(data) : data;\n          this.targetId = targetId;\n      }\n      writeMessage(stream) {\n          stream.writeUTF(this.topic);\n          stream.writeUTF(this.targetId);\n          // RetryableWriter.prototype.writeMessage.call(this, stream)\n          super.writeMessage(stream);\n          stream.write(this.data);\n      }\n  }\n  /**\n   * @description\n   * Server 发送 Query, Web 给 Server 的回执\n   */\n  class QueryConWriter extends RetryableWriter {\n      constructor(messageId) {\n          super(OperationType.QUERY_CONFIRM);\n          this._name = MessageName.QUERY_CON;\n          this.messageId = messageId;\n      }\n  }\n  /**\n   * @description\n   * Server 对 Web 查询操作的回执\n   */\n  class QueryAckReader extends RetryableReader {\n      constructor() {\n          super(...arguments);\n          this._name = MessageName.QUERY_ACK;\n          this.status = 0;\n          this.identifier = IDENTIFIER.QUERY;\n          this.topic = '';\n          this.targetId = '';\n      }\n      readMessage(stream, length) {\n          // RetryableReader.prototype.readMessage.call(this, stream)\n          super.readMessage(stream, length);\n          this.date = stream.readInt();\n          this.status = stream.readByte() * 256 + stream.readByte();\n          this.data = stream.readAll();\n          // if (msgLength > 0) {\n          //   this.data = new Array(msgLength - 8);\n          //   this.data = stream.readAll();\n          // }\n          return {\n              stream,\n              length\n          };\n      }\n  }\n  const getReaderByHeader = (header) => {\n      const type = header.type;\n      let msg;\n      switch (type) {\n          case OperationType.CONN_ACK:\n              msg = new ConnAckReader(header);\n              break;\n          case OperationType.PUBLISH:\n              msg = new PublishReader(header);\n              msg.syncMsg = header.syncMsg;\n              break;\n          case OperationType.PUB_ACK:\n              msg = new PubAckReader(header);\n              break;\n          case OperationType.QUERY_ACK:\n              msg = new QueryAckReader(header);\n              break;\n          case OperationType.SUB_ACK:\n          case OperationType.UNSUB_ACK:\n          case OperationType.PING_RESP:\n              msg = new PingRespReader(header);\n              break;\n          case OperationType.DISCONNECT:\n              msg = new DisconnectReader(header);\n              break;\n          default:\n              msg = new BaseReader(header);\n              logger.error('No support for deserializing ' + type + ' messages');\n      }\n      return msg;\n  };\n  /**\n   * 解析 websocket 收到的数据 ArrayBuffer 数据\n   * @param {ArrayBuffer} data server 通过 webscoekt 传送的所有数据\n   */\n  const readWSBuffer = (data) => {\n      const arr = new Uint8Array(data);\n      const stream = new RongStreamReader(arr);\n      const flags = stream.readByte();\n      const header = new Header(flags);\n      const msg = getReaderByHeader(header);\n      msg.read(stream, arr.length - 1);\n      return msg;\n  };\n  const readCometData = (data) => {\n      const flags = data.headerCode;\n      const header = new Header(flags);\n      const msg = getReaderByHeader(header);\n      // utils.forEach(data, (item: any, key: string) => {\n      //   if (key in msg) {\n      //     msg[key] = item;\n      //   }\n      // });\n      for (const key in data) {\n          // if (key in msg) {\n          msg[key] = data[key];\n          // }\n      }\n      return msg;\n  };\n\n  /**\n   * CMP/Comet 服务连接应答码\n   */\n  const ConnectResultCode = {\n      /**\n       * 连接成功\n       */\n      ACCEPTED: 0,\n      /**\n       * 协议版本不匹配\n       * @description 暂未使用\n       */\n      UNACCEPTABLE_PROTOCOL_VERSION: 1,\n      /**\n       * 客户端（移动端 TCP 连接建立时）`info` 字段格式错误\n       * @description 格式：`{平台类型}-{设备信息}-{sdk版本}`。\n       * 其中设备信息为：{手机类型}{手机型号}{网络类型，4G/WIFI}{运营商标识, 移动/电信/联通}\n       */\n      IDENTIFIER_REJECTED: 2,\n      /**\n       * 不支持的平台类型，一般小程序或 PC 未开通\n       */\n      SERVER_UNAVAILABLE: 3,\n      /**\n       * Token无法解析，或Token已过期\n       */\n      TOKEN_INCORRECT: 4,\n      /**\n       * 防黑产规则相关应答\n       */\n      NOT_AUTHORIZED: 5,\n      /**\n       * 服务重定向，一般服务扩缩容时，落点已经改变，此时 userId 链接到旧的节点时，会触发该错误。\n       * 客户端收到该应答后须重新访问导航，重新获取 CMP 地址\n       */\n      REDIRECT: 6,\n      /**\n       * 暂未使用\n       */\n      PACKAGE_ERROR: 7,\n      /**\n       * 该 AppKey 已经封禁或删除\n       */\n      APP_BLOCK_OR_DELETE: 8,\n      /**\n       * 该用户 ID 已经被封禁\n       */\n      BLOCK: 9,\n      /**\n       * Token 已过期，暂未使用\n       */\n      TOKEN_EXPIRE: 10,\n      /**\n       * Token 中携带 deviceId 时，检测 Token 中 deviceId 与链接设备 deviceId 不一致\n       */\n      DEVICE_ERROR: 11,\n      /**\n       * Web 端设置安全域名后，连接端域名不在安全域名范围内\n       */\n      HOSTNAME_ERROR: 12,\n      /**\n       * 开启`禁止把已在线客户端踢下线`开关后，该错误码标识已有同类型端在线，禁止链接\n       */\n      HASOHTERSAMECLIENTONLINE: 13\n  };\n\n  /**\n   * 连接状态\n   */\n  var ConnectionStatus;\n  (function (ConnectionStatus) {\n      /**\n       * 连接成功。\n       */\n      ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n      /**\n       * 连接中。\n       */\n      ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n      /**\n       * 正常断开连接。\n       */\n      ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n      /**\n       * 网络不可用。\n       */\n      ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n      /**\n       * 连接关闭。\n       */\n      ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n      /**\n       * 用户账户在其他设备登录，本机会被踢掉线。\n       */\n      ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n      /**\n       * websocket 连接失败\n       */\n      ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n      /**\n       * websocket 报错\n       */\n      ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n      /**\n       * 用户被封禁\n       */\n      ConnectionStatus[ConnectionStatus[\"BLOCKED\"] = 9] = \"BLOCKED\";\n      /**\n       * 域名错误\n       */\n      ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n      /**\n       * appkey 不正确\n       */\n      ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n      /**\n       * 互踢次数过多（`count > 5`），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n       */\n      ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n      /**\n       * 开始请求导航\n       */\n      ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n      /**\n       * 请求导航结束\n       */\n      ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n      /**\n       *  请求导航失败\n       */\n      ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n      /**\n       *  请求导航超时\n       */\n      ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n  })(ConnectionStatus || (ConnectionStatus = {}));\n  var ConnectionStatus$1 = ConnectionStatus;\n\n  const randomNum = (min, max) => {\n      return min + Math.floor(Math.random() * (max - min));\n  };\n  const getUUID = () => {\n      return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n          const r = Math.random() * 16 | 0;\n          const v = c === 'x' ? r : (r & 0x3 | 0x8);\n          return v.toString(16);\n      });\n  };\n\n  /* eslint-disable camelcase */\n  /**\n   * 信令名\n   */\n  var Topic;\n  (function (Topic) {\n      /** 发送消息进入离线消息存储，接收者不在线时，可转推送 */\n      Topic[Topic[\"ppMsgP\"] = 1] = \"ppMsgP\";\n      /** 发送消息进入离线消息存储，接收者不在线时，不转推送 */\n      Topic[Topic[\"ppMsgN\"] = 2] = \"ppMsgN\";\n      /** 发送消息不进入离线存储，用户在线时直发到接收者，不在线时消息丢弃，不转推送 */\n      Topic[Topic[\"ppMsgS\"] = 3] = \"ppMsgS\";\n      Topic[Topic[\"pgMsgP\"] = 4] = \"pgMsgP\";\n      Topic[Topic[\"chatMsg\"] = 5] = \"chatMsg\";\n      Topic[Topic[\"pcMsgP\"] = 6] = \"pcMsgP\";\n      Topic[Topic[\"qryPMsg\"] = 7] = \"qryPMsg\";\n      Topic[Topic[\"qryGMsg\"] = 8] = \"qryGMsg\";\n      Topic[Topic[\"qryCHMsg\"] = 9] = \"qryCHMsg\";\n      Topic[Topic[\"qryCMsg\"] = 10] = \"qryCMsg\";\n      Topic[Topic[\"qrySMsg\"] = 11] = \"qrySMsg\";\n      Topic[Topic[\"recallMsg\"] = 12] = \"recallMsg\";\n      Topic[Topic[\"prMsgS\"] = 13] = \"prMsgS\";\n      /** 消息通知拉取 */\n      Topic[Topic[\"s_ntf\"] = 14] = \"s_ntf\";\n      /** 服务直发消息 */\n      Topic[Topic[\"s_msg\"] = 15] = \"s_msg\";\n      /**\n       * 状态同步\n       * @todo 需确定同步哪些状态\n       */\n      Topic[Topic[\"s_stat\"] = 16] = \"s_stat\";\n      /** 服务端通知：聊天室 kv 、会话状态 */\n      Topic[Topic[\"s_cmd\"] = 17] = \"s_cmd\";\n      /** 实时配置变更通知 */\n      Topic[Topic[\"s_us\"] = 18] = \"s_us\";\n      /** 拉取实时配置 */\n      Topic[Topic[\"pullUS\"] = 19] = \"pullUS\";\n      Topic[Topic[\"pgMsgS\"] = 20] = \"pgMsgS\";\n      Topic[Topic[\"chatMsgS\"] = 21] = \"chatMsgS\";\n      Topic[Topic[\"qrySessionsAtt\"] = 22] = \"qrySessionsAtt\";\n      Topic[Topic[\"pullMsg\"] = 23] = \"pullMsg\";\n      Topic[Topic[\"qrySessions\"] = 24] = \"qrySessions\";\n      Topic[Topic[\"delSessions\"] = 25] = \"delSessions\";\n      Topic[Topic[\"delMsg\"] = 26] = \"delMsg\";\n      Topic[Topic[\"updRRTime\"] = 27] = \"updRRTime\";\n      /** 拉取聊天室消息 */\n      Topic[Topic[\"chrmPull\"] = 28] = \"chrmPull\";\n      Topic[Topic[\"joinChrm\"] = 29] = \"joinChrm\";\n      Topic[Topic[\"joinChrmR\"] = 30] = \"joinChrmR\";\n      Topic[Topic[\"exitChrm\"] = 31] = \"exitChrm\";\n      Topic[Topic[\"queryChrmI\"] = 32] = \"queryChrmI\";\n      Topic[Topic[\"setKV\"] = 33] = \"setKV\";\n      Topic[Topic[\"delKV\"] = 34] = \"delKV\";\n      /** 拉取聊天室 KV 存储 */\n      Topic[Topic[\"pullKV\"] = 35] = \"pullKV\";\n      Topic[Topic[\"qryRelation\"] = 36] = \"qryRelation\";\n      Topic[Topic[\"delRelation\"] = 37] = \"delRelation\";\n      Topic[Topic[\"pullSeAtts\"] = 38] = \"pullSeAtts\";\n      Topic[Topic[\"setSeAtt\"] = 39] = \"setSeAtt\";\n      Topic[Topic[\"qnTkn\"] = 40] = \"qnTkn\";\n      Topic[Topic[\"qnUrl\"] = 41] = \"qnUrl\";\n      Topic[Topic[\"aliUrl\"] = 42] = \"aliUrl\";\n      Topic[Topic[\"cleanPMsg\"] = 43] = \"cleanPMsg\";\n      Topic[Topic[\"cleanGMsg\"] = 44] = \"cleanGMsg\";\n      Topic[Topic[\"cleanCMsg\"] = 45] = \"cleanCMsg\";\n      Topic[Topic[\"cleanSMsg\"] = 46] = \"cleanSMsg\";\n      Topic[Topic[\"rtcRJoin_data\"] = 47] = \"rtcRJoin_data\";\n      Topic[Topic[\"rtcRExit\"] = 48] = \"rtcRExit\";\n      Topic[Topic[\"rtcPing\"] = 49] = \"rtcPing\";\n      Topic[Topic[\"rtcSetData\"] = 50] = \"rtcSetData\";\n      /** 全量 URI 资源变更 */\n      Topic[Topic[\"userSetData\"] = 51] = \"userSetData\";\n      Topic[Topic[\"rtcQryData\"] = 52] = \"rtcQryData\";\n      Topic[Topic[\"rtcDelData\"] = 53] = \"rtcDelData\";\n      Topic[Topic[\"rtcSetOutData\"] = 54] = \"rtcSetOutData\";\n      Topic[Topic[\"rtcQryUserOutData\"] = 55] = \"rtcQryUserOutData\";\n      Topic[Topic[\"rtcToken\"] = 56] = \"rtcToken\";\n      Topic[Topic[\"rtcUserState\"] = 57] = \"rtcUserState\";\n      Topic[Topic[\"rtcRInfo\"] = 58] = \"rtcRInfo\";\n      Topic[Topic[\"rtcUData\"] = 59] = \"rtcUData\";\n      Topic[Topic[\"rtcUPut\"] = 60] = \"rtcUPut\";\n      Topic[Topic[\"rtcUDel\"] = 61] = \"rtcUDel\";\n      Topic[Topic[\"rtcUList\"] = 62] = \"rtcUList\";\n  })(Topic || (Topic = {}));\n  var Topic$1 = Topic;\n\n  /**\n   * 通过 /ping 接口确定目标导航是否可用，并根据响应速度排序\n   * @todo 需确认该嗅探的必要性，并确定是否需要删除\n   * @param hosts\n   * @param protocol\n   * @param runtime\n   */\n  const getValidHosts = (hosts, protocol, runtime) => __awaiter(void 0, void 0, void 0, function* () {\n      // 根据 /ping?r=<random> 的响应速度对 hosts 进行排序响应速度排序\n      let pingRes = yield Promise.all(hosts.map((host) => __awaiter(void 0, void 0, void 0, function* () {\n          const now = Date.now();\n          const url = `${protocol}://${host}/ping?r=${randomNum(1000, 9999)}`;\n          const res = yield runtime.httpReq({\n              url,\n              timeout: PING_REQ_TIMEOUT\n          });\n          return { status: res.status, host, cost: Date.now() - now };\n      })));\n      // 清理无效地址\n      pingRes = pingRes.filter(item => item.status === 200);\n      // 按响应时间排序\n      if (pingRes.length > 1) {\n          pingRes = pingRes.sort((a, b) => a.cost - b.cost);\n      }\n      return pingRes.map(item => item.host);\n  });\n  const formatWSUrl = (protocol, host, appkey, token, runtime, apiVersion, pid) => {\n      return `${protocol}://${host}/websocket?appId=${appkey}&token=${encodeURIComponent(token)}&sdkVer=${apiVersion}&pid=${pid}&apiVer=${runtime.isFromUniapp ? 'uniapp' : 'normal'}${runtime.connectPlatform ? '&platform=' + runtime.connectPlatform : ''}`;\n  };\n  const formatResolveKey = (messageId, identifier) => [messageId, identifier].join('-');\n  const isStatusMessage = (topic) => {\n      return [Topic$1.ppMsgS, Topic$1.pgMsgS, Topic$1.chatMsgS].map(item => Topic$1[item]).indexOf(topic) >= 0;\n  };\n\n  const sendWSData = (writer, socket) => {\n      if (!(writer instanceof PingReqWriter)) {\n          logger.debug('Websocket ==>', writer);\n      }\n      const binary = writer.getBufferData();\n      socket.send(binary.buffer);\n  };\n  /**\n   * @todo 迁移中的 DataCodec 模块导致数据通道不够独立，与 xhr-polling 通信可能会有耦合，后续需解耦\n   * @description\n   * 1. 基于 WebSocket 协议建立数据通道，实现数据收发\n   * 2. 基于 Protobuf 进行数据编解码\n   */\n  class WebSocketChannel extends ADataChannel {\n      // 为避免 Circular dependency，此处 runtime 通过参数传入而非全局获取\n      constructor(_runtime, watcher) {\n          super('websocket', watcher);\n          this._runtime = _runtime;\n          this._socket = null;\n          /**\n           * 本端发送消息时等待接收 PubAck 的 Promise.resolve 函数\n           */\n          this._messageIds = {};\n          /**\n           * 接收多端同步消息时，等待 PubAck 的 Promise.resolve 函数\n           */\n          this._syncMessageIds = {};\n          /**\n           * 当前累计心跳超时次数\n           */\n          this._failedCount = 0;\n          /**\n           * 允许连续 PING 超时次数，次数内不主动关闭连接\n           */\n          this.ALLOW_FAILED_TIMES = 4;\n          /**\n           * 有效值 0 - 65535，超出 65535 位数超长溢出\n           */\n          this._idCount = 0;\n          this._generateMessageId = () => {\n              if (this._idCount >= 65535) {\n                  this._idCount = 0;\n              }\n              return ++this._idCount;\n          };\n      }\n      /**\n       * 建立 websocket 连接\n       * @param appkey\n       * @param token\n       * @param hosts\n       * @param protocol\n       * @param apiVersion - apiVersion 需符合 `/\\d+(\\.\\d+){2}/` 规则\n       */\n      connect(appkey, token, hosts, protocol, apiVersion) {\n          return __awaiter(this, void 0, void 0, function* () {\n              // 祛除预发布包中的预发布标签，取真实版本号\n              apiVersion = matchVersion(apiVersion);\n              // 通知连接中\n              this._watcher.status(ConnectionStatus$1.CONNECTING);\n              // 检索有效地址\n              const validHosts = yield getValidHosts(hosts, protocol, this._runtime);\n              if (validHosts.length === 0) {\n                  logger.error('No valid websocket server hosts!');\n                  return ErrorCode$1.RC_SOCKET_NOT_CREATED;\n              }\n              // 确定连接协议：http -> ws, https -> wss\n              const wsProtocol = protocol.replace('http', 'ws');\n              // 逐个尝试建立 websocket 连接\n              for (let i = 0, len = validHosts.length; i < len; i += 1) {\n                  const url = formatWSUrl(wsProtocol, validHosts[i], appkey, token, this._runtime, apiVersion);\n                  // 创建 socket，若超时一定时间未收到 ConnAck 确认，则视为连接超时\n                  const socket = this._runtime.createWebSocket(url);\n                  // 服务连接非主动断开，尝试重连\n                  const disconnected = (code) => {\n                      if (this._socket === socket) {\n                          this._socket = null;\n                          this._watcher.status(code);\n                      }\n                  };\n                  // 等待连接结果\n                  const code = yield new Promise((resolve) => {\n                      socket.onMessage((data) => {\n                          if (Object.prototype.toString.call(data) !== '[object ArrayBuffer]') {\n                              logger.error('Socket received invalid data:', data);\n                              return;\n                          }\n                          const signal = readWSBuffer(data);\n                          // Ping 响应\n                          if (signal instanceof PingRespReader && this._pingResolve) {\n                              this._pingResolve(ErrorCode$1.SUCCESS);\n                              this._pingResolve = undefined;\n                              return;\n                          }\n                          logger.debug('Websocket <==', signal);\n                          // 连接回执\n                          if (signal instanceof ConnAckReader) {\n                              if (signal.status !== ConnectResultCode.ACCEPTED) {\n                                  logger.error('Websocket connAck status:', signal.status);\n                                  resolve(signal.status);\n                                  return;\n                              }\n                              this.connectedTime = signal.timestamp;\n                              this.userId = signal.userId || '';\n                              resolve(ErrorCode$1.SUCCESS);\n                              return;\n                          }\n                          // 连接状态断开\n                          if (signal instanceof DisconnectReader) {\n                              // 收到 Server 通知己方被踢, 抛出至状态监听\n                              // 1 为被其他端挤下线\n                              // 2 为用户封禁，其他正常向上抛出给业务层\n                              const { status } = signal;\n                              const connStatus = status === 1\n                                  ? ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT\n                                  : (status === 2 ? ConnectionStatus$1.BLOCKED : status);\n                              this._watcher.status(connStatus);\n                              return;\n                          }\n                          // 非连接信令处理\n                          this._onReceiveSignal(signal);\n                      });\n                      socket.onClose((code, reason) => {\n                          logger.warn('websocket closed! code:', code, 'reason:', reason);\n                          disconnected(ConnectionStatus$1.CONNECTION_CLOSED);\n                          resolve(code);\n                      });\n                      socket.onError((error) => {\n                          logger.error('websocket error!', error);\n                          disconnected(ConnectionStatus$1.WEBSOCKET_ERROR);\n                          resolve(ErrorCode$1.NETWORK_ERROR);\n                      });\n                      socket.onOpen(() => logger.debug('websocket open =>', url));\n                      // ConnAck 超时\n                      timerSetTimeout(() => {\n                          resolve(ErrorCode$1.TIMEOUT);\n                      }, WEB_SOCKET_TIMEOUT);\n                  });\n                  if (code === ErrorCode$1.SUCCESS) {\n                      this._socket = socket;\n                      // 启动定时心跳\n                      this._checkAlive();\n                      // 通知上层连接成功\n                      this._watcher.status(ConnectionStatus$1.CONNECTED);\n                      return code;\n                  }\n                  socket.close();\n              }\n              return ErrorCode$1.RC_NET_UNAVAILABLE;\n          });\n      }\n      _checkAlive() {\n          var _a;\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._socket) {\n                  // 连接已中断，停止发 Ping\n                  return;\n              }\n              this.sendOnly(new PingReqWriter());\n              // 等待响应\n              const code = yield new Promise((resolve) => {\n                  this._pingResolve = resolve;\n                  setTimeout(() => {\n                      this._pingResolve = undefined;\n                      resolve(ErrorCode$1.TIMEOUT);\n                  }, IM_SIGNAL_TIMEOUT);\n              });\n              // 响应超时，尝试关闭连接\n              if (code !== ErrorCode$1.SUCCESS && ++this._failedCount >= this.ALLOW_FAILED_TIMES) {\n                  (_a = this._socket) === null || _a === void 0 ? void 0 : _a.close();\n                  return;\n              }\n              this._failedCount = 0;\n              // 重新定时任务\n              setTimeout(() => this._checkAlive(), IM_PING_INTERVAL_TIME);\n          });\n      }\n      _onReceiveSignal(signal) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { messageId, identifier } = signal;\n              // 检查是否为 Ack, 如果是, 则处理回执\n              const isQosNeedAck = signal.header && signal.header.qos !== QOS.AT_MOST_ONCE;\n              if (isQosNeedAck) {\n                  // Pub 回执\n                  if (signal instanceof PublishReader && !signal.syncMsg) {\n                      this.sendOnly(new PubAckWriter(messageId));\n                  }\n                  // qry 回执\n                  if (signal instanceof QueryAckReader) {\n                      this.sendOnly(new QueryConWriter(messageId));\n                  }\n              }\n              const key = formatResolveKey(messageId, identifier);\n              // 处理 pubAck、queryAck 回执\n              if (messageId > 0) {\n                  const resolve = this._messageIds[key];\n                  resolve && resolve(signal);\n                  // 多端同步消息的 pubAck\n                  this._syncMessageIds[key] && this._syncMessageIds[key](signal);\n              }\n              // PublishReader 处理\n              if (signal instanceof PublishReader) {\n                  const { syncMsg, topic } = signal;\n                  // 非同步消息或者是状态消息（ppMsgS，pgMsgS，chatMsgS），则直接抛出到上层\n                  if (!syncMsg || isStatusMessage(topic)) {\n                      this._watcher.signal(signal);\n                      return;\n                  }\n                  // 多端同步消息息需等待 CMP 发送的 PubAck（Comet 不发）\n                  const ack = yield new Promise(resolve => {\n                      this._syncMessageIds[key] = resolve;\n                  });\n                  delete this._syncMessageIds[key];\n                  this._watcher.signal(signal, ack);\n              }\n          });\n      }\n      sendOnly(writer) {\n          if (this._socket) {\n              sendWSData(writer, this._socket);\n          }\n      }\n      send(writer, respPBName, option, timeout = IM_SIGNAL_TIMEOUT) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (this._socket) {\n                  const messageId = this._generateMessageId();\n                  writer.messageId = messageId;\n                  const identifier = writer.identifier;\n                  sendWSData(writer, this._socket);\n                  // 等待响应结果\n                  const respSignal = yield new Promise((resolve) => {\n                      const key = formatResolveKey(messageId, identifier);\n                      this._messageIds[key] = resolve;\n                      setTimeout(() => {\n                          delete this._messageIds[key];\n                          resolve(); // 无值认为 timeout 超时\n                      }, timeout);\n                  });\n                  if (!respSignal) {\n                      return { code: ErrorCode$1.TIMEOUT };\n                  }\n                  if (respSignal.status !== 0) {\n                      return { code: respSignal.status };\n                  }\n                  const data = respPBName ? this.codec.decodeByPBName(respSignal.data, respPBName, option) : respSignal;\n                  return { code: ErrorCode$1.SUCCESS, data };\n              }\n              return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n          });\n      }\n      close() {\n          if (this._socket) {\n              this._socket.close();\n              this._socket = null;\n              this._watcher.status(ConnectionStatus$1.DISCONNECTED);\n          }\n      }\n  }\n\n  (function (HttpMethod) {\n      HttpMethod[\"GET\"] = \"GET\";\n      HttpMethod[\"POST\"] = \"POST\";\n  })(exports.HttpMethod || (exports.HttpMethod = {}));\n\n  const isValidJSON = (jsonStr) => {\n      if (isObject(jsonStr)) {\n          return true;\n      }\n      let isValid = false;\n      try {\n          const obj = JSON.parse(jsonStr);\n          const str = JSON.stringify(obj);\n          isValid = str === jsonStr;\n      }\n      catch (e) {\n          isValid = false;\n      }\n      return isValid;\n  };\n  class CometChannel extends ADataChannel {\n      constructor(_runtime, watcher) {\n          super('comet', watcher);\n          this._runtime = _runtime;\n          this._messageIds = {};\n          this._syncMessageIds = {};\n          this._idCount = 0;\n          this._generateMessageId = () => {\n              return ++this._idCount;\n          };\n          this._pid = encodeURIComponent(new Date().getTime() + Math.random() + '');\n      }\n      /**\n       * 长轮询结果处理\n       * @param data\n       */\n      handleCometRes(res) {\n          if (res.status !== 200 && res.status !== 202) {\n              return false;\n          }\n          const data = isString(res.data) ? JSON.parse(res.data) : res.data;\n          if (!data) {\n              logger.error('received data is not a validJson', data);\n              return false;\n          }\n          if (!isArray(data)) {\n              return true;\n          }\n          forEach(data, (item) => __awaiter(this, void 0, void 0, function* () {\n              const { sessionid } = item;\n              if (sessionid) {\n                  this._sessionid = sessionid;\n              }\n              const signal = readCometData(item);\n              const { messageId, _header, status, identifier } = signal;\n              const isQosNeedAck = _header && _header.qos !== QOS.AT_MOST_ONCE;\n              const key = formatResolveKey(messageId, identifier);\n              // 处理 pubAck、queryAck 回执\n              if (messageId && signal.getIdentifier) {\n                  const resolve = this._messageIds[key];\n                  resolve && resolve(signal);\n                  // 多端同步消息的 pubAck\n                  this._syncMessageIds[key] && this._syncMessageIds[key](signal);\n              }\n              // 是否需要发回执\n              if (isQosNeedAck) {\n                  if (signal instanceof PublishReader && !signal.syncMsg) {\n                      const writer = new PubAckWriter(messageId);\n                      this.sendOnly(writer);\n                  }\n                  if (signal instanceof QueryAckReader) {\n                      const writer = new QueryConWriter(messageId);\n                      this.sendOnly(writer);\n                  }\n              }\n              // 连接状态断开\n              if (signal instanceof DisconnectReader) {\n                  const connStatus = status === 1\n                      ? ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT\n                      : (status === 2 ? ConnectionStatus$1.BLOCKED : status);\n                  this._watcher.status(connStatus);\n              }\n              // 处理 publish\n              if (signal instanceof PublishReader) {\n                  const { syncMsg, topic } = signal;\n                  // 非同步消息或者是状态消息（ppMsgS，pgMsgS，chatMsgS），则直接抛出到上层\n                  if (!syncMsg || isStatusMessage(topic)) {\n                      this._watcher.signal(signal);\n                      return false;\n                  }\n                  // 多端同步消息需等待 CMP 发送的 PubAck\n                  const ack = yield new Promise(resolve => {\n                      this._syncMessageIds[key] = resolve;\n                  });\n                  delete this._syncMessageIds[key];\n                  this._watcher.signal(signal, ack);\n              }\n          }));\n          return true;\n      }\n      /**\n       * 长轮询心跳\n       */\n      _startPullSignal(protocol) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const timestamp = new Date().getTime();\n              const url = `${protocol}://${this._domain}/pullmsg.js?sessionid=${this._sessionid}&timestrap=${timestamp}&pid=${this._pid}`;\n              const res = yield this._runtime.httpReq({\n                  url,\n                  body: { pid: this._pid },\n                  timeout: IM_COMET_PULLMSG_TIMEOUT\n              });\n              const isSuccess = this.handleCometRes(res);\n              if (!this._isDisconnected) {\n                  if (isSuccess) {\n                      this._startPullSignal(protocol);\n                  }\n                  else {\n                      this._watcher.status(ConnectionStatus$1.NETWORK_UNAVAILABLE);\n                      this.close();\n                  }\n              }\n          });\n      }\n      connect(appkey, token, hosts, protocol, apiVersion) {\n          return __awaiter(this, void 0, void 0, function* () {\n              // 祛除预发布包中的预发布标签，取真实版本号\n              apiVersion = matchVersion(apiVersion);\n              this._protocol = protocol;\n              this._isDisconnected = false;\n              this._watcher.status(ConnectionStatus$1.CONNECTING);\n              const validHosts = yield getValidHosts(hosts, protocol, this._runtime);\n              if (validHosts.length === 0) {\n                  logger.error('No valid comet server hosts!');\n                  return ErrorCode$1.RC_SOCKET_NOT_CREATED;\n              }\n              /**\n               * 连接结果处理\n               */\n              const handleConnectRes = (res) => {\n                  if (res.status !== 200 && res.status !== 202) {\n                      return false;\n                  }\n                  if (res.data) {\n                      if (!isValidJSON(res.data)) {\n                          logger.error('received data is not a validJson', res.data);\n                          return false;\n                      }\n                      return isObject(res.data) ? res.data : JSON.parse(res.data);\n                  }\n                  return false;\n              };\n              for (let i = 0, len = validHosts.length; i < len; i += 1) {\n                  const url = formatWSUrl(protocol, validHosts[i], appkey, token, this._runtime, apiVersion, this._pid);\n                  const res = yield this._runtime.httpReq({\n                      url,\n                      body: {\n                          pid: this._pid\n                      },\n                      timeout: WEB_SOCKET_TIMEOUT\n                  });\n                  const response = handleConnectRes(res);\n                  this._domain = validHosts[i];\n                  if (response && response.status === 0) {\n                      this._watcher.status(ConnectionStatus$1.CONNECTED);\n                      this._sessionid = response.sessionid;\n                      this._startPullSignal(protocol);\n                      this.userId = response.userId;\n                      this.connectedTime = response.timestamp;\n                      return response.status;\n                  }\n              }\n              return ErrorCode$1.RC_NET_UNAVAILABLE;\n          });\n      }\n      sendCometData(writer, timeout = IM_SIGNAL_TIMEOUT) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _domain, _sessionid, _pid } = this;\n              const { messageId, topic, targetId, identifier } = writer;\n              const headerCode = writer.getHeaderFlag();\n              let url;\n              if (topic) {\n                  url = `${this._protocol}://${_domain}/websocket?messageid=${messageId}&header=${headerCode}&sessionid=${_sessionid}&topic=${topic}&targetid=${targetId}&pid=${_pid}`;\n              }\n              else {\n                  url = `${this._protocol}://${_domain}/websocket?messageid=${messageId}&header=${headerCode}&sessionid=${_sessionid}&pid=${_pid}`;\n              }\n              const res = yield this._runtime.httpReq({\n                  url,\n                  method: exports.HttpMethod.POST,\n                  body: writer.getCometData()\n              });\n              this.handleCometRes(res);\n          });\n      }\n      sendOnly(writer) {\n          this.sendCometData(writer);\n      }\n      send(writer, respPBName, option, timeout = IM_SIGNAL_TIMEOUT) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const messageId = this._generateMessageId();\n              writer.messageId = messageId;\n              this.sendCometData(writer);\n              const { identifier } = writer;\n              const respSignal = yield new Promise((resolve) => {\n                  const key = formatResolveKey(messageId, identifier);\n                  this._messageIds[key] = resolve;\n                  setTimeout(() => {\n                      delete this._messageIds[key];\n                      resolve(); // 无值认为 timeout 超时\n                  }, timeout);\n              });\n              if (!respSignal) {\n                  return { code: ErrorCode$1.TIMEOUT };\n              }\n              if (respSignal.status !== 0) {\n                  return { code: respSignal.status };\n              }\n              const data = respPBName ? this.codec.decodeByPBName(respSignal.data, respPBName, option) : respSignal;\n              return { code: ErrorCode$1.SUCCESS, data };\n          });\n      }\n      close() {\n          this._isDisconnected = true;\n          this._watcher.status(ConnectionStatus$1.DISCONNECTED);\n      }\n  }\n\n  const getKey = (appkey, token) => {\n      return ['navi', appkey, token].join('_');\n  };\n  const getNaviInfoFromCache = (appkey, token, storage) => {\n      const key = getKey(appkey, token);\n      const jsonStr = storage.getItem(key);\n      if (!jsonStr) {\n          return null;\n      }\n      let data;\n      try {\n          data = JSON.parse(jsonStr);\n      }\n      catch (err) {\n          // 缓存数据被篡改，清空缓存\n          storage.removeItem(key);\n          return null;\n      }\n      // 缓存超时\n      if (Date.now() - data.timestamp >= NAVI_CACHE_DURATION) {\n          storage.removeItem(key);\n          return null;\n      }\n      return data.naviInfo;\n  };\n  const setNaviInfo2Cache = (appkey, token, naviInfo, storage) => {\n      const key = getKey(appkey, token);\n      const data = {\n          naviInfo,\n          timestamp: Date.now()\n      };\n      storage.setItem(key, JSON.stringify(data));\n  };\n  const clearCache = (appkey, token, storage) => {\n      storage.removeItem(getKey(appkey, token));\n  };\n  class Navi {\n      constructor(_runtime, _appkey, \n      /**\n       * 导航地址，该数据中不包含 token 中的动态导航\n       */\n      _navigators, _customCMP = [], _apiVersion, _connectType) {\n          this._runtime = _runtime;\n          this._appkey = _appkey;\n          this._navigators = _navigators;\n          this._customCMP = _customCMP;\n          this._apiVersion = _apiVersion;\n          this._connectType = _connectType;\n          this._apiVersion = matchVersion(this._apiVersion);\n      }\n      _formatNaviUrl(url, token, appkey, jsonpFunc, connectType) {\n          const path = this._runtime.isSupportSocket() && (connectType === 'websocket') ? 'navi' : 'cometnavi';\n          const tmpUrl = `${url}/${path}.js?appId=${appkey}&token=${encodeURIComponent(token)}&callBack=${jsonpFunc}&v=${this._apiVersion}&r=${Date.now()}`;\n          return tmpUrl;\n      }\n      _reqNavi(uris, appkey, token, connectType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const jsonpFunc = 'getServerEndpoint';\n              for (let i = 0, len = uris.length; i < len; i += 1) {\n                  const url = this._formatNaviUrl(uris[i], token, appkey, jsonpFunc, connectType);\n                  logger.debug(`req navi => ${url}`);\n                  const res = yield this._runtime.httpReq({\n                      url,\n                      timeout: NAVI_REQ_TIMEOUT\n                  });\n                  if (res.status !== 200) {\n                      continue;\n                  }\n                  try {\n                      // 返回结果中，私有云无 ; 号，公有云有分号\n                      // 解析 res 数据，解析成功则返回 naviInfo 数据\n                      const jsonStr = res.data.replace(`${jsonpFunc}(`, '').replace(/\\);?$/, '');\n                      const naviInfo = JSON.parse(jsonStr);\n                      // 补充导航数据请求使用的协议\n                      const protocol = /^https/.test(url) ? 'https' : 'http';\n                      naviInfo.protocol = protocol;\n                      return naviInfo;\n                  }\n                  catch (err) {\n                      logger.error('parse navi err =>', err);\n                  }\n              }\n              return null;\n          });\n      }\n      /**\n       * 获取导航数据\n       * @param force 是否强制重新获取并清空缓存数据\n       */\n      getInfo(token, dynamicUris, force, isCppMode) {\n          var _a;\n          return __awaiter(this, void 0, void 0, function* () {\n              // C++ 协议栈不请求导航\n              if (isCppMode) {\n                  return null;\n              }\n              // TODO: 微信小程序直接返值，不需请求导航\n              if (!this._runtime.useNavi) {\n                  let connectUrl;\n                  if (this._runtime.isSupportSocket()) {\n                      connectUrl = MINI_SOCKET_CONNECT_URIS.join(',');\n                  }\n                  else {\n                      connectUrl = MINI_COMET_CONNECT_URIS.join(',');\n                  }\n                  const naviInfo = {\n                      code: 200,\n                      protocol: 'https',\n                      server: '',\n                      voipCallInfo: '',\n                      kvStorage: 0,\n                      openHttpDNS: false,\n                      historyMsg: false,\n                      chatroomMsg: false,\n                      uploadServer: 'https://upload.qiniup.com',\n                      bosAddr: 'https://gz.bcebos.com',\n                      location: '',\n                      monitor: 0,\n                      joinMChrm: false,\n                      openMp: 0,\n                      openUS: 0,\n                      grpMsgLimit: 0,\n                      isFormatted: 0,\n                      gifSize: 2048,\n                      logSwitch: 0,\n                      logPolicy: '',\n                      compDays: 0,\n                      msgAck: '',\n                      activeServer: '',\n                      qnAddr: '',\n                      extkitSwitch: 0,\n                      alone: false,\n                      voipServer: '',\n                      offlinelogserver: '',\n                      backupServer: ((_a = this._customCMP) === null || _a === void 0 ? void 0 : _a.length) ? this._customCMP.join(',') : connectUrl\n                  };\n                  setNaviInfo2Cache(this._appkey, token, naviInfo, this._runtime.localStorage);\n                  return naviInfo;\n              }\n              // 判断是否需要重新获取导航数据，是则清空缓存数据\n              if (force) {\n                  this._clear(token);\n              }\n              // 判断是否有有效缓存数据\n              let naviInfo = getNaviInfoFromCache(this._appkey, token, this._runtime.localStorage);\n              if (naviInfo) {\n                  return naviInfo;\n              }\n              const uris = this._navigators.slice();\n              dynamicUris.length && dynamicUris.forEach(uri => {\n                  uris.indexOf(uri) < 0 && uris.unshift(uri);\n              });\n              // 串行请求，直到获取到导航数据或所有请求结束\n              // TODO: 考虑是否可改为并行请求，串行请求时间过长\n              naviInfo = yield this._reqNavi(uris, this._appkey, token, this._connectType);\n              if (naviInfo) {\n                  setNaviInfo2Cache(this._appkey, token, naviInfo, this._runtime.localStorage);\n                  return naviInfo;\n              }\n              // TODO: 所有请求已失败，公有云需要内置导航数据\n              return naviInfo;\n          });\n      }\n      getInfoFromCache(token) {\n          return getNaviInfoFromCache(this._appkey, token, this._runtime.localStorage);\n      }\n      /**\n       * 清空导航数据：内存数据、缓存数据\n       */\n      _clear(token) {\n          clearCache(this._appkey, token, this._runtime.localStorage);\n      }\n  }\n\n  /**\n   * 引擎定义\n   */\n  class AEngine {\n      /**\n       * 引擎初始化\n       * @param _appkey\n       */\n      constructor(runtime, _appkey, _watcher, _apiVersion, _options) {\n          this.runtime = runtime;\n          this._appkey = _appkey;\n          this._watcher = _watcher;\n          this._apiVersion = _apiVersion;\n          this._options = _options;\n          /**\n           * 当前用户 Id\n           */\n          this.currentUserId = '';\n          /**\n           * 连接时间\n          */\n          this.connectedTime = 0;\n      }\n  }\n\n  const OUTBOX_KEY = 'outbox';\n  const INBOX_KEY = 'inbox';\n  const generateKey = (prefix, appkey, userId) => {\n      return [prefix, appkey, userId].join('_');\n  };\n  /**\n   * 用于维护用户的收件箱、发件箱时间\n   */\n  class Letterbox {\n      constructor(_runtime, _appkey) {\n          this._runtime = _runtime;\n          this._appkey = _appkey;\n          // 需要在内存维护一份时间戳数据，以避免同浏览器多标签页下多端拉取消息时共享时间戳\n          this._inboxTime = 0;\n          this._outboxTime = 0;\n      }\n      /**\n       * 更新收件箱时间\n       * @param timestamp\n       * @param userId\n       */\n      setInboxTime(timestamp, userId) {\n          if (this._inboxTime > timestamp) {\n              return;\n          }\n          this._inboxTime = timestamp;\n          const key = generateKey(INBOX_KEY, this._appkey, userId);\n          this._runtime.localStorage.setItem(key, timestamp.toString());\n      }\n      /**\n       * 获取收件箱时间\n       * @param userId\n       */\n      getInboxTime(userId) {\n          if (this._inboxTime === 0) {\n              const key = generateKey(INBOX_KEY, this._appkey, userId);\n              this._inboxTime = parseInt(this._runtime.localStorage.getItem(key)) || 0;\n          }\n          return this._inboxTime;\n      }\n      /**\n       * 更新发件箱时间\n       * @param timestamp\n       * @param userId\n       */\n      setOutboxTime(timestamp, userId) {\n          if (this._outboxTime > timestamp) {\n              return;\n          }\n          this._outboxTime = timestamp;\n          const key = generateKey(OUTBOX_KEY, this._appkey, userId);\n          this._runtime.localStorage.setItem(key, timestamp.toString());\n      }\n      /**\n       * 获取发件箱时间\n       * @param userId\n       */\n      getOutboxTime(userId) {\n          if (this._outboxTime === 0) {\n              const key = generateKey(OUTBOX_KEY, this._appkey, userId);\n              this._outboxTime = parseInt(this._runtime.localStorage.getItem(key)) || 0;\n          }\n          return this._outboxTime;\n      }\n  }\n\n  const PullTimeCache = {\n      _caches: {},\n      set(chrmId, time) {\n          this._caches[chrmId] = time;\n      },\n      get(chrmId) {\n          return this._caches[chrmId] || 0;\n      },\n      clear(chrmId) {\n          this._caches[chrmId] = 0;\n      }\n  };\n  class KVStore {\n      constructor(chatroomId, currentUserId) {\n          this._kvCaches = {};\n          this._chatroomId = chatroomId;\n          this._currentUserId = currentUserId;\n      }\n      _add(kv) {\n          const { key } = kv;\n          kv.isDeleted = false;\n          this._kvCaches[key] = kv;\n      }\n      _remove(kv) {\n          const { key } = kv;\n          const cacheKV = this._kvCaches[key];\n          cacheKV.isDeleted = true;\n          this._kvCaches[key] = cacheKV;\n      }\n      _setEntry(data, isFullUpdate) {\n          const { key, type, isOverwrite, userId } = data;\n          const latestUserId = this._getSetUserId(key);\n          const isDeleteOpt = type === ChatroomEntryType$1.DELETE;\n          const isSameAtLastSetUser = latestUserId === userId;\n          const isKeyNotExist = !this._isExisted(key);\n          const event = isDeleteOpt ? this._remove : this._add;\n          if (isFullUpdate) {\n              event.call(this, data);\n          }\n          else if (isOverwrite || isSameAtLastSetUser || isKeyNotExist) {\n              event.call(this, data);\n          }\n          else ;\n      }\n      getValue(key) {\n          const kv = this._kvCaches[key] || {};\n          const { isDeleted } = kv;\n          return isDeleted ? null : kv.value;\n      }\n      getAllValue() {\n          const entries = {};\n          for (const key in this._kvCaches) {\n              if (!this._kvCaches[key].isDeleted) {\n                  entries[key] = this._kvCaches[key].value;\n              }\n          }\n          return entries;\n      }\n      _getSetUserId(key) {\n          const cache = this._kvCaches[key] || {};\n          return cache.userId;\n      }\n      _isExisted(key) {\n          const cache = this._kvCaches[key] || {};\n          const { value, isDeleted } = cache;\n          return (value && !isDeleted);\n      }\n      setEntries(data) {\n          let { kvEntries, isFullUpdate } = data;\n          kvEntries = kvEntries || [];\n          isFullUpdate = isFullUpdate || false;\n          isFullUpdate && this.clear();\n          kvEntries.forEach((kv) => {\n              this._setEntry(kv, isFullUpdate);\n          });\n      }\n      clear() {\n          this._kvCaches = {};\n      }\n  }\n  class ChrmEntryHandler {\n      constructor(engine) {\n          this._pullQueue = [];\n          this._isPulling = false;\n          this._storeCaches = {}; // 所有聊天室的 Store 缓存\n          this._engine = engine;\n      }\n      _startPull() {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (this._isPulling || this._pullQueue.length === 0) {\n                  return;\n              }\n              this._isPulling = true;\n              const { chrmId, timestamp } = this._pullQueue.splice(0, 1)[0];\n              const pulledUpTime = PullTimeCache.get(chrmId);\n              if (pulledUpTime > timestamp) { // 已经拉取过，不再拉取\n                  this._isPulling = false;\n                  this._startPull();\n                  return;\n              }\n              const { code, data } = yield this._engine.pullChatroomEntry(chrmId, pulledUpTime);\n              if (code === ErrorCode$1.SUCCESS) {\n                  this._isPulling = false;\n                  PullTimeCache.set(chrmId, data.syncTime || 0);\n                  this._startPull();\n              }\n              else {\n                  this._startPull();\n              }\n          });\n      }\n      /**\n       * 退出聊天室前清空 kv 缓存 和 拉取时间缓存，再次加入聊天室后重新拉取 kv 并更新本地\n      */\n      reset(chrmId) {\n          // throw new Error('Method not implemented.')\n          PullTimeCache.clear(chrmId);\n          const kvStore = this._storeCaches[chrmId];\n          kvStore && kvStore.clear();\n      }\n      /**\n       * 向服务端拉取 kv\n       * @description\n       * 拉取时机: 1、加入聊天室成功后 2、收到 Server 拉取通知后\n      */\n      pullEntry(chrmId, timestamp) {\n          this._pullQueue.push({ chrmId, timestamp });\n          this._startPull();\n      }\n      /**\n       * 向本地缓存己方设置或拉取到的 kv\n      */\n      setLocal(chrmId, data, userId) {\n          // throw new Error('Method not implemented.')\n          let kvStore = this._storeCaches[chrmId];\n          if (!notEmptyObject(kvStore)) {\n              kvStore = new KVStore(chrmId, userId);\n          }\n          kvStore.setEntries(data);\n          this._storeCaches[chrmId] = kvStore;\n      }\n      /**\n       * 获取聊天室 key 对应的 value\n       * @param chrmId\n       * @param key\n      */\n      getValue(chrmId, key) {\n          // throw new Error('Method not implemented.')\n          const kvStore = this._storeCaches[chrmId];\n          return kvStore ? kvStore.getValue(key) : null;\n      }\n      /**\n       * 获取聊天室所有 key value\n       * @param chrmId\n      */\n      getAll(chrmId) {\n          // throw new Error('Method not implemented.')\n          const kvStore = this._storeCaches[chrmId];\n          let entries = {};\n          if (kvStore) {\n              entries = kvStore.getAllValue();\n          }\n          return entries;\n      }\n  }\n  class JoinedChrmManager {\n      constructor(_runtime, _appkey, _userId, _canJoinMulipleChrm) {\n          this._runtime = _runtime;\n          this._appkey = _appkey;\n          this._userId = _userId;\n          this._canJoinMulipleChrm = _canJoinMulipleChrm;\n          this._sessionKey = '';\n          this._joinedChrmsInfo = {};\n          this._sessionKey = `sync-chrm-${this._appkey}-${this._userId}`;\n      }\n      set(chrmId, count = 10) {\n          !this._canJoinMulipleChrm && (this._joinedChrmsInfo = {});\n          this._joinedChrmsInfo[chrmId] = count;\n          this._runtime.sessionStorage.setItem(this._sessionKey, JSON.stringify(this._joinedChrmsInfo));\n      }\n      get() {\n          let infos;\n          try {\n              const data = this._runtime.sessionStorage.getItem(this._sessionKey);\n              infos = JSON.parse(data || '');\n          }\n          catch (err) {\n              logger.error('parse rejoined chrm infos error', err);\n              infos = {};\n          }\n          return infos;\n      }\n      remove(chrmId) {\n          delete this._joinedChrmsInfo[chrmId];\n          if (notEmptyObject(this._joinedChrmsInfo)) {\n              this._runtime.sessionStorage.setItem(this._sessionKey, JSON.stringify(this._joinedChrmsInfo));\n          }\n          else {\n              this.clear();\n          }\n      }\n      clear() {\n          this._joinedChrmsInfo = {};\n          this._runtime.sessionStorage.removeItem(this._sessionKey);\n      }\n  }\n\n  const EventName = {\n      STATUS_CHANGED: 'converStatusChanged'\n  };\n  class ConversationStatus {\n      constructor(engine, appkey, currentUserId) {\n          this._eventEmitter = new EventEmitter();\n          this._pullQueue = [];\n          this._isPulling = false;\n          this._storage = createRootStorage(engine.runtime);\n          this._appkey = appkey;\n          this._currentUserId = currentUserId;\n          this._engine = engine;\n          this._storagePullTimeKey = `con-s-${appkey}-${currentUserId}`;\n      }\n      /**\n       * 向本地设置拉取的时间, 并通知上层会话状态的变更\n      */\n      _set(list) {\n          // todo('ConversationStatus set')\n          if (isUndefined(list)) {\n              return;\n          }\n          let localTime = this._storage.get(this._storagePullTimeKey) || 0;\n          const listCount = list.length;\n          list.forEach((statusItem, index) => {\n              const updatedTime = statusItem.updatedTime || 0;\n              localTime = updatedTime > localTime ? updatedTime : localTime;\n              statusItem.conversationType = statusItem.type;\n              this._eventEmitter.emit(EventName.STATUS_CHANGED, {\n                  statusItem,\n                  isLastPull: index === listCount - 1\n              });\n          });\n          this._storage.set(this._storagePullTimeKey, localTime);\n      }\n      /**\n       * 拉取队列\n      */\n      _startPull() {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (this._isPulling || this._pullQueue.length === 0) {\n                  return;\n              }\n              this._isPulling = true;\n              const time = this._pullQueue.splice(0, 1)[0];\n              const { code, data } = yield this._engine.pullConversationStatus(time);\n              if (code === ErrorCode$1.SUCCESS) {\n                  this._isPulling = false;\n                  this._set(data);\n                  this._startPull();\n              }\n              else {\n                  this._startPull();\n              }\n          });\n      }\n      /**\n       * 从服务端拉取变更\n      */\n      pull(newPullTime) {\n          const time = this._storage.get(this._storagePullTimeKey) || 0;\n          if (newPullTime > time || newPullTime === 0) {\n              // 拉取,并通知上层拉取到的数据\n              this._pullQueue.push(time);\n              this._startPull();\n          }\n      }\n      /**\n       * 注册会话状态变更事件\n      */\n      watch(event) {\n          this._eventEmitter.on(EventName.STATUS_CHANGED, (data) => {\n              event(data);\n          });\n      }\n      /**\n       * 断开连接的后，取消注册的会话状态变更时间，防止再次连接重复注册\n      */\n      unwatch() {\n          this._eventEmitter.off(EventName.STATUS_CHANGED, (data) => { });\n      }\n  }\n\n  const StorageKey2ConversationKey = {\n      c: { keyName: 'unreadMessageCount', defaultVal: 0 },\n      hm: { keyName: 'hasMentioned', defaultVal: false },\n      m: { keyName: 'mentionedInfo', defaultVal: null },\n      t: { keyName: 'lastUnreadTime', defaultVal: 0 },\n      nc: { keyName: 'notificationStatus', defaultVal: 2 },\n      to: { keyName: 'isTop', defaultVal: false }\n  };\n  const ConversationKey2StorageKey = {};\n  for (const key in StorageKey2ConversationKey) {\n      const keyName = StorageKey2ConversationKey[key].keyName;\n      ConversationKey2StorageKey[keyName] = key;\n  }\n  /**\n   * 存储再本地的 conversation 信息\n   * 目前字段：\n   *  未读数\n   *  是否有 @  消息\n   *  @ 内容\n   *  免打扰状态\n   *  置顶状态\n   * 对应开发者字段\n   *  unreadMessageCount\n   *  hasMentioned\n   *  mentionedInfo\n   *  notificationStatus\n   *  isTop\n  */\n  class ConversationStore {\n      constructor(runtime, _appkey, _currentUserId) {\n          this._appkey = _appkey;\n          this._currentUserId = _currentUserId;\n          const suffix = `con-${_appkey}-${_currentUserId}`;\n          this.storage = new AppStorage(runtime, suffix);\n      }\n      _getStoreKey(type, targetId) {\n          return `${type}_${targetId}`;\n      }\n      _getConOptionByKey(key) {\n          key = key || '';\n          const arr = key.split('_');\n          if (arr.length === 2) {\n              return {\n                  conversationType: arr[0],\n                  targetId: arr[1]\n              };\n          }\n          else {\n              return {\n                  conversationType: ConversationType$1.PRIVATE,\n                  targetId: ''\n              };\n          }\n      }\n      /**\n       * 更新 hasMentioned mentionedInfo 信息\n      */\n      updateMentionedData(message) {\n          const { conversationType, targetId, messageType, isMentioned, content, senderUserId } = message;\n          const key = this._getStoreKey(conversationType, targetId);\n          const local = this.storage.get(key) || {};\n          const storageMetionedInfoKey = ConversationKey2StorageKey.mentionedInfo;\n          const storageHasMentionedKey = ConversationKey2StorageKey.hasMentioned;\n          let updatedUserIdList = [];\n          // let mentionedInfo = {}\n          const localMentionedInfo = local[storageMetionedInfoKey] || {};\n          const localUserIdList = localMentionedInfo.userIdList || [];\n          let mentionedInfo = content.mentionedInfo;\n          // 如果是 @ 消息, 且 @ 列表里有自己, 更新本地的 MentionInfo.userIdList\n          if (isMentioned && conversationType === ConversationType$1.GROUP) {\n              const receiveUserIdList = mentionedInfo.userIdList || [];\n              receiveUserIdList.forEach(userId => {\n                  if (userId === this._currentUserId && localUserIdList.indexOf(senderUserId) < 0) {\n                      localUserIdList.push(senderUserId);\n                  }\n              });\n              if (mentionedInfo.type === MentionedType$1.ALL && localUserIdList.indexOf(senderUserId) < 0) {\n                  localUserIdList.push(senderUserId);\n              }\n              updatedUserIdList = localUserIdList;\n          }\n          // 如果是撤回 @ 消息, 更新本地 userIdList， userIdList 为空时更新 hasMentioned 为 false\n          if (messageType === MessageType$1.RECALL && conversationType === ConversationType$1.GROUP) {\n              const list = localUserIdList;\n              localUserIdList.forEach((userId, index) => {\n                  if (userId === senderUserId) {\n                      list.splice(index, 1);\n                  }\n              });\n              updatedUserIdList = list;\n          }\n          mentionedInfo = {\n              userIdList: updatedUserIdList,\n              type: mentionedInfo === null || mentionedInfo === void 0 ? void 0 : mentionedInfo.type\n          };\n          if (updatedUserIdList.length !== 0) {\n              local[storageMetionedInfoKey] = mentionedInfo;\n              local[storageHasMentionedKey] = true;\n          }\n          else {\n              delete local[storageMetionedInfoKey];\n              delete local[storageHasMentionedKey];\n          }\n          if (notEmptyObject(local)) {\n              this.storage.set(key, local);\n          }\n          else {\n              this.storage.remove(key);\n          }\n      }\n      /**\n       * 设置会话信息\n      */\n      set(type, targetId, conversation) {\n          const key = this._getStoreKey(type, targetId);\n          const local = this.storage.get(key) || {};\n          for (const key in conversation) {\n              const storageKey = ConversationKey2StorageKey[key];\n              const val = conversation[key];\n              if (isUndefined(storageKey) || isUndefined(val) || key === 'hasMentioned' || key === 'MentionedInfo') {\n                  continue;\n              }\n              const defaultVal = StorageKey2ConversationKey[storageKey].defaultVal;\n              if (val === defaultVal) {\n                  // 默认值不存储，避免占用存储空间。获取时未获取到的返回默认值\n                  delete local[storageKey];\n              }\n              else {\n                  local[storageKey] = val;\n              }\n              if (!local.c) {\n                  // 清空未读数则清空最后操作未读时间，避免占用空间\n                  delete local.t;\n              }\n          }\n          if (notEmptyObject(local)) {\n              this.storage.set(key, local);\n          }\n          else {\n              this.storage.remove(key);\n          }\n      }\n      /**\n       * 获取单个会话本地存储信息\n      */\n      get(type, targetId) {\n          const key = this._getStoreKey(type, targetId);\n          const local = this.storage.get(key) || {};\n          const conversation = {};\n          for (const key in StorageKey2ConversationKey) {\n              const { keyName, defaultVal } = StorageKey2ConversationKey[key];\n              conversation[keyName] = local[key] || defaultVal;\n          }\n          return conversation;\n      }\n      /**\n       * 获取所有会话信息\n      */\n      getValue(func) {\n          const values = this.storage.getValues() || {};\n          const storageConversationList = [];\n          for (const key in values) {\n              const { conversationType, targetId } = this._getConOptionByKey(key);\n              let conversation = {};\n              const store = values[key];\n              for (const storeKey in store) {\n                  const { keyName, defaultVal } = StorageKey2ConversationKey[storeKey];\n                  conversation[keyName] = store[storeKey] || defaultVal;\n              }\n              conversation = Object.assign(conversation, {\n                  conversationType,\n                  targetId\n              });\n              conversation = func ? func(conversation) : conversation;\n              storageConversationList.push(conversation);\n          }\n          return storageConversationList;\n      }\n  }\n\n  const saveConversationType = [ConversationType$1.PRIVATE, ConversationType$1.GROUP, ConversationType$1.SYSTEM];\n  const EventName$1 = {\n      CHANGED: 'conversationChanged'\n  };\n  class ConversationManager {\n      constructor(engine, appkey, userId, updatedConversationFunc) {\n          this._updatedConversations = {};\n          this._eventEmitter = new EventEmitter();\n          this._draftMap = {};\n          this._appkey = appkey;\n          this._loginUserId = userId;\n          this._store = new ConversationStore(engine.runtime, appkey, userId);\n          this._statusManager = new ConversationStatus(engine, appkey, userId);\n          this._statusManager.watch((data) => {\n              const { statusItem, isLastPull } = data;\n              this.addStatus(statusItem, isLastPull);\n          });\n          this._eventEmitter.on(EventName$1.CHANGED, (data) => {\n              updatedConversationFunc(data);\n          });\n      }\n      /**\n       * 根据消息计算本地 localConversation 是否需要更新 和 更新的未读数\n      */\n      _calcUnreadCount(message, localConversation) {\n          const { content, messageType, sentTime, isCounted, messageDirection, senderUserId } = message;\n          const isSelfSend = messageDirection === MessageDirection$1.SEND && senderUserId === this._loginUserId;\n          const isRecall = messageType === MessageType$1.RECALL;\n          const hasContent = isObject(content);\n          let hasChanged = false;\n          const lastUnreadTime = localConversation.lastUnreadTime || 0;\n          const unreadMessageCount = localConversation.unreadMessageCount || 0;\n          const hasBeenAdded = lastUnreadTime > sentTime;\n          // 自己发送的消息、已经计算过的消息 不更新本地存储\n          if (hasBeenAdded || isSelfSend) {\n              return { hasChanged, localConversation };\n          }\n          // 计数的消息，未读数 + 1\n          if (isCounted) {\n              localConversation.unreadMessageCount = unreadMessageCount + 1;\n              localConversation.lastUnreadTime = sentTime;\n              hasChanged = true;\n          }\n          // 测回的消息 且 符合撤回消息内容格式（ 撤回消息 content: {conversationType, targetId, messageUId, sentTime} ）\n          if (isRecall && hasContent) {\n              const isNotRead = lastUnreadTime >= content.sentTime;\n              if (isNotRead && unreadMessageCount) {\n                  localConversation.unreadMessageCount = unreadMessageCount - 1;\n                  hasChanged = true;\n              }\n          }\n          return { hasChanged, localConversation };\n      }\n      /**\n       * 根据消息计算本地 localConversation 是否需要更新 和 更新的 mentionedInfo\n      */\n      _calcMentionedInfo(message, localConversation) {\n          const { content, messageDirection, isMentioned } = message;\n          const isSelfSend = messageDirection === MessageDirection$1.SEND;\n          const hasContent = isObject(content);\n          let hasChanged = false;\n          if (isMentioned && hasContent && content.mentionedInfo) {\n              localConversation.hasMentioned = true;\n              // localConversation.mentionedInfo = (content.mentionedInfo as unknown as IMentionInfo)\n              hasChanged = true;\n          }\n          return { hasChanged, localConversation };\n      }\n      /**\n       * 更新内存中 updatedConversation 字段\n      */\n      _setUpdatedConversation(updatedConOptions) {\n          if (isObject(updatedConOptions)) {\n              const { conversationType, targetId } = updatedConOptions;\n              const key = `${conversationType}_${targetId}`;\n              const cacheConversation = this._store.get(conversationType, targetId) || {};\n              this._updatedConversations[key] = Object.assign(cacheConversation, updatedConOptions);\n          }\n      }\n      addStatus(statusItem, isLastPull) {\n          const { conversationType, targetId, updatedTime, notificationStatus, isTop } = statusItem;\n          const updatedItems = {};\n          if (!isUndefined(notificationStatus)) {\n              updatedItems.notificationStatus = { time: updatedTime, val: notificationStatus };\n          }\n          if (!isUndefined(isTop)) {\n              updatedItems.isTop = { time: updatedTime, val: isTop };\n          }\n          this._store.set(conversationType, targetId, {\n              notificationStatus,\n              isTop\n          });\n          this._setUpdatedConversation({\n              conversationType,\n              targetId,\n              updatedItems\n          });\n          if (isLastPull) {\n              this._notifyConversationChanged();\n          }\n      }\n      /**\n       * 通知会话更新\n       * @description\n       * 通知的条件: 会话状态变化、会话未读数变化（未读数增加、未读数清空）、会话 @ 信息（hasMentioned、mentionedInfo）、？会话最后一条消息\n      */\n      _notifyConversationChanged() {\n          const list = [];\n          for (const key in this._updatedConversations) {\n              list.push(this._updatedConversations[key]);\n          }\n          this._eventEmitter.emit(EventName$1.CHANGED, list);\n          this._updatedConversations = {};\n      }\n      /**\n       * 根据消息向 localstorage 设置会话未读数、会话 @ 信息（ hasMentioned、MentionedInfo ）、会话状态（ 置顶、免打扰 ）\n       * @description\n       * 调用时机：1、收到消息后 2、发消息成功后 3、发送撤回消息成功后\n      */\n      setConversationCacheByMessage(message, isPullMessageFinished) {\n          // 若不是存储会话的类型(比如: 聊天室类型), 则不作处理\n          const { conversationType, isPersited, targetId } = message;\n          const isSaveConversationType = saveConversationType.indexOf(conversationType) >= 0;\n          if (!isSaveConversationType) {\n              return;\n          }\n          let hasChanged = false;\n          let storageConversation = this._store.get(conversationType, targetId);\n          // 计算本地存储\n          const CalcEvents = [this._calcUnreadCount, this._calcMentionedInfo];\n          CalcEvents.forEach((func) => {\n              const { hasChanged: hasCaclChanged, localConversation } = func.call(this, message, storageConversation);\n              hasChanged = hasChanged || hasCaclChanged;\n              storageConversation = cloneByJSON(localConversation);\n          });\n          if (hasChanged) {\n              this._store.set(conversationType, targetId, storageConversation);\n          }\n          this._store.updateMentionedData(message);\n          // 写入会话缓存中\n          if (isPersited) {\n              const conversation = this._store.get(conversationType, targetId);\n              conversation.updatedItems = {\n                  latestMessage: {\n                      time: message.sentTime,\n                      val: message\n                  }\n              };\n              conversation.latestMessage = message;\n              const updateConOptions = Object.assign(conversation, { conversationType, targetId });\n              this._setUpdatedConversation(updateConOptions);\n          }\n          // 是否需要通知， 通知 API Context 本地会话变更\n          if (isPullMessageFinished) {\n              this._notifyConversationChanged();\n          }\n      }\n      /**\n       * 获取会话本地存储信息\n      */\n      get(conversationType, targetId) {\n          return this._store.get(conversationType, targetId);\n      }\n      /**\n       * 获取本地会话所有未读数\n      */\n      getAllUnreadCount() {\n          const conversationList = this._store.getValue();\n          let totalCount = 0;\n          conversationList.forEach(({ unreadMessageCount }) => {\n              unreadMessageCount = unreadMessageCount || 0;\n              totalCount += Number(unreadMessageCount);\n          });\n          return totalCount;\n      }\n      /**\n       * 获取本地指定会话未读数\n      */\n      getUnreadCount(conversationType, targetId) {\n          const conversation = this._store.get(conversationType, targetId);\n          return conversation.unreadMessageCount || 0;\n      }\n      /**\n       * 清除本地指定会话未读数\n      */\n      clearUnreadCount(conversationType, targetId) {\n          const conversation = this._store.get(conversationType, targetId);\n          const { unreadMessageCount, hasMentioned } = conversation;\n          if (unreadMessageCount || hasMentioned) {\n              conversation.unreadMessageCount = 0;\n              conversation.hasMentioned = false;\n              // conversation.mentionedInfo = null\n          }\n          this._store.set(conversationType, targetId, conversation);\n          const updateConOptions = Object.assign(conversation, { conversationType, targetId });\n          this._setUpdatedConversation(updateConOptions);\n          this._notifyConversationChanged();\n      }\n      startPullConversationStatus(time) {\n          this._statusManager.pull(time);\n      }\n      /**\n       * 设置会话消息草稿\n      */\n      setDraft(conversationType, targetId, draft) {\n          const key = `${conversationType}_${targetId}`;\n          this._draftMap[key] = draft;\n      }\n      /**\n       * 获取会话消息草稿\n      */\n      getDraft(conversationType, targetId) {\n          const key = `${conversationType}_${targetId}`;\n          return this._draftMap[key];\n      }\n      /**\n       * 删除会话消息草稿\n      */\n      clearDraft(conversationType, targetId) {\n          const key = `${conversationType}_${targetId}`;\n          delete this._draftMap[key];\n      }\n  }\n\n  var UploadMethod;\n  (function (UploadMethod) {\n      /**\n       * 七牛上传\n       */\n      UploadMethod[UploadMethod[\"QINIU\"] = 1] = \"QINIU\";\n      /**\n       * 阿里云上传\n       */\n      UploadMethod[UploadMethod[\"ALI\"] = 2] = \"ALI\";\n  })(UploadMethod || (UploadMethod = {}));\n  var UploadMethod$1 = UploadMethod;\n\n  /**\n   * engine 层业务相关工具方法\n  */\n  /**\n   * 通过文件类型生成上传唯一文件名\n  */\n  const getUploadFileName = (type, fileName) => {\n      const random = Math.floor((Math.random() * 1000) % 10000);\n      const uuid = getUUID();\n      const date = formatDate();\n      const timestamp = new Date().getTime();\n      let extension = '';\n      if (fileName) {\n          const fileNameArr = fileName.split('.');\n          extension = '.' + fileNameArr[fileNameArr.length - 1];\n      }\n      return `${type}__RC-${date}_${random}_${timestamp}${uuid}${extension}`;\n  };\n  /**\n   * 通过 fileType 获取 MIME\n  */\n  const getMimeKey = (fileType) => {\n      let mimeKey = 'application/octet-stream';\n      switch (fileType) {\n          case FileType$1.IMAGE:\n              mimeKey = 'image/jpeg';\n              break;\n          case FileType$1.AUDIO:\n              mimeKey = 'audio/amr';\n              break;\n          case FileType$1.VIDEO:\n              mimeKey = 'video/3gpp';\n              break;\n          case FileType$1.SIGHT:\n              mimeKey = 'video/mpeg4';\n              break;\n          case FileType$1.COMBINE_HTML:\n              mimeKey = 'text/html';\n              break;\n      }\n      return mimeKey;\n  };\n  /**\n   * 生成 pushConfigs JSON\n   * @description\n   * 与 Server 约定一致， threadId、apnsCollapseId、channelIdMi、channelIdHW、channelIdOPPO、typeVivo 无值时可传空字符串\n  */\n  const pushConfigsToJSON = (iOSConfig = {}, androidConfig = {}) => {\n      const { threadId, apnsCollapseId } = iOSConfig;\n      const { channelIdMi, channelIdHW, channelIdOPPO, typeVivo } = androidConfig;\n      const APNS = {};\n      APNS['thread-id'] = threadId || '';\n      APNS['apns-collapse-id'] = apnsCollapseId || '';\n      const pushCongfigs = [\n          {\n              HW: {\n                  channelId: channelIdHW || ''\n              }\n          }, {\n              MI: {\n                  channelId: channelIdMi || ''\n              }\n          }, {\n              OPPO: {\n                  channelId: channelIdOPPO || ''\n              }\n          }, {\n              VIVO: {\n                  classification: typeVivo || ''\n              }\n          }, {\n              APNS: APNS\n          }\n      ];\n      return JSON.stringify(pushCongfigs);\n  };\n\n  const getPubTopic = (type) => {\n      return {\n          [ConversationType$1.PRIVATE]: Topic$1.ppMsgP,\n          [ConversationType$1.GROUP]: Topic$1.pgMsgP,\n          [ConversationType$1.CHATROOM]: Topic$1.chatMsg,\n          [ConversationType$1.CUSTOMER_SERVICE]: Topic$1.pcMsgP,\n          [ConversationType$1.RTC_ROOM]: Topic$1.prMsgS\n      }[type];\n  };\n  const getStatPubTopic = (type) => {\n      return {\n          [ConversationType$1.PRIVATE]: Topic$1.ppMsgS,\n          [ConversationType$1.GROUP]: Topic$1.pgMsgS\n      }[type];\n  };\n  const transSentAttrs2IReceivedMessage = (conversationType, targetId, options, messageUId, sentTime, senderUserId) => {\n      return {\n          conversationType,\n          targetId,\n          senderUserId,\n          messageDirection: MessageDirection$1.SEND,\n          isCounted: !!options.isCounted,\n          isMentioned: !!options.isMentioned,\n          content: options.content,\n          messageType: options.messageType,\n          isOffLineMessage: false,\n          isPersited: !!options.isPersited,\n          messageUId,\n          sentTime,\n          receivedTime: 0,\n          disableNotification: !!options.disableNotification,\n          isStatusMessage: !!options.isStatusMessage,\n          canIncludeExpansion: !!options.canIncludeExpansion,\n          expansion: options.canIncludeExpansion ? options.expansion : null,\n          receivedStatus: ReceivedStatus$1.UNREAD // 发送消息成功返回的 接收状态默认为 未读\n      };\n  };\n  /**\n   * @description\n   * 处理群已读同步消息逻辑：即时用户传 directionalUserIdList 也强制修改为当前登录用户。群内其他人接收无意义\n  */\n  const handleInnerMsgOptions = (options, currentUserId) => {\n      const { messageType } = options;\n      if (messageType === 'RC:SRSMsg') {\n          Object.assign(options, {\n              directionalUserIdList: [currentUserId]\n          });\n      }\n      return options;\n  };\n  class JSEngine extends AEngine {\n      constructor(runtime, appkey, watcher, apiVersion) {\n          super(runtime, appkey, watcher, apiVersion, {});\n          this._customMessageType = {};\n          /**\n           * 拉取离线消息标记\n           */\n          this._pullingMsg = false;\n          /**\n           * 收到的所有消息拉取通知事件戳队列\n           */\n          this._pullQueue = [];\n          /**\n           * 聊天室消息拉取通知队列\n           */\n          this._chrmsQueue = {};\n          // 初始化信箱\n          this._letterbox = new Letterbox(runtime, appkey);\n          // 初始化 Chrm KV 处理\n          this._chrmEntryHandler = new ChrmEntryHandler(this);\n      }\n      connect(token, naviInfo, connectType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const hosts = [];\n              this._naviInfo = naviInfo;\n              if (naviInfo.server) {\n                  hosts.push(naviInfo.server);\n              }\n              else {\n                  // 私有云无法保证客户环境 Navi 配置有效性\n                  logger.warn('navi.server is invalid');\n              }\n              const backupServer = naviInfo.backupServer;\n              // 备用服务有效性验证与排重\n              backupServer && backupServer.split(',').forEach(host => {\n                  if (hosts.indexOf(host) < 0) {\n                      hosts.push(host);\n                  }\n              });\n              if (hosts.length === 0) {\n                  logger.error('navi invaild.', hosts);\n                  return ErrorCode$1.UNKNOWN;\n              }\n              // 创建数据通道\n              const channel = this.runtime.createDataChannel({\n                  status: (status) => {\n                      this._connectionStatusHandler(status, token, hosts, naviInfo.protocol);\n                  },\n                  signal: this._signalHandler.bind(this)\n              }, connectType);\n              // 建立连接\n              const code = yield channel.connect(this._appkey, token, hosts, naviInfo.protocol, this._apiVersion);\n              if (code === ErrorCode$1.SUCCESS) {\n                  this._channel = channel;\n                  this.currentUserId = channel.userId;\n                  this.connectedTime = channel.connectedTime;\n                  this._conversationManager = new ConversationManager(this, this._appkey, this.currentUserId, this._watcher.conversation);\n                  this._conversationManager.startPullConversationStatus(0);\n                  // 初始化加入 chrm 的信息\n                  this._joinedChrmManager = new JoinedChrmManager(this.runtime, this._appkey, this.currentUserId, naviInfo.joinMChrm);\n                  // 拉取离线消息\n                  this._syncMsg();\n              }\n              else {\n                  channel.close();\n              }\n              return code;\n          });\n      }\n      _connectionStatusHandler(status, token, hosts, protocol) {\n          logger.warn('connection status changed:', status);\n          if (status === ConnectionStatus$1.CONNECTING || status === ConnectionStatus$1.CONNECTED) {\n              this._watcher.status(status);\n              return;\n          }\n          if (!this._channel || status === ConnectionStatus$1.DISCONNECTED) {\n              // 用户主动断开连接，直接抛出连接状态\n              this._watcher.status(status);\n              return;\n          }\n          if (status === ConnectionStatus$1.BLOCKED || status === ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT) {\n              // 用户被封禁，或多端被踢下线，需主动断开 websocket 连接\n              this.disconnect();\n              this._watcher.status(status);\n              return;\n          }\n          // 异常断开，尝试重连\n          this._try2Reconnect(token, hosts, protocol);\n      }\n      _try2Reconnect(token, hosts, protocol) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return;\n              }\n              const code = yield this._channel.connect(this._appkey, token, hosts, protocol, this._apiVersion);\n              if (code === ErrorCode$1.SUCCESS) {\n                  this._rejoinChrm();\n                  return;\n              }\n              this._watcher.status(ConnectionStatus$1.WEBSOCKET_UNAVAILABLE);\n              // 等待 5s 后重新尝试\n              setTimeout(() => {\n                  this._try2Reconnect(token, hosts, protocol);\n              }, 5000);\n          });\n      }\n      _signalHandler(signal, ack) {\n          const { syncMsg, topic } = signal;\n          if (syncMsg) {\n              // 此消息为本人其他端发出的消息，此处为多端消息同步\n              this._receiveSyncMsg(signal, ack);\n              return;\n          }\n          const tmpTopic = Topic$1[topic];\n          if (!tmpTopic) {\n              logger.error('unknown topic:', topic);\n              return;\n          }\n          switch (tmpTopic) {\n              case Topic$1.s_ntf:\n                  this._pullMsg(signal); // 通知拉取\n                  break;\n              case Topic$1.s_msg:\n                  this._receiveMsg(signal); // 接收直发消息\n                  break;\n              case Topic$1.s_cmd:\n                  this._receiveStateNotify(signal);\n                  break;\n              case Topic$1.s_us:\n                  this._receiveSettingNotify(signal);\n                  break;\n          }\n      }\n      /**\n       * 接收聊天室 kv 通知与会话状态变更通知\n       * @param signal\n       */\n      _receiveStateNotify(signal) {\n          var _a;\n          const { time, type, chrmId } = (_a = this._channel) === null || _a === void 0 ? void 0 : _a.codec.decodeByPBName(signal.data, PBName.NotifyMsg);\n          switch (type) {\n              case 2:\n                  this._chrmEntryHandler.pullEntry(chrmId, time);\n                  break;\n              case 3:\n                  this._conversationManager.startPullConversationStatus(time);\n                  break;\n          }\n      }\n      /**\n       * 接收实时配置变更通知\n       * @param signal\n       */\n      _receiveSettingNotify(signal) {\n          // 持续迭代中，注释防止 comet 报错\n          // const notice = this._channel?.codec.decodeByPBName(signal.data, PBName.UserSettingNotification)\n          // logger.error('TODO: 接收用户级配置变更通知', notice)\n      }\n      /**\n       * 通知 API Content 扩展变更\n      */\n      _receiveMessageExpansion(message) {\n          const { content } = message;\n          const { put, del, mid } = content;\n          if (put) {\n              this._watcher.expansion({\n                  updatedExpansion: {\n                      messageUId: mid,\n                      expansion: put\n                  }\n              });\n          }\n          if (del) {\n              this._watcher.expansion({\n                  deletedExpansion: {\n                      messageUId: mid,\n                      deletedKeys: del\n                  }\n              });\n          }\n      }\n      /**\n       * 接收多端同步消息\n       * @param signal\n       * @param ack 同步消息的 ack 信令数据，comet 连接无此数据\n       */\n      _receiveSyncMsg(signal, ack) {\n          var _a;\n          let msg = (_a = this._channel) === null || _a === void 0 ? void 0 : _a.codec.decodeByPBName(signal.data, PBName.UpStreamMessage, {\n              currentUserId: this.currentUserId, signal\n          });\n          msg = this._handleMsgProperties(msg);\n          // 更新消息并通知业务层\n          msg.sentTime = ack.timestamp;\n          msg.messageUId = ack.messageUId;\n          // 当前正在拉取消息过程中，不需要同步直发消息到业务层，向拉取队列中重新添加一个时间戳等待当前拉取动作完成后递归拉取\n          if (this._pullingMsg) {\n              this._pullQueue.push(ack.timestamp);\n              return;\n          }\n          // 更新发件箱时间\n          this._letterbox.setOutboxTime(ack.timestamp, this.currentUserId);\n          if (msg.messageType === MessageType$1.EXPANSION_NOTIFY) {\n              this._receiveMessageExpansion(msg);\n              return;\n          }\n          this._watcher.message(msg);\n          this._conversationManager.setConversationCacheByMessage(msg, true);\n      }\n      /**\n       * 拉取消息\n       * @description 聊天室消息与普通消息都是通知拉取\n       * @param signal\n       */\n      _pullMsg(signal) {\n          if (!this._channel) {\n              return;\n          }\n          const { type, chrmId, time } = this._channel.codec.decodeByPBName(signal.data, PBName.NotifyMsg);\n          if (type === 2) {\n              const info = this._chrmsQueue[chrmId];\n              info.queue.push(time);\n              this._pullChrmMsg(chrmId);\n          }\n          else {\n              // 记录消息拉取通知的时间戳\n              this._pullQueue.push(time);\n              this._syncMsg();\n          }\n      }\n      /**\n       * 拉取消息：离线 Or 通知拉取\n       */\n      _syncMsg() {\n          return __awaiter(this, void 0, void 0, function* () {\n              // 拉取中，队列等待\n              if (this._pullingMsg) {\n                  return;\n              }\n              if (!this._channel) {\n                  // 连接中断，无需拉取离线消息\n                  this._pullingMsg = false;\n                  return;\n              }\n              this._pullingMsg = true;\n              // 获取消息时间戳\n              const outboxTime = this._letterbox.getOutboxTime(this.currentUserId);\n              const inboxTime = this._letterbox.getInboxTime(this.currentUserId);\n              logger.debug('outboxTime', outboxTime);\n              logger.debug('inboxTime', inboxTime);\n              const reqBody = this._channel.codec.encodeSyncMsg({ sendboxTime: outboxTime, inboxTime });\n              const writer = new QueryWriter(Topic$1[Topic$1.pullMsg], reqBody, this.currentUserId);\n              const { code, data } = yield this._channel.send(writer, PBName.DownStreamMessages, {\n                  connectedTime: this._channel.connectedTime,\n                  currentUserId: this.currentUserId\n              });\n              if (code !== ErrorCode$1.SUCCESS || !data) {\n                  logger.warn('Pull msg failed, code:', code, ', data: ', data);\n                  this._pullingMsg = false;\n                  return;\n              }\n              const { list, finished, syncTime } = data;\n              let newOutboxTime = 0;\n              // let newInboxTime = 0\n              // 派发消息\n              list.forEach(item => {\n                  if (item.messageDirection === MessageDirection$1.SEND) {\n                      newOutboxTime = Math.max(item.sentTime, newOutboxTime);\n                  }\n                  // else {\n                  //   newInboxTime = Math.max(item.sentTime, newInboxTime)\n                  // }\n                  if (item.messageType === MessageType$1.EXPANSION_NOTIFY) {\n                      this._receiveMessageExpansion(item);\n                      return;\n                  }\n                  this._watcher.message(item);\n                  this._conversationManager.setConversationCacheByMessage(item, true);\n              });\n              // 更新收件箱时间\n              // this.letterbox.setInboxTime(newInboxTime, this.currentUserId)\n              this._letterbox.setInboxTime(syncTime, this.currentUserId);\n              // 更新发件箱时间\n              this._letterbox.setOutboxTime(newOutboxTime, this.currentUserId);\n              this._pullingMsg = false;\n              // 清除较 syncTime 更早的拉取通知时间戳\n              const tmpPullQueue = this._pullQueue.filter(timestamp => timestamp > syncTime);\n              this._pullQueue.length = 0;\n              this._pullQueue.push(...tmpPullQueue);\n              if (!finished || tmpPullQueue.length > 0) {\n                  // 继续拉取\n                  this._syncMsg();\n              }\n          });\n      }\n      /**\n       * 接收直发消息\n       * @description 直发消息只有单聊、群聊存在，其他会话类型均为通知拉取\n       * @param signal\n       */\n      _receiveMsg(signal) {\n          if (!this._channel) {\n              return;\n          }\n          let msg = this._channel.codec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n              currentUserId: this.currentUserId, connectedTime: this._channel.connectedTime\n          });\n          msg = this._handleMsgProperties(msg);\n          // 当在拉取单群聊离线过程中，直发消息可直接抛弃\n          if (this._pullingMsg) {\n              return;\n          }\n          // 更新收件箱时间\n          this._letterbox.setInboxTime(msg.sentTime, this.currentUserId);\n          if (msg.messageType === MessageType$1.EXPANSION_NOTIFY) {\n              this._receiveMessageExpansion(msg);\n              return;\n          }\n          this._watcher.message(msg);\n          this._conversationManager.setConversationCacheByMessage(msg, true);\n      }\n      /**\n       * 向 API Context 抛出消息时，处理消息的部分属性值\n       * @description\n       * 当前仅根据内置消息或自定义类型的消息处理消息的存储、计数属性\n      */\n      _handleMsgProperties(msgOptions, isSendMsg = false) {\n          const { messageType, isCounted, isPersited, isStatusMessage } = msgOptions;\n          let options;\n          const inRCMessageType = messageType in SEND_MESSAGE_TYPE_OPTION;\n          const inCustomMessageType = messageType in this._customMessageType;\n          if (inRCMessageType) { // 内置消息\n              options = SEND_MESSAGE_TYPE_OPTION[messageType];\n          }\n          else if (inCustomMessageType) { // 自定义消息\n              options = this._customMessageType[messageType];\n          }\n          else { // 其他消息, 发消息已传参为准, 无参数默认 false. 收消息已服务端微赚\n              options = {\n                  isCounted: isNull(isCounted) ? false : isCounted,\n                  isPersited: isNull(isPersited) ? false : isPersited\n              };\n          }\n          Object.assign(msgOptions, {\n              isCounted: options.isCounted,\n              isPersited: options.isPersited,\n              isStatusMessage: !(msgOptions.isCounted && msgOptions.isPersited)\n          });\n          isSendMsg && (msgOptions.isStatusMessage = isStatusMessage);\n          return msgOptions;\n      }\n      getConnectTime() {\n          if (this._channel) {\n              return Promise.resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: this._channel.connectedTime\n              });\n          }\n          return Promise.resolve({ code: ErrorCode$1.RC_NET_CHANNEL_INVALID });\n      }\n      getHistoryMessage(conversationType, targetId, timestamp, count, order) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { currentUserId, _channel: channel } = this;\n              const hisTopic = ConversationTypeToQueryHistoryTopic[conversationType] || QueryHistoryTopic.PRIVATE;\n              if (channel) {\n                  const data = channel.codec.encodeGetHistoryMsg(targetId, { timestamp, count, order });\n                  const resp = yield channel.send(new QueryWriter(hisTopic, data, currentUserId), PBName.HistoryMsgOuput, {\n                      currentUserId, connectedTime: channel.connectedTime, conversation: { targetId }\n                  });\n                  const { code } = resp;\n                  if (code !== ErrorCode$1.SUCCESS) {\n                      return { code };\n                  }\n                  // 解析数据转换为业务层数据结构\n                  const downstreamData = resp.data;\n                  return {\n                      code,\n                      data: { list: downstreamData.list, hasMore: downstreamData.hasMore }\n                  };\n              }\n              return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n          });\n      }\n      deleteRemoteMessage(conversationType, targetId, list) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { currentUserId, _channel: channel } = this;\n              if (channel) {\n                  const data = channel.codec.encodeDeleteMessages(conversationType, targetId, list);\n                  const writer = new QueryWriter(QueryTopic.DELETE_MESSAGES, data, currentUserId);\n                  const resp = yield channel.send(writer);\n                  const { code } = resp;\n                  if (code !== ErrorCode$1.SUCCESS) {\n                      return code;\n                  }\n                  return code;\n              }\n              return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n          });\n      }\n      deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { currentUserId, _channel: channel } = this;\n              if (channel) {\n                  const data = channel.codec.encodeClearMessages(targetId, timestamp);\n                  const topic = ConversationTypeToClearMessageTopic[conversationType];\n                  const writer = new QueryWriter(topic, data, currentUserId);\n                  const resp = yield channel.send(writer);\n                  const { code } = resp;\n                  if (code !== ErrorCode$1.SUCCESS) {\n                      return code;\n                  }\n                  return code;\n              }\n              return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n          });\n      }\n      getConversationList(count = 300, conversationType, startTime, order) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { currentUserId, _channel: channel } = this;\n              conversationType = conversationType || ConversationType$1.PRIVATE;\n              if (channel) {\n                  const buff = channel.codec.encodeOldConversationList({ count, type: conversationType, startTime, order });\n                  const writer = new QueryWriter(QueryTopic.GET_OLD_CONVERSATION_LIST, buff, currentUserId);\n                  const resp = yield channel.send(writer, PBName.RelationsOutput, {\n                      currentUserId,\n                      connectedTime: channel.connectedTime,\n                      afterDecode: (conversation) => {\n                          const { conversationType, targetId } = conversation;\n                          const localConversation = this._conversationManager.get(conversationType, targetId);\n                          // 将本地存储的会话属性和从 Server 获取到的会话属性进行合并\n                          Object.assign(conversation, localConversation);\n                          return conversation;\n                      }\n                  });\n                  logger.info('GetConversationList =>', resp);\n                  const { code, data } = resp;\n                  if (code !== ErrorCode$1.SUCCESS) {\n                      return { code };\n                  }\n                  return {\n                      code,\n                      data: data\n                  };\n              }\n              return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n          });\n      }\n      removeConversation(conversationType, targetId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel } = this;\n              if (channel) {\n                  const data = channel.codec.encodeOldConversationList({ type: conversationType });\n                  const writer = new QueryWriter(QueryTopic.REMOVE_OLD_CONVERSATION, data, targetId);\n                  const resp = yield channel.send(writer);\n                  logger.info('RemoveConversation =>', resp);\n                  const { code } = resp;\n                  if (code !== ErrorCode$1.SUCCESS) {\n                      return code;\n                  }\n                  return code;\n              }\n              return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n          });\n      }\n      getConversation(conversationType, targetId, tag) {\n          throw new Error('Method not implemented.');\n      }\n      getAllConversationUnreadCount() {\n          const allUnreadCount = this._conversationManager.getAllUnreadCount();\n          return Promise.resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: allUnreadCount\n          });\n      }\n      getConversationUnreadCount(conversationType, targetId) {\n          const unreadCount = this._conversationManager.getUnreadCount(conversationType, targetId);\n          return Promise.resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: unreadCount\n          });\n      }\n      clearConversationUnreadCount(conversationType, targetId) {\n          this._conversationManager.clearUnreadCount(conversationType, targetId);\n          return Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n      saveConversationMessageDraft(conversationType, targetId, draft) {\n          this._conversationManager.setDraft(conversationType, targetId, draft);\n          return Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n      getConversationMessageDraft(conversationType, targetId) {\n          const draft = this._conversationManager.getDraft(conversationType, targetId);\n          return Promise.resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: draft\n          });\n      }\n      clearConversationMessageDraft(conversationType, targetId) {\n          this._conversationManager.clearDraft(conversationType, targetId);\n          return Promise.resolve(ErrorCode$1.SUCCESS);\n      }\n      pullConversationStatus(timestamp) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel, currentUserId } = this;\n              if (channel) {\n                  const buff = channel.codec.encodeGetConversationStatus(timestamp);\n                  const writer = new QueryWriter(Topic$1[Topic$1.pullSeAtts], buff, currentUserId);\n                  const resp = yield channel.send(writer, PBName.SessionStates);\n                  const { code, data } = resp;\n                  if (code !== ErrorCode$1.SUCCESS) {\n                      return { code };\n                  }\n                  return { code, data: data };\n              }\n              return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n          });\n      }\n      batchSetConversationStatus(statusList) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { currentUserId, _channel: channel } = this;\n              if (channel) {\n                  const buff = channel.codec.encodeSetConversationStatus(statusList);\n                  const writer = new QueryWriter(QueryTopic.SET_CONVERSATION_STATUS, buff, currentUserId);\n                  const resp = yield channel.send(writer, PBName.SessionStateModifyResp);\n                  const { code, data } = resp;\n                  if (code === ErrorCode$1.SUCCESS) {\n                      const versionData = data;\n                      statusList.forEach((item) => {\n                          this._conversationManager.addStatus(Object.assign(Object.assign({}, item), { updatedTime: versionData.version }), true);\n                      });\n                      return code;\n                  }\n                  return code;\n              }\n              return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n          });\n      }\n      _joinChrm(chrmId, count, isJoinExist) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel } = this;\n              if (!channel)\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              const buff = channel.codec.encodeJoinOrQuitChatRoom();\n              const topic = isJoinExist ? QueryTopic.JOIN_EXIST_CHATROOM : QueryTopic.JOIN_CHATROOM;\n              const writer = new QueryWriter(topic, buff, chrmId);\n              const { code, data } = yield channel.send(writer);\n              // 加入聊天室成功后，需要拉取聊天室最近消息, 并抛给消息监听器\n              if (code === ErrorCode$1.SUCCESS) {\n                  const info = this._chrmsQueue[chrmId];\n                  // 断线重连情况下，重复加房间不能重置消息拉取信息\n                  if (!info) {\n                      this._chrmsQueue[chrmId] = { pulling: false, queue: [], timestamp: 0 };\n                  }\n                  this._pullChrmMsg(chrmId, count);\n                  // 如果开通聊天室 KV 存储服务, 加入成功后拉取聊天室 KV 存储\n                  const { kvStorage: isOpenKVService } = this._naviInfo;\n                  if (isOpenKVService) {\n                      this._chrmEntryHandler.pullEntry(chrmId, 0);\n                  }\n                  // sessionStorage 存储加入房间的信息\n                  this._joinedChrmManager.set(chrmId, count);\n              }\n              return code;\n          });\n      }\n      /**\n       * 断网重连成功后，从 sessionStorage 缓存中获取用户已加入的聊天室，然后重新加入已存在的聊天室，并拉取消息\n      */\n      _rejoinChrm() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const joinedChrms = this._joinedChrmManager.get();\n              for (const chrmId in joinedChrms) {\n                  const code = yield this._joinChrm(chrmId, joinedChrms[chrmId], true);\n                  if (code === ErrorCode$1.SUCCESS) {\n                      this._watcher.chatroom({\n                          rejoinedRoom: {\n                              chatroomId: chrmId,\n                              count: joinedChrms[chrmId]\n                          }\n                      });\n                  }\n                  else {\n                      this._watcher.chatroom({\n                          rejoinedRoom: {\n                              chatroomId: chrmId,\n                              errorCode: code\n                          }\n                      });\n                  }\n              }\n          });\n      }\n      /**\n       * 拉取聊天室消息\n       * @param chrmId\n       * @param count 默认拉取 10 条，最大一次拉取 50 条，只在加入房间时第一次拉取时有效\n       */\n      _pullChrmMsg(chrmId, count = 10) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return;\n              }\n              const chrmInfo = this._chrmsQueue[chrmId];\n              const { pulling, timestamp } = chrmInfo;\n              if (pulling) {\n                  return;\n              }\n              const reqBody = this._channel.codec.encodeChrmSyncMsg(timestamp, count);\n              const signal = new QueryWriter(Topic$1[Topic$1.chrmPull], reqBody, chrmId);\n              const { code, data } = yield this._channel.send(signal, PBName.DownStreamMessages, {\n                  connectedTime: this._channel.connectedTime,\n                  currentUserId: this.currentUserId\n              });\n              if (code !== ErrorCode$1.SUCCESS || !data) {\n                  logger.warn('pull chatroom msg failed, code:', code, ', data:', data);\n                  return;\n              }\n              const { list, syncTime, finished } = data;\n              chrmInfo.timestamp = syncTime;\n              chrmInfo.pulling = false;\n              // 清除无效时间戳\n              chrmInfo.queue = chrmInfo.queue.filter(item => item > timestamp);\n              // 派发消息\n              list.forEach(item => {\n                  if (item.sentTime < timestamp) {\n                      return;\n                  }\n                  this._watcher.message(item);\n              });\n              if (!finished || chrmInfo.queue.length > 0) {\n                  this._pullChrmMsg(chrmId);\n              }\n          });\n      }\n      joinChatroom(chatroomId, count) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._joinChrm(chatroomId, count, false);\n          });\n      }\n      joinExistChatroom(chatroomId, count) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._joinChrm(chatroomId, count, true);\n          });\n      }\n      quitChatroom(chrmId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel } = this;\n              if (!channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const buff = channel.codec.encodeJoinOrQuitChatRoom();\n              const writer = new QueryWriter(QueryTopic.QUIT_CHATROOM, buff, chrmId);\n              const resp = yield channel.send(writer);\n              const { code } = resp;\n              if (code === ErrorCode$1.SUCCESS) {\n                  delete this._chrmsQueue[chrmId];\n                  this._chrmEntryHandler.reset(chrmId);\n                  // 移除加入聊天室存储信息\n                  this._joinedChrmManager.remove(chrmId);\n              }\n              return code;\n          });\n      }\n      getChatroomInfo(chatroomId, count, order) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel } = this;\n              if (!channel)\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              const buff = channel.codec.encodeGetChatRoomInfo(count, order);\n              const writer = new QueryWriter(Topic$1[Topic$1.queryChrmI], buff, chatroomId);\n              const resp = yield channel.send(writer, PBName.QueryChatRoomInfoOutput);\n              const { code, data } = resp;\n              if (code !== ErrorCode$1.SUCCESS)\n                  return { code };\n              return { code, data: data };\n          });\n      }\n      getChatroomHistoryMessages(chatroomId, timestamp, count, order) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel } = this;\n              if (!channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const buff = channel.codec.encodeGetHistoryMsg(chatroomId, { timestamp, count, order });\n              const writer = new QueryWriter(QueryHistoryTopic.CHATROOM, buff, chatroomId);\n              const resp = yield channel.send(writer, PBName.HistoryMsgOuput, {\n                  conversation: { targetId: chatroomId }\n              });\n              const { code } = resp;\n              const data = resp.data;\n              if (code !== ErrorCode$1.SUCCESS)\n                  return { code };\n              return { code, data: { list: data.list, hasMore: data.hasMore } };\n          });\n      }\n      _modifyChatroomKV(chatroomId, entry) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel, currentUserId } = this;\n              if (!channel)\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              const buff = channel.codec.encodeModifyChatRoomKV(chatroomId, entry, currentUserId);\n              const topic = entry.type === ChatroomEntryType$1.UPDATE ? QueryTopic.UPDATE_CHATROOM_KV : QueryTopic.DELETE_CHATROOM_KV;\n              const writer = new QueryWriter(topic, buff, chatroomId);\n              const resp = yield channel.send(writer);\n              const { code } = resp;\n              if (code === ErrorCode$1.SUCCESS) {\n                  this._chrmEntryHandler.setLocal(chatroomId, {\n                      kvEntries: [entry],\n                      syncTime: new Date().getTime()\n                  }, currentUserId);\n                  return code;\n              }\n              return code;\n          });\n      }\n      setChatroomEntry(chatroomId, entry) {\n          return __awaiter(this, void 0, void 0, function* () {\n              entry.type = ChatroomEntryType$1.UPDATE;\n              return this._modifyChatroomKV(chatroomId, entry);\n          });\n      }\n      forceSetChatroomEntry(chatroomId, entry) {\n          return __awaiter(this, void 0, void 0, function* () {\n              entry.type = ChatroomEntryType$1.UPDATE;\n              entry.isOverwrite = true;\n              return this._modifyChatroomKV(chatroomId, entry);\n          });\n      }\n      removeChatroomEntry(chatroomId, entry) {\n          return __awaiter(this, void 0, void 0, function* () {\n              entry.type = ChatroomEntryType$1.DELETE;\n              return this._modifyChatroomKV(chatroomId, entry);\n          });\n      }\n      forceRemoveChatroomEntry(chatroomId, entry) {\n          return __awaiter(this, void 0, void 0, function* () {\n              entry.type = ChatroomEntryType$1.DELETE;\n              entry.isOverwrite = true;\n              return this._modifyChatroomKV(chatroomId, entry);\n          });\n      }\n      getChatroomEntry(chatroomId, key) {\n          // 1、判断用户是否在聊天室，不在抛出 不在聊天室 错误码 2、从本地获取 key value 属性\n          const entry = this._chrmEntryHandler.getValue(chatroomId, key);\n          if (entry) {\n              return Promise.resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: entry\n              });\n          }\n          else {\n              return Promise.resolve({\n                  code: ErrorCode$1.CHATROOM_KEY_NOT_EXIST\n              });\n          }\n      }\n      getAllChatroomEntry(chatroomId) {\n          // 1、判断用户是否在聊天室，不在抛出 不在聊天室 错误码 2、从本地获取 key value 属性\n          const entries = this._chrmEntryHandler.getAll(chatroomId);\n          return Promise.resolve({\n              code: ErrorCode$1.SUCCESS,\n              data: entries\n          });\n      }\n      /**\n       * 拉取聊天室 KV 存储\n       * @param chatroomId\n       * @param timestamp\n      */\n      pullChatroomEntry(chatroomId, timestamp) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { _channel: channel, currentUserId } = this;\n              if (!channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const buff = channel.codec.encodePullChatRoomKV(timestamp);\n              const writer = new QueryWriter(Topic$1[Topic$1.pullKV], buff, chatroomId);\n              const resp = yield channel.send(writer, PBName.ChrmKVOutput);\n              const { code, data } = resp;\n              if (code === ErrorCode$1.SUCCESS) {\n                  // 拉取完成后，向本地缓存 kv\n                  this._chrmEntryHandler.setLocal(chatroomId, data, currentUserId);\n                  // 拉取完成后, 如果有拉取到更新的 entry 通知聊天室 KV 监听器\n                  const { kvEntries } = data;\n                  const updatedEntries = [];\n                  if (kvEntries.length > 0) {\n                      kvEntries.forEach(entry => {\n                          const { key, value, type, timestamp } = entry;\n                          updatedEntries.push({\n                              key,\n                              value: value,\n                              type: type,\n                              timestamp: timestamp,\n                              chatroomId\n                          });\n                      });\n                      this._watcher.chatroom({ updatedEntries });\n                  }\n                  return {\n                      code,\n                      data: data\n                  };\n              }\n              return { code };\n          });\n      }\n      /**\n       * 消息发送\n       * @param conversationType\n       * @param targetId\n       * @param options\n       */\n      sendMessage(conversationType, targetId, options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              options = handleInnerMsgOptions(options, this.currentUserId);\n              options = this._handleMsgProperties(options, true);\n              // 检查是否为状态消息，状态消息只在单聊、群聊类型会话中有效\n              const isStatusMessage = [ConversationType$1.PRIVATE, ConversationType$1.GROUP].includes(conversationType)\n                  ? options.isStatusMessage\n                  : false;\n              const topic = isStatusMessage ? getStatPubTopic(conversationType) : (getPubTopic(conversationType) || Topic$1.ppMsgP);\n              if (isStatusMessage) {\n                  options.isPersited = false;\n                  options.isCounted = false;\n              }\n              const data = this._channel.codec.encodeUpMsg({ type: conversationType, targetId }, options);\n              const signal = new PublishWriter(Topic$1[topic], data, targetId);\n              signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n              // 状态消息无 Ack 应答\n              if (isStatusMessage) {\n                  this._channel.sendOnly(signal);\n                  return {\n                      code: ErrorCode$1.SUCCESS,\n                      data: transSentAttrs2IReceivedMessage(conversationType, targetId, Object.assign({}, options), '', 0, this.currentUserId)\n                  };\n              }\n              const { code, data: resp } = yield this._channel.send(signal);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return { code };\n              }\n              const pubAck = resp;\n              // 更新发件箱时间\n              this._letterbox.setOutboxTime(pubAck.timestamp, this.currentUserId);\n              // 更新会话监听\n              const receivedMessage = transSentAttrs2IReceivedMessage(conversationType, targetId, Object.assign({}, options), pubAck.messageUId, pubAck.timestamp, this.currentUserId);\n              this._conversationManager.setConversationCacheByMessage(receivedMessage, true);\n              return {\n                  code: ErrorCode$1.SUCCESS,\n                  data: receivedMessage\n              };\n          });\n      }\n      recallMsg(conversationType, targetId, messageUId, sentTime, recallMsgOptions) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const { user } = recallMsgOptions;\n              // user 为发送撤回消息携带的用户信息\n              const msg = {\n                  content: { conversationType, targetId, messageUId, sentTime, user },\n                  messageType: 'RC:RcCmd'\n              };\n              const topic = Topic$1[Topic$1.recallMsg];\n              const data = this._channel.codec.encodeUpMsg({ type: conversationType, targetId }, msg);\n              const signal = new PublishWriter(topic, data, this.currentUserId);\n              signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n              const { code, data: resp } = yield this._channel.send(signal);\n              if (code !== ErrorCode$1.SUCCESS) {\n                  return { code };\n              }\n              const pubAck = resp;\n              return {\n                  code: ErrorCode$1.SUCCESS,\n                  data: transSentAttrs2IReceivedMessage(conversationType, targetId, Object.assign({}, msg), pubAck.messageUId, pubAck.timestamp, this.currentUserId)\n              };\n          });\n      }\n      /**\n       * 拉取用户配置\n       * @todo 需要确定 version 的作用是什么\n       * @param version\n       */\n      pullUserSettings(version) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const buff = this._channel.codec.encodePullUserSetting(version);\n              const writer = new QueryWriter(Topic$1[Topic$1.pullUS], buff, this.currentUserId);\n              return this._channel.send(writer, PBName.PullUserSettingOutput);\n          });\n      }\n      getFileToken(fileType, fileName) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              // 若不设置 fileName 百度上传的认证数据均返回 null\n              const uploadFileName = getUploadFileName(fileType, fileName);\n              const buff = this._channel.codec.encodeGetFileToken(fileType, uploadFileName);\n              const writer = new QueryWriter(Topic$1[Topic$1.qnTkn], buff, this.currentUserId);\n              let { code, data } = yield this._channel.send(writer, PBName.GetQNupTokenOutput);\n              data = Object.assign(data, { fileName: uploadFileName });\n              if (code === ErrorCode$1.SUCCESS) {\n                  return {\n                      code,\n                      data: data\n                  };\n              }\n              return { code };\n          });\n      }\n      getFileUrl(fileType, uploadMethod, fileName, originName) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              let topic = '';\n              let inputPBName = '';\n              let outputPBName = '';\n              if (uploadMethod === UploadMethod$1.QINIU) {\n                  topic = Topic$1[Topic$1.qnUrl];\n                  inputPBName = PBName.GetQNdownloadUrlInput;\n                  outputPBName = PBName.GetQNdownloadUrlOutput;\n              }\n              else {\n                  topic = Topic$1[Topic$1.aliUrl];\n                  inputPBName = PBName.GetDownloadUrlInput;\n                  outputPBName = PBName.GetDownloadUrlOutput;\n              }\n              const buff = this._channel.codec.encodeGetFileUrl(inputPBName, fileType, fileName, originName);\n              const writer = new QueryWriter(topic, buff, this.currentUserId);\n              const { code, data } = yield this._channel.send(writer, outputPBName);\n              const resp = data;\n              if (code === ErrorCode$1.SUCCESS) {\n                  return {\n                      code,\n                      data: resp\n                  };\n              }\n              return { code };\n          });\n      }\n      disconnect() {\n          if (this._channel) {\n              this._channel.close();\n              this._channel = undefined;\n          }\n      }\n      destroy() {\n          throw new Error('JSEngine\\'s method not implemented.');\n      }\n      registerMessageType(objectName, isPersited, isCounted, searchProps) {\n          // ✔️ 根据 objectName 将自定义消息属性内存态存储 [objectName]: {isPersited, isCounted}\n          this._customMessageType[objectName] = { isPersited, isCounted };\n          // 根据 messageName searchProps 生成构造消息（ V3 不实现 V2 API 层实现）\n          // ✔️ SDK 发消息时，根据内置消息类型或自定义消息类型去处理 存储、计数属性\n          // ✔️ SDK 收到消息后，内置消息类型的属性（存储、计数）去处理收到的消息、本地会话未读数存储\n      }\n      // ===================== RTC 相关接口 =====================\n      joinRTCRoom(roomId, mode, broadcastType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const reqBody = this._channel.codec.encodeJoinRTCRoom(mode, broadcastType);\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcRJoin_data], reqBody, roomId);\n              return this._channel.send(writer, PBName.RtcUserListOutput);\n          });\n      }\n      quitRTCRoom(roomId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeQuitRTCRoom();\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcRExit], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      rtcPing(roomId, mode, broadcastType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeJoinRTCRoom(mode, broadcastType);\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcPing], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      getRTCRoomInfo(roomId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const reqBody = this._channel.codec.encodeGetRTCRoomInfo();\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcRInfo], reqBody, roomId);\n              return this._channel.send(writer, PBName.RtcRoomInfoOutput);\n          });\n      }\n      getRTCUserInfoList(roomId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const reqBody = this._channel.codec.encodeGetRTCRoomInfo();\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcUData], reqBody, roomId);\n              const { code, data } = yield this._channel.send(writer, PBName.RtcUserListOutput);\n              return { code, data: data ? { users: data.users } : data };\n          });\n      }\n      // TODO: 排查 rtcUPut 超时无响应问题\n      setRTCUserInfo(roomId, key, value) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeSetRTCUserInfo(key, value);\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcUPut], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      removeRTCUserInfo(roomId, keys) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeRemoveRTCUserInfo(keys);\n              const writer = new PublishWriter(Topic$1[Topic$1.rtcUDel], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      setRTCData(roomId, key, value, isInner, apiType, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeSetRTCData(key, value, isInner, apiType, message);\n              const writer = new PublishWriter(Topic$1[Topic$1.rtcSetData], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      setRTCTotalRes(roomId, message, valueInfo, objectName) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeUserSetRTCData(message, valueInfo, objectName);\n              const writer = new PublishWriter(Topic$1[Topic$1.userSetData], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      getRTCData(roomId, keys, isInner, apiType) {\n          if (!this._channel) {\n              return Promise.resolve({ code: ErrorCode$1.RC_NET_CHANNEL_INVALID });\n          }\n          const reqBody = this._channel.codec.encodeGetRTCData(keys, isInner, apiType);\n          const writer = new QueryWriter(Topic$1[Topic$1.rtcQryData], reqBody, roomId);\n          return this._channel.send(writer, PBName.RtcQryOutput);\n      }\n      removeRTCData(roomId, keys, isInner, apiType, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeRemoveRTCData(keys, isInner, apiType, message);\n              const writer = new PublishWriter(Topic$1[Topic$1.rtcDelData], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      setRTCOutData(roomId, rtcData, type, message) {\n          // const data = this._serverDataCodec.encodeSetRTCOutData(rtcData, type, message);\n          // let writer = new PublishWriter(QUERY_TOPIC.SET_RTC_OUT_DATA, data, roomId);\n          // return this._sendSignalForData(writer);\n          throw new Error('JSEngine\\'s method not implemented.');\n      }\n      getRTCOutData(roomId, userIds) {\n          // const data = this._serverDataCodec.ecnodeGetRTCOutData(userIds);\n          // let writer = new QueryWriter(QUERY_TOPIC.GET_RTC_OUT_DATA, data, roomId);\n          // return this._sendSignalForData(writer, PBName.RtcUserOutDataOutput);\n          throw new Error('JSEngine\\'s method not implemented.');\n      }\n      getRTCToken(roomId, mode, broadcastType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return { code: ErrorCode$1.RC_NET_CHANNEL_INVALID };\n              }\n              const reqBody = this._channel.codec.encodeJoinRTCRoom(mode, broadcastType);\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcToken], reqBody, roomId);\n              return this._channel.send(writer, PBName.RtcTokenOutput);\n          });\n      }\n      setRTCState(roomId, report) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (!this._channel) {\n                  return ErrorCode$1.RC_NET_CHANNEL_INVALID;\n              }\n              const reqBody = this._channel.codec.encodeSetRTCState(report);\n              const writer = new QueryWriter(Topic$1[Topic$1.rtcUserState], reqBody, roomId);\n              const { code } = yield this._channel.send(writer);\n              return code;\n          });\n      }\n      getRTCUserInfo(roomId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              throw new Error('Method not implemented.');\n          });\n      }\n      getRTCUserList(roomId) {\n          if (!this._channel) {\n              return Promise.resolve({ code: ErrorCode$1.RC_NET_CHANNEL_INVALID });\n          }\n          const data = this._channel.codec.encodeGetRTCRoomInfo();\n          const writer = new QueryWriter(Topic$1[Topic$1.rtcUList], data, roomId);\n          return this._channel.send(writer, PBName.RtcUserListOutput);\n      }\n      /* ================ 以下为 CPP 特有接口，JSEngine 无需实现 ================== */\n      clearConversations() {\n          throw new Error('Method not implemented.');\n      }\n      setUserStatusListener(config, listener) {\n          throw new Error('Method not implemented.');\n      }\n      setUserStatus(status) {\n          throw new Error('Method not implemented.');\n      }\n      subscribeUserStatus(userIds) {\n          throw new Error('Method not implemented.');\n      }\n      getUserStatus(userId) {\n          throw new Error('Method not implemented.');\n      }\n      addToBlacklist(userId) {\n          throw new Error('Method not implemented.');\n      }\n      removeFromBlacklist(userId) {\n          throw new Error('Method not implemented.');\n      }\n      getBlacklist() {\n          throw new Error('Method not implemented.');\n      }\n      getBlacklistStatus(userId) {\n          throw new Error('Method not implemented.');\n      }\n      insertMessage(conversationType, targetId, insertOptions) {\n          throw new Error('Method not implemented.');\n      }\n      deleteMessages(timestamps) {\n          throw new Error('Method not implemented.');\n      }\n      deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace, channelId) {\n          throw new Error('Method not implemented.');\n      }\n      clearMessages(conversationType, targetId, channelId) {\n          throw new Error('Method not implemented.');\n      }\n      getMessage(messageId) {\n          throw new Error('Method not implemented.');\n      }\n      setMessageContent(messageId, content, objectName) {\n          throw new Error('Method not implemented.');\n      }\n      setMessageSearchField(messageId, content, searchFiles) {\n          throw new Error('Method not implemented.');\n      }\n      searchConversationByContent(keyword, messageTypes, channelId, conversationTypes) {\n          throw new Error('Method not implemented.');\n      }\n      searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total) {\n          throw new Error('Method not implemented.');\n      }\n      getUnreadMentionedMessages(conversationType, targetId) {\n          throw new Error('Method not implemented.');\n      }\n      setMessageSentStatus(messageId, sentStatus) {\n          throw new Error('Method not implemented.');\n      }\n      setMessageReceivedStatus(messageId, receivedStatus) {\n          throw new Error('Method not implemented.');\n      }\n      clearUnreadCountByTimestamp(conversationType, targetId, timestamp, channelId) {\n          throw new Error('Method not implemented.');\n      }\n      getConversationNotificationStatus(conversationType, targetId, channelId) {\n          throw new Error('Method not implemented.');\n      }\n      getRemoteHistoryMessages(conversationType, targetId, timestamp, count, order, channelId) {\n          throw new Error('Method not implemented.');\n      }\n  }\n\n  /**\n   * 音视频模式\n   */\n  (function (RTCMode) {\n      /**\n       * 普通音视频模式\n       */\n      RTCMode[RTCMode[\"RTC\"] = 0] = \"RTC\";\n      /**\n       * 直播模式\n       */\n      RTCMode[RTCMode[\"LIVE\"] = 2] = \"LIVE\";\n  })(exports.RTCMode || (exports.RTCMode = {}));\n  (function (LiveType) {\n      /**\n       * 音视频直播\n       */\n      LiveType[LiveType[\"AUDIO_AND_VIDEO\"] = 0] = \"AUDIO_AND_VIDEO\";\n      /**\n       * 音频直播\n       */\n      LiveType[LiveType[\"AUDIO\"] = 1] = \"AUDIO\";\n  })(exports.LiveType || (exports.LiveType = {}));\n  (function (LiveRole) {\n      /**\n       * 主播身份\n       */\n      LiveRole[LiveRole[\"ANCHOR\"] = 1] = \"ANCHOR\";\n      /**\n       * 观众身份\n       */\n      LiveRole[LiveRole[\"AUDIENCE\"] = 2] = \"AUDIENCE\";\n  })(exports.LiveRole || (exports.LiveRole = {}));\n  /**\n   * CallLib 流程消息\n   */\n  const CallLibMsgType = {\n      'RC:VCAccept': 'RC:VCAccept',\n      'RC:VCRinging': 'RC:VCRinging',\n      'RC:VCSummary': 'RC:VCSummary',\n      'RC:VCHangup': 'RC:VCHangup',\n      'RC:VCInvite': 'RC:VCInvite',\n      'RC:VCModifyMedia': 'RC:VCModifyMedia',\n      'RC:VCModifyMem': 'RC:VCModifyMem'\n  };\n  (function (RTCApiType) {\n      RTCApiType[RTCApiType[\"ROOM\"] = 1] = \"ROOM\";\n      RTCApiType[RTCApiType[\"PERSON\"] = 2] = \"PERSON\";\n  })(exports.RTCApiType || (exports.RTCApiType = {}));\n\n  const string10to64 = (number) => {\n      const chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split('');\n      const radix = chars.length + 1;\n      let qutient = +number;\n      const arr = [];\n      do {\n          const mod = qutient % radix;\n          qutient = (qutient - mod) / radix;\n          arr.unshift(chars[mod]);\n      } while (qutient);\n      return arr.join('');\n  };\n  const getUUID22 = () => {\n      let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n          const r = Math.random() * 16 | 0;\n          const v = c === 'x' ? r : (r & 0x3 | 0x8);\n          return v.toString(16);\n      });\n      uuid = uuid.replace(/-/g, '') + 'a';\n      const uuidNum = parseInt(uuid, 16);\n      uuid = string10to64(uuidNum);\n      if (uuid.length > 22) {\n          uuid = uuid.slice(0, 22);\n      }\n      if (uuid.length < 22) {\n          const len = 22 - uuid.length;\n          for (let i = 0; i < len; i++) {\n              uuid = uuid + '0';\n          }\n      }\n      return uuid;\n  };\n  class Heartbeat {\n      constructor(pongRes, connectionListener) {\n          this._timerId = 0;\n          this._heartbeatTimeoutId = 0;\n          this._isFirstPing = true;\n          this._hasPingRes = pongRes;\n          this._connectionListener = connectionListener;\n      }\n      start(cppHeartbeatFunc, cppEngine) {\n          const self = this;\n          const startHeartbeat = () => {\n              const time = this._isFirstPing ? 0 : 15 * 1000;\n              self._timerId = setTimeout(() => {\n                  self._isFirstPing = false;\n                  if (self._hasPingRes) {\n                      cppHeartbeatFunc.call(cppEngine);\n                      self._hasPingRes = false;\n                      startHeartbeat();\n                  }\n                  else {\n                      self._heartbeatTimeoutId = setTimeout(() => {\n                          // 网络不可用后，ping 超时暂不抛出，状态监听器会抛出网络不可用\n                          // self._connectionListener.call(cppEngine, ErrorCode.NETWORK_ERROR)\n                      }, 90 * 1000);\n                  }\n              }, time);\n          };\n          startHeartbeat();\n      }\n      stop() {\n          clearTimeout(this._timerId);\n      }\n      setHeartbeatRes(hasRes) {\n          this._hasPingRes = hasRes;\n          if (this._hasPingRes) {\n              clearTimeout(this._heartbeatTimeoutId);\n          }\n      }\n  }\n  /**\n   * 用于对接协议栈的基础引擎桥接类\n   */\n  class CPPEngine extends AEngine {\n      constructor(_runtime, _appkey, _watcher, _apiVersion, _cppProtocol, _options) {\n          super(_runtime, _appkey, _watcher, _apiVersion, _options);\n          this._cppProtocol = _cppProtocol;\n          this._currentToken = '';\n          this._connectionStatus = ConnectionStatus$1.DISCONNECTED;\n          this._promiseHandler = {};\n          this._customMessageType = {};\n          this._heartbeat = {};\n          this._connectionListener = (status) => { };\n          this._cppConnectionStatus = ConnectionStatus$1.DISCONNECTED;\n          this.init(_appkey, { version: _apiVersion, dbPath: _options.dbPath || '', navi: _options.navigators[0] || '' });\n          this._setConnectionStatusListener(_watcher.status);\n          this._setOnReceiveMessageListener(_watcher.message);\n          this._setConversationStatusListener(_watcher.conversation);\n      }\n      /**\n       * 批量注册内置消息\n      */\n      _registerMsgTypes() {\n          SEND_MESSAGE_TYPE_OPTION['RC:RcCmd'] = { isCounted: false, isPersited: false };\n          for (const messageType in SEND_MESSAGE_TYPE_OPTION) {\n              const { isCounted, isPersited } = SEND_MESSAGE_TYPE_OPTION[messageType];\n              let msgOptions = 0;\n              if (isPersited) {\n                  msgOptions = msgOptions | 0x01;\n              }\n              if (isCounted) {\n                  msgOptions = msgOptions | 0x02;\n              }\n              this._cppProtocol.registerMessageType(messageType, msgOptions);\n          }\n      }\n      /**\n       * 消息构建\n      */\n      _buildMessage(result, isOffLineMessage) {\n          const receivedCppMessage = JSON.parse(result);\n          const { channelId, conversationType, targetId, senderUserId, content, objectName, messageUid, direction, status, source, messageId, sentTime } = receivedCppMessage;\n          let msgContent;\n          // try {\n          //   msgContent = content ? JSON.parse(content) : content\n          // } catch (error) {\n          //   logger.error('cpp engine build messaga error:', error)\n          //   msgContent = content\n          // }\n          if (isObject(content)) {\n              msgContent = content;\n          }\n          else {\n              msgContent = content ? JSON.parse(content) : content;\n          }\n          let msgOptions = { isCounted: false, isPersited: false };\n          if (objectName in SEND_MESSAGE_TYPE_OPTION) {\n              msgOptions = SEND_MESSAGE_TYPE_OPTION[objectName];\n          }\n          else if (objectName in this._customMessageType) {\n              msgOptions = this._customMessageType[objectName];\n          }\n          const isOffline = isUndefined(isOffLineMessage) ? (sentTime < this.connectedTime) : isOffLineMessage;\n          const msg = {\n              channelId,\n              conversationType,\n              targetId,\n              senderUserId,\n              content: msgContent || {},\n              messageType: objectName,\n              messageUId: messageUid,\n              messageDirection: direction,\n              isOffLineMessage: isOffline,\n              sentTime,\n              receivedTime: 0,\n              isPersited: msgOptions.isPersited,\n              isCounted: msgOptions.isCounted,\n              isMentioned: false,\n              disableNotification: false,\n              isStatusMessage: false,\n              canIncludeExpansion: false,\n              expansion: null,\n              receivedStatus: status,\n              messageId\n          };\n          if (direction === MessageDirection$1.RECEIVE) {\n              msg.receivedStatus = status;\n          }\n          else if (direction === MessageDirection$1.SEND) {\n              msg.sentStatus = status;\n          }\n          return msg;\n      }\n      /**\n       * 会话构建\n      */\n      _buildConversation(result) {\n          const conver = JSON.parse(result);\n          const { channelId, conversationType, targetId, unreadCount: unreadMessageCount, lastestMsg, isTop, isBlocked } = conver;\n          const isTopToBool = isTop === 1;\n          const isNotify = isBlocked === 1 ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE;\n          return {\n              channelId,\n              conversationType,\n              targetId,\n              unreadMessageCount,\n              latestMessage: this._buildMessage(lastestMsg),\n              hasMentioned: false,\n              mentionedInfo: null,\n              notificationStatus: isNotify,\n              isTop: isTopToBool,\n              lastUnreadTime: 0\n          };\n      }\n      /**\n       * 设置连接状态监听器\n       * ConnectionStatus_TokenIncorrect = 31004,\n       * ConnectionStatus_Connected = 0,\n       * ConnectionStatus_KickedOff = 6,// 其他设备登录\n       * ConnectionStatus_Connecting = 10,// 连接中\n       * ConnectionStatus_SignUp = 12, // 未登录\n       * ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n       * ConnectionStatus_ServerInvalid = 8, // 断开\n       * ConnectionStatus_ValidateFailure = 9,//断开\n       * ConnectionStatus_Unconnected = 11,//断开\n       * ConnectionStatus_DisconnExecption = 31011 //断开\n       * RC_NAVI_MALLOC_ERROR   = 30000,//断开\n       * RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n       * RC_NAVI_SEND_FAIL      = 30004,//断开\n       * RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n       * RC_NAVI_RECV_FAIL      = 30006,//断开\n       * RC_NAVI_RESOURCE_ERROR = 30007,//断开\n       * RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n       * RC_NAVI_DNS_ERROR      = 30009,//断开\n      */\n      _setConnectionStatusListener(listener) {\n          this._connectionListener = listener;\n          this._cppProtocol.setConnectionStatusListener((status) => {\n              logger.warn('protocol connection status changed:', status);\n              this._cppConnectionStatus = status;\n              let connectionStatus;\n              switch (status) {\n                  case 10:\n                      connectionStatus = ConnectionStatus$1.CONNECTING;\n                      break;\n                  case 31004:\n                      setTimeout(() => {\n                          this._promiseHandler.connect && this._promiseHandler.connect.resolve(ErrorCode$1.RC_CONN_USER_OR_PASSWD_ERROR);\n                      });\n                      return;\n                  case 12:\n                      connectionStatus = ConnectionStatus$1.DISCONNECTED;\n                      break;\n                  case 13:\n                      connectionStatus = ConnectionStatus$1.BLOCKED;\n                      break;\n                  case 1:\n                  case 8:\n                  case 9:\n                  case 11:\n                  case 31011:\n                  case 30000:\n                  case 30002:\n                      connectionStatus = ConnectionStatus$1.NETWORK_UNAVAILABLE;\n                      break;\n                  case 30010:\n                      // 收到 30010 说明协议栈已重连失败，SDK 内部开始尝试定时重连\n                      this._try2Reconnect();\n                      connectionStatus = ConnectionStatus$1.NETWORK_UNAVAILABLE;\n                      break;\n                  case 0:\n                  case 33005:\n                      connectionStatus = ConnectionStatus$1.CONNECTED;\n                      this.connectedTime = new Date().getTime() - this._cppProtocol.getDeltaTime();\n                      setTimeout(() => {\n                          this._promiseHandler.connect && this._promiseHandler.connect.resolve(ErrorCode$1.SUCCESS);\n                          this._heartbeat = new Heartbeat(true, listener);\n                          this._heartbeat.start(this._sendHeartbeat, this);\n                      });\n                      break;\n                  case ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT:\n                      connectionStatus = ConnectionStatus$1.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                      break;\n                  case 30004:\n                      // 断网内部重连失败状态码，不向上层抛出\n                      return;\n                  default:\n                      connectionStatus = status;\n                      break;\n              }\n              this._connectionStatus = connectionStatus;\n              setTimeout(() => {\n                  listener(connectionStatus);\n              });\n          }, this._dbInitCallback, () => {\n              this._heartbeat.setHeartbeatRes(true);\n          });\n      }\n      /**\n       * 数据库初始化回调\n      */\n      _dbInitCallback(code) {\n      }\n      /**\n       * 发送心跳\n      */\n      _sendHeartbeat() {\n          this._cppProtocol.sendHeartbeat();\n      }\n      /**\n       * 重连\n      */\n      _try2Reconnect() {\n          if (this._cppConnectionStatus !== 30010 && this._cppConnectionStatus !== 30004) {\n              return;\n          }\n          this._cppProtocol.connectWithToken(this._currentToken, '', () => { });\n          // 等待 5s 后重新尝试\n          setTimeout(() => {\n              this._try2Reconnect();\n          }, 5000);\n      }\n      /**\n       * 设置消息监听器\n      */\n      _setOnReceiveMessageListener(listener) {\n          this._cppProtocol.setOnReceiveMessageListener((result, leftCount, offline, hasMore) => {\n              // 构建消息\n              const message = this._buildMessage(result, offline);\n              // 触发 API Context 消息监听\n              listener(message);\n          });\n      }\n      /**\n       * 设置会话状态监听器\n      */\n      _setConversationStatusListener(listener) {\n          this._cppProtocol.setConversationStatusListener((result) => {\n              const list = JSON.parse(result).list;\n              const updatedConvers = [];\n              list.forEach(conver => {\n                  const converData = JSON.parse(conver.obj);\n                  const { conversationType, targetId, status, channelId } = converData;\n                  const statusObj = { notificationStatus: 2, isTop: false };\n                  status.forEach(status => {\n                      const itemObj = JSON.parse(status.item);\n                      if (itemObj.type === 1) {\n                          statusObj.notificationStatus = Number(itemObj.value) === 1 ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE;\n                      }\n                      else {\n                          statusObj.isTop = Number(itemObj.value) === 1;\n                      }\n                  });\n                  updatedConvers.push({\n                      channelId,\n                      conversationType,\n                      targetId,\n                      updatedItems: {\n                          notificationStatus: { val: statusObj.notificationStatus, time: 0 },\n                          isTop: { val: statusObj.isTop, time: 0 }\n                      }\n                  });\n              });\n              listener(updatedConvers);\n          });\n      }\n      /**\n       * 清空监听器\n      */\n      _clearListener() {\n          this._cppProtocol.setOnReceiveMessageListener();\n          this._cppProtocol.setConnectionStatusListener();\n          this._cppProtocol.setOnReceiveStatusListener();\n      }\n      /**\n       * 初始化\n      */\n      init(appkey, config) {\n          // 1、获取 SDK 信息\n          let sdkInfo = this._cppProtocol.initWithAppkey(appkey, config === null || config === void 0 ? void 0 : config.dbPath, config);\n          if (sdkInfo) {\n              sdkInfo = JSON.parse(sdkInfo);\n          }\n          // 2、调用 c++ 接口注册内置消息\n          this._registerMsgTypes();\n          // 3、设置 DeviceId\n          const deviceIdKey = `${appkey}_device_id`;\n          let deviceId = this.runtime.localStorage.getItem(deviceIdKey);\n          if (!deviceId) {\n              deviceId = getUUID22();\n              this.runtime.localStorage.setItem(deviceIdKey, deviceId);\n          }\n          this._cppProtocol.setDeviceId(deviceId);\n          return sdkInfo;\n      }\n      /**\n       * 注册自定义消息\n      */\n      registerMessageType(messageType, isPersited, isCounted, searchProps) {\n          let msgOptions = 0;\n          if (isPersited) {\n              msgOptions = msgOptions | 0x01;\n          }\n          if (isCounted) {\n              msgOptions = msgOptions | 0x02;\n          }\n          this._customMessageType[messageType] = { isCounted, isPersited };\n          this._cppProtocol.registerMessageType(messageType, msgOptions, searchProps);\n      }\n      /**\n       * 连接\n      */\n      connect(token, naviInfo, connectType, userId, options = {}) {\n          this._currentToken = token;\n          // 设置环境信息\n          if (options.type) {\n              this._cppProtocol.setEnvironment(true);\n          }\n          // 通过 token 连接\n          this._cppProtocol.connectWithToken(token, userId, (userId) => {\n              this.currentUserId = userId;\n          });\n          return new Promise((resolve, reject) => {\n              this._promiseHandler.connect = { resolve, reject };\n          });\n      }\n      /**\n       * 断开链接\n      */\n      disconnect() {\n          // this._clearListener()\n          this._cppProtocol.disconnect(true);\n          this._heartbeat.stop();\n          this._connectionListener(ConnectionStatus$1.DISCONNECTED);\n      }\n      /**\n       * 注销登录\n      */\n      logout() {\n          this.disconnect();\n      }\n      getConnectTime() {\n          return new Promise((resolve, reject) => {\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: this.connectedTime\n              });\n          });\n      }\n      /**\n       * 设置用户在线状态监听器\n      */\n      setUserStatusListener(config, listener) {\n          this._cppProtocol.setOnReceiveStatusListener((userId, status) => {\n              listener({\n                  userId: userId,\n                  status: status\n              });\n          });\n          const userIds = config.userIds || [];\n          if (userIds.length) {\n              this.subscribeUserStatus(userIds);\n          }\n      }\n      /**\n       * 订阅用户在线状态\n      */\n      subscribeUserStatus(userIds) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.subscribeUserStatus(userIds, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve);\n          });\n      }\n      /**\n       * 设置当前用户在线状态\n      */\n      setUserStatus(status) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.setUserStatus(status, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve);\n          });\n      }\n      /**\n       * 获取用户状态\n      */\n      getUserStatus(userId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.getUserStatus(userId, (status) => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: { status }\n                  });\n              }, (code) => {\n                  resolve({ code });\n              });\n          });\n      }\n      /**\n       * 发送消息\n      */\n      sendMessage(conversationType, targetId, options) {\n          let { messageType, content, pushContent, pushData, directionalUserIdList, disableNotification, canIncludeExpansion, expansion, isVoipPush, pushConfig, channelId } = options;\n          let { iOSConfig, androidConfig, pushTitle, pushContent: newPushContent, pushData: newPushData, disablePushTitle, forceShowDetailContent } = pushConfig || {};\n          const serverPushConfigStr = pushConfigsToJSON(iOSConfig, androidConfig);\n          return new Promise((resolve, reject) => {\n              // pushContent、pushData 优先使用 pushConfig.pushContent pushConfig.pushData\n              pushContent = newPushContent || pushContent || '';\n              pushData = newPushData || pushData || '';\n              disableNotification = disableNotification || false;\n              expansion = expansion || '';\n              isVoipPush = isVoipPush || false;\n              pushTitle = pushTitle || '';\n              newPushContent = newPushContent || '';\n              newPushData = newPushData || '';\n              disablePushTitle = disablePushTitle || false;\n              forceShowDetailContent = forceShowDetailContent || false;\n              canIncludeExpansion = canIncludeExpansion || false;\n              const notificationId = (androidConfig === null || androidConfig === void 0 ? void 0 : androidConfig.notificationId) || '';\n              // TODO 待确认逻辑 start\n              const isGroup = conversationType === ConversationType$1.GROUP;\n              directionalUserIdList = [];\n              if (isGroup && messageType === MessageType$1.READ_RECEIPT_RESPONSE) {\n                  if (content.receiptMessageDic) {\n                      for (const key in content.receiptMessageDic) {\n                          directionalUserIdList === null || directionalUserIdList === void 0 ? void 0 : directionalUserIdList.push(key);\n                      }\n                  }\n              }\n              if (isGroup && messageType === MessageType$1.READ_RECEIPT_REQUEST) {\n                  directionalUserIdList === null || directionalUserIdList === void 0 ? void 0 : directionalUserIdList.push(this.currentUserId);\n              }\n              // TODO 待确认逻辑 end\n              const onSuccess = (message, code) => {\n                  const msg = this._buildMessage(message, false);\n                  if (code === ErrorCode$1.SENSITIVE_REPLACE) {\n                      return resolve({ code });\n                  }\n                  return resolve({ code: ErrorCode$1.SUCCESS, data: msg });\n              };\n              const onError = (message, code) => {\n                  const msg = this._buildMessage(message, false);\n                  return resolve({ code, data: msg });\n              };\n              const pushTplId = ''; // PUSH 模板 ID，PUSH 二期功能\n              this._cppProtocol.sendMessage(onSuccess, onError, conversationType, targetId, messageType, JSON.stringify(content), directionalUserIdList, disableNotification, disablePushTitle, forceShowDetailContent, pushContent, pushData, notificationId, pushTitle, serverPushConfigStr, pushTplId, canIncludeExpansion, JSON.stringify(expansion), isVoipPush, channelId);\n          });\n      }\n      /**\n       * 撤回消息\n      */\n      recallMsg(conversationType, targetId, messageUId, sentTime, recallMsgOptions) {\n          return new Promise((resolve, reject) => {\n              let { user, pushContent, channelId, oriContent } = recallMsgOptions;\n              pushContent = pushContent || '';\n              const message = {\n                  conversationType,\n                  targetId,\n                  senderUserId: this.currentUserId,\n                  content: oriContent,\n                  objectName: MessageType$1.RECALL,\n                  messageUid: messageUId,\n                  messageDirection: MessageDirection$1.SEND,\n                  status: ReceivedStatus$1.UNREAD,\n                  sentTime\n              };\n              const returnMsg = this._buildMessage(JSON.stringify(message), false);\n              const disableNotification = false;\n              const disablePushTitle = false;\n              const forceShowDetailContent = false;\n              const pushData = '';\n              const notificationId = '';\n              const pushTitle = '';\n              const pushConfig = '';\n              const pushTemplateId = '';\n              const onSuccess = () => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: returnMsg\n                  });\n              };\n              const onError = (code) => {\n                  resolve({ code });\n              };\n              this._cppProtocol.recallMessage(onSuccess, onError, MessageType$1.RECALL, JSON.stringify(returnMsg), disableNotification, disablePushTitle, forceShowDetailContent, pushContent, pushData, notificationId, pushTitle, pushConfig, pushTemplateId, channelId);\n          });\n      }\n      getHistoryMessage(conversationType, targetId, timestamp, count, order, channelId) {\n          return new Promise((resolve, reject) => {\n              timestamp = timestamp || 0;\n              const desc = order === 0;\n              const searchCount = count + 1;\n              const cppMessagaes = this._cppProtocol.getHistoryMessages(conversationType, targetId, timestamp, searchCount, '', desc, channelId);\n              const messages = JSON.parse(cppMessagaes).list;\n              const hisMessages = [];\n              messages.reverse();\n              for (let i = 0; i < messages.length; i++) {\n                  const buildMsg = this._buildMessage(messages[i].obj);\n                  hisMessages[i] = buildMsg;\n              }\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: {\n                      list: searchCount === hisMessages.length ? hisMessages.slice(1, searchCount) : hisMessages,\n                      hasMore: count < hisMessages.length // 如果查到历史消息的长度大于用户实际传入的长度，说明还有更多消息\n                  }\n              });\n          });\n      }\n      getRemoteHistoryMessages(conversationType, targetId, timestamp, count, order, channelId) {\n          return new Promise((resolve, reject) => {\n              timestamp = timestamp || 0;\n              const desc = 0;\n              const needRepeatMsg = true;\n              const onSuccess = (result, hasMore) => {\n                  const messages = JSON.parse(result).list;\n                  const hisMessages = [];\n                  messages.reverse();\n                  for (let i = 0; i < messages.length; i++) {\n                      const buildMsg = this._buildMessage(messages[i].obj);\n                      hisMessages[i] = buildMsg;\n                  }\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: {\n                          list: hisMessages,\n                          hasMore: !!hasMore\n                      }\n                  });\n              };\n              const onError = (code) => {\n                  resolve({ code });\n              };\n              this._cppProtocol.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, onSuccess, onError, desc, needRepeatMsg, channelId);\n          });\n      }\n      deleteRemoteMessage(conversationType, targetId, messages, channelId) {\n          return new Promise((resolve, reject) => {\n              const msgsStr = JSON.stringify(messages);\n              const onSuccess = () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              };\n              // 保持功能单一性，仅删除远端，不删除本地\n              const isDelLocal = false;\n              this._cppProtocol.deleteRemoteHistoryMessages(conversationType, targetId, msgsStr, isDelLocal, channelId, onSuccess, resolve);\n          });\n      }\n      deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp, channelId) {\n          return new Promise((resolve, reject) => {\n              const onSuccess = () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              };\n              const onError = (code) => {\n                  resolve(code);\n              };\n              this._cppProtocol.clearRemoteHistoryMessages(conversationType, targetId, timestamp, onSuccess, onError, channelId);\n          });\n      }\n      clearMessages(conversationType, targetId, channelId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.clearMessages(conversationType, targetId, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n       * 获取全部会话列表\n      */\n      getConversationList(count, conversationType, startTime, order, channelId = '') {\n          return new Promise((resolve, reject) => {\n              const converTypes = [1, 3, 6, 7];\n              const result = this._cppProtocol.getConversationList(converTypes, channelId);\n              const resultList = JSON.parse(result);\n              const converList = resultList.list;\n              const convers = [];\n              for (let i = 0; i < converList.length; i++) {\n                  convers.push(this._buildConversation(converList[i].obj));\n              }\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: convers\n              });\n          });\n      }\n      /**\n       * 获取指定会话\n      */\n      getConversation(conversationType, targetId, channelId) {\n          return new Promise((resolve, reject) => {\n              const result = this._cppProtocol.getConversation(conversationType, targetId, channelId);\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: this._buildConversation(result)\n              });\n          });\n      }\n      /**\n       * 删除指定会话\n      */\n      removeConversation(conversationType, targetId, channelId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.removeConversation(conversationType, targetId, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n       * 删除所有会话\n      */\n      clearConversations(conversationTypes, channelId) {\n          return new Promise((resolve, reject) => {\n              let types = [];\n              if (isArray(conversationTypes)) {\n                  types = conversationTypes;\n              }\n              else {\n                  types = [ConversationType$1.PRIVATE, ConversationType$1.GROUP, ConversationType$1.SYSTEM, ConversationType$1.PUBLIC_SERVICE];\n              }\n              this._cppProtocol.clearConversations(types, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n       * 获取所有会话未读数\n      */\n      getAllConversationUnreadCount(channelId) {\n          return new Promise((resolve, reject) => {\n              // getTotalUnreadCount 如果传入  conversationTyps 可按类型， TODO ? 是否分开写？\n              const types = [ConversationType$1.PRIVATE, ConversationType$1.GROUP, ConversationType$1.SYSTEM, ConversationType$1.PUBLIC_SERVICE];\n              const isIncludeNotDisturb = true;\n              const count = this._cppProtocol.getTotalUnreadCount(types, isIncludeNotDisturb, channelId);\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: count\n              });\n          });\n      }\n      /**\n       * 获取指定会话未读数\n      */\n      getConversationUnreadCount(conversationType, targetId, channelId = '') {\n          return new Promise((resolve, reject) => {\n              const count = this._cppProtocol.getUnreadCount(conversationType, targetId, channelId);\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: count\n              });\n          });\n      }\n      /**\n       * 清除指定会话未读数\n      */\n      clearConversationUnreadCount(conversationType, targetId, channelId = '') {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.clearUnreadCount(conversationType, targetId, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n       * 清除时间戳之前的未读数\n      */\n      clearUnreadCountByTimestamp(conversationType, targetId, timestamp, channelId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n       * 设置会话置顶\n      */\n      setConversationToTop(conversationType, targetId, isTop, channelId = '') {\n          return new Promise((resolve, reject) => {\n              const isCreateConversation = true;\n              this._cppProtocol.setConversationToTop(conversationType, targetId, isTop, channelId, isCreateConversation);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n        * 设置会话隐藏\n      */\n      setConversationHidden(conversationType, targetId, isHidden, channelId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.setConversationHidden(conversationType, targetId, isHidden, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      /**\n       * 设置会话置顶\n      */\n      setConversationNotificationStatus(conversationType, targetId, isNotify, channelId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.setConversationNotificationStatus(conversationType, targetId, isNotify, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve, channelId);\n          });\n      }\n      /**\n       * 设置会话置顶、免打扰\n      */\n      setConversationStatus(conversationType, targetId, isBlocked, isTop, channelId) {\n          return new Promise((resolve, reject) => {\n              const isCreateConversation = true;\n              this._cppProtocol.setConversationStatus(conversationType, targetId, isBlocked, isTop, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve, channelId, isCreateConversation);\n          });\n      }\n      /**\n       * 获取会话置顶状态\n      */\n      getConversationNotificationStatus(conversationType, targetId, channelId) {\n          return new Promise((resolve, reject) => {\n              const notify = this._cppProtocol.getConversationNotificationStatus(conversationType, targetId, channelId);\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: notify ? NotificationStatus$1.OPEN : NotificationStatus$1.CLOSE\n              });\n          });\n      }\n      /**\n       * 通过关键字搜索会话\n       * @description\n       * 不传 messageTypes 默认仅支持 文本消息、文件消息， 自定义消息类型需传\n      */\n      searchConversationByContent(keyword, customMessageTypes, channelId, conversationTypes) {\n          return new Promise((resolve, reject) => {\n              conversationTypes = conversationTypes || [1, 3, 6, 7];\n              const data = this._cppProtocol.searchConversationByContent(conversationTypes, keyword, customMessageTypes, channelId);\n              const list = JSON.parse(data).list;\n              const convers = [];\n              for (let i = 0; i < list.length; i++) {\n                  convers[i] = this._buildConversation(list[i].obj);\n              }\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: convers\n              });\n          });\n      }\n      /**\n       * 按内容搜索会话内的消息\n      */\n      searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, channelId) {\n          return new Promise((resolve, reject) => {\n              const isReturnMatchedNum = 1;\n              this._cppProtocol.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, isReturnMatchedNum, (result, matched) => {\n                  const list = result ? JSON.parse(result).list : [];\n                  const msgs = [];\n                  for (let i = 0; i < list.length; i++) {\n                      msgs[i] = this._buildMessage(list[i].obj);\n                  }\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: {\n                          messages: msgs,\n                          count: matched\n                      }\n                  });\n              }, channelId);\n          });\n      }\n      /**\n       * 获取会话下所有未读的 @ 消息\n      */\n      getUnreadMentionedMessages(conversationType, targetId, channelId) {\n          const mentions = JSON.parse(this._cppProtocol.getUnreadMentionedMessages(conversationType, targetId, channelId)).list;\n          for (let i = 0; i < mentions.length; i++) {\n              // var temp = JSON.parse(mentions[i].obj)\n              // temp.content = JSON.parse(temp.content)\n              mentions[i] = this._buildMessage(mentions[i].obj);\n          }\n          return mentions;\n      }\n      addToBlacklist(userId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.addToBlacklist(userId, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve);\n          });\n      }\n      removeFromBlacklist(userId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.removeFromBlacklist(userId, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve);\n          });\n      }\n      getBlacklist() {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.getBlacklist((userIds) => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: userIds\n                  });\n              }, (code) => {\n                  resolve({ code });\n              });\n          });\n      }\n      getBlacklistStatus(userId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.getBlacklistStatus(userId, (result) => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: result\n                  });\n              }, (code) => {\n                  resolve({ code });\n              });\n          });\n      }\n      insertMessage(conversationType, targetId, insertOptions) {\n          let { content: msgContent, senderUserId, messageType, messageDirection, readStatus, sendStatus, sentTime, searchContent, isUnread, messageUId, disableNotification, canIncludeExpansion, expansionMsg, channelId } = insertOptions;\n          msgContent = JSON.stringify(msgContent);\n          return new Promise((resolve, reject) => {\n              const onSuccess = () => { };\n              const onError = (error) => {\n                  resolve({\n                      code: error\n                  });\n              };\n              const msg = this._cppProtocol.insertMessage(conversationType, targetId, senderUserId, messageType, msgContent, onSuccess, onError, messageDirection, readStatus, sendStatus, sentTime, searchContent, isUnread, messageUId, disableNotification, canIncludeExpansion, expansionMsg, channelId);\n              const receivedMessage = this._buildMessage(msg, false);\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: receivedMessage\n              });\n          });\n      }\n      deleteMessages(timestamps) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.deleteMessages(timestamps);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace, channelId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace, channelId);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      getMessage(messageId) {\n          return new Promise((resolve, reject) => {\n              const result = this._cppProtocol.getMessage(messageId);\n              const message = this._buildMessage(result, false);\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: message\n              });\n          });\n      }\n      setMessageContent(messageId, content, messageType) {\n          return new Promise((resolve, reject) => {\n              content = JSON.stringify(content);\n              this._cppProtocol.setMessageContent(messageId, content, messageType);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      setMessageSearchField(messageId, content, searchFiles) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.setMessageSearchField(messageId, content, searchFiles);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      setMessageSentStatus(messageId, sentStatus) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.setMessageSentStatus(messageId, sentStatus);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      setMessageReceivedStatus(messageId, receivedStatus) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.setMessageReceivedStatus(messageId, receivedStatus);\n              resolve(ErrorCode$1.SUCCESS);\n          });\n      }\n      saveConversationMessageDraft(conversationType, targetId, draft) {\n          throw new Error('Method not implemented.');\n      }\n      getConversationMessageDraft(conversationType, targetId) {\n          throw new Error('Method not implemented.');\n      }\n      clearConversationMessageDraft(conversationType, targetId) {\n          throw new Error('Method not implemented.');\n      }\n      pullConversationStatus(timestamp) {\n          throw new Error('Method not implemented.');\n      }\n      /**\n       * 协议栈暂时仅支持单独设置免打扰和置顶\n      */\n      batchSetConversationStatus(statusList) {\n          const { conversationType, targetId, isTop, notificationStatus, channelId } = statusList[0];\n          if (isTop !== undefined && notificationStatus === undefined) {\n              return this.setConversationToTop(conversationType, targetId, isTop, channelId);\n          }\n          else if (notificationStatus !== undefined && isTop === undefined) {\n              const isBlocked = notificationStatus === NotificationStatus$1.OPEN;\n              return this.setConversationNotificationStatus(conversationType, targetId, isBlocked, channelId);\n          }\n          else {\n              const isBlocked = notificationStatus === NotificationStatus$1.OPEN;\n              return this.setConversationStatus(conversationType, targetId, isBlocked, isTop, channelId);\n          }\n      }\n      pullUserSettings(version) {\n          throw new Error('Method not implemented.');\n      }\n      joinChatroom(chatroomId, count) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.joinChatRoom(chatroomId, count, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve);\n          });\n      }\n      joinExistChatroom(chatroomId, count) {\n          throw new Error('Method not implemented.');\n      }\n      quitChatroom(chatroomId) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.quitChatRoom(chatroomId, () => {\n                  resolve(ErrorCode$1.SUCCESS);\n              }, resolve);\n          });\n      }\n      /**\n       * 获取聊天室信息\n       * @description\n       * 协议栈返回数据里不带用户加入时间\n      */\n      getChatroomInfo(chatroomId, count, order) {\n          return new Promise((resolve, reject) => {\n              this._cppProtocol.getChatroomInfo(chatroomId, count, order, (result, count) => {\n                  const list = result ? JSON.parse(result).list : [];\n                  const userInfos = [];\n                  if (list.length > 0) {\n                      for (let i = 0; i < list.length; i++) {\n                          userInfos.push(JSON.parse(list[i].obj));\n                      }\n                  }\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: {\n                          userInfos,\n                          userCount: count\n                      }\n                  });\n              }, (code) => {\n                  resolve({ code });\n              });\n          });\n      }\n      getChatroomHistoryMessages(chatroomId, timestamp, count, order) {\n          throw new Error('Method not implemented.');\n      }\n      setChatroomEntry(chatroomId, entry) {\n          throw new Error('Method not implemented.');\n      }\n      forceSetChatroomEntry(chatroomId, entry) {\n          throw new Error('Method not implemented.');\n      }\n      removeChatroomEntry(chatroomId, entry) {\n          throw new Error('Method not implemented.');\n      }\n      forceRemoveChatroomEntry(chatroomId, entry) {\n          throw new Error('Method not implemented.');\n      }\n      getChatroomEntry(chatroomId, key) {\n          throw new Error('Method not implemented.');\n      }\n      getAllChatroomEntry(chatroomId) {\n          throw new Error('Method not implemented.');\n      }\n      getFileToken(fileType, fileName) {\n          return new Promise((resolve, reject) => {\n              const uploadFileName = getUploadFileName(fileType, fileName);\n              this._cppProtocol.getUploadToken(fileType, uploadFileName, (token, bosToken, bosDate, bosPath, ossToken, ossPolicy, ossSignature, ossBucketName) => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: {\n                          token,\n                          deadline: 0,\n                          bosToken,\n                          bosDate,\n                          path: bosPath,\n                          osskeyId: ossToken,\n                          ossPolicy,\n                          ossSign: ossSignature,\n                          ossBucketName,\n                          fileName: uploadFileName\n                      }\n                  });\n              }, (code) => {\n                  resolve({ code });\n              });\n          });\n      }\n      getFileUrl(fileType, uploadMethod, fileName, originName) {\n          return new Promise((resolve, reject) => {\n              const onSuccess = (url) => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: { downloadUrl: url }\n                  });\n              };\n              const onError = (code) => {\n                  resolve({ code });\n              };\n              const isOss = uploadMethod === UploadMethod$1.ALI;\n              const mimeKey = getMimeKey(fileType);\n              this._cppProtocol.getDownloadUrl(fileType, mimeKey, originName, isOss, onSuccess, onError);\n          });\n      }\n      clearData() {\n          return new Promise((resolve, reject) => {\n              const result = this._cppProtocol.clearData();\n              resolve({\n                  code: ErrorCode$1.SUCCESS,\n                  data: result\n              });\n          });\n      }\n      setDeviceInfo(device) {\n          return new Promise((resolve, reject) => {\n              const id = device.id || '';\n              this._cppProtocol.setDeviceId(id);\n          });\n      }\n      getVoIPKey(engineType, channelName) {\n          return new Promise((resolve, reject) => {\n              const extra = '';\n              const onSuccess = (token) => {\n                  resolve({\n                      code: ErrorCode$1.SUCCESS,\n                      data: token\n                  });\n              };\n              const onError = (code) => {\n                  resolve({ code });\n              };\n              this._cppProtocol.getVoIPKey(engineType, channelName, extra, onSuccess, onError);\n          });\n      }\n      /**\n       * 以下为 RTC 方法\n      */\n      joinRTCRoom(roomId, mode, broadcastType) {\n          throw new Error('Method not implemented.');\n      }\n      quitRTCRoom(roomId) {\n          throw new Error('Method not implemented.');\n      }\n      rtcPing(roomId, mode, broadcastType) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCRoomInfo(roomId) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCUserInfoList(roomId) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCUserInfo(roomId) {\n          throw new Error('Method not implemented.');\n      }\n      setRTCUserInfo(roomId, key, value) {\n          throw new Error('Method not implemented.');\n      }\n      removeRTCUserInfo(roomId, keys) {\n          throw new Error('Method not implemented.');\n      }\n      setRTCData(roomId, key, value, isInner, apiType, message) {\n          throw new Error('Method not implemented.');\n      }\n      setRTCTotalRes(roomId, message, valueInfo, messageType) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCData(roomId, keys, isInner, apiType) {\n          throw new Error('Method not implemented.');\n      }\n      removeRTCData(roomId, keys, isInner, apiType, message) {\n          throw new Error('Method not implemented.');\n      }\n      setRTCOutData(roomId, rtcData, type, message) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCOutData(roomId, userIds) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCToken(roomId, mode, broadcastType) {\n          throw new Error('Method not implemented.');\n      }\n      setRTCState(roomId, reportId) {\n          throw new Error('Method not implemented.');\n      }\n      getRTCUserList(roomId) {\n          throw new Error('Method not implemented.');\n      }\n  }\n\n  class PluginContext {\n      constructor(_context) {\n          this._context = _context;\n      }\n      /**\n       * 获取 `@rongcloud/engine` 包版本\n       */\n      getCoreVersion() {\n          return this._context.coreVersion;\n      }\n      /**\n       * 获取当前运行中的 IMLib 版本号\n       */\n      getAPIVersion() {\n          return this._context.apiVersion;\n      }\n      /**\n       * 获取当前应用的 appkey\n       */\n      getAppkey() {\n          return this._context.appkey;\n      }\n      /**\n       * 获取当前已连接用户的 userId\n       * 用户连接建立之前及 disconnect 之后，该方法返回 '' 值\n       */\n      getCurrentId() {\n          return this._context.getCurrentUserId();\n      }\n      /**\n       * 获取当前连接状态\n       */\n      getConnectionStatus() {\n          return this._context.getConnectionStatus();\n      }\n      /**\n       * 发送消息\n       */\n      sendMessage(conversationType, targetId, options) {\n          return this._context.sendMessage(conversationType, targetId, options);\n      }\n      /**\n       * 消息注册\n       * @description 消息注册需在应用初始化完成前进行\n       * @param objectName 消息类型，如：RC:TxtMsg\n       * @param isPersited 是否存储\n       * @param isCounted 是否技术\n       * @param searchProps 搜索字段，只在搭配协议栈使用时有效\n       */\n      registerMessageType(objectName, isPersited, isCounted, searchProps = []) {\n          this._context.registerMessageType(objectName, isPersited, isCounted, searchProps);\n      }\n  }\n\n  class RTCPluginContext extends PluginContext {\n      /**\n       * 获取当前的导航数据\n       */\n      getNaviInfo() {\n          return this._context.getInfoFromCache();\n      }\n      /**\n       * 加入 RTC 房间\n       * @todo 需确认 `broadcastType` 参数的作用与有效值\n       * @param roomId\n       * @param mode 房间模式：直播 or 会议\n       * @param broadcastType\n       */\n      joinRTCRoom(roomId, mode, broadcastType) {\n          return this._context.joinRTCRoom(roomId, mode, broadcastType);\n      }\n      quitRTCRoom(roomId) {\n          return this._context.quitRTCRoom(roomId);\n      }\n      rtcPing(roomId, mode, broadcastType) {\n          return this._context.rtcPing(roomId, mode, broadcastType);\n      }\n      getRTCRoomInfo(roomId) {\n          return this._context.getRTCRoomInfo(roomId);\n      }\n      getRTCUserInfoList(roomId) {\n          return this._context.getRTCUserInfoList(roomId);\n      }\n      getRTCUserInfo(roomId) {\n          return this._context.getRTCUserInfo(roomId);\n      }\n      setRTCUserInfo(roomId, key, value) {\n          return this._context.setRTCUserInfo(roomId, key, value);\n      }\n      removeRTCUserInfo(roomId, keys) {\n          return this._context.removeRTCUserInfo(roomId, keys);\n      }\n      setRTCData(roomId, key, value, isInner, apiType, message) {\n          return this._context.setRTCData(roomId, key, value, isInner, apiType, message);\n      }\n      /**\n       * @param - roomId\n       * @param - message 向前兼容的消息数据，以兼容旧版本 SDK，即增量数据，如：\n       * ```\n       * JSON.stringify({\n       *  name: 'RCRTC:PublishResource',\n       *  content: {\n       *  }\n       * })\n       * ```\n       * @param - valueInfo 全量资源数据\n       * @param - 全量 URI 消息名，即 `RCRTC:TotalContentResources`\n       */\n      setRTCTotalRes(roomId, \n      /**\n       * 向旧版本 RTCLib 兼容的消息数据\n       */\n      message, valueInfo, objectName) {\n          return this._context.setRTCTotalRes(roomId, message, valueInfo, objectName);\n      }\n      getRTCData(roomId, keys, isInner, apiType) {\n          return this._context.getRTCData(roomId, keys, isInner, apiType);\n      }\n      removeRTCData(roomId, keys, isInner, apiType, message) {\n          return this._context.removeRTCData(roomId, keys, isInner, apiType, message);\n      }\n      setRTCOutData(roomId, rtcData, type, message) {\n          return this._context.setRTCOutData(roomId, rtcData, type, message);\n      }\n      getRTCOutData(roomId, userIds) {\n          return this._context.getRTCOutData(roomId, userIds);\n      }\n      getRTCToken(roomId, mode, broadcastType) {\n          return this._context.getRTCToken(roomId, mode, broadcastType);\n      }\n      setRTCState(roomId, report) {\n          return this._context.setRTCState(roomId, report);\n      }\n      getRTCUserList(roomId) {\n          return this._context.getRTCUserList(roomId);\n      }\n  }\n\n  function cloneMessage(message) {\n      return Object.assign({}, message);\n  }\n  class APIContext {\n      constructor(_runtime, options) {\n          this._runtime = _runtime;\n          this._token = '';\n          /**\n           * 插件队列，用于逐一派发消息与信令\n           */\n          this._pluginContextQueue = [];\n          /**\n           * 核心库版本号，后期与 4.0 IM SDK 版本号保持一致\n           */\n          this.coreVersion = \"4.2.0\";\n          this._connectionStatus = ConnectionStatus$1.DISCONNECTED;\n          /**\n           * 业务层事件监听器挂载点\n           */\n          this._watcher = {\n              message: undefined,\n              conversationState: undefined,\n              chatroomState: undefined,\n              connectionState: undefined,\n              rtcInnerWatcher: undefined,\n              expansion: undefined\n          };\n          this._options = Object.assign({}, options);\n          this.appkey = this._options.appkey;\n          this.apiVersion = this._options.apiVersion;\n          const { appkey, miniCMPProxy, apiVersion, connectionType } = this._options;\n          // electron 运行时下, cppProtocol 为必填项\n          if (_runtime.tag === \"electron\" && !this._options.cppProtocol) {\n              const msg = 'cppProtocol is required';\n              logger.error(msg);\n              throw new Error(msg);\n          }\n          // 过滤无效地址\n          this._options.navigators = this._options.navigators.filter(item => /^https?:\\/\\//.test(item));\n          // 有自定义导航的状态下，不再使用内置导航地址\n          if (this._options.navigators.length === 0) {\n              this._options.navigators.push(...PUBLIC_CLOUD_NAVI_URIS);\n          }\n          // 初始化 Navi 模块\n          this._navi = new Navi(_runtime, appkey, this._options.navigators, miniCMPProxy, apiVersion, connectionType);\n          // 初始化引擎监听器，监听连接状态变化、消息变化以及聊天室状态变化\n          const engineWatcher = {\n              status: this._connectionStatusListener.bind(this),\n              message: this._messageReceiver.bind(this),\n              chatroom: this._chatroomInfoListener.bind(this),\n              conversation: this._conversationInfoListener.bind(this),\n              expansion: this._expansionInfoListener.bind(this)\n          };\n          // 初始化引擎\n          this._engine = this._options.cppProtocol\n              ? new CPPEngine(_runtime, appkey, engineWatcher, apiVersion, this._options.cppProtocol, this._options)\n              : new JSEngine(_runtime, appkey, engineWatcher, apiVersion);\n      }\n      static init(runtime, options) {\n          logger.debug('APIContext.init =>', options.appkey, options.navigators);\n          if (this._context) {\n              logger.error('Repeat initialize!');\n              return this._context;\n          }\n          {\n              logger.warn('VersionCode:', \"1838ab715d966e65fa509d4d5e4ffd76827367a7\");\n          }\n          this._context = new APIContext(runtime, options);\n          return this._context;\n      }\n      static destroy() {\n          if (this._context) {\n              this._context._destroy();\n              this._context = undefined;\n          }\n      }\n      /**\n       * 安装使用插件，并初始化插件实例\n       * @param plugin\n       * @param options\n       */\n      install(plugin, options) {\n          const context = plugin.tag === 'RCRTC' ? new RTCPluginContext(this) : new PluginContext(this);\n          let pluginClient = null;\n          try {\n              if (!plugin.verify(this._runtime)) {\n                  return null;\n              }\n              pluginClient = plugin.setup(context, this._runtime, options);\n          }\n          catch (error) {\n              logger.error('install plugin error!\\n', error);\n          }\n          pluginClient && this._pluginContextQueue.push(context);\n          return pluginClient;\n      }\n      /**\n       * 连接状态变更回调\n       * @param message\n       */\n      _connectionStatusListener(status) {\n          var _a;\n          this._connectionStatus = status;\n          // 通知旧版本 RTCLib、CallLib\n          ((_a = this._watcher.rtcInnerWatcher) === null || _a === void 0 ? void 0 : _a.status) && this._watcher.rtcInnerWatcher.status(status);\n          // 通知插件连接状态变更\n          this._pluginContextQueue.forEach(item => {\n              item.onconnectionstatechange && item.onconnectionstatechange(status);\n          });\n          // 通知应用层连接状态变更\n          this._watcher.connectionState && this._watcher.connectionState(status);\n      }\n      _messageReceiver(message) {\n          /**\n           * 为兼容非插件化的 RTCLib、CallLib，需预先将\n           * conversationType === 12\n           * 或\n           * RCRTC:AcceptMsg... 等消息分别分发给 RTCLib\\CallLib\n           */\n          if (message.conversationType === ConversationType$1.RTC_ROOM ||\n              Object.prototype.hasOwnProperty.call(CallLibMsgType, message.messageType)) {\n              /**\n               * 分发 RTCLib 或 CallLib 消息，如果未找到 RTCLib 或 CallLib 注册的消息监听，\n               * 说明未使用旧版本 RTCLib 或 CallLib，消息要分发到插件钩子\n               */\n              if (this._watcher.rtcInnerWatcher && this._watcher.rtcInnerWatcher.message) {\n                  this._watcher.rtcInnerWatcher.message(cloneMessage(message));\n                  return;\n              }\n          }\n          // 消息分发至插件，并根据插件响应结果确定是否继续向业务层派发\n          if (this._pluginContextQueue.some((item) => {\n              // 插件不接收消息\n              if (!item.onmessage) {\n                  return false;\n              }\n              try {\n                  return item.onmessage(cloneMessage(message));\n              }\n              catch (err) {\n                  logger.error('plugin error =>', err);\n                  return false;\n              }\n          })) {\n              return;\n          }\n          // 最终未被过滤的消息派发给应用层\n          this._watcher.message && this._watcher.message(cloneMessage(message));\n      }\n      /**\n       * 聊天室相关信息监听\n      */\n      _chatroomInfoListener(info) {\n          this._watcher.chatroomState && this._watcher.chatroomState(info);\n      }\n      /**\n       * 会话监听相关\n      */\n      _conversationInfoListener(info) {\n          this._watcher.conversationState && this._watcher.conversationState(info);\n      }\n      /**\n       * 消息扩展监听相关\n      */\n      _expansionInfoListener(info) {\n          this._watcher.expansion && this._watcher.expansion(info);\n      }\n      /**\n       * 添加事件监听\n       * @param options\n       */\n      assignWatcher(watcher) {\n          // 只取有效的四个 key，避免引用透传造成内存泄露\n          Object.keys(this._watcher).forEach((key) => {\n              if (Object.prototype.hasOwnProperty.call(watcher, key)) {\n                  const value = watcher[key];\n                  this._watcher[key] = isFunction(value) || isObject(value) ? value : undefined;\n              }\n          });\n      }\n      getConnectedTime() {\n          return this._engine.connectedTime;\n      }\n      getCurrentUserId() {\n          return this._engine.currentUserId;\n      }\n      getConnectionStatus() {\n          return this._connectionStatus;\n      }\n      /**\n       * 建立连接，连接失败则抛出异常，连接成功后返回用户 userId，否则返回相应的错误码\n       * @param token\n       * @param refreshNavi 是否需要重新请求导航，当值为 `false` 时，优先使用有效缓存导航，若缓存失效则重新获取导航\n       */\n      connect(token, refreshNavi = false) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (this._connectionStatus === ConnectionStatus$1.CONNECTED) {\n                  return { code: ErrorCode$1.SUCCESS, userId: this._engine.currentUserId };\n              }\n              if (this._connectionStatus === ConnectionStatus$1.CONNECTING) {\n                  return { code: ErrorCode$1.BIZ_ERROR_CONNECTING };\n              }\n              if (typeof token !== 'string' || token.length === 0) {\n                  return { code: ErrorCode$1.RC_CONN_USER_OR_PASSWD_ERROR };\n              }\n              this._token = token;\n              // 根据 token 解析动态导航，优先从动态导航获取数据\n              const [, tmpArr] = token.split('@');\n              const dynamicUris = tmpArr\n                  ? tmpArr.split(';').map(item => /^https?:/.test(item) ? item : `https://${item}`)\n                  : [];\n              const isCppMode = !!this._options.cppProtocol;\n              // 获取导航数据\n              const naviInfo = yield this._navi.getInfo(this._getTokenWithoutNavi(), dynamicUris, refreshNavi, isCppMode);\n              if (!naviInfo && !isCppMode) {\n                  return { code: ErrorCode$1.RC_NAVI_RESOURCE_ERROR };\n              }\n              // 开始连接，并监听链接状态变化，状态为 0 则连接成功\n              const code = yield this._engine.connect(this._getTokenWithoutNavi(), naviInfo, this._options.connectionType);\n              if (code === ErrorCode$1.SUCCESS && !isCppMode) { // TODO 限制 !isCppMode 防止报错，临时解决方案\n                  // 拉取用户级配置\n                  naviInfo.openUS === 1 && this._pullUserSettings();\n              }\n              return { code, userId: this._engine.currentUserId };\n          });\n      }\n      getConnectTime() {\n          return this._engine.getConnectTime();\n      }\n      /**\n       * 拉取实时配置 web 端需更新 voipCall 字段\n       */\n      _pullUserSettings() {\n          return __awaiter(this, void 0, void 0, function* () {\n              // TODO: 持续迭代中，防止 comet 报错\n              // const res = await this._engine.pullUserSettings(version)\n              // logger.error('TODO：存储配置，需要使用时获取', res)\n          });\n      }\n      disconnect() {\n          this._engine.disconnect();\n          this._pluginContextQueue.forEach(item => {\n              if (!item.ondisconnect) {\n                  return;\n              }\n              try {\n                  item.ondisconnect();\n              }\n              catch (err) {\n                  logger.error('plugin error =>', err);\n              }\n          });\n          // 为照顾 API 层的 Promise 链式调用，故增加返回 Promise\n          return Promise.resolve();\n      }\n      reconnect() {\n          return this.connect(this._getTokenWithoutNavi());\n      }\n      // 获取 token 动态导航前的部分\n      _getTokenWithoutNavi() {\n          return this._token.replace(/@.+$/, '@');\n      }\n      /**\n       * 获取当前缓存的导航数据\n       */\n      getInfoFromCache() {\n          return this._navi.getInfoFromCache(this._getTokenWithoutNavi());\n      }\n      /**\n       * 消息注册\n       * @description 消息注册需在应用初始化完成前进行\n       * @param objectName 消息类型，如：RC:TxtMsg\n       * @param isPersited 是否存储\n       * @param isCounted 是否技术\n       * @param searchProps 搜索字段，只在搭配协议栈使用时有效\n       */\n      registerMessageType(objectName, isPersited, isCounted, searchProps = []) {\n          this._engine.registerMessageType(objectName, isPersited, isCounted, searchProps);\n      }\n      /**\n       * 发送消息\n       * @param conversationType\n       * @param targetId\n       * @param objectName\n       * @param content\n       * @param options\n       */\n      sendMessage(conversationType, targetId, options) {\n          // 端上不能发送系统消息，若会话类型传入 6 ，抛出参数错误，与移动端一致\n          if (conversationType === ConversationType$1.SYSTEM) {\n              return Promise.resolve({ code: ErrorCode$1.BIZ_ERROR_INVALID_PARAMETER });\n          }\n          // 消息 content 需小于 128 KB\n          const contentJson = JSON.stringify(options.content);\n          if (getByteLength(contentJson) > MAX_MESSAGE_CONTENT_BYTES) {\n              return Promise.resolve({ code: ErrorCode$1.RC_MSG_CONTENT_EXCEED_LIMIT });\n          }\n          return this._engine.sendMessage(conversationType, targetId, options);\n      }\n      /**\n       * 发送扩展消息\n       * @param messageUId 消息 Id\n       * @param keys 需要删除的 key\n       * @param expansion 设置的扩展\n      */\n      sendExpansionMessage(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              let { conversationType, targetId, messageUId, keys, expansion, originExpansion, removeAll, canIncludeExpansion } = options;\n              // 校验消息是否支持扩展\n              if (!canIncludeExpansion) {\n                  return { code: ErrorCode$1.MESSAGE_KV_NOT_SUPPORT };\n              }\n              let isExceedLimit = false;\n              let isIllgalEx = false;\n              if (isObject(expansion)) {\n                  // 验证扩展总数是否 大于 300\n                  originExpansion = originExpansion || {};\n                  const exKeysLength = Object.keys(expansion).length;\n                  const totalExpansion = Object.assign(originExpansion, expansion);\n                  const totalExKeysLength = Object.keys(totalExpansion).length;\n                  isExceedLimit = totalExKeysLength > 300 || exKeysLength > 20;\n                  // 验证 expansion key value 是否合法\n                  for (const key in expansion) {\n                      const val = expansion[key];\n                      isExceedLimit = key.length > 32 || val.length > 64;\n                      isIllgalEx = !/^[A-Za-z0-9_=+-]+$/.test(key);\n                  }\n              }\n              if (isExceedLimit) {\n                  return { code: ErrorCode$1.EXPANSION_LIMIT_EXCEET };\n              }\n              if (isIllgalEx) {\n                  return { code: ErrorCode$1.BIZ_ERROR_INVALID_PARAMETER };\n              }\n              const content = {\n                  mid: messageUId\n              };\n              expansion && (content.put = expansion);\n              keys && (content.del = keys);\n              removeAll && (content.removeAll = 1);\n              // RC:MsgExMsg 类型消息需使用单群聊消息信令：ppMsgP、pgMsgP（ Server 端处理不存到历史消息云存储）\n              const { code } = yield this._engine.sendMessage(conversationType, targetId, {\n                  content,\n                  messageType: MessageType$1.EXPANSION_NOTIFY\n              });\n              return { code };\n          });\n      }\n      /**\n       * 反初始化，清空所有监听及计时器\n       */\n      _destroy() {\n          this._watcher = {};\n          this._engine.disconnect();\n          this._pluginContextQueue.forEach(item => {\n              if (!item.ondestroy) {\n                  return;\n              }\n              try {\n                  item.ondestroy();\n              }\n              catch (err) {\n                  logger.error('plugin error =>', err);\n              }\n          });\n          this._pluginContextQueue.length = 0;\n      }\n      /**\n       * @param conversationType\n       * @param targetId 会话 Id\n       * @param timestamp 拉取时间戳\n       * @param count 拉取条数\n       * @param order 1 正序拉取，0 为倒序拉取\n       */\n      getHistoryMessage(conversationType, targetId, timestamp = 0, count = 20, order = 0, channelId = '') {\n          return this._engine.getHistoryMessage(conversationType, targetId, timestamp, count, order, channelId);\n      }\n      /**\n       * 获取会话列表\n       * @param count 指定获取数量, 不传则获取全部会话列表，默认 `300`\n       */\n      getConversationList(count = 300, conversationType, startTime, order, channelId = '') {\n          return this._engine.getConversationList(count, conversationType, startTime, order, channelId);\n      }\n      /**\n       * 删除会话\n       */\n      removeConversation(conversationType, targetId, channelId = '') {\n          return this._engine.removeConversation(conversationType, targetId, channelId);\n      }\n      /**\n       * 清除会话消息未读数\n       */\n      clearUnreadCount(conversationType, targetId, channelId = '') {\n          return this._engine.clearConversationUnreadCount(conversationType, targetId, channelId);\n      }\n      /**\n       * 获取指定会话消息未读数\n       */\n      getUnreadCount(conversationType, targetId, channelId = '') {\n          return this._engine.getConversationUnreadCount(conversationType, targetId, channelId);\n      }\n      getTotalUnreadCount(channelId = '') {\n          return this._engine.getAllConversationUnreadCount(channelId);\n      }\n      setConversationStatus(conversationType, targetId, isTop, notificationStatus, channelId = '') {\n          const statusList = [{ conversationType, targetId, isTop, notificationStatus, channelId }];\n          return this._engine.batchSetConversationStatus(statusList);\n      }\n      saveConversationMessageDraft(conversationType, targetId, draft) {\n          return this._engine.saveConversationMessageDraft(conversationType, targetId, draft);\n      }\n      getConversationMessageDraft(conversationType, targetId) {\n          return this._engine.getConversationMessageDraft(conversationType, targetId);\n      }\n      clearConversationMessageDraft(conversationType, targetId) {\n          return this._engine.clearConversationMessageDraft(conversationType, targetId);\n      }\n      recallMessage(conversationType, targetId, messageUId, sentTime, recallMsgOptions) {\n          return this._engine.recallMsg(conversationType, targetId, messageUId, sentTime, recallMsgOptions);\n      }\n      /**\n       * 删除远端消息\n       * @param conversationType\n       * @param targetId\n       * @param list\n       */\n      deleteRemoteMessage(conversationType, targetId, list, channelId = '') {\n          return this._engine.deleteRemoteMessage(conversationType, targetId, list, channelId);\n      }\n      /**\n       * 根据时间戳删除指定时间之前的\n       * @param conversationType\n       * @param targetId\n       * @param timestamp\n       */\n      deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp, channelId = '') {\n          return this._engine.deleteRemoteMessageByTimestamp(conversationType, targetId, timestamp, channelId);\n      }\n      /**\n       * 加入聊天室，若聊天室不存在则创建聊天室\n       * @param roomId 聊天室房间 Id\n       * @param count 进入聊天室成功后，自动拉取的历史消息数量，默认值为 `10`，最大有效值为 `50`，`-1` 为不拉取\n       */\n      joinChatroom(roomId, count = 10) {\n          return this._engine.joinChatroom(roomId, count);\n      }\n      /**\n       * 加入聊天室，若聊天室不存在则抛出异常\n       * @param roomId 聊天室房间 Id\n       * @param count 进入聊天室成功后，自动拉取的历史消息数量，默认值为 `10`，最大有效值为 `50`，`-1` 为不拉取\n       */\n      joinExistChatroom(roomId, count = 10) {\n          return this._engine.joinExistChatroom(roomId, count);\n      }\n      /**\n       * 退出聊天室\n       * @param roomId\n       */\n      quitChatroom(roomId) {\n          return this._engine.quitChatroom(roomId);\n      }\n      /**\n       * 获取聊天室房间数据\n       * @description count 或 order 有一个为 0 时，只返回成员总数，不返回成员列表信息\n       * @param roomId 聊天室 Id\n       * @param count 获取房间人员列表数量，最大有效值 `20`，最小值未 `0`，默认为 0\n       * @param order 人员排序方式，`1` 为正序，`2` 为倒序，默认为 0\n       */\n      getChatroomInfo(roomId, count = 0, order = 0) {\n          return this._engine.getChatroomInfo(roomId, count, order);\n      }\n      /**\n       * 在指定聊天室中设置自定义属性\n       * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功\n       * @param roomId 聊天室房间 id\n       * @param entry 属性信息\n       */\n      setChatroomEntry(roomId, entry) {\n          return this._engine.setChatroomEntry(roomId, entry);\n      }\n      /**\n       * 在指定聊天室中强制增加 / 修改任意聊天室属性\n       * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功\n       * @param roomId 聊天室房间 id\n       * @param entry 属性信息\n       */\n      forceSetChatroomEntry(roomId, entry) {\n          return this._engine.forceSetChatroomEntry(roomId, entry);\n      }\n      /**\n       * 删除聊天室属性\n       * @description 该方法仅限于删除自己设置的聊天室属性\n       * @param roomId 聊天室房间 id\n       * @param entry 要移除的属性信息\n       */\n      removeChatroomEntry(roomId, entry) {\n          return this._engine.removeChatroomEntry(roomId, entry);\n      }\n      /**\n       * 强制删除任意聊天室属性\n       * @description 该方法仅限于删除自己设置的聊天室属性\n       * @param roomId 聊天室房间 id\n       * @param entry 要移除的属性信息\n       */\n      forceRemoveChatroomEntry(roomId, entry) {\n          return this._engine.forceRemoveChatroomEntry(roomId, entry);\n      }\n      /**\n       * 获取聊天室中的指定属性\n       * @param roomId 聊天室房间 id\n       * @param key 属性键名\n       */\n      getChatroomEntry(roomId, key) {\n          return this._engine.getChatroomEntry(roomId, key);\n      }\n      /**\n       * 获取聊天室内的所有属性\n       * @param roomId 聊天室房间 id\n       */\n      getAllChatroomEntries(roomId) {\n          return this._engine.getAllChatroomEntry(roomId);\n      }\n      /**\n       * 拉取聊天室内的历史消息\n       * @param roomId\n       * @param count 拉取消息条数, 有效值范围 `1 - 20`\n       * @param order 获取顺序，默认值为 0。\n       * * 0：降序，用于获取早于指定时间戳发送的消息\n       * * 1：升序，用于获取晚于指定时间戳发送的消息\n       * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`，表示按当前时间拉取\n       */\n      getChatRoomHistoryMessages(roomId, count = 20, order = 0, timestamp = 0) {\n          return this._engine.getChatroomHistoryMessages(roomId, timestamp, count, order);\n      }\n      /**\n       * 获取 七牛、百度上传认证信息\n       * @param fileType 文件类型\n       * @param fileName 文件名\n      */\n      getFileToken(fileType, fileName) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const naviInfo = this.getInfoFromCache();\n              const bos = (naviInfo === null || naviInfo === void 0 ? void 0 : naviInfo.bosAddr) || '';\n              const qiniu = (naviInfo === null || naviInfo === void 0 ? void 0 : naviInfo.uploadServer) || '';\n              const ossConfig = (naviInfo === null || naviInfo === void 0 ? void 0 : naviInfo.ossConfig) || '';\n              const { code, data } = yield this._engine.getFileToken(fileType, fileName);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return Promise.resolve(Object.assign(data, { bos, qiniu, ossConfig }));\n              }\n              return Promise.reject(code);\n          });\n      }\n      /**\n       * 获取 七牛、百度、阿里云 上传成功可下载的 URL\n       * @param fileType 文件类型\n       * @param uploadMethod 上传方式\n       * @param fileName 文件名\n       * @param originName 文件源名\n       * @param uploadRes 插件上传返回的结果。降级百度上传后，用户传入返回结果，再把结果里的下载地址返回给用户，保证兼容之前结果获取\n      */\n      getFileUrl(fileType, fileName, originName, uploadRes, uploadMethod = UploadMethod$1.QINIU) {\n          return __awaiter(this, void 0, void 0, function* () {\n              if (uploadRes === null || uploadRes === void 0 ? void 0 : uploadRes.isBosRes) {\n                  return Promise.resolve(uploadRes);\n              }\n              const { code, data } = yield this._engine.getFileUrl(fileType, uploadMethod, fileName, originName);\n              if (code === ErrorCode$1.SUCCESS) {\n                  return Promise.resolve(data);\n              }\n              return Promise.reject(code);\n          });\n      }\n      /* ============================= 以下为 CPP 接口 ================================== */\n      /**\n       * 删除所有会话\n      */\n      clearConversations(conversationTypes, tag) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return yield this._engine.clearConversations(conversationTypes, tag);\n          });\n      }\n      /**\n       * 设置用户连接状态监听器\n      */\n      setUserStatusListener(config, listener) {\n          return this._engine.setUserStatusListener(config, (data) => {\n              try {\n                  listener(data);\n              }\n              catch (error) {\n                  logger.error(error);\n              }\n          });\n      }\n      /**\n       * 添加用户黑名单\n      */\n      addToBlacklist(userId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.addToBlacklist(userId);\n          });\n      }\n      /**\n       * 将指定用户移除黑名单\n      */\n      removeFromBlacklist(userId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.removeFromBlacklist(userId);\n          });\n      }\n      /**\n       * 获取黑名单列表\n      */\n      getBlacklist() {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.getBlacklist();\n          });\n      }\n      /**\n       * 获取指定人员在黑名单中的状态\n      */\n      getBlacklistStatus(userId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.getBlacklistStatus(userId);\n          });\n      }\n      /**\n       * 向本地插入一条消息，不发送到服务器\n      */\n      insertMessage(conversationType, targetId, insertOptions) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.insertMessage(conversationType, targetId, insertOptions);\n          });\n      }\n      /**\n       * 删除本地消息\n      */\n      deleteMessages(timestamp) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.deleteMessages(timestamp);\n          });\n      }\n      /**\n       * 从本地消息数据库中删除某一会话指定时间之前的消息数据\n      */\n      deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace, channelId = '') {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.deleteMessagesByTimestamp(conversationType, targetId, timestamp, cleanSpace, channelId);\n          });\n      }\n      /**\n       * 清空会话下历史消息\n      */\n      clearMessages(conversationType, targetId, channelId = '') {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.clearMessages(conversationType, targetId, channelId);\n          });\n      }\n      /**\n       * 获取本地消息\n      */\n      getMessage(messageId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.getMessage(messageId);\n          });\n      }\n      /**\n       * 设置消息内容\n      */\n      setMessageContent(messageId, content, messageType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.setMessageContent(messageId, content, messageType);\n          });\n      }\n      /**\n       * 设置消息搜索字段\n      */\n      setMessageSearchField(messageId, content, searchFiles) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.setMessageSearchField(messageId, content, searchFiles);\n          });\n      }\n      /**\n       * 设置消息发送状态\n      */\n      setMessageSentStatus(messageId, sentStatus) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.setMessageSentStatus(messageId, sentStatus);\n          });\n      }\n      /**\n      * 设置消息接收状态\n      */\n      setMessageReceivedStatus(messageId, receivedStatus) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.setMessageReceivedStatus(messageId, receivedStatus);\n          });\n      }\n      /**\n       * 设置当前用户在线状态\n      */\n      setUserStatus(status) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.setUserStatus(status);\n          });\n      }\n      /**\n       * 订阅用户在线状态\n      */\n      subscribeUserStatus(userIds) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.subscribeUserStatus(userIds);\n          });\n      }\n      /**\n       * 获取用户在线状态\n      */\n      getUserStatus(userId) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.getUserStatus(userId);\n          });\n      }\n      searchConversationByContent(keyword, customMessageTypes = [], channelId = '', conversationTypes) {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.searchConversationByContent(keyword, customMessageTypes, channelId, conversationTypes);\n          });\n      }\n      searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, channelId = '') {\n          return __awaiter(this, void 0, void 0, function* () {\n              return this._engine.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, channelId);\n          });\n      }\n      getUnreadMentionedMessages(conversationType, targetId, channelId = '') {\n          return this._engine.getUnreadMentionedMessages(conversationType, targetId, channelId);\n      }\n      clearUnreadCountByTimestamp(conversationType, targetId, timestamp, channelId = '') {\n          return this._engine.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, channelId);\n      }\n      /**\n       * 获取会话免打扰状态\n      */\n      getConversationNotificationStatus(conversationType, targetId, channelId = '') {\n          return this._engine.getConversationNotificationStatus(conversationType, targetId, channelId);\n      }\n      getRemoteHistoryMessages(conversationType, targetId, timestamp, count, order, channelId) {\n          return this._engine.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, order, channelId);\n      }\n      /* ============================= CPP 接口 END =================================== */\n      /* ============================= 以下为 RTC 相关接口 ============================== */\n      /**\n       * 加入房间\n       * @param roomId\n       * @param mode 房间模式：直播 or 会议\n       * @param mediaType 直播房间模式下的媒体资源类型\n       */\n      joinRTCRoom(roomId, mode, mediaType) {\n          return this._engine.joinRTCRoom(roomId, mode, mediaType);\n      }\n      quitRTCRoom(roomId) {\n          return this._engine.quitRTCRoom(roomId);\n      }\n      rtcPing(roomId, mode, mediaType) {\n          return this._engine.rtcPing(roomId, mode, mediaType);\n      }\n      getRTCRoomInfo(roomId) {\n          return this._engine.getRTCRoomInfo(roomId);\n      }\n      getRTCUserInfoList(roomId) {\n          return this._engine.getRTCUserInfoList(roomId);\n      }\n      getRTCUserInfo(roomId) {\n          return this._engine.getRTCUserInfo(roomId);\n      }\n      setRTCUserInfo(roomId, key, value) {\n          return this._engine.setRTCUserInfo(roomId, key, value);\n      }\n      removeRTCUserInfo(roomId, keys) {\n          return this._engine.removeRTCUserInfo(roomId, keys);\n      }\n      setRTCData(roomId, key, value, isInner, apiType, message) {\n          return this._engine.setRTCData(roomId, key, value, isInner, apiType, message);\n      }\n      setRTCTotalRes(roomId, message, valueInfo, objectName) {\n          return this._engine.setRTCTotalRes(roomId, message, valueInfo, objectName);\n      }\n      getRTCData(roomId, keys, isInner, apiType) {\n          return this._engine.getRTCData(roomId, keys, isInner, apiType);\n      }\n      removeRTCData(roomId, keys, isInner, apiType, message) {\n          return this._engine.removeRTCData(roomId, keys, isInner, apiType, message);\n      }\n      setRTCOutData(roomId, rtcData, type, message) {\n          return this._engine.setRTCOutData(roomId, rtcData, type, message);\n      }\n      getRTCOutData(roomId, userIds) {\n          return this._engine.getRTCOutData(roomId, userIds);\n      }\n      getRTCToken(roomId, mode, broadcastType) {\n          return this._engine.getRTCToken(roomId, mode, broadcastType);\n      }\n      // RTC 北极星数据上报\n      setRTCState(roomId, report) {\n          return this._engine.setRTCState(roomId, report);\n      }\n      getRTCUserList(roomId) {\n          return this._engine.getRTCUserList(roomId);\n      }\n  }\n\n  /**\n   * engine 版本号\n   */\n  const version = \"4.2.0\";\n\n  exports.APIContext = APIContext;\n  exports.AppStorage = AppStorage;\n  exports.CallLibMsgType = CallLibMsgType;\n  exports.CometChannel = CometChannel;\n  exports.ConnectResultCode = ConnectResultCode;\n  exports.ConnectionStatus = ConnectionStatus$1;\n  exports.ConversationType = ConversationType$1;\n  exports.DelayTimer = DelayTimer;\n  exports.ErrorCode = ErrorCode$1;\n  exports.EventEmitter = EventEmitter;\n  exports.FileType = FileType$1;\n  exports.Logger = Logger;\n  exports.MentionedType = MentionedType$1;\n  exports.MessageDirection = MessageDirection$1;\n  exports.MessageType = MessageType$1;\n  exports.NotificationStatus = NotificationStatus$1;\n  exports.PluginContext = PluginContext;\n  exports.RCAssertError = RCAssertError;\n  exports.RTCPluginContext = RTCPluginContext;\n  exports.ReceivedStatus = ReceivedStatus$1;\n  exports.UploadMethod = UploadMethod$1;\n  exports.WebSocketChannel = WebSocketChannel;\n  exports.appendUrl = appendUrl;\n  exports.assert = assert;\n  exports.cloneByJSON = cloneByJSON;\n  exports.forEach = forEach;\n  exports.indexOf = indexOf;\n  exports.isArray = isArray;\n  exports.isArrayBuffer = isArrayBuffer;\n  exports.isFunction = isFunction;\n  exports.isHttpUrl = isHttpUrl;\n  exports.isInObject = isInObject;\n  exports.isInclude = isInclude;\n  exports.isNull = isNull;\n  exports.isNumber = isNumber;\n  exports.isObject = isObject;\n  exports.isString = isString;\n  exports.isUndefined = isUndefined;\n  exports.isValidConversationType = isValidConversationType;\n  exports.isValidFileType = isValidFileType;\n  exports.map = map;\n  exports.notEmptyArray = notEmptyArray;\n  exports.notEmptyObject = notEmptyObject;\n  exports.notEmptyString = notEmptyString;\n  exports.todo = todo;\n  exports.validate = validate;\n  exports.version = version;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n/*\n* RongIMLib - v4.2.0\n* CommitId - a00ad544f0c1624334ccf8ba7cca39a77640f5e4\n* Tue Jan 12 2021 20:58:11 GMT+0800 (China Standard Time)\n* ©2020 RongCloud, Inc. All rights reserved.\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@rongcloud/engine')) :\n  typeof define === 'function' && define.amd ? define(['exports', '@rongcloud/engine'], factory) :\n  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.RongIMLib = {}, global.RCEngine));\n}(this, (function (exports, engine) { 'use strict';\n\n  /*! *****************************************************************************\n  Copyright (c) Microsoft Corporation.\n\n  Permission to use, copy, modify, and/or distribute this software for any\n  purpose with or without fee is hereby granted.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n  PERFORMANCE OF THIS SOFTWARE.\n  ***************************************************************************** */\n\n  function __awaiter(thisArg, _arguments, P, generator) {\n      function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n      return new (P || (P = Promise))(function (resolve, reject) {\n          function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n          function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n          function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n          step((generator = generator.apply(thisArg, _arguments || [])).next());\n      });\n  }\n\n  const logger = new engine.Logger('RCIM');\n  logger.set( engine.LogLevel.DEBUG );\n\n  const ERROR_INFO = {\n      // 超时\n      TIMEOUT: {\n          code: -1,\n          msg: 'Network timeout'\n      },\n      // SDK 内部错误\n      SDK_INTERNAL_ERROR: {\n          code: -2,\n          msg: 'SDK internal error'\n      },\n      // 开发者参数传入错误\n      PARAMETER_ERROR: {\n          code: -3,\n          msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n      },\n      REJECTED_BY_BLACKLIST: {\n          code: 405,\n          msg: 'Blacklisted by the other party'\n      },\n      // 发送频率过快\n      SEND_TOO_FAST: {\n          code: 20604,\n          msg: 'Sending messages too quickly'\n      },\n      // 不在群组中\n      NOT_IN_GROUP: {\n          code: 22406,\n          msg: 'Not in group'\n      },\n      // 在群组中被禁言\n      FORBIDDEN_IN_GROUP: {\n          code: 22408,\n          msg: 'Forbbiden from speaking in the group'\n      },\n      // 不在聊天室中\n      NOT_IN_CHATROOM: {\n          code: 23406,\n          msg: 'Not in chatRoom'\n      },\n      // 在聊天室中被禁言\n      FORBIDDEN_IN_CHATROOM: {\n          code: 23408,\n          msg: 'Forbbiden from speaking in the chatRoom'\n      },\n      // 已被踢出并禁止加入聊天室\n      KICKED_FROM_CHATROOM: {\n          code: 23409,\n          msg: 'Kicked out and forbbiden from joining the chatRoom'\n      },\n      // 聊天室不存在\n      CHATROOM_NOT_EXIST: {\n          code: 23410,\n          msg: 'ChatRoom does not exist'\n      },\n      // 聊天室成员超限\n      CHATROOM_IS_FULL: {\n          code: 23411,\n          msg: 'ChatRoom members exceeded'\n      },\n      // 聊天室参数无效\n      PARAMETER_INVALID_CHATROOM: {\n          code: 23412,\n          msg: 'Invalid chatRoom parameters'\n      },\n      // 聊天室云存储业务未开通\n      ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n          code: 23414,\n          msg: 'ChatRoom message roaming service is not open, Please go to the developer to open this service'\n      },\n      // 撤回消息失败\n      RECALLMESSAGE_PARAMETER_INVALID: {\n          code: 25101,\n          msg: 'Invalid recall message parameter'\n      },\n      // 未开通单群聊消息云存储服务\n      ROAMING_SERVICE_UNAVAILABLE_MESSAGE: {\n          code: 25102,\n          msg: 'Single group chat roaming service is not open, Please go to the developer to open this service'\n      },\n      // push 设置参数无效\n      PUSHSETTING_PARAMETER_INVALID: {\n          code: 26001,\n          msg: 'Invalid push parameter'\n      },\n      // 操作被禁止\n      OPERATION_BLOCKED: {\n          code: 20605,\n          msg: 'Operation is blocked'\n      },\n      // 操作不支持\n      OPERATION_NOT_SUPPORT: {\n          code: 20606,\n          msg: 'Operation is not supported'\n      },\n      // 发送的消息中包含敏感词 (发送方发送失败，接收方不会收到消息)\n      MSG_BLOCKED_SENSITIVE_WORD: {\n          code: 21501,\n          msg: 'The sent message contains sensitive words'\n      },\n      // 消息中敏感词已经被替换 (接收方可以收到被替换之后的消息)\n      REPLACED_SENSITIVE_WORD: {\n          code: 21502,\n          msg: 'Sensitive words in the message have been replaced'\n      },\n      // 用户未连接成功\n      NOT_CONNECTED: {\n          code: 30001,\n          msg: 'Please connect successfully first'\n      },\n      // 导航 http 请求失败\n      NAVI_REQUEST_ERROR: {\n          code: 30007,\n          msg: 'Navigation http request failed'\n      },\n      // CMP 嗅探 http 请求失败\n      CMP_REQUEST_ERROR: {\n          code: 30010,\n          msg: 'CMP sniff http request failed'\n      },\n      CONN_APPKEY_FAKE: {\n          code: 31002,\n          msg: 'Your appkey is fake'\n      },\n      CONN_MINI_SERVICE_NOT_OPEN: {\n          code: 31003,\n          msg: 'Mini program service is not open, Please go to the developer to open this service'\n      },\n      CONN_ACK_TIMEOUT: {\n          code: 31000,\n          msg: 'Connection ACK timeout'\n      },\n      CONN_TOKEN_INCORRECT: {\n          code: 31004,\n          msg: 'Your token is not valid or expired'\n      },\n      CONN_NOT_AUTHRORIZED: {\n          code: 31005,\n          msg: 'AppKey and Token do not match'\n      },\n      CONN_REDIRECTED: {\n          code: 31006,\n          msg: 'Connection redirection'\n      },\n      CONN_APP_BLOCKED_OR_DELETED: {\n          code: 31008,\n          msg: 'AppKey is banned or deleted'\n      },\n      CONN_USER_BLOCKED: {\n          code: 31009,\n          msg: 'User blocked'\n      },\n      // 域名无效\n      CONN_DOMAIN_INCORRECT: {\n          code: 31012,\n          msg: 'Connect domain error, Please check the set security domain'\n      },\n      // 未开通单群聊历史消息云存储\n      ROAMING_SERVICE_UNAVAILABLE: {\n          code: 33007,\n          msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n      },\n      // 已连接, 不可再次调用链接(错误码与移动端对齐)\n      RC_CONNECTION_EXIST: {\n          code: 34001,\n          msg: 'Connection already exists'\n      },\n      // 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n      CHATROOM_KV_EXCEED: {\n          code: 23423,\n          msg: 'ChatRoom KV setting exceeds maximum'\n      },\n      // 聊天室 KV 已存在\n      CHATROOM_KV_OVERWRITE_INVALID: {\n          code: 23424,\n          msg: 'ChatRoom KV already exists'\n      },\n      // 聊天室 KV 存储功能没有开通\n      CHATROOM_KV_STORE_NOT_OPEN: {\n          code: 23426,\n          msg: 'ChatRoom KV storage service is not open, Please go to the developer to open this service'\n      },\n      // 聊天室Key不存在\n      CHATROOM_KEY_NOT_EXIST: {\n          code: 23427,\n          msg: 'ChatRoom key does not exist'\n      },\n      // 消息不支持扩展存储(错误码与移动端对齐)\n      MSG_KV_NOT_SUPPORT: {\n          code: 34008,\n          msg: 'The message cannot be extended'\n      },\n      // 发送扩展存储消息失败(错误码与移动端对齐)\n      SEND_MESSAGE_KV_FAIL: {\n          code: 34009,\n          msg: 'Sending RC expansion message fail'\n      },\n      // 扩展存储 key value 超出限制(错误码与移动端对齐)\n      EXPANSION_LIMIT_EXCEET: {\n          code: 34010,\n          msg: 'The message expansion size is beyond the limit'\n      },\n      // 调用接口时传入的参数不正确(错误码与移动端对齐)\n      ILLGAL_PARAMS: {\n          code: 33003,\n          msg: 'Incorrect parameters passed in while calling the interface'\n      }\n  };\n  const ERROR_CODE = {};\n  for (const name in ERROR_INFO) {\n      const info = ERROR_INFO[name];\n      const { code } = info;\n      // ERROR_CODE[name] = code\n      ERROR_CODE[code] = name;\n  }\n  // 服务返回的错误码, 转化为 SDK 的 ErrorCode\n  const SERVER_ERROR_TO_CODE = {\n      // 未开通单群聊历史消息云存储\n      1: ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n  };\n\n  const CONNECTION_STATUS = {\n      CONNECTED: 0,\n      CONNECTING: 1,\n      DISCONNECTED: 2,\n      NETWORK_UNAVAILABLE: 3,\n      SOCKET_ERROR: 4,\n      KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n      BLOCKED: 12 // 用户被封禁(服务值为 2, 转为状态码后 + 10)\n  };\n\n  /**\n   * 业务层枚举, 此处枚举会暴露给开发者\n  */\n  const CONNECT_TYPE = {\n      COMET: 'comet',\n      WEBSOCKET: 'websocket'\n  };\n  const CONVERSATION_TYPE = engine.ConversationType;\n  const MESSAGE_DIRECTION = engine.MessageDirection;\n  const MESSAGS_TIME_ORDER = {\n      DESC: 0,\n      ASC: 1 // 正序\n  };\n  // 聊天室历史消息、聊天室用户信息排序\n  const CHATROOM_ORDER = {\n      ASC: 1,\n      DESC: 2\n  };\n  const RECALL_MESSAGE_TYPE = 'RC:RcCmd';\n  const MENTIONED_TYPE = {\n      ALL: 1,\n      SINGAL: 2\n  };\n  const MESSAGE_TYPE = {\n      TEXT: 'RC:TxtMsg',\n      VOICE: 'RC:VcMsg',\n      HQ_VOICE: 'RC:HQVCMsg',\n      IMAGE: 'RC:ImgMsg',\n      GIF: 'RC:GIFMsg',\n      RICH_CONTENT: 'RC:ImgTextMsg',\n      LOCATION: 'RC:LBSMsg',\n      FILE: 'RC:FileMsg',\n      SIGHT: 'RC:SightMsg',\n      COMBINE: 'RC:CombineMsg',\n      CHRM_KV_NOTIFY: 'RC:chrmKVNotiMsg',\n      LOG_COMMAND: 'RC:LogCmdMsg',\n      EXPANSION_NOTIFY: 'RC:MsgExMsg',\n      REFERENCE: 'RC:ReferenceMsg'\n  };\n  const FILE_TYPE = engine.FileType;\n  // 聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新\n  const CHATROOM_ENTRY_TYPE = {\n      UPDATE: 1,\n      DELETE: 2\n  };\n  const NOTIFICATION_STATUS = {\n      DO_NOT_DISTURB: 1,\n      NOTIFY: 2 // 提醒(非免打扰)\n  };\n  const RECEIVED_STATUS = {\n      READ: 0x1,\n      LISTENED: 0x2,\n      DOWNLOADED: 0x4,\n      RETRIEVED: 0x8,\n      UNREAD: 0 // 未读\n  };\n  const SDK_VERSION = \"4.2.0\";\n\n  /**\n   * 转化 APIContext 传过来的消息数据\n   * @param msg APIContext 消息\n   * @returns V3 需要的消息数据\n   */\n  function tranReceivedMessage(msg) {\n      let { conversationType: type, messageType, content, senderUserId, targetId, sentTime, receivedTime, messageUId, messageDirection, isPersited, isCounted, isOffLineMessage, canIncludeExpansion, expansion, receivedStatus, disableNotification, isMentioned, isStatusMessage } = msg;\n      if (!receivedStatus) {\n          receivedStatus = engine.ReceivedStatus.UNREAD;\n      }\n      return {\n          messageType,\n          content,\n          senderUserId,\n          targetId,\n          type,\n          sentTime,\n          receivedTime,\n          messageUId,\n          messageDirection,\n          isPersited,\n          isCounted,\n          isOffLineMessage,\n          isMentioned,\n          disableNotification,\n          isStatusMessage,\n          canIncludeExpansion,\n          expansion,\n          receivedStatus\n      };\n  }\n  /**\n   * 转化 APIContext 传过来的会话数据\n   * @param conversation APIContext 会话\n   * @returns V3 需要的会话数据\n   */\n  function tranReceiveConversation(conversation) {\n      const { conversationType: type, targetId, latestMessage, unreadMessageCount, hasMentioned, mentionedInfo, lastUnreadTime, notificationStatus, isTop } = conversation;\n      const latestMessageV3 = latestMessage && tranReceivedMessage(latestMessage);\n      let mentionedInfoV3;\n      if (hasMentioned) {\n          mentionedInfoV3 = {\n              type: mentionedInfo === null || mentionedInfo === void 0 ? void 0 : mentionedInfo.type,\n              userIdList: mentionedInfo === null || mentionedInfo === void 0 ? void 0 : mentionedInfo.userIdList\n          };\n      }\n      else {\n          mentionedInfoV3 = undefined;\n      }\n      return {\n          type,\n          targetId,\n          latestMessage: latestMessageV3,\n          unreadMessageCount,\n          hasMentioned,\n          mentionedInfo: mentionedInfoV3,\n          lastUnreadTime,\n          notificationStatus,\n          isTop\n      };\n  }\n  function tranReceiveUpdateConversation(conversation) {\n      const { updatedItems, conversationType: type, targetId, latestMessage, unreadMessageCount, lastUnreadTime, notificationStatus, isTop, mentionedInfo, hasMentioned } = conversation;\n      const latestMessageV3 = latestMessage && tranReceivedMessage(latestMessage);\n      if (updatedItems && updatedItems.latestMessage) {\n          updatedItems.latestMessage.val = latestMessageV3;\n      }\n      return {\n          updatedItems,\n          type,\n          targetId,\n          latestMessage: latestMessageV3,\n          unreadMessageCount,\n          lastUnreadTime,\n          notificationStatus,\n          isTop,\n          mentionedInfo,\n          hasMentioned\n      };\n  }\n  /**\n   * 校验发消息的参数\n   */\n  function assertSendMsgOption(options) {\n      engine.assert('options.messageType', options.messageType, engine.AssertRules.STRING, true);\n      engine.assert('options.content', options.content, (value) => {\n          return engine.isObject(value);\n      }, true);\n      engine.assert('options.isPersited', options.isPersited, engine.AssertRules.BOOLEAN);\n      engine.assert('options.isCounted', options.isCounted, engine.AssertRules.BOOLEAN);\n      engine.assert('options.pushContent', options.pushContent, engine.AssertRules.STRING);\n      engine.assert('options.pushData', options.pushData, engine.AssertRules.STRING);\n      engine.assert('options.isVoipPush', options.isVoipPush, engine.AssertRules.BOOLEAN);\n      engine.assert('options.isStatusMessage', options.isStatusMessage, engine.AssertRules.BOOLEAN);\n      engine.assert('options.isMentioned', options.isMentioned, engine.AssertRules.BOOLEAN);\n      engine.assert('options.mentionedType', options.mentionedType, engine.AssertRules.NUMBER);\n      engine.assert('options.mentionedUserIdList', options.mentionedUserIdList, (value) => {\n          return engine.isArray(value) && (value.length === 0 || value.every(engine.isString));\n      });\n      engine.assert('options.directionalUserIdList', options.directionalUserIdList, (value) => {\n          return engine.isArray(value) && (value.length === 0 || value.every(engine.isString));\n      });\n      if (!engine.isUndefined(options.isPersited) || !engine.isUndefined(options.isCounted) || !engine.isUndefined(options.isStatusMessage)) {\n          logger.warn('The parameters `isPersited`, `isCounted`, `isStatusMessage` will be deprecated in future releases due to inconsistance of the values on mobile side and web side. Please use `registerMessageType` instead for non-integrated message type.');\n      }\n  }\n\n  // import { isObject, isUndefined } from '../../utils/validator'\n  /**\n   * 会话排序（拆分-排序-合并）\n   * 将会话列表拆分为置顶和非置顶的两个数组\n   * 再对两个数组按时间进行排序，时间戳大的说明是最近的消息排最上\n  */\n  const sortConList = (conversationList, order) => {\n      if (!conversationList) {\n          return [];\n      }\n      const splitConversationList = splitConversationListByIsTop(conversationList);\n      const topConversationList = _sortListBySentTime(splitConversationList.topConversationList, order);\n      const unToppedConversationList = _sortListBySentTime(splitConversationList.unToppedConversationList, order);\n      topConversationList.push.apply(topConversationList, unToppedConversationList);\n      return topConversationList;\n  };\n  const mergeConversationList = (option) => {\n      option = option || {};\n      let { conversationList, updatedConversationList } = option;\n      conversationList = conversationList || [];\n      updatedConversationList = updatedConversationList || [];\n      const allConversationList = [...updatedConversationList, ...conversationList];\n      // 按顺序合并相同会话的数值(顺序依然为上一步的排序, 只是数值合并, 顺序靠后的数值合并到顺序靠前数值中)\n      const hashTable = {};\n      let newList = [];\n      const invalidDataIndexList = [];\n      engine.forEach(allConversationList, (conversation) => {\n          if (!engine.isObject(conversation)) { // 会话格式错误, 不添加至新列表\n              return;\n          }\n          const { type, targetId } = conversation;\n          const key = getConversationKey({ type, targetId });\n          const hashItem = hashTable[key] || {};\n          const hashIndex = engine.isUndefined(hashItem.index) ? newList.length : hashItem.index;\n          const hashVal = hashItem.val || {};\n          const cacheUpdatedItems = hashVal.updatedItems || {};\n          const updatedItems = conversation.updatedItems;\n          conversation = extend(conversation, hashVal);\n          engine.forEach(cacheUpdatedItems, (item, key) => {\n              conversation[key] = item.val;\n          });\n          engine.forEach(updatedItems, (item, key) => {\n              const cacheItem = cacheUpdatedItems[key] || {};\n              const cacheItemUpdatedTime = cacheItem.time || 0;\n              if (item.time > cacheItemUpdatedTime) {\n                  conversation[key] = item.val;\n              }\n          });\n          hashTable[key] = { index: hashIndex, val: conversation };\n          newList[hashIndex] = conversation;\n          isInValidConversationData(conversation) && invalidDataIndexList.push(hashIndex);\n      });\n      engine.forEach(invalidDataIndexList, (invalidIndex) => {\n          const conversation = newList[invalidIndex];\n          newList[invalidIndex] = fixConversationData(conversation);\n      });\n      newList = sortConList(newList);\n      return engine.map(newList, (item) => {\n          delete item.updatedItems;\n          return item;\n      });\n  };\n  const splitConversationListByIsTop = (conversationList) => {\n      const topConversationList = [];\n      const unToppedConversationList = [];\n      engine.forEach(conversationList, (conversation) => {\n          // 兼容会话中单词拼写错误字段 hasMentiond、mentiondInfo\n          const { hasMentioned, mentionedInfo } = conversation;\n          conversation.hasMentioned = hasMentioned;\n          conversation.mentionedInfo = mentionedInfo;\n          // 兼容接收\n          const isTop = conversation.isTop || false;\n          if (isTop) {\n              topConversationList.push(conversation);\n          }\n          else {\n              unToppedConversationList.push(conversation);\n          }\n      });\n      return {\n          topConversationList: topConversationList || [],\n          unToppedConversationList: unToppedConversationList || []\n      };\n  };\n  const getConversationKey = (option) => {\n      const { type, targetId } = option;\n      return type + '_' + targetId;\n  };\n  const _sortListBySentTime = (convers, order = 0) => {\n      return quickSort(convers, (before, after) => {\n          before = before || {};\n          after = after || {};\n          const beforeLatestMessage = before.latestMessage || {};\n          const afterLatestMessage = after.latestMessage || {};\n          const beforeLatestSentTime = beforeLatestMessage.sentTime || 0;\n          const afterLatestSentTime = afterLatestMessage.sentTime || 0;\n          if (!order) {\n              return afterLatestSentTime <= beforeLatestSentTime;\n          }\n          return afterLatestSentTime >= beforeLatestSentTime;\n      });\n  };\n  const fixConversationData = (conversation) => {\n      conversation = conversation || {};\n      const { targetId, type } = conversation;\n      const defaultType = engine.ConversationType.PRIVATE;\n      const defaultMsg = {\n          messageType: engine.MessageType.TextMessage,\n          sentTime: engine.DelayTimer.getTime(),\n          content: { content: '' },\n          senderUserId: targetId,\n          targetId,\n          type\n      };\n      conversation.type = type || defaultType;\n      conversation.targetId = targetId || '';\n      conversation.latestMessage = conversation.latestMessage || defaultMsg;\n      return conversation;\n  };\n  const quickSort = (arr, event) => {\n      const sort = (array, left, right, event) => {\n          event = event || ((a, b) => {\n              return a <= b;\n          });\n          if (left < right) {\n              const x = array[right];\n              let i = left - 1;\n              let temp;\n              for (let j = left; j <= right; j++) {\n                  if (event(array[j], x)) {\n                      i++;\n                      temp = array[i];\n                      array[i] = array[j];\n                      array[j] = temp;\n                  }\n              }\n              sort(array, left, i - 1, event);\n              sort(array, i + 1, right, event);\n          }\n          return array;\n      };\n      return sort(arr, 0, arr.length - 1, event);\n  };\n  const isInValidConversationData = (conversation) => {\n      return !conversation.type ||\n          !conversation.targetId ||\n          !engine.isObject(conversation.latestMessage) ||\n          engine.isUndefined(conversation.unreadMessageCount);\n  };\n  const extend = (destination, sources, option) => {\n      option = option || {};\n      const { isAllowNull } = option;\n      destination = destination || {};\n      sources = sources || {};\n      for (const key in sources) {\n          const value = sources[key];\n          if (!engine.isUndefined(value) || isAllowNull) {\n              destination[key] = value;\n          }\n      }\n      return destination;\n  };\n\n  class Conversation {\n      constructor(_context, option) {\n          this._context = _context;\n          this.targetId = option.targetId;\n          this.type = option.type;\n      }\n      /**\n       * 删除指定会话\n       */\n      destory() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.removeConversation(this.type, this.targetId);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 清除会话未读数\n       */\n      read() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.clearUnreadCount(this.type, this.targetId);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取指定会话未读数\n       */\n      getUnreadCount() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getUnreadCount(this.type, this.targetId);\n              // 当未读数为空时，返回 0 故不校验 data 值\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 发送消息\n       * @param options\n       * @deprecated options.isPersited\n       * @deprecated options.isCounted\n       * @deprecated options.isStatusMessage\n       */\n      send(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSendMsgOption(options);\n              if (!Object.prototype.hasOwnProperty.call(options, 'isPersited')) {\n                  options.isPersited = true;\n              }\n              if (!Object.prototype.hasOwnProperty.call(options, 'isCounted')) {\n                  options.isCounted = true;\n              }\n              const { code, data } = yield this._context.sendMessage(this.type, this.targetId, options);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 设置会话状态\n       */\n      setStatus(status) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.notificationStatus', status.notificationStatus, (value) => {\n                  return (value === 1 || value === 2);\n              });\n              engine.assert('options.isTop', status.isTop, engine.AssertRules.BOOLEAN);\n              const code = yield this._context.setConversationStatus(this.type, this.targetId, status.isTop, status.notificationStatus);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取历史消息\n       */\n      getMessages(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.timestamp', options.timestamp, engine.AssertRules.NUMBER);\n              engine.assert('options.count', options.count, engine.AssertRules.NUMBER);\n              engine.assert('options.order', options.order, (value) => {\n                  return (value === 0 || value === 1);\n              });\n              const { code, data } = yield this._context.getHistoryMessage(this.type, this.targetId, options === null || options === void 0 ? void 0 : options.timestamp, options === null || options === void 0 ? void 0 : options.count, options === null || options === void 0 ? void 0 : options.order);\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  const list = data.list.map(item => tranReceivedMessage(item));\n                  return Promise.resolve({\n                      list,\n                      hasMore: data.hasMore\n                  });\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 撤回消息\n       * @param options\n       */\n      recall(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.messageUId', options.messageUId, engine.AssertRules.STRING, true);\n              engine.assert('options.sentTime', options.sentTime, engine.AssertRules.NUMBER, true);\n              const recallOptions = {\n                  user: options.user,\n                  channelId: ''\n              };\n              const { code, data } = yield this._context.recallMessage(this.type, this.targetId, options.messageUId, options.sentTime, recallOptions);\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 按消息 id 删除消息\n       */\n      deleteMessages(messages) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options', messages, (value) => {\n                  return engine.isArray(value) && value.length;\n              }, true);\n              messages.forEach((item) => {\n                  engine.assert('options.messageUId', item.messageUId, engine.AssertRules.STRING, true);\n                  engine.assert('options.sentTime', item.sentTime, engine.AssertRules.NUMBER, true);\n                  engine.assert('options.messageDirection', item.messageDirection, (value) => {\n                      return (value === 1 || value === 2);\n                  }, true);\n              });\n              const code = yield this._context.deleteRemoteMessage(this.type, this.targetId, messages);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 按时间戳删除消息\n       */\n      clearMessages(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.timestamp', options.timestamp, engine.AssertRules.NUMBER, true);\n              const code = yield this._context.deleteRemoteMessageByTimestamp(this.type, this.targetId, options.timestamp);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 更新（添加、替换）消息扩展属性\n       * @param expansion 要更新的消息扩展信息键值对\n       * @param message 要更新的原始消息体\n      */\n      updateMessageExpansion(expansion, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('expansion', expansion, engine.AssertRules.OBJECT, true);\n              engine.assert('message', message, engine.AssertRules.OBJECT, true);\n              const { type: conversationType, targetId, messageUId, canIncludeExpansion, expansion: originExpansion } = message;\n              const { code } = yield this._context.sendExpansionMessage({\n                  conversationType,\n                  targetId,\n                  messageUId,\n                  expansion,\n                  canIncludeExpansion,\n                  originExpansion\n              });\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 删除扩展存储\n       * @params keys 需删除消息扩展的 keys\n       * @params message 原始消息体\n      */\n      removeMessageExpansion(keys, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('keys', keys, engine.AssertRules.ARRAY, true);\n              engine.assert('message', message, engine.AssertRules.OBJECT, true);\n              const { conversationType, targetId, messageUId, canIncludeExpansion } = message;\n              const { code } = yield this._context.sendExpansionMessage({\n                  conversationType,\n                  targetId,\n                  messageUId,\n                  canIncludeExpansion,\n                  keys\n              });\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 设置会话文本草稿\n       * @params conversationType 会话乐行\n       * @params targetId 目标 ID\n       * @params draft 草稿内容\n      */\n      setDraft(draft) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('draft', draft, engine.AssertRules.STRING, true);\n              const code = yield this._context.saveConversationMessageDraft(this.type, this.targetId, draft);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return Promise.resolve();\n              }\n          });\n      }\n      /**\n       * 获取会话文本草稿\n       * @params conversationType 会话乐行\n       * @params targetId 目标 ID\n      */\n      getDraft() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getConversationMessageDraft(this.type, this.targetId);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return Promise.resolve(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 删除会话文本草稿\n       * @params conversationType 会话乐行\n       * @params targetId 目标 ID\n      */\n      deleteDraft() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.clearConversationMessageDraft(this.type, this.targetId);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return Promise.resolve();\n              }\n          });\n      }\n  }\n  class ConversationModule {\n      constructor(apiContext) {\n          this._context = apiContext;\n      }\n      /**\n       * 获取会话列表\n       * @param options\n       */\n      getList(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getConversationList(options === null || options === void 0 ? void 0 : options.count, undefined, options === null || options === void 0 ? void 0 : options.startTime, options === null || options === void 0 ? void 0 : options.order);\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  const list = data.map(item => tranReceiveConversation(item));\n                  return sortConList(list);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 获取指定会话实例，通过实例可实现向指定会话收发消息等功能\n       * @description 通过该方法获取的会话可能并不存在于当前的会话列表中，此处只作为功能性封装语法糖\n       * @param options\n       */\n      get(options) {\n          engine.assert('options.type', options.type, engine.isValidConversationType, true);\n          return new Conversation(this._context, options);\n      }\n      remove(options) {\n          engine.assert('options.type', options.type, engine.isValidConversationType, true);\n          return new Conversation(this._context, options).destory();\n      }\n      /**\n       * 获取当前所有会话的消息未读数\n       */\n      getTotalUnreadCount() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getTotalUnreadCount();\n              // 当未读数为空时，返回 0 故不校验 data 值\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 合并会话\n       * @param option\n       */\n      merge(option) {\n          !option.conversationList && logger.warn('Parameter option.conversationList are required!');\n          return mergeConversationList(option);\n      }\n  }\n\n  /**\n   * 校验设置聊天室属性的参数\n   * @param options\n   */\n  const assertSetChatRoomEntryOption = (options) => {\n      engine.assert('options.key', options.key, engine.AssertRules.STRING, true);\n      engine.assert('options.value', options.value, engine.AssertRules.STRING, true);\n      engine.assert('options.isAutoDelete', options.isAutoDelete, engine.AssertRules.BOOLEAN);\n      engine.assert('options.isSendNotification', options.isSendNotification, engine.AssertRules.BOOLEAN);\n      engine.assert('options.notificationExtra', options.notificationExtra, engine.AssertRules.STRING);\n  };\n  /**\n   * 校验删除聊天室属性的参数\n   * @param options\n   */\n  const assertRemoveChatRoomEntryOption = (options) => {\n      engine.assert('options.key', options.key, engine.AssertRules.STRING, true);\n      engine.assert('options.isSendNotification', options.isSendNotification, engine.AssertRules.BOOLEAN);\n      engine.assert('options.notificationExtra', options.notificationExtra, engine.AssertRules.STRING);\n  };\n  class Chatroom {\n      constructor(context, id) {\n          this._context = context;\n          this._id = id;\n      }\n      /**\n       * 加入聊天室\n       */\n      join(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.count', options.count, engine.AssertRules.NUMBER, true);\n              const code = yield this._context.joinChatroom(this._id, options.count);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 加入已存在的聊天室\n       */\n      joinExist(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.count', options.count, engine.AssertRules.NUMBER, true);\n              const code = yield this._context.joinExistChatroom(this._id, options.count);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 退出聊天室\n       */\n      quit() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.quitChatroom(this._id);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取聊天室房间数据\n       * @description count 或 order 有一个为 0 时，只返回成员总数，不返回成员列表信息\n       */\n      getInfo(options = {}) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.count', options.count, engine.AssertRules.NUMBER);\n              engine.assert('options.order', options.order, (value) => {\n                  return [0, 1, 2].includes(value);\n              });\n              const { code, data: chatroomInfo } = yield this._context.getChatroomInfo(this._id, options.count, options.order);\n              if (code === engine.ErrorCode.SUCCESS && chatroomInfo) {\n                  return chatroomInfo;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 设置聊天室自定义属性\n       * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功\n       */\n      setEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSetChatRoomEntryOption(options);\n              const code = yield this._context.setChatroomEntry(this._id, options);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 强制 增加/修改 任意聊天室属性\n       * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功\n       */\n      forceSetEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSetChatRoomEntryOption(options);\n              const code = yield this._context.forceSetChatroomEntry(this._id, options);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 删除聊天室属性\n       * @description 仅限于删除自己设置的聊天室属性\n       * @param key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符\n       * @param isSendNotification? 删除成功后是否发送通知消息\n       * @param notificationExtra? RC:chrmKVNotiMsg 通知消息中携带的附加信息\n       */\n      removeEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertRemoveChatRoomEntryOption(options);\n              const code = yield this._context.removeChatroomEntry(this._id, options);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 强制删除聊天室内的任意属性\n       * @description\n       */\n      forceRemoveEntry(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertRemoveChatRoomEntryOption(options);\n              const code = yield this._context.forceRemoveChatroomEntry(this._id, options);\n              if (code !== engine.ErrorCode.SUCCESS) {\n                  return Promise.reject({ code, msg: ERROR_CODE[code] });\n              }\n          });\n      }\n      /**\n       * 获取聊天室的指定属性\n       */\n      getEntry(key\n      /**\n       * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符\n       */\n      ) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('key', key, (value) => {\n                  return engine.isString(value) && /[\\w+=-]+/.test(value) && value.length <= 128;\n              }, true);\n              const { code, data } = yield this._context.getChatroomEntry(this._id, key);\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 获取聊天室的所有属性\n       */\n      getAllEntries() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getAllChatroomEntries(this._id);\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  return data;\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 发送消息\n       */\n      send(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              assertSendMsgOption(options);\n              if (!Object.prototype.hasOwnProperty.call(options, 'isPersited')) {\n                  options.isPersited = true;\n              }\n              if (!Object.prototype.hasOwnProperty.call(options, 'isCounted')) {\n                  options.isCounted = true;\n              }\n              const { code, data } = yield this._context.sendMessage(engine.ConversationType.CHATROOM, this._id, options);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 获取聊天室的历史消息\n       */\n      getMessages(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.timestamp', options.timestamp, engine.AssertRules.NUMBER);\n              engine.assert('options.count', options.count, engine.AssertRules.NUMBER);\n              engine.assert('options.order', options.order, (value) => {\n                  return (value === 0 || value === 1);\n              });\n              const { code, data } = yield this._context.getChatRoomHistoryMessages(this._id, options.count, options.order, options.timestamp);\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  const list = data.list.map(item => tranReceivedMessage(item));\n                  return {\n                      list,\n                      hasMore: data.hasMore\n                  };\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n      /**\n       * 撤回聊天室消息\n      */\n      recall(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.messageUId', options.messageUId, engine.AssertRules.STRING, true);\n              engine.assert('options.sentTime', options.sentTime, engine.AssertRules.NUMBER, true);\n              const conversationType = engine.ConversationType.CHATROOM;\n              const { code, data } = yield this._context.recallMessage(conversationType, this._id, options.messageUId, options.sentTime, { channelId: '', user: options.user });\n              if (code === engine.ErrorCode.SUCCESS && data) {\n                  return tranReceivedMessage(data);\n              }\n              return Promise.reject({ code, msg: ERROR_CODE[code] });\n          });\n      }\n  }\n  class ChatroomModule {\n      constructor(apiContext) {\n          this._context = apiContext;\n      }\n      /**\n       * 根据聊天室 id 初始化一个聊天室功能实例，以实现收发消息等聊天室相关功能\n       * @param option\n       */\n      get(option) {\n          engine.assert('option.id', option.id, engine.notEmptyString, true);\n          return new Chatroom(this._context, option.id);\n      }\n  }\n\n  class RTCClient {\n      constructor(_options, _context) {\n          this._options = _options;\n          this._context = _context;\n          this._roomId = _options.id;\n      }\n      join() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.joinRTCRoom(this._roomId, this._options.mode, this._options.broadcastType);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      quit() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.quitRTCRoom(this._roomId);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      getRoomInfo() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCRoomInfo(this._roomId);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      setUserInfo(info) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCUserInfo(this._roomId, info.key, info.value);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      removeUserInfo(info) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.removeRTCUserInfo(this._roomId, info.keys);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      setData(key, value, isInner, apiType, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCData(this._roomId, key, value, isInner, apiType, message);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      setUserData(key, value, isInner, message) {\n          return this.setData(key, value, isInner, engine.RTCApiType.PERSON, message);\n      }\n      /**\n       * 全量 URI 资源发布\n       * @param message 旧版本消息，含消息名及消息内容\n       * @param valueInfo 全量消息数据\n       * @param objectName 全量 URI 消息名\n       */\n      setRTCUserData(message, valueInfo, objectName) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCTotalRes(this._roomId, message, valueInfo, objectName);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      getData(keys, isInner, apiType) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCData(this._roomId, keys, isInner, apiType);\n              return code === engine.ErrorCode.SUCCESS ? data : Promise.reject(code);\n          });\n      }\n      getUserData(keys, isInner) {\n          return this.getData(keys, isInner, engine.RTCApiType.PERSON);\n      }\n      removeData(keys, isInner, apiType, message) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.removeRTCData(this._roomId, keys, isInner, apiType, message);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      removeUserData(keys, isInner, message) {\n          return this.removeData(keys, isInner, engine.RTCApiType.PERSON, message);\n      }\n      setRoomData(key, value, isInner, message) {\n          return this.setData(key, value, isInner, engine.RTCApiType.ROOM, message);\n      }\n      getRoomData(keys, isInner) {\n          return this.getData(keys, isInner, engine.RTCApiType.ROOM);\n      }\n      removeRoomData(keys, isInner, message) {\n          return this.removeData(keys, isInner, engine.RTCApiType.ROOM, message);\n      }\n      setState(content) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.setRTCState(this._roomId, content.report);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      getUserList() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCUserInfoList(this._roomId);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      getUserInfoList() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.getRTCUserInfoList(this._roomId);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      getToken() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { data, code } = yield this._context.getRTCToken(this._roomId, this._options.mode, this._options.broadcastType);\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n      ping() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const code = yield this._context.rtcPing(this._roomId, this._options.mode, this._options.broadcastType);\n              return code === engine.ErrorCode.SUCCESS ? code : Promise.reject(code);\n          });\n      }\n      send(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              const { code, data } = yield this._context.sendMessage(engine.ConversationType.RTC_ROOM, this._roomId, {\n                  content: Object.assign({}, options.content),\n                  messageType: options.messageType\n              });\n              if (code === engine.ErrorCode.SUCCESS) {\n                  return data;\n              }\n              return Promise.reject(code);\n          });\n      }\n  }\n  // export class RTCModule {\n  //   private _context: APIContext\n  //   constructor (apiContext: APIContext) {\n  //     this._context = apiContext\n  //   }\n  //   /**\n  //     * 为 RTCLib 提供的 API 接口，业务层不可使用\n  //     * @private\n  //     * @param options\n  //     */\n  //   get (options: RTCRoomOption) {\n  //     assert('options.id', options.id, notEmptyString, true)\n  //     return new RTCClient(options, this._context)\n  //   }\n  // }\n\n  const hasMiniBaseEvent = (miniGlobal) => {\n      const baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n      for (let i = 0, max = baseMiniEventNames.length; i < max; i++) {\n          const baseEventName = baseMiniEventNames[i];\n          if (!miniGlobal[baseEventName]) {\n              return false;\n          }\n      }\n      return true;\n  };\n  const isFromUniappEnv = () => {\n      if (typeof uni !== 'undefined' && hasMiniBaseEvent(uni)) {\n          return true;\n      }\n      return false;\n  };\n\n  const isFromUniapp = isFromUniappEnv();\n  const createXHR = () => {\n      const hasCORS = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest();\n      if (typeof XMLHttpRequest !== 'undefined' && hasCORS) {\n          return new XMLHttpRequest();\n      }\n      else if (typeof XDomainRequest !== 'undefined') {\n          return new XDomainRequest();\n      }\n      else {\n          return new ActiveXObject('Microsoft.XMLHTTP');\n      }\n  };\n  function httpReq(options) {\n      const method = options.method || engine.HttpMethod.GET;\n      const timeout = options.timeout || 60 * 1000;\n      const { headers, query, body } = options;\n      const url = engine.appendUrl(options.url, query);\n      return new Promise((resolve) => {\n          const xhr = createXHR();\n          const isXDomainRequest = Object.prototype.toString.call(xhr) === '[object XDomainRequest]';\n          xhr.open(method, url);\n          if (headers && xhr.setRequestHeader) {\n              for (const key in headers) {\n                  xhr.setRequestHeader(key, headers[key]);\n              }\n          }\n          if (isXDomainRequest) {\n              xhr.timeout = timeout;\n              xhr.onload = function () {\n                  resolve({ data: xhr.responseText, status: xhr.status || 200 });\n              };\n              xhr.onerror = function () {\n                  resolve({ status: xhr.status || 0 });\n              };\n              xhr.ontimeout = () => {\n                  resolve({ status: xhr.status || 0 });\n              };\n              const reqBody = typeof body === 'object' ? JSON.stringify(body) : body;\n              xhr.send(reqBody);\n          }\n          else {\n              xhr.onreadystatechange = () => {\n                  if (xhr.readyState === 4) {\n                      resolve({ data: xhr.responseText, status: xhr.status });\n                  }\n              };\n              xhr.onerror = function () {\n                  resolve({ status: xhr.status || 0 });\n              };\n              setTimeout(() => resolve({ status: xhr.status || 0 }), timeout);\n              xhr.send(body);\n          }\n      });\n  }\n  function createWebSocket(url, protocols) {\n      const ws = new WebSocket(url, protocols);\n      ws.binaryType = 'arraybuffer';\n      return {\n          onClose(callback) {\n              ws.onclose = (evt) => {\n                  const { code, reason } = evt;\n                  callback(code, reason);\n              };\n          },\n          onError(callback) {\n              ws.onerror = callback;\n          },\n          onMessage(callback) {\n              ws.onmessage = (evt) => {\n                  callback(evt.data);\n              };\n          },\n          onOpen(callback) {\n              ws.onopen = callback;\n          },\n          send(data) {\n              ws.send(data);\n          },\n          close(code, reason) {\n              ws.close(code, reason);\n          }\n      };\n  }\n  const browser = {\n      tag: \"browser\",\n      httpReq,\n      localStorage: window === null || window === void 0 ? void 0 : window.localStorage,\n      sessionStorage: window === null || window === void 0 ? void 0 : window.sessionStorage,\n      isSupportSocket() {\n          const bool = typeof WebSocket !== 'undefined';\n          bool || logger.warn('websocket not support');\n          return bool;\n      },\n      useNavi: true,\n      connectPlatform: '',\n      isFromUniapp,\n      createWebSocket,\n      createDataChannel(watcher, connectType) {\n          if (this.isSupportSocket() && connectType === 'websocket') {\n              return new engine.WebSocketChannel(this, watcher);\n          }\n          else {\n              return new engine.CometChannel(this, watcher);\n          }\n      }\n  };\n\n  const isFromUniapp$1 = isFromUniappEnv();\n  const createFunc = (method) => (...args) => {\n      try {\n          return wx[method](...args);\n      }\n      catch (err) {\n          // 此 Bug 是由于微信小程序数据库文件可能会意外损坏导致，目前无解\n          logger.error(err);\n      }\n  };\n  const storage = {\n      setItem: createFunc('setStorageSync'),\n      getItem: createFunc('getStorageSync'),\n      removeItem: createFunc('removeStorageSync'),\n      clear: createFunc('clearStorageSync')\n  };\n  /**\n   * @todo\n   */\n  const wechat = {\n      tag: \"wechat\",\n      httpReq(options) {\n          const method = options.method || engine.HttpMethod.GET;\n          const timeout = options.timeout || 60 * 1000;\n          const { headers, query, body } = options;\n          const url = engine.appendUrl(options.url, query);\n          return new Promise((resolve) => {\n              wx.request({\n                  url,\n                  method,\n                  headers,\n                  timeout,\n                  data: body,\n                  success: (res) => {\n                      resolve({ data: res.data, status: res.statusCode });\n                  },\n                  fail: () => {\n                      resolve({ status: engine.ErrorCode.RC_HTTP_REQ_TIMEOUT });\n                  }\n              });\n          });\n      },\n      localStorage: storage,\n      sessionStorage: storage,\n      isSupportSocket() {\n          return true;\n      },\n      useNavi: false,\n      connectPlatform: 'MiniProgram',\n      isFromUniapp: isFromUniapp$1,\n      createWebSocket(url, protocols) {\n          const socketTask = wx.connectSocket({ url, protocols });\n          return {\n              onClose(callback) {\n                  socketTask.onClose((res) => {\n                      callback(res.code, res.reason);\n                  });\n              },\n              onError(callback) {\n                  socketTask.onError((res) => {\n                      callback(res.errMsg);\n                  });\n              },\n              onMessage(callback) {\n                  socketTask.onMessage((res) => {\n                      callback(res.data);\n                  });\n              },\n              onOpen(callback) {\n                  socketTask.onOpen(callback);\n              },\n              send(data) {\n                  socketTask.send({ data });\n              },\n              close(code, reason) {\n                  socketTask.close({ code, reason });\n              }\n          };\n      },\n      createDataChannel(watcher) {\n          return new engine.WebSocketChannel(this, watcher);\n      }\n  };\n\n  const isFromUniapp$2 = isFromUniappEnv();\n  const createFunc$1 = (method) => (...args) => {\n      try {\n          return my[method](...args);\n      }\n      catch (err) {\n          logger.error(err);\n      }\n  };\n  const storage$1 = {\n      setItem: createFunc$1('setStorageSync'),\n      getItem: createFunc$1('getStorageSync'),\n      removeItem: createFunc$1('removeStorageSync'),\n      clear: createFunc$1('clearStorageSync')\n  };\n  const alipay = {\n      tag: \"alipay\",\n      httpReq(options) {\n          const method = options.method || engine.HttpMethod.GET;\n          const timeout = options.timeout || 60 * 1000;\n          const { headers, query, body } = options;\n          const url = engine.appendUrl(options.url, query);\n          return new Promise((resolve) => {\n              my.request({\n                  url,\n                  method,\n                  headers,\n                  timeout,\n                  data: body,\n                  success: (res) => {\n                      resolve({ data: res.data, status: res.status });\n                  },\n                  fail: () => {\n                      resolve({ status: engine.ErrorCode.RC_HTTP_REQ_TIMEOUT });\n                  }\n              });\n          });\n      },\n      localStorage: storage$1,\n      sessionStorage: storage$1,\n      isSupportSocket() {\n          return false;\n      },\n      useNavi: false,\n      connectPlatform: 'MiniProgram',\n      isFromUniapp: isFromUniapp$2,\n      createDataChannel(watcher) {\n          return new engine.CometChannel(this, watcher);\n      }\n  };\n\n  // TODO\n  const createFunc$2 = (method) => (...args) => {\n      try {\n          return uni[method](...args);\n      }\n      catch (err) {\n          logger.error(err);\n      }\n  };\n  const storage$2 = {\n      setItem: createFunc$2('setStorageSync'),\n      getItem: createFunc$2('getStorageSync'),\n      removeItem: createFunc$2('removeStorageSync'),\n      clear: createFunc$2('clearStorageSync')\n  };\n  /**\n   * @todo\n   */\n  const appPlus = {\n      tag: \"uniapp\",\n      httpReq(options) {\n          const method = options.method || engine.HttpMethod.GET;\n          const timeout = options.timeout || 60 * 1000;\n          const { headers, query, body } = options;\n          const url = engine.appendUrl(options.url, query);\n          return new Promise((resolve) => {\n              uni.request({\n                  url,\n                  method,\n                  headers,\n                  timeout,\n                  data: body,\n                  success: (res) => {\n                      resolve({ data: res.data, status: res.statusCode });\n                  },\n                  fail: () => {\n                      resolve({ status: engine.ErrorCode.RC_HTTP_REQ_TIMEOUT });\n                  }\n              });\n          });\n      },\n      localStorage: storage$2,\n      sessionStorage: storage$2,\n      isSupportSocket() {\n          return true;\n      },\n      useNavi: true,\n      connectPlatform: '',\n      isFromUniapp: true,\n      createWebSocket(url, protocols) {\n          const options = {\n              complete: () => { },\n              url,\n              protocols\n          };\n          const socketTask = uni.connectSocket(options);\n          return {\n              onClose(callback) {\n                  socketTask.onClose((res) => {\n                      callback(res.code, res.reason);\n                  });\n              },\n              onError(callback) {\n                  socketTask.onError((res) => {\n                      callback(res.errMsg);\n                  });\n              },\n              onMessage(callback) {\n                  socketTask.onMessage((res) => {\n                      callback(res.data);\n                  });\n              },\n              onOpen(callback) {\n                  socketTask.onOpen(callback);\n              },\n              send(data) {\n                  socketTask.send({ data });\n              },\n              close(code, reason) {\n                  socketTask.close({ code, reason });\n              }\n          };\n      },\n      createDataChannel(watcher) {\n          return new engine.WebSocketChannel(this, watcher);\n      }\n  };\n  const uniapp = () => {\n      const uniPlatform = process.env.VUE_APP_PLATFORM;\n      switch (uniPlatform) {\n          case 'app-plus':\n              return appPlus;\n          // case 'mp-baidu':\n          //   return {}\n          // case 'mp-toutiao':\n          //   return {}\n          case 'mp-alipay':\n              return alipay;\n          case 'mp-weixin':\n              return wechat;\n          case 'h5':\n          default:\n              return browser;\n      }\n  };\n\n  const isMiniPrograme = (miniGlobal) => {\n      return miniGlobal && miniGlobal.canIUse && miniGlobal.getSystemInfo;\n  };\n  const runtime = (() => {\n      if (typeof uni !== 'undefined' && isMiniPrograme(uni)) {\n          return uniapp();\n      }\n      if (typeof wx !== 'undefined' && isMiniPrograme(wx)) {\n          return wechat;\n      }\n      if (typeof my !== 'undefined' && isMiniPrograme(my)) {\n          return alipay;\n      }\n      return browser;\n  })();\n\n  // RTCLib、CallLib 相关监听存储\n  const rtcInnerMsgWatcher = [];\n  const rtcInnerStatusWatcher = [];\n  const rtcInnerWatcher = {\n      message(message) {\n          rtcInnerMsgWatcher.forEach(item => item(message));\n      },\n      status(status) {\n          rtcInnerStatusWatcher.forEach(item => item(status));\n      }\n  };\n  class IMClient {\n      constructor(apiContext) {\n          this._token = '';\n          this._context = apiContext;\n          this.Conversation = new ConversationModule(apiContext);\n          this.ChatRoom = new ChatroomModule(apiContext);\n          this.RTC = function (options) {\n              engine.assert('options.id', options.id, engine.notEmptyString, true);\n              return new RTCClient(options, apiContext);\n          };\n      }\n      /**\n       * 装载 plugin 插件，并返回相应的插件实例，需在调用 `connect` 方法之前使用\n       * @param plugins\n       */\n      install(plugin, options) {\n          return this._context.install(plugin, options);\n      }\n      /**\n       * 添加全局事件监听，同一类型事件会覆盖添加，以避免多次监听引起的复杂问题\n       * @param options\n       */\n      watch(options) {\n          const { status: statusListener, conversation: conversationListener, message: messageListener, chatroom: chatroomListener, expansion: expansionListener } = options;\n          const watcher = {};\n          if (statusListener) {\n              watcher.connectionState = (status) => {\n                  // 对业务层的方法要增加 catch 捕获，避免影响内部调用栈的继续进行\n                  try {\n                      statusListener({ status });\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              };\n          }\n          if (conversationListener) {\n              watcher.conversationState = (conversations) => {\n                  try {\n                      const list = conversations.map((item) => tranReceiveUpdateConversation(item));\n                      conversationListener({\n                          updatedConversationList: list\n                      });\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              };\n          }\n          if (messageListener) {\n              watcher.message = (message) => {\n                  try {\n                      messageListener({ message: tranReceivedMessage(message) });\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              };\n          }\n          if (chatroomListener) {\n              watcher.chatroomState = (event) => {\n                  try {\n                      chatroomListener(event);\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              };\n          }\n          if (expansionListener) {\n              watcher.expansion = (event) => {\n                  try {\n                      expansionListener(event);\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              };\n          }\n          this._context.assignWatcher(watcher);\n      }\n      unwatch() {\n          this._context.assignWatcher({\n              message: undefined,\n              connectionState: undefined,\n              conversationState: undefined,\n              chatroomState: undefined,\n              expansion: undefined\n          });\n      }\n      rtcInnerWatch(attrs) {\n          const { message: messageListener, status: statusListener } = attrs;\n          if (messageListener) {\n              rtcInnerMsgWatcher.push((message) => {\n                  try {\n                      messageListener({ message: tranReceivedMessage(message) });\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              });\n          }\n          if (statusListener) {\n              rtcInnerStatusWatcher.push((status) => {\n                  try {\n                      statusListener({ status });\n                  }\n                  catch (err) {\n                      logger.error(err);\n                  }\n              });\n          }\n          this._context.assignWatcher({ rtcInnerWatcher });\n      }\n      rtcInnerUnwatch() {\n          rtcInnerStatusWatcher.length = rtcInnerStatusWatcher.length = 0;\n          this._context.assignWatcher({ rtcInnerWatcher: undefined });\n      }\n      /**\n       * 建立 IM 连接\n       * @param options\n       */\n      connect(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              engine.assert('options.token', options.token, engine.AssertRules.STRING, true);\n              const token = options.token;\n              this._token = token;\n              const res = yield this._context.connect(token, true);\n              if (res.code === engine.ErrorCode.SUCCESS) {\n                  return { id: res.userId };\n              }\n              return Promise.reject({ code: res.code, msg: ERROR_CODE[res.code] });\n          });\n      }\n      /**\n       * 使用上一次的链接 token 重新建立连接，该方法只需在主动调用 `disconnect` 方法之后有重连需求时调用\n       */\n      reconnect() {\n          return __awaiter(this, void 0, void 0, function* () {\n              const res = yield this._context.reconnect();\n              if (res.code === engine.ErrorCode.SUCCESS) {\n                  return { id: res.userId };\n              }\n              return Promise.reject({ code: res.code, msg: ERROR_CODE[res.code] });\n          });\n      }\n      /**\n       * 断开当前用户的连接\n       * @description 调用后将不再接收消息，不可发送消息，不可获取历史消息，不可获取会话列表\n       */\n      disconnect() {\n          return this._context.disconnect();\n      }\n      /**\n       * 获取当前 IM 环境信息\n       */\n      getAppInfo() {\n          return {\n              appkey: this._context.appkey,\n              token: this._token,\n              navi: this._context.getInfoFromCache()\n          };\n      }\n      /**\n       * 获取 IM 连接时间\n       */\n      getConnectedTime() {\n          return this._context.getConnectedTime();\n      }\n      /**\n       * 获取 IM 连接状态\n       */\n      getConnectionStatus() {\n          return this._context.getConnectionStatus();\n      }\n      /**\n       * 获取 IM 连接用户的 id\n       */\n      getConnectionUserId() {\n          return this._context.getCurrentUserId();\n      }\n      /**\n       * 获取文件 token\n       * @description 上传文件时，获取文件 token\n       * @param fileType 上传类型, 通过 RongIMLib.FILE_TYPE 获取\n       * @param fileName 上传文件名，Server 通过文件名生成百度上传认证, 若不传 engine 自动生成\n       */\n      getFileToken(fileType, fileName) {\n          engine.assert('fileType', fileType, engine.isValidFileType, true);\n          return this._context.getFileToken(fileType, fileName);\n      }\n      /**\n       * 获取文件上传后的下载地址\n       */\n      getFileUrl(\n      /**\n       * 上传类型, 通过 RongIMLib.FILE_TYPE 获取\n       */\n      fileType, \n      /**\n       * 上传后的文件名\n       */\n      filename, \n      /**\n       * 原始文件名\n       */\n      oriname, \n      /**\n       * 上传成功返回数据\n       * 百度 bos 上传地址即为下载地址，IM Server 不会返回百度 bos 下载地址，通过用户层传入再返回\n      */\n      uploadRes, \n      /**\n       * 上传方式，阿里或七牛，RongIMLib.UploadMethod 获取\n       */\n      uploadMethod) {\n          engine.assert('fileType', fileType, engine.isValidFileType, true);\n          engine.assert('filename', filename, engine.AssertRules.STRING);\n          engine.assert('oriname', oriname, engine.AssertRules.STRING);\n          engine.assert('uploadMethod', uploadMethod, engine.AssertRules.NUMBER);\n          return this._context.getFileUrl(fileType, filename, oriname, uploadRes, uploadMethod);\n      }\n      /**\n       * 切换用户，作用等同于断开当前用户连接，以新的 token 重新建立连接\n       * @deprecated\n       * @param option\n       */\n      changeUser(options) {\n          return __awaiter(this, void 0, void 0, function* () {\n              logger.warn('Method is deprecated');\n              engine.assert('options.token', options.token, engine.AssertRules.STRING, true);\n              yield this.disconnect();\n              return this.connect(options);\n          });\n      }\n      /**\n       * 注册自定义消息\n       * @param messageType 消息类型\n       * @param isPersited  是否存储\n       * @param isCounted   是否计数\n       * @param prototypes  消息属性名称\n      */\n      registerMessageType(messageType, isPersited, isCounted, prototypes) {\n          this._context.registerMessageType(messageType, isPersited, isCounted, prototypes);\n      }\n  }\n  let imInstance;\n  /**\n   * 初始化\n   * @param {IInitOption} options\n   */\n  const init = (options) => {\n      if (imInstance) {\n          logger.error('The instance already exists. Do not repeatedly call the init method');\n          return imInstance;\n      }\n      engine.assert('options.appkey', options.appkey, engine.AssertRules.STRING, true);\n      engine.assert('options.debug', options.debug, engine.AssertRules.BOOLEAN);\n      engine.assert('options.navigators', options.navigators, (value) => {\n          return engine.isArray(value) && (value.length === 0 || value.every(engine.isHttpUrl));\n      });\n      const context = engine.APIContext.init(runtime, {\n          appkey: options.appkey,\n          apiVersion: \"4.2.0\",\n          navigators: options.navigators || [],\n          miniCMPProxy: options.customCMP || [],\n          connectionType: options.connectType || 'websocket',\n          cppProtocol: options.cppProtocol\n      });\n      imInstance = new IMClient(context);\n      return imInstance;\n  };\n  const getInstance = () => {\n      if (!imInstance) {\n          logger.error('Please call the init method first');\n      }\n      return imInstance;\n  };\n\n  Object.defineProperty(exports, 'ConnectionStatus', {\n      enumerable: true,\n      get: function () {\n          return engine.ConnectionStatus;\n      }\n  });\n  Object.defineProperty(exports, 'LogLevel', {\n      enumerable: true,\n      get: function () {\n          return engine.LogLevel;\n      }\n  });\n  Object.defineProperty(exports, 'UploadMethod', {\n      enumerable: true,\n      get: function () {\n          return engine.UploadMethod;\n      }\n  });\n  exports.CHATROOM_ENTRY_TYPE = CHATROOM_ENTRY_TYPE;\n  exports.CHATROOM_ORDER = CHATROOM_ORDER;\n  exports.CONNECTION_STATUS = CONNECTION_STATUS;\n  exports.CONNECT_TYPE = CONNECT_TYPE;\n  exports.CONVERSATION_TYPE = CONVERSATION_TYPE;\n  exports.ERROR_CODE = ERROR_CODE;\n  exports.FILE_TYPE = FILE_TYPE;\n  exports.IMClient = IMClient;\n  exports.MENTIONED_TYPE = MENTIONED_TYPE;\n  exports.MESSAGE_DIRECTION = MESSAGE_DIRECTION;\n  exports.MESSAGE_TYPE = MESSAGE_TYPE;\n  exports.MESSAGS_TIME_ORDER = MESSAGS_TIME_ORDER;\n  exports.NOTIFICATION_STATUS = NOTIFICATION_STATUS;\n  exports.RECALL_MESSAGE_TYPE = RECALL_MESSAGE_TYPE;\n  exports.RECEIVED_STATUS = RECEIVED_STATUS;\n  exports.SDK_VERSION = SDK_VERSION;\n  exports.getInstance = getInstance;\n  exports.init = init;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n"
  },
  {
    "path": "api-test-v4/lib/js/es6-promise.js",
    "content": "!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){\"use strict\";function t(t){var e=typeof t;return null!==t&&(\"object\"===e||\"function\"===e)}function e(t){return\"function\"==typeof t}function n(t){W=t}function r(t){z=t}function o(){return function(){return process.nextTick(a)}}function i(){return\"undefined\"!=typeof U?function(){U(a)}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode(\"\");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<N;t+=2){var e=Q[t],n=Q[t+1];e(n),Q[t]=void 0,Q[t+1]=void 0}N=0}function f(){try{var t=Function(\"return this\")().require(\"vertx\");return U=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(v);void 0===r[V]&&x(r);var o=n._state;if(o){var i=arguments[o-1];z(function(){return T(o,r,i,n._result)})}else j(n,r,t,e);return r}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var n=new e(v);return w(n,t),n}function v(){}function p(){return new TypeError(\"You cannot resolve a promise with itself\")}function d(){return new TypeError(\"A promises callback cannot return that same promise.\")}function _(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function y(t,e,n){z(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?w(t,n):A(t,n))},function(e){r||(r=!0,S(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!r&&o&&(r=!0,S(t,o))},t)}function m(t,e){e._state===Z?A(t,e._result):e._state===$?S(t,e._result):j(e,void 0,function(e){return w(t,e)},function(e){return S(t,e)})}function b(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?m(t,n):void 0===r?A(t,n):e(r)?y(t,n,r):A(t,n)}function w(e,n){if(e===n)S(e,p());else if(t(n)){var r=void 0;try{r=n.then}catch(o){return void S(e,o)}b(e,n,r)}else A(e,n)}function g(t){t._onerror&&t._onerror(t._result),E(t)}function A(t,e){t._state===X&&(t._result=e,t._state=Z,0!==t._subscribers.length&&z(E,t))}function S(t,e){t._state===X&&(t._state=$,t._result=e,z(g,t))}function j(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+Z]=n,o[i+$]=r,0===i&&t._state&&z(E,t)}function E(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?T(n,r,o,i):o(i);t._subscribers.length=0}}function T(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=!0;if(i){try{s=r(o)}catch(a){c=!1,u=a}if(n===s)return void S(n,d())}else s=o;n._state!==X||(i&&c?w(n,s):c===!1?S(n,u):t===Z?A(n,s):t===$&&S(n,s))}function M(t,e){try{e(function(e){w(t,e)},function(e){S(t,e)})}catch(n){S(t,n)}}function P(){return tt++}function x(t){t[V]=tt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function C(){return new Error(\"Array Methods must be provided an Array\")}function O(t){return new et(this,t).promise}function k(t){var e=this;return new e(L(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function F(t){var e=this,n=new e(v);return S(n,t),n}function Y(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function q(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function D(){var t=void 0;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(e){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if(\"[object Promise]\"===r&&!n.cast)return}t.Promise=nt}var K=void 0;K=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var L=K,N=0,U=void 0,W=void 0,z=function(t,e){Q[N]=t,Q[N+1]=e,N+=2,2===N&&(W?W(a):R())},B=\"undefined\"!=typeof window?window:void 0,G=B||{},H=G.MutationObserver||G.WebKitMutationObserver,I=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),J=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,Q=new Array(1e3),R=void 0;R=I?o():H?s():J?u():void 0===B&&\"function\"==typeof require?f():c();var V=Math.random().toString(36).substring(2),X=void 0,Z=1,$=2,tt=0,et=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(v),this.promise[V]||x(this.promise),L(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&A(this.promise,this._result))):S(this.promise,C())}return t.prototype._enumerate=function(t){for(var e=0;this._state===X&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(u){s=!0,i=u}if(o===l&&t._state!==X)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=t;else if(n===nt){var c=new n(v);s?S(c,i):b(c,t,o),this._willSettleAt(c,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===X&&(this._remaining--,t===$?S(r,n):this._result[e]=n),0===this._remaining&&A(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){return n._settledAt(Z,e,t)},function(t){return n._settledAt($,e,t)})},t}(),nt=function(){function t(e){this[V]=P(),this._result=this._state=void 0,this._subscribers=[],v!==e&&(\"function\"!=typeof e&&Y(),this instanceof t?M(this,e):q())}return t.prototype[\"catch\"]=function(t){return this.then(null,t)},t.prototype[\"finally\"]=function(t){var n=this,r=n.constructor;return e(t)?n.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):n.then(t,t)},t}();return nt.prototype.then=l,nt.all=O,nt.race=k,nt.resolve=h,nt.reject=F,nt._setScheduler=n,nt._setAsap=r,nt._asap=z,nt.polyfill=D,nt.Promise=nt,nt});"
  },
  {
    "path": "api-test-v4/lib/js/vue-2.6.10.js",
    "content": "/*!\n * Vue.js v2.6.11\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){\"use strict\";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return\"string\"==typeof e||\"number\"==typeof e||\"symbol\"==typeof e||\"boolean\"==typeof e}function o(e){return null!==e&&\"object\"==typeof e}var a=Object.prototype.toString;function s(e){return\"[object Object]\"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&\"function\"==typeof e.then&&\"function\"==typeof e.catch}function l(e){return null==e?\"\":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(\",\"),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var d=p(\"slot,component\",!0),v=p(\"key,ref,slot,slot-scope,is\");function h(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():\"\"})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\\B([A-Z])/g,C=g(function(e){return e.replace(w,\"-$1\").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n<e.length;n++)e[n]&&A(t,e[n]);return t}function S(e,t,n){}var T=function(e,t,n){return!1},E=function(e){return e};function N(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every(function(e,n){return N(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every(function(n){return N(e[n],t[n])})}catch(e){return!1}}function j(e,t){for(var n=0;n<e.length;n++)if(N(e[n],t))return n;return-1}function D(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var L=\"data-server-rendered\",M=[\"component\",\"directive\",\"filter\"],I=[\"beforeCreate\",\"created\",\"beforeMount\",\"mounted\",\"beforeUpdate\",\"updated\",\"beforeDestroy\",\"destroyed\",\"activated\",\"deactivated\",\"errorCaptured\",\"serverPrefetch\"],F={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:S,parsePlatformTagName:E,mustUseProp:T,async:!0,_lifecycleHooks:I},P=/a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;function R(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H=new RegExp(\"[^\"+P.source+\".$_\\\\d]\");var B,U=\"__proto__\"in{},z=\"undefined\"!=typeof window,V=\"undefined\"!=typeof WXEnvironment&&!!WXEnvironment.platform,K=V&&WXEnvironment.platform.toLowerCase(),J=z&&window.navigator.userAgent.toLowerCase(),q=J&&/msie|trident/.test(J),W=J&&J.indexOf(\"msie 9.0\")>0,Z=J&&J.indexOf(\"edge/\")>0,G=(J&&J.indexOf(\"android\"),J&&/iphone|ipad|ipod|ios/.test(J)||\"ios\"===K),X=(J&&/chrome\\/\\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\\/(\\d+)/)),Y={}.watch,Q=!1;if(z)try{var ee={};Object.defineProperty(ee,\"passive\",{get:function(){Q=!0}}),window.addEventListener(\"test-passive\",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!z&&!V&&\"undefined\"!=typeof global&&(global.process&&\"server\"===global.process.env.VUE_ENV)),B},ne=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return\"function\"==typeof e&&/native code/.test(e.toString())}var ie,oe=\"undefined\"!=typeof Symbol&&re(Symbol)&&\"undefined\"!=typeof Reflect&&re(Reflect.ownKeys);ie=\"undefined\"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},ce.target=null;var ue=[];function le(e){ue.push(e),ce.target=e}function fe(){ue.pop(),ce.target=ue[ue.length-1]}var pe=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},de={child:{configurable:!0}};de.child.get=function(){return this.componentInstance},Object.defineProperties(pe.prototype,de);var ve=function(e){void 0===e&&(e=\"\");var t=new pe;return t.text=e,t.isComment=!0,t};function he(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){var t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ye=Array.prototype,ge=Object.create(ye);[\"push\",\"pop\",\"shift\",\"unshift\",\"splice\",\"sort\",\"reverse\"].forEach(function(e){var t=ye[e];R(ge,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case\"push\":case\"unshift\":i=n;break;case\"splice\":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var _e=Object.getOwnPropertyNames(ge),be=!0;function $e(e){be=e}var we=function(e){var t;this.value=e,this.dep=new ce,this.vmCount=0,R(e,\"__ob__\",this),Array.isArray(e)?(U?(t=ge,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];R(e,o,t[o])}}(e,ge,_e),this.observeArray(e)):this.walk(e)};function Ce(e,t){var n;if(o(e)&&!(e instanceof pe))return y(e,\"__ob__\")&&e.__ob__ instanceof we?n=e.__ob__:be&&!te()&&(Array.isArray(e)||s(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new we(e)),t&&n&&n.vmCount++,n}function xe(e,t,n,r,i){var o=new ce,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Ce(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return ce.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Ce(t),o.notify())}})}}function ke(e,t,n){if(Array.isArray(e)&&c(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(xe(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Ae(e,t){if(Array.isArray(e)&&c(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||y(e,t)&&(delete e[t],n&&n.dep.notify())}}we.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)xe(e,t[n])},we.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ce(e[t])};var Oe=F.optionMergeStrategies;function Se(e,t){if(!t)return e;for(var n,r,i,o=oe?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)\"__ob__\"!==(n=o[a])&&(r=e[n],i=t[n],y(e,n)?r!==i&&s(r)&&s(i)&&Se(r,i):ke(e,n,i));return e}function Te(e,t,n){return n?function(){var r=\"function\"==typeof t?t.call(n,n):t,i=\"function\"==typeof e?e.call(n,n):e;return r?Se(r,i):i}:t?e?function(){return Se(\"function\"==typeof t?t.call(this,this):t,\"function\"==typeof e?e.call(this,this):e)}:t:e}function Ee(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ne(e,t,n,r){var i=Object.create(e||null);return t?A(i,t):i}Oe.data=function(e,t,n){return n?Te(e,t,n):t&&\"function\"!=typeof t?e:Te(e,t)},I.forEach(function(e){Oe[e]=Ee}),M.forEach(function(e){Oe[e+\"s\"]=Ne}),Oe.watch=function(e,t,n,r){if(e===Y&&(e=void 0),t===Y&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in A(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Oe.props=Oe.methods=Oe.inject=Oe.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return A(i,e),t&&A(i,t),i},Oe.provide=Te;var je=function(e,t){return void 0===t?e:t};function De(e,t,n){if(\"function\"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)\"string\"==typeof(i=n[r])&&(o[b(i)]={type:null});else if(s(n))for(var a in n)i=n[a],o[b(a)]=s(i)?i:{type:i};e.props=o}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(s(n))for(var o in n){var a=n[o];r[o]=s(a)?A({from:o},a):{from:a}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];\"function\"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=De(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=De(e,t.mixins[r],n);var o,a={};for(o in e)c(o);for(o in t)y(e,o)||c(o);function c(r){var i=Oe[r]||je;a[r]=i(e[r],t[r],n,r)}return a}function Le(e,t,n,r){if(\"string\"==typeof n){var i=e[t];if(y(i,n))return i[n];var o=b(n);if(y(i,o))return i[o];var a=$(o);return y(i,a)?i[a]:i[n]||i[o]||i[a]}}function Me(e,t,n,r){var i=t[e],o=!y(n,e),a=n[e],s=Pe(Boolean,i.type);if(s>-1)if(o&&!y(i,\"default\"))a=!1;else if(\"\"===a||a===C(e)){var c=Pe(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(!y(t,\"default\"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return\"function\"==typeof r&&\"Function\"!==Ie(t.type)?r.call(e):r}(r,i,e);var u=be;$e(!0),Ce(a),$e(u)}return a}function Ie(e){var t=e&&e.toString().match(/^\\s*function (\\w+)/);return t?t[1]:\"\"}function Fe(e,t){return Ie(e)===Ie(t)}function Pe(e,t){if(!Array.isArray(t))return Fe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Fe(t[n],e))return n;return-1}function Re(e,t,n){le();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){Be(e,r,\"errorCaptured hook\")}}Be(e,t,n)}finally{fe()}}function He(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&u(o)&&!o._handled&&(o.catch(function(e){return Re(e,r,i+\" (Promise/async)\")}),o._handled=!0)}catch(e){Re(e,r,i)}return o}function Be(e,t,n){if(F.errorHandler)try{return F.errorHandler.call(null,e,t,n)}catch(t){t!==e&&Ue(t,null,\"config.errorHandler\")}Ue(e,t,n)}function Ue(e,t,n){if(!z&&!V||\"undefined\"==typeof console)throw e;console.error(e)}var ze,Ve=!1,Ke=[],Je=!1;function qe(){Je=!1;var e=Ke.slice(0);Ke.length=0;for(var t=0;t<e.length;t++)e[t]()}if(\"undefined\"!=typeof Promise&&re(Promise)){var We=Promise.resolve();ze=function(){We.then(qe),G&&setTimeout(S)},Ve=!0}else if(q||\"undefined\"==typeof MutationObserver||!re(MutationObserver)&&\"[object MutationObserverConstructor]\"!==MutationObserver.toString())ze=\"undefined\"!=typeof setImmediate&&re(setImmediate)?function(){setImmediate(qe)}:function(){setTimeout(qe,0)};else{var Ze=1,Ge=new MutationObserver(qe),Xe=document.createTextNode(String(Ze));Ge.observe(Xe,{characterData:!0}),ze=function(){Ze=(Ze+1)%2,Xe.data=String(Ze)},Ve=!0}function Ye(e,t){var n;if(Ke.push(function(){if(e)try{e.call(t)}catch(e){Re(e,t,\"nextTick\")}else n&&n(t)}),Je||(Je=!0,ze()),!e&&\"undefined\"!=typeof Promise)return new Promise(function(e){n=e})}var Qe=new ie;function et(e){!function e(t,n){var r,i;var a=Array.isArray(t);if(!a&&!o(t)||Object.isFrozen(t)||t instanceof pe)return;if(t.__ob__){var s=t.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(a)for(r=t.length;r--;)e(t[r],n);else for(i=Object.keys(t),r=i.length;r--;)e(t[i[r]],n)}(e,Qe),Qe.clear()}var tt=g(function(e){var t=\"&\"===e.charAt(0),n=\"~\"===(e=t?e.slice(1):e).charAt(0),r=\"!\"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function nt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return He(r,null,arguments,t,\"v-on handler\");for(var i=r.slice(),o=0;o<i.length;o++)He(i[o],null,e,t,\"v-on handler\")}return n.fns=e,n}function rt(e,n,i,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=n[c],f=tt(c),t(u)||(t(l)?(t(u.fns)&&(u=e[c]=nt(u,s)),r(f.once)&&(u=e[c]=a(f.name,u,f.capture)),i(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in n)t(e[c])&&o((f=tt(c)).name,n[c],f.capture)}function it(e,i,o){var a;e instanceof pe&&(e=e.data.hook||(e.data.hook={}));var s=e[i];function c(){o.apply(this,arguments),h(a.fns,c)}t(s)?a=nt([c]):n(s.fns)&&r(s.merged)?(a=s).fns.push(c):a=nt([s,c]),a.merged=!0,e[i]=a}function ot(e,t,r,i,o){if(n(t)){if(y(t,r))return e[r]=t[r],o||delete t[r],!0;if(y(t,i))return e[r]=t[i],o||delete t[i],!0}return!1}function at(e){return i(e)?[he(e)]:Array.isArray(e)?function e(o,a){var s=[];var c,u,l,f;for(c=0;c<o.length;c++)t(u=o[c])||\"boolean\"==typeof u||(l=s.length-1,f=s[l],Array.isArray(u)?u.length>0&&(st((u=e(u,(a||\"\")+\"_\"+c))[0])&&st(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?st(f)?s[l]=he(f.text+u):\"\"!==u&&s.push(he(u)):st(u)&&st(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key=\"__vlist\"+a+\"_\"+c+\"__\"),s.push(u)));return s}(e):void 0}function st(e){return n(e)&&n(e.text)&&!1===e.isComment}function ct(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if(\"__ob__\"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&y(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&\"default\"in e[o]){var c=e[o].default;n[o]=\"function\"==typeof c?c.call(t):c}}}return n}}function ut(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);\"template\"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(lt)&&delete n[u];return n}function lt(e){return e.isComment&&!e.asyncFactory||\" \"===e.text}function ft(t,n,r){var i,o=Object.keys(n).length>0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&\"$\"!==c[0]&&(i[c]=pt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=dt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,\"$stable\",a),R(i,\"$key\",s),R(i,\"$hasNormal\",o),i}function pt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&\"object\"==typeof e&&!Array.isArray(e)?[e]:at(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function dt(e,t){return function(){return e[t]}}function vt(e,t){var r,i,a,s,c;if(Array.isArray(e)||\"string\"==typeof e)for(r=new Array(e.length),i=0,a=e.length;i<a;i++)r[i]=t(e[i],i);else if(\"number\"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=t(i+1,i);else if(o(e))if(oe&&e[Symbol.iterator]){r=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)r.push(t(l.value,r.length)),l=u.next()}else for(s=Object.keys(e),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=t(e[c],c,i);return n(r)||(r=[]),r._isVList=!0,r}function ht(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=A(A({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement(\"template\",{slot:a},i):i}function mt(e){return Le(this.$options,\"filters\",e)||E}function yt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function gt(e,t,n,r,i){var o=F.keyCodes[t]||n;return i&&r&&!F.keyCodes[t]?yt(i,r):o?yt(o,e):r?C(r)!==t:void 0}function _t(e,t,n,r,i){if(n)if(o(n)){var a;Array.isArray(n)&&(n=O(n));var s=function(o){if(\"class\"===o||\"style\"===o||v(o))a=e;else{var s=e.attrs&&e.attrs.type;a=r||F.mustUseProp(t,s,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=b(o),u=C(o);c in a||u in a||(a[o]=n[o],i&&((e.on||(e.on={}))[\"update:\"+o]=function(e){n[o]=e}))};for(var c in n)s(c)}else;return e}function bt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(wt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),\"__static__\"+e,!1),r)}function $t(e,t,n){return wt(e,\"__once__\"+t+(n?\"_\"+n:\"\"),!0),e}function wt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&\"string\"!=typeof e[r]&&Ct(e[r],t+\"_\"+r,n);else Ct(e,t,n)}function Ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function xt(e,t){if(t)if(s(t)){var n=e.on=e.on?A({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function kt(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?kt(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function At(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];\"string\"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Ot(e,t){return\"string\"==typeof e?t+e:e}function St(e){e._o=$t,e._n=f,e._s=l,e._l=vt,e._t=ht,e._q=N,e._i=j,e._m=bt,e._f=mt,e._k=gt,e._b=_t,e._v=he,e._e=ve,e._u=kt,e._g=xt,e._d=At,e._p=Ot}function Tt(t,n,i,o,a){var s,c=this,u=a.options;y(o,\"_uid\")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=r(u._compiled),f=!l;this.data=t,this.props=n,this.children=i,this.parent=o,this.listeners=t.on||e,this.injections=ct(u.inject,o),this.slots=function(){return c.$slots||ft(t.scopedSlots,c.$slots=ut(i,o)),c.$slots},Object.defineProperty(this,\"scopedSlots\",{enumerable:!0,get:function(){return ft(t.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=ft(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Pt(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Pt(s,e,t,n,r,f)}}function Et(e,t,n,r,i){var o=me(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Nt(e,t){for(var n in t)e[b(n)]=t[n]}St(Tt.prototype);var jt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;jt.prepatch(r,r)}else{(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;n(i)&&(r.render=i.render,r.staticRenderFns=i.staticRenderFns);return new e.componentOptions.Ctor(r)}(e,Wt)).$mount(t?e.elm:void 0,t)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,i,o){var a=i.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),u=!!(o||t.$options._renderChildren||c);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){$e(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=t.$options.props;l[d]=Me(d,v,n,t)}$e(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,qt(t,r,h),u&&(t.$slots=ut(o,i.context),t.$forceUpdate())}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Yt(r,\"mounted\")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,en.push(t)):Xt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(n&&(t._directInactive=!0,Gt(t)))return;if(!t._inactive){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);Yt(t,\"deactivated\")}}(t,!0):t.$destroy())}},Dt=Object.keys(jt);function Lt(i,a,s,c,l){if(!t(i)){var f=s.$options._base;if(o(i)&&(i=f.extend(i)),\"function\"==typeof i){var p;if(t(i.cid)&&void 0===(i=function(e,i){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var a=Ht;a&&n(e.owners)&&-1===e.owners.indexOf(a)&&e.owners.push(a);if(r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(a&&!n(e.owners)){var s=e.owners=[a],c=!0,l=null,f=null;a.$on(\"hook:destroyed\",function(){return h(s,a)});var p=function(e){for(var t=0,n=s.length;t<n;t++)s[t].$forceUpdate();e&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==f&&(clearTimeout(f),f=null))},d=D(function(t){e.resolved=Bt(t,i),c?s.length=0:p(!0)}),v=D(function(t){n(e.errorComp)&&(e.error=!0,p(!0))}),m=e(d,v);return o(m)&&(u(m)?t(e.resolved)&&m.then(d,v):u(m.component)&&(m.component.then(d,v),n(m.error)&&(e.errorComp=Bt(m.error,i)),n(m.loading)&&(e.loadingComp=Bt(m.loading,i),0===m.delay?e.loading=!0:l=setTimeout(function(){l=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,p(!1))},m.delay||200)),n(m.timeout)&&(f=setTimeout(function(){f=null,t(e.resolved)&&v(null)},m.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(p=i,f)))return function(e,t,n,r,i){var o=ve();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(p,a,s,c,l);a=a||{},$n(i),n(a.model)&&function(e,t){var r=e.model&&e.model.prop||\"value\",i=e.model&&e.model.event||\"input\";(t.attrs||(t.attrs={}))[r]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;n(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}(i.options,a);var d=function(e,r,i){var o=r.options.props;if(!t(o)){var a={},s=e.attrs,c=e.props;if(n(s)||n(c))for(var u in o){var l=C(u);ot(a,c,u,l,!0)||ot(a,s,u,l,!1)}return a}}(a,i);if(r(i.options.functional))return function(t,r,i,o,a){var s=t.options,c={},u=s.props;if(n(u))for(var l in u)c[l]=Me(l,u,r||e);else n(i.attrs)&&Nt(c,i.attrs),n(i.props)&&Nt(c,i.props);var f=new Tt(i,c,a,o,t),p=s.render.call(null,f._c,f);if(p instanceof pe)return Et(p,i,f.parent,s);if(Array.isArray(p)){for(var d=at(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Et(d[h],i,f.parent,s);return v}}(i,d,a,s,c);var v=a.on;if(a.on=a.nativeOn,r(i.options.abstract)){var m=a.slot;a={},m&&(a.slot=m)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Dt.length;n++){var r=Dt[n],i=t[r],o=jt[r];i===o||i&&i._merged||(t[r]=i?Mt(o,i):o)}}(a);var y=i.options.name||l;return new pe(\"vue-component-\"+i.cid+(y?\"-\"+y:\"\"),a,void 0,void 0,void 0,s,{Ctor:i,propsData:d,listeners:v,tag:l,children:c},p)}}}function Mt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}var It=1,Ft=2;function Pt(e,a,s,c,u,l){return(Array.isArray(s)||i(s))&&(u=c,c=s,s=void 0),r(l)&&(u=Ft),function(e,i,a,s,c){if(n(a)&&n(a.__ob__))return ve();n(a)&&n(a.is)&&(i=a.is);if(!i)return ve();Array.isArray(s)&&\"function\"==typeof s[0]&&((a=a||{}).scopedSlots={default:s[0]},s.length=0);c===Ft?s=at(s):c===It&&(s=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(s));var u,l;if(\"string\"==typeof i){var f;l=e.$vnode&&e.$vnode.ns||F.getTagNamespace(i),u=F.isReservedTag(i)?new pe(F.parsePlatformTagName(i),a,s,void 0,void 0,e):a&&a.pre||!n(f=Le(e.$options,\"components\",i))?new pe(i,a,s,void 0,void 0,e):Lt(f,a,e,s,i)}else u=Lt(i,a,e,s);return Array.isArray(u)?u:n(u)?(n(l)&&function e(i,o,a){i.ns=o;\"foreignObject\"===i.tag&&(o=void 0,a=!0);if(n(i.children))for(var s=0,c=i.children.length;s<c;s++){var u=i.children[s];n(u.tag)&&(t(u.ns)||r(a)&&\"svg\"!==u.tag)&&e(u,o,a)}}(u,l),n(a)&&function(e){o(e.style)&&et(e.style);o(e.class)&&et(e.class)}(a),u):ve()}(e,a,s,c,u)}var Rt,Ht=null;function Bt(e,t){return(e.__esModule||oe&&\"Module\"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function Ut(e){return e.isComment&&e.asyncFactory}function zt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||Ut(r)))return r}}function Vt(e,t){Rt.$on(e,t)}function Kt(e,t){Rt.$off(e,t)}function Jt(e,t){var n=Rt;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function qt(e,t,n){Rt=e,rt(t,n||{},Vt,Kt,Jt,e),Rt=void 0}var Wt=null;function Zt(e){var t=Wt;return Wt=e,function(){Wt=t}}function Gt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Xt(e,t){if(t){if(e._directInactive=!1,Gt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Xt(e.$children[n]);Yt(e,\"activated\")}}function Yt(e,t){le();var n=e.$options[t],r=t+\" hook\";if(n)for(var i=0,o=n.length;i<o;i++)He(n[i],e,null,e,r);e._hasHookEvent&&e.$emit(\"hook:\"+t),fe()}var Qt=[],en=[],tn={},nn=!1,rn=!1,on=0;var an=0,sn=Date.now;if(z&&!q){var cn=window.performance;cn&&\"function\"==typeof cn.now&&sn()>document.createEvent(\"Event\").timeStamp&&(sn=function(){return cn.now()})}function un(){var e,t;for(an=sn(),rn=!0,Qt.sort(function(e,t){return e.id-t.id}),on=0;on<Qt.length;on++)(e=Qt[on]).before&&e.before(),t=e.id,tn[t]=null,e.run();var n=en.slice(),r=Qt.slice();on=Qt.length=en.length=0,tn={},nn=rn=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Xt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Yt(r,\"updated\")}}(r),ne&&F.devtools&&ne.emit(\"flush\")}var ln=0,fn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ln,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ie,this.newDepIds=new ie,this.expression=\"\",\"function\"==typeof t?this.getter=t:(this.getter=function(e){if(!H.test(e)){var t=e.split(\".\");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=S)),this.value=this.lazy?void 0:this.get()};fn.prototype.get=function(){var e;le(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Re(e,t,'getter for watcher \"'+this.expression+'\"')}finally{this.deep&&et(e),fe(),this.cleanupDeps()}return e},fn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},fn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},fn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==tn[t]){if(tn[t]=!0,rn){for(var n=Qt.length-1;n>on&&Qt[n].id>e.id;)n--;Qt.splice(n+1,0,e)}else Qt.push(e);nn||(nn=!0,Ye(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher \"'+this.expression+'\"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:S,set:S};function dn(e,t,n){pn.get=function(){return this[t][n]},pn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,pn)}function vn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);xe(r,o,a),o in e||dn(e,\"_props\",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=\"function\"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data=\"function\"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return Re(e,t,\"data()\"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+\"\").charCodeAt(0))&&95!==a&&dn(e,\"_data\",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a=\"function\"==typeof o?o:o.get;r||(n[i]=new fn(e,a||S,S,hn)),i in e||mn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)_n(e,n,r[i]);else _n(e,n,r)}}(e,t.watch)}var hn={lazy:!0};function mn(e,t,n){var r=!te();\"function\"==typeof n?(pn.get=r?yn(t):gn(n),pn.set=S):(pn.get=n.get?r&&!1!==n.cache?yn(t):gn(n.get):S,pn.set=n.set||S),Object.defineProperty(e,t,pn)}function yn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ce.target&&t.depend(),t.value}}function gn(e){return function(){return e.call(this,this)}}function _n(e,t,n,r){return s(n)&&(r=n,n=n.handler),\"string\"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var bn=0;function $n(e){var t=e.options;if(e.super){var n=$n(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&A(e.extendOptions,r),(t=e.options=De(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function wn(e){this._init(e)}function Cn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=De(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)dn(e.prototype,\"_props\",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,M.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=A({},a.options),i[r]=a,a}}function xn(e){return e&&(e.Ctor.options.name||e.tag)}function kn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:\"string\"==typeof e?e.split(\",\").indexOf(t)>-1:(n=e,\"[object RegExp]\"===a.call(n)&&e.test(t));var n}function An(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=xn(a.componentOptions);s&&!t(s)&&On(n,o,r,i)}}}function On(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=bn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De($n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ut(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,\"$attrs\",o&&o.attrs||e,null,!0),xe(t,\"$listeners\",n._parentListeners||e,null,!0)}(n),Yt(n,\"beforeCreate\"),function(e){var t=ct(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),vn(n),function(e){var t=e.$options.provide;t&&(e._provided=\"function\"==typeof t?t.call(e):t)}(n),Yt(n,\"created\"),n.$options.el&&n.$mount(n.$options.el)}}(wn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,\"$data\",t),Object.defineProperty(e.prototype,\"$props\",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher \"'+r.expression+'\"')}return function(){r.teardown()}}}(wn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?k(t):t;for(var n=k(arguments,1),r='event handler for \"'+e+'\"',i=0,o=t.length;i<o;i++)He(t[i],this,n,this,r)}return this}}(wn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=Zt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Yt(e,\"beforeDestroy\"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||h(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Yt(e,\"destroyed\"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(wn),function(e){St(e.prototype),e.prototype.$nextTick=function(e){return Ye(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=ft(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Ht=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){Re(n,t,\"render\"),e=t._vnode}finally{Ht=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof pe||(e=ve()),e.parent=i,e}}(wn);var Sn=[String,RegExp,Array],Tn={KeepAlive:{name:\"keep-alive\",abstract:!0,props:{include:Sn,exclude:Sn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)On(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch(\"include\",function(t){An(e,function(e){return kn(t,e)})}),this.$watch(\"exclude\",function(t){An(e,function(e){return!kn(t,e)})})},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=xn(n),i=this.include,o=this.exclude;if(i&&(!r||!kn(i,r))||o&&r&&kn(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?\"::\"+n.tag:\"\"):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&On(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,\"config\",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Ye,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),M.forEach(function(t){e.options[t+\"s\"]=Object.create(null)}),e.options._base=e,A(e.options.components,Tn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),\"function\"==typeof e.install?e.install.apply(e,n):\"function\"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Cn(e),function(e){M.forEach(function(t){e[t]=function(e,n){return n?(\"component\"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),\"directive\"===t&&\"function\"==typeof n&&(n={bind:n,update:n}),this.options[t+\"s\"][e]=n,n):this.options[t+\"s\"][e]}})}(e)}(wn),Object.defineProperty(wn.prototype,\"$isServer\",{get:te}),Object.defineProperty(wn.prototype,\"$ssrContext\",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wn,\"FunctionalRenderContext\",{value:Tt}),wn.version=\"2.6.11\";var En=p(\"style,class\"),Nn=p(\"input,textarea,option,select,progress\"),jn=function(e,t,n){return\"value\"===n&&Nn(e)&&\"button\"!==t||\"selected\"===n&&\"option\"===e||\"checked\"===n&&\"input\"===e||\"muted\"===n&&\"video\"===e},Dn=p(\"contenteditable,draggable,spellcheck\"),Ln=p(\"events,caret,typing,plaintext-only\"),Mn=function(e,t){return Hn(t)||\"false\"===t?\"false\":\"contenteditable\"===e&&Ln(t)?t:\"true\"},In=p(\"allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible\"),Fn=\"http://www.w3.org/1999/xlink\",Pn=function(e){return\":\"===e.charAt(5)&&\"xlink\"===e.slice(0,5)},Rn=function(e){return Pn(e)?e.slice(6,e.length):\"\"},Hn=function(e){return null==e||!1===e};function Bn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Un(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Un(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Vn(t));return\"\"}(t.staticClass,t.class)}function Un(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+\" \"+t:e:t||\"\"}function Vn(e){return Array.isArray(e)?function(e){for(var t,r=\"\",i=0,o=e.length;i<o;i++)n(t=Vn(e[i]))&&\"\"!==t&&(r&&(r+=\" \"),r+=t);return r}(e):o(e)?function(e){var t=\"\";for(var n in e)e[n]&&(t&&(t+=\" \"),t+=n);return t}(e):\"string\"==typeof e?e:\"\"}var Kn={svg:\"http://www.w3.org/2000/svg\",math:\"http://www.w3.org/1998/Math/MathML\"},Jn=p(\"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot\"),qn=p(\"svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view\",!0),Wn=function(e){return Jn(e)||qn(e)};function Zn(e){return qn(e)?\"svg\":\"math\"===e?\"math\":void 0}var Gn=Object.create(null);var Xn=p(\"text,number,password,search,email,tel,url\");function Yn(e){if(\"string\"==typeof e){var t=document.querySelector(e);return t||document.createElement(\"div\")}return e}var Qn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return\"select\"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute(\"multiple\",\"multiple\"),n)},createElementNS:function(e,t){return document.createElementNS(Kn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,\"\")}}),er={create:function(e,t){tr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(tr(e,!0),tr(t))},destroy:function(e){tr(e,!0)}};function tr(e,t){var r=e.data.ref;if(n(r)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[r])?h(a[r],o):a[r]===o&&(a[r]=void 0):e.data.refInFor?Array.isArray(a[r])?a[r].indexOf(o)<0&&a[r].push(o):a[r]=[o]:a[r]=o}}var nr=new pe(\"\",{},[]),rr=[\"create\",\"activate\",\"update\",\"remove\",\"destroy\"];function ir(e,i){return e.key===i.key&&(e.tag===i.tag&&e.isComment===i.isComment&&n(e.data)===n(i.data)&&function(e,t){if(\"input\"!==e.tag)return!0;var r,i=n(r=e.data)&&n(r=r.attrs)&&r.type,o=n(r=t.data)&&n(r=r.attrs)&&r.type;return i===o||Xn(i)&&Xn(o)}(e,i)||r(e.isAsyncPlaceholder)&&e.asyncFactory===i.asyncFactory&&t(i.asyncFactory.error))}function or(e,t,r){var i,o,a={};for(i=t;i<=r;++i)n(o=e[i].key)&&(a[o]=i);return a}var ar={create:sr,update:sr,destroy:function(e){sr(e,nr)}};function sr(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===nr,a=t===nr,s=ur(e.data.directives,e.context),c=ur(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,fr(i,\"update\",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(fr(i,\"bind\",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)fr(u[n],\"inserted\",t,e)};o?it(t,\"insert\",f):f()}l.length&&it(t,\"postpatch\",function(){for(var n=0;n<l.length;n++)fr(l[n],\"componentUpdated\",t,e)});if(!o)for(n in s)c[n]||fr(s[n],\"unbind\",e,e,a)}(e,t)}var cr=Object.create(null);function ur(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=cr),i[lr(r)]=r,r.def=Le(t.$options,\"directives\",r.name);return i}function lr(e){return e.rawName||e.name+\".\"+Object.keys(e.modifiers||{}).join(\".\")}function fr(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){Re(r,n.context,\"directive \"+e.name+\" \"+t+\" hook\")}}var pr=[er,ar];function dr(e,r){var i=r.componentOptions;if(!(n(i)&&!1===i.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var o,a,s=r.elm,c=e.data.attrs||{},u=r.data.attrs||{};for(o in n(u.__ob__)&&(u=r.data.attrs=A({},u)),u)a=u[o],c[o]!==a&&vr(s,o,a);for(o in(q||Z)&&u.value!==c.value&&vr(s,\"value\",u.value),c)t(u[o])&&(Pn(o)?s.removeAttributeNS(Fn,Rn(o)):Dn(o)||s.removeAttribute(o))}}function vr(e,t,n){e.tagName.indexOf(\"-\")>-1?hr(e,t,n):In(t)?Hn(n)?e.removeAttribute(t):(n=\"allowfullscreen\"===t&&\"EMBED\"===e.tagName?\"true\":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Mn(t,n)):Pn(t)?Hn(n)?e.removeAttributeNS(Fn,Rn(t)):e.setAttributeNS(Fn,t,n):hr(e,t,n)}function hr(e,t,n){if(Hn(n))e.removeAttribute(t);else{if(q&&!W&&\"TEXTAREA\"===e.tagName&&\"placeholder\"===t&&\"\"!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener(\"input\",r)};e.addEventListener(\"input\",r),e.__ieph=!0}e.setAttribute(t,n)}}var mr={create:dr,update:dr};function yr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Bn(r),c=i._transitionClasses;n(c)&&(s=zn(s,Vn(c))),s!==i._prevClass&&(i.setAttribute(\"class\",s),i._prevClass=s)}}var gr,_r,br,$r,wr,Cr,xr={create:yr,update:yr},kr=/[\\w).+\\-_$\\]]/;function Ar(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&\" \"===(h=e.charAt(v));v--);h&&kr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Or(i,o[r]);return i}function Or(e,t){var n=t.indexOf(\"(\");if(n<0)return'_f(\"'+t+'\")('+e+\")\";var r=t.slice(0,n),i=t.slice(n+1);return'_f(\"'+r+'\")('+e+(\")\"!==i?\",\"+i:i)}function Sr(e,t){console.error(\"[Vue compiler]: \"+e)}function Tr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Er(e,t,n,r,i){(e.props||(e.props=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Nr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function jr(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Rr({name:t,value:n},r))}function Dr(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Rr({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Lr(e,t,n){return n?\"_p(\"+t+',\"'+e+'\")':e+t}function Mr(t,n,r,i,o,a,s,c){var u;(i=i||e).right?c?n=\"(\"+n+\")==='click'?'contextmenu':(\"+n+\")\":\"click\"===n&&(n=\"contextmenu\",delete i.right):i.middle&&(c?n=\"(\"+n+\")==='click'?'mouseup':(\"+n+\")\":\"click\"===n&&(n=\"mouseup\")),i.capture&&(delete i.capture,n=Lr(\"!\",n,c)),i.once&&(delete i.once,n=Lr(\"~\",n,c)),i.passive&&(delete i.passive,n=Lr(\"&\",n,c)),i.native?(delete i.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var l=Rr({value:r.trim(),dynamic:c},s);i!==e&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,t.plain=!1}function Ir(e,t,n){var r=Fr(e,\":\"+t)||Fr(e,\"v-bind:\"+t);if(null!=r)return Ar(r);if(!1!==n){var i=Fr(e,t);if(null!=i)return JSON.stringify(i)}}function Fr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Pr(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Rr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Hr(e,t,n){var r=n||{},i=r.number,o=\"$$v\";r.trim&&(o=\"(typeof $$v === 'string'? $$v.trim(): $$v)\"),i&&(o=\"_n(\"+o+\")\");var a=Br(t,o);e.model={value:\"(\"+t+\")\",expression:JSON.stringify(t),callback:\"function ($$v) {\"+a+\"}\"}}function Br(e,t){var n=function(e){if(e=e.trim(),gr=e.length,e.indexOf(\"[\")<0||e.lastIndexOf(\"]\")<gr-1)return($r=e.lastIndexOf(\".\"))>-1?{exp:e.slice(0,$r),key:'\"'+e.slice($r+1)+'\"'}:{exp:e,key:null};_r=e,$r=wr=Cr=0;for(;!zr();)Vr(br=Ur())?Jr(br):91===br&&Kr(br);return{exp:e.slice(0,wr),key:e.slice(wr+1,Cr)}}(e);return null===n.key?e+\"=\"+t:\"$set(\"+n.exp+\", \"+n.key+\", \"+t+\")\"}function Ur(){return _r.charCodeAt(++$r)}function zr(){return $r>=gr}function Vr(e){return 34===e||39===e}function Kr(e){var t=1;for(wr=$r;!zr();)if(Vr(e=Ur()))Jr(e);else if(91===e&&t++,93===e&&t--,0===t){Cr=$r;break}}function Jr(e){for(var t=e;!zr()&&(e=Ur())!==t;);}var qr,Wr=\"__r\",Zr=\"__c\";function Gr(e,t,n){var r=qr;return function i(){null!==t.apply(null,arguments)&&Qr(e,i,n,r)}}var Xr=Ve&&!(X&&Number(X[1])<=53);function Yr(e,t,n,r){if(Xr){var i=an,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}qr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function Qr(e,t,n,r){(r||qr).removeEventListener(e,t._wrapper||t,n)}function ei(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};qr=r.elm,function(e){if(n(e[Wr])){var t=q?\"change\":\"input\";e[t]=[].concat(e[Wr],e[t]||[]),delete e[Wr]}n(e[Zr])&&(e.change=[].concat(e[Zr],e.change||[]),delete e[Zr])}(i),rt(i,o,Yr,Qr,Gr,r.context),qr=void 0}}var ti,ni={create:ei,update:ei};function ri(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]=\"\");for(i in c){if(o=c[i],\"textContent\"===i||\"innerHTML\"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if(\"value\"===i&&\"PROGRESS\"!==a.tagName){a._value=o;var u=t(o)?\"\":String(o);ii(a,u)&&(a.value=u)}else if(\"innerHTML\"===i&&qn(a.tagName)&&t(a.innerHTML)){(ti=ti||document.createElement(\"div\")).innerHTML=\"<svg>\"+o+\"</svg>\";for(var l=ti.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function ii(e,t){return!e.composing&&(\"OPTION\"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var oi={create:ri,update:ri},ai=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function si(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?O(e):\"string\"==typeof e?ai(e):e}var ui,li=/^--/,fi=/\\s*!important$/,pi=function(e,t,n){if(li.test(t))e.style.setProperty(t,n);else if(fi.test(n))e.style.setProperty(C(t),n.replace(fi,\"\"),\"important\");else{var r=vi(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},di=[\"Webkit\",\"Moz\",\"ms\"],vi=g(function(e){if(ui=ui||document.createElement(\"div\").style,\"filter\"!==(e=b(e))&&e in ui)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<di.length;n++){var r=di[n]+t;if(r in ui)return r}});function hi(e,r){var i=r.data,o=e.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=ci(r.data.style)||{};r.data.normalizedStyle=n(p.__ob__)?A({},p):p;var d=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=si(i.data))&&A(r,n);(n=si(e.data))&&A(r,n);for(var o=e;o=o.parent;)o.data&&(n=si(o.data))&&A(r,n);return r}(r,!0);for(s in f)t(d[s])&&pi(c,s,\"\");for(s in d)(a=d[s])!==f[s]&&pi(c,s,null==a?\"\":a)}}var mi={create:hi,update:hi},yi=/\\s+/;function gi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(yi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \";n.indexOf(\" \"+t+\" \")<0&&e.setAttribute(\"class\",(n+t).trim())}}function _i(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(yi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute(\"class\");else{for(var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \",r=\" \"+t+\" \";n.indexOf(r)>=0;)n=n.replace(r,\" \");(n=n.trim())?e.setAttribute(\"class\",n):e.removeAttribute(\"class\")}}function bi(e){if(e){if(\"object\"==typeof e){var t={};return!1!==e.css&&A(t,$i(e.name||\"v\")),A(t,e),t}return\"string\"==typeof e?$i(e):void 0}}var $i=g(function(e){return{enterClass:e+\"-enter\",enterToClass:e+\"-enter-to\",enterActiveClass:e+\"-enter-active\",leaveClass:e+\"-leave\",leaveToClass:e+\"-leave-to\",leaveActiveClass:e+\"-leave-active\"}}),wi=z&&!W,Ci=\"transition\",xi=\"animation\",ki=\"transition\",Ai=\"transitionend\",Oi=\"animation\",Si=\"animationend\";wi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ki=\"WebkitTransition\",Ai=\"webkitTransitionEnd\"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi=\"WebkitAnimation\",Si=\"webkitAnimationEnd\"));var Ti=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ti(function(){Ti(e)})}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gi(e,t))}function ji(e,t){e._transitionClasses&&h(e._transitionClasses,t),_i(e,t)}function Di(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ci?Ai:Si,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var Li=/\\b(transform|all)(,|$)/;function Mi(e,t){var n,r=window.getComputedStyle(e),i=(r[ki+\"Delay\"]||\"\").split(\", \"),o=(r[ki+\"Duration\"]||\"\").split(\", \"),a=Ii(i,o),s=(r[Oi+\"Delay\"]||\"\").split(\", \"),c=(r[Oi+\"Duration\"]||\"\").split(\", \"),u=Ii(s,c),l=0,f=0;return t===Ci?a>0&&(n=Ci,l=a,f=o.length):t===xi?u>0&&(n=xi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ci:xi:null)?n===Ci?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ci&&Li.test(r[ki+\"Property\"])}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Fi(t)+Fi(e[n])}))}function Fi(e){return 1e3*Number(e.slice(0,-1).replace(\",\",\".\"))}function Pi(e,r){var i=e.elm;n(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=bi(e.data.transition);if(!t(a)&&!n(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,l=a.enterToClass,p=a.enterActiveClass,d=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,$=a.appear,w=a.afterAppear,C=a.appearCancelled,x=a.duration,k=Wt,A=Wt.$vnode;A&&A.parent;)k=A.context,A=A.parent;var O=!k._isMounted||!e.isRootInsert;if(!O||$||\"\"===$){var S=O&&d?d:u,T=O&&h?h:p,E=O&&v?v:l,N=O&&b||m,j=O&&\"function\"==typeof $?$:y,L=O&&w||g,M=O&&C||_,I=f(o(x)?x.enter:x),F=!1!==s&&!W,P=Bi(j),R=i._enterCb=D(function(){F&&(ji(i,E),ji(i,T)),R.cancelled?(F&&ji(i,S),M&&M(i)):L&&L(i),i._enterCb=null});e.data.show||it(e,\"insert\",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),j&&j(i,R)}),N&&N(i),F&&(Ni(i,S),Ni(i,T),Ei(function(){ji(i,S),R.cancelled||(Ni(i,E),P||(Hi(I)?setTimeout(R,I):Di(i,c,R)))})),e.data.show&&(r&&r(),j&&j(i,R)),F||P||R()}}}function Ri(e,r){var i=e.elm;n(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var a=bi(e.data.transition);if(t(a)||1!==i.nodeType)return r();if(!n(i._leaveCb)){var s=a.css,c=a.type,u=a.leaveClass,l=a.leaveToClass,p=a.leaveActiveClass,d=a.beforeLeave,v=a.leave,h=a.afterLeave,m=a.leaveCancelled,y=a.delayLeave,g=a.duration,_=!1!==s&&!W,b=Bi(v),$=f(o(g)?g.leave:g),w=i._leaveCb=D(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ji(i,l),ji(i,p)),w.cancelled?(_&&ji(i,u),m&&m(i)):(r(),h&&h(i)),i._leaveCb=null});y?y(C):C()}function C(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),d&&d(i),_&&(Ni(i,u),Ni(i,p),Ei(function(){ji(i,u),w.cancelled||(Ni(i,l),b||(Hi($)?setTimeout(w,$):Di(i,c,w)))})),v&&v(i,w),_||b||w())}}function Hi(e){return\"number\"==typeof e&&!isNaN(e)}function Bi(e){if(t(e))return!1;var r=e.fns;return n(r)?Bi(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function Ui(e,t){!0!==t.data.show&&Pi(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;o<rr.length;++o)for(s[rr[o]]=[],a=0;a<c.length;++a)n(c[a][rr[o]])&&s[rr[o]].push(c[a][rr[o]]);function l(e){var t=u.parentNode(e);n(t)&&u.removeChild(t,e)}function f(e,t,i,o,a,c,l){if(n(e.elm)&&n(c)&&(e=c[l]=me(e)),e.isRootInsert=!a,!function(e,t,i,o){var a=e.data;if(n(a)){var c=n(e.componentInstance)&&a.keepAlive;if(n(a=a.hook)&&n(a=a.init)&&a(e,!1),n(e.componentInstance))return d(e,t),v(i,e.elm,o),r(c)&&function(e,t,r,i){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,n(o=a.data)&&n(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](nr,a);t.push(a);break}v(r,e.elm,i)}(e,t,i,o),!0}}(e,t,i,o)){var f=e.data,p=e.children,m=e.tag;n(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),h(e,p,t),n(f)&&y(e,t),v(i,e.elm,o)):r(e.isComment)?(e.elm=u.createComment(e.text),v(i,e.elm,o)):(e.elm=u.createTextNode(e.text),v(i,e.elm,o))}}function d(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,m(e)?(y(e,t),g(e)):(tr(e),t.push(e))}function v(e,t,r){n(e)&&(n(r)?u.parentNode(r)===e&&u.insertBefore(e,t,r):u.appendChild(e,t))}function h(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r);else i(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function m(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function y(e,t){for(var r=0;r<s.create.length;++r)s.create[r](nr,e);n(o=e.data.hook)&&(n(o.create)&&o.create(nr,e),n(o.insert)&&t.push(e))}function g(e){var t;if(n(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),r=r.parent;n(t=Wt)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,r,i=e.data;if(n(i))for(n(t=i.hook)&&n(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)b(e.children[r])}function $(e,t,r){for(;t<=r;++t){var i=e[t];n(i)&&(n(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(n(t)||n(e.data)){var r,i=s.remove.length+1;for(n(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&w(r,t),r=0;r<s.remove.length;++r)s.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else l(e.elm)}function C(e,t,r,i){for(var o=r;o<i;o++){var a=t[o];if(n(a)&&ir(e,a))return o}}function x(e,i,o,a,c,l){if(e!==i){n(i.elm)&&n(a)&&(i=a[c]=me(i));var p=i.elm=e.elm;if(r(e.isAsyncPlaceholder))n(i.asyncFactory.resolved)?O(e.elm,i,o):i.isAsyncPlaceholder=!0;else if(r(i.isStatic)&&r(e.isStatic)&&i.key===e.key&&(r(i.isCloned)||r(i.isOnce)))i.componentInstance=e.componentInstance;else{var d,v=i.data;n(v)&&n(d=v.hook)&&n(d=d.prepatch)&&d(e,i);var h=e.children,y=i.children;if(n(v)&&m(i)){for(d=0;d<s.update.length;++d)s.update[d](e,i);n(d=v.hook)&&n(d=d.update)&&d(e,i)}t(i.text)?n(h)&&n(y)?h!==y&&function(e,r,i,o,a){for(var s,c,l,p=0,d=0,v=r.length-1,h=r[0],m=r[v],y=i.length-1,g=i[0],b=i[y],w=!a;p<=v&&d<=y;)t(h)?h=r[++p]:t(m)?m=r[--v]:ir(h,g)?(x(h,g,o,i,d),h=r[++p],g=i[++d]):ir(m,b)?(x(m,b,o,i,y),m=r[--v],b=i[--y]):ir(h,b)?(x(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=r[++p],b=i[--y]):ir(m,g)?(x(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=r[--v],g=i[++d]):(t(s)&&(s=or(r,p,v)),t(c=n(g.key)?s[g.key]:C(g,r,p,v))?f(g,o,e,h.elm,!1,i,d):ir(l=r[c],g)?(x(l,g,o,i,d),r[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,\"\"),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,\"\"):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var A=p(\"attrs,class,staticClass,staticStyle,key\");function O(e,t,i,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(n(c)&&(n(a=c.hook)&&n(a=a.init)&&a(t,!0),n(a=t.componentInstance)))return d(t,i),!0;if(n(s)){if(n(u))if(e.hasChildNodes())if(n(a=c)&&n(a=a.domProps)&&n(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,p=0;p<u.length;p++){if(!f||!O(f,u[p],i,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else h(t,u,i);if(n(c)){var v=!1;for(var m in c)if(!A(m)){v=!0,y(t,i);break}!v&&c.class&&et(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,i,o,a){if(!t(i)){var c,l=!1,p=[];if(t(e))l=!0,f(i,p);else{var d=n(e.nodeType);if(!d&&ir(e,i))x(e,i,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(L)&&(e.removeAttribute(L),o=!0),r(o)&&O(e,i,p))return k(i,p,!0),e;c=e,e=new pe(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,h=u.parentNode(v);if(f(i,p,v._leaveCb?null:h,u.nextSibling(v)),n(i.parent))for(var y=i.parent,g=m(i);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=i.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](nr,y);var C=y.data.hook.insert;if(C.merged)for(var A=1;A<C.fns.length;A++)C.fns[A]()}else tr(y);y=y.parent}n(h)?$([e],0,0):n(e.tag)&&b(e)}}return k(i,p,l),i.elm}n(e)&&b(e)}}({nodeOps:Qn,modules:[mr,xr,ni,oi,mi,z?{create:Ui,activate:Ui,remove:function(e,t){!0!==e.data.show?Ri(e,t):t()}}:{}].concat(pr)});W&&document.addEventListener(\"selectionchange\",function(){var e=document.activeElement;e&&e.vmodel&&Xi(e,\"input\")});var Vi={inserted:function(e,t,n,r){\"select\"===n.tag?(r.elm&&!r.elm._vOptions?it(n,\"postpatch\",function(){Vi.componentUpdated(e,t,n)}):Ki(e,t,n.context),e._vOptions=[].map.call(e.options,Wi)):(\"textarea\"===n.tag||Xn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener(\"compositionstart\",Zi),e.addEventListener(\"compositionend\",Gi),e.addEventListener(\"change\",Gi),W&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if(\"select\"===n.tag){Ki(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Wi);if(i.some(function(e,t){return!N(e,r[t])}))(e.multiple?t.value.some(function(e){return qi(e,i)}):t.value!==t.oldValue&&qi(t.value,i))&&Xi(e,\"change\")}}};function Ki(e,t,n){Ji(e,t,n),(q||Z)&&setTimeout(function(){Ji(e,t,n)},0)}function Ji(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=j(r,Wi(a))>-1,a.selected!==o&&(a.selected=o);else if(N(Wi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function qi(e,t){return t.every(function(t){return!N(t,e)})}function Wi(e){return\"_value\"in e?e._value:e.value}function Zi(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,\"input\"))}function Xi(e,t){var n=document.createEvent(\"HTMLEvents\");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Yi(e){return!e.componentInstance||e.data&&e.data.transition?e:Yi(e.componentInstance._vnode)}var Qi={model:Vi,show:{bind:function(e,t,n){var r=t.value,i=(n=Yi(n)).data&&n.data.transition,o=e.__vOriginalDisplay=\"none\"===e.style.display?\"\":e.style.display;r&&i?(n.data.show=!0,Pi(n,function(){e.style.display=o})):e.style.display=r?o:\"none\"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Yi(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,function(){e.style.display=e.__vOriginalDisplay}):Ri(n,function(){e.style.display=\"none\"})):e.style.display=r?e.__vOriginalDisplay:\"none\")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},eo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function to(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?to(zt(t.children)):e}function no(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function ro(e,t){if(/\\d-keep-alive$/.test(t.tag))return e(\"keep-alive\",{props:t.componentOptions.propsData})}var io=function(e){return e.tag||Ut(e)},oo=function(e){return\"show\"===e.name},ao={name:\"transition\",props:eo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(io)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=to(o);if(!a)return o;if(this._leaving)return ro(e,o);var s=\"__transition-\"+this._uid+\"-\";a.key=null==a.key?a.isComment?s+\"comment\":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=no(this),u=this._vnode,l=to(u);if(a.data.directives&&a.data.directives.some(oo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!Ut(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if(\"out-in\"===r)return this._leaving=!0,it(f,\"afterLeave\",function(){t._leaving=!1,t.$forceUpdate()}),ro(e,o);if(\"in-out\"===r){if(Ut(a))return u;var p,d=function(){p()};it(c,\"afterEnter\",d),it(c,\"enterCancelled\",d),it(f,\"delayLeave\",function(e){p=e})}}return o}}},so=A({tag:String,moveClass:String},eo);function co(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function uo(e){e.data.newPos=e.elm.getBoundingClientRect()}function lo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform=\"translate(\"+r+\"px,\"+i+\"px)\",o.transitionDuration=\"0s\"}}delete so.mode;var fo={Transition:ao,TransitionGroup:{props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||\"span\",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=no(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf(\"__vlist\")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||\"v\")+\"-move\";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(co),e.forEach(uo),e.forEach(lo),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Ni(n,t),r.transform=r.WebkitTransform=r.transitionDuration=\"\",n.addEventListener(Ai,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ai,e),n._moveCb=null,ji(n,t))})}}))},methods:{hasMove:function(e,t){if(!wi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){_i(n,e)}),gi(n,t),n.style.display=\"none\",this.$el.appendChild(n);var r=Mi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};wn.config.mustUseProp=jn,wn.config.isReservedTag=Wn,wn.config.isReservedAttr=En,wn.config.getTagNamespace=Zn,wn.config.isUnknownElement=function(e){if(!z)return!0;if(Wn(e))return!1;if(e=e.toLowerCase(),null!=Gn[e])return Gn[e];var t=document.createElement(e);return e.indexOf(\"-\")>-1?Gn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Gn[e]=/HTMLUnknownElement/.test(t.toString())},A(wn.options.directives,Qi),A(wn.options.components,fo),wn.prototype.__patch__=z?zi:S,wn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Yt(e,\"beforeMount\"),r=function(){e._update(e._render(),n)},new fn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Yt(e,\"beforeUpdate\")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Yt(e,\"mounted\")),e}(this,e=e&&z?Yn(e):void 0,t)},z&&setTimeout(function(){F.devtools&&ne&&ne.emit(\"init\",wn)},0);var po=/\\{\\{((?:.|\\r?\\n)+?)\\}\\}/g,vo=/[-.*+?^${}()|[\\]\\/\\\\]/g,ho=g(function(e){var t=e[0].replace(vo,\"\\\\$&\"),n=e[1].replace(vo,\"\\\\$&\");return new RegExp(t+\"((?:.|\\\\n)+?)\"+n,\"g\")});var mo={staticKeys:[\"staticClass\"],transformNode:function(e,t){t.warn;var n=Fr(e,\"class\");n&&(e.staticClass=JSON.stringify(n));var r=Ir(e,\"class\",!1);r&&(e.classBinding=r)},genData:function(e){var t=\"\";return e.staticClass&&(t+=\"staticClass:\"+e.staticClass+\",\"),e.classBinding&&(t+=\"class:\"+e.classBinding+\",\"),t}};var yo,go={staticKeys:[\"staticStyle\"],transformNode:function(e,t){t.warn;var n=Fr(e,\"style\");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Ir(e,\"style\",!1);r&&(e.styleBinding=r)},genData:function(e){var t=\"\";return e.staticStyle&&(t+=\"staticStyle:\"+e.staticStyle+\",\"),e.styleBinding&&(t+=\"style:(\"+e.styleBinding+\"),\"),t}},_o=function(e){return(yo=yo||document.createElement(\"div\")).innerHTML=e,yo.textContent},bo=p(\"area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr\"),$o=p(\"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source\"),wo=p(\"address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track\"),Co=/^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,xo=/^\\s*((?:v-[\\w-]+:|@|:|#)\\[[^=]+\\][^\\s\"'<>\\/=]*)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,ko=\"[a-zA-Z_][\\\\-\\\\.0-9_a-zA-Z\"+P.source+\"]*\",Ao=\"((?:\"+ko+\"\\\\:)?\"+ko+\")\",Oo=new RegExp(\"^<\"+Ao),So=/^\\s*(\\/?)>/,To=new RegExp(\"^<\\\\/\"+Ao+\"[^>]*>\"),Eo=/^<!DOCTYPE [^>]+>/i,No=/^<!\\--/,jo=/^<!\\[/,Do=p(\"script,style,textarea\",!0),Lo={},Mo={\"&lt;\":\"<\",\"&gt;\":\">\",\"&quot;\":'\"',\"&amp;\":\"&\",\"&#10;\":\"\\n\",\"&#9;\":\"\\t\",\"&#39;\":\"'\"},Io=/&(?:lt|gt|quot|amp|#39);/g,Fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Po=p(\"pre,textarea\",!0),Ro=function(e,t){return e&&Po(e)&&\"\\n\"===t[0]};function Ho(e,t){var n=t?Fo:Io;return e.replace(n,function(e){return Mo[e]})}var Bo,Uo,zo,Vo,Ko,Jo,qo,Wo,Zo=/^@|^v-on:/,Go=/^v-|^@|^:|^#/,Xo=/([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/,Yo=/,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/,Qo=/^\\(|\\)$/g,ea=/^\\[.*\\]$/,ta=/:(.*)$/,na=/^:|^\\.|^v-bind:/,ra=/\\.[^.\\]]+(?=[^\\]]*$)/g,ia=/^v-slot(:|$)|^#/,oa=/[\\r\\n]/,aa=/\\s+/g,sa=g(_o),ca=\"_empty_\";function ua(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ma(t),rawAttrsMap:{},parent:n,children:[]}}function la(e,t){Bo=t.warn||Sr,Jo=t.isPreTag||T,qo=t.mustUseProp||T,Wo=t.getTagNamespace||T;t.isReservedTag;zo=Tr(t.modules,\"transformNode\"),Vo=Tr(t.modules,\"preTransformNode\"),Ko=Tr(t.modules,\"postTransformNode\"),Uo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=fa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&da(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&da(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'\"default\"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Jo(e.tag)&&(c=!1);for(var f=0;f<Ko.length;f++)Ko[f](e,t)}function l(e){if(!c)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&\" \"===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||T,s=t.canBeLeftOpenTag||T,c=0;e;){if(n=e,r&&Do(r)){var u=0,l=r.toLowerCase(),f=Lo[l]||(Lo[l]=new RegExp(\"([\\\\s\\\\S]*?)(</\"+l+\"[^>]*>)\",\"i\")),p=e.replace(f,function(e,n,r){return u=r.length,Do(l)||\"noscript\"===l||(n=n.replace(/<!\\--([\\s\\S]*?)-->/g,\"$1\").replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g,\"$1\")),Ro(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),\"\"});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf(\"<\");if(0===d){if(No.test(e)){var v=e.indexOf(\"--\\x3e\");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(jo.test(e)){var h=e.indexOf(\"]>\");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(To);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ro(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(To.test($)||Oo.test($)||No.test($)||jo.test($)||(w=$.indexOf(\"<\",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(Oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(So))&&(r=e.match(xo)||e.match(Co));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&(\"p\"===r&&wo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||\"\",h=\"a\"===n&&\"href\"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:Ho(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function A(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else\"br\"===s?t.start&&t.start(e,[],!0,n,o):\"p\"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Wo(e);q&&\"svg\"===p&&(o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];ya.test(r.name)||(r.name=r.name.replace(ga,\"\"),t.push(r))}return t}(o));var d,v=ua(e,o,r);p&&(v.ns=p),\"style\"!==(d=v).tag&&(\"script\"!==d.tag||d.attrsMap.type&&\"text/javascript\"!==d.attrsMap.type)||te()||(v.forbidden=!0);for(var h=0;h<Vo.length;h++)v=Vo[h](v,t)||v;s||(!function(e){null!=Fr(e,\"v-pre\")&&(e.pre=!0)}(v),v.pre&&(s=!0)),Jo(v.tag)&&(c=!0),s?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(v):v.processed||(pa(v),function(e){var t=Fr(e,\"v-if\");if(t)e.if=t,da(e,{exp:t,block:e});else{null!=Fr(e,\"v-else\")&&(e.else=!0);var n=Fr(e,\"v-else-if\");n&&(e.elseif=n)}}(v),function(e){null!=Fr(e,\"v-once\")&&(e.once=!0)}(v)),n||(n=v),a?u(v):(r=v,i.push(v))},end:function(e,t,n){var o=i[i.length-1];i.length-=1,r=i[i.length-1],u(o)},chars:function(e,t,n){if(r&&(!q||\"textarea\"!==r.tag||r.attrsMap.placeholder!==e)){var i,u,l,f=r.children;if(e=c||e.trim()?\"script\"===(i=r).tag||\"style\"===i.tag?e:sa(e):f.length?a?\"condense\"===a&&oa.test(e)?\"\":\" \":o?\" \":\"\":\"\")c||\"condense\"!==a||(e=e.replace(aa,\" \")),!s&&\" \"!==e&&(u=function(e,t){var n=t?ho(t):po;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Ar(r[1].trim());a.push(\"_s(\"+u+\")\"),s.push({\"@binding\":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join(\"+\"),tokens:s}}}(e,Uo))?l={type:2,expression:u.expression,tokens:u.tokens,text:e}:\" \"===e&&f.length&&\" \"===f[f.length-1].text||(l={type:3,text:e}),l&&f.push(l)}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}function fa(e,t){var n,r;(r=Ir(n=e,\"key\"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Ir(e,\"ref\");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;\"template\"===e.tag?(t=Fr(e,\"scope\"),e.slotScope=t||Fr(e,\"slot-scope\")):(t=Fr(e,\"slot-scope\"))&&(e.slotScope=t);var n=Ir(e,\"slot\");n&&(e.slotTarget='\"\"'===n?'\"default\"':n,e.slotTargetDynamic=!(!e.attrsMap[\":slot\"]&&!e.attrsMap[\"v-bind:slot\"]),\"template\"===e.tag||e.slotScope||Nr(e,\"slot\",n,function(e,t){return e.rawAttrsMap[\":\"+t]||e.rawAttrsMap[\"v-bind:\"+t]||e.rawAttrsMap[t]}(e,\"slot\")));if(\"template\"===e.tag){var r=Pr(e,ia);if(r){var i=va(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||ca}}else{var s=Pr(e,ia);if(s){var c=e.scopedSlots||(e.scopedSlots={}),u=va(s),l=u.name,f=u.dynamic,p=c[l]=ua(\"template\",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||ca,e.children=[],e.plain=!1}}}(e),function(e){\"slot\"===e.tag&&(e.slotName=Ir(e,\"name\"))}(e),function(e){var t;(t=Ir(e,\"is\"))&&(e.component=t);null!=Fr(e,\"inline-template\")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<zo.length;i++)e=zo[i](e,t)||e;return function(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=i=u[t].name,o=u[t].value,Go.test(r))if(e.hasBindings=!0,(a=ha(r.replace(Go,\"\")))&&(r=r.replace(ra,\"\")),na.test(r))r=r.replace(na,\"\"),o=Ar(o),(c=ea.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&\"innerHtml\"===(r=b(r))&&(r=\"innerHTML\"),a.camel&&!c&&(r=b(r)),a.sync&&(s=Br(o,\"$event\"),c?Mr(e,'\"update:\"+('+r+\")\",s,null,!1,0,u[t],!0):(Mr(e,\"update:\"+b(r),s,null,!1,0,u[t]),C(r)!==b(r)&&Mr(e,\"update:\"+C(r),s,null,!1,0,u[t])))),a&&a.prop||!e.component&&qo(e.tag,e.attrsMap.type,r)?Er(e,r,o,u[t],c):Nr(e,r,o,u[t],c);else if(Zo.test(r))r=r.replace(Zo,\"\"),(c=ea.test(r))&&(r=r.slice(1,-1)),Mr(e,r,o,a,!1,0,u[t],c);else{var l=(r=r.replace(Go,\"\")).match(ta),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),ea.test(f)&&(f=f.slice(1,-1),c=!0)),Dr(e,r,i,o,f,c,a,u[t])}else Nr(e,r,JSON.stringify(o),u[t]),!e.component&&\"muted\"===r&&qo(e.tag,e.attrsMap.type,r)&&Er(e,r,\"true\",u[t])}(e),e}function pa(e){var t;if(t=Fr(e,\"v-for\")){var n=function(e){var t=e.match(Xo);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Qo,\"\"),i=r.match(Yo);i?(n.alias=r.replace(Yo,\"\").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&A(e,n)}}function da(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function va(e){var t=e.name.replace(ia,\"\");return t||\"#\"!==e.name[0]&&(t=\"default\"),ea.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'\"'+t+'\"',dynamic:!1}}function ha(e){var t=e.match(ra);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function ma(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var ya=/^xmlns:NS\\d+/,ga=/^NS\\d+:/;function _a(e){return ua(e.tag,e.attrsList.slice(),e.parent)}var ba=[mo,go,{preTransformNode:function(e,t){if(\"input\"===e.tag){var n,r=e.attrsMap;if(!r[\"v-model\"])return;if((r[\":type\"]||r[\"v-bind:type\"])&&(n=Ir(e,\"type\")),r.type||n||!r[\"v-bind\"]||(n=\"(\"+r[\"v-bind\"]+\").type\"),n){var i=Fr(e,\"v-if\",!0),o=i?\"&&(\"+i+\")\":\"\",a=null!=Fr(e,\"v-else\",!0),s=Fr(e,\"v-else-if\",!0),c=_a(e);pa(c),jr(c,\"type\",\"checkbox\"),fa(c,t),c.processed=!0,c.if=\"(\"+n+\")==='checkbox'\"+o,da(c,{exp:c.if,block:c});var u=_a(e);Fr(u,\"v-for\",!0),jr(u,\"type\",\"radio\"),fa(u,t),da(c,{exp:\"(\"+n+\")==='radio'\"+o,block:u});var l=_a(e);return Fr(l,\"v-for\",!0),jr(l,\":type\",n),fa(l,t),da(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}];var $a,wa,Ca={expectHTML:!0,modules:ba,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Hr(e,r,i),!1;if(\"select\"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return '+(n&&n.number?\"_n(val)\":\"val\")+\"});\";r=r+\" \"+Br(t,\"$event.target.multiple ? $$selectedVal : $$selectedVal[0]\"),Mr(e,\"change\",r,null,!0)}(e,r,i);else if(\"input\"===o&&\"checkbox\"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,\"value\")||\"null\",o=Ir(e,\"true-value\")||\"true\",a=Ir(e,\"false-value\")||\"false\";Er(e,\"checked\",\"Array.isArray(\"+t+\")?_i(\"+t+\",\"+i+\")>-1\"+(\"true\"===o?\":(\"+t+\")\":\":_q(\"+t+\",\"+o+\")\")),Mr(e,\"change\",\"var $$a=\"+t+\",$$el=$event.target,$$c=$$el.checked?(\"+o+\"):(\"+a+\");if(Array.isArray($$a)){var $$v=\"+(r?\"_n(\"+i+\")\":i)+\",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&(\"+Br(t,\"$$a.concat([$$v])\")+\")}else{$$i>-1&&(\"+Br(t,\"$$a.slice(0,$$i).concat($$a.slice($$i+1))\")+\")}}else{\"+Br(t,\"$$c\")+\"}\",null,!0)}(e,r,i);else if(\"input\"===o&&\"radio\"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,\"value\")||\"null\";Er(e,\"checked\",\"_q(\"+t+\",\"+(i=r?\"_n(\"+i+\")\":i)+\")\"),Mr(e,\"change\",Br(t,i),null,!0)}(e,r,i);else if(\"input\"===o||\"textarea\"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&\"range\"!==r,u=o?\"change\":\"range\"===r?Wr:\"input\",l=\"$event.target.value\";s&&(l=\"$event.target.value.trim()\"),a&&(l=\"_n(\"+l+\")\");var f=Br(t,l);c&&(f=\"if($event.target.composing)return;\"+f),Er(e,\"value\",\"(\"+t+\")\"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,\"blur\",\"$forceUpdate()\")}(e,r,i);else if(!F.isReservedTag(o))return Hr(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,\"textContent\",\"_s(\"+t.value+\")\",t)},html:function(e,t){t.value&&Er(e,\"innerHTML\",\"_s(\"+t.value+\")\",t)}},isPreTag:function(e){return\"pre\"===e},isUnaryTag:bo,mustUseProp:jn,canBeLeftOpenTag:$o,isReservedTag:Wn,getTagNamespace:Zn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(\",\")}(ba)},xa=g(function(e){return p(\"type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap\"+(e?\",\"+e:\"\"))});function ka(e,t){e&&($a=xa(t.staticKeys||\"\"),wa=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!wa(e.tag)||function(e){for(;e.parent;){if(\"template\"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every($a)))}(t);if(1===t.type){if(!wa(t.tag)&&\"slot\"!==t.tag&&null==t.attrsMap[\"inline-template\"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++){var s=t.ifConditions[o].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++)e(t.ifConditions[o].block,n)}}(e,!1))}var Aa=/^([\\w$_]+|\\([^)]*?\\))\\s*=>|^function(?:\\s+[\\w$]+)?\\s*\\(/,Oa=/\\([^)]*?\\);*$/,Sa=/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?']|\\[\"[^\"]*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*$/,Ta={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:[\"Esc\",\"Escape\"],tab:\"Tab\",enter:\"Enter\",space:[\" \",\"Spacebar\"],up:[\"Up\",\"ArrowUp\"],left:[\"Left\",\"ArrowLeft\"],right:[\"Right\",\"ArrowRight\"],down:[\"Down\",\"ArrowDown\"],delete:[\"Backspace\",\"Delete\",\"Del\"]},Na=function(e){return\"if(\"+e+\")return null;\"},ja={stop:\"$event.stopPropagation();\",prevent:\"$event.preventDefault();\",self:Na(\"$event.target !== $event.currentTarget\"),ctrl:Na(\"!$event.ctrlKey\"),shift:Na(\"!$event.shiftKey\"),alt:Na(\"!$event.altKey\"),meta:Na(\"!$event.metaKey\"),left:Na(\"'button' in $event && $event.button !== 0\"),middle:Na(\"'button' in $event && $event.button !== 1\"),right:Na(\"'button' in $event && $event.button !== 2\")};function Da(e,t){var n=t?\"nativeOn:\":\"on:\",r=\"\",i=\"\";for(var o in e){var a=La(e[o]);e[o]&&e[o].dynamic?i+=o+\",\"+a+\",\":r+='\"'+o+'\":'+a+\",\"}return r=\"{\"+r.slice(0,-1)+\"}\",i?n+\"_d(\"+r+\",[\"+i.slice(0,-1)+\"])\":n+r}function La(e){if(!e)return\"function(){}\";if(Array.isArray(e))return\"[\"+e.map(function(e){return La(e)}).join(\",\")+\"]\";var t=Sa.test(e.value),n=Aa.test(e.value),r=Sa.test(e.value.replace(Oa,\"\"));if(e.modifiers){var i=\"\",o=\"\",a=[];for(var s in e.modifiers)if(ja[s])o+=ja[s],Ta[s]&&a.push(s);else if(\"exact\"===s){var c=e.modifiers;o+=Na([\"ctrl\",\"shift\",\"alt\",\"meta\"].filter(function(e){return!c[e]}).map(function(e){return\"$event.\"+e+\"Key\"}).join(\"||\"))}else a.push(s);return a.length&&(i+=function(e){return\"if(!$event.type.indexOf('key')&&\"+e.map(Ma).join(\"&&\")+\")return null;\"}(a)),o&&(i+=o),\"function($event){\"+i+(t?\"return \"+e.value+\"($event)\":n?\"return (\"+e.value+\")($event)\":r?\"return \"+e.value:e.value)+\"}\"}return t||n?e.value:\"function($event){\"+(r?\"return \"+e.value:e.value)+\"}\"}function Ma(e){var t=parseInt(e,10);if(t)return\"$event.keyCode!==\"+t;var n=Ta[e],r=Ea[e];return\"_k($event.keyCode,\"+JSON.stringify(e)+\",\"+JSON.stringify(n)+\",$event.key,\"+JSON.stringify(r)+\")\"}var Ia={on:function(e,t){e.wrapListeners=function(e){return\"_g(\"+e+\",\"+t.value+\")\"}},bind:function(e,t){e.wrapData=function(n){return\"_b(\"+n+\",'\"+e.tag+\"',\"+t.value+\",\"+(t.modifiers&&t.modifiers.prop?\"true\":\"false\")+(t.modifiers&&t.modifiers.sync?\",true\":\"\")+\")\"}},cloak:S},Fa=function(e){this.options=e,this.warn=e.warn||Sr,this.transforms=Tr(e.modules,\"transformCode\"),this.dataGenFns=Tr(e.modules,\"genData\"),this.directives=A(A({},Ia),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Pa(e,t){var n=new Fa(t);return{render:\"with(this){return \"+(e?Ra(e,n):'_c(\"div\")')+\"}\",staticRenderFns:n.staticRenderFns}}function Ra(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ha(e,t);if(e.once&&!e.onceProcessed)return Ba(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Ua(e,t);if(\"template\"!==e.tag||e.slotTarget||t.pre){if(\"slot\"===e.tag)return function(e,t){var n=e.slotName||'\"default\"',r=qa(e,t),i=\"_t(\"+n+(r?\",\"+r:\"\"),o=e.attrs||e.dynamicAttrs?Ga((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap[\"v-bind\"];!o&&!a||r||(i+=\",null\");o&&(i+=\",\"+o);a&&(i+=(o?\"\":\",null\")+\",\"+a);return i+\")\"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:qa(t,n,!0);return\"_c(\"+e+\",\"+Va(t,n)+(r?\",\"+r:\"\")+\")\"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Va(e,t));var i=e.inlineTemplate?null:qa(e,t,!0);n=\"_c('\"+e.tag+\"'\"+(r?\",\"+r:\"\")+(i?\",\"+i:\"\")+\")\"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return qa(e,t)||\"void 0\"}function Ha(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push(\"with(this){return \"+Ra(e,t)+\"}\"),t.pre=n,\"_m(\"+(t.staticRenderFns.length-1)+(e.staticInFor?\",true\":\"\")+\")\"}function Ba(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ua(e,t);if(e.staticInFor){for(var n=\"\",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?\"_o(\"+Ra(e,t)+\",\"+t.onceId+++\",\"+n+\")\":Ra(e,t)}return Ha(e,t)}function Ua(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||\"_e()\";var o=t.shift();return o.exp?\"(\"+o.exp+\")?\"+a(o.block)+\":\"+e(t,n,r,i):\"\"+a(o.block);function a(e){return r?r(e,n):e.once?Ba(e,n):Ra(e,n)}}(e.ifConditions.slice(),t,n,r)}function za(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?\",\"+e.iterator1:\"\",s=e.iterator2?\",\"+e.iterator2:\"\";return e.forProcessed=!0,(r||\"_l\")+\"((\"+i+\"),function(\"+o+a+s+\"){return \"+(n||Ra)(e,t)+\"})\"}function Va(e,t){var n=\"{\",r=function(e,t){var n=e.directives;if(!n)return;var r,i,o,a,s=\"directives:[\",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:\"'+o.name+'\",rawName:\"'+o.rawName+'\"'+(o.value?\",value:(\"+o.value+\"),expression:\"+JSON.stringify(o.value):\"\")+(o.arg?\",arg:\"+(o.isDynamicArg?o.arg:'\"'+o.arg+'\"'):\"\")+(o.modifiers?\",modifiers:\"+JSON.stringify(o.modifiers):\"\")+\"},\")}if(c)return s.slice(0,-1)+\"]\"}(e,t);r&&(n+=r+\",\"),e.key&&(n+=\"key:\"+e.key+\",\"),e.ref&&(n+=\"ref:\"+e.ref+\",\"),e.refInFor&&(n+=\"refInFor:true,\"),e.pre&&(n+=\"pre:true,\"),e.component&&(n+='tag:\"'+e.tag+'\",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+=\"attrs:\"+Ga(e.attrs)+\",\"),e.props&&(n+=\"domProps:\"+Ga(e.props)+\",\"),e.events&&(n+=Da(e.events,!1)+\",\"),e.nativeEvents&&(n+=Da(e.nativeEvents,!0)+\",\"),e.slotTarget&&!e.slotScope&&(n+=\"slot:\"+e.slotTarget+\",\"),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Ka(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==ca||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return Ja(t[e],n)}).join(\",\");return\"scopedSlots:_u([\"+a+\"]\"+(r?\",null,true\":\"\")+(!r&&i?\",null,false,\"+function(e){var t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):\"\")+\")\"}(e,e.scopedSlots,t)+\",\"),e.model&&(n+=\"model:{value:\"+e.model.value+\",callback:\"+e.model.callback+\",expression:\"+e.model.expression+\"},\"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Pa(n,t.options);return\"inlineTemplate:{render:function(){\"+r.render+\"},staticRenderFns:[\"+r.staticRenderFns.map(function(e){return\"function(){\"+e+\"}\"}).join(\",\")+\"]}\"}}(e,t);o&&(n+=o+\",\")}return n=n.replace(/,$/,\"\")+\"}\",e.dynamicAttrs&&(n=\"_b(\"+n+',\"'+e.tag+'\",'+Ga(e.dynamicAttrs)+\")\"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ka(e){return 1===e.type&&(\"slot\"===e.tag||e.children.some(Ka))}function Ja(e,t){var n=e.attrsMap[\"slot-scope\"];if(e.if&&!e.ifProcessed&&!n)return Ua(e,t,Ja,\"null\");if(e.for&&!e.forProcessed)return za(e,t,Ja);var r=e.slotScope===ca?\"\":String(e.slotScope),i=\"function(\"+r+\"){return \"+(\"template\"===e.tag?e.if&&n?\"(\"+e.if+\")?\"+(qa(e,t)||\"undefined\")+\":undefined\":qa(e,t)||\"undefined\":Ra(e,t))+\"}\",o=r?\"\":\",proxy:true\";return\"{key:\"+(e.slotTarget||'\"default\"')+\",fn:\"+i+o+\"}\"}function qa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&\"template\"!==a.tag&&\"slot\"!==a.tag){var s=n?t.maybeComponent(a)?\",1\":\",0\":\"\";return\"\"+(r||Ra)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Wa(i)||i.ifConditions&&i.ifConditions.some(function(e){return Wa(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,u=i||Za;return\"[\"+o.map(function(e){return u(e,t)}).join(\",\")+\"]\"+(c?\",\"+c:\"\")}}function Wa(e){return void 0!==e.for||\"template\"===e.tag||\"slot\"===e.tag}function Za(e,t){return 1===e.type?Ra(e,t):3===e.type&&e.isComment?(r=e,\"_e(\"+JSON.stringify(r.text)+\")\"):\"_v(\"+(2===(n=e).type?n.expression:Xa(JSON.stringify(n.text)))+\")\";var n,r}function Ga(e){for(var t=\"\",n=\"\",r=0;r<e.length;r++){var i=e[r],o=Xa(i.value);i.dynamic?n+=i.name+\",\"+o+\",\":t+='\"'+i.name+'\":'+o+\",\"}return t=\"{\"+t.slice(0,-1)+\"}\",n?\"_d(\"+t+\",[\"+n.slice(0,-1)+\"])\":t}function Xa(e){return e.replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}new RegExp(\"\\\\b\"+\"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments\".split(\",\").join(\"\\\\b|\\\\b\")+\"\\\\b\");function Ya(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),S}}function Qa(e){var t=Object.create(null);return function(n,r,i){(r=A({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=Ya(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Ya(e,c)}),t[o]=s}}var es,ts,ns=(es=function(e,t){var n=la(e.trim(),t);!1!==t.optimize&&ka(n,t);var r=Pa(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(n)for(var a in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=A(Object.create(e.directives||null),n.directives)),n)\"modules\"!==a&&\"directives\"!==a&&(r[a]=n[a]);r.warn=function(e,t,n){(n?o:i).push(e)};var s=es(t.trim(),r);return s.errors=i,s.tips=o,s}return{compile:t,compileToFunctions:Qa(t)}})(Ca),rs=(ns.compile,ns.compileToFunctions);function is(e){return(ts=ts||document.createElement(\"div\")).innerHTML=e?'<a href=\"\\n\"/>':'<div a=\"\\n\"/>',ts.innerHTML.indexOf(\"&#10;\")>0}var os=!!z&&is(!1),as=!!z&&is(!0),ss=g(function(e){var t=Yn(e);return t&&t.innerHTML}),cs=wn.prototype.$mount;return wn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if(\"string\"==typeof r)\"#\"===r.charAt(0)&&(r=ss(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement(\"div\");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=rs(r,{outputSourceRange:!1,shouldDecodeNewlines:os,shouldDecodeNewlinesForHref:as,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return cs.call(this,e,t)},wn.compile=rs,wn});"
  },
  {
    "path": "api-test-v4/lib/js/vue-json-pretty.js",
    "content": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.VueJsonPretty=t():e.VueJsonPretty=t()}(\"undefined\"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=39)}([function(e,t){var n=e.exports={version:\"2.6.9\"};\"number\"==typeof __e&&(__e=n)},function(e,t,n){var r=n(25)(\"wks\"),o=n(27),i=n(3).Symbol,s=\"function\"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)(\"Symbol.\"+e))}).store=r},function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},c=typeof e.default;\"object\"!==c&&\"function\"!==c||(s=e,a=e.default);var u=\"function\"==typeof a?a.options:a;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var l;if(i?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=l):r&&(l=r),l){var f=u.functional,d=f?u.render:u.beforeCreate;f?(u._injectStyles=l,u.render=function(e,t){return l.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:s,exports:a,options:u}}},function(e,t){var n=e.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=n)},function(e,t,n){e.exports=!n(9)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(3),o=n(0),i=n(19),s=n(6),a=n(10),c=function(e,t,n){var u,l,f,d=e&c.F,p=e&c.G,h=e&c.S,v=e&c.P,b=e&c.B,m=e&c.W,y=p?o:o[t]||(o[t]={}),g=y.prototype,_=p?r:h?r[t]:(r[t]||{}).prototype;p&&(n=t);for(u in n)(l=!d&&_&&void 0!==_[u])&&a(y,u)||(f=l?_[u]:n[u],y[u]=p&&\"function\"!=typeof _[u]?n[u]:b&&l?i(f,r):m&&_[u]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&\"function\"==typeof f?i(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[u]=f,e&c.R&&g&&!g[u]&&s(g,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(7),o=n(13);e.exports=n(4)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(8),o=n(44),i=n(45),s=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return s(e,t,n)}catch(e){}if(\"get\"in n||\"set\"in n)throw TypeError(\"Accessors not supported!\");return\"value\"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(12);e.exports=function(e){if(!r(e))throw TypeError(e+\" is not an object!\");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(15);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return\"object\"==typeof e?null!==e:\"function\"==typeof e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(47),o=n(28);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError(\"Can't call method on  \"+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(25)(\"keys\"),o=n(27);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t){e.exports={}},function(e,t,n){var r=n(43);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(12),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(22),o=n(15);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(23);e.exports=Object(\"z\").propertyIsEnumerable(0)?Object:function(e){return\"String\"==r(e)?e.split(\"\"):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(16),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(0),o=n(3),i=o[\"__core-js_shared__\"]||(o[\"__core-js_shared__\"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})(\"versions\",[]).push({version:r.version,mode:n(26)?\"pure\":\"global\",copyright:\"© 2019 Denis Pushkarev (zloirock.ru)\"})},function(e,t){e.exports=!0},function(e,t){var n=0,r=Math.random();e.exports=function(e){return\"Symbol(\".concat(void 0===e?\"\":e,\")_\",(++n+r).toString(36))}},function(e,t){e.exports=\"constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf\".split(\",\")},function(e,t,n){\"use strict\";var r=n(53),o=n.n(r),i=n(31),s=n.n(i),a=n(75),c=n(77),u=n(79),l=n(81),f=n(83),d=n(33);t.a={name:\"vue-json-pretty\",components:{SimpleText:a.a,VueCheckbox:c.a,VueRadio:u.a,BracketsLeft:l.a,BracketsRight:f.a},props:{data:{},deep:{type:Number,default:1/0},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},path:{type:String,default:\"root\"},selectableType:{type:String,default:\"\"},showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},selectOnClickNode:{type:Boolean,default:!0},value:{type:[Array,String],default:function(){return\"\"}},pathSelectable:{type:Function,default:function(){return!0}},highlightMouseoverNode:{type:Boolean,default:!1},highlightSelectedNode:{type:Boolean,default:!0},collapsedOnClickBrackets:{type:Boolean,default:!0},parentData:{},currentDeep:{type:Number,default:1},currentKey:[Number,String]},data:function(){return{visible:this.currentDeep<=this.deep,isMouseover:!1,currentCheckboxVal:!!Array.isArray(this.value)&&this.value.includes(this.path)}},computed:{model:{get:function(){var e=\"multiple\"===this.selectableType?[]:\"single\"===this.selectableType?\"\":null;return this.value||e},set:function(e){this.$emit(\"input\",e)}},lastKey:function(){if(Array.isArray(this.parentData))return this.parentData.length-1;if(this.isObject(this.parentData)){var e=s()(this.parentData);return e[e.length-1]}},notLastKey:function(){return this.currentKey!==this.lastKey},selectable:function(){return this.pathSelectable(this.path,this.data)&&(this.isMultiple||this.isSingle)},isMultiple:function(){return\"multiple\"===this.selectableType},isSingle:function(){return\"single\"===this.selectableType},isSelected:function(){return this.isMultiple?this.model.includes(this.path):!!this.isSingle&&this.model===this.path},propsError:function(){return!this.selectableType||this.selectOnClickNode||this.showSelectController?\"\":\"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail.\"}},methods:{handleValueChange:function(e){var t=this;if(!this.isMultiple||\"checkbox\"!==e&&\"tree\"!==e){if(this.isSingle&&(\"radio\"===e||\"tree\"===e)&&this.model!==this.path){var n=this.model,r=this.path;this.model=r,this.$emit(\"change\",r,n)}}else{var i=this.model.findIndex(function(e){return e===t.path}),s=[].concat(o()(this.model));-1!==i?this.model.splice(i,1):this.model.push(this.path),\"checkbox\"!==e&&(this.currentCheckboxVal=!this.currentCheckboxVal),this.$emit(\"change\",this.model,s)}},handleClick:function(e){e._uid&&e._uid!==this._uid||(e._uid=this._uid,this.$emit(\"click\",this.path,this.data),this.selectable&&this.selectOnClickNode&&this.handleValueChange(\"tree\"))},handleItemClick:function(e,t){this.$emit(\"click\",e,t)},handleItemChange:function(e,t){this.selectable&&this.$emit(\"change\",e,t)},handleMouseover:function(){this.highlightMouseoverNode&&(this.selectable||\"\"===this.selectableType)&&(this.isMouseover=!0)},handleMouseout:function(){this.highlightMouseoverNode&&(this.selectable||\"\"===this.selectableType)&&(this.isMouseover=!1)},isObject:function(e){return\"object\"===Object(d.a)(e)},keyFormatter:function(e){return this.showDoubleQuotes?'\"'+e+'\"':e}},errorCaptured:function(){return!1},watch:{deep:function(e){this.visible=this.currentDeep<=e},propsError:{handler:function(e){if(e)throw new Error(\"[vue-json-pretty] \"+e)},immediate:!0}}}},function(e,t,n){var r=n(7).f,o=n(10),i=n(1)(\"toStringTag\");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){e.exports={default:n(72),__esModule:!0}},function(e,t,n){\"use strict\";var r=n(33);t.a={props:{showDoubleQuotes:Boolean,parentData:{},data:{},showComma:Boolean,currentKey:[Number,String]},computed:{dataType:function(){return Object(r.a)(this.data)},parentDataType:function(){return Object(r.a)(this.parentData)}},methods:{textFormatter:function(e){var t=e+\"\";return\"string\"===this.dataType&&(t='\"'+t+'\"'),this.showComma&&(t+=\",\"),t}}}},function(e,t,n){\"use strict\";function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}t.a=r},function(e,t,n){\"use strict\";t.a={props:{value:{type:Boolean,default:!1}},data:function(){return{focus:!1}},computed:{model:{get:function(){return this.value},set:function(e){this.$emit(\"input\",e)}}}}},function(e,t,n){\"use strict\";t.a={props:{path:String,value:{type:String,default:\"\"}},data:function(){return{focus:!1}},computed:{currentPath:function(){return this.path},model:{get:function(){return this.value},set:function(e){this.$emit(\"input\",e)}}},methods:{change:function(){this.$emit(\"change\",this.model)}}}},function(e,t,n){\"use strict\";var r=n(31),o=n.n(r),i=n(37);t.a={mixins:[i.a],props:{showLength:Boolean},methods:{closedBracketsGenerator:function(e){var t=Array.isArray(e)?\"[...]\":\"{...}\";return this.bracketsFormatter(t)},lengthGenerator:function(e){return\" // \"+(Array.isArray(e)?e.length+\" items\":o()(e).length+\" keys\")}}}},function(e,t,n){\"use strict\";t.a={props:{visible:{required:!0,type:Boolean},data:{required:!0},showComma:Boolean,collapsedOnClickBrackets:Boolean},computed:{dataVisible:{get:function(){return this.visible},set:function(e){this.collapsedOnClickBrackets&&this.$emit(\"update:visible\",e)}}},methods:{toggleBrackets:function(){this.dataVisible=!this.dataVisible},bracketsFormatter:function(e){return this.showComma?e+\",\":e}}}},function(e,t,n){\"use strict\";var r=n(37);t.a={mixins:[r.a]}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(40),o=n.n(r),i=n(52),s=n(86);n.n(s);t.default=o()({},i.a,{version:\"1.6.2\"})},function(e,t,n){e.exports={default:n(41),__esModule:!0}},function(e,t,n){n(42),e.exports=n(0).Object.assign},function(e,t,n){var r=n(5);r(r.S+r.F,\"Object\",{assign:n(46)})},function(e,t){e.exports=function(e){if(\"function\"!=typeof e)throw TypeError(e+\" is not a function!\");return e}},function(e,t,n){e.exports=!n(4)&&!n(9)(function(){return 7!=Object.defineProperty(n(20)(\"div\"),\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(12);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&\"function\"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if(\"function\"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&\"function\"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError(\"Can't convert object to primitive value\")}},function(e,t,n){\"use strict\";var r=n(4),o=n(14),i=n(50),s=n(51),a=n(11),c=n(22),u=Object.assign;e.exports=!u||n(9)(function(){var e={},t={},n=Symbol(),r=\"abcdefghijklmnopqrst\";return e[n]=7,r.split(\"\").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join(\"\")!=r})?function(e,t){for(var n=a(e),u=arguments.length,l=1,f=i.f,d=s.f;u>l;)for(var p,h=c(arguments[l++]),v=f?o(h).concat(f(h)):o(h),b=v.length,m=0;b>m;)p=v[m++],r&&!d.call(h,p)||(n[p]=h[p]);return n}:u},function(e,t,n){var r=n(10),o=n(21),i=n(48)(!1),s=n(17)(\"IE_PROTO\");e.exports=function(e,t){var n,a=o(e),c=0,u=[];for(n in a)n!=s&&r(a,n)&&u.push(n);for(;t.length>c;)r(a,n=t[c++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){var r=n(21),o=n(24),i=n(49);e.exports=function(e){return function(t,n,s){var a,c=r(t),u=o(c.length),l=i(s,u);if(e&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(16),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){\"use strict\";var r=n(29),o=n(85),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";t.__esModule=!0;var r=n(54),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,o.default)(e)}},function(e,t,n){e.exports={default:n(55),__esModule:!0}},function(e,t,n){n(56),n(65),e.exports=n(0).Array.from},function(e,t,n){\"use strict\";var r=n(57)(!0);n(58)(String,\"String\",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(16),o=n(15);e.exports=function(e){return function(t,n){var i,s,a=String(o(t)),c=r(n),u=a.length;return c<0||c>=u?e?\"\":void 0:(i=a.charCodeAt(c),i<55296||i>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?e?a.charAt(c):i:e?a.slice(c,c+2):s-56320+(i-55296<<10)+65536)}}},function(e,t,n){\"use strict\";var r=n(26),o=n(5),i=n(59),s=n(6),a=n(18),c=n(60),u=n(30),l=n(64),f=n(1)(\"iterator\"),d=!([].keys&&\"next\"in[].keys()),p=function(){return this};e.exports=function(e,t,n,h,v,b,m){c(n,t,h);var y,g,_,x=function(e){if(!d&&e in C)return C[e];switch(e){case\"keys\":case\"values\":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+\" Iterator\",j=\"values\"==v,w=!1,C=e.prototype,O=C[f]||C[\"@@iterator\"]||v&&C[v],S=O||x(v),A=v?j?x(\"entries\"):S:void 0,M=\"Array\"==t?C.entries||O:O;if(M&&(_=l(M.call(new e)))!==Object.prototype&&_.next&&(u(_,k,!0),r||\"function\"==typeof _[f]||s(_,f,p)),j&&O&&\"values\"!==O.name&&(w=!0,S=function(){return O.call(this)}),r&&!m||!d&&!w&&C[f]||s(C,f,S),a[t]=S,a[k]=p,v)if(y={values:j?S:x(\"values\"),keys:b?S:x(\"keys\"),entries:A},m)for(g in y)g in C||i(C,g,y[g]);else o(o.P+o.F*(d||w),t,y);return y}},function(e,t,n){e.exports=n(6)},function(e,t,n){\"use strict\";var r=n(61),o=n(13),i=n(30),s={};n(6)(s,n(1)(\"iterator\"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+\" Iterator\")}},function(e,t,n){var r=n(8),o=n(62),i=n(28),s=n(17)(\"IE_PROTO\"),a=function(){},c=function(){var e,t=n(20)(\"iframe\"),r=i.length;for(t.style.display=\"none\",n(63).appendChild(t),t.src=\"javascript:\",e=t.contentWindow.document,e.open(),e.write(\"<script>document.F=Object<\\/script>\"),e.close(),c=e.F;r--;)delete c.prototype[i[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=r(e),n=new a,a.prototype=null,n[s]=e):n=c(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(7),o=n(8),i=n(14);e.exports=n(4)?Object.defineProperties:function(e,t){o(e);for(var n,s=i(t),a=s.length,c=0;a>c;)r.f(e,n=s[c++],t[n]);return e}},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(10),o=n(11),i=n(17)(\"IE_PROTO\"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:\"function\"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){\"use strict\";var r=n(19),o=n(5),i=n(11),s=n(66),a=n(67),c=n(24),u=n(68),l=n(69);o(o.S+o.F*!n(71)(function(e){Array.from(e)}),\"Array\",{from:function(e){var t,n,o,f,d=i(e),p=\"function\"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,b=void 0!==v,m=0,y=l(d);if(b&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==y||p==Array&&a(y))for(t=c(d.length),n=new p(t);t>m;m++)u(n,m,b?v(d[m],m):d[m]);else for(f=y.call(d),n=new p;!(o=f.next()).done;m++)u(n,m,b?s(f,v,[o.value,m],!0):o.value);return n.length=m,n}})},function(e,t,n){var r=n(8);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(18),o=n(1)(\"iterator\"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){\"use strict\";var r=n(7),o=n(13);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(70),o=n(1)(\"iterator\"),i=n(18);e.exports=n(0).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e[\"@@iterator\"]||i[r(e)]}},function(e,t,n){var r=n(23),o=n(1)(\"toStringTag\"),i=\"Arguments\"==r(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,a;return void 0===e?\"Undefined\":null===e?\"Null\":\"string\"==typeof(n=s(t=Object(e),o))?n:i?r(t):\"Object\"==(a=r(t))&&\"function\"==typeof t.callee?\"Arguments\":a}},function(e,t,n){var r=n(1)(\"iterator\"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},e(i)}catch(e){}return n}},function(e,t,n){n(73),e.exports=n(0).Object.keys},function(e,t,n){var r=n(11),o=n(14);n(74)(\"keys\",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(5),o=n(0),i=n(9);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*i(function(){n(1)}),\"Object\",s)}},function(e,t,n){\"use strict\";var r=n(32),o=n(76),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",[e._t(\"default\"),e._v(\" \"),n(\"span\",{class:\"vjs-value vjs-value__\"+e.dataType},[e._v(\"\\n    \"+e._s(e.textFormatter(e.data))+\"\\n  \")])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(34),o=n(78),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"label\",{class:[\"vjs-checkbox\",e.value?\"is-checked\":\"\"],on:{click:function(e){e.stopPropagation()}}},[n(\"span\",{staticClass:\"vjs-checkbox__inner\"}),e._v(\" \"),n(\"input\",{directives:[{name:\"model\",rawName:\"v-model\",value:e.model,expression:\"model\"}],staticClass:\"vjs-checkbox__original\",attrs:{type:\"checkbox\"},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e.model},on:{change:[function(t){var n=e.model,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&(e.model=n.concat([null])):i>-1&&(e.model=n.slice(0,i).concat(n.slice(i+1)))}else e.model=o},function(t){return e.$emit(\"change\",e.model)}],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(35),o=n(80),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"label\",{class:[\"vjs-radio\",e.model===e.currentPath?\"is-checked\":\"\"],on:{click:function(e){e.stopPropagation()}}},[n(\"span\",{staticClass:\"vjs-radio__inner\"}),e._v(\" \"),n(\"input\",{directives:[{name:\"model\",rawName:\"v-model\",value:e.model,expression:\"model\"}],staticClass:\"vjs-radio__original\",attrs:{type:\"radio\"},domProps:{value:e.currentPath,checked:e._q(e.model,e.currentPath)},on:{change:[function(t){e.model=e.currentPath},e.change],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(36),o=n(82),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",[e._t(\"default\"),e._v(\" \"),n(\"span\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.dataVisible,expression:\"dataVisible\"}],staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n    \"+e._s(Array.isArray(e.data)?\"[\":\"{\")+\"\\n  \")]),e._v(\" \"),n(\"span\",{directives:[{name:\"show\",rawName:\"v-show\",value:!e.dataVisible,expression:\"!dataVisible\"}]},[n(\"span\",{staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n      \"+e._s(e.closedBracketsGenerator(e.data))+\"\\n    \")]),e._v(\" \"),e.showLength?n(\"span\",{staticClass:\"vjs-comment\"},[e._v(\"\\n      \"+e._s(e.lengthGenerator(e.data))+\"\\n    \")]):e._e()])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=n(38),o=n(84),i=n(2),s=i(r.a,o.a,!1,null,null,null);t.a=s.exports},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.dataVisible,expression:\"dataVisible\"}]},[n(\"span\",{staticClass:\"vjs-tree__brackets\",on:{click:function(t){return t.stopPropagation(),e.toggleBrackets(t)}}},[e._v(\"\\n    \"+e._s(e.bracketsFormatter(Array.isArray(e.data)?\"]\":\"}\"))+\"\\n  \")])])},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){\"use strict\";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{class:{\"vjs-tree\":!0,\"has-selectable-control\":e.isMultiple||e.showSelectController,\"is-root\":1===e.currentDeep,\"is-selectable\":e.selectable,\"is-selected\":e.isSelected,\"is-highlight-selected\":e.isSelected&&e.highlightSelectedNode,\"is-mouseover\":e.isMouseover},on:{click:e.handleClick,mouseover:function(t){return t.stopPropagation(),e.handleMouseover(t)},mouseout:function(t){return t.stopPropagation(),e.handleMouseout(t)}}},[e.showSelectController&&e.selectable?[e.isMultiple?n(\"vue-checkbox\",{on:{change:function(t){return e.handleValueChange(\"checkbox\")}},model:{value:e.currentCheckboxVal,callback:function(t){e.currentCheckboxVal=t},expression:\"currentCheckboxVal\"}}):e.isSingle?n(\"vue-radio\",{attrs:{path:e.path},on:{change:function(t){return e.handleValueChange(\"radio\")}},model:{value:e.model,callback:function(t){e.model=t},expression:\"model\"}}):e._e()]:e._e(),e._v(\" \"),Array.isArray(e.data)||e.isObject(e.data)?[n(\"brackets-left\",{attrs:{visible:e.visible,data:e.data,\"show-length\":e.showLength,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"show-comma\":e.notLastKey},on:{\"update:visible\":function(t){e.visible=t}}},[e.currentDeep>1&&!Array.isArray(e.parentData)?n(\"span\",{staticClass:\"vjs-key\"},[e._v(e._s(e.keyFormatter(e.currentKey))+\":\")]):e._e()]),e._v(\" \"),e._l(e.data,function(t,r){return n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.visible,expression:\"visible\"}],key:r,class:{\"vjs-tree__content\":!0,\"has-line\":e.showLine}},[n(\"vue-json-pretty\",{attrs:{\"parent-data\":e.data,data:t,deep:e.deep,\"show-length\":e.showLength,\"show-double-quotes\":e.showDoubleQuotes,\"show-line\":e.showLine,\"highlight-mouseover-node\":e.highlightMouseoverNode,\"highlight-selected-node\":e.highlightSelectedNode,path:e.path+(Array.isArray(e.data)?\"[\"+r+\"]\":\".\"+r),\"path-selectable\":e.pathSelectable,\"selectable-type\":e.selectableType,\"show-select-controller\":e.showSelectController,\"select-on-click-node\":e.selectOnClickNode,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"current-key\":r,\"current-deep\":e.currentDeep+1},on:{click:e.handleItemClick,change:e.handleItemChange},model:{value:e.model,callback:function(t){e.model=t},expression:\"model\"}})],1)}),e._v(\" \"),n(\"brackets-right\",{attrs:{visible:e.visible,data:e.data,\"collapsed-on-click-brackets\":e.collapsedOnClickBrackets,\"show-comma\":e.notLastKey},on:{\"update:visible\":function(t){e.visible=t}}})]:n(\"simple-text\",{attrs:{\"show-double-quotes\":e.showDoubleQuotes,\"show-comma\":e.notLastKey,\"parent-data\":e.parentData,data:e.data,\"current-key\":e.currentKey}},[e.parentData&&e.currentKey&&!Array.isArray(e.parentData)?n(\"span\",{staticClass:\"vjs-key\"},[e._v(\"\\n      \"+e._s(e.keyFormatter(e.currentKey))+\":\\n    \")]):e._e()])],2)},o=[],i={render:r,staticRenderFns:o};t.a=i},function(e,t,n){var r=n(87);\"string\"==typeof r&&(r=[[e.i,r,\"\"]]),r.locals&&(e.exports=r.locals);n(89)(\"bfa6fc9c\",r,!0,{})},function(e,t,n){t=e.exports=n(88)(!1),t.push([e.i,'.vjs-checkbox{position:absolute;left:-30px;color:#1f2d3d;user-select:none}.vjs-checkbox.is-checked .vjs-checkbox__inner{background-color:#1890ff;border-color:#0076e4}.vjs-checkbox.is-checked .vjs-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.vjs-checkbox .vjs-checkbox__inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-checkbox .vjs-checkbox__inner:after{box-sizing:content-box;content:\"\";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-checkbox .vjs-checkbox__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-radio{position:absolute;left:-30px;color:#1f2d3d;user-select:none}.vjs-radio.is-checked .vjs-radio__inner{background-color:#1890ff;border-color:#0076e4}.vjs-radio.is-checked .vjs-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.vjs-radio .vjs-radio__inner{border:1px solid #bfcbd9;border-radius:100%;width:16px;height:16px;vertical-align:middle;background-color:#fff;position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.vjs-radio .vjs-radio__inner:after{width:4px;height:4px;border-radius:100%;background-color:#fff;content:\"\";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.vjs-radio .vjs-radio__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px}.vjs-tree.is-root{position:relative}.vjs-tree.is-root.has-selectable-control{margin-left:30px}.vjs-tree.is-mouseover{background-color:#e6f7ff}.vjs-tree.is-highlight-selected{background-color:#ccefff}.vjs-tree .vjs-tree__content{padding-left:1em}.vjs-tree .vjs-tree__content.has-line{border-left:1px dotted #bfcbd9}.vjs-tree .vjs-tree__brackets{cursor:pointer}.vjs-tree .vjs-tree__brackets:hover{color:#1890ff}.vjs-tree .vjs-comment{color:#bfcbd9}.vjs-tree .vjs-value__null{color:#ff4949}.vjs-tree .vjs-value__boolean,.vjs-tree .vjs-value__number{color:#1d8ce0}.vjs-tree .vjs-value__string{color:#13ce66}',\"\"])},function(e,t){function n(e,t){var n=e[1]||\"\",o=e[3];if(!o)return n;if(t&&\"function\"==typeof btoa){var i=r(o);return[n].concat(o.sources.map(function(e){return\"/*# sourceURL=\"+o.sourceRoot+e+\" */\"})).concat([i]).join(\"\\n\")}return[n].join(\"\\n\")}function r(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?\"@media \"+t[2]+\"{\"+r+\"}\":r}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];\"number\"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var s=e[o];\"number\"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]=\"(\"+s[2]+\") and (\"+n+\")\"),t.push(s))}},t}},function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=l[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(i(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var s=[],o=0;o<n.parts.length;o++)s.push(i(n.parts[o]));l[n.id]={id:n.id,refs:1,parts:s}}}}function o(){var e=document.createElement(\"style\");return e.type=\"text/css\",f.appendChild(e),e}function i(e){var t,n,r=document.querySelector(\"style[\"+m+'~=\"'+e.id+'\"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(y){var i=p++;r=d||(d=o()),t=s.bind(null,r,i,!1),n=s.bind(null,r,i,!0)}else r=o(),t=a.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function s(e,t,n,r){var o=n?\"\":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function a(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute(\"media\",r),b.ssrId&&e.setAttribute(m,t.id),o&&(n+=\"\\n/*# sourceURL=\"+o.sources[0]+\" */\",n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+\" */\"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c=\"undefined\"!=typeof document;if(\"undefined\"!=typeof DEBUG&&DEBUG&&!c)throw new Error(\"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\");var u=n(90),l={},f=c&&(document.head||document.getElementsByTagName(\"head\")[0]),d=null,p=0,h=!1,v=function(){},b=null,m=\"data-vue-ssr-id\",y=\"undefined\"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,o){h=n,b=o||{};var i=u(e,t);return r(i),function(t){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=l[s.id];a.refs--,n.push(a)}t?(i=u(e,t),r(i)):i=[];for(var o=0;o<n.length;o++){var a=n[o];if(0===a.refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete l[a.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join(\"\\n\")}}()},function(e,t){e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],s=i[0],a=i[1],c=i[2],u=i[3],l={id:e+\":\"+o,css:a,media:c,sourceMap:u};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}}])});"
  },
  {
    "path": "api-test-v4/lib/styles/dragula-3.7.2.css",
    "content": ".gu-mirror {\n  position: fixed !important;\n  margin: 0 !important;\n  z-index: 9999 !important;\n  opacity: 0.8;\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";\n  filter: alpha(opacity=80);\n}\n.gu-hide {\n  display: none !important;\n}\n.gu-unselectable {\n  -webkit-user-select: none !important;\n  -moz-user-select: none !important;\n  -ms-user-select: none !important;\n  user-select: none !important;\n}\n.gu-transit {\n  opacity: 0.2;\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";\n  filter: alpha(opacity=20);\n}"
  },
  {
    "path": "api-test-v4/lib/styles/iview.css",
    "content": ".ivu-load-loop{-webkit-animation:ani-load-loop 1s linear infinite;animation:ani-load-loop 1s linear infinite}@-webkit-keyframes ani-load-loop{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes ani-load-loop{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.input-group-error-append,.input-group-error-prepend{background-color:#fff;border:1px solid #ed4014}.input-group-error-append .ivu-select-selection,.input-group-error-prepend .ivu-select-selection{background-color:inherit;border:1px solid transparent}.input-group-error-prepend{border-right:0}.input-group-error-append{border-left:0}/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto;resize:vertical}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}body{font-family:\"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;font-size:14px;line-height:1.5;color:#515a6e;background-color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}article,aside,blockquote,body,button,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,input,legend,li,menu,nav,ol,p,section,td,textarea,th,ul{margin:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}input::-ms-clear,input::-ms-reveal{display:none}a{color:#2d8cf0;background:0 0;text-decoration:none;outline:0;cursor:pointer;-webkit-transition:color .2s ease;transition:color .2s ease}a:hover{color:#57a3f3}a:active{color:#2b85e4}a:active,a:hover{outline:0;text-decoration:none}a[disabled]{color:#ccc;cursor:not-allowed;pointer-events:none}code,kbd,pre,samp{font-family:Consolas,Menlo,Courier,monospace}@font-face{font-family:Ionicons;src:url(fonts/ionicons.woff2?v=3.0.0) format(\"woff2\"),url(fonts/ionicons.woff?v=3.0.0) format(\"woff\"),url(fonts/ionicons.ttf?v=3.0.0) format(\"truetype\"),url(fonts/ionicons.svg?v=3.0.0#Ionicons) format(\"svg\");font-weight:400;font-style:normal}.ivu-icon{display:inline-block;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:optimizeLegibility;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:-.125em;text-align:center}.ivu-icon-ios-add-circle-outline:before{content:\"\\f100\"}.ivu-icon-ios-add-circle:before{content:\"\\f101\"}.ivu-icon-ios-add:before{content:\"\\f102\"}.ivu-icon-ios-alarm-outline:before{content:\"\\f103\"}.ivu-icon-ios-alarm:before{content:\"\\f104\"}.ivu-icon-ios-albums-outline:before{content:\"\\f105\"}.ivu-icon-ios-albums:before{content:\"\\f106\"}.ivu-icon-ios-alert-outline:before{content:\"\\f107\"}.ivu-icon-ios-alert:before{content:\"\\f108\"}.ivu-icon-ios-american-football-outline:before{content:\"\\f109\"}.ivu-icon-ios-american-football:before{content:\"\\f10a\"}.ivu-icon-ios-analytics-outline:before{content:\"\\f10b\"}.ivu-icon-ios-analytics:before{content:\"\\f10c\"}.ivu-icon-ios-aperture-outline:before{content:\"\\f10d\"}.ivu-icon-ios-aperture:before{content:\"\\f10e\"}.ivu-icon-ios-apps-outline:before{content:\"\\f10f\"}.ivu-icon-ios-apps:before{content:\"\\f110\"}.ivu-icon-ios-appstore-outline:before{content:\"\\f111\"}.ivu-icon-ios-appstore:before{content:\"\\f112\"}.ivu-icon-ios-archive-outline:before{content:\"\\f113\"}.ivu-icon-ios-archive:before{content:\"\\f114\"}.ivu-icon-ios-arrow-back:before{content:\"\\f115\"}.ivu-icon-ios-arrow-down:before{content:\"\\f116\"}.ivu-icon-ios-arrow-dropdown-circle:before{content:\"\\f117\"}.ivu-icon-ios-arrow-dropdown:before{content:\"\\f118\"}.ivu-icon-ios-arrow-dropleft-circle:before{content:\"\\f119\"}.ivu-icon-ios-arrow-dropleft:before{content:\"\\f11a\"}.ivu-icon-ios-arrow-dropright-circle:before{content:\"\\f11b\"}.ivu-icon-ios-arrow-dropright:before{content:\"\\f11c\"}.ivu-icon-ios-arrow-dropup-circle:before{content:\"\\f11d\"}.ivu-icon-ios-arrow-dropup:before{content:\"\\f11e\"}.ivu-icon-ios-arrow-forward:before{content:\"\\f11f\"}.ivu-icon-ios-arrow-round-back:before{content:\"\\f120\"}.ivu-icon-ios-arrow-round-down:before{content:\"\\f121\"}.ivu-icon-ios-arrow-round-forward:before{content:\"\\f122\"}.ivu-icon-ios-arrow-round-up:before{content:\"\\f123\"}.ivu-icon-ios-arrow-up:before{content:\"\\f124\"}.ivu-icon-ios-at-outline:before{content:\"\\f125\"}.ivu-icon-ios-at:before{content:\"\\f126\"}.ivu-icon-ios-attach:before{content:\"\\f127\"}.ivu-icon-ios-backspace-outline:before{content:\"\\f128\"}.ivu-icon-ios-backspace:before{content:\"\\f129\"}.ivu-icon-ios-barcode-outline:before{content:\"\\f12a\"}.ivu-icon-ios-barcode:before{content:\"\\f12b\"}.ivu-icon-ios-baseball-outline:before{content:\"\\f12c\"}.ivu-icon-ios-baseball:before{content:\"\\f12d\"}.ivu-icon-ios-basket-outline:before{content:\"\\f12e\"}.ivu-icon-ios-basket:before{content:\"\\f12f\"}.ivu-icon-ios-basketball-outline:before{content:\"\\f130\"}.ivu-icon-ios-basketball:before{content:\"\\f131\"}.ivu-icon-ios-battery-charging:before{content:\"\\f132\"}.ivu-icon-ios-battery-dead:before{content:\"\\f133\"}.ivu-icon-ios-battery-full:before{content:\"\\f134\"}.ivu-icon-ios-beaker-outline:before{content:\"\\f135\"}.ivu-icon-ios-beaker:before{content:\"\\f136\"}.ivu-icon-ios-beer-outline:before{content:\"\\f137\"}.ivu-icon-ios-beer:before{content:\"\\f138\"}.ivu-icon-ios-bicycle:before{content:\"\\f139\"}.ivu-icon-ios-bluetooth:before{content:\"\\f13a\"}.ivu-icon-ios-boat-outline:before{content:\"\\f13b\"}.ivu-icon-ios-boat:before{content:\"\\f13c\"}.ivu-icon-ios-body-outline:before{content:\"\\f13d\"}.ivu-icon-ios-body:before{content:\"\\f13e\"}.ivu-icon-ios-bonfire-outline:before{content:\"\\f13f\"}.ivu-icon-ios-bonfire:before{content:\"\\f140\"}.ivu-icon-ios-book-outline:before{content:\"\\f141\"}.ivu-icon-ios-book:before{content:\"\\f142\"}.ivu-icon-ios-bookmark-outline:before{content:\"\\f143\"}.ivu-icon-ios-bookmark:before{content:\"\\f144\"}.ivu-icon-ios-bookmarks-outline:before{content:\"\\f145\"}.ivu-icon-ios-bookmarks:before{content:\"\\f146\"}.ivu-icon-ios-bowtie-outline:before{content:\"\\f147\"}.ivu-icon-ios-bowtie:before{content:\"\\f148\"}.ivu-icon-ios-briefcase-outline:before{content:\"\\f149\"}.ivu-icon-ios-briefcase:before{content:\"\\f14a\"}.ivu-icon-ios-browsers-outline:before{content:\"\\f14b\"}.ivu-icon-ios-browsers:before{content:\"\\f14c\"}.ivu-icon-ios-brush-outline:before{content:\"\\f14d\"}.ivu-icon-ios-brush:before{content:\"\\f14e\"}.ivu-icon-ios-bug-outline:before{content:\"\\f14f\"}.ivu-icon-ios-bug:before{content:\"\\f150\"}.ivu-icon-ios-build-outline:before{content:\"\\f151\"}.ivu-icon-ios-build:before{content:\"\\f152\"}.ivu-icon-ios-bulb-outline:before{content:\"\\f153\"}.ivu-icon-ios-bulb:before{content:\"\\f154\"}.ivu-icon-ios-bus-outline:before{content:\"\\f155\"}.ivu-icon-ios-bus:before{content:\"\\f156\"}.ivu-icon-ios-cafe-outline:before{content:\"\\f157\"}.ivu-icon-ios-cafe:before{content:\"\\f158\"}.ivu-icon-ios-calculator-outline:before{content:\"\\f159\"}.ivu-icon-ios-calculator:before{content:\"\\f15a\"}.ivu-icon-ios-calendar-outline:before{content:\"\\f15b\"}.ivu-icon-ios-calendar:before{content:\"\\f15c\"}.ivu-icon-ios-call-outline:before{content:\"\\f15d\"}.ivu-icon-ios-call:before{content:\"\\f15e\"}.ivu-icon-ios-camera-outline:before{content:\"\\f15f\"}.ivu-icon-ios-camera:before{content:\"\\f160\"}.ivu-icon-ios-car-outline:before{content:\"\\f161\"}.ivu-icon-ios-car:before{content:\"\\f162\"}.ivu-icon-ios-card-outline:before{content:\"\\f163\"}.ivu-icon-ios-card:before{content:\"\\f164\"}.ivu-icon-ios-cart-outline:before{content:\"\\f165\"}.ivu-icon-ios-cart:before{content:\"\\f166\"}.ivu-icon-ios-cash-outline:before{content:\"\\f167\"}.ivu-icon-ios-cash:before{content:\"\\f168\"}.ivu-icon-ios-chatboxes-outline:before{content:\"\\f169\"}.ivu-icon-ios-chatboxes:before{content:\"\\f16a\"}.ivu-icon-ios-chatbubbles-outline:before{content:\"\\f16b\"}.ivu-icon-ios-chatbubbles:before{content:\"\\f16c\"}.ivu-icon-ios-checkbox-outline:before{content:\"\\f16d\"}.ivu-icon-ios-checkbox:before{content:\"\\f16e\"}.ivu-icon-ios-checkmark-circle-outline:before{content:\"\\f16f\"}.ivu-icon-ios-checkmark-circle:before{content:\"\\f170\"}.ivu-icon-ios-checkmark:before{content:\"\\f171\"}.ivu-icon-ios-clipboard-outline:before{content:\"\\f172\"}.ivu-icon-ios-clipboard:before{content:\"\\f173\"}.ivu-icon-ios-clock-outline:before{content:\"\\f174\"}.ivu-icon-ios-clock:before{content:\"\\f175\"}.ivu-icon-ios-close-circle-outline:before{content:\"\\f176\"}.ivu-icon-ios-close-circle:before{content:\"\\f177\"}.ivu-icon-ios-close:before{content:\"\\f178\"}.ivu-icon-ios-closed-captioning-outline:before{content:\"\\f179\"}.ivu-icon-ios-closed-captioning:before{content:\"\\f17a\"}.ivu-icon-ios-cloud-circle-outline:before{content:\"\\f17b\"}.ivu-icon-ios-cloud-circle:before{content:\"\\f17c\"}.ivu-icon-ios-cloud-done-outline:before{content:\"\\f17d\"}.ivu-icon-ios-cloud-done:before{content:\"\\f17e\"}.ivu-icon-ios-cloud-download-outline:before{content:\"\\f17f\"}.ivu-icon-ios-cloud-download:before{content:\"\\f180\"}.ivu-icon-ios-cloud-outline:before{content:\"\\f181\"}.ivu-icon-ios-cloud-upload-outline:before{content:\"\\f182\"}.ivu-icon-ios-cloud-upload:before{content:\"\\f183\"}.ivu-icon-ios-cloud:before{content:\"\\f184\"}.ivu-icon-ios-cloudy-night-outline:before{content:\"\\f185\"}.ivu-icon-ios-cloudy-night:before{content:\"\\f186\"}.ivu-icon-ios-cloudy-outline:before{content:\"\\f187\"}.ivu-icon-ios-cloudy:before{content:\"\\f188\"}.ivu-icon-ios-code-download:before{content:\"\\f189\"}.ivu-icon-ios-code-working:before{content:\"\\f18a\"}.ivu-icon-ios-code:before{content:\"\\f18b\"}.ivu-icon-ios-cog-outline:before{content:\"\\f18c\"}.ivu-icon-ios-cog:before{content:\"\\f18d\"}.ivu-icon-ios-color-fill-outline:before{content:\"\\f18e\"}.ivu-icon-ios-color-fill:before{content:\"\\f18f\"}.ivu-icon-ios-color-filter-outline:before{content:\"\\f190\"}.ivu-icon-ios-color-filter:before{content:\"\\f191\"}.ivu-icon-ios-color-palette-outline:before{content:\"\\f192\"}.ivu-icon-ios-color-palette:before{content:\"\\f193\"}.ivu-icon-ios-color-wand-outline:before{content:\"\\f194\"}.ivu-icon-ios-color-wand:before{content:\"\\f195\"}.ivu-icon-ios-compass-outline:before{content:\"\\f196\"}.ivu-icon-ios-compass:before{content:\"\\f197\"}.ivu-icon-ios-construct-outline:before{content:\"\\f198\"}.ivu-icon-ios-construct:before{content:\"\\f199\"}.ivu-icon-ios-contact-outline:before{content:\"\\f19a\"}.ivu-icon-ios-contact:before{content:\"\\f19b\"}.ivu-icon-ios-contacts-outline:before{content:\"\\f19c\"}.ivu-icon-ios-contacts:before{content:\"\\f19d\"}.ivu-icon-ios-contract:before{content:\"\\f19e\"}.ivu-icon-ios-contrast:before{content:\"\\f19f\"}.ivu-icon-ios-copy-outline:before{content:\"\\f1a0\"}.ivu-icon-ios-copy:before{content:\"\\f1a1\"}.ivu-icon-ios-create-outline:before{content:\"\\f1a2\"}.ivu-icon-ios-create:before{content:\"\\f1a3\"}.ivu-icon-ios-crop-outline:before{content:\"\\f1a4\"}.ivu-icon-ios-crop:before{content:\"\\f1a5\"}.ivu-icon-ios-cube-outline:before{content:\"\\f1a6\"}.ivu-icon-ios-cube:before{content:\"\\f1a7\"}.ivu-icon-ios-cut-outline:before{content:\"\\f1a8\"}.ivu-icon-ios-cut:before{content:\"\\f1a9\"}.ivu-icon-ios-desktop-outline:before{content:\"\\f1aa\"}.ivu-icon-ios-desktop:before{content:\"\\f1ab\"}.ivu-icon-ios-disc-outline:before{content:\"\\f1ac\"}.ivu-icon-ios-disc:before{content:\"\\f1ad\"}.ivu-icon-ios-document-outline:before{content:\"\\f1ae\"}.ivu-icon-ios-document:before{content:\"\\f1af\"}.ivu-icon-ios-done-all:before{content:\"\\f1b0\"}.ivu-icon-ios-download-outline:before{content:\"\\f1b1\"}.ivu-icon-ios-download:before{content:\"\\f1b2\"}.ivu-icon-ios-easel-outline:before{content:\"\\f1b3\"}.ivu-icon-ios-easel:before{content:\"\\f1b4\"}.ivu-icon-ios-egg-outline:before{content:\"\\f1b5\"}.ivu-icon-ios-egg:before{content:\"\\f1b6\"}.ivu-icon-ios-exit-outline:before{content:\"\\f1b7\"}.ivu-icon-ios-exit:before{content:\"\\f1b8\"}.ivu-icon-ios-expand:before{content:\"\\f1b9\"}.ivu-icon-ios-eye-off-outline:before{content:\"\\f1ba\"}.ivu-icon-ios-eye-off:before{content:\"\\f1bb\"}.ivu-icon-ios-eye-outline:before{content:\"\\f1bc\"}.ivu-icon-ios-eye:before{content:\"\\f1bd\"}.ivu-icon-ios-fastforward-outline:before{content:\"\\f1be\"}.ivu-icon-ios-fastforward:before{content:\"\\f1bf\"}.ivu-icon-ios-female:before{content:\"\\f1c0\"}.ivu-icon-ios-filing-outline:before{content:\"\\f1c1\"}.ivu-icon-ios-filing:before{content:\"\\f1c2\"}.ivu-icon-ios-film-outline:before{content:\"\\f1c3\"}.ivu-icon-ios-film:before{content:\"\\f1c4\"}.ivu-icon-ios-finger-print:before{content:\"\\f1c5\"}.ivu-icon-ios-flag-outline:before{content:\"\\f1c6\"}.ivu-icon-ios-flag:before{content:\"\\f1c7\"}.ivu-icon-ios-flame-outline:before{content:\"\\f1c8\"}.ivu-icon-ios-flame:before{content:\"\\f1c9\"}.ivu-icon-ios-flash-outline:before{content:\"\\f1ca\"}.ivu-icon-ios-flash:before{content:\"\\f1cb\"}.ivu-icon-ios-flask-outline:before{content:\"\\f1cc\"}.ivu-icon-ios-flask:before{content:\"\\f1cd\"}.ivu-icon-ios-flower-outline:before{content:\"\\f1ce\"}.ivu-icon-ios-flower:before{content:\"\\f1cf\"}.ivu-icon-ios-folder-open-outline:before{content:\"\\f1d0\"}.ivu-icon-ios-folder-open:before{content:\"\\f1d1\"}.ivu-icon-ios-folder-outline:before{content:\"\\f1d2\"}.ivu-icon-ios-folder:before{content:\"\\f1d3\"}.ivu-icon-ios-football-outline:before{content:\"\\f1d4\"}.ivu-icon-ios-football:before{content:\"\\f1d5\"}.ivu-icon-ios-funnel-outline:before{content:\"\\f1d6\"}.ivu-icon-ios-funnel:before{content:\"\\f1d7\"}.ivu-icon-ios-game-controller-a-outline:before{content:\"\\f1d8\"}.ivu-icon-ios-game-controller-a:before{content:\"\\f1d9\"}.ivu-icon-ios-game-controller-b-outline:before{content:\"\\f1da\"}.ivu-icon-ios-game-controller-b:before{content:\"\\f1db\"}.ivu-icon-ios-git-branch:before{content:\"\\f1dc\"}.ivu-icon-ios-git-commit:before{content:\"\\f1dd\"}.ivu-icon-ios-git-compare:before{content:\"\\f1de\"}.ivu-icon-ios-git-merge:before{content:\"\\f1df\"}.ivu-icon-ios-git-network:before{content:\"\\f1e0\"}.ivu-icon-ios-git-pull-request:before{content:\"\\f1e1\"}.ivu-icon-ios-glasses-outline:before{content:\"\\f1e2\"}.ivu-icon-ios-glasses:before{content:\"\\f1e3\"}.ivu-icon-ios-globe-outline:before{content:\"\\f1e4\"}.ivu-icon-ios-globe:before{content:\"\\f1e5\"}.ivu-icon-ios-grid-outline:before{content:\"\\f1e6\"}.ivu-icon-ios-grid:before{content:\"\\f1e7\"}.ivu-icon-ios-hammer-outline:before{content:\"\\f1e8\"}.ivu-icon-ios-hammer:before{content:\"\\f1e9\"}.ivu-icon-ios-hand-outline:before{content:\"\\f1ea\"}.ivu-icon-ios-hand:before{content:\"\\f1eb\"}.ivu-icon-ios-happy-outline:before{content:\"\\f1ec\"}.ivu-icon-ios-happy:before{content:\"\\f1ed\"}.ivu-icon-ios-headset-outline:before{content:\"\\f1ee\"}.ivu-icon-ios-headset:before{content:\"\\f1ef\"}.ivu-icon-ios-heart-outline:before{content:\"\\f1f0\"}.ivu-icon-ios-heart:before{content:\"\\f1f1\"}.ivu-icon-ios-help-buoy-outline:before{content:\"\\f1f2\"}.ivu-icon-ios-help-buoy:before{content:\"\\f1f3\"}.ivu-icon-ios-help-circle-outline:before{content:\"\\f1f4\"}.ivu-icon-ios-help-circle:before{content:\"\\f1f5\"}.ivu-icon-ios-help:before{content:\"\\f1f6\"}.ivu-icon-ios-home-outline:before{content:\"\\f1f7\"}.ivu-icon-ios-home:before{content:\"\\f1f8\"}.ivu-icon-ios-ice-cream-outline:before{content:\"\\f1f9\"}.ivu-icon-ios-ice-cream:before{content:\"\\f1fa\"}.ivu-icon-ios-image-outline:before{content:\"\\f1fb\"}.ivu-icon-ios-image:before{content:\"\\f1fc\"}.ivu-icon-ios-images-outline:before{content:\"\\f1fd\"}.ivu-icon-ios-images:before{content:\"\\f1fe\"}.ivu-icon-ios-infinite-outline:before{content:\"\\f1ff\"}.ivu-icon-ios-infinite:before{content:\"\\f200\"}.ivu-icon-ios-information-circle-outline:before{content:\"\\f201\"}.ivu-icon-ios-information-circle:before{content:\"\\f202\"}.ivu-icon-ios-information:before{content:\"\\f203\"}.ivu-icon-ios-ionic-outline:before{content:\"\\f204\"}.ivu-icon-ios-ionic:before{content:\"\\f205\"}.ivu-icon-ios-ionitron-outline:before{content:\"\\f206\"}.ivu-icon-ios-ionitron:before{content:\"\\f207\"}.ivu-icon-ios-jet-outline:before{content:\"\\f208\"}.ivu-icon-ios-jet:before{content:\"\\f209\"}.ivu-icon-ios-key-outline:before{content:\"\\f20a\"}.ivu-icon-ios-key:before{content:\"\\f20b\"}.ivu-icon-ios-keypad-outline:before{content:\"\\f20c\"}.ivu-icon-ios-keypad:before{content:\"\\f20d\"}.ivu-icon-ios-laptop:before{content:\"\\f20e\"}.ivu-icon-ios-leaf-outline:before{content:\"\\f20f\"}.ivu-icon-ios-leaf:before{content:\"\\f210\"}.ivu-icon-ios-link-outline:before{content:\"\\f211\"}.ivu-icon-ios-link:before{content:\"\\f212\"}.ivu-icon-ios-list-box-outline:before{content:\"\\f213\"}.ivu-icon-ios-list-box:before{content:\"\\f214\"}.ivu-icon-ios-list:before{content:\"\\f215\"}.ivu-icon-ios-locate-outline:before{content:\"\\f216\"}.ivu-icon-ios-locate:before{content:\"\\f217\"}.ivu-icon-ios-lock-outline:before{content:\"\\f218\"}.ivu-icon-ios-lock:before{content:\"\\f219\"}.ivu-icon-ios-log-in:before{content:\"\\f21a\"}.ivu-icon-ios-log-out:before{content:\"\\f21b\"}.ivu-icon-ios-magnet-outline:before{content:\"\\f21c\"}.ivu-icon-ios-magnet:before{content:\"\\f21d\"}.ivu-icon-ios-mail-open-outline:before{content:\"\\f21e\"}.ivu-icon-ios-mail-open:before{content:\"\\f21f\"}.ivu-icon-ios-mail-outline:before{content:\"\\f220\"}.ivu-icon-ios-mail:before{content:\"\\f221\"}.ivu-icon-ios-male:before{content:\"\\f222\"}.ivu-icon-ios-man-outline:before{content:\"\\f223\"}.ivu-icon-ios-man:before{content:\"\\f224\"}.ivu-icon-ios-map-outline:before{content:\"\\f225\"}.ivu-icon-ios-map:before{content:\"\\f226\"}.ivu-icon-ios-medal-outline:before{content:\"\\f227\"}.ivu-icon-ios-medal:before{content:\"\\f228\"}.ivu-icon-ios-medical-outline:before{content:\"\\f229\"}.ivu-icon-ios-medical:before{content:\"\\f22a\"}.ivu-icon-ios-medkit-outline:before{content:\"\\f22b\"}.ivu-icon-ios-medkit:before{content:\"\\f22c\"}.ivu-icon-ios-megaphone-outline:before{content:\"\\f22d\"}.ivu-icon-ios-megaphone:before{content:\"\\f22e\"}.ivu-icon-ios-menu-outline:before{content:\"\\f22f\"}.ivu-icon-ios-menu:before{content:\"\\f230\"}.ivu-icon-ios-mic-off-outline:before{content:\"\\f231\"}.ivu-icon-ios-mic-off:before{content:\"\\f232\"}.ivu-icon-ios-mic-outline:before{content:\"\\f233\"}.ivu-icon-ios-mic:before{content:\"\\f234\"}.ivu-icon-ios-microphone-outline:before{content:\"\\f235\"}.ivu-icon-ios-microphone:before{content:\"\\f236\"}.ivu-icon-ios-moon-outline:before{content:\"\\f237\"}.ivu-icon-ios-moon:before{content:\"\\f238\"}.ivu-icon-ios-more-outline:before{content:\"\\f239\"}.ivu-icon-ios-more:before{content:\"\\f23a\"}.ivu-icon-ios-move:before{content:\"\\f23b\"}.ivu-icon-ios-musical-note-outline:before{content:\"\\f23c\"}.ivu-icon-ios-musical-note:before{content:\"\\f23d\"}.ivu-icon-ios-musical-notes-outline:before{content:\"\\f23e\"}.ivu-icon-ios-musical-notes:before{content:\"\\f23f\"}.ivu-icon-ios-navigate-outline:before{content:\"\\f240\"}.ivu-icon-ios-navigate:before{content:\"\\f241\"}.ivu-icon-ios-no-smoking-outline:before{content:\"\\f242\"}.ivu-icon-ios-no-smoking:before{content:\"\\f243\"}.ivu-icon-ios-notifications-off-outline:before{content:\"\\f244\"}.ivu-icon-ios-notifications-off:before{content:\"\\f245\"}.ivu-icon-ios-notifications-outline:before{content:\"\\f246\"}.ivu-icon-ios-notifications:before{content:\"\\f247\"}.ivu-icon-ios-nuclear-outline:before{content:\"\\f248\"}.ivu-icon-ios-nuclear:before{content:\"\\f249\"}.ivu-icon-ios-nutrition-outline:before{content:\"\\f24a\"}.ivu-icon-ios-nutrition:before{content:\"\\f24b\"}.ivu-icon-ios-open-outline:before{content:\"\\f24c\"}.ivu-icon-ios-open:before{content:\"\\f24d\"}.ivu-icon-ios-options-outline:before{content:\"\\f24e\"}.ivu-icon-ios-options:before{content:\"\\f24f\"}.ivu-icon-ios-outlet-outline:before{content:\"\\f250\"}.ivu-icon-ios-outlet:before{content:\"\\f251\"}.ivu-icon-ios-paper-outline:before{content:\"\\f252\"}.ivu-icon-ios-paper-plane-outline:before{content:\"\\f253\"}.ivu-icon-ios-paper-plane:before{content:\"\\f254\"}.ivu-icon-ios-paper:before{content:\"\\f255\"}.ivu-icon-ios-partly-sunny-outline:before{content:\"\\f256\"}.ivu-icon-ios-partly-sunny:before{content:\"\\f257\"}.ivu-icon-ios-pause-outline:before{content:\"\\f258\"}.ivu-icon-ios-pause:before{content:\"\\f259\"}.ivu-icon-ios-paw-outline:before{content:\"\\f25a\"}.ivu-icon-ios-paw:before{content:\"\\f25b\"}.ivu-icon-ios-people-outline:before{content:\"\\f25c\"}.ivu-icon-ios-people:before{content:\"\\f25d\"}.ivu-icon-ios-person-add-outline:before{content:\"\\f25e\"}.ivu-icon-ios-person-add:before{content:\"\\f25f\"}.ivu-icon-ios-person-outline:before{content:\"\\f260\"}.ivu-icon-ios-person:before{content:\"\\f261\"}.ivu-icon-ios-phone-landscape:before{content:\"\\f262\"}.ivu-icon-ios-phone-portrait:before{content:\"\\f263\"}.ivu-icon-ios-photos-outline:before{content:\"\\f264\"}.ivu-icon-ios-photos:before{content:\"\\f265\"}.ivu-icon-ios-pie-outline:before{content:\"\\f266\"}.ivu-icon-ios-pie:before{content:\"\\f267\"}.ivu-icon-ios-pin-outline:before{content:\"\\f268\"}.ivu-icon-ios-pin:before{content:\"\\f269\"}.ivu-icon-ios-pint-outline:before{content:\"\\f26a\"}.ivu-icon-ios-pint:before{content:\"\\f26b\"}.ivu-icon-ios-pizza-outline:before{content:\"\\f26c\"}.ivu-icon-ios-pizza:before{content:\"\\f26d\"}.ivu-icon-ios-plane-outline:before{content:\"\\f26e\"}.ivu-icon-ios-plane:before{content:\"\\f26f\"}.ivu-icon-ios-planet-outline:before{content:\"\\f270\"}.ivu-icon-ios-planet:before{content:\"\\f271\"}.ivu-icon-ios-play-outline:before{content:\"\\f272\"}.ivu-icon-ios-play:before{content:\"\\f273\"}.ivu-icon-ios-podium-outline:before{content:\"\\f274\"}.ivu-icon-ios-podium:before{content:\"\\f275\"}.ivu-icon-ios-power-outline:before{content:\"\\f276\"}.ivu-icon-ios-power:before{content:\"\\f277\"}.ivu-icon-ios-pricetag-outline:before{content:\"\\f278\"}.ivu-icon-ios-pricetag:before{content:\"\\f279\"}.ivu-icon-ios-pricetags-outline:before{content:\"\\f27a\"}.ivu-icon-ios-pricetags:before{content:\"\\f27b\"}.ivu-icon-ios-print-outline:before{content:\"\\f27c\"}.ivu-icon-ios-print:before{content:\"\\f27d\"}.ivu-icon-ios-pulse-outline:before{content:\"\\f27e\"}.ivu-icon-ios-pulse:before{content:\"\\f27f\"}.ivu-icon-ios-qr-scanner:before{content:\"\\f280\"}.ivu-icon-ios-quote-outline:before{content:\"\\f281\"}.ivu-icon-ios-quote:before{content:\"\\f282\"}.ivu-icon-ios-radio-button-off:before{content:\"\\f283\"}.ivu-icon-ios-radio-button-on:before{content:\"\\f284\"}.ivu-icon-ios-radio-outline:before{content:\"\\f285\"}.ivu-icon-ios-radio:before{content:\"\\f286\"}.ivu-icon-ios-rainy-outline:before{content:\"\\f287\"}.ivu-icon-ios-rainy:before{content:\"\\f288\"}.ivu-icon-ios-recording-outline:before{content:\"\\f289\"}.ivu-icon-ios-recording:before{content:\"\\f28a\"}.ivu-icon-ios-redo-outline:before{content:\"\\f28b\"}.ivu-icon-ios-redo:before{content:\"\\f28c\"}.ivu-icon-ios-refresh-circle-outline:before{content:\"\\f28d\"}.ivu-icon-ios-refresh-circle:before{content:\"\\f28e\"}.ivu-icon-ios-refresh:before{content:\"\\f28f\"}.ivu-icon-ios-remove-circle-outline:before{content:\"\\f290\"}.ivu-icon-ios-remove-circle:before{content:\"\\f291\"}.ivu-icon-ios-remove:before{content:\"\\f292\"}.ivu-icon-ios-reorder:before{content:\"\\f293\"}.ivu-icon-ios-repeat:before{content:\"\\f294\"}.ivu-icon-ios-resize:before{content:\"\\f295\"}.ivu-icon-ios-restaurant-outline:before{content:\"\\f296\"}.ivu-icon-ios-restaurant:before{content:\"\\f297\"}.ivu-icon-ios-return-left:before{content:\"\\f298\"}.ivu-icon-ios-return-right:before{content:\"\\f299\"}.ivu-icon-ios-reverse-camera-outline:before{content:\"\\f29a\"}.ivu-icon-ios-reverse-camera:before{content:\"\\f29b\"}.ivu-icon-ios-rewind-outline:before{content:\"\\f29c\"}.ivu-icon-ios-rewind:before{content:\"\\f29d\"}.ivu-icon-ios-ribbon-outline:before{content:\"\\f29e\"}.ivu-icon-ios-ribbon:before{content:\"\\f29f\"}.ivu-icon-ios-rose-outline:before{content:\"\\f2a0\"}.ivu-icon-ios-rose:before{content:\"\\f2a1\"}.ivu-icon-ios-sad-outline:before{content:\"\\f2a2\"}.ivu-icon-ios-sad:before{content:\"\\f2a3\"}.ivu-icon-ios-school-outline:before{content:\"\\f2a4\"}.ivu-icon-ios-school:before{content:\"\\f2a5\"}.ivu-icon-ios-search-outline:before{content:\"\\f2a6\"}.ivu-icon-ios-search:before{content:\"\\f2a7\"}.ivu-icon-ios-send-outline:before{content:\"\\f2a8\"}.ivu-icon-ios-send:before{content:\"\\f2a9\"}.ivu-icon-ios-settings-outline:before{content:\"\\f2aa\"}.ivu-icon-ios-settings:before{content:\"\\f2ab\"}.ivu-icon-ios-share-alt-outline:before{content:\"\\f2ac\"}.ivu-icon-ios-share-alt:before{content:\"\\f2ad\"}.ivu-icon-ios-share-outline:before{content:\"\\f2ae\"}.ivu-icon-ios-share:before{content:\"\\f2af\"}.ivu-icon-ios-shirt-outline:before{content:\"\\f2b0\"}.ivu-icon-ios-shirt:before{content:\"\\f2b1\"}.ivu-icon-ios-shuffle:before{content:\"\\f2b2\"}.ivu-icon-ios-skip-backward-outline:before{content:\"\\f2b3\"}.ivu-icon-ios-skip-backward:before{content:\"\\f2b4\"}.ivu-icon-ios-skip-forward-outline:before{content:\"\\f2b5\"}.ivu-icon-ios-skip-forward:before{content:\"\\f2b6\"}.ivu-icon-ios-snow-outline:before{content:\"\\f2b7\"}.ivu-icon-ios-snow:before{content:\"\\f2b8\"}.ivu-icon-ios-speedometer-outline:before{content:\"\\f2b9\"}.ivu-icon-ios-speedometer:before{content:\"\\f2ba\"}.ivu-icon-ios-square-outline:before{content:\"\\f2bb\"}.ivu-icon-ios-square:before{content:\"\\f2bc\"}.ivu-icon-ios-star-half:before{content:\"\\f2bd\"}.ivu-icon-ios-star-outline:before{content:\"\\f2be\"}.ivu-icon-ios-star:before{content:\"\\f2bf\"}.ivu-icon-ios-stats-outline:before{content:\"\\f2c0\"}.ivu-icon-ios-stats:before{content:\"\\f2c1\"}.ivu-icon-ios-stopwatch-outline:before{content:\"\\f2c2\"}.ivu-icon-ios-stopwatch:before{content:\"\\f2c3\"}.ivu-icon-ios-subway-outline:before{content:\"\\f2c4\"}.ivu-icon-ios-subway:before{content:\"\\f2c5\"}.ivu-icon-ios-sunny-outline:before{content:\"\\f2c6\"}.ivu-icon-ios-sunny:before{content:\"\\f2c7\"}.ivu-icon-ios-swap:before{content:\"\\f2c8\"}.ivu-icon-ios-switch-outline:before{content:\"\\f2c9\"}.ivu-icon-ios-switch:before{content:\"\\f2ca\"}.ivu-icon-ios-sync:before{content:\"\\f2cb\"}.ivu-icon-ios-tablet-landscape:before{content:\"\\f2cc\"}.ivu-icon-ios-tablet-portrait:before{content:\"\\f2cd\"}.ivu-icon-ios-tennisball-outline:before{content:\"\\f2ce\"}.ivu-icon-ios-tennisball:before{content:\"\\f2cf\"}.ivu-icon-ios-text-outline:before{content:\"\\f2d0\"}.ivu-icon-ios-text:before{content:\"\\f2d1\"}.ivu-icon-ios-thermometer-outline:before{content:\"\\f2d2\"}.ivu-icon-ios-thermometer:before{content:\"\\f2d3\"}.ivu-icon-ios-thumbs-down-outline:before{content:\"\\f2d4\"}.ivu-icon-ios-thumbs-down:before{content:\"\\f2d5\"}.ivu-icon-ios-thumbs-up-outline:before{content:\"\\f2d6\"}.ivu-icon-ios-thumbs-up:before{content:\"\\f2d7\"}.ivu-icon-ios-thunderstorm-outline:before{content:\"\\f2d8\"}.ivu-icon-ios-thunderstorm:before{content:\"\\f2d9\"}.ivu-icon-ios-time-outline:before{content:\"\\f2da\"}.ivu-icon-ios-time:before{content:\"\\f2db\"}.ivu-icon-ios-timer-outline:before{content:\"\\f2dc\"}.ivu-icon-ios-timer:before{content:\"\\f2dd\"}.ivu-icon-ios-train-outline:before{content:\"\\f2de\"}.ivu-icon-ios-train:before{content:\"\\f2df\"}.ivu-icon-ios-transgender:before{content:\"\\f2e0\"}.ivu-icon-ios-trash-outline:before{content:\"\\f2e1\"}.ivu-icon-ios-trash:before{content:\"\\f2e2\"}.ivu-icon-ios-trending-down:before{content:\"\\f2e3\"}.ivu-icon-ios-trending-up:before{content:\"\\f2e4\"}.ivu-icon-ios-trophy-outline:before{content:\"\\f2e5\"}.ivu-icon-ios-trophy:before{content:\"\\f2e6\"}.ivu-icon-ios-umbrella-outline:before{content:\"\\f2e7\"}.ivu-icon-ios-umbrella:before{content:\"\\f2e8\"}.ivu-icon-ios-undo-outline:before{content:\"\\f2e9\"}.ivu-icon-ios-undo:before{content:\"\\f2ea\"}.ivu-icon-ios-unlock-outline:before{content:\"\\f2eb\"}.ivu-icon-ios-unlock:before{content:\"\\f2ec\"}.ivu-icon-ios-videocam-outline:before{content:\"\\f2ed\"}.ivu-icon-ios-videocam:before{content:\"\\f2ee\"}.ivu-icon-ios-volume-down:before{content:\"\\f2ef\"}.ivu-icon-ios-volume-mute:before{content:\"\\f2f0\"}.ivu-icon-ios-volume-off:before{content:\"\\f2f1\"}.ivu-icon-ios-volume-up:before{content:\"\\f2f2\"}.ivu-icon-ios-walk:before{content:\"\\f2f3\"}.ivu-icon-ios-warning-outline:before{content:\"\\f2f4\"}.ivu-icon-ios-warning:before{content:\"\\f2f5\"}.ivu-icon-ios-watch:before{content:\"\\f2f6\"}.ivu-icon-ios-water-outline:before{content:\"\\f2f7\"}.ivu-icon-ios-water:before{content:\"\\f2f8\"}.ivu-icon-ios-wifi-outline:before{content:\"\\f2f9\"}.ivu-icon-ios-wifi:before{content:\"\\f2fa\"}.ivu-icon-ios-wine-outline:before{content:\"\\f2fb\"}.ivu-icon-ios-wine:before{content:\"\\f2fc\"}.ivu-icon-ios-woman-outline:before{content:\"\\f2fd\"}.ivu-icon-ios-woman:before{content:\"\\f2fe\"}.ivu-icon-logo-android:before{content:\"\\f2ff\"}.ivu-icon-logo-angular:before{content:\"\\f300\"}.ivu-icon-logo-apple:before{content:\"\\f301\"}.ivu-icon-logo-bitcoin:before{content:\"\\f302\"}.ivu-icon-logo-buffer:before{content:\"\\f303\"}.ivu-icon-logo-chrome:before{content:\"\\f304\"}.ivu-icon-logo-codepen:before{content:\"\\f305\"}.ivu-icon-logo-css3:before{content:\"\\f306\"}.ivu-icon-logo-designernews:before{content:\"\\f307\"}.ivu-icon-logo-dribbble:before{content:\"\\f308\"}.ivu-icon-logo-dropbox:before{content:\"\\f309\"}.ivu-icon-logo-euro:before{content:\"\\f30a\"}.ivu-icon-logo-facebook:before{content:\"\\f30b\"}.ivu-icon-logo-foursquare:before{content:\"\\f30c\"}.ivu-icon-logo-freebsd-devil:before{content:\"\\f30d\"}.ivu-icon-logo-github:before{content:\"\\f30e\"}.ivu-icon-logo-google:before{content:\"\\f30f\"}.ivu-icon-logo-googleplus:before{content:\"\\f310\"}.ivu-icon-logo-hackernews:before{content:\"\\f311\"}.ivu-icon-logo-html5:before{content:\"\\f312\"}.ivu-icon-logo-instagram:before{content:\"\\f313\"}.ivu-icon-logo-javascript:before{content:\"\\f314\"}.ivu-icon-logo-linkedin:before{content:\"\\f315\"}.ivu-icon-logo-markdown:before{content:\"\\f316\"}.ivu-icon-logo-nodejs:before{content:\"\\f317\"}.ivu-icon-logo-octocat:before{content:\"\\f318\"}.ivu-icon-logo-pinterest:before{content:\"\\f319\"}.ivu-icon-logo-playstation:before{content:\"\\f31a\"}.ivu-icon-logo-python:before{content:\"\\f31b\"}.ivu-icon-logo-reddit:before{content:\"\\f31c\"}.ivu-icon-logo-rss:before{content:\"\\f31d\"}.ivu-icon-logo-sass:before{content:\"\\f31e\"}.ivu-icon-logo-skype:before{content:\"\\f31f\"}.ivu-icon-logo-snapchat:before{content:\"\\f320\"}.ivu-icon-logo-steam:before{content:\"\\f321\"}.ivu-icon-logo-tumblr:before{content:\"\\f322\"}.ivu-icon-logo-tux:before{content:\"\\f323\"}.ivu-icon-logo-twitch:before{content:\"\\f324\"}.ivu-icon-logo-twitter:before{content:\"\\f325\"}.ivu-icon-logo-usd:before{content:\"\\f326\"}.ivu-icon-logo-vimeo:before{content:\"\\f327\"}.ivu-icon-logo-whatsapp:before{content:\"\\f328\"}.ivu-icon-logo-windows:before{content:\"\\f329\"}.ivu-icon-logo-wordpress:before{content:\"\\f32a\"}.ivu-icon-logo-xbox:before{content:\"\\f32b\"}.ivu-icon-logo-yahoo:before{content:\"\\f32c\"}.ivu-icon-logo-yen:before{content:\"\\f32d\"}.ivu-icon-logo-youtube:before{content:\"\\f32e\"}.ivu-icon-md-add-circle:before{content:\"\\f32f\"}.ivu-icon-md-add:before{content:\"\\f330\"}.ivu-icon-md-alarm:before{content:\"\\f331\"}.ivu-icon-md-albums:before{content:\"\\f332\"}.ivu-icon-md-alert:before{content:\"\\f333\"}.ivu-icon-md-american-football:before{content:\"\\f334\"}.ivu-icon-md-analytics:before{content:\"\\f335\"}.ivu-icon-md-aperture:before{content:\"\\f336\"}.ivu-icon-md-apps:before{content:\"\\f337\"}.ivu-icon-md-appstore:before{content:\"\\f338\"}.ivu-icon-md-archive:before{content:\"\\f339\"}.ivu-icon-md-arrow-back:before{content:\"\\f33a\"}.ivu-icon-md-arrow-down:before{content:\"\\f33b\"}.ivu-icon-md-arrow-dropdown-circle:before{content:\"\\f33c\"}.ivu-icon-md-arrow-dropdown:before{content:\"\\f33d\"}.ivu-icon-md-arrow-dropleft-circle:before{content:\"\\f33e\"}.ivu-icon-md-arrow-dropleft:before{content:\"\\f33f\"}.ivu-icon-md-arrow-dropright-circle:before{content:\"\\f340\"}.ivu-icon-md-arrow-dropright:before{content:\"\\f341\"}.ivu-icon-md-arrow-dropup-circle:before{content:\"\\f342\"}.ivu-icon-md-arrow-dropup:before{content:\"\\f343\"}.ivu-icon-md-arrow-forward:before{content:\"\\f344\"}.ivu-icon-md-arrow-round-back:before{content:\"\\f345\"}.ivu-icon-md-arrow-round-down:before{content:\"\\f346\"}.ivu-icon-md-arrow-round-forward:before{content:\"\\f347\"}.ivu-icon-md-arrow-round-up:before{content:\"\\f348\"}.ivu-icon-md-arrow-up:before{content:\"\\f349\"}.ivu-icon-md-at:before{content:\"\\f34a\"}.ivu-icon-md-attach:before{content:\"\\f34b\"}.ivu-icon-md-backspace:before{content:\"\\f34c\"}.ivu-icon-md-barcode:before{content:\"\\f34d\"}.ivu-icon-md-baseball:before{content:\"\\f34e\"}.ivu-icon-md-basket:before{content:\"\\f34f\"}.ivu-icon-md-basketball:before{content:\"\\f350\"}.ivu-icon-md-battery-charging:before{content:\"\\f351\"}.ivu-icon-md-battery-dead:before{content:\"\\f352\"}.ivu-icon-md-battery-full:before{content:\"\\f353\"}.ivu-icon-md-beaker:before{content:\"\\f354\"}.ivu-icon-md-beer:before{content:\"\\f355\"}.ivu-icon-md-bicycle:before{content:\"\\f356\"}.ivu-icon-md-bluetooth:before{content:\"\\f357\"}.ivu-icon-md-boat:before{content:\"\\f358\"}.ivu-icon-md-body:before{content:\"\\f359\"}.ivu-icon-md-bonfire:before{content:\"\\f35a\"}.ivu-icon-md-book:before{content:\"\\f35b\"}.ivu-icon-md-bookmark:before{content:\"\\f35c\"}.ivu-icon-md-bookmarks:before{content:\"\\f35d\"}.ivu-icon-md-bowtie:before{content:\"\\f35e\"}.ivu-icon-md-briefcase:before{content:\"\\f35f\"}.ivu-icon-md-browsers:before{content:\"\\f360\"}.ivu-icon-md-brush:before{content:\"\\f361\"}.ivu-icon-md-bug:before{content:\"\\f362\"}.ivu-icon-md-build:before{content:\"\\f363\"}.ivu-icon-md-bulb:before{content:\"\\f364\"}.ivu-icon-md-bus:before{content:\"\\f365\"}.ivu-icon-md-cafe:before{content:\"\\f366\"}.ivu-icon-md-calculator:before{content:\"\\f367\"}.ivu-icon-md-calendar:before{content:\"\\f368\"}.ivu-icon-md-call:before{content:\"\\f369\"}.ivu-icon-md-camera:before{content:\"\\f36a\"}.ivu-icon-md-car:before{content:\"\\f36b\"}.ivu-icon-md-card:before{content:\"\\f36c\"}.ivu-icon-md-cart:before{content:\"\\f36d\"}.ivu-icon-md-cash:before{content:\"\\f36e\"}.ivu-icon-md-chatboxes:before{content:\"\\f36f\"}.ivu-icon-md-chatbubbles:before{content:\"\\f370\"}.ivu-icon-md-checkbox-outline:before{content:\"\\f371\"}.ivu-icon-md-checkbox:before{content:\"\\f372\"}.ivu-icon-md-checkmark-circle-outline:before{content:\"\\f373\"}.ivu-icon-md-checkmark-circle:before{content:\"\\f374\"}.ivu-icon-md-checkmark:before{content:\"\\f375\"}.ivu-icon-md-clipboard:before{content:\"\\f376\"}.ivu-icon-md-clock:before{content:\"\\f377\"}.ivu-icon-md-close-circle:before{content:\"\\f378\"}.ivu-icon-md-close:before{content:\"\\f379\"}.ivu-icon-md-closed-captioning:before{content:\"\\f37a\"}.ivu-icon-md-cloud-circle:before{content:\"\\f37b\"}.ivu-icon-md-cloud-done:before{content:\"\\f37c\"}.ivu-icon-md-cloud-download:before{content:\"\\f37d\"}.ivu-icon-md-cloud-outline:before{content:\"\\f37e\"}.ivu-icon-md-cloud-upload:before{content:\"\\f37f\"}.ivu-icon-md-cloud:before{content:\"\\f380\"}.ivu-icon-md-cloudy-night:before{content:\"\\f381\"}.ivu-icon-md-cloudy:before{content:\"\\f382\"}.ivu-icon-md-code-download:before{content:\"\\f383\"}.ivu-icon-md-code-working:before{content:\"\\f384\"}.ivu-icon-md-code:before{content:\"\\f385\"}.ivu-icon-md-cog:before{content:\"\\f386\"}.ivu-icon-md-color-fill:before{content:\"\\f387\"}.ivu-icon-md-color-filter:before{content:\"\\f388\"}.ivu-icon-md-color-palette:before{content:\"\\f389\"}.ivu-icon-md-color-wand:before{content:\"\\f38a\"}.ivu-icon-md-compass:before{content:\"\\f38b\"}.ivu-icon-md-construct:before{content:\"\\f38c\"}.ivu-icon-md-contact:before{content:\"\\f38d\"}.ivu-icon-md-contacts:before{content:\"\\f38e\"}.ivu-icon-md-contract:before{content:\"\\f38f\"}.ivu-icon-md-contrast:before{content:\"\\f390\"}.ivu-icon-md-copy:before{content:\"\\f391\"}.ivu-icon-md-create:before{content:\"\\f392\"}.ivu-icon-md-crop:before{content:\"\\f393\"}.ivu-icon-md-cube:before{content:\"\\f394\"}.ivu-icon-md-cut:before{content:\"\\f395\"}.ivu-icon-md-desktop:before{content:\"\\f396\"}.ivu-icon-md-disc:before{content:\"\\f397\"}.ivu-icon-md-document:before{content:\"\\f398\"}.ivu-icon-md-done-all:before{content:\"\\f399\"}.ivu-icon-md-download:before{content:\"\\f39a\"}.ivu-icon-md-easel:before{content:\"\\f39b\"}.ivu-icon-md-egg:before{content:\"\\f39c\"}.ivu-icon-md-exit:before{content:\"\\f39d\"}.ivu-icon-md-expand:before{content:\"\\f39e\"}.ivu-icon-md-eye-off:before{content:\"\\f39f\"}.ivu-icon-md-eye:before{content:\"\\f3a0\"}.ivu-icon-md-fastforward:before{content:\"\\f3a1\"}.ivu-icon-md-female:before{content:\"\\f3a2\"}.ivu-icon-md-filing:before{content:\"\\f3a3\"}.ivu-icon-md-film:before{content:\"\\f3a4\"}.ivu-icon-md-finger-print:before{content:\"\\f3a5\"}.ivu-icon-md-flag:before{content:\"\\f3a6\"}.ivu-icon-md-flame:before{content:\"\\f3a7\"}.ivu-icon-md-flash:before{content:\"\\f3a8\"}.ivu-icon-md-flask:before{content:\"\\f3a9\"}.ivu-icon-md-flower:before{content:\"\\f3aa\"}.ivu-icon-md-folder-open:before{content:\"\\f3ab\"}.ivu-icon-md-folder:before{content:\"\\f3ac\"}.ivu-icon-md-football:before{content:\"\\f3ad\"}.ivu-icon-md-funnel:before{content:\"\\f3ae\"}.ivu-icon-md-game-controller-a:before{content:\"\\f3af\"}.ivu-icon-md-game-controller-b:before{content:\"\\f3b0\"}.ivu-icon-md-git-branch:before{content:\"\\f3b1\"}.ivu-icon-md-git-commit:before{content:\"\\f3b2\"}.ivu-icon-md-git-compare:before{content:\"\\f3b3\"}.ivu-icon-md-git-merge:before{content:\"\\f3b4\"}.ivu-icon-md-git-network:before{content:\"\\f3b5\"}.ivu-icon-md-git-pull-request:before{content:\"\\f3b6\"}.ivu-icon-md-glasses:before{content:\"\\f3b7\"}.ivu-icon-md-globe:before{content:\"\\f3b8\"}.ivu-icon-md-grid:before{content:\"\\f3b9\"}.ivu-icon-md-hammer:before{content:\"\\f3ba\"}.ivu-icon-md-hand:before{content:\"\\f3bb\"}.ivu-icon-md-happy:before{content:\"\\f3bc\"}.ivu-icon-md-headset:before{content:\"\\f3bd\"}.ivu-icon-md-heart-outline:before{content:\"\\f3be\"}.ivu-icon-md-heart:before{content:\"\\f3bf\"}.ivu-icon-md-help-buoy:before{content:\"\\f3c0\"}.ivu-icon-md-help-circle:before{content:\"\\f3c1\"}.ivu-icon-md-help:before{content:\"\\f3c2\"}.ivu-icon-md-home:before{content:\"\\f3c3\"}.ivu-icon-md-ice-cream:before{content:\"\\f3c4\"}.ivu-icon-md-image:before{content:\"\\f3c5\"}.ivu-icon-md-images:before{content:\"\\f3c6\"}.ivu-icon-md-infinite:before{content:\"\\f3c7\"}.ivu-icon-md-information-circle:before{content:\"\\f3c8\"}.ivu-icon-md-information:before{content:\"\\f3c9\"}.ivu-icon-md-ionic:before{content:\"\\f3ca\"}.ivu-icon-md-ionitron:before{content:\"\\f3cb\"}.ivu-icon-md-jet:before{content:\"\\f3cc\"}.ivu-icon-md-key:before{content:\"\\f3cd\"}.ivu-icon-md-keypad:before{content:\"\\f3ce\"}.ivu-icon-md-laptop:before{content:\"\\f3cf\"}.ivu-icon-md-leaf:before{content:\"\\f3d0\"}.ivu-icon-md-link:before{content:\"\\f3d1\"}.ivu-icon-md-list-box:before{content:\"\\f3d2\"}.ivu-icon-md-list:before{content:\"\\f3d3\"}.ivu-icon-md-locate:before{content:\"\\f3d4\"}.ivu-icon-md-lock:before{content:\"\\f3d5\"}.ivu-icon-md-log-in:before{content:\"\\f3d6\"}.ivu-icon-md-log-out:before{content:\"\\f3d7\"}.ivu-icon-md-magnet:before{content:\"\\f3d8\"}.ivu-icon-md-mail-open:before{content:\"\\f3d9\"}.ivu-icon-md-mail:before{content:\"\\f3da\"}.ivu-icon-md-male:before{content:\"\\f3db\"}.ivu-icon-md-man:before{content:\"\\f3dc\"}.ivu-icon-md-map:before{content:\"\\f3dd\"}.ivu-icon-md-medal:before{content:\"\\f3de\"}.ivu-icon-md-medical:before{content:\"\\f3df\"}.ivu-icon-md-medkit:before{content:\"\\f3e0\"}.ivu-icon-md-megaphone:before{content:\"\\f3e1\"}.ivu-icon-md-menu:before{content:\"\\f3e2\"}.ivu-icon-md-mic-off:before{content:\"\\f3e3\"}.ivu-icon-md-mic:before{content:\"\\f3e4\"}.ivu-icon-md-microphone:before{content:\"\\f3e5\"}.ivu-icon-md-moon:before{content:\"\\f3e6\"}.ivu-icon-md-more:before{content:\"\\f3e7\"}.ivu-icon-md-move:before{content:\"\\f3e8\"}.ivu-icon-md-musical-note:before{content:\"\\f3e9\"}.ivu-icon-md-musical-notes:before{content:\"\\f3ea\"}.ivu-icon-md-navigate:before{content:\"\\f3eb\"}.ivu-icon-md-no-smoking:before{content:\"\\f3ec\"}.ivu-icon-md-notifications-off:before{content:\"\\f3ed\"}.ivu-icon-md-notifications-outline:before{content:\"\\f3ee\"}.ivu-icon-md-notifications:before{content:\"\\f3ef\"}.ivu-icon-md-nuclear:before{content:\"\\f3f0\"}.ivu-icon-md-nutrition:before{content:\"\\f3f1\"}.ivu-icon-md-open:before{content:\"\\f3f2\"}.ivu-icon-md-options:before{content:\"\\f3f3\"}.ivu-icon-md-outlet:before{content:\"\\f3f4\"}.ivu-icon-md-paper-plane:before{content:\"\\f3f5\"}.ivu-icon-md-paper:before{content:\"\\f3f6\"}.ivu-icon-md-partly-sunny:before{content:\"\\f3f7\"}.ivu-icon-md-pause:before{content:\"\\f3f8\"}.ivu-icon-md-paw:before{content:\"\\f3f9\"}.ivu-icon-md-people:before{content:\"\\f3fa\"}.ivu-icon-md-person-add:before{content:\"\\f3fb\"}.ivu-icon-md-person:before{content:\"\\f3fc\"}.ivu-icon-md-phone-landscape:before{content:\"\\f3fd\"}.ivu-icon-md-phone-portrait:before{content:\"\\f3fe\"}.ivu-icon-md-photos:before{content:\"\\f3ff\"}.ivu-icon-md-pie:before{content:\"\\f400\"}.ivu-icon-md-pin:before{content:\"\\f401\"}.ivu-icon-md-pint:before{content:\"\\f402\"}.ivu-icon-md-pizza:before{content:\"\\f403\"}.ivu-icon-md-plane:before{content:\"\\f404\"}.ivu-icon-md-planet:before{content:\"\\f405\"}.ivu-icon-md-play:before{content:\"\\f406\"}.ivu-icon-md-podium:before{content:\"\\f407\"}.ivu-icon-md-power:before{content:\"\\f408\"}.ivu-icon-md-pricetag:before{content:\"\\f409\"}.ivu-icon-md-pricetags:before{content:\"\\f40a\"}.ivu-icon-md-print:before{content:\"\\f40b\"}.ivu-icon-md-pulse:before{content:\"\\f40c\"}.ivu-icon-md-qr-scanner:before{content:\"\\f40d\"}.ivu-icon-md-quote:before{content:\"\\f40e\"}.ivu-icon-md-radio-button-off:before{content:\"\\f40f\"}.ivu-icon-md-radio-button-on:before{content:\"\\f410\"}.ivu-icon-md-radio:before{content:\"\\f411\"}.ivu-icon-md-rainy:before{content:\"\\f412\"}.ivu-icon-md-recording:before{content:\"\\f413\"}.ivu-icon-md-redo:before{content:\"\\f414\"}.ivu-icon-md-refresh-circle:before{content:\"\\f415\"}.ivu-icon-md-refresh:before{content:\"\\f416\"}.ivu-icon-md-remove-circle:before{content:\"\\f417\"}.ivu-icon-md-remove:before{content:\"\\f418\"}.ivu-icon-md-reorder:before{content:\"\\f419\"}.ivu-icon-md-repeat:before{content:\"\\f41a\"}.ivu-icon-md-resize:before{content:\"\\f41b\"}.ivu-icon-md-restaurant:before{content:\"\\f41c\"}.ivu-icon-md-return-left:before{content:\"\\f41d\"}.ivu-icon-md-return-right:before{content:\"\\f41e\"}.ivu-icon-md-reverse-camera:before{content:\"\\f41f\"}.ivu-icon-md-rewind:before{content:\"\\f420\"}.ivu-icon-md-ribbon:before{content:\"\\f421\"}.ivu-icon-md-rose:before{content:\"\\f422\"}.ivu-icon-md-sad:before{content:\"\\f423\"}.ivu-icon-md-school:before{content:\"\\f424\"}.ivu-icon-md-search:before{content:\"\\f425\"}.ivu-icon-md-send:before{content:\"\\f426\"}.ivu-icon-md-settings:before{content:\"\\f427\"}.ivu-icon-md-share-alt:before{content:\"\\f428\"}.ivu-icon-md-share:before{content:\"\\f429\"}.ivu-icon-md-shirt:before{content:\"\\f42a\"}.ivu-icon-md-shuffle:before{content:\"\\f42b\"}.ivu-icon-md-skip-backward:before{content:\"\\f42c\"}.ivu-icon-md-skip-forward:before{content:\"\\f42d\"}.ivu-icon-md-snow:before{content:\"\\f42e\"}.ivu-icon-md-speedometer:before{content:\"\\f42f\"}.ivu-icon-md-square-outline:before{content:\"\\f430\"}.ivu-icon-md-square:before{content:\"\\f431\"}.ivu-icon-md-star-half:before{content:\"\\f432\"}.ivu-icon-md-star-outline:before{content:\"\\f433\"}.ivu-icon-md-star:before{content:\"\\f434\"}.ivu-icon-md-stats:before{content:\"\\f435\"}.ivu-icon-md-stopwatch:before{content:\"\\f436\"}.ivu-icon-md-subway:before{content:\"\\f437\"}.ivu-icon-md-sunny:before{content:\"\\f438\"}.ivu-icon-md-swap:before{content:\"\\f439\"}.ivu-icon-md-switch:before{content:\"\\f43a\"}.ivu-icon-md-sync:before{content:\"\\f43b\"}.ivu-icon-md-tablet-landscape:before{content:\"\\f43c\"}.ivu-icon-md-tablet-portrait:before{content:\"\\f43d\"}.ivu-icon-md-tennisball:before{content:\"\\f43e\"}.ivu-icon-md-text:before{content:\"\\f43f\"}.ivu-icon-md-thermometer:before{content:\"\\f440\"}.ivu-icon-md-thumbs-down:before{content:\"\\f441\"}.ivu-icon-md-thumbs-up:before{content:\"\\f442\"}.ivu-icon-md-thunderstorm:before{content:\"\\f443\"}.ivu-icon-md-time:before{content:\"\\f444\"}.ivu-icon-md-timer:before{content:\"\\f445\"}.ivu-icon-md-train:before{content:\"\\f446\"}.ivu-icon-md-transgender:before{content:\"\\f447\"}.ivu-icon-md-trash:before{content:\"\\f448\"}.ivu-icon-md-trending-down:before{content:\"\\f449\"}.ivu-icon-md-trending-up:before{content:\"\\f44a\"}.ivu-icon-md-trophy:before{content:\"\\f44b\"}.ivu-icon-md-umbrella:before{content:\"\\f44c\"}.ivu-icon-md-undo:before{content:\"\\f44d\"}.ivu-icon-md-unlock:before{content:\"\\f44e\"}.ivu-icon-md-videocam:before{content:\"\\f44f\"}.ivu-icon-md-volume-down:before{content:\"\\f450\"}.ivu-icon-md-volume-mute:before{content:\"\\f451\"}.ivu-icon-md-volume-off:before{content:\"\\f452\"}.ivu-icon-md-volume-up:before{content:\"\\f453\"}.ivu-icon-md-walk:before{content:\"\\f454\"}.ivu-icon-md-warning:before{content:\"\\f455\"}.ivu-icon-md-watch:before{content:\"\\f456\"}.ivu-icon-md-water:before{content:\"\\f457\"}.ivu-icon-md-wifi:before{content:\"\\f458\"}.ivu-icon-md-wine:before{content:\"\\f459\"}.ivu-icon-md-woman:before{content:\"\\f45a\"}.ivu-icon-ios-loading:before{content:\"\\f45b\"}.ivu-row{position:relative;margin-left:0;margin-right:0;height:auto;zoom:1;display:block}.ivu-row:after,.ivu-row:before{content:\"\";display:table}.ivu-row:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-row-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.ivu-row-flex:after,.ivu-row-flex:before{display:-webkit-box;display:-ms-flexbox;display:flex}.ivu-row-flex-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.ivu-row-flex-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ivu-row-flex-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.ivu-row-flex-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.ivu-row-flex-space-around{-ms-flex-pack:distribute;justify-content:space-around}.ivu-row-flex-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.ivu-row-flex-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-row-flex-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.ivu-col{position:relative;display:block}.ivu-col-span-1,.ivu-col-span-10,.ivu-col-span-11,.ivu-col-span-12,.ivu-col-span-13,.ivu-col-span-14,.ivu-col-span-15,.ivu-col-span-16,.ivu-col-span-17,.ivu-col-span-18,.ivu-col-span-19,.ivu-col-span-2,.ivu-col-span-20,.ivu-col-span-21,.ivu-col-span-22,.ivu-col-span-23,.ivu-col-span-24,.ivu-col-span-3,.ivu-col-span-4,.ivu-col-span-5,.ivu-col-span-6,.ivu-col-span-7,.ivu-col-span-8,.ivu-col-span-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-24{display:block;width:100%}.ivu-col-push-24{left:100%}.ivu-col-pull-24{right:100%}.ivu-col-offset-24{margin-left:100%}.ivu-col-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-23{display:block;width:95.83333333%}.ivu-col-push-23{left:95.83333333%}.ivu-col-pull-23{right:95.83333333%}.ivu-col-offset-23{margin-left:95.83333333%}.ivu-col-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-22{display:block;width:91.66666667%}.ivu-col-push-22{left:91.66666667%}.ivu-col-pull-22{right:91.66666667%}.ivu-col-offset-22{margin-left:91.66666667%}.ivu-col-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-21{display:block;width:87.5%}.ivu-col-push-21{left:87.5%}.ivu-col-pull-21{right:87.5%}.ivu-col-offset-21{margin-left:87.5%}.ivu-col-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-20{display:block;width:83.33333333%}.ivu-col-push-20{left:83.33333333%}.ivu-col-pull-20{right:83.33333333%}.ivu-col-offset-20{margin-left:83.33333333%}.ivu-col-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-19{display:block;width:79.16666667%}.ivu-col-push-19{left:79.16666667%}.ivu-col-pull-19{right:79.16666667%}.ivu-col-offset-19{margin-left:79.16666667%}.ivu-col-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-18{display:block;width:75%}.ivu-col-push-18{left:75%}.ivu-col-pull-18{right:75%}.ivu-col-offset-18{margin-left:75%}.ivu-col-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-17{display:block;width:70.83333333%}.ivu-col-push-17{left:70.83333333%}.ivu-col-pull-17{right:70.83333333%}.ivu-col-offset-17{margin-left:70.83333333%}.ivu-col-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-16{display:block;width:66.66666667%}.ivu-col-push-16{left:66.66666667%}.ivu-col-pull-16{right:66.66666667%}.ivu-col-offset-16{margin-left:66.66666667%}.ivu-col-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-15{display:block;width:62.5%}.ivu-col-push-15{left:62.5%}.ivu-col-pull-15{right:62.5%}.ivu-col-offset-15{margin-left:62.5%}.ivu-col-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-14{display:block;width:58.33333333%}.ivu-col-push-14{left:58.33333333%}.ivu-col-pull-14{right:58.33333333%}.ivu-col-offset-14{margin-left:58.33333333%}.ivu-col-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-13{display:block;width:54.16666667%}.ivu-col-push-13{left:54.16666667%}.ivu-col-pull-13{right:54.16666667%}.ivu-col-offset-13{margin-left:54.16666667%}.ivu-col-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-12{display:block;width:50%}.ivu-col-push-12{left:50%}.ivu-col-pull-12{right:50%}.ivu-col-offset-12{margin-left:50%}.ivu-col-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-11{display:block;width:45.83333333%}.ivu-col-push-11{left:45.83333333%}.ivu-col-pull-11{right:45.83333333%}.ivu-col-offset-11{margin-left:45.83333333%}.ivu-col-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-10{display:block;width:41.66666667%}.ivu-col-push-10{left:41.66666667%}.ivu-col-pull-10{right:41.66666667%}.ivu-col-offset-10{margin-left:41.66666667%}.ivu-col-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-9{display:block;width:37.5%}.ivu-col-push-9{left:37.5%}.ivu-col-pull-9{right:37.5%}.ivu-col-offset-9{margin-left:37.5%}.ivu-col-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-8{display:block;width:33.33333333%}.ivu-col-push-8{left:33.33333333%}.ivu-col-pull-8{right:33.33333333%}.ivu-col-offset-8{margin-left:33.33333333%}.ivu-col-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-7{display:block;width:29.16666667%}.ivu-col-push-7{left:29.16666667%}.ivu-col-pull-7{right:29.16666667%}.ivu-col-offset-7{margin-left:29.16666667%}.ivu-col-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-6{display:block;width:25%}.ivu-col-push-6{left:25%}.ivu-col-pull-6{right:25%}.ivu-col-offset-6{margin-left:25%}.ivu-col-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-5{display:block;width:20.83333333%}.ivu-col-push-5{left:20.83333333%}.ivu-col-pull-5{right:20.83333333%}.ivu-col-offset-5{margin-left:20.83333333%}.ivu-col-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-4{display:block;width:16.66666667%}.ivu-col-push-4{left:16.66666667%}.ivu-col-pull-4{right:16.66666667%}.ivu-col-offset-4{margin-left:16.66666667%}.ivu-col-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-3{display:block;width:12.5%}.ivu-col-push-3{left:12.5%}.ivu-col-pull-3{right:12.5%}.ivu-col-offset-3{margin-left:12.5%}.ivu-col-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-2{display:block;width:8.33333333%}.ivu-col-push-2{left:8.33333333%}.ivu-col-pull-2{right:8.33333333%}.ivu-col-offset-2{margin-left:8.33333333%}.ivu-col-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-1{display:block;width:4.16666667%}.ivu-col-push-1{left:4.16666667%}.ivu-col-pull-1{right:4.16666667%}.ivu-col-offset-1{margin-left:4.16666667%}.ivu-col-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-0{display:none}.ivu-col-push-0{left:auto}.ivu-col-pull-0{right:auto}.ivu-col-offset-0{margin-left:0}.ivu-col-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.ivu-col-span-xs-1,.ivu-col-span-xs-10,.ivu-col-span-xs-11,.ivu-col-span-xs-12,.ivu-col-span-xs-13,.ivu-col-span-xs-14,.ivu-col-span-xs-15,.ivu-col-span-xs-16,.ivu-col-span-xs-17,.ivu-col-span-xs-18,.ivu-col-span-xs-19,.ivu-col-span-xs-2,.ivu-col-span-xs-20,.ivu-col-span-xs-21,.ivu-col-span-xs-22,.ivu-col-span-xs-23,.ivu-col-span-xs-24,.ivu-col-span-xs-3,.ivu-col-span-xs-4,.ivu-col-span-xs-5,.ivu-col-span-xs-6,.ivu-col-span-xs-7,.ivu-col-span-xs-8,.ivu-col-span-xs-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xs-24{display:block;width:100%}.ivu-col-xs-push-24{left:100%}.ivu-col-xs-pull-24{right:100%}.ivu-col-xs-offset-24{margin-left:100%}.ivu-col-xs-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xs-23{display:block;width:95.83333333%}.ivu-col-xs-push-23{left:95.83333333%}.ivu-col-xs-pull-23{right:95.83333333%}.ivu-col-xs-offset-23{margin-left:95.83333333%}.ivu-col-xs-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xs-22{display:block;width:91.66666667%}.ivu-col-xs-push-22{left:91.66666667%}.ivu-col-xs-pull-22{right:91.66666667%}.ivu-col-xs-offset-22{margin-left:91.66666667%}.ivu-col-xs-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xs-21{display:block;width:87.5%}.ivu-col-xs-push-21{left:87.5%}.ivu-col-xs-pull-21{right:87.5%}.ivu-col-xs-offset-21{margin-left:87.5%}.ivu-col-xs-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xs-20{display:block;width:83.33333333%}.ivu-col-xs-push-20{left:83.33333333%}.ivu-col-xs-pull-20{right:83.33333333%}.ivu-col-xs-offset-20{margin-left:83.33333333%}.ivu-col-xs-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xs-19{display:block;width:79.16666667%}.ivu-col-xs-push-19{left:79.16666667%}.ivu-col-xs-pull-19{right:79.16666667%}.ivu-col-xs-offset-19{margin-left:79.16666667%}.ivu-col-xs-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xs-18{display:block;width:75%}.ivu-col-xs-push-18{left:75%}.ivu-col-xs-pull-18{right:75%}.ivu-col-xs-offset-18{margin-left:75%}.ivu-col-xs-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xs-17{display:block;width:70.83333333%}.ivu-col-xs-push-17{left:70.83333333%}.ivu-col-xs-pull-17{right:70.83333333%}.ivu-col-xs-offset-17{margin-left:70.83333333%}.ivu-col-xs-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xs-16{display:block;width:66.66666667%}.ivu-col-xs-push-16{left:66.66666667%}.ivu-col-xs-pull-16{right:66.66666667%}.ivu-col-xs-offset-16{margin-left:66.66666667%}.ivu-col-xs-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xs-15{display:block;width:62.5%}.ivu-col-xs-push-15{left:62.5%}.ivu-col-xs-pull-15{right:62.5%}.ivu-col-xs-offset-15{margin-left:62.5%}.ivu-col-xs-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xs-14{display:block;width:58.33333333%}.ivu-col-xs-push-14{left:58.33333333%}.ivu-col-xs-pull-14{right:58.33333333%}.ivu-col-xs-offset-14{margin-left:58.33333333%}.ivu-col-xs-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xs-13{display:block;width:54.16666667%}.ivu-col-xs-push-13{left:54.16666667%}.ivu-col-xs-pull-13{right:54.16666667%}.ivu-col-xs-offset-13{margin-left:54.16666667%}.ivu-col-xs-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xs-12{display:block;width:50%}.ivu-col-xs-push-12{left:50%}.ivu-col-xs-pull-12{right:50%}.ivu-col-xs-offset-12{margin-left:50%}.ivu-col-xs-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xs-11{display:block;width:45.83333333%}.ivu-col-xs-push-11{left:45.83333333%}.ivu-col-xs-pull-11{right:45.83333333%}.ivu-col-xs-offset-11{margin-left:45.83333333%}.ivu-col-xs-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xs-10{display:block;width:41.66666667%}.ivu-col-xs-push-10{left:41.66666667%}.ivu-col-xs-pull-10{right:41.66666667%}.ivu-col-xs-offset-10{margin-left:41.66666667%}.ivu-col-xs-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xs-9{display:block;width:37.5%}.ivu-col-xs-push-9{left:37.5%}.ivu-col-xs-pull-9{right:37.5%}.ivu-col-xs-offset-9{margin-left:37.5%}.ivu-col-xs-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xs-8{display:block;width:33.33333333%}.ivu-col-xs-push-8{left:33.33333333%}.ivu-col-xs-pull-8{right:33.33333333%}.ivu-col-xs-offset-8{margin-left:33.33333333%}.ivu-col-xs-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xs-7{display:block;width:29.16666667%}.ivu-col-xs-push-7{left:29.16666667%}.ivu-col-xs-pull-7{right:29.16666667%}.ivu-col-xs-offset-7{margin-left:29.16666667%}.ivu-col-xs-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xs-6{display:block;width:25%}.ivu-col-xs-push-6{left:25%}.ivu-col-xs-pull-6{right:25%}.ivu-col-xs-offset-6{margin-left:25%}.ivu-col-xs-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xs-5{display:block;width:20.83333333%}.ivu-col-xs-push-5{left:20.83333333%}.ivu-col-xs-pull-5{right:20.83333333%}.ivu-col-xs-offset-5{margin-left:20.83333333%}.ivu-col-xs-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xs-4{display:block;width:16.66666667%}.ivu-col-xs-push-4{left:16.66666667%}.ivu-col-xs-pull-4{right:16.66666667%}.ivu-col-xs-offset-4{margin-left:16.66666667%}.ivu-col-xs-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xs-3{display:block;width:12.5%}.ivu-col-xs-push-3{left:12.5%}.ivu-col-xs-pull-3{right:12.5%}.ivu-col-xs-offset-3{margin-left:12.5%}.ivu-col-xs-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xs-2{display:block;width:8.33333333%}.ivu-col-xs-push-2{left:8.33333333%}.ivu-col-xs-pull-2{right:8.33333333%}.ivu-col-xs-offset-2{margin-left:8.33333333%}.ivu-col-xs-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xs-1{display:block;width:4.16666667%}.ivu-col-xs-push-1{left:4.16666667%}.ivu-col-xs-pull-1{right:4.16666667%}.ivu-col-xs-offset-1{margin-left:4.16666667%}.ivu-col-xs-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xs-0{display:none}.ivu-col-xs-push-0{left:auto}.ivu-col-xs-pull-0{right:auto}.ivu-col-xs-offset-0{margin-left:0}.ivu-col-xs-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}@media (min-width:576px){.ivu-col-span-sm-1,.ivu-col-span-sm-10,.ivu-col-span-sm-11,.ivu-col-span-sm-12,.ivu-col-span-sm-13,.ivu-col-span-sm-14,.ivu-col-span-sm-15,.ivu-col-span-sm-16,.ivu-col-span-sm-17,.ivu-col-span-sm-18,.ivu-col-span-sm-19,.ivu-col-span-sm-2,.ivu-col-span-sm-20,.ivu-col-span-sm-21,.ivu-col-span-sm-22,.ivu-col-span-sm-23,.ivu-col-span-sm-24,.ivu-col-span-sm-3,.ivu-col-span-sm-4,.ivu-col-span-sm-5,.ivu-col-span-sm-6,.ivu-col-span-sm-7,.ivu-col-span-sm-8,.ivu-col-span-sm-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-sm-24{display:block;width:100%}.ivu-col-sm-push-24{left:100%}.ivu-col-sm-pull-24{right:100%}.ivu-col-sm-offset-24{margin-left:100%}.ivu-col-sm-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-sm-23{display:block;width:95.83333333%}.ivu-col-sm-push-23{left:95.83333333%}.ivu-col-sm-pull-23{right:95.83333333%}.ivu-col-sm-offset-23{margin-left:95.83333333%}.ivu-col-sm-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-sm-22{display:block;width:91.66666667%}.ivu-col-sm-push-22{left:91.66666667%}.ivu-col-sm-pull-22{right:91.66666667%}.ivu-col-sm-offset-22{margin-left:91.66666667%}.ivu-col-sm-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-sm-21{display:block;width:87.5%}.ivu-col-sm-push-21{left:87.5%}.ivu-col-sm-pull-21{right:87.5%}.ivu-col-sm-offset-21{margin-left:87.5%}.ivu-col-sm-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-sm-20{display:block;width:83.33333333%}.ivu-col-sm-push-20{left:83.33333333%}.ivu-col-sm-pull-20{right:83.33333333%}.ivu-col-sm-offset-20{margin-left:83.33333333%}.ivu-col-sm-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-sm-19{display:block;width:79.16666667%}.ivu-col-sm-push-19{left:79.16666667%}.ivu-col-sm-pull-19{right:79.16666667%}.ivu-col-sm-offset-19{margin-left:79.16666667%}.ivu-col-sm-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-sm-18{display:block;width:75%}.ivu-col-sm-push-18{left:75%}.ivu-col-sm-pull-18{right:75%}.ivu-col-sm-offset-18{margin-left:75%}.ivu-col-sm-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-sm-17{display:block;width:70.83333333%}.ivu-col-sm-push-17{left:70.83333333%}.ivu-col-sm-pull-17{right:70.83333333%}.ivu-col-sm-offset-17{margin-left:70.83333333%}.ivu-col-sm-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-sm-16{display:block;width:66.66666667%}.ivu-col-sm-push-16{left:66.66666667%}.ivu-col-sm-pull-16{right:66.66666667%}.ivu-col-sm-offset-16{margin-left:66.66666667%}.ivu-col-sm-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-sm-15{display:block;width:62.5%}.ivu-col-sm-push-15{left:62.5%}.ivu-col-sm-pull-15{right:62.5%}.ivu-col-sm-offset-15{margin-left:62.5%}.ivu-col-sm-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-sm-14{display:block;width:58.33333333%}.ivu-col-sm-push-14{left:58.33333333%}.ivu-col-sm-pull-14{right:58.33333333%}.ivu-col-sm-offset-14{margin-left:58.33333333%}.ivu-col-sm-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-sm-13{display:block;width:54.16666667%}.ivu-col-sm-push-13{left:54.16666667%}.ivu-col-sm-pull-13{right:54.16666667%}.ivu-col-sm-offset-13{margin-left:54.16666667%}.ivu-col-sm-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-sm-12{display:block;width:50%}.ivu-col-sm-push-12{left:50%}.ivu-col-sm-pull-12{right:50%}.ivu-col-sm-offset-12{margin-left:50%}.ivu-col-sm-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-sm-11{display:block;width:45.83333333%}.ivu-col-sm-push-11{left:45.83333333%}.ivu-col-sm-pull-11{right:45.83333333%}.ivu-col-sm-offset-11{margin-left:45.83333333%}.ivu-col-sm-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-sm-10{display:block;width:41.66666667%}.ivu-col-sm-push-10{left:41.66666667%}.ivu-col-sm-pull-10{right:41.66666667%}.ivu-col-sm-offset-10{margin-left:41.66666667%}.ivu-col-sm-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-sm-9{display:block;width:37.5%}.ivu-col-sm-push-9{left:37.5%}.ivu-col-sm-pull-9{right:37.5%}.ivu-col-sm-offset-9{margin-left:37.5%}.ivu-col-sm-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-sm-8{display:block;width:33.33333333%}.ivu-col-sm-push-8{left:33.33333333%}.ivu-col-sm-pull-8{right:33.33333333%}.ivu-col-sm-offset-8{margin-left:33.33333333%}.ivu-col-sm-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-sm-7{display:block;width:29.16666667%}.ivu-col-sm-push-7{left:29.16666667%}.ivu-col-sm-pull-7{right:29.16666667%}.ivu-col-sm-offset-7{margin-left:29.16666667%}.ivu-col-sm-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-sm-6{display:block;width:25%}.ivu-col-sm-push-6{left:25%}.ivu-col-sm-pull-6{right:25%}.ivu-col-sm-offset-6{margin-left:25%}.ivu-col-sm-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-sm-5{display:block;width:20.83333333%}.ivu-col-sm-push-5{left:20.83333333%}.ivu-col-sm-pull-5{right:20.83333333%}.ivu-col-sm-offset-5{margin-left:20.83333333%}.ivu-col-sm-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-sm-4{display:block;width:16.66666667%}.ivu-col-sm-push-4{left:16.66666667%}.ivu-col-sm-pull-4{right:16.66666667%}.ivu-col-sm-offset-4{margin-left:16.66666667%}.ivu-col-sm-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-sm-3{display:block;width:12.5%}.ivu-col-sm-push-3{left:12.5%}.ivu-col-sm-pull-3{right:12.5%}.ivu-col-sm-offset-3{margin-left:12.5%}.ivu-col-sm-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-sm-2{display:block;width:8.33333333%}.ivu-col-sm-push-2{left:8.33333333%}.ivu-col-sm-pull-2{right:8.33333333%}.ivu-col-sm-offset-2{margin-left:8.33333333%}.ivu-col-sm-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-sm-1{display:block;width:4.16666667%}.ivu-col-sm-push-1{left:4.16666667%}.ivu-col-sm-pull-1{right:4.16666667%}.ivu-col-sm-offset-1{margin-left:4.16666667%}.ivu-col-sm-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-sm-0{display:none}.ivu-col-sm-push-0{left:auto}.ivu-col-sm-pull-0{right:auto}.ivu-col-sm-offset-0{margin-left:0}.ivu-col-sm-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:768px){.ivu-col-span-md-1,.ivu-col-span-md-10,.ivu-col-span-md-11,.ivu-col-span-md-12,.ivu-col-span-md-13,.ivu-col-span-md-14,.ivu-col-span-md-15,.ivu-col-span-md-16,.ivu-col-span-md-17,.ivu-col-span-md-18,.ivu-col-span-md-19,.ivu-col-span-md-2,.ivu-col-span-md-20,.ivu-col-span-md-21,.ivu-col-span-md-22,.ivu-col-span-md-23,.ivu-col-span-md-24,.ivu-col-span-md-3,.ivu-col-span-md-4,.ivu-col-span-md-5,.ivu-col-span-md-6,.ivu-col-span-md-7,.ivu-col-span-md-8,.ivu-col-span-md-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-md-24{display:block;width:100%}.ivu-col-md-push-24{left:100%}.ivu-col-md-pull-24{right:100%}.ivu-col-md-offset-24{margin-left:100%}.ivu-col-md-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-md-23{display:block;width:95.83333333%}.ivu-col-md-push-23{left:95.83333333%}.ivu-col-md-pull-23{right:95.83333333%}.ivu-col-md-offset-23{margin-left:95.83333333%}.ivu-col-md-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-md-22{display:block;width:91.66666667%}.ivu-col-md-push-22{left:91.66666667%}.ivu-col-md-pull-22{right:91.66666667%}.ivu-col-md-offset-22{margin-left:91.66666667%}.ivu-col-md-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-md-21{display:block;width:87.5%}.ivu-col-md-push-21{left:87.5%}.ivu-col-md-pull-21{right:87.5%}.ivu-col-md-offset-21{margin-left:87.5%}.ivu-col-md-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-md-20{display:block;width:83.33333333%}.ivu-col-md-push-20{left:83.33333333%}.ivu-col-md-pull-20{right:83.33333333%}.ivu-col-md-offset-20{margin-left:83.33333333%}.ivu-col-md-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-md-19{display:block;width:79.16666667%}.ivu-col-md-push-19{left:79.16666667%}.ivu-col-md-pull-19{right:79.16666667%}.ivu-col-md-offset-19{margin-left:79.16666667%}.ivu-col-md-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-md-18{display:block;width:75%}.ivu-col-md-push-18{left:75%}.ivu-col-md-pull-18{right:75%}.ivu-col-md-offset-18{margin-left:75%}.ivu-col-md-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-md-17{display:block;width:70.83333333%}.ivu-col-md-push-17{left:70.83333333%}.ivu-col-md-pull-17{right:70.83333333%}.ivu-col-md-offset-17{margin-left:70.83333333%}.ivu-col-md-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-md-16{display:block;width:66.66666667%}.ivu-col-md-push-16{left:66.66666667%}.ivu-col-md-pull-16{right:66.66666667%}.ivu-col-md-offset-16{margin-left:66.66666667%}.ivu-col-md-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-md-15{display:block;width:62.5%}.ivu-col-md-push-15{left:62.5%}.ivu-col-md-pull-15{right:62.5%}.ivu-col-md-offset-15{margin-left:62.5%}.ivu-col-md-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-md-14{display:block;width:58.33333333%}.ivu-col-md-push-14{left:58.33333333%}.ivu-col-md-pull-14{right:58.33333333%}.ivu-col-md-offset-14{margin-left:58.33333333%}.ivu-col-md-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-md-13{display:block;width:54.16666667%}.ivu-col-md-push-13{left:54.16666667%}.ivu-col-md-pull-13{right:54.16666667%}.ivu-col-md-offset-13{margin-left:54.16666667%}.ivu-col-md-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-md-12{display:block;width:50%}.ivu-col-md-push-12{left:50%}.ivu-col-md-pull-12{right:50%}.ivu-col-md-offset-12{margin-left:50%}.ivu-col-md-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-md-11{display:block;width:45.83333333%}.ivu-col-md-push-11{left:45.83333333%}.ivu-col-md-pull-11{right:45.83333333%}.ivu-col-md-offset-11{margin-left:45.83333333%}.ivu-col-md-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-md-10{display:block;width:41.66666667%}.ivu-col-md-push-10{left:41.66666667%}.ivu-col-md-pull-10{right:41.66666667%}.ivu-col-md-offset-10{margin-left:41.66666667%}.ivu-col-md-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-md-9{display:block;width:37.5%}.ivu-col-md-push-9{left:37.5%}.ivu-col-md-pull-9{right:37.5%}.ivu-col-md-offset-9{margin-left:37.5%}.ivu-col-md-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-md-8{display:block;width:33.33333333%}.ivu-col-md-push-8{left:33.33333333%}.ivu-col-md-pull-8{right:33.33333333%}.ivu-col-md-offset-8{margin-left:33.33333333%}.ivu-col-md-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-md-7{display:block;width:29.16666667%}.ivu-col-md-push-7{left:29.16666667%}.ivu-col-md-pull-7{right:29.16666667%}.ivu-col-md-offset-7{margin-left:29.16666667%}.ivu-col-md-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-md-6{display:block;width:25%}.ivu-col-md-push-6{left:25%}.ivu-col-md-pull-6{right:25%}.ivu-col-md-offset-6{margin-left:25%}.ivu-col-md-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-md-5{display:block;width:20.83333333%}.ivu-col-md-push-5{left:20.83333333%}.ivu-col-md-pull-5{right:20.83333333%}.ivu-col-md-offset-5{margin-left:20.83333333%}.ivu-col-md-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-md-4{display:block;width:16.66666667%}.ivu-col-md-push-4{left:16.66666667%}.ivu-col-md-pull-4{right:16.66666667%}.ivu-col-md-offset-4{margin-left:16.66666667%}.ivu-col-md-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-md-3{display:block;width:12.5%}.ivu-col-md-push-3{left:12.5%}.ivu-col-md-pull-3{right:12.5%}.ivu-col-md-offset-3{margin-left:12.5%}.ivu-col-md-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-md-2{display:block;width:8.33333333%}.ivu-col-md-push-2{left:8.33333333%}.ivu-col-md-pull-2{right:8.33333333%}.ivu-col-md-offset-2{margin-left:8.33333333%}.ivu-col-md-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-md-1{display:block;width:4.16666667%}.ivu-col-md-push-1{left:4.16666667%}.ivu-col-md-pull-1{right:4.16666667%}.ivu-col-md-offset-1{margin-left:4.16666667%}.ivu-col-md-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-md-0{display:none}.ivu-col-md-push-0{left:auto}.ivu-col-md-pull-0{right:auto}.ivu-col-md-offset-0{margin-left:0}.ivu-col-md-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:992px){.ivu-col-span-lg-1,.ivu-col-span-lg-10,.ivu-col-span-lg-11,.ivu-col-span-lg-12,.ivu-col-span-lg-13,.ivu-col-span-lg-14,.ivu-col-span-lg-15,.ivu-col-span-lg-16,.ivu-col-span-lg-17,.ivu-col-span-lg-18,.ivu-col-span-lg-19,.ivu-col-span-lg-2,.ivu-col-span-lg-20,.ivu-col-span-lg-21,.ivu-col-span-lg-22,.ivu-col-span-lg-23,.ivu-col-span-lg-24,.ivu-col-span-lg-3,.ivu-col-span-lg-4,.ivu-col-span-lg-5,.ivu-col-span-lg-6,.ivu-col-span-lg-7,.ivu-col-span-lg-8,.ivu-col-span-lg-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-lg-24{display:block;width:100%}.ivu-col-lg-push-24{left:100%}.ivu-col-lg-pull-24{right:100%}.ivu-col-lg-offset-24{margin-left:100%}.ivu-col-lg-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-lg-23{display:block;width:95.83333333%}.ivu-col-lg-push-23{left:95.83333333%}.ivu-col-lg-pull-23{right:95.83333333%}.ivu-col-lg-offset-23{margin-left:95.83333333%}.ivu-col-lg-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-lg-22{display:block;width:91.66666667%}.ivu-col-lg-push-22{left:91.66666667%}.ivu-col-lg-pull-22{right:91.66666667%}.ivu-col-lg-offset-22{margin-left:91.66666667%}.ivu-col-lg-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-lg-21{display:block;width:87.5%}.ivu-col-lg-push-21{left:87.5%}.ivu-col-lg-pull-21{right:87.5%}.ivu-col-lg-offset-21{margin-left:87.5%}.ivu-col-lg-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-lg-20{display:block;width:83.33333333%}.ivu-col-lg-push-20{left:83.33333333%}.ivu-col-lg-pull-20{right:83.33333333%}.ivu-col-lg-offset-20{margin-left:83.33333333%}.ivu-col-lg-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-lg-19{display:block;width:79.16666667%}.ivu-col-lg-push-19{left:79.16666667%}.ivu-col-lg-pull-19{right:79.16666667%}.ivu-col-lg-offset-19{margin-left:79.16666667%}.ivu-col-lg-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-lg-18{display:block;width:75%}.ivu-col-lg-push-18{left:75%}.ivu-col-lg-pull-18{right:75%}.ivu-col-lg-offset-18{margin-left:75%}.ivu-col-lg-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-lg-17{display:block;width:70.83333333%}.ivu-col-lg-push-17{left:70.83333333%}.ivu-col-lg-pull-17{right:70.83333333%}.ivu-col-lg-offset-17{margin-left:70.83333333%}.ivu-col-lg-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-lg-16{display:block;width:66.66666667%}.ivu-col-lg-push-16{left:66.66666667%}.ivu-col-lg-pull-16{right:66.66666667%}.ivu-col-lg-offset-16{margin-left:66.66666667%}.ivu-col-lg-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-lg-15{display:block;width:62.5%}.ivu-col-lg-push-15{left:62.5%}.ivu-col-lg-pull-15{right:62.5%}.ivu-col-lg-offset-15{margin-left:62.5%}.ivu-col-lg-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-lg-14{display:block;width:58.33333333%}.ivu-col-lg-push-14{left:58.33333333%}.ivu-col-lg-pull-14{right:58.33333333%}.ivu-col-lg-offset-14{margin-left:58.33333333%}.ivu-col-lg-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-lg-13{display:block;width:54.16666667%}.ivu-col-lg-push-13{left:54.16666667%}.ivu-col-lg-pull-13{right:54.16666667%}.ivu-col-lg-offset-13{margin-left:54.16666667%}.ivu-col-lg-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-lg-12{display:block;width:50%}.ivu-col-lg-push-12{left:50%}.ivu-col-lg-pull-12{right:50%}.ivu-col-lg-offset-12{margin-left:50%}.ivu-col-lg-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-lg-11{display:block;width:45.83333333%}.ivu-col-lg-push-11{left:45.83333333%}.ivu-col-lg-pull-11{right:45.83333333%}.ivu-col-lg-offset-11{margin-left:45.83333333%}.ivu-col-lg-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-lg-10{display:block;width:41.66666667%}.ivu-col-lg-push-10{left:41.66666667%}.ivu-col-lg-pull-10{right:41.66666667%}.ivu-col-lg-offset-10{margin-left:41.66666667%}.ivu-col-lg-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-lg-9{display:block;width:37.5%}.ivu-col-lg-push-9{left:37.5%}.ivu-col-lg-pull-9{right:37.5%}.ivu-col-lg-offset-9{margin-left:37.5%}.ivu-col-lg-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-lg-8{display:block;width:33.33333333%}.ivu-col-lg-push-8{left:33.33333333%}.ivu-col-lg-pull-8{right:33.33333333%}.ivu-col-lg-offset-8{margin-left:33.33333333%}.ivu-col-lg-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-lg-7{display:block;width:29.16666667%}.ivu-col-lg-push-7{left:29.16666667%}.ivu-col-lg-pull-7{right:29.16666667%}.ivu-col-lg-offset-7{margin-left:29.16666667%}.ivu-col-lg-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-lg-6{display:block;width:25%}.ivu-col-lg-push-6{left:25%}.ivu-col-lg-pull-6{right:25%}.ivu-col-lg-offset-6{margin-left:25%}.ivu-col-lg-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-lg-5{display:block;width:20.83333333%}.ivu-col-lg-push-5{left:20.83333333%}.ivu-col-lg-pull-5{right:20.83333333%}.ivu-col-lg-offset-5{margin-left:20.83333333%}.ivu-col-lg-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-lg-4{display:block;width:16.66666667%}.ivu-col-lg-push-4{left:16.66666667%}.ivu-col-lg-pull-4{right:16.66666667%}.ivu-col-lg-offset-4{margin-left:16.66666667%}.ivu-col-lg-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-lg-3{display:block;width:12.5%}.ivu-col-lg-push-3{left:12.5%}.ivu-col-lg-pull-3{right:12.5%}.ivu-col-lg-offset-3{margin-left:12.5%}.ivu-col-lg-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-lg-2{display:block;width:8.33333333%}.ivu-col-lg-push-2{left:8.33333333%}.ivu-col-lg-pull-2{right:8.33333333%}.ivu-col-lg-offset-2{margin-left:8.33333333%}.ivu-col-lg-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-lg-1{display:block;width:4.16666667%}.ivu-col-lg-push-1{left:4.16666667%}.ivu-col-lg-pull-1{right:4.16666667%}.ivu-col-lg-offset-1{margin-left:4.16666667%}.ivu-col-lg-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-lg-0{display:none}.ivu-col-lg-push-0{left:auto}.ivu-col-lg-pull-0{right:auto}.ivu-col-lg-offset-0{margin-left:0}.ivu-col-lg-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:1200px){.ivu-col-span-xl-1,.ivu-col-span-xl-10,.ivu-col-span-xl-11,.ivu-col-span-xl-12,.ivu-col-span-xl-13,.ivu-col-span-xl-14,.ivu-col-span-xl-15,.ivu-col-span-xl-16,.ivu-col-span-xl-17,.ivu-col-span-xl-18,.ivu-col-span-xl-19,.ivu-col-span-xl-2,.ivu-col-span-xl-20,.ivu-col-span-xl-21,.ivu-col-span-xl-22,.ivu-col-span-xl-23,.ivu-col-span-xl-24,.ivu-col-span-xl-3,.ivu-col-span-xl-4,.ivu-col-span-xl-5,.ivu-col-span-xl-6,.ivu-col-span-xl-7,.ivu-col-span-xl-8,.ivu-col-span-xl-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xl-24{display:block;width:100%}.ivu-col-xl-push-24{left:100%}.ivu-col-xl-pull-24{right:100%}.ivu-col-xl-offset-24{margin-left:100%}.ivu-col-xl-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xl-23{display:block;width:95.83333333%}.ivu-col-xl-push-23{left:95.83333333%}.ivu-col-xl-pull-23{right:95.83333333%}.ivu-col-xl-offset-23{margin-left:95.83333333%}.ivu-col-xl-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xl-22{display:block;width:91.66666667%}.ivu-col-xl-push-22{left:91.66666667%}.ivu-col-xl-pull-22{right:91.66666667%}.ivu-col-xl-offset-22{margin-left:91.66666667%}.ivu-col-xl-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xl-21{display:block;width:87.5%}.ivu-col-xl-push-21{left:87.5%}.ivu-col-xl-pull-21{right:87.5%}.ivu-col-xl-offset-21{margin-left:87.5%}.ivu-col-xl-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xl-20{display:block;width:83.33333333%}.ivu-col-xl-push-20{left:83.33333333%}.ivu-col-xl-pull-20{right:83.33333333%}.ivu-col-xl-offset-20{margin-left:83.33333333%}.ivu-col-xl-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xl-19{display:block;width:79.16666667%}.ivu-col-xl-push-19{left:79.16666667%}.ivu-col-xl-pull-19{right:79.16666667%}.ivu-col-xl-offset-19{margin-left:79.16666667%}.ivu-col-xl-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xl-18{display:block;width:75%}.ivu-col-xl-push-18{left:75%}.ivu-col-xl-pull-18{right:75%}.ivu-col-xl-offset-18{margin-left:75%}.ivu-col-xl-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xl-17{display:block;width:70.83333333%}.ivu-col-xl-push-17{left:70.83333333%}.ivu-col-xl-pull-17{right:70.83333333%}.ivu-col-xl-offset-17{margin-left:70.83333333%}.ivu-col-xl-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xl-16{display:block;width:66.66666667%}.ivu-col-xl-push-16{left:66.66666667%}.ivu-col-xl-pull-16{right:66.66666667%}.ivu-col-xl-offset-16{margin-left:66.66666667%}.ivu-col-xl-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xl-15{display:block;width:62.5%}.ivu-col-xl-push-15{left:62.5%}.ivu-col-xl-pull-15{right:62.5%}.ivu-col-xl-offset-15{margin-left:62.5%}.ivu-col-xl-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xl-14{display:block;width:58.33333333%}.ivu-col-xl-push-14{left:58.33333333%}.ivu-col-xl-pull-14{right:58.33333333%}.ivu-col-xl-offset-14{margin-left:58.33333333%}.ivu-col-xl-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xl-13{display:block;width:54.16666667%}.ivu-col-xl-push-13{left:54.16666667%}.ivu-col-xl-pull-13{right:54.16666667%}.ivu-col-xl-offset-13{margin-left:54.16666667%}.ivu-col-xl-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xl-12{display:block;width:50%}.ivu-col-xl-push-12{left:50%}.ivu-col-xl-pull-12{right:50%}.ivu-col-xl-offset-12{margin-left:50%}.ivu-col-xl-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xl-11{display:block;width:45.83333333%}.ivu-col-xl-push-11{left:45.83333333%}.ivu-col-xl-pull-11{right:45.83333333%}.ivu-col-xl-offset-11{margin-left:45.83333333%}.ivu-col-xl-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xl-10{display:block;width:41.66666667%}.ivu-col-xl-push-10{left:41.66666667%}.ivu-col-xl-pull-10{right:41.66666667%}.ivu-col-xl-offset-10{margin-left:41.66666667%}.ivu-col-xl-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xl-9{display:block;width:37.5%}.ivu-col-xl-push-9{left:37.5%}.ivu-col-xl-pull-9{right:37.5%}.ivu-col-xl-offset-9{margin-left:37.5%}.ivu-col-xl-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xl-8{display:block;width:33.33333333%}.ivu-col-xl-push-8{left:33.33333333%}.ivu-col-xl-pull-8{right:33.33333333%}.ivu-col-xl-offset-8{margin-left:33.33333333%}.ivu-col-xl-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xl-7{display:block;width:29.16666667%}.ivu-col-xl-push-7{left:29.16666667%}.ivu-col-xl-pull-7{right:29.16666667%}.ivu-col-xl-offset-7{margin-left:29.16666667%}.ivu-col-xl-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xl-6{display:block;width:25%}.ivu-col-xl-push-6{left:25%}.ivu-col-xl-pull-6{right:25%}.ivu-col-xl-offset-6{margin-left:25%}.ivu-col-xl-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xl-5{display:block;width:20.83333333%}.ivu-col-xl-push-5{left:20.83333333%}.ivu-col-xl-pull-5{right:20.83333333%}.ivu-col-xl-offset-5{margin-left:20.83333333%}.ivu-col-xl-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xl-4{display:block;width:16.66666667%}.ivu-col-xl-push-4{left:16.66666667%}.ivu-col-xl-pull-4{right:16.66666667%}.ivu-col-xl-offset-4{margin-left:16.66666667%}.ivu-col-xl-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xl-3{display:block;width:12.5%}.ivu-col-xl-push-3{left:12.5%}.ivu-col-xl-pull-3{right:12.5%}.ivu-col-xl-offset-3{margin-left:12.5%}.ivu-col-xl-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xl-2{display:block;width:8.33333333%}.ivu-col-xl-push-2{left:8.33333333%}.ivu-col-xl-pull-2{right:8.33333333%}.ivu-col-xl-offset-2{margin-left:8.33333333%}.ivu-col-xl-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xl-1{display:block;width:4.16666667%}.ivu-col-xl-push-1{left:4.16666667%}.ivu-col-xl-pull-1{right:4.16666667%}.ivu-col-xl-offset-1{margin-left:4.16666667%}.ivu-col-xl-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xl-0{display:none}.ivu-col-xl-push-0{left:auto}.ivu-col-xl-pull-0{right:auto}.ivu-col-xl-offset-0{margin-left:0}.ivu-col-xl-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}@media (min-width:1600px){.ivu-col-span-xxl-1,.ivu-col-span-xxl-10,.ivu-col-span-xxl-11,.ivu-col-span-xxl-12,.ivu-col-span-xxl-13,.ivu-col-span-xxl-14,.ivu-col-span-xxl-15,.ivu-col-span-xxl-16,.ivu-col-span-xxl-17,.ivu-col-span-xxl-18,.ivu-col-span-xxl-19,.ivu-col-span-xxl-2,.ivu-col-span-xxl-20,.ivu-col-span-xxl-21,.ivu-col-span-xxl-22,.ivu-col-span-xxl-23,.ivu-col-span-xxl-24,.ivu-col-span-xxl-3,.ivu-col-span-xxl-4,.ivu-col-span-xxl-5,.ivu-col-span-xxl-6,.ivu-col-span-xxl-7,.ivu-col-span-xxl-8,.ivu-col-span-xxl-9{float:left;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-col-span-xxl-24{display:block;width:100%}.ivu-col-xxl-push-24{left:100%}.ivu-col-xxl-pull-24{right:100%}.ivu-col-xxl-offset-24{margin-left:100%}.ivu-col-xxl-order-24{-webkit-box-ordinal-group:25;-ms-flex-order:24;order:24}.ivu-col-span-xxl-23{display:block;width:95.83333333%}.ivu-col-xxl-push-23{left:95.83333333%}.ivu-col-xxl-pull-23{right:95.83333333%}.ivu-col-xxl-offset-23{margin-left:95.83333333%}.ivu-col-xxl-order-23{-webkit-box-ordinal-group:24;-ms-flex-order:23;order:23}.ivu-col-span-xxl-22{display:block;width:91.66666667%}.ivu-col-xxl-push-22{left:91.66666667%}.ivu-col-xxl-pull-22{right:91.66666667%}.ivu-col-xxl-offset-22{margin-left:91.66666667%}.ivu-col-xxl-order-22{-webkit-box-ordinal-group:23;-ms-flex-order:22;order:22}.ivu-col-span-xxl-21{display:block;width:87.5%}.ivu-col-xxl-push-21{left:87.5%}.ivu-col-xxl-pull-21{right:87.5%}.ivu-col-xxl-offset-21{margin-left:87.5%}.ivu-col-xxl-order-21{-webkit-box-ordinal-group:22;-ms-flex-order:21;order:21}.ivu-col-span-xxl-20{display:block;width:83.33333333%}.ivu-col-xxl-push-20{left:83.33333333%}.ivu-col-xxl-pull-20{right:83.33333333%}.ivu-col-xxl-offset-20{margin-left:83.33333333%}.ivu-col-xxl-order-20{-webkit-box-ordinal-group:21;-ms-flex-order:20;order:20}.ivu-col-span-xxl-19{display:block;width:79.16666667%}.ivu-col-xxl-push-19{left:79.16666667%}.ivu-col-xxl-pull-19{right:79.16666667%}.ivu-col-xxl-offset-19{margin-left:79.16666667%}.ivu-col-xxl-order-19{-webkit-box-ordinal-group:20;-ms-flex-order:19;order:19}.ivu-col-span-xxl-18{display:block;width:75%}.ivu-col-xxl-push-18{left:75%}.ivu-col-xxl-pull-18{right:75%}.ivu-col-xxl-offset-18{margin-left:75%}.ivu-col-xxl-order-18{-webkit-box-ordinal-group:19;-ms-flex-order:18;order:18}.ivu-col-span-xxl-17{display:block;width:70.83333333%}.ivu-col-xxl-push-17{left:70.83333333%}.ivu-col-xxl-pull-17{right:70.83333333%}.ivu-col-xxl-offset-17{margin-left:70.83333333%}.ivu-col-xxl-order-17{-webkit-box-ordinal-group:18;-ms-flex-order:17;order:17}.ivu-col-span-xxl-16{display:block;width:66.66666667%}.ivu-col-xxl-push-16{left:66.66666667%}.ivu-col-xxl-pull-16{right:66.66666667%}.ivu-col-xxl-offset-16{margin-left:66.66666667%}.ivu-col-xxl-order-16{-webkit-box-ordinal-group:17;-ms-flex-order:16;order:16}.ivu-col-span-xxl-15{display:block;width:62.5%}.ivu-col-xxl-push-15{left:62.5%}.ivu-col-xxl-pull-15{right:62.5%}.ivu-col-xxl-offset-15{margin-left:62.5%}.ivu-col-xxl-order-15{-webkit-box-ordinal-group:16;-ms-flex-order:15;order:15}.ivu-col-span-xxl-14{display:block;width:58.33333333%}.ivu-col-xxl-push-14{left:58.33333333%}.ivu-col-xxl-pull-14{right:58.33333333%}.ivu-col-xxl-offset-14{margin-left:58.33333333%}.ivu-col-xxl-order-14{-webkit-box-ordinal-group:15;-ms-flex-order:14;order:14}.ivu-col-span-xxl-13{display:block;width:54.16666667%}.ivu-col-xxl-push-13{left:54.16666667%}.ivu-col-xxl-pull-13{right:54.16666667%}.ivu-col-xxl-offset-13{margin-left:54.16666667%}.ivu-col-xxl-order-13{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.ivu-col-span-xxl-12{display:block;width:50%}.ivu-col-xxl-push-12{left:50%}.ivu-col-xxl-pull-12{right:50%}.ivu-col-xxl-offset-12{margin-left:50%}.ivu-col-xxl-order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.ivu-col-span-xxl-11{display:block;width:45.83333333%}.ivu-col-xxl-push-11{left:45.83333333%}.ivu-col-xxl-pull-11{right:45.83333333%}.ivu-col-xxl-offset-11{margin-left:45.83333333%}.ivu-col-xxl-order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.ivu-col-span-xxl-10{display:block;width:41.66666667%}.ivu-col-xxl-push-10{left:41.66666667%}.ivu-col-xxl-pull-10{right:41.66666667%}.ivu-col-xxl-offset-10{margin-left:41.66666667%}.ivu-col-xxl-order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.ivu-col-span-xxl-9{display:block;width:37.5%}.ivu-col-xxl-push-9{left:37.5%}.ivu-col-xxl-pull-9{right:37.5%}.ivu-col-xxl-offset-9{margin-left:37.5%}.ivu-col-xxl-order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.ivu-col-span-xxl-8{display:block;width:33.33333333%}.ivu-col-xxl-push-8{left:33.33333333%}.ivu-col-xxl-pull-8{right:33.33333333%}.ivu-col-xxl-offset-8{margin-left:33.33333333%}.ivu-col-xxl-order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.ivu-col-span-xxl-7{display:block;width:29.16666667%}.ivu-col-xxl-push-7{left:29.16666667%}.ivu-col-xxl-pull-7{right:29.16666667%}.ivu-col-xxl-offset-7{margin-left:29.16666667%}.ivu-col-xxl-order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.ivu-col-span-xxl-6{display:block;width:25%}.ivu-col-xxl-push-6{left:25%}.ivu-col-xxl-pull-6{right:25%}.ivu-col-xxl-offset-6{margin-left:25%}.ivu-col-xxl-order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.ivu-col-span-xxl-5{display:block;width:20.83333333%}.ivu-col-xxl-push-5{left:20.83333333%}.ivu-col-xxl-pull-5{right:20.83333333%}.ivu-col-xxl-offset-5{margin-left:20.83333333%}.ivu-col-xxl-order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ivu-col-span-xxl-4{display:block;width:16.66666667%}.ivu-col-xxl-push-4{left:16.66666667%}.ivu-col-xxl-pull-4{right:16.66666667%}.ivu-col-xxl-offset-4{margin-left:16.66666667%}.ivu-col-xxl-order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.ivu-col-span-xxl-3{display:block;width:12.5%}.ivu-col-xxl-push-3{left:12.5%}.ivu-col-xxl-pull-3{right:12.5%}.ivu-col-xxl-offset-3{margin-left:12.5%}.ivu-col-xxl-order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.ivu-col-span-xxl-2{display:block;width:8.33333333%}.ivu-col-xxl-push-2{left:8.33333333%}.ivu-col-xxl-pull-2{right:8.33333333%}.ivu-col-xxl-offset-2{margin-left:8.33333333%}.ivu-col-xxl-order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.ivu-col-span-xxl-1{display:block;width:4.16666667%}.ivu-col-xxl-push-1{left:4.16666667%}.ivu-col-xxl-pull-1{right:4.16666667%}.ivu-col-xxl-offset-1{margin-left:4.16666667%}.ivu-col-xxl-order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ivu-col-span-xxl-0{display:none}.ivu-col-xxl-push-0{left:auto}.ivu-col-xxl-pull-0{right:auto}.ivu-col-xxl-offset-0{margin-left:0}.ivu-col-xxl-order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}}.ivu-article h1{font-size:26px;font-weight:400}.ivu-article h2{font-size:20px;font-weight:400}.ivu-article h3{font-size:16px;font-weight:400}.ivu-article h4{font-size:14px;font-weight:400}.ivu-article h5{font-size:12px;font-weight:400}.ivu-article h6{font-size:12px;font-weight:400}.ivu-article blockquote{padding:5px 5px 3px 10px;line-height:1.5;border-left:4px solid #ddd;margin-bottom:20px;color:#666;font-size:14px}.ivu-article ul:not([class^=ivu-]){padding-left:40px;list-style-type:disc}.ivu-article li:not([class^=ivu-]){margin-bottom:5px;font-size:14px}.ivu-article ol ul:not([class^=ivu-]),.ivu-article ul ul:not([class^=ivu-]){list-style-type:circle}.ivu-article p{margin:5px;font-size:14px}.ivu-article a:not([class^=ivu-])[target=\"_blank\"]:after{content:\"\\F3F2\";font-family:Ionicons;color:#aaa;margin-left:3px}.fade-appear,.fade-enter-active{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-leave-active{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.fade-appear,.fade-enter-active{-webkit-animation-name:ivuFadeIn;animation-name:ivuFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.fade-leave-active{-webkit-animation-name:ivuFadeOut;animation-name:ivuFadeOut;-webkit-animation-play-state:running;animation-play-state:running}.fade-appear,.fade-enter-active{opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear}.fade-leave-active{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes ivuFadeIn{0%{opacity:0}100%{opacity:1}}@keyframes ivuFadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes ivuFadeOut{0%{opacity:1}100%{opacity:0}}@keyframes ivuFadeOut{0%{opacity:1}100%{opacity:0}}.move-up-appear,.move-up-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-up-appear,.move-up-enter-active{-webkit-animation-name:ivuMoveUpIn;animation-name:ivuMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.move-up-leave-active{-webkit-animation-name:ivuMoveUpOut;animation-name:ivuMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running}.move-up-appear,.move-up-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-up-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-down-appear,.move-down-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-down-appear,.move-down-enter-active{-webkit-animation-name:ivuMoveDownIn;animation-name:ivuMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.move-down-leave-active{-webkit-animation-name:ivuMoveDownOut;animation-name:ivuMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running}.move-down-appear,.move-down-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-down-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-left-appear,.move-left-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-left-appear,.move-left-enter-active{-webkit-animation-name:ivuMoveLeftIn;animation-name:ivuMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.move-left-leave-active{-webkit-animation-name:ivuMoveLeftOut;animation-name:ivuMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running}.move-left-appear,.move-left-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-left-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-right-appear,.move-right-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-right-appear,.move-right-enter-active{-webkit-animation-name:ivuMoveRightIn;animation-name:ivuMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.move-right-leave-active{-webkit-animation-name:ivuMoveRightOut;animation-name:ivuMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running}.move-right-appear,.move-right-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-right-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes ivuMoveDownIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes ivuMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@keyframes ivuMoveDownOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}}@-webkit-keyframes ivuMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes ivuMoveLeftIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@-webkit-keyframes ivuMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes ivuMoveLeftOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@-webkit-keyframes ivuMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes ivuMoveRightIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes ivuMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes ivuMoveRightOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes ivuMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes ivuMoveUpIn{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@-webkit-keyframes ivuMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}@keyframes ivuMoveUpOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-100%);transform:translateY(-100%);opacity:0}}.move-notice-appear,.move-notice-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-notice-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.move-notice-appear,.move-notice-enter-active{-webkit-animation-name:ivuMoveNoticeIn;animation-name:ivuMoveNoticeIn;-webkit-animation-play-state:running;animation-play-state:running}.move-notice-leave-active{-webkit-animation-name:ivuMoveNoticeOut;animation-name:ivuMoveNoticeOut;-webkit-animation-play-state:running;animation-play-state:running}.move-notice-appear,.move-notice-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.move-notice-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuMoveNoticeIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes ivuMoveNoticeIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes ivuMoveNoticeOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}70%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:auto;padding:16px;margin-bottom:10px;opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:0;padding:0;margin-bottom:0;opacity:0}}@keyframes ivuMoveNoticeOut{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}70%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:auto;padding:16px;margin-bottom:10px;opacity:0}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);height:0;padding:0;margin-bottom:0;opacity:0}}.ease-appear,.ease-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ease-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ease-appear,.ease-enter-active{-webkit-animation-name:ivuEaseIn;animation-name:ivuEaseIn;-webkit-animation-play-state:running;animation-play-state:running}.ease-leave-active{-webkit-animation-name:ivuEaseOut;animation-name:ivuEaseOut;-webkit-animation-play-state:running;animation-play-state:running}.ease-appear,.ease-enter-active{opacity:0;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}.ease-leave-active{-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes ivuEaseIn{0%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes ivuEaseIn{0%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes ivuEaseOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}@keyframes ivuEaseOut{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(.9);transform:scale(.9)}}.transition-drop-appear,.transition-drop-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.transition-drop-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.transition-drop-appear,.transition-drop-enter-active{-webkit-animation-name:ivuTransitionDropIn;animation-name:ivuTransitionDropIn;-webkit-animation-play-state:running;animation-play-state:running}.transition-drop-leave-active{-webkit-animation-name:ivuTransitionDropOut;animation-name:ivuTransitionDropOut;-webkit-animation-play-state:running;animation-play-state:running}.transition-drop-appear,.transition-drop-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.transition-drop-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-up-appear,.slide-up-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-up-appear,.slide-up-enter-active{-webkit-animation-name:ivuSlideUpIn;animation-name:ivuSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-leave-active{-webkit-animation-name:ivuSlideUpOut;animation-name:ivuSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-up-appear,.slide-up-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-up-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-down-appear,.slide-down-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-down-appear,.slide-down-enter-active{-webkit-animation-name:ivuSlideDownIn;animation-name:ivuSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-leave-active{-webkit-animation-name:ivuSlideDownOut;animation-name:ivuSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-down-appear,.slide-down-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-down-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-left-appear,.slide-left-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-left-appear,.slide-left-enter-active{-webkit-animation-name:ivuSlideLeftIn;animation-name:ivuSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-leave-active{-webkit-animation-name:ivuSlideLeftOut;animation-name:ivuSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-left-appear,.slide-left-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-left-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-right-appear,.slide-right-enter-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.slide-right-appear,.slide-right-enter-active{-webkit-animation-name:ivuSlideRightIn;animation-name:ivuSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-leave-active{-webkit-animation-name:ivuSlideRightOut;animation-name:ivuSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running}.slide-right-appear,.slide-right-enter-active{opacity:0;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.slide-right-leave-active{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes ivuTransitionDropIn{0%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuTransitionDropIn{0%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuTransitionDropOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuTransitionDropOut{0%{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuSlideUpIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuSlideUpOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@keyframes ivuSlideDownIn{0%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}100%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}}@-webkit-keyframes ivuSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@keyframes ivuSlideDownOut{0%{opacity:1;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(1);transform:scaleY(1)}100%{opacity:0;-webkit-transform-origin:100% 100%;transform-origin:100% 100%;-webkit-transform:scaleY(.8);transform:scaleY(.8)}}@-webkit-keyframes ivuSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes ivuSlideLeftIn{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes ivuSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes ivuSlideLeftOut{0%{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@-webkit-keyframes ivuSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes ivuSlideRightIn{0%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}100%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}}@-webkit-keyframes ivuSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}@keyframes ivuSlideRightOut{0%{opacity:1;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(1);transform:scaleX(1)}100%{opacity:0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.8);transform:scaleX(.8)}}.collapse-transition{-webkit-transition:.2s height ease-in-out,.2s padding-top ease-in-out,.2s padding-bottom ease-in-out;transition:.2s height ease-in-out,.2s padding-top ease-in-out,.2s padding-bottom ease-in-out}.ivu-btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;line-height:1.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:32px;padding:0 15px;font-size:14px;border-radius:4px;-webkit-transition:color .2s linear,background-color .2s linear,border .2s linear,-webkit-box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,-webkit-box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear;transition:color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear,-webkit-box-shadow .2s linear;color:#515a6e;background-color:#fff;border-color:#dcdee2}.ivu-btn>.ivu-icon{line-height:1.5}.ivu-btn-icon-only.ivu-btn-circle>.ivu-icon{vertical-align:baseline}.ivu-btn>i,.ivu-btn>span{display:inline-block}.ivu-btn,.ivu-btn:active,.ivu-btn:focus{outline:0}.ivu-btn:not([disabled]):hover{text-decoration:none}.ivu-btn:not([disabled]):active{outline:0}.ivu-btn.disabled,.ivu-btn[disabled]{cursor:not-allowed}.ivu-btn.disabled>*,.ivu-btn[disabled]>*{pointer-events:none}.ivu-btn-large{height:40px;padding:0 15px;font-size:16px;border-radius:4px}.ivu-btn-small{height:24px;padding:0 7px;font-size:14px;border-radius:3px}.ivu-btn-icon-only{width:32px;height:32px;padding:0;font-size:16px;border-radius:4px}.ivu-btn-icon-only.ivu-btn-large{width:40px;height:40px;padding:0;font-size:18px;border-radius:4px}.ivu-btn-icon-only.ivu-btn-small{width:24px;height:24px;padding:0;font-size:14px;border-radius:4px}.ivu-btn>a:only-child{color:currentColor}.ivu-btn>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:hover{color:#747b8b;background-color:#fff;border-color:#e3e5e8}.ivu-btn:hover>a:only-child{color:currentColor}.ivu-btn:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.active,.ivu-btn:active{color:#4d5669;background-color:#f2f2f2;border-color:#f2f2f2}.ivu-btn.active>a:only-child,.ivu-btn:active>a:only-child{color:currentColor}.ivu-btn.active>a:only-child:after,.ivu-btn:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.disabled,.ivu-btn.disabled.active,.ivu-btn.disabled:active,.ivu-btn.disabled:focus,.ivu-btn.disabled:hover,.ivu-btn[disabled],.ivu-btn[disabled].active,.ivu-btn[disabled]:active,.ivu-btn[disabled]:focus,.ivu-btn[disabled]:hover,fieldset[disabled] .ivu-btn,fieldset[disabled] .ivu-btn.active,fieldset[disabled] .ivu-btn:active,fieldset[disabled] .ivu-btn:focus,fieldset[disabled] .ivu-btn:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn.disabled.active>a:only-child,.ivu-btn.disabled:active>a:only-child,.ivu-btn.disabled:focus>a:only-child,.ivu-btn.disabled:hover>a:only-child,.ivu-btn.disabled>a:only-child,.ivu-btn[disabled].active>a:only-child,.ivu-btn[disabled]:active>a:only-child,.ivu-btn[disabled]:focus>a:only-child,.ivu-btn[disabled]:hover>a:only-child,.ivu-btn[disabled]>a:only-child,fieldset[disabled] .ivu-btn.active>a:only-child,fieldset[disabled] .ivu-btn:active>a:only-child,fieldset[disabled] .ivu-btn:focus>a:only-child,fieldset[disabled] .ivu-btn:hover>a:only-child,fieldset[disabled] .ivu-btn>a:only-child{color:currentColor}.ivu-btn.disabled.active>a:only-child:after,.ivu-btn.disabled:active>a:only-child:after,.ivu-btn.disabled:focus>a:only-child:after,.ivu-btn.disabled:hover>a:only-child:after,.ivu-btn.disabled>a:only-child:after,.ivu-btn[disabled].active>a:only-child:after,.ivu-btn[disabled]:active>a:only-child:after,.ivu-btn[disabled]:focus>a:only-child:after,.ivu-btn[disabled]:hover>a:only-child:after,.ivu-btn[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn.active>a:only-child:after,fieldset[disabled] .ivu-btn:active>a:only-child:after,fieldset[disabled] .ivu-btn:focus>a:only-child:after,fieldset[disabled] .ivu-btn:hover>a:only-child:after,fieldset[disabled] .ivu-btn>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:hover{color:#57a3f3;background-color:#fff;border-color:#57a3f3}.ivu-btn:hover>a:only-child{color:currentColor}.ivu-btn:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn.active,.ivu-btn:active{color:#2b85e4;background-color:#fff;border-color:#2b85e4}.ivu-btn.active>a:only-child,.ivu-btn:active>a:only-child{color:currentColor}.ivu-btn.active>a:only-child:after,.ivu-btn:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-long{width:100%}.ivu-btn>.ivu-icon+span,.ivu-btn>span+.ivu-icon{margin-left:4px}.ivu-btn-primary{color:#fff;background-color:#2d8cf0;border-color:#2d8cf0}.ivu-btn-primary>a:only-child{color:currentColor}.ivu-btn-primary>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary:hover{color:#fff;background-color:#57a3f3;border-color:#57a3f3}.ivu-btn-primary:hover>a:only-child{color:currentColor}.ivu-btn-primary:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.active,.ivu-btn-primary:active{color:#f2f2f2;background-color:#2b85e4;border-color:#2b85e4}.ivu-btn-primary.active>a:only-child,.ivu-btn-primary:active>a:only-child{color:currentColor}.ivu-btn-primary.active>a:only-child:after,.ivu-btn-primary:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.disabled,.ivu-btn-primary.disabled.active,.ivu-btn-primary.disabled:active,.ivu-btn-primary.disabled:focus,.ivu-btn-primary.disabled:hover,.ivu-btn-primary[disabled],.ivu-btn-primary[disabled].active,.ivu-btn-primary[disabled]:active,.ivu-btn-primary[disabled]:focus,.ivu-btn-primary[disabled]:hover,fieldset[disabled] .ivu-btn-primary,fieldset[disabled] .ivu-btn-primary.active,fieldset[disabled] .ivu-btn-primary:active,fieldset[disabled] .ivu-btn-primary:focus,fieldset[disabled] .ivu-btn-primary:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-primary.disabled.active>a:only-child,.ivu-btn-primary.disabled:active>a:only-child,.ivu-btn-primary.disabled:focus>a:only-child,.ivu-btn-primary.disabled:hover>a:only-child,.ivu-btn-primary.disabled>a:only-child,.ivu-btn-primary[disabled].active>a:only-child,.ivu-btn-primary[disabled]:active>a:only-child,.ivu-btn-primary[disabled]:focus>a:only-child,.ivu-btn-primary[disabled]:hover>a:only-child,.ivu-btn-primary[disabled]>a:only-child,fieldset[disabled] .ivu-btn-primary.active>a:only-child,fieldset[disabled] .ivu-btn-primary:active>a:only-child,fieldset[disabled] .ivu-btn-primary:focus>a:only-child,fieldset[disabled] .ivu-btn-primary:hover>a:only-child,fieldset[disabled] .ivu-btn-primary>a:only-child{color:currentColor}.ivu-btn-primary.disabled.active>a:only-child:after,.ivu-btn-primary.disabled:active>a:only-child:after,.ivu-btn-primary.disabled:focus>a:only-child:after,.ivu-btn-primary.disabled:hover>a:only-child:after,.ivu-btn-primary.disabled>a:only-child:after,.ivu-btn-primary[disabled].active>a:only-child:after,.ivu-btn-primary[disabled]:active>a:only-child:after,.ivu-btn-primary[disabled]:focus>a:only-child:after,.ivu-btn-primary[disabled]:hover>a:only-child:after,.ivu-btn-primary[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-primary.active>a:only-child:after,fieldset[disabled] .ivu-btn-primary:active>a:only-child:after,fieldset[disabled] .ivu-btn-primary:focus>a:only-child:after,fieldset[disabled] .ivu-btn-primary:hover>a:only-child:after,fieldset[disabled] .ivu-btn-primary>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-primary.active,.ivu-btn-primary:active,.ivu-btn-primary:hover{color:#fff}.ivu-btn-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:not(:first-child):not(:last-child){border-right-color:#2b85e4;border-left-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child){border-right-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#dcdee2}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary+.ivu-btn,.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:last-child:not(:first-child){border-left-color:#2b85e4}.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary+.ivu-btn[disabled],.ivu-btn-group:not(.ivu-btn-group-vertical) .ivu-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#dcdee2}.ivu-btn-group-vertical .ivu-btn-primary:not(:first-child):not(:last-child){border-top-color:#2b85e4;border-bottom-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary:first-child:not(:last-child){border-bottom-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary:first-child:not(:last-child)[disabled]{border-top-color:#dcdee2}.ivu-btn-group-vertical .ivu-btn-primary+.ivu-btn,.ivu-btn-group-vertical .ivu-btn-primary:last-child:not(:first-child){border-top-color:#2b85e4}.ivu-btn-group-vertical .ivu-btn-primary+.ivu-btn[disabled],.ivu-btn-group-vertical .ivu-btn-primary:last-child:not(:first-child)[disabled]{border-bottom-color:#dcdee2}.ivu-btn-dashed{color:#515a6e;background-color:#fff;border-color:#dcdee2;border-style:dashed}.ivu-btn-dashed>a:only-child{color:currentColor}.ivu-btn-dashed>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:hover{color:#747b8b;background-color:#fff;border-color:#e3e5e8}.ivu-btn-dashed:hover>a:only-child{color:currentColor}.ivu-btn-dashed:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.active,.ivu-btn-dashed:active{color:#4d5669;background-color:#f2f2f2;border-color:#f2f2f2}.ivu-btn-dashed.active>a:only-child,.ivu-btn-dashed:active>a:only-child{color:currentColor}.ivu-btn-dashed.active>a:only-child:after,.ivu-btn-dashed:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.disabled,.ivu-btn-dashed.disabled.active,.ivu-btn-dashed.disabled:active,.ivu-btn-dashed.disabled:focus,.ivu-btn-dashed.disabled:hover,.ivu-btn-dashed[disabled],.ivu-btn-dashed[disabled].active,.ivu-btn-dashed[disabled]:active,.ivu-btn-dashed[disabled]:focus,.ivu-btn-dashed[disabled]:hover,fieldset[disabled] .ivu-btn-dashed,fieldset[disabled] .ivu-btn-dashed.active,fieldset[disabled] .ivu-btn-dashed:active,fieldset[disabled] .ivu-btn-dashed:focus,fieldset[disabled] .ivu-btn-dashed:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-dashed.disabled.active>a:only-child,.ivu-btn-dashed.disabled:active>a:only-child,.ivu-btn-dashed.disabled:focus>a:only-child,.ivu-btn-dashed.disabled:hover>a:only-child,.ivu-btn-dashed.disabled>a:only-child,.ivu-btn-dashed[disabled].active>a:only-child,.ivu-btn-dashed[disabled]:active>a:only-child,.ivu-btn-dashed[disabled]:focus>a:only-child,.ivu-btn-dashed[disabled]:hover>a:only-child,.ivu-btn-dashed[disabled]>a:only-child,fieldset[disabled] .ivu-btn-dashed.active>a:only-child,fieldset[disabled] .ivu-btn-dashed:active>a:only-child,fieldset[disabled] .ivu-btn-dashed:focus>a:only-child,fieldset[disabled] .ivu-btn-dashed:hover>a:only-child,fieldset[disabled] .ivu-btn-dashed>a:only-child{color:currentColor}.ivu-btn-dashed.disabled.active>a:only-child:after,.ivu-btn-dashed.disabled:active>a:only-child:after,.ivu-btn-dashed.disabled:focus>a:only-child:after,.ivu-btn-dashed.disabled:hover>a:only-child:after,.ivu-btn-dashed.disabled>a:only-child:after,.ivu-btn-dashed[disabled].active>a:only-child:after,.ivu-btn-dashed[disabled]:active>a:only-child:after,.ivu-btn-dashed[disabled]:focus>a:only-child:after,.ivu-btn-dashed[disabled]:hover>a:only-child:after,.ivu-btn-dashed[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-dashed.active>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:active>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:focus>a:only-child:after,fieldset[disabled] .ivu-btn-dashed:hover>a:only-child:after,fieldset[disabled] .ivu-btn-dashed>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:hover{color:#57a3f3;background-color:#fff;border-color:#57a3f3}.ivu-btn-dashed:hover>a:only-child{color:currentColor}.ivu-btn-dashed:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed.active,.ivu-btn-dashed:active{color:#2b85e4;background-color:#fff;border-color:#2b85e4}.ivu-btn-dashed.active>a:only-child,.ivu-btn-dashed:active>a:only-child{color:currentColor}.ivu-btn-dashed.active>a:only-child:after,.ivu-btn-dashed:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-dashed:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-text{color:#515a6e;background-color:transparent;border-color:transparent}.ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:hover{color:#747b8b;background-color:rgba(255,255,255,.2);border-color:rgba(255,255,255,.2)}.ivu-btn-text:hover>a:only-child{color:currentColor}.ivu-btn-text:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.active,.ivu-btn-text:active{color:#4d5669;background-color:rgba(0,0,0,.05);border-color:rgba(0,0,0,.05)}.ivu-btn-text.active>a:only-child,.ivu-btn-text:active>a:only-child{color:currentColor}.ivu-btn-text.active>a:only-child:after,.ivu-btn-text:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.disabled,.ivu-btn-text.disabled.active,.ivu-btn-text.disabled:active,.ivu-btn-text.disabled:focus,.ivu-btn-text.disabled:hover,.ivu-btn-text[disabled],.ivu-btn-text[disabled].active,.ivu-btn-text[disabled]:active,.ivu-btn-text[disabled]:focus,.ivu-btn-text[disabled]:hover,fieldset[disabled] .ivu-btn-text,fieldset[disabled] .ivu-btn-text.active,fieldset[disabled] .ivu-btn-text:active,fieldset[disabled] .ivu-btn-text:focus,fieldset[disabled] .ivu-btn-text:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-text.disabled.active>a:only-child,.ivu-btn-text.disabled:active>a:only-child,.ivu-btn-text.disabled:focus>a:only-child,.ivu-btn-text.disabled:hover>a:only-child,.ivu-btn-text.disabled>a:only-child,.ivu-btn-text[disabled].active>a:only-child,.ivu-btn-text[disabled]:active>a:only-child,.ivu-btn-text[disabled]:focus>a:only-child,.ivu-btn-text[disabled]:hover>a:only-child,.ivu-btn-text[disabled]>a:only-child,fieldset[disabled] .ivu-btn-text.active>a:only-child,fieldset[disabled] .ivu-btn-text:active>a:only-child,fieldset[disabled] .ivu-btn-text:focus>a:only-child,fieldset[disabled] .ivu-btn-text:hover>a:only-child,fieldset[disabled] .ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text.disabled.active>a:only-child:after,.ivu-btn-text.disabled:active>a:only-child:after,.ivu-btn-text.disabled:focus>a:only-child:after,.ivu-btn-text.disabled:hover>a:only-child:after,.ivu-btn-text.disabled>a:only-child:after,.ivu-btn-text[disabled].active>a:only-child:after,.ivu-btn-text[disabled]:active>a:only-child:after,.ivu-btn-text[disabled]:focus>a:only-child:after,.ivu-btn-text[disabled]:hover>a:only-child:after,.ivu-btn-text[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-text.active>a:only-child:after,fieldset[disabled] .ivu-btn-text:active>a:only-child:after,fieldset[disabled] .ivu-btn-text:focus>a:only-child:after,fieldset[disabled] .ivu-btn-text:hover>a:only-child:after,fieldset[disabled] .ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.disabled,.ivu-btn-text.disabled.active,.ivu-btn-text.disabled:active,.ivu-btn-text.disabled:focus,.ivu-btn-text.disabled:hover,.ivu-btn-text[disabled],.ivu-btn-text[disabled].active,.ivu-btn-text[disabled]:active,.ivu-btn-text[disabled]:focus,.ivu-btn-text[disabled]:hover,fieldset[disabled] .ivu-btn-text,fieldset[disabled] .ivu-btn-text.active,fieldset[disabled] .ivu-btn-text:active,fieldset[disabled] .ivu-btn-text:focus,fieldset[disabled] .ivu-btn-text:hover{color:#c5c8ce;background-color:#fff;border-color:transparent}.ivu-btn-text.disabled.active>a:only-child,.ivu-btn-text.disabled:active>a:only-child,.ivu-btn-text.disabled:focus>a:only-child,.ivu-btn-text.disabled:hover>a:only-child,.ivu-btn-text.disabled>a:only-child,.ivu-btn-text[disabled].active>a:only-child,.ivu-btn-text[disabled]:active>a:only-child,.ivu-btn-text[disabled]:focus>a:only-child,.ivu-btn-text[disabled]:hover>a:only-child,.ivu-btn-text[disabled]>a:only-child,fieldset[disabled] .ivu-btn-text.active>a:only-child,fieldset[disabled] .ivu-btn-text:active>a:only-child,fieldset[disabled] .ivu-btn-text:focus>a:only-child,fieldset[disabled] .ivu-btn-text:hover>a:only-child,fieldset[disabled] .ivu-btn-text>a:only-child{color:currentColor}.ivu-btn-text.disabled.active>a:only-child:after,.ivu-btn-text.disabled:active>a:only-child:after,.ivu-btn-text.disabled:focus>a:only-child:after,.ivu-btn-text.disabled:hover>a:only-child:after,.ivu-btn-text.disabled>a:only-child:after,.ivu-btn-text[disabled].active>a:only-child:after,.ivu-btn-text[disabled]:active>a:only-child:after,.ivu-btn-text[disabled]:focus>a:only-child:after,.ivu-btn-text[disabled]:hover>a:only-child:after,.ivu-btn-text[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-text.active>a:only-child:after,fieldset[disabled] .ivu-btn-text:active>a:only-child:after,fieldset[disabled] .ivu-btn-text:focus>a:only-child:after,fieldset[disabled] .ivu-btn-text:hover>a:only-child:after,fieldset[disabled] .ivu-btn-text>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:hover{color:#57a3f3;background-color:#fff;border-color:transparent}.ivu-btn-text:hover>a:only-child{color:currentColor}.ivu-btn-text:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text.active,.ivu-btn-text:active{color:#2b85e4;background-color:#fff;border-color:transparent}.ivu-btn-text.active>a:only-child,.ivu-btn-text:active>a:only-child{color:currentColor}.ivu-btn-text.active>a:only-child:after,.ivu-btn-text:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-text:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-btn-success{color:#fff;background-color:#19be6b;border-color:#19be6b}.ivu-btn-success>a:only-child{color:currentColor}.ivu-btn-success>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success:hover{color:#fff;background-color:#47cb89;border-color:#47cb89}.ivu-btn-success:hover>a:only-child{color:currentColor}.ivu-btn-success:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.active,.ivu-btn-success:active{color:#f2f2f2;background-color:#18b566;border-color:#18b566}.ivu-btn-success.active>a:only-child,.ivu-btn-success:active>a:only-child{color:currentColor}.ivu-btn-success.active>a:only-child:after,.ivu-btn-success:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.disabled,.ivu-btn-success.disabled.active,.ivu-btn-success.disabled:active,.ivu-btn-success.disabled:focus,.ivu-btn-success.disabled:hover,.ivu-btn-success[disabled],.ivu-btn-success[disabled].active,.ivu-btn-success[disabled]:active,.ivu-btn-success[disabled]:focus,.ivu-btn-success[disabled]:hover,fieldset[disabled] .ivu-btn-success,fieldset[disabled] .ivu-btn-success.active,fieldset[disabled] .ivu-btn-success:active,fieldset[disabled] .ivu-btn-success:focus,fieldset[disabled] .ivu-btn-success:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-success.disabled.active>a:only-child,.ivu-btn-success.disabled:active>a:only-child,.ivu-btn-success.disabled:focus>a:only-child,.ivu-btn-success.disabled:hover>a:only-child,.ivu-btn-success.disabled>a:only-child,.ivu-btn-success[disabled].active>a:only-child,.ivu-btn-success[disabled]:active>a:only-child,.ivu-btn-success[disabled]:focus>a:only-child,.ivu-btn-success[disabled]:hover>a:only-child,.ivu-btn-success[disabled]>a:only-child,fieldset[disabled] .ivu-btn-success.active>a:only-child,fieldset[disabled] .ivu-btn-success:active>a:only-child,fieldset[disabled] .ivu-btn-success:focus>a:only-child,fieldset[disabled] .ivu-btn-success:hover>a:only-child,fieldset[disabled] .ivu-btn-success>a:only-child{color:currentColor}.ivu-btn-success.disabled.active>a:only-child:after,.ivu-btn-success.disabled:active>a:only-child:after,.ivu-btn-success.disabled:focus>a:only-child:after,.ivu-btn-success.disabled:hover>a:only-child:after,.ivu-btn-success.disabled>a:only-child:after,.ivu-btn-success[disabled].active>a:only-child:after,.ivu-btn-success[disabled]:active>a:only-child:after,.ivu-btn-success[disabled]:focus>a:only-child:after,.ivu-btn-success[disabled]:hover>a:only-child:after,.ivu-btn-success[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-success.active>a:only-child:after,fieldset[disabled] .ivu-btn-success:active>a:only-child:after,fieldset[disabled] .ivu-btn-success:focus>a:only-child:after,fieldset[disabled] .ivu-btn-success:hover>a:only-child:after,fieldset[disabled] .ivu-btn-success>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-success.active,.ivu-btn-success:active,.ivu-btn-success:hover{color:#fff}.ivu-btn-success:focus{-webkit-box-shadow:0 0 0 2px rgba(25,190,107,.2);box-shadow:0 0 0 2px rgba(25,190,107,.2)}.ivu-btn-warning{color:#fff;background-color:#f90;border-color:#f90}.ivu-btn-warning>a:only-child{color:currentColor}.ivu-btn-warning>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning:hover{color:#fff;background-color:#ffad33;border-color:#ffad33}.ivu-btn-warning:hover>a:only-child{color:currentColor}.ivu-btn-warning:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.active,.ivu-btn-warning:active{color:#f2f2f2;background-color:#f29100;border-color:#f29100}.ivu-btn-warning.active>a:only-child,.ivu-btn-warning:active>a:only-child{color:currentColor}.ivu-btn-warning.active>a:only-child:after,.ivu-btn-warning:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.disabled,.ivu-btn-warning.disabled.active,.ivu-btn-warning.disabled:active,.ivu-btn-warning.disabled:focus,.ivu-btn-warning.disabled:hover,.ivu-btn-warning[disabled],.ivu-btn-warning[disabled].active,.ivu-btn-warning[disabled]:active,.ivu-btn-warning[disabled]:focus,.ivu-btn-warning[disabled]:hover,fieldset[disabled] .ivu-btn-warning,fieldset[disabled] .ivu-btn-warning.active,fieldset[disabled] .ivu-btn-warning:active,fieldset[disabled] .ivu-btn-warning:focus,fieldset[disabled] .ivu-btn-warning:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-warning.disabled.active>a:only-child,.ivu-btn-warning.disabled:active>a:only-child,.ivu-btn-warning.disabled:focus>a:only-child,.ivu-btn-warning.disabled:hover>a:only-child,.ivu-btn-warning.disabled>a:only-child,.ivu-btn-warning[disabled].active>a:only-child,.ivu-btn-warning[disabled]:active>a:only-child,.ivu-btn-warning[disabled]:focus>a:only-child,.ivu-btn-warning[disabled]:hover>a:only-child,.ivu-btn-warning[disabled]>a:only-child,fieldset[disabled] .ivu-btn-warning.active>a:only-child,fieldset[disabled] .ivu-btn-warning:active>a:only-child,fieldset[disabled] .ivu-btn-warning:focus>a:only-child,fieldset[disabled] .ivu-btn-warning:hover>a:only-child,fieldset[disabled] .ivu-btn-warning>a:only-child{color:currentColor}.ivu-btn-warning.disabled.active>a:only-child:after,.ivu-btn-warning.disabled:active>a:only-child:after,.ivu-btn-warning.disabled:focus>a:only-child:after,.ivu-btn-warning.disabled:hover>a:only-child:after,.ivu-btn-warning.disabled>a:only-child:after,.ivu-btn-warning[disabled].active>a:only-child:after,.ivu-btn-warning[disabled]:active>a:only-child:after,.ivu-btn-warning[disabled]:focus>a:only-child:after,.ivu-btn-warning[disabled]:hover>a:only-child:after,.ivu-btn-warning[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-warning.active>a:only-child:after,fieldset[disabled] .ivu-btn-warning:active>a:only-child:after,fieldset[disabled] .ivu-btn-warning:focus>a:only-child:after,fieldset[disabled] .ivu-btn-warning:hover>a:only-child:after,fieldset[disabled] .ivu-btn-warning>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-warning.active,.ivu-btn-warning:active,.ivu-btn-warning:hover{color:#fff}.ivu-btn-warning:focus{-webkit-box-shadow:0 0 0 2px rgba(255,153,0,.2);box-shadow:0 0 0 2px rgba(255,153,0,.2)}.ivu-btn-error{color:#fff;background-color:#ed4014;border-color:#ed4014}.ivu-btn-error>a:only-child{color:currentColor}.ivu-btn-error>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error:hover{color:#fff;background-color:#f16643;border-color:#f16643}.ivu-btn-error:hover>a:only-child{color:currentColor}.ivu-btn-error:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.active,.ivu-btn-error:active{color:#f2f2f2;background-color:#e13d13;border-color:#e13d13}.ivu-btn-error.active>a:only-child,.ivu-btn-error:active>a:only-child{color:currentColor}.ivu-btn-error.active>a:only-child:after,.ivu-btn-error:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.disabled,.ivu-btn-error.disabled.active,.ivu-btn-error.disabled:active,.ivu-btn-error.disabled:focus,.ivu-btn-error.disabled:hover,.ivu-btn-error[disabled],.ivu-btn-error[disabled].active,.ivu-btn-error[disabled]:active,.ivu-btn-error[disabled]:focus,.ivu-btn-error[disabled]:hover,fieldset[disabled] .ivu-btn-error,fieldset[disabled] .ivu-btn-error.active,fieldset[disabled] .ivu-btn-error:active,fieldset[disabled] .ivu-btn-error:focus,fieldset[disabled] .ivu-btn-error:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-error.disabled.active>a:only-child,.ivu-btn-error.disabled:active>a:only-child,.ivu-btn-error.disabled:focus>a:only-child,.ivu-btn-error.disabled:hover>a:only-child,.ivu-btn-error.disabled>a:only-child,.ivu-btn-error[disabled].active>a:only-child,.ivu-btn-error[disabled]:active>a:only-child,.ivu-btn-error[disabled]:focus>a:only-child,.ivu-btn-error[disabled]:hover>a:only-child,.ivu-btn-error[disabled]>a:only-child,fieldset[disabled] .ivu-btn-error.active>a:only-child,fieldset[disabled] .ivu-btn-error:active>a:only-child,fieldset[disabled] .ivu-btn-error:focus>a:only-child,fieldset[disabled] .ivu-btn-error:hover>a:only-child,fieldset[disabled] .ivu-btn-error>a:only-child{color:currentColor}.ivu-btn-error.disabled.active>a:only-child:after,.ivu-btn-error.disabled:active>a:only-child:after,.ivu-btn-error.disabled:focus>a:only-child:after,.ivu-btn-error.disabled:hover>a:only-child:after,.ivu-btn-error.disabled>a:only-child:after,.ivu-btn-error[disabled].active>a:only-child:after,.ivu-btn-error[disabled]:active>a:only-child:after,.ivu-btn-error[disabled]:focus>a:only-child:after,.ivu-btn-error[disabled]:hover>a:only-child:after,.ivu-btn-error[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-error.active>a:only-child:after,fieldset[disabled] .ivu-btn-error:active>a:only-child:after,fieldset[disabled] .ivu-btn-error:focus>a:only-child:after,fieldset[disabled] .ivu-btn-error:hover>a:only-child:after,fieldset[disabled] .ivu-btn-error>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-error.active,.ivu-btn-error:active,.ivu-btn-error:hover{color:#fff}.ivu-btn-error:focus{-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-btn-info{color:#fff;background-color:#2db7f5;border-color:#2db7f5}.ivu-btn-info>a:only-child{color:currentColor}.ivu-btn-info>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info:hover{color:#fff;background-color:#57c5f7;border-color:#57c5f7}.ivu-btn-info:hover>a:only-child{color:currentColor}.ivu-btn-info:hover>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.active,.ivu-btn-info:active{color:#f2f2f2;background-color:#2baee9;border-color:#2baee9}.ivu-btn-info.active>a:only-child,.ivu-btn-info:active>a:only-child{color:currentColor}.ivu-btn-info.active>a:only-child:after,.ivu-btn-info:active>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.disabled,.ivu-btn-info.disabled.active,.ivu-btn-info.disabled:active,.ivu-btn-info.disabled:focus,.ivu-btn-info.disabled:hover,.ivu-btn-info[disabled],.ivu-btn-info[disabled].active,.ivu-btn-info[disabled]:active,.ivu-btn-info[disabled]:focus,.ivu-btn-info[disabled]:hover,fieldset[disabled] .ivu-btn-info,fieldset[disabled] .ivu-btn-info.active,fieldset[disabled] .ivu-btn-info:active,fieldset[disabled] .ivu-btn-info:focus,fieldset[disabled] .ivu-btn-info:hover{color:#c5c8ce;background-color:#f7f7f7;border-color:#dcdee2}.ivu-btn-info.disabled.active>a:only-child,.ivu-btn-info.disabled:active>a:only-child,.ivu-btn-info.disabled:focus>a:only-child,.ivu-btn-info.disabled:hover>a:only-child,.ivu-btn-info.disabled>a:only-child,.ivu-btn-info[disabled].active>a:only-child,.ivu-btn-info[disabled]:active>a:only-child,.ivu-btn-info[disabled]:focus>a:only-child,.ivu-btn-info[disabled]:hover>a:only-child,.ivu-btn-info[disabled]>a:only-child,fieldset[disabled] .ivu-btn-info.active>a:only-child,fieldset[disabled] .ivu-btn-info:active>a:only-child,fieldset[disabled] .ivu-btn-info:focus>a:only-child,fieldset[disabled] .ivu-btn-info:hover>a:only-child,fieldset[disabled] .ivu-btn-info>a:only-child{color:currentColor}.ivu-btn-info.disabled.active>a:only-child:after,.ivu-btn-info.disabled:active>a:only-child:after,.ivu-btn-info.disabled:focus>a:only-child:after,.ivu-btn-info.disabled:hover>a:only-child:after,.ivu-btn-info.disabled>a:only-child:after,.ivu-btn-info[disabled].active>a:only-child:after,.ivu-btn-info[disabled]:active>a:only-child:after,.ivu-btn-info[disabled]:focus>a:only-child:after,.ivu-btn-info[disabled]:hover>a:only-child:after,.ivu-btn-info[disabled]>a:only-child:after,fieldset[disabled] .ivu-btn-info.active>a:only-child:after,fieldset[disabled] .ivu-btn-info:active>a:only-child:after,fieldset[disabled] .ivu-btn-info:focus>a:only-child:after,fieldset[disabled] .ivu-btn-info:hover>a:only-child:after,fieldset[disabled] .ivu-btn-info>a:only-child:after{content:'';position:absolute;top:0;left:0;bottom:0;right:0;background:0 0}.ivu-btn-info.active,.ivu-btn-info:active,.ivu-btn-info:hover{color:#fff}.ivu-btn-info:focus{-webkit-box-shadow:0 0 0 2px rgba(45,183,245,.2);box-shadow:0 0 0 2px rgba(45,183,245,.2)}.ivu-btn-circle,.ivu-btn-circle-outline{border-radius:32px}.ivu-btn-circle-outline.ivu-btn-large,.ivu-btn-circle.ivu-btn-large{border-radius:40px}.ivu-btn-circle-outline.ivu-btn-size,.ivu-btn-circle.ivu-btn-size{border-radius:24px}.ivu-btn-circle-outline.ivu-btn-icon-only,.ivu-btn-circle.ivu-btn-icon-only{width:32px;height:32px;padding:0;font-size:16px;border-radius:50%}.ivu-btn-circle-outline.ivu-btn-icon-only.ivu-btn-large,.ivu-btn-circle.ivu-btn-icon-only.ivu-btn-large{width:40px;height:40px;padding:0;font-size:18px;border-radius:50%}.ivu-btn-circle-outline.ivu-btn-icon-only.ivu-btn-small,.ivu-btn-circle.ivu-btn-icon-only.ivu-btn-small{width:24px;height:24px;padding:0;font-size:14px;border-radius:50%}.ivu-btn:before{position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;background:#fff;opacity:.35;content:'';border-radius:inherit;z-index:1;-webkit-transition:opacity .2s;transition:opacity .2s;pointer-events:none;display:none}.ivu-btn.ivu-btn-loading{pointer-events:none;position:relative}.ivu-btn.ivu-btn-loading:before{display:block}.ivu-btn-group{position:relative;display:inline-block;vertical-align:middle}.ivu-btn-group>.ivu-btn{position:relative;float:left}.ivu-btn-group>.ivu-btn.active,.ivu-btn-group>.ivu-btn:active,.ivu-btn-group>.ivu-btn:hover{z-index:2}.ivu-btn-group-circle .ivu-btn{border-radius:32px}.ivu-btn-group-large.ivu-btn-group-circle .ivu-btn{border-radius:40px}.ivu-btn-group-large>.ivu-btn{height:40px;padding:0 15px;font-size:16px;border-radius:4px}.ivu-btn-group-small.ivu-btn-group-circle .ivu-btn{border-radius:24px}.ivu-btn-group-small>.ivu-btn{height:24px;padding:0 7px;font-size:14px;border-radius:3px}.ivu-btn-group-small>.ivu-btn>.ivu-icon{font-size:14px}.ivu-btn-group-small .ivu-btn-icon-only{width:24px;height:24px;padding:0}.ivu-btn-group-large .ivu-btn-icon-only{width:40px;height:40px;padding:0}.ivu-btn+.ivu-btn-group,.ivu-btn-group .ivu-btn+.ivu-btn,.ivu-btn-group+.ivu-btn,.ivu-btn-group+.ivu-btn-group{margin-left:-1px}.ivu-btn-group .ivu-btn:not(:first-child):not(:last-child){border-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:first-child{margin-left:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ivu-btn-group>.ivu-btn-group{float:left}.ivu-btn-group>.ivu-btn-group:not(:first-child):not(:last-child)>.ivu-btn{border-radius:0}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn-group:first-child:not(:last-child)>.ivu-btn:last-child{border-bottom-right-radius:0;border-top-right-radius:0;padding-right:8px}.ivu-btn-group:not(.ivu-btn-group-vertical)>.ivu-btn-group:last-child:not(:first-child)>.ivu-btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px}.ivu-btn-group-vertical{display:inline-block;vertical-align:middle}.ivu-btn-group-vertical>.ivu-btn{display:block;width:100%;max-width:100%;float:none;min-width:32px}.ivu-btn-group-vertical.ivu-btn-group-small>.ivu-btn{min-width:24px}.ivu-btn-group-vertical.ivu-btn-group-large>.ivu-btn{min-width:40px}.ivu-btn+.ivu-btn-group-vertical,.ivu-btn-group-vertical .ivu-btn+.ivu-btn,.ivu-btn-group-vertical+.ivu-btn,.ivu-btn-group-vertical+.ivu-btn-group-vertical{margin-top:-1px;margin-left:0}.ivu-btn-group-vertical>.ivu-btn:first-child{margin-top:0}.ivu-btn-group-vertical>.ivu-btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0}.ivu-btn-group-vertical>.ivu-btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.ivu-btn-group-vertical>.ivu-btn-group-vertical:first-child:not(:last-child)>.ivu-btn:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:8px}.ivu-btn-group-vertical>.ivu-btn-group-vertical:last-child:not(:first-child)>.ivu-btn:first-child{border-bottom-right-radius:0;border-bottom-left-radius:0;padding-top:8px}.ivu-btn-ghost{color:#fff;background:0 0}.ivu-btn-ghost:hover{background:0 0}.ivu-btn-ghost.ivu-btn-dashed,.ivu-btn-ghost.ivu-btn-default{color:#fff;border-color:#fff}.ivu-btn-ghost.ivu-btn-dashed:hover,.ivu-btn-ghost.ivu-btn-default:hover{color:#57a3f3;border-color:#57a3f3}.ivu-btn-ghost.ivu-btn-primary{color:#2d8cf0}.ivu-btn-ghost.ivu-btn-primary:hover{color:#57a3f3;background:rgba(245,249,254,.5)}.ivu-btn-ghost.ivu-btn-info{color:#2db7f5}.ivu-btn-ghost.ivu-btn-info:hover{color:#57c5f7;background:rgba(245,251,254,.5)}.ivu-btn-ghost.ivu-btn-success{color:#19be6b}.ivu-btn-ghost.ivu-btn-success:hover{color:#47cb89;background:rgba(244,252,248,.5)}.ivu-btn-ghost.ivu-btn-warning{color:#f90}.ivu-btn-ghost.ivu-btn-warning:hover{color:#ffad33;background:rgba(255,250,242,.5)}.ivu-btn-ghost.ivu-btn-error{color:#ed4014}.ivu-btn-ghost.ivu-btn-error:hover{color:#f16643;background:rgba(254,245,243,.5)}.ivu-btn-ghost.ivu-btn-dashed[disabled],.ivu-btn-ghost.ivu-btn-default[disabled],.ivu-btn-ghost.ivu-btn-error[disabled],.ivu-btn-ghost.ivu-btn-info[disabled],.ivu-btn-ghost.ivu-btn-primary[disabled],.ivu-btn-ghost.ivu-btn-success[disabled],.ivu-btn-ghost.ivu-btn-warning[disabled]{background:0 0;color:rgba(0,0,0,.25);border-color:#dcdee2}.ivu-btn-ghost.ivu-btn-text[disabled]{background:0 0;color:rgba(0,0,0,.25)}a.ivu-btn{padding-top:.1px;line-height:30px}a.ivu-btn-large{line-height:38px}a.ivu-btn-small{line-height:22px}.ivu-affix{position:fixed;z-index:10}.ivu-back-top{z-index:10;position:fixed;cursor:pointer;display:none}.ivu-back-top.ivu-back-top-show{display:block}.ivu-back-top-inner{background-color:rgba(0,0,0,.6);border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.2);box-shadow:0 1px 3px rgba(0,0,0,.2);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-back-top-inner:hover{background-color:rgba(0,0,0,.7)}.ivu-back-top i{color:#fff;font-size:24px;padding:8px 12px}.ivu-badge{position:relative;display:inline-block}.ivu-badge-count{font-family:\"Monospaced Number\";line-height:1;vertical-align:middle;position:absolute;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);top:-10px;right:0;height:20px;border-radius:10px;min-width:20px;background:#ed4014;border:1px solid transparent;color:#fff;line-height:18px;text-align:center;padding:0 6px;font-size:12px;white-space:nowrap;-webkit-transform-origin:-10% center;-ms-transform-origin:-10% center;transform-origin:-10% center;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ivu-badge-count-custom{background:0 0;color:inherit;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.ivu-badge-count a,.ivu-badge-count a:hover{color:#fff}.ivu-badge-count-alone{top:auto;display:block;position:relative;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ivu-badge-count-primary{background:#2d8cf0}.ivu-badge-count-success{background:#19be6b}.ivu-badge-count-error{background:#ed4014}.ivu-badge-count-warning{background:#f90}.ivu-badge-count-info{background:#2db7f5}.ivu-badge-count-normal{background:#e6ebf1;color:#808695}.ivu-badge-dot{position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);-webkit-transform-origin:0 center;-ms-transform-origin:0 center;transform-origin:0 center;top:-4px;right:-8px;height:8px;width:8px;border-radius:100%;background:#ed4014;z-index:10;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.ivu-badge-status{line-height:inherit;vertical-align:baseline}.ivu-badge-status-dot{width:6px;height:6px;display:inline-block;border-radius:50%;vertical-align:middle;position:relative;top:-1px}.ivu-badge-status-success{background-color:#19be6b}.ivu-badge-status-processing{background-color:#2d8cf0;position:relative}.ivu-badge-status-processing:after{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;border:1px solid #2d8cf0;content:'';-webkit-animation:aniStatusProcessing 1.2s infinite ease-in-out;animation:aniStatusProcessing 1.2s infinite ease-in-out}.ivu-badge-status-default{background-color:#e6ebf1}.ivu-badge-status-error{background-color:#ed4014}.ivu-badge-status-warning{background-color:#f90}.ivu-badge-status-text{display:inline-block;color:#515a6e;font-size:14px;margin-left:6px}.ivu-badge-status-pink{background-color:#eb2f96}.ivu-badge-status-magenta{background-color:#eb2f96}.ivu-badge-status-red{background-color:#f5222d}.ivu-badge-status-volcano{background-color:#fa541c}.ivu-badge-status-orange{background-color:#fa8c16}.ivu-badge-status-yellow{background-color:#fadb14}.ivu-badge-status-gold{background-color:#faad14}.ivu-badge-status-cyan{background-color:#13c2c2}.ivu-badge-status-lime{background-color:#a0d911}.ivu-badge-status-green{background-color:#52c41a}.ivu-badge-status-blue{background-color:#1890ff}.ivu-badge-status-geekblue{background-color:#2f54eb}.ivu-badge-status-purple{background-color:#722ed1}@-webkit-keyframes aniStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}100%{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}@keyframes aniStatusProcessing{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:.5}100%{-webkit-transform:scale(2.4);transform:scale(2.4);opacity:0}}.ivu-chart-circle{display:inline-block;position:relative}.ivu-chart-circle-inner{width:100%;text-align:center;position:absolute;left:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);line-height:1}.ivu-spin{color:#2d8cf0;vertical-align:middle;text-align:center}.ivu-spin-dot{position:relative;display:block;border-radius:50%;background-color:#2d8cf0;width:20px;height:20px;-webkit-animation:ani-spin-bounce 1s 0s ease-in-out infinite;animation:ani-spin-bounce 1s 0s ease-in-out infinite}.ivu-spin-large .ivu-spin-dot{width:32px;height:32px}.ivu-spin-small .ivu-spin-dot{width:12px;height:12px}.ivu-spin-fix{position:absolute;top:0;left:0;z-index:8;width:100%;height:100%;background-color:rgba(255,255,255,.9)}.ivu-spin-fullscreen{z-index:2010}.ivu-spin-fullscreen-wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.ivu-spin-fix .ivu-spin-main{position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ivu-spin-fix .ivu-spin-dot{display:inline-block}.ivu-spin-show-text .ivu-spin-dot,.ivu-spin-text{display:none}.ivu-spin-show-text .ivu-spin-text{display:block}.ivu-table-wrapper>.ivu-spin-fix{border:1px solid #dcdee2;border-top:0;border-left:0}@-webkit-keyframes ani-spin-bounce{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@keyframes ani-spin-bounce{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.ivu-alert{position:relative;padding:8px 48px 8px 16px;border-radius:4px;color:#515a6e;font-size:14px;line-height:16px;margin-bottom:10px}.ivu-alert.ivu-alert-with-icon{padding:8px 48px 8px 38px}.ivu-alert-icon{font-size:16px;top:6px;left:12px;position:absolute}.ivu-alert-desc{font-size:14px;color:#515a6e;line-height:21px;display:none;text-align:justify}.ivu-alert-success{border:1px solid #8ce6b0;background-color:#edfff3}.ivu-alert-success .ivu-alert-icon{color:#19be6b}.ivu-alert-info{border:1px solid #abdcff;background-color:#f0faff}.ivu-alert-info .ivu-alert-icon{color:#2d8cf0}.ivu-alert-warning{border:1px solid #ffd77a;background-color:#fff9e6}.ivu-alert-warning .ivu-alert-icon{color:#f90}.ivu-alert-error{border:1px solid #ffb08f;background-color:#ffefe6}.ivu-alert-error .ivu-alert-icon{color:#ed4014}.ivu-alert-close{font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-alert-close .ivu-icon-ios-close{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-alert-close .ivu-icon-ios-close:hover{color:#444}.ivu-alert-with-desc{padding:16px;position:relative;border-radius:4px;margin-bottom:10px;color:#515a6e;line-height:1.5}.ivu-alert-with-desc.ivu-alert-with-icon{padding:16px 16px 16px 69px}.ivu-alert-with-desc .ivu-alert-desc{display:block}.ivu-alert-with-desc .ivu-alert-message{font-size:16px;color:#17233d;display:block;margin-bottom:4px}.ivu-alert-with-desc .ivu-alert-icon{top:50%;left:24px;margin-top:-24px;font-size:28px}.ivu-alert-with-banner{border-radius:0}.ivu-collapse{background-color:#f7f7f7;border-radius:3px;border:1px solid #dcdee2}.ivu-collapse-simple{border-left:none;border-right:none;background-color:#fff;border-radius:0}.ivu-collapse>.ivu-collapse-item{border-top:1px solid #dcdee2}.ivu-collapse>.ivu-collapse-item:first-child{border-top:0}.ivu-collapse>.ivu-collapse-item>.ivu-collapse-header{height:38px;line-height:38px;padding-left:16px;color:#666;cursor:pointer;position:relative;border-bottom:1px solid transparent;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-collapse>.ivu-collapse-item>.ivu-collapse-header>i{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;margin-right:14px}.ivu-collapse>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header{border-bottom:1px solid #dcdee2}.ivu-collapse-simple>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header{border-bottom:1px solid transparent}.ivu-collapse>.ivu-collapse-item.ivu-collapse-item-active>.ivu-collapse-header>i{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-collapse-content{color:#515a6e;padding:0 16px;background-color:#fff}.ivu-collapse-content>.ivu-collapse-content-box{padding-top:16px;padding-bottom:16px}.ivu-collapse-simple>.ivu-collapse-item>.ivu-collapse-content>.ivu-collapse-content-box{padding-top:0}.ivu-collapse-item:last-child>.ivu-collapse-content{border-radius:0 0 3px 3px}.ivu-card{display:block;background:#fff;border-radius:4px;font-size:14px;position:relative;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-card-bordered{border:1px solid #dcdee2;border-color:#e8eaec}.ivu-card-shadow{-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.ivu-card:hover{-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);border-color:#eee}.ivu-card.ivu-card-dis-hover:hover{-webkit-box-shadow:none;box-shadow:none;border-color:transparent}.ivu-card.ivu-card-dis-hover.ivu-card-bordered:hover{border-color:#e8eaec}.ivu-card.ivu-card-shadow:hover{-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}.ivu-card-head{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-card-head p,.ivu-card-head-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-card-extra{position:absolute;right:16px;top:14px}.ivu-card-body{padding:16px}.ivu-message{font-size:14px;position:fixed;z-index:1010;width:100%;top:16px;left:0;pointer-events:none}.ivu-message-notice{padding:8px;text-align:center;-webkit-transition:height .3s ease-in-out,padding .3s ease-in-out;transition:height .3s ease-in-out,padding .3s ease-in-out}.ivu-message-notice:first-child{margin-top:-8px}.ivu-message-notice-close{position:absolute;right:4px;top:10px;color:#999;outline:0}.ivu-message-notice-close i.ivu-icon{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-message-notice-close i.ivu-icon:hover{color:#444}.ivu-message-notice-content{display:inline-block;pointer-events:all;padding:8px 16px;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);background:#fff;position:relative}.ivu-message-notice-content-text{display:inline-block}.ivu-message-notice-closable .ivu-message-notice-content-text{padding-right:32px}.ivu-message-success .ivu-icon{color:#19be6b}.ivu-message-error .ivu-icon{color:#ed4014}.ivu-message-warning .ivu-icon{color:#f90}.ivu-message-info .ivu-icon,.ivu-message-loading .ivu-icon{color:#2d8cf0}.ivu-message .ivu-icon{margin-right:4px;font-size:16px;vertical-align:middle}.ivu-message-custom-content span{vertical-align:middle}.ivu-message-notice-with-background .ivu-message-notice-content-background{-webkit-box-shadow:none;box-shadow:none}.ivu-message-notice-with-background .ivu-message-notice-content-info{background:#f0faff;color:#2e8bf0;border:1px solid #d4eeff}.ivu-message-notice-with-background .ivu-message-notice-content-success{background:#edfff3;color:#19bf6c;border:1px solid #bbf2cf}.ivu-message-notice-with-background .ivu-message-notice-content-warning{background:#fff9e6;color:#f90;border:1px solid #ffe7a3}.ivu-message-notice-with-background .ivu-message-notice-content-error{background:#ffefe6;color:#ed3f13;border:1px solid #ffcfb8}.ivu-notice{width:335px;margin-right:24px;position:fixed;z-index:1010}.ivu-notice-content-with-icon{margin-left:51px}.ivu-notice-with-desc.ivu-notice-with-icon .ivu-notice-title{margin-left:51px}.ivu-notice-notice{margin-bottom:10px;padding:16px;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);background:#fff;line-height:1;position:relative;overflow:hidden}.ivu-notice-notice-close{position:absolute;right:8px;top:15px;color:#999;outline:0}.ivu-notice-notice-close i{font-size:22px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:-3px}.ivu-notice-notice-close i:hover{color:#444}.ivu-notice-notice-content-with-render .ivu-notice-desc{display:none}.ivu-notice-notice-with-desc .ivu-notice-notice-close{top:11px}.ivu-notice-content-with-render-notitle{margin-left:26px}.ivu-notice-title{font-size:16px;line-height:19px;color:#17233d;padding-right:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-notice-with-desc .ivu-notice-title{margin-bottom:8px}.ivu-notice-desc{font-size:14px;color:#515a6e;text-align:justify;line-height:1.5}.ivu-notice-with-desc.ivu-notice-with-icon .ivu-notice-desc{margin-left:51px}.ivu-notice-with-icon .ivu-notice-title{margin-left:26px}.ivu-notice-icon{position:absolute;top:-2px;font-size:20px}.ivu-notice-icon-success{color:#19be6b}.ivu-notice-icon-info{color:#2d8cf0}.ivu-notice-icon-warning{color:#f90}.ivu-notice-icon-error{color:#ed4014}.ivu-notice-with-desc .ivu-notice-icon{font-size:36px;top:-6px}.ivu-notice-custom-content{position:relative}.ivu-radio-focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);z-index:1}.ivu-radio-group{display:inline-block;font-size:14px;vertical-align:middle}.ivu-radio-group-vertical .ivu-radio-wrapper{display:block;height:30px;line-height:30px}.ivu-radio-wrapper{font-size:14px;vertical-align:middle;display:inline-block;position:relative;white-space:nowrap;margin-right:8px;cursor:pointer}.ivu-radio-wrapper-disabled{cursor:not-allowed}.ivu-radio{display:inline-block;margin-right:4px;white-space:nowrap;position:relative;line-height:1;vertical-align:middle;cursor:pointer}.ivu-radio:hover .ivu-radio-inner{border-color:#bcbcbc}.ivu-radio-inner{display:inline-block;width:16px;height:16px;position:relative;top:0;left:0;background-color:#fff;border:1px solid #dcdee2;border-radius:50%;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-inner:after{position:absolute;width:10px;height:10px;left:2px;top:2px;border-radius:6px;display:table;border-top:0;border-left:0;content:' ';background-color:#2d8cf0;opacity:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.ivu-radio-large{font-size:16px}.ivu-radio-large .ivu-radio-inner{width:18px;height:18px}.ivu-radio-large .ivu-radio-inner:after{width:12px;height:12px}.ivu-radio-large .ivu-radio-wrapper,.ivu-radio-large.ivu-radio-wrapper{font-size:16px}.ivu-radio-small .ivu-radio-inner{width:14px;height:14px}.ivu-radio-small .ivu-radio-inner:after{width:8px;height:8px}.ivu-radio-input{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;opacity:0;cursor:pointer}.ivu-radio-border{border:1px solid #dcdee2;border-radius:4px;height:32px;line-height:30px;padding:0 15px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.ivu-radio-group-small .ivu-radio-border,.ivu-radio-small.ivu-radio-border{height:24px;line-height:22px;padding:0 7px}.ivu-radio-group-large .ivu-radio-border,.ivu-radio-large.ivu-radio-border{height:40px;line-height:36px;padding:0 15px}.ivu-radio-wrapper-checked.ivu-radio-border{border-color:#2d8cf0}.ivu-radio-wrapper-disabled.ivu-radio-border{border-color:#dcdee2}.ivu-radio-checked .ivu-radio-inner{border-color:#2d8cf0}.ivu-radio-checked .ivu-radio-inner:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-checked:hover .ivu-radio-inner{border-color:#2d8cf0}.ivu-radio-disabled{cursor:not-allowed}.ivu-radio-disabled .ivu-radio-input{cursor:not-allowed}.ivu-radio-disabled:hover .ivu-radio-inner{border-color:#dcdee2}.ivu-radio-disabled .ivu-radio-inner{border-color:#dcdee2;background-color:#f3f3f3}.ivu-radio-disabled .ivu-radio-inner:after{background-color:#ccc}.ivu-radio-disabled .ivu-radio-disabled+span{color:#ccc}span.ivu-radio+*{margin-left:2px;margin-right:2px}.ivu-radio-group-button{font-size:0;-webkit-text-size-adjust:none}.ivu-radio-group-button .ivu-radio{width:0;margin-right:0}.ivu-radio-group-button .ivu-radio-wrapper{display:inline-block;height:32px;line-height:30px;margin:0;padding:0 15px;font-size:14px;color:#515a6e;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer;border:1px solid #dcdee2;border-left:0;background:#fff;position:relative}.ivu-radio-group-button .ivu-radio-wrapper>span{margin-left:0}.ivu-radio-group-button .ivu-radio-wrapper:after,.ivu-radio-group-button .ivu-radio-wrapper:before{content:'';display:block;position:absolute;width:1px;height:100%;left:-1px;top:0;background:#dcdee2;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-group-button .ivu-radio-wrapper:after{height:36px;left:-1px;top:-3px;background:rgba(45,140,240,.2);opacity:0}.ivu-radio-group-button .ivu-radio-wrapper:first-child{border-radius:4px 0 0 4px;border-left:1px solid #dcdee2}.ivu-radio-group-button .ivu-radio-wrapper:first-child:after,.ivu-radio-group-button .ivu-radio-wrapper:first-child:before{display:none}.ivu-radio-group-button .ivu-radio-wrapper:last-child{border-radius:0 4px 4px 0}.ivu-radio-group-button .ivu-radio-wrapper:first-child:last-child{border-radius:4px}.ivu-radio-group-button .ivu-radio-wrapper:hover{position:relative;color:#2d8cf0}.ivu-radio-group-button .ivu-radio-wrapper:hover .ivu-radio{background-color:#000}.ivu-radio-group-button .ivu-radio-wrapper .ivu-radio-inner,.ivu-radio-group-button .ivu-radio-wrapper input{opacity:0;width:0;height:0}.ivu-radio-group-button .ivu-radio-wrapper-checked{background:#fff;border-color:#2d8cf0;color:#2d8cf0;-webkit-box-shadow:-1px 0 0 0 #2d8cf0;box-shadow:-1px 0 0 0 #2d8cf0;z-index:1}.ivu-radio-group-button .ivu-radio-wrapper-checked:before{background:#2d8cf0;opacity:.1}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus{-webkit-box-shadow:-1px 0 0 0 #2d8cf0,0 0 0 2px rgba(45,140,240,.2);box-shadow:-1px 0 0 0 #2d8cf0,0 0 0 2px rgba(45,140,240,.2);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus:after{left:-3px;top:-3px;opacity:1;background:rgba(45,140,240,.2)}.ivu-radio-group-button .ivu-radio-wrapper-checked.ivu-radio-focus:first-child{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-radio-group-button .ivu-radio-wrapper-checked:first-child{border-color:#2d8cf0;-webkit-box-shadow:none;box-shadow:none}.ivu-radio-group-button .ivu-radio-wrapper-checked:hover{border-color:#57a3f3;color:#57a3f3}.ivu-radio-group-button .ivu-radio-wrapper-checked:active{border-color:#2b85e4;color:#2b85e4}.ivu-radio-group-button .ivu-radio-wrapper-disabled{border-color:#dcdee2;background-color:#f7f7f7;cursor:not-allowed;color:#ccc}.ivu-radio-group-button .ivu-radio-wrapper-disabled:first-child,.ivu-radio-group-button .ivu-radio-wrapper-disabled:hover{border-color:#dcdee2;background-color:#f7f7f7;color:#ccc}.ivu-radio-group-button .ivu-radio-wrapper-disabled:first-child{border-left-color:#dcdee2}.ivu-radio-group-button .ivu-radio-wrapper-disabled.ivu-radio-wrapper-checked{color:#fff;background-color:#e6e6e6;border-color:#dcdee2;-webkit-box-shadow:none!important;box-shadow:none!important}.ivu-radio-group-button.ivu-radio-group-large .ivu-radio-wrapper{height:40px;line-height:38px;font-size:16px}.ivu-radio-group-button.ivu-radio-group-large .ivu-radio-wrapper:after{height:44px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper{height:24px;line-height:22px;padding:0 12px;font-size:14px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:after{height:28px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:first-child{border-radius:3px 0 0 3px}.ivu-radio-group-button.ivu-radio-group-small .ivu-radio-wrapper:last-child{border-radius:0 3px 3px 0}.ivu-checkbox-focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);z-index:1}.ivu-checkbox{display:inline-block;vertical-align:middle;white-space:nowrap;cursor:pointer;line-height:1;position:relative}.ivu-checkbox-disabled{cursor:not-allowed}.ivu-checkbox:hover .ivu-checkbox-inner{border-color:#bcbcbc}.ivu-checkbox-inner{display:inline-block;width:16px;height:16px;position:relative;top:0;left:0;border:1px solid #dcdee2;border-radius:2px;background-color:#fff;-webkit-transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-checkbox-inner:after{content:'';display:table;width:4px;height:8px;position:absolute;top:1px;left:4px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(0);-ms-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-checkbox-large .ivu-checkbox-inner{width:18px;height:18px}.ivu-checkbox-large .ivu-checkbox-inner:after{width:5px;height:9px}.ivu-checkbox-small{font-size:14px}.ivu-checkbox-small .ivu-checkbox-inner{width:14px;height:14px}.ivu-checkbox-small .ivu-checkbox-inner:after{top:0;left:3px}.ivu-checkbox-input{width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;cursor:pointer;opacity:0}.ivu-checkbox-input[disabled]{cursor:not-allowed}.ivu-checkbox-border{border:1px solid #dcdee2;border-radius:4px;height:32px;line-height:30px;padding:0 15px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.ivu-checkbox-group.ivu-checkbox-small .ivu-checkbox-border,.ivu-checkbox-small.ivu-checkbox-border{height:24px;line-height:22px;padding:0 7px}.ivu-checkbox-group.ivu-checkbox-large .ivu-checkbox-border,.ivu-checkbox-large.ivu-checkbox-border{height:40px;line-height:36px;padding:0 15px}.ivu-checkbox-wrapper-checked.ivu-checkbox-border{border-color:#2d8cf0}.ivu-checkbox-wrapper-disabled.ivu-checkbox-border{border-color:#dcdee2}.ivu-checkbox-checked:hover .ivu-checkbox-inner{border-color:#2d8cf0}.ivu-checkbox-checked .ivu-checkbox-inner{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-checkbox-checked .ivu-checkbox-inner:after{content:'';display:table;width:4px;height:8px;position:absolute;top:2px;left:5px;border:2px solid #fff;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1);-ms-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-checkbox-large .ivu-checkbox-checked .ivu-checkbox-inner:after{width:6px;height:10px}.ivu-checkbox-small .ivu-checkbox-checked .ivu-checkbox-inner:after{top:1px;left:4px}.ivu-checkbox-disabled.ivu-checkbox-checked:hover .ivu-checkbox-inner{border-color:#dcdee2}.ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner{background-color:#f3f3f3;border-color:#dcdee2}.ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#ccc}.ivu-checkbox-disabled:hover .ivu-checkbox-inner{border-color:#dcdee2}.ivu-checkbox-disabled .ivu-checkbox-inner{border-color:#dcdee2;background-color:#f3f3f3}.ivu-checkbox-disabled .ivu-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:#f3f3f3}.ivu-checkbox-disabled .ivu-checkbox-inner-input{cursor:default}.ivu-checkbox-disabled+span{color:#ccc;cursor:not-allowed}.ivu-checkbox-indeterminate .ivu-checkbox-inner:after{content:'';width:10px;height:1px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);position:absolute;left:2px;top:6px}.ivu-checkbox-indeterminate:hover .ivu-checkbox-inner{border-color:#2d8cf0}.ivu-checkbox-indeterminate .ivu-checkbox-inner{background-color:#2d8cf0;border-color:#2d8cf0}.ivu-checkbox-indeterminate.ivu-checkbox-disabled .ivu-checkbox-inner{background-color:#f3f3f3;border-color:#dcdee2}.ivu-checkbox-indeterminate.ivu-checkbox-disabled .ivu-checkbox-inner:after{border-color:#c5c8ce}.ivu-checkbox-large .ivu-checkbox-indeterminate .ivu-checkbox-inner:after{width:12px;top:7px}.ivu-checkbox-small .ivu-checkbox-indeterminate .ivu-checkbox-inner:after{width:8px;top:5px}.ivu-checkbox-wrapper{cursor:pointer;font-size:14px;display:inline-block;margin-right:8px}.ivu-checkbox-wrapper-disabled{cursor:not-allowed}.ivu-checkbox-wrapper.ivu-checkbox-large{font-size:16px}.ivu-checkbox+span,.ivu-checkbox-wrapper+span{margin-right:4px}.ivu-checkbox-group{font-size:14px}.ivu-checkbox-group-item{display:inline-block}.ivu-switch{display:inline-block;width:44px;height:22px;line-height:20px;border-radius:22px;vertical-align:middle;border:1px solid #ccc;background-color:#ccc;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-switch-loading{opacity:.4}.ivu-switch-inner{color:#fff;font-size:12px;position:absolute;left:23px}.ivu-switch-inner i{width:12px;height:12px;text-align:center;position:relative;top:-1px}.ivu-switch:after{content:'';width:18px;height:18px;border-radius:18px;background-color:#fff;position:absolute;left:1px;top:1px;cursor:pointer;-webkit-transition:left .2s ease-in-out,width .2s ease-in-out;transition:left .2s ease-in-out,width .2s ease-in-out}.ivu-switch:active:after{width:26px}.ivu-switch:before{content:'';display:none;width:14px;height:14px;border-radius:50%;background-color:transparent;position:absolute;left:3px;top:3px;z-index:1;border:1px solid #2d8cf0;border-color:transparent transparent transparent #2d8cf0;-webkit-animation:switch-loading 1s linear;animation:switch-loading 1s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.ivu-switch-loading:before{display:block}.ivu-switch:focus{-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2);outline:0}.ivu-switch:focus:hover{-webkit-box-shadow:none;box-shadow:none}.ivu-switch-small{width:28px;height:16px;line-height:14px}.ivu-switch-small:after{width:12px;height:12px}.ivu-switch-small:active:after{width:14px}.ivu-switch-small:before{width:10px;height:10px;left:2px;top:2px}.ivu-switch-small.ivu-switch-checked:after{left:13px}.ivu-switch-small.ivu-switch-checked:before{left:14px}.ivu-switch-small:active.ivu-switch-checked:after{left:11px}.ivu-switch-large{width:56px}.ivu-switch-large:active:after{width:26px}.ivu-switch-large:active:after{width:30px}.ivu-switch-large.ivu-switch-checked:after{left:35px}.ivu-switch-large.ivu-switch-checked:before{left:37px}.ivu-switch-large:active.ivu-switch-checked:after{left:23px}.ivu-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-switch-checked .ivu-switch-inner{left:7px}.ivu-switch-checked:after{left:23px}.ivu-switch-checked:before{left:25px}.ivu-switch-checked:active:after{left:15px}.ivu-switch-disabled{cursor:not-allowed;opacity:.4}.ivu-switch-disabled:after{background:#fff;cursor:not-allowed}.ivu-switch-disabled .ivu-switch-inner{color:#fff}.ivu-switch-disabled.ivu-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0;opacity:.4}.ivu-switch-disabled.ivu-switch-checked:after{background:#fff}.ivu-switch-disabled.ivu-switch-checked .ivu-switch-inner{color:#fff}@-webkit-keyframes switch-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes switch-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ivu-input-number{display:inline-block;width:100%;line-height:1.5;padding:4px 7px;font-size:14px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;margin:0;padding:0;width:80px;height:32px;line-height:32px;vertical-align:middle;border:1px solid #dcdee2;border-radius:4px;overflow:hidden;cursor:default}.ivu-input-number::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-input-number:-ms-input-placeholder{color:#c5c8ce}.ivu-input-number::-webkit-input-placeholder{color:#c5c8ce}.ivu-input-number:hover{border-color:#57a3f3}.ivu-input-number:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input-number[disabled],fieldset[disabled] .ivu-input-number{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number[disabled]:hover,fieldset[disabled] .ivu-input-number:hover{border-color:#e3e5e8}textarea.ivu-input-number{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-input-number-large{font-size:16px;padding:6px 7px;height:40px}.ivu-input-number-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-input-number-handler-wrap{width:22px;height:100%;border-left:1px solid #dcdee2;border-radius:0 4px 4px 0;background:#fff;position:absolute;top:0;right:0;opacity:0;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out}.ivu-input-number:hover .ivu-input-number-handler-wrap{opacity:1}.ivu-input-number-handler-up{cursor:pointer}.ivu-input-number-handler-up-inner{top:1px}.ivu-input-number-handler-down{border-top:1px solid #dcdee2;top:-1px;cursor:pointer}.ivu-input-number-handler{display:block;width:100%;height:16px;line-height:0;text-align:center;overflow:hidden;color:#999;position:relative}.ivu-input-number-handler:hover .ivu-input-number-handler-down-inner,.ivu-input-number-handler:hover .ivu-input-number-handler-up-inner{color:#57a3f3}.ivu-input-number-handler-down-inner,.ivu-input-number-handler-up-inner{width:12px;height:12px;line-height:12px;font-size:14px;color:#999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;right:5px;-webkit-transition:all .2s linear;transition:all .2s linear}.ivu-input-number:hover{border-color:#57a3f3}.ivu-input-number-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input-number-disabled{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number-disabled:hover{border-color:#e3e5e8}.ivu-input-number-input-wrap{overflow:hidden;height:32px}.ivu-input-number-input{width:100%;height:32px;line-height:32px;padding:0 7px;text-align:left;outline:0;-moz-appearance:textfield;color:#666;border:0;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.ivu-input-number-input[disabled]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input-number-input[disabled]:hover{border-color:#e3e5e8}.ivu-input-number-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-input-number-input::-moz-placeholder{color:#c5c8ce}.ivu-input-number-input::-ms-input-placeholder{color:#c5c8ce}.ivu-input-number-input::placeholder{color:#c5c8ce}.ivu-input-number-large{padding:0}.ivu-input-number-large .ivu-input-number-input-wrap{height:40px}.ivu-input-number-large .ivu-input-number-handler{height:20px}.ivu-input-number-large input{height:40px;line-height:40px}.ivu-input-number-large .ivu-input-number-handler-up-inner{top:2px}.ivu-input-number-large .ivu-input-number-handler-down-inner{bottom:2px}.ivu-input-number-small{padding:0}.ivu-input-number-small .ivu-input-number-input-wrap{height:24px}.ivu-input-number-small .ivu-input-number-handler{height:12px}.ivu-input-number-small input{height:24px;line-height:24px;margin-top:-1px;vertical-align:top}.ivu-input-number-small .ivu-input-number-handler-up-inner{top:-1px}.ivu-input-number-small .ivu-input-number-handler-down-inner{bottom:-1px}.ivu-input-number-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-disabled .ivu-input-number-handler-up-inner,.ivu-input-number-handler-down-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-handler-down-disabled .ivu-input-number-handler-up-inner,.ivu-input-number-handler-up-disabled .ivu-input-number-handler-down-inner,.ivu-input-number-handler-up-disabled .ivu-input-number-handler-up-inner{opacity:.72;color:#ccc!important;cursor:not-allowed}.ivu-input-number-disabled .ivu-input-number-input{opacity:.72;cursor:not-allowed;background-color:#f3f3f3}.ivu-input-number-disabled .ivu-input-number-handler-wrap{display:none}.ivu-input-number-disabled .ivu-input-number-handler{opacity:.72;color:#ccc!important;cursor:not-allowed}.ivu-form-item-error .ivu-input-number{border:1px solid #ed4014}.ivu-form-item-error .ivu-input-number:hover{border-color:#ed4014}.ivu-form-item-error .ivu-input-number:focus{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-form-item-error .ivu-input-number-focused{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-scroll-wrapper{width:auto;margin:0 auto;position:relative;outline:0}.ivu-scroll-container{overflow-y:scroll}.ivu-scroll-content{opacity:1;-webkit-transition:opacity .5s;transition:opacity .5s}.ivu-scroll-content-loading{opacity:.5}.ivu-scroll-loader{text-align:center;padding:0;-webkit-transition:padding .5s;transition:padding .5s}.ivu-scroll-loader-wrapper{padding:5px 0;height:0;background-color:inherit;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:opacity .3s,height .5s,-webkit-transform .5s;transition:opacity .3s,height .5s,-webkit-transform .5s;transition:opacity .3s,transform .5s,height .5s;transition:opacity .3s,transform .5s,height .5s,-webkit-transform .5s}.ivu-scroll-loader-wrapper-active{height:40px;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}@-webkit-keyframes ani-demo-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes ani-demo-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ivu-scroll-loader-wrapper .ivu-scroll-spinner{position:relative}.ivu-scroll-loader-wrapper .ivu-scroll-spinner-icon{-webkit-animation:ani-demo-spin 1s linear infinite;animation:ani-demo-spin 1s linear infinite}.ivu-tag{display:inline-block;height:22px;line-height:22px;margin:2px 4px 2px 0;padding:0 8px;border:1px solid #e8eaec;border-radius:3px;background:#f7f7f7;font-size:12px;vertical-align:middle;opacity:1;overflow:hidden}.ivu-tag-size-large{height:32px;line-height:32px;padding:0 12px}.ivu-tag-size-medium{height:28px;line-height:28px;padding:0 10px}.ivu-tag:not(.ivu-tag-border):not(.ivu-tag-dot):not(.ivu-tag-checked){background:0 0;border:0;color:#515a6e}.ivu-tag:not(.ivu-tag-border):not(.ivu-tag-dot):not(.ivu-tag-checked) .ivu-icon-ios-close{color:#515a6e!important}.ivu-tag-color-error{color:#ed4014!important;border-color:#ed4014}.ivu-tag-color-success{color:#19be6b!important;border-color:#19be6b}.ivu-tag-color-primary{color:#2d8cf0!important;border-color:#2d8cf0}.ivu-tag-color-warning{color:#f90!important;border-color:#f90}.ivu-tag-color-white{color:#fff!important}.ivu-tag-dot{height:32px;line-height:32px;border:1px solid #e8eaec!important;color:#515a6e!important;background:#fff!important;padding:0 12px}.ivu-tag-dot-inner{display:inline-block;width:12px;height:12px;margin-right:8px;border-radius:50%;background:#e8eaec;position:relative;top:1px}.ivu-tag-dot .ivu-icon-ios-close{color:#666!important;margin-left:12px!important}.ivu-tag-border{height:24px;line-height:24px;border:1px solid #e8eaec;color:#e8eaec;background:#fff!important;position:relative}.ivu-tag-border .ivu-icon-ios-close{color:#666;margin-left:12px!important}.ivu-tag-border:after{content:\"\";display:none;width:1px;background:currentColor;position:absolute;top:0;bottom:0;right:22px}.ivu-tag-border.ivu-tag-closable:after{display:block}.ivu-tag-border.ivu-tag-closable .ivu-icon-ios-close{margin-left:18px!important;left:4px;top:-1px}.ivu-tag-border.ivu-tag-primary{color:#2d8cf0!important;border:1px solid #2d8cf0!important}.ivu-tag-border.ivu-tag-primary:after{background:#2d8cf0}.ivu-tag-border.ivu-tag-primary .ivu-icon-ios-close{color:#2d8cf0!important}.ivu-tag-border.ivu-tag-success{color:#19be6b!important;border:1px solid #19be6b!important}.ivu-tag-border.ivu-tag-success:after{background:#19be6b}.ivu-tag-border.ivu-tag-success .ivu-icon-ios-close{color:#19be6b!important}.ivu-tag-border.ivu-tag-warning{color:#f90!important;border:1px solid #f90!important}.ivu-tag-border.ivu-tag-warning:after{background:#f90}.ivu-tag-border.ivu-tag-warning .ivu-icon-ios-close{color:#f90!important}.ivu-tag-border.ivu-tag-error{color:#ed4014!important;border:1px solid #ed4014!important}.ivu-tag-border.ivu-tag-error:after{background:#ed4014}.ivu-tag-border.ivu-tag-error .ivu-icon-ios-close{color:#ed4014!important}.ivu-tag:hover{opacity:.85}.ivu-tag-text{color:#515a6e}.ivu-tag-text a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ivu-tag .ivu-icon-ios-close{display:inline-block;font-size:14px;-webkit-transform:scale(1.42857143) rotate(0);-ms-transform:scale(1.42857143) rotate(0);transform:scale(1.42857143) rotate(0);cursor:pointer;margin-left:2px;color:#666;opacity:.66;position:relative;top:-1px}:root .ivu-tag .ivu-icon-ios-close{font-size:14px}.ivu-tag .ivu-icon-ios-close:hover{opacity:1}.ivu-tag-error,.ivu-tag-primary,.ivu-tag-success,.ivu-tag-warning{border:0}.ivu-tag-error,.ivu-tag-error .ivu-icon-ios-close,.ivu-tag-error .ivu-icon-ios-close:hover,.ivu-tag-error a,.ivu-tag-error a:hover,.ivu-tag-primary,.ivu-tag-primary .ivu-icon-ios-close,.ivu-tag-primary .ivu-icon-ios-close:hover,.ivu-tag-primary a,.ivu-tag-primary a:hover,.ivu-tag-success,.ivu-tag-success .ivu-icon-ios-close,.ivu-tag-success .ivu-icon-ios-close:hover,.ivu-tag-success a,.ivu-tag-success a:hover,.ivu-tag-warning,.ivu-tag-warning .ivu-icon-ios-close,.ivu-tag-warning .ivu-icon-ios-close:hover,.ivu-tag-warning a,.ivu-tag-warning a:hover{color:#fff}.ivu-tag-primary,.ivu-tag-primary.ivu-tag-dot .ivu-tag-dot-inner{background:#2d8cf0}.ivu-tag-success,.ivu-tag-success.ivu-tag-dot .ivu-tag-dot-inner{background:#19be6b}.ivu-tag-warning,.ivu-tag-warning.ivu-tag-dot .ivu-tag-dot-inner{background:#f90}.ivu-tag-error,.ivu-tag-error.ivu-tag-dot .ivu-tag-dot-inner{background:#ed4014}.ivu-tag-pink{line-height:20px;background:#fff0f6;border-color:#ffadd2}.ivu-tag-pink .ivu-tag-text{color:#eb2f96!important}.ivu-tag-pink.ivu-tag-dot{line-height:32px}.ivu-tag-magenta{line-height:20px;background:#fff0f6;border-color:#ffadd2}.ivu-tag-magenta .ivu-tag-text{color:#eb2f96!important}.ivu-tag-magenta.ivu-tag-dot{line-height:32px}.ivu-tag-red{line-height:20px;background:#fff1f0;border-color:#ffa39e}.ivu-tag-red .ivu-tag-text{color:#f5222d!important}.ivu-tag-red.ivu-tag-dot{line-height:32px}.ivu-tag-volcano{line-height:20px;background:#fff2e8;border-color:#ffbb96}.ivu-tag-volcano .ivu-tag-text{color:#fa541c!important}.ivu-tag-volcano.ivu-tag-dot{line-height:32px}.ivu-tag-orange{line-height:20px;background:#fff7e6;border-color:#ffd591}.ivu-tag-orange .ivu-tag-text{color:#fa8c16!important}.ivu-tag-orange.ivu-tag-dot{line-height:32px}.ivu-tag-yellow{line-height:20px;background:#feffe6;border-color:#fffb8f}.ivu-tag-yellow .ivu-tag-text{color:#fadb14!important}.ivu-tag-yellow.ivu-tag-dot{line-height:32px}.ivu-tag-gold{line-height:20px;background:#fffbe6;border-color:#ffe58f}.ivu-tag-gold .ivu-tag-text{color:#faad14!important}.ivu-tag-gold.ivu-tag-dot{line-height:32px}.ivu-tag-cyan{line-height:20px;background:#e6fffb;border-color:#87e8de}.ivu-tag-cyan .ivu-tag-text{color:#13c2c2!important}.ivu-tag-cyan.ivu-tag-dot{line-height:32px}.ivu-tag-lime{line-height:20px;background:#fcffe6;border-color:#eaff8f}.ivu-tag-lime .ivu-tag-text{color:#a0d911!important}.ivu-tag-lime.ivu-tag-dot{line-height:32px}.ivu-tag-green{line-height:20px;background:#f6ffed;border-color:#b7eb8f}.ivu-tag-green .ivu-tag-text{color:#52c41a!important}.ivu-tag-green.ivu-tag-dot{line-height:32px}.ivu-tag-blue{line-height:20px;background:#e6f7ff;border-color:#91d5ff}.ivu-tag-blue .ivu-tag-text{color:#1890ff!important}.ivu-tag-blue.ivu-tag-dot{line-height:32px}.ivu-tag-geekblue{line-height:20px;background:#f0f5ff;border-color:#adc6ff}.ivu-tag-geekblue .ivu-tag-text{color:#2f54eb!important}.ivu-tag-geekblue.ivu-tag-dot{line-height:32px}.ivu-tag-purple{line-height:20px;background:#f9f0ff;border-color:#d3adf7}.ivu-tag-purple .ivu-tag-text{color:#722ed1!important}.ivu-tag-purple.ivu-tag-dot{line-height:32px}.ivu-layout{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex:auto;flex:auto;background:#f5f7f9}.ivu-layout.ivu-layout-has-sider{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.ivu-layout.ivu-layout-has-sider>.ivu-layout,.ivu-layout.ivu-layout-has-sider>.ivu-layout-content{overflow-x:hidden}.ivu-layout-footer,.ivu-layout-header{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.ivu-layout-header{background:#515a6e;padding:0 50px;height:64px;line-height:64px}.ivu-layout-sider{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;background:#515a6e;min-width:0}.ivu-layout-sider-children{height:100%;padding-top:.1px;margin-top:-.1px}.ivu-layout-sider-has-trigger{padding-bottom:48px}.ivu-layout-sider-trigger{position:fixed;bottom:0;text-align:center;cursor:pointer;height:48px;line-height:48px;color:#fff;background:#515a6e;z-index:1000;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-layout-sider-trigger .ivu-icon{font-size:16px}.ivu-layout-sider-trigger>*{-webkit-transition:all .2s;transition:all .2s}.ivu-layout-sider-trigger-collapsed .ivu-layout-sider-trigger-icon{-webkit-transform:rotateZ(180deg);-ms-transform:rotate(180deg);transform:rotateZ(180deg)}.ivu-layout-sider-zero-width>*{overflow:hidden}.ivu-layout-sider-zero-width-trigger{position:absolute;top:64px;right:-36px;text-align:center;width:36px;height:42px;line-height:42px;background:#515a6e;color:#fff;font-size:18px;border-radius:0 6px 6px 0;cursor:pointer;-webkit-transition:background .3s ease;transition:background .3s ease}.ivu-layout-sider-zero-width-trigger:hover{background:#626b7d}.ivu-layout-sider-zero-width-trigger.ivu-layout-sider-zero-width-trigger-left{right:0;left:-36px;border-radius:6px 0 0 6px}.ivu-layout-footer{background:#f5f7f9;padding:24px 50px;color:#515a6e;font-size:14px}.ivu-layout-content{-webkit-box-flex:1;-ms-flex:auto;flex:auto}.ivu-loading-bar{width:100%;position:fixed;top:0;left:0;right:0;z-index:2000}.ivu-loading-bar-inner{-webkit-transition:width .2s linear;transition:width .2s linear}.ivu-loading-bar-inner-color-primary{background-color:#2d8cf0}.ivu-loading-bar-inner-failed-color-error{background-color:#ed4014}.ivu-progress{display:inline-block;width:100%;font-size:12px;position:relative}.ivu-progress-vertical{height:100%;width:auto}.ivu-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0}.ivu-progress-show-info .ivu-progress-outer{padding-right:55px;margin-right:-55px}.ivu-progress-vertical .ivu-progress-outer{height:100%;width:auto}.ivu-progress-inner{display:inline-block;width:100%;background-color:#f3f3f3;border-radius:100px;vertical-align:middle;position:relative}.ivu-progress-inner-text{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 6px}.ivu-progress-vertical .ivu-progress-inner{height:100%;width:auto}.ivu-progress-vertical .ivu-progress-inner:after,.ivu-progress-vertical .ivu-progress-inner>*{display:inline-block;vertical-align:bottom}.ivu-progress-vertical .ivu-progress-inner:after{content:'';height:100%}.ivu-progress-bg{text-align:right;border-radius:100px;background-color:#2d8cf0;-webkit-transition:all .2s linear;transition:all .2s linear;position:relative}.ivu-progress-bg:after{content:'';display:inline-block;height:100%;vertical-align:middle}.ivu-progress-success-bg{border-radius:100px;background-color:#19be6b;-webkit-transition:all .2s linear;transition:all .2s linear;position:absolute;top:0;left:0}.ivu-progress-text{display:inline-block;margin-left:5px;text-align:left;font-size:1em;vertical-align:middle;color:#808695}.ivu-progress-active .ivu-progress-bg:before{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border-radius:10px;-webkit-animation:ivu-progress-active 2s ease-in-out infinite;animation:ivu-progress-active 2s ease-in-out infinite}.ivu-progress-vertical.ivu-progress-active .ivu-progress-bg:before{top:auto;-webkit-animation:ivu-progress-active-vertical 2s ease-in-out infinite;animation:ivu-progress-active-vertical 2s ease-in-out infinite}.ivu-progress-wrong .ivu-progress-bg{background-color:#ed4014}.ivu-progress-wrong .ivu-progress-text{color:#ed4014}.ivu-progress-success .ivu-progress-bg{background-color:#19be6b}.ivu-progress-success .ivu-progress-text{color:#19be6b}@-webkit-keyframes ivu-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@keyframes ivu-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}@-webkit-keyframes ivu-progress-active-vertical{0%{opacity:.3;height:0}100%{opacity:0;height:100%}}@keyframes ivu-progress-active-vertical{0%{opacity:.3;height:0}100%{opacity:0;height:100%}}.ivu-timeline{list-style:none;margin:0;padding:0}.ivu-timeline-item{margin:0!important;padding:0 0 12px 0;list-style:none;position:relative}.ivu-timeline-item-tail{height:100%;border-left:1px solid #e8eaec;position:absolute;left:6px;top:0}.ivu-timeline-item-pending .ivu-timeline-item-tail{display:none}.ivu-timeline-item-head{width:13px;height:13px;background-color:#fff;border-radius:50%;border:1px solid transparent;position:absolute}.ivu-timeline-item-head-blue{border-color:#2d8cf0;color:#2d8cf0}.ivu-timeline-item-head-red{border-color:#ed4014;color:#ed4014}.ivu-timeline-item-head-green{border-color:#19be6b;color:#19be6b}.ivu-timeline-item-head-custom{width:40px;height:auto;margin-top:6px;padding:3px 0;text-align:center;line-height:1;border:0;border-radius:0;font-size:14px;position:absolute;left:-13px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-timeline-item-content{padding:1px 1px 10px 24px;font-size:14px;position:relative;top:-3px}.ivu-timeline-item:last-child .ivu-timeline-item-tail{display:none}.ivu-timeline.ivu-timeline-pending .ivu-timeline-item:nth-last-of-type(2) .ivu-timeline-item-tail{border-left:1px dotted #e8eaec}.ivu-timeline.ivu-timeline-pending .ivu-timeline-item:nth-last-of-type(2) .ivu-timeline-item-content{min-height:48px}.ivu-page:after{content:'';display:block;height:0;clear:both;overflow:hidden;visibility:hidden}.ivu-page-item{display:inline-block;vertical-align:middle;min-width:32px;height:32px;line-height:30px;margin-right:4px;text-align:center;list-style:none;background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;font-family:Arial;font-weight:500;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:border .2s ease-in-out,color .2s ease-in-out;transition:border .2s ease-in-out,color .2s ease-in-out}.ivu-page-item a{margin:0 6px;text-decoration:none;color:#515a6e}.ivu-page-item:hover{border-color:#2d8cf0}.ivu-page-item:hover a{color:#2d8cf0}.ivu-page-item-active{border-color:#2d8cf0}.ivu-page-item-active a,.ivu-page-item-active:hover a{color:#2d8cf0}.ivu-page-with-disabled .ivu-page-disabled,.ivu-page-with-disabled .ivu-page-item{cursor:not-allowed;background-color:#f3f3f3}.ivu-page-with-disabled .ivu-page-disabled a,.ivu-page-with-disabled .ivu-page-item a{color:#ccc}.ivu-page-with-disabled .ivu-page-disabled:hover,.ivu-page-with-disabled .ivu-page-item:hover{border-color:#dcdee2}.ivu-page-with-disabled .ivu-page-disabled:hover a,.ivu-page-with-disabled .ivu-page-item:hover a{color:#ccc;cursor:not-allowed}.ivu-page-with-disabled .ivu-page-disabled-active,.ivu-page-with-disabled .ivu-page-item-active{background-color:#dcdee2;border-color:#dcdee2}.ivu-page-with-disabled .ivu-page-disabled-active a,.ivu-page-with-disabled .ivu-page-disabled-active:hover a,.ivu-page-with-disabled .ivu-page-item-active a,.ivu-page-with-disabled .ivu-page-item-active:hover a{color:#fff}.ivu-page-item-jump-next:after,.ivu-page-item-jump-prev:after{content:\"•••\";display:block;letter-spacing:1px;color:#ccc;text-align:center}.ivu-page-item-jump-next i,.ivu-page-item-jump-prev i{display:none}.ivu-page-item-jump-next:hover:after,.ivu-page-item-jump-prev:hover:after{display:none}.ivu-page-item-jump-next:hover i,.ivu-page-item-jump-prev:hover i{display:inline}.ivu-page-with-disabled .ivu-page-item-jump-next,.ivu-page-with-disabled .ivu-page-item-jump-prev{cursor:not-allowed}.ivu-page-with-disabled .ivu-page-item-jump-next:hover:after,.ivu-page-with-disabled .ivu-page-item-jump-prev:hover:after{display:block}.ivu-page-with-disabled .ivu-page-item-jump-next:hover i,.ivu-page-with-disabled .ivu-page-item-jump-prev:hover i{display:none}.ivu-page-item-jump-prev:hover i:after{content:\"\\F115\";margin-left:-8px}.ivu-page-item-jump-next:hover i:after{content:\"\\F11F\";margin-left:-8px}.ivu-page-prev{margin-right:4px}.ivu-page-item-jump-next,.ivu-page-item-jump-prev{margin-right:4px}.ivu-page-item-jump-next,.ivu-page-item-jump-prev,.ivu-page-next,.ivu-page-prev{display:inline-block;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-width:32px;height:32px;line-height:30px;list-style:none;text-align:center;cursor:pointer;color:#666;font-family:Arial;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-page-item-jump-next,.ivu-page-item-jump-prev{border-color:transparent}.ivu-page-next,.ivu-page-prev{background-color:#fff}.ivu-page-next a,.ivu-page-prev a{color:#666;font-size:14px}.ivu-page-next:hover,.ivu-page-prev:hover{border-color:#2d8cf0}.ivu-page-next:hover a,.ivu-page-prev:hover a{color:#2d8cf0}.ivu-page-disabled{cursor:not-allowed}.ivu-page-disabled a{color:#ccc}.ivu-page-disabled:hover{border-color:#dcdee2}.ivu-page-disabled:hover a{color:#ccc;cursor:not-allowed}.ivu-page-options{display:inline-block;vertical-align:middle;margin-left:15px}.ivu-page-options-sizer{display:inline-block;margin-right:10px}.ivu-page-options-elevator{display:inline-block;vertical-align:middle;height:32px;line-height:32px}.ivu-page-options-elevator input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;border-radius:4px;margin:0 8px;width:50px}.ivu-page-options-elevator input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-page-options-elevator input:-ms-input-placeholder{color:#c5c8ce}.ivu-page-options-elevator input::-webkit-input-placeholder{color:#c5c8ce}.ivu-page-options-elevator input:hover{border-color:#57a3f3}.ivu-page-options-elevator input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-page-options-elevator input[disabled],fieldset[disabled] .ivu-page-options-elevator input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-page-options-elevator input[disabled]:hover,fieldset[disabled] .ivu-page-options-elevator input:hover{border-color:#e3e5e8}textarea.ivu-page-options-elevator input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-page-options-elevator input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-page-options-elevator input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-page-total{display:inline-block;height:32px;line-height:32px;margin-right:10px}.ivu-page-simple .ivu-page-next,.ivu-page-simple .ivu-page-prev{margin:0;border:0;height:24px;line-height:normal;font-size:18px}.ivu-page-simple .ivu-page-simple-pager{display:inline-block;margin-right:8px;vertical-align:middle}.ivu-page-simple .ivu-page-simple-pager input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;color:#515a6e;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;width:30px;height:24px;margin:0 8px;padding:5px 8px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff;outline:0;border:1px solid #dcdee2;border-radius:4px;-webkit-transition:border-color .2s ease-in-out;transition:border-color .2s ease-in-out}.ivu-page-simple .ivu-page-simple-pager input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-page-simple .ivu-page-simple-pager input:-ms-input-placeholder{color:#c5c8ce}.ivu-page-simple .ivu-page-simple-pager input::-webkit-input-placeholder{color:#c5c8ce}.ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#57a3f3}.ivu-page-simple .ivu-page-simple-pager input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-page-simple .ivu-page-simple-pager input[disabled],fieldset[disabled] .ivu-page-simple .ivu-page-simple-pager input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-page-simple .ivu-page-simple-pager input[disabled]:hover,fieldset[disabled] .ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#e3e5e8}textarea.ivu-page-simple .ivu-page-simple-pager input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-page-simple .ivu-page-simple-pager input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-page-simple .ivu-page-simple-pager input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-page-simple .ivu-page-simple-pager input:hover{border-color:#2d8cf0}.ivu-page-simple .ivu-page-simple-pager span{padding:0 8px 0 2px}.ivu-page-custom-text,.ivu-page-custom-text:hover{border-color:transparent}.ivu-page.mini .ivu-page-total{height:24px;line-height:24px}.ivu-page.mini .ivu-page-item{border:0;margin:0;min-width:24px;height:24px;line-height:24px;border-radius:3px}.ivu-page.mini .ivu-page-next,.ivu-page.mini .ivu-page-prev{margin:0;min-width:24px;height:24px;line-height:22px;border:0}.ivu-page.mini .ivu-page-next a i:after,.ivu-page.mini .ivu-page-prev a i:after{height:24px;line-height:24px}.ivu-page.mini .ivu-page-item-jump-next,.ivu-page.mini .ivu-page-item-jump-prev{height:24px;line-height:24px;border:none;margin-right:0}.ivu-page.mini .ivu-page-options{margin-left:8px}.ivu-page.mini .ivu-page-options-elevator{height:24px;line-height:24px}.ivu-page.mini .ivu-page-options-elevator input{padding:1px 7px;height:24px;border-radius:3px;width:44px}.ivu-steps{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;font-size:0;line-height:1.5}.ivu-steps-item{display:inline-block;position:relative;vertical-align:top;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.ivu-steps-item:last-child{-webkit-box-flex:0;-ms-flex:0;flex:none}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner{background-color:#fff}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-wait .ivu-steps-head-inner>.ivu-steps-icon{color:#ccc}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-title{color:#999}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-content{color:#999}.ivu-steps-item.ivu-steps-status-wait .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner{border-color:#2d8cf0;background-color:#2d8cf0}.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-process .ivu-steps-head-inner>.ivu-steps-icon{color:#fff}.ivu-steps-item.ivu-steps-status-process .ivu-steps-title{color:#666}.ivu-steps-item.ivu-steps-status-process .ivu-steps-content{color:#666}.ivu-steps-item.ivu-steps-status-process .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner{background-color:#fff;border-color:#2d8cf0}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner span,.ivu-steps-item.ivu-steps-status-finish .ivu-steps-head-inner>.ivu-steps-icon{color:#2d8cf0}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-tail>i:after{width:100%;background:#2d8cf0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;opacity:1}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-title{color:#999}.ivu-steps-item.ivu-steps-status-finish .ivu-steps-content{color:#999}.ivu-steps-item.ivu-steps-status-error .ivu-steps-head-inner{background-color:#fff;border-color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-head-inner>.ivu-steps-icon{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-title{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-content{color:#ed4014}.ivu-steps-item.ivu-steps-status-error .ivu-steps-tail>i{background-color:#e8eaec}.ivu-steps-item.ivu-steps-next-error .ivu-steps-tail>i,.ivu-steps-item.ivu-steps-next-error .ivu-steps-tail>i:after{background-color:#ed4014}.ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner{background:0 0;border:0;width:auto;height:auto}.ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner>.ivu-steps-icon{font-size:20px;top:2px;width:20px;height:20px}.ivu-steps-item.ivu-steps-custom.ivu-steps-status-process .ivu-steps-head-inner>.ivu-steps-icon{color:#2d8cf0}.ivu-steps-item:last-child .ivu-steps-tail{display:none}.ivu-steps .ivu-steps-head,.ivu-steps .ivu-steps-main{position:relative;display:inline-block;vertical-align:top}.ivu-steps .ivu-steps-head{background:#fff}.ivu-steps .ivu-steps-head-inner{display:block;width:26px;height:26px;line-height:24px;margin-right:8px;text-align:center;border:1px solid #ccc;border-radius:50%;font-size:14px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon{line-height:1;position:relative}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon{font-size:24px}.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon-ios-checkmark-empty,.ivu-steps .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon-ios-close-empty{font-weight:700}.ivu-steps .ivu-steps-main{margin-top:2.5px;display:inline}.ivu-steps .ivu-steps-custom .ivu-steps-title{margin-top:2.5px}.ivu-steps .ivu-steps-title{display:inline-block;margin-bottom:4px;padding-right:10px;font-size:14px;font-weight:700;color:#666;background:#fff}.ivu-steps .ivu-steps-title>a:first-child:last-child{color:#666}.ivu-steps .ivu-steps-item-last .ivu-steps-title{padding-right:0;width:100%}.ivu-steps .ivu-steps-content{font-size:12px;color:#999}.ivu-steps .ivu-steps-tail{width:100%;padding:0 10px;position:absolute;left:0;top:13px}.ivu-steps .ivu-steps-tail>i{display:inline-block;width:100%;height:1px;vertical-align:top;background:#e8eaec;border-radius:1px;position:relative}.ivu-steps .ivu-steps-tail>i:after{content:'';width:0;height:100%;background:#e8eaec;opacity:0;position:absolute;top:0}.ivu-steps.ivu-steps-small .ivu-steps-head-inner{width:18px;height:18px;line-height:16px;margin-right:10px;text-align:center;border-radius:50%;font-size:12px}.ivu-steps.ivu-steps-small .ivu-steps-head-inner>.ivu-steps-icon.ivu-icon{font-size:16px;top:0}.ivu-steps.ivu-steps-small .ivu-steps-main{margin-top:0}.ivu-steps.ivu-steps-small .ivu-steps-title{margin-bottom:4px;margin-top:0;color:#666;font-size:12px;font-weight:700}.ivu-steps.ivu-steps-small .ivu-steps-content{font-size:12px;color:#999;padding-left:30px}.ivu-steps.ivu-steps-small .ivu-steps-tail{top:8px;padding:0 8px}.ivu-steps.ivu-steps-small .ivu-steps-tail>i{height:1px;width:100%;border-radius:1px}.ivu-steps .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner,.ivu-steps.ivu-steps-small .ivu-steps-item.ivu-steps-custom .ivu-steps-head-inner{width:inherit;height:inherit;line-height:inherit;border-radius:0;border:0;background:0 0}.ivu-steps-vertical{display:block}.ivu-steps-vertical .ivu-steps-item{display:block;overflow:visible}.ivu-steps-vertical .ivu-steps-tail{position:absolute;left:13px;top:0;height:100%;width:1px;padding:30px 0 4px 0}.ivu-steps-vertical .ivu-steps-tail>i{height:100%;width:1px}.ivu-steps-vertical .ivu-steps-tail>i:after{height:0;width:100%}.ivu-steps-vertical .ivu-steps-status-finish .ivu-steps-tail>i:after{height:100%}.ivu-steps-vertical .ivu-steps-head{float:left}.ivu-steps-vertical .ivu-steps-head-inner{margin-right:16px}.ivu-steps-vertical .ivu-steps-main{min-height:47px;overflow:hidden;display:block}.ivu-steps-vertical .ivu-steps-main .ivu-steps-title{line-height:26px}.ivu-steps-vertical .ivu-steps-main .ivu-steps-content{padding-bottom:12px;padding-left:0}.ivu-steps-vertical .ivu-steps-custom .ivu-steps-icon{left:4px}.ivu-steps-vertical.ivu-steps-small .ivu-steps-custom .ivu-steps-icon{left:0}.ivu-steps-vertical.ivu-steps-small .ivu-steps-tail{position:absolute;left:9px;top:0;padding:22px 0 4px 0}.ivu-steps-vertical.ivu-steps-small .ivu-steps-tail>i{height:100%}.ivu-steps-vertical.ivu-steps-small .ivu-steps-title{line-height:18px}.ivu-steps-horizontal.ivu-steps-hidden{visibility:hidden}.ivu-steps-horizontal .ivu-steps-content{padding-left:35px}.ivu-steps-horizontal .ivu-steps-item:not(:first-child) .ivu-steps-head{padding-left:10px;margin-left:-10px}.ivu-modal{width:auto;margin:0 auto;position:relative;outline:0;top:100px}.ivu-modal-hidden{display:none!important}.ivu-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1000;-webkit-overflow-scrolling:touch;outline:0}.ivu-modal-wrap *{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.ivu-modal-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1000}.ivu-modal-mask-hidden{display:none}.ivu-modal-content{position:relative;background-color:#fff;border:0;border-radius:6px;background-clip:padding-box;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}.ivu-modal-content-no-mask{pointer-events:auto}.ivu-modal-content-drag{position:absolute}.ivu-modal-content-drag .ivu-modal-header{cursor:move}.ivu-modal-content-dragging{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-modal-header{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-modal-header p,.ivu-modal-header-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-modal-close{z-index:1;font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-modal-close .ivu-icon-ios-close{font-size:31px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:1px}.ivu-modal-close .ivu-icon-ios-close:hover{color:#444}.ivu-modal-body{padding:16px;font-size:14px;line-height:1.5}.ivu-modal-footer{border-top:1px solid #e8eaec;padding:12px 18px 12px 18px;text-align:right}.ivu-modal-footer button+button{margin-left:8px;margin-bottom:0}.ivu-modal-fullscreen{width:100%!important;top:0;bottom:0;position:absolute}.ivu-modal-fullscreen .ivu-modal-content{width:100%;border-radius:0;position:absolute;top:0;bottom:0}.ivu-modal-fullscreen .ivu-modal-body{width:100%;overflow:auto;position:absolute;top:51px;bottom:61px}.ivu-modal-fullscreen-no-header .ivu-modal-body{top:0}.ivu-modal-fullscreen-no-footer .ivu-modal-body{bottom:0}.ivu-modal-fullscreen .ivu-modal-footer{position:absolute;width:100%;bottom:0}.ivu-modal-no-mask{pointer-events:none}@media (max-width:576px){.ivu-modal{width:auto!important;margin:10px}.ivu-modal-fullscreen{width:100%!important;margin:0}.vertical-center-modal .ivu-modal{-webkit-box-flex:1;-ms-flex:1;flex:1}}.ivu-modal-confirm{padding:6px 16px 8px}.ivu-modal-confirm-head{padding:0 12px 0 0}.ivu-modal-confirm-head-icon{display:inline-block;font-size:28px;vertical-align:middle;position:relative;top:-2px}.ivu-modal-confirm-head-icon-info{color:#2d8cf0}.ivu-modal-confirm-head-icon-success{color:#19be6b}.ivu-modal-confirm-head-icon-warning{color:#f90}.ivu-modal-confirm-head-icon-error{color:#ed4014}.ivu-modal-confirm-head-icon-confirm{color:#f90}.ivu-modal-confirm-head-title{display:inline-block;vertical-align:middle;margin-left:12px;font-size:16px;color:#17233d;font-weight:500}.ivu-modal-confirm-body{padding-left:40px;font-size:14px;color:#515a6e;position:relative}.ivu-modal-confirm-body-render{margin:0;padding:0}.ivu-modal-confirm-footer{margin-top:20px;text-align:right}.ivu-modal-confirm-footer button+button{margin-left:8px;margin-bottom:0}.ivu-select{display:inline-block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle;color:#515a6e;font-size:14px;line-height:normal}.ivu-select-selection{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative;background-color:#fff;border-radius:4px;border:1px solid #dcdee2;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-select-selection-focused,.ivu-select-selection:hover{border-color:#57a3f3}.ivu-select-selection-focused .ivu-select-arrow,.ivu-select-selection:hover .ivu-select-arrow{display:inline-block}.ivu-select-arrow{position:absolute;top:50%;right:8px;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);font-size:14px;color:#808695;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-select-visible .ivu-select-selection{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-select-visible .ivu-select-arrow{-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg);display:inline-block}.ivu-select-disabled .ivu-select-selection{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-select-disabled .ivu-select-selection:hover{border-color:#e3e5e8}.ivu-select-disabled .ivu-select-selection .ivu-select-arrow{color:#ccc}.ivu-select-disabled .ivu-select-selection:hover{border-color:#dcdee2;-webkit-box-shadow:none;box-shadow:none}.ivu-select-disabled .ivu-select-selection:hover .ivu-select-arrow{display:inline-block}.ivu-select-single .ivu-select-selection{height:32px;position:relative}.ivu-select-single .ivu-select-selection .ivu-select-placeholder{color:#c5c8ce}.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-single .ivu-select-selection .ivu-select-selected-value{display:block;height:30px;line-height:30px;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:8px;padding-right:24px}.ivu-select-multiple .ivu-select-selection{padding:0 24px 0 4px}.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder{display:block;height:30px;line-height:30px;color:#c5c8ce;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:4px;padding-right:22px}.ivu-select-default.ivu-select-multiple .ivu-select-selection{min-height:32px}.ivu-select-large.ivu-select-single .ivu-select-selection{height:40px}.ivu-select-large.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-large.ivu-select-single .ivu-select-selection .ivu-select-selected-value{height:38px;line-height:38px;font-size:16px}.ivu-select-large.ivu-select-multiple .ivu-select-selection{min-height:40px}.ivu-select-large.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,.ivu-select-large.ivu-select-multiple .ivu-select-selection .ivu-select-selected-value{min-height:38px;line-height:38px;font-size:16px}.ivu-select-small.ivu-select-single .ivu-select-selection{height:24px;border-radius:3px}.ivu-select-small.ivu-select-single .ivu-select-selection .ivu-select-placeholder,.ivu-select-small.ivu-select-single .ivu-select-selection .ivu-select-selected-value{height:22px;line-height:22px}.ivu-select-small.ivu-select-multiple .ivu-select-selection{min-height:24px;border-radius:3px}.ivu-select-small.ivu-select-multiple .ivu-select-selection .ivu-select-placeholder,.ivu-select-small.ivu-select-multiple .ivu-select-selection .ivu-select-selected-value{height:auto;min-height:22px;line-height:22px}.ivu-select-input{display:inline-block;height:32px;line-height:32px;padding:0 24px 0 8px;font-size:14px;outline:0;border:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:#515a6e;background-color:transparent;position:relative;cursor:pointer}.ivu-select-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-select-input:-ms-input-placeholder{color:#c5c8ce}.ivu-select-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-select-input[disabled]{cursor:not-allowed;color:#ccc;-webkit-text-fill-color:#ccc}.ivu-select-single .ivu-select-input{width:100%}.ivu-select-large .ivu-select-input,.ivu-select-large.ivu-select-multiple .ivu-select-input{font-size:16px;height:32px;line-height:32px;top:3px}.ivu-select-small .ivu-select-input,.ivu-select-small.ivu-select-multiple .ivu-select-input{height:18px;line-height:18px;top:2px}.ivu-select-multiple .ivu-select-input{height:26px;line-height:26px;padding:0 0 0 4px;top:2px}.ivu-select-not-found{text-align:center;color:#c5c8ce}.ivu-select-not-found li:not([class^=ivu-]){margin-bottom:0}.ivu-select-loading{text-align:center;color:#c5c8ce}.ivu-select-multiple .ivu-tag{height:24px;line-height:22px;margin:3px 4px 3px 0;max-width:99%;position:relative}.ivu-select-multiple .ivu-tag span:not(.ivu-select-max-tag){display:block;margin-right:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-select-multiple .ivu-tag i{display:block;position:absolute;right:4px;top:4px}.ivu-select-large.ivu-select-multiple .ivu-tag{height:32px;line-height:30px;font-size:16px}.ivu-select-large.ivu-select-multiple .ivu-tag i{top:9px}.ivu-select-small.ivu-select-multiple .ivu-tag{height:17px;line-height:15px;font-size:12px;padding:0 6px;margin:3px 4px 2px 0}.ivu-select-small.ivu-select-multiple .ivu-tag span{margin-right:14px}.ivu-select-small.ivu-select-multiple .ivu-tag i{top:1px;right:2px}.ivu-select-dropdown-list{min-width:100%;list-style:none}.ivu-select .ivu-select-dropdown{width:auto}.ivu-select-prefix{display:inline-block;vertical-align:middle}.ivu-select-prefix i{vertical-align:top}.ivu-select-head-with-prefix{display:inline-block!important;vertical-align:middle}.ivu-select-single .ivu-select-prefix{padding-left:4px}.ivu-select-multiple .ivu-select-head-with-prefix,.ivu-select-single .ivu-select-head-with-prefix{padding-left:0!important}.ivu-select-head-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-select-multiple .ivu-select-head-flex .ivu-select-prefix{margin-right:4px}.ivu-select-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-select-item:hover{background:#f3f3f3}.ivu-select-item-focus{background:#f3f3f3}.ivu-select-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-select-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-select-item-selected,.ivu-select-item-selected:hover{color:#2d8cf0}.ivu-select-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-select-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-select-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-select-large .ivu-select-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-select-item{white-space:normal}}.ivu-select-multiple .ivu-select-item{position:relative}.ivu-select-multiple .ivu-select-item-selected{color:rgba(45,140,240,.9);background:#fff}.ivu-select-multiple .ivu-select-item-focus,.ivu-select-multiple .ivu-select-item-selected:hover{background:#f3f3f3}.ivu-select-multiple .ivu-select-item-selected.ivu-select-multiple .ivu-select-item-focus{color:rgba(40,123,211,.91);background:#fff}.ivu-select-multiple .ivu-select-item-selected:after{display:inline-block;font-family:Ionicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:optimizeLegibility;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:-.125em;text-align:center;font-size:24px;content:'\\F171';color:rgba(45,140,240,.9);position:absolute;top:2px;right:8px}.ivu-select-group{list-style:none;margin:0;padding:0}.ivu-select-group-title{padding-left:8px;font-size:14px;color:#999;height:30px;line-height:30px}.ivu-form-item-error .ivu-select-selection{border:1px solid #ed4014}.ivu-form-item-error .ivu-select-arrow{color:#ed4014}.ivu-form-item-error .ivu-select-visible .ivu-select-selection{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-select-dropdown{width:inherit;max-height:200px;overflow:auto;margin:5px 0;padding:5px 0;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);position:absolute;z-index:900}.ivu-select-dropdown-transfer{z-index:1060;width:auto}.ivu-select-dropdown.ivu-transfer-no-max-height{max-height:none}.ivu-modal .ivu-select-dropdown{position:absolute!important}.ivu-split-wrapper{position:relative;width:100%;height:100%}.ivu-split-pane{position:absolute}.ivu-split-pane.left-pane,.ivu-split-pane.right-pane{top:0;bottom:0}.ivu-split-pane.left-pane{left:0}.ivu-split-pane.right-pane{right:0}.ivu-split-pane.bottom-pane,.ivu-split-pane.top-pane{left:0;right:0}.ivu-split-pane.top-pane{top:0}.ivu-split-pane.bottom-pane{bottom:0}.ivu-split-pane-moving{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-split-trigger{border:1px solid #dcdee2}.ivu-split-trigger-con{position:absolute;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:10}.ivu-split-trigger-bar-con{position:absolute;overflow:hidden}.ivu-split-trigger-bar-con.vertical{left:1px;top:50%;height:32px;-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translate(0,-50%)}.ivu-split-trigger-bar-con.horizontal{left:50%;top:1px;width:32px;-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0)}.ivu-split-trigger-vertical{width:6px;height:100%;background:#f8f8f9;border-top:none;border-bottom:none;cursor:col-resize}.ivu-split-trigger-vertical .ivu-split-trigger-bar{width:4px;height:1px;background:rgba(23,35,61,.25);float:left;margin-top:3px}.ivu-split-trigger-horizontal{height:6px;width:100%;background:#f8f8f9;border-left:none;border-right:none;cursor:row-resize}.ivu-split-trigger-horizontal .ivu-split-trigger-bar{height:4px;width:1px;background:rgba(23,35,61,.25);float:left;margin-right:3px}.ivu-split-horizontal .ivu-split-trigger-con{top:50%;height:100%;width:0}.ivu-split-vertical .ivu-split-trigger-con{left:50%;height:0;width:100%}.ivu-split .no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-tooltip{display:inline-block}.ivu-tooltip-rel{display:inline-block;position:relative;width:inherit}.ivu-tooltip-popper{display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-tooltip-popper[x-placement^=top]{padding:5px 0 8px 0}.ivu-tooltip-popper[x-placement^=right]{padding:0 5px 0 8px}.ivu-tooltip-popper[x-placement^=bottom]{padding:8px 0 5px 0}.ivu-tooltip-popper[x-placement^=left]{padding:0 8px 0 5px}.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow{bottom:3px;border-width:5px 5px 0;border-top-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=top] .ivu-tooltip-arrow{left:50%;margin-left:-5px}.ivu-tooltip-popper[x-placement=top-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-popper[x-placement=top-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow{left:3px;border-width:5px 5px 5px 0;border-right-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=right] .ivu-tooltip-arrow{top:50%;margin-top:-5px}.ivu-tooltip-popper[x-placement=right-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-popper[x-placement=right-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow{right:3px;border-width:5px 0 5px 5px;border-left-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=left] .ivu-tooltip-arrow{top:50%;margin-top:-5px}.ivu-tooltip-popper[x-placement=left-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-popper[x-placement=left-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow{top:3px;border-width:0 5px 5px;border-bottom-color:rgba(70,76,91,.9)}.ivu-tooltip-popper[x-placement=bottom] .ivu-tooltip-arrow{left:50%;margin-left:-5px}.ivu-tooltip-popper[x-placement=bottom-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-popper[x-placement=bottom-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper{display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top]{padding:7px 0 10px 0}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right]{padding:0 7px 0 10px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom]{padding:10px 0 7px 0}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left]{padding:0 10px 0 7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow{bottom:3px;border-width:7px 7px 0;border-top-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top] .ivu-tooltip-arrow{left:50%;margin-left:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=top-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow{left:3px;border-width:7px 7px 7px 0;border-right-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right] .ivu-tooltip-arrow{top:50%;margin-top:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=right-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow{right:3px;border-width:7px 0 7px 7px;border-left-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left] .ivu-tooltip-arrow{top:50%;margin-top:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left-start] .ivu-tooltip-arrow{top:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=left-end] .ivu-tooltip-arrow{bottom:8px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow{top:3px;border-width:0 7px 7px;border-bottom-color:rgba(217,217,217,.5)}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom] .ivu-tooltip-arrow{left:50%;margin-left:-7px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom-start] .ivu-tooltip-arrow{left:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement=bottom-end] .ivu-tooltip-arrow{right:16px}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=top] .ivu-tooltip-arrow:after{content:\" \";bottom:1px;margin-left:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=right] .ivu-tooltip-arrow:after{content:\" \";left:1px;bottom:-7px;border-left-width:0;border-right-width:7px;border-right-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=bottom] .ivu-tooltip-arrow:after{content:\" \";top:1px;margin-left:-7px;border-top-width:0;border-bottom-width:7px;border-bottom-color:#fff}.ivu-tooltip-light.ivu-tooltip-popper[x-placement^=left] .ivu-tooltip-arrow:after{content:\" \";right:1px;border-right-width:0;border-left-width:7px;border-left-color:#fff;bottom:-7px}.ivu-tooltip-inner{max-width:250px;min-height:34px;padding:8px 12px;color:#fff;text-align:left;text-decoration:none;background-color:rgba(70,76,91,.9);border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);white-space:nowrap}.ivu-tooltip-inner-with-width{white-space:pre-wrap;text-align:justify}.ivu-tooltip-light .ivu-tooltip-inner{background-color:#fff;color:#515a6e}.ivu-tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.ivu-tooltip-light .ivu-tooltip-arrow{border-width:8px}.ivu-tooltip-light .ivu-tooltip-arrow:after{display:block;width:0;height:0;position:absolute;border-color:transparent;border-style:solid;content:\"\";border-width:7px}.ivu-poptip{display:inline-block}.ivu-poptip-rel{display:inline-block;position:relative}.ivu-poptip-title{margin:0;padding:8px 16px;position:relative}.ivu-poptip-title:after{content:'';display:block;height:1px;position:absolute;left:8px;right:8px;bottom:0;background-color:#e8eaec}.ivu-poptip-title-inner{color:#17233d;font-size:14px;font-weight:500}.ivu-poptip-body{padding:8px 16px}.ivu-poptip-body-content{overflow:auto}.ivu-poptip-body-content-word-wrap{white-space:pre-wrap;text-align:justify}.ivu-poptip-body-content-inner{color:#515a6e}.ivu-poptip-inner{width:100%;background-color:#fff;background-clip:padding-box;border-radius:4px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);white-space:nowrap}.ivu-poptip-popper{min-width:150px;display:block;visibility:visible;font-size:14px;line-height:1.5;position:absolute;z-index:1060}.ivu-poptip-popper[x-placement^=top]{padding:7px 0 10px 0}.ivu-poptip-popper[x-placement^=right]{padding:0 7px 0 10px}.ivu-poptip-popper[x-placement^=bottom]{padding:10px 0 7px 0}.ivu-poptip-popper[x-placement^=left]{padding:0 10px 0 7px}.ivu-poptip-popper[x-placement^=top] .ivu-poptip-arrow{bottom:3px;border-width:7px 7px 0;border-top-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=top] .ivu-poptip-arrow{left:50%;margin-left:-7px}.ivu-poptip-popper[x-placement=top-start] .ivu-poptip-arrow{left:16px}.ivu-poptip-popper[x-placement=top-end] .ivu-poptip-arrow{right:16px}.ivu-poptip-popper[x-placement^=right] .ivu-poptip-arrow{left:3px;border-width:7px 7px 7px 0;border-right-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=right] .ivu-poptip-arrow{top:50%;margin-top:-7px}.ivu-poptip-popper[x-placement=right-start] .ivu-poptip-arrow{top:8px}.ivu-poptip-popper[x-placement=right-end] .ivu-poptip-arrow{bottom:8px}.ivu-poptip-popper[x-placement^=left] .ivu-poptip-arrow{right:3px;border-width:7px 0 7px 7px;border-left-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=left] .ivu-poptip-arrow{top:50%;margin-top:-7px}.ivu-poptip-popper[x-placement=left-start] .ivu-poptip-arrow{top:8px}.ivu-poptip-popper[x-placement=left-end] .ivu-poptip-arrow{bottom:8px}.ivu-poptip-popper[x-placement^=bottom] .ivu-poptip-arrow{top:3px;border-width:0 7px 7px;border-bottom-color:rgba(217,217,217,.5)}.ivu-poptip-popper[x-placement=bottom] .ivu-poptip-arrow{left:50%;margin-left:-7px}.ivu-poptip-popper[x-placement=bottom-start] .ivu-poptip-arrow{left:16px}.ivu-poptip-popper[x-placement=bottom-end] .ivu-poptip-arrow{right:16px}.ivu-poptip-popper[x-placement^=top] .ivu-poptip-arrow:after{content:\" \";bottom:1px;margin-left:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#fff}.ivu-poptip-popper[x-placement^=right] .ivu-poptip-arrow:after{content:\" \";left:1px;bottom:-7px;border-left-width:0;border-right-width:7px;border-right-color:#fff}.ivu-poptip-popper[x-placement^=bottom] .ivu-poptip-arrow:after{content:\" \";top:1px;margin-left:-7px;border-top-width:0;border-bottom-width:7px;border-bottom-color:#fff}.ivu-poptip-popper[x-placement^=left] .ivu-poptip-arrow:after{content:\" \";right:1px;border-right-width:0;border-left-width:7px;border-left-color:#fff;bottom:-7px}.ivu-poptip-arrow,.ivu-poptip-arrow:after{display:block;width:0;height:0;position:absolute;border-color:transparent;border-style:solid}.ivu-poptip-arrow{border-width:8px}.ivu-poptip-arrow:after{content:\"\";border-width:7px}.ivu-poptip-confirm .ivu-poptip-popper{max-width:300px}.ivu-poptip-confirm .ivu-poptip-inner{white-space:normal}.ivu-poptip-confirm .ivu-poptip-body{padding:16px 16px 8px}.ivu-poptip-confirm .ivu-poptip-body .ivu-icon{font-size:16px;color:#f90;line-height:18px;position:absolute}.ivu-poptip-confirm .ivu-poptip-body-message{padding-left:20px}.ivu-poptip-confirm .ivu-poptip-footer{text-align:right;padding:8px 16px 16px}.ivu-poptip-confirm .ivu-poptip-footer button{margin-left:4px}.ivu-input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;border-radius:4px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-input:-ms-input-placeholder{color:#c5c8ce}.ivu-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-input:hover{border-color:#57a3f3}.ivu-input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-input[disabled],fieldset[disabled] .ivu-input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-input[disabled]:hover,fieldset[disabled] .ivu-input:hover{border-color:#e3e5e8}textarea.ivu-input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-input-wrapper{display:inline-block;width:100%;position:relative;vertical-align:middle;line-height:normal}.ivu-input-icon{width:32px;height:32px;line-height:32px;font-size:16px;text-align:center;color:#808695;position:absolute;right:0;z-index:3}.ivu-input-hide-icon .ivu-input-icon{display:none}.ivu-input-icon-validate{display:none}.ivu-input-icon-clear{display:none}.ivu-input-wrapper:hover .ivu-input-icon-clear{display:inline-block}.ivu-input-icon-normal+.ivu-input{padding-right:32px}.ivu-input-hide-icon .ivu-input-icon-normal+.ivu-input{padding-right:7px}.ivu-input-wrapper-large .ivu-input-icon{font-size:18px;height:40px;line-height:40px}.ivu-input-wrapper-small .ivu-input-icon{width:24px;font-size:14px;height:24px;line-height:24px}.ivu-input-prefix,.ivu-input-suffix{width:32px;height:100%;text-align:center;position:absolute;left:0;top:0;z-index:1}.ivu-input-prefix i,.ivu-input-suffix i{font-size:16px;line-height:32px;color:#808695}.ivu-input-suffix{left:auto;right:0}.ivu-input-wrapper-small .ivu-input-prefix i,.ivu-input-wrapper-small .ivu-input-suffix i{font-size:14px;line-height:24px}.ivu-input-wrapper-large .ivu-input-prefix i,.ivu-input-wrapper-large .ivu-input-suffix i{font-size:18px;line-height:40px}.ivu-input-with-prefix{padding-left:32px}.ivu-input-with-suffix{padding-right:32px}.ivu-input-search{cursor:pointer;padding:0 16px!important;background:#2d8cf0!important;color:#fff!important;border-color:#2d8cf0!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;position:relative;z-index:2}.ivu-input-search i{font-size:16px}.ivu-input-search:hover{background:#57a3f3!important;border-color:#57a3f3!important}.ivu-input-search:active{background:#2b85e4!important;border-color:#2b85e4!important}.ivu-input-search-icon{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-input-search-icon:hover{color:inherit}.ivu-input-search:before{content:'';display:block;width:1px;position:absolute;top:-1px;bottom:-1px;left:-1px;background:inherit}.ivu-input-wrapper-small .ivu-input-search{padding:0 12px!important}.ivu-input-wrapper-small .ivu-input-search i{font-size:14px}.ivu-input-wrapper-large .ivu-input-search{padding:0 20px!important}.ivu-input-wrapper-large .ivu-input-search i{font-size:18px}.ivu-input-with-search:hover .ivu-input{border-color:#57a3f3}.ivu-input-word-count{text-align:center;position:absolute;right:7px;top:1px;bottom:1px;padding-left:7px;background:#fff;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#808695;font-size:12px}.ivu-input-type-textarea .ivu-input-word-count{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;top:auto}.ivu-input-group{display:table;width:100%;border-collapse:separate;position:relative;font-size:14px;top:1px}.ivu-input-group-large{font-size:16px}.ivu-input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ivu-input-group>[class*=col-]{padding-right:8px}.ivu-input-group-append,.ivu-input-group-prepend,.ivu-input-group>.ivu-input{display:table-cell}.ivu-input-group-with-prepend .ivu-input,.ivu-input-group-with-prepend.ivu-input-group-small .ivu-input{border-top-left-radius:0;border-bottom-left-radius:0}.ivu-input-group-with-append .ivu-input,.ivu-input-group-with-append.ivu-input-group-small .ivu-input{border-top-right-radius:0;border-bottom-right-radius:0}.ivu-input-group-append .ivu-btn,.ivu-input-group-prepend .ivu-btn{border-color:transparent;background-color:transparent;color:inherit;margin:-6px -7px}.ivu-input-group-append,.ivu-input-group-prepend{width:1px;white-space:nowrap;vertical-align:middle}.ivu-input-group .ivu-input{width:100%;float:left;margin-bottom:0;position:relative;z-index:2}.ivu-input-group-append,.ivu-input-group-prepend{padding:4px 7px;font-size:inherit;font-weight:400;line-height:1;color:#515a6e;text-align:center;background-color:#f8f8f9;border:1px solid #dcdee2;border-radius:4px}.ivu-input-group-append .ivu-select,.ivu-input-group-prepend .ivu-select{margin:-5px -7px}.ivu-input-group-append .ivu-select-selection,.ivu-input-group-prepend .ivu-select-selection{background-color:inherit;margin:-1px;border:1px solid transparent}.ivu-input-group-append .ivu-select-visible .ivu-select-selection,.ivu-input-group-prepend .ivu-select-visible .ivu-select-selection{-webkit-box-shadow:none;box-shadow:none}.ivu-input-group-prepend,.ivu-input-group>.ivu-input:first-child,.ivu-input-group>span>.ivu-input:first-child{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.ivu-input-group-prepend .ivu--select .ivu--select-selection,.ivu-input-group>.ivu-input:first-child .ivu--select .ivu--select-selection,.ivu-input-group>span>.ivu-input:first-child .ivu--select .ivu--select-selection{border-bottom-right-radius:0;border-top-right-radius:0}.ivu-input-group-prepend{border-right:0}.ivu-input-group-append{border-left:0}.ivu-input-group-append,.ivu-input-group>.ivu-input:last-child{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.ivu-input-group-append .ivu--select .ivu--select-selection,.ivu-input-group>.ivu-input:last-child .ivu--select .ivu--select-selection{border-bottom-left-radius:0;border-top-left-radius:0}.ivu-input-group-large .ivu-input,.ivu-input-group-large>.ivu-input-group-append,.ivu-input-group-large>.ivu-input-group-prepend{font-size:16px;padding:6px 7px;height:40px}.ivu-input-group-small .ivu-input,.ivu-input-group-small>.ivu-input-group-append,.ivu-input-group-small>.ivu-input-group-prepend{padding:1px 7px;height:24px;border-radius:3px}.ivu-form-item-error .ivu-input{border:1px solid #ed4014}.ivu-form-item-error .ivu-input:hover{border-color:#ed4014}.ivu-form-item-error .ivu-input:focus{border-color:#ed4014;outline:0;-webkit-box-shadow:0 0 0 2px rgba(237,64,20,.2);box-shadow:0 0 0 2px rgba(237,64,20,.2)}.ivu-form-item-error .ivu-input-icon{color:#ed4014}.ivu-form-item-error .ivu-input-group-append,.ivu-form-item-error .ivu-input-group-prepend{background-color:#fff;border:1px solid #ed4014}.ivu-form-item-error .ivu-input-group-append .ivu-select-selection,.ivu-form-item-error .ivu-input-group-prepend .ivu-select-selection{background-color:inherit;border:1px solid transparent}.ivu-form-item-error .ivu-input-group-prepend{border-right:0}.ivu-form-item-error .ivu-input-group-append{border-left:0}.ivu-form-item-error .ivu-transfer .ivu-input{display:inline-block;width:100%;height:32px;line-height:1.5;padding:4px 7px;font-size:14px;border:1px solid #dcdee2;border-radius:4px;color:#515a6e;background-color:#fff;background-image:none;position:relative;cursor:text;-webkit-transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,background .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-form-item-error .ivu-transfer .ivu-input::-moz-placeholder{color:#c5c8ce;opacity:1}.ivu-form-item-error .ivu-transfer .ivu-input:-ms-input-placeholder{color:#c5c8ce}.ivu-form-item-error .ivu-transfer .ivu-input::-webkit-input-placeholder{color:#c5c8ce}.ivu-form-item-error .ivu-transfer .ivu-input:hover{border-color:#57a3f3}.ivu-form-item-error .ivu-transfer .ivu-input:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-form-item-error .ivu-transfer .ivu-input[disabled],fieldset[disabled] .ivu-form-item-error .ivu-transfer .ivu-input{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-form-item-error .ivu-transfer .ivu-input[disabled]:hover,fieldset[disabled] .ivu-form-item-error .ivu-transfer .ivu-input:hover{border-color:#e3e5e8}textarea.ivu-form-item-error .ivu-transfer .ivu-input{max-width:100%;height:auto;min-height:32px;vertical-align:bottom;font-size:14px}.ivu-form-item-error .ivu-transfer .ivu-input-large{font-size:16px;padding:6px 7px;height:40px}.ivu-form-item-error .ivu-transfer .ivu-input-small{padding:1px 7px;height:24px;border-radius:3px}.ivu-form-item-error .ivu-transfer .ivu-input-icon{color:#808695}.ivu-form-item-validating .ivu-input-icon-validate{display:inline-block}.ivu-form-item-validating .ivu-input-icon+.ivu-input{padding-right:32px}.ivu-slider{line-height:normal}.ivu-slider-wrap{width:100%;height:4px;margin:16px 0;background-color:#e8eaec;border-radius:3px;vertical-align:middle;position:relative;cursor:pointer}.ivu-slider-button-wrap{width:18px;height:18px;text-align:center;background-color:transparent;position:absolute;top:-4px;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.ivu-slider-button-wrap .ivu-tooltip{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-slider-button{width:12px;height:12px;border:2px solid #57a3f3;border-radius:50%;background-color:#fff;-webkit-transition:all .2s linear;transition:all .2s linear;outline:0}.ivu-slider-button-dragging,.ivu-slider-button:focus,.ivu-slider-button:hover{border-color:#2d8cf0;-webkit-transform:scale(1.5);-ms-transform:scale(1.5);transform:scale(1.5)}.ivu-slider-button:hover{cursor:-webkit-grab;cursor:grab}.ivu-slider-button-dragging,.ivu-slider-button-dragging:hover{cursor:-webkit-grabbing;cursor:grabbing}.ivu-slider-bar{height:4px;background:#57a3f3;border-radius:3px;position:absolute}.ivu-slider-stop{position:absolute;width:4px;height:4px;border-radius:50%;background-color:#fff;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.ivu-slider-marks{top:0;left:12px;width:18px;height:100%}.ivu-slider-marks-item{position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#808695;margin-top:15px}.ivu-slider-disabled{cursor:not-allowed}.ivu-slider-disabled .ivu-slider-wrap{background-color:#ccc;cursor:not-allowed}.ivu-slider-disabled .ivu-slider-bar{background-color:#ccc}.ivu-slider-disabled .ivu-slider-button{border-color:#ccc}.ivu-slider-disabled .ivu-slider-button-dragging,.ivu-slider-disabled .ivu-slider-button:hover{border-color:#ccc}.ivu-slider-disabled .ivu-slider-button:hover{cursor:not-allowed}.ivu-slider-disabled .ivu-slider-button-dragging,.ivu-slider-disabled .ivu-slider-button-dragging:hover{cursor:not-allowed}.ivu-slider-input .ivu-slider-wrap{width:auto;margin-right:100px}.ivu-slider-input .ivu-input-number{float:right;margin-top:-14px}.selectDropDown{width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader{line-height:normal}.ivu-cascader-rel{display:inline-block;width:100%;position:relative}.ivu-cascader .ivu-input{padding-right:24px;display:block;cursor:pointer}.ivu-cascader-disabled .ivu-input{cursor:not-allowed}.ivu-cascader-label{width:100%;height:100%;line-height:32px;padding:0 7px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;font-size:14px;position:absolute;left:0;top:0}.ivu-cascader-size-large .ivu-cascader-label{line-height:36px;font-size:14px}.ivu-cascader-size-small .ivu-cascader-label{line-height:26px}.ivu-cascader .ivu-cascader-arrow:nth-of-type(1){display:none;cursor:pointer}.ivu-cascader:hover .ivu-cascader-arrow:nth-of-type(1){display:inline-block}.ivu-cascader-show-clear:hover .ivu-cascader-arrow:nth-of-type(2){display:none}.ivu-cascader-arrow{position:absolute;top:50%;right:8px;line-height:1;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);font-size:14px;color:#808695;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-visible .ivu-cascader-arrow:nth-of-type(2){-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.ivu-cascader .ivu-select-dropdown{width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader .ivu-cascader-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cascader .ivu-cascader-menu-item:hover{background:#f3f3f3}.ivu-cascader .ivu-cascader-menu-item-focus{background:#f3f3f3}.ivu-cascader .ivu-cascader-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cascader .ivu-cascader-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cascader .ivu-cascader-menu-item-selected,.ivu-cascader .ivu-cascader-menu-item-selected:hover{color:#2d8cf0}.ivu-cascader .ivu-cascader-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cascader .ivu-cascader-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cascader .ivu-cascader-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cascader .ivu-cascader-large .ivu-cascader-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cascader .ivu-cascader-menu-item{white-space:normal}}.ivu-cascader .ivu-select-item span{color:#ed4014}.ivu-cascader-dropdown{padding:5px 0}.ivu-cascader-dropdown .ivu-select-dropdown-list{max-height:190px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto}.ivu-cascader-not-found-tip{padding:5px 0;text-align:center;color:#c5c8ce}.ivu-cascader-not-found-tip li:not([class^=ivu-]){list-style:none;margin-bottom:0}.ivu-cascader-not-found .ivu-select-dropdown{width:inherit}.ivu-cascader-menu{display:inline-block;min-width:100px;height:180px;margin:0;padding:5px 0!important;vertical-align:top;list-style:none;border-right:1px solid #e8eaec;overflow:auto}.ivu-cascader-menu:last-child{border-right-color:transparent;margin-right:-1px}.ivu-cascader-menu .ivu-cascader-menu-item{position:relative;padding-right:36px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-menu .ivu-cascader-menu-item i{font-size:12px;position:absolute;right:15px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-cascader-menu .ivu-cascader-menu-item-loading{margin-top:-6px}.ivu-cascader-menu .ivu-cascader-menu-item-active{background-color:#f3f3f3;color:#2d8cf0}.ivu-cascader-transfer{z-index:1060;width:auto;padding:0;white-space:nowrap;overflow:visible}.ivu-cascader-transfer .ivu-cascader-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cascader-transfer .ivu-cascader-menu-item:hover{background:#f3f3f3}.ivu-cascader-transfer .ivu-cascader-menu-item-focus{background:#f3f3f3}.ivu-cascader-transfer .ivu-cascader-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cascader-transfer .ivu-cascader-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cascader-transfer .ivu-cascader-menu-item-selected,.ivu-cascader-transfer .ivu-cascader-menu-item-selected:hover{color:#2d8cf0}.ivu-cascader-transfer .ivu-cascader-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cascader-transfer .ivu-cascader-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cascader-transfer .ivu-cascader-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cascader-transfer .ivu-cascader-large .ivu-cascader-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cascader-transfer .ivu-cascader-menu-item{white-space:normal}}.ivu-cascader-transfer .ivu-select-item span{color:#ed4014}.ivu-cascader-transfer .ivu-cascader-menu-item{padding-right:24px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-cascader-transfer .ivu-cascader-menu-item-active{background-color:#f3f3f3;color:#2d8cf0}.ivu-form-item-error .ivu-cascader-arrow{color:#ed4014}.ivu-transfer{position:relative;line-height:1.5}.ivu-transfer-list{display:inline-block;width:180px;height:210px;font-size:14px;vertical-align:middle;position:relative;padding-top:35px}.ivu-transfer-list-with-footer{padding-bottom:35px}.ivu-transfer-list-header{padding:8px 16px;background:#f9fafc;color:#515a6e;border:1px solid #dcdee2;border-bottom:1px solid #e8eaec;border-radius:6px 6px 0 0;overflow:hidden;position:absolute;top:0;left:0;width:100%}.ivu-transfer-list-header-title{cursor:pointer}.ivu-transfer-list-header>span{padding-left:4px}.ivu-transfer-list-header-count{margin:0!important;float:right}.ivu-transfer-list-body{height:100%;border:1px solid #dcdee2;border-top:none;border-radius:0 0 6px 6px;position:relative;overflow:hidden}.ivu-transfer-list-body-with-search{padding-top:34px}.ivu-transfer-list-body-with-footer{border-radius:0}.ivu-transfer-list-content{height:100%;padding:4px 0;overflow:auto}.ivu-transfer-list-content-item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ivu-transfer-list-content-item>span{padding-left:4px}.ivu-transfer-list-content-not-found{display:none;text-align:center;color:#c5c8ce}li.ivu-transfer-list-content-not-found:only-child{display:block}.ivu-transfer-list-body-with-search .ivu-transfer-list-content{padding:6px 0 0}.ivu-transfer-list-body-search-wrapper{padding:8px 8px 0;position:absolute;top:0;left:0;right:0}.ivu-transfer-list-search{position:relative}.ivu-transfer-list-footer{border:1px solid #dcdee2;border-top:none;border-radius:0 0 6px 6px;position:absolute;bottom:0;left:0;right:0;zoom:1}.ivu-transfer-list-footer:after,.ivu-transfer-list-footer:before{content:\"\";display:table}.ivu-transfer-list-footer:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-transfer-operation{display:inline-block;margin:0 16px;vertical-align:middle}.ivu-transfer-operation .ivu-btn{display:block;min-width:24px}.ivu-transfer-operation .ivu-btn:first-child{margin-bottom:12px}.ivu-transfer-operation .ivu-btn span i,.ivu-transfer-operation .ivu-btn span span{vertical-align:middle}.ivu-transfer-list-content-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-transfer-list-content-item:hover{background:#f3f3f3}.ivu-transfer-list-content-item-focus{background:#f3f3f3}.ivu-transfer-list-content-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-transfer-list-content-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-transfer-list-content-item-selected,.ivu-transfer-list-content-item-selected:hover{color:#2d8cf0}.ivu-transfer-list-content-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-transfer-list-content-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-transfer-list-content-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-transfer-large .ivu-transfer-list-content-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-transfer-list-content-item{white-space:normal}}.ivu-table{width:inherit;height:100%;max-width:100%;overflow:hidden;color:#515a6e;font-size:14px;background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-table-wrapper{position:relative;overflow:hidden}.ivu-table-wrapper-with-border{border:1px solid #dcdee2;border-bottom:0;border-right:0}.ivu-table-summary{border-top:1px solid #e8eaec}.ivu-table-summary tr td{background-color:#f8f8f9}.ivu-table-with-summary .ivu-table-tbody tr:last-child td{border-bottom:none}.ivu-table-resize-line{position:absolute;top:0;left:0;bottom:0;width:1px;border-right:1px dashed #e8eaec}.ivu-table-hide{opacity:0}.ivu-table:before{content:'';width:100%;height:1px;position:absolute;left:0;bottom:0;background-color:#dcdee2;z-index:1}.ivu-table-border:after{content:'';width:1px;height:100%;position:absolute;top:0;right:0;background-color:#dcdee2;z-index:3}.ivu-table-footer,.ivu-table-title{height:48px;line-height:48px;border-bottom:1px solid #e8eaec}.ivu-table-footer{border-bottom:none}.ivu-table-header{overflow:hidden}.ivu-table-header thead tr th{position:relative;height:100%;padding:8px 0}.ivu-table-header-resizable{position:absolute;width:10px;height:100%;bottom:0;right:-5px;cursor:col-resize;z-index:1}.ivu-table-overflowX{overflow-x:scroll}.ivu-table-overflowY{overflow-y:scroll}.ivu-table-tip{overflow-x:auto;overflow-y:hidden}.ivu-table-with-fixed-top.ivu-table-with-footer .ivu-table-footer{border-top:1px solid #dcdee2}.ivu-table-with-fixed-top.ivu-table-with-footer tbody tr:last-child td{border-bottom:none}.ivu-table td,.ivu-table th{min-width:0;height:48px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:left;text-overflow:ellipsis;vertical-align:middle;border-bottom:1px solid #e8eaec}.ivu-table th{height:40px;white-space:nowrap;overflow:hidden;background-color:#f8f8f9}.ivu-table td{background-color:#fff;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}td.ivu-table-column-left,th.ivu-table-column-left{text-align:left}td.ivu-table-column-center,th.ivu-table-column-center{text-align:center}td.ivu-table-column-right,th.ivu-table-column-right{text-align:right}.ivu-table table{table-layout:fixed}.ivu-table-border td,.ivu-table-border th{border-right:1px solid #e8eaec}.ivu-table-cell{padding-left:18px;padding-right:18px;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-table-cell-ellipsis{word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ivu-table-cell-tooltip{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ivu-table-cell-tooltip-content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-table-cell-with-expand{height:47px;line-height:47px;padding:0;text-align:center}.ivu-table-cell-expand{cursor:pointer;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ivu-table-cell-expand i{font-size:14px}.ivu-table-cell-expand-expanded{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-table-cell-sort{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-table-cell-with-selection .ivu-checkbox-wrapper{margin-right:0}.ivu-table-hidden{visibility:hidden}th .ivu-table-cell{display:inline-block;word-wrap:normal;vertical-align:middle}td.ivu-table-expanded-cell{padding:20px 50px;background:#f8f8f9}.ivu-table-stripe .ivu-table-body tr:nth-child(2n) td,.ivu-table-stripe .ivu-table-fixed-body tr:nth-child(2n) td{background-color:#f8f8f9}.ivu-table-stripe .ivu-table-body tr.ivu-table-row-hover td,.ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-hover td{background-color:#ebf7ff}tr.ivu-table-row-hover td{background-color:#ebf7ff}.ivu-table-large{font-size:16px}.ivu-table-large th{height:48px}.ivu-table-large td{height:60px}.ivu-table-large-footer,.ivu-table-large-title{height:60px;line-height:60px}.ivu-table-large .ivu-table-cell-with-expand{height:59px;line-height:59px}.ivu-table-large .ivu-table-cell-with-expand i{font-size:16px}.ivu-table-small{font-size:12px}.ivu-table-small th{height:32px}.ivu-table-small td{height:40px}.ivu-table-small-footer,.ivu-table-small-title{height:40px;line-height:40px}.ivu-table-small .ivu-table-cell-with-expand{height:39px;line-height:39px}.ivu-table-row-highlight td,.ivu-table-stripe .ivu-table-body tr.ivu-table-row-highlight:nth-child(2n) td,.ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-highlight:nth-child(2n) td,tr.ivu-table-row-highlight.ivu-table-row-hover td{background-color:#ebf7ff}.ivu-table-fixed,.ivu-table-fixed-right{position:absolute;top:0;left:0;-webkit-box-shadow:2px 0 6px -2px rgba(0,0,0,.2);box-shadow:2px 0 6px -2px rgba(0,0,0,.2)}.ivu-table-fixed-right::before,.ivu-table-fixed::before{content:'';width:100%;height:1px;background-color:#dcdee2;position:absolute;left:0;bottom:0;z-index:4}.ivu-table-fixed-right{top:0;left:auto;right:0;-webkit-box-shadow:-2px 0 6px -2px rgba(0,0,0,.2);box-shadow:-2px 0 6px -2px rgba(0,0,0,.2)}.ivu-table-fixed-right-header{position:absolute;top:-1px;right:0;background-color:#f8f8f9;border-top:1px solid #dcdee2;border-bottom:1px solid #e8eaec}.ivu-table-fixed-header{overflow:hidden}.ivu-table-fixed-header thead tr th{position:relative;height:100%;padding:8px 0}.ivu-table-fixed-body{overflow:hidden;position:relative;z-index:3}.ivu-table-fixed-shadow{width:1px;height:100%;position:absolute;top:0;right:0;-webkit-box-shadow:1px 0 6px rgba(0,0,0,.2);box-shadow:1px 0 6px rgba(0,0,0,.2);overflow:hidden;z-index:1}.ivu-table-sort{display:inline-block;width:14px;height:12px;margin-top:-1px;vertical-align:middle;overflow:hidden;cursor:pointer;position:relative}.ivu-table-sort i{display:block;height:6px;line-height:6px;overflow:hidden;position:absolute;color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out;font-size:16px}.ivu-table-sort i:hover{color:inherit}.ivu-table-sort i.on{color:#2d8cf0}.ivu-table-sort i:first-child{top:0}.ivu-table-sort i:last-child{bottom:0}.ivu-table-filter{display:inline-block;cursor:pointer;position:relative}.ivu-table-filter i{color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-table-filter i:hover{color:inherit}.ivu-table-filter i.on{color:#2d8cf0}.ivu-table-filter-list{padding:8px 0 0}.ivu-table-filter-list-item{padding:0 12px 8px}.ivu-table-filter-list-item .ivu-checkbox-wrapper+.ivu-checkbox-wrapper{margin:0}.ivu-table-filter-list-item label{display:block}.ivu-table-filter-list-item label>span{margin-right:4px}.ivu-table-filter-list ul{padding-bottom:8px}.ivu-table-filter-list .ivu-table-filter-select-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-table-filter-list .ivu-table-filter-select-item:hover{background:#f3f3f3}.ivu-table-filter-list .ivu-table-filter-select-item-focus{background:#f3f3f3}.ivu-table-filter-list .ivu-table-filter-select-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-table-filter-list .ivu-table-filter-select-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-table-filter-list .ivu-table-filter-select-item-selected,.ivu-table-filter-list .ivu-table-filter-select-item-selected:hover{color:#2d8cf0}.ivu-table-filter-list .ivu-table-filter-select-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-table-filter-list .ivu-table-filter-select-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-table-filter-list .ivu-table-filter-select-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-table-filter-list .ivu-table-large .ivu-table-filter-select-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-table-filter-list .ivu-table-filter-select-item{white-space:normal}}.ivu-table-filter-footer{padding:4px;border-top:1px solid #e8eaec;overflow:hidden}.ivu-table-filter-footer button:first-child{float:left}.ivu-table-filter-footer button:last-child{float:right}.ivu-table-tip table{width:100%}.ivu-table-tip table td{text-align:center}.ivu-table-expanded-hidden{visibility:hidden}.ivu-table-popper{min-width:0;text-align:left}.ivu-table-popper .ivu-poptip-body{padding:0}.ivu-dropdown{display:inline-block}.ivu-dropdown .ivu-select-dropdown{overflow:visible;max-height:none}.ivu-dropdown .ivu-dropdown{width:100%}.ivu-dropdown-rel{position:relative}.ivu-dropdown-rel-user-select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-dropdown-menu{min-width:100px}.ivu-dropdown-transfer{width:auto}.ivu-dropdown-item-selected,.ivu-dropdown-item.ivu-dropdown-item-selected:hover{background:#f0faff}.ivu-dropdown-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-dropdown-item:hover{background:#f3f3f3}.ivu-dropdown-item-focus{background:#f3f3f3}.ivu-dropdown-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-dropdown-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-dropdown-item-selected,.ivu-dropdown-item-selected:hover{color:#2d8cf0}.ivu-dropdown-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-dropdown-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-dropdown-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-dropdown-large .ivu-dropdown-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-dropdown-item{white-space:normal}}.ivu-tabs{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;overflow:hidden;color:#515a6e;zoom:1}.ivu-tabs:after,.ivu-tabs:before{content:\"\";display:table}.ivu-tabs:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-tabs-bar{outline:0}.ivu-tabs-ink-bar{height:2px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#2d8cf0;position:absolute;left:0;bottom:1px;z-index:1;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}.ivu-tabs-bar{border-bottom:1px solid #dcdee2;margin-bottom:16px}.ivu-tabs-nav-container{margin-bottom:-1px;line-height:1.5;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;overflow:hidden;position:relative;zoom:1}.ivu-tabs-nav-container:after,.ivu-tabs-nav-container:before{content:\"\";display:table}.ivu-tabs-nav-container:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-tabs-nav-container:focus{outline:0}.ivu-tabs-nav-container:focus .ivu-tabs-tab-focused{border-color:#57a3f3!important}.ivu-tabs-nav-container-scrolling{padding-left:32px;padding-right:32px}.ivu-tabs-nav-wrap{overflow:hidden;margin-bottom:-1px}.ivu-tabs-nav-scroll{overflow:hidden;white-space:nowrap}.ivu-tabs-nav-right{float:right;margin-left:5px}.ivu-tabs-nav-next,.ivu-tabs-nav-prev{width:32px;text-align:center;position:absolute;line-height:32px;cursor:pointer}.ivu-tabs-nav-next i,.ivu-tabs-nav-prev i{font-size:16px}.ivu-tabs-nav-prev{left:0}.ivu-tabs-nav-next{right:0}.ivu-tabs-nav-scrollable{padding:0 32px}.ivu-tabs-nav-scroll-disabled{display:none}.ivu-tabs-nav{padding-left:0;margin:0;float:left;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out,-webkit-transform .5s ease-in-out}.ivu-tabs-nav:after,.ivu-tabs-nav:before{display:table;content:\" \"}.ivu-tabs-nav:after{clear:both}.ivu-tabs-nav .ivu-tabs-tab-disabled{pointer-events:none;cursor:default;color:#ccc}.ivu-tabs-nav .ivu-tabs-tab{display:inline-block;height:100%;padding:8px 16px;margin-right:16px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;text-decoration:none;position:relative;-webkit-transition:color .3s ease-in-out;transition:color .3s ease-in-out}.ivu-tabs-nav .ivu-tabs-tab:hover{color:#57a3f3}.ivu-tabs-nav .ivu-tabs-tab:active{color:#2b85e4}.ivu-tabs-nav .ivu-tabs-tab .ivu-icon{width:14px;height:14px;margin-right:8px}.ivu-tabs-nav .ivu-tabs-tab-active{color:#2d8cf0}.ivu-tabs-mini .ivu-tabs-nav-container{font-size:14px}.ivu-tabs-mini .ivu-tabs-tab{margin-right:0;padding:8px 16px;font-size:12px}.ivu-tabs .ivu-tabs-content-animated{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;will-change:transform;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.ivu-tabs .ivu-tabs-tabpane{-ms-flex-negative:0;flex-shrink:0;width:100%;-webkit-transition:opacity .3s;transition:opacity .3s;opacity:1;outline:0}.ivu-tabs .ivu-tabs-tabpane-inactive{opacity:0;height:0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-nav-container{height:32px}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-ink-bar{visibility:hidden}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab{margin:0;margin-right:4px;height:31px;padding:5px 16px 4px;border:1px solid #dcdee2;border-bottom:0;border-radius:4px 4px 0 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:#f8f8f9}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab-active{height:32px;padding-bottom:5px;background:#fff;-webkit-transform:translateZ(0);transform:translateZ(0);border-color:#dcdee2;color:#2d8cf0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-nav-wrap{margin-bottom:0}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab .ivu-tabs-close{width:0;height:22px;font-size:22px;margin-right:0;color:#999;text-align:right;vertical-align:middle;overflow:hidden;position:relative;top:-1px;-webkit-transform-origin:100% 50%;-ms-transform-origin:100% 50%;transform-origin:100% 50%;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab .ivu-tabs-close:hover{color:#444}.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab-active .ivu-tabs-close,.ivu-tabs.ivu-tabs-card>.ivu-tabs-bar .ivu-tabs-tab:hover .ivu-tabs-close{width:22px;-webkit-transform:translateZ(0);transform:translateZ(0);margin-right:-6px}.ivu-tabs-no-animation>.ivu-tabs-content{-webkit-transform:none!important;-ms-transform:none!important;transform:none!important}.ivu-tabs-no-animation>.ivu-tabs-content>.ivu-tabs-tabpane-inactive{display:none}.ivu-menu{display:block;margin:0;padding:0;outline:0;list-style:none;color:#515a6e;font-size:14px;position:relative;z-index:900}.ivu-menu-horizontal{height:60px;line-height:60px}.ivu-menu-horizontal.ivu-menu-light:after{content:'';display:block;width:100%;height:1px;background:#dcdee2;position:absolute;bottom:0;left:0}.ivu-menu-vertical.ivu-menu-light:after{content:'';display:block;width:1px;height:100%;background:#dcdee2;position:absolute;top:0;bottom:0;right:0;z-index:1}.ivu-menu-light{background:#fff}.ivu-menu-dark{background:#515a6e}.ivu-menu-primary{background:#2d8cf0}.ivu-menu-item{display:block;outline:0;list-style:none;font-size:14px;position:relative;z-index:1;cursor:pointer;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.ivu-menu-item{color:inherit}a.ivu-menu-item:active,a.ivu-menu-item:hover{color:inherit}.ivu-menu-item>i{margin-right:6px}.ivu-menu-submenu-title span>i,.ivu-menu-submenu-title>i{margin-right:8px}.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-horizontal .ivu-menu-submenu{float:left;padding:0 20px;position:relative;cursor:pointer;z-index:3;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu{height:inherit;line-height:inherit;border-bottom:2px solid transparent;color:#515a6e}.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item-active,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-item:hover,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu-active,.ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu:hover{color:#2d8cf0;border-bottom:2px solid #2d8cf0}.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu{color:rgba(255,255,255,.7)}.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item-active,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-item:hover,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu-active,.ivu-menu-dark.ivu-menu-horizontal .ivu-menu-submenu:hover{color:#fff}.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-item,.ivu-menu-primary.ivu-menu-horizontal .ivu-menu-submenu{color:#fff}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown{min-width:100%;width:auto;max-height:none}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{height:auto;line-height:normal;border-bottom:0;float:none}.ivu-menu-item-group{line-height:normal}.ivu-menu-item-group-title{height:30px;line-height:30px;padding-left:8px;font-size:12px;color:#999}.ivu-menu-item-group>ul{padding:0!important;list-style:none!important}.ivu-menu-vertical .ivu-menu-item,.ivu-menu-vertical .ivu-menu-submenu-title{padding:14px 24px;position:relative;cursor:pointer;z-index:1;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-menu-vertical .ivu-menu-item:hover,.ivu-menu-vertical .ivu-menu-submenu-title:hover{color:#2d8cf0}.ivu-menu-vertical .ivu-menu-submenu-title-icon{position:absolute;top:50%;right:24px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ivu-menu-submenu-title-icon{-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ivu-menu-horizontal .ivu-menu-opened>*>.ivu-menu-submenu-title-icon{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.ivu-menu-vertical .ivu-menu-opened>*>.ivu-menu-submenu-title-icon{-webkit-transform:translateY(-50%) rotate(180deg);-ms-transform:translateY(-50%) rotate(180deg);transform:translateY(-50%) rotate(180deg)}.ivu-menu-vertical .ivu-menu-submenu-nested{padding-left:20px}.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item{padding-left:43px}.ivu-menu-vertical .ivu-menu-item-group-title{height:48px;line-height:48px;font-size:14px;padding-left:28px}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-group-title{color:rgba(255,255,255,.36)}.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu){color:#2d8cf0;background:#f0faff;z-index:2}.ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):after{content:'';display:block;width:2px;position:absolute;top:0;bottom:0;right:0;background:#2d8cf0}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title{color:rgba(255,255,255,.7)}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):hover,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu):hover{background:#363e4f}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item:hover,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title:hover{color:#fff;background:#515a6e}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu),.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){color:#2d8cf0}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item:hover{color:#fff;background:0 0!important}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active,.ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active:hover{border-right:none;color:#fff;background:#2d8cf0!important}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-child-item-active>.ivu-menu-submenu-title{color:#fff}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened{background:#363e4f}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-title{background:#515a6e}.ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-has-parent-submenu .ivu-menu-submenu-title{background:0 0}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item:hover{background:#f3f3f3}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-focus{background:#f3f3f3}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-selected,.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-selected:hover{color:#2d8cf0}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-menu-large .ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{white-space:normal}}.ivu-menu-horizontal .ivu-menu-submenu .ivu-select-dropdown .ivu-menu-item{padding:7px 16px 8px;font-size:14px!important}.ivu-date-picker{display:inline-block;line-height:normal}.ivu-date-picker-rel{position:relative}.ivu-date-picker .ivu-select-dropdown{width:auto;padding:0;overflow:visible;max-height:none}.ivu-date-picker-cells{width:196px;margin:10px;white-space:normal}.ivu-date-picker-cells span{display:inline-block;width:24px;height:24px}.ivu-date-picker-cells span em{display:inline-block;width:24px;height:24px;line-height:24px;margin:2px;font-style:normal;border-radius:3px;text-align:center;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-date-picker-cells-header span{line-height:24px;text-align:center;margin:2px;color:#c5c8ce}.ivu-date-picker-cells-cell:hover em{background:#e1f0fe}.ivu-date-picker-cells-focused em{-webkit-box-shadow:0 0 0 1px #2d8cf0 inset;box-shadow:0 0 0 1px #2d8cf0 inset}span.ivu-date-picker-cells-cell{width:28px;height:28px;cursor:pointer}.ivu-date-picker-cells-cell-next-month em,.ivu-date-picker-cells-cell-prev-month em{color:#c5c8ce}.ivu-date-picker-cells-cell-next-month:hover em,.ivu-date-picker-cells-cell-prev-month:hover em{background:0 0}span.ivu-date-picker-cells-cell-disabled,span.ivu-date-picker-cells-cell-disabled:hover,span.ivu-date-picker-cells-cell-week-label,span.ivu-date-picker-cells-cell-week-label:hover{cursor:not-allowed;color:#c5c8ce}span.ivu-date-picker-cells-cell-disabled em,span.ivu-date-picker-cells-cell-disabled:hover em,span.ivu-date-picker-cells-cell-week-label em,span.ivu-date-picker-cells-cell-week-label:hover em{color:inherit;background:inherit}span.ivu-date-picker-cells-cell-disabled,span.ivu-date-picker-cells-cell-disabled:hover{background:#f7f7f7}.ivu-date-picker-cells-cell-today em{position:relative}.ivu-date-picker-cells-cell-today em:after{content:'';display:block;width:6px;height:6px;border-radius:50%;background:#2d8cf0;position:absolute;top:1px;right:1px}.ivu-date-picker-cells-cell-range{position:relative}.ivu-date-picker-cells-cell-range em{position:relative;z-index:1}.ivu-date-picker-cells-cell-range:before{content:'';display:block;background:#e1f0fe;border-radius:0;border:0;position:absolute;top:2px;bottom:2px;left:0;right:0}.ivu-date-picker-cells-cell-selected em,.ivu-date-picker-cells-cell-selected:hover em{background:#2d8cf0;color:#fff}span.ivu-date-picker-cells-cell-disabled.ivu-date-picker-cells-cell-selected em{background:#c5c8ce;color:#f7f7f7}.ivu-date-picker-cells-cell-today.ivu-date-picker-cells-cell-selected em:after{background:#fff}.ivu-date-picker-cells-show-week-numbers{width:226px}.ivu-date-picker-cells-month,.ivu-date-picker-cells-year{margin-top:14px}.ivu-date-picker-cells-month span,.ivu-date-picker-cells-year span{width:40px;height:28px;line-height:28px;margin:10px 12px;border-radius:3px}.ivu-date-picker-cells-month span em,.ivu-date-picker-cells-year span em{width:40px;height:28px;line-height:28px;margin:0}.ivu-date-picker-cells-month .ivu-date-picker-cells-cell-focused,.ivu-date-picker-cells-year .ivu-date-picker-cells-cell-focused{background-color:#d5e8fc}.ivu-date-picker-header{height:32px;line-height:32px;text-align:center;border-bottom:1px solid #e8eaec}.ivu-date-picker-header-label{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-date-picker-header-label:hover{color:#2d8cf0}.ivu-date-picker-btn-pulse{background-color:#d5e8fc!important;border-radius:4px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.ivu-date-picker-prev-btn{float:left}.ivu-date-picker-prev-btn-arrow-double{margin-left:10px}.ivu-date-picker-prev-btn-arrow-double i:after{content:\"\\F115\";margin-left:-8px}.ivu-date-picker-next-btn{float:right}.ivu-date-picker-next-btn-arrow-double{margin-right:10px}.ivu-date-picker-next-btn-arrow-double i:after{content:\"\\F11F\";margin-left:-8px}.ivu-date-picker-with-range .ivu-picker-panel-body{min-width:432px}.ivu-date-picker-with-range .ivu-picker-panel-content{float:left}.ivu-date-picker-with-range .ivu-picker-cells-show-week-numbers{min-width:492px}.ivu-date-picker-with-week-numbers .ivu-picker-panel-body-date{min-width:492px}.ivu-date-picker-transfer{z-index:1060;max-height:none;width:auto}.ivu-date-picker-focused input{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-picker-panel-icon-btn{display:inline-block;width:20px;height:24px;line-height:26px;margin-top:2px;text-align:center;cursor:pointer;color:#c5c8ce;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-picker-panel-icon-btn:hover{color:#2d8cf0}.ivu-picker-panel-icon-btn i{font-size:14px}.ivu-picker-panel-body-wrapper.ivu-picker-panel-with-sidebar{padding-left:92px}.ivu-picker-panel-sidebar{width:92px;float:left;margin-left:-92px;position:absolute;top:0;bottom:0;background:#f8f8f9;border-right:1px solid #e8eaec;border-radius:4px 0 0 4px;overflow:auto}.ivu-picker-panel-shortcut{padding:6px 16px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-picker-panel-shortcut:hover{background:#e8eaec}.ivu-picker-panel-body{float:left}.ivu-picker-confirm{border-top:1px solid #e8eaec;text-align:right;padding:8px;clear:both}.ivu-picker-confirm>span{color:#2d8cf0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;float:left;padding:2px 0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-picker-confirm>span:hover{color:#57a3f3}.ivu-picker-confirm>span:active{color:#2b85e4}.ivu-picker-confirm-time{float:left}.ivu-time-picker-cells{min-width:112px}.ivu-time-picker-cells-with-seconds{min-width:168px}.ivu-time-picker-cells-list{width:56px;max-height:144px;float:left;overflow:hidden;border-left:1px solid #e8eaec;position:relative}.ivu-time-picker-cells-list:hover{overflow-y:auto}.ivu-time-picker-cells-list:first-child{border-left:none;border-radius:4px 0 0 4px}.ivu-time-picker-cells-list:last-child{border-radius:0 4px 4px 0}.ivu-time-picker-cells-list ul{width:100%;margin:0;padding:0 0 120px 0;list-style:none}.ivu-time-picker-cells-list ul li{width:100%;height:24px;line-height:24px;margin:0;padding:0 0 0 16px;-webkit-box-sizing:content-box;box-sizing:content-box;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;list-style:none;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-time-picker-cells-cell:hover{background:#f3f3f3}.ivu-time-picker-cells-cell-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-time-picker-cells-cell-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-time-picker-cells-cell-selected,.ivu-time-picker-cells-cell-selected:hover{color:#2d8cf0;background:#f3f3f3}.ivu-time-picker-cells-cell-focused{background-color:#d5e8fc}.ivu-time-picker-header{height:32px;line-height:32px;text-align:center;border-bottom:1px solid #e8eaec}.ivu-time-picker-with-range .ivu-picker-panel-body{min-width:228px}.ivu-time-picker-with-range .ivu-picker-panel-content{float:left;position:relative}.ivu-time-picker-with-range .ivu-picker-panel-content:after{content:'';display:block;width:2px;position:absolute;top:31px;bottom:0;right:-2px;background:#e8eaec;z-index:1}.ivu-time-picker-with-range .ivu-picker-panel-content-right{float:right}.ivu-time-picker-with-range .ivu-picker-panel-content-right:after{right:auto;left:-2px}.ivu-time-picker-with-range .ivu-time-picker-cells-list:first-child{border-radius:0}.ivu-time-picker-with-range .ivu-time-picker-cells-list:last-child{border-radius:0}.ivu-time-picker-with-range.ivu-time-picker-with-seconds .ivu-picker-panel-body{min-width:340px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells{min-width:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds{min-width:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds .ivu-time-picker-cells-list{width:72px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-with-seconds .ivu-time-picker-cells-list ul li{padding:0 0 0 28px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list{width:108px;max-height:216px}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list:first-child{border-radius:0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list:last-child{border-radius:0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list ul{padding:0 0 192px 0}.ivu-picker-panel-content .ivu-picker-panel-content .ivu-time-picker-cells-list ul li{padding:0 0 0 46px}.ivu-form .ivu-form-item-label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#515a6e;line-height:1;padding:10px 12px 10px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.ivu-form-label-left .ivu-form-item-label{text-align:left}.ivu-form-label-top .ivu-form-item-label{float:none;display:inline-block;padding:0 0 10px 0}.ivu-form-inline .ivu-form-item{display:inline-block;margin-right:10px;vertical-align:top}.ivu-form-item{margin-bottom:24px;vertical-align:top;zoom:1}.ivu-form-item:after,.ivu-form-item:before{content:\"\";display:table}.ivu-form-item:after{clear:both;visibility:hidden;font-size:0;height:0}.ivu-form-item-content{position:relative;line-height:32px;font-size:14px}.ivu-form-item .ivu-form-item{margin-bottom:0}.ivu-form-item .ivu-form-item .ivu-form-item-content{margin-left:0!important}.ivu-form-item-error-tip{position:absolute;top:100%;left:0;line-height:1;padding-top:6px;color:#ed4014}.ivu-form-item-required .ivu-form-item-label:before{content:'*';display:inline-block;margin-right:4px;line-height:1;font-family:SimSun;font-size:14px;color:#ed4014}.ivu-form-hide-required-mark .ivu-form-item-required .ivu-form-item-label:before{display:none}.ivu-carousel{position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.ivu-carousel-list,.ivu-carousel-track{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.ivu-carousel-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.ivu-carousel-track{position:relative;top:0;left:0;display:block;overflow:hidden;z-index:1}.ivu-carousel-track.higher{z-index:2}.ivu-carousel-item{float:left;height:100%;min-height:1px;display:block}.ivu-carousel-arrow{border:none;outline:0;padding:0;margin:0;width:36px;height:36px;border-radius:50%;cursor:pointer;display:none;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.2s;transition:.2s;background-color:rgba(31,45,61,.11);color:#fff;text-align:center;font-size:1em;font-family:inherit;line-height:inherit}.ivu-carousel-arrow:hover{background-color:rgba(31,45,61,.5)}.ivu-carousel-arrow>*{vertical-align:baseline}.ivu-carousel-arrow.left{left:16px}.ivu-carousel-arrow.right{right:16px}.ivu-carousel-arrow-always{display:inherit}.ivu-carousel-arrow-hover{display:inherit;opacity:0}.ivu-carousel:hover .ivu-carousel-arrow-hover{opacity:1}.ivu-carousel-dots{z-index:10;display:none;position:relative;list-style:none;text-align:center;padding:0;width:100%;height:17px}.ivu-carousel-dots-inside{display:block;position:absolute;bottom:3px}.ivu-carousel-dots-outside{display:block;margin-top:3px}.ivu-carousel-dots li{position:relative;display:inline-block;vertical-align:top;text-align:center;margin:0 2px;padding:7px 0;cursor:pointer}.ivu-carousel-dots li button{border:0;cursor:pointer;background:#8391a5;opacity:.3;display:block;width:16px;height:3px;border-radius:1px;outline:0;font-size:0;color:transparent;-webkit-transition:all .5s;transition:all .5s}.ivu-carousel-dots li button.radius{width:6px;height:6px;border-radius:50%}.ivu-carousel-dots li:hover>button{opacity:.7}.ivu-carousel-dots li.ivu-carousel-active>button{opacity:1;width:24px}.ivu-carousel-dots li.ivu-carousel-active>button.radius{width:6px}.ivu-rate{display:inline-block;margin:0;padding:0;font-size:20px;vertical-align:middle;font-weight:400;font-style:normal}.ivu-rate-disabled .ivu-rate-star-content:before,.ivu-rate-disabled .ivu-rate-star:before{cursor:default}.ivu-rate-disabled .ivu-rate-star:hover{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.ivu-rate-star-full,.ivu-rate-star-zero{position:relative}.ivu-rate-star-first{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden;opacity:0}.ivu-rate-star-first,.ivu-rate-star-second{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s ease;transition:all .3s ease;color:#e9e9e9;cursor:pointer}.ivu-rate-star-chart{display:inline-block;margin:0;padding:0;margin-right:8px;position:relative;font-family:Ionicons;-webkit-transition:all .3s ease;transition:all .3s ease}.ivu-rate-star-chart:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.ivu-rate-star-chart.ivu-rate-star-full .ivu-rate-star-first,.ivu-rate-star-chart.ivu-rate-star-full .ivu-rate-star-second{color:#f5a623}.ivu-rate-star-chart.ivu-rate-star-half .ivu-rate-star-first{opacity:1;color:#f5a623}.ivu-rate-star{display:inline-block;margin:0;padding:0;margin-right:8px;position:relative;font-family:Ionicons;-webkit-transition:all .3s ease;transition:all .3s ease}.ivu-rate-star:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.ivu-rate-star-content:before,.ivu-rate-star:before{color:#e9e9e9;cursor:pointer;content:\"\\F2BF\";-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:block}.ivu-rate-star-content{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden}.ivu-rate-star-content:before{color:transparent}.ivu-rate-star-full:before,.ivu-rate-star-half .ivu-rate-star-content:before{color:#f5a623}.ivu-rate-star-full:hover:before,.ivu-rate-star-half:hover .ivu-rate-star-content:before{color:#f7b84f}.ivu-rate-text{margin-left:8px;vertical-align:middle;display:inline-block;font-size:14px}.ivu-upload input[type=file]{display:none}.ivu-upload-list{margin-top:8px}.ivu-upload-list-file{padding:4px;color:#515a6e;border-radius:4px;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out;overflow:hidden;position:relative}.ivu-upload-list-file>span{cursor:pointer;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-upload-list-file>span i{display:inline-block;width:12px;height:12px;color:#515a6e;text-align:center}.ivu-upload-list-file:hover{background:#f3f3f3}.ivu-upload-list-file:hover>span{color:#2d8cf0}.ivu-upload-list-file:hover>span i{color:#515a6e}.ivu-upload-list-file:hover .ivu-upload-list-remove{opacity:1}.ivu-upload-list-remove{opacity:0;font-size:18px;cursor:pointer;float:right;margin-right:4px;color:#999;-webkit-transition:all .2s ease;transition:all .2s ease}.ivu-upload-list-remove:hover{color:#444}.ivu-upload-select{display:inline-block}.ivu-upload-drag{background:#fff;border:1px dashed #dcdee2;border-radius:4px;text-align:center;cursor:pointer;position:relative;overflow:hidden;-webkit-transition:border-color .2s ease;transition:border-color .2s ease}.ivu-upload-drag:hover{border:1px dashed #2d8cf0}.ivu-upload-dragOver{border:2px dashed #2d8cf0}.ivu-tree ul{list-style:none;margin:0;padding:0;font-size:14px}.ivu-tree ul.ivu-dropdown-menu{padding:0}.ivu-tree ul li{list-style:none;margin:8px 0;padding:0;white-space:nowrap;outline:0}.ivu-tree ul li.ivu-dropdown-item{margin:0;padding:7px 16px;white-space:nowrap}.ivu-tree li ul{margin:0;padding:0 0 0 18px}.ivu-tree-title{display:inline-block;margin:0;padding:0 4px;border-radius:3px;cursor:pointer;vertical-align:top;color:#515a6e;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ivu-tree-title:hover{background-color:#eaf4fe}.ivu-tree-title-selected,.ivu-tree-title-selected:hover{background-color:#d5e8fc}.ivu-tree-arrow{cursor:pointer;width:12px;text-align:center;display:inline-block}.ivu-tree-arrow i{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;font-size:14px;vertical-align:middle}.ivu-tree-arrow-open i{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ivu-tree-arrow-disabled{cursor:not-allowed}.ivu-tree .ivu-checkbox-wrapper{margin-right:4px;margin-left:4px}.ivu-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:50%}.ivu-avatar-image{background:0 0}.ivu-avatar .ivu-icon{position:relative;top:-1px}.ivu-avatar>*{line-height:32px}.ivu-avatar.ivu-avatar-icon{font-size:18px}.ivu-avatar-large{width:40px;height:40px;line-height:40px;border-radius:50%}.ivu-avatar-large>*{line-height:40px}.ivu-avatar-large.ivu-avatar-icon{font-size:24px}.ivu-avatar-large .ivu-icon{position:relative;top:-2px}.ivu-avatar-small{width:24px;height:24px;line-height:24px;border-radius:50%}.ivu-avatar-small>*{line-height:24px}.ivu-avatar-small.ivu-avatar-icon{font-size:14px}.ivu-avatar-square{border-radius:4px}.ivu-avatar>img{width:100%;height:100%}.ivu-color-picker{display:inline-block}.ivu-color-picker-hide{display:none}.ivu-color-picker-hide-drop{visibility:hidden}.ivu-color-picker-disabled{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc}.ivu-color-picker-disabled:hover{border-color:#e3e5e8}.ivu-color-picker>div:first-child:hover .ivu-input{border-color:#57a3f3}.ivu-color-picker>div:first-child.ivu-color-picker-disabled:hover .ivu-input{border-color:#e3e5e8}.ivu-color-picker .ivu-select-dropdown{padding:0}.ivu-color-picker-input.ivu-input:focus{-webkit-box-shadow:none;box-shadow:none}.ivu-color-picker-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-rel{line-height:0}.ivu-color-picker-color{width:18px;height:18px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px;position:relative;top:2px}.ivu-color-picker-color div{width:100%;height:100%;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);border-radius:2px}.ivu-color-picker-color-empty{background:#fff;overflow:hidden;text-align:center}.ivu-color-picker-color-empty i{font-size:18px;vertical-align:baseline}.ivu-color-picker-color-focused{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-large .ivu-color-picker-color{width:20px;height:20px;top:1px}.ivu-color-picker-large .ivu-color-picker-color-empty i{font-size:20px}.ivu-color-picker-small .ivu-color-picker-color{width:14px;height:14px;top:3px}.ivu-color-picker-small .ivu-color-picker-color-empty i{font-size:14px}.ivu-color-picker-picker-wrapper{padding:8px 8px 0}.ivu-color-picker-picker-panel{width:240px;margin:0 auto;-webkit-box-sizing:initial;box-sizing:initial;position:relative}.ivu-color-picker-picker-alpha-slider,.ivu-color-picker-picker-hue-slider{height:10px;margin-top:8px;position:relative}.ivu-color-picker-picker-colors{margin-top:8px;overflow:hidden;border-radius:2px;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-picker-colors:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-picker-colors-wrapper{display:inline;width:20px;height:20px;float:left;position:relative}.ivu-color-picker-picker-colors-wrapper-color{outline:0;display:block;position:absolute;width:16px;height:16px;margin:2px;cursor:pointer;border-radius:2px;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.ivu-color-picker-picker-colors-wrapper-circle{width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);-ms-transform:translate(-2px,-2px);transform:translate(-2px,-2px);position:absolute;top:10px;left:10px;cursor:pointer}.ivu-color-picker-picker .ivu-picker-confirm{margin-top:8px}.ivu-color-picker-saturation-wrapper{width:100%;padding-bottom:75%;position:relative;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-saturation-wrapper:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-saturation,.ivu-color-picker-saturation--black,.ivu-color-picker-saturation--white{cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0}.ivu-color-picker-saturation--white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(rgba(255,255,255,0)));background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.ivu-color-picker-saturation--black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(rgba(0,0,0,0)));background:linear-gradient(to top,#000,rgba(0,0,0,0))}.ivu-color-picker-saturation-pointer{cursor:pointer;position:absolute}.ivu-color-picker-saturation-circle{width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);-ms-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.ivu-color-picker-hue{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-hue:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-hue-container{cursor:pointer;margin:0 2px;position:relative;height:100%}.ivu-color-picker-hue-pointer{z-index:2;position:absolute}.ivu-color-picker-hue-picker{cursor:pointer;margin-top:1px;width:4px;border-radius:1px;height:8px;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;-webkit-transform:translateX(-2px);-ms-transform:translateX(-2px);transform:translateX(-2px)}.ivu-color-picker-alpha{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ivu-color-picker-alpha:focus{border-color:#57a3f3;outline:0;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ivu-color-picker-alpha-checkboard-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;border-radius:2px}.ivu-color-picker-alpha-checkerboard{position:absolute;top:0;right:0;bottom:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.ivu-color-picker-alpha-gradient{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:2px}.ivu-color-picker-alpha-container{cursor:pointer;position:relative;z-index:2;height:100%;margin:0 3px}.ivu-color-picker-alpha-pointer{z-index:2;position:absolute}.ivu-color-picker-alpha-picker{cursor:pointer;width:4px;border-radius:1px;height:8px;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;margin-top:1px;-webkit-transform:translateX(-2px);-ms-transform:translateX(-2px);transform:translateX(-2px)}.ivu-color-picker-confirm{margin-top:8px;position:relative;border-top:1px solid #e8eaec;text-align:right;padding:8px;clear:both}.ivu-color-picker-confirm-color{position:absolute;top:11px;left:8px}.ivu-color-picker-confirm-color-editable{top:8px;right:110px}.ivu-auto-complete .ivu-select-not-found{display:none}.ivu-auto-complete .ivu-icon-ios-close{display:none}.ivu-auto-complete:hover .ivu-icon-ios-close{display:inline-block}.ivu-auto-complete.ivu-select-dropdown{max-height:none}.ivu-auto-complete div,.ivu-auto-complete:focus{outline:0}.ivu-divider{font-family:\"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;font-size:14px;line-height:1.5;color:#515a6e;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;background:#e8eaec}.ivu-divider,.ivu-divider-vertical{margin:0 8px;display:inline-block;height:.9em;width:1px;vertical-align:middle;position:relative;top:-.06em}.ivu-divider-horizontal{display:block;height:1px;width:100%;min-width:100%;margin:24px 0;clear:both}.ivu-divider-horizontal.ivu-divider-with-text-center,.ivu-divider-horizontal.ivu-divider-with-text-left,.ivu-divider-horizontal.ivu-divider-with-text-right{display:table;white-space:nowrap;text-align:center;background:0 0;font-weight:500;color:#17233d;font-size:16px;margin:16px 0}.ivu-divider-horizontal.ivu-divider-with-text-center:after,.ivu-divider-horizontal.ivu-divider-with-text-center:before,.ivu-divider-horizontal.ivu-divider-with-text-left:after,.ivu-divider-horizontal.ivu-divider-with-text-left:before,.ivu-divider-horizontal.ivu-divider-with-text-right:after,.ivu-divider-horizontal.ivu-divider-with-text-right:before{content:'';display:table-cell;position:relative;top:50%;width:50%;border-top:1px solid #e8eaec;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%)}.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-center,.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-left,.ivu-divider-horizontal.ivu-divider-small.ivu-divider-with-text-right{font-size:14px;margin:8px 0}.ivu-divider-horizontal.ivu-divider-with-text-left .ivu-divider-inner-text,.ivu-divider-horizontal.ivu-divider-with-text-right .ivu-divider-inner-text{display:inline-block;padding:0 10px}.ivu-divider-horizontal.ivu-divider-with-text-left:before{top:50%;width:5%}.ivu-divider-horizontal.ivu-divider-with-text-left:after{top:50%;width:95%}.ivu-divider-horizontal.ivu-divider-with-text-right:before{top:50%;width:95%}.ivu-divider-horizontal.ivu-divider-with-text-right:after{top:50%;width:5%}.ivu-divider-inner-text{display:inline-block;padding:0 24px}.ivu-divider-dashed{background:0 0;border-top:1px dashed #e8eaec}.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed{border-top:0}.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text-left.ivu-divider-dashed:before,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text-right.ivu-divider-dashed:before,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed:after,.ivu-divider-horizontal.ivu-divider-with-text.ivu-divider-dashed:before{border-style:dashed none none}.ivu-anchor{position:relative;padding-left:2px}.ivu-anchor-wrapper{overflow:auto;padding-left:4px;margin-left:-4px}.ivu-anchor-ink{position:absolute;height:100%;left:0;top:0}.ivu-anchor-ink:before{content:' ';position:relative;width:2px;height:100%;display:block;background-color:#e8eaec;margin:0 auto}.ivu-anchor-ink-ball{display:inline-block;position:absolute;width:8px;height:8px;border-radius:50%;border:2px solid #2d8cf0;background-color:#fff;left:50%;-webkit-transition:top .2s ease-in-out;transition:top .2s ease-in-out;-webkit-transform:translate(-50%,2px);-ms-transform:translate(-50%,2px);transform:translate(-50%,2px)}.ivu-anchor.fixed .ivu-anchor-ink .ivu-anchor-ink-ball{display:none}.ivu-anchor-link{padding:8px 0 8px 16px;line-height:1}.ivu-anchor-link-title{display:block;position:relative;-webkit-transition:all .3s;transition:all .3s;color:#515a6e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:8px}.ivu-anchor-link-title:only-child{margin-bottom:0}.ivu-anchor-link-active>.ivu-anchor-link-title{color:#2d8cf0}.ivu-anchor-link .ivu-anchor-link{padding-top:6px;padding-bottom:6px}.ivu-time-with-hash{cursor:pointer}.ivu-time-with-hash:hover{text-decoration:underline}.ivu-cell{position:relative;overflow:hidden}.ivu-cell-link,.ivu-cell-link:active,.ivu-cell-link:hover{color:inherit}.ivu-cell-icon{display:inline-block;margin-right:4px;font-size:14px;vertical-align:middle}.ivu-cell-icon:empty{display:none}.ivu-cell-main{display:inline-block;vertical-align:middle}.ivu-cell-title{line-height:24px;font-size:14px}.ivu-cell-label{line-height:1.2;font-size:12px;color:#808695}.ivu-cell-selected .ivu-cell-label{color:inherit}.ivu-cell-selected,.ivu-cell.ivu-cell-selected:hover{background:#f0faff}.ivu-cell-footer{display:inline-block;position:absolute;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%;right:16px;color:#515a6e}.ivu-cell-with-link .ivu-cell-footer{right:32px}.ivu-cell-selected .ivu-cell-footer{color:inherit}.ivu-cell-arrow{display:inline-block;position:absolute;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%;right:16px;font-size:14px}.ivu-cell:focus{background:#f3f3f3;outline:0}.ivu-cell-selected:focus{background:rgba(40,123,211,.91)}.ivu-cell{margin:0;line-height:normal;padding:7px 16px;clear:both;color:#515a6e;font-size:14px!important;white-space:nowrap;list-style:none;cursor:pointer;-webkit-transition:background .2s ease-in-out;transition:background .2s ease-in-out}.ivu-cell:hover{background:#f3f3f3}.ivu-cell-focus{background:#f3f3f3}.ivu-cell-disabled{color:#c5c8ce;cursor:not-allowed}.ivu-cell-disabled:hover{color:#c5c8ce;background-color:#fff;cursor:not-allowed}.ivu-cell-selected,.ivu-cell-selected:hover{color:#2d8cf0}.ivu-cell-divided{margin-top:5px;border-top:1px solid #e8eaec}.ivu-cell-divided:before{content:'';height:5px;display:block;margin:0 -16px;background-color:#fff;position:relative;top:-7px}.ivu-cell-enter{color:#2d8cf0;font-weight:700;float:right}.ivu-cell-large .ivu-cell{padding:7px 16px 8px;font-size:14px!important}@-moz-document url-prefix(){.ivu-cell{white-space:normal}}.ivu-drawer{width:auto;height:100%;position:fixed;top:0}.ivu-drawer-inner{position:absolute}.ivu-drawer-left{left:0}.ivu-drawer-right{right:0}.ivu-drawer-hidden{display:none!important}.ivu-drawer-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1000;-webkit-overflow-scrolling:touch;outline:0}.ivu-drawer-wrap-inner{position:absolute;overflow:hidden}.ivu-drawer-wrap-dragging{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ivu-drawer-wrap *{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.ivu-drawer-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1000}.ivu-drawer-mask-hidden{display:none}.ivu-drawer-mask-inner{position:absolute}.ivu-drawer-content{width:100%;height:100%;position:absolute;top:0;bottom:0;background-color:#fff;border:0;background-clip:padding-box;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15);box-shadow:0 4px 12px rgba(0,0,0,.15)}.ivu-drawer-content-no-mask{pointer-events:auto}.ivu-drawer-header{border-bottom:1px solid #e8eaec;padding:14px 16px;line-height:1}.ivu-drawer-header p,.ivu-drawer-header-inner{display:inline-block;width:100%;height:20px;line-height:20px;font-size:16px;color:#17233d;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ivu-drawer-close{z-index:1;font-size:12px;position:absolute;right:8px;top:8px;overflow:hidden;cursor:pointer}.ivu-drawer-close .ivu-icon-ios-close{font-size:31px;color:#999;-webkit-transition:color .2s ease;transition:color .2s ease;position:relative;top:1px}.ivu-drawer-close .ivu-icon-ios-close:hover{color:#444}.ivu-drawer-body{width:100%;height:calc(100% - 51px);padding:16px;font-size:14px;line-height:1.5;word-wrap:break-word;position:absolute;overflow:auto}.ivu-drawer-no-header .ivu-drawer-body{height:100%}.ivu-drawer-no-mask{pointer-events:none}.ivu-drawer-no-mask .ivu-drawer-drag{pointer-events:auto}.ivu-drawer-drag{top:0;height:100%;width:0;position:absolute}.ivu-drawer-drag-left{right:0}.ivu-drawer-drag-move-trigger{width:8px;height:100px;line-height:100px;position:absolute;top:50%;background:#f3f3f3;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border-radius:4px/6px;-webkit-box-shadow:0 0 1px 1px rgba(0,0,0,.2);box-shadow:0 0 1px 1px rgba(0,0,0,.2);cursor:col-resize}.ivu-drawer-drag-move-trigger-point{display:inline-block;width:50%;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%)}.ivu-drawer-drag-move-trigger-point i{display:block;border-bottom:1px solid silver;padding-bottom:2px}.ivu-breadcrumb{color:#999;font-size:14px}.ivu-breadcrumb a{color:#515a6e;-webkit-transition:color .2s ease-in-out;transition:color .2s ease-in-out}.ivu-breadcrumb a:hover{color:#57a3f3}.ivu-breadcrumb>span:last-child{font-weight:700;color:#515a6e}.ivu-breadcrumb>span:last-child .ivu-breadcrumb-item-separator{display:none}.ivu-breadcrumb-item-separator{margin:0 8px;color:#dcdee2}.ivu-breadcrumb-item-link>.ivu-icon+span{margin-left:4px}.ivu-list{position:relative}.ivu-list-items{margin:0;padding:0;list-style:none}.ivu-list-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 0}.ivu-list-item-content{color:#515a6e}.ivu-list-item-meta{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;font-size:0}.ivu-list-item-meta-avatar{margin-right:16px}.ivu-list-item-meta-content{-webkit-box-flex:1;-ms-flex:1 0;flex:1 0}.ivu-list-item-meta-title{font-weight:500;margin-bottom:4px;color:#515a6e;font-size:14px;line-height:22px}.ivu-list-item-meta-title>a{color:#515a6e;-webkit-transition:all .2s;transition:all .2s}.ivu-list-item-meta-title>a:hover{color:#2d8cf0}.ivu-list-item-meta-description{color:rgba(0,0,0,.45);font-size:14px;line-height:22px}.ivu-list-item-action{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;margin-left:48px;padding:0;font-size:0;list-style:none}.ivu-list-item-action>li{position:relative;display:inline-block;padding:0 8px;color:rgba(0,0,0,.45);font-size:14px;line-height:22px;text-align:center;cursor:pointer}.ivu-list-item-action>li:after{content:'';position:absolute;top:50%;right:0;width:1px;height:14px;margin-top:-7px;background-color:#e8eaec}.ivu-list-item-action>li:first-child{padding-left:0}.ivu-list-item-action>li:last-child:after{display:none}.ivu-list-header{background:0 0}.ivu-list-footer{background:0 0}.ivu-list-footer,.ivu-list-header{padding-top:12px;padding-bottom:12px}.ivu-list-split .ivu-list-item{border-bottom:1px solid #e8eaec}.ivu-list-split .ivu-list-item:last-child{border-bottom:none}.ivu-list-split .ivu-list-header{border-bottom:1px solid #e8eaec}.ivu-list-split .ivu-list-footer{border-top:1px solid #e8eaec}.ivu-list-large .ivu-list-item{padding-top:16px;padding-bottom:16px}.ivu-list-small .ivu-list-item{padding-top:8px;padding-bottom:8px}.ivu-list-vertical .ivu-list-item{-webkit-box-align:initial;-ms-flex-align:initial;align-items:initial}.ivu-list-vertical .ivu-list-item-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1}.ivu-list-vertical .ivu-list-item-extra{margin-left:40px}.ivu-list-vertical .ivu-list-item-meta{margin-bottom:16px}.ivu-list-vertical .ivu-list-item-meta-title{margin-bottom:12px;color:rgba(0,0,0,.85);font-size:16px;line-height:24px}.ivu-list-vertical .ivu-list-item-action{margin-top:16px;margin-left:auto}.ivu-list-vertical .ivu-list-item-action>li{padding:0 16px}.ivu-list-vertical .ivu-list-item-action>li:first-child{padding-left:0}.ivu-list-item-no-flex{display:block}.ivu-list:not(.ivu-list-vertical) .ivu-list-item-no-flex .ivu-list-item-action{float:right}.ivu-list-bordered{border:1px solid #dcdee2;border-radius:6px}.ivu-list-bordered .ivu-list-header{padding-right:24px;padding-left:24px}.ivu-list-bordered .ivu-list-footer{padding-right:24px;padding-left:24px}.ivu-list-bordered .ivu-list-item{padding-right:24px;padding-left:24px;border-bottom:1px solid #e8eaec}.ivu-list-bordered .ivu-list-pagination{margin:16px 24px}.ivu-list-bordered.ivu-list-small .ivu-list-item{padding-right:16px;padding-left:16px}.ivu-list-bordered.ivu-list-small .ivu-list-footer,.ivu-list-bordered.ivu-list-small .ivu-list-header{padding:8px 16px}.ivu-list-bordered.ivu-list-large .ivu-list-footer,.ivu-list-bordered.ivu-list-large .ivu-list-header{padding:16px 24px}@media screen and (max-width:768px){.ivu-list-item-action{margin-left:24px}.ivu-list-vertical .ivu-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ivu-list-item{-ms-flex-wrap:wrap;flex-wrap:wrap}.ivu-list-item-action{margin-left:12px}.ivu-list-vertical .ivu-list-item{-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse}.ivu-list-vertical .ivu-list-item-main{min-width:220px}.ivu-list-vertical .ivu-list-item-extra{margin:auto auto 16px}}"
  },
  {
    "path": "api-test-v4/styles/main.css",
    "content": "html, body {\n  height: 100%;\n  margin: 0;\n  overflow: hidden;\n  padding: 10px; }\n\n.rong-box {\n  height: 100%;\n  overflow: auto; }\n\nh1 {\n  margin-bottom: 20px; }\n\n.rong-hidden {\n  display: none; }\n\n.rong-show {\n  display: block; }\n\n.rong-login .rong-input-form .rong-login-input-item {\n  max-width: 678px; }\n.rong-login .rong-input-form .rong-input-appkey, .rong-login .rong-input-form .rong-input-targetId {\n  max-width: 140px; }\n.rong-login .rong-connect-btn-box {\n  margin-left: 80px; }\n  .rong-login .rong-connect-btn-box button {\n    margin-right: 10px; }\n\n.rong-login-formitem .rong-prompt {\n  display: none;\n  font-size: 13px;\n  margin-left: 10px;\n  color: #484848; }\n\n.rong-login-formitem:hover .rong-prompt {\n  display: inline; }\n\n.rong-user-title {\n  background: #f5f5f5;\n  margin-bottom: 15px; }\n  .rong-user-title h4 {\n    padding: 15px 3px;\n    display: inline-block;\n    margin-right: 13px; }\n\n.rong-global-opt {\n  margin-bottom: 10px; }\n\n.rong-api-list {\n  position: absolute;\n  right: 50px;\n  width: 120px;\n  top: 30px; }\n  .rong-api-list button {\n    margin: 5px 0; }\n\n.rong-api-btn {\n  display: inline-block;\n  margin: 5px; }\n\n.rong-opt-list .rong-ready-box {\n  margin: 5px 0;\n  min-height: 40px; }\n\n.rong-api-btn-box {\n  position: relative; }\n  .rong-api-btn-box .rong-api-btn-set {\n    display: none; }\n  .rong-api-btn-box .rong-api-btn-run {\n    background-color: #2db7f5;\n    color: #fff; }\n  .rong-api-btn-box .rong-api-btn-config {\n    background-color: #47cb89;\n    color: #fff; }\n\n.rong-api-btn-box:active {\n  background-color: #fff;\n  border-color: #dcdee2;\n  color: #515a6e; }\n\n.rong-drag .rong-api-btn-box .rong-api-btn-set {\n  display: none; }\n.rong-drag .rong-api-btn-box .rong-api-btn-name {\n  z-index: 10; }\n\n.rong-tip-params {\n  padding-left: 20px; }\n\n.rong-current-output {\n  color: black;\n  overflow: auto; }\n\n.rong-out-list {\n  position: fixed;\n  right: 15px;\n  width: 200px;\n  top: 20px;\n  bottom: 25px;\n  overflow-y: auto;\n  overflow-x: auto; }\n  .rong-out-list .rong-out-item {\n    overflow-x: auto; }\n    .rong-out-list .rong-out-item p {\n      text-overflow: ellipsis;\n      white-space: nowrap; }\n\n.rong-parse-json-btn {\n  margin-top: 5px; }\n\n.rong-out-list-head {\n  margin-bottom: 7px; }\n\n.rong-json-content {\n  overflow: auto; }\n\n.rong-api-set-item .rong-api-set-name {\n  font-size: 12px; }\n\n.ivu-collapse > .rong-out-panel {\n  color: #19be6b; }\n  .ivu-collapse > .rong-out-panel .ivu-collapse-header {\n    color: inherit; }\n  .ivu-collapse > .rong-out-panel .rong-out-title {\n    position: absolute;\n    left: 35px;\n    right: 0;\n    height: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap; }\n\n.rong-api-btn-link {\n  color: #ff9900; }\n\n.rong-prompt-box button {\n  margin: 5px 2px;\n  font-size: 12px; }\n.rong-prompt-box p {\n  white-space: pre-wrap;\n  word-break: break-all; }\n\n.ivu-tooltip-popper {\n  z-index: 500 !important; }\n\n.rong-out-btn-list {\n  margin: 5px 0; }\n\n.rong-run-sel-prompt {\n  margin: 20px 0 0 5px; }\n\n.rong-api-prompt {\n  font-size: 12px;\n  color: #ff9900;\n  margin: -10px 0 10px 0; }\n\n.rong-out-list-display {\n  display: inline-block; }\n\n.rong-user-title h4 {\n  display: block; }\n\n.get-source {\n  display: none;\n  text-decoration: none;\n  background: #000;\n  color: #fff;\n  padding: 0.6rem 1.3rem;\n  border-radius: 5px;\n  z-index: 10;\n  font-size: 0.8rem;\n  position: relative;\n  margin-left: 1.4rem;\n  position: relative;\n  top: -0.2rem; }\n\n.get-source:hover {\n  color: #e9e9e9; }\n\n@media (min-width: 780px) {\n  .rong-opt-list {\n    padding-right: 300px; }\n\n  .rong-out-list {\n    width: 300px; }\n\n  .rong-user-title h4 {\n    display: inline-block; }\n\n  .rong-out-list-display {\n    display: none; }\n\n  .rong-out-list-content {\n    display: block !important; }\n\n  .get-source {\n    display: inline-block; } }\n.rong-run-info {\n  position: absolute;\n  left: 400px;\n  top: 12px;\n  color: red; }\n\n.rong-msg-expansion {\n  position: absolute;\n  width: 300px;\n  background: #f7f7f7;\n  box-shadow: 1px 1px 5px #00000069;\n  z-index: 100;\n  left: 40%;\n  border-radius: 2px;\n  padding-bottom: 10px; }\n  .rong-msg-expansion .rong-ex-title {\n    text-align: center; }\n  .rong-msg-expansion .rong-ex-input {\n    padding: 10px; }\n  .rong-msg-expansion .rong-expansion-content {\n    height: 450px;\n    overflow: auto;\n    padding: 10px; }\n  .rong-msg-expansion .rong-ex-join {\n    text-align: center;\n    width: 100%; }\n  .rong-msg-expansion .rong-ex-opt {\n    text-align: left;\n    width: 100%;\n    padding: 10px; }\n\n/*# sourceMappingURL=main.css.map */\n"
  },
  {
    "path": "api-test-v4/styles/main.scss",
    "content": "@charset \"utf-8\";\n// sass-lint:disable nesting-depth\nhtml, body {\n  height: 100%;\n  margin: 0;\n  overflow: hidden;\n  padding: 10px;\n}\n.rong-box {\n  height: 100%;\n  overflow: auto;\n}\nh1 {\n  margin-bottom: 20px;\n}\n\n.rong-hidden {\n  display: none;\n}\n\n.rong-show {\n  display: block;\n}\n\n\n.rong-login {\n  .rong-input-form {\n    .rong-login-input-item {\n      // width: 50%;\n      max-width: 678px;\n    }\n    .rong-input-appkey, .rong-input-targetId {\n      // width: 10%;\n      max-width: 140px;\n    }\n  }\n  .rong-connect-btn-box {\n    margin-left: 80px;\n    button {\n      margin-right: 10px;\n    }\n  }\n}\n\n.rong-login-formitem {\n  .rong-prompt {\n    display: none;\n    font-size: 13px;\n    margin-left: 10px;\n    color: rgb(72, 72, 72);\n  }\n}\n.rong-login-formitem:hover {\n  .rong-prompt {\n    display: inline;\n  }\n}\n\n.rong-user-title {\n  background: #f5f5f5;\n  margin-bottom: 15px;\n  h4 {\n    padding: 15px 3px;\n    display: inline-block;\n    margin-right: 13px;\n  }\n  // button {\n  //   margin-left: 13px;\n  // }\n}\n\n.rong-global-opt {\n  margin-bottom: 10px;\n}\n.rong-api-list {\n  position: absolute;\n  right: 50px;\n  width: 120px;\n  top: 30px;\n  button {\n    margin: 5px 0;\n  }\n}\n.rong-api-btn {\n  display: inline-block;\n  margin: 5px;\n}\n\n.rong-opt-list {\n  .rong-ready-box {\n    margin: 5px 0;\n    min-height: 40px;\n  }\n  // .rong-api-btn:active {\n  //   .ivu-tooltip-popper {\n  //     display: none;\n  //   }\n  // }\n}\n.rong-api-btn-box {\n  position: relative;\n  .rong-api-btn-set {\n    display: none;\n  }\n  .rong-api-btn-run {\n    background-color: #2db7f5;\n    color: #fff;\n  }\n  .rong-api-btn-config {\n    background-color: #47cb89;\n    color: #fff;\n  }\n  // .rong-api-btn-doc {\n  //   background-color: #47cb89;\n  //   color: #fff;\n  // }\n}\n\n.rong-api-btn-box:active {\n  background-color: #fff;\n  border-color: #dcdee2;\n  color: #515a6e;\n}\n// .rong-api-btn-box:hover {\n//   .rong-api-btn-name {\n//     position: relative;\n//     z-index: -1;\n//   }\n//   .rong-api-btn-set {\n//     position: absolute;\n//     left: 0;\n//     top: 0;\n//     height: 100%;\n//     width: 100%;\n//     display: inline-block;\n//     border: none;\n//     padding: none;\n//     font-size: 12px;\n//     z-index: 100;\n//     button {\n//       width: 50%;\n//       height: 100%;\n//       border: none;\n//       cursor: pointer;\n//     }\n//   }\n// }\n\n.rong-drag .rong-api-btn-box {\n  .rong-api-btn-set {\n    display: none;\n  }\n  .rong-api-btn-name {\n    z-index: 10;\n  }\n}\n\n.rong-tip-params {\n  padding-left: 20px;\n}\n\n.rong-current-output {\n  color: black;\n  overflow: auto;\n}\n\n.rong-out-list {\n  position: fixed;\n  right: 15px;\n  width: 200px;\n  top: 20px;\n  bottom: 25px;\n  overflow-y: auto;\n  overflow-x: auto;\n  .rong-out-item {\n    overflow-x: auto;\n    p {\n      text-overflow:ellipsis;\n      white-space:nowrap;\n    }\n  }\n}\n\n.rong-parse-json-btn {\n  margin-top: 5px;\n}\n\n.rong-out-list-head {\n  margin-bottom: 7px;\n}\n.rong-json-content {\n  overflow: auto;\n}\n\n.rong-api-set-item {\n  .rong-api-set-name {\n    font-size: 12px;\n  }\n}\n.ivu-collapse>.rong-out-panel {\n  color: #19be6b;\n  .ivu-collapse-header {\n    color: inherit;\n  }\n  .rong-out-title {\n    position: absolute;\n    left: 35px;\n    right: 0;\n    height: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n}\n\n.rong-api-btn-link {\n  color: #ff9900;\n}\n\n.rong-prompt-box {\n  button {\n    margin: 5px 2px;\n    font-size: 12px;\n  }\n  p {\n    white-space: pre-wrap;\n    word-break: break-all;\n  }\n}\n\n.ivu-tooltip-popper {\n  z-index: 500 !important;\n}\n\n.rong-out-btn-list {\n  margin: 5px 0;\n}\n\n.rong-run-sel-prompt {\n  margin: 20px 0 0 5px;\n}\n\n.rong-api-prompt {\n  font-size: 12px;\n  color: #ff9900;\n  margin: -10px 0 10px 0;\n}\n\n.rong-out-list-display {\n  display: inline-block;\n}\n\n.rong-user-title h4 {\n  display: block;\n}\n\n.get-source {\n  display: none;\n  text-decoration: none;\n  background: #000;\n  color: #fff;\n  padding: 0.6rem 1.3rem;\n  border-radius: 5px;\n  z-index: 10;\n  font-size: 0.8rem;\n  position: relative;\n  margin-left: 1.4rem;\n  position: relative;\n  top: -0.2rem;\n}\n.get-source:hover {\n  color: rgb(233, 233, 233);\n}\n\n@media (min-width: 780px) {\n  .rong-opt-list {\n    padding-right: 300px;\n  }\n  .rong-out-list {\n    width: 300px;\n  }\n  .rong-user-title h4 {\n    display: inline-block;\n  }\n  .rong-out-list-display {\n    display: none;\n  }\n  .rong-out-list-content {\n    display: block !important;\n  }\n  .get-source {\n    display: inline-block;\n  }\n}\n\n.rong-run-info {\n  position: absolute;\n  left: 400px;\n  top: 12px;\n  color: red;\n}\n\n.rong-msg-expansion {\n  position: absolute;\n  width: 300px;\n  background: #f7f7f7;\n  box-shadow: 1px 1px 5px #00000069;\n  z-index: 100;\n  left: 40%;\n  border-radius: 2px;\n  padding-bottom: 10px;\n  .rong-ex-title {\n    text-align: center;\n  }\n  .rong-ex-input {\n    padding: 10px;\n  }\n  .rong-expansion-content {\n    height: 450px;\n    overflow: auto;\n    padding: 10px\n  }\n  .rong-ex-join {\n    text-align: center;\n    width: 100%;\n  }\n  .rong-ex-opt {\n    text-align: left;\n    width: 100%;\n    padding: 10px;\n  }\n}"
  },
  {
    "path": "api-test.html",
    "content": "\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>WebSDK API test</title>\n</head>\n<body>\n\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/api-test.html\" class=\"get-source\">获取源码</a>\n\n<style>\n\tbody{\n\t\tfont-size:14px;\n\t\tline-height:2;\n\t\tcolor:#333;\n\t}\n\th1,h2,h3{\n\t\tmargin:0;\n\t}\n\t.panel span{\n\t\tdisplay:inline-block;\t\n\t\twidth:60px;\n\t}\n\t.show{\n\t\tdisplay:none;\n\t\tfont-size:12px;\n\t\tborder:1px solid #ccc;\n\t\tbackground:#fff;\n\t\tpadding:10px 30px;\n\t\twidth:300px;\n\t\toverflow:auto;\n\t\tposition:fixed;\n\t\tright:10px;\n\t\ttop:0;\n\t\tbottom:10px;\n\t}\n\t.btns{\n\t\tdisplay:none;\n\t}\n\t.btns input,\n\t.btns a{\n\t\tfont-size:12px;\n\t\tmargin:20px 10px 0 10px;\n\t}\t\n\t.result{\n\t\tdisplay:none;\n\t\tbackground:#f5f5f5;\n\t\tmargin-top:30px;\n\t\twidth:730px;\n\t\tpadding:5px;\n\t\toverflow:hidden;\n\t}\n\t.result h2{\n\t\tfont-size:14px;\n\t\tmargin:0;\n\t\tpadding:0;\n\t}\n\t.result btn{\n\t\tmargin:5px;\n\t\tpadding:0;\n\t\tcolor:#cd0000;\n\t}\n\t.result-code{\n\t\tfloat:right;\n\t\tmargin:0 5px 5px 0;\n\t\tcolor:#fff;\n\t\tbackground:#000;\n\t\tborder:none;\n\t}\n\t#result-body{\n\t\tposition: relative;\n\t}\n\t.code-copy{\n\t\tposition:absolute;\n\t\tright:5px;\n\t\ttop:5px;\n\t}\n\t.title {\n\t\tbackground:#f5f5f5;\n\t\tpadding-left:1em;\n\t\tpadding-bottom:1em;\n\t}\n\t.title h2{\n\t\tdisplay: inline;\n\t\tfont-size:14px;\n\t\tmargin-right:0.5em;\n\t}\n</style>\n\n\n<!-- \ncheck.js是做一些环境监测用的临时代码，仅限开发调试使用\n-->\n<!-- <script src=\"js/pre-check.js\"></script> -->\n\n<!-- \nhttp://www.ghostchina.com/adding-syntax-highlighting-to-ghost-using-highlight-js/\n-->\n<link href=\"res/monokai_sublime.min.css\" rel=\"stylesheet\">  \n<script src=\"res/highlight.min.js\"></script> \n\n<script type=\"text/javascript\" src=\"lib/jquery-3.1.1.js\"></script>\n<link rel=\"stylesheet\" href=\"json-view/jsonview.css\" />\n<script type=\"text/javascript\" src=\"json-view/jquery.jsonview.js\"></script>\n\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script src=\"//cdn.ronghub.com/RongEmoji-2.2.4.min.js\"></script> \n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n\n<!-- 声音样本文件 -->\n<script src=\"res/voice-amr-base64.json\"></script>\n\n<!-- 二次封装的初始化代码 -->\n<script src=\"init.js\"></script>\n\n<script>\n\"use strict\";\nfunction showTips(data){\n\tvar dom = document.getElementById(\"show\");\n\t\tdom.style.display = \"block\";\n\tif(data){\n\t\tdom.innerHTML += \"<li>\" + data + \"</li>\";\n\t}else{\n\t\tdom.innerHTML = \"\";\n\t}\n}\t\nfunction showResult(title,code,start){\n\tvar dom = document.getElementById(\"result-area\");\n\t\tdom.style.display = \"block\";\n\n\tvar now = new Date().getTime();\n\tvar t = document.getElementById(\"result-title\");\n\t\tt.innerHTML = title + '  <small>执行时间：'  + (now - start) + 'ms</small>';\n\t\n\tjsonOprators(code);\n}\n\nfunction jsonOprators(json){\n\tvar jt = $('#result-body');\n\n\tif(typeof json == 'function'){\n\t\tjt.html('<pre class=\"jsonview\"><code id=\"result-code\">' + json + '</code></pre>');\n\t\t$('pre > code').each(function(i, block) {\n\t\t\thljs.highlightBlock(block);\n\t\t});\n\t}else{\n\t\tjson = JSON.stringify(json);\n\t\tjt.JSONView(json);\n\t}\n\n\t$('#collapse-btn').on('click', function() {\n\t\tjt.JSONView('collapse');\n\t});\n\n\t$('#expand-btn').on('click', function() {\n\t\tjt.JSONView('expand');\n\t});\n\n\t$('#toggle-btn').on('click', function() {\n\t\tjt.JSONView('toggle');\n\t});\n\n\t$('#toggle-level1-btn').on('click', function() {\n\t\tjt.JSONView('toggle', 1);\n\t});\n\n\t$('#toggle-level2-btn').on('click', function() {\n\t\tjt.JSONView('toggle', 2);\n\t});\n}\n\n\nfunction getTimer(begin){\n\tvar now = new Date().getTime();\n\treturn \" time:\" + (now - begin) + \" ms\";\n}\n</script>\n\n<!-- \n用户数据，群组数据，好友关系 必须有应用服务器提供\n显示会话信息需要从融云和应用服务器共同获取数据才能完整显示\n\n\n\n开发环境 \n\t默认appkey = 8w7jv4qb78a9y，已上线\n\t当前用户：user8\n\t对象用户：user9,user10 \n\n生产环境\n\t82hegw5uh8ktx\n\trybznHwVbrk7upeAMWv8RnHEDKuqy0jJayFPsQ4gP8z+SyAuRRg4uk2hA24NDcnvbl6oswAYXQCdpAbHm4pp9g==\n-->\n<script>\n\"use strict\";\nvar instance = null;\nvar appKey = \"\";\nvar token = \"\";\n\nvar userId = \"\";\n\n/*\n消息全部用单聊，user8 -> user9\n*/\nvar conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n /*\n PRIVATE \t\t\t\t1\t\t单聊\n DISCUSSION \t\t\t2\t\t讨论组\n GROUP \t\t\t\t\t3\t\t群组\n CHATROOM \t\t\t\t4\t\t聊天室\n CUSTOMER_SERVICE \t\t5\t\t客服\n SYSTEM \t\t\t\t6\t\t系统消息\n APP_PUBLIC_SERVICE \t7\t\t应用公众账号（应用内私有）\n PUBLIC_SERVICE \t\t8\t\t公众账号 (公有)\n */\n\nvar targetId = \"user9\"; \nvar targetId2 = \"user10\";\nvar targetIds = [];\n//消息接收方 Id，根据不同的 ConversationType，可能是用户 Id、讨论组 Id、群组 Id、聊天室 Id等。\n\nvar begin = 0;\n\nfunction startInit(token){\n\tappKey = document.getElementById(\"appkey\").value;\n\n\tif(appKey == \"\"){\n\t\talert(\"必须提供appkey和token\");\n\t}\n\n\tshowTips();\n\n\tbegin = new Date().getTime()\n\n\t//公有云初始化\n\tvar config = {\n\t\t//protobuf: 'https://cdn.ronghub.com/protobuf-2.3.6.min.js' //支持http(s)网络路径、本地相对路径\t\n  };\n\n    /*\n\n\t\t----------\n\t\t备注： 桌面版需优先开通，开通后方可使用\n\t\t\t\t\t开通方式，请移步开发者后台提工单，申请开通 https://developer.rongcloud.cn/signin?returnUrl=%2F\n\t\t----------\n\n\t\tRongDesktop 即为 electron-c++sdk/js/preload.js 中的 `RongDesktop`\n\t\t以下逻辑为 RongDesktop 存在即认为在 Electron 中，请一定保证 RongDesktop 唯一、不可破坏、不被污染\n\t\t详细请参考 init.js dataProvider 用法\n    */\n    var imClient = null;\n\tvar isDesktopEnv = (typeof RongDesktop != 'undefined')\n\tif (isDesktopEnv) {\n\t\timClient = RongDesktop.require('IMLib');\n\t\t// document.getElementById(\"rong-discussion\").style.display = 'none';\n\t\t// document.getElementById(\"rong-public-service\").style.display = 'none';\n\t\t// document.getElementById(\"rong-home-page\").style.display = 'block';\n\t}\n\n\tvar params = {\n\t\tappKey : appKey,\n\t\ttoken : token,\n\t\timClient: imClient,\n\t\tuserId: 'user10'\n\t};\n\n\tvar callbacks = {\n\t\tgetInstance : function(_instance){\n\t\t\tinstance = _instance;\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t\t// 判断消息类型\n\t\t    showTips(\"新消息，类型为：\" + message.messageType);\n            // showResult(\"新消息\",message,start);\n\n            console.log(\"messageUId:\" + message.messageUId + \",   messageId:\" + message.messageId);\n            console.log(message);\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\tshowTips(\"链接成功 用户id：\" + userInfo.userId + \", 耗时\" + getTimer(begin));\n\t\t\tuserId = userInfo.userId;\n\t\t\tdocument.getElementById(\"login\").innerHTML = userId;\n\t\t    afterConnected();\n\t\t}\n\t};\n\tinit(params,callbacks,config);\n\tshowTips(\"初始化 应用 \" + getTimer(begin));\n\n\n\tRongIMLib.RongIMEmoji.init();\n\tshowTips(\"初始化 表情库 \" + getTimer(begin));\n\n\n\tRongIMLib.RongIMVoice.init();\n\tshowTips(\"初始化 声音库 \" + getTimer(begin));\n}\n\nfunction login(){\n\ttoken = document.getElementById(\"token\").value;\n\n\tif(token == \"\"){\n\t\talert(\"必须提供 token\");\n\t}\n\n\ttargetIds = document.getElementById(\"targetId\").value;\n\tif(targetIds == \"\"){\n\t\talert(\"必须提供两个的有效targetId\");\n\t}\n\n\ttargetIds = targetIds.split(\"，\").join(\",\").split(\",\");\n\ttargetId = targetIds[0];\t\n\ttargetId2 = targetIds[1];\n\n\tstartInit(token);\t\n}\n\nfunction changeUser(){\n\tinstance.logout();\n\tvar token = document.getElementById(\"token2\").value;\n\n\tif(token == \"\"){\n\t\talert(\"必须提供 token\");\n\t}\n\tstartInit(token);\n}\n\nfunction afterConnected(){\n\tdocument.getElementById(\"panel\").style.display = \"none\";\n\tdocument.getElementById(\"btns\").style.display = \"block\";\n}\n\nfunction disconnect(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/api/js/RongIMClient.html\n\t*/\n\n\tvar start = new Date().getTime();\n\tinstance.disconnect();\n\tshowResult(\"断开链接 成功\", null , start);\n}\n\nfunction reconnect(){\n\t/*\n\t1: reconnect 是重新连接，并没有重连机制，调用此方法前应该进行网络嗅探，网络正常再调用 reconnect。\n\t2: 提示其他设备登录请勿调用重连方法。\n \t3: docs   http://www.rongcloud.cn/docs/api/js/RongIMClient.html\n\t*/\n\n \tvar start = new Date().getTime();\n\tbegin = new Date().getTime();\n\tRongIMClient.reconnect({\n\t\tonSuccess: function(userId) {\n\t\t\tshowTips(\"重新链接成功，用户id：\" + userId + \"; \" + getTimer(begin));\n\t\t\tshowResult(\"重新链接 成功\", userId, start);\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\t//console.log('token无效');\n\t\t\tshowResult(\"重新链接 失败\", \"token无效\", start);\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  var info = '';\n\t\t  switch (errorCode) {\n\t\t    case RongIMLib.ErrorCode.TIMEOUT:\n\t\t      info = '超时';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n\t\t      info = '未知错误';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNACCEPTABLE_PROTOCOL_VERSION:\n\t\t      info = '不可接受的协议版本';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n\t\t      info = 'appkey不正确';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n\t\t      info = '服务器不可用';\n\t\t      break;\n\t\t  }\n\t\t  showTips(info);\n\t\t  showResult(\"重新链接 失败\", info, start);\n\t\t}\n\t});\n}\n\n//消息撤回变量及设置\nvar recallMessage = null, clearMessage;\nfunction markMessage(message){\n\trecallMessage = message;\n\tclearMessage = message;\n}\n\nfunction sendTextMessage(){\n\t/*\n\t文档： http://www.rongcloud.cn/docs/web.html#5_1、发送消息\n\t\t   http://rongcloud.cn/docs/api/js/TextMessage.html\n\t1: 单条消息整体不得大于128K\n\t2: conversatinType 类型是 number，targetId 类型是 string\n\t*/\n\n\t/*\n\t\t1、不要多端登陆，保证所有端都离线\n\t\t2、接收 push 设备设置:\n\t\t\t（1）打开系统通知提醒\n\t\t\t（2）小米设置 “授权管理” －> “自己的应用” 为自启动\n\t\t\t（3）应用内不要屏蔽新消息通知\n\t\t3、内置消息类型，默认 push，自定义消息类型需要\n\t\t   pushData 显示逻辑顺序：自定义 > 默认\n\t\t4、发送其他消息类型与发送 TextMessage 逻辑、方式一致\n\t*/\n\tvar pushData = \"pushData\" + Date.now();\n\n\tvar isMentioned = false;\n\n\tvar content = {\n\t\tcontent: [\n\t\t\t\"阿拉伯语：الشرق الأوسط \",\n\t\t\t\"希伯来语：המזרח התיכון\",\n\t\t\t\"emoji: 😊 \",\n\t\t\t\"希腊字母： π，α，β, \",\n\t\t\t\"数字单位部分字符 如：× \",\n\t\t\t\"拉丁文所有字符 如：Ο Ρ σ Ï Æ \",\n\t\t\t\"拼音所有字符 如： ě ì ň \",\n\t\t\t\"英文音标部分字符 如 ： ə ʃ \",\n\t\t\t\"俄文部分字符 如 ：ш ; ⊇ â Œ Š ™ \"\n\t\t].join(\",\"),\n\t\tuser : {\n\t\t\t\"id\" : \"this-is-a-test-id\",\t//不支持中文及特殊字符\n\t\t\t\"name\" : \"张三\",\n\t\t\t\"portrait\" : \"https://avatars1.githubusercontent.com/u/10265829?s=96&v=4\"\n\t\t},\n\t\textra: \"{\\\"key\\\":\\\"value\\\", \\\"key2\\\" : 12, \\\"key3\\\":true}\"\n\t};\n\n\tvar msg = new RongIMLib.TextMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送文字消息 成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送文字消息 失败\",message,start);\n        }\n    }, isMentioned, pushData);\n}\n\nfunction sendImageMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/api/js/ImageMessage.html\n\n\t需自行解决文件上传\n\t上传插件（含获取缩略图方法）: https://github.com/rongcloud/rongcloud-web-im-upload\n\t\n\t缩略图必须是base64码的jpg图，而且不带前缀\"data:image/jpeg;base64,\"，不得超过100K\n\t压缩：https://github.com/rongcloud/rongcloud-web-im-upload/blob/master/resize.html\n\t*/\n\n\tvar content = {\n\t\timageUri: \"http://rongcloud.cn/images/newVersion/log_wx.png\", \n\t\tcontent: getBase64Image()\n\t};\n\n\tvar msg = new RongIMLib.ImageMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送图片消息 成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送图片消息 失败\",message,start);\n        }\n    });\t\n}\n\nfunction sendFileMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/api/js/ImageMessage.html\n\n\tupload组件：https://github.com/rongcloud/rongcloud-web-im-upload\n\t上传插件文档: http://rongcloud.cn/docs/web.html#上传插件\n\n\t单条消息整体不得大于128K\n\n\t文件消息分两步：\n\t\t1、上传文件至文件服务器\n\t\t2、发送文件信息和文件 URL\n\t*/\n\n\tvar content = {\n\t    name: 'log_wx', // 文件名称\n\t    size: '20k', // 文件大小，单位自己约定\n\t    type: 'png', // 文件的后缀名，例如 png、js、doc ...\n\t    fileUrl: 'http://rongcloud.cn/images/newVersion/log_wx.png' // 文件地址\n\t};\n\n\tvar msg = new RongIMLib.FileMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送文件消息成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送文件消息失败\",message,start);\n        }\n    });\t\n}\n\nfunction sendVoiceMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/api/js/VoiceMessage.html\n\n\t需自行解决录音和转码问题，要求编码为base64格式amr，不带前缀，不得超过100K\n\n\t声音播放：https://rongcloud.github.io/websdk-demo/voice.html\n\t*/\n\tvar content = {\n\t\tcontent : voice, //form res/voice-amr-base64.json\n\t\tduration : 20\n\t};\n\t\n\tvar msg = new RongIMLib.VoiceMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送语音消息成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送语音消息失败\",message,start);\n        }\n    });\n}\n\nfunction sendAtMessage(){\n    /*\n    @ 消息对象\n    全部：RongIMLib.MentionedType.ALL；\n    部分：RongIMLib.MentionedType.PART\n\t\n\t文档说明：http://support.rongcloud.cn/kb/NjE1\n    接收@代码：https://rongcloud.github.io/websdk-demo/connect-check.html\n    */\n    var mentioneds = new RongIMLib.MentionedInfo();\n\t    mentioneds.type = RongIMLib.MentionedType.PART;\n    \tmentioneds.userIdList = [targetId, targetId2];\n\n    var content = {\n    \tcontent: \"This is a at message!\",\n    \textra: \"extra info\",\n    \tmentionedInfo: mentioneds\n    };\n\tvar msg = new RongIMLib.TextMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n\t\tonSuccess: function (message) {\n\t\t   //message 为发送的消息对象并且包含服务器返回的消息唯一Id和发送消息时间戳\n            showResult(\"发送 @ 消息成功\",message,start);\n\t\t},\n\t\tonError: function (errorCode,message) {\n            showResult(\"发送 @ 消息失败\",message,start);\n        }\n\t}, true);\n}\n\nfunction registerMessage(type,propertys){\n\tvar messageName = type; // 消息名称。\n\tvar objectName = \"s:\" + type; // 消息内置名称，请按照此格式命名 *:* 。\n\tvar mesasgeTag = new RongIMLib.MessageTag(true,true); //true true 保存且计数，false false 不保存不计数。\n\n\tRongIMClient.registerMessageType(messageName,objectName,mesasgeTag,propertys);\n}\nfunction sendRegisterMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/web_api_demo.html#自定义消息\n\n\t注意事项：\n\t\t1：init之前注册新消息类型\n\t\t2：对应接收 onReceived: function (message) {}\n\t\t\tmessage.messageType == \"PersonMessage\"\n\t\t3：需要自己做解析实现\n\t*/\n\tvar propertys = [\"name\",\"age\",\"gender\"]; // 消息类中的属性名。\n\tregisterMessage(\"PersonMessage\",propertys);\n\n\tvar content = {\n\t\tname: {\n\t\t\t\"first\" : \"Bob\",\n\t\t\t\"last\" : \"Smith\"\n\t\t},\n\t\tage: 3,\n\t\tgender: \"male\"\n\t};\n\n\tvar msg = new RongIMClient.RegisterMessage.PersonMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送自定义消息成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送自定义消息失败\",message,start);\n        }\n    });\n}\n\nfunction sendLocationMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/api/js/LocationMessage.html\n\n\t缩略图必须是base64码的jpg图，而且不带前缀\"data:image/jpeg;base64,\"，不得超过100K\n\n\t需要自己做显示效果，一般显示逻辑：图片加链接，传入经纬度并跳转进入地图网站\n\t*/\n\n\tvar content = {\n\t\t\"content\":getBase64Image(),\n\t\t\"latitude\":\"24.114\",\n\t\t\"longitude\":\"334.221\",\n\t\t\"poi\":\"北京市朝阳区北苑路北辰泰岳大厦\"\n\t};\n\n\tvar msg = new RongIMLib.LocationMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送自定义消息成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送自定义消息失败\",message,start);\n        }\n    });\n}\n\nfunction sendRichContentMessage(){\n\t/*\n\thttp://www.rongcloud.cn/docs/api/js/RichContentMessage.html\n\t*/ \n\n\tvar content = {\n\t\t\"title\": \"sendRichContentMessage\",\n\t\t\"content\": \"<a href=\\\"http://www.rongcloud.cn\\\">hello</a>\",\n\t\t\"imageUri\": \"http://www.demo.com/1.jpg\",\n\t\t\"url\": \"http://www.rongcloud.cn/\",\n\t\t\"extra\": \"{\\\"key\\\":\\\"value\\\"}\"\n\t};\n\n\tvar msg = new RongIMLib.RichContentMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送图文消息成功\", message, start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送图文消息失败\", message, start);\n        }\n    });\n}\n\nfunction SendSyncReadStatusMessage(){\n\t/*\n\t一端发送，其他端接受并做同步更新\n\t具体处理说明文档： http://support.rongcloud.cn/kb/NjE0\n\t*/ \n\tvar sentTime = 1486975569605;// message 的 sentTime 服务器端时间\n\tvar content = {\n\t\tlastMessageSendTime: sentTime\n\t};\n\tvar msg = new RongIMLib.SyncReadStatusMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, targetId, msg, {\n        onSuccess: function (message) {\n            showResult(\"发送同步消息成功\", message, start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送同步消息失败\", message, start);\n        }\n    });\t\n}\n\nfunction sendRecallMessage(){\n\tif(recallMessage == null){\n\t\talert(\"请先发送任意一条消息会再执行撤回\");\n\t\treturn;\n\t}\n\t//消息撤回服务器端没有时间限制，由客户端决定\n\n\tvar start = new Date().getTime();\n\tinstance.sendRecallMessage(recallMessage, {\n        onSuccess: function (message) {\n            showResult(\"撤回成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"撤回失败\",message,start);\n        }\n    });\t\t\n}\n\nfunction checkUnreadMessage(){\n\t/*\n\thttp://www.rongcloud.cn/docs/web.html#5_5、检测是否有未读的消息\n\n\t此接口必须在init()方法之后调用，但不依赖于connect\n\t只返回true/false，不返回具体的未读数量\n\t若连接成功后调用此方法将一直返回 false。\n\t*/\n\t\n\tvar start = new Date().getTime();\n\tinstance.hasRemoteUnreadMessages(token,{\n\t    onSuccess:function(hasMessage){\n\t        if(hasMessage){\n\t            // 有未读的消息\n\t        }else{\n\t            // 没有未读的消息\n\t        }\n\n            showResult(\"检查未读消息成功\",hasMessage,start);\n\n\t    },onError:function(err){\n            showResult(\"检查未读消息失败\",err,start);\n\t    }\n\t});\n}\n\nfunction getHistroyMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/web_api_demo.html#获取历史消息\n\n\t注意事项：\n\t\t1：一定一定一定要先开通 历史消息云存储 功能，本服务收费，测试环境可免费开通\n\t\t2：登录开发者后台可以直接开启 https://developer.rongcloud.cn/app\n\t\t2：timestrap第二次拉取必须为null才能实现循环拉取\n\t*/\n\n\tvar count = 3;  // 2 <= count <= 20\n\tvar timestrap = null; //0, 1483950413013\n\n\tvar start = new Date().getTime();\n\tinstance.getHistoryMessages(conversationType, targetId, timestrap, count, {\n\t\tonSuccess: function(list, hasMsg) {\n\t\t\t//可通过sort订制其他顺序\n\t\t\tlist.sort(function(a,b){\n\t\t\t\treturn a.sentTime < b.sentTime;\n\t\t\t});\n\n            showResult(\"获取历史消息成功\",list,start);\n\t\t},\n\t\tonError: function(error) {\n            showResult(\"获取历史消息失败\",error,start);\n\t\t}\n\t});\n} \n\n\nfunction clearHistroyMessage(){\n\t/*\n\t\t文档：http://www.rongcloud.cn/docs/web_api_demo.html#会话接口\n\n\t\t注意事项：必须开通历史消息云存储\n\n\t\t参数说明：\n\t\ttimestamp 取值范围:  timestamp >=0 并且 timestamp <= 当前会话最后一条消息的 sentTime\n \t*/\n\tif (!clearMessage) {\n\t\talert('请先发一条消息');\n\t\treturn;\n\t}\n\tvar start = new Date().getTime();\n\tvar params = {\n\t\tconversationType: clearMessage.conversationType,\n\t\ttargetId: clearMessage.targetId,\n\t\ttimestamp: clearMessage.sentTime\n\t};\n\tinstance.clearRemoteHistoryMessages(params, {\n\t\tonSuccess: function() {\n            showResult(\"清除历史消息成功\", \"success\");\n\t\t},\n\t\tonError: function(error) {\n\t\t\tconsole.log('请排查： 历史消息云存储是否开通');\n            showResult(\"清除历史消息失败\",error);\n\t\t}\n\t});\n} \n\nfunction getConversationList(){\t\n\t/*\n\t文档：http://www.rongcloud.cn/docs/web_api_demo.html#会话接口\n\t\thttp://www.rongcloud.cn/docs/web.html#5_2、同步会话列表\n\t\thttp://www.rongcloud.cn/docs/api/js/Conversation.html\n\n\t历史消息云存储开通位置：https://developer.rongcloud.cn/service/roam/rXxI4IAJjxRAD72SpQ==\n\n\t注意事项：\n\t\t1：一定一定一定要先开通 历史消息云存储 功能，本服务收费，测试环境可免费开通\n\t\t2：只有发过消息才能生成会话\n\t*/\n\n\tvar conversationTypes = null;  //具体格式设置需要补充\n\tvar limit = 150; //获取会话的数量，不传或传null为全部，暂不支持分页\n\tvar start = new Date().getTime();\n\tinstance.getConversationList({\n\t\tonSuccess: function(list) {\n\t\t\t// list.sort(function(a,b){\n\t\t\t// \treturn a.sentTime > b.sentTime;\n\t\t\t// });\n\n\t\t\tvar title = \"成功获取 \" + list.length + \" 个会话\";\n            showResult(title,list,start);\n\t\t},\n\t\tonError: function(error) {\n            showResult(\"获取会话失败\",error,start);\n\t\t}\n    }, conversationTypes, limit);\n}\n\nfunction getConversation(){\n\t//需在 getConversationList 方法执行之后执行，否则返回null\n\tvar start = new Date().getTime();\n\n\tinstance.getConversation(conversationType, targetId, { \n\t\tonSuccess:function(result){ \n            showResult(\"获取群组会话 成功\", result, start);\n\t\t}, \n\t\tonError:function(error){ \n\t\t    showResult(\"获取群组会话 失败\", error, start);\n\t\t} \n\t});\n}\n\nfunction removeConversation(){\n\tvar start = new Date().getTime();\n\tinstance.removeConversation(conversationType, targetId, { \n\t\tonSuccess:function(result){ \n            showResult(\"删除会话成功\",result,start);\n\t\t}, \n\t\tonError:function(error){ \n\t\t// error => 清除会话错误码。 \n\t\t    showResult(\"删除会话失败\",error,start);\n\t\t} \n\t});\n}\n\nfunction clearConversation(){\n\tvar start = new Date().getTime();\n\tinstance.clearConversations({ \n\t\tonSuccess:function(){ \n            showResult(\"清除会话成功\",null,start);\n\t\t}, \n\t\tonError:function(error){ \n\t\t// error => 清除会话错误码。 \n\t\t    showResult(\"清除会话失败\",error,start);\n\t\t} \n\t});\n}\n\nfunction getUnreadCount(){\n\t/*\n\t\t阅读时间戳缓存在 localStorage 中，消息状态根据发送时间和阅读时间戳对比判断\n\t\t每次接受新消息后通过重新调用此方法计算\n\t */\n\tvar start = new Date().getTime();\n\tinstance.getUnreadCount(conversationType,targetId,{\n\t    onSuccess:function(count){\n\t       showResult(\"获取会话未读数成功\", count, start);\n\t    },\n\t    onError:function(error){\n\t       showResult(\"获取会话未读数失败\", error, start);\n\t    }\n\t});\n}\n\nfunction getTotalUnreadCount(){\n\t/*\n\t\t阅读时间戳缓存在 localStorage 中，消息状态根据发送时间和阅读时间戳对比判断\n\t\t每次接受新消息后通过重新调用此方法计算\n\t */\n\tvar start = new Date().getTime();\n\tinstance.getTotalUnreadCount({\n\t  onSuccess:function(count){\n\t       showResult(\"获取总未读数成功\", count, start);\n\t  },\n\t  onError:function(error){\n\t      showResult(\"获取总未读数失败\", error, start);\n\t  }\n\t});\n}\n\nfunction clearTotalUnreadCount(){\n\tvar start = Date.now();\n\tinstance.clearTotalUnreadCount({\n\t    onSuccess:function(){\n\t        showResult(\"清除未读总数成功\", \"success\", start);\n\t    },\n\t    onError:function(error){\n\t        showResult(\"清除未读总数失败\", error, start);\n\t    }\n\t});\n}\nfunction clearUnreadCount(){\n\t/*\n\t \t此方法清除当前端的未读数，并不会多端同步，\n\t \t多端同步需要发送 SyncReadStatusMessage：http://support.rongcloud.cn/kb/NjE0\n\t */\n\n\tvar start = Date.now();\n\tinstance.clearUnreadCount(conversationType,targetId,{\n\t    onSuccess:function(){\n\t        showResult(\"清除指定会话未读数成功\", \"success\", start);\n\t    },\n\t    onError:function(error){\n\t        showResult(\"清除指定会话未读数失败\", error, start);\n\t    }\n\t});\n}\n\n\nfunction receiveMessage(){\n\talert(\"请见init方法里的 RongIMClient.setOnReceiveMessageListener\")\n}\n\n\n//加入聊天室后，可以用任意一个发送消息的方法发送消息，只需要conversationType为CHATROOM\nvar chatRoomId = \"chatRoomId-008\"; // 聊天室 Id,可任意指定，能区分不同聊天室即可\nvar count = 10; //拉取最近的会话内容（最多50条），-1不拉取 \n\nfunction enterChatroom(){\n\t/*\n\thttp://www.rongcloud.cn/docs/web_api_demo.html#聊天室\n\n\t聊天室不支持通过 getHistoryMessages 方法获取历史消息，\n\n\tcount：//拉取最近的会话内容（最多50条），-1不拉取 \n\t*/\n\n\tvar start = new Date().getTime();\n\tinstance.joinChatRoom(chatRoomId, count, {\n\t\tonSuccess: function() {\n            showResult(\"加入聊天室成功\",null,start);\n\t\t},\n\t\tonError: function(error) {\n            showResult(\"加入聊天室失败\",null,start);\n\t\t}\n\t});\n}\n\nfunction quitChatroom(){\n\tvar start = new Date().getTime();\n\tinstance.quitChatRoom(chatRoomId, {\n\t\tonSuccess: function() {\n            showResult(\"退出聊天室成功\",null,start);\n\t\t},\n\t\tonError: function(error) {\n            showResult(\"退出聊天室失败\",null,start);\n\t\t}\n\t});\n}\n\nfunction getChatroomInfo(){\n\t/*\n\t需确认 当前用户 已加入聊天室\n\t*/ \n\tvar order = RongIMLib.GetChatRoomType.REVERSE;// 排序方式。\n\tvar memberCount = 10; // 获取聊天室人数 （范围 0-20 ）\n\n\tvar start = new Date().getTime();\n\tinstance.getChatRoomInfo(chatRoomId, memberCount, order, {\n\t  onSuccess: function(chatRoom) {\n\t\t\t// chatRoom => 聊天室信息。\n\t\t\t// chatRoom.userInfos => 返回聊天室成员。\n\t\t\t// chatRoom.userTotalNums => 当前聊天室总人数。\n            showResult(\"获取聊天室信息成功\",chatRoom,start);\n\t  },\n\t  onError: function(error) {\n            showResult(\"获取天室信息失败\",error);\n\t  }\n\t});\n}\n\nfunction sendMessageToChatroom(){\n\tvar content = {\n\t\tcontent:\"hello，time：\" + new Date().getTime(),\n\t\textra:\"RongCloud\"\n\t};\n\n\tvar conversationType = RongIMLib.ConversationType.CHATROOM; // 私聊\n\tvar msg = new RongIMLib.TextMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(conversationType, chatRoomId, msg, {\n        onSuccess: function (message) {\n            showResult(\"发送聊天室消息成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送聊天室消息失败\",message,start);\n        }\n    });\n}\n\n//发送题目\nfunction sendQAMessage(){\n\t/*\n\t文档：http://www.rongcloud.cn/docs/web_api_demo.html#自定义消息\n\n\t注意事项：\n\t\t1：init之前注册新消息类型\n\t\t2：对应接收 onReceived: function (message) {}\n\t\t\tmessage.messageType == \"PersonMessage\"\n\t\t3：需要自己做解析实现\n\t*/\n\tvar propertys = [\"title\",\"submitAPI\",\"questions\"]; // 消息类中的属性名。\n\tregisterMessage(\"QA\",propertys);\n\n\tvar questions = [\n\t\t{\n\t\t\tid: 8560,\n\t\t\tquestion : \"中国首都是那个城市？\",\n\t\t\tanswers : [{ id: 9901,answer: '上海', bingo: 9904},\n\t\t\t\t\t   { id: 9903,answer: '武汉', bingo: 9904 },\n\t\t\t\t\t   { id: 9904,answer: '北京', bingo: 9904 },\n\t\t\t\t\t   { id: 9905,answer: '深圳', bingo: 9904 }]\n\t\t},\n\t\t{\n\t\t\tid: 8561,\n\t\t\tquestion : \"世界上最大的岛是那个？\",\n\t\t\tanswers : [{ id: 9906,answer: '马达加斯加', bingo: 9909},\n\t\t\t\t\t   { id: 9907,answer: '海南', bingo: 9909 },\n\t\t\t\t\t   { id: 9908,answer: '台湾', bingo: 9909 },\n\t\t\t\t\t   { id: 9909,answer: '格陵兰', bingo: 9909 }]\n\t\t},\n\t\t{\n\t\t\tid: 8562,\n\t\t\tquestion : \"冰与火之歌里，那个家族的徽章是狼？\",\n\t\t\tanswers : [{ id: 9910,answer: '史塔克', bingo: 9910  },\n\t\t\t\t\t   { id: 9911,answer: '塔格利安', bingo: 9910 },\n\t\t\t\t\t   { id: 9912,answer: '兰尼斯特', bingo: 9910 }]\n\t\t},\n\t\t{\n\t\t\tid: 8563,\n\t\t\tquestion : \"地球上最大的哺乳动物是？\",\n\t\t\tanswers : [{ id: 9913,answer: '鲸鱼', bingo: 9913 },\n\t\t\t\t\t   { id: 9914,answer: '大象', bingo: 9913 },\n\t\t\t\t\t   { id: 9915,answer: '巨蟒', bingo: 9913 },\n\t\t\t\t\t   { id: 9916,answer: '恐龙', bingo: 9913 }]\n\t\t},\n\t\t{\n\t\t\tid: 8564,\n\t\t\tquestion : \"人们常说的花季是几岁？\",\n\t\t\tanswers : [{ id: 9917,answer: 15, bingo: 9920 },\n\t\t\t\t\t   { id: 9918,answer: 20, bingo: 9920 },\n\t\t\t\t\t   { id: 9919,answer: 18, bingo: 9920 },\n\t\t\t\t\t   { id: 9920,answer: 16, bingo: 9920 }]\n\t\t},\n\t\t{\n\t\t\tid: 8565,\n\t\t\tquestion : \"成龙、林志颖、郭德纲最年轻的是谁？\",\n\t\t\tanswers : [{ id: 9921,answer: '成龙' , bingo: 9921},\n\t\t\t\t\t   { id: 9922,answer: '林志颖', bingo: 9921 },\n\t\t\t\t\t   { id: 9923,answer: '郭德纲', bingo: 9921 }]\n\t\t},\n\t\t{\n\t\t\tid: 8565,\n\t\t\tquestion : \"劳动法规定，劳动者试用期不能超过几个月？\",\n\t\t\tanswers : [{ id: 9921,answer: 3 , bingo: 9921},\n\t\t\t\t\t   { id: 9922,answer: 6, bingo: 9921 },\n\t\t\t\t\t   { id: 9923,answer: 9, bingo: 9921 },\n\t\t\t\t\t   { id: 9924,answer: 12, bingo: 9921 }]\n\t\t},\n\t\t{\n\t\t\tid: 8566,\n\t\t\tquestion : \"融云成立几年了？\",\n\t\t\tanswers : [{ id: 9921,answer: 4 , bingo: 9921},\n\t\t\t\t\t   { id: 9922,answer: 5, bingo: 9921 },\n\t\t\t\t\t   { id: 9923,answer: 3, bingo: 9921 },\n\t\t\t\t\t   { id: 9924,answer: 2, bingo: 9921 }]\n\t\t},\n\t\t{\n\t\t\tid: 8567,\n\t\t\tquestion : \"变脸是我国哪个戏剧的绝活？\",\n\t\t\tanswers : [{ id: 9921,answer: '川剧' , bingo: 9921},\n\t\t\t\t\t   { id: 9922,answer: '京剧', bingo: 9921 },\n\t\t\t\t\t   { id: 9923,answer: '豫剧', bingo: 9921 },\n\t\t\t\t\t   { id: 9924,answer: '评剧', bingo: 9921 }]\n\t\t}\n\t];\n\n\tvar qIndex = Math.floor(Math.random()*5);\n\n\tvar content = {\n\t\ttitle: \"冲顶大会\",\n\t\tsubmitAPI: \"http://abc.com/check\",\n\t\tquestions: JSON.stringify([questions[qIndex]])\n\t};\n\n\tvar msg = new RongIMClient.RegisterMessage.QA(content);\n\n\tvar start = new Date().getTime();\n\tvar conversationType = RongIMLib.ConversationType.CHATROOM; // 私聊\n\tinstance.sendMessage(conversationType, chatRoomId, msg, {\n        onSuccess: function (message) {\n        \tmarkMessage(message);\n            showResult(\"发送题目 成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"发送题目 失败\",message,start);\n        }\n    });\n}\n\n\n/*\n公众号\nRongIMLib.ConversationType = {\n\tAPP_PUBLIC_SERVICE : \"应用服务平台 mc\",\n\tPUBLIC_SERVICE : \"公众服务平台 mp\"\n};\n*/\n\nvar publicServiceType = RongIMLib.ConversationType.APP_PUBLIC_SERVICE; //固定值\nvar publicServiceId = \"Rong_shuise\"; //RongCloud\nvar searchType = 1; //[0-exact 1-fuzzy]\nvar keywords = \"Rong\";\n// var keywords = \"test\";\n\n/*\n用户给公众号发消息\nvar conversationType = RongIMLib.ConversationType.PUBLIC_SERVICE;\nvar targetId = publicServiceId\n*/\n\nfunction sendToPublic(){\n\t/*\n\t文档： http://www.rongcloud.cn/docs/web.html#5_1、发送消息\n\t\t   http://rongcloud.cn/docs/api/js/TextMessage.html\n\t1: 单条消息整体不得大于128K\n\t2: conversatinType 类型是 number，targetId 类型是 string\n\t*/\n\n\tvar content = {\n\t\tcontent: \"公众号你好\"\n\t};\n\n\tvar msg = new RongIMLib.TextMessage(content);\n\n\tvar start = new Date().getTime();\n\tinstance.sendMessage(publicServiceType, publicServiceId, msg, {\n        onSuccess: function (message) {\n            showResult(\"公众号留言 成功\",message,start);\n        },\n        onError: function (errorCode,message) {\n            showResult(\"公众号留言 失败\",message,start);\n        }\n    });\n}\n\nfunction getPublicHistroyMessage(){\n\talert(\"暂不支持\");\n\n\t// var count = 10;  // 2 <= count <= 20\n\t// var timestrap = null; //0, 1483950413013\n\n\t// var start = new Date().getTime();\n\t// instance.getHistoryMessages(publicServiceType, publicServiceId, timestrap, count, {\n\t// \tonSuccess: function(list, hasMsg) {\n\t// \t},\n\t// \tonError: function(error) {\n\t// \t}\n\t// });\n} \n\nfunction getPublicServiceList(){\n\t/* \n\tgetRemotePublicServiceList = function (mpId, conversationType, pullMessageTime, callback)  \n\t*/ \n\tvar start = new Date().getTime();\n\n\tinstance.getPublicServiceList({\n\t    onSuccess:function(list){\n            showResult(\"获取已关注公众号 成功\",list,start);\n\t    },\n\t    onError:function(error){\n\t    \tshowResult(\"搜索获取已关注公众号公众号 失败\",error,start);\n\t    }\n\t});\n}\n\nfunction searchPublicService(){\n\t/*\n\tWebAPI文档：http://www.rongcloud.cn/docs/api/js/RongIMClient.html\n\tiOS文档：http://www.rongcloud.cn/docs/ios_imlib.html#公众服务\n\t*/ \n\tvar start = new Date().getTime();\n\n\tinstance.searchPublicService(searchType, keywords, {\n\t    onSuccess:function(list){\n            showResult(\"查找公众号 成功\",list,start);\n\t    },\n\t    onError:function(error){\n\t    \tshowResult(\"查找公众号 失败\",error,start);\n\t    }\n\t});\n}\n\n// function searchPublicServiceByType(){\n// \tvar start = new Date().getTime();\n\n// \tinstance.searchPublicServiceByType(publicServiceType, searchType, keywords, {\n// \t    onSuccess:function(list){\n//             showTips(\"搜索公众号by type 成功\");\n//             showResult(\"搜索公众号by type 成功\",list,start);\n// \t    },\n// \t    onError:function(error){\n// \t    \tshowTips(\"搜索公众号by type 失败\");\n// \t    \tshowResult(\"搜索公众号by type 失败\",error,start);\n// \t    }\n// \t});\n// }\n\nfunction subscribePublicService(){\n\t/*\n\thttp://www.rongcloud.cn/docs/api/js/RongIMClient.html\n\n\t*/\n\tvar start = new Date().getTime();\n\n\tinstance.subscribePublicService(publicServiceType, publicServiceId, {\n\t    onSuccess:function(list){\n            showResult(\"订阅公众号 成功\",list,start);\n\t    },\n\t    onError:function(error){\n\t    \tshowResult(\"订阅公众号 失败\",error,start);\n\t    }\n\t});\n}\n\nfunction unsubscribePublicService(){\n\t/*\n\thttp://www.rongcloud.cn/docs/api/js/RongIMClient.html\n\t\n\t*/\n\tvar start = new Date().getTime();\n\n\tinstance.unsubscribePublicService(publicServiceType, publicServiceId, {\n\t    onSuccess:function(list){\n            showResult(\"取消订阅公众号 成功\",list,start);\n\t    },\n\t    onError:function(error){\n\t    \tshowResult(\"取消订阅公众号 失败\",error,start);\n\t    }\n\t});\n}\n\nfunction getPublicServiceProfile(){\n\t/*\n\thttp://www.rongcloud.cn/docs/api/js/RongIMClient.html\n\n\t必须是已经关注的公众号，才能获取到详情\n\t*/\n\tvar start = new Date().getTime();\n\n\tinstance.getPublicServiceProfile(publicServiceType, publicServiceId, {\n\t\tonSuccess:function(profile){\n            showResult(\"获取公众号详情 成功\",profile,start);\n\t\t}, \n\t  \tonError:function(){\n\t  \t\tcosnole.log(\"获取公众号详情 error\");\n\t  \t}\n\t});\n}\n\n//获取base64假数据方法\nfunction getBase64Image(){\n\tvar canvas = document.createElement(\"canvas\");\n\t\tcanvas.width = 100;\n\t\tcanvas.height = 100;\n\n\n\tvar context = canvas.getContext(\"2d\");\t\n\t\tcontext.font = \"20pt Arial\";    \t\t\t\n\t\tcontext.fillStyle = \"blue\"; \n\t\tcontext.fillText(\"RongCloud.cn\", 10, 20);\n\tvar content = canvas.toDataURL(\"image/jpeg\");\n\t\tcontent = content.replace(\"data:image/jpeg;base64,\",\"\");\n\treturn content;\n}\n\nfunction setUserStatus(){\n\t/*\n\t\t自定义在线状态(举例)：\n\t\t\n\t\t1、在线\n\t\t\tstatus : 10 \n\n\t\t2、离开\n\t\t\tstatus : 11 \n\n\t\t3、忙碌\n\t\t\tstatus : 12  \n\n\t*/\n\tvar start = new Date().getTime();\n\tvar status = 10;\n\tinstance.setUserStatus(status, {\n\t\tonSuccess:function(status){\n\t\t\t// 此时别人 调用 setUserStatusListener 查询当前用户的在线状态 status 值为 10；\n            showResult(\"设置在线状态成功\", status, start);\n\t\t}, \n\t  \tonError:function(error){\n\t  \t\tcosnole.log(\"设置在线状态 error:\" + error);\n\t  \t}\n\t});\n}\n\nfunction setUserStatusListener(){\n\tvar start = new Date().getTime();\n\tvar params =  {\n\t\tuserIds: targetIds\n\t};\n\t// 批量获取用户信息，逐个返回\n\tinstance.setUserStatusListener(params, function(userStatus){\n\t\tconsole.log(userStatus);\n\t\t/*\n\t\tuserStatus 结构: {\"status\":[{\"platform\":[\"web\"],\"online\":1,\"status\":10}],\"userId\":null}\n\t\tplatform 平台: web | Android | iOS | pc\n\t\tonline 在线标示: 1 | 0 , 1 表示在线，反之不在线 \n\t\tstatus 自定义状态, 通过 setUserStatus 设置\n\t\t*/\n\t\tshowResult(\"获取用户在线状态成功\", userStatus, start);\n\t});\n}\n\n</script>\n\n<h1>Web SDK demo <small><a href=\"connect-check.html\">消息接收demo</a></small></h1>\n<button onclick=\"history.back()\" style=\"display: none;\" id=\"rong-home-page\">主页</button>\n<div class=\"panel\" id=\"panel\">\n\t<p>\n\t\t<span>appkey</span>\n\t\t<input type=\"text\" id=\"appkey\" size=\"20\" value=\"8w7jv4qb78a9y\">\n\t</p>\n\t<p>\n\t\t<span>token</span>\n\t\t<input type=\"text\" id=\"token\" size=\"90\" _user=\"user10\" value=\"4FGCL0oQ/E72nU4ivbui8uHR/ySxKaD1cAX2biXsYR6RsLYO9xAA4ooa+q3n42JnVTQyMAdFUiDsjFRDYZaQeg==\">\n\t\t<!-- \n\t\t8w7jv4qb78a9y\n\t\tuser9\tZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\n\t\tuser10\t4FGCL0oQ/E72nU4ivbui8uHR/ySxKaD1cAX2biXsYR6RsLYO9xAA4ooa+q3n42JnVTQyMAdFUiDsjFRDYZaQeg== \n\t\tuser11\tovjkF2621YWp7odRhy9i6vHDlKxuUva3nL1owWyEuVOxBPB1/Pr1sY7ayEdnH2tgVyqC/Dcl95lDFEgeXzjaqQ==\n\t\t-->\n\n\t\t<!-- \n\t\t82hegw5uh8ktx\n\t\trybznHwVbrk7upeAMWv8RnHEDKuqy0jJayFPsQ4gP8z+SyAuRRg4uk2hA24NDcnvbl6oswAYXQCdpAbHm4pp9g==\n\t\t-->\n\t</p>\n\t<p>\n\t\t<span>token2</span>\n\t\t<input type=\"text\" id=\"token2\" size=\"90\" _user=\"user11\" value=\"ovjkF2621YWp7odRhy9i6vHDlKxuUva3nL1owWyEuVOxBPB1/Pr1sY7ayEdnH2tgVyqC/Dcl95lDFEgeXzjaqQ==\">  &#160;&#160;<strong>切换方法使用</strong>\n\t</p>\n\t<p>\n\t\t<span>targetIds</span>\n\t\t<input type=\"text\" id=\"targetId\" size=\"25\" value=\"user9,user8\">\n\t\t<em>逗号间隔，至少提供两个</em>\n\t</p>\n\t<p>\n\t\t<span>&#160;</span>\n\t\t<input type=\"button\" onclick=\"login()\" value=\"初始化\">  &#160;&#160;<strong>所有业务方法都必须在 链接成功 之后执行</strong>\n\t</p>\n</div>\n\n<div class=\"btns\" id=\"btns\">\n\t<div class=\"title\">\n\t\t<h2>当前登录用户 id：<span id=\"login\"></span></h2> \t\n\t\t<input type=\"button\" value=\"切换用户\" onclick=\"changeUser();\">\n\t</div>\n\n\t链接状态：\n\t<input type=\"button\" value=\"断开链接\" onclick=\"disconnect();\">\n\t<input type=\"button\" value=\"重新链接\" onclick=\"reconnect();\">\n\t\n\t<br>\n\n\n\t发送消息：\n\t<input type=\"button\" value=\"文字消息(携带用户信息)\" onclick=\"sendTextMessage();\">\n\t<input type=\"button\" value=\"图片消息\" onclick=\"sendImageMessage();\">\n\t<input type=\"button\" value=\"文件消息\" onclick=\"sendFileMessage();\">\n\t<input type=\"button\" value=\"语音消息\" onclick=\"sendVoiceMessage();\">\n\t<br/>\n\t<input type=\"button\" value=\"@ 消息\" onclick=\"sendAtMessage();\"> \n\t<input type=\"button\" value=\"富文本消息\" onclick=\"sendRichContentMessage();\">\n\t<input type=\"button\" value=\"自定义消息\" onclick=\"sendRegisterMessage();\">\n\t<input type=\"button\" value=\"位置消息\" onclick=\"sendLocationMessage();\"> \n\t<input type=\"button\" value=\"消息撤回\" onclick=\"sendRecallMessage();\"> \n\n\t<br>\n\n\t接收消息：\n\t<input type=\"button\" value=\"同步状态消息\" onclick=\"SendSyncReadStatusMessage();\">\n\t<input type=\"button\" value=\"检查未读消息\" onclick=\"checkUnreadMessage();\"> \n\t<input type=\"button\" value=\"消息接收\" onclick=\"receiveMessage();\"> \n\t\n\t<br>\n\t历史消息：\n\t<input type=\"button\" value=\"获取列表\" onclick=\"getHistroyMessage();\"> \n\t<input type=\"button\" value=\"清空全部\" onclick=\"clearHistroyMessage();\"> \n\n\t<br>\n\n\t会&nbsp;&nbsp;话：\n\t<input type=\"button\" value=\"会话列表\" onclick=\"getConversationList();\">\n\t<input type=\"button\" value=\"获取会话\" title=\"需要在获取会话列表之后执行\" onclick=\"getConversation();\">\n\t<input type=\"button\" value=\"会话未读数\" onclick=\"getUnreadCount();\"> \n\t<input type=\"button\" value=\"会话未读总数\" onclick=\"getTotalUnreadCount();\"> \n\t<br/>\n\t<input type=\"button\" value=\"清除会话未读数\" onclick=\"clearUnreadCount();\">\n\t<input type=\"button\" value=\"清除全部未读数\" onclick=\"clearTotalUnreadCount();\">\n\t<input type=\"button\" value=\"删除指定会话\" onclick=\"removeConversation();\">\n\t<input type=\"button\" value=\"删除所有会话\" onclick=\"clearConversation();\">\n\n\t<br>\n\n\t聊 天 室：\n\t<input type=\"button\" value=\"加入聊天室\" onclick=\"enterChatroom();\"> \n\t<input type=\"button\" value=\"聊天室发消息\" onclick=\"sendMessageToChatroom();\"> \n\t<input type=\"button\" value=\"聊天室发题目\" onclick=\"sendQAMessage();\"> \n\t<input type=\"button\" value=\"退出聊天室\" onclick=\"quitChatroom();\"> \n\t<input type=\"button\" value=\"获取聊天室信息\" onclick=\"getChatroomInfo();\"> \n\t\n\t<br>\n\t\n\t在线状态：\n\t<input type=\"button\" value=\"设置自己在线状态\" onclick=\"setUserStatus();\"> \n\t<input type=\"button\" value=\"查询其他人在线状态\" onclick=\"setUserStatusListener();\"> \n\t<br>\n\t\n\t<div class=\"rong-public-service\" id=\"rong-public-service\">\n\t\t公众服务：\n\t\t<input type=\"button\" value=\"获取已关注公众号\" onclick=\"getPublicServiceList();\"> \n\t\t<input type=\"button\" value=\"查找公众号\" onclick=\"searchPublicService();\"> \n\t\t<!-- <input type=\"button\" value=\"查找公众号 byType\" onclick=\"searchPublicServiceByType();\">  -->\n\t\t<input type=\"button\" value=\"订阅公众号\" onclick=\"subscribePublicService();\"> \n\t\t<input type=\"button\" value=\"取消订阅公众号\" onclick=\"unsubscribePublicService();\"> \n\t\t<input type=\"button\" value=\"获取公众号信息\" onclick=\"getPublicServiceProfile();\"> \n\t\t<input type=\"button\" value=\"给公众号留言\" onclick=\"sendToPublic();\"> \n\t\t<input type=\"button\" value=\"公众号历史留言\" onclick=\"getPublicHistroyMessage();\"> \n\t</div>\n\t<br>\n</div>\n\n<div class=\"result\" id=\"result-area\">\n\t<h3 id=\"result-title\">运行结果：</h3>\n\n\t<div class=\"result-btns\">\n\t\t<button id=\"collapse-btn\">Collapse</button>\n\t\t<button id=\"expand-btn\">Expand</button>\n\t\t<button id=\"toggle-btn\">Toggle</button>\n\t\t<button id=\"toggle-level1-btn\">Toggle level1</button>\n\t\t<button id=\"toggle-level2-btn\">Toggle level2</button>\n\t\t\n\t\t<button class=\"result-code\" id=\"result-code-btn\">查看代码</button>\n\t</div>\n\n\t<div id=\"result-body\"></div>\n</div>\n\n\n<ol id=\"show\" class=\"show\"></ol>\n<div id=\"show1\"></div>\n<script>\n(function(){\n\tvar t = document.getElementById(\"btns\");\n\tvar _code = document.getElementById(\"result-code-btn\");\n\tvar _funcName = \"\", _btnName = \"\";\n\tt.onclick = function(event){\n\t\tvar e = event || window.event;\n\t\tvar node = e.target || e.srcElement;\n\t\tvar tagName = node.tagName.toLowerCase();\n\t\tif(tagName == \"input\"){\n\t\t\t_funcName = node.getAttribute(\"onclick\").split(\"(\")[0];\n\t\t\t_btnName = node.innerHTML;\n\t\t}\n\t}\n\t_code.onclick = function(){\n\t\tvar code = window[_funcName] + \"\";\n\n\t\tvar start = new Date().getTime();\n\t\tshowResult(_btnName, window[_funcName], start);\n\t}\n})();\n</script>\n\n</body>\n</html>"
  },
  {
    "path": "calllib-v2/README.md",
    "content": "### 文档\n\n开通音视频服务，请参考 [音视频开通指南](http://www.rongcloud.cn/docs/call.html#open)\n\nCallLib [开发指南](http://www.rongcloud.cn/docs/web_calllib.html#CallLibInit)\n\n### 示例说明\n\n1、HTTPS 站点或 localhost, 端口不限\n\n2、配置 `private.html` 、`group.html` 页面中的用户信息 <span style=\"color: red;\">至少配置 2 个 用户</span>\n\n`private.html`:\n\n```js\nvar config = {\n  // 融云开发者后台创建应用获取 http://developer.rongcloud.cn/\n  appKey: 'appkey',\n  users: [{\n    // 用户 Id\n    id: \"XDov3Ln7p\",\n    /*\n      用户 Token \n      Server API：http://www.rongcloud.cn/docs/server.html#user_get_token\n      Server SDK：http://rongcloud.github.io/server-sdk-nodejs/docs/v1/user/user.html#register\n    */ \n    token: \"48WQuGNh7065SB3WVJYnt6+YsUIoF3ojin3K2sssIg+8Ph5+QmAtoP6tdpZUyLdaH\"\n  }, {\n    id: \"Qlyvf1BdT\",\n    token: \"KM7HOjWA2JPghgUJSvFUkcjRgiV1+NBKF4hsSSFA/joNtsdS1YEkeV2IKH+AY1qZPXnLINfK\"\n  }]\n};\n```\n\n`group.html`:\n\n```js\nvar config = {\n  // 融云开发者后台创建应用获取 http://developer.rongcloud.cn/\n  appKey: 'appkey',\n  groupId: '群组 Id',\n  members: [{\n    id: \"XDov3Ln7p\",\n    /*\n      用户 Token \n      Server API：http://www.rongcloud.cn/docs/server.html#user_get_token\n      Server SDK：http://rongcloud.github.io/server-sdk-nodejs/docs/v1/user/user.html#register\n    */ \n    token: \"48WQuGNojin3K277sfOlwuO8bLvftw4xaa/DrZEyJMsLZ9PPIg+8Ph5+QmAtoP6tdpZUyLdaH\"\n  }, {\n    id: \"Qlyvf1BdT\",\n    token: \"KM7HOjWA2JPgasdfrUJSvFUkcjRgiV1+NBKF4hsSSFA/joNtsdS1YEkeV2IKH+AY1qZPXnLINfK\"\n  }, {\n    id: \"OasdgfrU\",\n    token: \"KM7HfOasdgfrUJSvFUkcjRgiV1+KH+AY1qZPXnLINfK\"\n  }]\n};\n```\n\n3、访问地址:\n\n>一对一视频通话\n\n用户 XDov3Ln7p: `https://域名/private.html?0`\n\n用户 Qlyvf1BdT: `https://域名/private.html?1`\n\n>多人视频通话\n\n用户 XDov3Ln7p: `https://域名/private.html?0`\n\n用户 Qlyvf1BdT: `https://域名/private.html?1`\n\n用户 OasdgfrU: `https://域名/private.html?2`\n\n\n"
  },
  {
    "path": "calllib-v2/demo.js",
    "content": "var RongCallLib = RongCallLib.init({\n  RongIMLib: RongIMLib\n});\n\nvar tools = {\n  //仅支持类选择器和 Id 选择器\n  getDom: function(selector) {\n    var selectorMap = {\n      class: function(selector) {\n        return document.getElementsByClassName(selector);\n      },\n      id: function(selector) {\n        return document.getElementById(selector);\n      }\n    };\n    var isClass = (selector.indexOf('.') == 0);\n    var type = isClass ? 'class' : 'id';\n    var name = selector.slice(1);\n    return selectorMap[type](name);\n  },\n  toggleClass: function(node, name) {\n    node.className = name;\n  },\n  createDom: function(name, attrs) {\n    attrs = attrs || {};\n    var node = document.createElement(name);\n    for (var key in attrs) {\n      node[key] = attrs[key];\n    }\n    return node;\n  },\n  noop: function(){}\n};\n\nvar ClassType = {\n  MAX: 'rong-max-window',\n  MIN: 'rong-min-window'\n};\n\nvar containerNode = tools.getDom('.rong-container')[0];\n\nvar clearWindow = function() {\n  containerNode.innerHTML = '';\n};\n\nvar setMaxWindow = function(minNode) {\n  var maxNode = tools.getDom('.' + ClassType.MAX)[0];\n  if (maxNode) {\n    tools.toggleClass(maxNode, ClassType.MIN);\n  }\n  tools.toggleClass(minNode, ClassType.MAX);\n};\n\n\nvar videoItem = {\n  added: function(result) {\n    var node = result.data;\n\n\n    var win = tools.createDom('div', {\n      className: ClassType.MIN\n    });\n    var isLocal = result.isLocal;\n\n    win.onclick = function(event) {\n      setMaxWindow(event.currentTarget);\n    };\n    win.appendChild(node);\n    containerNode.appendChild(win);\n\n    \n    if (isLocal) {\n      setMaxWindow(win);\n    }\n  },\n  removed: function(result) {\n    var videoId = result.data;\n    var video = tools.getDom('#' + videoId);\n    if (video) {\n      var win = video.parentNode;\n      containerNode.removeChild(win);\n    }\n  },\n  leave: function() {\n    clearWindow();\n  }\n};\n// 注册视频节点监听\nRongCallLib.videoWatch(function(result) {\n  videoItem[result.type](result);\n});\n\nvar tBarCallVideo = tools.getDom('.rong-callvideo')[0];\nvar tBarCallAudio = tools.getDom('.rong-callaudio')[0];\n\nvar tBarAccept = tools.getDom('.rong-accept')[0];\nvar tBarHungup = tools.getDom('.rong-hungup')[0];\n\nvar tBarMute = tools.getDom('.rong-mute')[0];\nvar tBarUnMute = tools.getDom('.rong-unmute')[0];\n\nvar tBarDisableVideo = tools.getDom('.rong-disable-video')[0];\nvar tbarDisableAudio = tools.getDom('.rong-disable-audio')[0];\n\nvar show = function(node){\n  node.style.display = 'block';\n};\nvar hide = function(node){\n  node.style.display = 'none';\n};\n\nvar Buttons = {\n  showCall: function(){\n    show(tBarCallVideo);\n    show(tBarCallAudio); \n  },\n  hideCall: function(){\n    hide(tBarCallVideo);\n    hide(tBarCallAudio); \n  },\n  showAccept: function(){\n    show(tBarAccept);\n  },\n  hideAccept: function(){\n    hide(tBarAccept);\n  },\n  showMute: function(){\n    show(tBarMute);\n    hide(tBarUnMute);\n  },\n  showUnmute: function(){\n    show(tBarUnMute);\n    hide(tBarMute);\n  },\n  showDisableVideo: function(){\n    show(tBarDisableVideo);\n    hide(tbarDisableAudio);\n  },\n  showDisableAudio: function(){\n    show(tbarDisableAudio);\n    hide(tBarDisableVideo);\n  },\n  showCaller: function(){\n    show(tBarHungup);\n    show(tBarMute);\n    show(tBarDisableVideo);\n  },\n  showCallee: function(){\n    show(tBarAccept);\n    show(tBarHungup);\n    show(tBarMute);\n    show(tBarDisableVideo); \n  },\n  hideOperate: function(){\n    hide(tBarHungup);\n    hide(tBarAccept);\n    hide(tBarMute);\n    hide(tBarUnMute);\n    hide(tBarDisableVideo);\n    hide(tbarDisableAudio);\n  }\n};\n\nvar commandMap = {\n  InviteMessage: function(){\n    Buttons.showCallee();\n    Buttons.hideCall();\n  }\n};\n// 注册命令监听\nRongCallLib.commandWatch(function(command) {\n  var cmd = commandMap[command.messageType] || tools.noop;\n  cmd();\n  console.log(command);\n});\n\nvar CallType = RongIMLib.VoIPMediaType;\nfunction callVideo() {\n  var mediaType = CallType.MEDIA_VEDIO;\n  call(mediaType);\n}\n\nfunction callAudio() {\n  var mediaType = CallType.MEDIA_AUDIO;\n  call(mediaType);\n}\n\nfunction call(mediaType) {\n\n  Buttons.hideCall();\n  Buttons.showCaller();\n\n  params.mediaType = mediaType;\n  RongCallLib.call(params, function(error) {\n    console.log(error);\n  });\n}\n\nfunction hungup() {\n  Buttons.showCall();\n  Buttons.hideOperate();\n  clearWindow();\n  RongCallLib.hungup(params, function(error, summary) {\n    console.log(summary);\n  });\n}\n\nfunction acceptVideo() {\n  Buttons.hideAccept();\n  params.mediaType = CallType.MEDIA_VEDIO;\n  RongCallLib.accept(params);\n}\n\nfunction reject() {\n  RongCallLib.reject(params);\n}\n\nfunction mute() {\n  Buttons.showUnmute();\n  RongCallLib.mute();\n}\n\nfunction unmute() {\n  Buttons.showMute();\n  RongCallLib.unmute();\n}\n\nfunction videoToAudio() {\n  Buttons.showDisableAudio();\n  RongCallLib.videoToAudio();\n}\n\nfunction audioToVideo() {\n  Buttons.showDisableVideo();\n  RongCallLib.audioToVideo();\n}\n"
  },
  {
    "path": "calllib-v2/group.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title> CallLib </title>\n  <link rel=\"stylesheet\" href=\"../res/rongcloud.css\">\n  <link rel=\"stylesheet\" href=\"style/main.css\">\n</head>\n<body>\n  <a href=\"https://github.com/rongcloud/websdk-demo/blob/master/calllib/blink/private.html\" class=\"get-source\">获取源码</a>\n  <div class=\"rong-container\"></div>\n   <div class=\"rong-toolbar\">\n      <button onclick=\"callVideo()\" class=\"rong-callvideo\"></button>\n      <button onclick=\"callAudio()\" class=\"rong-callaudio\"></button>\n      \n      <button onclick=\"acceptVideo()\" class=\"rong-accept\"></button>\n      <button onclick=\"hungup()\" class=\"rong-hungup\"></button>\n      \n      <button onclick=\"mute()\" class=\"rong-mute\"></button>\n      <button onclick=\"unmute()\" class=\"rong-unmute\"></button>\n\n      <button onclick=\"videoToAudio()\" class=\"rong-disable-video\"></button>\n      <button onclick=\"audioToVideo()\" class=\"rong-disable-audio\"></button>\n  </div>\n  </div>\n  <h2 class=\"rong-notice\">公告：此 Demo 即将废弃，后续不再维护，同时会推出新示例</h2>\n  <div class=\"rong-warns\">\n    <p>兼容说明：</p>\n    <ul>\n      <li>操作系统: macOS 10.13.3+ 、Win7+</li>\n      <li>浏览器: Chrome 57+</li>\n    </ul>\n    <p>站点要求：</p>\n    <ul>\n      <li>HTTPS 站点或 localhost, 端口不限</li>\n    </ul>\n  </div>\n</body>\n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.1.js\"></script>\n  <script src=\"//cdn.ronghub.com/RongCallLib-3.0.0.min.js\"></script>\n  <script src=\"./init.js\"></script>\n  <script src=\"./demo.js\"></script>\n  <script>\n    var config = {\n      appKey: 'appkey',\n      groupId: 'mBze1232Cm',\n      members: [{\n        id: 'XDdddLn7p',\n        token: '48WQuGNLvftw4xaa/DrZEyJMsLZ9PPIg+8Ph5+QmAtoP6tdpZUyLdaH'\n      }, {\n        id: 'Qlyv123T',\n        token: 'KM7HOjWA2JPgQ/joNtsdS1YEkeV2IKH+AY1qZPXnLINfK'\n      },{\n        id: 'RffffM6h',\n        token: 'X1LcAANGwXDJjWfmuNGHu3xpRjANxKgfakOnYL9zWv+8tfUu6WVQ=='\n      }]\n    };\n\n    var params = (function(config){\n        var members = config.members;  \n        var appKey = config.appKey;\n\n        var index = location.search.slice(1) || 0;\n        var member = members[index];\n        var inviteUsers = members.filter(function(_member){\n          return _member.id != member.id;\n        });\n        var inviteUserIds = inviteUsers.map(function(_member){\n          return _member.id; \n        });\n        return {\n          appKey: appKey,\n          conversationType: 3,\n          userId: member.id,\n          inviteUserIds: inviteUserIds,\n          token: member.token,\n          targetId: config.groupId\n        };\n    })(config);\n\n    var callbacks = {\n        getInstance : function(instance){\n           var toolbar = tools.getDom('.rong-toolbar')[0];\n           toolbar.style.display = 'block';\n        },\n        getCurrentUser : function(userInfo){\n            console.log(userInfo.userId);\n        }\n    };\n\n    IMLib.init(params, callbacks);\n  </script>\n\n</html> "
  },
  {
    "path": "calllib-v2/init.js",
    "content": "\"use strict\";\n\n;\n(function(dependencies) {\n\n  var global = dependencies.global;\n  var RongIMLib = dependencies.RongIMLib;\n  var RongIMClient = RongIMLib.RongIMClient;\n\n  function ObserverList() {\n\n    var checkIndexOutBound = function(index, bound) {\n      return index > -1 && index < bound;\n    };\n\n    this.observerList = [];\n\n    this.add = function(observer, force) {\n      force && (this.observerList.length = 0);\n      this.observerList.push(observer);\n    };\n\n    this.get = function(index) {\n      if (checkIndexOutBound(index, this.observerList.length)) {\n        return this.observerList[index];\n      }\n    };\n\n    this.count = function() {\n      return this.observerList.length;\n    };\n\n    this.removeAt = function(index) {\n      checkIndexOutBound(index, this.observerList.length) && this.observerList.splice(index, 1);\n    };\n\n    this.remove = function(observer) {\n      if (!observer) {\n        this.observerList.length = 0;\n        return;\n      }\n      observer = Object.prototype.toString.call(observer) == '[object Function]' ? [observer] : observer;\n      for (var i = 0, len = this.observerList.length; i < len; i++) {\n        if (this.observerList[i] === observer[i]) {\n          this.removeAt(i);\n          break;\n        }\n      }\n    };\n\n    this.notify = function(val) {\n      for (var i = 0, len = this.observerList.length; i < len; i++) {\n        this.observerList[i](val);\n      }\n    };\n\n    this.indexOf = function(observer, startIndex) {\n      var i = startIndex || 0,\n        len = this.observerList.length;\n      while (i < len) {\n        if (this.observerList[i] === observer) {\n          return i;\n        }\n        i++;\n      }\n      return -1;\n    };\n  }\n\n  var msgObserverList = new ObserverList();\n\n  var init = function(params, callbacks) {\n    var appKey = params.appKey;\n    var token = params.token;\n    var navi = params.navi || \"\";\n\n    if (navi !== \"\") {\n      //私有云\n      var config = {\n        navi: navi\n      }\n      RongIMLib.RongIMClient.init(appKey, null, config);\n    } else {\n      //公有云\n      RongIMLib.RongIMClient.init(appKey);\n    }\n\n    var instance = RongIMClient.getInstance();\n\n    // 连接状态监听器\n    RongIMClient.setConnectionStatusListener({\n      onChanged: function(status) {\n        switch (status) {\n          case RongIMLib.ConnectionStatus.CONNECTED:\n            callbacks.getInstance && callbacks.getInstance(instance);\n            break;\n        }\n      }\n    });\n\n    RongIMClient.setOnReceiveMessageListener({\n      // 接收到的消息\n      onReceived: function(message) {\n        // 判断消息类型\n        msgObserverList.notify(message);\n      }\n    });\n\n    //开始链接\n    RongIMClient.connect(token, {\n      onSuccess: function(userId) {\n        callbacks.getCurrentUser && callbacks.getCurrentUser({\n          userId: userId\n        });\n        console.log(\"链接成功\");\n      },\n      onTokenIncorrect: function() {\n        //console.log('token无效');\n      },\n      onError: function(errorCode) {\n        console.log(errorCode);\n      }\n    });\n  }\n\n  var watch = function(watcher) {\n    msgObserverList.add(watcher);\n  };\n\n  global.IMLib = {\n    init: init,\n    watch: watch\n  };\n})({\n  global: window,\n  RongIMLib: RongIMLib\n});"
  },
  {
    "path": "calllib-v2/private.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title> CallLib </title>\n  <link rel=\"stylesheet\" href=\"../res/rongcloud.css\">\n  <link rel=\"stylesheet\" href=\"style/main.css\">\n</head>\n<body>\n  <div class=\"rong-container\"></div>\n   <div class=\"rong-toolbar\">\n      <button onclick=\"callVideo()\" class=\"rong-callvideo\"></button>\n      <button onclick=\"callAudio()\" class=\"rong-callaudio\"></button>\n      \n      <button onclick=\"acceptVideo()\" class=\"rong-accept\"></button>\n      <button onclick=\"hungup()\" class=\"rong-hungup\"></button>\n      \n      <button onclick=\"mute()\" class=\"rong-mute\"></button>\n      <button onclick=\"unmute()\" class=\"rong-unmute\"></button>\n\n      <button onclick=\"videoToAudio()\" class=\"rong-disable-video\"></button>\n      <button onclick=\"audioToVideo()\" class=\"rong-disable-audio\"></button>\n  </div>\n  <h2 class=\"rong-notice\">公告：此 Demo 即将废弃，后续不再维护，同时会推出新示例</h2>\n  <div class=\"rong-warns\">\n    <p>兼容说明：</p>\n    <ul>\n      <li>操作系统: macOS 10.13.3+ 、Win7+</li>\n      <li>浏览器: Chrome 57+</li>\n    </ul>\n    <p>站点要求：</p>\n    <ul>\n      <li>HTTPS 站点或 localhost, 端口不限</li>\n    </ul>\n  </div>\n</body>\n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.1.js\"></script>\n  <script src=\"//cdn.ronghub.com/RongCallLib-3.0.2.min.js\"></script>\n  <script src=\"./init.js\"></script>\n  <script src=\"./demo.js\"></script>\n  <script>\n    var config = {\n      appKey: 'appkey',\n      users: [{\n        id: \"XD1n7p\",\n        token: \"48WQusfOlwuO8bLvftw4xaa/DrZEyJMsLZ9PPIg+8Ph5+QmAtoP6tdpZUyLdaH\"\n      }, {\n        id: \"QlyBdT\",\n        token: \"KM7HOjWA2JPgQUF0r+usAKE4ovwvabHEXU8xDrUJSvFtsdS1YEkeV2IKH+AY1qZPXnLINfK\"\n      }]\n    };\n\n    var params = (function(config){\n        var users = config.users;  \n        var appKey = config.appKey;\n\n        var index = location.search.slice(1) || 0;\n        var user = users[index];\n        var inviteUsers = users.filter(function(_user){\n          return _user.id != user.id;\n        });\n        var inviteUserIds = inviteUsers.map(function(_user){\n          return _user.id; \n        });\n        return {\n          appKey: appKey,\n          conversationType: 1,\n          userId: user.id,\n          inviteUserIds: inviteUserIds,\n          token: user.token,\n          targetId: inviteUsers[0].id\n        };\n    })(config);\n\n    var callbacks = {\n        getInstance : function(instance){\n           var toolbar = tools.getDom('.rong-toolbar')[0];\n           toolbar.style.display = 'block';\n        },\n        getCurrentUser : function(userInfo){\n            console.log(userInfo.userId);\n        }\n    };\n\n    IMLib.init(params, callbacks);\n  </script>\n\n</html> "
  },
  {
    "path": "calllib-v2/style/main.css",
    "content": " html,body{\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  position: absolute;\n  z-index: -3;\n} \n.rong-container{\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  background-color: #333;\n  z-index: -2;\n}\n\n.rong-max-window{\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  z-index: -1;\n}\n.rong-max-window video{\n  width: 100%;\n  height: 100%;\n  object-fit: fill;\n  margin: 0 auto;\n  display: block;\n}\n\n.rong-min-window{\n  float:left;\n  margin-left: 30px;\n  margin-top: 10px;\n  width: 200px;\n  height: 150px;\n  border: 2px solid #FFF;\n  cursor: pointer;\n}\n\n.rong-min-window video{\n  height: 100%;\n}\n\n.rong-toolbar{\n  position: absolute;\n  bottom: 50px;\n  left: 40%;\n}\n\n.rong-toolbar button{\n  border-radius: 47%;\n  padding: 7px;\n  margin-left: 20px;\n  float: left;\n  outline: none;\n  cursor: pointer;\n  background-repeat: no-repeat;\n  border: none;\n  font-family:\"iconfont\";\n  font-size:28px;\n  font-style:normal;\n  -webkit-font-smoothing: antialiased;\n  -webkit-text-stroke-width: 0.2px;\n  -moz-osx-font-smoothing: grayscale; \n  display: none;\n}\n\n.rong-toolbar-operation{\n    display: none;\n}\n\n@font-face {\n  font-family: 'iconfont';  /* project id 698950 */\n  src: url('//at.alicdn.com/t/font_698950_0qhfkfwxt2xfxbt9.eot');\n  src: url('//at.alicdn.com/t/font_698950_0qhfkfwxt2xfxbt9.eot?#iefix') format('embedded-opentype'),\n  url('//at.alicdn.com/t/font_698950_0qhfkfwxt2xfxbt9.woff') format('woff'),\n  url('//at.alicdn.com/t/font_698950_0qhfkfwxt2xfxbt9.ttf') format('truetype'),\n  url('//at.alicdn.com/t/font_698950_0qhfkfwxt2xfxbt9.svg#iconfont') format('svg');\n}\n\nbutton.rong-callvideo, button.rong-callaudio{\n  display: block;\n}\n.rong-callvideo:before{\n  content: \"\\e895\";\n}\n.rong-callaudio:before{\n  content: \"\\e608\";\n}\n\nbutton.rong-accept{\n  padding: 8px 4px 8px 7px;\n}\n.rong-accept:before{\n  content: \"\\e606\";\n  color: green;\n}\n\n.rong-hungup:before{\n  content: \"\\e64e\";\n  color: red;\n}\n\n.rong-mute:before{\n  content: \"\\e610\";\n}\n.rong-unmute:before{\n  content: \"\\e684\";\n}\n.rong-disable-video:before{\n  content: \"\\e6a1\";\n  color: red;\n}\n\n.rong-disable-audio:before{\n  content: \"\\e895\";\n  color: green;\n}\n\n.rong-warns{\n  width: 400px;\n  height: 200px;\n  position: absolute;\n  right: 0;\n  font-style: italic;\n  border: 2px solid #FFF;\n  color: #FFF;\n  padding-left: 10px;\n  box-sizing: border-box;\n}\n\n.rong-warns li{\n  list-style: none;\n  line-height: 26px;\n}\n.rong-notice{\n  position: relative;\n  left: 30%;\n  color: #FFF;\n}"
  },
  {
    "path": "calllib-v2/user-media.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>user media</title>\n</head>\n\n<body onload=\"init()\">\n\n<section id=\"app\" hidden>\n\t<video id=\"show\" autoplay></video>\n</section>\n\n\n<style>\n#css {\n\tdisplay:none;\n}\n#cssText {\n\twidth:300px;\n\theight:140px;\n\tfont-size:12px;\n\tline-height:1.5;\n\tfont-family:verdana;\n\tpadding:5px;\n}\t\n</style>\n<div id=\"css\">\n\t<textarea id=\"cssText\">border:5px solid #cd0000;\nwidth:180px;\nheight:180px;\nright:1em;\ntop:1em;\nposition:fixed;\nopacity:0.8;</textarea> <br>\n<input type=\"button\" value=\"应用 CSS\" id=\"cssApply\">\n</div>\n\n<script>\nfunction init(){\n\tvar video = document.getElementById(\"show\");\n\tvar app = document.getElementById(\"app\");\n\tvar cssPanel = document.getElementById(\"css\");\n\tvar cssApply = document.getElementById(\"cssApply\");\n\tvar cssRules = document.getElementById(\"cssText\");\n\n\tcssApply.onclick = function(){\n\t\tvideo.style.cssText = cssRules.value;\n\t}\n\n\tif (navigator.webkitGetUserMedia) {\n\t\tnavigator.webkitGetUserMedia({audio:true, video:true},gotStream,function(){});\n\t}\n\tfunction gotStream(stream) {\n\t\tvideo.src = webkitURL.createObjectURL(stream);\n\t\tcssPanel.style.display = \"block\";\n\t\tapp.hidden = false;\n\t}\n\n\tif (navigator.mozGetUserMedia) {\n\t\tnavigator.mozGetUserMedia({audio:true, video:true}, gotStream2,function(){});\n\t}\n\tfunction gotStream2(stream) {\n\t\tvideo.src = URL.createObjectURL(stream);\n\t\tcssPanel.style.display = \"block\";\n\t\tapp.hidden = false;\n\t}\n}\n\n/*\n指定设备：MediaStreamTrack.getSources()\n*/\n\n\n// pc1 = new webkitRTCPeerConnection(servers);\n// // ...\n// pc1.addStream(localstream); \n\n\n// pc1.createOffer(gotDescription1);\n// //...\n// function gotDescription1(desc){\n//   pc1.setLocalDescription(desc);\n//   trace(\"Offer from pc1 \\n\" + desc.sdp);\n//   pc2.setRemoteDescription(desc);\n//   pc2.createAnswer(gotDescription2);\n// }\n\n\n// pc2 = new webkitRTCPeerConnection(servers);\n// pc2.onaddstream = gotRemoteStream;\n// //...\n// function gotRemoteStream(e){\n//   vid2.src = URL.createObjectURL(e.stream);\n// }\n</script>\n</body>\n</html>\n"
  },
  {
    "path": "calllib-v3/README.md",
    "content": "# CallLib Demo\n\n`注意事项:`\n\n1、需开通 [音视频 3.0 服务](./docs/ready.md)\n\n2、旧版 calllib-v3 demo 请参考: [calllib-v3-old](https://github.com/rongcloud/websdk-demo/tree/11de9a6f7c3dc33d3211c89e39069c684718224e/calllib-v3)\n\n`启动流程:`\n\n* [前期准备](./docs/ready.md)\n* [Demo Server](./docs/server.md)\n* [Demo Web](./docs/web.md)\n* [演示示例](./docs/show.md)\n\n`相关文档:`\n\nWeb CallLib 开发指南: [https://www.rongcloud.cn/docs/web_calllib.html](https://www.rongcloud.cn/docs/web_calllib.html)\n\nWeb IM SDK 开发指南: [https://www.rongcloud.cn/docs/web.html](https://www.rongcloud.cn/docs/web.html)\n\n融云知识库: [https://support.rongcloud.cn](https://support.rongcloud.cn)\n\n融云开发者后台: [https://developer.rongcloud.cn](https://developer.rongcloud.cn)"
  },
  {
    "path": "calllib-v3/docs/ready.md",
    "content": "## 前期准备\n\nSealRTC Web 是基于 [RongCloud Web CallLib](https://www.rongcloud.cn/docs/web_calllib.html) 的音视频示例，通过此示例，可更好的帮助您集成、使用 Web CallLib SDK\n\n#### 创建应用\n\n1、移步融云开发者后台: [https://developer.rongcloud.cn](https://developer.rongcloud.cn)\n\n2、输入必要信息注册用户\n\n![](./images/register.png)\n\n3、首次登录融云开发者后台\n\n![](./images/first-login.png)\n\n4、创建应用\n\n#### 开通服务\n\n![](./images/open.png)\n"
  },
  {
    "path": "calllib-v3/docs/server.md",
    "content": "## CallLib Demo Server\n\n**Demo Server 作用**\n\n1、为 CallLib Web Demo 提供获取 token 的接口\n\n2、自动创建群组, 提供进行群组音视频的能力\n\n<b>注</b>: 运行 Web Demo 时, 必须运行 Demo Server, 并且 appKey 配置必须一致\n\n**下载并安装 Node.js**\n\nNode.js 最低版本为 [10+](http://nodejs.cn/download/)，如果机器已安装 Node ，可使用 [NVM](https://github.com/creationix/nvm) 切换版本\n\n**快速启动**\n\n1、下载 Demo Server 源码\n\n[https://github.com/rongcloud/websdk-demo/tree/master/calllib-v3/server](https://github.com/rongcloud/websdk-demo/tree/master/calllib-v3/server)\n\n2、进入 server 根目录执行\n\n```bash\nnpm install\n```\n\n3、修改配置文件 `setting.js`\n\n```js\nmodule.exports = {\n  appkey: 'appkey', // 融云应用 AppKey，可在融云开发者后台获取\n  secret: 'secret', // 融云应用 Secret，可在融云开发者后台获取\n  port: '9929' // 启动服务端口号, 默认 9929, 按需修改\n};\n```\n\n4、启动服务\n\n```\nnpm run serve\n```\n\n启动成功后, 控制台输出如下:\n\n![](./images/serve.png)\n\n<b>注</b>: 此 Server 仅供测试, 生产环境 App Server 需部署 https 协议\n"
  },
  {
    "path": "calllib-v3/docs/show.md",
    "content": "## 演示示例\n\n#### CallLib Demo Web 浏览器兼容性说明\n\n![](./images/compatible.png)\n\n1、在谷歌浏览器使用两个 Tab 页面分别打开 Web Demo: [http://localhost:3582/src/index.html](http://localhost:3582/src/index.html)\n\n![](./images/login.png)\n\n2、两个页面分别输入不同的用户 id(例如用户为 A、B), 点击登录, 进入通话界面\n\n![](./images/call.png)\n\n3、用户 A 点击视频或音频按钮, 输入用户 B 的 id\n\n![](./images/call-other.png)\n\n4、用户 B 接收到 A 发送的音视频请求, 点击接听按钮\n\n![](./images/accept.png)\n\n5、开始音视频通话\n\n![](./images/finished.png)"
  },
  {
    "path": "calllib-v3/docs/web.md",
    "content": "## CallLib Demo Web\n\n1、下载 Demo Web 源码\n\n[https://github.com/rongcloud/websdk-demo/tree/master/calllib-v3/web](https://github.com/rongcloud/websdk-demo/tree/master/calllib-v3/web)\n\n2、修改配置文件 `setting.js`\n\n```js\n{\n  appkey: 'appkey', // 融云应用 AppKey，可在融云开发者后台获取\n  server: 'http://localhost:9929' // Demo Server 地址\n}\n```\n\n3、启动 `index.html` 开始体验\n\n<b>注</b>: 浏览器限制协议必须是 `HTTPS` 或 `http://localhost:port` 才可使用摄像头、麦克风\n\n所以需准备本地服务，若无本地服务，推荐: [Nginx](http://nginx.org/en/download.html) 或 [Node.js Puer](https://www.npmjs.com/package/puer)\n\n![](./images/login.png)<br><br><br>\n\n使用 Puer 启动服务器示例:\n\n1、全局安装 puer\n\n```bash\nnpm install puer -g\n```\n\n2、打开命令行 `Web Demo` 根目录\n\n```bash\npuer --port 3582\n```\n\n启动成功后出现如下界面，点击 `index.html` 开始体验\n\n![](./images/puer.png)\n"
  },
  {
    "path": "calllib-v3/private.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>已废弃 CallLib</title>\n  <style>\n    body {\n      background-color: #333;\n    }\n    .rong-warns {\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate(-50%, -50%);\n      text-align: center;\n      color: white;\n    }\n    .rong-warns a {\n      color: white;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"rong-warns\">\n    <p>抱歉, 为了大家更好的使用体验, 推荐参考最新版 Demo: <a href=\"https://github.com/rongcloud/websdk-demo/tree/master/calllib-v3\">CallLib Demo v3</a></p>\n    <p>如依然需要使用旧版 Demo, 请访问: <a href=\"https://github.com/rongcloud/websdk-demo/tree/11de9a6f7c3dc33d3211c89e39069c684718224e/calllib-v3\">CallLib Demo v3 Old</a></p>\n  </div>\n</body>\n\n</html> "
  },
  {
    "path": "calllib-v3/server/index.js",
    "content": "var app = require('express')(),\n  setting = require('./setting'),\n  http = require('http'),\n  bodyParser = require(\"body-parser\"),\n  RongSDK = require('rongcloud-sdk')({\n    appkey: setting.appkey,\n    secret: setting.secret\n  }),\n  port = setting.port;\n\nvar Group = RongSDK.Group,\n  User = RongSDK.User;\n\nvar groupId, userList;\n\n\n// 允许跨域\nvar allowCors = function (req, res, next) {\n  res.header('Access-Control-Allow-Origin', req.headers.origin);\n  res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');\n  res.header('Access-Control-Allow-Headers', 'Content-Type');\n  res.header('Access-Control-Allow-Credentials', 'true');\n  next();\n};\n\napp.use(allowCors);\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({ extended: false }));\n\napp.post('/login', function (req, res) {\n  var params = req.params,\n    body = req.body;\n  var userId = body.userId;\n  var user = {\n    id: userId,\n    name: userId,\n    portrait: '  '\n  };\n  var token;\n  User.register(user).then(function (result) {\n    console.log('register result', result);\n    token = result.token;\n    var joinGroup, joinParams;\n    if (!groupId) {\n      groupId = +new Date() + '';\n      joinGroup = Group.create;\n      joinParams = {\n        id: groupId,\n        name: groupId,\n        members: [{ id: userId }]\n      };\n      console.log('createParams', joinParams);\n    } else {\n      joinGroup = Group.join;\n      joinParams = {\n        id: groupId,\n        member: { id: userId }\n      };\n      console.log('joinParams', joinParams);\n    }\n    return joinGroup(joinParams);\n  }).then(function (result) {\n    return Group.get({ id: groupId });\n  }).then(function (result) {\n    result.userId = userId;\n    result.groupId = groupId;\n    result.token = token;\n    console.log('result', result);\n    return res.send(result);\n  }).catch(function (e) {\n    console.error('error', e);\n  });\n});\n\napp.post('/getMembers', function (req, res) {\n  var params = req.params,\n    body = req.body;\n  Group.get({\n    id: body.groupId || groupId\n  }).then(function (result) {\n    return res.send(result);\n  });\n});\n\napp.listen(port, function () {\n  console.log(\n`CallLib Demo Server 启动成功\nAppKey: ${setting.appkey} (Web 需一致)\nServer 地址: http://localhost:${port}\n请将此 Server 地址填入 CallLib Demo Web 的 setting.js 文件\n  `);\n});"
  },
  {
    "path": "calllib-v3/server/package.json",
    "content": "{\n  \"name\": \"server\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"serve\": \"node index.js\"\n  },\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"express\": \"^4.16.4\",\n    \"rongcloud-sdk\": \"^3.0.1\"\n  }\n}\n"
  },
  {
    "path": "calllib-v3/server/setting.js",
    "content": "module.exports = {\n  appkey: 'appkey',\n  secret: 'secret',\n  port: '9929'\n};"
  },
  {
    "path": "calllib-v3/web/css/main.css",
    "content": "@charset \"UTF-8\";\n/* 超出部分省略 */\n.ellipsis, .rong-dialog-box .rong-dialog-user-list-content span {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\nhtml, body {\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #f5f5f5;\n}\n\n.rong-main {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-box {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-login-inner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.rong-login-inner p {\n  text-align: center;\n  font-size: 20px;\n}\n\n.rong-login-inner input {\n  width: 280px;\n  height: 44px;\n  border: none;\n  border-radius: 10px;\n  display: block;\n  box-sizing: border-box;\n  margin: 17px;\n  padding: 0 15px;\n  font-size: 14px;\n  outline: none;\n}\n\n.rong-login-inner input[type=\"text\"] {\n  border: 1px solid #ddd;\n}\n\n.rong-login-inner input[type=\"button\"] {\n  background-color: #0888ff;\n  color: white;\n}\n\n.rong-info {\n  position: absolute;\n  top: 10px;\n  left: 30px;\n  text-align: left;\n  color: white;\n  z-index: 20;\n}\n\n.rong-info p {\n  font-size: 15px;\n}\n\n.rong-call-box {\n  background-color: #333;\n}\n\n.rong-call-box .rong-call-btns {\n  position: absolute;\n  bottom: 32px;\n  left: 50%;\n  transform: translateX(-50%);\n  z-index: 32;\n}\n\n.rong-call-box .rong-call-btns button {\n  width: 55px;\n  height: 55px;\n  margin: 0 8px;\n  border-radius: 50%;\n  background-image: url(\"../img/icons.svg\");\n  border: none;\n  outline: none;\n  background-repeat: no-repeat;\n  background-color: rgba(255, 255, 255, 0.87);\n  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n  box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n  cursor: pointer;\n}\n\n.rong-call-box .rong-call-btns button:hover {\n  background-color: rgba(255, 255, 255, 0.7);\n}\n\n.rong-call-box .rong-call-btns .rong-call-hungup {\n  background-position: -66px 15px;\n  background-color: #ef5350;\n}\n\n.rong-call-box .rong-call-btns button.rong-call-hungup:hover {\n  background-color: #EF5360;\n}\n\n.rong-call-box .rong-call-btns .rong-call-accept {\n  background-color: #008700;\n  background-position: 14px 15px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-accept:hover {\n  background-color: #00a000;\n}\n\n.rong-call-box .rong-call-btns .rong-call-mute {\n  background-position: 15px -154px;\n  background-size: 112px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-mute[closed] {\n  background-position: -68px -154px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-video {\n  background-position: 12px -30px;\n  background-size: 102px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-video[closed] {\n  background-position: -61px -30px;\n  background-size: 102px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-audio {\n  background-position: 17px -93px;\n  background-size: 111px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-invite {\n  background-position: 13px -310px;\n}\n\n.rong-type-box {\n  color: white;\n  position: absolute;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 20px;\n  z-index: 30;\n}\n\n.rong-video-box {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\n.rong-video-box .rong-video-list {\n  width: calc(100% - 200px);\n  height: 150px;\n  position: absolute;\n  right: 0;\n  z-index: 10;\n  margin-top: 10px;\n}\n\n.rong-video-box .rong-video-list .rong-video-min {\n  display: inline-block;\n  width: 190px;\n  height: 100%;\n  position: relative;\n  margin: 0 15px;\n  border: 1px solid white;\n}\n\n.rong-video-box .rong-video-list video {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max {\n  width: 100%;\n  height: 100%;\n  position: absolute;\n}\n\n.rong-video-box .rong-video-max video {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"], .rong-video-box .rong-video-min[talktype=\"0\"] {\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"] video, .rong-video-box .rong-video-min[talktype=\"0\"] video {\n  display: none;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"]::before, .rong-video-box .rong-video-min[talktype=\"0\"]::before {\n  content: '摄像头已关闭';\n  color: white;\n  font-size: 18px;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.rong-video-box .rong-video-min[talktype=\"0\"]::before {\n  font-size: 15px;\n}\n\n.rong-dialog-box {\n  position: fixed;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  opacity: 1;\n  z-index: 500;\n  color: #333;\n}\n\n.rong-dialog-box .rong-dialog-user-list {\n  position: fixed;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 45px;\n  background-color: #fefefe;\n  border: 1px solid #e6e6e6;\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 20px 20px 12px 20px;\n  z-index: 12;\n  font-weight: 400;\n  width: 252px;\n}\n\n.rong-dialog-box .rong-dialog-user-list h3 {\n  margin: 0;\n  font-size: 15px;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content {\n  margin: 15px 0;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content .rong-dialog-user {\n  display: inline-block;\n  width: 50%;\n  margin: 4px 0;\n  line-height: 1;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content i {\n  display: inline-block;\n  width: 12px;\n  height: 12px;\n  border: 1px solid #B2B2B2;\n  background-color: white;\n  margin-right: 1px;\n  vertical-align: middle;\n  background-image: url(../img/icons.svg);\n}\n\n.rong-dialog-box .rong-dialog-user-list-content i.rong-user-selected {\n  background-color: transparent;\n  background-position: 0px -115px;\n  background-size: 54px;\n  background-repeat: no-repeat;\n  border: 1px solid black;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content span {\n  font-size: 12px;\n  color: #585858;\n  vertical-align: middle;\n  max-width: 96px;\n  display: inline-block;\n}\n\n.rong-dialog-box .rong-confirm-btns {\n  text-align: right;\n}\n\n.rong-dialog-box .rong-confirm-btns button {\n  padding: 0 8px;\n  height: 23px;\n  border: none;\n  font-size: 12px;\n  border-radius: 5px;\n  margin-left: 3px;\n  outline: none;\n}\n\n.rong-dialog-box .rong-confirm-btns .rong-confirm-ok[disabled] {\n  opacity: 0.6;\n}\n\n.rong-dialog-box .rong-confirm-btns .rong-confirm-ok, .rong-dialog-box .rong-confirm-btns .rong-confirm-cancel {\n  background-color: #f9f9f9;\n  border: 1px solid #979797;\n}\n\n.rong-dialog-toast {\n  position: fixed;\n  text-align: center;\n  top: 30px;\n  left: 50%;\n  transform: translateX(-50%);\n  width: auto;\n  padding: 12px 50px;\n  background-color: #fefefe;\n  border: 1px solid #e6e6e6;\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 7px 35px;\n  z-index: 31;\n  font-weight: 400;\n}\n\n.rong-dialog-toast .rong-dialog-toast-content {\n  display: inline-block;\n  font-size: 14px;\n  vertical-align: middle;\n}\n"
  },
  {
    "path": "calllib-v3/web/css/main.scss",
    "content": "/* 超出部分省略 */\n.ellipsis {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\nhtml, body {\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #f5f5f5;\n}\n\n.rong-main {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-box {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-login-inner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  p {\n    text-align: center;\n    font-size: 20px;\n  }\n  input {\n    width: 280px;\n    height: 44px;\n    border: none;\n    border-radius: 10px;\n    display: block;\n    box-sizing: border-box;\n    margin: 17px;\n    padding: 0 15px;\n    font-size: 14px;\n    outline: none;\n  }\n  input[type=\"text\"] {\n    border: 1px solid #ddd;\n  }\n  input[type=\"button\"] {\n    background-color: #0888ff;\n    color: white;\n  }\n}\n\n.rong-info {\n  position: absolute;\n  top: 10px;\n  left: 30px;\n  text-align: left;\n  color: white;\n  z-index: 20;\n  p {\n    font-size: 15px;\n  }\n}\n\n.rong-call-box {\n  background-color: #333;\n  .rong-call-btns {\n    position: absolute;\n    bottom: 32px;\n    left: 50%;\n    transform: translateX(-50%);\n    z-index: 32;\n    button {\n      width: 55px;\n      height: 55px;\n      margin: 0 8px;\n      border-radius: 50%;\n      background-image: url('../img/icons.svg');\n      border: none;\n      outline: none;\n      background-repeat: no-repeat;\n      background-color: rgba(255, 255, 255, 0.87);\n      transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n      box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12);\n      cursor: pointer;\n    }\n    button:hover {\n      background-color: rgba(255, 255, 255, 0.7);\n    }\n    .rong-call-hungup {\n      background-position: -66px 15px;\n      background-color: #ef5350;\n    }\n    button.rong-call-hungup:hover {\n      background-color: #EF5360;\n    }\n    .rong-call-accept {\n      background-color: rgb(0, 135, 0);\n      background-position: 14px 15px;\n    }\n    .rong-call-accept:hover {\n      background-color: rgb(0, 160, 0);\n    }\n    .rong-call-mute {\n      background-position: 15px -154px;\n      background-size: 112px;\n    }\n    .rong-call-mute[closed] {\n      background-position: -68px -154px;\n    }\n    .rong-call-video {\n      background-position: 12px -30px;\n      background-size: 102px;\n    }\n    .rong-call-video[closed] {\n      background-position: -61px -30px;\n      background-size: 102px;\n    }\n    .rong-call-audio {\n      background-position: 17px -93px;\n      background-size: 111px;\n    }\n    .rong-call-invite {\n      background-position: 13px -310px;\n    }\n  }\n}\n.rong-type-box {\n  color: white;\n  position: absolute;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 20px;\n  z-index: 30;\n}\n\n.rong-video-box {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  .rong-video-list {\n    width: calc(100% - 200px);\n    height: 150px;\n    position: absolute;\n    right: 0;\n    z-index: 10;\n    margin-top: 10px;\n    .rong-video-min {\n      display: inline-block;\n      width: 190px;\n      height: 100%;\n      position: relative;\n      margin: 0 15px;\n      border: 1px solid white;\n    }\n    video {\n      position: absolute;\n      width: 100%;\n      height: 100%;\n      background-color: black;\n    }\n  }\n  .rong-video-max {\n    width: 100%;\n    height: 100%;\n    position: absolute;\n    video {\n      position: absolute;\n      width: 100%;\n      height: 100%;\n      background-color: black;\n    }\n  }\n  .rong-video-max[talktype=\"0\"], .rong-video-min[talktype=\"0\"] {\n    background-color: black;\n    video {\n      display: none;\n    }\n    &::before {\n      content: '摄像头已关闭';\n      color: white;\n      font-size: 18px;\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate(-50%, -50%);\n    }\n  }\n  .rong-video-min[talktype=\"0\"]::before {\n    font-size: 15px;\n  }\n}\n\n.rong-dialog-box {\n  position: fixed;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  opacity: 1;\n  z-index: 500;\n  color: #333;\n  .rong-dialog-user-list {\n    position: fixed;\n    left: 50%;\n    transform: translateX(-50%);\n    top: 45px;\n    background-color: rgb(254, 254, 254);\n    border: 1px solid rgb(230, 230, 230);\n    border-radius: 5px;\n    box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n    padding: 20px 20px 12px 20px;\n    z-index: 12;\n    font-weight: 400;\n    width: 252px;\n    h3 {\n      margin: 0;\n      font-size: 15px;\n    }\n  }\n  .rong-dialog-user-list-content {\n    margin: 15px 0;\n    .rong-dialog-user {\n      display: inline-block;\n      width: 50%;\n      margin: 4px 0;\n      line-height: 1;\n    }\n    i {\n      display: inline-block;\n      width: 12px;\n      height: 12px;\n      border: 1px solid #B2B2B2;\n      background-color: white;\n      margin-right: 1px;\n      vertical-align: middle;\n      background-image: url(../img/icons.svg);\n    }\n    i.rong-user-selected {\n      background-color: transparent;\n      background-position: 0px -115px;\n      background-size: 54px;\n      background-repeat: no-repeat;\n      border: 1px solid black;\n    }\n    span {\n      font-size: 12px;\n      color: rgb(88, 88, 88);\n      vertical-align: middle;\n      max-width: 96px;\n      display: inline-block;\n      @extend .ellipsis;\n    }\n  }\n  .rong-confirm-btns {\n    text-align: right;\n    button {\n      padding: 0 8px;\n      height: 23px;\n      border: none;\n      font-size: 12px;\n      border-radius: 5px;\n      margin-left: 3px;\n      outline: none;\n    }\n    .rong-confirm-ok[disabled] {\n      opacity: 0.6;\n    }\n    .rong-confirm-ok, .rong-confirm-cancel {\n      background-color: rgb(249, 249, 249);\n      border: 1px solid rgb(151, 151, 151);\n    }\n  }\n}\n\n.rong-dialog-toast {\n  position: fixed;\n  text-align: center;\n  top: 30px;;\n  left: 50%;\n  transform: translateX(-50%);\n  width: auto;\n  // top: 116px;\n  padding: 12px 50px;\n  background-color: rgb(254, 254, 254);\n  border: 1px solid rgb(230, 230, 230);\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 7px 35px;\n  z-index: 31;\n  font-weight: 400;\n  .rong-dialog-toast-content {\n    display: inline-block;\n    font-size: 14px;\n    vertical-align: middle;\n  }\n}\n"
  },
  {
    "path": "calllib-v3/web/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>Rong CallLib Demo</title>\n  <link rel=\"stylesheet\" href=\"./css/main.min.css\">\n\n  <!-- 配置文件 -->\n  <script src=\"setting.js\"></script>\n\n  <script src=\"lib/vue-2.6.7.js\"></script>\n  <script src=\"lib/vue-router-3.0.2.js\"></script>\n  \n  <!-- <script src=\"//cdn.ronghub.com/RongRTC-3.2.6.js\"></script> \n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.9.js\"></script>\n  <script src=\"//cdn.ronghub.com/RongCallLib.3.1.7.1.js\"></script> -->\n\n  <!-- <script src=\"https://cdn.ronghub.com/RongIMLib-2.5.16.min.js\"></script>\n  <script src=\"https://cdn.ronghub.com/RongRTC-3.2.9.min.js\"></script>\n  <script src=\"https://cdn.ronghub.com/RongCallLib.3.1.8.1.js\"></script> -->\n\n  <!-- 适配 RTC 5.0 -->\n  <script src=\"https://cdn.ronghub.com/RongIMLib-2.9.1.prod.js\"></script>\n  <script src=\"https://cdn.ronghub.com/RCRTC-5.1.1.prod.js\"></script>\n  <script src=\"https://cdn.ronghub.com/RCRTCAdapter-1.0.5.prod.js\"></script>\n  <script src=\"https://cdn.ronghub.com/RongCallLib.3.2.2.js\"></script>\n  \n\n  <script src=\"js/common/utils.js\"></script>\n  <script src=\"js/common/init.js\"></script>\n\n  <script src=\"js/dialog.js\"></script>\n  <script src=\"js/login.js\"></script>\n  <script src=\"js/call.js\"></script>\n  <script src=\"js/main.js\"></script>\n\n  <!-- 登录页面模板 -->\n  <script id=\"rong-template-login\" type=\"text/x-template\">\n    <div class=\"rong-box\">\n      <div class=\"rong-login-inner\">\n        <p>融云 CallLib</p>\n        <input v-model=\"userId\" type=\"text\" placeholder=\"请输入 userId\" @keyup.13=\"login\">\n        <input type=\"button\" value=\"登录\" @click=\"login\">\n      </div>\n    </div>\n  </script>\n\n  <!-- 通话界面模板 -->\n  <script id=\"rong-template-call\" type=\"text/x-template\">\n    <div class=\"rong-box rong-call-box\">\n      <div class=\"rong-info\">\n        <p>登录用户 id: <span>{{$route.params.userId}}</span></p>\n        <p>群组 id: <span>{{$route.params.groupId}}</span></p>\n      </div>\n      <div class=\"rong-type-box\" v-if=\"callStep === CallStep.READY_TO_CALL\">\n        <label for=\"\">通话类型: </label>\n        <select name=\"\" id=\"\" v-model=\"callType\">\n          <option value=\"1\">单人</option>\n          <option value=\"3\">群组</option>\n        </select>\n      </div>\n      <div class=\"rong-video-box\">\n        <div class=\"rong-video-list\">\n          <div class=\"rong-video-min\" v-for=\"user in minUserList\" v-video=\"user\" :talktype=\"user.talkType\"></div>\n        </div>\n        <div v-if=\"maxUser\" class=\"rong-video-max\" v-video=\"maxUser\" :talktype=\"maxUser.talkType\"></div>\n      </div>\n      <div class=\"rong-call-btns\">\n        <template v-if=\"callStep === CallStep.READY_TO_CALL\">\n          <button class=\"rong-call-video\" title=\"点击进行视频通话\" @click=\"startCall(false)\"></button>\n          <button class=\"rong-call-audio\" title=\"点击进行音频通话\" @click=\"startCall(true)\"></button>\n        </template>\n        <template v-else-if=\"callStep === CallStep.CALLS_ESTABLISH\">\n          <button v-if=\"callType == 3\" class=\"rong-call-invite\" title=\"点击邀请\" @click=\"invite\"></button>\n          <button class=\"rong-call-mute\" title=\"点击开启/关闭音频\" :closed=\"isMuted\" @click=\"mute\"></button>\n          <button class=\"rong-call-video\" closed title=\"点击开启/关闭视频\" :closed=\"callInfo.mediaType !== 2\" @click=\"setVideo\"></button>\n        </template>\n        <template v-else-if=\"callStep === CallStep.INVITED_TO_ANSWER\">\n          <button class=\"rong-call-accept\" @click=\"accept\"></button>\n          <button class=\"rong-call-hungup\" @click=\"reject\"></button>\n        </template>\n        <template v-if=\"callStep === CallStep.CALLING || callStep === CallStep.CALLS_ESTABLISH\">\n          <button class=\"rong-call-hungup\" title=\"点击挂断\" @click=\"hungup\"></button>\n        </template>\n      </div>\n    </div>\n  </script>\n\n  <!-- 选择人员弹框 -->\n  <script id=\"rong-template-dialog-users\" type=\"text/x-template\">\n    <div v-if=\"isShow\" class=\"rong-dialog-box\">\n      <div class=\"rong-dialog-user-list\">\n        <h3>选择人员</h3>\n        <div class=\"rong-dialog-user-list-content\">\n          <div class=\"rong-dialog-user\" v-for=\"user in userList\" @click=\"selectUser(user)\">\n            <i :class=\"{ 'rong-user-selected': user.isSelected }\"></i>\n            <span>{{user.userId || user.id}}</span>\n          </div>\n        </div>\n        <div class=\"rong-confirm-btns\">\n          <button class=\"rong-confirm-cancel\" @click=\"cancel\">取消</button>\n          <button class=\"rong-confirm-ok\" @click=\"confirm\" :disabled=\"!hasSelectedUser\">确认</button>\n        </div>\n      </div>\n    </div>\n  </script>\n\n  <script id=\"rong-template-dialog-toast\" type=\"text/x-template\">\n    <div class=\"rong-dialog-toast\">\n      <span class=\"rong-dialog-toast-content\">{{content}}</span>\n    </div>\n  </script>\n\n\n  \n</head>\n<body>\n  <div id=\"rongCall\" class=\"rong-main\">\n    <router-view></router-view>\n  </div>\n</body>\n\n<script>\n  // 方法定义见: js/main.js\n  RongCall.init({\n    el: '#rongCall'\n  })\n</script>\n\n</html>"
  },
  {
    "path": "calllib-v3/web/js/call.js",
    "content": "(function (RongCall, dependencies) {\n  /* 通话逻辑 */\n\n  var win = dependencies.win,\n    Vue = win.Vue,\n    RongIMLib = win.RongIMLib,\n    RongCallLib = win.RongCallLib,\n    utils = RongCall.utils;\n\n  var toast = utils.toast,\n    dialog = RongCall.dialog,\n    ConversationType = RongIMLib.ConversationType,\n    MediaType = RongIMLib.VoIPMediaType;\n\n  // 通话阶段\n  var CallStep = {\n    READY_TO_CALL: 1, // 准备拨打(最初状态)\n    INVITED_TO_ANSWER: 2, // 被邀请接听, 其他人拨打, 己方选择接听或拒绝\n    CALLING: 3, // 拨打中\n    CALLS_ESTABLISH: 4 // 通话建立完成\n  };\n\n  var CallName = {};\n  CallName[MediaType.MEDIA_AUDIO] = '语音';\n  CallName[MediaType.MEDIA_VEDIO] = '视频';\n\n  // 将消息转化为调用 CallLib 需要参数\n  function messageToCallInfo(message) {\n    return {\n      conversationType: message.conversationType,\n      targetId: message.targetId,\n      mediaType: message.content.mediaType\n    };\n  }\n  \n  // 获取挂断原因\n  function getHungupReason(reason, message) {\n    var reasonPrompt;\n    var senderUserId = message.senderUserId;\n    switch(reason) {\n    case 8:\n      reasonPrompt = '其他设备已处理';\n      break;\n    case 11:\n      reasonPrompt = `${senderUserId} 已取消`;\n      break;\n    case 12:\n      reasonPrompt = `${senderUserId} 已拒绝`;\n      break;\n    case 13:\n      reasonPrompt = `${senderUserId} 已挂断`;\n      break;\n    case 14:\n      reasonPrompt = `${senderUserId} 忙碌中`;\n      break;\n    case 15:\n      reasonPrompt = `${senderUserId} 未接听`;\n      break;\n    default:\n      reasonPrompt = '未知原因挂断';\n    }\n    return reasonPrompt;\n  }\n\n  // 己方挂断后的提示\n  function getSummaryText(status, message) {\n    var senderUserId = message.senderUserId;\n    var text;\n    switch(status) {\n    case 1:\n      text = '己方已取消';\n      break;\n    case 2:\n      text = '己方已拒绝';\n      break;\n    case 3:\n      text = '己方挂断';\n      break;\n    case 4:\n      text = `收到 ${senderUserId} 的音视频邀请, 但己方忙碌中, 不处理`;\n      break;\n    case 5:\n      text = '己方未接听';\n      break;\n    default:\n      text = '未知原因';\n    }\n    return text;\n  }\n\n  function mediaTypeToTalkType(mediaType) {\n    return mediaType === MediaType.MEDIA_AUDIO ? 0 : 1;\n  }\n\n  var commandEvents = {\n    // 监听其他人邀请自己\n    InviteMessage: function (message, context) {\n      var conversationType = message.conversationType === ConversationType.PRIVATE ? '单聊' : '群聊';\n      toast(`${message.senderUserId} 邀请您进行${CallName[message.content.mediaType]}通话(${conversationType})`);\n      context.callInfo = messageToCallInfo(message);\n      context.callStep = CallStep.INVITED_TO_ANSWER;\n    },\n    MemberModifyMessage: function (message, context) {\n      if (message.content.inviteUserIds.indexOf(context.selfUserId) !== -1) {\n        var conversationType = message.conversationType === ConversationType.PRIVATE ? '单聊' : '群聊';\n        toast(`${message.senderUserId} 邀请您进行${CallName[message.content.mediaType]}通话(${conversationType})`);\n        context.callInfo = messageToCallInfo(message);\n        context.callStep = CallStep.INVITED_TO_ANSWER;\n      }\n    },\n    HungupMessage: function (message) {\n      var reason = getHungupReason(message.content.reason, message);\n      toast(reason);\n    },\n    MediaModifyMessage: function (message, context) {\n      var senderUserId = message.senderUserId,\n        mediaType = message.content.mediaType;\n      context.userList.forEach(function (user) {\n        if (user.userId === senderUserId) {\n          user.talkType = mediaTypeToTalkType(mediaType);\n        }\n      });\n    },\n    SummaryMessage: function (message, context) {\n      var status = message.content.status;\n      var promptText = getSummaryText(status, message);\n      toast(promptText);\n      if (status === 5) { // 自己未接听, 回到初始状态\n        context.callStep = CallStep.READY_TO_CALL;\n      }\n    }\n  };\n\n  var videoChangedEvents = {\n    added: function (detail, context) {\n      context.userList.push(detail);\n      context.callStep = CallStep.CALLS_ESTABLISH;\n    },\n    removed: function (detail, context) {\n      context.userList = utils.removeArray(detail, context.userList, 'userId');\n    },\n    leave: function (detail, context) {\n      context.userList = [];\n    }\n  };\n\n  function getMembers(currentUserList, selfUserId) {\n    return utils.getMembers().then(function (members) {\n      members = members.filter(function (user) {\n        var currentUserIds = currentUserList.map(function (user) {\n          return user.id || user.userId;\n        });\n        return user.id !== selfUserId && currentUserIds.indexOf(user.id) === -1;\n      });\n      return win.Promise.resolve(members);\n    });\n  }\n\n  function call(callParams) {\n    var context = this;\n    RongCallLib.call(callParams, function (error) {\n      // 置为通话中状态\n      context.callStep = error ? context.callStep : CallStep.CALLING;\n    });\n    context.callInfo = callParams;\n  }\n\n  function accept() {\n    var context = this;\n    var callInfo = context.callInfo; // callInfo 在监听到 InviteMessage 时赋值, 格式见 messageToCallInfo 方法\n    RongCallLib.accept(callInfo, function (error) {\n      // 置为通话中状态\n      context.callStep = error ? context.callStep : CallStep.CALLING;\n    });\n  }\n\n  function invite() {\n    var context = this;\n    var callInfo = context.callInfo,\n      inviteParams = {\n        conversationType: ConversationType.GROUP,\n        targetId: callInfo.targetId,\n        inviteUserIds: [],\n        mediaType: callInfo.mediaType\n      };\n    getMembers(context.userList, context.selfUserId).then(function (members) {\n      dialog.selectUser({\n        userList: members,\n        confirmed: function (selectedUserList) {\n          var selectedIds = selectedUserList.map(function (user) {\n            return user.id;\n          });\n          inviteParams.inviteUserIds = selectedIds;\n          RongCallLib.invite(inviteParams);\n        }\n      });\n    }).catch(function () {\n      toast('获取群组成员失败');\n    });\n  }\n\n  function reject() {\n    var context = this;\n    var callInfo = context.callInfo; // callInfo 在监听到 InviteMessage 时赋值, 格式见 messageToCallInfo 方法\n    RongCallLib.reject(callInfo, function (error) {\n      // 置为最初的准备拨打状态\n      context.callStep = error ? context.callStep : CallStep.READY_TO_CALL;\n    });\n  }\n\n  function hungup() {\n    var context = this;\n    var callInfo = context.callInfo;\n    RongCallLib.hungup(callInfo, function (error) {\n      // 置为最初的准备拨打状态\n      context.callStep = error ? context.callStep : CallStep.READY_TO_CALL;\n    });\n  }\n\n  function mute() {\n    var isMuted = this.isMuted;\n    var event = isMuted ? RongCallLib.unmute : RongCallLib.mute;\n    event();\n    this.isMuted = !isMuted;\n  }\n\n  function setVideo() {\n    var callInfo = this.callInfo,\n      mediaType = callInfo.mediaType;\n    var event = mediaType === MediaType.MEDIA_AUDIO ? RongCallLib.audioToVideo : RongCallLib.videoToAudio;\n    event();\n    this.callInfo.mediaType = mediaType === MediaType.MEDIA_AUDIO ? MediaType.MEDIA_VEDIO : MediaType.MEDIA_AUDIO;\n  }\n\n  RongCall.call = Vue.component('call', {\n    template: '#rong-template-call',\n    data: function () {\n      return {\n        userList: [],\n        callStep: CallStep.READY_TO_CALL,\n        callType: ConversationType.PRIVATE, // 通话类型, 默认为单聊\n        /**\n         * 通话信息. 给 callInfo 赋值的地方有:\n         * 1. 发送 call 成功后, 存储当前通话信息\n         * 2. 接收到 InviteMessage 后, 存储通话信息\n         */\n        callInfo: {},\n        isMuted: false\n      };\n    },\n    directives: {\n      video: function (el, binding) {\n        var user = binding.value;\n        var video = user.data;\n        el.appendChild(video);\n        video.play();\n      }\n    },\n    computed: {\n      CallStep: function () {\n        return CallStep;\n      },\n      // 大窗口用户\n      maxUser: function () {\n        var context = this;\n        var maxUser;\n        context.userList.forEach(function (user) {\n          if (user.userId === context.selfUserId) {\n            maxUser = user;\n          }\n        });\n        if (maxUser) {\n          maxUser.talkType = mediaTypeToTalkType(context.callInfo.mediaType);\n        }\n        return maxUser;\n      },\n      // 小窗口用户列表\n      minUserList: function () {\n        var context = this,\n          maxUser = context.maxUser || {};\n        return context.userList.filter(function (user) {\n          return user.userId !== maxUser.userId;\n        });\n      },\n      selfUserId: function () {\n        return this.$route.params.userId;\n      }\n    },\n    methods: {\n      /**\n       * @param {boolean} isOnlyAudio 是否仅以音频发起\n       */\n      startCall: function (isOnlyAudio) {\n        var mediaType = isOnlyAudio ? MediaType.MEDIA_AUDIO : MediaType.MEDIA_VEDIO;\n        if (this.callType == ConversationType.GROUP) {\n          this.startGroupCall(mediaType);\n        } else {\n          this.startPrivateCall(mediaType);\n        }\n      },\n      startPrivateCall: function (mediaType) {\n        var targetId = win.prompt('请输入接收者 id:');\n        targetId && this.call({\n          conversationType: ConversationType.PRIVATE,\n          targetId: targetId,\n          inviteUserIds: [ targetId ],\n          mediaType: mediaType\n        });\n      },\n      startGroupCall: function (mediaType) {\n        var context = this;\n        var params = context.$route.params,\n          groupId = params.groupId;\n\n        var callParams = {\n          conversationType: ConversationType.GROUP,\n          targetId: groupId,\n          inviteUserIds: [],\n          mediaType: mediaType\n        };\n        getMembers(context.userList, context.selfUserId).then(function (members) {\n          dialog.selectUser({\n            userList: members,\n            confirmed: function (selectedUserList) {\n              var selectedIds = selectedUserList.map(function (user) {\n                return user.id;\n              });\n              callParams.inviteUserIds = selectedIds;\n              context.call(callParams);\n            }\n          });\n        }).catch(function () {\n          toast('获取群组成员失败');\n        });\n      },\n      call: call,\n      accept: accept,\n      invite: invite,\n      reject: reject,\n      hungup: hungup,\n      mute: mute,\n      setVideo: setVideo\n    },\n    mounted: function () {\n      var context = this;\n\n      // 初始化\n      RongCallLib = RongCall.initCallLib(context.selfUserId);\n\n      // 注册命令(消息)监听\n      RongCallLib.commandWatch(function (message) {\n        var event = commandEvents[message.messageType];\n        event && event(message, context);\n        console.log('received message', message);\n      });\n\n      // 注册音视频节点监听\n      RongCallLib.videoWatch(function (result) {\n        var event = videoChangedEvents[result.type];\n        event && event(result, context);\n        console.log('video changed', result);\n      });\n    }\n  });\n\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web/js/common/init.js",
    "content": "(function (RongCall, dependencies) {\n  var RongIMLib = dependencies.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient,\n    RongCallLib = dependencies.RongCallLib,\n    RongRTC = dependencies.RongRTC;\n  var RCRTC = dependencies.RCRTC;\n  var RCRTCAdapter = dependencies.RCRTCAdapter;\n\n  var win = dependencies.win;\n  var imClient;\n\n  /**\n   * \n   * @param {string} params.appkey 融云 appKey\n   * @param {string} params.token 融云 token\n   * @param {string} params.navi navi 地址, 公有云可不配置\n   */\n  var initIM = function (params) {\n    var console = win.console;\n\n    var appKey = params.appkey,\n      token = params.token,\n      navi = params.navi;\n    \n    if (navi) {\n      // 私有云初始化\n      RongIMClient.init(appKey, null, {\n        navi: navi // 私有云 navi 地址\n      });\n    } else {\n      RongIMClient.init(appKey);\n    }\n\n    // 设置状态监听器\n    RongIMClient.setConnectionStatusListener({\n      onChanged: function (status) {\n        console.log('status changed', status);\n        // 此处若监听到网络错误, 需调用 disconnect 做重连处理\n      }\n    });\n\n    // 设置消息监听器\n    RongIMClient.setOnReceiveMessageListener({\n      onReceived: function (message) {\n        console.log('received message', message, 'is offLineMessage :', message.offLineMessage);\n      }\n    });\n\n    return new win.Promise(function (resolve, reject) {\n      // 连接融云服务器\n      RongIMClient.connect(token, {\n        onSuccess: function (userId) {\n          resolve(userId)\n        },\n        onTokenIncorrect: function () {\n          reject();\n        },\n        onError: function (errorCode) {\n          reject(errorCode);\n        }\n      }, '');\n    });\n  };\n  \n  var initCallLib = function (userId) {\n    RongIMClient.getInstance().install(RongCallLib.installer)\n    const rtcClient = RongIMClient.getInstance().install(RCRTC.installer)\n    var config = {\n      RongIMLib: RongIMLib,\n      RongRTC: rtcClient,\n      currentUserId: userId,\n      RongRTCAdapter: RCRTCAdapter\n    };\n    // 初始化 CallLib\n    RongCallLib = RongCallLib.init(config);\n\n    return RongCallLib;\n  };\n\n  RongCall = RongCall || {};\n  RongCall.initIM = initIM;\n  RongCall.initCallLib = initCallLib;\n  \n})(window.RongCall, {\n  win: window,\n  RongIMLib: window.RongIMLib,\n  RongCallLib: window.RongCallLib,\n  RongRTC: window.RongRTC,\n  RCRTC: window.RCRTC,\n  RCRTCAdapter: window.RCRTCAdapter\n});"
  },
  {
    "path": "calllib-v3/web/js/common/utils.js",
    "content": "(function (dependencies) {\n  var win = dependencies.win;\n\n  var noop = function () {};\n\n  var Dom = {\n    get: function (name) {\n      var selector = null;\n      try {\n        selector = win.document.querySelector(name);\n      } catch (e) {\n        // console.error(e);\n      }\n      return selector;\n    },\n    getById: function (id) {\n      return win.document.getElementById(id);\n    },\n    create: function (innerHTML) {\n      var div = win.document.createElement('div');\n      div.innerHTML = innerHTML;\n      return div.children[0];\n    }\n  };\n\n  function tplEngine(temp, data, regexp) {\n    var replaceAction = function (object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n      });\n    };\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  }\n\n  /**\n   * http 请求\n   * @param {object} option \n   * @param {object} option.url 地址\n   * @param {object} option.queryStrings\n   * @param {object} option.headers\n   * @param {object} option.body\n   * @param {object} option.isSync\n   */\n  function ajax(option) {\n    var xhr = new win.XMLHttpRequest();\n    var method = option.method || 'GET';\n    var url = option.url;\n    var isSync = option.isSync;\n    var queryStrings = option.queryStrings || {};\n    var tpl = '{key}={value}', strings = [];\n    for (var key in queryStrings) {\n      var value = queryStrings[key];\n      var str = tplEngine(tpl, {\n        key: key,\n        value: value\n      });\n      strings.push(str);\n    }\n    queryStrings = strings.join('&');\n    var urlTpl = '{url}?{queryString}';\n    url = tplEngine(urlTpl, {\n      url: url,\n      queryString: queryStrings\n    });\n    xhr.open(method, url, !isSync);\n\n    var headers = option.headers || {};\n    for (var name in headers) {\n      var header = headers[name];\n      xhr.setRequestHeader(name, header);\n    }\n\n    var isSuccess = function (xhr) {\n      return /^(200|202|10000)$/.test(xhr.status);\n    };\n    var success = option.success || noop;\n    var fail = option.fail || noop;\n    var onLoad = function () {\n      var result = xhr.responseText;\n      if (isSuccess(xhr)) {\n        success(result);\n      } else {\n        fail(result);\n      }\n    }\n    if ('onload' in xhr) {\n      xhr.onload = onLoad;\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          onLoad();\n        }\n      };\n    }\n    xhr.onerror = function (result) {\n      fail(result);\n    };\n\n    xhr.send(option.body);\n  }\n\n  /* 监听器(观察者模式) */\n  var EventEmitter = (function () {\n    var events = {};\n\n    var on = function (name, event) {\n      var currentEventList = events[name] || [];\n      currentEventList.push(event);\n      events[name] = currentEventList;\n    };\n\n    var off = function (name, event) {\n      if (!event) {\n        delete events[name];\n      } else {\n        var currentEventList = events[name];\n        currentEventList && currentEventList.forEach(function (currentEvent) {\n          if (currentEvent === event) {\n            var index = currentEventList.indexOf(currentEvent);\n            currentEventList.splice(index, 1);\n          }\n        });\n      }\n    };\n\n    var emit = function (name, data) {\n      let currentEventList = events[name] || [];\n      currentEventList.forEach(function (event) {\n        event(data);\n      });\n    };\n\n    var clear = function () {\n      events = {};\n    };\n\n    return {\n      on: on,\n      off: off,\n      emit: emit,\n      clear: clear\n    };\n  })();\n\n  function mountDialog(options) {\n    var Dialog = win.Vue.extend(options);\n    var instance = new Dialog({\n      el: document.createElement('div')\n    });\n    var wrap = document.getElementsByTagName('body')[0];\n    wrap.appendChild(instance.$el);\n    return instance;\n  }\n\n  function removeArray(value, array, removeKey) {\n    var removeKeyList = array.map(function (value) {\n      return value[removeKey];\n    });\n    var index = removeKeyList.indexOf(value[removeKey]);\n    if (index !== -1) {\n      array.splice(index, 1);\n    }\n    return array;\n  }\n\n  function DialogQueue() {\n    this.isRunning = false;\n    this.list = [];\n  }\n  DialogQueue.prototype.add = function (fn) {\n    var context = this;\n    var run = function () {\n      context.isRunning = true;\n      var index = context.list.indexOf(run);\n      context.list.splice(index, 1);\n      var runNext = function () {\n        context.isRunning = false;\n        context.run();\n      };\n      fn(runNext);\n    };\n    context.list.push(run);\n  };\n  DialogQueue.prototype.run = function () {\n    if (this.list.length && !this.isRunning) {\n      var run = this.list[0];\n      run && run();\n    }\n  };\n\n  var toastQueue = new DialogQueue();\n\n  function toast(content) {\n    var destroyTimeout = 3000;\n    var fn = function (runNext) {\n      win.RongCall.dialog.toast({\n        content: content,\n        destroyTimeout: destroyTimeout,\n        onDestoryed: runNext\n      });\n    };\n    toastQueue.add(fn);\n    toastQueue.run();\n  }\n\n  function login(userId) {\n    return new win.Promise(function (resolve, reject) {\n      ajax({\n        url: win.RongCall.setting.server + '/login',\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: win.JSON.stringify({\n          userId: userId\n        }),\n        success: function (result) {\n          resolve(win.JSON.parse(result));\n        },\n        fail: function (err) {\n          reject(err);\n        }\n      });\n    });\n  }\n\n  function getMembers(groupId) {\n    return new win.Promise(function (resolve, reject) {\n      ajax({\n        url: win.RongCall.setting.server + '/getMembers',\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: win.JSON.stringify({\n          groupId: groupId\n        }),\n        success: function (result) {\n          resolve(win.JSON.parse(result).members);\n        },\n        fail: function (err) {\n          reject(err);\n        }\n      });\n    });\n  }\n\n  win.RongCall = win.RongCall || {};\n  win.RongCall.utils = {\n    Dom: Dom,\n    console: win.console,\n    ajax: ajax,\n    EventEmitter: EventEmitter,\n    mountDialog: mountDialog,\n    removeArray: removeArray,\n    toast: toast,\n    login: login,\n    getMembers: getMembers\n  };\n\n})({\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web/js/dialog.js",
    "content": "(function (RongCall) {\n  /* 弹框 */\n\n  var utils = RongCall.utils;\n\n  function removeSelf($el) {\n    var parent = $el.parentElement;\n    parent.removeChild($el);\n  }\n\n  /* 选择人员弹框 */\n  var selectUser = function (options) {\n    options = options || {};\n\n    var userList = options.userList;\n    userList = userList.map(function (user) {\n      user.isSelected = false;\n      return user;\n    });\n\n    return utils.mountDialog({\n      name: 'rong-select-dialog',\n      template: '#rong-template-dialog-users',\n      data: function () {\n        return {\n          isShow: true,\n          userList: userList\n        };\n      },\n      computed: {\n        hasSelectedUser: function () {\n          var selectedUser = this.userList.filter(function (user) {\n            return user.isSelected;\n          });\n          return selectedUser.length;\n        }\n      },\n      methods: {\n        selectUser: function (user) {\n          user.isSelected = !user.isSelected;\n        },\n        cancel: function () {\n          this.isShow = false;\n          options.canceled && options.canceled();\n        },\n        confirm: function () {\n          var userList = this.userList;\n          userList = userList.filter(function (user) {\n            return user.isSelected;\n          });\n          options.confirmed && options.confirmed(userList);\n          this.isShow = false;\n        }\n      },\n      watch: {\n        isShow: function (isShow) {\n          !isShow && removeSelf(this.$el);\n        }\n      }\n    });\n  };\n\n  /* 提示弹框 */\n  var toast = function (options) {\n    options = options || {};\n\n    return utils.mountDialog({\n      name: 'rong-toast-dialog',\n      template: '#rong-template-dialog-toast',\n      data: function () {\n        return {\n          isShow: true,\n          content: options.content\n        };\n      },\n      watch: {\n        isShow: function (isShow) {\n          !isShow && removeSelf(this.$el);\n        }\n      },\n      mounted: function () {\n        var context = this;\n        setTimeout(function () {\n          if (context.isShow) {\n            context.isShow = false;\n            options && options.onDestoryed();\n          }\n        }, options.destroyTimeout || 5000);\n      }\n    });\n  };\n\n  RongCall.dialog = {\n    selectUser: selectUser,\n    toast: toast\n  };\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web/js/login.js",
    "content": "(function (RongCall, dependencies) {\n  /* 登录逻辑 */\n\n  var win = dependencies.win,\n    Vue = win.Vue;\n  var utils = RongCall.utils,\n    setting = RongCall.setting;\n\n  function toInfoPage(data) {\n    var instance = RongCall.instance;\n    instance.$router.push({\n      name: 'call',\n      params: data\n    });\n  }\n\n  RongCall.login = Vue.component('login', {\n    template: '#rong-template-login',\n    data: function () {\n      return {\n        userId: ''\n      };\n    },\n    methods: {\n      login: function () {\n        var userId = this.userId;\n        var loginDetail\n        utils.login(userId).then(function (result) {\n          setting.token = result.token;\n          loginDetail = result;\n          return RongCall.initIM(setting);\n        }).then(function () {\n          RongCall.instance.auth = loginDetail;\n          toInfoPage(loginDetail);\n        }).catch(function () {\n          win.alert('登录失败, 请检查 CallLib Demo Server 是否启动');\n        });\n      }\n    }\n  });\n\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web/js/main.js",
    "content": "(function (RongCall, dependencies) {\n  'use strict';\n\n  var Vue = dependencies.Vue,\n    VueRouter = dependencies.VueRouter;\n\n  function getRouter() {\n    var router = new VueRouter({\n      routes: [\n        {\n          path: '/login',\n          name: 'login',\n          component: RongCall.login\n        },\n        {\n          path: '/call',\n          name: 'call',\n          component: RongCall.call\n        },\n        {\n          path: '*',\n          redirect: '/login'\n        }\n      ]\n    });\n    router.beforeEach(function (to, from, next) {\n      var ignoreAuthRoutes = ['login'];\n      var toName = to.name;\n      var instance = RongCall.instance || {};\n      var auth = instance.auth;\n      if (ignoreAuthRoutes.indexOf(toName) === -1 && !auth) {\n        return next({ name: 'login' });\n      }\n      next();\n    });\n    return router;\n  }\n\n  function init(config) {\n    RongCall.instance = new Vue({\n      el: config.el,\n      router: getRouter()\n    });\n  }\n\n  RongCall.init = init;\n\n})(window.RongCall, {\n  win: window,\n  Vue: window.Vue,\n  VueRouter: window.VueRouter\n});"
  },
  {
    "path": "calllib-v3/web/lib/vue-2.6.7.js",
    "content": "/*!\n * Vue.js v2.6.7\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global = global || self, global.Vue = factory());\n}(this, function () { 'use strict';\n\n  /*  */\n\n  var emptyObject = Object.freeze({});\n\n  // These helpers produce better VM code in JS engines due to their\n  // explicitness and function inlining.\n  function isUndef (v) {\n    return v === undefined || v === null\n  }\n\n  function isDef (v) {\n    return v !== undefined && v !== null\n  }\n\n  function isTrue (v) {\n    return v === true\n  }\n\n  function isFalse (v) {\n    return v === false\n  }\n\n  /**\n   * Check if value is primitive.\n   */\n  function isPrimitive (value) {\n    return (\n      typeof value === 'string' ||\n      typeof value === 'number' ||\n      // $flow-disable-line\n      typeof value === 'symbol' ||\n      typeof value === 'boolean'\n    )\n  }\n\n  /**\n   * Quick object check - this is primarily used to tell\n   * Objects from primitive values when we know the value\n   * is a JSON-compliant type.\n   */\n  function isObject (obj) {\n    return obj !== null && typeof obj === 'object'\n  }\n\n  /**\n   * Get the raw type string of a value, e.g., [object Object].\n   */\n  var _toString = Object.prototype.toString;\n\n  function toRawType (value) {\n    return _toString.call(value).slice(8, -1)\n  }\n\n  /**\n   * Strict object type check. Only returns true\n   * for plain JavaScript objects.\n   */\n  function isPlainObject (obj) {\n    return _toString.call(obj) === '[object Object]'\n  }\n\n  function isRegExp (v) {\n    return _toString.call(v) === '[object RegExp]'\n  }\n\n  /**\n   * Check if val is a valid array index.\n   */\n  function isValidArrayIndex (val) {\n    var n = parseFloat(String(val));\n    return n >= 0 && Math.floor(n) === n && isFinite(val)\n  }\n\n  function isPromise (val) {\n    return (\n      isDef(val) &&\n      typeof val.then === 'function' &&\n      typeof val.catch === 'function'\n    )\n  }\n\n  /**\n   * Convert a value to a string that is actually rendered.\n   */\n  function toString (val) {\n    return val == null\n      ? ''\n      : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n        ? JSON.stringify(val, null, 2)\n        : String(val)\n  }\n\n  /**\n   * Convert an input value to a number for persistence.\n   * If the conversion fails, return original string.\n   */\n  function toNumber (val) {\n    var n = parseFloat(val);\n    return isNaN(n) ? val : n\n  }\n\n  /**\n   * Make a map and return a function for checking if a key\n   * is in that map.\n   */\n  function makeMap (\n    str,\n    expectsLowerCase\n  ) {\n    var map = Object.create(null);\n    var list = str.split(',');\n    for (var i = 0; i < list.length; i++) {\n      map[list[i]] = true;\n    }\n    return expectsLowerCase\n      ? function (val) { return map[val.toLowerCase()]; }\n      : function (val) { return map[val]; }\n  }\n\n  /**\n   * Check if a tag is a built-in tag.\n   */\n  var isBuiltInTag = makeMap('slot,component', true);\n\n  /**\n   * Check if an attribute is a reserved attribute.\n   */\n  var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n\n  /**\n   * Remove an item from an array.\n   */\n  function remove (arr, item) {\n    if (arr.length) {\n      var index = arr.indexOf(item);\n      if (index > -1) {\n        return arr.splice(index, 1)\n      }\n    }\n  }\n\n  /**\n   * Check whether an object has the property.\n   */\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n  function hasOwn (obj, key) {\n    return hasOwnProperty.call(obj, key)\n  }\n\n  /**\n   * Create a cached version of a pure function.\n   */\n  function cached (fn) {\n    var cache = Object.create(null);\n    return (function cachedFn (str) {\n      var hit = cache[str];\n      return hit || (cache[str] = fn(str))\n    })\n  }\n\n  /**\n   * Camelize a hyphen-delimited string.\n   */\n  var camelizeRE = /-(\\w)/g;\n  var camelize = cached(function (str) {\n    return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n  });\n\n  /**\n   * Capitalize a string.\n   */\n  var capitalize = cached(function (str) {\n    return str.charAt(0).toUpperCase() + str.slice(1)\n  });\n\n  /**\n   * Hyphenate a camelCase string.\n   */\n  var hyphenateRE = /\\B([A-Z])/g;\n  var hyphenate = cached(function (str) {\n    return str.replace(hyphenateRE, '-$1').toLowerCase()\n  });\n\n  /**\n   * Simple bind polyfill for environments that do not support it,\n   * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n   * since native bind is now performant enough in most browsers.\n   * But removing it would mean breaking code that was able to run in\n   * PhantomJS 1.x, so this must be kept for backward compatibility.\n   */\n\n  /* istanbul ignore next */\n  function polyfillBind (fn, ctx) {\n    function boundFn (a) {\n      var l = arguments.length;\n      return l\n        ? l > 1\n          ? fn.apply(ctx, arguments)\n          : fn.call(ctx, a)\n        : fn.call(ctx)\n    }\n\n    boundFn._length = fn.length;\n    return boundFn\n  }\n\n  function nativeBind (fn, ctx) {\n    return fn.bind(ctx)\n  }\n\n  var bind = Function.prototype.bind\n    ? nativeBind\n    : polyfillBind;\n\n  /**\n   * Convert an Array-like object to a real Array.\n   */\n  function toArray (list, start) {\n    start = start || 0;\n    var i = list.length - start;\n    var ret = new Array(i);\n    while (i--) {\n      ret[i] = list[i + start];\n    }\n    return ret\n  }\n\n  /**\n   * Mix properties into target object.\n   */\n  function extend (to, _from) {\n    for (var key in _from) {\n      to[key] = _from[key];\n    }\n    return to\n  }\n\n  /**\n   * Merge an Array of Objects into a single Object.\n   */\n  function toObject (arr) {\n    var res = {};\n    for (var i = 0; i < arr.length; i++) {\n      if (arr[i]) {\n        extend(res, arr[i]);\n      }\n    }\n    return res\n  }\n\n  /* eslint-disable no-unused-vars */\n\n  /**\n   * Perform no operation.\n   * Stubbing args to make Flow happy without leaving useless transpiled code\n   * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n   */\n  function noop (a, b, c) {}\n\n  /**\n   * Always return false.\n   */\n  var no = function (a, b, c) { return false; };\n\n  /* eslint-enable no-unused-vars */\n\n  /**\n   * Return the same value.\n   */\n  var identity = function (_) { return _; };\n\n  /**\n   * Generate a string containing static keys from compiler modules.\n   */\n  function genStaticKeys (modules) {\n    return modules.reduce(function (keys, m) {\n      return keys.concat(m.staticKeys || [])\n    }, []).join(',')\n  }\n\n  /**\n   * Check if two values are loosely equal - that is,\n   * if they are plain objects, do they have the same shape?\n   */\n  function looseEqual (a, b) {\n    if (a === b) { return true }\n    var isObjectA = isObject(a);\n    var isObjectB = isObject(b);\n    if (isObjectA && isObjectB) {\n      try {\n        var isArrayA = Array.isArray(a);\n        var isArrayB = Array.isArray(b);\n        if (isArrayA && isArrayB) {\n          return a.length === b.length && a.every(function (e, i) {\n            return looseEqual(e, b[i])\n          })\n        } else if (a instanceof Date && b instanceof Date) {\n          return a.getTime() === b.getTime()\n        } else if (!isArrayA && !isArrayB) {\n          var keysA = Object.keys(a);\n          var keysB = Object.keys(b);\n          return keysA.length === keysB.length && keysA.every(function (key) {\n            return looseEqual(a[key], b[key])\n          })\n        } else {\n          /* istanbul ignore next */\n          return false\n        }\n      } catch (e) {\n        /* istanbul ignore next */\n        return false\n      }\n    } else if (!isObjectA && !isObjectB) {\n      return String(a) === String(b)\n    } else {\n      return false\n    }\n  }\n\n  /**\n   * Return the first index at which a loosely equal value can be\n   * found in the array (if value is a plain object, the array must\n   * contain an object of the same shape), or -1 if it is not present.\n   */\n  function looseIndexOf (arr, val) {\n    for (var i = 0; i < arr.length; i++) {\n      if (looseEqual(arr[i], val)) { return i }\n    }\n    return -1\n  }\n\n  /**\n   * Ensure a function is called only once.\n   */\n  function once (fn) {\n    var called = false;\n    return function () {\n      if (!called) {\n        called = true;\n        fn.apply(this, arguments);\n      }\n    }\n  }\n\n  var SSR_ATTR = 'data-server-rendered';\n\n  var ASSET_TYPES = [\n    'component',\n    'directive',\n    'filter'\n  ];\n\n  var LIFECYCLE_HOOKS = [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated',\n    'errorCaptured',\n    'serverPrefetch'\n  ];\n\n  /*  */\n\n\n\n  var config = ({\n    /**\n     * Option merge strategies (used in core/util/options)\n     */\n    // $flow-disable-line\n    optionMergeStrategies: Object.create(null),\n\n    /**\n     * Whether to suppress warnings.\n     */\n    silent: false,\n\n    /**\n     * Show production mode tip message on boot?\n     */\n    productionTip: \"development\" !== 'production',\n\n    /**\n     * Whether to enable devtools\n     */\n    devtools: \"development\" !== 'production',\n\n    /**\n     * Whether to record perf\n     */\n    performance: false,\n\n    /**\n     * Error handler for watcher errors\n     */\n    errorHandler: null,\n\n    /**\n     * Warn handler for watcher warns\n     */\n    warnHandler: null,\n\n    /**\n     * Ignore certain custom elements\n     */\n    ignoredElements: [],\n\n    /**\n     * Custom user key aliases for v-on\n     */\n    // $flow-disable-line\n    keyCodes: Object.create(null),\n\n    /**\n     * Check if a tag is reserved so that it cannot be registered as a\n     * component. This is platform-dependent and may be overwritten.\n     */\n    isReservedTag: no,\n\n    /**\n     * Check if an attribute is reserved so that it cannot be used as a component\n     * prop. This is platform-dependent and may be overwritten.\n     */\n    isReservedAttr: no,\n\n    /**\n     * Check if a tag is an unknown element.\n     * Platform-dependent.\n     */\n    isUnknownElement: no,\n\n    /**\n     * Get the namespace of an element\n     */\n    getTagNamespace: noop,\n\n    /**\n     * Parse the real tag name for the specific platform.\n     */\n    parsePlatformTagName: identity,\n\n    /**\n     * Check if an attribute must be bound using property, e.g. value\n     * Platform-dependent.\n     */\n    mustUseProp: no,\n\n    /**\n     * Perform updates asynchronously. Intended to be used by Vue Test Utils\n     * This will significantly reduce performance if set to false.\n     */\n    async: true,\n\n    /**\n     * Exposed for legacy reasons\n     */\n    _lifecycleHooks: LIFECYCLE_HOOKS\n  });\n\n  /*  */\n\n  /**\n   * unicode letters used for parsing html tags, component names and property paths.\n   * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n   * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n   */\n  var unicodeLetters = 'a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';\n\n  /**\n   * Check if a string starts with $ or _\n   */\n  function isReserved (str) {\n    var c = (str + '').charCodeAt(0);\n    return c === 0x24 || c === 0x5F\n  }\n\n  /**\n   * Define a property.\n   */\n  function def (obj, key, val, enumerable) {\n    Object.defineProperty(obj, key, {\n      value: val,\n      enumerable: !!enumerable,\n      writable: true,\n      configurable: true\n    });\n  }\n\n  /**\n   * Parse simple path.\n   */\n  var bailRE = new RegExp((\"[^\" + unicodeLetters + \".$_\\\\d]\"));\n  function parsePath (path) {\n    if (bailRE.test(path)) {\n      return\n    }\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n\n  /*  */\n\n  // can we use __proto__?\n  var hasProto = '__proto__' in {};\n\n  // Browser environment sniffing\n  var inBrowser = typeof window !== 'undefined';\n  var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;\n  var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();\n  var UA = inBrowser && window.navigator.userAgent.toLowerCase();\n  var isIE = UA && /msie|trident/.test(UA);\n  var isIE9 = UA && UA.indexOf('msie 9.0') > 0;\n  var isEdge = UA && UA.indexOf('edge/') > 0;\n  var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');\n  var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');\n  var isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge;\n  var isPhantomJS = UA && /phantomjs/.test(UA);\n  var isFF = UA && UA.match(/firefox\\/(\\d+)/);\n\n  // Firefox has a \"watch\" function on Object.prototype...\n  var nativeWatch = ({}).watch;\n\n  var supportsPassive = false;\n  if (inBrowser) {\n    try {\n      var opts = {};\n      Object.defineProperty(opts, 'passive', ({\n        get: function get () {\n          /* istanbul ignore next */\n          supportsPassive = true;\n        }\n      })); // https://github.com/facebook/flow/issues/285\n      window.addEventListener('test-passive', null, opts);\n    } catch (e) {}\n  }\n\n  // this needs to be lazy-evaled because vue may be required before\n  // vue-server-renderer can set VUE_ENV\n  var _isServer;\n  var isServerRendering = function () {\n    if (_isServer === undefined) {\n      /* istanbul ignore if */\n      if (!inBrowser && !inWeex && typeof global !== 'undefined') {\n        // detect presence of vue-server-renderer and avoid\n        // Webpack shimming the process\n        _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';\n      } else {\n        _isServer = false;\n      }\n    }\n    return _isServer\n  };\n\n  // detect devtools\n  var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n  /* istanbul ignore next */\n  function isNative (Ctor) {\n    return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n  }\n\n  var hasSymbol =\n    typeof Symbol !== 'undefined' && isNative(Symbol) &&\n    typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);\n\n  var _Set;\n  /* istanbul ignore if */ // $flow-disable-line\n  if (typeof Set !== 'undefined' && isNative(Set)) {\n    // use native Set when available.\n    _Set = Set;\n  } else {\n    // a non-standard Set polyfill that only works with primitive keys.\n    _Set = /*@__PURE__*/(function () {\n      function Set () {\n        this.set = Object.create(null);\n      }\n      Set.prototype.has = function has (key) {\n        return this.set[key] === true\n      };\n      Set.prototype.add = function add (key) {\n        this.set[key] = true;\n      };\n      Set.prototype.clear = function clear () {\n        this.set = Object.create(null);\n      };\n\n      return Set;\n    }());\n  }\n\n  /*  */\n\n  var warn = noop;\n  var tip = noop;\n  var generateComponentTrace = (noop); // work around flow check\n  var formatComponentName = (noop);\n\n  {\n    var hasConsole = typeof console !== 'undefined';\n    var classifyRE = /(?:^|[-_])(\\w)/g;\n    var classify = function (str) { return str\n      .replace(classifyRE, function (c) { return c.toUpperCase(); })\n      .replace(/[-_]/g, ''); };\n\n    warn = function (msg, vm) {\n      var trace = vm ? generateComponentTrace(vm) : '';\n\n      if (config.warnHandler) {\n        config.warnHandler.call(null, msg, vm, trace);\n      } else if (hasConsole && (!config.silent)) {\n        console.error((\"[Vue warn]: \" + msg + trace));\n      }\n    };\n\n    tip = function (msg, vm) {\n      if (hasConsole && (!config.silent)) {\n        console.warn(\"[Vue tip]: \" + msg + (\n          vm ? generateComponentTrace(vm) : ''\n        ));\n      }\n    };\n\n    formatComponentName = function (vm, includeFile) {\n      if (vm.$root === vm) {\n        return '<Root>'\n      }\n      var options = typeof vm === 'function' && vm.cid != null\n        ? vm.options\n        : vm._isVue\n          ? vm.$options || vm.constructor.options\n          : vm;\n      var name = options.name || options._componentTag;\n      var file = options.__file;\n      if (!name && file) {\n        var match = file.match(/([^/\\\\]+)\\.vue$/);\n        name = match && match[1];\n      }\n\n      return (\n        (name ? (\"<\" + (classify(name)) + \">\") : \"<Anonymous>\") +\n        (file && includeFile !== false ? (\" at \" + file) : '')\n      )\n    };\n\n    var repeat = function (str, n) {\n      var res = '';\n      while (n) {\n        if (n % 2 === 1) { res += str; }\n        if (n > 1) { str += str; }\n        n >>= 1;\n      }\n      return res\n    };\n\n    generateComponentTrace = function (vm) {\n      if (vm._isVue && vm.$parent) {\n        var tree = [];\n        var currentRecursiveSequence = 0;\n        while (vm) {\n          if (tree.length > 0) {\n            var last = tree[tree.length - 1];\n            if (last.constructor === vm.constructor) {\n              currentRecursiveSequence++;\n              vm = vm.$parent;\n              continue\n            } else if (currentRecursiveSequence > 0) {\n              tree[tree.length - 1] = [last, currentRecursiveSequence];\n              currentRecursiveSequence = 0;\n            }\n          }\n          tree.push(vm);\n          vm = vm.$parent;\n        }\n        return '\\n\\nfound in\\n\\n' + tree\n          .map(function (vm, i) { return (\"\" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n              ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n              : formatComponentName(vm))); })\n          .join('\\n')\n      } else {\n        return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n      }\n    };\n  }\n\n  /*  */\n\n  var uid = 0;\n\n  /**\n   * A dep is an observable that can have multiple\n   * directives subscribing to it.\n   */\n  var Dep = function Dep () {\n    this.id = uid++;\n    this.subs = [];\n  };\n\n  Dep.prototype.addSub = function addSub (sub) {\n    this.subs.push(sub);\n  };\n\n  Dep.prototype.removeSub = function removeSub (sub) {\n    remove(this.subs, sub);\n  };\n\n  Dep.prototype.depend = function depend () {\n    if (Dep.target) {\n      Dep.target.addDep(this);\n    }\n  };\n\n  Dep.prototype.notify = function notify () {\n    // stabilize the subscriber list first\n    var subs = this.subs.slice();\n    if (!config.async) {\n      // subs aren't sorted in scheduler if not running async\n      // we need to sort them now to make sure they fire in correct\n      // order\n      subs.sort(function (a, b) { return a.id - b.id; });\n    }\n    for (var i = 0, l = subs.length; i < l; i++) {\n      subs[i].update();\n    }\n  };\n\n  // The current target watcher being evaluated.\n  // This is globally unique because only one watcher\n  // can be evaluated at a time.\n  Dep.target = null;\n  var targetStack = [];\n\n  function pushTarget (target) {\n    targetStack.push(target);\n    Dep.target = target;\n  }\n\n  function popTarget () {\n    targetStack.pop();\n    Dep.target = targetStack[targetStack.length - 1];\n  }\n\n  /*  */\n\n  var VNode = function VNode (\n    tag,\n    data,\n    children,\n    text,\n    elm,\n    context,\n    componentOptions,\n    asyncFactory\n  ) {\n    this.tag = tag;\n    this.data = data;\n    this.children = children;\n    this.text = text;\n    this.elm = elm;\n    this.ns = undefined;\n    this.context = context;\n    this.fnContext = undefined;\n    this.fnOptions = undefined;\n    this.fnScopeId = undefined;\n    this.key = data && data.key;\n    this.componentOptions = componentOptions;\n    this.componentInstance = undefined;\n    this.parent = undefined;\n    this.raw = false;\n    this.isStatic = false;\n    this.isRootInsert = true;\n    this.isComment = false;\n    this.isCloned = false;\n    this.isOnce = false;\n    this.asyncFactory = asyncFactory;\n    this.asyncMeta = undefined;\n    this.isAsyncPlaceholder = false;\n  };\n\n  var prototypeAccessors = { child: { configurable: true } };\n\n  // DEPRECATED: alias for componentInstance for backwards compat.\n  /* istanbul ignore next */\n  prototypeAccessors.child.get = function () {\n    return this.componentInstance\n  };\n\n  Object.defineProperties( VNode.prototype, prototypeAccessors );\n\n  var createEmptyVNode = function (text) {\n    if ( text === void 0 ) text = '';\n\n    var node = new VNode();\n    node.text = text;\n    node.isComment = true;\n    return node\n  };\n\n  function createTextVNode (val) {\n    return new VNode(undefined, undefined, undefined, String(val))\n  }\n\n  // optimized shallow clone\n  // used for static nodes and slot nodes because they may be reused across\n  // multiple renders, cloning them avoids errors when DOM manipulations rely\n  // on their elm reference.\n  function cloneVNode (vnode) {\n    var cloned = new VNode(\n      vnode.tag,\n      vnode.data,\n      // #7975\n      // clone children array to avoid mutating original in case of cloning\n      // a child.\n      vnode.children && vnode.children.slice(),\n      vnode.text,\n      vnode.elm,\n      vnode.context,\n      vnode.componentOptions,\n      vnode.asyncFactory\n    );\n    cloned.ns = vnode.ns;\n    cloned.isStatic = vnode.isStatic;\n    cloned.key = vnode.key;\n    cloned.isComment = vnode.isComment;\n    cloned.fnContext = vnode.fnContext;\n    cloned.fnOptions = vnode.fnOptions;\n    cloned.fnScopeId = vnode.fnScopeId;\n    cloned.asyncMeta = vnode.asyncMeta;\n    cloned.isCloned = true;\n    return cloned\n  }\n\n  /*\n   * not type checking this file because flow doesn't play well with\n   * dynamically accessing methods on Array prototype\n   */\n\n  var arrayProto = Array.prototype;\n  var arrayMethods = Object.create(arrayProto);\n\n  var methodsToPatch = [\n    'push',\n    'pop',\n    'shift',\n    'unshift',\n    'splice',\n    'sort',\n    'reverse'\n  ];\n\n  /**\n   * Intercept mutating methods and emit events\n   */\n  methodsToPatch.forEach(function (method) {\n    // cache original method\n    var original = arrayProto[method];\n    def(arrayMethods, method, function mutator () {\n      var args = [], len = arguments.length;\n      while ( len-- ) args[ len ] = arguments[ len ];\n\n      var result = original.apply(this, args);\n      var ob = this.__ob__;\n      var inserted;\n      switch (method) {\n        case 'push':\n        case 'unshift':\n          inserted = args;\n          break\n        case 'splice':\n          inserted = args.slice(2);\n          break\n      }\n      if (inserted) { ob.observeArray(inserted); }\n      // notify change\n      ob.dep.notify();\n      return result\n    });\n  });\n\n  /*  */\n\n  var arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n  /**\n   * In some cases we may want to disable observation inside a component's\n   * update computation.\n   */\n  var shouldObserve = true;\n\n  function toggleObserving (value) {\n    shouldObserve = value;\n  }\n\n  /**\n   * Observer class that is attached to each observed\n   * object. Once attached, the observer converts the target\n   * object's property keys into getter/setters that\n   * collect dependencies and dispatch updates.\n   */\n  var Observer = function Observer (value) {\n    this.value = value;\n    this.dep = new Dep();\n    this.vmCount = 0;\n    def(value, '__ob__', this);\n    if (Array.isArray(value)) {\n      if (hasProto) {\n        protoAugment(value, arrayMethods);\n      } else {\n        copyAugment(value, arrayMethods, arrayKeys);\n      }\n      this.observeArray(value);\n    } else {\n      this.walk(value);\n    }\n  };\n\n  /**\n   * Walk through all properties and convert them into\n   * getter/setters. This method should only be called when\n   * value type is Object.\n   */\n  Observer.prototype.walk = function walk (obj) {\n    var keys = Object.keys(obj);\n    for (var i = 0; i < keys.length; i++) {\n      defineReactive$$1(obj, keys[i]);\n    }\n  };\n\n  /**\n   * Observe a list of Array items.\n   */\n  Observer.prototype.observeArray = function observeArray (items) {\n    for (var i = 0, l = items.length; i < l; i++) {\n      observe(items[i]);\n    }\n  };\n\n  // helpers\n\n  /**\n   * Augment a target Object or Array by intercepting\n   * the prototype chain using __proto__\n   */\n  function protoAugment (target, src) {\n    /* eslint-disable no-proto */\n    target.__proto__ = src;\n    /* eslint-enable no-proto */\n  }\n\n  /**\n   * Augment a target Object or Array by defining\n   * hidden properties.\n   */\n  /* istanbul ignore next */\n  function copyAugment (target, src, keys) {\n    for (var i = 0, l = keys.length; i < l; i++) {\n      var key = keys[i];\n      def(target, key, src[key]);\n    }\n  }\n\n  /**\n   * Attempt to create an observer instance for a value,\n   * returns the new observer if successfully observed,\n   * or the existing observer if the value already has one.\n   */\n  function observe (value, asRootData) {\n    if (!isObject(value) || value instanceof VNode) {\n      return\n    }\n    var ob;\n    if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n      ob = value.__ob__;\n    } else if (\n      shouldObserve &&\n      !isServerRendering() &&\n      (Array.isArray(value) || isPlainObject(value)) &&\n      Object.isExtensible(value) &&\n      !value._isVue\n    ) {\n      ob = new Observer(value);\n    }\n    if (asRootData && ob) {\n      ob.vmCount++;\n    }\n    return ob\n  }\n\n  /**\n   * Define a reactive property on an Object.\n   */\n  function defineReactive$$1 (\n    obj,\n    key,\n    val,\n    customSetter,\n    shallow\n  ) {\n    var dep = new Dep();\n\n    var property = Object.getOwnPropertyDescriptor(obj, key);\n    if (property && property.configurable === false) {\n      return\n    }\n\n    // cater for pre-defined getter/setters\n    var getter = property && property.get;\n    var setter = property && property.set;\n    if ((!getter || setter) && arguments.length === 2) {\n      val = obj[key];\n    }\n\n    var childOb = !shallow && observe(val);\n    Object.defineProperty(obj, key, {\n      enumerable: true,\n      configurable: true,\n      get: function reactiveGetter () {\n        var value = getter ? getter.call(obj) : val;\n        if (Dep.target) {\n          dep.depend();\n          if (childOb) {\n            childOb.dep.depend();\n            if (Array.isArray(value)) {\n              dependArray(value);\n            }\n          }\n        }\n        return value\n      },\n      set: function reactiveSetter (newVal) {\n        var value = getter ? getter.call(obj) : val;\n        /* eslint-disable no-self-compare */\n        if (newVal === value || (newVal !== newVal && value !== value)) {\n          return\n        }\n        /* eslint-enable no-self-compare */\n        if (customSetter) {\n          customSetter();\n        }\n        // #7981: for accessor properties without setter\n        if (getter && !setter) { return }\n        if (setter) {\n          setter.call(obj, newVal);\n        } else {\n          val = newVal;\n        }\n        childOb = !shallow && observe(newVal);\n        dep.notify();\n      }\n    });\n  }\n\n  /**\n   * Set a property on an object. Adds the new property and\n   * triggers change notification if the property doesn't\n   * already exist.\n   */\n  function set (target, key, val) {\n    if (isUndef(target) || isPrimitive(target)\n    ) {\n      warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n    }\n    if (Array.isArray(target) && isValidArrayIndex(key)) {\n      target.length = Math.max(target.length, key);\n      target.splice(key, 1, val);\n      return val\n    }\n    if (key in target && !(key in Object.prototype)) {\n      target[key] = val;\n      return val\n    }\n    var ob = (target).__ob__;\n    if (target._isVue || (ob && ob.vmCount)) {\n      warn(\n        'Avoid adding reactive properties to a Vue instance or its root $data ' +\n        'at runtime - declare it upfront in the data option.'\n      );\n      return val\n    }\n    if (!ob) {\n      target[key] = val;\n      return val\n    }\n    defineReactive$$1(ob.value, key, val);\n    ob.dep.notify();\n    return val\n  }\n\n  /**\n   * Delete a property and trigger change if necessary.\n   */\n  function del (target, key) {\n    if (isUndef(target) || isPrimitive(target)\n    ) {\n      warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n    }\n    if (Array.isArray(target) && isValidArrayIndex(key)) {\n      target.splice(key, 1);\n      return\n    }\n    var ob = (target).__ob__;\n    if (target._isVue || (ob && ob.vmCount)) {\n      warn(\n        'Avoid deleting properties on a Vue instance or its root $data ' +\n        '- just set it to null.'\n      );\n      return\n    }\n    if (!hasOwn(target, key)) {\n      return\n    }\n    delete target[key];\n    if (!ob) {\n      return\n    }\n    ob.dep.notify();\n  }\n\n  /**\n   * Collect dependencies on array elements when the array is touched, since\n   * we cannot intercept array element access like property getters.\n   */\n  function dependArray (value) {\n    for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n      e = value[i];\n      e && e.__ob__ && e.__ob__.dep.depend();\n      if (Array.isArray(e)) {\n        dependArray(e);\n      }\n    }\n  }\n\n  /*  */\n\n  /**\n   * Option overwriting strategies are functions that handle\n   * how to merge a parent option value and a child option\n   * value into the final value.\n   */\n  var strats = config.optionMergeStrategies;\n\n  /**\n   * Options with restrictions\n   */\n  {\n    strats.el = strats.propsData = function (parent, child, vm, key) {\n      if (!vm) {\n        warn(\n          \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n          'creation with the `new` keyword.'\n        );\n      }\n      return defaultStrat(parent, child)\n    };\n  }\n\n  /**\n   * Helper that recursively merges two data objects together.\n   */\n  function mergeData (to, from) {\n    if (!from) { return to }\n    var key, toVal, fromVal;\n\n    var keys = hasSymbol\n      ? Reflect.ownKeys(from)\n      : Object.keys(from);\n\n    for (var i = 0; i < keys.length; i++) {\n      key = keys[i];\n      // in case the object is already observed...\n      if (key === '__ob__') { continue }\n      toVal = to[key];\n      fromVal = from[key];\n      if (!hasOwn(to, key)) {\n        set(to, key, fromVal);\n      } else if (\n        toVal !== fromVal &&\n        isPlainObject(toVal) &&\n        isPlainObject(fromVal)\n      ) {\n        mergeData(toVal, fromVal);\n      }\n    }\n    return to\n  }\n\n  /**\n   * Data\n   */\n  function mergeDataOrFn (\n    parentVal,\n    childVal,\n    vm\n  ) {\n    if (!vm) {\n      // in a Vue.extend merge, both should be functions\n      if (!childVal) {\n        return parentVal\n      }\n      if (!parentVal) {\n        return childVal\n      }\n      // when parentVal & childVal are both present,\n      // we need to return a function that returns the\n      // merged result of both functions... no need to\n      // check if parentVal is a function here because\n      // it has to be a function to pass previous merges.\n      return function mergedDataFn () {\n        return mergeData(\n          typeof childVal === 'function' ? childVal.call(this, this) : childVal,\n          typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal\n        )\n      }\n    } else {\n      return function mergedInstanceDataFn () {\n        // instance merge\n        var instanceData = typeof childVal === 'function'\n          ? childVal.call(vm, vm)\n          : childVal;\n        var defaultData = typeof parentVal === 'function'\n          ? parentVal.call(vm, vm)\n          : parentVal;\n        if (instanceData) {\n          return mergeData(instanceData, defaultData)\n        } else {\n          return defaultData\n        }\n      }\n    }\n  }\n\n  strats.data = function (\n    parentVal,\n    childVal,\n    vm\n  ) {\n    if (!vm) {\n      if (childVal && typeof childVal !== 'function') {\n        warn(\n          'The \"data\" option should be a function ' +\n          'that returns a per-instance value in component ' +\n          'definitions.',\n          vm\n        );\n\n        return parentVal\n      }\n      return mergeDataOrFn(parentVal, childVal)\n    }\n\n    return mergeDataOrFn(parentVal, childVal, vm)\n  };\n\n  /**\n   * Hooks and props are merged as arrays.\n   */\n  function mergeHook (\n    parentVal,\n    childVal\n  ) {\n    var res = childVal\n      ? parentVal\n        ? parentVal.concat(childVal)\n        : Array.isArray(childVal)\n          ? childVal\n          : [childVal]\n      : parentVal;\n    return res\n      ? dedupeHooks(res)\n      : res\n  }\n\n  function dedupeHooks (hooks) {\n    var res = [];\n    for (var i = 0; i < hooks.length; i++) {\n      if (res.indexOf(hooks[i]) === -1) {\n        res.push(hooks[i]);\n      }\n    }\n    return res\n  }\n\n  LIFECYCLE_HOOKS.forEach(function (hook) {\n    strats[hook] = mergeHook;\n  });\n\n  /**\n   * Assets\n   *\n   * When a vm is present (instance creation), we need to do\n   * a three-way merge between constructor options, instance\n   * options and parent options.\n   */\n  function mergeAssets (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    var res = Object.create(parentVal || null);\n    if (childVal) {\n      assertObjectType(key, childVal, vm);\n      return extend(res, childVal)\n    } else {\n      return res\n    }\n  }\n\n  ASSET_TYPES.forEach(function (type) {\n    strats[type + 's'] = mergeAssets;\n  });\n\n  /**\n   * Watchers.\n   *\n   * Watchers hashes should not overwrite one\n   * another, so we merge them as arrays.\n   */\n  strats.watch = function (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    // work around Firefox's Object.prototype.watch...\n    if (parentVal === nativeWatch) { parentVal = undefined; }\n    if (childVal === nativeWatch) { childVal = undefined; }\n    /* istanbul ignore if */\n    if (!childVal) { return Object.create(parentVal || null) }\n    {\n      assertObjectType(key, childVal, vm);\n    }\n    if (!parentVal) { return childVal }\n    var ret = {};\n    extend(ret, parentVal);\n    for (var key$1 in childVal) {\n      var parent = ret[key$1];\n      var child = childVal[key$1];\n      if (parent && !Array.isArray(parent)) {\n        parent = [parent];\n      }\n      ret[key$1] = parent\n        ? parent.concat(child)\n        : Array.isArray(child) ? child : [child];\n    }\n    return ret\n  };\n\n  /**\n   * Other object hashes.\n   */\n  strats.props =\n  strats.methods =\n  strats.inject =\n  strats.computed = function (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    if (childVal && \"development\" !== 'production') {\n      assertObjectType(key, childVal, vm);\n    }\n    if (!parentVal) { return childVal }\n    var ret = Object.create(null);\n    extend(ret, parentVal);\n    if (childVal) { extend(ret, childVal); }\n    return ret\n  };\n  strats.provide = mergeDataOrFn;\n\n  /**\n   * Default strategy.\n   */\n  var defaultStrat = function (parentVal, childVal) {\n    return childVal === undefined\n      ? parentVal\n      : childVal\n  };\n\n  /**\n   * Validate component names\n   */\n  function checkComponents (options) {\n    for (var key in options.components) {\n      validateComponentName(key);\n    }\n  }\n\n  function validateComponentName (name) {\n    if (!new RegExp((\"^[a-zA-Z][\\\\-\\\\.0-9_\" + unicodeLetters + \"]*$\")).test(name)) {\n      warn(\n        'Invalid component name: \"' + name + '\". Component names ' +\n        'should conform to valid custom element name in html5 specification.'\n      );\n    }\n    if (isBuiltInTag(name) || config.isReservedTag(name)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + name\n      );\n    }\n  }\n\n  /**\n   * Ensure all props option syntax are normalized into the\n   * Object-based format.\n   */\n  function normalizeProps (options, vm) {\n    var props = options.props;\n    if (!props) { return }\n    var res = {};\n    var i, val, name;\n    if (Array.isArray(props)) {\n      i = props.length;\n      while (i--) {\n        val = props[i];\n        if (typeof val === 'string') {\n          name = camelize(val);\n          res[name] = { type: null };\n        } else {\n          warn('props must be strings when using array syntax.');\n        }\n      }\n    } else if (isPlainObject(props)) {\n      for (var key in props) {\n        val = props[key];\n        name = camelize(key);\n        res[name] = isPlainObject(val)\n          ? val\n          : { type: val };\n      }\n    } else {\n      warn(\n        \"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\n        \"but got \" + (toRawType(props)) + \".\",\n        vm\n      );\n    }\n    options.props = res;\n  }\n\n  /**\n   * Normalize all injections into Object-based format\n   */\n  function normalizeInject (options, vm) {\n    var inject = options.inject;\n    if (!inject) { return }\n    var normalized = options.inject = {};\n    if (Array.isArray(inject)) {\n      for (var i = 0; i < inject.length; i++) {\n        normalized[inject[i]] = { from: inject[i] };\n      }\n    } else if (isPlainObject(inject)) {\n      for (var key in inject) {\n        var val = inject[key];\n        normalized[key] = isPlainObject(val)\n          ? extend({ from: key }, val)\n          : { from: val };\n      }\n    } else {\n      warn(\n        \"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\n        \"but got \" + (toRawType(inject)) + \".\",\n        vm\n      );\n    }\n  }\n\n  /**\n   * Normalize raw function directives into object format.\n   */\n  function normalizeDirectives (options) {\n    var dirs = options.directives;\n    if (dirs) {\n      for (var key in dirs) {\n        var def$$1 = dirs[key];\n        if (typeof def$$1 === 'function') {\n          dirs[key] = { bind: def$$1, update: def$$1 };\n        }\n      }\n    }\n  }\n\n  function assertObjectType (name, value, vm) {\n    if (!isPlainObject(value)) {\n      warn(\n        \"Invalid value for option \\\"\" + name + \"\\\": expected an Object, \" +\n        \"but got \" + (toRawType(value)) + \".\",\n        vm\n      );\n    }\n  }\n\n  /**\n   * Merge two option objects into a new one.\n   * Core utility used in both instantiation and inheritance.\n   */\n  function mergeOptions (\n    parent,\n    child,\n    vm\n  ) {\n    {\n      checkComponents(child);\n    }\n\n    if (typeof child === 'function') {\n      child = child.options;\n    }\n\n    normalizeProps(child, vm);\n    normalizeInject(child, vm);\n    normalizeDirectives(child);\n\n    // Apply extends and mixins on the child options,\n    // but only if it is a raw options object that isn't\n    // the result of another mergeOptions call.\n    // Only merged options has the _base property.\n    if (!child._base) {\n      if (child.extends) {\n        parent = mergeOptions(parent, child.extends, vm);\n      }\n      if (child.mixins) {\n        for (var i = 0, l = child.mixins.length; i < l; i++) {\n          parent = mergeOptions(parent, child.mixins[i], vm);\n        }\n      }\n    }\n\n    var options = {};\n    var key;\n    for (key in parent) {\n      mergeField(key);\n    }\n    for (key in child) {\n      if (!hasOwn(parent, key)) {\n        mergeField(key);\n      }\n    }\n    function mergeField (key) {\n      var strat = strats[key] || defaultStrat;\n      options[key] = strat(parent[key], child[key], vm, key);\n    }\n    return options\n  }\n\n  /**\n   * Resolve an asset.\n   * This function is used because child instances need access\n   * to assets defined in its ancestor chain.\n   */\n  function resolveAsset (\n    options,\n    type,\n    id,\n    warnMissing\n  ) {\n    /* istanbul ignore if */\n    if (typeof id !== 'string') {\n      return\n    }\n    var assets = options[type];\n    // check local registration variations first\n    if (hasOwn(assets, id)) { return assets[id] }\n    var camelizedId = camelize(id);\n    if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }\n    var PascalCaseId = capitalize(camelizedId);\n    if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }\n    // fallback to prototype chain\n    var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\n    if (warnMissing && !res) {\n      warn(\n        'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n        options\n      );\n    }\n    return res\n  }\n\n  /*  */\n\n\n\n  function validateProp (\n    key,\n    propOptions,\n    propsData,\n    vm\n  ) {\n    var prop = propOptions[key];\n    var absent = !hasOwn(propsData, key);\n    var value = propsData[key];\n    // boolean casting\n    var booleanIndex = getTypeIndex(Boolean, prop.type);\n    if (booleanIndex > -1) {\n      if (absent && !hasOwn(prop, 'default')) {\n        value = false;\n      } else if (value === '' || value === hyphenate(key)) {\n        // only cast empty string / same name to boolean if\n        // boolean has higher priority\n        var stringIndex = getTypeIndex(String, prop.type);\n        if (stringIndex < 0 || booleanIndex < stringIndex) {\n          value = true;\n        }\n      }\n    }\n    // check default value\n    if (value === undefined) {\n      value = getPropDefaultValue(vm, prop, key);\n      // since the default value is a fresh copy,\n      // make sure to observe it.\n      var prevShouldObserve = shouldObserve;\n      toggleObserving(true);\n      observe(value);\n      toggleObserving(prevShouldObserve);\n    }\n    {\n      assertProp(prop, key, value, vm, absent);\n    }\n    return value\n  }\n\n  /**\n   * Get the default value of a prop.\n   */\n  function getPropDefaultValue (vm, prop, key) {\n    // no default, return undefined\n    if (!hasOwn(prop, 'default')) {\n      return undefined\n    }\n    var def = prop.default;\n    // warn against non-factory defaults for Object & Array\n    if (isObject(def)) {\n      warn(\n        'Invalid default value for prop \"' + key + '\": ' +\n        'Props with type Object/Array must use a factory function ' +\n        'to return the default value.',\n        vm\n      );\n    }\n    // the raw prop value was also undefined from previous render,\n    // return previous default value to avoid unnecessary watcher trigger\n    if (vm && vm.$options.propsData &&\n      vm.$options.propsData[key] === undefined &&\n      vm._props[key] !== undefined\n    ) {\n      return vm._props[key]\n    }\n    // call factory function for non-Function types\n    // a value is Function if its prototype is function even across different execution context\n    return typeof def === 'function' && getType(prop.type) !== 'Function'\n      ? def.call(vm)\n      : def\n  }\n\n  /**\n   * Assert whether a prop is valid.\n   */\n  function assertProp (\n    prop,\n    name,\n    value,\n    vm,\n    absent\n  ) {\n    if (prop.required && absent) {\n      warn(\n        'Missing required prop: \"' + name + '\"',\n        vm\n      );\n      return\n    }\n    if (value == null && !prop.required) {\n      return\n    }\n    var type = prop.type;\n    var valid = !type || type === true;\n    var expectedTypes = [];\n    if (type) {\n      if (!Array.isArray(type)) {\n        type = [type];\n      }\n      for (var i = 0; i < type.length && !valid; i++) {\n        var assertedType = assertType(value, type[i]);\n        expectedTypes.push(assertedType.expectedType || '');\n        valid = assertedType.valid;\n      }\n    }\n\n    if (!valid) {\n      warn(\n        getInvalidTypeMessage(name, value, expectedTypes),\n        vm\n      );\n      return\n    }\n    var validator = prop.validator;\n    if (validator) {\n      if (!validator(value)) {\n        warn(\n          'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n          vm\n        );\n      }\n    }\n  }\n\n  var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;\n\n  function assertType (value, type) {\n    var valid;\n    var expectedType = getType(type);\n    if (simpleCheckRE.test(expectedType)) {\n      var t = typeof value;\n      valid = t === expectedType.toLowerCase();\n      // for primitive wrapper objects\n      if (!valid && t === 'object') {\n        valid = value instanceof type;\n      }\n    } else if (expectedType === 'Object') {\n      valid = isPlainObject(value);\n    } else if (expectedType === 'Array') {\n      valid = Array.isArray(value);\n    } else {\n      valid = value instanceof type;\n    }\n    return {\n      valid: valid,\n      expectedType: expectedType\n    }\n  }\n\n  /**\n   * Use function string name to check built-in types,\n   * because a simple equality check will fail when running\n   * across different vms / iframes.\n   */\n  function getType (fn) {\n    var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n    return match ? match[1] : ''\n  }\n\n  function isSameType (a, b) {\n    return getType(a) === getType(b)\n  }\n\n  function getTypeIndex (type, expectedTypes) {\n    if (!Array.isArray(expectedTypes)) {\n      return isSameType(expectedTypes, type) ? 0 : -1\n    }\n    for (var i = 0, len = expectedTypes.length; i < len; i++) {\n      if (isSameType(expectedTypes[i], type)) {\n        return i\n      }\n    }\n    return -1\n  }\n\n  function getInvalidTypeMessage (name, value, expectedTypes) {\n    var message = \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n      \" Expected \" + (expectedTypes.map(capitalize).join(', '));\n    var expectedType = expectedTypes[0];\n    var receivedType = toRawType(value);\n    var expectedValue = styleValue(value, expectedType);\n    var receivedValue = styleValue(value, receivedType);\n    // check if we need to specify expected value\n    if (expectedTypes.length === 1 &&\n        isExplicable(expectedType) &&\n        !isBoolean(expectedType, receivedType)) {\n      message += \" with value \" + expectedValue;\n    }\n    message += \", got \" + receivedType + \" \";\n    // check if we need to specify received value\n    if (isExplicable(receivedType)) {\n      message += \"with value \" + receivedValue + \".\";\n    }\n    return message\n  }\n\n  function styleValue (value, type) {\n    if (type === 'String') {\n      return (\"\\\"\" + value + \"\\\"\")\n    } else if (type === 'Number') {\n      return (\"\" + (Number(value)))\n    } else {\n      return (\"\" + value)\n    }\n  }\n\n  function isExplicable (value) {\n    var explicitTypes = ['string', 'number', 'boolean'];\n    return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })\n  }\n\n  function isBoolean () {\n    var args = [], len = arguments.length;\n    while ( len-- ) args[ len ] = arguments[ len ];\n\n    return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })\n  }\n\n  /*  */\n\n  function handleError (err, vm, info) {\n    // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.\n    // See: https://github.com/vuejs/vuex/issues/1505\n    pushTarget();\n    try {\n      if (vm) {\n        var cur = vm;\n        while ((cur = cur.$parent)) {\n          var hooks = cur.$options.errorCaptured;\n          if (hooks) {\n            for (var i = 0; i < hooks.length; i++) {\n              try {\n                var capture = hooks[i].call(cur, err, vm, info) === false;\n                if (capture) { return }\n              } catch (e) {\n                globalHandleError(e, cur, 'errorCaptured hook');\n              }\n            }\n          }\n        }\n      }\n      globalHandleError(err, vm, info);\n    } finally {\n      popTarget();\n    }\n  }\n\n  function invokeWithErrorHandling (\n    handler,\n    context,\n    args,\n    vm,\n    info\n  ) {\n    var res;\n    try {\n      res = args ? handler.apply(context, args) : handler.call(context);\n      if (res && !res._isVue && isPromise(res)) {\n        // issue #9511\n        // reassign to res to avoid catch triggering multiple times when nested calls\n        res = res.catch(function (e) { return handleError(e, vm, info + \" (Promise/async)\"); });\n      }\n    } catch (e) {\n      handleError(e, vm, info);\n    }\n    return res\n  }\n\n  function globalHandleError (err, vm, info) {\n    if (config.errorHandler) {\n      try {\n        return config.errorHandler.call(null, err, vm, info)\n      } catch (e) {\n        // if the user intentionally throws the original error in the handler,\n        // do not log it twice\n        if (e !== err) {\n          logError(e, null, 'config.errorHandler');\n        }\n      }\n    }\n    logError(err, vm, info);\n  }\n\n  function logError (err, vm, info) {\n    {\n      warn((\"Error in \" + info + \": \\\"\" + (err.toString()) + \"\\\"\"), vm);\n    }\n    /* istanbul ignore else */\n    if ((inBrowser || inWeex) && typeof console !== 'undefined') {\n      console.error(err);\n    } else {\n      throw err\n    }\n  }\n\n  /*  */\n\n  var isUsingMicroTask = false;\n\n  var callbacks = [];\n  var pending = false;\n\n  function flushCallbacks () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // Here we have async deferring wrappers using microtasks.\n  // In 2.5 we used (macro) tasks (in combination with microtasks).\n  // However, it has subtle problems when state is changed right before repaint\n  // (e.g. #6813, out-in transitions).\n  // Also, using (macro) tasks in event handler would cause some weird behaviors\n  // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).\n  // So we now use microtasks everywhere, again.\n  // A major drawback of this tradeoff is that there are some scenarios\n  // where microtasks have too high a priority and fire in between supposedly\n  // sequential events (e.g. #4521, #6690, which have workarounds)\n  // or even between bubbling of the same event (#6566).\n  var timerFunc;\n\n  // The nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore next, $flow-disable-line */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    timerFunc = function () {\n      p.then(flushCallbacks);\n      // In problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n    isUsingMicroTask = true;\n  } else if (!isIE && typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // Use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS, iOS7, Android 4.4\n    // (#6466 MutationObserver is unreliable in IE11)\n    var counter = 1;\n    var observer = new MutationObserver(flushCallbacks);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n    isUsingMicroTask = true;\n  } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\n    // Fallback to setImmediate.\n    // Techinically it leverages the (macro) task queue,\n    // but it is still a better choice than setTimeout.\n    timerFunc = function () {\n      setImmediate(flushCallbacks);\n    };\n  } else {\n    // Fallback to setTimeout.\n    timerFunc = function () {\n      setTimeout(flushCallbacks, 0);\n    };\n  }\n\n  function nextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) {\n        try {\n          cb.call(ctx);\n        } catch (e) {\n          handleError(e, ctx, 'nextTick');\n        }\n      } else if (_resolve) {\n        _resolve(ctx);\n      }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    // $flow-disable-line\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n\n  /*  */\n\n  var mark;\n  var measure;\n\n  {\n    var perf = inBrowser && window.performance;\n    /* istanbul ignore if */\n    if (\n      perf &&\n      perf.mark &&\n      perf.measure &&\n      perf.clearMarks &&\n      perf.clearMeasures\n    ) {\n      mark = function (tag) { return perf.mark(tag); };\n      measure = function (name, startTag, endTag) {\n        perf.measure(name, startTag, endTag);\n        perf.clearMarks(startTag);\n        perf.clearMarks(endTag);\n        // perf.clearMeasures(name)\n      };\n    }\n  }\n\n  /* not type checking this file because flow doesn't play well with Proxy */\n\n  var initProxy;\n\n  {\n    var allowedGlobals = makeMap(\n      'Infinity,undefined,NaN,isFinite,isNaN,' +\n      'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n      'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n      'require' // for Webpack/Browserify\n    );\n\n    var warnNonPresent = function (target, key) {\n      warn(\n        \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n        'referenced during render. Make sure that this property is reactive, ' +\n        'either in the data option, or for class-based components, by ' +\n        'initializing the property. ' +\n        'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',\n        target\n      );\n    };\n\n    var warnReservedPrefix = function (target, key) {\n      warn(\n        \"Property \\\"\" + key + \"\\\" must be accessed with \\\"$data.\" + key + \"\\\" because \" +\n        'properties starting with \"$\" or \"_\" are not proxied in the Vue instance to ' +\n        'prevent conflicts with Vue internals' +\n        'See: https://vuejs.org/v2/api/#data',\n        target\n      );\n    };\n\n    var hasProxy =\n      typeof Proxy !== 'undefined' && isNative(Proxy);\n\n    if (hasProxy) {\n      var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\n      config.keyCodes = new Proxy(config.keyCodes, {\n        set: function set (target, key, value) {\n          if (isBuiltInModifier(key)) {\n            warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n            return false\n          } else {\n            target[key] = value;\n            return true\n          }\n        }\n      });\n    }\n\n    var hasHandler = {\n      has: function has (target, key) {\n        var has = key in target;\n        var isAllowed = allowedGlobals(key) ||\n          (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));\n        if (!has && !isAllowed) {\n          if (key in target.$data) { warnReservedPrefix(target, key); }\n          else { warnNonPresent(target, key); }\n        }\n        return has || !isAllowed\n      }\n    };\n\n    var getHandler = {\n      get: function get (target, key) {\n        if (typeof key === 'string' && !(key in target)) {\n          if (key in target.$data) { warnReservedPrefix(target, key); }\n          else { warnNonPresent(target, key); }\n        }\n        return target[key]\n      }\n    };\n\n    initProxy = function initProxy (vm) {\n      if (hasProxy) {\n        // determine which proxy handler to use\n        var options = vm.$options;\n        var handlers = options.render && options.render._withStripped\n          ? getHandler\n          : hasHandler;\n        vm._renderProxy = new Proxy(vm, handlers);\n      } else {\n        vm._renderProxy = vm;\n      }\n    };\n  }\n\n  /*  */\n\n  var seenObjects = new _Set();\n\n  /**\n   * Recursively traverse an object to evoke all converted\n   * getters, so that every nested property inside the object\n   * is collected as a \"deep\" dependency.\n   */\n  function traverse (val) {\n    _traverse(val, seenObjects);\n    seenObjects.clear();\n  }\n\n  function _traverse (val, seen) {\n    var i, keys;\n    var isA = Array.isArray(val);\n    if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {\n      return\n    }\n    if (val.__ob__) {\n      var depId = val.__ob__.dep.id;\n      if (seen.has(depId)) {\n        return\n      }\n      seen.add(depId);\n    }\n    if (isA) {\n      i = val.length;\n      while (i--) { _traverse(val[i], seen); }\n    } else {\n      keys = Object.keys(val);\n      i = keys.length;\n      while (i--) { _traverse(val[keys[i]], seen); }\n    }\n  }\n\n  /*  */\n\n  var normalizeEvent = cached(function (name) {\n    var passive = name.charAt(0) === '&';\n    name = passive ? name.slice(1) : name;\n    var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first\n    name = once$$1 ? name.slice(1) : name;\n    var capture = name.charAt(0) === '!';\n    name = capture ? name.slice(1) : name;\n    return {\n      name: name,\n      once: once$$1,\n      capture: capture,\n      passive: passive\n    }\n  });\n\n  function createFnInvoker (fns, vm) {\n    function invoker () {\n      var arguments$1 = arguments;\n\n      var fns = invoker.fns;\n      if (Array.isArray(fns)) {\n        var cloned = fns.slice();\n        for (var i = 0; i < cloned.length; i++) {\n          invokeWithErrorHandling(cloned[i], null, arguments$1, vm, \"v-on handler\");\n        }\n      } else {\n        // return handler return value for single handlers\n        return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\")\n      }\n    }\n    invoker.fns = fns;\n    return invoker\n  }\n\n  function updateListeners (\n    on,\n    oldOn,\n    add,\n    remove$$1,\n    createOnceHandler,\n    vm\n  ) {\n    var name, def$$1, cur, old, event;\n    for (name in on) {\n      def$$1 = cur = on[name];\n      old = oldOn[name];\n      event = normalizeEvent(name);\n      if (isUndef(cur)) {\n        warn(\n          \"Invalid handler for event \\\"\" + (event.name) + \"\\\": got \" + String(cur),\n          vm\n        );\n      } else if (isUndef(old)) {\n        if (isUndef(cur.fns)) {\n          cur = on[name] = createFnInvoker(cur, vm);\n        }\n        if (isTrue(event.once)) {\n          cur = on[name] = createOnceHandler(event.name, cur, event.capture);\n        }\n        add(event.name, cur, event.capture, event.passive, event.params);\n      } else if (cur !== old) {\n        old.fns = cur;\n        on[name] = old;\n      }\n    }\n    for (name in oldOn) {\n      if (isUndef(on[name])) {\n        event = normalizeEvent(name);\n        remove$$1(event.name, oldOn[name], event.capture);\n      }\n    }\n  }\n\n  /*  */\n\n  function mergeVNodeHook (def, hookKey, hook) {\n    if (def instanceof VNode) {\n      def = def.data.hook || (def.data.hook = {});\n    }\n    var invoker;\n    var oldHook = def[hookKey];\n\n    function wrappedHook () {\n      hook.apply(this, arguments);\n      // important: remove merged hook to ensure it's called only once\n      // and prevent memory leak\n      remove(invoker.fns, wrappedHook);\n    }\n\n    if (isUndef(oldHook)) {\n      // no existing hook\n      invoker = createFnInvoker([wrappedHook]);\n    } else {\n      /* istanbul ignore if */\n      if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n        // already a merged invoker\n        invoker = oldHook;\n        invoker.fns.push(wrappedHook);\n      } else {\n        // existing plain hook\n        invoker = createFnInvoker([oldHook, wrappedHook]);\n      }\n    }\n\n    invoker.merged = true;\n    def[hookKey] = invoker;\n  }\n\n  /*  */\n\n  function extractPropsFromVNodeData (\n    data,\n    Ctor,\n    tag\n  ) {\n    // we are only extracting raw values here.\n    // validation and default values are handled in the child\n    // component itself.\n    var propOptions = Ctor.options.props;\n    if (isUndef(propOptions)) {\n      return\n    }\n    var res = {};\n    var attrs = data.attrs;\n    var props = data.props;\n    if (isDef(attrs) || isDef(props)) {\n      for (var key in propOptions) {\n        var altKey = hyphenate(key);\n        {\n          var keyInLowerCase = key.toLowerCase();\n          if (\n            key !== keyInLowerCase &&\n            attrs && hasOwn(attrs, keyInLowerCase)\n          ) {\n            tip(\n              \"Prop \\\"\" + keyInLowerCase + \"\\\" is passed to component \" +\n              (formatComponentName(tag || Ctor)) + \", but the declared prop name is\" +\n              \" \\\"\" + key + \"\\\". \" +\n              \"Note that HTML attributes are case-insensitive and camelCased \" +\n              \"props need to use their kebab-case equivalents when using in-DOM \" +\n              \"templates. You should probably use \\\"\" + altKey + \"\\\" instead of \\\"\" + key + \"\\\".\"\n            );\n          }\n        }\n        checkProp(res, props, key, altKey, true) ||\n        checkProp(res, attrs, key, altKey, false);\n      }\n    }\n    return res\n  }\n\n  function checkProp (\n    res,\n    hash,\n    key,\n    altKey,\n    preserve\n  ) {\n    if (isDef(hash)) {\n      if (hasOwn(hash, key)) {\n        res[key] = hash[key];\n        if (!preserve) {\n          delete hash[key];\n        }\n        return true\n      } else if (hasOwn(hash, altKey)) {\n        res[key] = hash[altKey];\n        if (!preserve) {\n          delete hash[altKey];\n        }\n        return true\n      }\n    }\n    return false\n  }\n\n  /*  */\n\n  // The template compiler attempts to minimize the need for normalization by\n  // statically analyzing the template at compile time.\n  //\n  // For plain HTML markup, normalization can be completely skipped because the\n  // generated render function is guaranteed to return Array<VNode>. There are\n  // two cases where extra normalization is needed:\n\n  // 1. When the children contains components - because a functional component\n  // may return an Array instead of a single root. In this case, just a simple\n  // normalization is needed - if any child is an Array, we flatten the whole\n  // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n  // because functional components already normalize their own children.\n  function simpleNormalizeChildren (children) {\n    for (var i = 0; i < children.length; i++) {\n      if (Array.isArray(children[i])) {\n        return Array.prototype.concat.apply([], children)\n      }\n    }\n    return children\n  }\n\n  // 2. When the children contains constructs that always generated nested Arrays,\n  // e.g. <template>, <slot>, v-for, or when the children is provided by user\n  // with hand-written render functions / JSX. In such cases a full normalization\n  // is needed to cater to all possible types of children values.\n  function normalizeChildren (children) {\n    return isPrimitive(children)\n      ? [createTextVNode(children)]\n      : Array.isArray(children)\n        ? normalizeArrayChildren(children)\n        : undefined\n  }\n\n  function isTextNode (node) {\n    return isDef(node) && isDef(node.text) && isFalse(node.isComment)\n  }\n\n  function normalizeArrayChildren (children, nestedIndex) {\n    var res = [];\n    var i, c, lastIndex, last;\n    for (i = 0; i < children.length; i++) {\n      c = children[i];\n      if (isUndef(c) || typeof c === 'boolean') { continue }\n      lastIndex = res.length - 1;\n      last = res[lastIndex];\n      //  nested\n      if (Array.isArray(c)) {\n        if (c.length > 0) {\n          c = normalizeArrayChildren(c, ((nestedIndex || '') + \"_\" + i));\n          // merge adjacent text nodes\n          if (isTextNode(c[0]) && isTextNode(last)) {\n            res[lastIndex] = createTextVNode(last.text + (c[0]).text);\n            c.shift();\n          }\n          res.push.apply(res, c);\n        }\n      } else if (isPrimitive(c)) {\n        if (isTextNode(last)) {\n          // merge adjacent text nodes\n          // this is necessary for SSR hydration because text nodes are\n          // essentially merged when rendered to HTML strings\n          res[lastIndex] = createTextVNode(last.text + c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else {\n        if (isTextNode(c) && isTextNode(last)) {\n          // merge adjacent text nodes\n          res[lastIndex] = createTextVNode(last.text + c.text);\n        } else {\n          // default key for nested array children (likely generated by v-for)\n          if (isTrue(children._isVList) &&\n            isDef(c.tag) &&\n            isUndef(c.key) &&\n            isDef(nestedIndex)) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  function initProvide (vm) {\n    var provide = vm.$options.provide;\n    if (provide) {\n      vm._provided = typeof provide === 'function'\n        ? provide.call(vm)\n        : provide;\n    }\n  }\n\n  function initInjections (vm) {\n    var result = resolveInject(vm.$options.inject, vm);\n    if (result) {\n      toggleObserving(false);\n      Object.keys(result).forEach(function (key) {\n        /* istanbul ignore else */\n        {\n          defineReactive$$1(vm, key, result[key], function () {\n            warn(\n              \"Avoid mutating an injected value directly since the changes will be \" +\n              \"overwritten whenever the provided component re-renders. \" +\n              \"injection being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          });\n        }\n      });\n      toggleObserving(true);\n    }\n  }\n\n  function resolveInject (inject, vm) {\n    if (inject) {\n      // inject is :any because flow is not smart enough to figure out cached\n      var result = Object.create(null);\n      var keys = hasSymbol\n        ? Reflect.ownKeys(inject)\n        : Object.keys(inject);\n\n      for (var i = 0; i < keys.length; i++) {\n        var key = keys[i];\n        // #6574 in case the inject object is observed...\n        if (key === '__ob__') { continue }\n        var provideKey = inject[key].from;\n        var source = vm;\n        while (source) {\n          if (source._provided && hasOwn(source._provided, provideKey)) {\n            result[key] = source._provided[provideKey];\n            break\n          }\n          source = source.$parent;\n        }\n        if (!source) {\n          if ('default' in inject[key]) {\n            var provideDefault = inject[key].default;\n            result[key] = typeof provideDefault === 'function'\n              ? provideDefault.call(vm)\n              : provideDefault;\n          } else {\n            warn((\"Injection \\\"\" + key + \"\\\" not found\"), vm);\n          }\n        }\n      }\n      return result\n    }\n  }\n\n  /*  */\n\n\n\n  /**\n   * Runtime helper for resolving raw children VNodes into a slot object.\n   */\n  function resolveSlots (\n    children,\n    context\n  ) {\n    if (!children || !children.length) {\n      return {}\n    }\n    var slots = {};\n    for (var i = 0, l = children.length; i < l; i++) {\n      var child = children[i];\n      var data = child.data;\n      // remove slot attribute if the node is resolved as a Vue slot node\n      if (data && data.attrs && data.attrs.slot) {\n        delete data.attrs.slot;\n      }\n      // named slots should only be respected if the vnode was rendered in the\n      // same context.\n      if ((child.context === context || child.fnContext === context) &&\n        data && data.slot != null\n      ) {\n        var name = data.slot;\n        var slot = (slots[name] || (slots[name] = []));\n        if (child.tag === 'template') {\n          slot.push.apply(slot, child.children || []);\n        } else {\n          slot.push(child);\n        }\n      } else {\n        (slots.default || (slots.default = [])).push(child);\n      }\n    }\n    // ignore slots that contains only whitespace\n    for (var name$1 in slots) {\n      if (slots[name$1].every(isWhitespace)) {\n        delete slots[name$1];\n      }\n    }\n    return slots\n  }\n\n  function isWhitespace (node) {\n    return (node.isComment && !node.asyncFactory) || node.text === ' '\n  }\n\n  /*  */\n\n  function normalizeScopedSlots (\n    slots,\n    normalSlots,\n    prevSlots\n  ) {\n    var res;\n    var isStable = slots ? !!slots.$stable : true;\n    var key = slots && slots.$key;\n    if (!slots) {\n      res = {};\n    } else if (slots._normalized) {\n      // fast path 1: child component re-render only, parent did not change\n      return slots._normalized\n    } else if (\n      isStable &&\n      prevSlots &&\n      prevSlots !== emptyObject &&\n      key === prevSlots.$key &&\n      Object.keys(normalSlots).length === 0\n    ) {\n      // fast path 2: stable scoped slots w/ no normal slots to proxy,\n      // only need to normalize once\n      return prevSlots\n    } else {\n      res = {};\n      for (var key$1 in slots) {\n        if (slots[key$1] && key$1[0] !== '$') {\n          res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);\n        }\n      }\n    }\n    // expose normal slots on scopedSlots\n    for (var key$2 in normalSlots) {\n      if (!(key$2 in res)) {\n        res[key$2] = proxyNormalSlot(normalSlots, key$2);\n      }\n    }\n    // avoriaz seems to mock a non-extensible $scopedSlots object\n    // and when that is passed down this would cause an error\n    if (slots && Object.isExtensible(slots)) {\n      (slots)._normalized = res;\n    }\n    def(res, '$stable', isStable);\n    def(res, '$key', key);\n    return res\n  }\n\n  function normalizeScopedSlot(normalSlots, key, fn) {\n    var normalized = function () {\n      var res = arguments.length ? fn.apply(null, arguments) : fn({});\n      res = res && typeof res === 'object' && !Array.isArray(res)\n        ? [res] // single vnode\n        : normalizeChildren(res);\n      return res && res.length === 0\n        ? undefined\n        : res\n    };\n    // this is a slot using the new v-slot syntax without scope. although it is\n    // compiled as a scoped slot, render fn users would expect it to be present\n    // on this.$slots because the usage is semantically a normal slot.\n    if (fn.proxy) {\n      Object.defineProperty(normalSlots, key, {\n        get: normalized,\n        enumerable: true,\n        configurable: true\n      });\n    }\n    return normalized\n  }\n\n  function proxyNormalSlot(slots, key) {\n    return function () { return slots[key]; }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering v-for lists.\n   */\n  function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val) || typeof val === 'string') {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      if (hasSymbol && val[Symbol.iterator]) {\n        ret = [];\n        var iterator = val[Symbol.iterator]();\n        var result = iterator.next();\n        while (!result.done) {\n          ret.push(render(result.value, ret.length));\n          result = iterator.next();\n        }\n      } else {\n        keys = Object.keys(val);\n        ret = new Array(keys.length);\n        for (i = 0, l = keys.length; i < l; i++) {\n          key = keys[i];\n          ret[i] = render(val[key], key, i);\n        }\n      }\n    }\n    if (!isDef(ret)) {\n      ret = [];\n    }\n    (ret)._isVList = true;\n    return ret\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering <slot>\n   */\n  function renderSlot (\n    name,\n    fallback,\n    props,\n    bindObject\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    var nodes;\n    if (scopedSlotFn) { // scoped slot\n      props = props || {};\n      if (bindObject) {\n        if (!isObject(bindObject)) {\n          warn(\n            'slot v-bind without argument expects an Object',\n            this\n          );\n        }\n        props = extend(extend({}, bindObject), props);\n      }\n      nodes = scopedSlotFn(props) || fallback;\n    } else {\n      nodes = this.$slots[name] || fallback;\n    }\n\n    var target = props && props.slot;\n    if (target) {\n      return this.$createElement('template', { slot: target }, nodes)\n    } else {\n      return nodes\n    }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for resolving filters\n   */\n  function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  }\n\n  /*  */\n\n  function isKeyNotMatch (expect, actual) {\n    if (Array.isArray(expect)) {\n      return expect.indexOf(actual) === -1\n    } else {\n      return expect !== actual\n    }\n  }\n\n  /**\n   * Runtime helper for checking keyCodes from config.\n   * exposed as Vue.prototype._k\n   * passing in eventKeyName as last argument separately for backwards compat\n   */\n  function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInKeyCode,\n    eventKeyName,\n    builtInKeyName\n  ) {\n    var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;\n    if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {\n      return isKeyNotMatch(builtInKeyName, eventKeyName)\n    } else if (mappedKeyCode) {\n      return isKeyNotMatch(mappedKeyCode, eventKeyCode)\n    } else if (eventKeyName) {\n      return hyphenate(eventKeyName) !== key\n    }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for merging v-bind=\"object\" into a VNode's data.\n   */\n  function bindObjectProps (\n    data,\n    tag,\n    value,\n    asProp,\n    isSync\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        var hash;\n        var loop = function ( key ) {\n          if (\n            key === 'class' ||\n            key === 'style' ||\n            isReservedAttribute(key)\n          ) {\n            hash = data;\n          } else {\n            var type = data.attrs && data.attrs.type;\n            hash = asProp || config.mustUseProp(tag, type, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n          }\n          var camelizedKey = camelize(key);\n          if (!(key in hash) && !(camelizedKey in hash)) {\n            hash[key] = value[key];\n\n            if (isSync) {\n              var on = data.on || (data.on = {});\n              on[(\"update:\" + camelizedKey)] = function ($event) {\n                value[key] = $event;\n              };\n            }\n          }\n        };\n\n        for (var key in value) loop( key );\n      }\n    }\n    return data\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering static trees.\n   */\n  function renderStatic (\n    index,\n    isInFor\n  ) {\n    var cached = this._staticTrees || (this._staticTrees = []);\n    var tree = cached[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree.\n    if (tree && !isInFor) {\n      return tree\n    }\n    // otherwise, render a fresh tree.\n    tree = cached[index] = this.$options.staticRenderFns[index].call(\n      this._renderProxy,\n      null,\n      this // for render fns generated for functional component templates\n    );\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  }\n\n  /**\n   * Runtime helper for v-once.\n   * Effectively it means marking the node as static with a unique key.\n   */\n  function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  }\n\n  function markStatic (\n    tree,\n    key,\n    isOnce\n  ) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  /*  */\n\n  function bindObjectListeners (data, value) {\n    if (value) {\n      if (!isPlainObject(value)) {\n        warn(\n          'v-on without argument expects an Object value',\n          this\n        );\n      } else {\n        var on = data.on = data.on ? extend({}, data.on) : {};\n        for (var key in value) {\n          var existing = on[key];\n          var ours = value[key];\n          on[key] = existing ? [].concat(existing, ours) : ours;\n        }\n      }\n    }\n    return data\n  }\n\n  /*  */\n\n  function resolveScopedSlots (\n    fns, // see flow/vnode\n    res,\n    // the following are added in 2.6\n    hasDynamicKeys,\n    contentHashKey\n  ) {\n    res = res || { $stable: !hasDynamicKeys };\n    for (var i = 0; i < fns.length; i++) {\n      var slot = fns[i];\n      if (Array.isArray(slot)) {\n        resolveScopedSlots(slot, res, hasDynamicKeys);\n      } else if (slot) {\n        // marker for reverse proxying v-slot without scope on this.$slots\n        if (slot.proxy) {\n          slot.fn.proxy = true;\n        }\n        res[slot.key] = slot.fn;\n      }\n    }\n    if (contentHashKey) {\n      (res).$key = contentHashKey;\n    }\n    return res\n  }\n\n  /*  */\n\n  function bindDynamicKeys (baseObj, values) {\n    for (var i = 0; i < values.length; i += 2) {\n      var key = values[i];\n      if (typeof key === 'string' && key) {\n        baseObj[values[i]] = values[i + 1];\n      } else if (key !== '' && key !== null) {\n        // null is a speical value for explicitly removing a binding\n        warn(\n          (\"Invalid value for dynamic directive argument (expected string or null): \" + key),\n          this\n        );\n      }\n    }\n    return baseObj\n  }\n\n  // helper to dynamically append modifier runtime markers to event names.\n  // ensure only append when value is already string, otherwise it will be cast\n  // to string and cause the type check to miss.\n  function prependModifier (value, symbol) {\n    return typeof value === 'string' ? symbol + value : value\n  }\n\n  /*  */\n\n  function installRenderHelpers (target) {\n    target._o = markOnce;\n    target._n = toNumber;\n    target._s = toString;\n    target._l = renderList;\n    target._t = renderSlot;\n    target._q = looseEqual;\n    target._i = looseIndexOf;\n    target._m = renderStatic;\n    target._f = resolveFilter;\n    target._k = checkKeyCodes;\n    target._b = bindObjectProps;\n    target._v = createTextVNode;\n    target._e = createEmptyVNode;\n    target._u = resolveScopedSlots;\n    target._g = bindObjectListeners;\n    target._d = bindDynamicKeys;\n    target._p = prependModifier;\n  }\n\n  /*  */\n\n  function FunctionalRenderContext (\n    data,\n    props,\n    children,\n    parent,\n    Ctor\n  ) {\n    var this$1 = this;\n\n    var options = Ctor.options;\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    var contextVm;\n    if (hasOwn(parent, '_uid')) {\n      contextVm = Object.create(parent);\n      // $flow-disable-line\n      contextVm._original = parent;\n    } else {\n      // the context vm passed in is a functional context as well.\n      // in this case we want to make sure we are able to get a hold to the\n      // real context instance.\n      contextVm = parent;\n      // $flow-disable-line\n      parent = parent._original;\n    }\n    var isCompiled = isTrue(options._compiled);\n    var needNormalization = !isCompiled;\n\n    this.data = data;\n    this.props = props;\n    this.children = children;\n    this.parent = parent;\n    this.listeners = data.on || emptyObject;\n    this.injections = resolveInject(options.inject, parent);\n    this.slots = function () {\n      if (!this$1.$slots) {\n        normalizeScopedSlots(\n          data.scopedSlots,\n          this$1.$slots = resolveSlots(children, parent)\n        );\n      }\n      return this$1.$slots\n    };\n\n    Object.defineProperty(this, 'scopedSlots', ({\n      enumerable: true,\n      get: function get () {\n        return normalizeScopedSlots(data.scopedSlots, this.slots())\n      }\n    }));\n\n    // support for compiled functional template\n    if (isCompiled) {\n      // exposing $options for renderStatic()\n      this.$options = options;\n      // pre-resolve slots for renderSlot()\n      this.$slots = this.slots();\n      this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);\n    }\n\n    if (options._scopeId) {\n      this._c = function (a, b, c, d) {\n        var vnode = createElement(contextVm, a, b, c, d, needNormalization);\n        if (vnode && !Array.isArray(vnode)) {\n          vnode.fnScopeId = options._scopeId;\n          vnode.fnContext = parent;\n        }\n        return vnode\n      };\n    } else {\n      this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };\n    }\n  }\n\n  installRenderHelpers(FunctionalRenderContext.prototype);\n\n  function createFunctionalComponent (\n    Ctor,\n    propsData,\n    data,\n    contextVm,\n    children\n  ) {\n    var options = Ctor.options;\n    var props = {};\n    var propOptions = options.props;\n    if (isDef(propOptions)) {\n      for (var key in propOptions) {\n        props[key] = validateProp(key, propOptions, propsData || emptyObject);\n      }\n    } else {\n      if (isDef(data.attrs)) { mergeProps(props, data.attrs); }\n      if (isDef(data.props)) { mergeProps(props, data.props); }\n    }\n\n    var renderContext = new FunctionalRenderContext(\n      data,\n      props,\n      children,\n      contextVm,\n      Ctor\n    );\n\n    var vnode = options.render.call(null, renderContext._c, renderContext);\n\n    if (vnode instanceof VNode) {\n      return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)\n    } else if (Array.isArray(vnode)) {\n      var vnodes = normalizeChildren(vnode) || [];\n      var res = new Array(vnodes.length);\n      for (var i = 0; i < vnodes.length; i++) {\n        res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);\n      }\n      return res\n    }\n  }\n\n  function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {\n    // #7817 clone node before setting fnContext, otherwise if the node is reused\n    // (e.g. it was from a cached normal slot) the fnContext causes named slots\n    // that should not be matched to match.\n    var clone = cloneVNode(vnode);\n    clone.fnContext = contextVm;\n    clone.fnOptions = options;\n    {\n      (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;\n    }\n    if (data.slot) {\n      (clone.data || (clone.data = {})).slot = data.slot;\n    }\n    return clone\n  }\n\n  function mergeProps (to, from) {\n    for (var key in from) {\n      to[camelize(key)] = from[key];\n    }\n  }\n\n  /*  */\n\n  /*  */\n\n  /*  */\n\n  /*  */\n\n  // inline hooks to be invoked on component VNodes during patch\n  var componentVNodeHooks = {\n    init: function init (vnode, hydrating) {\n      if (\n        vnode.componentInstance &&\n        !vnode.componentInstance._isDestroyed &&\n        vnode.data.keepAlive\n      ) {\n        // kept-alive components, treat as a patch\n        var mountedNode = vnode; // work around flow\n        componentVNodeHooks.prepatch(mountedNode, mountedNode);\n      } else {\n        var child = vnode.componentInstance = createComponentInstanceForVnode(\n          vnode,\n          activeInstance\n        );\n        child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n      }\n    },\n\n    prepatch: function prepatch (oldVnode, vnode) {\n      var options = vnode.componentOptions;\n      var child = vnode.componentInstance = oldVnode.componentInstance;\n      updateChildComponent(\n        child,\n        options.propsData, // updated props\n        options.listeners, // updated listeners\n        vnode, // new parent vnode\n        options.children // new children\n      );\n    },\n\n    insert: function insert (vnode) {\n      var context = vnode.context;\n      var componentInstance = vnode.componentInstance;\n      if (!componentInstance._isMounted) {\n        componentInstance._isMounted = true;\n        callHook(componentInstance, 'mounted');\n      }\n      if (vnode.data.keepAlive) {\n        if (context._isMounted) {\n          // vue-router#1212\n          // During updates, a kept-alive component's child components may\n          // change, so directly walking the tree here may call activated hooks\n          // on incorrect children. Instead we push them into a queue which will\n          // be processed after the whole patch process ended.\n          queueActivatedComponent(componentInstance);\n        } else {\n          activateChildComponent(componentInstance, true /* direct */);\n        }\n      }\n    },\n\n    destroy: function destroy (vnode) {\n      var componentInstance = vnode.componentInstance;\n      if (!componentInstance._isDestroyed) {\n        if (!vnode.data.keepAlive) {\n          componentInstance.$destroy();\n        } else {\n          deactivateChildComponent(componentInstance, true /* direct */);\n        }\n      }\n    }\n  };\n\n  var hooksToMerge = Object.keys(componentVNodeHooks);\n\n  function createComponent (\n    Ctor,\n    data,\n    context,\n    children,\n    tag\n  ) {\n    if (isUndef(Ctor)) {\n      return\n    }\n\n    var baseCtor = context.$options._base;\n\n    // plain options object: turn it into a constructor\n    if (isObject(Ctor)) {\n      Ctor = baseCtor.extend(Ctor);\n    }\n\n    // if at this stage it's not a constructor or an async component factory,\n    // reject.\n    if (typeof Ctor !== 'function') {\n      {\n        warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n      }\n      return\n    }\n\n    // async component\n    var asyncFactory;\n    if (isUndef(Ctor.cid)) {\n      asyncFactory = Ctor;\n      Ctor = resolveAsyncComponent(asyncFactory, baseCtor);\n      if (Ctor === undefined) {\n        // return a placeholder node for async component, which is rendered\n        // as a comment node but preserves all the raw information for the node.\n        // the information will be used for async server-rendering and hydration.\n        return createAsyncPlaceholder(\n          asyncFactory,\n          data,\n          context,\n          children,\n          tag\n        )\n      }\n    }\n\n    data = data || {};\n\n    // resolve constructor options in case global mixins are applied after\n    // component constructor creation\n    resolveConstructorOptions(Ctor);\n\n    // transform component v-model data into props & events\n    if (isDef(data.model)) {\n      transformModel(Ctor.options, data);\n    }\n\n    // extract props\n    var propsData = extractPropsFromVNodeData(data, Ctor, tag);\n\n    // functional component\n    if (isTrue(Ctor.options.functional)) {\n      return createFunctionalComponent(Ctor, propsData, data, context, children)\n    }\n\n    // extract listeners, since these needs to be treated as\n    // child component listeners instead of DOM listeners\n    var listeners = data.on;\n    // replace with listeners with .native modifier\n    // so it gets processed during parent component patch.\n    data.on = data.nativeOn;\n\n    if (isTrue(Ctor.options.abstract)) {\n      // abstract components do not keep anything\n      // other than props & listeners & slot\n\n      // work around flow\n      var slot = data.slot;\n      data = {};\n      if (slot) {\n        data.slot = slot;\n      }\n    }\n\n    // install component management hooks onto the placeholder node\n    installComponentHooks(data);\n\n    // return a placeholder vnode\n    var name = Ctor.options.name || tag;\n    var vnode = new VNode(\n      (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n      data, undefined, undefined, undefined, context,\n      { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },\n      asyncFactory\n    );\n\n    return vnode\n  }\n\n  function createComponentInstanceForVnode (\n    vnode, // we know it's MountedComponentVNode but flow doesn't\n    parent // activeInstance in lifecycle state\n  ) {\n    var options = {\n      _isComponent: true,\n      _parentVnode: vnode,\n      parent: parent\n    };\n    // check inline-template render functions\n    var inlineTemplate = vnode.data.inlineTemplate;\n    if (isDef(inlineTemplate)) {\n      options.render = inlineTemplate.render;\n      options.staticRenderFns = inlineTemplate.staticRenderFns;\n    }\n    return new vnode.componentOptions.Ctor(options)\n  }\n\n  function installComponentHooks (data) {\n    var hooks = data.hook || (data.hook = {});\n    for (var i = 0; i < hooksToMerge.length; i++) {\n      var key = hooksToMerge[i];\n      var existing = hooks[key];\n      var toMerge = componentVNodeHooks[key];\n      if (existing !== toMerge && !(existing && existing._merged)) {\n        hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;\n      }\n    }\n  }\n\n  function mergeHook$1 (f1, f2) {\n    var merged = function (a, b) {\n      // flow complains about extra args which is why we use any\n      f1(a, b);\n      f2(a, b);\n    };\n    merged._merged = true;\n    return merged\n  }\n\n  // transform component v-model info (value and callback) into\n  // prop and event handler respectively.\n  function transformModel (options, data) {\n    var prop = (options.model && options.model.prop) || 'value';\n    var event = (options.model && options.model.event) || 'input'\n    ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;\n    var on = data.on || (data.on = {});\n    var existing = on[event];\n    var callback = data.model.callback;\n    if (isDef(existing)) {\n      if (\n        Array.isArray(existing)\n          ? existing.indexOf(callback) === -1\n          : existing !== callback\n      ) {\n        on[event] = [callback].concat(existing);\n      }\n    } else {\n      on[event] = callback;\n    }\n  }\n\n  /*  */\n\n  var SIMPLE_NORMALIZE = 1;\n  var ALWAYS_NORMALIZE = 2;\n\n  // wrapper function for providing a more flexible interface\n  // without getting yelled at by flow\n  function createElement (\n    context,\n    tag,\n    data,\n    children,\n    normalizationType,\n    alwaysNormalize\n  ) {\n    if (Array.isArray(data) || isPrimitive(data)) {\n      normalizationType = children;\n      children = data;\n      data = undefined;\n    }\n    if (isTrue(alwaysNormalize)) {\n      normalizationType = ALWAYS_NORMALIZE;\n    }\n    return _createElement(context, tag, data, children, normalizationType)\n  }\n\n  function _createElement (\n    context,\n    tag,\n    data,\n    children,\n    normalizationType\n  ) {\n    if (isDef(data) && isDef((data).__ob__)) {\n      warn(\n        \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n        'Always create fresh vnode data objects in each render!',\n        context\n      );\n      return createEmptyVNode()\n    }\n    // object syntax in v-bind\n    if (isDef(data) && isDef(data.is)) {\n      tag = data.is;\n    }\n    if (!tag) {\n      // in case of component :is set to falsy value\n      return createEmptyVNode()\n    }\n    // warn against non-primitive key\n    if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)\n    ) {\n      {\n        warn(\n          'Avoid using non-primitive value as key, ' +\n          'use string/number value instead.',\n          context\n        );\n      }\n    }\n    // support single function children as default scoped slot\n    if (Array.isArray(children) &&\n      typeof children[0] === 'function'\n    ) {\n      data = data || {};\n      data.scopedSlots = { default: children[0] };\n      children.length = 0;\n    }\n    if (normalizationType === ALWAYS_NORMALIZE) {\n      children = normalizeChildren(children);\n    } else if (normalizationType === SIMPLE_NORMALIZE) {\n      children = simpleNormalizeChildren(children);\n    }\n    var vnode, ns;\n    if (typeof tag === 'string') {\n      var Ctor;\n      ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);\n      if (config.isReservedTag(tag)) {\n        // platform built-in elements\n        vnode = new VNode(\n          config.parsePlatformTagName(tag), data, children,\n          undefined, undefined, context\n        );\n      } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {\n        // component\n        vnode = createComponent(Ctor, data, context, children, tag);\n      } else {\n        // unknown or unlisted namespaced elements\n        // check at runtime because it may get assigned a namespace when its\n        // parent normalizes children\n        vnode = new VNode(\n          tag, data, children,\n          undefined, undefined, context\n        );\n      }\n    } else {\n      // direct component options / constructor\n      vnode = createComponent(tag, data, context, children);\n    }\n    if (Array.isArray(vnode)) {\n      return vnode\n    } else if (isDef(vnode)) {\n      if (isDef(ns)) { applyNS(vnode, ns); }\n      if (isDef(data)) { registerDeepBindings(data); }\n      return vnode\n    } else {\n      return createEmptyVNode()\n    }\n  }\n\n  function applyNS (vnode, ns, force) {\n    vnode.ns = ns;\n    if (vnode.tag === 'foreignObject') {\n      // use default namespace inside foreignObject\n      ns = undefined;\n      force = true;\n    }\n    if (isDef(vnode.children)) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        var child = vnode.children[i];\n        if (isDef(child.tag) && (\n          isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {\n          applyNS(child, ns, force);\n        }\n      }\n    }\n  }\n\n  // ref #5318\n  // necessary to ensure parent re-render when deep bindings like :style and\n  // :class are used on slot nodes\n  function registerDeepBindings (data) {\n    if (isObject(data.style)) {\n      traverse(data.style);\n    }\n    if (isObject(data.class)) {\n      traverse(data.class);\n    }\n  }\n\n  /*  */\n\n  function initRender (vm) {\n    vm._vnode = null; // the root of the child tree\n    vm._staticTrees = null; // v-once cached trees\n    var options = vm.$options;\n    var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree\n    var renderContext = parentVnode && parentVnode.context;\n    vm.$slots = resolveSlots(options._renderChildren, renderContext);\n    vm.$scopedSlots = emptyObject;\n    // bind the createElement fn to this instance\n    // so that we get proper render context inside it.\n    // args order: tag, data, children, normalizationType, alwaysNormalize\n    // internal version is used by render functions compiled from templates\n    vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };\n    // normalization is always applied for the public version, used in\n    // user-written render functions.\n    vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };\n\n    // $attrs & $listeners are exposed for easier HOC creation.\n    // they need to be reactive so that HOCs using them are always updated\n    var parentData = parentVnode && parentVnode.data;\n\n    /* istanbul ignore else */\n    {\n      defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {\n        !isUpdatingChildComponent && warn(\"$attrs is readonly.\", vm);\n      }, true);\n      defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {\n        !isUpdatingChildComponent && warn(\"$listeners is readonly.\", vm);\n      }, true);\n    }\n  }\n\n  var currentRenderingInstance = null;\n\n  function renderMixin (Vue) {\n    // install runtime convenience helpers\n    installRenderHelpers(Vue.prototype);\n\n    Vue.prototype.$nextTick = function (fn) {\n      return nextTick(fn, this)\n    };\n\n    Vue.prototype._render = function () {\n      var vm = this;\n      var ref = vm.$options;\n      var render = ref.render;\n      var _parentVnode = ref._parentVnode;\n\n      if (_parentVnode) {\n        vm.$scopedSlots = normalizeScopedSlots(\n          _parentVnode.data.scopedSlots,\n          vm.$slots,\n          vm.$scopedSlots\n        );\n      }\n\n      // set parent vnode. this allows render functions to have access\n      // to the data on the placeholder node.\n      vm.$vnode = _parentVnode;\n      // render self\n      var vnode;\n      try {\n        // There's no need to maintain a stack becaues all render fns are called\n        // separately from one another. Nested component's render fns are called\n        // when parent component is patched.\n        currentRenderingInstance = vm;\n        vnode = render.call(vm._renderProxy, vm.$createElement);\n      } catch (e) {\n        handleError(e, vm, \"render\");\n        // return error render result,\n        // or previous vnode to prevent render error causing blank component\n        /* istanbul ignore else */\n        if (vm.$options.renderError) {\n          try {\n            vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);\n          } catch (e) {\n            handleError(e, vm, \"renderError\");\n            vnode = vm._vnode;\n          }\n        } else {\n          vnode = vm._vnode;\n        }\n      } finally {\n        currentRenderingInstance = null;\n      }\n      // if the returned array contains only a single node, allow it\n      if (Array.isArray(vnode) && vnode.length === 1) {\n        vnode = vnode[0];\n      }\n      // return empty vnode in case the render function errored out\n      if (!(vnode instanceof VNode)) {\n        if (Array.isArray(vnode)) {\n          warn(\n            'Multiple root nodes returned from render function. Render function ' +\n            'should return a single root node.',\n            vm\n          );\n        }\n        vnode = createEmptyVNode();\n      }\n      // set parent\n      vnode.parent = _parentVnode;\n      return vnode\n    };\n  }\n\n  /*  */\n\n  function ensureCtor (comp, base) {\n    if (\n      comp.__esModule ||\n      (hasSymbol && comp[Symbol.toStringTag] === 'Module')\n    ) {\n      comp = comp.default;\n    }\n    return isObject(comp)\n      ? base.extend(comp)\n      : comp\n  }\n\n  function createAsyncPlaceholder (\n    factory,\n    data,\n    context,\n    children,\n    tag\n  ) {\n    var node = createEmptyVNode();\n    node.asyncFactory = factory;\n    node.asyncMeta = { data: data, context: context, children: children, tag: tag };\n    return node\n  }\n\n  function resolveAsyncComponent (\n    factory,\n    baseCtor\n  ) {\n    if (isTrue(factory.error) && isDef(factory.errorComp)) {\n      return factory.errorComp\n    }\n\n    if (isDef(factory.resolved)) {\n      return factory.resolved\n    }\n\n    if (isTrue(factory.loading) && isDef(factory.loadingComp)) {\n      return factory.loadingComp\n    }\n\n    var owner = currentRenderingInstance;\n    if (isDef(factory.owners)) {\n      // already pending\n      factory.owners.push(owner);\n    } else {\n      var owners = factory.owners = [owner];\n      var sync = true;\n\n      var forceRender = function (renderCompleted) {\n        for (var i = 0, l = owners.length; i < l; i++) {\n          (owners[i]).$forceUpdate();\n        }\n\n        if (renderCompleted) {\n          owners.length = 0;\n        }\n      };\n\n      var resolve = once(function (res) {\n        // cache resolved\n        factory.resolved = ensureCtor(res, baseCtor);\n        // invoke callbacks only if this is not a synchronous resolve\n        // (async resolves are shimmed as synchronous during SSR)\n        if (!sync) {\n          forceRender(true);\n        } else {\n          owners.length = 0;\n        }\n      });\n\n      var reject = once(function (reason) {\n        warn(\n          \"Failed to resolve async component: \" + (String(factory)) +\n          (reason ? (\"\\nReason: \" + reason) : '')\n        );\n        if (isDef(factory.errorComp)) {\n          factory.error = true;\n          forceRender(true);\n        }\n      });\n\n      var res = factory(resolve, reject);\n\n      if (isObject(res)) {\n        if (isPromise(res)) {\n          // () => Promise\n          if (isUndef(factory.resolved)) {\n            res.then(resolve, reject);\n          }\n        } else if (isPromise(res.component)) {\n          res.component.then(resolve, reject);\n\n          if (isDef(res.error)) {\n            factory.errorComp = ensureCtor(res.error, baseCtor);\n          }\n\n          if (isDef(res.loading)) {\n            factory.loadingComp = ensureCtor(res.loading, baseCtor);\n            if (res.delay === 0) {\n              factory.loading = true;\n            } else {\n              setTimeout(function () {\n                if (isUndef(factory.resolved) && isUndef(factory.error)) {\n                  factory.loading = true;\n                  forceRender(false);\n                }\n              }, res.delay || 200);\n            }\n          }\n\n          if (isDef(res.timeout)) {\n            setTimeout(function () {\n              if (isUndef(factory.resolved)) {\n                reject(\n                  \"timeout (\" + (res.timeout) + \"ms)\"\n                );\n              }\n            }, res.timeout);\n          }\n        }\n      }\n\n      sync = false;\n      // return in case resolved synchronously\n      return factory.loading\n        ? factory.loadingComp\n        : factory.resolved\n    }\n  }\n\n  /*  */\n\n  function isAsyncPlaceholder (node) {\n    return node.isComment && node.asyncFactory\n  }\n\n  /*  */\n\n  function getFirstComponentChild (children) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; i++) {\n        var c = children[i];\n        if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {\n          return c\n        }\n      }\n    }\n  }\n\n  /*  */\n\n  /*  */\n\n  function initEvents (vm) {\n    vm._events = Object.create(null);\n    vm._hasHookEvent = false;\n    // init parent attached events\n    var listeners = vm.$options._parentListeners;\n    if (listeners) {\n      updateComponentListeners(vm, listeners);\n    }\n  }\n\n  var target;\n\n  function add (event, fn) {\n    target.$on(event, fn);\n  }\n\n  function remove$1 (event, fn) {\n    target.$off(event, fn);\n  }\n\n  function createOnceHandler (event, fn) {\n    var _target = target;\n    return function onceHandler () {\n      var res = fn.apply(null, arguments);\n      if (res !== null) {\n        _target.$off(event, onceHandler);\n      }\n    }\n  }\n\n  function updateComponentListeners (\n    vm,\n    listeners,\n    oldListeners\n  ) {\n    target = vm;\n    updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);\n    target = undefined;\n  }\n\n  function eventsMixin (Vue) {\n    var hookRE = /^hook:/;\n    Vue.prototype.$on = function (event, fn) {\n      var vm = this;\n      if (Array.isArray(event)) {\n        for (var i = 0, l = event.length; i < l; i++) {\n          vm.$on(event[i], fn);\n        }\n      } else {\n        (vm._events[event] || (vm._events[event] = [])).push(fn);\n        // optimize hook:event cost by using a boolean flag marked at registration\n        // instead of a hash lookup\n        if (hookRE.test(event)) {\n          vm._hasHookEvent = true;\n        }\n      }\n      return vm\n    };\n\n    Vue.prototype.$once = function (event, fn) {\n      var vm = this;\n      function on () {\n        vm.$off(event, on);\n        fn.apply(vm, arguments);\n      }\n      on.fn = fn;\n      vm.$on(event, on);\n      return vm\n    };\n\n    Vue.prototype.$off = function (event, fn) {\n      var vm = this;\n      // all\n      if (!arguments.length) {\n        vm._events = Object.create(null);\n        return vm\n      }\n      // array of events\n      if (Array.isArray(event)) {\n        for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {\n          vm.$off(event[i$1], fn);\n        }\n        return vm\n      }\n      // specific event\n      var cbs = vm._events[event];\n      if (!cbs) {\n        return vm\n      }\n      if (!fn) {\n        vm._events[event] = null;\n        return vm\n      }\n      // specific handler\n      var cb;\n      var i = cbs.length;\n      while (i--) {\n        cb = cbs[i];\n        if (cb === fn || cb.fn === fn) {\n          cbs.splice(i, 1);\n          break\n        }\n      }\n      return vm\n    };\n\n    Vue.prototype.$emit = function (event) {\n      var vm = this;\n      {\n        var lowerCaseEvent = event.toLowerCase();\n        if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {\n          tip(\n            \"Event \\\"\" + lowerCaseEvent + \"\\\" is emitted in component \" +\n            (formatComponentName(vm)) + \" but the handler is registered for \\\"\" + event + \"\\\". \" +\n            \"Note that HTML attributes are case-insensitive and you cannot use \" +\n            \"v-on to listen to camelCase events when using in-DOM templates. \" +\n            \"You should probably use \\\"\" + (hyphenate(event)) + \"\\\" instead of \\\"\" + event + \"\\\".\"\n          );\n        }\n      }\n      var cbs = vm._events[event];\n      if (cbs) {\n        cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n        var args = toArray(arguments, 1);\n        var info = \"event handler for \\\"\" + event + \"\\\"\";\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          invokeWithErrorHandling(cbs[i], vm, args, vm, info);\n        }\n      }\n      return vm\n    };\n  }\n\n  /*  */\n\n  var activeInstance = null;\n  var isUpdatingChildComponent = false;\n\n  function setActiveInstance(vm) {\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    return function () {\n      activeInstance = prevActiveInstance;\n    }\n  }\n\n  function initLifecycle (vm) {\n    var options = vm.$options;\n\n    // locate first non-abstract parent\n    var parent = options.parent;\n    if (parent && !options.abstract) {\n      while (parent.$options.abstract && parent.$parent) {\n        parent = parent.$parent;\n      }\n      parent.$children.push(vm);\n    }\n\n    vm.$parent = parent;\n    vm.$root = parent ? parent.$root : vm;\n\n    vm.$children = [];\n    vm.$refs = {};\n\n    vm._watcher = null;\n    vm._inactive = null;\n    vm._directInactive = false;\n    vm._isMounted = false;\n    vm._isDestroyed = false;\n    vm._isBeingDestroyed = false;\n  }\n\n  function lifecycleMixin (Vue) {\n    Vue.prototype._update = function (vnode, hydrating) {\n      var vm = this;\n      var prevEl = vm.$el;\n      var prevVnode = vm._vnode;\n      var restoreActiveInstance = setActiveInstance(vm);\n      vm._vnode = vnode;\n      // Vue.prototype.__patch__ is injected in entry points\n      // based on the rendering backend used.\n      if (!prevVnode) {\n        // initial render\n        vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);\n      } else {\n        // updates\n        vm.$el = vm.__patch__(prevVnode, vnode);\n      }\n      restoreActiveInstance();\n      // update __vue__ reference\n      if (prevEl) {\n        prevEl.__vue__ = null;\n      }\n      if (vm.$el) {\n        vm.$el.__vue__ = vm;\n      }\n      // if parent is an HOC, update its $el as well\n      if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n        vm.$parent.$el = vm.$el;\n      }\n      // updated hook is called by the scheduler to ensure that children are\n      // updated in a parent's updated hook.\n    };\n\n    Vue.prototype.$forceUpdate = function () {\n      var vm = this;\n      if (vm._watcher) {\n        vm._watcher.update();\n      }\n    };\n\n    Vue.prototype.$destroy = function () {\n      var vm = this;\n      if (vm._isBeingDestroyed) {\n        return\n      }\n      callHook(vm, 'beforeDestroy');\n      vm._isBeingDestroyed = true;\n      // remove self from parent\n      var parent = vm.$parent;\n      if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n        remove(parent.$children, vm);\n      }\n      // teardown watchers\n      if (vm._watcher) {\n        vm._watcher.teardown();\n      }\n      var i = vm._watchers.length;\n      while (i--) {\n        vm._watchers[i].teardown();\n      }\n      // remove reference from data ob\n      // frozen object may not have observer.\n      if (vm._data.__ob__) {\n        vm._data.__ob__.vmCount--;\n      }\n      // call the last hook...\n      vm._isDestroyed = true;\n      // invoke destroy hooks on current rendered tree\n      vm.__patch__(vm._vnode, null);\n      // fire destroyed hook\n      callHook(vm, 'destroyed');\n      // turn off all instance listeners.\n      vm.$off();\n      // remove __vue__ reference\n      if (vm.$el) {\n        vm.$el.__vue__ = null;\n      }\n      // release circular reference (#6759)\n      if (vm.$vnode) {\n        vm.$vnode.parent = null;\n      }\n    };\n  }\n\n  function mountComponent (\n    vm,\n    el,\n    hydrating\n  ) {\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = createEmptyVNode;\n      {\n        /* istanbul ignore if */\n        if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\n          vm.$options.el || el) {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'compiler is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n\n    var updateComponent;\n    /* istanbul ignore if */\n    if (config.performance && mark) {\n      updateComponent = function () {\n        var name = vm._name;\n        var id = vm._uid;\n        var startTag = \"vue-perf-start:\" + id;\n        var endTag = \"vue-perf-end:\" + id;\n\n        mark(startTag);\n        var vnode = vm._render();\n        mark(endTag);\n        measure((\"vue \" + name + \" render\"), startTag, endTag);\n\n        mark(startTag);\n        vm._update(vnode, hydrating);\n        mark(endTag);\n        measure((\"vue \" + name + \" patch\"), startTag, endTag);\n      };\n    } else {\n      updateComponent = function () {\n        vm._update(vm._render(), hydrating);\n      };\n    }\n\n    // we set this to vm._watcher inside the watcher's constructor\n    // since the watcher's initial patch may call $forceUpdate (e.g. inside child\n    // component's mounted hook), which relies on vm._watcher being already defined\n    new Watcher(vm, updateComponent, noop, {\n      before: function before () {\n        if (vm._isMounted && !vm._isDestroyed) {\n          callHook(vm, 'beforeUpdate');\n        }\n      }\n    }, true /* isRenderWatcher */);\n    hydrating = false;\n\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  }\n\n  function updateChildComponent (\n    vm,\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    {\n      isUpdatingChildComponent = true;\n    }\n\n    // determine whether component has slot children\n    // we need to do this before overwriting $options._renderChildren.\n\n    // check if there are dynamic scopedSlots (hand-written or compiled but with\n    // dynamic slot names). Static scoped slots compiled from template has the\n    // \"$stable\" marker.\n    var newScopedSlots = parentVnode.data.scopedSlots;\n    var oldScopedSlots = vm.$scopedSlots;\n    var hasDynamicScopedSlot = !!(\n      (newScopedSlots && !newScopedSlots.$stable) ||\n      (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||\n      (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)\n    );\n\n    // Any static slot children from the parent may have changed during parent's\n    // update. Dynamic scoped slots may also have changed. In such cases, a forced\n    // update is necessary to ensure correctness.\n    var needsForceUpdate = !!(\n      renderChildren ||               // has new static slots\n      vm.$options._renderChildren ||  // has old static slots\n      hasDynamicScopedSlot\n    );\n\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n\n    // update $attrs and $listeners hash\n    // these are also reactive so they may trigger child update if the child\n    // used them during render\n    vm.$attrs = parentVnode.data.attrs || emptyObject;\n    vm.$listeners = listeners || emptyObject;\n\n    // update props\n    if (propsData && vm.$options.props) {\n      toggleObserving(false);\n      var props = vm._props;\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        var propOptions = vm.$options.props; // wtf flow?\n        props[key] = validateProp(key, propOptions, propsData, vm);\n      }\n      toggleObserving(true);\n      // keep a copy of raw propsData\n      vm.$options.propsData = propsData;\n    }\n\n    // update listeners\n    listeners = listeners || emptyObject;\n    var oldListeners = vm.$options._parentListeners;\n    vm.$options._parentListeners = listeners;\n    updateComponentListeners(vm, listeners, oldListeners);\n\n    // resolve slots + force update if has children\n    if (needsForceUpdate) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n\n    {\n      isUpdatingChildComponent = false;\n    }\n  }\n\n  function isInInactiveTree (vm) {\n    while (vm && (vm = vm.$parent)) {\n      if (vm._inactive) { return true }\n    }\n    return false\n  }\n\n  function activateChildComponent (vm, direct) {\n    if (direct) {\n      vm._directInactive = false;\n      if (isInInactiveTree(vm)) {\n        return\n      }\n    } else if (vm._directInactive) {\n      return\n    }\n    if (vm._inactive || vm._inactive === null) {\n      vm._inactive = false;\n      for (var i = 0; i < vm.$children.length; i++) {\n        activateChildComponent(vm.$children[i]);\n      }\n      callHook(vm, 'activated');\n    }\n  }\n\n  function deactivateChildComponent (vm, direct) {\n    if (direct) {\n      vm._directInactive = true;\n      if (isInInactiveTree(vm)) {\n        return\n      }\n    }\n    if (!vm._inactive) {\n      vm._inactive = true;\n      for (var i = 0; i < vm.$children.length; i++) {\n        deactivateChildComponent(vm.$children[i]);\n      }\n      callHook(vm, 'deactivated');\n    }\n  }\n\n  function callHook (vm, hook) {\n    // #7573 disable dep collection when invoking lifecycle hooks\n    pushTarget();\n    var handlers = vm.$options[hook];\n    var info = hook + \" hook\";\n    if (handlers) {\n      for (var i = 0, j = handlers.length; i < j; i++) {\n        invokeWithErrorHandling(handlers[i], vm, null, vm, info);\n      }\n    }\n    if (vm._hasHookEvent) {\n      vm.$emit('hook:' + hook);\n    }\n    popTarget();\n  }\n\n  /*  */\n\n  var MAX_UPDATE_COUNT = 100;\n\n  var queue = [];\n  var activatedChildren = [];\n  var has = {};\n  var circular = {};\n  var waiting = false;\n  var flushing = false;\n  var index = 0;\n\n  /**\n   * Reset the scheduler's state.\n   */\n  function resetSchedulerState () {\n    index = queue.length = activatedChildren.length = 0;\n    has = {};\n    {\n      circular = {};\n    }\n    waiting = flushing = false;\n  }\n\n  // Async edge case #6566 requires saving the timestamp when event listeners are\n  // attached. However, calling performance.now() has a perf overhead especially\n  // if the page has thousands of event listeners. Instead, we take a timestamp\n  // every time the scheduler flushes and use that for all event listeners\n  // attached during that flush.\n  var currentFlushTimestamp = 0;\n\n  // Async edge case fix requires storing an event listener's attach timestamp.\n  var getNow = Date.now;\n\n  // Determine what event timestamp the browser is using. Annoyingly, the\n  // timestamp can either be hi-res (relative to page load) or low-res\n  // (relative to UNIX epoch), so in order to compare time we have to use the\n  // same timestamp type when saving the flush timestamp.\n  if (inBrowser && getNow() > document.createEvent('Event').timeStamp) {\n    // if the low-res timestamp which is bigger than the event timestamp\n    // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\n    // and we need to use the hi-res version for event listeners as well.\n    getNow = function () { return performance.now(); };\n  }\n\n  /**\n   * Flush both queues and run the watchers.\n   */\n  function flushSchedulerQueue () {\n    currentFlushTimestamp = getNow();\n    flushing = true;\n    var watcher, id;\n\n    // Sort queue before flush.\n    // This ensures that:\n    // 1. Components are updated from parent to child. (because parent is always\n    //    created before the child)\n    // 2. A component's user watchers are run before its render watcher (because\n    //    user watchers are created before the render watcher)\n    // 3. If a component is destroyed during a parent component's watcher run,\n    //    its watchers can be skipped.\n    queue.sort(function (a, b) { return a.id - b.id; });\n\n    // do not cache length because more watchers might be pushed\n    // as we run existing watchers\n    for (index = 0; index < queue.length; index++) {\n      watcher = queue[index];\n      if (watcher.before) {\n        watcher.before();\n      }\n      id = watcher.id;\n      has[id] = null;\n      watcher.run();\n      // in dev build, check and stop circular updates.\n      if (has[id] != null) {\n        circular[id] = (circular[id] || 0) + 1;\n        if (circular[id] > MAX_UPDATE_COUNT) {\n          warn(\n            'You may have an infinite update loop ' + (\n              watcher.user\n                ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n                : \"in a component render function.\"\n            ),\n            watcher.vm\n          );\n          break\n        }\n      }\n    }\n\n    // keep copies of post queues before resetting state\n    var activatedQueue = activatedChildren.slice();\n    var updatedQueue = queue.slice();\n\n    resetSchedulerState();\n\n    // call component updated and activated hooks\n    callActivatedHooks(activatedQueue);\n    callUpdatedHooks(updatedQueue);\n\n    // devtool hook\n    /* istanbul ignore if */\n    if (devtools && config.devtools) {\n      devtools.emit('flush');\n    }\n  }\n\n  function callUpdatedHooks (queue) {\n    var i = queue.length;\n    while (i--) {\n      var watcher = queue[i];\n      var vm = watcher.vm;\n      if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {\n        callHook(vm, 'updated');\n      }\n    }\n  }\n\n  /**\n   * Queue a kept-alive component that was activated during patch.\n   * The queue will be processed after the entire tree has been patched.\n   */\n  function queueActivatedComponent (vm) {\n    // setting _inactive to false here so that a render function can\n    // rely on checking whether it's in an inactive tree (e.g. router-view)\n    vm._inactive = false;\n    activatedChildren.push(vm);\n  }\n\n  function callActivatedHooks (queue) {\n    for (var i = 0; i < queue.length; i++) {\n      queue[i]._inactive = true;\n      activateChildComponent(queue[i], true /* true */);\n    }\n  }\n\n  /**\n   * Push a watcher into the watcher queue.\n   * Jobs with duplicate IDs will be skipped unless it's\n   * pushed when the queue is being flushed.\n   */\n  function queueWatcher (watcher) {\n    var id = watcher.id;\n    if (has[id] == null) {\n      has[id] = true;\n      if (!flushing) {\n        queue.push(watcher);\n      } else {\n        // if already flushing, splice the watcher based on its id\n        // if already past its id, it will be run next immediately.\n        var i = queue.length - 1;\n        while (i > index && queue[i].id > watcher.id) {\n          i--;\n        }\n        queue.splice(i + 1, 0, watcher);\n      }\n      // queue the flush\n      if (!waiting) {\n        waiting = true;\n\n        if (!config.async) {\n          flushSchedulerQueue();\n          return\n        }\n        nextTick(flushSchedulerQueue);\n      }\n    }\n  }\n\n  /*  */\n\n\n\n  var uid$2 = 0;\n\n  /**\n   * A watcher parses an expression, collects dependencies,\n   * and fires callback when the expression value changes.\n   * This is used for both the $watch() api and directives.\n   */\n  var Watcher = function Watcher (\n    vm,\n    expOrFn,\n    cb,\n    options,\n    isRenderWatcher\n  ) {\n    this.vm = vm;\n    if (isRenderWatcher) {\n      vm._watcher = this;\n    }\n    vm._watchers.push(this);\n    // options\n    if (options) {\n      this.deep = !!options.deep;\n      this.user = !!options.user;\n      this.lazy = !!options.lazy;\n      this.sync = !!options.sync;\n      this.before = options.before;\n    } else {\n      this.deep = this.user = this.lazy = this.sync = false;\n    }\n    this.cb = cb;\n    this.id = ++uid$2; // uid for batching\n    this.active = true;\n    this.dirty = this.lazy; // for lazy watchers\n    this.deps = [];\n    this.newDeps = [];\n    this.depIds = new _Set();\n    this.newDepIds = new _Set();\n    this.expression = expOrFn.toString();\n    // parse expression for getter\n    if (typeof expOrFn === 'function') {\n      this.getter = expOrFn;\n    } else {\n      this.getter = parsePath(expOrFn);\n      if (!this.getter) {\n        this.getter = noop;\n        warn(\n          \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n          'Watcher only accepts simple dot-delimited paths. ' +\n          'For full control, use a function instead.',\n          vm\n        );\n      }\n    }\n    this.value = this.lazy\n      ? undefined\n      : this.get();\n  };\n\n  /**\n   * Evaluate the getter, and re-collect dependencies.\n   */\n  Watcher.prototype.get = function get () {\n    pushTarget(this);\n    var value;\n    var vm = this.vm;\n    try {\n      value = this.getter.call(vm, vm);\n    } catch (e) {\n      if (this.user) {\n        handleError(e, vm, (\"getter for watcher \\\"\" + (this.expression) + \"\\\"\"));\n      } else {\n        throw e\n      }\n    } finally {\n      // \"touch\" every property so they are all tracked as\n      // dependencies for deep watching\n      if (this.deep) {\n        traverse(value);\n      }\n      popTarget();\n      this.cleanupDeps();\n    }\n    return value\n  };\n\n  /**\n   * Add a dependency to this directive.\n   */\n  Watcher.prototype.addDep = function addDep (dep) {\n    var id = dep.id;\n    if (!this.newDepIds.has(id)) {\n      this.newDepIds.add(id);\n      this.newDeps.push(dep);\n      if (!this.depIds.has(id)) {\n        dep.addSub(this);\n      }\n    }\n  };\n\n  /**\n   * Clean up for dependency collection.\n   */\n  Watcher.prototype.cleanupDeps = function cleanupDeps () {\n    var i = this.deps.length;\n    while (i--) {\n      var dep = this.deps[i];\n      if (!this.newDepIds.has(dep.id)) {\n        dep.removeSub(this);\n      }\n    }\n    var tmp = this.depIds;\n    this.depIds = this.newDepIds;\n    this.newDepIds = tmp;\n    this.newDepIds.clear();\n    tmp = this.deps;\n    this.deps = this.newDeps;\n    this.newDeps = tmp;\n    this.newDeps.length = 0;\n  };\n\n  /**\n   * Subscriber interface.\n   * Will be called when a dependency changes.\n   */\n  Watcher.prototype.update = function update () {\n    /* istanbul ignore else */\n    if (this.lazy) {\n      this.dirty = true;\n    } else if (this.sync) {\n      this.run();\n    } else {\n      queueWatcher(this);\n    }\n  };\n\n  /**\n   * Scheduler job interface.\n   * Will be called by the scheduler.\n   */\n  Watcher.prototype.run = function run () {\n    if (this.active) {\n      var value = this.get();\n      if (\n        value !== this.value ||\n        // Deep watchers and watchers on Object/Arrays should fire even\n        // when the value is the same, because the value may\n        // have mutated.\n        isObject(value) ||\n        this.deep\n      ) {\n        // set new value\n        var oldValue = this.value;\n        this.value = value;\n        if (this.user) {\n          try {\n            this.cb.call(this.vm, value, oldValue);\n          } catch (e) {\n            handleError(e, this.vm, (\"callback for watcher \\\"\" + (this.expression) + \"\\\"\"));\n          }\n        } else {\n          this.cb.call(this.vm, value, oldValue);\n        }\n      }\n    }\n  };\n\n  /**\n   * Evaluate the value of the watcher.\n   * This only gets called for lazy watchers.\n   */\n  Watcher.prototype.evaluate = function evaluate () {\n    this.value = this.get();\n    this.dirty = false;\n  };\n\n  /**\n   * Depend on all deps collected by this watcher.\n   */\n  Watcher.prototype.depend = function depend () {\n    var i = this.deps.length;\n    while (i--) {\n      this.deps[i].depend();\n    }\n  };\n\n  /**\n   * Remove self from all dependencies' subscriber list.\n   */\n  Watcher.prototype.teardown = function teardown () {\n    if (this.active) {\n      // remove self from vm's watcher list\n      // this is a somewhat expensive operation so we skip it\n      // if the vm is being destroyed.\n      if (!this.vm._isBeingDestroyed) {\n        remove(this.vm._watchers, this);\n      }\n      var i = this.deps.length;\n      while (i--) {\n        this.deps[i].removeSub(this);\n      }\n      this.active = false;\n    }\n  };\n\n  /*  */\n\n  var sharedPropertyDefinition = {\n    enumerable: true,\n    configurable: true,\n    get: noop,\n    set: noop\n  };\n\n  function proxy (target, sourceKey, key) {\n    sharedPropertyDefinition.get = function proxyGetter () {\n      return this[sourceKey][key]\n    };\n    sharedPropertyDefinition.set = function proxySetter (val) {\n      this[sourceKey][key] = val;\n    };\n    Object.defineProperty(target, key, sharedPropertyDefinition);\n  }\n\n  function initState (vm) {\n    vm._watchers = [];\n    var opts = vm.$options;\n    if (opts.props) { initProps(vm, opts.props); }\n    if (opts.methods) { initMethods(vm, opts.methods); }\n    if (opts.data) {\n      initData(vm);\n    } else {\n      observe(vm._data = {}, true /* asRootData */);\n    }\n    if (opts.computed) { initComputed(vm, opts.computed); }\n    if (opts.watch && opts.watch !== nativeWatch) {\n      initWatch(vm, opts.watch);\n    }\n  }\n\n  function initProps (vm, propsOptions) {\n    var propsData = vm.$options.propsData || {};\n    var props = vm._props = {};\n    // cache prop keys so that future props updates can iterate using Array\n    // instead of dynamic object key enumeration.\n    var keys = vm.$options._propKeys = [];\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    if (!isRoot) {\n      toggleObserving(false);\n    }\n    var loop = function ( key ) {\n      keys.push(key);\n      var value = validateProp(key, propsOptions, propsData, vm);\n      /* istanbul ignore else */\n      {\n        var hyphenatedKey = hyphenate(key);\n        if (isReservedAttribute(hyphenatedKey) ||\n            config.isReservedAttr(hyphenatedKey)) {\n          warn(\n            (\"\\\"\" + hyphenatedKey + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(props, key, value, function () {\n          if (!isRoot && !isUpdatingChildComponent) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n      // static props are already proxied on the component's prototype\n      // during Vue.extend(). We only need to proxy props defined at\n      // instantiation here.\n      if (!(key in vm)) {\n        proxy(vm, \"_props\", key);\n      }\n    };\n\n    for (var key in propsOptions) loop( key );\n    toggleObserving(true);\n  }\n\n  function initData (vm) {\n    var data = vm.$options.data;\n    data = vm._data = typeof data === 'function'\n      ? getData(data, vm)\n      : data || {};\n    if (!isPlainObject(data)) {\n      data = {};\n      warn(\n        'data functions should return an object:\\n' +\n        'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',\n        vm\n      );\n    }\n    // proxy data on instance\n    var keys = Object.keys(data);\n    var props = vm.$options.props;\n    var methods = vm.$options.methods;\n    var i = keys.length;\n    while (i--) {\n      var key = keys[i];\n      {\n        if (methods && hasOwn(methods, key)) {\n          warn(\n            (\"Method \\\"\" + key + \"\\\" has already been defined as a data property.\"),\n            vm\n          );\n        }\n      }\n      if (props && hasOwn(props, key)) {\n        warn(\n          \"The data property \\\"\" + key + \"\\\" is already declared as a prop. \" +\n          \"Use prop default value instead.\",\n          vm\n        );\n      } else if (!isReserved(key)) {\n        proxy(vm, \"_data\", key);\n      }\n    }\n    // observe data\n    observe(data, true /* asRootData */);\n  }\n\n  function getData (data, vm) {\n    // #7573 disable dep collection when invoking data getters\n    pushTarget();\n    try {\n      return data.call(vm, vm)\n    } catch (e) {\n      handleError(e, vm, \"data()\");\n      return {}\n    } finally {\n      popTarget();\n    }\n  }\n\n  var computedWatcherOptions = { lazy: true };\n\n  function initComputed (vm, computed) {\n    // $flow-disable-line\n    var watchers = vm._computedWatchers = Object.create(null);\n    // computed properties are just getters during SSR\n    var isSSR = isServerRendering();\n\n    for (var key in computed) {\n      var userDef = computed[key];\n      var getter = typeof userDef === 'function' ? userDef : userDef.get;\n      if (getter == null) {\n        warn(\n          (\"Getter is missing for computed property \\\"\" + key + \"\\\".\"),\n          vm\n        );\n      }\n\n      if (!isSSR) {\n        // create internal watcher for the computed property.\n        watchers[key] = new Watcher(\n          vm,\n          getter || noop,\n          noop,\n          computedWatcherOptions\n        );\n      }\n\n      // component-defined computed properties are already defined on the\n      // component prototype. We only need to define computed properties defined\n      // at instantiation here.\n      if (!(key in vm)) {\n        defineComputed(vm, key, userDef);\n      } else {\n        if (key in vm.$data) {\n          warn((\"The computed property \\\"\" + key + \"\\\" is already defined in data.\"), vm);\n        } else if (vm.$options.props && key in vm.$options.props) {\n          warn((\"The computed property \\\"\" + key + \"\\\" is already defined as a prop.\"), vm);\n        }\n      }\n    }\n  }\n\n  function defineComputed (\n    target,\n    key,\n    userDef\n  ) {\n    var shouldCache = !isServerRendering();\n    if (typeof userDef === 'function') {\n      sharedPropertyDefinition.get = shouldCache\n        ? createComputedGetter(key)\n        : createGetterInvoker(userDef);\n      sharedPropertyDefinition.set = noop;\n    } else {\n      sharedPropertyDefinition.get = userDef.get\n        ? shouldCache && userDef.cache !== false\n          ? createComputedGetter(key)\n          : createGetterInvoker(userDef.get)\n        : noop;\n      sharedPropertyDefinition.set = userDef.set || noop;\n    }\n    if (sharedPropertyDefinition.set === noop) {\n      sharedPropertyDefinition.set = function () {\n        warn(\n          (\"Computed property \\\"\" + key + \"\\\" was assigned to but it has no setter.\"),\n          this\n        );\n      };\n    }\n    Object.defineProperty(target, key, sharedPropertyDefinition);\n  }\n\n  function createComputedGetter (key) {\n    return function computedGetter () {\n      var watcher = this._computedWatchers && this._computedWatchers[key];\n      if (watcher) {\n        if (watcher.dirty) {\n          watcher.evaluate();\n        }\n        if (Dep.target) {\n          watcher.depend();\n        }\n        return watcher.value\n      }\n    }\n  }\n\n  function createGetterInvoker(fn) {\n    return function computedGetter () {\n      return fn.call(this, this)\n    }\n  }\n\n  function initMethods (vm, methods) {\n    var props = vm.$options.props;\n    for (var key in methods) {\n      {\n        if (typeof methods[key] !== 'function') {\n          warn(\n            \"Method \\\"\" + key + \"\\\" has type \\\"\" + (typeof methods[key]) + \"\\\" in the component definition. \" +\n            \"Did you reference the function correctly?\",\n            vm\n          );\n        }\n        if (props && hasOwn(props, key)) {\n          warn(\n            (\"Method \\\"\" + key + \"\\\" has already been defined as a prop.\"),\n            vm\n          );\n        }\n        if ((key in vm) && isReserved(key)) {\n          warn(\n            \"Method \\\"\" + key + \"\\\" conflicts with an existing Vue instance method. \" +\n            \"Avoid defining component methods that start with _ or $.\"\n          );\n        }\n      }\n      vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);\n    }\n  }\n\n  function initWatch (vm, watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n\n  function createWatcher (\n    vm,\n    expOrFn,\n    handler,\n    options\n  ) {\n    if (isPlainObject(handler)) {\n      options = handler;\n      handler = handler.handler;\n    }\n    if (typeof handler === 'string') {\n      handler = vm[handler];\n    }\n    return vm.$watch(expOrFn, handler, options)\n  }\n\n  function stateMixin (Vue) {\n    // flow somehow has problems with directly declared definition object\n    // when using Object.defineProperty, so we have to procedurally build up\n    // the object here.\n    var dataDef = {};\n    dataDef.get = function () { return this._data };\n    var propsDef = {};\n    propsDef.get = function () { return this._props };\n    {\n      dataDef.set = function () {\n        warn(\n          'Avoid replacing instance root $data. ' +\n          'Use nested data properties instead.',\n          this\n        );\n      };\n      propsDef.set = function () {\n        warn(\"$props is readonly.\", this);\n      };\n    }\n    Object.defineProperty(Vue.prototype, '$data', dataDef);\n    Object.defineProperty(Vue.prototype, '$props', propsDef);\n\n    Vue.prototype.$set = set;\n    Vue.prototype.$delete = del;\n\n    Vue.prototype.$watch = function (\n      expOrFn,\n      cb,\n      options\n    ) {\n      var vm = this;\n      if (isPlainObject(cb)) {\n        return createWatcher(vm, expOrFn, cb, options)\n      }\n      options = options || {};\n      options.user = true;\n      var watcher = new Watcher(vm, expOrFn, cb, options);\n      if (options.immediate) {\n        try {\n          cb.call(vm, watcher.value);\n        } catch (error) {\n          handleError(error, vm, (\"callback for immediate watcher \\\"\" + (watcher.expression) + \"\\\"\"));\n        }\n      }\n      return function unwatchFn () {\n        watcher.teardown();\n      }\n    };\n  }\n\n  /*  */\n\n  var uid$3 = 0;\n\n  function initMixin (Vue) {\n    Vue.prototype._init = function (options) {\n      var vm = this;\n      // a uid\n      vm._uid = uid$3++;\n\n      var startTag, endTag;\n      /* istanbul ignore if */\n      if (config.performance && mark) {\n        startTag = \"vue-perf-start:\" + (vm._uid);\n        endTag = \"vue-perf-end:\" + (vm._uid);\n        mark(startTag);\n      }\n\n      // a flag to avoid this being observed\n      vm._isVue = true;\n      // merge options\n      if (options && options._isComponent) {\n        // optimize internal component instantiation\n        // since dynamic options merging is pretty slow, and none of the\n        // internal component options needs special treatment.\n        initInternalComponent(vm, options);\n      } else {\n        vm.$options = mergeOptions(\n          resolveConstructorOptions(vm.constructor),\n          options || {},\n          vm\n        );\n      }\n      /* istanbul ignore else */\n      {\n        initProxy(vm);\n      }\n      // expose real self\n      vm._self = vm;\n      initLifecycle(vm);\n      initEvents(vm);\n      initRender(vm);\n      callHook(vm, 'beforeCreate');\n      initInjections(vm); // resolve injections before data/props\n      initState(vm);\n      initProvide(vm); // resolve provide after data/props\n      callHook(vm, 'created');\n\n      /* istanbul ignore if */\n      if (config.performance && mark) {\n        vm._name = formatComponentName(vm, false);\n        mark(endTag);\n        measure((\"vue \" + (vm._name) + \" init\"), startTag, endTag);\n      }\n\n      if (vm.$options.el) {\n        vm.$mount(vm.$options.el);\n      }\n    };\n  }\n\n  function initInternalComponent (vm, options) {\n    var opts = vm.$options = Object.create(vm.constructor.options);\n    // doing this because it's faster than dynamic enumeration.\n    var parentVnode = options._parentVnode;\n    opts.parent = options.parent;\n    opts._parentVnode = parentVnode;\n\n    var vnodeComponentOptions = parentVnode.componentOptions;\n    opts.propsData = vnodeComponentOptions.propsData;\n    opts._parentListeners = vnodeComponentOptions.listeners;\n    opts._renderChildren = vnodeComponentOptions.children;\n    opts._componentTag = vnodeComponentOptions.tag;\n\n    if (options.render) {\n      opts.render = options.render;\n      opts.staticRenderFns = options.staticRenderFns;\n    }\n  }\n\n  function resolveConstructorOptions (Ctor) {\n    var options = Ctor.options;\n    if (Ctor.super) {\n      var superOptions = resolveConstructorOptions(Ctor.super);\n      var cachedSuperOptions = Ctor.superOptions;\n      if (superOptions !== cachedSuperOptions) {\n        // super option changed,\n        // need to resolve new options.\n        Ctor.superOptions = superOptions;\n        // check if there are any late-modified/attached options (#4976)\n        var modifiedOptions = resolveModifiedOptions(Ctor);\n        // update base extend options\n        if (modifiedOptions) {\n          extend(Ctor.extendOptions, modifiedOptions);\n        }\n        options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);\n        if (options.name) {\n          options.components[options.name] = Ctor;\n        }\n      }\n    }\n    return options\n  }\n\n  function resolveModifiedOptions (Ctor) {\n    var modified;\n    var latest = Ctor.options;\n    var sealed = Ctor.sealedOptions;\n    for (var key in latest) {\n      if (latest[key] !== sealed[key]) {\n        if (!modified) { modified = {}; }\n        modified[key] = latest[key];\n      }\n    }\n    return modified\n  }\n\n  function Vue (options) {\n    if (!(this instanceof Vue)\n    ) {\n      warn('Vue is a constructor and should be called with the `new` keyword');\n    }\n    this._init(options);\n  }\n\n  initMixin(Vue);\n  stateMixin(Vue);\n  eventsMixin(Vue);\n  lifecycleMixin(Vue);\n  renderMixin(Vue);\n\n  /*  */\n\n  function initUse (Vue) {\n    Vue.use = function (plugin) {\n      var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));\n      if (installedPlugins.indexOf(plugin) > -1) {\n        return this\n      }\n\n      // additional parameters\n      var args = toArray(arguments, 1);\n      args.unshift(this);\n      if (typeof plugin.install === 'function') {\n        plugin.install.apply(plugin, args);\n      } else if (typeof plugin === 'function') {\n        plugin.apply(null, args);\n      }\n      installedPlugins.push(plugin);\n      return this\n    };\n  }\n\n  /*  */\n\n  function initMixin$1 (Vue) {\n    Vue.mixin = function (mixin) {\n      this.options = mergeOptions(this.options, mixin);\n      return this\n    };\n  }\n\n  /*  */\n\n  function initExtend (Vue) {\n    /**\n     * Each instance constructor, including Vue, has a unique\n     * cid. This enables us to create wrapped \"child\n     * constructors\" for prototypal inheritance and cache them.\n     */\n    Vue.cid = 0;\n    var cid = 1;\n\n    /**\n     * Class inheritance\n     */\n    Vue.extend = function (extendOptions) {\n      extendOptions = extendOptions || {};\n      var Super = this;\n      var SuperId = Super.cid;\n      var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n      if (cachedCtors[SuperId]) {\n        return cachedCtors[SuperId]\n      }\n\n      var name = extendOptions.name || Super.options.name;\n      if (name) {\n        validateComponentName(name);\n      }\n\n      var Sub = function VueComponent (options) {\n        this._init(options);\n      };\n      Sub.prototype = Object.create(Super.prototype);\n      Sub.prototype.constructor = Sub;\n      Sub.cid = cid++;\n      Sub.options = mergeOptions(\n        Super.options,\n        extendOptions\n      );\n      Sub['super'] = Super;\n\n      // For props and computed properties, we define the proxy getters on\n      // the Vue instances at extension time, on the extended prototype. This\n      // avoids Object.defineProperty calls for each instance created.\n      if (Sub.options.props) {\n        initProps$1(Sub);\n      }\n      if (Sub.options.computed) {\n        initComputed$1(Sub);\n      }\n\n      // allow further extension/mixin/plugin usage\n      Sub.extend = Super.extend;\n      Sub.mixin = Super.mixin;\n      Sub.use = Super.use;\n\n      // create asset registers, so extended classes\n      // can have their private assets too.\n      ASSET_TYPES.forEach(function (type) {\n        Sub[type] = Super[type];\n      });\n      // enable recursive self-lookup\n      if (name) {\n        Sub.options.components[name] = Sub;\n      }\n\n      // keep a reference to the super options at extension time.\n      // later at instantiation we can check if Super's options have\n      // been updated.\n      Sub.superOptions = Super.options;\n      Sub.extendOptions = extendOptions;\n      Sub.sealedOptions = extend({}, Sub.options);\n\n      // cache constructor\n      cachedCtors[SuperId] = Sub;\n      return Sub\n    };\n  }\n\n  function initProps$1 (Comp) {\n    var props = Comp.options.props;\n    for (var key in props) {\n      proxy(Comp.prototype, \"_props\", key);\n    }\n  }\n\n  function initComputed$1 (Comp) {\n    var computed = Comp.options.computed;\n    for (var key in computed) {\n      defineComputed(Comp.prototype, key, computed[key]);\n    }\n  }\n\n  /*  */\n\n  function initAssetRegisters (Vue) {\n    /**\n     * Create asset registration methods.\n     */\n    ASSET_TYPES.forEach(function (type) {\n      Vue[type] = function (\n        id,\n        definition\n      ) {\n        if (!definition) {\n          return this.options[type + 's'][id]\n        } else {\n          /* istanbul ignore if */\n          if (type === 'component') {\n            validateComponentName(id);\n          }\n          if (type === 'component' && isPlainObject(definition)) {\n            definition.name = definition.name || id;\n            definition = this.options._base.extend(definition);\n          }\n          if (type === 'directive' && typeof definition === 'function') {\n            definition = { bind: definition, update: definition };\n          }\n          this.options[type + 's'][id] = definition;\n          return definition\n        }\n      };\n    });\n  }\n\n  /*  */\n\n\n\n  function getComponentName (opts) {\n    return opts && (opts.Ctor.options.name || opts.tag)\n  }\n\n  function matches (pattern, name) {\n    if (Array.isArray(pattern)) {\n      return pattern.indexOf(name) > -1\n    } else if (typeof pattern === 'string') {\n      return pattern.split(',').indexOf(name) > -1\n    } else if (isRegExp(pattern)) {\n      return pattern.test(name)\n    }\n    /* istanbul ignore next */\n    return false\n  }\n\n  function pruneCache (keepAliveInstance, filter) {\n    var cache = keepAliveInstance.cache;\n    var keys = keepAliveInstance.keys;\n    var _vnode = keepAliveInstance._vnode;\n    for (var key in cache) {\n      var cachedNode = cache[key];\n      if (cachedNode) {\n        var name = getComponentName(cachedNode.componentOptions);\n        if (name && !filter(name)) {\n          pruneCacheEntry(cache, key, keys, _vnode);\n        }\n      }\n    }\n  }\n\n  function pruneCacheEntry (\n    cache,\n    key,\n    keys,\n    current\n  ) {\n    var cached$$1 = cache[key];\n    if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {\n      cached$$1.componentInstance.$destroy();\n    }\n    cache[key] = null;\n    remove(keys, key);\n  }\n\n  var patternTypes = [String, RegExp, Array];\n\n  var KeepAlive = {\n    name: 'keep-alive',\n    abstract: true,\n\n    props: {\n      include: patternTypes,\n      exclude: patternTypes,\n      max: [String, Number]\n    },\n\n    created: function created () {\n      this.cache = Object.create(null);\n      this.keys = [];\n    },\n\n    destroyed: function destroyed () {\n      for (var key in this.cache) {\n        pruneCacheEntry(this.cache, key, this.keys);\n      }\n    },\n\n    mounted: function mounted () {\n      var this$1 = this;\n\n      this.$watch('include', function (val) {\n        pruneCache(this$1, function (name) { return matches(val, name); });\n      });\n      this.$watch('exclude', function (val) {\n        pruneCache(this$1, function (name) { return !matches(val, name); });\n      });\n    },\n\n    render: function render () {\n      var slot = this.$slots.default;\n      var vnode = getFirstComponentChild(slot);\n      var componentOptions = vnode && vnode.componentOptions;\n      if (componentOptions) {\n        // check pattern\n        var name = getComponentName(componentOptions);\n        var ref = this;\n        var include = ref.include;\n        var exclude = ref.exclude;\n        if (\n          // not included\n          (include && (!name || !matches(include, name))) ||\n          // excluded\n          (exclude && name && matches(exclude, name))\n        ) {\n          return vnode\n        }\n\n        var ref$1 = this;\n        var cache = ref$1.cache;\n        var keys = ref$1.keys;\n        var key = vnode.key == null\n          // same constructor may get registered as different local components\n          // so cid alone is not enough (#3269)\n          ? componentOptions.Ctor.cid + (componentOptions.tag ? (\"::\" + (componentOptions.tag)) : '')\n          : vnode.key;\n        if (cache[key]) {\n          vnode.componentInstance = cache[key].componentInstance;\n          // make current key freshest\n          remove(keys, key);\n          keys.push(key);\n        } else {\n          cache[key] = vnode;\n          keys.push(key);\n          // prune oldest entry\n          if (this.max && keys.length > parseInt(this.max)) {\n            pruneCacheEntry(cache, keys[0], keys, this._vnode);\n          }\n        }\n\n        vnode.data.keepAlive = true;\n      }\n      return vnode || (slot && slot[0])\n    }\n  };\n\n  var builtInComponents = {\n    KeepAlive: KeepAlive\n  };\n\n  /*  */\n\n  function initGlobalAPI (Vue) {\n    // config\n    var configDef = {};\n    configDef.get = function () { return config; };\n    {\n      configDef.set = function () {\n        warn(\n          'Do not replace the Vue.config object, set individual fields instead.'\n        );\n      };\n    }\n    Object.defineProperty(Vue, 'config', configDef);\n\n    // exposed util methods.\n    // NOTE: these are not considered part of the public API - avoid relying on\n    // them unless you are aware of the risk.\n    Vue.util = {\n      warn: warn,\n      extend: extend,\n      mergeOptions: mergeOptions,\n      defineReactive: defineReactive$$1\n    };\n\n    Vue.set = set;\n    Vue.delete = del;\n    Vue.nextTick = nextTick;\n\n    // 2.6 explicit observable API\n    Vue.observable = function (obj) {\n      observe(obj);\n      return obj\n    };\n\n    Vue.options = Object.create(null);\n    ASSET_TYPES.forEach(function (type) {\n      Vue.options[type + 's'] = Object.create(null);\n    });\n\n    // this is used to identify the \"base\" constructor to extend all plain-object\n    // components with in Weex's multi-instance scenarios.\n    Vue.options._base = Vue;\n\n    extend(Vue.options.components, builtInComponents);\n\n    initUse(Vue);\n    initMixin$1(Vue);\n    initExtend(Vue);\n    initAssetRegisters(Vue);\n  }\n\n  initGlobalAPI(Vue);\n\n  Object.defineProperty(Vue.prototype, '$isServer', {\n    get: isServerRendering\n  });\n\n  Object.defineProperty(Vue.prototype, '$ssrContext', {\n    get: function get () {\n      /* istanbul ignore next */\n      return this.$vnode && this.$vnode.ssrContext\n    }\n  });\n\n  // expose FunctionalRenderContext for ssr runtime helper installation\n  Object.defineProperty(Vue, 'FunctionalRenderContext', {\n    value: FunctionalRenderContext\n  });\n\n  Vue.version = '2.6.7';\n\n  /*  */\n\n  // these are reserved for web because they are directly compiled away\n  // during template compilation\n  var isReservedAttr = makeMap('style,class');\n\n  // attributes that should be using props for binding\n  var acceptValue = makeMap('input,textarea,option,select,progress');\n  var mustUseProp = function (tag, type, attr) {\n    return (\n      (attr === 'value' && acceptValue(tag)) && type !== 'button' ||\n      (attr === 'selected' && tag === 'option') ||\n      (attr === 'checked' && tag === 'input') ||\n      (attr === 'muted' && tag === 'video')\n    )\n  };\n\n  var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\n  var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');\n\n  var convertEnumeratedValue = function (key, value) {\n    return isFalsyAttrValue(value) || value === 'false'\n      ? 'false'\n      // allow arbitrary string value for contenteditable\n      : key === 'contenteditable' && isValidContentEditableValue(value)\n        ? value\n        : 'true'\n  };\n\n  var isBooleanAttr = makeMap(\n    'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n    'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n    'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n    'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n    'required,reversed,scoped,seamless,selected,sortable,translate,' +\n    'truespeed,typemustmatch,visible'\n  );\n\n  var xlinkNS = 'http://www.w3.org/1999/xlink';\n\n  var isXlink = function (name) {\n    return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n  };\n\n  var getXlinkProp = function (name) {\n    return isXlink(name) ? name.slice(6, name.length) : ''\n  };\n\n  var isFalsyAttrValue = function (val) {\n    return val == null || val === false\n  };\n\n  /*  */\n\n  function genClassForVnode (vnode) {\n    var data = vnode.data;\n    var parentNode = vnode;\n    var childNode = vnode;\n    while (isDef(childNode.componentInstance)) {\n      childNode = childNode.componentInstance._vnode;\n      if (childNode && childNode.data) {\n        data = mergeClassData(childNode.data, data);\n      }\n    }\n    while (isDef(parentNode = parentNode.parent)) {\n      if (parentNode && parentNode.data) {\n        data = mergeClassData(data, parentNode.data);\n      }\n    }\n    return renderClass(data.staticClass, data.class)\n  }\n\n  function mergeClassData (child, parent) {\n    return {\n      staticClass: concat(child.staticClass, parent.staticClass),\n      class: isDef(child.class)\n        ? [child.class, parent.class]\n        : parent.class\n    }\n  }\n\n  function renderClass (\n    staticClass,\n    dynamicClass\n  ) {\n    if (isDef(staticClass) || isDef(dynamicClass)) {\n      return concat(staticClass, stringifyClass(dynamicClass))\n    }\n    /* istanbul ignore next */\n    return ''\n  }\n\n  function concat (a, b) {\n    return a ? b ? (a + ' ' + b) : a : (b || '')\n  }\n\n  function stringifyClass (value) {\n    if (Array.isArray(value)) {\n      return stringifyArray(value)\n    }\n    if (isObject(value)) {\n      return stringifyObject(value)\n    }\n    if (typeof value === 'string') {\n      return value\n    }\n    /* istanbul ignore next */\n    return ''\n  }\n\n  function stringifyArray (value) {\n    var res = '';\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {\n        if (res) { res += ' '; }\n        res += stringified;\n      }\n    }\n    return res\n  }\n\n  function stringifyObject (value) {\n    var res = '';\n    for (var key in value) {\n      if (value[key]) {\n        if (res) { res += ' '; }\n        res += key;\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  var namespaceMap = {\n    svg: 'http://www.w3.org/2000/svg',\n    math: 'http://www.w3.org/1998/Math/MathML'\n  };\n\n  var isHTMLTag = makeMap(\n    'html,body,base,head,link,meta,style,title,' +\n    'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n    'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +\n    'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n    's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n    'embed,object,param,source,canvas,script,noscript,del,ins,' +\n    'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n    'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n    'output,progress,select,textarea,' +\n    'details,dialog,menu,menuitem,summary,' +\n    'content,element,shadow,template,blockquote,iframe,tfoot'\n  );\n\n  // this map is intentionally selective, only covering SVG elements that may\n  // contain child elements.\n  var isSVG = makeMap(\n    'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\n    'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n    'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n    true\n  );\n\n  var isPreTag = function (tag) { return tag === 'pre'; };\n\n  var isReservedTag = function (tag) {\n    return isHTMLTag(tag) || isSVG(tag)\n  };\n\n  function getTagNamespace (tag) {\n    if (isSVG(tag)) {\n      return 'svg'\n    }\n    // basic support for MathML\n    // note it doesn't support other MathML elements being component roots\n    if (tag === 'math') {\n      return 'math'\n    }\n  }\n\n  var unknownElementCache = Object.create(null);\n  function isUnknownElement (tag) {\n    /* istanbul ignore if */\n    if (!inBrowser) {\n      return true\n    }\n    if (isReservedTag(tag)) {\n      return false\n    }\n    tag = tag.toLowerCase();\n    /* istanbul ignore if */\n    if (unknownElementCache[tag] != null) {\n      return unknownElementCache[tag]\n    }\n    var el = document.createElement(tag);\n    if (tag.indexOf('-') > -1) {\n      // http://stackoverflow.com/a/28210364/1070244\n      return (unknownElementCache[tag] = (\n        el.constructor === window.HTMLUnknownElement ||\n        el.constructor === window.HTMLElement\n      ))\n    } else {\n      return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n    }\n  }\n\n  var isTextInputType = makeMap('text,number,password,search,email,tel,url');\n\n  /*  */\n\n  /**\n   * Query an element selector if it's not an element already.\n   */\n  function query (el) {\n    if (typeof el === 'string') {\n      var selected = document.querySelector(el);\n      if (!selected) {\n        warn(\n          'Cannot find element: ' + el\n        );\n        return document.createElement('div')\n      }\n      return selected\n    } else {\n      return el\n    }\n  }\n\n  /*  */\n\n  function createElement$1 (tagName, vnode) {\n    var elm = document.createElement(tagName);\n    if (tagName !== 'select') {\n      return elm\n    }\n    // false or null will remove the attribute but undefined will not\n    if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {\n      elm.setAttribute('multiple', 'multiple');\n    }\n    return elm\n  }\n\n  function createElementNS (namespace, tagName) {\n    return document.createElementNS(namespaceMap[namespace], tagName)\n  }\n\n  function createTextNode (text) {\n    return document.createTextNode(text)\n  }\n\n  function createComment (text) {\n    return document.createComment(text)\n  }\n\n  function insertBefore (parentNode, newNode, referenceNode) {\n    parentNode.insertBefore(newNode, referenceNode);\n  }\n\n  function removeChild (node, child) {\n    node.removeChild(child);\n  }\n\n  function appendChild (node, child) {\n    node.appendChild(child);\n  }\n\n  function parentNode (node) {\n    return node.parentNode\n  }\n\n  function nextSibling (node) {\n    return node.nextSibling\n  }\n\n  function tagName (node) {\n    return node.tagName\n  }\n\n  function setTextContent (node, text) {\n    node.textContent = text;\n  }\n\n  function setStyleScope (node, scopeId) {\n    node.setAttribute(scopeId, '');\n  }\n\n  var nodeOps = /*#__PURE__*/Object.freeze({\n    createElement: createElement$1,\n    createElementNS: createElementNS,\n    createTextNode: createTextNode,\n    createComment: createComment,\n    insertBefore: insertBefore,\n    removeChild: removeChild,\n    appendChild: appendChild,\n    parentNode: parentNode,\n    nextSibling: nextSibling,\n    tagName: tagName,\n    setTextContent: setTextContent,\n    setStyleScope: setStyleScope\n  });\n\n  /*  */\n\n  var ref = {\n    create: function create (_, vnode) {\n      registerRef(vnode);\n    },\n    update: function update (oldVnode, vnode) {\n      if (oldVnode.data.ref !== vnode.data.ref) {\n        registerRef(oldVnode, true);\n        registerRef(vnode);\n      }\n    },\n    destroy: function destroy (vnode) {\n      registerRef(vnode, true);\n    }\n  };\n\n  function registerRef (vnode, isRemoval) {\n    var key = vnode.data.ref;\n    if (!isDef(key)) { return }\n\n    var vm = vnode.context;\n    var ref = vnode.componentInstance || vnode.elm;\n    var refs = vm.$refs;\n    if (isRemoval) {\n      if (Array.isArray(refs[key])) {\n        remove(refs[key], ref);\n      } else if (refs[key] === ref) {\n        refs[key] = undefined;\n      }\n    } else {\n      if (vnode.data.refInFor) {\n        if (!Array.isArray(refs[key])) {\n          refs[key] = [ref];\n        } else if (refs[key].indexOf(ref) < 0) {\n          // $flow-disable-line\n          refs[key].push(ref);\n        }\n      } else {\n        refs[key] = ref;\n      }\n    }\n  }\n\n  /**\n   * Virtual DOM patching algorithm based on Snabbdom by\n   * Simon Friis Vindum (@paldepind)\n   * Licensed under the MIT License\n   * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n   *\n   * modified by Evan You (@yyx990803)\n   *\n   * Not type-checking this because this file is perf-critical and the cost\n   * of making flow understand it is not worth it.\n   */\n\n  var emptyNode = new VNode('', {}, []);\n\n  var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];\n\n  function sameVnode (a, b) {\n    return (\n      a.key === b.key && (\n        (\n          a.tag === b.tag &&\n          a.isComment === b.isComment &&\n          isDef(a.data) === isDef(b.data) &&\n          sameInputType(a, b)\n        ) || (\n          isTrue(a.isAsyncPlaceholder) &&\n          a.asyncFactory === b.asyncFactory &&\n          isUndef(b.asyncFactory.error)\n        )\n      )\n    )\n  }\n\n  function sameInputType (a, b) {\n    if (a.tag !== 'input') { return true }\n    var i;\n    var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;\n    var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;\n    return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)\n  }\n\n  function createKeyToOldIdx (children, beginIdx, endIdx) {\n    var i, key;\n    var map = {};\n    for (i = beginIdx; i <= endIdx; ++i) {\n      key = children[i].key;\n      if (isDef(key)) { map[key] = i; }\n    }\n    return map\n  }\n\n  function createPatchFunction (backend) {\n    var i, j;\n    var cbs = {};\n\n    var modules = backend.modules;\n    var nodeOps = backend.nodeOps;\n\n    for (i = 0; i < hooks.length; ++i) {\n      cbs[hooks[i]] = [];\n      for (j = 0; j < modules.length; ++j) {\n        if (isDef(modules[j][hooks[i]])) {\n          cbs[hooks[i]].push(modules[j][hooks[i]]);\n        }\n      }\n    }\n\n    function emptyNodeAt (elm) {\n      return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n    }\n\n    function createRmCb (childElm, listeners) {\n      function remove$$1 () {\n        if (--remove$$1.listeners === 0) {\n          removeNode(childElm);\n        }\n      }\n      remove$$1.listeners = listeners;\n      return remove$$1\n    }\n\n    function removeNode (el) {\n      var parent = nodeOps.parentNode(el);\n      // element may have already been removed due to v-html / v-text\n      if (isDef(parent)) {\n        nodeOps.removeChild(parent, el);\n      }\n    }\n\n    function isUnknownElement$$1 (vnode, inVPre) {\n      return (\n        !inVPre &&\n        !vnode.ns &&\n        !(\n          config.ignoredElements.length &&\n          config.ignoredElements.some(function (ignore) {\n            return isRegExp(ignore)\n              ? ignore.test(vnode.tag)\n              : ignore === vnode.tag\n          })\n        ) &&\n        config.isUnknownElement(vnode.tag)\n      )\n    }\n\n    var creatingElmInVPre = 0;\n\n    function createElm (\n      vnode,\n      insertedVnodeQueue,\n      parentElm,\n      refElm,\n      nested,\n      ownerArray,\n      index\n    ) {\n      if (isDef(vnode.elm) && isDef(ownerArray)) {\n        // This vnode was used in a previous render!\n        // now it's used as a new node, overwriting its elm would cause\n        // potential patch errors down the road when it's used as an insertion\n        // reference node. Instead, we clone the node on-demand before creating\n        // associated DOM element for it.\n        vnode = ownerArray[index] = cloneVNode(vnode);\n      }\n\n      vnode.isRootInsert = !nested; // for transition enter check\n      if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n        return\n      }\n\n      var data = vnode.data;\n      var children = vnode.children;\n      var tag = vnode.tag;\n      if (isDef(tag)) {\n        {\n          if (data && data.pre) {\n            creatingElmInVPre++;\n          }\n          if (isUnknownElement$$1(vnode, creatingElmInVPre)) {\n            warn(\n              'Unknown custom element: <' + tag + '> - did you ' +\n              'register the component correctly? For recursive components, ' +\n              'make sure to provide the \"name\" option.',\n              vnode.context\n            );\n          }\n        }\n\n        vnode.elm = vnode.ns\n          ? nodeOps.createElementNS(vnode.ns, tag)\n          : nodeOps.createElement(tag, vnode);\n        setScope(vnode);\n\n        /* istanbul ignore if */\n        {\n          createChildren(vnode, children, insertedVnodeQueue);\n          if (isDef(data)) {\n            invokeCreateHooks(vnode, insertedVnodeQueue);\n          }\n          insert(parentElm, vnode.elm, refElm);\n        }\n\n        if (data && data.pre) {\n          creatingElmInVPre--;\n        }\n      } else if (isTrue(vnode.isComment)) {\n        vnode.elm = nodeOps.createComment(vnode.text);\n        insert(parentElm, vnode.elm, refElm);\n      } else {\n        vnode.elm = nodeOps.createTextNode(vnode.text);\n        insert(parentElm, vnode.elm, refElm);\n      }\n    }\n\n    function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n      var i = vnode.data;\n      if (isDef(i)) {\n        var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;\n        if (isDef(i = i.hook) && isDef(i = i.init)) {\n          i(vnode, false /* hydrating */);\n        }\n        // after calling the init hook, if the vnode is a child component\n        // it should've created a child instance and mounted it. the child\n        // component also has set the placeholder vnode's elm.\n        // in that case we can just return the element and be done.\n        if (isDef(vnode.componentInstance)) {\n          initComponent(vnode, insertedVnodeQueue);\n          insert(parentElm, vnode.elm, refElm);\n          if (isTrue(isReactivated)) {\n            reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n          }\n          return true\n        }\n      }\n    }\n\n    function initComponent (vnode, insertedVnodeQueue) {\n      if (isDef(vnode.data.pendingInsert)) {\n        insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n        vnode.data.pendingInsert = null;\n      }\n      vnode.elm = vnode.componentInstance.$el;\n      if (isPatchable(vnode)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n        setScope(vnode);\n      } else {\n        // empty component root.\n        // skip all element-related modules except for ref (#3455)\n        registerRef(vnode);\n        // make sure to invoke the insert hook\n        insertedVnodeQueue.push(vnode);\n      }\n    }\n\n    function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n      var i;\n      // hack for #4339: a reactivated component with inner transition\n      // does not trigger because the inner node's created hooks are not called\n      // again. It's not ideal to involve module-specific logic in here but\n      // there doesn't seem to be a better way to do it.\n      var innerNode = vnode;\n      while (innerNode.componentInstance) {\n        innerNode = innerNode.componentInstance._vnode;\n        if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n          for (i = 0; i < cbs.activate.length; ++i) {\n            cbs.activate[i](emptyNode, innerNode);\n          }\n          insertedVnodeQueue.push(innerNode);\n          break\n        }\n      }\n      // unlike a newly created component,\n      // a reactivated keep-alive component doesn't insert itself\n      insert(parentElm, vnode.elm, refElm);\n    }\n\n    function insert (parent, elm, ref$$1) {\n      if (isDef(parent)) {\n        if (isDef(ref$$1)) {\n          if (nodeOps.parentNode(ref$$1) === parent) {\n            nodeOps.insertBefore(parent, elm, ref$$1);\n          }\n        } else {\n          nodeOps.appendChild(parent, elm);\n        }\n      }\n    }\n\n    function createChildren (vnode, children, insertedVnodeQueue) {\n      if (Array.isArray(children)) {\n        {\n          checkDuplicateKeys(children);\n        }\n        for (var i = 0; i < children.length; ++i) {\n          createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);\n        }\n      } else if (isPrimitive(vnode.text)) {\n        nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));\n      }\n    }\n\n    function isPatchable (vnode) {\n      while (vnode.componentInstance) {\n        vnode = vnode.componentInstance._vnode;\n      }\n      return isDef(vnode.tag)\n    }\n\n    function invokeCreateHooks (vnode, insertedVnodeQueue) {\n      for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n        cbs.create[i$1](emptyNode, vnode);\n      }\n      i = vnode.data.hook; // Reuse variable\n      if (isDef(i)) {\n        if (isDef(i.create)) { i.create(emptyNode, vnode); }\n        if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }\n      }\n    }\n\n    // set scope id attribute for scoped CSS.\n    // this is implemented as a special case to avoid the overhead\n    // of going through the normal attribute patching process.\n    function setScope (vnode) {\n      var i;\n      if (isDef(i = vnode.fnScopeId)) {\n        nodeOps.setStyleScope(vnode.elm, i);\n      } else {\n        var ancestor = vnode;\n        while (ancestor) {\n          if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n            nodeOps.setStyleScope(vnode.elm, i);\n          }\n          ancestor = ancestor.parent;\n        }\n      }\n      // for slot content they should also get the scopeId from the host instance.\n      if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        i !== vnode.fnContext &&\n        isDef(i = i.$options._scopeId)\n      ) {\n        nodeOps.setStyleScope(vnode.elm, i);\n      }\n    }\n\n    function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n      for (; startIdx <= endIdx; ++startIdx) {\n        createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);\n      }\n    }\n\n    function invokeDestroyHook (vnode) {\n      var i, j;\n      var data = vnode.data;\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n        for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n      }\n      if (isDef(i = vnode.children)) {\n        for (j = 0; j < vnode.children.length; ++j) {\n          invokeDestroyHook(vnode.children[j]);\n        }\n      }\n    }\n\n    function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n      for (; startIdx <= endIdx; ++startIdx) {\n        var ch = vnodes[startIdx];\n        if (isDef(ch)) {\n          if (isDef(ch.tag)) {\n            removeAndInvokeRemoveHook(ch);\n            invokeDestroyHook(ch);\n          } else { // Text node\n            removeNode(ch.elm);\n          }\n        }\n      }\n    }\n\n    function removeAndInvokeRemoveHook (vnode, rm) {\n      if (isDef(rm) || isDef(vnode.data)) {\n        var i;\n        var listeners = cbs.remove.length + 1;\n        if (isDef(rm)) {\n          // we have a recursively passed down rm callback\n          // increase the listeners count\n          rm.listeners += listeners;\n        } else {\n          // directly removing\n          rm = createRmCb(vnode.elm, listeners);\n        }\n        // recursively invoke hooks on child component root node\n        if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {\n          removeAndInvokeRemoveHook(i, rm);\n        }\n        for (i = 0; i < cbs.remove.length; ++i) {\n          cbs.remove[i](vnode, rm);\n        }\n        if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n          i(vnode, rm);\n        } else {\n          rm();\n        }\n      } else {\n        removeNode(vnode.elm);\n      }\n    }\n\n    function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n      var oldStartIdx = 0;\n      var newStartIdx = 0;\n      var oldEndIdx = oldCh.length - 1;\n      var oldStartVnode = oldCh[0];\n      var oldEndVnode = oldCh[oldEndIdx];\n      var newEndIdx = newCh.length - 1;\n      var newStartVnode = newCh[0];\n      var newEndVnode = newCh[newEndIdx];\n      var oldKeyToIdx, idxInOld, vnodeToMove, refElm;\n\n      // removeOnly is a special flag used only by <transition-group>\n      // to ensure removed elements stay in correct relative positions\n      // during leaving transitions\n      var canMove = !removeOnly;\n\n      {\n        checkDuplicateKeys(newCh);\n      }\n\n      while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n        if (isUndef(oldStartVnode)) {\n          oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n        } else if (isUndef(oldEndVnode)) {\n          oldEndVnode = oldCh[--oldEndIdx];\n        } else if (sameVnode(oldStartVnode, newStartVnode)) {\n          patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n          oldStartVnode = oldCh[++oldStartIdx];\n          newStartVnode = newCh[++newStartIdx];\n        } else if (sameVnode(oldEndVnode, newEndVnode)) {\n          patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n          oldEndVnode = oldCh[--oldEndIdx];\n          newEndVnode = newCh[--newEndIdx];\n        } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n          patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n          canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n          oldStartVnode = oldCh[++oldStartIdx];\n          newEndVnode = newCh[--newEndIdx];\n        } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n          patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n          canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n          oldEndVnode = oldCh[--oldEndIdx];\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n          idxInOld = isDef(newStartVnode.key)\n            ? oldKeyToIdx[newStartVnode.key]\n            : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);\n          if (isUndef(idxInOld)) { // New element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n          } else {\n            vnodeToMove = oldCh[idxInOld];\n            if (sameVnode(vnodeToMove, newStartVnode)) {\n              patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n              oldCh[idxInOld] = undefined;\n              canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);\n            } else {\n              // same key but different element. treat as new element\n              createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n            }\n          }\n          newStartVnode = newCh[++newStartIdx];\n        }\n      }\n      if (oldStartIdx > oldEndIdx) {\n        refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n        addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n      } else if (newStartIdx > newEndIdx) {\n        removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n      }\n    }\n\n    function checkDuplicateKeys (children) {\n      var seenKeys = {};\n      for (var i = 0; i < children.length; i++) {\n        var vnode = children[i];\n        var key = vnode.key;\n        if (isDef(key)) {\n          if (seenKeys[key]) {\n            warn(\n              (\"Duplicate keys detected: '\" + key + \"'. This may cause an update error.\"),\n              vnode.context\n            );\n          } else {\n            seenKeys[key] = true;\n          }\n        }\n      }\n    }\n\n    function findIdxInOld (node, oldCh, start, end) {\n      for (var i = start; i < end; i++) {\n        var c = oldCh[i];\n        if (isDef(c) && sameVnode(node, c)) { return i }\n      }\n    }\n\n    function patchVnode (\n      oldVnode,\n      vnode,\n      insertedVnodeQueue,\n      ownerArray,\n      index,\n      removeOnly\n    ) {\n      if (oldVnode === vnode) {\n        return\n      }\n\n      if (isDef(vnode.elm) && isDef(ownerArray)) {\n        // clone reused vnode\n        vnode = ownerArray[index] = cloneVNode(vnode);\n      }\n\n      var elm = vnode.elm = oldVnode.elm;\n\n      if (isTrue(oldVnode.isAsyncPlaceholder)) {\n        if (isDef(vnode.asyncFactory.resolved)) {\n          hydrate(oldVnode.elm, vnode, insertedVnodeQueue);\n        } else {\n          vnode.isAsyncPlaceholder = true;\n        }\n        return\n      }\n\n      // reuse element for static trees.\n      // note we only do this if the vnode is cloned -\n      // if the new node is not cloned it means the render functions have been\n      // reset by the hot-reload-api and we need to do a proper re-render.\n      if (isTrue(vnode.isStatic) &&\n        isTrue(oldVnode.isStatic) &&\n        vnode.key === oldVnode.key &&\n        (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))\n      ) {\n        vnode.componentInstance = oldVnode.componentInstance;\n        return\n      }\n\n      var i;\n      var data = vnode.data;\n      if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n        i(oldVnode, vnode);\n      }\n\n      var oldCh = oldVnode.children;\n      var ch = vnode.children;\n      if (isDef(data) && isPatchable(vnode)) {\n        for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n        if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n      }\n      if (isUndef(vnode.text)) {\n        if (isDef(oldCh) && isDef(ch)) {\n          if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n        } else if (isDef(ch)) {\n          {\n            checkDuplicateKeys(ch);\n          }\n          if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n          addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n        } else if (isDef(oldCh)) {\n          removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n        } else if (isDef(oldVnode.text)) {\n          nodeOps.setTextContent(elm, '');\n        }\n      } else if (oldVnode.text !== vnode.text) {\n        nodeOps.setTextContent(elm, vnode.text);\n      }\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n      }\n    }\n\n    function invokeInsertHook (vnode, queue, initial) {\n      // delay insert hooks for component root nodes, invoke them after the\n      // element is really inserted\n      if (isTrue(initial) && isDef(vnode.parent)) {\n        vnode.parent.data.pendingInsert = queue;\n      } else {\n        for (var i = 0; i < queue.length; ++i) {\n          queue[i].data.hook.insert(queue[i]);\n        }\n      }\n    }\n\n    var hydrationBailed = false;\n    // list of modules that can skip create hook during hydration because they\n    // are already rendered on the client or has no need for initialization\n    // Note: style is excluded because it relies on initial clone for future\n    // deep updates (#7063).\n    var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');\n\n    // Note: this is a browser-only function so we can assume elms are DOM nodes.\n    function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {\n      var i;\n      var tag = vnode.tag;\n      var data = vnode.data;\n      var children = vnode.children;\n      inVPre = inVPre || (data && data.pre);\n      vnode.elm = elm;\n\n      if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {\n        vnode.isAsyncPlaceholder = true;\n        return true\n      }\n      // assert node match\n      {\n        if (!assertNodeMatch(elm, vnode, inVPre)) {\n          return false\n        }\n      }\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n        if (isDef(i = vnode.componentInstance)) {\n          // child component. it should have hydrated its own tree.\n          initComponent(vnode, insertedVnodeQueue);\n          return true\n        }\n      }\n      if (isDef(tag)) {\n        if (isDef(children)) {\n          // empty element, allow client to pick up and populate children\n          if (!elm.hasChildNodes()) {\n            createChildren(vnode, children, insertedVnodeQueue);\n          } else {\n            // v-html and domProps: innerHTML\n            if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {\n              if (i !== elm.innerHTML) {\n                /* istanbul ignore if */\n                if (typeof console !== 'undefined' &&\n                  !hydrationBailed\n                ) {\n                  hydrationBailed = true;\n                  console.warn('Parent: ', elm);\n                  console.warn('server innerHTML: ', i);\n                  console.warn('client innerHTML: ', elm.innerHTML);\n                }\n                return false\n              }\n            } else {\n              // iterate and compare children lists\n              var childrenMatch = true;\n              var childNode = elm.firstChild;\n              for (var i$1 = 0; i$1 < children.length; i$1++) {\n                if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {\n                  childrenMatch = false;\n                  break\n                }\n                childNode = childNode.nextSibling;\n              }\n              // if childNode is not null, it means the actual childNodes list is\n              // longer than the virtual children list.\n              if (!childrenMatch || childNode) {\n                /* istanbul ignore if */\n                if (typeof console !== 'undefined' &&\n                  !hydrationBailed\n                ) {\n                  hydrationBailed = true;\n                  console.warn('Parent: ', elm);\n                  console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);\n                }\n                return false\n              }\n            }\n          }\n        }\n        if (isDef(data)) {\n          var fullInvoke = false;\n          for (var key in data) {\n            if (!isRenderedModule(key)) {\n              fullInvoke = true;\n              invokeCreateHooks(vnode, insertedVnodeQueue);\n              break\n            }\n          }\n          if (!fullInvoke && data['class']) {\n            // ensure collecting deps for deep class bindings for future updates\n            traverse(data['class']);\n          }\n        }\n      } else if (elm.data !== vnode.text) {\n        elm.data = vnode.text;\n      }\n      return true\n    }\n\n    function assertNodeMatch (node, vnode, inVPre) {\n      if (isDef(vnode.tag)) {\n        return vnode.tag.indexOf('vue-component') === 0 || (\n          !isUnknownElement$$1(vnode, inVPre) &&\n          vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())\n        )\n      } else {\n        return node.nodeType === (vnode.isComment ? 8 : 3)\n      }\n    }\n\n    return function patch (oldVnode, vnode, hydrating, removeOnly) {\n      if (isUndef(vnode)) {\n        if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }\n        return\n      }\n\n      var isInitialPatch = false;\n      var insertedVnodeQueue = [];\n\n      if (isUndef(oldVnode)) {\n        // empty mount (likely as component), create new root element\n        isInitialPatch = true;\n        createElm(vnode, insertedVnodeQueue);\n      } else {\n        var isRealElement = isDef(oldVnode.nodeType);\n        if (!isRealElement && sameVnode(oldVnode, vnode)) {\n          // patch existing root node\n          patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);\n        } else {\n          if (isRealElement) {\n            // mounting to a real element\n            // check if this is server-rendered content and if we can perform\n            // a successful hydration.\n            if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {\n              oldVnode.removeAttribute(SSR_ATTR);\n              hydrating = true;\n            }\n            if (isTrue(hydrating)) {\n              if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n                invokeInsertHook(vnode, insertedVnodeQueue, true);\n                return oldVnode\n              } else {\n                warn(\n                  'The client-side rendered virtual DOM tree is not matching ' +\n                  'server-rendered content. This is likely caused by incorrect ' +\n                  'HTML markup, for example nesting block-level elements inside ' +\n                  '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                  'full client-side render.'\n                );\n              }\n            }\n            // either not server-rendered, or hydration failed.\n            // create an empty node and replace it\n            oldVnode = emptyNodeAt(oldVnode);\n          }\n\n          // replacing existing element\n          var oldElm = oldVnode.elm;\n          var parentElm = nodeOps.parentNode(oldElm);\n\n          // create new node\n          createElm(\n            vnode,\n            insertedVnodeQueue,\n            // extremely rare edge case: do not insert if old element is in a\n            // leaving transition. Only happens when combining transition +\n            // keep-alive + HOCs. (#4590)\n            oldElm._leaveCb ? null : parentElm,\n            nodeOps.nextSibling(oldElm)\n          );\n\n          // update parent placeholder node element, recursively\n          if (isDef(vnode.parent)) {\n            var ancestor = vnode.parent;\n            var patchable = isPatchable(vnode);\n            while (ancestor) {\n              for (var i = 0; i < cbs.destroy.length; ++i) {\n                cbs.destroy[i](ancestor);\n              }\n              ancestor.elm = vnode.elm;\n              if (patchable) {\n                for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n                  cbs.create[i$1](emptyNode, ancestor);\n                }\n                // #6513\n                // invoke insert hooks that may have been merged by create hooks.\n                // e.g. for directives that uses the \"inserted\" hook.\n                var insert = ancestor.data.hook.insert;\n                if (insert.merged) {\n                  // start at index 1 to avoid re-invoking component mounted hook\n                  for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {\n                    insert.fns[i$2]();\n                  }\n                }\n              } else {\n                registerRef(ancestor);\n              }\n              ancestor = ancestor.parent;\n            }\n          }\n\n          // destroy old node\n          if (isDef(parentElm)) {\n            removeVnodes(parentElm, [oldVnode], 0, 0);\n          } else if (isDef(oldVnode.tag)) {\n            invokeDestroyHook(oldVnode);\n          }\n        }\n      }\n\n      invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n      return vnode.elm\n    }\n  }\n\n  /*  */\n\n  var directives = {\n    create: updateDirectives,\n    update: updateDirectives,\n    destroy: function unbindDirectives (vnode) {\n      updateDirectives(vnode, emptyNode);\n    }\n  };\n\n  function updateDirectives (oldVnode, vnode) {\n    if (oldVnode.data.directives || vnode.data.directives) {\n      _update(oldVnode, vnode);\n    }\n  }\n\n  function _update (oldVnode, vnode) {\n    var isCreate = oldVnode === emptyNode;\n    var isDestroy = vnode === emptyNode;\n    var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n    var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n    var dirsWithInsert = [];\n    var dirsWithPostpatch = [];\n\n    var key, oldDir, dir;\n    for (key in newDirs) {\n      oldDir = oldDirs[key];\n      dir = newDirs[key];\n      if (!oldDir) {\n        // new directive, bind\n        callHook$1(dir, 'bind', vnode, oldVnode);\n        if (dir.def && dir.def.inserted) {\n          dirsWithInsert.push(dir);\n        }\n      } else {\n        // existing directive, update\n        dir.oldValue = oldDir.value;\n        dir.oldArg = oldDir.arg;\n        callHook$1(dir, 'update', vnode, oldVnode);\n        if (dir.def && dir.def.componentUpdated) {\n          dirsWithPostpatch.push(dir);\n        }\n      }\n    }\n\n    if (dirsWithInsert.length) {\n      var callInsert = function () {\n        for (var i = 0; i < dirsWithInsert.length; i++) {\n          callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);\n        }\n      };\n      if (isCreate) {\n        mergeVNodeHook(vnode, 'insert', callInsert);\n      } else {\n        callInsert();\n      }\n    }\n\n    if (dirsWithPostpatch.length) {\n      mergeVNodeHook(vnode, 'postpatch', function () {\n        for (var i = 0; i < dirsWithPostpatch.length; i++) {\n          callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);\n        }\n      });\n    }\n\n    if (!isCreate) {\n      for (key in oldDirs) {\n        if (!newDirs[key]) {\n          // no longer present, unbind\n          callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);\n        }\n      }\n    }\n  }\n\n  var emptyModifiers = Object.create(null);\n\n  function normalizeDirectives$1 (\n    dirs,\n    vm\n  ) {\n    var res = Object.create(null);\n    if (!dirs) {\n      // $flow-disable-line\n      return res\n    }\n    var i, dir;\n    for (i = 0; i < dirs.length; i++) {\n      dir = dirs[i];\n      if (!dir.modifiers) {\n        // $flow-disable-line\n        dir.modifiers = emptyModifiers;\n      }\n      res[getRawDirName(dir)] = dir;\n      dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n    }\n    // $flow-disable-line\n    return res\n  }\n\n  function getRawDirName (dir) {\n    return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n  }\n\n  function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {\n    var fn = dir.def && dir.def[hook];\n    if (fn) {\n      try {\n        fn(vnode.elm, dir, vnode, oldVnode, isDestroy);\n      } catch (e) {\n        handleError(e, vnode.context, (\"directive \" + (dir.name) + \" \" + hook + \" hook\"));\n      }\n    }\n  }\n\n  var baseModules = [\n    ref,\n    directives\n  ];\n\n  /*  */\n\n  function updateAttrs (oldVnode, vnode) {\n    var opts = vnode.componentOptions;\n    if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {\n      return\n    }\n    if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {\n      return\n    }\n    var key, cur, old;\n    var elm = vnode.elm;\n    var oldAttrs = oldVnode.data.attrs || {};\n    var attrs = vnode.data.attrs || {};\n    // clone observed objects, as the user probably wants to mutate it\n    if (isDef(attrs.__ob__)) {\n      attrs = vnode.data.attrs = extend({}, attrs);\n    }\n\n    for (key in attrs) {\n      cur = attrs[key];\n      old = oldAttrs[key];\n      if (old !== cur) {\n        setAttr(elm, key, cur);\n      }\n    }\n    // #4391: in IE9, setting type can reset value for input[type=radio]\n    // #6666: IE/Edge forces progress value down to 1 before setting a max\n    /* istanbul ignore if */\n    if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {\n      setAttr(elm, 'value', attrs.value);\n    }\n    for (key in oldAttrs) {\n      if (isUndef(attrs[key])) {\n        if (isXlink(key)) {\n          elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n        } else if (!isEnumeratedAttr(key)) {\n          elm.removeAttribute(key);\n        }\n      }\n    }\n  }\n\n  function setAttr (el, key, value) {\n    if (el.tagName.indexOf('-') > -1) {\n      baseSetAttr(el, key, value);\n    } else if (isBooleanAttr(key)) {\n      // set attribute for blank value\n      // e.g. <option disabled>Select one</option>\n      if (isFalsyAttrValue(value)) {\n        el.removeAttribute(key);\n      } else {\n        // technically allowfullscreen is a boolean attribute for <iframe>,\n        // but Flash expects a value of \"true\" when used on <embed> tag\n        value = key === 'allowfullscreen' && el.tagName === 'EMBED'\n          ? 'true'\n          : key;\n        el.setAttribute(key, value);\n      }\n    } else if (isEnumeratedAttr(key)) {\n      el.setAttribute(key, convertEnumeratedValue(key, value));\n    } else if (isXlink(key)) {\n      if (isFalsyAttrValue(value)) {\n        el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else {\n        el.setAttributeNS(xlinkNS, key, value);\n      }\n    } else {\n      baseSetAttr(el, key, value);\n    }\n  }\n\n  function baseSetAttr (el, key, value) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      // #7138: IE10 & 11 fires input event when setting placeholder on\n      // <textarea>... block the first input event and remove the blocker\n      // immediately.\n      /* istanbul ignore if */\n      if (\n        isIE && !isIE9 &&\n        el.tagName === 'TEXTAREA' &&\n        key === 'placeholder' && value !== '' && !el.__ieph\n      ) {\n        var blocker = function (e) {\n          e.stopImmediatePropagation();\n          el.removeEventListener('input', blocker);\n        };\n        el.addEventListener('input', blocker);\n        // $flow-disable-line\n        el.__ieph = true; /* IE placeholder patched */\n      }\n      el.setAttribute(key, value);\n    }\n  }\n\n  var attrs = {\n    create: updateAttrs,\n    update: updateAttrs\n  };\n\n  /*  */\n\n  function updateClass (oldVnode, vnode) {\n    var el = vnode.elm;\n    var data = vnode.data;\n    var oldData = oldVnode.data;\n    if (\n      isUndef(data.staticClass) &&\n      isUndef(data.class) && (\n        isUndef(oldData) || (\n          isUndef(oldData.staticClass) &&\n          isUndef(oldData.class)\n        )\n      )\n    ) {\n      return\n    }\n\n    var cls = genClassForVnode(vnode);\n\n    // handle transition classes\n    var transitionClass = el._transitionClasses;\n    if (isDef(transitionClass)) {\n      cls = concat(cls, stringifyClass(transitionClass));\n    }\n\n    // set the class\n    if (cls !== el._prevClass) {\n      el.setAttribute('class', cls);\n      el._prevClass = cls;\n    }\n  }\n\n  var klass = {\n    create: updateClass,\n    update: updateClass\n  };\n\n  /*  */\n\n  var validDivisionCharRE = /[\\w).+\\-_$\\]]/;\n\n  function parseFilters (exp) {\n    var inSingle = false;\n    var inDouble = false;\n    var inTemplateString = false;\n    var inRegex = false;\n    var curly = 0;\n    var square = 0;\n    var paren = 0;\n    var lastFilterIndex = 0;\n    var c, prev, i, expression, filters;\n\n    for (i = 0; i < exp.length; i++) {\n      prev = c;\n      c = exp.charCodeAt(i);\n      if (inSingle) {\n        if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n      } else if (inDouble) {\n        if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n      } else if (inTemplateString) {\n        if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n      } else if (inRegex) {\n        if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n      } else if (\n        c === 0x7C && // pipe\n        exp.charCodeAt(i + 1) !== 0x7C &&\n        exp.charCodeAt(i - 1) !== 0x7C &&\n        !curly && !square && !paren\n      ) {\n        if (expression === undefined) {\n          // first filter, end of expression\n          lastFilterIndex = i + 1;\n          expression = exp.slice(0, i).trim();\n        } else {\n          pushFilter();\n        }\n      } else {\n        switch (c) {\n          case 0x22: inDouble = true; break         // \"\n          case 0x27: inSingle = true; break         // '\n          case 0x60: inTemplateString = true; break // `\n          case 0x28: paren++; break                 // (\n          case 0x29: paren--; break                 // )\n          case 0x5B: square++; break                // [\n          case 0x5D: square--; break                // ]\n          case 0x7B: curly++; break                 // {\n          case 0x7D: curly--; break                 // }\n        }\n        if (c === 0x2f) { // /\n          var j = i - 1;\n          var p = (void 0);\n          // find first non-whitespace prev char\n          for (; j >= 0; j--) {\n            p = exp.charAt(j);\n            if (p !== ' ') { break }\n          }\n          if (!p || !validDivisionCharRE.test(p)) {\n            inRegex = true;\n          }\n        }\n      }\n    }\n\n    if (expression === undefined) {\n      expression = exp.slice(0, i).trim();\n    } else if (lastFilterIndex !== 0) {\n      pushFilter();\n    }\n\n    function pushFilter () {\n      (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n      lastFilterIndex = i + 1;\n    }\n\n    if (filters) {\n      for (i = 0; i < filters.length; i++) {\n        expression = wrapFilter(expression, filters[i]);\n      }\n    }\n\n    return expression\n  }\n\n  function wrapFilter (exp, filter) {\n    var i = filter.indexOf('(');\n    if (i < 0) {\n      // _f: resolveFilter\n      return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n    } else {\n      var name = filter.slice(0, i);\n      var args = filter.slice(i + 1);\n      return (\"_f(\\\"\" + name + \"\\\")(\" + exp + (args !== ')' ? ',' + args : args))\n    }\n  }\n\n  /*  */\n\n\n\n  /* eslint-disable no-unused-vars */\n  function baseWarn (msg, range) {\n    console.error((\"[Vue compiler]: \" + msg));\n  }\n  /* eslint-enable no-unused-vars */\n\n  function pluckModuleFunction (\n    modules,\n    key\n  ) {\n    return modules\n      ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n      : []\n  }\n\n  function addProp (el, name, value, range, dynamic) {\n    (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));\n    el.plain = false;\n  }\n\n  function addAttr (el, name, value, range, dynamic) {\n    var attrs = dynamic\n      ? (el.dynamicAttrs || (el.dynamicAttrs = []))\n      : (el.attrs || (el.attrs = []));\n    attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));\n    el.plain = false;\n  }\n\n  // add a raw attr (use this in preTransforms)\n  function addRawAttr (el, name, value, range) {\n    el.attrsMap[name] = value;\n    el.attrsList.push(rangeSetItem({ name: name, value: value }, range));\n  }\n\n  function addDirective (\n    el,\n    name,\n    rawName,\n    value,\n    arg,\n    isDynamicArg,\n    modifiers,\n    range\n  ) {\n    (el.directives || (el.directives = [])).push(rangeSetItem({\n      name: name,\n      rawName: rawName,\n      value: value,\n      arg: arg,\n      isDynamicArg: isDynamicArg,\n      modifiers: modifiers\n    }, range));\n    el.plain = false;\n  }\n\n  function prependModifierMarker (symbol, name, dynamic) {\n    return dynamic\n      ? (\"_p(\" + name + \",\\\"\" + symbol + \"\\\")\")\n      : symbol + name // mark the event as captured\n  }\n\n  function addHandler (\n    el,\n    name,\n    value,\n    modifiers,\n    important,\n    warn,\n    range,\n    dynamic\n  ) {\n    modifiers = modifiers || emptyObject;\n    // warn prevent and passive modifier\n    /* istanbul ignore if */\n    if (\n      warn &&\n      modifiers.prevent && modifiers.passive\n    ) {\n      warn(\n        'passive and prevent can\\'t be used together. ' +\n        'Passive handler can\\'t prevent default event.',\n        range\n      );\n    }\n\n    // normalize click.right and click.middle since they don't actually fire\n    // this is technically browser-specific, but at least for now browsers are\n    // the only target envs that have right/middle clicks.\n    if (modifiers.right) {\n      if (dynamic) {\n        name = \"(\" + name + \")==='click'?'contextmenu':(\" + name + \")\";\n      } else if (name === 'click') {\n        name = 'contextmenu';\n        delete modifiers.right;\n      }\n    } else if (modifiers.middle) {\n      if (dynamic) {\n        name = \"(\" + name + \")==='click'?'mouseup':(\" + name + \")\";\n      } else if (name === 'click') {\n        name = 'mouseup';\n      }\n    }\n\n    // check capture modifier\n    if (modifiers.capture) {\n      delete modifiers.capture;\n      name = prependModifierMarker('!', name, dynamic);\n    }\n    if (modifiers.once) {\n      delete modifiers.once;\n      name = prependModifierMarker('~', name, dynamic);\n    }\n    /* istanbul ignore if */\n    if (modifiers.passive) {\n      delete modifiers.passive;\n      name = prependModifierMarker('&', name, dynamic);\n    }\n\n    var events;\n    if (modifiers.native) {\n      delete modifiers.native;\n      events = el.nativeEvents || (el.nativeEvents = {});\n    } else {\n      events = el.events || (el.events = {});\n    }\n\n    var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);\n    if (modifiers !== emptyObject) {\n      newHandler.modifiers = modifiers;\n    }\n\n    var handlers = events[name];\n    /* istanbul ignore if */\n    if (Array.isArray(handlers)) {\n      important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n    } else if (handlers) {\n      events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n    } else {\n      events[name] = newHandler;\n    }\n\n    el.plain = false;\n  }\n\n  function getRawBindingAttr (\n    el,\n    name\n  ) {\n    return el.rawAttrsMap[':' + name] ||\n      el.rawAttrsMap['v-bind:' + name] ||\n      el.rawAttrsMap[name]\n  }\n\n  function getBindingAttr (\n    el,\n    name,\n    getStatic\n  ) {\n    var dynamicValue =\n      getAndRemoveAttr(el, ':' + name) ||\n      getAndRemoveAttr(el, 'v-bind:' + name);\n    if (dynamicValue != null) {\n      return parseFilters(dynamicValue)\n    } else if (getStatic !== false) {\n      var staticValue = getAndRemoveAttr(el, name);\n      if (staticValue != null) {\n        return JSON.stringify(staticValue)\n      }\n    }\n  }\n\n  // note: this only removes the attr from the Array (attrsList) so that it\n  // doesn't get processed by processAttrs.\n  // By default it does NOT remove it from the map (attrsMap) because the map is\n  // needed during codegen.\n  function getAndRemoveAttr (\n    el,\n    name,\n    removeFromMap\n  ) {\n    var val;\n    if ((val = el.attrsMap[name]) != null) {\n      var list = el.attrsList;\n      for (var i = 0, l = list.length; i < l; i++) {\n        if (list[i].name === name) {\n          list.splice(i, 1);\n          break\n        }\n      }\n    }\n    if (removeFromMap) {\n      delete el.attrsMap[name];\n    }\n    return val\n  }\n\n  function getAndRemoveAttrByRegex (\n    el,\n    name\n  ) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      var attr = list[i];\n      if (name.test(attr.name)) {\n        list.splice(i, 1);\n        return attr\n      }\n    }\n  }\n\n  function rangeSetItem (\n    item,\n    range\n  ) {\n    if (range) {\n      if (range.start != null) {\n        item.start = range.start;\n      }\n      if (range.end != null) {\n        item.end = range.end;\n      }\n    }\n    return item\n  }\n\n  /*  */\n\n  /**\n   * Cross-platform code generation for component v-model\n   */\n  function genComponentModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var ref = modifiers || {};\n    var number = ref.number;\n    var trim = ref.trim;\n\n    var baseValueExpression = '$$v';\n    var valueExpression = baseValueExpression;\n    if (trim) {\n      valueExpression =\n        \"(typeof \" + baseValueExpression + \" === 'string'\" +\n        \"? \" + baseValueExpression + \".trim()\" +\n        \": \" + baseValueExpression + \")\";\n    }\n    if (number) {\n      valueExpression = \"_n(\" + valueExpression + \")\";\n    }\n    var assignment = genAssignmentCode(value, valueExpression);\n\n    el.model = {\n      value: (\"(\" + value + \")\"),\n      expression: JSON.stringify(value),\n      callback: (\"function (\" + baseValueExpression + \") {\" + assignment + \"}\")\n    };\n  }\n\n  /**\n   * Cross-platform codegen helper for generating v-model value assignment code.\n   */\n  function genAssignmentCode (\n    value,\n    assignment\n  ) {\n    var res = parseModel(value);\n    if (res.key === null) {\n      return (value + \"=\" + assignment)\n    } else {\n      return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n    }\n  }\n\n  /**\n   * Parse a v-model expression into a base path and a final key segment.\n   * Handles both dot-path and possible square brackets.\n   *\n   * Possible cases:\n   *\n   * - test\n   * - test[key]\n   * - test[test1[key]]\n   * - test[\"a\"][key]\n   * - xxx.test[a[a].test1[key]]\n   * - test.xxx.a[\"asa\"][test1[key]]\n   *\n   */\n\n  var len, str, chr, index$1, expressionPos, expressionEndPos;\n\n\n\n  function parseModel (val) {\n    // Fix https://github.com/vuejs/vue/pull/7730\n    // allow v-model=\"obj.val \" (trailing whitespace)\n    val = val.trim();\n    len = val.length;\n\n    if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n      index$1 = val.lastIndexOf('.');\n      if (index$1 > -1) {\n        return {\n          exp: val.slice(0, index$1),\n          key: '\"' + val.slice(index$1 + 1) + '\"'\n        }\n      } else {\n        return {\n          exp: val,\n          key: null\n        }\n      }\n    }\n\n    str = val;\n    index$1 = expressionPos = expressionEndPos = 0;\n\n    while (!eof()) {\n      chr = next();\n      /* istanbul ignore if */\n      if (isStringStart(chr)) {\n        parseString(chr);\n      } else if (chr === 0x5B) {\n        parseBracket(chr);\n      }\n    }\n\n    return {\n      exp: val.slice(0, expressionPos),\n      key: val.slice(expressionPos + 1, expressionEndPos)\n    }\n  }\n\n  function next () {\n    return str.charCodeAt(++index$1)\n  }\n\n  function eof () {\n    return index$1 >= len\n  }\n\n  function isStringStart (chr) {\n    return chr === 0x22 || chr === 0x27\n  }\n\n  function parseBracket (chr) {\n    var inBracket = 1;\n    expressionPos = index$1;\n    while (!eof()) {\n      chr = next();\n      if (isStringStart(chr)) {\n        parseString(chr);\n        continue\n      }\n      if (chr === 0x5B) { inBracket++; }\n      if (chr === 0x5D) { inBracket--; }\n      if (inBracket === 0) {\n        expressionEndPos = index$1;\n        break\n      }\n    }\n  }\n\n  function parseString (chr) {\n    var stringQuote = chr;\n    while (!eof()) {\n      chr = next();\n      if (chr === stringQuote) {\n        break\n      }\n    }\n  }\n\n  /*  */\n\n  var warn$1;\n\n  // in some cases, the event used has to be determined at runtime\n  // so we used some reserved tokens during compile.\n  var RANGE_TOKEN = '__r';\n  var CHECKBOX_RADIO_TOKEN = '__c';\n\n  function model (\n    el,\n    dir,\n    _warn\n  ) {\n    warn$1 = _warn;\n    var value = dir.value;\n    var modifiers = dir.modifiers;\n    var tag = el.tag;\n    var type = el.attrsMap.type;\n\n    {\n      // inputs with type=\"file\" are read only and setting the input's\n      // value will throw an error.\n      if (tag === 'input' && type === 'file') {\n        warn$1(\n          \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n          \"File inputs are read only. Use a v-on:change listener instead.\",\n          el.rawAttrsMap['v-model']\n        );\n      }\n    }\n\n    if (el.component) {\n      genComponentModel(el, value, modifiers);\n      // component v-model doesn't need extra runtime\n      return false\n    } else if (tag === 'select') {\n      genSelect(el, value, modifiers);\n    } else if (tag === 'input' && type === 'checkbox') {\n      genCheckboxModel(el, value, modifiers);\n    } else if (tag === 'input' && type === 'radio') {\n      genRadioModel(el, value, modifiers);\n    } else if (tag === 'input' || tag === 'textarea') {\n      genDefaultModel(el, value, modifiers);\n    } else if (!config.isReservedTag(tag)) {\n      genComponentModel(el, value, modifiers);\n      // component v-model doesn't need extra runtime\n      return false\n    } else {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"v-model is not supported on this element type. \" +\n        'If you are working with contenteditable, it\\'s recommended to ' +\n        'wrap a library dedicated for that purpose inside a custom component.',\n        el.rawAttrsMap['v-model']\n      );\n    }\n\n    // ensure runtime directive metadata\n    return true\n  }\n\n  function genCheckboxModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var valueBinding = getBindingAttr(el, 'value') || 'null';\n    var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n    var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n    addProp(el, 'checked',\n      \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" + (\n        trueValueBinding === 'true'\n          ? (\":(\" + value + \")\")\n          : (\":_q(\" + value + \",\" + trueValueBinding + \")\")\n      )\n    );\n    addHandler(el, 'change',\n      \"var $$a=\" + value + \",\" +\n          '$$el=$event.target,' +\n          \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n      'if(Array.isArray($$a)){' +\n        \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n            '$$i=_i($$a,$$v);' +\n        \"if($$el.checked){$$i<0&&(\" + (genAssignmentCode(value, '$$a.concat([$$v])')) + \")}\" +\n        \"else{$$i>-1&&(\" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + \")}\" +\n      \"}else{\" + (genAssignmentCode(value, '$$c')) + \"}\",\n      null, true\n    );\n  }\n\n  function genRadioModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var valueBinding = getBindingAttr(el, 'value') || 'null';\n    valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n    addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n    addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n  }\n\n  function genSelect (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var selectedVal = \"Array.prototype.filter\" +\n      \".call($event.target.options,function(o){return o.selected})\" +\n      \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n      \"return \" + (number ? '_n(val)' : 'val') + \"})\";\n\n    var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';\n    var code = \"var $$selectedVal = \" + selectedVal + \";\";\n    code = code + \" \" + (genAssignmentCode(value, assignment));\n    addHandler(el, 'change', code, null, true);\n  }\n\n  function genDefaultModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var type = el.attrsMap.type;\n\n    // warn if v-bind:value conflicts with v-model\n    // except for inputs with v-bind:type\n    {\n      var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];\n      var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n      if (value$1 && !typeBinding) {\n        var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';\n        warn$1(\n          binding + \"=\\\"\" + value$1 + \"\\\" conflicts with v-model on the same element \" +\n          'because the latter already expands to a value binding internally',\n          el.rawAttrsMap[binding]\n        );\n      }\n    }\n\n    var ref = modifiers || {};\n    var lazy = ref.lazy;\n    var number = ref.number;\n    var trim = ref.trim;\n    var needCompositionGuard = !lazy && type !== 'range';\n    var event = lazy\n      ? 'change'\n      : type === 'range'\n        ? RANGE_TOKEN\n        : 'input';\n\n    var valueExpression = '$event.target.value';\n    if (trim) {\n      valueExpression = \"$event.target.value.trim()\";\n    }\n    if (number) {\n      valueExpression = \"_n(\" + valueExpression + \")\";\n    }\n\n    var code = genAssignmentCode(value, valueExpression);\n    if (needCompositionGuard) {\n      code = \"if($event.target.composing)return;\" + code;\n    }\n\n    addProp(el, 'value', (\"(\" + value + \")\"));\n    addHandler(el, event, code, null, true);\n    if (trim || number) {\n      addHandler(el, 'blur', '$forceUpdate()');\n    }\n  }\n\n  /*  */\n\n  // normalize v-model event tokens that can only be determined at runtime.\n  // it's important to place the event as the first in the array because\n  // the whole point is ensuring the v-model callback gets called before\n  // user-attached handlers.\n  function normalizeEvents (on) {\n    /* istanbul ignore if */\n    if (isDef(on[RANGE_TOKEN])) {\n      // IE input[type=range] only supports `change` event\n      var event = isIE ? 'change' : 'input';\n      on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);\n      delete on[RANGE_TOKEN];\n    }\n    // This was originally intended to fix #4521 but no longer necessary\n    // after 2.5. Keeping it for backwards compat with generated code from < 2.4\n    /* istanbul ignore if */\n    if (isDef(on[CHECKBOX_RADIO_TOKEN])) {\n      on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);\n      delete on[CHECKBOX_RADIO_TOKEN];\n    }\n  }\n\n  var target$1;\n\n  function createOnceHandler$1 (event, handler, capture) {\n    var _target = target$1; // save current target element in closure\n    return function onceHandler () {\n      var res = handler.apply(null, arguments);\n      if (res !== null) {\n        remove$2(event, onceHandler, capture, _target);\n      }\n    }\n  }\n\n  // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp\n  // implementation and does not fire microtasks in between event propagation, so\n  // safe to exclude.\n  var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);\n\n  function add$1 (\n    name,\n    handler,\n    capture,\n    passive\n  ) {\n    // async edge case #6566: inner click event triggers patch, event handler\n    // attached to outer element during patch, and triggered again. This\n    // happens because browsers fire microtask ticks between event propagation.\n    // the solution is simple: we save the timestamp when a handler is attached,\n    // and the handler would only fire if the event passed to it was fired\n    // AFTER it was attached.\n    if (useMicrotaskFix) {\n      var attachedTimestamp = currentFlushTimestamp;\n      var original = handler;\n      handler = original._wrapper = function (e) {\n        if (\n          // no bubbling, should always fire.\n          // this is just a safety net in case event.timeStamp is unreliable in\n          // certain weird environments...\n          e.target === e.currentTarget ||\n          // event is fired after handler attachment\n          e.timeStamp >= attachedTimestamp ||\n          // #9462 bail for iOS 9 bug: event.timeStamp is 0 after history.pushState\n          e.timeStamp === 0 ||\n          // #9448 bail if event is fired in another document in a multi-page\n          // electron/nw.js app, since event.timeStamp will be using a different\n          // starting reference\n          e.target.ownerDocument !== document\n        ) {\n          return original.apply(this, arguments)\n        }\n      };\n    }\n    target$1.addEventListener(\n      name,\n      handler,\n      supportsPassive\n        ? { capture: capture, passive: passive }\n        : capture\n    );\n  }\n\n  function remove$2 (\n    name,\n    handler,\n    capture,\n    _target\n  ) {\n    (_target || target$1).removeEventListener(\n      name,\n      handler._wrapper || handler,\n      capture\n    );\n  }\n\n  function updateDOMListeners (oldVnode, vnode) {\n    if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {\n      return\n    }\n    var on = vnode.data.on || {};\n    var oldOn = oldVnode.data.on || {};\n    target$1 = vnode.elm;\n    normalizeEvents(on);\n    updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);\n    target$1 = undefined;\n  }\n\n  var events = {\n    create: updateDOMListeners,\n    update: updateDOMListeners\n  };\n\n  /*  */\n\n  var svgContainer;\n\n  function updateDOMProps (oldVnode, vnode) {\n    if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {\n      return\n    }\n    var key, cur;\n    var elm = vnode.elm;\n    var oldProps = oldVnode.data.domProps || {};\n    var props = vnode.data.domProps || {};\n    // clone observed objects, as the user probably wants to mutate it\n    if (isDef(props.__ob__)) {\n      props = vnode.data.domProps = extend({}, props);\n    }\n\n    for (key in oldProps) {\n      if (isUndef(props[key])) {\n        elm[key] = '';\n      }\n    }\n    for (key in props) {\n      cur = props[key];\n      // ignore children if the node has textContent or innerHTML,\n      // as these will throw away existing DOM nodes and cause removal errors\n      // on subsequent patches (#3360)\n      if (key === 'textContent' || key === 'innerHTML') {\n        if (vnode.children) { vnode.children.length = 0; }\n        if (cur === oldProps[key]) { continue }\n        // #6601 work around Chrome version <= 55 bug where single textNode\n        // replaced by innerHTML/textContent retains its parentNode property\n        if (elm.childNodes.length === 1) {\n          elm.removeChild(elm.childNodes[0]);\n        }\n      }\n\n      if (key === 'value' && elm.tagName !== 'PROGRESS') {\n        // store value as _value as well since\n        // non-string values will be stringified\n        elm._value = cur;\n        // avoid resetting cursor position when value is the same\n        var strCur = isUndef(cur) ? '' : String(cur);\n        if (shouldUpdateValue(elm, strCur)) {\n          elm.value = strCur;\n        }\n      } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {\n        // IE doesn't support innerHTML for SVG elements\n        svgContainer = svgContainer || document.createElement('div');\n        svgContainer.innerHTML = \"<svg>\" + cur + \"</svg>\";\n        var svg = svgContainer.firstChild;\n        while (elm.firstChild) {\n          elm.removeChild(elm.firstChild);\n        }\n        while (svg.firstChild) {\n          elm.appendChild(svg.firstChild);\n        }\n      } else if (\n        // skip the update if old and new VDOM state is the same.\n        // `value` is handled separately because the DOM value may be temporarily\n        // out of sync with VDOM state due to focus, composition and modifiers.\n        // This  #4521 by skipping the unnecesarry `checked` update.\n        cur !== oldProps[key]\n      ) {\n        // some property updates can throw\n        // e.g. `value` on <progress> w/ non-finite value\n        try {\n          elm[key] = cur;\n        } catch (e) {}\n      }\n    }\n  }\n\n  // check platforms/web/util/attrs.js acceptValue\n\n\n  function shouldUpdateValue (elm, checkVal) {\n    return (!elm.composing && (\n      elm.tagName === 'OPTION' ||\n      isNotInFocusAndDirty(elm, checkVal) ||\n      isDirtyWithModifiers(elm, checkVal)\n    ))\n  }\n\n  function isNotInFocusAndDirty (elm, checkVal) {\n    // return true when textbox (.number and .trim) loses focus and its value is\n    // not equal to the updated value\n    var notInFocus = true;\n    // #6157\n    // work around IE bug when accessing document.activeElement in an iframe\n    try { notInFocus = document.activeElement !== elm; } catch (e) {}\n    return notInFocus && elm.value !== checkVal\n  }\n\n  function isDirtyWithModifiers (elm, newVal) {\n    var value = elm.value;\n    var modifiers = elm._vModifiers; // injected by v-model runtime\n    if (isDef(modifiers)) {\n      if (modifiers.number) {\n        return toNumber(value) !== toNumber(newVal)\n      }\n      if (modifiers.trim) {\n        return value.trim() !== newVal.trim()\n      }\n    }\n    return value !== newVal\n  }\n\n  var domProps = {\n    create: updateDOMProps,\n    update: updateDOMProps\n  };\n\n  /*  */\n\n  var parseStyleText = cached(function (cssText) {\n    var res = {};\n    var listDelimiter = /;(?![^(]*\\))/g;\n    var propertyDelimiter = /:(.+)/;\n    cssText.split(listDelimiter).forEach(function (item) {\n      if (item) {\n        var tmp = item.split(propertyDelimiter);\n        tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n      }\n    });\n    return res\n  });\n\n  // merge static and dynamic style data on the same vnode\n  function normalizeStyleData (data) {\n    var style = normalizeStyleBinding(data.style);\n    // static style is pre-processed into an object during compilation\n    // and is always a fresh object, so it's safe to merge into it\n    return data.staticStyle\n      ? extend(data.staticStyle, style)\n      : style\n  }\n\n  // normalize possible array / string values into Object\n  function normalizeStyleBinding (bindingStyle) {\n    if (Array.isArray(bindingStyle)) {\n      return toObject(bindingStyle)\n    }\n    if (typeof bindingStyle === 'string') {\n      return parseStyleText(bindingStyle)\n    }\n    return bindingStyle\n  }\n\n  /**\n   * parent component style should be after child's\n   * so that parent component's style could override it\n   */\n  function getStyle (vnode, checkChild) {\n    var res = {};\n    var styleData;\n\n    if (checkChild) {\n      var childNode = vnode;\n      while (childNode.componentInstance) {\n        childNode = childNode.componentInstance._vnode;\n        if (\n          childNode && childNode.data &&\n          (styleData = normalizeStyleData(childNode.data))\n        ) {\n          extend(res, styleData);\n        }\n      }\n    }\n\n    if ((styleData = normalizeStyleData(vnode.data))) {\n      extend(res, styleData);\n    }\n\n    var parentNode = vnode;\n    while ((parentNode = parentNode.parent)) {\n      if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n        extend(res, styleData);\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  var cssVarRE = /^--/;\n  var importantRE = /\\s*!important$/;\n  var setProp = function (el, name, val) {\n    /* istanbul ignore if */\n    if (cssVarRE.test(name)) {\n      el.style.setProperty(name, val);\n    } else if (importantRE.test(val)) {\n      el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');\n    } else {\n      var normalizedName = normalize(name);\n      if (Array.isArray(val)) {\n        // Support values array created by autoprefixer, e.g.\n        // {display: [\"-webkit-box\", \"-ms-flexbox\", \"flex\"]}\n        // Set them one by one, and the browser will only set those it can recognize\n        for (var i = 0, len = val.length; i < len; i++) {\n          el.style[normalizedName] = val[i];\n        }\n      } else {\n        el.style[normalizedName] = val;\n      }\n    }\n  };\n\n  var vendorNames = ['Webkit', 'Moz', 'ms'];\n\n  var emptyStyle;\n  var normalize = cached(function (prop) {\n    emptyStyle = emptyStyle || document.createElement('div').style;\n    prop = camelize(prop);\n    if (prop !== 'filter' && (prop in emptyStyle)) {\n      return prop\n    }\n    var capName = prop.charAt(0).toUpperCase() + prop.slice(1);\n    for (var i = 0; i < vendorNames.length; i++) {\n      var name = vendorNames[i] + capName;\n      if (name in emptyStyle) {\n        return name\n      }\n    }\n  });\n\n  function updateStyle (oldVnode, vnode) {\n    var data = vnode.data;\n    var oldData = oldVnode.data;\n\n    if (isUndef(data.staticStyle) && isUndef(data.style) &&\n      isUndef(oldData.staticStyle) && isUndef(oldData.style)\n    ) {\n      return\n    }\n\n    var cur, name;\n    var el = vnode.elm;\n    var oldStaticStyle = oldData.staticStyle;\n    var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};\n\n    // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n    var oldStyle = oldStaticStyle || oldStyleBinding;\n\n    var style = normalizeStyleBinding(vnode.data.style) || {};\n\n    // store normalized style under a different key for next diff\n    // make sure to clone it if it's reactive, since the user likely wants\n    // to mutate it.\n    vnode.data.normalizedStyle = isDef(style.__ob__)\n      ? extend({}, style)\n      : style;\n\n    var newStyle = getStyle(vnode, true);\n\n    for (name in oldStyle) {\n      if (isUndef(newStyle[name])) {\n        setProp(el, name, '');\n      }\n    }\n    for (name in newStyle) {\n      cur = newStyle[name];\n      if (cur !== oldStyle[name]) {\n        // ie9 setting to null has no effect, must use empty string\n        setProp(el, name, cur == null ? '' : cur);\n      }\n    }\n  }\n\n  var style = {\n    create: updateStyle,\n    update: updateStyle\n  };\n\n  /*  */\n\n  var whitespaceRE = /\\s+/;\n\n  /**\n   * Add class with compatibility for SVG since classList is not supported on\n   * SVG elements in IE\n   */\n  function addClass (el, cls) {\n    /* istanbul ignore if */\n    if (!cls || !(cls = cls.trim())) {\n      return\n    }\n\n    /* istanbul ignore else */\n    if (el.classList) {\n      if (cls.indexOf(' ') > -1) {\n        cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });\n      } else {\n        el.classList.add(cls);\n      }\n    } else {\n      var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n      if (cur.indexOf(' ' + cls + ' ') < 0) {\n        el.setAttribute('class', (cur + cls).trim());\n      }\n    }\n  }\n\n  /**\n   * Remove class with compatibility for SVG since classList is not supported on\n   * SVG elements in IE\n   */\n  function removeClass (el, cls) {\n    /* istanbul ignore if */\n    if (!cls || !(cls = cls.trim())) {\n      return\n    }\n\n    /* istanbul ignore else */\n    if (el.classList) {\n      if (cls.indexOf(' ') > -1) {\n        cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });\n      } else {\n        el.classList.remove(cls);\n      }\n      if (!el.classList.length) {\n        el.removeAttribute('class');\n      }\n    } else {\n      var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n      var tar = ' ' + cls + ' ';\n      while (cur.indexOf(tar) >= 0) {\n        cur = cur.replace(tar, ' ');\n      }\n      cur = cur.trim();\n      if (cur) {\n        el.setAttribute('class', cur);\n      } else {\n        el.removeAttribute('class');\n      }\n    }\n  }\n\n  /*  */\n\n  function resolveTransition (def$$1) {\n    if (!def$$1) {\n      return\n    }\n    /* istanbul ignore else */\n    if (typeof def$$1 === 'object') {\n      var res = {};\n      if (def$$1.css !== false) {\n        extend(res, autoCssTransition(def$$1.name || 'v'));\n      }\n      extend(res, def$$1);\n      return res\n    } else if (typeof def$$1 === 'string') {\n      return autoCssTransition(def$$1)\n    }\n  }\n\n  var autoCssTransition = cached(function (name) {\n    return {\n      enterClass: (name + \"-enter\"),\n      enterToClass: (name + \"-enter-to\"),\n      enterActiveClass: (name + \"-enter-active\"),\n      leaveClass: (name + \"-leave\"),\n      leaveToClass: (name + \"-leave-to\"),\n      leaveActiveClass: (name + \"-leave-active\")\n    }\n  });\n\n  var hasTransition = inBrowser && !isIE9;\n  var TRANSITION = 'transition';\n  var ANIMATION = 'animation';\n\n  // Transition property/event sniffing\n  var transitionProp = 'transition';\n  var transitionEndEvent = 'transitionend';\n  var animationProp = 'animation';\n  var animationEndEvent = 'animationend';\n  if (hasTransition) {\n    /* istanbul ignore if */\n    if (window.ontransitionend === undefined &&\n      window.onwebkittransitionend !== undefined\n    ) {\n      transitionProp = 'WebkitTransition';\n      transitionEndEvent = 'webkitTransitionEnd';\n    }\n    if (window.onanimationend === undefined &&\n      window.onwebkitanimationend !== undefined\n    ) {\n      animationProp = 'WebkitAnimation';\n      animationEndEvent = 'webkitAnimationEnd';\n    }\n  }\n\n  // binding to window is necessary to make hot reload work in IE in strict mode\n  var raf = inBrowser\n    ? window.requestAnimationFrame\n      ? window.requestAnimationFrame.bind(window)\n      : setTimeout\n    : /* istanbul ignore next */ function (fn) { return fn(); };\n\n  function nextFrame (fn) {\n    raf(function () {\n      raf(fn);\n    });\n  }\n\n  function addTransitionClass (el, cls) {\n    var transitionClasses = el._transitionClasses || (el._transitionClasses = []);\n    if (transitionClasses.indexOf(cls) < 0) {\n      transitionClasses.push(cls);\n      addClass(el, cls);\n    }\n  }\n\n  function removeTransitionClass (el, cls) {\n    if (el._transitionClasses) {\n      remove(el._transitionClasses, cls);\n    }\n    removeClass(el, cls);\n  }\n\n  function whenTransitionEnds (\n    el,\n    expectedType,\n    cb\n  ) {\n    var ref = getTransitionInfo(el, expectedType);\n    var type = ref.type;\n    var timeout = ref.timeout;\n    var propCount = ref.propCount;\n    if (!type) { return cb() }\n    var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n    var ended = 0;\n    var end = function () {\n      el.removeEventListener(event, onEnd);\n      cb();\n    };\n    var onEnd = function (e) {\n      if (e.target === el) {\n        if (++ended >= propCount) {\n          end();\n        }\n      }\n    };\n    setTimeout(function () {\n      if (ended < propCount) {\n        end();\n      }\n    }, timeout + 1);\n    el.addEventListener(event, onEnd);\n  }\n\n  var transformRE = /\\b(transform|all)(,|$)/;\n\n  function getTransitionInfo (el, expectedType) {\n    var styles = window.getComputedStyle(el);\n    // JSDOM may return undefined for transition properties\n    var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');\n    var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');\n    var transitionTimeout = getTimeout(transitionDelays, transitionDurations);\n    var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');\n    var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');\n    var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n    var type;\n    var timeout = 0;\n    var propCount = 0;\n    /* istanbul ignore if */\n    if (expectedType === TRANSITION) {\n      if (transitionTimeout > 0) {\n        type = TRANSITION;\n        timeout = transitionTimeout;\n        propCount = transitionDurations.length;\n      }\n    } else if (expectedType === ANIMATION) {\n      if (animationTimeout > 0) {\n        type = ANIMATION;\n        timeout = animationTimeout;\n        propCount = animationDurations.length;\n      }\n    } else {\n      timeout = Math.max(transitionTimeout, animationTimeout);\n      type = timeout > 0\n        ? transitionTimeout > animationTimeout\n          ? TRANSITION\n          : ANIMATION\n        : null;\n      propCount = type\n        ? type === TRANSITION\n          ? transitionDurations.length\n          : animationDurations.length\n        : 0;\n    }\n    var hasTransform =\n      type === TRANSITION &&\n      transformRE.test(styles[transitionProp + 'Property']);\n    return {\n      type: type,\n      timeout: timeout,\n      propCount: propCount,\n      hasTransform: hasTransform\n    }\n  }\n\n  function getTimeout (delays, durations) {\n    /* istanbul ignore next */\n    while (delays.length < durations.length) {\n      delays = delays.concat(delays);\n    }\n\n    return Math.max.apply(null, durations.map(function (d, i) {\n      return toMs(d) + toMs(delays[i])\n    }))\n  }\n\n  // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers\n  // in a locale-dependent way, using a comma instead of a dot.\n  // If comma is not replaced with a dot, the input will be rounded down (i.e. acting\n  // as a floor function) causing unexpected behaviors\n  function toMs (s) {\n    return Number(s.slice(0, -1).replace(',', '.')) * 1000\n  }\n\n  /*  */\n\n  function enter (vnode, toggleDisplay) {\n    var el = vnode.elm;\n\n    // call leave callback now\n    if (isDef(el._leaveCb)) {\n      el._leaveCb.cancelled = true;\n      el._leaveCb();\n    }\n\n    var data = resolveTransition(vnode.data.transition);\n    if (isUndef(data)) {\n      return\n    }\n\n    /* istanbul ignore if */\n    if (isDef(el._enterCb) || el.nodeType !== 1) {\n      return\n    }\n\n    var css = data.css;\n    var type = data.type;\n    var enterClass = data.enterClass;\n    var enterToClass = data.enterToClass;\n    var enterActiveClass = data.enterActiveClass;\n    var appearClass = data.appearClass;\n    var appearToClass = data.appearToClass;\n    var appearActiveClass = data.appearActiveClass;\n    var beforeEnter = data.beforeEnter;\n    var enter = data.enter;\n    var afterEnter = data.afterEnter;\n    var enterCancelled = data.enterCancelled;\n    var beforeAppear = data.beforeAppear;\n    var appear = data.appear;\n    var afterAppear = data.afterAppear;\n    var appearCancelled = data.appearCancelled;\n    var duration = data.duration;\n\n    // activeInstance will always be the <transition> component managing this\n    // transition. One edge case to check is when the <transition> is placed\n    // as the root node of a child component. In that case we need to check\n    // <transition>'s parent for appear check.\n    var context = activeInstance;\n    var transitionNode = activeInstance.$vnode;\n    while (transitionNode && transitionNode.parent) {\n      transitionNode = transitionNode.parent;\n      context = transitionNode.context;\n    }\n\n    var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n    if (isAppear && !appear && appear !== '') {\n      return\n    }\n\n    var startClass = isAppear && appearClass\n      ? appearClass\n      : enterClass;\n    var activeClass = isAppear && appearActiveClass\n      ? appearActiveClass\n      : enterActiveClass;\n    var toClass = isAppear && appearToClass\n      ? appearToClass\n      : enterToClass;\n\n    var beforeEnterHook = isAppear\n      ? (beforeAppear || beforeEnter)\n      : beforeEnter;\n    var enterHook = isAppear\n      ? (typeof appear === 'function' ? appear : enter)\n      : enter;\n    var afterEnterHook = isAppear\n      ? (afterAppear || afterEnter)\n      : afterEnter;\n    var enterCancelledHook = isAppear\n      ? (appearCancelled || enterCancelled)\n      : enterCancelled;\n\n    var explicitEnterDuration = toNumber(\n      isObject(duration)\n        ? duration.enter\n        : duration\n    );\n\n    if (explicitEnterDuration != null) {\n      checkDuration(explicitEnterDuration, 'enter', vnode);\n    }\n\n    var expectsCSS = css !== false && !isIE9;\n    var userWantsControl = getHookArgumentsLength(enterHook);\n\n    var cb = el._enterCb = once(function () {\n      if (expectsCSS) {\n        removeTransitionClass(el, toClass);\n        removeTransitionClass(el, activeClass);\n      }\n      if (cb.cancelled) {\n        if (expectsCSS) {\n          removeTransitionClass(el, startClass);\n        }\n        enterCancelledHook && enterCancelledHook(el);\n      } else {\n        afterEnterHook && afterEnterHook(el);\n      }\n      el._enterCb = null;\n    });\n\n    if (!vnode.data.show) {\n      // remove pending leave element on enter by injecting an insert hook\n      mergeVNodeHook(vnode, 'insert', function () {\n        var parent = el.parentNode;\n        var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n        if (pendingNode &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb\n        ) {\n          pendingNode.elm._leaveCb();\n        }\n        enterHook && enterHook(el, cb);\n      });\n    }\n\n    // start enter transition\n    beforeEnterHook && beforeEnterHook(el);\n    if (expectsCSS) {\n      addTransitionClass(el, startClass);\n      addTransitionClass(el, activeClass);\n      nextFrame(function () {\n        removeTransitionClass(el, startClass);\n        if (!cb.cancelled) {\n          addTransitionClass(el, toClass);\n          if (!userWantsControl) {\n            if (isValidDuration(explicitEnterDuration)) {\n              setTimeout(cb, explicitEnterDuration);\n            } else {\n              whenTransitionEnds(el, type, cb);\n            }\n          }\n        }\n      });\n    }\n\n    if (vnode.data.show) {\n      toggleDisplay && toggleDisplay();\n      enterHook && enterHook(el, cb);\n    }\n\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n\n  function leave (vnode, rm) {\n    var el = vnode.elm;\n\n    // call enter callback now\n    if (isDef(el._enterCb)) {\n      el._enterCb.cancelled = true;\n      el._enterCb();\n    }\n\n    var data = resolveTransition(vnode.data.transition);\n    if (isUndef(data) || el.nodeType !== 1) {\n      return rm()\n    }\n\n    /* istanbul ignore if */\n    if (isDef(el._leaveCb)) {\n      return\n    }\n\n    var css = data.css;\n    var type = data.type;\n    var leaveClass = data.leaveClass;\n    var leaveToClass = data.leaveToClass;\n    var leaveActiveClass = data.leaveActiveClass;\n    var beforeLeave = data.beforeLeave;\n    var leave = data.leave;\n    var afterLeave = data.afterLeave;\n    var leaveCancelled = data.leaveCancelled;\n    var delayLeave = data.delayLeave;\n    var duration = data.duration;\n\n    var expectsCSS = css !== false && !isIE9;\n    var userWantsControl = getHookArgumentsLength(leave);\n\n    var explicitLeaveDuration = toNumber(\n      isObject(duration)\n        ? duration.leave\n        : duration\n    );\n\n    if (isDef(explicitLeaveDuration)) {\n      checkDuration(explicitLeaveDuration, 'leave', vnode);\n    }\n\n    var cb = el._leaveCb = once(function () {\n      if (el.parentNode && el.parentNode._pending) {\n        el.parentNode._pending[vnode.key] = null;\n      }\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveToClass);\n        removeTransitionClass(el, leaveActiveClass);\n      }\n      if (cb.cancelled) {\n        if (expectsCSS) {\n          removeTransitionClass(el, leaveClass);\n        }\n        leaveCancelled && leaveCancelled(el);\n      } else {\n        rm();\n        afterLeave && afterLeave(el);\n      }\n      el._leaveCb = null;\n    });\n\n    if (delayLeave) {\n      delayLeave(performLeave);\n    } else {\n      performLeave();\n    }\n\n    function performLeave () {\n      // the delayed leave may have already been cancelled\n      if (cb.cancelled) {\n        return\n      }\n      // record leaving element\n      if (!vnode.data.show && el.parentNode) {\n        (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;\n      }\n      beforeLeave && beforeLeave(el);\n      if (expectsCSS) {\n        addTransitionClass(el, leaveClass);\n        addTransitionClass(el, leaveActiveClass);\n        nextFrame(function () {\n          removeTransitionClass(el, leaveClass);\n          if (!cb.cancelled) {\n            addTransitionClass(el, leaveToClass);\n            if (!userWantsControl) {\n              if (isValidDuration(explicitLeaveDuration)) {\n                setTimeout(cb, explicitLeaveDuration);\n              } else {\n                whenTransitionEnds(el, type, cb);\n              }\n            }\n          }\n        });\n      }\n      leave && leave(el, cb);\n      if (!expectsCSS && !userWantsControl) {\n        cb();\n      }\n    }\n  }\n\n  // only used in dev mode\n  function checkDuration (val, name, vnode) {\n    if (typeof val !== 'number') {\n      warn(\n        \"<transition> explicit \" + name + \" duration is not a valid number - \" +\n        \"got \" + (JSON.stringify(val)) + \".\",\n        vnode.context\n      );\n    } else if (isNaN(val)) {\n      warn(\n        \"<transition> explicit \" + name + \" duration is NaN - \" +\n        'the duration expression might be incorrect.',\n        vnode.context\n      );\n    }\n  }\n\n  function isValidDuration (val) {\n    return typeof val === 'number' && !isNaN(val)\n  }\n\n  /**\n   * Normalize a transition hook's argument length. The hook may be:\n   * - a merged hook (invoker) with the original in .fns\n   * - a wrapped component method (check ._length)\n   * - a plain function (.length)\n   */\n  function getHookArgumentsLength (fn) {\n    if (isUndef(fn)) {\n      return false\n    }\n    var invokerFns = fn.fns;\n    if (isDef(invokerFns)) {\n      // invoker\n      return getHookArgumentsLength(\n        Array.isArray(invokerFns)\n          ? invokerFns[0]\n          : invokerFns\n      )\n    } else {\n      return (fn._length || fn.length) > 1\n    }\n  }\n\n  function _enter (_, vnode) {\n    if (vnode.data.show !== true) {\n      enter(vnode);\n    }\n  }\n\n  var transition = inBrowser ? {\n    create: _enter,\n    activate: _enter,\n    remove: function remove$$1 (vnode, rm) {\n      /* istanbul ignore else */\n      if (vnode.data.show !== true) {\n        leave(vnode, rm);\n      } else {\n        rm();\n      }\n    }\n  } : {};\n\n  var platformModules = [\n    attrs,\n    klass,\n    events,\n    domProps,\n    style,\n    transition\n  ];\n\n  /*  */\n\n  // the directive module should be applied last, after all\n  // built-in modules have been applied.\n  var modules = platformModules.concat(baseModules);\n\n  var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n  /**\n   * Not type checking this file because flow doesn't like attaching\n   * properties to Elements.\n   */\n\n  /* istanbul ignore if */\n  if (isIE9) {\n    // http://www.matts411.com/post/internet-explorer-9-oninput/\n    document.addEventListener('selectionchange', function () {\n      var el = document.activeElement;\n      if (el && el.vmodel) {\n        trigger(el, 'input');\n      }\n    });\n  }\n\n  var directive = {\n    inserted: function inserted (el, binding, vnode, oldVnode) {\n      if (vnode.tag === 'select') {\n        // #6903\n        if (oldVnode.elm && !oldVnode.elm._vOptions) {\n          mergeVNodeHook(vnode, 'postpatch', function () {\n            directive.componentUpdated(el, binding, vnode);\n          });\n        } else {\n          setSelected(el, binding, vnode.context);\n        }\n        el._vOptions = [].map.call(el.options, getValue);\n      } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {\n        el._vModifiers = binding.modifiers;\n        if (!binding.modifiers.lazy) {\n          el.addEventListener('compositionstart', onCompositionStart);\n          el.addEventListener('compositionend', onCompositionEnd);\n          // Safari < 10.2 & UIWebView doesn't fire compositionend when\n          // switching focus before confirming composition choice\n          // this also fixes the issue where some browsers e.g. iOS Chrome\n          // fires \"change\" instead of \"input\" on autocomplete.\n          el.addEventListener('change', onCompositionEnd);\n          /* istanbul ignore if */\n          if (isIE9) {\n            el.vmodel = true;\n          }\n        }\n      }\n    },\n\n    componentUpdated: function componentUpdated (el, binding, vnode) {\n      if (vnode.tag === 'select') {\n        setSelected(el, binding, vnode.context);\n        // in case the options rendered by v-for have changed,\n        // it's possible that the value is out-of-sync with the rendered options.\n        // detect such cases and filter out values that no longer has a matching\n        // option in the DOM.\n        var prevOptions = el._vOptions;\n        var curOptions = el._vOptions = [].map.call(el.options, getValue);\n        if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {\n          // trigger change event if\n          // no matching option found for at least one value\n          var needReset = el.multiple\n            ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })\n            : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);\n          if (needReset) {\n            trigger(el, 'change');\n          }\n        }\n      }\n    }\n  };\n\n  function setSelected (el, binding, vm) {\n    actuallySetSelected(el, binding, vm);\n    /* istanbul ignore if */\n    if (isIE || isEdge) {\n      setTimeout(function () {\n        actuallySetSelected(el, binding, vm);\n      }, 0);\n    }\n  }\n\n  function actuallySetSelected (el, binding, vm) {\n    var value = binding.value;\n    var isMultiple = el.multiple;\n    if (isMultiple && !Array.isArray(value)) {\n      warn(\n        \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n        \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n        vm\n      );\n      return\n    }\n    var selected, option;\n    for (var i = 0, l = el.options.length; i < l; i++) {\n      option = el.options[i];\n      if (isMultiple) {\n        selected = looseIndexOf(value, getValue(option)) > -1;\n        if (option.selected !== selected) {\n          option.selected = selected;\n        }\n      } else {\n        if (looseEqual(getValue(option), value)) {\n          if (el.selectedIndex !== i) {\n            el.selectedIndex = i;\n          }\n          return\n        }\n      }\n    }\n    if (!isMultiple) {\n      el.selectedIndex = -1;\n    }\n  }\n\n  function hasNoMatchingOption (value, options) {\n    return options.every(function (o) { return !looseEqual(o, value); })\n  }\n\n  function getValue (option) {\n    return '_value' in option\n      ? option._value\n      : option.value\n  }\n\n  function onCompositionStart (e) {\n    e.target.composing = true;\n  }\n\n  function onCompositionEnd (e) {\n    // prevent triggering an input event for no reason\n    if (!e.target.composing) { return }\n    e.target.composing = false;\n    trigger(e.target, 'input');\n  }\n\n  function trigger (el, type) {\n    var e = document.createEvent('HTMLEvents');\n    e.initEvent(type, true, true);\n    el.dispatchEvent(e);\n  }\n\n  /*  */\n\n  // recursively search for possible transition defined inside the component root\n  function locateNode (vnode) {\n    return vnode.componentInstance && (!vnode.data || !vnode.data.transition)\n      ? locateNode(vnode.componentInstance._vnode)\n      : vnode\n  }\n\n  var show = {\n    bind: function bind (el, ref, vnode) {\n      var value = ref.value;\n\n      vnode = locateNode(vnode);\n      var transition$$1 = vnode.data && vnode.data.transition;\n      var originalDisplay = el.__vOriginalDisplay =\n        el.style.display === 'none' ? '' : el.style.display;\n      if (value && transition$$1) {\n        vnode.data.show = true;\n        enter(vnode, function () {\n          el.style.display = originalDisplay;\n        });\n      } else {\n        el.style.display = value ? originalDisplay : 'none';\n      }\n    },\n\n    update: function update (el, ref, vnode) {\n      var value = ref.value;\n      var oldValue = ref.oldValue;\n\n      /* istanbul ignore if */\n      if (!value === !oldValue) { return }\n      vnode = locateNode(vnode);\n      var transition$$1 = vnode.data && vnode.data.transition;\n      if (transition$$1) {\n        vnode.data.show = true;\n        if (value) {\n          enter(vnode, function () {\n            el.style.display = el.__vOriginalDisplay;\n          });\n        } else {\n          leave(vnode, function () {\n            el.style.display = 'none';\n          });\n        }\n      } else {\n        el.style.display = value ? el.__vOriginalDisplay : 'none';\n      }\n    },\n\n    unbind: function unbind (\n      el,\n      binding,\n      vnode,\n      oldVnode,\n      isDestroy\n    ) {\n      if (!isDestroy) {\n        el.style.display = el.__vOriginalDisplay;\n      }\n    }\n  };\n\n  var platformDirectives = {\n    model: directive,\n    show: show\n  };\n\n  /*  */\n\n  var transitionProps = {\n    name: String,\n    appear: Boolean,\n    css: Boolean,\n    mode: String,\n    type: String,\n    enterClass: String,\n    leaveClass: String,\n    enterToClass: String,\n    leaveToClass: String,\n    enterActiveClass: String,\n    leaveActiveClass: String,\n    appearClass: String,\n    appearActiveClass: String,\n    appearToClass: String,\n    duration: [Number, String, Object]\n  };\n\n  // in case the child is also an abstract component, e.g. <keep-alive>\n  // we want to recursively retrieve the real component to be rendered\n  function getRealChild (vnode) {\n    var compOptions = vnode && vnode.componentOptions;\n    if (compOptions && compOptions.Ctor.options.abstract) {\n      return getRealChild(getFirstComponentChild(compOptions.children))\n    } else {\n      return vnode\n    }\n  }\n\n  function extractTransitionData (comp) {\n    var data = {};\n    var options = comp.$options;\n    // props\n    for (var key in options.propsData) {\n      data[key] = comp[key];\n    }\n    // events.\n    // extract listeners and pass them directly to the transition methods\n    var listeners = options._parentListeners;\n    for (var key$1 in listeners) {\n      data[camelize(key$1)] = listeners[key$1];\n    }\n    return data\n  }\n\n  function placeholder (h, rawChild) {\n    if (/\\d-keep-alive$/.test(rawChild.tag)) {\n      return h('keep-alive', {\n        props: rawChild.componentOptions.propsData\n      })\n    }\n  }\n\n  function hasParentTransition (vnode) {\n    while ((vnode = vnode.parent)) {\n      if (vnode.data.transition) {\n        return true\n      }\n    }\n  }\n\n  function isSameChild (child, oldChild) {\n    return oldChild.key === child.key && oldChild.tag === child.tag\n  }\n\n  var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };\n\n  var isVShowDirective = function (d) { return d.name === 'show'; };\n\n  var Transition = {\n    name: 'transition',\n    props: transitionProps,\n    abstract: true,\n\n    render: function render (h) {\n      var this$1 = this;\n\n      var children = this.$slots.default;\n      if (!children) {\n        return\n      }\n\n      // filter out text nodes (possible whitespaces)\n      children = children.filter(isNotTextNode);\n      /* istanbul ignore if */\n      if (!children.length) {\n        return\n      }\n\n      // warn multiple elements\n      if (children.length > 1) {\n        warn(\n          '<transition> can only be used on a single element. Use ' +\n          '<transition-group> for lists.',\n          this.$parent\n        );\n      }\n\n      var mode = this.mode;\n\n      // warn invalid mode\n      if (mode && mode !== 'in-out' && mode !== 'out-in'\n      ) {\n        warn(\n          'invalid <transition> mode: ' + mode,\n          this.$parent\n        );\n      }\n\n      var rawChild = children[0];\n\n      // if this is a component root node and the component's\n      // parent container node also has transition, skip.\n      if (hasParentTransition(this.$vnode)) {\n        return rawChild\n      }\n\n      // apply transition data to child\n      // use getRealChild() to ignore abstract components e.g. keep-alive\n      var child = getRealChild(rawChild);\n      /* istanbul ignore if */\n      if (!child) {\n        return rawChild\n      }\n\n      if (this._leaving) {\n        return placeholder(h, rawChild)\n      }\n\n      // ensure a key that is unique to the vnode type and to this transition\n      // component instance. This key will be used to remove pending leaving nodes\n      // during entering.\n      var id = \"__transition-\" + (this._uid) + \"-\";\n      child.key = child.key == null\n        ? child.isComment\n          ? id + 'comment'\n          : id + child.tag\n        : isPrimitive(child.key)\n          ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)\n          : child.key;\n\n      var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n      var oldRawChild = this._vnode;\n      var oldChild = getRealChild(oldRawChild);\n\n      // mark v-show\n      // so that the transition module can hand over the control to the directive\n      if (child.data.directives && child.data.directives.some(isVShowDirective)) {\n        child.data.show = true;\n      }\n\n      if (\n        oldChild &&\n        oldChild.data &&\n        !isSameChild(child, oldChild) &&\n        !isAsyncPlaceholder(oldChild) &&\n        // #6687 component root is a comment node\n        !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)\n      ) {\n        // replace old child transition data with fresh one\n        // important for dynamic transitions!\n        var oldData = oldChild.data.transition = extend({}, data);\n        // handle transition mode\n        if (mode === 'out-in') {\n          // return placeholder node and queue update when leave finishes\n          this._leaving = true;\n          mergeVNodeHook(oldData, 'afterLeave', function () {\n            this$1._leaving = false;\n            this$1.$forceUpdate();\n          });\n          return placeholder(h, rawChild)\n        } else if (mode === 'in-out') {\n          if (isAsyncPlaceholder(child)) {\n            return oldRawChild\n          }\n          var delayedLeave;\n          var performLeave = function () { delayedLeave(); };\n          mergeVNodeHook(data, 'afterEnter', performLeave);\n          mergeVNodeHook(data, 'enterCancelled', performLeave);\n          mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });\n        }\n      }\n\n      return rawChild\n    }\n  };\n\n  /*  */\n\n  var props = extend({\n    tag: String,\n    moveClass: String\n  }, transitionProps);\n\n  delete props.mode;\n\n  var TransitionGroup = {\n    props: props,\n\n    beforeMount: function beforeMount () {\n      var this$1 = this;\n\n      var update = this._update;\n      this._update = function (vnode, hydrating) {\n        var restoreActiveInstance = setActiveInstance(this$1);\n        // force removing pass\n        this$1.__patch__(\n          this$1._vnode,\n          this$1.kept,\n          false, // hydrating\n          true // removeOnly (!important, avoids unnecessary moves)\n        );\n        this$1._vnode = this$1.kept;\n        restoreActiveInstance();\n        update.call(this$1, vnode, hydrating);\n      };\n    },\n\n    render: function render (h) {\n      var tag = this.tag || this.$vnode.data.tag || 'span';\n      var map = Object.create(null);\n      var prevChildren = this.prevChildren = this.children;\n      var rawChildren = this.$slots.default || [];\n      var children = this.children = [];\n      var transitionData = extractTransitionData(this);\n\n      for (var i = 0; i < rawChildren.length; i++) {\n        var c = rawChildren[i];\n        if (c.tag) {\n          if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n            children.push(c);\n            map[c.key] = c\n            ;(c.data || (c.data = {})).transition = transitionData;\n          } else {\n            var opts = c.componentOptions;\n            var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;\n            warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n          }\n        }\n      }\n\n      if (prevChildren) {\n        var kept = [];\n        var removed = [];\n        for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n          var c$1 = prevChildren[i$1];\n          c$1.data.transition = transitionData;\n          c$1.data.pos = c$1.elm.getBoundingClientRect();\n          if (map[c$1.key]) {\n            kept.push(c$1);\n          } else {\n            removed.push(c$1);\n          }\n        }\n        this.kept = h(tag, null, kept);\n        this.removed = removed;\n      }\n\n      return h(tag, null, children)\n    },\n\n    updated: function updated () {\n      var children = this.prevChildren;\n      var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n      if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n        return\n      }\n\n      // we divide the work into three loops to avoid mixing DOM reads and writes\n      // in each iteration - which helps prevent layout thrashing.\n      children.forEach(callPendingCbs);\n      children.forEach(recordPosition);\n      children.forEach(applyTranslation);\n\n      // force reflow to put everything in position\n      // assign to this to avoid being removed in tree-shaking\n      // $flow-disable-line\n      this._reflow = document.body.offsetHeight;\n\n      children.forEach(function (c) {\n        if (c.data.moved) {\n          var el = c.elm;\n          var s = el.style;\n          addTransitionClass(el, moveClass);\n          s.transform = s.WebkitTransform = s.transitionDuration = '';\n          el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n            if (e && e.target !== el) {\n              return\n            }\n            if (!e || /transform$/.test(e.propertyName)) {\n              el.removeEventListener(transitionEndEvent, cb);\n              el._moveCb = null;\n              removeTransitionClass(el, moveClass);\n            }\n          });\n        }\n      });\n    },\n\n    methods: {\n      hasMove: function hasMove (el, moveClass) {\n        /* istanbul ignore if */\n        if (!hasTransition) {\n          return false\n        }\n        /* istanbul ignore if */\n        if (this._hasMove) {\n          return this._hasMove\n        }\n        // Detect whether an element with the move class applied has\n        // CSS transitions. Since the element may be inside an entering\n        // transition at this very moment, we make a clone of it and remove\n        // all other transition classes applied to ensure only the move class\n        // is applied.\n        var clone = el.cloneNode();\n        if (el._transitionClasses) {\n          el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });\n        }\n        addClass(clone, moveClass);\n        clone.style.display = 'none';\n        this.$el.appendChild(clone);\n        var info = getTransitionInfo(clone);\n        this.$el.removeChild(clone);\n        return (this._hasMove = info.hasTransform)\n      }\n    }\n  };\n\n  function callPendingCbs (c) {\n    /* istanbul ignore if */\n    if (c.elm._moveCb) {\n      c.elm._moveCb();\n    }\n    /* istanbul ignore if */\n    if (c.elm._enterCb) {\n      c.elm._enterCb();\n    }\n  }\n\n  function recordPosition (c) {\n    c.data.newPos = c.elm.getBoundingClientRect();\n  }\n\n  function applyTranslation (c) {\n    var oldPos = c.data.pos;\n    var newPos = c.data.newPos;\n    var dx = oldPos.left - newPos.left;\n    var dy = oldPos.top - newPos.top;\n    if (dx || dy) {\n      c.data.moved = true;\n      var s = c.elm.style;\n      s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n      s.transitionDuration = '0s';\n    }\n  }\n\n  var platformComponents = {\n    Transition: Transition,\n    TransitionGroup: TransitionGroup\n  };\n\n  /*  */\n\n  // install platform specific utils\n  Vue.config.mustUseProp = mustUseProp;\n  Vue.config.isReservedTag = isReservedTag;\n  Vue.config.isReservedAttr = isReservedAttr;\n  Vue.config.getTagNamespace = getTagNamespace;\n  Vue.config.isUnknownElement = isUnknownElement;\n\n  // install platform runtime directives & components\n  extend(Vue.options.directives, platformDirectives);\n  extend(Vue.options.components, platformComponents);\n\n  // install platform patch function\n  Vue.prototype.__patch__ = inBrowser ? patch : noop;\n\n  // public mount method\n  Vue.prototype.$mount = function (\n    el,\n    hydrating\n  ) {\n    el = el && inBrowser ? query(el) : undefined;\n    return mountComponent(this, el, hydrating)\n  };\n\n  // devtools global hook\n  /* istanbul ignore next */\n  if (inBrowser) {\n    setTimeout(function () {\n      if (config.devtools) {\n        if (devtools) {\n          devtools.emit('init', Vue);\n        } else {\n          console[console.info ? 'info' : 'log'](\n            'Download the Vue Devtools extension for a better development experience:\\n' +\n            'https://github.com/vuejs/vue-devtools'\n          );\n        }\n      }\n      if (config.productionTip !== false &&\n        typeof console !== 'undefined'\n      ) {\n        console[console.info ? 'info' : 'log'](\n          \"You are running Vue in development mode.\\n\" +\n          \"Make sure to turn on production mode when deploying for production.\\n\" +\n          \"See more tips at https://vuejs.org/guide/deployment.html\"\n        );\n      }\n    }, 0);\n  }\n\n  /*  */\n\n  var defaultTagRE = /\\{\\{((?:.|\\r?\\n)+?)\\}\\}/g;\n  var regexEscapeRE = /[-.*+?^${}()|[\\]\\/\\\\]/g;\n\n  var buildRegex = cached(function (delimiters) {\n    var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n    var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n    return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n  });\n\n\n\n  function parseText (\n    text,\n    delimiters\n  ) {\n    var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n    if (!tagRE.test(text)) {\n      return\n    }\n    var tokens = [];\n    var rawTokens = [];\n    var lastIndex = tagRE.lastIndex = 0;\n    var match, index, tokenValue;\n    while ((match = tagRE.exec(text))) {\n      index = match.index;\n      // push text token\n      if (index > lastIndex) {\n        rawTokens.push(tokenValue = text.slice(lastIndex, index));\n        tokens.push(JSON.stringify(tokenValue));\n      }\n      // tag token\n      var exp = parseFilters(match[1].trim());\n      tokens.push((\"_s(\" + exp + \")\"));\n      rawTokens.push({ '@binding': exp });\n      lastIndex = index + match[0].length;\n    }\n    if (lastIndex < text.length) {\n      rawTokens.push(tokenValue = text.slice(lastIndex));\n      tokens.push(JSON.stringify(tokenValue));\n    }\n    return {\n      expression: tokens.join('+'),\n      tokens: rawTokens\n    }\n  }\n\n  /*  */\n\n  function transformNode (el, options) {\n    var warn = options.warn || baseWarn;\n    var staticClass = getAndRemoveAttr(el, 'class');\n    if (staticClass) {\n      var res = parseText(staticClass, options.delimiters);\n      if (res) {\n        warn(\n          \"class=\\\"\" + staticClass + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.',\n          el.rawAttrsMap['class']\n        );\n      }\n    }\n    if (staticClass) {\n      el.staticClass = JSON.stringify(staticClass);\n    }\n    var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n    if (classBinding) {\n      el.classBinding = classBinding;\n    }\n  }\n\n  function genData (el) {\n    var data = '';\n    if (el.staticClass) {\n      data += \"staticClass:\" + (el.staticClass) + \",\";\n    }\n    if (el.classBinding) {\n      data += \"class:\" + (el.classBinding) + \",\";\n    }\n    return data\n  }\n\n  var klass$1 = {\n    staticKeys: ['staticClass'],\n    transformNode: transformNode,\n    genData: genData\n  };\n\n  /*  */\n\n  function transformNode$1 (el, options) {\n    var warn = options.warn || baseWarn;\n    var staticStyle = getAndRemoveAttr(el, 'style');\n    if (staticStyle) {\n      /* istanbul ignore if */\n      {\n        var res = parseText(staticStyle, options.delimiters);\n        if (res) {\n          warn(\n            \"style=\\\"\" + staticStyle + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.',\n            el.rawAttrsMap['style']\n          );\n        }\n      }\n      el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n    }\n\n    var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n    if (styleBinding) {\n      el.styleBinding = styleBinding;\n    }\n  }\n\n  function genData$1 (el) {\n    var data = '';\n    if (el.staticStyle) {\n      data += \"staticStyle:\" + (el.staticStyle) + \",\";\n    }\n    if (el.styleBinding) {\n      data += \"style:(\" + (el.styleBinding) + \"),\";\n    }\n    return data\n  }\n\n  var style$1 = {\n    staticKeys: ['staticStyle'],\n    transformNode: transformNode$1,\n    genData: genData$1\n  };\n\n  /*  */\n\n  var decoder;\n\n  var he = {\n    decode: function decode (html) {\n      decoder = decoder || document.createElement('div');\n      decoder.innerHTML = html;\n      return decoder.textContent\n    }\n  };\n\n  /*  */\n\n  var isUnaryTag = makeMap(\n    'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n    'link,meta,param,source,track,wbr'\n  );\n\n  // Elements that you can, intentionally, leave open\n  // (and which close themselves)\n  var canBeLeftOpenTag = makeMap(\n    'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'\n  );\n\n  // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n  // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\n  var isNonPhrasingTag = makeMap(\n    'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n    'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n    'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n    'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n    'title,tr,track'\n  );\n\n  /**\n   * Not type-checking this file because it's mostly vendor code.\n   */\n\n  // Regular Expressions for parsing tags and attributes\n  var attribute = /^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/;\n  var dynamicArgAttribute = /^\\s*((?:v-[\\w-]+:|@|:|#)\\[[^=]+\\][^\\s\"'<>\\/=]*)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/;\n  var ncname = \"[a-zA-Z_][\\\\-\\\\.0-9_a-zA-Z\" + unicodeLetters + \"]*\";\n  var qnameCapture = \"((?:\" + ncname + \"\\\\:)?\" + ncname + \")\";\n  var startTagOpen = new RegExp((\"^<\" + qnameCapture));\n  var startTagClose = /^\\s*(\\/?)>/;\n  var endTag = new RegExp((\"^<\\\\/\" + qnameCapture + \"[^>]*>\"));\n  var doctype = /^<!DOCTYPE [^>]+>/i;\n  // #7298: escape - to avoid being pased as HTML comment when inlined in page\n  var comment = /^<!\\--/;\n  var conditionalComment = /^<!\\[/;\n\n  // Special Elements (can contain anything)\n  var isPlainTextElement = makeMap('script,style,textarea', true);\n  var reCache = {};\n\n  var decodingMap = {\n    '&lt;': '<',\n    '&gt;': '>',\n    '&quot;': '\"',\n    '&amp;': '&',\n    '&#10;': '\\n',\n    '&#9;': '\\t',\n    '&#39;': \"'\"\n  };\n  var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;\n  var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;\n\n  // #5992\n  var isIgnoreNewlineTag = makeMap('pre,textarea', true);\n  var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\\n'; };\n\n  function decodeAttr (value, shouldDecodeNewlines) {\n    var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;\n    return value.replace(re, function (match) { return decodingMap[match]; })\n  }\n\n  function parseHTML (html, options) {\n    var stack = [];\n    var expectHTML = options.expectHTML;\n    var isUnaryTag$$1 = options.isUnaryTag || no;\n    var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;\n    var index = 0;\n    var last, lastTag;\n    while (html) {\n      last = html;\n      // Make sure we're not in a plaintext content element like script/style\n      if (!lastTag || !isPlainTextElement(lastTag)) {\n        var textEnd = html.indexOf('<');\n        if (textEnd === 0) {\n          // Comment:\n          if (comment.test(html)) {\n            var commentEnd = html.indexOf('-->');\n\n            if (commentEnd >= 0) {\n              if (options.shouldKeepComment) {\n                options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);\n              }\n              advance(commentEnd + 3);\n              continue\n            }\n          }\n\n          // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n          if (conditionalComment.test(html)) {\n            var conditionalEnd = html.indexOf(']>');\n\n            if (conditionalEnd >= 0) {\n              advance(conditionalEnd + 2);\n              continue\n            }\n          }\n\n          // Doctype:\n          var doctypeMatch = html.match(doctype);\n          if (doctypeMatch) {\n            advance(doctypeMatch[0].length);\n            continue\n          }\n\n          // End tag:\n          var endTagMatch = html.match(endTag);\n          if (endTagMatch) {\n            var curIndex = index;\n            advance(endTagMatch[0].length);\n            parseEndTag(endTagMatch[1], curIndex, index);\n            continue\n          }\n\n          // Start tag:\n          var startTagMatch = parseStartTag();\n          if (startTagMatch) {\n            handleStartTag(startTagMatch);\n            if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {\n              advance(1);\n            }\n            continue\n          }\n        }\n\n        var text = (void 0), rest = (void 0), next = (void 0);\n        if (textEnd >= 0) {\n          rest = html.slice(textEnd);\n          while (\n            !endTag.test(rest) &&\n            !startTagOpen.test(rest) &&\n            !comment.test(rest) &&\n            !conditionalComment.test(rest)\n          ) {\n            // < in plain text, be forgiving and treat it as text\n            next = rest.indexOf('<', 1);\n            if (next < 0) { break }\n            textEnd += next;\n            rest = html.slice(textEnd);\n          }\n          text = html.substring(0, textEnd);\n        }\n\n        if (textEnd < 0) {\n          text = html;\n        }\n\n        if (text) {\n          advance(text.length);\n        }\n\n        if (options.chars && text) {\n          options.chars(text, index - text.length, index);\n        }\n      } else {\n        var endTagLength = 0;\n        var stackedTag = lastTag.toLowerCase();\n        var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n        var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {\n          endTagLength = endTag.length;\n          if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {\n            text = text\n              .replace(/<!\\--([\\s\\S]*?)-->/g, '$1') // #7298\n              .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n          }\n          if (shouldIgnoreFirstNewline(stackedTag, text)) {\n            text = text.slice(1);\n          }\n          if (options.chars) {\n            options.chars(text);\n          }\n          return ''\n        });\n        index += html.length - rest$1.length;\n        html = rest$1;\n        parseEndTag(stackedTag, index - endTagLength, index);\n      }\n\n      if (html === last) {\n        options.chars && options.chars(html);\n        if (!stack.length && options.warn) {\n          options.warn((\"Mal-formatted tag at end of template: \\\"\" + html + \"\\\"\"), { start: index + html.length });\n        }\n        break\n      }\n    }\n\n    // Clean up any remaining tags\n    parseEndTag();\n\n    function advance (n) {\n      index += n;\n      html = html.substring(n);\n    }\n\n    function parseStartTag () {\n      var start = html.match(startTagOpen);\n      if (start) {\n        var match = {\n          tagName: start[1],\n          attrs: [],\n          start: index\n        };\n        advance(start[0].length);\n        var end, attr;\n        while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {\n          attr.start = index;\n          advance(attr[0].length);\n          attr.end = index;\n          match.attrs.push(attr);\n        }\n        if (end) {\n          match.unarySlash = end[1];\n          advance(end[0].length);\n          match.end = index;\n          return match\n        }\n      }\n    }\n\n    function handleStartTag (match) {\n      var tagName = match.tagName;\n      var unarySlash = match.unarySlash;\n\n      if (expectHTML) {\n        if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n          parseEndTag(lastTag);\n        }\n        if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {\n          parseEndTag(tagName);\n        }\n      }\n\n      var unary = isUnaryTag$$1(tagName) || !!unarySlash;\n\n      var l = match.attrs.length;\n      var attrs = new Array(l);\n      for (var i = 0; i < l; i++) {\n        var args = match.attrs[i];\n        var value = args[3] || args[4] || args[5] || '';\n        var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'\n          ? options.shouldDecodeNewlinesForHref\n          : options.shouldDecodeNewlines;\n        attrs[i] = {\n          name: args[1],\n          value: decodeAttr(value, shouldDecodeNewlines)\n        };\n        if (options.outputSourceRange) {\n          attrs[i].start = args.start + args[0].match(/^\\s*/).length;\n          attrs[i].end = args.end;\n        }\n      }\n\n      if (!unary) {\n        stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });\n        lastTag = tagName;\n      }\n\n      if (options.start) {\n        options.start(tagName, attrs, unary, match.start, match.end);\n      }\n    }\n\n    function parseEndTag (tagName, start, end) {\n      var pos, lowerCasedTagName;\n      if (start == null) { start = index; }\n      if (end == null) { end = index; }\n\n      // Find the closest opened tag of the same type\n      if (tagName) {\n        lowerCasedTagName = tagName.toLowerCase();\n        for (pos = stack.length - 1; pos >= 0; pos--) {\n          if (stack[pos].lowerCasedTag === lowerCasedTagName) {\n            break\n          }\n        }\n      } else {\n        // If no tag name is provided, clean shop\n        pos = 0;\n      }\n\n      if (pos >= 0) {\n        // Close all the open elements, up the stack\n        for (var i = stack.length - 1; i >= pos; i--) {\n          if (i > pos || !tagName &&\n            options.warn\n          ) {\n            options.warn(\n              (\"tag <\" + (stack[i].tag) + \"> has no matching end tag.\"),\n              { start: stack[i].start }\n            );\n          }\n          if (options.end) {\n            options.end(stack[i].tag, start, end);\n          }\n        }\n\n        // Remove the open elements from the stack\n        stack.length = pos;\n        lastTag = pos && stack[pos - 1].tag;\n      } else if (lowerCasedTagName === 'br') {\n        if (options.start) {\n          options.start(tagName, [], true, start, end);\n        }\n      } else if (lowerCasedTagName === 'p') {\n        if (options.start) {\n          options.start(tagName, [], false, start, end);\n        }\n        if (options.end) {\n          options.end(tagName, start, end);\n        }\n      }\n    }\n  }\n\n  /*  */\n\n  var onRE = /^@|^v-on:/;\n  var dirRE = /^v-|^@|^:/;\n  var forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\n  var forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\n  var stripParensRE = /^\\(|\\)$/g;\n  var dynamicArgRE = /^\\[.*\\]$/;\n\n  var argRE = /:(.*)$/;\n  var bindRE = /^:|^\\.|^v-bind:/;\n  var modifierRE = /\\.[^.]+/g;\n\n  var slotRE = /^v-slot(:|$)|^#/;\n\n  var lineBreakRE = /[\\r\\n]/;\n  var whitespaceRE$1 = /\\s+/g;\n\n  var invalidAttributeRE = /[\\s\"'<>\\/=]/;\n\n  var decodeHTMLCached = cached(he.decode);\n\n  var emptySlotScopeToken = \"_empty_\";\n\n  // configurable state\n  var warn$2;\n  var delimiters;\n  var transforms;\n  var preTransforms;\n  var postTransforms;\n  var platformIsPreTag;\n  var platformMustUseProp;\n  var platformGetTagNamespace;\n  var maybeComponent;\n\n  function createASTElement (\n    tag,\n    attrs,\n    parent\n  ) {\n    return {\n      type: 1,\n      tag: tag,\n      attrsList: attrs,\n      attrsMap: makeAttrsMap(attrs),\n      rawAttrsMap: {},\n      parent: parent,\n      children: []\n    }\n  }\n\n  /**\n   * Convert HTML string to AST.\n   */\n  function parse (\n    template,\n    options\n  ) {\n    warn$2 = options.warn || baseWarn;\n\n    platformIsPreTag = options.isPreTag || no;\n    platformMustUseProp = options.mustUseProp || no;\n    platformGetTagNamespace = options.getTagNamespace || no;\n    var isReservedTag = options.isReservedTag || no;\n    maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };\n\n    transforms = pluckModuleFunction(options.modules, 'transformNode');\n    preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n    postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n\n    delimiters = options.delimiters;\n\n    var stack = [];\n    var preserveWhitespace = options.preserveWhitespace !== false;\n    var whitespaceOption = options.whitespace;\n    var root;\n    var currentParent;\n    var inVPre = false;\n    var inPre = false;\n    var warned = false;\n\n    function warnOnce (msg, range) {\n      if (!warned) {\n        warned = true;\n        warn$2(msg, range);\n      }\n    }\n\n    function closeElement (element) {\n      trimEndingWhitespace(element);\n      if (!inVPre && !element.processed) {\n        element = processElement(element, options);\n      }\n      // tree management\n      if (!stack.length && element !== root) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          {\n            checkRootConstraints(element);\n          }\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else {\n          warnOnce(\n            \"Component template should contain exactly one root element. \" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\",\n            { start: element.start }\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else {\n          if (element.slotScope) {\n            // scoped slot\n            // keep it in the children list so that v-else(-if) conditions can\n            // find it as the prev node.\n            var name = element.slotTarget || '\"default\"'\n            ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n          }\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n\n      // final children cleanup\n      // filter out scoped slots\n      element.children = element.children.filter(function (c) { return !(c).slotScope; });\n      // remove trailing whitespace node again\n      trimEndingWhitespace(element);\n\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n      // apply post-transforms\n      for (var i = 0; i < postTransforms.length; i++) {\n        postTransforms[i](element, options);\n      }\n    }\n\n    function trimEndingWhitespace (el) {\n      // remove trailing whitespace node\n      if (!inPre) {\n        var lastNode;\n        while (\n          (lastNode = el.children[el.children.length - 1]) &&\n          lastNode.type === 3 &&\n          lastNode.text === ' '\n        ) {\n          el.children.pop();\n        }\n      }\n    }\n\n    function checkRootConstraints (el) {\n      if (el.tag === 'slot' || el.tag === 'template') {\n        warnOnce(\n          \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n          'contain multiple nodes.',\n          { start: el.start }\n        );\n      }\n      if (el.attrsMap.hasOwnProperty('v-for')) {\n        warnOnce(\n          'Cannot use v-for on stateful component root element because ' +\n          'it renders multiple elements.',\n          el.rawAttrsMap['v-for']\n        );\n      }\n    }\n\n    parseHTML(template, {\n      warn: warn$2,\n      expectHTML: options.expectHTML,\n      isUnaryTag: options.isUnaryTag,\n      canBeLeftOpenTag: options.canBeLeftOpenTag,\n      shouldDecodeNewlines: options.shouldDecodeNewlines,\n      shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,\n      shouldKeepComment: options.comments,\n      outputSourceRange: options.outputSourceRange,\n      start: function start (tag, attrs, unary, start$1) {\n        // check namespace.\n        // inherit parent ns if there is one\n        var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n        // handle IE svg bug\n        /* istanbul ignore if */\n        if (isIE && ns === 'svg') {\n          attrs = guardIESVGBug(attrs);\n        }\n\n        var element = createASTElement(tag, attrs, currentParent);\n        if (ns) {\n          element.ns = ns;\n        }\n\n        {\n          if (options.outputSourceRange) {\n            element.start = start$1;\n            element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {\n              cumulated[attr.name] = attr;\n              return cumulated\n            }, {});\n          }\n          attrs.forEach(function (attr) {\n            if (invalidAttributeRE.test(attr.name)) {\n              warn$2(\n                \"Invalid dynamic argument expression: attribute names cannot contain \" +\n                \"spaces, quotes, <, >, / or =.\",\n                {\n                  start: attr.start + attr.name.indexOf(\"[\"),\n                  end: attr.start + attr.name.length\n                }\n              );\n            }\n          });\n        }\n\n        if (isForbiddenTag(element) && !isServerRendering()) {\n          element.forbidden = true;\n          warn$2(\n            'Templates should only be responsible for mapping the state to the ' +\n            'UI. Avoid placing tags with side-effects in your templates, such as ' +\n            \"<\" + tag + \">\" + ', as they will not be parsed.',\n            { start: element.start }\n          );\n        }\n\n        // apply pre-transforms\n        for (var i = 0; i < preTransforms.length; i++) {\n          element = preTransforms[i](element, options) || element;\n        }\n\n        if (!inVPre) {\n          processPre(element);\n          if (element.pre) {\n            inVPre = true;\n          }\n        }\n        if (platformIsPreTag(element.tag)) {\n          inPre = true;\n        }\n        if (inVPre) {\n          processRawAttrs(element);\n        } else if (!element.processed) {\n          // structural directives\n          processFor(element);\n          processIf(element);\n          processOnce(element);\n        }\n\n        if (!root) {\n          root = element;\n          {\n            checkRootConstraints(root);\n          }\n        }\n\n        if (!unary) {\n          currentParent = element;\n          stack.push(element);\n        } else {\n          closeElement(element);\n        }\n      },\n\n      end: function end (tag, start, end$1) {\n        var element = stack[stack.length - 1];\n        // pop stack\n        stack.length -= 1;\n        currentParent = stack[stack.length - 1];\n        if (options.outputSourceRange) {\n          element.end = end$1;\n        }\n        closeElement(element);\n      },\n\n      chars: function chars (text, start, end) {\n        if (!currentParent) {\n          {\n            if (text === template) {\n              warnOnce(\n                'Component template requires a root element, rather than just text.',\n                { start: start }\n              );\n            } else if ((text = text.trim())) {\n              warnOnce(\n                (\"text \\\"\" + text + \"\\\" outside root element will be ignored.\"),\n                { start: start }\n              );\n            }\n          }\n          return\n        }\n        // IE textarea placeholder bug\n        /* istanbul ignore if */\n        if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text\n        ) {\n          return\n        }\n        var children = currentParent.children;\n        if (inPre || text.trim()) {\n          text = isTextTag(currentParent) ? text : decodeHTMLCached(text);\n        } else if (!children.length) {\n          // remove the whitespace-only node right after an opening tag\n          text = '';\n        } else if (whitespaceOption) {\n          if (whitespaceOption === 'condense') {\n            // in condense mode, remove the whitespace node if it contains\n            // line break, otherwise condense to a single space\n            text = lineBreakRE.test(text) ? '' : ' ';\n          } else {\n            text = ' ';\n          }\n        } else {\n          text = preserveWhitespace ? ' ' : '';\n        }\n        if (text) {\n          if (whitespaceOption === 'condense') {\n            // condense consecutive whitespaces into single space\n            text = text.replace(whitespaceRE$1, ' ');\n          }\n          var res;\n          var child;\n          if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {\n            child = {\n              type: 2,\n              expression: res.expression,\n              tokens: res.tokens,\n              text: text\n            };\n          } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {\n            child = {\n              type: 3,\n              text: text\n            };\n          }\n          if (child) {\n            if (options.outputSourceRange) {\n              child.start = start;\n              child.end = end;\n            }\n            children.push(child);\n          }\n        }\n      },\n      comment: function comment (text, start, end) {\n        // adding anyting as a sibling to the root node is forbidden\n        // comments should still be allowed, but ignored\n        if (currentParent) {\n          var child = {\n            type: 3,\n            text: text,\n            isComment: true\n          };\n          if (options.outputSourceRange) {\n            child.start = start;\n            child.end = end;\n          }\n          currentParent.children.push(child);\n        }\n      }\n    });\n    return root\n  }\n\n  function processPre (el) {\n    if (getAndRemoveAttr(el, 'v-pre') != null) {\n      el.pre = true;\n    }\n  }\n\n  function processRawAttrs (el) {\n    var list = el.attrsList;\n    var len = list.length;\n    if (len) {\n      var attrs = el.attrs = new Array(len);\n      for (var i = 0; i < len; i++) {\n        attrs[i] = {\n          name: list[i].name,\n          value: JSON.stringify(list[i].value)\n        };\n        if (list[i].start != null) {\n          attrs[i].start = list[i].start;\n          attrs[i].end = list[i].end;\n        }\n      }\n    } else if (!el.pre) {\n      // non root node in pre blocks with no attributes\n      el.plain = true;\n    }\n  }\n\n  function processElement (\n    element,\n    options\n  ) {\n    processKey(element);\n\n    // determine whether this is a plain element after\n    // removing structural attributes\n    element.plain = (\n      !element.key &&\n      !element.scopedSlots &&\n      !element.attrsList.length\n    );\n\n    processRef(element);\n    processSlotContent(element);\n    processSlotOutlet(element);\n    processComponent(element);\n    for (var i = 0; i < transforms.length; i++) {\n      element = transforms[i](element, options) || element;\n    }\n    processAttrs(element);\n    return element\n  }\n\n  function processKey (el) {\n    var exp = getBindingAttr(el, 'key');\n    if (exp) {\n      {\n        if (el.tag === 'template') {\n          warn$2(\n            \"<template> cannot be keyed. Place the key on real elements instead.\",\n            getRawBindingAttr(el, 'key')\n          );\n        }\n        if (el.for) {\n          var iterator = el.iterator2 || el.iterator1;\n          var parent = el.parent;\n          if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {\n            warn$2(\n              \"Do not use v-for index as key on <transition-group> children, \" +\n              \"this is the same as not using keys.\",\n              getRawBindingAttr(el, 'key'),\n              true /* tip */\n            );\n          }\n        }\n      }\n      el.key = exp;\n    }\n  }\n\n  function processRef (el) {\n    var ref = getBindingAttr(el, 'ref');\n    if (ref) {\n      el.ref = ref;\n      el.refInFor = checkInFor(el);\n    }\n  }\n\n  function processFor (el) {\n    var exp;\n    if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n      var res = parseFor(exp);\n      if (res) {\n        extend(el, res);\n      } else {\n        warn$2(\n          (\"Invalid v-for expression: \" + exp),\n          el.rawAttrsMap['v-for']\n        );\n      }\n    }\n  }\n\n\n\n  function parseFor (exp) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) { return }\n    var res = {};\n    res.for = inMatch[2].trim();\n    var alias = inMatch[1].trim().replace(stripParensRE, '');\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      res.alias = alias.replace(forIteratorRE, '').trim();\n      res.iterator1 = iteratorMatch[1].trim();\n      if (iteratorMatch[2]) {\n        res.iterator2 = iteratorMatch[2].trim();\n      }\n    } else {\n      res.alias = alias;\n    }\n    return res\n  }\n\n  function processIf (el) {\n    var exp = getAndRemoveAttr(el, 'v-if');\n    if (exp) {\n      el.if = exp;\n      addIfCondition(el, {\n        exp: exp,\n        block: el\n      });\n    } else {\n      if (getAndRemoveAttr(el, 'v-else') != null) {\n        el.else = true;\n      }\n      var elseif = getAndRemoveAttr(el, 'v-else-if');\n      if (elseif) {\n        el.elseif = elseif;\n      }\n    }\n  }\n\n  function processIfConditions (el, parent) {\n    var prev = findPrevElement(parent.children);\n    if (prev && prev.if) {\n      addIfCondition(prev, {\n        exp: el.elseif,\n        block: el\n      });\n    } else {\n      warn$2(\n        \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n        \"used on element <\" + (el.tag) + \"> without corresponding v-if.\",\n        el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']\n      );\n    }\n  }\n\n  function findPrevElement (children) {\n    var i = children.length;\n    while (i--) {\n      if (children[i].type === 1) {\n        return children[i]\n      } else {\n        if (children[i].text !== ' ') {\n          warn$2(\n            \"text \\\"\" + (children[i].text.trim()) + \"\\\" between v-if and v-else(-if) \" +\n            \"will be ignored.\",\n            children[i]\n          );\n        }\n        children.pop();\n      }\n    }\n  }\n\n  function addIfCondition (el, condition) {\n    if (!el.ifConditions) {\n      el.ifConditions = [];\n    }\n    el.ifConditions.push(condition);\n  }\n\n  function processOnce (el) {\n    var once$$1 = getAndRemoveAttr(el, 'v-once');\n    if (once$$1 != null) {\n      el.once = true;\n    }\n  }\n\n  // handle content being passed to a component as slot,\n  // e.g. <template slot=\"xxx\">, <div slot-scope=\"xxx\">\n  function processSlotContent (el) {\n    var slotScope;\n    if (el.tag === 'template') {\n      slotScope = getAndRemoveAttr(el, 'scope');\n      /* istanbul ignore if */\n      if (slotScope) {\n        warn$2(\n          \"the \\\"scope\\\" attribute for scoped slots have been deprecated and \" +\n          \"replaced by \\\"slot-scope\\\" since 2.5. The new \\\"slot-scope\\\" attribute \" +\n          \"can also be used on plain elements in addition to <template> to \" +\n          \"denote scoped slots.\",\n          el.rawAttrsMap['scope'],\n          true\n        );\n      }\n      el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');\n    } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {\n      /* istanbul ignore if */\n      if (el.attrsMap['v-for']) {\n        warn$2(\n          \"Ambiguous combined usage of slot-scope and v-for on <\" + (el.tag) + \"> \" +\n          \"(v-for takes higher priority). Use a wrapper <template> for the \" +\n          \"scoped slot to make it clearer.\",\n          el.rawAttrsMap['slot-scope'],\n          true\n        );\n      }\n      el.slotScope = slotScope;\n    }\n\n    // slot=\"xxx\"\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n      el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);\n      // preserve slot as an attribute for native shadow DOM compat\n      // only for non-scoped slots.\n      if (el.tag !== 'template' && !el.slotScope) {\n        addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));\n      }\n    }\n\n    // 2.6 v-slot syntax\n    {\n      if (el.tag === 'template') {\n        // v-slot on <template>\n        var slotBinding = getAndRemoveAttrByRegex(el, slotRE);\n        if (slotBinding) {\n          {\n            if (el.slotTarget || el.slotScope) {\n              warn$2(\n                \"Unexpected mixed usage of different slot syntaxes.\",\n                el\n              );\n            }\n            if (el.parent && !maybeComponent(el.parent)) {\n              warn$2(\n                \"<template v-slot> can only appear at the root level inside \" +\n                \"the receiving the component\",\n                el\n              );\n            }\n          }\n          var ref = getSlotName(slotBinding);\n          var name = ref.name;\n          var dynamic = ref.dynamic;\n          el.slotTarget = name;\n          el.slotTargetDynamic = dynamic;\n          el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf\n        }\n      } else {\n        // v-slot on component, denotes default slot\n        var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);\n        if (slotBinding$1) {\n          {\n            if (!maybeComponent(el)) {\n              warn$2(\n                \"v-slot can only be used on components or <template>.\",\n                slotBinding$1\n              );\n            }\n            if (el.slotScope || el.slotTarget) {\n              warn$2(\n                \"Unexpected mixed usage of different slot syntaxes.\",\n                el\n              );\n            }\n            if (el.scopedSlots) {\n              warn$2(\n                \"To avoid scope ambiguity, the default slot should also use \" +\n                \"<template> syntax when there are other named slots.\",\n                slotBinding$1\n              );\n            }\n          }\n          // add the component's children to its default slot\n          var slots = el.scopedSlots || (el.scopedSlots = {});\n          var ref$1 = getSlotName(slotBinding$1);\n          var name$1 = ref$1.name;\n          var dynamic$1 = ref$1.dynamic;\n          var slotContainer = slots[name$1] = createASTElement('template', [], el);\n          slotContainer.slotTarget = name$1;\n          slotContainer.slotTargetDynamic = dynamic$1;\n          slotContainer.children = el.children.filter(function (c) {\n            if (!c.slotScope) {\n              c.parent = slotContainer;\n              return true\n            }\n          });\n          slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;\n          // remove children as they are returned from scopedSlots now\n          el.children = [];\n          // mark el non-plain so data gets generated\n          el.plain = false;\n        }\n      }\n    }\n  }\n\n  function getSlotName (binding) {\n    var name = binding.name.replace(slotRE, '');\n    if (!name) {\n      if (binding.name[0] !== '#') {\n        name = 'default';\n      } else {\n        warn$2(\n          \"v-slot shorthand syntax requires a slot name.\",\n          binding\n        );\n      }\n    }\n    return dynamicArgRE.test(name)\n      // dynamic [name]\n      ? { name: name.slice(1, -1), dynamic: true }\n      // static name\n      : { name: (\"\\\"\" + name + \"\\\"\"), dynamic: false }\n  }\n\n  // handle <slot/> outlets\n  function processSlotOutlet (el) {\n    if (el.tag === 'slot') {\n      el.slotName = getBindingAttr(el, 'name');\n      if (el.key) {\n        warn$2(\n          \"`key` does not work on <slot> because slots are abstract outlets \" +\n          \"and can possibly expand into multiple elements. \" +\n          \"Use the key on a wrapping element instead.\",\n          getRawBindingAttr(el, 'key')\n        );\n      }\n    }\n  }\n\n  function processComponent (el) {\n    var binding;\n    if ((binding = getBindingAttr(el, 'is'))) {\n      el.component = binding;\n    }\n    if (getAndRemoveAttr(el, 'inline-template') != null) {\n      el.inlineTemplate = true;\n    }\n  }\n\n  function processAttrs (el) {\n    var list = el.attrsList;\n    var i, l, name, rawName, value, modifiers, syncGen, isDynamic;\n    for (i = 0, l = list.length; i < l; i++) {\n      name = rawName = list[i].name;\n      value = list[i].value;\n      if (dirRE.test(name)) {\n        // mark element as dynamic\n        el.hasBindings = true;\n        // modifiers\n        modifiers = parseModifiers(name.replace(dirRE, ''));\n        // support .foo shorthand syntax for the .prop modifier\n        if (modifiers) {\n          name = name.replace(modifierRE, '');\n        }\n        if (bindRE.test(name)) { // v-bind\n          name = name.replace(bindRE, '');\n          value = parseFilters(value);\n          isDynamic = dynamicArgRE.test(name);\n          if (isDynamic) {\n            name = name.slice(1, -1);\n          }\n          if (\n            value.trim().length === 0\n          ) {\n            warn$2(\n              (\"The value for a v-bind expression cannot be empty. Found in \\\"v-bind:\" + name + \"\\\"\")\n            );\n          }\n          if (modifiers) {\n            if (modifiers.prop && !isDynamic) {\n              name = camelize(name);\n              if (name === 'innerHtml') { name = 'innerHTML'; }\n            }\n            if (modifiers.camel && !isDynamic) {\n              name = camelize(name);\n            }\n            if (modifiers.sync) {\n              syncGen = genAssignmentCode(value, \"$event\");\n              if (!isDynamic) {\n                addHandler(\n                  el,\n                  (\"update:\" + (camelize(name))),\n                  syncGen,\n                  null,\n                  false,\n                  warn$2,\n                  list[i]\n                );\n                if (hyphenate(name) !== camelize(name)) {\n                  addHandler(\n                    el,\n                    (\"update:\" + (hyphenate(name))),\n                    syncGen,\n                    null,\n                    false,\n                    warn$2,\n                    list[i]\n                  );\n                }\n              } else {\n                // handler w/ dynamic event name\n                addHandler(\n                  el,\n                  (\"\\\"update:\\\"+(\" + name + \")\"),\n                  syncGen,\n                  null,\n                  false,\n                  warn$2,\n                  list[i],\n                  true // dynamic\n                );\n              }\n            }\n          }\n          if ((modifiers && modifiers.prop) || (\n            !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)\n          )) {\n            addProp(el, name, value, list[i], isDynamic);\n          } else {\n            addAttr(el, name, value, list[i], isDynamic);\n          }\n        } else if (onRE.test(name)) { // v-on\n          name = name.replace(onRE, '');\n          isDynamic = dynamicArgRE.test(name);\n          if (isDynamic) {\n            name = name.slice(1, -1);\n          }\n          addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);\n        } else { // normal directives\n          name = name.replace(dirRE, '');\n          // parse arg\n          var argMatch = name.match(argRE);\n          var arg = argMatch && argMatch[1];\n          isDynamic = false;\n          if (arg) {\n            name = name.slice(0, -(arg.length + 1));\n            if (dynamicArgRE.test(arg)) {\n              arg = arg.slice(1, -1);\n              isDynamic = true;\n            }\n          }\n          addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);\n          if (name === 'model') {\n            checkForAliasModel(el, value);\n          }\n        }\n      } else {\n        // literal attribute\n        {\n          var res = parseText(value, delimiters);\n          if (res) {\n            warn$2(\n              name + \"=\\\"\" + value + \"\\\": \" +\n              'Interpolation inside attributes has been removed. ' +\n              'Use v-bind or the colon shorthand instead. For example, ' +\n              'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.',\n              list[i]\n            );\n          }\n        }\n        addAttr(el, name, JSON.stringify(value), list[i]);\n        // #6887 firefox doesn't update muted state if set via attribute\n        // even immediately after element creation\n        if (!el.component &&\n            name === 'muted' &&\n            platformMustUseProp(el.tag, el.attrsMap.type, name)) {\n          addProp(el, name, 'true', list[i]);\n        }\n      }\n    }\n  }\n\n  function checkInFor (el) {\n    var parent = el;\n    while (parent) {\n      if (parent.for !== undefined) {\n        return true\n      }\n      parent = parent.parent;\n    }\n    return false\n  }\n\n  function parseModifiers (name) {\n    var match = name.match(modifierRE);\n    if (match) {\n      var ret = {};\n      match.forEach(function (m) { ret[m.slice(1)] = true; });\n      return ret\n    }\n  }\n\n  function makeAttrsMap (attrs) {\n    var map = {};\n    for (var i = 0, l = attrs.length; i < l; i++) {\n      if (\n        map[attrs[i].name] && !isIE && !isEdge\n      ) {\n        warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);\n      }\n      map[attrs[i].name] = attrs[i].value;\n    }\n    return map\n  }\n\n  // for script (e.g. type=\"x/template\") or style, do not decode content\n  function isTextTag (el) {\n    return el.tag === 'script' || el.tag === 'style'\n  }\n\n  function isForbiddenTag (el) {\n    return (\n      el.tag === 'style' ||\n      (el.tag === 'script' && (\n        !el.attrsMap.type ||\n        el.attrsMap.type === 'text/javascript'\n      ))\n    )\n  }\n\n  var ieNSBug = /^xmlns:NS\\d+/;\n  var ieNSPrefix = /^NS\\d+:/;\n\n  /* istanbul ignore next */\n  function guardIESVGBug (attrs) {\n    var res = [];\n    for (var i = 0; i < attrs.length; i++) {\n      var attr = attrs[i];\n      if (!ieNSBug.test(attr.name)) {\n        attr.name = attr.name.replace(ieNSPrefix, '');\n        res.push(attr);\n      }\n    }\n    return res\n  }\n\n  function checkForAliasModel (el, value) {\n    var _el = el;\n    while (_el) {\n      if (_el.for && _el.alias === value) {\n        warn$2(\n          \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n          \"You are binding v-model directly to a v-for iteration alias. \" +\n          \"This will not be able to modify the v-for source array because \" +\n          \"writing to the alias is like modifying a function local variable. \" +\n          \"Consider using an array of objects and use v-model on an object property instead.\",\n          el.rawAttrsMap['v-model']\n        );\n      }\n      _el = _el.parent;\n    }\n  }\n\n  /*  */\n\n  function preTransformNode (el, options) {\n    if (el.tag === 'input') {\n      var map = el.attrsMap;\n      if (!map['v-model']) {\n        return\n      }\n\n      var typeBinding;\n      if (map[':type'] || map['v-bind:type']) {\n        typeBinding = getBindingAttr(el, 'type');\n      }\n      if (!map.type && !typeBinding && map['v-bind']) {\n        typeBinding = \"(\" + (map['v-bind']) + \").type\";\n      }\n\n      if (typeBinding) {\n        var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n        var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n        var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n        var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n        // 1. checkbox\n        var branch0 = cloneASTElement(el);\n        // process for on the main node\n        processFor(branch0);\n        addRawAttr(branch0, 'type', 'checkbox');\n        processElement(branch0, options);\n        branch0.processed = true; // prevent it from double-processed\n        branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n        addIfCondition(branch0, {\n          exp: branch0.if,\n          block: branch0\n        });\n        // 2. add radio else-if condition\n        var branch1 = cloneASTElement(el);\n        getAndRemoveAttr(branch1, 'v-for', true);\n        addRawAttr(branch1, 'type', 'radio');\n        processElement(branch1, options);\n        addIfCondition(branch0, {\n          exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n          block: branch1\n        });\n        // 3. other\n        var branch2 = cloneASTElement(el);\n        getAndRemoveAttr(branch2, 'v-for', true);\n        addRawAttr(branch2, ':type', typeBinding);\n        processElement(branch2, options);\n        addIfCondition(branch0, {\n          exp: ifCondition,\n          block: branch2\n        });\n\n        if (hasElse) {\n          branch0.else = true;\n        } else if (elseIfCondition) {\n          branch0.elseif = elseIfCondition;\n        }\n\n        return branch0\n      }\n    }\n  }\n\n  function cloneASTElement (el) {\n    return createASTElement(el.tag, el.attrsList.slice(), el.parent)\n  }\n\n  var model$1 = {\n    preTransformNode: preTransformNode\n  };\n\n  var modules$1 = [\n    klass$1,\n    style$1,\n    model$1\n  ];\n\n  /*  */\n\n  function text (el, dir) {\n    if (dir.value) {\n      addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"), dir);\n    }\n  }\n\n  /*  */\n\n  function html (el, dir) {\n    if (dir.value) {\n      addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"), dir);\n    }\n  }\n\n  var directives$1 = {\n    model: model,\n    text: text,\n    html: html\n  };\n\n  /*  */\n\n  var baseOptions = {\n    expectHTML: true,\n    modules: modules$1,\n    directives: directives$1,\n    isPreTag: isPreTag,\n    isUnaryTag: isUnaryTag,\n    mustUseProp: mustUseProp,\n    canBeLeftOpenTag: canBeLeftOpenTag,\n    isReservedTag: isReservedTag,\n    getTagNamespace: getTagNamespace,\n    staticKeys: genStaticKeys(modules$1)\n  };\n\n  /*  */\n\n  var isStaticKey;\n  var isPlatformReservedTag;\n\n  var genStaticKeysCached = cached(genStaticKeys$1);\n\n  /**\n   * Goal of the optimizer: walk the generated template AST tree\n   * and detect sub-trees that are purely static, i.e. parts of\n   * the DOM that never needs to change.\n   *\n   * Once we detect these sub-trees, we can:\n   *\n   * 1. Hoist them into constants, so that we no longer need to\n   *    create fresh nodes for them on each re-render;\n   * 2. Completely skip them in the patching process.\n   */\n  function optimize (root, options) {\n    if (!root) { return }\n    isStaticKey = genStaticKeysCached(options.staticKeys || '');\n    isPlatformReservedTag = options.isReservedTag || no;\n    // first pass: mark all non-static nodes.\n    markStatic$1(root);\n    // second pass: mark static roots.\n    markStaticRoots(root, false);\n  }\n\n  function genStaticKeys$1 (keys) {\n    return makeMap(\n      'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +\n      (keys ? ',' + keys : '')\n    )\n  }\n\n  function markStatic$1 (node) {\n    node.static = isStatic(node);\n    if (node.type === 1) {\n      // do not make component slot content static. this avoids\n      // 1. components not able to mutate slot nodes\n      // 2. static slot content fails for hot-reloading\n      if (\n        !isPlatformReservedTag(node.tag) &&\n        node.tag !== 'slot' &&\n        node.attrsMap['inline-template'] == null\n      ) {\n        return\n      }\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        var child = node.children[i];\n        markStatic$1(child);\n        if (!child.static) {\n          node.static = false;\n        }\n      }\n      if (node.ifConditions) {\n        for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {\n          var block = node.ifConditions[i$1].block;\n          markStatic$1(block);\n          if (!block.static) {\n            node.static = false;\n          }\n        }\n      }\n    }\n  }\n\n  function markStaticRoots (node, isInFor) {\n    if (node.type === 1) {\n      if (node.static || node.once) {\n        node.staticInFor = isInFor;\n      }\n      // For a node to qualify as a static root, it should have children that\n      // are not just static text. Otherwise the cost of hoisting out will\n      // outweigh the benefits and it's better off to just always render it fresh.\n      if (node.static && node.children.length && !(\n        node.children.length === 1 &&\n        node.children[0].type === 3\n      )) {\n        node.staticRoot = true;\n        return\n      } else {\n        node.staticRoot = false;\n      }\n      if (node.children) {\n        for (var i = 0, l = node.children.length; i < l; i++) {\n          markStaticRoots(node.children[i], isInFor || !!node.for);\n        }\n      }\n      if (node.ifConditions) {\n        for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {\n          markStaticRoots(node.ifConditions[i$1].block, isInFor);\n        }\n      }\n    }\n  }\n\n  function isStatic (node) {\n    if (node.type === 2) { // expression\n      return false\n    }\n    if (node.type === 3) { // text\n      return true\n    }\n    return !!(node.pre || (\n      !node.hasBindings && // no dynamic bindings\n      !node.if && !node.for && // not v-if or v-for or v-else\n      !isBuiltInTag(node.tag) && // not a built-in\n      isPlatformReservedTag(node.tag) && // not a component\n      !isDirectChildOfTemplateFor(node) &&\n      Object.keys(node).every(isStaticKey)\n    ))\n  }\n\n  function isDirectChildOfTemplateFor (node) {\n    while (node.parent) {\n      node = node.parent;\n      if (node.tag !== 'template') {\n        return false\n      }\n      if (node.for) {\n        return true\n      }\n    }\n    return false\n  }\n\n  /*  */\n\n  var fnExpRE = /^([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\n  var fnInvokeRE = /\\([^)]*?\\);*$/;\n  var simplePathRE = /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?']|\\[\"[^\"]*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*$/;\n\n  // KeyboardEvent.keyCode aliases\n  var keyCodes = {\n    esc: 27,\n    tab: 9,\n    enter: 13,\n    space: 32,\n    up: 38,\n    left: 37,\n    right: 39,\n    down: 40,\n    'delete': [8, 46]\n  };\n\n  // KeyboardEvent.key aliases\n  var keyNames = {\n    // #7880: IE11 and Edge use `Esc` for Escape key name.\n    esc: ['Esc', 'Escape'],\n    tab: 'Tab',\n    enter: 'Enter',\n    // #9112: IE11 uses `Spacebar` for Space key name.\n    space: [' ', 'Spacebar'],\n    // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.\n    up: ['Up', 'ArrowUp'],\n    left: ['Left', 'ArrowLeft'],\n    right: ['Right', 'ArrowRight'],\n    down: ['Down', 'ArrowDown'],\n    // #9112: IE11 uses `Del` for Delete key name.\n    'delete': ['Backspace', 'Delete', 'Del']\n  };\n\n  // #4868: modifiers that prevent the execution of the listener\n  // need to explicitly return null so that we can determine whether to remove\n  // the listener for .once\n  var genGuard = function (condition) { return (\"if(\" + condition + \")return null;\"); };\n\n  var modifierCode = {\n    stop: '$event.stopPropagation();',\n    prevent: '$event.preventDefault();',\n    self: genGuard(\"$event.target !== $event.currentTarget\"),\n    ctrl: genGuard(\"!$event.ctrlKey\"),\n    shift: genGuard(\"!$event.shiftKey\"),\n    alt: genGuard(\"!$event.altKey\"),\n    meta: genGuard(\"!$event.metaKey\"),\n    left: genGuard(\"'button' in $event && $event.button !== 0\"),\n    middle: genGuard(\"'button' in $event && $event.button !== 1\"),\n    right: genGuard(\"'button' in $event && $event.button !== 2\")\n  };\n\n  function genHandlers (\n    events,\n    isNative\n  ) {\n    var prefix = isNative ? 'nativeOn:' : 'on:';\n    var staticHandlers = \"\";\n    var dynamicHandlers = \"\";\n    for (var name in events) {\n      var handlerCode = genHandler(events[name]);\n      if (events[name] && events[name].dynamic) {\n        dynamicHandlers += name + \",\" + handlerCode + \",\";\n      } else {\n        staticHandlers += \"\\\"\" + name + \"\\\":\" + handlerCode + \",\";\n      }\n    }\n    staticHandlers = \"{\" + (staticHandlers.slice(0, -1)) + \"}\";\n    if (dynamicHandlers) {\n      return prefix + \"_d(\" + staticHandlers + \",[\" + (dynamicHandlers.slice(0, -1)) + \"])\"\n    } else {\n      return prefix + staticHandlers\n    }\n  }\n\n  function genHandler (handler) {\n    if (!handler) {\n      return 'function(){}'\n    }\n\n    if (Array.isArray(handler)) {\n      return (\"[\" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + \"]\")\n    }\n\n    var isMethodPath = simplePathRE.test(handler.value);\n    var isFunctionExpression = fnExpRE.test(handler.value);\n    var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));\n\n    if (!handler.modifiers) {\n      if (isMethodPath || isFunctionExpression) {\n        return handler.value\n      }\n      return (\"function($event){\" + (isFunctionInvocation ? (\"return \" + (handler.value)) : handler.value) + \"}\") // inline statement\n    } else {\n      var code = '';\n      var genModifierCode = '';\n      var keys = [];\n      for (var key in handler.modifiers) {\n        if (modifierCode[key]) {\n          genModifierCode += modifierCode[key];\n          // left/right\n          if (keyCodes[key]) {\n            keys.push(key);\n          }\n        } else if (key === 'exact') {\n          var modifiers = (handler.modifiers);\n          genModifierCode += genGuard(\n            ['ctrl', 'shift', 'alt', 'meta']\n              .filter(function (keyModifier) { return !modifiers[keyModifier]; })\n              .map(function (keyModifier) { return (\"$event.\" + keyModifier + \"Key\"); })\n              .join('||')\n          );\n        } else {\n          keys.push(key);\n        }\n      }\n      if (keys.length) {\n        code += genKeyFilter(keys);\n      }\n      // Make sure modifiers like prevent and stop get executed after key filtering\n      if (genModifierCode) {\n        code += genModifierCode;\n      }\n      var handlerCode = isMethodPath\n        ? (\"return \" + (handler.value) + \"($event)\")\n        : isFunctionExpression\n          ? (\"return (\" + (handler.value) + \")($event)\")\n          : isFunctionInvocation\n            ? (\"return \" + (handler.value))\n            : handler.value;\n      return (\"function($event){\" + code + handlerCode + \"}\")\n    }\n  }\n\n  function genKeyFilter (keys) {\n    return (\n      // make sure the key filters only apply to KeyboardEvents\n      // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake\n      // key events that do not have keyCode property...\n      \"if(!$event.type.indexOf('key')&&\" +\n      (keys.map(genFilterCode).join('&&')) + \")return null;\"\n    )\n  }\n\n  function genFilterCode (key) {\n    var keyVal = parseInt(key, 10);\n    if (keyVal) {\n      return (\"$event.keyCode!==\" + keyVal)\n    }\n    var keyCode = keyCodes[key];\n    var keyName = keyNames[key];\n    return (\n      \"_k($event.keyCode,\" +\n      (JSON.stringify(key)) + \",\" +\n      (JSON.stringify(keyCode)) + \",\" +\n      \"$event.key,\" +\n      \"\" + (JSON.stringify(keyName)) +\n      \")\"\n    )\n  }\n\n  /*  */\n\n  function on (el, dir) {\n    if (dir.modifiers) {\n      warn(\"v-on without argument does not support modifiers.\");\n    }\n    el.wrapListeners = function (code) { return (\"_g(\" + code + \",\" + (dir.value) + \")\"); };\n  }\n\n  /*  */\n\n  function bind$1 (el, dir) {\n    el.wrapData = function (code) {\n      return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + \",\" + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + \")\")\n    };\n  }\n\n  /*  */\n\n  var baseDirectives = {\n    on: on,\n    bind: bind$1,\n    cloak: noop\n  };\n\n  /*  */\n\n\n\n\n\n  var CodegenState = function CodegenState (options) {\n    this.options = options;\n    this.warn = options.warn || baseWarn;\n    this.transforms = pluckModuleFunction(options.modules, 'transformCode');\n    this.dataGenFns = pluckModuleFunction(options.modules, 'genData');\n    this.directives = extend(extend({}, baseDirectives), options.directives);\n    var isReservedTag = options.isReservedTag || no;\n    this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };\n    this.onceId = 0;\n    this.staticRenderFns = [];\n    this.pre = false;\n  };\n\n\n\n  function generate (\n    ast,\n    options\n  ) {\n    var state = new CodegenState(options);\n    var code = ast ? genElement(ast, state) : '_c(\"div\")';\n    return {\n      render: (\"with(this){return \" + code + \"}\"),\n      staticRenderFns: state.staticRenderFns\n    }\n  }\n\n  function genElement (el, state) {\n    if (el.parent) {\n      el.pre = el.pre || el.parent.pre;\n    }\n\n    if (el.staticRoot && !el.staticProcessed) {\n      return genStatic(el, state)\n    } else if (el.once && !el.onceProcessed) {\n      return genOnce(el, state)\n    } else if (el.for && !el.forProcessed) {\n      return genFor(el, state)\n    } else if (el.if && !el.ifProcessed) {\n      return genIf(el, state)\n    } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {\n      return genChildren(el, state) || 'void 0'\n    } else if (el.tag === 'slot') {\n      return genSlot(el, state)\n    } else {\n      // component or element\n      var code;\n      if (el.component) {\n        code = genComponent(el.component, el, state);\n      } else {\n        var data;\n        if (!el.plain || (el.pre && state.maybeComponent(el))) {\n          data = genData$2(el, state);\n        }\n\n        var children = el.inlineTemplate ? null : genChildren(el, state, true);\n        code = \"_c('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n      }\n      // module transforms\n      for (var i = 0; i < state.transforms.length; i++) {\n        code = state.transforms[i](el, code);\n      }\n      return code\n    }\n  }\n\n  // hoist static sub-trees out\n  function genStatic (el, state) {\n    el.staticProcessed = true;\n    // Some elements (templates) need to behave differently inside of a v-pre\n    // node.  All pre nodes are static roots, so we can use this as a location to\n    // wrap a state change and reset it upon exiting the pre node.\n    var originalPreState = state.pre;\n    if (el.pre) {\n      state.pre = el.pre;\n    }\n    state.staticRenderFns.push((\"with(this){return \" + (genElement(el, state)) + \"}\"));\n    state.pre = originalPreState;\n    return (\"_m(\" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n  }\n\n  // v-once\n  function genOnce (el, state) {\n    el.onceProcessed = true;\n    if (el.if && !el.ifProcessed) {\n      return genIf(el, state)\n    } else if (el.staticInFor) {\n      var key = '';\n      var parent = el.parent;\n      while (parent) {\n        if (parent.for) {\n          key = parent.key;\n          break\n        }\n        parent = parent.parent;\n      }\n      if (!key) {\n        state.warn(\n          \"v-once can only be used inside v-for that is keyed. \",\n          el.rawAttrsMap['v-once']\n        );\n        return genElement(el, state)\n      }\n      return (\"_o(\" + (genElement(el, state)) + \",\" + (state.onceId++) + \",\" + key + \")\")\n    } else {\n      return genStatic(el, state)\n    }\n  }\n\n  function genIf (\n    el,\n    state,\n    altGen,\n    altEmpty\n  ) {\n    el.ifProcessed = true; // avoid recursion\n    return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)\n  }\n\n  function genIfConditions (\n    conditions,\n    state,\n    altGen,\n    altEmpty\n  ) {\n    if (!conditions.length) {\n      return altEmpty || '_e()'\n    }\n\n    var condition = conditions.shift();\n    if (condition.exp) {\n      return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions, state, altGen, altEmpty)))\n    } else {\n      return (\"\" + (genTernaryExp(condition.block)))\n    }\n\n    // v-if with v-once should generate code like (a)?_m(0):_m(1)\n    function genTernaryExp (el) {\n      return altGen\n        ? altGen(el, state)\n        : el.once\n          ? genOnce(el, state)\n          : genElement(el, state)\n    }\n  }\n\n  function genFor (\n    el,\n    state,\n    altGen,\n    altHelper\n  ) {\n    var exp = el.for;\n    var alias = el.alias;\n    var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n    var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n\n    if (state.maybeComponent(el) &&\n      el.tag !== 'slot' &&\n      el.tag !== 'template' &&\n      !el.key\n    ) {\n      state.warn(\n        \"<\" + (el.tag) + \" v-for=\\\"\" + alias + \" in \" + exp + \"\\\">: component lists rendered with \" +\n        \"v-for should have explicit keys. \" +\n        \"See https://vuejs.org/guide/list.html#key for more info.\",\n        el.rawAttrsMap['v-for'],\n        true /* tip */\n      );\n    }\n\n    el.forProcessed = true; // avoid recursion\n    return (altHelper || '_l') + \"((\" + exp + \"),\" +\n      \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n        \"return \" + ((altGen || genElement)(el, state)) +\n      '})'\n  }\n\n  function genData$2 (el, state) {\n    var data = '{';\n\n    // directives first.\n    // directives may mutate the el's other properties before they are generated.\n    var dirs = genDirectives(el, state);\n    if (dirs) { data += dirs + ','; }\n\n    // key\n    if (el.key) {\n      data += \"key:\" + (el.key) + \",\";\n    }\n    // ref\n    if (el.ref) {\n      data += \"ref:\" + (el.ref) + \",\";\n    }\n    if (el.refInFor) {\n      data += \"refInFor:true,\";\n    }\n    // pre\n    if (el.pre) {\n      data += \"pre:true,\";\n    }\n    // record original tag name for components using \"is\" attribute\n    if (el.component) {\n      data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n    }\n    // module data generation functions\n    for (var i = 0; i < state.dataGenFns.length; i++) {\n      data += state.dataGenFns[i](el);\n    }\n    // attributes\n    if (el.attrs) {\n      data += \"attrs:\" + (genProps(el.attrs)) + \",\";\n    }\n    // DOM props\n    if (el.props) {\n      data += \"domProps:\" + (genProps(el.props)) + \",\";\n    }\n    // event handlers\n    if (el.events) {\n      data += (genHandlers(el.events, false)) + \",\";\n    }\n    if (el.nativeEvents) {\n      data += (genHandlers(el.nativeEvents, true)) + \",\";\n    }\n    // slot target\n    // only for non-scoped slots\n    if (el.slotTarget && !el.slotScope) {\n      data += \"slot:\" + (el.slotTarget) + \",\";\n    }\n    // scoped slots\n    if (el.scopedSlots) {\n      data += (genScopedSlots(el, el.scopedSlots, state)) + \",\";\n    }\n    // component v-model\n    if (el.model) {\n      data += \"model:{value:\" + (el.model.value) + \",callback:\" + (el.model.callback) + \",expression:\" + (el.model.expression) + \"},\";\n    }\n    // inline-template\n    if (el.inlineTemplate) {\n      var inlineTemplate = genInlineTemplate(el, state);\n      if (inlineTemplate) {\n        data += inlineTemplate + \",\";\n      }\n    }\n    data = data.replace(/,$/, '') + '}';\n    // v-bind dynamic argument wrap\n    // v-bind with dynamic arguments must be applied using the same v-bind object\n    // merge helper so that class/style/mustUseProp attrs are handled correctly.\n    if (el.dynamicAttrs) {\n      data = \"_b(\" + data + \",\\\"\" + (el.tag) + \"\\\",\" + (genProps(el.dynamicAttrs)) + \")\";\n    }\n    // v-bind data wrap\n    if (el.wrapData) {\n      data = el.wrapData(data);\n    }\n    // v-on data wrap\n    if (el.wrapListeners) {\n      data = el.wrapListeners(data);\n    }\n    return data\n  }\n\n  function genDirectives (el, state) {\n    var dirs = el.directives;\n    if (!dirs) { return }\n    var res = 'directives:[';\n    var hasRuntime = false;\n    var i, l, dir, needRuntime;\n    for (i = 0, l = dirs.length; i < l; i++) {\n      dir = dirs[i];\n      needRuntime = true;\n      var gen = state.directives[dir.name];\n      if (gen) {\n        // compile-time directive that manipulates AST.\n        // returns true if it also needs a runtime counterpart.\n        needRuntime = !!gen(el, dir, state.warn);\n      }\n      if (needRuntime) {\n        hasRuntime = true;\n        res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\" + (dir.isDynamicArg ? dir.arg : (\"\\\"\" + (dir.arg) + \"\\\"\"))) : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n      }\n    }\n    if (hasRuntime) {\n      return res.slice(0, -1) + ']'\n    }\n  }\n\n  function genInlineTemplate (el, state) {\n    var ast = el.children[0];\n    if (el.children.length !== 1 || ast.type !== 1) {\n      state.warn(\n        'Inline-template components must have exactly one child element.',\n        { start: el.start }\n      );\n    }\n    if (ast && ast.type === 1) {\n      var inlineRenderFns = generate(ast, state.options);\n      return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n    }\n  }\n\n  function genScopedSlots (\n    el,\n    slots,\n    state\n  ) {\n    // by default scoped slots are considered \"stable\", this allows child\n    // components with only scoped slots to skip forced updates from parent.\n    // but in some cases we have to bail-out of this optimization\n    // for example if the slot contains dynamic names, has v-if or v-for on them...\n    var needsForceUpdate = Object.keys(slots).some(function (key) {\n      var slot = slots[key];\n      return (\n        slot.slotTargetDynamic ||\n        slot.if ||\n        slot.for ||\n        containsSlotChild(slot) // is passing down slot from parent which may be dynamic\n      )\n    });\n\n    // #9534: if a component with scoped slots is inside a conditional branch,\n    // it's possible for the same component to be reused but with different\n    // compiled slot content. To avoid that, we generate a unique key based on\n    // the generated code of all the slot contents.\n    var needsKey = !!el.if;\n\n    // OR when it is inside another scoped slot or v-for (the reactivity may be\n    // disconnected due to the intermediate scope variable)\n    // #9438, #9506\n    // TODO: this can be further optimized by properly analyzing in-scope bindings\n    // and skip force updating ones that do not actually use scope variables.\n    if (!needsForceUpdate) {\n      var parent = el.parent;\n      while (parent) {\n        if (\n          (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||\n          parent.for\n        ) {\n          needsForceUpdate = true;\n          break\n        }\n        if (parent.if) {\n          needsKey = true;\n        }\n        parent = parent.parent;\n      }\n    }\n\n    var generatedSlots = Object.keys(slots)\n      .map(function (key) { return genScopedSlot(slots[key], state); })\n      .join(',');\n\n    return (\"scopedSlots:_u([\" + generatedSlots + \"]\" + (needsForceUpdate ? \",null,true\" : \"\") + (!needsForceUpdate && needsKey ? (\",null,false,\" + (hash(generatedSlots))) : \"\") + \")\")\n  }\n\n  function hash(str) {\n    var hash = 5381;\n    var i = str.length;\n    while(i) {\n      hash = (hash * 33) ^ str.charCodeAt(--i);\n    }\n    return hash >>> 0\n  }\n\n  function containsSlotChild (el) {\n    if (el.type === 1) {\n      if (el.tag === 'slot') {\n        return true\n      }\n      return el.children.some(containsSlotChild)\n    }\n    return false\n  }\n\n  function genScopedSlot (\n    el,\n    state\n  ) {\n    var isLegacySyntax = el.attrsMap['slot-scope'];\n    if (el.if && !el.ifProcessed && !isLegacySyntax) {\n      return genIf(el, state, genScopedSlot, \"null\")\n    }\n    if (el.for && !el.forProcessed) {\n      return genFor(el, state, genScopedSlot)\n    }\n    var slotScope = el.slotScope === emptySlotScopeToken\n      ? \"\"\n      : String(el.slotScope);\n    var fn = \"function(\" + slotScope + \"){\" +\n      \"return \" + (el.tag === 'template'\n        ? el.if && isLegacySyntax\n          ? (\"(\" + (el.if) + \")?\" + (genChildren(el, state) || 'undefined') + \":undefined\")\n          : genChildren(el, state) || 'undefined'\n        : genElement(el, state)) + \"}\";\n    // reverse proxy v-slot without scope on this.$slots\n    var reverseProxy = slotScope ? \"\" : \",proxy:true\";\n    return (\"{key:\" + (el.slotTarget || \"\\\"default\\\"\") + \",fn:\" + fn + reverseProxy + \"}\")\n  }\n\n  function genChildren (\n    el,\n    state,\n    checkSkip,\n    altGenElement,\n    altGenNode\n  ) {\n    var children = el.children;\n    if (children.length) {\n      var el$1 = children[0];\n      // optimize single v-for\n      if (children.length === 1 &&\n        el$1.for &&\n        el$1.tag !== 'template' &&\n        el$1.tag !== 'slot'\n      ) {\n        var normalizationType = checkSkip\n          ? state.maybeComponent(el$1) ? \",1\" : \",0\"\n          : \"\";\n        return (\"\" + ((altGenElement || genElement)(el$1, state)) + normalizationType)\n      }\n      var normalizationType$1 = checkSkip\n        ? getNormalizationType(children, state.maybeComponent)\n        : 0;\n      var gen = altGenNode || genNode;\n      return (\"[\" + (children.map(function (c) { return gen(c, state); }).join(',')) + \"]\" + (normalizationType$1 ? (\",\" + normalizationType$1) : ''))\n    }\n  }\n\n  // determine the normalization needed for the children array.\n  // 0: no normalization needed\n  // 1: simple normalization needed (possible 1-level deep nested array)\n  // 2: full normalization needed\n  function getNormalizationType (\n    children,\n    maybeComponent\n  ) {\n    var res = 0;\n    for (var i = 0; i < children.length; i++) {\n      var el = children[i];\n      if (el.type !== 1) {\n        continue\n      }\n      if (needsNormalization(el) ||\n          (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {\n        res = 2;\n        break\n      }\n      if (maybeComponent(el) ||\n          (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {\n        res = 1;\n      }\n    }\n    return res\n  }\n\n  function needsNormalization (el) {\n    return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'\n  }\n\n  function genNode (node, state) {\n    if (node.type === 1) {\n      return genElement(node, state)\n    } else if (node.type === 3 && node.isComment) {\n      return genComment(node)\n    } else {\n      return genText(node)\n    }\n  }\n\n  function genText (text) {\n    return (\"_v(\" + (text.type === 2\n      ? text.expression // no need for () because already wrapped in _s()\n      : transformSpecialNewlines(JSON.stringify(text.text))) + \")\")\n  }\n\n  function genComment (comment) {\n    return (\"_e(\" + (JSON.stringify(comment.text)) + \")\")\n  }\n\n  function genSlot (el, state) {\n    var slotName = el.slotName || '\"default\"';\n    var children = genChildren(el, state);\n    var res = \"_t(\" + slotName + (children ? (\",\" + children) : '');\n    var attrs = el.attrs || el.dynamicAttrs\n      ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({\n          // slot props are camelized\n          name: camelize(attr.name),\n          value: attr.value,\n          dynamic: attr.dynamic\n        }); }))\n      : null;\n    var bind$$1 = el.attrsMap['v-bind'];\n    if ((attrs || bind$$1) && !children) {\n      res += \",null\";\n    }\n    if (attrs) {\n      res += \",\" + attrs;\n    }\n    if (bind$$1) {\n      res += (attrs ? '' : ',null') + \",\" + bind$$1;\n    }\n    return res + ')'\n  }\n\n  // componentName is el.component, take it as argument to shun flow's pessimistic refinement\n  function genComponent (\n    componentName,\n    el,\n    state\n  ) {\n    var children = el.inlineTemplate ? null : genChildren(el, state, true);\n    return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n  }\n\n  function genProps (props) {\n    var staticProps = \"\";\n    var dynamicProps = \"\";\n    for (var i = 0; i < props.length; i++) {\n      var prop = props[i];\n      var value = transformSpecialNewlines(prop.value);\n      if (prop.dynamic) {\n        dynamicProps += (prop.name) + \",\" + value + \",\";\n      } else {\n        staticProps += \"\\\"\" + (prop.name) + \"\\\":\" + value + \",\";\n      }\n    }\n    staticProps = \"{\" + (staticProps.slice(0, -1)) + \"}\";\n    if (dynamicProps) {\n      return (\"_d(\" + staticProps + \",[\" + (dynamicProps.slice(0, -1)) + \"])\")\n    } else {\n      return staticProps\n    }\n  }\n\n  // #3895, #4268\n  function transformSpecialNewlines (text) {\n    return text\n      .replace(/\\u2028/g, '\\\\u2028')\n      .replace(/\\u2029/g, '\\\\u2029')\n  }\n\n  /*  */\n\n\n\n  // these keywords should not appear inside expressions, but operators like\n  // typeof, instanceof and in are allowed\n  var prohibitedKeywordRE = new RegExp('\\\\b' + (\n    'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n    'super,throw,while,yield,delete,export,import,return,switch,default,' +\n    'extends,finally,continue,debugger,function,arguments'\n  ).split(',').join('\\\\b|\\\\b') + '\\\\b');\n\n  // these unary operators should not be used as property/method names\n  var unaryOperatorsRE = new RegExp('\\\\b' + (\n    'delete,typeof,void'\n  ).split(',').join('\\\\s*\\\\([^\\\\)]*\\\\)|\\\\b') + '\\\\s*\\\\([^\\\\)]*\\\\)');\n\n  // strip strings in expressions\n  var stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n  // detect problematic expressions in a template\n  function detectErrors (ast, warn) {\n    if (ast) {\n      checkNode(ast, warn);\n    }\n  }\n\n  function checkNode (node, warn) {\n    if (node.type === 1) {\n      for (var name in node.attrsMap) {\n        if (dirRE.test(name)) {\n          var value = node.attrsMap[name];\n          if (value) {\n            var range = node.rawAttrsMap[name];\n            if (name === 'v-for') {\n              checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), warn, range);\n            } else if (onRE.test(name)) {\n              checkEvent(value, (name + \"=\\\"\" + value + \"\\\"\"), warn, range);\n            } else {\n              checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), warn, range);\n            }\n          }\n        }\n      }\n      if (node.children) {\n        for (var i = 0; i < node.children.length; i++) {\n          checkNode(node.children[i], warn);\n        }\n      }\n    } else if (node.type === 2) {\n      checkExpression(node.expression, node.text, warn, node);\n    }\n  }\n\n  function checkEvent (exp, text, warn, range) {\n    var stipped = exp.replace(stripStringRE, '');\n    var keywordMatch = stipped.match(unaryOperatorsRE);\n    if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {\n      warn(\n        \"avoid using JavaScript unary operator as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + (text.trim()),\n        range\n      );\n    }\n    checkExpression(exp, text, warn, range);\n  }\n\n  function checkFor (node, text, warn, range) {\n    checkExpression(node.for || '', text, warn, range);\n    checkIdentifier(node.alias, 'v-for alias', text, warn, range);\n    checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);\n    checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);\n  }\n\n  function checkIdentifier (\n    ident,\n    type,\n    text,\n    warn,\n    range\n  ) {\n    if (typeof ident === 'string') {\n      try {\n        new Function((\"var \" + ident + \"=_\"));\n      } catch (e) {\n        warn((\"invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + (text.trim())), range);\n      }\n    }\n  }\n\n  function checkExpression (exp, text, warn, range) {\n    try {\n      new Function((\"return \" + exp));\n    } catch (e) {\n      var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n      if (keywordMatch) {\n        warn(\n          \"avoid using JavaScript keyword as property name: \" +\n          \"\\\"\" + (keywordMatch[0]) + \"\\\"\\n  Raw expression: \" + (text.trim()),\n          range\n        );\n      } else {\n        warn(\n          \"invalid expression: \" + (e.message) + \" in\\n\\n\" +\n          \"    \" + exp + \"\\n\\n\" +\n          \"  Raw expression: \" + (text.trim()) + \"\\n\",\n          range\n        );\n      }\n    }\n  }\n\n  /*  */\n\n  var range = 2;\n\n  function generateCodeFrame (\n    source,\n    start,\n    end\n  ) {\n    if ( start === void 0 ) start = 0;\n    if ( end === void 0 ) end = source.length;\n\n    var lines = source.split(/\\r?\\n/);\n    var count = 0;\n    var res = [];\n    for (var i = 0; i < lines.length; i++) {\n      count += lines[i].length + 1;\n      if (count >= start) {\n        for (var j = i - range; j <= i + range || end > count; j++) {\n          if (j < 0 || j >= lines.length) { continue }\n          res.push((\"\" + (j + 1) + (repeat$1(\" \", 3 - String(j + 1).length)) + \"|  \" + (lines[j])));\n          var lineLength = lines[j].length;\n          if (j === i) {\n            // push underline\n            var pad = start - (count - lineLength) + 1;\n            var length = end > count ? lineLength - pad : end - start;\n            res.push(\"   |  \" + repeat$1(\" \", pad) + repeat$1(\"^\", length));\n          } else if (j > i) {\n            if (end > count) {\n              var length$1 = Math.min(end - count, lineLength);\n              res.push(\"   |  \" + repeat$1(\"^\", length$1));\n            }\n            count += lineLength + 1;\n          }\n        }\n        break\n      }\n    }\n    return res.join('\\n')\n  }\n\n  function repeat$1 (str, n) {\n    var result = '';\n    if (n > 0) {\n      while (true) { // eslint-disable-line\n        if (n & 1) { result += str; }\n        n >>>= 1;\n        if (n <= 0) { break }\n        str += str;\n      }\n    }\n    return result\n  }\n\n  /*  */\n\n\n\n  function createFunction (code, errors) {\n    try {\n      return new Function(code)\n    } catch (err) {\n      errors.push({ err: err, code: code });\n      return noop\n    }\n  }\n\n  function createCompileToFunctionFn (compile) {\n    var cache = Object.create(null);\n\n    return function compileToFunctions (\n      template,\n      options,\n      vm\n    ) {\n      options = extend({}, options);\n      var warn$$1 = options.warn || warn;\n      delete options.warn;\n\n      /* istanbul ignore if */\n      {\n        // detect possible CSP restriction\n        try {\n          new Function('return 1');\n        } catch (e) {\n          if (e.toString().match(/unsafe-eval|CSP/)) {\n            warn$$1(\n              'It seems you are using the standalone build of Vue.js in an ' +\n              'environment with Content Security Policy that prohibits unsafe-eval. ' +\n              'The template compiler cannot work in this environment. Consider ' +\n              'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n              'templates into render functions.'\n            );\n          }\n        }\n      }\n\n      // check cache\n      var key = options.delimiters\n        ? String(options.delimiters) + template\n        : template;\n      if (cache[key]) {\n        return cache[key]\n      }\n\n      // compile\n      var compiled = compile(template, options);\n\n      // check compilation errors/tips\n      {\n        if (compiled.errors && compiled.errors.length) {\n          if (options.outputSourceRange) {\n            compiled.errors.forEach(function (e) {\n              warn$$1(\n                \"Error compiling template:\\n\\n\" + (e.msg) + \"\\n\\n\" +\n                generateCodeFrame(template, e.start, e.end),\n                vm\n              );\n            });\n          } else {\n            warn$$1(\n              \"Error compiling template:\\n\\n\" + template + \"\\n\\n\" +\n              compiled.errors.map(function (e) { return (\"- \" + e); }).join('\\n') + '\\n',\n              vm\n            );\n          }\n        }\n        if (compiled.tips && compiled.tips.length) {\n          if (options.outputSourceRange) {\n            compiled.tips.forEach(function (e) { return tip(e.msg, vm); });\n          } else {\n            compiled.tips.forEach(function (msg) { return tip(msg, vm); });\n          }\n        }\n      }\n\n      // turn code into functions\n      var res = {};\n      var fnGenErrors = [];\n      res.render = createFunction(compiled.render, fnGenErrors);\n      res.staticRenderFns = compiled.staticRenderFns.map(function (code) {\n        return createFunction(code, fnGenErrors)\n      });\n\n      // check function generation errors.\n      // this should only happen if there is a bug in the compiler itself.\n      // mostly for codegen development use\n      /* istanbul ignore if */\n      {\n        if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {\n          warn$$1(\n            \"Failed to generate render function:\\n\\n\" +\n            fnGenErrors.map(function (ref) {\n              var err = ref.err;\n              var code = ref.code;\n\n              return ((err.toString()) + \" in\\n\\n\" + code + \"\\n\");\n          }).join('\\n'),\n            vm\n          );\n        }\n      }\n\n      return (cache[key] = res)\n    }\n  }\n\n  /*  */\n\n  function createCompilerCreator (baseCompile) {\n    return function createCompiler (baseOptions) {\n      function compile (\n        template,\n        options\n      ) {\n        var finalOptions = Object.create(baseOptions);\n        var errors = [];\n        var tips = [];\n\n        var warn = function (msg, range, tip) {\n          (tip ? tips : errors).push(msg);\n        };\n\n        if (options) {\n          if (options.outputSourceRange) {\n            // $flow-disable-line\n            var leadingSpaceLength = template.match(/^\\s*/)[0].length;\n\n            warn = function (msg, range, tip) {\n              var data = { msg: msg };\n              if (range) {\n                if (range.start != null) {\n                  data.start = range.start + leadingSpaceLength;\n                }\n                if (range.end != null) {\n                  data.end = range.end + leadingSpaceLength;\n                }\n              }\n              (tip ? tips : errors).push(data);\n            };\n          }\n          // merge custom modules\n          if (options.modules) {\n            finalOptions.modules =\n              (baseOptions.modules || []).concat(options.modules);\n          }\n          // merge custom directives\n          if (options.directives) {\n            finalOptions.directives = extend(\n              Object.create(baseOptions.directives || null),\n              options.directives\n            );\n          }\n          // copy other options\n          for (var key in options) {\n            if (key !== 'modules' && key !== 'directives') {\n              finalOptions[key] = options[key];\n            }\n          }\n        }\n\n        finalOptions.warn = warn;\n\n        var compiled = baseCompile(template.trim(), finalOptions);\n        {\n          detectErrors(compiled.ast, warn);\n        }\n        compiled.errors = errors;\n        compiled.tips = tips;\n        return compiled\n      }\n\n      return {\n        compile: compile,\n        compileToFunctions: createCompileToFunctionFn(compile)\n      }\n    }\n  }\n\n  /*  */\n\n  // `createCompilerCreator` allows creating compilers that use alternative\n  // parser/optimizer/codegen, e.g the SSR optimizing compiler.\n  // Here we just export a default compiler using the default parts.\n  var createCompiler = createCompilerCreator(function baseCompile (\n    template,\n    options\n  ) {\n    var ast = parse(template.trim(), options);\n    if (options.optimize !== false) {\n      optimize(ast, options);\n    }\n    var code = generate(ast, options);\n    return {\n      ast: ast,\n      render: code.render,\n      staticRenderFns: code.staticRenderFns\n    }\n  });\n\n  /*  */\n\n  var ref$1 = createCompiler(baseOptions);\n  var compile = ref$1.compile;\n  var compileToFunctions = ref$1.compileToFunctions;\n\n  /*  */\n\n  // check whether current browser encodes a char inside attribute values\n  var div;\n  function getShouldDecode (href) {\n    div = div || document.createElement('div');\n    div.innerHTML = href ? \"<a href=\\\"\\n\\\"/>\" : \"<div a=\\\"\\n\\\"/>\";\n    return div.innerHTML.indexOf('&#10;') > 0\n  }\n\n  // #3663: IE encodes newlines inside attribute values while other browsers don't\n  var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;\n  // #6828: chrome encodes content in a[href]\n  var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;\n\n  /*  */\n\n  var idToTemplate = cached(function (id) {\n    var el = query(id);\n    return el && el.innerHTML\n  });\n\n  var mount = Vue.prototype.$mount;\n  Vue.prototype.$mount = function (\n    el,\n    hydrating\n  ) {\n    el = el && query(el);\n\n    /* istanbul ignore if */\n    if (el === document.body || el === document.documentElement) {\n      warn(\n        \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n      );\n      return this\n    }\n\n    var options = this.$options;\n    // resolve template/el and convert to render function\n    if (!options.render) {\n      var template = options.template;\n      if (template) {\n        if (typeof template === 'string') {\n          if (template.charAt(0) === '#') {\n            template = idToTemplate(template);\n            /* istanbul ignore if */\n            if (!template) {\n              warn(\n                (\"Template element not found or is empty: \" + (options.template)),\n                this\n              );\n            }\n          }\n        } else if (template.nodeType) {\n          template = template.innerHTML;\n        } else {\n          {\n            warn('invalid template option:' + template, this);\n          }\n          return this\n        }\n      } else if (el) {\n        template = getOuterHTML(el);\n      }\n      if (template) {\n        /* istanbul ignore if */\n        if (config.performance && mark) {\n          mark('compile');\n        }\n\n        var ref = compileToFunctions(template, {\n          outputSourceRange: \"development\" !== 'production',\n          shouldDecodeNewlines: shouldDecodeNewlines,\n          shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,\n          delimiters: options.delimiters,\n          comments: options.comments\n        }, this);\n        var render = ref.render;\n        var staticRenderFns = ref.staticRenderFns;\n        options.render = render;\n        options.staticRenderFns = staticRenderFns;\n\n        /* istanbul ignore if */\n        if (config.performance && mark) {\n          mark('compile end');\n          measure((\"vue \" + (this._name) + \" compile\"), 'compile', 'compile end');\n        }\n      }\n    }\n    return mount.call(this, el, hydrating)\n  };\n\n  /**\n   * Get outerHTML of elements, taking care\n   * of SVG elements in IE as well.\n   */\n  function getOuterHTML (el) {\n    if (el.outerHTML) {\n      return el.outerHTML\n    } else {\n      var container = document.createElement('div');\n      container.appendChild(el.cloneNode(true));\n      return container.innerHTML\n    }\n  }\n\n  Vue.compile = compileToFunctions;\n\n  return Vue;\n\n}));\n"
  },
  {
    "path": "calllib-v3/web/lib/vue-router-3.0.2.js",
    "content": "/*!\n  * vue-router v3.0.2\n  * (c) 2018 Evan You\n  * @license MIT\n  */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.VueRouter = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\nfunction assert (condition, message) {\n  if (!condition) {\n    throw new Error((\"[vue-router] \" + message))\n  }\n}\n\nfunction warn (condition, message) {\n  if (\"development\" !== 'production' && !condition) {\n    typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n  }\n}\n\nfunction isError (err) {\n  return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction extend (a, b) {\n  for (var key in b) {\n    a[key] = b[key];\n  }\n  return a\n}\n\nvar View = {\n  name: 'RouterView',\n  functional: true,\n  props: {\n    name: {\n      type: String,\n      default: 'default'\n    }\n  },\n  render: function render (_, ref) {\n    var props = ref.props;\n    var children = ref.children;\n    var parent = ref.parent;\n    var data = ref.data;\n\n    // used by devtools to display a router-view badge\n    data.routerView = true;\n\n    // directly use parent context's createElement() function\n    // so that components rendered by router-view can resolve named slots\n    var h = parent.$createElement;\n    var name = props.name;\n    var route = parent.$route;\n    var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n    // determine current view depth, also check to see if the tree\n    // has been toggled inactive but kept-alive.\n    var depth = 0;\n    var inactive = false;\n    while (parent && parent._routerRoot !== parent) {\n      if (parent.$vnode && parent.$vnode.data.routerView) {\n        depth++;\n      }\n      if (parent._inactive) {\n        inactive = true;\n      }\n      parent = parent.$parent;\n    }\n    data.routerViewDepth = depth;\n\n    // render previous view if the tree is inactive and kept-alive\n    if (inactive) {\n      return h(cache[name], data, children)\n    }\n\n    var matched = route.matched[depth];\n    // render empty node if no matched route\n    if (!matched) {\n      cache[name] = null;\n      return h()\n    }\n\n    var component = cache[name] = matched.components[name];\n\n    // attach instance registration hook\n    // this will be called in the instance's injected lifecycle hooks\n    data.registerRouteInstance = function (vm, val) {\n      // val could be undefined for unregistration\n      var current = matched.instances[name];\n      if (\n        (val && current !== vm) ||\n        (!val && current === vm)\n      ) {\n        matched.instances[name] = val;\n      }\n    }\n\n    // also register instance in prepatch hook\n    // in case the same component instance is reused across different routes\n    ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n      matched.instances[name] = vnode.componentInstance;\n    };\n\n    // resolve props\n    var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);\n    if (propsToPass) {\n      // clone to prevent mutation\n      propsToPass = data.props = extend({}, propsToPass);\n      // pass non-declared props as attrs\n      var attrs = data.attrs = data.attrs || {};\n      for (var key in propsToPass) {\n        if (!component.props || !(key in component.props)) {\n          attrs[key] = propsToPass[key];\n          delete propsToPass[key];\n        }\n      }\n    }\n\n    return h(component, data, children)\n  }\n}\n\nfunction resolveProps (route, config) {\n  switch (typeof config) {\n    case 'undefined':\n      return\n    case 'object':\n      return config\n    case 'function':\n      return config(route)\n    case 'boolean':\n      return config ? route.params : undefined\n    default:\n      {\n        warn(\n          false,\n          \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n          \"expecting an object, function or boolean.\"\n        );\n      }\n  }\n}\n\n/*  */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n  .replace(encodeReserveRE, encodeReserveReplacer)\n  .replace(commaRE, ','); };\n\nvar decode = decodeURIComponent;\n\nfunction resolveQuery (\n  query,\n  extraQuery,\n  _parseQuery\n) {\n  if ( extraQuery === void 0 ) extraQuery = {};\n\n  var parse = _parseQuery || parseQuery;\n  var parsedQuery;\n  try {\n    parsedQuery = parse(query || '');\n  } catch (e) {\n    \"development\" !== 'production' && warn(false, e.message);\n    parsedQuery = {};\n  }\n  for (var key in extraQuery) {\n    parsedQuery[key] = extraQuery[key];\n  }\n  return parsedQuery\n}\n\nfunction parseQuery (query) {\n  var res = {};\n\n  query = query.trim().replace(/^(\\?|#|&)/, '');\n\n  if (!query) {\n    return res\n  }\n\n  query.split('&').forEach(function (param) {\n    var parts = param.replace(/\\+/g, ' ').split('=');\n    var key = decode(parts.shift());\n    var val = parts.length > 0\n      ? decode(parts.join('='))\n      : null;\n\n    if (res[key] === undefined) {\n      res[key] = val;\n    } else if (Array.isArray(res[key])) {\n      res[key].push(val);\n    } else {\n      res[key] = [res[key], val];\n    }\n  });\n\n  return res\n}\n\nfunction stringifyQuery (obj) {\n  var res = obj ? Object.keys(obj).map(function (key) {\n    var val = obj[key];\n\n    if (val === undefined) {\n      return ''\n    }\n\n    if (val === null) {\n      return encode(key)\n    }\n\n    if (Array.isArray(val)) {\n      var result = [];\n      val.forEach(function (val2) {\n        if (val2 === undefined) {\n          return\n        }\n        if (val2 === null) {\n          result.push(encode(key));\n        } else {\n          result.push(encode(key) + '=' + encode(val2));\n        }\n      });\n      return result.join('&')\n    }\n\n    return encode(key) + '=' + encode(val)\n  }).filter(function (x) { return x.length > 0; }).join('&') : null;\n  return res ? (\"?\" + res) : ''\n}\n\n/*  */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n  record,\n  location,\n  redirectedFrom,\n  router\n) {\n  var stringifyQuery$$1 = router && router.options.stringifyQuery;\n\n  var query = location.query || {};\n  try {\n    query = clone(query);\n  } catch (e) {}\n\n  var route = {\n    name: location.name || (record && record.name),\n    meta: (record && record.meta) || {},\n    path: location.path || '/',\n    hash: location.hash || '',\n    query: query,\n    params: location.params || {},\n    fullPath: getFullPath(location, stringifyQuery$$1),\n    matched: record ? formatMatch(record) : []\n  };\n  if (redirectedFrom) {\n    route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1);\n  }\n  return Object.freeze(route)\n}\n\nfunction clone (value) {\n  if (Array.isArray(value)) {\n    return value.map(clone)\n  } else if (value && typeof value === 'object') {\n    var res = {};\n    for (var key in value) {\n      res[key] = clone(value[key]);\n    }\n    return res\n  } else {\n    return value\n  }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n  path: '/'\n});\n\nfunction formatMatch (record) {\n  var res = [];\n  while (record) {\n    res.unshift(record);\n    record = record.parent;\n  }\n  return res\n}\n\nfunction getFullPath (\n  ref,\n  _stringifyQuery\n) {\n  var path = ref.path;\n  var query = ref.query; if ( query === void 0 ) query = {};\n  var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n  var stringify = _stringifyQuery || stringifyQuery;\n  return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b) {\n  if (b === START) {\n    return a === b\n  } else if (!b) {\n    return false\n  } else if (a.path && b.path) {\n    return (\n      a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query)\n    )\n  } else if (a.name && b.name) {\n    return (\n      a.name === b.name &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query) &&\n      isObjectEqual(a.params, b.params)\n    )\n  } else {\n    return false\n  }\n}\n\nfunction isObjectEqual (a, b) {\n  if ( a === void 0 ) a = {};\n  if ( b === void 0 ) b = {};\n\n  // handle null value #1566\n  if (!a || !b) { return a === b }\n  var aKeys = Object.keys(a);\n  var bKeys = Object.keys(b);\n  if (aKeys.length !== bKeys.length) {\n    return false\n  }\n  return aKeys.every(function (key) {\n    var aVal = a[key];\n    var bVal = b[key];\n    // check nested equality\n    if (typeof aVal === 'object' && typeof bVal === 'object') {\n      return isObjectEqual(aVal, bVal)\n    }\n    return String(aVal) === String(bVal)\n  })\n}\n\nfunction isIncludedRoute (current, target) {\n  return (\n    current.path.replace(trailingSlashRE, '/').indexOf(\n      target.path.replace(trailingSlashRE, '/')\n    ) === 0 &&\n    (!target.hash || current.hash === target.hash) &&\n    queryIncludes(current.query, target.query)\n  )\n}\n\nfunction queryIncludes (current, target) {\n  for (var key in target) {\n    if (!(key in current)) {\n      return false\n    }\n  }\n  return true\n}\n\n/*  */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar Link = {\n  name: 'RouterLink',\n  props: {\n    to: {\n      type: toTypes,\n      required: true\n    },\n    tag: {\n      type: String,\n      default: 'a'\n    },\n    exact: Boolean,\n    append: Boolean,\n    replace: Boolean,\n    activeClass: String,\n    exactActiveClass: String,\n    event: {\n      type: eventTypes,\n      default: 'click'\n    }\n  },\n  render: function render (h) {\n    var this$1 = this;\n\n    var router = this.$router;\n    var current = this.$route;\n    var ref = router.resolve(this.to, current, this.append);\n    var location = ref.location;\n    var route = ref.route;\n    var href = ref.href;\n\n    var classes = {};\n    var globalActiveClass = router.options.linkActiveClass;\n    var globalExactActiveClass = router.options.linkExactActiveClass;\n    // Support global empty active class\n    var activeClassFallback = globalActiveClass == null\n      ? 'router-link-active'\n      : globalActiveClass;\n    var exactActiveClassFallback = globalExactActiveClass == null\n      ? 'router-link-exact-active'\n      : globalExactActiveClass;\n    var activeClass = this.activeClass == null\n      ? activeClassFallback\n      : this.activeClass;\n    var exactActiveClass = this.exactActiveClass == null\n      ? exactActiveClassFallback\n      : this.exactActiveClass;\n    var compareTarget = location.path\n      ? createRoute(null, location, null, router)\n      : route;\n\n    classes[exactActiveClass] = isSameRoute(current, compareTarget);\n    classes[activeClass] = this.exact\n      ? classes[exactActiveClass]\n      : isIncludedRoute(current, compareTarget);\n\n    var handler = function (e) {\n      if (guardEvent(e)) {\n        if (this$1.replace) {\n          router.replace(location);\n        } else {\n          router.push(location);\n        }\n      }\n    };\n\n    var on = { click: guardEvent };\n    if (Array.isArray(this.event)) {\n      this.event.forEach(function (e) { on[e] = handler; });\n    } else {\n      on[this.event] = handler;\n    }\n\n    var data = {\n      class: classes\n    };\n\n    if (this.tag === 'a') {\n      data.on = on;\n      data.attrs = { href: href };\n    } else {\n      // find the first <a> child and apply listener and href\n      var a = findAnchor(this.$slots.default);\n      if (a) {\n        // in case the <a> is a static node\n        a.isStatic = false;\n        var aData = a.data = extend({}, a.data);\n        aData.on = on;\n        var aAttrs = a.data.attrs = extend({}, a.data.attrs);\n        aAttrs.href = href;\n      } else {\n        // doesn't have <a> child, apply listener to self\n        data.on = on;\n      }\n    }\n\n    return h(this.tag, data, this.$slots.default)\n  }\n}\n\nfunction guardEvent (e) {\n  // don't redirect with control keys\n  if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n  // don't redirect when preventDefault called\n  if (e.defaultPrevented) { return }\n  // don't redirect on right click\n  if (e.button !== undefined && e.button !== 0) { return }\n  // don't redirect if `target=\"_blank\"`\n  if (e.currentTarget && e.currentTarget.getAttribute) {\n    var target = e.currentTarget.getAttribute('target');\n    if (/\\b_blank\\b/i.test(target)) { return }\n  }\n  // this may be a Weex event which doesn't have this method\n  if (e.preventDefault) {\n    e.preventDefault();\n  }\n  return true\n}\n\nfunction findAnchor (children) {\n  if (children) {\n    var child;\n    for (var i = 0; i < children.length; i++) {\n      child = children[i];\n      if (child.tag === 'a') {\n        return child\n      }\n      if (child.children && (child = findAnchor(child.children))) {\n        return child\n      }\n    }\n  }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n  if (install.installed && _Vue === Vue) { return }\n  install.installed = true;\n\n  _Vue = Vue;\n\n  var isDef = function (v) { return v !== undefined; };\n\n  var registerInstance = function (vm, callVal) {\n    var i = vm.$options._parentVnode;\n    if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n      i(vm, callVal);\n    }\n  };\n\n  Vue.mixin({\n    beforeCreate: function beforeCreate () {\n      if (isDef(this.$options.router)) {\n        this._routerRoot = this;\n        this._router = this.$options.router;\n        this._router.init(this);\n        Vue.util.defineReactive(this, '_route', this._router.history.current);\n      } else {\n        this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n      }\n      registerInstance(this, this);\n    },\n    destroyed: function destroyed () {\n      registerInstance(this);\n    }\n  });\n\n  Object.defineProperty(Vue.prototype, '$router', {\n    get: function get () { return this._routerRoot._router }\n  });\n\n  Object.defineProperty(Vue.prototype, '$route', {\n    get: function get () { return this._routerRoot._route }\n  });\n\n  Vue.component('RouterView', View);\n  Vue.component('RouterLink', Link);\n\n  var strats = Vue.config.optionMergeStrategies;\n  // use the same hook merging strategy for route hooks\n  strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/*  */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/*  */\n\nfunction resolvePath (\n  relative,\n  base,\n  append\n) {\n  var firstChar = relative.charAt(0);\n  if (firstChar === '/') {\n    return relative\n  }\n\n  if (firstChar === '?' || firstChar === '#') {\n    return base + relative\n  }\n\n  var stack = base.split('/');\n\n  // remove trailing segment if:\n  // - not appending\n  // - appending to trailing slash (last segment is empty)\n  if (!append || !stack[stack.length - 1]) {\n    stack.pop();\n  }\n\n  // resolve relative path\n  var segments = relative.replace(/^\\//, '').split('/');\n  for (var i = 0; i < segments.length; i++) {\n    var segment = segments[i];\n    if (segment === '..') {\n      stack.pop();\n    } else if (segment !== '.') {\n      stack.push(segment);\n    }\n  }\n\n  // ensure leading slash\n  if (stack[0] !== '') {\n    stack.unshift('');\n  }\n\n  return stack.join('/')\n}\n\nfunction parsePath (path) {\n  var hash = '';\n  var query = '';\n\n  var hashIndex = path.indexOf('#');\n  if (hashIndex >= 0) {\n    hash = path.slice(hashIndex);\n    path = path.slice(0, hashIndex);\n  }\n\n  var queryIndex = path.indexOf('?');\n  if (queryIndex >= 0) {\n    query = path.slice(queryIndex + 1);\n    path = path.slice(0, queryIndex);\n  }\n\n  return {\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\nfunction cleanPath (path) {\n  return path.replace(/\\/\\//g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n  return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n  // Match escaped characters that would otherwise appear in future matches.\n  // This allows the user to escape special characters that won't transform.\n  '(\\\\\\\\.)',\n  // Match Express-style parameters and un-named parameters with a prefix\n  // and optional suffixes. Matches appear as:\n  //\n  // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n  // \"/route(\\\\d+)\"  => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n  // \"/*\"            => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n  '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param  {string}  str\n * @param  {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n  var tokens = [];\n  var key = 0;\n  var index = 0;\n  var path = '';\n  var defaultDelimiter = options && options.delimiter || '/';\n  var res;\n\n  while ((res = PATH_REGEXP.exec(str)) != null) {\n    var m = res[0];\n    var escaped = res[1];\n    var offset = res.index;\n    path += str.slice(index, offset);\n    index = offset + m.length;\n\n    // Ignore already escaped sequences.\n    if (escaped) {\n      path += escaped[1];\n      continue\n    }\n\n    var next = str[index];\n    var prefix = res[2];\n    var name = res[3];\n    var capture = res[4];\n    var group = res[5];\n    var modifier = res[6];\n    var asterisk = res[7];\n\n    // Push the current path onto the tokens.\n    if (path) {\n      tokens.push(path);\n      path = '';\n    }\n\n    var partial = prefix != null && next != null && next !== prefix;\n    var repeat = modifier === '+' || modifier === '*';\n    var optional = modifier === '?' || modifier === '*';\n    var delimiter = res[2] || defaultDelimiter;\n    var pattern = capture || group;\n\n    tokens.push({\n      name: name || key++,\n      prefix: prefix || '',\n      delimiter: delimiter,\n      optional: optional,\n      repeat: repeat,\n      partial: partial,\n      asterisk: !!asterisk,\n      pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n    });\n  }\n\n  // Match any characters still remaining.\n  if (index < str.length) {\n    path += str.substr(index);\n  }\n\n  // If the path exists, push it onto the end.\n  if (path) {\n    tokens.push(path);\n  }\n\n  return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param  {string}             str\n * @param  {Object=}            options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n  return tokensToFunction(parse(str, options))\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n  return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n  return encodeURI(str).replace(/[?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n  // Compile all the tokens into regexps.\n  var matches = new Array(tokens.length);\n\n  // Compile all the patterns before compilation.\n  for (var i = 0; i < tokens.length; i++) {\n    if (typeof tokens[i] === 'object') {\n      matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n    }\n  }\n\n  return function (obj, opts) {\n    var path = '';\n    var data = obj || {};\n    var options = opts || {};\n    var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n    for (var i = 0; i < tokens.length; i++) {\n      var token = tokens[i];\n\n      if (typeof token === 'string') {\n        path += token;\n\n        continue\n      }\n\n      var value = data[token.name];\n      var segment;\n\n      if (value == null) {\n        if (token.optional) {\n          // Prepend partial segment prefixes.\n          if (token.partial) {\n            path += token.prefix;\n          }\n\n          continue\n        } else {\n          throw new TypeError('Expected \"' + token.name + '\" to be defined')\n        }\n      }\n\n      if (isarray(value)) {\n        if (!token.repeat) {\n          throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n        }\n\n        if (value.length === 0) {\n          if (token.optional) {\n            continue\n          } else {\n            throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n          }\n        }\n\n        for (var j = 0; j < value.length; j++) {\n          segment = encode(value[j]);\n\n          if (!matches[i].test(segment)) {\n            throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n          }\n\n          path += (j === 0 ? token.prefix : token.delimiter) + segment;\n        }\n\n        continue\n      }\n\n      segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n      if (!matches[i].test(segment)) {\n        throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n      }\n\n      path += token.prefix + segment;\n    }\n\n    return path\n  }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param  {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n  return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param  {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n  return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param  {!RegExp} re\n * @param  {Array}   keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n  re.keys = keys;\n  return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param  {Object} options\n * @return {string}\n */\nfunction flags (options) {\n  return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param  {!RegExp} path\n * @param  {!Array}  keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n  // Use a negative lookahead to match only capturing groups.\n  var groups = path.source.match(/\\((?!\\?)/g);\n\n  if (groups) {\n    for (var i = 0; i < groups.length; i++) {\n      keys.push({\n        name: i,\n        prefix: null,\n        delimiter: null,\n        optional: false,\n        repeat: false,\n        partial: false,\n        asterisk: false,\n        pattern: null\n      });\n    }\n  }\n\n  return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param  {!Array}  path\n * @param  {Array}   keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n  var parts = [];\n\n  for (var i = 0; i < path.length; i++) {\n    parts.push(pathToRegexp(path[i], keys, options).source);\n  }\n\n  var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n  return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param  {string}  path\n * @param  {!Array}  keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n  return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param  {!Array}          tokens\n * @param  {(Array|Object)=} keys\n * @param  {Object=}         options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options);\n    keys = [];\n  }\n\n  options = options || {};\n\n  var strict = options.strict;\n  var end = options.end !== false;\n  var route = '';\n\n  // Iterate over the tokens and create our regexp string.\n  for (var i = 0; i < tokens.length; i++) {\n    var token = tokens[i];\n\n    if (typeof token === 'string') {\n      route += escapeString(token);\n    } else {\n      var prefix = escapeString(token.prefix);\n      var capture = '(?:' + token.pattern + ')';\n\n      keys.push(token);\n\n      if (token.repeat) {\n        capture += '(?:' + prefix + capture + ')*';\n      }\n\n      if (token.optional) {\n        if (!token.partial) {\n          capture = '(?:' + prefix + '(' + capture + '))?';\n        } else {\n          capture = prefix + '(' + capture + ')?';\n        }\n      } else {\n        capture = prefix + '(' + capture + ')';\n      }\n\n      route += capture;\n    }\n  }\n\n  var delimiter = escapeString(options.delimiter || '/');\n  var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n  // In non-strict mode we allow a slash at the end of match. If the path to\n  // match already ends with a slash, we remove it for consistency. The slash\n  // is valid at the end of a path match, not in the middle. This is important\n  // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n  if (!strict) {\n    route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n  }\n\n  if (end) {\n    route += '$';\n  } else {\n    // In non-ending mode, we need the capturing groups to match as much as\n    // possible by using a positive lookahead to the end or next path segment.\n    route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n  }\n\n  return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param  {(string|RegExp|Array)} path\n * @param  {(Array|Object)=}       keys\n * @param  {Object=}               options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options);\n    keys = [];\n  }\n\n  options = options || {};\n\n  if (path instanceof RegExp) {\n    return regexpToRegexp(path, /** @type {!Array} */ (keys))\n  }\n\n  if (isarray(path)) {\n    return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n  }\n\n  return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/*  */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n  path,\n  params,\n  routeMsg\n) {\n  try {\n    var filler =\n      regexpCompileCache[path] ||\n      (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n    return filler(params || {}, { pretty: true })\n  } catch (e) {\n    {\n      warn(false, (\"missing param for \" + routeMsg + \": \" + (e.message)));\n    }\n    return ''\n  }\n}\n\n/*  */\n\nfunction createRouteMap (\n  routes,\n  oldPathList,\n  oldPathMap,\n  oldNameMap\n) {\n  // the path list is used to control path matching priority\n  var pathList = oldPathList || [];\n  // $flow-disable-line\n  var pathMap = oldPathMap || Object.create(null);\n  // $flow-disable-line\n  var nameMap = oldNameMap || Object.create(null);\n\n  routes.forEach(function (route) {\n    addRouteRecord(pathList, pathMap, nameMap, route);\n  });\n\n  // ensure wildcard routes are always at the end\n  for (var i = 0, l = pathList.length; i < l; i++) {\n    if (pathList[i] === '*') {\n      pathList.push(pathList.splice(i, 1)[0]);\n      l--;\n      i--;\n    }\n  }\n\n  return {\n    pathList: pathList,\n    pathMap: pathMap,\n    nameMap: nameMap\n  }\n}\n\nfunction addRouteRecord (\n  pathList,\n  pathMap,\n  nameMap,\n  route,\n  parent,\n  matchAs\n) {\n  var path = route.path;\n  var name = route.name;\n  {\n    assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n    assert(\n      typeof route.component !== 'string',\n      \"route config \\\"component\\\" for path: \" + (String(path || name)) + \" cannot be a \" +\n      \"string id. Use an actual component instead.\"\n    );\n  }\n\n  var pathToRegexpOptions = route.pathToRegexpOptions || {};\n  var normalizedPath = normalizePath(\n    path,\n    parent,\n    pathToRegexpOptions.strict\n  );\n\n  if (typeof route.caseSensitive === 'boolean') {\n    pathToRegexpOptions.sensitive = route.caseSensitive;\n  }\n\n  var record = {\n    path: normalizedPath,\n    regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n    components: route.components || { default: route.component },\n    instances: {},\n    name: name,\n    parent: parent,\n    matchAs: matchAs,\n    redirect: route.redirect,\n    beforeEnter: route.beforeEnter,\n    meta: route.meta || {},\n    props: route.props == null\n      ? {}\n      : route.components\n        ? route.props\n        : { default: route.props }\n  };\n\n  if (route.children) {\n    // Warn if route is named, does not redirect and has a default child route.\n    // If users navigate to this route by name, the default child will\n    // not be rendered (GH Issue #629)\n    {\n      if (route.name && !route.redirect && route.children.some(function (child) { return /^\\/?$/.test(child.path); })) {\n        warn(\n          false,\n          \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n          \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n          \"the default child route will not be rendered. Remove the name from \" +\n          \"this route and use the name of the default child route for named \" +\n          \"links instead.\"\n        );\n      }\n    }\n    route.children.forEach(function (child) {\n      var childMatchAs = matchAs\n        ? cleanPath((matchAs + \"/\" + (child.path)))\n        : undefined;\n      addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n    });\n  }\n\n  if (route.alias !== undefined) {\n    var aliases = Array.isArray(route.alias)\n      ? route.alias\n      : [route.alias];\n\n    aliases.forEach(function (alias) {\n      var aliasRoute = {\n        path: alias,\n        children: route.children\n      };\n      addRouteRecord(\n        pathList,\n        pathMap,\n        nameMap,\n        aliasRoute,\n        parent,\n        record.path || '/' // matchAs\n      );\n    });\n  }\n\n  if (!pathMap[record.path]) {\n    pathList.push(record.path);\n    pathMap[record.path] = record;\n  }\n\n  if (name) {\n    if (!nameMap[name]) {\n      nameMap[name] = record;\n    } else if (\"development\" !== 'production' && !matchAs) {\n      warn(\n        false,\n        \"Duplicate named routes definition: \" +\n        \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n      );\n    }\n  }\n}\n\nfunction compileRouteRegex (path, pathToRegexpOptions) {\n  var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n  {\n    var keys = Object.create(null);\n    regex.keys.forEach(function (key) {\n      warn(!keys[key.name], (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\"));\n      keys[key.name] = true;\n    });\n  }\n  return regex\n}\n\nfunction normalizePath (path, parent, strict) {\n  if (!strict) { path = path.replace(/\\/$/, ''); }\n  if (path[0] === '/') { return path }\n  if (parent == null) { return path }\n  return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/*  */\n\nfunction normalizeLocation (\n  raw,\n  current,\n  append,\n  router\n) {\n  var next = typeof raw === 'string' ? { path: raw } : raw;\n  // named target\n  if (next.name || next._normalized) {\n    return next\n  }\n\n  // relative params\n  if (!next.path && next.params && current) {\n    next = extend({}, next);\n    next._normalized = true;\n    var params = extend(extend({}, current.params), next.params);\n    if (current.name) {\n      next.name = current.name;\n      next.params = params;\n    } else if (current.matched.length) {\n      var rawPath = current.matched[current.matched.length - 1].path;\n      next.path = fillParams(rawPath, params, (\"path \" + (current.path)));\n    } else {\n      warn(false, \"relative params navigation requires a current route.\");\n    }\n    return next\n  }\n\n  var parsedPath = parsePath(next.path || '');\n  var basePath = (current && current.path) || '/';\n  var path = parsedPath.path\n    ? resolvePath(parsedPath.path, basePath, append || next.append)\n    : basePath;\n\n  var query = resolveQuery(\n    parsedPath.query,\n    next.query,\n    router && router.options.parseQuery\n  );\n\n  var hash = next.hash || parsedPath.hash;\n  if (hash && hash.charAt(0) !== '#') {\n    hash = \"#\" + hash;\n  }\n\n  return {\n    _normalized: true,\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\n/*  */\n\n\n\nfunction createMatcher (\n  routes,\n  router\n) {\n  var ref = createRouteMap(routes);\n  var pathList = ref.pathList;\n  var pathMap = ref.pathMap;\n  var nameMap = ref.nameMap;\n\n  function addRoutes (routes) {\n    createRouteMap(routes, pathList, pathMap, nameMap);\n  }\n\n  function match (\n    raw,\n    currentRoute,\n    redirectedFrom\n  ) {\n    var location = normalizeLocation(raw, currentRoute, false, router);\n    var name = location.name;\n\n    if (name) {\n      var record = nameMap[name];\n      {\n        warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n      }\n      if (!record) { return _createRoute(null, location) }\n      var paramNames = record.regex.keys\n        .filter(function (key) { return !key.optional; })\n        .map(function (key) { return key.name; });\n\n      if (typeof location.params !== 'object') {\n        location.params = {};\n      }\n\n      if (currentRoute && typeof currentRoute.params === 'object') {\n        for (var key in currentRoute.params) {\n          if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n            location.params[key] = currentRoute.params[key];\n          }\n        }\n      }\n\n      if (record) {\n        location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n        return _createRoute(record, location, redirectedFrom)\n      }\n    } else if (location.path) {\n      location.params = {};\n      for (var i = 0; i < pathList.length; i++) {\n        var path = pathList[i];\n        var record$1 = pathMap[path];\n        if (matchRoute(record$1.regex, location.path, location.params)) {\n          return _createRoute(record$1, location, redirectedFrom)\n        }\n      }\n    }\n    // no match\n    return _createRoute(null, location)\n  }\n\n  function redirect (\n    record,\n    location\n  ) {\n    var originalRedirect = record.redirect;\n    var redirect = typeof originalRedirect === 'function'\n      ? originalRedirect(createRoute(record, location, null, router))\n      : originalRedirect;\n\n    if (typeof redirect === 'string') {\n      redirect = { path: redirect };\n    }\n\n    if (!redirect || typeof redirect !== 'object') {\n      {\n        warn(\n          false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n        );\n      }\n      return _createRoute(null, location)\n    }\n\n    var re = redirect;\n    var name = re.name;\n    var path = re.path;\n    var query = location.query;\n    var hash = location.hash;\n    var params = location.params;\n    query = re.hasOwnProperty('query') ? re.query : query;\n    hash = re.hasOwnProperty('hash') ? re.hash : hash;\n    params = re.hasOwnProperty('params') ? re.params : params;\n\n    if (name) {\n      // resolved named direct\n      var targetRecord = nameMap[name];\n      {\n        assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n      }\n      return match({\n        _normalized: true,\n        name: name,\n        query: query,\n        hash: hash,\n        params: params\n      }, undefined, location)\n    } else if (path) {\n      // 1. resolve relative redirect\n      var rawPath = resolveRecordPath(path, record);\n      // 2. resolve params\n      var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n      // 3. rematch with existing query and hash\n      return match({\n        _normalized: true,\n        path: resolvedPath,\n        query: query,\n        hash: hash\n      }, undefined, location)\n    } else {\n      {\n        warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n      }\n      return _createRoute(null, location)\n    }\n  }\n\n  function alias (\n    record,\n    location,\n    matchAs\n  ) {\n    var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n    var aliasedMatch = match({\n      _normalized: true,\n      path: aliasedPath\n    });\n    if (aliasedMatch) {\n      var matched = aliasedMatch.matched;\n      var aliasedRecord = matched[matched.length - 1];\n      location.params = aliasedMatch.params;\n      return _createRoute(aliasedRecord, location)\n    }\n    return _createRoute(null, location)\n  }\n\n  function _createRoute (\n    record,\n    location,\n    redirectedFrom\n  ) {\n    if (record && record.redirect) {\n      return redirect(record, redirectedFrom || location)\n    }\n    if (record && record.matchAs) {\n      return alias(record, location, record.matchAs)\n    }\n    return createRoute(record, location, redirectedFrom, router)\n  }\n\n  return {\n    match: match,\n    addRoutes: addRoutes\n  }\n}\n\nfunction matchRoute (\n  regex,\n  path,\n  params\n) {\n  var m = path.match(regex);\n\n  if (!m) {\n    return false\n  } else if (!params) {\n    return true\n  }\n\n  for (var i = 1, len = m.length; i < len; ++i) {\n    var key = regex.keys[i - 1];\n    var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];\n    if (key) {\n      // Fix #1994: using * with props: true generates a param named 0\n      params[key.name || 'pathMatch'] = val;\n    }\n  }\n\n  return true\n}\n\nfunction resolveRecordPath (path, record) {\n  return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/*  */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n  // Fix for #1585 for Firefox\n  // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n  window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, ''));\n  window.addEventListener('popstate', function (e) {\n    saveScrollPosition();\n    if (e.state && e.state.key) {\n      setStateKey(e.state.key);\n    }\n  });\n}\n\nfunction handleScroll (\n  router,\n  to,\n  from,\n  isPop\n) {\n  if (!router.app) {\n    return\n  }\n\n  var behavior = router.options.scrollBehavior;\n  if (!behavior) {\n    return\n  }\n\n  {\n    assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n  }\n\n  // wait until re-render finishes before scrolling\n  router.app.$nextTick(function () {\n    var position = getScrollPosition();\n    var shouldScroll = behavior.call(router, to, from, isPop ? position : null);\n\n    if (!shouldScroll) {\n      return\n    }\n\n    if (typeof shouldScroll.then === 'function') {\n      shouldScroll.then(function (shouldScroll) {\n        scrollToPosition((shouldScroll), position);\n      }).catch(function (err) {\n        {\n          assert(false, err.toString());\n        }\n      });\n    } else {\n      scrollToPosition(shouldScroll, position);\n    }\n  });\n}\n\nfunction saveScrollPosition () {\n  var key = getStateKey();\n  if (key) {\n    positionStore[key] = {\n      x: window.pageXOffset,\n      y: window.pageYOffset\n    };\n  }\n}\n\nfunction getScrollPosition () {\n  var key = getStateKey();\n  if (key) {\n    return positionStore[key]\n  }\n}\n\nfunction getElementPosition (el, offset) {\n  var docEl = document.documentElement;\n  var docRect = docEl.getBoundingClientRect();\n  var elRect = el.getBoundingClientRect();\n  return {\n    x: elRect.left - docRect.left - offset.x,\n    y: elRect.top - docRect.top - offset.y\n  }\n}\n\nfunction isValidPosition (obj) {\n  return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n    y: isNumber(obj.y) ? obj.y : window.pageYOffset\n  }\n}\n\nfunction normalizeOffset (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : 0,\n    y: isNumber(obj.y) ? obj.y : 0\n  }\n}\n\nfunction isNumber (v) {\n  return typeof v === 'number'\n}\n\nfunction scrollToPosition (shouldScroll, position) {\n  var isObject = typeof shouldScroll === 'object';\n  if (isObject && typeof shouldScroll.selector === 'string') {\n    var el = document.querySelector(shouldScroll.selector);\n    if (el) {\n      var offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {};\n      offset = normalizeOffset(offset);\n      position = getElementPosition(el, offset);\n    } else if (isValidPosition(shouldScroll)) {\n      position = normalizePosition(shouldScroll);\n    }\n  } else if (isObject && isValidPosition(shouldScroll)) {\n    position = normalizePosition(shouldScroll);\n  }\n\n  if (position) {\n    window.scrollTo(position.x, position.y);\n  }\n}\n\n/*  */\n\nvar supportsPushState = inBrowser && (function () {\n  var ua = window.navigator.userAgent;\n\n  if (\n    (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n    ua.indexOf('Mobile Safari') !== -1 &&\n    ua.indexOf('Chrome') === -1 &&\n    ua.indexOf('Windows Phone') === -1\n  ) {\n    return false\n  }\n\n  return window.history && 'pushState' in window.history\n})();\n\n// use User Timing api (if present) for more accurate key precision\nvar Time = inBrowser && window.performance && window.performance.now\n  ? window.performance\n  : Date;\n\nvar _key = genKey();\n\nfunction genKey () {\n  return Time.now().toFixed(3)\n}\n\nfunction getStateKey () {\n  return _key\n}\n\nfunction setStateKey (key) {\n  _key = key;\n}\n\nfunction pushState (url, replace) {\n  saveScrollPosition();\n  // try...catch the pushState call to get around Safari\n  // DOM Exception 18 where it limits to 100 pushState calls\n  var history = window.history;\n  try {\n    if (replace) {\n      history.replaceState({ key: _key }, '', url);\n    } else {\n      _key = genKey();\n      history.pushState({ key: _key }, '', url);\n    }\n  } catch (e) {\n    window.location[replace ? 'replace' : 'assign'](url);\n  }\n}\n\nfunction replaceState (url) {\n  pushState(url, true);\n}\n\n/*  */\n\nfunction runQueue (queue, fn, cb) {\n  var step = function (index) {\n    if (index >= queue.length) {\n      cb();\n    } else {\n      if (queue[index]) {\n        fn(queue[index], function () {\n          step(index + 1);\n        });\n      } else {\n        step(index + 1);\n      }\n    }\n  };\n  step(0);\n}\n\n/*  */\n\nfunction resolveAsyncComponents (matched) {\n  return function (to, from, next) {\n    var hasAsync = false;\n    var pending = 0;\n    var error = null;\n\n    flatMapComponents(matched, function (def, _, match, key) {\n      // if it's a function and doesn't have cid attached,\n      // assume it's an async component resolve function.\n      // we are not using Vue's default async resolving mechanism because\n      // we want to halt the navigation until the incoming component has been\n      // resolved.\n      if (typeof def === 'function' && def.cid === undefined) {\n        hasAsync = true;\n        pending++;\n\n        var resolve = once(function (resolvedDef) {\n          if (isESModule(resolvedDef)) {\n            resolvedDef = resolvedDef.default;\n          }\n          // save resolved on async factory in case it's used elsewhere\n          def.resolved = typeof resolvedDef === 'function'\n            ? resolvedDef\n            : _Vue.extend(resolvedDef);\n          match.components[key] = resolvedDef;\n          pending--;\n          if (pending <= 0) {\n            next();\n          }\n        });\n\n        var reject = once(function (reason) {\n          var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n          \"development\" !== 'production' && warn(false, msg);\n          if (!error) {\n            error = isError(reason)\n              ? reason\n              : new Error(msg);\n            next(error);\n          }\n        });\n\n        var res;\n        try {\n          res = def(resolve, reject);\n        } catch (e) {\n          reject(e);\n        }\n        if (res) {\n          if (typeof res.then === 'function') {\n            res.then(resolve, reject);\n          } else {\n            // new syntax in Vue 2.3\n            var comp = res.component;\n            if (comp && typeof comp.then === 'function') {\n              comp.then(resolve, reject);\n            }\n          }\n        }\n      }\n    });\n\n    if (!hasAsync) { next(); }\n  }\n}\n\nfunction flatMapComponents (\n  matched,\n  fn\n) {\n  return flatten(matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) { return fn(\n      m.components[key],\n      m.instances[key],\n      m, key\n    ); })\n  }))\n}\n\nfunction flatten (arr) {\n  return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n  typeof Symbol === 'function' &&\n  typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n  return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n  var called = false;\n  return function () {\n    var args = [], len = arguments.length;\n    while ( len-- ) args[ len ] = arguments[ len ];\n\n    if (called) { return }\n    called = true;\n    return fn.apply(this, args)\n  }\n}\n\n/*  */\n\nvar History = function History (router, base) {\n  this.router = router;\n  this.base = normalizeBase(base);\n  // start with a route object that stands for \"nowhere\"\n  this.current = START;\n  this.pending = null;\n  this.ready = false;\n  this.readyCbs = [];\n  this.readyErrorCbs = [];\n  this.errorCbs = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n  this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n  if (this.ready) {\n    cb();\n  } else {\n    this.readyCbs.push(cb);\n    if (errorCb) {\n      this.readyErrorCbs.push(errorCb);\n    }\n  }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n  this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {\n    var this$1 = this;\n\n  var route = this.router.match(location, this.current);\n  this.confirmTransition(route, function () {\n    this$1.updateRoute(route);\n    onComplete && onComplete(route);\n    this$1.ensureURL();\n\n    // fire ready cbs once\n    if (!this$1.ready) {\n      this$1.ready = true;\n      this$1.readyCbs.forEach(function (cb) { cb(route); });\n    }\n  }, function (err) {\n    if (onAbort) {\n      onAbort(err);\n    }\n    if (err && !this$1.ready) {\n      this$1.ready = true;\n      this$1.readyErrorCbs.forEach(function (cb) { cb(err); });\n    }\n  });\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n    var this$1 = this;\n\n  var current = this.current;\n  var abort = function (err) {\n    if (isError(err)) {\n      if (this$1.errorCbs.length) {\n        this$1.errorCbs.forEach(function (cb) { cb(err); });\n      } else {\n        warn(false, 'uncaught error during route navigation:');\n        console.error(err);\n      }\n    }\n    onAbort && onAbort(err);\n  };\n  if (\n    isSameRoute(route, current) &&\n    // in the case the route map has been dynamically appended to\n    route.matched.length === current.matched.length\n  ) {\n    this.ensureURL();\n    return abort()\n  }\n\n  var ref = resolveQueue(this.current.matched, route.matched);\n    var updated = ref.updated;\n    var deactivated = ref.deactivated;\n    var activated = ref.activated;\n\n  var queue = [].concat(\n    // in-component leave guards\n    extractLeaveGuards(deactivated),\n    // global before hooks\n    this.router.beforeHooks,\n    // in-component update hooks\n    extractUpdateHooks(updated),\n    // in-config enter guards\n    activated.map(function (m) { return m.beforeEnter; }),\n    // async components\n    resolveAsyncComponents(activated)\n  );\n\n  this.pending = route;\n  var iterator = function (hook, next) {\n    if (this$1.pending !== route) {\n      return abort()\n    }\n    try {\n      hook(route, current, function (to) {\n        if (to === false || isError(to)) {\n          // next(false) -> abort navigation, ensure current URL\n          this$1.ensureURL(true);\n          abort(to);\n        } else if (\n          typeof to === 'string' ||\n          (typeof to === 'object' && (\n            typeof to.path === 'string' ||\n            typeof to.name === 'string'\n          ))\n        ) {\n          // next('/') or next({ path: '/' }) -> redirect\n          abort();\n          if (typeof to === 'object' && to.replace) {\n            this$1.replace(to);\n          } else {\n            this$1.push(to);\n          }\n        } else {\n          // confirm transition and pass on the value\n          next(to);\n        }\n      });\n    } catch (e) {\n      abort(e);\n    }\n  };\n\n  runQueue(queue, iterator, function () {\n    var postEnterCbs = [];\n    var isValid = function () { return this$1.current === route; };\n    // wait until async components are resolved before\n    // extracting in-component enter guards\n    var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);\n    var queue = enterGuards.concat(this$1.router.resolveHooks);\n    runQueue(queue, iterator, function () {\n      if (this$1.pending !== route) {\n        return abort()\n      }\n      this$1.pending = null;\n      onComplete(route);\n      if (this$1.router.app) {\n        this$1.router.app.$nextTick(function () {\n          postEnterCbs.forEach(function (cb) { cb(); });\n        });\n      }\n    });\n  });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n  var prev = this.current;\n  this.current = route;\n  this.cb && this.cb(route);\n  this.router.afterHooks.forEach(function (hook) {\n    hook && hook(route, prev);\n  });\n};\n\nfunction normalizeBase (base) {\n  if (!base) {\n    if (inBrowser) {\n      // respect <base> tag\n      var baseEl = document.querySelector('base');\n      base = (baseEl && baseEl.getAttribute('href')) || '/';\n      // strip full URL origin\n      base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n    } else {\n      base = '/';\n    }\n  }\n  // make sure there's the starting slash\n  if (base.charAt(0) !== '/') {\n    base = '/' + base;\n  }\n  // remove trailing slash\n  return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n  current,\n  next\n) {\n  var i;\n  var max = Math.max(current.length, next.length);\n  for (i = 0; i < max; i++) {\n    if (current[i] !== next[i]) {\n      break\n    }\n  }\n  return {\n    updated: next.slice(0, i),\n    activated: next.slice(i),\n    deactivated: current.slice(i)\n  }\n}\n\nfunction extractGuards (\n  records,\n  name,\n  bind,\n  reverse\n) {\n  var guards = flatMapComponents(records, function (def, instance, match, key) {\n    var guard = extractGuard(def, name);\n    if (guard) {\n      return Array.isArray(guard)\n        ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n        : bind(guard, instance, match, key)\n    }\n  });\n  return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n  def,\n  key\n) {\n  if (typeof def !== 'function') {\n    // extend now so that global mixins are applied.\n    def = _Vue.extend(def);\n  }\n  return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n  return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n  return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n  if (instance) {\n    return function boundRouteGuard () {\n      return guard.apply(instance, arguments)\n    }\n  }\n}\n\nfunction extractEnterGuards (\n  activated,\n  cbs,\n  isValid\n) {\n  return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {\n    return bindEnterGuard(guard, match, key, cbs, isValid)\n  })\n}\n\nfunction bindEnterGuard (\n  guard,\n  match,\n  key,\n  cbs,\n  isValid\n) {\n  return function routeEnterGuard (to, from, next) {\n    return guard(to, from, function (cb) {\n      next(cb);\n      if (typeof cb === 'function') {\n        cbs.push(function () {\n          // #750\n          // if a router-view is wrapped with an out-in transition,\n          // the instance may not have been registered at this time.\n          // we will need to poll for registration until current route\n          // is no longer valid.\n          poll(cb, match.instances, key, isValid);\n        });\n      }\n    })\n  }\n}\n\nfunction poll (\n  cb, // somehow flow cannot infer this is a function\n  instances,\n  key,\n  isValid\n) {\n  if (\n    instances[key] &&\n    !instances[key]._isBeingDestroyed // do not reuse being destroyed instance\n  ) {\n    cb(instances[key]);\n  } else if (isValid()) {\n    setTimeout(function () {\n      poll(cb, instances, key, isValid);\n    }, 16);\n  }\n}\n\n/*  */\n\nvar HTML5History = (function (History$$1) {\n  function HTML5History (router, base) {\n    var this$1 = this;\n\n    History$$1.call(this, router, base);\n\n    var expectScroll = router.options.scrollBehavior;\n    var supportsScroll = supportsPushState && expectScroll;\n\n    if (supportsScroll) {\n      setupScroll();\n    }\n\n    var initLocation = getLocation(this.base);\n    window.addEventListener('popstate', function (e) {\n      var current = this$1.current;\n\n      // Avoiding first `popstate` event dispatched in some browsers but first\n      // history route not updated since async guard at the same time.\n      var location = getLocation(this$1.base);\n      if (this$1.current === START && location === initLocation) {\n        return\n      }\n\n      this$1.transitionTo(location, function (route) {\n        if (supportsScroll) {\n          handleScroll(router, route, current, true);\n        }\n      });\n    });\n  }\n\n  if ( History$$1 ) HTML5History.__proto__ = History$$1;\n  HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );\n  HTML5History.prototype.constructor = HTML5History;\n\n  HTML5History.prototype.go = function go (n) {\n    window.history.go(n);\n  };\n\n  HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      pushState(cleanPath(this$1.base + route.fullPath));\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      replaceState(cleanPath(this$1.base + route.fullPath));\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HTML5History.prototype.ensureURL = function ensureURL (push) {\n    if (getLocation(this.base) !== this.current.fullPath) {\n      var current = cleanPath(this.base + this.current.fullPath);\n      push ? pushState(current) : replaceState(current);\n    }\n  };\n\n  HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n    return getLocation(this.base)\n  };\n\n  return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n  var path = decodeURI(window.location.pathname);\n  if (base && path.indexOf(base) === 0) {\n    path = path.slice(base.length);\n  }\n  return (path || '/') + window.location.search + window.location.hash\n}\n\n/*  */\n\nvar HashHistory = (function (History$$1) {\n  function HashHistory (router, base, fallback) {\n    History$$1.call(this, router, base);\n    // check history fallback deeplinking\n    if (fallback && checkFallback(this.base)) {\n      return\n    }\n    ensureSlash();\n  }\n\n  if ( History$$1 ) HashHistory.__proto__ = History$$1;\n  HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );\n  HashHistory.prototype.constructor = HashHistory;\n\n  // this is delayed until the app mounts\n  // to avoid the hashchange listener being fired too early\n  HashHistory.prototype.setupListeners = function setupListeners () {\n    var this$1 = this;\n\n    var router = this.router;\n    var expectScroll = router.options.scrollBehavior;\n    var supportsScroll = supportsPushState && expectScroll;\n\n    if (supportsScroll) {\n      setupScroll();\n    }\n\n    window.addEventListener(supportsPushState ? 'popstate' : 'hashchange', function () {\n      var current = this$1.current;\n      if (!ensureSlash()) {\n        return\n      }\n      this$1.transitionTo(getHash(), function (route) {\n        if (supportsScroll) {\n          handleScroll(this$1.router, route, current, true);\n        }\n        if (!supportsPushState) {\n          replaceHash(route.fullPath);\n        }\n      });\n    });\n  };\n\n  HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      pushHash(route.fullPath);\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      replaceHash(route.fullPath);\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HashHistory.prototype.go = function go (n) {\n    window.history.go(n);\n  };\n\n  HashHistory.prototype.ensureURL = function ensureURL (push) {\n    var current = this.current.fullPath;\n    if (getHash() !== current) {\n      push ? pushHash(current) : replaceHash(current);\n    }\n  };\n\n  HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n    return getHash()\n  };\n\n  return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n  var location = getLocation(base);\n  if (!/^\\/#/.test(location)) {\n    window.location.replace(\n      cleanPath(base + '/#' + location)\n    );\n    return true\n  }\n}\n\nfunction ensureSlash () {\n  var path = getHash();\n  if (path.charAt(0) === '/') {\n    return true\n  }\n  replaceHash('/' + path);\n  return false\n}\n\nfunction getHash () {\n  // We can't use window.location.hash here because it's not\n  // consistent across browsers - Firefox will pre-decode it!\n  var href = window.location.href;\n  var index = href.indexOf('#');\n  return index === -1 ? '' : decodeURI(href.slice(index + 1))\n}\n\nfunction getUrl (path) {\n  var href = window.location.href;\n  var i = href.indexOf('#');\n  var base = i >= 0 ? href.slice(0, i) : href;\n  return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n  if (supportsPushState) {\n    pushState(getUrl(path));\n  } else {\n    window.location.hash = path;\n  }\n}\n\nfunction replaceHash (path) {\n  if (supportsPushState) {\n    replaceState(getUrl(path));\n  } else {\n    window.location.replace(getUrl(path));\n  }\n}\n\n/*  */\n\nvar AbstractHistory = (function (History$$1) {\n  function AbstractHistory (router, base) {\n    History$$1.call(this, router, base);\n    this.stack = [];\n    this.index = -1;\n  }\n\n  if ( History$$1 ) AbstractHistory.__proto__ = History$$1;\n  AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );\n  AbstractHistory.prototype.constructor = AbstractHistory;\n\n  AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n      this$1.index++;\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  AbstractHistory.prototype.go = function go (n) {\n    var this$1 = this;\n\n    var targetIndex = this.index + n;\n    if (targetIndex < 0 || targetIndex >= this.stack.length) {\n      return\n    }\n    var route = this.stack[targetIndex];\n    this.confirmTransition(route, function () {\n      this$1.index = targetIndex;\n      this$1.updateRoute(route);\n    });\n  };\n\n  AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n    var current = this.stack[this.stack.length - 1];\n    return current ? current.fullPath : '/'\n  };\n\n  AbstractHistory.prototype.ensureURL = function ensureURL () {\n    // noop\n  };\n\n  return AbstractHistory;\n}(History));\n\n/*  */\n\n\n\nvar VueRouter = function VueRouter (options) {\n  if ( options === void 0 ) options = {};\n\n  this.app = null;\n  this.apps = [];\n  this.options = options;\n  this.beforeHooks = [];\n  this.resolveHooks = [];\n  this.afterHooks = [];\n  this.matcher = createMatcher(options.routes || [], this);\n\n  var mode = options.mode || 'hash';\n  this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;\n  if (this.fallback) {\n    mode = 'hash';\n  }\n  if (!inBrowser) {\n    mode = 'abstract';\n  }\n  this.mode = mode;\n\n  switch (mode) {\n    case 'history':\n      this.history = new HTML5History(this, options.base);\n      break\n    case 'hash':\n      this.history = new HashHistory(this, options.base, this.fallback);\n      break\n    case 'abstract':\n      this.history = new AbstractHistory(this, options.base);\n      break\n    default:\n      {\n        assert(false, (\"invalid mode: \" + mode));\n      }\n  }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (\n  raw,\n  current,\n  redirectedFrom\n) {\n  return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n  return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n    var this$1 = this;\n\n  \"development\" !== 'production' && assert(\n    install.installed,\n    \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n    \"before creating root instance.\"\n  );\n\n  this.apps.push(app);\n\n  // main app already initialized.\n  if (this.app) {\n    return\n  }\n\n  this.app = app;\n\n  var history = this.history;\n\n  if (history instanceof HTML5History) {\n    history.transitionTo(history.getCurrentLocation());\n  } else if (history instanceof HashHistory) {\n    var setupHashListener = function () {\n      history.setupListeners();\n    };\n    history.transitionTo(\n      history.getCurrentLocation(),\n      setupHashListener,\n      setupHashListener\n    );\n  }\n\n  history.listen(function (route) {\n    this$1.apps.forEach(function (app) {\n      app._route = route;\n    });\n  });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n  return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n  return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n  return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n  this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n  this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n  this.history.push(location, onComplete, onAbort);\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n  this.history.replace(location, onComplete, onAbort);\n};\n\nVueRouter.prototype.go = function go (n) {\n  this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n  this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n  this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n  var route = to\n    ? to.matched\n      ? to\n      : this.resolve(to).route\n    : this.currentRoute;\n  if (!route) {\n    return []\n  }\n  return [].concat.apply([], route.matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) {\n      return m.components[key]\n    })\n  }))\n};\n\nVueRouter.prototype.resolve = function resolve (\n  to,\n  current,\n  append\n) {\n  var location = normalizeLocation(\n    to,\n    current || this.history.current,\n    append,\n    this\n  );\n  var route = this.match(location, current);\n  var fullPath = route.redirectedFrom || route.fullPath;\n  var base = this.history.base;\n  var href = createHref(base, fullPath, this.mode);\n  return {\n    location: location,\n    route: route,\n    href: href,\n    // for backwards compat\n    normalizedTo: location,\n    resolved: route\n  }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n  this.matcher.addRoutes(routes);\n  if (this.history.current !== START) {\n    this.history.transitionTo(this.history.getCurrentLocation());\n  }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n  list.push(fn);\n  return function () {\n    var i = list.indexOf(fn);\n    if (i > -1) { list.splice(i, 1); }\n  }\n}\n\nfunction createHref (base, fullPath, mode) {\n  var path = mode === 'hash' ? '#' + fullPath : fullPath;\n  return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.0.2';\n\nif (inBrowser && window.Vue) {\n  window.Vue.use(VueRouter);\n}\n\nreturn VueRouter;\n\n})));\n"
  },
  {
    "path": "calllib-v3/web/setting.js",
    "content": "(function (global, factory) {\n  if (typeof exports === 'object' && module !== 'undefined') {\n    module.exports = factory();\n  } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n    define(factory);\n  } else {\n    global.RongCall = global.RongCall || {};\n    global.RongCall.setting = factory();\n  }\n})(this, function () {\n  \n  var ENUM = {};\n\n  ENUM.Events = {\n    INVITE: 'invite',\n    ACCEPT: 'accept',\n    HUNGUP: 'hungup',\n    MEDIA_MODIFY: 'media_modify',\n    MEMBER_MODIFY: 'member_modify',\n\n    RTC_ADDED: 'added',\n    RTC_REMOVED: 'removed',\n    RTC_LEAVE: 'leave'\n  };\n\n  return {\n    appkey: 'appkey',\n    navi: '',\n    server: 'http://localhost:9929',\n    \n    ENUM: ENUM\n  };\n});"
  },
  {
    "path": "calllib-v3/web-ie/README.md",
    "content": "# CallLib IE Web\n\n### 使用说明\n\n1、CallLib IE 接口与 CallLib Web 一致, 可参考[文档](http://127.0.0.1:8000/rtc/calllib/web/summary)\n\n2、CallLib Demo 的运行方法, 可参考[教程](https://tutorials.rongcloud.cn/tutorial/web-calllib-demo#0)\n\n3、IE 插件不强制要求站点为 https\n\n4、IE CallLib 界面需通过 object 标签渲染, 具体见[插件使用](https://docs.rongcloud.cn/rtc/rtclib/ie/plugin)\n\n5、使用 IE CallLib 需要在 init 时传入 engineId 参数\n\n示例:\n\n```js\nvar config = {\n  RongIMLib: RongIMLib,\n  RongRTC: RongRTC,\n  currentUserId: 'userId',\n  engineId: 'RTCEngine' // engineId 为 object 标签 id\n};\nvar callLib = RongCallLib.init(config);\n```\n\n6、IE CallLib 不需要监听 videoWatch, 界面由 object 自动渲染\n"
  },
  {
    "path": "calllib-v3/web-ie/css/main.css",
    "content": "@charset \"UTF-8\";\n/* 超出部分省略 */\n.ellipsis, .rong-dialog-box .rong-dialog-user-list-content span {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\nhtml, body {\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #f5f5f5;\n}\n\n.rong-main {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-box {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-login-inner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.rong-login-inner p {\n  text-align: center;\n  font-size: 20px;\n}\n\n.rong-login-inner input {\n  width: 280px;\n  height: 44px;\n  border: none;\n  border-radius: 10px;\n  display: block;\n  box-sizing: border-box;\n  margin: 17px;\n  padding: 0 15px;\n  font-size: 14px;\n  outline: none;\n}\n\n.rong-login-inner input[type=\"text\"] {\n  border: 1px solid #ddd;\n}\n\n.rong-login-inner input[type=\"button\"] {\n  background-color: #0888ff;\n  color: white;\n}\n\n.rong-info {\n  position: absolute;\n  top: 10px;\n  left: 30px;\n  text-align: left;\n  color: white;\n  z-index: 20;\n}\n\n.rong-info p {\n  font-size: 15px;\n}\n\n.rong-call-box {\n  background-color: black;\n}\n\n.rong-call-box .rong-call-btns {\n  position: absolute;\n  bottom: 32px;\n  left: 50%;\n  transform: translateX(-50%);\n}\n\n.rong-call-box .rong-call-btns button {\n  width: 55px;\n  height: 55px;\n  margin: 0 8px;\n  border-radius: 50%;\n  background-image: url(\"../img/icons.svg\");\n  border: none;\n  outline: none;\n  background-repeat: no-repeat;\n  background-color: rgba(255, 255, 255, 0.87);\n  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n  box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n  cursor: pointer;\n}\n\n.rong-call-box .rong-call-btns button:hover {\n  background-color: rgba(255, 255, 255, 0.7);\n}\n\n.rong-call-box .rong-call-btns .rong-call-hungup {\n  background-position: -66px 15px;\n  background-color: #ef5350;\n}\n\n.rong-call-box .rong-call-btns button.rong-call-hungup:hover {\n  background-color: #EF5360;\n}\n\n.rong-call-box .rong-call-btns .rong-call-accept {\n  background-color: #008700;\n  background-position: 14px 15px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-accept:hover {\n  background-color: #00a000;\n}\n\n.rong-call-box .rong-call-btns .rong-call-mute {\n  background-position: 15px -154px;\n  background-size: 112px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-mute[closed] {\n  background-position: -68px -154px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-video {\n  background-position: 12px -30px;\n  background-size: 102px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-video[closed] {\n  background-position: -61px -30px;\n  background-size: 102px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-audio {\n  background-position: 17px -93px;\n  background-size: 111px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-invite {\n  background-position: 13px -310px;\n}\n\n.rong-type-box {\n  color: white;\n  position: absolute;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 20px;\n  z-index: 30;\n}\n\n.rong-video-box {\n  position: absolute;\n  top: 90px;\n  bottom: 100px;\n  left: 0;\n  width: 100%;\n  z-index: 10;\n}\n\n.rong-video-box .rong-stream-content {\n  width: 100%;\n  height: 100%;\n  z-index: 10;\n}\n\n.rong-video-box .rong-video-list {\n  width: calc(100% - 200px);\n  height: 150px;\n  position: absolute;\n  right: 0;\n  z-index: 10;\n  margin-top: 10px;\n}\n\n.rong-video-box .rong-video-list .rong-video-min {\n  display: inline-block;\n  width: 190px;\n  height: 100%;\n  position: relative;\n  margin: 0 15px;\n  border: 1px solid white;\n}\n\n.rong-video-box .rong-video-list video {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max {\n  width: 100%;\n  height: 100%;\n  position: absolute;\n}\n\n.rong-video-box .rong-video-max video {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"], .rong-video-box .rong-video-min[talktype=\"0\"] {\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"] video, .rong-video-box .rong-video-min[talktype=\"0\"] video {\n  display: none;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"]::before, .rong-video-box .rong-video-min[talktype=\"0\"]::before {\n  content: '摄像头已关闭';\n  color: white;\n  font-size: 18px;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.rong-video-box .rong-video-min[talktype=\"0\"]::before {\n  font-size: 15px;\n}\n\n.rong-dialog-box {\n  position: fixed;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  opacity: 1;\n  z-index: 500;\n  color: #333;\n}\n\n.rong-dialog-box .rong-dialog-user-list {\n  position: fixed;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 45px;\n  background-color: #fefefe;\n  border: 1px solid #e6e6e6;\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 20px 20px 12px 20px;\n  z-index: 12;\n  font-weight: 400;\n  width: 252px;\n}\n\n.rong-dialog-box .rong-dialog-user-list h3 {\n  margin: 0;\n  font-size: 15px;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content {\n  margin: 15px 0;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content .rong-dialog-user {\n  display: inline-block;\n  width: 50%;\n  margin: 4px 0;\n  line-height: 1;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content i {\n  display: inline-block;\n  width: 12px;\n  height: 12px;\n  border: 1px solid #B2B2B2;\n  background-color: white;\n  margin-right: 1px;\n  vertical-align: middle;\n  background-image: url(../img/icons.svg);\n}\n\n.rong-dialog-box .rong-dialog-user-list-content i.rong-user-selected {\n  background-color: transparent;\n  background-position: 0px -115px;\n  background-size: 54px;\n  background-repeat: no-repeat;\n  border: 1px solid black;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content span {\n  font-size: 12px;\n  color: #585858;\n  vertical-align: middle;\n  max-width: 96px;\n  display: inline-block;\n}\n\n.rong-dialog-box .rong-confirm-btns {\n  text-align: right;\n}\n\n.rong-dialog-box .rong-confirm-btns button {\n  padding: 0 8px;\n  height: 23px;\n  border: none;\n  font-size: 12px;\n  border-radius: 5px;\n  margin-left: 3px;\n  outline: none;\n}\n\n.rong-dialog-box .rong-confirm-btns .rong-confirm-ok[disabled] {\n  opacity: 0.6;\n}\n\n.rong-dialog-box .rong-confirm-btns .rong-confirm-ok, .rong-dialog-box .rong-confirm-btns .rong-confirm-cancel {\n  background-color: #f9f9f9;\n  border: 1px solid #979797;\n}\n\n.rong-dialog-toast {\n  position: fixed;\n  text-align: center;\n  top: 30px;\n  left: 50%;\n  transform: translateX(-50%);\n  width: auto;\n  padding: 12px 50px;\n  background-color: #fefefe;\n  border: 1px solid #e6e6e6;\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 7px 35px;\n  z-index: 31;\n  font-weight: 400;\n}\n\n.rong-dialog-toast .rong-dialog-toast-content {\n  display: inline-block;\n  font-size: 14px;\n  vertical-align: middle;\n}\n"
  },
  {
    "path": "calllib-v3/web-ie/css/main.scss",
    "content": "/* 超出部分省略 */\n.ellipsis {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\nhtml, body {\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #f5f5f5;\n}\n\n.rong-main {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-box {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-login-inner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  p {\n    text-align: center;\n    font-size: 20px;\n  }\n  input {\n    width: 280px;\n    height: 44px;\n    border: none;\n    border-radius: 10px;\n    display: block;\n    box-sizing: border-box;\n    margin: 17px;\n    padding: 0 15px;\n    font-size: 14px;\n    outline: none;\n  }\n  input[type=\"text\"] {\n    border: 1px solid #ddd;\n  }\n  input[type=\"button\"] {\n    background-color: #0888ff;\n    color: white;\n  }\n}\n\n.rong-info {\n  position: absolute;\n  top: 10px;\n  left: 30px;\n  text-align: left;\n  color: white;\n  z-index: 20;\n  p {\n    font-size: 15px;\n  }\n}\n\n.rong-call-box {\n  background-color: black;\n  .rong-call-btns {\n    position: absolute;\n    bottom: 32px;\n    left: 50%;\n    transform: translateX(-50%);\n    button {\n      width: 55px;\n      height: 55px;\n      margin: 0 8px;\n      border-radius: 50%;\n      background-image: url('../img/icons.svg');\n      border: none;\n      outline: none;\n      background-repeat: no-repeat;\n      background-color: rgba(255, 255, 255, 0.87);\n      transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n      box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12);\n      cursor: pointer;\n    }\n    button:hover {\n      background-color: rgba(255, 255, 255, 0.7);\n    }\n    .rong-call-hungup {\n      background-position: -66px 15px;\n      background-color: #ef5350;\n    }\n    button.rong-call-hungup:hover {\n      background-color: #EF5360;\n    }\n    .rong-call-accept {\n      background-color: rgb(0, 135, 0);\n      background-position: 14px 15px;\n    }\n    .rong-call-accept:hover {\n      background-color: rgb(0, 160, 0);\n    }\n    .rong-call-mute {\n      background-position: 15px -154px;\n      background-size: 112px;\n    }\n    .rong-call-mute[closed] {\n      background-position: -68px -154px;\n    }\n    .rong-call-video {\n      background-position: 12px -30px;\n      background-size: 102px;\n    }\n    .rong-call-video[closed] {\n      background-position: -61px -30px;\n      background-size: 102px;\n    }\n    .rong-call-audio {\n      background-position: 17px -93px;\n      background-size: 111px;\n    }\n    .rong-call-invite {\n      background-position: 13px -310px;\n    }\n  }\n}\n.rong-type-box {\n  color: white;\n  position: absolute;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 20px;\n  z-index: 30;\n}\n\n.rong-video-box {\n  position: absolute;\n  top: 90px;\n  bottom: 100px;\n  left: 0;\n  width: 100%;\n  // height: 100%;\n  z-index: 10;\n  .rong-stream-content {\n    width: 100%;\n    height: 100%;\n    z-index: 10;\n    // background-color: red;\n  }\n  .rong-video-list {\n    width: calc(100% - 200px);\n    height: 150px;\n    position: absolute;\n    right: 0;\n    z-index: 10;\n    margin-top: 10px;\n    .rong-video-min {\n      display: inline-block;\n      width: 190px;\n      height: 100%;\n      position: relative;\n      margin: 0 15px;\n      border: 1px solid white;\n    }\n    video {\n      position: absolute;\n      width: 100%;\n      height: 100%;\n      background-color: black;\n    }\n  }\n  .rong-video-max {\n    width: 100%;\n    height: 100%;\n    position: absolute;\n    video {\n      position: absolute;\n      width: 100%;\n      height: 100%;\n      background-color: black;\n    }\n  }\n  .rong-video-max[talktype=\"0\"], .rong-video-min[talktype=\"0\"] {\n    background-color: black;\n    video {\n      display: none;\n    }\n    &::before {\n      content: '摄像头已关闭';\n      color: white;\n      font-size: 18px;\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate(-50%, -50%);\n    }\n  }\n  .rong-video-min[talktype=\"0\"]::before {\n    font-size: 15px;\n  }\n}\n\n.rong-dialog-box {\n  position: fixed;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  opacity: 1;\n  z-index: 500;\n  color: #333;\n  .rong-dialog-user-list {\n    position: fixed;\n    left: 50%;\n    transform: translateX(-50%);\n    top: 45px;\n    background-color: rgb(254, 254, 254);\n    border: 1px solid rgb(230, 230, 230);\n    border-radius: 5px;\n    box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n    padding: 20px 20px 12px 20px;\n    z-index: 12;\n    font-weight: 400;\n    width: 252px;\n    h3 {\n      margin: 0;\n      font-size: 15px;\n    }\n  }\n  .rong-dialog-user-list-content {\n    margin: 15px 0;\n    .rong-dialog-user {\n      display: inline-block;\n      width: 50%;\n      margin: 4px 0;\n      line-height: 1;\n    }\n    i {\n      display: inline-block;\n      width: 12px;\n      height: 12px;\n      border: 1px solid #B2B2B2;\n      background-color: white;\n      margin-right: 1px;\n      vertical-align: middle;\n      background-image: url(../img/icons.svg);\n    }\n    i.rong-user-selected {\n      background-color: transparent;\n      background-position: 0px -115px;\n      background-size: 54px;\n      background-repeat: no-repeat;\n      border: 1px solid black;\n    }\n    span {\n      font-size: 12px;\n      color: rgb(88, 88, 88);\n      vertical-align: middle;\n      max-width: 96px;\n      display: inline-block;\n      @extend .ellipsis;\n    }\n  }\n  .rong-confirm-btns {\n    text-align: right;\n    button {\n      padding: 0 8px;\n      height: 23px;\n      border: none;\n      font-size: 12px;\n      border-radius: 5px;\n      margin-left: 3px;\n      outline: none;\n    }\n    .rong-confirm-ok[disabled] {\n      opacity: 0.6;\n    }\n    .rong-confirm-ok, .rong-confirm-cancel {\n      background-color: rgb(249, 249, 249);\n      border: 1px solid rgb(151, 151, 151);\n    }\n  }\n}\n\n.rong-dialog-toast {\n  position: fixed;\n  text-align: center;\n  top: 30px;;\n  left: 50%;\n  transform: translateX(-50%);\n  width: auto;\n  // top: 116px;\n  padding: 12px 50px;\n  background-color: rgb(254, 254, 254);\n  border: 1px solid rgb(230, 230, 230);\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 7px 35px;\n  z-index: 31;\n  font-weight: 400;\n  .rong-dialog-toast-content {\n    display: inline-block;\n    font-size: 14px;\n    vertical-align: middle;\n  }\n}\n"
  },
  {
    "path": "calllib-v3/web-ie/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>Rong CallLib Demo</title>\n  <link rel=\"stylesheet\" href=\"./css/main.min.css\">\n\n  <!-- 配置文件 -->\n  <script src=\"setting.js\"></script>\n\n  <script src=\"./lib/promise.js\"></script>\n  <script src=\"./lib/vue-2.6.7.js\"></script>\n  <script src=\"./lib/vue-router-3.0.2.js\"></script>\n  <script src=\"./lib/RongRTC-IE-3.0.4.js\"></script>\n  <script src=\"./lib/RongIMLib-2.5.1.js\"></script>\n  <script src=\"./lib/RongCallLib.3.1.5.js\"></script>\n  \n  <script src=\"./js/common/utils.js\"></script>\n  <script src=\"./js/common/init.js\"></script>\n\n  <script src=\"./js/dialog.js\"></script>\n  <script src=\"./js/login.js\"></script>\n  <script src=\"./js/call.js\"></script>\n  <script src=\"./js/main.js\"></script>\n\n  <!-- 登录页面模板 -->\n  <script id=\"rong-template-login\" type=\"text/x-template\">\n    <div class=\"rong-box\">\n      <div class=\"rong-login-inner\">\n        <p>融云 CallLib</p>\n        <input v-model=\"userId\" type=\"text\" placeholder=\"请输入 userId\" @keyup.13=\"login\">\n        <input v-if=\"isLoading\" type=\"button\" value=\"正在登陆 ...\" disabled>\n        <input v-else type=\"button\" value=\"登陆\" @click=\"login\">\n      </div>\n    </div>\n  </script>\n\n  <!-- 通话界面模板 -->\n  <script id=\"rong-template-call\" type=\"text/x-template\">\n    <div class=\"rong-box rong-call-box\">\n      <div class=\"rong-info\">\n        <p>登录用户 id: <span>{{$route.params.userId}}</span></p>\n        <p>群组 id: <span>{{$route.params.groupId}}</span></p>\n      </div>\n      <div class=\"rong-type-box\" v-if=\"callStep === CallStep.READY_TO_CALL\">\n        <label for=\"\">通话类型: </label>\n        <select name=\"\" id=\"\" v-model=\"callType\">\n          <option value=\"1\">单人</option>\n          <option value=\"3\">群组</option>\n        </select>\n      </div>\n      <div class=\"rong-video-box\">\n        <object :style=\"engineStyle\" class=\"rong-stream-content\" id=\"RTCEngine\" width=640 height=480 classid=\"CLSID:369C2ABD-E339-42C8-B302-9652E3936E28\"></object>\n        <!-- <div class=\"rong-video-list\">\n          <div class=\"rong-video-min\" v-for=\"user in minUserList\" v-video=\"user\" :talktype=\"user.talkType\"></div>\n        </div>\n        <div v-if=\"maxUser\" class=\"rong-video-max\" v-video=\"maxUser\" :talktype=\"maxUser.talkType\"></div> -->\n      </div>\n      <div class=\"rong-call-btns\">\n        <template v-if=\"callStep === CallStep.READY_TO_CALL\">\n          <button class=\"rong-call-video\" title=\"点击进行视频通话\" @click=\"startCall(false)\"></button>\n          <button class=\"rong-call-audio\" title=\"点击进行音频通话\" @click=\"startCall(true)\"></button>\n        </template>\n        <template v-else-if=\"callStep === CallStep.CALLING\">\n          <button class=\"rong-call-hungup\" title=\"点击挂断\" @click=\"hungup\"></button>\n          <button v-if=\"callType == 3\" class=\"rong-call-invite\" title=\"点击邀请\" @click=\"invite\"></button>\n          <button class=\"rong-call-mute\" title=\"点击开启/关闭音频\" :closed=\"isMuted\" @click=\"mute\"></button>\n          <button class=\"rong-call-video\" closed title=\"点击开启/关闭视频\" :closed=\"callInfo.mediaType !== 2\" @click=\"setVideo\"></button>\n        </template>\n        <template v-else-if=\"callStep === CallStep.INVITED_TO_ANSWER\">\n          <button class=\"rong-call-accept\" @click=\"accept\"></button>\n          <button class=\"rong-call-hungup\" @click=\"reject\"></button>\n        </template>\n        <!-- <iframe id=\"iframe1\" src=\"about:blank\" frameBorder=\"0\" marginHeight=\"0\" marginWidth=\"0\"\n　　style=\"position:absolute; visibility:inherit; top:0px;left:0px;width:120px; height:120px;z-index:-1; filter:alpha(opacity=0);\"></iframe> -->\n      </div>\n    </div>\n  </script>\n\n  <!-- 选择人员弹框 -->\n  <script id=\"rong-template-dialog-users\" type=\"text/x-template\">\n    <div v-if=\"isShow\" class=\"rong-dialog-box\">\n      <div class=\"rong-dialog-user-list\">\n        <h3>选择人员</h3>\n        <div class=\"rong-dialog-user-list-content\">\n          <div class=\"rong-dialog-user\" v-for=\"user in userList\" @click=\"selectUser(user)\">\n            <i :class=\"{ 'rong-user-selected': user.isSelected }\"></i>\n            <span>{{user.userId || user.id}}</span>\n          </div>\n        </div>\n        <div class=\"rong-confirm-btns\">\n          <button class=\"rong-confirm-cancel\" @click=\"cancel\">取消</button>\n          <button class=\"rong-confirm-ok\" @click=\"confirm\" :disabled=\"!hasSelectedUser\">确认</button>\n        </div>\n      </div>\n    </div>\n  </script>\n\n  <script id=\"rong-template-dialog-toast\" type=\"text/x-template\">\n    <div class=\"rong-dialog-toast\">\n      <span class=\"rong-dialog-toast-content\">{{content}}</span>\n    </div>\n  </script>\n\n\n  \n</head>\n<body>\n  <div id=\"rongCall\" class=\"rong-main\">\n    <router-view></router-view>\n  </div>\n</body>\n\n<script>\n  // 方法定义见: js/main.js\n  RongCall.init({\n    el: '#rongCall'\n  })\n</script>\n\n</html>"
  },
  {
    "path": "calllib-v3/web-ie/js/call.js",
    "content": "(function (RongCall, dependencies) {\n  /* 通话逻辑 */\n\n  var win = dependencies.win,\n    Vue = win.Vue,\n    RongIMLib = win.RongIMLib,\n    RongCallLib = win.RongCallLib,\n    RongIMClient = RongIMLib.RongIMClient,\n    utils = RongCall.utils,\n    EventEmitter = utils.EventEmitter;\n\n  var toast = utils.toast,\n    dialog = RongCall.dialog,\n    ConversationType = RongIMLib.ConversationType,\n    MediaType = RongIMLib.VoIPMediaType;\n\n  // 通话阶段\n  var CallStep = {\n    READY_TO_CALL: 1, // 准备拨打(最初状态)\n    INVITED_TO_ANSWER: 2, // 被邀请接听, 其他人拨打, 己方选择接听或拒绝\n    CALLING: 3 // 拨打中\n  };\n\n  var CallName = {};\n  CallName[MediaType.MEDIA_AUDIO] = '语音';\n  CallName[MediaType.MEDIA_VEDIO] = '视频';\n\n  // 将消息转化为调用 CallLib 需要参数\n  function messageToCallInfo(message) {\n    return {\n      conversationType: message.conversationType,\n      targetId: message.targetId,\n      mediaType: message.content.mediaType\n    };\n  }\n  \n  // 获取挂断原因\n  function getHungupReason(reason, message) {\n    var reasonPrompt;\n    var senderUserId = message.senderUserId;\n    switch(reason) {\n    case 8:\n      reasonPrompt = '其他设备已处理';\n      break;\n    case 11:\n      reasonPrompt = senderUserId + '已取消';\n      break;\n    case 12:\n      reasonPrompt = senderUserId + '已拒绝';\n      break;\n    case 13:\n      reasonPrompt = senderUserId + '已挂断';\n      break;\n    case 14:\n      reasonPrompt = senderUserId + '忙碌中';\n      break;\n    case 15:\n      reasonPrompt = senderUserId + '未接听';\n      break;\n    default:\n      reasonPrompt = '未知原因挂断';\n    }\n    return reasonPrompt;\n  }\n\n  // 己方挂断后的提示\n  function getSummaryText(status, message) {\n    var senderUserId = message.senderUserId;\n    var text;\n    switch(status) {\n    case 1:\n      text = '己方已取消';\n      break;\n    case 2:\n      text = '己方已拒绝';\n      break;\n    case 3:\n      text = '己方挂断';\n      break;\n    case 4:\n      text = '收到' + senderUserId + '的音视频邀请, 但己方忙碌中, 不处理';\n      break;\n    case 5:\n      text = '己方未接听';\n      break;\n    case 7:\n      text = '己方网络错误';\n      break;\n    default:\n      text = '未知原因';\n    }\n    return text;\n  }\n\n  function mediaTypeToTalkType(mediaType) {\n    return mediaType === MediaType.MEDIA_AUDIO ? 0 : 1;\n  }\n\n  var InviteTpl = '{senderUserId} 邀请您进行 {mediaType} 通话{type}';\n  var commandEvents = {\n    // 监听其他人邀请自己\n    InviteMessage: function (message, context) {\n      var conversationType = message.conversationType === ConversationType.PRIVATE ? '单聊' : '群聊';\n      toast(utils.tplEngine(InviteTpl, {\n        senderUserId: message.senderUserId,\n        mediaType: CallName[message.content.mediaType],\n        type: conversationType\n      }));\n      context.callInfo = messageToCallInfo(message);\n      context.callStep = CallStep.INVITED_TO_ANSWER;\n    },\n    MemberModifyMessage: function (message, context) {\n      if (message.content.inviteUserIds.indexOf(context.selfUserId) !== -1) {\n        var conversationType = message.conversationType === ConversationType.PRIVATE ? '单聊' : '群聊';\n        toast(utils.tplEngine(InviteTpl, {\n          senderUserId: message.senderUserId,\n          mediaType: CallName[message.content.mediaType],\n          type: conversationType\n        }));\n        context.callInfo = messageToCallInfo(message);\n        context.callStep = CallStep.INVITED_TO_ANSWER;\n      }\n    },\n    HungupMessage: function (message) {\n      var reason = getHungupReason(message.content.reason, message);\n      toast(reason);\n    },\n    MediaModifyMessage: function (message, context) {\n      var senderUserId = message.senderUserId,\n        mediaType = message.content.mediaType;\n      context.userList.forEach(function (user) {\n        if (user.userId === senderUserId) {\n          user.talkType = mediaTypeToTalkType(mediaType);\n        }\n      });\n    },\n    SummaryMessage: function (message, context) {\n      var status = message.content.status;\n      var promptText = getSummaryText(status, message);\n      if (context.callStep === CallStep.CALLING) {\n        toast(promptText);\n      }\n      if (status === 5 || status === 7) { // 自己未接听|自己网络错误, 回到初始状态\n        context.callStep = CallStep.READY_TO_CALL;\n      }\n    }\n  };\n\n  var videoChangedEvents = {\n    added: function (detail, context) {\n      context.userList.push(detail);\n    },\n    removed: function (detail, context) {\n      context.userList = utils.removeArray(detail, context.userList, 'userId');\n    },\n    leave: function (detail, context) {\n      context.userList = [];\n    }\n  };\n\n  function getMembers(currentUserList, selfUserId) {\n    return utils.getMembers().then(function (members) {\n      members = members.filter(function (user) {\n        var currentUserIds = currentUserList.map(function (user) {\n          return user.id || user.userId;\n        });\n        return user.id !== selfUserId && currentUserIds.indexOf(user.id) === -1;\n      });\n      return RongCall.Promise.resolve(members);\n    });\n  }\n\n  function call(callParams) {\n    var context = this;\n    RongCallLib.call(callParams, function (error) {\n      // 置为通话中状态\n      context.callStep = error ? context.callStep : CallStep.CALLING;\n    });\n    context.callInfo = callParams;\n  }\n\n  function accept() {\n    var context = this;\n    var callInfo = context.callInfo; // callInfo 在监听到 InviteMessage 时赋值, 格式见 messageToCallInfo 方法\n    RongCallLib.accept(callInfo, function (error) {\n      // 置为通话中状态\n      context.callStep = error ? context.callStep : CallStep.CALLING;\n    });\n  }\n\n  function invite() {\n    var context = this;\n    var callInfo = context.callInfo,\n      inviteParams = {\n        conversationType: ConversationType.GROUP,\n        targetId: callInfo.targetId,\n        inviteUserIds: [],\n        mediaType: callInfo.mediaType\n      };\n    var inviteUserIds = win.prompt('请输入被邀请人 id(id 间用 , 分割): ');\n    inviteUserIds = inviteUserIds.split(',');\n    inviteUserIds = inviteUserIds.map(function (userId) {\n      return userId.replace(/\\s/g, '');\n    });\n    inviteParams.inviteUserIds = inviteUserIds;\n    RongCallLib.invite(inviteParams);\n    // getMembers(context.userList, context.selfUserId).then(function (members) {\n    //   dialog.selectUser({\n    //     userList: members,\n    //     confirmed: function (selectedUserList) {\n    //       var selectedIds = selectedUserList.map(function (user) {\n    //         return user.id;\n    //       });\n    //       inviteParams.inviteUserIds = selectedIds;\n    //       RongCallLib.invite(inviteParams);\n    //     }\n    //   });\n    // }).catch(function () {\n    //   toast('获取群组成员失败');\n    // });\n  }\n\n  function reject() {\n    var context = this;\n    var callInfo = context.callInfo; // callInfo 在监听到 InviteMessage 时赋值, 格式见 messageToCallInfo 方法\n    RongCallLib.reject(callInfo, function (error) {\n      // 置为最初的准备拨打状态\n      context.callStep = error ? context.callStep : CallStep.READY_TO_CALL;\n    });\n  }\n\n  function hungup() {\n    var context = this;\n    // clearTimeout(context.hungupTimeout);\n    var callInfo = context.callInfo;\n    context.callStep = CallStep.READY_TO_CALL;\n    RongCallLib.hungup(callInfo, function (error) {\n      console.log('hungup result', error);\n    });\n  }\n\n  function mute() {\n    var isMuted = this.isMuted;\n    var event = isMuted ? RongCallLib.unmute : RongCallLib.mute;\n    event();\n    this.isMuted = !isMuted;\n  }\n\n  function setVideo() {\n    var callInfo = this.callInfo,\n      mediaType = callInfo.mediaType;\n    var event = mediaType === MediaType.MEDIA_AUDIO ? RongCallLib.audioToVideo : RongCallLib.videoToAudio;\n    event();\n    this.callInfo.mediaType = mediaType === MediaType.MEDIA_AUDIO ? MediaType.MEDIA_VEDIO : MediaType.MEDIA_AUDIO;\n  }\n\n  RongCall.call = Vue.component('call', {\n    template: '#rong-template-call',\n    data: function () {\n      return {\n        userList: [],\n        callStep: CallStep.READY_TO_CALL,\n        callType: ConversationType.PRIVATE, // 通话类型, 默认为单聊\n        /**\n         * 通话信息. 给 callInfo 赋值的地方有:\n         * 1. 发送 call 成功后, 存储当前通话信息\n         * 2. 接收到 InviteMessage 后, 存储通话信息\n         */\n        callInfo: {},\n        isMuted: false,\n        isNetworkValid: true,\n        hungupTimeout: null\n      };\n    },\n    directives: {\n      video: function (el, binding) {\n        var user = binding.value;\n        var video = user.data;\n        el.appendChild(video);\n        video.play();\n      }\n    },\n    computed: {\n      CallStep: function () {\n        return CallStep;\n      },\n      // 大窗口用户\n      maxUser: function () {\n        var context = this;\n        var maxUser;\n        context.userList.forEach(function (user) {\n          if (user.userId === context.selfUserId) {\n            maxUser = user;\n          }\n        });\n        if (maxUser) {\n          maxUser.talkType = mediaTypeToTalkType(context.callInfo.mediaType);\n        }\n        return maxUser;\n      },\n      // 小窗口用户列表\n      minUserList: function () {\n        var context = this,\n          maxUser = context.maxUser || {};\n        return context.userList.filter(function (user) {\n          return user.userId !== maxUser.userId;\n        });\n      },\n      selfUserId: function () {\n        return this.$route.params.userId;\n      },\n      engineStyle: function () {\n        var isCallling = this.callStep === CallStep.CALLING;\n        return {\n          opacity: isCallling ? 1 : 0\n        }\n      }\n    },\n    methods: {\n      /**\n       * @param {boolean} isOnlyAudio 是否仅以音频发起\n       */\n      startCall: function (isOnlyAudio) {\n        var mediaType = isOnlyAudio ? MediaType.MEDIA_AUDIO : MediaType.MEDIA_VEDIO;\n        if (this.callType == ConversationType.GROUP) {\n          this.startGroupCall(mediaType);\n        } else {\n          this.startPrivateCall(mediaType);\n        }\n      },\n      startPrivateCall: function (mediaType) {\n        var targetId = win.prompt('请输入接收者 id:');\n        if (targetId === this.selfUserId) {\n          return alert('不可呼叫自己');\n        }\n        if (targetId == undefined || targetId === 'undefined') {\n          return alert('请填写正确的接收者 id');\n        }\n        var callParams = {\n          conversationType: ConversationType.PRIVATE,\n          targetId: targetId,\n          inviteUserIds: [targetId],\n          mediaType: mediaType\n        };\n        targetId && this.call(callParams);\n      },\n      startGroupCall: function (mediaType) {\n        var context = this;\n        var params = context.$route.params,\n          groupId = params.groupId;\n\n        var callParams = {\n          conversationType: ConversationType.GROUP,\n          targetId: groupId,\n          inviteUserIds: [],\n          mediaType: mediaType\n        };\n        // groupId = win.prompt('请输入群组 id: ') || groupId;\n        var inviteUserIds = win.prompt('请输入被邀请人 id(id 间用 , 分割): ');\n        inviteUserIds = inviteUserIds.split(',');\n        inviteUserIds = inviteUserIds.map(function (userId) {\n          return userId.replace(/\\s/g, '');\n        });\n        callParams.inviteUserIds = inviteUserIds;\n        context.call(callParams);\n      },\n      call: call,\n      accept: accept,\n      invite: invite,\n      reject: reject,\n      hungup: hungup,\n      mute: mute,\n      setVideo: setVideo\n    },\n    mounted: function () {\n      var context = this;\n      // window.testContext = context;\n\n      EventEmitter.on('NetworkError', function () {\n        if (context.isNetworkValid) {\n          context.isNetworkValid = false;\n          toast('网络已断开');\n          context.hungup();\n        }\n      });\n      EventEmitter.on('NetworkReconnect', function () {\n        context.isNetworkValid = true;\n        // clearTimeout(context.hungupTimeout);\n        if (context.callStep === CallStep.READY_TO_CALL) {\n          context.hungup();\n        }\n      });\n\n      // 初始化\n      RongCallLib = RongCall.initCallLib(context.selfUserId);\n\n      // 注册命令(消息)监听\n      RongCallLib.commandWatch(function (message) {\n        var event = commandEvents[message.messageType];\n        event && event(message, context);\n        console.log('received message', message);\n      });\n\n      // 注册音视频节点监听\n      RongCallLib.videoWatch(function (result) {\n        var event = videoChangedEvents[result.type];\n        event && event(result, context);\n        console.log('video changed', result);\n      });\n    }\n  });\n\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-ie/js/common/init.js",
    "content": "(function (RongCall, dependencies) {\n  var RongIMLib = dependencies.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient,\n    RongCallLib = dependencies.RongCallLib,\n    RongRTC = dependencies.RongRTC;\n\n  var win = dependencies.win;\n\n  var isConnecting = false;\n\n  function reconnect() {\n    console.log('准备重连 isConnecting: ', isConnecting);\n    if (isConnecting) {\n      return;\n    }\n    isConnecting = true;\n    var utils = win.RongCall.utils,\n      EventEmitter = utils.EventEmitter;\n    var callback = {\n      onSuccess: function (userId) {\n        isConnecting = false;\n        EventEmitter.emit('NetworkReconnect');\n      },\n      onTokenIncorrect: function () {\n        isConnecting = false;\n        alert('重连 Token 无效')\n      },\n      onError: function (errorCode) {\n        isConnecting = false;\n        if (errorCode == -1 || errorCode == 3) {\n          reconnect();\n        } else {\n          alert('重连失败');\n        }\n      }\n    };\n    var config = {\n      auto: true,\n      url: 'cdn.ronghub.com/RongIMLib-2.2.6.min.js?d=' + Date.now(),\n      rate: [100, 1000, 1000, 1000, 1000, 1000, 2000, 2000, 2000]\n    };\n    RongIMClient.reconnect(callback, config);\n  }\n\n  /**\n   * \n   * @param {string} params.appkey 融云 appKey\n   * @param {string} params.token 融云 token\n   * @param {string} params.navi navi 地址, 公有云可不配置\n   * @param {string} params.onError navi 地址, 公有云可不配置\n   */\n  var initIM = function (params) {\n    var console = win.console,\n      utils = win.RongCall.utils,\n      EventEmitter = utils.EventEmitter;\n\n    var appKey = params.appkey,\n      token = params.token,\n      navi = params.navi;\n    \n    if (navi) {\n      // 私有云初始化\n      RongIMClient.init(appKey, null, {\n        navi: navi, // 私有云 navi 地址\n        protobuf: './lib/protobuf-2.3.6.min.js'\n      });\n    } else {\n      RongIMClient.init(appKey, null, {\n        protobuf: './lib/protobuf-2.3.6.min.js'\n      });\n    }\n\n    // 设置状态监听器\n    RongIMClient.setConnectionStatusListener({\n      onChanged: function (status) {\n        console.log('status changed', status);\n        switch (status) {\n          case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n            reconnect();\n            EventEmitter.emit('NetworkError');\n            break;\n          case RongIMLib.ConnectionStatus.WEBSOCKET_ERROR:\n            RongIMClient.getInstance().disconnect();\n            reconnect();\n            EventEmitter.emit('NetworkError');\n            break;\n        }\n      }\n    });\n\n    // 设置消息监听器\n    RongIMClient.setOnReceiveMessageListener({\n      onReceived: function (message) {\n        console.log('received message', message, 'is offLineMessage :', message.offLineMessage);\n      }\n    });\n\n    return new RongCall.Promise(function (resolve, reject) {\n      // 连接融云服务器\n      RongIMClient.connect(token, {\n        onSuccess: function (userId) {\n          resolve(userId)\n        },\n        onTokenIncorrect: function () {\n          reject();\n        },\n        onError: function (errorCode) {\n          reject(errorCode);\n        }\n      }, '');\n    });\n  };\n\n  var initCallLib = function (userId) {\n    var config = {\n      RongIMLib: RongIMLib,\n      RongRTC: RongRTC,\n      currentUserId: userId,\n      engineId: 'RTCEngine'\n    };\n    // 初始化 CallLib\n    RongCallLib = RongCallLib.init(config);\n\n    return RongCallLib;\n  };\n\n  RongCall = RongCall || {};\n  RongCall.initIM = initIM;\n  RongCall.initCallLib = initCallLib;\n  \n})(window.RongCall, {\n  win: window,\n  RongIMLib: window.RongIMLib,\n  RongCallLib: window.RongCallLib,\n  RongRTC: window.RongRTC\n});"
  },
  {
    "path": "calllib-v3/web-ie/js/common/utils.js",
    "content": "(function (dependencies) {\n  var win = dependencies.win;\n  var RongCall = win.RongCall || {};\n\n  var noop = function () {};\n\n  var Dom = {\n    get: function (name) {\n      var selector = null;\n      try {\n        selector = win.document.querySelector(name);\n      } catch (e) {\n        // console.error(e);\n      }\n      return selector;\n    },\n    getById: function (id) {\n      return win.document.getElementById(id);\n    },\n    create: function (innerHTML) {\n      var div = win.document.createElement('div');\n      div.innerHTML = innerHTML;\n      return div.children[0];\n    }\n  };\n\n  function tplEngine(temp, data, regexp) {\n    var replaceAction = function (object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n      });\n    };\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  }\n\n  function getBrowser() {\n    var userAgent = navigator.userAgent;\n    var isOpera = userAgent.indexOf('Opera') > -1;\n    var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n    var isEdge = userAgent.indexOf('Edge') > -1;\n    var isFF = userAgent.indexOf('Firefox') > -1;\n    var isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') == -1;\n    var isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge;\n    if (isIE) {\n      var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n      reIE.test(userAgent);\n      var fIEVersion = parseFloat(RegExp['$1']);\n      if (userAgent.indexOf('MSIE 6.0') != -1) {\n        return 'IE6';\n      } else if (fIEVersion == 7) { return 'IE7'; }\n      else if (fIEVersion == 8) { return 'IE8'; }\n      else if (fIEVersion == 9) { return 'IE9'; }\n      else if (fIEVersion == 10) { return 'IE10'; }\n      else if (userAgent.toLowerCase().match(/rv:([\\d.]+)\\) like gecko/)) {\n        return 'IE11';\n      }\n      else { return '0' }//IE版本过低\n    }//isIE end \n    if (isFF) { return 'FF'; }\n    if (isOpera) { return 'Opera'; }\n    if (isSafari) { return 'Safari'; }\n    if (isChrome) { return 'Chrome'; }\n    if (isEdge) { return 'Edge'; }\n  }\n\n  /**\n   * http 请求\n   * @param {object} option \n   * @param {object} option.url 地址\n   * @param {object} option.queryStrings\n   * @param {object} option.headers\n   * @param {object} option.body\n   * @param {object} option.isSync\n   */\n  function ajax(option) {\n    var browser = getBrowser();\n    var isSupportHeaders = browser === 'IE9' || browser === 'IE8' || browser === 'IE7';\n    var getXHR = function () {\n      var xhr = null;\n      var hasXDomain = function () {\n        return (typeof XDomainRequest != 'undefined');\n      };\n      var hasXMLRequest = function () {\n        return (typeof XMLHttpRequest != 'undefined');\n      };\n      if (hasXMLRequest() && !isSupportHeaders) {\n        xhr = new win.XMLHttpRequest();\n      } else if (hasXDomain()) {\n        xhr = new win.XDomainRequest();\n      } else {\n        xhr = new win.ActiveXObject('Microsoft.XMLHTTP');\n      }\n      return xhr;\n    };\n\n    var xhr = getXHR();\n    var method = option.method || 'GET';\n    var url = option.url;\n    var isSync = option.isSync;\n    var queryStrings = option.queryStrings || {};\n    var tpl = '{key}={value}', strings = [];\n    for (var key in queryStrings) {\n      var value = queryStrings[key];\n      var str = tplEngine(tpl, {\n        key: key,\n        value: value\n      });\n      strings.push(str);\n    }\n    queryStrings = strings.join('&');\n    var urlTpl = '{url}?{queryString}';\n    url = tplEngine(urlTpl, {\n      url: url,\n      queryString: queryStrings\n    });\n    xhr.open(method, url);\n\n    var headers = option.headers || {};\n    if (xhr.setRequestHeader) {\n      for (var name in headers) {\n        var header = headers[name];\n        xhr.setRequestHeader(name, header);\n      }\n    }\n\n    var isSuccess = function (xhr) {\n      return /^(200|202|10000)$/.test(xhr.status) || xhr.responseText;\n    };\n    var success = option.success || noop;\n    var fail = option.fail || noop;\n    var onLoad = function () {\n      var result = xhr.responseText;\n      if (isSuccess(xhr)) {\n        success(result);\n      } else {\n        fail(result);\n      }\n    }\n    if ('onload' in xhr) {\n      xhr.onload = onLoad;\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          onLoad();\n        }\n      };\n    }\n    xhr.onerror = function (result) {\n      fail(result);\n    };\n\n    xhr.send(option.body);\n  }\n\n  /* 监听器(观察者模式) */\n  var EventEmitter = (function () {\n    var events = {};\n\n    var on = function (name, event) {\n      var currentEventList = events[name] || [];\n      currentEventList.push(event);\n      events[name] = currentEventList;\n    };\n\n    var off = function (name, event) {\n      if (!event) {\n        delete events[name];\n      } else {\n        var currentEventList = events[name];\n        currentEventList && currentEventList.forEach(function (currentEvent) {\n          if (currentEvent === event) {\n            var index = currentEventList.indexOf(currentEvent);\n            currentEventList.splice(index, 1);\n          }\n        });\n      }\n    };\n\n    var emit = function (name, data) {\n      var currentEventList = events[name] || [];\n      currentEventList.forEach(function (event) {\n        event(data);\n      });\n    };\n\n    var clear = function () {\n      events = {};\n    };\n\n    return {\n      on: on,\n      off: off,\n      emit: emit,\n      clear: clear\n    };\n  })();\n\n  function mountDialog(options) {\n    var Dialog = win.Vue.extend(options);\n    var instance = new Dialog({\n      el: document.createElement('div')\n    });\n    var wrap = document.getElementsByTagName('body')[0];\n    wrap.appendChild(instance.$el);\n    return instance;\n  }\n\n  function removeArray(value, array, removeKey) {\n    var removeKeyList = array.map(function (value) {\n      return value[removeKey];\n    });\n    var index = removeKeyList.indexOf(value[removeKey]);\n    if (index !== -1) {\n      array.splice(index, 1);\n    }\n    return array;\n  }\n\n  function DialogQueue() {\n    this.isRunning = false;\n    this.list = [];\n  }\n  DialogQueue.prototype.add = function (fn) {\n    var context = this;\n    var run = function () {\n      context.isRunning = true;\n      var index = context.list.indexOf(run);\n      context.list.splice(index, 1);\n      var runNext = function () {\n        context.isRunning = false;\n        context.run();\n      };\n      fn(runNext);\n    };\n    context.list.push(run);\n  };\n  DialogQueue.prototype.run = function () {\n    if (this.list.length && !this.isRunning) {\n      var run = this.list[0];\n      run && run();\n    }\n  };\n\n  var toastQueue = new DialogQueue();\n\n  function toast(content) {\n    var destroyTimeout = 3000;\n    var fn = function (runNext) {\n      win.RongCall.dialog.toast({\n        content: content,\n        destroyTimeout: destroyTimeout,\n        onDestoryed: runNext\n      });\n    };\n    toastQueue.add(fn);\n    toastQueue.run();\n  }\n\n  function login(userId) {\n    return new RongCall.Promise(function (resolve, reject) {\n      ajax({\n        url: win.RongCall.setting.server + '/login',\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: win.JSON.stringify({\n          userId: userId\n        }),\n        success: function (result) {\n          resolve(win.JSON.parse(result));\n        },\n        fail: function (err) {\n          reject(err);\n        }\n      });\n    });\n  }\n\n  function getMembers(groupId) {\n    return new RongCall.Promise(function (resolve, reject) {\n      ajax({\n        url: win.RongCall.setting.server + '/getMembers',\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: win.JSON.stringify({\n          groupId: groupId\n        }),\n        success: function (result) {\n          resolve(win.JSON.parse(result).members);\n        },\n        fail: function (err) {\n          reject(err);\n        }\n      });\n    });\n  }\n\n  function compatiblePlaceholder() {\n    if (!('placeholder' in document.createElement('input'))) {\n      // 将返回的nodeList对象转为数组\n      var nodes = Array.prototype.slice.call(document.querySelectorAll('[placeholder]'))\n      nodes.forEach(function (item, index) {\n        item.addEventListener('focus', function () {\n          this.nextSibling.style.display = 'none'\n        })\n        item.addEventListener('blur', function () {\n          if (!this.value) {\n            this.style.display = 'none'\n            this.nextSibling.style.display = 'inline'\n          }\n        })\n        var cloneNode = item.cloneNode()\n        // 如果[type='password']类型，则转为text\n        if (cloneNode.getAttribute('type').toLowerCase() === 'password') {\n          cloneNode.setAttribute('type', 'text')\n        }\n        cloneNode.setAttribute('value', cloneNode.getAttribute('placeholder'))\n        cloneNode.style.display = 'none'\n        item.insertAdjacentHTML('afterend', cloneNode.outerHTML)\n        item.nextSibling.addEventListener('focus', function () {\n          this.style.display = 'none'\n          this.previousSibling.style.display = 'inline'\n          this.previousSibling.focus()\n        })\n        if (!item.value) {\n          item.style.display = 'none'\n          item.nextSibling.style.display = 'inline'\n        }\n      })\n    }\n  }\n\n\n  win.RongCall = RongCall || {};\n  win.RongCall.utils = {\n    Dom: Dom,\n    console: win.console,\n    ajax: ajax,\n    EventEmitter: EventEmitter,\n    mountDialog: mountDialog,\n    removeArray: removeArray,\n    toast: toast,\n    login: login,\n    getMembers: getMembers,\n    tplEngine: tplEngine,\n    compatiblePlaceholder: compatiblePlaceholder\n  };\n\n})({\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-ie/js/dialog.js",
    "content": "(function (RongCall) {\n  /* 弹框 */\n\n  var utils = RongCall.utils;\n\n  function removeSelf($el) {\n    var parent = $el.parentElement;\n    parent.removeChild($el);\n  }\n\n  /* 选择人员弹框 */\n  var selectUser = function (options) {\n    options = options || {};\n\n    var userList = options.userList;\n    userList = userList.map(function (user) {\n      user.isSelected = false;\n      return user;\n    });\n\n    return utils.mountDialog({\n      name: 'rong-select-dialog',\n      template: '#rong-template-dialog-users',\n      data: function () {\n        return {\n          isShow: true,\n          userList: userList\n        };\n      },\n      computed: {\n        hasSelectedUser: function () {\n          var selectedUser = this.userList.filter(function (user) {\n            return user.isSelected;\n          });\n          return selectedUser.length;\n        }\n      },\n      methods: {\n        selectUser: function (user) {\n          user.isSelected = !user.isSelected;\n        },\n        cancel: function () {\n          this.isShow = false;\n          options.canceled && options.canceled();\n        },\n        confirm: function () {\n          var userList = this.userList;\n          userList = userList.filter(function (user) {\n            return user.isSelected;\n          });\n          options.confirmed && options.confirmed(userList);\n          this.isShow = false;\n        }\n      },\n      watch: {\n        isShow: function (isShow) {\n          !isShow && removeSelf(this.$el);\n        }\n      }\n    });\n  };\n\n  /* 提示弹框 */\n  var toast = function (options) {\n    options = options || {};\n\n    return utils.mountDialog({\n      name: 'rong-toast-dialog',\n      template: '#rong-template-dialog-toast',\n      data: function () {\n        return {\n          isShow: true,\n          content: options.content\n        };\n      },\n      watch: {\n        isShow: function (isShow) {\n          !isShow && removeSelf(this.$el);\n        }\n      },\n      mounted: function () {\n        var context = this;\n        setTimeout(function () {\n          if (context.isShow) {\n            context.isShow = false;\n            options && options.onDestoryed();\n          }\n        }, options.destroyTimeout || 5000);\n      }\n    });\n  };\n\n  RongCall.dialog = {\n    selectUser: selectUser,\n    toast: toast\n  };\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-ie/js/login.js",
    "content": "(function (RongCall, dependencies) {\n  /* 登录逻辑 */\n\n  var win = dependencies.win,\n    Vue = win.Vue;\n  var utils = RongCall.utils,\n    setting = RongCall.setting;\n\n  function toInfoPage(data) {\n    var instance = RongCall.instance;\n    instance.$router.push({\n      name: 'call',\n      params: data\n    });\n  }\n  RongCall.login = Vue.component('login', {\n    template: '#rong-template-login',\n    data: function () {\n      return {\n        userId: '',\n        isLoading: false\n      };\n    },\n    methods: {\n      login: function () {\n        var context = this;\n        if (context.isLoading) {\n          return;\n        }\n        context.isLoading = true;\n        var userId = context.userId;\n        var loginDetail;\n        utils.login(userId).then(function (result) {\n          setting.token = result.token;\n          loginDetail = result;\n          return RongCall.initIM(setting);\n        }).then(function () {\n          RongCall.instance.auth = loginDetail;\n          toInfoPage(loginDetail);\n        }).catch(function () {\n          context.isLoading = false;\n          win.alert('登录失败, 请检查 CallLib Demo Server 是否启动');\n        });\n      }\n    },\n    mounted: function () {\n      utils.compatiblePlaceholder();\n    }\n  });\n\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-ie/js/main.js",
    "content": "(function (RongCall, dependencies) {\n  'use strict';\n\n  var Vue = dependencies.Vue,\n    VueRouter = dependencies.VueRouter;\n\n  function getRouter() {\n    var router = new VueRouter({\n      routes: [\n        {\n          path: '/login',\n          name: 'login',\n          component: RongCall.login\n        },\n        {\n          path: '/call',\n          name: 'call',\n          component: RongCall.call\n        },\n        {\n          path: '*',\n          redirect: '/login'\n        }\n      ]\n    });\n    router.beforeEach(function (to, from, next) {\n      var ignoreAuthRoutes = ['login'];\n      var toName = to.name;\n      var instance = RongCall.instance || {};\n      var auth = instance.auth;\n      if (ignoreAuthRoutes.indexOf(toName) === -1 && !auth) {\n        return next({ name: 'login' });\n      }\n      next();\n    });\n    return router;\n  }\n\n  function init(config) {\n    RongCall.instance = new Vue({\n      el: config.el,\n      router: getRouter()\n    });\n  }\n\n  RongCall.init = init;\n\n})(window.RongCall, {\n  win: window,\n  Vue: window.Vue,\n  VueRouter: window.VueRouter\n});"
  },
  {
    "path": "calllib-v3/web-ie/lib/RongCallLib.3.1.5.js",
    "content": "/*\n* RongCallLib.js v3.1.5\n* Release Date: Tue Sep 17 2019 10:09:49 GMT+0800 (China Standard Time)\n* Copyright 2019 RongCloud\n* Released under the MIT License.\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongCallLib = factory());\n}(this, (function () { 'use strict';\n\n  var deviceEnable = {\n    camera: true\n  };\n\n  var noop = function noop() {};\n  var isObject = function isObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  };\n  var isArray = function isArray(arr) {\n    return Object.prototype.toString.call(arr) === '[object Array]';\n  };\n  var ObserverList = function ObserverList() {\n    var checkIndexOutBound = function checkIndexOutBound(index, bound) {\n      return index > -1 && index < bound;\n    };\n\n    this.observerList = [];\n\n    this.add = function (observer, force) {\n      force && (this.observerList.length = 0);\n      this.observerList.push(observer);\n    };\n\n    this.get = function (index) {\n      if (checkIndexOutBound(index, this.observerList.length)) {\n        return this.observerList[index];\n      }\n    };\n\n    this.count = function () {\n      return this.observerList.length;\n    };\n\n    this.removeAt = function (index) {\n      checkIndexOutBound(index, this.observerList.length) && this.observerList.splice(index, 1);\n    };\n\n    this.remove = function (observer) {\n      if (!observer) {\n        this.observerList.length = 0;\n        return;\n      }\n      observer = Object.prototype.toString.call(observer) == '[object Function]' ? [observer] : observer;\n      for (var i = 0, len = this.observerList.length; i < len; i++) {\n        if (this.observerList[i] === observer[i]) {\n          this.removeAt(i);\n          break;\n        }\n      }\n    };\n\n    this.notify = function (val) {\n      for (var i = 0, len = this.observerList.length; i < len; i++) {\n        this.observerList[i](val);\n      }\n    };\n\n    this.indexOf = function (observer, startIndex) {\n      var i = startIndex || 0,\n          len = this.observerList.length;\n      while (i < len) {\n        if (this.observerList[i] === observer) {\n          return i;\n        }\n        i++;\n      }\n      return -1;\n    };\n  };\n\n  var cache = function cache() {\n    var session = {};\n\n    var set = function set(key, value) {\n      session[key] = value;\n    };\n\n    var get = function get(key) {\n      return session[key];\n    };\n\n    var remove = function remove(key) {\n      delete session[key];\n    };\n\n    var update = function update(key, value) {\n      set(key, value);\n    };\n\n    var clear = function clear() {\n      session = {};\n    };\n    return {\n      set: set,\n      get: get,\n      update: update,\n      remove: remove,\n      clear: clear\n    };\n  };\n\n  var forEach = function forEach(arrs, callback) {\n    callback = callback || noop;\n    var forObj = function forObj() {\n      for (var key in arrs) {\n        callback(arrs[key], key, arrs);\n      }\n    };\n    var forArrs = function forArrs() {\n      for (var i = 0; i < arrs.length; i++) {\n        callback(arrs[i], i, arrs);\n      }\n    };\n    var isArr = isArray(arrs);\n    var exec = isArr ? forArrs : forObj;\n    exec();\n  };\n\n  var extend = function extend(target, source) {\n    for (var key in source) {\n      target[key] = source[key];\n    }\n    return target;\n  };\n\n  var isNumber = function isNumber(num) {\n    return Object.prototype.toString.call(num) == '[object Number]';\n  };\n\n  var array2Obj = function array2Obj(arrs) {\n    var obj = {};\n    forEach(arrs, function (item) {\n      obj[item] = item;\n    });\n    return obj;\n  };\n\n  var getBrowser = function getBrowser() {\n    var userAgent = navigator.userAgent;\n    var version;\n    var type;\n\n    /* 记录各浏览器名字和匹配条件 */\n    var condition = {\n      IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n      Edge: /Edge\\/([\\d.]+)/,\n      Firefox: /Firefox\\/([\\d.]+)/,\n      Opera: /(?:OPERA|OPR).([\\d.]+)/,\n      WeChat: /MicroMessenger/i,\n      QQBrowser: /QQBrowser\\/([\\d.]+)/,\n      Chrome: /Chrome\\/([\\d.]+)/,\n      Safari: /Version\\/([\\d.]+).*Safari/,\n      iOSChrome: /Mobile\\/([\\d.]+).*Safari/\n    };\n\n    for (var key in condition) {\n      if (!condition.hasOwnProperty(key)) continue;\n      var browserContent;\n      if (browserContent = userAgent.match(condition[key])) {\n        type = key;\n        version = browserContent[1] || browserContent[2];\n        break;\n      }\n    }\n    return {\n      type: type ? type : 'UnKonw',\n      version: version ? version : 'UnKonw'\n    };\n  };\n\n  var isSupportedBrowser = function isSupportedBrowser() {\n    var browser = getBrowser();\n    var browserType = browser.type;\n    var supportList = ['Chrome', 'Safari', 'IE'];\n    return supportList.indexOf(browserType) !== -1;\n  };\n\n  var isSupportedPlatform = function isSupportedPlatform() {\n    var userAgentInfo = navigator.userAgent;\n    var Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];\n    var flag = true;\n    for (var v = 0; v < Agents.length; v++) {\n      if (userAgentInfo.indexOf(Agents[v]) > 0) {\n        flag = false;\n        break;\n      }\n    }\n    return flag;\n  };\n\n  var isSupportedProtocol = function isSupportedProtocol() {\n    var hostname = location.hostname,\n        protocol = location.protocol;\n    var browser = getBrowser();\n    if (browser.type === 'IE') {\n      return true;\n    }\n    return hostname === 'localhost' || hostname === '127.0.0.1' || protocol.indexOf('https') !== -1;\n  };\n\n  var getVideoAudioStream = function getVideoAudioStream(videoWidth, videoHeight) {\n    var videoConfig = true;\n    if (videoWidth && videoHeight) {\n      videoConfig = {\n        width: videoWidth,\n        height: videoHeight\n      };\n    }\n    return navigator.mediaDevices.getUserMedia({ video: videoConfig, audio: true }).then(function (mediaStream) {\n      return mediaStream;\n    }, function () {\n      return navigator.mediaDevices.getUserMedia({ video: true, audio: false });\n    }).then(function (mediaStream) {\n      return mediaStream;\n    }, function () {\n      return navigator.mediaDevices.getUserMedia({ video: false, audio: true });\n    });\n  };\n\n  var getAudioStream = function getAudioStream() {\n    return navigator.mediaDevices.getUserMedia({ video: true, audio: true }).then(function (mediaStream) {\n      var videoTracks = mediaStream.getVideoTracks();\n      for (var i = 0, max = videoTracks.length; i < max; i++) {\n        videoTracks[i].enabled = false;\n      }\n      return Promise.resolve(mediaStream);\n    }, function () {\n      deviceEnable.camera = false;\n      return navigator.mediaDevices.getUserMedia({ video: false, audio: true });\n    });\n  };\n\n  var util = {\n    noop: noop,\n    ObserverList: ObserverList,\n    cache: cache,\n    forEach: forEach,\n    extend: extend,\n    array2Obj: array2Obj,\n    isNumber: isNumber,\n    isArray: isArray,\n    isObject: isObject,\n    isSupportedBrowser: isSupportedBrowser,\n    isSupportedPlatform: isSupportedPlatform,\n    isSupportedProtocol: isSupportedProtocol,\n    console: console,\n    getVideoAudioStream: getVideoAudioStream,\n    getAudioStream: getAudioStream,\n    deviceEnable: deviceEnable\n  };\n\n  var RongIMLib = void 0;\n  var RongRTC = void 0;\n\n  var getRongIMLib = function getRongIMLib() {\n    return RongIMLib;\n  };\n\n  var setRongIMLib = function setRongIMLib(lib) {\n    RongIMLib = lib;\n  };\n\n  var getRongRTC = function getRongRTC() {\n    return RongRTC;\n  };\n\n  var setRongRTC = function setRongRTC(lib) {\n    RongRTC = lib;\n  };\n\n  var module$1 = {\n    getRongIMLib: getRongIMLib,\n    setRongIMLib: setRongIMLib,\n    getRongRTC: getRongRTC,\n    setRongRTC: setRongRTC\n  };\n\n  var Reason = {\n    CANCEL1: {\n      code: 1,\n      info: '己方取消已发出的通话请求'\n    },\n    REJECT2: {\n      code: 2,\n      info: '己方拒绝收到的通话请求'\n    },\n    HANGUP3: {\n      code: 3,\n      info: '己方挂断'\n    },\n    BUSYLINE4: {\n      code: 4,\n      info: '己方忙碌'\n    },\n    NO_RESPONSE5: {\n      code: 5,\n      info: '己方未接听'\n    },\n    ENGINE_UN_SUPPORTED6: {\n      code: 6,\n      info: '己方不支持当前引擎'\n    },\n    NETWORK_ERROR7: {\n      code: 7,\n      info: '己方网络出错'\n    },\n    OTHER_CLIENT_HANDLED8: {\n      code: 8,\n      info: '其他设备已处理'\n    },\n    REMOTE_CANCEL11: {\n      code: 11,\n      info: '对方取消已发出的通话请求'\n    },\n    REMOTE_REJECT12: {\n      code: 12,\n      info: '对方拒绝收到的通话请求'\n    },\n    REMOTE_HANGUP13: {\n      code: 13,\n      info: '通话过程对方挂断'\n    },\n    REMOTE_BUSYLINE14: {\n      code: 14,\n      info: '对方忙碌'\n    },\n    REMOTE_NO_RESPONSE15: {\n      code: 15,\n      info: '对方未接听'\n    },\n    REMOTE_ENGINE_UN_SUPPORTED16: {\n      code: 16,\n      info: '对方不支持当前引擎'\n    },\n    REMOTE_NETWORK_ERROR17: {\n      code: 17,\n      info: '对方网络错误'\n    },\n    VOIP_NOT_AVALIABLE18: {\n      code: 18,\n      info: 'VoIP 不可以用'\n    },\n    DEVICE_ERROR: {\n      code: 19,\n      info: '获取麦克风或摄像头失败'\n    }\n  };\n\n  var CallStatus = {\n    //初始状态\n    CallIdle: 0,\n\n    //正在呼出\n    Dialing: 1,\n\n    //正在呼入\n    Incoming: 2,\n\n    //收到一个通话呼入后，正在振铃\n    Ringing: 3,\n\n    //正在通话\n    Active: 4,\n\n    //已经挂断\n    Hangup: 5\n  };\n\n  var Enum = {\n    Reason: Reason,\n    CallStatus: CallStatus\n  };\n\n  var Reason$1 = Enum.Reason;\n\n  var TalkType = {\n    OnlyAudio: 0,\n    All: 1,\n    OnlyVideo: 2,\n    None: 3\n  };\n\n  var Tag = 'RongCloudRTC';\n\n  var selfUserId = void 0;\n  var rongRTC = void 0,\n      rongRTCRoom = void 0,\n      rongRTCStream = void 0;\n  var joinRoomCallback = util.noop;\n\n  var VIDEO_PROFILE = {\n    VIDEO_PROFILE_240P: {\n      width: 320,\n      height: 240\n    },\n    VIDEO_PROFILE_480P: {\n      width: 640,\n      height: 480\n    },\n    VIDEO_PROFILE_720: {\n      width: 1280,\n      height: 720\n    }\n  };\n\n  var config = {};\n\n  var getRTCPeer = function getRTCPeer() {\n    if (!rongRTC) {\n      throw new Error('Not call yet, please call first.');\n    }\n    return rongRTC;\n  };\n\n  var getTalkType = function getTalkType(videoEnable, audioEnable) {\n    var type = void 0;\n    if (videoEnable && audioEnable) {\n      type = TalkType.All;\n    } else if (videoEnable) {\n      type = TalkType.OnlyVideo;\n    } else if (audioEnable) {\n      type = TalkType.OnlyAudio;\n    } else {\n      type = TalkType.None;\n    }\n    return type;\n  };\n\n  var setVideoProfile = function setVideoProfile(profile) {\n    var videoProfile = VIDEO_PROFILE[profile] || VIDEO_PROFILE[VIDEO_PROFILE.VIDEO_PROFILE_480P];\n    util.extend(config, videoProfile);\n  };\n\n  var createVideo = function createVideo(src, id) {\n    var video = document.createElement('video');\n    video.id = id;\n    video.autoplay = true;\n    video.controls = false;\n    video.srcObject = src;\n    return video;\n  };\n\n  var getId = function getId(id) {\n    /*  id = id || 'local';\n    let prefix = 'native-';*/\n    return (/*prefix + */id\n    );\n  };\n\n  /**\n   * @param  {object} data\n   * @param  {object} data.id 用户 id\n   * @param  {object} data.stream\n   * @param  {object} data.stream.type 媒体流状态\n   * @param  {object} data.stream.mediaStream 媒体流\n   */\n  var addStream = function addStream(data) {\n    var userId = data.id;\n    var stream = data.stream;\n\n    var isLocal = userId === selfUserId;\n    var video = void 0,\n        talkType = void 0,\n        tag = void 0;\n    if (stream) {\n      var enable = stream.enable;\n      var mediaStream = stream.mediaStream;\n\n      var videoId = getId(userId);\n      video = createVideo(mediaStream, videoId);\n      talkType = getTalkType(enable.video, enable.audio);\n      video.muted = userId === selfUserId;\n      video.setAttribute('userid', userId);\n      tag = stream.tag;\n    }\n    var result = {\n      type: 'added',\n      data: video,\n      talkType: talkType,\n      isLocal: isLocal,\n      tag: tag\n    };\n    joinRoomCallback(null, result);\n  };\n\n  var addIEStream = function addIEStream(data) {\n    var userId = data.id,\n        stream = data.stream,\n        _stream$enable = stream.enable,\n        video = _stream$enable.video,\n        audio = _stream$enable.audio,\n        tag = stream.tag,\n        isLocal = userId === selfUserId;\n\n    var talkType = getTalkType(video, audio);\n    var result = {\n      type: 'added',\n      talkType: talkType,\n      isLocal: isLocal,\n      tag: tag\n    };\n    joinRoomCallback(null, result);\n  };\n\n  var streamPublished = function streamPublished(user) {\n    var StreamSize = rongRTC.StreamSize;\n    user.stream.size = StreamSize.MAX;\n    rongRTCStream.subscribe(user).then(function (user) {\n      config.isIE ? addIEStream(user) : addStream(user);\n    }, function (error) {\n      console.error(error);\n      joinRoomCallback('stream subscribe error');\n    });\n  };\n\n  var removeUser = function removeUser(user) {\n    user = user || {};\n    var result = {\n      type: 'removed',\n      data: user.id,\n      userId: user.id,\n      isLocal: false\n    };\n    joinRoomCallback(null, result);\n  };\n\n  var getSelfStream = function getSelfStream(mediaType, callback) {\n    var RongIMLib = module$1.getRongIMLib();\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    var StreamType = rongRTC.StreamType;\n\n    var type = mediaType === VoIPMediaType.MEDIA_AUDIO ? StreamType.AUDIO : StreamType.AUDIO_AND_VIDEO;\n    var user = {\n      id: selfUserId\n    };\n    var videoEnable = mediaType === VoIPMediaType.MEDIA_VEDIO;\n\n    // let videoConfig = true;\n    // if (config.width && config.height) {\n    //   videoConfig = {\n    //     width: config.width,\n    //     height: config.height\n    //   };\n    // }\n    var getStreamFunc = videoEnable ? util.getVideoAudioStream : util.getAudioStream;\n    return getStreamFunc(config.width, config.height).then(function (mediaStream) {\n      user.stream = {\n        mediaStream: mediaStream,\n        type: type,\n        tag: Tag\n      };\n      callback(null, user);\n    }).catch(function () {\n      callback(null, user);\n    });\n  };\n\n  var publishIERTC = function publishIERTC(params) {\n    var mediaType = params.mediaType;\n    var RongIMLib = module$1.getRongIMLib();\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    var StreamType = rongRTC.StreamType;\n\n    var type = mediaType === VoIPMediaType.MEDIA_AUDIO ? StreamType.AUDIO : StreamType.AUDIO_AND_VIDEO;\n    var user = {\n      id: selfUserId,\n      stream: {\n        tag: Tag,\n        type: type,\n        enable: {\n          video: mediaType !== VoIPMediaType.MEDIA_AUDIO,\n          audio: true\n        }\n      }\n    };\n    rongRTCStream.publish(user).then(function () {}).catch(function (error) {\n      console.error('publish self stream error', error);\n    });\n    addIEStream(user);\n  };\n\n  var publishRTC = function publishRTC(params) {\n    var RongIMLib = module$1.getRongIMLib();\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    // const StreamType = rongRTC.StreamType;\n    var video = rongRTCStream.video;\n    getSelfStream(params.mediaType, function (err, result) {\n      if (err) {\n        return joinRoomCallback(Reason$1.DEVICE_ERROR.code, Reason$1.DEVICE_ERROR.info);\n      }\n      result.isLocal = true;\n      if (result.stream) {\n        rongRTCStream.publish(result).then(function () {\n          if (params.mediaType === VoIPMediaType.MEDIA_AUDIO) {\n            video.disable({\n              id: selfUserId,\n              stream: {\n                tag: Tag\n              }\n            });\n          }\n        }, function (error) {\n          console.error('publish self stream error', error);\n        });\n        result.stream.enable = {\n          video: params.mediaType !== VoIPMediaType.MEDIA_AUDIO,\n          audio: true\n        };\n      } else {\n        console.error('Microphone and camera not captured, Can\\'t get your own stream');\n      }\n      addStream(result);\n    });\n  };\n\n  var observeRoom = function observeRoom(roomId) {\n    rongRTCRoom = new rongRTC.Room({\n      id: roomId,\n      // joined: , // 其他人加入不处理, 已通过消息处理\n      left: removeUser\n    });\n  };\n\n  var observeStream = function observeStream() {\n    rongRTCStream = new rongRTC.Stream({\n      published: streamPublished\n      // unpublished: '', 对方取消推流, 不处理, calllib 只有退出, 没有取消\n      // disabled: '',  资源改变, 不处理, 已通过消息处理\n      // enabled: '',\n      // muted: '',\n      // unmuted: ''\n    });\n    return rongRTCStream;\n  };\n\n  // const observeScreenShare = () => {\n  //   let { ScreenShare } = rongRTC;\n  //   let observer = new Observer((mutation) => {\n  //     let { type } = mutation;\n  //     if (type === 'finished') {\n  //       // TODO onShareComplete\n  //     }\n  //   });\n  //   observer.observe(ScreenShare, {\n  //     finished: true\n  //   });\n  // };\n\n  var initRTC = function initRTC(params) {\n    observeRoom(params.channelId);\n  };\n\n  var setConfig = function setConfig(cfg) {\n    util.extend(config, cfg);\n    if (cfg.engineId) {\n      config.isIE = true;\n    }\n    var RongRTC = module$1.getRongRTC();\n    var RongIMLib = module$1.getRongIMLib();\n    rongRTC = new RongRTC({\n      id: config.engineId,\n      RongIMLib: RongIMLib,\n      mode: RongRTC.RTC,\n      error: function error(_error) {\n        joinRoomCallback(null, {\n          type: 'error',\n          error: _error\n        });\n      }\n    });\n    observeStream();\n    return rongRTCStream;\n  };\n\n  var joinRoom = function joinRoom(params, callback) {\n    joinRoomCallback = callback || util.noop;\n    selfUserId = params.userId;\n    initRTC(params);\n    var room = {\n      id: selfUserId,\n      token: selfUserId\n    };\n    rongRTCRoom.join(room).then(function () {\n      config.isIE ? publishIERTC(params) : publishRTC(params);\n    }, function (err) {\n      console.log('join room error', err);\n      joinRoomCallback('join error.');\n    });\n  };\n\n  var quitRoom = function quitRoom(config, callback) {\n    callback = callback || util.noop;\n    if (!rongRTC || !rongRTCRoom) {\n      return callback();\n    }\n    rongRTCRoom.leave().then(function () {\n      joinRoomCallback(null, {\n        type: 'leave'\n      });\n      callback();\n    }, function () {\n      callback();\n      joinRoomCallback('leave error.');\n    });\n  };\n\n  var enableAudio = function enableAudio(params) {\n    var isMute = !params.isEnabled;\n    var Audio = rongRTCStream.audio;\n    var audioFuc = isMute ? Audio.mute : Audio.unmute;\n    audioFuc({\n      id: selfUserId,\n      stream: {\n        tag: Tag\n      }\n    });\n  };\n\n  var enableVideo = function enableVideo(params) {\n    var isClosed = !params.isEnabled;\n    var Video = rongRTCStream.video;\n    var videoFuc = isClosed ? Video.disable : Video.enable;\n    videoFuc({\n      id: selfUserId,\n      stream: {\n        tag: Tag\n      }\n    });\n  };\n\n  var startScreenShare = function startScreenShare() {\n    var ScreenShare = rongRTC.ScreenShare;\n    ScreenShare.start().then(function () {}, function () {\n      joinRoomCallback('screenshare error.');\n    });\n  };\n\n  var stopScreenShare = function stopScreenShare() {\n    var ScreenShare = rongRTC.ScreenShare;\n    ScreenShare.stop();\n  };\n\n  var getMediaID = function getMediaID(params) {\n    var sentTime = params.sentTime;\n    return String(sentTime & 0x7fffffff); //ios o只支持string 类型\n  };\n\n  var requestWhiteBoardURL = function requestWhiteBoardURL() {\n    var WhiteBoard = rongRTC.WhiteBoard;\n    WhiteBoard.create().then(function (whiteboard) {\n      if (whiteboard.url) {\n        var result = {\n          index: 'meet',\n          type: 'whiteBoardURL',\n          url: whiteboard.url\n        };\n        joinRoomCallback(result);\n      } else {\n        joinRoomCallback('request whiteboard error.');\n      }\n    });\n  };\n\n  var RongVoIP = {\n    setConfig: setConfig,\n    joinRoom: joinRoom,\n    quitRoom: quitRoom,\n    enableAudio: enableAudio,\n    enableVideo: enableVideo,\n    getMediaID: getMediaID,\n    startScreenShare: startScreenShare,\n    stopScreenShare: stopScreenShare,\n    requestWhiteBoardURL: requestWhiteBoardURL,\n    setVideoProfile: setVideoProfile,\n    getRTCPeer: getRTCPeer\n  };\n\n  var MsgObserverList = util.ObserverList;\n\n  // patch c++ SDK 多端时发送一条消息，会再收到一条同样 messageUId 的消息这里记录一下做排除\n  var cacheMessageUIdList = [];\n  var MAXCACHE = 500;\n\n  var getIMPeer = function getIMPeer() {\n    return module$1.getRongIMLib();\n  };\n\n  /*\n    根据 MessageType 返回 message 对象\n    let params = {\n        messageType:'TextMessage',\n        content: { content: 'hello'}    // 消息体\n    };\n  let textMsg = messageFactory(params);\n  */\n  var messageFactory = function messageFactory(params) {\n    var RongIMLib = getIMPeer();\n    var messageTypes = {\n      AcceptMessage: RongIMLib.AcceptMessage,\n      RingingMessage: RongIMLib.RingingMessage,\n      SummaryMessage: RongIMLib.SummaryMessage,\n      HungupMessage: RongIMLib.HungupMessage,\n      InviteMessage: RongIMLib.InviteMessage,\n      MediaModifyMessage: RongIMLib.MediaModifyMessage,\n      MemberModifyMessage: RongIMLib.MemberModifyMessage\n    };\n    var content = params.content;\n    var message = messageTypes[params.messageType] || util.noop;\n    return new message(content);\n  };\n\n  var sendMessage = function sendMessage(params, callback) {\n    var RongIMLib = getIMPeer();\n    callback = callback || util.noop;\n\n    var msg = messageFactory(params);\n\n    var conversationType = params.conversationType;\n    var targetId = params.targetId;\n\n    var im = RongIMLib.RongIMClient.getInstance();\n\n    var isMentioned = false;\n    var pushText = params.pushText || '';\n    var appData = params.appData || '';\n    var methodType = null;\n    // console.log('im.sendMessage', msg);\n    im.sendMessage(conversationType, targetId, msg, {\n      onSuccess: function onSuccess(message) {\n        cacheMessageUIdList.unshift(message.messageUId);\n        if (cacheMessageUIdList.length > MAXCACHE) {\n          cacheMessageUIdList.pop();\n        }\n        var error = null;\n        callback(error, message);\n      },\n      onError: function onError(code) {\n        callback(code);\n      }\n    }, isMentioned, pushText, appData, methodType, params);\n  };\n\n  var commandItem = {\n    /*\n        params.conversationType\n        params.targetId\n        params.content\n        */\n    invite: function invite(params, callback) {\n      params.messageType = 'InviteMessage';\n\n      var content = params.content;\n\n      var mediaType = content.mediaType;\n      var inviteUserIds = content.inviteUserIds;\n      var callId = content.callId;\n\n      var appData = {\n        mediaType: mediaType,\n        userIdList: inviteUserIds,\n        callId: callId\n      };\n\n      var pushItem = {\n        1: '您有一条音频通话',\n        2: '您有一条视频通话'\n      };\n      params.pushText = pushItem[mediaType];\n      params.appData = JSON.stringify(appData);\n      params.userIds = inviteUserIds;\n      sendMessage(params, callback);\n    },\n    ringing: function ringing(params, callback) {\n      params.messageType = 'RingingMessage';\n      sendMessage(params, callback);\n    },\n    /*\n        params.conversationType\n        params.targetId\n        params.content\n        */\n    accept: function accept(params, callback) {\n      params.messageType = 'AcceptMessage';\n      sendMessage(params, callback);\n    },\n\n    /*\n       params.conversationType\n       params.targetId\n       params.content\n       */\n    hungup: function hungup(params, callback) {\n      params.messageType = 'HungupMessage';\n      sendMessage(params, callback);\n    },\n    /*\n        params.conversationType\n        params.targetId\n        params.content\n        */\n    mediaModify: function mediaModify(params, callback) {\n      params.messageType = 'MediaModifyMessage';\n      sendMessage(params, callback);\n    },\n    memberModify: function memberModify(params, callback) {\n      params.messageType = 'MemberModifyMessage';\n      var content = params.content;\n      var userIds = [];\n      var inviteUserIds = content.inviteUserIds;\n      var existList = content.existedMemberStatusList;\n\n      util.forEach(inviteUserIds, function (userId) {\n        userIds.push(userId);\n      });\n      util.forEach(existList, function (user) {\n        var userId = user.userId;\n        userIds.push(userId);\n      });\n      params.userIds = userIds;\n      sendMessage(params, callback);\n    },\n    getToken: function getToken(params, callback) {\n      // const RongIMLib = getIMPeer();\n      // let im = RongIMLib.RongIMClient.getInstance();\n      // let engineType = 3;\n      // let channelId = params.channelId;\n      callback(null, '');\n      // im.getAgoraDynamicKey(engineType, channelId, {\n      //   onSuccess: function (data) {\n      //     let error = null;\n      //     callback(error, data.dynamicKey);\n      //   },\n      //   onError: function (error) {\n      //     callback(error);\n      //   }\n      // });\n\n      // let uid = params.userId & 0x7fffffff;\n      // let url = 'https://api.blinktalk.site:8800/token';\n      // $.ajax({\n      //     url : url,\n      //     type : 'POST',\n      //     data : 'uid=' + uid + '&appid=1234567890abcdefg',\n      //     async : true,\n      //     success : function(data) {\n      //         let error = null;\n      //         callback(error, data);\n      //     },\n      //     error : function(error) {\n      //         callback(error);\n      //     }\n      // });\n    }\n  };\n  /*\n  let params = {\n      command: 'invite' | 'ringing' | 'accept' | 'hungup' | 'mediaModify' | 'memberModify' | 'getToken',\n      data: {\n          conversationType: 1,\n          targetId: '',\n          content: {}\n      }\n  };\n  */\n  var sendCommand = function sendCommand(params, callback) {\n    var command = params.command;\n    var data = params.data;\n    commandItem[command] && commandItem[command](data, callback);\n  };\n\n  var watcher = new MsgObserverList();\n\n  var watch = function watch(listener) {\n    watcher.add(listener);\n  };\n\n  var getCurrentUserId = function getCurrentUserId() {\n    var RongIMLib = getIMPeer();\n    if (!RongIMLib) {\n      console.error('Missing RongIMLib, please pass in RongIMLib in init');\n      return '';\n    }\n    var RongIMClient = RongIMLib.RongIMClient || {\n      getInstance: function getInstance() {\n        return { getCurrentUserId: util.noop };\n      }\n    };\n    var currentUserId = RongIMClient.getInstance().getCurrentUserId();\n    if (!currentUserId) {\n      console.error('Please connect im first');\n      return '';\n    }\n    return currentUserId;\n  };\n\n  var setVoipProvider = function setVoipProvider() {\n    var RongIMLib = getIMPeer();\n    // WebSDK VoIP message adapter.\n    RongIMLib.RongIMClient._voipProvider = {\n      onReceived: function onReceived(message) {\n        // console.log('onRecrived msd', message)\n        // patch 排除自己发的消息\n        var isSelfClientSendMessage = cacheMessageUIdList.indexOf(message.messageUId) > -1;\n        if (message.offLineMessage || isSelfClientSendMessage) {\n          return;\n        }\n        watcher.notify(message);\n      }\n    };\n  };\n\n  var MessageCtrl = {\n    sendCommand: sendCommand,\n    watch: watch,\n    setVoipProvider: setVoipProvider,\n    getCurrentUserId: getCurrentUserId\n  };\n\n  var classCallCheck = function (instance, Constructor) {\n    if (!(instance instanceof Constructor)) {\n      throw new TypeError(\"Cannot call a class as a function\");\n    }\n  };\n\n  var EnumReason = Enum.Reason;\n\n  var joinRoom$1 = RongVoIP.joinRoom;\n  var quitRoom$1 = RongVoIP.quitRoom;\n  var enableAudio$1 = RongVoIP.enableAudio;\n  var enableVideo$1 = RongVoIP.enableVideo;\n  var getMediaID$1 = RongVoIP.getMediaID;\n\n  var sendCommand$1 = MessageCtrl.sendCommand;\n  var getCurrentUserId$1 = MessageCtrl.getCurrentUserId;\n\n  var cache$1 = util.cache();\n\n  var ObserverList$1 = util.ObserverList;\n\n  var videoWatcher = new ObserverList$1();\n  var meetCommandWatcher = new ObserverList$1();\n  var commandWatcher = new ObserverList$1();\n  var msgWatcher = new ObserverList$1();\n\n  var config$1 = {\n    url: 'https://rtcapi.ronghub.com/nav/websocketlist',\n    timeout: 10000 * 3,\n    ices: [{\n      urls: 'turn:119.254.101.80:3478',\n      credential: 'test',\n      username: 'test'\n    }]\n  };\n\n  cache$1.set('videoQueue', {});\n\n  var callTimer = {};\n\n  var MessgeDirection = {\n    SENT: 1,\n    RECEIVED: 2\n  };\n\n  var getSendExtraParams = function getSendExtraParams(params) {\n    var extraParamNames = ['extra'];\n    var contents = {};\n    extraParamNames.forEach(function (name) {\n      contents[name] = params[name];\n    });\n    return contents;\n  };\n\n  var stopItem = {\n    single: function single(message) {\n      var senderUserId = message.senderUserId;\n      var timer = callTimer[senderUserId];\n      timer && timer.stop();\n    },\n    multi: function multi() {\n      util.forEach(callTimer, function (timer) {\n        timer.stop();\n      });\n      cache$1.remove('inviteUsers');\n    }\n  };\n\n  var CallStatus$1 = {\n    //初始状态\n    CallIdle: 0,\n\n    //正在呼出\n    Dialing: 1,\n\n    //正在呼入\n    Incoming: 2,\n\n    //收到一个通话呼入后，正在振铃\n    Ringing: 3,\n\n    //正在通话\n    Active: 4,\n\n    //已经挂断\n    Hangup: 5\n  };\n\n  var Reason$2 = function () {\n    // key ：用描述和错误码组成，方便通过错错误码或者描述获取\n    var result = {\n      CANCEL1: {\n        code: 1,\n        info: '己方取消已发出的通话请求'\n      },\n      REJECT2: {\n        code: 2,\n        info: '己方拒绝收到的通话请求'\n      },\n      HANGUP3: {\n        code: 3,\n        info: '己方挂断'\n      },\n      BUSYLINE4: {\n        code: 4,\n        info: '己方忙碌'\n      },\n      NO_RESPONSE5: {\n        code: 5,\n        info: '己方未接听'\n      },\n      ENGINE_UN_SUPPORTED6: {\n        code: 6,\n        info: '己方不支持当前引擎'\n      },\n      NETWORK_ERROR7: {\n        code: 7,\n        info: '己方网络出错'\n      },\n      OTHER_CLIENT_HANDLED8: {\n        code: 8,\n        info: '其他设备已处理'\n      },\n      REMOTE_CANCEL11: {\n        code: 11,\n        info: '对方取消已发出的通话请求'\n      },\n      REMOTE_REJECT12: {\n        code: 12,\n        info: '对方拒绝收到的通话请求'\n      },\n      REMOTE_HANGUP13: {\n        code: 13,\n        info: '通话过程对方挂断'\n      },\n      REMOTE_BUSYLINE14: {\n        code: 14,\n        info: '对方忙碌'\n      },\n      REMOTE_NO_RESPONSE15: {\n        code: 15,\n        info: '对方未接听'\n      },\n      REMOTE_ENGINE_UN_SUPPORTED16: {\n        code: 16,\n        info: '对方不支持当前引擎'\n      },\n      REMOTE_NETWORK_ERROR17: {\n        code: 17,\n        info: '对方网络错误'\n      },\n      VOIP_NOT_AVALIABLE18: {\n        code: 18,\n        info: 'VoIP 不可以用'\n      }\n    };\n\n    var getKey = function getKey(key) {\n      if (util.isNumber(key)) {\n        util.forEach(result, function (reason, reasonKey) {\n          reasonKey.indexOf(key) > -1 && (key = reasonKey);\n        });\n      }\n      return key;\n    };\n\n    var get$$1 = function get$$1(key) {\n      key = getKey(key);\n      return result[key];\n    };\n\n    return {\n      get: get$$1\n    };\n  }();\n\n  var reasonItem = {\n    1: function _() {\n      return Reason$2.get('REMOTE_CANCEL11');\n    },\n    2: function _() {\n      return Reason$2.get('REMOTE_REJECT12');\n    },\n    3: function _() {\n      return Reason$2.get('REMOTE_HANGUP13');\n    },\n    4: function _() {\n      return Reason$2.get('REMOTE_BUSYLINE14');\n    },\n    5: function _() {\n      return Reason$2.get('REMOTE_NO_RESPONSE15');\n    },\n    15: function _() {\n      return Reason$2.get('NO_RESPONSE5');\n    }\n  };\n\n  var watch$1 = function watch(listener) {\n    msgWatcher.add(listener);\n  };\n\n  var Timer = function Timer() {\n    this.timeout = 0;\n    this.startTime = 0;\n    this.start = function (callback, second) {\n      second = second || 0;\n\n      if (callback) {\n        this.timeout = setTimeout(function () {\n          callback();\n        }, second);\n      }\n\n      this.startTime = +new Date();\n    };\n\n    this.stop = function () {\n\n      clearTimeout(this.timeout);\n\n      var endTime = +new Date();\n      var startTime = this.startTime;\n      var duration = endTime - startTime;\n      if (startTime === 0) {\n        duration = 0;\n      }\n      return {\n        start: startTime,\n        end: endTime,\n        duration: duration\n      };\n    };\n    this.clear = function () {\n      this.startTime = 0;\n    };\n  };\n\n  var summayTimer = new Timer();\n\n  var getToken = function getToken(params, callback) {\n    var channelId = params.channelId;\n    var engineType = 4;\n    params = {\n      command: 'getToken',\n      engineType: engineType,\n      data: {\n        channelId: channelId\n      }\n    };\n    sendCommand$1(params, callback);\n  };\n\n  // params.info\n  // params.position\n  var errorHandler = function errorHandler(params) {\n    var info = params.info;\n    throw new Error(info);\n  };\n\n  var checkSession = function checkSession(params) {\n    if (!params.session) {\n      errorHandler(params);\n    }\n  };\n\n  var stopTimer = function stopTimer(message) {\n    var method = message ? 'single' : 'multi';\n    stopItem[method](message);\n  };\n\n  var room = {\n    isActive: false,\n    init: function init(params, callback) {\n      if (this.isActive) {\n        return;\n      }\n      params.url = config$1.url;\n      params.ices = config$1.ices;\n      joinRoom$1(params, callback);\n      this.isActive = true;\n    },\n    reset: function reset() {\n      this.isActive = false;\n      cache$1.remove('session');\n      cache$1.remove('initRoom');\n    }\n  };\n\n  var getSummary = function getSummary(params) {\n\n    var session = params.session || cache$1.get('session');\n    var reason = Reason$2.get(params.reasonKey);\n\n    var conversationType = session.conversationType;\n    var targetId = session.targetId;\n\n    var timer = summayTimer.stop();\n    summayTimer.clear();\n\n    var caller = session.senderUserId;\n\n    var inviter = session.senderUserId;\n\n    var content = session.content;\n    var mediaType = content.mediaType;\n\n    var inviteUserIds = content.inviteUserIds;\n\n    var userOnLine = session.userOnLine || {};\n\n    if (conversationType === 1 && userOnLine[caller]) {\n      var method = reasonItem[reason.code];\n      method && (reason = method());\n    }\n\n    var summary = {\n      conversationType: conversationType,\n      targetId: targetId,\n      messageDirection: session.messageDirection,\n      content: {\n        caller: caller,\n        inviter: inviter,\n        mediaType: mediaType,\n        startTime: timer.start,\n        duration: timer.duration,\n        status: reason.code,\n        memberIdList: inviteUserIds\n      },\n      senderUserId: inviter,\n      messageType: 'SummaryMessage'\n    };\n    commandWatcher.notify(summary);\n\n    room.reset();\n    cache$1.remove('hungupReason');\n    return summary;\n  };\n\n  var sendHungup = function sendHungup(params, callback) {\n    callback = callback || util.noop;\n\n    var session = cache$1.get('session');\n    params.session = session;\n\n    var from = params.from;\n    var info = from + ': Not call yet';\n    checkSession({\n      session: session,\n      info: info\n    });\n    var callId = session.content.callId;\n    var conversationType = session.conversationType;\n    var targetId = session.targetId;\n    var key = params.reasonKey;\n    var reason = Reason$2.get(key);\n\n    var requireSendCommand = !params.passive;\n\n    // 点击挂断按钮触发时发送消息，接受到 HungupMessage 时不发送消息\n    if (requireSendCommand) {\n      var arg = {\n        command: 'hungup',\n        data: {\n          conversationType: conversationType,\n          targetId: targetId,\n          content: util.extend({\n            callId: callId,\n            reason: reason.code\n          }, getSendExtraParams(params))\n        }\n      };\n      quitRoom$1({\n        roomId: callId\n      }, function () {\n        sendCommand$1(arg, function (error) {\n          if (!error) {\n            var summary = getSummary(params);\n            callback(null, summary);\n          }\n        });\n      });\n    } else {\n      quitRoom$1({\n        roomId: callId\n      }, function () {\n        var summary = getSummary(params);\n        callback(null, summary);\n      });\n    }\n\n    if (cache$1.get('joinRoom')) {\n      cache$1.remove('joinRoom');\n    }\n    stopTimer();\n    // cache.clear();\n  };\n\n  var calcTimeout = function calcTimeout(params) {\n    var userIds = params.userIds;\n    var conversationType = params.conversationType;\n    var targetId = params.targetId;\n\n    var currentUserId = getCurrentUserId$1() || config$1.currentUserId;\n\n    util.forEach(userIds, function (userId) {\n      var timer = callTimer[userId] = new Timer();\n\n      var isPrivate = conversationType === 1;\n      var isRemote = userId === currentUserId || isPrivate;\n      var status = params.status;\n      timer.status = status;\n      timer.mediaType = params.mediaType;\n      var timeout = config$1.timeout;\n      if (!isRemote) {\n        timeout += params.timeout || 0;\n      }\n      var sentItem = {\n        sent: function sent(timer) {\n          // 一直处于呼叫状态认为对方不在线。\n          var isOffLine = timer.status === CallStatus$1.Dialing;\n          var key = isOffLine ? 'REMOTE_NO_RESPONSE15' : 'NO_RESPONSE5';\n          var params = {\n            conversationType: conversationType,\n            targetId: targetId,\n            from: 'call-timeout',\n            reasonKey: key\n          };\n          var inviteUsers = cache$1.get('inviteUsers');\n          sendHungup(params, function (error, message) {\n            var senderUserId = message.senderUserId;\n            delete inviteUsers[senderUserId];\n          });\n        },\n        local: function local() /*callback*/{\n          var key = 'NO_RESPONSE5';\n          var reason = Reason$2.get(key);\n          var session = cache$1.get('session');\n          var content = {\n            reason: reason.code,\n            callId: session.content.channelInfo.Id\n          };\n          var message = {\n            messageType: 'HungupMessage',\n            conversationType: conversationType,\n            targetId: targetId,\n            senderUserId: userId,\n            content: content,\n            messageDirection: 2\n          };\n\n          // let error = null;\n          msgWatcher.notify(message);\n        }\n      };\n      timer.start(function () {\n        // 接收者为自己时发送 HungupMessage, 其他人则本地创建 HungupMessage，认为此人已忽略、或者不在线。\n        var method = isRemote ? 'sent' : 'local';\n        sentItem[method](timer);\n      }, timeout);\n    });\n  };\n\n  var initRoom = function initRoom(params, callback, command) {\n    getToken(params, function (error, token) {\n      if (error) {\n        throw new Error(error);\n      }\n\n      params.token = token;\n\n      var videoItem = {\n        added: function added(result) {\n          var stream = result.data;\n          var userId = stream.getAttribute('userid');\n          // App Server 的用户 Id\n          result.userId = userId;\n          stream.setAttribute('userId', userId);\n        }\n      };\n      room.init(params, function (error, result) {\n        callback = callback || util.noop;\n        if (error) {\n          callback(error, result);\n          throw new Error(error);\n        }\n        if (result.type === 'error') {\n          getSummary({\n            reasonKey: 'NETWORK_ERROR7'\n          });\n          throw new Error('RTC Connect Error.');\n          // return callback(null, summary);\n        }\n        if (result.isLeft) {\n          // 离开事件\n          //   room.reset();\n          return;\n        }\n        if (result.type === 'added' && result.isLocal) {\n          callback(null, command);\n        }\n        var type = result.type;\n        var index = result.index;\n        var handler = videoItem[type];\n        handler && handler(result);\n        if (index === 'meet') {\n          // 会控相关\n          meetCommandWatcher.notify(result);\n        } else {\n          var sourceId = result.sourceId;\n          var userId = result.userId;\n          var hasUser = Number(userId) !== sourceId;\n          if (hasUser) {\n            videoWatcher.notify(result);\n          } else {\n            var queue = cache$1.get('videoQueue');\n            queue[sourceId] = result;\n          }\n        }\n      });\n    });\n  };\n\n  var array2Obj$1 = function array2Obj(arrs) {\n    var obj = {};\n    util.forEach(arrs, function (item) {\n      obj[item] = item;\n    });\n    return obj;\n  };\n\n  var isGroup = function isGroup(type) {\n    return type === 3;\n  };\n\n  var doUserRelation = function doUserRelation(senderUserId, mediaId) {\n    var session = cache$1.get('session');\n\n    session[senderUserId] = mediaId;\n    session[mediaId] = senderUserId;\n\n    return {\n      userId: mediaId,\n      sender: senderUserId\n    };\n  };\n\n  var addUserRelation = function addUserRelation(params) {\n    // let sentTime = params.sentTime;\n    var senderUserId = params.senderUserId;\n    var mediaID = getMediaID$1(params);\n    // console.log('addUserRelation:sentTime->userId', sentTime, '->', senderUserId);\n    return doUserRelation(senderUserId, mediaID);\n  };\n\n  var inviteItem = {\n    busy: function busy(message) {\n      var reasonKey = 'BUSYLINE4';\n      var reason = Reason$2.get(reasonKey);\n\n      var isSender = message.messageDirection === 1;\n\n      if (isSender) {\n        reasonKey = 'HANGUP3';\n      }\n\n      var callId = message.content.callId;\n\n      var content = {\n        callId: callId,\n        reason: reason.code\n      };\n\n      var conversationType = message.conversationType;\n      var targetId = message.targetId;\n\n      var data = {\n        conversationType: conversationType,\n        targetId: targetId,\n        content: content\n      };\n      var params = {\n        command: 'hungup',\n        data: data\n      };\n\n      sendCommand$1(params);\n    },\n    free: function free(message, isNeedUpUserRel, isInvite) {\n\n      cache$1.set('session', message);\n      commandWatcher.notify(message);\n\n      var sentTime = message.sentTime;\n      var senderUserId = message.senderUserId;\n      if (isNeedUpUserRel) {\n        //邀请方一人映射\n        addUserRelation({\n          sentTime: sentTime,\n          senderUserId: senderUserId\n        });\n      } else {\n        // 群聊 映射 正在视频的成员\n        message.content.existedUserPofiles.map(function (user) {\n          doUserRelation(user.userId, user.mediaId);\n        });\n      }\n\n      var content = message.content;\n\n      var callId = content.callId;\n\n      var conversationType = message.conversationType;\n      var targetId = message.targetId;\n\n      var userIds = content.inviteUserIds;\n\n      cache$1.set('inviteUsers', array2Obj$1(userIds));\n\n      var mediaType = content.mediaType;\n      var params = {\n        conversationType: conversationType,\n        targetId: targetId,\n        userIds: userIds,\n        mediaType: mediaType,\n        status: CallStatus$1.Incoming\n      };\n      calcTimeout(params);\n      // 移动端第一次向pc端发起单个群聊\n      if (isInvite) {\n        var _params = {\n          conversationType: conversationType,\n          targetId: targetId,\n          userIds: [message.senderUserId],\n          mediaType: mediaType,\n          status: CallStatus$1.Active\n        };\n        calcTimeout(_params);\n        stopTimer(message);\n        var data = {\n          conversationType: conversationType,\n          targetId: targetId,\n          content: {\n            callId: callId\n          }\n        };\n        var result = {\n          command: 'ringing',\n          data: data\n        };\n\n        sendCommand$1(result);\n      }\n    }\n  };\n\n  var Consumer = function Consumer(result) {\n    var queue = cache$1.get('videoQueue');\n\n    var stream = result.data;\n    var userId = stream.getAttribute('userid');\n    var session = cache$1.get('session');\n\n    if (userId in session) {\n      delete queue[userId];\n      userId = session[userId] || userId;\n      result.sourceId = userId;\n      stream.setAttribute('userid', userId);\n      videoWatcher.notify(result);\n    }\n  };\n\n  var otherClientHandler = function otherClientHandler(message) {\n    var type = message.conversationType;\n    var targetId = message.targetId;\n    var direction = 2;\n\n    var session = cache$1.get('session');\n    var senderUserId = session.senderUserId;\n    var caller = senderUserId;\n    var inviter = senderUserId;\n    var content = session.content;\n    var mediaType = content.mediaType;\n    var inviteUserIds = content.inviteUserIds;\n\n    var start = 0;\n    var duration = 0;\n    var reason = Reason$2.get('OTHER_CLIENT_HANDLED8');\n\n    var summary = {\n      conversationType: type,\n      targetId: targetId,\n      messageDirection: direction,\n      content: {\n        caller: caller,\n        inviter: inviter,\n        mediaType: mediaType,\n        startTime: start,\n        duration: duration,\n        status: reason.code,\n        memberIdList: inviteUserIds\n      },\n      senderUserId: inviter,\n      messageType: 'SummaryMessage'\n    };\n\n    commandWatcher.notify(summary);\n    cache$1.remove('session');\n  };\n\n  var messageHandler = {\n    InviteMessage: function InviteMessage(message) {\n      var session = cache$1.get('session');\n      var method = session ? 'busy' : 'free';\n      inviteItem[method](message, true, true);\n    },\n    RingingMessage: function RingingMessage(message) {\n      var senderUserId = message.senderUserId;\n      var timer = callTimer[senderUserId];\n      if (timer) {\n        timer.stop();\n        timer.status = CallStatus$1.Ringing;\n      }\n      var session = cache$1.get('session');\n      if (session) {\n        var userOnLine = session.userOnLine || {};\n        userOnLine[senderUserId] = true;\n\n        session.userOnLine = userOnLine;\n        commandWatcher.notify(message);\n      }\n    },\n    AcceptMessage: function AcceptMessage(message) {\n      var session = cache$1.get('session');\n      if (!session) {\n        // 己方已挂断, 再收到对方 accept 消息时\n        return;\n      }\n      var params = session.params;\n      var sessionSenderUserId = session.senderUserId;\n      function hasInitRoom() {\n        return cache$1.get('initRoom') && sessionSenderUserId === getCurrentUserId$1();\n      }\n      function isSelf() {\n        return sessionSenderUserId === getCurrentUserId$1();\n      }\n      if (!hasInitRoom() && isSelf()) {\n        cache$1.set('initRoom', true);\n        initRoom(params);\n      }\n      // let already = session.already;\n\n      var senderUserId = message.senderUserId;\n      // 存储用户信息标识\n      var sentTime = message.sentTime;\n      var user = addUserRelation({\n        sentTime: sentTime,\n        senderUserId: senderUserId\n      });\n\n      var queue = cache$1.get('videoQueue');\n      var video = queue[user.userId] || queue[user.sender];\n      if (video) {\n        Consumer(video);\n      }\n\n      var isSender = message.messageDirection === 1;\n\n      if (isSender) {\n        otherClientHandler(message);\n        return;\n      }\n\n      // if (already) {\n      //     return;\n      // }\n\n      var content = message.content;\n\n      message.callInfo = {\n        mediaType: content.mediaType,\n        status: CallStatus$1.Active\n      };\n      stopTimer(message);\n\n      var channel = session.content.channelInfo;\n      var channelId = channel.Id;\n\n      // 过滤其他端的发送消息\n      var callInfo = session.callInfo || {};\n      if (!callInfo[channelId]) {\n        return;\n      }\n\n      session.already = true;\n      summayTimer.start();\n\n      var timer = callTimer[senderUserId] || {};\n      timer.status = CallStatus$1.Active;\n      commandWatcher.notify(message);\n    },\n    HungupMessage: function HungupMessage(message) {\n\n      var inviteUsers = cache$1.get('inviteUsers') || {};\n\n      var senderUserId = message.senderUserId;\n      // let conversationType = message.conversationType;\n\n      var session = cache$1.get('session');\n\n      if (!session) {\n        return;\n      }\n\n      var content = session.content;\n      var callId = content.channelInfo.Id;\n      var hungupContent = message.content;\n      var hungupCallId = hungupContent.callId;\n\n      if (callId !== hungupCallId) {\n        return;\n      }\n\n      message.callInfo = {\n        mediaType: content.mediaType,\n        status: CallStatus$1.Hangup\n      };\n\n      stopTimer(message);\n\n      delete inviteUsers[senderUserId];\n      delete callTimer[senderUserId]; // 挂断在邀请\n\n      var isReceived = message.messageDirection === MessgeDirection.RECEIVED;\n\n      if (isReceived) {\n        var _content = message.content;\n        var reasonCode = _content.reason;\n        // 兼容移动端拒绝时 reason = 3\n        if (reasonCode === 3 && summayTimer.startTime === 0) {\n          reasonCode = 2;\n        }\n\n        var getReason = reasonItem[reasonCode] || util.noop;\n        var reason = getReason() || {};\n\n        reasonCode = reason.code || reasonCode;\n\n        message.content.reason = reasonCode;\n\n        // content.reason = reasonCode;\n        // message.content.reason = reasonCode;\n        cache$1.set('hungupReason', reasonCode);\n      } else {\n        otherClientHandler(message);\n      }\n      commandWatcher.notify(message);\n    },\n    MediaModifyMessage: function MediaModifyMessage(message) {\n      commandWatcher.notify(message);\n    },\n    MemberModifyMessage: function MemberModifyMessage(message) {\n      // fix: 移动端与 PC 端属性名称不一致\n      if (message.content.existedUserPofiles) {\n        message.content.existedMemberStatusList = message.content.existedUserPofiles;\n      } else {\n        message.content.existedUserPofiles = message.content.existedMemberStatusList;\n      }\n      inviteItem['free'](message, false, false);\n    },\n    otherMessage: function otherMessage(message) {\n      commandWatcher.notify(message);\n    }\n  };\n\n  watch$1(function (message) {\n    var messageType = message.messageType;\n    messageType = messageType in messageHandler ? messageType : 'otherMessage';\n\n    var handler = messageHandler[messageType];\n    handler(message);\n  });\n\n  var getRoomId = function getRoomId(params) {\n    var random = Math.floor(Math.random() * 1000);\n    var info = [params.conversationType, params.targetId, random];\n    return info.join('_');\n  };\n\n  var sendCall = function sendCall(data, callback) {\n    var content = data.content;\n    var callId = content.callId;\n    var mediaType = content.mediaType;\n    var isSharing = data.isSharing;\n    var inviteUserIds = content.inviteUserIds;\n\n    var conversationType = data.conversationType;\n    var targetId = data.targetId;\n\n    cache$1.set('inviteUsers', array2Obj$1(inviteUserIds));\n\n    var params = {\n      command: 'invite',\n      data: data\n    };\n\n    sendCommand$1(params, function (error, result) {\n      if (error) {\n        callback({ code: error });\n      }\n\n      var callInfo = {};\n      callInfo[callId] = true;\n\n      result.callInfo = callInfo;\n      result.isSharing = isSharing;\n\n      //主叫方 userId 为 inviterMessage.sentTime\n      //被叫方 userId 为 AcceptMessage.sentTime\n      var sentTime = result.sentTime;\n      var senderUserId = result.senderUserId;\n\n      var userOnLine = result.userOnLine = {};\n      util.forEach(inviteUserIds, function (userId) {\n        userOnLine[userId] = false;\n      });\n\n      cache$1.update('session', result);\n\n      addUserRelation({\n        sentTime: sentTime,\n        senderUserId: senderUserId\n      });\n\n      var errorInfo = {\n        code: error\n      };\n\n      result.params = {\n        channelId: callId,\n        userId: senderUserId,\n        sentTime: sentTime,\n        mediaType: mediaType,\n        isSharing: isSharing\n      };\n\n      callback(errorInfo, result);\n\n      var params = {\n        conversationType: conversationType,\n        targetId: targetId,\n        userIds: inviteUserIds,\n        timer: 10,\n        mediaType: mediaType,\n        status: CallStatus$1.Dialing\n      };\n      calcTimeout(params);\n      //self\n      var self = {\n        conversationType: conversationType,\n        targetId: targetId,\n        userIds: [senderUserId],\n        timer: 10,\n        mediaType: mediaType,\n        status: CallStatus$1.Active\n      };\n      calcTimeout(self);\n      stopTimer(result);\n    });\n  };\n\n  var call = function call(params, callback) {\n\n    var cacheKey = 'session';\n\n    var session = cache$1.get(cacheKey);\n    if (session) {\n      var key = 'BUSYLINE4';\n      callback(Reason$2.get(key));\n      return;\n    }\n\n    var engineType = params.engineType || 4;\n\n    cache$1.set(callback, params);\n\n    callback = callback || util.noop;\n\n    var conversationType = params.conversationType;\n    var targetId = params.targetId;\n    var inviteUserIds = params.inviteUserIds;\n    var mediaType = params.mediaType;\n    var isSharing = params.isSharing;\n\n    var callId = getRoomId(params);\n    var channel = {\n      Key: '',\n      Id: callId\n    };\n\n    var observerUserIds = params.observerUserIds || [];\n    var data = {\n      isSharing: isSharing,\n      conversationType: conversationType,\n      targetId: targetId,\n      content: util.extend({\n        sharing: isSharing,\n        engineType: engineType,\n        inviteUserIds: inviteUserIds,\n        observerUserIds: observerUserIds,\n        mediaType: mediaType,\n        callId: callId,\n        channelInfo: channel\n      }, getSendExtraParams(params))\n    };\n\n    sendCall(data, function (error, result) {\n      callback(error.code, result);\n      // let params = result.params;\n      // params.engineType = engineType;\n      // initRoom(params);\n    });\n  };\n\n  var sendInvite = function sendInvite(data, callback) {\n    var content = data.content;\n    var inviteUserIds = content.inviteUserIds;\n\n    var inviteUsers = cache$1.get('inviteUsers');\n    util.forEach(inviteUserIds, function (userId) {\n      inviteUsers[userId] = userId;\n    });\n\n    var params = {\n      command: 'memberModify',\n      data: data\n    };\n    var conversationType = data.conversationType;\n    var targetId = data.targetId;\n    var mediaType = data.content.mediaType;\n    // console.log('send memberModify', data);\n    sendCommand$1(params, function (error, result) {\n      // let sentTime = result.sentTime;\n      // let senderUserId = result.senderUserId;\n\n      /*  addUserRelation({  //  群聊 A 已经在房间， A 邀请 B ，A的mediaId在第一次accept的时候已经确定！此 sentTime 是A 邀请 B的时间戳 不应该映射为 A 的mediaID。\n            sentTime: sentTime,\n            senderUserId: senderUserId\n          });*/\n\n      error = {\n        code: error\n      };\n\n      callback(error, result);\n\n      var params = {\n        conversationType: conversationType,\n        targetId: targetId,\n        userIds: inviteUserIds,\n        timer: 10,\n        mediaType: mediaType,\n        status: CallStatus$1.Dialing\n      };\n      calcTimeout(params);\n    });\n  };\n\n  var invite = function invite(params, callback) {\n    var cacheKey = 'session';\n\n    var session = cache$1.get(cacheKey);\n\n    var info = 'Invite: Not call yet';\n    checkSession({\n      session: session,\n      info: info\n    });\n\n    callback = callback || util.noop;\n\n    session = cache$1.get('session');\n    var conversationType = params.conversationType;\n    var targetId = params.targetId;\n\n    var content = session.content;\n    var callId = content.callId;\n\n    var caller = session.senderUserId;\n    var engineType = params.engineType || 4;\n    var channel = {\n      Key: '',\n      Id: callId\n    };\n\n    var mediaType = params.mediaType;\n    var inviteUserIds = params.inviteUserIds;\n    // let isSharing = params.isSharing;\n\n    var modifyMemType = 1;\n\n    var existList = [];\n\n    util.forEach(callTimer, function (timer, userId) {\n      var sendTimeFrom = session[userId];\n      var member = {\n        userId: userId,\n        mediaId: getMediaID$1({\n          sentTime: sendTimeFrom,\n          userId: userId\n        }), //ios o只支持string 类型\n        mediaType: timer.mediaType,\n        callStatus: timer.status\n      };\n      existList.push(member);\n    });\n\n    var currentUserId = getCurrentUserId$1() || config$1.currentUserId;\n    var sendTimeSelf = session[currentUserId];\n    var currentUser = {\n      userId: currentUserId,\n      mediaId: getMediaID$1({\n        sentTime: sendTimeSelf,\n        userId: currentUserId\n      }),\n      mediaType: mediaType,\n      callStatus: CallStatus$1.Active\n    };\n    var userIDs = existList.map(function (user) {\n      return user.userId;\n    });\n    if (userIDs.indexOf(currentUser.userId) < 0) existList.push(currentUser);\n\n    var observerUserIds = params.observerUserIds || [];\n    var data = {\n      conversationType: conversationType,\n      targetId: targetId,\n      content: util.extend({\n        modifyMemType: modifyMemType,\n        callId: callId,\n        caller: caller,\n        engineType: engineType,\n        channelInfo: channel,\n        mediaType: mediaType,\n        inviteUserIds: inviteUserIds,\n        existedMemberStatusList: existList,\n        existedUserPofiles: existList,\n        observerUserIds: observerUserIds,\n        extra: params.extra\n      }, getSendExtraParams(params))\n    };\n\n    sendInvite(data, callback);\n  };\n\n  var sendAccept = function sendAccept(params, callback) {\n    callback = callback || util.noop;\n\n    var conversationType = params.conversationType;\n    var targetId = params.targetId;\n    var userType = params.userType;\n    var mediaType = params.mediaType;\n    var isSharing = params.isSharing;\n\n    var session = cache$1.get('session');\n\n    var from = params.from;\n    var info = from + ': Not call yet';\n    checkSession({\n      session: session,\n      info: info\n    });\n\n    var engineType = params.engineType;\n\n    var content = session.content;\n    var callId = content.callId;\n\n    params = {\n      command: 'accept',\n      data: {\n        conversationType: conversationType,\n        targetId: targetId,\n        content: util.extend({\n          callId: callId,\n          mediaType: mediaType\n        }, getSendExtraParams(params))\n      }\n    };\n\n    sendCommand$1(params, function (error, command) {\n      if (error) {\n        return callback(error);\n      }\n\n      var sentTime = command.sentTime;\n      var channelId = content.callId;\n      var userId = command.senderUserId;\n\n      command.callInfo = {\n        mediaType: content.mediaType,\n        status: CallStatus$1.Active\n      };\n\n      stopTimer(command);\n\n      addUserRelation({\n        sentTime: sentTime,\n        senderUserId: userId\n      });\n\n      var params = {\n\n        channelId: channelId,\n        userId: userId,\n        sentTime: sentTime,\n        mediaType: mediaType,\n        isSharing: isSharing,\n        engineType: engineType,\n        userType: userType\n      };\n      callTimer[userId].status = CallStatus$1.Active;\n      if (conversationType === 3) {\n        cache$1.set('joinRoom', true);\n      }\n      initRoom(params, callback, command);\n      summayTimer.start();\n\n      // callback(null, command);\n    });\n  };\n\n  var accept = function accept(params, callback) {\n    params.form = 'accept';\n    sendAccept(params, callback);\n  };\n\n  var join = function join(params) {\n    params.form = 'join';\n    sendAccept(params);\n  };\n\n  var hungup = function hungup(params, callback) {\n    params.from = 'hungup';\n    var key = 'CANCEL1';\n    util.forEach(callTimer, function (timer, userId) {\n      if (timer.status === CallStatus$1.Active && userId !== getCurrentUserId$1()) {\n        key = 'HANGUP3';\n      }\n    });\n\n    var conversationType = params.conversationType;\n    if (params.passive) {\n      key = cache$1.get('hungupReason') || key;\n      if (isGroup(conversationType)) {\n        if (callTimer[getCurrentUserId$1()].status === CallStatus$1.Active) {\n          key = 'REMOTE_HANGUP13';\n        } else {\n          key = 'NO_RESPONSE5';\n        }\n      }\n    }\n    params.reasonKey = key;\n    sendHungup(params, callback);\n  };\n\n  var reject = function reject(params, callback) {\n    params = params || {};\n    params.from = 'reject';\n    params.reasonKey = 'REJECT2';\n    sendHungup(params, callback);\n  };\n\n  // let quit = function (params, callback) {\n  //   params.reasonKey = 'HANGUP3';\n  //   sendHungup(params, callback);\n  // };\n\n  var mute = function mute() {\n    var params = {\n      isEnabled: false\n    };\n    enableAudio$1(params);\n  };\n\n  var unmute = function unmute() {\n    var params = {\n      isEnabled: true\n    };\n    enableAudio$1(params);\n  };\n\n  var sendMediaModify = function sendMediaModify(mediaType, callback) {\n    var session = cache$1.get('session');\n    var content = session.content;\n    var callId = content.callId;\n    // mediaType = mediaType;\n    var conversationType = session.conversationType;\n    var targetId = session.targetId;\n\n    var params = {\n      command: 'mediaModify',\n      data: {\n        conversationType: conversationType,\n        targetId: targetId,\n        content: {\n          callId: callId,\n          mediaType: mediaType\n        }\n      }\n    };\n\n    session.content.mediaType = mediaType;\n    cache$1.get('session', session);\n\n    sendCommand$1(params, callback);\n  };\n\n  var videoToAudio = function videoToAudio(callback) {\n    var params = {\n      isEnabled: false\n    };\n    enableVideo$1(params);\n    // TODO\n    var mediaType = 1;\n    sendMediaModify(mediaType, callback);\n  };\n\n  var audioToVideo = function audioToVideo(callback) {\n    var deviceEnable = util.deviceEnable;\n    if (!deviceEnable.camera) {\n      return callback && callback(EnumReason.DEVICE_ERROR.code, EnumReason.DEVICE_ERROR.info);\n    }\n\n    var params = {\n      isEnabled: true\n    };\n    enableVideo$1(params);\n    // TODO\n    var mediaType = 2;\n    sendMediaModify(mediaType, callback);\n  };\n  var requestWhiteBoardURL$1 = function requestWhiteBoardURL() {\n    RongVoIP.requestWhiteBoardURL();\n  };\n\n  var videoWatch = function videoWatch(watcher) {\n    videoWatcher.add(watcher);\n  };\n  var meetCommandWatche = function meetCommandWatche(watcher) {\n    meetCommandWatcher.add(watcher);\n  };\n  var commandWatch = function commandWatch(watcher) {\n    commandWatcher.add(watcher);\n  };\n  var CallVIdeoProfile = {\n    20: 'VIDEO_PROFILE_240P',\n    40: ' VIDEO_PROFILE_480P',\n    50: 'VIDEO_PROFILE_720P'\n  };\n  var setVideoProfile$1 = function setVideoProfile(profile) {\n    var enableProfile = CallVIdeoProfile[profile];\n    RongVoIP.setVideoProfile(enableProfile);\n  };\n  var startScreenShare$1 = function startScreenShare(stream) {\n    RongVoIP.startScreenShare(stream);\n  };\n  var stopScreenShare$1 = function stopScreenShare() {\n    RongVoIP.stopScreenShare();\n  };\n\n  var init = function init(cfg, rongRTCStream) {\n\n    if (cfg.watch) {\n      cfg.watch(function (message) {\n        msgWatcher.notify(message);\n      });\n    } else {\n      MessageCtrl.watch(function (message) {\n        msgWatcher.notify(message);\n      });\n    }\n\n    return {\n      videoWatch: videoWatch,\n      commandWatch: commandWatch,\n\n      call: call,\n      invite: invite,\n      accept: accept,\n      hungup: hungup,\n      reject: reject,\n      join: join,\n      mute: mute,\n      unmute: unmute,\n      videoToAudio: videoToAudio,\n      audioToVideo: audioToVideo,\n      meetCommandWatche: meetCommandWatche,\n      requestWhiteBoardURL: requestWhiteBoardURL$1,\n      startScreenShare: startScreenShare$1,\n      stopScreenShare: stopScreenShare$1,\n      setVideoProfile: setVideoProfile$1,\n      rongRTCStream: rongRTCStream\n    };\n  };\n\n  var CallLib = function CallLib(cfg) {\n    classCallCheck(this, CallLib);\n\n    if (!cfg.RongIMLib) {\n      throw new Error('请引入请引入 Web SDK : http://www.rongcloud.cn/docs/web.html#sdk');\n    }\n    util.extend(config$1, cfg);\n    module$1.setRongIMLib(cfg.RongIMLib);\n    module$1.setRongRTC(cfg.RongRTC);\n    MessageCtrl.setVoipProvider();\n    var rongRTCStream = RongVoIP.setConfig(config$1);\n    if (cfg.sendCommand) {\n      sendCommand$1 = cfg.sendCommand;\n    }\n    return init(cfg, rongRTCStream);\n  };\n\n  var RongCallLib = {\n    init: function init(cfg) {\n      try {\n        if (!util.isSupportedBrowser()) {\n          util.console.error('This browser is not supported at this time. Please use Chrome 57+ or Safari 12+ to access it');\n        }\n        if (!util.isSupportedPlatform()) {\n          util.console.error('Mobile is not supported at this time, please use PC to access');\n        }\n        if (!util.isSupportedProtocol()) {\n          util.console.error('The web site must be localhost or https');\n        }\n      } catch (e) {\n        util.console.error('init error', e);\n      }\n      return new CallLib(cfg);\n    }\n  };\n\n  return RongCallLib;\n\n})));\n"
  },
  {
    "path": "calllib-v3/web-ie/lib/RongIMLib-2.5.1.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.6.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n            this.socket.fire(\"disconnect\", code);\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            modules.setRoomType(0);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            this.observers.push(observer);\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "calllib-v3/web-ie/lib/RongRTC-IE-3.0.4.js",
    "content": "/*\n* RongRTC.js v3.0.4\n* Copyright 2019 RongCloud\n* Released under the MIT License.\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongRTC = factory());\n}(this, (function () { 'use strict';\n\n  var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n    return typeof obj;\n  } : function (obj) {\n    return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n  };\n\n  var classCallCheck = function (instance, Constructor) {\n    if (!(instance instanceof Constructor)) {\n      throw new TypeError(\"Cannot call a class as a function\");\n    }\n  };\n\n  var createClass = function () {\n    function defineProperties(target, props) {\n      for (var i = 0; i < props.length; i++) {\n        var descriptor = props[i];\n        descriptor.enumerable = descriptor.enumerable || false;\n        descriptor.configurable = true;\n        if (\"value\" in descriptor) descriptor.writable = true;\n        Object.defineProperty(target, descriptor.key, descriptor);\n      }\n    }\n\n    return function (Constructor, protoProps, staticProps) {\n      if (protoProps) defineProperties(Constructor.prototype, protoProps);\n      if (staticProps) defineProperties(Constructor, staticProps);\n      return Constructor;\n    };\n  }();\n\n  var defineProperty = function (obj, key, value) {\n    if (key in obj) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      obj[key] = value;\n    }\n\n    return obj;\n  };\n\n  var inherits = function (subClass, superClass) {\n    if (typeof superClass !== \"function\" && superClass !== null) {\n      throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n    }\n\n    subClass.prototype = Object.create(superClass && superClass.prototype, {\n      constructor: {\n        value: subClass,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n    if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n  };\n\n  var possibleConstructorReturn = function (self, call) {\n    if (!self) {\n      throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n    }\n\n    return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n  };\n\n  var slicedToArray = function () {\n    function sliceIterator(arr, i) {\n      var _arr = [];\n      var _n = true;\n      var _d = false;\n      var _e = undefined;\n\n      try {\n        for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n          _arr.push(_s.value);\n\n          if (i && _arr.length === i) break;\n        }\n      } catch (err) {\n        _d = true;\n        _e = err;\n      } finally {\n        try {\n          if (!_n && _i[\"return\"]) _i[\"return\"]();\n        } finally {\n          if (_d) throw _e;\n        }\n      }\n\n      return _arr;\n    }\n\n    return function (arr, i) {\n      if (Array.isArray(arr)) {\n        return arr;\n      } else if (Symbol.iterator in Object(arr)) {\n        return sliceIterator(arr, i);\n      } else {\n        throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n      }\n    };\n  }();\n\n  var toConsumableArray = function (arr) {\n    if (Array.isArray(arr)) {\n      for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n      return arr2;\n    } else {\n      return Array.from(arr);\n    }\n  };\n\n  /*!\n   基于 es6-promise\n   * @overview es6-promise - a tiny implementation of Promises/A+.\n   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n   * @license   Licensed under MIT license\n   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n   * @version   v4.2.8+1e68dce6\n   */\n\n  function objectOrFunction(x) {\n    var type = typeof x === 'undefined' ? 'undefined' : _typeof(x);\n    return x !== null && (type === 'object' || type === 'function');\n  }\n\n  function isFunction(x) {\n    return typeof x === 'function';\n  }\n\n  var _isArray = void 0;\n  if (Array.isArray) {\n    _isArray = Array.isArray;\n  } else {\n    _isArray = function _isArray(x) {\n      return Object.prototype.toString.call(x) === '[object Array]';\n    };\n  }\n\n  var isArray = _isArray;\n\n  var len = 0;\n  var vertxNext = void 0;\n  var customSchedulerFn = void 0;\n\n  var asap = function asap(callback, arg) {\n    queue[len] = callback;\n    queue[len + 1] = arg;\n    len += 2;\n    if (len === 2) {\n      // If len is 2, that means that we need to schedule an async flush.\n      // If additional callbacks are queued before the queue is flushed, they\n      // will be processed by this flush that we are scheduling.\n      if (customSchedulerFn) {\n        customSchedulerFn(flush);\n      } else {\n        scheduleFlush();\n      }\n    }\n  };\n\n  function setScheduler(scheduleFn) {\n    customSchedulerFn = scheduleFn;\n  }\n\n  function setAsap(asapFn) {\n    asap = asapFn;\n  }\n\n  var browserWindow = typeof window !== 'undefined' ? window : undefined;\n  var browserGlobal = browserWindow || {};\n  var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n  var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n  // test for web worker but not in IE10\n  var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n  // node\n  function useNextTick() {\n    // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n    // see https://github.com/cujojs/when/issues/410 for details\n    return function () {\n      return process.nextTick(flush);\n    };\n  }\n\n  // vertx\n  function useVertxTimer() {\n    if (typeof vertxNext !== 'undefined') {\n      return function () {\n        vertxNext(flush);\n      };\n    }\n\n    return useSetTimeout();\n  }\n\n  function useMutationObserver() {\n    var iterations = 0;\n    var observer = new BrowserMutationObserver(flush);\n    var node = document.createTextNode('');\n    observer.observe(node, { characterData: true });\n\n    return function () {\n      node.data = iterations = ++iterations % 2;\n    };\n  }\n\n  // web worker\n  function useMessageChannel() {\n    var channel = new MessageChannel();\n    channel.port1.onmessage = flush;\n    return function () {\n      return channel.port2.postMessage(0);\n    };\n  }\n\n  function useSetTimeout() {\n    // Store setTimeout reference so es6-promise will be unaffected by\n    // other code modifying setTimeout (like sinon.useFakeTimers())\n    var globalSetTimeout = setTimeout;\n    return function () {\n      return globalSetTimeout(flush, 1);\n    };\n  }\n\n  var queue = new Array(1000);\n  function flush() {\n    for (var i = 0; i < len; i += 2) {\n      var callback = queue[i];\n      var arg = queue[i + 1];\n\n      callback(arg);\n\n      queue[i] = undefined;\n      queue[i + 1] = undefined;\n    }\n\n    len = 0;\n  }\n\n  function attemptVertx() {\n    try {\n      var vertx = Function('return this')().require('vertx');\n      vertxNext = vertx.runOnLoop || vertx.runOnContext;\n      return useVertxTimer();\n    } catch (e) {\n      return useSetTimeout();\n    }\n  }\n\n  var scheduleFlush = void 0;\n  // Decide what async method to use to triggering processing of queued callbacks:\n  if (isNode) {\n    scheduleFlush = useNextTick();\n  } else if (BrowserMutationObserver) {\n    scheduleFlush = useMutationObserver();\n  } else if (isWorker) {\n    scheduleFlush = useMessageChannel();\n  } else if (browserWindow === undefined && typeof require === 'function') {\n    scheduleFlush = attemptVertx();\n  } else {\n    scheduleFlush = useSetTimeout();\n  }\n\n  function then(onFulfillment, onRejection) {\n    var parent = this;\n\n    var child = new this.constructor(noop);\n\n    if (child[PROMISE_ID] === undefined) {\n      makePromise(child);\n    }\n\n    var _state = parent._state;\n\n    if (_state) {\n      var callback = arguments[_state - 1];\n      asap(function () {\n        return invokeCallback(_state, child, callback, parent._result);\n      });\n    } else {\n      subscribe(parent, child, onFulfillment, onRejection);\n    }\n\n    return child;\n  }\n\n  /**\n   \n    @method resolve\n    @static\n    @param {Any} value value that the returned promise will be resolved with\n    Useful for tooling.\n    @return {Promise} a promise that will become fulfilled with the given\n    `value`\n  */\n  function resolve$1(object) {\n    /*jshint validthis:true */\n    var Constructor = this;\n\n    if (object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object.constructor === Constructor) {\n      return object;\n    }\n\n    var promise = new Constructor(noop);\n    resolve(promise, object);\n    return promise;\n  }\n\n  var PROMISE_ID = Math.random().toString(36).substring(2);\n\n  function noop() {}\n\n  var PENDING = void 0;\n  var FULFILLED = 1;\n  var REJECTED = 2;\n\n  function selfFulfillment() {\n    return new TypeError(\"You cannot resolve a promise with itself\");\n  }\n\n  function cannotReturnOwn() {\n    return new TypeError('A promises callback cannot return that same promise.');\n  }\n\n  function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n    try {\n      then$$1.call(value, fulfillmentHandler, rejectionHandler);\n    } catch (e) {\n      return e;\n    }\n  }\n\n  function handleForeignThenable(promise, thenable, then$$1) {\n    asap(function (promise) {\n      var sealed = false;\n      var error = tryThen(then$$1, thenable, function (value) {\n        if (sealed) {\n          return;\n        }\n        sealed = true;\n        if (thenable !== value) {\n          resolve(promise, value);\n        } else {\n          fulfill(promise, value);\n        }\n      }, function (reason) {\n        if (sealed) {\n          return;\n        }\n        sealed = true;\n\n        reject(promise, reason);\n      }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n      if (!sealed && error) {\n        sealed = true;\n        reject(promise, error);\n      }\n    }, promise);\n  }\n\n  function handleOwnThenable(promise, thenable) {\n    if (thenable._state === FULFILLED) {\n      fulfill(promise, thenable._result);\n    } else if (thenable._state === REJECTED) {\n      reject(promise, thenable._result);\n    } else {\n      subscribe(thenable, undefined, function (value) {\n        return resolve(promise, value);\n      }, function (reason) {\n        return reject(promise, reason);\n      });\n    }\n  }\n\n  function handleMaybeThenable(promise, maybeThenable, then$$1) {\n    if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n      handleOwnThenable(promise, maybeThenable);\n    } else {\n      if (then$$1 === undefined) {\n        fulfill(promise, maybeThenable);\n      } else if (isFunction(then$$1)) {\n        handleForeignThenable(promise, maybeThenable, then$$1);\n      } else {\n        fulfill(promise, maybeThenable);\n      }\n    }\n  }\n\n  function resolve(promise, value) {\n    if (promise === value) {\n      reject(promise, selfFulfillment());\n    } else if (objectOrFunction(value)) {\n      var then$$1 = void 0;\n      try {\n        then$$1 = value.then;\n      } catch (error) {\n        reject(promise, error);\n        return;\n      }\n      handleMaybeThenable(promise, value, then$$1);\n    } else {\n      fulfill(promise, value);\n    }\n  }\n\n  function publishRejection(promise) {\n    if (promise._onerror) {\n      promise._onerror(promise._result);\n    }\n\n    publish(promise);\n  }\n\n  function fulfill(promise, value) {\n    if (promise._state !== PENDING) {\n      return;\n    }\n\n    promise._result = value;\n    promise._state = FULFILLED;\n\n    if (promise._subscribers.length !== 0) {\n      asap(publish, promise);\n    }\n  }\n\n  function reject(promise, reason) {\n    if (promise._state !== PENDING) {\n      return;\n    }\n    promise._state = REJECTED;\n    promise._result = reason;\n\n    asap(publishRejection, promise);\n  }\n\n  function subscribe(parent, child, onFulfillment, onRejection) {\n    var _subscribers = parent._subscribers;\n    var length = _subscribers.length;\n\n    parent._onerror = null;\n\n    _subscribers[length] = child;\n    _subscribers[length + FULFILLED] = onFulfillment;\n    _subscribers[length + REJECTED] = onRejection;\n\n    if (length === 0 && parent._state) {\n      asap(publish, parent);\n    }\n  }\n\n  function publish(promise) {\n    var subscribers = promise._subscribers;\n    var settled = promise._state;\n\n    if (subscribers.length === 0) {\n      return;\n    }\n\n    var child = void 0,\n        callback = void 0,\n        detail = promise._result;\n\n    for (var i = 0; i < subscribers.length; i += 3) {\n      child = subscribers[i];\n      callback = subscribers[i + settled];\n\n      if (child) {\n        invokeCallback(settled, child, callback, detail);\n      } else {\n        callback(detail);\n      }\n    }\n\n    promise._subscribers.length = 0;\n  }\n\n  function invokeCallback(settled, promise, callback, detail) {\n    var hasCallback = isFunction(callback),\n        value = void 0,\n        error = void 0,\n        succeeded = true;\n\n    if (hasCallback) {\n      try {\n        value = callback(detail);\n      } catch (e) {\n        succeeded = false;\n        error = e;\n      }\n\n      if (promise === value) {\n        reject(promise, cannotReturnOwn());\n        return;\n      }\n    } else {\n      value = detail;\n    }\n\n    if (promise._state !== PENDING) ; else if (hasCallback && succeeded) {\n      resolve(promise, value);\n    } else if (succeeded === false) {\n      reject(promise, error);\n    } else if (settled === FULFILLED) {\n      fulfill(promise, value);\n    } else if (settled === REJECTED) {\n      reject(promise, value);\n    }\n  }\n\n  function initializePromise(promise, resolver) {\n    try {\n      resolver(function resolvePromise(value) {\n        resolve(promise, value);\n      }, function rejectPromise(reason) {\n        reject(promise, reason);\n      });\n    } catch (e) {\n      reject(promise, e);\n    }\n  }\n\n  var id = 0;\n  function nextId() {\n    return id++;\n  }\n\n  function makePromise(promise) {\n    promise[PROMISE_ID] = id++;\n    promise._state = undefined;\n    promise._result = undefined;\n    promise._subscribers = [];\n  }\n\n  function validationError() {\n    return new Error('Array Methods must be provided an Array');\n  }\n\n  var Enumerator = function () {\n    function Enumerator(Constructor, input) {\n      this._instanceConstructor = Constructor;\n      this.promise = new Constructor(noop);\n\n      if (!this.promise[PROMISE_ID]) {\n        makePromise(this.promise);\n      }\n\n      if (isArray(input)) {\n        this.length = input.length;\n        this._remaining = input.length;\n\n        this._result = new Array(this.length);\n\n        if (this.length === 0) {\n          fulfill(this.promise, this._result);\n        } else {\n          this.length = this.length || 0;\n          this._enumerate(input);\n          if (this._remaining === 0) {\n            fulfill(this.promise, this._result);\n          }\n        }\n      } else {\n        reject(this.promise, validationError());\n      }\n    }\n\n    Enumerator.prototype._enumerate = function _enumerate(input) {\n      for (var i = 0; this._state === PENDING && i < input.length; i++) {\n        this._eachEntry(input[i], i);\n      }\n    };\n\n    Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n      var c = this._instanceConstructor;\n      var resolve$$1 = c.resolve;\n\n      if (resolve$$1 === resolve$1) {\n        var _then = void 0;\n        var error = void 0;\n        var didError = false;\n        try {\n          _then = entry.then;\n        } catch (e) {\n          didError = true;\n          error = e;\n        }\n\n        if (_then === then && entry._state !== PENDING) {\n          this._settledAt(entry._state, i, entry._result);\n        } else if (typeof _then !== 'function') {\n          this._remaining--;\n          this._result[i] = entry;\n        } else if (c === Promise$1) {\n          var promise = new c(noop);\n          if (didError) {\n            reject(promise, error);\n          } else {\n            handleMaybeThenable(promise, entry, _then);\n          }\n          this._willSettleAt(promise, i);\n        } else {\n          this._willSettleAt(new c(function (resolve$$1) {\n            return resolve$$1(entry);\n          }), i);\n        }\n      } else {\n        this._willSettleAt(resolve$$1(entry), i);\n      }\n    };\n\n    Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n      var promise = this.promise;\n\n      if (promise._state === PENDING) {\n        this._remaining--;\n\n        if (state === REJECTED) {\n          reject(promise, value);\n        } else {\n          this._result[i] = value;\n        }\n      }\n\n      if (this._remaining === 0) {\n        fulfill(promise, this._result);\n      }\n    };\n\n    Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n      var enumerator = this;\n\n      subscribe(promise, undefined, function (value) {\n        return enumerator._settledAt(FULFILLED, i, value);\n      }, function (reason) {\n        return enumerator._settledAt(REJECTED, i, reason);\n      });\n    };\n\n    return Enumerator;\n  }();\n\n  /**\n    @method all\n    @static\n    @param {Array} entries array of promises\n    @param {String} label optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise} promise that is fulfilled when all `promises` have been\n    fulfilled, or rejected if any of them become rejected.\n    @static\n  */\n  function all(entries) {\n    return new Enumerator(this, entries).promise;\n  }\n\n  /**\n    @method race\n    @static\n    @param {Array} promises array of promises to observe\n    Useful for tooling.\n    @return {Promise} a promise which settles in the same way as the first passed\n    promise to settle.\n  */\n  function race(entries) {\n    /*jshint validthis:true */\n    var Constructor = this;\n\n    if (!isArray(entries)) {\n      return new Constructor(function (_, reject) {\n        return reject(new TypeError('You must pass an array to race.'));\n      });\n    } else {\n      return new Constructor(function (resolve, reject) {\n        var length = entries.length;\n        for (var i = 0; i < length; i++) {\n          Constructor.resolve(entries[i]).then(resolve, reject);\n        }\n      });\n    }\n  }\n\n  /**\n    @method reject\n    @static\n    @param {Any} reason value that the returned promise will be rejected with.\n    Useful for tooling.\n    @return {Promise} a promise rejected with the given `reason`.\n  */\n  function reject$1(reason) {\n    /*jshint validthis:true */\n    var Constructor = this;\n    var promise = new Constructor(noop);\n    reject(promise, reason);\n    return promise;\n  }\n\n  function needsResolver() {\n    throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n  }\n\n  function needsNew() {\n    throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n  }\n\n  /**\n    @class Promise\n    @param {Function} resolver\n    Useful for tooling.\n    @constructor\n  */\n\n  var Promise$1 = function () {\n    function Promise(resolver) {\n      this[PROMISE_ID] = nextId();\n      this._result = this._state = undefined;\n      this._subscribers = [];\n\n      if (noop !== resolver) {\n        typeof resolver !== 'function' && needsResolver();\n        this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n      }\n    }\n\n    /**\n     @method then\n    @param {Function} onFulfilled\n    @param {Function} onRejected\n    Useful for tooling.\n    @return {Promise}\n    */\n\n    /**\n    @method catch\n    @param {Function} onRejection\n    Useful for tooling.\n    @return {Promise}\n    */\n\n    Promise.prototype['catch'] = function _catch(onRejection) {\n      return this.then(null, onRejection);\n    };\n\n    /**\n      @method finally\n      @param {Function} callback\n      @return {Promise}\n    */\n\n    Promise.prototype['finally'] = function _finally(callback) {\n      var promise = this;\n      var constructor = promise.constructor;\n\n      if (isFunction(callback)) {\n        return promise.then(function (value) {\n          return constructor.resolve(callback()).then(function () {\n            return value;\n          });\n        }, function (reason) {\n          return constructor.resolve(callback()).then(function () {\n            throw reason;\n          });\n        });\n      }\n\n      return promise.then(callback, callback);\n    };\n\n    return Promise;\n  }();\n\n  Promise$1.prototype.then = then;\n  Promise$1.all = all;\n  Promise$1.race = race;\n  Promise$1.resolve = resolve$1;\n  Promise$1.reject = reject$1;\n  Promise$1._setScheduler = setScheduler;\n  Promise$1._setAsap = setAsap;\n  Promise$1._asap = asap;\n\n  /*global self*/\n  function polyfill() {\n    var local = void 0;\n\n    if (typeof global !== 'undefined') {\n      local = global;\n    } else if (typeof self !== 'undefined') {\n      local = self;\n    } else {\n      try {\n        local = Function('return this')();\n      } catch (e) {\n        throw new Error('polyfill failed because global object is unavailable in this environment');\n      }\n    }\n\n    var P = local.Promise;\n\n    if (P) {\n      var promiseToString = null;\n      try {\n        promiseToString = Object.prototype.toString.call(P.resolve());\n      } catch (e) {\n        // silently ignored\n      }\n\n      if (promiseToString === '[object Promise]' && !P.cast) {\n        return;\n      }\n    }\n\n    local.Promise = Promise$1;\n  }\n\n  // Strange compat..\n  Promise$1.polyfill = polyfill;\n  Promise$1.Promise = Promise$1;\n\n  var _IE_RESOLUTION_TO_BIT;\n\n  var StreamType = {\n    NODE: -1,\n    AUDIO: 0,\n    VIDEO: 1,\n    AUDIO_AND_VIDEO: 2\n  };\n\n  var StreamSize = {\n    MAX: 1,\n    MIN: 2\n  };\n\n  var StreamState = {\n    ENABLE: 1,\n    DISBALE: 0\n  };\n\n  var UserState = {\n    JOINED: 0,\n    LEFT: 1,\n    OFFLINE: 2\n  };\n\n  var PingCount = 4;\n\n  var LogTag = {\n    ICE: 'ice',\n    LIFECYCLE: 'lifecycle',\n    ROOM: 'room',\n    STREAM: 'stream',\n    STREAM_HANDLER: 'stream_handler',\n    ROOM_HANDLER: 'room_handler',\n    STORAGE_HANDLER: 'storage_handler',\n    IM: 'im',\n    MESSAGE: 'message',\n    DEVICE: 'device',\n    IE_NOTIFY: 'ie_notify'\n  };\n\n  var LogLevel = {\n    INFO: 'I',\n    DEBUG: 'D',\n    VERBOSE: 'V',\n    WARN: 'W',\n    ERROR: 'E'\n  };\n\n  var EventType = {\n    REQUEST: 1,\n    RESPONSE: 2\n  };\n\n  var StorageType = {\n    ROOM: 1,\n    USER: 2\n  };\n\n  var REGEXP_ROOM_ID = /[A-Za-z0-9+=-_]+$/;\n\n  var LENGTH_ROOM_ID = 64;\n  var MIN_STREAM_SUFFIX = 'tiny';\n\n  var AUDIO_LEVEL = [0, 1, 2, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9];\n\n  var REPORT_FREQUENCY = 1 * 1000;\n\n  var REQUEST_TIMEOUT = 5 * 1000;\n\n  var MEDIASERVER_SUCCESS = 10000;\n\n  var IE9_REQUEST_SUCCESS = 0;\n\n  var RTC_MODE = {\n    RTC: 0,\n    LIVE: 1\n  };\n\n  var TAG_V2 = '';\n\n  var IE_ENABLE = {\n    CLOSE: 0,\n    OPEN: 1\n  };\n\n  var IE_RESPONSE = {\n    SUCCESS: 0\n  };\n\n  var IE_MEDIA_TYPE = {\n    AUDIO: 1,\n    VIDEO: 2,\n    AUDIO_AND_VIDEO: 3\n  };\n\n  var IE_RESOLUTION = {\n    'Solution_256_144': 1,\n    'Solution_320_240': 2,\n    'Solution_480_360': 3,\n    'Solution_640_360': 4,\n    'Solution_640_480': 5,\n    'Solution_720_480': 6,\n    'Solution_1280_720': 7,\n    'Solution_1920_1080': 8\n  };\n\n  var IE_RESOLUTION_TO_BITRATE = (_IE_RESOLUTION_TO_BIT = {}, defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_256_144'], {\n    max: 150,\n    min: 30\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_320_240'], {\n    max: 500,\n    min: 150\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_480_360'], {\n    max: 650,\n    min: 200\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_640_360'], {\n    max: 800,\n    min: 250\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_640_480'], {\n    max: 1000,\n    min: 350\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_720_480'], {\n    max: 1200,\n    min: 400\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_1280_720'], {\n    max: 2500,\n    min: 750\n  }), defineProperty(_IE_RESOLUTION_TO_BIT, IE_RESOLUTION['Solution_1920_1080'], {\n    max: 4500,\n    min: 1500\n  }), _IE_RESOLUTION_TO_BIT);\n\n  var IE_FRAME_RATE = {\n    'Rate_5': 1,\n    'Rate_10': 2,\n    'Rate_15': 3,\n    'Rate_20': 4,\n    'Rate_25': 5,\n    'Rate_30': 6\n  };\n\n  var IE_ROTATE = {\n    NONE: 0,\n    ROTATE_X: 1\n  };\n\n  var IE_TAG = {\n    RTC: 'RongCloudRTC',\n    ScreenShare: 'screenshare'\n  };\n\n  var IE_NOTIFY_EVENT = {\n    ICE_CONNECTION_CHANGE: 1,\n    VIDEO_RENDER_CHANGE: 2\n  };\n\n  var noop$1 = function noop() {};\n  var isObject = function isObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  };\n  var isArray$1 = function isArray(arr) {\n    return Object.prototype.toString.call(arr) === '[object Array]';\n  };\n  var isFunction$1 = function isFunction(arr) {\n    return Object.prototype.toString.call(arr) === '[object Function]';\n  };\n  var isString = function isString(str) {\n    return Object.prototype.toString.call(str) === '[object String]';\n  };\n  var isBoolean = function isBoolean(str) {\n    return Object.prototype.toString.call(str) === '[object Boolean]';\n  };\n  var isUndefined = function isUndefined(str) {\n    return Object.prototype.toString.call(str) === '[object Undefined]';\n  };\n  var isNull = function isNull(str) {\n    return Object.prototype.toString.call(str) === '[object Null]';\n  };\n  var isNumber = function isNumber(str) {\n    return Object.prototype.toString.call(str) === '[object Number]';\n  };\n  var stringify = function stringify(obj) {\n    return JSON.stringify(obj);\n  };\n  var parse = function parse(str) {\n    var value = str;\n    try {\n      value = JSON.parse(str);\n    } catch (e) {}\n    return value;\n  };\n  var toJSON = function toJSON(value) {\n    return JSON.stringify(value);\n  };\n  var forEach = function forEach(obj, callback) {\n    callback = callback || noop$1;\n    var loopObj = function loopObj() {\n      for (var key in obj) {\n        callback(obj[key], key, obj);\n      }\n    };\n    var loopArr = function loopArr() {\n      for (var i = 0, len = obj.length; i < len; i++) {\n        callback(obj[i], i);\n      }\n    };\n    if (isObject(obj)) {\n      loopObj();\n    }\n    if (isArray$1(obj)) {\n      loopArr();\n    }\n  };\n  var isEmpty = function isEmpty(obj) {\n    var result = true;\n    if (isObject(obj)) {\n      forEach(obj, function () {\n        result = false;\n      });\n    }\n    if (isString(obj) || isArray$1(obj)) {\n      result = obj.length === 0;\n    }\n    return result;\n  };\n  var rename = function rename(origin, newNames) {\n    var isObj = isObject(origin);\n    if (isObj) {\n      origin = [origin];\n    }\n    origin = parse(stringify(origin));\n    var updateProperty = function updateProperty(val, key, obj) {\n      delete obj[key];\n      key = newNames[key];\n      obj[key] = val;\n    };\n    forEach(origin, function (item) {\n      forEach(item, function (val, key, obj) {\n        var isRename = key in newNames;\n        (isRename ? updateProperty : noop$1)(val, key, obj);\n      });\n    });\n    return isObject ? origin[0] : origin;\n  };\n  var extend = function extend(destination, sources) {\n    for (var key in sources) {\n      var value = sources[key];\n      if (!isUndefined(value)) {\n        destination[key] = value;\n      }\n    }\n    return destination;\n  };\n  var Defer = Promise$1;\n  var deferred = function deferred(callback) {\n    return new Defer(callback);\n  };\n  var tplEngine = function tplEngine(tpl, data, regexp) {\n    if (!isArray$1(data)) {\n      data = [data];\n    }\n    var ret = [];\n    var replaceAction = function replaceAction(object) {\n      return tpl.replace(regexp || /\\\\?\\{([^}]+)\\}/g, function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return object[name] !== undefined ? object[name] : '{' + name + '}';\n      });\n    };\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  };\n  // 暂时支持 String\n  var isContain = function isContain(str, keyword) {\n    return str.indexOf(keyword) > -1;\n  };\n  var isEqual = function isEqual(source, target) {\n    return source === target;\n  };\n  var Cache = function Cache(cache) {\n    if (!isObject(cache)) {\n      cache = {};\n    }\n    var set = function set(key, value) {\n      cache[key] = value;\n    };\n    var get = function get(key) {\n      return cache[key];\n    };\n    var remove = function remove(key) {\n      delete cache[key];\n    };\n    var getKeys = function getKeys() {\n      var keys = [];\n      for (var key in cache) {\n        keys.push(key);\n      }\n      return keys;\n    };\n    var clear = function clear() {\n      cache = {};\n    };\n    return {\n      set: set,\n      get: get,\n      remove: remove,\n      getKeys: getKeys,\n      clear: clear\n    };\n  };\n\n  /* IE 组件带入的 request */\n  var pcEngineRequest = function pcEngineRequest(url, options, pc) {\n    options = options || {};\n    var headers = options.headers || {},\n        body = options.body || {};\n\n    var headerTpl = '\"{name}:{header}\"',\n        headersTpl = '[{headers}]';\n\n    var formatedHeaders = [];\n\n    forEach(headers, function (header, name) {\n      header = tplEngine(headerTpl, {\n        header: header,\n        name: name\n      });\n      formatedHeaders.push(header);\n    });\n    formatedHeaders = tplEngine(headersTpl, {\n      headers: formatedHeaders.join(',')\n    });\n\n    return deferred(function (resolve, reject) {\n      var code = pc.HttpPost(url, formatedHeaders, body, function (result) {\n        result = parse(result);\n        resolve(result);\n      });\n      if (code !== IE9_REQUEST_SUCCESS) {\n        reject({\n          status: code\n        });\n      }\n    });\n  };\n\n  var request = function request(url, option) {\n    return deferred(function (resolve, reject) {\n      option = option || {};\n      var xhr = new XMLHttpRequest();\n      var method = option.method || 'GET';\n      xhr.open(method, url, true);\n      var headers = option.headers || {};\n      forEach(headers, function (header, name) {\n        xhr.setRequestHeader(name, header);\n      });\n      var body = option.body || {};\n      var isSuccess = function isSuccess() {\n        return (/^(200|202)$/.test(xhr.status)\n        );\n      };\n      var timeout = option.timeout;\n      if (timeout) {\n        xhr.timeout = timeout;\n      }\n      xhr.onreadystatechange = function () {\n        if (isEqual(xhr.readyState, 4)) {\n          var responseText = xhr.responseText;\n\n          responseText = responseText || '{}';\n          var result = JSON.parse(responseText);\n          if (isSuccess()) {\n            resolve(result);\n          } else {\n            var status = xhr.status;\n\n            extend(result, {\n              status: status\n            });\n            reject(result);\n          }\n        }\n      };\n      xhr.onerror = function (error) {\n        reject(error);\n      };\n      xhr.send(body);\n    });\n  };\n  var map = function map(arrs, callback) {\n    return arrs.map(callback);\n  };\n  var filter = function filter(arrs, callback) {\n    return arrs.filter(callback);\n  };\n  var uniq = function uniq(arrs, callback) {\n    var newData = [],\n        tempData = {};\n    arrs.forEach(function (target) {\n      var temp = callback(target);\n      tempData[temp.key] = temp.value;\n    });\n    forEach(tempData, function (val) {\n      newData.push(val);\n    });\n    return newData;\n  };\n  var some = function some(arrs, callback) {\n    return arrs.some(callback);\n  };\n  var toArray$1 = function toArray(obj) {\n    var arrs = [];\n    forEach(obj, function (v, k) {\n      arrs.push([k, v]);\n    });\n    return arrs;\n  };\n  function Timer(_option) {\n    _option = _option || {};\n    var option = {\n      timeout: 0,\n      // interval | timeout\n      type: 'interval'\n    };\n    extend(option, _option);\n    var timers = [];\n    var _timeout = option.timeout,\n        type = option.type;\n\n    var timerType = {\n      resume: {\n        interval: function interval(callback, immediate) {\n          if (immediate) {\n            callback();\n          }\n          return setInterval(callback, _timeout);\n        },\n        timeout: function timeout(callback, immediate) {\n          if (immediate) {\n            callback();\n          }\n          return setTimeout(callback, _timeout);\n        }\n      },\n      pause: {\n        interval: function interval(timer) {\n          return clearInterval(timer);\n        },\n        timeout: function timeout(timer) {\n          return clearTimeout(timer);\n        }\n      }\n    };\n    this.resume = function (callback, immediate) {\n      callback = callback || noop$1;\n      var resume = timerType.resume;\n\n      var timer = resume[type](callback, immediate);\n      timers.push(timer);\n    };\n    this.pause = function () {\n      var pause = timerType.pause;\n\n      forEach(timers, function (timer) {\n        pause[type](timer);\n      });\n    };\n  }\n  var isInclude = function isInclude(str, match) {\n    return str.indexOf(match) > -1;\n  };\n  var clone = function clone(source) {\n    return JSON.parse(JSON.stringify(source));\n  };\n  function Index() {\n    var index = 0;\n    this.add = function () {\n      index += 1;\n    };\n    this.get = function () {\n      return index;\n    };\n    this.reset = function () {\n      index = 0;\n    };\n  }\n  function Observer() {\n    var observers = [];\n    this.add = function (observer, force) {\n      if (isFunction$1(observer)) {\n        if (force) {\n          return observers = [observer];\n        }\n        observers.push(observer);\n      }\n    };\n    this.remove = function (observer) {\n      observers = filter(observers, function (_observer) {\n        return _observer !== observer;\n      });\n    };\n    this.emit = function (data) {\n      forEach(observers, function (observer) {\n        observer(data);\n      });\n    };\n  }\n  function Prosumer() {\n    var data = [],\n        isConsuming = false;\n    this.produce = function (res) {\n      data.push(res);\n    };\n    this.consume = function (callback, finished) {\n      if (isConsuming) {\n        return;\n      }\n      isConsuming = true;\n      var next = function next() {\n        var res = data.shift();\n        if (isUndefined(res)) {\n          isConsuming = false;\n          finished && finished();\n          return;\n        }\n        callback(res, next);\n      };\n      next();\n    };\n    this.isExeuting = function () {\n      return isConsuming;\n    };\n  }\n  /* \n   prosumer.consume(function(data, next){\n    //dosomething\n    next();\n   });\n  */\n  var Log = console;\n  var getBrowser = function getBrowser() {\n    var userAgent = navigator.userAgent;\n    var name = '',\n        version = '';\n    if (/(Msie|Firefox|Opera|Chrome|Netscape)\\D+(\\d[\\d.]*)/.test(userAgent)) {\n      name = RegExp.$1;\n      version = RegExp.$2;\n    }\n    if (/Version\\D+(\\d[\\d.]*).*Safari/.test(userAgent)) {\n      name = 'Safari';\n      version = RegExp.$1;\n    }\n    return {\n      name: name,\n      version: version\n    };\n  };\n\n  var isSupportRequestHeaders = function isSupportRequestHeaders() {\n    var userAgent = navigator.userAgent;\n    var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n    if (isIE) {\n      var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n      reIE.test(userAgent);\n      var fIEVersion = parseFloat(RegExp['$1']);\n      return fIEVersion <= 9;\n    }\n    return false;\n  };\n\n  var getDate = function getDate(timestramp) {\n    timestramp = timestramp || Date.now();\n    var date = new Date(timestramp);\n    var dateList = [date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()];\n    return dateList.join('_');\n  };\n\n  var utils = {\n    Prosumer: Prosumer,\n    Log: Log,\n    Observer: Observer,\n    Timer: Timer,\n    isUndefined: isUndefined,\n    isBoolean: isBoolean,\n    isString: isString,\n    isObject: isObject,\n    isArray: isArray$1,\n    isFunction: isFunction$1,\n    stringify: stringify,\n    parse: parse,\n    rename: rename,\n    extend: extend,\n    clone: clone,\n    deferred: deferred,\n    Defer: Defer,\n    forEach: forEach,\n    tplEngine: tplEngine,\n    isContain: isContain,\n    noop: noop$1,\n    Cache: Cache,\n    request: request,\n    pcEngineRequest: pcEngineRequest,\n    map: map,\n    filter: filter,\n    uniq: uniq,\n    some: some,\n    isEqual: isEqual,\n    isEmpty: isEmpty,\n    toJSON: toJSON,\n    isInclude: isInclude,\n    isNull: isNull,\n    isNumber: isNumber,\n    toArray: toArray$1,\n    Index: Index,\n    getBrowser: getBrowser,\n    getDate: getDate,\n    isSupportRequestHeaders: isSupportRequestHeaders\n  };\n\n  var DownEvent = {\n    ROOM_USER_JOINED: 'room_user_joined',\n    ROOM_USER_LEFT: 'room_user_left',\n\n    STREAM_PUBLISHED: 'stream_published',\n    STREAM_UNPUBLISHED: 'stream_unpublished',\n    STREAM_DISABLED: 'stream_disabled',\n    STREAM_ENABLED: 'stream_enabled',\n    STREAM_MUTED: 'stream_muted',\n    STREAM_UNMUTED: 'stream_unmuted',\n    STREAM_RESIZED: 'stream_resized',\n\n    RTC_ERROR: 'rtc_error',\n    RTC_MOUNTED: 'rtc_mounted',\n    RTC_UNMOUNTED: 'rtc_unmounted',\n\n    MESSAGE_RECEIVED: 'message_received',\n\n    REPORT_SPOKE: 'report_spoke'\n  };\n\n  var UpEvent = {\n    ROOM_JOIN: 'room_join',\n    ROOM_LEAVE: 'room_leave',\n    ROOM_GET: 'room_get',\n\n    STREAM_PUBLISH: 'stream_publish',\n    STREAM_UNPUBLISH: 'stream_UNPUBLISH',\n    STREAM_SUBSCRIBE: 'stream_subscribe',\n    STREAM_UNSUBSCRIBE: 'stream_unsubscribe',\n    STREAM_RESIZE: 'stream_resize',\n    STREAM_GET: 'stream_get',\n    STREAM_UPDATE: 'stream_update',\n\n    AUDIO_MUTE: 'audio_mute',\n    AUDIO_UNMUTE: 'audio_unmute',\n\n    VIDEO_DISABLE: 'video_disable',\n    VIDEO_ENABLE: 'video_enable',\n\n    STORAGE_SET: 'strorage_set',\n    STORAGE_GET: 'strorage_get',\n    STORAGE_REMOVE: 'strorage_remove',\n\n    MESSAGE_SEND: 'message_send',\n\n    DEVICE_GET: 'device_get',\n\n    REPORT_START: 'report_start',\n    REPORT_STOP: 'report_stop'\n  };\n\n  var RoomEvents = [{\n    name: DownEvent.ROOM_USER_JOINED,\n    type: 'joined'\n  }, {\n    name: DownEvent.ROOM_USER_LEFT,\n    type: 'left'\n  }];\n\n  var StreamEvents = [{\n    name: DownEvent.STREAM_PUBLISHED,\n    type: 'published'\n  }, {\n    name: DownEvent.STREAM_UNPUBLISHED,\n    type: 'unpublished'\n  }, {\n    name: DownEvent.STREAM_DISABLED,\n    type: 'disabled'\n  }, {\n    name: DownEvent.STREAM_ENABLED,\n    type: 'enabled'\n  }, {\n    name: DownEvent.STREAM_MUTED,\n    type: 'muted'\n  }, {\n    name: DownEvent.STREAM_UNMUTED,\n    type: 'unmuted'\n  }, {\n    name: DownEvent.STREAM_RESIZED,\n    type: 'resized'\n  }];\n\n  var MessageEvents = [{\n    name: DownEvent.MESSAGE_RECEIVED,\n    type: 'received'\n  }];\n\n  var ReportEvents = [{\n    name: DownEvent.REPORT_SPOKE,\n    type: 'spoke'\n  }];\n\n  var getErrors = function getErrors() {\n    var errors = [{\n      code: 10000,\n      name: 'INSTANCE_IS_DESTROYED',\n      msg: 'RongRTC instance has been destroyed'\n    }, {\n      code: 50000,\n      name: 'IM_NOT_CONNECTED',\n      msg: 'IM not connected'\n    }, {\n      code: 50001,\n      name: 'ROOM_ID_IS_ILLEGAL',\n      msg: 'The roomId is illegal and can contain only upper and lower case letters, Arabic numerals, +, =, -, _ and cannot exceed 64 characters in length'\n    }, {\n      code: 50002,\n      name: 'ROOM_REPEAT_JOIN',\n      msg: 'Not rejoin the room'\n    }, {\n      code: 50010,\n      name: '',\n      msg: 'Http request timeout'\n    }, {\n      code: 50011,\n      name: '',\n      msg: 'http response error'\n    }, {\n      code: 50012,\n      name: '',\n      msg: 'Network unavailable'\n    }, {\n      code: 50020,\n      name: '',\n      msg: 'Resources has been published'\n    }, {\n      code: 50021,\n      name: 'SET_OFFER_ERROR',\n      msg: 'Set offer error'\n    }, {\n      code: 50021,\n      name: 'SET_ANSWER_ERROR',\n      msg: 'Set answer error'\n    }, {\n      code: 50023,\n      name: 'PUBLISH_STREAM_EXCEED_LIMIT',\n      msg: 'The maximum number of published resources has been reached'\n    }, {\n      code: 50024,\n      name: 'STREAM_NOT_EXIST',\n      msg: 'Stream not exist. Please check user.id、stream.type or stream.tag'\n    }, {\n      code: 50030,\n      name: 'SUBSCRIBE_STREAM_NOT_EXIST',\n      msg: 'Subscribe to non-existent resource'\n    }, {\n      code: 50030,\n      name: 'STREAM_TRACK_NOT_EXIST',\n      msg: 'Track not exist. Please check user.id、stream.type or stream.tag'\n    }, {\n      code: 50031,\n      name: 'STREAM_SUBSCRIBED',\n      msg: 'Resources has been subscribed'\n    }, {\n      code: 50032,\n      name: 'UNSUBSCRIBE_STREAM_NOT_EXIST',\n      msg: 'Unsubscribe to non-existent resource'\n    }, {\n      code: 50050,\n      name: 'RTC_NOT_JOIN_ROOM',\n      msg: 'Please join the room first'\n    }, {\n      code: 50051,\n      name: 'SOCKET_UNAVAILABLE',\n      msg: 'IM socket unavailable'\n    }, {\n      code: 50052,\n      name: 'NETWORK_UNAVAILABLE',\n      msg: 'Network unavailable'\n    }, {\n      code: 50053,\n      name: 'IM_SDK_VER_NOT_MATCH',\n      msg: 'IM SDK version is too low, minimum version 2.4.0, please check: https://www.rongcloud.cn/docs/web_rtclib.html'\n    }, {\n      code: 50054,\n      name: 'STREAM_DESKTOPID_ILLEGAL',\n      msg: 'Failed to get screen shared stream, illegal desktopStreamId'\n    }, {\n      code: 50055,\n      name: 'PARAMTER_ILLEGAL',\n      msg: 'Please check the parameters, the {name} parameter is mandatory'\n    }, {\n      code: 50056,\n      name: 'ENGINE_ERROR',\n      msg: 'RTC engine error'\n    }, {\n      code: 50057,\n      name: 'MEDIA_SERVER_ERROR',\n      msg: 'Network is abnormal or Media Server is unavailable'\n    }, {\n      code: 50058,\n      name: 'MEDIA_SERVER_RESPONSE_EMPTY',\n      msg: 'Media Server response body is empty'\n    }, {\n      code: 40001,\n      name: 'NOT_IN_ROOM',\n      msg: 'Not in the room'\n    }, {\n      code: 40002,\n      name: 'INTERNAL_ERROR',\n      msg: 'IM Server internal error'\n    }, {\n      code: 40003,\n      name: 'HAS_NO_ROOM',\n      msg: 'IM Server room info not exist'\n    }, {\n      code: 40004,\n      name: 'INVALID_USERID',\n      msg: 'UserId illegal'\n    }, {\n      code: 40005,\n      name: 'REPEAT_JOIN_ROOM',\n      msg: 'Not rejoin the room'\n    }];\n\n    var errorMap = {\n      Inner: {},\n      Outer: {}\n    };\n    utils.forEach(errors, function (error) {\n      var name = error.name,\n          code = error.code,\n          msg = error.msg;\n\n      var info = {\n        code: code,\n        msg: msg\n      };\n      errorMap.Inner[name] = info;\n      errorMap[code] = info;\n      errorMap.Outer[name] = code;\n    });\n    return errorMap;\n  };\n  var ErrorType = getErrors();\n\n  /* \n    data： 任意对象\n    rules: 校验规则，数组\n    let user = {\n      id: '',\n      stream: {\n        type: 1,\n        tag: 2\n      }\n    };\n    // 校验必传入参数, 暂时支持 2 级\n    check(user, ['id', 'stream.type', 'stream.tag', 'stream.mediaStream']);\n  */\n  var check = function check(data, rules) {\n    var isIllegal = false,\n        name = '';\n    var getBody = function getBody() {\n      return {\n        isIllegal: isIllegal,\n        name: name\n      };\n    };\n    if (!utils.isArray(rules)) {\n      rules = [rules];\n    }\n    if (!utils.isObject(data)) {\n      throw new Error('check(data, rules): data must be an object');\n    }\n    utils.forEach(rules, function (rule) {\n      var isTier = rule.indexOf('.') > -1;\n      if (!isTier) {\n        isIllegal = utils.isUndefined(data[rule]);\n        if (isIllegal) {\n          return name = rule;\n        }\n      }\n      if (isTier) {\n        var props = rule.split('.');\n\n        var _props = slicedToArray(props, 2),\n            parent = _props[0],\n            child = _props[1];\n\n        var parentData = data[parent];\n        isIllegal = utils.isUndefined(parentData);\n        if (isIllegal) {\n          return name = parent;\n        }\n        if (!utils.isArray(parentData)) {\n          parentData = [parentData];\n        }\n        utils.forEach(parentData, function (parent) {\n          var childData = parent[child];\n          isIllegal = utils.isUndefined(childData);\n          if (isIllegal) {\n            return name = child;\n          }\n        });\n      }\n    });\n    return getBody();\n  };\n\n  var getError = function getError(name) {\n    var error = ErrorType.Inner.PARAMTER_ILLEGAL;\n    var msg = error.msg;\n\n    msg = utils.tplEngine(msg, {\n      name: name\n    });\n    return utils.extend(error, {\n      msg: msg\n    });\n  };\n\n  var getHeaders = function getHeaders(im) {\n    var roomId = im.getRoomId();\n    var token = im.getRTCToken();\n\n    var _im$getAppInfo = im.getAppInfo(),\n        appKey = _im$getAppInfo.appKey;\n\n    var browser = utils.getBrowser();\n    var tpl = 'web|{name}|{version}';\n    var type = utils.tplEngine(tpl, browser);\n    return {\n      'App-Key': appKey,\n      RoomId: roomId,\n      Token: token,\n      ClientType: type,\n      ClientVersion: 1\n    };\n  };\n\n  var dispatchStreamEvent = function dispatchStreamEvent(user, callback) {\n    var id = user.id,\n        uris = user.uris;\n\n    if (utils.isString(uris)) {\n      uris = utils.parse(uris);\n    }\n    var streams = [user];\n    if (uris) {\n      streams = utils.uniq(uris, function (target) {\n        var tag = target.tag,\n            mediaType = target.mediaType,\n            state = target.state;\n\n        var streamId = target.streamId || target.msid;\n        return {\n          key: [streamId, tag].join('_'),\n          value: {\n            tag: tag,\n            uris: uris,\n            mediaType: mediaType,\n            state: state\n          }\n        };\n      });\n    }\n    utils.forEach(streams, function (stream) {\n      callback({\n        id: id,\n        stream: stream\n      });\n    });\n  };\n\n  var dispatchOperationEvent = function dispatchOperationEvent(user, callback) {\n    var getModifyEvents = function getModifyEvents() {\n      var events = {},\n          tpl = '{type}_{state}';\n      // 禁用视频\n      var name = utils.tplEngine(tpl, {\n        type: StreamType.VIDEO,\n        state: StreamState.DISBALE\n      });\n      events[name] = DownEvent.STREAM_DISABLED;\n      // 启用视频\n      name = utils.tplEngine(tpl, {\n        type: StreamType.VIDEO,\n        state: StreamState.ENABLE\n      });\n      events[name] = DownEvent.STREAM_ENABLED;\n      // 音频静音\n      name = utils.tplEngine(tpl, {\n        type: StreamType.AUDIO,\n        state: StreamState.DISBALE\n      });\n      events[name] = DownEvent.STREAM_MUTED;\n      // 音频取消静音\n      name = utils.tplEngine(tpl, {\n        type: StreamType.AUDIO,\n        state: StreamState.ENABLE\n      });\n      events[name] = DownEvent.STREAM_UNMUTED;\n      return events;\n    };\n    var _user$stream = user.stream,\n        type = _user$stream.mediaType,\n        state = _user$stream.state;\n\n    var tpl = '{type}_{state}';\n    var name = utils.tplEngine(tpl, {\n      type: type,\n      state: state\n    });\n    var events = getModifyEvents();\n    var event = events[name];\n    return callback(event, user);\n  };\n\n  var isSafari = function isSafari() {\n    return (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)\n    );\n  };\n\n  var isV2Tag = function isV2Tag(tag) {\n    return utils.isUndefined(tag) || utils.isEmpty(tag);\n  };\n\n  var toIEMediaType = function toIEMediaType(mediaType) {\n    var mediaTypeMap = {};\n    utils.forEach(StreamType, function (type, key) {\n      mediaTypeMap[type] = IE_MEDIA_TYPE[key] || type;\n    });\n    return mediaTypeMap[mediaType];\n  };\n\n  var getRenderState = function getRenderState(mediaType, isEnabled) {\n    switch (mediaType) {\n      case IE_MEDIA_TYPE.AUDIO:\n        return isEnabled ? 1 : 0;\n      case IE_MEDIA_TYPE.VIDEO:\n        return isEnabled ? 2 : 1;\n      case IE_MEDIA_TYPE.AUDIO_AND_VIDEO:\n        return isEnabled ? 3 : 0;\n    }\n  };\n\n  function Logger() {\n    var observer = new utils.Observer();\n    var write = function write(level, tag, meta) {\n      var time = new Date().getTime();\n      var log = {\n        level: level,\n        tag: tag,\n        meta: meta,\n        time: time,\n        platform: 'web'\n      };\n      observer.emit(log);\n    };\n    var warn = function warn(tag, meta) {\n      return write(LogLevel.WARN, tag, meta);\n    };\n    var error = function error(tag, meta) {\n      return write(LogLevel.ERROR, tag, meta);\n    };\n    var info = function info(tag, meta) {\n      return write(LogLevel.INFO, tag, meta);\n    };\n    var log = function log(tag, meta) {\n      return write(LogLevel.VERBOSE, tag, meta);\n    };\n    var watch = function watch(watcher, force) {\n      observer.add(watcher, force);\n    };\n    return {\n      warn: warn,\n      error: error,\n      info: info,\n      log: log,\n      watch: watch\n    };\n  }\n  var Logger$1 = Logger();\n\n  var Room = function () {\n    function Room(option) {\n      classCallCheck(this, Room);\n\n      var context = this;\n\n      var _ref = option || '',\n          id = _ref.id;\n\n      var roomIdLen = id.length;\n      var client = context.getClient();\n      if (!REGEXP_ROOM_ID.test(id) || roomIdLen > LENGTH_ROOM_ID) {\n        var Inner = ErrorType.Inner;\n\n        return client.emit(DownEvent.RTC_ERROR, Inner.ROOM_ID_IS_ILLEGAL);\n      }\n      utils.forEach(RoomEvents, function (event) {\n        var _event = event,\n            name = _event.name,\n            type = _event.type;\n\n        client.on(name, function (error, user) {\n          event = option[type] || utils.noop;\n          event(user, error);\n          Logger$1.log(LogTag.ROOM, {\n            event: type,\n            user: user\n          });\n        });\n      });\n      utils.extend(context, {\n        option: option,\n        client: client,\n        room: {\n          id: id\n        }\n      });\n    }\n\n    createClass(Room, [{\n      key: 'join',\n      value: function join(user) {\n        var _check = check(user, ['id']),\n            isIllegal = _check.isIllegal,\n            name = _check.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var room = this.room,\n            client = this.client;\n\n        utils.extend(room, {\n          user: user\n        });\n        return client.exec({\n          event: UpEvent.ROOM_JOIN,\n          type: 'room',\n          args: [room]\n        });\n      }\n    }, {\n      key: 'leave',\n      value: function leave() {\n        var room = this.room,\n            client = this.client;\n\n        return client.exec({\n          event: UpEvent.ROOM_LEAVE,\n          type: 'room',\n          args: [room]\n        });\n      }\n    }, {\n      key: 'get',\n      value: function get$$1() {\n        var room = this.room,\n            client = this.client;\n\n        return client.exec({\n          event: UpEvent.ROOM_GET,\n          type: 'room',\n          args: [room]\n        });\n      }\n    }]);\n    return Room;\n  }();\n\n  function Video(client) {\n    return {\n      disable: function disable(user) {\n        var _check = check(user, ['id', 'stream.tag']),\n            isIllegal = _check.isIllegal,\n            name = _check.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        return client.exec({\n          event: UpEvent.VIDEO_DISABLE,\n          type: 'stream',\n          args: [user]\n        });\n      },\n      enable: function enable(user) {\n        var _check2 = check(user, ['id', 'stream.tag']),\n            isIllegal = _check2.isIllegal,\n            name = _check2.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        return client.exec({\n          event: UpEvent.VIDEO_ENABLE,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    };\n  }\n\n  function Audio(client) {\n    return {\n      mute: function mute(user) {\n        var _check = check(user, ['id', 'stream.tag']),\n            isIllegal = _check.isIllegal,\n            name = _check.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        return client.exec({\n          event: UpEvent.AUDIO_MUTE,\n          type: 'stream',\n          args: [user]\n        });\n      },\n      unmute: function unmute(user) {\n        var _check2 = check(user, ['id', 'stream.tag']),\n            isIllegal = _check2.isIllegal,\n            name = _check2.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        return client.exec({\n          event: UpEvent.AUDIO_UNMUTE,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    };\n  }\n\n  var Stream = function () {\n    function Stream(option) {\n      classCallCheck(this, Stream);\n\n      var context = this;\n      var client = context.getClient();\n      utils.forEach(StreamEvents, function (event) {\n        var _event = event,\n            name = _event.name,\n            type = _event.type;\n\n        client.on(name, function (error, user) {\n          event = option[type] || utils.noop;\n          event(user, error);\n          Logger$1.log(LogTag.STREAM, {\n            event: type,\n            user: user\n          });\n        });\n      });\n      client.extendOption(option);\n      utils.extend(context, {\n        option: option,\n        client: client,\n        video: new Video(client),\n        audio: new Audio(client)\n      });\n    }\n\n    createClass(Stream, [{\n      key: 'publish',\n      value: function publish(user) {\n        var _check = check(user, ['id', 'stream.tag', 'stream.mediaStream', 'stream.type']),\n            isIllegal = _check.isIllegal,\n            name = _check.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_PUBLISH,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    }, {\n      key: 'unpublish',\n      value: function unpublish(user) {\n        var _check2 = check(user, ['id', 'stream.tag', 'stream.type']),\n            isIllegal = _check2.isIllegal,\n            name = _check2.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_UNPUBLISH,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    }, {\n      key: 'subscribe',\n      value: function subscribe(user) {\n        var _check3 = check(user, ['id', 'stream.tag', 'stream.type']),\n            isIllegal = _check3.isIllegal,\n            name = _check3.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_SUBSCRIBE,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    }, {\n      key: 'unsubscribe',\n      value: function unsubscribe(user) {\n        var _check4 = check(user, ['id', 'stream.tag', 'stream.type']),\n            isIllegal = _check4.isIllegal,\n            name = _check4.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_UNSUBSCRIBE,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    }, {\n      key: 'resize',\n      value: function resize(user) {\n        var _check5 = check(user, ['id', 'stream.tag']),\n            isIllegal = _check5.isIllegal,\n            name = _check5.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_RESIZE,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    }, {\n      key: 'get',\n      value: function get$$1(constraints) {\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_GET,\n          type: 'stream',\n          args: [constraints]\n        });\n      }\n    }, {\n      key: 'update',\n      value: function update(user) {\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.STREAM_UPDATE,\n          type: 'stream',\n          args: [user]\n        });\n      }\n    }]);\n    return Stream;\n  }();\n\n  var EventEmitter = function () {\n    function EventEmitter() {\n      classCallCheck(this, EventEmitter);\n\n      this.events = {};\n      this.onceEvents = {};\n    }\n\n    createClass(EventEmitter, [{\n      key: 'on',\n      value: function on(name, event) {\n        var events = this.events[name] || [];\n        events.push(event);\n        this.events[name] = events;\n      }\n    }, {\n      key: 'off',\n      value: function off(name) {\n        delete this.events[name];\n      }\n    }, {\n      key: 'emit',\n      value: function emit(name, data, error) {\n        var events = this.events[name];\n        utils.forEach(events, function (event) {\n          event(error, data);\n        });\n\n        var onceEvent = this.onceEvents[name] || utils.noop;\n        onceEvent(error, data);\n        delete this.onceEvents[name];\n      }\n    }, {\n      key: 'once',\n      value: function once(name, event) {\n        this.onceEvents[name] = event;\n      }\n    }, {\n      key: 'teardown',\n      value: function teardown() {\n        for (var name in this.events) {\n          this.off(name);\n        }\n        for (var _name in this.onceEvents) {\n          delete this.onceEvents[_name];\n        }\n      }\n    }]);\n    return EventEmitter;\n  }();\n\n  var CommonEvent = {\n    JOINED: 'common_joined',\n    LEFT: 'common_left',\n    ERROR: 'common_error',\n    CONSUME: 'common_consume',\n    REQUEST_CONSUME: 'common_request_consume',\n    CONNECTED: 'common_connected',\n    PEERCONN_CREATED: 'common_peerconn_created',\n    PUBLISHED_STREAM: 'common_published_stream',\n    RTC_PING_RECONNECT: 'common_rtcping_reconnect'\n  };\n\n  function request$1() {\n    var config = {\n      urls: []\n    };\n    // 正在使用的 URL 下标，每次请求在 urls 中取对应的地址发送请求\n    var indexTools = new utils.Index();\n\n    var prosumer = new utils.Prosumer();\n    var eventEmitter = new EventEmitter();\n    var setOption = function setOption(_config) {\n      utils.extend(config, _config);\n    };\n    var postProcess = function postProcess(option) {\n      var urls = config.urls,\n          pc = config.pc;\n      var path = option.path,\n          body = option.body;\n\n      var tpl = '{domain}{path}';\n\n      return utils.deferred(function (resolve, reject) {\n        var doRequest = function doRequest(error) {\n          var index = indexTools.get();\n          var isRange = index >= urls.length;\n          if (isRange) {\n            var Inner = ErrorType.Inner;\n\n            indexTools.reset();\n            error = utils.isEqual(error.status, 0) ? Inner.MEDIA_SERVER_ERROR : error;\n            return reject(error);\n          }\n          var domain = urls[index];\n          var url = utils.tplEngine(tpl, {\n            domain: domain,\n            path: path\n          });\n          var headers = {\n            'Content-Type': 'application/json;charset=UTF-8'\n          };\n          var _headers = option.headers;\n\n          if (utils.isObject(_headers)) {\n            utils.extend(headers, _headers);\n          }\n\n          var requestFunc = utils.isSupportRequestHeaders() ? utils.pcEngineRequest : utils.request;\n\n          requestFunc(url, {\n            method: 'POST',\n            timeout: REQUEST_TIMEOUT,\n            body: JSON.stringify(body),\n            headers: headers\n          }, pc).then(function (result) {\n            var code = result.resultCode;\n\n            if (utils.isEqual(code, MEDIASERVER_SUCCESS)) {\n              resolve(result);\n            } else {\n              reject(result);\n            }\n          }, function (error) {\n            var status = error.status;\n\n            if (utils.isInclude([403], status)) {\n              return reject(error);\n            }\n            indexTools.add();\n            doRequest(error);\n          });\n        };\n        doRequest();\n      });\n    };\n    eventEmitter.on(CommonEvent.REQUEST_CONSUME, function () {\n      prosumer.consume(function (_ref, next) {\n        var option = _ref.option,\n            resolve = _ref.resolve,\n            reject = _ref.reject;\n\n        postProcess(option).then(function (result) {\n          resolve(result);\n          next();\n        }, function (error) {\n          reject(error);\n          next();\n        });\n      });\n    });\n    var post = function post(option) {\n      return utils.deferred(function (resolve, reject) {\n        prosumer.produce({ option: option, resolve: resolve, reject: reject });\n        eventEmitter.emit(CommonEvent.REQUEST_CONSUME);\n      });\n    };\n    return {\n      setOption: setOption,\n      post: post\n    };\n  }\n  var request$2 = request$1();\n\n  var PeerConnection = function (_EventEmitter) {\n    inherits(PeerConnection, _EventEmitter);\n\n    function PeerConnection(options) {\n      classCallCheck(this, PeerConnection);\n\n      var _this = possibleConstructorReturn(this, (PeerConnection.__proto__ || Object.getPrototypeOf(PeerConnection)).call(this));\n\n      var context = _this;\n      var im = options.im;\n\n      var appInfo = im.getAppInfo() || {};\n      var appKey = appInfo.appKey;\n      var pc = window.document.getElementById(options.id);\n\n      var StreamCache = utils.Cache();\n\n      pc.SetLogEnabled(1, appKey, utils.getDate());\n      // pc.Init();\n      pc.CreatePeerConnection('');\n      request$2.setOption({\n        pc: pc\n      });\n      utils.extend(context, {\n        options: options,\n        pc: pc,\n        StreamCache: StreamCache\n      });\n\n      context.addEngineNotify();\n      return _this;\n    }\n\n    createClass(PeerConnection, [{\n      key: 'addEngineNotify',\n      value: function addEngineNotify() {\n        var context = this;\n        var id = context.options.id;\n\n        var notifyEvent = 'RongRTCEngineNotify';\n\n        var notifyAttrs = {\n          language: 'javascript',\n          for: id,\n          event: 'EngineNotify(msg)'\n        };\n\n        var notifyDom = document.createElement('script');\n        utils.forEach(notifyAttrs, function (value, key) {\n          notifyDom.setAttribute(key, value);\n        });\n\n        notifyDom.innerHTML = '\\n      var ret = JSON.parse(msg);\\n      console.log(ret);\\n      window[\\'' + notifyEvent + '\\'](ret);\\n    ';\n\n        window.document.body.appendChild(notifyDom);\n        window[notifyEvent] = function (msg) {\n          context.receiveEngineNotify(msg);\n        };\n      }\n    }, {\n      key: 'receiveEngineNotify',\n      value: function receiveEngineNotify(msg) {\n        var context = this;\n        Logger$1.log(LogTag.IE_NOTIFY, defineProperty({\n          msg: 'receiveEngineNotify:msg'\n        }, 'msg', msg));\n        switch (msg.id) {\n          case IE_NOTIFY_EVENT.ICE_CONNECTION_CHANGE:\n            break;\n          case IE_NOTIFY_EVENT.VIDEO_RENDER_CHANGE:\n            var big_stream_id = msg.big_stream_id,\n                small_stream_id = msg.small_stream_id;\n\n            context.emitUserResized([\n            /* big、small 为切换之前为 big、small */\n            { id: big_stream_id, size: StreamSize.MIN }, { id: small_stream_id, size: StreamSize.MAX }]);\n            break;\n        }\n      }\n    }, {\n      key: 'emitUserResized',\n      value: function emitUserResized(resizeIdList) {\n        var context = this;\n        var im = context.options.im;\n\n        utils.forEach(resizeIdList, function (_ref) {\n          var id = _ref.id,\n              size = _ref.size;\n\n          var user = context.getUserByStreamId(id);\n          user.stream.size = size;\n          im.emit(DownEvent.STREAM_RESIZED, user);\n        });\n      }\n\n      // render(user, isEnable) {\n      //   let { pc } = context;\n      //   let { name, stream: { type } } = user;\n      //   let streamId = context.getStreamId(user);\n      //   let mediaType = common.toIEMediaType(type);\n      //   var state = common.getRenderState(mediaType, isEnable);\n      //   pc.AddVideoRender(streamId, name, mediaType, state);\n      // }\n\n    }, {\n      key: 'getBitrate',\n      value: function getBitrate(resolution) {\n        return IE_RESOLUTION_TO_BITRATE[resolution] || {};\n      }\n    }, {\n      key: 'setBitrate',\n      value: function setBitrate() {\n        var context = this;\n        var pc = context.pc,\n            StreamCache = context.StreamCache;\n\n        var keys = StreamCache.getKeys();\n        utils.forEach(keys, function (streamId) {\n          var value = StreamCache.get(streamId);\n          var resolution = value.resolution;\n          var bitrate = context.getBitrate(resolution);\n          if (bitrate.max && bitrate.min) {\n            pc.SetVideoStreamBitrate(streamId, bitrate.min, bitrate.max);\n          }\n        });\n      }\n    }, {\n      key: 'addRenderers',\n      value: function addRenderers(user) {\n        var context = this;\n\n        var pc = context.pc,\n            im = context.options.im,\n            StreamCache = context.StreamCache;\n\n        var _im$getUser = im.getUser(),\n            currentUserId = _im$getUser.id;\n\n        var id = user.id,\n            name = user.name,\n            isZoomIn = user.isZoomIn,\n            _user$stream = user.stream,\n            type = _user$stream.type,\n            tag = _user$stream.tag,\n            resolution = _user$stream.resolution,\n            rate = _user$stream.rate,\n            rotate = _user$stream.rotate;\n\n        var mediaType = toIEMediaType(type);\n        var streamId = context.getStreamId(user);\n\n        name = name || id;\n        isZoomIn = isZoomIn || false;\n        resolution = resolution || IE_RESOLUTION.Solution_640_480;\n        rate = rate || IE_FRAME_RATE.Rate_15;\n        rotate = utils.isUndefined(rotate) ? IE_ROTATE.NONE : rotate;\n\n        var isSelf = currentUserId === id,\n            isScreenShare = tag === IE_TAG.ScreenShare;\n\n        var isLocal = isSelf ? IE_ENABLE.OPEN : IE_ENABLE.CLOSE;\n\n        if (isSelf) {\n          if (isScreenShare) {\n            pc.AddScreenShareStream(streamId);\n          } else {\n            pc.AddDefaultStream(streamId, mediaType, resolution, rate);\n          }\n          StreamCache.set(streamId, {\n            resolution: resolution,\n            rate: rate\n          });\n        }\n\n        var isSelfScreenShare = isSelf && isScreenShare;\n        // 不展示自己的屏幕共享流\n        if (!isSelfScreenShare) {\n          var state = getRenderState(mediaType, true);\n          pc.AddVideoRender(streamId, name, mediaType, state, isZoomIn, isLocal, rotate);\n        }\n      }\n    }, {\n      key: 'updateDisplayName',\n      value: function updateDisplayName(user) {\n        var context = this;\n        var pc = context.pc;\n        var name = user.name;\n\n        var streamId = context.getStreamId(user);\n        return pc.UpdateDisplayName(streamId, name);\n      }\n    }, {\n      key: 'updateRenderers',\n      value: function updateRenderers(user, type, isEnable) {\n        var context = this;\n        var pc = context.pc;\n\n        var streamId = context.getStreamId(user);\n        var mediaType = toIEMediaType(type);\n        var state = getRenderState(mediaType, isEnable);\n        return pc.UpdateMediaState(streamId, mediaType, state);\n      }\n    }, {\n      key: 'removeRenderers',\n      value: function removeRenderers(user) {\n        var context = this;\n\n        var pc = context.pc,\n            im = context.options.im;\n\n        var _im$getUser2 = im.getUser(),\n            currentUserId = _im$getUser2.id;\n\n        var id = user.id,\n            _user$stream2 = user.stream,\n            type = _user$stream2.type,\n            tag = _user$stream2.tag;\n\n        var mediaType = toIEMediaType(type) || IE_MEDIA_TYPE.AUDIO_AND_VIDEO;\n        var streamId = context.getStreamId(user);\n\n        if (currentUserId === id) {\n          if (tag === IE_TAG.ScreenShare) {\n            pc.RemoveScreenShareStream(streamId);\n          } else {\n            pc.RemoveDefaultStream(streamId, mediaType);\n          }\n        }\n        pc.RemoveVideoRender(streamId, mediaType, function (ret) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'removeRender:result',\n            ret: ret\n          });\n        });\n      }\n    }, {\n      key: 'setTrackEnabled',\n      value: function setTrackEnabled(user, isEnable) {\n        var context = this;\n\n        var pc = context.pc,\n            im = context.options.im;\n\n        var _im$getUser3 = im.getUser(),\n            currentUserId = _im$getUser3.id;\n\n        var id = user.id,\n            type = user.stream.type;\n\n        var mediaType = toIEMediaType(type);\n        var streamId = context.getStreamId(user);\n        var isSelf = currentUserId === id;\n        var enable = isEnable ? IE_ENABLE.OPEN : IE_ENABLE.CLOSE;\n\n        if (isSelf) {\n          pc.SetLocalTrackEnabled(streamId, mediaType, enable);\n        } else {\n          pc.SetRemoteTrackEnabled(streamId, mediaType, enable);\n        }\n        var state = getRenderState(mediaType, isEnable);\n        pc.UpdateMediaState(streamId, mediaType, state);\n      }\n    }, {\n      key: 'addStream',\n      value: function addStream(user) {\n        var context = this;\n        context.addRenderers(user);\n        // return context.createOffer(user);\n      }\n    }, {\n      key: 'removeStream',\n      value: function removeStream(user) {\n        var context = this;\n        context.removeRenderers(user);\n        // return context.createOffer(user);\n      }\n    }, {\n      key: 'createOffer',\n      value: function createOffer(config) {\n        config = config || {};\n        var context = this;\n        var pc = context.pc;\n        var _config = config,\n            isRestartICE = _config.isRestartICE;\n\n\n        isRestartICE = isRestartICE ? IE_ENABLE.OPEN : IE_ENABLE.CLOSE;\n        return utils.deferred(function (resolve, reject) {\n          pc.CreateOffer(isRestartICE, function (ret) {\n            var msg = utils.parse(ret);\n            if (msg.code != IE_RESPONSE.SUCCESS) {\n              return reject(msg);\n            }\n            var desc = {\n              sdp: msg.sdp,\n              type: 'offer'\n            };\n            desc = context.renameCodec(desc);\n            utils.extend(context, {\n              desc: desc\n            });\n            resolve(desc);\n          });\n        });\n      }\n    }, {\n      key: 'setOffer',\n      value: function setOffer(desc) {\n        var context = this;\n        var pc = context.pc;\n        var sdp = desc.sdp;\n\n        return utils.deferred(function (resolve, reject) {\n          pc.SetLocalOffer(sdp, function (ret) {\n            Logger$1.log(LogTag.STREAM_HANDLER, {\n              msg: 'setLocalOffer:success',\n              ret: ret\n            });\n            ret = utils.parse(ret);\n            ret.code == IE_RESPONSE.SUCCESS ? resolve() : reject(ret);\n          });\n        });\n      }\n    }, {\n      key: 'setAnwser',\n      value: function setAnwser(answer) {\n        var context = this;\n        var pc = context.pc;\n        var sdp = answer.sdp;\n\n        return utils.deferred(function (resolve, reject) {\n          pc.SetRemoteAnswer(sdp, function (ret) {\n            context.setBitrate();\n            ret = utils.parse(ret);\n            ret.code == IE_RESPONSE.SUCCESS ? resolve() : reject(ret);\n          });\n        });\n      }\n    }, {\n      key: 'getOffer',\n      value: function getOffer(config) {\n        var context = this;\n        // let success = (desc) => {\n        //   desc = context.renameCodec(desc);\n        //   return desc;\n        // };\n        return context.createOffer(config);\n      }\n    }, {\n      key: 'getStreamRatio',\n      value: function getStreamRatio() {\n        return {};\n      }\n    }, {\n      key: 'getStreamId',\n      value: function getStreamId(user, size) {\n        var tpl = '{userId}_{tag}';\n        var userId = user.id,\n            stream = user.stream;\n\n        if (!utils.isArray(stream)) {\n          stream = [stream];\n        }\n\n        var _stream = stream,\n            _stream2 = slicedToArray(_stream, 1),\n            tag = _stream2[0].tag;\n\n        if (utils.isEqual(size, StreamSize.MIN)) {\n          tpl = '{userId}_{tag}_{suffix}';\n        }\n        if (isV2Tag(tag)) {\n          return userId;\n        }\n        return utils.tplEngine(tpl, {\n          userId: userId,\n          tag: tag,\n          suffix: MIN_STREAM_SUFFIX\n        });\n      }\n    }, {\n      key: 'getUserByStreamId',\n      value: function getUserByStreamId(id) {\n        var details = id.split('_');\n        return {\n          id: details[0],\n          stream: {\n            tag: details[details.length - 1]\n          }\n        };\n      }\n    }, {\n      key: 'getTagByStreamId',\n      value: function getTagByStreamId(id) {\n        var details = id.split('_');\n        return details[details.length - 1];\n      }\n    }, {\n      key: 'getStreamSymbolById',\n      value: function getStreamSymbolById(id) {\n        var connector = '_';\n        var details = id.split(connector);\n        if (utils.isEqual(details.length, 1)) {\n          details.push(TAG_V2);\n          return details;\n        }\n        var tag = details.pop();\n        var userId = details.join(connector);\n        return [userId, tag];\n      }\n    }, {\n      key: 'close',\n      value: function close() {\n        var context = this;\n        var pc = context.pc;\n\n        if (pc) {\n          pc.DestroyPeerConnection();\n          context.pc = null;\n          delete context.pc;\n        }\n      }\n    }, {\n      key: 'getStats',\n      value: function getStats() {}\n    }, {\n      key: 'renameCodec',\n      value: function renameCodec(offer) {\n        return offer;\n      }\n    }]);\n    return PeerConnection;\n  }(EventEmitter);\n\n  var Path = {\n    PUBLISH: '/exchange',\n    UNPUBLISH: '/exchange',\n    RESIZE: '/exchange',\n    SUBSCRIBE: '/exchange',\n    UNSUBSCRIBE: '/exchange',\n    EXIT: '/exit'\n  };\n\n  var Message = {\n    PUBLISH: 'RTCPublishResourceMessage',\n    UNPUBLISH: 'RTCUnpublishResourceMessage',\n    MODIFY: 'RTCModifyResourceMessage',\n    STATE: 'RTCUserChangeMessage',\n    ROOM_NOTIFY: 'RTCRoomDataNotifyMessage',\n    USER_NOTIFY: 'RTCUserDataNotifyMessage'\n  };\n\n  var MessageName = {\n    PUBLISH: 'RCRTC:PublishResource',\n    UNPUBLISH: 'RCRTC:UnpublishResource',\n    MODIFY: 'RCRTC:ModifyResource',\n    STATE: 'RCRTC:state',\n    ROOM_NOTIFY: 'RCRTC:RoomNtf',\n    USER_NOTIFY: 'RCRTC:UserNtf'\n  };\n  var Timeout = {\n    TIME: 10 * 1000\n  };\n  var errorHandler = function errorHandler(code) {\n    var error = ErrorType[code] || {\n      code: code\n    };\n    return error;\n  };\n  var getMsgName = function getMsgName(type) {\n    switch (type) {\n      case Message.PUBLISH:\n        return MessageName.PUBLISH;\n      case Message.UNPUBLISH:\n        return MessageName.UNPUBLISH;\n      case Message.MODIFY:\n        return MessageName.MODIFY;\n      case Message.STATE:\n        return MessageName.STATE;\n      case Message.ROOM_NOTIFY:\n        return MessageName.ROOM_NOTIFY;\n      case Message.USER_NOTIFY:\n        return MessageName.USER_NOTIFY;\n    }\n  };\n  var IM = function (_EventEmitter) {\n    inherits(IM, _EventEmitter);\n\n    function IM(option) {\n      classCallCheck(this, IM);\n\n      var _this = possibleConstructorReturn(this, (IM.__proto__ || Object.getPrototypeOf(IM)).call(this));\n\n      var timer = new utils.Timer({\n        timeout: Timeout.TIME\n      });\n      var v2Users = utils.Cache();\n      var context = _this;\n      var isJoinRoom = false;\n      var isRTCPingInFailure = false;\n      utils.extend(context, {\n        timer: timer,\n        isJoinRoom: isJoinRoom,\n        v2Users: v2Users,\n        isRTCPingInFailure: isRTCPingInFailure\n      });\n      var im = option.RongIMLib.RongIMClient,\n          RongIMLib = option.RongIMLib;\n\n      var init = function init() {\n        if (context.isJoinRoom) {\n          context.rePing();\n        }\n        context.registerMessage();\n      };\n      var connectState = -1;\n      try {\n        connectState = im.getInstance().getCurrentConnectionStatus();\n      } catch (error) {\n        Logger$1.error(LogTag.IM, {\n          content: error,\n          pos: 'new RongRTC'\n        });\n      }\n      var CONNECTED = RongIMLib.ConnectionStatus.CONNECTED;\n\n      utils.extend(context, {\n        connectState: connectState,\n        im: im,\n        RongIMLib: RongIMLib\n      });\n      // 如果实例化 RongRTC 时，IM 已连接成功，主动触发内部 init\n      if (utils.isEqual(connectState, CONNECTED)) {\n        init();\n      }\n      im.statusWatch = im.statusWatch || utils.noop;\n      im.statusWatch(function (status) {\n        switch (status) {\n          case CONNECTED:\n            init();\n            context.emit(CommonEvent.CONNECTED);\n            break;\n        }\n        utils.extend(context, {\n          connectState: status\n        });\n      });\n      var roomEventHandler = function roomEventHandler(users) {\n        utils.forEach(users, function (user) {\n          var id = user.userId,\n              state = user.state;\n\n          switch (+state) {\n            case UserState.JOINED:\n              context.emit(DownEvent.ROOM_USER_JOINED, { id: id });\n              break;\n            case UserState.LEFT:\n            case UserState.OFFLINE:\n              Logger$1.log(LogTag.ROOM, {\n                msg: 'room:member:left',\n                user: user\n              });\n              context.emit(DownEvent.ROOM_USER_LEFT, { id: id });\n              break;\n            default:\n              Logger$1.warn('UserState: unkown state ' + state);\n          }\n        });\n      };\n      /**\n       * 收到 UnkownMessage 自动转为 ObjectName + \"Message\" 做为 MessageType\n       * 免去注册自定义消息逻辑\n       */\n      var renameMessage = function renameMessage(message) {\n        var messageType = message.messageType;\n\n        var isCustom = utils.isEqual(im.MessageType.UnknownMessage, messageType);\n        var clear = function clear(msg, content) {\n          delete content.objectName;\n          delete content.messageName;\n          delete msg.conversationType;\n          delete msg.messageId;\n          delete msg.offLineMessage;\n          delete msg.receivedStatus;\n          delete msg.messageType;\n          delete msg.targetId;\n          delete msg.messageDirection;\n        };\n        var msg = utils.parse(utils.toJSON(message));\n        var content = {};\n        if (isCustom) {\n          var customMsg = msg.content;\n          content = customMsg.message.content;\n        } else {\n          content = msg.content;\n        }\n        clear(msg, content);\n        utils.extend(msg, {\n          content: content\n        });\n        msg = utils.rename(msg, {\n          objectName: 'name',\n          messageUId: 'uId',\n          senderUserId: 'senderId'\n        });\n        return msg;\n      };\n      im.messageWatch = im.messageWatch || utils.noop;\n      im.messageWatch(function (message) {\n        var type = message.messageType,\n            id = message.senderUserId,\n            _message$content = message.content,\n            uris = _message$content.uris,\n            users = _message$content.users;\n\n        var user = { id: id };\n        if (utils.isArray(uris)) {\n          uris = utils.map(uris, function (uri) {\n            var tag = uri.tag;\n\n            if (isV2Tag(tag)) {\n              utils.extend(uri, {\n                tag: TAG_V2\n              });\n            }\n            return uri;\n          });\n        }\n        switch (type) {\n          case Message.STATE:\n            roomEventHandler(users);\n            break;\n          case Message.PUBLISH:\n            user = { id: id, uris: uris };\n            if (utils.isInclude(id, '_')) {\n              v2Users.set(id, true);\n            }\n            dispatchStreamEvent(user, function (user) {\n              context.emit(DownEvent.STREAM_PUBLISHED, user);\n            });\n            break;\n          case Message.UNPUBLISH:\n            user = { id: id, uris: uris };\n            dispatchStreamEvent(user, function (user) {\n              context.emit(DownEvent.STREAM_UNPUBLISHED, user);\n            });\n            break;\n          case Message.MODIFY:\n            user = { id: id, uris: uris };\n            dispatchStreamEvent(user, function (user) {\n              dispatchOperationEvent(user, function (event, user) {\n                context.emit(event, user);\n              });\n            });\n            break;\n          default:\n            context.emit(DownEvent.MESSAGE_RECEIVED, renameMessage(message));\n        }\n        Logger$1.log(LogTag.IM, {\n          msg: 'receive:message',\n          message: message\n        });\n      });\n      return _this;\n    }\n\n    createClass(IM, [{\n      key: 'registerMessage',\n      value: function registerMessage() {\n        var im = this.im,\n            RongIMLib = this.RongIMLib;\n\n        var register = function register(message) {\n          var type = message.type,\n              name = message.name,\n              props = message.props;\n\n          var isCounted = false;\n          var isPersited = false;\n          var tag = new RongIMLib.MessageTag(isCounted, isPersited);\n          im.registerMessageType(type, name, tag, props);\n        };\n        var messages = [{\n          type: Message.PUBLISH,\n          name: getMsgName(Message.PUBLISH),\n          props: ['uris']\n        }, {\n          type: Message.UNPUBLISH,\n          name: getMsgName(Message.UNPUBLISH),\n          props: ['uris']\n        }, {\n          type: Message.MODIFY,\n          name: getMsgName(Message.MODIFY),\n          props: ['uris']\n        }, {\n          type: Message.STATE,\n          name: getMsgName(Message.STATE),\n          props: ['users']\n        }, {\n          type: Message.ROOM_NOTIFY,\n          name: getMsgName(Message.ROOM_NOTIFY),\n          props: ['content']\n        }, {\n          type: Message.USER_NOTIFY,\n          name: getMsgName(Message.USER_NOTIFY),\n          props: ['content']\n        }];\n        utils.forEach(messages, function (message) {\n          register(message);\n        });\n      }\n    }, {\n      key: 'joinRoom',\n      value: function joinRoom(room) {\n        var context = this;\n        var im = context.im;\n\n        utils.extend(context, {\n          room: room,\n          isJoinRoom: true\n        });\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().joinRTCRoom(room, {\n            onSuccess: function onSuccess(_ref) {\n              var users = _ref.users,\n                  token = _ref.token;\n\n              context.rtcPing(room);\n\n              var _context$getUser = context.getUser(),\n                  currentUserId = _context$getUser.id;\n\n              var tempUsers = utils.clone(users);\n              Logger$1.log(LogTag.IM, {\n                msg: 'join:room:inner:success',\n                users: tempUsers\n              });\n              utils.forEach(tempUsers, function (tUser, userId) {\n                tUser = tUser || {};\n                // 过滤自己和为空的用户\n                if (utils.isEmpty(tUser) || utils.isEqual(currentUserId, tUser.id)) {\n                  delete users[userId];\n                } else {\n                  var user = users[userId];\n                  var uris = user.uris;\n\n                  context.v2Users.set(userId, true);\n                  if (!utils.isUndefined(uris)) {\n                    uris = utils.parse(uris);\n                    utils.extend(user, {\n                      uris: uris\n                    });\n                  }\n                }\n              });\n              utils.extend(room, {\n                rtcToken: token,\n                users: users\n              });\n              context.emit(CommonEvent.JOINED, room);\n              resolve(users);\n            },\n            onError: function onError(code) {\n              return reject(errorHandler(code));\n            }\n          });\n        });\n      }\n    }, {\n      key: 'setLeaveStatus',\n      value: function setLeaveStatus() {\n        var context = this;\n        var im = context.im,\n            room = context.room,\n            timer = context.timer;\n\n        timer.pause();\n        utils.extend(context, {\n          isJoinRoom: false\n        });\n        context.emit(CommonEvent.LEFT, room);\n        im.isJoinedRTCRoom = false;\n      }\n    }, {\n      key: 'leaveRoom',\n      value: function leaveRoom() {\n        var context = this;\n        var im = context.im,\n            room = context.room,\n            timer = context.timer;\n\n        timer.pause();\n        utils.extend(context, {\n          isJoinRoom: false\n        });\n        context.emit(CommonEvent.LEFT, room);\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().quitRTCRoom(room, {\n            onSuccess: function onSuccess() {\n              resolve();\n            },\n            onError: function onError(code) {\n              return reject(errorHandler(code));\n            }\n          });\n        });\n      }\n    }, {\n      key: 'getRoom',\n      value: function getRoom() {\n        var im = this.im,\n            room = this.room;\n\n        return utils.deferred(function (resolve, _reject) {\n          im.getInstance().getRTCRoomInfo(room, {\n            onSuccess: resolve,\n            reject: function reject(code) {\n              return _reject(errorHandler(code));\n            }\n          });\n        });\n      }\n    }, {\n      key: 'getUsers',\n      value: function getUsers() {\n        var im = this.im,\n            room = this.room;\n\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().getRTCUserInfoList(room, {\n            onSuccess: resolve,\n            onError: function onError(code) {\n              return reject(errorHandler(code));\n            }\n          });\n        });\n      }\n    }, {\n      key: 'getRTCToken',\n      value: function getRTCToken() {\n        var rtcToken = this.room.rtcToken;\n\n        return rtcToken;\n      }\n    }, {\n      key: 'getRoomId',\n      value: function getRoomId() {\n        var id = this.room.id;\n\n        return id;\n      }\n    }, {\n      key: 'getMSUrl',\n      value: function getMSUrl() {\n        var im = this.im;\n\n        var navi = im.getInstance().getNavi();\n        var rtcInfo = navi.voipCallInfo;\n\n        rtcInfo = rtcInfo || '{\"callEngine\": [{}]}';\n        rtcInfo = utils.parse(rtcInfo);\n        var engines = rtcInfo.callEngine;\n        var engine = utils.filter(engines, function (e) {\n          return e.engineType === 4;\n        })[0] || {};\n        var urls = engine.backupMediaServer,\n            mediaServer = engine.mediaServer;\n\n        if (utils.isUndefined(urls)) {\n          urls = [];\n        }\n        if (!utils.isUndefined(mediaServer)) {\n          urls.unshift(mediaServer);\n        }\n        return urls;\n      }\n    }, {\n      key: 'getUser',\n      value: function getUser() {\n        var user = this.room.user;\n\n        return user;\n      }\n    }, {\n      key: 'setUserInfo',\n      value: function setUserInfo(key, value) {\n        var room = this.room,\n            im = this.im;\n\n        value = utils.toJSON(value);\n        var info = {\n          key: key,\n          value: value\n        };\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().setRTCUserInfo(room, info, {\n            onSuccess: resolve,\n            onError: reject\n          });\n        });\n      }\n    }, {\n      key: 'removeUserInfo',\n      value: function removeUserInfo(keys) {\n        var room = this.room,\n            im = this.im;\n\n        var info = {\n          keys: keys\n        };\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().removeRTCUserInfo(room, info, {\n            onSuccess: resolve,\n            onError: reject\n          });\n        });\n      }\n    }, {\n      key: 'setUserData',\n      value: function setUserData(key, value, isInner, message) {\n        var id = this.room.id,\n            im = this.im;\n\n        value = utils.toJSON(value);\n        Logger$1.log(LogTag.STREAM_HANDLER, {\n          msg: 'setUserData:before',\n          roomId: id,\n          value: value,\n          message: message\n        });\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().setRTCUserData(id, key, value, isInner, {\n            onSuccess: function onSuccess() {\n              Logger$1.log(LogTag.STREAM_HANDLER, {\n                msg: 'setUserData:after',\n                roomId: id,\n                value: value,\n                message: message\n              });\n              resolve();\n            },\n            onError: reject\n          }, message);\n        });\n      }\n    }, {\n      key: 'getUserData',\n      value: function getUserData(keys, isInner) {\n        var id = this.room.id,\n            im = this.im;\n\n        if (!utils.isArray(keys)) {\n          keys = [keys];\n        }\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().getRTCUserData(id, keys, isInner, {\n            onSuccess: resolve,\n            onError: function onError(error) {\n              reject(error);\n            }\n          });\n        });\n      }\n    }, {\n      key: 'removeUserData',\n      value: function removeUserData(keys, isInner, message) {\n        var id = this.room.id,\n            im = this.im;\n\n        if (!utils.isArray(keys)) {\n          keys = [keys];\n        }\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().removeRTCUserData(id, keys, isInner, {\n            onSuccess: resolve,\n            onError: reject\n          }, message);\n        });\n      }\n    }, {\n      key: 'setRoomData',\n      value: function setRoomData(key, value, isInner, message) {\n        var id = this.room.id,\n            im = this.im;\n\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().setRTCRoomData(id, key, value, isInner, {\n            onSuccess: resolve,\n            onError: reject\n          }, message);\n        });\n      }\n    }, {\n      key: 'getRoomData',\n      value: function getRoomData(keys, isInner) {\n        var id = this.room.id,\n            im = this.im;\n\n        if (!utils.isArray(keys)) {\n          keys = [keys];\n        }\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().getRTCRoomData(id, keys, isInner, {\n            onSuccess: function onSuccess(data) {\n              resolve(data);\n            },\n            onError: reject\n          });\n        });\n      }\n    }, {\n      key: 'removeRoomData',\n      value: function removeRoomData(keys, isInner, message) {\n        var id = this.room.id,\n            im = this.im;\n\n        if (!utils.isArray(keys)) {\n          keys = [keys];\n        }\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().removeRTCRoomData(id, keys, isInner, {\n            onSuccess: resolve,\n            onError: reject\n          }, message);\n        });\n      }\n    }, {\n      key: 'getExistUsers',\n      value: function getExistUsers() {\n        var im = this.im,\n            room = this.room;\n\n        return utils.deferred(function (resolve, reject) {\n          im.getInstance().getRTCUserList(room, {\n            onSuccess: resolve,\n            onError: function onError(code) {\n              return reject(errorHandler(code));\n            }\n          });\n        });\n      }\n    }, {\n      key: 'sendMessage',\n      value: function sendMessage(message) {\n        var im = this.im,\n            room = this.room,\n            RongIMLib = this.RongIMLib;\n\n        return utils.deferred(function (resolve, reject) {\n          var conversationType = 12,\n              targetId = room.id;\n          var register = function register(name) {\n            var isCounted = false;\n            var isPersited = false;\n            var tag = new RongIMLib.MessageTag(isCounted, isPersited);\n            var content = message.content;\n\n            var props = utils.map(utils.toArray(content), function (columns) {\n              return columns[0];\n            });\n            im.registerMessageType(name, name, tag, props);\n          };\n          var create = function create() {\n            var name = message.name,\n                content = message.content;\n\n            if (utils.isUndefined(im.RegisterMessage[name])) {\n              register(name);\n            }\n            return new im.RegisterMessage[name](content);\n          };\n          var msg = create();\n          Logger$1.log(LogTag.IM, {\n            msg: 'send:before',\n            message: message\n          });\n          im.getInstance().sendMessage(conversationType, targetId, msg, {\n            onSuccess: function onSuccess() {\n              Logger$1.log(LogTag.IM, {\n                msg: 'send:after',\n                message: message\n              });\n              resolve(room);\n            },\n            onError: function onError(code) {\n              Logger$1.log(LogTag.IM, {\n                msg: 'send:after',\n                error: code\n              });\n              reject(code);\n            }\n          });\n        });\n      }\n    }, {\n      key: 'getMessage',\n      value: function getMessage(type, content) {\n        var name = getMsgName(type);\n        content = utils.toJSON(content);\n        return {\n          name: name,\n          content: content\n        };\n      }\n    }, {\n      key: 'isIMReady',\n      value: function isIMReady() {\n        var context = this;\n        var CONNECTED = context.RongIMLib.ConnectionStatus.CONNECTED;\n\n        return context.connectState === CONNECTED;\n      }\n    }, {\n      key: 'getAppInfo',\n      value: function getAppInfo() {\n        var context = this;\n        var im = context.im;\n\n        return im.getInstance().getAppInfo();\n      }\n    }, {\n      key: 'isJoined',\n      value: function isJoined() {\n        var context = this;\n        return context.isJoinRoom;\n      }\n    }, {\n      key: 'isSupportRTC',\n      value: function isSupportRTC() {\n        var context = this;\n        var im = context.im;\n\n        var isSupport = false;\n        if (utils.isFunction(im.prototype.RTCPing)) {\n          isSupport = true;\n        }\n        return isSupport;\n      }\n    }, {\n      key: 'rePing',\n      value: function rePing() {\n        var context = this;\n        var timer = context.timer;\n\n        var roomId = context.getRoomId();\n        if (!utils.isUndefined(roomId)) {\n          context.emit(CommonEvent.RTC_PING_RECONNECT);\n          timer.pause();\n          context.rtcPing(context.room);\n        }\n      }\n    }, {\n      key: 'rtcPing',\n      value: function rtcPing(room) {\n        var context = this;\n        var im = context.im,\n            timer = context.timer;\n\n        var count = 0;\n        var isPinging = false;\n        var Status = {\n          reset: function reset() {\n            count = 0;\n            isPinging = false;\n          },\n          sum: function sum() {\n            count += 1;\n          }\n        };\n        var Inner = ErrorType.Inner;\n\n        timer.resume(function () {\n          if (count > PingCount) {\n            timer.pause();\n            utils.extend(context, {\n              isJoinRoom: false\n            });\n            context.emit(CommonEvent.LEFT);\n            return context.emit(CommonEvent.ERROR, Inner.SOCKET_UNAVAILABLE);\n          }\n          if (!context.isIMReady()) {\n            return;\n          }\n          // 如果上次 Ping 没有结束，累计 Ping 次数\n          if (isPinging) {\n            Status.sum();\n          }\n          isPinging = true;\n          im.getInstance().RTCPing(room, {\n            onSuccess: function onSuccess() {\n              if (context.isRTCPingInFailure) {\n                context.emit(CommonEvent.RTC_PING_RECONNECT);\n                Logger$1.log(LogTag.IM, {\n                  msg: 'RTC Ping ReSuccess'\n                });\n              }\n              context.isRTCPingInFailure = false;\n              Status.reset();\n            },\n            onError: function onError(code) {\n              context.isRTCPingInFailure = true;\n              Logger$1.error(LogTag.IM, {\n                msg: 'RTC Ping Error' + code\n              });\n            }\n          });\n        }, true);\n      }\n    }]);\n    return IM;\n  }(EventEmitter);\n\n  function StreamHandler(im, option) {\n    var pc = null;\n    var prosumer = new utils.Prosumer();\n    var eventEmitter = new EventEmitter();\n    // const { detect } = option;\n    // const network = new Network(detect);\n\n    utils.extend(option, { im: im });\n\n    var User = {\n      set: function set$$1(key, data, isInner, message) {\n        return im.setUserData(key, data, isInner, message);\n      },\n      SET_USERINFO: 'uris'\n    };\n\n    // 缓存数据\n    var DataCache = utils.Cache();\n    var DataCacheName = {\n      USERS: 'room_users',\n      // 全部通知后一次性交换 SDP\n      IS_NOTIFY_READY: 'is_notify_ready'\n    };\n\n    // 已发布资源数据\n    var PubResourceCache = utils.Cache();\n\n    /**\n     * 缓存订阅关系, 每次修改需同步全量数据\n     */\n    var subCache = utils.Cache();\n    var SubscribeCache = {\n      get: function get$$1(userId) {\n        return subCache.get(userId);\n      },\n      set: function set$$1(userId, subs) {\n        return subCache.set(userId, subs);\n      },\n      getKeys: function getKeys() {\n        return subCache.getKeys();\n      },\n      remove: function remove(user) {\n        var userId = user.id;\n\n        var subs = subCache.get(userId) || [];\n        var streamId = pc.getStreamId(user);\n        subs = utils.filter(subs, function (_ref) {\n          var msid = _ref.msid;\n\n          return !utils.isEqual(streamId, msid);\n        });\n        subCache.set(userId, subs);\n      },\n      clear: function clear() {\n        subCache.clear();\n      }\n    };\n\n    var clear = function clear() {\n      DataCache.clear();\n      PubResourceCache.clear();\n      SubscribeCache.clear();\n    };\n\n    // const getSubPromiseUId = (user) => {\n    //   let { id, stream: { tag, type } } = user;\n    //   let tpl = '{id}_{tag}_{type}';\n    //   return utils.tplEngine(tpl, {\n    //     id,\n    //     tag,\n    //     type\n    //   });\n    // };\n\n    var getSubs = function getSubs() {\n      var subs = [];\n      var userIds = SubscribeCache.getKeys();\n      utils.forEach(userIds, function (userId) {\n        var streams = SubscribeCache.get(userId);\n        utils.forEach(streams, function (stream) {\n          subs.push(stream);\n        });\n      });\n      return subs;\n    };\n\n    var getBody = function getBody(desc, config) {\n      var subs = getSubs();\n      var body = {\n        subscribeList: subs\n      };\n      if (desc) {\n        utils.extend(body, {\n          sdp: desc\n        });\n        return utils.Defer.resolve(body);\n      }\n      return pc.getOffer(config).then(function (offer) {\n        utils.extend(body, {\n          sdp: offer\n        });\n        return body;\n      });\n    };\n\n    var negotiate = function negotiate(offer, response) {\n      var sdp = response.sdp;\n\n      pc.setOffer(offer).then(function () {\n        pc.setAnwser(sdp);\n      });\n    };\n\n    var getUris = function getUris(publishList) {\n      return utils.map(publishList, function (stream) {\n        var msid = stream.msid;\n\n        var tag = pc.getTagByStreamId(msid);\n        utils.extend(stream, {\n          tag: tag,\n          state: StreamState.ENABLE\n        });\n        return stream;\n      });\n    };\n\n    var exchangeHandler = function exchangeHandler(result, user, type, offer) {\n      var publishList = result.publishList,\n          sdp = result.sdp;\n\n      pc.setOffer(offer).then(function () {\n        pc.setAnwser(sdp);\n      });\n      Logger$1.log(LogTag.STREAM_HANDLER, {\n        msg: 'exchangeHandler set sdp'\n      });\n      var uris = getUris(publishList);\n      var getTempUris = function getTempUris(type) {\n        var userId = user.id;\n\n        var cacheUris = PubResourceCache.get(userId) || [];\n        var isPublish = utils.isEqual(type, Message.PUBLISH);\n        if (isPublish) {\n          cacheUris = uris;\n        }\n        var streamId = pc.getStreamId(user);\n        var getCondition = function getCondition(stream) {\n          var msid = stream.msid;\n\n          return utils.isEqual(msid, streamId);\n        };\n        var tempUris = utils.filter(cacheUris, function (stream) {\n          return getCondition(stream);\n        });\n        return utils.isEmpty(tempUris) ? uris : tempUris;\n      };\n      var sendUris = getTempUris(type);\n      var content = {\n        uris: sendUris\n      };\n      var message = im.getMessage(type, content);\n      var isInner = true;\n      User.set(User.SET_USERINFO, uris, isInner, message);\n      return PubResourceCache.set(user.id, uris);\n    };\n\n    var getUId = function getUId(user, tpl) {\n      tpl = tpl || '{userId}_{tag}_{type}';\n      var userId = user.id,\n          _user$stream = user.stream,\n          tag = _user$stream.tag,\n          type = _user$stream.type;\n\n      if (utils.isEmpty(tag)) {\n        tpl = '{userId}_{type}';\n      }\n      return utils.tplEngine(tpl, {\n        userId: userId,\n        tag: tag,\n        type: type\n      });\n    };\n\n    var dispatchStreamEvent$$1 = function dispatchStreamEvent$$1(user, callback) {\n      var id = user.id,\n          uris = user.stream.uris;\n\n      utils.forEach(uris, function (uri) {\n        var tag = uri.tag,\n            type = uri.mediaType;\n\n        var key = getUId({ id: id, stream: { tag: tag, type: type } });\n        callback(key, uri);\n      });\n    };\n\n    var getUsersById = function getUsersById(user) {\n      var id = user.id;\n\n      var subs = SubscribeCache.get(id);\n      var streams = {},\n          msTypes = {};\n      utils.forEach(subs, function (_ref2) {\n        var msid = _ref2.msid,\n            tag = _ref2.tag,\n            type = _ref2.type;\n\n        streams[msid] = tag;\n        var types = msTypes[msid] || [];\n        types.push(type);\n        msTypes[msid] = types;\n      });\n      var users = [];\n      utils.forEach(streams, function (tag, msid) {\n        var types = msTypes[msid] || [];\n        var type = msTypes[0];\n        type = utils.isEqual(types.length, 2) ? StreamType.AUDIO_AND_VIDEO : type;\n        users.push({\n          id: id,\n          stream: {\n            tag: tag,\n            type: type\n          }\n        });\n      });\n      return users;\n    };\n\n    var isTrackExist = function isTrackExist(user, types) {\n      var userId = user.id,\n          tag = user.stream.tag;\n\n      var isError = false;\n      utils.forEach(types, function (type) {\n        var tUser = {\n          id: userId,\n          stream: {\n            tag: tag,\n            type: type\n          }\n        };\n        var key = getUId(tUser);\n\n        var _ref3 = DataCache.get(key) || {},\n            uri = _ref3.uri;\n\n        if (utils.isUndefined(uri)) {\n          isError = true;\n        }\n      });\n      return isError;\n    };\n\n    var publish = function publish(user) {\n      var roomId = im.getRoomId();\n      pc.addStream(user);\n      return utils.deferred(function (resolve, reject) {\n        pc.createOffer(user).then(function (desc) {\n          return getBody(desc).then(function (body) {\n            var url = utils.tplEngine(Path.PUBLISH, {\n              roomId: roomId\n            });\n            Logger$1.log(LogTag.STREAM_HANDLER, {\n              msg: 'publish:request',\n              roomId: roomId,\n              user: user,\n              body: body\n            });\n            var headers = getHeaders(im);\n            return request$2.post({\n              path: url,\n              body: body,\n              headers: headers\n            }).then(function (response) {\n              Logger$1.log(LogTag.STREAM_HANDLER, {\n                msg: 'publish:response',\n                roomId: roomId,\n                user: user,\n                response: response\n              });\n              exchangeHandler(response, user, Message.PUBLISH, desc);\n              resolve();\n            }, function (error) {\n              Logger$1.log(LogTag.STREAM_HANDLER, {\n                msg: 'publish:response:error',\n                roomId: roomId,\n                user: user,\n                error: error\n              });\n              reject(error);\n            });\n          });\n        });\n      });\n    };\n\n    var unpublish = function unpublish(user) {\n      user = utils.clone(user);\n      var roomId = im.getRoomId();\n      pc.removeStream(user);\n      return getBody().then(function (body) {\n        var desc = body.sdp;\n\n        var url = utils.tplEngine(Path.UNPUBLISH, {\n          roomId: roomId\n        });\n        Logger$1.log(LogTag.STREAM_HANDLER, {\n          msg: 'unpublish:request',\n          roomId: roomId,\n          user: user,\n          body: body\n        });\n        var headers = getHeaders(im);\n        return request$2.post({\n          path: url,\n          body: body,\n          headers: headers\n        }).then(function (response) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'unpublish:response',\n            roomId: roomId,\n            user: user,\n            response: response\n          });\n          exchangeHandler(response, user, Message.UNPUBLISH, desc);\n        }, function (error) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'unpublish:response',\n            roomId: roomId,\n            user: user,\n            error: error\n          });\n        });\n      });\n    };\n\n    var subscribe = function subscribe(user, callback) {\n      var userId = user.id,\n          _user$stream2 = user.stream,\n          tag = _user$stream2.tag,\n          type = _user$stream2.type,\n          size = _user$stream2.size;\n\n      var subs = SubscribeCache.get(userId) || [];\n      var types = [StreamType.VIDEO, StreamType.AUDIO];\n      if (!utils.isEqual(type, StreamType.AUDIO_AND_VIDEO)) {\n        types = [type];\n      }\n      if (isTrackExist(user, types)) {\n        var Inner = ErrorType.Inner;\n\n        return utils.Defer.reject(Inner.STREAM_TRACK_NOT_EXIST);\n      }\n\n      if (utils.isUndefined(size)) {\n        size = StreamSize.MAX;\n      }\n\n      utils.forEach(types, function (type) {\n        var tUser = {\n          id: userId,\n          stream: {\n            tag: tag,\n            type: type\n          }\n        };\n        var key = getUId(tUser);\n        var uri = DataCache.get(key);\n        var isAdd = true;\n        utils.forEach(subs, function (sub) {\n          var existType = sub.type,\n              existTag = sub.tag;\n\n          if (isV2Tag(existTag)) {\n            tag = TAG_V2;\n          }\n          var isExist = utils.isEqual(type, existType) && utils.isEqual(tag, existTag);\n          if (isExist) {\n            isAdd = false;\n          }\n        });\n        if (isAdd && !utils.isUndefined(uri)) {\n          uri = utils.clone(uri);\n          uri = utils.rename(uri, {\n            mediaType: 'type'\n          });\n          subs.push(uri);\n        }\n      });\n      SubscribeCache.set(userId, subs);\n      var roomId = im.getRoomId();\n      return utils.deferred(function (resolve, reject) {\n        getBody().then(function (body) {\n          var offer = body.sdp;\n\n          var url = utils.tplEngine(Path.SUBSCRIBE, {\n            roomId: roomId\n          });\n          var headers = getHeaders(im);\n          var option = {\n            path: url,\n            body: body,\n            headers: headers\n          };\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'subscribe:request',\n            roomId: roomId,\n            option: option\n          });\n          request$2.post(option).then(function (response) {\n            var answer = response.sdp;\n\n            pc.setOffer(offer).then(function () {\n              pc.setAnwser(answer);\n            });\n            Logger$1.log(LogTag.STREAM_HANDLER, {\n              msg: 'subscribe:response:stream:not:arrive',\n              roomId: roomId,\n              user: user,\n              response: response\n            });\n            callback();\n            pc.addRenderers(user);\n\n            var uris = SubscribeCache.get(user.id) || [];\n            utils.forEach(uris, function (uri) {\n              var state = uri.state,\n                  type = uri.type;\n\n              var isEnabled = utils.isEqual(state, StreamState.ENABLE);\n              pc.updateRenderers(user, type, isEnabled);\n            });\n\n            resolve(user);\n          });\n        }, function (error) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'subscribe:response:error',\n            roomId: roomId,\n            user: user,\n            error: error\n          });\n          reject(error);\n        });\n      });\n    };\n\n    var unsubscribe = function unsubscribe(user) {\n      SubscribeCache.remove(user);\n      var roomId = im.getRoomId();\n      Logger$1.log(LogTag.STREAM_HANDLER, {\n        msg: 'unsubscribe:start',\n        roomId: roomId,\n        user: user\n      });\n      return getBody().then(function (body) {\n        var url = utils.tplEngine(Path.UNSUBSCRIBE, {\n          roomId: roomId\n        });\n        Logger$1.log(LogTag.STREAM_HANDLER, {\n          msg: 'unsubscrube:request',\n          roomId: roomId,\n          user: user,\n          body: body\n        });\n        var headers = getHeaders(im);\n        var offer = body.sdp;\n\n        return request$2.post({\n          path: url,\n          body: body,\n          headers: headers\n        }).then(function (response) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'unsubscribe:response',\n            roomId: roomId,\n            user: user,\n            response: response\n          });\n          negotiate(offer, response);\n          pc.removeRenderers(user);\n        }, function (error) {\n          Logger$1.error(LogTag.STREAM_HANDLER, {\n            msg: 'unsubscribe:response:error',\n            roomId: roomId,\n            user: user,\n            error: error\n          });\n        }).catch(function (error) {\n          Logger$1.error(LogTag.STREAM_HANDLER, {\n            msg: 'unsubscribe:response:error',\n            roomId: roomId,\n            user: user,\n            error: error\n          });\n        });\n      });\n    };\n\n    var update = function update(user) {\n      return utils.deferred(function (resolve, reject) {\n        var code = pc.updateDisplayName(user);\n        code === IE9_REQUEST_SUCCESS ? resolve() : reject();\n      });\n    };\n\n    var resize = function resize(user) {\n      var size = user.stream.size,\n          id = user.id;\n\n      var streams = SubscribeCache.get(id);\n      if (utils.isUndefined(streams)) {\n        return utils.Defer.reject(ErrorType.Inner.STREAM_NOT_EXIST);\n      }\n      var roomId = im.getRoomId();\n      Logger$1.log(LogTag.STREAM_HANDLER, {\n        msg: 'resize:start',\n        roomId: roomId,\n        user: user\n      });\n      return getBody().then(function (body) {\n        var streamId = pc.getStreamId(user);\n        var stream = utils.filter(streams, function (stream) {\n          var msid = stream.msid;\n\n          return utils.isEqual(streamId, msid);\n        })[0];\n        if (!stream) {\n          var error = ErrorType.Inner.STREAM_NOT_EXIST;\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'resize:response',\n            roomId: roomId,\n            user: user,\n            error: error\n          });\n          return utils.Defer.reject(error);\n        }\n        var uri = stream.uri;\n\n        utils.forEach(body.subscribeList, function (stream) {\n          if (utils.isEqual(stream.uri, uri)) {\n            utils.extend(stream, {\n              simulcast: size\n            });\n          }\n        });\n        var url = utils.tplEngine(Path.RESIZE, {\n          roomId: roomId\n        });\n        Logger$1.log(LogTag.STREAM_HANDLER, {\n          msg: 'resize: request',\n          roomId: roomId,\n          user: user,\n          body: body\n        });\n        var headers = getHeaders(im);\n        return request$2.post({\n          path: url,\n          body: body,\n          headers: headers\n        }).then(function (response) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'resize:response',\n            roomId: roomId,\n            user: user,\n            response: response\n          });\n        }, function (error) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'resize:response',\n            roomId: roomId,\n            user: user,\n            error: error\n          });\n        });\n      });\n    };\n\n    var isCurrentUser = function isCurrentUser(user) {\n      var _im$getUser = im.getUser(),\n          id = _im$getUser.id;\n\n      return utils.isEqual(user.id, id);\n    };\n\n    var trackHandler = function trackHandler(user, type, isEnable) {\n      user.stream.type = type;\n      pc.setTrackEnabled(user, isEnable);\n    };\n\n    var getFitUris = function getFitUris(user, type, state) {\n      var id = user.id;\n\n      var uris = PubResourceCache.get(id) || [];\n      var targetId = pc.getStreamId(user);\n      uris = utils.filter(uris, function (stream) {\n        var msid = stream.msid,\n            mediaType = stream.mediaType;\n\n        var isSameStream = utils.isEqual(targetId, msid),\n            isSameType = utils.isEqual(mediaType, type);\n        var isFit = isSameStream && isSameType;\n        if (isFit) {\n          utils.extend(stream, {\n            state: state\n          });\n        }\n        return isFit;\n      });\n      return uris;\n    };\n\n    var saveModify = function saveModify(user, type, state) {\n      var uris = getFitUris(user, type, state);\n      if (!utils.isEmpty(uris)) {\n        var id = user.id;\n\n        var fullUris = PubResourceCache.get(id);\n        var content = {\n          uris: uris\n        };\n        var message = im.getMessage(Message.MODIFY, content);\n        var isInner = true;\n        User.set(User.SET_USERINFO, fullUris, isInner, message);\n      }\n      return utils.Defer.resolve();\n    };\n\n    var modifyTrack = function modifyTrack(user, type, state, isEnabled) {\n      trackHandler(user, type, isEnabled);\n      if (isCurrentUser(user)) {\n        saveModify(user, type, state, isEnabled);\n      }\n      return utils.Defer.resolve();\n    };\n\n    var mute = function mute(user) {\n      var isEnabled = false;\n      return modifyTrack(user, StreamType.AUDIO, StreamState.DISBALE, isEnabled);\n    };\n\n    var unmute = function unmute(user) {\n      var isEnabled = true;\n      return modifyTrack(user, StreamType.AUDIO, StreamState.ENABLE, isEnabled);\n    };\n\n    var disable = function disable(user) {\n      var isEnabled = false;\n      return modifyTrack(user, StreamType.VIDEO, StreamState.DISBALE, isEnabled);\n    };\n\n    var enable = function enable(user) {\n      var isEnabled = true;\n      return modifyTrack(user, StreamType.VIDEO, StreamState.ENABLE, isEnabled);\n    };\n\n    var reconnect = function reconnect() {\n      var roomId = im.getRoomId();\n      getBody(null, {\n        isRestartICE: true\n      }).then(function (body) {\n        var url = utils.tplEngine(Path.SUBSCRIBE, {\n          roomId: roomId\n        });\n        Logger$1.log(LogTag.STREAM_HANDLER, {\n          msg: 'publish:reconnect:request',\n          roomId: roomId,\n          body: body\n        });\n        var headers = getHeaders(im);\n        var offer = body.sdp;\n\n        return request$2.post({\n          path: url,\n          body: body,\n          headers: headers\n        }).then(function (response) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'publish:reconnect:response',\n            roomId: roomId,\n            response: response\n          });\n          negotiate(offer, response);\n        }, function (error) {\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'publish:reconnect:response',\n            roomId: roomId,\n            error: error\n          });\n          return error;\n        });\n      });\n    };\n\n    var compare = function compare() {\n      var format = function format(users) {\n        var streams = {};\n        utils.forEach(users, function (_ref4) {\n          var uris = _ref4.uris;\n\n          utils.forEach(uris, function (uri) {\n            var msid = uri.msid;\n\n            var resources = streams[msid] || [];\n            resources.push(uri);\n            streams[msid] = resources;\n          });\n        });\n        return streams;\n      };\n\n      var dispatch = function dispatch(event, id, uris, callback) {\n        dispatchStreamEvent({ id: id, uris: uris }, function (user) {\n          if (utils.isFunction(callback)) {\n            return callback(user);\n          }\n          im.emit(event, user);\n        });\n      };\n\n      var compareStreams = function compareStreams(localUsers, remoteUsers) {\n        localUsers = format(localUsers);\n        remoteUsers = format(remoteUsers);\n        var tempLocalUsers = utils.clone(localUsers);\n        utils.forEach(remoteUsers, function (remoteUris, remoteMSId) {\n          /** \n           * 包含本地资源说明流没有变化，删除 tempLocalUsers，且需比对 track 变化，state 有差异，以 remoteUsers 为准\n           * 未包含说明是新发布资源，触发 published 事件 \n           * 遍历后 tempLocalUsers 还有数据认为是取消发布\n           */\n          var isInclude = remoteMSId in localUsers;\n\n          var _pc$getStreamSymbolBy = pc.getStreamSymbolById(remoteMSId),\n              _pc$getStreamSymbolBy2 = slicedToArray(_pc$getStreamSymbolBy, 1),\n              userId = _pc$getStreamSymbolBy2[0];\n\n          var _im$getUser2 = im.getUser(),\n              currentUserId = _im$getUser2.id;\n\n          var isCurrent = utils.isEqual(currentUserId, userId);\n          if (isInclude) {\n            delete tempLocalUsers[remoteMSId];\n            var tempRemote = utils.toJSON(remoteUris);\n            var localUris = localUsers[remoteMSId];\n            var tempLocal = utils.toJSON(localUris);\n            if (!utils.isEqual(tempRemote, tempLocal)) {\n              dispatch('', userId, remoteUris, function (user) {\n                dispatchOperationEvent(user, function (event, user) {\n                  im.emit(event, user);\n                });\n              });\n            }\n          } else {\n            if (!isCurrent) {\n              dispatch(DownEvent.STREAM_PUBLISHED, userId, remoteUris);\n            }\n          }\n        });\n        utils.forEach(tempLocalUsers, function (localUris, localMSId) {\n          var _pc$getStreamSymbolBy3 = pc.getStreamSymbolById(localMSId),\n              _pc$getStreamSymbolBy4 = slicedToArray(_pc$getStreamSymbolBy3, 1),\n              userId = _pc$getStreamSymbolBy4[0];\n\n          dispatch(DownEvent.STREAM_UNPUBLISHED, userId, localUris);\n        });\n      };\n\n      var compareUser = function compareUser(localUsers, remoteUsers) {\n        var tempLocalUsers = utils.clone(localUsers);\n        var tempRemoteUsers = utils.toArray(remoteUsers);\n\n        var _im$getUsers = im.getUsers(),\n            currentUserId = _im$getUsers.id;\n\n        utils.forEach(tempRemoteUsers, function (_ref5) {\n          var _ref6 = slicedToArray(_ref5, 1),\n              remoteUserId = _ref6[0];\n\n          var isInclude = remoteUserId in localUsers;\n          var isCurrent = utils.isEqual(currentUserId, remoteUserId);\n          Logger$1.log(LogTag.STREAM_HANDLER, {\n            msg: 'stream:compareuser',\n            currentUserId: currentUserId,\n            remoteUserId: remoteUserId,\n            isInclude: isInclude,\n            localUsers: localUsers\n          });\n          if (isInclude) {\n            delete tempLocalUsers[remoteUserId];\n          } else {\n            if (!isCurrent) {\n              im.emit(DownEvent.ROOM_USER_JOINED, { id: remoteUserId });\n            }\n          }\n        });\n        tempLocalUsers = utils.toArray(tempLocalUsers);\n        utils.forEach(tempLocalUsers, function (_ref7) {\n          var _ref8 = slicedToArray(_ref7, 1),\n              id = _ref8[0];\n\n          im.emit(DownEvent.ROOM_USER_LEFT, { id: id });\n        });\n      };\n\n      return im.getUsers().then(function (remoteUsers) {\n        utils.forEach(remoteUsers, function (user) {\n          var uris = user.uris;\n\n          uris = utils.parse(uris);\n          utils.extend(user, {\n            uris: uris\n          });\n        });\n        var localUsers = DataCache.get(DataCacheName.USERS);\n        compareUser(localUsers, remoteUsers);\n        compareStreams(localUsers, remoteUsers);\n        DataCache.set(DataCacheName.USERS, remoteUsers);\n      });\n    };\n\n    im.on(CommonEvent.CONNECTED, function () {\n      var users = DataCache.get(DataCacheName.USERS);\n      if (users) {\n        // 断网重连后, 调用 compare()\n        compare().then(function () {\n          reconnect();\n        }, function (error) {\n          Logger$1.log(LogTag.IM, {\n            msg: 'reconnect:compare:error',\n            error: error\n          });\n        });\n      }\n    });\n\n    /**\n     * 已在房间，再有新人发布资源触发此事件\n     * 此处为缓存对应人员资源信息\n     */\n    im.on(DownEvent.STREAM_PUBLISHED, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      dispatchStreamEvent$$1(user, function (key, uri) {\n        DataCache.set(key, uri);\n      });\n    });\n\n    im.on(CommonEvent.LEFT, function () {\n      clear();\n      pc && pc.close();\n    });\n\n    im.on(CommonEvent.JOINED, function (error, room) {\n      if (error) {\n        throw error;\n      }\n      var users = room.users;\n\n      pc = new PeerConnection(option);\n      im.emit(CommonEvent.PEERCONN_CREATED, pc);\n\n      /**\n       * IE 插件自动渲染\n       * 此处不监听 addstream、removestream\n       * TODO 是否需要监听 change, 做重连处理\n       */\n\n      var usersHandler = function usersHandler() {\n        DataCache.set(DataCacheName.USERS, users);\n\n        var _im$getUsers2 = im.getUsers(),\n            currentUserId = _im$getUsers2.id;\n\n        utils.forEach(users, function (data, id) {\n          var uris = data.uris;\n\n          if (utils.isUndefined(uris)) {\n            Logger$1.log(LogTag.STREAM_HANDLER, {\n              msg: 'user exist, uris is empty',\n              user: {\n                id: id\n              }\n            });\n            return;\n          }\n          if (utils.isEqual(currentUserId, id)) {\n            var _uris = slicedToArray(uris, 1),\n                stream = _uris[0];\n\n            if (utils.isUndefined(stream)) {\n              return;\n            }\n            var type = stream.mediaType,\n                tag = stream.tag;\n\n            type = utils.isEqual(uris.length, 1) ? type : StreamType.AUDIO_AND_VIDEO;\n            return unpublish({\n              id: id,\n              stream: {\n                tag: tag,\n                type: type\n              }\n            });\n          }\n          utils.forEach(uris, function (uri) {\n            var type = uri.mediaType,\n                tag = uri.tag;\n\n            var key = getUId({\n              id: id,\n              stream: {\n                type: type,\n                tag: tag\n              }\n            });\n            DataCache.set(key, uri);\n          });\n          var streams = utils.uniq(uris, function (target) {\n            var streamId = target.streamId,\n                tag = target.tag;\n\n            if (isV2Tag(tag)) {\n              tag = TAG_V2;\n            }\n            return {\n              key: [streamId, tag].join('_'),\n              value: { tag: tag }\n            };\n          });\n          utils.forEach(streams, function (stream) {\n            var tag = stream.tag;\n\n            var msUris = utils.filter(uris, function (_ref9) {\n              var msid = _ref9.msid;\n\n              return utils.isInclude(msid, tag);\n            });\n            setTimeout(function () {\n              im.emit(DownEvent.STREAM_PUBLISHED, {\n                id: id,\n                stream: {\n                  tag: tag,\n                  uris: msUris\n                }\n              });\n            });\n          });\n        });\n      };\n      usersHandler();\n    });\n\n    im.on(CommonEvent.RTC_PING_RECONNECT, function () {\n      reconnect();\n    });\n\n    im.on(DownEvent.ROOM_USER_LEFT, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      var users = getUsersById(user);\n      utils.forEach(users, function (user) {\n        unsubscribe(user);\n      });\n    });\n\n    im.on(DownEvent.STREAM_UNPUBLISHED, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      dispatchStreamEvent$$1(user, function (key) {\n        DataCache.remove(key);\n      });\n      unsubscribe(user);\n    });\n\n    im.on(DownEvent.STREAM_MUTED, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      pc.updateRenderers(user, StreamType.AUDIO, false);\n    });\n\n    im.on(DownEvent.STREAM_UNMUTED, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      pc.updateRenderers(user, StreamType.AUDIO, true);\n    });\n\n    im.on(DownEvent.STREAM_DISABLED, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      pc.updateRenderers(user, StreamType.VIDEO, false);\n    });\n\n    im.on(DownEvent.STREAM_ENABLED, function (error, user) {\n      if (error) {\n        throw error;\n      }\n      pc.updateRenderers(user, StreamType.VIDEO, true);\n    });\n\n    eventEmitter.on(CommonEvent.CONSUME, function () {\n      prosumer.consume(function (_ref10, next) {\n        var event = _ref10.event,\n            args = _ref10.args,\n            resolve = _ref10.resolve,\n            reject = _ref10.reject;\n\n        switch (event) {\n          case UpEvent.STREAM_PUBLISH:\n            return publish.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.STREAM_UNPUBLISH:\n            return unpublish.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.STREAM_SUBSCRIBE:\n            return subscribe.apply(undefined, toConsumableArray(args).concat([function () {\n              next();\n            }])).then(function (result) {\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.STREAM_UNSUBSCRIBE:\n            return unsubscribe.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.STREAM_RESIZE:\n            return resize.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.STREAM_UPDATE:\n            return update.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.AUDIO_MUTE:\n            return mute.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.AUDIO_UNMUTE:\n            return unmute.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.VIDEO_DISABLE:\n            return disable.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          case UpEvent.VIDEO_ENABLE:\n            return enable.apply(undefined, toConsumableArray(args)).then(function (result) {\n              next();\n              resolve(result);\n            }).catch(function (error) {\n              next();\n              reject(error);\n            });\n          default:\n            Logger$1.warn(LogTag.STREAM_HANDLER, {\n              event: event,\n              msg: 'unkown event'\n            });\n        }\n      });\n    });\n\n    var dispatch = function dispatch(event, args) {\n      return utils.deferred(function (resolve, reject) {\n        prosumer.produce({\n          event: event,\n          args: args,\n          resolve: resolve,\n          reject: reject\n        });\n        eventEmitter.emit(CommonEvent.CONSUME);\n      });\n    };\n\n    return {\n      dispatch: dispatch\n    };\n  }\n\n  function RoomHandler(im, option) {\n    var join = function join(room) {\n      Logger$1.log(LogTag.ROOM_HANDLER, {\n        msg: 'join:before',\n        room: room\n      });\n      if (im.isJoined()) {\n        var Inner = ErrorType.Inner;\n\n        Logger$1.log(LogTag.ROOM_HANDLER, {\n          msg: 'join:after',\n          extra: 'repeate join room'\n        });\n        return utils.Defer.reject(Inner.ROOM_REPEAT_JOIN);\n      }\n      return utils.deferred(function (resolve, reject) {\n        var mode = option.mode;\n\n        utils.extend(room, {\n          mode: mode\n        });\n        im.joinRoom(room).then(function (users) {\n          Logger$1.log(LogTag.ROOM_HANDLER, {\n            msg: 'join:after',\n            users: users\n          });\n          users = utils.toArray(users);\n          users = utils.map(users, function (user) {\n            return {\n              id: user[0]\n            };\n          });\n          resolve({\n            users: users\n          });\n        }).catch(function (error) {\n          Logger$1.log(LogTag.ROOM_HANDLER, {\n            msg: 'join:after:error',\n            room: room,\n            error: error\n          });\n          reject(error);\n        });\n      });\n    };\n    var leave = function leave() {\n      var roomId = im.getRoomId();\n      var user = im.getUser();\n      Logger$1.log(LogTag.ROOM_HANDLER, {\n        msg: 'leave:before',\n        roomId: roomId,\n        user: user\n      });\n      im.setLeaveStatus();\n      var token = im.getRTCToken();\n      var url = utils.tplEngine(Path.EXIT, {\n        roomId: roomId\n      });\n      var headers = getHeaders(im);\n      return utils.deferred(function (resolve, reject) {\n        request$2.post({\n          path: url,\n          headers: headers,\n          body: {\n            token: token\n          }\n        }).then(function () {\n          im.leaveRoom().then(function () {\n            Logger$1.log(LogTag.ROOM_HANDLER, {\n              msg: 'leave:after',\n              roomId: roomId,\n              user: user\n            });\n            resolve();\n          }, function (error) {\n            Logger$1.log(LogTag.ROOM_HANDLER, {\n              msg: 'leave:im:error',\n              roomId: roomId,\n              error: error,\n              user: user\n            });\n            reject(error);\n          });\n        }, function (error) {\n          Logger$1.log(LogTag.ROOM_HANDLER, {\n            msg: 'leave:ms:error',\n            roomId: roomId,\n            error: error,\n            user: user\n          });\n          reject(error);\n        });\n      });\n    };\n    var get$$1 = function get$$1() {\n      return im.getRoom();\n    };\n    var dispatch = function dispatch(event, args) {\n      switch (event) {\n        case UpEvent.ROOM_JOIN:\n          return join.apply(undefined, toConsumableArray(args));\n        case UpEvent.ROOM_LEAVE:\n          return leave.apply(undefined, toConsumableArray(args));\n        case UpEvent.ROOM_GET:\n          return get$$1.apply(undefined, toConsumableArray(args));\n        default:\n          Logger$1.warn(LogTag.ROOM_HANDLER, {\n            event: event,\n            msg: 'unkown event'\n          });\n      }\n    };\n    return {\n      dispatch: dispatch\n    };\n  }\n\n  function StorageHandler(im) {\n    var isInner = false;\n    var getType = function getType(type) {\n      return utils.isEqual(type, StorageType.ROOM) ? 'Room' : 'User';\n    };\n    var getName = function getName(operate, type) {\n      var tpl = '{operate}{type}Data';\n      type = getType(type);\n      return utils.tplEngine(tpl, {\n        operate: operate,\n        type: type\n      });\n    };\n    var set$$1 = function set$$1(type, key, value, message) {\n      var name = getName('set', type);\n      return im[name](key, value, isInner, message);\n    };\n    var get$$1 = function get$$1(type, key) {\n      var name = getName('get', type);\n      return im[name](key, isInner);\n    };\n    var remove = function remove(type, key, message) {\n      var name = getName('remove', type);\n      return im[name](key, isInner, message);\n    };\n    var dispatch = function dispatch(event, args) {\n      switch (event) {\n        case UpEvent.STORAGE_SET:\n          return set$$1.apply(undefined, toConsumableArray(args));\n        case UpEvent.STORAGE_GET:\n          return get$$1.apply(undefined, toConsumableArray(args));\n        case UpEvent.STORAGE_REMOVE:\n          return remove.apply(undefined, toConsumableArray(args));\n        default:\n          Logger$1.warn(LogTag.STORAGE_HANDLER, {\n            event: event,\n            msg: 'unkown event'\n          });\n      }\n    };\n    return {\n      dispatch: dispatch\n    };\n  }\n\n  function MessageHandler(im) {\n    var send = function send(message) {\n      return im.sendMessage(message);\n    };\n    var dispatch = function dispatch(event, args) {\n      switch (event) {\n        case UpEvent.MESSAGE_SEND:\n          return send.apply(undefined, toConsumableArray(args));\n        default:\n          Logger$1.warn(LogTag.MESSAGE, {\n            event: event,\n            msg: 'unkown event'\n          });\n      }\n    };\n    return {\n      dispatch: dispatch\n    };\n  }\n\n  function DeviceHandler() {\n    var get$$1 = function get$$1() {\n      return navigator.mediaDevices.enumerateDevices();\n    };\n    var dispatch = function dispatch(event, args) {\n      switch (event) {\n        case UpEvent.DEVICE_GET:\n          return get$$1.apply(undefined, toConsumableArray(args));\n        default:\n          Logger$1.warn(LogTag.DEVICE, {\n            event: event,\n            msg: 'unkown event'\n          });\n      }\n    };\n    return {\n      dispatch: dispatch\n    };\n  }\n\n  function ReportHandler(im) {\n    var pc = null,\n        reportTimer = 0;\n\n    var TrackCache = utils.Cache();\n    var TrackStateCache = utils.Cache();\n    var setTrackCache = function setTrackCache(stream, user) {\n      var tracks = stream.getTracks();\n      var id = user.id,\n          tag = user.stream.tag;\n\n      utils.forEach(tracks, function (_ref) {\n        var trackId = _ref.id;\n\n        TrackCache.set(trackId, {\n          id: id,\n          stream: { tag: tag }\n        });\n      });\n    };\n    var getAudioLevel = function getAudioLevel(level) {\n      level = level || 0;\n      var index = Math.floor(level / 1000);\n      if (index >= AUDIO_LEVEL.length) {\n        index = 0;\n      }\n      return AUDIO_LEVEL[index];\n    };\n    var resourceHandler = function resourceHandler(stat) {\n      var trackId = stat.googTrackId,\n          mediaType = stat.mediaType;\n\n      if (utils.isEqual(mediaType, 'audio')) {\n        // 不区分 Input、Output 最终对应用层按 user 暴露\n        var audioLevel = stat['audioOutputLevel'] || stat['audioInputLevel'];\n        audioLevel = getAudioLevel(audioLevel);\n        var latestLevel = TrackStateCache.get(trackId);\n        if (!utils.isEqual(latestLevel, audioLevel)) {\n          var user = TrackCache.get(trackId);\n          if (utils.isObject(user)) {\n            utils.extend(user.stream, {\n              audioLevel: audioLevel\n            });\n            TrackStateCache.set(trackId, audioLevel);\n            im.emit(DownEvent.REPORT_SPOKE, user);\n          }\n        }\n      }\n    };\n    var statsHandler = function statsHandler(stats) {\n      utils.forEach(stats, function (stat) {\n        var type = stat.type;\n\n        if (utils.isInclude(type, 'ssrc')) {\n          resourceHandler(stat);\n        }\n      });\n    };\n    var clear = function clear() {\n      clearInterval(reportTimer);\n    };\n    im.on(CommonEvent.PEERCONN_CREATED, function (error, _pc) {\n      if (error) {\n        throw error;\n      }\n      pc = _pc;\n    });\n    im.on(CommonEvent.LEFT, function () {\n      TrackCache.clear();\n      TrackStateCache.clear();\n      clear();\n    });\n    im.on(CommonEvent.PUBLISHED_STREAM, function (error, data) {\n      if (error) {\n        throw error;\n      }\n      var mediaStream = data.mediaStream,\n          user = data.user;\n\n      setTrackCache(mediaStream, user);\n    });\n\n    var start = function start(_option) {\n      var option = {\n        frequency: REPORT_FREQUENCY\n      };\n      if (utils.isObject(_option)) {\n        utils.extend(option, _option);\n      }\n      if (isSafari()) {\n        return;\n      }\n      if (reportTimer) {\n        clear();\n      }\n      reportTimer = setInterval(function () {\n        if (!pc) {\n          return clear();\n        }\n        pc.getStats(function (stats) {\n          statsHandler(stats);\n        });\n      }, option.frequency);\n      return utils.Defer.resolve();\n    };\n    var stop = function stop() {\n      clear();\n      return utils.Defer.resolve();\n    };\n    var dispatch = function dispatch(event, args) {\n      switch (event) {\n        case UpEvent.REPORT_START:\n          return start.apply(undefined, toConsumableArray(args));\n        case UpEvent.REPORT_STOP:\n          return stop.apply(undefined, toConsumableArray(args));\n      }\n    };\n    return {\n      dispatch: dispatch\n    };\n  }\n\n  var Client = function (_EventEmitter) {\n    inherits(Client, _EventEmitter);\n\n    /* \n      let option = {\n        url: 'mediaServer path',\n        RongIMLib\n      };\n    */\n    function Client(option) {\n      classCallCheck(this, Client);\n\n      var _this = possibleConstructorReturn(this, (Client.__proto__ || Object.getPrototypeOf(Client)).call(this));\n\n      var im = new IM(option);\n      var RequestHandler = {\n        room: RoomHandler(im, option),\n        stream: StreamHandler(im, option),\n        storage: StorageHandler(im),\n        message: MessageHandler(im),\n        device: DeviceHandler(im),\n        report: ReportHandler(im)\n      };\n      var context = _this;\n      var RongIMLib = option.RongIMLib;\n\n      var destroyed = false;\n      utils.extend(context, {\n        RongIMLib: RongIMLib,\n        option: option,\n        destroyed: destroyed,\n        im: im,\n        RequestHandler: RequestHandler\n      });\n      var bindEvent = function bindEvent(event) {\n        var name = event.name;\n\n        im.on(name, function (error, user) {\n          context.emit(name, user, error);\n        });\n      };\n      utils.forEach(RoomEvents, bindEvent);\n      im.on(CommonEvent.JOINED, function () {\n        var urls = im.getMSUrl();\n        var customUrl = option.url;\n\n        if (!utils.isEmpty(customUrl)) {\n          urls = [customUrl];\n        }\n        if (utils.isEmpty(urls)) {\n          var Inner = ErrorType.Inner;\n\n          var error = Inner.ENGINE_ERROR;\n          return context.emit(DownEvent.RTC_ERROR, error);\n        }\n        request$2.setOption({\n          urls: urls\n        });\n        context.emit(DownEvent.RTC_MOUNTED);\n      });\n      im.on(CommonEvent.LEFT, function () {\n        context.emit(DownEvent.RTC_UNMOUNTED);\n      });\n      im.on(CommonEvent.ERROR, function (error, data) {\n        context.emit(DownEvent.RTC_ERROR, data, error);\n      });\n      im.on(DownEvent.MESSAGE_RECEIVED, function (error, message) {\n        context.emit(DownEvent.MESSAGE_RECEIVED, message, error);\n      });\n      im.on(DownEvent.REPORT_SPOKE, function (error, user) {\n        context.emit(DownEvent.REPORT_SPOKE, user, error);\n      });\n      var getMSType = function getMSType(uris) {\n        var check = function check(msType) {\n          return utils.some(uris, function (_ref) {\n            var mediaType = _ref.mediaType;\n\n            // return utils.isEqual(msType, mediaType) && utils.isEqual(state, StreamState.ENABLE);\n            // 只区分 track 不区分\n            return utils.isEqual(msType, mediaType);\n          });\n        };\n        var type = StreamType.NODE;\n        var hasAudio = check(StreamType.AUDIO);\n        var hasVideo = check(StreamType.VIDEO);\n        if (hasAudio) {\n          type = StreamType.AUDIO;\n        }\n        if (hasVideo) {\n          type = StreamType.VIDEO;\n        }\n        if (hasVideo && hasAudio) {\n          type = StreamType.AUDIO_AND_VIDEO;\n        }\n        return type;\n      };\n      var eventHandler = function eventHandler(name, result, error) {\n        var id = result.id,\n            _result$stream = result.stream,\n            tag = _result$stream.tag,\n            uris = _result$stream.uris,\n            size = _result$stream.size;\n\n        var user = {\n          id: id,\n          stream: {\n            tag: tag\n          }\n        };\n        if (uris) {\n          user.stream.type = getMSType(uris);\n        }\n        if (size) {\n          user.stream.size = size;\n        }\n        context.emit(name, user, error);\n      };\n      im.on(DownEvent.STREAM_PUBLISHED, function (error, user) {\n        eventHandler(DownEvent.STREAM_PUBLISHED, user, error);\n      });\n      im.on(DownEvent.STREAM_UNPUBLISHED, function (error, user) {\n        eventHandler(DownEvent.STREAM_UNPUBLISHED, user, error);\n      });\n      im.on(DownEvent.STREAM_DISABLED, function (error, user) {\n        eventHandler(DownEvent.STREAM_DISABLED, user, error);\n      });\n      im.on(DownEvent.STREAM_ENABLED, function (error, user) {\n        eventHandler(DownEvent.STREAM_ENABLED, user, error);\n      });\n      im.on(DownEvent.STREAM_MUTED, function (error, user) {\n        eventHandler(DownEvent.STREAM_MUTED, user, error);\n      });\n      im.on(DownEvent.STREAM_UNMUTED, function (error, user) {\n        eventHandler(DownEvent.STREAM_UNMUTED, user, error);\n      });\n      im.on(DownEvent.STREAM_RESIZED, function (error, user) {\n        eventHandler(DownEvent.STREAM_RESIZED, user, error);\n      });\n      return _this;\n    }\n\n    createClass(Client, [{\n      key: 'exec',\n      value: function exec(params) {\n        var context = this;\n        var im = context.im;\n\n        if (context.isDestroyed()) {\n          return utils.Defer.reject(ErrorType.Inner.INSTANCE_IS_DESTROYED);\n        }\n        if (!im.isSupportRTC()) {\n          return utils.Defer.reject(ErrorType.Inner.IM_SDK_VER_NOT_MATCH);\n        }\n        var type = params.type,\n            args = params.args,\n            event = params.event;\n\n        var APIWhitelist = [UpEvent.ROOM_JOIN, UpEvent.DEVICE_GET, UpEvent.STREAM_GET];\n        var isInclude = utils.isInclude(APIWhitelist, event);\n\n        if (!im.isIMReady() && !isInclude) {\n          return utils.Defer.reject(ErrorType.Inner.IM_NOT_CONNECTED);\n        }\n\n        if (!isInclude && !im.isJoined()) {\n          return utils.Defer.reject(ErrorType.Inner.RTC_NOT_JOIN_ROOM);\n        }\n        var RequestHandler = this.RequestHandler;\n\n        Logger$1.log(type, {\n          func: event,\n          type: EventType.REQUEST,\n          args: args\n        });\n        return RequestHandler[type].dispatch(event, args).then(function (result) {\n          Logger$1.log(type, {\n            func: event,\n            type: EventType.RESPONSE,\n            result: result\n          });\n          return result;\n        }, function (error) {\n          Logger$1.error(type, {\n            func: event,\n            type: EventType.RESPONSE,\n            error: error\n          });\n          error = utils.rename(error, {\n            resultCode: 'code'\n          });\n          throw error;\n        });\n      }\n    }, {\n      key: 'isDestroyed',\n      value: function isDestroyed() {\n        return this.destroyed;\n      }\n    }, {\n      key: 'extendOption',\n      value: function extendOption(_option) {\n        var context = this;\n        utils.extend(context.option, _option);\n      }\n    }, {\n      key: 'destroy',\n      value: function destroy() {\n        var context = this;\n        utils.extend(context, {\n          destroyed: true\n        });\n        context.teardown();\n        context.im.teardown();\n      }\n    }]);\n    return Client;\n  }(EventEmitter);\n\n  var Storage = function () {\n    function Storage(_option) {\n      classCallCheck(this, Storage);\n\n      _option = _option || {};\n      var context = this;\n      var client = context.getClient();\n      var option = {\n        type: StorageType.ROOM\n      };\n      utils.extend(option, _option);\n      utils.extend(context, {\n        option: option,\n        client: client\n      });\n    }\n\n    createClass(Storage, [{\n      key: 'set',\n      value: function set$$1(key, value, message) {\n        var _check = check({ key: key, value: value }, ['key', 'value']),\n            isIllegal = _check.isIllegal,\n            name = _check.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var context = this;\n        var client = context.client,\n            type = context.option.type;\n\n        return client.exec({\n          event: UpEvent.STORAGE_SET,\n          type: 'storage',\n          args: [type, key, value, message]\n        });\n      }\n    }, {\n      key: 'get',\n      value: function get$$1(key) {\n        var _check2 = check({ key: key }, ['key']),\n            isIllegal = _check2.isIllegal,\n            name = _check2.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var context = this;\n        var client = context.client,\n            type = context.option.type;\n\n        return client.exec({\n          event: UpEvent.STORAGE_GET,\n          type: 'storage',\n          args: [type, key]\n        });\n      }\n    }, {\n      key: 'remove',\n      value: function remove(key, message) {\n        var _check3 = check({ key: key }, ['key']),\n            isIllegal = _check3.isIllegal,\n            name = _check3.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var context = this;\n        var client = context.client,\n            type = context.option.type;\n\n        return client.exec({\n          event: UpEvent.STORAGE_REMOVE,\n          type: 'storage',\n          args: [type, key, message]\n        });\n      }\n    }]);\n    return Storage;\n  }();\n\n  var Message$1 = function () {\n    function Message(_option) {\n      classCallCheck(this, Message);\n\n      var context = this;\n      var client = context.getClient();\n      var option = {\n        received: function received() {}\n      };\n      utils.extend(option, _option);\n      utils.extend(context, {\n        client: client,\n        option: option\n      });\n      utils.forEach(MessageEvents, function (event) {\n        var _event = event,\n            name = _event.name,\n            type = _event.type;\n\n        client.on(name, function (error, message) {\n          event = option[type] || utils.noop;\n          event(message, error);\n          Logger$1.log(LogTag.MESSAGE, {\n            event: type,\n            message: message\n          });\n        });\n      });\n    }\n\n    createClass(Message, [{\n      key: 'send',\n      value: function send(message) {\n        var _check = check(message, ['name', 'content']),\n            isIllegal = _check.isIllegal,\n            name = _check.name;\n\n        if (isIllegal) {\n          var error = getError(name);\n          return utils.Defer.reject(error);\n        }\n        var context = this;\n        var client = context.client;\n\n        return client.exec({\n          event: UpEvent.MESSAGE_SEND,\n          type: 'message',\n          args: [message]\n        });\n      }\n    }]);\n    return Message;\n  }();\n\n  var Device = function () {\n    function Device() {\n      classCallCheck(this, Device);\n\n      var context = this;\n      var client = context.getClient();\n      utils.extend(context, {\n        client: client\n      });\n    }\n\n    createClass(Device, [{\n      key: 'get',\n      value: function get$$1() {\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.DEVICE_GET,\n          type: 'device',\n          args: []\n        });\n      }\n    }]);\n    return Device;\n  }();\n\n  var Report = function () {\n    function Report(_option) {\n      classCallCheck(this, Report);\n\n      var context = this;\n      var client = context.getClient();\n      var option = {\n        received: function received() {}\n      };\n      utils.extend(option, _option);\n      utils.extend(context, {\n        client: client,\n        option: option\n      });\n      utils.forEach(ReportEvents, function (event) {\n        var _event = event,\n            name = _event.name,\n            type = _event.type;\n\n        client.on(name, function (error, report) {\n          event = option[type] || utils.noop;\n          event(report, error);\n        });\n      });\n    }\n\n    createClass(Report, [{\n      key: 'start',\n      value: function start(option) {\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.REPORT_START,\n          type: 'report',\n          args: [option]\n        });\n      }\n    }, {\n      key: 'stop',\n      value: function stop() {\n        var client = this.client;\n\n        return client.exec({\n          event: UpEvent.REPORT_STOP,\n          type: 'report',\n          args: []\n        });\n      }\n    }]);\n    return Report;\n  }();\n\n  var RongRTC = function () {\n    function RongRTC(_option) {\n      classCallCheck(this, RongRTC);\n\n      var context = this;\n      var option = {\n        url: '',\n        debug: false,\n        bitrate: {\n          max: 1000,\n          min: 100,\n          start: 300\n        },\n        mode: RTC_MODE.RTC,\n        created: function created() {},\n        mounted: function mounted() {},\n        unmounted: function unmounted() {},\n        destroyed: function destroyed() {},\n        error: function error() {}\n      };\n      utils.extend(option, _option);\n      var logger = option.logger,\n          debug = option.debug;\n      var Outer = ErrorType.Outer;\n\n      if (utils.isFunction(logger)) {\n        Logger$1.watch(logger, true);\n      }\n      if (debug) {\n        Logger$1.watch(function (log) {\n          utils.Log.log(log);\n        });\n      }\n      var client = new Client(option);\n      utils.forEach([Room, Stream, Storage, Message$1, Device, Report], function (module) {\n        module.prototype.getClient = function () {\n          return client;\n        };\n      });\n      utils.extend(context, {\n        Room: Room,\n        Stream: Stream,\n        Storage: Storage,\n        StreamType: StreamType,\n        StreamSize: StreamSize,\n        StorageType: StorageType,\n        Mode: RTC_MODE,\n        Message: Message$1,\n        Device: Device,\n        Report: Report,\n        ErrorType: Outer,\n        option: option,\n        client: client\n      });\n      var created = option.created,\n          mounted = option.mounted,\n          unmounted = option.unmounted,\n          error = option.error;\n\n      created();\n      Logger$1.log(LogTag.LIFECYCLE, {\n        state: 'created'\n      });\n      client.on(DownEvent.RTC_MOUNTED, function () {\n        mounted();\n        Logger$1.log(LogTag.LIFECYCLE, {\n          state: 'mounted'\n        });\n      });\n      client.on(DownEvent.RTC_UNMOUNTED, function () {\n        unmounted();\n        Logger$1.log(LogTag.LIFECYCLE, {\n          state: 'unmounted'\n        });\n      });\n      client.on(DownEvent.RTC_ERROR, function (e, data) {\n        if (e) {\n          throw new Error(e);\n        }\n        error(data);\n      });\n    }\n\n    createClass(RongRTC, [{\n      key: 'destroy',\n      value: function destroy() {\n        var destroyed = this.option.destroyed,\n            client = this.client;\n\n        destroyed();\n        client.destroy();\n        Logger$1.log(LogTag.LIFECYCLE, {\n          state: 'destroyed'\n        });\n      }\n    }]);\n    return RongRTC;\n  }();\n\n  utils.extend(RongRTC, {\n    StreamType: StreamType,\n    StreamSize: StreamSize,\n    StorageType: StorageType,\n    Tag: IE_TAG,\n    Resolution: IE_RESOLUTION,\n    FrameRate: IE_FRAME_RATE,\n    Rotate: IE_ROTATE,\n    Mode: RTC_MODE\n  });\n\n  return RongRTC;\n\n})));\n"
  },
  {
    "path": "calllib-v3/web-ie/lib/promise.js",
    "content": "(function () {\n  /*!\n 基于 es6-promise\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license   Licensed under MIT license\n *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version   v4.2.8+1e68dce6\n */\n\n  function objectOrFunction(x) {\n    var type = typeof x;\n    return x !== null && (type === 'object' || type === 'function');\n  }\n\n  function isFunction(x) {\n    return typeof x === 'function';\n  }\n\n\n\n  var _isArray = void 0;\n  if (Array.isArray) {\n    _isArray = Array.isArray;\n  } else {\n    _isArray = function (x) {\n      return Object.prototype.toString.call(x) === '[object Array]';\n    };\n  }\n\n  var isArray = _isArray;\n\n  var len = 0;\n  var vertxNext = void 0;\n  var customSchedulerFn = void 0;\n\n  var asap = function asap(callback, arg) {\n    queue[len] = callback;\n    queue[len + 1] = arg;\n    len += 2;\n    if (len === 2) {\n      // If len is 2, that means that we need to schedule an async flush.\n      // If additional callbacks are queued before the queue is flushed, they\n      // will be processed by this flush that we are scheduling.\n      if (customSchedulerFn) {\n        customSchedulerFn(flush);\n      } else {\n        scheduleFlush();\n      }\n    }\n  };\n\n  function setScheduler(scheduleFn) {\n    customSchedulerFn = scheduleFn;\n  }\n\n  function setAsap(asapFn) {\n    asap = asapFn;\n  }\n\n  var browserWindow = typeof window !== 'undefined' ? window : undefined;\n  var browserGlobal = browserWindow || {};\n  var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n  var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n  // test for web worker but not in IE10\n  var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n  // node\n  function useNextTick() {\n    // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n    // see https://github.com/cujojs/when/issues/410 for details\n    return function () {\n      return process.nextTick(flush);\n    };\n  }\n\n  // vertx\n  function useVertxTimer() {\n    if (typeof vertxNext !== 'undefined') {\n      return function () {\n        vertxNext(flush);\n      };\n    }\n\n    return useSetTimeout();\n  }\n\n  function useMutationObserver() {\n    var iterations = 0;\n    var observer = new BrowserMutationObserver(flush);\n    var node = document.createTextNode('');\n    observer.observe(node, { characterData: true });\n\n    return function () {\n      node.data = iterations = ++iterations % 2;\n    };\n  }\n\n  // web worker\n  function useMessageChannel() {\n    var channel = new MessageChannel();\n    channel.port1.onmessage = flush;\n    return function () {\n      return channel.port2.postMessage(0);\n    };\n  }\n\n  function useSetTimeout() {\n    // Store setTimeout reference so es6-promise will be unaffected by\n    // other code modifying setTimeout (like sinon.useFakeTimers())\n    var globalSetTimeout = setTimeout;\n    return function () {\n      return globalSetTimeout(flush, 1);\n    };\n  }\n\n  var queue = new Array(1000);\n  function flush() {\n    for (var i = 0; i < len; i += 2) {\n      var callback = queue[i];\n      var arg = queue[i + 1];\n\n      callback(arg);\n\n      queue[i] = undefined;\n      queue[i + 1] = undefined;\n    }\n\n    len = 0;\n  }\n\n  function attemptVertx() {\n    try {\n      var vertx = Function('return this')().require('vertx');\n      vertxNext = vertx.runOnLoop || vertx.runOnContext;\n      return useVertxTimer();\n    } catch (e) {\n      return useSetTimeout();\n    }\n  }\n\n  var scheduleFlush = void 0;\n  // Decide what async method to use to triggering processing of queued callbacks:\n  if (isNode) {\n    scheduleFlush = useNextTick();\n  } else if (BrowserMutationObserver) {\n    scheduleFlush = useMutationObserver();\n  } else if (isWorker) {\n    scheduleFlush = useMessageChannel();\n  } else if (browserWindow === undefined && typeof require === 'function') {\n    scheduleFlush = attemptVertx();\n  } else {\n    scheduleFlush = useSetTimeout();\n  }\n\n  function then(onFulfillment, onRejection) {\n    var parent = this;\n\n    var child = new this.constructor(noop);\n\n    if (child[PROMISE_ID] === undefined) {\n      makePromise(child);\n    }\n\n    var _state = parent._state;\n\n\n    if (_state) {\n      var callback = arguments[_state - 1];\n      asap(function () {\n        return invokeCallback(_state, child, callback, parent._result);\n      });\n    } else {\n      subscribe(parent, child, onFulfillment, onRejection);\n    }\n\n    return child;\n  }\n\n  /**\n   \n    @method resolve\n    @static\n    @param {Any} value value that the returned promise will be resolved with\n    Useful for tooling.\n    @return {Promise} a promise that will become fulfilled with the given\n    `value`\n  */\n  function resolve$1(object) {\n    /*jshint validthis:true */\n    var Constructor = this;\n\n    if (object && typeof object === 'object' && object.constructor === Constructor) {\n      return object;\n    }\n\n    var promise = new Constructor(noop);\n    resolve(promise, object);\n    return promise;\n  }\n\n  var PROMISE_ID = Math.random().toString(36).substring(2);\n\n  function noop() { }\n\n  var PENDING = void 0;\n  var FULFILLED = 1;\n  var REJECTED = 2;\n\n  function selfFulfillment() {\n    return new TypeError(\"You cannot resolve a promise with itself\");\n  }\n\n  function cannotReturnOwn() {\n    return new TypeError('A promises callback cannot return that same promise.');\n  }\n\n  function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n    try {\n      then$$1.call(value, fulfillmentHandler, rejectionHandler);\n    } catch (e) {\n      return e;\n    }\n  }\n\n  function handleForeignThenable(promise, thenable, then$$1) {\n    asap(function (promise) {\n      var sealed = false;\n      var error = tryThen(then$$1, thenable, function (value) {\n        if (sealed) {\n          return;\n        }\n        sealed = true;\n        if (thenable !== value) {\n          resolve(promise, value);\n        } else {\n          fulfill(promise, value);\n        }\n      }, function (reason) {\n        if (sealed) {\n          return;\n        }\n        sealed = true;\n\n        reject(promise, reason);\n      }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n      if (!sealed && error) {\n        sealed = true;\n        reject(promise, error);\n      }\n    }, promise);\n  }\n\n  function handleOwnThenable(promise, thenable) {\n    if (thenable._state === FULFILLED) {\n      fulfill(promise, thenable._result);\n    } else if (thenable._state === REJECTED) {\n      reject(promise, thenable._result);\n    } else {\n      subscribe(thenable, undefined, function (value) {\n        return resolve(promise, value);\n      }, function (reason) {\n        return reject(promise, reason);\n      });\n    }\n  }\n\n  function handleMaybeThenable(promise, maybeThenable, then$$1) {\n    if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n      handleOwnThenable(promise, maybeThenable);\n    } else {\n      if (then$$1 === undefined) {\n        fulfill(promise, maybeThenable);\n      } else if (isFunction(then$$1)) {\n        handleForeignThenable(promise, maybeThenable, then$$1);\n      } else {\n        fulfill(promise, maybeThenable);\n      }\n    }\n  }\n\n  function resolve(promise, value) {\n    if (promise === value) {\n      reject(promise, selfFulfillment());\n    } else if (objectOrFunction(value)) {\n      var then$$1 = void 0;\n      try {\n        then$$1 = value.then;\n      } catch (error) {\n        reject(promise, error);\n        return;\n      }\n      handleMaybeThenable(promise, value, then$$1);\n    } else {\n      fulfill(promise, value);\n    }\n  }\n\n  function publishRejection(promise) {\n    if (promise._onerror) {\n      promise._onerror(promise._result);\n    }\n\n    publish(promise);\n  }\n\n  function fulfill(promise, value) {\n    if (promise._state !== PENDING) {\n      return;\n    }\n\n    promise._result = value;\n    promise._state = FULFILLED;\n\n    if (promise._subscribers.length !== 0) {\n      asap(publish, promise);\n    }\n  }\n\n  function reject(promise, reason) {\n    if (promise._state !== PENDING) {\n      return;\n    }\n    promise._state = REJECTED;\n    promise._result = reason;\n\n    asap(publishRejection, promise);\n  }\n\n  function subscribe(parent, child, onFulfillment, onRejection) {\n    var _subscribers = parent._subscribers;\n    var length = _subscribers.length;\n\n\n    parent._onerror = null;\n\n    _subscribers[length] = child;\n    _subscribers[length + FULFILLED] = onFulfillment;\n    _subscribers[length + REJECTED] = onRejection;\n\n    if (length === 0 && parent._state) {\n      asap(publish, parent);\n    }\n  }\n\n  function publish(promise) {\n    var subscribers = promise._subscribers;\n    var settled = promise._state;\n\n    if (subscribers.length === 0) {\n      return;\n    }\n\n    var child = void 0,\n      callback = void 0,\n      detail = promise._result;\n\n    for (var i = 0; i < subscribers.length; i += 3) {\n      child = subscribers[i];\n      callback = subscribers[i + settled];\n\n      if (child) {\n        invokeCallback(settled, child, callback, detail);\n      } else {\n        callback(detail);\n      }\n    }\n\n    promise._subscribers.length = 0;\n  }\n\n  function invokeCallback(settled, promise, callback, detail) {\n    var hasCallback = isFunction(callback),\n      value = void 0,\n      error = void 0,\n      succeeded = true;\n\n    if (hasCallback) {\n      try {\n        value = callback(detail);\n      } catch (e) {\n        succeeded = false;\n        error = e;\n      }\n\n      if (promise === value) {\n        reject(promise, cannotReturnOwn());\n        return;\n      }\n    } else {\n      value = detail;\n    }\n\n    if (promise._state !== PENDING) {\n      // noop\n    } else if (hasCallback && succeeded) {\n      resolve(promise, value);\n    } else if (succeeded === false) {\n      reject(promise, error);\n    } else if (settled === FULFILLED) {\n      fulfill(promise, value);\n    } else if (settled === REJECTED) {\n      reject(promise, value);\n    }\n  }\n\n  function initializePromise(promise, resolver) {\n    try {\n      resolver(function resolvePromise(value) {\n        resolve(promise, value);\n      }, function rejectPromise(reason) {\n        reject(promise, reason);\n      });\n    } catch (e) {\n      reject(promise, e);\n    }\n  }\n\n  var id = 0;\n  function nextId() {\n    return id++;\n  }\n\n  function makePromise(promise) {\n    promise[PROMISE_ID] = id++;\n    promise._state = undefined;\n    promise._result = undefined;\n    promise._subscribers = [];\n  }\n\n  function validationError() {\n    return new Error('Array Methods must be provided an Array');\n  }\n\n  var Enumerator = function () {\n    function Enumerator(Constructor, input) {\n      this._instanceConstructor = Constructor;\n      this.promise = new Constructor(noop);\n\n      if (!this.promise[PROMISE_ID]) {\n        makePromise(this.promise);\n      }\n\n      if (isArray(input)) {\n        this.length = input.length;\n        this._remaining = input.length;\n\n        this._result = new Array(this.length);\n\n        if (this.length === 0) {\n          fulfill(this.promise, this._result);\n        } else {\n          this.length = this.length || 0;\n          this._enumerate(input);\n          if (this._remaining === 0) {\n            fulfill(this.promise, this._result);\n          }\n        }\n      } else {\n        reject(this.promise, validationError());\n      }\n    }\n\n    Enumerator.prototype._enumerate = function _enumerate(input) {\n      for (var i = 0; this._state === PENDING && i < input.length; i++) {\n        this._eachEntry(input[i], i);\n      }\n    };\n\n    Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n      var c = this._instanceConstructor;\n      var resolve$$1 = c.resolve;\n\n\n      if (resolve$$1 === resolve$1) {\n        var _then = void 0;\n        var error = void 0;\n        var didError = false;\n        try {\n          _then = entry.then;\n        } catch (e) {\n          didError = true;\n          error = e;\n        }\n\n        if (_then === then && entry._state !== PENDING) {\n          this._settledAt(entry._state, i, entry._result);\n        } else if (typeof _then !== 'function') {\n          this._remaining--;\n          this._result[i] = entry;\n        } else if (c === Promise$1) {\n          var promise = new c(noop);\n          if (didError) {\n            reject(promise, error);\n          } else {\n            handleMaybeThenable(promise, entry, _then);\n          }\n          this._willSettleAt(promise, i);\n        } else {\n          this._willSettleAt(new c(function (resolve$$1) {\n            return resolve$$1(entry);\n          }), i);\n        }\n      } else {\n        this._willSettleAt(resolve$$1(entry), i);\n      }\n    };\n\n    Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n      var promise = this.promise;\n\n\n      if (promise._state === PENDING) {\n        this._remaining--;\n\n        if (state === REJECTED) {\n          reject(promise, value);\n        } else {\n          this._result[i] = value;\n        }\n      }\n\n      if (this._remaining === 0) {\n        fulfill(promise, this._result);\n      }\n    };\n\n    Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n      var enumerator = this;\n\n      subscribe(promise, undefined, function (value) {\n        return enumerator._settledAt(FULFILLED, i, value);\n      }, function (reason) {\n        return enumerator._settledAt(REJECTED, i, reason);\n      });\n    };\n\n    return Enumerator;\n  }();\n\n  /**\n    @method all\n    @static\n    @param {Array} entries array of promises\n    @param {String} label optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise} promise that is fulfilled when all `promises` have been\n    fulfilled, or rejected if any of them become rejected.\n    @static\n  */\n  function all(entries) {\n    return new Enumerator(this, entries).promise;\n  }\n\n  /**\n    @method race\n    @static\n    @param {Array} promises array of promises to observe\n    Useful for tooling.\n    @return {Promise} a promise which settles in the same way as the first passed\n    promise to settle.\n  */\n  function race(entries) {\n    /*jshint validthis:true */\n    var Constructor = this;\n\n    if (!isArray(entries)) {\n      return new Constructor(function (_, reject) {\n        return reject(new TypeError('You must pass an array to race.'));\n      });\n    } else {\n      return new Constructor(function (resolve, reject) {\n        var length = entries.length;\n        for (var i = 0; i < length; i++) {\n          Constructor.resolve(entries[i]).then(resolve, reject);\n        }\n      });\n    }\n  }\n\n  /**\n    @method reject\n    @static\n    @param {Any} reason value that the returned promise will be rejected with.\n    Useful for tooling.\n    @return {Promise} a promise rejected with the given `reason`.\n  */\n  function reject$1(reason) {\n    /*jshint validthis:true */\n    var Constructor = this;\n    var promise = new Constructor(noop);\n    reject(promise, reason);\n    return promise;\n  }\n\n  function needsResolver() {\n    throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n  }\n\n  function needsNew() {\n    throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n  }\n\n  /**\n    @class Promise\n    @param {Function} resolver\n    Useful for tooling.\n    @constructor\n  */\n\n  var Promise$1 = function () {\n    function Promise(resolver) {\n      this[PROMISE_ID] = nextId();\n      this._result = this._state = undefined;\n      this._subscribers = [];\n\n      if (noop !== resolver) {\n        typeof resolver !== 'function' && needsResolver();\n        this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n      }\n    }\n\n    /**\n     @method then\n    @param {Function} onFulfilled\n    @param {Function} onRejected\n    Useful for tooling.\n    @return {Promise}\n    */\n\n    /**\n    @method catch\n    @param {Function} onRejection\n    Useful for tooling.\n    @return {Promise}\n    */\n\n\n    Promise.prototype['catch'] = function _catch(onRejection) {\n      return this.then(null, onRejection);\n    };\n\n    /**\n      @method finally\n      @param {Function} callback\n      @return {Promise}\n    */\n\n\n    Promise.prototype['finally'] = function _finally(callback) {\n      var promise = this;\n      var constructor = promise.constructor;\n\n      if (isFunction(callback)) {\n        return promise.then(function (value) {\n          return constructor.resolve(callback()).then(function () {\n            return value;\n          });\n        }, function (reason) {\n          return constructor.resolve(callback()).then(function () {\n            throw reason;\n          });\n        });\n      }\n\n      return promise.then(callback, callback);\n    };\n\n    return Promise;\n  }();\n\n  Promise$1.prototype.then = then;\n  Promise$1.all = all;\n  Promise$1.race = race;\n  Promise$1.resolve = resolve$1;\n  Promise$1.reject = reject$1;\n  Promise$1._setScheduler = setScheduler;\n  Promise$1._setAsap = setAsap;\n  Promise$1._asap = asap;\n\n  /*global self*/\n  function polyfill() {\n    var local = void 0;\n\n    if (typeof global !== 'undefined') {\n      local = global;\n    } else if (typeof self !== 'undefined') {\n      local = self;\n    } else {\n      try {\n        local = Function('return this')();\n      } catch (e) {\n        throw new Error('polyfill failed because global object is unavailable in this environment');\n      }\n    }\n\n    var P = local.Promise;\n\n    if (P) {\n      var promiseToString = null;\n      try {\n        promiseToString = Object.prototype.toString.call(P.resolve());\n      } catch (e) {\n        // silently ignored\n      }\n\n      if (promiseToString === '[object Promise]' && !P.cast) {\n        return;\n      }\n    }\n\n    local.Promise = Promise$1;\n  }\n\n  // Strange compat..\n  Promise$1.polyfill = polyfill;\n  Promise$1.Promise = Promise$1;\n\n  window.RongCall = window.RongCall || {};\n  window.RongCall.Promise = Promise$1;\n})();"
  },
  {
    "path": "calllib-v3/web-ie/lib/vue-2.6.7.js",
    "content": "/*!\n * Vue.js v2.6.7\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global = global || self, global.Vue = factory());\n}(this, function () { 'use strict';\n\n  /*  */\n\n  var emptyObject = Object.freeze({});\n\n  // These helpers produce better VM code in JS engines due to their\n  // explicitness and function inlining.\n  function isUndef (v) {\n    return v === undefined || v === null\n  }\n\n  function isDef (v) {\n    return v !== undefined && v !== null\n  }\n\n  function isTrue (v) {\n    return v === true\n  }\n\n  function isFalse (v) {\n    return v === false\n  }\n\n  /**\n   * Check if value is primitive.\n   */\n  function isPrimitive (value) {\n    return (\n      typeof value === 'string' ||\n      typeof value === 'number' ||\n      // $flow-disable-line\n      typeof value === 'symbol' ||\n      typeof value === 'boolean'\n    )\n  }\n\n  /**\n   * Quick object check - this is primarily used to tell\n   * Objects from primitive values when we know the value\n   * is a JSON-compliant type.\n   */\n  function isObject (obj) {\n    return obj !== null && typeof obj === 'object'\n  }\n\n  /**\n   * Get the raw type string of a value, e.g., [object Object].\n   */\n  var _toString = Object.prototype.toString;\n\n  function toRawType (value) {\n    return _toString.call(value).slice(8, -1)\n  }\n\n  /**\n   * Strict object type check. Only returns true\n   * for plain JavaScript objects.\n   */\n  function isPlainObject (obj) {\n    return _toString.call(obj) === '[object Object]'\n  }\n\n  function isRegExp (v) {\n    return _toString.call(v) === '[object RegExp]'\n  }\n\n  /**\n   * Check if val is a valid array index.\n   */\n  function isValidArrayIndex (val) {\n    var n = parseFloat(String(val));\n    return n >= 0 && Math.floor(n) === n && isFinite(val)\n  }\n\n  function isPromise (val) {\n    return (\n      isDef(val) &&\n      typeof val.then === 'function' &&\n      typeof val.catch === 'function'\n    )\n  }\n\n  /**\n   * Convert a value to a string that is actually rendered.\n   */\n  function toString (val) {\n    return val == null\n      ? ''\n      : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n        ? JSON.stringify(val, null, 2)\n        : String(val)\n  }\n\n  /**\n   * Convert an input value to a number for persistence.\n   * If the conversion fails, return original string.\n   */\n  function toNumber (val) {\n    var n = parseFloat(val);\n    return isNaN(n) ? val : n\n  }\n\n  /**\n   * Make a map and return a function for checking if a key\n   * is in that map.\n   */\n  function makeMap (\n    str,\n    expectsLowerCase\n  ) {\n    var map = Object.create(null);\n    var list = str.split(',');\n    for (var i = 0; i < list.length; i++) {\n      map[list[i]] = true;\n    }\n    return expectsLowerCase\n      ? function (val) { return map[val.toLowerCase()]; }\n      : function (val) { return map[val]; }\n  }\n\n  /**\n   * Check if a tag is a built-in tag.\n   */\n  var isBuiltInTag = makeMap('slot,component', true);\n\n  /**\n   * Check if an attribute is a reserved attribute.\n   */\n  var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n\n  /**\n   * Remove an item from an array.\n   */\n  function remove (arr, item) {\n    if (arr.length) {\n      var index = arr.indexOf(item);\n      if (index > -1) {\n        return arr.splice(index, 1)\n      }\n    }\n  }\n\n  /**\n   * Check whether an object has the property.\n   */\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n  function hasOwn (obj, key) {\n    return hasOwnProperty.call(obj, key)\n  }\n\n  /**\n   * Create a cached version of a pure function.\n   */\n  function cached (fn) {\n    var cache = Object.create(null);\n    return (function cachedFn (str) {\n      var hit = cache[str];\n      return hit || (cache[str] = fn(str))\n    })\n  }\n\n  /**\n   * Camelize a hyphen-delimited string.\n   */\n  var camelizeRE = /-(\\w)/g;\n  var camelize = cached(function (str) {\n    return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n  });\n\n  /**\n   * Capitalize a string.\n   */\n  var capitalize = cached(function (str) {\n    return str.charAt(0).toUpperCase() + str.slice(1)\n  });\n\n  /**\n   * Hyphenate a camelCase string.\n   */\n  var hyphenateRE = /\\B([A-Z])/g;\n  var hyphenate = cached(function (str) {\n    return str.replace(hyphenateRE, '-$1').toLowerCase()\n  });\n\n  /**\n   * Simple bind polyfill for environments that do not support it,\n   * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n   * since native bind is now performant enough in most browsers.\n   * But removing it would mean breaking code that was able to run in\n   * PhantomJS 1.x, so this must be kept for backward compatibility.\n   */\n\n  /* istanbul ignore next */\n  function polyfillBind (fn, ctx) {\n    function boundFn (a) {\n      var l = arguments.length;\n      return l\n        ? l > 1\n          ? fn.apply(ctx, arguments)\n          : fn.call(ctx, a)\n        : fn.call(ctx)\n    }\n\n    boundFn._length = fn.length;\n    return boundFn\n  }\n\n  function nativeBind (fn, ctx) {\n    return fn.bind(ctx)\n  }\n\n  var bind = Function.prototype.bind\n    ? nativeBind\n    : polyfillBind;\n\n  /**\n   * Convert an Array-like object to a real Array.\n   */\n  function toArray (list, start) {\n    start = start || 0;\n    var i = list.length - start;\n    var ret = new Array(i);\n    while (i--) {\n      ret[i] = list[i + start];\n    }\n    return ret\n  }\n\n  /**\n   * Mix properties into target object.\n   */\n  function extend (to, _from) {\n    for (var key in _from) {\n      to[key] = _from[key];\n    }\n    return to\n  }\n\n  /**\n   * Merge an Array of Objects into a single Object.\n   */\n  function toObject (arr) {\n    var res = {};\n    for (var i = 0; i < arr.length; i++) {\n      if (arr[i]) {\n        extend(res, arr[i]);\n      }\n    }\n    return res\n  }\n\n  /* eslint-disable no-unused-vars */\n\n  /**\n   * Perform no operation.\n   * Stubbing args to make Flow happy without leaving useless transpiled code\n   * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n   */\n  function noop (a, b, c) {}\n\n  /**\n   * Always return false.\n   */\n  var no = function (a, b, c) { return false; };\n\n  /* eslint-enable no-unused-vars */\n\n  /**\n   * Return the same value.\n   */\n  var identity = function (_) { return _; };\n\n  /**\n   * Generate a string containing static keys from compiler modules.\n   */\n  function genStaticKeys (modules) {\n    return modules.reduce(function (keys, m) {\n      return keys.concat(m.staticKeys || [])\n    }, []).join(',')\n  }\n\n  /**\n   * Check if two values are loosely equal - that is,\n   * if they are plain objects, do they have the same shape?\n   */\n  function looseEqual (a, b) {\n    if (a === b) { return true }\n    var isObjectA = isObject(a);\n    var isObjectB = isObject(b);\n    if (isObjectA && isObjectB) {\n      try {\n        var isArrayA = Array.isArray(a);\n        var isArrayB = Array.isArray(b);\n        if (isArrayA && isArrayB) {\n          return a.length === b.length && a.every(function (e, i) {\n            return looseEqual(e, b[i])\n          })\n        } else if (a instanceof Date && b instanceof Date) {\n          return a.getTime() === b.getTime()\n        } else if (!isArrayA && !isArrayB) {\n          var keysA = Object.keys(a);\n          var keysB = Object.keys(b);\n          return keysA.length === keysB.length && keysA.every(function (key) {\n            return looseEqual(a[key], b[key])\n          })\n        } else {\n          /* istanbul ignore next */\n          return false\n        }\n      } catch (e) {\n        /* istanbul ignore next */\n        return false\n      }\n    } else if (!isObjectA && !isObjectB) {\n      return String(a) === String(b)\n    } else {\n      return false\n    }\n  }\n\n  /**\n   * Return the first index at which a loosely equal value can be\n   * found in the array (if value is a plain object, the array must\n   * contain an object of the same shape), or -1 if it is not present.\n   */\n  function looseIndexOf (arr, val) {\n    for (var i = 0; i < arr.length; i++) {\n      if (looseEqual(arr[i], val)) { return i }\n    }\n    return -1\n  }\n\n  /**\n   * Ensure a function is called only once.\n   */\n  function once (fn) {\n    var called = false;\n    return function () {\n      if (!called) {\n        called = true;\n        fn.apply(this, arguments);\n      }\n    }\n  }\n\n  var SSR_ATTR = 'data-server-rendered';\n\n  var ASSET_TYPES = [\n    'component',\n    'directive',\n    'filter'\n  ];\n\n  var LIFECYCLE_HOOKS = [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated',\n    'errorCaptured',\n    'serverPrefetch'\n  ];\n\n  /*  */\n\n\n\n  var config = ({\n    /**\n     * Option merge strategies (used in core/util/options)\n     */\n    // $flow-disable-line\n    optionMergeStrategies: Object.create(null),\n\n    /**\n     * Whether to suppress warnings.\n     */\n    silent: false,\n\n    /**\n     * Show production mode tip message on boot?\n     */\n    productionTip: \"development\" !== 'production',\n\n    /**\n     * Whether to enable devtools\n     */\n    devtools: \"development\" !== 'production',\n\n    /**\n     * Whether to record perf\n     */\n    performance: false,\n\n    /**\n     * Error handler for watcher errors\n     */\n    errorHandler: null,\n\n    /**\n     * Warn handler for watcher warns\n     */\n    warnHandler: null,\n\n    /**\n     * Ignore certain custom elements\n     */\n    ignoredElements: [],\n\n    /**\n     * Custom user key aliases for v-on\n     */\n    // $flow-disable-line\n    keyCodes: Object.create(null),\n\n    /**\n     * Check if a tag is reserved so that it cannot be registered as a\n     * component. This is platform-dependent and may be overwritten.\n     */\n    isReservedTag: no,\n\n    /**\n     * Check if an attribute is reserved so that it cannot be used as a component\n     * prop. This is platform-dependent and may be overwritten.\n     */\n    isReservedAttr: no,\n\n    /**\n     * Check if a tag is an unknown element.\n     * Platform-dependent.\n     */\n    isUnknownElement: no,\n\n    /**\n     * Get the namespace of an element\n     */\n    getTagNamespace: noop,\n\n    /**\n     * Parse the real tag name for the specific platform.\n     */\n    parsePlatformTagName: identity,\n\n    /**\n     * Check if an attribute must be bound using property, e.g. value\n     * Platform-dependent.\n     */\n    mustUseProp: no,\n\n    /**\n     * Perform updates asynchronously. Intended to be used by Vue Test Utils\n     * This will significantly reduce performance if set to false.\n     */\n    async: true,\n\n    /**\n     * Exposed for legacy reasons\n     */\n    _lifecycleHooks: LIFECYCLE_HOOKS\n  });\n\n  /*  */\n\n  /**\n   * unicode letters used for parsing html tags, component names and property paths.\n   * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n   * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n   */\n  var unicodeLetters = 'a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';\n\n  /**\n   * Check if a string starts with $ or _\n   */\n  function isReserved (str) {\n    var c = (str + '').charCodeAt(0);\n    return c === 0x24 || c === 0x5F\n  }\n\n  /**\n   * Define a property.\n   */\n  function def (obj, key, val, enumerable) {\n    Object.defineProperty(obj, key, {\n      value: val,\n      enumerable: !!enumerable,\n      writable: true,\n      configurable: true\n    });\n  }\n\n  /**\n   * Parse simple path.\n   */\n  var bailRE = new RegExp((\"[^\" + unicodeLetters + \".$_\\\\d]\"));\n  function parsePath (path) {\n    if (bailRE.test(path)) {\n      return\n    }\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n\n  /*  */\n\n  // can we use __proto__?\n  var hasProto = '__proto__' in {};\n\n  // Browser environment sniffing\n  var inBrowser = typeof window !== 'undefined';\n  var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;\n  var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();\n  var UA = inBrowser && window.navigator.userAgent.toLowerCase();\n  var isIE = UA && /msie|trident/.test(UA);\n  var isIE9 = UA && UA.indexOf('msie 9.0') > 0;\n  var isEdge = UA && UA.indexOf('edge/') > 0;\n  var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');\n  var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');\n  var isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge;\n  var isPhantomJS = UA && /phantomjs/.test(UA);\n  var isFF = UA && UA.match(/firefox\\/(\\d+)/);\n\n  // Firefox has a \"watch\" function on Object.prototype...\n  var nativeWatch = ({}).watch;\n\n  var supportsPassive = false;\n  if (inBrowser) {\n    try {\n      var opts = {};\n      Object.defineProperty(opts, 'passive', ({\n        get: function get () {\n          /* istanbul ignore next */\n          supportsPassive = true;\n        }\n      })); // https://github.com/facebook/flow/issues/285\n      window.addEventListener('test-passive', null, opts);\n    } catch (e) {}\n  }\n\n  // this needs to be lazy-evaled because vue may be required before\n  // vue-server-renderer can set VUE_ENV\n  var _isServer;\n  var isServerRendering = function () {\n    if (_isServer === undefined) {\n      /* istanbul ignore if */\n      if (!inBrowser && !inWeex && typeof global !== 'undefined') {\n        // detect presence of vue-server-renderer and avoid\n        // Webpack shimming the process\n        _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';\n      } else {\n        _isServer = false;\n      }\n    }\n    return _isServer\n  };\n\n  // detect devtools\n  var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n  /* istanbul ignore next */\n  function isNative (Ctor) {\n    return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n  }\n\n  var hasSymbol =\n    typeof Symbol !== 'undefined' && isNative(Symbol) &&\n    typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);\n\n  var _Set;\n  /* istanbul ignore if */ // $flow-disable-line\n  if (typeof Set !== 'undefined' && isNative(Set)) {\n    // use native Set when available.\n    _Set = Set;\n  } else {\n    // a non-standard Set polyfill that only works with primitive keys.\n    _Set = /*@__PURE__*/(function () {\n      function Set () {\n        this.set = Object.create(null);\n      }\n      Set.prototype.has = function has (key) {\n        return this.set[key] === true\n      };\n      Set.prototype.add = function add (key) {\n        this.set[key] = true;\n      };\n      Set.prototype.clear = function clear () {\n        this.set = Object.create(null);\n      };\n\n      return Set;\n    }());\n  }\n\n  /*  */\n\n  var warn = noop;\n  var tip = noop;\n  var generateComponentTrace = (noop); // work around flow check\n  var formatComponentName = (noop);\n\n  {\n    var hasConsole = typeof console !== 'undefined';\n    var classifyRE = /(?:^|[-_])(\\w)/g;\n    var classify = function (str) { return str\n      .replace(classifyRE, function (c) { return c.toUpperCase(); })\n      .replace(/[-_]/g, ''); };\n\n    warn = function (msg, vm) {\n      var trace = vm ? generateComponentTrace(vm) : '';\n\n      if (config.warnHandler) {\n        config.warnHandler.call(null, msg, vm, trace);\n      } else if (hasConsole && (!config.silent)) {\n        console.error((\"[Vue warn]: \" + msg + trace));\n      }\n    };\n\n    tip = function (msg, vm) {\n      if (hasConsole && (!config.silent)) {\n        console.warn(\"[Vue tip]: \" + msg + (\n          vm ? generateComponentTrace(vm) : ''\n        ));\n      }\n    };\n\n    formatComponentName = function (vm, includeFile) {\n      if (vm.$root === vm) {\n        return '<Root>'\n      }\n      var options = typeof vm === 'function' && vm.cid != null\n        ? vm.options\n        : vm._isVue\n          ? vm.$options || vm.constructor.options\n          : vm;\n      var name = options.name || options._componentTag;\n      var file = options.__file;\n      if (!name && file) {\n        var match = file.match(/([^/\\\\]+)\\.vue$/);\n        name = match && match[1];\n      }\n\n      return (\n        (name ? (\"<\" + (classify(name)) + \">\") : \"<Anonymous>\") +\n        (file && includeFile !== false ? (\" at \" + file) : '')\n      )\n    };\n\n    var repeat = function (str, n) {\n      var res = '';\n      while (n) {\n        if (n % 2 === 1) { res += str; }\n        if (n > 1) { str += str; }\n        n >>= 1;\n      }\n      return res\n    };\n\n    generateComponentTrace = function (vm) {\n      if (vm._isVue && vm.$parent) {\n        var tree = [];\n        var currentRecursiveSequence = 0;\n        while (vm) {\n          if (tree.length > 0) {\n            var last = tree[tree.length - 1];\n            if (last.constructor === vm.constructor) {\n              currentRecursiveSequence++;\n              vm = vm.$parent;\n              continue\n            } else if (currentRecursiveSequence > 0) {\n              tree[tree.length - 1] = [last, currentRecursiveSequence];\n              currentRecursiveSequence = 0;\n            }\n          }\n          tree.push(vm);\n          vm = vm.$parent;\n        }\n        return '\\n\\nfound in\\n\\n' + tree\n          .map(function (vm, i) { return (\"\" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n              ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n              : formatComponentName(vm))); })\n          .join('\\n')\n      } else {\n        return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n      }\n    };\n  }\n\n  /*  */\n\n  var uid = 0;\n\n  /**\n   * A dep is an observable that can have multiple\n   * directives subscribing to it.\n   */\n  var Dep = function Dep () {\n    this.id = uid++;\n    this.subs = [];\n  };\n\n  Dep.prototype.addSub = function addSub (sub) {\n    this.subs.push(sub);\n  };\n\n  Dep.prototype.removeSub = function removeSub (sub) {\n    remove(this.subs, sub);\n  };\n\n  Dep.prototype.depend = function depend () {\n    if (Dep.target) {\n      Dep.target.addDep(this);\n    }\n  };\n\n  Dep.prototype.notify = function notify () {\n    // stabilize the subscriber list first\n    var subs = this.subs.slice();\n    if (!config.async) {\n      // subs aren't sorted in scheduler if not running async\n      // we need to sort them now to make sure they fire in correct\n      // order\n      subs.sort(function (a, b) { return a.id - b.id; });\n    }\n    for (var i = 0, l = subs.length; i < l; i++) {\n      subs[i].update();\n    }\n  };\n\n  // The current target watcher being evaluated.\n  // This is globally unique because only one watcher\n  // can be evaluated at a time.\n  Dep.target = null;\n  var targetStack = [];\n\n  function pushTarget (target) {\n    targetStack.push(target);\n    Dep.target = target;\n  }\n\n  function popTarget () {\n    targetStack.pop();\n    Dep.target = targetStack[targetStack.length - 1];\n  }\n\n  /*  */\n\n  var VNode = function VNode (\n    tag,\n    data,\n    children,\n    text,\n    elm,\n    context,\n    componentOptions,\n    asyncFactory\n  ) {\n    this.tag = tag;\n    this.data = data;\n    this.children = children;\n    this.text = text;\n    this.elm = elm;\n    this.ns = undefined;\n    this.context = context;\n    this.fnContext = undefined;\n    this.fnOptions = undefined;\n    this.fnScopeId = undefined;\n    this.key = data && data.key;\n    this.componentOptions = componentOptions;\n    this.componentInstance = undefined;\n    this.parent = undefined;\n    this.raw = false;\n    this.isStatic = false;\n    this.isRootInsert = true;\n    this.isComment = false;\n    this.isCloned = false;\n    this.isOnce = false;\n    this.asyncFactory = asyncFactory;\n    this.asyncMeta = undefined;\n    this.isAsyncPlaceholder = false;\n  };\n\n  var prototypeAccessors = { child: { configurable: true } };\n\n  // DEPRECATED: alias for componentInstance for backwards compat.\n  /* istanbul ignore next */\n  prototypeAccessors.child.get = function () {\n    return this.componentInstance\n  };\n\n  Object.defineProperties( VNode.prototype, prototypeAccessors );\n\n  var createEmptyVNode = function (text) {\n    if ( text === void 0 ) text = '';\n\n    var node = new VNode();\n    node.text = text;\n    node.isComment = true;\n    return node\n  };\n\n  function createTextVNode (val) {\n    return new VNode(undefined, undefined, undefined, String(val))\n  }\n\n  // optimized shallow clone\n  // used for static nodes and slot nodes because they may be reused across\n  // multiple renders, cloning them avoids errors when DOM manipulations rely\n  // on their elm reference.\n  function cloneVNode (vnode) {\n    var cloned = new VNode(\n      vnode.tag,\n      vnode.data,\n      // #7975\n      // clone children array to avoid mutating original in case of cloning\n      // a child.\n      vnode.children && vnode.children.slice(),\n      vnode.text,\n      vnode.elm,\n      vnode.context,\n      vnode.componentOptions,\n      vnode.asyncFactory\n    );\n    cloned.ns = vnode.ns;\n    cloned.isStatic = vnode.isStatic;\n    cloned.key = vnode.key;\n    cloned.isComment = vnode.isComment;\n    cloned.fnContext = vnode.fnContext;\n    cloned.fnOptions = vnode.fnOptions;\n    cloned.fnScopeId = vnode.fnScopeId;\n    cloned.asyncMeta = vnode.asyncMeta;\n    cloned.isCloned = true;\n    return cloned\n  }\n\n  /*\n   * not type checking this file because flow doesn't play well with\n   * dynamically accessing methods on Array prototype\n   */\n\n  var arrayProto = Array.prototype;\n  var arrayMethods = Object.create(arrayProto);\n\n  var methodsToPatch = [\n    'push',\n    'pop',\n    'shift',\n    'unshift',\n    'splice',\n    'sort',\n    'reverse'\n  ];\n\n  /**\n   * Intercept mutating methods and emit events\n   */\n  methodsToPatch.forEach(function (method) {\n    // cache original method\n    var original = arrayProto[method];\n    def(arrayMethods, method, function mutator () {\n      var args = [], len = arguments.length;\n      while ( len-- ) args[ len ] = arguments[ len ];\n\n      var result = original.apply(this, args);\n      var ob = this.__ob__;\n      var inserted;\n      switch (method) {\n        case 'push':\n        case 'unshift':\n          inserted = args;\n          break\n        case 'splice':\n          inserted = args.slice(2);\n          break\n      }\n      if (inserted) { ob.observeArray(inserted); }\n      // notify change\n      ob.dep.notify();\n      return result\n    });\n  });\n\n  /*  */\n\n  var arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n  /**\n   * In some cases we may want to disable observation inside a component's\n   * update computation.\n   */\n  var shouldObserve = true;\n\n  function toggleObserving (value) {\n    shouldObserve = value;\n  }\n\n  /**\n   * Observer class that is attached to each observed\n   * object. Once attached, the observer converts the target\n   * object's property keys into getter/setters that\n   * collect dependencies and dispatch updates.\n   */\n  var Observer = function Observer (value) {\n    this.value = value;\n    this.dep = new Dep();\n    this.vmCount = 0;\n    def(value, '__ob__', this);\n    if (Array.isArray(value)) {\n      if (hasProto) {\n        protoAugment(value, arrayMethods);\n      } else {\n        copyAugment(value, arrayMethods, arrayKeys);\n      }\n      this.observeArray(value);\n    } else {\n      this.walk(value);\n    }\n  };\n\n  /**\n   * Walk through all properties and convert them into\n   * getter/setters. This method should only be called when\n   * value type is Object.\n   */\n  Observer.prototype.walk = function walk (obj) {\n    var keys = Object.keys(obj);\n    for (var i = 0; i < keys.length; i++) {\n      defineReactive$$1(obj, keys[i]);\n    }\n  };\n\n  /**\n   * Observe a list of Array items.\n   */\n  Observer.prototype.observeArray = function observeArray (items) {\n    for (var i = 0, l = items.length; i < l; i++) {\n      observe(items[i]);\n    }\n  };\n\n  // helpers\n\n  /**\n   * Augment a target Object or Array by intercepting\n   * the prototype chain using __proto__\n   */\n  function protoAugment (target, src) {\n    /* eslint-disable no-proto */\n    target.__proto__ = src;\n    /* eslint-enable no-proto */\n  }\n\n  /**\n   * Augment a target Object or Array by defining\n   * hidden properties.\n   */\n  /* istanbul ignore next */\n  function copyAugment (target, src, keys) {\n    for (var i = 0, l = keys.length; i < l; i++) {\n      var key = keys[i];\n      def(target, key, src[key]);\n    }\n  }\n\n  /**\n   * Attempt to create an observer instance for a value,\n   * returns the new observer if successfully observed,\n   * or the existing observer if the value already has one.\n   */\n  function observe (value, asRootData) {\n    if (!isObject(value) || value instanceof VNode) {\n      return\n    }\n    var ob;\n    if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n      ob = value.__ob__;\n    } else if (\n      shouldObserve &&\n      !isServerRendering() &&\n      (Array.isArray(value) || isPlainObject(value)) &&\n      Object.isExtensible(value) &&\n      !value._isVue\n    ) {\n      ob = new Observer(value);\n    }\n    if (asRootData && ob) {\n      ob.vmCount++;\n    }\n    return ob\n  }\n\n  /**\n   * Define a reactive property on an Object.\n   */\n  function defineReactive$$1 (\n    obj,\n    key,\n    val,\n    customSetter,\n    shallow\n  ) {\n    var dep = new Dep();\n\n    var property = Object.getOwnPropertyDescriptor(obj, key);\n    if (property && property.configurable === false) {\n      return\n    }\n\n    // cater for pre-defined getter/setters\n    var getter = property && property.get;\n    var setter = property && property.set;\n    if ((!getter || setter) && arguments.length === 2) {\n      val = obj[key];\n    }\n\n    var childOb = !shallow && observe(val);\n    Object.defineProperty(obj, key, {\n      enumerable: true,\n      configurable: true,\n      get: function reactiveGetter () {\n        var value = getter ? getter.call(obj) : val;\n        if (Dep.target) {\n          dep.depend();\n          if (childOb) {\n            childOb.dep.depend();\n            if (Array.isArray(value)) {\n              dependArray(value);\n            }\n          }\n        }\n        return value\n      },\n      set: function reactiveSetter (newVal) {\n        var value = getter ? getter.call(obj) : val;\n        /* eslint-disable no-self-compare */\n        if (newVal === value || (newVal !== newVal && value !== value)) {\n          return\n        }\n        /* eslint-enable no-self-compare */\n        if (customSetter) {\n          customSetter();\n        }\n        // #7981: for accessor properties without setter\n        if (getter && !setter) { return }\n        if (setter) {\n          setter.call(obj, newVal);\n        } else {\n          val = newVal;\n        }\n        childOb = !shallow && observe(newVal);\n        dep.notify();\n      }\n    });\n  }\n\n  /**\n   * Set a property on an object. Adds the new property and\n   * triggers change notification if the property doesn't\n   * already exist.\n   */\n  function set (target, key, val) {\n    if (isUndef(target) || isPrimitive(target)\n    ) {\n      warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n    }\n    if (Array.isArray(target) && isValidArrayIndex(key)) {\n      target.length = Math.max(target.length, key);\n      target.splice(key, 1, val);\n      return val\n    }\n    if (key in target && !(key in Object.prototype)) {\n      target[key] = val;\n      return val\n    }\n    var ob = (target).__ob__;\n    if (target._isVue || (ob && ob.vmCount)) {\n      warn(\n        'Avoid adding reactive properties to a Vue instance or its root $data ' +\n        'at runtime - declare it upfront in the data option.'\n      );\n      return val\n    }\n    if (!ob) {\n      target[key] = val;\n      return val\n    }\n    defineReactive$$1(ob.value, key, val);\n    ob.dep.notify();\n    return val\n  }\n\n  /**\n   * Delete a property and trigger change if necessary.\n   */\n  function del (target, key) {\n    if (isUndef(target) || isPrimitive(target)\n    ) {\n      warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n    }\n    if (Array.isArray(target) && isValidArrayIndex(key)) {\n      target.splice(key, 1);\n      return\n    }\n    var ob = (target).__ob__;\n    if (target._isVue || (ob && ob.vmCount)) {\n      warn(\n        'Avoid deleting properties on a Vue instance or its root $data ' +\n        '- just set it to null.'\n      );\n      return\n    }\n    if (!hasOwn(target, key)) {\n      return\n    }\n    delete target[key];\n    if (!ob) {\n      return\n    }\n    ob.dep.notify();\n  }\n\n  /**\n   * Collect dependencies on array elements when the array is touched, since\n   * we cannot intercept array element access like property getters.\n   */\n  function dependArray (value) {\n    for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n      e = value[i];\n      e && e.__ob__ && e.__ob__.dep.depend();\n      if (Array.isArray(e)) {\n        dependArray(e);\n      }\n    }\n  }\n\n  /*  */\n\n  /**\n   * Option overwriting strategies are functions that handle\n   * how to merge a parent option value and a child option\n   * value into the final value.\n   */\n  var strats = config.optionMergeStrategies;\n\n  /**\n   * Options with restrictions\n   */\n  {\n    strats.el = strats.propsData = function (parent, child, vm, key) {\n      if (!vm) {\n        warn(\n          \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n          'creation with the `new` keyword.'\n        );\n      }\n      return defaultStrat(parent, child)\n    };\n  }\n\n  /**\n   * Helper that recursively merges two data objects together.\n   */\n  function mergeData (to, from) {\n    if (!from) { return to }\n    var key, toVal, fromVal;\n\n    var keys = hasSymbol\n      ? Reflect.ownKeys(from)\n      : Object.keys(from);\n\n    for (var i = 0; i < keys.length; i++) {\n      key = keys[i];\n      // in case the object is already observed...\n      if (key === '__ob__') { continue }\n      toVal = to[key];\n      fromVal = from[key];\n      if (!hasOwn(to, key)) {\n        set(to, key, fromVal);\n      } else if (\n        toVal !== fromVal &&\n        isPlainObject(toVal) &&\n        isPlainObject(fromVal)\n      ) {\n        mergeData(toVal, fromVal);\n      }\n    }\n    return to\n  }\n\n  /**\n   * Data\n   */\n  function mergeDataOrFn (\n    parentVal,\n    childVal,\n    vm\n  ) {\n    if (!vm) {\n      // in a Vue.extend merge, both should be functions\n      if (!childVal) {\n        return parentVal\n      }\n      if (!parentVal) {\n        return childVal\n      }\n      // when parentVal & childVal are both present,\n      // we need to return a function that returns the\n      // merged result of both functions... no need to\n      // check if parentVal is a function here because\n      // it has to be a function to pass previous merges.\n      return function mergedDataFn () {\n        return mergeData(\n          typeof childVal === 'function' ? childVal.call(this, this) : childVal,\n          typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal\n        )\n      }\n    } else {\n      return function mergedInstanceDataFn () {\n        // instance merge\n        var instanceData = typeof childVal === 'function'\n          ? childVal.call(vm, vm)\n          : childVal;\n        var defaultData = typeof parentVal === 'function'\n          ? parentVal.call(vm, vm)\n          : parentVal;\n        if (instanceData) {\n          return mergeData(instanceData, defaultData)\n        } else {\n          return defaultData\n        }\n      }\n    }\n  }\n\n  strats.data = function (\n    parentVal,\n    childVal,\n    vm\n  ) {\n    if (!vm) {\n      if (childVal && typeof childVal !== 'function') {\n        warn(\n          'The \"data\" option should be a function ' +\n          'that returns a per-instance value in component ' +\n          'definitions.',\n          vm\n        );\n\n        return parentVal\n      }\n      return mergeDataOrFn(parentVal, childVal)\n    }\n\n    return mergeDataOrFn(parentVal, childVal, vm)\n  };\n\n  /**\n   * Hooks and props are merged as arrays.\n   */\n  function mergeHook (\n    parentVal,\n    childVal\n  ) {\n    var res = childVal\n      ? parentVal\n        ? parentVal.concat(childVal)\n        : Array.isArray(childVal)\n          ? childVal\n          : [childVal]\n      : parentVal;\n    return res\n      ? dedupeHooks(res)\n      : res\n  }\n\n  function dedupeHooks (hooks) {\n    var res = [];\n    for (var i = 0; i < hooks.length; i++) {\n      if (res.indexOf(hooks[i]) === -1) {\n        res.push(hooks[i]);\n      }\n    }\n    return res\n  }\n\n  LIFECYCLE_HOOKS.forEach(function (hook) {\n    strats[hook] = mergeHook;\n  });\n\n  /**\n   * Assets\n   *\n   * When a vm is present (instance creation), we need to do\n   * a three-way merge between constructor options, instance\n   * options and parent options.\n   */\n  function mergeAssets (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    var res = Object.create(parentVal || null);\n    if (childVal) {\n      assertObjectType(key, childVal, vm);\n      return extend(res, childVal)\n    } else {\n      return res\n    }\n  }\n\n  ASSET_TYPES.forEach(function (type) {\n    strats[type + 's'] = mergeAssets;\n  });\n\n  /**\n   * Watchers.\n   *\n   * Watchers hashes should not overwrite one\n   * another, so we merge them as arrays.\n   */\n  strats.watch = function (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    // work around Firefox's Object.prototype.watch...\n    if (parentVal === nativeWatch) { parentVal = undefined; }\n    if (childVal === nativeWatch) { childVal = undefined; }\n    /* istanbul ignore if */\n    if (!childVal) { return Object.create(parentVal || null) }\n    {\n      assertObjectType(key, childVal, vm);\n    }\n    if (!parentVal) { return childVal }\n    var ret = {};\n    extend(ret, parentVal);\n    for (var key$1 in childVal) {\n      var parent = ret[key$1];\n      var child = childVal[key$1];\n      if (parent && !Array.isArray(parent)) {\n        parent = [parent];\n      }\n      ret[key$1] = parent\n        ? parent.concat(child)\n        : Array.isArray(child) ? child : [child];\n    }\n    return ret\n  };\n\n  /**\n   * Other object hashes.\n   */\n  strats.props =\n  strats.methods =\n  strats.inject =\n  strats.computed = function (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    if (childVal && \"development\" !== 'production') {\n      assertObjectType(key, childVal, vm);\n    }\n    if (!parentVal) { return childVal }\n    var ret = Object.create(null);\n    extend(ret, parentVal);\n    if (childVal) { extend(ret, childVal); }\n    return ret\n  };\n  strats.provide = mergeDataOrFn;\n\n  /**\n   * Default strategy.\n   */\n  var defaultStrat = function (parentVal, childVal) {\n    return childVal === undefined\n      ? parentVal\n      : childVal\n  };\n\n  /**\n   * Validate component names\n   */\n  function checkComponents (options) {\n    for (var key in options.components) {\n      validateComponentName(key);\n    }\n  }\n\n  function validateComponentName (name) {\n    if (!new RegExp((\"^[a-zA-Z][\\\\-\\\\.0-9_\" + unicodeLetters + \"]*$\")).test(name)) {\n      warn(\n        'Invalid component name: \"' + name + '\". Component names ' +\n        'should conform to valid custom element name in html5 specification.'\n      );\n    }\n    if (isBuiltInTag(name) || config.isReservedTag(name)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + name\n      );\n    }\n  }\n\n  /**\n   * Ensure all props option syntax are normalized into the\n   * Object-based format.\n   */\n  function normalizeProps (options, vm) {\n    var props = options.props;\n    if (!props) { return }\n    var res = {};\n    var i, val, name;\n    if (Array.isArray(props)) {\n      i = props.length;\n      while (i--) {\n        val = props[i];\n        if (typeof val === 'string') {\n          name = camelize(val);\n          res[name] = { type: null };\n        } else {\n          warn('props must be strings when using array syntax.');\n        }\n      }\n    } else if (isPlainObject(props)) {\n      for (var key in props) {\n        val = props[key];\n        name = camelize(key);\n        res[name] = isPlainObject(val)\n          ? val\n          : { type: val };\n      }\n    } else {\n      warn(\n        \"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\n        \"but got \" + (toRawType(props)) + \".\",\n        vm\n      );\n    }\n    options.props = res;\n  }\n\n  /**\n   * Normalize all injections into Object-based format\n   */\n  function normalizeInject (options, vm) {\n    var inject = options.inject;\n    if (!inject) { return }\n    var normalized = options.inject = {};\n    if (Array.isArray(inject)) {\n      for (var i = 0; i < inject.length; i++) {\n        normalized[inject[i]] = { from: inject[i] };\n      }\n    } else if (isPlainObject(inject)) {\n      for (var key in inject) {\n        var val = inject[key];\n        normalized[key] = isPlainObject(val)\n          ? extend({ from: key }, val)\n          : { from: val };\n      }\n    } else {\n      warn(\n        \"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\n        \"but got \" + (toRawType(inject)) + \".\",\n        vm\n      );\n    }\n  }\n\n  /**\n   * Normalize raw function directives into object format.\n   */\n  function normalizeDirectives (options) {\n    var dirs = options.directives;\n    if (dirs) {\n      for (var key in dirs) {\n        var def$$1 = dirs[key];\n        if (typeof def$$1 === 'function') {\n          dirs[key] = { bind: def$$1, update: def$$1 };\n        }\n      }\n    }\n  }\n\n  function assertObjectType (name, value, vm) {\n    if (!isPlainObject(value)) {\n      warn(\n        \"Invalid value for option \\\"\" + name + \"\\\": expected an Object, \" +\n        \"but got \" + (toRawType(value)) + \".\",\n        vm\n      );\n    }\n  }\n\n  /**\n   * Merge two option objects into a new one.\n   * Core utility used in both instantiation and inheritance.\n   */\n  function mergeOptions (\n    parent,\n    child,\n    vm\n  ) {\n    {\n      checkComponents(child);\n    }\n\n    if (typeof child === 'function') {\n      child = child.options;\n    }\n\n    normalizeProps(child, vm);\n    normalizeInject(child, vm);\n    normalizeDirectives(child);\n\n    // Apply extends and mixins on the child options,\n    // but only if it is a raw options object that isn't\n    // the result of another mergeOptions call.\n    // Only merged options has the _base property.\n    if (!child._base) {\n      if (child.extends) {\n        parent = mergeOptions(parent, child.extends, vm);\n      }\n      if (child.mixins) {\n        for (var i = 0, l = child.mixins.length; i < l; i++) {\n          parent = mergeOptions(parent, child.mixins[i], vm);\n        }\n      }\n    }\n\n    var options = {};\n    var key;\n    for (key in parent) {\n      mergeField(key);\n    }\n    for (key in child) {\n      if (!hasOwn(parent, key)) {\n        mergeField(key);\n      }\n    }\n    function mergeField (key) {\n      var strat = strats[key] || defaultStrat;\n      options[key] = strat(parent[key], child[key], vm, key);\n    }\n    return options\n  }\n\n  /**\n   * Resolve an asset.\n   * This function is used because child instances need access\n   * to assets defined in its ancestor chain.\n   */\n  function resolveAsset (\n    options,\n    type,\n    id,\n    warnMissing\n  ) {\n    /* istanbul ignore if */\n    if (typeof id !== 'string') {\n      return\n    }\n    var assets = options[type];\n    // check local registration variations first\n    if (hasOwn(assets, id)) { return assets[id] }\n    var camelizedId = camelize(id);\n    if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }\n    var PascalCaseId = capitalize(camelizedId);\n    if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }\n    // fallback to prototype chain\n    var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\n    if (warnMissing && !res) {\n      warn(\n        'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n        options\n      );\n    }\n    return res\n  }\n\n  /*  */\n\n\n\n  function validateProp (\n    key,\n    propOptions,\n    propsData,\n    vm\n  ) {\n    var prop = propOptions[key];\n    var absent = !hasOwn(propsData, key);\n    var value = propsData[key];\n    // boolean casting\n    var booleanIndex = getTypeIndex(Boolean, prop.type);\n    if (booleanIndex > -1) {\n      if (absent && !hasOwn(prop, 'default')) {\n        value = false;\n      } else if (value === '' || value === hyphenate(key)) {\n        // only cast empty string / same name to boolean if\n        // boolean has higher priority\n        var stringIndex = getTypeIndex(String, prop.type);\n        if (stringIndex < 0 || booleanIndex < stringIndex) {\n          value = true;\n        }\n      }\n    }\n    // check default value\n    if (value === undefined) {\n      value = getPropDefaultValue(vm, prop, key);\n      // since the default value is a fresh copy,\n      // make sure to observe it.\n      var prevShouldObserve = shouldObserve;\n      toggleObserving(true);\n      observe(value);\n      toggleObserving(prevShouldObserve);\n    }\n    {\n      assertProp(prop, key, value, vm, absent);\n    }\n    return value\n  }\n\n  /**\n   * Get the default value of a prop.\n   */\n  function getPropDefaultValue (vm, prop, key) {\n    // no default, return undefined\n    if (!hasOwn(prop, 'default')) {\n      return undefined\n    }\n    var def = prop.default;\n    // warn against non-factory defaults for Object & Array\n    if (isObject(def)) {\n      warn(\n        'Invalid default value for prop \"' + key + '\": ' +\n        'Props with type Object/Array must use a factory function ' +\n        'to return the default value.',\n        vm\n      );\n    }\n    // the raw prop value was also undefined from previous render,\n    // return previous default value to avoid unnecessary watcher trigger\n    if (vm && vm.$options.propsData &&\n      vm.$options.propsData[key] === undefined &&\n      vm._props[key] !== undefined\n    ) {\n      return vm._props[key]\n    }\n    // call factory function for non-Function types\n    // a value is Function if its prototype is function even across different execution context\n    return typeof def === 'function' && getType(prop.type) !== 'Function'\n      ? def.call(vm)\n      : def\n  }\n\n  /**\n   * Assert whether a prop is valid.\n   */\n  function assertProp (\n    prop,\n    name,\n    value,\n    vm,\n    absent\n  ) {\n    if (prop.required && absent) {\n      warn(\n        'Missing required prop: \"' + name + '\"',\n        vm\n      );\n      return\n    }\n    if (value == null && !prop.required) {\n      return\n    }\n    var type = prop.type;\n    var valid = !type || type === true;\n    var expectedTypes = [];\n    if (type) {\n      if (!Array.isArray(type)) {\n        type = [type];\n      }\n      for (var i = 0; i < type.length && !valid; i++) {\n        var assertedType = assertType(value, type[i]);\n        expectedTypes.push(assertedType.expectedType || '');\n        valid = assertedType.valid;\n      }\n    }\n\n    if (!valid) {\n      warn(\n        getInvalidTypeMessage(name, value, expectedTypes),\n        vm\n      );\n      return\n    }\n    var validator = prop.validator;\n    if (validator) {\n      if (!validator(value)) {\n        warn(\n          'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n          vm\n        );\n      }\n    }\n  }\n\n  var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;\n\n  function assertType (value, type) {\n    var valid;\n    var expectedType = getType(type);\n    if (simpleCheckRE.test(expectedType)) {\n      var t = typeof value;\n      valid = t === expectedType.toLowerCase();\n      // for primitive wrapper objects\n      if (!valid && t === 'object') {\n        valid = value instanceof type;\n      }\n    } else if (expectedType === 'Object') {\n      valid = isPlainObject(value);\n    } else if (expectedType === 'Array') {\n      valid = Array.isArray(value);\n    } else {\n      valid = value instanceof type;\n    }\n    return {\n      valid: valid,\n      expectedType: expectedType\n    }\n  }\n\n  /**\n   * Use function string name to check built-in types,\n   * because a simple equality check will fail when running\n   * across different vms / iframes.\n   */\n  function getType (fn) {\n    var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n    return match ? match[1] : ''\n  }\n\n  function isSameType (a, b) {\n    return getType(a) === getType(b)\n  }\n\n  function getTypeIndex (type, expectedTypes) {\n    if (!Array.isArray(expectedTypes)) {\n      return isSameType(expectedTypes, type) ? 0 : -1\n    }\n    for (var i = 0, len = expectedTypes.length; i < len; i++) {\n      if (isSameType(expectedTypes[i], type)) {\n        return i\n      }\n    }\n    return -1\n  }\n\n  function getInvalidTypeMessage (name, value, expectedTypes) {\n    var message = \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n      \" Expected \" + (expectedTypes.map(capitalize).join(', '));\n    var expectedType = expectedTypes[0];\n    var receivedType = toRawType(value);\n    var expectedValue = styleValue(value, expectedType);\n    var receivedValue = styleValue(value, receivedType);\n    // check if we need to specify expected value\n    if (expectedTypes.length === 1 &&\n        isExplicable(expectedType) &&\n        !isBoolean(expectedType, receivedType)) {\n      message += \" with value \" + expectedValue;\n    }\n    message += \", got \" + receivedType + \" \";\n    // check if we need to specify received value\n    if (isExplicable(receivedType)) {\n      message += \"with value \" + receivedValue + \".\";\n    }\n    return message\n  }\n\n  function styleValue (value, type) {\n    if (type === 'String') {\n      return (\"\\\"\" + value + \"\\\"\")\n    } else if (type === 'Number') {\n      return (\"\" + (Number(value)))\n    } else {\n      return (\"\" + value)\n    }\n  }\n\n  function isExplicable (value) {\n    var explicitTypes = ['string', 'number', 'boolean'];\n    return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })\n  }\n\n  function isBoolean () {\n    var args = [], len = arguments.length;\n    while ( len-- ) args[ len ] = arguments[ len ];\n\n    return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })\n  }\n\n  /*  */\n\n  function handleError (err, vm, info) {\n    // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.\n    // See: https://github.com/vuejs/vuex/issues/1505\n    pushTarget();\n    try {\n      if (vm) {\n        var cur = vm;\n        while ((cur = cur.$parent)) {\n          var hooks = cur.$options.errorCaptured;\n          if (hooks) {\n            for (var i = 0; i < hooks.length; i++) {\n              try {\n                var capture = hooks[i].call(cur, err, vm, info) === false;\n                if (capture) { return }\n              } catch (e) {\n                globalHandleError(e, cur, 'errorCaptured hook');\n              }\n            }\n          }\n        }\n      }\n      globalHandleError(err, vm, info);\n    } finally {\n      popTarget();\n    }\n  }\n\n  function invokeWithErrorHandling (\n    handler,\n    context,\n    args,\n    vm,\n    info\n  ) {\n    var res;\n    try {\n      res = args ? handler.apply(context, args) : handler.call(context);\n      if (res && !res._isVue && isPromise(res)) {\n        // issue #9511\n        // reassign to res to avoid catch triggering multiple times when nested calls\n        res = res.catch(function (e) { return handleError(e, vm, info + \" (Promise/async)\"); });\n      }\n    } catch (e) {\n      handleError(e, vm, info);\n    }\n    return res\n  }\n\n  function globalHandleError (err, vm, info) {\n    if (config.errorHandler) {\n      try {\n        return config.errorHandler.call(null, err, vm, info)\n      } catch (e) {\n        // if the user intentionally throws the original error in the handler,\n        // do not log it twice\n        if (e !== err) {\n          logError(e, null, 'config.errorHandler');\n        }\n      }\n    }\n    logError(err, vm, info);\n  }\n\n  function logError (err, vm, info) {\n    {\n      warn((\"Error in \" + info + \": \\\"\" + (err.toString()) + \"\\\"\"), vm);\n    }\n    /* istanbul ignore else */\n    if ((inBrowser || inWeex) && typeof console !== 'undefined') {\n      console.error(err);\n    } else {\n      throw err\n    }\n  }\n\n  /*  */\n\n  var isUsingMicroTask = false;\n\n  var callbacks = [];\n  var pending = false;\n\n  function flushCallbacks () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // Here we have async deferring wrappers using microtasks.\n  // In 2.5 we used (macro) tasks (in combination with microtasks).\n  // However, it has subtle problems when state is changed right before repaint\n  // (e.g. #6813, out-in transitions).\n  // Also, using (macro) tasks in event handler would cause some weird behaviors\n  // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).\n  // So we now use microtasks everywhere, again.\n  // A major drawback of this tradeoff is that there are some scenarios\n  // where microtasks have too high a priority and fire in between supposedly\n  // sequential events (e.g. #4521, #6690, which have workarounds)\n  // or even between bubbling of the same event (#6566).\n  var timerFunc;\n\n  // The nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore next, $flow-disable-line */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    timerFunc = function () {\n      p.then(flushCallbacks);\n      // In problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n    isUsingMicroTask = true;\n  } else if (!isIE && typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // Use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS, iOS7, Android 4.4\n    // (#6466 MutationObserver is unreliable in IE11)\n    var counter = 1;\n    var observer = new MutationObserver(flushCallbacks);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n    isUsingMicroTask = true;\n  } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\n    // Fallback to setImmediate.\n    // Techinically it leverages the (macro) task queue,\n    // but it is still a better choice than setTimeout.\n    timerFunc = function () {\n      setImmediate(flushCallbacks);\n    };\n  } else {\n    // Fallback to setTimeout.\n    timerFunc = function () {\n      setTimeout(flushCallbacks, 0);\n    };\n  }\n\n  function nextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) {\n        try {\n          cb.call(ctx);\n        } catch (e) {\n          handleError(e, ctx, 'nextTick');\n        }\n      } else if (_resolve) {\n        _resolve(ctx);\n      }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    // $flow-disable-line\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n\n  /*  */\n\n  var mark;\n  var measure;\n\n  {\n    var perf = inBrowser && window.performance;\n    /* istanbul ignore if */\n    if (\n      perf &&\n      perf.mark &&\n      perf.measure &&\n      perf.clearMarks &&\n      perf.clearMeasures\n    ) {\n      mark = function (tag) { return perf.mark(tag); };\n      measure = function (name, startTag, endTag) {\n        perf.measure(name, startTag, endTag);\n        perf.clearMarks(startTag);\n        perf.clearMarks(endTag);\n        // perf.clearMeasures(name)\n      };\n    }\n  }\n\n  /* not type checking this file because flow doesn't play well with Proxy */\n\n  var initProxy;\n\n  {\n    var allowedGlobals = makeMap(\n      'Infinity,undefined,NaN,isFinite,isNaN,' +\n      'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n      'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n      'require' // for Webpack/Browserify\n    );\n\n    var warnNonPresent = function (target, key) {\n      warn(\n        \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n        'referenced during render. Make sure that this property is reactive, ' +\n        'either in the data option, or for class-based components, by ' +\n        'initializing the property. ' +\n        'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',\n        target\n      );\n    };\n\n    var warnReservedPrefix = function (target, key) {\n      warn(\n        \"Property \\\"\" + key + \"\\\" must be accessed with \\\"$data.\" + key + \"\\\" because \" +\n        'properties starting with \"$\" or \"_\" are not proxied in the Vue instance to ' +\n        'prevent conflicts with Vue internals' +\n        'See: https://vuejs.org/v2/api/#data',\n        target\n      );\n    };\n\n    var hasProxy =\n      typeof Proxy !== 'undefined' && isNative(Proxy);\n\n    if (hasProxy) {\n      var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\n      config.keyCodes = new Proxy(config.keyCodes, {\n        set: function set (target, key, value) {\n          if (isBuiltInModifier(key)) {\n            warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n            return false\n          } else {\n            target[key] = value;\n            return true\n          }\n        }\n      });\n    }\n\n    var hasHandler = {\n      has: function has (target, key) {\n        var has = key in target;\n        var isAllowed = allowedGlobals(key) ||\n          (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));\n        if (!has && !isAllowed) {\n          if (key in target.$data) { warnReservedPrefix(target, key); }\n          else { warnNonPresent(target, key); }\n        }\n        return has || !isAllowed\n      }\n    };\n\n    var getHandler = {\n      get: function get (target, key) {\n        if (typeof key === 'string' && !(key in target)) {\n          if (key in target.$data) { warnReservedPrefix(target, key); }\n          else { warnNonPresent(target, key); }\n        }\n        return target[key]\n      }\n    };\n\n    initProxy = function initProxy (vm) {\n      if (hasProxy) {\n        // determine which proxy handler to use\n        var options = vm.$options;\n        var handlers = options.render && options.render._withStripped\n          ? getHandler\n          : hasHandler;\n        vm._renderProxy = new Proxy(vm, handlers);\n      } else {\n        vm._renderProxy = vm;\n      }\n    };\n  }\n\n  /*  */\n\n  var seenObjects = new _Set();\n\n  /**\n   * Recursively traverse an object to evoke all converted\n   * getters, so that every nested property inside the object\n   * is collected as a \"deep\" dependency.\n   */\n  function traverse (val) {\n    _traverse(val, seenObjects);\n    seenObjects.clear();\n  }\n\n  function _traverse (val, seen) {\n    var i, keys;\n    var isA = Array.isArray(val);\n    if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {\n      return\n    }\n    if (val.__ob__) {\n      var depId = val.__ob__.dep.id;\n      if (seen.has(depId)) {\n        return\n      }\n      seen.add(depId);\n    }\n    if (isA) {\n      i = val.length;\n      while (i--) { _traverse(val[i], seen); }\n    } else {\n      keys = Object.keys(val);\n      i = keys.length;\n      while (i--) { _traverse(val[keys[i]], seen); }\n    }\n  }\n\n  /*  */\n\n  var normalizeEvent = cached(function (name) {\n    var passive = name.charAt(0) === '&';\n    name = passive ? name.slice(1) : name;\n    var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first\n    name = once$$1 ? name.slice(1) : name;\n    var capture = name.charAt(0) === '!';\n    name = capture ? name.slice(1) : name;\n    return {\n      name: name,\n      once: once$$1,\n      capture: capture,\n      passive: passive\n    }\n  });\n\n  function createFnInvoker (fns, vm) {\n    function invoker () {\n      var arguments$1 = arguments;\n\n      var fns = invoker.fns;\n      if (Array.isArray(fns)) {\n        var cloned = fns.slice();\n        for (var i = 0; i < cloned.length; i++) {\n          invokeWithErrorHandling(cloned[i], null, arguments$1, vm, \"v-on handler\");\n        }\n      } else {\n        // return handler return value for single handlers\n        return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\")\n      }\n    }\n    invoker.fns = fns;\n    return invoker\n  }\n\n  function updateListeners (\n    on,\n    oldOn,\n    add,\n    remove$$1,\n    createOnceHandler,\n    vm\n  ) {\n    var name, def$$1, cur, old, event;\n    for (name in on) {\n      def$$1 = cur = on[name];\n      old = oldOn[name];\n      event = normalizeEvent(name);\n      if (isUndef(cur)) {\n        warn(\n          \"Invalid handler for event \\\"\" + (event.name) + \"\\\": got \" + String(cur),\n          vm\n        );\n      } else if (isUndef(old)) {\n        if (isUndef(cur.fns)) {\n          cur = on[name] = createFnInvoker(cur, vm);\n        }\n        if (isTrue(event.once)) {\n          cur = on[name] = createOnceHandler(event.name, cur, event.capture);\n        }\n        add(event.name, cur, event.capture, event.passive, event.params);\n      } else if (cur !== old) {\n        old.fns = cur;\n        on[name] = old;\n      }\n    }\n    for (name in oldOn) {\n      if (isUndef(on[name])) {\n        event = normalizeEvent(name);\n        remove$$1(event.name, oldOn[name], event.capture);\n      }\n    }\n  }\n\n  /*  */\n\n  function mergeVNodeHook (def, hookKey, hook) {\n    if (def instanceof VNode) {\n      def = def.data.hook || (def.data.hook = {});\n    }\n    var invoker;\n    var oldHook = def[hookKey];\n\n    function wrappedHook () {\n      hook.apply(this, arguments);\n      // important: remove merged hook to ensure it's called only once\n      // and prevent memory leak\n      remove(invoker.fns, wrappedHook);\n    }\n\n    if (isUndef(oldHook)) {\n      // no existing hook\n      invoker = createFnInvoker([wrappedHook]);\n    } else {\n      /* istanbul ignore if */\n      if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n        // already a merged invoker\n        invoker = oldHook;\n        invoker.fns.push(wrappedHook);\n      } else {\n        // existing plain hook\n        invoker = createFnInvoker([oldHook, wrappedHook]);\n      }\n    }\n\n    invoker.merged = true;\n    def[hookKey] = invoker;\n  }\n\n  /*  */\n\n  function extractPropsFromVNodeData (\n    data,\n    Ctor,\n    tag\n  ) {\n    // we are only extracting raw values here.\n    // validation and default values are handled in the child\n    // component itself.\n    var propOptions = Ctor.options.props;\n    if (isUndef(propOptions)) {\n      return\n    }\n    var res = {};\n    var attrs = data.attrs;\n    var props = data.props;\n    if (isDef(attrs) || isDef(props)) {\n      for (var key in propOptions) {\n        var altKey = hyphenate(key);\n        {\n          var keyInLowerCase = key.toLowerCase();\n          if (\n            key !== keyInLowerCase &&\n            attrs && hasOwn(attrs, keyInLowerCase)\n          ) {\n            tip(\n              \"Prop \\\"\" + keyInLowerCase + \"\\\" is passed to component \" +\n              (formatComponentName(tag || Ctor)) + \", but the declared prop name is\" +\n              \" \\\"\" + key + \"\\\". \" +\n              \"Note that HTML attributes are case-insensitive and camelCased \" +\n              \"props need to use their kebab-case equivalents when using in-DOM \" +\n              \"templates. You should probably use \\\"\" + altKey + \"\\\" instead of \\\"\" + key + \"\\\".\"\n            );\n          }\n        }\n        checkProp(res, props, key, altKey, true) ||\n        checkProp(res, attrs, key, altKey, false);\n      }\n    }\n    return res\n  }\n\n  function checkProp (\n    res,\n    hash,\n    key,\n    altKey,\n    preserve\n  ) {\n    if (isDef(hash)) {\n      if (hasOwn(hash, key)) {\n        res[key] = hash[key];\n        if (!preserve) {\n          delete hash[key];\n        }\n        return true\n      } else if (hasOwn(hash, altKey)) {\n        res[key] = hash[altKey];\n        if (!preserve) {\n          delete hash[altKey];\n        }\n        return true\n      }\n    }\n    return false\n  }\n\n  /*  */\n\n  // The template compiler attempts to minimize the need for normalization by\n  // statically analyzing the template at compile time.\n  //\n  // For plain HTML markup, normalization can be completely skipped because the\n  // generated render function is guaranteed to return Array<VNode>. There are\n  // two cases where extra normalization is needed:\n\n  // 1. When the children contains components - because a functional component\n  // may return an Array instead of a single root. In this case, just a simple\n  // normalization is needed - if any child is an Array, we flatten the whole\n  // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n  // because functional components already normalize their own children.\n  function simpleNormalizeChildren (children) {\n    for (var i = 0; i < children.length; i++) {\n      if (Array.isArray(children[i])) {\n        return Array.prototype.concat.apply([], children)\n      }\n    }\n    return children\n  }\n\n  // 2. When the children contains constructs that always generated nested Arrays,\n  // e.g. <template>, <slot>, v-for, or when the children is provided by user\n  // with hand-written render functions / JSX. In such cases a full normalization\n  // is needed to cater to all possible types of children values.\n  function normalizeChildren (children) {\n    return isPrimitive(children)\n      ? [createTextVNode(children)]\n      : Array.isArray(children)\n        ? normalizeArrayChildren(children)\n        : undefined\n  }\n\n  function isTextNode (node) {\n    return isDef(node) && isDef(node.text) && isFalse(node.isComment)\n  }\n\n  function normalizeArrayChildren (children, nestedIndex) {\n    var res = [];\n    var i, c, lastIndex, last;\n    for (i = 0; i < children.length; i++) {\n      c = children[i];\n      if (isUndef(c) || typeof c === 'boolean') { continue }\n      lastIndex = res.length - 1;\n      last = res[lastIndex];\n      //  nested\n      if (Array.isArray(c)) {\n        if (c.length > 0) {\n          c = normalizeArrayChildren(c, ((nestedIndex || '') + \"_\" + i));\n          // merge adjacent text nodes\n          if (isTextNode(c[0]) && isTextNode(last)) {\n            res[lastIndex] = createTextVNode(last.text + (c[0]).text);\n            c.shift();\n          }\n          res.push.apply(res, c);\n        }\n      } else if (isPrimitive(c)) {\n        if (isTextNode(last)) {\n          // merge adjacent text nodes\n          // this is necessary for SSR hydration because text nodes are\n          // essentially merged when rendered to HTML strings\n          res[lastIndex] = createTextVNode(last.text + c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else {\n        if (isTextNode(c) && isTextNode(last)) {\n          // merge adjacent text nodes\n          res[lastIndex] = createTextVNode(last.text + c.text);\n        } else {\n          // default key for nested array children (likely generated by v-for)\n          if (isTrue(children._isVList) &&\n            isDef(c.tag) &&\n            isUndef(c.key) &&\n            isDef(nestedIndex)) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  function initProvide (vm) {\n    var provide = vm.$options.provide;\n    if (provide) {\n      vm._provided = typeof provide === 'function'\n        ? provide.call(vm)\n        : provide;\n    }\n  }\n\n  function initInjections (vm) {\n    var result = resolveInject(vm.$options.inject, vm);\n    if (result) {\n      toggleObserving(false);\n      Object.keys(result).forEach(function (key) {\n        /* istanbul ignore else */\n        {\n          defineReactive$$1(vm, key, result[key], function () {\n            warn(\n              \"Avoid mutating an injected value directly since the changes will be \" +\n              \"overwritten whenever the provided component re-renders. \" +\n              \"injection being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          });\n        }\n      });\n      toggleObserving(true);\n    }\n  }\n\n  function resolveInject (inject, vm) {\n    if (inject) {\n      // inject is :any because flow is not smart enough to figure out cached\n      var result = Object.create(null);\n      var keys = hasSymbol\n        ? Reflect.ownKeys(inject)\n        : Object.keys(inject);\n\n      for (var i = 0; i < keys.length; i++) {\n        var key = keys[i];\n        // #6574 in case the inject object is observed...\n        if (key === '__ob__') { continue }\n        var provideKey = inject[key].from;\n        var source = vm;\n        while (source) {\n          if (source._provided && hasOwn(source._provided, provideKey)) {\n            result[key] = source._provided[provideKey];\n            break\n          }\n          source = source.$parent;\n        }\n        if (!source) {\n          if ('default' in inject[key]) {\n            var provideDefault = inject[key].default;\n            result[key] = typeof provideDefault === 'function'\n              ? provideDefault.call(vm)\n              : provideDefault;\n          } else {\n            warn((\"Injection \\\"\" + key + \"\\\" not found\"), vm);\n          }\n        }\n      }\n      return result\n    }\n  }\n\n  /*  */\n\n\n\n  /**\n   * Runtime helper for resolving raw children VNodes into a slot object.\n   */\n  function resolveSlots (\n    children,\n    context\n  ) {\n    if (!children || !children.length) {\n      return {}\n    }\n    var slots = {};\n    for (var i = 0, l = children.length; i < l; i++) {\n      var child = children[i];\n      var data = child.data;\n      // remove slot attribute if the node is resolved as a Vue slot node\n      if (data && data.attrs && data.attrs.slot) {\n        delete data.attrs.slot;\n      }\n      // named slots should only be respected if the vnode was rendered in the\n      // same context.\n      if ((child.context === context || child.fnContext === context) &&\n        data && data.slot != null\n      ) {\n        var name = data.slot;\n        var slot = (slots[name] || (slots[name] = []));\n        if (child.tag === 'template') {\n          slot.push.apply(slot, child.children || []);\n        } else {\n          slot.push(child);\n        }\n      } else {\n        (slots.default || (slots.default = [])).push(child);\n      }\n    }\n    // ignore slots that contains only whitespace\n    for (var name$1 in slots) {\n      if (slots[name$1].every(isWhitespace)) {\n        delete slots[name$1];\n      }\n    }\n    return slots\n  }\n\n  function isWhitespace (node) {\n    return (node.isComment && !node.asyncFactory) || node.text === ' '\n  }\n\n  /*  */\n\n  function normalizeScopedSlots (\n    slots,\n    normalSlots,\n    prevSlots\n  ) {\n    var res;\n    var isStable = slots ? !!slots.$stable : true;\n    var key = slots && slots.$key;\n    if (!slots) {\n      res = {};\n    } else if (slots._normalized) {\n      // fast path 1: child component re-render only, parent did not change\n      return slots._normalized\n    } else if (\n      isStable &&\n      prevSlots &&\n      prevSlots !== emptyObject &&\n      key === prevSlots.$key &&\n      Object.keys(normalSlots).length === 0\n    ) {\n      // fast path 2: stable scoped slots w/ no normal slots to proxy,\n      // only need to normalize once\n      return prevSlots\n    } else {\n      res = {};\n      for (var key$1 in slots) {\n        if (slots[key$1] && key$1[0] !== '$') {\n          res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);\n        }\n      }\n    }\n    // expose normal slots on scopedSlots\n    for (var key$2 in normalSlots) {\n      if (!(key$2 in res)) {\n        res[key$2] = proxyNormalSlot(normalSlots, key$2);\n      }\n    }\n    // avoriaz seems to mock a non-extensible $scopedSlots object\n    // and when that is passed down this would cause an error\n    if (slots && Object.isExtensible(slots)) {\n      (slots)._normalized = res;\n    }\n    def(res, '$stable', isStable);\n    def(res, '$key', key);\n    return res\n  }\n\n  function normalizeScopedSlot(normalSlots, key, fn) {\n    var normalized = function () {\n      var res = arguments.length ? fn.apply(null, arguments) : fn({});\n      res = res && typeof res === 'object' && !Array.isArray(res)\n        ? [res] // single vnode\n        : normalizeChildren(res);\n      return res && res.length === 0\n        ? undefined\n        : res\n    };\n    // this is a slot using the new v-slot syntax without scope. although it is\n    // compiled as a scoped slot, render fn users would expect it to be present\n    // on this.$slots because the usage is semantically a normal slot.\n    if (fn.proxy) {\n      Object.defineProperty(normalSlots, key, {\n        get: normalized,\n        enumerable: true,\n        configurable: true\n      });\n    }\n    return normalized\n  }\n\n  function proxyNormalSlot(slots, key) {\n    return function () { return slots[key]; }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering v-for lists.\n   */\n  function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val) || typeof val === 'string') {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      if (hasSymbol && val[Symbol.iterator]) {\n        ret = [];\n        var iterator = val[Symbol.iterator]();\n        var result = iterator.next();\n        while (!result.done) {\n          ret.push(render(result.value, ret.length));\n          result = iterator.next();\n        }\n      } else {\n        keys = Object.keys(val);\n        ret = new Array(keys.length);\n        for (i = 0, l = keys.length; i < l; i++) {\n          key = keys[i];\n          ret[i] = render(val[key], key, i);\n        }\n      }\n    }\n    if (!isDef(ret)) {\n      ret = [];\n    }\n    (ret)._isVList = true;\n    return ret\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering <slot>\n   */\n  function renderSlot (\n    name,\n    fallback,\n    props,\n    bindObject\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    var nodes;\n    if (scopedSlotFn) { // scoped slot\n      props = props || {};\n      if (bindObject) {\n        if (!isObject(bindObject)) {\n          warn(\n            'slot v-bind without argument expects an Object',\n            this\n          );\n        }\n        props = extend(extend({}, bindObject), props);\n      }\n      nodes = scopedSlotFn(props) || fallback;\n    } else {\n      nodes = this.$slots[name] || fallback;\n    }\n\n    var target = props && props.slot;\n    if (target) {\n      return this.$createElement('template', { slot: target }, nodes)\n    } else {\n      return nodes\n    }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for resolving filters\n   */\n  function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  }\n\n  /*  */\n\n  function isKeyNotMatch (expect, actual) {\n    if (Array.isArray(expect)) {\n      return expect.indexOf(actual) === -1\n    } else {\n      return expect !== actual\n    }\n  }\n\n  /**\n   * Runtime helper for checking keyCodes from config.\n   * exposed as Vue.prototype._k\n   * passing in eventKeyName as last argument separately for backwards compat\n   */\n  function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInKeyCode,\n    eventKeyName,\n    builtInKeyName\n  ) {\n    var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;\n    if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {\n      return isKeyNotMatch(builtInKeyName, eventKeyName)\n    } else if (mappedKeyCode) {\n      return isKeyNotMatch(mappedKeyCode, eventKeyCode)\n    } else if (eventKeyName) {\n      return hyphenate(eventKeyName) !== key\n    }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for merging v-bind=\"object\" into a VNode's data.\n   */\n  function bindObjectProps (\n    data,\n    tag,\n    value,\n    asProp,\n    isSync\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        var hash;\n        var loop = function ( key ) {\n          if (\n            key === 'class' ||\n            key === 'style' ||\n            isReservedAttribute(key)\n          ) {\n            hash = data;\n          } else {\n            var type = data.attrs && data.attrs.type;\n            hash = asProp || config.mustUseProp(tag, type, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n          }\n          var camelizedKey = camelize(key);\n          if (!(key in hash) && !(camelizedKey in hash)) {\n            hash[key] = value[key];\n\n            if (isSync) {\n              var on = data.on || (data.on = {});\n              on[(\"update:\" + camelizedKey)] = function ($event) {\n                value[key] = $event;\n              };\n            }\n          }\n        };\n\n        for (var key in value) loop( key );\n      }\n    }\n    return data\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering static trees.\n   */\n  function renderStatic (\n    index,\n    isInFor\n  ) {\n    var cached = this._staticTrees || (this._staticTrees = []);\n    var tree = cached[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree.\n    if (tree && !isInFor) {\n      return tree\n    }\n    // otherwise, render a fresh tree.\n    tree = cached[index] = this.$options.staticRenderFns[index].call(\n      this._renderProxy,\n      null,\n      this // for render fns generated for functional component templates\n    );\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  }\n\n  /**\n   * Runtime helper for v-once.\n   * Effectively it means marking the node as static with a unique key.\n   */\n  function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  }\n\n  function markStatic (\n    tree,\n    key,\n    isOnce\n  ) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  /*  */\n\n  function bindObjectListeners (data, value) {\n    if (value) {\n      if (!isPlainObject(value)) {\n        warn(\n          'v-on without argument expects an Object value',\n          this\n        );\n      } else {\n        var on = data.on = data.on ? extend({}, data.on) : {};\n        for (var key in value) {\n          var existing = on[key];\n          var ours = value[key];\n          on[key] = existing ? [].concat(existing, ours) : ours;\n        }\n      }\n    }\n    return data\n  }\n\n  /*  */\n\n  function resolveScopedSlots (\n    fns, // see flow/vnode\n    res,\n    // the following are added in 2.6\n    hasDynamicKeys,\n    contentHashKey\n  ) {\n    res = res || { $stable: !hasDynamicKeys };\n    for (var i = 0; i < fns.length; i++) {\n      var slot = fns[i];\n      if (Array.isArray(slot)) {\n        resolveScopedSlots(slot, res, hasDynamicKeys);\n      } else if (slot) {\n        // marker for reverse proxying v-slot without scope on this.$slots\n        if (slot.proxy) {\n          slot.fn.proxy = true;\n        }\n        res[slot.key] = slot.fn;\n      }\n    }\n    if (contentHashKey) {\n      (res).$key = contentHashKey;\n    }\n    return res\n  }\n\n  /*  */\n\n  function bindDynamicKeys (baseObj, values) {\n    for (var i = 0; i < values.length; i += 2) {\n      var key = values[i];\n      if (typeof key === 'string' && key) {\n        baseObj[values[i]] = values[i + 1];\n      } else if (key !== '' && key !== null) {\n        // null is a speical value for explicitly removing a binding\n        warn(\n          (\"Invalid value for dynamic directive argument (expected string or null): \" + key),\n          this\n        );\n      }\n    }\n    return baseObj\n  }\n\n  // helper to dynamically append modifier runtime markers to event names.\n  // ensure only append when value is already string, otherwise it will be cast\n  // to string and cause the type check to miss.\n  function prependModifier (value, symbol) {\n    return typeof value === 'string' ? symbol + value : value\n  }\n\n  /*  */\n\n  function installRenderHelpers (target) {\n    target._o = markOnce;\n    target._n = toNumber;\n    target._s = toString;\n    target._l = renderList;\n    target._t = renderSlot;\n    target._q = looseEqual;\n    target._i = looseIndexOf;\n    target._m = renderStatic;\n    target._f = resolveFilter;\n    target._k = checkKeyCodes;\n    target._b = bindObjectProps;\n    target._v = createTextVNode;\n    target._e = createEmptyVNode;\n    target._u = resolveScopedSlots;\n    target._g = bindObjectListeners;\n    target._d = bindDynamicKeys;\n    target._p = prependModifier;\n  }\n\n  /*  */\n\n  function FunctionalRenderContext (\n    data,\n    props,\n    children,\n    parent,\n    Ctor\n  ) {\n    var this$1 = this;\n\n    var options = Ctor.options;\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    var contextVm;\n    if (hasOwn(parent, '_uid')) {\n      contextVm = Object.create(parent);\n      // $flow-disable-line\n      contextVm._original = parent;\n    } else {\n      // the context vm passed in is a functional context as well.\n      // in this case we want to make sure we are able to get a hold to the\n      // real context instance.\n      contextVm = parent;\n      // $flow-disable-line\n      parent = parent._original;\n    }\n    var isCompiled = isTrue(options._compiled);\n    var needNormalization = !isCompiled;\n\n    this.data = data;\n    this.props = props;\n    this.children = children;\n    this.parent = parent;\n    this.listeners = data.on || emptyObject;\n    this.injections = resolveInject(options.inject, parent);\n    this.slots = function () {\n      if (!this$1.$slots) {\n        normalizeScopedSlots(\n          data.scopedSlots,\n          this$1.$slots = resolveSlots(children, parent)\n        );\n      }\n      return this$1.$slots\n    };\n\n    Object.defineProperty(this, 'scopedSlots', ({\n      enumerable: true,\n      get: function get () {\n        return normalizeScopedSlots(data.scopedSlots, this.slots())\n      }\n    }));\n\n    // support for compiled functional template\n    if (isCompiled) {\n      // exposing $options for renderStatic()\n      this.$options = options;\n      // pre-resolve slots for renderSlot()\n      this.$slots = this.slots();\n      this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);\n    }\n\n    if (options._scopeId) {\n      this._c = function (a, b, c, d) {\n        var vnode = createElement(contextVm, a, b, c, d, needNormalization);\n        if (vnode && !Array.isArray(vnode)) {\n          vnode.fnScopeId = options._scopeId;\n          vnode.fnContext = parent;\n        }\n        return vnode\n      };\n    } else {\n      this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };\n    }\n  }\n\n  installRenderHelpers(FunctionalRenderContext.prototype);\n\n  function createFunctionalComponent (\n    Ctor,\n    propsData,\n    data,\n    contextVm,\n    children\n  ) {\n    var options = Ctor.options;\n    var props = {};\n    var propOptions = options.props;\n    if (isDef(propOptions)) {\n      for (var key in propOptions) {\n        props[key] = validateProp(key, propOptions, propsData || emptyObject);\n      }\n    } else {\n      if (isDef(data.attrs)) { mergeProps(props, data.attrs); }\n      if (isDef(data.props)) { mergeProps(props, data.props); }\n    }\n\n    var renderContext = new FunctionalRenderContext(\n      data,\n      props,\n      children,\n      contextVm,\n      Ctor\n    );\n\n    var vnode = options.render.call(null, renderContext._c, renderContext);\n\n    if (vnode instanceof VNode) {\n      return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)\n    } else if (Array.isArray(vnode)) {\n      var vnodes = normalizeChildren(vnode) || [];\n      var res = new Array(vnodes.length);\n      for (var i = 0; i < vnodes.length; i++) {\n        res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);\n      }\n      return res\n    }\n  }\n\n  function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {\n    // #7817 clone node before setting fnContext, otherwise if the node is reused\n    // (e.g. it was from a cached normal slot) the fnContext causes named slots\n    // that should not be matched to match.\n    var clone = cloneVNode(vnode);\n    clone.fnContext = contextVm;\n    clone.fnOptions = options;\n    {\n      (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;\n    }\n    if (data.slot) {\n      (clone.data || (clone.data = {})).slot = data.slot;\n    }\n    return clone\n  }\n\n  function mergeProps (to, from) {\n    for (var key in from) {\n      to[camelize(key)] = from[key];\n    }\n  }\n\n  /*  */\n\n  /*  */\n\n  /*  */\n\n  /*  */\n\n  // inline hooks to be invoked on component VNodes during patch\n  var componentVNodeHooks = {\n    init: function init (vnode, hydrating) {\n      if (\n        vnode.componentInstance &&\n        !vnode.componentInstance._isDestroyed &&\n        vnode.data.keepAlive\n      ) {\n        // kept-alive components, treat as a patch\n        var mountedNode = vnode; // work around flow\n        componentVNodeHooks.prepatch(mountedNode, mountedNode);\n      } else {\n        var child = vnode.componentInstance = createComponentInstanceForVnode(\n          vnode,\n          activeInstance\n        );\n        child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n      }\n    },\n\n    prepatch: function prepatch (oldVnode, vnode) {\n      var options = vnode.componentOptions;\n      var child = vnode.componentInstance = oldVnode.componentInstance;\n      updateChildComponent(\n        child,\n        options.propsData, // updated props\n        options.listeners, // updated listeners\n        vnode, // new parent vnode\n        options.children // new children\n      );\n    },\n\n    insert: function insert (vnode) {\n      var context = vnode.context;\n      var componentInstance = vnode.componentInstance;\n      if (!componentInstance._isMounted) {\n        componentInstance._isMounted = true;\n        callHook(componentInstance, 'mounted');\n      }\n      if (vnode.data.keepAlive) {\n        if (context._isMounted) {\n          // vue-router#1212\n          // During updates, a kept-alive component's child components may\n          // change, so directly walking the tree here may call activated hooks\n          // on incorrect children. Instead we push them into a queue which will\n          // be processed after the whole patch process ended.\n          queueActivatedComponent(componentInstance);\n        } else {\n          activateChildComponent(componentInstance, true /* direct */);\n        }\n      }\n    },\n\n    destroy: function destroy (vnode) {\n      var componentInstance = vnode.componentInstance;\n      if (!componentInstance._isDestroyed) {\n        if (!vnode.data.keepAlive) {\n          componentInstance.$destroy();\n        } else {\n          deactivateChildComponent(componentInstance, true /* direct */);\n        }\n      }\n    }\n  };\n\n  var hooksToMerge = Object.keys(componentVNodeHooks);\n\n  function createComponent (\n    Ctor,\n    data,\n    context,\n    children,\n    tag\n  ) {\n    if (isUndef(Ctor)) {\n      return\n    }\n\n    var baseCtor = context.$options._base;\n\n    // plain options object: turn it into a constructor\n    if (isObject(Ctor)) {\n      Ctor = baseCtor.extend(Ctor);\n    }\n\n    // if at this stage it's not a constructor or an async component factory,\n    // reject.\n    if (typeof Ctor !== 'function') {\n      {\n        warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n      }\n      return\n    }\n\n    // async component\n    var asyncFactory;\n    if (isUndef(Ctor.cid)) {\n      asyncFactory = Ctor;\n      Ctor = resolveAsyncComponent(asyncFactory, baseCtor);\n      if (Ctor === undefined) {\n        // return a placeholder node for async component, which is rendered\n        // as a comment node but preserves all the raw information for the node.\n        // the information will be used for async server-rendering and hydration.\n        return createAsyncPlaceholder(\n          asyncFactory,\n          data,\n          context,\n          children,\n          tag\n        )\n      }\n    }\n\n    data = data || {};\n\n    // resolve constructor options in case global mixins are applied after\n    // component constructor creation\n    resolveConstructorOptions(Ctor);\n\n    // transform component v-model data into props & events\n    if (isDef(data.model)) {\n      transformModel(Ctor.options, data);\n    }\n\n    // extract props\n    var propsData = extractPropsFromVNodeData(data, Ctor, tag);\n\n    // functional component\n    if (isTrue(Ctor.options.functional)) {\n      return createFunctionalComponent(Ctor, propsData, data, context, children)\n    }\n\n    // extract listeners, since these needs to be treated as\n    // child component listeners instead of DOM listeners\n    var listeners = data.on;\n    // replace with listeners with .native modifier\n    // so it gets processed during parent component patch.\n    data.on = data.nativeOn;\n\n    if (isTrue(Ctor.options.abstract)) {\n      // abstract components do not keep anything\n      // other than props & listeners & slot\n\n      // work around flow\n      var slot = data.slot;\n      data = {};\n      if (slot) {\n        data.slot = slot;\n      }\n    }\n\n    // install component management hooks onto the placeholder node\n    installComponentHooks(data);\n\n    // return a placeholder vnode\n    var name = Ctor.options.name || tag;\n    var vnode = new VNode(\n      (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n      data, undefined, undefined, undefined, context,\n      { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },\n      asyncFactory\n    );\n\n    return vnode\n  }\n\n  function createComponentInstanceForVnode (\n    vnode, // we know it's MountedComponentVNode but flow doesn't\n    parent // activeInstance in lifecycle state\n  ) {\n    var options = {\n      _isComponent: true,\n      _parentVnode: vnode,\n      parent: parent\n    };\n    // check inline-template render functions\n    var inlineTemplate = vnode.data.inlineTemplate;\n    if (isDef(inlineTemplate)) {\n      options.render = inlineTemplate.render;\n      options.staticRenderFns = inlineTemplate.staticRenderFns;\n    }\n    return new vnode.componentOptions.Ctor(options)\n  }\n\n  function installComponentHooks (data) {\n    var hooks = data.hook || (data.hook = {});\n    for (var i = 0; i < hooksToMerge.length; i++) {\n      var key = hooksToMerge[i];\n      var existing = hooks[key];\n      var toMerge = componentVNodeHooks[key];\n      if (existing !== toMerge && !(existing && existing._merged)) {\n        hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;\n      }\n    }\n  }\n\n  function mergeHook$1 (f1, f2) {\n    var merged = function (a, b) {\n      // flow complains about extra args which is why we use any\n      f1(a, b);\n      f2(a, b);\n    };\n    merged._merged = true;\n    return merged\n  }\n\n  // transform component v-model info (value and callback) into\n  // prop and event handler respectively.\n  function transformModel (options, data) {\n    var prop = (options.model && options.model.prop) || 'value';\n    var event = (options.model && options.model.event) || 'input'\n    ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;\n    var on = data.on || (data.on = {});\n    var existing = on[event];\n    var callback = data.model.callback;\n    if (isDef(existing)) {\n      if (\n        Array.isArray(existing)\n          ? existing.indexOf(callback) === -1\n          : existing !== callback\n      ) {\n        on[event] = [callback].concat(existing);\n      }\n    } else {\n      on[event] = callback;\n    }\n  }\n\n  /*  */\n\n  var SIMPLE_NORMALIZE = 1;\n  var ALWAYS_NORMALIZE = 2;\n\n  // wrapper function for providing a more flexible interface\n  // without getting yelled at by flow\n  function createElement (\n    context,\n    tag,\n    data,\n    children,\n    normalizationType,\n    alwaysNormalize\n  ) {\n    if (Array.isArray(data) || isPrimitive(data)) {\n      normalizationType = children;\n      children = data;\n      data = undefined;\n    }\n    if (isTrue(alwaysNormalize)) {\n      normalizationType = ALWAYS_NORMALIZE;\n    }\n    return _createElement(context, tag, data, children, normalizationType)\n  }\n\n  function _createElement (\n    context,\n    tag,\n    data,\n    children,\n    normalizationType\n  ) {\n    if (isDef(data) && isDef((data).__ob__)) {\n      warn(\n        \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n        'Always create fresh vnode data objects in each render!',\n        context\n      );\n      return createEmptyVNode()\n    }\n    // object syntax in v-bind\n    if (isDef(data) && isDef(data.is)) {\n      tag = data.is;\n    }\n    if (!tag) {\n      // in case of component :is set to falsy value\n      return createEmptyVNode()\n    }\n    // warn against non-primitive key\n    if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)\n    ) {\n      {\n        warn(\n          'Avoid using non-primitive value as key, ' +\n          'use string/number value instead.',\n          context\n        );\n      }\n    }\n    // support single function children as default scoped slot\n    if (Array.isArray(children) &&\n      typeof children[0] === 'function'\n    ) {\n      data = data || {};\n      data.scopedSlots = { default: children[0] };\n      children.length = 0;\n    }\n    if (normalizationType === ALWAYS_NORMALIZE) {\n      children = normalizeChildren(children);\n    } else if (normalizationType === SIMPLE_NORMALIZE) {\n      children = simpleNormalizeChildren(children);\n    }\n    var vnode, ns;\n    if (typeof tag === 'string') {\n      var Ctor;\n      ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);\n      if (config.isReservedTag(tag)) {\n        // platform built-in elements\n        vnode = new VNode(\n          config.parsePlatformTagName(tag), data, children,\n          undefined, undefined, context\n        );\n      } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {\n        // component\n        vnode = createComponent(Ctor, data, context, children, tag);\n      } else {\n        // unknown or unlisted namespaced elements\n        // check at runtime because it may get assigned a namespace when its\n        // parent normalizes children\n        vnode = new VNode(\n          tag, data, children,\n          undefined, undefined, context\n        );\n      }\n    } else {\n      // direct component options / constructor\n      vnode = createComponent(tag, data, context, children);\n    }\n    if (Array.isArray(vnode)) {\n      return vnode\n    } else if (isDef(vnode)) {\n      if (isDef(ns)) { applyNS(vnode, ns); }\n      if (isDef(data)) { registerDeepBindings(data); }\n      return vnode\n    } else {\n      return createEmptyVNode()\n    }\n  }\n\n  function applyNS (vnode, ns, force) {\n    vnode.ns = ns;\n    if (vnode.tag === 'foreignObject') {\n      // use default namespace inside foreignObject\n      ns = undefined;\n      force = true;\n    }\n    if (isDef(vnode.children)) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        var child = vnode.children[i];\n        if (isDef(child.tag) && (\n          isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {\n          applyNS(child, ns, force);\n        }\n      }\n    }\n  }\n\n  // ref #5318\n  // necessary to ensure parent re-render when deep bindings like :style and\n  // :class are used on slot nodes\n  function registerDeepBindings (data) {\n    if (isObject(data.style)) {\n      traverse(data.style);\n    }\n    if (isObject(data.class)) {\n      traverse(data.class);\n    }\n  }\n\n  /*  */\n\n  function initRender (vm) {\n    vm._vnode = null; // the root of the child tree\n    vm._staticTrees = null; // v-once cached trees\n    var options = vm.$options;\n    var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree\n    var renderContext = parentVnode && parentVnode.context;\n    vm.$slots = resolveSlots(options._renderChildren, renderContext);\n    vm.$scopedSlots = emptyObject;\n    // bind the createElement fn to this instance\n    // so that we get proper render context inside it.\n    // args order: tag, data, children, normalizationType, alwaysNormalize\n    // internal version is used by render functions compiled from templates\n    vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };\n    // normalization is always applied for the public version, used in\n    // user-written render functions.\n    vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };\n\n    // $attrs & $listeners are exposed for easier HOC creation.\n    // they need to be reactive so that HOCs using them are always updated\n    var parentData = parentVnode && parentVnode.data;\n\n    /* istanbul ignore else */\n    {\n      defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {\n        !isUpdatingChildComponent && warn(\"$attrs is readonly.\", vm);\n      }, true);\n      defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {\n        !isUpdatingChildComponent && warn(\"$listeners is readonly.\", vm);\n      }, true);\n    }\n  }\n\n  var currentRenderingInstance = null;\n\n  function renderMixin (Vue) {\n    // install runtime convenience helpers\n    installRenderHelpers(Vue.prototype);\n\n    Vue.prototype.$nextTick = function (fn) {\n      return nextTick(fn, this)\n    };\n\n    Vue.prototype._render = function () {\n      var vm = this;\n      var ref = vm.$options;\n      var render = ref.render;\n      var _parentVnode = ref._parentVnode;\n\n      if (_parentVnode) {\n        vm.$scopedSlots = normalizeScopedSlots(\n          _parentVnode.data.scopedSlots,\n          vm.$slots,\n          vm.$scopedSlots\n        );\n      }\n\n      // set parent vnode. this allows render functions to have access\n      // to the data on the placeholder node.\n      vm.$vnode = _parentVnode;\n      // render self\n      var vnode;\n      try {\n        // There's no need to maintain a stack becaues all render fns are called\n        // separately from one another. Nested component's render fns are called\n        // when parent component is patched.\n        currentRenderingInstance = vm;\n        vnode = render.call(vm._renderProxy, vm.$createElement);\n      } catch (e) {\n        handleError(e, vm, \"render\");\n        // return error render result,\n        // or previous vnode to prevent render error causing blank component\n        /* istanbul ignore else */\n        if (vm.$options.renderError) {\n          try {\n            vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);\n          } catch (e) {\n            handleError(e, vm, \"renderError\");\n            vnode = vm._vnode;\n          }\n        } else {\n          vnode = vm._vnode;\n        }\n      } finally {\n        currentRenderingInstance = null;\n      }\n      // if the returned array contains only a single node, allow it\n      if (Array.isArray(vnode) && vnode.length === 1) {\n        vnode = vnode[0];\n      }\n      // return empty vnode in case the render function errored out\n      if (!(vnode instanceof VNode)) {\n        if (Array.isArray(vnode)) {\n          warn(\n            'Multiple root nodes returned from render function. Render function ' +\n            'should return a single root node.',\n            vm\n          );\n        }\n        vnode = createEmptyVNode();\n      }\n      // set parent\n      vnode.parent = _parentVnode;\n      return vnode\n    };\n  }\n\n  /*  */\n\n  function ensureCtor (comp, base) {\n    if (\n      comp.__esModule ||\n      (hasSymbol && comp[Symbol.toStringTag] === 'Module')\n    ) {\n      comp = comp.default;\n    }\n    return isObject(comp)\n      ? base.extend(comp)\n      : comp\n  }\n\n  function createAsyncPlaceholder (\n    factory,\n    data,\n    context,\n    children,\n    tag\n  ) {\n    var node = createEmptyVNode();\n    node.asyncFactory = factory;\n    node.asyncMeta = { data: data, context: context, children: children, tag: tag };\n    return node\n  }\n\n  function resolveAsyncComponent (\n    factory,\n    baseCtor\n  ) {\n    if (isTrue(factory.error) && isDef(factory.errorComp)) {\n      return factory.errorComp\n    }\n\n    if (isDef(factory.resolved)) {\n      return factory.resolved\n    }\n\n    if (isTrue(factory.loading) && isDef(factory.loadingComp)) {\n      return factory.loadingComp\n    }\n\n    var owner = currentRenderingInstance;\n    if (isDef(factory.owners)) {\n      // already pending\n      factory.owners.push(owner);\n    } else {\n      var owners = factory.owners = [owner];\n      var sync = true;\n\n      var forceRender = function (renderCompleted) {\n        for (var i = 0, l = owners.length; i < l; i++) {\n          (owners[i]).$forceUpdate();\n        }\n\n        if (renderCompleted) {\n          owners.length = 0;\n        }\n      };\n\n      var resolve = once(function (res) {\n        // cache resolved\n        factory.resolved = ensureCtor(res, baseCtor);\n        // invoke callbacks only if this is not a synchronous resolve\n        // (async resolves are shimmed as synchronous during SSR)\n        if (!sync) {\n          forceRender(true);\n        } else {\n          owners.length = 0;\n        }\n      });\n\n      var reject = once(function (reason) {\n        warn(\n          \"Failed to resolve async component: \" + (String(factory)) +\n          (reason ? (\"\\nReason: \" + reason) : '')\n        );\n        if (isDef(factory.errorComp)) {\n          factory.error = true;\n          forceRender(true);\n        }\n      });\n\n      var res = factory(resolve, reject);\n\n      if (isObject(res)) {\n        if (isPromise(res)) {\n          // () => Promise\n          if (isUndef(factory.resolved)) {\n            res.then(resolve, reject);\n          }\n        } else if (isPromise(res.component)) {\n          res.component.then(resolve, reject);\n\n          if (isDef(res.error)) {\n            factory.errorComp = ensureCtor(res.error, baseCtor);\n          }\n\n          if (isDef(res.loading)) {\n            factory.loadingComp = ensureCtor(res.loading, baseCtor);\n            if (res.delay === 0) {\n              factory.loading = true;\n            } else {\n              setTimeout(function () {\n                if (isUndef(factory.resolved) && isUndef(factory.error)) {\n                  factory.loading = true;\n                  forceRender(false);\n                }\n              }, res.delay || 200);\n            }\n          }\n\n          if (isDef(res.timeout)) {\n            setTimeout(function () {\n              if (isUndef(factory.resolved)) {\n                reject(\n                  \"timeout (\" + (res.timeout) + \"ms)\"\n                );\n              }\n            }, res.timeout);\n          }\n        }\n      }\n\n      sync = false;\n      // return in case resolved synchronously\n      return factory.loading\n        ? factory.loadingComp\n        : factory.resolved\n    }\n  }\n\n  /*  */\n\n  function isAsyncPlaceholder (node) {\n    return node.isComment && node.asyncFactory\n  }\n\n  /*  */\n\n  function getFirstComponentChild (children) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; i++) {\n        var c = children[i];\n        if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {\n          return c\n        }\n      }\n    }\n  }\n\n  /*  */\n\n  /*  */\n\n  function initEvents (vm) {\n    vm._events = Object.create(null);\n    vm._hasHookEvent = false;\n    // init parent attached events\n    var listeners = vm.$options._parentListeners;\n    if (listeners) {\n      updateComponentListeners(vm, listeners);\n    }\n  }\n\n  var target;\n\n  function add (event, fn) {\n    target.$on(event, fn);\n  }\n\n  function remove$1 (event, fn) {\n    target.$off(event, fn);\n  }\n\n  function createOnceHandler (event, fn) {\n    var _target = target;\n    return function onceHandler () {\n      var res = fn.apply(null, arguments);\n      if (res !== null) {\n        _target.$off(event, onceHandler);\n      }\n    }\n  }\n\n  function updateComponentListeners (\n    vm,\n    listeners,\n    oldListeners\n  ) {\n    target = vm;\n    updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);\n    target = undefined;\n  }\n\n  function eventsMixin (Vue) {\n    var hookRE = /^hook:/;\n    Vue.prototype.$on = function (event, fn) {\n      var vm = this;\n      if (Array.isArray(event)) {\n        for (var i = 0, l = event.length; i < l; i++) {\n          vm.$on(event[i], fn);\n        }\n      } else {\n        (vm._events[event] || (vm._events[event] = [])).push(fn);\n        // optimize hook:event cost by using a boolean flag marked at registration\n        // instead of a hash lookup\n        if (hookRE.test(event)) {\n          vm._hasHookEvent = true;\n        }\n      }\n      return vm\n    };\n\n    Vue.prototype.$once = function (event, fn) {\n      var vm = this;\n      function on () {\n        vm.$off(event, on);\n        fn.apply(vm, arguments);\n      }\n      on.fn = fn;\n      vm.$on(event, on);\n      return vm\n    };\n\n    Vue.prototype.$off = function (event, fn) {\n      var vm = this;\n      // all\n      if (!arguments.length) {\n        vm._events = Object.create(null);\n        return vm\n      }\n      // array of events\n      if (Array.isArray(event)) {\n        for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {\n          vm.$off(event[i$1], fn);\n        }\n        return vm\n      }\n      // specific event\n      var cbs = vm._events[event];\n      if (!cbs) {\n        return vm\n      }\n      if (!fn) {\n        vm._events[event] = null;\n        return vm\n      }\n      // specific handler\n      var cb;\n      var i = cbs.length;\n      while (i--) {\n        cb = cbs[i];\n        if (cb === fn || cb.fn === fn) {\n          cbs.splice(i, 1);\n          break\n        }\n      }\n      return vm\n    };\n\n    Vue.prototype.$emit = function (event) {\n      var vm = this;\n      {\n        var lowerCaseEvent = event.toLowerCase();\n        if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {\n          tip(\n            \"Event \\\"\" + lowerCaseEvent + \"\\\" is emitted in component \" +\n            (formatComponentName(vm)) + \" but the handler is registered for \\\"\" + event + \"\\\". \" +\n            \"Note that HTML attributes are case-insensitive and you cannot use \" +\n            \"v-on to listen to camelCase events when using in-DOM templates. \" +\n            \"You should probably use \\\"\" + (hyphenate(event)) + \"\\\" instead of \\\"\" + event + \"\\\".\"\n          );\n        }\n      }\n      var cbs = vm._events[event];\n      if (cbs) {\n        cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n        var args = toArray(arguments, 1);\n        var info = \"event handler for \\\"\" + event + \"\\\"\";\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          invokeWithErrorHandling(cbs[i], vm, args, vm, info);\n        }\n      }\n      return vm\n    };\n  }\n\n  /*  */\n\n  var activeInstance = null;\n  var isUpdatingChildComponent = false;\n\n  function setActiveInstance(vm) {\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    return function () {\n      activeInstance = prevActiveInstance;\n    }\n  }\n\n  function initLifecycle (vm) {\n    var options = vm.$options;\n\n    // locate first non-abstract parent\n    var parent = options.parent;\n    if (parent && !options.abstract) {\n      while (parent.$options.abstract && parent.$parent) {\n        parent = parent.$parent;\n      }\n      parent.$children.push(vm);\n    }\n\n    vm.$parent = parent;\n    vm.$root = parent ? parent.$root : vm;\n\n    vm.$children = [];\n    vm.$refs = {};\n\n    vm._watcher = null;\n    vm._inactive = null;\n    vm._directInactive = false;\n    vm._isMounted = false;\n    vm._isDestroyed = false;\n    vm._isBeingDestroyed = false;\n  }\n\n  function lifecycleMixin (Vue) {\n    Vue.prototype._update = function (vnode, hydrating) {\n      var vm = this;\n      var prevEl = vm.$el;\n      var prevVnode = vm._vnode;\n      var restoreActiveInstance = setActiveInstance(vm);\n      vm._vnode = vnode;\n      // Vue.prototype.__patch__ is injected in entry points\n      // based on the rendering backend used.\n      if (!prevVnode) {\n        // initial render\n        vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);\n      } else {\n        // updates\n        vm.$el = vm.__patch__(prevVnode, vnode);\n      }\n      restoreActiveInstance();\n      // update __vue__ reference\n      if (prevEl) {\n        prevEl.__vue__ = null;\n      }\n      if (vm.$el) {\n        vm.$el.__vue__ = vm;\n      }\n      // if parent is an HOC, update its $el as well\n      if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n        vm.$parent.$el = vm.$el;\n      }\n      // updated hook is called by the scheduler to ensure that children are\n      // updated in a parent's updated hook.\n    };\n\n    Vue.prototype.$forceUpdate = function () {\n      var vm = this;\n      if (vm._watcher) {\n        vm._watcher.update();\n      }\n    };\n\n    Vue.prototype.$destroy = function () {\n      var vm = this;\n      if (vm._isBeingDestroyed) {\n        return\n      }\n      callHook(vm, 'beforeDestroy');\n      vm._isBeingDestroyed = true;\n      // remove self from parent\n      var parent = vm.$parent;\n      if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n        remove(parent.$children, vm);\n      }\n      // teardown watchers\n      if (vm._watcher) {\n        vm._watcher.teardown();\n      }\n      var i = vm._watchers.length;\n      while (i--) {\n        vm._watchers[i].teardown();\n      }\n      // remove reference from data ob\n      // frozen object may not have observer.\n      if (vm._data.__ob__) {\n        vm._data.__ob__.vmCount--;\n      }\n      // call the last hook...\n      vm._isDestroyed = true;\n      // invoke destroy hooks on current rendered tree\n      vm.__patch__(vm._vnode, null);\n      // fire destroyed hook\n      callHook(vm, 'destroyed');\n      // turn off all instance listeners.\n      vm.$off();\n      // remove __vue__ reference\n      if (vm.$el) {\n        vm.$el.__vue__ = null;\n      }\n      // release circular reference (#6759)\n      if (vm.$vnode) {\n        vm.$vnode.parent = null;\n      }\n    };\n  }\n\n  function mountComponent (\n    vm,\n    el,\n    hydrating\n  ) {\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = createEmptyVNode;\n      {\n        /* istanbul ignore if */\n        if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\n          vm.$options.el || el) {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'compiler is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n\n    var updateComponent;\n    /* istanbul ignore if */\n    if (config.performance && mark) {\n      updateComponent = function () {\n        var name = vm._name;\n        var id = vm._uid;\n        var startTag = \"vue-perf-start:\" + id;\n        var endTag = \"vue-perf-end:\" + id;\n\n        mark(startTag);\n        var vnode = vm._render();\n        mark(endTag);\n        measure((\"vue \" + name + \" render\"), startTag, endTag);\n\n        mark(startTag);\n        vm._update(vnode, hydrating);\n        mark(endTag);\n        measure((\"vue \" + name + \" patch\"), startTag, endTag);\n      };\n    } else {\n      updateComponent = function () {\n        vm._update(vm._render(), hydrating);\n      };\n    }\n\n    // we set this to vm._watcher inside the watcher's constructor\n    // since the watcher's initial patch may call $forceUpdate (e.g. inside child\n    // component's mounted hook), which relies on vm._watcher being already defined\n    new Watcher(vm, updateComponent, noop, {\n      before: function before () {\n        if (vm._isMounted && !vm._isDestroyed) {\n          callHook(vm, 'beforeUpdate');\n        }\n      }\n    }, true /* isRenderWatcher */);\n    hydrating = false;\n\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  }\n\n  function updateChildComponent (\n    vm,\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    {\n      isUpdatingChildComponent = true;\n    }\n\n    // determine whether component has slot children\n    // we need to do this before overwriting $options._renderChildren.\n\n    // check if there are dynamic scopedSlots (hand-written or compiled but with\n    // dynamic slot names). Static scoped slots compiled from template has the\n    // \"$stable\" marker.\n    var newScopedSlots = parentVnode.data.scopedSlots;\n    var oldScopedSlots = vm.$scopedSlots;\n    var hasDynamicScopedSlot = !!(\n      (newScopedSlots && !newScopedSlots.$stable) ||\n      (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||\n      (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)\n    );\n\n    // Any static slot children from the parent may have changed during parent's\n    // update. Dynamic scoped slots may also have changed. In such cases, a forced\n    // update is necessary to ensure correctness.\n    var needsForceUpdate = !!(\n      renderChildren ||               // has new static slots\n      vm.$options._renderChildren ||  // has old static slots\n      hasDynamicScopedSlot\n    );\n\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n\n    // update $attrs and $listeners hash\n    // these are also reactive so they may trigger child update if the child\n    // used them during render\n    vm.$attrs = parentVnode.data.attrs || emptyObject;\n    vm.$listeners = listeners || emptyObject;\n\n    // update props\n    if (propsData && vm.$options.props) {\n      toggleObserving(false);\n      var props = vm._props;\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        var propOptions = vm.$options.props; // wtf flow?\n        props[key] = validateProp(key, propOptions, propsData, vm);\n      }\n      toggleObserving(true);\n      // keep a copy of raw propsData\n      vm.$options.propsData = propsData;\n    }\n\n    // update listeners\n    listeners = listeners || emptyObject;\n    var oldListeners = vm.$options._parentListeners;\n    vm.$options._parentListeners = listeners;\n    updateComponentListeners(vm, listeners, oldListeners);\n\n    // resolve slots + force update if has children\n    if (needsForceUpdate) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n\n    {\n      isUpdatingChildComponent = false;\n    }\n  }\n\n  function isInInactiveTree (vm) {\n    while (vm && (vm = vm.$parent)) {\n      if (vm._inactive) { return true }\n    }\n    return false\n  }\n\n  function activateChildComponent (vm, direct) {\n    if (direct) {\n      vm._directInactive = false;\n      if (isInInactiveTree(vm)) {\n        return\n      }\n    } else if (vm._directInactive) {\n      return\n    }\n    if (vm._inactive || vm._inactive === null) {\n      vm._inactive = false;\n      for (var i = 0; i < vm.$children.length; i++) {\n        activateChildComponent(vm.$children[i]);\n      }\n      callHook(vm, 'activated');\n    }\n  }\n\n  function deactivateChildComponent (vm, direct) {\n    if (direct) {\n      vm._directInactive = true;\n      if (isInInactiveTree(vm)) {\n        return\n      }\n    }\n    if (!vm._inactive) {\n      vm._inactive = true;\n      for (var i = 0; i < vm.$children.length; i++) {\n        deactivateChildComponent(vm.$children[i]);\n      }\n      callHook(vm, 'deactivated');\n    }\n  }\n\n  function callHook (vm, hook) {\n    // #7573 disable dep collection when invoking lifecycle hooks\n    pushTarget();\n    var handlers = vm.$options[hook];\n    var info = hook + \" hook\";\n    if (handlers) {\n      for (var i = 0, j = handlers.length; i < j; i++) {\n        invokeWithErrorHandling(handlers[i], vm, null, vm, info);\n      }\n    }\n    if (vm._hasHookEvent) {\n      vm.$emit('hook:' + hook);\n    }\n    popTarget();\n  }\n\n  /*  */\n\n  var MAX_UPDATE_COUNT = 100;\n\n  var queue = [];\n  var activatedChildren = [];\n  var has = {};\n  var circular = {};\n  var waiting = false;\n  var flushing = false;\n  var index = 0;\n\n  /**\n   * Reset the scheduler's state.\n   */\n  function resetSchedulerState () {\n    index = queue.length = activatedChildren.length = 0;\n    has = {};\n    {\n      circular = {};\n    }\n    waiting = flushing = false;\n  }\n\n  // Async edge case #6566 requires saving the timestamp when event listeners are\n  // attached. However, calling performance.now() has a perf overhead especially\n  // if the page has thousands of event listeners. Instead, we take a timestamp\n  // every time the scheduler flushes and use that for all event listeners\n  // attached during that flush.\n  var currentFlushTimestamp = 0;\n\n  // Async edge case fix requires storing an event listener's attach timestamp.\n  var getNow = Date.now;\n\n  // Determine what event timestamp the browser is using. Annoyingly, the\n  // timestamp can either be hi-res (relative to page load) or low-res\n  // (relative to UNIX epoch), so in order to compare time we have to use the\n  // same timestamp type when saving the flush timestamp.\n  if (inBrowser && getNow() > document.createEvent('Event').timeStamp) {\n    // if the low-res timestamp which is bigger than the event timestamp\n    // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\n    // and we need to use the hi-res version for event listeners as well.\n    getNow = function () { return performance.now(); };\n  }\n\n  /**\n   * Flush both queues and run the watchers.\n   */\n  function flushSchedulerQueue () {\n    currentFlushTimestamp = getNow();\n    flushing = true;\n    var watcher, id;\n\n    // Sort queue before flush.\n    // This ensures that:\n    // 1. Components are updated from parent to child. (because parent is always\n    //    created before the child)\n    // 2. A component's user watchers are run before its render watcher (because\n    //    user watchers are created before the render watcher)\n    // 3. If a component is destroyed during a parent component's watcher run,\n    //    its watchers can be skipped.\n    queue.sort(function (a, b) { return a.id - b.id; });\n\n    // do not cache length because more watchers might be pushed\n    // as we run existing watchers\n    for (index = 0; index < queue.length; index++) {\n      watcher = queue[index];\n      if (watcher.before) {\n        watcher.before();\n      }\n      id = watcher.id;\n      has[id] = null;\n      watcher.run();\n      // in dev build, check and stop circular updates.\n      if (has[id] != null) {\n        circular[id] = (circular[id] || 0) + 1;\n        if (circular[id] > MAX_UPDATE_COUNT) {\n          warn(\n            'You may have an infinite update loop ' + (\n              watcher.user\n                ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n                : \"in a component render function.\"\n            ),\n            watcher.vm\n          );\n          break\n        }\n      }\n    }\n\n    // keep copies of post queues before resetting state\n    var activatedQueue = activatedChildren.slice();\n    var updatedQueue = queue.slice();\n\n    resetSchedulerState();\n\n    // call component updated and activated hooks\n    callActivatedHooks(activatedQueue);\n    callUpdatedHooks(updatedQueue);\n\n    // devtool hook\n    /* istanbul ignore if */\n    if (devtools && config.devtools) {\n      devtools.emit('flush');\n    }\n  }\n\n  function callUpdatedHooks (queue) {\n    var i = queue.length;\n    while (i--) {\n      var watcher = queue[i];\n      var vm = watcher.vm;\n      if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {\n        callHook(vm, 'updated');\n      }\n    }\n  }\n\n  /**\n   * Queue a kept-alive component that was activated during patch.\n   * The queue will be processed after the entire tree has been patched.\n   */\n  function queueActivatedComponent (vm) {\n    // setting _inactive to false here so that a render function can\n    // rely on checking whether it's in an inactive tree (e.g. router-view)\n    vm._inactive = false;\n    activatedChildren.push(vm);\n  }\n\n  function callActivatedHooks (queue) {\n    for (var i = 0; i < queue.length; i++) {\n      queue[i]._inactive = true;\n      activateChildComponent(queue[i], true /* true */);\n    }\n  }\n\n  /**\n   * Push a watcher into the watcher queue.\n   * Jobs with duplicate IDs will be skipped unless it's\n   * pushed when the queue is being flushed.\n   */\n  function queueWatcher (watcher) {\n    var id = watcher.id;\n    if (has[id] == null) {\n      has[id] = true;\n      if (!flushing) {\n        queue.push(watcher);\n      } else {\n        // if already flushing, splice the watcher based on its id\n        // if already past its id, it will be run next immediately.\n        var i = queue.length - 1;\n        while (i > index && queue[i].id > watcher.id) {\n          i--;\n        }\n        queue.splice(i + 1, 0, watcher);\n      }\n      // queue the flush\n      if (!waiting) {\n        waiting = true;\n\n        if (!config.async) {\n          flushSchedulerQueue();\n          return\n        }\n        nextTick(flushSchedulerQueue);\n      }\n    }\n  }\n\n  /*  */\n\n\n\n  var uid$2 = 0;\n\n  /**\n   * A watcher parses an expression, collects dependencies,\n   * and fires callback when the expression value changes.\n   * This is used for both the $watch() api and directives.\n   */\n  var Watcher = function Watcher (\n    vm,\n    expOrFn,\n    cb,\n    options,\n    isRenderWatcher\n  ) {\n    this.vm = vm;\n    if (isRenderWatcher) {\n      vm._watcher = this;\n    }\n    vm._watchers.push(this);\n    // options\n    if (options) {\n      this.deep = !!options.deep;\n      this.user = !!options.user;\n      this.lazy = !!options.lazy;\n      this.sync = !!options.sync;\n      this.before = options.before;\n    } else {\n      this.deep = this.user = this.lazy = this.sync = false;\n    }\n    this.cb = cb;\n    this.id = ++uid$2; // uid for batching\n    this.active = true;\n    this.dirty = this.lazy; // for lazy watchers\n    this.deps = [];\n    this.newDeps = [];\n    this.depIds = new _Set();\n    this.newDepIds = new _Set();\n    this.expression = expOrFn.toString();\n    // parse expression for getter\n    if (typeof expOrFn === 'function') {\n      this.getter = expOrFn;\n    } else {\n      this.getter = parsePath(expOrFn);\n      if (!this.getter) {\n        this.getter = noop;\n        warn(\n          \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n          'Watcher only accepts simple dot-delimited paths. ' +\n          'For full control, use a function instead.',\n          vm\n        );\n      }\n    }\n    this.value = this.lazy\n      ? undefined\n      : this.get();\n  };\n\n  /**\n   * Evaluate the getter, and re-collect dependencies.\n   */\n  Watcher.prototype.get = function get () {\n    pushTarget(this);\n    var value;\n    var vm = this.vm;\n    try {\n      value = this.getter.call(vm, vm);\n    } catch (e) {\n      if (this.user) {\n        handleError(e, vm, (\"getter for watcher \\\"\" + (this.expression) + \"\\\"\"));\n      } else {\n        throw e\n      }\n    } finally {\n      // \"touch\" every property so they are all tracked as\n      // dependencies for deep watching\n      if (this.deep) {\n        traverse(value);\n      }\n      popTarget();\n      this.cleanupDeps();\n    }\n    return value\n  };\n\n  /**\n   * Add a dependency to this directive.\n   */\n  Watcher.prototype.addDep = function addDep (dep) {\n    var id = dep.id;\n    if (!this.newDepIds.has(id)) {\n      this.newDepIds.add(id);\n      this.newDeps.push(dep);\n      if (!this.depIds.has(id)) {\n        dep.addSub(this);\n      }\n    }\n  };\n\n  /**\n   * Clean up for dependency collection.\n   */\n  Watcher.prototype.cleanupDeps = function cleanupDeps () {\n    var i = this.deps.length;\n    while (i--) {\n      var dep = this.deps[i];\n      if (!this.newDepIds.has(dep.id)) {\n        dep.removeSub(this);\n      }\n    }\n    var tmp = this.depIds;\n    this.depIds = this.newDepIds;\n    this.newDepIds = tmp;\n    this.newDepIds.clear();\n    tmp = this.deps;\n    this.deps = this.newDeps;\n    this.newDeps = tmp;\n    this.newDeps.length = 0;\n  };\n\n  /**\n   * Subscriber interface.\n   * Will be called when a dependency changes.\n   */\n  Watcher.prototype.update = function update () {\n    /* istanbul ignore else */\n    if (this.lazy) {\n      this.dirty = true;\n    } else if (this.sync) {\n      this.run();\n    } else {\n      queueWatcher(this);\n    }\n  };\n\n  /**\n   * Scheduler job interface.\n   * Will be called by the scheduler.\n   */\n  Watcher.prototype.run = function run () {\n    if (this.active) {\n      var value = this.get();\n      if (\n        value !== this.value ||\n        // Deep watchers and watchers on Object/Arrays should fire even\n        // when the value is the same, because the value may\n        // have mutated.\n        isObject(value) ||\n        this.deep\n      ) {\n        // set new value\n        var oldValue = this.value;\n        this.value = value;\n        if (this.user) {\n          try {\n            this.cb.call(this.vm, value, oldValue);\n          } catch (e) {\n            handleError(e, this.vm, (\"callback for watcher \\\"\" + (this.expression) + \"\\\"\"));\n          }\n        } else {\n          this.cb.call(this.vm, value, oldValue);\n        }\n      }\n    }\n  };\n\n  /**\n   * Evaluate the value of the watcher.\n   * This only gets called for lazy watchers.\n   */\n  Watcher.prototype.evaluate = function evaluate () {\n    this.value = this.get();\n    this.dirty = false;\n  };\n\n  /**\n   * Depend on all deps collected by this watcher.\n   */\n  Watcher.prototype.depend = function depend () {\n    var i = this.deps.length;\n    while (i--) {\n      this.deps[i].depend();\n    }\n  };\n\n  /**\n   * Remove self from all dependencies' subscriber list.\n   */\n  Watcher.prototype.teardown = function teardown () {\n    if (this.active) {\n      // remove self from vm's watcher list\n      // this is a somewhat expensive operation so we skip it\n      // if the vm is being destroyed.\n      if (!this.vm._isBeingDestroyed) {\n        remove(this.vm._watchers, this);\n      }\n      var i = this.deps.length;\n      while (i--) {\n        this.deps[i].removeSub(this);\n      }\n      this.active = false;\n    }\n  };\n\n  /*  */\n\n  var sharedPropertyDefinition = {\n    enumerable: true,\n    configurable: true,\n    get: noop,\n    set: noop\n  };\n\n  function proxy (target, sourceKey, key) {\n    sharedPropertyDefinition.get = function proxyGetter () {\n      return this[sourceKey][key]\n    };\n    sharedPropertyDefinition.set = function proxySetter (val) {\n      this[sourceKey][key] = val;\n    };\n    Object.defineProperty(target, key, sharedPropertyDefinition);\n  }\n\n  function initState (vm) {\n    vm._watchers = [];\n    var opts = vm.$options;\n    if (opts.props) { initProps(vm, opts.props); }\n    if (opts.methods) { initMethods(vm, opts.methods); }\n    if (opts.data) {\n      initData(vm);\n    } else {\n      observe(vm._data = {}, true /* asRootData */);\n    }\n    if (opts.computed) { initComputed(vm, opts.computed); }\n    if (opts.watch && opts.watch !== nativeWatch) {\n      initWatch(vm, opts.watch);\n    }\n  }\n\n  function initProps (vm, propsOptions) {\n    var propsData = vm.$options.propsData || {};\n    var props = vm._props = {};\n    // cache prop keys so that future props updates can iterate using Array\n    // instead of dynamic object key enumeration.\n    var keys = vm.$options._propKeys = [];\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    if (!isRoot) {\n      toggleObserving(false);\n    }\n    var loop = function ( key ) {\n      keys.push(key);\n      var value = validateProp(key, propsOptions, propsData, vm);\n      /* istanbul ignore else */\n      {\n        var hyphenatedKey = hyphenate(key);\n        if (isReservedAttribute(hyphenatedKey) ||\n            config.isReservedAttr(hyphenatedKey)) {\n          warn(\n            (\"\\\"\" + hyphenatedKey + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(props, key, value, function () {\n          if (!isRoot && !isUpdatingChildComponent) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n      // static props are already proxied on the component's prototype\n      // during Vue.extend(). We only need to proxy props defined at\n      // instantiation here.\n      if (!(key in vm)) {\n        proxy(vm, \"_props\", key);\n      }\n    };\n\n    for (var key in propsOptions) loop( key );\n    toggleObserving(true);\n  }\n\n  function initData (vm) {\n    var data = vm.$options.data;\n    data = vm._data = typeof data === 'function'\n      ? getData(data, vm)\n      : data || {};\n    if (!isPlainObject(data)) {\n      data = {};\n      warn(\n        'data functions should return an object:\\n' +\n        'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',\n        vm\n      );\n    }\n    // proxy data on instance\n    var keys = Object.keys(data);\n    var props = vm.$options.props;\n    var methods = vm.$options.methods;\n    var i = keys.length;\n    while (i--) {\n      var key = keys[i];\n      {\n        if (methods && hasOwn(methods, key)) {\n          warn(\n            (\"Method \\\"\" + key + \"\\\" has already been defined as a data property.\"),\n            vm\n          );\n        }\n      }\n      if (props && hasOwn(props, key)) {\n        warn(\n          \"The data property \\\"\" + key + \"\\\" is already declared as a prop. \" +\n          \"Use prop default value instead.\",\n          vm\n        );\n      } else if (!isReserved(key)) {\n        proxy(vm, \"_data\", key);\n      }\n    }\n    // observe data\n    observe(data, true /* asRootData */);\n  }\n\n  function getData (data, vm) {\n    // #7573 disable dep collection when invoking data getters\n    pushTarget();\n    try {\n      return data.call(vm, vm)\n    } catch (e) {\n      handleError(e, vm, \"data()\");\n      return {}\n    } finally {\n      popTarget();\n    }\n  }\n\n  var computedWatcherOptions = { lazy: true };\n\n  function initComputed (vm, computed) {\n    // $flow-disable-line\n    var watchers = vm._computedWatchers = Object.create(null);\n    // computed properties are just getters during SSR\n    var isSSR = isServerRendering();\n\n    for (var key in computed) {\n      var userDef = computed[key];\n      var getter = typeof userDef === 'function' ? userDef : userDef.get;\n      if (getter == null) {\n        warn(\n          (\"Getter is missing for computed property \\\"\" + key + \"\\\".\"),\n          vm\n        );\n      }\n\n      if (!isSSR) {\n        // create internal watcher for the computed property.\n        watchers[key] = new Watcher(\n          vm,\n          getter || noop,\n          noop,\n          computedWatcherOptions\n        );\n      }\n\n      // component-defined computed properties are already defined on the\n      // component prototype. We only need to define computed properties defined\n      // at instantiation here.\n      if (!(key in vm)) {\n        defineComputed(vm, key, userDef);\n      } else {\n        if (key in vm.$data) {\n          warn((\"The computed property \\\"\" + key + \"\\\" is already defined in data.\"), vm);\n        } else if (vm.$options.props && key in vm.$options.props) {\n          warn((\"The computed property \\\"\" + key + \"\\\" is already defined as a prop.\"), vm);\n        }\n      }\n    }\n  }\n\n  function defineComputed (\n    target,\n    key,\n    userDef\n  ) {\n    var shouldCache = !isServerRendering();\n    if (typeof userDef === 'function') {\n      sharedPropertyDefinition.get = shouldCache\n        ? createComputedGetter(key)\n        : createGetterInvoker(userDef);\n      sharedPropertyDefinition.set = noop;\n    } else {\n      sharedPropertyDefinition.get = userDef.get\n        ? shouldCache && userDef.cache !== false\n          ? createComputedGetter(key)\n          : createGetterInvoker(userDef.get)\n        : noop;\n      sharedPropertyDefinition.set = userDef.set || noop;\n    }\n    if (sharedPropertyDefinition.set === noop) {\n      sharedPropertyDefinition.set = function () {\n        warn(\n          (\"Computed property \\\"\" + key + \"\\\" was assigned to but it has no setter.\"),\n          this\n        );\n      };\n    }\n    Object.defineProperty(target, key, sharedPropertyDefinition);\n  }\n\n  function createComputedGetter (key) {\n    return function computedGetter () {\n      var watcher = this._computedWatchers && this._computedWatchers[key];\n      if (watcher) {\n        if (watcher.dirty) {\n          watcher.evaluate();\n        }\n        if (Dep.target) {\n          watcher.depend();\n        }\n        return watcher.value\n      }\n    }\n  }\n\n  function createGetterInvoker(fn) {\n    return function computedGetter () {\n      return fn.call(this, this)\n    }\n  }\n\n  function initMethods (vm, methods) {\n    var props = vm.$options.props;\n    for (var key in methods) {\n      {\n        if (typeof methods[key] !== 'function') {\n          warn(\n            \"Method \\\"\" + key + \"\\\" has type \\\"\" + (typeof methods[key]) + \"\\\" in the component definition. \" +\n            \"Did you reference the function correctly?\",\n            vm\n          );\n        }\n        if (props && hasOwn(props, key)) {\n          warn(\n            (\"Method \\\"\" + key + \"\\\" has already been defined as a prop.\"),\n            vm\n          );\n        }\n        if ((key in vm) && isReserved(key)) {\n          warn(\n            \"Method \\\"\" + key + \"\\\" conflicts with an existing Vue instance method. \" +\n            \"Avoid defining component methods that start with _ or $.\"\n          );\n        }\n      }\n      vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);\n    }\n  }\n\n  function initWatch (vm, watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n\n  function createWatcher (\n    vm,\n    expOrFn,\n    handler,\n    options\n  ) {\n    if (isPlainObject(handler)) {\n      options = handler;\n      handler = handler.handler;\n    }\n    if (typeof handler === 'string') {\n      handler = vm[handler];\n    }\n    return vm.$watch(expOrFn, handler, options)\n  }\n\n  function stateMixin (Vue) {\n    // flow somehow has problems with directly declared definition object\n    // when using Object.defineProperty, so we have to procedurally build up\n    // the object here.\n    var dataDef = {};\n    dataDef.get = function () { return this._data };\n    var propsDef = {};\n    propsDef.get = function () { return this._props };\n    {\n      dataDef.set = function () {\n        warn(\n          'Avoid replacing instance root $data. ' +\n          'Use nested data properties instead.',\n          this\n        );\n      };\n      propsDef.set = function () {\n        warn(\"$props is readonly.\", this);\n      };\n    }\n    Object.defineProperty(Vue.prototype, '$data', dataDef);\n    Object.defineProperty(Vue.prototype, '$props', propsDef);\n\n    Vue.prototype.$set = set;\n    Vue.prototype.$delete = del;\n\n    Vue.prototype.$watch = function (\n      expOrFn,\n      cb,\n      options\n    ) {\n      var vm = this;\n      if (isPlainObject(cb)) {\n        return createWatcher(vm, expOrFn, cb, options)\n      }\n      options = options || {};\n      options.user = true;\n      var watcher = new Watcher(vm, expOrFn, cb, options);\n      if (options.immediate) {\n        try {\n          cb.call(vm, watcher.value);\n        } catch (error) {\n          handleError(error, vm, (\"callback for immediate watcher \\\"\" + (watcher.expression) + \"\\\"\"));\n        }\n      }\n      return function unwatchFn () {\n        watcher.teardown();\n      }\n    };\n  }\n\n  /*  */\n\n  var uid$3 = 0;\n\n  function initMixin (Vue) {\n    Vue.prototype._init = function (options) {\n      var vm = this;\n      // a uid\n      vm._uid = uid$3++;\n\n      var startTag, endTag;\n      /* istanbul ignore if */\n      if (config.performance && mark) {\n        startTag = \"vue-perf-start:\" + (vm._uid);\n        endTag = \"vue-perf-end:\" + (vm._uid);\n        mark(startTag);\n      }\n\n      // a flag to avoid this being observed\n      vm._isVue = true;\n      // merge options\n      if (options && options._isComponent) {\n        // optimize internal component instantiation\n        // since dynamic options merging is pretty slow, and none of the\n        // internal component options needs special treatment.\n        initInternalComponent(vm, options);\n      } else {\n        vm.$options = mergeOptions(\n          resolveConstructorOptions(vm.constructor),\n          options || {},\n          vm\n        );\n      }\n      /* istanbul ignore else */\n      {\n        initProxy(vm);\n      }\n      // expose real self\n      vm._self = vm;\n      initLifecycle(vm);\n      initEvents(vm);\n      initRender(vm);\n      callHook(vm, 'beforeCreate');\n      initInjections(vm); // resolve injections before data/props\n      initState(vm);\n      initProvide(vm); // resolve provide after data/props\n      callHook(vm, 'created');\n\n      /* istanbul ignore if */\n      if (config.performance && mark) {\n        vm._name = formatComponentName(vm, false);\n        mark(endTag);\n        measure((\"vue \" + (vm._name) + \" init\"), startTag, endTag);\n      }\n\n      if (vm.$options.el) {\n        vm.$mount(vm.$options.el);\n      }\n    };\n  }\n\n  function initInternalComponent (vm, options) {\n    var opts = vm.$options = Object.create(vm.constructor.options);\n    // doing this because it's faster than dynamic enumeration.\n    var parentVnode = options._parentVnode;\n    opts.parent = options.parent;\n    opts._parentVnode = parentVnode;\n\n    var vnodeComponentOptions = parentVnode.componentOptions;\n    opts.propsData = vnodeComponentOptions.propsData;\n    opts._parentListeners = vnodeComponentOptions.listeners;\n    opts._renderChildren = vnodeComponentOptions.children;\n    opts._componentTag = vnodeComponentOptions.tag;\n\n    if (options.render) {\n      opts.render = options.render;\n      opts.staticRenderFns = options.staticRenderFns;\n    }\n  }\n\n  function resolveConstructorOptions (Ctor) {\n    var options = Ctor.options;\n    if (Ctor.super) {\n      var superOptions = resolveConstructorOptions(Ctor.super);\n      var cachedSuperOptions = Ctor.superOptions;\n      if (superOptions !== cachedSuperOptions) {\n        // super option changed,\n        // need to resolve new options.\n        Ctor.superOptions = superOptions;\n        // check if there are any late-modified/attached options (#4976)\n        var modifiedOptions = resolveModifiedOptions(Ctor);\n        // update base extend options\n        if (modifiedOptions) {\n          extend(Ctor.extendOptions, modifiedOptions);\n        }\n        options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);\n        if (options.name) {\n          options.components[options.name] = Ctor;\n        }\n      }\n    }\n    return options\n  }\n\n  function resolveModifiedOptions (Ctor) {\n    var modified;\n    var latest = Ctor.options;\n    var sealed = Ctor.sealedOptions;\n    for (var key in latest) {\n      if (latest[key] !== sealed[key]) {\n        if (!modified) { modified = {}; }\n        modified[key] = latest[key];\n      }\n    }\n    return modified\n  }\n\n  function Vue (options) {\n    if (!(this instanceof Vue)\n    ) {\n      warn('Vue is a constructor and should be called with the `new` keyword');\n    }\n    this._init(options);\n  }\n\n  initMixin(Vue);\n  stateMixin(Vue);\n  eventsMixin(Vue);\n  lifecycleMixin(Vue);\n  renderMixin(Vue);\n\n  /*  */\n\n  function initUse (Vue) {\n    Vue.use = function (plugin) {\n      var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));\n      if (installedPlugins.indexOf(plugin) > -1) {\n        return this\n      }\n\n      // additional parameters\n      var args = toArray(arguments, 1);\n      args.unshift(this);\n      if (typeof plugin.install === 'function') {\n        plugin.install.apply(plugin, args);\n      } else if (typeof plugin === 'function') {\n        plugin.apply(null, args);\n      }\n      installedPlugins.push(plugin);\n      return this\n    };\n  }\n\n  /*  */\n\n  function initMixin$1 (Vue) {\n    Vue.mixin = function (mixin) {\n      this.options = mergeOptions(this.options, mixin);\n      return this\n    };\n  }\n\n  /*  */\n\n  function initExtend (Vue) {\n    /**\n     * Each instance constructor, including Vue, has a unique\n     * cid. This enables us to create wrapped \"child\n     * constructors\" for prototypal inheritance and cache them.\n     */\n    Vue.cid = 0;\n    var cid = 1;\n\n    /**\n     * Class inheritance\n     */\n    Vue.extend = function (extendOptions) {\n      extendOptions = extendOptions || {};\n      var Super = this;\n      var SuperId = Super.cid;\n      var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n      if (cachedCtors[SuperId]) {\n        return cachedCtors[SuperId]\n      }\n\n      var name = extendOptions.name || Super.options.name;\n      if (name) {\n        validateComponentName(name);\n      }\n\n      var Sub = function VueComponent (options) {\n        this._init(options);\n      };\n      Sub.prototype = Object.create(Super.prototype);\n      Sub.prototype.constructor = Sub;\n      Sub.cid = cid++;\n      Sub.options = mergeOptions(\n        Super.options,\n        extendOptions\n      );\n      Sub['super'] = Super;\n\n      // For props and computed properties, we define the proxy getters on\n      // the Vue instances at extension time, on the extended prototype. This\n      // avoids Object.defineProperty calls for each instance created.\n      if (Sub.options.props) {\n        initProps$1(Sub);\n      }\n      if (Sub.options.computed) {\n        initComputed$1(Sub);\n      }\n\n      // allow further extension/mixin/plugin usage\n      Sub.extend = Super.extend;\n      Sub.mixin = Super.mixin;\n      Sub.use = Super.use;\n\n      // create asset registers, so extended classes\n      // can have their private assets too.\n      ASSET_TYPES.forEach(function (type) {\n        Sub[type] = Super[type];\n      });\n      // enable recursive self-lookup\n      if (name) {\n        Sub.options.components[name] = Sub;\n      }\n\n      // keep a reference to the super options at extension time.\n      // later at instantiation we can check if Super's options have\n      // been updated.\n      Sub.superOptions = Super.options;\n      Sub.extendOptions = extendOptions;\n      Sub.sealedOptions = extend({}, Sub.options);\n\n      // cache constructor\n      cachedCtors[SuperId] = Sub;\n      return Sub\n    };\n  }\n\n  function initProps$1 (Comp) {\n    var props = Comp.options.props;\n    for (var key in props) {\n      proxy(Comp.prototype, \"_props\", key);\n    }\n  }\n\n  function initComputed$1 (Comp) {\n    var computed = Comp.options.computed;\n    for (var key in computed) {\n      defineComputed(Comp.prototype, key, computed[key]);\n    }\n  }\n\n  /*  */\n\n  function initAssetRegisters (Vue) {\n    /**\n     * Create asset registration methods.\n     */\n    ASSET_TYPES.forEach(function (type) {\n      Vue[type] = function (\n        id,\n        definition\n      ) {\n        if (!definition) {\n          return this.options[type + 's'][id]\n        } else {\n          /* istanbul ignore if */\n          if (type === 'component') {\n            validateComponentName(id);\n          }\n          if (type === 'component' && isPlainObject(definition)) {\n            definition.name = definition.name || id;\n            definition = this.options._base.extend(definition);\n          }\n          if (type === 'directive' && typeof definition === 'function') {\n            definition = { bind: definition, update: definition };\n          }\n          this.options[type + 's'][id] = definition;\n          return definition\n        }\n      };\n    });\n  }\n\n  /*  */\n\n\n\n  function getComponentName (opts) {\n    return opts && (opts.Ctor.options.name || opts.tag)\n  }\n\n  function matches (pattern, name) {\n    if (Array.isArray(pattern)) {\n      return pattern.indexOf(name) > -1\n    } else if (typeof pattern === 'string') {\n      return pattern.split(',').indexOf(name) > -1\n    } else if (isRegExp(pattern)) {\n      return pattern.test(name)\n    }\n    /* istanbul ignore next */\n    return false\n  }\n\n  function pruneCache (keepAliveInstance, filter) {\n    var cache = keepAliveInstance.cache;\n    var keys = keepAliveInstance.keys;\n    var _vnode = keepAliveInstance._vnode;\n    for (var key in cache) {\n      var cachedNode = cache[key];\n      if (cachedNode) {\n        var name = getComponentName(cachedNode.componentOptions);\n        if (name && !filter(name)) {\n          pruneCacheEntry(cache, key, keys, _vnode);\n        }\n      }\n    }\n  }\n\n  function pruneCacheEntry (\n    cache,\n    key,\n    keys,\n    current\n  ) {\n    var cached$$1 = cache[key];\n    if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {\n      cached$$1.componentInstance.$destroy();\n    }\n    cache[key] = null;\n    remove(keys, key);\n  }\n\n  var patternTypes = [String, RegExp, Array];\n\n  var KeepAlive = {\n    name: 'keep-alive',\n    abstract: true,\n\n    props: {\n      include: patternTypes,\n      exclude: patternTypes,\n      max: [String, Number]\n    },\n\n    created: function created () {\n      this.cache = Object.create(null);\n      this.keys = [];\n    },\n\n    destroyed: function destroyed () {\n      for (var key in this.cache) {\n        pruneCacheEntry(this.cache, key, this.keys);\n      }\n    },\n\n    mounted: function mounted () {\n      var this$1 = this;\n\n      this.$watch('include', function (val) {\n        pruneCache(this$1, function (name) { return matches(val, name); });\n      });\n      this.$watch('exclude', function (val) {\n        pruneCache(this$1, function (name) { return !matches(val, name); });\n      });\n    },\n\n    render: function render () {\n      var slot = this.$slots.default;\n      var vnode = getFirstComponentChild(slot);\n      var componentOptions = vnode && vnode.componentOptions;\n      if (componentOptions) {\n        // check pattern\n        var name = getComponentName(componentOptions);\n        var ref = this;\n        var include = ref.include;\n        var exclude = ref.exclude;\n        if (\n          // not included\n          (include && (!name || !matches(include, name))) ||\n          // excluded\n          (exclude && name && matches(exclude, name))\n        ) {\n          return vnode\n        }\n\n        var ref$1 = this;\n        var cache = ref$1.cache;\n        var keys = ref$1.keys;\n        var key = vnode.key == null\n          // same constructor may get registered as different local components\n          // so cid alone is not enough (#3269)\n          ? componentOptions.Ctor.cid + (componentOptions.tag ? (\"::\" + (componentOptions.tag)) : '')\n          : vnode.key;\n        if (cache[key]) {\n          vnode.componentInstance = cache[key].componentInstance;\n          // make current key freshest\n          remove(keys, key);\n          keys.push(key);\n        } else {\n          cache[key] = vnode;\n          keys.push(key);\n          // prune oldest entry\n          if (this.max && keys.length > parseInt(this.max)) {\n            pruneCacheEntry(cache, keys[0], keys, this._vnode);\n          }\n        }\n\n        vnode.data.keepAlive = true;\n      }\n      return vnode || (slot && slot[0])\n    }\n  };\n\n  var builtInComponents = {\n    KeepAlive: KeepAlive\n  };\n\n  /*  */\n\n  function initGlobalAPI (Vue) {\n    // config\n    var configDef = {};\n    configDef.get = function () { return config; };\n    {\n      configDef.set = function () {\n        warn(\n          'Do not replace the Vue.config object, set individual fields instead.'\n        );\n      };\n    }\n    Object.defineProperty(Vue, 'config', configDef);\n\n    // exposed util methods.\n    // NOTE: these are not considered part of the public API - avoid relying on\n    // them unless you are aware of the risk.\n    Vue.util = {\n      warn: warn,\n      extend: extend,\n      mergeOptions: mergeOptions,\n      defineReactive: defineReactive$$1\n    };\n\n    Vue.set = set;\n    Vue.delete = del;\n    Vue.nextTick = nextTick;\n\n    // 2.6 explicit observable API\n    Vue.observable = function (obj) {\n      observe(obj);\n      return obj\n    };\n\n    Vue.options = Object.create(null);\n    ASSET_TYPES.forEach(function (type) {\n      Vue.options[type + 's'] = Object.create(null);\n    });\n\n    // this is used to identify the \"base\" constructor to extend all plain-object\n    // components with in Weex's multi-instance scenarios.\n    Vue.options._base = Vue;\n\n    extend(Vue.options.components, builtInComponents);\n\n    initUse(Vue);\n    initMixin$1(Vue);\n    initExtend(Vue);\n    initAssetRegisters(Vue);\n  }\n\n  initGlobalAPI(Vue);\n\n  Object.defineProperty(Vue.prototype, '$isServer', {\n    get: isServerRendering\n  });\n\n  Object.defineProperty(Vue.prototype, '$ssrContext', {\n    get: function get () {\n      /* istanbul ignore next */\n      return this.$vnode && this.$vnode.ssrContext\n    }\n  });\n\n  // expose FunctionalRenderContext for ssr runtime helper installation\n  Object.defineProperty(Vue, 'FunctionalRenderContext', {\n    value: FunctionalRenderContext\n  });\n\n  Vue.version = '2.6.7';\n\n  /*  */\n\n  // these are reserved for web because they are directly compiled away\n  // during template compilation\n  var isReservedAttr = makeMap('style,class');\n\n  // attributes that should be using props for binding\n  var acceptValue = makeMap('input,textarea,option,select,progress');\n  var mustUseProp = function (tag, type, attr) {\n    return (\n      (attr === 'value' && acceptValue(tag)) && type !== 'button' ||\n      (attr === 'selected' && tag === 'option') ||\n      (attr === 'checked' && tag === 'input') ||\n      (attr === 'muted' && tag === 'video')\n    )\n  };\n\n  var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\n  var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');\n\n  var convertEnumeratedValue = function (key, value) {\n    return isFalsyAttrValue(value) || value === 'false'\n      ? 'false'\n      // allow arbitrary string value for contenteditable\n      : key === 'contenteditable' && isValidContentEditableValue(value)\n        ? value\n        : 'true'\n  };\n\n  var isBooleanAttr = makeMap(\n    'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n    'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n    'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n    'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n    'required,reversed,scoped,seamless,selected,sortable,translate,' +\n    'truespeed,typemustmatch,visible'\n  );\n\n  var xlinkNS = 'http://www.w3.org/1999/xlink';\n\n  var isXlink = function (name) {\n    return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n  };\n\n  var getXlinkProp = function (name) {\n    return isXlink(name) ? name.slice(6, name.length) : ''\n  };\n\n  var isFalsyAttrValue = function (val) {\n    return val == null || val === false\n  };\n\n  /*  */\n\n  function genClassForVnode (vnode) {\n    var data = vnode.data;\n    var parentNode = vnode;\n    var childNode = vnode;\n    while (isDef(childNode.componentInstance)) {\n      childNode = childNode.componentInstance._vnode;\n      if (childNode && childNode.data) {\n        data = mergeClassData(childNode.data, data);\n      }\n    }\n    while (isDef(parentNode = parentNode.parent)) {\n      if (parentNode && parentNode.data) {\n        data = mergeClassData(data, parentNode.data);\n      }\n    }\n    return renderClass(data.staticClass, data.class)\n  }\n\n  function mergeClassData (child, parent) {\n    return {\n      staticClass: concat(child.staticClass, parent.staticClass),\n      class: isDef(child.class)\n        ? [child.class, parent.class]\n        : parent.class\n    }\n  }\n\n  function renderClass (\n    staticClass,\n    dynamicClass\n  ) {\n    if (isDef(staticClass) || isDef(dynamicClass)) {\n      return concat(staticClass, stringifyClass(dynamicClass))\n    }\n    /* istanbul ignore next */\n    return ''\n  }\n\n  function concat (a, b) {\n    return a ? b ? (a + ' ' + b) : a : (b || '')\n  }\n\n  function stringifyClass (value) {\n    if (Array.isArray(value)) {\n      return stringifyArray(value)\n    }\n    if (isObject(value)) {\n      return stringifyObject(value)\n    }\n    if (typeof value === 'string') {\n      return value\n    }\n    /* istanbul ignore next */\n    return ''\n  }\n\n  function stringifyArray (value) {\n    var res = '';\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {\n        if (res) { res += ' '; }\n        res += stringified;\n      }\n    }\n    return res\n  }\n\n  function stringifyObject (value) {\n    var res = '';\n    for (var key in value) {\n      if (value[key]) {\n        if (res) { res += ' '; }\n        res += key;\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  var namespaceMap = {\n    svg: 'http://www.w3.org/2000/svg',\n    math: 'http://www.w3.org/1998/Math/MathML'\n  };\n\n  var isHTMLTag = makeMap(\n    'html,body,base,head,link,meta,style,title,' +\n    'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n    'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +\n    'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n    's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n    'embed,object,param,source,canvas,script,noscript,del,ins,' +\n    'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n    'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n    'output,progress,select,textarea,' +\n    'details,dialog,menu,menuitem,summary,' +\n    'content,element,shadow,template,blockquote,iframe,tfoot'\n  );\n\n  // this map is intentionally selective, only covering SVG elements that may\n  // contain child elements.\n  var isSVG = makeMap(\n    'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\n    'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n    'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n    true\n  );\n\n  var isPreTag = function (tag) { return tag === 'pre'; };\n\n  var isReservedTag = function (tag) {\n    return isHTMLTag(tag) || isSVG(tag)\n  };\n\n  function getTagNamespace (tag) {\n    if (isSVG(tag)) {\n      return 'svg'\n    }\n    // basic support for MathML\n    // note it doesn't support other MathML elements being component roots\n    if (tag === 'math') {\n      return 'math'\n    }\n  }\n\n  var unknownElementCache = Object.create(null);\n  function isUnknownElement (tag) {\n    /* istanbul ignore if */\n    if (!inBrowser) {\n      return true\n    }\n    if (isReservedTag(tag)) {\n      return false\n    }\n    tag = tag.toLowerCase();\n    /* istanbul ignore if */\n    if (unknownElementCache[tag] != null) {\n      return unknownElementCache[tag]\n    }\n    var el = document.createElement(tag);\n    if (tag.indexOf('-') > -1) {\n      // http://stackoverflow.com/a/28210364/1070244\n      return (unknownElementCache[tag] = (\n        el.constructor === window.HTMLUnknownElement ||\n        el.constructor === window.HTMLElement\n      ))\n    } else {\n      return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n    }\n  }\n\n  var isTextInputType = makeMap('text,number,password,search,email,tel,url');\n\n  /*  */\n\n  /**\n   * Query an element selector if it's not an element already.\n   */\n  function query (el) {\n    if (typeof el === 'string') {\n      var selected = document.querySelector(el);\n      if (!selected) {\n        warn(\n          'Cannot find element: ' + el\n        );\n        return document.createElement('div')\n      }\n      return selected\n    } else {\n      return el\n    }\n  }\n\n  /*  */\n\n  function createElement$1 (tagName, vnode) {\n    var elm = document.createElement(tagName);\n    if (tagName !== 'select') {\n      return elm\n    }\n    // false or null will remove the attribute but undefined will not\n    if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {\n      elm.setAttribute('multiple', 'multiple');\n    }\n    return elm\n  }\n\n  function createElementNS (namespace, tagName) {\n    return document.createElementNS(namespaceMap[namespace], tagName)\n  }\n\n  function createTextNode (text) {\n    return document.createTextNode(text)\n  }\n\n  function createComment (text) {\n    return document.createComment(text)\n  }\n\n  function insertBefore (parentNode, newNode, referenceNode) {\n    parentNode.insertBefore(newNode, referenceNode);\n  }\n\n  function removeChild (node, child) {\n    node.removeChild(child);\n  }\n\n  function appendChild (node, child) {\n    node.appendChild(child);\n  }\n\n  function parentNode (node) {\n    return node.parentNode\n  }\n\n  function nextSibling (node) {\n    return node.nextSibling\n  }\n\n  function tagName (node) {\n    return node.tagName\n  }\n\n  function setTextContent (node, text) {\n    node.textContent = text;\n  }\n\n  function setStyleScope (node, scopeId) {\n    node.setAttribute(scopeId, '');\n  }\n\n  var nodeOps = /*#__PURE__*/Object.freeze({\n    createElement: createElement$1,\n    createElementNS: createElementNS,\n    createTextNode: createTextNode,\n    createComment: createComment,\n    insertBefore: insertBefore,\n    removeChild: removeChild,\n    appendChild: appendChild,\n    parentNode: parentNode,\n    nextSibling: nextSibling,\n    tagName: tagName,\n    setTextContent: setTextContent,\n    setStyleScope: setStyleScope\n  });\n\n  /*  */\n\n  var ref = {\n    create: function create (_, vnode) {\n      registerRef(vnode);\n    },\n    update: function update (oldVnode, vnode) {\n      if (oldVnode.data.ref !== vnode.data.ref) {\n        registerRef(oldVnode, true);\n        registerRef(vnode);\n      }\n    },\n    destroy: function destroy (vnode) {\n      registerRef(vnode, true);\n    }\n  };\n\n  function registerRef (vnode, isRemoval) {\n    var key = vnode.data.ref;\n    if (!isDef(key)) { return }\n\n    var vm = vnode.context;\n    var ref = vnode.componentInstance || vnode.elm;\n    var refs = vm.$refs;\n    if (isRemoval) {\n      if (Array.isArray(refs[key])) {\n        remove(refs[key], ref);\n      } else if (refs[key] === ref) {\n        refs[key] = undefined;\n      }\n    } else {\n      if (vnode.data.refInFor) {\n        if (!Array.isArray(refs[key])) {\n          refs[key] = [ref];\n        } else if (refs[key].indexOf(ref) < 0) {\n          // $flow-disable-line\n          refs[key].push(ref);\n        }\n      } else {\n        refs[key] = ref;\n      }\n    }\n  }\n\n  /**\n   * Virtual DOM patching algorithm based on Snabbdom by\n   * Simon Friis Vindum (@paldepind)\n   * Licensed under the MIT License\n   * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n   *\n   * modified by Evan You (@yyx990803)\n   *\n   * Not type-checking this because this file is perf-critical and the cost\n   * of making flow understand it is not worth it.\n   */\n\n  var emptyNode = new VNode('', {}, []);\n\n  var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];\n\n  function sameVnode (a, b) {\n    return (\n      a.key === b.key && (\n        (\n          a.tag === b.tag &&\n          a.isComment === b.isComment &&\n          isDef(a.data) === isDef(b.data) &&\n          sameInputType(a, b)\n        ) || (\n          isTrue(a.isAsyncPlaceholder) &&\n          a.asyncFactory === b.asyncFactory &&\n          isUndef(b.asyncFactory.error)\n        )\n      )\n    )\n  }\n\n  function sameInputType (a, b) {\n    if (a.tag !== 'input') { return true }\n    var i;\n    var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;\n    var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;\n    return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)\n  }\n\n  function createKeyToOldIdx (children, beginIdx, endIdx) {\n    var i, key;\n    var map = {};\n    for (i = beginIdx; i <= endIdx; ++i) {\n      key = children[i].key;\n      if (isDef(key)) { map[key] = i; }\n    }\n    return map\n  }\n\n  function createPatchFunction (backend) {\n    var i, j;\n    var cbs = {};\n\n    var modules = backend.modules;\n    var nodeOps = backend.nodeOps;\n\n    for (i = 0; i < hooks.length; ++i) {\n      cbs[hooks[i]] = [];\n      for (j = 0; j < modules.length; ++j) {\n        if (isDef(modules[j][hooks[i]])) {\n          cbs[hooks[i]].push(modules[j][hooks[i]]);\n        }\n      }\n    }\n\n    function emptyNodeAt (elm) {\n      return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n    }\n\n    function createRmCb (childElm, listeners) {\n      function remove$$1 () {\n        if (--remove$$1.listeners === 0) {\n          removeNode(childElm);\n        }\n      }\n      remove$$1.listeners = listeners;\n      return remove$$1\n    }\n\n    function removeNode (el) {\n      var parent = nodeOps.parentNode(el);\n      // element may have already been removed due to v-html / v-text\n      if (isDef(parent)) {\n        nodeOps.removeChild(parent, el);\n      }\n    }\n\n    function isUnknownElement$$1 (vnode, inVPre) {\n      return (\n        !inVPre &&\n        !vnode.ns &&\n        !(\n          config.ignoredElements.length &&\n          config.ignoredElements.some(function (ignore) {\n            return isRegExp(ignore)\n              ? ignore.test(vnode.tag)\n              : ignore === vnode.tag\n          })\n        ) &&\n        config.isUnknownElement(vnode.tag)\n      )\n    }\n\n    var creatingElmInVPre = 0;\n\n    function createElm (\n      vnode,\n      insertedVnodeQueue,\n      parentElm,\n      refElm,\n      nested,\n      ownerArray,\n      index\n    ) {\n      if (isDef(vnode.elm) && isDef(ownerArray)) {\n        // This vnode was used in a previous render!\n        // now it's used as a new node, overwriting its elm would cause\n        // potential patch errors down the road when it's used as an insertion\n        // reference node. Instead, we clone the node on-demand before creating\n        // associated DOM element for it.\n        vnode = ownerArray[index] = cloneVNode(vnode);\n      }\n\n      vnode.isRootInsert = !nested; // for transition enter check\n      if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n        return\n      }\n\n      var data = vnode.data;\n      var children = vnode.children;\n      var tag = vnode.tag;\n      if (isDef(tag)) {\n        {\n          if (data && data.pre) {\n            creatingElmInVPre++;\n          }\n          if (isUnknownElement$$1(vnode, creatingElmInVPre)) {\n            warn(\n              'Unknown custom element: <' + tag + '> - did you ' +\n              'register the component correctly? For recursive components, ' +\n              'make sure to provide the \"name\" option.',\n              vnode.context\n            );\n          }\n        }\n\n        vnode.elm = vnode.ns\n          ? nodeOps.createElementNS(vnode.ns, tag)\n          : nodeOps.createElement(tag, vnode);\n        setScope(vnode);\n\n        /* istanbul ignore if */\n        {\n          createChildren(vnode, children, insertedVnodeQueue);\n          if (isDef(data)) {\n            invokeCreateHooks(vnode, insertedVnodeQueue);\n          }\n          insert(parentElm, vnode.elm, refElm);\n        }\n\n        if (data && data.pre) {\n          creatingElmInVPre--;\n        }\n      } else if (isTrue(vnode.isComment)) {\n        vnode.elm = nodeOps.createComment(vnode.text);\n        insert(parentElm, vnode.elm, refElm);\n      } else {\n        vnode.elm = nodeOps.createTextNode(vnode.text);\n        insert(parentElm, vnode.elm, refElm);\n      }\n    }\n\n    function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n      var i = vnode.data;\n      if (isDef(i)) {\n        var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;\n        if (isDef(i = i.hook) && isDef(i = i.init)) {\n          i(vnode, false /* hydrating */);\n        }\n        // after calling the init hook, if the vnode is a child component\n        // it should've created a child instance and mounted it. the child\n        // component also has set the placeholder vnode's elm.\n        // in that case we can just return the element and be done.\n        if (isDef(vnode.componentInstance)) {\n          initComponent(vnode, insertedVnodeQueue);\n          insert(parentElm, vnode.elm, refElm);\n          if (isTrue(isReactivated)) {\n            reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n          }\n          return true\n        }\n      }\n    }\n\n    function initComponent (vnode, insertedVnodeQueue) {\n      if (isDef(vnode.data.pendingInsert)) {\n        insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n        vnode.data.pendingInsert = null;\n      }\n      vnode.elm = vnode.componentInstance.$el;\n      if (isPatchable(vnode)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n        setScope(vnode);\n      } else {\n        // empty component root.\n        // skip all element-related modules except for ref (#3455)\n        registerRef(vnode);\n        // make sure to invoke the insert hook\n        insertedVnodeQueue.push(vnode);\n      }\n    }\n\n    function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n      var i;\n      // hack for #4339: a reactivated component with inner transition\n      // does not trigger because the inner node's created hooks are not called\n      // again. It's not ideal to involve module-specific logic in here but\n      // there doesn't seem to be a better way to do it.\n      var innerNode = vnode;\n      while (innerNode.componentInstance) {\n        innerNode = innerNode.componentInstance._vnode;\n        if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n          for (i = 0; i < cbs.activate.length; ++i) {\n            cbs.activate[i](emptyNode, innerNode);\n          }\n          insertedVnodeQueue.push(innerNode);\n          break\n        }\n      }\n      // unlike a newly created component,\n      // a reactivated keep-alive component doesn't insert itself\n      insert(parentElm, vnode.elm, refElm);\n    }\n\n    function insert (parent, elm, ref$$1) {\n      if (isDef(parent)) {\n        if (isDef(ref$$1)) {\n          if (nodeOps.parentNode(ref$$1) === parent) {\n            nodeOps.insertBefore(parent, elm, ref$$1);\n          }\n        } else {\n          nodeOps.appendChild(parent, elm);\n        }\n      }\n    }\n\n    function createChildren (vnode, children, insertedVnodeQueue) {\n      if (Array.isArray(children)) {\n        {\n          checkDuplicateKeys(children);\n        }\n        for (var i = 0; i < children.length; ++i) {\n          createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);\n        }\n      } else if (isPrimitive(vnode.text)) {\n        nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));\n      }\n    }\n\n    function isPatchable (vnode) {\n      while (vnode.componentInstance) {\n        vnode = vnode.componentInstance._vnode;\n      }\n      return isDef(vnode.tag)\n    }\n\n    function invokeCreateHooks (vnode, insertedVnodeQueue) {\n      for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n        cbs.create[i$1](emptyNode, vnode);\n      }\n      i = vnode.data.hook; // Reuse variable\n      if (isDef(i)) {\n        if (isDef(i.create)) { i.create(emptyNode, vnode); }\n        if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }\n      }\n    }\n\n    // set scope id attribute for scoped CSS.\n    // this is implemented as a special case to avoid the overhead\n    // of going through the normal attribute patching process.\n    function setScope (vnode) {\n      var i;\n      if (isDef(i = vnode.fnScopeId)) {\n        nodeOps.setStyleScope(vnode.elm, i);\n      } else {\n        var ancestor = vnode;\n        while (ancestor) {\n          if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n            nodeOps.setStyleScope(vnode.elm, i);\n          }\n          ancestor = ancestor.parent;\n        }\n      }\n      // for slot content they should also get the scopeId from the host instance.\n      if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        i !== vnode.fnContext &&\n        isDef(i = i.$options._scopeId)\n      ) {\n        nodeOps.setStyleScope(vnode.elm, i);\n      }\n    }\n\n    function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n      for (; startIdx <= endIdx; ++startIdx) {\n        createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);\n      }\n    }\n\n    function invokeDestroyHook (vnode) {\n      var i, j;\n      var data = vnode.data;\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n        for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n      }\n      if (isDef(i = vnode.children)) {\n        for (j = 0; j < vnode.children.length; ++j) {\n          invokeDestroyHook(vnode.children[j]);\n        }\n      }\n    }\n\n    function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n      for (; startIdx <= endIdx; ++startIdx) {\n        var ch = vnodes[startIdx];\n        if (isDef(ch)) {\n          if (isDef(ch.tag)) {\n            removeAndInvokeRemoveHook(ch);\n            invokeDestroyHook(ch);\n          } else { // Text node\n            removeNode(ch.elm);\n          }\n        }\n      }\n    }\n\n    function removeAndInvokeRemoveHook (vnode, rm) {\n      if (isDef(rm) || isDef(vnode.data)) {\n        var i;\n        var listeners = cbs.remove.length + 1;\n        if (isDef(rm)) {\n          // we have a recursively passed down rm callback\n          // increase the listeners count\n          rm.listeners += listeners;\n        } else {\n          // directly removing\n          rm = createRmCb(vnode.elm, listeners);\n        }\n        // recursively invoke hooks on child component root node\n        if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {\n          removeAndInvokeRemoveHook(i, rm);\n        }\n        for (i = 0; i < cbs.remove.length; ++i) {\n          cbs.remove[i](vnode, rm);\n        }\n        if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n          i(vnode, rm);\n        } else {\n          rm();\n        }\n      } else {\n        removeNode(vnode.elm);\n      }\n    }\n\n    function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n      var oldStartIdx = 0;\n      var newStartIdx = 0;\n      var oldEndIdx = oldCh.length - 1;\n      var oldStartVnode = oldCh[0];\n      var oldEndVnode = oldCh[oldEndIdx];\n      var newEndIdx = newCh.length - 1;\n      var newStartVnode = newCh[0];\n      var newEndVnode = newCh[newEndIdx];\n      var oldKeyToIdx, idxInOld, vnodeToMove, refElm;\n\n      // removeOnly is a special flag used only by <transition-group>\n      // to ensure removed elements stay in correct relative positions\n      // during leaving transitions\n      var canMove = !removeOnly;\n\n      {\n        checkDuplicateKeys(newCh);\n      }\n\n      while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n        if (isUndef(oldStartVnode)) {\n          oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n        } else if (isUndef(oldEndVnode)) {\n          oldEndVnode = oldCh[--oldEndIdx];\n        } else if (sameVnode(oldStartVnode, newStartVnode)) {\n          patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n          oldStartVnode = oldCh[++oldStartIdx];\n          newStartVnode = newCh[++newStartIdx];\n        } else if (sameVnode(oldEndVnode, newEndVnode)) {\n          patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n          oldEndVnode = oldCh[--oldEndIdx];\n          newEndVnode = newCh[--newEndIdx];\n        } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n          patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n          canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n          oldStartVnode = oldCh[++oldStartIdx];\n          newEndVnode = newCh[--newEndIdx];\n        } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n          patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n          canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n          oldEndVnode = oldCh[--oldEndIdx];\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n          idxInOld = isDef(newStartVnode.key)\n            ? oldKeyToIdx[newStartVnode.key]\n            : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);\n          if (isUndef(idxInOld)) { // New element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n          } else {\n            vnodeToMove = oldCh[idxInOld];\n            if (sameVnode(vnodeToMove, newStartVnode)) {\n              patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n              oldCh[idxInOld] = undefined;\n              canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);\n            } else {\n              // same key but different element. treat as new element\n              createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n            }\n          }\n          newStartVnode = newCh[++newStartIdx];\n        }\n      }\n      if (oldStartIdx > oldEndIdx) {\n        refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n        addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n      } else if (newStartIdx > newEndIdx) {\n        removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n      }\n    }\n\n    function checkDuplicateKeys (children) {\n      var seenKeys = {};\n      for (var i = 0; i < children.length; i++) {\n        var vnode = children[i];\n        var key = vnode.key;\n        if (isDef(key)) {\n          if (seenKeys[key]) {\n            warn(\n              (\"Duplicate keys detected: '\" + key + \"'. This may cause an update error.\"),\n              vnode.context\n            );\n          } else {\n            seenKeys[key] = true;\n          }\n        }\n      }\n    }\n\n    function findIdxInOld (node, oldCh, start, end) {\n      for (var i = start; i < end; i++) {\n        var c = oldCh[i];\n        if (isDef(c) && sameVnode(node, c)) { return i }\n      }\n    }\n\n    function patchVnode (\n      oldVnode,\n      vnode,\n      insertedVnodeQueue,\n      ownerArray,\n      index,\n      removeOnly\n    ) {\n      if (oldVnode === vnode) {\n        return\n      }\n\n      if (isDef(vnode.elm) && isDef(ownerArray)) {\n        // clone reused vnode\n        vnode = ownerArray[index] = cloneVNode(vnode);\n      }\n\n      var elm = vnode.elm = oldVnode.elm;\n\n      if (isTrue(oldVnode.isAsyncPlaceholder)) {\n        if (isDef(vnode.asyncFactory.resolved)) {\n          hydrate(oldVnode.elm, vnode, insertedVnodeQueue);\n        } else {\n          vnode.isAsyncPlaceholder = true;\n        }\n        return\n      }\n\n      // reuse element for static trees.\n      // note we only do this if the vnode is cloned -\n      // if the new node is not cloned it means the render functions have been\n      // reset by the hot-reload-api and we need to do a proper re-render.\n      if (isTrue(vnode.isStatic) &&\n        isTrue(oldVnode.isStatic) &&\n        vnode.key === oldVnode.key &&\n        (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))\n      ) {\n        vnode.componentInstance = oldVnode.componentInstance;\n        return\n      }\n\n      var i;\n      var data = vnode.data;\n      if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n        i(oldVnode, vnode);\n      }\n\n      var oldCh = oldVnode.children;\n      var ch = vnode.children;\n      if (isDef(data) && isPatchable(vnode)) {\n        for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n        if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n      }\n      if (isUndef(vnode.text)) {\n        if (isDef(oldCh) && isDef(ch)) {\n          if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n        } else if (isDef(ch)) {\n          {\n            checkDuplicateKeys(ch);\n          }\n          if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n          addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n        } else if (isDef(oldCh)) {\n          removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n        } else if (isDef(oldVnode.text)) {\n          nodeOps.setTextContent(elm, '');\n        }\n      } else if (oldVnode.text !== vnode.text) {\n        nodeOps.setTextContent(elm, vnode.text);\n      }\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n      }\n    }\n\n    function invokeInsertHook (vnode, queue, initial) {\n      // delay insert hooks for component root nodes, invoke them after the\n      // element is really inserted\n      if (isTrue(initial) && isDef(vnode.parent)) {\n        vnode.parent.data.pendingInsert = queue;\n      } else {\n        for (var i = 0; i < queue.length; ++i) {\n          queue[i].data.hook.insert(queue[i]);\n        }\n      }\n    }\n\n    var hydrationBailed = false;\n    // list of modules that can skip create hook during hydration because they\n    // are already rendered on the client or has no need for initialization\n    // Note: style is excluded because it relies on initial clone for future\n    // deep updates (#7063).\n    var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');\n\n    // Note: this is a browser-only function so we can assume elms are DOM nodes.\n    function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {\n      var i;\n      var tag = vnode.tag;\n      var data = vnode.data;\n      var children = vnode.children;\n      inVPre = inVPre || (data && data.pre);\n      vnode.elm = elm;\n\n      if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {\n        vnode.isAsyncPlaceholder = true;\n        return true\n      }\n      // assert node match\n      {\n        if (!assertNodeMatch(elm, vnode, inVPre)) {\n          return false\n        }\n      }\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n        if (isDef(i = vnode.componentInstance)) {\n          // child component. it should have hydrated its own tree.\n          initComponent(vnode, insertedVnodeQueue);\n          return true\n        }\n      }\n      if (isDef(tag)) {\n        if (isDef(children)) {\n          // empty element, allow client to pick up and populate children\n          if (!elm.hasChildNodes()) {\n            createChildren(vnode, children, insertedVnodeQueue);\n          } else {\n            // v-html and domProps: innerHTML\n            if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {\n              if (i !== elm.innerHTML) {\n                /* istanbul ignore if */\n                if (typeof console !== 'undefined' &&\n                  !hydrationBailed\n                ) {\n                  hydrationBailed = true;\n                  console.warn('Parent: ', elm);\n                  console.warn('server innerHTML: ', i);\n                  console.warn('client innerHTML: ', elm.innerHTML);\n                }\n                return false\n              }\n            } else {\n              // iterate and compare children lists\n              var childrenMatch = true;\n              var childNode = elm.firstChild;\n              for (var i$1 = 0; i$1 < children.length; i$1++) {\n                if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {\n                  childrenMatch = false;\n                  break\n                }\n                childNode = childNode.nextSibling;\n              }\n              // if childNode is not null, it means the actual childNodes list is\n              // longer than the virtual children list.\n              if (!childrenMatch || childNode) {\n                /* istanbul ignore if */\n                if (typeof console !== 'undefined' &&\n                  !hydrationBailed\n                ) {\n                  hydrationBailed = true;\n                  console.warn('Parent: ', elm);\n                  console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);\n                }\n                return false\n              }\n            }\n          }\n        }\n        if (isDef(data)) {\n          var fullInvoke = false;\n          for (var key in data) {\n            if (!isRenderedModule(key)) {\n              fullInvoke = true;\n              invokeCreateHooks(vnode, insertedVnodeQueue);\n              break\n            }\n          }\n          if (!fullInvoke && data['class']) {\n            // ensure collecting deps for deep class bindings for future updates\n            traverse(data['class']);\n          }\n        }\n      } else if (elm.data !== vnode.text) {\n        elm.data = vnode.text;\n      }\n      return true\n    }\n\n    function assertNodeMatch (node, vnode, inVPre) {\n      if (isDef(vnode.tag)) {\n        return vnode.tag.indexOf('vue-component') === 0 || (\n          !isUnknownElement$$1(vnode, inVPre) &&\n          vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())\n        )\n      } else {\n        return node.nodeType === (vnode.isComment ? 8 : 3)\n      }\n    }\n\n    return function patch (oldVnode, vnode, hydrating, removeOnly) {\n      if (isUndef(vnode)) {\n        if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }\n        return\n      }\n\n      var isInitialPatch = false;\n      var insertedVnodeQueue = [];\n\n      if (isUndef(oldVnode)) {\n        // empty mount (likely as component), create new root element\n        isInitialPatch = true;\n        createElm(vnode, insertedVnodeQueue);\n      } else {\n        var isRealElement = isDef(oldVnode.nodeType);\n        if (!isRealElement && sameVnode(oldVnode, vnode)) {\n          // patch existing root node\n          patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);\n        } else {\n          if (isRealElement) {\n            // mounting to a real element\n            // check if this is server-rendered content and if we can perform\n            // a successful hydration.\n            if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {\n              oldVnode.removeAttribute(SSR_ATTR);\n              hydrating = true;\n            }\n            if (isTrue(hydrating)) {\n              if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n                invokeInsertHook(vnode, insertedVnodeQueue, true);\n                return oldVnode\n              } else {\n                warn(\n                  'The client-side rendered virtual DOM tree is not matching ' +\n                  'server-rendered content. This is likely caused by incorrect ' +\n                  'HTML markup, for example nesting block-level elements inside ' +\n                  '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                  'full client-side render.'\n                );\n              }\n            }\n            // either not server-rendered, or hydration failed.\n            // create an empty node and replace it\n            oldVnode = emptyNodeAt(oldVnode);\n          }\n\n          // replacing existing element\n          var oldElm = oldVnode.elm;\n          var parentElm = nodeOps.parentNode(oldElm);\n\n          // create new node\n          createElm(\n            vnode,\n            insertedVnodeQueue,\n            // extremely rare edge case: do not insert if old element is in a\n            // leaving transition. Only happens when combining transition +\n            // keep-alive + HOCs. (#4590)\n            oldElm._leaveCb ? null : parentElm,\n            nodeOps.nextSibling(oldElm)\n          );\n\n          // update parent placeholder node element, recursively\n          if (isDef(vnode.parent)) {\n            var ancestor = vnode.parent;\n            var patchable = isPatchable(vnode);\n            while (ancestor) {\n              for (var i = 0; i < cbs.destroy.length; ++i) {\n                cbs.destroy[i](ancestor);\n              }\n              ancestor.elm = vnode.elm;\n              if (patchable) {\n                for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n                  cbs.create[i$1](emptyNode, ancestor);\n                }\n                // #6513\n                // invoke insert hooks that may have been merged by create hooks.\n                // e.g. for directives that uses the \"inserted\" hook.\n                var insert = ancestor.data.hook.insert;\n                if (insert.merged) {\n                  // start at index 1 to avoid re-invoking component mounted hook\n                  for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {\n                    insert.fns[i$2]();\n                  }\n                }\n              } else {\n                registerRef(ancestor);\n              }\n              ancestor = ancestor.parent;\n            }\n          }\n\n          // destroy old node\n          if (isDef(parentElm)) {\n            removeVnodes(parentElm, [oldVnode], 0, 0);\n          } else if (isDef(oldVnode.tag)) {\n            invokeDestroyHook(oldVnode);\n          }\n        }\n      }\n\n      invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n      return vnode.elm\n    }\n  }\n\n  /*  */\n\n  var directives = {\n    create: updateDirectives,\n    update: updateDirectives,\n    destroy: function unbindDirectives (vnode) {\n      updateDirectives(vnode, emptyNode);\n    }\n  };\n\n  function updateDirectives (oldVnode, vnode) {\n    if (oldVnode.data.directives || vnode.data.directives) {\n      _update(oldVnode, vnode);\n    }\n  }\n\n  function _update (oldVnode, vnode) {\n    var isCreate = oldVnode === emptyNode;\n    var isDestroy = vnode === emptyNode;\n    var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n    var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n    var dirsWithInsert = [];\n    var dirsWithPostpatch = [];\n\n    var key, oldDir, dir;\n    for (key in newDirs) {\n      oldDir = oldDirs[key];\n      dir = newDirs[key];\n      if (!oldDir) {\n        // new directive, bind\n        callHook$1(dir, 'bind', vnode, oldVnode);\n        if (dir.def && dir.def.inserted) {\n          dirsWithInsert.push(dir);\n        }\n      } else {\n        // existing directive, update\n        dir.oldValue = oldDir.value;\n        dir.oldArg = oldDir.arg;\n        callHook$1(dir, 'update', vnode, oldVnode);\n        if (dir.def && dir.def.componentUpdated) {\n          dirsWithPostpatch.push(dir);\n        }\n      }\n    }\n\n    if (dirsWithInsert.length) {\n      var callInsert = function () {\n        for (var i = 0; i < dirsWithInsert.length; i++) {\n          callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);\n        }\n      };\n      if (isCreate) {\n        mergeVNodeHook(vnode, 'insert', callInsert);\n      } else {\n        callInsert();\n      }\n    }\n\n    if (dirsWithPostpatch.length) {\n      mergeVNodeHook(vnode, 'postpatch', function () {\n        for (var i = 0; i < dirsWithPostpatch.length; i++) {\n          callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);\n        }\n      });\n    }\n\n    if (!isCreate) {\n      for (key in oldDirs) {\n        if (!newDirs[key]) {\n          // no longer present, unbind\n          callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);\n        }\n      }\n    }\n  }\n\n  var emptyModifiers = Object.create(null);\n\n  function normalizeDirectives$1 (\n    dirs,\n    vm\n  ) {\n    var res = Object.create(null);\n    if (!dirs) {\n      // $flow-disable-line\n      return res\n    }\n    var i, dir;\n    for (i = 0; i < dirs.length; i++) {\n      dir = dirs[i];\n      if (!dir.modifiers) {\n        // $flow-disable-line\n        dir.modifiers = emptyModifiers;\n      }\n      res[getRawDirName(dir)] = dir;\n      dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n    }\n    // $flow-disable-line\n    return res\n  }\n\n  function getRawDirName (dir) {\n    return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n  }\n\n  function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {\n    var fn = dir.def && dir.def[hook];\n    if (fn) {\n      try {\n        fn(vnode.elm, dir, vnode, oldVnode, isDestroy);\n      } catch (e) {\n        handleError(e, vnode.context, (\"directive \" + (dir.name) + \" \" + hook + \" hook\"));\n      }\n    }\n  }\n\n  var baseModules = [\n    ref,\n    directives\n  ];\n\n  /*  */\n\n  function updateAttrs (oldVnode, vnode) {\n    var opts = vnode.componentOptions;\n    if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {\n      return\n    }\n    if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {\n      return\n    }\n    var key, cur, old;\n    var elm = vnode.elm;\n    var oldAttrs = oldVnode.data.attrs || {};\n    var attrs = vnode.data.attrs || {};\n    // clone observed objects, as the user probably wants to mutate it\n    if (isDef(attrs.__ob__)) {\n      attrs = vnode.data.attrs = extend({}, attrs);\n    }\n\n    for (key in attrs) {\n      cur = attrs[key];\n      old = oldAttrs[key];\n      if (old !== cur) {\n        setAttr(elm, key, cur);\n      }\n    }\n    // #4391: in IE9, setting type can reset value for input[type=radio]\n    // #6666: IE/Edge forces progress value down to 1 before setting a max\n    /* istanbul ignore if */\n    if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {\n      setAttr(elm, 'value', attrs.value);\n    }\n    for (key in oldAttrs) {\n      if (isUndef(attrs[key])) {\n        if (isXlink(key)) {\n          elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n        } else if (!isEnumeratedAttr(key)) {\n          elm.removeAttribute(key);\n        }\n      }\n    }\n  }\n\n  function setAttr (el, key, value) {\n    if (el.tagName.indexOf('-') > -1) {\n      baseSetAttr(el, key, value);\n    } else if (isBooleanAttr(key)) {\n      // set attribute for blank value\n      // e.g. <option disabled>Select one</option>\n      if (isFalsyAttrValue(value)) {\n        el.removeAttribute(key);\n      } else {\n        // technically allowfullscreen is a boolean attribute for <iframe>,\n        // but Flash expects a value of \"true\" when used on <embed> tag\n        value = key === 'allowfullscreen' && el.tagName === 'EMBED'\n          ? 'true'\n          : key;\n        el.setAttribute(key, value);\n      }\n    } else if (isEnumeratedAttr(key)) {\n      el.setAttribute(key, convertEnumeratedValue(key, value));\n    } else if (isXlink(key)) {\n      if (isFalsyAttrValue(value)) {\n        el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else {\n        el.setAttributeNS(xlinkNS, key, value);\n      }\n    } else {\n      baseSetAttr(el, key, value);\n    }\n  }\n\n  function baseSetAttr (el, key, value) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      // #7138: IE10 & 11 fires input event when setting placeholder on\n      // <textarea>... block the first input event and remove the blocker\n      // immediately.\n      /* istanbul ignore if */\n      if (\n        isIE && !isIE9 &&\n        el.tagName === 'TEXTAREA' &&\n        key === 'placeholder' && value !== '' && !el.__ieph\n      ) {\n        var blocker = function (e) {\n          e.stopImmediatePropagation();\n          el.removeEventListener('input', blocker);\n        };\n        el.addEventListener('input', blocker);\n        // $flow-disable-line\n        el.__ieph = true; /* IE placeholder patched */\n      }\n      el.setAttribute(key, value);\n    }\n  }\n\n  var attrs = {\n    create: updateAttrs,\n    update: updateAttrs\n  };\n\n  /*  */\n\n  function updateClass (oldVnode, vnode) {\n    var el = vnode.elm;\n    var data = vnode.data;\n    var oldData = oldVnode.data;\n    if (\n      isUndef(data.staticClass) &&\n      isUndef(data.class) && (\n        isUndef(oldData) || (\n          isUndef(oldData.staticClass) &&\n          isUndef(oldData.class)\n        )\n      )\n    ) {\n      return\n    }\n\n    var cls = genClassForVnode(vnode);\n\n    // handle transition classes\n    var transitionClass = el._transitionClasses;\n    if (isDef(transitionClass)) {\n      cls = concat(cls, stringifyClass(transitionClass));\n    }\n\n    // set the class\n    if (cls !== el._prevClass) {\n      el.setAttribute('class', cls);\n      el._prevClass = cls;\n    }\n  }\n\n  var klass = {\n    create: updateClass,\n    update: updateClass\n  };\n\n  /*  */\n\n  var validDivisionCharRE = /[\\w).+\\-_$\\]]/;\n\n  function parseFilters (exp) {\n    var inSingle = false;\n    var inDouble = false;\n    var inTemplateString = false;\n    var inRegex = false;\n    var curly = 0;\n    var square = 0;\n    var paren = 0;\n    var lastFilterIndex = 0;\n    var c, prev, i, expression, filters;\n\n    for (i = 0; i < exp.length; i++) {\n      prev = c;\n      c = exp.charCodeAt(i);\n      if (inSingle) {\n        if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n      } else if (inDouble) {\n        if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n      } else if (inTemplateString) {\n        if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n      } else if (inRegex) {\n        if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n      } else if (\n        c === 0x7C && // pipe\n        exp.charCodeAt(i + 1) !== 0x7C &&\n        exp.charCodeAt(i - 1) !== 0x7C &&\n        !curly && !square && !paren\n      ) {\n        if (expression === undefined) {\n          // first filter, end of expression\n          lastFilterIndex = i + 1;\n          expression = exp.slice(0, i).trim();\n        } else {\n          pushFilter();\n        }\n      } else {\n        switch (c) {\n          case 0x22: inDouble = true; break         // \"\n          case 0x27: inSingle = true; break         // '\n          case 0x60: inTemplateString = true; break // `\n          case 0x28: paren++; break                 // (\n          case 0x29: paren--; break                 // )\n          case 0x5B: square++; break                // [\n          case 0x5D: square--; break                // ]\n          case 0x7B: curly++; break                 // {\n          case 0x7D: curly--; break                 // }\n        }\n        if (c === 0x2f) { // /\n          var j = i - 1;\n          var p = (void 0);\n          // find first non-whitespace prev char\n          for (; j >= 0; j--) {\n            p = exp.charAt(j);\n            if (p !== ' ') { break }\n          }\n          if (!p || !validDivisionCharRE.test(p)) {\n            inRegex = true;\n          }\n        }\n      }\n    }\n\n    if (expression === undefined) {\n      expression = exp.slice(0, i).trim();\n    } else if (lastFilterIndex !== 0) {\n      pushFilter();\n    }\n\n    function pushFilter () {\n      (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n      lastFilterIndex = i + 1;\n    }\n\n    if (filters) {\n      for (i = 0; i < filters.length; i++) {\n        expression = wrapFilter(expression, filters[i]);\n      }\n    }\n\n    return expression\n  }\n\n  function wrapFilter (exp, filter) {\n    var i = filter.indexOf('(');\n    if (i < 0) {\n      // _f: resolveFilter\n      return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n    } else {\n      var name = filter.slice(0, i);\n      var args = filter.slice(i + 1);\n      return (\"_f(\\\"\" + name + \"\\\")(\" + exp + (args !== ')' ? ',' + args : args))\n    }\n  }\n\n  /*  */\n\n\n\n  /* eslint-disable no-unused-vars */\n  function baseWarn (msg, range) {\n    console.error((\"[Vue compiler]: \" + msg));\n  }\n  /* eslint-enable no-unused-vars */\n\n  function pluckModuleFunction (\n    modules,\n    key\n  ) {\n    return modules\n      ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n      : []\n  }\n\n  function addProp (el, name, value, range, dynamic) {\n    (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));\n    el.plain = false;\n  }\n\n  function addAttr (el, name, value, range, dynamic) {\n    var attrs = dynamic\n      ? (el.dynamicAttrs || (el.dynamicAttrs = []))\n      : (el.attrs || (el.attrs = []));\n    attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));\n    el.plain = false;\n  }\n\n  // add a raw attr (use this in preTransforms)\n  function addRawAttr (el, name, value, range) {\n    el.attrsMap[name] = value;\n    el.attrsList.push(rangeSetItem({ name: name, value: value }, range));\n  }\n\n  function addDirective (\n    el,\n    name,\n    rawName,\n    value,\n    arg,\n    isDynamicArg,\n    modifiers,\n    range\n  ) {\n    (el.directives || (el.directives = [])).push(rangeSetItem({\n      name: name,\n      rawName: rawName,\n      value: value,\n      arg: arg,\n      isDynamicArg: isDynamicArg,\n      modifiers: modifiers\n    }, range));\n    el.plain = false;\n  }\n\n  function prependModifierMarker (symbol, name, dynamic) {\n    return dynamic\n      ? (\"_p(\" + name + \",\\\"\" + symbol + \"\\\")\")\n      : symbol + name // mark the event as captured\n  }\n\n  function addHandler (\n    el,\n    name,\n    value,\n    modifiers,\n    important,\n    warn,\n    range,\n    dynamic\n  ) {\n    modifiers = modifiers || emptyObject;\n    // warn prevent and passive modifier\n    /* istanbul ignore if */\n    if (\n      warn &&\n      modifiers.prevent && modifiers.passive\n    ) {\n      warn(\n        'passive and prevent can\\'t be used together. ' +\n        'Passive handler can\\'t prevent default event.',\n        range\n      );\n    }\n\n    // normalize click.right and click.middle since they don't actually fire\n    // this is technically browser-specific, but at least for now browsers are\n    // the only target envs that have right/middle clicks.\n    if (modifiers.right) {\n      if (dynamic) {\n        name = \"(\" + name + \")==='click'?'contextmenu':(\" + name + \")\";\n      } else if (name === 'click') {\n        name = 'contextmenu';\n        delete modifiers.right;\n      }\n    } else if (modifiers.middle) {\n      if (dynamic) {\n        name = \"(\" + name + \")==='click'?'mouseup':(\" + name + \")\";\n      } else if (name === 'click') {\n        name = 'mouseup';\n      }\n    }\n\n    // check capture modifier\n    if (modifiers.capture) {\n      delete modifiers.capture;\n      name = prependModifierMarker('!', name, dynamic);\n    }\n    if (modifiers.once) {\n      delete modifiers.once;\n      name = prependModifierMarker('~', name, dynamic);\n    }\n    /* istanbul ignore if */\n    if (modifiers.passive) {\n      delete modifiers.passive;\n      name = prependModifierMarker('&', name, dynamic);\n    }\n\n    var events;\n    if (modifiers.native) {\n      delete modifiers.native;\n      events = el.nativeEvents || (el.nativeEvents = {});\n    } else {\n      events = el.events || (el.events = {});\n    }\n\n    var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);\n    if (modifiers !== emptyObject) {\n      newHandler.modifiers = modifiers;\n    }\n\n    var handlers = events[name];\n    /* istanbul ignore if */\n    if (Array.isArray(handlers)) {\n      important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n    } else if (handlers) {\n      events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n    } else {\n      events[name] = newHandler;\n    }\n\n    el.plain = false;\n  }\n\n  function getRawBindingAttr (\n    el,\n    name\n  ) {\n    return el.rawAttrsMap[':' + name] ||\n      el.rawAttrsMap['v-bind:' + name] ||\n      el.rawAttrsMap[name]\n  }\n\n  function getBindingAttr (\n    el,\n    name,\n    getStatic\n  ) {\n    var dynamicValue =\n      getAndRemoveAttr(el, ':' + name) ||\n      getAndRemoveAttr(el, 'v-bind:' + name);\n    if (dynamicValue != null) {\n      return parseFilters(dynamicValue)\n    } else if (getStatic !== false) {\n      var staticValue = getAndRemoveAttr(el, name);\n      if (staticValue != null) {\n        return JSON.stringify(staticValue)\n      }\n    }\n  }\n\n  // note: this only removes the attr from the Array (attrsList) so that it\n  // doesn't get processed by processAttrs.\n  // By default it does NOT remove it from the map (attrsMap) because the map is\n  // needed during codegen.\n  function getAndRemoveAttr (\n    el,\n    name,\n    removeFromMap\n  ) {\n    var val;\n    if ((val = el.attrsMap[name]) != null) {\n      var list = el.attrsList;\n      for (var i = 0, l = list.length; i < l; i++) {\n        if (list[i].name === name) {\n          list.splice(i, 1);\n          break\n        }\n      }\n    }\n    if (removeFromMap) {\n      delete el.attrsMap[name];\n    }\n    return val\n  }\n\n  function getAndRemoveAttrByRegex (\n    el,\n    name\n  ) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      var attr = list[i];\n      if (name.test(attr.name)) {\n        list.splice(i, 1);\n        return attr\n      }\n    }\n  }\n\n  function rangeSetItem (\n    item,\n    range\n  ) {\n    if (range) {\n      if (range.start != null) {\n        item.start = range.start;\n      }\n      if (range.end != null) {\n        item.end = range.end;\n      }\n    }\n    return item\n  }\n\n  /*  */\n\n  /**\n   * Cross-platform code generation for component v-model\n   */\n  function genComponentModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var ref = modifiers || {};\n    var number = ref.number;\n    var trim = ref.trim;\n\n    var baseValueExpression = '$$v';\n    var valueExpression = baseValueExpression;\n    if (trim) {\n      valueExpression =\n        \"(typeof \" + baseValueExpression + \" === 'string'\" +\n        \"? \" + baseValueExpression + \".trim()\" +\n        \": \" + baseValueExpression + \")\";\n    }\n    if (number) {\n      valueExpression = \"_n(\" + valueExpression + \")\";\n    }\n    var assignment = genAssignmentCode(value, valueExpression);\n\n    el.model = {\n      value: (\"(\" + value + \")\"),\n      expression: JSON.stringify(value),\n      callback: (\"function (\" + baseValueExpression + \") {\" + assignment + \"}\")\n    };\n  }\n\n  /**\n   * Cross-platform codegen helper for generating v-model value assignment code.\n   */\n  function genAssignmentCode (\n    value,\n    assignment\n  ) {\n    var res = parseModel(value);\n    if (res.key === null) {\n      return (value + \"=\" + assignment)\n    } else {\n      return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n    }\n  }\n\n  /**\n   * Parse a v-model expression into a base path and a final key segment.\n   * Handles both dot-path and possible square brackets.\n   *\n   * Possible cases:\n   *\n   * - test\n   * - test[key]\n   * - test[test1[key]]\n   * - test[\"a\"][key]\n   * - xxx.test[a[a].test1[key]]\n   * - test.xxx.a[\"asa\"][test1[key]]\n   *\n   */\n\n  var len, str, chr, index$1, expressionPos, expressionEndPos;\n\n\n\n  function parseModel (val) {\n    // Fix https://github.com/vuejs/vue/pull/7730\n    // allow v-model=\"obj.val \" (trailing whitespace)\n    val = val.trim();\n    len = val.length;\n\n    if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n      index$1 = val.lastIndexOf('.');\n      if (index$1 > -1) {\n        return {\n          exp: val.slice(0, index$1),\n          key: '\"' + val.slice(index$1 + 1) + '\"'\n        }\n      } else {\n        return {\n          exp: val,\n          key: null\n        }\n      }\n    }\n\n    str = val;\n    index$1 = expressionPos = expressionEndPos = 0;\n\n    while (!eof()) {\n      chr = next();\n      /* istanbul ignore if */\n      if (isStringStart(chr)) {\n        parseString(chr);\n      } else if (chr === 0x5B) {\n        parseBracket(chr);\n      }\n    }\n\n    return {\n      exp: val.slice(0, expressionPos),\n      key: val.slice(expressionPos + 1, expressionEndPos)\n    }\n  }\n\n  function next () {\n    return str.charCodeAt(++index$1)\n  }\n\n  function eof () {\n    return index$1 >= len\n  }\n\n  function isStringStart (chr) {\n    return chr === 0x22 || chr === 0x27\n  }\n\n  function parseBracket (chr) {\n    var inBracket = 1;\n    expressionPos = index$1;\n    while (!eof()) {\n      chr = next();\n      if (isStringStart(chr)) {\n        parseString(chr);\n        continue\n      }\n      if (chr === 0x5B) { inBracket++; }\n      if (chr === 0x5D) { inBracket--; }\n      if (inBracket === 0) {\n        expressionEndPos = index$1;\n        break\n      }\n    }\n  }\n\n  function parseString (chr) {\n    var stringQuote = chr;\n    while (!eof()) {\n      chr = next();\n      if (chr === stringQuote) {\n        break\n      }\n    }\n  }\n\n  /*  */\n\n  var warn$1;\n\n  // in some cases, the event used has to be determined at runtime\n  // so we used some reserved tokens during compile.\n  var RANGE_TOKEN = '__r';\n  var CHECKBOX_RADIO_TOKEN = '__c';\n\n  function model (\n    el,\n    dir,\n    _warn\n  ) {\n    warn$1 = _warn;\n    var value = dir.value;\n    var modifiers = dir.modifiers;\n    var tag = el.tag;\n    var type = el.attrsMap.type;\n\n    {\n      // inputs with type=\"file\" are read only and setting the input's\n      // value will throw an error.\n      if (tag === 'input' && type === 'file') {\n        warn$1(\n          \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n          \"File inputs are read only. Use a v-on:change listener instead.\",\n          el.rawAttrsMap['v-model']\n        );\n      }\n    }\n\n    if (el.component) {\n      genComponentModel(el, value, modifiers);\n      // component v-model doesn't need extra runtime\n      return false\n    } else if (tag === 'select') {\n      genSelect(el, value, modifiers);\n    } else if (tag === 'input' && type === 'checkbox') {\n      genCheckboxModel(el, value, modifiers);\n    } else if (tag === 'input' && type === 'radio') {\n      genRadioModel(el, value, modifiers);\n    } else if (tag === 'input' || tag === 'textarea') {\n      genDefaultModel(el, value, modifiers);\n    } else if (!config.isReservedTag(tag)) {\n      genComponentModel(el, value, modifiers);\n      // component v-model doesn't need extra runtime\n      return false\n    } else {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"v-model is not supported on this element type. \" +\n        'If you are working with contenteditable, it\\'s recommended to ' +\n        'wrap a library dedicated for that purpose inside a custom component.',\n        el.rawAttrsMap['v-model']\n      );\n    }\n\n    // ensure runtime directive metadata\n    return true\n  }\n\n  function genCheckboxModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var valueBinding = getBindingAttr(el, 'value') || 'null';\n    var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n    var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n    addProp(el, 'checked',\n      \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" + (\n        trueValueBinding === 'true'\n          ? (\":(\" + value + \")\")\n          : (\":_q(\" + value + \",\" + trueValueBinding + \")\")\n      )\n    );\n    addHandler(el, 'change',\n      \"var $$a=\" + value + \",\" +\n          '$$el=$event.target,' +\n          \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n      'if(Array.isArray($$a)){' +\n        \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n            '$$i=_i($$a,$$v);' +\n        \"if($$el.checked){$$i<0&&(\" + (genAssignmentCode(value, '$$a.concat([$$v])')) + \")}\" +\n        \"else{$$i>-1&&(\" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + \")}\" +\n      \"}else{\" + (genAssignmentCode(value, '$$c')) + \"}\",\n      null, true\n    );\n  }\n\n  function genRadioModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var valueBinding = getBindingAttr(el, 'value') || 'null';\n    valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n    addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n    addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n  }\n\n  function genSelect (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var selectedVal = \"Array.prototype.filter\" +\n      \".call($event.target.options,function(o){return o.selected})\" +\n      \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n      \"return \" + (number ? '_n(val)' : 'val') + \"})\";\n\n    var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';\n    var code = \"var $$selectedVal = \" + selectedVal + \";\";\n    code = code + \" \" + (genAssignmentCode(value, assignment));\n    addHandler(el, 'change', code, null, true);\n  }\n\n  function genDefaultModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var type = el.attrsMap.type;\n\n    // warn if v-bind:value conflicts with v-model\n    // except for inputs with v-bind:type\n    {\n      var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];\n      var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n      if (value$1 && !typeBinding) {\n        var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';\n        warn$1(\n          binding + \"=\\\"\" + value$1 + \"\\\" conflicts with v-model on the same element \" +\n          'because the latter already expands to a value binding internally',\n          el.rawAttrsMap[binding]\n        );\n      }\n    }\n\n    var ref = modifiers || {};\n    var lazy = ref.lazy;\n    var number = ref.number;\n    var trim = ref.trim;\n    var needCompositionGuard = !lazy && type !== 'range';\n    var event = lazy\n      ? 'change'\n      : type === 'range'\n        ? RANGE_TOKEN\n        : 'input';\n\n    var valueExpression = '$event.target.value';\n    if (trim) {\n      valueExpression = \"$event.target.value.trim()\";\n    }\n    if (number) {\n      valueExpression = \"_n(\" + valueExpression + \")\";\n    }\n\n    var code = genAssignmentCode(value, valueExpression);\n    if (needCompositionGuard) {\n      code = \"if($event.target.composing)return;\" + code;\n    }\n\n    addProp(el, 'value', (\"(\" + value + \")\"));\n    addHandler(el, event, code, null, true);\n    if (trim || number) {\n      addHandler(el, 'blur', '$forceUpdate()');\n    }\n  }\n\n  /*  */\n\n  // normalize v-model event tokens that can only be determined at runtime.\n  // it's important to place the event as the first in the array because\n  // the whole point is ensuring the v-model callback gets called before\n  // user-attached handlers.\n  function normalizeEvents (on) {\n    /* istanbul ignore if */\n    if (isDef(on[RANGE_TOKEN])) {\n      // IE input[type=range] only supports `change` event\n      var event = isIE ? 'change' : 'input';\n      on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);\n      delete on[RANGE_TOKEN];\n    }\n    // This was originally intended to fix #4521 but no longer necessary\n    // after 2.5. Keeping it for backwards compat with generated code from < 2.4\n    /* istanbul ignore if */\n    if (isDef(on[CHECKBOX_RADIO_TOKEN])) {\n      on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);\n      delete on[CHECKBOX_RADIO_TOKEN];\n    }\n  }\n\n  var target$1;\n\n  function createOnceHandler$1 (event, handler, capture) {\n    var _target = target$1; // save current target element in closure\n    return function onceHandler () {\n      var res = handler.apply(null, arguments);\n      if (res !== null) {\n        remove$2(event, onceHandler, capture, _target);\n      }\n    }\n  }\n\n  // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp\n  // implementation and does not fire microtasks in between event propagation, so\n  // safe to exclude.\n  var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);\n\n  function add$1 (\n    name,\n    handler,\n    capture,\n    passive\n  ) {\n    // async edge case #6566: inner click event triggers patch, event handler\n    // attached to outer element during patch, and triggered again. This\n    // happens because browsers fire microtask ticks between event propagation.\n    // the solution is simple: we save the timestamp when a handler is attached,\n    // and the handler would only fire if the event passed to it was fired\n    // AFTER it was attached.\n    if (useMicrotaskFix) {\n      var attachedTimestamp = currentFlushTimestamp;\n      var original = handler;\n      handler = original._wrapper = function (e) {\n        if (\n          // no bubbling, should always fire.\n          // this is just a safety net in case event.timeStamp is unreliable in\n          // certain weird environments...\n          e.target === e.currentTarget ||\n          // event is fired after handler attachment\n          e.timeStamp >= attachedTimestamp ||\n          // #9462 bail for iOS 9 bug: event.timeStamp is 0 after history.pushState\n          e.timeStamp === 0 ||\n          // #9448 bail if event is fired in another document in a multi-page\n          // electron/nw.js app, since event.timeStamp will be using a different\n          // starting reference\n          e.target.ownerDocument !== document\n        ) {\n          return original.apply(this, arguments)\n        }\n      };\n    }\n    target$1.addEventListener(\n      name,\n      handler,\n      supportsPassive\n        ? { capture: capture, passive: passive }\n        : capture\n    );\n  }\n\n  function remove$2 (\n    name,\n    handler,\n    capture,\n    _target\n  ) {\n    (_target || target$1).removeEventListener(\n      name,\n      handler._wrapper || handler,\n      capture\n    );\n  }\n\n  function updateDOMListeners (oldVnode, vnode) {\n    if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {\n      return\n    }\n    var on = vnode.data.on || {};\n    var oldOn = oldVnode.data.on || {};\n    target$1 = vnode.elm;\n    normalizeEvents(on);\n    updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);\n    target$1 = undefined;\n  }\n\n  var events = {\n    create: updateDOMListeners,\n    update: updateDOMListeners\n  };\n\n  /*  */\n\n  var svgContainer;\n\n  function updateDOMProps (oldVnode, vnode) {\n    if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {\n      return\n    }\n    var key, cur;\n    var elm = vnode.elm;\n    var oldProps = oldVnode.data.domProps || {};\n    var props = vnode.data.domProps || {};\n    // clone observed objects, as the user probably wants to mutate it\n    if (isDef(props.__ob__)) {\n      props = vnode.data.domProps = extend({}, props);\n    }\n\n    for (key in oldProps) {\n      if (isUndef(props[key])) {\n        elm[key] = '';\n      }\n    }\n    for (key in props) {\n      cur = props[key];\n      // ignore children if the node has textContent or innerHTML,\n      // as these will throw away existing DOM nodes and cause removal errors\n      // on subsequent patches (#3360)\n      if (key === 'textContent' || key === 'innerHTML') {\n        if (vnode.children) { vnode.children.length = 0; }\n        if (cur === oldProps[key]) { continue }\n        // #6601 work around Chrome version <= 55 bug where single textNode\n        // replaced by innerHTML/textContent retains its parentNode property\n        if (elm.childNodes.length === 1) {\n          elm.removeChild(elm.childNodes[0]);\n        }\n      }\n\n      if (key === 'value' && elm.tagName !== 'PROGRESS') {\n        // store value as _value as well since\n        // non-string values will be stringified\n        elm._value = cur;\n        // avoid resetting cursor position when value is the same\n        var strCur = isUndef(cur) ? '' : String(cur);\n        if (shouldUpdateValue(elm, strCur)) {\n          elm.value = strCur;\n        }\n      } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {\n        // IE doesn't support innerHTML for SVG elements\n        svgContainer = svgContainer || document.createElement('div');\n        svgContainer.innerHTML = \"<svg>\" + cur + \"</svg>\";\n        var svg = svgContainer.firstChild;\n        while (elm.firstChild) {\n          elm.removeChild(elm.firstChild);\n        }\n        while (svg.firstChild) {\n          elm.appendChild(svg.firstChild);\n        }\n      } else if (\n        // skip the update if old and new VDOM state is the same.\n        // `value` is handled separately because the DOM value may be temporarily\n        // out of sync with VDOM state due to focus, composition and modifiers.\n        // This  #4521 by skipping the unnecesarry `checked` update.\n        cur !== oldProps[key]\n      ) {\n        // some property updates can throw\n        // e.g. `value` on <progress> w/ non-finite value\n        try {\n          elm[key] = cur;\n        } catch (e) {}\n      }\n    }\n  }\n\n  // check platforms/web/util/attrs.js acceptValue\n\n\n  function shouldUpdateValue (elm, checkVal) {\n    return (!elm.composing && (\n      elm.tagName === 'OPTION' ||\n      isNotInFocusAndDirty(elm, checkVal) ||\n      isDirtyWithModifiers(elm, checkVal)\n    ))\n  }\n\n  function isNotInFocusAndDirty (elm, checkVal) {\n    // return true when textbox (.number and .trim) loses focus and its value is\n    // not equal to the updated value\n    var notInFocus = true;\n    // #6157\n    // work around IE bug when accessing document.activeElement in an iframe\n    try { notInFocus = document.activeElement !== elm; } catch (e) {}\n    return notInFocus && elm.value !== checkVal\n  }\n\n  function isDirtyWithModifiers (elm, newVal) {\n    var value = elm.value;\n    var modifiers = elm._vModifiers; // injected by v-model runtime\n    if (isDef(modifiers)) {\n      if (modifiers.number) {\n        return toNumber(value) !== toNumber(newVal)\n      }\n      if (modifiers.trim) {\n        return value.trim() !== newVal.trim()\n      }\n    }\n    return value !== newVal\n  }\n\n  var domProps = {\n    create: updateDOMProps,\n    update: updateDOMProps\n  };\n\n  /*  */\n\n  var parseStyleText = cached(function (cssText) {\n    var res = {};\n    var listDelimiter = /;(?![^(]*\\))/g;\n    var propertyDelimiter = /:(.+)/;\n    cssText.split(listDelimiter).forEach(function (item) {\n      if (item) {\n        var tmp = item.split(propertyDelimiter);\n        tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n      }\n    });\n    return res\n  });\n\n  // merge static and dynamic style data on the same vnode\n  function normalizeStyleData (data) {\n    var style = normalizeStyleBinding(data.style);\n    // static style is pre-processed into an object during compilation\n    // and is always a fresh object, so it's safe to merge into it\n    return data.staticStyle\n      ? extend(data.staticStyle, style)\n      : style\n  }\n\n  // normalize possible array / string values into Object\n  function normalizeStyleBinding (bindingStyle) {\n    if (Array.isArray(bindingStyle)) {\n      return toObject(bindingStyle)\n    }\n    if (typeof bindingStyle === 'string') {\n      return parseStyleText(bindingStyle)\n    }\n    return bindingStyle\n  }\n\n  /**\n   * parent component style should be after child's\n   * so that parent component's style could override it\n   */\n  function getStyle (vnode, checkChild) {\n    var res = {};\n    var styleData;\n\n    if (checkChild) {\n      var childNode = vnode;\n      while (childNode.componentInstance) {\n        childNode = childNode.componentInstance._vnode;\n        if (\n          childNode && childNode.data &&\n          (styleData = normalizeStyleData(childNode.data))\n        ) {\n          extend(res, styleData);\n        }\n      }\n    }\n\n    if ((styleData = normalizeStyleData(vnode.data))) {\n      extend(res, styleData);\n    }\n\n    var parentNode = vnode;\n    while ((parentNode = parentNode.parent)) {\n      if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n        extend(res, styleData);\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  var cssVarRE = /^--/;\n  var importantRE = /\\s*!important$/;\n  var setProp = function (el, name, val) {\n    /* istanbul ignore if */\n    if (cssVarRE.test(name)) {\n      el.style.setProperty(name, val);\n    } else if (importantRE.test(val)) {\n      el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');\n    } else {\n      var normalizedName = normalize(name);\n      if (Array.isArray(val)) {\n        // Support values array created by autoprefixer, e.g.\n        // {display: [\"-webkit-box\", \"-ms-flexbox\", \"flex\"]}\n        // Set them one by one, and the browser will only set those it can recognize\n        for (var i = 0, len = val.length; i < len; i++) {\n          el.style[normalizedName] = val[i];\n        }\n      } else {\n        el.style[normalizedName] = val;\n      }\n    }\n  };\n\n  var vendorNames = ['Webkit', 'Moz', 'ms'];\n\n  var emptyStyle;\n  var normalize = cached(function (prop) {\n    emptyStyle = emptyStyle || document.createElement('div').style;\n    prop = camelize(prop);\n    if (prop !== 'filter' && (prop in emptyStyle)) {\n      return prop\n    }\n    var capName = prop.charAt(0).toUpperCase() + prop.slice(1);\n    for (var i = 0; i < vendorNames.length; i++) {\n      var name = vendorNames[i] + capName;\n      if (name in emptyStyle) {\n        return name\n      }\n    }\n  });\n\n  function updateStyle (oldVnode, vnode) {\n    var data = vnode.data;\n    var oldData = oldVnode.data;\n\n    if (isUndef(data.staticStyle) && isUndef(data.style) &&\n      isUndef(oldData.staticStyle) && isUndef(oldData.style)\n    ) {\n      return\n    }\n\n    var cur, name;\n    var el = vnode.elm;\n    var oldStaticStyle = oldData.staticStyle;\n    var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};\n\n    // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n    var oldStyle = oldStaticStyle || oldStyleBinding;\n\n    var style = normalizeStyleBinding(vnode.data.style) || {};\n\n    // store normalized style under a different key for next diff\n    // make sure to clone it if it's reactive, since the user likely wants\n    // to mutate it.\n    vnode.data.normalizedStyle = isDef(style.__ob__)\n      ? extend({}, style)\n      : style;\n\n    var newStyle = getStyle(vnode, true);\n\n    for (name in oldStyle) {\n      if (isUndef(newStyle[name])) {\n        setProp(el, name, '');\n      }\n    }\n    for (name in newStyle) {\n      cur = newStyle[name];\n      if (cur !== oldStyle[name]) {\n        // ie9 setting to null has no effect, must use empty string\n        setProp(el, name, cur == null ? '' : cur);\n      }\n    }\n  }\n\n  var style = {\n    create: updateStyle,\n    update: updateStyle\n  };\n\n  /*  */\n\n  var whitespaceRE = /\\s+/;\n\n  /**\n   * Add class with compatibility for SVG since classList is not supported on\n   * SVG elements in IE\n   */\n  function addClass (el, cls) {\n    /* istanbul ignore if */\n    if (!cls || !(cls = cls.trim())) {\n      return\n    }\n\n    /* istanbul ignore else */\n    if (el.classList) {\n      if (cls.indexOf(' ') > -1) {\n        cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });\n      } else {\n        el.classList.add(cls);\n      }\n    } else {\n      var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n      if (cur.indexOf(' ' + cls + ' ') < 0) {\n        el.setAttribute('class', (cur + cls).trim());\n      }\n    }\n  }\n\n  /**\n   * Remove class with compatibility for SVG since classList is not supported on\n   * SVG elements in IE\n   */\n  function removeClass (el, cls) {\n    /* istanbul ignore if */\n    if (!cls || !(cls = cls.trim())) {\n      return\n    }\n\n    /* istanbul ignore else */\n    if (el.classList) {\n      if (cls.indexOf(' ') > -1) {\n        cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });\n      } else {\n        el.classList.remove(cls);\n      }\n      if (!el.classList.length) {\n        el.removeAttribute('class');\n      }\n    } else {\n      var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n      var tar = ' ' + cls + ' ';\n      while (cur.indexOf(tar) >= 0) {\n        cur = cur.replace(tar, ' ');\n      }\n      cur = cur.trim();\n      if (cur) {\n        el.setAttribute('class', cur);\n      } else {\n        el.removeAttribute('class');\n      }\n    }\n  }\n\n  /*  */\n\n  function resolveTransition (def$$1) {\n    if (!def$$1) {\n      return\n    }\n    /* istanbul ignore else */\n    if (typeof def$$1 === 'object') {\n      var res = {};\n      if (def$$1.css !== false) {\n        extend(res, autoCssTransition(def$$1.name || 'v'));\n      }\n      extend(res, def$$1);\n      return res\n    } else if (typeof def$$1 === 'string') {\n      return autoCssTransition(def$$1)\n    }\n  }\n\n  var autoCssTransition = cached(function (name) {\n    return {\n      enterClass: (name + \"-enter\"),\n      enterToClass: (name + \"-enter-to\"),\n      enterActiveClass: (name + \"-enter-active\"),\n      leaveClass: (name + \"-leave\"),\n      leaveToClass: (name + \"-leave-to\"),\n      leaveActiveClass: (name + \"-leave-active\")\n    }\n  });\n\n  var hasTransition = inBrowser && !isIE9;\n  var TRANSITION = 'transition';\n  var ANIMATION = 'animation';\n\n  // Transition property/event sniffing\n  var transitionProp = 'transition';\n  var transitionEndEvent = 'transitionend';\n  var animationProp = 'animation';\n  var animationEndEvent = 'animationend';\n  if (hasTransition) {\n    /* istanbul ignore if */\n    if (window.ontransitionend === undefined &&\n      window.onwebkittransitionend !== undefined\n    ) {\n      transitionProp = 'WebkitTransition';\n      transitionEndEvent = 'webkitTransitionEnd';\n    }\n    if (window.onanimationend === undefined &&\n      window.onwebkitanimationend !== undefined\n    ) {\n      animationProp = 'WebkitAnimation';\n      animationEndEvent = 'webkitAnimationEnd';\n    }\n  }\n\n  // binding to window is necessary to make hot reload work in IE in strict mode\n  var raf = inBrowser\n    ? window.requestAnimationFrame\n      ? window.requestAnimationFrame.bind(window)\n      : setTimeout\n    : /* istanbul ignore next */ function (fn) { return fn(); };\n\n  function nextFrame (fn) {\n    raf(function () {\n      raf(fn);\n    });\n  }\n\n  function addTransitionClass (el, cls) {\n    var transitionClasses = el._transitionClasses || (el._transitionClasses = []);\n    if (transitionClasses.indexOf(cls) < 0) {\n      transitionClasses.push(cls);\n      addClass(el, cls);\n    }\n  }\n\n  function removeTransitionClass (el, cls) {\n    if (el._transitionClasses) {\n      remove(el._transitionClasses, cls);\n    }\n    removeClass(el, cls);\n  }\n\n  function whenTransitionEnds (\n    el,\n    expectedType,\n    cb\n  ) {\n    var ref = getTransitionInfo(el, expectedType);\n    var type = ref.type;\n    var timeout = ref.timeout;\n    var propCount = ref.propCount;\n    if (!type) { return cb() }\n    var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n    var ended = 0;\n    var end = function () {\n      el.removeEventListener(event, onEnd);\n      cb();\n    };\n    var onEnd = function (e) {\n      if (e.target === el) {\n        if (++ended >= propCount) {\n          end();\n        }\n      }\n    };\n    setTimeout(function () {\n      if (ended < propCount) {\n        end();\n      }\n    }, timeout + 1);\n    el.addEventListener(event, onEnd);\n  }\n\n  var transformRE = /\\b(transform|all)(,|$)/;\n\n  function getTransitionInfo (el, expectedType) {\n    var styles = window.getComputedStyle(el);\n    // JSDOM may return undefined for transition properties\n    var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');\n    var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');\n    var transitionTimeout = getTimeout(transitionDelays, transitionDurations);\n    var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');\n    var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');\n    var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n    var type;\n    var timeout = 0;\n    var propCount = 0;\n    /* istanbul ignore if */\n    if (expectedType === TRANSITION) {\n      if (transitionTimeout > 0) {\n        type = TRANSITION;\n        timeout = transitionTimeout;\n        propCount = transitionDurations.length;\n      }\n    } else if (expectedType === ANIMATION) {\n      if (animationTimeout > 0) {\n        type = ANIMATION;\n        timeout = animationTimeout;\n        propCount = animationDurations.length;\n      }\n    } else {\n      timeout = Math.max(transitionTimeout, animationTimeout);\n      type = timeout > 0\n        ? transitionTimeout > animationTimeout\n          ? TRANSITION\n          : ANIMATION\n        : null;\n      propCount = type\n        ? type === TRANSITION\n          ? transitionDurations.length\n          : animationDurations.length\n        : 0;\n    }\n    var hasTransform =\n      type === TRANSITION &&\n      transformRE.test(styles[transitionProp + 'Property']);\n    return {\n      type: type,\n      timeout: timeout,\n      propCount: propCount,\n      hasTransform: hasTransform\n    }\n  }\n\n  function getTimeout (delays, durations) {\n    /* istanbul ignore next */\n    while (delays.length < durations.length) {\n      delays = delays.concat(delays);\n    }\n\n    return Math.max.apply(null, durations.map(function (d, i) {\n      return toMs(d) + toMs(delays[i])\n    }))\n  }\n\n  // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers\n  // in a locale-dependent way, using a comma instead of a dot.\n  // If comma is not replaced with a dot, the input will be rounded down (i.e. acting\n  // as a floor function) causing unexpected behaviors\n  function toMs (s) {\n    return Number(s.slice(0, -1).replace(',', '.')) * 1000\n  }\n\n  /*  */\n\n  function enter (vnode, toggleDisplay) {\n    var el = vnode.elm;\n\n    // call leave callback now\n    if (isDef(el._leaveCb)) {\n      el._leaveCb.cancelled = true;\n      el._leaveCb();\n    }\n\n    var data = resolveTransition(vnode.data.transition);\n    if (isUndef(data)) {\n      return\n    }\n\n    /* istanbul ignore if */\n    if (isDef(el._enterCb) || el.nodeType !== 1) {\n      return\n    }\n\n    var css = data.css;\n    var type = data.type;\n    var enterClass = data.enterClass;\n    var enterToClass = data.enterToClass;\n    var enterActiveClass = data.enterActiveClass;\n    var appearClass = data.appearClass;\n    var appearToClass = data.appearToClass;\n    var appearActiveClass = data.appearActiveClass;\n    var beforeEnter = data.beforeEnter;\n    var enter = data.enter;\n    var afterEnter = data.afterEnter;\n    var enterCancelled = data.enterCancelled;\n    var beforeAppear = data.beforeAppear;\n    var appear = data.appear;\n    var afterAppear = data.afterAppear;\n    var appearCancelled = data.appearCancelled;\n    var duration = data.duration;\n\n    // activeInstance will always be the <transition> component managing this\n    // transition. One edge case to check is when the <transition> is placed\n    // as the root node of a child component. In that case we need to check\n    // <transition>'s parent for appear check.\n    var context = activeInstance;\n    var transitionNode = activeInstance.$vnode;\n    while (transitionNode && transitionNode.parent) {\n      transitionNode = transitionNode.parent;\n      context = transitionNode.context;\n    }\n\n    var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n    if (isAppear && !appear && appear !== '') {\n      return\n    }\n\n    var startClass = isAppear && appearClass\n      ? appearClass\n      : enterClass;\n    var activeClass = isAppear && appearActiveClass\n      ? appearActiveClass\n      : enterActiveClass;\n    var toClass = isAppear && appearToClass\n      ? appearToClass\n      : enterToClass;\n\n    var beforeEnterHook = isAppear\n      ? (beforeAppear || beforeEnter)\n      : beforeEnter;\n    var enterHook = isAppear\n      ? (typeof appear === 'function' ? appear : enter)\n      : enter;\n    var afterEnterHook = isAppear\n      ? (afterAppear || afterEnter)\n      : afterEnter;\n    var enterCancelledHook = isAppear\n      ? (appearCancelled || enterCancelled)\n      : enterCancelled;\n\n    var explicitEnterDuration = toNumber(\n      isObject(duration)\n        ? duration.enter\n        : duration\n    );\n\n    if (explicitEnterDuration != null) {\n      checkDuration(explicitEnterDuration, 'enter', vnode);\n    }\n\n    var expectsCSS = css !== false && !isIE9;\n    var userWantsControl = getHookArgumentsLength(enterHook);\n\n    var cb = el._enterCb = once(function () {\n      if (expectsCSS) {\n        removeTransitionClass(el, toClass);\n        removeTransitionClass(el, activeClass);\n      }\n      if (cb.cancelled) {\n        if (expectsCSS) {\n          removeTransitionClass(el, startClass);\n        }\n        enterCancelledHook && enterCancelledHook(el);\n      } else {\n        afterEnterHook && afterEnterHook(el);\n      }\n      el._enterCb = null;\n    });\n\n    if (!vnode.data.show) {\n      // remove pending leave element on enter by injecting an insert hook\n      mergeVNodeHook(vnode, 'insert', function () {\n        var parent = el.parentNode;\n        var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n        if (pendingNode &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb\n        ) {\n          pendingNode.elm._leaveCb();\n        }\n        enterHook && enterHook(el, cb);\n      });\n    }\n\n    // start enter transition\n    beforeEnterHook && beforeEnterHook(el);\n    if (expectsCSS) {\n      addTransitionClass(el, startClass);\n      addTransitionClass(el, activeClass);\n      nextFrame(function () {\n        removeTransitionClass(el, startClass);\n        if (!cb.cancelled) {\n          addTransitionClass(el, toClass);\n          if (!userWantsControl) {\n            if (isValidDuration(explicitEnterDuration)) {\n              setTimeout(cb, explicitEnterDuration);\n            } else {\n              whenTransitionEnds(el, type, cb);\n            }\n          }\n        }\n      });\n    }\n\n    if (vnode.data.show) {\n      toggleDisplay && toggleDisplay();\n      enterHook && enterHook(el, cb);\n    }\n\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n\n  function leave (vnode, rm) {\n    var el = vnode.elm;\n\n    // call enter callback now\n    if (isDef(el._enterCb)) {\n      el._enterCb.cancelled = true;\n      el._enterCb();\n    }\n\n    var data = resolveTransition(vnode.data.transition);\n    if (isUndef(data) || el.nodeType !== 1) {\n      return rm()\n    }\n\n    /* istanbul ignore if */\n    if (isDef(el._leaveCb)) {\n      return\n    }\n\n    var css = data.css;\n    var type = data.type;\n    var leaveClass = data.leaveClass;\n    var leaveToClass = data.leaveToClass;\n    var leaveActiveClass = data.leaveActiveClass;\n    var beforeLeave = data.beforeLeave;\n    var leave = data.leave;\n    var afterLeave = data.afterLeave;\n    var leaveCancelled = data.leaveCancelled;\n    var delayLeave = data.delayLeave;\n    var duration = data.duration;\n\n    var expectsCSS = css !== false && !isIE9;\n    var userWantsControl = getHookArgumentsLength(leave);\n\n    var explicitLeaveDuration = toNumber(\n      isObject(duration)\n        ? duration.leave\n        : duration\n    );\n\n    if (isDef(explicitLeaveDuration)) {\n      checkDuration(explicitLeaveDuration, 'leave', vnode);\n    }\n\n    var cb = el._leaveCb = once(function () {\n      if (el.parentNode && el.parentNode._pending) {\n        el.parentNode._pending[vnode.key] = null;\n      }\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveToClass);\n        removeTransitionClass(el, leaveActiveClass);\n      }\n      if (cb.cancelled) {\n        if (expectsCSS) {\n          removeTransitionClass(el, leaveClass);\n        }\n        leaveCancelled && leaveCancelled(el);\n      } else {\n        rm();\n        afterLeave && afterLeave(el);\n      }\n      el._leaveCb = null;\n    });\n\n    if (delayLeave) {\n      delayLeave(performLeave);\n    } else {\n      performLeave();\n    }\n\n    function performLeave () {\n      // the delayed leave may have already been cancelled\n      if (cb.cancelled) {\n        return\n      }\n      // record leaving element\n      if (!vnode.data.show && el.parentNode) {\n        (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;\n      }\n      beforeLeave && beforeLeave(el);\n      if (expectsCSS) {\n        addTransitionClass(el, leaveClass);\n        addTransitionClass(el, leaveActiveClass);\n        nextFrame(function () {\n          removeTransitionClass(el, leaveClass);\n          if (!cb.cancelled) {\n            addTransitionClass(el, leaveToClass);\n            if (!userWantsControl) {\n              if (isValidDuration(explicitLeaveDuration)) {\n                setTimeout(cb, explicitLeaveDuration);\n              } else {\n                whenTransitionEnds(el, type, cb);\n              }\n            }\n          }\n        });\n      }\n      leave && leave(el, cb);\n      if (!expectsCSS && !userWantsControl) {\n        cb();\n      }\n    }\n  }\n\n  // only used in dev mode\n  function checkDuration (val, name, vnode) {\n    if (typeof val !== 'number') {\n      warn(\n        \"<transition> explicit \" + name + \" duration is not a valid number - \" +\n        \"got \" + (JSON.stringify(val)) + \".\",\n        vnode.context\n      );\n    } else if (isNaN(val)) {\n      warn(\n        \"<transition> explicit \" + name + \" duration is NaN - \" +\n        'the duration expression might be incorrect.',\n        vnode.context\n      );\n    }\n  }\n\n  function isValidDuration (val) {\n    return typeof val === 'number' && !isNaN(val)\n  }\n\n  /**\n   * Normalize a transition hook's argument length. The hook may be:\n   * - a merged hook (invoker) with the original in .fns\n   * - a wrapped component method (check ._length)\n   * - a plain function (.length)\n   */\n  function getHookArgumentsLength (fn) {\n    if (isUndef(fn)) {\n      return false\n    }\n    var invokerFns = fn.fns;\n    if (isDef(invokerFns)) {\n      // invoker\n      return getHookArgumentsLength(\n        Array.isArray(invokerFns)\n          ? invokerFns[0]\n          : invokerFns\n      )\n    } else {\n      return (fn._length || fn.length) > 1\n    }\n  }\n\n  function _enter (_, vnode) {\n    if (vnode.data.show !== true) {\n      enter(vnode);\n    }\n  }\n\n  var transition = inBrowser ? {\n    create: _enter,\n    activate: _enter,\n    remove: function remove$$1 (vnode, rm) {\n      /* istanbul ignore else */\n      if (vnode.data.show !== true) {\n        leave(vnode, rm);\n      } else {\n        rm();\n      }\n    }\n  } : {};\n\n  var platformModules = [\n    attrs,\n    klass,\n    events,\n    domProps,\n    style,\n    transition\n  ];\n\n  /*  */\n\n  // the directive module should be applied last, after all\n  // built-in modules have been applied.\n  var modules = platformModules.concat(baseModules);\n\n  var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n  /**\n   * Not type checking this file because flow doesn't like attaching\n   * properties to Elements.\n   */\n\n  /* istanbul ignore if */\n  if (isIE9) {\n    // http://www.matts411.com/post/internet-explorer-9-oninput/\n    document.addEventListener('selectionchange', function () {\n      var el = document.activeElement;\n      if (el && el.vmodel) {\n        trigger(el, 'input');\n      }\n    });\n  }\n\n  var directive = {\n    inserted: function inserted (el, binding, vnode, oldVnode) {\n      if (vnode.tag === 'select') {\n        // #6903\n        if (oldVnode.elm && !oldVnode.elm._vOptions) {\n          mergeVNodeHook(vnode, 'postpatch', function () {\n            directive.componentUpdated(el, binding, vnode);\n          });\n        } else {\n          setSelected(el, binding, vnode.context);\n        }\n        el._vOptions = [].map.call(el.options, getValue);\n      } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {\n        el._vModifiers = binding.modifiers;\n        if (!binding.modifiers.lazy) {\n          el.addEventListener('compositionstart', onCompositionStart);\n          el.addEventListener('compositionend', onCompositionEnd);\n          // Safari < 10.2 & UIWebView doesn't fire compositionend when\n          // switching focus before confirming composition choice\n          // this also fixes the issue where some browsers e.g. iOS Chrome\n          // fires \"change\" instead of \"input\" on autocomplete.\n          el.addEventListener('change', onCompositionEnd);\n          /* istanbul ignore if */\n          if (isIE9) {\n            el.vmodel = true;\n          }\n        }\n      }\n    },\n\n    componentUpdated: function componentUpdated (el, binding, vnode) {\n      if (vnode.tag === 'select') {\n        setSelected(el, binding, vnode.context);\n        // in case the options rendered by v-for have changed,\n        // it's possible that the value is out-of-sync with the rendered options.\n        // detect such cases and filter out values that no longer has a matching\n        // option in the DOM.\n        var prevOptions = el._vOptions;\n        var curOptions = el._vOptions = [].map.call(el.options, getValue);\n        if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {\n          // trigger change event if\n          // no matching option found for at least one value\n          var needReset = el.multiple\n            ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })\n            : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);\n          if (needReset) {\n            trigger(el, 'change');\n          }\n        }\n      }\n    }\n  };\n\n  function setSelected (el, binding, vm) {\n    actuallySetSelected(el, binding, vm);\n    /* istanbul ignore if */\n    if (isIE || isEdge) {\n      setTimeout(function () {\n        actuallySetSelected(el, binding, vm);\n      }, 0);\n    }\n  }\n\n  function actuallySetSelected (el, binding, vm) {\n    var value = binding.value;\n    var isMultiple = el.multiple;\n    if (isMultiple && !Array.isArray(value)) {\n      warn(\n        \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n        \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n        vm\n      );\n      return\n    }\n    var selected, option;\n    for (var i = 0, l = el.options.length; i < l; i++) {\n      option = el.options[i];\n      if (isMultiple) {\n        selected = looseIndexOf(value, getValue(option)) > -1;\n        if (option.selected !== selected) {\n          option.selected = selected;\n        }\n      } else {\n        if (looseEqual(getValue(option), value)) {\n          if (el.selectedIndex !== i) {\n            el.selectedIndex = i;\n          }\n          return\n        }\n      }\n    }\n    if (!isMultiple) {\n      el.selectedIndex = -1;\n    }\n  }\n\n  function hasNoMatchingOption (value, options) {\n    return options.every(function (o) { return !looseEqual(o, value); })\n  }\n\n  function getValue (option) {\n    return '_value' in option\n      ? option._value\n      : option.value\n  }\n\n  function onCompositionStart (e) {\n    e.target.composing = true;\n  }\n\n  function onCompositionEnd (e) {\n    // prevent triggering an input event for no reason\n    if (!e.target.composing) { return }\n    e.target.composing = false;\n    trigger(e.target, 'input');\n  }\n\n  function trigger (el, type) {\n    var e = document.createEvent('HTMLEvents');\n    e.initEvent(type, true, true);\n    el.dispatchEvent(e);\n  }\n\n  /*  */\n\n  // recursively search for possible transition defined inside the component root\n  function locateNode (vnode) {\n    return vnode.componentInstance && (!vnode.data || !vnode.data.transition)\n      ? locateNode(vnode.componentInstance._vnode)\n      : vnode\n  }\n\n  var show = {\n    bind: function bind (el, ref, vnode) {\n      var value = ref.value;\n\n      vnode = locateNode(vnode);\n      var transition$$1 = vnode.data && vnode.data.transition;\n      var originalDisplay = el.__vOriginalDisplay =\n        el.style.display === 'none' ? '' : el.style.display;\n      if (value && transition$$1) {\n        vnode.data.show = true;\n        enter(vnode, function () {\n          el.style.display = originalDisplay;\n        });\n      } else {\n        el.style.display = value ? originalDisplay : 'none';\n      }\n    },\n\n    update: function update (el, ref, vnode) {\n      var value = ref.value;\n      var oldValue = ref.oldValue;\n\n      /* istanbul ignore if */\n      if (!value === !oldValue) { return }\n      vnode = locateNode(vnode);\n      var transition$$1 = vnode.data && vnode.data.transition;\n      if (transition$$1) {\n        vnode.data.show = true;\n        if (value) {\n          enter(vnode, function () {\n            el.style.display = el.__vOriginalDisplay;\n          });\n        } else {\n          leave(vnode, function () {\n            el.style.display = 'none';\n          });\n        }\n      } else {\n        el.style.display = value ? el.__vOriginalDisplay : 'none';\n      }\n    },\n\n    unbind: function unbind (\n      el,\n      binding,\n      vnode,\n      oldVnode,\n      isDestroy\n    ) {\n      if (!isDestroy) {\n        el.style.display = el.__vOriginalDisplay;\n      }\n    }\n  };\n\n  var platformDirectives = {\n    model: directive,\n    show: show\n  };\n\n  /*  */\n\n  var transitionProps = {\n    name: String,\n    appear: Boolean,\n    css: Boolean,\n    mode: String,\n    type: String,\n    enterClass: String,\n    leaveClass: String,\n    enterToClass: String,\n    leaveToClass: String,\n    enterActiveClass: String,\n    leaveActiveClass: String,\n    appearClass: String,\n    appearActiveClass: String,\n    appearToClass: String,\n    duration: [Number, String, Object]\n  };\n\n  // in case the child is also an abstract component, e.g. <keep-alive>\n  // we want to recursively retrieve the real component to be rendered\n  function getRealChild (vnode) {\n    var compOptions = vnode && vnode.componentOptions;\n    if (compOptions && compOptions.Ctor.options.abstract) {\n      return getRealChild(getFirstComponentChild(compOptions.children))\n    } else {\n      return vnode\n    }\n  }\n\n  function extractTransitionData (comp) {\n    var data = {};\n    var options = comp.$options;\n    // props\n    for (var key in options.propsData) {\n      data[key] = comp[key];\n    }\n    // events.\n    // extract listeners and pass them directly to the transition methods\n    var listeners = options._parentListeners;\n    for (var key$1 in listeners) {\n      data[camelize(key$1)] = listeners[key$1];\n    }\n    return data\n  }\n\n  function placeholder (h, rawChild) {\n    if (/\\d-keep-alive$/.test(rawChild.tag)) {\n      return h('keep-alive', {\n        props: rawChild.componentOptions.propsData\n      })\n    }\n  }\n\n  function hasParentTransition (vnode) {\n    while ((vnode = vnode.parent)) {\n      if (vnode.data.transition) {\n        return true\n      }\n    }\n  }\n\n  function isSameChild (child, oldChild) {\n    return oldChild.key === child.key && oldChild.tag === child.tag\n  }\n\n  var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };\n\n  var isVShowDirective = function (d) { return d.name === 'show'; };\n\n  var Transition = {\n    name: 'transition',\n    props: transitionProps,\n    abstract: true,\n\n    render: function render (h) {\n      var this$1 = this;\n\n      var children = this.$slots.default;\n      if (!children) {\n        return\n      }\n\n      // filter out text nodes (possible whitespaces)\n      children = children.filter(isNotTextNode);\n      /* istanbul ignore if */\n      if (!children.length) {\n        return\n      }\n\n      // warn multiple elements\n      if (children.length > 1) {\n        warn(\n          '<transition> can only be used on a single element. Use ' +\n          '<transition-group> for lists.',\n          this.$parent\n        );\n      }\n\n      var mode = this.mode;\n\n      // warn invalid mode\n      if (mode && mode !== 'in-out' && mode !== 'out-in'\n      ) {\n        warn(\n          'invalid <transition> mode: ' + mode,\n          this.$parent\n        );\n      }\n\n      var rawChild = children[0];\n\n      // if this is a component root node and the component's\n      // parent container node also has transition, skip.\n      if (hasParentTransition(this.$vnode)) {\n        return rawChild\n      }\n\n      // apply transition data to child\n      // use getRealChild() to ignore abstract components e.g. keep-alive\n      var child = getRealChild(rawChild);\n      /* istanbul ignore if */\n      if (!child) {\n        return rawChild\n      }\n\n      if (this._leaving) {\n        return placeholder(h, rawChild)\n      }\n\n      // ensure a key that is unique to the vnode type and to this transition\n      // component instance. This key will be used to remove pending leaving nodes\n      // during entering.\n      var id = \"__transition-\" + (this._uid) + \"-\";\n      child.key = child.key == null\n        ? child.isComment\n          ? id + 'comment'\n          : id + child.tag\n        : isPrimitive(child.key)\n          ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)\n          : child.key;\n\n      var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n      var oldRawChild = this._vnode;\n      var oldChild = getRealChild(oldRawChild);\n\n      // mark v-show\n      // so that the transition module can hand over the control to the directive\n      if (child.data.directives && child.data.directives.some(isVShowDirective)) {\n        child.data.show = true;\n      }\n\n      if (\n        oldChild &&\n        oldChild.data &&\n        !isSameChild(child, oldChild) &&\n        !isAsyncPlaceholder(oldChild) &&\n        // #6687 component root is a comment node\n        !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)\n      ) {\n        // replace old child transition data with fresh one\n        // important for dynamic transitions!\n        var oldData = oldChild.data.transition = extend({}, data);\n        // handle transition mode\n        if (mode === 'out-in') {\n          // return placeholder node and queue update when leave finishes\n          this._leaving = true;\n          mergeVNodeHook(oldData, 'afterLeave', function () {\n            this$1._leaving = false;\n            this$1.$forceUpdate();\n          });\n          return placeholder(h, rawChild)\n        } else if (mode === 'in-out') {\n          if (isAsyncPlaceholder(child)) {\n            return oldRawChild\n          }\n          var delayedLeave;\n          var performLeave = function () { delayedLeave(); };\n          mergeVNodeHook(data, 'afterEnter', performLeave);\n          mergeVNodeHook(data, 'enterCancelled', performLeave);\n          mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });\n        }\n      }\n\n      return rawChild\n    }\n  };\n\n  /*  */\n\n  var props = extend({\n    tag: String,\n    moveClass: String\n  }, transitionProps);\n\n  delete props.mode;\n\n  var TransitionGroup = {\n    props: props,\n\n    beforeMount: function beforeMount () {\n      var this$1 = this;\n\n      var update = this._update;\n      this._update = function (vnode, hydrating) {\n        var restoreActiveInstance = setActiveInstance(this$1);\n        // force removing pass\n        this$1.__patch__(\n          this$1._vnode,\n          this$1.kept,\n          false, // hydrating\n          true // removeOnly (!important, avoids unnecessary moves)\n        );\n        this$1._vnode = this$1.kept;\n        restoreActiveInstance();\n        update.call(this$1, vnode, hydrating);\n      };\n    },\n\n    render: function render (h) {\n      var tag = this.tag || this.$vnode.data.tag || 'span';\n      var map = Object.create(null);\n      var prevChildren = this.prevChildren = this.children;\n      var rawChildren = this.$slots.default || [];\n      var children = this.children = [];\n      var transitionData = extractTransitionData(this);\n\n      for (var i = 0; i < rawChildren.length; i++) {\n        var c = rawChildren[i];\n        if (c.tag) {\n          if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n            children.push(c);\n            map[c.key] = c\n            ;(c.data || (c.data = {})).transition = transitionData;\n          } else {\n            var opts = c.componentOptions;\n            var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;\n            warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n          }\n        }\n      }\n\n      if (prevChildren) {\n        var kept = [];\n        var removed = [];\n        for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n          var c$1 = prevChildren[i$1];\n          c$1.data.transition = transitionData;\n          c$1.data.pos = c$1.elm.getBoundingClientRect();\n          if (map[c$1.key]) {\n            kept.push(c$1);\n          } else {\n            removed.push(c$1);\n          }\n        }\n        this.kept = h(tag, null, kept);\n        this.removed = removed;\n      }\n\n      return h(tag, null, children)\n    },\n\n    updated: function updated () {\n      var children = this.prevChildren;\n      var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n      if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n        return\n      }\n\n      // we divide the work into three loops to avoid mixing DOM reads and writes\n      // in each iteration - which helps prevent layout thrashing.\n      children.forEach(callPendingCbs);\n      children.forEach(recordPosition);\n      children.forEach(applyTranslation);\n\n      // force reflow to put everything in position\n      // assign to this to avoid being removed in tree-shaking\n      // $flow-disable-line\n      this._reflow = document.body.offsetHeight;\n\n      children.forEach(function (c) {\n        if (c.data.moved) {\n          var el = c.elm;\n          var s = el.style;\n          addTransitionClass(el, moveClass);\n          s.transform = s.WebkitTransform = s.transitionDuration = '';\n          el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n            if (e && e.target !== el) {\n              return\n            }\n            if (!e || /transform$/.test(e.propertyName)) {\n              el.removeEventListener(transitionEndEvent, cb);\n              el._moveCb = null;\n              removeTransitionClass(el, moveClass);\n            }\n          });\n        }\n      });\n    },\n\n    methods: {\n      hasMove: function hasMove (el, moveClass) {\n        /* istanbul ignore if */\n        if (!hasTransition) {\n          return false\n        }\n        /* istanbul ignore if */\n        if (this._hasMove) {\n          return this._hasMove\n        }\n        // Detect whether an element with the move class applied has\n        // CSS transitions. Since the element may be inside an entering\n        // transition at this very moment, we make a clone of it and remove\n        // all other transition classes applied to ensure only the move class\n        // is applied.\n        var clone = el.cloneNode();\n        if (el._transitionClasses) {\n          el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });\n        }\n        addClass(clone, moveClass);\n        clone.style.display = 'none';\n        this.$el.appendChild(clone);\n        var info = getTransitionInfo(clone);\n        this.$el.removeChild(clone);\n        return (this._hasMove = info.hasTransform)\n      }\n    }\n  };\n\n  function callPendingCbs (c) {\n    /* istanbul ignore if */\n    if (c.elm._moveCb) {\n      c.elm._moveCb();\n    }\n    /* istanbul ignore if */\n    if (c.elm._enterCb) {\n      c.elm._enterCb();\n    }\n  }\n\n  function recordPosition (c) {\n    c.data.newPos = c.elm.getBoundingClientRect();\n  }\n\n  function applyTranslation (c) {\n    var oldPos = c.data.pos;\n    var newPos = c.data.newPos;\n    var dx = oldPos.left - newPos.left;\n    var dy = oldPos.top - newPos.top;\n    if (dx || dy) {\n      c.data.moved = true;\n      var s = c.elm.style;\n      s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n      s.transitionDuration = '0s';\n    }\n  }\n\n  var platformComponents = {\n    Transition: Transition,\n    TransitionGroup: TransitionGroup\n  };\n\n  /*  */\n\n  // install platform specific utils\n  Vue.config.mustUseProp = mustUseProp;\n  Vue.config.isReservedTag = isReservedTag;\n  Vue.config.isReservedAttr = isReservedAttr;\n  Vue.config.getTagNamespace = getTagNamespace;\n  Vue.config.isUnknownElement = isUnknownElement;\n\n  // install platform runtime directives & components\n  extend(Vue.options.directives, platformDirectives);\n  extend(Vue.options.components, platformComponents);\n\n  // install platform patch function\n  Vue.prototype.__patch__ = inBrowser ? patch : noop;\n\n  // public mount method\n  Vue.prototype.$mount = function (\n    el,\n    hydrating\n  ) {\n    el = el && inBrowser ? query(el) : undefined;\n    return mountComponent(this, el, hydrating)\n  };\n\n  // devtools global hook\n  /* istanbul ignore next */\n  if (inBrowser) {\n    setTimeout(function () {\n      if (config.devtools) {\n        if (devtools) {\n          devtools.emit('init', Vue);\n        } else {\n          console[console.info ? 'info' : 'log'](\n            'Download the Vue Devtools extension for a better development experience:\\n' +\n            'https://github.com/vuejs/vue-devtools'\n          );\n        }\n      }\n      if (config.productionTip !== false &&\n        typeof console !== 'undefined'\n      ) {\n        console[console.info ? 'info' : 'log'](\n          \"You are running Vue in development mode.\\n\" +\n          \"Make sure to turn on production mode when deploying for production.\\n\" +\n          \"See more tips at https://vuejs.org/guide/deployment.html\"\n        );\n      }\n    }, 0);\n  }\n\n  /*  */\n\n  var defaultTagRE = /\\{\\{((?:.|\\r?\\n)+?)\\}\\}/g;\n  var regexEscapeRE = /[-.*+?^${}()|[\\]\\/\\\\]/g;\n\n  var buildRegex = cached(function (delimiters) {\n    var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n    var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n    return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n  });\n\n\n\n  function parseText (\n    text,\n    delimiters\n  ) {\n    var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n    if (!tagRE.test(text)) {\n      return\n    }\n    var tokens = [];\n    var rawTokens = [];\n    var lastIndex = tagRE.lastIndex = 0;\n    var match, index, tokenValue;\n    while ((match = tagRE.exec(text))) {\n      index = match.index;\n      // push text token\n      if (index > lastIndex) {\n        rawTokens.push(tokenValue = text.slice(lastIndex, index));\n        tokens.push(JSON.stringify(tokenValue));\n      }\n      // tag token\n      var exp = parseFilters(match[1].trim());\n      tokens.push((\"_s(\" + exp + \")\"));\n      rawTokens.push({ '@binding': exp });\n      lastIndex = index + match[0].length;\n    }\n    if (lastIndex < text.length) {\n      rawTokens.push(tokenValue = text.slice(lastIndex));\n      tokens.push(JSON.stringify(tokenValue));\n    }\n    return {\n      expression: tokens.join('+'),\n      tokens: rawTokens\n    }\n  }\n\n  /*  */\n\n  function transformNode (el, options) {\n    var warn = options.warn || baseWarn;\n    var staticClass = getAndRemoveAttr(el, 'class');\n    if (staticClass) {\n      var res = parseText(staticClass, options.delimiters);\n      if (res) {\n        warn(\n          \"class=\\\"\" + staticClass + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.',\n          el.rawAttrsMap['class']\n        );\n      }\n    }\n    if (staticClass) {\n      el.staticClass = JSON.stringify(staticClass);\n    }\n    var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n    if (classBinding) {\n      el.classBinding = classBinding;\n    }\n  }\n\n  function genData (el) {\n    var data = '';\n    if (el.staticClass) {\n      data += \"staticClass:\" + (el.staticClass) + \",\";\n    }\n    if (el.classBinding) {\n      data += \"class:\" + (el.classBinding) + \",\";\n    }\n    return data\n  }\n\n  var klass$1 = {\n    staticKeys: ['staticClass'],\n    transformNode: transformNode,\n    genData: genData\n  };\n\n  /*  */\n\n  function transformNode$1 (el, options) {\n    var warn = options.warn || baseWarn;\n    var staticStyle = getAndRemoveAttr(el, 'style');\n    if (staticStyle) {\n      /* istanbul ignore if */\n      {\n        var res = parseText(staticStyle, options.delimiters);\n        if (res) {\n          warn(\n            \"style=\\\"\" + staticStyle + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.',\n            el.rawAttrsMap['style']\n          );\n        }\n      }\n      el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n    }\n\n    var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n    if (styleBinding) {\n      el.styleBinding = styleBinding;\n    }\n  }\n\n  function genData$1 (el) {\n    var data = '';\n    if (el.staticStyle) {\n      data += \"staticStyle:\" + (el.staticStyle) + \",\";\n    }\n    if (el.styleBinding) {\n      data += \"style:(\" + (el.styleBinding) + \"),\";\n    }\n    return data\n  }\n\n  var style$1 = {\n    staticKeys: ['staticStyle'],\n    transformNode: transformNode$1,\n    genData: genData$1\n  };\n\n  /*  */\n\n  var decoder;\n\n  var he = {\n    decode: function decode (html) {\n      decoder = decoder || document.createElement('div');\n      decoder.innerHTML = html;\n      return decoder.textContent\n    }\n  };\n\n  /*  */\n\n  var isUnaryTag = makeMap(\n    'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n    'link,meta,param,source,track,wbr'\n  );\n\n  // Elements that you can, intentionally, leave open\n  // (and which close themselves)\n  var canBeLeftOpenTag = makeMap(\n    'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'\n  );\n\n  // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n  // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\n  var isNonPhrasingTag = makeMap(\n    'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n    'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n    'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n    'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n    'title,tr,track'\n  );\n\n  /**\n   * Not type-checking this file because it's mostly vendor code.\n   */\n\n  // Regular Expressions for parsing tags and attributes\n  var attribute = /^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/;\n  var dynamicArgAttribute = /^\\s*((?:v-[\\w-]+:|@|:|#)\\[[^=]+\\][^\\s\"'<>\\/=]*)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/;\n  var ncname = \"[a-zA-Z_][\\\\-\\\\.0-9_a-zA-Z\" + unicodeLetters + \"]*\";\n  var qnameCapture = \"((?:\" + ncname + \"\\\\:)?\" + ncname + \")\";\n  var startTagOpen = new RegExp((\"^<\" + qnameCapture));\n  var startTagClose = /^\\s*(\\/?)>/;\n  var endTag = new RegExp((\"^<\\\\/\" + qnameCapture + \"[^>]*>\"));\n  var doctype = /^<!DOCTYPE [^>]+>/i;\n  // #7298: escape - to avoid being pased as HTML comment when inlined in page\n  var comment = /^<!\\--/;\n  var conditionalComment = /^<!\\[/;\n\n  // Special Elements (can contain anything)\n  var isPlainTextElement = makeMap('script,style,textarea', true);\n  var reCache = {};\n\n  var decodingMap = {\n    '&lt;': '<',\n    '&gt;': '>',\n    '&quot;': '\"',\n    '&amp;': '&',\n    '&#10;': '\\n',\n    '&#9;': '\\t',\n    '&#39;': \"'\"\n  };\n  var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;\n  var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;\n\n  // #5992\n  var isIgnoreNewlineTag = makeMap('pre,textarea', true);\n  var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\\n'; };\n\n  function decodeAttr (value, shouldDecodeNewlines) {\n    var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;\n    return value.replace(re, function (match) { return decodingMap[match]; })\n  }\n\n  function parseHTML (html, options) {\n    var stack = [];\n    var expectHTML = options.expectHTML;\n    var isUnaryTag$$1 = options.isUnaryTag || no;\n    var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;\n    var index = 0;\n    var last, lastTag;\n    while (html) {\n      last = html;\n      // Make sure we're not in a plaintext content element like script/style\n      if (!lastTag || !isPlainTextElement(lastTag)) {\n        var textEnd = html.indexOf('<');\n        if (textEnd === 0) {\n          // Comment:\n          if (comment.test(html)) {\n            var commentEnd = html.indexOf('-->');\n\n            if (commentEnd >= 0) {\n              if (options.shouldKeepComment) {\n                options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);\n              }\n              advance(commentEnd + 3);\n              continue\n            }\n          }\n\n          // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n          if (conditionalComment.test(html)) {\n            var conditionalEnd = html.indexOf(']>');\n\n            if (conditionalEnd >= 0) {\n              advance(conditionalEnd + 2);\n              continue\n            }\n          }\n\n          // Doctype:\n          var doctypeMatch = html.match(doctype);\n          if (doctypeMatch) {\n            advance(doctypeMatch[0].length);\n            continue\n          }\n\n          // End tag:\n          var endTagMatch = html.match(endTag);\n          if (endTagMatch) {\n            var curIndex = index;\n            advance(endTagMatch[0].length);\n            parseEndTag(endTagMatch[1], curIndex, index);\n            continue\n          }\n\n          // Start tag:\n          var startTagMatch = parseStartTag();\n          if (startTagMatch) {\n            handleStartTag(startTagMatch);\n            if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {\n              advance(1);\n            }\n            continue\n          }\n        }\n\n        var text = (void 0), rest = (void 0), next = (void 0);\n        if (textEnd >= 0) {\n          rest = html.slice(textEnd);\n          while (\n            !endTag.test(rest) &&\n            !startTagOpen.test(rest) &&\n            !comment.test(rest) &&\n            !conditionalComment.test(rest)\n          ) {\n            // < in plain text, be forgiving and treat it as text\n            next = rest.indexOf('<', 1);\n            if (next < 0) { break }\n            textEnd += next;\n            rest = html.slice(textEnd);\n          }\n          text = html.substring(0, textEnd);\n        }\n\n        if (textEnd < 0) {\n          text = html;\n        }\n\n        if (text) {\n          advance(text.length);\n        }\n\n        if (options.chars && text) {\n          options.chars(text, index - text.length, index);\n        }\n      } else {\n        var endTagLength = 0;\n        var stackedTag = lastTag.toLowerCase();\n        var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n        var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {\n          endTagLength = endTag.length;\n          if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {\n            text = text\n              .replace(/<!\\--([\\s\\S]*?)-->/g, '$1') // #7298\n              .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n          }\n          if (shouldIgnoreFirstNewline(stackedTag, text)) {\n            text = text.slice(1);\n          }\n          if (options.chars) {\n            options.chars(text);\n          }\n          return ''\n        });\n        index += html.length - rest$1.length;\n        html = rest$1;\n        parseEndTag(stackedTag, index - endTagLength, index);\n      }\n\n      if (html === last) {\n        options.chars && options.chars(html);\n        if (!stack.length && options.warn) {\n          options.warn((\"Mal-formatted tag at end of template: \\\"\" + html + \"\\\"\"), { start: index + html.length });\n        }\n        break\n      }\n    }\n\n    // Clean up any remaining tags\n    parseEndTag();\n\n    function advance (n) {\n      index += n;\n      html = html.substring(n);\n    }\n\n    function parseStartTag () {\n      var start = html.match(startTagOpen);\n      if (start) {\n        var match = {\n          tagName: start[1],\n          attrs: [],\n          start: index\n        };\n        advance(start[0].length);\n        var end, attr;\n        while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {\n          attr.start = index;\n          advance(attr[0].length);\n          attr.end = index;\n          match.attrs.push(attr);\n        }\n        if (end) {\n          match.unarySlash = end[1];\n          advance(end[0].length);\n          match.end = index;\n          return match\n        }\n      }\n    }\n\n    function handleStartTag (match) {\n      var tagName = match.tagName;\n      var unarySlash = match.unarySlash;\n\n      if (expectHTML) {\n        if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n          parseEndTag(lastTag);\n        }\n        if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {\n          parseEndTag(tagName);\n        }\n      }\n\n      var unary = isUnaryTag$$1(tagName) || !!unarySlash;\n\n      var l = match.attrs.length;\n      var attrs = new Array(l);\n      for (var i = 0; i < l; i++) {\n        var args = match.attrs[i];\n        var value = args[3] || args[4] || args[5] || '';\n        var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'\n          ? options.shouldDecodeNewlinesForHref\n          : options.shouldDecodeNewlines;\n        attrs[i] = {\n          name: args[1],\n          value: decodeAttr(value, shouldDecodeNewlines)\n        };\n        if (options.outputSourceRange) {\n          attrs[i].start = args.start + args[0].match(/^\\s*/).length;\n          attrs[i].end = args.end;\n        }\n      }\n\n      if (!unary) {\n        stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });\n        lastTag = tagName;\n      }\n\n      if (options.start) {\n        options.start(tagName, attrs, unary, match.start, match.end);\n      }\n    }\n\n    function parseEndTag (tagName, start, end) {\n      var pos, lowerCasedTagName;\n      if (start == null) { start = index; }\n      if (end == null) { end = index; }\n\n      // Find the closest opened tag of the same type\n      if (tagName) {\n        lowerCasedTagName = tagName.toLowerCase();\n        for (pos = stack.length - 1; pos >= 0; pos--) {\n          if (stack[pos].lowerCasedTag === lowerCasedTagName) {\n            break\n          }\n        }\n      } else {\n        // If no tag name is provided, clean shop\n        pos = 0;\n      }\n\n      if (pos >= 0) {\n        // Close all the open elements, up the stack\n        for (var i = stack.length - 1; i >= pos; i--) {\n          if (i > pos || !tagName &&\n            options.warn\n          ) {\n            options.warn(\n              (\"tag <\" + (stack[i].tag) + \"> has no matching end tag.\"),\n              { start: stack[i].start }\n            );\n          }\n          if (options.end) {\n            options.end(stack[i].tag, start, end);\n          }\n        }\n\n        // Remove the open elements from the stack\n        stack.length = pos;\n        lastTag = pos && stack[pos - 1].tag;\n      } else if (lowerCasedTagName === 'br') {\n        if (options.start) {\n          options.start(tagName, [], true, start, end);\n        }\n      } else if (lowerCasedTagName === 'p') {\n        if (options.start) {\n          options.start(tagName, [], false, start, end);\n        }\n        if (options.end) {\n          options.end(tagName, start, end);\n        }\n      }\n    }\n  }\n\n  /*  */\n\n  var onRE = /^@|^v-on:/;\n  var dirRE = /^v-|^@|^:/;\n  var forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\n  var forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\n  var stripParensRE = /^\\(|\\)$/g;\n  var dynamicArgRE = /^\\[.*\\]$/;\n\n  var argRE = /:(.*)$/;\n  var bindRE = /^:|^\\.|^v-bind:/;\n  var modifierRE = /\\.[^.]+/g;\n\n  var slotRE = /^v-slot(:|$)|^#/;\n\n  var lineBreakRE = /[\\r\\n]/;\n  var whitespaceRE$1 = /\\s+/g;\n\n  var invalidAttributeRE = /[\\s\"'<>\\/=]/;\n\n  var decodeHTMLCached = cached(he.decode);\n\n  var emptySlotScopeToken = \"_empty_\";\n\n  // configurable state\n  var warn$2;\n  var delimiters;\n  var transforms;\n  var preTransforms;\n  var postTransforms;\n  var platformIsPreTag;\n  var platformMustUseProp;\n  var platformGetTagNamespace;\n  var maybeComponent;\n\n  function createASTElement (\n    tag,\n    attrs,\n    parent\n  ) {\n    return {\n      type: 1,\n      tag: tag,\n      attrsList: attrs,\n      attrsMap: makeAttrsMap(attrs),\n      rawAttrsMap: {},\n      parent: parent,\n      children: []\n    }\n  }\n\n  /**\n   * Convert HTML string to AST.\n   */\n  function parse (\n    template,\n    options\n  ) {\n    warn$2 = options.warn || baseWarn;\n\n    platformIsPreTag = options.isPreTag || no;\n    platformMustUseProp = options.mustUseProp || no;\n    platformGetTagNamespace = options.getTagNamespace || no;\n    var isReservedTag = options.isReservedTag || no;\n    maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };\n\n    transforms = pluckModuleFunction(options.modules, 'transformNode');\n    preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n    postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n\n    delimiters = options.delimiters;\n\n    var stack = [];\n    var preserveWhitespace = options.preserveWhitespace !== false;\n    var whitespaceOption = options.whitespace;\n    var root;\n    var currentParent;\n    var inVPre = false;\n    var inPre = false;\n    var warned = false;\n\n    function warnOnce (msg, range) {\n      if (!warned) {\n        warned = true;\n        warn$2(msg, range);\n      }\n    }\n\n    function closeElement (element) {\n      trimEndingWhitespace(element);\n      if (!inVPre && !element.processed) {\n        element = processElement(element, options);\n      }\n      // tree management\n      if (!stack.length && element !== root) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          {\n            checkRootConstraints(element);\n          }\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else {\n          warnOnce(\n            \"Component template should contain exactly one root element. \" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\",\n            { start: element.start }\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else {\n          if (element.slotScope) {\n            // scoped slot\n            // keep it in the children list so that v-else(-if) conditions can\n            // find it as the prev node.\n            var name = element.slotTarget || '\"default\"'\n            ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n          }\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n\n      // final children cleanup\n      // filter out scoped slots\n      element.children = element.children.filter(function (c) { return !(c).slotScope; });\n      // remove trailing whitespace node again\n      trimEndingWhitespace(element);\n\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n      // apply post-transforms\n      for (var i = 0; i < postTransforms.length; i++) {\n        postTransforms[i](element, options);\n      }\n    }\n\n    function trimEndingWhitespace (el) {\n      // remove trailing whitespace node\n      if (!inPre) {\n        var lastNode;\n        while (\n          (lastNode = el.children[el.children.length - 1]) &&\n          lastNode.type === 3 &&\n          lastNode.text === ' '\n        ) {\n          el.children.pop();\n        }\n      }\n    }\n\n    function checkRootConstraints (el) {\n      if (el.tag === 'slot' || el.tag === 'template') {\n        warnOnce(\n          \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n          'contain multiple nodes.',\n          { start: el.start }\n        );\n      }\n      if (el.attrsMap.hasOwnProperty('v-for')) {\n        warnOnce(\n          'Cannot use v-for on stateful component root element because ' +\n          'it renders multiple elements.',\n          el.rawAttrsMap['v-for']\n        );\n      }\n    }\n\n    parseHTML(template, {\n      warn: warn$2,\n      expectHTML: options.expectHTML,\n      isUnaryTag: options.isUnaryTag,\n      canBeLeftOpenTag: options.canBeLeftOpenTag,\n      shouldDecodeNewlines: options.shouldDecodeNewlines,\n      shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,\n      shouldKeepComment: options.comments,\n      outputSourceRange: options.outputSourceRange,\n      start: function start (tag, attrs, unary, start$1) {\n        // check namespace.\n        // inherit parent ns if there is one\n        var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n        // handle IE svg bug\n        /* istanbul ignore if */\n        if (isIE && ns === 'svg') {\n          attrs = guardIESVGBug(attrs);\n        }\n\n        var element = createASTElement(tag, attrs, currentParent);\n        if (ns) {\n          element.ns = ns;\n        }\n\n        {\n          if (options.outputSourceRange) {\n            element.start = start$1;\n            element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {\n              cumulated[attr.name] = attr;\n              return cumulated\n            }, {});\n          }\n          attrs.forEach(function (attr) {\n            if (invalidAttributeRE.test(attr.name)) {\n              warn$2(\n                \"Invalid dynamic argument expression: attribute names cannot contain \" +\n                \"spaces, quotes, <, >, / or =.\",\n                {\n                  start: attr.start + attr.name.indexOf(\"[\"),\n                  end: attr.start + attr.name.length\n                }\n              );\n            }\n          });\n        }\n\n        if (isForbiddenTag(element) && !isServerRendering()) {\n          element.forbidden = true;\n          warn$2(\n            'Templates should only be responsible for mapping the state to the ' +\n            'UI. Avoid placing tags with side-effects in your templates, such as ' +\n            \"<\" + tag + \">\" + ', as they will not be parsed.',\n            { start: element.start }\n          );\n        }\n\n        // apply pre-transforms\n        for (var i = 0; i < preTransforms.length; i++) {\n          element = preTransforms[i](element, options) || element;\n        }\n\n        if (!inVPre) {\n          processPre(element);\n          if (element.pre) {\n            inVPre = true;\n          }\n        }\n        if (platformIsPreTag(element.tag)) {\n          inPre = true;\n        }\n        if (inVPre) {\n          processRawAttrs(element);\n        } else if (!element.processed) {\n          // structural directives\n          processFor(element);\n          processIf(element);\n          processOnce(element);\n        }\n\n        if (!root) {\n          root = element;\n          {\n            checkRootConstraints(root);\n          }\n        }\n\n        if (!unary) {\n          currentParent = element;\n          stack.push(element);\n        } else {\n          closeElement(element);\n        }\n      },\n\n      end: function end (tag, start, end$1) {\n        var element = stack[stack.length - 1];\n        // pop stack\n        stack.length -= 1;\n        currentParent = stack[stack.length - 1];\n        if (options.outputSourceRange) {\n          element.end = end$1;\n        }\n        closeElement(element);\n      },\n\n      chars: function chars (text, start, end) {\n        if (!currentParent) {\n          {\n            if (text === template) {\n              warnOnce(\n                'Component template requires a root element, rather than just text.',\n                { start: start }\n              );\n            } else if ((text = text.trim())) {\n              warnOnce(\n                (\"text \\\"\" + text + \"\\\" outside root element will be ignored.\"),\n                { start: start }\n              );\n            }\n          }\n          return\n        }\n        // IE textarea placeholder bug\n        /* istanbul ignore if */\n        if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text\n        ) {\n          return\n        }\n        var children = currentParent.children;\n        if (inPre || text.trim()) {\n          text = isTextTag(currentParent) ? text : decodeHTMLCached(text);\n        } else if (!children.length) {\n          // remove the whitespace-only node right after an opening tag\n          text = '';\n        } else if (whitespaceOption) {\n          if (whitespaceOption === 'condense') {\n            // in condense mode, remove the whitespace node if it contains\n            // line break, otherwise condense to a single space\n            text = lineBreakRE.test(text) ? '' : ' ';\n          } else {\n            text = ' ';\n          }\n        } else {\n          text = preserveWhitespace ? ' ' : '';\n        }\n        if (text) {\n          if (whitespaceOption === 'condense') {\n            // condense consecutive whitespaces into single space\n            text = text.replace(whitespaceRE$1, ' ');\n          }\n          var res;\n          var child;\n          if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {\n            child = {\n              type: 2,\n              expression: res.expression,\n              tokens: res.tokens,\n              text: text\n            };\n          } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {\n            child = {\n              type: 3,\n              text: text\n            };\n          }\n          if (child) {\n            if (options.outputSourceRange) {\n              child.start = start;\n              child.end = end;\n            }\n            children.push(child);\n          }\n        }\n      },\n      comment: function comment (text, start, end) {\n        // adding anyting as a sibling to the root node is forbidden\n        // comments should still be allowed, but ignored\n        if (currentParent) {\n          var child = {\n            type: 3,\n            text: text,\n            isComment: true\n          };\n          if (options.outputSourceRange) {\n            child.start = start;\n            child.end = end;\n          }\n          currentParent.children.push(child);\n        }\n      }\n    });\n    return root\n  }\n\n  function processPre (el) {\n    if (getAndRemoveAttr(el, 'v-pre') != null) {\n      el.pre = true;\n    }\n  }\n\n  function processRawAttrs (el) {\n    var list = el.attrsList;\n    var len = list.length;\n    if (len) {\n      var attrs = el.attrs = new Array(len);\n      for (var i = 0; i < len; i++) {\n        attrs[i] = {\n          name: list[i].name,\n          value: JSON.stringify(list[i].value)\n        };\n        if (list[i].start != null) {\n          attrs[i].start = list[i].start;\n          attrs[i].end = list[i].end;\n        }\n      }\n    } else if (!el.pre) {\n      // non root node in pre blocks with no attributes\n      el.plain = true;\n    }\n  }\n\n  function processElement (\n    element,\n    options\n  ) {\n    processKey(element);\n\n    // determine whether this is a plain element after\n    // removing structural attributes\n    element.plain = (\n      !element.key &&\n      !element.scopedSlots &&\n      !element.attrsList.length\n    );\n\n    processRef(element);\n    processSlotContent(element);\n    processSlotOutlet(element);\n    processComponent(element);\n    for (var i = 0; i < transforms.length; i++) {\n      element = transforms[i](element, options) || element;\n    }\n    processAttrs(element);\n    return element\n  }\n\n  function processKey (el) {\n    var exp = getBindingAttr(el, 'key');\n    if (exp) {\n      {\n        if (el.tag === 'template') {\n          warn$2(\n            \"<template> cannot be keyed. Place the key on real elements instead.\",\n            getRawBindingAttr(el, 'key')\n          );\n        }\n        if (el.for) {\n          var iterator = el.iterator2 || el.iterator1;\n          var parent = el.parent;\n          if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {\n            warn$2(\n              \"Do not use v-for index as key on <transition-group> children, \" +\n              \"this is the same as not using keys.\",\n              getRawBindingAttr(el, 'key'),\n              true /* tip */\n            );\n          }\n        }\n      }\n      el.key = exp;\n    }\n  }\n\n  function processRef (el) {\n    var ref = getBindingAttr(el, 'ref');\n    if (ref) {\n      el.ref = ref;\n      el.refInFor = checkInFor(el);\n    }\n  }\n\n  function processFor (el) {\n    var exp;\n    if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n      var res = parseFor(exp);\n      if (res) {\n        extend(el, res);\n      } else {\n        warn$2(\n          (\"Invalid v-for expression: \" + exp),\n          el.rawAttrsMap['v-for']\n        );\n      }\n    }\n  }\n\n\n\n  function parseFor (exp) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) { return }\n    var res = {};\n    res.for = inMatch[2].trim();\n    var alias = inMatch[1].trim().replace(stripParensRE, '');\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      res.alias = alias.replace(forIteratorRE, '').trim();\n      res.iterator1 = iteratorMatch[1].trim();\n      if (iteratorMatch[2]) {\n        res.iterator2 = iteratorMatch[2].trim();\n      }\n    } else {\n      res.alias = alias;\n    }\n    return res\n  }\n\n  function processIf (el) {\n    var exp = getAndRemoveAttr(el, 'v-if');\n    if (exp) {\n      el.if = exp;\n      addIfCondition(el, {\n        exp: exp,\n        block: el\n      });\n    } else {\n      if (getAndRemoveAttr(el, 'v-else') != null) {\n        el.else = true;\n      }\n      var elseif = getAndRemoveAttr(el, 'v-else-if');\n      if (elseif) {\n        el.elseif = elseif;\n      }\n    }\n  }\n\n  function processIfConditions (el, parent) {\n    var prev = findPrevElement(parent.children);\n    if (prev && prev.if) {\n      addIfCondition(prev, {\n        exp: el.elseif,\n        block: el\n      });\n    } else {\n      warn$2(\n        \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n        \"used on element <\" + (el.tag) + \"> without corresponding v-if.\",\n        el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']\n      );\n    }\n  }\n\n  function findPrevElement (children) {\n    var i = children.length;\n    while (i--) {\n      if (children[i].type === 1) {\n        return children[i]\n      } else {\n        if (children[i].text !== ' ') {\n          warn$2(\n            \"text \\\"\" + (children[i].text.trim()) + \"\\\" between v-if and v-else(-if) \" +\n            \"will be ignored.\",\n            children[i]\n          );\n        }\n        children.pop();\n      }\n    }\n  }\n\n  function addIfCondition (el, condition) {\n    if (!el.ifConditions) {\n      el.ifConditions = [];\n    }\n    el.ifConditions.push(condition);\n  }\n\n  function processOnce (el) {\n    var once$$1 = getAndRemoveAttr(el, 'v-once');\n    if (once$$1 != null) {\n      el.once = true;\n    }\n  }\n\n  // handle content being passed to a component as slot,\n  // e.g. <template slot=\"xxx\">, <div slot-scope=\"xxx\">\n  function processSlotContent (el) {\n    var slotScope;\n    if (el.tag === 'template') {\n      slotScope = getAndRemoveAttr(el, 'scope');\n      /* istanbul ignore if */\n      if (slotScope) {\n        warn$2(\n          \"the \\\"scope\\\" attribute for scoped slots have been deprecated and \" +\n          \"replaced by \\\"slot-scope\\\" since 2.5. The new \\\"slot-scope\\\" attribute \" +\n          \"can also be used on plain elements in addition to <template> to \" +\n          \"denote scoped slots.\",\n          el.rawAttrsMap['scope'],\n          true\n        );\n      }\n      el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');\n    } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {\n      /* istanbul ignore if */\n      if (el.attrsMap['v-for']) {\n        warn$2(\n          \"Ambiguous combined usage of slot-scope and v-for on <\" + (el.tag) + \"> \" +\n          \"(v-for takes higher priority). Use a wrapper <template> for the \" +\n          \"scoped slot to make it clearer.\",\n          el.rawAttrsMap['slot-scope'],\n          true\n        );\n      }\n      el.slotScope = slotScope;\n    }\n\n    // slot=\"xxx\"\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n      el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);\n      // preserve slot as an attribute for native shadow DOM compat\n      // only for non-scoped slots.\n      if (el.tag !== 'template' && !el.slotScope) {\n        addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));\n      }\n    }\n\n    // 2.6 v-slot syntax\n    {\n      if (el.tag === 'template') {\n        // v-slot on <template>\n        var slotBinding = getAndRemoveAttrByRegex(el, slotRE);\n        if (slotBinding) {\n          {\n            if (el.slotTarget || el.slotScope) {\n              warn$2(\n                \"Unexpected mixed usage of different slot syntaxes.\",\n                el\n              );\n            }\n            if (el.parent && !maybeComponent(el.parent)) {\n              warn$2(\n                \"<template v-slot> can only appear at the root level inside \" +\n                \"the receiving the component\",\n                el\n              );\n            }\n          }\n          var ref = getSlotName(slotBinding);\n          var name = ref.name;\n          var dynamic = ref.dynamic;\n          el.slotTarget = name;\n          el.slotTargetDynamic = dynamic;\n          el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf\n        }\n      } else {\n        // v-slot on component, denotes default slot\n        var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);\n        if (slotBinding$1) {\n          {\n            if (!maybeComponent(el)) {\n              warn$2(\n                \"v-slot can only be used on components or <template>.\",\n                slotBinding$1\n              );\n            }\n            if (el.slotScope || el.slotTarget) {\n              warn$2(\n                \"Unexpected mixed usage of different slot syntaxes.\",\n                el\n              );\n            }\n            if (el.scopedSlots) {\n              warn$2(\n                \"To avoid scope ambiguity, the default slot should also use \" +\n                \"<template> syntax when there are other named slots.\",\n                slotBinding$1\n              );\n            }\n          }\n          // add the component's children to its default slot\n          var slots = el.scopedSlots || (el.scopedSlots = {});\n          var ref$1 = getSlotName(slotBinding$1);\n          var name$1 = ref$1.name;\n          var dynamic$1 = ref$1.dynamic;\n          var slotContainer = slots[name$1] = createASTElement('template', [], el);\n          slotContainer.slotTarget = name$1;\n          slotContainer.slotTargetDynamic = dynamic$1;\n          slotContainer.children = el.children.filter(function (c) {\n            if (!c.slotScope) {\n              c.parent = slotContainer;\n              return true\n            }\n          });\n          slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;\n          // remove children as they are returned from scopedSlots now\n          el.children = [];\n          // mark el non-plain so data gets generated\n          el.plain = false;\n        }\n      }\n    }\n  }\n\n  function getSlotName (binding) {\n    var name = binding.name.replace(slotRE, '');\n    if (!name) {\n      if (binding.name[0] !== '#') {\n        name = 'default';\n      } else {\n        warn$2(\n          \"v-slot shorthand syntax requires a slot name.\",\n          binding\n        );\n      }\n    }\n    return dynamicArgRE.test(name)\n      // dynamic [name]\n      ? { name: name.slice(1, -1), dynamic: true }\n      // static name\n      : { name: (\"\\\"\" + name + \"\\\"\"), dynamic: false }\n  }\n\n  // handle <slot/> outlets\n  function processSlotOutlet (el) {\n    if (el.tag === 'slot') {\n      el.slotName = getBindingAttr(el, 'name');\n      if (el.key) {\n        warn$2(\n          \"`key` does not work on <slot> because slots are abstract outlets \" +\n          \"and can possibly expand into multiple elements. \" +\n          \"Use the key on a wrapping element instead.\",\n          getRawBindingAttr(el, 'key')\n        );\n      }\n    }\n  }\n\n  function processComponent (el) {\n    var binding;\n    if ((binding = getBindingAttr(el, 'is'))) {\n      el.component = binding;\n    }\n    if (getAndRemoveAttr(el, 'inline-template') != null) {\n      el.inlineTemplate = true;\n    }\n  }\n\n  function processAttrs (el) {\n    var list = el.attrsList;\n    var i, l, name, rawName, value, modifiers, syncGen, isDynamic;\n    for (i = 0, l = list.length; i < l; i++) {\n      name = rawName = list[i].name;\n      value = list[i].value;\n      if (dirRE.test(name)) {\n        // mark element as dynamic\n        el.hasBindings = true;\n        // modifiers\n        modifiers = parseModifiers(name.replace(dirRE, ''));\n        // support .foo shorthand syntax for the .prop modifier\n        if (modifiers) {\n          name = name.replace(modifierRE, '');\n        }\n        if (bindRE.test(name)) { // v-bind\n          name = name.replace(bindRE, '');\n          value = parseFilters(value);\n          isDynamic = dynamicArgRE.test(name);\n          if (isDynamic) {\n            name = name.slice(1, -1);\n          }\n          if (\n            value.trim().length === 0\n          ) {\n            warn$2(\n              (\"The value for a v-bind expression cannot be empty. Found in \\\"v-bind:\" + name + \"\\\"\")\n            );\n          }\n          if (modifiers) {\n            if (modifiers.prop && !isDynamic) {\n              name = camelize(name);\n              if (name === 'innerHtml') { name = 'innerHTML'; }\n            }\n            if (modifiers.camel && !isDynamic) {\n              name = camelize(name);\n            }\n            if (modifiers.sync) {\n              syncGen = genAssignmentCode(value, \"$event\");\n              if (!isDynamic) {\n                addHandler(\n                  el,\n                  (\"update:\" + (camelize(name))),\n                  syncGen,\n                  null,\n                  false,\n                  warn$2,\n                  list[i]\n                );\n                if (hyphenate(name) !== camelize(name)) {\n                  addHandler(\n                    el,\n                    (\"update:\" + (hyphenate(name))),\n                    syncGen,\n                    null,\n                    false,\n                    warn$2,\n                    list[i]\n                  );\n                }\n              } else {\n                // handler w/ dynamic event name\n                addHandler(\n                  el,\n                  (\"\\\"update:\\\"+(\" + name + \")\"),\n                  syncGen,\n                  null,\n                  false,\n                  warn$2,\n                  list[i],\n                  true // dynamic\n                );\n              }\n            }\n          }\n          if ((modifiers && modifiers.prop) || (\n            !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)\n          )) {\n            addProp(el, name, value, list[i], isDynamic);\n          } else {\n            addAttr(el, name, value, list[i], isDynamic);\n          }\n        } else if (onRE.test(name)) { // v-on\n          name = name.replace(onRE, '');\n          isDynamic = dynamicArgRE.test(name);\n          if (isDynamic) {\n            name = name.slice(1, -1);\n          }\n          addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);\n        } else { // normal directives\n          name = name.replace(dirRE, '');\n          // parse arg\n          var argMatch = name.match(argRE);\n          var arg = argMatch && argMatch[1];\n          isDynamic = false;\n          if (arg) {\n            name = name.slice(0, -(arg.length + 1));\n            if (dynamicArgRE.test(arg)) {\n              arg = arg.slice(1, -1);\n              isDynamic = true;\n            }\n          }\n          addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);\n          if (name === 'model') {\n            checkForAliasModel(el, value);\n          }\n        }\n      } else {\n        // literal attribute\n        {\n          var res = parseText(value, delimiters);\n          if (res) {\n            warn$2(\n              name + \"=\\\"\" + value + \"\\\": \" +\n              'Interpolation inside attributes has been removed. ' +\n              'Use v-bind or the colon shorthand instead. For example, ' +\n              'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.',\n              list[i]\n            );\n          }\n        }\n        addAttr(el, name, JSON.stringify(value), list[i]);\n        // #6887 firefox doesn't update muted state if set via attribute\n        // even immediately after element creation\n        if (!el.component &&\n            name === 'muted' &&\n            platformMustUseProp(el.tag, el.attrsMap.type, name)) {\n          addProp(el, name, 'true', list[i]);\n        }\n      }\n    }\n  }\n\n  function checkInFor (el) {\n    var parent = el;\n    while (parent) {\n      if (parent.for !== undefined) {\n        return true\n      }\n      parent = parent.parent;\n    }\n    return false\n  }\n\n  function parseModifiers (name) {\n    var match = name.match(modifierRE);\n    if (match) {\n      var ret = {};\n      match.forEach(function (m) { ret[m.slice(1)] = true; });\n      return ret\n    }\n  }\n\n  function makeAttrsMap (attrs) {\n    var map = {};\n    for (var i = 0, l = attrs.length; i < l; i++) {\n      if (\n        map[attrs[i].name] && !isIE && !isEdge\n      ) {\n        warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);\n      }\n      map[attrs[i].name] = attrs[i].value;\n    }\n    return map\n  }\n\n  // for script (e.g. type=\"x/template\") or style, do not decode content\n  function isTextTag (el) {\n    return el.tag === 'script' || el.tag === 'style'\n  }\n\n  function isForbiddenTag (el) {\n    return (\n      el.tag === 'style' ||\n      (el.tag === 'script' && (\n        !el.attrsMap.type ||\n        el.attrsMap.type === 'text/javascript'\n      ))\n    )\n  }\n\n  var ieNSBug = /^xmlns:NS\\d+/;\n  var ieNSPrefix = /^NS\\d+:/;\n\n  /* istanbul ignore next */\n  function guardIESVGBug (attrs) {\n    var res = [];\n    for (var i = 0; i < attrs.length; i++) {\n      var attr = attrs[i];\n      if (!ieNSBug.test(attr.name)) {\n        attr.name = attr.name.replace(ieNSPrefix, '');\n        res.push(attr);\n      }\n    }\n    return res\n  }\n\n  function checkForAliasModel (el, value) {\n    var _el = el;\n    while (_el) {\n      if (_el.for && _el.alias === value) {\n        warn$2(\n          \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n          \"You are binding v-model directly to a v-for iteration alias. \" +\n          \"This will not be able to modify the v-for source array because \" +\n          \"writing to the alias is like modifying a function local variable. \" +\n          \"Consider using an array of objects and use v-model on an object property instead.\",\n          el.rawAttrsMap['v-model']\n        );\n      }\n      _el = _el.parent;\n    }\n  }\n\n  /*  */\n\n  function preTransformNode (el, options) {\n    if (el.tag === 'input') {\n      var map = el.attrsMap;\n      if (!map['v-model']) {\n        return\n      }\n\n      var typeBinding;\n      if (map[':type'] || map['v-bind:type']) {\n        typeBinding = getBindingAttr(el, 'type');\n      }\n      if (!map.type && !typeBinding && map['v-bind']) {\n        typeBinding = \"(\" + (map['v-bind']) + \").type\";\n      }\n\n      if (typeBinding) {\n        var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n        var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n        var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n        var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n        // 1. checkbox\n        var branch0 = cloneASTElement(el);\n        // process for on the main node\n        processFor(branch0);\n        addRawAttr(branch0, 'type', 'checkbox');\n        processElement(branch0, options);\n        branch0.processed = true; // prevent it from double-processed\n        branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n        addIfCondition(branch0, {\n          exp: branch0.if,\n          block: branch0\n        });\n        // 2. add radio else-if condition\n        var branch1 = cloneASTElement(el);\n        getAndRemoveAttr(branch1, 'v-for', true);\n        addRawAttr(branch1, 'type', 'radio');\n        processElement(branch1, options);\n        addIfCondition(branch0, {\n          exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n          block: branch1\n        });\n        // 3. other\n        var branch2 = cloneASTElement(el);\n        getAndRemoveAttr(branch2, 'v-for', true);\n        addRawAttr(branch2, ':type', typeBinding);\n        processElement(branch2, options);\n        addIfCondition(branch0, {\n          exp: ifCondition,\n          block: branch2\n        });\n\n        if (hasElse) {\n          branch0.else = true;\n        } else if (elseIfCondition) {\n          branch0.elseif = elseIfCondition;\n        }\n\n        return branch0\n      }\n    }\n  }\n\n  function cloneASTElement (el) {\n    return createASTElement(el.tag, el.attrsList.slice(), el.parent)\n  }\n\n  var model$1 = {\n    preTransformNode: preTransformNode\n  };\n\n  var modules$1 = [\n    klass$1,\n    style$1,\n    model$1\n  ];\n\n  /*  */\n\n  function text (el, dir) {\n    if (dir.value) {\n      addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"), dir);\n    }\n  }\n\n  /*  */\n\n  function html (el, dir) {\n    if (dir.value) {\n      addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"), dir);\n    }\n  }\n\n  var directives$1 = {\n    model: model,\n    text: text,\n    html: html\n  };\n\n  /*  */\n\n  var baseOptions = {\n    expectHTML: true,\n    modules: modules$1,\n    directives: directives$1,\n    isPreTag: isPreTag,\n    isUnaryTag: isUnaryTag,\n    mustUseProp: mustUseProp,\n    canBeLeftOpenTag: canBeLeftOpenTag,\n    isReservedTag: isReservedTag,\n    getTagNamespace: getTagNamespace,\n    staticKeys: genStaticKeys(modules$1)\n  };\n\n  /*  */\n\n  var isStaticKey;\n  var isPlatformReservedTag;\n\n  var genStaticKeysCached = cached(genStaticKeys$1);\n\n  /**\n   * Goal of the optimizer: walk the generated template AST tree\n   * and detect sub-trees that are purely static, i.e. parts of\n   * the DOM that never needs to change.\n   *\n   * Once we detect these sub-trees, we can:\n   *\n   * 1. Hoist them into constants, so that we no longer need to\n   *    create fresh nodes for them on each re-render;\n   * 2. Completely skip them in the patching process.\n   */\n  function optimize (root, options) {\n    if (!root) { return }\n    isStaticKey = genStaticKeysCached(options.staticKeys || '');\n    isPlatformReservedTag = options.isReservedTag || no;\n    // first pass: mark all non-static nodes.\n    markStatic$1(root);\n    // second pass: mark static roots.\n    markStaticRoots(root, false);\n  }\n\n  function genStaticKeys$1 (keys) {\n    return makeMap(\n      'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +\n      (keys ? ',' + keys : '')\n    )\n  }\n\n  function markStatic$1 (node) {\n    node.static = isStatic(node);\n    if (node.type === 1) {\n      // do not make component slot content static. this avoids\n      // 1. components not able to mutate slot nodes\n      // 2. static slot content fails for hot-reloading\n      if (\n        !isPlatformReservedTag(node.tag) &&\n        node.tag !== 'slot' &&\n        node.attrsMap['inline-template'] == null\n      ) {\n        return\n      }\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        var child = node.children[i];\n        markStatic$1(child);\n        if (!child.static) {\n          node.static = false;\n        }\n      }\n      if (node.ifConditions) {\n        for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {\n          var block = node.ifConditions[i$1].block;\n          markStatic$1(block);\n          if (!block.static) {\n            node.static = false;\n          }\n        }\n      }\n    }\n  }\n\n  function markStaticRoots (node, isInFor) {\n    if (node.type === 1) {\n      if (node.static || node.once) {\n        node.staticInFor = isInFor;\n      }\n      // For a node to qualify as a static root, it should have children that\n      // are not just static text. Otherwise the cost of hoisting out will\n      // outweigh the benefits and it's better off to just always render it fresh.\n      if (node.static && node.children.length && !(\n        node.children.length === 1 &&\n        node.children[0].type === 3\n      )) {\n        node.staticRoot = true;\n        return\n      } else {\n        node.staticRoot = false;\n      }\n      if (node.children) {\n        for (var i = 0, l = node.children.length; i < l; i++) {\n          markStaticRoots(node.children[i], isInFor || !!node.for);\n        }\n      }\n      if (node.ifConditions) {\n        for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {\n          markStaticRoots(node.ifConditions[i$1].block, isInFor);\n        }\n      }\n    }\n  }\n\n  function isStatic (node) {\n    if (node.type === 2) { // expression\n      return false\n    }\n    if (node.type === 3) { // text\n      return true\n    }\n    return !!(node.pre || (\n      !node.hasBindings && // no dynamic bindings\n      !node.if && !node.for && // not v-if or v-for or v-else\n      !isBuiltInTag(node.tag) && // not a built-in\n      isPlatformReservedTag(node.tag) && // not a component\n      !isDirectChildOfTemplateFor(node) &&\n      Object.keys(node).every(isStaticKey)\n    ))\n  }\n\n  function isDirectChildOfTemplateFor (node) {\n    while (node.parent) {\n      node = node.parent;\n      if (node.tag !== 'template') {\n        return false\n      }\n      if (node.for) {\n        return true\n      }\n    }\n    return false\n  }\n\n  /*  */\n\n  var fnExpRE = /^([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\n  var fnInvokeRE = /\\([^)]*?\\);*$/;\n  var simplePathRE = /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?']|\\[\"[^\"]*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*$/;\n\n  // KeyboardEvent.keyCode aliases\n  var keyCodes = {\n    esc: 27,\n    tab: 9,\n    enter: 13,\n    space: 32,\n    up: 38,\n    left: 37,\n    right: 39,\n    down: 40,\n    'delete': [8, 46]\n  };\n\n  // KeyboardEvent.key aliases\n  var keyNames = {\n    // #7880: IE11 and Edge use `Esc` for Escape key name.\n    esc: ['Esc', 'Escape'],\n    tab: 'Tab',\n    enter: 'Enter',\n    // #9112: IE11 uses `Spacebar` for Space key name.\n    space: [' ', 'Spacebar'],\n    // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.\n    up: ['Up', 'ArrowUp'],\n    left: ['Left', 'ArrowLeft'],\n    right: ['Right', 'ArrowRight'],\n    down: ['Down', 'ArrowDown'],\n    // #9112: IE11 uses `Del` for Delete key name.\n    'delete': ['Backspace', 'Delete', 'Del']\n  };\n\n  // #4868: modifiers that prevent the execution of the listener\n  // need to explicitly return null so that we can determine whether to remove\n  // the listener for .once\n  var genGuard = function (condition) { return (\"if(\" + condition + \")return null;\"); };\n\n  var modifierCode = {\n    stop: '$event.stopPropagation();',\n    prevent: '$event.preventDefault();',\n    self: genGuard(\"$event.target !== $event.currentTarget\"),\n    ctrl: genGuard(\"!$event.ctrlKey\"),\n    shift: genGuard(\"!$event.shiftKey\"),\n    alt: genGuard(\"!$event.altKey\"),\n    meta: genGuard(\"!$event.metaKey\"),\n    left: genGuard(\"'button' in $event && $event.button !== 0\"),\n    middle: genGuard(\"'button' in $event && $event.button !== 1\"),\n    right: genGuard(\"'button' in $event && $event.button !== 2\")\n  };\n\n  function genHandlers (\n    events,\n    isNative\n  ) {\n    var prefix = isNative ? 'nativeOn:' : 'on:';\n    var staticHandlers = \"\";\n    var dynamicHandlers = \"\";\n    for (var name in events) {\n      var handlerCode = genHandler(events[name]);\n      if (events[name] && events[name].dynamic) {\n        dynamicHandlers += name + \",\" + handlerCode + \",\";\n      } else {\n        staticHandlers += \"\\\"\" + name + \"\\\":\" + handlerCode + \",\";\n      }\n    }\n    staticHandlers = \"{\" + (staticHandlers.slice(0, -1)) + \"}\";\n    if (dynamicHandlers) {\n      return prefix + \"_d(\" + staticHandlers + \",[\" + (dynamicHandlers.slice(0, -1)) + \"])\"\n    } else {\n      return prefix + staticHandlers\n    }\n  }\n\n  function genHandler (handler) {\n    if (!handler) {\n      return 'function(){}'\n    }\n\n    if (Array.isArray(handler)) {\n      return (\"[\" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + \"]\")\n    }\n\n    var isMethodPath = simplePathRE.test(handler.value);\n    var isFunctionExpression = fnExpRE.test(handler.value);\n    var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));\n\n    if (!handler.modifiers) {\n      if (isMethodPath || isFunctionExpression) {\n        return handler.value\n      }\n      return (\"function($event){\" + (isFunctionInvocation ? (\"return \" + (handler.value)) : handler.value) + \"}\") // inline statement\n    } else {\n      var code = '';\n      var genModifierCode = '';\n      var keys = [];\n      for (var key in handler.modifiers) {\n        if (modifierCode[key]) {\n          genModifierCode += modifierCode[key];\n          // left/right\n          if (keyCodes[key]) {\n            keys.push(key);\n          }\n        } else if (key === 'exact') {\n          var modifiers = (handler.modifiers);\n          genModifierCode += genGuard(\n            ['ctrl', 'shift', 'alt', 'meta']\n              .filter(function (keyModifier) { return !modifiers[keyModifier]; })\n              .map(function (keyModifier) { return (\"$event.\" + keyModifier + \"Key\"); })\n              .join('||')\n          );\n        } else {\n          keys.push(key);\n        }\n      }\n      if (keys.length) {\n        code += genKeyFilter(keys);\n      }\n      // Make sure modifiers like prevent and stop get executed after key filtering\n      if (genModifierCode) {\n        code += genModifierCode;\n      }\n      var handlerCode = isMethodPath\n        ? (\"return \" + (handler.value) + \"($event)\")\n        : isFunctionExpression\n          ? (\"return (\" + (handler.value) + \")($event)\")\n          : isFunctionInvocation\n            ? (\"return \" + (handler.value))\n            : handler.value;\n      return (\"function($event){\" + code + handlerCode + \"}\")\n    }\n  }\n\n  function genKeyFilter (keys) {\n    return (\n      // make sure the key filters only apply to KeyboardEvents\n      // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake\n      // key events that do not have keyCode property...\n      \"if(!$event.type.indexOf('key')&&\" +\n      (keys.map(genFilterCode).join('&&')) + \")return null;\"\n    )\n  }\n\n  function genFilterCode (key) {\n    var keyVal = parseInt(key, 10);\n    if (keyVal) {\n      return (\"$event.keyCode!==\" + keyVal)\n    }\n    var keyCode = keyCodes[key];\n    var keyName = keyNames[key];\n    return (\n      \"_k($event.keyCode,\" +\n      (JSON.stringify(key)) + \",\" +\n      (JSON.stringify(keyCode)) + \",\" +\n      \"$event.key,\" +\n      \"\" + (JSON.stringify(keyName)) +\n      \")\"\n    )\n  }\n\n  /*  */\n\n  function on (el, dir) {\n    if (dir.modifiers) {\n      warn(\"v-on without argument does not support modifiers.\");\n    }\n    el.wrapListeners = function (code) { return (\"_g(\" + code + \",\" + (dir.value) + \")\"); };\n  }\n\n  /*  */\n\n  function bind$1 (el, dir) {\n    el.wrapData = function (code) {\n      return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + \",\" + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + \")\")\n    };\n  }\n\n  /*  */\n\n  var baseDirectives = {\n    on: on,\n    bind: bind$1,\n    cloak: noop\n  };\n\n  /*  */\n\n\n\n\n\n  var CodegenState = function CodegenState (options) {\n    this.options = options;\n    this.warn = options.warn || baseWarn;\n    this.transforms = pluckModuleFunction(options.modules, 'transformCode');\n    this.dataGenFns = pluckModuleFunction(options.modules, 'genData');\n    this.directives = extend(extend({}, baseDirectives), options.directives);\n    var isReservedTag = options.isReservedTag || no;\n    this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };\n    this.onceId = 0;\n    this.staticRenderFns = [];\n    this.pre = false;\n  };\n\n\n\n  function generate (\n    ast,\n    options\n  ) {\n    var state = new CodegenState(options);\n    var code = ast ? genElement(ast, state) : '_c(\"div\")';\n    return {\n      render: (\"with(this){return \" + code + \"}\"),\n      staticRenderFns: state.staticRenderFns\n    }\n  }\n\n  function genElement (el, state) {\n    if (el.parent) {\n      el.pre = el.pre || el.parent.pre;\n    }\n\n    if (el.staticRoot && !el.staticProcessed) {\n      return genStatic(el, state)\n    } else if (el.once && !el.onceProcessed) {\n      return genOnce(el, state)\n    } else if (el.for && !el.forProcessed) {\n      return genFor(el, state)\n    } else if (el.if && !el.ifProcessed) {\n      return genIf(el, state)\n    } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {\n      return genChildren(el, state) || 'void 0'\n    } else if (el.tag === 'slot') {\n      return genSlot(el, state)\n    } else {\n      // component or element\n      var code;\n      if (el.component) {\n        code = genComponent(el.component, el, state);\n      } else {\n        var data;\n        if (!el.plain || (el.pre && state.maybeComponent(el))) {\n          data = genData$2(el, state);\n        }\n\n        var children = el.inlineTemplate ? null : genChildren(el, state, true);\n        code = \"_c('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n      }\n      // module transforms\n      for (var i = 0; i < state.transforms.length; i++) {\n        code = state.transforms[i](el, code);\n      }\n      return code\n    }\n  }\n\n  // hoist static sub-trees out\n  function genStatic (el, state) {\n    el.staticProcessed = true;\n    // Some elements (templates) need to behave differently inside of a v-pre\n    // node.  All pre nodes are static roots, so we can use this as a location to\n    // wrap a state change and reset it upon exiting the pre node.\n    var originalPreState = state.pre;\n    if (el.pre) {\n      state.pre = el.pre;\n    }\n    state.staticRenderFns.push((\"with(this){return \" + (genElement(el, state)) + \"}\"));\n    state.pre = originalPreState;\n    return (\"_m(\" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n  }\n\n  // v-once\n  function genOnce (el, state) {\n    el.onceProcessed = true;\n    if (el.if && !el.ifProcessed) {\n      return genIf(el, state)\n    } else if (el.staticInFor) {\n      var key = '';\n      var parent = el.parent;\n      while (parent) {\n        if (parent.for) {\n          key = parent.key;\n          break\n        }\n        parent = parent.parent;\n      }\n      if (!key) {\n        state.warn(\n          \"v-once can only be used inside v-for that is keyed. \",\n          el.rawAttrsMap['v-once']\n        );\n        return genElement(el, state)\n      }\n      return (\"_o(\" + (genElement(el, state)) + \",\" + (state.onceId++) + \",\" + key + \")\")\n    } else {\n      return genStatic(el, state)\n    }\n  }\n\n  function genIf (\n    el,\n    state,\n    altGen,\n    altEmpty\n  ) {\n    el.ifProcessed = true; // avoid recursion\n    return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)\n  }\n\n  function genIfConditions (\n    conditions,\n    state,\n    altGen,\n    altEmpty\n  ) {\n    if (!conditions.length) {\n      return altEmpty || '_e()'\n    }\n\n    var condition = conditions.shift();\n    if (condition.exp) {\n      return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions, state, altGen, altEmpty)))\n    } else {\n      return (\"\" + (genTernaryExp(condition.block)))\n    }\n\n    // v-if with v-once should generate code like (a)?_m(0):_m(1)\n    function genTernaryExp (el) {\n      return altGen\n        ? altGen(el, state)\n        : el.once\n          ? genOnce(el, state)\n          : genElement(el, state)\n    }\n  }\n\n  function genFor (\n    el,\n    state,\n    altGen,\n    altHelper\n  ) {\n    var exp = el.for;\n    var alias = el.alias;\n    var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n    var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n\n    if (state.maybeComponent(el) &&\n      el.tag !== 'slot' &&\n      el.tag !== 'template' &&\n      !el.key\n    ) {\n      state.warn(\n        \"<\" + (el.tag) + \" v-for=\\\"\" + alias + \" in \" + exp + \"\\\">: component lists rendered with \" +\n        \"v-for should have explicit keys. \" +\n        \"See https://vuejs.org/guide/list.html#key for more info.\",\n        el.rawAttrsMap['v-for'],\n        true /* tip */\n      );\n    }\n\n    el.forProcessed = true; // avoid recursion\n    return (altHelper || '_l') + \"((\" + exp + \"),\" +\n      \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n        \"return \" + ((altGen || genElement)(el, state)) +\n      '})'\n  }\n\n  function genData$2 (el, state) {\n    var data = '{';\n\n    // directives first.\n    // directives may mutate the el's other properties before they are generated.\n    var dirs = genDirectives(el, state);\n    if (dirs) { data += dirs + ','; }\n\n    // key\n    if (el.key) {\n      data += \"key:\" + (el.key) + \",\";\n    }\n    // ref\n    if (el.ref) {\n      data += \"ref:\" + (el.ref) + \",\";\n    }\n    if (el.refInFor) {\n      data += \"refInFor:true,\";\n    }\n    // pre\n    if (el.pre) {\n      data += \"pre:true,\";\n    }\n    // record original tag name for components using \"is\" attribute\n    if (el.component) {\n      data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n    }\n    // module data generation functions\n    for (var i = 0; i < state.dataGenFns.length; i++) {\n      data += state.dataGenFns[i](el);\n    }\n    // attributes\n    if (el.attrs) {\n      data += \"attrs:\" + (genProps(el.attrs)) + \",\";\n    }\n    // DOM props\n    if (el.props) {\n      data += \"domProps:\" + (genProps(el.props)) + \",\";\n    }\n    // event handlers\n    if (el.events) {\n      data += (genHandlers(el.events, false)) + \",\";\n    }\n    if (el.nativeEvents) {\n      data += (genHandlers(el.nativeEvents, true)) + \",\";\n    }\n    // slot target\n    // only for non-scoped slots\n    if (el.slotTarget && !el.slotScope) {\n      data += \"slot:\" + (el.slotTarget) + \",\";\n    }\n    // scoped slots\n    if (el.scopedSlots) {\n      data += (genScopedSlots(el, el.scopedSlots, state)) + \",\";\n    }\n    // component v-model\n    if (el.model) {\n      data += \"model:{value:\" + (el.model.value) + \",callback:\" + (el.model.callback) + \",expression:\" + (el.model.expression) + \"},\";\n    }\n    // inline-template\n    if (el.inlineTemplate) {\n      var inlineTemplate = genInlineTemplate(el, state);\n      if (inlineTemplate) {\n        data += inlineTemplate + \",\";\n      }\n    }\n    data = data.replace(/,$/, '') + '}';\n    // v-bind dynamic argument wrap\n    // v-bind with dynamic arguments must be applied using the same v-bind object\n    // merge helper so that class/style/mustUseProp attrs are handled correctly.\n    if (el.dynamicAttrs) {\n      data = \"_b(\" + data + \",\\\"\" + (el.tag) + \"\\\",\" + (genProps(el.dynamicAttrs)) + \")\";\n    }\n    // v-bind data wrap\n    if (el.wrapData) {\n      data = el.wrapData(data);\n    }\n    // v-on data wrap\n    if (el.wrapListeners) {\n      data = el.wrapListeners(data);\n    }\n    return data\n  }\n\n  function genDirectives (el, state) {\n    var dirs = el.directives;\n    if (!dirs) { return }\n    var res = 'directives:[';\n    var hasRuntime = false;\n    var i, l, dir, needRuntime;\n    for (i = 0, l = dirs.length; i < l; i++) {\n      dir = dirs[i];\n      needRuntime = true;\n      var gen = state.directives[dir.name];\n      if (gen) {\n        // compile-time directive that manipulates AST.\n        // returns true if it also needs a runtime counterpart.\n        needRuntime = !!gen(el, dir, state.warn);\n      }\n      if (needRuntime) {\n        hasRuntime = true;\n        res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\" + (dir.isDynamicArg ? dir.arg : (\"\\\"\" + (dir.arg) + \"\\\"\"))) : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n      }\n    }\n    if (hasRuntime) {\n      return res.slice(0, -1) + ']'\n    }\n  }\n\n  function genInlineTemplate (el, state) {\n    var ast = el.children[0];\n    if (el.children.length !== 1 || ast.type !== 1) {\n      state.warn(\n        'Inline-template components must have exactly one child element.',\n        { start: el.start }\n      );\n    }\n    if (ast && ast.type === 1) {\n      var inlineRenderFns = generate(ast, state.options);\n      return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n    }\n  }\n\n  function genScopedSlots (\n    el,\n    slots,\n    state\n  ) {\n    // by default scoped slots are considered \"stable\", this allows child\n    // components with only scoped slots to skip forced updates from parent.\n    // but in some cases we have to bail-out of this optimization\n    // for example if the slot contains dynamic names, has v-if or v-for on them...\n    var needsForceUpdate = Object.keys(slots).some(function (key) {\n      var slot = slots[key];\n      return (\n        slot.slotTargetDynamic ||\n        slot.if ||\n        slot.for ||\n        containsSlotChild(slot) // is passing down slot from parent which may be dynamic\n      )\n    });\n\n    // #9534: if a component with scoped slots is inside a conditional branch,\n    // it's possible for the same component to be reused but with different\n    // compiled slot content. To avoid that, we generate a unique key based on\n    // the generated code of all the slot contents.\n    var needsKey = !!el.if;\n\n    // OR when it is inside another scoped slot or v-for (the reactivity may be\n    // disconnected due to the intermediate scope variable)\n    // #9438, #9506\n    // TODO: this can be further optimized by properly analyzing in-scope bindings\n    // and skip force updating ones that do not actually use scope variables.\n    if (!needsForceUpdate) {\n      var parent = el.parent;\n      while (parent) {\n        if (\n          (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||\n          parent.for\n        ) {\n          needsForceUpdate = true;\n          break\n        }\n        if (parent.if) {\n          needsKey = true;\n        }\n        parent = parent.parent;\n      }\n    }\n\n    var generatedSlots = Object.keys(slots)\n      .map(function (key) { return genScopedSlot(slots[key], state); })\n      .join(',');\n\n    return (\"scopedSlots:_u([\" + generatedSlots + \"]\" + (needsForceUpdate ? \",null,true\" : \"\") + (!needsForceUpdate && needsKey ? (\",null,false,\" + (hash(generatedSlots))) : \"\") + \")\")\n  }\n\n  function hash(str) {\n    var hash = 5381;\n    var i = str.length;\n    while(i) {\n      hash = (hash * 33) ^ str.charCodeAt(--i);\n    }\n    return hash >>> 0\n  }\n\n  function containsSlotChild (el) {\n    if (el.type === 1) {\n      if (el.tag === 'slot') {\n        return true\n      }\n      return el.children.some(containsSlotChild)\n    }\n    return false\n  }\n\n  function genScopedSlot (\n    el,\n    state\n  ) {\n    var isLegacySyntax = el.attrsMap['slot-scope'];\n    if (el.if && !el.ifProcessed && !isLegacySyntax) {\n      return genIf(el, state, genScopedSlot, \"null\")\n    }\n    if (el.for && !el.forProcessed) {\n      return genFor(el, state, genScopedSlot)\n    }\n    var slotScope = el.slotScope === emptySlotScopeToken\n      ? \"\"\n      : String(el.slotScope);\n    var fn = \"function(\" + slotScope + \"){\" +\n      \"return \" + (el.tag === 'template'\n        ? el.if && isLegacySyntax\n          ? (\"(\" + (el.if) + \")?\" + (genChildren(el, state) || 'undefined') + \":undefined\")\n          : genChildren(el, state) || 'undefined'\n        : genElement(el, state)) + \"}\";\n    // reverse proxy v-slot without scope on this.$slots\n    var reverseProxy = slotScope ? \"\" : \",proxy:true\";\n    return (\"{key:\" + (el.slotTarget || \"\\\"default\\\"\") + \",fn:\" + fn + reverseProxy + \"}\")\n  }\n\n  function genChildren (\n    el,\n    state,\n    checkSkip,\n    altGenElement,\n    altGenNode\n  ) {\n    var children = el.children;\n    if (children.length) {\n      var el$1 = children[0];\n      // optimize single v-for\n      if (children.length === 1 &&\n        el$1.for &&\n        el$1.tag !== 'template' &&\n        el$1.tag !== 'slot'\n      ) {\n        var normalizationType = checkSkip\n          ? state.maybeComponent(el$1) ? \",1\" : \",0\"\n          : \"\";\n        return (\"\" + ((altGenElement || genElement)(el$1, state)) + normalizationType)\n      }\n      var normalizationType$1 = checkSkip\n        ? getNormalizationType(children, state.maybeComponent)\n        : 0;\n      var gen = altGenNode || genNode;\n      return (\"[\" + (children.map(function (c) { return gen(c, state); }).join(',')) + \"]\" + (normalizationType$1 ? (\",\" + normalizationType$1) : ''))\n    }\n  }\n\n  // determine the normalization needed for the children array.\n  // 0: no normalization needed\n  // 1: simple normalization needed (possible 1-level deep nested array)\n  // 2: full normalization needed\n  function getNormalizationType (\n    children,\n    maybeComponent\n  ) {\n    var res = 0;\n    for (var i = 0; i < children.length; i++) {\n      var el = children[i];\n      if (el.type !== 1) {\n        continue\n      }\n      if (needsNormalization(el) ||\n          (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {\n        res = 2;\n        break\n      }\n      if (maybeComponent(el) ||\n          (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {\n        res = 1;\n      }\n    }\n    return res\n  }\n\n  function needsNormalization (el) {\n    return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'\n  }\n\n  function genNode (node, state) {\n    if (node.type === 1) {\n      return genElement(node, state)\n    } else if (node.type === 3 && node.isComment) {\n      return genComment(node)\n    } else {\n      return genText(node)\n    }\n  }\n\n  function genText (text) {\n    return (\"_v(\" + (text.type === 2\n      ? text.expression // no need for () because already wrapped in _s()\n      : transformSpecialNewlines(JSON.stringify(text.text))) + \")\")\n  }\n\n  function genComment (comment) {\n    return (\"_e(\" + (JSON.stringify(comment.text)) + \")\")\n  }\n\n  function genSlot (el, state) {\n    var slotName = el.slotName || '\"default\"';\n    var children = genChildren(el, state);\n    var res = \"_t(\" + slotName + (children ? (\",\" + children) : '');\n    var attrs = el.attrs || el.dynamicAttrs\n      ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({\n          // slot props are camelized\n          name: camelize(attr.name),\n          value: attr.value,\n          dynamic: attr.dynamic\n        }); }))\n      : null;\n    var bind$$1 = el.attrsMap['v-bind'];\n    if ((attrs || bind$$1) && !children) {\n      res += \",null\";\n    }\n    if (attrs) {\n      res += \",\" + attrs;\n    }\n    if (bind$$1) {\n      res += (attrs ? '' : ',null') + \",\" + bind$$1;\n    }\n    return res + ')'\n  }\n\n  // componentName is el.component, take it as argument to shun flow's pessimistic refinement\n  function genComponent (\n    componentName,\n    el,\n    state\n  ) {\n    var children = el.inlineTemplate ? null : genChildren(el, state, true);\n    return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n  }\n\n  function genProps (props) {\n    var staticProps = \"\";\n    var dynamicProps = \"\";\n    for (var i = 0; i < props.length; i++) {\n      var prop = props[i];\n      var value = transformSpecialNewlines(prop.value);\n      if (prop.dynamic) {\n        dynamicProps += (prop.name) + \",\" + value + \",\";\n      } else {\n        staticProps += \"\\\"\" + (prop.name) + \"\\\":\" + value + \",\";\n      }\n    }\n    staticProps = \"{\" + (staticProps.slice(0, -1)) + \"}\";\n    if (dynamicProps) {\n      return (\"_d(\" + staticProps + \",[\" + (dynamicProps.slice(0, -1)) + \"])\")\n    } else {\n      return staticProps\n    }\n  }\n\n  // #3895, #4268\n  function transformSpecialNewlines (text) {\n    return text\n      .replace(/\\u2028/g, '\\\\u2028')\n      .replace(/\\u2029/g, '\\\\u2029')\n  }\n\n  /*  */\n\n\n\n  // these keywords should not appear inside expressions, but operators like\n  // typeof, instanceof and in are allowed\n  var prohibitedKeywordRE = new RegExp('\\\\b' + (\n    'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n    'super,throw,while,yield,delete,export,import,return,switch,default,' +\n    'extends,finally,continue,debugger,function,arguments'\n  ).split(',').join('\\\\b|\\\\b') + '\\\\b');\n\n  // these unary operators should not be used as property/method names\n  var unaryOperatorsRE = new RegExp('\\\\b' + (\n    'delete,typeof,void'\n  ).split(',').join('\\\\s*\\\\([^\\\\)]*\\\\)|\\\\b') + '\\\\s*\\\\([^\\\\)]*\\\\)');\n\n  // strip strings in expressions\n  var stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n  // detect problematic expressions in a template\n  function detectErrors (ast, warn) {\n    if (ast) {\n      checkNode(ast, warn);\n    }\n  }\n\n  function checkNode (node, warn) {\n    if (node.type === 1) {\n      for (var name in node.attrsMap) {\n        if (dirRE.test(name)) {\n          var value = node.attrsMap[name];\n          if (value) {\n            var range = node.rawAttrsMap[name];\n            if (name === 'v-for') {\n              checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), warn, range);\n            } else if (onRE.test(name)) {\n              checkEvent(value, (name + \"=\\\"\" + value + \"\\\"\"), warn, range);\n            } else {\n              checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), warn, range);\n            }\n          }\n        }\n      }\n      if (node.children) {\n        for (var i = 0; i < node.children.length; i++) {\n          checkNode(node.children[i], warn);\n        }\n      }\n    } else if (node.type === 2) {\n      checkExpression(node.expression, node.text, warn, node);\n    }\n  }\n\n  function checkEvent (exp, text, warn, range) {\n    var stipped = exp.replace(stripStringRE, '');\n    var keywordMatch = stipped.match(unaryOperatorsRE);\n    if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {\n      warn(\n        \"avoid using JavaScript unary operator as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + (text.trim()),\n        range\n      );\n    }\n    checkExpression(exp, text, warn, range);\n  }\n\n  function checkFor (node, text, warn, range) {\n    checkExpression(node.for || '', text, warn, range);\n    checkIdentifier(node.alias, 'v-for alias', text, warn, range);\n    checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);\n    checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);\n  }\n\n  function checkIdentifier (\n    ident,\n    type,\n    text,\n    warn,\n    range\n  ) {\n    if (typeof ident === 'string') {\n      try {\n        new Function((\"var \" + ident + \"=_\"));\n      } catch (e) {\n        warn((\"invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + (text.trim())), range);\n      }\n    }\n  }\n\n  function checkExpression (exp, text, warn, range) {\n    try {\n      new Function((\"return \" + exp));\n    } catch (e) {\n      var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n      if (keywordMatch) {\n        warn(\n          \"avoid using JavaScript keyword as property name: \" +\n          \"\\\"\" + (keywordMatch[0]) + \"\\\"\\n  Raw expression: \" + (text.trim()),\n          range\n        );\n      } else {\n        warn(\n          \"invalid expression: \" + (e.message) + \" in\\n\\n\" +\n          \"    \" + exp + \"\\n\\n\" +\n          \"  Raw expression: \" + (text.trim()) + \"\\n\",\n          range\n        );\n      }\n    }\n  }\n\n  /*  */\n\n  var range = 2;\n\n  function generateCodeFrame (\n    source,\n    start,\n    end\n  ) {\n    if ( start === void 0 ) start = 0;\n    if ( end === void 0 ) end = source.length;\n\n    var lines = source.split(/\\r?\\n/);\n    var count = 0;\n    var res = [];\n    for (var i = 0; i < lines.length; i++) {\n      count += lines[i].length + 1;\n      if (count >= start) {\n        for (var j = i - range; j <= i + range || end > count; j++) {\n          if (j < 0 || j >= lines.length) { continue }\n          res.push((\"\" + (j + 1) + (repeat$1(\" \", 3 - String(j + 1).length)) + \"|  \" + (lines[j])));\n          var lineLength = lines[j].length;\n          if (j === i) {\n            // push underline\n            var pad = start - (count - lineLength) + 1;\n            var length = end > count ? lineLength - pad : end - start;\n            res.push(\"   |  \" + repeat$1(\" \", pad) + repeat$1(\"^\", length));\n          } else if (j > i) {\n            if (end > count) {\n              var length$1 = Math.min(end - count, lineLength);\n              res.push(\"   |  \" + repeat$1(\"^\", length$1));\n            }\n            count += lineLength + 1;\n          }\n        }\n        break\n      }\n    }\n    return res.join('\\n')\n  }\n\n  function repeat$1 (str, n) {\n    var result = '';\n    if (n > 0) {\n      while (true) { // eslint-disable-line\n        if (n & 1) { result += str; }\n        n >>>= 1;\n        if (n <= 0) { break }\n        str += str;\n      }\n    }\n    return result\n  }\n\n  /*  */\n\n\n\n  function createFunction (code, errors) {\n    try {\n      return new Function(code)\n    } catch (err) {\n      errors.push({ err: err, code: code });\n      return noop\n    }\n  }\n\n  function createCompileToFunctionFn (compile) {\n    var cache = Object.create(null);\n\n    return function compileToFunctions (\n      template,\n      options,\n      vm\n    ) {\n      options = extend({}, options);\n      var warn$$1 = options.warn || warn;\n      delete options.warn;\n\n      /* istanbul ignore if */\n      {\n        // detect possible CSP restriction\n        try {\n          new Function('return 1');\n        } catch (e) {\n          if (e.toString().match(/unsafe-eval|CSP/)) {\n            warn$$1(\n              'It seems you are using the standalone build of Vue.js in an ' +\n              'environment with Content Security Policy that prohibits unsafe-eval. ' +\n              'The template compiler cannot work in this environment. Consider ' +\n              'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n              'templates into render functions.'\n            );\n          }\n        }\n      }\n\n      // check cache\n      var key = options.delimiters\n        ? String(options.delimiters) + template\n        : template;\n      if (cache[key]) {\n        return cache[key]\n      }\n\n      // compile\n      var compiled = compile(template, options);\n\n      // check compilation errors/tips\n      {\n        if (compiled.errors && compiled.errors.length) {\n          if (options.outputSourceRange) {\n            compiled.errors.forEach(function (e) {\n              warn$$1(\n                \"Error compiling template:\\n\\n\" + (e.msg) + \"\\n\\n\" +\n                generateCodeFrame(template, e.start, e.end),\n                vm\n              );\n            });\n          } else {\n            warn$$1(\n              \"Error compiling template:\\n\\n\" + template + \"\\n\\n\" +\n              compiled.errors.map(function (e) { return (\"- \" + e); }).join('\\n') + '\\n',\n              vm\n            );\n          }\n        }\n        if (compiled.tips && compiled.tips.length) {\n          if (options.outputSourceRange) {\n            compiled.tips.forEach(function (e) { return tip(e.msg, vm); });\n          } else {\n            compiled.tips.forEach(function (msg) { return tip(msg, vm); });\n          }\n        }\n      }\n\n      // turn code into functions\n      var res = {};\n      var fnGenErrors = [];\n      res.render = createFunction(compiled.render, fnGenErrors);\n      res.staticRenderFns = compiled.staticRenderFns.map(function (code) {\n        return createFunction(code, fnGenErrors)\n      });\n\n      // check function generation errors.\n      // this should only happen if there is a bug in the compiler itself.\n      // mostly for codegen development use\n      /* istanbul ignore if */\n      {\n        if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {\n          warn$$1(\n            \"Failed to generate render function:\\n\\n\" +\n            fnGenErrors.map(function (ref) {\n              var err = ref.err;\n              var code = ref.code;\n\n              return ((err.toString()) + \" in\\n\\n\" + code + \"\\n\");\n          }).join('\\n'),\n            vm\n          );\n        }\n      }\n\n      return (cache[key] = res)\n    }\n  }\n\n  /*  */\n\n  function createCompilerCreator (baseCompile) {\n    return function createCompiler (baseOptions) {\n      function compile (\n        template,\n        options\n      ) {\n        var finalOptions = Object.create(baseOptions);\n        var errors = [];\n        var tips = [];\n\n        var warn = function (msg, range, tip) {\n          (tip ? tips : errors).push(msg);\n        };\n\n        if (options) {\n          if (options.outputSourceRange) {\n            // $flow-disable-line\n            var leadingSpaceLength = template.match(/^\\s*/)[0].length;\n\n            warn = function (msg, range, tip) {\n              var data = { msg: msg };\n              if (range) {\n                if (range.start != null) {\n                  data.start = range.start + leadingSpaceLength;\n                }\n                if (range.end != null) {\n                  data.end = range.end + leadingSpaceLength;\n                }\n              }\n              (tip ? tips : errors).push(data);\n            };\n          }\n          // merge custom modules\n          if (options.modules) {\n            finalOptions.modules =\n              (baseOptions.modules || []).concat(options.modules);\n          }\n          // merge custom directives\n          if (options.directives) {\n            finalOptions.directives = extend(\n              Object.create(baseOptions.directives || null),\n              options.directives\n            );\n          }\n          // copy other options\n          for (var key in options) {\n            if (key !== 'modules' && key !== 'directives') {\n              finalOptions[key] = options[key];\n            }\n          }\n        }\n\n        finalOptions.warn = warn;\n\n        var compiled = baseCompile(template.trim(), finalOptions);\n        {\n          detectErrors(compiled.ast, warn);\n        }\n        compiled.errors = errors;\n        compiled.tips = tips;\n        return compiled\n      }\n\n      return {\n        compile: compile,\n        compileToFunctions: createCompileToFunctionFn(compile)\n      }\n    }\n  }\n\n  /*  */\n\n  // `createCompilerCreator` allows creating compilers that use alternative\n  // parser/optimizer/codegen, e.g the SSR optimizing compiler.\n  // Here we just export a default compiler using the default parts.\n  var createCompiler = createCompilerCreator(function baseCompile (\n    template,\n    options\n  ) {\n    var ast = parse(template.trim(), options);\n    if (options.optimize !== false) {\n      optimize(ast, options);\n    }\n    var code = generate(ast, options);\n    return {\n      ast: ast,\n      render: code.render,\n      staticRenderFns: code.staticRenderFns\n    }\n  });\n\n  /*  */\n\n  var ref$1 = createCompiler(baseOptions);\n  var compile = ref$1.compile;\n  var compileToFunctions = ref$1.compileToFunctions;\n\n  /*  */\n\n  // check whether current browser encodes a char inside attribute values\n  var div;\n  function getShouldDecode (href) {\n    div = div || document.createElement('div');\n    div.innerHTML = href ? \"<a href=\\\"\\n\\\"/>\" : \"<div a=\\\"\\n\\\"/>\";\n    return div.innerHTML.indexOf('&#10;') > 0\n  }\n\n  // #3663: IE encodes newlines inside attribute values while other browsers don't\n  var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;\n  // #6828: chrome encodes content in a[href]\n  var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;\n\n  /*  */\n\n  var idToTemplate = cached(function (id) {\n    var el = query(id);\n    return el && el.innerHTML\n  });\n\n  var mount = Vue.prototype.$mount;\n  Vue.prototype.$mount = function (\n    el,\n    hydrating\n  ) {\n    el = el && query(el);\n\n    /* istanbul ignore if */\n    if (el === document.body || el === document.documentElement) {\n      warn(\n        \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n      );\n      return this\n    }\n\n    var options = this.$options;\n    // resolve template/el and convert to render function\n    if (!options.render) {\n      var template = options.template;\n      if (template) {\n        if (typeof template === 'string') {\n          if (template.charAt(0) === '#') {\n            template = idToTemplate(template);\n            /* istanbul ignore if */\n            if (!template) {\n              warn(\n                (\"Template element not found or is empty: \" + (options.template)),\n                this\n              );\n            }\n          }\n        } else if (template.nodeType) {\n          template = template.innerHTML;\n        } else {\n          {\n            warn('invalid template option:' + template, this);\n          }\n          return this\n        }\n      } else if (el) {\n        template = getOuterHTML(el);\n      }\n      if (template) {\n        /* istanbul ignore if */\n        if (config.performance && mark) {\n          mark('compile');\n        }\n\n        var ref = compileToFunctions(template, {\n          outputSourceRange: \"development\" !== 'production',\n          shouldDecodeNewlines: shouldDecodeNewlines,\n          shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,\n          delimiters: options.delimiters,\n          comments: options.comments\n        }, this);\n        var render = ref.render;\n        var staticRenderFns = ref.staticRenderFns;\n        options.render = render;\n        options.staticRenderFns = staticRenderFns;\n\n        /* istanbul ignore if */\n        if (config.performance && mark) {\n          mark('compile end');\n          measure((\"vue \" + (this._name) + \" compile\"), 'compile', 'compile end');\n        }\n      }\n    }\n    return mount.call(this, el, hydrating)\n  };\n\n  /**\n   * Get outerHTML of elements, taking care\n   * of SVG elements in IE as well.\n   */\n  function getOuterHTML (el) {\n    if (el.outerHTML) {\n      return el.outerHTML\n    } else {\n      var container = document.createElement('div');\n      container.appendChild(el.cloneNode(true));\n      return container.innerHTML\n    }\n  }\n\n  Vue.compile = compileToFunctions;\n\n  return Vue;\n\n}));\n"
  },
  {
    "path": "calllib-v3/web-ie/lib/vue-router-3.0.2.js",
    "content": "/*!\n  * vue-router v3.0.2\n  * (c) 2018 Evan You\n  * @license MIT\n  */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.VueRouter = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\nfunction assert (condition, message) {\n  if (!condition) {\n    throw new Error((\"[vue-router] \" + message))\n  }\n}\n\nfunction warn (condition, message) {\n  if (\"development\" !== 'production' && !condition) {\n    typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n  }\n}\n\nfunction isError (err) {\n  return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction extend (a, b) {\n  for (var key in b) {\n    a[key] = b[key];\n  }\n  return a\n}\n\nvar View = {\n  name: 'RouterView',\n  functional: true,\n  props: {\n    name: {\n      type: String,\n      default: 'default'\n    }\n  },\n  render: function render (_, ref) {\n    var props = ref.props;\n    var children = ref.children;\n    var parent = ref.parent;\n    var data = ref.data;\n\n    // used by devtools to display a router-view badge\n    data.routerView = true;\n\n    // directly use parent context's createElement() function\n    // so that components rendered by router-view can resolve named slots\n    var h = parent.$createElement;\n    var name = props.name;\n    var route = parent.$route;\n    var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n    // determine current view depth, also check to see if the tree\n    // has been toggled inactive but kept-alive.\n    var depth = 0;\n    var inactive = false;\n    while (parent && parent._routerRoot !== parent) {\n      if (parent.$vnode && parent.$vnode.data.routerView) {\n        depth++;\n      }\n      if (parent._inactive) {\n        inactive = true;\n      }\n      parent = parent.$parent;\n    }\n    data.routerViewDepth = depth;\n\n    // render previous view if the tree is inactive and kept-alive\n    if (inactive) {\n      return h(cache[name], data, children)\n    }\n\n    var matched = route.matched[depth];\n    // render empty node if no matched route\n    if (!matched) {\n      cache[name] = null;\n      return h()\n    }\n\n    var component = cache[name] = matched.components[name];\n\n    // attach instance registration hook\n    // this will be called in the instance's injected lifecycle hooks\n    data.registerRouteInstance = function (vm, val) {\n      // val could be undefined for unregistration\n      var current = matched.instances[name];\n      if (\n        (val && current !== vm) ||\n        (!val && current === vm)\n      ) {\n        matched.instances[name] = val;\n      }\n    }\n\n    // also register instance in prepatch hook\n    // in case the same component instance is reused across different routes\n    ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n      matched.instances[name] = vnode.componentInstance;\n    };\n\n    // resolve props\n    var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);\n    if (propsToPass) {\n      // clone to prevent mutation\n      propsToPass = data.props = extend({}, propsToPass);\n      // pass non-declared props as attrs\n      var attrs = data.attrs = data.attrs || {};\n      for (var key in propsToPass) {\n        if (!component.props || !(key in component.props)) {\n          attrs[key] = propsToPass[key];\n          delete propsToPass[key];\n        }\n      }\n    }\n\n    return h(component, data, children)\n  }\n}\n\nfunction resolveProps (route, config) {\n  switch (typeof config) {\n    case 'undefined':\n      return\n    case 'object':\n      return config\n    case 'function':\n      return config(route)\n    case 'boolean':\n      return config ? route.params : undefined\n    default:\n      {\n        warn(\n          false,\n          \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n          \"expecting an object, function or boolean.\"\n        );\n      }\n  }\n}\n\n/*  */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n  .replace(encodeReserveRE, encodeReserveReplacer)\n  .replace(commaRE, ','); };\n\nvar decode = decodeURIComponent;\n\nfunction resolveQuery (\n  query,\n  extraQuery,\n  _parseQuery\n) {\n  if ( extraQuery === void 0 ) extraQuery = {};\n\n  var parse = _parseQuery || parseQuery;\n  var parsedQuery;\n  try {\n    parsedQuery = parse(query || '');\n  } catch (e) {\n    \"development\" !== 'production' && warn(false, e.message);\n    parsedQuery = {};\n  }\n  for (var key in extraQuery) {\n    parsedQuery[key] = extraQuery[key];\n  }\n  return parsedQuery\n}\n\nfunction parseQuery (query) {\n  var res = {};\n\n  query = query.trim().replace(/^(\\?|#|&)/, '');\n\n  if (!query) {\n    return res\n  }\n\n  query.split('&').forEach(function (param) {\n    var parts = param.replace(/\\+/g, ' ').split('=');\n    var key = decode(parts.shift());\n    var val = parts.length > 0\n      ? decode(parts.join('='))\n      : null;\n\n    if (res[key] === undefined) {\n      res[key] = val;\n    } else if (Array.isArray(res[key])) {\n      res[key].push(val);\n    } else {\n      res[key] = [res[key], val];\n    }\n  });\n\n  return res\n}\n\nfunction stringifyQuery (obj) {\n  var res = obj ? Object.keys(obj).map(function (key) {\n    var val = obj[key];\n\n    if (val === undefined) {\n      return ''\n    }\n\n    if (val === null) {\n      return encode(key)\n    }\n\n    if (Array.isArray(val)) {\n      var result = [];\n      val.forEach(function (val2) {\n        if (val2 === undefined) {\n          return\n        }\n        if (val2 === null) {\n          result.push(encode(key));\n        } else {\n          result.push(encode(key) + '=' + encode(val2));\n        }\n      });\n      return result.join('&')\n    }\n\n    return encode(key) + '=' + encode(val)\n  }).filter(function (x) { return x.length > 0; }).join('&') : null;\n  return res ? (\"?\" + res) : ''\n}\n\n/*  */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n  record,\n  location,\n  redirectedFrom,\n  router\n) {\n  var stringifyQuery$$1 = router && router.options.stringifyQuery;\n\n  var query = location.query || {};\n  try {\n    query = clone(query);\n  } catch (e) {}\n\n  var route = {\n    name: location.name || (record && record.name),\n    meta: (record && record.meta) || {},\n    path: location.path || '/',\n    hash: location.hash || '',\n    query: query,\n    params: location.params || {},\n    fullPath: getFullPath(location, stringifyQuery$$1),\n    matched: record ? formatMatch(record) : []\n  };\n  if (redirectedFrom) {\n    route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1);\n  }\n  return Object.freeze(route)\n}\n\nfunction clone (value) {\n  if (Array.isArray(value)) {\n    return value.map(clone)\n  } else if (value && typeof value === 'object') {\n    var res = {};\n    for (var key in value) {\n      res[key] = clone(value[key]);\n    }\n    return res\n  } else {\n    return value\n  }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n  path: '/'\n});\n\nfunction formatMatch (record) {\n  var res = [];\n  while (record) {\n    res.unshift(record);\n    record = record.parent;\n  }\n  return res\n}\n\nfunction getFullPath (\n  ref,\n  _stringifyQuery\n) {\n  var path = ref.path;\n  var query = ref.query; if ( query === void 0 ) query = {};\n  var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n  var stringify = _stringifyQuery || stringifyQuery;\n  return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b) {\n  if (b === START) {\n    return a === b\n  } else if (!b) {\n    return false\n  } else if (a.path && b.path) {\n    return (\n      a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query)\n    )\n  } else if (a.name && b.name) {\n    return (\n      a.name === b.name &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query) &&\n      isObjectEqual(a.params, b.params)\n    )\n  } else {\n    return false\n  }\n}\n\nfunction isObjectEqual (a, b) {\n  if ( a === void 0 ) a = {};\n  if ( b === void 0 ) b = {};\n\n  // handle null value #1566\n  if (!a || !b) { return a === b }\n  var aKeys = Object.keys(a);\n  var bKeys = Object.keys(b);\n  if (aKeys.length !== bKeys.length) {\n    return false\n  }\n  return aKeys.every(function (key) {\n    var aVal = a[key];\n    var bVal = b[key];\n    // check nested equality\n    if (typeof aVal === 'object' && typeof bVal === 'object') {\n      return isObjectEqual(aVal, bVal)\n    }\n    return String(aVal) === String(bVal)\n  })\n}\n\nfunction isIncludedRoute (current, target) {\n  return (\n    current.path.replace(trailingSlashRE, '/').indexOf(\n      target.path.replace(trailingSlashRE, '/')\n    ) === 0 &&\n    (!target.hash || current.hash === target.hash) &&\n    queryIncludes(current.query, target.query)\n  )\n}\n\nfunction queryIncludes (current, target) {\n  for (var key in target) {\n    if (!(key in current)) {\n      return false\n    }\n  }\n  return true\n}\n\n/*  */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar Link = {\n  name: 'RouterLink',\n  props: {\n    to: {\n      type: toTypes,\n      required: true\n    },\n    tag: {\n      type: String,\n      default: 'a'\n    },\n    exact: Boolean,\n    append: Boolean,\n    replace: Boolean,\n    activeClass: String,\n    exactActiveClass: String,\n    event: {\n      type: eventTypes,\n      default: 'click'\n    }\n  },\n  render: function render (h) {\n    var this$1 = this;\n\n    var router = this.$router;\n    var current = this.$route;\n    var ref = router.resolve(this.to, current, this.append);\n    var location = ref.location;\n    var route = ref.route;\n    var href = ref.href;\n\n    var classes = {};\n    var globalActiveClass = router.options.linkActiveClass;\n    var globalExactActiveClass = router.options.linkExactActiveClass;\n    // Support global empty active class\n    var activeClassFallback = globalActiveClass == null\n      ? 'router-link-active'\n      : globalActiveClass;\n    var exactActiveClassFallback = globalExactActiveClass == null\n      ? 'router-link-exact-active'\n      : globalExactActiveClass;\n    var activeClass = this.activeClass == null\n      ? activeClassFallback\n      : this.activeClass;\n    var exactActiveClass = this.exactActiveClass == null\n      ? exactActiveClassFallback\n      : this.exactActiveClass;\n    var compareTarget = location.path\n      ? createRoute(null, location, null, router)\n      : route;\n\n    classes[exactActiveClass] = isSameRoute(current, compareTarget);\n    classes[activeClass] = this.exact\n      ? classes[exactActiveClass]\n      : isIncludedRoute(current, compareTarget);\n\n    var handler = function (e) {\n      if (guardEvent(e)) {\n        if (this$1.replace) {\n          router.replace(location);\n        } else {\n          router.push(location);\n        }\n      }\n    };\n\n    var on = { click: guardEvent };\n    if (Array.isArray(this.event)) {\n      this.event.forEach(function (e) { on[e] = handler; });\n    } else {\n      on[this.event] = handler;\n    }\n\n    var data = {\n      class: classes\n    };\n\n    if (this.tag === 'a') {\n      data.on = on;\n      data.attrs = { href: href };\n    } else {\n      // find the first <a> child and apply listener and href\n      var a = findAnchor(this.$slots.default);\n      if (a) {\n        // in case the <a> is a static node\n        a.isStatic = false;\n        var aData = a.data = extend({}, a.data);\n        aData.on = on;\n        var aAttrs = a.data.attrs = extend({}, a.data.attrs);\n        aAttrs.href = href;\n      } else {\n        // doesn't have <a> child, apply listener to self\n        data.on = on;\n      }\n    }\n\n    return h(this.tag, data, this.$slots.default)\n  }\n}\n\nfunction guardEvent (e) {\n  // don't redirect with control keys\n  if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n  // don't redirect when preventDefault called\n  if (e.defaultPrevented) { return }\n  // don't redirect on right click\n  if (e.button !== undefined && e.button !== 0) { return }\n  // don't redirect if `target=\"_blank\"`\n  if (e.currentTarget && e.currentTarget.getAttribute) {\n    var target = e.currentTarget.getAttribute('target');\n    if (/\\b_blank\\b/i.test(target)) { return }\n  }\n  // this may be a Weex event which doesn't have this method\n  if (e.preventDefault) {\n    e.preventDefault();\n  }\n  return true\n}\n\nfunction findAnchor (children) {\n  if (children) {\n    var child;\n    for (var i = 0; i < children.length; i++) {\n      child = children[i];\n      if (child.tag === 'a') {\n        return child\n      }\n      if (child.children && (child = findAnchor(child.children))) {\n        return child\n      }\n    }\n  }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n  if (install.installed && _Vue === Vue) { return }\n  install.installed = true;\n\n  _Vue = Vue;\n\n  var isDef = function (v) { return v !== undefined; };\n\n  var registerInstance = function (vm, callVal) {\n    var i = vm.$options._parentVnode;\n    if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n      i(vm, callVal);\n    }\n  };\n\n  Vue.mixin({\n    beforeCreate: function beforeCreate () {\n      if (isDef(this.$options.router)) {\n        this._routerRoot = this;\n        this._router = this.$options.router;\n        this._router.init(this);\n        Vue.util.defineReactive(this, '_route', this._router.history.current);\n      } else {\n        this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n      }\n      registerInstance(this, this);\n    },\n    destroyed: function destroyed () {\n      registerInstance(this);\n    }\n  });\n\n  Object.defineProperty(Vue.prototype, '$router', {\n    get: function get () { return this._routerRoot._router }\n  });\n\n  Object.defineProperty(Vue.prototype, '$route', {\n    get: function get () { return this._routerRoot._route }\n  });\n\n  Vue.component('RouterView', View);\n  Vue.component('RouterLink', Link);\n\n  var strats = Vue.config.optionMergeStrategies;\n  // use the same hook merging strategy for route hooks\n  strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/*  */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/*  */\n\nfunction resolvePath (\n  relative,\n  base,\n  append\n) {\n  var firstChar = relative.charAt(0);\n  if (firstChar === '/') {\n    return relative\n  }\n\n  if (firstChar === '?' || firstChar === '#') {\n    return base + relative\n  }\n\n  var stack = base.split('/');\n\n  // remove trailing segment if:\n  // - not appending\n  // - appending to trailing slash (last segment is empty)\n  if (!append || !stack[stack.length - 1]) {\n    stack.pop();\n  }\n\n  // resolve relative path\n  var segments = relative.replace(/^\\//, '').split('/');\n  for (var i = 0; i < segments.length; i++) {\n    var segment = segments[i];\n    if (segment === '..') {\n      stack.pop();\n    } else if (segment !== '.') {\n      stack.push(segment);\n    }\n  }\n\n  // ensure leading slash\n  if (stack[0] !== '') {\n    stack.unshift('');\n  }\n\n  return stack.join('/')\n}\n\nfunction parsePath (path) {\n  var hash = '';\n  var query = '';\n\n  var hashIndex = path.indexOf('#');\n  if (hashIndex >= 0) {\n    hash = path.slice(hashIndex);\n    path = path.slice(0, hashIndex);\n  }\n\n  var queryIndex = path.indexOf('?');\n  if (queryIndex >= 0) {\n    query = path.slice(queryIndex + 1);\n    path = path.slice(0, queryIndex);\n  }\n\n  return {\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\nfunction cleanPath (path) {\n  return path.replace(/\\/\\//g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n  return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n  // Match escaped characters that would otherwise appear in future matches.\n  // This allows the user to escape special characters that won't transform.\n  '(\\\\\\\\.)',\n  // Match Express-style parameters and un-named parameters with a prefix\n  // and optional suffixes. Matches appear as:\n  //\n  // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n  // \"/route(\\\\d+)\"  => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n  // \"/*\"            => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n  '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param  {string}  str\n * @param  {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n  var tokens = [];\n  var key = 0;\n  var index = 0;\n  var path = '';\n  var defaultDelimiter = options && options.delimiter || '/';\n  var res;\n\n  while ((res = PATH_REGEXP.exec(str)) != null) {\n    var m = res[0];\n    var escaped = res[1];\n    var offset = res.index;\n    path += str.slice(index, offset);\n    index = offset + m.length;\n\n    // Ignore already escaped sequences.\n    if (escaped) {\n      path += escaped[1];\n      continue\n    }\n\n    var next = str[index];\n    var prefix = res[2];\n    var name = res[3];\n    var capture = res[4];\n    var group = res[5];\n    var modifier = res[6];\n    var asterisk = res[7];\n\n    // Push the current path onto the tokens.\n    if (path) {\n      tokens.push(path);\n      path = '';\n    }\n\n    var partial = prefix != null && next != null && next !== prefix;\n    var repeat = modifier === '+' || modifier === '*';\n    var optional = modifier === '?' || modifier === '*';\n    var delimiter = res[2] || defaultDelimiter;\n    var pattern = capture || group;\n\n    tokens.push({\n      name: name || key++,\n      prefix: prefix || '',\n      delimiter: delimiter,\n      optional: optional,\n      repeat: repeat,\n      partial: partial,\n      asterisk: !!asterisk,\n      pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n    });\n  }\n\n  // Match any characters still remaining.\n  if (index < str.length) {\n    path += str.substr(index);\n  }\n\n  // If the path exists, push it onto the end.\n  if (path) {\n    tokens.push(path);\n  }\n\n  return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param  {string}             str\n * @param  {Object=}            options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n  return tokensToFunction(parse(str, options))\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n  return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n  return encodeURI(str).replace(/[?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n  // Compile all the tokens into regexps.\n  var matches = new Array(tokens.length);\n\n  // Compile all the patterns before compilation.\n  for (var i = 0; i < tokens.length; i++) {\n    if (typeof tokens[i] === 'object') {\n      matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n    }\n  }\n\n  return function (obj, opts) {\n    var path = '';\n    var data = obj || {};\n    var options = opts || {};\n    var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n    for (var i = 0; i < tokens.length; i++) {\n      var token = tokens[i];\n\n      if (typeof token === 'string') {\n        path += token;\n\n        continue\n      }\n\n      var value = data[token.name];\n      var segment;\n\n      if (value == null) {\n        if (token.optional) {\n          // Prepend partial segment prefixes.\n          if (token.partial) {\n            path += token.prefix;\n          }\n\n          continue\n        } else {\n          throw new TypeError('Expected \"' + token.name + '\" to be defined')\n        }\n      }\n\n      if (isarray(value)) {\n        if (!token.repeat) {\n          throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n        }\n\n        if (value.length === 0) {\n          if (token.optional) {\n            continue\n          } else {\n            throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n          }\n        }\n\n        for (var j = 0; j < value.length; j++) {\n          segment = encode(value[j]);\n\n          if (!matches[i].test(segment)) {\n            throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n          }\n\n          path += (j === 0 ? token.prefix : token.delimiter) + segment;\n        }\n\n        continue\n      }\n\n      segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n      if (!matches[i].test(segment)) {\n        throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n      }\n\n      path += token.prefix + segment;\n    }\n\n    return path\n  }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param  {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n  return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param  {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n  return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param  {!RegExp} re\n * @param  {Array}   keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n  re.keys = keys;\n  return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param  {Object} options\n * @return {string}\n */\nfunction flags (options) {\n  return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param  {!RegExp} path\n * @param  {!Array}  keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n  // Use a negative lookahead to match only capturing groups.\n  var groups = path.source.match(/\\((?!\\?)/g);\n\n  if (groups) {\n    for (var i = 0; i < groups.length; i++) {\n      keys.push({\n        name: i,\n        prefix: null,\n        delimiter: null,\n        optional: false,\n        repeat: false,\n        partial: false,\n        asterisk: false,\n        pattern: null\n      });\n    }\n  }\n\n  return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param  {!Array}  path\n * @param  {Array}   keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n  var parts = [];\n\n  for (var i = 0; i < path.length; i++) {\n    parts.push(pathToRegexp(path[i], keys, options).source);\n  }\n\n  var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n  return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param  {string}  path\n * @param  {!Array}  keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n  return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param  {!Array}          tokens\n * @param  {(Array|Object)=} keys\n * @param  {Object=}         options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options);\n    keys = [];\n  }\n\n  options = options || {};\n\n  var strict = options.strict;\n  var end = options.end !== false;\n  var route = '';\n\n  // Iterate over the tokens and create our regexp string.\n  for (var i = 0; i < tokens.length; i++) {\n    var token = tokens[i];\n\n    if (typeof token === 'string') {\n      route += escapeString(token);\n    } else {\n      var prefix = escapeString(token.prefix);\n      var capture = '(?:' + token.pattern + ')';\n\n      keys.push(token);\n\n      if (token.repeat) {\n        capture += '(?:' + prefix + capture + ')*';\n      }\n\n      if (token.optional) {\n        if (!token.partial) {\n          capture = '(?:' + prefix + '(' + capture + '))?';\n        } else {\n          capture = prefix + '(' + capture + ')?';\n        }\n      } else {\n        capture = prefix + '(' + capture + ')';\n      }\n\n      route += capture;\n    }\n  }\n\n  var delimiter = escapeString(options.delimiter || '/');\n  var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n  // In non-strict mode we allow a slash at the end of match. If the path to\n  // match already ends with a slash, we remove it for consistency. The slash\n  // is valid at the end of a path match, not in the middle. This is important\n  // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n  if (!strict) {\n    route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n  }\n\n  if (end) {\n    route += '$';\n  } else {\n    // In non-ending mode, we need the capturing groups to match as much as\n    // possible by using a positive lookahead to the end or next path segment.\n    route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n  }\n\n  return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param  {(string|RegExp|Array)} path\n * @param  {(Array|Object)=}       keys\n * @param  {Object=}               options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options);\n    keys = [];\n  }\n\n  options = options || {};\n\n  if (path instanceof RegExp) {\n    return regexpToRegexp(path, /** @type {!Array} */ (keys))\n  }\n\n  if (isarray(path)) {\n    return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n  }\n\n  return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/*  */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n  path,\n  params,\n  routeMsg\n) {\n  try {\n    var filler =\n      regexpCompileCache[path] ||\n      (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n    return filler(params || {}, { pretty: true })\n  } catch (e) {\n    {\n      warn(false, (\"missing param for \" + routeMsg + \": \" + (e.message)));\n    }\n    return ''\n  }\n}\n\n/*  */\n\nfunction createRouteMap (\n  routes,\n  oldPathList,\n  oldPathMap,\n  oldNameMap\n) {\n  // the path list is used to control path matching priority\n  var pathList = oldPathList || [];\n  // $flow-disable-line\n  var pathMap = oldPathMap || Object.create(null);\n  // $flow-disable-line\n  var nameMap = oldNameMap || Object.create(null);\n\n  routes.forEach(function (route) {\n    addRouteRecord(pathList, pathMap, nameMap, route);\n  });\n\n  // ensure wildcard routes are always at the end\n  for (var i = 0, l = pathList.length; i < l; i++) {\n    if (pathList[i] === '*') {\n      pathList.push(pathList.splice(i, 1)[0]);\n      l--;\n      i--;\n    }\n  }\n\n  return {\n    pathList: pathList,\n    pathMap: pathMap,\n    nameMap: nameMap\n  }\n}\n\nfunction addRouteRecord (\n  pathList,\n  pathMap,\n  nameMap,\n  route,\n  parent,\n  matchAs\n) {\n  var path = route.path;\n  var name = route.name;\n  {\n    assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n    assert(\n      typeof route.component !== 'string',\n      \"route config \\\"component\\\" for path: \" + (String(path || name)) + \" cannot be a \" +\n      \"string id. Use an actual component instead.\"\n    );\n  }\n\n  var pathToRegexpOptions = route.pathToRegexpOptions || {};\n  var normalizedPath = normalizePath(\n    path,\n    parent,\n    pathToRegexpOptions.strict\n  );\n\n  if (typeof route.caseSensitive === 'boolean') {\n    pathToRegexpOptions.sensitive = route.caseSensitive;\n  }\n\n  var record = {\n    path: normalizedPath,\n    regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n    components: route.components || { default: route.component },\n    instances: {},\n    name: name,\n    parent: parent,\n    matchAs: matchAs,\n    redirect: route.redirect,\n    beforeEnter: route.beforeEnter,\n    meta: route.meta || {},\n    props: route.props == null\n      ? {}\n      : route.components\n        ? route.props\n        : { default: route.props }\n  };\n\n  if (route.children) {\n    // Warn if route is named, does not redirect and has a default child route.\n    // If users navigate to this route by name, the default child will\n    // not be rendered (GH Issue #629)\n    {\n      if (route.name && !route.redirect && route.children.some(function (child) { return /^\\/?$/.test(child.path); })) {\n        warn(\n          false,\n          \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n          \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n          \"the default child route will not be rendered. Remove the name from \" +\n          \"this route and use the name of the default child route for named \" +\n          \"links instead.\"\n        );\n      }\n    }\n    route.children.forEach(function (child) {\n      var childMatchAs = matchAs\n        ? cleanPath((matchAs + \"/\" + (child.path)))\n        : undefined;\n      addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n    });\n  }\n\n  if (route.alias !== undefined) {\n    var aliases = Array.isArray(route.alias)\n      ? route.alias\n      : [route.alias];\n\n    aliases.forEach(function (alias) {\n      var aliasRoute = {\n        path: alias,\n        children: route.children\n      };\n      addRouteRecord(\n        pathList,\n        pathMap,\n        nameMap,\n        aliasRoute,\n        parent,\n        record.path || '/' // matchAs\n      );\n    });\n  }\n\n  if (!pathMap[record.path]) {\n    pathList.push(record.path);\n    pathMap[record.path] = record;\n  }\n\n  if (name) {\n    if (!nameMap[name]) {\n      nameMap[name] = record;\n    } else if (\"development\" !== 'production' && !matchAs) {\n      warn(\n        false,\n        \"Duplicate named routes definition: \" +\n        \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n      );\n    }\n  }\n}\n\nfunction compileRouteRegex (path, pathToRegexpOptions) {\n  var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n  {\n    var keys = Object.create(null);\n    regex.keys.forEach(function (key) {\n      warn(!keys[key.name], (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\"));\n      keys[key.name] = true;\n    });\n  }\n  return regex\n}\n\nfunction normalizePath (path, parent, strict) {\n  if (!strict) { path = path.replace(/\\/$/, ''); }\n  if (path[0] === '/') { return path }\n  if (parent == null) { return path }\n  return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/*  */\n\nfunction normalizeLocation (\n  raw,\n  current,\n  append,\n  router\n) {\n  var next = typeof raw === 'string' ? { path: raw } : raw;\n  // named target\n  if (next.name || next._normalized) {\n    return next\n  }\n\n  // relative params\n  if (!next.path && next.params && current) {\n    next = extend({}, next);\n    next._normalized = true;\n    var params = extend(extend({}, current.params), next.params);\n    if (current.name) {\n      next.name = current.name;\n      next.params = params;\n    } else if (current.matched.length) {\n      var rawPath = current.matched[current.matched.length - 1].path;\n      next.path = fillParams(rawPath, params, (\"path \" + (current.path)));\n    } else {\n      warn(false, \"relative params navigation requires a current route.\");\n    }\n    return next\n  }\n\n  var parsedPath = parsePath(next.path || '');\n  var basePath = (current && current.path) || '/';\n  var path = parsedPath.path\n    ? resolvePath(parsedPath.path, basePath, append || next.append)\n    : basePath;\n\n  var query = resolveQuery(\n    parsedPath.query,\n    next.query,\n    router && router.options.parseQuery\n  );\n\n  var hash = next.hash || parsedPath.hash;\n  if (hash && hash.charAt(0) !== '#') {\n    hash = \"#\" + hash;\n  }\n\n  return {\n    _normalized: true,\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\n/*  */\n\n\n\nfunction createMatcher (\n  routes,\n  router\n) {\n  var ref = createRouteMap(routes);\n  var pathList = ref.pathList;\n  var pathMap = ref.pathMap;\n  var nameMap = ref.nameMap;\n\n  function addRoutes (routes) {\n    createRouteMap(routes, pathList, pathMap, nameMap);\n  }\n\n  function match (\n    raw,\n    currentRoute,\n    redirectedFrom\n  ) {\n    var location = normalizeLocation(raw, currentRoute, false, router);\n    var name = location.name;\n\n    if (name) {\n      var record = nameMap[name];\n      {\n        warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n      }\n      if (!record) { return _createRoute(null, location) }\n      var paramNames = record.regex.keys\n        .filter(function (key) { return !key.optional; })\n        .map(function (key) { return key.name; });\n\n      if (typeof location.params !== 'object') {\n        location.params = {};\n      }\n\n      if (currentRoute && typeof currentRoute.params === 'object') {\n        for (var key in currentRoute.params) {\n          if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n            location.params[key] = currentRoute.params[key];\n          }\n        }\n      }\n\n      if (record) {\n        location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n        return _createRoute(record, location, redirectedFrom)\n      }\n    } else if (location.path) {\n      location.params = {};\n      for (var i = 0; i < pathList.length; i++) {\n        var path = pathList[i];\n        var record$1 = pathMap[path];\n        if (matchRoute(record$1.regex, location.path, location.params)) {\n          return _createRoute(record$1, location, redirectedFrom)\n        }\n      }\n    }\n    // no match\n    return _createRoute(null, location)\n  }\n\n  function redirect (\n    record,\n    location\n  ) {\n    var originalRedirect = record.redirect;\n    var redirect = typeof originalRedirect === 'function'\n      ? originalRedirect(createRoute(record, location, null, router))\n      : originalRedirect;\n\n    if (typeof redirect === 'string') {\n      redirect = { path: redirect };\n    }\n\n    if (!redirect || typeof redirect !== 'object') {\n      {\n        warn(\n          false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n        );\n      }\n      return _createRoute(null, location)\n    }\n\n    var re = redirect;\n    var name = re.name;\n    var path = re.path;\n    var query = location.query;\n    var hash = location.hash;\n    var params = location.params;\n    query = re.hasOwnProperty('query') ? re.query : query;\n    hash = re.hasOwnProperty('hash') ? re.hash : hash;\n    params = re.hasOwnProperty('params') ? re.params : params;\n\n    if (name) {\n      // resolved named direct\n      var targetRecord = nameMap[name];\n      {\n        assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n      }\n      return match({\n        _normalized: true,\n        name: name,\n        query: query,\n        hash: hash,\n        params: params\n      }, undefined, location)\n    } else if (path) {\n      // 1. resolve relative redirect\n      var rawPath = resolveRecordPath(path, record);\n      // 2. resolve params\n      var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n      // 3. rematch with existing query and hash\n      return match({\n        _normalized: true,\n        path: resolvedPath,\n        query: query,\n        hash: hash\n      }, undefined, location)\n    } else {\n      {\n        warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n      }\n      return _createRoute(null, location)\n    }\n  }\n\n  function alias (\n    record,\n    location,\n    matchAs\n  ) {\n    var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n    var aliasedMatch = match({\n      _normalized: true,\n      path: aliasedPath\n    });\n    if (aliasedMatch) {\n      var matched = aliasedMatch.matched;\n      var aliasedRecord = matched[matched.length - 1];\n      location.params = aliasedMatch.params;\n      return _createRoute(aliasedRecord, location)\n    }\n    return _createRoute(null, location)\n  }\n\n  function _createRoute (\n    record,\n    location,\n    redirectedFrom\n  ) {\n    if (record && record.redirect) {\n      return redirect(record, redirectedFrom || location)\n    }\n    if (record && record.matchAs) {\n      return alias(record, location, record.matchAs)\n    }\n    return createRoute(record, location, redirectedFrom, router)\n  }\n\n  return {\n    match: match,\n    addRoutes: addRoutes\n  }\n}\n\nfunction matchRoute (\n  regex,\n  path,\n  params\n) {\n  var m = path.match(regex);\n\n  if (!m) {\n    return false\n  } else if (!params) {\n    return true\n  }\n\n  for (var i = 1, len = m.length; i < len; ++i) {\n    var key = regex.keys[i - 1];\n    var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];\n    if (key) {\n      // Fix #1994: using * with props: true generates a param named 0\n      params[key.name || 'pathMatch'] = val;\n    }\n  }\n\n  return true\n}\n\nfunction resolveRecordPath (path, record) {\n  return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/*  */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n  // Fix for #1585 for Firefox\n  // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n  window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, ''));\n  window.addEventListener('popstate', function (e) {\n    saveScrollPosition();\n    if (e.state && e.state.key) {\n      setStateKey(e.state.key);\n    }\n  });\n}\n\nfunction handleScroll (\n  router,\n  to,\n  from,\n  isPop\n) {\n  if (!router.app) {\n    return\n  }\n\n  var behavior = router.options.scrollBehavior;\n  if (!behavior) {\n    return\n  }\n\n  {\n    assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n  }\n\n  // wait until re-render finishes before scrolling\n  router.app.$nextTick(function () {\n    var position = getScrollPosition();\n    var shouldScroll = behavior.call(router, to, from, isPop ? position : null);\n\n    if (!shouldScroll) {\n      return\n    }\n\n    if (typeof shouldScroll.then === 'function') {\n      shouldScroll.then(function (shouldScroll) {\n        scrollToPosition((shouldScroll), position);\n      }).catch(function (err) {\n        {\n          assert(false, err.toString());\n        }\n      });\n    } else {\n      scrollToPosition(shouldScroll, position);\n    }\n  });\n}\n\nfunction saveScrollPosition () {\n  var key = getStateKey();\n  if (key) {\n    positionStore[key] = {\n      x: window.pageXOffset,\n      y: window.pageYOffset\n    };\n  }\n}\n\nfunction getScrollPosition () {\n  var key = getStateKey();\n  if (key) {\n    return positionStore[key]\n  }\n}\n\nfunction getElementPosition (el, offset) {\n  var docEl = document.documentElement;\n  var docRect = docEl.getBoundingClientRect();\n  var elRect = el.getBoundingClientRect();\n  return {\n    x: elRect.left - docRect.left - offset.x,\n    y: elRect.top - docRect.top - offset.y\n  }\n}\n\nfunction isValidPosition (obj) {\n  return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n    y: isNumber(obj.y) ? obj.y : window.pageYOffset\n  }\n}\n\nfunction normalizeOffset (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : 0,\n    y: isNumber(obj.y) ? obj.y : 0\n  }\n}\n\nfunction isNumber (v) {\n  return typeof v === 'number'\n}\n\nfunction scrollToPosition (shouldScroll, position) {\n  var isObject = typeof shouldScroll === 'object';\n  if (isObject && typeof shouldScroll.selector === 'string') {\n    var el = document.querySelector(shouldScroll.selector);\n    if (el) {\n      var offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {};\n      offset = normalizeOffset(offset);\n      position = getElementPosition(el, offset);\n    } else if (isValidPosition(shouldScroll)) {\n      position = normalizePosition(shouldScroll);\n    }\n  } else if (isObject && isValidPosition(shouldScroll)) {\n    position = normalizePosition(shouldScroll);\n  }\n\n  if (position) {\n    window.scrollTo(position.x, position.y);\n  }\n}\n\n/*  */\n\nvar supportsPushState = inBrowser && (function () {\n  var ua = window.navigator.userAgent;\n\n  if (\n    (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n    ua.indexOf('Mobile Safari') !== -1 &&\n    ua.indexOf('Chrome') === -1 &&\n    ua.indexOf('Windows Phone') === -1\n  ) {\n    return false\n  }\n\n  return window.history && 'pushState' in window.history\n})();\n\n// use User Timing api (if present) for more accurate key precision\nvar Time = inBrowser && window.performance && window.performance.now\n  ? window.performance\n  : Date;\n\nvar _key = genKey();\n\nfunction genKey () {\n  return Time.now().toFixed(3)\n}\n\nfunction getStateKey () {\n  return _key\n}\n\nfunction setStateKey (key) {\n  _key = key;\n}\n\nfunction pushState (url, replace) {\n  saveScrollPosition();\n  // try...catch the pushState call to get around Safari\n  // DOM Exception 18 where it limits to 100 pushState calls\n  var history = window.history;\n  try {\n    if (replace) {\n      history.replaceState({ key: _key }, '', url);\n    } else {\n      _key = genKey();\n      history.pushState({ key: _key }, '', url);\n    }\n  } catch (e) {\n    window.location[replace ? 'replace' : 'assign'](url);\n  }\n}\n\nfunction replaceState (url) {\n  pushState(url, true);\n}\n\n/*  */\n\nfunction runQueue (queue, fn, cb) {\n  var step = function (index) {\n    if (index >= queue.length) {\n      cb();\n    } else {\n      if (queue[index]) {\n        fn(queue[index], function () {\n          step(index + 1);\n        });\n      } else {\n        step(index + 1);\n      }\n    }\n  };\n  step(0);\n}\n\n/*  */\n\nfunction resolveAsyncComponents (matched) {\n  return function (to, from, next) {\n    var hasAsync = false;\n    var pending = 0;\n    var error = null;\n\n    flatMapComponents(matched, function (def, _, match, key) {\n      // if it's a function and doesn't have cid attached,\n      // assume it's an async component resolve function.\n      // we are not using Vue's default async resolving mechanism because\n      // we want to halt the navigation until the incoming component has been\n      // resolved.\n      if (typeof def === 'function' && def.cid === undefined) {\n        hasAsync = true;\n        pending++;\n\n        var resolve = once(function (resolvedDef) {\n          if (isESModule(resolvedDef)) {\n            resolvedDef = resolvedDef.default;\n          }\n          // save resolved on async factory in case it's used elsewhere\n          def.resolved = typeof resolvedDef === 'function'\n            ? resolvedDef\n            : _Vue.extend(resolvedDef);\n          match.components[key] = resolvedDef;\n          pending--;\n          if (pending <= 0) {\n            next();\n          }\n        });\n\n        var reject = once(function (reason) {\n          var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n          \"development\" !== 'production' && warn(false, msg);\n          if (!error) {\n            error = isError(reason)\n              ? reason\n              : new Error(msg);\n            next(error);\n          }\n        });\n\n        var res;\n        try {\n          res = def(resolve, reject);\n        } catch (e) {\n          reject(e);\n        }\n        if (res) {\n          if (typeof res.then === 'function') {\n            res.then(resolve, reject);\n          } else {\n            // new syntax in Vue 2.3\n            var comp = res.component;\n            if (comp && typeof comp.then === 'function') {\n              comp.then(resolve, reject);\n            }\n          }\n        }\n      }\n    });\n\n    if (!hasAsync) { next(); }\n  }\n}\n\nfunction flatMapComponents (\n  matched,\n  fn\n) {\n  return flatten(matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) { return fn(\n      m.components[key],\n      m.instances[key],\n      m, key\n    ); })\n  }))\n}\n\nfunction flatten (arr) {\n  return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n  typeof Symbol === 'function' &&\n  typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n  return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n  var called = false;\n  return function () {\n    var args = [], len = arguments.length;\n    while ( len-- ) args[ len ] = arguments[ len ];\n\n    if (called) { return }\n    called = true;\n    return fn.apply(this, args)\n  }\n}\n\n/*  */\n\nvar History = function History (router, base) {\n  this.router = router;\n  this.base = normalizeBase(base);\n  // start with a route object that stands for \"nowhere\"\n  this.current = START;\n  this.pending = null;\n  this.ready = false;\n  this.readyCbs = [];\n  this.readyErrorCbs = [];\n  this.errorCbs = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n  this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n  if (this.ready) {\n    cb();\n  } else {\n    this.readyCbs.push(cb);\n    if (errorCb) {\n      this.readyErrorCbs.push(errorCb);\n    }\n  }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n  this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {\n    var this$1 = this;\n\n  var route = this.router.match(location, this.current);\n  this.confirmTransition(route, function () {\n    this$1.updateRoute(route);\n    onComplete && onComplete(route);\n    this$1.ensureURL();\n\n    // fire ready cbs once\n    if (!this$1.ready) {\n      this$1.ready = true;\n      this$1.readyCbs.forEach(function (cb) { cb(route); });\n    }\n  }, function (err) {\n    if (onAbort) {\n      onAbort(err);\n    }\n    if (err && !this$1.ready) {\n      this$1.ready = true;\n      this$1.readyErrorCbs.forEach(function (cb) { cb(err); });\n    }\n  });\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n    var this$1 = this;\n\n  var current = this.current;\n  var abort = function (err) {\n    if (isError(err)) {\n      if (this$1.errorCbs.length) {\n        this$1.errorCbs.forEach(function (cb) { cb(err); });\n      } else {\n        warn(false, 'uncaught error during route navigation:');\n        console.error(err);\n      }\n    }\n    onAbort && onAbort(err);\n  };\n  if (\n    isSameRoute(route, current) &&\n    // in the case the route map has been dynamically appended to\n    route.matched.length === current.matched.length\n  ) {\n    this.ensureURL();\n    return abort()\n  }\n\n  var ref = resolveQueue(this.current.matched, route.matched);\n    var updated = ref.updated;\n    var deactivated = ref.deactivated;\n    var activated = ref.activated;\n\n  var queue = [].concat(\n    // in-component leave guards\n    extractLeaveGuards(deactivated),\n    // global before hooks\n    this.router.beforeHooks,\n    // in-component update hooks\n    extractUpdateHooks(updated),\n    // in-config enter guards\n    activated.map(function (m) { return m.beforeEnter; }),\n    // async components\n    resolveAsyncComponents(activated)\n  );\n\n  this.pending = route;\n  var iterator = function (hook, next) {\n    if (this$1.pending !== route) {\n      return abort()\n    }\n    try {\n      hook(route, current, function (to) {\n        if (to === false || isError(to)) {\n          // next(false) -> abort navigation, ensure current URL\n          this$1.ensureURL(true);\n          abort(to);\n        } else if (\n          typeof to === 'string' ||\n          (typeof to === 'object' && (\n            typeof to.path === 'string' ||\n            typeof to.name === 'string'\n          ))\n        ) {\n          // next('/') or next({ path: '/' }) -> redirect\n          abort();\n          if (typeof to === 'object' && to.replace) {\n            this$1.replace(to);\n          } else {\n            this$1.push(to);\n          }\n        } else {\n          // confirm transition and pass on the value\n          next(to);\n        }\n      });\n    } catch (e) {\n      abort(e);\n    }\n  };\n\n  runQueue(queue, iterator, function () {\n    var postEnterCbs = [];\n    var isValid = function () { return this$1.current === route; };\n    // wait until async components are resolved before\n    // extracting in-component enter guards\n    var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);\n    var queue = enterGuards.concat(this$1.router.resolveHooks);\n    runQueue(queue, iterator, function () {\n      if (this$1.pending !== route) {\n        return abort()\n      }\n      this$1.pending = null;\n      onComplete(route);\n      if (this$1.router.app) {\n        this$1.router.app.$nextTick(function () {\n          postEnterCbs.forEach(function (cb) { cb(); });\n        });\n      }\n    });\n  });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n  var prev = this.current;\n  this.current = route;\n  this.cb && this.cb(route);\n  this.router.afterHooks.forEach(function (hook) {\n    hook && hook(route, prev);\n  });\n};\n\nfunction normalizeBase (base) {\n  if (!base) {\n    if (inBrowser) {\n      // respect <base> tag\n      var baseEl = document.querySelector('base');\n      base = (baseEl && baseEl.getAttribute('href')) || '/';\n      // strip full URL origin\n      base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n    } else {\n      base = '/';\n    }\n  }\n  // make sure there's the starting slash\n  if (base.charAt(0) !== '/') {\n    base = '/' + base;\n  }\n  // remove trailing slash\n  return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n  current,\n  next\n) {\n  var i;\n  var max = Math.max(current.length, next.length);\n  for (i = 0; i < max; i++) {\n    if (current[i] !== next[i]) {\n      break\n    }\n  }\n  return {\n    updated: next.slice(0, i),\n    activated: next.slice(i),\n    deactivated: current.slice(i)\n  }\n}\n\nfunction extractGuards (\n  records,\n  name,\n  bind,\n  reverse\n) {\n  var guards = flatMapComponents(records, function (def, instance, match, key) {\n    var guard = extractGuard(def, name);\n    if (guard) {\n      return Array.isArray(guard)\n        ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n        : bind(guard, instance, match, key)\n    }\n  });\n  return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n  def,\n  key\n) {\n  if (typeof def !== 'function') {\n    // extend now so that global mixins are applied.\n    def = _Vue.extend(def);\n  }\n  return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n  return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n  return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n  if (instance) {\n    return function boundRouteGuard () {\n      return guard.apply(instance, arguments)\n    }\n  }\n}\n\nfunction extractEnterGuards (\n  activated,\n  cbs,\n  isValid\n) {\n  return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {\n    return bindEnterGuard(guard, match, key, cbs, isValid)\n  })\n}\n\nfunction bindEnterGuard (\n  guard,\n  match,\n  key,\n  cbs,\n  isValid\n) {\n  return function routeEnterGuard (to, from, next) {\n    return guard(to, from, function (cb) {\n      next(cb);\n      if (typeof cb === 'function') {\n        cbs.push(function () {\n          // #750\n          // if a router-view is wrapped with an out-in transition,\n          // the instance may not have been registered at this time.\n          // we will need to poll for registration until current route\n          // is no longer valid.\n          poll(cb, match.instances, key, isValid);\n        });\n      }\n    })\n  }\n}\n\nfunction poll (\n  cb, // somehow flow cannot infer this is a function\n  instances,\n  key,\n  isValid\n) {\n  if (\n    instances[key] &&\n    !instances[key]._isBeingDestroyed // do not reuse being destroyed instance\n  ) {\n    cb(instances[key]);\n  } else if (isValid()) {\n    setTimeout(function () {\n      poll(cb, instances, key, isValid);\n    }, 16);\n  }\n}\n\n/*  */\n\nvar HTML5History = (function (History$$1) {\n  function HTML5History (router, base) {\n    var this$1 = this;\n\n    History$$1.call(this, router, base);\n\n    var expectScroll = router.options.scrollBehavior;\n    var supportsScroll = supportsPushState && expectScroll;\n\n    if (supportsScroll) {\n      setupScroll();\n    }\n\n    var initLocation = getLocation(this.base);\n    window.addEventListener('popstate', function (e) {\n      var current = this$1.current;\n\n      // Avoiding first `popstate` event dispatched in some browsers but first\n      // history route not updated since async guard at the same time.\n      var location = getLocation(this$1.base);\n      if (this$1.current === START && location === initLocation) {\n        return\n      }\n\n      this$1.transitionTo(location, function (route) {\n        if (supportsScroll) {\n          handleScroll(router, route, current, true);\n        }\n      });\n    });\n  }\n\n  if ( History$$1 ) HTML5History.__proto__ = History$$1;\n  HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );\n  HTML5History.prototype.constructor = HTML5History;\n\n  HTML5History.prototype.go = function go (n) {\n    window.history.go(n);\n  };\n\n  HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      pushState(cleanPath(this$1.base + route.fullPath));\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      replaceState(cleanPath(this$1.base + route.fullPath));\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HTML5History.prototype.ensureURL = function ensureURL (push) {\n    if (getLocation(this.base) !== this.current.fullPath) {\n      var current = cleanPath(this.base + this.current.fullPath);\n      push ? pushState(current) : replaceState(current);\n    }\n  };\n\n  HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n    return getLocation(this.base)\n  };\n\n  return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n  var path = decodeURI(window.location.pathname);\n  if (base && path.indexOf(base) === 0) {\n    path = path.slice(base.length);\n  }\n  return (path || '/') + window.location.search + window.location.hash\n}\n\n/*  */\n\nvar HashHistory = (function (History$$1) {\n  function HashHistory (router, base, fallback) {\n    History$$1.call(this, router, base);\n    // check history fallback deeplinking\n    if (fallback && checkFallback(this.base)) {\n      return\n    }\n    ensureSlash();\n  }\n\n  if ( History$$1 ) HashHistory.__proto__ = History$$1;\n  HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );\n  HashHistory.prototype.constructor = HashHistory;\n\n  // this is delayed until the app mounts\n  // to avoid the hashchange listener being fired too early\n  HashHistory.prototype.setupListeners = function setupListeners () {\n    var this$1 = this;\n\n    var router = this.router;\n    var expectScroll = router.options.scrollBehavior;\n    var supportsScroll = supportsPushState && expectScroll;\n\n    if (supportsScroll) {\n      setupScroll();\n    }\n\n    window.addEventListener(supportsPushState ? 'popstate' : 'hashchange', function () {\n      var current = this$1.current;\n      if (!ensureSlash()) {\n        return\n      }\n      this$1.transitionTo(getHash(), function (route) {\n        if (supportsScroll) {\n          handleScroll(this$1.router, route, current, true);\n        }\n        if (!supportsPushState) {\n          replaceHash(route.fullPath);\n        }\n      });\n    });\n  };\n\n  HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      pushHash(route.fullPath);\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      replaceHash(route.fullPath);\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HashHistory.prototype.go = function go (n) {\n    window.history.go(n);\n  };\n\n  HashHistory.prototype.ensureURL = function ensureURL (push) {\n    var current = this.current.fullPath;\n    if (getHash() !== current) {\n      push ? pushHash(current) : replaceHash(current);\n    }\n  };\n\n  HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n    return getHash()\n  };\n\n  return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n  var location = getLocation(base);\n  if (!/^\\/#/.test(location)) {\n    window.location.replace(\n      cleanPath(base + '/#' + location)\n    );\n    return true\n  }\n}\n\nfunction ensureSlash () {\n  var path = getHash();\n  if (path.charAt(0) === '/') {\n    return true\n  }\n  replaceHash('/' + path);\n  return false\n}\n\nfunction getHash () {\n  // We can't use window.location.hash here because it's not\n  // consistent across browsers - Firefox will pre-decode it!\n  var href = window.location.href;\n  var index = href.indexOf('#');\n  return index === -1 ? '' : decodeURI(href.slice(index + 1))\n}\n\nfunction getUrl (path) {\n  var href = window.location.href;\n  var i = href.indexOf('#');\n  var base = i >= 0 ? href.slice(0, i) : href;\n  return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n  if (supportsPushState) {\n    pushState(getUrl(path));\n  } else {\n    window.location.hash = path;\n  }\n}\n\nfunction replaceHash (path) {\n  if (supportsPushState) {\n    replaceState(getUrl(path));\n  } else {\n    window.location.replace(getUrl(path));\n  }\n}\n\n/*  */\n\nvar AbstractHistory = (function (History$$1) {\n  function AbstractHistory (router, base) {\n    History$$1.call(this, router, base);\n    this.stack = [];\n    this.index = -1;\n  }\n\n  if ( History$$1 ) AbstractHistory.__proto__ = History$$1;\n  AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );\n  AbstractHistory.prototype.constructor = AbstractHistory;\n\n  AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n      this$1.index++;\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  AbstractHistory.prototype.go = function go (n) {\n    var this$1 = this;\n\n    var targetIndex = this.index + n;\n    if (targetIndex < 0 || targetIndex >= this.stack.length) {\n      return\n    }\n    var route = this.stack[targetIndex];\n    this.confirmTransition(route, function () {\n      this$1.index = targetIndex;\n      this$1.updateRoute(route);\n    });\n  };\n\n  AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n    var current = this.stack[this.stack.length - 1];\n    return current ? current.fullPath : '/'\n  };\n\n  AbstractHistory.prototype.ensureURL = function ensureURL () {\n    // noop\n  };\n\n  return AbstractHistory;\n}(History));\n\n/*  */\n\n\n\nvar VueRouter = function VueRouter (options) {\n  if ( options === void 0 ) options = {};\n\n  this.app = null;\n  this.apps = [];\n  this.options = options;\n  this.beforeHooks = [];\n  this.resolveHooks = [];\n  this.afterHooks = [];\n  this.matcher = createMatcher(options.routes || [], this);\n\n  var mode = options.mode || 'hash';\n  this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;\n  if (this.fallback) {\n    mode = 'hash';\n  }\n  if (!inBrowser) {\n    mode = 'abstract';\n  }\n  this.mode = mode;\n\n  switch (mode) {\n    case 'history':\n      this.history = new HTML5History(this, options.base);\n      break\n    case 'hash':\n      this.history = new HashHistory(this, options.base, this.fallback);\n      break\n    case 'abstract':\n      this.history = new AbstractHistory(this, options.base);\n      break\n    default:\n      {\n        assert(false, (\"invalid mode: \" + mode));\n      }\n  }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (\n  raw,\n  current,\n  redirectedFrom\n) {\n  return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n  return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n    var this$1 = this;\n\n  \"development\" !== 'production' && assert(\n    install.installed,\n    \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n    \"before creating root instance.\"\n  );\n\n  this.apps.push(app);\n\n  // main app already initialized.\n  if (this.app) {\n    return\n  }\n\n  this.app = app;\n\n  var history = this.history;\n\n  if (history instanceof HTML5History) {\n    history.transitionTo(history.getCurrentLocation());\n  } else if (history instanceof HashHistory) {\n    var setupHashListener = function () {\n      history.setupListeners();\n    };\n    history.transitionTo(\n      history.getCurrentLocation(),\n      setupHashListener,\n      setupHashListener\n    );\n  }\n\n  history.listen(function (route) {\n    this$1.apps.forEach(function (app) {\n      app._route = route;\n    });\n  });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n  return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n  return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n  return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n  this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n  this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n  this.history.push(location, onComplete, onAbort);\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n  this.history.replace(location, onComplete, onAbort);\n};\n\nVueRouter.prototype.go = function go (n) {\n  this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n  this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n  this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n  var route = to\n    ? to.matched\n      ? to\n      : this.resolve(to).route\n    : this.currentRoute;\n  if (!route) {\n    return []\n  }\n  return [].concat.apply([], route.matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) {\n      return m.components[key]\n    })\n  }))\n};\n\nVueRouter.prototype.resolve = function resolve (\n  to,\n  current,\n  append\n) {\n  var location = normalizeLocation(\n    to,\n    current || this.history.current,\n    append,\n    this\n  );\n  var route = this.match(location, current);\n  var fullPath = route.redirectedFrom || route.fullPath;\n  var base = this.history.base;\n  var href = createHref(base, fullPath, this.mode);\n  return {\n    location: location,\n    route: route,\n    href: href,\n    // for backwards compat\n    normalizedTo: location,\n    resolved: route\n  }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n  this.matcher.addRoutes(routes);\n  if (this.history.current !== START) {\n    this.history.transitionTo(this.history.getCurrentLocation());\n  }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n  list.push(fn);\n  return function () {\n    var i = list.indexOf(fn);\n    if (i > -1) { list.splice(i, 1); }\n  }\n}\n\nfunction createHref (base, fullPath, mode) {\n  var path = mode === 'hash' ? '#' + fullPath : fullPath;\n  return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.0.2';\n\nif (inBrowser && window.Vue) {\n  window.Vue.use(VueRouter);\n}\n\nreturn VueRouter;\n\n})));\n"
  },
  {
    "path": "calllib-v3/web-ie/setting.js",
    "content": "(function (global, factory) {\n  if (typeof exports === 'object' && module !== 'undefined') {\n    module.exports = factory();\n  } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n    define(factory);\n  } else {\n    global.RongCall = global.RongCall || {};\n    global.RongCall.setting = factory();\n  }\n})(this, function () {\n\n  var ENUM = {};\n\n  ENUM.Events = {\n    INVITE: 'invite',\n    ACCEPT: 'accept',\n    HUNGUP: 'hungup',\n    MEDIA_MODIFY: 'media_modify',\n    MEMBER_MODIFY: 'member_modify',\n\n    RTC_ADDED: 'added',\n    RTC_REMOVED: 'removed',\n    RTC_LEAVE: 'leave'\n  };\n\n  return {\n    appkey: 'appkey',\n    navi: '',\n    server: 'http://localhost:9929',\n\n    ENUM: ENUM\n  };\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/css/main.css",
    "content": "@charset \"UTF-8\";\n/* 超出部分省略 */\n.ellipsis, .rong-dialog-box .rong-dialog-user-list-content span {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\nhtml, body {\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #f5f5f5;\n}\n\n.rong-main {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-box {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-login-inner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.rong-login-inner p {\n  text-align: center;\n  font-size: 20px;\n}\n\n.rong-login-inner input {\n  width: 280px;\n  height: 44px;\n  border: none;\n  border-radius: 10px;\n  display: block;\n  box-sizing: border-box;\n  margin: 17px;\n  padding: 0 15px;\n  font-size: 14px;\n  outline: none;\n}\n\n.rong-login-inner input[type=\"text\"] {\n  border: 1px solid #ddd;\n}\n\n.rong-login-inner input[type=\"button\"] {\n  background-color: #0888ff;\n  color: white;\n}\n\n.rong-info {\n  position: absolute;\n  top: 10px;\n  left: 30px;\n  text-align: left;\n  color: white;\n  z-index: 20;\n}\n\n.rong-info p {\n  font-size: 15px;\n}\n\n.rong-call-box {\n  background-color: #333;\n}\n\n.rong-call-box .rong-call-btns {\n  position: absolute;\n  bottom: 32px;\n  left: 50%;\n  transform: translateX(-50%);\n  z-index: 32;\n}\n\n.rong-call-box .rong-call-btns button {\n  width: 55px;\n  height: 55px;\n  margin: 0 8px;\n  border-radius: 50%;\n  background-image: url(\"../img/icons.svg\");\n  border: none;\n  outline: none;\n  background-repeat: no-repeat;\n  background-color: rgba(255, 255, 255, 0.87);\n  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n  box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n  cursor: pointer;\n}\n\n.rong-call-box .rong-call-btns button:hover {\n  background-color: rgba(255, 255, 255, 0.7);\n}\n\n.rong-call-box .rong-call-btns .rong-call-hungup {\n  background-position: -66px 15px;\n  background-color: #ef5350;\n}\n\n.rong-call-box .rong-call-btns button.rong-call-hungup:hover {\n  background-color: #EF5360;\n}\n\n.rong-call-box .rong-call-btns .rong-call-accept {\n  background-color: #008700;\n  background-position: 14px 15px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-accept:hover {\n  background-color: #00a000;\n}\n\n.rong-call-box .rong-call-btns .rong-call-mute {\n  background-position: 15px -154px;\n  background-size: 112px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-mute[closed] {\n  background-position: -68px -154px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-video {\n  background-position: 12px -30px;\n  background-size: 102px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-video[closed] {\n  background-position: -61px -30px;\n  background-size: 102px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-audio {\n  background-position: 17px -93px;\n  background-size: 111px;\n}\n\n.rong-call-box .rong-call-btns .rong-call-invite {\n  background-position: 13px -310px;\n}\n\n.rong-type-box {\n  color: white;\n  position: absolute;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 20px;\n  z-index: 30;\n}\n\n.rong-video-box {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\n.rong-video-box .rong-video-list {\n  width: calc(100% - 200px);\n  height: 150px;\n  position: absolute;\n  right: 0;\n  z-index: 10;\n  margin-top: 10px;\n}\n\n.rong-video-box .rong-video-list .rong-video-min {\n  display: inline-block;\n  width: 190px;\n  height: 100%;\n  position: relative;\n  margin: 0 15px;\n  border: 1px solid white;\n}\n\n.rong-video-box .rong-video-list video {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max {\n  width: 100%;\n  height: 100%;\n  position: absolute;\n}\n\n.rong-video-box .rong-video-max video {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"], .rong-video-box .rong-video-min[talktype=\"0\"] {\n  background-color: black;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"] video, .rong-video-box .rong-video-min[talktype=\"0\"] video {\n  display: none;\n}\n\n.rong-video-box .rong-video-max[talktype=\"0\"]::before, .rong-video-box .rong-video-min[talktype=\"0\"]::before {\n  content: '摄像头已关闭';\n  color: white;\n  font-size: 18px;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.rong-video-box .rong-video-min[talktype=\"0\"]::before {\n  font-size: 15px;\n}\n\n.rong-dialog-box {\n  position: fixed;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  opacity: 1;\n  z-index: 500;\n  color: #333;\n}\n\n.rong-dialog-box .rong-dialog-user-list {\n  position: fixed;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 45px;\n  background-color: #fefefe;\n  border: 1px solid #e6e6e6;\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 20px 20px 12px 20px;\n  z-index: 12;\n  font-weight: 400;\n  width: 252px;\n}\n\n.rong-dialog-box .rong-dialog-user-list h3 {\n  margin: 0;\n  font-size: 15px;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content {\n  margin: 15px 0;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content .rong-dialog-user {\n  display: inline-block;\n  width: 50%;\n  margin: 4px 0;\n  line-height: 1;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content i {\n  display: inline-block;\n  width: 12px;\n  height: 12px;\n  border: 1px solid #B2B2B2;\n  background-color: white;\n  margin-right: 1px;\n  vertical-align: middle;\n  background-image: url(../img/icons.svg);\n}\n\n.rong-dialog-box .rong-dialog-user-list-content i.rong-user-selected {\n  background-color: transparent;\n  background-position: 0px -115px;\n  background-size: 54px;\n  background-repeat: no-repeat;\n  border: 1px solid black;\n}\n\n.rong-dialog-box .rong-dialog-user-list-content span {\n  font-size: 12px;\n  color: #585858;\n  vertical-align: middle;\n  max-width: 96px;\n  display: inline-block;\n}\n\n.rong-dialog-box .rong-confirm-btns {\n  text-align: right;\n}\n\n.rong-dialog-box .rong-confirm-btns button {\n  padding: 0 8px;\n  height: 23px;\n  border: none;\n  font-size: 12px;\n  border-radius: 5px;\n  margin-left: 3px;\n  outline: none;\n}\n\n.rong-dialog-box .rong-confirm-btns .rong-confirm-ok[disabled] {\n  opacity: 0.6;\n}\n\n.rong-dialog-box .rong-confirm-btns .rong-confirm-ok, .rong-dialog-box .rong-confirm-btns .rong-confirm-cancel {\n  background-color: #f9f9f9;\n  border: 1px solid #979797;\n}\n\n.rong-dialog-toast {\n  position: fixed;\n  text-align: center;\n  top: 30px;\n  left: 50%;\n  transform: translateX(-50%);\n  width: auto;\n  padding: 12px 50px;\n  background-color: #fefefe;\n  border: 1px solid #e6e6e6;\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 7px 35px;\n  z-index: 31;\n  font-weight: 400;\n}\n\n.rong-dialog-toast .rong-dialog-toast-content {\n  display: inline-block;\n  font-size: 14px;\n  vertical-align: middle;\n}\n"
  },
  {
    "path": "calllib-v3/web-im-v3/css/main.scss",
    "content": "/* 超出部分省略 */\n.ellipsis {\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n\nhtml, body {\n  margin: 0;\n  padding: 0;\n  width: 100%;\n  height: 100%;\n  background-color: #f5f5f5;\n}\n\n.rong-main {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-box {\n  width: 100%;\n  height: 100%;\n}\n\n.rong-login-inner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  p {\n    text-align: center;\n    font-size: 20px;\n  }\n  input {\n    width: 280px;\n    height: 44px;\n    border: none;\n    border-radius: 10px;\n    display: block;\n    box-sizing: border-box;\n    margin: 17px;\n    padding: 0 15px;\n    font-size: 14px;\n    outline: none;\n  }\n  input[type=\"text\"] {\n    border: 1px solid #ddd;\n  }\n  input[type=\"button\"] {\n    background-color: #0888ff;\n    color: white;\n  }\n}\n\n.rong-info {\n  position: absolute;\n  top: 10px;\n  left: 30px;\n  text-align: left;\n  color: white;\n  z-index: 20;\n  p {\n    font-size: 15px;\n  }\n}\n\n.rong-call-box {\n  background-color: #333;\n  .rong-call-btns {\n    position: absolute;\n    bottom: 32px;\n    left: 50%;\n    transform: translateX(-50%);\n    z-index: 32;\n    button {\n      width: 55px;\n      height: 55px;\n      margin: 0 8px;\n      border-radius: 50%;\n      background-image: url('../img/icons.svg');\n      border: none;\n      outline: none;\n      background-repeat: no-repeat;\n      background-color: rgba(255, 255, 255, 0.87);\n      transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n      box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12);\n      cursor: pointer;\n    }\n    button:hover {\n      background-color: rgba(255, 255, 255, 0.7);\n    }\n    .rong-call-hungup {\n      background-position: -66px 15px;\n      background-color: #ef5350;\n    }\n    button.rong-call-hungup:hover {\n      background-color: #EF5360;\n    }\n    .rong-call-accept {\n      background-color: rgb(0, 135, 0);\n      background-position: 14px 15px;\n    }\n    .rong-call-accept:hover {\n      background-color: rgb(0, 160, 0);\n    }\n    .rong-call-mute {\n      background-position: 15px -154px;\n      background-size: 112px;\n    }\n    .rong-call-mute[closed] {\n      background-position: -68px -154px;\n    }\n    .rong-call-video {\n      background-position: 12px -30px;\n      background-size: 102px;\n    }\n    .rong-call-video[closed] {\n      background-position: -61px -30px;\n      background-size: 102px;\n    }\n    .rong-call-audio {\n      background-position: 17px -93px;\n      background-size: 111px;\n    }\n    .rong-call-invite {\n      background-position: 13px -310px;\n    }\n  }\n}\n.rong-type-box {\n  color: white;\n  position: absolute;\n  left: 50%;\n  transform: translateX(-50%);\n  top: 20px;\n  z-index: 30;\n}\n\n.rong-video-box {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  .rong-video-list {\n    width: calc(100% - 200px);\n    height: 150px;\n    position: absolute;\n    right: 0;\n    z-index: 10;\n    margin-top: 10px;\n    .rong-video-min {\n      display: inline-block;\n      width: 190px;\n      height: 100%;\n      position: relative;\n      margin: 0 15px;\n      border: 1px solid white;\n    }\n    video {\n      position: absolute;\n      width: 100%;\n      height: 100%;\n      background-color: black;\n    }\n  }\n  .rong-video-max {\n    width: 100%;\n    height: 100%;\n    position: absolute;\n    video {\n      position: absolute;\n      width: 100%;\n      height: 100%;\n      background-color: black;\n    }\n  }\n  .rong-video-max[talktype=\"0\"], .rong-video-min[talktype=\"0\"] {\n    background-color: black;\n    video {\n      display: none;\n    }\n    &::before {\n      content: '摄像头已关闭';\n      color: white;\n      font-size: 18px;\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate(-50%, -50%);\n    }\n  }\n  .rong-video-min[talktype=\"0\"]::before {\n    font-size: 15px;\n  }\n}\n\n.rong-dialog-box {\n  position: fixed;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  opacity: 1;\n  z-index: 500;\n  color: #333;\n  .rong-dialog-user-list {\n    position: fixed;\n    left: 50%;\n    transform: translateX(-50%);\n    top: 45px;\n    background-color: rgb(254, 254, 254);\n    border: 1px solid rgb(230, 230, 230);\n    border-radius: 5px;\n    box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n    padding: 20px 20px 12px 20px;\n    z-index: 12;\n    font-weight: 400;\n    width: 252px;\n    h3 {\n      margin: 0;\n      font-size: 15px;\n    }\n  }\n  .rong-dialog-user-list-content {\n    margin: 15px 0;\n    .rong-dialog-user {\n      display: inline-block;\n      width: 50%;\n      margin: 4px 0;\n      line-height: 1;\n    }\n    i {\n      display: inline-block;\n      width: 12px;\n      height: 12px;\n      border: 1px solid #B2B2B2;\n      background-color: white;\n      margin-right: 1px;\n      vertical-align: middle;\n      background-image: url(../img/icons.svg);\n    }\n    i.rong-user-selected {\n      background-color: transparent;\n      background-position: 0px -115px;\n      background-size: 54px;\n      background-repeat: no-repeat;\n      border: 1px solid black;\n    }\n    span {\n      font-size: 12px;\n      color: rgb(88, 88, 88);\n      vertical-align: middle;\n      max-width: 96px;\n      display: inline-block;\n      @extend .ellipsis;\n    }\n  }\n  .rong-confirm-btns {\n    text-align: right;\n    button {\n      padding: 0 8px;\n      height: 23px;\n      border: none;\n      font-size: 12px;\n      border-radius: 5px;\n      margin-left: 3px;\n      outline: none;\n    }\n    .rong-confirm-ok[disabled] {\n      opacity: 0.6;\n    }\n    .rong-confirm-ok, .rong-confirm-cancel {\n      background-color: rgb(249, 249, 249);\n      border: 1px solid rgb(151, 151, 151);\n    }\n  }\n}\n\n.rong-dialog-toast {\n  position: fixed;\n  text-align: center;\n  top: 30px;;\n  left: 50%;\n  transform: translateX(-50%);\n  width: auto;\n  // top: 116px;\n  padding: 12px 50px;\n  background-color: rgb(254, 254, 254);\n  border: 1px solid rgb(230, 230, 230);\n  border-radius: 5px;\n  box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.1);\n  padding: 7px 35px;\n  z-index: 31;\n  font-weight: 400;\n  .rong-dialog-toast-content {\n    display: inline-block;\n    font-size: 14px;\n    vertical-align: middle;\n  }\n}\n"
  },
  {
    "path": "calllib-v3/web-im-v3/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>Rong CallLib Demo</title>\n  <link rel=\"stylesheet\" href=\"./css/main.min.css\">\n\n  <!-- 配置文件 -->\n  <script src=\"setting.js\"></script>\n\n  <script src=\"lib/vue-2.6.7.js\"></script>\n  <script src=\"lib/vue-router-3.0.2.js\"></script>\n\n   <!-- 适配 RTC 5.0 -->\n   <script src=\"https://cdn.ronghub.com/RongIMLib-4.4.1.prod.js\"></script>\n   <script src=\"https://cdn.ronghub.com/RCRTC-5.1.1.prod.js\"></script>\n   <script src=\"https://cdn.ronghub.com/RCRTCAdapter-1.0.5.prod.js\"></script>\n   <script src=\"https://cdn.ronghub.com/RongCallLib.3.2.2.js\"></script>\n\n  \n  <script src=\"js/common/utils.js\"></script>\n  <script src=\"js/common/init.js\"></script>\n\n  <script src=\"js/dialog.js\"></script>\n  <script src=\"js/login.js\"></script>\n  <script src=\"js/call.js\"></script>\n  <script src=\"js/main.js\"></script>\n\n  <!-- 登录页面模板 -->\n  <script id=\"rong-template-login\" type=\"text/x-template\">\n    <div class=\"rong-box\">\n      <div class=\"rong-login-inner\">\n        <p>融云 CallLib</p>\n        <input v-model=\"userId\" type=\"text\" placeholder=\"请输入 userId\" @keyup.13=\"login\">\n        <input type=\"button\" value=\"登录\" @click=\"login\">\n      </div>\n    </div>\n  </script>\n\n  <!-- 通话界面模板 -->\n  <script id=\"rong-template-call\" type=\"text/x-template\">\n    <div class=\"rong-box rong-call-box\">\n      <div class=\"rong-info\">\n        <p>登录用户 id: <span>{{$route.params.userId}}</span></p>\n        <p>群组 id: <span>{{$route.params.groupId}}</span></p>\n      </div>\n      <div class=\"rong-type-box\" v-if=\"callStep === CallStep.READY_TO_CALL\">\n        <label for=\"\">通话类型: </label>\n        <select name=\"\" id=\"\" v-model=\"callType\">\n          <option value=\"1\">单人</option>\n          <option value=\"3\">群组</option>\n        </select>\n      </div>\n      <div class=\"rong-video-box\">\n        <div class=\"rong-video-list\">\n          <div class=\"rong-video-min\" v-for=\"user in minUserList\" v-video=\"user\" :talktype=\"user.talkType\"></div>\n        </div>\n        <div v-if=\"maxUser\" class=\"rong-video-max\" v-video=\"maxUser\" :talktype=\"maxUser.talkType\"></div>\n      </div>\n      <div class=\"rong-call-btns\">\n        <template v-if=\"callStep === CallStep.READY_TO_CALL\">\n          <button class=\"rong-call-video\" title=\"点击进行视频通话\" @click=\"startCall(false)\"></button>\n          <button class=\"rong-call-audio\" title=\"点击进行音频通话\" @click=\"startCall(true)\"></button>\n        </template>\n        <template v-else-if=\"callStep === CallStep.CALLS_ESTABLISH\">\n          <button v-if=\"callType == 3\" class=\"rong-call-invite\" title=\"点击邀请\" @click=\"invite\"></button>\n          <button class=\"rong-call-mute\" title=\"点击开启/关闭音频\" :closed=\"isMuted\" @click=\"mute\"></button>\n          <button class=\"rong-call-video\" closed title=\"点击开启/关闭视频\" :closed=\"callInfo.mediaType !== 2\" @click=\"setVideo\"></button>\n        </template>\n        <template v-else-if=\"callStep === CallStep.INVITED_TO_ANSWER\">\n          <button class=\"rong-call-accept\" @click=\"accept\"></button>\n          <button class=\"rong-call-hungup\" @click=\"reject\"></button>\n        </template>\n        <template v-if=\"callStep === CallStep.CALLING || callStep === CallStep.CALLS_ESTABLISH\">\n          <button class=\"rong-call-hungup\" title=\"点击挂断\" @click=\"hungup\"></button>\n        </template>\n      </div>\n    </div>\n  </script>\n\n  <!-- 选择人员弹框 -->\n  <script id=\"rong-template-dialog-users\" type=\"text/x-template\">\n    <div v-if=\"isShow\" class=\"rong-dialog-box\">\n      <div class=\"rong-dialog-user-list\">\n        <h3>选择人员</h3>\n        <div class=\"rong-dialog-user-list-content\">\n          <div class=\"rong-dialog-user\" v-for=\"user in userList\" @click=\"selectUser(user)\">\n            <i :class=\"{ 'rong-user-selected': user.isSelected }\"></i>\n            <span>{{user.userId || user.id}}</span>\n          </div>\n        </div>\n        <div class=\"rong-confirm-btns\">\n          <button class=\"rong-confirm-cancel\" @click=\"cancel\">取消</button>\n          <button class=\"rong-confirm-ok\" @click=\"confirm\" :disabled=\"!hasSelectedUser\">确认</button>\n        </div>\n      </div>\n    </div>\n  </script>\n\n  <script id=\"rong-template-dialog-toast\" type=\"text/x-template\">\n    <div class=\"rong-dialog-toast\">\n      <span class=\"rong-dialog-toast-content\">{{content}}</span>\n    </div>\n  </script>\n\n\n  \n</head>\n<body>\n  <div id=\"rongCall\" class=\"rong-main\">\n    <router-view></router-view>\n  </div>\n</body>\n\n<script>\n  // 方法定义见: js/main.js\n  RongCall.init({\n    el: '#rongCall'\n  })\n</script>\n\n</html>"
  },
  {
    "path": "calllib-v3/web-im-v3/js/call.js",
    "content": "(function (RongCall, dependencies) {\n  /* 通话逻辑 */\n\n  var win = dependencies.win,\n    Vue = win.Vue,\n    RongIMLib = win.RongIMLib,\n    RongCallLib = win.RongCallLib,\n    utils = RongCall.utils;\n\n  var toast = utils.toast,\n    dialog = RongCall.dialog,\n    ConversationType = RongIMLib.CONVERSATION_TYPE,\n    MediaType = {\n      MEDIA_AUDIO: 1,\n      MEDIA_VEDIO: 2,\n      '1': 'MEDIA_AUDIO',\n      '2': 'MEDIA_VEDIO'\n    };\n\n  // 通话阶段\n  var CallStep = {\n    READY_TO_CALL: 1, // 准备拨打(最初状态)\n    INVITED_TO_ANSWER: 2, // 被邀请接听, 其他人拨打, 己方选择接听或拒绝\n    CALLING: 3, // 拨打中\n    CALLS_ESTABLISH: 4 // 通话建立完成 \n  };\n\n  var CallName = {};\n  CallName[MediaType.MEDIA_AUDIO] = '语音';\n  CallName[MediaType.MEDIA_VEDIO] = '视频';\n\n  // 将消息转化为调用 CallLib 需要参数\n  function messageToCallInfo(message) {\n    return {\n      conversationType: message.conversationType,\n      targetId: message.targetId,\n      mediaType: message.content.mediaType\n    };\n  }\n\n  // 获取挂断原因\n  function getHungupReason(reason, message) {\n    var reasonPrompt;\n    var senderUserId = message.senderUserId;\n    switch (reason) {\n      case 8:\n        reasonPrompt = '其他设备已处理';\n        break;\n      case 11:\n        reasonPrompt = `${senderUserId} 已取消`;\n        break;\n      case 12:\n        reasonPrompt = `${senderUserId} 已拒绝`;\n        break;\n      case 13:\n        reasonPrompt = `${senderUserId} 已挂断`;\n        break;\n      case 14:\n        reasonPrompt = `${senderUserId} 忙碌中`;\n        break;\n      case 15:\n        reasonPrompt = `${senderUserId} 未接听`;\n        break;\n      default:\n        reasonPrompt = '未知原因挂断';\n    }\n    return reasonPrompt;\n  }\n\n  // 己方挂断后的提示\n  function getSummaryText(status, message) {\n    var senderUserId = message.senderUserId;\n    var text;\n    switch (status) {\n      case 1:\n        text = '己方已取消';\n        break;\n      case 2:\n        text = '己方已拒绝';\n        break;\n      case 3:\n        text = '己方挂断';\n        break;\n      case 4:\n        text = `收到 ${senderUserId} 的音视频邀请, 但己方忙碌中, 不处理`;\n        break;\n      case 5:\n        text = '己方未接听';\n        break;\n      default:\n        text = '未知原因';\n    }\n    return text;\n  }\n\n  function mediaTypeToTalkType(mediaType) {\n    return mediaType === MediaType.MEDIA_AUDIO ? 0 : 1;\n  }\n\n  var commandEvents = {\n    // 监听其他人邀请自己\n    InviteMessage: function (message, context) {\n      var conversationType = message.conversationType === ConversationType.PRIVATE ? '单聊' : '群聊';\n      toast(`${message.senderUserId} 邀请您进行${CallName[message.content.mediaType]}通话(${conversationType})`);\n      context.callInfo = messageToCallInfo(message);\n      context.callStep = CallStep.INVITED_TO_ANSWER;\n    },\n    MemberModifyMessage: function (message, context) {\n      if (message.content.inviteUserIds.indexOf(context.selfUserId) !== -1) {\n        var conversationType = message.conversationType === ConversationType.PRIVATE ? '单聊' : '群聊';\n        toast(`${message.senderUserId} 邀请您进行${CallName[message.content.mediaType]}通话(${conversationType})`);\n        context.callInfo = messageToCallInfo(message);\n        context.callStep = CallStep.INVITED_TO_ANSWER;\n      }\n    },\n    HungupMessage: function (message) {\n      var reason = getHungupReason(message.content.reason, message);\n      toast(reason);\n    },\n    MediaModifyMessage: function (message, context) {\n      var senderUserId = message.senderUserId,\n        mediaType = message.content.mediaType;\n      context.userList.forEach(function (user) {\n        if (user.userId === senderUserId) {\n          user.talkType = mediaTypeToTalkType(mediaType);\n        }\n      });\n    },\n    SummaryMessage: function (message, context) {\n      var status = message.content.status;\n      var promptText = getSummaryText(status, message);\n      toast(promptText);\n      if (status === 5) { // 自己未接听, 回到初始状态\n        context.callStep = CallStep.READY_TO_CALL;\n      }\n    }\n  };\n\n  var videoChangedEvents = {\n    added: function (detail, context) {\n      context.userList.push(detail);\n      context.callStep = CallStep.CALLS_ESTABLISH;\n    },\n    removed: function (detail, context) {\n      context.userList = utils.removeArray(detail, context.userList, 'userId');\n    },\n    leave: function (detail, context) {\n      context.userList = [];\n    }\n  };\n\n  function getMembers(currentUserList, selfUserId) {\n    return utils.getMembers().then(function (members) {\n      members = members.filter(function (user) {\n        var currentUserIds = currentUserList.map(function (user) {\n          return user.id || user.userId;\n        });\n        return user.id !== selfUserId && currentUserIds.indexOf(user.id) === -1;\n      });\n      return win.Promise.resolve(members);\n    });\n  }\n\n  function call(callParams) {\n    var context = this;\n    RongCallLib.call(callParams, function (error) {\n      // 置为通话中状态\n      context.callStep = error ? context.callStep : CallStep.CALLING;\n    });\n    context.callInfo = callParams;\n  }\n\n  function accept() {\n    var context = this;\n    var callInfo = context.callInfo; // callInfo 在监听到 InviteMessage 时赋值, 格式见 messageToCallInfo 方法\n    RongCallLib.accept(callInfo, function (error) {\n      // 置为通话中状态\n      context.callStep = error ? context.callStep : CallStep.CALLING;\n    });\n  }\n\n  function invite() {\n    var context = this;\n    var callInfo = context.callInfo,\n      inviteParams = {\n        conversationType: ConversationType.GROUP,\n        targetId: callInfo.targetId,\n        inviteUserIds: [],\n        mediaType: callInfo.mediaType\n      };\n    getMembers(context.userList, context.selfUserId).then(function (members) {\n      dialog.selectUser({\n        userList: members,\n        confirmed: function (selectedUserList) {\n          var selectedIds = selectedUserList.map(function (user) {\n            return user.id;\n          });\n          inviteParams.inviteUserIds = selectedIds;\n          RongCallLib.invite(inviteParams);\n        }\n      });\n    }).catch(function () {\n      toast('获取群组成员失败');\n    });\n  }\n\n  function reject() {\n    var context = this;\n    var callInfo = context.callInfo; // callInfo 在监听到 InviteMessage 时赋值, 格式见 messageToCallInfo 方法\n    RongCallLib.reject(callInfo, function (error) {\n      // 置为最初的准备拨打状态\n      context.callStep = error ? context.callStep : CallStep.READY_TO_CALL;\n    });\n  }\n\n  function hungup() {\n    var context = this;\n    var callInfo = context.callInfo;\n    RongCallLib.hungup(callInfo, function (error) {\n      // 置为最初的准备拨打状态\n      context.callStep = error ? context.callStep : CallStep.READY_TO_CALL;\n    });\n  }\n\n  function mute() {\n    var isMuted = this.isMuted;\n    var event = isMuted ? RongCallLib.unmute : RongCallLib.mute;\n    event();\n    this.isMuted = !isMuted;\n  }\n\n  function setVideo() {\n    var callInfo = this.callInfo,\n      mediaType = callInfo.mediaType;\n    var event = mediaType === MediaType.MEDIA_AUDIO ? RongCallLib.audioToVideo : RongCallLib.videoToAudio;\n    event();\n    this.callInfo.mediaType = mediaType === MediaType.MEDIA_AUDIO ? MediaType.MEDIA_VEDIO : MediaType.MEDIA_AUDIO;\n  }\n\n  RongCall.call = Vue.component('call', {\n    template: '#rong-template-call',\n    data: function () {\n      return {\n        userList: [],\n        callStep: CallStep.READY_TO_CALL,\n        callType: ConversationType.PRIVATE, // 通话类型, 默认为单聊\n        /**\n         * 通话信息. 给 callInfo 赋值的地方有:\n         * 1. 发送 call 成功后, 存储当前通话信息\n         * 2. 接收到 InviteMessage 后, 存储通话信息\n         */\n        callInfo: {},\n        isMuted: false\n      };\n    },\n    directives: {\n      video: function (el, binding) {\n        var user = binding.value;\n        var video = user.data;\n        el.appendChild(video);\n        video.play();\n      }\n    },\n    computed: {\n      CallStep: function () {\n        return CallStep;\n      },\n      // 大窗口用户\n      maxUser: function () {\n        var context = this;\n        var maxUser;\n        context.userList.forEach(function (user) {\n          if (user.userId === context.selfUserId) {\n            maxUser = user;\n          }\n        });\n        if (maxUser) {\n          maxUser.talkType = mediaTypeToTalkType(context.callInfo.mediaType);\n        }\n        return maxUser;\n      },\n      // 小窗口用户列表\n      minUserList: function () {\n        var context = this,\n          maxUser = context.maxUser || {};\n        return context.userList.filter(function (user) {\n          return user.userId !== maxUser.userId;\n        });\n      },\n      selfUserId: function () {\n        return this.$route.params.userId;\n      }\n    },\n    methods: {\n      /**\n       * @param {boolean} isOnlyAudio 是否仅以音频发起\n       */\n      startCall: function (isOnlyAudio) {\n        var mediaType = isOnlyAudio ? MediaType.MEDIA_AUDIO : MediaType.MEDIA_VEDIO;\n        if (this.callType == ConversationType.GROUP) {\n          this.startGroupCall(mediaType);\n        } else {\n          this.startPrivateCall(mediaType);\n        }\n      },\n      startPrivateCall: function (mediaType) {\n        var targetId = win.prompt('请输入接收者 id:');\n        targetId && this.call({\n          conversationType: ConversationType.PRIVATE,\n          targetId: targetId,\n          inviteUserIds: [targetId],\n          mediaType: mediaType\n        });\n      },\n      startGroupCall: function (mediaType) {\n        var context = this;\n        var params = context.$route.params,\n          groupId = params.groupId;\n\n        var callParams = {\n          conversationType: ConversationType.GROUP,\n          targetId: groupId,\n          inviteUserIds: [],\n          mediaType: mediaType\n        };\n        getMembers(context.userList, context.selfUserId).then(function (members) {\n          dialog.selectUser({\n            userList: members,\n            confirmed: function (selectedUserList) {\n              var selectedIds = selectedUserList.map(function (user) {\n                return user.id;\n              });\n              callParams.inviteUserIds = selectedIds;\n              context.call(callParams);\n            }\n          });\n        }).catch(function () {\n          toast('获取群组成员失败');\n        });\n      },\n      call: call,\n      accept: accept,\n      invite: invite,\n      reject: reject,\n      hungup: hungup,\n      mute: mute,\n      setVideo: setVideo\n    },\n    mounted: function () {\n      var context = this;\n\n      // 初始化\n      RongCallLib = RongCall.initCallLib(context.selfUserId);\n\n      // 注册命令(消息)监听\n      RongCallLib.commandWatch(function (message) {\n        var event = commandEvents[message.messageType];\n        event && event(message, context);\n        console.log('received message', message);\n      });\n\n      // 注册音视频节点监听\n      RongCallLib.videoWatch(function (result) {\n        var event = videoChangedEvents[result.type];\n        event && event(result, context);\n        console.log('video changed', result);\n      });\n    }\n  });\n\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/js/common/init.js",
    "content": "(function (RongCall, dependencies) {\n  var RongIMLib = dependencies.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient,\n    RongCallLib = dependencies.RongCallLib,\n    RongRTC = dependencies.RongRTC;\n\n  var win = dependencies.win;\n\n  var RCRTC = dependencies.RCRTC;\n  var RCRTCAdapter = dependencies.RCRTCAdapter;\n  var im;\n\n  /**\n   * \n   * @param {string} params.appkey 融云 appKey\n   * @param {string} params.token 融云 token\n   * @param {string} params.navi navi 地址, 公有云可不配置\n   */\n  var initIM = function (params) {\n    var console = win.console;\n\n    var appKey = params.appkey,\n      token = params.token,\n      navi = params.navi;\n\n    im = RongIMLib.init({\n      appkey: appKey,\n      // navigators: [navi]\n    });\n\n    im.watch({\n      status: function (event) {\n        console.log('status changed', event);\n      }\n    });\n\n    return im.connect({\n      token\n    });\n  };\n\n  var initCallLib = function (userId) {\n    im.install(RongCallLib.installer)\n    const rtcClient = im.install(RCRTC.installer)\n    var config = {\n      RongIMLib: RongIMLib,\n      RongRTC: rtcClient,\n      currentUserId: userId,\n      RongRTCAdapter: RCRTCAdapter\n    };\n    // 初始化 CallLib\n    RongCallLib = RongCallLib.init(config);\n\n    return RongCallLib;\n  };\n\n  RongCall = RongCall || {};\n  RongCall.initIM = initIM;\n  RongCall.initCallLib = initCallLib;\n\n})(window.RongCall, {\n  win: window,\n  RongIMLib: window.RongIMLib,\n  RongCallLib: window.RongCallLib,\n  RongRTC: window.RongRTC,\n  RCRTC: window.RCRTC,\n  RCRTCAdapter: window.RCRTCAdapter\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/js/common/utils.js",
    "content": "(function (dependencies) {\n  var win = dependencies.win;\n\n  var noop = function () {};\n\n  var Dom = {\n    get: function (name) {\n      var selector = null;\n      try {\n        selector = win.document.querySelector(name);\n      } catch (e) {\n        // console.error(e);\n      }\n      return selector;\n    },\n    getById: function (id) {\n      return win.document.getElementById(id);\n    },\n    create: function (innerHTML) {\n      var div = win.document.createElement('div');\n      div.innerHTML = innerHTML;\n      return div.children[0];\n    }\n  };\n\n  function tplEngine(temp, data, regexp) {\n    var replaceAction = function (object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) === '\\\\') return match.slice(1);\n        return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n      });\n    };\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n  }\n\n  /**\n   * http 请求\n   * @param {object} option \n   * @param {object} option.url 地址\n   * @param {object} option.queryStrings\n   * @param {object} option.headers\n   * @param {object} option.body\n   * @param {object} option.isSync\n   */\n  function ajax(option) {\n    var xhr = new win.XMLHttpRequest();\n    var method = option.method || 'GET';\n    var url = option.url;\n    var isSync = option.isSync;\n    var queryStrings = option.queryStrings || {};\n    var tpl = '{key}={value}', strings = [];\n    for (var key in queryStrings) {\n      var value = queryStrings[key];\n      var str = tplEngine(tpl, {\n        key: key,\n        value: value\n      });\n      strings.push(str);\n    }\n    queryStrings = strings.join('&');\n    var urlTpl = '{url}?{queryString}';\n    url = tplEngine(urlTpl, {\n      url: url,\n      queryString: queryStrings\n    });\n    xhr.open(method, url, !isSync);\n\n    var headers = option.headers || {};\n    for (var name in headers) {\n      var header = headers[name];\n      xhr.setRequestHeader(name, header);\n    }\n\n    var isSuccess = function (xhr) {\n      return /^(200|202|10000)$/.test(xhr.status);\n    };\n    var success = option.success || noop;\n    var fail = option.fail || noop;\n    var onLoad = function () {\n      var result = xhr.responseText;\n      if (isSuccess(xhr)) {\n        success(result);\n      } else {\n        fail(result);\n      }\n    }\n    if ('onload' in xhr) {\n      xhr.onload = onLoad;\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          onLoad();\n        }\n      };\n    }\n    xhr.onerror = function (result) {\n      fail(result);\n    };\n\n    xhr.send(option.body);\n  }\n\n  /* 监听器(观察者模式) */\n  var EventEmitter = (function () {\n    var events = {};\n\n    var on = function (name, event) {\n      var currentEventList = events[name] || [];\n      currentEventList.push(event);\n      events[name] = currentEventList;\n    };\n\n    var off = function (name, event) {\n      if (!event) {\n        delete events[name];\n      } else {\n        var currentEventList = events[name];\n        currentEventList && currentEventList.forEach(function (currentEvent) {\n          if (currentEvent === event) {\n            var index = currentEventList.indexOf(currentEvent);\n            currentEventList.splice(index, 1);\n          }\n        });\n      }\n    };\n\n    var emit = function (name, data) {\n      let currentEventList = events[name] || [];\n      currentEventList.forEach(function (event) {\n        event(data);\n      });\n    };\n\n    var clear = function () {\n      events = {};\n    };\n\n    return {\n      on: on,\n      off: off,\n      emit: emit,\n      clear: clear\n    };\n  })();\n\n  function mountDialog(options) {\n    var Dialog = win.Vue.extend(options);\n    var instance = new Dialog({\n      el: document.createElement('div')\n    });\n    var wrap = document.getElementsByTagName('body')[0];\n    wrap.appendChild(instance.$el);\n    return instance;\n  }\n\n  function removeArray(value, array, removeKey) {\n    var removeKeyList = array.map(function (value) {\n      return value[removeKey];\n    });\n    var index = removeKeyList.indexOf(value[removeKey]);\n    if (index !== -1) {\n      array.splice(index, 1);\n    }\n    return array;\n  }\n\n  function DialogQueue() {\n    this.isRunning = false;\n    this.list = [];\n  }\n  DialogQueue.prototype.add = function (fn) {\n    var context = this;\n    var run = function () {\n      context.isRunning = true;\n      var index = context.list.indexOf(run);\n      context.list.splice(index, 1);\n      var runNext = function () {\n        context.isRunning = false;\n        context.run();\n      };\n      fn(runNext);\n    };\n    context.list.push(run);\n  };\n  DialogQueue.prototype.run = function () {\n    if (this.list.length && !this.isRunning) {\n      var run = this.list[0];\n      run && run();\n    }\n  };\n\n  var toastQueue = new DialogQueue();\n\n  function toast(content) {\n    var destroyTimeout = 3000;\n    var fn = function (runNext) {\n      win.RongCall.dialog.toast({\n        content: content,\n        destroyTimeout: destroyTimeout,\n        onDestoryed: runNext\n      });\n    };\n    toastQueue.add(fn);\n    toastQueue.run();\n  }\n\n  function login(userId) {\n    return new win.Promise(function (resolve, reject) {\n      ajax({\n        url: win.RongCall.setting.server + '/login',\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: win.JSON.stringify({\n          userId: userId\n        }),\n        success: function (result) {\n          resolve(win.JSON.parse(result));\n        },\n        fail: function (err) {\n          reject(err);\n        }\n      });\n    });\n  }\n\n  function getMembers(groupId) {\n    return new win.Promise(function (resolve, reject) {\n      ajax({\n        url: win.RongCall.setting.server + '/getMembers',\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json'\n        },\n        body: win.JSON.stringify({\n          groupId: groupId\n        }),\n        success: function (result) {\n          resolve(win.JSON.parse(result).members);\n        },\n        fail: function (err) {\n          reject(err);\n        }\n      });\n    });\n  }\n\n  win.RongCall = win.RongCall || {};\n  win.RongCall.utils = {\n    Dom: Dom,\n    console: win.console,\n    ajax: ajax,\n    EventEmitter: EventEmitter,\n    mountDialog: mountDialog,\n    removeArray: removeArray,\n    toast: toast,\n    login: login,\n    getMembers: getMembers\n  };\n\n})({\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/js/dialog.js",
    "content": "(function (RongCall) {\n  /* 弹框 */\n\n  var utils = RongCall.utils;\n\n  function removeSelf($el) {\n    var parent = $el.parentElement;\n    parent.removeChild($el);\n  }\n\n  /* 选择人员弹框 */\n  var selectUser = function (options) {\n    options = options || {};\n\n    var userList = options.userList;\n    userList = userList.map(function (user) {\n      user.isSelected = false;\n      return user;\n    });\n\n    return utils.mountDialog({\n      name: 'rong-select-dialog',\n      template: '#rong-template-dialog-users',\n      data: function () {\n        return {\n          isShow: true,\n          userList: userList\n        };\n      },\n      computed: {\n        hasSelectedUser: function () {\n          var selectedUser = this.userList.filter(function (user) {\n            return user.isSelected;\n          });\n          return selectedUser.length;\n        }\n      },\n      methods: {\n        selectUser: function (user) {\n          user.isSelected = !user.isSelected;\n        },\n        cancel: function () {\n          this.isShow = false;\n          options.canceled && options.canceled();\n        },\n        confirm: function () {\n          var userList = this.userList;\n          userList = userList.filter(function (user) {\n            return user.isSelected;\n          });\n          options.confirmed && options.confirmed(userList);\n          this.isShow = false;\n        }\n      },\n      watch: {\n        isShow: function (isShow) {\n          !isShow && removeSelf(this.$el);\n        }\n      }\n    });\n  };\n\n  /* 提示弹框 */\n  var toast = function (options) {\n    options = options || {};\n\n    return utils.mountDialog({\n      name: 'rong-toast-dialog',\n      template: '#rong-template-dialog-toast',\n      data: function () {\n        return {\n          isShow: true,\n          content: options.content\n        };\n      },\n      watch: {\n        isShow: function (isShow) {\n          !isShow && removeSelf(this.$el);\n        }\n      },\n      mounted: function () {\n        var context = this;\n        setTimeout(function () {\n          if (context.isShow) {\n            context.isShow = false;\n            options && options.onDestoryed();\n          }\n        }, options.destroyTimeout || 5000);\n      }\n    });\n  };\n\n  RongCall.dialog = {\n    selectUser: selectUser,\n    toast: toast\n  };\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/js/login.js",
    "content": "(function (RongCall, dependencies) {\n  /* 登录逻辑 */\n\n  var win = dependencies.win,\n    Vue = win.Vue;\n  var utils = RongCall.utils,\n    setting = RongCall.setting;\n\n  function toInfoPage(data) {\n    var instance = RongCall.instance;\n    instance.$router.push({\n      name: 'call',\n      params: data\n    });\n  }\n\n  RongCall.login = Vue.component('login', {\n    template: '#rong-template-login',\n    data: function () {\n      return {\n        userId: ''\n      };\n    },\n    methods: {\n      login: function () {\n        var userId = this.userId;\n        var loginDetail\n        utils.login(userId).then(function (result) {\n          setting.token = result.token;\n          loginDetail = result;\n          return RongCall.initIM(setting);\n        }).then(function () {\n          RongCall.instance.auth = loginDetail;\n          toInfoPage(loginDetail);\n        }).catch(function () {\n          win.alert('登录失败, 请检查 CallLib Demo Server 是否启动');\n        });\n      }\n    }\n  });\n\n})(window.RongCall, {\n  win: window\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/js/main.js",
    "content": "(function (RongCall, dependencies) {\n  'use strict';\n\n  var Vue = dependencies.Vue,\n    VueRouter = dependencies.VueRouter;\n\n  function getRouter() {\n    var router = new VueRouter({\n      routes: [\n        {\n          path: '/login',\n          name: 'login',\n          component: RongCall.login\n        },\n        {\n          path: '/call',\n          name: 'call',\n          component: RongCall.call\n        },\n        {\n          path: '*',\n          redirect: '/login'\n        }\n      ]\n    });\n    router.beforeEach(function (to, from, next) {\n      var ignoreAuthRoutes = ['login'];\n      var toName = to.name;\n      var instance = RongCall.instance || {};\n      var auth = instance.auth;\n      if (ignoreAuthRoutes.indexOf(toName) === -1 && !auth) {\n        return next({ name: 'login' });\n      }\n      next();\n    });\n    return router;\n  }\n\n  function init(config) {\n    RongCall.instance = new Vue({\n      el: config.el,\n      router: getRouter()\n    });\n  }\n\n  RongCall.init = init;\n\n})(window.RongCall, {\n  win: window,\n  Vue: window.Vue,\n  VueRouter: window.VueRouter\n});"
  },
  {
    "path": "calllib-v3/web-im-v3/lib/vue-2.6.7.js",
    "content": "/*!\n * Vue.js v2.6.7\n * (c) 2014-2019 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global = global || self, global.Vue = factory());\n}(this, function () { 'use strict';\n\n  /*  */\n\n  var emptyObject = Object.freeze({});\n\n  // These helpers produce better VM code in JS engines due to their\n  // explicitness and function inlining.\n  function isUndef (v) {\n    return v === undefined || v === null\n  }\n\n  function isDef (v) {\n    return v !== undefined && v !== null\n  }\n\n  function isTrue (v) {\n    return v === true\n  }\n\n  function isFalse (v) {\n    return v === false\n  }\n\n  /**\n   * Check if value is primitive.\n   */\n  function isPrimitive (value) {\n    return (\n      typeof value === 'string' ||\n      typeof value === 'number' ||\n      // $flow-disable-line\n      typeof value === 'symbol' ||\n      typeof value === 'boolean'\n    )\n  }\n\n  /**\n   * Quick object check - this is primarily used to tell\n   * Objects from primitive values when we know the value\n   * is a JSON-compliant type.\n   */\n  function isObject (obj) {\n    return obj !== null && typeof obj === 'object'\n  }\n\n  /**\n   * Get the raw type string of a value, e.g., [object Object].\n   */\n  var _toString = Object.prototype.toString;\n\n  function toRawType (value) {\n    return _toString.call(value).slice(8, -1)\n  }\n\n  /**\n   * Strict object type check. Only returns true\n   * for plain JavaScript objects.\n   */\n  function isPlainObject (obj) {\n    return _toString.call(obj) === '[object Object]'\n  }\n\n  function isRegExp (v) {\n    return _toString.call(v) === '[object RegExp]'\n  }\n\n  /**\n   * Check if val is a valid array index.\n   */\n  function isValidArrayIndex (val) {\n    var n = parseFloat(String(val));\n    return n >= 0 && Math.floor(n) === n && isFinite(val)\n  }\n\n  function isPromise (val) {\n    return (\n      isDef(val) &&\n      typeof val.then === 'function' &&\n      typeof val.catch === 'function'\n    )\n  }\n\n  /**\n   * Convert a value to a string that is actually rendered.\n   */\n  function toString (val) {\n    return val == null\n      ? ''\n      : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n        ? JSON.stringify(val, null, 2)\n        : String(val)\n  }\n\n  /**\n   * Convert an input value to a number for persistence.\n   * If the conversion fails, return original string.\n   */\n  function toNumber (val) {\n    var n = parseFloat(val);\n    return isNaN(n) ? val : n\n  }\n\n  /**\n   * Make a map and return a function for checking if a key\n   * is in that map.\n   */\n  function makeMap (\n    str,\n    expectsLowerCase\n  ) {\n    var map = Object.create(null);\n    var list = str.split(',');\n    for (var i = 0; i < list.length; i++) {\n      map[list[i]] = true;\n    }\n    return expectsLowerCase\n      ? function (val) { return map[val.toLowerCase()]; }\n      : function (val) { return map[val]; }\n  }\n\n  /**\n   * Check if a tag is a built-in tag.\n   */\n  var isBuiltInTag = makeMap('slot,component', true);\n\n  /**\n   * Check if an attribute is a reserved attribute.\n   */\n  var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n\n  /**\n   * Remove an item from an array.\n   */\n  function remove (arr, item) {\n    if (arr.length) {\n      var index = arr.indexOf(item);\n      if (index > -1) {\n        return arr.splice(index, 1)\n      }\n    }\n  }\n\n  /**\n   * Check whether an object has the property.\n   */\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n  function hasOwn (obj, key) {\n    return hasOwnProperty.call(obj, key)\n  }\n\n  /**\n   * Create a cached version of a pure function.\n   */\n  function cached (fn) {\n    var cache = Object.create(null);\n    return (function cachedFn (str) {\n      var hit = cache[str];\n      return hit || (cache[str] = fn(str))\n    })\n  }\n\n  /**\n   * Camelize a hyphen-delimited string.\n   */\n  var camelizeRE = /-(\\w)/g;\n  var camelize = cached(function (str) {\n    return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n  });\n\n  /**\n   * Capitalize a string.\n   */\n  var capitalize = cached(function (str) {\n    return str.charAt(0).toUpperCase() + str.slice(1)\n  });\n\n  /**\n   * Hyphenate a camelCase string.\n   */\n  var hyphenateRE = /\\B([A-Z])/g;\n  var hyphenate = cached(function (str) {\n    return str.replace(hyphenateRE, '-$1').toLowerCase()\n  });\n\n  /**\n   * Simple bind polyfill for environments that do not support it,\n   * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n   * since native bind is now performant enough in most browsers.\n   * But removing it would mean breaking code that was able to run in\n   * PhantomJS 1.x, so this must be kept for backward compatibility.\n   */\n\n  /* istanbul ignore next */\n  function polyfillBind (fn, ctx) {\n    function boundFn (a) {\n      var l = arguments.length;\n      return l\n        ? l > 1\n          ? fn.apply(ctx, arguments)\n          : fn.call(ctx, a)\n        : fn.call(ctx)\n    }\n\n    boundFn._length = fn.length;\n    return boundFn\n  }\n\n  function nativeBind (fn, ctx) {\n    return fn.bind(ctx)\n  }\n\n  var bind = Function.prototype.bind\n    ? nativeBind\n    : polyfillBind;\n\n  /**\n   * Convert an Array-like object to a real Array.\n   */\n  function toArray (list, start) {\n    start = start || 0;\n    var i = list.length - start;\n    var ret = new Array(i);\n    while (i--) {\n      ret[i] = list[i + start];\n    }\n    return ret\n  }\n\n  /**\n   * Mix properties into target object.\n   */\n  function extend (to, _from) {\n    for (var key in _from) {\n      to[key] = _from[key];\n    }\n    return to\n  }\n\n  /**\n   * Merge an Array of Objects into a single Object.\n   */\n  function toObject (arr) {\n    var res = {};\n    for (var i = 0; i < arr.length; i++) {\n      if (arr[i]) {\n        extend(res, arr[i]);\n      }\n    }\n    return res\n  }\n\n  /* eslint-disable no-unused-vars */\n\n  /**\n   * Perform no operation.\n   * Stubbing args to make Flow happy without leaving useless transpiled code\n   * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n   */\n  function noop (a, b, c) {}\n\n  /**\n   * Always return false.\n   */\n  var no = function (a, b, c) { return false; };\n\n  /* eslint-enable no-unused-vars */\n\n  /**\n   * Return the same value.\n   */\n  var identity = function (_) { return _; };\n\n  /**\n   * Generate a string containing static keys from compiler modules.\n   */\n  function genStaticKeys (modules) {\n    return modules.reduce(function (keys, m) {\n      return keys.concat(m.staticKeys || [])\n    }, []).join(',')\n  }\n\n  /**\n   * Check if two values are loosely equal - that is,\n   * if they are plain objects, do they have the same shape?\n   */\n  function looseEqual (a, b) {\n    if (a === b) { return true }\n    var isObjectA = isObject(a);\n    var isObjectB = isObject(b);\n    if (isObjectA && isObjectB) {\n      try {\n        var isArrayA = Array.isArray(a);\n        var isArrayB = Array.isArray(b);\n        if (isArrayA && isArrayB) {\n          return a.length === b.length && a.every(function (e, i) {\n            return looseEqual(e, b[i])\n          })\n        } else if (a instanceof Date && b instanceof Date) {\n          return a.getTime() === b.getTime()\n        } else if (!isArrayA && !isArrayB) {\n          var keysA = Object.keys(a);\n          var keysB = Object.keys(b);\n          return keysA.length === keysB.length && keysA.every(function (key) {\n            return looseEqual(a[key], b[key])\n          })\n        } else {\n          /* istanbul ignore next */\n          return false\n        }\n      } catch (e) {\n        /* istanbul ignore next */\n        return false\n      }\n    } else if (!isObjectA && !isObjectB) {\n      return String(a) === String(b)\n    } else {\n      return false\n    }\n  }\n\n  /**\n   * Return the first index at which a loosely equal value can be\n   * found in the array (if value is a plain object, the array must\n   * contain an object of the same shape), or -1 if it is not present.\n   */\n  function looseIndexOf (arr, val) {\n    for (var i = 0; i < arr.length; i++) {\n      if (looseEqual(arr[i], val)) { return i }\n    }\n    return -1\n  }\n\n  /**\n   * Ensure a function is called only once.\n   */\n  function once (fn) {\n    var called = false;\n    return function () {\n      if (!called) {\n        called = true;\n        fn.apply(this, arguments);\n      }\n    }\n  }\n\n  var SSR_ATTR = 'data-server-rendered';\n\n  var ASSET_TYPES = [\n    'component',\n    'directive',\n    'filter'\n  ];\n\n  var LIFECYCLE_HOOKS = [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated',\n    'errorCaptured',\n    'serverPrefetch'\n  ];\n\n  /*  */\n\n\n\n  var config = ({\n    /**\n     * Option merge strategies (used in core/util/options)\n     */\n    // $flow-disable-line\n    optionMergeStrategies: Object.create(null),\n\n    /**\n     * Whether to suppress warnings.\n     */\n    silent: false,\n\n    /**\n     * Show production mode tip message on boot?\n     */\n    productionTip: \"development\" !== 'production',\n\n    /**\n     * Whether to enable devtools\n     */\n    devtools: \"development\" !== 'production',\n\n    /**\n     * Whether to record perf\n     */\n    performance: false,\n\n    /**\n     * Error handler for watcher errors\n     */\n    errorHandler: null,\n\n    /**\n     * Warn handler for watcher warns\n     */\n    warnHandler: null,\n\n    /**\n     * Ignore certain custom elements\n     */\n    ignoredElements: [],\n\n    /**\n     * Custom user key aliases for v-on\n     */\n    // $flow-disable-line\n    keyCodes: Object.create(null),\n\n    /**\n     * Check if a tag is reserved so that it cannot be registered as a\n     * component. This is platform-dependent and may be overwritten.\n     */\n    isReservedTag: no,\n\n    /**\n     * Check if an attribute is reserved so that it cannot be used as a component\n     * prop. This is platform-dependent and may be overwritten.\n     */\n    isReservedAttr: no,\n\n    /**\n     * Check if a tag is an unknown element.\n     * Platform-dependent.\n     */\n    isUnknownElement: no,\n\n    /**\n     * Get the namespace of an element\n     */\n    getTagNamespace: noop,\n\n    /**\n     * Parse the real tag name for the specific platform.\n     */\n    parsePlatformTagName: identity,\n\n    /**\n     * Check if an attribute must be bound using property, e.g. value\n     * Platform-dependent.\n     */\n    mustUseProp: no,\n\n    /**\n     * Perform updates asynchronously. Intended to be used by Vue Test Utils\n     * This will significantly reduce performance if set to false.\n     */\n    async: true,\n\n    /**\n     * Exposed for legacy reasons\n     */\n    _lifecycleHooks: LIFECYCLE_HOOKS\n  });\n\n  /*  */\n\n  /**\n   * unicode letters used for parsing html tags, component names and property paths.\n   * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n   * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n   */\n  var unicodeLetters = 'a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';\n\n  /**\n   * Check if a string starts with $ or _\n   */\n  function isReserved (str) {\n    var c = (str + '').charCodeAt(0);\n    return c === 0x24 || c === 0x5F\n  }\n\n  /**\n   * Define a property.\n   */\n  function def (obj, key, val, enumerable) {\n    Object.defineProperty(obj, key, {\n      value: val,\n      enumerable: !!enumerable,\n      writable: true,\n      configurable: true\n    });\n  }\n\n  /**\n   * Parse simple path.\n   */\n  var bailRE = new RegExp((\"[^\" + unicodeLetters + \".$_\\\\d]\"));\n  function parsePath (path) {\n    if (bailRE.test(path)) {\n      return\n    }\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n\n  /*  */\n\n  // can we use __proto__?\n  var hasProto = '__proto__' in {};\n\n  // Browser environment sniffing\n  var inBrowser = typeof window !== 'undefined';\n  var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;\n  var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();\n  var UA = inBrowser && window.navigator.userAgent.toLowerCase();\n  var isIE = UA && /msie|trident/.test(UA);\n  var isIE9 = UA && UA.indexOf('msie 9.0') > 0;\n  var isEdge = UA && UA.indexOf('edge/') > 0;\n  var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');\n  var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');\n  var isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge;\n  var isPhantomJS = UA && /phantomjs/.test(UA);\n  var isFF = UA && UA.match(/firefox\\/(\\d+)/);\n\n  // Firefox has a \"watch\" function on Object.prototype...\n  var nativeWatch = ({}).watch;\n\n  var supportsPassive = false;\n  if (inBrowser) {\n    try {\n      var opts = {};\n      Object.defineProperty(opts, 'passive', ({\n        get: function get () {\n          /* istanbul ignore next */\n          supportsPassive = true;\n        }\n      })); // https://github.com/facebook/flow/issues/285\n      window.addEventListener('test-passive', null, opts);\n    } catch (e) {}\n  }\n\n  // this needs to be lazy-evaled because vue may be required before\n  // vue-server-renderer can set VUE_ENV\n  var _isServer;\n  var isServerRendering = function () {\n    if (_isServer === undefined) {\n      /* istanbul ignore if */\n      if (!inBrowser && !inWeex && typeof global !== 'undefined') {\n        // detect presence of vue-server-renderer and avoid\n        // Webpack shimming the process\n        _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';\n      } else {\n        _isServer = false;\n      }\n    }\n    return _isServer\n  };\n\n  // detect devtools\n  var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n  /* istanbul ignore next */\n  function isNative (Ctor) {\n    return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n  }\n\n  var hasSymbol =\n    typeof Symbol !== 'undefined' && isNative(Symbol) &&\n    typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);\n\n  var _Set;\n  /* istanbul ignore if */ // $flow-disable-line\n  if (typeof Set !== 'undefined' && isNative(Set)) {\n    // use native Set when available.\n    _Set = Set;\n  } else {\n    // a non-standard Set polyfill that only works with primitive keys.\n    _Set = /*@__PURE__*/(function () {\n      function Set () {\n        this.set = Object.create(null);\n      }\n      Set.prototype.has = function has (key) {\n        return this.set[key] === true\n      };\n      Set.prototype.add = function add (key) {\n        this.set[key] = true;\n      };\n      Set.prototype.clear = function clear () {\n        this.set = Object.create(null);\n      };\n\n      return Set;\n    }());\n  }\n\n  /*  */\n\n  var warn = noop;\n  var tip = noop;\n  var generateComponentTrace = (noop); // work around flow check\n  var formatComponentName = (noop);\n\n  {\n    var hasConsole = typeof console !== 'undefined';\n    var classifyRE = /(?:^|[-_])(\\w)/g;\n    var classify = function (str) { return str\n      .replace(classifyRE, function (c) { return c.toUpperCase(); })\n      .replace(/[-_]/g, ''); };\n\n    warn = function (msg, vm) {\n      var trace = vm ? generateComponentTrace(vm) : '';\n\n      if (config.warnHandler) {\n        config.warnHandler.call(null, msg, vm, trace);\n      } else if (hasConsole && (!config.silent)) {\n        console.error((\"[Vue warn]: \" + msg + trace));\n      }\n    };\n\n    tip = function (msg, vm) {\n      if (hasConsole && (!config.silent)) {\n        console.warn(\"[Vue tip]: \" + msg + (\n          vm ? generateComponentTrace(vm) : ''\n        ));\n      }\n    };\n\n    formatComponentName = function (vm, includeFile) {\n      if (vm.$root === vm) {\n        return '<Root>'\n      }\n      var options = typeof vm === 'function' && vm.cid != null\n        ? vm.options\n        : vm._isVue\n          ? vm.$options || vm.constructor.options\n          : vm;\n      var name = options.name || options._componentTag;\n      var file = options.__file;\n      if (!name && file) {\n        var match = file.match(/([^/\\\\]+)\\.vue$/);\n        name = match && match[1];\n      }\n\n      return (\n        (name ? (\"<\" + (classify(name)) + \">\") : \"<Anonymous>\") +\n        (file && includeFile !== false ? (\" at \" + file) : '')\n      )\n    };\n\n    var repeat = function (str, n) {\n      var res = '';\n      while (n) {\n        if (n % 2 === 1) { res += str; }\n        if (n > 1) { str += str; }\n        n >>= 1;\n      }\n      return res\n    };\n\n    generateComponentTrace = function (vm) {\n      if (vm._isVue && vm.$parent) {\n        var tree = [];\n        var currentRecursiveSequence = 0;\n        while (vm) {\n          if (tree.length > 0) {\n            var last = tree[tree.length - 1];\n            if (last.constructor === vm.constructor) {\n              currentRecursiveSequence++;\n              vm = vm.$parent;\n              continue\n            } else if (currentRecursiveSequence > 0) {\n              tree[tree.length - 1] = [last, currentRecursiveSequence];\n              currentRecursiveSequence = 0;\n            }\n          }\n          tree.push(vm);\n          vm = vm.$parent;\n        }\n        return '\\n\\nfound in\\n\\n' + tree\n          .map(function (vm, i) { return (\"\" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n              ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n              : formatComponentName(vm))); })\n          .join('\\n')\n      } else {\n        return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n      }\n    };\n  }\n\n  /*  */\n\n  var uid = 0;\n\n  /**\n   * A dep is an observable that can have multiple\n   * directives subscribing to it.\n   */\n  var Dep = function Dep () {\n    this.id = uid++;\n    this.subs = [];\n  };\n\n  Dep.prototype.addSub = function addSub (sub) {\n    this.subs.push(sub);\n  };\n\n  Dep.prototype.removeSub = function removeSub (sub) {\n    remove(this.subs, sub);\n  };\n\n  Dep.prototype.depend = function depend () {\n    if (Dep.target) {\n      Dep.target.addDep(this);\n    }\n  };\n\n  Dep.prototype.notify = function notify () {\n    // stabilize the subscriber list first\n    var subs = this.subs.slice();\n    if (!config.async) {\n      // subs aren't sorted in scheduler if not running async\n      // we need to sort them now to make sure they fire in correct\n      // order\n      subs.sort(function (a, b) { return a.id - b.id; });\n    }\n    for (var i = 0, l = subs.length; i < l; i++) {\n      subs[i].update();\n    }\n  };\n\n  // The current target watcher being evaluated.\n  // This is globally unique because only one watcher\n  // can be evaluated at a time.\n  Dep.target = null;\n  var targetStack = [];\n\n  function pushTarget (target) {\n    targetStack.push(target);\n    Dep.target = target;\n  }\n\n  function popTarget () {\n    targetStack.pop();\n    Dep.target = targetStack[targetStack.length - 1];\n  }\n\n  /*  */\n\n  var VNode = function VNode (\n    tag,\n    data,\n    children,\n    text,\n    elm,\n    context,\n    componentOptions,\n    asyncFactory\n  ) {\n    this.tag = tag;\n    this.data = data;\n    this.children = children;\n    this.text = text;\n    this.elm = elm;\n    this.ns = undefined;\n    this.context = context;\n    this.fnContext = undefined;\n    this.fnOptions = undefined;\n    this.fnScopeId = undefined;\n    this.key = data && data.key;\n    this.componentOptions = componentOptions;\n    this.componentInstance = undefined;\n    this.parent = undefined;\n    this.raw = false;\n    this.isStatic = false;\n    this.isRootInsert = true;\n    this.isComment = false;\n    this.isCloned = false;\n    this.isOnce = false;\n    this.asyncFactory = asyncFactory;\n    this.asyncMeta = undefined;\n    this.isAsyncPlaceholder = false;\n  };\n\n  var prototypeAccessors = { child: { configurable: true } };\n\n  // DEPRECATED: alias for componentInstance for backwards compat.\n  /* istanbul ignore next */\n  prototypeAccessors.child.get = function () {\n    return this.componentInstance\n  };\n\n  Object.defineProperties( VNode.prototype, prototypeAccessors );\n\n  var createEmptyVNode = function (text) {\n    if ( text === void 0 ) text = '';\n\n    var node = new VNode();\n    node.text = text;\n    node.isComment = true;\n    return node\n  };\n\n  function createTextVNode (val) {\n    return new VNode(undefined, undefined, undefined, String(val))\n  }\n\n  // optimized shallow clone\n  // used for static nodes and slot nodes because they may be reused across\n  // multiple renders, cloning them avoids errors when DOM manipulations rely\n  // on their elm reference.\n  function cloneVNode (vnode) {\n    var cloned = new VNode(\n      vnode.tag,\n      vnode.data,\n      // #7975\n      // clone children array to avoid mutating original in case of cloning\n      // a child.\n      vnode.children && vnode.children.slice(),\n      vnode.text,\n      vnode.elm,\n      vnode.context,\n      vnode.componentOptions,\n      vnode.asyncFactory\n    );\n    cloned.ns = vnode.ns;\n    cloned.isStatic = vnode.isStatic;\n    cloned.key = vnode.key;\n    cloned.isComment = vnode.isComment;\n    cloned.fnContext = vnode.fnContext;\n    cloned.fnOptions = vnode.fnOptions;\n    cloned.fnScopeId = vnode.fnScopeId;\n    cloned.asyncMeta = vnode.asyncMeta;\n    cloned.isCloned = true;\n    return cloned\n  }\n\n  /*\n   * not type checking this file because flow doesn't play well with\n   * dynamically accessing methods on Array prototype\n   */\n\n  var arrayProto = Array.prototype;\n  var arrayMethods = Object.create(arrayProto);\n\n  var methodsToPatch = [\n    'push',\n    'pop',\n    'shift',\n    'unshift',\n    'splice',\n    'sort',\n    'reverse'\n  ];\n\n  /**\n   * Intercept mutating methods and emit events\n   */\n  methodsToPatch.forEach(function (method) {\n    // cache original method\n    var original = arrayProto[method];\n    def(arrayMethods, method, function mutator () {\n      var args = [], len = arguments.length;\n      while ( len-- ) args[ len ] = arguments[ len ];\n\n      var result = original.apply(this, args);\n      var ob = this.__ob__;\n      var inserted;\n      switch (method) {\n        case 'push':\n        case 'unshift':\n          inserted = args;\n          break\n        case 'splice':\n          inserted = args.slice(2);\n          break\n      }\n      if (inserted) { ob.observeArray(inserted); }\n      // notify change\n      ob.dep.notify();\n      return result\n    });\n  });\n\n  /*  */\n\n  var arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n  /**\n   * In some cases we may want to disable observation inside a component's\n   * update computation.\n   */\n  var shouldObserve = true;\n\n  function toggleObserving (value) {\n    shouldObserve = value;\n  }\n\n  /**\n   * Observer class that is attached to each observed\n   * object. Once attached, the observer converts the target\n   * object's property keys into getter/setters that\n   * collect dependencies and dispatch updates.\n   */\n  var Observer = function Observer (value) {\n    this.value = value;\n    this.dep = new Dep();\n    this.vmCount = 0;\n    def(value, '__ob__', this);\n    if (Array.isArray(value)) {\n      if (hasProto) {\n        protoAugment(value, arrayMethods);\n      } else {\n        copyAugment(value, arrayMethods, arrayKeys);\n      }\n      this.observeArray(value);\n    } else {\n      this.walk(value);\n    }\n  };\n\n  /**\n   * Walk through all properties and convert them into\n   * getter/setters. This method should only be called when\n   * value type is Object.\n   */\n  Observer.prototype.walk = function walk (obj) {\n    var keys = Object.keys(obj);\n    for (var i = 0; i < keys.length; i++) {\n      defineReactive$$1(obj, keys[i]);\n    }\n  };\n\n  /**\n   * Observe a list of Array items.\n   */\n  Observer.prototype.observeArray = function observeArray (items) {\n    for (var i = 0, l = items.length; i < l; i++) {\n      observe(items[i]);\n    }\n  };\n\n  // helpers\n\n  /**\n   * Augment a target Object or Array by intercepting\n   * the prototype chain using __proto__\n   */\n  function protoAugment (target, src) {\n    /* eslint-disable no-proto */\n    target.__proto__ = src;\n    /* eslint-enable no-proto */\n  }\n\n  /**\n   * Augment a target Object or Array by defining\n   * hidden properties.\n   */\n  /* istanbul ignore next */\n  function copyAugment (target, src, keys) {\n    for (var i = 0, l = keys.length; i < l; i++) {\n      var key = keys[i];\n      def(target, key, src[key]);\n    }\n  }\n\n  /**\n   * Attempt to create an observer instance for a value,\n   * returns the new observer if successfully observed,\n   * or the existing observer if the value already has one.\n   */\n  function observe (value, asRootData) {\n    if (!isObject(value) || value instanceof VNode) {\n      return\n    }\n    var ob;\n    if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n      ob = value.__ob__;\n    } else if (\n      shouldObserve &&\n      !isServerRendering() &&\n      (Array.isArray(value) || isPlainObject(value)) &&\n      Object.isExtensible(value) &&\n      !value._isVue\n    ) {\n      ob = new Observer(value);\n    }\n    if (asRootData && ob) {\n      ob.vmCount++;\n    }\n    return ob\n  }\n\n  /**\n   * Define a reactive property on an Object.\n   */\n  function defineReactive$$1 (\n    obj,\n    key,\n    val,\n    customSetter,\n    shallow\n  ) {\n    var dep = new Dep();\n\n    var property = Object.getOwnPropertyDescriptor(obj, key);\n    if (property && property.configurable === false) {\n      return\n    }\n\n    // cater for pre-defined getter/setters\n    var getter = property && property.get;\n    var setter = property && property.set;\n    if ((!getter || setter) && arguments.length === 2) {\n      val = obj[key];\n    }\n\n    var childOb = !shallow && observe(val);\n    Object.defineProperty(obj, key, {\n      enumerable: true,\n      configurable: true,\n      get: function reactiveGetter () {\n        var value = getter ? getter.call(obj) : val;\n        if (Dep.target) {\n          dep.depend();\n          if (childOb) {\n            childOb.dep.depend();\n            if (Array.isArray(value)) {\n              dependArray(value);\n            }\n          }\n        }\n        return value\n      },\n      set: function reactiveSetter (newVal) {\n        var value = getter ? getter.call(obj) : val;\n        /* eslint-disable no-self-compare */\n        if (newVal === value || (newVal !== newVal && value !== value)) {\n          return\n        }\n        /* eslint-enable no-self-compare */\n        if (customSetter) {\n          customSetter();\n        }\n        // #7981: for accessor properties without setter\n        if (getter && !setter) { return }\n        if (setter) {\n          setter.call(obj, newVal);\n        } else {\n          val = newVal;\n        }\n        childOb = !shallow && observe(newVal);\n        dep.notify();\n      }\n    });\n  }\n\n  /**\n   * Set a property on an object. Adds the new property and\n   * triggers change notification if the property doesn't\n   * already exist.\n   */\n  function set (target, key, val) {\n    if (isUndef(target) || isPrimitive(target)\n    ) {\n      warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n    }\n    if (Array.isArray(target) && isValidArrayIndex(key)) {\n      target.length = Math.max(target.length, key);\n      target.splice(key, 1, val);\n      return val\n    }\n    if (key in target && !(key in Object.prototype)) {\n      target[key] = val;\n      return val\n    }\n    var ob = (target).__ob__;\n    if (target._isVue || (ob && ob.vmCount)) {\n      warn(\n        'Avoid adding reactive properties to a Vue instance or its root $data ' +\n        'at runtime - declare it upfront in the data option.'\n      );\n      return val\n    }\n    if (!ob) {\n      target[key] = val;\n      return val\n    }\n    defineReactive$$1(ob.value, key, val);\n    ob.dep.notify();\n    return val\n  }\n\n  /**\n   * Delete a property and trigger change if necessary.\n   */\n  function del (target, key) {\n    if (isUndef(target) || isPrimitive(target)\n    ) {\n      warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n    }\n    if (Array.isArray(target) && isValidArrayIndex(key)) {\n      target.splice(key, 1);\n      return\n    }\n    var ob = (target).__ob__;\n    if (target._isVue || (ob && ob.vmCount)) {\n      warn(\n        'Avoid deleting properties on a Vue instance or its root $data ' +\n        '- just set it to null.'\n      );\n      return\n    }\n    if (!hasOwn(target, key)) {\n      return\n    }\n    delete target[key];\n    if (!ob) {\n      return\n    }\n    ob.dep.notify();\n  }\n\n  /**\n   * Collect dependencies on array elements when the array is touched, since\n   * we cannot intercept array element access like property getters.\n   */\n  function dependArray (value) {\n    for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n      e = value[i];\n      e && e.__ob__ && e.__ob__.dep.depend();\n      if (Array.isArray(e)) {\n        dependArray(e);\n      }\n    }\n  }\n\n  /*  */\n\n  /**\n   * Option overwriting strategies are functions that handle\n   * how to merge a parent option value and a child option\n   * value into the final value.\n   */\n  var strats = config.optionMergeStrategies;\n\n  /**\n   * Options with restrictions\n   */\n  {\n    strats.el = strats.propsData = function (parent, child, vm, key) {\n      if (!vm) {\n        warn(\n          \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n          'creation with the `new` keyword.'\n        );\n      }\n      return defaultStrat(parent, child)\n    };\n  }\n\n  /**\n   * Helper that recursively merges two data objects together.\n   */\n  function mergeData (to, from) {\n    if (!from) { return to }\n    var key, toVal, fromVal;\n\n    var keys = hasSymbol\n      ? Reflect.ownKeys(from)\n      : Object.keys(from);\n\n    for (var i = 0; i < keys.length; i++) {\n      key = keys[i];\n      // in case the object is already observed...\n      if (key === '__ob__') { continue }\n      toVal = to[key];\n      fromVal = from[key];\n      if (!hasOwn(to, key)) {\n        set(to, key, fromVal);\n      } else if (\n        toVal !== fromVal &&\n        isPlainObject(toVal) &&\n        isPlainObject(fromVal)\n      ) {\n        mergeData(toVal, fromVal);\n      }\n    }\n    return to\n  }\n\n  /**\n   * Data\n   */\n  function mergeDataOrFn (\n    parentVal,\n    childVal,\n    vm\n  ) {\n    if (!vm) {\n      // in a Vue.extend merge, both should be functions\n      if (!childVal) {\n        return parentVal\n      }\n      if (!parentVal) {\n        return childVal\n      }\n      // when parentVal & childVal are both present,\n      // we need to return a function that returns the\n      // merged result of both functions... no need to\n      // check if parentVal is a function here because\n      // it has to be a function to pass previous merges.\n      return function mergedDataFn () {\n        return mergeData(\n          typeof childVal === 'function' ? childVal.call(this, this) : childVal,\n          typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal\n        )\n      }\n    } else {\n      return function mergedInstanceDataFn () {\n        // instance merge\n        var instanceData = typeof childVal === 'function'\n          ? childVal.call(vm, vm)\n          : childVal;\n        var defaultData = typeof parentVal === 'function'\n          ? parentVal.call(vm, vm)\n          : parentVal;\n        if (instanceData) {\n          return mergeData(instanceData, defaultData)\n        } else {\n          return defaultData\n        }\n      }\n    }\n  }\n\n  strats.data = function (\n    parentVal,\n    childVal,\n    vm\n  ) {\n    if (!vm) {\n      if (childVal && typeof childVal !== 'function') {\n        warn(\n          'The \"data\" option should be a function ' +\n          'that returns a per-instance value in component ' +\n          'definitions.',\n          vm\n        );\n\n        return parentVal\n      }\n      return mergeDataOrFn(parentVal, childVal)\n    }\n\n    return mergeDataOrFn(parentVal, childVal, vm)\n  };\n\n  /**\n   * Hooks and props are merged as arrays.\n   */\n  function mergeHook (\n    parentVal,\n    childVal\n  ) {\n    var res = childVal\n      ? parentVal\n        ? parentVal.concat(childVal)\n        : Array.isArray(childVal)\n          ? childVal\n          : [childVal]\n      : parentVal;\n    return res\n      ? dedupeHooks(res)\n      : res\n  }\n\n  function dedupeHooks (hooks) {\n    var res = [];\n    for (var i = 0; i < hooks.length; i++) {\n      if (res.indexOf(hooks[i]) === -1) {\n        res.push(hooks[i]);\n      }\n    }\n    return res\n  }\n\n  LIFECYCLE_HOOKS.forEach(function (hook) {\n    strats[hook] = mergeHook;\n  });\n\n  /**\n   * Assets\n   *\n   * When a vm is present (instance creation), we need to do\n   * a three-way merge between constructor options, instance\n   * options and parent options.\n   */\n  function mergeAssets (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    var res = Object.create(parentVal || null);\n    if (childVal) {\n      assertObjectType(key, childVal, vm);\n      return extend(res, childVal)\n    } else {\n      return res\n    }\n  }\n\n  ASSET_TYPES.forEach(function (type) {\n    strats[type + 's'] = mergeAssets;\n  });\n\n  /**\n   * Watchers.\n   *\n   * Watchers hashes should not overwrite one\n   * another, so we merge them as arrays.\n   */\n  strats.watch = function (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    // work around Firefox's Object.prototype.watch...\n    if (parentVal === nativeWatch) { parentVal = undefined; }\n    if (childVal === nativeWatch) { childVal = undefined; }\n    /* istanbul ignore if */\n    if (!childVal) { return Object.create(parentVal || null) }\n    {\n      assertObjectType(key, childVal, vm);\n    }\n    if (!parentVal) { return childVal }\n    var ret = {};\n    extend(ret, parentVal);\n    for (var key$1 in childVal) {\n      var parent = ret[key$1];\n      var child = childVal[key$1];\n      if (parent && !Array.isArray(parent)) {\n        parent = [parent];\n      }\n      ret[key$1] = parent\n        ? parent.concat(child)\n        : Array.isArray(child) ? child : [child];\n    }\n    return ret\n  };\n\n  /**\n   * Other object hashes.\n   */\n  strats.props =\n  strats.methods =\n  strats.inject =\n  strats.computed = function (\n    parentVal,\n    childVal,\n    vm,\n    key\n  ) {\n    if (childVal && \"development\" !== 'production') {\n      assertObjectType(key, childVal, vm);\n    }\n    if (!parentVal) { return childVal }\n    var ret = Object.create(null);\n    extend(ret, parentVal);\n    if (childVal) { extend(ret, childVal); }\n    return ret\n  };\n  strats.provide = mergeDataOrFn;\n\n  /**\n   * Default strategy.\n   */\n  var defaultStrat = function (parentVal, childVal) {\n    return childVal === undefined\n      ? parentVal\n      : childVal\n  };\n\n  /**\n   * Validate component names\n   */\n  function checkComponents (options) {\n    for (var key in options.components) {\n      validateComponentName(key);\n    }\n  }\n\n  function validateComponentName (name) {\n    if (!new RegExp((\"^[a-zA-Z][\\\\-\\\\.0-9_\" + unicodeLetters + \"]*$\")).test(name)) {\n      warn(\n        'Invalid component name: \"' + name + '\". Component names ' +\n        'should conform to valid custom element name in html5 specification.'\n      );\n    }\n    if (isBuiltInTag(name) || config.isReservedTag(name)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + name\n      );\n    }\n  }\n\n  /**\n   * Ensure all props option syntax are normalized into the\n   * Object-based format.\n   */\n  function normalizeProps (options, vm) {\n    var props = options.props;\n    if (!props) { return }\n    var res = {};\n    var i, val, name;\n    if (Array.isArray(props)) {\n      i = props.length;\n      while (i--) {\n        val = props[i];\n        if (typeof val === 'string') {\n          name = camelize(val);\n          res[name] = { type: null };\n        } else {\n          warn('props must be strings when using array syntax.');\n        }\n      }\n    } else if (isPlainObject(props)) {\n      for (var key in props) {\n        val = props[key];\n        name = camelize(key);\n        res[name] = isPlainObject(val)\n          ? val\n          : { type: val };\n      }\n    } else {\n      warn(\n        \"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\n        \"but got \" + (toRawType(props)) + \".\",\n        vm\n      );\n    }\n    options.props = res;\n  }\n\n  /**\n   * Normalize all injections into Object-based format\n   */\n  function normalizeInject (options, vm) {\n    var inject = options.inject;\n    if (!inject) { return }\n    var normalized = options.inject = {};\n    if (Array.isArray(inject)) {\n      for (var i = 0; i < inject.length; i++) {\n        normalized[inject[i]] = { from: inject[i] };\n      }\n    } else if (isPlainObject(inject)) {\n      for (var key in inject) {\n        var val = inject[key];\n        normalized[key] = isPlainObject(val)\n          ? extend({ from: key }, val)\n          : { from: val };\n      }\n    } else {\n      warn(\n        \"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\n        \"but got \" + (toRawType(inject)) + \".\",\n        vm\n      );\n    }\n  }\n\n  /**\n   * Normalize raw function directives into object format.\n   */\n  function normalizeDirectives (options) {\n    var dirs = options.directives;\n    if (dirs) {\n      for (var key in dirs) {\n        var def$$1 = dirs[key];\n        if (typeof def$$1 === 'function') {\n          dirs[key] = { bind: def$$1, update: def$$1 };\n        }\n      }\n    }\n  }\n\n  function assertObjectType (name, value, vm) {\n    if (!isPlainObject(value)) {\n      warn(\n        \"Invalid value for option \\\"\" + name + \"\\\": expected an Object, \" +\n        \"but got \" + (toRawType(value)) + \".\",\n        vm\n      );\n    }\n  }\n\n  /**\n   * Merge two option objects into a new one.\n   * Core utility used in both instantiation and inheritance.\n   */\n  function mergeOptions (\n    parent,\n    child,\n    vm\n  ) {\n    {\n      checkComponents(child);\n    }\n\n    if (typeof child === 'function') {\n      child = child.options;\n    }\n\n    normalizeProps(child, vm);\n    normalizeInject(child, vm);\n    normalizeDirectives(child);\n\n    // Apply extends and mixins on the child options,\n    // but only if it is a raw options object that isn't\n    // the result of another mergeOptions call.\n    // Only merged options has the _base property.\n    if (!child._base) {\n      if (child.extends) {\n        parent = mergeOptions(parent, child.extends, vm);\n      }\n      if (child.mixins) {\n        for (var i = 0, l = child.mixins.length; i < l; i++) {\n          parent = mergeOptions(parent, child.mixins[i], vm);\n        }\n      }\n    }\n\n    var options = {};\n    var key;\n    for (key in parent) {\n      mergeField(key);\n    }\n    for (key in child) {\n      if (!hasOwn(parent, key)) {\n        mergeField(key);\n      }\n    }\n    function mergeField (key) {\n      var strat = strats[key] || defaultStrat;\n      options[key] = strat(parent[key], child[key], vm, key);\n    }\n    return options\n  }\n\n  /**\n   * Resolve an asset.\n   * This function is used because child instances need access\n   * to assets defined in its ancestor chain.\n   */\n  function resolveAsset (\n    options,\n    type,\n    id,\n    warnMissing\n  ) {\n    /* istanbul ignore if */\n    if (typeof id !== 'string') {\n      return\n    }\n    var assets = options[type];\n    // check local registration variations first\n    if (hasOwn(assets, id)) { return assets[id] }\n    var camelizedId = camelize(id);\n    if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }\n    var PascalCaseId = capitalize(camelizedId);\n    if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }\n    // fallback to prototype chain\n    var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\n    if (warnMissing && !res) {\n      warn(\n        'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n        options\n      );\n    }\n    return res\n  }\n\n  /*  */\n\n\n\n  function validateProp (\n    key,\n    propOptions,\n    propsData,\n    vm\n  ) {\n    var prop = propOptions[key];\n    var absent = !hasOwn(propsData, key);\n    var value = propsData[key];\n    // boolean casting\n    var booleanIndex = getTypeIndex(Boolean, prop.type);\n    if (booleanIndex > -1) {\n      if (absent && !hasOwn(prop, 'default')) {\n        value = false;\n      } else if (value === '' || value === hyphenate(key)) {\n        // only cast empty string / same name to boolean if\n        // boolean has higher priority\n        var stringIndex = getTypeIndex(String, prop.type);\n        if (stringIndex < 0 || booleanIndex < stringIndex) {\n          value = true;\n        }\n      }\n    }\n    // check default value\n    if (value === undefined) {\n      value = getPropDefaultValue(vm, prop, key);\n      // since the default value is a fresh copy,\n      // make sure to observe it.\n      var prevShouldObserve = shouldObserve;\n      toggleObserving(true);\n      observe(value);\n      toggleObserving(prevShouldObserve);\n    }\n    {\n      assertProp(prop, key, value, vm, absent);\n    }\n    return value\n  }\n\n  /**\n   * Get the default value of a prop.\n   */\n  function getPropDefaultValue (vm, prop, key) {\n    // no default, return undefined\n    if (!hasOwn(prop, 'default')) {\n      return undefined\n    }\n    var def = prop.default;\n    // warn against non-factory defaults for Object & Array\n    if (isObject(def)) {\n      warn(\n        'Invalid default value for prop \"' + key + '\": ' +\n        'Props with type Object/Array must use a factory function ' +\n        'to return the default value.',\n        vm\n      );\n    }\n    // the raw prop value was also undefined from previous render,\n    // return previous default value to avoid unnecessary watcher trigger\n    if (vm && vm.$options.propsData &&\n      vm.$options.propsData[key] === undefined &&\n      vm._props[key] !== undefined\n    ) {\n      return vm._props[key]\n    }\n    // call factory function for non-Function types\n    // a value is Function if its prototype is function even across different execution context\n    return typeof def === 'function' && getType(prop.type) !== 'Function'\n      ? def.call(vm)\n      : def\n  }\n\n  /**\n   * Assert whether a prop is valid.\n   */\n  function assertProp (\n    prop,\n    name,\n    value,\n    vm,\n    absent\n  ) {\n    if (prop.required && absent) {\n      warn(\n        'Missing required prop: \"' + name + '\"',\n        vm\n      );\n      return\n    }\n    if (value == null && !prop.required) {\n      return\n    }\n    var type = prop.type;\n    var valid = !type || type === true;\n    var expectedTypes = [];\n    if (type) {\n      if (!Array.isArray(type)) {\n        type = [type];\n      }\n      for (var i = 0; i < type.length && !valid; i++) {\n        var assertedType = assertType(value, type[i]);\n        expectedTypes.push(assertedType.expectedType || '');\n        valid = assertedType.valid;\n      }\n    }\n\n    if (!valid) {\n      warn(\n        getInvalidTypeMessage(name, value, expectedTypes),\n        vm\n      );\n      return\n    }\n    var validator = prop.validator;\n    if (validator) {\n      if (!validator(value)) {\n        warn(\n          'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n          vm\n        );\n      }\n    }\n  }\n\n  var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;\n\n  function assertType (value, type) {\n    var valid;\n    var expectedType = getType(type);\n    if (simpleCheckRE.test(expectedType)) {\n      var t = typeof value;\n      valid = t === expectedType.toLowerCase();\n      // for primitive wrapper objects\n      if (!valid && t === 'object') {\n        valid = value instanceof type;\n      }\n    } else if (expectedType === 'Object') {\n      valid = isPlainObject(value);\n    } else if (expectedType === 'Array') {\n      valid = Array.isArray(value);\n    } else {\n      valid = value instanceof type;\n    }\n    return {\n      valid: valid,\n      expectedType: expectedType\n    }\n  }\n\n  /**\n   * Use function string name to check built-in types,\n   * because a simple equality check will fail when running\n   * across different vms / iframes.\n   */\n  function getType (fn) {\n    var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n    return match ? match[1] : ''\n  }\n\n  function isSameType (a, b) {\n    return getType(a) === getType(b)\n  }\n\n  function getTypeIndex (type, expectedTypes) {\n    if (!Array.isArray(expectedTypes)) {\n      return isSameType(expectedTypes, type) ? 0 : -1\n    }\n    for (var i = 0, len = expectedTypes.length; i < len; i++) {\n      if (isSameType(expectedTypes[i], type)) {\n        return i\n      }\n    }\n    return -1\n  }\n\n  function getInvalidTypeMessage (name, value, expectedTypes) {\n    var message = \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n      \" Expected \" + (expectedTypes.map(capitalize).join(', '));\n    var expectedType = expectedTypes[0];\n    var receivedType = toRawType(value);\n    var expectedValue = styleValue(value, expectedType);\n    var receivedValue = styleValue(value, receivedType);\n    // check if we need to specify expected value\n    if (expectedTypes.length === 1 &&\n        isExplicable(expectedType) &&\n        !isBoolean(expectedType, receivedType)) {\n      message += \" with value \" + expectedValue;\n    }\n    message += \", got \" + receivedType + \" \";\n    // check if we need to specify received value\n    if (isExplicable(receivedType)) {\n      message += \"with value \" + receivedValue + \".\";\n    }\n    return message\n  }\n\n  function styleValue (value, type) {\n    if (type === 'String') {\n      return (\"\\\"\" + value + \"\\\"\")\n    } else if (type === 'Number') {\n      return (\"\" + (Number(value)))\n    } else {\n      return (\"\" + value)\n    }\n  }\n\n  function isExplicable (value) {\n    var explicitTypes = ['string', 'number', 'boolean'];\n    return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })\n  }\n\n  function isBoolean () {\n    var args = [], len = arguments.length;\n    while ( len-- ) args[ len ] = arguments[ len ];\n\n    return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })\n  }\n\n  /*  */\n\n  function handleError (err, vm, info) {\n    // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.\n    // See: https://github.com/vuejs/vuex/issues/1505\n    pushTarget();\n    try {\n      if (vm) {\n        var cur = vm;\n        while ((cur = cur.$parent)) {\n          var hooks = cur.$options.errorCaptured;\n          if (hooks) {\n            for (var i = 0; i < hooks.length; i++) {\n              try {\n                var capture = hooks[i].call(cur, err, vm, info) === false;\n                if (capture) { return }\n              } catch (e) {\n                globalHandleError(e, cur, 'errorCaptured hook');\n              }\n            }\n          }\n        }\n      }\n      globalHandleError(err, vm, info);\n    } finally {\n      popTarget();\n    }\n  }\n\n  function invokeWithErrorHandling (\n    handler,\n    context,\n    args,\n    vm,\n    info\n  ) {\n    var res;\n    try {\n      res = args ? handler.apply(context, args) : handler.call(context);\n      if (res && !res._isVue && isPromise(res)) {\n        // issue #9511\n        // reassign to res to avoid catch triggering multiple times when nested calls\n        res = res.catch(function (e) { return handleError(e, vm, info + \" (Promise/async)\"); });\n      }\n    } catch (e) {\n      handleError(e, vm, info);\n    }\n    return res\n  }\n\n  function globalHandleError (err, vm, info) {\n    if (config.errorHandler) {\n      try {\n        return config.errorHandler.call(null, err, vm, info)\n      } catch (e) {\n        // if the user intentionally throws the original error in the handler,\n        // do not log it twice\n        if (e !== err) {\n          logError(e, null, 'config.errorHandler');\n        }\n      }\n    }\n    logError(err, vm, info);\n  }\n\n  function logError (err, vm, info) {\n    {\n      warn((\"Error in \" + info + \": \\\"\" + (err.toString()) + \"\\\"\"), vm);\n    }\n    /* istanbul ignore else */\n    if ((inBrowser || inWeex) && typeof console !== 'undefined') {\n      console.error(err);\n    } else {\n      throw err\n    }\n  }\n\n  /*  */\n\n  var isUsingMicroTask = false;\n\n  var callbacks = [];\n  var pending = false;\n\n  function flushCallbacks () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // Here we have async deferring wrappers using microtasks.\n  // In 2.5 we used (macro) tasks (in combination with microtasks).\n  // However, it has subtle problems when state is changed right before repaint\n  // (e.g. #6813, out-in transitions).\n  // Also, using (macro) tasks in event handler would cause some weird behaviors\n  // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).\n  // So we now use microtasks everywhere, again.\n  // A major drawback of this tradeoff is that there are some scenarios\n  // where microtasks have too high a priority and fire in between supposedly\n  // sequential events (e.g. #4521, #6690, which have workarounds)\n  // or even between bubbling of the same event (#6566).\n  var timerFunc;\n\n  // The nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore next, $flow-disable-line */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    timerFunc = function () {\n      p.then(flushCallbacks);\n      // In problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n    isUsingMicroTask = true;\n  } else if (!isIE && typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // Use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS, iOS7, Android 4.4\n    // (#6466 MutationObserver is unreliable in IE11)\n    var counter = 1;\n    var observer = new MutationObserver(flushCallbacks);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n    isUsingMicroTask = true;\n  } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\n    // Fallback to setImmediate.\n    // Techinically it leverages the (macro) task queue,\n    // but it is still a better choice than setTimeout.\n    timerFunc = function () {\n      setImmediate(flushCallbacks);\n    };\n  } else {\n    // Fallback to setTimeout.\n    timerFunc = function () {\n      setTimeout(flushCallbacks, 0);\n    };\n  }\n\n  function nextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) {\n        try {\n          cb.call(ctx);\n        } catch (e) {\n          handleError(e, ctx, 'nextTick');\n        }\n      } else if (_resolve) {\n        _resolve(ctx);\n      }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    // $flow-disable-line\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n\n  /*  */\n\n  var mark;\n  var measure;\n\n  {\n    var perf = inBrowser && window.performance;\n    /* istanbul ignore if */\n    if (\n      perf &&\n      perf.mark &&\n      perf.measure &&\n      perf.clearMarks &&\n      perf.clearMeasures\n    ) {\n      mark = function (tag) { return perf.mark(tag); };\n      measure = function (name, startTag, endTag) {\n        perf.measure(name, startTag, endTag);\n        perf.clearMarks(startTag);\n        perf.clearMarks(endTag);\n        // perf.clearMeasures(name)\n      };\n    }\n  }\n\n  /* not type checking this file because flow doesn't play well with Proxy */\n\n  var initProxy;\n\n  {\n    var allowedGlobals = makeMap(\n      'Infinity,undefined,NaN,isFinite,isNaN,' +\n      'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n      'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n      'require' // for Webpack/Browserify\n    );\n\n    var warnNonPresent = function (target, key) {\n      warn(\n        \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n        'referenced during render. Make sure that this property is reactive, ' +\n        'either in the data option, or for class-based components, by ' +\n        'initializing the property. ' +\n        'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',\n        target\n      );\n    };\n\n    var warnReservedPrefix = function (target, key) {\n      warn(\n        \"Property \\\"\" + key + \"\\\" must be accessed with \\\"$data.\" + key + \"\\\" because \" +\n        'properties starting with \"$\" or \"_\" are not proxied in the Vue instance to ' +\n        'prevent conflicts with Vue internals' +\n        'See: https://vuejs.org/v2/api/#data',\n        target\n      );\n    };\n\n    var hasProxy =\n      typeof Proxy !== 'undefined' && isNative(Proxy);\n\n    if (hasProxy) {\n      var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\n      config.keyCodes = new Proxy(config.keyCodes, {\n        set: function set (target, key, value) {\n          if (isBuiltInModifier(key)) {\n            warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n            return false\n          } else {\n            target[key] = value;\n            return true\n          }\n        }\n      });\n    }\n\n    var hasHandler = {\n      has: function has (target, key) {\n        var has = key in target;\n        var isAllowed = allowedGlobals(key) ||\n          (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));\n        if (!has && !isAllowed) {\n          if (key in target.$data) { warnReservedPrefix(target, key); }\n          else { warnNonPresent(target, key); }\n        }\n        return has || !isAllowed\n      }\n    };\n\n    var getHandler = {\n      get: function get (target, key) {\n        if (typeof key === 'string' && !(key in target)) {\n          if (key in target.$data) { warnReservedPrefix(target, key); }\n          else { warnNonPresent(target, key); }\n        }\n        return target[key]\n      }\n    };\n\n    initProxy = function initProxy (vm) {\n      if (hasProxy) {\n        // determine which proxy handler to use\n        var options = vm.$options;\n        var handlers = options.render && options.render._withStripped\n          ? getHandler\n          : hasHandler;\n        vm._renderProxy = new Proxy(vm, handlers);\n      } else {\n        vm._renderProxy = vm;\n      }\n    };\n  }\n\n  /*  */\n\n  var seenObjects = new _Set();\n\n  /**\n   * Recursively traverse an object to evoke all converted\n   * getters, so that every nested property inside the object\n   * is collected as a \"deep\" dependency.\n   */\n  function traverse (val) {\n    _traverse(val, seenObjects);\n    seenObjects.clear();\n  }\n\n  function _traverse (val, seen) {\n    var i, keys;\n    var isA = Array.isArray(val);\n    if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {\n      return\n    }\n    if (val.__ob__) {\n      var depId = val.__ob__.dep.id;\n      if (seen.has(depId)) {\n        return\n      }\n      seen.add(depId);\n    }\n    if (isA) {\n      i = val.length;\n      while (i--) { _traverse(val[i], seen); }\n    } else {\n      keys = Object.keys(val);\n      i = keys.length;\n      while (i--) { _traverse(val[keys[i]], seen); }\n    }\n  }\n\n  /*  */\n\n  var normalizeEvent = cached(function (name) {\n    var passive = name.charAt(0) === '&';\n    name = passive ? name.slice(1) : name;\n    var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first\n    name = once$$1 ? name.slice(1) : name;\n    var capture = name.charAt(0) === '!';\n    name = capture ? name.slice(1) : name;\n    return {\n      name: name,\n      once: once$$1,\n      capture: capture,\n      passive: passive\n    }\n  });\n\n  function createFnInvoker (fns, vm) {\n    function invoker () {\n      var arguments$1 = arguments;\n\n      var fns = invoker.fns;\n      if (Array.isArray(fns)) {\n        var cloned = fns.slice();\n        for (var i = 0; i < cloned.length; i++) {\n          invokeWithErrorHandling(cloned[i], null, arguments$1, vm, \"v-on handler\");\n        }\n      } else {\n        // return handler return value for single handlers\n        return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\")\n      }\n    }\n    invoker.fns = fns;\n    return invoker\n  }\n\n  function updateListeners (\n    on,\n    oldOn,\n    add,\n    remove$$1,\n    createOnceHandler,\n    vm\n  ) {\n    var name, def$$1, cur, old, event;\n    for (name in on) {\n      def$$1 = cur = on[name];\n      old = oldOn[name];\n      event = normalizeEvent(name);\n      if (isUndef(cur)) {\n        warn(\n          \"Invalid handler for event \\\"\" + (event.name) + \"\\\": got \" + String(cur),\n          vm\n        );\n      } else if (isUndef(old)) {\n        if (isUndef(cur.fns)) {\n          cur = on[name] = createFnInvoker(cur, vm);\n        }\n        if (isTrue(event.once)) {\n          cur = on[name] = createOnceHandler(event.name, cur, event.capture);\n        }\n        add(event.name, cur, event.capture, event.passive, event.params);\n      } else if (cur !== old) {\n        old.fns = cur;\n        on[name] = old;\n      }\n    }\n    for (name in oldOn) {\n      if (isUndef(on[name])) {\n        event = normalizeEvent(name);\n        remove$$1(event.name, oldOn[name], event.capture);\n      }\n    }\n  }\n\n  /*  */\n\n  function mergeVNodeHook (def, hookKey, hook) {\n    if (def instanceof VNode) {\n      def = def.data.hook || (def.data.hook = {});\n    }\n    var invoker;\n    var oldHook = def[hookKey];\n\n    function wrappedHook () {\n      hook.apply(this, arguments);\n      // important: remove merged hook to ensure it's called only once\n      // and prevent memory leak\n      remove(invoker.fns, wrappedHook);\n    }\n\n    if (isUndef(oldHook)) {\n      // no existing hook\n      invoker = createFnInvoker([wrappedHook]);\n    } else {\n      /* istanbul ignore if */\n      if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n        // already a merged invoker\n        invoker = oldHook;\n        invoker.fns.push(wrappedHook);\n      } else {\n        // existing plain hook\n        invoker = createFnInvoker([oldHook, wrappedHook]);\n      }\n    }\n\n    invoker.merged = true;\n    def[hookKey] = invoker;\n  }\n\n  /*  */\n\n  function extractPropsFromVNodeData (\n    data,\n    Ctor,\n    tag\n  ) {\n    // we are only extracting raw values here.\n    // validation and default values are handled in the child\n    // component itself.\n    var propOptions = Ctor.options.props;\n    if (isUndef(propOptions)) {\n      return\n    }\n    var res = {};\n    var attrs = data.attrs;\n    var props = data.props;\n    if (isDef(attrs) || isDef(props)) {\n      for (var key in propOptions) {\n        var altKey = hyphenate(key);\n        {\n          var keyInLowerCase = key.toLowerCase();\n          if (\n            key !== keyInLowerCase &&\n            attrs && hasOwn(attrs, keyInLowerCase)\n          ) {\n            tip(\n              \"Prop \\\"\" + keyInLowerCase + \"\\\" is passed to component \" +\n              (formatComponentName(tag || Ctor)) + \", but the declared prop name is\" +\n              \" \\\"\" + key + \"\\\". \" +\n              \"Note that HTML attributes are case-insensitive and camelCased \" +\n              \"props need to use their kebab-case equivalents when using in-DOM \" +\n              \"templates. You should probably use \\\"\" + altKey + \"\\\" instead of \\\"\" + key + \"\\\".\"\n            );\n          }\n        }\n        checkProp(res, props, key, altKey, true) ||\n        checkProp(res, attrs, key, altKey, false);\n      }\n    }\n    return res\n  }\n\n  function checkProp (\n    res,\n    hash,\n    key,\n    altKey,\n    preserve\n  ) {\n    if (isDef(hash)) {\n      if (hasOwn(hash, key)) {\n        res[key] = hash[key];\n        if (!preserve) {\n          delete hash[key];\n        }\n        return true\n      } else if (hasOwn(hash, altKey)) {\n        res[key] = hash[altKey];\n        if (!preserve) {\n          delete hash[altKey];\n        }\n        return true\n      }\n    }\n    return false\n  }\n\n  /*  */\n\n  // The template compiler attempts to minimize the need for normalization by\n  // statically analyzing the template at compile time.\n  //\n  // For plain HTML markup, normalization can be completely skipped because the\n  // generated render function is guaranteed to return Array<VNode>. There are\n  // two cases where extra normalization is needed:\n\n  // 1. When the children contains components - because a functional component\n  // may return an Array instead of a single root. In this case, just a simple\n  // normalization is needed - if any child is an Array, we flatten the whole\n  // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n  // because functional components already normalize their own children.\n  function simpleNormalizeChildren (children) {\n    for (var i = 0; i < children.length; i++) {\n      if (Array.isArray(children[i])) {\n        return Array.prototype.concat.apply([], children)\n      }\n    }\n    return children\n  }\n\n  // 2. When the children contains constructs that always generated nested Arrays,\n  // e.g. <template>, <slot>, v-for, or when the children is provided by user\n  // with hand-written render functions / JSX. In such cases a full normalization\n  // is needed to cater to all possible types of children values.\n  function normalizeChildren (children) {\n    return isPrimitive(children)\n      ? [createTextVNode(children)]\n      : Array.isArray(children)\n        ? normalizeArrayChildren(children)\n        : undefined\n  }\n\n  function isTextNode (node) {\n    return isDef(node) && isDef(node.text) && isFalse(node.isComment)\n  }\n\n  function normalizeArrayChildren (children, nestedIndex) {\n    var res = [];\n    var i, c, lastIndex, last;\n    for (i = 0; i < children.length; i++) {\n      c = children[i];\n      if (isUndef(c) || typeof c === 'boolean') { continue }\n      lastIndex = res.length - 1;\n      last = res[lastIndex];\n      //  nested\n      if (Array.isArray(c)) {\n        if (c.length > 0) {\n          c = normalizeArrayChildren(c, ((nestedIndex || '') + \"_\" + i));\n          // merge adjacent text nodes\n          if (isTextNode(c[0]) && isTextNode(last)) {\n            res[lastIndex] = createTextVNode(last.text + (c[0]).text);\n            c.shift();\n          }\n          res.push.apply(res, c);\n        }\n      } else if (isPrimitive(c)) {\n        if (isTextNode(last)) {\n          // merge adjacent text nodes\n          // this is necessary for SSR hydration because text nodes are\n          // essentially merged when rendered to HTML strings\n          res[lastIndex] = createTextVNode(last.text + c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else {\n        if (isTextNode(c) && isTextNode(last)) {\n          // merge adjacent text nodes\n          res[lastIndex] = createTextVNode(last.text + c.text);\n        } else {\n          // default key for nested array children (likely generated by v-for)\n          if (isTrue(children._isVList) &&\n            isDef(c.tag) &&\n            isUndef(c.key) &&\n            isDef(nestedIndex)) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  function initProvide (vm) {\n    var provide = vm.$options.provide;\n    if (provide) {\n      vm._provided = typeof provide === 'function'\n        ? provide.call(vm)\n        : provide;\n    }\n  }\n\n  function initInjections (vm) {\n    var result = resolveInject(vm.$options.inject, vm);\n    if (result) {\n      toggleObserving(false);\n      Object.keys(result).forEach(function (key) {\n        /* istanbul ignore else */\n        {\n          defineReactive$$1(vm, key, result[key], function () {\n            warn(\n              \"Avoid mutating an injected value directly since the changes will be \" +\n              \"overwritten whenever the provided component re-renders. \" +\n              \"injection being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          });\n        }\n      });\n      toggleObserving(true);\n    }\n  }\n\n  function resolveInject (inject, vm) {\n    if (inject) {\n      // inject is :any because flow is not smart enough to figure out cached\n      var result = Object.create(null);\n      var keys = hasSymbol\n        ? Reflect.ownKeys(inject)\n        : Object.keys(inject);\n\n      for (var i = 0; i < keys.length; i++) {\n        var key = keys[i];\n        // #6574 in case the inject object is observed...\n        if (key === '__ob__') { continue }\n        var provideKey = inject[key].from;\n        var source = vm;\n        while (source) {\n          if (source._provided && hasOwn(source._provided, provideKey)) {\n            result[key] = source._provided[provideKey];\n            break\n          }\n          source = source.$parent;\n        }\n        if (!source) {\n          if ('default' in inject[key]) {\n            var provideDefault = inject[key].default;\n            result[key] = typeof provideDefault === 'function'\n              ? provideDefault.call(vm)\n              : provideDefault;\n          } else {\n            warn((\"Injection \\\"\" + key + \"\\\" not found\"), vm);\n          }\n        }\n      }\n      return result\n    }\n  }\n\n  /*  */\n\n\n\n  /**\n   * Runtime helper for resolving raw children VNodes into a slot object.\n   */\n  function resolveSlots (\n    children,\n    context\n  ) {\n    if (!children || !children.length) {\n      return {}\n    }\n    var slots = {};\n    for (var i = 0, l = children.length; i < l; i++) {\n      var child = children[i];\n      var data = child.data;\n      // remove slot attribute if the node is resolved as a Vue slot node\n      if (data && data.attrs && data.attrs.slot) {\n        delete data.attrs.slot;\n      }\n      // named slots should only be respected if the vnode was rendered in the\n      // same context.\n      if ((child.context === context || child.fnContext === context) &&\n        data && data.slot != null\n      ) {\n        var name = data.slot;\n        var slot = (slots[name] || (slots[name] = []));\n        if (child.tag === 'template') {\n          slot.push.apply(slot, child.children || []);\n        } else {\n          slot.push(child);\n        }\n      } else {\n        (slots.default || (slots.default = [])).push(child);\n      }\n    }\n    // ignore slots that contains only whitespace\n    for (var name$1 in slots) {\n      if (slots[name$1].every(isWhitespace)) {\n        delete slots[name$1];\n      }\n    }\n    return slots\n  }\n\n  function isWhitespace (node) {\n    return (node.isComment && !node.asyncFactory) || node.text === ' '\n  }\n\n  /*  */\n\n  function normalizeScopedSlots (\n    slots,\n    normalSlots,\n    prevSlots\n  ) {\n    var res;\n    var isStable = slots ? !!slots.$stable : true;\n    var key = slots && slots.$key;\n    if (!slots) {\n      res = {};\n    } else if (slots._normalized) {\n      // fast path 1: child component re-render only, parent did not change\n      return slots._normalized\n    } else if (\n      isStable &&\n      prevSlots &&\n      prevSlots !== emptyObject &&\n      key === prevSlots.$key &&\n      Object.keys(normalSlots).length === 0\n    ) {\n      // fast path 2: stable scoped slots w/ no normal slots to proxy,\n      // only need to normalize once\n      return prevSlots\n    } else {\n      res = {};\n      for (var key$1 in slots) {\n        if (slots[key$1] && key$1[0] !== '$') {\n          res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);\n        }\n      }\n    }\n    // expose normal slots on scopedSlots\n    for (var key$2 in normalSlots) {\n      if (!(key$2 in res)) {\n        res[key$2] = proxyNormalSlot(normalSlots, key$2);\n      }\n    }\n    // avoriaz seems to mock a non-extensible $scopedSlots object\n    // and when that is passed down this would cause an error\n    if (slots && Object.isExtensible(slots)) {\n      (slots)._normalized = res;\n    }\n    def(res, '$stable', isStable);\n    def(res, '$key', key);\n    return res\n  }\n\n  function normalizeScopedSlot(normalSlots, key, fn) {\n    var normalized = function () {\n      var res = arguments.length ? fn.apply(null, arguments) : fn({});\n      res = res && typeof res === 'object' && !Array.isArray(res)\n        ? [res] // single vnode\n        : normalizeChildren(res);\n      return res && res.length === 0\n        ? undefined\n        : res\n    };\n    // this is a slot using the new v-slot syntax without scope. although it is\n    // compiled as a scoped slot, render fn users would expect it to be present\n    // on this.$slots because the usage is semantically a normal slot.\n    if (fn.proxy) {\n      Object.defineProperty(normalSlots, key, {\n        get: normalized,\n        enumerable: true,\n        configurable: true\n      });\n    }\n    return normalized\n  }\n\n  function proxyNormalSlot(slots, key) {\n    return function () { return slots[key]; }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering v-for lists.\n   */\n  function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val) || typeof val === 'string') {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      if (hasSymbol && val[Symbol.iterator]) {\n        ret = [];\n        var iterator = val[Symbol.iterator]();\n        var result = iterator.next();\n        while (!result.done) {\n          ret.push(render(result.value, ret.length));\n          result = iterator.next();\n        }\n      } else {\n        keys = Object.keys(val);\n        ret = new Array(keys.length);\n        for (i = 0, l = keys.length; i < l; i++) {\n          key = keys[i];\n          ret[i] = render(val[key], key, i);\n        }\n      }\n    }\n    if (!isDef(ret)) {\n      ret = [];\n    }\n    (ret)._isVList = true;\n    return ret\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering <slot>\n   */\n  function renderSlot (\n    name,\n    fallback,\n    props,\n    bindObject\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    var nodes;\n    if (scopedSlotFn) { // scoped slot\n      props = props || {};\n      if (bindObject) {\n        if (!isObject(bindObject)) {\n          warn(\n            'slot v-bind without argument expects an Object',\n            this\n          );\n        }\n        props = extend(extend({}, bindObject), props);\n      }\n      nodes = scopedSlotFn(props) || fallback;\n    } else {\n      nodes = this.$slots[name] || fallback;\n    }\n\n    var target = props && props.slot;\n    if (target) {\n      return this.$createElement('template', { slot: target }, nodes)\n    } else {\n      return nodes\n    }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for resolving filters\n   */\n  function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  }\n\n  /*  */\n\n  function isKeyNotMatch (expect, actual) {\n    if (Array.isArray(expect)) {\n      return expect.indexOf(actual) === -1\n    } else {\n      return expect !== actual\n    }\n  }\n\n  /**\n   * Runtime helper for checking keyCodes from config.\n   * exposed as Vue.prototype._k\n   * passing in eventKeyName as last argument separately for backwards compat\n   */\n  function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInKeyCode,\n    eventKeyName,\n    builtInKeyName\n  ) {\n    var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;\n    if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {\n      return isKeyNotMatch(builtInKeyName, eventKeyName)\n    } else if (mappedKeyCode) {\n      return isKeyNotMatch(mappedKeyCode, eventKeyCode)\n    } else if (eventKeyName) {\n      return hyphenate(eventKeyName) !== key\n    }\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for merging v-bind=\"object\" into a VNode's data.\n   */\n  function bindObjectProps (\n    data,\n    tag,\n    value,\n    asProp,\n    isSync\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        var hash;\n        var loop = function ( key ) {\n          if (\n            key === 'class' ||\n            key === 'style' ||\n            isReservedAttribute(key)\n          ) {\n            hash = data;\n          } else {\n            var type = data.attrs && data.attrs.type;\n            hash = asProp || config.mustUseProp(tag, type, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n          }\n          var camelizedKey = camelize(key);\n          if (!(key in hash) && !(camelizedKey in hash)) {\n            hash[key] = value[key];\n\n            if (isSync) {\n              var on = data.on || (data.on = {});\n              on[(\"update:\" + camelizedKey)] = function ($event) {\n                value[key] = $event;\n              };\n            }\n          }\n        };\n\n        for (var key in value) loop( key );\n      }\n    }\n    return data\n  }\n\n  /*  */\n\n  /**\n   * Runtime helper for rendering static trees.\n   */\n  function renderStatic (\n    index,\n    isInFor\n  ) {\n    var cached = this._staticTrees || (this._staticTrees = []);\n    var tree = cached[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree.\n    if (tree && !isInFor) {\n      return tree\n    }\n    // otherwise, render a fresh tree.\n    tree = cached[index] = this.$options.staticRenderFns[index].call(\n      this._renderProxy,\n      null,\n      this // for render fns generated for functional component templates\n    );\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  }\n\n  /**\n   * Runtime helper for v-once.\n   * Effectively it means marking the node as static with a unique key.\n   */\n  function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  }\n\n  function markStatic (\n    tree,\n    key,\n    isOnce\n  ) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  /*  */\n\n  function bindObjectListeners (data, value) {\n    if (value) {\n      if (!isPlainObject(value)) {\n        warn(\n          'v-on without argument expects an Object value',\n          this\n        );\n      } else {\n        var on = data.on = data.on ? extend({}, data.on) : {};\n        for (var key in value) {\n          var existing = on[key];\n          var ours = value[key];\n          on[key] = existing ? [].concat(existing, ours) : ours;\n        }\n      }\n    }\n    return data\n  }\n\n  /*  */\n\n  function resolveScopedSlots (\n    fns, // see flow/vnode\n    res,\n    // the following are added in 2.6\n    hasDynamicKeys,\n    contentHashKey\n  ) {\n    res = res || { $stable: !hasDynamicKeys };\n    for (var i = 0; i < fns.length; i++) {\n      var slot = fns[i];\n      if (Array.isArray(slot)) {\n        resolveScopedSlots(slot, res, hasDynamicKeys);\n      } else if (slot) {\n        // marker for reverse proxying v-slot without scope on this.$slots\n        if (slot.proxy) {\n          slot.fn.proxy = true;\n        }\n        res[slot.key] = slot.fn;\n      }\n    }\n    if (contentHashKey) {\n      (res).$key = contentHashKey;\n    }\n    return res\n  }\n\n  /*  */\n\n  function bindDynamicKeys (baseObj, values) {\n    for (var i = 0; i < values.length; i += 2) {\n      var key = values[i];\n      if (typeof key === 'string' && key) {\n        baseObj[values[i]] = values[i + 1];\n      } else if (key !== '' && key !== null) {\n        // null is a speical value for explicitly removing a binding\n        warn(\n          (\"Invalid value for dynamic directive argument (expected string or null): \" + key),\n          this\n        );\n      }\n    }\n    return baseObj\n  }\n\n  // helper to dynamically append modifier runtime markers to event names.\n  // ensure only append when value is already string, otherwise it will be cast\n  // to string and cause the type check to miss.\n  function prependModifier (value, symbol) {\n    return typeof value === 'string' ? symbol + value : value\n  }\n\n  /*  */\n\n  function installRenderHelpers (target) {\n    target._o = markOnce;\n    target._n = toNumber;\n    target._s = toString;\n    target._l = renderList;\n    target._t = renderSlot;\n    target._q = looseEqual;\n    target._i = looseIndexOf;\n    target._m = renderStatic;\n    target._f = resolveFilter;\n    target._k = checkKeyCodes;\n    target._b = bindObjectProps;\n    target._v = createTextVNode;\n    target._e = createEmptyVNode;\n    target._u = resolveScopedSlots;\n    target._g = bindObjectListeners;\n    target._d = bindDynamicKeys;\n    target._p = prependModifier;\n  }\n\n  /*  */\n\n  function FunctionalRenderContext (\n    data,\n    props,\n    children,\n    parent,\n    Ctor\n  ) {\n    var this$1 = this;\n\n    var options = Ctor.options;\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    var contextVm;\n    if (hasOwn(parent, '_uid')) {\n      contextVm = Object.create(parent);\n      // $flow-disable-line\n      contextVm._original = parent;\n    } else {\n      // the context vm passed in is a functional context as well.\n      // in this case we want to make sure we are able to get a hold to the\n      // real context instance.\n      contextVm = parent;\n      // $flow-disable-line\n      parent = parent._original;\n    }\n    var isCompiled = isTrue(options._compiled);\n    var needNormalization = !isCompiled;\n\n    this.data = data;\n    this.props = props;\n    this.children = children;\n    this.parent = parent;\n    this.listeners = data.on || emptyObject;\n    this.injections = resolveInject(options.inject, parent);\n    this.slots = function () {\n      if (!this$1.$slots) {\n        normalizeScopedSlots(\n          data.scopedSlots,\n          this$1.$slots = resolveSlots(children, parent)\n        );\n      }\n      return this$1.$slots\n    };\n\n    Object.defineProperty(this, 'scopedSlots', ({\n      enumerable: true,\n      get: function get () {\n        return normalizeScopedSlots(data.scopedSlots, this.slots())\n      }\n    }));\n\n    // support for compiled functional template\n    if (isCompiled) {\n      // exposing $options for renderStatic()\n      this.$options = options;\n      // pre-resolve slots for renderSlot()\n      this.$slots = this.slots();\n      this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);\n    }\n\n    if (options._scopeId) {\n      this._c = function (a, b, c, d) {\n        var vnode = createElement(contextVm, a, b, c, d, needNormalization);\n        if (vnode && !Array.isArray(vnode)) {\n          vnode.fnScopeId = options._scopeId;\n          vnode.fnContext = parent;\n        }\n        return vnode\n      };\n    } else {\n      this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };\n    }\n  }\n\n  installRenderHelpers(FunctionalRenderContext.prototype);\n\n  function createFunctionalComponent (\n    Ctor,\n    propsData,\n    data,\n    contextVm,\n    children\n  ) {\n    var options = Ctor.options;\n    var props = {};\n    var propOptions = options.props;\n    if (isDef(propOptions)) {\n      for (var key in propOptions) {\n        props[key] = validateProp(key, propOptions, propsData || emptyObject);\n      }\n    } else {\n      if (isDef(data.attrs)) { mergeProps(props, data.attrs); }\n      if (isDef(data.props)) { mergeProps(props, data.props); }\n    }\n\n    var renderContext = new FunctionalRenderContext(\n      data,\n      props,\n      children,\n      contextVm,\n      Ctor\n    );\n\n    var vnode = options.render.call(null, renderContext._c, renderContext);\n\n    if (vnode instanceof VNode) {\n      return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)\n    } else if (Array.isArray(vnode)) {\n      var vnodes = normalizeChildren(vnode) || [];\n      var res = new Array(vnodes.length);\n      for (var i = 0; i < vnodes.length; i++) {\n        res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);\n      }\n      return res\n    }\n  }\n\n  function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {\n    // #7817 clone node before setting fnContext, otherwise if the node is reused\n    // (e.g. it was from a cached normal slot) the fnContext causes named slots\n    // that should not be matched to match.\n    var clone = cloneVNode(vnode);\n    clone.fnContext = contextVm;\n    clone.fnOptions = options;\n    {\n      (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;\n    }\n    if (data.slot) {\n      (clone.data || (clone.data = {})).slot = data.slot;\n    }\n    return clone\n  }\n\n  function mergeProps (to, from) {\n    for (var key in from) {\n      to[camelize(key)] = from[key];\n    }\n  }\n\n  /*  */\n\n  /*  */\n\n  /*  */\n\n  /*  */\n\n  // inline hooks to be invoked on component VNodes during patch\n  var componentVNodeHooks = {\n    init: function init (vnode, hydrating) {\n      if (\n        vnode.componentInstance &&\n        !vnode.componentInstance._isDestroyed &&\n        vnode.data.keepAlive\n      ) {\n        // kept-alive components, treat as a patch\n        var mountedNode = vnode; // work around flow\n        componentVNodeHooks.prepatch(mountedNode, mountedNode);\n      } else {\n        var child = vnode.componentInstance = createComponentInstanceForVnode(\n          vnode,\n          activeInstance\n        );\n        child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n      }\n    },\n\n    prepatch: function prepatch (oldVnode, vnode) {\n      var options = vnode.componentOptions;\n      var child = vnode.componentInstance = oldVnode.componentInstance;\n      updateChildComponent(\n        child,\n        options.propsData, // updated props\n        options.listeners, // updated listeners\n        vnode, // new parent vnode\n        options.children // new children\n      );\n    },\n\n    insert: function insert (vnode) {\n      var context = vnode.context;\n      var componentInstance = vnode.componentInstance;\n      if (!componentInstance._isMounted) {\n        componentInstance._isMounted = true;\n        callHook(componentInstance, 'mounted');\n      }\n      if (vnode.data.keepAlive) {\n        if (context._isMounted) {\n          // vue-router#1212\n          // During updates, a kept-alive component's child components may\n          // change, so directly walking the tree here may call activated hooks\n          // on incorrect children. Instead we push them into a queue which will\n          // be processed after the whole patch process ended.\n          queueActivatedComponent(componentInstance);\n        } else {\n          activateChildComponent(componentInstance, true /* direct */);\n        }\n      }\n    },\n\n    destroy: function destroy (vnode) {\n      var componentInstance = vnode.componentInstance;\n      if (!componentInstance._isDestroyed) {\n        if (!vnode.data.keepAlive) {\n          componentInstance.$destroy();\n        } else {\n          deactivateChildComponent(componentInstance, true /* direct */);\n        }\n      }\n    }\n  };\n\n  var hooksToMerge = Object.keys(componentVNodeHooks);\n\n  function createComponent (\n    Ctor,\n    data,\n    context,\n    children,\n    tag\n  ) {\n    if (isUndef(Ctor)) {\n      return\n    }\n\n    var baseCtor = context.$options._base;\n\n    // plain options object: turn it into a constructor\n    if (isObject(Ctor)) {\n      Ctor = baseCtor.extend(Ctor);\n    }\n\n    // if at this stage it's not a constructor or an async component factory,\n    // reject.\n    if (typeof Ctor !== 'function') {\n      {\n        warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n      }\n      return\n    }\n\n    // async component\n    var asyncFactory;\n    if (isUndef(Ctor.cid)) {\n      asyncFactory = Ctor;\n      Ctor = resolveAsyncComponent(asyncFactory, baseCtor);\n      if (Ctor === undefined) {\n        // return a placeholder node for async component, which is rendered\n        // as a comment node but preserves all the raw information for the node.\n        // the information will be used for async server-rendering and hydration.\n        return createAsyncPlaceholder(\n          asyncFactory,\n          data,\n          context,\n          children,\n          tag\n        )\n      }\n    }\n\n    data = data || {};\n\n    // resolve constructor options in case global mixins are applied after\n    // component constructor creation\n    resolveConstructorOptions(Ctor);\n\n    // transform component v-model data into props & events\n    if (isDef(data.model)) {\n      transformModel(Ctor.options, data);\n    }\n\n    // extract props\n    var propsData = extractPropsFromVNodeData(data, Ctor, tag);\n\n    // functional component\n    if (isTrue(Ctor.options.functional)) {\n      return createFunctionalComponent(Ctor, propsData, data, context, children)\n    }\n\n    // extract listeners, since these needs to be treated as\n    // child component listeners instead of DOM listeners\n    var listeners = data.on;\n    // replace with listeners with .native modifier\n    // so it gets processed during parent component patch.\n    data.on = data.nativeOn;\n\n    if (isTrue(Ctor.options.abstract)) {\n      // abstract components do not keep anything\n      // other than props & listeners & slot\n\n      // work around flow\n      var slot = data.slot;\n      data = {};\n      if (slot) {\n        data.slot = slot;\n      }\n    }\n\n    // install component management hooks onto the placeholder node\n    installComponentHooks(data);\n\n    // return a placeholder vnode\n    var name = Ctor.options.name || tag;\n    var vnode = new VNode(\n      (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n      data, undefined, undefined, undefined, context,\n      { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },\n      asyncFactory\n    );\n\n    return vnode\n  }\n\n  function createComponentInstanceForVnode (\n    vnode, // we know it's MountedComponentVNode but flow doesn't\n    parent // activeInstance in lifecycle state\n  ) {\n    var options = {\n      _isComponent: true,\n      _parentVnode: vnode,\n      parent: parent\n    };\n    // check inline-template render functions\n    var inlineTemplate = vnode.data.inlineTemplate;\n    if (isDef(inlineTemplate)) {\n      options.render = inlineTemplate.render;\n      options.staticRenderFns = inlineTemplate.staticRenderFns;\n    }\n    return new vnode.componentOptions.Ctor(options)\n  }\n\n  function installComponentHooks (data) {\n    var hooks = data.hook || (data.hook = {});\n    for (var i = 0; i < hooksToMerge.length; i++) {\n      var key = hooksToMerge[i];\n      var existing = hooks[key];\n      var toMerge = componentVNodeHooks[key];\n      if (existing !== toMerge && !(existing && existing._merged)) {\n        hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;\n      }\n    }\n  }\n\n  function mergeHook$1 (f1, f2) {\n    var merged = function (a, b) {\n      // flow complains about extra args which is why we use any\n      f1(a, b);\n      f2(a, b);\n    };\n    merged._merged = true;\n    return merged\n  }\n\n  // transform component v-model info (value and callback) into\n  // prop and event handler respectively.\n  function transformModel (options, data) {\n    var prop = (options.model && options.model.prop) || 'value';\n    var event = (options.model && options.model.event) || 'input'\n    ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;\n    var on = data.on || (data.on = {});\n    var existing = on[event];\n    var callback = data.model.callback;\n    if (isDef(existing)) {\n      if (\n        Array.isArray(existing)\n          ? existing.indexOf(callback) === -1\n          : existing !== callback\n      ) {\n        on[event] = [callback].concat(existing);\n      }\n    } else {\n      on[event] = callback;\n    }\n  }\n\n  /*  */\n\n  var SIMPLE_NORMALIZE = 1;\n  var ALWAYS_NORMALIZE = 2;\n\n  // wrapper function for providing a more flexible interface\n  // without getting yelled at by flow\n  function createElement (\n    context,\n    tag,\n    data,\n    children,\n    normalizationType,\n    alwaysNormalize\n  ) {\n    if (Array.isArray(data) || isPrimitive(data)) {\n      normalizationType = children;\n      children = data;\n      data = undefined;\n    }\n    if (isTrue(alwaysNormalize)) {\n      normalizationType = ALWAYS_NORMALIZE;\n    }\n    return _createElement(context, tag, data, children, normalizationType)\n  }\n\n  function _createElement (\n    context,\n    tag,\n    data,\n    children,\n    normalizationType\n  ) {\n    if (isDef(data) && isDef((data).__ob__)) {\n      warn(\n        \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n        'Always create fresh vnode data objects in each render!',\n        context\n      );\n      return createEmptyVNode()\n    }\n    // object syntax in v-bind\n    if (isDef(data) && isDef(data.is)) {\n      tag = data.is;\n    }\n    if (!tag) {\n      // in case of component :is set to falsy value\n      return createEmptyVNode()\n    }\n    // warn against non-primitive key\n    if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)\n    ) {\n      {\n        warn(\n          'Avoid using non-primitive value as key, ' +\n          'use string/number value instead.',\n          context\n        );\n      }\n    }\n    // support single function children as default scoped slot\n    if (Array.isArray(children) &&\n      typeof children[0] === 'function'\n    ) {\n      data = data || {};\n      data.scopedSlots = { default: children[0] };\n      children.length = 0;\n    }\n    if (normalizationType === ALWAYS_NORMALIZE) {\n      children = normalizeChildren(children);\n    } else if (normalizationType === SIMPLE_NORMALIZE) {\n      children = simpleNormalizeChildren(children);\n    }\n    var vnode, ns;\n    if (typeof tag === 'string') {\n      var Ctor;\n      ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);\n      if (config.isReservedTag(tag)) {\n        // platform built-in elements\n        vnode = new VNode(\n          config.parsePlatformTagName(tag), data, children,\n          undefined, undefined, context\n        );\n      } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {\n        // component\n        vnode = createComponent(Ctor, data, context, children, tag);\n      } else {\n        // unknown or unlisted namespaced elements\n        // check at runtime because it may get assigned a namespace when its\n        // parent normalizes children\n        vnode = new VNode(\n          tag, data, children,\n          undefined, undefined, context\n        );\n      }\n    } else {\n      // direct component options / constructor\n      vnode = createComponent(tag, data, context, children);\n    }\n    if (Array.isArray(vnode)) {\n      return vnode\n    } else if (isDef(vnode)) {\n      if (isDef(ns)) { applyNS(vnode, ns); }\n      if (isDef(data)) { registerDeepBindings(data); }\n      return vnode\n    } else {\n      return createEmptyVNode()\n    }\n  }\n\n  function applyNS (vnode, ns, force) {\n    vnode.ns = ns;\n    if (vnode.tag === 'foreignObject') {\n      // use default namespace inside foreignObject\n      ns = undefined;\n      force = true;\n    }\n    if (isDef(vnode.children)) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        var child = vnode.children[i];\n        if (isDef(child.tag) && (\n          isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {\n          applyNS(child, ns, force);\n        }\n      }\n    }\n  }\n\n  // ref #5318\n  // necessary to ensure parent re-render when deep bindings like :style and\n  // :class are used on slot nodes\n  function registerDeepBindings (data) {\n    if (isObject(data.style)) {\n      traverse(data.style);\n    }\n    if (isObject(data.class)) {\n      traverse(data.class);\n    }\n  }\n\n  /*  */\n\n  function initRender (vm) {\n    vm._vnode = null; // the root of the child tree\n    vm._staticTrees = null; // v-once cached trees\n    var options = vm.$options;\n    var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree\n    var renderContext = parentVnode && parentVnode.context;\n    vm.$slots = resolveSlots(options._renderChildren, renderContext);\n    vm.$scopedSlots = emptyObject;\n    // bind the createElement fn to this instance\n    // so that we get proper render context inside it.\n    // args order: tag, data, children, normalizationType, alwaysNormalize\n    // internal version is used by render functions compiled from templates\n    vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };\n    // normalization is always applied for the public version, used in\n    // user-written render functions.\n    vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };\n\n    // $attrs & $listeners are exposed for easier HOC creation.\n    // they need to be reactive so that HOCs using them are always updated\n    var parentData = parentVnode && parentVnode.data;\n\n    /* istanbul ignore else */\n    {\n      defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {\n        !isUpdatingChildComponent && warn(\"$attrs is readonly.\", vm);\n      }, true);\n      defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {\n        !isUpdatingChildComponent && warn(\"$listeners is readonly.\", vm);\n      }, true);\n    }\n  }\n\n  var currentRenderingInstance = null;\n\n  function renderMixin (Vue) {\n    // install runtime convenience helpers\n    installRenderHelpers(Vue.prototype);\n\n    Vue.prototype.$nextTick = function (fn) {\n      return nextTick(fn, this)\n    };\n\n    Vue.prototype._render = function () {\n      var vm = this;\n      var ref = vm.$options;\n      var render = ref.render;\n      var _parentVnode = ref._parentVnode;\n\n      if (_parentVnode) {\n        vm.$scopedSlots = normalizeScopedSlots(\n          _parentVnode.data.scopedSlots,\n          vm.$slots,\n          vm.$scopedSlots\n        );\n      }\n\n      // set parent vnode. this allows render functions to have access\n      // to the data on the placeholder node.\n      vm.$vnode = _parentVnode;\n      // render self\n      var vnode;\n      try {\n        // There's no need to maintain a stack becaues all render fns are called\n        // separately from one another. Nested component's render fns are called\n        // when parent component is patched.\n        currentRenderingInstance = vm;\n        vnode = render.call(vm._renderProxy, vm.$createElement);\n      } catch (e) {\n        handleError(e, vm, \"render\");\n        // return error render result,\n        // or previous vnode to prevent render error causing blank component\n        /* istanbul ignore else */\n        if (vm.$options.renderError) {\n          try {\n            vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);\n          } catch (e) {\n            handleError(e, vm, \"renderError\");\n            vnode = vm._vnode;\n          }\n        } else {\n          vnode = vm._vnode;\n        }\n      } finally {\n        currentRenderingInstance = null;\n      }\n      // if the returned array contains only a single node, allow it\n      if (Array.isArray(vnode) && vnode.length === 1) {\n        vnode = vnode[0];\n      }\n      // return empty vnode in case the render function errored out\n      if (!(vnode instanceof VNode)) {\n        if (Array.isArray(vnode)) {\n          warn(\n            'Multiple root nodes returned from render function. Render function ' +\n            'should return a single root node.',\n            vm\n          );\n        }\n        vnode = createEmptyVNode();\n      }\n      // set parent\n      vnode.parent = _parentVnode;\n      return vnode\n    };\n  }\n\n  /*  */\n\n  function ensureCtor (comp, base) {\n    if (\n      comp.__esModule ||\n      (hasSymbol && comp[Symbol.toStringTag] === 'Module')\n    ) {\n      comp = comp.default;\n    }\n    return isObject(comp)\n      ? base.extend(comp)\n      : comp\n  }\n\n  function createAsyncPlaceholder (\n    factory,\n    data,\n    context,\n    children,\n    tag\n  ) {\n    var node = createEmptyVNode();\n    node.asyncFactory = factory;\n    node.asyncMeta = { data: data, context: context, children: children, tag: tag };\n    return node\n  }\n\n  function resolveAsyncComponent (\n    factory,\n    baseCtor\n  ) {\n    if (isTrue(factory.error) && isDef(factory.errorComp)) {\n      return factory.errorComp\n    }\n\n    if (isDef(factory.resolved)) {\n      return factory.resolved\n    }\n\n    if (isTrue(factory.loading) && isDef(factory.loadingComp)) {\n      return factory.loadingComp\n    }\n\n    var owner = currentRenderingInstance;\n    if (isDef(factory.owners)) {\n      // already pending\n      factory.owners.push(owner);\n    } else {\n      var owners = factory.owners = [owner];\n      var sync = true;\n\n      var forceRender = function (renderCompleted) {\n        for (var i = 0, l = owners.length; i < l; i++) {\n          (owners[i]).$forceUpdate();\n        }\n\n        if (renderCompleted) {\n          owners.length = 0;\n        }\n      };\n\n      var resolve = once(function (res) {\n        // cache resolved\n        factory.resolved = ensureCtor(res, baseCtor);\n        // invoke callbacks only if this is not a synchronous resolve\n        // (async resolves are shimmed as synchronous during SSR)\n        if (!sync) {\n          forceRender(true);\n        } else {\n          owners.length = 0;\n        }\n      });\n\n      var reject = once(function (reason) {\n        warn(\n          \"Failed to resolve async component: \" + (String(factory)) +\n          (reason ? (\"\\nReason: \" + reason) : '')\n        );\n        if (isDef(factory.errorComp)) {\n          factory.error = true;\n          forceRender(true);\n        }\n      });\n\n      var res = factory(resolve, reject);\n\n      if (isObject(res)) {\n        if (isPromise(res)) {\n          // () => Promise\n          if (isUndef(factory.resolved)) {\n            res.then(resolve, reject);\n          }\n        } else if (isPromise(res.component)) {\n          res.component.then(resolve, reject);\n\n          if (isDef(res.error)) {\n            factory.errorComp = ensureCtor(res.error, baseCtor);\n          }\n\n          if (isDef(res.loading)) {\n            factory.loadingComp = ensureCtor(res.loading, baseCtor);\n            if (res.delay === 0) {\n              factory.loading = true;\n            } else {\n              setTimeout(function () {\n                if (isUndef(factory.resolved) && isUndef(factory.error)) {\n                  factory.loading = true;\n                  forceRender(false);\n                }\n              }, res.delay || 200);\n            }\n          }\n\n          if (isDef(res.timeout)) {\n            setTimeout(function () {\n              if (isUndef(factory.resolved)) {\n                reject(\n                  \"timeout (\" + (res.timeout) + \"ms)\"\n                );\n              }\n            }, res.timeout);\n          }\n        }\n      }\n\n      sync = false;\n      // return in case resolved synchronously\n      return factory.loading\n        ? factory.loadingComp\n        : factory.resolved\n    }\n  }\n\n  /*  */\n\n  function isAsyncPlaceholder (node) {\n    return node.isComment && node.asyncFactory\n  }\n\n  /*  */\n\n  function getFirstComponentChild (children) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; i++) {\n        var c = children[i];\n        if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {\n          return c\n        }\n      }\n    }\n  }\n\n  /*  */\n\n  /*  */\n\n  function initEvents (vm) {\n    vm._events = Object.create(null);\n    vm._hasHookEvent = false;\n    // init parent attached events\n    var listeners = vm.$options._parentListeners;\n    if (listeners) {\n      updateComponentListeners(vm, listeners);\n    }\n  }\n\n  var target;\n\n  function add (event, fn) {\n    target.$on(event, fn);\n  }\n\n  function remove$1 (event, fn) {\n    target.$off(event, fn);\n  }\n\n  function createOnceHandler (event, fn) {\n    var _target = target;\n    return function onceHandler () {\n      var res = fn.apply(null, arguments);\n      if (res !== null) {\n        _target.$off(event, onceHandler);\n      }\n    }\n  }\n\n  function updateComponentListeners (\n    vm,\n    listeners,\n    oldListeners\n  ) {\n    target = vm;\n    updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);\n    target = undefined;\n  }\n\n  function eventsMixin (Vue) {\n    var hookRE = /^hook:/;\n    Vue.prototype.$on = function (event, fn) {\n      var vm = this;\n      if (Array.isArray(event)) {\n        for (var i = 0, l = event.length; i < l; i++) {\n          vm.$on(event[i], fn);\n        }\n      } else {\n        (vm._events[event] || (vm._events[event] = [])).push(fn);\n        // optimize hook:event cost by using a boolean flag marked at registration\n        // instead of a hash lookup\n        if (hookRE.test(event)) {\n          vm._hasHookEvent = true;\n        }\n      }\n      return vm\n    };\n\n    Vue.prototype.$once = function (event, fn) {\n      var vm = this;\n      function on () {\n        vm.$off(event, on);\n        fn.apply(vm, arguments);\n      }\n      on.fn = fn;\n      vm.$on(event, on);\n      return vm\n    };\n\n    Vue.prototype.$off = function (event, fn) {\n      var vm = this;\n      // all\n      if (!arguments.length) {\n        vm._events = Object.create(null);\n        return vm\n      }\n      // array of events\n      if (Array.isArray(event)) {\n        for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {\n          vm.$off(event[i$1], fn);\n        }\n        return vm\n      }\n      // specific event\n      var cbs = vm._events[event];\n      if (!cbs) {\n        return vm\n      }\n      if (!fn) {\n        vm._events[event] = null;\n        return vm\n      }\n      // specific handler\n      var cb;\n      var i = cbs.length;\n      while (i--) {\n        cb = cbs[i];\n        if (cb === fn || cb.fn === fn) {\n          cbs.splice(i, 1);\n          break\n        }\n      }\n      return vm\n    };\n\n    Vue.prototype.$emit = function (event) {\n      var vm = this;\n      {\n        var lowerCaseEvent = event.toLowerCase();\n        if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {\n          tip(\n            \"Event \\\"\" + lowerCaseEvent + \"\\\" is emitted in component \" +\n            (formatComponentName(vm)) + \" but the handler is registered for \\\"\" + event + \"\\\". \" +\n            \"Note that HTML attributes are case-insensitive and you cannot use \" +\n            \"v-on to listen to camelCase events when using in-DOM templates. \" +\n            \"You should probably use \\\"\" + (hyphenate(event)) + \"\\\" instead of \\\"\" + event + \"\\\".\"\n          );\n        }\n      }\n      var cbs = vm._events[event];\n      if (cbs) {\n        cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n        var args = toArray(arguments, 1);\n        var info = \"event handler for \\\"\" + event + \"\\\"\";\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          invokeWithErrorHandling(cbs[i], vm, args, vm, info);\n        }\n      }\n      return vm\n    };\n  }\n\n  /*  */\n\n  var activeInstance = null;\n  var isUpdatingChildComponent = false;\n\n  function setActiveInstance(vm) {\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    return function () {\n      activeInstance = prevActiveInstance;\n    }\n  }\n\n  function initLifecycle (vm) {\n    var options = vm.$options;\n\n    // locate first non-abstract parent\n    var parent = options.parent;\n    if (parent && !options.abstract) {\n      while (parent.$options.abstract && parent.$parent) {\n        parent = parent.$parent;\n      }\n      parent.$children.push(vm);\n    }\n\n    vm.$parent = parent;\n    vm.$root = parent ? parent.$root : vm;\n\n    vm.$children = [];\n    vm.$refs = {};\n\n    vm._watcher = null;\n    vm._inactive = null;\n    vm._directInactive = false;\n    vm._isMounted = false;\n    vm._isDestroyed = false;\n    vm._isBeingDestroyed = false;\n  }\n\n  function lifecycleMixin (Vue) {\n    Vue.prototype._update = function (vnode, hydrating) {\n      var vm = this;\n      var prevEl = vm.$el;\n      var prevVnode = vm._vnode;\n      var restoreActiveInstance = setActiveInstance(vm);\n      vm._vnode = vnode;\n      // Vue.prototype.__patch__ is injected in entry points\n      // based on the rendering backend used.\n      if (!prevVnode) {\n        // initial render\n        vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);\n      } else {\n        // updates\n        vm.$el = vm.__patch__(prevVnode, vnode);\n      }\n      restoreActiveInstance();\n      // update __vue__ reference\n      if (prevEl) {\n        prevEl.__vue__ = null;\n      }\n      if (vm.$el) {\n        vm.$el.__vue__ = vm;\n      }\n      // if parent is an HOC, update its $el as well\n      if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n        vm.$parent.$el = vm.$el;\n      }\n      // updated hook is called by the scheduler to ensure that children are\n      // updated in a parent's updated hook.\n    };\n\n    Vue.prototype.$forceUpdate = function () {\n      var vm = this;\n      if (vm._watcher) {\n        vm._watcher.update();\n      }\n    };\n\n    Vue.prototype.$destroy = function () {\n      var vm = this;\n      if (vm._isBeingDestroyed) {\n        return\n      }\n      callHook(vm, 'beforeDestroy');\n      vm._isBeingDestroyed = true;\n      // remove self from parent\n      var parent = vm.$parent;\n      if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n        remove(parent.$children, vm);\n      }\n      // teardown watchers\n      if (vm._watcher) {\n        vm._watcher.teardown();\n      }\n      var i = vm._watchers.length;\n      while (i--) {\n        vm._watchers[i].teardown();\n      }\n      // remove reference from data ob\n      // frozen object may not have observer.\n      if (vm._data.__ob__) {\n        vm._data.__ob__.vmCount--;\n      }\n      // call the last hook...\n      vm._isDestroyed = true;\n      // invoke destroy hooks on current rendered tree\n      vm.__patch__(vm._vnode, null);\n      // fire destroyed hook\n      callHook(vm, 'destroyed');\n      // turn off all instance listeners.\n      vm.$off();\n      // remove __vue__ reference\n      if (vm.$el) {\n        vm.$el.__vue__ = null;\n      }\n      // release circular reference (#6759)\n      if (vm.$vnode) {\n        vm.$vnode.parent = null;\n      }\n    };\n  }\n\n  function mountComponent (\n    vm,\n    el,\n    hydrating\n  ) {\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = createEmptyVNode;\n      {\n        /* istanbul ignore if */\n        if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\n          vm.$options.el || el) {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'compiler is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n\n    var updateComponent;\n    /* istanbul ignore if */\n    if (config.performance && mark) {\n      updateComponent = function () {\n        var name = vm._name;\n        var id = vm._uid;\n        var startTag = \"vue-perf-start:\" + id;\n        var endTag = \"vue-perf-end:\" + id;\n\n        mark(startTag);\n        var vnode = vm._render();\n        mark(endTag);\n        measure((\"vue \" + name + \" render\"), startTag, endTag);\n\n        mark(startTag);\n        vm._update(vnode, hydrating);\n        mark(endTag);\n        measure((\"vue \" + name + \" patch\"), startTag, endTag);\n      };\n    } else {\n      updateComponent = function () {\n        vm._update(vm._render(), hydrating);\n      };\n    }\n\n    // we set this to vm._watcher inside the watcher's constructor\n    // since the watcher's initial patch may call $forceUpdate (e.g. inside child\n    // component's mounted hook), which relies on vm._watcher being already defined\n    new Watcher(vm, updateComponent, noop, {\n      before: function before () {\n        if (vm._isMounted && !vm._isDestroyed) {\n          callHook(vm, 'beforeUpdate');\n        }\n      }\n    }, true /* isRenderWatcher */);\n    hydrating = false;\n\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  }\n\n  function updateChildComponent (\n    vm,\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    {\n      isUpdatingChildComponent = true;\n    }\n\n    // determine whether component has slot children\n    // we need to do this before overwriting $options._renderChildren.\n\n    // check if there are dynamic scopedSlots (hand-written or compiled but with\n    // dynamic slot names). Static scoped slots compiled from template has the\n    // \"$stable\" marker.\n    var newScopedSlots = parentVnode.data.scopedSlots;\n    var oldScopedSlots = vm.$scopedSlots;\n    var hasDynamicScopedSlot = !!(\n      (newScopedSlots && !newScopedSlots.$stable) ||\n      (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||\n      (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)\n    );\n\n    // Any static slot children from the parent may have changed during parent's\n    // update. Dynamic scoped slots may also have changed. In such cases, a forced\n    // update is necessary to ensure correctness.\n    var needsForceUpdate = !!(\n      renderChildren ||               // has new static slots\n      vm.$options._renderChildren ||  // has old static slots\n      hasDynamicScopedSlot\n    );\n\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n\n    // update $attrs and $listeners hash\n    // these are also reactive so they may trigger child update if the child\n    // used them during render\n    vm.$attrs = parentVnode.data.attrs || emptyObject;\n    vm.$listeners = listeners || emptyObject;\n\n    // update props\n    if (propsData && vm.$options.props) {\n      toggleObserving(false);\n      var props = vm._props;\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        var propOptions = vm.$options.props; // wtf flow?\n        props[key] = validateProp(key, propOptions, propsData, vm);\n      }\n      toggleObserving(true);\n      // keep a copy of raw propsData\n      vm.$options.propsData = propsData;\n    }\n\n    // update listeners\n    listeners = listeners || emptyObject;\n    var oldListeners = vm.$options._parentListeners;\n    vm.$options._parentListeners = listeners;\n    updateComponentListeners(vm, listeners, oldListeners);\n\n    // resolve slots + force update if has children\n    if (needsForceUpdate) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n\n    {\n      isUpdatingChildComponent = false;\n    }\n  }\n\n  function isInInactiveTree (vm) {\n    while (vm && (vm = vm.$parent)) {\n      if (vm._inactive) { return true }\n    }\n    return false\n  }\n\n  function activateChildComponent (vm, direct) {\n    if (direct) {\n      vm._directInactive = false;\n      if (isInInactiveTree(vm)) {\n        return\n      }\n    } else if (vm._directInactive) {\n      return\n    }\n    if (vm._inactive || vm._inactive === null) {\n      vm._inactive = false;\n      for (var i = 0; i < vm.$children.length; i++) {\n        activateChildComponent(vm.$children[i]);\n      }\n      callHook(vm, 'activated');\n    }\n  }\n\n  function deactivateChildComponent (vm, direct) {\n    if (direct) {\n      vm._directInactive = true;\n      if (isInInactiveTree(vm)) {\n        return\n      }\n    }\n    if (!vm._inactive) {\n      vm._inactive = true;\n      for (var i = 0; i < vm.$children.length; i++) {\n        deactivateChildComponent(vm.$children[i]);\n      }\n      callHook(vm, 'deactivated');\n    }\n  }\n\n  function callHook (vm, hook) {\n    // #7573 disable dep collection when invoking lifecycle hooks\n    pushTarget();\n    var handlers = vm.$options[hook];\n    var info = hook + \" hook\";\n    if (handlers) {\n      for (var i = 0, j = handlers.length; i < j; i++) {\n        invokeWithErrorHandling(handlers[i], vm, null, vm, info);\n      }\n    }\n    if (vm._hasHookEvent) {\n      vm.$emit('hook:' + hook);\n    }\n    popTarget();\n  }\n\n  /*  */\n\n  var MAX_UPDATE_COUNT = 100;\n\n  var queue = [];\n  var activatedChildren = [];\n  var has = {};\n  var circular = {};\n  var waiting = false;\n  var flushing = false;\n  var index = 0;\n\n  /**\n   * Reset the scheduler's state.\n   */\n  function resetSchedulerState () {\n    index = queue.length = activatedChildren.length = 0;\n    has = {};\n    {\n      circular = {};\n    }\n    waiting = flushing = false;\n  }\n\n  // Async edge case #6566 requires saving the timestamp when event listeners are\n  // attached. However, calling performance.now() has a perf overhead especially\n  // if the page has thousands of event listeners. Instead, we take a timestamp\n  // every time the scheduler flushes and use that for all event listeners\n  // attached during that flush.\n  var currentFlushTimestamp = 0;\n\n  // Async edge case fix requires storing an event listener's attach timestamp.\n  var getNow = Date.now;\n\n  // Determine what event timestamp the browser is using. Annoyingly, the\n  // timestamp can either be hi-res (relative to page load) or low-res\n  // (relative to UNIX epoch), so in order to compare time we have to use the\n  // same timestamp type when saving the flush timestamp.\n  if (inBrowser && getNow() > document.createEvent('Event').timeStamp) {\n    // if the low-res timestamp which is bigger than the event timestamp\n    // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\n    // and we need to use the hi-res version for event listeners as well.\n    getNow = function () { return performance.now(); };\n  }\n\n  /**\n   * Flush both queues and run the watchers.\n   */\n  function flushSchedulerQueue () {\n    currentFlushTimestamp = getNow();\n    flushing = true;\n    var watcher, id;\n\n    // Sort queue before flush.\n    // This ensures that:\n    // 1. Components are updated from parent to child. (because parent is always\n    //    created before the child)\n    // 2. A component's user watchers are run before its render watcher (because\n    //    user watchers are created before the render watcher)\n    // 3. If a component is destroyed during a parent component's watcher run,\n    //    its watchers can be skipped.\n    queue.sort(function (a, b) { return a.id - b.id; });\n\n    // do not cache length because more watchers might be pushed\n    // as we run existing watchers\n    for (index = 0; index < queue.length; index++) {\n      watcher = queue[index];\n      if (watcher.before) {\n        watcher.before();\n      }\n      id = watcher.id;\n      has[id] = null;\n      watcher.run();\n      // in dev build, check and stop circular updates.\n      if (has[id] != null) {\n        circular[id] = (circular[id] || 0) + 1;\n        if (circular[id] > MAX_UPDATE_COUNT) {\n          warn(\n            'You may have an infinite update loop ' + (\n              watcher.user\n                ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n                : \"in a component render function.\"\n            ),\n            watcher.vm\n          );\n          break\n        }\n      }\n    }\n\n    // keep copies of post queues before resetting state\n    var activatedQueue = activatedChildren.slice();\n    var updatedQueue = queue.slice();\n\n    resetSchedulerState();\n\n    // call component updated and activated hooks\n    callActivatedHooks(activatedQueue);\n    callUpdatedHooks(updatedQueue);\n\n    // devtool hook\n    /* istanbul ignore if */\n    if (devtools && config.devtools) {\n      devtools.emit('flush');\n    }\n  }\n\n  function callUpdatedHooks (queue) {\n    var i = queue.length;\n    while (i--) {\n      var watcher = queue[i];\n      var vm = watcher.vm;\n      if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {\n        callHook(vm, 'updated');\n      }\n    }\n  }\n\n  /**\n   * Queue a kept-alive component that was activated during patch.\n   * The queue will be processed after the entire tree has been patched.\n   */\n  function queueActivatedComponent (vm) {\n    // setting _inactive to false here so that a render function can\n    // rely on checking whether it's in an inactive tree (e.g. router-view)\n    vm._inactive = false;\n    activatedChildren.push(vm);\n  }\n\n  function callActivatedHooks (queue) {\n    for (var i = 0; i < queue.length; i++) {\n      queue[i]._inactive = true;\n      activateChildComponent(queue[i], true /* true */);\n    }\n  }\n\n  /**\n   * Push a watcher into the watcher queue.\n   * Jobs with duplicate IDs will be skipped unless it's\n   * pushed when the queue is being flushed.\n   */\n  function queueWatcher (watcher) {\n    var id = watcher.id;\n    if (has[id] == null) {\n      has[id] = true;\n      if (!flushing) {\n        queue.push(watcher);\n      } else {\n        // if already flushing, splice the watcher based on its id\n        // if already past its id, it will be run next immediately.\n        var i = queue.length - 1;\n        while (i > index && queue[i].id > watcher.id) {\n          i--;\n        }\n        queue.splice(i + 1, 0, watcher);\n      }\n      // queue the flush\n      if (!waiting) {\n        waiting = true;\n\n        if (!config.async) {\n          flushSchedulerQueue();\n          return\n        }\n        nextTick(flushSchedulerQueue);\n      }\n    }\n  }\n\n  /*  */\n\n\n\n  var uid$2 = 0;\n\n  /**\n   * A watcher parses an expression, collects dependencies,\n   * and fires callback when the expression value changes.\n   * This is used for both the $watch() api and directives.\n   */\n  var Watcher = function Watcher (\n    vm,\n    expOrFn,\n    cb,\n    options,\n    isRenderWatcher\n  ) {\n    this.vm = vm;\n    if (isRenderWatcher) {\n      vm._watcher = this;\n    }\n    vm._watchers.push(this);\n    // options\n    if (options) {\n      this.deep = !!options.deep;\n      this.user = !!options.user;\n      this.lazy = !!options.lazy;\n      this.sync = !!options.sync;\n      this.before = options.before;\n    } else {\n      this.deep = this.user = this.lazy = this.sync = false;\n    }\n    this.cb = cb;\n    this.id = ++uid$2; // uid for batching\n    this.active = true;\n    this.dirty = this.lazy; // for lazy watchers\n    this.deps = [];\n    this.newDeps = [];\n    this.depIds = new _Set();\n    this.newDepIds = new _Set();\n    this.expression = expOrFn.toString();\n    // parse expression for getter\n    if (typeof expOrFn === 'function') {\n      this.getter = expOrFn;\n    } else {\n      this.getter = parsePath(expOrFn);\n      if (!this.getter) {\n        this.getter = noop;\n        warn(\n          \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n          'Watcher only accepts simple dot-delimited paths. ' +\n          'For full control, use a function instead.',\n          vm\n        );\n      }\n    }\n    this.value = this.lazy\n      ? undefined\n      : this.get();\n  };\n\n  /**\n   * Evaluate the getter, and re-collect dependencies.\n   */\n  Watcher.prototype.get = function get () {\n    pushTarget(this);\n    var value;\n    var vm = this.vm;\n    try {\n      value = this.getter.call(vm, vm);\n    } catch (e) {\n      if (this.user) {\n        handleError(e, vm, (\"getter for watcher \\\"\" + (this.expression) + \"\\\"\"));\n      } else {\n        throw e\n      }\n    } finally {\n      // \"touch\" every property so they are all tracked as\n      // dependencies for deep watching\n      if (this.deep) {\n        traverse(value);\n      }\n      popTarget();\n      this.cleanupDeps();\n    }\n    return value\n  };\n\n  /**\n   * Add a dependency to this directive.\n   */\n  Watcher.prototype.addDep = function addDep (dep) {\n    var id = dep.id;\n    if (!this.newDepIds.has(id)) {\n      this.newDepIds.add(id);\n      this.newDeps.push(dep);\n      if (!this.depIds.has(id)) {\n        dep.addSub(this);\n      }\n    }\n  };\n\n  /**\n   * Clean up for dependency collection.\n   */\n  Watcher.prototype.cleanupDeps = function cleanupDeps () {\n    var i = this.deps.length;\n    while (i--) {\n      var dep = this.deps[i];\n      if (!this.newDepIds.has(dep.id)) {\n        dep.removeSub(this);\n      }\n    }\n    var tmp = this.depIds;\n    this.depIds = this.newDepIds;\n    this.newDepIds = tmp;\n    this.newDepIds.clear();\n    tmp = this.deps;\n    this.deps = this.newDeps;\n    this.newDeps = tmp;\n    this.newDeps.length = 0;\n  };\n\n  /**\n   * Subscriber interface.\n   * Will be called when a dependency changes.\n   */\n  Watcher.prototype.update = function update () {\n    /* istanbul ignore else */\n    if (this.lazy) {\n      this.dirty = true;\n    } else if (this.sync) {\n      this.run();\n    } else {\n      queueWatcher(this);\n    }\n  };\n\n  /**\n   * Scheduler job interface.\n   * Will be called by the scheduler.\n   */\n  Watcher.prototype.run = function run () {\n    if (this.active) {\n      var value = this.get();\n      if (\n        value !== this.value ||\n        // Deep watchers and watchers on Object/Arrays should fire even\n        // when the value is the same, because the value may\n        // have mutated.\n        isObject(value) ||\n        this.deep\n      ) {\n        // set new value\n        var oldValue = this.value;\n        this.value = value;\n        if (this.user) {\n          try {\n            this.cb.call(this.vm, value, oldValue);\n          } catch (e) {\n            handleError(e, this.vm, (\"callback for watcher \\\"\" + (this.expression) + \"\\\"\"));\n          }\n        } else {\n          this.cb.call(this.vm, value, oldValue);\n        }\n      }\n    }\n  };\n\n  /**\n   * Evaluate the value of the watcher.\n   * This only gets called for lazy watchers.\n   */\n  Watcher.prototype.evaluate = function evaluate () {\n    this.value = this.get();\n    this.dirty = false;\n  };\n\n  /**\n   * Depend on all deps collected by this watcher.\n   */\n  Watcher.prototype.depend = function depend () {\n    var i = this.deps.length;\n    while (i--) {\n      this.deps[i].depend();\n    }\n  };\n\n  /**\n   * Remove self from all dependencies' subscriber list.\n   */\n  Watcher.prototype.teardown = function teardown () {\n    if (this.active) {\n      // remove self from vm's watcher list\n      // this is a somewhat expensive operation so we skip it\n      // if the vm is being destroyed.\n      if (!this.vm._isBeingDestroyed) {\n        remove(this.vm._watchers, this);\n      }\n      var i = this.deps.length;\n      while (i--) {\n        this.deps[i].removeSub(this);\n      }\n      this.active = false;\n    }\n  };\n\n  /*  */\n\n  var sharedPropertyDefinition = {\n    enumerable: true,\n    configurable: true,\n    get: noop,\n    set: noop\n  };\n\n  function proxy (target, sourceKey, key) {\n    sharedPropertyDefinition.get = function proxyGetter () {\n      return this[sourceKey][key]\n    };\n    sharedPropertyDefinition.set = function proxySetter (val) {\n      this[sourceKey][key] = val;\n    };\n    Object.defineProperty(target, key, sharedPropertyDefinition);\n  }\n\n  function initState (vm) {\n    vm._watchers = [];\n    var opts = vm.$options;\n    if (opts.props) { initProps(vm, opts.props); }\n    if (opts.methods) { initMethods(vm, opts.methods); }\n    if (opts.data) {\n      initData(vm);\n    } else {\n      observe(vm._data = {}, true /* asRootData */);\n    }\n    if (opts.computed) { initComputed(vm, opts.computed); }\n    if (opts.watch && opts.watch !== nativeWatch) {\n      initWatch(vm, opts.watch);\n    }\n  }\n\n  function initProps (vm, propsOptions) {\n    var propsData = vm.$options.propsData || {};\n    var props = vm._props = {};\n    // cache prop keys so that future props updates can iterate using Array\n    // instead of dynamic object key enumeration.\n    var keys = vm.$options._propKeys = [];\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    if (!isRoot) {\n      toggleObserving(false);\n    }\n    var loop = function ( key ) {\n      keys.push(key);\n      var value = validateProp(key, propsOptions, propsData, vm);\n      /* istanbul ignore else */\n      {\n        var hyphenatedKey = hyphenate(key);\n        if (isReservedAttribute(hyphenatedKey) ||\n            config.isReservedAttr(hyphenatedKey)) {\n          warn(\n            (\"\\\"\" + hyphenatedKey + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(props, key, value, function () {\n          if (!isRoot && !isUpdatingChildComponent) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n      // static props are already proxied on the component's prototype\n      // during Vue.extend(). We only need to proxy props defined at\n      // instantiation here.\n      if (!(key in vm)) {\n        proxy(vm, \"_props\", key);\n      }\n    };\n\n    for (var key in propsOptions) loop( key );\n    toggleObserving(true);\n  }\n\n  function initData (vm) {\n    var data = vm.$options.data;\n    data = vm._data = typeof data === 'function'\n      ? getData(data, vm)\n      : data || {};\n    if (!isPlainObject(data)) {\n      data = {};\n      warn(\n        'data functions should return an object:\\n' +\n        'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',\n        vm\n      );\n    }\n    // proxy data on instance\n    var keys = Object.keys(data);\n    var props = vm.$options.props;\n    var methods = vm.$options.methods;\n    var i = keys.length;\n    while (i--) {\n      var key = keys[i];\n      {\n        if (methods && hasOwn(methods, key)) {\n          warn(\n            (\"Method \\\"\" + key + \"\\\" has already been defined as a data property.\"),\n            vm\n          );\n        }\n      }\n      if (props && hasOwn(props, key)) {\n        warn(\n          \"The data property \\\"\" + key + \"\\\" is already declared as a prop. \" +\n          \"Use prop default value instead.\",\n          vm\n        );\n      } else if (!isReserved(key)) {\n        proxy(vm, \"_data\", key);\n      }\n    }\n    // observe data\n    observe(data, true /* asRootData */);\n  }\n\n  function getData (data, vm) {\n    // #7573 disable dep collection when invoking data getters\n    pushTarget();\n    try {\n      return data.call(vm, vm)\n    } catch (e) {\n      handleError(e, vm, \"data()\");\n      return {}\n    } finally {\n      popTarget();\n    }\n  }\n\n  var computedWatcherOptions = { lazy: true };\n\n  function initComputed (vm, computed) {\n    // $flow-disable-line\n    var watchers = vm._computedWatchers = Object.create(null);\n    // computed properties are just getters during SSR\n    var isSSR = isServerRendering();\n\n    for (var key in computed) {\n      var userDef = computed[key];\n      var getter = typeof userDef === 'function' ? userDef : userDef.get;\n      if (getter == null) {\n        warn(\n          (\"Getter is missing for computed property \\\"\" + key + \"\\\".\"),\n          vm\n        );\n      }\n\n      if (!isSSR) {\n        // create internal watcher for the computed property.\n        watchers[key] = new Watcher(\n          vm,\n          getter || noop,\n          noop,\n          computedWatcherOptions\n        );\n      }\n\n      // component-defined computed properties are already defined on the\n      // component prototype. We only need to define computed properties defined\n      // at instantiation here.\n      if (!(key in vm)) {\n        defineComputed(vm, key, userDef);\n      } else {\n        if (key in vm.$data) {\n          warn((\"The computed property \\\"\" + key + \"\\\" is already defined in data.\"), vm);\n        } else if (vm.$options.props && key in vm.$options.props) {\n          warn((\"The computed property \\\"\" + key + \"\\\" is already defined as a prop.\"), vm);\n        }\n      }\n    }\n  }\n\n  function defineComputed (\n    target,\n    key,\n    userDef\n  ) {\n    var shouldCache = !isServerRendering();\n    if (typeof userDef === 'function') {\n      sharedPropertyDefinition.get = shouldCache\n        ? createComputedGetter(key)\n        : createGetterInvoker(userDef);\n      sharedPropertyDefinition.set = noop;\n    } else {\n      sharedPropertyDefinition.get = userDef.get\n        ? shouldCache && userDef.cache !== false\n          ? createComputedGetter(key)\n          : createGetterInvoker(userDef.get)\n        : noop;\n      sharedPropertyDefinition.set = userDef.set || noop;\n    }\n    if (sharedPropertyDefinition.set === noop) {\n      sharedPropertyDefinition.set = function () {\n        warn(\n          (\"Computed property \\\"\" + key + \"\\\" was assigned to but it has no setter.\"),\n          this\n        );\n      };\n    }\n    Object.defineProperty(target, key, sharedPropertyDefinition);\n  }\n\n  function createComputedGetter (key) {\n    return function computedGetter () {\n      var watcher = this._computedWatchers && this._computedWatchers[key];\n      if (watcher) {\n        if (watcher.dirty) {\n          watcher.evaluate();\n        }\n        if (Dep.target) {\n          watcher.depend();\n        }\n        return watcher.value\n      }\n    }\n  }\n\n  function createGetterInvoker(fn) {\n    return function computedGetter () {\n      return fn.call(this, this)\n    }\n  }\n\n  function initMethods (vm, methods) {\n    var props = vm.$options.props;\n    for (var key in methods) {\n      {\n        if (typeof methods[key] !== 'function') {\n          warn(\n            \"Method \\\"\" + key + \"\\\" has type \\\"\" + (typeof methods[key]) + \"\\\" in the component definition. \" +\n            \"Did you reference the function correctly?\",\n            vm\n          );\n        }\n        if (props && hasOwn(props, key)) {\n          warn(\n            (\"Method \\\"\" + key + \"\\\" has already been defined as a prop.\"),\n            vm\n          );\n        }\n        if ((key in vm) && isReserved(key)) {\n          warn(\n            \"Method \\\"\" + key + \"\\\" conflicts with an existing Vue instance method. \" +\n            \"Avoid defining component methods that start with _ or $.\"\n          );\n        }\n      }\n      vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);\n    }\n  }\n\n  function initWatch (vm, watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n\n  function createWatcher (\n    vm,\n    expOrFn,\n    handler,\n    options\n  ) {\n    if (isPlainObject(handler)) {\n      options = handler;\n      handler = handler.handler;\n    }\n    if (typeof handler === 'string') {\n      handler = vm[handler];\n    }\n    return vm.$watch(expOrFn, handler, options)\n  }\n\n  function stateMixin (Vue) {\n    // flow somehow has problems with directly declared definition object\n    // when using Object.defineProperty, so we have to procedurally build up\n    // the object here.\n    var dataDef = {};\n    dataDef.get = function () { return this._data };\n    var propsDef = {};\n    propsDef.get = function () { return this._props };\n    {\n      dataDef.set = function () {\n        warn(\n          'Avoid replacing instance root $data. ' +\n          'Use nested data properties instead.',\n          this\n        );\n      };\n      propsDef.set = function () {\n        warn(\"$props is readonly.\", this);\n      };\n    }\n    Object.defineProperty(Vue.prototype, '$data', dataDef);\n    Object.defineProperty(Vue.prototype, '$props', propsDef);\n\n    Vue.prototype.$set = set;\n    Vue.prototype.$delete = del;\n\n    Vue.prototype.$watch = function (\n      expOrFn,\n      cb,\n      options\n    ) {\n      var vm = this;\n      if (isPlainObject(cb)) {\n        return createWatcher(vm, expOrFn, cb, options)\n      }\n      options = options || {};\n      options.user = true;\n      var watcher = new Watcher(vm, expOrFn, cb, options);\n      if (options.immediate) {\n        try {\n          cb.call(vm, watcher.value);\n        } catch (error) {\n          handleError(error, vm, (\"callback for immediate watcher \\\"\" + (watcher.expression) + \"\\\"\"));\n        }\n      }\n      return function unwatchFn () {\n        watcher.teardown();\n      }\n    };\n  }\n\n  /*  */\n\n  var uid$3 = 0;\n\n  function initMixin (Vue) {\n    Vue.prototype._init = function (options) {\n      var vm = this;\n      // a uid\n      vm._uid = uid$3++;\n\n      var startTag, endTag;\n      /* istanbul ignore if */\n      if (config.performance && mark) {\n        startTag = \"vue-perf-start:\" + (vm._uid);\n        endTag = \"vue-perf-end:\" + (vm._uid);\n        mark(startTag);\n      }\n\n      // a flag to avoid this being observed\n      vm._isVue = true;\n      // merge options\n      if (options && options._isComponent) {\n        // optimize internal component instantiation\n        // since dynamic options merging is pretty slow, and none of the\n        // internal component options needs special treatment.\n        initInternalComponent(vm, options);\n      } else {\n        vm.$options = mergeOptions(\n          resolveConstructorOptions(vm.constructor),\n          options || {},\n          vm\n        );\n      }\n      /* istanbul ignore else */\n      {\n        initProxy(vm);\n      }\n      // expose real self\n      vm._self = vm;\n      initLifecycle(vm);\n      initEvents(vm);\n      initRender(vm);\n      callHook(vm, 'beforeCreate');\n      initInjections(vm); // resolve injections before data/props\n      initState(vm);\n      initProvide(vm); // resolve provide after data/props\n      callHook(vm, 'created');\n\n      /* istanbul ignore if */\n      if (config.performance && mark) {\n        vm._name = formatComponentName(vm, false);\n        mark(endTag);\n        measure((\"vue \" + (vm._name) + \" init\"), startTag, endTag);\n      }\n\n      if (vm.$options.el) {\n        vm.$mount(vm.$options.el);\n      }\n    };\n  }\n\n  function initInternalComponent (vm, options) {\n    var opts = vm.$options = Object.create(vm.constructor.options);\n    // doing this because it's faster than dynamic enumeration.\n    var parentVnode = options._parentVnode;\n    opts.parent = options.parent;\n    opts._parentVnode = parentVnode;\n\n    var vnodeComponentOptions = parentVnode.componentOptions;\n    opts.propsData = vnodeComponentOptions.propsData;\n    opts._parentListeners = vnodeComponentOptions.listeners;\n    opts._renderChildren = vnodeComponentOptions.children;\n    opts._componentTag = vnodeComponentOptions.tag;\n\n    if (options.render) {\n      opts.render = options.render;\n      opts.staticRenderFns = options.staticRenderFns;\n    }\n  }\n\n  function resolveConstructorOptions (Ctor) {\n    var options = Ctor.options;\n    if (Ctor.super) {\n      var superOptions = resolveConstructorOptions(Ctor.super);\n      var cachedSuperOptions = Ctor.superOptions;\n      if (superOptions !== cachedSuperOptions) {\n        // super option changed,\n        // need to resolve new options.\n        Ctor.superOptions = superOptions;\n        // check if there are any late-modified/attached options (#4976)\n        var modifiedOptions = resolveModifiedOptions(Ctor);\n        // update base extend options\n        if (modifiedOptions) {\n          extend(Ctor.extendOptions, modifiedOptions);\n        }\n        options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);\n        if (options.name) {\n          options.components[options.name] = Ctor;\n        }\n      }\n    }\n    return options\n  }\n\n  function resolveModifiedOptions (Ctor) {\n    var modified;\n    var latest = Ctor.options;\n    var sealed = Ctor.sealedOptions;\n    for (var key in latest) {\n      if (latest[key] !== sealed[key]) {\n        if (!modified) { modified = {}; }\n        modified[key] = latest[key];\n      }\n    }\n    return modified\n  }\n\n  function Vue (options) {\n    if (!(this instanceof Vue)\n    ) {\n      warn('Vue is a constructor and should be called with the `new` keyword');\n    }\n    this._init(options);\n  }\n\n  initMixin(Vue);\n  stateMixin(Vue);\n  eventsMixin(Vue);\n  lifecycleMixin(Vue);\n  renderMixin(Vue);\n\n  /*  */\n\n  function initUse (Vue) {\n    Vue.use = function (plugin) {\n      var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));\n      if (installedPlugins.indexOf(plugin) > -1) {\n        return this\n      }\n\n      // additional parameters\n      var args = toArray(arguments, 1);\n      args.unshift(this);\n      if (typeof plugin.install === 'function') {\n        plugin.install.apply(plugin, args);\n      } else if (typeof plugin === 'function') {\n        plugin.apply(null, args);\n      }\n      installedPlugins.push(plugin);\n      return this\n    };\n  }\n\n  /*  */\n\n  function initMixin$1 (Vue) {\n    Vue.mixin = function (mixin) {\n      this.options = mergeOptions(this.options, mixin);\n      return this\n    };\n  }\n\n  /*  */\n\n  function initExtend (Vue) {\n    /**\n     * Each instance constructor, including Vue, has a unique\n     * cid. This enables us to create wrapped \"child\n     * constructors\" for prototypal inheritance and cache them.\n     */\n    Vue.cid = 0;\n    var cid = 1;\n\n    /**\n     * Class inheritance\n     */\n    Vue.extend = function (extendOptions) {\n      extendOptions = extendOptions || {};\n      var Super = this;\n      var SuperId = Super.cid;\n      var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n      if (cachedCtors[SuperId]) {\n        return cachedCtors[SuperId]\n      }\n\n      var name = extendOptions.name || Super.options.name;\n      if (name) {\n        validateComponentName(name);\n      }\n\n      var Sub = function VueComponent (options) {\n        this._init(options);\n      };\n      Sub.prototype = Object.create(Super.prototype);\n      Sub.prototype.constructor = Sub;\n      Sub.cid = cid++;\n      Sub.options = mergeOptions(\n        Super.options,\n        extendOptions\n      );\n      Sub['super'] = Super;\n\n      // For props and computed properties, we define the proxy getters on\n      // the Vue instances at extension time, on the extended prototype. This\n      // avoids Object.defineProperty calls for each instance created.\n      if (Sub.options.props) {\n        initProps$1(Sub);\n      }\n      if (Sub.options.computed) {\n        initComputed$1(Sub);\n      }\n\n      // allow further extension/mixin/plugin usage\n      Sub.extend = Super.extend;\n      Sub.mixin = Super.mixin;\n      Sub.use = Super.use;\n\n      // create asset registers, so extended classes\n      // can have their private assets too.\n      ASSET_TYPES.forEach(function (type) {\n        Sub[type] = Super[type];\n      });\n      // enable recursive self-lookup\n      if (name) {\n        Sub.options.components[name] = Sub;\n      }\n\n      // keep a reference to the super options at extension time.\n      // later at instantiation we can check if Super's options have\n      // been updated.\n      Sub.superOptions = Super.options;\n      Sub.extendOptions = extendOptions;\n      Sub.sealedOptions = extend({}, Sub.options);\n\n      // cache constructor\n      cachedCtors[SuperId] = Sub;\n      return Sub\n    };\n  }\n\n  function initProps$1 (Comp) {\n    var props = Comp.options.props;\n    for (var key in props) {\n      proxy(Comp.prototype, \"_props\", key);\n    }\n  }\n\n  function initComputed$1 (Comp) {\n    var computed = Comp.options.computed;\n    for (var key in computed) {\n      defineComputed(Comp.prototype, key, computed[key]);\n    }\n  }\n\n  /*  */\n\n  function initAssetRegisters (Vue) {\n    /**\n     * Create asset registration methods.\n     */\n    ASSET_TYPES.forEach(function (type) {\n      Vue[type] = function (\n        id,\n        definition\n      ) {\n        if (!definition) {\n          return this.options[type + 's'][id]\n        } else {\n          /* istanbul ignore if */\n          if (type === 'component') {\n            validateComponentName(id);\n          }\n          if (type === 'component' && isPlainObject(definition)) {\n            definition.name = definition.name || id;\n            definition = this.options._base.extend(definition);\n          }\n          if (type === 'directive' && typeof definition === 'function') {\n            definition = { bind: definition, update: definition };\n          }\n          this.options[type + 's'][id] = definition;\n          return definition\n        }\n      };\n    });\n  }\n\n  /*  */\n\n\n\n  function getComponentName (opts) {\n    return opts && (opts.Ctor.options.name || opts.tag)\n  }\n\n  function matches (pattern, name) {\n    if (Array.isArray(pattern)) {\n      return pattern.indexOf(name) > -1\n    } else if (typeof pattern === 'string') {\n      return pattern.split(',').indexOf(name) > -1\n    } else if (isRegExp(pattern)) {\n      return pattern.test(name)\n    }\n    /* istanbul ignore next */\n    return false\n  }\n\n  function pruneCache (keepAliveInstance, filter) {\n    var cache = keepAliveInstance.cache;\n    var keys = keepAliveInstance.keys;\n    var _vnode = keepAliveInstance._vnode;\n    for (var key in cache) {\n      var cachedNode = cache[key];\n      if (cachedNode) {\n        var name = getComponentName(cachedNode.componentOptions);\n        if (name && !filter(name)) {\n          pruneCacheEntry(cache, key, keys, _vnode);\n        }\n      }\n    }\n  }\n\n  function pruneCacheEntry (\n    cache,\n    key,\n    keys,\n    current\n  ) {\n    var cached$$1 = cache[key];\n    if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {\n      cached$$1.componentInstance.$destroy();\n    }\n    cache[key] = null;\n    remove(keys, key);\n  }\n\n  var patternTypes = [String, RegExp, Array];\n\n  var KeepAlive = {\n    name: 'keep-alive',\n    abstract: true,\n\n    props: {\n      include: patternTypes,\n      exclude: patternTypes,\n      max: [String, Number]\n    },\n\n    created: function created () {\n      this.cache = Object.create(null);\n      this.keys = [];\n    },\n\n    destroyed: function destroyed () {\n      for (var key in this.cache) {\n        pruneCacheEntry(this.cache, key, this.keys);\n      }\n    },\n\n    mounted: function mounted () {\n      var this$1 = this;\n\n      this.$watch('include', function (val) {\n        pruneCache(this$1, function (name) { return matches(val, name); });\n      });\n      this.$watch('exclude', function (val) {\n        pruneCache(this$1, function (name) { return !matches(val, name); });\n      });\n    },\n\n    render: function render () {\n      var slot = this.$slots.default;\n      var vnode = getFirstComponentChild(slot);\n      var componentOptions = vnode && vnode.componentOptions;\n      if (componentOptions) {\n        // check pattern\n        var name = getComponentName(componentOptions);\n        var ref = this;\n        var include = ref.include;\n        var exclude = ref.exclude;\n        if (\n          // not included\n          (include && (!name || !matches(include, name))) ||\n          // excluded\n          (exclude && name && matches(exclude, name))\n        ) {\n          return vnode\n        }\n\n        var ref$1 = this;\n        var cache = ref$1.cache;\n        var keys = ref$1.keys;\n        var key = vnode.key == null\n          // same constructor may get registered as different local components\n          // so cid alone is not enough (#3269)\n          ? componentOptions.Ctor.cid + (componentOptions.tag ? (\"::\" + (componentOptions.tag)) : '')\n          : vnode.key;\n        if (cache[key]) {\n          vnode.componentInstance = cache[key].componentInstance;\n          // make current key freshest\n          remove(keys, key);\n          keys.push(key);\n        } else {\n          cache[key] = vnode;\n          keys.push(key);\n          // prune oldest entry\n          if (this.max && keys.length > parseInt(this.max)) {\n            pruneCacheEntry(cache, keys[0], keys, this._vnode);\n          }\n        }\n\n        vnode.data.keepAlive = true;\n      }\n      return vnode || (slot && slot[0])\n    }\n  };\n\n  var builtInComponents = {\n    KeepAlive: KeepAlive\n  };\n\n  /*  */\n\n  function initGlobalAPI (Vue) {\n    // config\n    var configDef = {};\n    configDef.get = function () { return config; };\n    {\n      configDef.set = function () {\n        warn(\n          'Do not replace the Vue.config object, set individual fields instead.'\n        );\n      };\n    }\n    Object.defineProperty(Vue, 'config', configDef);\n\n    // exposed util methods.\n    // NOTE: these are not considered part of the public API - avoid relying on\n    // them unless you are aware of the risk.\n    Vue.util = {\n      warn: warn,\n      extend: extend,\n      mergeOptions: mergeOptions,\n      defineReactive: defineReactive$$1\n    };\n\n    Vue.set = set;\n    Vue.delete = del;\n    Vue.nextTick = nextTick;\n\n    // 2.6 explicit observable API\n    Vue.observable = function (obj) {\n      observe(obj);\n      return obj\n    };\n\n    Vue.options = Object.create(null);\n    ASSET_TYPES.forEach(function (type) {\n      Vue.options[type + 's'] = Object.create(null);\n    });\n\n    // this is used to identify the \"base\" constructor to extend all plain-object\n    // components with in Weex's multi-instance scenarios.\n    Vue.options._base = Vue;\n\n    extend(Vue.options.components, builtInComponents);\n\n    initUse(Vue);\n    initMixin$1(Vue);\n    initExtend(Vue);\n    initAssetRegisters(Vue);\n  }\n\n  initGlobalAPI(Vue);\n\n  Object.defineProperty(Vue.prototype, '$isServer', {\n    get: isServerRendering\n  });\n\n  Object.defineProperty(Vue.prototype, '$ssrContext', {\n    get: function get () {\n      /* istanbul ignore next */\n      return this.$vnode && this.$vnode.ssrContext\n    }\n  });\n\n  // expose FunctionalRenderContext for ssr runtime helper installation\n  Object.defineProperty(Vue, 'FunctionalRenderContext', {\n    value: FunctionalRenderContext\n  });\n\n  Vue.version = '2.6.7';\n\n  /*  */\n\n  // these are reserved for web because they are directly compiled away\n  // during template compilation\n  var isReservedAttr = makeMap('style,class');\n\n  // attributes that should be using props for binding\n  var acceptValue = makeMap('input,textarea,option,select,progress');\n  var mustUseProp = function (tag, type, attr) {\n    return (\n      (attr === 'value' && acceptValue(tag)) && type !== 'button' ||\n      (attr === 'selected' && tag === 'option') ||\n      (attr === 'checked' && tag === 'input') ||\n      (attr === 'muted' && tag === 'video')\n    )\n  };\n\n  var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\n  var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');\n\n  var convertEnumeratedValue = function (key, value) {\n    return isFalsyAttrValue(value) || value === 'false'\n      ? 'false'\n      // allow arbitrary string value for contenteditable\n      : key === 'contenteditable' && isValidContentEditableValue(value)\n        ? value\n        : 'true'\n  };\n\n  var isBooleanAttr = makeMap(\n    'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n    'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n    'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n    'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n    'required,reversed,scoped,seamless,selected,sortable,translate,' +\n    'truespeed,typemustmatch,visible'\n  );\n\n  var xlinkNS = 'http://www.w3.org/1999/xlink';\n\n  var isXlink = function (name) {\n    return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n  };\n\n  var getXlinkProp = function (name) {\n    return isXlink(name) ? name.slice(6, name.length) : ''\n  };\n\n  var isFalsyAttrValue = function (val) {\n    return val == null || val === false\n  };\n\n  /*  */\n\n  function genClassForVnode (vnode) {\n    var data = vnode.data;\n    var parentNode = vnode;\n    var childNode = vnode;\n    while (isDef(childNode.componentInstance)) {\n      childNode = childNode.componentInstance._vnode;\n      if (childNode && childNode.data) {\n        data = mergeClassData(childNode.data, data);\n      }\n    }\n    while (isDef(parentNode = parentNode.parent)) {\n      if (parentNode && parentNode.data) {\n        data = mergeClassData(data, parentNode.data);\n      }\n    }\n    return renderClass(data.staticClass, data.class)\n  }\n\n  function mergeClassData (child, parent) {\n    return {\n      staticClass: concat(child.staticClass, parent.staticClass),\n      class: isDef(child.class)\n        ? [child.class, parent.class]\n        : parent.class\n    }\n  }\n\n  function renderClass (\n    staticClass,\n    dynamicClass\n  ) {\n    if (isDef(staticClass) || isDef(dynamicClass)) {\n      return concat(staticClass, stringifyClass(dynamicClass))\n    }\n    /* istanbul ignore next */\n    return ''\n  }\n\n  function concat (a, b) {\n    return a ? b ? (a + ' ' + b) : a : (b || '')\n  }\n\n  function stringifyClass (value) {\n    if (Array.isArray(value)) {\n      return stringifyArray(value)\n    }\n    if (isObject(value)) {\n      return stringifyObject(value)\n    }\n    if (typeof value === 'string') {\n      return value\n    }\n    /* istanbul ignore next */\n    return ''\n  }\n\n  function stringifyArray (value) {\n    var res = '';\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {\n        if (res) { res += ' '; }\n        res += stringified;\n      }\n    }\n    return res\n  }\n\n  function stringifyObject (value) {\n    var res = '';\n    for (var key in value) {\n      if (value[key]) {\n        if (res) { res += ' '; }\n        res += key;\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  var namespaceMap = {\n    svg: 'http://www.w3.org/2000/svg',\n    math: 'http://www.w3.org/1998/Math/MathML'\n  };\n\n  var isHTMLTag = makeMap(\n    'html,body,base,head,link,meta,style,title,' +\n    'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n    'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +\n    'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n    's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n    'embed,object,param,source,canvas,script,noscript,del,ins,' +\n    'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n    'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n    'output,progress,select,textarea,' +\n    'details,dialog,menu,menuitem,summary,' +\n    'content,element,shadow,template,blockquote,iframe,tfoot'\n  );\n\n  // this map is intentionally selective, only covering SVG elements that may\n  // contain child elements.\n  var isSVG = makeMap(\n    'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\n    'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n    'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n    true\n  );\n\n  var isPreTag = function (tag) { return tag === 'pre'; };\n\n  var isReservedTag = function (tag) {\n    return isHTMLTag(tag) || isSVG(tag)\n  };\n\n  function getTagNamespace (tag) {\n    if (isSVG(tag)) {\n      return 'svg'\n    }\n    // basic support for MathML\n    // note it doesn't support other MathML elements being component roots\n    if (tag === 'math') {\n      return 'math'\n    }\n  }\n\n  var unknownElementCache = Object.create(null);\n  function isUnknownElement (tag) {\n    /* istanbul ignore if */\n    if (!inBrowser) {\n      return true\n    }\n    if (isReservedTag(tag)) {\n      return false\n    }\n    tag = tag.toLowerCase();\n    /* istanbul ignore if */\n    if (unknownElementCache[tag] != null) {\n      return unknownElementCache[tag]\n    }\n    var el = document.createElement(tag);\n    if (tag.indexOf('-') > -1) {\n      // http://stackoverflow.com/a/28210364/1070244\n      return (unknownElementCache[tag] = (\n        el.constructor === window.HTMLUnknownElement ||\n        el.constructor === window.HTMLElement\n      ))\n    } else {\n      return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n    }\n  }\n\n  var isTextInputType = makeMap('text,number,password,search,email,tel,url');\n\n  /*  */\n\n  /**\n   * Query an element selector if it's not an element already.\n   */\n  function query (el) {\n    if (typeof el === 'string') {\n      var selected = document.querySelector(el);\n      if (!selected) {\n        warn(\n          'Cannot find element: ' + el\n        );\n        return document.createElement('div')\n      }\n      return selected\n    } else {\n      return el\n    }\n  }\n\n  /*  */\n\n  function createElement$1 (tagName, vnode) {\n    var elm = document.createElement(tagName);\n    if (tagName !== 'select') {\n      return elm\n    }\n    // false or null will remove the attribute but undefined will not\n    if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {\n      elm.setAttribute('multiple', 'multiple');\n    }\n    return elm\n  }\n\n  function createElementNS (namespace, tagName) {\n    return document.createElementNS(namespaceMap[namespace], tagName)\n  }\n\n  function createTextNode (text) {\n    return document.createTextNode(text)\n  }\n\n  function createComment (text) {\n    return document.createComment(text)\n  }\n\n  function insertBefore (parentNode, newNode, referenceNode) {\n    parentNode.insertBefore(newNode, referenceNode);\n  }\n\n  function removeChild (node, child) {\n    node.removeChild(child);\n  }\n\n  function appendChild (node, child) {\n    node.appendChild(child);\n  }\n\n  function parentNode (node) {\n    return node.parentNode\n  }\n\n  function nextSibling (node) {\n    return node.nextSibling\n  }\n\n  function tagName (node) {\n    return node.tagName\n  }\n\n  function setTextContent (node, text) {\n    node.textContent = text;\n  }\n\n  function setStyleScope (node, scopeId) {\n    node.setAttribute(scopeId, '');\n  }\n\n  var nodeOps = /*#__PURE__*/Object.freeze({\n    createElement: createElement$1,\n    createElementNS: createElementNS,\n    createTextNode: createTextNode,\n    createComment: createComment,\n    insertBefore: insertBefore,\n    removeChild: removeChild,\n    appendChild: appendChild,\n    parentNode: parentNode,\n    nextSibling: nextSibling,\n    tagName: tagName,\n    setTextContent: setTextContent,\n    setStyleScope: setStyleScope\n  });\n\n  /*  */\n\n  var ref = {\n    create: function create (_, vnode) {\n      registerRef(vnode);\n    },\n    update: function update (oldVnode, vnode) {\n      if (oldVnode.data.ref !== vnode.data.ref) {\n        registerRef(oldVnode, true);\n        registerRef(vnode);\n      }\n    },\n    destroy: function destroy (vnode) {\n      registerRef(vnode, true);\n    }\n  };\n\n  function registerRef (vnode, isRemoval) {\n    var key = vnode.data.ref;\n    if (!isDef(key)) { return }\n\n    var vm = vnode.context;\n    var ref = vnode.componentInstance || vnode.elm;\n    var refs = vm.$refs;\n    if (isRemoval) {\n      if (Array.isArray(refs[key])) {\n        remove(refs[key], ref);\n      } else if (refs[key] === ref) {\n        refs[key] = undefined;\n      }\n    } else {\n      if (vnode.data.refInFor) {\n        if (!Array.isArray(refs[key])) {\n          refs[key] = [ref];\n        } else if (refs[key].indexOf(ref) < 0) {\n          // $flow-disable-line\n          refs[key].push(ref);\n        }\n      } else {\n        refs[key] = ref;\n      }\n    }\n  }\n\n  /**\n   * Virtual DOM patching algorithm based on Snabbdom by\n   * Simon Friis Vindum (@paldepind)\n   * Licensed under the MIT License\n   * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n   *\n   * modified by Evan You (@yyx990803)\n   *\n   * Not type-checking this because this file is perf-critical and the cost\n   * of making flow understand it is not worth it.\n   */\n\n  var emptyNode = new VNode('', {}, []);\n\n  var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];\n\n  function sameVnode (a, b) {\n    return (\n      a.key === b.key && (\n        (\n          a.tag === b.tag &&\n          a.isComment === b.isComment &&\n          isDef(a.data) === isDef(b.data) &&\n          sameInputType(a, b)\n        ) || (\n          isTrue(a.isAsyncPlaceholder) &&\n          a.asyncFactory === b.asyncFactory &&\n          isUndef(b.asyncFactory.error)\n        )\n      )\n    )\n  }\n\n  function sameInputType (a, b) {\n    if (a.tag !== 'input') { return true }\n    var i;\n    var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;\n    var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;\n    return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)\n  }\n\n  function createKeyToOldIdx (children, beginIdx, endIdx) {\n    var i, key;\n    var map = {};\n    for (i = beginIdx; i <= endIdx; ++i) {\n      key = children[i].key;\n      if (isDef(key)) { map[key] = i; }\n    }\n    return map\n  }\n\n  function createPatchFunction (backend) {\n    var i, j;\n    var cbs = {};\n\n    var modules = backend.modules;\n    var nodeOps = backend.nodeOps;\n\n    for (i = 0; i < hooks.length; ++i) {\n      cbs[hooks[i]] = [];\n      for (j = 0; j < modules.length; ++j) {\n        if (isDef(modules[j][hooks[i]])) {\n          cbs[hooks[i]].push(modules[j][hooks[i]]);\n        }\n      }\n    }\n\n    function emptyNodeAt (elm) {\n      return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n    }\n\n    function createRmCb (childElm, listeners) {\n      function remove$$1 () {\n        if (--remove$$1.listeners === 0) {\n          removeNode(childElm);\n        }\n      }\n      remove$$1.listeners = listeners;\n      return remove$$1\n    }\n\n    function removeNode (el) {\n      var parent = nodeOps.parentNode(el);\n      // element may have already been removed due to v-html / v-text\n      if (isDef(parent)) {\n        nodeOps.removeChild(parent, el);\n      }\n    }\n\n    function isUnknownElement$$1 (vnode, inVPre) {\n      return (\n        !inVPre &&\n        !vnode.ns &&\n        !(\n          config.ignoredElements.length &&\n          config.ignoredElements.some(function (ignore) {\n            return isRegExp(ignore)\n              ? ignore.test(vnode.tag)\n              : ignore === vnode.tag\n          })\n        ) &&\n        config.isUnknownElement(vnode.tag)\n      )\n    }\n\n    var creatingElmInVPre = 0;\n\n    function createElm (\n      vnode,\n      insertedVnodeQueue,\n      parentElm,\n      refElm,\n      nested,\n      ownerArray,\n      index\n    ) {\n      if (isDef(vnode.elm) && isDef(ownerArray)) {\n        // This vnode was used in a previous render!\n        // now it's used as a new node, overwriting its elm would cause\n        // potential patch errors down the road when it's used as an insertion\n        // reference node. Instead, we clone the node on-demand before creating\n        // associated DOM element for it.\n        vnode = ownerArray[index] = cloneVNode(vnode);\n      }\n\n      vnode.isRootInsert = !nested; // for transition enter check\n      if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n        return\n      }\n\n      var data = vnode.data;\n      var children = vnode.children;\n      var tag = vnode.tag;\n      if (isDef(tag)) {\n        {\n          if (data && data.pre) {\n            creatingElmInVPre++;\n          }\n          if (isUnknownElement$$1(vnode, creatingElmInVPre)) {\n            warn(\n              'Unknown custom element: <' + tag + '> - did you ' +\n              'register the component correctly? For recursive components, ' +\n              'make sure to provide the \"name\" option.',\n              vnode.context\n            );\n          }\n        }\n\n        vnode.elm = vnode.ns\n          ? nodeOps.createElementNS(vnode.ns, tag)\n          : nodeOps.createElement(tag, vnode);\n        setScope(vnode);\n\n        /* istanbul ignore if */\n        {\n          createChildren(vnode, children, insertedVnodeQueue);\n          if (isDef(data)) {\n            invokeCreateHooks(vnode, insertedVnodeQueue);\n          }\n          insert(parentElm, vnode.elm, refElm);\n        }\n\n        if (data && data.pre) {\n          creatingElmInVPre--;\n        }\n      } else if (isTrue(vnode.isComment)) {\n        vnode.elm = nodeOps.createComment(vnode.text);\n        insert(parentElm, vnode.elm, refElm);\n      } else {\n        vnode.elm = nodeOps.createTextNode(vnode.text);\n        insert(parentElm, vnode.elm, refElm);\n      }\n    }\n\n    function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n      var i = vnode.data;\n      if (isDef(i)) {\n        var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;\n        if (isDef(i = i.hook) && isDef(i = i.init)) {\n          i(vnode, false /* hydrating */);\n        }\n        // after calling the init hook, if the vnode is a child component\n        // it should've created a child instance and mounted it. the child\n        // component also has set the placeholder vnode's elm.\n        // in that case we can just return the element and be done.\n        if (isDef(vnode.componentInstance)) {\n          initComponent(vnode, insertedVnodeQueue);\n          insert(parentElm, vnode.elm, refElm);\n          if (isTrue(isReactivated)) {\n            reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n          }\n          return true\n        }\n      }\n    }\n\n    function initComponent (vnode, insertedVnodeQueue) {\n      if (isDef(vnode.data.pendingInsert)) {\n        insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n        vnode.data.pendingInsert = null;\n      }\n      vnode.elm = vnode.componentInstance.$el;\n      if (isPatchable(vnode)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n        setScope(vnode);\n      } else {\n        // empty component root.\n        // skip all element-related modules except for ref (#3455)\n        registerRef(vnode);\n        // make sure to invoke the insert hook\n        insertedVnodeQueue.push(vnode);\n      }\n    }\n\n    function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n      var i;\n      // hack for #4339: a reactivated component with inner transition\n      // does not trigger because the inner node's created hooks are not called\n      // again. It's not ideal to involve module-specific logic in here but\n      // there doesn't seem to be a better way to do it.\n      var innerNode = vnode;\n      while (innerNode.componentInstance) {\n        innerNode = innerNode.componentInstance._vnode;\n        if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n          for (i = 0; i < cbs.activate.length; ++i) {\n            cbs.activate[i](emptyNode, innerNode);\n          }\n          insertedVnodeQueue.push(innerNode);\n          break\n        }\n      }\n      // unlike a newly created component,\n      // a reactivated keep-alive component doesn't insert itself\n      insert(parentElm, vnode.elm, refElm);\n    }\n\n    function insert (parent, elm, ref$$1) {\n      if (isDef(parent)) {\n        if (isDef(ref$$1)) {\n          if (nodeOps.parentNode(ref$$1) === parent) {\n            nodeOps.insertBefore(parent, elm, ref$$1);\n          }\n        } else {\n          nodeOps.appendChild(parent, elm);\n        }\n      }\n    }\n\n    function createChildren (vnode, children, insertedVnodeQueue) {\n      if (Array.isArray(children)) {\n        {\n          checkDuplicateKeys(children);\n        }\n        for (var i = 0; i < children.length; ++i) {\n          createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);\n        }\n      } else if (isPrimitive(vnode.text)) {\n        nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));\n      }\n    }\n\n    function isPatchable (vnode) {\n      while (vnode.componentInstance) {\n        vnode = vnode.componentInstance._vnode;\n      }\n      return isDef(vnode.tag)\n    }\n\n    function invokeCreateHooks (vnode, insertedVnodeQueue) {\n      for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n        cbs.create[i$1](emptyNode, vnode);\n      }\n      i = vnode.data.hook; // Reuse variable\n      if (isDef(i)) {\n        if (isDef(i.create)) { i.create(emptyNode, vnode); }\n        if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }\n      }\n    }\n\n    // set scope id attribute for scoped CSS.\n    // this is implemented as a special case to avoid the overhead\n    // of going through the normal attribute patching process.\n    function setScope (vnode) {\n      var i;\n      if (isDef(i = vnode.fnScopeId)) {\n        nodeOps.setStyleScope(vnode.elm, i);\n      } else {\n        var ancestor = vnode;\n        while (ancestor) {\n          if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {\n            nodeOps.setStyleScope(vnode.elm, i);\n          }\n          ancestor = ancestor.parent;\n        }\n      }\n      // for slot content they should also get the scopeId from the host instance.\n      if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        i !== vnode.fnContext &&\n        isDef(i = i.$options._scopeId)\n      ) {\n        nodeOps.setStyleScope(vnode.elm, i);\n      }\n    }\n\n    function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n      for (; startIdx <= endIdx; ++startIdx) {\n        createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);\n      }\n    }\n\n    function invokeDestroyHook (vnode) {\n      var i, j;\n      var data = vnode.data;\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n        for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n      }\n      if (isDef(i = vnode.children)) {\n        for (j = 0; j < vnode.children.length; ++j) {\n          invokeDestroyHook(vnode.children[j]);\n        }\n      }\n    }\n\n    function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n      for (; startIdx <= endIdx; ++startIdx) {\n        var ch = vnodes[startIdx];\n        if (isDef(ch)) {\n          if (isDef(ch.tag)) {\n            removeAndInvokeRemoveHook(ch);\n            invokeDestroyHook(ch);\n          } else { // Text node\n            removeNode(ch.elm);\n          }\n        }\n      }\n    }\n\n    function removeAndInvokeRemoveHook (vnode, rm) {\n      if (isDef(rm) || isDef(vnode.data)) {\n        var i;\n        var listeners = cbs.remove.length + 1;\n        if (isDef(rm)) {\n          // we have a recursively passed down rm callback\n          // increase the listeners count\n          rm.listeners += listeners;\n        } else {\n          // directly removing\n          rm = createRmCb(vnode.elm, listeners);\n        }\n        // recursively invoke hooks on child component root node\n        if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {\n          removeAndInvokeRemoveHook(i, rm);\n        }\n        for (i = 0; i < cbs.remove.length; ++i) {\n          cbs.remove[i](vnode, rm);\n        }\n        if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n          i(vnode, rm);\n        } else {\n          rm();\n        }\n      } else {\n        removeNode(vnode.elm);\n      }\n    }\n\n    function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n      var oldStartIdx = 0;\n      var newStartIdx = 0;\n      var oldEndIdx = oldCh.length - 1;\n      var oldStartVnode = oldCh[0];\n      var oldEndVnode = oldCh[oldEndIdx];\n      var newEndIdx = newCh.length - 1;\n      var newStartVnode = newCh[0];\n      var newEndVnode = newCh[newEndIdx];\n      var oldKeyToIdx, idxInOld, vnodeToMove, refElm;\n\n      // removeOnly is a special flag used only by <transition-group>\n      // to ensure removed elements stay in correct relative positions\n      // during leaving transitions\n      var canMove = !removeOnly;\n\n      {\n        checkDuplicateKeys(newCh);\n      }\n\n      while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n        if (isUndef(oldStartVnode)) {\n          oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n        } else if (isUndef(oldEndVnode)) {\n          oldEndVnode = oldCh[--oldEndIdx];\n        } else if (sameVnode(oldStartVnode, newStartVnode)) {\n          patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n          oldStartVnode = oldCh[++oldStartIdx];\n          newStartVnode = newCh[++newStartIdx];\n        } else if (sameVnode(oldEndVnode, newEndVnode)) {\n          patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n          oldEndVnode = oldCh[--oldEndIdx];\n          newEndVnode = newCh[--newEndIdx];\n        } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n          patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);\n          canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n          oldStartVnode = oldCh[++oldStartIdx];\n          newEndVnode = newCh[--newEndIdx];\n        } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n          patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n          canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n          oldEndVnode = oldCh[--oldEndIdx];\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n          idxInOld = isDef(newStartVnode.key)\n            ? oldKeyToIdx[newStartVnode.key]\n            : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);\n          if (isUndef(idxInOld)) { // New element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n          } else {\n            vnodeToMove = oldCh[idxInOld];\n            if (sameVnode(vnodeToMove, newStartVnode)) {\n              patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);\n              oldCh[idxInOld] = undefined;\n              canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);\n            } else {\n              // same key but different element. treat as new element\n              createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);\n            }\n          }\n          newStartVnode = newCh[++newStartIdx];\n        }\n      }\n      if (oldStartIdx > oldEndIdx) {\n        refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n        addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n      } else if (newStartIdx > newEndIdx) {\n        removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n      }\n    }\n\n    function checkDuplicateKeys (children) {\n      var seenKeys = {};\n      for (var i = 0; i < children.length; i++) {\n        var vnode = children[i];\n        var key = vnode.key;\n        if (isDef(key)) {\n          if (seenKeys[key]) {\n            warn(\n              (\"Duplicate keys detected: '\" + key + \"'. This may cause an update error.\"),\n              vnode.context\n            );\n          } else {\n            seenKeys[key] = true;\n          }\n        }\n      }\n    }\n\n    function findIdxInOld (node, oldCh, start, end) {\n      for (var i = start; i < end; i++) {\n        var c = oldCh[i];\n        if (isDef(c) && sameVnode(node, c)) { return i }\n      }\n    }\n\n    function patchVnode (\n      oldVnode,\n      vnode,\n      insertedVnodeQueue,\n      ownerArray,\n      index,\n      removeOnly\n    ) {\n      if (oldVnode === vnode) {\n        return\n      }\n\n      if (isDef(vnode.elm) && isDef(ownerArray)) {\n        // clone reused vnode\n        vnode = ownerArray[index] = cloneVNode(vnode);\n      }\n\n      var elm = vnode.elm = oldVnode.elm;\n\n      if (isTrue(oldVnode.isAsyncPlaceholder)) {\n        if (isDef(vnode.asyncFactory.resolved)) {\n          hydrate(oldVnode.elm, vnode, insertedVnodeQueue);\n        } else {\n          vnode.isAsyncPlaceholder = true;\n        }\n        return\n      }\n\n      // reuse element for static trees.\n      // note we only do this if the vnode is cloned -\n      // if the new node is not cloned it means the render functions have been\n      // reset by the hot-reload-api and we need to do a proper re-render.\n      if (isTrue(vnode.isStatic) &&\n        isTrue(oldVnode.isStatic) &&\n        vnode.key === oldVnode.key &&\n        (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))\n      ) {\n        vnode.componentInstance = oldVnode.componentInstance;\n        return\n      }\n\n      var i;\n      var data = vnode.data;\n      if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n        i(oldVnode, vnode);\n      }\n\n      var oldCh = oldVnode.children;\n      var ch = vnode.children;\n      if (isDef(data) && isPatchable(vnode)) {\n        for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n        if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n      }\n      if (isUndef(vnode.text)) {\n        if (isDef(oldCh) && isDef(ch)) {\n          if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n        } else if (isDef(ch)) {\n          {\n            checkDuplicateKeys(ch);\n          }\n          if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n          addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n        } else if (isDef(oldCh)) {\n          removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n        } else if (isDef(oldVnode.text)) {\n          nodeOps.setTextContent(elm, '');\n        }\n      } else if (oldVnode.text !== vnode.text) {\n        nodeOps.setTextContent(elm, vnode.text);\n      }\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n      }\n    }\n\n    function invokeInsertHook (vnode, queue, initial) {\n      // delay insert hooks for component root nodes, invoke them after the\n      // element is really inserted\n      if (isTrue(initial) && isDef(vnode.parent)) {\n        vnode.parent.data.pendingInsert = queue;\n      } else {\n        for (var i = 0; i < queue.length; ++i) {\n          queue[i].data.hook.insert(queue[i]);\n        }\n      }\n    }\n\n    var hydrationBailed = false;\n    // list of modules that can skip create hook during hydration because they\n    // are already rendered on the client or has no need for initialization\n    // Note: style is excluded because it relies on initial clone for future\n    // deep updates (#7063).\n    var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');\n\n    // Note: this is a browser-only function so we can assume elms are DOM nodes.\n    function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {\n      var i;\n      var tag = vnode.tag;\n      var data = vnode.data;\n      var children = vnode.children;\n      inVPre = inVPre || (data && data.pre);\n      vnode.elm = elm;\n\n      if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {\n        vnode.isAsyncPlaceholder = true;\n        return true\n      }\n      // assert node match\n      {\n        if (!assertNodeMatch(elm, vnode, inVPre)) {\n          return false\n        }\n      }\n      if (isDef(data)) {\n        if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n        if (isDef(i = vnode.componentInstance)) {\n          // child component. it should have hydrated its own tree.\n          initComponent(vnode, insertedVnodeQueue);\n          return true\n        }\n      }\n      if (isDef(tag)) {\n        if (isDef(children)) {\n          // empty element, allow client to pick up and populate children\n          if (!elm.hasChildNodes()) {\n            createChildren(vnode, children, insertedVnodeQueue);\n          } else {\n            // v-html and domProps: innerHTML\n            if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {\n              if (i !== elm.innerHTML) {\n                /* istanbul ignore if */\n                if (typeof console !== 'undefined' &&\n                  !hydrationBailed\n                ) {\n                  hydrationBailed = true;\n                  console.warn('Parent: ', elm);\n                  console.warn('server innerHTML: ', i);\n                  console.warn('client innerHTML: ', elm.innerHTML);\n                }\n                return false\n              }\n            } else {\n              // iterate and compare children lists\n              var childrenMatch = true;\n              var childNode = elm.firstChild;\n              for (var i$1 = 0; i$1 < children.length; i$1++) {\n                if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {\n                  childrenMatch = false;\n                  break\n                }\n                childNode = childNode.nextSibling;\n              }\n              // if childNode is not null, it means the actual childNodes list is\n              // longer than the virtual children list.\n              if (!childrenMatch || childNode) {\n                /* istanbul ignore if */\n                if (typeof console !== 'undefined' &&\n                  !hydrationBailed\n                ) {\n                  hydrationBailed = true;\n                  console.warn('Parent: ', elm);\n                  console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);\n                }\n                return false\n              }\n            }\n          }\n        }\n        if (isDef(data)) {\n          var fullInvoke = false;\n          for (var key in data) {\n            if (!isRenderedModule(key)) {\n              fullInvoke = true;\n              invokeCreateHooks(vnode, insertedVnodeQueue);\n              break\n            }\n          }\n          if (!fullInvoke && data['class']) {\n            // ensure collecting deps for deep class bindings for future updates\n            traverse(data['class']);\n          }\n        }\n      } else if (elm.data !== vnode.text) {\n        elm.data = vnode.text;\n      }\n      return true\n    }\n\n    function assertNodeMatch (node, vnode, inVPre) {\n      if (isDef(vnode.tag)) {\n        return vnode.tag.indexOf('vue-component') === 0 || (\n          !isUnknownElement$$1(vnode, inVPre) &&\n          vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())\n        )\n      } else {\n        return node.nodeType === (vnode.isComment ? 8 : 3)\n      }\n    }\n\n    return function patch (oldVnode, vnode, hydrating, removeOnly) {\n      if (isUndef(vnode)) {\n        if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }\n        return\n      }\n\n      var isInitialPatch = false;\n      var insertedVnodeQueue = [];\n\n      if (isUndef(oldVnode)) {\n        // empty mount (likely as component), create new root element\n        isInitialPatch = true;\n        createElm(vnode, insertedVnodeQueue);\n      } else {\n        var isRealElement = isDef(oldVnode.nodeType);\n        if (!isRealElement && sameVnode(oldVnode, vnode)) {\n          // patch existing root node\n          patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);\n        } else {\n          if (isRealElement) {\n            // mounting to a real element\n            // check if this is server-rendered content and if we can perform\n            // a successful hydration.\n            if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {\n              oldVnode.removeAttribute(SSR_ATTR);\n              hydrating = true;\n            }\n            if (isTrue(hydrating)) {\n              if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n                invokeInsertHook(vnode, insertedVnodeQueue, true);\n                return oldVnode\n              } else {\n                warn(\n                  'The client-side rendered virtual DOM tree is not matching ' +\n                  'server-rendered content. This is likely caused by incorrect ' +\n                  'HTML markup, for example nesting block-level elements inside ' +\n                  '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                  'full client-side render.'\n                );\n              }\n            }\n            // either not server-rendered, or hydration failed.\n            // create an empty node and replace it\n            oldVnode = emptyNodeAt(oldVnode);\n          }\n\n          // replacing existing element\n          var oldElm = oldVnode.elm;\n          var parentElm = nodeOps.parentNode(oldElm);\n\n          // create new node\n          createElm(\n            vnode,\n            insertedVnodeQueue,\n            // extremely rare edge case: do not insert if old element is in a\n            // leaving transition. Only happens when combining transition +\n            // keep-alive + HOCs. (#4590)\n            oldElm._leaveCb ? null : parentElm,\n            nodeOps.nextSibling(oldElm)\n          );\n\n          // update parent placeholder node element, recursively\n          if (isDef(vnode.parent)) {\n            var ancestor = vnode.parent;\n            var patchable = isPatchable(vnode);\n            while (ancestor) {\n              for (var i = 0; i < cbs.destroy.length; ++i) {\n                cbs.destroy[i](ancestor);\n              }\n              ancestor.elm = vnode.elm;\n              if (patchable) {\n                for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n                  cbs.create[i$1](emptyNode, ancestor);\n                }\n                // #6513\n                // invoke insert hooks that may have been merged by create hooks.\n                // e.g. for directives that uses the \"inserted\" hook.\n                var insert = ancestor.data.hook.insert;\n                if (insert.merged) {\n                  // start at index 1 to avoid re-invoking component mounted hook\n                  for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {\n                    insert.fns[i$2]();\n                  }\n                }\n              } else {\n                registerRef(ancestor);\n              }\n              ancestor = ancestor.parent;\n            }\n          }\n\n          // destroy old node\n          if (isDef(parentElm)) {\n            removeVnodes(parentElm, [oldVnode], 0, 0);\n          } else if (isDef(oldVnode.tag)) {\n            invokeDestroyHook(oldVnode);\n          }\n        }\n      }\n\n      invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n      return vnode.elm\n    }\n  }\n\n  /*  */\n\n  var directives = {\n    create: updateDirectives,\n    update: updateDirectives,\n    destroy: function unbindDirectives (vnode) {\n      updateDirectives(vnode, emptyNode);\n    }\n  };\n\n  function updateDirectives (oldVnode, vnode) {\n    if (oldVnode.data.directives || vnode.data.directives) {\n      _update(oldVnode, vnode);\n    }\n  }\n\n  function _update (oldVnode, vnode) {\n    var isCreate = oldVnode === emptyNode;\n    var isDestroy = vnode === emptyNode;\n    var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n    var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n    var dirsWithInsert = [];\n    var dirsWithPostpatch = [];\n\n    var key, oldDir, dir;\n    for (key in newDirs) {\n      oldDir = oldDirs[key];\n      dir = newDirs[key];\n      if (!oldDir) {\n        // new directive, bind\n        callHook$1(dir, 'bind', vnode, oldVnode);\n        if (dir.def && dir.def.inserted) {\n          dirsWithInsert.push(dir);\n        }\n      } else {\n        // existing directive, update\n        dir.oldValue = oldDir.value;\n        dir.oldArg = oldDir.arg;\n        callHook$1(dir, 'update', vnode, oldVnode);\n        if (dir.def && dir.def.componentUpdated) {\n          dirsWithPostpatch.push(dir);\n        }\n      }\n    }\n\n    if (dirsWithInsert.length) {\n      var callInsert = function () {\n        for (var i = 0; i < dirsWithInsert.length; i++) {\n          callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);\n        }\n      };\n      if (isCreate) {\n        mergeVNodeHook(vnode, 'insert', callInsert);\n      } else {\n        callInsert();\n      }\n    }\n\n    if (dirsWithPostpatch.length) {\n      mergeVNodeHook(vnode, 'postpatch', function () {\n        for (var i = 0; i < dirsWithPostpatch.length; i++) {\n          callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);\n        }\n      });\n    }\n\n    if (!isCreate) {\n      for (key in oldDirs) {\n        if (!newDirs[key]) {\n          // no longer present, unbind\n          callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);\n        }\n      }\n    }\n  }\n\n  var emptyModifiers = Object.create(null);\n\n  function normalizeDirectives$1 (\n    dirs,\n    vm\n  ) {\n    var res = Object.create(null);\n    if (!dirs) {\n      // $flow-disable-line\n      return res\n    }\n    var i, dir;\n    for (i = 0; i < dirs.length; i++) {\n      dir = dirs[i];\n      if (!dir.modifiers) {\n        // $flow-disable-line\n        dir.modifiers = emptyModifiers;\n      }\n      res[getRawDirName(dir)] = dir;\n      dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n    }\n    // $flow-disable-line\n    return res\n  }\n\n  function getRawDirName (dir) {\n    return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n  }\n\n  function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {\n    var fn = dir.def && dir.def[hook];\n    if (fn) {\n      try {\n        fn(vnode.elm, dir, vnode, oldVnode, isDestroy);\n      } catch (e) {\n        handleError(e, vnode.context, (\"directive \" + (dir.name) + \" \" + hook + \" hook\"));\n      }\n    }\n  }\n\n  var baseModules = [\n    ref,\n    directives\n  ];\n\n  /*  */\n\n  function updateAttrs (oldVnode, vnode) {\n    var opts = vnode.componentOptions;\n    if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {\n      return\n    }\n    if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {\n      return\n    }\n    var key, cur, old;\n    var elm = vnode.elm;\n    var oldAttrs = oldVnode.data.attrs || {};\n    var attrs = vnode.data.attrs || {};\n    // clone observed objects, as the user probably wants to mutate it\n    if (isDef(attrs.__ob__)) {\n      attrs = vnode.data.attrs = extend({}, attrs);\n    }\n\n    for (key in attrs) {\n      cur = attrs[key];\n      old = oldAttrs[key];\n      if (old !== cur) {\n        setAttr(elm, key, cur);\n      }\n    }\n    // #4391: in IE9, setting type can reset value for input[type=radio]\n    // #6666: IE/Edge forces progress value down to 1 before setting a max\n    /* istanbul ignore if */\n    if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {\n      setAttr(elm, 'value', attrs.value);\n    }\n    for (key in oldAttrs) {\n      if (isUndef(attrs[key])) {\n        if (isXlink(key)) {\n          elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n        } else if (!isEnumeratedAttr(key)) {\n          elm.removeAttribute(key);\n        }\n      }\n    }\n  }\n\n  function setAttr (el, key, value) {\n    if (el.tagName.indexOf('-') > -1) {\n      baseSetAttr(el, key, value);\n    } else if (isBooleanAttr(key)) {\n      // set attribute for blank value\n      // e.g. <option disabled>Select one</option>\n      if (isFalsyAttrValue(value)) {\n        el.removeAttribute(key);\n      } else {\n        // technically allowfullscreen is a boolean attribute for <iframe>,\n        // but Flash expects a value of \"true\" when used on <embed> tag\n        value = key === 'allowfullscreen' && el.tagName === 'EMBED'\n          ? 'true'\n          : key;\n        el.setAttribute(key, value);\n      }\n    } else if (isEnumeratedAttr(key)) {\n      el.setAttribute(key, convertEnumeratedValue(key, value));\n    } else if (isXlink(key)) {\n      if (isFalsyAttrValue(value)) {\n        el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else {\n        el.setAttributeNS(xlinkNS, key, value);\n      }\n    } else {\n      baseSetAttr(el, key, value);\n    }\n  }\n\n  function baseSetAttr (el, key, value) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      // #7138: IE10 & 11 fires input event when setting placeholder on\n      // <textarea>... block the first input event and remove the blocker\n      // immediately.\n      /* istanbul ignore if */\n      if (\n        isIE && !isIE9 &&\n        el.tagName === 'TEXTAREA' &&\n        key === 'placeholder' && value !== '' && !el.__ieph\n      ) {\n        var blocker = function (e) {\n          e.stopImmediatePropagation();\n          el.removeEventListener('input', blocker);\n        };\n        el.addEventListener('input', blocker);\n        // $flow-disable-line\n        el.__ieph = true; /* IE placeholder patched */\n      }\n      el.setAttribute(key, value);\n    }\n  }\n\n  var attrs = {\n    create: updateAttrs,\n    update: updateAttrs\n  };\n\n  /*  */\n\n  function updateClass (oldVnode, vnode) {\n    var el = vnode.elm;\n    var data = vnode.data;\n    var oldData = oldVnode.data;\n    if (\n      isUndef(data.staticClass) &&\n      isUndef(data.class) && (\n        isUndef(oldData) || (\n          isUndef(oldData.staticClass) &&\n          isUndef(oldData.class)\n        )\n      )\n    ) {\n      return\n    }\n\n    var cls = genClassForVnode(vnode);\n\n    // handle transition classes\n    var transitionClass = el._transitionClasses;\n    if (isDef(transitionClass)) {\n      cls = concat(cls, stringifyClass(transitionClass));\n    }\n\n    // set the class\n    if (cls !== el._prevClass) {\n      el.setAttribute('class', cls);\n      el._prevClass = cls;\n    }\n  }\n\n  var klass = {\n    create: updateClass,\n    update: updateClass\n  };\n\n  /*  */\n\n  var validDivisionCharRE = /[\\w).+\\-_$\\]]/;\n\n  function parseFilters (exp) {\n    var inSingle = false;\n    var inDouble = false;\n    var inTemplateString = false;\n    var inRegex = false;\n    var curly = 0;\n    var square = 0;\n    var paren = 0;\n    var lastFilterIndex = 0;\n    var c, prev, i, expression, filters;\n\n    for (i = 0; i < exp.length; i++) {\n      prev = c;\n      c = exp.charCodeAt(i);\n      if (inSingle) {\n        if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n      } else if (inDouble) {\n        if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n      } else if (inTemplateString) {\n        if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n      } else if (inRegex) {\n        if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n      } else if (\n        c === 0x7C && // pipe\n        exp.charCodeAt(i + 1) !== 0x7C &&\n        exp.charCodeAt(i - 1) !== 0x7C &&\n        !curly && !square && !paren\n      ) {\n        if (expression === undefined) {\n          // first filter, end of expression\n          lastFilterIndex = i + 1;\n          expression = exp.slice(0, i).trim();\n        } else {\n          pushFilter();\n        }\n      } else {\n        switch (c) {\n          case 0x22: inDouble = true; break         // \"\n          case 0x27: inSingle = true; break         // '\n          case 0x60: inTemplateString = true; break // `\n          case 0x28: paren++; break                 // (\n          case 0x29: paren--; break                 // )\n          case 0x5B: square++; break                // [\n          case 0x5D: square--; break                // ]\n          case 0x7B: curly++; break                 // {\n          case 0x7D: curly--; break                 // }\n        }\n        if (c === 0x2f) { // /\n          var j = i - 1;\n          var p = (void 0);\n          // find first non-whitespace prev char\n          for (; j >= 0; j--) {\n            p = exp.charAt(j);\n            if (p !== ' ') { break }\n          }\n          if (!p || !validDivisionCharRE.test(p)) {\n            inRegex = true;\n          }\n        }\n      }\n    }\n\n    if (expression === undefined) {\n      expression = exp.slice(0, i).trim();\n    } else if (lastFilterIndex !== 0) {\n      pushFilter();\n    }\n\n    function pushFilter () {\n      (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n      lastFilterIndex = i + 1;\n    }\n\n    if (filters) {\n      for (i = 0; i < filters.length; i++) {\n        expression = wrapFilter(expression, filters[i]);\n      }\n    }\n\n    return expression\n  }\n\n  function wrapFilter (exp, filter) {\n    var i = filter.indexOf('(');\n    if (i < 0) {\n      // _f: resolveFilter\n      return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n    } else {\n      var name = filter.slice(0, i);\n      var args = filter.slice(i + 1);\n      return (\"_f(\\\"\" + name + \"\\\")(\" + exp + (args !== ')' ? ',' + args : args))\n    }\n  }\n\n  /*  */\n\n\n\n  /* eslint-disable no-unused-vars */\n  function baseWarn (msg, range) {\n    console.error((\"[Vue compiler]: \" + msg));\n  }\n  /* eslint-enable no-unused-vars */\n\n  function pluckModuleFunction (\n    modules,\n    key\n  ) {\n    return modules\n      ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n      : []\n  }\n\n  function addProp (el, name, value, range, dynamic) {\n    (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));\n    el.plain = false;\n  }\n\n  function addAttr (el, name, value, range, dynamic) {\n    var attrs = dynamic\n      ? (el.dynamicAttrs || (el.dynamicAttrs = []))\n      : (el.attrs || (el.attrs = []));\n    attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));\n    el.plain = false;\n  }\n\n  // add a raw attr (use this in preTransforms)\n  function addRawAttr (el, name, value, range) {\n    el.attrsMap[name] = value;\n    el.attrsList.push(rangeSetItem({ name: name, value: value }, range));\n  }\n\n  function addDirective (\n    el,\n    name,\n    rawName,\n    value,\n    arg,\n    isDynamicArg,\n    modifiers,\n    range\n  ) {\n    (el.directives || (el.directives = [])).push(rangeSetItem({\n      name: name,\n      rawName: rawName,\n      value: value,\n      arg: arg,\n      isDynamicArg: isDynamicArg,\n      modifiers: modifiers\n    }, range));\n    el.plain = false;\n  }\n\n  function prependModifierMarker (symbol, name, dynamic) {\n    return dynamic\n      ? (\"_p(\" + name + \",\\\"\" + symbol + \"\\\")\")\n      : symbol + name // mark the event as captured\n  }\n\n  function addHandler (\n    el,\n    name,\n    value,\n    modifiers,\n    important,\n    warn,\n    range,\n    dynamic\n  ) {\n    modifiers = modifiers || emptyObject;\n    // warn prevent and passive modifier\n    /* istanbul ignore if */\n    if (\n      warn &&\n      modifiers.prevent && modifiers.passive\n    ) {\n      warn(\n        'passive and prevent can\\'t be used together. ' +\n        'Passive handler can\\'t prevent default event.',\n        range\n      );\n    }\n\n    // normalize click.right and click.middle since they don't actually fire\n    // this is technically browser-specific, but at least for now browsers are\n    // the only target envs that have right/middle clicks.\n    if (modifiers.right) {\n      if (dynamic) {\n        name = \"(\" + name + \")==='click'?'contextmenu':(\" + name + \")\";\n      } else if (name === 'click') {\n        name = 'contextmenu';\n        delete modifiers.right;\n      }\n    } else if (modifiers.middle) {\n      if (dynamic) {\n        name = \"(\" + name + \")==='click'?'mouseup':(\" + name + \")\";\n      } else if (name === 'click') {\n        name = 'mouseup';\n      }\n    }\n\n    // check capture modifier\n    if (modifiers.capture) {\n      delete modifiers.capture;\n      name = prependModifierMarker('!', name, dynamic);\n    }\n    if (modifiers.once) {\n      delete modifiers.once;\n      name = prependModifierMarker('~', name, dynamic);\n    }\n    /* istanbul ignore if */\n    if (modifiers.passive) {\n      delete modifiers.passive;\n      name = prependModifierMarker('&', name, dynamic);\n    }\n\n    var events;\n    if (modifiers.native) {\n      delete modifiers.native;\n      events = el.nativeEvents || (el.nativeEvents = {});\n    } else {\n      events = el.events || (el.events = {});\n    }\n\n    var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);\n    if (modifiers !== emptyObject) {\n      newHandler.modifiers = modifiers;\n    }\n\n    var handlers = events[name];\n    /* istanbul ignore if */\n    if (Array.isArray(handlers)) {\n      important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n    } else if (handlers) {\n      events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n    } else {\n      events[name] = newHandler;\n    }\n\n    el.plain = false;\n  }\n\n  function getRawBindingAttr (\n    el,\n    name\n  ) {\n    return el.rawAttrsMap[':' + name] ||\n      el.rawAttrsMap['v-bind:' + name] ||\n      el.rawAttrsMap[name]\n  }\n\n  function getBindingAttr (\n    el,\n    name,\n    getStatic\n  ) {\n    var dynamicValue =\n      getAndRemoveAttr(el, ':' + name) ||\n      getAndRemoveAttr(el, 'v-bind:' + name);\n    if (dynamicValue != null) {\n      return parseFilters(dynamicValue)\n    } else if (getStatic !== false) {\n      var staticValue = getAndRemoveAttr(el, name);\n      if (staticValue != null) {\n        return JSON.stringify(staticValue)\n      }\n    }\n  }\n\n  // note: this only removes the attr from the Array (attrsList) so that it\n  // doesn't get processed by processAttrs.\n  // By default it does NOT remove it from the map (attrsMap) because the map is\n  // needed during codegen.\n  function getAndRemoveAttr (\n    el,\n    name,\n    removeFromMap\n  ) {\n    var val;\n    if ((val = el.attrsMap[name]) != null) {\n      var list = el.attrsList;\n      for (var i = 0, l = list.length; i < l; i++) {\n        if (list[i].name === name) {\n          list.splice(i, 1);\n          break\n        }\n      }\n    }\n    if (removeFromMap) {\n      delete el.attrsMap[name];\n    }\n    return val\n  }\n\n  function getAndRemoveAttrByRegex (\n    el,\n    name\n  ) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      var attr = list[i];\n      if (name.test(attr.name)) {\n        list.splice(i, 1);\n        return attr\n      }\n    }\n  }\n\n  function rangeSetItem (\n    item,\n    range\n  ) {\n    if (range) {\n      if (range.start != null) {\n        item.start = range.start;\n      }\n      if (range.end != null) {\n        item.end = range.end;\n      }\n    }\n    return item\n  }\n\n  /*  */\n\n  /**\n   * Cross-platform code generation for component v-model\n   */\n  function genComponentModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var ref = modifiers || {};\n    var number = ref.number;\n    var trim = ref.trim;\n\n    var baseValueExpression = '$$v';\n    var valueExpression = baseValueExpression;\n    if (trim) {\n      valueExpression =\n        \"(typeof \" + baseValueExpression + \" === 'string'\" +\n        \"? \" + baseValueExpression + \".trim()\" +\n        \": \" + baseValueExpression + \")\";\n    }\n    if (number) {\n      valueExpression = \"_n(\" + valueExpression + \")\";\n    }\n    var assignment = genAssignmentCode(value, valueExpression);\n\n    el.model = {\n      value: (\"(\" + value + \")\"),\n      expression: JSON.stringify(value),\n      callback: (\"function (\" + baseValueExpression + \") {\" + assignment + \"}\")\n    };\n  }\n\n  /**\n   * Cross-platform codegen helper for generating v-model value assignment code.\n   */\n  function genAssignmentCode (\n    value,\n    assignment\n  ) {\n    var res = parseModel(value);\n    if (res.key === null) {\n      return (value + \"=\" + assignment)\n    } else {\n      return (\"$set(\" + (res.exp) + \", \" + (res.key) + \", \" + assignment + \")\")\n    }\n  }\n\n  /**\n   * Parse a v-model expression into a base path and a final key segment.\n   * Handles both dot-path and possible square brackets.\n   *\n   * Possible cases:\n   *\n   * - test\n   * - test[key]\n   * - test[test1[key]]\n   * - test[\"a\"][key]\n   * - xxx.test[a[a].test1[key]]\n   * - test.xxx.a[\"asa\"][test1[key]]\n   *\n   */\n\n  var len, str, chr, index$1, expressionPos, expressionEndPos;\n\n\n\n  function parseModel (val) {\n    // Fix https://github.com/vuejs/vue/pull/7730\n    // allow v-model=\"obj.val \" (trailing whitespace)\n    val = val.trim();\n    len = val.length;\n\n    if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n      index$1 = val.lastIndexOf('.');\n      if (index$1 > -1) {\n        return {\n          exp: val.slice(0, index$1),\n          key: '\"' + val.slice(index$1 + 1) + '\"'\n        }\n      } else {\n        return {\n          exp: val,\n          key: null\n        }\n      }\n    }\n\n    str = val;\n    index$1 = expressionPos = expressionEndPos = 0;\n\n    while (!eof()) {\n      chr = next();\n      /* istanbul ignore if */\n      if (isStringStart(chr)) {\n        parseString(chr);\n      } else if (chr === 0x5B) {\n        parseBracket(chr);\n      }\n    }\n\n    return {\n      exp: val.slice(0, expressionPos),\n      key: val.slice(expressionPos + 1, expressionEndPos)\n    }\n  }\n\n  function next () {\n    return str.charCodeAt(++index$1)\n  }\n\n  function eof () {\n    return index$1 >= len\n  }\n\n  function isStringStart (chr) {\n    return chr === 0x22 || chr === 0x27\n  }\n\n  function parseBracket (chr) {\n    var inBracket = 1;\n    expressionPos = index$1;\n    while (!eof()) {\n      chr = next();\n      if (isStringStart(chr)) {\n        parseString(chr);\n        continue\n      }\n      if (chr === 0x5B) { inBracket++; }\n      if (chr === 0x5D) { inBracket--; }\n      if (inBracket === 0) {\n        expressionEndPos = index$1;\n        break\n      }\n    }\n  }\n\n  function parseString (chr) {\n    var stringQuote = chr;\n    while (!eof()) {\n      chr = next();\n      if (chr === stringQuote) {\n        break\n      }\n    }\n  }\n\n  /*  */\n\n  var warn$1;\n\n  // in some cases, the event used has to be determined at runtime\n  // so we used some reserved tokens during compile.\n  var RANGE_TOKEN = '__r';\n  var CHECKBOX_RADIO_TOKEN = '__c';\n\n  function model (\n    el,\n    dir,\n    _warn\n  ) {\n    warn$1 = _warn;\n    var value = dir.value;\n    var modifiers = dir.modifiers;\n    var tag = el.tag;\n    var type = el.attrsMap.type;\n\n    {\n      // inputs with type=\"file\" are read only and setting the input's\n      // value will throw an error.\n      if (tag === 'input' && type === 'file') {\n        warn$1(\n          \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n          \"File inputs are read only. Use a v-on:change listener instead.\",\n          el.rawAttrsMap['v-model']\n        );\n      }\n    }\n\n    if (el.component) {\n      genComponentModel(el, value, modifiers);\n      // component v-model doesn't need extra runtime\n      return false\n    } else if (tag === 'select') {\n      genSelect(el, value, modifiers);\n    } else if (tag === 'input' && type === 'checkbox') {\n      genCheckboxModel(el, value, modifiers);\n    } else if (tag === 'input' && type === 'radio') {\n      genRadioModel(el, value, modifiers);\n    } else if (tag === 'input' || tag === 'textarea') {\n      genDefaultModel(el, value, modifiers);\n    } else if (!config.isReservedTag(tag)) {\n      genComponentModel(el, value, modifiers);\n      // component v-model doesn't need extra runtime\n      return false\n    } else {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"v-model is not supported on this element type. \" +\n        'If you are working with contenteditable, it\\'s recommended to ' +\n        'wrap a library dedicated for that purpose inside a custom component.',\n        el.rawAttrsMap['v-model']\n      );\n    }\n\n    // ensure runtime directive metadata\n    return true\n  }\n\n  function genCheckboxModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var valueBinding = getBindingAttr(el, 'value') || 'null';\n    var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n    var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n    addProp(el, 'checked',\n      \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" + (\n        trueValueBinding === 'true'\n          ? (\":(\" + value + \")\")\n          : (\":_q(\" + value + \",\" + trueValueBinding + \")\")\n      )\n    );\n    addHandler(el, 'change',\n      \"var $$a=\" + value + \",\" +\n          '$$el=$event.target,' +\n          \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n      'if(Array.isArray($$a)){' +\n        \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n            '$$i=_i($$a,$$v);' +\n        \"if($$el.checked){$$i<0&&(\" + (genAssignmentCode(value, '$$a.concat([$$v])')) + \")}\" +\n        \"else{$$i>-1&&(\" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + \")}\" +\n      \"}else{\" + (genAssignmentCode(value, '$$c')) + \"}\",\n      null, true\n    );\n  }\n\n  function genRadioModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var valueBinding = getBindingAttr(el, 'value') || 'null';\n    valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n    addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n    addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n  }\n\n  function genSelect (\n    el,\n    value,\n    modifiers\n  ) {\n    var number = modifiers && modifiers.number;\n    var selectedVal = \"Array.prototype.filter\" +\n      \".call($event.target.options,function(o){return o.selected})\" +\n      \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n      \"return \" + (number ? '_n(val)' : 'val') + \"})\";\n\n    var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';\n    var code = \"var $$selectedVal = \" + selectedVal + \";\";\n    code = code + \" \" + (genAssignmentCode(value, assignment));\n    addHandler(el, 'change', code, null, true);\n  }\n\n  function genDefaultModel (\n    el,\n    value,\n    modifiers\n  ) {\n    var type = el.attrsMap.type;\n\n    // warn if v-bind:value conflicts with v-model\n    // except for inputs with v-bind:type\n    {\n      var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];\n      var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n      if (value$1 && !typeBinding) {\n        var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';\n        warn$1(\n          binding + \"=\\\"\" + value$1 + \"\\\" conflicts with v-model on the same element \" +\n          'because the latter already expands to a value binding internally',\n          el.rawAttrsMap[binding]\n        );\n      }\n    }\n\n    var ref = modifiers || {};\n    var lazy = ref.lazy;\n    var number = ref.number;\n    var trim = ref.trim;\n    var needCompositionGuard = !lazy && type !== 'range';\n    var event = lazy\n      ? 'change'\n      : type === 'range'\n        ? RANGE_TOKEN\n        : 'input';\n\n    var valueExpression = '$event.target.value';\n    if (trim) {\n      valueExpression = \"$event.target.value.trim()\";\n    }\n    if (number) {\n      valueExpression = \"_n(\" + valueExpression + \")\";\n    }\n\n    var code = genAssignmentCode(value, valueExpression);\n    if (needCompositionGuard) {\n      code = \"if($event.target.composing)return;\" + code;\n    }\n\n    addProp(el, 'value', (\"(\" + value + \")\"));\n    addHandler(el, event, code, null, true);\n    if (trim || number) {\n      addHandler(el, 'blur', '$forceUpdate()');\n    }\n  }\n\n  /*  */\n\n  // normalize v-model event tokens that can only be determined at runtime.\n  // it's important to place the event as the first in the array because\n  // the whole point is ensuring the v-model callback gets called before\n  // user-attached handlers.\n  function normalizeEvents (on) {\n    /* istanbul ignore if */\n    if (isDef(on[RANGE_TOKEN])) {\n      // IE input[type=range] only supports `change` event\n      var event = isIE ? 'change' : 'input';\n      on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);\n      delete on[RANGE_TOKEN];\n    }\n    // This was originally intended to fix #4521 but no longer necessary\n    // after 2.5. Keeping it for backwards compat with generated code from < 2.4\n    /* istanbul ignore if */\n    if (isDef(on[CHECKBOX_RADIO_TOKEN])) {\n      on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);\n      delete on[CHECKBOX_RADIO_TOKEN];\n    }\n  }\n\n  var target$1;\n\n  function createOnceHandler$1 (event, handler, capture) {\n    var _target = target$1; // save current target element in closure\n    return function onceHandler () {\n      var res = handler.apply(null, arguments);\n      if (res !== null) {\n        remove$2(event, onceHandler, capture, _target);\n      }\n    }\n  }\n\n  // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp\n  // implementation and does not fire microtasks in between event propagation, so\n  // safe to exclude.\n  var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);\n\n  function add$1 (\n    name,\n    handler,\n    capture,\n    passive\n  ) {\n    // async edge case #6566: inner click event triggers patch, event handler\n    // attached to outer element during patch, and triggered again. This\n    // happens because browsers fire microtask ticks between event propagation.\n    // the solution is simple: we save the timestamp when a handler is attached,\n    // and the handler would only fire if the event passed to it was fired\n    // AFTER it was attached.\n    if (useMicrotaskFix) {\n      var attachedTimestamp = currentFlushTimestamp;\n      var original = handler;\n      handler = original._wrapper = function (e) {\n        if (\n          // no bubbling, should always fire.\n          // this is just a safety net in case event.timeStamp is unreliable in\n          // certain weird environments...\n          e.target === e.currentTarget ||\n          // event is fired after handler attachment\n          e.timeStamp >= attachedTimestamp ||\n          // #9462 bail for iOS 9 bug: event.timeStamp is 0 after history.pushState\n          e.timeStamp === 0 ||\n          // #9448 bail if event is fired in another document in a multi-page\n          // electron/nw.js app, since event.timeStamp will be using a different\n          // starting reference\n          e.target.ownerDocument !== document\n        ) {\n          return original.apply(this, arguments)\n        }\n      };\n    }\n    target$1.addEventListener(\n      name,\n      handler,\n      supportsPassive\n        ? { capture: capture, passive: passive }\n        : capture\n    );\n  }\n\n  function remove$2 (\n    name,\n    handler,\n    capture,\n    _target\n  ) {\n    (_target || target$1).removeEventListener(\n      name,\n      handler._wrapper || handler,\n      capture\n    );\n  }\n\n  function updateDOMListeners (oldVnode, vnode) {\n    if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {\n      return\n    }\n    var on = vnode.data.on || {};\n    var oldOn = oldVnode.data.on || {};\n    target$1 = vnode.elm;\n    normalizeEvents(on);\n    updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);\n    target$1 = undefined;\n  }\n\n  var events = {\n    create: updateDOMListeners,\n    update: updateDOMListeners\n  };\n\n  /*  */\n\n  var svgContainer;\n\n  function updateDOMProps (oldVnode, vnode) {\n    if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {\n      return\n    }\n    var key, cur;\n    var elm = vnode.elm;\n    var oldProps = oldVnode.data.domProps || {};\n    var props = vnode.data.domProps || {};\n    // clone observed objects, as the user probably wants to mutate it\n    if (isDef(props.__ob__)) {\n      props = vnode.data.domProps = extend({}, props);\n    }\n\n    for (key in oldProps) {\n      if (isUndef(props[key])) {\n        elm[key] = '';\n      }\n    }\n    for (key in props) {\n      cur = props[key];\n      // ignore children if the node has textContent or innerHTML,\n      // as these will throw away existing DOM nodes and cause removal errors\n      // on subsequent patches (#3360)\n      if (key === 'textContent' || key === 'innerHTML') {\n        if (vnode.children) { vnode.children.length = 0; }\n        if (cur === oldProps[key]) { continue }\n        // #6601 work around Chrome version <= 55 bug where single textNode\n        // replaced by innerHTML/textContent retains its parentNode property\n        if (elm.childNodes.length === 1) {\n          elm.removeChild(elm.childNodes[0]);\n        }\n      }\n\n      if (key === 'value' && elm.tagName !== 'PROGRESS') {\n        // store value as _value as well since\n        // non-string values will be stringified\n        elm._value = cur;\n        // avoid resetting cursor position when value is the same\n        var strCur = isUndef(cur) ? '' : String(cur);\n        if (shouldUpdateValue(elm, strCur)) {\n          elm.value = strCur;\n        }\n      } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {\n        // IE doesn't support innerHTML for SVG elements\n        svgContainer = svgContainer || document.createElement('div');\n        svgContainer.innerHTML = \"<svg>\" + cur + \"</svg>\";\n        var svg = svgContainer.firstChild;\n        while (elm.firstChild) {\n          elm.removeChild(elm.firstChild);\n        }\n        while (svg.firstChild) {\n          elm.appendChild(svg.firstChild);\n        }\n      } else if (\n        // skip the update if old and new VDOM state is the same.\n        // `value` is handled separately because the DOM value may be temporarily\n        // out of sync with VDOM state due to focus, composition and modifiers.\n        // This  #4521 by skipping the unnecesarry `checked` update.\n        cur !== oldProps[key]\n      ) {\n        // some property updates can throw\n        // e.g. `value` on <progress> w/ non-finite value\n        try {\n          elm[key] = cur;\n        } catch (e) {}\n      }\n    }\n  }\n\n  // check platforms/web/util/attrs.js acceptValue\n\n\n  function shouldUpdateValue (elm, checkVal) {\n    return (!elm.composing && (\n      elm.tagName === 'OPTION' ||\n      isNotInFocusAndDirty(elm, checkVal) ||\n      isDirtyWithModifiers(elm, checkVal)\n    ))\n  }\n\n  function isNotInFocusAndDirty (elm, checkVal) {\n    // return true when textbox (.number and .trim) loses focus and its value is\n    // not equal to the updated value\n    var notInFocus = true;\n    // #6157\n    // work around IE bug when accessing document.activeElement in an iframe\n    try { notInFocus = document.activeElement !== elm; } catch (e) {}\n    return notInFocus && elm.value !== checkVal\n  }\n\n  function isDirtyWithModifiers (elm, newVal) {\n    var value = elm.value;\n    var modifiers = elm._vModifiers; // injected by v-model runtime\n    if (isDef(modifiers)) {\n      if (modifiers.number) {\n        return toNumber(value) !== toNumber(newVal)\n      }\n      if (modifiers.trim) {\n        return value.trim() !== newVal.trim()\n      }\n    }\n    return value !== newVal\n  }\n\n  var domProps = {\n    create: updateDOMProps,\n    update: updateDOMProps\n  };\n\n  /*  */\n\n  var parseStyleText = cached(function (cssText) {\n    var res = {};\n    var listDelimiter = /;(?![^(]*\\))/g;\n    var propertyDelimiter = /:(.+)/;\n    cssText.split(listDelimiter).forEach(function (item) {\n      if (item) {\n        var tmp = item.split(propertyDelimiter);\n        tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n      }\n    });\n    return res\n  });\n\n  // merge static and dynamic style data on the same vnode\n  function normalizeStyleData (data) {\n    var style = normalizeStyleBinding(data.style);\n    // static style is pre-processed into an object during compilation\n    // and is always a fresh object, so it's safe to merge into it\n    return data.staticStyle\n      ? extend(data.staticStyle, style)\n      : style\n  }\n\n  // normalize possible array / string values into Object\n  function normalizeStyleBinding (bindingStyle) {\n    if (Array.isArray(bindingStyle)) {\n      return toObject(bindingStyle)\n    }\n    if (typeof bindingStyle === 'string') {\n      return parseStyleText(bindingStyle)\n    }\n    return bindingStyle\n  }\n\n  /**\n   * parent component style should be after child's\n   * so that parent component's style could override it\n   */\n  function getStyle (vnode, checkChild) {\n    var res = {};\n    var styleData;\n\n    if (checkChild) {\n      var childNode = vnode;\n      while (childNode.componentInstance) {\n        childNode = childNode.componentInstance._vnode;\n        if (\n          childNode && childNode.data &&\n          (styleData = normalizeStyleData(childNode.data))\n        ) {\n          extend(res, styleData);\n        }\n      }\n    }\n\n    if ((styleData = normalizeStyleData(vnode.data))) {\n      extend(res, styleData);\n    }\n\n    var parentNode = vnode;\n    while ((parentNode = parentNode.parent)) {\n      if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n        extend(res, styleData);\n      }\n    }\n    return res\n  }\n\n  /*  */\n\n  var cssVarRE = /^--/;\n  var importantRE = /\\s*!important$/;\n  var setProp = function (el, name, val) {\n    /* istanbul ignore if */\n    if (cssVarRE.test(name)) {\n      el.style.setProperty(name, val);\n    } else if (importantRE.test(val)) {\n      el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');\n    } else {\n      var normalizedName = normalize(name);\n      if (Array.isArray(val)) {\n        // Support values array created by autoprefixer, e.g.\n        // {display: [\"-webkit-box\", \"-ms-flexbox\", \"flex\"]}\n        // Set them one by one, and the browser will only set those it can recognize\n        for (var i = 0, len = val.length; i < len; i++) {\n          el.style[normalizedName] = val[i];\n        }\n      } else {\n        el.style[normalizedName] = val;\n      }\n    }\n  };\n\n  var vendorNames = ['Webkit', 'Moz', 'ms'];\n\n  var emptyStyle;\n  var normalize = cached(function (prop) {\n    emptyStyle = emptyStyle || document.createElement('div').style;\n    prop = camelize(prop);\n    if (prop !== 'filter' && (prop in emptyStyle)) {\n      return prop\n    }\n    var capName = prop.charAt(0).toUpperCase() + prop.slice(1);\n    for (var i = 0; i < vendorNames.length; i++) {\n      var name = vendorNames[i] + capName;\n      if (name in emptyStyle) {\n        return name\n      }\n    }\n  });\n\n  function updateStyle (oldVnode, vnode) {\n    var data = vnode.data;\n    var oldData = oldVnode.data;\n\n    if (isUndef(data.staticStyle) && isUndef(data.style) &&\n      isUndef(oldData.staticStyle) && isUndef(oldData.style)\n    ) {\n      return\n    }\n\n    var cur, name;\n    var el = vnode.elm;\n    var oldStaticStyle = oldData.staticStyle;\n    var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};\n\n    // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n    var oldStyle = oldStaticStyle || oldStyleBinding;\n\n    var style = normalizeStyleBinding(vnode.data.style) || {};\n\n    // store normalized style under a different key for next diff\n    // make sure to clone it if it's reactive, since the user likely wants\n    // to mutate it.\n    vnode.data.normalizedStyle = isDef(style.__ob__)\n      ? extend({}, style)\n      : style;\n\n    var newStyle = getStyle(vnode, true);\n\n    for (name in oldStyle) {\n      if (isUndef(newStyle[name])) {\n        setProp(el, name, '');\n      }\n    }\n    for (name in newStyle) {\n      cur = newStyle[name];\n      if (cur !== oldStyle[name]) {\n        // ie9 setting to null has no effect, must use empty string\n        setProp(el, name, cur == null ? '' : cur);\n      }\n    }\n  }\n\n  var style = {\n    create: updateStyle,\n    update: updateStyle\n  };\n\n  /*  */\n\n  var whitespaceRE = /\\s+/;\n\n  /**\n   * Add class with compatibility for SVG since classList is not supported on\n   * SVG elements in IE\n   */\n  function addClass (el, cls) {\n    /* istanbul ignore if */\n    if (!cls || !(cls = cls.trim())) {\n      return\n    }\n\n    /* istanbul ignore else */\n    if (el.classList) {\n      if (cls.indexOf(' ') > -1) {\n        cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });\n      } else {\n        el.classList.add(cls);\n      }\n    } else {\n      var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n      if (cur.indexOf(' ' + cls + ' ') < 0) {\n        el.setAttribute('class', (cur + cls).trim());\n      }\n    }\n  }\n\n  /**\n   * Remove class with compatibility for SVG since classList is not supported on\n   * SVG elements in IE\n   */\n  function removeClass (el, cls) {\n    /* istanbul ignore if */\n    if (!cls || !(cls = cls.trim())) {\n      return\n    }\n\n    /* istanbul ignore else */\n    if (el.classList) {\n      if (cls.indexOf(' ') > -1) {\n        cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });\n      } else {\n        el.classList.remove(cls);\n      }\n      if (!el.classList.length) {\n        el.removeAttribute('class');\n      }\n    } else {\n      var cur = \" \" + (el.getAttribute('class') || '') + \" \";\n      var tar = ' ' + cls + ' ';\n      while (cur.indexOf(tar) >= 0) {\n        cur = cur.replace(tar, ' ');\n      }\n      cur = cur.trim();\n      if (cur) {\n        el.setAttribute('class', cur);\n      } else {\n        el.removeAttribute('class');\n      }\n    }\n  }\n\n  /*  */\n\n  function resolveTransition (def$$1) {\n    if (!def$$1) {\n      return\n    }\n    /* istanbul ignore else */\n    if (typeof def$$1 === 'object') {\n      var res = {};\n      if (def$$1.css !== false) {\n        extend(res, autoCssTransition(def$$1.name || 'v'));\n      }\n      extend(res, def$$1);\n      return res\n    } else if (typeof def$$1 === 'string') {\n      return autoCssTransition(def$$1)\n    }\n  }\n\n  var autoCssTransition = cached(function (name) {\n    return {\n      enterClass: (name + \"-enter\"),\n      enterToClass: (name + \"-enter-to\"),\n      enterActiveClass: (name + \"-enter-active\"),\n      leaveClass: (name + \"-leave\"),\n      leaveToClass: (name + \"-leave-to\"),\n      leaveActiveClass: (name + \"-leave-active\")\n    }\n  });\n\n  var hasTransition = inBrowser && !isIE9;\n  var TRANSITION = 'transition';\n  var ANIMATION = 'animation';\n\n  // Transition property/event sniffing\n  var transitionProp = 'transition';\n  var transitionEndEvent = 'transitionend';\n  var animationProp = 'animation';\n  var animationEndEvent = 'animationend';\n  if (hasTransition) {\n    /* istanbul ignore if */\n    if (window.ontransitionend === undefined &&\n      window.onwebkittransitionend !== undefined\n    ) {\n      transitionProp = 'WebkitTransition';\n      transitionEndEvent = 'webkitTransitionEnd';\n    }\n    if (window.onanimationend === undefined &&\n      window.onwebkitanimationend !== undefined\n    ) {\n      animationProp = 'WebkitAnimation';\n      animationEndEvent = 'webkitAnimationEnd';\n    }\n  }\n\n  // binding to window is necessary to make hot reload work in IE in strict mode\n  var raf = inBrowser\n    ? window.requestAnimationFrame\n      ? window.requestAnimationFrame.bind(window)\n      : setTimeout\n    : /* istanbul ignore next */ function (fn) { return fn(); };\n\n  function nextFrame (fn) {\n    raf(function () {\n      raf(fn);\n    });\n  }\n\n  function addTransitionClass (el, cls) {\n    var transitionClasses = el._transitionClasses || (el._transitionClasses = []);\n    if (transitionClasses.indexOf(cls) < 0) {\n      transitionClasses.push(cls);\n      addClass(el, cls);\n    }\n  }\n\n  function removeTransitionClass (el, cls) {\n    if (el._transitionClasses) {\n      remove(el._transitionClasses, cls);\n    }\n    removeClass(el, cls);\n  }\n\n  function whenTransitionEnds (\n    el,\n    expectedType,\n    cb\n  ) {\n    var ref = getTransitionInfo(el, expectedType);\n    var type = ref.type;\n    var timeout = ref.timeout;\n    var propCount = ref.propCount;\n    if (!type) { return cb() }\n    var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n    var ended = 0;\n    var end = function () {\n      el.removeEventListener(event, onEnd);\n      cb();\n    };\n    var onEnd = function (e) {\n      if (e.target === el) {\n        if (++ended >= propCount) {\n          end();\n        }\n      }\n    };\n    setTimeout(function () {\n      if (ended < propCount) {\n        end();\n      }\n    }, timeout + 1);\n    el.addEventListener(event, onEnd);\n  }\n\n  var transformRE = /\\b(transform|all)(,|$)/;\n\n  function getTransitionInfo (el, expectedType) {\n    var styles = window.getComputedStyle(el);\n    // JSDOM may return undefined for transition properties\n    var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');\n    var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');\n    var transitionTimeout = getTimeout(transitionDelays, transitionDurations);\n    var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');\n    var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');\n    var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n    var type;\n    var timeout = 0;\n    var propCount = 0;\n    /* istanbul ignore if */\n    if (expectedType === TRANSITION) {\n      if (transitionTimeout > 0) {\n        type = TRANSITION;\n        timeout = transitionTimeout;\n        propCount = transitionDurations.length;\n      }\n    } else if (expectedType === ANIMATION) {\n      if (animationTimeout > 0) {\n        type = ANIMATION;\n        timeout = animationTimeout;\n        propCount = animationDurations.length;\n      }\n    } else {\n      timeout = Math.max(transitionTimeout, animationTimeout);\n      type = timeout > 0\n        ? transitionTimeout > animationTimeout\n          ? TRANSITION\n          : ANIMATION\n        : null;\n      propCount = type\n        ? type === TRANSITION\n          ? transitionDurations.length\n          : animationDurations.length\n        : 0;\n    }\n    var hasTransform =\n      type === TRANSITION &&\n      transformRE.test(styles[transitionProp + 'Property']);\n    return {\n      type: type,\n      timeout: timeout,\n      propCount: propCount,\n      hasTransform: hasTransform\n    }\n  }\n\n  function getTimeout (delays, durations) {\n    /* istanbul ignore next */\n    while (delays.length < durations.length) {\n      delays = delays.concat(delays);\n    }\n\n    return Math.max.apply(null, durations.map(function (d, i) {\n      return toMs(d) + toMs(delays[i])\n    }))\n  }\n\n  // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers\n  // in a locale-dependent way, using a comma instead of a dot.\n  // If comma is not replaced with a dot, the input will be rounded down (i.e. acting\n  // as a floor function) causing unexpected behaviors\n  function toMs (s) {\n    return Number(s.slice(0, -1).replace(',', '.')) * 1000\n  }\n\n  /*  */\n\n  function enter (vnode, toggleDisplay) {\n    var el = vnode.elm;\n\n    // call leave callback now\n    if (isDef(el._leaveCb)) {\n      el._leaveCb.cancelled = true;\n      el._leaveCb();\n    }\n\n    var data = resolveTransition(vnode.data.transition);\n    if (isUndef(data)) {\n      return\n    }\n\n    /* istanbul ignore if */\n    if (isDef(el._enterCb) || el.nodeType !== 1) {\n      return\n    }\n\n    var css = data.css;\n    var type = data.type;\n    var enterClass = data.enterClass;\n    var enterToClass = data.enterToClass;\n    var enterActiveClass = data.enterActiveClass;\n    var appearClass = data.appearClass;\n    var appearToClass = data.appearToClass;\n    var appearActiveClass = data.appearActiveClass;\n    var beforeEnter = data.beforeEnter;\n    var enter = data.enter;\n    var afterEnter = data.afterEnter;\n    var enterCancelled = data.enterCancelled;\n    var beforeAppear = data.beforeAppear;\n    var appear = data.appear;\n    var afterAppear = data.afterAppear;\n    var appearCancelled = data.appearCancelled;\n    var duration = data.duration;\n\n    // activeInstance will always be the <transition> component managing this\n    // transition. One edge case to check is when the <transition> is placed\n    // as the root node of a child component. In that case we need to check\n    // <transition>'s parent for appear check.\n    var context = activeInstance;\n    var transitionNode = activeInstance.$vnode;\n    while (transitionNode && transitionNode.parent) {\n      transitionNode = transitionNode.parent;\n      context = transitionNode.context;\n    }\n\n    var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n    if (isAppear && !appear && appear !== '') {\n      return\n    }\n\n    var startClass = isAppear && appearClass\n      ? appearClass\n      : enterClass;\n    var activeClass = isAppear && appearActiveClass\n      ? appearActiveClass\n      : enterActiveClass;\n    var toClass = isAppear && appearToClass\n      ? appearToClass\n      : enterToClass;\n\n    var beforeEnterHook = isAppear\n      ? (beforeAppear || beforeEnter)\n      : beforeEnter;\n    var enterHook = isAppear\n      ? (typeof appear === 'function' ? appear : enter)\n      : enter;\n    var afterEnterHook = isAppear\n      ? (afterAppear || afterEnter)\n      : afterEnter;\n    var enterCancelledHook = isAppear\n      ? (appearCancelled || enterCancelled)\n      : enterCancelled;\n\n    var explicitEnterDuration = toNumber(\n      isObject(duration)\n        ? duration.enter\n        : duration\n    );\n\n    if (explicitEnterDuration != null) {\n      checkDuration(explicitEnterDuration, 'enter', vnode);\n    }\n\n    var expectsCSS = css !== false && !isIE9;\n    var userWantsControl = getHookArgumentsLength(enterHook);\n\n    var cb = el._enterCb = once(function () {\n      if (expectsCSS) {\n        removeTransitionClass(el, toClass);\n        removeTransitionClass(el, activeClass);\n      }\n      if (cb.cancelled) {\n        if (expectsCSS) {\n          removeTransitionClass(el, startClass);\n        }\n        enterCancelledHook && enterCancelledHook(el);\n      } else {\n        afterEnterHook && afterEnterHook(el);\n      }\n      el._enterCb = null;\n    });\n\n    if (!vnode.data.show) {\n      // remove pending leave element on enter by injecting an insert hook\n      mergeVNodeHook(vnode, 'insert', function () {\n        var parent = el.parentNode;\n        var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n        if (pendingNode &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb\n        ) {\n          pendingNode.elm._leaveCb();\n        }\n        enterHook && enterHook(el, cb);\n      });\n    }\n\n    // start enter transition\n    beforeEnterHook && beforeEnterHook(el);\n    if (expectsCSS) {\n      addTransitionClass(el, startClass);\n      addTransitionClass(el, activeClass);\n      nextFrame(function () {\n        removeTransitionClass(el, startClass);\n        if (!cb.cancelled) {\n          addTransitionClass(el, toClass);\n          if (!userWantsControl) {\n            if (isValidDuration(explicitEnterDuration)) {\n              setTimeout(cb, explicitEnterDuration);\n            } else {\n              whenTransitionEnds(el, type, cb);\n            }\n          }\n        }\n      });\n    }\n\n    if (vnode.data.show) {\n      toggleDisplay && toggleDisplay();\n      enterHook && enterHook(el, cb);\n    }\n\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n\n  function leave (vnode, rm) {\n    var el = vnode.elm;\n\n    // call enter callback now\n    if (isDef(el._enterCb)) {\n      el._enterCb.cancelled = true;\n      el._enterCb();\n    }\n\n    var data = resolveTransition(vnode.data.transition);\n    if (isUndef(data) || el.nodeType !== 1) {\n      return rm()\n    }\n\n    /* istanbul ignore if */\n    if (isDef(el._leaveCb)) {\n      return\n    }\n\n    var css = data.css;\n    var type = data.type;\n    var leaveClass = data.leaveClass;\n    var leaveToClass = data.leaveToClass;\n    var leaveActiveClass = data.leaveActiveClass;\n    var beforeLeave = data.beforeLeave;\n    var leave = data.leave;\n    var afterLeave = data.afterLeave;\n    var leaveCancelled = data.leaveCancelled;\n    var delayLeave = data.delayLeave;\n    var duration = data.duration;\n\n    var expectsCSS = css !== false && !isIE9;\n    var userWantsControl = getHookArgumentsLength(leave);\n\n    var explicitLeaveDuration = toNumber(\n      isObject(duration)\n        ? duration.leave\n        : duration\n    );\n\n    if (isDef(explicitLeaveDuration)) {\n      checkDuration(explicitLeaveDuration, 'leave', vnode);\n    }\n\n    var cb = el._leaveCb = once(function () {\n      if (el.parentNode && el.parentNode._pending) {\n        el.parentNode._pending[vnode.key] = null;\n      }\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveToClass);\n        removeTransitionClass(el, leaveActiveClass);\n      }\n      if (cb.cancelled) {\n        if (expectsCSS) {\n          removeTransitionClass(el, leaveClass);\n        }\n        leaveCancelled && leaveCancelled(el);\n      } else {\n        rm();\n        afterLeave && afterLeave(el);\n      }\n      el._leaveCb = null;\n    });\n\n    if (delayLeave) {\n      delayLeave(performLeave);\n    } else {\n      performLeave();\n    }\n\n    function performLeave () {\n      // the delayed leave may have already been cancelled\n      if (cb.cancelled) {\n        return\n      }\n      // record leaving element\n      if (!vnode.data.show && el.parentNode) {\n        (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;\n      }\n      beforeLeave && beforeLeave(el);\n      if (expectsCSS) {\n        addTransitionClass(el, leaveClass);\n        addTransitionClass(el, leaveActiveClass);\n        nextFrame(function () {\n          removeTransitionClass(el, leaveClass);\n          if (!cb.cancelled) {\n            addTransitionClass(el, leaveToClass);\n            if (!userWantsControl) {\n              if (isValidDuration(explicitLeaveDuration)) {\n                setTimeout(cb, explicitLeaveDuration);\n              } else {\n                whenTransitionEnds(el, type, cb);\n              }\n            }\n          }\n        });\n      }\n      leave && leave(el, cb);\n      if (!expectsCSS && !userWantsControl) {\n        cb();\n      }\n    }\n  }\n\n  // only used in dev mode\n  function checkDuration (val, name, vnode) {\n    if (typeof val !== 'number') {\n      warn(\n        \"<transition> explicit \" + name + \" duration is not a valid number - \" +\n        \"got \" + (JSON.stringify(val)) + \".\",\n        vnode.context\n      );\n    } else if (isNaN(val)) {\n      warn(\n        \"<transition> explicit \" + name + \" duration is NaN - \" +\n        'the duration expression might be incorrect.',\n        vnode.context\n      );\n    }\n  }\n\n  function isValidDuration (val) {\n    return typeof val === 'number' && !isNaN(val)\n  }\n\n  /**\n   * Normalize a transition hook's argument length. The hook may be:\n   * - a merged hook (invoker) with the original in .fns\n   * - a wrapped component method (check ._length)\n   * - a plain function (.length)\n   */\n  function getHookArgumentsLength (fn) {\n    if (isUndef(fn)) {\n      return false\n    }\n    var invokerFns = fn.fns;\n    if (isDef(invokerFns)) {\n      // invoker\n      return getHookArgumentsLength(\n        Array.isArray(invokerFns)\n          ? invokerFns[0]\n          : invokerFns\n      )\n    } else {\n      return (fn._length || fn.length) > 1\n    }\n  }\n\n  function _enter (_, vnode) {\n    if (vnode.data.show !== true) {\n      enter(vnode);\n    }\n  }\n\n  var transition = inBrowser ? {\n    create: _enter,\n    activate: _enter,\n    remove: function remove$$1 (vnode, rm) {\n      /* istanbul ignore else */\n      if (vnode.data.show !== true) {\n        leave(vnode, rm);\n      } else {\n        rm();\n      }\n    }\n  } : {};\n\n  var platformModules = [\n    attrs,\n    klass,\n    events,\n    domProps,\n    style,\n    transition\n  ];\n\n  /*  */\n\n  // the directive module should be applied last, after all\n  // built-in modules have been applied.\n  var modules = platformModules.concat(baseModules);\n\n  var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n  /**\n   * Not type checking this file because flow doesn't like attaching\n   * properties to Elements.\n   */\n\n  /* istanbul ignore if */\n  if (isIE9) {\n    // http://www.matts411.com/post/internet-explorer-9-oninput/\n    document.addEventListener('selectionchange', function () {\n      var el = document.activeElement;\n      if (el && el.vmodel) {\n        trigger(el, 'input');\n      }\n    });\n  }\n\n  var directive = {\n    inserted: function inserted (el, binding, vnode, oldVnode) {\n      if (vnode.tag === 'select') {\n        // #6903\n        if (oldVnode.elm && !oldVnode.elm._vOptions) {\n          mergeVNodeHook(vnode, 'postpatch', function () {\n            directive.componentUpdated(el, binding, vnode);\n          });\n        } else {\n          setSelected(el, binding, vnode.context);\n        }\n        el._vOptions = [].map.call(el.options, getValue);\n      } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {\n        el._vModifiers = binding.modifiers;\n        if (!binding.modifiers.lazy) {\n          el.addEventListener('compositionstart', onCompositionStart);\n          el.addEventListener('compositionend', onCompositionEnd);\n          // Safari < 10.2 & UIWebView doesn't fire compositionend when\n          // switching focus before confirming composition choice\n          // this also fixes the issue where some browsers e.g. iOS Chrome\n          // fires \"change\" instead of \"input\" on autocomplete.\n          el.addEventListener('change', onCompositionEnd);\n          /* istanbul ignore if */\n          if (isIE9) {\n            el.vmodel = true;\n          }\n        }\n      }\n    },\n\n    componentUpdated: function componentUpdated (el, binding, vnode) {\n      if (vnode.tag === 'select') {\n        setSelected(el, binding, vnode.context);\n        // in case the options rendered by v-for have changed,\n        // it's possible that the value is out-of-sync with the rendered options.\n        // detect such cases and filter out values that no longer has a matching\n        // option in the DOM.\n        var prevOptions = el._vOptions;\n        var curOptions = el._vOptions = [].map.call(el.options, getValue);\n        if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {\n          // trigger change event if\n          // no matching option found for at least one value\n          var needReset = el.multiple\n            ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })\n            : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);\n          if (needReset) {\n            trigger(el, 'change');\n          }\n        }\n      }\n    }\n  };\n\n  function setSelected (el, binding, vm) {\n    actuallySetSelected(el, binding, vm);\n    /* istanbul ignore if */\n    if (isIE || isEdge) {\n      setTimeout(function () {\n        actuallySetSelected(el, binding, vm);\n      }, 0);\n    }\n  }\n\n  function actuallySetSelected (el, binding, vm) {\n    var value = binding.value;\n    var isMultiple = el.multiple;\n    if (isMultiple && !Array.isArray(value)) {\n      warn(\n        \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n        \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n        vm\n      );\n      return\n    }\n    var selected, option;\n    for (var i = 0, l = el.options.length; i < l; i++) {\n      option = el.options[i];\n      if (isMultiple) {\n        selected = looseIndexOf(value, getValue(option)) > -1;\n        if (option.selected !== selected) {\n          option.selected = selected;\n        }\n      } else {\n        if (looseEqual(getValue(option), value)) {\n          if (el.selectedIndex !== i) {\n            el.selectedIndex = i;\n          }\n          return\n        }\n      }\n    }\n    if (!isMultiple) {\n      el.selectedIndex = -1;\n    }\n  }\n\n  function hasNoMatchingOption (value, options) {\n    return options.every(function (o) { return !looseEqual(o, value); })\n  }\n\n  function getValue (option) {\n    return '_value' in option\n      ? option._value\n      : option.value\n  }\n\n  function onCompositionStart (e) {\n    e.target.composing = true;\n  }\n\n  function onCompositionEnd (e) {\n    // prevent triggering an input event for no reason\n    if (!e.target.composing) { return }\n    e.target.composing = false;\n    trigger(e.target, 'input');\n  }\n\n  function trigger (el, type) {\n    var e = document.createEvent('HTMLEvents');\n    e.initEvent(type, true, true);\n    el.dispatchEvent(e);\n  }\n\n  /*  */\n\n  // recursively search for possible transition defined inside the component root\n  function locateNode (vnode) {\n    return vnode.componentInstance && (!vnode.data || !vnode.data.transition)\n      ? locateNode(vnode.componentInstance._vnode)\n      : vnode\n  }\n\n  var show = {\n    bind: function bind (el, ref, vnode) {\n      var value = ref.value;\n\n      vnode = locateNode(vnode);\n      var transition$$1 = vnode.data && vnode.data.transition;\n      var originalDisplay = el.__vOriginalDisplay =\n        el.style.display === 'none' ? '' : el.style.display;\n      if (value && transition$$1) {\n        vnode.data.show = true;\n        enter(vnode, function () {\n          el.style.display = originalDisplay;\n        });\n      } else {\n        el.style.display = value ? originalDisplay : 'none';\n      }\n    },\n\n    update: function update (el, ref, vnode) {\n      var value = ref.value;\n      var oldValue = ref.oldValue;\n\n      /* istanbul ignore if */\n      if (!value === !oldValue) { return }\n      vnode = locateNode(vnode);\n      var transition$$1 = vnode.data && vnode.data.transition;\n      if (transition$$1) {\n        vnode.data.show = true;\n        if (value) {\n          enter(vnode, function () {\n            el.style.display = el.__vOriginalDisplay;\n          });\n        } else {\n          leave(vnode, function () {\n            el.style.display = 'none';\n          });\n        }\n      } else {\n        el.style.display = value ? el.__vOriginalDisplay : 'none';\n      }\n    },\n\n    unbind: function unbind (\n      el,\n      binding,\n      vnode,\n      oldVnode,\n      isDestroy\n    ) {\n      if (!isDestroy) {\n        el.style.display = el.__vOriginalDisplay;\n      }\n    }\n  };\n\n  var platformDirectives = {\n    model: directive,\n    show: show\n  };\n\n  /*  */\n\n  var transitionProps = {\n    name: String,\n    appear: Boolean,\n    css: Boolean,\n    mode: String,\n    type: String,\n    enterClass: String,\n    leaveClass: String,\n    enterToClass: String,\n    leaveToClass: String,\n    enterActiveClass: String,\n    leaveActiveClass: String,\n    appearClass: String,\n    appearActiveClass: String,\n    appearToClass: String,\n    duration: [Number, String, Object]\n  };\n\n  // in case the child is also an abstract component, e.g. <keep-alive>\n  // we want to recursively retrieve the real component to be rendered\n  function getRealChild (vnode) {\n    var compOptions = vnode && vnode.componentOptions;\n    if (compOptions && compOptions.Ctor.options.abstract) {\n      return getRealChild(getFirstComponentChild(compOptions.children))\n    } else {\n      return vnode\n    }\n  }\n\n  function extractTransitionData (comp) {\n    var data = {};\n    var options = comp.$options;\n    // props\n    for (var key in options.propsData) {\n      data[key] = comp[key];\n    }\n    // events.\n    // extract listeners and pass them directly to the transition methods\n    var listeners = options._parentListeners;\n    for (var key$1 in listeners) {\n      data[camelize(key$1)] = listeners[key$1];\n    }\n    return data\n  }\n\n  function placeholder (h, rawChild) {\n    if (/\\d-keep-alive$/.test(rawChild.tag)) {\n      return h('keep-alive', {\n        props: rawChild.componentOptions.propsData\n      })\n    }\n  }\n\n  function hasParentTransition (vnode) {\n    while ((vnode = vnode.parent)) {\n      if (vnode.data.transition) {\n        return true\n      }\n    }\n  }\n\n  function isSameChild (child, oldChild) {\n    return oldChild.key === child.key && oldChild.tag === child.tag\n  }\n\n  var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };\n\n  var isVShowDirective = function (d) { return d.name === 'show'; };\n\n  var Transition = {\n    name: 'transition',\n    props: transitionProps,\n    abstract: true,\n\n    render: function render (h) {\n      var this$1 = this;\n\n      var children = this.$slots.default;\n      if (!children) {\n        return\n      }\n\n      // filter out text nodes (possible whitespaces)\n      children = children.filter(isNotTextNode);\n      /* istanbul ignore if */\n      if (!children.length) {\n        return\n      }\n\n      // warn multiple elements\n      if (children.length > 1) {\n        warn(\n          '<transition> can only be used on a single element. Use ' +\n          '<transition-group> for lists.',\n          this.$parent\n        );\n      }\n\n      var mode = this.mode;\n\n      // warn invalid mode\n      if (mode && mode !== 'in-out' && mode !== 'out-in'\n      ) {\n        warn(\n          'invalid <transition> mode: ' + mode,\n          this.$parent\n        );\n      }\n\n      var rawChild = children[0];\n\n      // if this is a component root node and the component's\n      // parent container node also has transition, skip.\n      if (hasParentTransition(this.$vnode)) {\n        return rawChild\n      }\n\n      // apply transition data to child\n      // use getRealChild() to ignore abstract components e.g. keep-alive\n      var child = getRealChild(rawChild);\n      /* istanbul ignore if */\n      if (!child) {\n        return rawChild\n      }\n\n      if (this._leaving) {\n        return placeholder(h, rawChild)\n      }\n\n      // ensure a key that is unique to the vnode type and to this transition\n      // component instance. This key will be used to remove pending leaving nodes\n      // during entering.\n      var id = \"__transition-\" + (this._uid) + \"-\";\n      child.key = child.key == null\n        ? child.isComment\n          ? id + 'comment'\n          : id + child.tag\n        : isPrimitive(child.key)\n          ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)\n          : child.key;\n\n      var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n      var oldRawChild = this._vnode;\n      var oldChild = getRealChild(oldRawChild);\n\n      // mark v-show\n      // so that the transition module can hand over the control to the directive\n      if (child.data.directives && child.data.directives.some(isVShowDirective)) {\n        child.data.show = true;\n      }\n\n      if (\n        oldChild &&\n        oldChild.data &&\n        !isSameChild(child, oldChild) &&\n        !isAsyncPlaceholder(oldChild) &&\n        // #6687 component root is a comment node\n        !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)\n      ) {\n        // replace old child transition data with fresh one\n        // important for dynamic transitions!\n        var oldData = oldChild.data.transition = extend({}, data);\n        // handle transition mode\n        if (mode === 'out-in') {\n          // return placeholder node and queue update when leave finishes\n          this._leaving = true;\n          mergeVNodeHook(oldData, 'afterLeave', function () {\n            this$1._leaving = false;\n            this$1.$forceUpdate();\n          });\n          return placeholder(h, rawChild)\n        } else if (mode === 'in-out') {\n          if (isAsyncPlaceholder(child)) {\n            return oldRawChild\n          }\n          var delayedLeave;\n          var performLeave = function () { delayedLeave(); };\n          mergeVNodeHook(data, 'afterEnter', performLeave);\n          mergeVNodeHook(data, 'enterCancelled', performLeave);\n          mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });\n        }\n      }\n\n      return rawChild\n    }\n  };\n\n  /*  */\n\n  var props = extend({\n    tag: String,\n    moveClass: String\n  }, transitionProps);\n\n  delete props.mode;\n\n  var TransitionGroup = {\n    props: props,\n\n    beforeMount: function beforeMount () {\n      var this$1 = this;\n\n      var update = this._update;\n      this._update = function (vnode, hydrating) {\n        var restoreActiveInstance = setActiveInstance(this$1);\n        // force removing pass\n        this$1.__patch__(\n          this$1._vnode,\n          this$1.kept,\n          false, // hydrating\n          true // removeOnly (!important, avoids unnecessary moves)\n        );\n        this$1._vnode = this$1.kept;\n        restoreActiveInstance();\n        update.call(this$1, vnode, hydrating);\n      };\n    },\n\n    render: function render (h) {\n      var tag = this.tag || this.$vnode.data.tag || 'span';\n      var map = Object.create(null);\n      var prevChildren = this.prevChildren = this.children;\n      var rawChildren = this.$slots.default || [];\n      var children = this.children = [];\n      var transitionData = extractTransitionData(this);\n\n      for (var i = 0; i < rawChildren.length; i++) {\n        var c = rawChildren[i];\n        if (c.tag) {\n          if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n            children.push(c);\n            map[c.key] = c\n            ;(c.data || (c.data = {})).transition = transitionData;\n          } else {\n            var opts = c.componentOptions;\n            var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;\n            warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n          }\n        }\n      }\n\n      if (prevChildren) {\n        var kept = [];\n        var removed = [];\n        for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n          var c$1 = prevChildren[i$1];\n          c$1.data.transition = transitionData;\n          c$1.data.pos = c$1.elm.getBoundingClientRect();\n          if (map[c$1.key]) {\n            kept.push(c$1);\n          } else {\n            removed.push(c$1);\n          }\n        }\n        this.kept = h(tag, null, kept);\n        this.removed = removed;\n      }\n\n      return h(tag, null, children)\n    },\n\n    updated: function updated () {\n      var children = this.prevChildren;\n      var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n      if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n        return\n      }\n\n      // we divide the work into three loops to avoid mixing DOM reads and writes\n      // in each iteration - which helps prevent layout thrashing.\n      children.forEach(callPendingCbs);\n      children.forEach(recordPosition);\n      children.forEach(applyTranslation);\n\n      // force reflow to put everything in position\n      // assign to this to avoid being removed in tree-shaking\n      // $flow-disable-line\n      this._reflow = document.body.offsetHeight;\n\n      children.forEach(function (c) {\n        if (c.data.moved) {\n          var el = c.elm;\n          var s = el.style;\n          addTransitionClass(el, moveClass);\n          s.transform = s.WebkitTransform = s.transitionDuration = '';\n          el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n            if (e && e.target !== el) {\n              return\n            }\n            if (!e || /transform$/.test(e.propertyName)) {\n              el.removeEventListener(transitionEndEvent, cb);\n              el._moveCb = null;\n              removeTransitionClass(el, moveClass);\n            }\n          });\n        }\n      });\n    },\n\n    methods: {\n      hasMove: function hasMove (el, moveClass) {\n        /* istanbul ignore if */\n        if (!hasTransition) {\n          return false\n        }\n        /* istanbul ignore if */\n        if (this._hasMove) {\n          return this._hasMove\n        }\n        // Detect whether an element with the move class applied has\n        // CSS transitions. Since the element may be inside an entering\n        // transition at this very moment, we make a clone of it and remove\n        // all other transition classes applied to ensure only the move class\n        // is applied.\n        var clone = el.cloneNode();\n        if (el._transitionClasses) {\n          el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });\n        }\n        addClass(clone, moveClass);\n        clone.style.display = 'none';\n        this.$el.appendChild(clone);\n        var info = getTransitionInfo(clone);\n        this.$el.removeChild(clone);\n        return (this._hasMove = info.hasTransform)\n      }\n    }\n  };\n\n  function callPendingCbs (c) {\n    /* istanbul ignore if */\n    if (c.elm._moveCb) {\n      c.elm._moveCb();\n    }\n    /* istanbul ignore if */\n    if (c.elm._enterCb) {\n      c.elm._enterCb();\n    }\n  }\n\n  function recordPosition (c) {\n    c.data.newPos = c.elm.getBoundingClientRect();\n  }\n\n  function applyTranslation (c) {\n    var oldPos = c.data.pos;\n    var newPos = c.data.newPos;\n    var dx = oldPos.left - newPos.left;\n    var dy = oldPos.top - newPos.top;\n    if (dx || dy) {\n      c.data.moved = true;\n      var s = c.elm.style;\n      s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n      s.transitionDuration = '0s';\n    }\n  }\n\n  var platformComponents = {\n    Transition: Transition,\n    TransitionGroup: TransitionGroup\n  };\n\n  /*  */\n\n  // install platform specific utils\n  Vue.config.mustUseProp = mustUseProp;\n  Vue.config.isReservedTag = isReservedTag;\n  Vue.config.isReservedAttr = isReservedAttr;\n  Vue.config.getTagNamespace = getTagNamespace;\n  Vue.config.isUnknownElement = isUnknownElement;\n\n  // install platform runtime directives & components\n  extend(Vue.options.directives, platformDirectives);\n  extend(Vue.options.components, platformComponents);\n\n  // install platform patch function\n  Vue.prototype.__patch__ = inBrowser ? patch : noop;\n\n  // public mount method\n  Vue.prototype.$mount = function (\n    el,\n    hydrating\n  ) {\n    el = el && inBrowser ? query(el) : undefined;\n    return mountComponent(this, el, hydrating)\n  };\n\n  // devtools global hook\n  /* istanbul ignore next */\n  if (inBrowser) {\n    setTimeout(function () {\n      if (config.devtools) {\n        if (devtools) {\n          devtools.emit('init', Vue);\n        } else {\n          console[console.info ? 'info' : 'log'](\n            'Download the Vue Devtools extension for a better development experience:\\n' +\n            'https://github.com/vuejs/vue-devtools'\n          );\n        }\n      }\n      if (config.productionTip !== false &&\n        typeof console !== 'undefined'\n      ) {\n        console[console.info ? 'info' : 'log'](\n          \"You are running Vue in development mode.\\n\" +\n          \"Make sure to turn on production mode when deploying for production.\\n\" +\n          \"See more tips at https://vuejs.org/guide/deployment.html\"\n        );\n      }\n    }, 0);\n  }\n\n  /*  */\n\n  var defaultTagRE = /\\{\\{((?:.|\\r?\\n)+?)\\}\\}/g;\n  var regexEscapeRE = /[-.*+?^${}()|[\\]\\/\\\\]/g;\n\n  var buildRegex = cached(function (delimiters) {\n    var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n    var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n    return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n  });\n\n\n\n  function parseText (\n    text,\n    delimiters\n  ) {\n    var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n    if (!tagRE.test(text)) {\n      return\n    }\n    var tokens = [];\n    var rawTokens = [];\n    var lastIndex = tagRE.lastIndex = 0;\n    var match, index, tokenValue;\n    while ((match = tagRE.exec(text))) {\n      index = match.index;\n      // push text token\n      if (index > lastIndex) {\n        rawTokens.push(tokenValue = text.slice(lastIndex, index));\n        tokens.push(JSON.stringify(tokenValue));\n      }\n      // tag token\n      var exp = parseFilters(match[1].trim());\n      tokens.push((\"_s(\" + exp + \")\"));\n      rawTokens.push({ '@binding': exp });\n      lastIndex = index + match[0].length;\n    }\n    if (lastIndex < text.length) {\n      rawTokens.push(tokenValue = text.slice(lastIndex));\n      tokens.push(JSON.stringify(tokenValue));\n    }\n    return {\n      expression: tokens.join('+'),\n      tokens: rawTokens\n    }\n  }\n\n  /*  */\n\n  function transformNode (el, options) {\n    var warn = options.warn || baseWarn;\n    var staticClass = getAndRemoveAttr(el, 'class');\n    if (staticClass) {\n      var res = parseText(staticClass, options.delimiters);\n      if (res) {\n        warn(\n          \"class=\\\"\" + staticClass + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.',\n          el.rawAttrsMap['class']\n        );\n      }\n    }\n    if (staticClass) {\n      el.staticClass = JSON.stringify(staticClass);\n    }\n    var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n    if (classBinding) {\n      el.classBinding = classBinding;\n    }\n  }\n\n  function genData (el) {\n    var data = '';\n    if (el.staticClass) {\n      data += \"staticClass:\" + (el.staticClass) + \",\";\n    }\n    if (el.classBinding) {\n      data += \"class:\" + (el.classBinding) + \",\";\n    }\n    return data\n  }\n\n  var klass$1 = {\n    staticKeys: ['staticClass'],\n    transformNode: transformNode,\n    genData: genData\n  };\n\n  /*  */\n\n  function transformNode$1 (el, options) {\n    var warn = options.warn || baseWarn;\n    var staticStyle = getAndRemoveAttr(el, 'style');\n    if (staticStyle) {\n      /* istanbul ignore if */\n      {\n        var res = parseText(staticStyle, options.delimiters);\n        if (res) {\n          warn(\n            \"style=\\\"\" + staticStyle + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.',\n            el.rawAttrsMap['style']\n          );\n        }\n      }\n      el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n    }\n\n    var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n    if (styleBinding) {\n      el.styleBinding = styleBinding;\n    }\n  }\n\n  function genData$1 (el) {\n    var data = '';\n    if (el.staticStyle) {\n      data += \"staticStyle:\" + (el.staticStyle) + \",\";\n    }\n    if (el.styleBinding) {\n      data += \"style:(\" + (el.styleBinding) + \"),\";\n    }\n    return data\n  }\n\n  var style$1 = {\n    staticKeys: ['staticStyle'],\n    transformNode: transformNode$1,\n    genData: genData$1\n  };\n\n  /*  */\n\n  var decoder;\n\n  var he = {\n    decode: function decode (html) {\n      decoder = decoder || document.createElement('div');\n      decoder.innerHTML = html;\n      return decoder.textContent\n    }\n  };\n\n  /*  */\n\n  var isUnaryTag = makeMap(\n    'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n    'link,meta,param,source,track,wbr'\n  );\n\n  // Elements that you can, intentionally, leave open\n  // (and which close themselves)\n  var canBeLeftOpenTag = makeMap(\n    'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'\n  );\n\n  // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n  // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\n  var isNonPhrasingTag = makeMap(\n    'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n    'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n    'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n    'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n    'title,tr,track'\n  );\n\n  /**\n   * Not type-checking this file because it's mostly vendor code.\n   */\n\n  // Regular Expressions for parsing tags and attributes\n  var attribute = /^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/;\n  var dynamicArgAttribute = /^\\s*((?:v-[\\w-]+:|@|:|#)\\[[^=]+\\][^\\s\"'<>\\/=]*)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/;\n  var ncname = \"[a-zA-Z_][\\\\-\\\\.0-9_a-zA-Z\" + unicodeLetters + \"]*\";\n  var qnameCapture = \"((?:\" + ncname + \"\\\\:)?\" + ncname + \")\";\n  var startTagOpen = new RegExp((\"^<\" + qnameCapture));\n  var startTagClose = /^\\s*(\\/?)>/;\n  var endTag = new RegExp((\"^<\\\\/\" + qnameCapture + \"[^>]*>\"));\n  var doctype = /^<!DOCTYPE [^>]+>/i;\n  // #7298: escape - to avoid being pased as HTML comment when inlined in page\n  var comment = /^<!\\--/;\n  var conditionalComment = /^<!\\[/;\n\n  // Special Elements (can contain anything)\n  var isPlainTextElement = makeMap('script,style,textarea', true);\n  var reCache = {};\n\n  var decodingMap = {\n    '&lt;': '<',\n    '&gt;': '>',\n    '&quot;': '\"',\n    '&amp;': '&',\n    '&#10;': '\\n',\n    '&#9;': '\\t',\n    '&#39;': \"'\"\n  };\n  var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;\n  var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;\n\n  // #5992\n  var isIgnoreNewlineTag = makeMap('pre,textarea', true);\n  var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\\n'; };\n\n  function decodeAttr (value, shouldDecodeNewlines) {\n    var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;\n    return value.replace(re, function (match) { return decodingMap[match]; })\n  }\n\n  function parseHTML (html, options) {\n    var stack = [];\n    var expectHTML = options.expectHTML;\n    var isUnaryTag$$1 = options.isUnaryTag || no;\n    var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;\n    var index = 0;\n    var last, lastTag;\n    while (html) {\n      last = html;\n      // Make sure we're not in a plaintext content element like script/style\n      if (!lastTag || !isPlainTextElement(lastTag)) {\n        var textEnd = html.indexOf('<');\n        if (textEnd === 0) {\n          // Comment:\n          if (comment.test(html)) {\n            var commentEnd = html.indexOf('-->');\n\n            if (commentEnd >= 0) {\n              if (options.shouldKeepComment) {\n                options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);\n              }\n              advance(commentEnd + 3);\n              continue\n            }\n          }\n\n          // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n          if (conditionalComment.test(html)) {\n            var conditionalEnd = html.indexOf(']>');\n\n            if (conditionalEnd >= 0) {\n              advance(conditionalEnd + 2);\n              continue\n            }\n          }\n\n          // Doctype:\n          var doctypeMatch = html.match(doctype);\n          if (doctypeMatch) {\n            advance(doctypeMatch[0].length);\n            continue\n          }\n\n          // End tag:\n          var endTagMatch = html.match(endTag);\n          if (endTagMatch) {\n            var curIndex = index;\n            advance(endTagMatch[0].length);\n            parseEndTag(endTagMatch[1], curIndex, index);\n            continue\n          }\n\n          // Start tag:\n          var startTagMatch = parseStartTag();\n          if (startTagMatch) {\n            handleStartTag(startTagMatch);\n            if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {\n              advance(1);\n            }\n            continue\n          }\n        }\n\n        var text = (void 0), rest = (void 0), next = (void 0);\n        if (textEnd >= 0) {\n          rest = html.slice(textEnd);\n          while (\n            !endTag.test(rest) &&\n            !startTagOpen.test(rest) &&\n            !comment.test(rest) &&\n            !conditionalComment.test(rest)\n          ) {\n            // < in plain text, be forgiving and treat it as text\n            next = rest.indexOf('<', 1);\n            if (next < 0) { break }\n            textEnd += next;\n            rest = html.slice(textEnd);\n          }\n          text = html.substring(0, textEnd);\n        }\n\n        if (textEnd < 0) {\n          text = html;\n        }\n\n        if (text) {\n          advance(text.length);\n        }\n\n        if (options.chars && text) {\n          options.chars(text, index - text.length, index);\n        }\n      } else {\n        var endTagLength = 0;\n        var stackedTag = lastTag.toLowerCase();\n        var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n        var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {\n          endTagLength = endTag.length;\n          if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {\n            text = text\n              .replace(/<!\\--([\\s\\S]*?)-->/g, '$1') // #7298\n              .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n          }\n          if (shouldIgnoreFirstNewline(stackedTag, text)) {\n            text = text.slice(1);\n          }\n          if (options.chars) {\n            options.chars(text);\n          }\n          return ''\n        });\n        index += html.length - rest$1.length;\n        html = rest$1;\n        parseEndTag(stackedTag, index - endTagLength, index);\n      }\n\n      if (html === last) {\n        options.chars && options.chars(html);\n        if (!stack.length && options.warn) {\n          options.warn((\"Mal-formatted tag at end of template: \\\"\" + html + \"\\\"\"), { start: index + html.length });\n        }\n        break\n      }\n    }\n\n    // Clean up any remaining tags\n    parseEndTag();\n\n    function advance (n) {\n      index += n;\n      html = html.substring(n);\n    }\n\n    function parseStartTag () {\n      var start = html.match(startTagOpen);\n      if (start) {\n        var match = {\n          tagName: start[1],\n          attrs: [],\n          start: index\n        };\n        advance(start[0].length);\n        var end, attr;\n        while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {\n          attr.start = index;\n          advance(attr[0].length);\n          attr.end = index;\n          match.attrs.push(attr);\n        }\n        if (end) {\n          match.unarySlash = end[1];\n          advance(end[0].length);\n          match.end = index;\n          return match\n        }\n      }\n    }\n\n    function handleStartTag (match) {\n      var tagName = match.tagName;\n      var unarySlash = match.unarySlash;\n\n      if (expectHTML) {\n        if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n          parseEndTag(lastTag);\n        }\n        if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {\n          parseEndTag(tagName);\n        }\n      }\n\n      var unary = isUnaryTag$$1(tagName) || !!unarySlash;\n\n      var l = match.attrs.length;\n      var attrs = new Array(l);\n      for (var i = 0; i < l; i++) {\n        var args = match.attrs[i];\n        var value = args[3] || args[4] || args[5] || '';\n        var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'\n          ? options.shouldDecodeNewlinesForHref\n          : options.shouldDecodeNewlines;\n        attrs[i] = {\n          name: args[1],\n          value: decodeAttr(value, shouldDecodeNewlines)\n        };\n        if (options.outputSourceRange) {\n          attrs[i].start = args.start + args[0].match(/^\\s*/).length;\n          attrs[i].end = args.end;\n        }\n      }\n\n      if (!unary) {\n        stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });\n        lastTag = tagName;\n      }\n\n      if (options.start) {\n        options.start(tagName, attrs, unary, match.start, match.end);\n      }\n    }\n\n    function parseEndTag (tagName, start, end) {\n      var pos, lowerCasedTagName;\n      if (start == null) { start = index; }\n      if (end == null) { end = index; }\n\n      // Find the closest opened tag of the same type\n      if (tagName) {\n        lowerCasedTagName = tagName.toLowerCase();\n        for (pos = stack.length - 1; pos >= 0; pos--) {\n          if (stack[pos].lowerCasedTag === lowerCasedTagName) {\n            break\n          }\n        }\n      } else {\n        // If no tag name is provided, clean shop\n        pos = 0;\n      }\n\n      if (pos >= 0) {\n        // Close all the open elements, up the stack\n        for (var i = stack.length - 1; i >= pos; i--) {\n          if (i > pos || !tagName &&\n            options.warn\n          ) {\n            options.warn(\n              (\"tag <\" + (stack[i].tag) + \"> has no matching end tag.\"),\n              { start: stack[i].start }\n            );\n          }\n          if (options.end) {\n            options.end(stack[i].tag, start, end);\n          }\n        }\n\n        // Remove the open elements from the stack\n        stack.length = pos;\n        lastTag = pos && stack[pos - 1].tag;\n      } else if (lowerCasedTagName === 'br') {\n        if (options.start) {\n          options.start(tagName, [], true, start, end);\n        }\n      } else if (lowerCasedTagName === 'p') {\n        if (options.start) {\n          options.start(tagName, [], false, start, end);\n        }\n        if (options.end) {\n          options.end(tagName, start, end);\n        }\n      }\n    }\n  }\n\n  /*  */\n\n  var onRE = /^@|^v-on:/;\n  var dirRE = /^v-|^@|^:/;\n  var forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\n  var forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\n  var stripParensRE = /^\\(|\\)$/g;\n  var dynamicArgRE = /^\\[.*\\]$/;\n\n  var argRE = /:(.*)$/;\n  var bindRE = /^:|^\\.|^v-bind:/;\n  var modifierRE = /\\.[^.]+/g;\n\n  var slotRE = /^v-slot(:|$)|^#/;\n\n  var lineBreakRE = /[\\r\\n]/;\n  var whitespaceRE$1 = /\\s+/g;\n\n  var invalidAttributeRE = /[\\s\"'<>\\/=]/;\n\n  var decodeHTMLCached = cached(he.decode);\n\n  var emptySlotScopeToken = \"_empty_\";\n\n  // configurable state\n  var warn$2;\n  var delimiters;\n  var transforms;\n  var preTransforms;\n  var postTransforms;\n  var platformIsPreTag;\n  var platformMustUseProp;\n  var platformGetTagNamespace;\n  var maybeComponent;\n\n  function createASTElement (\n    tag,\n    attrs,\n    parent\n  ) {\n    return {\n      type: 1,\n      tag: tag,\n      attrsList: attrs,\n      attrsMap: makeAttrsMap(attrs),\n      rawAttrsMap: {},\n      parent: parent,\n      children: []\n    }\n  }\n\n  /**\n   * Convert HTML string to AST.\n   */\n  function parse (\n    template,\n    options\n  ) {\n    warn$2 = options.warn || baseWarn;\n\n    platformIsPreTag = options.isPreTag || no;\n    platformMustUseProp = options.mustUseProp || no;\n    platformGetTagNamespace = options.getTagNamespace || no;\n    var isReservedTag = options.isReservedTag || no;\n    maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };\n\n    transforms = pluckModuleFunction(options.modules, 'transformNode');\n    preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n    postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n\n    delimiters = options.delimiters;\n\n    var stack = [];\n    var preserveWhitespace = options.preserveWhitespace !== false;\n    var whitespaceOption = options.whitespace;\n    var root;\n    var currentParent;\n    var inVPre = false;\n    var inPre = false;\n    var warned = false;\n\n    function warnOnce (msg, range) {\n      if (!warned) {\n        warned = true;\n        warn$2(msg, range);\n      }\n    }\n\n    function closeElement (element) {\n      trimEndingWhitespace(element);\n      if (!inVPre && !element.processed) {\n        element = processElement(element, options);\n      }\n      // tree management\n      if (!stack.length && element !== root) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          {\n            checkRootConstraints(element);\n          }\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else {\n          warnOnce(\n            \"Component template should contain exactly one root element. \" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\",\n            { start: element.start }\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else {\n          if (element.slotScope) {\n            // scoped slot\n            // keep it in the children list so that v-else(-if) conditions can\n            // find it as the prev node.\n            var name = element.slotTarget || '\"default\"'\n            ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n          }\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n\n      // final children cleanup\n      // filter out scoped slots\n      element.children = element.children.filter(function (c) { return !(c).slotScope; });\n      // remove trailing whitespace node again\n      trimEndingWhitespace(element);\n\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n      // apply post-transforms\n      for (var i = 0; i < postTransforms.length; i++) {\n        postTransforms[i](element, options);\n      }\n    }\n\n    function trimEndingWhitespace (el) {\n      // remove trailing whitespace node\n      if (!inPre) {\n        var lastNode;\n        while (\n          (lastNode = el.children[el.children.length - 1]) &&\n          lastNode.type === 3 &&\n          lastNode.text === ' '\n        ) {\n          el.children.pop();\n        }\n      }\n    }\n\n    function checkRootConstraints (el) {\n      if (el.tag === 'slot' || el.tag === 'template') {\n        warnOnce(\n          \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n          'contain multiple nodes.',\n          { start: el.start }\n        );\n      }\n      if (el.attrsMap.hasOwnProperty('v-for')) {\n        warnOnce(\n          'Cannot use v-for on stateful component root element because ' +\n          'it renders multiple elements.',\n          el.rawAttrsMap['v-for']\n        );\n      }\n    }\n\n    parseHTML(template, {\n      warn: warn$2,\n      expectHTML: options.expectHTML,\n      isUnaryTag: options.isUnaryTag,\n      canBeLeftOpenTag: options.canBeLeftOpenTag,\n      shouldDecodeNewlines: options.shouldDecodeNewlines,\n      shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,\n      shouldKeepComment: options.comments,\n      outputSourceRange: options.outputSourceRange,\n      start: function start (tag, attrs, unary, start$1) {\n        // check namespace.\n        // inherit parent ns if there is one\n        var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n        // handle IE svg bug\n        /* istanbul ignore if */\n        if (isIE && ns === 'svg') {\n          attrs = guardIESVGBug(attrs);\n        }\n\n        var element = createASTElement(tag, attrs, currentParent);\n        if (ns) {\n          element.ns = ns;\n        }\n\n        {\n          if (options.outputSourceRange) {\n            element.start = start$1;\n            element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {\n              cumulated[attr.name] = attr;\n              return cumulated\n            }, {});\n          }\n          attrs.forEach(function (attr) {\n            if (invalidAttributeRE.test(attr.name)) {\n              warn$2(\n                \"Invalid dynamic argument expression: attribute names cannot contain \" +\n                \"spaces, quotes, <, >, / or =.\",\n                {\n                  start: attr.start + attr.name.indexOf(\"[\"),\n                  end: attr.start + attr.name.length\n                }\n              );\n            }\n          });\n        }\n\n        if (isForbiddenTag(element) && !isServerRendering()) {\n          element.forbidden = true;\n          warn$2(\n            'Templates should only be responsible for mapping the state to the ' +\n            'UI. Avoid placing tags with side-effects in your templates, such as ' +\n            \"<\" + tag + \">\" + ', as they will not be parsed.',\n            { start: element.start }\n          );\n        }\n\n        // apply pre-transforms\n        for (var i = 0; i < preTransforms.length; i++) {\n          element = preTransforms[i](element, options) || element;\n        }\n\n        if (!inVPre) {\n          processPre(element);\n          if (element.pre) {\n            inVPre = true;\n          }\n        }\n        if (platformIsPreTag(element.tag)) {\n          inPre = true;\n        }\n        if (inVPre) {\n          processRawAttrs(element);\n        } else if (!element.processed) {\n          // structural directives\n          processFor(element);\n          processIf(element);\n          processOnce(element);\n        }\n\n        if (!root) {\n          root = element;\n          {\n            checkRootConstraints(root);\n          }\n        }\n\n        if (!unary) {\n          currentParent = element;\n          stack.push(element);\n        } else {\n          closeElement(element);\n        }\n      },\n\n      end: function end (tag, start, end$1) {\n        var element = stack[stack.length - 1];\n        // pop stack\n        stack.length -= 1;\n        currentParent = stack[stack.length - 1];\n        if (options.outputSourceRange) {\n          element.end = end$1;\n        }\n        closeElement(element);\n      },\n\n      chars: function chars (text, start, end) {\n        if (!currentParent) {\n          {\n            if (text === template) {\n              warnOnce(\n                'Component template requires a root element, rather than just text.',\n                { start: start }\n              );\n            } else if ((text = text.trim())) {\n              warnOnce(\n                (\"text \\\"\" + text + \"\\\" outside root element will be ignored.\"),\n                { start: start }\n              );\n            }\n          }\n          return\n        }\n        // IE textarea placeholder bug\n        /* istanbul ignore if */\n        if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text\n        ) {\n          return\n        }\n        var children = currentParent.children;\n        if (inPre || text.trim()) {\n          text = isTextTag(currentParent) ? text : decodeHTMLCached(text);\n        } else if (!children.length) {\n          // remove the whitespace-only node right after an opening tag\n          text = '';\n        } else if (whitespaceOption) {\n          if (whitespaceOption === 'condense') {\n            // in condense mode, remove the whitespace node if it contains\n            // line break, otherwise condense to a single space\n            text = lineBreakRE.test(text) ? '' : ' ';\n          } else {\n            text = ' ';\n          }\n        } else {\n          text = preserveWhitespace ? ' ' : '';\n        }\n        if (text) {\n          if (whitespaceOption === 'condense') {\n            // condense consecutive whitespaces into single space\n            text = text.replace(whitespaceRE$1, ' ');\n          }\n          var res;\n          var child;\n          if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {\n            child = {\n              type: 2,\n              expression: res.expression,\n              tokens: res.tokens,\n              text: text\n            };\n          } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {\n            child = {\n              type: 3,\n              text: text\n            };\n          }\n          if (child) {\n            if (options.outputSourceRange) {\n              child.start = start;\n              child.end = end;\n            }\n            children.push(child);\n          }\n        }\n      },\n      comment: function comment (text, start, end) {\n        // adding anyting as a sibling to the root node is forbidden\n        // comments should still be allowed, but ignored\n        if (currentParent) {\n          var child = {\n            type: 3,\n            text: text,\n            isComment: true\n          };\n          if (options.outputSourceRange) {\n            child.start = start;\n            child.end = end;\n          }\n          currentParent.children.push(child);\n        }\n      }\n    });\n    return root\n  }\n\n  function processPre (el) {\n    if (getAndRemoveAttr(el, 'v-pre') != null) {\n      el.pre = true;\n    }\n  }\n\n  function processRawAttrs (el) {\n    var list = el.attrsList;\n    var len = list.length;\n    if (len) {\n      var attrs = el.attrs = new Array(len);\n      for (var i = 0; i < len; i++) {\n        attrs[i] = {\n          name: list[i].name,\n          value: JSON.stringify(list[i].value)\n        };\n        if (list[i].start != null) {\n          attrs[i].start = list[i].start;\n          attrs[i].end = list[i].end;\n        }\n      }\n    } else if (!el.pre) {\n      // non root node in pre blocks with no attributes\n      el.plain = true;\n    }\n  }\n\n  function processElement (\n    element,\n    options\n  ) {\n    processKey(element);\n\n    // determine whether this is a plain element after\n    // removing structural attributes\n    element.plain = (\n      !element.key &&\n      !element.scopedSlots &&\n      !element.attrsList.length\n    );\n\n    processRef(element);\n    processSlotContent(element);\n    processSlotOutlet(element);\n    processComponent(element);\n    for (var i = 0; i < transforms.length; i++) {\n      element = transforms[i](element, options) || element;\n    }\n    processAttrs(element);\n    return element\n  }\n\n  function processKey (el) {\n    var exp = getBindingAttr(el, 'key');\n    if (exp) {\n      {\n        if (el.tag === 'template') {\n          warn$2(\n            \"<template> cannot be keyed. Place the key on real elements instead.\",\n            getRawBindingAttr(el, 'key')\n          );\n        }\n        if (el.for) {\n          var iterator = el.iterator2 || el.iterator1;\n          var parent = el.parent;\n          if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {\n            warn$2(\n              \"Do not use v-for index as key on <transition-group> children, \" +\n              \"this is the same as not using keys.\",\n              getRawBindingAttr(el, 'key'),\n              true /* tip */\n            );\n          }\n        }\n      }\n      el.key = exp;\n    }\n  }\n\n  function processRef (el) {\n    var ref = getBindingAttr(el, 'ref');\n    if (ref) {\n      el.ref = ref;\n      el.refInFor = checkInFor(el);\n    }\n  }\n\n  function processFor (el) {\n    var exp;\n    if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n      var res = parseFor(exp);\n      if (res) {\n        extend(el, res);\n      } else {\n        warn$2(\n          (\"Invalid v-for expression: \" + exp),\n          el.rawAttrsMap['v-for']\n        );\n      }\n    }\n  }\n\n\n\n  function parseFor (exp) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) { return }\n    var res = {};\n    res.for = inMatch[2].trim();\n    var alias = inMatch[1].trim().replace(stripParensRE, '');\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      res.alias = alias.replace(forIteratorRE, '').trim();\n      res.iterator1 = iteratorMatch[1].trim();\n      if (iteratorMatch[2]) {\n        res.iterator2 = iteratorMatch[2].trim();\n      }\n    } else {\n      res.alias = alias;\n    }\n    return res\n  }\n\n  function processIf (el) {\n    var exp = getAndRemoveAttr(el, 'v-if');\n    if (exp) {\n      el.if = exp;\n      addIfCondition(el, {\n        exp: exp,\n        block: el\n      });\n    } else {\n      if (getAndRemoveAttr(el, 'v-else') != null) {\n        el.else = true;\n      }\n      var elseif = getAndRemoveAttr(el, 'v-else-if');\n      if (elseif) {\n        el.elseif = elseif;\n      }\n    }\n  }\n\n  function processIfConditions (el, parent) {\n    var prev = findPrevElement(parent.children);\n    if (prev && prev.if) {\n      addIfCondition(prev, {\n        exp: el.elseif,\n        block: el\n      });\n    } else {\n      warn$2(\n        \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n        \"used on element <\" + (el.tag) + \"> without corresponding v-if.\",\n        el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']\n      );\n    }\n  }\n\n  function findPrevElement (children) {\n    var i = children.length;\n    while (i--) {\n      if (children[i].type === 1) {\n        return children[i]\n      } else {\n        if (children[i].text !== ' ') {\n          warn$2(\n            \"text \\\"\" + (children[i].text.trim()) + \"\\\" between v-if and v-else(-if) \" +\n            \"will be ignored.\",\n            children[i]\n          );\n        }\n        children.pop();\n      }\n    }\n  }\n\n  function addIfCondition (el, condition) {\n    if (!el.ifConditions) {\n      el.ifConditions = [];\n    }\n    el.ifConditions.push(condition);\n  }\n\n  function processOnce (el) {\n    var once$$1 = getAndRemoveAttr(el, 'v-once');\n    if (once$$1 != null) {\n      el.once = true;\n    }\n  }\n\n  // handle content being passed to a component as slot,\n  // e.g. <template slot=\"xxx\">, <div slot-scope=\"xxx\">\n  function processSlotContent (el) {\n    var slotScope;\n    if (el.tag === 'template') {\n      slotScope = getAndRemoveAttr(el, 'scope');\n      /* istanbul ignore if */\n      if (slotScope) {\n        warn$2(\n          \"the \\\"scope\\\" attribute for scoped slots have been deprecated and \" +\n          \"replaced by \\\"slot-scope\\\" since 2.5. The new \\\"slot-scope\\\" attribute \" +\n          \"can also be used on plain elements in addition to <template> to \" +\n          \"denote scoped slots.\",\n          el.rawAttrsMap['scope'],\n          true\n        );\n      }\n      el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');\n    } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {\n      /* istanbul ignore if */\n      if (el.attrsMap['v-for']) {\n        warn$2(\n          \"Ambiguous combined usage of slot-scope and v-for on <\" + (el.tag) + \"> \" +\n          \"(v-for takes higher priority). Use a wrapper <template> for the \" +\n          \"scoped slot to make it clearer.\",\n          el.rawAttrsMap['slot-scope'],\n          true\n        );\n      }\n      el.slotScope = slotScope;\n    }\n\n    // slot=\"xxx\"\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n      el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);\n      // preserve slot as an attribute for native shadow DOM compat\n      // only for non-scoped slots.\n      if (el.tag !== 'template' && !el.slotScope) {\n        addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));\n      }\n    }\n\n    // 2.6 v-slot syntax\n    {\n      if (el.tag === 'template') {\n        // v-slot on <template>\n        var slotBinding = getAndRemoveAttrByRegex(el, slotRE);\n        if (slotBinding) {\n          {\n            if (el.slotTarget || el.slotScope) {\n              warn$2(\n                \"Unexpected mixed usage of different slot syntaxes.\",\n                el\n              );\n            }\n            if (el.parent && !maybeComponent(el.parent)) {\n              warn$2(\n                \"<template v-slot> can only appear at the root level inside \" +\n                \"the receiving the component\",\n                el\n              );\n            }\n          }\n          var ref = getSlotName(slotBinding);\n          var name = ref.name;\n          var dynamic = ref.dynamic;\n          el.slotTarget = name;\n          el.slotTargetDynamic = dynamic;\n          el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf\n        }\n      } else {\n        // v-slot on component, denotes default slot\n        var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);\n        if (slotBinding$1) {\n          {\n            if (!maybeComponent(el)) {\n              warn$2(\n                \"v-slot can only be used on components or <template>.\",\n                slotBinding$1\n              );\n            }\n            if (el.slotScope || el.slotTarget) {\n              warn$2(\n                \"Unexpected mixed usage of different slot syntaxes.\",\n                el\n              );\n            }\n            if (el.scopedSlots) {\n              warn$2(\n                \"To avoid scope ambiguity, the default slot should also use \" +\n                \"<template> syntax when there are other named slots.\",\n                slotBinding$1\n              );\n            }\n          }\n          // add the component's children to its default slot\n          var slots = el.scopedSlots || (el.scopedSlots = {});\n          var ref$1 = getSlotName(slotBinding$1);\n          var name$1 = ref$1.name;\n          var dynamic$1 = ref$1.dynamic;\n          var slotContainer = slots[name$1] = createASTElement('template', [], el);\n          slotContainer.slotTarget = name$1;\n          slotContainer.slotTargetDynamic = dynamic$1;\n          slotContainer.children = el.children.filter(function (c) {\n            if (!c.slotScope) {\n              c.parent = slotContainer;\n              return true\n            }\n          });\n          slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;\n          // remove children as they are returned from scopedSlots now\n          el.children = [];\n          // mark el non-plain so data gets generated\n          el.plain = false;\n        }\n      }\n    }\n  }\n\n  function getSlotName (binding) {\n    var name = binding.name.replace(slotRE, '');\n    if (!name) {\n      if (binding.name[0] !== '#') {\n        name = 'default';\n      } else {\n        warn$2(\n          \"v-slot shorthand syntax requires a slot name.\",\n          binding\n        );\n      }\n    }\n    return dynamicArgRE.test(name)\n      // dynamic [name]\n      ? { name: name.slice(1, -1), dynamic: true }\n      // static name\n      : { name: (\"\\\"\" + name + \"\\\"\"), dynamic: false }\n  }\n\n  // handle <slot/> outlets\n  function processSlotOutlet (el) {\n    if (el.tag === 'slot') {\n      el.slotName = getBindingAttr(el, 'name');\n      if (el.key) {\n        warn$2(\n          \"`key` does not work on <slot> because slots are abstract outlets \" +\n          \"and can possibly expand into multiple elements. \" +\n          \"Use the key on a wrapping element instead.\",\n          getRawBindingAttr(el, 'key')\n        );\n      }\n    }\n  }\n\n  function processComponent (el) {\n    var binding;\n    if ((binding = getBindingAttr(el, 'is'))) {\n      el.component = binding;\n    }\n    if (getAndRemoveAttr(el, 'inline-template') != null) {\n      el.inlineTemplate = true;\n    }\n  }\n\n  function processAttrs (el) {\n    var list = el.attrsList;\n    var i, l, name, rawName, value, modifiers, syncGen, isDynamic;\n    for (i = 0, l = list.length; i < l; i++) {\n      name = rawName = list[i].name;\n      value = list[i].value;\n      if (dirRE.test(name)) {\n        // mark element as dynamic\n        el.hasBindings = true;\n        // modifiers\n        modifiers = parseModifiers(name.replace(dirRE, ''));\n        // support .foo shorthand syntax for the .prop modifier\n        if (modifiers) {\n          name = name.replace(modifierRE, '');\n        }\n        if (bindRE.test(name)) { // v-bind\n          name = name.replace(bindRE, '');\n          value = parseFilters(value);\n          isDynamic = dynamicArgRE.test(name);\n          if (isDynamic) {\n            name = name.slice(1, -1);\n          }\n          if (\n            value.trim().length === 0\n          ) {\n            warn$2(\n              (\"The value for a v-bind expression cannot be empty. Found in \\\"v-bind:\" + name + \"\\\"\")\n            );\n          }\n          if (modifiers) {\n            if (modifiers.prop && !isDynamic) {\n              name = camelize(name);\n              if (name === 'innerHtml') { name = 'innerHTML'; }\n            }\n            if (modifiers.camel && !isDynamic) {\n              name = camelize(name);\n            }\n            if (modifiers.sync) {\n              syncGen = genAssignmentCode(value, \"$event\");\n              if (!isDynamic) {\n                addHandler(\n                  el,\n                  (\"update:\" + (camelize(name))),\n                  syncGen,\n                  null,\n                  false,\n                  warn$2,\n                  list[i]\n                );\n                if (hyphenate(name) !== camelize(name)) {\n                  addHandler(\n                    el,\n                    (\"update:\" + (hyphenate(name))),\n                    syncGen,\n                    null,\n                    false,\n                    warn$2,\n                    list[i]\n                  );\n                }\n              } else {\n                // handler w/ dynamic event name\n                addHandler(\n                  el,\n                  (\"\\\"update:\\\"+(\" + name + \")\"),\n                  syncGen,\n                  null,\n                  false,\n                  warn$2,\n                  list[i],\n                  true // dynamic\n                );\n              }\n            }\n          }\n          if ((modifiers && modifiers.prop) || (\n            !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)\n          )) {\n            addProp(el, name, value, list[i], isDynamic);\n          } else {\n            addAttr(el, name, value, list[i], isDynamic);\n          }\n        } else if (onRE.test(name)) { // v-on\n          name = name.replace(onRE, '');\n          isDynamic = dynamicArgRE.test(name);\n          if (isDynamic) {\n            name = name.slice(1, -1);\n          }\n          addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);\n        } else { // normal directives\n          name = name.replace(dirRE, '');\n          // parse arg\n          var argMatch = name.match(argRE);\n          var arg = argMatch && argMatch[1];\n          isDynamic = false;\n          if (arg) {\n            name = name.slice(0, -(arg.length + 1));\n            if (dynamicArgRE.test(arg)) {\n              arg = arg.slice(1, -1);\n              isDynamic = true;\n            }\n          }\n          addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);\n          if (name === 'model') {\n            checkForAliasModel(el, value);\n          }\n        }\n      } else {\n        // literal attribute\n        {\n          var res = parseText(value, delimiters);\n          if (res) {\n            warn$2(\n              name + \"=\\\"\" + value + \"\\\": \" +\n              'Interpolation inside attributes has been removed. ' +\n              'Use v-bind or the colon shorthand instead. For example, ' +\n              'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.',\n              list[i]\n            );\n          }\n        }\n        addAttr(el, name, JSON.stringify(value), list[i]);\n        // #6887 firefox doesn't update muted state if set via attribute\n        // even immediately after element creation\n        if (!el.component &&\n            name === 'muted' &&\n            platformMustUseProp(el.tag, el.attrsMap.type, name)) {\n          addProp(el, name, 'true', list[i]);\n        }\n      }\n    }\n  }\n\n  function checkInFor (el) {\n    var parent = el;\n    while (parent) {\n      if (parent.for !== undefined) {\n        return true\n      }\n      parent = parent.parent;\n    }\n    return false\n  }\n\n  function parseModifiers (name) {\n    var match = name.match(modifierRE);\n    if (match) {\n      var ret = {};\n      match.forEach(function (m) { ret[m.slice(1)] = true; });\n      return ret\n    }\n  }\n\n  function makeAttrsMap (attrs) {\n    var map = {};\n    for (var i = 0, l = attrs.length; i < l; i++) {\n      if (\n        map[attrs[i].name] && !isIE && !isEdge\n      ) {\n        warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);\n      }\n      map[attrs[i].name] = attrs[i].value;\n    }\n    return map\n  }\n\n  // for script (e.g. type=\"x/template\") or style, do not decode content\n  function isTextTag (el) {\n    return el.tag === 'script' || el.tag === 'style'\n  }\n\n  function isForbiddenTag (el) {\n    return (\n      el.tag === 'style' ||\n      (el.tag === 'script' && (\n        !el.attrsMap.type ||\n        el.attrsMap.type === 'text/javascript'\n      ))\n    )\n  }\n\n  var ieNSBug = /^xmlns:NS\\d+/;\n  var ieNSPrefix = /^NS\\d+:/;\n\n  /* istanbul ignore next */\n  function guardIESVGBug (attrs) {\n    var res = [];\n    for (var i = 0; i < attrs.length; i++) {\n      var attr = attrs[i];\n      if (!ieNSBug.test(attr.name)) {\n        attr.name = attr.name.replace(ieNSPrefix, '');\n        res.push(attr);\n      }\n    }\n    return res\n  }\n\n  function checkForAliasModel (el, value) {\n    var _el = el;\n    while (_el) {\n      if (_el.for && _el.alias === value) {\n        warn$2(\n          \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n          \"You are binding v-model directly to a v-for iteration alias. \" +\n          \"This will not be able to modify the v-for source array because \" +\n          \"writing to the alias is like modifying a function local variable. \" +\n          \"Consider using an array of objects and use v-model on an object property instead.\",\n          el.rawAttrsMap['v-model']\n        );\n      }\n      _el = _el.parent;\n    }\n  }\n\n  /*  */\n\n  function preTransformNode (el, options) {\n    if (el.tag === 'input') {\n      var map = el.attrsMap;\n      if (!map['v-model']) {\n        return\n      }\n\n      var typeBinding;\n      if (map[':type'] || map['v-bind:type']) {\n        typeBinding = getBindingAttr(el, 'type');\n      }\n      if (!map.type && !typeBinding && map['v-bind']) {\n        typeBinding = \"(\" + (map['v-bind']) + \").type\";\n      }\n\n      if (typeBinding) {\n        var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n        var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n        var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n        var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n        // 1. checkbox\n        var branch0 = cloneASTElement(el);\n        // process for on the main node\n        processFor(branch0);\n        addRawAttr(branch0, 'type', 'checkbox');\n        processElement(branch0, options);\n        branch0.processed = true; // prevent it from double-processed\n        branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n        addIfCondition(branch0, {\n          exp: branch0.if,\n          block: branch0\n        });\n        // 2. add radio else-if condition\n        var branch1 = cloneASTElement(el);\n        getAndRemoveAttr(branch1, 'v-for', true);\n        addRawAttr(branch1, 'type', 'radio');\n        processElement(branch1, options);\n        addIfCondition(branch0, {\n          exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n          block: branch1\n        });\n        // 3. other\n        var branch2 = cloneASTElement(el);\n        getAndRemoveAttr(branch2, 'v-for', true);\n        addRawAttr(branch2, ':type', typeBinding);\n        processElement(branch2, options);\n        addIfCondition(branch0, {\n          exp: ifCondition,\n          block: branch2\n        });\n\n        if (hasElse) {\n          branch0.else = true;\n        } else if (elseIfCondition) {\n          branch0.elseif = elseIfCondition;\n        }\n\n        return branch0\n      }\n    }\n  }\n\n  function cloneASTElement (el) {\n    return createASTElement(el.tag, el.attrsList.slice(), el.parent)\n  }\n\n  var model$1 = {\n    preTransformNode: preTransformNode\n  };\n\n  var modules$1 = [\n    klass$1,\n    style$1,\n    model$1\n  ];\n\n  /*  */\n\n  function text (el, dir) {\n    if (dir.value) {\n      addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"), dir);\n    }\n  }\n\n  /*  */\n\n  function html (el, dir) {\n    if (dir.value) {\n      addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"), dir);\n    }\n  }\n\n  var directives$1 = {\n    model: model,\n    text: text,\n    html: html\n  };\n\n  /*  */\n\n  var baseOptions = {\n    expectHTML: true,\n    modules: modules$1,\n    directives: directives$1,\n    isPreTag: isPreTag,\n    isUnaryTag: isUnaryTag,\n    mustUseProp: mustUseProp,\n    canBeLeftOpenTag: canBeLeftOpenTag,\n    isReservedTag: isReservedTag,\n    getTagNamespace: getTagNamespace,\n    staticKeys: genStaticKeys(modules$1)\n  };\n\n  /*  */\n\n  var isStaticKey;\n  var isPlatformReservedTag;\n\n  var genStaticKeysCached = cached(genStaticKeys$1);\n\n  /**\n   * Goal of the optimizer: walk the generated template AST tree\n   * and detect sub-trees that are purely static, i.e. parts of\n   * the DOM that never needs to change.\n   *\n   * Once we detect these sub-trees, we can:\n   *\n   * 1. Hoist them into constants, so that we no longer need to\n   *    create fresh nodes for them on each re-render;\n   * 2. Completely skip them in the patching process.\n   */\n  function optimize (root, options) {\n    if (!root) { return }\n    isStaticKey = genStaticKeysCached(options.staticKeys || '');\n    isPlatformReservedTag = options.isReservedTag || no;\n    // first pass: mark all non-static nodes.\n    markStatic$1(root);\n    // second pass: mark static roots.\n    markStaticRoots(root, false);\n  }\n\n  function genStaticKeys$1 (keys) {\n    return makeMap(\n      'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +\n      (keys ? ',' + keys : '')\n    )\n  }\n\n  function markStatic$1 (node) {\n    node.static = isStatic(node);\n    if (node.type === 1) {\n      // do not make component slot content static. this avoids\n      // 1. components not able to mutate slot nodes\n      // 2. static slot content fails for hot-reloading\n      if (\n        !isPlatformReservedTag(node.tag) &&\n        node.tag !== 'slot' &&\n        node.attrsMap['inline-template'] == null\n      ) {\n        return\n      }\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        var child = node.children[i];\n        markStatic$1(child);\n        if (!child.static) {\n          node.static = false;\n        }\n      }\n      if (node.ifConditions) {\n        for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {\n          var block = node.ifConditions[i$1].block;\n          markStatic$1(block);\n          if (!block.static) {\n            node.static = false;\n          }\n        }\n      }\n    }\n  }\n\n  function markStaticRoots (node, isInFor) {\n    if (node.type === 1) {\n      if (node.static || node.once) {\n        node.staticInFor = isInFor;\n      }\n      // For a node to qualify as a static root, it should have children that\n      // are not just static text. Otherwise the cost of hoisting out will\n      // outweigh the benefits and it's better off to just always render it fresh.\n      if (node.static && node.children.length && !(\n        node.children.length === 1 &&\n        node.children[0].type === 3\n      )) {\n        node.staticRoot = true;\n        return\n      } else {\n        node.staticRoot = false;\n      }\n      if (node.children) {\n        for (var i = 0, l = node.children.length; i < l; i++) {\n          markStaticRoots(node.children[i], isInFor || !!node.for);\n        }\n      }\n      if (node.ifConditions) {\n        for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {\n          markStaticRoots(node.ifConditions[i$1].block, isInFor);\n        }\n      }\n    }\n  }\n\n  function isStatic (node) {\n    if (node.type === 2) { // expression\n      return false\n    }\n    if (node.type === 3) { // text\n      return true\n    }\n    return !!(node.pre || (\n      !node.hasBindings && // no dynamic bindings\n      !node.if && !node.for && // not v-if or v-for or v-else\n      !isBuiltInTag(node.tag) && // not a built-in\n      isPlatformReservedTag(node.tag) && // not a component\n      !isDirectChildOfTemplateFor(node) &&\n      Object.keys(node).every(isStaticKey)\n    ))\n  }\n\n  function isDirectChildOfTemplateFor (node) {\n    while (node.parent) {\n      node = node.parent;\n      if (node.tag !== 'template') {\n        return false\n      }\n      if (node.for) {\n        return true\n      }\n    }\n    return false\n  }\n\n  /*  */\n\n  var fnExpRE = /^([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\n  var fnInvokeRE = /\\([^)]*?\\);*$/;\n  var simplePathRE = /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?']|\\[\"[^\"]*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*$/;\n\n  // KeyboardEvent.keyCode aliases\n  var keyCodes = {\n    esc: 27,\n    tab: 9,\n    enter: 13,\n    space: 32,\n    up: 38,\n    left: 37,\n    right: 39,\n    down: 40,\n    'delete': [8, 46]\n  };\n\n  // KeyboardEvent.key aliases\n  var keyNames = {\n    // #7880: IE11 and Edge use `Esc` for Escape key name.\n    esc: ['Esc', 'Escape'],\n    tab: 'Tab',\n    enter: 'Enter',\n    // #9112: IE11 uses `Spacebar` for Space key name.\n    space: [' ', 'Spacebar'],\n    // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.\n    up: ['Up', 'ArrowUp'],\n    left: ['Left', 'ArrowLeft'],\n    right: ['Right', 'ArrowRight'],\n    down: ['Down', 'ArrowDown'],\n    // #9112: IE11 uses `Del` for Delete key name.\n    'delete': ['Backspace', 'Delete', 'Del']\n  };\n\n  // #4868: modifiers that prevent the execution of the listener\n  // need to explicitly return null so that we can determine whether to remove\n  // the listener for .once\n  var genGuard = function (condition) { return (\"if(\" + condition + \")return null;\"); };\n\n  var modifierCode = {\n    stop: '$event.stopPropagation();',\n    prevent: '$event.preventDefault();',\n    self: genGuard(\"$event.target !== $event.currentTarget\"),\n    ctrl: genGuard(\"!$event.ctrlKey\"),\n    shift: genGuard(\"!$event.shiftKey\"),\n    alt: genGuard(\"!$event.altKey\"),\n    meta: genGuard(\"!$event.metaKey\"),\n    left: genGuard(\"'button' in $event && $event.button !== 0\"),\n    middle: genGuard(\"'button' in $event && $event.button !== 1\"),\n    right: genGuard(\"'button' in $event && $event.button !== 2\")\n  };\n\n  function genHandlers (\n    events,\n    isNative\n  ) {\n    var prefix = isNative ? 'nativeOn:' : 'on:';\n    var staticHandlers = \"\";\n    var dynamicHandlers = \"\";\n    for (var name in events) {\n      var handlerCode = genHandler(events[name]);\n      if (events[name] && events[name].dynamic) {\n        dynamicHandlers += name + \",\" + handlerCode + \",\";\n      } else {\n        staticHandlers += \"\\\"\" + name + \"\\\":\" + handlerCode + \",\";\n      }\n    }\n    staticHandlers = \"{\" + (staticHandlers.slice(0, -1)) + \"}\";\n    if (dynamicHandlers) {\n      return prefix + \"_d(\" + staticHandlers + \",[\" + (dynamicHandlers.slice(0, -1)) + \"])\"\n    } else {\n      return prefix + staticHandlers\n    }\n  }\n\n  function genHandler (handler) {\n    if (!handler) {\n      return 'function(){}'\n    }\n\n    if (Array.isArray(handler)) {\n      return (\"[\" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + \"]\")\n    }\n\n    var isMethodPath = simplePathRE.test(handler.value);\n    var isFunctionExpression = fnExpRE.test(handler.value);\n    var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));\n\n    if (!handler.modifiers) {\n      if (isMethodPath || isFunctionExpression) {\n        return handler.value\n      }\n      return (\"function($event){\" + (isFunctionInvocation ? (\"return \" + (handler.value)) : handler.value) + \"}\") // inline statement\n    } else {\n      var code = '';\n      var genModifierCode = '';\n      var keys = [];\n      for (var key in handler.modifiers) {\n        if (modifierCode[key]) {\n          genModifierCode += modifierCode[key];\n          // left/right\n          if (keyCodes[key]) {\n            keys.push(key);\n          }\n        } else if (key === 'exact') {\n          var modifiers = (handler.modifiers);\n          genModifierCode += genGuard(\n            ['ctrl', 'shift', 'alt', 'meta']\n              .filter(function (keyModifier) { return !modifiers[keyModifier]; })\n              .map(function (keyModifier) { return (\"$event.\" + keyModifier + \"Key\"); })\n              .join('||')\n          );\n        } else {\n          keys.push(key);\n        }\n      }\n      if (keys.length) {\n        code += genKeyFilter(keys);\n      }\n      // Make sure modifiers like prevent and stop get executed after key filtering\n      if (genModifierCode) {\n        code += genModifierCode;\n      }\n      var handlerCode = isMethodPath\n        ? (\"return \" + (handler.value) + \"($event)\")\n        : isFunctionExpression\n          ? (\"return (\" + (handler.value) + \")($event)\")\n          : isFunctionInvocation\n            ? (\"return \" + (handler.value))\n            : handler.value;\n      return (\"function($event){\" + code + handlerCode + \"}\")\n    }\n  }\n\n  function genKeyFilter (keys) {\n    return (\n      // make sure the key filters only apply to KeyboardEvents\n      // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake\n      // key events that do not have keyCode property...\n      \"if(!$event.type.indexOf('key')&&\" +\n      (keys.map(genFilterCode).join('&&')) + \")return null;\"\n    )\n  }\n\n  function genFilterCode (key) {\n    var keyVal = parseInt(key, 10);\n    if (keyVal) {\n      return (\"$event.keyCode!==\" + keyVal)\n    }\n    var keyCode = keyCodes[key];\n    var keyName = keyNames[key];\n    return (\n      \"_k($event.keyCode,\" +\n      (JSON.stringify(key)) + \",\" +\n      (JSON.stringify(keyCode)) + \",\" +\n      \"$event.key,\" +\n      \"\" + (JSON.stringify(keyName)) +\n      \")\"\n    )\n  }\n\n  /*  */\n\n  function on (el, dir) {\n    if (dir.modifiers) {\n      warn(\"v-on without argument does not support modifiers.\");\n    }\n    el.wrapListeners = function (code) { return (\"_g(\" + code + \",\" + (dir.value) + \")\"); };\n  }\n\n  /*  */\n\n  function bind$1 (el, dir) {\n    el.wrapData = function (code) {\n      return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + \",\" + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + \")\")\n    };\n  }\n\n  /*  */\n\n  var baseDirectives = {\n    on: on,\n    bind: bind$1,\n    cloak: noop\n  };\n\n  /*  */\n\n\n\n\n\n  var CodegenState = function CodegenState (options) {\n    this.options = options;\n    this.warn = options.warn || baseWarn;\n    this.transforms = pluckModuleFunction(options.modules, 'transformCode');\n    this.dataGenFns = pluckModuleFunction(options.modules, 'genData');\n    this.directives = extend(extend({}, baseDirectives), options.directives);\n    var isReservedTag = options.isReservedTag || no;\n    this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };\n    this.onceId = 0;\n    this.staticRenderFns = [];\n    this.pre = false;\n  };\n\n\n\n  function generate (\n    ast,\n    options\n  ) {\n    var state = new CodegenState(options);\n    var code = ast ? genElement(ast, state) : '_c(\"div\")';\n    return {\n      render: (\"with(this){return \" + code + \"}\"),\n      staticRenderFns: state.staticRenderFns\n    }\n  }\n\n  function genElement (el, state) {\n    if (el.parent) {\n      el.pre = el.pre || el.parent.pre;\n    }\n\n    if (el.staticRoot && !el.staticProcessed) {\n      return genStatic(el, state)\n    } else if (el.once && !el.onceProcessed) {\n      return genOnce(el, state)\n    } else if (el.for && !el.forProcessed) {\n      return genFor(el, state)\n    } else if (el.if && !el.ifProcessed) {\n      return genIf(el, state)\n    } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {\n      return genChildren(el, state) || 'void 0'\n    } else if (el.tag === 'slot') {\n      return genSlot(el, state)\n    } else {\n      // component or element\n      var code;\n      if (el.component) {\n        code = genComponent(el.component, el, state);\n      } else {\n        var data;\n        if (!el.plain || (el.pre && state.maybeComponent(el))) {\n          data = genData$2(el, state);\n        }\n\n        var children = el.inlineTemplate ? null : genChildren(el, state, true);\n        code = \"_c('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n      }\n      // module transforms\n      for (var i = 0; i < state.transforms.length; i++) {\n        code = state.transforms[i](el, code);\n      }\n      return code\n    }\n  }\n\n  // hoist static sub-trees out\n  function genStatic (el, state) {\n    el.staticProcessed = true;\n    // Some elements (templates) need to behave differently inside of a v-pre\n    // node.  All pre nodes are static roots, so we can use this as a location to\n    // wrap a state change and reset it upon exiting the pre node.\n    var originalPreState = state.pre;\n    if (el.pre) {\n      state.pre = el.pre;\n    }\n    state.staticRenderFns.push((\"with(this){return \" + (genElement(el, state)) + \"}\"));\n    state.pre = originalPreState;\n    return (\"_m(\" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n  }\n\n  // v-once\n  function genOnce (el, state) {\n    el.onceProcessed = true;\n    if (el.if && !el.ifProcessed) {\n      return genIf(el, state)\n    } else if (el.staticInFor) {\n      var key = '';\n      var parent = el.parent;\n      while (parent) {\n        if (parent.for) {\n          key = parent.key;\n          break\n        }\n        parent = parent.parent;\n      }\n      if (!key) {\n        state.warn(\n          \"v-once can only be used inside v-for that is keyed. \",\n          el.rawAttrsMap['v-once']\n        );\n        return genElement(el, state)\n      }\n      return (\"_o(\" + (genElement(el, state)) + \",\" + (state.onceId++) + \",\" + key + \")\")\n    } else {\n      return genStatic(el, state)\n    }\n  }\n\n  function genIf (\n    el,\n    state,\n    altGen,\n    altEmpty\n  ) {\n    el.ifProcessed = true; // avoid recursion\n    return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)\n  }\n\n  function genIfConditions (\n    conditions,\n    state,\n    altGen,\n    altEmpty\n  ) {\n    if (!conditions.length) {\n      return altEmpty || '_e()'\n    }\n\n    var condition = conditions.shift();\n    if (condition.exp) {\n      return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions, state, altGen, altEmpty)))\n    } else {\n      return (\"\" + (genTernaryExp(condition.block)))\n    }\n\n    // v-if with v-once should generate code like (a)?_m(0):_m(1)\n    function genTernaryExp (el) {\n      return altGen\n        ? altGen(el, state)\n        : el.once\n          ? genOnce(el, state)\n          : genElement(el, state)\n    }\n  }\n\n  function genFor (\n    el,\n    state,\n    altGen,\n    altHelper\n  ) {\n    var exp = el.for;\n    var alias = el.alias;\n    var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n    var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n\n    if (state.maybeComponent(el) &&\n      el.tag !== 'slot' &&\n      el.tag !== 'template' &&\n      !el.key\n    ) {\n      state.warn(\n        \"<\" + (el.tag) + \" v-for=\\\"\" + alias + \" in \" + exp + \"\\\">: component lists rendered with \" +\n        \"v-for should have explicit keys. \" +\n        \"See https://vuejs.org/guide/list.html#key for more info.\",\n        el.rawAttrsMap['v-for'],\n        true /* tip */\n      );\n    }\n\n    el.forProcessed = true; // avoid recursion\n    return (altHelper || '_l') + \"((\" + exp + \"),\" +\n      \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n        \"return \" + ((altGen || genElement)(el, state)) +\n      '})'\n  }\n\n  function genData$2 (el, state) {\n    var data = '{';\n\n    // directives first.\n    // directives may mutate the el's other properties before they are generated.\n    var dirs = genDirectives(el, state);\n    if (dirs) { data += dirs + ','; }\n\n    // key\n    if (el.key) {\n      data += \"key:\" + (el.key) + \",\";\n    }\n    // ref\n    if (el.ref) {\n      data += \"ref:\" + (el.ref) + \",\";\n    }\n    if (el.refInFor) {\n      data += \"refInFor:true,\";\n    }\n    // pre\n    if (el.pre) {\n      data += \"pre:true,\";\n    }\n    // record original tag name for components using \"is\" attribute\n    if (el.component) {\n      data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n    }\n    // module data generation functions\n    for (var i = 0; i < state.dataGenFns.length; i++) {\n      data += state.dataGenFns[i](el);\n    }\n    // attributes\n    if (el.attrs) {\n      data += \"attrs:\" + (genProps(el.attrs)) + \",\";\n    }\n    // DOM props\n    if (el.props) {\n      data += \"domProps:\" + (genProps(el.props)) + \",\";\n    }\n    // event handlers\n    if (el.events) {\n      data += (genHandlers(el.events, false)) + \",\";\n    }\n    if (el.nativeEvents) {\n      data += (genHandlers(el.nativeEvents, true)) + \",\";\n    }\n    // slot target\n    // only for non-scoped slots\n    if (el.slotTarget && !el.slotScope) {\n      data += \"slot:\" + (el.slotTarget) + \",\";\n    }\n    // scoped slots\n    if (el.scopedSlots) {\n      data += (genScopedSlots(el, el.scopedSlots, state)) + \",\";\n    }\n    // component v-model\n    if (el.model) {\n      data += \"model:{value:\" + (el.model.value) + \",callback:\" + (el.model.callback) + \",expression:\" + (el.model.expression) + \"},\";\n    }\n    // inline-template\n    if (el.inlineTemplate) {\n      var inlineTemplate = genInlineTemplate(el, state);\n      if (inlineTemplate) {\n        data += inlineTemplate + \",\";\n      }\n    }\n    data = data.replace(/,$/, '') + '}';\n    // v-bind dynamic argument wrap\n    // v-bind with dynamic arguments must be applied using the same v-bind object\n    // merge helper so that class/style/mustUseProp attrs are handled correctly.\n    if (el.dynamicAttrs) {\n      data = \"_b(\" + data + \",\\\"\" + (el.tag) + \"\\\",\" + (genProps(el.dynamicAttrs)) + \")\";\n    }\n    // v-bind data wrap\n    if (el.wrapData) {\n      data = el.wrapData(data);\n    }\n    // v-on data wrap\n    if (el.wrapListeners) {\n      data = el.wrapListeners(data);\n    }\n    return data\n  }\n\n  function genDirectives (el, state) {\n    var dirs = el.directives;\n    if (!dirs) { return }\n    var res = 'directives:[';\n    var hasRuntime = false;\n    var i, l, dir, needRuntime;\n    for (i = 0, l = dirs.length; i < l; i++) {\n      dir = dirs[i];\n      needRuntime = true;\n      var gen = state.directives[dir.name];\n      if (gen) {\n        // compile-time directive that manipulates AST.\n        // returns true if it also needs a runtime counterpart.\n        needRuntime = !!gen(el, dir, state.warn);\n      }\n      if (needRuntime) {\n        hasRuntime = true;\n        res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\" + (dir.isDynamicArg ? dir.arg : (\"\\\"\" + (dir.arg) + \"\\\"\"))) : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n      }\n    }\n    if (hasRuntime) {\n      return res.slice(0, -1) + ']'\n    }\n  }\n\n  function genInlineTemplate (el, state) {\n    var ast = el.children[0];\n    if (el.children.length !== 1 || ast.type !== 1) {\n      state.warn(\n        'Inline-template components must have exactly one child element.',\n        { start: el.start }\n      );\n    }\n    if (ast && ast.type === 1) {\n      var inlineRenderFns = generate(ast, state.options);\n      return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n    }\n  }\n\n  function genScopedSlots (\n    el,\n    slots,\n    state\n  ) {\n    // by default scoped slots are considered \"stable\", this allows child\n    // components with only scoped slots to skip forced updates from parent.\n    // but in some cases we have to bail-out of this optimization\n    // for example if the slot contains dynamic names, has v-if or v-for on them...\n    var needsForceUpdate = Object.keys(slots).some(function (key) {\n      var slot = slots[key];\n      return (\n        slot.slotTargetDynamic ||\n        slot.if ||\n        slot.for ||\n        containsSlotChild(slot) // is passing down slot from parent which may be dynamic\n      )\n    });\n\n    // #9534: if a component with scoped slots is inside a conditional branch,\n    // it's possible for the same component to be reused but with different\n    // compiled slot content. To avoid that, we generate a unique key based on\n    // the generated code of all the slot contents.\n    var needsKey = !!el.if;\n\n    // OR when it is inside another scoped slot or v-for (the reactivity may be\n    // disconnected due to the intermediate scope variable)\n    // #9438, #9506\n    // TODO: this can be further optimized by properly analyzing in-scope bindings\n    // and skip force updating ones that do not actually use scope variables.\n    if (!needsForceUpdate) {\n      var parent = el.parent;\n      while (parent) {\n        if (\n          (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||\n          parent.for\n        ) {\n          needsForceUpdate = true;\n          break\n        }\n        if (parent.if) {\n          needsKey = true;\n        }\n        parent = parent.parent;\n      }\n    }\n\n    var generatedSlots = Object.keys(slots)\n      .map(function (key) { return genScopedSlot(slots[key], state); })\n      .join(',');\n\n    return (\"scopedSlots:_u([\" + generatedSlots + \"]\" + (needsForceUpdate ? \",null,true\" : \"\") + (!needsForceUpdate && needsKey ? (\",null,false,\" + (hash(generatedSlots))) : \"\") + \")\")\n  }\n\n  function hash(str) {\n    var hash = 5381;\n    var i = str.length;\n    while(i) {\n      hash = (hash * 33) ^ str.charCodeAt(--i);\n    }\n    return hash >>> 0\n  }\n\n  function containsSlotChild (el) {\n    if (el.type === 1) {\n      if (el.tag === 'slot') {\n        return true\n      }\n      return el.children.some(containsSlotChild)\n    }\n    return false\n  }\n\n  function genScopedSlot (\n    el,\n    state\n  ) {\n    var isLegacySyntax = el.attrsMap['slot-scope'];\n    if (el.if && !el.ifProcessed && !isLegacySyntax) {\n      return genIf(el, state, genScopedSlot, \"null\")\n    }\n    if (el.for && !el.forProcessed) {\n      return genFor(el, state, genScopedSlot)\n    }\n    var slotScope = el.slotScope === emptySlotScopeToken\n      ? \"\"\n      : String(el.slotScope);\n    var fn = \"function(\" + slotScope + \"){\" +\n      \"return \" + (el.tag === 'template'\n        ? el.if && isLegacySyntax\n          ? (\"(\" + (el.if) + \")?\" + (genChildren(el, state) || 'undefined') + \":undefined\")\n          : genChildren(el, state) || 'undefined'\n        : genElement(el, state)) + \"}\";\n    // reverse proxy v-slot without scope on this.$slots\n    var reverseProxy = slotScope ? \"\" : \",proxy:true\";\n    return (\"{key:\" + (el.slotTarget || \"\\\"default\\\"\") + \",fn:\" + fn + reverseProxy + \"}\")\n  }\n\n  function genChildren (\n    el,\n    state,\n    checkSkip,\n    altGenElement,\n    altGenNode\n  ) {\n    var children = el.children;\n    if (children.length) {\n      var el$1 = children[0];\n      // optimize single v-for\n      if (children.length === 1 &&\n        el$1.for &&\n        el$1.tag !== 'template' &&\n        el$1.tag !== 'slot'\n      ) {\n        var normalizationType = checkSkip\n          ? state.maybeComponent(el$1) ? \",1\" : \",0\"\n          : \"\";\n        return (\"\" + ((altGenElement || genElement)(el$1, state)) + normalizationType)\n      }\n      var normalizationType$1 = checkSkip\n        ? getNormalizationType(children, state.maybeComponent)\n        : 0;\n      var gen = altGenNode || genNode;\n      return (\"[\" + (children.map(function (c) { return gen(c, state); }).join(',')) + \"]\" + (normalizationType$1 ? (\",\" + normalizationType$1) : ''))\n    }\n  }\n\n  // determine the normalization needed for the children array.\n  // 0: no normalization needed\n  // 1: simple normalization needed (possible 1-level deep nested array)\n  // 2: full normalization needed\n  function getNormalizationType (\n    children,\n    maybeComponent\n  ) {\n    var res = 0;\n    for (var i = 0; i < children.length; i++) {\n      var el = children[i];\n      if (el.type !== 1) {\n        continue\n      }\n      if (needsNormalization(el) ||\n          (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {\n        res = 2;\n        break\n      }\n      if (maybeComponent(el) ||\n          (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {\n        res = 1;\n      }\n    }\n    return res\n  }\n\n  function needsNormalization (el) {\n    return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'\n  }\n\n  function genNode (node, state) {\n    if (node.type === 1) {\n      return genElement(node, state)\n    } else if (node.type === 3 && node.isComment) {\n      return genComment(node)\n    } else {\n      return genText(node)\n    }\n  }\n\n  function genText (text) {\n    return (\"_v(\" + (text.type === 2\n      ? text.expression // no need for () because already wrapped in _s()\n      : transformSpecialNewlines(JSON.stringify(text.text))) + \")\")\n  }\n\n  function genComment (comment) {\n    return (\"_e(\" + (JSON.stringify(comment.text)) + \")\")\n  }\n\n  function genSlot (el, state) {\n    var slotName = el.slotName || '\"default\"';\n    var children = genChildren(el, state);\n    var res = \"_t(\" + slotName + (children ? (\",\" + children) : '');\n    var attrs = el.attrs || el.dynamicAttrs\n      ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({\n          // slot props are camelized\n          name: camelize(attr.name),\n          value: attr.value,\n          dynamic: attr.dynamic\n        }); }))\n      : null;\n    var bind$$1 = el.attrsMap['v-bind'];\n    if ((attrs || bind$$1) && !children) {\n      res += \",null\";\n    }\n    if (attrs) {\n      res += \",\" + attrs;\n    }\n    if (bind$$1) {\n      res += (attrs ? '' : ',null') + \",\" + bind$$1;\n    }\n    return res + ')'\n  }\n\n  // componentName is el.component, take it as argument to shun flow's pessimistic refinement\n  function genComponent (\n    componentName,\n    el,\n    state\n  ) {\n    var children = el.inlineTemplate ? null : genChildren(el, state, true);\n    return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n  }\n\n  function genProps (props) {\n    var staticProps = \"\";\n    var dynamicProps = \"\";\n    for (var i = 0; i < props.length; i++) {\n      var prop = props[i];\n      var value = transformSpecialNewlines(prop.value);\n      if (prop.dynamic) {\n        dynamicProps += (prop.name) + \",\" + value + \",\";\n      } else {\n        staticProps += \"\\\"\" + (prop.name) + \"\\\":\" + value + \",\";\n      }\n    }\n    staticProps = \"{\" + (staticProps.slice(0, -1)) + \"}\";\n    if (dynamicProps) {\n      return (\"_d(\" + staticProps + \",[\" + (dynamicProps.slice(0, -1)) + \"])\")\n    } else {\n      return staticProps\n    }\n  }\n\n  // #3895, #4268\n  function transformSpecialNewlines (text) {\n    return text\n      .replace(/\\u2028/g, '\\\\u2028')\n      .replace(/\\u2029/g, '\\\\u2029')\n  }\n\n  /*  */\n\n\n\n  // these keywords should not appear inside expressions, but operators like\n  // typeof, instanceof and in are allowed\n  var prohibitedKeywordRE = new RegExp('\\\\b' + (\n    'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n    'super,throw,while,yield,delete,export,import,return,switch,default,' +\n    'extends,finally,continue,debugger,function,arguments'\n  ).split(',').join('\\\\b|\\\\b') + '\\\\b');\n\n  // these unary operators should not be used as property/method names\n  var unaryOperatorsRE = new RegExp('\\\\b' + (\n    'delete,typeof,void'\n  ).split(',').join('\\\\s*\\\\([^\\\\)]*\\\\)|\\\\b') + '\\\\s*\\\\([^\\\\)]*\\\\)');\n\n  // strip strings in expressions\n  var stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n  // detect problematic expressions in a template\n  function detectErrors (ast, warn) {\n    if (ast) {\n      checkNode(ast, warn);\n    }\n  }\n\n  function checkNode (node, warn) {\n    if (node.type === 1) {\n      for (var name in node.attrsMap) {\n        if (dirRE.test(name)) {\n          var value = node.attrsMap[name];\n          if (value) {\n            var range = node.rawAttrsMap[name];\n            if (name === 'v-for') {\n              checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), warn, range);\n            } else if (onRE.test(name)) {\n              checkEvent(value, (name + \"=\\\"\" + value + \"\\\"\"), warn, range);\n            } else {\n              checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), warn, range);\n            }\n          }\n        }\n      }\n      if (node.children) {\n        for (var i = 0; i < node.children.length; i++) {\n          checkNode(node.children[i], warn);\n        }\n      }\n    } else if (node.type === 2) {\n      checkExpression(node.expression, node.text, warn, node);\n    }\n  }\n\n  function checkEvent (exp, text, warn, range) {\n    var stipped = exp.replace(stripStringRE, '');\n    var keywordMatch = stipped.match(unaryOperatorsRE);\n    if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {\n      warn(\n        \"avoid using JavaScript unary operator as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + (text.trim()),\n        range\n      );\n    }\n    checkExpression(exp, text, warn, range);\n  }\n\n  function checkFor (node, text, warn, range) {\n    checkExpression(node.for || '', text, warn, range);\n    checkIdentifier(node.alias, 'v-for alias', text, warn, range);\n    checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);\n    checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);\n  }\n\n  function checkIdentifier (\n    ident,\n    type,\n    text,\n    warn,\n    range\n  ) {\n    if (typeof ident === 'string') {\n      try {\n        new Function((\"var \" + ident + \"=_\"));\n      } catch (e) {\n        warn((\"invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + (text.trim())), range);\n      }\n    }\n  }\n\n  function checkExpression (exp, text, warn, range) {\n    try {\n      new Function((\"return \" + exp));\n    } catch (e) {\n      var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n      if (keywordMatch) {\n        warn(\n          \"avoid using JavaScript keyword as property name: \" +\n          \"\\\"\" + (keywordMatch[0]) + \"\\\"\\n  Raw expression: \" + (text.trim()),\n          range\n        );\n      } else {\n        warn(\n          \"invalid expression: \" + (e.message) + \" in\\n\\n\" +\n          \"    \" + exp + \"\\n\\n\" +\n          \"  Raw expression: \" + (text.trim()) + \"\\n\",\n          range\n        );\n      }\n    }\n  }\n\n  /*  */\n\n  var range = 2;\n\n  function generateCodeFrame (\n    source,\n    start,\n    end\n  ) {\n    if ( start === void 0 ) start = 0;\n    if ( end === void 0 ) end = source.length;\n\n    var lines = source.split(/\\r?\\n/);\n    var count = 0;\n    var res = [];\n    for (var i = 0; i < lines.length; i++) {\n      count += lines[i].length + 1;\n      if (count >= start) {\n        for (var j = i - range; j <= i + range || end > count; j++) {\n          if (j < 0 || j >= lines.length) { continue }\n          res.push((\"\" + (j + 1) + (repeat$1(\" \", 3 - String(j + 1).length)) + \"|  \" + (lines[j])));\n          var lineLength = lines[j].length;\n          if (j === i) {\n            // push underline\n            var pad = start - (count - lineLength) + 1;\n            var length = end > count ? lineLength - pad : end - start;\n            res.push(\"   |  \" + repeat$1(\" \", pad) + repeat$1(\"^\", length));\n          } else if (j > i) {\n            if (end > count) {\n              var length$1 = Math.min(end - count, lineLength);\n              res.push(\"   |  \" + repeat$1(\"^\", length$1));\n            }\n            count += lineLength + 1;\n          }\n        }\n        break\n      }\n    }\n    return res.join('\\n')\n  }\n\n  function repeat$1 (str, n) {\n    var result = '';\n    if (n > 0) {\n      while (true) { // eslint-disable-line\n        if (n & 1) { result += str; }\n        n >>>= 1;\n        if (n <= 0) { break }\n        str += str;\n      }\n    }\n    return result\n  }\n\n  /*  */\n\n\n\n  function createFunction (code, errors) {\n    try {\n      return new Function(code)\n    } catch (err) {\n      errors.push({ err: err, code: code });\n      return noop\n    }\n  }\n\n  function createCompileToFunctionFn (compile) {\n    var cache = Object.create(null);\n\n    return function compileToFunctions (\n      template,\n      options,\n      vm\n    ) {\n      options = extend({}, options);\n      var warn$$1 = options.warn || warn;\n      delete options.warn;\n\n      /* istanbul ignore if */\n      {\n        // detect possible CSP restriction\n        try {\n          new Function('return 1');\n        } catch (e) {\n          if (e.toString().match(/unsafe-eval|CSP/)) {\n            warn$$1(\n              'It seems you are using the standalone build of Vue.js in an ' +\n              'environment with Content Security Policy that prohibits unsafe-eval. ' +\n              'The template compiler cannot work in this environment. Consider ' +\n              'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n              'templates into render functions.'\n            );\n          }\n        }\n      }\n\n      // check cache\n      var key = options.delimiters\n        ? String(options.delimiters) + template\n        : template;\n      if (cache[key]) {\n        return cache[key]\n      }\n\n      // compile\n      var compiled = compile(template, options);\n\n      // check compilation errors/tips\n      {\n        if (compiled.errors && compiled.errors.length) {\n          if (options.outputSourceRange) {\n            compiled.errors.forEach(function (e) {\n              warn$$1(\n                \"Error compiling template:\\n\\n\" + (e.msg) + \"\\n\\n\" +\n                generateCodeFrame(template, e.start, e.end),\n                vm\n              );\n            });\n          } else {\n            warn$$1(\n              \"Error compiling template:\\n\\n\" + template + \"\\n\\n\" +\n              compiled.errors.map(function (e) { return (\"- \" + e); }).join('\\n') + '\\n',\n              vm\n            );\n          }\n        }\n        if (compiled.tips && compiled.tips.length) {\n          if (options.outputSourceRange) {\n            compiled.tips.forEach(function (e) { return tip(e.msg, vm); });\n          } else {\n            compiled.tips.forEach(function (msg) { return tip(msg, vm); });\n          }\n        }\n      }\n\n      // turn code into functions\n      var res = {};\n      var fnGenErrors = [];\n      res.render = createFunction(compiled.render, fnGenErrors);\n      res.staticRenderFns = compiled.staticRenderFns.map(function (code) {\n        return createFunction(code, fnGenErrors)\n      });\n\n      // check function generation errors.\n      // this should only happen if there is a bug in the compiler itself.\n      // mostly for codegen development use\n      /* istanbul ignore if */\n      {\n        if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {\n          warn$$1(\n            \"Failed to generate render function:\\n\\n\" +\n            fnGenErrors.map(function (ref) {\n              var err = ref.err;\n              var code = ref.code;\n\n              return ((err.toString()) + \" in\\n\\n\" + code + \"\\n\");\n          }).join('\\n'),\n            vm\n          );\n        }\n      }\n\n      return (cache[key] = res)\n    }\n  }\n\n  /*  */\n\n  function createCompilerCreator (baseCompile) {\n    return function createCompiler (baseOptions) {\n      function compile (\n        template,\n        options\n      ) {\n        var finalOptions = Object.create(baseOptions);\n        var errors = [];\n        var tips = [];\n\n        var warn = function (msg, range, tip) {\n          (tip ? tips : errors).push(msg);\n        };\n\n        if (options) {\n          if (options.outputSourceRange) {\n            // $flow-disable-line\n            var leadingSpaceLength = template.match(/^\\s*/)[0].length;\n\n            warn = function (msg, range, tip) {\n              var data = { msg: msg };\n              if (range) {\n                if (range.start != null) {\n                  data.start = range.start + leadingSpaceLength;\n                }\n                if (range.end != null) {\n                  data.end = range.end + leadingSpaceLength;\n                }\n              }\n              (tip ? tips : errors).push(data);\n            };\n          }\n          // merge custom modules\n          if (options.modules) {\n            finalOptions.modules =\n              (baseOptions.modules || []).concat(options.modules);\n          }\n          // merge custom directives\n          if (options.directives) {\n            finalOptions.directives = extend(\n              Object.create(baseOptions.directives || null),\n              options.directives\n            );\n          }\n          // copy other options\n          for (var key in options) {\n            if (key !== 'modules' && key !== 'directives') {\n              finalOptions[key] = options[key];\n            }\n          }\n        }\n\n        finalOptions.warn = warn;\n\n        var compiled = baseCompile(template.trim(), finalOptions);\n        {\n          detectErrors(compiled.ast, warn);\n        }\n        compiled.errors = errors;\n        compiled.tips = tips;\n        return compiled\n      }\n\n      return {\n        compile: compile,\n        compileToFunctions: createCompileToFunctionFn(compile)\n      }\n    }\n  }\n\n  /*  */\n\n  // `createCompilerCreator` allows creating compilers that use alternative\n  // parser/optimizer/codegen, e.g the SSR optimizing compiler.\n  // Here we just export a default compiler using the default parts.\n  var createCompiler = createCompilerCreator(function baseCompile (\n    template,\n    options\n  ) {\n    var ast = parse(template.trim(), options);\n    if (options.optimize !== false) {\n      optimize(ast, options);\n    }\n    var code = generate(ast, options);\n    return {\n      ast: ast,\n      render: code.render,\n      staticRenderFns: code.staticRenderFns\n    }\n  });\n\n  /*  */\n\n  var ref$1 = createCompiler(baseOptions);\n  var compile = ref$1.compile;\n  var compileToFunctions = ref$1.compileToFunctions;\n\n  /*  */\n\n  // check whether current browser encodes a char inside attribute values\n  var div;\n  function getShouldDecode (href) {\n    div = div || document.createElement('div');\n    div.innerHTML = href ? \"<a href=\\\"\\n\\\"/>\" : \"<div a=\\\"\\n\\\"/>\";\n    return div.innerHTML.indexOf('&#10;') > 0\n  }\n\n  // #3663: IE encodes newlines inside attribute values while other browsers don't\n  var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;\n  // #6828: chrome encodes content in a[href]\n  var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;\n\n  /*  */\n\n  var idToTemplate = cached(function (id) {\n    var el = query(id);\n    return el && el.innerHTML\n  });\n\n  var mount = Vue.prototype.$mount;\n  Vue.prototype.$mount = function (\n    el,\n    hydrating\n  ) {\n    el = el && query(el);\n\n    /* istanbul ignore if */\n    if (el === document.body || el === document.documentElement) {\n      warn(\n        \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n      );\n      return this\n    }\n\n    var options = this.$options;\n    // resolve template/el and convert to render function\n    if (!options.render) {\n      var template = options.template;\n      if (template) {\n        if (typeof template === 'string') {\n          if (template.charAt(0) === '#') {\n            template = idToTemplate(template);\n            /* istanbul ignore if */\n            if (!template) {\n              warn(\n                (\"Template element not found or is empty: \" + (options.template)),\n                this\n              );\n            }\n          }\n        } else if (template.nodeType) {\n          template = template.innerHTML;\n        } else {\n          {\n            warn('invalid template option:' + template, this);\n          }\n          return this\n        }\n      } else if (el) {\n        template = getOuterHTML(el);\n      }\n      if (template) {\n        /* istanbul ignore if */\n        if (config.performance && mark) {\n          mark('compile');\n        }\n\n        var ref = compileToFunctions(template, {\n          outputSourceRange: \"development\" !== 'production',\n          shouldDecodeNewlines: shouldDecodeNewlines,\n          shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,\n          delimiters: options.delimiters,\n          comments: options.comments\n        }, this);\n        var render = ref.render;\n        var staticRenderFns = ref.staticRenderFns;\n        options.render = render;\n        options.staticRenderFns = staticRenderFns;\n\n        /* istanbul ignore if */\n        if (config.performance && mark) {\n          mark('compile end');\n          measure((\"vue \" + (this._name) + \" compile\"), 'compile', 'compile end');\n        }\n      }\n    }\n    return mount.call(this, el, hydrating)\n  };\n\n  /**\n   * Get outerHTML of elements, taking care\n   * of SVG elements in IE as well.\n   */\n  function getOuterHTML (el) {\n    if (el.outerHTML) {\n      return el.outerHTML\n    } else {\n      var container = document.createElement('div');\n      container.appendChild(el.cloneNode(true));\n      return container.innerHTML\n    }\n  }\n\n  Vue.compile = compileToFunctions;\n\n  return Vue;\n\n}));\n"
  },
  {
    "path": "calllib-v3/web-im-v3/lib/vue-router-3.0.2.js",
    "content": "/*!\n  * vue-router v3.0.2\n  * (c) 2018 Evan You\n  * @license MIT\n  */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.VueRouter = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\nfunction assert (condition, message) {\n  if (!condition) {\n    throw new Error((\"[vue-router] \" + message))\n  }\n}\n\nfunction warn (condition, message) {\n  if (\"development\" !== 'production' && !condition) {\n    typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n  }\n}\n\nfunction isError (err) {\n  return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction extend (a, b) {\n  for (var key in b) {\n    a[key] = b[key];\n  }\n  return a\n}\n\nvar View = {\n  name: 'RouterView',\n  functional: true,\n  props: {\n    name: {\n      type: String,\n      default: 'default'\n    }\n  },\n  render: function render (_, ref) {\n    var props = ref.props;\n    var children = ref.children;\n    var parent = ref.parent;\n    var data = ref.data;\n\n    // used by devtools to display a router-view badge\n    data.routerView = true;\n\n    // directly use parent context's createElement() function\n    // so that components rendered by router-view can resolve named slots\n    var h = parent.$createElement;\n    var name = props.name;\n    var route = parent.$route;\n    var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n    // determine current view depth, also check to see if the tree\n    // has been toggled inactive but kept-alive.\n    var depth = 0;\n    var inactive = false;\n    while (parent && parent._routerRoot !== parent) {\n      if (parent.$vnode && parent.$vnode.data.routerView) {\n        depth++;\n      }\n      if (parent._inactive) {\n        inactive = true;\n      }\n      parent = parent.$parent;\n    }\n    data.routerViewDepth = depth;\n\n    // render previous view if the tree is inactive and kept-alive\n    if (inactive) {\n      return h(cache[name], data, children)\n    }\n\n    var matched = route.matched[depth];\n    // render empty node if no matched route\n    if (!matched) {\n      cache[name] = null;\n      return h()\n    }\n\n    var component = cache[name] = matched.components[name];\n\n    // attach instance registration hook\n    // this will be called in the instance's injected lifecycle hooks\n    data.registerRouteInstance = function (vm, val) {\n      // val could be undefined for unregistration\n      var current = matched.instances[name];\n      if (\n        (val && current !== vm) ||\n        (!val && current === vm)\n      ) {\n        matched.instances[name] = val;\n      }\n    }\n\n    // also register instance in prepatch hook\n    // in case the same component instance is reused across different routes\n    ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n      matched.instances[name] = vnode.componentInstance;\n    };\n\n    // resolve props\n    var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);\n    if (propsToPass) {\n      // clone to prevent mutation\n      propsToPass = data.props = extend({}, propsToPass);\n      // pass non-declared props as attrs\n      var attrs = data.attrs = data.attrs || {};\n      for (var key in propsToPass) {\n        if (!component.props || !(key in component.props)) {\n          attrs[key] = propsToPass[key];\n          delete propsToPass[key];\n        }\n      }\n    }\n\n    return h(component, data, children)\n  }\n}\n\nfunction resolveProps (route, config) {\n  switch (typeof config) {\n    case 'undefined':\n      return\n    case 'object':\n      return config\n    case 'function':\n      return config(route)\n    case 'boolean':\n      return config ? route.params : undefined\n    default:\n      {\n        warn(\n          false,\n          \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n          \"expecting an object, function or boolean.\"\n        );\n      }\n  }\n}\n\n/*  */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n  .replace(encodeReserveRE, encodeReserveReplacer)\n  .replace(commaRE, ','); };\n\nvar decode = decodeURIComponent;\n\nfunction resolveQuery (\n  query,\n  extraQuery,\n  _parseQuery\n) {\n  if ( extraQuery === void 0 ) extraQuery = {};\n\n  var parse = _parseQuery || parseQuery;\n  var parsedQuery;\n  try {\n    parsedQuery = parse(query || '');\n  } catch (e) {\n    \"development\" !== 'production' && warn(false, e.message);\n    parsedQuery = {};\n  }\n  for (var key in extraQuery) {\n    parsedQuery[key] = extraQuery[key];\n  }\n  return parsedQuery\n}\n\nfunction parseQuery (query) {\n  var res = {};\n\n  query = query.trim().replace(/^(\\?|#|&)/, '');\n\n  if (!query) {\n    return res\n  }\n\n  query.split('&').forEach(function (param) {\n    var parts = param.replace(/\\+/g, ' ').split('=');\n    var key = decode(parts.shift());\n    var val = parts.length > 0\n      ? decode(parts.join('='))\n      : null;\n\n    if (res[key] === undefined) {\n      res[key] = val;\n    } else if (Array.isArray(res[key])) {\n      res[key].push(val);\n    } else {\n      res[key] = [res[key], val];\n    }\n  });\n\n  return res\n}\n\nfunction stringifyQuery (obj) {\n  var res = obj ? Object.keys(obj).map(function (key) {\n    var val = obj[key];\n\n    if (val === undefined) {\n      return ''\n    }\n\n    if (val === null) {\n      return encode(key)\n    }\n\n    if (Array.isArray(val)) {\n      var result = [];\n      val.forEach(function (val2) {\n        if (val2 === undefined) {\n          return\n        }\n        if (val2 === null) {\n          result.push(encode(key));\n        } else {\n          result.push(encode(key) + '=' + encode(val2));\n        }\n      });\n      return result.join('&')\n    }\n\n    return encode(key) + '=' + encode(val)\n  }).filter(function (x) { return x.length > 0; }).join('&') : null;\n  return res ? (\"?\" + res) : ''\n}\n\n/*  */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n  record,\n  location,\n  redirectedFrom,\n  router\n) {\n  var stringifyQuery$$1 = router && router.options.stringifyQuery;\n\n  var query = location.query || {};\n  try {\n    query = clone(query);\n  } catch (e) {}\n\n  var route = {\n    name: location.name || (record && record.name),\n    meta: (record && record.meta) || {},\n    path: location.path || '/',\n    hash: location.hash || '',\n    query: query,\n    params: location.params || {},\n    fullPath: getFullPath(location, stringifyQuery$$1),\n    matched: record ? formatMatch(record) : []\n  };\n  if (redirectedFrom) {\n    route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1);\n  }\n  return Object.freeze(route)\n}\n\nfunction clone (value) {\n  if (Array.isArray(value)) {\n    return value.map(clone)\n  } else if (value && typeof value === 'object') {\n    var res = {};\n    for (var key in value) {\n      res[key] = clone(value[key]);\n    }\n    return res\n  } else {\n    return value\n  }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n  path: '/'\n});\n\nfunction formatMatch (record) {\n  var res = [];\n  while (record) {\n    res.unshift(record);\n    record = record.parent;\n  }\n  return res\n}\n\nfunction getFullPath (\n  ref,\n  _stringifyQuery\n) {\n  var path = ref.path;\n  var query = ref.query; if ( query === void 0 ) query = {};\n  var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n  var stringify = _stringifyQuery || stringifyQuery;\n  return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b) {\n  if (b === START) {\n    return a === b\n  } else if (!b) {\n    return false\n  } else if (a.path && b.path) {\n    return (\n      a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query)\n    )\n  } else if (a.name && b.name) {\n    return (\n      a.name === b.name &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query) &&\n      isObjectEqual(a.params, b.params)\n    )\n  } else {\n    return false\n  }\n}\n\nfunction isObjectEqual (a, b) {\n  if ( a === void 0 ) a = {};\n  if ( b === void 0 ) b = {};\n\n  // handle null value #1566\n  if (!a || !b) { return a === b }\n  var aKeys = Object.keys(a);\n  var bKeys = Object.keys(b);\n  if (aKeys.length !== bKeys.length) {\n    return false\n  }\n  return aKeys.every(function (key) {\n    var aVal = a[key];\n    var bVal = b[key];\n    // check nested equality\n    if (typeof aVal === 'object' && typeof bVal === 'object') {\n      return isObjectEqual(aVal, bVal)\n    }\n    return String(aVal) === String(bVal)\n  })\n}\n\nfunction isIncludedRoute (current, target) {\n  return (\n    current.path.replace(trailingSlashRE, '/').indexOf(\n      target.path.replace(trailingSlashRE, '/')\n    ) === 0 &&\n    (!target.hash || current.hash === target.hash) &&\n    queryIncludes(current.query, target.query)\n  )\n}\n\nfunction queryIncludes (current, target) {\n  for (var key in target) {\n    if (!(key in current)) {\n      return false\n    }\n  }\n  return true\n}\n\n/*  */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar Link = {\n  name: 'RouterLink',\n  props: {\n    to: {\n      type: toTypes,\n      required: true\n    },\n    tag: {\n      type: String,\n      default: 'a'\n    },\n    exact: Boolean,\n    append: Boolean,\n    replace: Boolean,\n    activeClass: String,\n    exactActiveClass: String,\n    event: {\n      type: eventTypes,\n      default: 'click'\n    }\n  },\n  render: function render (h) {\n    var this$1 = this;\n\n    var router = this.$router;\n    var current = this.$route;\n    var ref = router.resolve(this.to, current, this.append);\n    var location = ref.location;\n    var route = ref.route;\n    var href = ref.href;\n\n    var classes = {};\n    var globalActiveClass = router.options.linkActiveClass;\n    var globalExactActiveClass = router.options.linkExactActiveClass;\n    // Support global empty active class\n    var activeClassFallback = globalActiveClass == null\n      ? 'router-link-active'\n      : globalActiveClass;\n    var exactActiveClassFallback = globalExactActiveClass == null\n      ? 'router-link-exact-active'\n      : globalExactActiveClass;\n    var activeClass = this.activeClass == null\n      ? activeClassFallback\n      : this.activeClass;\n    var exactActiveClass = this.exactActiveClass == null\n      ? exactActiveClassFallback\n      : this.exactActiveClass;\n    var compareTarget = location.path\n      ? createRoute(null, location, null, router)\n      : route;\n\n    classes[exactActiveClass] = isSameRoute(current, compareTarget);\n    classes[activeClass] = this.exact\n      ? classes[exactActiveClass]\n      : isIncludedRoute(current, compareTarget);\n\n    var handler = function (e) {\n      if (guardEvent(e)) {\n        if (this$1.replace) {\n          router.replace(location);\n        } else {\n          router.push(location);\n        }\n      }\n    };\n\n    var on = { click: guardEvent };\n    if (Array.isArray(this.event)) {\n      this.event.forEach(function (e) { on[e] = handler; });\n    } else {\n      on[this.event] = handler;\n    }\n\n    var data = {\n      class: classes\n    };\n\n    if (this.tag === 'a') {\n      data.on = on;\n      data.attrs = { href: href };\n    } else {\n      // find the first <a> child and apply listener and href\n      var a = findAnchor(this.$slots.default);\n      if (a) {\n        // in case the <a> is a static node\n        a.isStatic = false;\n        var aData = a.data = extend({}, a.data);\n        aData.on = on;\n        var aAttrs = a.data.attrs = extend({}, a.data.attrs);\n        aAttrs.href = href;\n      } else {\n        // doesn't have <a> child, apply listener to self\n        data.on = on;\n      }\n    }\n\n    return h(this.tag, data, this.$slots.default)\n  }\n}\n\nfunction guardEvent (e) {\n  // don't redirect with control keys\n  if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n  // don't redirect when preventDefault called\n  if (e.defaultPrevented) { return }\n  // don't redirect on right click\n  if (e.button !== undefined && e.button !== 0) { return }\n  // don't redirect if `target=\"_blank\"`\n  if (e.currentTarget && e.currentTarget.getAttribute) {\n    var target = e.currentTarget.getAttribute('target');\n    if (/\\b_blank\\b/i.test(target)) { return }\n  }\n  // this may be a Weex event which doesn't have this method\n  if (e.preventDefault) {\n    e.preventDefault();\n  }\n  return true\n}\n\nfunction findAnchor (children) {\n  if (children) {\n    var child;\n    for (var i = 0; i < children.length; i++) {\n      child = children[i];\n      if (child.tag === 'a') {\n        return child\n      }\n      if (child.children && (child = findAnchor(child.children))) {\n        return child\n      }\n    }\n  }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n  if (install.installed && _Vue === Vue) { return }\n  install.installed = true;\n\n  _Vue = Vue;\n\n  var isDef = function (v) { return v !== undefined; };\n\n  var registerInstance = function (vm, callVal) {\n    var i = vm.$options._parentVnode;\n    if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n      i(vm, callVal);\n    }\n  };\n\n  Vue.mixin({\n    beforeCreate: function beforeCreate () {\n      if (isDef(this.$options.router)) {\n        this._routerRoot = this;\n        this._router = this.$options.router;\n        this._router.init(this);\n        Vue.util.defineReactive(this, '_route', this._router.history.current);\n      } else {\n        this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n      }\n      registerInstance(this, this);\n    },\n    destroyed: function destroyed () {\n      registerInstance(this);\n    }\n  });\n\n  Object.defineProperty(Vue.prototype, '$router', {\n    get: function get () { return this._routerRoot._router }\n  });\n\n  Object.defineProperty(Vue.prototype, '$route', {\n    get: function get () { return this._routerRoot._route }\n  });\n\n  Vue.component('RouterView', View);\n  Vue.component('RouterLink', Link);\n\n  var strats = Vue.config.optionMergeStrategies;\n  // use the same hook merging strategy for route hooks\n  strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/*  */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/*  */\n\nfunction resolvePath (\n  relative,\n  base,\n  append\n) {\n  var firstChar = relative.charAt(0);\n  if (firstChar === '/') {\n    return relative\n  }\n\n  if (firstChar === '?' || firstChar === '#') {\n    return base + relative\n  }\n\n  var stack = base.split('/');\n\n  // remove trailing segment if:\n  // - not appending\n  // - appending to trailing slash (last segment is empty)\n  if (!append || !stack[stack.length - 1]) {\n    stack.pop();\n  }\n\n  // resolve relative path\n  var segments = relative.replace(/^\\//, '').split('/');\n  for (var i = 0; i < segments.length; i++) {\n    var segment = segments[i];\n    if (segment === '..') {\n      stack.pop();\n    } else if (segment !== '.') {\n      stack.push(segment);\n    }\n  }\n\n  // ensure leading slash\n  if (stack[0] !== '') {\n    stack.unshift('');\n  }\n\n  return stack.join('/')\n}\n\nfunction parsePath (path) {\n  var hash = '';\n  var query = '';\n\n  var hashIndex = path.indexOf('#');\n  if (hashIndex >= 0) {\n    hash = path.slice(hashIndex);\n    path = path.slice(0, hashIndex);\n  }\n\n  var queryIndex = path.indexOf('?');\n  if (queryIndex >= 0) {\n    query = path.slice(queryIndex + 1);\n    path = path.slice(0, queryIndex);\n  }\n\n  return {\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\nfunction cleanPath (path) {\n  return path.replace(/\\/\\//g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n  return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n  // Match escaped characters that would otherwise appear in future matches.\n  // This allows the user to escape special characters that won't transform.\n  '(\\\\\\\\.)',\n  // Match Express-style parameters and un-named parameters with a prefix\n  // and optional suffixes. Matches appear as:\n  //\n  // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n  // \"/route(\\\\d+)\"  => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n  // \"/*\"            => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n  '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param  {string}  str\n * @param  {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n  var tokens = [];\n  var key = 0;\n  var index = 0;\n  var path = '';\n  var defaultDelimiter = options && options.delimiter || '/';\n  var res;\n\n  while ((res = PATH_REGEXP.exec(str)) != null) {\n    var m = res[0];\n    var escaped = res[1];\n    var offset = res.index;\n    path += str.slice(index, offset);\n    index = offset + m.length;\n\n    // Ignore already escaped sequences.\n    if (escaped) {\n      path += escaped[1];\n      continue\n    }\n\n    var next = str[index];\n    var prefix = res[2];\n    var name = res[3];\n    var capture = res[4];\n    var group = res[5];\n    var modifier = res[6];\n    var asterisk = res[7];\n\n    // Push the current path onto the tokens.\n    if (path) {\n      tokens.push(path);\n      path = '';\n    }\n\n    var partial = prefix != null && next != null && next !== prefix;\n    var repeat = modifier === '+' || modifier === '*';\n    var optional = modifier === '?' || modifier === '*';\n    var delimiter = res[2] || defaultDelimiter;\n    var pattern = capture || group;\n\n    tokens.push({\n      name: name || key++,\n      prefix: prefix || '',\n      delimiter: delimiter,\n      optional: optional,\n      repeat: repeat,\n      partial: partial,\n      asterisk: !!asterisk,\n      pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n    });\n  }\n\n  // Match any characters still remaining.\n  if (index < str.length) {\n    path += str.substr(index);\n  }\n\n  // If the path exists, push it onto the end.\n  if (path) {\n    tokens.push(path);\n  }\n\n  return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param  {string}             str\n * @param  {Object=}            options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n  return tokensToFunction(parse(str, options))\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n  return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n  return encodeURI(str).replace(/[?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n  // Compile all the tokens into regexps.\n  var matches = new Array(tokens.length);\n\n  // Compile all the patterns before compilation.\n  for (var i = 0; i < tokens.length; i++) {\n    if (typeof tokens[i] === 'object') {\n      matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n    }\n  }\n\n  return function (obj, opts) {\n    var path = '';\n    var data = obj || {};\n    var options = opts || {};\n    var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n    for (var i = 0; i < tokens.length; i++) {\n      var token = tokens[i];\n\n      if (typeof token === 'string') {\n        path += token;\n\n        continue\n      }\n\n      var value = data[token.name];\n      var segment;\n\n      if (value == null) {\n        if (token.optional) {\n          // Prepend partial segment prefixes.\n          if (token.partial) {\n            path += token.prefix;\n          }\n\n          continue\n        } else {\n          throw new TypeError('Expected \"' + token.name + '\" to be defined')\n        }\n      }\n\n      if (isarray(value)) {\n        if (!token.repeat) {\n          throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n        }\n\n        if (value.length === 0) {\n          if (token.optional) {\n            continue\n          } else {\n            throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n          }\n        }\n\n        for (var j = 0; j < value.length; j++) {\n          segment = encode(value[j]);\n\n          if (!matches[i].test(segment)) {\n            throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n          }\n\n          path += (j === 0 ? token.prefix : token.delimiter) + segment;\n        }\n\n        continue\n      }\n\n      segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n      if (!matches[i].test(segment)) {\n        throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n      }\n\n      path += token.prefix + segment;\n    }\n\n    return path\n  }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param  {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n  return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param  {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n  return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param  {!RegExp} re\n * @param  {Array}   keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n  re.keys = keys;\n  return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param  {Object} options\n * @return {string}\n */\nfunction flags (options) {\n  return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param  {!RegExp} path\n * @param  {!Array}  keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n  // Use a negative lookahead to match only capturing groups.\n  var groups = path.source.match(/\\((?!\\?)/g);\n\n  if (groups) {\n    for (var i = 0; i < groups.length; i++) {\n      keys.push({\n        name: i,\n        prefix: null,\n        delimiter: null,\n        optional: false,\n        repeat: false,\n        partial: false,\n        asterisk: false,\n        pattern: null\n      });\n    }\n  }\n\n  return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param  {!Array}  path\n * @param  {Array}   keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n  var parts = [];\n\n  for (var i = 0; i < path.length; i++) {\n    parts.push(pathToRegexp(path[i], keys, options).source);\n  }\n\n  var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n  return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param  {string}  path\n * @param  {!Array}  keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n  return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param  {!Array}          tokens\n * @param  {(Array|Object)=} keys\n * @param  {Object=}         options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options);\n    keys = [];\n  }\n\n  options = options || {};\n\n  var strict = options.strict;\n  var end = options.end !== false;\n  var route = '';\n\n  // Iterate over the tokens and create our regexp string.\n  for (var i = 0; i < tokens.length; i++) {\n    var token = tokens[i];\n\n    if (typeof token === 'string') {\n      route += escapeString(token);\n    } else {\n      var prefix = escapeString(token.prefix);\n      var capture = '(?:' + token.pattern + ')';\n\n      keys.push(token);\n\n      if (token.repeat) {\n        capture += '(?:' + prefix + capture + ')*';\n      }\n\n      if (token.optional) {\n        if (!token.partial) {\n          capture = '(?:' + prefix + '(' + capture + '))?';\n        } else {\n          capture = prefix + '(' + capture + ')?';\n        }\n      } else {\n        capture = prefix + '(' + capture + ')';\n      }\n\n      route += capture;\n    }\n  }\n\n  var delimiter = escapeString(options.delimiter || '/');\n  var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n  // In non-strict mode we allow a slash at the end of match. If the path to\n  // match already ends with a slash, we remove it for consistency. The slash\n  // is valid at the end of a path match, not in the middle. This is important\n  // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n  if (!strict) {\n    route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n  }\n\n  if (end) {\n    route += '$';\n  } else {\n    // In non-ending mode, we need the capturing groups to match as much as\n    // possible by using a positive lookahead to the end or next path segment.\n    route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n  }\n\n  return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param  {(string|RegExp|Array)} path\n * @param  {(Array|Object)=}       keys\n * @param  {Object=}               options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options);\n    keys = [];\n  }\n\n  options = options || {};\n\n  if (path instanceof RegExp) {\n    return regexpToRegexp(path, /** @type {!Array} */ (keys))\n  }\n\n  if (isarray(path)) {\n    return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n  }\n\n  return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/*  */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n  path,\n  params,\n  routeMsg\n) {\n  try {\n    var filler =\n      regexpCompileCache[path] ||\n      (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n    return filler(params || {}, { pretty: true })\n  } catch (e) {\n    {\n      warn(false, (\"missing param for \" + routeMsg + \": \" + (e.message)));\n    }\n    return ''\n  }\n}\n\n/*  */\n\nfunction createRouteMap (\n  routes,\n  oldPathList,\n  oldPathMap,\n  oldNameMap\n) {\n  // the path list is used to control path matching priority\n  var pathList = oldPathList || [];\n  // $flow-disable-line\n  var pathMap = oldPathMap || Object.create(null);\n  // $flow-disable-line\n  var nameMap = oldNameMap || Object.create(null);\n\n  routes.forEach(function (route) {\n    addRouteRecord(pathList, pathMap, nameMap, route);\n  });\n\n  // ensure wildcard routes are always at the end\n  for (var i = 0, l = pathList.length; i < l; i++) {\n    if (pathList[i] === '*') {\n      pathList.push(pathList.splice(i, 1)[0]);\n      l--;\n      i--;\n    }\n  }\n\n  return {\n    pathList: pathList,\n    pathMap: pathMap,\n    nameMap: nameMap\n  }\n}\n\nfunction addRouteRecord (\n  pathList,\n  pathMap,\n  nameMap,\n  route,\n  parent,\n  matchAs\n) {\n  var path = route.path;\n  var name = route.name;\n  {\n    assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n    assert(\n      typeof route.component !== 'string',\n      \"route config \\\"component\\\" for path: \" + (String(path || name)) + \" cannot be a \" +\n      \"string id. Use an actual component instead.\"\n    );\n  }\n\n  var pathToRegexpOptions = route.pathToRegexpOptions || {};\n  var normalizedPath = normalizePath(\n    path,\n    parent,\n    pathToRegexpOptions.strict\n  );\n\n  if (typeof route.caseSensitive === 'boolean') {\n    pathToRegexpOptions.sensitive = route.caseSensitive;\n  }\n\n  var record = {\n    path: normalizedPath,\n    regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n    components: route.components || { default: route.component },\n    instances: {},\n    name: name,\n    parent: parent,\n    matchAs: matchAs,\n    redirect: route.redirect,\n    beforeEnter: route.beforeEnter,\n    meta: route.meta || {},\n    props: route.props == null\n      ? {}\n      : route.components\n        ? route.props\n        : { default: route.props }\n  };\n\n  if (route.children) {\n    // Warn if route is named, does not redirect and has a default child route.\n    // If users navigate to this route by name, the default child will\n    // not be rendered (GH Issue #629)\n    {\n      if (route.name && !route.redirect && route.children.some(function (child) { return /^\\/?$/.test(child.path); })) {\n        warn(\n          false,\n          \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n          \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n          \"the default child route will not be rendered. Remove the name from \" +\n          \"this route and use the name of the default child route for named \" +\n          \"links instead.\"\n        );\n      }\n    }\n    route.children.forEach(function (child) {\n      var childMatchAs = matchAs\n        ? cleanPath((matchAs + \"/\" + (child.path)))\n        : undefined;\n      addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n    });\n  }\n\n  if (route.alias !== undefined) {\n    var aliases = Array.isArray(route.alias)\n      ? route.alias\n      : [route.alias];\n\n    aliases.forEach(function (alias) {\n      var aliasRoute = {\n        path: alias,\n        children: route.children\n      };\n      addRouteRecord(\n        pathList,\n        pathMap,\n        nameMap,\n        aliasRoute,\n        parent,\n        record.path || '/' // matchAs\n      );\n    });\n  }\n\n  if (!pathMap[record.path]) {\n    pathList.push(record.path);\n    pathMap[record.path] = record;\n  }\n\n  if (name) {\n    if (!nameMap[name]) {\n      nameMap[name] = record;\n    } else if (\"development\" !== 'production' && !matchAs) {\n      warn(\n        false,\n        \"Duplicate named routes definition: \" +\n        \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n      );\n    }\n  }\n}\n\nfunction compileRouteRegex (path, pathToRegexpOptions) {\n  var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n  {\n    var keys = Object.create(null);\n    regex.keys.forEach(function (key) {\n      warn(!keys[key.name], (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\"));\n      keys[key.name] = true;\n    });\n  }\n  return regex\n}\n\nfunction normalizePath (path, parent, strict) {\n  if (!strict) { path = path.replace(/\\/$/, ''); }\n  if (path[0] === '/') { return path }\n  if (parent == null) { return path }\n  return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/*  */\n\nfunction normalizeLocation (\n  raw,\n  current,\n  append,\n  router\n) {\n  var next = typeof raw === 'string' ? { path: raw } : raw;\n  // named target\n  if (next.name || next._normalized) {\n    return next\n  }\n\n  // relative params\n  if (!next.path && next.params && current) {\n    next = extend({}, next);\n    next._normalized = true;\n    var params = extend(extend({}, current.params), next.params);\n    if (current.name) {\n      next.name = current.name;\n      next.params = params;\n    } else if (current.matched.length) {\n      var rawPath = current.matched[current.matched.length - 1].path;\n      next.path = fillParams(rawPath, params, (\"path \" + (current.path)));\n    } else {\n      warn(false, \"relative params navigation requires a current route.\");\n    }\n    return next\n  }\n\n  var parsedPath = parsePath(next.path || '');\n  var basePath = (current && current.path) || '/';\n  var path = parsedPath.path\n    ? resolvePath(parsedPath.path, basePath, append || next.append)\n    : basePath;\n\n  var query = resolveQuery(\n    parsedPath.query,\n    next.query,\n    router && router.options.parseQuery\n  );\n\n  var hash = next.hash || parsedPath.hash;\n  if (hash && hash.charAt(0) !== '#') {\n    hash = \"#\" + hash;\n  }\n\n  return {\n    _normalized: true,\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\n/*  */\n\n\n\nfunction createMatcher (\n  routes,\n  router\n) {\n  var ref = createRouteMap(routes);\n  var pathList = ref.pathList;\n  var pathMap = ref.pathMap;\n  var nameMap = ref.nameMap;\n\n  function addRoutes (routes) {\n    createRouteMap(routes, pathList, pathMap, nameMap);\n  }\n\n  function match (\n    raw,\n    currentRoute,\n    redirectedFrom\n  ) {\n    var location = normalizeLocation(raw, currentRoute, false, router);\n    var name = location.name;\n\n    if (name) {\n      var record = nameMap[name];\n      {\n        warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n      }\n      if (!record) { return _createRoute(null, location) }\n      var paramNames = record.regex.keys\n        .filter(function (key) { return !key.optional; })\n        .map(function (key) { return key.name; });\n\n      if (typeof location.params !== 'object') {\n        location.params = {};\n      }\n\n      if (currentRoute && typeof currentRoute.params === 'object') {\n        for (var key in currentRoute.params) {\n          if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n            location.params[key] = currentRoute.params[key];\n          }\n        }\n      }\n\n      if (record) {\n        location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n        return _createRoute(record, location, redirectedFrom)\n      }\n    } else if (location.path) {\n      location.params = {};\n      for (var i = 0; i < pathList.length; i++) {\n        var path = pathList[i];\n        var record$1 = pathMap[path];\n        if (matchRoute(record$1.regex, location.path, location.params)) {\n          return _createRoute(record$1, location, redirectedFrom)\n        }\n      }\n    }\n    // no match\n    return _createRoute(null, location)\n  }\n\n  function redirect (\n    record,\n    location\n  ) {\n    var originalRedirect = record.redirect;\n    var redirect = typeof originalRedirect === 'function'\n      ? originalRedirect(createRoute(record, location, null, router))\n      : originalRedirect;\n\n    if (typeof redirect === 'string') {\n      redirect = { path: redirect };\n    }\n\n    if (!redirect || typeof redirect !== 'object') {\n      {\n        warn(\n          false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n        );\n      }\n      return _createRoute(null, location)\n    }\n\n    var re = redirect;\n    var name = re.name;\n    var path = re.path;\n    var query = location.query;\n    var hash = location.hash;\n    var params = location.params;\n    query = re.hasOwnProperty('query') ? re.query : query;\n    hash = re.hasOwnProperty('hash') ? re.hash : hash;\n    params = re.hasOwnProperty('params') ? re.params : params;\n\n    if (name) {\n      // resolved named direct\n      var targetRecord = nameMap[name];\n      {\n        assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n      }\n      return match({\n        _normalized: true,\n        name: name,\n        query: query,\n        hash: hash,\n        params: params\n      }, undefined, location)\n    } else if (path) {\n      // 1. resolve relative redirect\n      var rawPath = resolveRecordPath(path, record);\n      // 2. resolve params\n      var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n      // 3. rematch with existing query and hash\n      return match({\n        _normalized: true,\n        path: resolvedPath,\n        query: query,\n        hash: hash\n      }, undefined, location)\n    } else {\n      {\n        warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n      }\n      return _createRoute(null, location)\n    }\n  }\n\n  function alias (\n    record,\n    location,\n    matchAs\n  ) {\n    var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n    var aliasedMatch = match({\n      _normalized: true,\n      path: aliasedPath\n    });\n    if (aliasedMatch) {\n      var matched = aliasedMatch.matched;\n      var aliasedRecord = matched[matched.length - 1];\n      location.params = aliasedMatch.params;\n      return _createRoute(aliasedRecord, location)\n    }\n    return _createRoute(null, location)\n  }\n\n  function _createRoute (\n    record,\n    location,\n    redirectedFrom\n  ) {\n    if (record && record.redirect) {\n      return redirect(record, redirectedFrom || location)\n    }\n    if (record && record.matchAs) {\n      return alias(record, location, record.matchAs)\n    }\n    return createRoute(record, location, redirectedFrom, router)\n  }\n\n  return {\n    match: match,\n    addRoutes: addRoutes\n  }\n}\n\nfunction matchRoute (\n  regex,\n  path,\n  params\n) {\n  var m = path.match(regex);\n\n  if (!m) {\n    return false\n  } else if (!params) {\n    return true\n  }\n\n  for (var i = 1, len = m.length; i < len; ++i) {\n    var key = regex.keys[i - 1];\n    var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];\n    if (key) {\n      // Fix #1994: using * with props: true generates a param named 0\n      params[key.name || 'pathMatch'] = val;\n    }\n  }\n\n  return true\n}\n\nfunction resolveRecordPath (path, record) {\n  return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/*  */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n  // Fix for #1585 for Firefox\n  // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n  window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, ''));\n  window.addEventListener('popstate', function (e) {\n    saveScrollPosition();\n    if (e.state && e.state.key) {\n      setStateKey(e.state.key);\n    }\n  });\n}\n\nfunction handleScroll (\n  router,\n  to,\n  from,\n  isPop\n) {\n  if (!router.app) {\n    return\n  }\n\n  var behavior = router.options.scrollBehavior;\n  if (!behavior) {\n    return\n  }\n\n  {\n    assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n  }\n\n  // wait until re-render finishes before scrolling\n  router.app.$nextTick(function () {\n    var position = getScrollPosition();\n    var shouldScroll = behavior.call(router, to, from, isPop ? position : null);\n\n    if (!shouldScroll) {\n      return\n    }\n\n    if (typeof shouldScroll.then === 'function') {\n      shouldScroll.then(function (shouldScroll) {\n        scrollToPosition((shouldScroll), position);\n      }).catch(function (err) {\n        {\n          assert(false, err.toString());\n        }\n      });\n    } else {\n      scrollToPosition(shouldScroll, position);\n    }\n  });\n}\n\nfunction saveScrollPosition () {\n  var key = getStateKey();\n  if (key) {\n    positionStore[key] = {\n      x: window.pageXOffset,\n      y: window.pageYOffset\n    };\n  }\n}\n\nfunction getScrollPosition () {\n  var key = getStateKey();\n  if (key) {\n    return positionStore[key]\n  }\n}\n\nfunction getElementPosition (el, offset) {\n  var docEl = document.documentElement;\n  var docRect = docEl.getBoundingClientRect();\n  var elRect = el.getBoundingClientRect();\n  return {\n    x: elRect.left - docRect.left - offset.x,\n    y: elRect.top - docRect.top - offset.y\n  }\n}\n\nfunction isValidPosition (obj) {\n  return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n    y: isNumber(obj.y) ? obj.y : window.pageYOffset\n  }\n}\n\nfunction normalizeOffset (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : 0,\n    y: isNumber(obj.y) ? obj.y : 0\n  }\n}\n\nfunction isNumber (v) {\n  return typeof v === 'number'\n}\n\nfunction scrollToPosition (shouldScroll, position) {\n  var isObject = typeof shouldScroll === 'object';\n  if (isObject && typeof shouldScroll.selector === 'string') {\n    var el = document.querySelector(shouldScroll.selector);\n    if (el) {\n      var offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {};\n      offset = normalizeOffset(offset);\n      position = getElementPosition(el, offset);\n    } else if (isValidPosition(shouldScroll)) {\n      position = normalizePosition(shouldScroll);\n    }\n  } else if (isObject && isValidPosition(shouldScroll)) {\n    position = normalizePosition(shouldScroll);\n  }\n\n  if (position) {\n    window.scrollTo(position.x, position.y);\n  }\n}\n\n/*  */\n\nvar supportsPushState = inBrowser && (function () {\n  var ua = window.navigator.userAgent;\n\n  if (\n    (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n    ua.indexOf('Mobile Safari') !== -1 &&\n    ua.indexOf('Chrome') === -1 &&\n    ua.indexOf('Windows Phone') === -1\n  ) {\n    return false\n  }\n\n  return window.history && 'pushState' in window.history\n})();\n\n// use User Timing api (if present) for more accurate key precision\nvar Time = inBrowser && window.performance && window.performance.now\n  ? window.performance\n  : Date;\n\nvar _key = genKey();\n\nfunction genKey () {\n  return Time.now().toFixed(3)\n}\n\nfunction getStateKey () {\n  return _key\n}\n\nfunction setStateKey (key) {\n  _key = key;\n}\n\nfunction pushState (url, replace) {\n  saveScrollPosition();\n  // try...catch the pushState call to get around Safari\n  // DOM Exception 18 where it limits to 100 pushState calls\n  var history = window.history;\n  try {\n    if (replace) {\n      history.replaceState({ key: _key }, '', url);\n    } else {\n      _key = genKey();\n      history.pushState({ key: _key }, '', url);\n    }\n  } catch (e) {\n    window.location[replace ? 'replace' : 'assign'](url);\n  }\n}\n\nfunction replaceState (url) {\n  pushState(url, true);\n}\n\n/*  */\n\nfunction runQueue (queue, fn, cb) {\n  var step = function (index) {\n    if (index >= queue.length) {\n      cb();\n    } else {\n      if (queue[index]) {\n        fn(queue[index], function () {\n          step(index + 1);\n        });\n      } else {\n        step(index + 1);\n      }\n    }\n  };\n  step(0);\n}\n\n/*  */\n\nfunction resolveAsyncComponents (matched) {\n  return function (to, from, next) {\n    var hasAsync = false;\n    var pending = 0;\n    var error = null;\n\n    flatMapComponents(matched, function (def, _, match, key) {\n      // if it's a function and doesn't have cid attached,\n      // assume it's an async component resolve function.\n      // we are not using Vue's default async resolving mechanism because\n      // we want to halt the navigation until the incoming component has been\n      // resolved.\n      if (typeof def === 'function' && def.cid === undefined) {\n        hasAsync = true;\n        pending++;\n\n        var resolve = once(function (resolvedDef) {\n          if (isESModule(resolvedDef)) {\n            resolvedDef = resolvedDef.default;\n          }\n          // save resolved on async factory in case it's used elsewhere\n          def.resolved = typeof resolvedDef === 'function'\n            ? resolvedDef\n            : _Vue.extend(resolvedDef);\n          match.components[key] = resolvedDef;\n          pending--;\n          if (pending <= 0) {\n            next();\n          }\n        });\n\n        var reject = once(function (reason) {\n          var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n          \"development\" !== 'production' && warn(false, msg);\n          if (!error) {\n            error = isError(reason)\n              ? reason\n              : new Error(msg);\n            next(error);\n          }\n        });\n\n        var res;\n        try {\n          res = def(resolve, reject);\n        } catch (e) {\n          reject(e);\n        }\n        if (res) {\n          if (typeof res.then === 'function') {\n            res.then(resolve, reject);\n          } else {\n            // new syntax in Vue 2.3\n            var comp = res.component;\n            if (comp && typeof comp.then === 'function') {\n              comp.then(resolve, reject);\n            }\n          }\n        }\n      }\n    });\n\n    if (!hasAsync) { next(); }\n  }\n}\n\nfunction flatMapComponents (\n  matched,\n  fn\n) {\n  return flatten(matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) { return fn(\n      m.components[key],\n      m.instances[key],\n      m, key\n    ); })\n  }))\n}\n\nfunction flatten (arr) {\n  return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n  typeof Symbol === 'function' &&\n  typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n  return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n  var called = false;\n  return function () {\n    var args = [], len = arguments.length;\n    while ( len-- ) args[ len ] = arguments[ len ];\n\n    if (called) { return }\n    called = true;\n    return fn.apply(this, args)\n  }\n}\n\n/*  */\n\nvar History = function History (router, base) {\n  this.router = router;\n  this.base = normalizeBase(base);\n  // start with a route object that stands for \"nowhere\"\n  this.current = START;\n  this.pending = null;\n  this.ready = false;\n  this.readyCbs = [];\n  this.readyErrorCbs = [];\n  this.errorCbs = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n  this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n  if (this.ready) {\n    cb();\n  } else {\n    this.readyCbs.push(cb);\n    if (errorCb) {\n      this.readyErrorCbs.push(errorCb);\n    }\n  }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n  this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {\n    var this$1 = this;\n\n  var route = this.router.match(location, this.current);\n  this.confirmTransition(route, function () {\n    this$1.updateRoute(route);\n    onComplete && onComplete(route);\n    this$1.ensureURL();\n\n    // fire ready cbs once\n    if (!this$1.ready) {\n      this$1.ready = true;\n      this$1.readyCbs.forEach(function (cb) { cb(route); });\n    }\n  }, function (err) {\n    if (onAbort) {\n      onAbort(err);\n    }\n    if (err && !this$1.ready) {\n      this$1.ready = true;\n      this$1.readyErrorCbs.forEach(function (cb) { cb(err); });\n    }\n  });\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n    var this$1 = this;\n\n  var current = this.current;\n  var abort = function (err) {\n    if (isError(err)) {\n      if (this$1.errorCbs.length) {\n        this$1.errorCbs.forEach(function (cb) { cb(err); });\n      } else {\n        warn(false, 'uncaught error during route navigation:');\n        console.error(err);\n      }\n    }\n    onAbort && onAbort(err);\n  };\n  if (\n    isSameRoute(route, current) &&\n    // in the case the route map has been dynamically appended to\n    route.matched.length === current.matched.length\n  ) {\n    this.ensureURL();\n    return abort()\n  }\n\n  var ref = resolveQueue(this.current.matched, route.matched);\n    var updated = ref.updated;\n    var deactivated = ref.deactivated;\n    var activated = ref.activated;\n\n  var queue = [].concat(\n    // in-component leave guards\n    extractLeaveGuards(deactivated),\n    // global before hooks\n    this.router.beforeHooks,\n    // in-component update hooks\n    extractUpdateHooks(updated),\n    // in-config enter guards\n    activated.map(function (m) { return m.beforeEnter; }),\n    // async components\n    resolveAsyncComponents(activated)\n  );\n\n  this.pending = route;\n  var iterator = function (hook, next) {\n    if (this$1.pending !== route) {\n      return abort()\n    }\n    try {\n      hook(route, current, function (to) {\n        if (to === false || isError(to)) {\n          // next(false) -> abort navigation, ensure current URL\n          this$1.ensureURL(true);\n          abort(to);\n        } else if (\n          typeof to === 'string' ||\n          (typeof to === 'object' && (\n            typeof to.path === 'string' ||\n            typeof to.name === 'string'\n          ))\n        ) {\n          // next('/') or next({ path: '/' }) -> redirect\n          abort();\n          if (typeof to === 'object' && to.replace) {\n            this$1.replace(to);\n          } else {\n            this$1.push(to);\n          }\n        } else {\n          // confirm transition and pass on the value\n          next(to);\n        }\n      });\n    } catch (e) {\n      abort(e);\n    }\n  };\n\n  runQueue(queue, iterator, function () {\n    var postEnterCbs = [];\n    var isValid = function () { return this$1.current === route; };\n    // wait until async components are resolved before\n    // extracting in-component enter guards\n    var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);\n    var queue = enterGuards.concat(this$1.router.resolveHooks);\n    runQueue(queue, iterator, function () {\n      if (this$1.pending !== route) {\n        return abort()\n      }\n      this$1.pending = null;\n      onComplete(route);\n      if (this$1.router.app) {\n        this$1.router.app.$nextTick(function () {\n          postEnterCbs.forEach(function (cb) { cb(); });\n        });\n      }\n    });\n  });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n  var prev = this.current;\n  this.current = route;\n  this.cb && this.cb(route);\n  this.router.afterHooks.forEach(function (hook) {\n    hook && hook(route, prev);\n  });\n};\n\nfunction normalizeBase (base) {\n  if (!base) {\n    if (inBrowser) {\n      // respect <base> tag\n      var baseEl = document.querySelector('base');\n      base = (baseEl && baseEl.getAttribute('href')) || '/';\n      // strip full URL origin\n      base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n    } else {\n      base = '/';\n    }\n  }\n  // make sure there's the starting slash\n  if (base.charAt(0) !== '/') {\n    base = '/' + base;\n  }\n  // remove trailing slash\n  return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n  current,\n  next\n) {\n  var i;\n  var max = Math.max(current.length, next.length);\n  for (i = 0; i < max; i++) {\n    if (current[i] !== next[i]) {\n      break\n    }\n  }\n  return {\n    updated: next.slice(0, i),\n    activated: next.slice(i),\n    deactivated: current.slice(i)\n  }\n}\n\nfunction extractGuards (\n  records,\n  name,\n  bind,\n  reverse\n) {\n  var guards = flatMapComponents(records, function (def, instance, match, key) {\n    var guard = extractGuard(def, name);\n    if (guard) {\n      return Array.isArray(guard)\n        ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n        : bind(guard, instance, match, key)\n    }\n  });\n  return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n  def,\n  key\n) {\n  if (typeof def !== 'function') {\n    // extend now so that global mixins are applied.\n    def = _Vue.extend(def);\n  }\n  return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n  return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n  return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n  if (instance) {\n    return function boundRouteGuard () {\n      return guard.apply(instance, arguments)\n    }\n  }\n}\n\nfunction extractEnterGuards (\n  activated,\n  cbs,\n  isValid\n) {\n  return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {\n    return bindEnterGuard(guard, match, key, cbs, isValid)\n  })\n}\n\nfunction bindEnterGuard (\n  guard,\n  match,\n  key,\n  cbs,\n  isValid\n) {\n  return function routeEnterGuard (to, from, next) {\n    return guard(to, from, function (cb) {\n      next(cb);\n      if (typeof cb === 'function') {\n        cbs.push(function () {\n          // #750\n          // if a router-view is wrapped with an out-in transition,\n          // the instance may not have been registered at this time.\n          // we will need to poll for registration until current route\n          // is no longer valid.\n          poll(cb, match.instances, key, isValid);\n        });\n      }\n    })\n  }\n}\n\nfunction poll (\n  cb, // somehow flow cannot infer this is a function\n  instances,\n  key,\n  isValid\n) {\n  if (\n    instances[key] &&\n    !instances[key]._isBeingDestroyed // do not reuse being destroyed instance\n  ) {\n    cb(instances[key]);\n  } else if (isValid()) {\n    setTimeout(function () {\n      poll(cb, instances, key, isValid);\n    }, 16);\n  }\n}\n\n/*  */\n\nvar HTML5History = (function (History$$1) {\n  function HTML5History (router, base) {\n    var this$1 = this;\n\n    History$$1.call(this, router, base);\n\n    var expectScroll = router.options.scrollBehavior;\n    var supportsScroll = supportsPushState && expectScroll;\n\n    if (supportsScroll) {\n      setupScroll();\n    }\n\n    var initLocation = getLocation(this.base);\n    window.addEventListener('popstate', function (e) {\n      var current = this$1.current;\n\n      // Avoiding first `popstate` event dispatched in some browsers but first\n      // history route not updated since async guard at the same time.\n      var location = getLocation(this$1.base);\n      if (this$1.current === START && location === initLocation) {\n        return\n      }\n\n      this$1.transitionTo(location, function (route) {\n        if (supportsScroll) {\n          handleScroll(router, route, current, true);\n        }\n      });\n    });\n  }\n\n  if ( History$$1 ) HTML5History.__proto__ = History$$1;\n  HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );\n  HTML5History.prototype.constructor = HTML5History;\n\n  HTML5History.prototype.go = function go (n) {\n    window.history.go(n);\n  };\n\n  HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      pushState(cleanPath(this$1.base + route.fullPath));\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      replaceState(cleanPath(this$1.base + route.fullPath));\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HTML5History.prototype.ensureURL = function ensureURL (push) {\n    if (getLocation(this.base) !== this.current.fullPath) {\n      var current = cleanPath(this.base + this.current.fullPath);\n      push ? pushState(current) : replaceState(current);\n    }\n  };\n\n  HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n    return getLocation(this.base)\n  };\n\n  return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n  var path = decodeURI(window.location.pathname);\n  if (base && path.indexOf(base) === 0) {\n    path = path.slice(base.length);\n  }\n  return (path || '/') + window.location.search + window.location.hash\n}\n\n/*  */\n\nvar HashHistory = (function (History$$1) {\n  function HashHistory (router, base, fallback) {\n    History$$1.call(this, router, base);\n    // check history fallback deeplinking\n    if (fallback && checkFallback(this.base)) {\n      return\n    }\n    ensureSlash();\n  }\n\n  if ( History$$1 ) HashHistory.__proto__ = History$$1;\n  HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );\n  HashHistory.prototype.constructor = HashHistory;\n\n  // this is delayed until the app mounts\n  // to avoid the hashchange listener being fired too early\n  HashHistory.prototype.setupListeners = function setupListeners () {\n    var this$1 = this;\n\n    var router = this.router;\n    var expectScroll = router.options.scrollBehavior;\n    var supportsScroll = supportsPushState && expectScroll;\n\n    if (supportsScroll) {\n      setupScroll();\n    }\n\n    window.addEventListener(supportsPushState ? 'popstate' : 'hashchange', function () {\n      var current = this$1.current;\n      if (!ensureSlash()) {\n        return\n      }\n      this$1.transitionTo(getHash(), function (route) {\n        if (supportsScroll) {\n          handleScroll(this$1.router, route, current, true);\n        }\n        if (!supportsPushState) {\n          replaceHash(route.fullPath);\n        }\n      });\n    });\n  };\n\n  HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      pushHash(route.fullPath);\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    var ref = this;\n    var fromRoute = ref.current;\n    this.transitionTo(location, function (route) {\n      replaceHash(route.fullPath);\n      handleScroll(this$1.router, route, fromRoute, false);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  HashHistory.prototype.go = function go (n) {\n    window.history.go(n);\n  };\n\n  HashHistory.prototype.ensureURL = function ensureURL (push) {\n    var current = this.current.fullPath;\n    if (getHash() !== current) {\n      push ? pushHash(current) : replaceHash(current);\n    }\n  };\n\n  HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n    return getHash()\n  };\n\n  return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n  var location = getLocation(base);\n  if (!/^\\/#/.test(location)) {\n    window.location.replace(\n      cleanPath(base + '/#' + location)\n    );\n    return true\n  }\n}\n\nfunction ensureSlash () {\n  var path = getHash();\n  if (path.charAt(0) === '/') {\n    return true\n  }\n  replaceHash('/' + path);\n  return false\n}\n\nfunction getHash () {\n  // We can't use window.location.hash here because it's not\n  // consistent across browsers - Firefox will pre-decode it!\n  var href = window.location.href;\n  var index = href.indexOf('#');\n  return index === -1 ? '' : decodeURI(href.slice(index + 1))\n}\n\nfunction getUrl (path) {\n  var href = window.location.href;\n  var i = href.indexOf('#');\n  var base = i >= 0 ? href.slice(0, i) : href;\n  return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n  if (supportsPushState) {\n    pushState(getUrl(path));\n  } else {\n    window.location.hash = path;\n  }\n}\n\nfunction replaceHash (path) {\n  if (supportsPushState) {\n    replaceState(getUrl(path));\n  } else {\n    window.location.replace(getUrl(path));\n  }\n}\n\n/*  */\n\nvar AbstractHistory = (function (History$$1) {\n  function AbstractHistory (router, base) {\n    History$$1.call(this, router, base);\n    this.stack = [];\n    this.index = -1;\n  }\n\n  if ( History$$1 ) AbstractHistory.__proto__ = History$$1;\n  AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );\n  AbstractHistory.prototype.constructor = AbstractHistory;\n\n  AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n      this$1.index++;\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n      onComplete && onComplete(route);\n    }, onAbort);\n  };\n\n  AbstractHistory.prototype.go = function go (n) {\n    var this$1 = this;\n\n    var targetIndex = this.index + n;\n    if (targetIndex < 0 || targetIndex >= this.stack.length) {\n      return\n    }\n    var route = this.stack[targetIndex];\n    this.confirmTransition(route, function () {\n      this$1.index = targetIndex;\n      this$1.updateRoute(route);\n    });\n  };\n\n  AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n    var current = this.stack[this.stack.length - 1];\n    return current ? current.fullPath : '/'\n  };\n\n  AbstractHistory.prototype.ensureURL = function ensureURL () {\n    // noop\n  };\n\n  return AbstractHistory;\n}(History));\n\n/*  */\n\n\n\nvar VueRouter = function VueRouter (options) {\n  if ( options === void 0 ) options = {};\n\n  this.app = null;\n  this.apps = [];\n  this.options = options;\n  this.beforeHooks = [];\n  this.resolveHooks = [];\n  this.afterHooks = [];\n  this.matcher = createMatcher(options.routes || [], this);\n\n  var mode = options.mode || 'hash';\n  this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;\n  if (this.fallback) {\n    mode = 'hash';\n  }\n  if (!inBrowser) {\n    mode = 'abstract';\n  }\n  this.mode = mode;\n\n  switch (mode) {\n    case 'history':\n      this.history = new HTML5History(this, options.base);\n      break\n    case 'hash':\n      this.history = new HashHistory(this, options.base, this.fallback);\n      break\n    case 'abstract':\n      this.history = new AbstractHistory(this, options.base);\n      break\n    default:\n      {\n        assert(false, (\"invalid mode: \" + mode));\n      }\n  }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (\n  raw,\n  current,\n  redirectedFrom\n) {\n  return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n  return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n    var this$1 = this;\n\n  \"development\" !== 'production' && assert(\n    install.installed,\n    \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n    \"before creating root instance.\"\n  );\n\n  this.apps.push(app);\n\n  // main app already initialized.\n  if (this.app) {\n    return\n  }\n\n  this.app = app;\n\n  var history = this.history;\n\n  if (history instanceof HTML5History) {\n    history.transitionTo(history.getCurrentLocation());\n  } else if (history instanceof HashHistory) {\n    var setupHashListener = function () {\n      history.setupListeners();\n    };\n    history.transitionTo(\n      history.getCurrentLocation(),\n      setupHashListener,\n      setupHashListener\n    );\n  }\n\n  history.listen(function (route) {\n    this$1.apps.forEach(function (app) {\n      app._route = route;\n    });\n  });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n  return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n  return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n  return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n  this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n  this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n  this.history.push(location, onComplete, onAbort);\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n  this.history.replace(location, onComplete, onAbort);\n};\n\nVueRouter.prototype.go = function go (n) {\n  this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n  this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n  this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n  var route = to\n    ? to.matched\n      ? to\n      : this.resolve(to).route\n    : this.currentRoute;\n  if (!route) {\n    return []\n  }\n  return [].concat.apply([], route.matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) {\n      return m.components[key]\n    })\n  }))\n};\n\nVueRouter.prototype.resolve = function resolve (\n  to,\n  current,\n  append\n) {\n  var location = normalizeLocation(\n    to,\n    current || this.history.current,\n    append,\n    this\n  );\n  var route = this.match(location, current);\n  var fullPath = route.redirectedFrom || route.fullPath;\n  var base = this.history.base;\n  var href = createHref(base, fullPath, this.mode);\n  return {\n    location: location,\n    route: route,\n    href: href,\n    // for backwards compat\n    normalizedTo: location,\n    resolved: route\n  }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n  this.matcher.addRoutes(routes);\n  if (this.history.current !== START) {\n    this.history.transitionTo(this.history.getCurrentLocation());\n  }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n  list.push(fn);\n  return function () {\n    var i = list.indexOf(fn);\n    if (i > -1) { list.splice(i, 1); }\n  }\n}\n\nfunction createHref (base, fullPath, mode) {\n  var path = mode === 'hash' ? '#' + fullPath : fullPath;\n  return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.0.2';\n\nif (inBrowser && window.Vue) {\n  window.Vue.use(VueRouter);\n}\n\nreturn VueRouter;\n\n})));\n"
  },
  {
    "path": "calllib-v3/web-im-v3/setting.js",
    "content": "(function (global, factory) {\n  if (typeof exports === 'object' && module !== 'undefined') {\n    module.exports = factory();\n  } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n    define(factory);\n  } else {\n    global.RongCall = global.RongCall || {};\n    global.RongCall.setting = factory();\n  }\n})(this, function () {\n  \n  var ENUM = {};\n\n  ENUM.Events = {\n    INVITE: 'invite',\n    ACCEPT: 'accept',\n    HUNGUP: 'hungup',\n    MEDIA_MODIFY: 'media_modify',\n    MEMBER_MODIFY: 'member_modify',\n\n    RTC_ADDED: 'added',\n    RTC_REMOVED: 'removed',\n    RTC_LEAVE: 'leave'\n  };\n\n  return {\n    appkey: 'appkey',\n    navi: '',\n    server: 'http://localhost:9929',\n    \n    ENUM: ENUM\n  };\n});"
  },
  {
    "path": "chameleon/README.md",
    "content": "### 集成步骤\n\n### chameleon-tool 基本使用\n\n1. 全局安装 chameleon-tool 构建工具： `npm i -g chameleon-tool`\n  \n2. 创建项目： `cml init project`\n\n3. 启动项目： `cml dev`\n\n4. 打包： `cml build`\n\n### 引入 web IM SDK \n\n下载 SDK : `http(s)://cdn.ronghub.com/RongIMLib-2.4.0.min.js` `https://cdn.ronghub.com/protobuf-2.3.4.min.js`\n\n\n```js\nimport RongIMLib from '../../assets/js/RongIMLib.min.js'; //在初始化页面引入sdk\nimport Protobuf from '../../assets/js/protobuf.min.js';\nRongIMLib.RongIMClient.init(appkey, null, {\n    protobuf: Protobuf\n})\n```\n\n### 注意事项\n\n1. mac全局安装权限问题：\n\n> `npm WARN checkPermissions Missing write accessto /usr/loacl/lib/node_modules`\n\n解决：`sudo npm i -g chameleon-tool` 在安装命令前加上sudo,输入用户的登陆密码，提升权限进行安装。\n\n> \n\n详细解决见： `https://yanyinhong.github.io/2017/11/15/Resolve-npm-missing-write-access-problem/`\n\n"
  },
  {
    "path": "chameleon/chameleon.config.js",
    "content": "\n// 设置静态资源的线上路径\nconst publicPath = '//www.static.chameleon.com/cml';\n// 设置api请求前缀\nconst apiPrefix = 'https://api.chameleon.com';\n\ncml.config.merge({\n  templateLang: \"cml\",\n  templateType: \"html\",\n  platforms: [\"web\",\"weex\",\"wx\"],\n  buildInfo: {\n    wxAppId: '123456'\n  },\n  wx: {\n    dev: {\n    },\n    build: {\n      apiPrefix\n    }\n  },\n  web: {\n    dev: {\n      analysis: false,\n      console: false\n    },\n    build: {\n      analysis: false,\n      publicPath: `${publicPath}/web/`,\n      apiPrefix\n    }\n  },\n  weex: {\n    dev: {\n    },\n    build: {\n      publicPath: `${publicPath}/weex/`,\n      apiPrefix\n    },\n    custom: {\n      publicPath: `${publicPath}/wx/`,\n      apiPrefix\n    }\n  }\n})\n\n"
  },
  {
    "path": "chameleon/dist/wx/app.js",
    "content": "var __CML__GLOBAL = require('/static/js/manifest.js')\n__CML__GLOBAL.App = App;\nrequire('/static/js/common.js')\nrequire('/static/js/app.js')\n"
  },
  {
    "path": "chameleon/dist/wx/app.json",
    "content": "{\n    \"window\": {\n        \"backgroundTextStyle\": \"dark\",\n        \"navigationBarBackgroundColor\": \"#343434\",\n        \"navigationBarTitleText\": \"CNODE\",\n        \"navigationBarTextStyle\": \"white\"\n    },\n    \"pages\": [\n        \"pages/index/index\"\n    ],\n    \"usingComponents\": {}\n}"
  },
  {
    "path": "chameleon/dist/wx/app.wxss",
    "content": ""
  },
  {
    "path": "chameleon/dist/wx/pages/index/index.js",
    "content": "var __CML__GLOBAL = require('../../static/js/manifest.js')\n__CML__GLOBAL.Page = Page;\nrequire('../../static/js/common.js')\nrequire('../../static/js/pages/index/index.js')\n"
  },
  {
    "path": "chameleon/dist/wx/pages/index/index.json",
    "content": "{\n    \"usingComponents\": {}\n}"
  },
  {
    "path": "chameleon/dist/wx/pages/index/index.wxml",
    "content": "<view class=\"rong-main  cml-base cml-view\">\n  <h1 class=\" cml-base cml-h1\">{{title}}</h1>\n  <view class=\" cml-base cml-view\">\n    <text class=\"rong-label  cml-base cml-text\">appkey: </text>\n    <input type=\"text\" data-modelkey=\"appkey\" bindinput=\"_cmlModelEventProxy\" value=\"{{appkey}}\" class=\"rong-appkey  cml-base cml-input\"></input>\n  </view>\n  <view class=\" cml-base cml-view\">\n     <text class=\"rong-label  cml-base cml-text\">token: </text>\n     <input type=\"text\" data-modelkey=\"token\" bindinput=\"_cmlModelEventProxy\" value=\"{{token}}\" class=\"rong-token  cml-base cml-input\"></input>\n  </view>\n  <view class=\" cml-base cml-view\">\n     <text class=\"rong-label  cml-base cml-text\">user: </text>\n     <input data-modelkey=\"userId\" bindinput=\"_cmlModelEventProxy\" value=\"{{userId}}\" class=\"rong-userId  cml-base cml-input\"></input>\n  </view>\n  <button text=\"初始化链接\" bindonclick=\"_cmlEventProxy\" data-eventonclick=\"{{['init']}}\" class=\"rong-button  cml-base cml-button\"></button>\n  <p class=\" cml-base cml-p\">初始化链接状态:</p>\n  <view wx:for=\"{{ initResult }}\" wx:for-index=\"idx\" wx:for-item=\"itemName\" class=\" cml-base cml-view\">\n    <text class=\"init-status  cml-base cml-text\">{{itemName}}</text>\n  </view>\n</view>"
  },
  {
    "path": "chameleon/dist/wx/static/js/app.js",
    "content": "var __CML__GLOBAL = require(\"./manifest.js\");\n__CML__GLOBAL.webpackJsonp([0],{\n\n/***/ \"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/babel-loader/lib/index.js?{\\\"filename\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/chameleon.js\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=script&index=0&fileType=app&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/app/app.cml\":\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _index = __webpack_require__(\"./src/store/index.js\");\n\nvar _index2 = _interopRequireDefault(_index);\n\nvar _routerConfig = __webpack_require__(\"./src/router.config.json\");\n\nvar _routerConfig2 = _interopRequireDefault(_routerConfig);\n\nvar _chameleonRuntime = __webpack_require__(!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"chameleon-runtime\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\nvar _chameleonRuntime2 = _interopRequireDefault(_chameleonRuntime);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar App = function () {\n  function App() {\n    _classCallCheck(this, App);\n\n    this.data = {\n      store: _index2.default,\n      routerConfig: _routerConfig2.default\n    };\n  }\n\n  _createClass(App, [{\n    key: 'created',\n    value: function created(res) {}\n  }]);\n\n  return App;\n}();\n\nexports.default = new App();\n\n\nexports.default = _chameleonRuntime2.default.createApp(exports.default).getOptions();\n\n/***/ }),\n\n/***/ \"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/cml-extract-css-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/vue-style-loader/index.js!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/css-loader/index.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"platform\\\":\\\"miniapp\\\",\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/postcss-loader/lib/index.js?{\\\"sourceMap\\\":false,\\\"config\\\":{\\\"path\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/configs/postcss/wx/.postcssrc.js\\\"}}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/less-loader/dist/cjs.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"media\\\":true,\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=styles&index=0&fileType=app&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/app/app.cml\":\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ \"./src/app/app.cml\":\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __cml__style0 = __webpack_require__(\"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/cml-extract-css-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/vue-style-loader/index.js!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/css-loader/index.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"platform\\\":\\\"miniapp\\\",\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/postcss-loader/lib/index.js?{\\\"sourceMap\\\":false,\\\"config\\\":{\\\"path\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/configs/postcss/wx/.postcssrc.js\\\"}}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/less-loader/dist/cjs.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"media\\\":true,\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=styles&index=0&fileType=app&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/app/app.cml\");\nvar __cml__script = __webpack_require__(\"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/babel-loader/lib/index.js?{\\\"filename\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/chameleon.js\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=script&index=0&fileType=app&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/app/app.cml\");\n\n\n/***/ }),\n\n/***/ \"./src/router.config.json\":\n/***/ (function(module, exports) {\n\nmodule.exports = {\"mode\":\"history\",\"domain\":\"https://www.chameleon.com\",\"routes\":[{\"url\":\"/cml/h5/index\",\"path\":\"/pages/index/index\",\"name\":\"首页\",\"mock\":\"index.php\"}]}\n\n/***/ }),\n\n/***/ \"./src/store/actions.js\":\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = {};\n\n/***/ }),\n\n/***/ \"./src/store/getters.js\":\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = {};\n\n/***/ }),\n\n/***/ \"./src/store/index.js\":\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _actions = __webpack_require__(\"./src/store/actions.js\");\n\nvar _actions2 = _interopRequireDefault(_actions);\n\nvar _getters = __webpack_require__(\"./src/store/getters.js\");\n\nvar _getters2 = _interopRequireDefault(_getters);\n\nvar _state = __webpack_require__(\"./src/store/state.js\");\n\nvar _state2 = _interopRequireDefault(_state);\n\nvar _mutations = __webpack_require__(\"./src/store/mutations.js\");\n\nvar _mutations2 = _interopRequireDefault(_mutations);\n\nvar _chameleonStore = __webpack_require__(!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"chameleon-store\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\nvar _chameleonStore2 = _interopRequireDefault(_chameleonStore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _chameleonStore2.default)({\n  actions: _actions2.default,\n  getters: _getters2.default,\n  state: _state2.default,\n  mutations: _mutations2.default\n});\n\n/***/ }),\n\n/***/ \"./src/store/mutations.js\":\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = {};\n\n/***/ }),\n\n/***/ \"./src/store/state.js\":\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar state = {};\n\nexports.default = state;\n\n/***/ })\n\n},[\"./src/app/app.cml\"]);"
  },
  {
    "path": "chameleon/dist/wx/static/js/common.js",
    "content": "var __CML__GLOBAL = require(\"./manifest.js\");\n__CML__GLOBAL.webpackJsonp([2],[\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackMissingModule() { throw new Error(\"Cannot find module \\\"chameleon-runtime/index.js\\\"\"); }());\n(function webpackMissingModule() { throw new Error(\"Cannot find module \\\"chameleon-store/index.js\\\"\"); }());\n\n\n/***/ })\n],[0]);"
  },
  {
    "path": "chameleon/dist/wx/static/js/manifest.js",
    "content": "/******/ var __CML__GLOBAL = {};\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// install a JSONP callback for chunk loading\n/******/ \tvar parentJsonpFunction = __CML__GLOBAL[\"webpackJsonp\"];\n/******/ \t__CML__GLOBAL[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/ \t\tif(executeModules) {\n/******/ \t\t\tfor(i=0; i < executeModules.length; i++) {\n/******/ \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\treturn result;\n/******/ \t};\n/******/\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// objects to store loaded and loading chunks\n/******/ \tvar installedChunks = {\n/******/ \t\t3: 0\n/******/ \t};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"http://10.12.8.95:8000/wx/\";\n/******/\n/******/ \t// on error function for async loading\n/******/ \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n/******/ })\n/************************************************************************/\n/******/ ([])\r\n /******/ module.exports = __CML__GLOBAL;;"
  },
  {
    "path": "chameleon/dist/wx/static/js/pages/index/index.js",
    "content": "var __CML__GLOBAL = require(\"../../manifest.js\");\n__CML__GLOBAL.webpackJsonp([1],{\n\n/***/ \"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/babel-loader/lib/index.js?{\\\"filename\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/chameleon.js\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=script&index=0&fileType=page&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/pages/index/index.cml\":\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _RongIMLib240Min = __webpack_require__(\"./src/assets/js/RongIMLib-2.4.0.min.js\");\n\nvar _RongIMLib240Min2 = _interopRequireDefault(_RongIMLib240Min);\n\nvar _protobuf234Min = __webpack_require__(\"./src/assets/js/protobuf-2.3.4.min.js\");\n\nvar _protobuf234Min2 = _interopRequireDefault(_protobuf234Min);\n\nvar _chameleonRuntime = __webpack_require__(!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"chameleon-runtime\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\nvar _chameleonRuntime2 = _interopRequireDefault(_chameleonRuntime);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction setListener(appKey, callback) {\n  console.log('setListener');\n  _RongIMLib240Min2.default.RongIMClient.init(appKey, null, {\n    protobuf: _protobuf234Min2.default\n  });\n  // 设置连接监听状态 （ status 标识当前连接状态 ）\n  // 连接状态监听器\n  _RongIMLib240Min2.default.RongIMClient.setConnectionStatusListener({\n    onChanged: function onChanged(status) {\n      callback(status);\n      switch (status) {\n        case _RongIMLib240Min2.default.ConnectionStatus.CONNECTED:\n          console.log('链接成功');\n          break;\n        case _RongIMLib240Min2.default.ConnectionStatus.CONNECTING:\n          console.log('正在链接');\n          break;\n        case _RongIMLib240Min2.default.ConnectionStatus.DISCONNECTED:\n          console.log('断开连接');\n          break;\n        case _RongIMLib240Min2.default.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n          console.log('其他设备登录');\n          break;\n        case _RongIMLib240Min2.default.ConnectionStatus.DOMAIN_INCORRECT:\n          console.log('域名不正确');\n          break;\n        case _RongIMLib240Min2.default.ConnectionStatus.NETWORK_UNAVAILABLE:\n          console.log('网络不可用');\n          break;\n      }\n    }\n  });\n  // 消息监听器\n  _RongIMLib240Min2.default.RongIMClient.setOnReceiveMessageListener({\n    // 接收到的消息\n    onReceived: function onReceived(message) {\n      // 判断消息类型\n      switch (message.messageType) {\n        case RongIMClient.MessageType.TextMessage:\n          // message.content.content => 消息内容\n          break;\n        case RongIMClient.MessageType.VoiceMessage:\n          // 对声音进行预加载                \n          // message.content.content 格式为 AMR 格式的 base64 码\n          break;\n        case RongIMClient.MessageType.ImageMessage:\n          // message.content.content => 图片缩略图 base64。\n          // message.content.imageUri => 原图 URL。\n          break;\n        case RongIMClient.MessageType.DiscussionNotificationMessage:\n          // message.content.extension => 讨论组中的人员。\n          break;\n        case RongIMClient.MessageType.LocationMessage:\n          // message.content.latiude => 纬度。\n          // message.content.longitude => 经度。\n          // message.content.content => 位置图片 base64。\n          break;\n        case RongIMClient.MessageType.RichContentMessage:\n          // message.content.content => 文本消息内容。\n          // message.content.imageUri => 图片 base64。\n          // message.content.url => 原图 URL。\n          break;\n        case RongIMClient.MessageType.InformationNotificationMessage:\n          // do something...\n          break;\n        case RongIMClient.MessageType.ContactNotificationMessage:\n          // do something...\n          break;\n        case RongIMClient.MessageType.ProfileNotificationMessage:\n          // do something...\n          break;\n        case RongIMClient.MessageType.CommandNotificationMessage:\n          // do something...\n          break;\n        case RongIMClient.MessageType.CommandMessage:\n          // do something...\n          break;\n        case RongIMClient.MessageType.UnknownMessage:\n          // do something...\n          break;\n        default:\n        // do something...\n      }\n    }\n  });\n}\nfunction connect(data, callback) {\n  var cml = this;\n  var token = data.token;\n  var userId = data.userId;\n  _RongIMLib240Min2.default.RongIMClient.connect(token, {\n    onSuccess: function onSuccess(userId) {\n      console.log(\"Connect successfully.\" + userId);\n      callback(userId);\n    },\n    onTokenIncorrect: function onTokenIncorrect() {\n      console.log('token无效');\n      callback();\n    },\n    onError: function onError(errorCode) {\n      var info = '';\n      switch (errorCode) {\n        case _RongIMLib240Min2.default.ErrorCode.TIMEOUT:\n          info = '超时';\n          break;\n        case _RongIMLib240Min2.default.ConnectionState.UNACCEPTABLE_PAROTOCOL_VERSION:\n          info = '不可接受的协议版本';\n          break;\n        case _RongIMLib240Min2.default.ConnectionState.IDENTIFIER_REJECTED:\n          info = 'appkey不正确';\n          break;\n        case _RongIMLib240Min2.default.ConnectionState.SERVER_UNAVAILABLE:\n          info = '服务器不可用';\n          break;\n      }\n      console.log(errorCode);\n    }\n  });\n}\n\nvar Index = function Index() {\n  _classCallCheck(this, Index);\n\n  this.data = {\n    title: 'Chameleon框架-连接融云服务demo',\n    appkey: 'vnroth0kvbf4o',\n    token: 'dvKz9A78l1XTOefuNW1XN+vX7mzajXCPhVdLzaVlxBArcMENdNOjkzB3EDvQjyIobIeFv0Cezh/32gSONIAXOA==',\n    userId: '1001',\n    initResult: []\n  };\n  this.computed = {\n    message2: function message2() {\n      return 'computed' + this.message;\n    }\n  };\n  this.methods = {\n    test: function test() {\n      console.log('appkey', this.appkey);\n    },\n    init: function init() {\n      var cml = this;\n      var appkey = cml.appkey;\n      var data = {\n        token: this.token,\n        userId: this.userId\n      };\n      console.log('data: ', data);\n      setListener(appkey, function (status) {\n        switch (status) {\n          case _RongIMLib240Min2.default.ConnectionStatus.CONNECTED:\n            cml.initResult.push('链接成功');\n            break;\n          case _RongIMLib240Min2.default.ConnectionStatus.CONNECTING:\n            cml.initResult.push('正在链接');\n            break;\n          case _RongIMLib240Min2.default.ConnectionStatus.DISCONNECTED:\n            cml.initResult.push('断开连接');\n            break;\n          case _RongIMLib240Min2.default.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n            cml.initResult.push('其他设备登录');\n            break;\n          case _RongIMLib240Min2.default.ConnectionStatus.DOMAIN_INCORRECT:\n            cml.initResult.push('域名不正确');\n            break;\n          case _RongIMLib240Min2.default.ConnectionStatus.NETWORK_UNAVAILABLE:\n            cml.initResult.push('网络不可用');\n            break;\n        }\n      });\n      connect(data, function (userId) {\n        if (userId) {\n          cml.initResult.push(\"Connect successfully.\" + userId);\n        } else {\n          cml.initResult.push('token无效');\n        }\n      });\n    }\n  };\n};\n\nexports.default = new Index();\n\n\nexports.default = _chameleonRuntime2.default.createPage(exports.default).getOptions();\n\n/***/ }),\n\n/***/ \"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/cml-extract-css-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/vue-style-loader/index.js!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/css-loader/index.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"platform\\\":\\\"miniapp\\\",\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/postcss-loader/lib/index.js?{\\\"sourceMap\\\":false,\\\"config\\\":{\\\"path\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/configs/postcss/wx/.postcssrc.js\\\"}}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/less-loader/dist/cjs.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"media\\\":true,\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=styles&index=0&fileType=page&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/pages/index/index.cml\":\n/***/ (function(module, exports) {\n\nthrow new Error(\"Module build failed: ModuleBuildError: Module build failed: Error: Failed to find 'chameleon-runtime/src/platform/wx/style/index.css'\\n  in [\\n    /Users/wangyonghao/work/02_github/temp/websdk-demo/chameleon/src/pages/index,\\n        /Users/wangyonghao/work/02_github/temp/websdk-demo/chameleon/src/app\\n  ]\\n    at resolveModule.catch.catch (/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/postcss-import/lib/resolve-id.js:35:13)\\n    at runLoaders (/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/webpack/lib/NormalModule.js:195:19)\\n    at /Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/loader-runner/lib/LoaderRunner.js:364:11\\n    at /Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/loader-runner/lib/LoaderRunner.js:230:18\\n    at context.callback (/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/loader-runner/lib/LoaderRunner.js:111:13)\\n    at Promise.resolve.then.then.catch (/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/postcss-loader/lib/index.js:194:71)\");\n\n/***/ }),\n\n/***/ \"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/process/browser.js\":\n/***/ (function(module, exports) {\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ }),\n\n/***/ \"./src/assets/js/RongIMLib-2.4.0.min.js\":\n/***/ (function(module, exports, __webpack_require__) {\n\n!function(a,b){if(true)module.exports=b();else if(\"function\"==typeof define&&(define.amd||define.cmd))define(b);else{var c=b(),d=c.RongIMClient,e=!!a.RongIMLib;if(e){var f=RongIMLib.RongIMClient||{};for(var g in f)d[g]=f[g]}a.RongIMLib=c,a.RongIMClient=d}}(window,function(){var Polling={SetUserStatusInput:function(){var a={};this.setStatus=function(b){a.status=b},this.toArrayBuffer=function(){return a}},SetUserStatusOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},GetUserStatusInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},GetUserStatusOutput:function(){var a={};this.setStatus=function(b){a.status=b},this.setSubUserId=function(b){a.subUserId=b},this.toArrayBuffer=function(){return a}},VoipDynamicInput:function(){var a={};this.setEngineType=function(b){a.engineType=b},this.setChannelName=function(b){a.channelName=b},this.setChannelExtra=function(b){a.channelExtra=b},this.toArrayBuffer=function(){return a}},VoipDynamicOutput:function(){var a={};this.setDynamicKey=function(b){a.dynamicKey=b},this.toArrayBuffer=function(){return a}},SubUserStatusInput:function(){var a={};this.setUserid=function(b){a.userid=b},this.toArrayBuffer=function(){return a}},SubUserStatusOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},CleanHisMsgInput:function(){var a={};this.setTargetId=function(b){a.targetId=b},this.setDataTime=function(b){a.dataTime=b},this.setConversationType=function(b){a.conversationType=b},this.toArrayBuffer=function(){return a}},DeleteMsgInput:function(){var a={};this.setType=function(b){a.type=b},this.setConversationId=function(b){a.conversationId=b},this.setMsgs=function(b){a.msgs=b},this.toArrayBuffer=function(){return a}},DeleteMsg:function(){var a={};this.setMsgId=function(b){a.msgId=b},this.setMsgDataTime=function(b){a.msgDataTime=b},this.setDirect=function(b){a.direct=b},this.toArrayBuffer=function(){return a}},DeleteMsgOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},SearchMpInput:function(){var a={};this.setType=function(b){a.type=b},this.setId=function(b){a.id=b},this.toArrayBuffer=function(){return a}},SearchMpOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.setInfo=function(b){a.info=b},this.toArrayBuffer=function(){return a}},MpInfo:function(){var a={};this.setMpid=function(b){a.mpid=b},this.setName=function(b){a.name=b},this.setType=function(b){a.type=b},this.setTime=function(b){a.time=b},this.setPortraitUri=function(b){a.portraitUrl=b},this.setExtra=function(b){a.extra=b},this.toArrayBuffer=function(){return a}},PullMpInput:function(){var a={};this.setMpid=function(b){a.mpid=b},this.setTime=function(b){a.time=b},this.toArrayBuffer=function(){return a}},PullMpOutput:function(){var a={};this.setStatus=function(b){a.status=b},this.setInfo=function(b){a.info=b},this.toArrayBuffer=function(){return a}},MPFollowInput:function(){var a={};this.setId=function(b){a.id=b},this.toArrayBuffer=function(){return a}},MPFollowOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.setInfo=function(b){a.info=b},this.toArrayBuffer=function(){return a}},NotifyMsg:function(){var a={};this.setType=function(b){a.type=b},this.setTime=function(b){a.time=b},this.setChrmId=function(b){a.chrmId=b},this.toArrayBuffer=function(){return a}},SyncRequestMsg:function(){var a={};this.setSyncTime=function(b){a.syncTime=b||0},this.setIspolling=function(b){a.ispolling=!!b},this.setIsweb=function(b){a.isweb=!!b},this.setIsPullSend=function(b){a.isPullSend=!!b},this.setSendBoxSyncTime=function(b){a.sendBoxSyncTime=b},this.toArrayBuffer=function(){return a}},UpStreamMessage:function(){var a={};this.setSessionId=function(b){a.sessionId=b},this.setClassname=function(b){a.classname=b},this.setContent=function(b){b&&(a.content=b)},this.setPushText=function(b){a.pushText=b},this.setUserId=function(b){a.userId=b},this.setAppData=function(b){a.appData=b},this.toArrayBuffer=function(){return a}},DownStreamMessages:function(){var a={};this.setList=function(b){a.list=b},this.setSyncTime=function(b){a.syncTime=b},this.setFinished=function(b){a.finished=b},this.toArrayBuffer=function(){return a}},DownStreamMessage:function(){var a={};this.setFromUserId=function(b){a.fromUserId=b},this.setType=function(b){a.type=b},this.setGroupId=function(b){a.groupId=b},this.setClassname=function(b){a.classname=b},this.setContent=function(b){b&&(a.content=b)},this.setDataTime=function(b){a.dataTime=b},this.setStatus=function(b){a.status=b},this.setMsgId=function(b){a.msgId=b},this.toArrayBuffer=function(){return a}},CreateDiscussionInput:function(){var a={};this.setName=function(b){a.name=b},this.toArrayBuffer=function(){return a}},CreateDiscussionOutput:function(){var a={};this.setId=function(b){a.id=b},this.toArrayBuffer=function(){return a}},ChannelInvitationInput:function(){var a={};this.setUsers=function(b){a.users=b},this.toArrayBuffer=function(){return a}},LeaveChannelInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},QueryChatroomInfoInput:function(){var a={};this.setCount=function(b){a.count=b},this.setOrder=function(b){a.order=b},this.toArrayBuffer=function(){return a}},QueryChatroomInfoOutput:function(){var a={};this.setUserTotalNums=function(b){a.userTotalNums=b},this.setUserInfos=function(b){a.userInfos=b},this.toArrayBuffer=function(){return a}},ChannelEvictionInput:function(){var a={};this.setUser=function(b){a.user=b},this.toArrayBuffer=function(){return a}},RenameChannelInput:function(){var a={};this.setName=function(b){a.name=b},this.toArrayBuffer=function(){return a}},ChannelInfoInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},ChannelInfoOutput:function(){var a={};this.setType=function(b){a.type=b},this.setChannelId=function(b){a.channelId=b},this.setChannelName=function(b){a.channelName=b},this.setAdminUserId=function(b){a.adminUserId=b},this.setFirstTenUserIds=function(b){a.firstTenUserIds=b},this.setOpenStatus=function(b){a.openStatus=b},this.toArrayBuffer=function(){return a}},ChannelInfosInput:function(){var a={};this.setPage=function(b){a.page=b},this.setNumber=function(b){a.number=b},this.toArrayBuffer=function(){return a}},ChannelInfosOutput:function(){var a={};this.setChannels=function(b){a.channels=b},this.setTotal=function(b){a.total=b},this.toArrayBuffer=function(){return a}},MemberInfo:function(){var a={};this.setUserId=function(b){a.userId=b},this.setUserName=function(b){a.userName=b},this.setUserPortrait=function(b){a.userPortrait=b},this.setExtension=function(b){a.extension=b},this.toArrayBuffer=function(){return a}},GroupMembersInput:function(){var a={};this.setPage=function(b){a.page=b},this.setNumber=function(b){a.number=b},this.toArrayBuffer=function(){return a}},GroupMembersOutput:function(){var a={};this.setMembers=function(b){a.members=b},this.setTotal=function(b){a.total=b},this.toArrayBuffer=function(){return a}},GetUserInfoInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},GetUserInfoOutput:function(){var a={};this.setUserId=function(b){a.userId=b},this.setUserName=function(b){a.userName=b},this.setUserPortrait=function(b){a.userPortrait=b},this.toArrayBuffer=function(){return a}},GetSessionIdInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},GetSessionIdOutput:function(){var a={};this.setSessionId=function(b){a.sessionId=b},this.toArrayBuffer=function(){return a}},GetQNupTokenInput:function(){var a={};this.setType=function(b){a.type=b},this.toArrayBuffer=function(){return a}},GetQNupTokenOutput:function(){var a={};this.setDeadline=function(b){a.deadline=b},this.setToken=function(b){a.token=b},this.toArrayBuffer=function(){return a}},GetQNdownloadUrlInput:function(){var a={};this.setType=function(b){a.type=b},this.setKey=function(b){a.key=b},this.setFileName=function(b){a.fileName=b},this.toArrayBuffer=function(){return a}},GetQNdownloadUrlOutput:function(){var a={};this.setDownloadUrl=function(b){a.downloadUrl=b},this.toArrayBuffer=function(){return a}},Add2BlackListInput:function(){var a={};this.setUserId=function(b){a.userId=b},this.toArrayBuffer=function(){return a}},RemoveFromBlackListInput:function(){var a={};this.setUserId=function(b){a.userId=b},this.toArrayBuffer=function(){return a}},QueryBlackListInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},QueryBlackListOutput:function(){var a={};this.setUserIds=function(b){a.userIds=b},this.toArrayBuffer=function(){return a}},BlackListStatusInput:function(){var a={};this.setUserId=function(b){a.userId=b},this.toArrayBuffer=function(){return a}},BlockPushInput:function(){var a={};this.setBlockeeId=function(b){a.blockeeId=b},this.toArrayBuffer=function(){return a}},ModifyPermissionInput:function(){var a={};this.setOpenStatus=function(b){a.openStatus=b},this.toArrayBuffer=function(){return a}},GroupInput:function(){var a={};this.setGroupInfo=function(b){for(var c=0,d=[];c<b.length;c++)d.push({id:b[c].getContent().id,name:b[c].getContent().name});a.groupInfo=d},this.toArrayBuffer=function(){return a}},GroupOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},GroupInfo:function(){var a={};this.setId=function(b){a.id=b},this.setName=function(b){a.name=b},this.getContent=function(){return a},this.toArrayBuffer=function(){return a}},GroupHashInput:function(){var a={};this.setUserId=function(b){a.userId=b},this.setGroupHashCode=function(b){a.groupHashCode=b},this.toArrayBuffer=function(){return a}},GroupHashOutput:function(){var a={};this.setResult=function(b){a.result=b},this.toArrayBuffer=function(){return a}},ChrmInput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},ChrmOutput:function(){var a={};this.setNothing=function(b){a.nothing=b},this.toArrayBuffer=function(){return a}},ChrmPullMsg:function(){var a={};this.setSyncTime=function(b){a.syncTime=b},this.setCount=function(b){a.count=b},this.toArrayBuffer=function(){return a}},RelationsInput:function(){var a={};this.setType=function(b){a.type=b},this.setMsg=function(b){a.msg=b},this.setCount=function(b){a.count=b},this.toArrayBuffer=function(){return a}},RelationsOutput:function(){var a={};this.setInfo=function(b){a.info=b},this.toArrayBuffer=function(){return a}},RelationInfo:function(){var a={};this.setType=function(b){a.type=b},this.setUserId=function(b){a.userId=b},this.setMsg=function(b){a.msg=b},this.toArrayBuffer=function(){return a}},HistoryMessageInput:function(){var a={};this.setTargetId=function(b){a.targetId=b},this.setDataTime=function(b){a.dataTime=b},this.setSize=function(b){a.size=b},this.toArrayBuffer=function(){return a}},HistoryMessagesOuput:function(){var a={};this.setList=function(b){a.list=b},this.setSyncTime=function(b){a.syncTime=b},this.setHasMsg=function(b){a.hasMsg=b},this.toArrayBuffer=function(){return a}},HistoryMsgInput:function(){var a={};this.setTargetId=function(b){a.targetId=b},this.setTime=function(b){a.time=b},this.setCount=function(b){a.count=b},this.setOrder=function(b){a.order=b},this.toArrayBuffer=function(){return a}},HistoryMsgOuput:function(){var a={};this.setList=function(b){a.list=b},this.setSyncTime=function(b){a.syncTime=b},this.setHasMsg=function(b){a.hasMsg=b},this.toArrayBuffer=function(){return a}}};for(var f in Polling)Polling[f].decode=function(b){var back={},val=JSON.parse(b)||eval(\"(\"+b+\")\");for(var i in val)back[i]=val[i],back[\"get\"+i.charAt(0).toUpperCase()+i.slice(1)]=function(){return val[i]};return back};var md5=function(){\"use strict\";function a(a,b){var c=(65535&a)+(65535&b);return(a>>16)+(b>>16)+(c>>16)<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){b[c>>5]|=128<<c%32,b[14+(c+64>>>9<<4)]=c;var h,i,j,k,l,m=1732584193,n=-271733879,o=-1732584194,p=271733878;for(h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return[m,n,o,p]}function i(a){var b,c=\"\";for(b=0;b<32*a.length;b+=8)c+=String.fromCharCode(a[b>>5]>>>b%32&255);return c}function j(a){var b,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(b=0;b<8*a.length;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,d,e=j(a),f=[],g=[];for(f[15]=g[15]=void 0,e.length>16&&(e=h(e,8*a.length)),c=0;c<16;c+=1)f[c]=909522486^e[c],g[c]=1549556828^e[c];return d=h(f.concat(j(b)),512+8*b.length),i(h(g.concat(d),640))}function m(a){var b,c,d=\"0123456789abcdef\",e=\"\";for(c=0;c<a.length;c+=1)b=a.charCodeAt(c),e+=d.charAt(b>>>4&15)+d.charAt(15&b);return e}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s}(),RongIMLib;!function(a){!function(a){a[a.ALL=1]=\"ALL\",a[a.PART=2]=\"PART\"}(a.MentionedType||(a.MentionedType={}));a.MentionedType;!function(a){a[a.CUSTOMER_SERVICE=1]=\"CUSTOMER_SERVICE\",a[a.RECALL=2]=\"RECALL\"}(a.MethodType||(a.MethodType={}));a.MethodType;!function(a){a[a.IN_BLACK_LIST=0]=\"IN_BLACK_LIST\",a[a.NOT_IN_BLACK_LIST=1]=\"NOT_IN_BLACK_LIST\"}(a.BlacklistStatus||(a.BlacklistStatus={}));a.BlacklistStatus;!function(a){a[a.XHR_POLLING=0]=\"XHR_POLLING\",a[a.WEBSOCKET=1]=\"WEBSOCKET\",a[a.HTTP=0]=\"HTTP\",a[a.HTTPS=1]=\"HTTPS\"}(a.ConnectionChannel||(a.ConnectionChannel={}));a.ConnectionChannel;!function(a){a[a.ONLY_ROBOT=1]=\"ONLY_ROBOT\",a[a.ONLY_HUMAN=2]=\"ONLY_HUMAN\",a[a.ROBOT_FIRST=3]=\"ROBOT_FIRST\",a[a.HUMAN_FIRST=4]=\"HUMAN_FIRST\"}(a.CustomerType||(a.CustomerType={}));a.CustomerType;!function(a){a[a.NONE=0]=\"NONE\",a[a.SQQUENCE=1]=\"SQQUENCE\",a[a.REVERSE=2]=\"REVERSE\"}(a.GetChatRoomType||(a.GetChatRoomType={}));a.GetChatRoomType;!function(a){a[a.CONNECTED=0]=\"CONNECTED\",a[a.CONNECTING=1]=\"CONNECTING\",a[a.DISCONNECTED=2]=\"DISCONNECTED\",a[a.KICKED_OFFLINE_BY_OTHER_CLIENT=6]=\"KICKED_OFFLINE_BY_OTHER_CLIENT\",a[a.WEBSOCKET_UNAVAILABLE=7]=\"WEBSOCKET_UNAVAILABLE\",a[a.NETWORK_UNAVAILABLE=3]=\"NETWORK_UNAVAILABLE\",a[a.DOMAIN_INCORRECT=12]=\"DOMAIN_INCORRECT\",a[a.CONNECTION_CLOSED=4]=\"CONNECTION_CLOSED\",a[a.ULTRALIMIT=1101]=\"ULTRALIMIT\",a[a.REQUEST_NAVI=201]=\"REQUEST_NAVI\",a[a.RESPONSE_NAVI=202]=\"RESPONSE_NAVI\"}(a.ConnectionStatus||(a.ConnectionStatus={}));a.ConnectionStatus;!function(a){a[a.DO_NOT_DISTURB=0]=\"DO_NOT_DISTURB\",a[a.NOTIFY=1]=\"NOTIFY\"}(a.ConversationNotificationStatus||(a.ConversationNotificationStatus={}));a.ConversationNotificationStatus;!function(a){a[a.NONE=0]=\"NONE\",a[a.PRIVATE=1]=\"PRIVATE\",a[a.DISCUSSION=2]=\"DISCUSSION\",a[a.GROUP=3]=\"GROUP\",a[a.CHATROOM=4]=\"CHATROOM\",a[a.CUSTOMER_SERVICE=5]=\"CUSTOMER_SERVICE\",a[a.SYSTEM=6]=\"SYSTEM\",a[a.APP_PUBLIC_SERVICE=7]=\"APP_PUBLIC_SERVICE\",a[a.PUBLIC_SERVICE=8]=\"PUBLIC_SERVICE\"}(a.ConversationType||(a.ConversationType={}));a.ConversationType;!function(a){a[a.OPENED=0]=\"OPENED\",a[a.CLOSED=1]=\"CLOSED\"}(a.DiscussionInviteStatus||(a.DiscussionInviteStatus={}));a.DiscussionInviteStatus;!function(a){a[a.RECALL_MESSAGE=25101]=\"RECALL_MESSAGE\",a[a.SEND_FREQUENCY_TOO_FAST=20604]=\"SEND_FREQUENCY_TOO_FAST\",a[a.RC_MSG_UNAUTHORIZED=20406]=\"RC_MSG_UNAUTHORIZED\",a[a.RC_DISCUSSION_GROUP_ID_INVALID=20407]=\"RC_DISCUSSION_GROUP_ID_INVALID\",a[a.FORBIDDEN_IN_GROUP=22408]=\"FORBIDDEN_IN_GROUP\",a[a.NOT_IN_DISCUSSION=21406]=\"NOT_IN_DISCUSSION\",a[a.NOT_IN_GROUP=22406]=\"NOT_IN_GROUP\",a[a.NOT_IN_CHATROOM=23406]=\"NOT_IN_CHATROOM\",a[a.FORBIDDEN_IN_CHATROOM=23408]=\"FORBIDDEN_IN_CHATROOM\",a[a.RC_CHATROOM_USER_KICKED=23409]=\"RC_CHATROOM_USER_KICKED\",a[a.RC_CHATROOM_NOT_EXIST=23410]=\"RC_CHATROOM_NOT_EXIST\",a[a.RC_CHATROOM_IS_FULL=23411]=\"RC_CHATROOM_IS_FULL\",a[a.RC_CHATROOM_PATAMETER_INVALID=23412]=\"RC_CHATROOM_PATAMETER_INVALID\",a[a.CHATROOM_GET_HISTORYMSG_ERROR=23413]=\"CHATROOM_GET_HISTORYMSG_ERROR\",a[a.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]=\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\",a[a.SENSITIVE_SHIELD=21501]=\"SENSITIVE_SHIELD\",a[a.SENSITIVE_REPLACE=21502]=\"SENSITIVE_REPLACE\",a[a.TIMEOUT=-1]=\"TIMEOUT\",a[a.UNKNOWN=-2]=\"UNKNOWN\",a[a.JOIN_IN_DISCUSSION=21407]=\"JOIN_IN_DISCUSSION\",a[a.CREATE_DISCUSSION=21408]=\"CREATE_DISCUSSION\",a[a.INVITE_DICUSSION=21409]=\"INVITE_DICUSSION\",a[a.GET_USERINFO_ERROR=23407]=\"GET_USERINFO_ERROR\",a[a.REJECTED_BY_BLACKLIST=405]=\"REJECTED_BY_BLACKLIST\",a[a.RC_NET_CHANNEL_INVALID=30001]=\"RC_NET_CHANNEL_INVALID\",a[a.RC_NET_UNAVAILABLE=30002]=\"RC_NET_UNAVAILABLE\",a[a.RC_MSG_RESP_TIMEOUT=30003]=\"RC_MSG_RESP_TIMEOUT\",a[a.RC_HTTP_SEND_FAIL=30004]=\"RC_HTTP_SEND_FAIL\",a[a.RC_HTTP_REQ_TIMEOUT=30005]=\"RC_HTTP_REQ_TIMEOUT\",a[a.RC_HTTP_RECV_FAIL=30006]=\"RC_HTTP_RECV_FAIL\",a[a.RC_NAVI_RESOURCE_ERROR=30007]=\"RC_NAVI_RESOURCE_ERROR\",a[a.RC_NODE_NOT_FOUND=30008]=\"RC_NODE_NOT_FOUND\",a[a.RC_DOMAIN_NOT_RESOLVE=30009]=\"RC_DOMAIN_NOT_RESOLVE\",a[a.RC_SOCKET_NOT_CREATED=30010]=\"RC_SOCKET_NOT_CREATED\",a[a.RC_SOCKET_DISCONNECTED=30011]=\"RC_SOCKET_DISCONNECTED\",a[a.RC_PING_SEND_FAIL=30012]=\"RC_PING_SEND_FAIL\",a[a.RC_PONG_RECV_FAIL=30013]=\"RC_PONG_RECV_FAIL\",a[a.RC_MSG_SEND_FAIL=30014]=\"RC_MSG_SEND_FAIL\",a[a.RC_CONN_ACK_TIMEOUT=31e3]=\"RC_CONN_ACK_TIMEOUT\",a[a.RC_CONN_PROTO_VERSION_ERROR=31001]=\"RC_CONN_PROTO_VERSION_ERROR\",a[a.RC_CONN_ID_REJECT=31002]=\"RC_CONN_ID_REJECT\",a[a.RC_CONN_SERVER_UNAVAILABLE=31003]=\"RC_CONN_SERVER_UNAVAILABLE\",a[a.RC_CONN_USER_OR_PASSWD_ERROR=31004]=\"RC_CONN_USER_OR_PASSWD_ERROR\",a[a.RC_CONN_NOT_AUTHRORIZED=31005]=\"RC_CONN_NOT_AUTHRORIZED\",a[a.RC_CONN_REDIRECTED=31006]=\"RC_CONN_REDIRECTED\",a[a.RC_CONN_PACKAGE_NAME_INVALID=31007]=\"RC_CONN_PACKAGE_NAME_INVALID\",a[a.RC_CONN_APP_BLOCKED_OR_DELETED=31008]=\"RC_CONN_APP_BLOCKED_OR_DELETED\",a[a.RC_CONN_USER_BLOCKED=31009]=\"RC_CONN_USER_BLOCKED\",a[a.RC_DISCONN_KICK=31010]=\"RC_DISCONN_KICK\",a[a.RC_DISCONN_EXCEPTION=31011]=\"RC_DISCONN_EXCEPTION\",a[a.RC_QUERY_ACK_NO_DATA=32001]=\"RC_QUERY_ACK_NO_DATA\",a[a.RC_MSG_DATA_INCOMPLETE=32002]=\"RC_MSG_DATA_INCOMPLETE\",a[a.BIZ_ERROR_CLIENT_NOT_INIT=33001]=\"BIZ_ERROR_CLIENT_NOT_INIT\",a[a.BIZ_ERROR_DATABASE_ERROR=33002]=\"BIZ_ERROR_DATABASE_ERROR\",a[a.BIZ_ERROR_INVALID_PARAMETER=33003]=\"BIZ_ERROR_INVALID_PARAMETER\",a[a.BIZ_ERROR_NO_CHANNEL=33004]=\"BIZ_ERROR_NO_CHANNEL\",a[a.BIZ_ERROR_RECONNECT_SUCCESS=33005]=\"BIZ_ERROR_RECONNECT_SUCCESS\",a[a.BIZ_ERROR_CONNECTING=33006]=\"BIZ_ERROR_CONNECTING\",a[a.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]=\"MSG_ROAMING_SERVICE_UNAVAILABLE\",a[a.MSG_INSERT_ERROR=33008]=\"MSG_INSERT_ERROR\",a[a.MSG_DEL_ERROR=33009]=\"MSG_DEL_ERROR\",a[a.CONVER_REMOVE_ERROR=34001]=\"CONVER_REMOVE_ERROR\",a[a.CONVER_GETLIST_ERROR=34002]=\"CONVER_GETLIST_ERROR\",a[a.CONVER_SETOP_ERROR=34003]=\"CONVER_SETOP_ERROR\",a[a.CONVER_TOTAL_UNREAD_ERROR=34004]=\"CONVER_TOTAL_UNREAD_ERROR\",a[a.CONVER_TYPE_UNREAD_ERROR=34005]=\"CONVER_TYPE_UNREAD_ERROR\",a[a.CONVER_ID_TYPE_UNREAD_ERROR=34006]=\"CONVER_ID_TYPE_UNREAD_ERROR\",a[a.CONVER_CLEAR_ERROR=34007]=\"CONVER_CLEAR_ERROR\",a[a.CLEAR_HIS_ERROR=34010]=\"CLEAR_HIS_ERROR\",a[a.CLEAR_HIS_TYPE_ERROR=34008]=\"CLEAR_HIS_TYPE_ERROR\",a[a.CLEAR_HIS_TIME_ERROR=34011]=\"CLEAR_HIS_TIME_ERROR\",a[a.CONVER_GET_ERROR=34009]=\"CONVER_GET_ERROR\",a[a.GROUP_SYNC_ERROR=35001]=\"GROUP_SYNC_ERROR\",a[a.GROUP_MATCH_ERROR=35002]=\"GROUP_MATCH_ERROR\",a[a.CHATROOM_ID_ISNULL=36001]=\"CHATROOM_ID_ISNULL\",a[a.CHARTOOM_JOIN_ERROR=36002]=\"CHARTOOM_JOIN_ERROR\",a[a.CHATROOM_HISMESSAGE_ERROR=36003]=\"CHATROOM_HISMESSAGE_ERROR\",a[a.BLACK_ADD_ERROR=37001]=\"BLACK_ADD_ERROR\",a[a.BLACK_GETSTATUS_ERROR=37002]=\"BLACK_GETSTATUS_ERROR\",a[a.BLACK_REMOVE_ERROR=37003]=\"BLACK_REMOVE_ERROR\",a[a.DRAF_GET_ERROR=38001]=\"DRAF_GET_ERROR\",a[a.DRAF_SAVE_ERROR=38002]=\"DRAF_SAVE_ERROR\",a[a.DRAF_REMOVE_ERROR=38003]=\"DRAF_REMOVE_ERROR\",a[a.SUBSCRIBE_ERROR=39001]=\"SUBSCRIBE_ERROR\",a[a.QNTKN_FILETYPE_ERROR=41001]=\"QNTKN_FILETYPE_ERROR\",a[a.QNTKN_GET_ERROR=41002]=\"QNTKN_GET_ERROR\",a[a.COOKIE_ENABLE=51001]=\"COOKIE_ENABLE\",a[a.GET_MESSAGE_BY_ID_ERROR=61001]=\"GET_MESSAGE_BY_ID_ERROR\",a[a.HAVNODEVICEID=24001]=\"HAVNODEVICEID\",a[a.DEVICEIDISHAVE=24002]=\"DEVICEIDISHAVE\",a[a.SUCCESS=0]=\"SUCCESS\",a[a.FEILD=24009]=\"FEILD\",a[a.VOIPISNULL=24013]=\"VOIPISNULL\",a[a.NOENGINETYPE=24010]=\"NOENGINETYPE\",a[a.NULLCHANNELNAME=24011]=\"NULLCHANNELNAME\",a[a.VOIPDYANMICERROR=24012]=\"VOIPDYANMICERROR\",a[a.NOVOIP=24014]=\"NOVOIP\",a[a.INTERNALERRROR=24015]=\"INTERNALERRROR\",a[a.VOIPCLOSE=24016]=\"VOIPCLOSE\",a[a.CLOSE_BEFORE_OPEN=51001]=\"CLOSE_BEFORE_OPEN\",a[a.ALREADY_IN_USE=51002]=\"ALREADY_IN_USE\",a[a.INVALID_CHANNEL_NAME=51003]=\"INVALID_CHANNEL_NAME\",a[a.VIDEO_CONTAINER_IS_NULL=51004]=\"VIDEO_CONTAINER_IS_NULL\",a[a.DELETE_MESSAGE_ID_IS_NULL=61001]=\"DELETE_MESSAGE_ID_IS_NULL\",a[a.CANCEL=1]=\"CANCEL\",a[a.REJECT=2]=\"REJECT\",a[a.HANGUP=3]=\"HANGUP\",a[a.BUSYLINE=4]=\"BUSYLINE\",a[a.NO_RESPONSE=5]=\"NO_RESPONSE\",a[a.ENGINE_UN_SUPPORTED=6]=\"ENGINE_UN_SUPPORTED\",a[a.NETWORK_ERROR=7]=\"NETWORK_ERROR\",a[a.REMOTE_CANCEL=11]=\"REMOTE_CANCEL\",a[a.REMOTE_REJECT=12]=\"REMOTE_REJECT\",a[a.REMOTE_HANGUP=13]=\"REMOTE_HANGUP\",a[a.REMOTE_BUSYLINE=14]=\"REMOTE_BUSYLINE\",a[a.REMOTE_NO_RESPONSE=15]=\"REMOTE_NO_RESPONSE\",a[a.REMOTE_ENGINE_UN_SUPPORTED=16]=\"REMOTE_ENGINE_UN_SUPPORTED\",a[a.REMOTE_NETWORK_ERROR=17]=\"REMOTE_NETWORK_ERROR\",a[a.VOIP_NOT_AVALIABLE=18]=\"VOIP_NOT_AVALIABLE\"}(a.ErrorCode||(a.ErrorCode={}));a.ErrorCode;!function(a){a[a.MEDIA_AUDIO=1]=\"MEDIA_AUDIO\",a[a.MEDIA_VEDIO=2]=\"MEDIA_VEDIO\"}(a.VoIPMediaType||(a.VoIPMediaType={}));a.VoIPMediaType;!function(a){a[a.IMAGE=1]=\"IMAGE\",a[a.AUDIO=2]=\"AUDIO\",a[a.VIDEO=3]=\"VIDEO\",a[a.FILE=100]=\"FILE\"}(a.MediaType||(a.MediaType={}));a.MediaType;!function(a){a[a.SEND=1]=\"SEND\",a[a.RECEIVE=2]=\"RECEIVE\"}(a.MessageDirection||(a.MessageDirection={}));a.MessageDirection;!function(a){a[a.IMAGE=1]=\"IMAGE\",a[a.AUDIO=2]=\"AUDIO\",a[a.VIDEO=3]=\"VIDEO\",a[a.FILE=4]=\"FILE\"}(a.FileType||(a.FileType={}));a.FileType;!function(a){a[a.RC_REAL_TIME_LOCATION_NOT_INIT=-1]=\"RC_REAL_TIME_LOCATION_NOT_INIT\",a[a.RC_REAL_TIME_LOCATION_SUCCESS=0]=\"RC_REAL_TIME_LOCATION_SUCCESS\",a[a.RC_REAL_TIME_LOCATION_GPS_DISABLED=1]=\"RC_REAL_TIME_LOCATION_GPS_DISABLED\",a[a.RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT=2]=\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\",a[a.RC_REAL_TIME_LOCATION_IS_ON_GOING=3]=\"RC_REAL_TIME_LOCATION_IS_ON_GOING\",a[a.RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT=4]=\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\",a[a.RC_REAL_TIME_LOCATION_JOIN_FAILURE=5]=\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\",a[a.RC_REAL_TIME_LOCATION_START_FAILURE=6]=\"RC_REAL_TIME_LOCATION_START_FAILURE\",a[a.RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE=7]=\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"}(a.RealTimeLocationErrorCode||(a.RealTimeLocationErrorCode={}));a.RealTimeLocationErrorCode;!function(a){a[a.RC_REAL_TIME_LOCATION_STATUS_IDLE=0]=\"RC_REAL_TIME_LOCATION_STATUS_IDLE\",a[a.RC_REAL_TIME_LOCATION_STATUS_INCOMING=1]=\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\",a[a.RC_REAL_TIME_LOCATION_STATUS_OUTGOING=2]=\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\",a[a.RC_REAL_TIME_LOCATION_STATUS_CONNECTED=3]=\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"}(a.RealTimeLocationStatus||(a.RealTimeLocationStatus={}));a.RealTimeLocationStatus;!function(a){a[a.READ=1]=\"READ\",a[a.LISTENED=2]=\"LISTENED\",a[a.DOWNLOADED=4]=\"DOWNLOADED\",a[a.RETRIEVED=8]=\"RETRIEVED\",a[a.UNREAD=0]=\"UNREAD\"}(a.ReceivedStatus||(a.ReceivedStatus={}));a.ReceivedStatus;!function(a){a[a.READ=1]=\"READ\",a[a.LISTENED=2]=\"LISTENED\",a[a.DOWNLOADED=4]=\"DOWNLOADED\",a[a.RETRIEVED=8]=\"RETRIEVED\",a[a.UNREAD=0]=\"UNREAD\"}(a.ReadStatus||(a.ReadStatus={}));a.ReadStatus;!function(a){a[a.EXACT=0]=\"EXACT\",a[a.FUZZY=1]=\"FUZZY\"}(a.SearchType||(a.SearchType={}));a.SearchType;!function(a){a[a.SENDING=10]=\"SENDING\",a[a.FAILED=20]=\"FAILED\",a[a.SENT=30]=\"SENT\",a[a.RECEIVED=40]=\"RECEIVED\",a[a.READ=50]=\"READ\",a[a.DESTROYED=60]=\"DESTROYED\"}(a.SentStatus||(a.SentStatus={}));a.SentStatus;!function(a){a[a.ACCEPTED=0]=\"ACCEPTED\",a[a.UNACCEPTABLE_PROTOCOL_VERSION=1]=\"UNACCEPTABLE_PROTOCOL_VERSION\",a[a.IDENTIFIER_REJECTED=2]=\"IDENTIFIER_REJECTED\",a[a.SERVER_UNAVAILABLE=3]=\"SERVER_UNAVAILABLE\",a[a.TOKEN_INCORRECT=4]=\"TOKEN_INCORRECT\",a[a.NOT_AUTHORIZED=5]=\"NOT_AUTHORIZED\",a[a.REDIRECT=6]=\"REDIRECT\",a[a.PACKAGE_ERROR=7]=\"PACKAGE_ERROR\",a[a.APP_BLOCK_OR_DELETE=8]=\"APP_BLOCK_OR_DELETE\",a[a.BLOCK=9]=\"BLOCK\",a[a.TOKEN_EXPIRE=10]=\"TOKEN_EXPIRE\",a[a.DEVICE_ERROR=11]=\"DEVICE_ERROR\"}(a.ConnectionState||(a.ConnectionState={}));a.ConnectionState;!function(a){a[a.ROOM=1]=\"ROOM\",a[a.PERSON=2]=\"PERSON\"}(a.RTCAPIType||(a.RTCAPIType={}));a.RTCAPIType}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(){}return b.getInstance=function(){if(!b._instance)throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");return b._instance},b.showError=function(a){console&&console.error&&console.error(JSON.stringify(a))},b.logger=function(a){var c=a.code,d=b.LogFactory[c]||a;d.funcName=a.funcName,d.msg=a.msg||d.msg,b._memoryStore.depend.showError&&b.showError(d)},b.logCallback=function(a,c){return{onSuccess:a.onSuccess,onError:function(d){b.logger({code:d,funcName:c}),a.onError(d)}}},b.logSendCallback=function(a,c){return{onSuccess:a.onSuccess,onError:function(d,e){b.logger({code:d,funcName:c}),a.onError(d,e)},onBefore:a.onBefore}},b.init=function(c,d,e,f){if(b._instance)return b._memoryStore.sdkInfo;b._instance=new b,e=e||{};var g=\"http://\",h=\"ws://\";\"https:\"==location.protocol&&(h=\"wss://\",g=\"https://\");var i=!1;\"function\"!=typeof WebSocket&&(i=!0);var j=function(){var a=typeof WebSocket,b=\"number\"==typeof WebSocket.OPEN;return a&&b};\"object\"==typeof WebSocket&&j()&&(i=!1);var k=function(){return document.documentElement.addBehavior};a.RongUtil.supportLocalStorage()?b._storageProvider=new a.LocalStorageProvider:k()?b._storageProvider=new a.UserDataProvider:b._storageProvider=new a.MemeoryProvider;var l=b._storageProvider.getItem(\"serverIndex\");b.serverStore.index=l||0;var m=\"{0}{1}\",n={navi:\"nav.cn.ronghub.com\",api:\"api.cn.ronghub.com\"};a.RongUtil.forEach(n,function(b,c){n[c]=a.RongUtil.stringFormat(m,[g,b])}),a.RongUtil.forEach(n,function(b,c){var d=c in e,f={path:e[c],tmpl:m,protocol:g,sub:!0};b=d?a.RongUtil.formatProtoclPath(f):b,e[c]=b});var o={protobuf:\"cdn.ronghub.com/protobuf-2.3.4.min.js\"};a.RongUtil.forEach(o,function(b,c){o[c]=a.RongUtil.stringFormat(m,[g,b])}),a.RongUtil.extend(o,e);var p={isPolling:i,wsScheme:h,protocol:g,showError:!0,openMp:!0,snifferTime:2e3};a.RongUtil.extend(p,e),a.RongUtil.isFunction(e.protobuf)&&(b.Protobuf=e.protobuf),b.userStatusObserver=new a.RongObserver,(new a.FeaturePatcher).patchAll();var q={token:\"\",callback:null,lastReadTime:new a.LimitableMap,historyMessageLimit:new a.MemoryCache,conversationList:[],appKey:c,publicServiceMap:new a.PublicServiceMap,providerType:1,deltaTime:0,filterMessages:[],isSyncRemoteConverList:!0,otherDevice:!1,custStore:{},converStore:{latestMessage:{}},connectAckTime:0,voipStategy:0,isFirstPingMsg:!0,depend:e,listenerList:b._memoryStore.listenerList,notification:{}};b._memoryStore=q,d&&\"[object Object]\"==Object.prototype.toString.call(d)?b._dataAccessProvider=d:b._dataAccessProvider=new a.ServerDataProvider,e.appCallback=f;var r=b._dataAccessProvider.init(c,e);return b._memoryStore.sdkInfo=r,b._dataAccessProvider.setServerInfo({navi:location.protocol+e.navi+\"/navi.xml\"}),b.MessageParams={TextMessage:{objectName:\"RC:TxtMsg\",msgTag:new a.MessageTag(!0,!0)},ImageMessage:{objectName:\"RC:ImgMsg\",msgTag:new a.MessageTag(!0,!0)},DiscussionNotificationMessage:{objectName:\"RC:DizNtf\",msgTag:new a.MessageTag(!1,!0)},VoiceMessage:{objectName:\"RC:VcMsg\",msgTag:new a.MessageTag(!0,!0)},RichContentMessage:{objectName:\"RC:ImgTextMsg\",msgTag:new a.MessageTag(!0,!0)},FileMessage:{objectName:\"RC:FileMsg\",msgTag:new a.MessageTag(!0,!0)},HandshakeMessage:{objectName:\"\",msgTag:new a.MessageTag(!0,!0)},UnknownMessage:{objectName:\"\",msgTag:new a.MessageTag(!0,!0)},LocationMessage:{objectName:\"RC:LBSMsg\",msgTag:new a.MessageTag(!0,!0)},InformationNotificationMessage:{objectName:\"RC:InfoNtf\",msgTag:new a.MessageTag(!1,!0)},ContactNotificationMessage:{objectName:\"RC:ContactNtf\",msgTag:new a.MessageTag(!1,!0)},ProfileNotificationMessage:{objectName:\"RC:ProfileNtf\",msgTag:new a.MessageTag(!1,!0)},CommandNotificationMessage:{objectName:\"RC:CmdNtf\",msgTag:new a.MessageTag(!0,!0)},PublicServiceRichContentMessage:{objectName:\"RC:PSImgTxtMsg\",msgTag:new a.MessageTag(!0,!0)},PublicServiceMultiRichContentMessage:{objectName:\"RC:PSMultiImgTxtMsg\",msgTag:new a.MessageTag(!0,!0)},JrmfRedPacketMessage:{objectName:\"RCJrmf:RpMsg\",msgTag:new a.MessageTag(!0,!0)},JrmfRedPacketOpenedMessage:{objectName:\"RCJrmf:RpOpendMsg\",msgTag:new a.MessageTag(!0,!0)},GroupNotificationMessage:{objectName:\"RC:GrpNtf\",msgTag:new a.MessageTag(!1,!0)},CommandMessage:{objectName:\"RC:CmdMsg\",msgTag:new a.MessageTag(!1,!1)},TypingStatusMessage:{objectName:\"RC:TypSts\",msgTag:new a.MessageTag(!1,!1)},PublicServiceCommandMessage:{objectName:\"RC:PSCmd\",msgTag:new a.MessageTag(!1,!1)},RecallCommandMessage:{objectName:\"RC:RcCmd\",msgTag:new a.MessageTag(!1,!0)},SyncReadStatusMessage:{objectName:\"RC:SRSMsg\",msgTag:new a.MessageTag(!1,!1)},ReadReceiptRequestMessage:{objectName:\"RC:RRReqMsg\",msgTag:new a.MessageTag(!1,!1)},ReadReceiptResponseMessage:{objectName:\"RC:RRRspMsg\",msgTag:new a.MessageTag(!1,!1)},ChangeModeResponseMessage:{objectName:\"RC:CsChaR\",msgTag:new a.MessageTag(!1,!1)},ChangeModeMessage:{objectName:\"RC:CSCha\",msgTag:new a.MessageTag(!1,!1)},\nEvaluateMessage:{objectName:\"RC:CsEva\",msgTag:new a.MessageTag(!1,!1)},CustomerContact:{objectName:\"RC:CsContact\",msgTag:new a.MessageTag(!1,!1)},HandShakeMessage:{objectName:\"RC:CsHs\",msgTag:new a.MessageTag(!1,!1)},HandShakeResponseMessage:{objectName:\"RC:CsHsR\",msgTag:new a.MessageTag(!1,!1)},SuspendMessage:{objectName:\"RC:CsSp\",msgTag:new a.MessageTag(!1,!1)},TerminateMessage:{objectName:\"RC:CsEnd\",msgTag:new a.MessageTag(!1,!1)},CustomerStatusUpdateMessage:{objectName:\"RC:CsUpdate\",msgTag:new a.MessageTag(!1,!1)},ReadReceiptMessage:{objectName:\"RC:ReadNtf\",msgTag:new a.MessageTag(!1,!1)}},b.MessageParams.AcceptMessage={objectName:\"RC:VCAccept\",msgTag:new a.MessageTag(!1,!1)},b.MessageParams.RingingMessage={objectName:\"RC:VCRinging\",msgTag:new a.MessageTag(!1,!1)},b.MessageParams.SummaryMessage={objectName:\"RC:VCSummary\",msgTag:new a.MessageTag(!1,!1)},b.MessageParams.HungupMessage={objectName:\"RC:VCHangup\",msgTag:new a.MessageTag(!1,!1)},b.MessageParams.InviteMessage={objectName:\"RC:VCInvite\",msgTag:new a.MessageTag(!1,!1)},b.MessageParams.MediaModifyMessage={objectName:\"RC:VCModifyMedia\",msgTag:new a.MessageTag(!1,!1)},b.MessageParams.MemberModifyMessage={objectName:\"RC:VCModifyMem\",msgTag:new a.MessageTag(!1,!1)},b.MessageType={TextMessage:\"TextMessage\",ImageMessage:\"ImageMessage\",DiscussionNotificationMessage:\"DiscussionNotificationMessage\",VoiceMessage:\"VoiceMessage\",RichContentMessage:\"RichContentMessage\",HandshakeMessage:\"HandshakeMessage\",UnknownMessage:\"UnknownMessage\",LocationMessage:\"LocationMessage\",InformationNotificationMessage:\"InformationNotificationMessage\",ContactNotificationMessage:\"ContactNotificationMessage\",ProfileNotificationMessage:\"ProfileNotificationMessage\",CommandNotificationMessage:\"CommandNotificationMessage\",CommandMessage:\"CommandMessage\",TypingStatusMessage:\"TypingStatusMessage\",ChangeModeResponseMessage:\"ChangeModeResponseMessage\",ChangeModeMessage:\"ChangeModeMessage\",EvaluateMessage:\"EvaluateMessage\",HandShakeMessage:\"HandShakeMessage\",HandShakeResponseMessage:\"HandShakeResponseMessage\",SuspendMessage:\"SuspendMessage\",TerminateMessage:\"TerminateMessage\",CustomerContact:\"CustomerContact\",CustomerStatusUpdateMessage:\"CustomerStatusUpdateMessage\",SyncReadStatusMessage:\"SyncReadStatusMessage\",ReadReceiptRequestMessage:\"ReadReceiptRequestMessage\",ReadReceiptResponseMessage:\"ReadReceiptResponseMessage\",FileMessage:\"FileMessage\",AcceptMessage:\"AcceptMessage\",RingingMessage:\"RingingMessage\",SummaryMessage:\"SummaryMessage\",HungupMessage:\"HungupMessage\",InviteMessage:\"InviteMessage\",MediaModifyMessage:\"MediaModifyMessage\",MemberModifyMessage:\"MemberModifyMessage\",JrmfRedPacketMessage:\"JrmfRedPacketMessage\",JrmfRedPacketOpenedMessage:\"JrmfRedPacketOpenedMessage\",GroupNotificationMessage:\"GroupNotificationMessage\",PublicServiceRichContentMessage:\"PublicServiceRichContentMessage\",PublicServiceMultiRichContentMessage:\"PublicServiceMultiRichContentMessage\",PublicServiceCommandMessage:\"PublicServiceCommandMessage\",RecallCommandMessage:\"RecallCommandMessage\",ReadReceiptMessage:\"ReadReceiptMessage\"},b.LogFactory={\"-1\":{code:\"-1\",msg:\"服务器超时\"},\"-2\":{code:\"-2\",msg:\"未知原因失败\"},\"-3\":{code:\"-3\",msg:\"参数错误\"},\"-4\":{code:\"-4\",msg:\"参数不正确或尚未实例化\"},25101:{code:\"25101\",msg:\"撤回消息参数错误\",desc:\"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"},25102:{code:\"25101\",msg:\"只能撤回自发发送的消息\"},20604:{code:\"20604\",msg:\"发送频率过快\",desc:\"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"},20406:{code:\"20406\",msg:\"被禁言\"},23407:{code:\"23407\",msg:\"获取用户失败\"},20407:{code:\"20407\",msg:\"群组Id无效\"},22408:{code:\"22408\",msg:\"群组被禁言\"},22406:{code:\"22406\",msg:\"不在群组\"},35001:{code:\"35001\",msg:\"群组同步异常\"},35002:{code:\"35002\",msg:\"匹配群信息异常\"},21406:{code:\"21406\",msg:\"不在讨论组\"},21407:{code:\"21407\",msg:\"加入讨论失败\"},21408:{code:\"21408\",msg:\"创建讨论组失败\"},21409:{code:\"21409\",msg:\"设置讨论组邀请状态失败\"},23406:{code:\"23406\",msg:\"不在聊天室\"},23408:{code:\"23408\",msg:\"聊天室被禁言\"},23409:{code:\"23409\",msg:\"聊天室中成员被踢出\"},23410:{code:\"23410\",msg:\"聊天室不存在\"},23411:{code:\"23411\",msg:\"聊天室成员已满\"},23412:{code:\"23412\",msg:\"获取聊天室信息参数无效\"},23413:{code:\"23413\",msg:\"聊天室异常\"},23414:{code:\"23414\",msg:\"没有打开聊天室消息存储\"},36001:{code:\"36001\",msg:\"加入聊天室Id为空\"},36002:{code:\"36002\",msg:\"加入聊天室失败\"},36003:{code:\"36003\",msg:\"拉取聊天室历史消息失败\"},24001:{code:\"24001\",msg:\"没有注册DeviveId 也就是用户没有登陆\"},24002:{code:\"24002\",msg:\"用户已经存在\"},0:{code:\"0\",msg:\"成功\"},24009:{code:\"24009\",msg:\"没有对应的用户或token\"},24013:{code:\"24013\",msg:\"voip为空\"},24010:{code:\"24010\",msg:\"不支持的Voip引擎\"},24011:{code:\"24011\",msg:\"channelName 是空\"},24012:{code:\"24012\",msg:\"生成Voipkey失败\"},24014:{code:\"24014\",msg:\"没有配置voip\"},24015:{code:\"24015\",msg:\"服务器内部错误\"},24016:{code:\"24016\",msg:\"VOIP close\"},30001:{code:\"30001\",msg:\"通信过程中，当前Socket不存在\"},30002:{code:\"30002\",msg:\"Socket连接不可用\"},30003:{code:\"30003\",msg:\"通信超时\"},30004:{code:\"30004\",msg:\"导航操作时，Http请求失败\"},30005:{code:\"30005\",msg:\"HTTP请求失败\"},30006:{code:\"30006\",msg:\"HTTP接收失败\"},30007:{code:\"30007\",msg:\"导航资源错误\"},30008:{code:\"30008\",msg:\"没有有效数据\"},30009:{code:\"30009\",msg:\"不存在有效 IP 地址\"},30010:{code:\"30010\",msg:\"创建 Socket 失败\"},30011:{code:\"30011\",msg:\" Socket 被断开\"},30012:{code:\"30012\",msg:\"PING 操作失败\"},30013:{code:\"30013\",msg:\"PING 超时\"},30014:{code:\"30014\",msg:\"消息发送失败\"},30016:{code:\"30016\",msg:\"消息大小超限，最大 128 KB\"},31000:{code:\"31000\",msg:\"做 connect 连接时，收到的 ACK 超时\"},31001:{code:\"31001\",msg:\"参数错误\"},31002:{code:\"31002\",msg:\"参数错误，App Id 错误\"},31003:{code:\"31003\",msg:\"服务器不可用\"},31004:{code:\"31004\",msg:\"Token 错误\"},31005:{code:\"31005\",msg:\"App Id 与 Token 不匹配\"},31006:{code:\"31006\",msg:\"重定向，地址错误\"},31007:{code:\"31007\",msg:\"NAME 与后台注册信息不一致\"},31008:{code:\"31008\",msg:\"APP 被屏蔽、删除或不存在\"},31009:{code:\"31009\",msg:\"用户被屏蔽\"},31010:{code:\"31010\",msg:\"Disconnect，由服务器返回，比如用户互踢\"},31011:{code:\"31011\",msg:\"Disconnect，由服务器返回，比如用户互踢\"},32001:{code:\"32001\",msg:\"协议层内部错误。query，上传下载过程中数据错误\"},32002:{code:\"32002\",msg:\"协议层内部错误\"},33001:{code:\"33001\",msg:\"未调用 init 初始化函数\"},33002:{code:\"33002\",msg:\"数据库初始化失败\"},33003:{code:\"33003\",msg:\"传入参数无效\"},33004:{code:\"33004\",msg:\"通道无效\"},33005:{code:\"33005\",msg:\"重新连接成功\"},33006:{code:\"33006\",msg:\"连接中，再调用 connect 被拒绝\"},33007:{code:\"33007\",msg:\"消息漫游服务未开通\"},33008:{code:\"33008\",msg:\"消息添加失败\"},33009:{code:\"33009\",msg:\"消息删除失败\"},34001:{code:\"34001\",msg:\"删除会话失败\"},34002:{code:\"34002\",msg:\"拉取历史消息失败\"},34003:{code:\"34003\",msg:\"会话指定异常\"},34004:{code:\"34004\",msg:\"获取会话未读消息总数失败\"},34005:{code:\"34005\",msg:\"获取指定会话类型未读消息数异常\"},34006:{code:\"34006\",msg:\"获取指定用户ID&会话类型未读消息数异常\"},34007:{code:\"34007\",msg:\"清除会话消息异常\"},34008:{code:\"34008\",msg:\"获取会话消息异常\"},34009:{code:\"34009\",msg:\"清除历史消息会话类型不正确\"},34010:{code:\"34010\",msg:\"清除历史消息失败，请检查传入参数\"},37001:{code:\"37001\",msg:\"加入黑名单异常\"},37002:{code:\"37002\",msg:\"获得指定人员再黑名单中的状态异常\"},37003:{code:\"37003\",msg:\"移除黑名单异常\"},405:{code:\"405\",msg:\"在黑名单中\"},38001:{code:\"38001\",msg:\"获取草稿失败\"},38002:{code:\"38002\",msg:\"保存草稿失败\"},38003:{code:\"38003\",msg:\"删除草稿失败\"},39001:{code:\"39001\",msg:\"关注公众号失败\"},41001:{code:\"41001\",msg:\"文件类型错误\"},41002:{code:\"41002\",msg:\"获取七牛token失败\"},51001:{code:\"51001\",msg:\"未安装或未启动插件\"},51002:{code:\"51002\",msg:\"视频已经存在\"},51003:{code:\"51003\",msg:\"无效的channelName\"},51004:{code:\"51004\",msg:\"视频内容为空\"},61001:{code:\"61001\",msg:\"删除消息数组长度为 0\"}},r},b.initApp=function(a,c){b.init(a.appkey,a.dataAccessProvider,a.opts,function(){var a=b._instance;c(null,a)})},b.connect=function(c,d,e,f){a.CheckParam.getInstance().check([\"string\",\"object\",\"string|null|object|global|undefined\",\"object|null|global|undefined\"],\"connect\",!0,arguments);var g={onSuccess:d.onSuccess,onTokenIncorrect:d.onTokenIncorrect,onError:function(a){b.logger({code:a,funcName:\"connect\"}),d.onError(a)}};b._dataAccessProvider.connect(c,g,e,f)},b.reconnect=function(a,c){var d={onSuccess:a.onSuccess,onTokenIncorrect:a.onTokenIncorrect,onError:function(c){b.logger({code:c,funcName:\"connect\"}),a.onError(c)}};b._dataAccessProvider.reconnect(d,c)},b.registerMessageType=function(a,c,d,e,f){b._dataAccessProvider.registerMessageType(a,c,d,e,f),b.RegisterMessage[a].messageName=a,b.MessageType[a]=a,b.MessageParams[a]={objectName:c,msgTag:d}},b.prototype.registerMessageTypes=function(a){a=a||{},b._dataAccessProvider.registerMessageTypes(a)},b.setConnectionStatusListener=function(a){b._dataAccessProvider?b._dataAccessProvider.setConnectionStatusListener(a):b._memoryStore.listenerList.push(a)},b.statusWatch=function(a){\"function\"==typeof a&&b.statusListeners.push(a)},b.setOnReceiveMessageListener=function(a){b._dataAccessProvider?b._dataAccessProvider.setOnReceiveMessageListener(a):b._memoryStore.listenerList.push(a)},b.prototype.logout=function(){b._dataAccessProvider.logout()},b.prototype.disconnect=function(){b._dataAccessProvider.disconnect()},b.prototype.startCustomService=function(c,d,e){if(c&&d){var f=new a.HandShakeMessage(e),g=this;a.RongIMClient._memoryStore.custStore.isInit=!0,b.getInstance().sendMessage(a.ConversationType.CUSTOMER_SERVICE,c,f,{onSuccess:function(a){a.isBlack?(d.onError(),g.stopCustomeService(c,{onSuccess:function(){},onError:function(){}})):d.onSuccess()},onError:function(){d.onError()},onBefore:function(){}})}},b.prototype.stopCustomeService=function(c,d){if(c&&d){var e=b._memoryStore.custStore[c];if(e){var f=new a.SuspendMessage({sid:e.sid,uid:e.uid,pid:e.pid});this.sendCustMessage(c,f,{onSuccess:function(){setTimeout(function(){d.onSuccess()})},onError:function(){setTimeout(function(){d.onError()})}})}}},b.prototype.switchToHumanMode=function(c,d){if(c&&d){var e=b._memoryStore.custStore[c];if(e){var f=new a.ChangeModeMessage({sid:e.sid,uid:e.uid,pid:e.pid});this.sendCustMessage(c,f,d)}}},b.prototype.evaluateRebotCustomService=function(c,d,e,f){if(c&&f){var g=b._memoryStore.custStore[c];if(g){var h=new a.EvaluateMessage({sid:g.sid,uid:g.uid,pid:g.pid,isRobotResolved:d,sugest:e,type:0});this.sendCustMessage(c,h,f)}}},b.prototype.evaluateHumanCustomService=function(c,d,e,f){if(c&&f){var g=b._memoryStore.custStore[c];if(g){var h=new a.EvaluateMessage({sid:g.sid,uid:g.uid,pid:g.pid,humanValue:d,sugest:e,type:1});this.sendCustMessage(c,h,f)}}},b.prototype.sendCustMessage=function(c,d,e){b.getInstance().sendMessage(a.ConversationType.CUSTOMER_SERVICE,c,d,{onSuccess:function(a){e.onSuccess()},onError:function(){e.onError()},onBefore:function(){}})},b.prototype.getCurrentConnectionStatus=function(){return b._dataAccessProvider.getCurrentConnectionStatus()},b.prototype.getConnectionChannel=function(){return a.Transportations._TransportType==a.Socket.XHR_POLLING?a.ConnectionChannel.XHR_POLLING:a.Transportations._TransportType==a.Socket.WEBSOCKET?a.ConnectionChannel.WEBSOCKET:void 0},b.prototype.getStorageProvider=function(){return 1==b._memoryStore.providerType?\"ServerDataProvider\":\"OtherDataProvider\"},b.prototype.setFilterMessages=function(a){\"[object Array]\"==Object.prototype.toString.call(a)&&(b._memoryStore.filterMessages=a)},b.prototype.getAgoraDynamicKey=function(a,c,d){b._dataAccessProvider.getAgoraDynamicKey(a,c,d)},b.prototype.getCurrentUserId=function(){return a.Bridge._client.userId},b.prototype.getDeltaTime=function(){return b._dataAccessProvider.getDelaTime()},b.prototype.getMessage=function(a,c){b._dataAccessProvider.getMessage(a,b.logCallback(c,\"getMessage\"))},b.prototype.deleteLocalMessages=function(a,c,d,e){b._dataAccessProvider.removeLocalMessage(a,c,d,b.logCallback(e,\"deleteLocalMessages\"))},b.prototype.updateMessage=function(a,c){b._dataAccessProvider.updateMessage(a,b.logCallback(c,\"updateMessage\"))},b.prototype.clearData=function(){return b._dataAccessProvider.clearData()},b.prototype.clearMessages=function(a,c,d){b._dataAccessProvider.clearMessages(a,c,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"clearMessages\"}),d.onError(a)})}})},b.prototype.clearMessagesUnreadStatus=function(a,c,d){b._dataAccessProvider.updateMessages(a,c,\"readStatus\",null,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"clearMessagesUnreadStatus\"}),d.onError(a)})}})},b.prototype.deleteRemoteMessages=function(c,d,e,f){if(a.CheckParam.getInstance().check([\"number\",\"string|number\",\"array\",\"object\"],\"deleteRemoteMessages\",!1,arguments),0==e.length){var g=a.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;return b.logger({code:g,funcName:\"deleteRemoteMessages\"}),void f.onError(a.ErrorCode.DELETE_MESSAGE_ID_IS_NULL)}e.length>100&&(e.length=100),f.onSuccess(!0)},b.prototype.deleteMessages=function(a,c,d,e){b._dataAccessProvider.removeMessage(a,c,d,{onSuccess:function(a){setTimeout(function(){e.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"deleteMessages\"}),e.onError(a)})}})},b.prototype.sendLocalMessage=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"sendLocalMessage\",!1,arguments),b._dataAccessProvider.updateMessage(c),this.sendMessage(c.conversationType,c.targetId,c.content,b.logSendCallback(d,\"sendLocalMessage\"))},b.prototype.sendMessage=function(c,d,e,f,g,h,i,j,k){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\",\"object\",\"undefined|object|null|global|boolean\",\"undefined|object|null|global|string\",\"undefined|object|null|global|string\",\"undefined|object|null|global|number\",\"undefined|object|null|global\"],\"sendMessage\",!1,arguments),b._dataAccessProvider.sendMessage(c,d,e,b.logSendCallback(f,\"sendMessage\"),g,h,i,j,k)},b.prototype.sendReceiptResponse=function(a,c,d){b._dataAccessProvider.sendReceiptResponse(a,c,b.logSendCallback(d,\"sendReceiptResponse\"))},b.prototype.sendTypingStatusMessage=function(a,c,d,e){b._dataAccessProvider.sendTypingStatusMessage(a,c,d,b.logSendCallback(e,\"sendTypingStatusMessage\"))},b.prototype.sendStatusMessage=function(a,b,c){throw new Error(\"Not implemented yet\")},b.prototype.sendTextMessage=function(a,c,d,e){b._dataAccessProvider.sendTextMessage(a,c,d,b.logSendCallback(e,\"sendTextMessage\"))},b.prototype.sendRecallMessage=function(c,d){var e=b.logSendCallback(d,\"sendRecallMessage\");if(c.senderUserId!=a.Bridge._client.userId){var e=b.logSendCallback(d,\"sendRecallMessage\");return void e.onError(a.ErrorCode.RECALL_MESSAGE,c)}b._dataAccessProvider.sendRecallMessage(c,e)},b.prototype.insertMessage=function(a,c,d,e){b._dataAccessProvider.addMessage(a,c,d,b.logCallback(e,\"insertMessage\"))},b.prototype.setMessageContent=function(a,c,d){b._dataAccessProvider.setMessageContent(a,c,d)},b.prototype.getHistoryMessages=function(c,d,e,f,g,h,i){if(a.CheckParam.getInstance().check([\"number\",\"string|number\",\"number|null|global|object\",\"number\",\"object\",\"undefined|object|null|global|string\",\"number|null|global|object\"],\"getHistoryMessages\",!1,arguments),f>20)throw new Error(\"HistroyMessage count must be less than or equal to 20!\");if(c.valueOf()<0)throw new Error(\"ConversationType must be greater than -1\");b._dataAccessProvider.getHistoryMessages(c,d,e,f,b.logCallback(g,\"getHistoryMessages\"),h,i)},b.prototype.getRemoteHistoryMessages=function(c,d,e,f,g,h){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"number|null|global|object\",\"number\",\"object\",\"undefined|null|global|object\"],\"getRemoteHistoryMessages\",!1,arguments);var i={errorCode:a.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,funcName:\"getRemoteHistoryMessages\"};return f>20?(b.logger(i),void g.onError(a.ErrorCode.RC_CONN_PROTO_VERSION_ERROR)):c.valueOf()<0?(b.logger(i),void g.onError(a.ErrorCode.RC_CONN_PROTO_VERSION_ERROR)):void b._dataAccessProvider.getRemoteHistoryMessages(c,d,e,f,b.logCallback(g,\"getRemoteHistoryMessages\"),h)},b.prototype.clearHistoryMessages=function(a,c){b._dataAccessProvider.clearHistoryMessages(a,c)},b.prototype.clearRemoteHistoryMessages=function(a,c){b._dataAccessProvider.clearRemoteHistoryMessages(a,b.logCallback(c,\"clearRemoteHistoryMessages\"))},b.prototype.hasRemoteUnreadMessages=function(a,c){b._dataAccessProvider.hasRemoteUnreadMessages(a,b.logCallback(c,\"hasRemoteUnreadMessages\"))},b.prototype.getTotalUnreadCount=function(a,c){b._dataAccessProvider.getTotalUnreadCount({onSuccess:function(b){setTimeout(function(){a.onSuccess(b)})},onError:function(c){setTimeout(function(){b.logger({code:c,funcName:\"getTotalUnreadCount\"}),a.onError(c)})}},c)},b.prototype.getConversationUnreadCount=function(a,c){b._dataAccessProvider.getConversationUnreadCount(a,{onSuccess:function(a){setTimeout(function(){c.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"getConversationUnreadCount\"}),c.onError(a)})}})},b.prototype.getUnreadCount=function(a,c,d){b._dataAccessProvider.getUnreadCount(a,c,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"getUnreadCount\"}),d.onError(a)})}})},b.prototype.setUnreadCount=function(c,d,e){a.CheckParam.getInstance().check([\"number\",\"string\",\"number\"],\"setUnreadCount\",!1,arguments),b._dataAccessProvider.setUnreadCount(c,d,e)},b.prototype.clearUnreadCountByTimestamp=function(a,c,d,e){b._dataAccessProvider.clearUnreadCountByTimestamp(a,c,d,b.logCallback(e,\"clearUnreadCountByTimestamp\"))},b.prototype.clearUnreadCount=function(a,c,d){b._dataAccessProvider.clearUnreadCount(a,c,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"clearUnreadCount\"}),d.onError(a)})}})},b.prototype.clearTotalUnreadCount=function(a){b._dataAccessProvider.clearTotalUnreadCount({onSuccess:function(b){a.onSuccess(b)},onError:function(c){setTimeout(function(){b.logger({code:c,funcName:\"clearTotalUnreadCount\"}),a.onError(c)})}})},b.prototype.clearLocalStorage=function(a){b._storageProvider.clearItem(),a()},b.prototype.setMessageExtra=function(a,c,d){b._dataAccessProvider.setMessageExtra(a,c,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"setMessageExtra\"}),d.onError(a)})}})},b.prototype.setMessageReceivedStatus=function(a,c,d){b._dataAccessProvider.setMessageReceivedStatus(a,c,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"setMessageReceivedStatus\"}),d.onError(a)})}})},b.prototype.setMessageStatus=function(a,c,d,e,f){b._dataAccessProvider.setMessageStatus(a,c,d,e,b.logCallback(f,\"setMessageStatus\"))},b.prototype.setMessageSentStatus=function(a,c,d){b._dataAccessProvider.setMessageSentStatus(a,c,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"setMessageSentStatus\"}),d.onError(a)})}})},b.prototype.clearTextMessageDraft=function(c,d){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"clearTextMessageDraft\",!1,arguments);var e=\"darf_\"+c+\"_\"+d;return delete b._memoryStore[e],!0},b.prototype.getTextMessageDraft=function(c,d){if(a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"getTextMessageDraft\",!1,arguments),\"\"==d||c<0)throw new Error(\"params error : \"+a.ErrorCode.DRAF_GET_ERROR);var e=\"darf_\"+c+\"_\"+d;return b._memoryStore[e]},b.prototype.saveTextMessageDraft=function(c,d,e){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"string\",\"object\"],\"saveTextMessageDraft\",!1,arguments);var f=\"darf_\"+c+\"_\"+d;return b._memoryStore[f]=e,!0},b.prototype.searchConversationByContent=function(a,c,d){b._dataAccessProvider.searchConversationByContent(a,b.logCallback(c,\"searchConversationByContent\"),d)},b.prototype.searchMessageByContent=function(a,c,d,e,f,g,h){b._dataAccessProvider.searchMessageByContent(a,c,d,e,f,g,b.logCallback(h,\"searchMessageByContent\"))},b.prototype.clearCache=function(){b._dataAccessProvider.clearCache()},b.prototype.clearConversations=function(c){for(var d=[],e=1;e<arguments.length;e++)d[e-1]=arguments[e];0==d.length&&(d=[a.ConversationType.CHATROOM,a.ConversationType.CUSTOMER_SERVICE,a.ConversationType.DISCUSSION,a.ConversationType.GROUP,a.ConversationType.PRIVATE,a.ConversationType.SYSTEM,a.ConversationType.PUBLIC_SERVICE,a.ConversationType.APP_PUBLIC_SERVICE]),b._dataAccessProvider.clearConversations(d,{onSuccess:function(a){setTimeout(function(){c.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"clearConversations\"}),c.onError(a)})}})},b.prototype.getConversation=function(c,d,e){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"getConversation\",!1,arguments),b._dataAccessProvider.getConversation(c,d,{onSuccess:function(a){setTimeout(function(){e.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"getConversation\"}),e.onError(a)})}})},b.prototype.pottingConversation=function(c){var d=this,e=!1;b._dataAccessProvider.getConversation(c.type,c.userId,{onSuccess:function(f){f?e=!0:f=new a.Conversation,f.conversationType=c.type,f.targetId=c.userId,f.latestMessage=a.MessageUtil.messageParser(c.msg),f.latestMessageId=f.latestMessage.messageId,f.objectName=f.latestMessage.objectName,f.receivedStatus=f.latestMessage.receivedStatus,f.receivedTime=f.latestMessage.receiveTime,f.sentStatus=f.latestMessage.sentStatus,f.sentTime=f.latestMessage.sentTime;var g=b._storageProvider.getItem(\"mentioneds_\"+a.Bridge._client.userId+\"_\"+f.conversationType+\"_\"+f.targetId);if(g){var h=JSON.parse(g);f.mentionedMsg=h[c.type+\"_\"+c.userId]}if(!e)if(a.RongUtil.supportLocalStorage()){var i=b._storageProvider.getItem(\"cu\"+a.Bridge._client.userId+c.type+c.userId);f.unreadMessageCount=Number(i)}else f.unreadMessageCount=0;f.conversationType==a.ConversationType.DISCUSSION&&d.getDiscussion(c.userId,{onSuccess:function(a){f.conversationTitle=a.name},onError:function(a){}}),b._dataAccessProvider.addConversation(f,{onSuccess:function(a){}})},onError:function(a){}})},b.prototype.addConversation=function(a,c){b._dataAccessProvider.addConversation(a,c)},b.prototype.sortConversationList=function(a){for(var c=[],d=0,e=a.length;d<e;d++)if(a[d])if(a[d].isTop)c.push(a[d]),a.splice(d,1);else for(var f=0;f<e-d-1;f++)if(a[f].sentTime<a[f+1].sentTime){var g=a[f];a[f]=a[f+1],a[f+1]=g}return b._memoryStore.conversationList=c.concat(a)},b.prototype.getConversationList=function(c,d,e,f){a.CheckParam.getInstance().check([\"object\",\"null|undefined|array|object|global\",\"number|undefined|null|object|global\",\"boolean|undefined|null|object|global\"],\"getConversationList\",!1,arguments);b._dataAccessProvider.getConversationList({onSuccess:function(a){d||b._dataAccessProvider?setTimeout(function(){c.onSuccess(a)}):setTimeout(function(){c.onSuccess(b._memoryStore.conversationList)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"getConversationList\"}),c.onError(a)})}},d,e,f)},b.prototype.getRemoteConversationList=function(c,d,e,f){a.CheckParam.getInstance().check([\"object\",\"null|array|object|global\",\"number|undefined|null|object|global\",\"boolean|undefined|null|object|global\"],\"getRemoteConversationList\",!1,arguments),b._dataAccessProvider.getRemoteConversationList(b.logCallback(c,\"getRemoteConversationList\"),d,e,f)},b.prototype.updateConversation=function(a){return b._dataAccessProvider.updateConversation(a)},b.prototype.createConversation=function(b,c,d){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"string\"],\"createConversation\",!1,arguments);var e=new a.Conversation;return e.targetId=c,e.conversationType=b,e.conversationTitle=d,e.latestMessage={},e.unreadMessageCount=0,e},b.prototype.removeConversation=function(c,d,e){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"removeConversation\",!1,arguments),b._dataAccessProvider.removeConversation(c,d,b.logCallback(e,\"removeConversation\"))},b.prototype.setConversationHidden=function(c,d,e){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"boolean\"],\"setConversationHidden\",!1,arguments),b._dataAccessProvider.setConversationHidden(c,d,e)},b.prototype.setConversationToTop=function(c,d,e,f){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"boolean\",\"object\"],\"setConversationToTop\",!1,arguments),b._dataAccessProvider.setConversationToTop(c,d,e,{onSuccess:function(a){setTimeout(function(){f.onSuccess(a)})},onError:function(a){setTimeout(function(){b.logger({code:a,funcName:\"setConversationToTop\"}),f.onError(a)})}})},b.prototype.getConversationNotificationStatus=function(a,c,d){var e={conversationType:a,targetId:c};b._dataAccessProvider.getConversationNotificationStatus(e,b.logCallback(d,\"getConversationNotificationStatus\"))},b.prototype.setConversationNotificationStatus=function(a,c,d,e){var f={conversationType:a,targetId:c,status:status};b._dataAccessProvider.setConversationNotificationStatus(f,b.logCallback(e,\"setConversationNotificationStatus\"))},b.prototype.getNotificationQuietHours=function(a){throw new Error(\"Not implemented yet\")},b.prototype.removeNotificationQuietHours=function(a){throw new Error(\"Not implemented yet\")},b.prototype.setNotificationQuietHours=function(a,b,c){throw new Error(\"Not implemented yet\")},b.prototype.addMemberToDiscussion=function(c,d,e){a.CheckParam.getInstance().check([\"string\",\"array\",\"object\"],\"addMemberToDiscussion\",!1,arguments),b._dataAccessProvider.addMemberToDiscussion(c,d,b.logCallback(e,\"addMemberToDiscussion\"))},b.prototype.createDiscussion=function(c,d,e){a.CheckParam.getInstance().check([\"string\",\"array\",\"object\"],\"createDiscussion\",!1,arguments),b._dataAccessProvider.createDiscussion(c,d,e)},b.prototype.getDiscussion=function(c,d){a.CheckParam.getInstance().check([\"string\",\"object\"],\"getDiscussion\",!1,arguments),b._dataAccessProvider.getDiscussion(c,b.logCallback(d,\"getDiscussion\"))},b.prototype.quitDiscussion=function(c,d){a.CheckParam.getInstance().check([\"string\",\"object\"],\"quitDiscussion\",!1,arguments),b._dataAccessProvider.quitDiscussion(c,b.logCallback(d,\"quitDiscussion\"))},b.prototype.removeMemberFromDiscussion=function(c,d,e){a.CheckParam.getInstance().check([\"string\",\"string\",\"object\"],\"removeMemberFromDiscussion\",!1,arguments),b._dataAccessProvider.removeMemberFromDiscussion(c,d,b.logCallback(e,\"removeMemberFromDiscussion\"))},b.prototype.setDiscussionInviteStatus=function(c,d,e){a.CheckParam.getInstance().check([\"string\",\"number\",\"object\"],\"setDiscussionInviteStatus\",!1,arguments),b._dataAccessProvider.setDiscussionInviteStatus(c,d,b.logCallback(e,\"setDiscussionInviteStatus\"))},b.prototype.setDiscussionName=function(c,d,e){a.CheckParam.getInstance().check([\"string\",\"string\",\"object\"],\"setDiscussionName\",!1,arguments),b._dataAccessProvider.setDiscussionName(c,d,b.logCallback(e,\"setDiscussionName\"))},b.prototype.joinChatRoom=function(c,d,e){if(a.CheckParam.getInstance().check([\"string|number\",\"number\",\"object\"],\"joinChatRoom\",!1,arguments),\"\"==c)return void setTimeout(function(){var c=a.ErrorCode.CHATROOM_ID_ISNULL;b.logger({code:c,funcName:\"joinChatRoom\"}),e.onError(a.ErrorCode.CHATROOM_ID_ISNULL)});b._dataAccessProvider.joinChatRoom(c,d,b.logCallback(e,\"joinChatRoom\"))},b.prototype.setDeviceInfo=function(a){b._dataAccessProvider.setDeviceInfo(a)},b.prototype.setChatroomHisMessageTimestamp=function(c,d){a.CheckParam.getInstance().check([\"string|number\",\"number\"],\"setChatroomHisMessageTimestamp\",!1,arguments),b._dataAccessProvider.setChatroomHisMessageTimestamp(c,d)},b.prototype.getChatRoomHistoryMessages=function(c,d,e,f){a.CheckParam.getInstance().check([\"string|number\",\"number\",\"number\",\"object\"],\"getChatRoomHistoryMessages\",!1,arguments),b._dataAccessProvider.getChatRoomHistoryMessages(c,d,e,b.logCallback(f,\"getChatRoomHistoryMessages\"))},b.prototype.getChatRoomInfo=function(c,d,e,f){a.CheckParam.getInstance().check([\"string|number\",\"number\",\"number\",\"object\"],\"getChatRoomInfo\",!1,arguments),b._dataAccessProvider.getChatRoomInfo(c,d,e,b.logCallback(f,\"getChatRoomInfo\"))},b.prototype.quitChatRoom=function(c,d){a.CheckParam.getInstance().check([\"string|number\",\"object\"],\"quitChatRoom\",!1,arguments),b._dataAccessProvider.quitChatRoom(c,b.logCallback(d,\"quitChatRoom\"))},b.prototype.getRemotePublicServiceList=function(a,c){b._dataAccessProvider.getRemotePublicServiceList(b.logCallback(a,\"getRemotePublicServiceList\"),c)},b.prototype.getPublicServiceList=function(c){b._memoryStore.depend.openMp&&(a.CheckParam.getInstance().check([\"object\"],\"getPublicServiceList\",!1,arguments),this.getRemotePublicServiceList(b.logCallback(c,\"getPublicServiceList\")))},b.prototype.getPublicServiceProfile=function(c,d,e){b._memoryStore.depend.openMp&&(a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"getPublicServiceProfile\",!1,arguments),b._dataAccessProvider.getPublicServiceProfile(c,d,b.logCallback(e,\"getPublicServiceProfile\")))},b.prototype.pottingPublicSearchType=function(a,c){if(b._memoryStore.depend.openMp){var d=0;return 0==a?(d|=3,d|=0==c?12:48):1==a?(d|=1,d|=0==c?8:32):(d|=2,d|=0==a?4:16),d}},b.prototype.searchPublicService=function(c,d,e){if(b._memoryStore.depend.openMp){a.CheckParam.getInstance().check([\"number\",\"string\",\"object\"],\"searchPublicService\",!1,arguments);var f=new b.Protobuf.SearchMpInput;f.setType(this.pottingPublicSearchType(0,c)),f.setId(d),b.bridge.queryMsg(29,a.MessageUtil.ArrayForm(f.toArrayBuffer()),a.Bridge._client.userId,b.logCallback(e,\"searchPublicService\"),\"SearchMpOutput\")}},b.prototype.searchPublicServiceByType=function(c,d,e,f){if(b._memoryStore.depend.openMp){a.CheckParam.getInstance().check([\"number\",\"number\",\"string\",\"object\"],\"searchPublicServiceByType\",!1,arguments);var g=c==a.ConversationType.APP_PUBLIC_SERVICE?2:1,h=new b.Protobuf.SearchMpInput;h.setType(this.pottingPublicSearchType(g,d)),h.setId(e),b.bridge.queryMsg(29,a.MessageUtil.ArrayForm(h.toArrayBuffer()),a.Bridge._client.userId,b.logCallback(f,\"searchPublicServiceByType\"),\"SearchMpOutput\")}},b.prototype.subscribePublicService=function(c,d,e){if(b._memoryStore.depend.openMp){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"subscribePublicService\",!1,arguments);var f=new b.Protobuf.MPFollowInput,g=this,h=c==a.ConversationType.APP_PUBLIC_SERVICE?\"mcFollow\":\"mpFollow\";f.setId(d),b.bridge.queryMsg(h,a.MessageUtil.ArrayForm(f.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(){g.getRemotePublicServiceList({onSuccess:function(){},onError:function(){}}),e.onSuccess()},onError:function(a){var c=a;b.logger({code:c,funcName:\"subscribePublicService\"}),e.onError(a)}},\"MPFollowOutput\")}},b.prototype.unsubscribePublicService=function(c,d,e){if(b._memoryStore.depend.openMp){a.CheckParam.getInstance().check([\"number\",\"string|number\",\"object\"],\"unsubscribePublicService\",!1,arguments);var f=new b.Protobuf.MPFollowInput,g=c==a.ConversationType.APP_PUBLIC_SERVICE?\"mcUnFollow\":\"mpUnFollow\";f.setId(d),b.bridge.queryMsg(g,a.MessageUtil.ArrayForm(f.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(){b._memoryStore.publicServiceMap.remove(c,d),e.onSuccess()},onError:function(a){var c=a;b.logger({code:c,funcName:\"unsubscribePublicService\"}),e.onError(a)}},\"MPFollowOutput\")}},b.prototype.addToBlacklist=function(c,d){a.CheckParam.getInstance().check([\"string|number\",\"object\"],\"addToBlacklist\",!1,arguments),b._dataAccessProvider.addToBlacklist(c,b.logCallback(d,\"addToBlacklist\"))},b.prototype.getBlacklist=function(c){a.CheckParam.getInstance().check([\"object\"],\"getBlacklist\",!1,arguments),b._dataAccessProvider.getBlacklist(c)},b.prototype.getBlacklistStatus=function(c,d){a.CheckParam.getInstance().check([\"string|number\",\"object\"],\"getBlacklistStatus\",!1,arguments),b._dataAccessProvider.getBlacklistStatus(c,b.logCallback(d,\"getBlacklistStatus\"))},b.prototype.removeFromBlacklist=function(c,d){a.CheckParam.getInstance().check([\"string|number\",\"object\"],\"removeFromBlacklist\",!1,arguments),b._dataAccessProvider.removeFromBlacklist(c,b.logCallback(d,\"removeFromBlacklist\"))},b.prototype.getFileToken=function(c,d){a.CheckParam.getInstance().check([\"number\",\"object\"],\"getQngetFileTokenTkn\",!1,arguments),b._dataAccessProvider.getFileToken(c,b.logCallback(d,\"getFileToken\"))},b.prototype.getFileUrl=function(c,d,e,f){a.CheckParam.getInstance().check([\"number\",\"string\",\"string|global|object|null\",\"object\"],\"getFileUrl\",!1,arguments),b._dataAccessProvider.getFileUrl(c,d,e,b.logCallback(f,\"getFileUrl\"))},\nb.prototype.addRealTimeLocationListener=function(a,b,c){throw new Error(\"Not implemented yet\")},b.prototype.getRealTimeLocation=function(a,b){throw new Error(\"Not implemented yet\")},b.prototype.getRealTimeLocationCurrentState=function(a,b){throw new Error(\"Not implemented yet\")},b.prototype.getRealTimeLocationParticipants=function(a,b){throw new Error(\"Not implemented yet\")},b.prototype.joinRealTimeLocation=function(a,b){throw new Error(\"Not implemented yet\")},b.prototype.quitRealTimeLocation=function(a,b){throw new Error(\"Not implemented yet\")},b.prototype.startRealTimeLocation=function(a,b){throw new Error(\"Not implemented yet\")},b.prototype.updateRealTimeLocationStatus=function(a,b,c,d){throw new Error(\"Not implemented yet\")},b.prototype.startCall=function(c,d,e,f,g,h){if(a.CheckParam.getInstance().check([\"number\",\"string|number\",\"array\",\"number\",\"string\",\"object\"],\"startCall\",!1,arguments),b._memoryStore.voipStategy)b._voipProvider.startCall(c,d,e,f,g,b.logCallback(h,\"startCall\"));else{var i=a.ErrorCode.VOIP_NOT_AVALIABLE;b.logger({code:i,funcName:\"startCall\"}),h.onError(a.ErrorCode.VOIP_NOT_AVALIABLE)}},b.prototype.joinCall=function(c,d){if(a.CheckParam.getInstance().check([\"number\",\"object\"],\"joinCall\",!1,arguments),b._memoryStore.voipStategy)b._voipProvider.joinCall(c,b.logCallback(d,\"joinCall\"));else{var e=a.ErrorCode.VOIP_NOT_AVALIABLE;b.logger({code:e,funcName:\"joinCall\"}),d.onError(a.ErrorCode.VOIP_NOT_AVALIABLE)}},b.prototype.hungupCall=function(c,d,e){a.CheckParam.getInstance().check([\"number\",\"string\",\"number\"],\"hungupCall\",!1,arguments),b._memoryStore.voipStategy&&b._voipProvider.hungupCall(c,d,e)},b.prototype.changeMediaType=function(c,d,e,f){if(a.CheckParam.getInstance().check([\"number\",\"string\",\"number\",\"object\"],\"changeMediaType\",!1,arguments),b._memoryStore.voipStategy)b._voipProvider.changeMediaType(c,d,e,b.logCallback(f,\"changeMediaType\"));else{var g=a.ErrorCode.VOIP_NOT_AVALIABLE;b.logger({code:g,funcName:\"changeMediaType\"}),f.onError(a.ErrorCode.VOIP_NOT_AVALIABLE)}},b.prototype.getUnreadMentionedMessages=function(a,c){return b._dataAccessProvider.getUnreadMentionedMessages(a,c)},b.prototype.clearListeners=function(){b._dataAccessProvider.clearListeners()},b.prototype.getUserStatus=function(a,c){b._dataAccessProvider.getUserStatus(a,b.logCallback(c,\"getUserStatus\"))},b.prototype.setUserStatus=function(a,c){b._dataAccessProvider.setUserStatus(a,b.logCallback(c,\"setUserStatus\"))},b.prototype.setUserStatusListener=function(a,c){var d=a.userIds,e=a.multiple;b.userStatusObserver.watch({key:d,func:c,multiple:e}),b._dataAccessProvider.setUserStatusListener(a,c)},b.messageWatch=function(a){b.RTCListener=a},b.prototype.getRTCUserInfoList=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"getRTCUserInfoList\",!1,arguments),b._dataAccessProvider.getRTCUserInfoList(c,d)},b.prototype.getRTCUserList=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"getRTCUserList\",!1,arguments),b._dataAccessProvider.getRTCUserList(c,d)},b.prototype.setRTCUserInfo=function(c,d,e){a.CheckParam.getInstance().check([\"object\",\"object\",\"object\"],\"setRTCUserInfo\",!1,arguments),b._dataAccessProvider.setRTCUserInfo(c,d,e)},b.prototype.removeRTCUserInfo=function(c,d,e){a.CheckParam.getInstance().check([\"object\",\"object\",\"object\"],\"removeRTCUserInfo\",!1,arguments),b._dataAccessProvider.removeRTCUserInfo(c,d,e)},b.prototype.getRTCRoomInfo=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"getRTCRoomInfo\",!1,arguments),b._dataAccessProvider.getRTCRoomInfo(c,d)},b.prototype.setRTCRoomInfo=function(c,d,e){a.CheckParam.getInstance().check([\"object\",\"object\",\"object\"],\"setRTCRoomInfo\",!1,arguments),b._dataAccessProvider.setRTCRoomInfo(c,d,e)},b.prototype.removeRTCRoomInfo=function(c,d,e){a.CheckParam.getInstance().check([\"object\",\"object\",\"object\"],\"removeRTCRoomInfo\",!1,arguments),b._dataAccessProvider.removeRTCRoomInfo(c,d,e)},b.prototype.joinRTCRoom=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"joinRTCRoom\",!1,arguments),b._dataAccessProvider.joinRTCRoom(c,d)},b.prototype.quitRTCRoom=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"quitRTCRoom\",!1,arguments),b._dataAccessProvider.quitRTCRoom(c,d)},b.prototype.RTCPing=function(c,d){a.CheckParam.getInstance().check([\"object\",\"object\"],\"RTCPing\",!1,arguments),b._dataAccessProvider.RTCPing(c,d)},b.prototype.setRTCUserData=function(c,d,e,f,g,h){a.CheckParam.getInstance().check([\"string\",\"string\",\"string\",\"boolean\",\"object\",\"global|object|null|undefined\"],\"setRTCUserData\",!1,arguments),b._dataAccessProvider.setRTCUserData(c,d,e,f,g,h)},b.prototype.getRTCUserData=function(c,d,e,f){a.CheckParam.getInstance().check([\"string\",\"array\",\"boolean\",\"object\",\"global|object|null\"],\"getRTCUserData\",!1,arguments),b._dataAccessProvider.getRTCUserData(c,d,e,f)},b.prototype.removeRTCUserData=function(c,d,e,f,g){a.CheckParam.getInstance().check([\"string\",\"array\",\"boolean\",\"object\",\"global|object|null|undefined\"],\"removeRTCUserData\",!1,arguments),b._dataAccessProvider.removeRTCUserData(c,d,e,f,g)},b.prototype.setRTCRoomData=function(c,d,e,f,g,h){a.CheckParam.getInstance().check([\"string\",\"string\",\"string\",\"boolean\",\"object\",\"global|object|null|undefined\"],\"setRTCRoomData\",!1,arguments),b._dataAccessProvider.setRTCRoomData(c,d,e,f,g,h)},b.prototype.getRTCRoomData=function(c,d,e,f){a.CheckParam.getInstance().check([\"string\",\"array\",\"boolean\",\"object\"],\"getRTCRoomData\",!1,arguments),b._dataAccessProvider.getRTCRoomData(c,d,e,f)},b.prototype.removeRTCRoomData=function(c,d,e,f,g){a.CheckParam.getInstance().check([\"string\",\"array\",\"boolean\",\"object\",\"global|object|null|undefined\"],\"removeRTCRoomData\",!1,arguments),b._dataAccessProvider.removeRTCRoomData(c,d,e,f,g)},b.prototype.getNavi=function(){return b._dataAccessProvider.getNavi()},b.prototype.getRTCToken=function(c,d){return a.CheckParam.getInstance().check([\"object\",\"object\"],\"getRTCToken\",!1,arguments),b._dataAccessProvider.getRTCToken(c,d)},b.prototype.getAppInfo=function(){return{appKey:b._memoryStore.appKey}},b.RTCListener=function(){},b.LogFactory={},b.MessageType={},b.RegisterMessage={},b._memoryStore={listenerList:[],isPullFinished:!1,syncMsgQueue:[]},b.isNotPullMsg=!1,b.userStatusObserver=null,b.sdkver=\"2.4.0\",b.otherDeviceLoginCount=0,b.serverStore={index:0},b.isFirstConnect=!0,b.statusListeners=[],b.userStatusListener=null,b}();a.RongIMClient=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){!function(a){a[a.AT_MOST_ONCE=0]=\"AT_MOST_ONCE\",a[a.AT_LEAST_ONCE=1]=\"AT_LEAST_ONCE\",a[a.EXACTLY_ONCE=2]=\"EXACTLY_ONCE\",a[a.DEFAULT=3]=\"DEFAULT\"}(a.Qos||(a.Qos={}));var b=a.Qos;!function(a){a[a.CONNECT=1]=\"CONNECT\",a[a.CONNACK=2]=\"CONNACK\",a[a.PUBLISH=3]=\"PUBLISH\",a[a.PUBACK=4]=\"PUBACK\",a[a.QUERY=5]=\"QUERY\",a[a.QUERYACK=6]=\"QUERYACK\",a[a.QUERYCON=7]=\"QUERYCON\",a[a.SUBSCRIBE=8]=\"SUBSCRIBE\",a[a.SUBACK=9]=\"SUBACK\",a[a.UNSUBSCRIBE=10]=\"UNSUBSCRIBE\",a[a.UNSUBACK=11]=\"UNSUBACK\",a[a.PINGREQ=12]=\"PINGREQ\",a[a.PINGRESP=13]=\"PINGRESP\",a[a.DISCONNECT=14]=\"DISCONNECT\"}(a.Type||(a.Type={}));var c=(a.Type,[\"invtDiz\",\"crDiz\",\"qnUrl\",\"userInf\",\"dizInf\",\"userInf\",\"joinGrp\",\"quitDiz\",\"exitGrp\",\"evctDiz\",[\"\",\"ppMsgP\",\"pdMsgP\",\"pgMsgP\",\"chatMsg\",\"pcMsgP\",\"\",\"pmcMsgN\",\"pmpMsgN\",\"\",\"\",\"\",\"prMsgS\"],\"pdOpen\",\"rename\",\"uGcmpr\",\"qnTkn\",\"destroyChrm\",\"createChrm\",\"exitChrm\",\"queryChrm\",\"joinChrm\",\"pGrps\",\"addBlack\",\"rmBlack\",\"getBlack\",\"blackStat\",\"addRelation\",\"qryRelation\",\"delRelation\",\"pullMp\",\"schMp\",\"qnTkn\",\"qnUrl\",\"qryVoipK\",\"delMsg\",\"qryCHMsg\",\"getUserStatus\",\"setUserStatus\",\"subUserStatus\",\"cleanHisMsg\"]),d=function(){function b(c,d){this.connectionStatus=-1;var f=d.appId,g=encodeURIComponent(d.token),h=d.sdkVer,i=d.apiVer;this.self=d,this.socket=e.getInstance().createServer();var j=this,k=a.RongIMClient._storageProvider,l=k.getItem(\"servers\");l=JSON.parse(l)||[];var m=a.RongIMClient._memoryStore.depend,n=function(b){j.url=a.RongUtil.tplEngine(\"{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}\",{host:b,appId:f,token:g,sdkVer:h,apiVer:i}),j.socket.connect(j.url,c);var d=k.getItem(\"rong_current_user\");a.Navigation.Endpoint={host:b,userId:d}};({ws:function(){for(var b=new a.Timer({timeout:15e3}),c=[],d=[],e=!1,f=function(){for(var a=0;a<c.length;a++){var b=c[a];clearTimeout(b)}for(var a=0;a<d.length;a++){d[a].abort()}c.length=0,d.length=0},g=function(g,h){var i=g.url,j=g.time;if(!e){var k=setTimeout(function(){var c=function(){e||(f(),e=!0,b.pause(),h(i))},g=a.MessageUtil.detectCMP({url:i,success:c,fail:function(a){console.log(a)}});d.push(g)},j);c.push(k)}},h=function(a){var b=/(http|https):\\/\\/([^\\/]+)/i,c=a.match(b)[2];n(c)},i=\"{protocol}{server}/ping?r={random}\",k=0;k<l.length;k++){var o=l[k];o&&(o=a.RongUtil.tplEngine(i,{protocol:m.protocol,server:o,random:a.RongUtil.getTimestamp()}),g({url:o,time:1e3*k},h))}b.resume(function(){a.Navigation.clear(),f(),j.socket.fire(\"StatusChanged\",a.ConnectionStatus.NETWORK_UNAVAILABLE)})},comet:function(){var a=l[0];n(a)}})[m.isPolling?\"comet\":\"ws\"]();var o=b._ConnectionStatusListener,p=\"object\"==typeof o,q=this;q.socket.on(\"StatusChanged\",function(b){if(!p)throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");var c=b==a.ConnectionStatus.NETWORK_UNAVAILABLE,e=!a.RongIMClient._memoryStore.depend.isPolling;a.RongIMClient.isFirstConnect&&c&&e&&(b=a.ConnectionStatus.WEBSOCKET_UNAVAILABLE),q.connectionStatus=b,setTimeout(function(){o.onChanged(b)}),b==a.ConnectionStatus.DISCONNECTED&&d.clearHeartbeat(),b==a.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT&&a.RongIMClient.otherDeviceLoginCount++,b==a.ConnectionStatus.CONNECTED&&(a.RongIMClient.isFirstConnect=!1),b==a.ConnectionStatus.WEBSOCKET_UNAVAILABLE&&(q.changeConnectType(),a.RongIMClient.isFirstConnect=!1,a.RongIMClient.connect(d.token,a.RongIMClient._memoryStore.callback))}),this.socket.on(\"message\",d.handler.handleMessage),this.socket.on(\"disconnect\",function(a){j.socket.fire(\"StatusChanged\",a||2)})}return b.prototype.changeConnectType=function(){a.RongIMClient._memoryStore.depend.isPolling=!a.RongIMClient._memoryStore.depend.isPolling,new a.FeatureDectector},b.prototype.writeAndFlush=function(a){this.socket.send(a)},b.prototype.reconnect=function(b){a.MessageIdHandler.clearMessageId(),this.socket=this.socket.reconnect(),b&&(this.self.reconnectObj=b)},b.prototype.disconnect=function(a){this.socket.disconnect(a)},b}();a.Channel=d;var e=function(){function b(){this.socket=null,this._events={}}return b.getInstance=function(){return new b},b.prototype.connect=function(b,c){return this.socket&&(b&&(a.RongIMClient._storageProvider.setItem(\"rongSDK\",this.checkTransport()),this.on(\"connect\",c||new Function)),b&&(this.currentURL=b),this.socket.createTransport(b)),this},b.prototype.createServer=function(){var a=this.getTransport(this.checkTransport());if(null===a)throw new Error(\"the channel was not supported\");return a},b.prototype.getTransport=function(c){return c==b.XHR_POLLING?this.socket=new a.PollingTransportation(this):c==b.WEBSOCKET&&(this.socket=new a.SocketTransportation(this)),this},b.prototype.send=function(a){this.socket&&(this.checkTransport()==b.WEBSOCKET?this.socket.send(a):this.socket.send(this._encode(a)))},b.prototype.onMessage=function(a){this.fire(\"message\",a)},b.prototype.disconnect=function(a){return this.socket.disconnect(a),this.fire(\"disconnect\",a),this},b.prototype.reconnect=function(){if(this.currentURL&&a.RongIMClient._storageProvider.getItem(\"rongSDK\"))return this.connect(this.currentURL,null);throw new Error(\"reconnect:no have URL\")},b.prototype.checkTransport=function(){return a.RongIMClient._memoryStore.depend.isPolling&&(a.Transportations._TransportType=b.XHR_POLLING),a.Transportations._TransportType},b.prototype.fire=function(a,b){if(a in this._events)for(var c=0,d=this._events[a].length;c<d;c++)this._events[a][c](b);return this},b.prototype.on=function(b,c){return\"function\"==typeof c&&b?(b in this._events?-1==a.MessageUtil.indexOf(this._events,c)&&this._events[b].push(c):this._events[b]=[c],this):this},b.prototype.removeEvent=function(a,b){if(a in this._events)for(var c=0,d=this._events[a].length;c<d;c++)this._events[a][c]==b&&this._events[a].splice(c,1);return this},b.prototype._encode=function(b){var c=\"?messageid=\"+b.getMessageId()+\"&header=\"+b.getHeaderFlag()+\"&sessionid=\"+a.RongIMClient._storageProvider.getItem(\"sId\"+a.Navigation.Endpoint.userId);return/(PubAckMessage|QueryConMessage)/.test(b._name)||(c+=\"&topic=\"+b.getTopic()+\"&targetid=\"+(b.getTargetId()||\"\")),{url:c,data:\"getData\"in b?b.getData():\"\"}},b.XHR_POLLING=\"xhr-polling\",b.WEBSOCKET=\"websocket\",b}();a.Socket=e;var f=function(){function c(b,c){this.timeoutMillis=6e3,this.timeout_=0,this.sdkVer=\"\",this.apiVer=Math.floor(1e6*Math.random()),this.channel=null,this.handler=null,this.userId=\"\",this.reconnectObj={},this.heartbeat=0,this.pullMsgHearbeat=0,this.chatroomId=\"\",this.SyncTimeQueue=[],this.cacheMessageIds=[],this.token=b,this.appId=c,this.SyncTimeQueue.state=\"complete\",this.sdkVer=a.RongIMClient.sdkver}return c.prototype.resumeTimer=function(){var a=this;this.timeout_=setTimeout(function(){a.channel.disconnect()},this.timeoutMillis)},c.prototype.pauseTimer=function(){this.timeout_&&(clearTimeout(this.timeout_),this.timeout_=0)},c.prototype.connect=function(b){this.handler=new h(this),this.handler.setConnectCallback(b);var c=this;this.channel=new d(function(){a.Transportations._TransportType==e.WEBSOCKET&&c.keepLive()},this),this.channel.socket.fire(\"StatusChanged\",a.ConnectionStatus.CONNECTING)},c.prototype.checkSocket=function(b){this.channel.writeAndFlush(new a.PingReqMessage);var c=0,d=setInterval(function(){a.RongIMClient._memoryStore.isFirstPingMsg?c>15&&(clearInterval(d),b.onError()):(clearInterval(d),b.onSuccess()),c++},100)},c.prototype.keepLive=function(){this.heartbeat>0&&clearInterval(this.heartbeat);var b=this;b.heartbeat=setInterval(function(){b.resumeTimer(),b.channel.writeAndFlush(new a.PingReqMessage)},3e4),b.pullMsgHearbeat>0&&clearInterval(b.pullMsgHearbeat),b.pullMsgHearbeat=setInterval(function(){b.syncTime(!0,void 0,void 0,!1)},18e4)},c.prototype.clearHeartbeat=function(){clearInterval(this.heartbeat),this.heartbeat=0,this.pauseTimer(),clearInterval(this.pullMsgHearbeat),this.pullMsgHearbeat=0},c.prototype.publishMessage=function(c,d,e,f,g){var h=a.MessageIdHandler.messageIdPlus(this.channel.reconnect);if(h){var i=new a.PublishMessage(c,d,e);i.setMessageId(h),f?(i.setQos(b.AT_LEAST_ONCE),this.handler.putCallback(new a.PublishCallback(f.onSuccess,f.onError),i.getMessageId(),g)):i.setQos(b.AT_MOST_ONCE),this.channel.writeAndFlush(i)}},c.prototype.queryMessage=function(b,d,e,f,g,h){if(\"userInf\"==b&&c.userInfoMapping[e])return void g.onSuccess(c.userInfoMapping[e]);var i=a.MessageIdHandler.messageIdPlus(this.channel.reconnect);if(i){var j=new a.QueryMessage(b,d,e);j.setMessageId(i),j.setQos(f),this.handler.putCallback(new a.QueryCallback(g.onSuccess,g.onError),j.getMessageId(),h),this.channel.writeAndFlush(j)}},c.prototype.invoke=function(c,d,e){var f,h,i,j,k=this,l=this.SyncTimeQueue.shift();if(void 0!=l){this.SyncTimeQueue.state=\"pending\";var m=a.SyncTimeUtil.get(),n=m.sent;if(2!=l.type)f=m.received,h=new a.RongIMClient.Protobuf.SyncRequestMsg,h.setIspolling(!1),i=\"pullMsg\",j=this.userId,h.setSendBoxSyncTime(n);else if(j=l.chrmId||k.chatroomId,f=a.RongIMClient._memoryStore.lastReadTime.get(j+g._client.userId+\"CST\")||0,h=new a.RongIMClient.Protobuf.ChrmPullMsg,h.setCount(0),i=\"chrmPull\",!j)throw new Error(\"syncTime:Received messages of chatroom but was not init\");if(l.pulltime<=f)return this.SyncTimeQueue.state=\"complete\",void this.invoke(c,j,e);c&&\"setIsPullSend\"in h&&h.setIsPullSend(!0),h.setSyncTime(f),this.queryMessage(i,a.MessageUtil.ArrayForm(h.toArrayBuffer()),j,b.AT_LEAST_ONCE,{onSuccess:function(b){var d=a.MessageUtil.int64ToTimestamp(b.syncTime),h=j,l=\"chrmPull\"==i;if(l)h+=g._client.userId+\"CST\",a.RongIMClient._memoryStore.lastReadTime.set(h,d);else{var m=a.RongIMClient._storageProvider;d>m.getItem(h)&&m.setItem(h,d)}var o=b.list,p=b.finished;l&&(p=!0),a.RongIMClient._memoryStore.isPullFinished=p;for(var q=a.RongIMClient._memoryStore.connectAckTime,r=0,s=o.length,t=s;r<s;r++){t-=1;var u=o[r],v=a.MessageUtil.int64ToTimestamp(u.dataTime);if(v>(u.direction==a.MessageDirection.SEND?n:f)){var w=v<q;g._client.handler.onReceived(u,void 0,w,t,!1,p)}}k.SyncTimeQueue.state=\"complete\",k.invoke(c,j,e)},onError:function(a){k.SyncTimeQueue.state=\"complete\",k.invoke(c,j,e)}},\"DownStreamMessages\")}},c.prototype.syncTime=function(a,b,c,d){this.SyncTimeQueue.push({type:a,pulltime:b,chrmId:c}),1==this.SyncTimeQueue.length&&\"complete\"==this.SyncTimeQueue.state&&this.invoke(!a,c,d)},c.prototype.__init=function(b){this.handler=new h(this),this.handler.setConnectCallback(a.RongIMClient._memoryStore.callback),this.channel=new d(b,this)},c.userInfoMapping={},c}();a.Client=f;var g=function(){function e(){}return e.getInstance=function(){return new e},e.prototype.connect=function(b,c,d){if(a.RongIMClient.Protobuf)return e._client=(new a.Navigation).connect(b,c,d),e._client},e.prototype.setListener=function(a){\"object\"==typeof a&&(\"function\"==typeof a.onChanged?d._ConnectionStatusListener=a:\"function\"==typeof a.onReceived&&(d._ReceiveMessageListener=a))},e.prototype.reconnect=function(a){e._client.channel.reconnect(a)},e.prototype.disconnect=function(){e._client.channel.disconnect(2)},e.prototype.queryMsg=function(a,d,f,g,h){\"string\"!=typeof a&&(a=c[a]),e._client.queryMessage(a,d,f,b.AT_MOST_ONCE,g,h)},e.prototype.pubMsg=function(b,d,f,g,h,i){\"number\"==typeof i?i==a.MethodType.CUSTOMER_SERVICE?e._client.publishMessage(\"pcuMsgP\",d,f,g,h):i==a.MethodType.RECALL&&e._client.publishMessage(\"recallMsg\",d,f,g,h):e._client.publishMessage(c[10][b],d,f,g,h)},e}();a.Bridge=g;var h=function(){function b(a){if(this.map={},this.connectCallback=null,!d._ReceiveMessageListener)throw new Error(\"please set onReceiveMessageListener\");this._onReceived=d._ReceiveMessageListener.onReceived,this._client=a,this.syncMsgMap=new Object}return b.prototype.putCallback=function(a,b,c){var d={Callback:a,Message:c};d.Callback.resumeTimer(),this.map[b]=d},b.prototype.setConnectCallback=function(b){b&&(this.connectCallback=new a.ConnectAck(b.onSuccess,b.onError,this._client))},b.prototype.onReceived=function(b,c,d,e,f){var h,i,j;if(\"PublishMessage\"!=b._name)h=b,a.RongIMClient._storageProvider.setItem(this._client.userId,a.MessageUtil.int64ToTimestamp(h.dataTime));else{if(\"s_ntf\"==b.getTopic())return h=a.RongIMClient.Protobuf.NotifyMsg.decode(b.getData()),void this._client.syncTime(h.type,a.MessageUtil.int64ToTimestamp(h.time),h.chrmId);if(\"s_msg\"==b.getTopic()){h=a.RongIMClient.Protobuf.DownStreamMessage.decode(b.getData());var k=a.MessageUtil.int64ToTimestamp(h.dataTime);a.RongIMClient._storageProvider.setItem(this._client.userId,k),a.RongIMClient._memoryStore.lastReadTime.get(this._client.userId,k)}else{if(\"s_stat\"==b.getTopic())return h=a.RongIMClient.Protobuf.GetUserStatusOutput.decode(b.getData()),h=a.RongInnerTools.convertUserStatus(h),void a.RongIMClient.userStatusObserver.notify({key:h.userId,entity:h});if(g._client.sdkVer&&\"1.0.0\"==g._client.sdkVer)return;h=a.RongIMClient.Protobuf.UpStreamMessage.decode(b.getData());var l=b.getTopic(),m=l.substr(0,2);\"pp\"==m?h.type=1:\"pd\"==m?h.type=2:\"pg\"==m?h.type=3:\"ch\"==m?h.type=4:\"pc\"==m&&(h.type=5),h.groupId=b.getTargetId(),h.fromUserId=this._client.userId,h.dataTime=Date.parse((new Date).toString())}if(!h)return}var n=a.RongIMClient._memoryStore.isPullFinished;if(n||d){i=a.MessageUtil.messageParser(h,this._onReceived,d);if(12==i.conversationType)return a.RongIMClient.RTCListener(i);if(b.getTopic&&\"recallMsg\"==b.getTopic()){var o=i.content;i.conversationType=o.conversationType,i.targetId=o.targetId,i.messageId=null}if(c&&(i.messageUId=c.getMessageUId(),i.sentTime=c.getTimestamp(),a.RongIMClient._storageProvider.setItem(this._client.userId,i.sentTime)),null!==i){if(!(i.conversationType==a.ConversationType.CHATROOM)){a.RongIMClient.MessageParams[i.messageType].msgTag.getMessageTag()>=0&&a.SyncTimeUtil.set(i);if(i.messageDirection==a.MessageDirection.SEND){var p=a.RongIMClient._storageProvider,q=a.Bridge._client.userId,r=p.getItem(\"last_sentTime_\"+q)||0;if(i.sentTime<=r&&!f)return}}if(a.RongIMClient.MessageParams[i.messageType].msgTag.getMessageTag()>0){if(j=a.RongIMClient._dataAccessProvider.getConversation(i.conversationType,i.targetId,{onSuccess:function(){},onError:function(){}}),j||(j=a.RongIMClient.getInstance().createConversation(i.conversationType,i.targetId,\"\")),i.messageDirection==a.MessageDirection.RECEIVE&&64==(64&h.status)){var s=a.RongIMClient._storageProvider.getItem(\"mentioneds_\"+g._client.userId+\"_\"+i.conversationType+\"_\"+i.targetId),t=i.conversationType+\"_\"+i.targetId,u={};if(i.content&&i.content.mentionedInfo&&(u[t]={uid:i.messageUId,time:i.sentTime,mentionedInfo:i.content.mentionedInfo},a.RongIMClient._storageProvider.setItem(\"mentioneds_\"+g._client.userId+\"_\"+i.conversationType+\"_\"+i.targetId,JSON.stringify(u)),s=JSON.stringify(u)),s){var u=JSON.parse(s);j.mentionedMsg=u[t]}}if(i.messageDirection==a.MessageDirection.RECEIVE&&(j.unreadMessageCount=j.unreadMessageCount+1,a.RongUtil.supportLocalStorage())){var v=a.RongIMClient._storageProvider.getItem(\"cu\"+g._client.userId+j.conversationType+j.targetId),w=Number(v)+1;a.RongIMClient._storageProvider.setItem(\"cu\"+g._client.userId+j.conversationType+i.targetId,w),j.unreadMessageCount=w}j.receivedTime=(new Date).getTime(),j.receivedStatus=i.receivedStatus,j.senderUserId=i.sendUserId,j.notificationStatus=a.ConversationNotificationStatus.DO_NOT_DISTURB,j.latestMessageId=i.messageId,j.latestMessage=i,j.sentTime=i.sentTime,a.RongIMClient._dataAccessProvider.addConversation(j,{onSuccess:function(a){},onError:function(){}})}if(i.conversationType!=a.ConversationType.CUSTOMER_SERVICE||\"ChangeModeResponseMessage\"!=i.messageType&&\"SuspendMessage\"!=i.messageType&&\"HandShakeResponseMessage\"!=i.messageType&&\"TerminateMessage\"!=i.messageType&&\"CustomerStatusUpdateMessage\"!=i.messageType&&\"TextMessage\"!=i.messageType&&\"InformationNotificationMessage\"!=i.messageType||a.RongIMClient._memoryStore.custStore.isInit){if(i.conversationType==a.ConversationType.CUSTOMER_SERVICE&&\"HandShakeResponseMessage\"!=i.messageType){if(!a.RongIMClient._memoryStore.custStore[i.targetId])return;if(\"TerminateMessage\"==i.messageType&&a.RongIMClient._memoryStore.custStore[i.targetId].sid!=i.content.sid)return}if(i.messageType===a.RongIMClient.MessageType.HandShakeResponseMessage){var x=i.content.data;a.RongIMClient._memoryStore.custStore[i.targetId]=x,x.serviceType!=a.CustomerType.ONLY_HUMAN&&x.serviceType!=a.CustomerType.HUMAN_FIRST||\"1\"==x.notAutoCha&&a.RongIMClient.getInstance().switchToHumanMode(i.targetId,{onSuccess:function(){},onError:function(){}})}var y=new Date,z=y.getMonth()+1,A=y.getFullYear()+\"/\"+(1==z.toString().length?\"0\"+z:z)+\"/\"+y.getDate(),B=new Date(A).getTime()-i.sentTime<0;if(a.RongUtil.supportLocalStorage()&&i.messageType===a.RongIMClient.MessageType.ReadReceiptRequestMessage&&B&&i.messageDirection==a.MessageDirection.SEND){var C=g._client.userId+i.content.messageUId+\"SENT\";a.RongIMClient._storageProvider.setItem(C,JSON.stringify({count:0,dealtime:i.sentTime,userIds:{}}))}else if(a.RongUtil.supportLocalStorage()&&i.messageType===a.RongIMClient.MessageType.ReadReceiptRequestMessage&&B){var D=g._client.userId+i.conversationType+i.targetId+\"RECEIVED\",E=JSON.parse(a.RongIMClient._storageProvider.getItem(D));if(E)if(i.senderUserId in E){if(!E[i.senderUserId].uIds||!E[i.senderUserId].uIds||-1!=E[i.senderUserId].uIds.indexOf(i.content.messageUId))return;E[i.senderUserId].uIds.push(i.content.messageUId),E[i.senderUserId].dealtime=i.sentTime,E[i.senderUserId].isResponse=!1,a.RongIMClient._storageProvider.setItem(D,JSON.stringify(E))}else{var F={uIds:[i.content.messageUId],dealtime:i.sentTime,isResponse:!1};E[i.senderUserId]=F,a.RongIMClient._storageProvider.setItem(D,JSON.stringify(E))}else{var G={};G[i.senderUserId]={uIds:[i.content.messageUId],dealtime:i.sentTime,isResponse:!1},a.RongIMClient._storageProvider.setItem(D,JSON.stringify(G))}}if(a.RongUtil.supportLocalStorage()&&i.messageType===a.RongIMClient.MessageType.ReadReceiptResponseMessage&&B){var H,I=i.content,J=I.receiptMessageDic[g._client.userId],C=\"\";if(i.receiptResponse||(i.receiptResponse={}),J){for(var K=[],L=0,M=J.length;L<M;L++)C=g._client.userId+J[L]+\"SENT\",!(H=JSON.parse(a.RongIMClient._storageProvider.getItem(C)))||i.senderUserId in H.userIds||(K.push(J[L]),H.count+=1,H.userIds[i.senderUserId]=i.sentTime,i.receiptResponse[J[L]]=H.count,a.RongIMClient._storageProvider.setItem(C,JSON.stringify(H)));I.receiptMessageDic[g._client.userId]=K,i.content=I}}var N=this;if(a.RongIMClient._voipProvider&&[\"AcceptMessage\",\"RingingMessage\",\"HungupMessage\",\"InviteMessage\",\"MediaModifyMessage\",\"MemberModifyMessage\"].indexOf(i.messageType)>-1)setTimeout(function(){a.RongIMClient._voipProvider.onReceived(i)});else{var O=e||0,P=!n;setTimeout(function(){N._onReceived(i,O,P)})}}}}},b.prototype.handleMessage=function(b){if(b)switch(b._name){case\"ConnAckMessage\":g._client.handler.connectCallback.process(b.getStatus(),b.getUserId(),b.getTimestamp());break;case\"PublishMessage\":b.getSyncMsg()||0==b.getQos()||g._client.channel.writeAndFlush(new a.PubAckMessage(b.getMessageId())),b.getSyncMsg()&&!a.RongIMClient._memoryStore.depend.isPolling?g._client.handler.syncMsgMap[b.getMessageId()]=b:g._client.handler.onReceived(b);break;case\"QueryAckMessage\":0!=b.getQos()&&g._client.channel.writeAndFlush(new a.QueryConMessage(b.getMessageId()));var c=g._client.handler.map[b.getMessageId()];c&&(c.Callback.process(b.getStatus(),b.getData(),b.getDate(),c.Message),delete g._client.handler.map[b.getMessageId()]);break;case\"PubAckMessage\":var d=g._client.handler.map[b.getMessageId()];if(d)d.Callback.process(b.getStatus()||0,b.getMessageUId(),b.getTimestamp(),d.Message,b.getMessageId()),delete g._client.handler.map[b.getMessageId()];else{var e=a.Bridge._client.userId;a.RongIMClient._storageProvider.setItem(\"last_sentTime_\"+e,b.timestamp),g._client.handler.onReceived(g._client.handler.syncMsgMap[b.messageId],b,null,null,!0),delete g._client.handler.syncMsgMap[b.getMessageId()]}break;case\"PingRespMessage\":a.RongIMClient._memoryStore.isFirstPingMsg?a.RongIMClient._memoryStore.isFirstPingMsg=!1:g._client.pauseTimer();break;case\"DisconnectMessage\":g._client.channel.disconnect(b.getStatus())}},b}();a.MessageHandler=h}(RongIMLib||(RongIMLib={}));var __extends=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},RongIMLib;!function(a){var b=function(){function b(a){this.timeout=null,this.onError=null,a&&\"number\"==typeof a?this.timeoutMillis=a:(this.timeoutMillis=3e4,this.onError=a)}return b.prototype.resumeTimer=function(){var a=this;this.timeoutMillis>0&&!this.timeout&&(this.timeout=setTimeout(function(){a.readTimeOut(!0)},this.timeoutMillis))},b.prototype.pauseTimer=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},b.prototype.readTimeOut=function(b){b&&this.onError?this.onError(a.ErrorCode.TIMEOUT):this.pauseTimer()},b}();a.MessageCallback=b;var c=function(){function b(){this.publicServiceList=[]}return b.getInstance=function(){return new b},b.prototype.pottingProfile=function(b){var c;this.profile=new a.PublicServiceProfile,c=JSON.parse(b.extra),this.profile.isGlobal=c.isGlobal,this.profile.introduction=c.introduction,this.profile.menu=c.menu,this.profile.hasFollowed=c.follow,this.profile.publicServiceId=b.mpid,this.profile.name=b.name,this.profile.portraitUri=b.portraitUrl,this.profile.conversationType=\"mc\"==b.type?a.ConversationType.APP_PUBLIC_SERVICE:a.ConversationType.PUBLIC_SERVICE,this.publicServiceList.push(this.profile)},b.prototype.mapping=function(b,c){switch(c){case\"GetUserInfoOutput\":return new a.UserInfo(b.userId,b.userName,b.userPortrait);case\"GetQNupTokenOutput\":return{deadline:a.MessageUtil.int64ToTimestamp(b.deadline),token:b.token};case\"GetQNdownloadUrlOutput\":return{downloadUrl:b.downloadUrl};case\"CreateDiscussionOutput\":return b.id;case\"ChannelInfoOutput\":var d=new a.Discussion;return d.creatorId=b.adminUserId,d.id=b.channelId,d.memberIdList=b.firstTenUserIds,d.name=b.channelName,d.isOpen=b.openStatus,d;case\"GroupHashOutput\":return b.result;case\"QueryBlackListOutput\":return b.userIds;case\"SearchMpOutput\":case\"PullMpOutput\":if(b.info){var e=this;Array.forEach(b.info,function(a){setTimeout(function(){e.pottingProfile(a)},100)})}return this.publicServiceList;default:return b}},b}();a.CallbackMapping=c;var d=function(c){function d(a,b){c.call(this,b),this._cb=a,this._timeout=b}return __extends(d,c),d.prototype.process=function(b,c,d,e,f){if(this.readTimeOut(),0==b){e&&(e.setSentStatus=b);if(a.RongIMClient._memoryStore.isPullFinished){var g=a.Bridge._client.userId;a.RongIMClient._storageProvider.setItem(\"last_sentTime_\"+g,d),a.SyncTimeUtil.set({messageDirection:a.MessageDirection.SEND,sentTime:d})}this._cb({messageUId:c,timestamp:d,messageId:f})}else this._timeout(b,{messageUId:c,sentTime:d})},d.prototype.readTimeOut=function(a){b.prototype.readTimeOut.call(this,a)},d}(b);a.PublishCallback=d;var e=function(d){function e(a,b){d.call(this,b),this._cb=a,this._timeout=b}return __extends(e,d),e.prototype.process=function(b,d,e,f){if(this.readTimeOut(),f&&d&&0==b){try{d=c.getInstance().mapping(a.RongIMClient.Protobuf[f].decode(d),f)}catch(g){return void this._timeout(a.ErrorCode.UNKNOWN)}\"GetUserInfoOutput\"==f&&(a.Client.userInfoMapping[d.userId]=d),this._cb(d)}else b>0?this._timeout(b):this._cb(b)},e.prototype.readTimeOut=function(a){b.prototype.readTimeOut.call(this,a)},e}(b);a.QueryCallback=e;var f=function(c){function d(a,b,d){c.call(this,b),this._client=d,this._cb=a,this._timeout=b}return __extends(d,c),d.prototype.process=function(b,c,d){if(this.readTimeOut(),0==b){this._client.userId=c;var e=this;if(!a.RongIMClient._memoryStore.depend.isPolling&&a.RongIMClient._memoryStore.isFirstPingMsg?a.Bridge._client.checkSocket({onSuccess:function(){a.RongIMClient.isNotPullMsg||e._client.syncTime(void 0,void 0,void 0,!0)},onError:function(){a.RongIMClient._memoryStore.isFirstPingMsg=!1,a.RongIMClient.getInstance().disconnect(),a.RongIMClient.connect(a.RongIMClient._memoryStore.token,a.RongIMClient._memoryStore.callback)}}):a.RongIMClient.isNotPullMsg||e._client.syncTime(void 0,void 0,void 0,!0),a.Bridge._client.channel.socket.fire(\"StatusChanged\",0),this._client.reconnectObj.onSuccess)this._client.reconnectObj.onSuccess(c),delete this._client.reconnectObj.onSuccess;else{var f=this;setTimeout(function(){f._cb(c)},500)}a.RongIMClient._memoryStore.connectAckTime=d,(new Date).getTime()-d?a.RongIMClient._memoryStore.deltaTime=(new Date).getTime()-d:a.RongIMClient._memoryStore.deltaTime=0}else if(6==b){a.RongIMClient.getInstance().disconnect();var f=this,g=f._client,h=g.appId,i=g.token;(new a.Navigation).getServerEndpoint(i,h,function(){g.clearHeartbeat();var b=new a.Client(i,h);a.Bridge._client=b,b.__init(function(){\"websocket\"==a.Transportations._TransportType&&g.keepLive()})},f._timeout,!1)}else a.Bridge._client.channel.socket.socket._status=b,this._client.reconnectObj.onError?(this._client.reconnectObj.onError(b),delete this._client.reconnectObj.onError):this._timeout(b)},d.prototype.readTimeOut=function(a){b.prototype.readTimeOut.call(this,a)},d}(b);a.ConnectAck=f}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(){window.getServerEndpoint=function(b){var c=a.RongIMClient._storageProvider;c.setItem(\"fullnavi\",JSON.stringify(b));var d=b.server;d&&(d+=\",\");var e=b.backupServer||\"\",f=\"{server}{backupServer}\",g=a.RongUtil.tplEngine(f,{server:d,backupServer:e});g=g.split(\",\"),c.setItem(\"servers\",JSON.stringify(g));var h=a.RongIMClient._memoryStore.token,i=a.InnerUtil.getUId(h);c.setItem(\"rc_uid\",i);var j=b.userId;if(c.setItem(\"current_user\",j),b.voipCallInfo){\nvar k=JSON.parse(b.voipCallInfo);a.RongIMClient._memoryStore.voipStategy=k.strategy,c.setItem(\"voipStrategy\",k.strategy)}var l=b.openMp;c.setItem(\"openMp\"+i,l),a.RongIMClient._memoryStore.depend.openMp=l,a.Channel._ConnectionStatusListener.onChanged(a.ConnectionStatus.RESPONSE_NAVI)}}return b.clear=function(){var b=a.RongIMClient._storageProvider;b.removeItem(\"rc_uid\"),b.removeItem(\"serverIndex\"),b.removeItem(\"rongSDK\")},b.prototype.connect=function(b,c,d){var e=a.RongIMClient._storageProvider.getItem(\"appId\");e&&e!=b&&(a.RongIMClient._storageProvider.clearItem(),a.RongIMClient._storageProvider.setItem(\"appId\",b)),e||a.RongIMClient._storageProvider.setItem(\"appId\",b);var f=new a.Client(c,b);return this.getServerEndpoint(c,b,function(){f.connect(d)},d.onError,!0),f},b.prototype.getServerEndpoint=function(c,d,e,f,g){if(g){var h=md5(c).slice(8,16),i=a.RongIMClient._storageProvider,j=i.getItem(\"rongSDK\"),k=a.Transportations._TransportType==j,l=i.getItem(\"rc_uid\"),m=l==h,n=i.getItem(\"servers\"),o=\"string\"==typeof n;if(m&&k&&o){a.RongIMClient._memoryStore.voipStategy=i.getItem(\"voipStrategy\");var p=i.getItem(\"openMp\"+h);return a.RongIMClient._memoryStore.depend.openMp=p,void e()}}b.clear(),a.Channel._ConnectionStatusListener.onChanged(a.ConnectionStatus.REQUEST_NAVI);var q=document.createElement(\"script\"),r=a.RongIMClient._memoryStore.depend,s=r.navi,t=r.isPolling?\"cometnavi\":\"navi\";c=encodeURIComponent(c);var u=a.RongIMClient.sdkver,v=a.RongUtil.getTimestamp(),w=\"{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}\",x=a.RongUtil.tplEngine(w,{domain:s,path:t,appId:d,token:c,sdkver:u,random:v});q.src=x,document.body.appendChild(q),q.onerror=function(){f(a.ConnectionState.TOKEN_INCORRECT)},\"onload\"in q?q.onload=e:q.onreadystatechange=function(){\"loaded\"==q.readyState&&e()}},b.Endpoint=new Object,b}();a.Navigation=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(b){this._name=\"BaseMessage\",this.lengthSize=0,b instanceof a.Header?this._header=b:this._header=new a.Header(b,!1,a.Qos.AT_MOST_ONCE,!1)}return b.prototype.read=function(a,b){this.readMessage(a,b)},b.prototype.write=function(b){var c=new a.BinaryHelper,d=c.convertStream(b);return this._headerCode=this.getHeaderFlag(),d.write(this._headerCode),this.writeMessage(d),d},b.prototype.getHeaderFlag=function(){return this._header.encode()},b.prototype.getLengthSize=function(){return this.lengthSize},b.prototype.toBytes=function(){return this.write([]).getBytesArray()},b.prototype.isRetained=function(){return this._header.retain},b.prototype.setRetained=function(a){this._header.retain=a},b.prototype.setQos=function(b){this._header.qos=\"[object Object]\"==Object.prototype.toString.call(b)?b:a.Qos[b]},b.prototype.setDup=function(a){this._header.dup=a},b.prototype.isDup=function(){return this._header.dup},b.prototype.getType=function(){return this._header.type},b.prototype.getQos=function(){return this._header.qos},b.prototype.messageLength=function(){return 0},b.prototype.writeMessage=function(a){},b.prototype.readMessage=function(a,b){},b.prototype.init=function(a){var b,c,d=this;for(c in a)a.hasOwnProperty(c)&&(b=c.replace(/^\\w/,function(a){var b=a.charCodeAt(0);return\"set\"+(b>=97?String.fromCharCode(-33&b):a)}))in d&&(\"status\"==c?d[b](disconnectStatus[a[c]]?disconnectStatus[a[c]]:a[c]):d[b](a[c]))},b}();a.BaseMessage=b;var c=function(b){function c(c){switch(b.call(this,0==arguments.length||3==arguments.length?a.Type.CONNECT:arguments[0]),this._name=\"ConnectMessage\",this.CONNECT_HEADER_SIZE=12,this.protocolId=\"RCloud\",this.binaryHelper=new a.BinaryHelper,this.protocolVersion=3,arguments.length){case 0:case 1:case 3:if(!arguments[0]||arguments[0].length>64)throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \"+arguments[0]);this.clientId=arguments[0],this.cleanSession=arguments[1],this.keepAlive=arguments[2]}}return __extends(c,b),c.prototype.messageLength=function(){var a=this.binaryHelper.toMQttString(this.clientId).length;return a+=this.binaryHelper.toMQttString(this.willTopic).length,a+=this.binaryHelper.toMQttString(this.will).length,a+=this.binaryHelper.toMQttString(this.appId).length,(a+=this.binaryHelper.toMQttString(this.token).length)+this.CONNECT_HEADER_SIZE},c.prototype.readMessage=function(a){this.protocolId=a.readUTF(),this.protocolVersion=a.readByte();var b=a.readByte();if(this.hasAppId=(128&b)>0,this.hasToken=(64&b)>0,this.retainWill=(32&b)>0,this.willQos=b>>3&3,this.hasWill=(4&b)>0,this.cleanSession=(32&b)>0,this.keepAlive=256*a.read()+a.read(),this.clientId=a.readUTF(),this.hasWill&&(this.willTopic=a.readUTF(),this.will=a.readUTF()),this.hasAppId)try{this.appId=a.readUTF()}catch(c){throw new Error(c)}if(this.hasToken)try{this.token=a.readUTF()}catch(c){throw new Error(c)}return a},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a);b.writeUTF(this.protocolId),b.write(this.protocolVersion);var c=this.cleanSession?2:0;return c|=this.hasWill?4:0,c|=this.willQos?this.willQos>>3:0,c|=this.retainWill?32:0,c|=this.hasToken?64:0,c|=this.hasAppId?128:0,b.write(c),b.writeChar(this.keepAlive),b.writeUTF(this.clientId),this.hasWill&&(b.writeUTF(this.willTopic),b.writeUTF(this.will)),this.hasAppId&&b.writeUTF(this.appId),this.hasToken&&b.writeUTF(this.token),b},c}(b);a.ConnectMessage=c;var d=function(b){function c(c){b.call(this,0==arguments.length?a.Type.CONNACK:1==arguments.length?arguments[0]instanceof a.Header?arguments[0]:a.Type.CONNACK:null),this._name=\"ConnAckMessage\",this.MESSAGE_LENGTH=2,this.binaryHelper=new a.BinaryHelper;var d=this;switch(arguments.length){case 0:case 1:if(!(arguments[0]instanceof a.Header)&&arguments[0]in a.ConnectionState){if(null==arguments[0])throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");d.setStatus(arguments[0])}}}return __extends(c,b),c.prototype.messageLength=function(){var a=this.MESSAGE_LENGTH;return this.userId&&(a+=this.binaryHelper.toMQttString(this.userId).length),a},c.prototype.readMessage=function(a,b){a.read();var c=+a.read();if(!(c>=0&&c<=12))throw new Error(\"Unsupported CONNACK code:\"+c);if(this.setStatus(c),b>this.MESSAGE_LENGTH){this.setUserId(a.readUTF());var d=(a.readUTF(),a.readLong());this.setTimestamp(d)}},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a);switch(b.write(128),+status){case 0:case 1:case 2:case 5:case 6:b.write(+status);break;case 3:case 4:b.write(3);break;default:throw new Error(\"Unsupported CONNACK code:\"+status)}return this.userId&&b.writeUTF(this.userId),b},c.prototype.setStatus=function(a){this.status=a},c.prototype.setUserId=function(a){this.userId=a},c.prototype.getStatus=function(){return this.status},c.prototype.getUserId=function(){return this.userId},c.prototype.setTimestamp=function(a){this.timestrap=a},c.prototype.getTimestamp=function(){return this.timestrap},c}(b);a.ConnAckMessage=d;var e=function(b){function c(c){b.call(this,c instanceof a.Header?c:a.Type.DISCONNECT),this._name=\"DisconnectMessage\",this.MESSAGE_LENGTH=2,this.binaryHelper=new a.BinaryHelper,c instanceof a.Header||c in a.ConnectionStatus&&(this.status=c)}return __extends(c,b),c.prototype.messageLength=function(){return this.MESSAGE_LENGTH},c.prototype.readMessage=function(a){a.read();var b=+a.read();if(!(b>=0&&b<=5))throw new Error(\"Unsupported CONNACK code:\"+b);this.setStatus(disconnectStatus[b]?disconnectStatus[b]:b)},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a);if(b.write(0),!(+status>=1&&+status<=3))throw new Error(\"Unsupported CONNACK code:\"+status);b.write(+status-1)},c.prototype.setStatus=function(a){this.status=a},c.prototype.getStatus=function(){return this.status},c}(b);a.DisconnectMessage=e;var f=function(b){function c(c){b.call(this,c&&c instanceof a.Header?c:a.Type.PINGREQ),this._name=\"PingReqMessage\"}return __extends(c,b),c}(b);a.PingReqMessage=f;var g=function(b){function c(c){b.call(this,c&&c instanceof a.Header?c:a.Type.PINGRESP),this._name=\"PingRespMessage\"}return __extends(c,b),c}(b);a.PingRespMessage=g;var h=function(b){function c(c){b.call(this,c),this._name=\"RetryableMessage\",this.binaryHelper=new a.BinaryHelper}return __extends(c,b),c.prototype.messageLength=function(){return 2},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a),c=this.getMessageId(),d=255&c,e=(65280&c)>>8;return b.write(e),b.write(d),b},c.prototype.readMessage=function(a,b){var c=256*a.read()+a.read();this.setMessageId(parseInt(c,10))},c.prototype.setMessageId=function(a){this.messageId=a},c.prototype.getMessageId=function(){return this.messageId},c}(b);a.RetryableMessage=h;var i=function(b){function c(c){b.call(this,c instanceof a.Header?c:a.Type.PUBACK),this.msgLen=2,this.date=0,this.millisecond=0,this.timestamp=0,this.binaryHelper=new a.BinaryHelper,this._name=\"PubAckMessage\",c instanceof a.Header||b.prototype.setMessageId.call(this,c)}return __extends(c,b),c.prototype.messageLength=function(){return this.msgLen},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a);h.prototype.writeMessage.call(this,b)},c.prototype.readMessage=function(a,b){h.prototype.readMessage.call(this,a),this.date=a.readInt(),this.status=256*a.read()+a.read(),this.millisecond=256*a.read()+a.read(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=a.readUTF()},c.prototype.setStatus=function(a){this.status=a},c.prototype.setTimestamp=function(a){this.timestamp=a},c.prototype.setMessageUId=function(a){this.messageUId=a},c.prototype.getStatus=function(){return this.status},c.prototype.getDate=function(){return this.date},c.prototype.getTimestamp=function(){return this.timestamp},c.prototype.getMessageUId=function(){return this.messageUId},c}(h);a.PubAckMessage=i;var j=function(b){function c(c,d,e){b.call(this,1==arguments.length&&c instanceof a.Header?c:3==arguments.length?a.Type.PUBLISH:0),this._name=\"PublishMessage\",this.binaryHelper=new a.BinaryHelper,this.syncMsg=!1,3==arguments.length&&(this.topic=c,this.targetId=e,this.data=\"string\"==typeof d?this.binaryHelper.toMQttString(d):d)}return __extends(c,b),c.prototype.messageLength=function(){var a=10;return a+=this.binaryHelper.toMQttString(this.topic).length,a+=this.binaryHelper.toMQttString(this.targetId).length,a+=this.data.length},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a);b.writeUTF(this.topic),b.writeUTF(this.targetId),h.prototype.writeMessage.apply(this,arguments),b.write(this.data)},c.prototype.readMessage=function(a,b){var c=6;this.date=a.readInt(),this.topic=a.readUTF(),c+=this.binaryHelper.toMQttString(this.topic).length,this.targetId=a.readUTF(),c+=this.binaryHelper.toMQttString(this.targetId).length,h.prototype.readMessage.apply(this,arguments),this.data=new Array(b-c),this.data=a.read(this.data)},c.prototype.setTopic=function(a){this.topic=a},c.prototype.setData=function(a){this.data=a},c.prototype.setTargetId=function(a){this.targetId=a},c.prototype.setDate=function(a){this.date=a},c.prototype.setSyncMsg=function(a){this.syncMsg=a},c.prototype.getSyncMsg=function(){return this.syncMsg},c.prototype.getTopic=function(){return this.topic},c.prototype.getData=function(){return this.data},c.prototype.getTargetId=function(){return this.targetId},c.prototype.getDate=function(){return this.date},c}(h);a.PublishMessage=j;var k=function(b){function c(c,d,e){b.call(this,c instanceof a.Header?c:3==arguments.length?a.Type.QUERY:null),this.binaryHelper=new a.BinaryHelper,this._name=\"QueryMessage\",3==arguments.length&&(this.data=\"string\"==typeof d?this.binaryHelper.toMQttString(d):d,this.topic=c,this.targetId=e)}return __extends(c,b),c.prototype.messageLength=function(){var a=0;return a+=this.binaryHelper.toMQttString(this.topic).length,a+=this.binaryHelper.toMQttString(this.targetId).length,a+=2,a+=this.data.length},c.prototype.writeMessage=function(a){var b=this.binaryHelper.convertStream(a);b.writeUTF(this.topic),b.writeUTF(this.targetId),h.prototype.writeMessage.call(this,b),b.write(this.data)},c.prototype.readMessage=function(a,b){var c=0;this.topic=a.readUTF(),this.targetId=a.readUTF(),c+=this.binaryHelper.toMQttString(this.topic).length,c+=this.binaryHelper.toMQttString(this.targetId).length,this.readMessage.apply(this,arguments),c+=2,this.data=new Array(b-c),a.read(this.data)},c.prototype.setTopic=function(a){this.topic=a},c.prototype.setData=function(a){this.data=a},c.prototype.setTargetId=function(a){this.targetId=a},c.prototype.getTopic=function(){return this.topic},c.prototype.getData=function(){return this.data},c.prototype.getTargetId=function(){return this.targetId},c}(h);a.QueryMessage=k;var l=function(b){function c(c){b.call(this,c instanceof a.Header?c:a.Type.QUERYCON),this._name=\"QueryConMessage\",c instanceof a.Header||b.prototype.setMessageId.call(this,c)}return __extends(c,b),c}(h);a.QueryConMessage=l;var m=function(b){function c(c){b.call(this,c),this._name=\"QueryAckMessage\",this.binaryHelper=new a.BinaryHelper}return __extends(c,b),c.prototype.readMessage=function(a,b){h.prototype.readMessage.call(this,a),this.date=a.readInt(),this.setStatus(256*a.read()+a.read()),b>0&&(this.data=new Array(b-8),this.data=a.read(this.data))},c.prototype.getData=function(){return this.data},c.prototype.getStatus=function(){return this.status},c.prototype.getDate=function(){return this.date},c.prototype.setDate=function(a){this.date=a},c.prototype.setStatus=function(a){this.status=a},c.prototype.setData=function(a){this.data=a},c}(h);a.QueryAckMessage=m}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(b){var c=new a.BinaryHelper;this.out=c.convertStream(b)}return b.prototype.writeMessage=function(b){b instanceof a.BaseMessage&&b.write(this.out)},b}();a.MessageOutputStream=b;var c=function(){function b(b,c){if(c)this.flags=b.headerCode;else{var d=(new a.BinaryHelper).convertStream(b);this.flags=d.readByte(),this._in=d}this.header=new a.Header(this.flags),this.isPolling=c,this.In=b}return b.prototype.readMessage=function(){switch(this.header.getType()){case 1:this.msg=new a.ConnectMessage(this.header);break;case 2:this.msg=new a.ConnAckMessage(this.header);break;case 3:this.msg=new a.PublishMessage(this.header),this.msg.setSyncMsg(this.header.getSyncMsg());break;case 4:this.msg=new a.PubAckMessage(this.header);break;case 5:this.msg=new a.QueryMessage(this.header);break;case 6:this.msg=new a.QueryAckMessage(this.header);break;case 7:this.msg=new a.QueryConMessage(this.header);break;case 9:case 11:case 13:this.msg=new a.PingRespMessage(this.header);break;case 8:case 10:case 12:this.msg=new a.PingReqMessage(this.header);break;case 14:this.msg=new a.DisconnectMessage(this.header);break;default:throw new Error(\"No support for deserializing \"+this.header.getType()+\" messages\")}return this.isPolling?this.msg.init(this.In):this.msg.read(this._in,this.In.length-1),this.msg},b}();a.MessageInputStream=c;var d=function(){function b(b,c,d,e){this.retain=!1,this.qos=a.Qos.AT_LEAST_ONCE,this.dup=!1,this.syncMsg=!1,b&&+b==b&&1==arguments.length?(this.retain=(1&b)>0,this.qos=(6&b)>>1,this.dup=(8&b)>0,this.type=b>>4&15,this.syncMsg=8==(8&b)):(this.type=b,this.retain=c,this.qos=d,this.dup=e)}return b.prototype.getSyncMsg=function(){return this.syncMsg},b.prototype.getType=function(){return this.type},b.prototype.encode=function(){var b=this;switch(this.qos){case a.Qos[0]:b.qos=a.Qos.AT_MOST_ONCE;break;case a.Qos[1]:b.qos=a.Qos.AT_LEAST_ONCE;break;case a.Qos[2]:b.qos=a.Qos.EXACTLY_ONCE;break;case a.Qos[3]:b.qos=a.Qos.DEFAULT}var c=this.type<<4;return c|=this.retain?1:0,c|=this.qos<<1,c|=this.dup?8:0},b.prototype.toString=function(){return\"Header [type=\"+this.type+\",retain=\"+this.retain+\",qos=\"+this.qos+\",dup=\"+this.dup+\"]\"},b}();a.Header=d;var e=function(){function a(){}return a.prototype.writeUTF=function(a,b){for(var c=[],d=0,e=0,f=a.length;e<f;e++){var g=a.charCodeAt(e);g>=0&&g<=127?(d+=1,c.push(g)):g>=128&&g<=2047?(d+=2,c.push(192|31&g>>6),c.push(128|63&g)):g>=2048&&g<=65535&&(d+=3,c.push(224|15&g>>12),c.push(128|63&g>>6),c.push(128|63&g))}for(var e=0,f=c.length;e<f;e++)c[e]>255&&(c[e]&=255);return b?c:d<=255?[0,d].concat(c):[d>>8,255&d].concat(c)},a.prototype.readUTF=function(a){if(\"[object String]\"==Object.prototype.toString.call(a))return a;for(var b=\"\",c=a,d=0,e=c.length;d<e;d++){c[d]<0&&(c[d]+=256);var f=c[d].toString(2),g=f.match(/^1+?(?=0)/);if(g&&8==f.length){for(var h=g[0].length,i=\"\",j=0;j<h;j++)i+=c[j+d].toString(2).slice(2);b+=String.fromCharCode(parseInt(i,2)),d+=h-1}else b+=String.fromCharCode(c[d])}return b},a.prototype.convertStream=function(a){return a instanceof f?a:new f(a)},a.prototype.toMQttString=function(a){return this.writeUTF(a)},a}();a.BinaryHelper=e;var f=function(){function a(a){this.position=0,this.writen=0,this.poolLen=0,this.binaryHelper=new e,this.pool=a,this.poolLen=a.length}return a.prototype.check=function(){return this.position>=this.pool.length},a.prototype.readInt=function(){if(this.check())return-1;for(var a=\"\",b=0;b<4;b++){var c=this.pool[this.position++].toString(16);1==c.length&&(c=\"0\"+c),a+=c.toString(16)}return parseInt(a,16)},a.prototype.readLong=function(){if(this.check())return-1;for(var a=\"\",b=0;b<8;b++){var c=this.pool[this.position++].toString(16);1==c.length&&(c=\"0\"+c),a+=c}return parseInt(a,16)},a.prototype.readTimestamp=function(){if(this.check())return-1;for(var a=\"\",b=0;b<8;b++)a+=this.pool[this.position++].toString(16);return a=a.substring(2,8),parseInt(a,16)},a.prototype.readUTF=function(){if(this.check())return-1;var a=this.readByte()<<8|this.readByte();return this.binaryHelper.readUTF(this.pool.subarray(this.position,this.position+=a))},a.prototype.readByte=function(){if(this.check())return-1;var a=this.pool[this.position++];return a>255&&(a&=255),a},a.prototype.read=function(a){return a?this.pool.subarray(this.position,this.poolLen):this.readByte()},a.prototype.write=function(a){var b=a;return\"[object array]\"==Object.prototype.toString.call(b).toLowerCase()?[].push.apply(this.pool,b):+b==b&&(b>255&&(b&=255),this.pool.push(b),this.writen++),b},a.prototype.writeChar=function(a){if(+a!=a)throw new Error(\"writeChar:arguments type is error\");this.write(a>>8&255),this.write(255&a),this.writen+=2},a.prototype.writeUTF=function(a){var b=this.binaryHelper.writeUTF(a);[].push.apply(this.pool,b),this.writen+=b.length},a.prototype.toComplements=function(){for(var a=this.pool,b=0;b<this.poolLen;b++)a[b]>128&&(a[b]-=256);return a},a.prototype.getBytesArray=function(a){return a?this.toComplements():this.pool},a}();a.RongIMStream=f}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(a){return this.connected=!1,this.isClose=!1,this.queue=[],this.empty=new Function,this._socket=a,this}return b.prototype.createTransport=function(b,c){if(!b)throw new Error(\"URL can't be empty\");this.url=b;var d=a.RongIMClient._memoryStore.depend,e=d.wsScheme;return b=a.RongUtil.tplEngine(\"{wsScheme}{url}\",{wsScheme:e,url:b}),this.socket=new WebSocket(b),this.socket.binaryType=\"arraybuffer\",this.addEvent(),this.socket},b.prototype.send=function(b){if(!this.connected&&!this.isClose)return void this.queue.push(b);if(this.isClose)return void this._socket.fire(\"StatusChanged\",a.ConnectionStatus.CONNECTION_CLOSED);var c=new a.RongIMStream([]);new a.MessageOutputStream(c).writeMessage(b);var d=c.getBytesArray(!0),e=new Int8Array(d);return this.socket.send(e.buffer),this},b.prototype.onData=function(b){return a.MessageUtil.isArray(b)?this._socket.onMessage(new a.MessageInputStream(b).readMessage()):this._socket.onMessage(new a.MessageInputStream(a.MessageUtil.ArrayFormInput(b)).readMessage()),\"\"},b.prototype.onClose=function(b){var c=this;c.isClose=!0,c.socket=this.empty,a.Bridge._client.clearHeartbeat(),1006!=b.code||this._status?c._status=0:c._socket.fire(\"StatusChanged\",a.ConnectionStatus.NETWORK_UNAVAILABLE)},b.prototype.onError=function(a){throw new Error(a)},b.prototype.addEvent=function(){var a=this;a.socket.onopen=function(){a.connected=!0,a.isClose=!1,a.doQueue(),a._socket.fire(\"connect\")},a.socket.onmessage=function(b){\"string\"==typeof b.data?a.onData(b.data.split(\",\")):a.onData(b.data)},a.socket.onerror=function(b){a.onError(b)},a.socket.onclose=function(b){a.onClose(b)}},b.prototype.doQueue=function(){for(var a=this,b=0,c=a.queue.length;b<c;b++)a.send(a.queue[b])},b.prototype.disconnect=function(a){var b=this;b.socket.readyState&&(b.isClose=!0,a&&(b._status=a),b.socket.close())},b.prototype.reconnect=function(){this.disconnect(),this.createTransport(this.url)},b.prototype.close=function(){this.socket.close()},b}();a.SocketTransportation=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(a){return this.empty=new Function,this.connected=!1,this.pid=+new Date+Math.random()+\"\",this.queue=[],this.socket=a,this}return b.prototype.createTransport=function(b,c){if(!b)throw new Error(\"Url is empty,Please check it!\");this.url=b;var d=a.RongIMClient._storageProvider.getItem(\"sId\"+a.Navigation.Endpoint.userId),e=this;return d?(setTimeout(function(){e.onSuccess('{\"status\":0,\"userId\":\"'+a.Navigation.Endpoint.userId+'\",\"headerCode\":32,\"messageId\":0,\"sessionid\":\"'+d+'\"}'),e.connected=!0},500),this):(this.getRequest(b,!0),this)},b.prototype.requestFactory=function(b,c,d){var e=this.XmlHttpRequest();return d&&(e.multipart=!0),e.timeout=6e4,e.open(c||\"GET\",a.RongIMClient._memoryStore.depend.protocol+b),\"POST\"==c&&\"setRequestHeader\"in e&&e.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded; charset=utf-8\"),e},b.prototype.getRequest=function(a,b){var c=this;c.xhr=this.requestFactory(a+\"&pid=\"+encodeURIComponent(c.pid),\"GET\"),\"onload\"in c.xhr?(c.xhr.onload=function(){c.xhr.onload=c.empty,\"lost params\"==this.responseText?c.onError():c.onSuccess(this.responseText,b)},c.xhr.onerror=function(){c.disconnect()}):c.xhr.onreadystatechange=function(){4==c.xhr.readyState&&(c.xhr.onreadystatechange=c.empty,/^(200|202)$/.test(c.xhr.status)?c.onSuccess(c.xhr.responseText,b):/^(400|403)$/.test(c.xhr.status)?c.onError():c.disconnect())},c.xhr.send()},b.prototype.send=function(b){var c=this,d=c.sendxhr=this.requestFactory(a.Navigation.Endpoint.host+\"/websocket\"+b.url+\"&pid=\"+encodeURIComponent(c.pid),\"POST\");\"onload\"in d?(d.onload=function(){d.onload=c.empty,c.onData(d.responseText)},d.onerror=function(){d.onerror=c.empty}):d.onreadystatechange=function(){4==d.readyState&&(this.onreadystatechange=this.empty,/^(202|200)$/.test(d.status)&&c.onData(d.responseText))},d.send(JSON.stringify(b.data))},b.prototype.onData=function(b,c){if(b&&\"lost params\"!=b){var d=this,e=JSON.parse(b);return e.userId&&(a.Navigation.Endpoint.userId=e.userId),c&&a.RongIMClient._storageProvider.setItem(\"sId\"+a.Navigation.Endpoint.userId,c),a.MessageUtil.isArray(e)||(e=[e]),Array.forEach(e,function(b){d.socket.fire(\"message\",new a.MessageInputStream(b,!0).readMessage())}),\"\"}},b.prototype.XmlHttpRequest=function(){var a=\"undefined\"!=typeof XMLHttpRequest&&\"withCredentials\"in new XMLHttpRequest;return\"undefined\"!=typeof XMLHttpRequest&&a?new XMLHttpRequest:\"undefined\"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject(\"Microsoft.XMLHTTP\")},b.prototype.onClose=function(){this.xhr&&(this.xhr.onload?this.xhr.onreadystatechange=this.xhr.onload=this.empty:this.xhr.onreadystatechange=this.empty,this.xhr.abort(),this.xhr=null),this.sendxhr&&(this.sendxhr.onload?this.sendxhr.onreadystatechange=this.sendxhr.onload=this.empty:this.sendxhr.onreadystatechange=this.empty,this.sendxhr.abort(),this.sendxhr=null)},b.prototype.disconnect=function(){a.RongIMClient._storageProvider.removeItem(\"sId\"+a.Navigation.Endpoint.userId),a.RongIMClient._storageProvider.removeItem(a.Navigation.Endpoint.userId+\"msgId\"),this.onClose()},b.prototype.reconnect=function(){this.disconnect(),this.createTransport(this.url)},b.prototype.onSuccess=function(b,c){var d=b.match(/\"sessionid\":\"\\S+?(?=\")/);if(this.onData(b,d?d[0].slice(13):0),/\"headerCode\":-32,/.test(b))return a.RongIMClient._storageProvider.removeItem(\"sId\"+a.Navigation.Endpoint.userId),void a.RongIMClient._storageProvider.removeItem(a.Navigation.Endpoint.userId+\"msgId\");this.getRequest(a.Navigation.Endpoint.host+\"/pullmsg.js?sessionid=\"+a.RongIMClient._storageProvider.getItem(\"sId\"+a.Navigation.Endpoint.userId)+\"&timestrap=\"+encodeURIComponent((new Date).getTime()+Math.random()+\"\")),this.connected=!0,c&&this.socket.fire(\"connect\")},b.prototype.onError=function(){a.RongIMClient._storageProvider.removeItem(\"sId\"+a.Navigation.Endpoint.userId),a.RongIMClient._storageProvider.removeItem(a.Navigation.Endpoint.userId+\"msgId\"),this.onClose(),this.connected=!1,this.socket.fire(\"disconnect\")},b.prototype.close=function(){this.xhr.abort(),this.sendxhr=null},b}();a.PollingTransportation=b}(RongIMLib||(RongIMLib={}));var typeMapping={\"RC:TxtMsg\":\"TextMessage\",\"RC:ImgMsg\":\"ImageMessage\",\"RC:VcMsg\":\"VoiceMessage\",\"RC:ImgTextMsg\":\"RichContentMessage\",\"RC:FileMsg\":\"FileMessage\",\"RC:LBSMsg\":\"LocationMessage\",\"RC:InfoNtf\":\"InformationNotificationMessage\",\"RC:ContactNtf\":\"ContactNotificationMessage\",\"RC:ProfileNtf\":\"ProfileNotificationMessage\",\"RC:CmdNtf\":\"CommandNotificationMessage\",\"RC:DizNtf\":\"DiscussionNotificationMessage\",\"RC:CmdMsg\":\"CommandMessage\",\"RC:TypSts\":\"TypingStatusMessage\",\"RC:CsChaR\":\"ChangeModeResponseMessage\",\"RC:CsHsR\":\"HandShakeResponseMessage\",\"RC:CsEnd\":\"TerminateMessage\",\"RC:CsSp\":\"SuspendMessage\",\"RC:CsUpdate\":\"CustomerStatusUpdateMessage\",\"RC:ReadNtf\":\"ReadReceiptMessage\",\"RC:VCAccept\":\"AcceptMessage\",\"RC:VCRinging\":\"RingingMessage\",\"RC:VCSummary\":\"SummaryMessage\",\"RC:VCHangup\":\"HungupMessage\",\"RC:VCInvite\":\"InviteMessage\",\"RC:VCModifyMedia\":\"MediaModifyMessage\",\"RC:VCModifyMem\":\"MemberModifyMessage\",\"RC:CsContact\":\"CustomerContact\",\"RC:PSImgTxtMsg\":\"PublicServiceRichContentMessage\",\"RC:PSMultiImgTxtMsg\":\"PublicServiceMultiRichContentMessage\",\"RC:GrpNtf\":\"GroupNotificationMessage\",\"RC:PSCmd\":\"PublicServiceCommandMessage\",\"RC:RcCmd\":\"RecallCommandMessage\",\"RC:SRSMsg\":\"SyncReadStatusMessage\",\"RC:RRReqMsg\":\"ReadReceiptRequestMessage\",\"RC:RRRspMsg\":\"ReadReceiptResponseMessage\",\"RCJrmf:RpMsg\":\"JrmfRedPacketMessage\",\"RCJrmf:RpOpendMsg\":\"JrmfRedPacketOpenedMessage\"},registerMessageTypeMapping={},HistoryMsgType={4:\"qryCMsg\",2:\"qryDMsg\",3:\"qryGMsg\",1:\"qryPMsg\",6:\"qrySMsg\",7:\"qryPMsg\",8:\"qryPMsg\",5:\"qryCMsg\"},disconnectStatus={1:6},RongIMLib;!function(RongIMLib){var Transportations=function(){function a(){}return a._TransportType=RongIMLib.Socket.WEBSOCKET,a}();RongIMLib.Transportations=Transportations;var SyncTimeUtil=function(){function a(){}return a.$getKey=function(a){var b=RongIMLib.Bridge._client,c=b.userId,d=1==a.messageDirection?\"send\":\"receive\",e=RongIMLib.RongIMClient._memoryStore.appKey;return RongIMLib.RongUtil.tplEngine(\"{appkey}_{userId}_{direction}box\",{appkey:e,userId:c,direction:d})},a.set=function(b){var c=a.$getKey(b),d=b.sentTime;RongIMLib.RongIMClient._storageProvider.setItem(c,d)},a.get=function(){var b=a.$getKey({messageDirection:RongIMLib.MessageDirection.SEND}),c=a.$getKey({messageDirection:RongIMLib.MessageDirection.RECEIVE}),d=RongIMLib.RongIMClient._storageProvider;return{sent:Number(d.getItem(b)||0),received:Number(d.getItem(c)||0)}},a}();RongIMLib.SyncTimeUtil=SyncTimeUtil;var MessageUtil=function(){function MessageUtil(){}return MessageUtil.checkStorageSize=function(){return JSON.stringify(localStorage).length<468e4},MessageUtil.getFirstKey=function(a){var b=\"\";for(var c in a){b=c;break}return b},MessageUtil.isEmpty=function(a){var b=!0;for(var c in a){b=!1;break}return b},MessageUtil.ArrayForm=function(a){if(\"[object ArrayBuffer]\"==Object.prototype.toString.call(a)){var b=new Int8Array(a);return[].slice.call(b)}return a},MessageUtil.ArrayFormInput=function(a){if(\"[object ArrayBuffer]\"==Object.prototype.toString.call(a)){return new Uint8Array(a)}return a},MessageUtil.indexOf=function(a,b,c){for(var d=a.length,e=c<0?Math.max(0,+c):c||0;e<d;e++)if(a[e]==b)return e;return-1},MessageUtil.isArray=function(a){return\"[object Array]\"==Object.prototype.toString.call(a)},MessageUtil.forEach=function(a,b){return[].forEach?function(a,b){[].forEach.call(a,b)}:function(a,b){for(var c=0;c<a.length;c++)b.call(a,a[c],c,a)}},MessageUtil.remove=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b(a[c]))return a.splice(c,1)[0];return null},MessageUtil.int64ToTimestamp=function(a,b){if(void 0===a.low)return a;var c=a.low;c<0&&(c+=4294967296),c=c.toString(16);var d=parseInt(a.high.toString(16)+\"00000000\".replace(new RegExp(\"0{\"+c.length+\"}$\"),c),16);return b?new Date(d):d},MessageUtil.messageParser=function(entity,onReceived,offlineMsg){var message=new RongIMLib.Message,content=entity.content,de,objectName=entity.classname,val,isUseDef=!1;try{RongIMLib.RongIMClient._memoryStore.depend.isPolling?(val=(new RongIMLib.BinaryHelper).readUTF(content.offset?MessageUtil.ArrayForm(content.buffer).slice(content.offset,content.limit):content),de=JSON.parse(val)):(val=(new RongIMLib.BinaryHelper).readUTF(content.offset?MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset,content.limit):content),de=JSON.parse(val))}catch(ex){de=val,isUseDef=!0}if(objectName in typeMapping){var str=\"new RongIMLib.\"+typeMapping[objectName]+\"(de)\";message.content=eval(str),message.messageType=typeMapping[objectName]}else if(objectName in registerMessageTypeMapping){var str=\"new RongIMLib.RongIMClient.RegisterMessage.\"+registerMessageTypeMapping[objectName]+\"(de)\";message.content=isUseDef?eval(str).decode(de):eval(str),message.messageType=registerMessageTypeMapping[objectName]}else message.content=new RongIMLib.UnknownMessage({content:de,objectName:objectName}),message.messageType=\"UnknownMessage\";var dateTime=MessageUtil.int64ToTimestamp(entity.dataTime);return message.sentTime=dateTime>0?dateTime:+new Date,message.senderUserId=entity.fromUserId,message.conversationType=entity.type,entity.fromUserId==RongIMLib.Bridge._client.userId?message.targetId=entity.groupId:message.targetId=/^[234]$/.test(entity.type||entity.getType())?entity.groupId:message.senderUserId,1==entity.direction?(message.messageDirection=RongIMLib.MessageDirection.SEND,message.senderUserId=RongIMLib.Bridge._client.userId):message.messageDirection=RongIMLib.MessageDirection.RECEIVE,message.messageUId=entity.msgId,message.receivedTime=(new Date).getTime(),message.messageId=message.conversationType+\"_\"+~~(16777215*Math.random()),message.objectName=objectName,message.receivedStatus=RongIMLib.ReceivedStatus.READ,2==(2&entity.status)&&(message.receivedStatus=RongIMLib.ReceivedStatus.RETRIEVED),message.offLineMessage=!!offlineMsg,offlineMsg||RongIMLib.RongIMClient._memoryStore.connectAckTime>message.sentTime&&(message.offLineMessage=!0),message},MessageUtil.detectCMP=function(a){var b=new XMLHttpRequest;b.onreadystatechange=function(){if(4==b.readyState){200==b.status?a.success():a.fail(b.status)}};var c=a.url,d=a.url,c=a.method||\"GET\";b.open(c,d);var e=a.headers;for(var f in e){var g=e[f];b.setRequestHeader(f,g)}var h=JSON.stringify(a.body||{});return b.send(h),b},MessageUtil.sign={converNum:1,msgNum:1,isMsgStart:!0,isConvStart:!0},MessageUtil}();RongIMLib.MessageUtil=MessageUtil;var MessageIdHandler=function(){function a(){}return a.init=function(){this.messageId=+(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId+\"msgId\")||RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId+\"msgId\",0)||0)},a.messageIdPlus=function(a){return RongIMLib.RongIMClient._memoryStore.depend.isPolling&&this.init(),this.messageId>=65535?(a(),!1):(this.messageId++,RongIMLib.RongIMClient._memoryStore.depend.isPolling&&RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId+\"msgId\",this.messageId),this.messageId)},a.clearMessageId=function(){this.messageId=0,RongIMLib.RongIMClient._memoryStore.depend.isPolling&&RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId+\"msgId\",this.messageId)},\na.getMessageId=function(){return RongIMLib.RongIMClient._memoryStore.depend.isPolling&&this.init(),this.messageId},a.messageId=0,a}();RongIMLib.MessageIdHandler=MessageIdHandler;var RongInnerTools=function(){function a(){}return a.convertUserStatus=function(a){a=RongIMLib.RongUtil.rename(a,{subUserId:\"userId\"});var b=JSON.parse(a.status),c=b.us;return c?(a.status=RongIMLib.RongUtil.rename(c,{o:\"online\",p:\"platform\",s:\"status\"}),a):a},a}();RongIMLib.RongInnerTools=RongInnerTools}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function a(a){throw new Error(\"This method is abstract, you must implement this method in inherited class.\")}return a.obtain=function(){throw new Error(\"This method is abstract, you must implement this method in inherited class.\")},a}();a.MessageContent=b;var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b}(b);a.NotificationMessage=c;var d=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b}(b);a.StatusMessage=d;var e=function(){function b(){}return b.modelClone=function(a){var b={};for(var c in a)\"messageName\"!=c&&\"encode\"!=c&&(b[c]=a[c]);return b},b.modleCreate=function(b,c){var d=function(e){var f=this;for(var g in b)f[b[g]]=e[b[g]];d.prototype.messageName=c,d.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))}};return d},b}();a.ModelUtil=e}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(a){this.messageName=\"CustomerStatusMessage\",this.status=a.status}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.CustomerStatusMessage=b;var c=function(){function b(a){this.messageName=\"ChangeModeResponseMessage\",this.code=a.code,this.data=a.data,this.msg=a.msg}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ChangeModeResponseMessage=c;var d=function(){function b(a){this.messageName=\"ChangeModeMessage\",this.uid=a.uid,this.sid=a.sid,this.pid=a.pid}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ChangeModeMessage=d;var e=function(){function b(a){this.messageName=\"CustomerStatusUpdateMessage\",this.serviceStatus=a.serviceStatus,this.sid=a.sid}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.CustomerStatusUpdateMessage=e;var f=function(){function b(a){this.messageName=\"HandShakeMessage\",a&&(this.requestInfo=a.requestInfo,this.userInfo=a.userInfo)}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.HandShakeMessage=f;var g=function(){function b(a){this.messageName=\"CustomerContact\",this.page=a.page,this.nickName=a.nickName,this.routingInfo=a.routingInfo,this.info=a.info,this.requestInfo=a.requestInfo}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.CustomerContact=g;var h=function(){function b(a){this.messageName=\"EvaluateMessage\",this.uid=a.uid,this.sid=a.sid,this.pid=a.pid,this.source=a.source,this.suggest=a.suggest,this.isresolve=a.isresolve,this.type=a.type}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.EvaluateMessage=h;var i=function(){function b(a){this.messageName=\"HandShakeResponseMessage\",this.msg=a.msg,this.status=a.status,this.data=a.data}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.HandShakeResponseMessage=i;var j=function(){function b(a){this.messageName=\"SuspendMessage\",this.uid=a.uid,this.sid=a.sid,this.pid=a.pid}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.SuspendMessage=j;var k=function(){function b(a){this.messageName=\"TerminateMessage\",this.code=a.code,this.msg=a.msg,this.sid=a.sid}return b.obtain=function(){return null},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.TerminateMessage=k}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function a(a){this.messageName=\"IsTypingStatusMessage\"}return a.prototype.encode=function(){},a.prototype.getMessage=function(){return null},a}();a.IsTypingStatusMessage=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(a){if(this.messageName=\"InformationNotificationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");this.message=a.message,this.extra=a.extra,a.user&&(this.user=a.user)}return b.obtain=function(a){return new b({message:a,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.InformationNotificationMessage=b;var c=function(){function b(a){if(this.messageName=\"CommandMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");try{\"[object String]\"==Object.prototype.toString.call(a.data)?this.data=JSON.parse(a.data):this.data=a.data}catch(b){this.data=a.data}this.name=a.name,this.extra=a.extra}return b.obtain=function(a){return new b({data:a,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.CommandMessage=c;var d=function(){function c(a){if(this.messageName=\"ContactNotificationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");this.operation=a.operation,this.targetUserId=a.targetUserId,this.message=a.message,this.extra=a.extra,this.sourceUserId=a.sourceUserId,a.user&&(this.user=a.user)}return c.obtain=function(a,c,d,e){return new b({operation:a,sourceUserId:c,targetUserId:d,message:e})},c.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},c.CONTACT_OPERATION_ACCEPT_RESPONSE=\"ContactOperationAcceptResponse\",c.CONTACT_OPERATION_REJECT_RESPONSE=\"ContactOperationRejectResponse\",c.CONTACT_OPERATION_REQUEST=\"ContactOperationRequest\",c}();a.ContactNotificationMessage=d;var e=function(){function b(a){if(this.messageName=\"ProfileNotificationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");this.operation=a.operation;try{\"[object String]\"==Object.prototype.toString.call(a.data)?this.data=JSON.parse(a.data):this.data=a.data}catch(b){this.data=a.data}this.extra=a.extra,a.user&&(this.user=a.user)}return b.obtain=function(a,c){return new b({operation:a,data:c})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ProfileNotificationMessage=e;var f=function(){function b(a){if(this.messageName=\"CommandNotificationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");try{\"[object String]\"==Object.prototype.toString.call(a.data)?this.data=JSON.parse(a.data):this.data=a.data}catch(b){this.data=a.data}this.name=a.name,this.extra=a.extra,a.user&&(this.user=a.user)}return b.obtain=function(a,c){return new b({name:a,data:c,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.CommandNotificationMessage=f;var g=function(){function b(a){if(this.messageName=\"DiscussionNotificationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");this.extra=a.extra,this.extension=a.extension,this.type=a.type,this.isHasReceived=a.isHasReceived,this.operation=a.operation,this.user=a.user,a.user&&(this.user=a.user)}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.DiscussionNotificationMessage=g;var h=function(){function b(a){if(this.messageName=\"GroupNotificationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");a.operatorUserId&&(this.operatorUserId=a.operatorUserId),a.operation&&(this.operation=a.operation),a.data&&(this.data=a.data),a.message&&(this.message=a.message),a.extra&&(this.extra=a.extra)}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.GroupNotificationMessage=h}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(a){if(this.messageName=\"TextMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");this.content=a.content,this.extra=a.extra,a.user&&(this.user=a.user),a.mentionedInfo&&(this.mentionedInfo=a.mentionedInfo)}return b.obtain=function(a){return new b({extra:\"\",content:a})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.TextMessage=b;var c=function(){function b(a){if(this.messageName=\"TypingStatusMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");this.typingContentType=a.typingContentType,this.data=a.data}return b.obtain=function(a,c){return new b({typingContentType:a,data:c})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.TypingStatusMessage=c;var d=function(){function b(a){if(this.messageName=\"ReadReceiptMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");this.lastMessageSendTime=a.lastMessageSendTime,this.messageUId=a.messageUId,this.type=a.type}return b.obtain=function(a,c,d){return new b({messageUId:a,lastMessageSendTime:c,type:d})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ReadReceiptMessage=d;var e=function(){function b(a){if(this.messageName=\"VoiceMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");this.content=a.content,this.duration=a.duration,this.extra=a.extra,a.user&&(this.user=a.user),a.mentionedInfo&&(this.mentionedInfo=a.mentionedInfo)}return b.obtain=function(a,c){return new b({content:a,duration:c,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.VoiceMessage=e;var f=function(){function b(a){this.messageName=\"RecallCommandMessage\",this.messageUId=a.messageUId,this.conversationType=a.conversationType,this.targetId=a.targetId,this.sentTime=a.sentTime,a.extra&&(this.extra=a.extra),a.user&&(this.user=a.user)}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.RecallCommandMessage=f;var g=function(){function b(a){if(this.messageName=\"ImageMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");this.content=a.content,this.imageUri=a.imageUri,a.extra&&(this.extra=a.extra),a.user&&(this.user=a.user),a.mentionedInfo&&(this.mentionedInfo=a.mentionedInfo)}return b.obtain=function(a,c){return new b({content:a,imageUri:c,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ImageMessage=g;var h=function(){function b(a){if(this.messageName=\"LocationMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");this.latitude=a.latitude,this.longitude=a.longitude,this.poi=a.poi,this.content=a.content,this.extra=a.extra,a.user&&(this.user=a.user),a.mentionedInfo&&(this.mentionedInfo=a.mentionedInfo)}return b.obtain=function(a,c,d,e){return new b({latitude:a,longitude:c,poi:d,content:e,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.LocationMessage=h;var i=function(){function b(a){if(this.messageName=\"RichContentMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");this.title=a.title,this.content=a.content,this.imageUri=a.imageUri,this.extra=a.extra,this.url=a.url,a.user&&(this.user=a.user)}return b.obtain=function(a,c,d,e){return new b({title:a,content:c,imageUri:d,url:e,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.RichContentMessage=i;var j=function(){function a(a){this.messageName=\"JrmfRedPacketMessage\",a&&(this.message=a)}return a.prototype.encode=function(){return\"\"},a}();a.JrmfRedPacketMessage=j;var k=function(){function a(a){this.messageName=\"JrmfRedPacketOpenedMessage\",a&&(this.message=a)}return a.prototype.encode=function(){return\"\"},a}();a.JrmfRedPacketOpenedMessage=k;var l=function(){function a(a){if(this.messageName=\"UnknownMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");this.message=a}return a.prototype.encode=function(){return\"\"},a}();a.UnknownMessage=l;var m=function(){function b(a){if(this.messageName=\"PublicServiceCommandMessage\",0==arguments.length)throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");this.content=a.content,this.extra=a.extra,this.menuItem=a.menuItem,a.user&&(this.user=a.user),a.mentionedInfo&&(this.mentionedInfo=a.mentionedInfo)}return b.obtain=function(a){return new b({content:\"\",command:\"\",menuItem:a,extra:\"\"})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.PublicServiceCommandMessage=m;var n=function(){function a(a){this.messageName=\"PublicServiceMultiRichContentMessage\",this.richContentMessages=a}return a.prototype.encode=function(){return null},a}();a.PublicServiceMultiRichContentMessage=n;var o=function(){function b(a){this.messageName=\"SyncReadStatusMessage\",a.lastMessageSendTime&&(this.lastMessageSendTime=a.lastMessageSendTime)}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.SyncReadStatusMessage=o;var p=function(){function b(a){this.messageName=\"ReadReceiptRequestMessage\",a.messageUId&&(this.messageUId=a.messageUId)}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ReadReceiptRequestMessage=p;var q=function(){function b(a){this.messageName=\"ReadReceiptResponseMessage\",a.receiptMessageDic&&(this.receiptMessageDic=a.receiptMessageDic)}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.ReadReceiptResponseMessage=q;var r=function(){function b(a){this.messageName=\"PublicServiceRichContentMessage\",this.richContentMessage=a}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.PublicServiceRichContentMessage=r;var s=function(){function b(a){this.messageName=\"FileMessage\",a.name&&(this.name=a.name),a.size&&(this.size=a.size),a.type&&(this.type=a.type),a.fileUrl&&(this.fileUrl=a.fileUrl),a.extra&&(this.extra=a.extra),a.user&&(this.user=a.user)}return b.obtain=function(a){return new b({name:a.name,size:a.size,type:a.type,fileUrl:a.fileUrl})},b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.FileMessage=s;var t=function(){function b(a){this.messageName=\"AcceptMessage\",this.mediaId=a.mediaId,this.callId=a.callId,this.mediaType=a.mediaType,this.mode=a.mode,this.subInfo=a.subInfo}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.AcceptMessage=t;var u=function(){function b(a){this.messageName=\"RingingMessage\",this.callId=a.callId}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.RingingMessage=u;var v=function(){function b(a){this.messageName=\"SummaryMessage\",this.caller=a.caller,this.inviter=a.inviter,this.mediaType=a.mediaType,this.memberIdList=a.memberIdList,this.startTime=a.startTime,this.connectedTime=a.connectedTime,this.duration=a.duration,this.status=a.status}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.SummaryMessage=v;var w=function(){function b(a){this.messageName=\"HungupMessage\",this.callId=a.callId,this.reason=a.reason,this.mode=a.mode,this.subInfo=a.subInfo}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.HungupMessage=w;var x=function(){function b(a){this.messageName=\"InviteMessage\",this.mediaId=a.mediaId,this.callId=a.callId,this.engineType=a.engineType,this.channelInfo=a.channelInfo,this.mediaType=a.mediaType,this.extra=a.extra,this.inviteUserIds=a.inviteUserIds,this.observerUserIds=a.observerUserIds,this.mode=a.mode,this.subInfo=a.subInfo}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.InviteMessage=x;var y=function(){function b(a){this.messageName=\"MediaModifyMessage\",this.callId=a.callId,this.mediaType=a.mediaType,this.mode=a.mode,this.subInfo=a.subInfo}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.MediaModifyMessage=y;var z=function(){function b(a){this.messageName=\"MemberModifyMessage\",this.modifyMemType=a.modifyMemType,this.callId=a.callId,this.caller=a.caller,this.engineType=a.engineType,this.channelInfo=a.channelInfo,this.mediaType=a.mediaType,this.extra=a.extra,this.inviteUserIds=a.inviteUserIds,this.existedMemberStatusList=a.existedMemberStatusList,this.existedUserPofiles=a.existedUserPofiles,this.observerUserIds=a.observerUserIds,this.mode=a.mode,this.subInfo=a.subInfo}return b.prototype.encode=function(){return JSON.stringify(a.ModelUtil.modelClone(this))},b}();a.MemberModifyMessage=z}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function a(a,b){this.Id=a,this.Key=b}return a}();a.ChannelInfo=b;var c=function(){function a(a,b,c){this.platform=a,this.online=b,this.status=c}return a}();a.UserStatus=c;var d=function(){function a(a,b,c){}return a}();a.MentionedInfo=d;var e=function(){function a(a,b,c){this.msgId=a,this.msgDataTime=b,this.direct=c}return a}();a.DeleteMessage=e;var f=function(){function a(a,b,c){}return a}();a.CustomServiceConfig=f;var g=function(){function a(a,b,c,d,e,f,g){}return a}();a.CustomServiceSession=g;var h=function(){function b(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){this.conversationTitle=a,this.conversationType=b,this.draft=c,this.isTop=d,this.latestMessage=e,this.latestMessageId=f,this.notificationStatus=g,this.objectName=h,this.receivedStatus=i,this.receivedTime=j,this.senderUserId=k,this.senderUserName=l,this.sentStatus=m,this.sentTime=n,this.targetId=o,this.unreadMessageCount=p,this.senderPortraitUri=q,this.isHidden=r,this.mentionedMsg=s,this.hasUnreadMention=t,this._readTime=u}return b.prototype.setTop=function(){a.RongIMClient._dataAccessProvider.addConversation(this,{onSuccess:function(a){}})},b}();a.Conversation=h;var i=function(){function a(a,b,c,d,e){this.creatorId=a,this.id=b,this.memberIdList=c,this.name=d,this.isOpen=e}return a}();a.Discussion=i;var j=function(){function a(a,b,c){this.id=a,this.name=b,this.portraitUri=c}return a}();a.Group=j;var k=function(){function a(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){this.content=a,this.conversationType=b,this.extra=c,this.objectName=d,this.messageDirection=e,this.messageId=f,this.receivedStatus=g,this.receivedTime=h,this.senderUserId=i,this.sentStatus=j,this.sentTime=k,this.targetId=l,this.messageType=m,this.messageUId=n,this.isLocalMessage=o,this.offLineMessage=p,this.receiptResponse=q}return a}();a.Message=k;var l=function(){function a(a,b){this.isCounted=a,this.isPersited=b}return a.prototype.getMessageTag=function(){return this.isCounted&&this.isPersited?3:this.isCounted?2:this.isPersited?1:this.isCounted||this.isPersited?void 0:0},a.getTagByStatus=function(a){var b={3:{isCounted:!0,isPersited:!0},2:{isCounted:!0,isPersited:!1},1:{isCounted:!0,isPersited:!0},0:{isCounted:!0,isPersited:!0}};return b[a]||b[3]},a}();a.MessageTag=l;var m=function(){function a(a,b,c,d,e){this.id=a,this.name=b,this.type=c,this.sunMenuItems=d,this.url=e}return a}();a.PublicServiceMenuItem=m;var n=function(){function a(a,b,c,d,e,f,g,h){this.conversationType=a,this.introduction=b,this.menu=c,this.name=d,this.portraitUri=e,this.publicServiceId=f,this.hasFollowed=g,this.isGlobal=h}return a}();a.PublicServiceProfile=n;var o=function(){function a(a,b,c){this.id=a,this.name=b,this.portraitUri=c}return a}();a.UserInfo=o;var p=function(){function a(a,b){this.id=a,this.token=b}return a}();a.User=p;var q=function(){function a(a,b){this.id=a,this.user=b}return a}();a.Room=q}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(){this.userStatusListener=null}return b.prototype.init=function(b,c){new a.FeatureDectector(c.appCallback)},b.prototype.connect=function(b,c,d,e){a.RongIMClient.bridge=a.Bridge.getInstance(),a.RongIMClient._memoryStore.token=b,a.RongIMClient._memoryStore.callback=c,d=d||\"\",e=e||{};var f=!1,g=!1;if(a.Bridge._client&&a.Bridge._client.channel&&(f=a.Bridge._client.channel.connectionStatus==a.ConnectionStatus.CONNECTING,g=a.Bridge._client.channel.connectionStatus==a.ConnectionStatus.CONNECTED),!g&&!f){if(a.RongIMClient.otherDeviceLoginCount>5)return void c.onError(a.ConnectionStatus.ULTRALIMIT);e.force&&a.RongIMClient._storageProvider.removeItem(\"servers\");for(var h=0,i=a.RongIMClient._memoryStore.listenerList.length;h<i;h++)a.RongIMClient.bridge.setListener(a.RongIMClient._memoryStore.listenerList[h]);a.RongIMClient._memoryStore.listenerList.length=0,a.RongIMClient.bridge.connect(a.RongIMClient._memoryStore.appKey,b,{onSuccess:function(a){setTimeout(function(){c.onSuccess(a)})},onError:function(b){b!=a.ConnectionState.TOKEN_INCORRECT&&b?setTimeout(function(){c.onError(b)}):setTimeout(function(){c.onTokenIncorrect()})}})}},b.prototype.reconnect=function(b,c){var d=a.RongIMClient._memoryStore,e=d.token;if(!e)throw new Error(\"reconnect: token is empty.\");if(a.Bridge._client&&a.Bridge._client.channel&&a.Bridge._client.channel.connectionStatus!=a.ConnectionStatus.CONNECTED&&a.Bridge._client.channel.connectionStatus!=a.ConnectionStatus.CONNECTING){c=c||{};var f=c.auto?\"auto\":\"custom\";({auto:function(){var d=function(b){var c=b.step(),d=b.url,e=function(){a.RongUtil.request({url:d,success:function(){b.done()},error:function(){f()}})},f=function(){var d=c();if(\"done\"==d){var f=a.ConnectionStatus.NETWORK_UNAVAILABLE;return void b.done(f)}setTimeout(e,d)};f()},f=a.RongIMClient._memoryStore.depend.protocol,g=c.url||\"cdn.ronghub.com/RongIMLib-2.2.6.min.js\",h={protocol:f,path:g};g=a.RongUtil.formatProtoclPath(h);var i=c.rate||[100,1e3,3e3,6e3,1e4,18e3];i.push(\"done\"),d({url:g,step:function(){var a=0;return function(){var b=i[a];return a++,b}},done:function(c){if(c)return void b.onError(c);a.RongIMClient.connect(e,b)}})},custom:function(){a.RongIMClient.connect(e,b)}})[f]()}},b.prototype.logout=function(){a.RongIMClient.bridge.disconnect(),a.RongIMClient.bridge=null},b.prototype.disconnect=function(){a.RongIMClient.bridge.disconnect()},b.prototype.sendReceiptResponse=function(b,c,d){var e=a.Bridge._client.userId+b+c+\"RECEIVED\",f=this;if(a.RongUtil.supportLocalStorage()){var g=JSON.parse(a.RongIMClient._storageProvider.getItem(e));if(g){var h=[];for(var i in g){var j={};j[i]=g[i].uIds,g[i].isResponse||h.push(j)}if(0==h.length)return void d.onSuccess();var k=setInterval(function(){1==h.length&&clearInterval(k);var i=h.splice(0,1)[0],j=new a.ReadReceiptResponseMessage({receiptMessageDic:i});f.sendMessage(b,c,j,{onSuccess:function(b){var c=a.MessageUtil.getFirstKey(i);g[c].isResponse=!0,a.RongIMClient._storageProvider.setItem(e,JSON.stringify(g)),d.onSuccess(b)},onError:function(a,b){d.onError(a,b)}})},200)}else d.onSuccess()}else d.onSuccess()},b.prototype.sendTypingStatusMessage=function(b,c,d,e){var f=this;d in a.RongIMClient.MessageParams&&f.sendMessage(b,c,a.TypingStatusMessage.obtain(a.RongIMClient.MessageParams[d].objectName,\"\"),{onSuccess:function(){setTimeout(function(){e.onSuccess()})},onError:function(a){setTimeout(function(){e.onError(a,null)})},onBefore:function(){}})},b.prototype.sendRecallMessage=function(b,c){var d=new a.RecallCommandMessage({conversationType:b.conversationType,targetId:b.targetId,sentTime:b.sentTime,messageUId:b.messageUId,extra:b.extra,user:b.user});this.sendMessage(b.conversationType,b.senderUserId,d,c,!1,null,null,2)},b.prototype.sendTextMessage=function(b,c,d,e){var f=a.TextMessage.obtain(d);this.sendMessage(b,c,f,e)},b.prototype.getRemoteHistoryMessages=function(b,c,d,e,f,g){if(e<=1)throw new Error(\"the count must be greater than 1.\");g=g||{};var h=g.order||0,i=function(){return[b,c,\"_\",h].join(\"\")},j=i();a.RongUtil.isNumber(d)||(d=a.RongIMClient._memoryStore.lastReadTime.get(j));var k=a.RongIMClient._memoryStore,l=k.historyMessageLimit,m=l.get(j)||{},n=m.hasMore;if(!n&&m.time==d&&0==h)return f.onSuccess([],n);var o=new a.RongIMClient.Protobuf.HistoryMsgInput;o.setTargetId(c),o.setTime(d),o.setCount(e),o.setOrder(h),a.RongIMClient.bridge.queryMsg(HistoryMsgType[b],a.MessageUtil.ArrayForm(o.toArrayBuffer()),c,{onSuccess:function(b){var d=a.MessageUtil.int64ToTimestamp(b.syncTime);a.RongIMClient._memoryStore.lastReadTime.set(j,d),l.set(j,{hasMore:!!b.hasMsg,time:d});var e,g=b.list.reverse(),h=null,i=a.SentStatus.READ;if(a.RongUtil.supportLocalStorage())for(var k=0,m=g.length;k<m;k++)h=a.MessageUtil.messageParser(g[k]),e=JSON.parse(a.RongIMClient._storageProvider.getItem(a.Bridge._client.userId+h.messageUId+\"SENT\")),e&&(h.receiptResponse||(h.receiptResponse={}),h.receiptResponse[h.messageUId]=e.count),h.sentStatus=i,h.targetId=c,g[k]=h;else for(var k=0,m=g.length;k<m;k++){var h=a.MessageUtil.messageParser(g[k]);h.sentStatus=i,g[k]=h}setTimeout(function(){f.onSuccess(g,!!b.hasMsg)})},onError:function(a){setTimeout(function(){f.onError(a)})}},\"HistoryMessagesOuput\")},b.prototype.hasRemoteUnreadMessages=function(b,c){var d=null;window.RCCallback=function(a){setTimeout(function(){c.onSuccess(!!+a.status)}),d.parentNode.removeChild(d)},d=document.createElement(\"script\"),d.src=a.RongIMClient._memoryStore.depend.api+\"/message/exist.js?appKey=\"+encodeURIComponent(a.RongIMClient._memoryStore.appKey)+\"&token=\"+encodeURIComponent(b)+\"&callBack=RCCallback&_=\"+a.RongUtil.getTimestamp(),document.body.appendChild(d),d.onerror=function(){setTimeout(function(){c.onError(a.ErrorCode.UNKNOWN)}),d.parentNode.removeChild(d)}},b.prototype.getRemoteConversationList=function(b,c,d){var e=new a.RongIMClient.Protobuf.RelationsInput,f=this;e.setType(1),void 0===d?e.setCount(0):e.setCount(d),a.RongIMClient.bridge.queryMsg(26,a.MessageUtil.ArrayForm(e.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(d){if(d.info){d.info=d.info.reverse();for(var e=0,g=d.info.length;e<g;e++)a.RongIMClient.getInstance().pottingConversation(d.info[e])}var h=a.RongIMClient._memoryStore.conversationList;setTimeout(function(){if(c)return b.onSuccess(f.filterConversations(c,h));b.onSuccess(h)})},onError:function(a){b.onError(a)}},\"RelationsOutput\")},b.prototype.addMemberToDiscussion=function(b,c,d){var e=new a.RongIMClient.Protobuf.ChannelInvitationInput;e.setUsers(c),a.RongIMClient.bridge.queryMsg(0,a.MessageUtil.ArrayForm(e.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){d.onSuccess()})},onError:function(a){setTimeout(function(){d.onError(a)})}})},b.prototype.createDiscussion=function(b,c,d){var e=new a.RongIMClient.Protobuf.CreateDiscussionInput,f=this;e.setName(b),a.RongIMClient.bridge.queryMsg(1,a.MessageUtil.ArrayForm(e.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(a){c.length>0&&f.addMemberToDiscussion(a,c,{onSuccess:function(){},onError:function(a){setTimeout(function(){d.onError(a)})}}),setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){d.onError(a)})}},\"CreateDiscussionOutput\")},b.prototype.getDiscussion=function(b,c){var d=new a.RongIMClient.Protobuf.ChannelInfoInput;d.setNothing(1),a.RongIMClient.bridge.queryMsg(4,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(a){setTimeout(function(){c.onSuccess(a)})},onError:function(a){setTimeout(function(){c.onError(a)})}},\"ChannelInfoOutput\")},b.prototype.quitDiscussion=function(b,c){var d=new a.RongIMClient.Protobuf.LeaveChannelInput;d.setNothing(1),a.RongIMClient.bridge.queryMsg(7,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){c.onSuccess()})},onError:function(a){setTimeout(function(){c.onError(a)})}})},b.prototype.removeMemberFromDiscussion=function(b,c,d){var e=new a.RongIMClient.Protobuf.ChannelEvictionInput;e.setUser(c),a.RongIMClient.bridge.queryMsg(9,a.MessageUtil.ArrayForm(e.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){d.onSuccess()})},onError:function(a){setTimeout(function(){d.onError(a)})}})},b.prototype.setDiscussionInviteStatus=function(b,c,d){var e=new a.RongIMClient.Protobuf.ModifyPermissionInput;e.setOpenStatus(c.valueOf()),a.RongIMClient.bridge.queryMsg(11,a.MessageUtil.ArrayForm(e.toArrayBuffer()),b,{onSuccess:function(a){setTimeout(function(){d.onSuccess()})},onError:function(a){setTimeout(function(){d.onError(a)})}})},b.prototype.setDiscussionName=function(b,c,d){var e=new a.RongIMClient.Protobuf.RenameChannelInput;e.setName(c),a.RongIMClient.bridge.queryMsg(12,a.MessageUtil.ArrayForm(e.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){d.onSuccess()})},onError:function(a){d.onError(a)}})},b.prototype.joinChatRoom=function(b,c,d){var e=new a.RongIMClient.Protobuf.ChrmInput;e.setNothing(1),a.Bridge._client.chatroomId=b,a.RongIMClient.bridge.queryMsg(19,a.MessageUtil.ArrayForm(e.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){d.onSuccess()});var e=new a.RongIMClient.Protobuf.ChrmPullMsg;0==c&&(c=-1),e.setCount(c),e.setSyncTime(0),a.Bridge._client.queryMessage(\"chrmPull\",a.MessageUtil.ArrayForm(e.toArrayBuffer()),b,1,{onSuccess:function(c){var d=c.list,e=a.MessageUtil.int64ToTimestamp(c.syncTime),f=d[d.length-1];f&&(f=a.MessageUtil.messageParser(f),e=f.sentTime),a.RongIMClient._memoryStore.lastReadTime.set(b+a.Bridge._client.userId+\"CST\",e);for(var g=a.Bridge._client,h=0,i=d.length;h<i;h++){var j=\"R\"+d[h].msgId;if(!(j in g.cacheMessageIds)){g.cacheMessageIds[j]=!0;var k=a.RongUtil.keys(g.cacheMessageIds);if(k.length>10&&(j=k[0],delete g.cacheMessageIds[j]),a.RongIMClient._memoryStore.filterMessages.length>0)for(var l=0,m=a.RongIMClient._memoryStore.filterMessages.length;l<m;l++)a.RongIMClient.MessageParams[a.RongIMClient._memoryStore.filterMessages[l]].objectName!=d[h].classname&&g.handler.onReceived(d[h]);else g.handler.onReceived(d[h])}}},onError:function(b){setTimeout(function(){d.onError(a.ErrorCode.CHATROOM_HISMESSAGE_ERROR)})}},\"DownStreamMessages\")},onError:function(a){setTimeout(function(){d.onError(a)})}},\"ChrmOutput\")},b.prototype.getChatRoomInfo=function(b,c,d,e){var f=new a.RongIMClient.Protobuf.QueryChatroomInfoInput;f.setCount(c),f.setOrder(d),a.RongIMClient.bridge.queryMsg(\"queryChrmI\",a.MessageUtil.ArrayForm(f.toArrayBuffer()),b,{onSuccess:function(b){b.userInfos.forEach(function(b){b.time=a.MessageUtil.int64ToTimestamp(b.time)}),setTimeout(function(){e.onSuccess(b)})},onError:function(a){setTimeout(function(){e.onError(a)})}},\"QueryChatroomInfoOutput\")},b.prototype.quitChatRoom=function(b,c){var d=new a.RongIMClient.Protobuf.ChrmInput;d.setNothing(1),a.RongIMClient.bridge.queryMsg(17,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){c.onSuccess()})},onError:function(a){setTimeout(function(){c.onError(a)})}},\"ChrmOutput\")},b.prototype.setChatroomHisMessageTimestamp=function(b,c){a.RongIMClient._memoryStore.lastReadTime.set(\"chrhis_\"+b,c)},\nb.prototype.getChatRoomHistoryMessages=function(b,c,d,e){var f=new a.RongIMClient.Protobuf.HistoryMsgInput;f.setTargetId(b);var g=a.RongIMClient._memoryStore.lastReadTime.get(\"chrhis_\"+b)||0;f.setTime(g),f.setCount(c),f.setOrder(d),a.RongIMClient.bridge.queryMsg(34,a.MessageUtil.ArrayForm(f.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(c){a.RongIMClient._memoryStore.lastReadTime.set(\"chrhis_\"+b,a.MessageUtil.int64ToTimestamp(c.syncTime));for(var d=c.list.reverse(),f=0,g=d.length;f<g;f++)d[f]=a.MessageUtil.messageParser(d[f]);setTimeout(function(){e.onSuccess(d,!!c.hasMsg)})},onError:function(a){setTimeout(function(){e.onError(a)})}},\"HistoryMsgOuput\")},b.prototype.setMessageStatus=function(a,b,c,d,e){setTimeout(function(){e.onSuccess(!0)})},b.prototype.addToBlacklist=function(b,c){var d=new a.RongIMClient.Protobuf.Add2BlackListInput;d.setUserId(b),a.RongIMClient.bridge.queryMsg(21,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){c.onSuccess()})},onError:function(a){setTimeout(function(){c.onError(a)})}})},b.prototype.getBlacklist=function(b){var c=new a.RongIMClient.Protobuf.QueryBlackListInput;c.setNothing(1),a.RongIMClient.bridge.queryMsg(23,a.MessageUtil.ArrayForm(c.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(a){setTimeout(function(){b.onSuccess(a)})},onError:function(a){setTimeout(function(){b.onError(a)})}},\"QueryBlackListOutput\")},b.prototype.getBlacklistStatus=function(b,c){var d=new a.RongIMClient.Protobuf.BlackListStatusInput;d.setUserId(b),a.RongIMClient.bridge.queryMsg(24,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(b){setTimeout(function(){c.onSuccess(a.BlacklistStatus[b])})},onError:function(a){setTimeout(function(){c.onError(a)})}})},b.prototype.removeFromBlacklist=function(b,c){var d=new a.RongIMClient.Protobuf.RemoveFromBlackListInput;d.setUserId(b),a.RongIMClient.bridge.queryMsg(22,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(){setTimeout(function(){c.onSuccess()})},onError:function(a){setTimeout(function(){c.onError(a)})}})},b.prototype.getFileToken=function(b,c){if(!/(1|2|3|4)/.test(b.toString()))return void setTimeout(function(){c.onError(a.ErrorCode.QNTKN_FILETYPE_ERROR)});var d=new a.RongIMClient.Protobuf.GetQNupTokenInput;d.setType(b),a.RongIMClient.bridge.queryMsg(30,a.MessageUtil.ArrayForm(d.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(a){setTimeout(function(){c.onSuccess(a)})},onError:function(a){setTimeout(function(){c.onError(a)})}},\"GetQNupTokenOutput\")},b.prototype.getFileUrl=function(b,c,d,e){if(!/(1|2|3|4)/.test(b.toString()))return void setTimeout(function(){e.onError(a.ErrorCode.QNTKN_FILETYPE_ERROR)});var f=new a.RongIMClient.Protobuf.GetQNdownloadUrlInput;f.setType(b),f.setKey(c),d&&f.setFileName(d),a.RongIMClient.bridge.queryMsg(31,a.MessageUtil.ArrayForm(f.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(a){setTimeout(function(){e.onSuccess(a)})},onError:function(a){setTimeout(function(){e.onError(a)})}},\"GetQNdownloadUrlOutput\")},b.prototype.sendMessage=function(b,c,d,e,f,g,h,i,j){if(!a.Bridge._client.channel)return void setTimeout(function(){e.onError(a.ErrorCode.RC_NET_UNAVAILABLE,null)});if(!a.Bridge._client.channel.socket.socket.connected)throw setTimeout(function(){e.onError(a.ErrorCode.TIMEOUT,null)}),new Error(\"connect is timeout! postion:sendMessage\");var k=b==a.ConversationType.DISCUSSION||b==a.ConversationType.GROUP,l=new a.RongIMClient.Protobuf.UpStreamMessage;if(f&&k?l.setSessionId(7):l.setSessionId(a.RongIMClient.MessageParams[d.messageName].msgTag.getMessageTag()),g&&l.setPushText(g),h&&l.setAppData(h),k&&d.messageName==a.RongIMClient.MessageType.ReadReceiptResponseMessage){var m=d;if(m.receiptMessageDic){var n=[];for(var o in m.receiptMessageDic)n.push(o);l.setUserId(n)}}k&&d.messageName==a.RongIMClient.MessageType.SyncReadStatusMessage&&l.setUserId(a.Bridge._client.userId),j=j||{};var p=j.userIds;k&&p&&l.setUserId(p),l.setClassname(a.RongIMClient.MessageParams[d.messageName].objectName),l.setContent(d.encode());var q=l.toArrayBuffer();\"[object ArrayBuffer]\"==Object.prototype.toString.call(q)&&(q=[].slice.call(new Int8Array(q)));var r=this,s=new a.Message,t=this.getConversation(b,c);3==a.RongIMClient.MessageParams[d.messageName].msgTag.getMessageTag()&&(t||(t=a.RongIMClient.getInstance().createConversation(b,c,\"\")),t.sentTime=(new Date).getTime(),t.sentStatus=a.SentStatus.SENDING,t.senderUserName=\"\",t.senderUserId=a.Bridge._client.userId,t.notificationStatus=a.ConversationNotificationStatus.DO_NOT_DISTURB,t.latestMessage=s,t.unreadMessageCount=0,a.RongIMClient._dataAccessProvider.addConversation(t,{onSuccess:function(a){}})),a.RongIMClient._memoryStore.converStore=t,s.content=d,s.conversationType=b,s.senderUserId=a.Bridge._client.userId,s.objectName=a.RongIMClient.MessageParams[d.messageName].objectName,s.targetId=c,s.sentTime=(new Date).getTime(),s.messageDirection=a.MessageDirection.SEND,s.sentStatus=a.SentStatus.SENT,s.messageType=d.messageName,a.RongIMClient.bridge.pubMsg(b.valueOf(),q,c,{onSuccess:function(f){if(f&&f.timestamp&&a.RongIMClient._memoryStore.lastReadTime.set(\"converST_\"+a.Bridge._client.userId+b+c,f.timestamp),(b==a.ConversationType.DISCUSSION||b==a.ConversationType.GROUP)&&d.messageName==a.RongIMClient.MessageType.ReadReceiptRequestMessage){var g=s.content,h=a.Bridge._client.userId+g.messageUId+\"SENT\";a.RongIMClient._storageProvider.setItem(h,JSON.stringify({count:0,dealtime:f.timestamp,userIds:{}}))}if(3==a.RongIMClient.MessageParams[s.messageType].msgTag.getMessageTag()){var i=a.RongIMClient._memoryStore.converStore;i.sentStatus=s.sentStatus,i.latestMessage=s,r.updateConversation(i),a.RongIMClient._dataAccessProvider.addMessage(b,c,s,{onSuccess:function(b){s=b,s.messageUId=f.messageUId,s.sentTime=f.timestamp,s.sentStatus=a.SentStatus.SENT,s.messageId=f.messageId,a.RongIMClient._dataAccessProvider.updateMessage(s)},onError:function(){}})}setTimeout(function(){i&&r.updateConversation(i),s.sentTime=f.timestamp,s.messageUId=f.messageUId,e.onSuccess(s)})},onError:function(d,f){s.sentStatus=a.SentStatus.FAILED,f&&(s.messageUId=f.messageUId,s.sentTime=f.sentTime),3==a.RongIMClient.MessageParams[s.messageType].msgTag.getMessageTag()&&(a.RongIMClient._memoryStore.converStore.latestMessage=s),a.RongIMClient._dataAccessProvider.addMessage(b,c,s,{onSuccess:function(b){s.messageId=b.messageId,a.RongIMClient._dataAccessProvider.updateMessage(s)},onError:function(){}}),setTimeout(function(){e.onError(d,s)})}},null,i),e.onBefore&&e.onBefore(a.MessageIdHandler.messageId),s.messageId=a.MessageIdHandler.messageId+\"\"},b.prototype.setConnectionStatusListener=function(b){var c={onChanged:function(c){b.onChanged(c),a.RongUtil.forEach(a.RongIMClient.statusListeners,function(a){a(c)})}};a.RongIMClient.bridge?a.RongIMClient.bridge.setListener(c):a.RongIMClient._memoryStore.listenerList.push(c)},b.prototype.setOnReceiveMessageListener=function(b){a.RongIMClient.bridge?a.RongIMClient.bridge.setListener(b):a.RongIMClient._memoryStore.listenerList.push(b)},b.prototype.registerMessageType=function(b,c,d,e,f){if(!b)throw new Error(\"messageType can't be empty,postion -> registerMessageType\");if(!c)throw new Error(\"objectName can't be empty,postion -> registerMessageType\");if(\"[object Array]\"==Object.prototype.toString.call(e)){var g=a.ModelUtil.modleCreate(e,b);a.RongIMClient.RegisterMessage[b]=g}else{if(\"[object Function]\"!=Object.prototype.toString.call(e)&&\"[object Object]\"!=Object.prototype.toString.call(e))throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");if(!e.encode)throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");if(!e.decode)throw new Error(\"decode method has not realized -> registerMessageType\")}registerMessageTypeMapping[c]=b},b.prototype.registerMessageTypes=function(b){var c=[],d=function(a){var b=[];for(var c in a)b.push(c);return b};for(var e in b){var f=b[e],g=f.proto,h=d(g),i=f.flag||3,j=a.MessageTag.getTagByStatus(i);i=new a.MessageTag(j.isCounted,j.isPersited),c.push({type:e,name:f.name,flag:i,protos:h})}for(var k=function(b){var c=b.type,d=b.name,e=b.flag,f=b.protos;a.RongIMClient.registerMessageType(c,d,e,f)},l=0,m=c.length;l<m;l++){var f=c[l];k(f)}},b.prototype.addConversation=function(b,c){for(var d=!0,e=0,f=a.RongIMClient._memoryStore.conversationList.length;e<f;e++)if(a.RongIMClient._memoryStore.conversationList[e].conversationType===b.conversationType&&a.RongIMClient._memoryStore.conversationList[e].targetId===b.targetId){a.RongIMClient._memoryStore.conversationList.unshift(a.RongIMClient._memoryStore.conversationList.splice(e,1)[0]),d=!1;break}d&&a.RongIMClient._memoryStore.conversationList.unshift(b),c&&c.onSuccess(!0)},b.prototype.updateConversation=function(b){for(var c,d=0,e=a.RongIMClient._memoryStore.conversationList.length;d<e;d++){var f=a.RongIMClient._memoryStore.conversationList[d];if(b.conversationType===f.conversationType&&b.targetId===f.targetId){b.conversationTitle&&(f.conversationTitle=b.conversationTitle),b.senderUserName&&(f.senderUserName=b.senderUserName),b.senderPortraitUri&&(f.senderPortraitUri=b.senderPortraitUri),b.latestMessage&&(f.latestMessage=b.latestMessage),b.sentStatus&&(f.sentStatus=b.sentStatus);break}}return c},b.prototype.removeConversation=function(b,c,d){var e=new a.RongIMClient.Protobuf.RelationsInput;e.setType(b),a.RongIMClient.bridge.queryMsg(27,a.MessageUtil.ArrayForm(e.toArrayBuffer()),c,{onSuccess:function(){for(var e=a.RongIMClient._memoryStore.conversationList,f=e.length,g=0;g<f;g++)if(e[g].conversationType==b&&c==e[g].targetId){e.splice(g,1);break}d.onSuccess(!0)},onError:function(a){setTimeout(function(){d.onError(a)})}})},b.prototype.getMessage=function(b,c){c.onSuccess(new a.Message)},b.prototype.addMessage=function(a,b,c,d){d&&d.onSuccess(c)},b.prototype.removeMessage=function(b,c,d,e){a.RongIMClient.getInstance().deleteRemoteMessages(b,c,d,e)},b.prototype.removeLocalMessage=function(a,b,c,d){d.onSuccess(!0)},b.prototype.updateMessage=function(a,b){b&&b.onSuccess(a)},b.prototype.clearRemoteHistoryMessages=function(b,c){var d=new a.RongIMClient.Protobuf.CleanHisMsgInput,e=b.conversationType,f={1:\"cleanPMsg\",2:\"cleanDMsg\",3:\"cleanGMsg\",5:\"cleanCMsg\",6:\"cleanSMsg\"},g=f[e];if(!g)return void c.onError(a.ErrorCode.CLEAR_HIS_TYPE_ERROR);var h=b.timestamp;if(\"number\"!=typeof h)return void c.onError(a.ErrorCode.CLEAR_HIS_TIME_ERROR);d.setDataTime(h);var i=b.targetId;d.setTargetId(i),a.RongIMClient.bridge.queryMsg(g,a.MessageUtil.ArrayForm(d.toArrayBuffer()),i,{onSuccess:function(a){c.onSuccess(!a)},onError:function(b){1==b&&(b=a.ErrorCode.CLEAR_HIS_ERROR),setTimeout(function(){c.onError(b)})}})},b.prototype.clearHistoryMessages=function(a,b){this.clearRemoteHistoryMessages(a,b)},b.prototype.clearMessages=function(a,b,c){},b.prototype.updateMessages=function(b,c,d,e,f){var g=this;\"readStatus\"==d&&a.RongIMClient._memoryStore.conversationList.length>0&&g.getConversationList({onSuccess:function(a){Array.forEach(a,function(a){a.conversationType==b&&a.targetId==c&&(a.unreadMessageCount=0)})},onError:function(a){setTimeout(function(){f.onError(a)})}},null),setTimeout(function(){f.onSuccess(!0)})},b.prototype.getConversation=function(b,c,d){for(var e=null,f=0,g=a.RongIMClient._memoryStore.conversationList.length;f<g;f++)if(a.RongIMClient._memoryStore.conversationList[f].conversationType==b&&a.RongIMClient._memoryStore.conversationList[f].targetId==c&&(e=a.RongIMClient._memoryStore.conversationList[f],a.RongUtil.supportLocalStorage())){var h=a.RongIMClient._storageProvider.getItem(\"cu\"+a.Bridge._client.userId+b+c);0==e.unreadMessageCount&&(e.unreadMessageCount=Number(h))}return setTimeout(function(){d&&d.onSuccess(e)}),e},b.prototype.filterConversations=function(b,c){var d=[];return a.RongUtil.forEach(b,function(b){a.RongUtil.forEach(c,function(a){a.conversationType==b&&d.push(a)})}),d},b.prototype.getConversationList=function(b,c,d,e){var f=this,g=a.RongIMClient._memoryStore.isSyncRemoteConverList,h=a.RongIMClient._memoryStore.conversationList,i=h.length>d;if(!g&&i)return void setTimeout(function(){var a=h.slice(0,d);c&&(a=f.filterConversations(c,a)),b.onSuccess(a)});a.RongIMClient.getInstance().getRemoteConversationList({onSuccess:function(c){a.RongUtil.supportLocalStorage()&&Array.forEach(a.RongIMClient._memoryStore.conversationList,function(b){var c=a.RongIMClient._storageProvider.getItem(\"cu\"+a.Bridge._client.userId+b.conversationType+b.targetId);0==b.unreadMessageCount&&(b.unreadMessageCount=Number(c))}),a.RongIMClient._memoryStore.isSyncRemoteConverList=!1,setTimeout(function(){b.onSuccess(c)})},onError:function(a){setTimeout(function(){b.onError(a)})}},c,d,e)},b.prototype.clearCache=function(){var b=a.RongIMClient._memoryStore||{};b.conversationList=[],b.isSyncRemoteConverList=!0},b.prototype.clearConversations=function(b,c){Array.forEach(b,function(b){Array.forEach(a.RongIMClient._memoryStore.conversationList,function(c){b==c.conversationType&&a.RongIMClient.getInstance().removeConversation(c.conversationType,c.targetId,{onSuccess:function(){},onError:function(){}})})}),setTimeout(function(){c.onSuccess(!0)})},b.prototype.setMessageContent=function(a,b,c){},b.prototype.getHistoryMessages=function(b,c,d,e,f,g,h){var i={objectname:g,order:h};a.RongIMClient.getInstance().getRemoteHistoryMessages(b,c,d,e,f,i)},b.prototype.getTotalUnreadCount=function(b,c){var d=0,e=a.RongIMClient._storageProvider;if(c)a.RongUtil.forEach(c,function(b){var c=e.getItemKeyList(\"cu\"+a.Bridge._client.userId+b);a.RongUtil.forEach(c,function(a){var b=e.getItem(a),c=Number(b)||0;d+=c})});else{var f=e.getItemKeyList(\"cu\"+a.Bridge._client.userId);a.RongUtil.forEach(f,function(a){var b=e.getItem(a),c=Number(b)||0;d+=c})}b.onSuccess(d)},b.prototype.getConversationUnreadCount=function(b,c){var d=0;Array.forEach(b,function(b){Array.forEach(a.RongIMClient._memoryStore.conversationList,function(a){a.conversationType==b&&(d+=a.unreadMessageCount)})}),setTimeout(function(){c.onSuccess(d)})},b.prototype.setUnreadCount=function(b,c,d){var e=a.RongIMClient._storageProvider,f=\"cu\"+a.Bridge._client.userId+b+c;e.setItem(f,d)},b.prototype.getUnreadCount=function(b,c,d){var e=\"cu\"+a.Bridge._client.userId+b+c,f=a.RongIMClient._storageProvider.getItem(e),g=Number(f);setTimeout(function(){d.onSuccess(g||0)})},b.prototype.cleanMentioneds=function(b){if(b){b.mentionedMsg=null;var c=b.targetId,d=b.conversationType,e=a.RongIMClient._storageProvider.getItem(\"mentioneds_\"+a.Bridge._client.userId+\"_\"+d+\"_\"+c);if(e){var f=JSON.parse(e);delete f[d+\"_\"+c],a.MessageUtil.isEmpty(f)?a.RongIMClient._storageProvider.removeItem(\"mentioneds_\"+a.Bridge._client.userId+\"_\"+d+\"_\"+c):a.RongIMClient._storageProvider.setItem(\"mentioneds_\"+a.Bridge._client.userId+\"_\"+d+\"_\"+c,JSON.stringify(f))}}},b.prototype.clearUnreadCountByTimestamp=function(a,b,c,d){setTimeout(function(){d.onSuccess(!0)})},b.prototype.clearUnreadCount=function(b,c,d){var e=this;a.RongIMClient._storageProvider.removeItem(\"cu\"+a.Bridge._client.userId+b+c),this.getConversation(b,c,{onSuccess:function(a){a&&(a.unreadMessageCount=0,e.cleanMentioneds(a)),setTimeout(function(){d.onSuccess(!0)})},onError:function(a){setTimeout(function(){d.onError(a)})}})},b.prototype.clearTotalUnreadCount=function(b){var c=a.RongIMClient._memoryStore.conversationList,d=this;if(c)for(var e=0;e<c.length;e++){var f=c[e];f&&(f.unreadMessageCount=0,d.cleanMentioneds(f))}var g=a.RongIMClient._storageProvider.getItemKeyList(\"cu\"+a.Bridge._client.userId);a.RongUtil.forEach(g,function(b){a.RongIMClient._storageProvider.removeItem(b)}),setTimeout(function(){b.onSuccess(!0)})},b.prototype.setConversationToTop=function(a,b,c,d){var e=this;this.getConversation(a,b,{onSuccess:function(a){a.isTop=c,e.addConversation(a,d),setTimeout(function(){d.onSuccess(!0)})},onError:function(a){setTimeout(function(){d.onError(a)})}})},b.prototype.getConversationNotificationStatus=function(b,c){var d=b.targetId,e=b.conversationType,f=a.RongIMClient._memoryStore.notification,g=function(){return e+\"_\"+d},h=g(),i=f[h];if(\"number\"==typeof i)return void c.onSuccess(i);var j={1:\"qryPPush\",3:\"qryDPush\"},k=j[e];if(!k){return void c.onError(8001)}var l=new a.RongIMClient.Protobuf.BlockPushInput;l.setBlockeeId(d);var m=a.Bridge._client.userId,n=function(a){f[h]=a,setTimeout(function(){c.onSuccess(a)})};a.RongIMClient.bridge.queryMsg(k,a.MessageUtil.ArrayForm(l.toArrayBuffer()),m,{onSuccess:function(a){n(a)},onError:function(a){1==a?n(a):setTimeout(function(){c.onError(a)})}})},b.prototype.setConversationNotificationStatus=function(b,c){var d=b.conversationType,e=b.targetId,f=b.status,g=function(){return d+\"_\"+f},h={\"1_1\":\"blkPPush\",\"3_1\":\"blkDPush\",\"1_0\":\"unblkPPush\",\"3_0\":\"unblkDPush\"},i=g();a.RongIMClient._memoryStore.notification[i]=f;var j=h[i];if(!j){return void setTimeout(function(){c.onError(8001)})}var k=new a.RongIMClient.Protobuf.BlockPushInput;k.setBlockeeId(e);var l=a.Bridge._client.userId;a.RongIMClient.bridge.queryMsg(j,a.MessageUtil.ArrayForm(k.toArrayBuffer()),l,{onSuccess:function(a){setTimeout(function(){c.onSuccess(a)})},onError:function(a){setTimeout(function(){c.onError(a)})}})},b.prototype.getUserStatus=function(b,c){var d=new a.RongIMClient.Protobuf.GetUserStatusInput;b=a.Bridge._client.userId,a.RongIMClient.bridge.queryMsg(35,a.MessageUtil.ArrayForm(d.toArrayBuffer()),b,{onSuccess:function(b){b=a.RongInnerTools.convertUserStatus(b),setTimeout(function(){c.onSuccess(b)})},onError:function(a){setTimeout(function(){c.onError(a)})}},\"GetUserStatusOutput\")},b.prototype.setUserStatus=function(b,c){var d=new a.RongIMClient.Protobuf.SetUserStatusInput,e=a.Bridge._client.userId;b&&d.setStatus(b),a.RongIMClient.bridge.queryMsg(36,a.MessageUtil.ArrayForm(d.toArrayBuffer()),e,{onSuccess:function(a){setTimeout(function(){c.onSuccess(!0)})},onError:function(a){setTimeout(function(){c.onError(a)})}},\"SetUserStatusOutput\")},b.prototype.subscribeUserStatus=function(b,c){var d=new a.RongIMClient.Protobuf.SubUserStatusInput,e=a.Bridge._client.userId;d.setUserid(b),a.RongIMClient.bridge.queryMsg(37,a.MessageUtil.ArrayForm(d.toArrayBuffer()),e,{onSuccess:function(a){setTimeout(function(){c&&c.onSuccess(!0)})},onError:function(a){setTimeout(function(){c&&c.onError(a)})}},\"SubUserStatusOutput\")},b.prototype.setUserStatusListener=function(b,c){a.RongIMClient.userStatusListener=c;var d=b.userIds||[];d.length&&a.RongIMClient._dataAccessProvider.subscribeUserStatus(d)},b.prototype.clearListeners=function(){},b.prototype.setServerInfo=function(a){},b.prototype.getUnreadMentionedMessages=function(a,b){return null},b.prototype.setConversationHidden=function(a,b,c){},b.prototype.setMessageExtra=function(a,b,c){setTimeout(function(){c.onSuccess(!0)})},b.prototype.setMessageReceivedStatus=function(a,b,c){setTimeout(function(){c.onSuccess(!0)})},b.prototype.setMessageSentStatus=function(a,b,c){setTimeout(function(){c.onSuccess(!0)})},b.prototype.getAllConversations=function(a){setTimeout(function(){a.onSuccess([])})},b.prototype.getConversationByContent=function(a,b){setTimeout(function(){b.onSuccess([])})},b.prototype.getMessagesFromConversation=function(a,b,c,d){setTimeout(function(){d.onSuccess([])})},b.prototype.searchConversationByContent=function(a,b,c){setTimeout(function(){b.onSuccess([])})},b.prototype.searchMessageByContent=function(a,b,c,d,e,f,g){setTimeout(function(){g.onSuccess([])})},b.prototype.getDelaTime=function(){return a.RongIMClient._memoryStore.deltaTime},b.prototype.getCurrentConnectionStatus=function(){var b=a.Bridge._client||{},c=b.channel||{},d=a.ConnectionStatus.CONNECTION_CLOSED;return\"number\"==typeof c.connectionStatus&&(d=c.connectionStatus),d},b.prototype.getAgoraDynamicKey=function(b,c,d){var e=new a.RongIMClient.Protobuf.VoipDynamicInput;e.setEngineType(b),e.setChannelName(c),a.RongIMClient.bridge.queryMsg(32,a.MessageUtil.ArrayForm(e.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(a){setTimeout(function(){d.onSuccess(a)})},onError:function(a){setTimeout(function(){d.onError(a)})}},\"VoipDynamicOutput\")},b.prototype.setDeviceInfo=function(a){},b.prototype.setEnvironment=function(a){},b.prototype.clearData=function(){return!0},b.prototype.getPublicServiceProfile=function(b,c,d){var e=a.RongIMClient._memoryStore.publicServiceMap.get(b,c);setTimeout(function(){d.onSuccess(e)})},b.prototype.getRemotePublicServiceList=function(b,c){if(a.RongIMClient._memoryStore.depend.openMp){var d=new a.RongIMClient.Protobuf.PullMpInput;c?d.setTime(c):d.setTime(0),d.setMpid(\"\"),a.RongIMClient.bridge.queryMsg(28,a.MessageUtil.ArrayForm(d.toArrayBuffer()),a.Bridge._client.userId,{onSuccess:function(c){a.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length=0,a.RongIMClient._memoryStore.publicServiceMap.publicServiceList=c,setTimeout(function(){b&&b.onSuccess(c)})},onError:function(a){setTimeout(function(){b&&b.onError(a)})}},\"PullMpOutput\")}},b.prototype.getRTCUserInfoList=function(b,c){var d=new a.RongIMClient.Protobuf.RtcQueryListInput;d.setOrder(2),a.RongIMClient.bridge.queryMsg(\"rtcUData\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,{onSuccess:function(b){var d={},e=b.list;a.RongUtil.forEach(e,function(b){var c=b.userId,e={};a.RongUtil.forEach(b.userData,function(a){var b=a.key,c=a.value;e[b]=c}),d[c]=e}),c.onSuccess(d)},onError:function(a){c.onError(a)}},\"RtcUserListOutput\")},b.prototype.getRTCUserList=function(b,c){var d=new a.RongIMClient.Protobuf.RtcQueryListInput;d.setOrder(2),a.RongIMClient.bridge.queryMsg(\"rtcUList\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,{onSuccess:function(a){c.onSuccess({users:a.list})},onError:function(a){c.onError(a)}},\"RtcUserListOutput\")},b.prototype.setRTCUserInfo=function(b,c,d){var e=new a.RongIMClient.Protobuf.RtcValueInfo;e.setKey(c.key),e.setValue(c.value),a.RongIMClient.bridge.queryMsg(\"rtcUPut\",a.MessageUtil.ArrayForm(e.toArrayBuffer()),b.id,{onSuccess:function(){d.onSuccess(!0)},onError:function(a){d.onError(a)}})},b.prototype.removeRTCUserInfo=function(b,c,d){var e=new a.RongIMClient.Protobuf.RtcKeyDeleteInput,f=c.keys||[];a.RongUtil.isArray(f)||(f=[f]),e.setKey(f),a.RongIMClient.bridge.queryMsg(\"rtcUDel\",a.MessageUtil.ArrayForm(e.toArrayBuffer()),b.id,{onSuccess:function(){d.onSuccess(!0)},onError:function(a){d.onError(a)}})},b.prototype.getRTCRoomInfo=function(b,c){var d=new a.RongIMClient.Protobuf.RtcQueryListInput;d.setOrder(2),a.RongIMClient.bridge.queryMsg(\"rtcRInfo\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,{onSuccess:function(b){var d={id:b.roomId,total:b.userCount};a.RongUtil.forEach(b.roomData,function(a){d[a.key]=a.value}),c.onSuccess(d)},onError:function(a){c.onError(a)}},\"RtcRoomInfoOutput\")},b.prototype.setRTCRoomInfo=function(b,c,d){var e=new a.RongIMClient.Protobuf.RtcValueInfo;e.setKey(c.key),e.setValue(c.value),a.RongIMClient.bridge.queryMsg(\"rtcRPut\",a.MessageUtil.ArrayForm(e.toArrayBuffer()),b.id,{onSuccess:function(){d.onSuccess(!0)},onError:function(a){d.onError(a)}})},b.prototype.removeRTCRoomInfo=function(b,c,d){var e=new a.RongIMClient.Protobuf.RtcKeyDeleteInput,f=c.keys||[];a.RongUtil.isArray(f)||(f=[f]),e.setKey(f),a.RongIMClient.bridge.queryMsg(\"rtcRDel\",a.MessageUtil.ArrayForm(e.toArrayBuffer()),b.id,{onSuccess:function(){d.onSuccess(!0)},onError:function(a){d.onError(a)}})},b.prototype.joinRTCRoom=function(b,c){var d=new a.RongIMClient.Protobuf.RtcInput;a.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,{onSuccess:function(b){var d={},e=b.list,f=b.token;a.RongUtil.forEach(e,function(b){var c=b.userId,e={};a.RongUtil.forEach(b.userData,function(a){var b=a.key,c=a.value;e[b]=c}),d[c]=e}),c.onSuccess({users:d,token:f})},onError:function(a){c.onError(a)}},\"RtcUserListOutput\")},b.prototype.quitRTCRoom=function(b,c){var d=new a.RongIMClient.Protobuf.SetUserStatusInput;a.RongIMClient.bridge.queryMsg(\"rtcRExit\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,{onSuccess:function(){c.onSuccess(!0)},onError:function(a){c.onError(a)}})},b.prototype.RTCPing=function(b,c){var d=new a.RongIMClient.Protobuf.RtcInput;a.RongIMClient.bridge.queryMsg(\"rtcPing\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,c)},b.prototype.setRTCData=function(b,c,d,e,f,g,h){var i=new a.RongIMClient.Protobuf.RtcSetDataInput;i.setInterior(e),i.setTarget(f),i.setKey(c),i.setValue(d),h=h||{};var j=h.name,k=h.content;j&&i.setObjectName(j),k&&(a.RongUtil.isString(k)||(k=JSON.stringify(k)),i.setContent(k)),a.RongIMClient.bridge.queryMsg(\"rtcSetData\",a.MessageUtil.ArrayForm(i.toArrayBuffer()),b,g,\"RtcOutput\")},b.prototype.getRTCData=function(b,c,d,e,f){var g=new a.RongIMClient.Protobuf.RtcDataInput;g.setInterior(d),g.setTarget(e),g.setKey(c),a.RongIMClient.bridge.queryMsg(\"rtcQryData\",a.MessageUtil.ArrayForm(g.toArrayBuffer()),b,{onSuccess:function(b){var c={},d=b.outInfo;a.RongUtil.forEach(d,function(a){c[a.key]=a.value}),f.onSuccess(c)},onError:f.onError},\"RtcQryOutput\")},b.prototype.removeRTCData=function(b,c,d,e,f,g){var h=new a.RongIMClient.Protobuf.RtcDataInput;h.setInterior(d),h.setTarget(e),h.setKey(c),g=g||{};var i=g.name,j=g.content;i&&h.setObjectName(i),j&&(a.RongUtil.isString(j)||(j=JSON.stringify(j)),h.setContent(j)),a.RongIMClient.bridge.queryMsg(\"rtcDelData\",a.MessageUtil.ArrayForm(h.toArrayBuffer()),b,f,\"RtcOutput\")},b.prototype.setRTCUserData=function(b,c,d,e,f,g){this.setRTCData(b,c,d,e,a.RTCAPIType.PERSON,f,g)},b.prototype.getRTCUserData=function(b,c,d,e,f){this.getRTCData(b,c,d,a.RTCAPIType.PERSON,e)},b.prototype.removeRTCUserData=function(b,c,d,e,f){this.removeRTCData(b,c,d,a.RTCAPIType.PERSON,e,f)},b.prototype.setRTCRoomData=function(b,c,d,e,f,g){this.setRTCData(b,c,d,e,a.RTCAPIType.ROOM,f,g)},b.prototype.getRTCRoomData=function(b,c,d,e,f){this.getRTCData(b,c,d,a.RTCAPIType.ROOM,e)},b.prototype.removeRTCRoomData=function(b,c,d,e,f){this.removeRTCData(b,c,d,a.RTCAPIType.ROOM,e,f)},b.prototype.getNavi=function(){var b=a.RongIMClient._storageProvider.getItem(\"fullnavi\")||\"{}\";return JSON.parse(b)},b.prototype.getRTCToken=function(b,c){var d=new a.RongIMClient.Protobuf.RtcInput;a.RongIMClient.bridge.queryMsg(\"rtcToken\",a.MessageUtil.ArrayForm(d.toArrayBuffer()),b.id,{onSuccess:function(a){c.onSuccess(a)},onError:function(a){c.onError(a)}},\"RtcTokenOutput\")},b}();a.ServerDataProvider=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(a){this.version=\"2.8.27\",this.userId=\"\",this.useConsole=!1,this.appKey=\"\",this.token=\"\",this.addon=a}return b.prototype.init=function(a,b){this.appKey=a,this.useConsole&&console.log(\"init\"),b=b||{},b.version=this.version;var c=this.addon.initWithAppkey(a,b.dbPath,b);return c&&(c=JSON.parse(c)),this.addon.registerMessageType(\"RC:VcMsg\",3),this.addon.registerMessageType(\"RC:ImgTextMsg\",3),this.addon.registerMessageType(\"RC:FileMsg\",3),this.addon.registerMessageType(\"RC:LBSMsg\",3),this.addon.registerMessageType(\"RC:PSImgTxtMsg\",3),this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\",3),this.addon.registerMessageType(\"RCJrmf:RpMsg\",3),this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\",1),this.addon.registerMessageType(\"RC:GrpNtf\",1),this.addon.registerMessageType(\"RC:DizNtf\",0),this.addon.registerMessageType(\"RC:InfoNtf\",0),this.addon.registerMessageType(\"RC:ContactNtf\",0),this.addon.registerMessageType(\"RC:ProfileNtf\",0),this.addon.registerMessageType(\"RC:CmdNtf\",0),this.addon.registerMessageType(\"RC:CmdMsg\",0),this.addon.registerMessageType(\"RC:TypSts\",0),this.addon.registerMessageType(\"RC:CsChaR\",0),this.addon.registerMessageType(\"RC:CsHsR\",0),this.addon.registerMessageType(\"RC:CsEnd\",0),this.addon.registerMessageType(\"RC:CsSp\",0),this.addon.registerMessageType(\"RC:CsUpdate\",0),this.addon.registerMessageType(\"RC:CsContact\",0),this.addon.registerMessageType(\"RC:ReadNtf\",0),this.addon.registerMessageType(\"RC:VCAccept\",0),this.addon.registerMessageType(\"RC:VCRinging\",0),this.addon.registerMessageType(\"RC:VCSummary\",0),this.addon.registerMessageType(\"RC:VCHangup\",0),this.addon.registerMessageType(\"RC:VCInvite\",0),this.addon.registerMessageType(\"RC:VCModifyMedia\",0),this.addon.registerMessageType(\"RC:VCModifyMem\",0),this.addon.registerMessageType(\"RC:PSCmd\",0),this.addon.registerMessageType(\"RC:RcCmd\",0),this.addon.registerMessageType(\"RC:SRSMsg\",0),this.addon.registerMessageType(\"RC:RRReqMsg\",0),this.addon.registerMessageType(\"RC:RRRspMsg\",0),c},b.prototype.connect=function(b,c,d,e){this.useConsole&&console.log(\"connect\"),this.userId=d,this.connectCallback=c,a.Bridge._client={userId:d},e=e||{};var f=!!e.openMp,g=!!e.openUS;e.type&&this.addon.setEnvironment(!0),this.addon.connectWithToken(b,d,e.serverList,f,g)},b.prototype.setServerInfo=function(a){\"setServerInfo\"in this.addon&&this.addon.setServerInfo(a.navi)},b.prototype.logout=function(){this.useConsole&&console.log(\"logout\"),this.disconnect()},b.prototype.disconnect=function(){this.useConsole&&console.log(\"disconnect\"),this.addon.disconnect(!0)},b.prototype.clearListeners=function(){this.addon.setOnReceiveStatusListener(),this.addon.setConnectionStatusListener(),this.addon.setOnReceiveMessageListener()},b.prototype.clearData=function(){return this.useConsole&&console.log(\"clearData\"),this.addon.clearData()},b.prototype.setConnectionStatusListener=function(b){var c=this;c.connectListener=b,this.useConsole&&console.log(\"setConnectionStatusListener\"),c.addon&&c.addon.setConnectionStatusListener(function(d){switch(d){case 10:setTimeout(function(){b.onChanged(a.ConnectionStatus.CONNECTING)});break;case 31004:setTimeout(function(){c.connectCallback.onTokenIncorrect()});break;case 1:case 8:case 9:case 11:case 12:case 31011:case 3e4:case 30002:setTimeout(function(){b.onChanged(a.ConnectionStatus.DISCONNECTED)});break;case 0:case 33005:setTimeout(function(){c.connectCallback.onSuccess(c.userId),b.onChanged(a.ConnectionStatus.CONNECTED)});break;case 6:setTimeout(function(){b.onChanged(a.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT)});break;default:setTimeout(function(){b.onChanged(d)})}})},b.prototype.setOnReceiveMessageListener=function(b){var c=this;c.messageListener=b,this.useConsole&&console.log(\"setOnReceiveMessageListener\"),c.addon&&c.addon.setOnReceiveMessageListener(function(d,e,f,g){var h=c.buildMessage(d);h.offLineMessage=f,setTimeout(function(){[\"AcceptMessage\",\"RingingMessage\",\"HungupMessage\",\"InviteMessage\",\"MediaModifyMessage\",\"MemberModifyMessage\"].indexOf(h.messageType)>-1?a.RongIMClient._voipProvider&&a.RongIMClient._voipProvider.onReceived(h):b.onReceived(h,e,g)})})},b.prototype.sendTypingStatusMessage=function(b,c,d,e){var f=this;this.useConsole&&console.log(\"sendTypingStatusMessage\"),d in a.RongIMClient.MessageParams&&f.sendMessage(b,c,a.TypingStatusMessage.obtain(a.RongIMClient.MessageParams[d].objectName,\"\"),{onSuccess:function(){setTimeout(function(){e.onSuccess()})},onError:function(a){setTimeout(function(){e.onError(a,null)})},onBefore:function(){}})},b.prototype.setMessageStatus=function(a,b,c,d,e){this.addon.updateMessageReceiptStatus(a,b,c),e.onSuccess(!0)},b.prototype.sendTextMessage=function(b,c,d,e){var f=a.TextMessage.obtain(d);this.useConsole&&console.log(\"sendTextMessage\"),this.sendMessage(b,c,f,e)},b.prototype.getRemoteHistoryMessages=function(b,c,d,e,f,g){try{var h=this;h.useConsole&&console.log(\"getRemoteHistoryMessages\"),h.addon.getRemoteHistoryMessages(b,c,d||0,e,function(b,c){var d=b?JSON.parse(b).list:[],e=[];d.reverse();for(var g=0,i=d.length;g<i;g++){var j=h.buildMessage(d[g].obj);j.sentStatus=a.SentStatus.READ,e[g]=j}f.onSuccess(e,!!c)},function(a){f.onError(a)})}catch(i){f.onError(i)}},b.prototype.getRemoteConversationList=function(a,b,c,d){try{this.useConsole&&console.log(\"getRemoteConversationList\");var e=b||[1,2,3,4,5,6,7,8],f=this.addon.getConversationList(e),g=JSON.parse(f).list,h=[],i=this,j=0;g.reverse(),d=\"boolean\"==typeof d&&d;for(var k=0,l=g.length;k<l;k++){var m=g[k].obj,n=JSON.parse(m);if(\"\"!=n){if(1==n.isHidden&&d)continue;h[j]=i.buildConversation(m),j++}}h.reverse();var o=h.length;c=c||o,\no>c&&(h.length=c),a.onSuccess(h)}catch(p){a.onError(p)}},b.prototype.removeConversation=function(b,c,d){try{this.useConsole&&console.log(\"removeConversation\"),this.addon.removeConversation(b,c);for(var e=a.RongIMClient._memoryStore.conversationList,f=e.length,g=0;g<f;g++)if(e[g].conversationType==b&&c==e[g].targetId){e.splice(g,1);break}d.onSuccess(!0)}catch(h){d.onError(h)}},b.prototype.joinChatRoom=function(a,b,c){this.useConsole&&console.log(\"joinChatRoom\"),this.addon.joinChatRoom(a,b,function(){c.onSuccess()},function(a){c.onError(a)})},b.prototype.quitChatRoom=function(a,b){this.useConsole&&console.log(\"quitChatRoom\"),this.addon.quitChatRoom(a,function(){b.onSuccess()},function(a){b.onError(a)})},b.prototype.addToBlacklist=function(a,b){this.useConsole&&console.log(\"addToBlacklist\"),this.addon.addToBlacklist(a,function(){b.onSuccess()},function(a){b.onError(a)})},b.prototype.getBlacklist=function(a){this.useConsole&&console.log(\"getBlacklist\"),this.addon.getBlacklist(function(b){a.onSuccess(b)},function(b){a.onError(b)})},b.prototype.getBlacklistStatus=function(a,b){this.useConsole&&console.log(\"getBlacklistStatus\"),this.addon.getBlacklistStatus(a,function(a){b.onSuccess(a)},function(a){b.onError(a)})},b.prototype.removeFromBlacklist=function(a,b){this.useConsole&&console.log(\"removeFromBlacklist\"),this.addon.removeFromBlacklist(a,function(){b.onSuccess()},function(a){b.onError(a)})},b.prototype.sendMessage=function(b,c,d,e,f,g,h,i,j){var k=this,l=[];k.useConsole&&console.log(\"sendMessage\"),j=j||{};var m=b==a.ConversationType.DISCUSSION||b==a.ConversationType.GROUP;if(m&&d.messageName==a.RongIMClient.MessageType.ReadReceiptResponseMessage){l=[];var n=d;if(n.receiptMessageDic){var o=[];for(var p in n.receiptMessageDic)o.push(p);l=o}}m&&d.messageName==a.RongIMClient.MessageType.SyncReadStatusMessage&&(l=[],l.push(k.userId));var q=j.userIds;m&&q&&(l=q);var r=k.addon.sendMessage(b,c,a.RongIMClient.MessageParams[d.messageName].objectName,d.encode(),g||\"\",h||\"\",function(a){},function(b,c){var d=k.buildMessage(b),f=a.ErrorCode.SENSITIVE_REPLACE;if(c==f)return e.onError(f,d);e.onSuccess(d)},function(a,b){e.onError(b,k.buildMessage(a))},l),s=JSON.parse(r);e.onBefore&&e.onBefore(s.messageId),a.MessageIdHandler.messageId=s.messageId},b.prototype.registerMessageType=function(b,c,d,e,f){this.useConsole&&console.log(\"registerMessageType\"),this.addon.registerMessageType(c,d.getMessageTag(),f);var g=a.ModelUtil.modleCreate(e,b);a.RongIMClient.RegisterMessage[b]=g,a.RongIMClient.RegisterMessage[b].messageName=b,registerMessageTypeMapping[c]=b,a.RongIMClient.MessageType[b]=b,a.RongIMClient.MessageParams[b]={objectName:c,msgTag:d},typeMapping[c]=b},b.prototype.registerMessageTypes=function(b){var c=[],d=function(a){var b=[];for(var c in a)b.push(c);return b};for(var e in b){var f=b[e],g=f.proto,h=d(g),i=f.flag||3,j=a.MessageTag.getTagByStatus(i);i=new a.MessageTag(j.isCounted,j.isPersited),c.push({type:e,name:f.name,flag:i,protos:h})}for(var k=function(b){var c=b.type,d=b.name,e=b.flag,f=b.protos;a.RongIMClient.registerMessageType(c,d,e,f)},l=0,m=c.length;l<m;l++){var f=c[l];k(f)}},b.prototype.addMessage=function(b,c,d,e){this.useConsole&&console.log(\"addMessage\");var f=d.direction,g=this.addon.insertMessage(b,c,d.senderUserId,d.objectName,JSON.stringify(d.content),function(){e.onSuccess(h.buildMessage(g))},function(){e.onError(a.ErrorCode.MSG_INSERT_ERROR)},f),h=this},b.prototype.removeMessage=function(a,b,c,d){},b.prototype.removeLocalMessage=function(a,b,c,d){try{this.useConsole&&console.log(\"removeLocalMessage\"),this.addon.deleteMessages(c),d.onSuccess(!0)}catch(e){d.onError(e)}},b.prototype.getMessage=function(a,b){try{this.useConsole&&console.log(\"getMessage\");var c=this.buildMessage(this.addon.getMessage(a));b.onSuccess(c)}catch(d){b.onError(d)}},b.prototype.clearMessages=function(a,b,c){try{this.useConsole&&console.log(\"clearMessages\"),this.addon.clearMessages(a,b),c.onSuccess(!0)}catch(d){c.onError(d)}},b.prototype.setUnreadCount=function(a,b,c){},b.prototype.getConversation=function(a,b,c){try{this.useConsole&&console.log(\"getConversation\");var d=this.addon.getConversation(a,b);c.onSuccess(this.buildConversation(d))}catch(e){c.onError(e)}},b.prototype.getConversationList=function(a,b,c,d){this.useConsole&&console.log(\"getConversationList\"),this.getRemoteConversationList(a,b,c,d)},b.prototype.clearCache=function(){var b=a.RongIMClient._memoryStore||{};b.conversationList=[],b.isSyncRemoteConverList},b.prototype.clearConversations=function(a,b){try{this.useConsole&&console.log(\"clearConversations\"),this.addon.clearConversations(),b.onSuccess(!0)}catch(c){b.onError(c)}},b.prototype.setMessageContent=function(a,b,c){b=JSON.stringify(b),this.addon.setMessageContent(a,b,c)},b.prototype.getHistoryMessages=function(b,c,d,e,f,g,h){if(this.useConsole&&console.log(\"getHistoryMessages\"),e<=0)return void f.onError(a.ErrorCode.TIMEOUT);g=g||\"\",h=void 0===h||h;try{var i=this.addon.getHistoryMessages(b,c,d||0,e,g,h),j=i?JSON.parse(i).list:[],k=[],l=this;j.reverse();for(var m=0,n=j.length;m<n;m++){var o=l.buildMessage(j[m].obj);k[m]=o}f.onSuccess(k,n==e)}catch(p){f.onError(p)}},b.prototype.clearRemoteHistoryMessages=function(b,c){var d=b.conversationType,e=b.targetId,f=b.timestamp;return{1:!0,2:!0,3:!0,5:!0,6:!0}[d]?\"number\"!=typeof f?void c.onError(a.ErrorCode.CLEAR_HIS_TIME_ERROR):void this.addon.clearRemoteHistoryMessages(+d,e,f,function(){c.onSuccess(!0)},function(b){1==b&&(b=a.ErrorCode.CLEAR_HIS_ERROR),c.onError(b)}):void c.onError(a.ErrorCode.CLEAR_HIS_TYPE_ERROR)},b.prototype.clearHistoryMessages=function(b,c){var d=+b.conversationType,e=b.targetId;try{this.addon.clearMessages(d,e);c.onSuccess(!0)}catch(f){console.log(f),c.onError(a.ErrorCode.CLEAR_HIS_ERROR)}},b.prototype.getTotalUnreadCount=function(a,b){try{var c;this.useConsole&&console.log(\"getTotalUnreadCount\"),c=b?this.addon.getTotalUnreadCount(b):this.addon.getTotalUnreadCount(),a.onSuccess(c)}catch(d){a.onError(d)}},b.prototype.getConversationUnreadCount=function(a,b){this.useConsole&&console.log(\"getConversationUnreadCount\"),this.getTotalUnreadCount(b,a)},b.prototype.getUnreadCount=function(a,b,c){try{this.useConsole&&console.log(\"getUnreadCount\");var d=this.addon.getUnreadCount(a,b);c.onSuccess(d)}catch(e){c.onError(e)}},b.prototype.clearUnreadCount=function(a,b,c){try{this.useConsole&&console.log(\"clearUnreadCount\");this.addon.clearUnreadCount(a,b);c.onSuccess(!0)}catch(d){c.onError(d)}},b.prototype.clearTotalUnreadCount=function(a){this.useConsole&&console.log(\"clearTotalUnreadCount\")},b.prototype.clearUnreadCountByTimestamp=function(a,b,c,d){try{this.useConsole&&console.log(\"clearUnreadCountByTimestamp\");this.addon.clearUnreadCountByTimestamp(a,b,c);d.onSuccess(!0)}catch(e){d.onError(e)}},b.prototype.setConversationToTop=function(a,b,c,d){try{this.useConsole&&console.log(\"setConversationToTop\"),this.addon.setConversationToTop(a,b,c),d.onSuccess(!0)}catch(e){d.onError(e)}},b.prototype.setConversationHidden=function(a,b,c){this.addon.setConversationHidden(a,b,c)},b.prototype.setMessageReceivedStatus=function(a,b,c){try{this.useConsole&&console.log(\"setMessageReceivedStatus\"),this.addon.setMessageReceivedStatus(a,b),c.onSuccess(!0)}catch(d){c.onError(d)}},b.prototype.setMessageSentStatus=function(a,b,c){try{this.useConsole&&console.log(\"setMessageSentStatus\"),this.addon.setMessageSentStatus(a,b),c.onSuccess(!0)}catch(d){c.onError(d)}},b.prototype.getFileToken=function(a,b){this.useConsole&&console.log(\"getFileToken\"),this.addon.getUploadToken(a,function(a){b.onSuccess({token:a})},function(a){b.onError(a)})},b.prototype.getFileUrl=function(a,b,c,d){this.useConsole&&console.log(\"getFileUrl\"),this.addon.getDownloadUrl(a,b,c,function(a){d.onSuccess({downloadUrl:a})},function(a){d.onError(a)})},b.prototype.searchConversationByContent=function(a,b,c){var d=[];d=void 0===c?[1,2,3,4,5,6,7]:c;try{this.useConsole&&console.log(\"searchConversationByContent\");var e=this.addon.searchConversationByContent(d,a),f=JSON.parse(e).list,g=[],h=this;f.reverse();for(var i=0,j=f.length;i<j;i++)g[i]=h.buildConversation(f[i].obj);b.onSuccess(g)}catch(k){b.onError(k)}},b.prototype.searchMessageByContent=function(a,b,c,d,e,f,g){var h=this;try{this.useConsole&&console.log(\"searchMessageByContent\"),this.addon.searchMessageByContent(a,b,c,d,e,f,function(a,b){var c=a?JSON.parse(a).list:[],d=[];c.reverse();for(var e=0,f=c.length;e<f;e++)d[e]=h.buildMessage(c[e].obj);g.onSuccess(d,b)})}catch(i){g.onError(i)}},b.prototype.getChatRoomInfo=function(a,b,c,d){this.useConsole&&console.log(\"getChatRoomInfo\"),this.addon.getChatroomInfo(a,b,c,function(a,b){var c=a?JSON.parse(a).list:[],e={userInfos:[],userTotalNums:b};if(c.length>0)for(var f=0,g=c.length;f<g;f++)e.userInfos.push(JSON.parse(c[f].obj));d.onSuccess(e)},function(a){d.onError(a)})},b.prototype.setChatroomHisMessageTimestamp=function(a,b){},b.prototype.getChatRoomHistoryMessages=function(a,b,c,d){},b.prototype.getDelaTime=function(){return this.addon.getDeltaTime()},b.prototype.getUserStatus=function(b,c){this.addon.getUserStatus(b,function(b){var d=a.RongInnerTools.convertUserStatus({status:b,userId:\"\"});c.onSuccess(d)},function(a){c.onError(a)})},b.prototype.setUserStatus=function(a,b){this.addon.setUserStatus(a,function(){b.onSuccess(!0)},function(a){b.onError(a)})},b.prototype.subscribeUserStatus=function(a,b){this.addon.subscribeUserStatus(a,function(){b&&b.onSuccess(!0)},function(a){b&&b.onError(a)})},b.prototype.setUserStatusListener=function(b,c){this.addon.setOnReceiveStatusListener(function(b,c){var d=a.RongInnerTools.convertUserStatus({userId:b,status:c});a.RongIMClient.userStatusObserver.notify({key:b,entity:d})});var d=b.userIds||[];d.length&&a.RongIMClient._dataAccessProvider.subscribeUserStatus(d)},b.prototype.getUnreadMentionedMessages=function(a,b){for(var c=this,d=JSON.parse(c.addon.getUnreadMentionedMessages(a,b)).list,e=0,f=d.length;e<f;e++){var g=JSON.parse(d[e].obj);g.content=JSON.parse(g.content),d[e]=g}return d},b.prototype.hasRemoteUnreadMessages=function(a,b){b.onSuccess(!1)},b.prototype.sendRecallMessage=function(a,b){var c=this;c.addon.recallMessage(\"RC:RcCmd\",JSON.stringify(a),a.push||\"\",function(){a.objectName=\"RC:RcCmd\",b.onSuccess(c.buildMessage(JSON.stringify(a)))},function(a){b.onError(a)})},b.prototype.updateMessage=function(a,b){},b.prototype.updateMessages=function(a,b,c,d,e){},b.prototype.reconnect=function(a){},b.prototype.sendReceiptResponse=function(a,b,c){},b.prototype.setMessageExtra=function(a,b,c){},b.prototype.addMemberToDiscussion=function(a,b,c){},b.prototype.createDiscussion=function(a,b,c){},b.prototype.getDiscussion=function(a,b){},b.prototype.quitDiscussion=function(a,b){},b.prototype.removeMemberFromDiscussion=function(a,b,c){},b.prototype.setDiscussionInviteStatus=function(a,b,c){},b.prototype.setDiscussionName=function(a,b,c){},b.prototype.setEnvironment=function(a){this.addon.setEnvironment(a)},b.prototype.addConversation=function(a,b){},b.prototype.updateConversation=function(a){return null},b.prototype.getConversationNotificationStatus=function(b,c){var d=b.conversationType,e=b.targetId,f=a.RongIMClient._memoryStore.notification,g=d+\"_\"+e,h=f[g];if(\"number\"==typeof h)return void c.onSuccess(h);this.addon.getConversationNotificationStatus(d,e,function(a){f[g]=a,c.onSuccess(a)},function(a){c.onError(a)})},b.prototype.setConversationNotificationStatus=function(b,c){var d=b.conversationType,e=b.targetId,f=b.status;a.RongIMClient._memoryStore.notification[d+\"_\"+e]=f;var g=!!f;this.addon.setConversationNotificationStatus(d,e,g,function(){c.onSuccess(f)},function(a){c.onError(a)})},b.prototype.getCurrentConnectionStatus=function(){return this.addon.getConnectionStatus()},b.prototype.getAgoraDynamicKey=function(a,b,c){this.addon.getVoIPKey(a,b,\"\",function(a){c.onSuccess(a)},function(a){c.onError(a)})},b.prototype.getPublicServiceProfile=function(b,c,d){var e=a.RongIMClient._memoryStore.publicServiceMap.get(b,c);d.onSuccess(e)},b.prototype.setDeviceInfo=function(a){var b=a.id||\"\";this.addon.setDeviceId(b)},b.prototype.getRemotePublicServiceList=function(b,c){var d=[],e=this.addon.getAccounts(),f=function(a){var b={hasFollowed:!1,isGlobal:!1,menu:null};if(!a.obj){var c={error:a};throw new Error(\"公众账号数据格式错误: \"+JSON.stringify(c))}var d=JSON.parse(a.obj),e={aType:\"conversationType\",aId:\"publicServiceId\",aName:\"introduction\",aUri:\"portraitUri\",follow:\"hasFollowed\",isGlobal:\"isGlobal\"};for(var f in d){var g=d[f];if(\"aExtra\"==f){var h=JSON.parse(g);b.hasFollowed=h.follow,b.isGlobal=h.isGlobal,b.menu=h.menu}var i=e[f];i&&(b[i]=g)}return b};if(e){e=JSON.parse(e);for(var g=e.list,h=0,i=g.length;h<i;h++){var j=g[h];j=f(j),d.push(j)}}d.length>0&&(a.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length=0,a.RongIMClient._memoryStore.publicServiceMap.publicServiceList=d),b.onSuccess(a.RongIMClient._memoryStore.publicServiceMap.publicServiceList)},b.prototype.buildMessage=function(b){var c=new a.Message,d=JSON.parse(b);c.conversationType=d.conversationType,c.targetId=d.targetId,c.messageDirection=d.direction,c.senderUserId=d.senderUserId,d.direction==a.MessageDirection.RECEIVE?c.receivedStatus=d.status:d.direction==a.MessageDirection.SEND&&(c.sentStatus=d.status),c.sentTime=d.sentTime,c.objectName=d.objectName;var e=d.content?JSON.parse(d.content):d.content,f=typeMapping[d.objectName]||registerMessageTypeMapping[d.objectName];return e&&(e.messageName=f),c.content=e,c.messageId=d.messageId,c.messageUId=d.messageUid,c.messageType=f,c},b.prototype.buildConversation=function(b){if(\"\"===b)return null;var c=new a.Conversation,d=JSON.parse(b),e=d.lastestMsg?this.buildMessage(d.lastestMsg):{};c.conversationTitle=d.title,c.conversationType=d.conversationType,c.draft=d.draft,c.isTop=d.isTop,c.isHidden=d.isHidden,e.conversationType=d.conversationType,e.targetId=d.targetId,c.latestMessage=e,c.latestMessageId=e.messageId,c.latestMessage.messageType=typeMapping[e.objectName]||registerMessageTypeMapping[e.objectName],c.objectName=e.objectName,c.receivedStatus=a.ReceivedStatus.READ,c.sentTime=e.sentTime,c.senderUserId=e.senderUserId,c.sentStatus=e.status,c.targetId=d.targetId,c.unreadMessageCount=d.unreadCount,c.hasUnreadMention=d.m_hasUnreadMention;var f=this.getUnreadMentionedMessages(d.conversationType,d.targetId);if(f.length>0){var g=f.pop();c.mentionedMsg={uid:g.messageUid,time:g.sentTime,mentionedInfo:g.content.mentionedInfo,sendUserId:g.senderUserId}}return c},b.prototype.getRTCUserInfoList=function(a,b){},b.prototype.setRTCUserInfo=function(a,b,c){},b.prototype.removeRTCUserInfo=function(a,b,c){},b.prototype.getRTCUserList=function(a,b){},b.prototype.getRTCRoomInfo=function(a,b){},b.prototype.setRTCRoomInfo=function(a,b,c){},b.prototype.removeRTCRoomInfo=function(a,b,c){},b.prototype.joinRTCRoom=function(a,b){},b.prototype.quitRTCRoom=function(a,b){},b.prototype.RTCPing=function(a,b){},b.prototype.setRTCUserData=function(a,b,c,d,e,f){},b.prototype.getRTCUserData=function(a,b,c,d,e){},b.prototype.removeRTCUserData=function(a,b,c,d,e){},b.prototype.setRTCRoomData=function(a,b,c,d,e,f){},b.prototype.getRTCRoomData=function(a,b,c,d,e){},b.prototype.removeRTCRoomData=function(a,b,c,d,e){},b.prototype.getNavi=function(){},b.prototype.getRTCToken=function(a,b){},b}();a.VCDataProvider=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function a(){this._memeoryStore={},this.prefix=\"rong_\"}return a.prototype.setItem=function(a,b){this._memeoryStore[a]=decodeURIComponent(b)},a.prototype.getItem=function(a){return this._memeoryStore[a]},a.prototype.removeItem=function(a){this.getItem(a)&&delete this._memeoryStore[a]},a.prototype.getItemKey=function(a){var b=this,c=null,d=new RegExp(a+\"\\\\w+\");for(var e in b._memeoryStore){e.match(d)&&(c=e)}return c},a.prototype.getItemKeyList=function(a){var b=this.prefix,c=this,d=[],e=new RegExp(a+\"\\\\w+\");for(var f in c._memeoryStore){f.match(e)&&(f=f.substring(b.length),d.push(f))}return d},a.prototype.clearItem=function(){var a=this;for(var b in a._memeoryStore)delete a._memeoryStore[b]},a.prototype.onOutOfQuota=function(){return 4096},a}();a.MemeoryProvider=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(){this.prefix=\"rong_\",this._host=\"\";var b=new Date,c=b.getMonth()+1,d=b.getFullYear()+\"/\"+(1==c.toString().length?\"0\"+c:c)+\"/\"+b.getDate(),e=new Date(d).getTime();for(var f in localStorage){if(f.lastIndexOf(\"RECEIVED\")>-1){var g=JSON.parse(localStorage.getItem(f));for(var h in g)e-g[h].dealtime>0&&delete g[h];a.RongUtil.isEmpty(g)?localStorage.removeItem(f):localStorage.setItem(f,JSON.stringify(g))}if(f.lastIndexOf(\"SENT\")>-1){e-JSON.parse(localStorage.getItem(f)).dealtime>0&&localStorage.removeItem(f)}}}return b.prototype.setItem=function(a,b){a&&(-1==a.indexOf(this.prefix)&&(a=this.prefix+a),localStorage.setItem(a,b))},b.prototype.getItem=function(a){return a?(-1==a.indexOf(this.prefix)&&(a=this.prefix+a),localStorage.getItem(a||\"\")):\"\"},b.prototype.getItemKey=function(a){var b=\"\",c=this.prefix+a;for(var d in localStorage)if(0==d.indexOf(c)){b=d;break}return b},b.prototype.getItemKeyList=function(a){var b=[],c=this.prefix,d=c+a;for(var e in localStorage)0==e.indexOf(d)&&(e=e.substring(c.length),b.push(e));return b},b.prototype.removeItem=function(a){a&&(-1==a.indexOf(this.prefix)&&(a=this.prefix+a),localStorage.removeItem(a.toString()))},b.prototype.clearItem=function(){var a=this;for(var b in localStorage)b.indexOf(a.prefix)>-1&&a.removeItem(b)},b.prototype.onOutOfQuota=function(){return JSON.stringify(localStorage).length},b}();a.LocalStorageProvider=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function a(){this.opersistName=\"RongIMLib\",this.keyManager=\"RongUserDataKeyManager\",this._host=\"\",this.prefix=\"rong_\",this.oPersist=document.createElement(\"div\"),this.oPersist.style.display=\"none\",this.oPersist.style.behavior=\"url('#default#userData')\",document.body.appendChild(this.oPersist),this.oPersist.load(this.opersistName)}return a.prototype.setItem=function(a,b){a&&-1==a.indexOf(this.prefix)&&(a=this.prefix+a),this.oPersist.setAttribute(a,b);var c=this.getItem(this.keyManager);c?-1==c.indexOf(a)&&(c+=\",\"+a):c=a,this.oPersist.setAttribute(this.prefix+this.keyManager,c),this.oPersist.save(this.opersistName)},a.prototype.getItem=function(a){return a&&-1==a.indexOf(this.prefix)&&(a=this.prefix+a),a?this.oPersist.getAttribute(a):a},a.prototype.removeItem=function(a){a&&-1==a.indexOf(this.prefix)&&(a=this.prefix+a),this.oPersist.removeAttribute(a),this.oPersist.save(this.opersistName);for(var b=this.getItem(this.keyManager),c=b&&b.split(\",\")||[],d=0,e=c.length;d<e;d++)c[d]==a&&c.splice(d,1);this.oPersist.setAttribute(this.prefix+this.keyManager,c.join(\",\")),this.oPersist.save(this.opersistName)},a.prototype.getItemKey=function(a){var b=null,c=this.getItem(this.keyManager),d=c&&c.split(\",\")||[],e=this.prefix+a;if(d.length)for(var f=0,g=d.length;f<g;f++)if(d[f]&&0==d[f].indexOf(e)){b=d[f];break}return b},a.prototype.getItemKeyList=function(a){var b=[],c=this.getItem(this.keyManager),d=c&&c.split(\",\")||[],e=this.prefix,f=e+a;if(d.length)for(var g=0,h=d.length;g<h;g++)if(d[g]&&0==d[g].indexOf(f)){var i=d[g];i=i.substring(e.length),b.push(d[g])}return b},a.prototype.clearItem=function(){var a=this.getItem(this.keyManager),b=[],c=this;if(a&&(b=a.split(\",\")),b.length){for(var d=0,e=b.length;d<e;d++)b[d]&&c.removeItem(b[d]);c.removeItem(c.keyManager)}},a.prototype.onOutOfQuota=function(){return 10485760},a}();a.UserDataProvider=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){var b=function(){function b(b){if(this.script=document.createElement(\"script\"),this.head=document.getElementsByTagName(\"head\")[0],\"WebSocket\"in window&&\"ArrayBuffer\"in window&&3===WebSocket.prototype.CLOSED&&!a.RongIMClient._memoryStore.depend.isPolling){if(a.Transportations._TransportType=a.Socket.WEBSOCKET,!a.RongIMClient.Protobuf){var c=a.RongIMClient._memoryStore.depend.protobuf,d=this.script;d.src=c,this.head.appendChild(d),d.onload=d.onreadystatechange=function(){if(!(this.readyState&&\"loaded\"!=this.readyState&&\"complete\"!=this.readyState||(d.onload=d.onreadystatechange=null,b&&b(),b))){var c=a.RongIMClient._memoryStore.token,e=a.RongIMClient._memoryStore.callback;c&&a.RongIMClient.connect(c,e)}}}}else a.Transportations._TransportType=\"xhr-polling\",a.RongIMClient.Protobuf=Polling}return b}();a.FeatureDectector=b}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(RongIMLib){var FeaturePatcher=function(){function FeaturePatcher(){}return FeaturePatcher.prototype.patchAll=function(){this.patchJSON(),this.patchForEach()},FeaturePatcher.prototype.patchForEach=function(){Array.forEach||(Array.forEach=function(a,b){for(var c=0;c<a.length;c++)b.call(a,a[c],c,a)})},FeaturePatcher.prototype.patchJSON=function(){window.JSON||(window.JSON=function(){function JSON(){}return JSON.parse=function(sJSON){return eval(\"(\"+sJSON+\")\")},JSON.stringify=function(a){return this.str(\"\",{\"\":a})},JSON.str=function(a,b){var c,d,e,f,g,h=b[a],i=this;switch(h&&\"object\"==typeof h&&\"function\"==typeof h.toJSON&&(h=h.toJSON(a)),typeof h){case\"string\":return i.quote(h);case\"number\":return isFinite(h)?String(h):\"null\";case\"boolean\":case\"null\":return String(h);case\"object\":if(!h)return\"null\";if(g=[],\"[object Array]\"===Object.prototype.toString.apply(h)){for(f=h.length,c=0;c<f;c+=1)g[c]=i.str(c,h)||\"null\";return e=0===g.length?\"[]\":\"[\"+g.join(\",\")+\"]\"}for(d in h)Object.prototype.hasOwnProperty.call(h,d)&&(e=i.str(d,h))&&g.push(i.quote(d)+\":\"+e);return e=0===g.length?\"{}\":\"{\"+g.join(\",\")+\"}\"}},JSON.quote=function(a){var b=this;return b.rx_escapable.lastIndex=0,b.rx_escapable.test(a)?'\"'+a.replace(b.rx_escapable,function(a){var c=b.meta[a];return\"string\"==typeof c?c:\"\\\\u\"+(\"0000\"+a.charCodeAt(0).toString(16)).slice(-4)})+'\"':'\"'+a+'\"'},JSON.rx_escapable=new RegExp('[\\\\\"\\\\\\\\\"\\0-\u001f-­؀-؄܏឴឵‌-‏\\u2028- ⁠-⁯\\ufeff￰-￿]',\"g\"),JSON.meta={\"\\b\":\"\\\\b\",\"\\t\":\"\\\\t\",\"\\n\":\"\\\\n\",\"\\f\":\"\\\\f\",\"\\r\":\"\\\\r\",'\"':'\\\\\"',\"''\":\"\\\\''\",\"\\\\\":\"\\\\\\\\\"},JSON}())},FeaturePatcher}();RongIMLib.FeaturePatcher=FeaturePatcher}(RongIMLib||(RongIMLib={}));var RongIMLib;!function(a){!function(){function a(){}a.prototype.load=function(a,b,c){var d=document.createElement(\"script\");d.async=!0,b&&(d.addEventListener?d.addEventListener(\"load\",function(a){var c=a.target||a.srcElement;b(c.src)},!1):d.readyState&&(d.onreadystatechange=function(a){var c=a.srcElement;b(c.src)})),c&&(d.onerror=function(a){var b=a.target||a.srcElement;c(b.src)}),(document.head||document.getElementsByTagName(\"head\")[0]).appendChild(d),d.src=a}}()}(RongIMLib||(RongIMLib={}));var RongIMLib;return function(a){var b=function(){function a(){this.publicServiceList=[]}return a.prototype.get=function(a,b){for(var c=0,d=this.publicServiceList.length;c<d;c++)if(this.publicServiceList[c].conversationType==a&&b==this.publicServiceList[c].publicServiceId)return this.publicServiceList[c]},a.prototype.add=function(a){for(var b=!0,c=this,d=0,e=this.publicServiceList.length;d<e;d++)if(c.publicServiceList[d].conversationType==a.conversationType&&a.publicServiceId==c.publicServiceList[d].publicServiceId){this.publicServiceList.unshift(this.publicServiceList.splice(d,1)[0]),b=!1;break}b&&this.publicServiceList.unshift(a)},a.prototype.replace=function(a){for(var b=this,c=0,d=this.publicServiceList.length;c<d;c++)if(b.publicServiceList[c].conversationType==a.conversationType&&a.publicServiceId==b.publicServiceList[c].publicServiceId){b.publicServiceList.splice(c,1,a);break}},a.prototype.remove=function(a,b){for(var c=this,d=0,e=this.publicServiceList.length;d<e;d++)if(c.publicServiceList[d].conversationType==a&&b==c.publicServiceList[d].publicServiceId){this.publicServiceList.splice(d,1);break}},a}();a.PublicServiceMap=b;var c=function(){function a(){this.conversationList=[]}return a.prototype.get=function(a,b){for(var c=0,d=this.conversationList.length;c<d;c++)if(this.conversationList[c].conversationType==a&&this.conversationList[c].targetId==b)return this.conversationList[c];return null},a.prototype.add=function(a){for(var b=!0,c=0,d=this.conversationList.length;c<d;c++)if(this.conversationList[c].conversationType===a.conversationType&&this.conversationList[c].targetId===a.targetId){this.conversationList.unshift(this.conversationList.splice(c,1)[0]),b=!1;break}b&&this.conversationList.unshift(a)},a.prototype.replace=function(a){for(var b=0,c=this.conversationList.length;b<c;b++)if(this.conversationList[b].conversationType===a.conversationType&&this.conversationList[b].targetId===a.targetId){this.conversationList.splice(b,1,a);break}},a.prototype.remove=function(a){for(var b=0,c=this.conversationList.length;b<c;b++)if(this.conversationList[b].conversationType===a.conversationType&&this.conversationList[b].targetId===a.targetId){this.conversationList.splice(b,1);break}},a}();a.ConversationMap=c;var d=function(){function b(){}return b.getInstance=function(){return b._instance||(b._instance=new b),b._instance},b.prototype.logger=function(b,c,d){a.RongIMClient.logger({code:b,funcName:c,msg:d})},b.prototype.check=function(b,c,d,e){if(a.RongIMClient._dataAccessProvider||d){for(var f=0,g=e.length;f<g;f++)if(!new RegExp(this.getType(e[f])).test(b[f])){var h=\"第\"+(f+1)+\"个参数错误, 错误类型：\"+this.getType(e[f])+\" [\"+b[f]+\"] -> 位置:\"+c;this.logger(\"-3\",c,h)}}else{var h=\"该参数不正确或尚未实例化RongIMClient -> 位置:\"+c;this.logger(\"-4\",c,h)}},b.prototype.getType=function(a){var b=Object.prototype.toString.call(a).toLowerCase();return b.slice(8,b.length-1)},b.prototype.checkCookieDisable=function(){document.cookie=\"checkCookie=1\";var a=document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")),b=!1;return a||(b=!0),document.cookie=\"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\",b},b}();a.CheckParam=d;var e=function(){function a(a){this.map={},this.keys=[],this.limit=a||10}return a.prototype.set=function(a,b){this.map[a]=b},a.prototype.get=function(a){return this.map[a]||0},a.prototype.remove=function(a){delete this.map[a]},a}();a.LimitableMap=e;var f=function(){function a(){this.cache={}}return a.prototype.set=function(a,b){this.cache[a]=b},a.prototype.get=function(a){return this.cache[a]},a.prototype.remove=function(a){delete this.cache[a]},a}();a.MemoryCache=f;var g=function(){function a(a){var b=this;b.xmlhttp=null,b.options=a;var c=\"undefined\"!=typeof XMLHttpRequest&&\"withCredentials\"in new XMLHttpRequest;\"undefined\"!=typeof XMLHttpRequest&&c?b.xmlhttp=new XMLHttpRequest:\"undefined\"!=typeof XDomainRequest?b.xmlhttp=new XDomainRequest:b.xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\")}return a.prototype.send=function(a){var b=this;b.options.url||(b.options.url=\"http://upload.qiniu.com/putb64/-1\"),b.xmlhttp.onreadystatechange=function(){4==b.xmlhttp.readyState&&(b.options.type?a():a(JSON.parse(b.xmlhttp.responseText.replace(/'/g,'\"'))))},b.xmlhttp.open(\"POST\",b.options.url,!0),b.xmlhttp.withCredentials=!1,\"setRequestHeader\"in b.xmlhttp&&(b.options.type?b.xmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded; charset=utf-8\"):(b.xmlhttp.setRequestHeader(\"Content-type\",\"application/octet-stream\"),b.xmlhttp.setRequestHeader(\"Authorization\",\"UpToken \"+b.options.token))),b.xmlhttp.send(b.options.type?\"appKey=\"+b.options.appKey+\"&deviceId=\"+b.options.deviceId+\"&timestamp=\"+b.options.timestamp+\"&deviceInfo=\"+b.options.deviceInfo+\"&privateInfo=\"+JSON.stringify(b.options.privateInfo):b.options.base64)},a}();a.RongAjax=g;var h=function(){function a(){}return a.noop=function(){},a.isEmpty=function(a){var b=!0;for(var c in a){b=!1;break}return b},a.MD5=function(a,b,c){return md5(a,b,c)},a.isObject=function(a){return\"[object Object]\"==Object.prototype.toString.call(a)},a.isArray=function(a){return\"[object Array]\"==Object.prototype.toString.call(a)},a.isString=function(a){return\"[object String]\"==Object.prototype.toString.call(a)},a.isFunction=function(a){return\"[object Function]\"==Object.prototype.toString.call(a)},a.stringFormat=function(a,b){for(var c=0,d=b.length;c<d;c++){var e=b[c],f=new RegExp(\"\\\\{\"+c+\"\\\\}\",\"g\");a=a.replace(f,e)}return a},a.tplEngine=function(a,b,c){function d(b){return a.replace(c||/{([^}]+)}/g,function(a,c){return\"\\\\\"==a.charAt(0)?a.slice(1):void 0!=b[c]?b[c]:\"{\"+c+\"}\"})}\"[object Array]\"!==Object.prototype.toString.call(b)&&(b=[b]);for(var e=[],f=0,g=b.length;f<g;f++)e.push(d(b[f]));return e.join(\"\")},a.forEach=function(b,c){c=c||a.noop;var d=function(){for(var a in b)b.hasOwnProperty(a)&&c(b[a],a,b)},e=function(){for(var a=0,d=b.length;a<d;a++)c(b[a],a)};a.isObject(b)&&d(),a.isArray(b)&&e()},a.extend=function(b,c,d,e){return a.forEach(b,function(a,b){var d=b in c;e&&d&&(c[b]=a),d||(c[b]=a)}),c},a.createXHR=function(){var a={XMLHttpRequest:function(){return new XMLHttpRequest},XDomainRequest:function(){return new XDomainRequest},ActiveXObject:function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}},b=\"function\"==typeof XMLHttpRequest,c=\"function\"==typeof XDomainRequest;return a[b?\"XMLHttpRequest\":c?\"XDomainRequest\":\"ActiveXObject\"]()},a.request=function(b){var c=b.url,d=b.success,e=b.error,f=b.method||\"GET\",g=a.createXHR();g.onreadystatechange=function(){4==g.readyState&&(200==g.status?d():e())},g.open(f,c,!0),g.send(null)},a.formatProtoclPath=function(b){var c=b.path,d=b.protocol,e=b.tmpl||\"{0}{1}\",f=b.sub,g=\"://\",h=c.indexOf(g);(h>-1&&(h+=g.length,c=c.substring(h)),f)&&((h=c.indexOf(\"/\"))>-1&&(c=c.substr(0,h)));return a.stringFormat(e,[d,c])},a.supportLocalStorage=function(){var a=!1;if(\"object\"==typeof localStorage)try{var b=\"RC_TMP_KEY\",c=\"RC_TMP_VAL\";localStorage.setItem(b,c);localStorage.getItem(b)==c&&(a=!0)}catch(d){console.log(\"localStorage is disabled.\")}return a},a.rename=function(b,c){var d=a.isObject(b);d&&(b=[b]),b=JSON.parse(JSON.stringify(b));var e=function(a,b,d){delete d[b],b=c[b],d[b]=a};return a.forEach(b,function(b){a.forEach(b,function(b,d,f){(d in c?e:a.noop)(b,d,f)})}),d?b[0]:b},a.some=function(a,b){for(var c=!1,d=0,e=a.length;d<e;d++)if(b(a[d])){c=!0;break}return c},a.keys=function(a){var b=[];for(var c in a)b.push(c);return b},a.isNumber=function(a){return\"[object Number]\"==Object.prototype.toString.call(a)},a.getTimestamp=function(){return(new Date).getTime()},a}();a.RongUtil=h;var i=function(){function a(){this.watchers={}}return a.prototype.genUId=function(a){return[a,(new Date).getTime()].join(\"_\")},a.prototype.watch=function(a){var b=this,c=a.key,d=a.multiple;c=h.isArray(c)?c:[c];var e=a.func;h.forEach(c,function(a){a=d?b.genUId(a):a,b.watchers[a]=e})},a.prototype.notify=function(a){var b=this,c=a.key,d=a.entity;for(var e in b.watchers){0==e.indexOf(c)&&b.watchers[e](d)}},a.prototype.remove=function(){},a}();a.RongObserver=i;var j=function(){function a(a){this.timeout=0,this.timer=null,this.timeout=a.timeout}return a.prototype.resume=function(a){this.timer=setTimeout(a,this.timeout)},a.prototype.pause=function(){clearTimeout(this.timer)},a}();a.Timer=j;var k=function(){function a(){}return a.getUId=function(a){return md5(a).slice(8,16)},a}();a.InnerUtil=k}(RongIMLib||(RongIMLib={})),RongIMLib});\n\n/***/ }),\n\n/***/ \"./src/assets/js/protobuf-2.3.4.min.js\":\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(process) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(c,d){if(true){!(__WEBPACK_AMD_DEFINE_FACTORY__ = (d),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}else{if(typeof require===\"function\"&&typeof module===\"object\"&&module&&module.exports){module.exports=d(true)}else{c.RongIMLib=c.RongIMLib||{RongIMClient:{}};c.RongIMLib.RongIMClient.Protobuf=d()}}})(this,function(a){var d=(function(){function E(an,ap,ao){this.low=an|0;this.high=ap|0;this.unsigned=!!ao}E.prototype.__isLong__;Object.defineProperty(E.prototype,\"__isLong__\",{value:true,enumerable:false,configurable:false});function k(an){return(an&&an.__isLong__)===true}E.isLong=k;var aa={};var M={};function ah(ap,ao){var aq,ar,an;if(ao){ap>>>=0;if(an=(0<=ap&&ap<256)){ar=M[ap];if(ar){return ar}}aq=S(ap,(ap|0)<0?-1:0,true);if(an){M[ap]=aq}return aq}else{ap|=0;if(an=(-128<=ap&&ap<128)){ar=aa[ap];if(ar){return ar}}aq=S(ap,ap<0?-1:0,false);if(an){aa[ap]=aq}return aq}}E.fromInt=ah;function q(ao,an){if(isNaN(ao)||!isFinite(ao)){return an?m:F}if(an){if(ao<0){return m}if(ao>=h){return D}}else{if(ao<=-C){return T}if(ao+1>=C){return b}}if(ao<0){return q(-ao,an).neg()}return S((ao%i)|0,(ao/i)|0,an)}E.fromNumber=q;function S(an,ap,ao){return new E(an,ap,ao)}E.fromBits=S;var B=Math.pow;function L(ar,ap,at){if(ar.length===0){throw Error(\"empty string\")}if(ar===\"NaN\"||ar===\"Infinity\"||ar===\"+Infinity\"||ar===\"-Infinity\"){return F}if(typeof ap===\"number\"){at=ap,ap=false}else{ap=!!ap}at=at||10;if(at<2||36<at){throw RangeError(\"radix\")}var ao;if((ao=ar.indexOf(\"-\"))>0){throw Error(\"interior hyphen\")}else{if(ao===0){return L(ar.substring(1),ap,at).neg()}}var av=q(B(at,8));var ax=F;for(var aq=0;aq<ar.length;aq+=8){var aw=Math.min(8,ar.length-aq),au=parseInt(ar.substring(aq,aq+aw),at);if(aw<8){var an=q(B(at,aw));ax=ax.mul(an).add(q(au))}else{ax=ax.mul(av);ax=ax.add(q(au))}}ax.unsigned=ap;return ax}E.fromString=L;function K(an){if(an instanceof E){return an}if(typeof an===\"number\"){return q(an)}if(typeof an===\"string\"){return L(an)}return S(an.low,an.high,an.unsigned)}E.fromValue=K;var ai=1<<16;var al=1<<24;var i=ai*ai;var h=i*i;var C=h/2;var u=ah(al);var F=ah(0);E.ZERO=F;var m=ah(0,true);E.UZERO=m;var W=ah(1);E.ONE=W;var O=ah(1,true);E.UONE=O;var f=ah(-1);E.NEG_ONE=f;var b=S(4294967295|0,2147483647|0,false);E.MAX_VALUE=b;var D=S(4294967295|0,4294967295|0,true);E.MAX_UNSIGNED_VALUE=D;var T=S(0,2147483648|0,false);E.MIN_VALUE=T;var z=E.prototype;z.toInt=function v(){return this.unsigned?this.low>>>0:this.low};z.toNumber=function ae(){if(this.unsigned){return((this.high>>>0)*i)+(this.low>>>0)}return this.high*i+(this.low>>>0)};z.toString=function n(at){at=at||10;if(at<2||36<at){throw RangeError(\"radix\")}if(this.isZero()){return\"0\"}if(this.isNegative()){if(this.eq(T)){var aq=q(at),an=this.div(aq),ap=an.mul(aq).sub(this);return an.toString(at)+ap.toInt().toString(at)}else{return\"-\"+this.neg().toString(at)}}var aw=q(B(at,6),this.unsigned),av=this;var ax=\"\";while(true){var au=av.div(aw),ar=av.sub(au.mul(aw)).toInt()>>>0,ao=ar.toString(at);av=au;if(av.isZero()){return ao+ax}else{while(ao.length<6){ao=\"0\"+ao}ax=\"\"+ao+ax}}};z.getHighBits=function af(){return this.high};z.getHighBitsUnsigned=function p(){return this.high>>>0};z.getLowBits=function y(){return this.low};z.getLowBitsUnsigned=function U(){return this.low>>>0};z.getNumBitsAbs=function aj(){if(this.isNegative()){return this.eq(T)?64:this.neg().getNumBitsAbs()}var ao=this.high!=0?this.high:this.low;for(var an=31;an>0;an--){if((ao&(1<<an))!=0){break}}return this.high!=0?an+33:an+1};z.isZero=function R(){return this.high===0&&this.low===0};z.isNegative=function X(){return !this.unsigned&&this.high<0};z.isPositive=function ad(){return this.unsigned||this.high>=0};z.isOdd=function V(){return(this.low&1)===1};z.isEven=function x(){return(this.low&1)===0};z.equals=function N(an){if(!k(an)){an=K(an)}if(this.unsigned!==an.unsigned&&(this.high>>>31)===1&&(an.high>>>31)===1){return false}return this.high===an.high&&this.low===an.low};z.eq=z.equals;z.notEquals=function ag(an){return !this.eq(an)};z.neq=z.notEquals;z.lessThan=function t(an){return this.comp(an)<0};z.lt=z.lessThan;z.lessThanOrEqual=function Z(an){return this.comp(an)<=0};z.lte=z.lessThanOrEqual;z.greaterThan=function o(an){return this.comp(an)>0};z.gt=z.greaterThan;z.greaterThanOrEqual=function Q(an){return this.comp(an)>=0};z.gte=z.greaterThanOrEqual;z.compare=function s(ao){if(!k(ao)){ao=K(ao)}if(this.eq(ao)){return 0}var an=this.isNegative(),ap=ao.isNegative();if(an&&!ap){return -1}if(!an&&ap){return 1}if(!this.unsigned){return this.sub(ao).isNegative()?-1:1}return(ao.high>>>0)>(this.high>>>0)||(ao.high===this.high&&(ao.low>>>0)>(this.low>>>0))?-1:1};z.comp=z.compare;z.negate=function w(){if(!this.unsigned&&this.eq(T)){return T}return this.not().add(W)};z.neg=z.negate;z.add=function j(aq){if(!k(aq)){aq=K(aq)}var au=this.high>>>16;var ao=this.high&65535;var aw=this.low>>>16;var ap=this.low&65535;var ay=aq.high>>>16;var ar=aq.high&65535;var az=aq.low>>>16;var at=aq.low&65535;var aA=0,av=0,an=0,ax=0;ax+=ap+at;an+=ax>>>16;ax&=65535;an+=aw+az;av+=an>>>16;an&=65535;av+=ao+ar;aA+=av>>>16;av&=65535;aA+=au+ay;aA&=65535;return S((an<<16)|ax,(aA<<16)|av,this.unsigned)};z.subtract=function r(an){if(!k(an)){an=K(an)}return this.add(an.neg())};z.sub=z.subtract;z.multiply=function I(az){if(this.isZero()){return F}if(!k(az)){az=K(az)}if(az.isZero()){return F}if(this.eq(T)){return az.isOdd()?T:F}if(az.eq(T)){return this.isOdd()?T:F}if(this.isNegative()){if(az.isNegative()){return this.neg().mul(az.neg())}else{return this.neg().mul(az).neg()}}else{if(az.isNegative()){return this.mul(az.neg()).neg()}}if(this.lt(u)&&az.lt(u)){return q(this.toNumber()*az.toNumber(),this.unsigned)}var at=this.high>>>16;var ao=this.high&65535;var av=this.low>>>16;var ap=this.low&65535;var ax=az.high>>>16;var aq=az.high&65535;var ay=az.low>>>16;var ar=az.low&65535;var aA=0,au=0,an=0,aw=0;aw+=ap*ar;an+=aw>>>16;aw&=65535;an+=av*ar;au+=an>>>16;an&=65535;an+=ap*ay;au+=an>>>16;an&=65535;au+=ao*ar;aA+=au>>>16;au&=65535;au+=av*ay;aA+=au>>>16;au&=65535;au+=ap*aq;aA+=au>>>16;au&=65535;aA+=at*ar+ao*ay+av*aq+ap*ax;aA&=65535;return S((an<<16)|aw,(aA<<16)|au,this.unsigned)};z.mul=z.multiply;z.divide=function J(an){if(!k(an)){an=K(an)}if(an.isZero()){throw Error(\"division by zero\")}if(this.isZero()){return this.unsigned?m:F}var at,av,aq;if(!this.unsigned){if(this.eq(T)){if(an.eq(W)||an.eq(f)){return T}else{if(an.eq(T)){return W}else{var ao=this.shr(1);at=ao.div(an).shl(1);if(at.eq(F)){return an.isNegative()?W:f}else{av=this.sub(an.mul(at));aq=at.add(av.div(an));return aq}}}}else{if(an.eq(T)){return this.unsigned?m:F}}if(this.isNegative()){if(an.isNegative()){return this.neg().div(an.neg())}return this.neg().div(an).neg()}else{if(an.isNegative()){return this.div(an.neg()).neg()}}aq=F}else{if(!an.unsigned){an=an.toUnsigned()}if(an.gt(this)){return m}if(an.gt(this.shru(1))){return O}aq=m}av=this;while(av.gte(an)){at=Math.max(1,Math.floor(av.toNumber()/an.toNumber()));var aw=Math.ceil(Math.log(at)/Math.LN2),au=(aw<=48)?1:B(2,aw-48),ap=q(at),ar=ap.mul(an);while(ar.isNegative()||ar.gt(av)){at-=au;ap=q(at,this.unsigned);ar=ap.mul(an)}if(ap.isZero()){ap=W}aq=aq.add(ap);av=av.sub(ar)}return aq};z.div=z.divide;z.modulo=function ak(an){if(!k(an)){an=K(an)}return this.sub(this.div(an).mul(an))};z.mod=z.modulo;z.not=function ac(){return S(~this.low,~this.high,this.unsigned)};z.and=function ab(an){if(!k(an)){an=K(an)}return S(this.low&an.low,this.high&an.high,this.unsigned)};z.or=function P(an){if(!k(an)){an=K(an)}return S(this.low|an.low,this.high|an.high,this.unsigned)};z.xor=function Y(an){if(!k(an)){an=K(an)}return S(this.low^an.low,this.high^an.high,this.unsigned)};z.shiftLeft=function A(an){if(k(an)){an=an.toInt()}if((an&=63)===0){return this}else{if(an<32){return S(this.low<<an,(this.high<<an)|(this.low>>>(32-an)),this.unsigned)}else{return S(0,this.low<<(an-32),this.unsigned)}}};z.shl=z.shiftLeft;z.shiftRight=function l(an){if(k(an)){an=an.toInt()}if((an&=63)===0){return this}else{if(an<32){return S((this.low>>>an)|(this.high<<(32-an)),this.high>>an,this.unsigned)}else{return S(this.high>>(an-32),this.high>=0?0:-1,this.unsigned)}}};z.shr=z.shiftRight;z.shiftRightUnsigned=function G(ap){if(k(ap)){ap=ap.toInt()}ap&=63;if(ap===0){return this}else{var ao=this.high;if(ap<32){var an=this.low;return S((an>>>ap)|(ao<<(32-ap)),ao>>>ap,this.unsigned)}else{if(ap===32){return S(ao,0,this.unsigned)}else{return S(ao>>>(ap-32),0,this.unsigned)}}}};z.shru=z.shiftRightUnsigned;z.toSigned=function am(){if(!this.unsigned){return this}return S(this.low,this.high,false)};z.toUnsigned=function H(){if(this.unsigned){return this}return S(this.low,this.high,true)};z.toBytes=function(an){return an?this.toBytesLE():this.toBytesBE()};z.toBytesLE=function(){var an=this.high,ao=this.low;return[ao&255,(ao>>>8)&255,(ao>>>16)&255,(ao>>>24)&255,an&255,(an>>>8)&255,(an>>>16)&255,(an>>>24)&255]};z.toBytesBE=function(){var an=this.high,ao=this.low;return[(an>>>24)&255,(an>>>16)&255,(an>>>8)&255,an&255,(ao>>>24)&255,(ao>>>16)&255,(ao>>>8)&255,ao&255]};return E})();var c=(function(k){var n=function(q,s,r){if(typeof q===\"undefined\"){q=n.DEFAULT_CAPACITY}if(typeof s===\"undefined\"){s=n.DEFAULT_ENDIAN}if(typeof r===\"undefined\"){r=n.DEFAULT_NOASSERT}if(!r){q=q|0;if(q<0){throw RangeError(\"Illegal capacity\")}s=!!s;r=!!r}this.buffer=q===0?p:new ArrayBuffer(q);this.view=q===0?null:new Uint8Array(this.buffer);this.offset=0;this.markedOffset=-1;this.limit=q;this.littleEndian=s;this.noAssert=r};n.VERSION=\"5.0.1\";n.LITTLE_ENDIAN=true;n.BIG_ENDIAN=false;n.DEFAULT_CAPACITY=16;n.DEFAULT_ENDIAN=n.BIG_ENDIAN;n.DEFAULT_NOASSERT=false;n.Long=k||null;var l=n.prototype;l.__isByteBuffer__;Object.defineProperty(l,\"__isByteBuffer__\",{value:true,enumerable:false,configurable:false});var p=new ArrayBuffer(0);var m=String.fromCharCode;function b(r){var q=0;return function(){return q<r.length?r.charCodeAt(q++):null}}function f(){var q=[],r=[];return function(){if(arguments.length===0){return r.join(\"\")+m.apply(String,q)}if(q.length+arguments.length>1024){r.push(m.apply(String,q)),q.length=0}Array.prototype.push.apply(q,arguments)}}n.accessor=function(){return Uint8Array};n.allocate=function(q,s,r){return new n(q,s,r)};n.concat=function(z,s,r,y){if(typeof s===\"boolean\"||typeof s!==\"string\"){y=r;r=s;s=undefined}var q=0;for(var w=0,v=z.length,t;w<v;++w){if(!n.isByteBuffer(z[w])){z[w]=n.wrap(z[w],s)}t=z[w].limit-z[w].offset;if(t>0){q+=t}}if(q===0){return new n(0,r,y)}var x=new n(q,r,y),u;w=0;while(w<v){u=z[w++];t=u.limit-u.offset;if(t<=0){continue}x.view.set(u.view.subarray(u.offset,u.limit),x.offset);x.offset+=t}x.limit=x.offset;x.offset=0;return x};n.isByteBuffer=function(q){return(q&&q.__isByteBuffer__)===true};n.type=function(){return ArrayBuffer};n.wrap=function(q,s,u,t){if(typeof s!==\"string\"){t=u;u=s;s=undefined}if(typeof q===\"string\"){if(typeof s===\"undefined\"){s=\"utf8\"}switch(s){case\"base64\":return n.fromBase64(q,u);case\"hex\":return n.fromHex(q,u);case\"binary\":return n.fromBinary(q,u);case\"utf8\":return n.fromUTF8(q,u);case\"debug\":return n.fromDebug(q,u);default:throw Error(\"Unsupported encoding: \"+s)}}if(q===null||typeof q!==\"object\"){throw TypeError(\"Illegal buffer\")}var v;if(n.isByteBuffer(q)){v=l.clone.call(q);v.markedOffset=-1;return v}if(q instanceof Uint8Array){v=new n(0,u,t);if(q.length>0){v.buffer=q.buffer;v.offset=q.byteOffset;v.limit=q.byteOffset+q.byteLength;v.view=new Uint8Array(q.buffer)}}else{if(q instanceof ArrayBuffer){v=new n(0,u,t);if(q.byteLength>0){v.buffer=q;v.offset=0;v.limit=q.byteLength;v.view=q.byteLength>0?new Uint8Array(q):null}}else{if(Object.prototype.toString.call(q)===\"[object Array]\"){v=new n(q.length,u,t);v.limit=q.length;for(var r=0;r<q.length;++r){v.view[r]=q[r]}}else{throw TypeError(\"Illegal buffer\")}}}return v};l.writeBitSet=function(w,u){var q=typeof u===\"undefined\";if(q){u=this.offset}if(!this.noAssert){if(!(w instanceof Array)){throw TypeError(\"Illegal BitSet: Not an array\")}if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}var r=u,x=w.length,y=(x>>3),v=0,t;u+=this.writeVarint32(x,u);while(y--){t=(!!w[v++]&1)|((!!w[v++]&1)<<1)|((!!w[v++]&1)<<2)|((!!w[v++]&1)<<3)|((!!w[v++]&1)<<4)|((!!w[v++]&1)<<5)|((!!w[v++]&1)<<6)|((!!w[v++]&1)<<7);this.writeByte(t,u++)}if(v<x){var s=0;t=0;while(v<x){t=t|((!!w[v++]&1)<<(s++))}this.writeByte(t,u++)}if(q){this.offset=u;return this}return u-r};l.readBitSet=function(t){var q=typeof t===\"undefined\";if(q){t=this.offset}var u=this.readVarint32(t),x=u.value,y=(x>>3),v=0,w=[],s;t+=u.length;while(y--){s=this.readByte(t++);w[v++]=!!(s&1);w[v++]=!!(s&2);w[v++]=!!(s&4);w[v++]=!!(s&8);w[v++]=!!(s&16);w[v++]=!!(s&32);w[v++]=!!(s&64);w[v++]=!!(s&128)}if(v<x){var r=0;s=this.readByte(t++);while(v<x){w[v++]=!!((s>>(r++))&1)}}if(q){this.offset=t}return w};l.readBytes=function(q,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+q>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+q+\") <= \"+this.buffer.byteLength)}}var s=this.slice(t,t+q);if(r){this.offset+=q}return s};l.writeBytes=l.append;l.writeInt8=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal value: \"+s+\" (not an integer)\")}s|=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=1;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=1;this.view[t]=s;if(r){this.offset+=1}return this};l.writeByte=l.writeInt8;l.readInt8=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+1>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+1+\") <= \"+this.buffer.byteLength)}}var q=this.view[s];if((q&128)===128){q=-(255-q+1)}if(r){this.offset+=1}return q};l.readByte=l.readInt8;l.writeUint8=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal value: \"+s+\" (not an integer)\")}s>>>=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=1;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=1;this.view[t]=s;if(r){this.offset+=1}return this};l.writeUInt8=l.writeUint8;l.readUint8=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+1>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+1+\") <= \"+this.buffer.byteLength)}}var q=this.view[s];if(r){this.offset+=1}return q};l.readUInt8=l.readUint8;l.writeInt16=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal value: \"+s+\" (not an integer)\")}s|=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=2;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=2;if(this.littleEndian){this.view[t+1]=(s&65280)>>>8;this.view[t]=s&255}else{this.view[t]=(s&65280)>>>8;this.view[t+1]=s&255}if(r){this.offset+=2}return this};l.writeShort=l.writeInt16;l.readInt16=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+2>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+2+\") <= \"+this.buffer.byteLength)}}var q=0;if(this.littleEndian){q=this.view[s];q|=this.view[s+1]<<8}else{q=this.view[s]<<8;q|=this.view[s+1]}if((q&32768)===32768){q=-(65535-q+1)}if(r){this.offset+=2}return q};l.readShort=l.readInt16;l.writeUint16=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal value: \"+s+\" (not an integer)\")}s>>>=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=2;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=2;if(this.littleEndian){this.view[t+1]=(s&65280)>>>8;this.view[t]=s&255}else{this.view[t]=(s&65280)>>>8;this.view[t+1]=s&255}if(r){this.offset+=2}return this};l.writeUInt16=l.writeUint16;l.readUint16=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+2>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+2+\") <= \"+this.buffer.byteLength)}}var q=0;if(this.littleEndian){q=this.view[s];q|=this.view[s+1]<<8}else{q=this.view[s]<<8;q|=this.view[s+1]}if(r){this.offset+=2}return q};l.readUInt16=l.readUint16;l.writeInt32=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal value: \"+s+\" (not an integer)\")}s|=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=4;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=4;if(this.littleEndian){this.view[t+3]=(s>>>24)&255;this.view[t+2]=(s>>>16)&255;this.view[t+1]=(s>>>8)&255;this.view[t]=s&255}else{this.view[t]=(s>>>24)&255;this.view[t+1]=(s>>>16)&255;this.view[t+2]=(s>>>8)&255;this.view[t+3]=s&255}if(r){this.offset+=4}return this};l.writeInt=l.writeInt32;l.readInt32=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+4>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+4+\") <= \"+this.buffer.byteLength)}}var q=0;if(this.littleEndian){q=this.view[s+2]<<16;q|=this.view[s+1]<<8;q|=this.view[s];q+=this.view[s+3]<<24>>>0}else{q=this.view[s+1]<<16;q|=this.view[s+2]<<8;q|=this.view[s+3];q+=this.view[s]<<24>>>0}q|=0;if(r){this.offset+=4}return q};l.readInt=l.readInt32;l.writeUint32=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal value: \"+s+\" (not an integer)\")}s>>>=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=4;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=4;if(this.littleEndian){this.view[t+3]=(s>>>24)&255;this.view[t+2]=(s>>>16)&255;this.view[t+1]=(s>>>8)&255;this.view[t]=s&255}else{this.view[t]=(s>>>24)&255;this.view[t+1]=(s>>>16)&255;this.view[t+2]=(s>>>8)&255;this.view[t+3]=s&255}if(r){this.offset+=4}return this};l.writeUInt32=l.writeUint32;l.readUint32=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+4>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+4+\") <= \"+this.buffer.byteLength)}}var q=0;if(this.littleEndian){q=this.view[s+2]<<16;q|=this.view[s+1]<<8;q|=this.view[s];q+=this.view[s+3]<<24>>>0}else{q=this.view[s+1]<<16;q|=this.view[s+2]<<8;q|=this.view[s+3];q+=this.view[s]<<24>>>0}if(r){this.offset+=4}return q};l.readUInt32=l.readUint32;if(k){l.writeInt64=function(t,u){var s=typeof u===\"undefined\";if(s){u=this.offset}if(!this.noAssert){if(typeof t===\"number\"){t=k.fromNumber(t)}else{if(typeof t===\"string\"){t=k.fromString(t)}else{if(!(t&&t instanceof k)){throw TypeError(\"Illegal value: \"+t+\" (not an integer or Long)\")}}}if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}if(typeof t===\"number\"){t=k.fromNumber(t)}else{if(typeof t===\"string\"){t=k.fromString(t)}}u+=8;var v=this.buffer.byteLength;if(u>v){this.resize((v*=2)>u?v:u)}u-=8;var r=t.low,q=t.high;if(this.littleEndian){this.view[u+3]=(r>>>24)&255;this.view[u+2]=(r>>>16)&255;this.view[u+1]=(r>>>8)&255;this.view[u]=r&255;u+=4;this.view[u+3]=(q>>>24)&255;this.view[u+2]=(q>>>16)&255;this.view[u+1]=(q>>>8)&255;this.view[u]=q&255}else{this.view[u]=(q>>>24)&255;this.view[u+1]=(q>>>16)&255;this.view[u+2]=(q>>>8)&255;this.view[u+3]=q&255;u+=4;this.view[u]=(r>>>24)&255;this.view[u+1]=(r>>>16)&255;this.view[u+2]=(r>>>8)&255;this.view[u+3]=r&255}if(s){this.offset+=8}return this};l.writeLong=l.writeInt64;l.readInt64=function(u){var t=typeof u===\"undefined\";if(t){u=this.offset}if(!this.noAssert){if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+8>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+8+\") <= \"+this.buffer.byteLength)}}var r=0,q=0;if(this.littleEndian){r=this.view[u+2]<<16;r|=this.view[u+1]<<8;r|=this.view[u];r+=this.view[u+3]<<24>>>0;u+=4;q=this.view[u+2]<<16;q|=this.view[u+1]<<8;q|=this.view[u];q+=this.view[u+3]<<24>>>0}else{q=this.view[u+1]<<16;q|=this.view[u+2]<<8;q|=this.view[u+3];q+=this.view[u]<<24>>>0;u+=4;r=this.view[u+1]<<16;r|=this.view[u+2]<<8;r|=this.view[u+3];r+=this.view[u]<<24>>>0}var s=new k(r,q,false);if(t){this.offset+=8}return s};l.readLong=l.readInt64;l.writeUint64=function(t,v){var s=typeof v===\"undefined\";if(s){v=this.offset}if(!this.noAssert){if(typeof t===\"number\"){t=k.fromNumber(t)}else{if(typeof t===\"string\"){t=k.fromString(t)}else{if(!(t&&t instanceof k)){throw TypeError(\"Illegal value: \"+t+\" (not an integer or Long)\")}}}if(typeof v!==\"number\"||v%1!==0){throw TypeError(\"Illegal offset: \"+v+\" (not an integer)\")}v>>>=0;if(v<0||v+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+v+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}if(typeof t===\"number\"){t=k.fromNumber(t)}else{if(typeof t===\"string\"){t=k.fromString(t)}}v+=8;var u=this.buffer.byteLength;if(v>u){this.resize((u*=2)>v?u:v)}v-=8;var r=t.low,q=t.high;if(this.littleEndian){this.view[v+3]=(r>>>24)&255;this.view[v+2]=(r>>>16)&255;this.view[v+1]=(r>>>8)&255;this.view[v]=r&255;v+=4;this.view[v+3]=(q>>>24)&255;this.view[v+2]=(q>>>16)&255;this.view[v+1]=(q>>>8)&255;this.view[v]=q&255}else{this.view[v]=(q>>>24)&255;this.view[v+1]=(q>>>16)&255;this.view[v+2]=(q>>>8)&255;this.view[v+3]=q&255;v+=4;this.view[v]=(r>>>24)&255;this.view[v+1]=(r>>>16)&255;this.view[v+2]=(r>>>8)&255;this.view[v+3]=r&255}if(s){this.offset+=8}return this};l.writeUInt64=l.writeUint64;l.readUint64=function(u){var t=typeof u===\"undefined\";if(t){u=this.offset}if(!this.noAssert){if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+8>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+8+\") <= \"+this.buffer.byteLength)}}var r=0,q=0;if(this.littleEndian){r=this.view[u+2]<<16;r|=this.view[u+1]<<8;r|=this.view[u];r+=this.view[u+3]<<24>>>0;u+=4;q=this.view[u+2]<<16;q|=this.view[u+1]<<8;q|=this.view[u];q+=this.view[u+3]<<24>>>0}else{q=this.view[u+1]<<16;q|=this.view[u+2]<<8;q|=this.view[u+3];q+=this.view[u]<<24>>>0;u+=4;r=this.view[u+1]<<16;r|=this.view[u+2]<<8;r|=this.view[u+3];r+=this.view[u]<<24>>>0}var s=new k(r,q,true);if(t){this.offset+=8}return s};l.readUInt64=l.readUint64}function i(x,w,t,r,A){var B,v,u=A*8-r-1,z=(1<<u)-1,q=z>>1,D=-7,y=t?(A-1):0,C=t?-1:1,E=x[w+y];y+=C;B=E&((1<<(-D))-1);E>>=(-D);D+=u;for(;D>0;B=B*256+x[w+y],y+=C,D-=8){}v=B&((1<<(-D))-1);B>>=(-D);D+=r;for(;D>0;v=v*256+x[w+y],y+=C,D-=8){}if(B===0){B=1-q}else{if(B===z){return v?NaN:((E?-1:1)*Infinity)}else{v=v+Math.pow(2,r);B=B-q}}return(E?-1:1)*v*Math.pow(2,B-r)}function j(y,F,x,t,r,B){var C,v,E,u=B*8-r-1,A=(1<<u)-1,q=A>>1,w=(r===23?Math.pow(2,-24)-Math.pow(2,-77):0),z=t?0:(B-1),D=t?1:-1,G=F<0||(F===0&&1/F<0)?1:0;F=Math.abs(F);if(isNaN(F)||F===Infinity){v=isNaN(F)?1:0;C=A}else{C=Math.floor(Math.log(F)/Math.LN2);if(F*(E=Math.pow(2,-C))<1){C--;E*=2}if(C+q>=1){F+=w/E}else{F+=w*Math.pow(2,1-q)}if(F*E>=2){C++;E/=2}if(C+q>=A){v=0;C=A}else{if(C+q>=1){v=(F*E-1)*Math.pow(2,r);C=C+q}else{v=F*Math.pow(2,q-1)*Math.pow(2,r);C=0}}}for(;r>=8;y[x+z]=v&255,z+=D,v/=256,r-=8){}C=(C<<r)|v;u+=r;for(;u>0;y[x+z]=C&255,z+=D,C/=256,u-=8){}y[x+z-D]|=G*128}l.writeFloat32=function(r,t){var q=typeof t===\"undefined\";if(q){t=this.offset}if(!this.noAssert){if(typeof r!==\"number\"){throw TypeError(\"Illegal value: \"+r+\" (not a number)\")}if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=4;var s=this.buffer.byteLength;if(t>s){this.resize((s*=2)>t?s:t)}t-=4;j(this.view,r,t,this.littleEndian,23,4);if(q){this.offset+=4}return this};l.writeFloat=l.writeFloat32;l.readFloat32=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+4>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+4+\") <= \"+this.buffer.byteLength)}}var q=i(this.view,s,this.littleEndian,23,4);if(r){this.offset+=4}return q};l.readFloat=l.readFloat32;l.writeFloat64=function(s,t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof s!==\"number\"){throw TypeError(\"Illegal value: \"+s+\" (not a number)\")}if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}t+=8;var q=this.buffer.byteLength;if(t>q){this.resize((q*=2)>t?q:t)}t-=8;j(this.view,s,t,this.littleEndian,52,8);if(r){this.offset+=8}return this};l.writeDouble=l.writeFloat64;l.readFloat64=function(s){var r=typeof s===\"undefined\";if(r){s=this.offset}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal offset: \"+s+\" (not an integer)\")}s>>>=0;if(s<0||s+8>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+s+\" (+\"+8+\") <= \"+this.buffer.byteLength)}}var q=i(this.view,s,this.littleEndian,52,8);if(r){this.offset+=8}return q};l.readDouble=l.readFloat64;n.MAX_VARINT32_BYTES=5;n.calculateVarint32=function(q){q=q>>>0;if(q<1<<7){return 1}else{if(q<1<<14){return 2}else{if(q<1<<21){return 3}else{if(q<1<<28){return 4}else{return 5}}}}};n.zigZagEncode32=function(q){return(((q|=0)<<1)^(q>>31))>>>0};n.zigZagDecode32=function(q){return((q>>>1)^-(q&1))|0};l.writeVarint32=function(u,v){var t=typeof v===\"undefined\";if(t){v=this.offset}if(!this.noAssert){if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal value: \"+u+\" (not an integer)\")}u|=0;if(typeof v!==\"number\"||v%1!==0){throw TypeError(\"Illegal offset: \"+v+\" (not an integer)\")}v>>>=0;if(v<0||v+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+v+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}var r=n.calculateVarint32(u),q;v+=r;var s=this.buffer.byteLength;if(v>s){this.resize((s*=2)>v?s:v)}v-=r;u>>>=0;while(u>=128){q=(u&127)|128;this.view[v++]=q;u>>>=7}this.view[v++]=u;if(t){this.offset=v;return this}return r};l.writeVarint32ZigZag=function(q,r){return this.writeVarint32(n.zigZagEncode32(q),r)};l.readVarint32=function(u){var t=typeof u===\"undefined\";if(t){u=this.offset}if(!this.noAssert){if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+1>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+1+\") <= \"+this.buffer.byteLength)}}var v=0,s=0>>>0,q;do{if(!this.noAssert&&u>this.limit){var r=Error(\"Truncated\");r.truncated=true;throw r}q=this.view[u++];if(v<5){s|=(q&127)<<(7*v)}++v}while((q&128)!==0);s|=0;if(t){this.offset=u;return s}return{value:s,length:v}};l.readVarint32ZigZag=function(r){var q=this.readVarint32(r);if(typeof q===\"object\"){q.value=n.zigZagDecode32(q.value)}else{q=n.zigZagDecode32(q)}return q};if(k){n.MAX_VARINT64_BYTES=10;n.calculateVarint64=function(r){if(typeof r===\"number\"){r=k.fromNumber(r)}else{if(typeof r===\"string\"){r=k.fromString(r)}}var t=r.toInt()>>>0,s=r.shiftRightUnsigned(28).toInt()>>>0,q=r.shiftRightUnsigned(56).toInt()>>>0;if(q==0){if(s==0){if(t<1<<14){return t<1<<7?1:2}else{return t<1<<21?3:4}}else{if(s<1<<14){return s<1<<7?5:6}else{return s<1<<21?7:8}}}else{return q<1<<7?9:10}};n.zigZagEncode64=function(q){if(typeof q===\"number\"){q=k.fromNumber(q,false)}else{if(typeof q===\"string\"){q=k.fromString(q,false)}else{if(q.unsigned!==false){q=q.toSigned()}}}return q.shiftLeft(1).xor(q.shiftRight(63)).toUnsigned()};n.zigZagDecode64=function(q){if(typeof q===\"number\"){q=k.fromNumber(q,false)}else{if(typeof q===\"string\"){q=k.fromString(q,false)}else{if(q.unsigned!==false){q=q.toSigned()}}}return q.shiftRightUnsigned(1).xor(q.and(k.ONE).toSigned().negate()).toSigned()};l.writeVarint64=function(u,x){var t=typeof x===\"undefined\";if(t){x=this.offset}if(!this.noAssert){if(typeof u===\"number\"){u=k.fromNumber(u)}else{if(typeof u===\"string\"){u=k.fromString(u)}else{if(!(u&&u instanceof k)){throw TypeError(\"Illegal value: \"+u+\" (not an integer or Long)\")}}}if(typeof x!==\"number\"||x%1!==0){throw TypeError(\"Illegal offset: \"+x+\" (not an integer)\")}x>>>=0;if(x<0||x+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+x+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}if(typeof u===\"number\"){u=k.fromNumber(u,false)}else{if(typeof u===\"string\"){u=k.fromString(u,false)}else{if(u.unsigned!==false){u=u.toSigned()}}}var q=n.calculateVarint64(u),w=u.toInt()>>>0,v=u.shiftRightUnsigned(28).toInt()>>>0,s=u.shiftRightUnsigned(56).toInt()>>>0;x+=q;var r=this.buffer.byteLength;if(x>r){this.resize((r*=2)>x?r:x)}x-=q;switch(q){case 10:this.view[x+9]=(s>>>7)&1;case 9:this.view[x+8]=q!==9?(s)|128:(s)&127;case 8:this.view[x+7]=q!==8?(v>>>21)|128:(v>>>21)&127;case 7:this.view[x+6]=q!==7?(v>>>14)|128:(v>>>14)&127;case 6:this.view[x+5]=q!==6?(v>>>7)|128:(v>>>7)&127;case 5:this.view[x+4]=q!==5?(v)|128:(v)&127;case 4:this.view[x+3]=q!==4?(w>>>21)|128:(w>>>21)&127;case 3:this.view[x+2]=q!==3?(w>>>14)|128:(w>>>14)&127;case 2:this.view[x+1]=q!==2?(w>>>7)|128:(w>>>7)&127;case 1:this.view[x]=q!==1?(w)|128:(w)&127}if(t){this.offset+=q;return this}else{return q}};l.writeVarint64ZigZag=function(q,r){return this.writeVarint64(n.zigZagEncode64(q),r)};l.readVarint64=function(w){var t=typeof w===\"undefined\";if(t){w=this.offset}if(!this.noAssert){if(typeof w!==\"number\"||w%1!==0){throw TypeError(\"Illegal offset: \"+w+\" (not an integer)\")}w>>>=0;if(w<0||w+1>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+w+\" (+\"+1+\") <= \"+this.buffer.byteLength)}}var x=w,v=0,u=0,s=0,q=0;q=this.view[w++];v=(q&127);if(q&128){q=this.view[w++];v|=(q&127)<<7;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];v|=(q&127)<<14;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];v|=(q&127)<<21;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];u=(q&127);if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];u|=(q&127)<<7;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];u|=(q&127)<<14;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];u|=(q&127)<<21;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];s=(q&127);if((q&128)||(this.noAssert&&typeof q===\"undefined\")){q=this.view[w++];s|=(q&127)<<7;if((q&128)||(this.noAssert&&typeof q===\"undefined\")){throw Error(\"Buffer overrun\")}}}}}}}}}}var r=k.fromBits(v|(u<<28),(u>>>4)|(s)<<24,false);if(t){this.offset=w;return r}else{return{value:r,length:w-x}}};l.readVarint64ZigZag=function(r){var q=this.readVarint64(r);if(q&&q.value instanceof k){q.value=n.zigZagDecode64(q.value)}else{q=n.zigZagDecode64(q)}return q}}l.writeCString=function(v,u){var t=typeof u===\"undefined\";if(t){u=this.offset}var r,q=v.length;if(!this.noAssert){if(typeof v!==\"string\"){throw TypeError(\"Illegal str: Not a string\")}for(r=0;r<q;++r){if(v.charCodeAt(r)===0){throw RangeError(\"Illegal str: Contains NULL-characters\")}}if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}q=o.calculateUTF16asUTF8(b(v))[1];u+=q+1;var s=this.buffer.byteLength;if(u>s){this.resize((s*=2)>u?s:u)}u-=q+1;o.encodeUTF16toUTF8(b(v),function(w){this.view[u++]=w}.bind(this));this.view[u++]=0;if(t){this.offset=u;return this}return q};l.readCString=function(u){var s=typeof u===\"undefined\";if(s){u=this.offset}if(!this.noAssert){if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+1>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+1+\") <= \"+this.buffer.byteLength)}}var v=u,r;var t,q=-1;o.decodeUTF8toUTF16(function(){if(q===0){return null}if(u>=this.limit){throw RangeError(\"Illegal range: Truncated data, \"+u+\" < \"+this.limit)}q=this.view[u++];return q===0?null:q}.bind(this),t=f(),true);if(s){this.offset=u;return t()}else{return{string:t(),length:u-v}}};l.writeIString=function(u,t){var s=typeof t===\"undefined\";if(s){t=this.offset}if(!this.noAssert){if(typeof u!==\"string\"){throw TypeError(\"Illegal str: Not a string\")}if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}var v=t,q;q=o.calculateUTF16asUTF8(b(u),this.noAssert)[1];t+=4+q;var r=this.buffer.byteLength;if(t>r){this.resize((r*=2)>t?r:t)}t-=4+q;if(this.littleEndian){this.view[t+3]=(q>>>24)&255;this.view[t+2]=(q>>>16)&255;this.view[t+1]=(q>>>8)&255;this.view[t]=q&255}else{this.view[t]=(q>>>24)&255;this.view[t+1]=(q>>>16)&255;this.view[t+2]=(q>>>8)&255;this.view[t+3]=q&255}t+=4;o.encodeUTF16toUTF8(b(u),function(w){this.view[t++]=w}.bind(this));if(t!==v+4+q){throw RangeError(\"Illegal range: Truncated data, \"+t+\" == \"+(t+4+q))}if(s){this.offset=t;return this}return t-v};l.readIString=function(t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+4>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+4+\") <= \"+this.buffer.byteLength)}}var u=t;var q=this.readUint32(t);var s=this.readUTF8String(q,n.METRICS_BYTES,t+=4);t+=s.length;if(r){this.offset=t;return s.string}else{return{string:s.string,length:t-u}}};n.METRICS_CHARS=\"c\";n.METRICS_BYTES=\"b\";l.writeUTF8String=function(u,t){var s=typeof t===\"undefined\";if(s){t=this.offset}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}var q;var v=t;q=o.calculateUTF16asUTF8(b(u))[1];t+=q;var r=this.buffer.byteLength;if(t>r){this.resize((r*=2)>t?r:t)}t-=q;o.encodeUTF16toUTF8(b(u),function(w){this.view[t++]=w}.bind(this));if(s){this.offset=t;return this}return t-v};l.writeString=l.writeUTF8String;n.calculateUTF8Chars=function(q){return o.calculateUTF16asUTF8(b(q))[0]};n.calculateUTF8Bytes=function(q){return o.calculateUTF16asUTF8(b(q))[1]};n.calculateString=n.calculateUTF8Bytes;l.readUTF8String=function(t,s,w){if(typeof s===\"number\"){w=s;s=undefined}var u=typeof w===\"undefined\";if(u){w=this.offset}if(typeof s===\"undefined\"){s=n.METRICS_CHARS}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal length: \"+t+\" (not an integer)\")}t|=0;if(typeof w!==\"number\"||w%1!==0){throw TypeError(\"Illegal offset: \"+w+\" (not an integer)\")}w>>>=0;if(w<0||w+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+w+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}var r=0,x=w,v;if(s===n.METRICS_CHARS){v=f();o.decodeUTF8(function(){return r<t&&w<this.limit?this.view[w++]:null}.bind(this),function(y){++r;o.UTF8toUTF16(y,v)});if(r!==t){throw RangeError(\"Illegal range: Truncated data, \"+r+\" == \"+t)}if(u){this.offset=w;return v()}else{return{string:v(),length:w-x}}}else{if(s===n.METRICS_BYTES){if(!this.noAssert){if(typeof w!==\"number\"||w%1!==0){throw TypeError(\"Illegal offset: \"+w+\" (not an integer)\")}w>>>=0;if(w<0||w+t>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+w+\" (+\"+t+\") <= \"+this.buffer.byteLength)}}var q=w+t;o.decodeUTF8toUTF16(function(){return w<q?this.view[w++]:null}.bind(this),v=f(),this.noAssert);if(w!==q){throw RangeError(\"Illegal range: Truncated data, \"+w+\" == \"+q)}if(u){this.offset=w;return v()}else{return{string:v(),length:w-x}}}else{throw TypeError(\"Unsupported metrics: \"+s)}}};l.readString=l.readUTF8String;l.writeVString=function(v,u){var t=typeof u===\"undefined\";if(t){u=this.offset}if(!this.noAssert){if(typeof v!==\"string\"){throw TypeError(\"Illegal str: Not a string\")}if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal offset: \"+u+\" (not an integer)\")}u>>>=0;if(u<0||u+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+u+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}var w=u,s,q;s=o.calculateUTF16asUTF8(b(v),this.noAssert)[1];q=n.calculateVarint32(s);u+=q+s;var r=this.buffer.byteLength;if(u>r){this.resize((r*=2)>u?r:u)}u-=q+s;u+=this.writeVarint32(s,u);o.encodeUTF16toUTF8(b(v),function(x){this.view[u++]=x}.bind(this));if(u!==w+s+q){throw RangeError(\"Illegal range: Truncated data, \"+u+\" == \"+(u+s+q))}if(t){this.offset=u;return this}return u-w};l.readVString=function(t){var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+1>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+1+\") <= \"+this.buffer.byteLength)}}var u=t;var q=this.readVarint32(t);var s=this.readUTF8String(q.value,n.METRICS_BYTES,t+=q.length);t+=s.length;if(r){this.offset=t;return s.string}else{return{string:s.string,length:t-u}}};l.append=function(u,s,v){if(typeof s===\"number\"||typeof s!==\"string\"){v=s;s=undefined}var t=typeof v===\"undefined\";if(t){v=this.offset}if(!this.noAssert){if(typeof v!==\"number\"||v%1!==0){throw TypeError(\"Illegal offset: \"+v+\" (not an integer)\")}v>>>=0;if(v<0||v+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+v+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}if(!(u instanceof n)){u=n.wrap(u,s)}var r=u.limit-u.offset;if(r<=0){return this}v+=r;var q=this.buffer.byteLength;if(v>q){this.resize((q*=2)>v?q:v)}v-=r;this.view.set(u.view.subarray(u.offset,u.limit),v);u.offset+=r;if(t){this.offset+=r}return this};l.appendTo=function(q,r){q.append(this,r);return this};l.assert=function(q){this.noAssert=!q;return this};l.capacity=function(){return this.buffer.byteLength};l.clear=function(){this.offset=0;this.limit=this.buffer.byteLength;this.markedOffset=-1;return this};l.clone=function(r){var q=new n(0,this.littleEndian,this.noAssert);if(r){q.buffer=new ArrayBuffer(this.buffer.byteLength);q.view=new Uint8Array(q.buffer)}else{q.buffer=this.buffer;q.view=this.view}q.offset=this.offset;q.markedOffset=this.markedOffset;q.limit=this.limit;return q};l.compact=function(u,t){if(typeof u===\"undefined\"){u=this.offset}if(typeof t===\"undefined\"){t=this.limit}if(!this.noAssert){if(typeof u!==\"number\"||u%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}u>>>=0;if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal end: Not an integer\")}t>>>=0;if(u<0||u>t||t>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+u+\" <= \"+t+\" <= \"+this.buffer.byteLength)}}if(u===0&&t===this.buffer.byteLength){return this}var q=t-u;if(q===0){this.buffer=p;this.view=null;if(this.markedOffset>=0){this.markedOffset-=u}this.offset=0;this.limit=0;return this}var s=new ArrayBuffer(q);var r=new Uint8Array(s);r.set(this.view.subarray(u,t));this.buffer=s;this.view=r;if(this.markedOffset>=0){this.markedOffset-=u}this.offset=0;this.limit=q;return this};l.copy=function(s,q){if(typeof s===\"undefined\"){s=this.offset}if(typeof q===\"undefined\"){q=this.limit}if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}s>>>=0;if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal end: Not an integer\")}q>>>=0;if(s<0||s>q||q>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+s+\" <= \"+q+\" <= \"+this.buffer.byteLength)}}if(s===q){return new n(0,this.littleEndian,this.noAssert)}var r=q-s,t=new n(r,this.littleEndian,this.noAssert);t.offset=0;t.limit=r;if(t.markedOffset>=0){t.markedOffset-=s}this.copyTo(t,0,s,q);return t};l.copyTo=function(u,w,s,v){var t,r;if(!this.noAssert){if(!n.isByteBuffer(u)){throw TypeError(\"Illegal target: Not a ByteBuffer\")}}w=(r=typeof w===\"undefined\")?u.offset:w|0;s=(t=typeof s===\"undefined\")?this.offset:s|0;v=typeof v===\"undefined\"?this.limit:v|0;if(w<0||w>u.buffer.byteLength){throw RangeError(\"Illegal target range: 0 <= \"+w+\" <= \"+u.buffer.byteLength)}if(s<0||v>this.buffer.byteLength){throw RangeError(\"Illegal source range: 0 <= \"+s+\" <= \"+this.buffer.byteLength)}var q=v-s;if(q===0){return u}u.ensureCapacity(w+q);u.view.set(this.view.subarray(s,v),w);if(t){this.offset+=q}if(r){u.offset+=q}return this};l.ensureCapacity=function(q){var r=this.buffer.byteLength;if(r<q){return this.resize((r*=2)>q?r:q)}return this};l.fill=function(t,r,q){var s=typeof r===\"undefined\";if(s){r=this.offset}if(typeof t===\"string\"&&t.length>0){t=t.charCodeAt(0)}if(typeof r===\"undefined\"){r=this.offset}if(typeof q===\"undefined\"){q=this.limit}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal value: \"+t+\" (not an integer)\")}t|=0;if(typeof r!==\"number\"||r%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}r>>>=0;if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal end: Not an integer\")}q>>>=0;if(r<0||r>q||q>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+r+\" <= \"+q+\" <= \"+this.buffer.byteLength)}}if(r>=q){return this}while(r<q){this.view[r++]=t}if(s){this.offset=r}return this};l.flip=function(){this.limit=this.offset;this.offset=0;return this};l.mark=function(q){q=typeof q===\"undefined\"?this.offset:q;if(!this.noAssert){if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal offset: \"+q+\" (not an integer)\")}q>>>=0;if(q<0||q+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+q+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}this.markedOffset=q;return this};l.order=function(q){if(!this.noAssert){if(typeof q!==\"boolean\"){throw TypeError(\"Illegal littleEndian: Not a boolean\")}}this.littleEndian=!!q;return this};l.LE=function(q){this.littleEndian=typeof q!==\"undefined\"?!!q:true;return this};l.BE=function(q){this.littleEndian=typeof q!==\"undefined\"?!q:false;return this};l.prepend=function(q,s,t){if(typeof s===\"number\"||typeof s!==\"string\"){t=s;s=undefined}var r=typeof t===\"undefined\";if(r){t=this.offset}if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: \"+t+\" (not an integer)\")}t>>>=0;if(t<0||t+0>this.buffer.byteLength){throw RangeError(\"Illegal offset: 0 <= \"+t+\" (+\"+0+\") <= \"+this.buffer.byteLength)}}if(!(q instanceof n)){q=n.wrap(q,s)}var v=q.limit-q.offset;if(v<=0){return this}var y=v-t;if(y>0){var u=new ArrayBuffer(this.buffer.byteLength+y);var x=new Uint8Array(u);x.set(this.view.subarray(t,this.buffer.byteLength),v);this.buffer=u;this.view=x;this.offset+=y;if(this.markedOffset>=0){this.markedOffset+=y}this.limit+=y;t+=y}else{var w=new Uint8Array(this.buffer)}this.view.set(q.view.subarray(q.offset,q.limit),t-v);q.offset=q.limit;if(r){this.offset-=v}return this};l.prependTo=function(q,r){q.prepend(this,r);return this};l.printDebug=function(q){if(typeof q!==\"function\"){q=console.log.bind(console)}q(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(true))};l.remaining=function(){return this.limit-this.offset};l.reset=function(){if(this.markedOffset>=0){this.offset=this.markedOffset;this.markedOffset=-1}else{this.offset=0}return this};l.resize=function(s){if(!this.noAssert){if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal capacity: \"+s+\" (not an integer)\")}s|=0;if(s<0){throw RangeError(\"Illegal capacity: 0 <= \"+s)}}if(this.buffer.byteLength<s){var r=new ArrayBuffer(s);var q=new Uint8Array(r);q.set(this.view);this.buffer=r;this.view=q}return this};l.reverse=function(r,q){if(typeof r===\"undefined\"){r=this.offset}if(typeof q===\"undefined\"){q=this.limit}if(!this.noAssert){if(typeof r!==\"number\"||r%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}r>>>=0;if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal end: Not an integer\")}q>>>=0;if(r<0||r>q||q>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+r+\" <= \"+q+\" <= \"+this.buffer.byteLength)}}if(r===q){return this}Array.prototype.reverse.call(this.view.subarray(r,q));return this};l.skip=function(q){if(!this.noAssert){if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal length: \"+q+\" (not an integer)\")}q|=0}var r=this.offset+q;if(!this.noAssert){if(r<0||r>this.buffer.byteLength){throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+q+\" <= \"+this.buffer.byteLength)}}this.offset=r;return this};l.slice=function(r,q){if(typeof r===\"undefined\"){r=this.offset}if(typeof q===\"undefined\"){q=this.limit}if(!this.noAssert){if(typeof r!==\"number\"||r%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}r>>>=0;if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal end: Not an integer\")}q>>>=0;if(r<0||r>q||q>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+r+\" <= \"+q+\" <= \"+this.buffer.byteLength)}}var s=this.clone();s.offset=r;s.limit=q;return s};l.toBuffer=function(q){var t=this.offset,s=this.limit;if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal offset: Not an integer\")}t>>>=0;if(typeof s!==\"number\"||s%1!==0){throw TypeError(\"Illegal limit: Not an integer\")}s>>>=0;if(t<0||t>s||s>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+t+\" <= \"+s+\" <= \"+this.buffer.byteLength)}}if(!q&&t===0&&s===this.buffer.byteLength){return this.buffer}if(t===s){return p}var r=new ArrayBuffer(s-t);new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,s),0);return r};l.toArrayBuffer=l.toBuffer;l.toString=function(s,r,q){if(typeof s===\"undefined\"){return\"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\"}if(typeof s===\"number\"){s=\"utf8\",r=s,q=r}switch(s){case\"utf8\":return this.toUTF8(r,q);case\"base64\":return this.toBase64(r,q);case\"hex\":return this.toHex(r,q);case\"binary\":return this.toBinary(r,q);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+s)}};var h=function(){var r={};var u=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47];var t=[];for(var s=0,q=u.length;s<q;++s){t[u[s]]=s}r.encode=function(x,y){var v,w;while((v=x())!==null){y(u[(v>>2)&63]);w=(v&3)<<4;if((v=x())!==null){w|=(v>>4)&15;y(u[(w|((v>>4)&15))&63]);w=(v&15)<<2;if((v=x())!==null){y(u[(w|((v>>6)&3))&63]),y(u[v&63])}else{y(u[w&63]),y(61)}}else{y(u[w&63]),y(61),y(61)}}};r.decode=function(y,A){var z,x,w;function v(B){throw Error(\"Illegal character code: \"+B)}while((z=y())!==null){x=t[z];if(typeof x===\"undefined\"){v(z)}if((z=y())!==null){w=t[z];if(typeof w===\"undefined\"){v(z)}A((x<<2)>>>0|(w&48)>>4);if((z=y())!==null){x=t[z];if(typeof x===\"undefined\"){if(z===61){break}else{v(z)}}A(((w&15)<<4)>>>0|(x&60)>>2);if((z=y())!==null){w=t[z];if(typeof w===\"undefined\"){if(z===61){break}else{v(z)}}A(((x&3)<<6)>>>0|w)}}}}};r.test=function(v){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(v)};return r}();l.toBase64=function(r,q){if(typeof r===\"undefined\"){r=this.offset}if(typeof q===\"undefined\"){q=this.limit}r=r|0;q=q|0;if(r<0||q>this.capacity||r>q){throw RangeError(\"begin, end\")}var s;h.encode(function(){return r<q?this.view[r++]:null}.bind(this),s=f());return s()};n.fromBase64=function(t,r){if(typeof t!==\"string\"){throw TypeError(\"str\")}var s=new n(t.length/4*3,r),q=0;h.decode(b(t),function(u){s.view[q++]=u});s.limit=q;return s};n.btoa=function(q){return n.fromBinary(q).toBase64()};n.atob=function(q){return n.fromBase64(q).toBinary()};l.toBinary=function(r,q){if(typeof r===\"undefined\"){r=this.offset}if(typeof q===\"undefined\"){q=this.limit}r|=0;q|=0;if(r<0||q>this.capacity()||r>q){throw RangeError(\"begin, end\")}if(r===q){return\"\"}var s=[],t=[];while(r<q){s.push(this.view[r++]);if(s.length>=1024){t.push(String.fromCharCode.apply(String,s)),s=[]}}return t.join(\"\")+String.fromCharCode.apply(String,s)};n.fromBinary=function(v,t){if(typeof v!==\"string\"){throw TypeError(\"str\")}var s=0,r=v.length,q,u=new n(r,t);while(s<r){q=v.charCodeAt(s);if(q>255){throw RangeError(\"illegal char code: \"+q)}u.view[s++]=q}u.limit=r;return u};l.toDebug=function(u){var t=-1,r=this.buffer.byteLength,q,w=\"\",v=\"\",s=\"\";while(t<r){if(t!==-1){q=this.view[t];if(q<16){w+=\"0\"+q.toString(16).toUpperCase()}else{w+=q.toString(16).toUpperCase()}if(u){v+=q>32&&q<127?String.fromCharCode(q):\".\"}}++t;if(u){if(t>0&&t%16===0&&t!==r){while(w.length<3*16+3){w+=\" \"}s+=w+v+\"\\n\";w=v=\"\"}}if(t===this.offset&&t===this.limit){w+=t===this.markedOffset?\"!\":\"|\"}else{if(t===this.offset){w+=t===this.markedOffset?\"[\":\"<\"}else{if(t===this.limit){w+=t===this.markedOffset?\"]\":\">\"}else{w+=t===this.markedOffset?\"'\":(u||(t!==0&&t!==r)?\" \":\"\")}}}}if(u&&w!==\" \"){while(w.length<3*16+3){w+=\" \"}s+=w+v+\"\\n\"}return u?s:w};n.fromDebug=function(A,s,C){var w=A.length,z=new n(((w+1)/3)|0,s,C);var y=0,x=0,q,B,v=false,D=false,r=false,t=false,u=false;while(y<w){switch(q=A.charAt(y++)){case\"!\":if(!C){if(D||r||t){u=true;break}D=r=t=true}z.offset=z.markedOffset=z.limit=x;v=false;break;case\"|\":if(!C){if(D||t){u=true;break}D=t=true}z.offset=z.limit=x;v=false;break;case\"[\":if(!C){if(D||r){u=true;break}D=r=true}z.offset=z.markedOffset=x;v=false;break;case\"<\":if(!C){if(D){u=true;break}D=true}z.offset=x;v=false;break;case\"]\":if(!C){if(t||r){u=true;break}t=r=true}z.limit=z.markedOffset=x;v=false;break;case\">\":if(!C){if(t){u=true;break}t=true}z.limit=x;v=false;break;case\"'\":if(!C){if(r){u=true;break}r=true}z.markedOffset=x;v=false;break;case\" \":v=false;break;default:if(!C){if(v){u=true;break}}B=parseInt(q+A.charAt(y++),16);if(!C){if(isNaN(B)||B<0||B>255){throw TypeError(\"Illegal str: Not a debug encoded string\")}}z.view[x++]=B;v=true}if(u){throw TypeError(\"Illegal str: Invalid symbol at \"+y)}}if(!C){if(!D||!t){throw TypeError(\"Illegal str: Missing offset or limit\")}if(x<z.buffer.byteLength){throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+x+\" < \"+w)}}return z};l.toHex=function(t,r){t=typeof t===\"undefined\"?this.offset:t;r=typeof r===\"undefined\"?this.limit:r;if(!this.noAssert){if(typeof t!==\"number\"||t%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}t>>>=0;if(typeof r!==\"number\"||r%1!==0){throw TypeError(\"Illegal end: Not an integer\")}r>>>=0;if(t<0||t>r||r>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+t+\" <= \"+r+\" <= \"+this.buffer.byteLength)}}var s=new Array(r-t),q;while(t<r){q=this.view[t++];if(q<16){s.push(\"0\",q.toString(16))}else{s.push(q.toString(16))}}return s.join(\"\")};n.fromHex=function(x,v,u){if(!u){if(typeof x!==\"string\"){throw TypeError(\"Illegal str: Not a string\")}if(x.length%2!==0){throw TypeError(\"Illegal str: Length not a multiple of 2\")}}var r=x.length,w=new n((r/2)|0,v),q;for(var t=0,s=0;t<r;t+=2){q=parseInt(x.substring(t,t+2),16);if(!u){if(!isFinite(q)||q<0||q>255){throw TypeError(\"Illegal str: Contains non-hex characters\")}}w.view[s++]=q}w.limit=s;return w};var o=function(){var q={};q.MAX_CODEPOINT=1114111;q.encodeUTF8=function(s,t){var r=null;if(typeof s===\"number\"){r=s,s=function(){return null}}while(r!==null||(r=s())!==null){if(r<128){t(r&127)}else{if(r<2048){t(((r>>6)&31)|192),t((r&63)|128)}else{if(r<65536){t(((r>>12)&15)|224),t(((r>>6)&63)|128),t((r&63)|128)}else{t(((r>>18)&7)|240),t(((r>>12)&63)|128),t(((r>>6)&63)|128),t((r&63)|128)}}}r=null}};q.decodeUTF8=function(v,x){var t,r,w,u,s=function(y){y=y.slice(0,y.indexOf(null));var z=Error(y.toString());z.name=\"TruncatedError\";z.bytes=y;throw z};while((t=v())!==null){if((t&128)===0){x(t)}else{if((t&224)===192){((r=v())===null)&&s([t,r]),x(((t&31)<<6)|(r&63))}else{if((t&240)===224){((r=v())===null||(w=v())===null)&&s([t,r,w]),x(((t&15)<<12)|((r&63)<<6)|(w&63))}else{if((t&248)===240){((r=v())===null||(w=v())===null||(u=v())===null)&&s([t,r,w,u]),x(((t&7)<<18)|((r&63)<<12)|((w&63)<<6)|(u&63))}else{throw RangeError(\"Illegal starting byte: \"+t)}}}}}};q.UTF16toUTF8=function(t,u){var s,r=null;while(true){if((s=r!==null?r:t())===null){break}if(s>=55296&&s<=57343){if((r=t())!==null){if(r>=56320&&r<=57343){u((s-55296)*1024+r-56320+65536);r=null;continue}}}u(s)}if(r!==null){u(r)}};q.UTF8toUTF16=function(s,t){var r=null;if(typeof s===\"number\"){r=s,s=function(){return null}}while(r!==null||(r=s())!==null){if(r<=65535){t(r)}else{r-=65536,t((r>>10)+55296),t((r%1024)+56320)}r=null}};q.encodeUTF16toUTF8=function(r,s){q.UTF16toUTF8(r,function(t){q.encodeUTF8(t,s)})};q.decodeUTF8toUTF16=function(r,s){q.decodeUTF8(r,function(t){q.UTF8toUTF16(t,s)})};q.calculateCodePoint=function(r){return(r<128)?1:(r<2048)?2:(r<65536)?3:4};q.calculateUTF8=function(t){var s,r=0;while((s=t())!==null){r+=(s<128)?1:(s<2048)?2:(s<65536)?3:4}return r};q.calculateUTF16asUTF8=function(s){var t=0,r=0;q.UTF16toUTF8(s,function(u){++t;r+=(u<128)?1:(u<2048)?2:(u<65536)?3:4});return[t,r]};return q}();l.toUTF8=function(r,q){if(typeof r===\"undefined\"){r=this.offset}if(typeof q===\"undefined\"){q=this.limit}if(!this.noAssert){if(typeof r!==\"number\"||r%1!==0){throw TypeError(\"Illegal begin: Not an integer\")}r>>>=0;if(typeof q!==\"number\"||q%1!==0){throw TypeError(\"Illegal end: Not an integer\")}q>>>=0;if(r<0||r>q||q>this.buffer.byteLength){throw RangeError(\"Illegal range: 0 <= \"+r+\" <= \"+q+\" <= \"+this.buffer.byteLength)}}var t;try{o.decodeUTF8toUTF16(function(){return r<q?this.view[r++]:null}.bind(this),t=f())}catch(s){if(r!==q){throw RangeError(\"Illegal range: Truncated data, \"+r+\" != \"+q)}}return t()};n.fromUTF8=function(u,s,r){if(!r){if(typeof u!==\"string\"){throw TypeError(\"Illegal str: Not a string\")}}var t=new n(o.calculateUTF16asUTF8(b(u),true)[1],s,r),q=0;o.encodeUTF16toUTF8(b(u),function(v){t.view[q++]=v});t.limit=q;return t};return n})(d);var e=(function(j,k,f){var l={};l.ByteBuffer=j;l.c=j;var n=j;l.Long=k||null;l.VERSION=\"5.0.1\";l.WIRE_TYPES={};l.WIRE_TYPES.VARINT=0;l.WIRE_TYPES.BITS64=1;l.WIRE_TYPES.LDELIM=2;l.WIRE_TYPES.STARTGROUP=3;l.WIRE_TYPES.ENDGROUP=4;l.WIRE_TYPES.BITS32=5;l.PACKABLE_WIRE_TYPES=[l.WIRE_TYPES.VARINT,l.WIRE_TYPES.BITS64,l.WIRE_TYPES.BITS32];l.TYPES={int32:{name:\"int32\",wireType:l.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:l.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:l.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:l.WIRE_TYPES.VARINT,defaultValue:l.Long?l.Long.ZERO:undefined},uint64:{name:\"uint64\",wireType:l.WIRE_TYPES.VARINT,defaultValue:l.Long?l.Long.UZERO:undefined},sint64:{name:\"sint64\",wireType:l.WIRE_TYPES.VARINT,defaultValue:l.Long?l.Long.ZERO:undefined},bool:{name:\"bool\",wireType:l.WIRE_TYPES.VARINT,defaultValue:false},\"double\":{name:\"double\",wireType:l.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:l.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:l.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:l.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:l.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:l.WIRE_TYPES.BITS64,defaultValue:l.Long?l.Long.UZERO:undefined},sfixed64:{name:\"sfixed64\",wireType:l.WIRE_TYPES.BITS64,defaultValue:l.Long?l.Long.ZERO:undefined},\"float\":{name:\"float\",wireType:l.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:l.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:l.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:l.WIRE_TYPES.STARTGROUP,defaultValue:null}};l.MAP_KEY_TYPES=[l.TYPES.int32,l.TYPES.sint32,l.TYPES.sfixed32,l.TYPES.uint32,l.TYPES.fixed32,l.TYPES.int64,l.TYPES.sint64,l.TYPES.sfixed64,l.TYPES.uint64,l.TYPES.fixed64,l.TYPES.bool,l.TYPES.string,l.TYPES.bytes];l.ID_MIN=1;l.ID_MAX=536870911;l.convertFieldsToCamelCase=false;l.populateAccessors=true;l.populateDefaults=true;l.Util=(function(){var b={};b.IS_NODE=!!(typeof process===\"object\"&&process+\"\"===\"[object process]\"&&!process.browser);b.XHR=function(){var r=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}];var o=null;for(var q=0;q<r.length;q++){try{o=r[q]()}catch(p){continue}break}if(!o){throw Error(\"XMLHttpRequest is not supported\")}return o};b.fetch=function(q,o){if(o&&typeof o!=\"function\"){o=null}if(b.IS_NODE){if(o){g.readFile(q,function(t,s){if(t){o(null)}else{o(\"\"+s)}})}else{try{return g.readFileSync(q)}catch(r){return null}}}else{var p=b.XHR();p.open(\"GET\",q,o?true:false);p.setRequestHeader(\"Accept\",\"text/plain\");if(typeof p.overrideMimeType===\"function\"){p.overrideMimeType(\"text/plain\")}if(o){p.onreadystatechange=function(){if(p.readyState!=4){return}if(p.status==200||(p.status==0&&typeof p.responseText===\"string\")){o(p.responseText)}else{o(null)}};if(p.readyState==4){return}p.send(null)}else{p.send(null);if(p.status==200||(p.status==0&&typeof p.responseText===\"string\")){return p.responseText}return null}}};b.toCamelCase=function(o){return o.replace(/_([a-zA-Z])/g,function(p,q){return q.toUpperCase()})};return b})();l.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g};l.DotProto=(function(s,t){var q={};var r=function(o){this.source=o+\"\";this.index=0;this.line=1;this.stack=[];this._stringOpen=null};var b=r.prototype;b._readString=function(){var o=this._stringOpen==='\"'?t.STRING_DQ:t.STRING_SQ;o.lastIndex=this.index-1;var y=o.exec(this.source);if(!y){throw Error(\"unterminated string\")}this.index=o.lastIndex;this.stack.push(this._stringOpen);this._stringOpen=null;return y[1]};b.next=function(){if(this.stack.length>0){return this.stack.shift()}if(this.index>=this.source.length){return null}if(this._stringOpen!==null){return this._readString()}var y,z,A;do{y=false;while(t.WHITESPACE.test(A=this.source.charAt(this.index))){if(A===\"\\n\"){++this.line}if(++this.index===this.source.length){return null}}if(this.source.charAt(this.index)===\"/\"){++this.index;if(this.source.charAt(this.index)===\"/\"){while(this.source.charAt(++this.index)!==\"\\n\"){if(this.index==this.source.length){return null}}++this.index;++this.line;y=true}else{if((A=this.source.charAt(this.index))===\"*\"){do{if(A===\"\\n\"){++this.line}if(++this.index===this.source.length){return null}z=A;A=this.source.charAt(this.index)}while(z!==\"*\"||A!==\"/\");++this.index;y=true}else{return\"/\"}}}}while(y);if(this.index===this.source.length){return null}var C=this.index;t.DELIM.lastIndex=0;var o=t.DELIM.test(this.source.charAt(C++));if(!o){while(C<this.source.length&&!t.DELIM.test(this.source.charAt(C))){++C}}var B=this.source.substring(this.index,this.index=C);if(B==='\"'||B===\"'\"){this._stringOpen=B}return B};b.peek=function(){if(this.stack.length===0){var o=this.next();if(o===null){return null}this.stack.push(o)}return this.stack[0]};b.skip=function(y){var o=this.next();if(o!==y){throw Error(\"illegal '\"+o+\"', '\"+y+\"' expected\")}};b.omit=function(o){if(this.peek()===o){this.next();return true}return false};b.toString=function(){return\"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"};q.Tokenizer=r;var u=function(o){this.tn=new r(o);this.proto3=false};var w=u.prototype;w.parse=function(){var A={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]};var y,z=true;try{while(y=this.tn.next()){switch(y){case\"package\":if(!z||A[\"package\"]!==null){throw Error(\"unexpected 'package'\")}y=this.tn.next();if(!t.TYPEREF.test(y)){throw Error(\"illegal package name: \"+y)}this.tn.skip(\";\");A[\"package\"]=y;break;case\"import\":if(!z){throw Error(\"unexpected 'import'\")}y=this.tn.peek();if(y===\"public\"){this.tn.next()}y=this._readString();this.tn.skip(\";\");A.imports.push(y);break;case\"syntax\":if(!z){throw Error(\"unexpected 'syntax'\")}this.tn.skip(\"=\");if((A.syntax=this._readString())===\"proto3\"){this.proto3=true}this.tn.skip(\";\");break;case\"message\":this._parseMessage(A,null);z=false;break;case\"enum\":this._parseEnum(A);z=false;break;case\"option\":this._parseOption(A);break;case\"service\":this._parseService(A);break;case\"extend\":this._parseExtend(A);break;default:throw Error(\"unexpected '\"+y+\"'\")}}}catch(o){o.message=\"Parse error at line \"+this.tn.line+\": \"+o.message;throw o}delete A.name;return A};u.parse=function(o){return new u(o).parse()};function x(y,z){var o=-1,A=1;if(y.charAt(0)==\"-\"){A=-1;y=y.substring(1)}if(t.NUMBER_DEC.test(y)){o=parseInt(y)}else{if(t.NUMBER_HEX.test(y)){o=parseInt(y.substring(2),16)}else{if(t.NUMBER_OCT.test(y)){o=parseInt(y.substring(1),8)}else{throw Error(\"illegal id value: \"+(A<0?\"-\":\"\")+y)}}}o=(A*o)|0;if(!z&&o<0){throw Error(\"illegal id value: \"+(A<0?\"-\":\"\")+y)}return o}function p(o){var y=1;if(o.charAt(0)==\"-\"){y=-1;o=o.substring(1)}if(t.NUMBER_DEC.test(o)){return y*parseInt(o,10)}else{if(t.NUMBER_HEX.test(o)){return y*parseInt(o.substring(2),16)}else{if(t.NUMBER_OCT.test(o)){return y*parseInt(o.substring(1),8)}else{if(o===\"inf\"){return y*Infinity}else{if(o===\"nan\"){return NaN}else{if(t.NUMBER_FLT.test(o)){return y*parseFloat(o)}}}}}}throw Error(\"illegal number value: \"+(y<0?\"-\":\"\")+o)}w._readString=function(){var y=\"\",z,o;do{o=this.tn.next();if(o!==\"'\"&&o!=='\"'){throw Error(\"illegal string delimiter: \"+o)}y+=this.tn.next();this.tn.skip(o);z=this.tn.peek()}while(z==='\"'||z==='\"');return y};w._readValue=function(z){var y=this.tn.peek(),o;if(y==='\"'||y===\"'\"){return this._readString()}this.tn.next();if(t.NUMBER.test(y)){return p(y)}if(t.BOOL.test(y)){return(y.toLowerCase()===\"true\")}if(z&&t.TYPEREF.test(y)){return y}throw Error(\"illegal value: \"+y)};w._parseOption=function(z,o){var A=this.tn.next(),y=false;if(A===\"(\"){y=true;A=this.tn.next()}if(!t.TYPEREF.test(A)){throw Error(\"illegal option name: \"+A)}var B=A;if(y){this.tn.skip(\")\");B=\"(\"+B+\")\";A=this.tn.peek();if(t.FQTYPEREF.test(A)){B+=A;this.tn.next()}}this.tn.skip(\"=\");this._parseOptionValue(z,B);if(!o){this.tn.skip(\";\")}};function v(y,z,o){if(typeof y[z]===\"undefined\"){y[z]=o}else{if(!Array.isArray(y[z])){y[z]=[y[z]]}y[z].push(o)}}w._parseOptionValue=function(o,z){var y=this.tn.peek();if(y!==\"{\"){v(o.options,z,this._readValue(true))}else{this.tn.skip(\"{\");while((y=this.tn.next())!==\"}\"){if(!t.NAME.test(y)){throw Error(\"illegal option name: \"+z+\".\"+y)}if(this.tn.omit(\":\")){v(o.options,z+\".\"+y,this._readValue(true))}else{this._parseOptionValue(o,z+\".\"+y)}}}};w._parseService=function(y){var z=this.tn.next();if(!t.NAME.test(z)){throw Error(\"illegal service name at line \"+this.tn.line+\": \"+z)}var A=z;var o={name:A,rpc:{},options:{}};this.tn.skip(\"{\");while((z=this.tn.next())!==\"}\"){if(z===\"option\"){this._parseOption(o)}else{if(z===\"rpc\"){this._parseServiceRPC(o)}else{throw Error(\"illegal service token: \"+z)}}}this.tn.omit(\";\");y.services.push(o)};w._parseServiceRPC=function(y){var z=\"rpc\",A=this.tn.next();if(!t.NAME.test(A)){throw Error(\"illegal rpc service method name: \"+A)}var B=A;var o={request:null,response:null,request_stream:false,response_stream:false,options:{}};this.tn.skip(\"(\");A=this.tn.next();if(A.toLowerCase()===\"stream\"){o.request_stream=true;A=this.tn.next()}if(!t.TYPEREF.test(A)){throw Error(\"illegal rpc service request type: \"+A)}o.request=A;this.tn.skip(\")\");A=this.tn.next();if(A.toLowerCase()!==\"returns\"){throw Error(\"illegal rpc service request type delimiter: \"+A)}this.tn.skip(\"(\");A=this.tn.next();if(A.toLowerCase()===\"stream\"){o.response_stream=true;A=this.tn.next()}o.response=A;this.tn.skip(\")\");A=this.tn.peek();if(A===\"{\"){this.tn.next();while((A=this.tn.next())!==\"}\"){if(A===\"option\"){this._parseOption(o)}else{throw Error(\"illegal rpc service token: \"+A)}}this.tn.omit(\";\")}else{this.tn.skip(\";\")}if(typeof y[z]===\"undefined\"){y[z]={}}y[z][B]=o};w._parseMessage=function(z,A){var o=!!A,B=this.tn.next();var y={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(B)){throw Error(\"illegal \"+(o?\"group\":\"message\")+\" name: \"+B)}y.name=B;if(o){this.tn.skip(\"=\");A.id=x(this.tn.next());y.isGroup=true}B=this.tn.peek();if(B===\"[\"&&A){this._parseFieldOptions(A)}this.tn.skip(\"{\");while((B=this.tn.next())!==\"}\"){if(t.RULE.test(B)){this._parseMessageField(y,B)}else{if(B===\"oneof\"){this._parseMessageOneOf(y)}else{if(B===\"enum\"){this._parseEnum(y)}else{if(B===\"message\"){this._parseMessage(y)}else{if(B===\"option\"){this._parseOption(y)}else{if(B===\"service\"){this._parseService(y)}else{if(B===\"extensions\"){y.extensions=this._parseExtensionRanges()}else{if(B===\"reserved\"){this._parseIgnored()}else{if(B===\"extend\"){this._parseExtend(y)}else{if(t.TYPEREF.test(B)){if(!this.proto3){throw Error(\"illegal field rule: \"+B)}this._parseMessageField(y,\"optional\",B)}else{throw Error(\"illegal message token: \"+B)}}}}}}}}}}}this.tn.omit(\";\");z.messages.push(y);return y};w._parseIgnored=function(){while(this.tn.peek()!==\";\"){this.tn.next()}this.tn.skip(\";\")};w._parseMessageField=function(o,y,z){if(!t.RULE.test(y)){throw Error(\"illegal message field rule: \"+y)}var A={rule:y,type:\"\",name:\"\",options:{},id:0};var B;if(y===\"map\"){if(z){throw Error(\"illegal type: \"+z)}this.tn.skip(\"<\");B=this.tn.next();if(!t.TYPE.test(B)&&!t.TYPEREF.test(B)){throw Error(\"illegal message field type: \"+B)}A.keytype=B;this.tn.skip(\",\");B=this.tn.next();if(!t.TYPE.test(B)&&!t.TYPEREF.test(B)){throw Error(\"illegal message field: \"+B)}A.type=B;this.tn.skip(\">\");B=this.tn.next();if(!t.NAME.test(B)){throw Error(\"illegal message field name: \"+B)}A.name=B;this.tn.skip(\"=\");A.id=x(this.tn.next());B=this.tn.peek();if(B===\"[\"){this._parseFieldOptions(A)}this.tn.skip(\";\")}else{z=typeof z!==\"undefined\"?z:this.tn.next();if(z===\"group\"){var C=this._parseMessage(o,A);if(!/^[A-Z]/.test(C.name)){throw Error(\"illegal group name: \"+C.name)}A.type=C.name;A.name=C.name.toLowerCase();this.tn.omit(\";\")}else{if(!t.TYPE.test(z)&&!t.TYPEREF.test(z)){throw Error(\"illegal message field type: \"+z)}A.type=z;B=this.tn.next();if(!t.NAME.test(B)){throw Error(\"illegal message field name: \"+B)}A.name=B;this.tn.skip(\"=\");A.id=x(this.tn.next());B=this.tn.peek();if(B===\"[\"){this._parseFieldOptions(A)}this.tn.skip(\";\")}}o.fields.push(A);return A};w._parseMessageOneOf=function(o){var y=this.tn.next();if(!t.NAME.test(y)){throw Error(\"illegal oneof name: \"+y)}var A=y,z;var B=[];this.tn.skip(\"{\");while((y=this.tn.next())!==\"}\"){z=this._parseMessageField(o,\"optional\",y);z.oneof=A;B.push(z.id)}this.tn.omit(\";\");o.oneofs[A]=B};w._parseFieldOptions=function(y){this.tn.skip(\"[\");var z,o=true;while((z=this.tn.peek())!==\"]\"){if(!o){this.tn.skip(\",\")}this._parseOption(y,true);o=false}this.tn.next()};w._parseEnum=function(o){var A={name:\"\",values:[],options:{}};var z=this.tn.next();if(!t.NAME.test(z)){throw Error(\"illegal name: \"+z)}A.name=z;this.tn.skip(\"{\");while((z=this.tn.next())!==\"}\"){if(z===\"option\"){this._parseOption(A)}else{if(!t.NAME.test(z)){throw Error(\"illegal name: \"+z)}this.tn.skip(\"=\");var y={name:z,id:x(this.tn.next(),true)};z=this.tn.peek();if(z===\"[\"){this._parseFieldOptions({options:{}})}this.tn.skip(\";\");A.values.push(y)}}this.tn.omit(\";\");o.enums.push(A)};w._parseExtensionRanges=function(){var A=[];var y,z,o;do{z=[];while(true){y=this.tn.next();switch(y){case\"min\":o=s.ID_MIN;break;case\"max\":o=s.ID_MAX;break;default:o=p(y);break}z.push(o);if(z.length===2){break}if(this.tn.peek()!==\"to\"){z.push(o);break}this.tn.next()}A.push(z)}while(this.tn.omit(\",\"));this.tn.skip(\";\");return A};w._parseExtend=function(o){var z=this.tn.next();if(!t.TYPEREF.test(z)){throw Error(\"illegal extend reference: \"+z)}var y={ref:z,fields:[]};this.tn.skip(\"{\");while((z=this.tn.next())!==\"}\"){if(t.RULE.test(z)){this._parseMessageField(y,z)}else{if(t.TYPEREF.test(z)){if(!this.proto3){throw Error(\"illegal field rule: \"+z)}this._parseMessageField(y,\"optional\",z)}else{throw Error(\"illegal extend token: \"+z)}}}this.tn.omit(\";\");o.messages.push(y);return y};w.toString=function(){return\"Parser at line \"+this.tn.line};q.Parser=u;return q})(l,l.Lang);l.Reflect=(function(V){var aa={};var Z=function(q,o,p){this.builder=q;this.parent=o;this.name=p;this.className};var ab=Z.prototype;ab.fqn=function(){var p=this.name,o=this;do{o=o.parent;if(o==null){break}p=o.name+\".\"+p}while(true);return p};ab.toString=function(o){return(o?this.className+\" \":\"\")+this.fqn()};ab.build=function(){throw Error(this.toString(true)+\" cannot be built directly\")};aa.T=Z;var P=function(r,o,p,q,s){Z.call(this,r,o,p);this.className=\"Namespace\";this.children=[];this.options=q||{};this.syntax=s||\"proto2\"};var H=P.prototype=Object.create(Z.prototype);H.getChildren=function(o){o=o||null;if(o==null){return this.children.slice()}var p=[];for(var q=0,r=this.children.length;q<r;++q){if(this.children[q] instanceof o){p.push(this.children[q])}}return p};H.addChild=function(o){var p;if(p=this.getChild(o.name)){if(p instanceof ad.Field&&p.name!==p.originalName&&this.getChild(p.originalName)===null){p.name=p.originalName}else{if(o instanceof ad.Field&&o.name!==o.originalName&&this.getChild(o.originalName)===null){o.name=o.originalName}else{throw Error(\"Duplicate name in namespace \"+this.toString(true)+\": \"+o.name)}}}this.children.push(o)};H.getChild=function(o){var p=typeof o===\"number\"?\"id\":\"name\";for(var q=0,r=this.children.length;q<r;++q){if(this.children[q][p]===o){return this.children[q]}}return null};H.resolve=function(q,t){var s=typeof q===\"string\"?q.split(\".\"):q,o=this,r=0;if(s[r]===\"\"){while(o.parent!==null){o=o.parent}r++}var p;do{do{if(!(o instanceof aa.Namespace)){o=null;break}p=o.getChild(s[r]);if(!p||!(p instanceof aa.T)||(t&&!(p instanceof aa.Namespace))){o=null;break}o=p;r++}while(r<s.length);if(o!=null){break}if(this.parent!==null){return this.parent.resolve(q,t)}}while(o!=null);return o};H.qn=function(q){var r=[],o=q;do{r.unshift(o.name);o=o.parent}while(o!==null);for(var s=1;s<=r.length;s++){var p=r.slice(r.length-s);if(q===this.resolve(p,q instanceof aa.Namespace)){return p.join(\".\")}}return q.fqn()};H.build=function(){var p={};var q=this.children;for(var r=0,s=q.length,o;r<s;++r){o=q[r];if(o instanceof P){p[o.name]=o.build()}}if(Object.defineProperty){Object.defineProperty(p,\"$options\",{value:this.buildOpt()})}return p};H.buildOpt=function(){var q={},p=Object.keys(this.options);for(var r=0,t=p.length;r<t;++r){var s=p[r],o=this.options[p[r]];q[s]=o}return q};H.getOption=function(o){if(typeof o===\"undefined\"){return this.options}return typeof this.options[o]!==\"undefined\"?this.options[o]:null};aa.Namespace=P;var J=function(o,q,p,r){this.type=o;this.resolvedType=q;this.isMapKey=p;this.syntax=r;if(p&&V.MAP_KEY_TYPES.indexOf(o)<0){throw Error(\"Invalid map key type: \"+o.name)}};var b=J.prototype;function F(o){if(typeof o===\"string\"){o=V.TYPES[o]}if(typeof o.defaultValue===\"undefined\"){throw Error(\"default value for type \"+o.name+\" is not supported\")}if(o==V.TYPES.bytes){return new n(0)}return o.defaultValue}J.defaultFieldValue=F;function W(o,p){if(o&&typeof o.low===\"number\"&&typeof o.high===\"number\"&&typeof o.unsigned===\"boolean\"&&o.low===o.low&&o.high===o.high){return new V.Long(o.low,o.high,typeof p===\"undefined\"?o.unsigned:p)}if(typeof o===\"string\"){return V.Long.fromString(o,p||false,10)}if(typeof o===\"number\"){return V.Long.fromNumber(o,p||false)}throw Error(\"not convertible to Long\")}b.verifyValue=function(q){var t=function(v,u){throw Error(\"Illegal value for \"+this.toString(true)+\" of type \"+this.type.name+\": \"+v+\" (\"+u+\")\")}.bind(this);switch(this.type){case V.TYPES.int32:case V.TYPES.sint32:case V.TYPES.sfixed32:if(typeof q!==\"number\"||(q===q&&q%1!==0)){t(typeof q,\"not an integer\")}return q>4294967295?q|0:q;case V.TYPES.uint32:case V.TYPES.fixed32:if(typeof q!==\"number\"||(q===q&&q%1!==0)){t(typeof q,\"not an integer\")}return q<0?q>>>0:q;case V.TYPES.int64:case V.TYPES.sint64:case V.TYPES.sfixed64:if(V.Long){try{return W(q,false)}catch(o){t(typeof q,o.message)}}else{t(typeof q,\"requires Long.js\")}case V.TYPES.uint64:case V.TYPES.fixed64:if(V.Long){try{return W(q,true)}catch(o){t(typeof q,o.message)}}else{t(typeof q,\"requires Long.js\")}case V.TYPES.bool:if(typeof q!==\"boolean\"){t(typeof q,\"not a boolean\")}return q;case V.TYPES[\"float\"]:case V.TYPES[\"double\"]:if(typeof q!==\"number\"){t(typeof q,\"not a number\")}return q;case V.TYPES.string:if(typeof q!==\"string\"&&!(q&&q instanceof String)){t(typeof q,\"not a string\")}return\"\"+q;case V.TYPES.bytes:if(j.isByteBuffer(q)){return q}return j.wrap(q);case V.TYPES[\"enum\"]:var s=this.resolvedType.getChildren(V.Reflect.Enum.Value);for(r=0;r<s.length;r++){if(s[r].name==q){return s[r].id}else{if(s[r].id==q){return s[r].id}}}if(this.syntax===\"proto3\"){if(typeof q!==\"number\"||(q===q&&q%1!==0)){t(typeof q,\"not an integer\")}if(q>4294967295||q<0){t(typeof q,\"not in range for uint32\")}return q}else{t(q,\"not a valid enum value\")}case V.TYPES.group:case V.TYPES.message:if(!q||typeof q!==\"object\"){t(typeof q,\"object expected\")}if(q instanceof this.resolvedType.clazz){return q}if(q instanceof V.Builder.Message){var p={};for(var r in q){if(q.hasOwnProperty(r)){p[r]=q[r]}}q=p}return new (this.resolvedType.clazz)(q)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(true)+\": \"+q+\" (undefined type \"+this.type+\")\")};b.calculateLength=function(o,q){if(q===null){return 0}var p;switch(this.type){case V.TYPES.int32:return q<0?n.calculateVarint64(q):n.calculateVarint32(q);case V.TYPES.uint32:return n.calculateVarint32(q);case V.TYPES.sint32:return n.calculateVarint32(n.zigZagEncode32(q));case V.TYPES.fixed32:case V.TYPES.sfixed32:case V.TYPES[\"float\"]:return 4;case V.TYPES.int64:case V.TYPES.uint64:return n.calculateVarint64(q);case V.TYPES.sint64:return n.calculateVarint64(n.zigZagEncode64(q));case V.TYPES.fixed64:case V.TYPES.sfixed64:return 8;case V.TYPES.bool:return 1;case V.TYPES[\"enum\"]:return n.calculateVarint32(q);case V.TYPES[\"double\"]:return 8;case V.TYPES.string:p=n.calculateUTF8Bytes(q);return n.calculateVarint32(p)+p;case V.TYPES.bytes:if(q.remaining()<0){throw Error(\"Illegal value for \"+this.toString(true)+\": \"+q.remaining()+\" bytes remaining\")}return n.calculateVarint32(q.remaining())+q.remaining();case V.TYPES.message:p=this.resolvedType.calculate(q);return n.calculateVarint32(p)+p;case V.TYPES.group:p=this.resolvedType.calculate(q);return p+n.calculateVarint32((o<<3)|V.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+q+\" (unknown type)\")};b.encodeValue=function(o,r,s){if(r===null){return s}switch(this.type){case V.TYPES.int32:if(r<0){s.writeVarint64(r)}else{s.writeVarint32(r)}break;case V.TYPES.uint32:s.writeVarint32(r);break;case V.TYPES.sint32:s.writeVarint32ZigZag(r);break;case V.TYPES.fixed32:s.writeUint32(r);break;case V.TYPES.sfixed32:s.writeInt32(r);break;case V.TYPES.int64:case V.TYPES.uint64:s.writeVarint64(r);break;case V.TYPES.sint64:s.writeVarint64ZigZag(r);break;case V.TYPES.fixed64:s.writeUint64(r);break;case V.TYPES.sfixed64:s.writeInt64(r);break;case V.TYPES.bool:if(typeof r===\"string\"){s.writeVarint32(r.toLowerCase()===\"false\"?0:!!r)}else{s.writeVarint32(r?1:0)}break;case V.TYPES[\"enum\"]:s.writeVarint32(r);break;case V.TYPES[\"float\"]:s.writeFloat32(r);break;case V.TYPES[\"double\"]:s.writeFloat64(r);break;case V.TYPES.string:s.writeVString(r);break;case V.TYPES.bytes:if(r.remaining()<0){throw Error(\"Illegal value for \"+this.toString(true)+\": \"+r.remaining()+\" bytes remaining\")}var q=r.offset;s.writeVarint32(r.remaining());s.append(r);r.offset=q;break;case V.TYPES.message:var p=new n().LE();this.resolvedType.encode(r,p);s.writeVarint32(p.offset);s.append(p.flip());break;case V.TYPES.group:this.resolvedType.encode(r,s);s.writeVarint32((o<<3)|V.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+r+\" (unknown type)\")}return s};b.decode=function(r,s,o){if(s!=this.type.wireType){throw Error(\"Unexpected wire type for element\")}var q,p;switch(this.type){case V.TYPES.int32:return r.readVarint32()|0;case V.TYPES.uint32:return r.readVarint32()>>>0;case V.TYPES.sint32:return r.readVarint32ZigZag()|0;case V.TYPES.fixed32:return r.readUint32()>>>0;case V.TYPES.sfixed32:return r.readInt32()|0;case V.TYPES.int64:return r.readVarint64();case V.TYPES.uint64:return r.readVarint64().toUnsigned();case V.TYPES.sint64:return r.readVarint64ZigZag();case V.TYPES.fixed64:return r.readUint64();case V.TYPES.sfixed64:return r.readInt64();case V.TYPES.bool:return !!r.readVarint32();case V.TYPES[\"enum\"]:return r.readVarint32();case V.TYPES[\"float\"]:return r.readFloat();case V.TYPES[\"double\"]:return r.readDouble();case V.TYPES.string:return r.readVString();case V.TYPES.bytes:p=r.readVarint32();if(r.remaining()<p){throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+p+\" required but got only \"+r.remaining())}q=r.clone();q.limit=q.offset+p;r.offset+=p;return q;case V.TYPES.message:p=r.readVarint32();return this.resolvedType.decode(r,p);case V.TYPES.group:return this.resolvedType.decode(r,-1,o)}throw Error(\"[INTERNAL] Illegal decode type\")};b.valueFromString=function(o){if(!this.isMapKey){throw Error(\"valueFromString() called on non-map-key element\")}switch(this.type){case V.TYPES.int32:case V.TYPES.sint32:case V.TYPES.sfixed32:case V.TYPES.uint32:case V.TYPES.fixed32:return this.verifyValue(parseInt(o));case V.TYPES.int64:case V.TYPES.sint64:case V.TYPES.sfixed64:case V.TYPES.uint64:case V.TYPES.fixed64:return this.verifyValue(o);case V.TYPES.bool:return o===\"true\";case V.TYPES.string:return this.verifyValue(o);case V.TYPES.bytes:return n.fromBinary(o)}};b.valueToString=function(o){if(!this.isMapKey){throw Error(\"valueToString() called on non-map-key element\")}if(this.type===V.TYPES.bytes){return o.toString(\"binary\")}else{return o.toString()}};aa.Element=J;var ad=function(s,p,q,r,o,t){P.call(this,s,p,q,r,t);this.className=\"Message\";this.extensions=undefined;this.clazz=null;this.isGroup=!!o;this._fields=null;this._fieldsById=null;this._fieldsByName=null};var L=ad.prototype=Object.create(P.prototype);L.build=function(s){if(this.clazz&&!s){return this.clazz}var q=(function(y,E){var A=E.getChildren(y.Reflect.Message.Field),v=E.getChildren(y.Reflect.Message.OneOf);var x=function(ak,ag){y.Builder.Message.call(this);for(var aj=0,af=v.length;aj<af;++aj){this[v[aj].name]=null}for(aj=0,af=A.length;aj<af;++aj){var ah=A[aj];this[ah.name]=ah.repeated?[]:(ah.map?new y.Map(ah):null);if((ah.required||E.syntax===\"proto3\")&&ah.defaultValue!==null){this[ah.name]=ah.defaultValue}}if(arguments.length>0){var ai;if(arguments.length===1&&ak!==null&&typeof ak===\"object\"&&(typeof ak.encode!==\"function\"||ak instanceof x)&&!Array.isArray(ak)&&!(ak instanceof y.Map)&&!n.isByteBuffer(ak)&&!(ak instanceof ArrayBuffer)&&!(y.Long&&ak instanceof y.Long)){this.$set(ak)}else{for(aj=0,af=arguments.length;aj<af;++aj){if(typeof(ai=arguments[aj])!==\"undefined\"){this.$set(A[aj].name,ai)}}}}};var B=x.prototype=Object.create(y.Builder.Message.prototype);B.add=function(af,ai,ah){var ag=E._fieldsByName[af];if(!ah){if(!ag){throw Error(this+\"#\"+af+\" is undefined\")}if(!(ag instanceof y.Reflect.Message.Field)){throw Error(this+\"#\"+af+\" is not a field: \"+ag.toString(true))}if(!ag.repeated){throw Error(this+\"#\"+af+\" is not a repeated field\")}ai=ag.verifyValue(ai,true)}if(this[af]===null){this[af]=[]}this[af].push(ai);return this};B.$add=B.add;B.set=function(ag,ak,ah){if(ag&&typeof ag===\"object\"){ah=ak;for(var aj in ag){if(ag.hasOwnProperty(aj)&&typeof(ak=ag[aj])!==\"undefined\"){this.$set(aj,ak,ah)}}return this}var ai=E._fieldsByName[ag];if(!ah){if(!ai){throw Error(this+\"#\"+ag+\" is not a field: undefined\")}if(!(ai instanceof y.Reflect.Message.Field)){throw Error(this+\"#\"+ag+\" is not a field: \"+ai.toString(true))}this[ai.name]=(ak=ai.verifyValue(ak))}else{this[ag]=ak}if(ai&&ai.oneof){var af=this[ai.oneof.name];if(ak!==null){if(af!==null&&af!==ai.name){this[af]=null}this[ai.oneof.name]=ai.name}else{if(af===ag){this[ai.oneof.name]=null}}}return this};B.$set=B.set;B.get=function(af,ag){if(ag){return this[af]}var ah=E._fieldsByName[af];if(!ah||!(ah instanceof y.Reflect.Message.Field)){throw Error(this+\"#\"+af+\" is not a field: undefined\")}if(!(ah instanceof y.Reflect.Message.Field)){throw Error(this+\"#\"+af+\" is not a field: \"+ah.toString(true))}return this[ah.name]};B.$get=B.get;for(var D=0;D<A.length;D++){var w=A[D];if(w instanceof y.Reflect.Message.ExtensionField){continue}if(E.builder.options.populateAccessors){(function(ai){var aj=ai.originalName.replace(/(_[a-zA-Z])/g,function(ak){return ak.toUpperCase().replace(\"_\",\"\")});aj=aj.substring(0,1).toUpperCase()+aj.substring(1);var ah=ai.originalName.replace(/([A-Z])/g,function(ak){return\"_\"+ak});var ag=function(al,ak){this[ai.name]=ak?al:ai.verifyValue(al);return this};var af=function(){return this[ai.name]};if(E.getChild(\"set\"+aj)===null){B[\"set\"+aj]=ag}if(E.getChild(\"set_\"+ah)===null){B[\"set_\"+ah]=ag}if(E.getChild(\"get\"+aj)===null){B[\"get\"+aj]=af}if(E.getChild(\"get_\"+ah)===null){B[\"get_\"+ah]=af}})(w)}}B.encode=function(aj,ai){if(typeof aj===\"boolean\"){ai=aj,aj=undefined}var af=false;if(!aj){aj=new j(),af=true}var ah=aj.littleEndian;try{E.encode(this,aj.LE(),ai);return(af?aj.flip():aj).LE(ah)}catch(ag){aj.LE(ah);throw (ag)}};x.encode=function(ag,af,ah){return new x(ag).encode(af,ah)};B.calculate=function(){return E.calculate(this)};B.encodeDelimited=function(ah){var af=false;if(!ah){ah=new n(),af=true}var ag=new n().LE();E.encode(this,ag).flip();ah.writeVarint32(ag.remaining());ah.append(ag);return af?ah.flip():ah};B.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(af){if(af.encoded){af.encoded=af.encoded.toArrayBuffer()}throw (af)}};B.toArrayBuffer=B.encodeAB;B.encodeNB=function(){try{return this.encode().toBuffer()}catch(af){if(af.encoded){af.encoded=af.encoded.toBuffer()}throw (af)}};B.toBuffer=B.encodeNB;B.encode64=function(){try{return this.encode().toBase64()}catch(af){if(af.encoded){af.encoded=af.encoded.toBase64()}throw (af)}};B.toBase64=B.encode64;B.encodeHex=function(){try{return this.encode().toHex()}catch(af){if(af.encoded){af.encoded=af.encoded.toHex()}throw (af)}};B.toHex=B.encodeHex;function u(aj,aq,at,am){if(aj===null||typeof aj!==\"object\"){if(am&&am instanceof y.Reflect.Enum){var al=y.Reflect.Enum.getName(am.object,aj);if(al!==null){return al}}return aj}if(n.isByteBuffer(aj)){return aq?aj.toBase64():aj.toBuffer()}if(y.Long.isLong(aj)){return at?aj.toString():y.Long.fromValue(aj)}var ao;if(Array.isArray(aj)){ao=[];aj.forEach(function(ag,af){ao[af]=u(ag,aq,at,am)});return ao}ao={};if(aj instanceof y.Map){var ai=aj.entries();for(var ar=ai.next();!ar.done;ar=ai.next()){ao[aj.keyElem.valueToString(ar.value[0])]=u(ar.value[1],aq,at,aj.valueElem.resolvedType)}return ao}var ap=aj.$type,an=undefined;for(var ak in aj){if(aj.hasOwnProperty(ak)){if(ap&&(an=ap.getChild(ak))){ao[ak]=u(aj[ak],aq,at,an.resolvedType)}else{ao[ak]=u(aj[ak],aq,at)}}}return ao}B.toRaw=function(af,ag){return u(this,!!af,!!ag,this.$type)};B.encodeJSON=function(){return JSON.stringify(u(this,true,true,this.$type))};x.decode=function(af,aj){if(typeof af===\"string\"){af=n.wrap(af,aj?aj:\"base64\")}af=n.isByteBuffer(af)?af:n.wrap(af);var ai=af.littleEndian;try{var ag=E.decode(af.LE());af.LE(ai);return ag}catch(ah){af.LE(ai);throw (ah)}};x.decodeDelimited=function(ak,aj){if(typeof ak===\"string\"){ak=n.wrap(ak,aj?aj:\"base64\")}ak=n.isByteBuffer(ak)?ak:n.wrap(ak);if(ak.remaining()<1){return null}var ag=ak.offset,af=ak.readVarint32();if(ak.remaining()<af){ak.offset=ag;return null}try{var ah=E.decode(ak.slice(ak.offset,ak.offset+af).LE());ak.offset+=af;return ah}catch(ai){ak.offset+=af;throw ai}};x.decode64=function(af){return x.decode(af,\"base64\")};x.decodeHex=function(af){return x.decode(af,\"hex\")};x.decodeJSON=function(af){return new x(JSON.parse(af))};B.toString=function(){return E.toString()};var ae;var C;var t;var z;if(Object.defineProperty){Object.defineProperty(x,\"$options\",{value:E.buildOpt()}),Object.defineProperty(B,\"$options\",{value:x[\"$options\"]}),Object.defineProperty(x,\"$type\",{value:E}),Object.defineProperty(B,\"$type\",{value:E})}return x})(V,this);this._fields=[];this._fieldsById={};this._fieldsByName={};for(var p=0,r=this.children.length,o;p<r;p++){o=this.children[p];if(o instanceof M||o instanceof ad||o instanceof Q){if(q.hasOwnProperty(o.name)){throw Error(\"Illegal reflect child of \"+this.toString(true)+\": \"+o.toString(true)+\" cannot override static property '\"+o.name+\"'\")}q[o.name]=o.build()}else{if(o instanceof ad.Field){o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o}else{if(!(o instanceof ad.OneOf)&&!(o instanceof T)){throw Error(\"Illegal reflect child of \"+this.toString(true)+\": \"+this.children[p].toString(true))}}}}return this.clazz=q};L.encode=function(o,s,r){var w=null,p;for(var q=0,t=this._fields.length,v;q<t;++q){p=this._fields[q];v=o[p.name];if(p.required&&v===null){if(w===null){w=p}}else{p.encode(r?v:p.verifyValue(v),s,o)}}if(w!==null){var u=Error(\"Missing at least one required field for \"+this.toString(true)+\": \"+w);u.encoded=s;throw (u)}return s};L.calculate=function(r){for(var o=0,s=0,t=this._fields.length,q,p;s<t;++s){q=this._fields[s];p=r[q.name];if(q.required&&p===null){throw Error(\"Missing at least one required field for \"+this.toString(true)+\": \"+q)}else{o+=q.calculate(p,r)}}return o};function O(p,q){var r=q.readVarint32(),s=r&7,o=r>>>3;switch(s){case V.WIRE_TYPES.VARINT:do{r=q.readUint8()}while((r&128)===128);break;case V.WIRE_TYPES.BITS64:q.offset+=8;break;case V.WIRE_TYPES.LDELIM:r=q.readVarint32();q.offset+=r;break;case V.WIRE_TYPES.STARTGROUP:O(o,q);break;case V.WIRE_TYPES.ENDGROUP:if(o===p){return false}else{throw Error(\"Illegal GROUPEND after unknown group: \"+o+\" (\"+p+\" expected)\")}case V.WIRE_TYPES.BITS32:q.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+p+\": \"+s)}return true}L.decode=function(w,A,u){A=typeof A===\"number\"?A:-1;var C=w.offset,z=new (this.clazz)(),o,p,B,r;while(w.offset<C+A||(A===-1&&w.remaining()>0)){o=w.readVarint32();p=o&7;B=o>>>3;if(p===V.WIRE_TYPES.ENDGROUP){if(B!==u){throw Error(\"Illegal group end indicator for \"+this.toString(true)+\": \"+B+\" (\"+(u?u+\" expected\":\"not a group\")+\")\")}break}if(!(r=this._fieldsById[B])){switch(p){case V.WIRE_TYPES.VARINT:w.readVarint32();break;case V.WIRE_TYPES.BITS32:w.offset+=4;break;case V.WIRE_TYPES.BITS64:w.offset+=8;break;case V.WIRE_TYPES.LDELIM:var t=w.readVarint32();w.offset+=t;break;case V.WIRE_TYPES.STARTGROUP:while(O(B,w)){}break;default:throw Error(\"Illegal wire type for unknown field \"+B+\" in \"+this.toString(true)+\"#decode: \"+p)}continue}if(r.repeated&&!r.options.packed){z[r.name].push(r.decode(p,w))}else{if(r.map){var s=r.decode(p,w);z[r.name].set(s[0],s[1])}else{z[r.name]=r.decode(p,w);if(r.oneof){var q=z[r.oneof.name];if(q!==null&&q!==r.name){z[q]=null}z[r.oneof.name]=r.name}}}}for(var v=0,x=this._fields.length;v<x;++v){r=this._fields[v];if(z[r.name]===null){if(this.syntax===\"proto3\"){z[r.name]=r.defaultValue}else{if(r.required){var y=Error(\"Missing at least one required field for \"+this.toString(true)+\": \"+r.name);y.decoded=z;throw (y)}else{if(V.populateDefaults&&r.defaultValue!==null){z[r.name]=r.defaultValue}}}}}return z};aa.Message=ad;var X=function(t,p,q,v,r,x,w,o,s,u){Z.call(this,t,p,x);this.className=\"Message.Field\";this.required=q===\"required\";this.repeated=q===\"repeated\";this.map=q===\"map\";this.keyType=v||null;this.type=r;this.resolvedType=null;this.id=w;this.options=o||{};this.defaultValue=null;this.oneof=s||null;this.syntax=u||\"proto2\";this.originalName=this.name;this.element=null;this.keyElement=null;if(this.builder.options.convertFieldsToCamelCase&&!(this instanceof ad.ExtensionField)){this.name=V.Util.toCamelCase(this.name)}};var N=X.prototype=Object.create(Z.prototype);N.build=function(){this.element=new J(this.type,this.resolvedType,false,this.syntax);if(this.map){this.keyElement=new J(this.keyType,undefined,true,this.syntax)}if(this.syntax===\"proto3\"&&!this.repeated&&!this.map){this.defaultValue=J.defaultFieldValue(this.type)}else{if(typeof this.options[\"default\"]!==\"undefined\"){this.defaultValue=this.verifyValue(this.options[\"default\"])}}};N.verifyValue=function(o,r){r=r||false;var s=function(t,u){throw Error(\"Illegal value for \"+this.toString(true)+\" of type \"+this.type.name+\": \"+t+\" (\"+u+\")\")}.bind(this);if(o===null){if(this.required){s(typeof o,\"required\")}if(this.syntax===\"proto3\"&&this.type!==V.TYPES.message){s(typeof o,\"proto3 field without field presence cannot be null\")}return null}var p;if(this.repeated&&!r){if(!Array.isArray(o)){o=[o]}var q=[];for(p=0;p<o.length;p++){q.push(this.element.verifyValue(o[p]))}return q}if(this.map&&!r){if(!(o instanceof V.Map)){if(!(o instanceof Object)){s(typeof o,\"expected ProtoBuf.Map or raw object for map field\")}return new V.Map(this,o)}else{return o}}if(!this.repeated&&Array.isArray(o)){s(typeof o,\"no array expected\")}return this.element.verifyValue(o)};N.hasWirePresence=function(o,p){if(this.syntax!==\"proto3\"){return(o!==null)}if(this.oneof&&p[this.oneof.name]===this.name){return true}switch(this.type){case V.TYPES.int32:case V.TYPES.sint32:case V.TYPES.sfixed32:case V.TYPES.uint32:case V.TYPES.fixed32:return o!==0;case V.TYPES.int64:case V.TYPES.sint64:case V.TYPES.sfixed64:case V.TYPES.uint64:case V.TYPES.fixed64:return o.low!==0||o.high!==0;case V.TYPES.bool:return o;case V.TYPES[\"float\"]:case V.TYPES[\"double\"]:return o!==0;case V.TYPES.string:return o.length>0;case V.TYPES.bytes:return o.remaining()>0;case V.TYPES[\"enum\"]:return o!==0;case V.TYPES.message:return o!==null;default:return true}};N.encode=function(p,t,o){if(this.type===null||typeof this.type!==\"object\"){throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(true)+\": \"+this.type)}if(p===null||(this.repeated&&p.length==0)){return t}try{if(this.repeated){var s;if(this.options.packed&&V.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){t.writeVarint32((this.id<<3)|V.WIRE_TYPES.LDELIM);t.ensureCapacity(t.offset+=1);var w=t.offset;for(s=0;s<p.length;s++){this.element.encodeValue(this.id,p[s],t)}var r=t.offset-w,u=n.calculateVarint32(r);if(u>1){var v=t.slice(w,t.offset);w+=u-1;t.offset=w;t.append(v)}t.writeVarint32(r,w-u)}else{for(s=0;s<p.length;s++){t.writeVarint32((this.id<<3)|this.type.wireType),this.element.encodeValue(this.id,p[s],t)}}}else{if(this.map){p.forEach(function(x,z,A){var y=n.calculateVarint32((1<<3)|this.keyType.wireType)+this.keyElement.calculateLength(1,z)+n.calculateVarint32((2<<3)|this.type.wireType)+this.element.calculateLength(2,x);t.writeVarint32((this.id<<3)|V.WIRE_TYPES.LDELIM);t.writeVarint32(y);t.writeVarint32((1<<3)|this.keyType.wireType);this.keyElement.encodeValue(1,z,t);t.writeVarint32((2<<3)|this.type.wireType);this.element.encodeValue(2,x,t)},this)}else{if(this.hasWirePresence(p,o)){t.writeVarint32((this.id<<3)|this.type.wireType);this.element.encodeValue(this.id,p,t)}}}}catch(q){throw Error(\"Illegal value for \"+this.toString(true)+\": \"+p+\" (\"+q+\")\")}return t};N.calculate=function(q,r){q=this.verifyValue(q);if(this.type===null||typeof this.type!==\"object\"){throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(true)+\": \"+this.type)}if(q===null||(this.repeated&&q.length==0)){return 0}var o=0;try{if(this.repeated){var s,t;if(this.options.packed&&V.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){o+=n.calculateVarint32((this.id<<3)|V.WIRE_TYPES.LDELIM);t=0;for(s=0;s<q.length;s++){t+=this.element.calculateLength(this.id,q[s])}o+=n.calculateVarint32(t);o+=t}else{for(s=0;s<q.length;s++){o+=n.calculateVarint32((this.id<<3)|this.type.wireType),o+=this.element.calculateLength(this.id,q[s])}}}else{if(this.map){q.forEach(function(v,x,u){var w=n.calculateVarint32((1<<3)|this.keyType.wireType)+this.keyElement.calculateLength(1,x)+n.calculateVarint32((2<<3)|this.type.wireType)+this.element.calculateLength(2,v);o+=n.calculateVarint32((this.id<<3)|V.WIRE_TYPES.LDELIM);o+=n.calculateVarint32(w);o+=w},this)}else{if(this.hasWirePresence(q,r)){o+=n.calculateVarint32((this.id<<3)|this.type.wireType);o+=this.element.calculateLength(this.id,q)}}}}catch(p){throw Error(\"Illegal value for \"+this.toString(true)+\": \"+q+\" (\"+p+\")\")}return o};N.decode=function(s,x,v){var t,w;var p=(!this.map&&s==this.type.wireType)||(!v&&this.repeated&&this.options.packed&&s==V.WIRE_TYPES.LDELIM)||(this.map&&s==V.WIRE_TYPES.LDELIM);if(!p){throw Error(\"Illegal wire type for field \"+this.toString(true)+\": \"+s+\" (\"+this.type.wireType+\" expected)\")}if(s==V.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&V.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){if(!v){w=x.readVarint32();w=x.offset+w;var q=[];while(x.offset<w){q.push(this.decode(this.type.wireType,x,true))}return q}}if(this.map){var r=J.defaultFieldValue(this.keyType);t=J.defaultFieldValue(this.type);w=x.readVarint32();if(x.remaining()<w){throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+w+\" required but got only \"+x.remaining())}var u=x.clone();u.limit=u.offset+w;x.offset+=w;while(u.remaining()>0){var o=u.readVarint32();s=o&7;var y=o>>>3;if(y===1){r=this.keyElement.decode(u,s,y)}else{if(y===2){t=this.element.decode(u,s,y)}else{throw Error(\"Unexpected tag in map field key/value submessage\")}}}return[r,t]}return this.element.decode(x,s,this.id)};aa.Message.Field=X;var I=function(u,q,p,r,s,o,t){X.call(this,u,q,p,null,r,s,o,t);this.extension};I.prototype=Object.create(X.prototype);aa.Message.ExtensionField=I;var G=function(q,o,p){Z.call(this,q,o,p);this.fields=[]};aa.Message.OneOf=G;var M=function(r,o,p,q,s){P.call(this,r,o,p,q,s);this.className=\"Enum\";this.object=null};M.getName=function(s,o){var p=Object.keys(s);for(var q=0,r;q<p.length;++q){if(s[r=p[q]]===o){return r}}return null};var Y=M.prototype=Object.create(P.prototype);Y.build=function(s){if(this.object&&!s){return this.object}var p=new V.Builder.Enum(),q=this.getChildren(M.Value);for(var o=0,r=q.length;o<r;++o){p[q[o][\"name\"]]=q[o][\"id\"]}if(Object.defineProperty){Object.defineProperty(p,\"$options\",{value:this.buildOpt(),enumerable:false})}return this.object=p};aa.Enum=M;var R=function(r,p,q,o){Z.call(this,r,p,q);this.className=\"Enum.Value\";this.id=o};R.prototype=Object.create(Z.prototype);aa.Enum.Value=R;var T=function(r,p,q,o){Z.call(this,r,p,q);this.field=o};T.prototype=Object.create(Z.prototype);aa.Extension=T;var Q=function(q,r,o,p){P.call(this,q,r,o,p);this.className=\"Service\";this.clazz=null};var S=Q.prototype=Object.create(P.prototype);S.build=function(o){if(this.clazz&&!o){return this.clazz}return this.clazz=(function(r,w){var x=function(z){r.Builder.Service.call(this);this.rpcImpl=z||function(C,B,A){setTimeout(A.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0)}};var q=x.prototype=Object.create(r.Builder.Service.prototype);var t=w.getChildren(r.Reflect.Service.RPCMethod);for(var v=0;v<t.length;v++){(function(z){q[z.name]=function(B,A){try{try{B=z.resolvedRequestType.clazz.decode(n.wrap(B))}catch(C){if(!(C instanceof TypeError)){throw C}}if(B===null||typeof B!==\"object\"){throw Error(\"Illegal arguments\")}if(!(B instanceof z.resolvedRequestType.clazz)){B=new z.resolvedRequestType.clazz(B)}this.rpcImpl(z.fqn(),B,function(E,ae){if(E){A(E);return}try{ae=z.resolvedResponseType.clazz.decode(ae)}catch(D){}if(!ae||!(ae instanceof z.resolvedResponseType.clazz)){A(Error(\"Illegal response type received in service method \"+w.name+\"#\"+z.name));return}A(null,ae)})}catch(C){setTimeout(A.bind(this,C),0)}};x[z.name]=function(C,B,A){new x(C)[z.name](B,A)};if(Object.defineProperty){Object.defineProperty(x[z.name],\"$options\",{value:z.buildOpt()}),Object.defineProperty(q[z.name],\"$options\",{value:x[z.name][\"$options\"]})}})(t[v])}var y;var u;var p;var s;if(Object.defineProperty){Object.defineProperty(x,\"$options\",{value:w.buildOpt()}),Object.defineProperty(q,\"$options\",{value:x[\"$options\"]}),Object.defineProperty(x,\"$type\",{value:w}),Object.defineProperty(q,\"$type\",{value:w})}return x})(V,this)};aa.Service=Q;var ac=function(r,o,p,q){Z.call(this,r,o,p);this.className=\"Service.Method\";this.options=q||{}};var U=ac.prototype=Object.create(Z.prototype);U.buildOpt=H.buildOpt;aa.Service.Method=ac;var K=function(s,v,p,o,t,q,u,r){ac.call(this,s,v,p,r);this.className=\"Service.RPCMethod\";this.requestName=o;this.responseName=t;this.requestStream=q;this.responseStream=u;this.resolvedRequestType=null;this.resolvedResponseType=null};K.prototype=Object.create(ac.prototype);aa.Service.RPCMethod=K;return aa})(l);l.Builder=(function(p,q,b){var o=function(t){this.ns=new b.Namespace(this,null,\"\");this.ptr=this.ns;this.resolved=false;this.result=null;this.files={};this.importRoot=null;this.options=t||{}};var s=o.prototype;o.isMessage=function(t){if(typeof t.name!==\"string\"){return false}if(typeof t.values!==\"undefined\"||typeof t.rpc!==\"undefined\"){return false}return true};o.isMessageField=function(t){if(typeof t.rule!==\"string\"||typeof t.name!==\"string\"||typeof t.type!==\"string\"||typeof t.id===\"undefined\"){return false}return true};o.isEnum=function(t){if(typeof t.name!==\"string\"){return false}if(typeof t.values===\"undefined\"||!Array.isArray(t.values)||t.values.length===0){return false}return true};o.isService=function(t){if(typeof t.name!==\"string\"||typeof t.rpc!==\"object\"||!t.rpc){return false}return true};o.isExtend=function(t){if(typeof t.ref!==\"string\"){return false}return true};s.reset=function(){this.ptr=this.ns;return this};s.define=function(t){if(typeof t!==\"string\"||!q.TYPEREF.test(t)){throw Error(\"illegal namespace: \"+t)}t.split(\".\").forEach(function(u){var v=this.ptr.getChild(u);if(v===null){this.ptr.addChild(v=new b.Namespace(this,this.ptr,u))}this.ptr=v},this);return this};s.create=function(t){if(!t){return this}if(!Array.isArray(t)){t=[t]}else{if(t.length===0){return this}t=t.slice()}var u=[t];while(u.length>0){t=u.pop();if(!Array.isArray(t)){throw Error(\"not a valid namespace: \"+JSON.stringify(t))}while(t.length>0){var w=t.shift();if(o.isMessage(w)){var v=new b.Message(this,this.ptr,w.name,w.options,w.isGroup,w.syntax);var x={};if(w.oneofs){Object.keys(w.oneofs).forEach(function(z){v.addChild(x[z]=new b.Message.OneOf(this,v,z))},this)}if(w.fields){w.fields.forEach(function(A){if(v.getChild(A.id|0)!==null){throw Error(\"duplicate or invalid field id in \"+v.name+\": \"+A.id)}if(A.options&&typeof A.options!==\"object\"){throw Error(\"illegal field options in \"+v.name+\"#\"+A.name)}var z=null;if(typeof A.oneof===\"string\"&&!(z=x[A.oneof])){throw Error(\"illegal oneof in \"+v.name+\"#\"+A.name+\": \"+A.oneof)}A=new b.Message.Field(this,v,A.rule,A.keytype,A.type,A.name,A.id,A.options,z,w.syntax);if(z){z.fields.push(A)}v.addChild(A)},this)}var y=[];if(w.enums){w.enums.forEach(function(z){y.push(z)})}if(w.messages){w.messages.forEach(function(z){y.push(z)})}if(w.services){w.services.forEach(function(z){y.push(z)})}if(w.extensions){if(typeof w.extensions[0]===\"number\"){v.extensions=[w.extensions]}else{v.extensions=w.extensions}}this.ptr.addChild(v);if(y.length>0){u.push(t);t=y;y=null;this.ptr=v;v=null;continue}y=null}else{if(o.isEnum(w)){v=new b.Enum(this,this.ptr,w.name,w.options,w.syntax);w.values.forEach(function(z){v.addChild(new b.Enum.Value(this,v,z.name,z.id))},this);this.ptr.addChild(v)}else{if(o.isService(w)){v=new b.Service(this,this.ptr,w.name,w.options);Object.keys(w.rpc).forEach(function(z){var A=w.rpc[z];v.addChild(new b.Service.RPCMethod(this,v,z,A.request,A.response,!!A.request_stream,!!A.response_stream,A.options))},this);this.ptr.addChild(v)}else{if(o.isExtend(w)){v=this.ptr.resolve(w.ref,true);if(v){w.fields.forEach(function(C){if(v.getChild(C.id|0)!==null){throw Error(\"duplicate extended field id in \"+v.name+\": \"+C.id)}if(v.extensions){var A=false;v.extensions.forEach(function(E){if(C.id>=E[0]&&C.id<=E[1]){A=true}});if(!A){throw Error(\"illegal extended field id in \"+v.name+\": \"+C.id+\" (not within valid ranges)\")}}var D=C.name;if(this.options.convertFieldsToCamelCase){D=p.Util.toCamelCase(D)}var z=new b.Message.ExtensionField(this,v,C.rule,C.type,this.ptr.fqn()+\".\"+D,C.id,C.options);var B=new b.Extension(this,this.ptr,C.name,z);z.extension=B;this.ptr.addChild(B);v.addChild(z)},this)}else{if(!/\\.?google\\.protobuf\\./.test(w.ref)){throw Error(\"extended message \"+w.ref+\" is not defined\")}}}else{throw Error(\"not a valid definition: \"+JSON.stringify(w))}}}}w=null;v=null}t=null;this.ptr=this.ptr.parent}this.resolved=false;this.result=null;return this};function r(t){if(t.messages){t.messages.forEach(function(u){u.syntax=t.syntax;r(u)})}if(t.enums){t.enums.forEach(function(u){u.syntax=t.syntax})}}s[\"import\"]=function(D,C){var A=\"/\";if(typeof C===\"string\"){if(p.Util.IS_NODE){}if(this.files[C]===true){return this.reset()}this.files[C]=true}else{if(typeof C===\"object\"){var F=C.root;if(p.Util.IS_NODE){}if(F.indexOf(\"\\\\\")>=0||C.file.indexOf(\"\\\\\")>=0){A=\"\\\\\"}var z=F+A+C.file;if(this.files[z]===true){return this.reset()}this.files[z]=true}}if(D.imports&&D.imports.length>0){var x,G=false;if(typeof C===\"object\"){this.importRoot=C.root;G=true;x=this.importRoot;C=C.file;if(x.indexOf(\"\\\\\")>=0||C.indexOf(\"\\\\\")>=0){A=\"\\\\\"}}else{if(typeof C===\"string\"){if(this.importRoot){x=this.importRoot}else{if(C.indexOf(\"/\")>=0){x=C.replace(/\\/[^\\/]*$/,\"\");if(x===\"\"){x=\"/\"}}else{if(C.indexOf(\"\\\\\")>=0){x=C.replace(/\\\\[^\\\\]*$/,\"\");A=\"\\\\\"}else{x=\".\"}}}}else{x=null}}for(var w=0;w<D.imports.length;w++){if(typeof D.imports[w]===\"string\"){if(!x){throw Error(\"cannot determine import root\")}var E=D.imports[w];if(E===\"google/protobuf/descriptor.proto\"){continue}E=x+A+E;if(this.files[E]===true){continue}if(/\\.proto$/i.test(E)&&!p.DotProto){E=E.replace(/\\.proto$/,\".json\")}var y=p.Util.fetch(E);if(y===null){throw Error(\"failed to import '\"+E+\"' in '\"+C+\"': file not found\")}if(/\\.json$/i.test(E)){this[\"import\"](JSON.parse(y+\"\"),E)}else{this[\"import\"](p.DotProto.Parser.parse(y),E)}}else{if(!C){this[\"import\"](D.imports[w])}else{if(/\\.(\\w+)$/.test(C)){this[\"import\"](D.imports[w],C.replace(/^(.+)\\.(\\w+)$/,function(t,u,v){return u+\"_import\"+w+\".\"+v}))}else{this[\"import\"](D.imports[w],C+\"_import\"+w)}}}}if(G){this.importRoot=null}}if(D[\"package\"]){this.define(D[\"package\"])}if(D.syntax){r(D)}var B=this.ptr;if(D.options){Object.keys(D.options).forEach(function(t){B.options[t]=D.options[t]})}if(D.messages){this.create(D.messages),this.ptr=B}if(D.enums){this.create(D.enums),this.ptr=B}if(D.services){this.create(D.services),this.ptr=B}if(D[\"extends\"]){this.create(D[\"extends\"])}return this.reset()};s.resolveAll=function(){var t;if(this.ptr==null||typeof this.ptr.type===\"object\"){return this}if(this.ptr instanceof b.Namespace){this.ptr.children.forEach(function(u){this.ptr=u;this.resolveAll()},this)}else{if(this.ptr instanceof b.Message.Field){if(!q.TYPE.test(this.ptr.type)){if(!q.TYPEREF.test(this.ptr.type)){throw Error(\"illegal type reference in \"+this.ptr.toString(true)+\": \"+this.ptr.type)}t=(this.ptr instanceof b.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,true);if(!t){throw Error(\"unresolvable type reference in \"+this.ptr.toString(true)+\": \"+this.ptr.type)}this.ptr.resolvedType=t;if(t instanceof b.Enum){this.ptr.type=p.TYPES[\"enum\"];if(this.ptr.syntax===\"proto3\"&&t.syntax!==\"proto3\"){throw Error(\"proto3 message cannot reference proto2 enum\")}}else{if(t instanceof b.Message){this.ptr.type=t.isGroup?p.TYPES.group:p.TYPES.message}else{throw Error(\"illegal type reference in \"+this.ptr.toString(true)+\": \"+this.ptr.type)}}}else{this.ptr.type=p.TYPES[this.ptr.type]}if(this.ptr.map){if(!q.TYPE.test(this.ptr.keyType)){throw Error(\"illegal key type for map field in \"+this.ptr.toString(true)+\": \"+this.ptr.keyType)}this.ptr.keyType=p.TYPES[this.ptr.keyType]}}else{if(this.ptr instanceof p.Reflect.Service.Method){if(this.ptr instanceof p.Reflect.Service.RPCMethod){t=this.ptr.parent.resolve(this.ptr.requestName,true);if(!t||!(t instanceof p.Reflect.Message)){throw Error(\"Illegal type reference in \"+this.ptr.toString(true)+\": \"+this.ptr.requestName)}this.ptr.resolvedRequestType=t;t=this.ptr.parent.resolve(this.ptr.responseName,true);if(!t||!(t instanceof p.Reflect.Message)){throw Error(\"Illegal type reference in \"+this.ptr.toString(true)+\": \"+this.ptr.responseName)}this.ptr.resolvedResponseType=t}else{throw Error(\"illegal service type in \"+this.ptr.toString(true))}}else{if(!(this.ptr instanceof p.Reflect.Message.OneOf)&&!(this.ptr instanceof p.Reflect.Extension)&&!(this.ptr instanceof p.Reflect.Enum.Value)){throw Error(\"illegal object in namespace: \"+typeof(this.ptr)+\": \"+this.ptr)}}}}return this.reset()};s.build=function(w){this.reset();if(!this.resolved){this.resolveAll(),this.resolved=true,this.result=null}if(this.result===null){this.result=this.ns.build()}if(!w){return this.result}var u=typeof w===\"string\"?w.split(\".\"):w,v=this.result;for(var t=0;t<u.length;t++){if(v[u[t]]){v=v[u[t]]}else{v=null;break}}return v};s.lookup=function(t,u){return t?this.ns.resolve(t,u):this.ns};s.toString=function(){return\"Builder\"};o.Message=function(){};o.Enum=function(){};o.Service=function(){};return o})(l,l.Lang,l.Reflect);l.Map=(function(q,b){var r=function(w,x){if(!w.map){throw Error(\"field is not a map\")}this.field=w;this.keyElem=new b.Element(w.keyType,null,true,w.syntax);this.valueElem=new b.Element(w.type,w.resolvedType,false,w.syntax);this.map={};Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}});if(x){var s=Object.keys(x);for(var t=0;t<s.length;t++){var u=this.keyElem.valueFromString(s[t]);var v=this.valueElem.verifyValue(x[s[t]]);this.map[this.keyElem.valueToString(u)]={key:u,value:v}}}};var p=r.prototype;function o(s){var t=0;return{next:function(){if(t<s.length){return{done:false,value:s[t++]}}return{done:true}}}}p.clear=function(){this.map={}};p[\"delete\"]=function(t){var s=this.keyElem.valueToString(this.keyElem.verifyValue(t));var u=s in this.map;delete this.map[s];return u};p.entries=function(){var u=[];var v=Object.keys(this.map);for(var t=0,s;t<v.length;t++){u.push([(s=this.map[v[t]]).key,s.value])}return o(u)};p.keys=function(){var t=[];var s=Object.keys(this.map);for(var u=0;u<s.length;u++){t.push(this.map[s[u]].key)}return o(t)};p.values=function(){var u=[];var s=Object.keys(this.map);for(var t=0;t<s.length;t++){u.push(this.map[s[t]].value)}return o(u)};p.forEach=function(u,t){var v=Object.keys(this.map);for(var s=0,w;s<v.length;s++){u.call(t,(w=this.map[v[s]]).value,w.key,this)}};p.set=function(u,s){var v=this.keyElem.verifyValue(u);var t=this.valueElem.verifyValue(s);this.map[this.keyElem.valueToString(v)]={key:v,value:t};return this};p.get=function(t){var s=this.keyElem.valueToString(this.keyElem.verifyValue(t));if(!(s in this.map)){return undefined}return this.map[s].value};p.has=function(t){var s=this.keyElem.valueToString(this.keyElem.verifyValue(t));return(s in this.map)};return r})(l,l.Reflect);l.loadProto=function(b,o,p){if(typeof o===\"string\"||(o&&typeof o.file===\"string\"&&typeof o.root===\"string\")){p=o,o=undefined}return l.loadJson(l.DotProto.Parser.parse(b),o,p)};l.protoFromString=l.loadProto;l.loadProtoFile=function(p,b,q){if(b&&typeof b===\"object\"){q=b,b=null}else{if(!b||typeof b!==\"function\"){b=null}}if(b){return l.Util.fetch(typeof p===\"string\"?p:p.root+\"/\"+p.file,function(s){if(s===null){b(Error(\"Failed to fetch file\"));return}try{b(null,l.loadProto(s,q,p))}catch(r){b(r)}})}var o=l.Util.fetch(typeof p===\"object\"?p.root+\"/\"+p.file:p);return o===null?null:l.loadProto(o,q,p)};l.protoFromFile=l.loadProtoFile;l.newBuilder=function(b){b=b||{};if(typeof b.convertFieldsToCamelCase===\"undefined\"){b.convertFieldsToCamelCase=l.convertFieldsToCamelCase}if(typeof b.populateAccessors===\"undefined\"){b.populateAccessors=l.populateAccessors}return new l.Builder(b)};l.loadJson=function(b,o,p){if(typeof o===\"string\"||(o&&typeof o.file===\"string\"&&typeof o.root===\"string\")){p=o,o=null}if(!o||typeof o!==\"object\"){o=l.newBuilder()}if(typeof b===\"string\"){b=JSON.parse(b)}o[\"import\"](b,p);o.resolveAll();return o};l.loadJsonFile=function(p,b,q){if(b&&typeof b===\"object\"){q=b,b=null}else{if(!b||typeof b!==\"function\"){b=null}}if(b){return l.Util.fetch(typeof p===\"string\"?p:p.root+\"/\"+p.file,function(s){if(s===null){b(Error(\"Failed to fetch file\"));return}try{b(null,l.loadJson(JSON.parse(s),q,p))}catch(r){b(r)}})}var o=l.Util.fetch(typeof p===\"object\"?p.root+\"/\"+p.file:p);return o===null?null:l.loadJson(JSON.parse(o),q,p)};var m=function(b){var s,u,v,w,r,p,t,q=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);p=b.length;r=0;t=\"\";while(r<p){do{s=q[b.charCodeAt(r++)&255]}while(r<p&&s==-1);if(s==-1){break}do{u=q[b.charCodeAt(r++)&255]}while(r<p&&u==-1);if(u==-1){break}t+=String.fromCharCode((s<<2)|((u&48)>>4));do{v=b.charCodeAt(r++)&255;if(v==61){return t}v=q[v]}while(r<p&&v==-1);if(v==-1){break}t+=String.fromCharCode(((u&15)<<4)|((v&60)>>2));do{w=b.charCodeAt(r++)&255;if(w==61){return t}w=q[w]}while(r<p&&w==-1);if(w==-1){break}t+=String.fromCharCode(((v&3)<<6)|w)}return t};var h=m(\"cGFja2FnZSBNb2R1bGVzOwptZXNzYWdlIHByb2J1ZiB7CiAgICBtZXNzYWdlIFNldFVzZXJTdGF0dXNJbnB1dAogICAgewogICAgICAgIG9wdGlvbmFsIGludDMyIHN0YXR1cz0xOwogICAgfQoKICAgIG1lc3NhZ2UgU2V0VXNlclN0YXR1c091dHB1dAogICAgewogICAgICAgIG9wdGlvbmFsIGludDMyIG5vdGhpbmc9MTsKICAgIH0KCiAgICBtZXNzYWdlIEdldFVzZXJTdGF0dXNJbnB1dAogICAgewogICAgICAgIG9wdGlvbmFsIGludDMyIG5vdGhpbmc9MTsKICAgIH0KCiAgICBtZXNzYWdlIEdldFVzZXJTdGF0dXNPdXRwdXQKICAgIHsKICAgICAgICBvcHRpb25hbCBzdHJpbmcgc3RhdHVzPTE7Ly8mIzIzMTvClCYjMTY4OyYjMjMwO8KIJiMxODM7JiMyMjg7JiMxOTE7JiMxNjE7JiMyMzA7woEmIzE3NTsKICAgICAgICBvcHRpb25hbCBzdHJpbmcgc3ViVXNlcklkPTI7Ly8mIzIzMjsmIzE2MjsmIzE3MTsmIzIzMjsmIzE3NDsmIzE2MjsmIzIzMzvCmMKFJiMyMzI7woDChQogICAgfQoKICAgIG1lc3NhZ2UgU3ViVXNlclN0YXR1c0lucHV0CiAgICB7CiAgICAgICAgcmVwZWF0ZWQgc3RyaW5nIHVzZXJpZCA9MTsgIC8vJiMyMzE7wpQmIzE2ODsmIzIzMDvCiCYjMTgzOyYjMjI5O8KIwpcmIzIzMjsmIzE2MTsmIzE2ODsKICAgIH0KCiAgICBtZXNzYWdlIFN1YlVzZXJTdGF0dXNPdXRwdXQKICAgIHsKICAgICAgICBvcHRpb25hbCBpbnQzMiBub3RoaW5nPTE7ICAgIC8vJiMyMjk7wo0mIzE2MDsmIzIyODsmIzE4OTvCjQogICAgfQogICAgbWVzc2FnZSBWb2lwRHluYW1pY0lucHV0CiAgICB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgIGVuZ2luZVR5cGUgPSAxOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyBjaGFubmVsTmFtZSA9IDI7CiAgICAgICAgb3B0aW9uYWwgc3RyaW5nIGNoYW5uZWxFeHRyYSA9IDM7CiAgICB9CgogICAgbWVzc2FnZSBWb2lwRHluYW1pY091dHB1dAogICAgewogICAgICAgICByZXF1aXJlZCBzdHJpbmcgZHluYW1pY0tleT0xOwogICAgfQogICAgbWVzc2FnZSBOb3RpZnlNc2cgewogICAgICAgIHJlcXVpcmVkIGludDMyIHR5cGUgPSAxOwogICAgICAgIG9wdGlvbmFsIGludDY0IHRpbWUgPSAyOwogICAgICAgIG9wdGlvbmFsIHN0cmluZyBjaHJtSWQ9MzsKICAgIH0KICAgIG1lc3NhZ2UgU3luY1JlcXVlc3RNc2cgewogICAgICAgIHJlcXVpcmVkIGludDY0IHN5bmNUaW1lID0gMTsKICAgICAgICByZXF1aXJlZCBib29sIGlzcG9sbGluZyA9IDI7CiAgICAgICAgb3B0aW9uYWwgYm9vbCBpc3dlYj0zOwogICAgICAgIG9wdGlvbmFsIGJvb2wgaXNQdWxsU2VuZD00OwogICAgICAgIG9wdGlvbmFsIGJvb2wgaXNLZWVwaW5nPTU7CiAgICAgICAgb3B0aW9uYWwgaW50NjQgc2VuZEJveFN5bmNUaW1lPTY7CiAgICB9CiAgICBtZXNzYWdlIFVwU3RyZWFtTWVzc2FnZSB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgc2Vzc2lvbklkID0gMTsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgY2xhc3NuYW1lID0gMjsKICAgICAgICByZXF1aXJlZCBieXRlcyBjb250ZW50ID0gMzsKICAgICAgICBvcHRpb25hbCBzdHJpbmcgcHVzaFRleHQgPSA0OwogICAgICAgIG9wdGlvbmFsIHN0cmluZyBhcHBEYXRhID0gNTsKICAgICAgICByZXBlYXRlZCBzdHJpbmcgdXNlcklkID0gNjsKICAgIH0KICAgIG1lc3NhZ2UgRG93blN0cmVhbU1lc3NhZ2VzIHsKICAgICAgICByZXBlYXRlZCBEb3duU3RyZWFtTWVzc2FnZSBsaXN0ID0gMTsKICAgICAgICByZXF1aXJlZCBpbnQ2NCBzeW5jVGltZSA9IDI7CiAgICAgICAgb3B0aW9uYWwgYm9vbCBmaW5pc2hlZCA9IDM7CiAgICB9CiAgICBtZXNzYWdlIERvd25TdHJlYW1NZXNzYWdlIHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgZnJvbVVzZXJJZCA9IDE7CiAgICAgICAgcmVxdWlyZWQgQ2hhbm5lbFR5cGUgdHlwZSA9IDI7CiAgICAgICAgb3B0aW9uYWwgc3RyaW5nIGdyb3VwSWQgPSAzOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyBjbGFzc25hbWUgPSA0OwogICAgICAgIHJlcXVpcmVkIGJ5dGVzIGNvbnRlbnQgPSA1OwogICAgICAgIHJlcXVpcmVkIGludDY0IGRhdGFUaW1lID0gNjsKICAgICAgICByZXF1aXJlZCBpbnQ2NCBzdGF0dXMgPSA3OwogICAgICAgIG9wdGlvbmFsIGludDY0IGV4dHJhID0gODsKICAgICAgICBvcHRpb25hbCBzdHJpbmcgbXNnSWQgPSA5OwogICAgICAgIG9wdGlvbmFsIGludDMyIGRpcmVjdGlvbiA9IDEwOyAKICAgIH0KICAgIGVudW0gQ2hhbm5lbFR5cGUgewogICAgICAgIFBFUlNPTiA9IDE7CiAgICAgICAgUEVSU09OUyA9IDI7CiAgICAgICAgR1JPVVAgPSAzOwogICAgICAgIFRFTVBHUk9VUCA9IDQ7CiAgICAgICAgQ1VTVE9NRVJTRVJWSUNFID0gNTsKICAgICAgICBOT1RJRlkgPSA2OwogICAgICAgIE1DPTc7CiAgICAgICAgTVA9ODsKICAgIH0KICAgIG1lc3NhZ2UgQ3JlYXRlRGlzY3Vzc2lvbklucHV0IHsKICAgICAgICBvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CiAgICB9CiAgICBtZXNzYWdlIENyZWF0ZURpc2N1c3Npb25PdXRwdXQgewogICAgICAgIHJlcXVpcmVkIHN0cmluZyBpZCA9IDE7CiAgICB9CiAgICBtZXNzYWdlIENoYW5uZWxJbnZpdGF0aW9uSW5wdXQgewogICAgICAgIHJlcGVhdGVkIHN0cmluZyB1c2VycyA9IDE7CiAgICB9CiAgICBtZXNzYWdlIExlYXZlQ2hhbm5lbElucHV0IHsKICAgICAgICByZXF1aXJlZCBpbnQzMiBub3RoaW5nID0gMTsKICAgIH0KICAgIG1lc3NhZ2UgQ2hhbm5lbEV2aWN0aW9uSW5wdXQgewogICAgICAgIHJlcXVpcmVkIHN0cmluZyB1c2VyID0gMTsKICAgIH0KICAgIG1lc3NhZ2UgUmVuYW1lQ2hhbm5lbElucHV0IHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgbmFtZSA9IDE7CiAgICB9CiAgICBtZXNzYWdlIENoYW5uZWxJbmZvSW5wdXQgewogICAgICAgIHJlcXVpcmVkIGludDMyIG5vdGhpbmcgPSAxOwogICAgfQogICAgbWVzc2FnZSBDaGFubmVsSW5mb091dHB1dCB7CiAgICAgICAgcmVxdWlyZWQgQ2hhbm5lbFR5cGUgdHlwZSA9IDE7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIGNoYW5uZWxJZCA9IDI7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIGNoYW5uZWxOYW1lID0gMzsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgYWRtaW5Vc2VySWQgPSA0OwogICAgICAgIHJlcGVhdGVkIHN0cmluZyBmaXJzdFRlblVzZXJJZHMgPSA1OwogICAgICAgIHJlcXVpcmVkIGludDMyIG9wZW5TdGF0dXMgPSA2OwogICAgfQogICAgbWVzc2FnZSBDaGFubmVsSW5mb3NJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgcGFnZSA9IDE7CiAgICAgICAgb3B0aW9uYWwgaW50MzIgbnVtYmVyID0gMjsKICAgIH0KICAgIG1lc3NhZ2UgQ2hhbm5lbEluZm9zT3V0cHV0IHsKICAgICAgICByZXBlYXRlZCBDaGFubmVsSW5mb091dHB1dCBjaGFubmVscyA9IDE7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgdG90YWwgPSAyOwogICAgfQogICAgbWVzc2FnZSBNZW1iZXJJbmZvIHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgdXNlcklkID0gMTsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgdXNlck5hbWUgPSAyOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyB1c2VyUG9ydHJhaXQgPSAzOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyBleHRlbnNpb24gPSA0OwogICAgfQogICAgbWVzc2FnZSBHcm91cE1lbWJlcnNJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgcGFnZSA9IDE7CiAgICAgICAgb3B0aW9uYWwgaW50MzIgbnVtYmVyID0gMjsKICAgIH0KICAgIG1lc3NhZ2UgR3JvdXBNZW1iZXJzT3V0cHV0IHsKICAgICAgICByZXBlYXRlZCBNZW1iZXJJbmZvIG1lbWJlcnMgPSAxOwogICAgICAgIHJlcXVpcmVkIGludDMyIHRvdGFsID0gMjsKICAgIH0KICAgIG1lc3NhZ2UgR2V0VXNlckluZm9JbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgbm90aGluZyA9IDE7CiAgICB9CiAgICBtZXNzYWdlIEdldFVzZXJJbmZvT3V0cHV0IHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgdXNlcklkID0gMTsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgdXNlck5hbWUgPSAyOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyB1c2VyUG9ydHJhaXQgPSAzOwogICAgfQogICAgbWVzc2FnZSBHZXRTZXNzaW9uSWRJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgbm90aGluZyA9IDE7CiAgICB9CiAgICBtZXNzYWdlIEdldFNlc3Npb25JZE91dHB1dCB7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgc2Vzc2lvbklkID0gMTsKICAgIH0KICAgIGVudW0gRmlsZVR5cGUgewogICAgICAgIGltYWdlID0gMTsKICAgICAgICBhdWRpbyA9IDI7CiAgICAgICAgdmlkZW8gPSAzOwogICAgICAgIGZpbGUgPSA0OwogICAgfQogICAgbWVzc2FnZSBHZXRRTnVwVG9rZW5JbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgRmlsZVR5cGUgdHlwZSA9IDE7CiAgICB9CiAgICBtZXNzYWdlIEdldFFOZG93bmxvYWRVcmxJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgRmlsZVR5cGUgdHlwZSA9IDE7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIGtleSA9IDI7CiAgICAgICAgb3B0aW9uYWwgc3RyaW5nICBmaWxlTmFtZSA9IDM7CiAgICB9CiAgICBtZXNzYWdlIEdldFFOdXBUb2tlbk91dHB1dCB7CiAgICAgICAgcmVxdWlyZWQgaW50NjQgZGVhZGxpbmUgPSAxOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyB0b2tlbiA9IDI7CiAgICB9CiAgICBtZXNzYWdlIEdldFFOZG93bmxvYWRVcmxPdXRwdXQgewogICAgICAgIHJlcXVpcmVkIHN0cmluZyBkb3dubG9hZFVybCA9IDE7CiAgICB9CiAgICBtZXNzYWdlIEFkZDJCbGFja0xpc3RJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIHVzZXJJZCA9IDE7CiAgICB9CiAgICBtZXNzYWdlIFJlbW92ZUZyb21CbGFja0xpc3RJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIHVzZXJJZCA9IDE7CiAgICB9CiAgICBtZXNzYWdlIFF1ZXJ5QmxhY2tMaXN0SW5wdXQgewogICAgICAgIHJlcXVpcmVkIGludDMyIG5vdGhpbmcgPSAxOwogICAgfQogICAgbWVzc2FnZSBRdWVyeUJsYWNrTGlzdE91dHB1dCB7CiAgICAgICAgcmVwZWF0ZWQgc3RyaW5nIHVzZXJJZHMgPSAxOwogICAgfQogICAgbWVzc2FnZSBCbGFja0xpc3RTdGF0dXNJbnB1dCB7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIHVzZXJJZCA9IDE7CiAgICB9CiAgICBtZXNzYWdlIEJsb2NrUHVzaElucHV0IHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgYmxvY2tlZUlkID0gMTsKICAgIH0KICAgIG1lc3NhZ2UgTW9kaWZ5UGVybWlzc2lvbklucHV0IHsKICAgICAgICByZXF1aXJlZCBpbnQzMiBvcGVuU3RhdHVzID0gMTsKICAgIH0KICAgIG1lc3NhZ2UgR3JvdXBJbnB1dCB7CiAgICAgICAgcmVwZWF0ZWQgR3JvdXBJbmZvIGdyb3VwSW5mbyA9IDE7CiAgICB9CiAgICBtZXNzYWdlIEdyb3VwT3V0cHV0IHsKICAgICAgICByZXF1aXJlZCBpbnQzMiBub3RoaW5nID0gMTsKICAgIH0KICAgIG1lc3NhZ2UgR3JvdXBJbmZvIHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgaWQgPSAxOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyBuYW1lID0gMjsKICAgIH0KICAgIG1lc3NhZ2UgR3JvdXBIYXNoSW5wdXQgewogICAgICAgIHJlcXVpcmVkIHN0cmluZyB1c2VySWQgPSAxOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyBncm91cEhhc2hDb2RlID0gMjsKICAgIH0KICAgIG1lc3NhZ2UgR3JvdXBIYXNoT3V0cHV0IHsKICAgICAgICByZXF1aXJlZCBHcm91cEhhc2hUeXBlIHJlc3VsdCA9IDE7CiAgICB9CiAgICBlbnVtIEdyb3VwSGFzaFR5cGUgewogICAgICAgIGdyb3VwX3N1Y2Nlc3MgPSAweDAwOwogICAgICAgIGdyb3VwX2ZhaWx1cmUgPSAweDAxOwogICAgfQogICAgbWVzc2FnZSBDaHJtSW5wdXQgewogICAgICAgIHJlcXVpcmVkIGludDMyIG5vdGhpbmcgPSAxOwogICAgfQogICAgbWVzc2FnZSBDaHJtT3V0cHV0IHsKICAgICAgICByZXF1aXJlZCBpbnQzMiBub3RoaW5nID0gMTsKICAgIH0KICAgIG1lc3NhZ2UgQ2hybVB1bGxNc2cgewogICAgICAgIHJlcXVpcmVkIGludDY0IHN5bmNUaW1lID0gMTsKICAgICAgICByZXF1aXJlZCBpbnQzMiBjb3VudCA9IDI7CiAgICB9CiAgICAKICAgIG1lc3NhZ2UgQ2hybVB1bGxNc2dOZXcgIC8vJiMyMjk7JiMxNzQ7JiMxNjI7JiMyMzA7wogmIzE4MzsmIzIzMTsmIzE3MTsmIzE3NTsmIzIzMDvCliYjMTc2OyYjMjMxO8KawoQmIzIzMDvCi8KJJiMyMjk7wo/CliYjMjMyO8KBwoomIzIyOTsmIzE2NDsmIzE2OTsmIzIyOTsmIzE3NDsmIzE2NDsmIzIzMDsmIzE4MjvCiCYjMjMwO8KBJiMxNzU7CiAgICB7CiAgICAgcmVxdWlyZWQgaW50MzIgY291bnQgPSAxOy8vJiMyMzA7wovCiSYjMjI5O8KPwpYmIzIzMDvCnSYjMTYxOyYjMjMwO8KVJiMxNzY7ICAgMDomIzIzMzvCgMKaJiMyMzE7wp8mIzE2NTsmIzIzMDvCi8KJJiMyMjk7wo/CliAgICYjMjMzO8Kdwp4wJiMyMzk7JiMxODg7wpomIzIyODsmIzE4NDsmIzE4NzsmIzIyOTvCiiYjMTY4OyYjMjMwO8KLwokmIzIyOTvCj8KWJiMyMjk7wo7ChiYjMjI5O8KPJiMxNzg7JiMyMzA7JiMxODI7wogmIzIzMDvCgSYjMTc1OyYjMjMwO8KdJiMxNjE7JiMyMzA7wpUmIzE3NjsKICAgICByZXF1aXJlZCBpbnQ2NCBzeW5jVGltZSA9IDI7Ly8mIzIyOTvCkMKMJiMyMzA7JiMxNzM7JiMxNjU7JiMyMzA7wovCiSYjMjI5O8KPwpYmIzIzMDvClyYjMTgyOyYjMjMzO8KXJiMxODA7CiAgICAgb3B0aW9uYWwgc3RyaW5nIGNocm1JZD0zOy8vJiMyMzI7woHCiiYjMjI5OyYjMTY0OyYjMTY5OyYjMjI5OyYjMTc0OyYjMTY0O0lECiAgICB9CiAgICAKICAgIG1lc3NhZ2UgUmVsYXRpb25zSW5wdXQKICAgIHsKICAgICAgICByZXF1aXJlZCBDaGFubmVsVHlwZSB0eXBlID0gMTsKICAgICAgICBvcHRpb25hbCBEb3duU3RyZWFtTWVzc2FnZSBtc2cgPTI7CiAgICAgICAgb3B0aW9uYWwgaW50MzIgY291bnQgPSAzOwogICAgICAgIG9wdGlvbmFsIGludDMyIG9mZnNldCA9IDQ7CiAgICAgICAgb3B0aW9uYWwgaW50NjQgc3RhcnRUaW1lID0gNTsKICAgICAgICBvcHRpb25hbCBpbnQ2NCBlbmRUaW1lID0gNjsKICAgIH0KICAgIG1lc3NhZ2UgUmVsYXRpb25zT3V0cHV0CiAgICB7CiAgICAgICAgcmVwZWF0ZWQgUmVsYXRpb25JbmZvIGluZm8gPSAxOwogICAgfQogICAgbWVzc2FnZSBSZWxhdGlvbkluZm8KICAgIHsKICAgICAgICByZXF1aXJlZCBDaGFubmVsVHlwZSB0eXBlID0gMTsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgdXNlcklkID0gMjsKICAgICAgICBvcHRpb25hbCBEb3duU3RyZWFtTWVzc2FnZSBtc2cgPTM7CiAgICAgICAgb3B0aW9uYWwgaW50NjQgcmVhZE1zZ1RpbWU9IDQ7CiAgICB9CiAgICBtZXNzYWdlIFJlbGF0aW9uSW5mb1JlYWRUaW1lCiAgICB7CiAgICAgICAgcmVxdWlyZWQgQ2hhbm5lbFR5cGUgdHlwZSA9IDE7CiAgICAgICAgcmVxdWlyZWQgaW50NjQgcmVhZE1zZ1RpbWU9IDI7CiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIHRhcmdldElkID0gMzsKICAgIH0KICAgIG1lc3NhZ2UgQ2xlYW5IaXNNc2dJbnB1dAogICAgewogICAgICAgICByZXF1aXJlZCBzdHJpbmcgdGFyZ2V0SWQgPSAxOy8vJiMyMjk7wo8mIzE3NTsmIzIzMjvCgyYjMTg5OyYjMjMwO8KYJiMxNzU7JiMyMzE7wpQmIzE2ODsmIzIzMDvCiCYjMTgzO2lkJiMyMzk7JiMxODg7wowmIzIzMTsmIzE5MDsmIzE2NDsmIzIzMTsmIzE4NzvChGlkJiMyMzE7JiMxNzM7wokmIzIyNzvCgMKCCiAgICAgICAgIHJlcXVpcmVkIGludDY0IGRhdGFUaW1lID0gMjsvLyYjMjMwOyYjMTg0O8KFJiMyMzM7wpkmIzE2NDsmIzIzMDvClyYjMTgyOyYjMjMzO8KXJiMxODA7CiAgICAgICAgIG9wdGlvbmFsIGludDMyIGNvbnZlcnNhdGlvblR5cGU9IDM7Ly8gJiMyMjk7JiMxNjQ7wocmIzIzMzvCgMKJJiMyMjk7JiMxNzM7wpcmIzIzMDsmIzE3NDsmIzE4MTsmIzIzMDvCmsKCJiMyMjg7JiMxODQ7wo0mIzIzMzvCnMKAJiMyMzI7JiMxNjY7woEKICAgIH0KICAgIG1lc3NhZ2UgSGlzdG9yeU1lc3NhZ2VJbnB1dAogICAgewogICAgICAgIHJlcXVpcmVkIHN0cmluZyB0YXJnZXRJZCA9IDE7CiAgICAgICAgcmVxdWlyZWQgaW50NjQgZGF0YVRpbWUgPTI7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgc2l6ZSAgPSAzOwogICAgfQoKICAgIG1lc3NhZ2UgSGlzdG9yeU1lc3NhZ2VzT3VwdXQKICAgIHsKICAgICAgICByZXBlYXRlZCBEb3duU3RyZWFtTWVzc2FnZSBsaXN0ID0gMTsKICAgICAgICByZXF1aXJlZCBpbnQ2NCBzeW5jVGltZSA9IDI7CiAgICAgICAgcmVxdWlyZWQgaW50MzIgaGFzTXNnID0gMzsKICAgIH0KICAgIG1lc3NhZ2UgUXVlcnlDaGF0cm9vbUluZm9JbnB1dAogICAgewogICAgIHJlcXVpcmVkIGludDMyIGNvdW50PSAxOy8vJiMyMzA7wpzCnyYjMjMwO8KcwpsmIzIzMjvCjiYjMTgzOyYjMjI5O8KPwpYmIzIzMjvCgcKKJiMyMjk7JiMxNjQ7JiMxNjk7JiMyMjk7JiMxNzQ7JiMxNjQ7JiMyMzE7wpQmIzE2ODsmIzIzMDvCiCYjMTgzOyYjMjMxO8KawoQmIzIyODsmIzE4NjsmIzE4NjsmIzIzMDvClSYjMTc2OyYjMjM5OyYjMTg4O8KMJiMyMzI7wozCgyYjMjI5O8KbJiMxODA7JiMyMjg7JiMxODQ7JiMxODY7MH4yMAogICAgIG9wdGlvbmFsIGludDMyIG9yZGVyPSAyOy8vJiMyMzA7wozCiSYjMjMwO8KXJiMxODI7JiMyMzM7wpcmIzE4MDsmIzIzMDvCjsKSJiMyMjk7JiMxODY7wo8mIzIzOTsmIzE4ODvCjCYjMjMyO8KMwoMmIzIyOTvCmyYjMTgwOyYjMjM5OyYjMTg4O8KaMCYjMjM5OyYjMTg4O8KMMSYjMjM5OyYjMTg4O8KMMi4mIzIzOTsmIzE4ODvCiDA6JiMyMjg7JiMxODQ7wo0mIzIzMjsmIzE5MTvClCYjMjI5O8Kbwp4mIzIzOTsmIzE4ODvCmzE6JiMyMzA7JiMxNzM7JiMxNjM7JiMyMjk7JiMxODY7wo8oJiMyMzA7wpzCgCYjMjMwO8KXJiMxNjk7JiMyMjk7woomIzE2MDsmIzIyOTvChSYjMTY1OykmIzIzOTsmIzE4ODvCmzI6JiMyMjk7woDCkiYjMjI5OyYjMTg2O8KPKCYjMjMwO8KcwoAmIzIzMDvCmcKaJiMyMjk7woomIzE2MDsmIzIyOTvChSYjMTY1OykmIzIzOTsmIzE4ODvCiQogICAgfQoKICAgIG1lc3NhZ2UgUXVlcnlDaGF0cm9vbUluZm9PdXRwdXQKICAgIHsKICAgICBvcHRpb25hbCBpbnQzMiB1c2VyVG90YWxOdW1zID0gMTsvLyYjMjI5OyYjMTg5O8KTJiMyMjk7wonCjSYjMjMyO8KBwoomIzIyOTsmIzE2NDsmIzE2OTsmIzIyOTsmIzE3NDsmIzE2NDsmIzIyODsmIzE4NDsmIzE3MzsmIzIzMTvCmsKEJiMyMzA7woAmIzE4NzsmIzIyODsmIzE4NjsmIzE4NjsmIzIzMDvClSYjMTc2OwogICAgIHJlcGVhdGVkIENocm1NZW1iZXIgdXNlckluZm9zID0gMjsvLyYjMjMyOyYjMTkxO8KUJiMyMjk7wpvCniYjMjMzO8KDJiMxNjg7JiMyMjk7wojChiYjMjMxO8KUJiMxNjg7JiMyMzA7wogmIzE4MzsmIzIyODsmIzE5MTsmIzE2MTsmIzIzMDvCgSYjMTc1OyYjMjI5O8KIwpcmIzIzMjsmIzE2MTsmIzE2ODsmIzIzOTsmIzE4ODvCiCYjMjI5O8KPJiMxNzA7JiMyMjk7wozChSYjMjI5O8KQJiMxNzE7dXNlcklkJiMyMjk7wpLCjGpvaW5UaW1lJiMyMjk7JiMxNzc7wp4mIzIzMDvCgCYjMTY3OyYjMjM5OyYjMTg4O8KJCiAgICB9CiAgICBtZXNzYWdlIENocm1NZW1iZXIKICAgIHsKICAgICByZXF1aXJlZCBpbnQ2NCB0aW1lID0gMTsvL01lbWJlciYjMjMxO8KawoRqb2luVGltZQogICAgIHJlcXVpcmVkIHN0cmluZyBpZCA9IDI7Ly9NZW1iZXImIzIzMTvCmsKEdXNlcklkCiAgICB9CiAgICBtZXNzYWdlIE1QRm9sbG93SW5wdXQgIC8vbXAmIzIyOTvChSYjMTc5OyYjMjMwOyYjMTc5OyYjMTY4Oy8mIzIyOTvCj8KWJiMyMzA7JiMxODI7wogmIzIyOTvChSYjMTc5OyYjMjMwOyYjMTc5OyYjMTY4OwogICAgewogICAgICAgIHJlcXVpcmVkIHN0cmluZyBpZCA9IDE7Ly9tcGlkCiAgICB9CgogICAgbWVzc2FnZSBNUEZvbGxvd091dHB1dAogICAgewogICAgICAgIHJlcXVpcmVkIGludDMyIG5vdGhpbmcgPSAxOy8vJiMyMjk7wo0mIzE2MDsmIzIyODsmIzE4OTvCjSYjMjI5OyYjMTczO8KXJiMyMzA7JiMxNzQ7JiMxODE7CiAgICAgICAgb3B0aW9uYWwgTXBJbmZvIGluZm8gPTI7Ly8mIzIyOTvChSYjMTc5OyYjMjMwOyYjMTc5OyYjMTY4OyYjMjMxO8KawoRtcGluZm8KICAgIH0KCiAgICBtZXNzYWdlIE1DRm9sbG93SW5wdXQgICAvL21jJiMyMjk7woUmIzE3OTsmIzIzMDsmIzE3OTsmIzE2ODsvJiMyMjk7wo/CliYjMjMwOyYjMTgyO8KIJiMyMjk7woUmIzE3OTsmIzIzMDsmIzE3OTsmIzE2ODsKICAgIHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgaWQgPSAxOy8vbWNpZAogICAgfQoKICAgIG1lc3NhZ2UgTUNGb2xsb3dPdXRwdXQKICAgIHsKICAgICAgICByZXF1aXJlZCBpbnQzMiBub3RoaW5nID0gMTsvLyYjMjI5O8KNJiMxNjA7JiMyMjg7JiMxODk7wo0mIzIyOTsmIzE3MzvClyYjMjMwOyYjMTc0OyYjMTgxOwogICAgICAgIG9wdGlvbmFsIE1wSW5mbyBpbmZvID0yOy8vJiMyMjk7woUmIzE3OTsmIzIzMDsmIzE3OTsmIzE2ODsmIzIzMTvCmsKEbXBpbmZvCiAgICB9CgogICAgbWVzc2FnZSBNcEluZm8gIC8vbXAmIzIyOTvCnyYjMTg2OyYjMjMwO8KcJiMxNzI7JiMyMjg7JiMxOTE7JiMxNjE7JiMyMzA7woEmIzE3NTsKICAgIHsKICAgICAgICByZXF1aXJlZCBzdHJpbmcgbXBpZD0xOy8vbXAvbWNpZAogICAgICAgIHJlcXVpcmVkIHN0cmluZyBuYW1lID0gMjsvL2Rpc3BsYXlOYW1lCiAgICAgICAgcmVxdWlyZWQgc3RyaW5nIHR5cGUgPSAzOy8vbXAvbWMKICAgICAgICByZXF1aXJlZCBpbnQ2NCB0aW1lPTQ7Ly8mIzIyOTvChSYjMTcyOyYjMjI4OyYjMTg4O8KXJiMyMjk7JiMxODQ7wpAmIzIyOTvCjyYjMTgzOyYjMjI4OyYjMTkxOyYjMTc0OyYjMjMwO8KUJiMxODU7JiMyMzA7wpcmIzE4MjsmIzIzMzvClyYjMTgwOwogICAgICAgIG9wdGlvbmFsIHN0cmluZyBwb3J0cmFpdFVybD01Oy8vJiMyMjk7JiMxNjQ7JiMxODA7JiMyMjk7woPCjwogICAgICAgIG9wdGlvbmFsIHN0cmluZyBleHRyYSA9NjsvLyYjMjI5O8KFJiMxODI7JiMyMjg7JiMxODc7wpYmIzIyODsmIzE5MTsmIzE2MTsmIzIzMDvCgSYjMTc1Oyhqc29uKSYjMjM5OyYjMTg4O8KMJiMyMzA7wovCiSYjMjI5O8KPwpYmIzIzMTvCmsKEJiMyMzA7wpcmIzE4MjsmIzIyOTvCgMKZJiMyMjk7wozChSYjMjI5O8KQJiMxNzE7JiMyMzI7wo/CnCYjMjI5O8KNwpUmIzIyNzvCgMKBJiMyMzE7JiMxNzQ7woAmIzIyODsmIzE4NzvCiyYjMjMxOyYjMTczO8KJJiMyMjg7JiMxOTE7JiMxNjE7JiMyMzA7woEmIzE3NTsmIzIyNzvCgMKCCiAgICB9CgogICAgbWVzc2FnZSBTZWFyY2hNcElucHV0IC8vJiMyMzA7JiMxNjA7JiMxODU7JiMyMzA7wo0mIzE3NDsmIzIyOTvChSYjMTcyOyYjMjI4OyYjMTg4O8KXJiMyMjk7JiMxODQ7wpAmIzIyOTvCjyYjMTgzO2lkJiMyMjk7JiMxNzQ7wowmIzIyOTvChSYjMTY4OyYjMjI5O8KMJiMxODU7JiMyMzM7woXCjSYjMjMwO8KfJiMxNjU7JiMyMzA7wokmIzE5MDsKICAgIHsKICAgICAgICByZXF1aXJlZCBpbnQzMiB0eXBlPTE7Ly8mIzIzMDsmIzE2MDvChyYjMjI5OyYjMTkxO8KXJiMyMjg7JiMxODk7wo0sJiMyMzA7wpcmIzE2NTsmIzIyOTvCkMKOJiMyMzA7wozCiSYjMjI4OyYjMTg5O8KNJiMyMzA7wp0mIzE2NTsmIzIyOTvCgcKaJiMyMzA7wokmIzE2OTsmIzIyOTsmIzE3NzvClQogICAgICAgIHJlcXVpcmVkIHN0cmluZyBpZD0yOy8vbXBpZC9tY2lkL2Rpc3BsYXlOYW1lCiAgICB9CgogICAgbWVzc2FnZSBTZWFyY2hNcE91dHB1dAogICAgewogICAgICAgIHJlcXVpcmVkIGludDMyIG5vdGhpbmc9MTsvLyYjMjI5O8KNJiMxNjA7JiMyMjg7JiMxODk7wo0mIzIzMTsmIzE3MjsmIzE2NjsKICAgICAgICByZXBlYXRlZCBNcEluZm8gaW5mbyA9IDI7Ly8mIzIyOTvChSYjMTcyOyYjMjI4OyYjMTg4O8KXJiMyMjk7JiMxODQ7wpAmIzIyOTvCjyYjMTgzOwogICAgfQoKICAgIG1lc3NhZ2UgUHVsbE1wSW5wdXQgLy8mIzIzMTsmIzE3MTsmIzE3NTsmIzIyODsmIzE4NDvCiiYjMjMwO8KLwokmIzIyOTvCj8KWJiMyMjk7woUmIzE3MjsmIzIyODsmIzE4ODvClyYjMjMyOyYjMTgwOyYjMTY2OyYjMjI5O8KPJiMxODM7JiMyMjg7JiMxOTE7JiMxNjE7JiMyMzA7woEmIzE3NTsKICAgIHsKICAgICAgICByZXF1aXJlZCBpbnQ2NCB0aW1lPTE7Ly8mIzIyOTvChSYjMTcyOyYjMjI4OyYjMTg4O8KXJiMyMjk7JiMxODQ7wpAmIzIyOTvCjyYjMTgzOyYjMjI4OyYjMTkxOyYjMTc0OyYjMjMwO8KUJiMxODU7JiMyMzA7wpcmIzE4MjsmIzIzMzvClyYjMTgwOwogICAgICAgIHJlcXVpcmVkIHN0cmluZyBtcGlkPTI7Ly8mIzIzMTsmIzE3MTsmIzE3NTsmIzIyODsmIzE4NDvCiiYjMjMxOyYjMTg4O8KTJiMyMjk7JiMxNzM7wpgmIzIyOTvChSYjMTcyOyYjMjI4OyYjMTg4O8KXJiMyMjk7JiMxODQ7wpAmIzIyOTvCjyYjMTgzOyYjMjMxO8KawoRpZCYjMjMxO8KawoRtZDUmIzIyODsmIzE4NDsmIzE3ODsKICAgIH0KCiAgICBtZXNzYWdlIFB1bGxNcE91dHB1dAogICAgewogICAgICAgIHJlcXVpcmVkIGludDMyIHN0YXR1cz0xOy8vJiMyMzA7wpgmIzE3NTsmIzIyOTvCkCYjMTY2OyYjMjMwO8KcwokmIzIzMDsmIzE4MzsmIzE4NzsmIzIyOTvCiiYjMTYwOyYjMjI5O8KSwowmIzIyOTvCiCYjMTYwOyYjMjMzO8KZJiMxNjQ7JiMyMzk7JiMxODg7wowmIzIyOTsmIzE2NjvCgiYjMjMwO8KewpwmIzIzMDvCnMKJJiMyMjk7wo/CmCYjMjI5O8KMwpYmIzIyOTvCiMKZJiMyMzI7JiMxOTE7wpQmIzIyOTvCm8KeJiMyMjk7woUmIzE2ODsmIzIzMzvCgyYjMTY4OyYjMjM5OyYjMTg4O8KMJiMyMjk7wpAmIzE2NjsmIzIyOTvCiMKZJiMyMzI7JiMxOTE7wpQmIzIyOTvCm8KeJiMyMzA7wpsmIzE4MDsmIzIzMDvCliYjMTc2OyYjMjMxO8KawoQKICAgICAgICByZXBlYXRlZCBNcEluZm8gaW5mbyA9IDI7Ly8mIzIyOTvChSYjMTcyOyYjMjI4OyYjMTg4O8KXJiMyMjk7JiMxODQ7wpAmIzIyOTvCjyYjMTgzOwogICAgfQogICAgbWVzc2FnZSBIaXN0b3J5TXNnSW5wdXQgIAogICAgewogICAgICAgIG9wdGlvbmFsIHN0cmluZyB0YXJnZXRJZCA9IDE7Ly8mIzIzMjvCgcKKJiMyMjk7JiMxNjQ7JiMxNjk7JiMyMjk7JiMxNzQ7JiMxNjQ7SUQKICAgICAgICBvcHRpb25hbCBpbnQ2NCB0aW1lID0gMjsvLyYjMjMwO8KfJiMxNjU7JiMyMzI7JiMxNzU7JiMxNjI7JiMyMzA7wpcmIzE4MjsmIzIzMzvClyYjMTgwOyYjMjMxO8KCJiMxODU7CiAgICAgICAgb3B0aW9uYWwgaW50MzIgY291bnQgID0gMzsvLyYjMjMwO8KLwokmIzIyOTvCj8KWJiMyMzA7wp0mIzE2MTsmIzIzMDvClSYjMTc2OwogICAgICAgIG9wdGlvbmFsIGludDMyIG9yZGVyID0gNDsvLyYjMjMwO8KLwokmIzIyOTvCj8KWJiMyMzM7JiMxNjE7JiMxODY7JiMyMjk7JiMxODY7wo8gKDEmIzIzOTsmIzE4ODvCmiYjMjMwOyYjMTczOyYjMTYzOyYjMjI5OyYjMTg2O8KPJiMyMzk7JiMxODg7wpswJiMyMzk7JiMxODg7wpomIzIyOTvCgMKSJiMyMjk7JiMxODY7wo8pCiAgICB9CgogICAgbWVzc2FnZSBIaXN0b3J5TXNnT3VwdXQgIC8vJiMyMzI7JiMxOTE7wpQmIzIyOTvCm8KeJiMyMzI7woHCiiYjMjI5OyYjMTY0OyYjMTY5OyYjMjI5OyYjMTc0OyYjMTY0OyYjMjI5O8KOwoYmIzIyOTvCjyYjMTc4OyYjMjMwOyYjMTgyO8KIJiMyMzA7woEmIzE3NTsKICAgIHsKICAgICAgICByZXBlYXRlZCBEb3duU3RyZWFtTWVzc2FnZSBsaXN0PTE7Ly8mIzIzMDvCicKAJiMyMzA7wosmIzE2NTsmIzIzMDvCnMKJJiMyMzE7wprChCYjMjMwOyYjMTgyO8KIJiMyMzA7woEmIzE3NTsmIzIzOTsmIzE4ODvCiGxpc3QmIzIyOTsmIzE2NDvCjSYjMjMxOyYjMTc3OyYjMTg3OyYjMjI5O8KewosmIzIzOTsmIzE4ODvCiQogICAgICAgIHJlcXVpcmVkIGludDY0IHN5bmNUaW1lPTI7Ly8mIzIyOTvCkMKMJiMyMzA7JiMxNzM7JiMxNjU7JiMyMzA7wpcmIzE4MjsmIzIzMzvClyYjMTgwOwogICAgICAgIHJlcXVpcmVkIGludDMyIGhhc01zZz0zOyAvLyYjMjMwO8KYJiMxNzU7JiMyMjk7wpAmIzE2NjsmIzIzMjsmIzE5MTvCmCYjMjMwO8KcwokmIzIyOTvCkMKOJiMyMzE7JiMxODc7JiMxNzM7JiMyMjk7wo7ChiYjMjI5O8KPJiMxNzg7JiMyMzA7JiMxODI7wogmIzIzMDvCgSYjMTc1OwogICAgfQogICAgbWVzc2FnZSBSdGNRdWVyeUxpc3RJbnB1dHsKICAgICAgb3B0aW9uYWwgaW50MzIgb3JkZXI9MTsgLy8mIzIzMDvCnSYjMTYxOyYjMjMwO8KVJiMxNzY7JiMyMzM7wpnCkCYjMjI5O8KIJiMxODI7JiMyMjk7wpwmIzE2ODsmIzIzMDvCnMKNJiMyMjk7woomIzE2MTsmIzIzMTsmIzE3MTsmIzE3NTsmIzIyOTvCgcKaIDEgJiMyMzA7wpgmIzE3NTsmIzIzMDsmIzE3MzsmIzE2MzsmIzIyOTsmIzE4NjvCjywyJiMyMzA7wpgmIzE3NTsmIzIyOTvCgMKSJiMyMjk7JiMxODY7wo8KICAgIH0KCiAgICBtZXNzYWdlIFJ0Y0tleURlbGV0ZUlucHV0ewogICAgICByZXBlYXRlZCBzdHJpbmcga2V5PTE7CiAgICB9CgogICAgbWVzc2FnZSBSdGNWYWx1ZUluZm97CiAgICAgIHJlcXVpcmVkIHN0cmluZyBrZXk9MTsKICAgICAgcmVxdWlyZWQgc3RyaW5nIHZhbHVlPTI7CiAgICB9CgogICAgbWVzc2FnZSBSdGNVc2VySW5mb3sKICAgICAgcmVxdWlyZWQgc3RyaW5nIHVzZXJJZD0xOwogICAgICByZXBlYXRlZCBSdGNWYWx1ZUluZm8gdXNlckRhdGE9MjsKICAgIH0KCiAgICBtZXNzYWdlIFJ0Y1VzZXJMaXN0T3V0cHV0ewogICAgICByZXBlYXRlZCBSdGNVc2VySW5mbyBsaXN0PTE7CiAgICAgIG9wdGlvbmFsIHN0cmluZyB0b2tlbj0yOwogICAgfQogICAgbWVzc2FnZSBSdGNSb29tSW5mb091dHB1dHsKICAgICAgICBvcHRpb25hbCBzdHJpbmcgcm9vbUlkID0gMTsKICAgICAgICByZXBlYXRlZCBSdGNWYWx1ZUluZm8gcm9vbURhdGEgPSAyOwogICAgICAgIG9wdGlvbmFsIGludDMyIHVzZXJDb3VudCA9IDM7CiAgICAgICAgcmVwZWF0ZWQgUnRjVXNlckluZm8gbGlzdD00OwogICAgfQogICAgbWVzc2FnZSBSdGNJbnB1dHsKICAgICAgb3B0aW9uYWwgaW50MzIgbm90aGluZz0xOwogICAgfQogICAgbWVzc2FnZSBSdGNRcnlJbnB1dHsgLy9xdWVyeSAmIzIyOTvCjyYjMTc1OyYjMjI4OyYjMTg3OyYjMTY1OyYjMjMwO8KYJiMxNzU7JiMyMzA7wp8mIzE2NTsmIzIzMjsmIzE3NTsmIzE2MjsmIzIyOTvCjcKVJiMyMjg7JiMxODQ7JiMxNzA7JiMyMjk7JiMxNzc7wp4mIzIzMDvCgCYjMTY3OyYjMjI4OyYjMTg1O8KfJiMyMjk7wo8mIzE3NTsmIzIyODsmIzE4NzsmIzE2NTsmIzIzMDvCnyYjMTY1OyYjMjMyOyYjMTc1OyYjMTYyOyYjMjI5OyYjMTY0O8KaJiMyMjg7JiMxODQ7JiMxNzA7JiMyMjk7JiMxNzc7wp4mIzIzMDvCgCYjMTY3OwogICAgICByZXF1aXJlZCBib29sIGlzSW50ZXJpb3I9MTsvLyYjMjMwO8KYJiMxNzU7JiMyMjk7wpAmIzE2NjsmIzIyODsmIzE4NDsmIzE4NjsmIzIzMjvCjiYjMTgzOyYjMjI5O8KPwpYmIzIyOTvChsKFJiMyMzM7woMmIzE2ODsmIzIzMDvClSYjMTc2OyYjMjMwO8KNJiMxNzQ7CiAgICAgIHJlcXVpcmVkIHRhcmdldFR5cGUgdGFyZ2V0PTI7CiAgICAgIHJlcGVhdGVkIHN0cmluZyBrZXk9MzsgLy8mIzIyOTvCiCYjMTYwOyYjMjMzO8KZJiMxNjQ7JiMyMzA7wozChyYjMjI5OyYjMTc0O8KaIHVzZXIgJiMyMzA7wojCliYjMjMyO8KAwoUgcm9vbSBJZCYjMjMxO8KawoQga2V5CiAgICB9CiAgICBtZXNzYWdlIFJ0Y1FyeU91dHB1dHsKICAgICAgcmVwZWF0ZWQgUnRjVmFsdWVJbmZvIG91dEluZm89MTsKICAgIH0KICAgIG1lc3NhZ2UgUnRjRGVsRGF0YUlucHV0ewogICAgICByZXBlYXRlZCBzdHJpbmcga2V5PTE7IC8vJiMyMjk7wogmIzE2MDsmIzIzMzvCmSYjMTY0OyYjMjMwO8KMwocmIzIyOTsmIzE3NDvCmiB1c2VyICYjMjMwO8KIwpYmIzIzMjvCgMKFIHJvb20gSWQmIzIzMTvCmsKEIGtleQogICAgICByZXF1aXJlZCBib29sIGlzSW50ZXJpb3I9MjsvLyYjMjMwO8KYJiMxNzU7JiMyMjk7wpAmIzE2NjsmIzIyODsmIzE4NDsmIzE4NjsmIzIyOTsmIzE2NDvChCYjMjMxO8KQwoYmIzIyOTvChsKFJiMyMzM7woMmIzE2ODsmIzIzMDvClSYjMTc2OyYjMjMwO8KNJiMxNzQ7CiAgICAgIHJlcXVpcmVkIHRhcmdldFR5cGUgdGFyZ2V0PTM7CiAgICB9CiAgICBtZXNzYWdlIFJ0Y0RhdGFJbnB1dHsgCiAgICAgIHJlcXVpcmVkIGJvb2wgaW50ZXJpb3I9MTsKICAgICAgLy8mIzIzMDvCmCYjMTc1OyYjMjI5O8KQJiMxNjY7JiMyMjg7JiMxODQ7JiMxODY7JiMyMzI7wo4mIzE4MzsmIzIyOTvCj8KWJiMyMjk7wobChSYjMjMzO8KDJiMxNjg7JiMyMzA7wpUmIzE3NjsmIzIzMDvCjSYjMTc0OwogICAgICByZXF1aXJlZCB0YXJnZXRUeXBlIHRhcmdldD0yOwogICAgICAvLyYjMjI5O8KIJiMxNjA7JiMyMzM7wpkmIzE2NDsmIzIzMDvCjMKHJiMyMjk7JiMxNzQ7wpogdXNlciAmIzIzMDvCiMKWJiMyMzI7woDChSByb29tIElkJiMyMzE7wprChCBrZXkKICAgICAgcmVwZWF0ZWQgc3RyaW5nIGtleT0zOwogICAgICBvcHRpb25hbCBzdHJpbmcgb2JqZWN0TmFtZT01OwogICAgICBvcHRpb25hbCBzdHJpbmcgY29udGVudD02OwogICAgfQogICAgbWVzc2FnZSBSdGNTZXREYXRhSW5wdXR7CiAgICAgIHJlcXVpcmVkIGJvb2wgaW50ZXJpb3I9MTsvLyYjMjMwO8KYJiMxNzU7JiMyMjk7wpAmIzE2NjsmIzIyODsmIzE4NDsmIzE4NjsmIzIyOTvCj8KRJiMyMjk7JiMxODQ7woMmIzIyOTvChsKFJiMyMzM7woMmIzE2ODsmIzIzMDvClSYjMTc2OyYjMjMwO8KNJiMxNzQ7CiAgICAgIHJlcXVpcmVkIHRhcmdldFR5cGUgdGFyZ2V0PTI7CiAgICAgIHJlcXVpcmVkIHN0cmluZyBrZXk9MzsKICAgICAgcmVxdWlyZWQgc3RyaW5nIHZhbHVlPTQ7CiAgICAgIG9wdGlvbmFsIHN0cmluZyBvYmplY3ROYW1lPTU7CiAgICAgIG9wdGlvbmFsIHN0cmluZyBjb250ZW50PTY7CiAgICB9CiAgICBtZXNzYWdlIFJ0Y091dHB1dAogICAgewogICAgICAgIG9wdGlvbmFsIGludDMyIG5vdGhpbmc9MTsgICAgLy8mIzIyOTvCjSYjMTYwOyYjMjI4OyYjMTg5O8KNCiAgICB9CiAgICBtZXNzYWdlIFJ0Y1Rva2VuT3V0cHV0ewogICAgICByZXF1aXJlZCBzdHJpbmcgcnRjVG9rZW49MTsKICAgIH0KICAgIGVudW0gdGFyZ2V0VHlwZSB7CiAgICAgIFJPT00gPTEgOwogICAgICBQRVJTT04gPSAyOwogICAgfQp9\");var i=l.loadProto(h,undefined,\"\").build(\"Modules\").probuf;return i})(c,d,a);return e});\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(\"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/process/browser.js\")))\n\n/***/ }),\n\n/***/ \"./src/pages/index/index.cml\":\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __cml__style0 = __webpack_require__(\"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/cml-extract-css-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/vue-style-loader/index.js!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/css-loader/index.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"platform\\\":\\\"miniapp\\\",\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/postcss-loader/lib/index.js?{\\\"sourceMap\\\":false,\\\"config\\\":{\\\"path\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/configs/postcss/wx/.postcssrc.js\\\"}}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/less-loader/dist/cjs.js?{\\\"sourceMap\\\":false}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-css-loader/index.js?{\\\"media\\\":true,\\\"cmlType\\\":\\\"wx\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=styles&index=0&fileType=page&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/pages/index/index.cml\");\nvar __cml__script = __webpack_require__(\"../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/babel-loader/lib/index.js?{\\\"filename\\\":\\\"/Users/wangyonghao/.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/chameleon.js\\\"}!../../../../../.nvm/versions/node/v10.16.0/lib/node_modules/chameleon-tool/node_modules/chameleon-loader/src/selector.js?type=script&index=0&fileType=page&media=dev&cmlType=wx&isInjectBaseStyle=true&check={\\\"enable\\\":true,\\\"enableTypes\\\":[]}!./src/pages/index/index.cml\");\n\n\n/***/ })\n\n},[\"./src/pages/index/index.cml\"]);"
  },
  {
    "path": "chameleon/mock/api/index.js",
    "content": "\nmodule.exports = [\n  {\n    method: ['get', 'post'],\n    path: '/api/getMessage',\n    controller: function (req, res, next) {\n      res.json({\n        total: 0,\n        message: [{\n          name: 'Hello chameleon!'\n        }]\n      });\n    }\n  }\n]\n"
  },
  {
    "path": "chameleon/mock/template/index.php",
    "content": "<?php\n\t$chameleon = array(\n\t\t\"errno\"=> \"0\",\n\t\t\"errmsg\"=> \"\",\n\t\t\"pageData\"=> array(\n\t\t\t\"name\"=>\"chameleon\",\n\t\t\t\"age\" => 10\n\t\t)\n\t);"
  },
  {
    "path": "chameleon/npm-shrinkwrap.json",
    "content": "{\n  \"name\": \"connectDemo\",\n  \"version\": \"1.0.0\",\n  \"lockfileVersion\": 1,\n  \"requires\": true,\n  \"dependencies\": {\n    \"chameleon-api\": {\n      \"version\": \"0.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/chameleon-api/-/chameleon-api-0.1.0.tgz\",\n      \"integrity\": \"sha512-3voN7q29/mApCpH4D58dQds2GjmhI7s1DbBpsdg46yKwMHYwW2B7dr6KyVNecnjOHU1fCRs+lgxyB7n4/voQ4Q==\",\n      \"requires\": {\n        \"chameleon-bridge\": \"0.1.0\",\n        \"fetch-detector\": \"^1.0.1\",\n        \"fetch-ie8\": \"^1.5.0\"\n      }\n    },\n    \"chameleon-bridge\": {\n      \"version\": \"0.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/chameleon-bridge/-/chameleon-bridge-0.1.0.tgz\",\n      \"integrity\": \"sha512-1Qc7F4ts0zlfglGn3VnVSPg3SRge37gu5/EQ+Mz8K3vqpRgoXGPN6cRtK+4wrvqox740gml+yWsuV10GY2xB1A==\"\n    },\n    \"chameleon-runtime\": {\n      \"version\": \"0.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/chameleon-runtime/-/chameleon-runtime-0.0.3.tgz\",\n      \"integrity\": \"sha512-4BZHXmpFPI6+oHvooOf1IcAD5BkjOFwLKSD3/EcL2k9PbZ8m4XZaxdyMwuErdci24c1cgJEcINivOYg4HztbsA==\",\n      \"requires\": {\n        \"mobx\": \"3.6.1\"\n      }\n    },\n    \"chameleon-scroll\": {\n      \"version\": \"0.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/chameleon-scroll/-/chameleon-scroll-0.0.1.tgz\",\n      \"integrity\": \"sha512-kpsab4j7dn0dpTseb60Pz8Qz1V7nc/UsElYixaK+n6MQxkCKoHKs25DHZ/4xH2rsWXqnPbAd7Je02zeFkKo7jw==\"\n    },\n    \"chameleon-store\": {\n      \"version\": \"0.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/chameleon-store/-/chameleon-store-0.0.3.tgz\",\n      \"integrity\": \"sha512-f6lmeDW01xnau71iXK52haomD2etmQg+gBvVFO5T84eqs9AxtXiRkYAjxl/rqu+ejFACAm1nWMfAjXldw0lUTQ==\",\n      \"requires\": {\n        \"mobx\": \"3.6.1\",\n        \"vuex\": \"3.0.1\"\n      }\n    },\n    \"chameleon-ui-builtin\": {\n      \"version\": \"0.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/chameleon-ui-builtin/-/chameleon-ui-builtin-0.0.6.tgz\",\n      \"integrity\": \"sha512-UwAxxaHdurksKX0m4czx8OjmaBdJZSXs5idVcWh35Zm4JPeHLsusRYQx6UTRCFneJaKwIAYF60TEUotPFBtzNQ==\",\n      \"requires\": {\n        \"chameleon-scroll\": \"0.0.1\"\n      }\n    },\n    \"classnames\": {\n      \"version\": \"2.2.6\",\n      \"resolved\": \"https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz\",\n      \"integrity\": \"sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==\"\n    },\n    \"cml-ui\": {\n      \"version\": \"0.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/cml-ui/-/cml-ui-0.0.6.tgz\",\n      \"integrity\": \"sha512-6Dq+h4AnCYAevIWbJE6EOLobAA1Q78eqvl9BRngRIK7/vmMwU0UYBTd3g72c9G+y42bxGBGlfrcZWKs7PqcP0A==\",\n      \"requires\": {\n        \"classnames\": \"2.2.6\"\n      }\n    },\n    \"fetch-detector\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/fetch-detector/-/fetch-detector-1.0.1.tgz\",\n      \"integrity\": \"sha1-bLPq9zjCcnhi6GiA1hIUI+qkIIM=\"\n    },\n    \"fetch-ie8\": {\n      \"version\": \"1.5.0\",\n      \"resolved\": \"https://registry.npmjs.org/fetch-ie8/-/fetch-ie8-1.5.0.tgz\",\n      \"integrity\": \"sha1-8RQcP5bLyJN6oxsPvBp3AiD7wVs=\"\n    },\n    \"mobx\": {\n      \"version\": \"3.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/mobx/-/mobx-3.6.1.tgz\",\n      \"integrity\": \"sha1-rmOo8A4UhadA0Pka4val9o4wO+o=\"\n    },\n    \"vuex\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz\",\n      \"integrity\": \"sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==\"\n    }\n  }\n}\n"
  },
  {
    "path": "chameleon/package.json",
    "content": "{\n  \"name\": \"connectDemo\",\n  \"version\": \"1.0.0\",\n  \"description\": \"A chameleon project\",\n  \"author\": \"\",\n  \"private\": true,\n  \"scripts\": {},\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"chameleon-api\": \"0.1.0\",\n    \"chameleon-bridge\": \"0.1.0\",\n    \"chameleon-runtime\": \"0.0.3\",\n    \"chameleon-store\": \"0.0.3\",\n    \"chameleon-ui-builtin\": \"0.0.6\",\n    \"cml-ui\": \"0.0.6\"\n  }\n}\n"
  },
  {
    "path": "chameleon/src/app/app.cml",
    "content": "<template>\n  <app store=\"{{store}}\" router-config=\"{{routerConfig}}\"></app>\n</template>\n<script>\nimport store from '../store/index.js'\nimport routerConfig from '../router.config.json';\n\nclass App {\n  data = {\n    store,\n    routerConfig\n  }\n  created(res) {\n  }\n}\n\nexport default new App();\n</script>\n\n<style>\n\n</style>\n\n<script cml-type=\"json\">\n{\n  \"wx\": {\n    \"window\": {\n      \"backgroundTextStyle\": \"dark\",\n      \"navigationBarBackgroundColor\": \"#343434\",\n      \"navigationBarTitleText\": \"CNODE\",\n      \"navigationBarTextStyle\": \"white\"\n    }\n  }\n}\n</script>"
  },
  {
    "path": "chameleon/src/assets/js/RongIMLib-2.4.0.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.4.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, callback);\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, callback);\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.4.0';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                return RongIMLib.RongIMClient.RTCListener(message);\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().getServerEndpoint(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && _client.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                storage.setItem('fullnavi', JSON.stringify(result));\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.RongIMClient._memoryStore.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user) {\n            this.id = id;\n            this.user = user;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            ;\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getNavi = function () {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "chameleon/src/components/demo-com/demo-com.cml",
    "content": "<template>\n  <view class=\"demo-com\">\n    <text class=\"title\">{{title}}</text>\n    <image src=\"{{imageSrc}}\" class=\"logo\"></image>  \n  </view>\n</template>\n\n<script>\n\nclass DemoCom {\n  props = {\n    title: {\n      type: String,\n      default: ''\n    },\n    imageSrc: {\n      type: String,\n      default: ''\n    },\n  }\n\n  data = {\n  }\n\n  computed = {\n  }\n\n  watch  = {\n  }\n\n  methods = {\n  }\n\n  beforeCreate() {\n  }\n\n  created() {\n  }\n\n  beforeMount() {\n  }\n\n  mounted() {\n  }\n\n  beforeDestroy() {\n  }\n\n  destroyed() {\n  }\n}\n\nexport default new DemoCom();\n</script>\n<style>\n.demo-com {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n}\n.title {\n  align-self: center;\n  color: #61c7fc;\n  font-size: 72cpx;\n  margin-top: 160cpx;\n  margin-bottom: 20cpx;\n}\n.logo {\n  width: 150cpx;\n  height: 150cpx;\n  margin-top: 100cpx;\n}\n</style>\n<script cml-type=\"json\">\n{\n  \"base\": {\n    \"usingComponents\": {}\n  }\n}\n</script>\n"
  },
  {
    "path": "chameleon/src/pages/index/index.cml",
    "content": "<template>\n  <view class=\"rong-main\">\n    <h1>{{ title }}</h1>\n    <view>\n      <text class=\"rong-label\">appkey: </text>\n      <input type=\"text\" c-model=\"{{appkey}}\" class=\"rong-appkey\"></input>\n    </view>\n    <view>\n       <text class=\"rong-label\">token: </text>\n       <input type=\"text\" c-model=\"{{token}}\" class=\"rong-token\"></input>\n    </view>\n    <view>\n       <text class=\"rong-label\">user: </text>\n       <input c-model=\"{{userId}}\" class=\"rong-userId\"></input>\n    </view>\n    <button text=\"初始化链接\" c-bind:onclick=\"init\" class=\"rong-button\"></button>\n    <p>初始化链接状态:</p>\n    <view c-for=\"{{ initResult }}\" c-for-index=\"idx\" c-for-item=\"itemName\">\n      <text class=\"init-status\">{{ itemName }}</text>\n    </view>\n  </view>\n</template>\n\n<script>\nimport RongIMLib from '../../assets/js/RongIMLib-2.4.0.min.js';\nimport protobuf from '../../assets/js/protobuf-2.3.4.min.js';\n\nfunction setListener(appKey,callback){\n  console.log('setListener');\n  RongIMLib.RongIMClient.init(appKey, null, {\n    protobuf: protobuf\n  });\n  // 设置连接监听状态 （ status 标识当前连接状态 ）\n  // 连接状态监听器\n  RongIMLib.RongIMClient.setConnectionStatusListener({\n    onChanged: function (status) {\n      callback(status)\n      switch (status) {\n        case RongIMLib.ConnectionStatus.CONNECTED:\n          console.log('链接成功');\n          break;\n        case RongIMLib.ConnectionStatus.CONNECTING:\n          console.log('正在链接');\n          break;\n        case RongIMLib.ConnectionStatus.DISCONNECTED:\n          console.log('断开连接');\n          break;\n        case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n          console.log('其他设备登录');\n          break;\n        case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n          console.log('域名不正确');\n          break;\n        case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n          console.log('网络不可用');\n          break;\n      }\n    }\n  });\n  // 消息监听器\n  RongIMLib.RongIMClient.setOnReceiveMessageListener({\n      // 接收到的消息\n      onReceived: function (message) {\n          // 判断消息类型\n          switch(message.messageType){\n              case RongIMClient.MessageType.TextMessage:\n                  // message.content.content => 消息内容\n                  break;\n              case RongIMClient.MessageType.VoiceMessage:\n                  // 对声音进行预加载                \n                  // message.content.content 格式为 AMR 格式的 base64 码\n                  break;\n              case RongIMClient.MessageType.ImageMessage:\n                // message.content.content => 图片缩略图 base64。\n                // message.content.imageUri => 原图 URL。\n                break;\n              case RongIMClient.MessageType.DiscussionNotificationMessage:\n                // message.content.extension => 讨论组中的人员。\n                break;\n              case RongIMClient.MessageType.LocationMessage:\n                // message.content.latiude => 纬度。\n                // message.content.longitude => 经度。\n                // message.content.content => 位置图片 base64。\n                break;\n              case RongIMClient.MessageType.RichContentMessage:\n                // message.content.content => 文本消息内容。\n                // message.content.imageUri => 图片 base64。\n                // message.content.url => 原图 URL。\n                break;\n              case RongIMClient.MessageType.InformationNotificationMessage:\n                  // do something...\n                break;\n              case RongIMClient.MessageType.ContactNotificationMessage:\n                  // do something...\n                break;\n              case RongIMClient.MessageType.ProfileNotificationMessage:\n                  // do something...\n                break;\n              case RongIMClient.MessageType.CommandNotificationMessage:\n                  // do something...\n                break;\n              case RongIMClient.MessageType.CommandMessage:\n                  // do something...\n                break;\n              case RongIMClient.MessageType.UnknownMessage:\n                  // do something...\n                break;\n              default:\n                  // do something...\n          }\n      }\n  });\n}\nfunction connect(data,callback) {\n  let cml = this;\n  let token = data.token;\n  let userId = data.userId;\n  RongIMLib.RongIMClient.connect(token, {\n    onSuccess: function(userId) {\n      console.log(\"Connect successfully.\" + userId);\n      callback(userId);\n    },\n    onTokenIncorrect: function() {\n      console.log('token无效');\n      callback();\n    },\n    onError:function(errorCode){\n        var info = '';\n        switch (errorCode) {\n          case RongIMLib.ErrorCode.TIMEOUT:\n            info = '超时';\n            break;\n          case RongIMLib.ConnectionState.UNACCEPTABLE_PAROTOCOL_VERSION:\n            info = '不可接受的协议版本';\n            break;\n          case RongIMLib.ConnectionState.IDENTIFIER_REJECTED:\n            info = 'appkey不正确';\n            break;\n          case RongIMLib.ConnectionState.SERVER_UNAVAILABLE:\n            info = '服务器不可用';\n            break;\n        }\n        console.log(errorCode);\n      }\n  });\n}\nclass Index {\n  data = {\n    title: 'Chameleon框架-连接融云服务demo',\n    appkey:'vnroth0kvbf4o',\n    token:'dvKz9A78l1XTOefuNW1XN+vX7mzajXCPhVdLzaVlxBArcMENdNOjkzB3EDvQjyIobIeFv0Cezh/32gSONIAXOA==',\n    userId:'1001',\n    initResult:[],\n  }\n  computed = {\n    message2: function() {\n      return 'computed' + this.message;\n    }\n  }\n  methods = {\n    test(){\n      console.log('appkey',this.appkey)\n    },\n    init(){\n      let cml = this;\n      let appkey = cml.appkey;\n      let data = {\n        token: this.token,\n        userId: this.userId\n      }\n      console.log('data: ', data);\n      setListener(appkey,function(status){\n        switch (status) {\n          case RongIMLib.ConnectionStatus.CONNECTED:\n            cml.initResult.push('链接成功');\n            break;\n          case RongIMLib.ConnectionStatus.CONNECTING:\n            cml.initResult.push('正在链接');\n            break;\n          case RongIMLib.ConnectionStatus.DISCONNECTED:\n            cml.initResult.push('断开连接');\n            break;\n          case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n            cml.initResult.push('其他设备登录');\n            break;\n          case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n            cml.initResult.push('域名不正确');\n            break;\n          case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n            cml.initResult.push('网络不可用');\n            break;\n        }\n      })\n      connect(data,function(userId){\n        if(userId){\n          cml.initResult.push(\"Connect successfully.\" + userId);\n        }else {\n          cml.initResult.push('token无效');\n        }\n      });\n    }\n  }\n}\n\nexport default new Index();\n</script>\n<style scoped>\n.rong-main {\n  padding: 8px\n}\n.rong-label {\n  margin-bottom: 8px;\n}\n.rong-appkey {\n  width: 100%;\n}\n.rong-button {\n  width: 100%;\n  margin: 8px 0 8px 0 ;\n}\n.init-status {\n  font-size: .3rem;\n}\n</style>\n<script cml-type=\"json\">\n{}\n</script>\n"
  },
  {
    "path": "chameleon/src/router.config.json",
    "content": "{\n  \"mode\": \"history\",\n  \"domain\": \"https://www.chameleon.com\",\n  \"routes\":[\n    {\n      \"url\": \"/cml/h5/index\",\n      \"path\": \"/pages/index/index\",\n      \"name\": \"首页\",\n      \"mock\": \"index.php\"\n    }\n  ]\n}"
  },
  {
    "path": "chameleon/src/store/actions.js",
    "content": "\nexport default {\n}\n"
  },
  {
    "path": "chameleon/src/store/getters.js",
    "content": "export default {\n}\n"
  },
  {
    "path": "chameleon/src/store/index.js",
    "content": "import actions from './actions'\nimport getters from './getters'\nimport state from './state'\nimport mutations from './mutations'\nimport createStore from \"chameleon-store\";\n\nexport default createStore({\n  actions,\n  getters,\n  state,\n  mutations\n})\n"
  },
  {
    "path": "chameleon/src/store/mutations.js",
    "content": "\nexport default {\n}\n"
  },
  {
    "path": "chameleon/src/store/state.js",
    "content": "\nconst state = {\n}\n\nexport default state\n"
  },
  {
    "path": "chatroom/chatroom.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>弹幕聊天室</title>\n<style>\n\tbody{\n        width: 100%;\n        margin: 0 auto 0;\n    }\n    #main{\n        width: 640px;\n        margin: 0 auto 0;\n        position: relative;\n        text-align: center;\n    }\n    #video-body{\n        background-color: #111;\n        overflow: hidden;\n        position: relative;\n        z-index: 1;\n        margin: 0 auto 0;\n    }\n    .active{\n        white-space :nowrap;\n        position: absolute;\n        display: inline-block;\n        animation: barrage 5s linear;\n        animation-fill-mode: forwards;\n        color: white;\n        /*-webkit-animation:barrage 5s linear 0 1 normal forwards;\n        -moz-animation:barrage 5s linear 0 1 normal forwards;\n        -o-animation: barrage 5s linear 0 1 normal forwards;*/\n        z-index: 5;\n    }\n    .tools {\n    \tpadding:2px 0;\n    }\n    .tools input{\n\t\twidth:76%;\n\t\tfont-size:14px;\n\t\tpadding:6px;\n    }\n    .tools button{\n    \twidth:20%;\n    \tpadding:6px;\n    }\n \t.info{\n \t\ttext-align: center;\n \t\tmargin-top:20px;\n \t\tfont-size:12px;\n \t}\n    @keyframes barrage{\n        0%{\n            left:100%;\n        }\n        100%{\n            left: -100%;\n        }\n    }\t\n\n    .chatroom {\n    \twidth:640px;\n    \theight:120px;\n    \toverflow:hidden;\n    \tmargin:1em auto;\n    \tposition:relative;\n    \tbackground:#fff;\n    \tborder:1px solid #ccc;\n    }\n    .chatroom h2{\n    \tfont-size:14px;\n    \tmargin:0;\n    \tpadding:5px;\n    \tbackground:#fff;\n    \tposition:relative;\n    }\n    .chatroom ol {\n    \tposition:absolute;\n    \tbottom:0;\n    \tleft:-10px;\n    \twidth:100%;\n    \theight:80px;\n    \toverflow:auto;\n    \tfont-size:12px;\n    }\n    .question, .question-dialog{\n    \tbackground-color: #111;\n    \topacity: 0.8;\n    \tfilter: alpha(opacity=0.8);\n\t    box-sizing: border-box;\n\t    padding: 0 0 3px 5px;\n\t    margin-top: -16px;\n\t    color: #FFF;\n\t    position: absolute;\n\t    bottom: 42px;\n\t    z-index: 1;\n\t    width: inherit;    \n    }\n\n    .question-dialog{\n       height: 110px;\n       z-index: 11;\n    }\n    \n    .question-title{\n\t\ttext-align: left;\n\t\tmargin: 6px 0px;\n\t\tpadding-bottom: 15px;\n    }\n\t.question-item{\n\t\tdisplay: inline-block;\n\t    width: 100px;\n\t    background: #909090;\n\t    border-radius: 13px;\n\t    margin-bottom: 10px;\n\t}\n\t.question a{\n\t\ttext-decoration: none;\n\t\tcolor: #FFF;\n\t    height: 100%;\n\t    width: 100%;\n\t    display: inline-block;\n\t}\n\t.question-countdown{\n\t\tfloat: right;\n\t\tmargin-right: 10px;\n\t}\n\t\n\t.question-bingo, .question-wrong{\n\t\tbackground-color: #FFF;\n\t}\n\t.question-bingo{\n\t\tcolor: green;\n\t}\n\t.question-wrong{\n\t\tcolor: red;\n\t}\n</style>\n</head>\n<body>\n\t<div class=\"info\">\n\t\t使用其他账号发送聊天室消息：<a href=\"https://rongcloud.github.io/websdk-demo/api-test.html\">https://rongcloud.github.io/websdk-demo/api-test.html</a>\n\t</div>\n\n\t<div id=\"main\">\n\t\t<div id=\"video-body\">\n\t\t\t<video id=\"video\" height=\"480\" width=\"640\" loop=\"true\" autoplay>\n\t\t\t\t<source id=\"vi\"  src=\"../res/heal-the-world.mp4\" type=\"video/mp4\" />\n\t\t\t\tYour browser does not support the video tag.\n\t\t\t</video>\n\t\t</div>\n\t\t\n\t\t<div class=\"question-dialog\" style=\"display: none;\">\n\t\t\t本轮结束\n\t\t</div>\n\n\t\t<div id=\"tools\" class=\"tools\">\n\t\t\t<input type=\"text\" id=\"message\" value=\"请输入消息\">\n\t\t\t<button id=\"send\" type=\"button\">发送</button>\n\t\t</div>\n\t</div>\n\n\t<!-- <div class=\"chatroom\" id=\"chatroom007\">\n\t\t<h2>聊天室 007 <em></em> （测试两个聊天室消息是否会串）</h2>\n\t\t<ol></ol>\n\t</div> -->\n\t\n</body>\n\n<script src=\"../lib/jquery-3.1.1.js\"></script>\n<script src=\"../lib/vue-2.1.4.js\"></script>\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script type=\"text/javascript\" src=\"./chatroom.js\"></script>\n\n\n<script type=\"text/javascript\">\n$(\"#tools\").hide();\n\n/*\n默认 1个用户 不能同时加入两个聊天室，需要通过工单申请客服开通\n*/\nvar appInfo = {\n\t\"appKey\" : \"8w7jv4qb78a9y\",\n\t\"token\" : \"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\"\n};\n\n//列表聊天室 id= chatRoomId-007\n/*\n(function(){\n\t// return false;\n\n\tvar chatRoomInfo = {\n\t\t\"chatRoomId\" : \"chatRoomId-007\",\n\t\t\"count\" : 20\n\t};\n\n\tRongChatRoom.init(appInfo, chatRoomInfo, {\n\t\tonSuccess: function(chatRoom) {\n\t\t\t// 加入聊天室成功。\n\t\t\tshowNewMessage(\"加入聊天室成功\");\n\n\t\t\t//聊天室发消息\n\t\t\tvar content = \"这是一条发给 chatroom 007 的消息。\"\n\t\t\tchatRoom.sendMessage(content, {\n\t\t        onSuccess: function (message) {\n\t\t\t\t\tshowNewMessage(content);\n\t\t        },\n\t\t        onError: function (errorCode,message) {\n\t\t            console.log(\"发送聊天室消息失败\", errorCode);\n\t\t        }\n\t\t    });\n\t\t},\n\t\tonError: function(error) {\n\t\t\talert('加入聊天室失败。')\n\t\t\t// 加入聊天室失败\n\t\t},\n\t\tonMessage : function(message){\n\t\t\t// console.log(\"007\");\n\t\t\t// console.log(message);\n\t\t\tshowNewMessage(\"chatroomId: \" + message.targetId + \",  messageUId: \" + message.messageUId);\n\t\t}\n\t});\n\n\tfunction showNewMessage(content){\n\t\t$(\"#chatroom007 ol\").append(\"<li>\" + content + \"</li>\");\n\t}\n})();\n*/\n\nvar utils = {\n\ttemplateRender: function(template, data) {\n\t    template = template || \"\";\n\t    data = data || [\"\"];\n\t    var re = /{%((?:(?!%}).)+)%}/g, reExp = /(^( )?(var|if|for|else|switch|case|default|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n\t    var add = function(line, js) {\n\t        js? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n\t            (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n\t        return add;\n\t    }\n\t    var match;\n\t    while(match = re.exec(template)) {\n\t        add(template.slice(cursor, match.index))(match[1], true);\n\t        cursor = match.index + match[0].length;\n\t    }\n\t    add(template.substr(cursor, template.length - cursor));\n\t    code += 'return r.join(\"\");';\n\t    data = isNaN(data.length) ? [data] : data;\n\t    var html = \"\";\n\t    for(var i = 0, length = data.length; i < length; i++) {\n\t        html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n\t    }\n\t    return html;    \n\t}\n};\n\nfunction registerMessage(type,propertys){\n\tvar messageName = type; // 消息名称。\n\tvar objectName = \"s:\" + type; // 消息内置名称，请按照此格式命名 *:* 。\n\tvar mesasgeTag = new RongIMLib.MessageTag(true,true); //true true 保存且计数，false false 不保存不计数。\n\n\tRongIMClient.registerMessageType(messageName,objectName,mesasgeTag,propertys);\n}\n\n//弹幕聊天室 id= chatRoomId-008\n\n(function(){\n\tvar chatRoomInfo = {\n\t\t\"chatRoomId\" : \"chatRoomId-008\",\n\t\t\"count\" : 20\n\t};\n\n\tRongChatRoom.init(appInfo, chatRoomInfo, {\n\t\tonSuccess: function(chatRoom) {\n\t\t\t//注册自定义消息\n\t\t\tvar propertys = [\"title\",\"submitAPI\",\"questions\"]; // 消息类中的属性名。\n\t\t\tregisterMessage(\"QA\",propertys);\n\n\t\t\t// 加入聊天室成功。\n\t\t\tconsole.log(\"加入聊天室成功\");\n\t\t\tconsole.log(chatRoom);\n\t\t\t$(\"#message\").val('加入聊天室成功，当前用户：' + chatRoom.currentUser.userId);\n\n\t\t\t//调用示例\n\t\t\tapiDemo(chatRoom);\n\t\t},\n\t\tonError: function(error) {\n\t\t\talert('加入聊天室失败。')\n\t\t\t// 加入聊天室失败\n\t\t},\n\t\tonMessage : function(message){\n\t\t\tif(message.objectName == \"s:QA\" && !message.offLineMessage){\n\t\t\t\tqaLive(message.content)\n\t\t\t}\n\t\t\tupdateDanmu(message.content.content);\n\t\t}\n\t});\n})();\n\nvar qaTpl = [\n\t'<div class=\"question\">',\n\t\t'<div class=\"question-countdown\">',\n\t\t\t'倒计时: <span id=\"countdown\">10</span>s',\n\t\t'</div>',\n\t\t'<dl>',\n\t\t\t'<dt class=\"question-title\">',\n\t\t\t\t'{% this.question %}',\n\t\t\t\t'{% for(var i=0; i < this.answers.length; i++){ %}',\n\t\t\t\t\t'<dd class=\"question-item\" id=\"answer-{% this.answers[i].id %}\">',\n\t\t\t\t\t\t'<a href=\"#\" onclick=submitAnswer({%this.answers[i].id%},\"{%this.submitAPI%}\",\"{%this.answers[i].bingo%}\")>{% this.answers[i].answer %}</a>',\n\t\t\t\t\t'</dd>',\n\t\t\t\t'{% } %}',\n\t\t\t'</dt>',\n\t\t'</dl>',\n\t'</div>',\n].join('');\n\nvar qaDialog = $('.question-dialog');\nfunction QAdialogOperator(isHide){\n\tvar type = 'block';\n\tif (isHide) {\n\t\ttype = 'none';\n\t}\n\tqaDialog.css('display', type);\n}\n\nvar interval = 0;\n\nfunction startCount(){\n\tinterval = setInterval(function(){\n\t\tvar counter = $('#countdown');\n\t\tvar count = counter.html();\n\t\tif (count > 0) {\n\t\t\t counter.html(count - 1);\n\t\t}else{\n\t\t\tstopCount();\n\t\t\tQAdialogOperator();\n\t\t}\n\t}, 1000);\n}\n\nfunction stopCount(){\n\tclearInterval(interval);\n}\n\nfunction submitAnswer(id, submitAPI, bingo){\n\tconsole.log(submitAPI);\n\t\n\tstopCount();\n\n\tvar isBingo = false;\n\tif (id == bingo) {\n\t\tisBingo = true;\n\t}\n\t// todo: post ajax submitAPI\n\tvar tpl = '#answer-{%this.id%}';\n\tid = utils.templateRender(tpl, {\n\t\tid: id\n\t});\n\n\t\n\tvar node = $(id);\n\tvar siblings = node.siblings();\n\tsiblings.find('a').css('pointerEvents', 'none');\n\n\tif (isBingo) {\n\t\tnode.addClass('question-bingo');\n\t\tnode.html('正确');\n\t}\n\n\tif (!isBingo) {\n\t\tnode.addClass('question-wrong');\n\t\tnode.html('答错了');\n\t}\n\t\n}\n\nfunction qaLive(content){\n\tconsole.log(content)\n\n\tstopCount();\n\tvar questions = JSON.parse(content.questions);\n\t// 暂时处理单个问答\n\tvar question = questions[0];\n\tquestion.submitAPI = content.submitAPI;\n\tvar qaNode = utils.templateRender(qaTpl, question);\n\n\t$('.question').remove();\n\n\tvar main = $('#main');\n\t$('#main').append(qaNode);\n\tQAdialogOperator(true);\n\tstartCount();\n}\n\n/*\n发送消息按钮，点击发送将push input框消息到服务器端，并清空input框。\n此处targetId为聊天室Id，勿和用户id混淆。\n*/\nfunction apiDemo(chatRoom){\n\t$(\"#tools\").show();\n\t//点击发送消息\n\t$(\"#send\").click(function(){\n\t\tvar content = $(\"#message\").val();\n\t\t\tcontent = '<div style=\"color:red;background:#333;padding:5px;\">' + content + '</div>';\n\t\tchatRoom.sendMessage({\"content\" : content}, {\n\t        onSuccess: function (message) {\n\t            console.log(\"发送聊天室消息成功\");\n\t            updateDanmu(content);\n\t        },\n\t        onError: function (errorCode,message) {\n\t            console.log(\"发送聊天室消息失败\",errorCode);\n\t        }\n\t    });\n\t});\n\n\t//循环发消息\n\tvar sends = setInterval(function(){\n\t\tvar content = {\n\t\t\tcontent: getRandomText()\n\t\t};\n\n\t\t//聊天室发消息\n\t\tchatRoom.sendMessage(content, {\n\t        onSuccess: function (message) {\n\t\t\t\tupdateDanmu(chatRoom.id + \": \" + message.content.content);\n\t        },\n\t        onError: function (errorCode,message) {\n\t            console.log(\"发送聊天室消息失败\", errorCode);\n\t        }\n\t    });\n    },2000);\n\t\n\t//聊天室信息\n\tchatRoom.getInfo({\n\t\t\torder : RongIMLib.GetChatRoomType.REVERSE, // 排序方式。\n\t\t\tmemberCount : 10 // 0 - 20\n\t\t},{\n\t\tonSuccess : function(chatRoomInfo){\n\t\t\tconsole.log(\"获取聊天室信息成功\");\n\t\t\tconsole.log(chatRoomInfo);\n\t\t},\n\t\tonError : function(error){\n\n\t\t}\n\t});\n\n    //聊天室退出\n    /*\n    chatRoom.quit({\n\t\tonSuccess : function(){\n\t\t\tconsole.log(\"退出成功\")\n\t\t},\n\t\tonError : function(error){\n\t\t\tconsole.log(\"退出失败\", error)\n\t\t}\n\t});\n\t*/\n}\n\n/*\n发送弹幕方法\n*/\nfunction updateDanmu(message){\n\t//弹幕高度随机\n\tvar margintop = Math.random()*160 + Math.random()*160;\n\t\tmargintop = Math.ceil(margintop);\n\t$(\"#video-body\").append(\"<div class='active' style='top:\"+margintop+\"px;'>\"+message+\"</div>\");\n}\n\nfunction getRandomText(){\n\tvar messages = \"琵琶行，白居易，浔阳江头夜送客，枫叶荻花秋瑟瑟。主人下马客在船，举酒欲饮无管弦。醉不成欢惨将别，别时茫茫江浸月。忽闻水上琵琶声，主人忘归客不发。寻声暗问弹者谁？琵琶声停欲语迟。移船相近邀相见，添酒回灯重开宴。千呼万唤始出来，犹抱琵琶半遮面。转轴拨弦三两声，未成曲调先有情。弦弦掩抑声声思，似诉平生不得志。低眉信手续续弹，说尽心中无限事。轻拢慢捻抹复挑，初为霓裳后六幺。大弦嘈嘈如急雨，小弦切切如私语。嘈嘈切切错杂弹，大珠小珠落玉盘。间关莺语花底滑，幽咽泉流冰下难。冰泉冷涩弦凝绝，凝绝不通声渐歇。别有幽愁暗恨生，此时无声胜有声。银瓶乍破水浆迸，铁骑突出刀枪鸣。曲终收拨当心画，四弦一声如裂帛。东船西舫悄无言，惟见江心秋月白。沉吟放拨插弦中，整顿衣裳起敛容。自言本是京城女，家在虾蟆陵下住。十三学得琵琶成，名属教坊第一部。曲罢曾教善才服，妆成每被秋娘妒。武陵年少争缠头，一曲红绡不知数。钿头银篦击节碎，血色罗裙翻酒污。今年欢笑复明年，秋月春风等闲度。弟走从军阿姨死，暮去朝来颜色故。门前冷落车马稀，老大嫁作商人妇。商人重利轻别离，前月浮梁买茶去。去来江口求空船，绕船月明江水寒。夜深忽梦少年事，梦啼红妆泪阑干。我闻琵琶已叹息，又闻此语重唧唧。同是天涯沦落人，相逢何必曾相识。我从去岁辞帝京，谪居卧病浔阳城。浔阳地僻无音乐，终岁不闻丝竹声。住近湓城地低湿，黄芦苦竹绕宅生。其间旦暮闻何物？杜鹃啼血猿哀鸣。春江花朝秋月夜，往往取酒还独倾。岂无山歌与村笛？呕哑嘲哳难为听。今夜闻君琵琶语，如听仙乐耳暂明。莫辞更坐弹一曲，为君翻作琵琶行。感我此言良久立，却坐促弦弦转急。凄凄不似向前声，满座重闻皆掩泣。座中泣下谁最多？江州司马青衫湿\";\n\n\t//将字符串拆分成数组\n\t// messages = messages.split(\"。\");\n\tmessages = messages.split(/，|。|？/);\n\n\tvar len = messages.length;\n\tvar index = Math.ceil(Math.random()*1000000)%len;\n\n\t// console.log(messages[index]);\n\treturn messages[index];\n}\n</script>\n\n</html>"
  },
  {
    "path": "chatroom/chatroom.js",
    "content": "//基于 Web IM SDK 封装的聊天室中间层示例\n;(function (global, factory, namespace) {\n    if(typeof exports === 'object' && typeof module !== 'undefined'){\n    \tmodule.exports = factory();\n    }else if(typeof define === 'function' && define.amd){\n    \tdefine(factory);\n    }else{\n    \tglobal[namespace] = factory();\n    }\n})(window, function(){\n\t\"use strict\";\n\n\tfunction initApp(appInfo, callbacks, modules){\t\n\t\twindow.RongIM = window.RongIM || {};\n\n\t\t//缓存消息回调队列\n\t\twindow.onMessageList = window.onMessageList || [];\n\t\twindow.onMessageList.push(callbacks.onMessage);\n\n\t\t//缓存状态队列\n\t\twindow.onConnectList = window.onConnectList || [];\n\t\twindow.onConnectList.push(callbacks.onConnected);\n\n\t\tmodules = modules || {};\n\t\tvar RongIMLib = modules.RongIMLib || window.RongIMLib;\n\t\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\t\tif(RongIM.ready){\n\t\t\tcallbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t\tcallbacks.onConnected && callbacks.onConnected(RongIM.instance, RongIM.userInfo);\n\t\t\treturn;\n\t\t}else{\n\t\t\tvar appKey = appInfo.appKey;\n\t\t\tvar token = appInfo.token;\n\t\t\tvar navi = appInfo.navi || \"\";\n\n\t\t\tvar protobuf = modules.protobuf || null;\n\n\t\t\tvar config = {};\n\n\t\t\t//私有云\n\t\t\tif(navi !== \"\"){\n\t\t\t\tconfig.navi = navi;\n\t\t\t}\n\n\t\t\t//support protobuf url + module\n\t\t\tif(protobuf != null){\n\t\t\t\tconfig.protobuf = protobuf;\n\t\t\t};\n\n\t\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\n\t\t\t//开始链接\n\t\t\tRongIMClient.connect(token, {\n\t\t\t\tonSuccess: function(userId) {\n\t\t\t\t\tRongIM.ready = true;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata : {userId: userId},\n\t\t\t\t\t\tstatus : \"ok\",\n\t\t\t\t\t\tinfo : \"链接成功\"\n\t\t\t\t\t};\n\n\t\t\t\t\tfor(var i = 0, len = onConnectList.length; i<len; i++){\n\t\t            \tonConnectList[i](RongIM.instance, RongIM.userInfo);\n\t\t            }\n\t\t\t\t},\n\t\t\t\tonTokenIncorrect: function() {\n\t\t\t\t\t// console.log('token无效');\n\t\t\t\t\tRongIM.ready = false;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata : {},\n\t\t\t\t\t\tstatus : \"fail\",\n\t\t\t\t\t\tinfo : \"token无效\"\n\t\t\t\t\t};\n\n\t\t\t\t\tfor(var i = 0, len = onConnectList.length; i<len; i++){\n\t\t            \tonConnectList[i](RongIM.instance, RongIM.userInfo);\n\t\t            }\n\t\t\t\t},\n\t\t\t\tonError:function(errorCode){\n\t\t\t\t\t// console.log(\"connect error\");\n\t\t\t\t\t// console.log(errorCode);\n\n\t\t\t\t\tRongIM.ready = false;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata : {},\n\t\t\t\t\t\tstatus : \"fail\",\n\t\t\t\t\t\tinfo : errorCode\n\t\t\t\t\t};\n\n\t\t\t\t\tfor(var i = 0, len = onConnectList.length; i<len; i++){\n\t\t            \tonConnectList[i](RongIM.instance, RongIM.userInfo);\n\t\t            }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// 连接状态监听器\n\t\tRongIMClient.setConnectionStatusListener({\n\t\t\tonChanged: function (status) {\n\t\t\t\t// console.log(status);\n\t\t\t    switch (status) {\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t        \tRongIM.instance = RongIMClient.getInstance();\n\t\t\t            callbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t\t            break;\n\t\t\t        }\n\t\t\t}\n\t\t});\n\n\t\tRongIMClient.setOnReceiveMessageListener({\n\t\t\t// 接收到的消息\n\t\t\tonReceived: function (message) {\n\t\t\t    // 判断消息类型\n\t\t\t    // console.log(\"新消息: \" + message.targetId);\n\t            // console.log(message);\n\t            for(var i = 0, len = onMessageList.length; i<len; i++){\n\t            \tonMessageList[i](message);\n\t            }\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction initChatRoom(appInfo, chatRoomInfo, callbacks, modules){\n\t\tvar chatRoomId = chatRoomInfo.chatRoomId;\n\t\tvar count = chatRoomInfo.count;\n\n\t\twindow.chatRoomCallbacks = {};\n\n\t\t//公有云初始化\n\t\tvar config = {\n\t        //protobuf: 'https://cdn.ronghub.com/protobuf-2.3.1.min.js' //支持http(s)网络路径、本地相对路径\n\t    };\n\n\t\tvar initCallbacks = {\n\t\t\tonReady : function(_instance){\n\t\t\t\t// alert(_instance)\n\t\t\t\t// IM = _instance;\n\t\t\t},\n\t\t\tonMessage : function(message){\n\t\t\t\t// 判断消息类型\n\n\t            // console.log(\"messageUId:\" + message.messageUId + \",   messageId:\" + message.messageId);\n\t            // console.log(message);\n\t            var onMessage = callbacks.onMessage;\n            \tif (message.conversationType == 4 && message.targetId == chatRoomId) {\n\t            \tonMessage(message);\n\t            }\n\t\t\t},\n\t\t\tonConnected : function(IM, userInfo){\n\t\t\t\t//链接成功\n\t\t\t\tIM.joinChatRoom(chatRoomId, count, {\n\t\t\t\t\tonSuccess: function() {\n\t\t\t\t\t\tvar chatRoom = {\n\t\t\t\t\t\t\tid : chatRoomId,\n\t\t\t\t\t\t\tcurrentUser : userInfo.data,\n\t\t\t\t\t\t\tgetInfo : function (params,callbacks){\n\t\t\t\t\t\t\t\tvar order = params.order; //RongIMLib.GetChatRoomType.REVERSE;// 排序方式。\n\t\t\t\t\t\t\t\tvar memberCount = params.memberCount; // 获取聊天室人数 （范围 0-20 ）\n\n\t\t\t\t\t\t\t\tIM.getChatRoomInfo(chatRoomId, memberCount, order,callbacks);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tquit : function(callbacks){\n\t\t\t\t\t\t\t\tIM.quitChatRoom(chatRoomId, callbacks);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsendMessage : function(content, callbacks){\n\t\t\t\t\t\t\t\tvar conversationType = RongIMLib.ConversationType.CHATROOM;\n\t\t\t\t\t\t\t\tvar msg = new RongIMLib.TextMessage(content);\n\n\t\t\t\t\t\t\t\tIM.sendMessage(conversationType, chatRoomId, msg, callbacks);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t            callbacks.onSuccess && callbacks.onSuccess(chatRoom);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error) {\n\t\t\t            callbacks.onError && callbacks.onError(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tinitApp(appInfo, initCallbacks, config);\n\t}\n\n\treturn {\n\t\tinit : initChatRoom\n\t};\n}, \"RongChatRoom\");"
  },
  {
    "path": "chatroom/chatroom.sdk.js",
    "content": "function render(data, template) {\n    template = template || \"\";\n    data = data || [\"\"];\n    var re = /{{((?:(?!}}).)+)}}/g, reExp = /(^( )?(var|if|for|else|switch|case|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n    var add = function(line, js) {\n        js? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n            (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n        return add;\n    }\n    var match;\n    while(match = re.exec(template)) {\n        add(template.slice(cursor, match.index))(match[1], true);\n        cursor = match.index + match[0].length;\n    }\n    add(template.substr(cursor, template.length - cursor));\n    code += 'return r.join(\"\");';\n\n    data = isNaN(data.length) ? [data] : data;\n    var html = \"\";\n    for(var i = 0, length = data.length; i < length; i++) {\n        html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n    }\n    return html;    \n}\n\nfunction renderUI(data,tpl){\n    var _tpl = ['<div class=\"rc-message\" _userId={{this.content.user.id}}>',\n                '    <div class=\"rc-message-portrait\"><img src=\"{{this.content.user.portrait}}\"></div>',\n                '    <div class=\"rc-message-name\">{{this.content.user.name}}</div>',\n                '    <div class=\"rc-message-time\">{{this.sentTime}}</div>',\n                '    <div class=\"rc-message-content\">{{this.content.content}}</div>',\n                '</div>'].join(\"\");\n    tpl = tpl || _tpl;\n                \n    return render(data, tpl);  \n}\n\nfunction sendMessage(message,callback){\n    //send ok\n    callback(message);\n}"
  },
  {
    "path": "chatroom/demo.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>chatroom component</title>\n</head>\n<body>\n\n\n<style>\n.rc-chatroom *{\n\tmargin:0;\n\tpadding:0;\n\tlist-style:none;\n}\t\n.rc-chatroom {\n\twidth:400px;\n\tborder:1px solid #ccc;\n\tborder-radius:3px;\n}\n.rc-message-list-wrapper{\n\twidth:100%;\n\theight:600px;\n\toverflow:auto;\t\n\tposition:relative;\n}\n.rc-message-list{\n\twidth:100%;\n\tposition:absolute;\n\tbottom:0;\n\tleft:0;\n}\n.rc-message{\n\tclear:both;\n\tfont-size:14px;\n\tline-height:1.5;\n\tborder-bottom:1px solid #f5f5f5;\n\tpadding-bottom:10px;\n\tmargin:5px;\n\tvertical-align:top;\n}\n.rc-message-portrait{\n\tdisplay:inline-block;\n\tfloat:left;\n\tmargin:5px;\n}\n.rc-message-portrait img{\n\twidth:40px;\n\theight:40px;\n\tborder:1px solid #ccc;\n\tborder-radius:50%;\n}\n.rc-message-time,\n.rc-message-name{\n\tdisplay:inline-block;\n\tmargin-left:0.5em;\n\tmargin-top:0.5em;\n}\n.rc-message-content{\n\tmargin-left:4.2em;\n}\n\n.rc-chatroom-user{\n\theight:30px;\n\tpadding:5px;\n\tpadding-bottom:10px;\n\tposition:relative;\n}\n.rc-emoji-panel{\n\tdisplay:none;\n\twidth:19em;\n\tborder:1px solid #ccc;\n\tpadding:10px;\n\tbackground:#f5f5f5;\n\tposition:absolute;\n\tleft:3px;\n\tbottom:40px;\n}\n.rc-chatroom-emoji{\n\tline-height:30px;\n\tfont-size:24px;\n\tcursor:pointer;\n}\n.rc-chatroom-input{\n\twidth:72%;\n\theight:24px;\n\tpadding:2px;\n\tborder:1px solid #ccc;\n\tbackground:#f5f5f5;\n}\n.rc-chatroom-button{\n\tbackground:#333;\n\tcolor:#fff;\n\tborder-radius:3px;\n\tpadding:6px 20px;\n}\n</style>\n\n<div id=\"show\">\n\t<div class=\"rc-chatroom\">\n\t\t<div class=\"rc-message-list-wrapper\">\n\t\t\t<div class=\"rc-message-list\" id=\"rc-message-list\"></div>\n\t\t</div>\n\n\t\t<div class=\"rc-chatroom-user\">\n\t\t\t<span class=\"rc-chatroom-emoji\" id=\"rc-chatroom-emoji\">😄</span>\n\t\t\t<div class=\"rc-emoji-panel\" id=\"rc-emoji-panel\"></div>\n\t\t\t<input class=\"rc-chatroom-input\" id=\"rc-chatroom-input\" type=\"text\" placeholder=\"发表你的精彩评论\">\n\t\t\t<input class=\"rc-chatroom-button\" id=\"rc-chatroom-button\" type=\"submit\" value=\"发送\">\n\t\t</div>\n\t</div>\n</div>\n<script src=\"//cdn.ronghub.com/RongEmoji-2.2.6.js\"></script> \n<script src=\"chatroom.sdk.js\"></script>\t\n<script>\n//mock\nfunction getRandomText(){\n\tvar messages = \"琵琶行，白居易，浔阳江头夜送客，枫叶荻花秋瑟瑟。主人下马客在船，举酒欲饮无管弦。醉不成欢惨将别，别时茫茫江浸月。忽闻水上琵琶声，主人忘归客不发。寻声暗问弹者谁？琵琶声停欲语迟。移船相近邀相见，添酒回灯重开宴。千呼万唤始出来，犹抱琵琶半遮面。转轴拨弦三两声，未成曲调先有情。弦弦掩抑声声思，似诉平生不得志。低眉信手续续弹，说尽心中无限事。轻拢慢捻抹复挑，初为霓裳后六幺。大弦嘈嘈如急雨，小弦切切如私语。嘈嘈切切错杂弹，大珠小珠落玉盘。间关莺语花底滑，幽咽泉流冰下难。冰泉冷涩弦凝绝，凝绝不通声渐歇。别有幽愁暗恨生，此时无声胜有声。银瓶乍破水浆迸，铁骑突出刀枪鸣。曲终收拨当心画，四弦一声如裂帛。东船西舫悄无言，惟见江心秋月白。沉吟放拨插弦中，整顿衣裳起敛容。自言本是京城女，家在虾蟆陵下住。十三学得琵琶成，名属教坊第一部。曲罢曾教善才服，妆成每被秋娘妒。武陵年少争缠头，一曲红绡不知数。钿头银篦击节碎，血色罗裙翻酒污。今年欢笑复明年，秋月春风等闲度。弟走从军阿姨死，暮去朝来颜色故。门前冷落车马稀，老大嫁作商人妇。商人重利轻别离，前月浮梁买茶去。去来江口求空船，绕船月明江水寒。夜深忽梦少年事，梦啼红妆泪阑干。我闻琵琶已叹息，又闻此语重唧唧。同是天涯沦落人，相逢何必曾相识。我从去岁辞帝京，谪居卧病浔阳城。浔阳地僻无音乐，终岁不闻丝竹声。住近湓城地低湿，黄芦苦竹绕宅生。其间旦暮闻何物？杜鹃啼血猿哀鸣。春江花朝秋月夜，往往取酒还独倾。岂无山歌与村笛？呕哑嘲哳难为听。今夜闻君琵琶语，如听仙乐耳暂明。莫辞更坐弹一曲，为君翻作琵琶行。感我此言良久立，却坐促弦弦转急。凄凄不似向前声，满座重闻皆掩泣。座中泣下谁最多？江州司马青衫湿\";\n\n\t//将字符串拆分成数组\n\t// messages = messages.split(\"。\");\n\tmessages = messages.split(/，|。|？/);\n\n\tvar len = messages.length;\n\tvar index = Math.ceil(Math.random()*1000000)%len;\n\n\t// console.log(messages[index]);\n\treturn messages[index];\n}\t\n\nfunction getUserInfo(){\n\tvar id = Math.ceil(Math.random()*1000)%99;\n\tvar name = \"用户\" + id;\n\tvar url = \"http://www.oneplusbbs.com/uc_server/images/noavatar_small.gif?\" + id;\n\treturn {\n\t\tportrait : url,\n\t\tname : name,\n\t\tid : \"u-\" + id\n\t};\n}\n</script>\n<script>\n(function(){\n\t//emoji表情\n\tvar RongIMEmoji = RongIMLib.RongIMEmoji;\n\tRongIMEmoji.init();\n\n\tvar panel = document.getElementById(\"rc-emoji-panel\");\n\tvar panelBtn = document.getElementById(\"rc-chatroom-emoji\");\n\tvar input = document.getElementById(\"rc-chatroom-input\");\n\tvar btn = document.getElementById(\"rc-chatroom-button\");\n\n\tvar emojis = RongIMEmoji.list;\n    for (var i = 0; i < 24; i++) {\n        var value = RongIMEmoji.list[i];\n        panel.appendChild(value.node);\n    }\n\n\tpanelBtn.onclick = function(){\n\t\tif(panel.style.display == \"block\"){\n\t\t\tpanel.style.display = \"none\";\n\t\t}else{\n    \t\tpanel.style.display = \"block\";\n    \t}\n    };\n\n    //表情选择\n    panel.onclick = function(event){\n        var e = event || window.event;\n        var target = e.target || e.srcElement;\n        if (document.all && !document.addEventListener === false) {\n            console.log(target);\n        }\n        input.value += RongIMEmoji.symbolToEmoji(target.getAttribute(\"name\"));\n    }\n\n    //发送消息\n\tbtn.onclick = function(){\n\t\tvar content = input.value;\n\t\t\tnewMessage.content.content = content;\n\n\t\tpanel.style.display = \"none\";\n\t\tinput.value = \"\";\n\t\tsendMessage(newMessage,function(message){\n\t\t\tupdateMessage(message);\n\t\t});\n\t}\n\n\t//接收消息并更新ui\n\tvar newMessage = {\n\t\t\"content\": {\n\t\t\t\"messageName\": \"TextMessage\",\n\t\t\t\"user\": getUserInfo()\n\t\t},\n\t\t\"conversationType\": 1,\n\t\t\"objectName\": \"RC:TxtMsg\",\n\t\t\"senderUserId\": \"user10\",\n\t\t\"sentTime\": 1522401683566,\n\t\t\"targetId\": \"user10\",\n\t\t\"messageType\": \"TextMessage\",\n\t\t\"messageUId\": \"B2EO-R2GR-MUA6-D3EE\"\n\t};\n\n\tvar times = 1;\n\tvar add = setInterval(function(){\n\t\tif(times >= 20){\n\t\t\tclearInterval(add);\n\t\t}\n\t\t\n\t\tnewMessage.content.content = getRandomText();\n\t\ttimes += 1;\n\n\t\tupdateMessage(newMessage);\n\t},1000);\n\n\tfunction updateMessage(message){\n\t\tvar t = document.getElementById(\"rc-message-list\");\n\t\tmessage.content.content = RongIMEmoji.symbolToEmoji(message.content.content);\n\t\tvar html = renderUI(message);\n\t\t\tt.innerHTML += html;\n\t}\n})();\n</script>\n</body>\n</html>"
  },
  {
    "path": "chatroom-h5/README.md",
    "content": "## 实现功能\nDemo 中实现了集成 2.x SDK 实现聊天室功能，实现聊天室内发送消息，点赞等功能。\n\n## Demo 启动\n可使用 nginx 代理静态页面。\n\n**访问地址**\n\nhttp://localhost:8080/test/chatroom-demo/demo.html?id=11\n\nhttp://localhost:8080/test/chatroom-demo/demo.html?id=22\n\n## Demo 数据修改说明\n\nDemo 使用了假数据进行测试，Demo 访问前需要您替换成您的相关信息。\n\n操作文件：mock.js\n修改位置如下：\n```js\nconst appInfo = {\n  \"appKey\": \"\",\n  \"22\": \"\",\n  \"11\": \"\"\n};\n```\n"
  },
  {
    "path": "chatroom-h5/demo.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\t<meta charset=\"UTF-8\">\n\t<title>挖财钱堂学院理财小白训练</title>\n\t<meta name=\"screen-orientation\" content=\"portrait\">\n\t<meta name=\"x5-orientation\" content=\"portrait\">\n\t<link rel=\"stylesheet\" href=\"./style/chatroom.css\">\n\n\t<meta name=\"viewport\" id=\"viewport\" content=\"width=device-width, initial-scale=0.5, maximum-scale=0.5\">\n</head>\n\n<body>\n\t<div id='view'>\n\t\t<div class=\"rc-main\">\n\t\t\t<div class=\"rc-video-body\"></div>\n\t\t</div>\n\n\t\t<div class=\"rc-chat\">\n\t\t\t<div class=\"rc-chat-main\">\n\t\t\t\t<img class=\"rc-chat-img\" src=\"./style/img/logo.png\">\n\t\t\t\t<div class=\"rc-chat-info\">\n\t\t\t\t\t<span class=\"rc-chat-name\">[直播回顾]</span>\n\t\t\t\t\t<span class=\"rc-chat-num\"><span class=\"rc-content-color\">4208</span> 人次</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"rc-user-join\" id=\"rc-user-join\"></div>\n\t\t<div class=\"rc-chatroom\">\n\t\t\t<div class=\"rc-message-list-wrapper\" id=\"rc-message-list-wrapper\">\n\t\t\t\t<div class=\"rc-message-list\" id=\"rc-message-list\"></div>\n\t\t\t</div>\n\n\t\t\t<div class=\"rc-chatroom-user\">\n\t\t\t\t<!-- <span class=\"rc-chatroom-emoji\" id=\"rc-chatroom-emoji\">😄</span> -->\n\t\t\t\t<div class=\"rc-emoji-panel\" id=\"rc-emoji-panel\"></div>\n\t\t\t\t<div>\n\t\t\t\t\t<input class=\"rc-chatroom-input\" id=\"rc-chatroom-input\" type=\"search\" placeholder=\"说点什么...\"\n\t\t\t\t\t\tonfocus=\"onFocus()\" onblur=\"onBlur()\">\n\t\t\t\t\t<img class=\"rc-send\" id='send' src=\"./style/img/send.png\" alt=\"\" onclick=\"send()\">\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t\t<div class=\"rc-liker\">\n\t\t\t\t<canvas class=\"rc-hearts-canvas\"></canvas>\n\t\t\t\t<button class=\"rc-hearts-btn\" onclick=\"clicLiker()\"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t</div>\n\t<script src=\"./js/RongIMLib-2.5.12.js\"></script>\n\t<!-- <script src=\"//cdn.ronghub.com/RongEmoji-2.2.6.js\"></script> -->\n\t<script src=\"./js/chatroom.js\"></script>\n\t<script src=\"./js/like.js\"></script>\n\t<script src=\"./js/render.js\"></script>\n\t<script src=\"./js/mock.js\"></script>\n\t<script src=\"./js/demo.js\"></script>\n\n</body>\n\n<!-- <script src=\"//bb.img.qq.com/bbcdn/common/vconsole.min.js\"></script>\n<script>\n\tvar vConsole = new VConsole();\n</script> -->\n\n</html>"
  },
  {
    "path": "chatroom-h5/js/RongIMLib-2.5.12.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n    Release Date: Fri Sep 18 2020 10:08:16 GMT+0800 (China Standard Time)\n    CodeVersion: 01fe5ba055933bb524b77ed6f348d712dc875e96\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n// console.warn('SDK VERSION:', '01fe5ba055933bb524b77ed6f348d712dc875e96')\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.setExtraContent = function(b){\n                a.extraContent = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.setExtraContent = function (b) {\n                a.extraContent = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 1] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 2] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * JSON 后的消息体超限, 目前最大 128kb\n         * */\n        ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n    (function (TimeoutEnum) {\n        TimeoutEnum[TimeoutEnum[\"CMP\"] = 10000] = \"CMP\";\n    })(RongIMLib.TimeoutEnum || (RongIMLib.TimeoutEnum = {}));\n    var TimeoutEnum = RongIMLib.TimeoutEnum;\n    (function (MessageExpansionErrorCode) {\n        MessageExpansionErrorCode[MessageExpansionErrorCode[\"NOT_SUPPORT\"] = 34008] = \"NOT_SUPPORT\";\n        MessageExpansionErrorCode[MessageExpansionErrorCode[\"SEND_MESSAGE_KV_FAIL\"] = 34009] = \"SEND_MESSAGE_KV_FAIL\";\n        MessageExpansionErrorCode[MessageExpansionErrorCode[\"EXPANSION_LIMIT_EXCEET\"] = 34010] = \"EXPANSION_LIMIT_EXCEET\";\n    })(RongIMLib.MessageExpansionErrorCode || (RongIMLib.MessageExpansionErrorCode = {}));\n    var MessageExpansionErrorCode = RongIMLib.MessageExpansionErrorCode;\n    (function (MsgEpansionLength) {\n        MsgEpansionLength[MsgEpansionLength[\"TOTAL\"] = 300] = \"TOTAL\";\n        MsgEpansionLength[MsgEpansionLength[\"MSG\"] = 20] = \"MSG\";\n        MsgEpansionLength[MsgEpansionLength[\"KEY\"] = 32] = \"KEY\";\n        MsgEpansionLength[MsgEpansionLength[\"VALUE\"] = 64] = \"VALUE\"; // 扩展 value 长度限制\n    })(RongIMLib.MsgEpansionLength || (RongIMLib.MsgEpansionLength = {}));\n    var MsgEpansionLength = RongIMLib.MsgEpansionLength;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            RongIMClient.settingListeners = [];\n            RongIMClient.conversationStatusListeners = [];\n            RongIMClient.messageExpansionListenerUpdated = [];\n            RongIMClient.messageExpansionListenerDeleted = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.4.0.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                isFullConversations: false,\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {},\n                networkUnavailable: false,\n                loggerSwitch: options.loggerSwitch || 'on',\n                autoReconnectTimer: null,\n                cmpTimeoutTimer: null\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ReferenceMessage: { objectName: \"RC:ReferenceMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GIFMessage: { objectName: \"RC:GIFMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                SightMessage: { objectName: \"RC:SightMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                LogCommandMessage: { objectName: 'RC:LogCmdMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                ExpansionCommandMessage: { objectName: \"RC:MsgExMsg\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                ReferenceMessage: \"ReferenceMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                GIFMessage: 'GIFMessage',\n                SightMessage: 'SightMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage',\n                LogCommandMessage: 'LogCommandMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    appKey: appKey\n                } });\n            return sdkInfo;\n        };\n        ;\n        RongIMClient.setProtocol = function (protocol) {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var HttpProtocol = RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMClient.WsProtocol;\n            if (protocol === HttpProtocol.http) {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.http;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.ws;\n            }\n            else {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.https;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.wss;\n            }\n        };\n        RongIMClient.getProtocol = function () {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var depend = RongIMClient._memoryStore.depend;\n            var protocol = depend.protocol, wsScheme = depend.wsScheme;\n            if (!protocol || !wsScheme) {\n                protocol = RongIMClient.HttpProtocol.https;\n                wsScheme = RongIMClient.WsProtocol.wss;\n            }\n            return {\n                protocol: protocol,\n                wsScheme: wsScheme\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            if (RongIMLib.IMHandler.isIncludeNavi(token)) {\n                var protocol = RongIMClient._memoryStore.depend.protocol;\n                var currentNavs = RongIMClient._memoryStore.depend.navigaters;\n                var navList = RongIMLib.IMHandler.getNavsByToken(token, protocol);\n                token = RongIMLib.IMHandler.getToken(token);\n                RongIMClient._memoryStore.depend.navigaters = RongIMLib.RongUtil.concat(navList, currentNavs, true);\n            }\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.setConversationStatusListener = function (listener) {\n            if (listener && listener.onChanged && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.conversationStatusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.setMessageExpansionListener = function (listener) {\n            if (listener && listener.onUpdated && RongIMLib.RongUtil.isFunction(listener.onUpdated)) {\n                RongIMClient.messageExpansionListenerUpdated.push(listener.onUpdated);\n            }\n            if (listener && listener.onDeleted && RongIMLib.RongUtil.isFunction(listener.onDeleted)) {\n                RongIMClient.messageExpansionListenerDeleted.push(listener.onDeleted);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        RongIMClient.watch = function (watchers) {\n            watchers = watchers || {};\n            var setting = watchers.setting;\n            if (RongIMLib.RongUtil.isFunction(setting)) {\n                RongIMClient.settingListeners.push(setting);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_DISC_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM });\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback, version) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback, version);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global|boolean\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            RongIMClient._dataAccessProvider.setConversationStatus(type, targetId, statusItem, callback);\n        };\n        /**\n         * 更新消息扩展属性\n         * @param expansionDic 要更新的消息扩展信息键值对\n         * @param message      要更新的原始消息体\n        */\n        RongIMClient.prototype.updateMessageExpansion = function (expansionDic, message, callback) {\n            RongIMClient._dataAccessProvider.updateMessageExpansion(expansionDic, message, callback);\n        };\n        /**\n         * 删除消息扩展属性\n         * @param keys 消息扩展信息中待删除的 key 的列表\n         * @param message 要删除消息扩展的原始消息体\n        */\n        RongIMClient.prototype.removeMessageExpansionForKey = function (keys, message, callback) {\n            RongIMClient._dataAccessProvider.removeMessageExpansionForKey(keys, message, callback);\n        };\n        /**\n         *删除特定消息内所有扩展信息\n         *@param message 原始消息体\n        */\n        RongIMClient.prototype.removeMessageAllExpansion = function (message, callback) {\n            RongIMClient._dataAccessProvider.removeMessageAllExpansion(message, callback);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback, params);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageSearchField(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    if (tempConver.msg) {\n                        conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                        conver.latestMessageId = conver.latestMessage.messageId;\n                        conver.objectName = conver.latestMessage.objectName;\n                        conver.receivedStatus = conver.latestMessage.receivedStatus;\n                        conver.receivedTime = conver.latestMessage.receiveTime;\n                        conver.sentStatus = conver.latestMessage.sentStatus;\n                        conver.sentTime = conver.latestMessage.sentTime;\n                    }\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    var status = RongIMClient._dataAccessProvider.conversationStatusManager.get(tempConver.type, tempConver.userId);\n                    conver.notificationStatus = status.notificationStatus;\n                    conver.isTop = status.isTop;\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback, fileName) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\", \"undefined|null|string\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"), fileName);\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\", \"undefined|null|object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"), data);\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", 'object', \"string\", \"string\", \"object\"], \"setRTCUserTotalRes\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserTotalRes(roomId, message, valueInfo, objectName, callback);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.HttpProtocol = {\n            http: 'http://',\n            https: 'https://'\n        };\n        RongIMClient.WsProtocol = {\n            ws: 'ws://',\n            wss: 'wss://'\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.MaxMessageContentBytes = 131072; // 128kb\n        RongIMClient.NavMarkInToken = '@';\n        RongIMClient.NavSeparatorInToken = ';';\n        RongIMClient.NavExpiredTime = 7200000; // 2 小时\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.10';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.settingListeners = [];\n        RongIMClient.conversationStatusListeners = [];\n        RongIMClient.messageExpansionListenerUpdated = [];\n        RongIMClient.messageExpansionListenerDeleted = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    RongIMLib.StatusTopic = (function () {\n        var ConversationType = RongIMLib.ConversationType;\n        var topic = {};\n        topic[ConversationType.PRIVATE] = 'ppMsgS';\n        topic[ConversationType.GROUP] = 'pgMsgS';\n        return topic;\n    })();\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var customCmpUrl = depend.cmpUrl;\n            if (RongIMLib.RongUtil.isValidWsUrl(customCmpUrl)) {\n                servers = [customCmpUrl];\n            }\n            else {\n                servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                        url: url\n                                    } });\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                            url: url,\n                                            code: code\n                                        } });\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    url: server\n                                } });\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                                desc: 'all websocket addresses are unavailable',\n                                cmp: servers,\n                                ConnectionStatus: RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE,\n                                available: false\n                            } });\n                        clearHandler();\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        var storeServers = storage.getItem('servers');\n                        try {\n                            storeServers = JSON.parse(storeServers);\n                            !RongIMLib.RongUtil.getValidWsUrlList(storeServers).length && RongIMLib.Navigation.clear();\n                        }\n                        catch (e) { }\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    me.connectionStatus = code;\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                    var unReportCodes = [RongIMLib.ConnectionStatus.CONNECTING, RongIMLib.ConnectionStatus.REQUEST_NAVI, RongIMLib.ConnectionStatus.RESPONSE_NAVI];\n                    var isReportCode = RongIMLib.RongUtil.indexOf(unReportCodes, code) === -1;\n                    if (isReportCode) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_NETC_S, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                ConnectionStatus: code,\n                                available: false\n                            } });\n                    }\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    if (RongIMLib.RongUtil.getValidWsUrlList(servers).length) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", RongIMLib.Transportations._TransportType);\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                    else {\n                        me.changeConnectType();\n                        RongIMLib.RongIMClient.isFirstConnect = false;\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            var self = this;\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n                RongIMLib.RongIMClient._memoryStore.cmpTimeoutTimer = setTimeout(function () {\n                    Bridge._client.handler.connectCallback.readTimeOut(true, RongIMLib.ErrorCode.RC_CONN_ACK_TIMEOUT);\n                    Bridge._client.channel.connectionStatus = -1;\n                }, RongIMLib.TimeoutEnum.CMP);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg, option) {\n            option = option || {};\n            var isNoAck = option.isNoAck;\n            var hasCallback = !!_callback;\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (isNoAck) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                _callback.onSuccess(msg);\n            }\n            else if (hasCallback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    var errorMsg = \"syncTime:Received messages of chatroom but was not init\";\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CHRM_PULL_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            msg: errorMsg\n                        } });\n                    throw new Error(errorMsg);\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            try {\n                                Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                            }\n                            catch (e) {\n                                console.log(e);\n                            }\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                    if (error !== RongIMLib.ErrorCode.TIMEOUT) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_QUERY_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                action: 'invoke -> queryMessage',\n                                error: error\n                            } });\n                    }\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.prototype.clearCacheMessageIds = function () {\n            this.cacheMessageIds = [];\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                    if (status == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE) {\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = true;\n                    }\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType, params) {\n            params = params || {};\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                var isStatusMessage = params.isStatus;\n                var statusTopic = RongIMLib.StatusTopic[topic];\n                if (isStatusMessage && statusTopic) {\n                    Bridge._client.publishMessage(statusTopic, content, targetId, callback, msg, {\n                        isNoAck: true\n                    });\n                }\n                else {\n                    Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg); // 非状态消息, 逻辑不变\n                }\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'NotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                if (data.type === 2) {\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n                else if (data.type === 3) {\n                    RongIMLib.RongIMClient._dataAccessProvider.conversationStatusManager.pull({\n                        time: timestamp\n                    });\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            if (!msg) {\n                return;\n            }\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    try {\n                        entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    }\n                    catch (e) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { stack: e, msg: 'MessageHandler -> onReceived' } });\n                        return;\n                    }\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg, isSync);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                var receivedTime = new Date().getTime();\n                con.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.isTop = false;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            if (RongIMLib.LoggerUtil.isLogCmdMsg(message)) {\n                RongIMLib.Logger.reportMNLog(message.content);\n                return;\n            }\n            if (RongIMLib.MessageExpansionHandler.isExpansionMessage(message)) {\n                RongIMLib.MessageExpansionHandler.emitListeners(message);\n                return;\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content;\n                if (RongIMLib.RongUtil.isUndefined(receiptResponseMsg) || RongIMLib.RongUtil.isNull(receiptResponseMsg)) {\n                    receiptResponseMsg = new RongIMLib.ReadReceiptResponseMessage({});\n                }\n                var receiptMessageDic = receiptResponseMsg.receiptMessageDic || {}, uIds = receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                try {\n                    that._onReceived(message, count, hasMore);\n                }\n                catch (e) {\n                    console.error(e);\n                }\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            if (msg && RongIMLib.RongUtil.isObject(msg) && msg.timestamp) {\n                RongIMLib.MessageUtil.setDeltaTime(msg.timestamp);\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CATCH_UNKNOWN_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'MessageHandler -> handleMessage',\n                            msg: msg\n                        } });\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout, code) {\n            code = code || RongIMLib.ErrorCode.TIMEOUT;\n            if (isTimeout && this.onError) {\n                this.onError(code);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token,\n                        bosToken: entity.bosToken,\n                        bosDate: entity.bosDate,\n                        path: entity.path\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_QUERY_DATA_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            stack: e,\n                            pbtype: pbtype,\n                            msg: 'QueryCallback -> process'\n                        } });\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            clearTimeout(RongIMLib.RongIMClient._memoryStore.cmpTimeoutTimer);\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                RongIMLib.MessageUtil.setDeltaTime(timestamp);\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x, errorCode) {\n            MessageCallback.prototype.readTimeOut.call(this, x, errorCode);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result, naviUrl) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var successNaviProtocol = RongIMLib.RongUtil.getUrlProtocol(naviUrl);\n            // navi 请求成功后, 根据 navi 协议头, 设置连接 websocket 协议头\n            RongIMLib.RongIMClient.setProtocol(successNaviProtocol);\n            storage.setItem(Navigation.StoreProtocolKey, successNaviProtocol);\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            storage.setItem('navi_time', RongIMLib.RongUtil.getTimestamp());\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            var uploadDomains = {\n                qiniu: result.uploadServer || '',\n                bos: result.bosAddr || ''\n            };\n            storage.setItem('upload_domains', JSON.stringify(uploadDomains));\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                var currentTime = RongIMLib.RongUtil.getTimestamp();\n                var naviSavedTime = Number(storage.getItem('navi_time')) || 0;\n                var isNotExpired = currentTime - naviSavedTime < RongIMLib.RongIMClient.NavExpiredTime;\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers) && isNotExpired) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    var storageProtocol = storage.getItem(Navigation.StoreProtocolKey);\n                    storageProtocol && RongIMLib.RongIMClient.setProtocol(storageProtocol);\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    if (RongIMLib.RongUtil.isPrivateService()) {\n                        return _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    }\n                    // 所有导航请求失败，及所有重试失败后，返回预埋导航配置信息，进行连接。预埋导航配置仅适用公有云环境，私有云仍直接抛出\n                    var naviResp = RongIMLib.FixedNaviRespHandler.getResp();\n                    var naviHost = navigaters[0];\n                    context.getNaviSuccess(naviResp, RongIMLib.RongUtil.getValidNavi(naviHost));\n                    _onsuccess();\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                navi = RongIMLib.RongUtil.getValidNavi(navi);\n                indexTools.add();\n                RongIMLib.LoggerUtil.recordFatalLogOfNavi(internalRetry, navigaters);\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result, navi);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n            RongIMLib.Logger.loggerCache.isNewNavi = true;\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            var requestType = \"HTTP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    result = JSON.parse(result);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                            code: 0,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                    success(result);\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            code: status,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            var requestType = \"JSONP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            var loggerResult = function (status, result) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        code: status,\n                        result: result,\n                        url: url,\n                        requestType: requestType\n                    } });\n            };\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                loggerResult(code, result);\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                loggerResult(RongIMLib.ConnectionState.TOKEN_INCORRECT, {});\n            };\n        };\n        Navigation.StoreProtocolKey = 'navprotocol';\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            // var UTF = \"\", _arr = arr;\n            // for (let i = 0, len = _arr.length; i < len; i++) {\n            //     if (_arr[i] < 0) { _arr[i] += 256; };\n            //     var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n            //     if (v && one.length == 8) {\n            //         var bytesLength = v[0].length,\n            //             // store = _arr[i].toString(2).slice(7 - bytesLength);\n            //             store = '';\n            //         for (var st = 0; st < bytesLength; st++) {\n            //             store += _arr[st + i].toString(2).slice(2);\n            //         }\n            //         UTF += String.fromCharCode(parseInt(store, 2));\n            //         i += bytesLength - 1;\n            //     } else {\n            //         UTF += String.fromCharCode(_arr[i]);\n            //     }\n            // }\n            // return UTF;\n            var MAX_SIZE = 0x4000;\n            var codeUnits = [];\n            var highSurrogate;\n            var lowSurrogate;\n            var index = -1;\n            var strBytes = arr;\n            var result = '';\n            while (++index < strBytes.length) {\n                var codePoint = Number(strBytes[index]);\n                if (codePoint === (codePoint & 0x7F)) {\n                }\n                else if (0xF0 === (codePoint & 0xF0)) {\n                    codePoint ^= 0xF0;\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                }\n                else if (0xE0 === (codePoint & 0xE0)) {\n                    codePoint ^= 0xE0;\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                }\n                else if (0xC0 === (codePoint & 0xC0)) {\n                    codePoint ^= 0xC0;\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                }\n                if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || Math.floor(codePoint) !== codePoint)\n                    throw RangeError('Invalid code point: ' + codePoint);\n                if (codePoint <= 0xFFFF)\n                    codeUnits.push(codePoint);\n                else {\n                    codePoint -= 0x10000;\n                    highSurrogate = (codePoint >> 10) | 0xD800;\n                    lowSurrogate = (codePoint % 0x400) | 0xDC00;\n                    codeUnits.push(highSurrogate, lowSurrogate);\n                }\n                if (index + 1 === strBytes.length || codeUnits.length > MAX_SIZE) {\n                    result += String.fromCharCode.apply(null, codeUnits);\n                    codeUnits.length = 0;\n                }\n            }\n            return result;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                try {\n                    this.pool = this.pool.concat(b);\n                }\n                catch (e) {\n                    [].push.apply(this.pool, b);\n                }\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (!me.connectedTime || (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime)) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_WS_ERR_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                    error: RongIMLib.ConnectionStatus.WEBSOCKET_ERROR,\n                    msg: 'SocketTransportation -> onError'\n                } });\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:ReferenceMsg\": \"ReferenceMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:GIFMsg\": \"GIFMessage\",\n    \"RC:SightMsg\": \"SightMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\",\n    \"RC:LogCmdMsg\": \"LogCommandMessage\",\n    \"RC:MsgExMsg\": \"ExpansionCommandMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    // 业务层公共方法处理\n    var IMHandler = (function () {\n        function IMHandler() {\n        }\n        IMHandler.isIncludeNavi = function (token) {\n            var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n            var hasNavMark = navMarkIndex !== -1;\n            return hasNavMark;\n        };\n        IMHandler.getToken = function (token) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                token = token.substring(0, navMarkIndex + 1);\n            }\n            return token;\n        };\n        IMHandler.getNavsByToken = function (token, protocol) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            var navUrlList = [];\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                var navsText = token.substring(navMarkIndex + 1, token.length);\n                var navDomains = navsText.split(RongIMLib.RongIMClient.NavSeparatorInToken);\n                RongIMLib.RongUtil.forEach(navDomains, function (domain) {\n                    if (RongIMLib.RongUtil.isEmpty(domain)) {\n                        return;\n                    }\n                    var navUrl = RongIMLib.RongUtil.formatProtoclPath({\n                        path: domain, protocol: protocol, sub: true\n                    });\n                    navUrlList.push(navUrl);\n                });\n            }\n            return navUrlList;\n        };\n        IMHandler.getConversationKey = function (type, id) {\n            return type + '_' + id;\n        };\n        return IMHandler;\n    })();\n    RongIMLib.IMHandler = IMHandler;\n    ;\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n            // 向缓存中也设置拉消息时间戳\n            SyncTimeUtil._syncTimeCache[key] = sentTime;\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            /**\n             * 先从缓存中获取时间戳，如果缓存中没有再从 localstorage 中取。\n             * 避免多端重连都从 localstorage 中取时间戳，重连成功时间不一致导致后重连的用户拉消息有断档情况\n            */\n            var pullMsgTimeBox = SyncTimeUtil._syncTimeCache;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            if (RongIMLib.RongUtil.isEmpty(pullMsgTimeBox)) {\n                pullMsgTimeBox[sent] = storage.getItem(sent);\n                pullMsgTimeBox[received] = storage.getItem(received);\n            }\n            return {\n                sent: Number(pullMsgTimeBox[sent] || 0),\n                received: Number(pullMsgTimeBox[received] || 0)\n            };\n        };\n        SyncTimeUtil._syncTimeCache = {};\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        // 下行消息状态位判断, 第 10 位为 disableNotification 开关（ 上行为第 6 位 ）\n        MessageUtil.isDisableNotification = function (status) {\n            return Boolean(status & 0x200);\n        };\n        MessageUtil.getMessageOptionByStatus = function (status) {\n            var disableNotification = false, canIncludeExpansion = false;\n            disableNotification = !!(status & 0x200);\n            canIncludeExpansion = !!(status & 0x400);\n            return {\n                disableNotification: disableNotification,\n                canIncludeExpansion: canIncludeExpansion\n            };\n        };\n        MessageUtil.getMessageOptionBySessionId = function (sessionId) {\n            var disableNotification = false, canIncludeExpansion = false;\n            disableNotification = !!(sessionId & 0x20);\n            canIncludeExpansion = !!(sessionId & 0x40);\n            return {\n                disableNotification: disableNotification,\n                canIncludeExpansion: canIncludeExpansion\n            };\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg, isSync) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PARSE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: ex,\n                        msg: 'MessageUtil -> messageParser'\n                    } });\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            var receivedTime = new Date().getTime();\n            message.messageUId = entity.msgId;\n            message.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            try {\n                if (isSync) {\n                    RongIMLib.RongUtil.extend(MessageUtil.getMessageOptionBySessionId(entity.sessionId), message, null, true);\n                }\n                else {\n                    var status = MessageUtil.int64ToTimestamp(entity.status);\n                    RongIMLib.RongUtil.extend(MessageUtil.getMessageOptionByStatus(status), message, null, true);\n                }\n                entity.extraContent && (message.expansion = MessageExpansionHandler.formatExtraContent(entity.extraContent));\n            }\n            catch (error) {\n                RongIMLib.RongUtil.extend(MessageUtil.getMessageOptionByStatus(status), message, null, true);\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        MessageUtil.setDeltaTime = function (serverTime) {\n            try {\n                RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - serverTime;\n            }\n            catch (e) { }\n        };\n        MessageUtil.getDeltaTime = function () {\n            var _memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            return _memoryStore.deltaTime || 0;\n        };\n        MessageUtil.getCheckedTime = function (time) {\n            var deltaTime = MessageUtil.getDeltaTime();\n            return time - deltaTime;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n    var ConversationStatusStoreUserKey = '{appkey}{userId}constas';\n    var ConversationStatusPullTimeStoreKey = 'time';\n    var ConversationStatusManager = (function () {\n        function ConversationStatusManager(option) {\n            this.updatedStatus = []; // 更新的会话状态\n            this.statusShangeObserver = new RongIMLib.Observer();\n            this.pullProsumer = new RongIMLib.RongUtil.Prosumer();\n            var appkey = option.appkey, userId = option.userId;\n            this.option = option;\n            this.storageKey = RongIMLib.RongUtil.tplEngine(ConversationStatusStoreUserKey, {\n                appkey: appkey, userId: userId\n            });\n        }\n        ConversationStatusManager.prototype._formatUpdatedStatus = function (status, type, targetId) {\n            var updatedStatus = {\n                conversationType: type,\n                targetId: targetId\n            };\n            delete status.isLastInAPull;\n            return RongIMLib.RongUtil.extend(updatedStatus, status);\n        };\n        ConversationStatusManager.prototype.watchChanged = function (event) {\n            this.statusShangeObserver.add(event);\n        };\n        ConversationStatusManager.prototype.set = function (type, targetId, status) {\n            var currentStatus = this.get(type, targetId);\n            var updateTime = status.updateTime, isLastInAPull = status.isLastInAPull;\n            if (updateTime >= currentStatus.updateTime) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n                var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n                var storeStatus = allStatus[conversationStoreKey] || {};\n                RongIMLib.RongUtil.forEach(status, function (val, key) {\n                    if (!RongIMLib.RongUtil.isUndefined(val)) {\n                        storeStatus[key] = val;\n                    }\n                });\n                allStatus[conversationStoreKey] = storeStatus;\n                RongIMLib.RongUtil.Storage.set(this.storageKey, allStatus);\n                var updatedStatusItem = this._formatUpdatedStatus(status, type, targetId);\n                this.updatedStatus.push(updatedStatusItem);\n                RongIMLib.RongIMClient.getInstance().pottingConversation({\n                    type: type,\n                    userId: targetId\n                });\n            }\n            isLastInAPull && this.statusShangeObserver.emit(this.updatedStatus);\n            this.updatedStatus = [];\n        };\n        ConversationStatusManager.prototype.get = function (type, targetId) {\n            var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n            var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n            var status = allStatus[conversationStoreKey] || {};\n            var notificationStatus = status.notificationStatus, isTop = status.isTop, updateTime = status.updateTime;\n            return {\n                notificationStatus: notificationStatus || RongIMLib.ConversationNotificationStatus.NOTIFY,\n                isTop: isTop || false,\n                updateTime: updateTime || 0\n            };\n        };\n        ConversationStatusManager.prototype.pull = function (option) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭会话状态设置\n            option = option || {};\n            var self = this;\n            var _a = this, server = _a.option.server, pullProsumer = _a.pullProsumer, storageKey = _a.storageKey;\n            pullProsumer.produce(option);\n            pullProsumer.consume(function (params, next) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                var lastUpdateTime = allStatus[ConversationStatusPullTimeStoreKey] || 0;\n                var updateTime = params.time, isForce = params.isForce;\n                if (lastUpdateTime > updateTime && !isForce) {\n                    return next();\n                }\n                server.pullConversationStatus(lastUpdateTime, {\n                    onStatus: function (type, id, conversationStatus) {\n                        self.set(type, id, conversationStatus);\n                    },\n                    onSuccess: function (updateTime) {\n                        var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                        allStatus[ConversationStatusPullTimeStoreKey] = updateTime; // 更新拉取时间戳\n                        RongIMLib.RongUtil.Storage.set(self.storageKey, allStatus);\n                        next();\n                    },\n                    onError: next\n                });\n            });\n        };\n        return ConversationStatusManager;\n    })();\n    RongIMLib.ConversationStatusManager = ConversationStatusManager;\n    var FixedNaviRespHandler = (function () {\n        function FixedNaviRespHandler() {\n        }\n        FixedNaviRespHandler.modifyVoipCallInfoByAppKey = function () {\n            var me = this;\n            try {\n                var naviResp = me.baseResp;\n                var appKey = RongIMLib.RongIMClient._memoryStore.appKey;\n                var voipCallInfo = naviResp.voipCallInfo;\n                var parseVoipCallInfo = JSON.parse(voipCallInfo);\n                RongIMLib.RongUtil.forEach(parseVoipCallInfo.callEngine, function (item) {\n                    if (item.engineType === 3) {\n                        item.vendorKey = appKey;\n                    }\n                });\n                var jsonVoipCallInfo = JSON.stringify(parseVoipCallInfo);\n                naviResp.voipCallInfo = jsonVoipCallInfo;\n            }\n            catch (error) {\n            }\n            return naviResp;\n        };\n        FixedNaviRespHandler.modifyCmpByProtocol = function () {\n            var me = this;\n            var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n            var isHTTP = protocol === RongIMLib.RongIMClient.HttpProtocol.http;\n            var cmpHost = isHTTP ? me.preparedCMP.WS : me.preparedCMP.WSS;\n            me.baseResp.backupServer = cmpHost;\n        };\n        FixedNaviRespHandler.genUserId = function () {\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            return uid;\n        };\n        FixedNaviRespHandler.getResp = function () {\n            var me = this;\n            me.modifyCmpByProtocol();\n            var naviResp = me.modifyVoipCallInfoByAppKey();\n            naviResp.userId = me.genUserId();\n            return naviResp;\n        };\n        FixedNaviRespHandler.baseResp = {\n            isFixedNaviResp: true,\n            code: 200,\n            userId: '',\n            server: '',\n            backupServer: '',\n            voipCallInfo: '{\"strategy\":1,\"callEngine\":[{\"engineType\":4,\"mediaServer\":\"https://rtc-info.ronghub.com\",\"maxStreamCount\":20},{\"engineType\":3,\"vendorKey\":\"\",\"signKey\":\"\",\"blinkCMPServer\":\"rtccmp.ronghub.com:80\",\"blinkSnifferServer\":\"rtccmp.ronghub.com:80\"}]}',\n            kvStorage: 1,\n            uploadServer: 'upload.qiniup.com',\n            openMp: 1,\n            openUS: 1,\n            logSwitch: 1,\n            logPolicy: '{\"url\": \"logcollection.ronghub.com\",\"level\": 1,\"itv\": 6,\"times\": 5}',\n            bosAddr: 'gz.bcebos.com'\n        };\n        FixedNaviRespHandler.preparedCMP = {\n            WSS: 'wsap-cn.ronghub.com:443',\n            WS: 'wsap-cn.ronghub.com:80'\n        };\n        return FixedNaviRespHandler;\n    })();\n    RongIMLib.FixedNaviRespHandler = FixedNaviRespHandler;\n    var JoinedChatroomSyner = (function () {\n        function JoinedChatroomSyner(option) {\n            this.chrmIds = [];\n            var self = this;\n            option = option || {};\n            self.key = RongIMLib.RongUtil.tplEngine('{appkey}-{userId}-joinedChrm', {\n                appkey: option.appkey,\n                userId: option.userId\n            });\n            self.storage = new RongIMLib.sessionStorageProvider();\n        }\n        JoinedChatroomSyner.prototype.set = function (chrmId) {\n            var self = this;\n            self.chrmIds.push(chrmId);\n            self.storage.setItem(self.key, self.chrmIds);\n        };\n        JoinedChatroomSyner.prototype.get = function () {\n            var chrmIds = this.storage.getItem(this.key);\n            return chrmIds.split(',');\n        };\n        JoinedChatroomSyner.prototype.remove = function (chrmId) {\n            var self = this;\n            RongIMLib.RongUtil.forEach(self.chrmIds, function (id, idx) {\n                if (id == chrmId) {\n                    self.chrmIds.splice(idx, 1);\n                }\n            });\n            self.storage.setItem(self.key, self.chrmIds);\n        };\n        JoinedChatroomSyner.prototype.clear = function () {\n            var self = this;\n            self.storage.setItem(self.key, []);\n        };\n        JoinedChatroomSyner.prototype.isInChrm = function (chrmId) {\n            var chrmIds = this.get();\n            var isInChrm = false;\n            RongIMLib.RongUtil.forEach(chrmIds, (function (id) {\n                if (chrmId === id) {\n                    isInChrm = true;\n                }\n            }));\n            return isInChrm;\n        };\n        return JoinedChatroomSyner;\n    })();\n    RongIMLib.JoinedChatroomSyner = JoinedChatroomSyner;\n    var MessageExpansionHandler = (function () {\n        function MessageExpansionHandler() {\n        }\n        MessageExpansionHandler.isExpansionMessage = function (message) {\n            return message.messageType === \"ExpansionCommandMessage\" && message.objectName === \"RC:MsgExMsg\";\n        };\n        MessageExpansionHandler.validateExpansion = function (expansion) {\n            var REGEXP_EXPANSION_KEY = /^[A-Za-z0-9_=+-]+$/;\n            var expansionKeysLength = RongIMLib.RongUtil.getObjectKeys(expansion).length;\n            if (RongIMLib.RongUtil.isEmpty(expansion)) {\n                return RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER;\n            }\n            if (expansionKeysLength > RongIMLib.MsgEpansionLength.MSG) {\n                return RongIMLib.MessageExpansionErrorCode.EXPANSION_LIMIT_EXCEET;\n            }\n            var error = void 0;\n            RongIMLib.RongUtil.forEach(expansion, function (val, key) {\n                if (!RongIMLib.RongUtil.isString(val)) {\n                    return;\n                }\n                if (key.length > RongIMLib.MsgEpansionLength.KEY || val.length > RongIMLib.MsgEpansionLength.VALUE) {\n                    error = RongIMLib.MessageExpansionErrorCode.EXPANSION_LIMIT_EXCEET;\n                    return;\n                }\n                if (!REGEXP_EXPANSION_KEY.test(key)) {\n                    error = RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER;\n                    return;\n                }\n            });\n            return error;\n        };\n        MessageExpansionHandler.formatExtraContent = function (extraContent) {\n            var expansion = {};\n            var parseExtraContent = JSON.parse(extraContent);\n            RongIMLib.RongUtil.forEach(parseExtraContent, function (value, key) {\n                expansion[key] = value.v;\n            });\n            return expansion;\n        };\n        MessageExpansionHandler.emitListeners = function (message) {\n            var content = message.content || {}, messageUId = content.mid, \n            // sentTime: number = message.sentTime,\n            removeAll = Boolean(message.removeAll);\n            var expansion = content.put, removeDic = content.del;\n            if (!RongIMLib.RongUtil.isEmpty(expansion)) {\n                var events = RongIMLib.RongIMClient.messageExpansionListenerUpdated;\n                RongIMLib.RongUtil.forEach(events, function (event) {\n                    event({ expansion: expansion, messageUId: messageUId });\n                });\n            }\n            if (!RongIMLib.RongUtil.isEmpty(removeDic)) {\n                var events = RongIMLib.RongIMClient.messageExpansionListenerDeleted;\n                RongIMLib.RongUtil.forEach(events, function (event) {\n                    event({ deletedKeys: removeDic, messageUId: messageUId });\n                });\n            }\n        };\n        return MessageExpansionHandler;\n    })();\n    RongIMLib.MessageExpansionHandler = MessageExpansionHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_PROFILE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_NOTI_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ExpansionCommandMessage = (function () {\n        function ExpansionCommandMessage(message) {\n            this.messageName = \"ExpansionCommandMessage\";\n            message.put && (this.put = message.put);\n            message.del && (this.del = message.del);\n            message.mid && (this.mid = message.mid);\n            message.removeAll && (this.removeAll = message.removeAll);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ExpansionCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ExpansionCommandMessage;\n    })();\n    RongIMLib.ExpansionCommandMessage = ExpansionCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            message.burnDuration && (this.burnDuration = message.burnDuration);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.conversationType = message.conversationType;\n            this.summaryList = message.summaryList;\n            this.extra = message.extra;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList, conversationType) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList, conversationType: conversationType });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n    var LogCommandMessage = (function () {\n        function LogCommandMessage(message) {\n            this.messageName = \"LogCommandMessage\";\n            message.uri && (this.uri = message.uri);\n            message.logId && (this.logId = message.logId);\n            message.platform && (this.platform = message.platform);\n            message.packageName && (this.packageName = message.packageName);\n            message.startTime && (this.startTime = message.startTime);\n            message.endTime && (this.endTime = message.endTime);\n            message.user && (this.user = message.user);\n        }\n        LogCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LogCommandMessage;\n    })();\n    RongIMLib.LogCommandMessage = LogCommandMessage;\n    var ReferenceMessage = (function () {\n        function ReferenceMessage(message) {\n            this.messageName = \"ReferenceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.content = message.content;\n            this.referMsgUserId = message.referMsgUserId;\n            this.referMsg = message.referMsg;\n            this.objName = message.objName;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            this.extra = message.extra;\n        }\n        ReferenceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReferenceMessage;\n    })();\n    RongIMLib.ReferenceMessage = ReferenceMessage;\n    var GIFMessage = (function () {\n        function GIFMessage(message) {\n            this.messageName = \"GIFMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.gifDataSize = message.gifDataSize;\n            this.localPath = message.localPath;\n            this.remoteUrl = message.remoteUrl;\n            this.width = message.width;\n            this.height = message.height;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        GIFMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GIFMessage;\n    })();\n    RongIMLib.GIFMessage = GIFMessage;\n    var SightMessage = (function () {\n        function SightMessage(message) {\n            this.messageName = \"SightMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.sightUrl = message.sightUrl;\n            this.content = message.content;\n            this.duration = message.duration;\n            this.size = message.size;\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        SightMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SightMessage;\n    })();\n    RongIMLib.SightMessage = SightMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse, disableNotification, canIncludeExpansion, expansion) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n            this.disableNotification = disableNotification;\n            this.canIncludeExpansion = canIncludeExpansion;\n            this.expansion = expansion;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            var self = this;\n            RongIMLib.Logger.reportRTLog();\n            option = option || {};\n            var isReconnect = option.isReconnect;\n            var isIgnoreReportStart = option.isIgnoreReportStart;\n            var StartReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_T : RongIMLib.LoggerTag.IM.A_CONN_T;\n            var EndReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_R : RongIMLib.LoggerTag.IM.A_CONN_R;\n            !isIgnoreReportStart && RongIMLib.Logger.writeLog({ tag: StartReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { \"token\": token } });\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = false;\n                        RongIMLib.Logger.loggerCache.userId = data;\n                        RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { desc: 'connection succeeded' } });\n                        self.conversationStatusManager = new RongIMLib.ConversationStatusManager({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data,\n                            server: self\n                        });\n                        self.conversationStatusManager.watchChanged(function (status) {\n                            RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.conversationStatusListeners, function (event) {\n                                event(status);\n                            });\n                        });\n                        self.conversationStatusManager.pull({\n                            isForce: true\n                        });\n                        self.joinedChrmManager = new RongIMLib.JoinedChatroomSyner({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data\n                        });\n                    });\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var fullnavi = storage.getItem('fullnavi') || '{}';\n                    try {\n                        fullnavi = JSON.parse(fullnavi);\n                    }\n                    catch (e) {\n                        fullnavi = {};\n                    }\n                    var isAutoPull = fullnavi.openUS;\n                    isAutoPull && self.getVoipInfo({\n                        onSuccess: function (VoipInfo) {\n                            try {\n                                VoipInfo && RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.settingListeners, function (listener) {\n                                    listener({ VoipInfo: VoipInfo }); // 与 3.x 保持一致, 方便后续 3.x 兼容\n                                });\n                                if (VoipInfo) {\n                                    var fullnavi_1 = storage.getItem('fullnavi') || '{}';\n                                    fullnavi_1 = JSON.parse(fullnavi_1);\n                                    fullnavi_1.voipCallInfo = VoipInfo;\n                                    storage.setItem('fullnavi', JSON.stringify(fullnavi_1));\n                                }\n                            }\n                            catch (e) {\n                            }\n                        },\n                        onError: function () {\n                            // do nothing\n                        }\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { ConnectionState: RongIMLib.ConnectionState.TOKEN_INCORRECT } });\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { code: e } });\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                var timer = setTimeout(ping, next);\n                                RongIMLib.RongIMClient._memoryStore.autoReconnectTimer = timer;\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback, null, {\n                                    isIgnoreReportStart: true,\n                                    isReconnect: true\n                                });\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback, null, {\n                            isIgnoreReportStart: true,\n                            isReconnect: true\n                        });\n                    }\n                };\n                handler[key]();\n            }\n            else {\n                var _client = RongIMLib.Bridge._client || {};\n                var _channel = _client.channel || {};\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_RECO_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        msg: {\n                            connectionStatus: _channel.connectionStatus\n                        },\n                        action: 'reconnect'\n                    } });\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            var timer = RongIMLib.RongIMClient._memoryStore.autoReconnectTimer;\n            timer && clearTimeout(timer);\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            params = params || {};\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2, params);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var self = this;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId\n                                        } });\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId,\n                                            error: errorCode\n                                        } });\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    chatroomId: chatroomId\n                                } });\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                    self.joinedChrmManager.set(chatroomId);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: error\n                            } });\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var self = this;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    RongIMLib.Bridge._client && RongIMLib.Bridge._client.clearCacheMessageIds();\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId\n                            } });\n                        callback.onSuccess();\n                        self.joinedChrmManager.remove(chatroomId);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: errcode\n                            } });\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var isInChatRoom = this.joinedChrmManager.isInChrm(chatroomId);\n            if (!isInChatRoom) {\n                return callback.onError(RongIMLib.ErrorCode.NOT_IN_CHATROOM);\n            }\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            var isInChatRoom = this.joinedChrmManager.isInChrm(chatroomId);\n            if (!isInChatRoom) {\n                return callback.onError(RongIMLib.ErrorCode.NOT_IN_CHATROOM);\n            }\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback, fileName) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var fileName = RongIMLib.RongUtil.generateUploadFileName(fileType, fileName);\n            // 获取上传地址\n            var domains = RongIMLib.RongIMClient._storageProvider.getItem('upload_domains') || '{}';\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (res) {\n                    setTimeout(function () {\n                        var data = RongIMLib.RongUtil.extend(JSON.parse(domains), res);\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            var data = data || {};\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            if (data.isBosRes) {\n                callback.onSuccess(data);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getVoipInfo = function (callback) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭实时配置，IE 现不支持音视频\n            // 获取最新值\n            return this.getPullSetting({\n                onSuccess: function (result) {\n                    result = result || {};\n                    var items = result.items || [];\n                    var voipInfo = null;\n                    for (var i = 0, max = items.length; i < max; i++) {\n                        var item = items[i];\n                        if (item.key === 'VoipInfo') {\n                            var value = item.value;\n                            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayForm(value.buffer).slice(value.offset, value.limit) : value);\n                            }\n                            else {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayFormInput(value.buffer).subarray(value.offset, value.limit) : value);\n                            }\n                            voipInfo = value;\n                        }\n                    }\n                    callback.onSuccess(voipInfo);\n                },\n                onError: callback.onError\n            }, 0);\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback, version) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            version = version || parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            var sessionId;\n            if (mentiondMsg && isGroup) {\n                sessionId = 7;\n                params.disableNotification && (sessionId = sessionId | 0x20);\n                params.canIncludeExpansion && (sessionId = sessionId | 0x40);\n                modules.setSessionId(sessionId);\n            }\n            else {\n                sessionId = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag();\n                params.disableNotification && (sessionId = sessionId | 0x20);\n                params.canIncludeExpansion && (sessionId = sessionId | 0x40);\n                modules.setSessionId(sessionId);\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (params.expansion && params.canIncludeExpansion) {\n                var error = RongIMLib.MessageExpansionHandler.validateExpansion(params.expansion);\n                if (error) {\n                    setTimeout(function () {\n                        sendCallback.onError(error);\n                    });\n                    return;\n                }\n                var extraContent = {};\n                RongIMLib.RongUtil.forEach(params.expansion, function (val, key) {\n                    extraContent[key] = { v: val };\n                });\n                modules.setExtraContent(JSON.stringify(extraContent));\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            var encodedContent = messageContent.encode();\n            if (RongIMLib.RongUtil.getByteLength(encodedContent) > RongIMLib.RongIMClient.MaxMessageContentBytes) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);\n                });\n                return;\n            }\n            modules.setContent(encodedContent);\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            msg.disableNotification = params.disableNotification || false;\n            msg.canIncludeExpansion = params.canIncludeExpansion || false;\n            params.canIncludeExpansion && (msg.expansion = params.expansion);\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType, params);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        /**\n         * 向缓存会话列表内添加新会话或更新会话\n        */\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        /**\n         * 更新缓存会话字段\n        */\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        /**\n         * 移除 IM Server 端会话,并清除缓存内会话\n        */\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!RongIMLib.RongUtil.isNumber(count)) {\n                count = 200;\n            }\n            var isLocalInclude = list.length >= count;\n            if (!isSync && (isLocalInclude || RongIMLib.RongIMClient._memoryStore.isFullConversations)) {\n                setTimeout(function () {\n                    var _list = JSON.parse(JSON.stringify(list));\n                    var localList = _list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    var isFullConversations = count > list.length;\n                    RongIMLib.RongIMClient._memoryStore.isFullConversations = isFullConversations;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            var self = this;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionStateModifyReq();\n            var userId = RongIMLib.Bridge._client.userId;\n            var time = +new Date();\n            var stateItemModules = [];\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.notificationStatus)) {\n                var isNotDisturbe = statusItem.notificationStatus === RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                stateItemModules.push({\n                    sessionStateType: 1,\n                    value: isNotDisturbe ? '1' : '0'\n                });\n            }\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.isTop)) {\n                stateItemModules.push({\n                    sessionStateType: 2,\n                    value: statusItem.isTop ? '1' : '0'\n                });\n            }\n            var stateModules = {\n                type: type,\n                channelId: targetId,\n                time: time,\n                stateItem: stateItemModules\n            };\n            modules.setVersion(time);\n            modules.setState([stateModules]);\n            RongIMLib.RongIMClient.bridge.queryMsg('setSeAtt', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var time = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    statusItem.updateTime = time;\n                    statusItem.isLastInAPull = true;\n                    self.conversationStatusManager.set(type, targetId, statusItem);\n                    setTimeout(function () {\n                        callback.onSuccess(time);\n                    });\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStateModifyResp');\n        };\n        ServerDataProvider.prototype.pullConversationStatus = function (time, callback) {\n            time = time || 0;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionReq();\n            modules.setTime(time);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg('pullSeAtts', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var sessionStateList = result.state, lastTime = result.version;\n                    var sessionLength = sessionStateList.length;\n                    RongIMLib.RongUtil.forEach(sessionStateList, function (state, index) {\n                        var type = state.type, targetId = state.channelId, updateTime = state.time, stateItem = state.stateItem;\n                        var isSilent = false, isTop = false;\n                        RongIMLib.RongUtil.forEach(stateItem, function (item) {\n                            var sessionStateType = item.sessionStateType, value = item.value;\n                            if (sessionStateType === 1) {\n                                isSilent = !!Number(value);\n                            }\n                            if (sessionStateType === 2) {\n                                isTop = !!Number(value);\n                            }\n                        });\n                        var isLastInAPull = index === sessionLength - 1;\n                        callback.onStatus(type, targetId, {\n                            notificationStatus: isSilent ? RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB : RongIMLib.ConversationNotificationStatus.NOTIFY,\n                            isTop: isTop,\n                            updateTime: RongIMLib.MessageUtil.int64ToTimestamp(updateTime),\n                            isLastInAPull: isLastInAPull\n                        });\n                    });\n                    callback.onSuccess(RongIMLib.MessageUtil.int64ToTimestamp(lastTime));\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStates');\n        };\n        ServerDataProvider.prototype.sendExpansionMessage = function (params, sendMessageCallback) {\n            var self = this;\n            params = params || {};\n            var removeAll = 0;\n            params.removeAll && (removeAll = 1);\n            var msg = new RongIMLib.ExpansionCommandMessage({\n                put: params.updateDic,\n                del: params.removeDic,\n                mid: params.messageUId,\n                removeAll: removeAll\n            });\n            self.sendMessage(params.conversationType, params.targetId, msg, {\n                onBefore: function () { },\n                onSuccess: function () {\n                    sendMessageCallback.onSuccess();\n                },\n                onError: function (errorCode) {\n                    sendMessageCallback.onError(errorCode);\n                }\n            }, false, null, null, null, null);\n        };\n        ServerDataProvider.prototype.updateMessageExpansion = function (expansionDic, message, callback) {\n            var self = this;\n            var msgExpansion = message.expansion || {};\n            var totalExpansion = RongIMLib.RongUtil.extend(expansionDic, msgExpansion);\n            var totalExpansionKeysLength = RongIMLib.RongUtil.getObjectKeys(totalExpansion).length;\n            if (!message.canIncludeExpansion) {\n                return callback.onError(RongIMLib.MessageExpansionErrorCode.NOT_SUPPORT);\n            }\n            if (totalExpansionKeysLength > RongIMLib.MsgEpansionLength.TOTAL) {\n                return callback.onError(RongIMLib.MessageExpansionErrorCode.EXPANSION_LIMIT_EXCEET);\n            }\n            var error = RongIMLib.MessageExpansionHandler.validateExpansion(expansionDic);\n            if (error) {\n                callback.onError(error);\n                return;\n            }\n            message = RongIMLib.RongUtil.extend(message, { updateDic: expansionDic });\n            self.sendExpansionMessage(message, callback);\n        };\n        ServerDataProvider.prototype.removeMessageExpansionForKey = function (keys, message, callback) {\n            var self = this;\n            if (RongIMLib.RongUtil.isEmpty(keys)) {\n                callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n            }\n            ;\n            message = RongIMLib.RongUtil.extend(message, { removeDic: keys });\n            self.sendExpansionMessage(message, callback);\n        };\n        ServerDataProvider.prototype.removeMessageAllExpansion = function (message, callback) {\n            var self = this;\n            RongIMLib.RongUtil.extend(message, { removeAll: true });\n            self.sendExpansionMessage(message, callback);\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        /**\n         * 全量订阅资源修改\n         * @param roomId 房间 Id\n         * @param message 增量数据\n         * @param valueInfo 全量资源信息\n         * @param objectName 消息名称\n         * @param callback\n         */\n        ServerDataProvider.prototype.setRTCTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            // 全量 URI 新增\n            // 全量发布中\n            // valueInfo: key 为 uris，值为 全量的订阅信息\n            // content: key 为增量数据消息 RCRTC:ModifyResource，value 为增量订阅信息\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcUserSetDataInput();\n            modules.setObjectName(objectName);\n            // content\n            var val = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            val.setKey(message.name);\n            val.setValue(message.content);\n            modules.setContent(val);\n            // valueInfo\n            val = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            val.setKey('uris');\n            val.setValue(valueInfo);\n            modules.setValueInfo(val);\n            var arrayBuff = RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer());\n            RongIMLib.RongIMClient.bridge.queryMsg(\"userSetData\", arrayBuff, roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            this.setRTCTotalRes(roomId, message, valueInfo, objectName, callback);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n        };\n        VCDataProvider.prototype.updateMessageExpansion = function (expansionDic, message, callback) {\n        };\n        VCDataProvider.prototype.removeMessageExpansionForKey = function (keys, message, callback) {\n        };\n        VCDataProvider.prototype.removeMessageAllExpansion = function (messageUId, callback) {\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            this.addon.setMessageSearchField(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var result = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return result;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            // TODO\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (LoggerLevel) {\n        LoggerLevel[LoggerLevel[\"F\"] = 0] = \"F\";\n        LoggerLevel[LoggerLevel[\"E\"] = 1] = \"E\";\n        LoggerLevel[LoggerLevel[\"W\"] = 2] = \"W\";\n        LoggerLevel[LoggerLevel[\"I\"] = 3] = \"I\";\n        LoggerLevel[LoggerLevel[\"D\"] = 4] = \"D\"; //debug\n    })(RongIMLib.LoggerLevel || (RongIMLib.LoggerLevel = {}));\n    var LoggerLevel = RongIMLib.LoggerLevel;\n    (function (LoggerStoreSize) {\n        LoggerStoreSize[LoggerStoreSize[\"ADVANCED\"] = 500] = \"ADVANCED\";\n        LoggerStoreSize[LoggerStoreSize[\"LOW\"] = 500] = \"LOW\";\n    })(RongIMLib.LoggerStoreSize || (RongIMLib.LoggerStoreSize = {}));\n    var LoggerStoreSize = RongIMLib.LoggerStoreSize;\n    var LoggerType = (function () {\n        function LoggerType() {\n        }\n        LoggerType.IM = 'IM';\n        LoggerType.RTC = 'RTC';\n        return LoggerType;\n    })();\n    RongIMLib.LoggerType = LoggerType;\n    var LoggerTag = (function () {\n        function LoggerTag() {\n        }\n        /**\n         * 三段式关键字: \"发起方-任务类型-结果类型\"\n         * A: App 层，L: Lib 层，N: 调用 Native 层接口，P: Protocol 层\n         * O: 操作，S: 状态，T: 任务，R: 结果，E: 错误\n         */\n        LoggerTag.IM = {\n            A_INIT_O: 'A-init-O',\n            A_CONN_T: 'A-connect-T',\n            A_CONN_R: 'A-connect-R',\n            A_CONN_E: 'A-connect-E',\n            L_RECO_T: 'L-reconnect-T',\n            L_RECO_R: 'L-reconnect-R',\n            L_RECO_E: 'L-reconnect-E',\n            L_GETN_T: 'L-get_navi-T',\n            L_GETN_R: 'L-get_navi-R',\n            L_PING_WS_T: 'L-ping_ws-T',\n            L_PING_WS_R: 'L-ping_ws-R',\n            L_NETC_S: 'L-network_changed-S',\n            A_DISC_O: 'A-disconnect-O',\n            A_JCTR_T: 'A-join_chatroom-T',\n            A_JCTR_R: 'A-join_chatroom-R',\n            A_QCTR_T: 'A-quit_chatroom-T',\n            A_QCTR_R: 'A-quit_chatroom-R',\n            A_INIT_CMD_MSG_E: 'A-instantiate_command_message-E',\n            A_INIT_PROFILE_MSG_E: 'A-instantiate_profile_notify_message-E',\n            A_INIT_CMD_NOTI_MSG_E: 'A-instantiate_command_notify_message-E',\n            L_CHRM_PULL_E: 'L-chatroom_pull-E',\n            L_QUERY_MSG_E: 'L-query_message-E',\n            L_DECODE_MSG_E: 'L-decode_upstream_message-E',\n            L_CATCH_UNKNOWN_MSG_E: 'L-catch_unknown_message-E',\n            L_DECODE_QUERY_DATA_E: 'L-decode_query_data-E',\n            L_PARSE_MSG_E: 'L-parse_message-E',\n            L_WS_ERR_E: 'L-websocket-error-E',\n            G_CRAW_E: 'G-crash-E',\n            G_UP_LOG_S: 'G-upload_log-S',\n            G_UP_LOG_E: 'G-upload_log-E'\n        };\n        return LoggerTag;\n    })();\n    RongIMLib.LoggerTag = LoggerTag;\n    var LoggerReportType = (function () {\n        function LoggerReportType() {\n        }\n        LoggerReportType.REAL_TIME_LOG = 'RealTimeLog';\n        LoggerReportType.MSG_NOTIF_LOG = 'MessageNotificationLog';\n        return LoggerReportType;\n    })();\n    RongIMLib.LoggerReportType = LoggerReportType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Logger = (function () {\n        function Logger() {\n        }\n        Logger.writeLog = function (log) {\n            var self = this;\n            if (RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\") {\n                return;\n            }\n            var networkUnavailable = RongIMLib.RongIMClient._memoryStore.networkUnavailable;\n            var isLowLevelBro = RongIMLib.LoggerUtil.isLowLevelBro();\n            log.time = new Date().getTime();\n            log.sessionId = RongIMLib.LoggerUtil.getSessionId();\n            log.content = log.content && JSON.stringify(log.content);\n            if (networkUnavailable) {\n                if (log.level == RongIMLib.LoggerLevel.E || log.level == RongIMLib.LoggerLevel.W) {\n                    log.level = RongIMLib.LoggerLevel.I;\n                }\n            }\n            self.logStore.push(log);\n            var _handleOverflowLog = function (size) {\n                if (self.logStore.length > size) {\n                    var delLength = self.logStore.length - size;\n                    self.logStore.splice(0, delLength);\n                }\n            };\n            if (isLowLevelBro) {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.LOW);\n            }\n            else {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.ADVANCED);\n            }\n        };\n        Logger.reportRTLog = function () {\n            var self = this;\n            var isUserCloseLogger = RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\";\n            if (self.loggerCache.hasStarted || isUserCloseLogger) {\n                return;\n            }\n            self.loggerCache.hasStarted = true;\n            var policy = this.defaultLogPolicy;\n            var isDefaultUpload = true;\n            var currentTime = 1;\n            var _robustUpload = function () {\n                var isOpen = policy.logSwitch;\n                var itv = policy.itv * 1000;\n                var times = policy.times;\n                var url = policy.url;\n                var level = policy.level;\n                var realItv = itv * Math.pow(2, currentTime - 1);\n                if (currentTime < times) {\n                    currentTime++;\n                }\n                if (!isOpen) {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: level, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: url, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    if (self.loggerCache.isNewNavi) {\n                        currentTime = 1;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        self.loggerCache.isNewNavi = false;\n                    }\n                    if (isDefaultUpload) {\n                        currentTime = 1;\n                        isDefaultUpload = false;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy(); // 更新 navi 中配置下次用\n                        if (RongIMLib.RongUtil.isPrivateService()) {\n                            //私有云关闭默认第一次上传，私有云没有默认上传地址，值能通过导航下发的配置上传\n                            _robustUpload();\n                            return;\n                        }\n                    }\n                    if (csvLog.length == 0) {\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        _robustUpload();\n                        return;\n                    }\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: policy.timeout * 1000,\n                        success: function (data) {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log'\n                                } });\n                            //第一次成功后，如果导航有数据使用导航数据，导航无数据关闭上传。第二次上传成功后返回数据使用返回数据\n                            if (!isOpen) {\n                                return;\n                            }\n                            if (data) {\n                                data = JSON.parse(data);\n                                policy.itv = data.nextTime;\n                                policy.level = data.level;\n                                policy.logSwitch = data.logSwitch;\n                                currentTime = 1;\n                            }\n                            _robustUpload();\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, realItv);\n            };\n            _robustUpload();\n        };\n        Logger.reportMNLog = function (policy) {\n            var self = this;\n            var currentTime = 1;\n            var connectTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n            if (policy.platform !== 'Web' || policy.logId === self.loggerCache.logId) {\n                return;\n            }\n            self.loggerCache.logId = policy.logId;\n            var _robustUpload = function () {\n                var itv = 5000;\n                var times = 3;\n                itv = itv * Math.pow(2, currentTime - 2);\n                if (currentTime === 1) {\n                    itv = 0;\n                }\n                if (currentTime <= times) {\n                    currentTime++;\n                }\n                else {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: RongIMLib.LoggerLevel.D, startTime: policy.startTime, endTime: policy.endTime, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    if (csvLog.length === 0 && policy.endTime < connectTime) {\n                        //没有日志且连接时间大于日志消息结束时间，说明此日志消息过期，无需上传\n                        return;\n                    }\n                    else if (csvLog.length === 0 && policy.endTime > connectTime) {\n                        //没有日志且连接时间小于日志消息结束时间，说明用户连接时间在需要获取的时间内,没有日志上传 nodata\n                        csvLog = 'nodata';\n                    }\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: policy.uri, logId: policy.logId, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: self.defaultLogPolicy.timeout * 1000,\n                        success: function () {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log'\n                                } });\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, itv);\n            };\n            _robustUpload();\n        };\n        Logger.logStore = [];\n        Logger.defaultLogPolicy = {\n            \"logSwitch\": 1,\n            \"url\": 'logcollection.ronghub.com/',\n            \"level\": RongIMLib.LoggerLevel.E,\n            \"itv\": 20,\n            \"times\": 5,\n            \"timeout\": 15\n        };\n        Logger.loggerCache = {\n            userId: '',\n            logId: 'none',\n            isNewNavi: false,\n            hasStarted: false\n        };\n        return Logger;\n    })();\n    RongIMLib.Logger = Logger;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LoggerUtil = (function () {\n        function LoggerUtil() {\n        }\n        LoggerUtil.isLowLevelBro = function () {\n            var flag = false;\n            var bro = RongIMLib.RongUtil.getBrower();\n            if (bro.type == 'IE' && bro.version < 9) {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.isRealTimeLogType = function (type) {\n            return type === RongIMLib.LoggerReportType.REAL_TIME_LOG;\n        };\n        LoggerUtil.handleLog = function (conf) {\n            var self = this;\n            var csvLog = '';\n            var logs = RongIMLib.Logger.logStore;\n            var lastIndex = 0;\n            if (self.isRealTimeLogType(conf.type)) {\n                RongIMLib.RongUtil.forEach(logs, function (log, index) {\n                    if (log.time > self.lastTime && log.level <= conf.level) {\n                        csvLog += self.genCSVLog(log);\n                        lastIndex = index;\n                    }\n                });\n                if (csvLog.length !== 0) {\n                    self.lastTime = logs[lastIndex].time;\n                }\n            }\n            else {\n                RongIMLib.RongUtil.forEach(logs, function (log) {\n                    if (log.level <= conf.level && log.time >= conf.startTime && log.time <= conf.endTime) {\n                        csvLog += self.genCSVLog(log);\n                    }\n                });\n            }\n            return csvLog;\n        };\n        LoggerUtil.getNaviPolicy = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            var fullNavi = navi && JSON.parse(navi);\n            var policy = {};\n            var logPolicy = fullNavi.logPolicy || \"{}\";\n            var logSwitch = fullNavi.logSwitch;\n            policy = logPolicy && JSON.parse(logPolicy);\n            policy.logSwitch = logSwitch;\n            return policy;\n        };\n        LoggerUtil.genDeviceId = function () {\n            var deviceId = '';\n            var key = 'deviceId';\n            var isSupportLS = RongIMLib.RongUtil.supportLocalStorage();\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            var loggerStorage;\n            if (isSupportLS) {\n                loggerStorage = new RongIMLib.LocalStorageProvider();\n            }\n            else if (isSupportSS) {\n                loggerStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                loggerStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasDeviceId = loggerStorage.getItem(key);\n            if (hasDeviceId) {\n                deviceId = loggerStorage.getItem(key);\n            }\n            else {\n                loggerStorage.removeItem(key);\n                var uuid = RongIMLib.RongUtil.getUUID22();\n                loggerStorage.setItem(key, uuid);\n                deviceId = uuid;\n            }\n            return deviceId;\n        };\n        LoggerUtil.getSessionId = function () {\n            var sessionId = '';\n            var key = 'sessionId';\n            var sessionStorage;\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            if (isSupportSS) {\n                sessionStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                sessionStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasSessionId = sessionStorage.getItem(key);\n            if (hasSessionId) {\n                sessionId = sessionStorage.getItem(key);\n            }\n            else {\n                sessionStorage.removeItem(key);\n                var val = RongIMLib.RongUtil.getUUID22();\n                sessionStorage.setItem(key, val);\n                sessionId = val;\n            }\n            return sessionId;\n        };\n        LoggerUtil.getDeviceInfo = function () {\n            var self = this;\n            var browerInfo = RongIMLib.RongUtil.getBrower();\n            var sessionId = self.getSessionId().slice(0, 10);\n            var infoTpl = '{brower}|{version}|{sessionId}';\n            return RongIMLib.RongUtil.tplEngine(infoTpl, {\n                brower: browerInfo.type,\n                version: browerInfo.version,\n                sessionId: sessionId\n            });\n        };\n        LoggerUtil.getEntireUrl = function (opt) {\n            var self = this;\n            var tLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var mLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var entireUrl = '';\n            var protocol = \"https://\";\n            if (location.protocol == \"http:\") {\n                protocol = \"http://\";\n            }\n            var paramObj = {\n                protocol: protocol,\n                url: opt.url,\n                version: RongIMLib.RongIMClient.sdkver || 'Unknown version',\n                appkey: RongIMLib.RongIMClient._memoryStore.appKey || 'Unknown appkey',\n                deviceId: self.genDeviceId(),\n                deviceInfo: self.getDeviceInfo(),\n                platform: 'Web',\n                userId: RongIMLib.Logger.loggerCache.userId || ''\n            };\n            if (self.isRealTimeLogType(opt.type)) {\n                entireUrl = RongIMLib.RongUtil.tplEngine(tLogTpl, paramObj);\n            }\n            else {\n                entireUrl = RongIMLib.RongUtil.tplEngine(mLogTpl, RongIMLib.RongUtil.extend(paramObj, {\n                    logId: opt.logId\n                }));\n            }\n            return entireUrl;\n        };\n        LoggerUtil.genCSVLog = function (log) {\n            var tpl = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n            if (log.content) {\n                var content = '\"' + log.content.replace(/\\\"/g, '\"\"') + '\"';\n            }\n            var csvLog = RongIMLib.RongUtil.tplEngine(tpl, {\n                sessionId: log.sessionId,\n                time: log.time,\n                type: log.type,\n                level: log.level,\n                tag: log.tag,\n                content: content || '\"\"'\n            });\n            return csvLog;\n        };\n        LoggerUtil.isLogCmdMsg = function (message) {\n            var flag = false;\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"LogCommandMessage\"] && message.senderUserId === 'rongcloudsystem') {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.recordFatalLogOfNavi = function (internalRetry, navigators) {\n            if (internalRetry === 3) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                        desc: 'Request navigation failed 3 times',\n                        navigators: navigators\n                    } });\n            }\n        };\n        LoggerUtil.lastTime = 0;\n        return LoggerUtil;\n    })();\n    RongIMLib.LoggerUtil = LoggerUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var sessionStorageProvider = (function () {\n        function sessionStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n        }\n        sessionStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.setItem(composedKey, object);\n            }\n        };\n        sessionStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return sessionStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return '';\n        };\n        sessionStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        sessionStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        sessionStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.removeItem(composedKey.toString());\n            }\n        };\n        sessionStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in sessionStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        sessionStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(sessionStorage).length;\n        };\n        return sessionStorageProvider;\n    })();\n    RongIMLib.sessionStorageProvider = sessionStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback, null, {\n                                    isIgnoreReportStart: true\n                                });\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isNull = function (val) {\n            return Object.prototype.toString.call(val) == '[object Null]';\n        };\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function' || typeof XDomainRequest == 'object';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var body = opts.body;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var timeout = opts.timeout;\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            if (timeout) {\n                xhr.timeout = timeout;\n            }\n            if (body) {\n                xhr.send(body);\n                return xhr;\n            }\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.getLocalProtocol = function () {\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol === 'https:') {\n                return 'https://';\n            }\n            else {\n                return 'http://';\n            }\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getValidNavi = function (naviHost) {\n            var HttpProtocol = RongIMLib.RongIMClient.HttpProtocol;\n            var flag = '://';\n            var index = naviHost.indexOf(flag);\n            var hasProtocol = index > -1;\n            var navi = naviHost;\n            if (!hasProtocol) {\n                var protocol = RongIMLib.RongIMClient.getProtocol().protocol;\n                navi = protocol + naviHost;\n            }\n            var naviProtocol = RongUtil.getUrlProtocol(navi), localProtocol = RongUtil.getLocalProtocol();\n            // 本地为 https, 但却传入 http 时, 强制转化为 https\n            if (naviProtocol === HttpProtocol.http && localProtocol === 'https://') {\n                navi = RongUtil.formatProtoclPath({\n                    path: navi,\n                    tmpl: '{0}{1}',\n                    protocol: HttpProtocol.https,\n                    sub: true\n                });\n            }\n            return navi;\n        };\n        RongUtil.getUrlProtocol = function (url) {\n            var flag = '://';\n            var index = url.indexOf(flag);\n            if (index > -1) {\n                return url.substring(0, index + flag.length);\n            }\n            else {\n                return 'https://';\n            }\n            ;\n        };\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        RongUtil.supportSessionStorage = function () {\n            var support = false;\n            if (typeof sessionStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    sessionStorage.setItem(key, value);\n                    var localVal = sessionStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('sessionStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.isValidWsUrl = function (url) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            return invalidWsUrls.indexOf(url) === -1 && !RongUtil.isEmpty(url);\n        };\n        RongUtil.getBrower = function () {\n            var userAgent = navigator.userAgent;\n            var version;\n            var type;\n            /* 记录各浏览器名字和匹配条件 */\n            var condition = {\n                IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n                Edge: /Edge\\/([\\d.]+)/,\n                Firefox: /Firefox\\/([\\d.]+)/,\n                Opera: /(?:OPERA|OPR).([\\d.]+)/,\n                WeChat: /MicroMessenger\\/([\\d.]+)/,\n                QQBrowser: /QQBrowser\\/([\\d.]+)/,\n                Chrome: /Chrome\\/([\\d.]+)/,\n                Safari: /Version\\/([\\d.]+).*Safari/,\n                iOSChrome: /Mobile\\/([\\d.]+).*Safari/\n            };\n            for (var key in condition) {\n                if (!condition.hasOwnProperty(key))\n                    continue;\n                var browserContent;\n                if (browserContent = userAgent.match(condition[key])) {\n                    type = key;\n                    version = browserContent[1] || browserContent[2];\n                    break;\n                }\n            }\n            return {\n                type: type || 'UnKonw',\n                version: version || 'UnKonw'\n            };\n        };\n        RongUtil.string10to64 = function (number) {\n            var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''), radix = chars.length + 1, qutient = +number, arr = [];\n            do {\n                var mod = qutient % radix;\n                qutient = (qutient - mod) / radix;\n                arr.unshift(chars[mod]);\n            } while (qutient);\n            return arr.join('');\n        };\n        RongUtil.getUUID = function () {\n            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n                var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n                return v.toString(16);\n            });\n        };\n        /* 获取 22 位的 UUID */\n        RongUtil.getUUID22 = function () {\n            var uuid = this.getUUID();\n            uuid = uuid.replace(/-/g, '') + 'a';\n            uuid = parseInt(uuid, 16);\n            uuid = this.string10to64(uuid);\n            if (uuid.length > 22) {\n                uuid = uuid.slice(0, 22);\n            }\n            if (uuid.length < 22) {\n                var len = 22 - uuid.length;\n                for (var i = 0; i < len; i++) {\n                    uuid = uuid + '0';\n                }\n            }\n            return uuid;\n        };\n        RongUtil.getByteLength = function (str, charset) {\n            charset = charset || 'utf-8';\n            var total = 0, chatCode;\n            if (charset === 'utf-16') {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode <= 0xffff) {\n                        total += 2;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            else {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode < 0x007f) {\n                        total += 1;\n                    }\n                    else if (chatCode <= 0x07ff) {\n                        total += 2;\n                    }\n                    else if (chatCode <= 0xffff) {\n                        total += 3;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            return total;\n        };\n        RongUtil.concat = function (before, after, isDedup) {\n            RongUtil.forEach(after, function (item) {\n                if (!isDedup || RongUtil.indexOf(before, item) === -1) {\n                    before.push(item);\n                }\n            });\n            return before;\n        };\n        RongUtil.getCurrentDate = function (seperator) {\n            var date = new Date();\n            var year = date.getFullYear();\n            var month = date.getMonth() + 1;\n            var day = date.getDate();\n            return RongUtil.tplEngine('{year}{seperator}{month}{seperator}{day}', {\n                year: year,\n                month: month,\n                day: day,\n                seperator: seperator\n            });\n        };\n        RongUtil.generateUploadFileName = function (type, fileName) {\n            var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n            var random = Math.floor((Math.random() * 1000) % 10000);\n            var uuid = this.getUUID();\n            var fileNameArr, extension;\n            if (fileName) {\n                fileNameArr = fileName.split('.');\n                extension = '.' + fileNameArr[fileNameArr.length - 1];\n            }\n            return RongUtil.tplEngine(tpl, {\n                type: type,\n                date: RongUtil.getCurrentDate('-'),\n                random: random,\n                uuid: uuid,\n                timestamp: RongUtil.getTimestamp(),\n                extension: extension || ''\n            });\n        };\n        RongUtil.isPrivateService = function () {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            return isNaviJSONP && isWSPingJSONP;\n        };\n        RongUtil.getObjectKeys = function (obj) {\n            var source = JSON.parse(JSON.stringify(obj));\n            var keys = [];\n            for (var key in source) {\n                keys.push(key);\n            }\n            return keys;\n        };\n        RongUtil.Prosumer = Prosumer;\n        RongUtil.Storage = {\n            set: function (key, value) {\n                try {\n                    RongIMLib.RongIMClient._storageProvider.setItem(key, JSON.stringify(value));\n                }\n                catch (e) { }\n            },\n            get: function (key) {\n                var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n                try {\n                    return JSON.parse(value);\n                }\n                catch (e) {\n                    return {};\n                }\n            }\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n    var Base64 = (function () {\n        function Base64() {\n        }\n        Base64.utf8_encode = function (string) {\n            string = string.replace(/\\r\\n/g, \"\\n\");\n            var utftext = \"\";\n            for (var n = 0; n < string.length; n++) {\n                var c = string.charCodeAt(n);\n                if (c < 128) {\n                    utftext += String.fromCharCode(c);\n                }\n                else if ((c > 127) && (c < 2048)) {\n                    utftext += String.fromCharCode((c >> 6) | 192);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n                else {\n                    utftext += String.fromCharCode((c >> 12) | 224);\n                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n            }\n            return utftext;\n        };\n        Base64.utf8_decode = function (utftext) {\n            var string = \"\";\n            var i = 0;\n            var c = 0, c1 = 0, c2 = 0, c3;\n            while (i < utftext.length) {\n                c = utftext.charCodeAt(i);\n                if (c < 128) {\n                    string += String.fromCharCode(c);\n                    i++;\n                }\n                else if ((c > 191) && (c < 224)) {\n                    c2 = utftext.charCodeAt(i + 1);\n                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n                    i += 2;\n                }\n                else {\n                    c2 = utftext.charCodeAt(i + 1);\n                    c3 = utftext.charCodeAt(i + 2);\n                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n                    i += 3;\n                }\n            }\n            return string;\n        };\n        Base64.encode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = this.utf8_encode(input);\n            while (i < input.length) {\n                chr1 = input.charCodeAt(i++);\n                chr2 = input.charCodeAt(i++);\n                chr3 = input.charCodeAt(i++);\n                enc1 = chr1 >> 2;\n                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n                enc4 = chr3 & 63;\n                if (isNaN(chr2)) {\n                    enc3 = enc4 = 64;\n                }\n                else if (isNaN(chr3)) {\n                    enc4 = 64;\n                }\n                output = output +\n                    this.keyStr.charAt(enc1) + this.keyStr.charAt(enc2) +\n                    this.keyStr.charAt(enc3) + this.keyStr.charAt(enc4);\n            }\n            return output;\n        };\n        Base64.decode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3;\n            var enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n            while (i < input.length) {\n                enc1 = this.keyStr.indexOf(input.charAt(i++));\n                enc2 = this.keyStr.indexOf(input.charAt(i++));\n                enc3 = this.keyStr.indexOf(input.charAt(i++));\n                enc4 = this.keyStr.indexOf(input.charAt(i++));\n                chr1 = (enc1 << 2) | (enc2 >> 4);\n                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n                chr3 = ((enc3 & 3) << 6) | enc4;\n                output = output + String.fromCharCode(chr1);\n                if (enc3 != 64) {\n                    output = output + String.fromCharCode(chr2);\n                }\n                if (enc4 != 64) {\n                    output = output + String.fromCharCode(chr3);\n                }\n            }\n            output = this.utf8_decode(output);\n            return output;\n        };\n        Base64.keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n        return Base64;\n    })();\n    RongIMLib.Base64 = Base64;\n    var TextCompressor = (function () {\n        function TextCompressor() {\n        }\n        TextCompressor.compress = function (data) {\n            var self = this;\n            var map = {};\n            //构建一个用于反向查询字符位置的 map\n            for (var p = 0; p < data.length - 1; p++) {\n                var c1 = data.charAt(p);\n                var c2 = data.charAt(p + 1);\n                var c = c1 + c2;\n                if (!map.hasOwnProperty(c)) {\n                    map[c] = [p];\n                    continue;\n                }\n                map[c].push(p);\n            }\n            var compressedData = [], normalBlockBuffer = [];\n            //编码未压缩数据块\n            var encodeNormalBlock = function () {\n                if (normalBlockBuffer.length > 0) {\n                    var normalBlock = normalBlockBuffer.join('');\n                    normalBlockBuffer = [];\n                    if (normalBlock.length > 26) {\n                        var normalExtBlockLength = self.numberEncode(normalBlock.length);\n                        var normalExtBlockHeader = String.fromCharCode(self.dataType.NormalExt | normalExtBlockLength.length);\n                        compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n                    }\n                    else {\n                        var normalBlockHeader = String.fromCharCode(self.dataType.Normal | normalBlock.length);\n                        compressedData.push(normalBlockHeader);\n                    }\n                    compressedData.push(normalBlock);\n                }\n            };\n            var i = 0;\n            while (i < data.length) {\n                var r = self.indexOf(map, data, i);\n                if (r.length < 2) {\n                    normalBlockBuffer.push(data.charAt(i++));\n                    continue;\n                }\n                if (r.length < 4) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                var offset = self.numberEncode(i - r.offset);\n                var length = self.numberEncode(r.length);\n                //欲压缩的数据与数据编码后的长度一致，则不进行压缩\n                if (offset.length + length.length >= r.length) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                //编码未压缩数据块\n                encodeNormalBlock();\n                //编码压缩数据块\n                var compressedBlockHeader = String.fromCharCode(self.dataType.Compressed | (offset.length << 2) | length.length);\n                compressedData.push(compressedBlockHeader + offset + length);\n                i += r.length;\n            }\n            //编码剩余未压缩数据块\n            encodeNormalBlock();\n            //在数据尾部添加校验和\n            var dataLengthTo62 = self.numberEncode(data.length);\n            var tailBlockHeader = String.fromCharCode(self.dataType.Tail | dataLengthTo62.length);\n            compressedData.push(tailBlockHeader + dataLengthTo62);\n            return compressedData.join('');\n        };\n        TextCompressor.uncompress = function (data) {\n            var self = this;\n            var i = 0;\n            var result = \"\";\n            label1: do {\n                var header = data.charCodeAt(i++);\n                var headerType = header & self.dataType.Mark;\n                var headerVal = header & 0xF;\n                switch (headerType) {\n                    case self.dataType.Compressed:\n                        var p1 = headerVal >> 2;\n                        var p2 = headerVal & 3;\n                        if (p1 == 0 || p2 == 0) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        var offset = self.numberDecode(data.substr(i, p1));\n                        var len = self.numberDecode(data.substr(i += p1, p2));\n                        offset = result.length - offset;\n                        if (offset + len > result.length) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += p2;\n                        result += result.substr(offset, len);\n                        break;\n                    case self.dataType.Tail:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        if (num != result.length) {\n                            console.log(result.length);\n                            console.log(num);\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += headerVal;\n                        break label1;\n                    case self.dataType.NormalExt:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        result += data.substr(i += headerVal, num);\n                        i += num;\n                        break;\n                    case self.dataType.Normal:\n                        result += data.substr(i, headerVal);\n                        i += headerVal;\n                        break;\n                    case self.dataType.Mark:\n                        if (headerVal > 10) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        result += data.substr(i, 16 + headerVal);\n                        i += (16 + headerVal);\n                        break;\n                    default:\n                        throw new Error(\"Data parsing error,at \" + i + \" header:\" + headerType);\n                }\n            } while (i < data.length);\n            return result;\n        };\n        TextCompressor.indexOf = function (map, source, fromIndex) {\n            var self = this;\n            var result = {\n                length: 0,\n                offset: -1\n            };\n            var sourceLength = source.length;\n            if (fromIndex >= source.length - 1) {\n                return result;\n            }\n            var c1 = source.charAt(fromIndex);\n            var c2 = source.charAt(fromIndex + 1);\n            var items = map[c1 + c2];\n            if (items[0] == fromIndex) {\n                return result;\n            }\n            var space1 = source.length - fromIndex;\n            var lastChar;\n            for (var i = 0, len = items.length; i < len; i++) {\n                var item = items[i];\n                var space2 = fromIndex - item;\n                if (space2 > self.max) {\n                    continue;\n                }\n                var end = Math.min(space1, space2);\n                if (end <= result.length) {\n                    break;\n                }\n                if (result.length > 2) {\n                    if (source.charAt(item + result.length - 1) != source.charAt(fromIndex + result.length - 1)) {\n                        continue;\n                    }\n                }\n                var m = 2;\n                for (var j = m; j < end; j++) {\n                    if (source.charAt(item + j) == source.charAt(fromIndex + j)) {\n                        m++;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                if (m >= result.length) {\n                    result.length = m;\n                    result.offset = item;\n                }\n            }\n            return result;\n        };\n        /*\n        * 将数字转化为 62 进制字符串。\n        */\n        TextCompressor.numberEncode = function (num) {\n            var self = this;\n            var result = [], remainder = 0;\n            do {\n                remainder = num % self.scale;\n                result.push(self.chars.charAt(remainder));\n                num = (num - remainder) / self.scale;\n            } while (num > 0);\n            return result.join('');\n        };\n        /*\n        * 将 62 进制字符串还原为数字。\n        */\n        TextCompressor.numberDecode = function (str) {\n            var self = this;\n            var num = 0, index = 0;\n            for (var i = str.length - 1; i >= 0; i--) {\n                index = self.chars.indexOf(str.charAt(i));\n                if (index == -1) {\n                    throw new Error(\"decode number error, data is \\\"\" + str + \"\\\"\");\n                }\n                num = num * self.scale + index;\n            }\n            return num;\n        };\n        TextCompressor.dataType = {\n            Tail: 0x30,\n            Compressed: 0x40,\n            NormalExt: 0x50,\n            Normal: 0x60,\n            Mark: 0x70\n        };\n        TextCompressor.chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n        TextCompressor.scale = TextCompressor.chars.length;\n        TextCompressor.max = 238327;\n        return TextCompressor;\n    })();\n    RongIMLib.TextCompressor = TextCompressor;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat    \n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "chatroom-h5/js/chatroom.js",
    "content": "; (function (global, factory, namespace) {\n\tif (typeof exports === 'object' && typeof module !== 'undefined') {\n\t\tmodule.exports = factory();\n\t} else if (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t} else {\n\t\tglobal[namespace] = factory();\n\t}\n})(window, function () {\n\t\"use strict\";\n\n\tfunction initApp(appInfo, callbacks) {\n\t\twindow.RongIM = window.RongIM || {};\n\t\tvar RongIMLib = window.RongIMLib;\n\t\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\t\tif (RongIM.ready) {\n\t\t\tcallbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t\tcallbacks.onConnected && callbacks.onConnected(RongIM.instance, RongIM.userInfo);\n\t\t\treturn;\n\t\t} else {\n\t\t\tvar appKey = appInfo.appKey;\n\t\t\tvar token = appInfo[id];\n\n\t\t\tRongIMLib.RongIMClient.init(appKey);\n\t\t\tregisterMessageType();\n\n\t\t\tRongIMClient.connect(token, {\n\t\t\t\tonSuccess: function (userId) {\n\t\t\t\t\tRongIM.ready = true;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata: { userId: userId },\n\t\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\t\tinfo: \"链接成功\"\n\t\t\t\t\t};\n\t\t\t\t\tcallbacks.onConnected && callbacks.onConnected(RongIM.instance, RongIM.userInfo);\n\t\t\t\t},\n\t\t\t\tonError: function (errorCode) {\n\t\t\t\t\tRongIM.ready = false;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata: {},\n\t\t\t\t\t\tstatus: \"fail\",\n\t\t\t\t\t\tinfo: errorCode\n\t\t\t\t\t};\n\n\t\t\t\t\tfor (var i = 0, len = onConnectList.length; i < len; i++) {\n\t\t\t\t\t\tonConnectList[i](RongIM.instance, RongIM.userInfo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tRongIMClient.setConnectionStatusListener({\n\t\t\tonChanged: function (status) {\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t\t\t\tRongIM.instance = RongIMClient.getInstance();\n\t\t\t\t\t\tcallbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tRongIMClient.setOnReceiveMessageListener({\n\t\t\tonReceived: function (message) {\n\t\t\t\tcallbacks.onMessage && callbacks.onMessage(message)\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction initChatRoom(appInfo, chatRoomInfo, callbacks, modules) {\n\t\tvar chatRoomId = chatRoomInfo.chatRoomId;\n\t\tvar count = chatRoomInfo.count;\n\n\t\twindow.chatRoomCallbacks = {};\n\n\t\tvar initCallbacks = {\n\t\t\tonReady: function (_instance) {\n\t\t\t},\n\t\t\tonMessage: function (message) {\n\t\t\t\tvar onMessage = callbacks.onMessage;\n\t\t\t\tif (message.conversationType == 4 && message.targetId == chatRoomId) {\n\t\t\t\t\tonMessage(message);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonConnected: function (IM, userInfo) {\n\t\t\t\tIM.joinChatRoom(chatRoomId, count, {\n\t\t\t\t\tonSuccess: function () {\n\t\t\t\t\t\tvar chatRoom = {\n\t\t\t\t\t\t\tid: chatRoomId,\n\t\t\t\t\t\t\tcurrentUser: userInfo.data,\n\t\t\t\t\t\t\tgetInfo: function (params, callbacks) {\n\t\t\t\t\t\t\t\tvar order = params.order;\n\t\t\t\t\t\t\t\tvar memberCount = params.memberCount;\n\t\t\t\t\t\t\t\tIM.getChatRoomInfo(chatRoomId, memberCount, order, callbacks);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tquit: function (callbacks) {\n\t\t\t\t\t\t\t\tIM.quitChatRoom(chatRoomId, callbacks);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsendMessage: function (msg, callbacks) {\n\t\t\t\t\t\t\t\tvar conversationType = RongIMLib.ConversationType.CHATROOM;\n\t\t\t\t\t\t\t\tIM.sendMessage(conversationType, chatRoomId, msg, callbacks);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcallbacks.onSuccess && callbacks.onSuccess(chatRoom);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function (error) {\n\t\t\t\t\t\tcallbacks.onError && callbacks.onError(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tinitApp(appInfo, initCallbacks);\n\t}\n\n\tfunction registerMessageType() {\n\t\tvar messageName = 'PersonMessage';\n\t\tvar objectName = 's:person';\n\t\tvar isCounted = true;\n\t\tvar isPersited = true;\n\t\tvar mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited);\n\t\tvar prototypes = ['name', 'portrait', 'id'];\n\t\tRongIMClient.registerMessageType(messageName, objectName, mesasgeTag, prototypes);\n\n\t\tvar messageName = 'LikerMessage';\n\t\tvar objectName = 's:liker';\n\t\tvar isCounted = false;\n\t\tvar isPersited = false;\n\t\tvar mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited);\n\t\tvar prototypes = ['likerNum'];\n\t\tRongIMClient.registerMessageType(messageName, objectName, mesasgeTag, prototypes);\n\n\t}\n\treturn {\n\t\tinit: initChatRoom\n\t};\n}, \"RongChatRoom\");"
  },
  {
    "path": "chatroom-h5/js/demo.js",
    "content": "var ht = new HeartsFlow({\n  canvasEl: '.rc-hearts-canvas',\n  amount: 1\n});\n\nvar lastTime = new Date(), num = 1, t;\nvar id = window.location.search.replace('?id=', '');\nappInfo.id = id;\n\nconst messageEvent = {\n  'TextMessage': updateMessage,\n  'PersonMessage': userJoinMeeage,\n  'LikerMessage': updateLiker\n}\n\nconst chatRoomInfo = {\n  \"chatRoomId\": \"chatRoomId-001\",\n  \"count\": 0\n};\n// (function () {\n//emoji表情\n// var RongIMEmoji = RongIMLib.RongIMEmoji;\n// window.RongIMEmoji = RongIMEmoji;\n// RongIMEmoji.init();\n\n// var panel = document.getElementById(\"rc-emoji-panel\");\n// var panelBtn = document.getElementById(\"rc-chatroom-emoji\");\nvar input = document.getElementById(\"rc-chatroom-input\");\nvar btn = document.getElementById(\"rc-chatroom-button\");\n\n// var emojis = RongIMEmoji.list;\n// for (var i = 0; i < 24; i++) {\n// \tvar value = RongIMEmoji.list[i];\n// \tpanel.appendChild(value.node);\n// }\n\n// panelBtn.onclick = function () {\n// \tif (panel.style.display == \"block\") {\n// \t\tpanel.style.display = \"none\";\n// \t} else {\n// \t\tpanel.style.display = \"block\";\n// \t}\n// };\n\n// //表情选择\n// panel.onclick = function (event) {\n// \tvar e = event || window.event;\n// \tvar target = e.target || e.srcElement;\n// \tif (document.all && !document.addEventListener === false) {\n// \t\tconsole.log(target);\n// \t}\n// \tinput.value += RongIMEmoji.symbolToEmoji(target.getAttribute(\"name\"));\n// }\n\n\n\nRongChatRoom.init(appInfo, chatRoomInfo, {\n  onSuccess: function (chatRoom) {\n    var msg = new RongIMClient.RegisterMessage.PersonMessage(getUserInfo(appInfo.id));\n    chatRoom.sendMessage(msg, {\n      onSuccess: function (message) {\n        RongIMLib.chatRoom = chatRoom;\n        var welcomeMessageInfo = {\n          content: {\n            content: \"欢迎来到直播间~ 请自行调节手机音量至合适大小。\"\n          }\n        }\n        updateMessage(welcomeMessageInfo);\n      },\n      onError: function (errorCode, message) {\n        console.log(\"发送聊天室消息失败\", errorCode);\n      }\n    });\n  },\n  onError: function (error) {\n    alert('加入聊天室失败。')\n  },\n  onMessage: function (message) {\n    console.info(message);\n    let event = messageEvent[message.messageType];\n    event(message);\n  }\n});\n\nfunction send() {\n  let content = document.getElementById('rc-chatroom-input').value;\n  if (content) {\n    let messageValue = textMessageInfo = {\n      content: content,\n      user: getUserInfo(RongIMLib.chatRoom.currentUser.userId)\n    }\n    var msg = new RongIMLib.TextMessage(messageValue);\n    RongIMLib.chatRoom.sendMessage(msg, {\n      onSuccess: function (message) {\n        updateMessage(message);\n        document.getElementById('rc-chatroom-input').value = '';\n        document.getElementById('send').style.display = 'none';\n      },\n      onError: function (errorCode, message) {\n        console.log(\"发送聊天室消息失败\", errorCode);\n      }\n    });\n  }\n}\n\nfunction clicLiker() {\n  ht.startAnimation();\n  var nowTime = new Date();\n  if (Math.round(nowTime.getTime() - lastTime.getTime()) < 400) {//判断两次点击之间的时间差\n    num++;\n    lastTime = nowTime;\n    return;\n  }\n  clearTimeout(t)\n  t = setTimeout(() => {\n    let msg = new RongIMClient.RegisterMessage.LikerMessage({ likerNum: num });\n    RongIMLib.chatRoom.sendMessage(msg, {\n      onSuccess: function (message) {\n        lastTime = nowTime;\n        num = 1;\n      },\n      onError: function (errorCode, message) {\n        console.log(\"发送聊天室消息失败\", errorCode);\n      }\n    });\n  }, 400)\n  lastTime = nowTime;\n}\n\nfunction onFocus() {\n  document.getElementById('send').style.display = 'block';\n}\n\nfunction onBlur() {\n  let content = document.getElementById('rc-chatroom-input').value;\n  if (!content) {\n    document.getElementById('send').style.display = 'none';\n  }\n}\n\nfunction updateMessage(message) {\n  var t = document.getElementById(\"rc-message-list\");\n  // message.content.content = RongIMEmoji.symbolToEmoji(message.content.content);\n  var html = renderUI(message);\n  t.innerHTML += html;\n  document.getElementById('rc-message-list-wrapper').scrollTop = document.getElementById('rc-message-list-wrapper').scrollHeight;\n}\n\nfunction userJoinMeeage(message) {\n  var t = document.getElementById(\"rc-user-join\");\n  var html = renderUserUI(message.content);\n  t.innerHTML += html;\n  setTimeout(() => {\n    document.getElementById(message.content.id).remove();\n  }, 1500)\n}\n\nfunction updateLiker(message) {\n  let likerNum = message.content.likerNum\n  if (likerNum) {\n    for (let i = 0; i < likerNum; i++) {\n      ht.startAnimation();\n    }\n  }\n}"
  },
  {
    "path": "chatroom-h5/js/like.js",
    "content": "class HeartsFlow {\n  constructor(data) {\n    this.el = document.querySelector(data.canvasEl);\n    this.w = 200;\n    this.h = 400;\n    this.ctx = this.el.getContext('2d');\n    this.colors = [\n      '255, 137, 164', //'#FF89A4',\n      '239, 121, 138', //'#EF798A',\n      '255, 77, 128', //'#FF4D80',\n      '249, 42, 130' //'#F92A82'\n    ];\n    this.heartsAmount = data.amount;\n    this.heartsList = [];\n    this.isAnimate = false;\n    this.raf = null;\n    this.animate = this.animate.bind(this);\n    this.paintHeart = this.paintHeart.bind(this);\n    this.stopAnimation = this.stopAnimation.bind(this);\n    this.init();\n  }\n  getRandomColor() {\n    return this.colors[Math.floor(Math.random() * this.colors.length)];\n  }\n  getRandom(min, max) {\n    return Math.floor(Math.random() * (max - min) + min);\n  }\n  setHeartsList() {\n    let arr = [];\n    for (let i = 0; i < this.heartsAmount; i++) {\n      let currentSize = this.getRandom(40, 50);\n      let dt = {\n        x: this.w / 2,\n        y: this.h,\n        bx: this.w / 2,\n        by: this.h,\n        pos: this.h,\n        _osp: this.getRandom(10, 500) / 100,\n        osp: this.getRandom(10, 12) / 10,\n        vsp: this.getRandom(currentSize, currentSize + i * 2) / 1500,\n        size: currentSize,\n        color: this.getRandomColor(),\n        alfa: 1\n      };\n\n      arr.push(dt);\n    }\n    this.heartsList = [...this.heartsList, ...arr];\n  }\n  getCoordinates({ x, y, size, color, bx, by, _osp, osp, vsp, pos, alfa }) {\n    return {\n      xst: x,\n      yst: y + size / 2,\n      x0: x - size / 1.4,\n      y0: y + size / 4,\n      x1: x - size / 1.3,\n      y1: y - size / 1.3,\n      _x0: x + size / 1.4,\n      _y0: y + size / 4,\n      _x1: x + size / 1.3,\n      _y1: y - size / 1.3,\n      xfn: x,\n      yfn: y - size / 3,\n      bx: bx,\n      by: by,\n      _osp: _osp,\n      osp: osp,\n      vsp: vsp,\n      pos: pos,\n      alfa: alfa,\n      size: size,\n      color: color\n    };\n\n  }\n  paintHeart({ xst, yst, x0, y0, _x0, _y0, x1, y1, _x1, _y1, xfn, yfn, color, alfa }) {\n    this.ctx.globalCompositeOperation = \"lighter\";\n    this.ctx.beginPath();\n    this.ctx.moveTo(xst, yst);\n    this.ctx.bezierCurveTo(x0, y0, x1, y1, xfn, yfn);\n    this.ctx.moveTo(xst, yst);\n    this.ctx.bezierCurveTo(_x0, _y0, _x1, _y1, xfn, yfn);\n    this.ctx.fillStyle = `rgba(${color}, ${alfa})`;\n    this.ctx.strokeStyle = `rgba(${color}, ${alfa})`;\n    // var img = new Image();\n    // img.src = \"like.svg\";\n    // this.ctx.drawImage(img, 5, 5);\n    this.ctx.fill();\n    this.ctx.stroke();\n    this.ctx.closePath();\n  }\n  mutateData() {\n    this.heartsList = this.heartsList.map(item => {\n      let pos = item.pos - 0.05;\n      let x = item.x + Math.sin(pos * item._osp) * ((pos - item.by) / item.osp);\n      let y = pos + (pos - item.by) / item.vsp * 1.6;\n      let alfa = this.normalize0between1(0, this.h, y).toFixed(1);\n      return {\n        ...item, x: x, y: y, pos: pos, alfa: alfa\n      };\n\n    });\n    this.heartsList = this.heartsList.filter(item => item.y > 0);\n  }\n  normalize0between1(min, max, value) {\n    return (value - min) / (max - min);\n  }\n  setCanvas() {\n    this.el.width = this.w;\n    this.el.height = this.h;\n  }\n  startAnimation() {\n    if (!this.isAnimate) {\n      this.isAnimate = true;\n      console.log('start animation');\n      this.setHeartsList();\n      this.animate();\n    } else {\n      this.setHeartsList();\n    }\n  }\n  stopAnimation() {\n    this.isAnimate = false;\n    console.log('stop animation');\n    cancelAnimationFrame(this.raf);\n  }\n  animate() {\n\n    this.ctx.clearRect(0, 0, this.w, this.h);\n\n    if (this.isAnimate) {\n      for (let i = 0, len = this.heartsList.length; i < len; i++) {\n        let hrt = this.getCoordinates(this.heartsList[i]);\n        this.paintHeart(hrt);\n      }\n      this.mutateData();\n    }\n\n    this.raf = requestAnimationFrame(this.animate);\n\n    if (this.heartsList.length === 0 && this.isAnimate) {\n      this.stopAnimation();\n    }\n  }\n  init() {\n    this.setCanvas();\n    this.setHeartsList();\n    this.animate();\n  }\n}\n\n\n"
  },
  {
    "path": "chatroom-h5/js/mock.js",
    "content": "function getUserInfo(id) {\n  let userList = {\n    '11': {\n      portrait: 'http://rongcloud-image.ronghub.com/004d0444c2a1b9fdaa.png?e=1619758376&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:l2iPse-iWrQj5tT-t5mUUUm510c=',\n      name: 'test_11',\n      id: id\n    }, '22': {\n      portrait: 'http://rongcloud-image.ronghub.com/dd61f5411896b925d2.png?e=1619758397&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:EHGy80kzSdt7NqrHctC4KDYtxP8=',\n      name: 'test_22',\n      id: id\n    }\n  }\n  return userList[id];\n}\n\nconst appInfo = {\n  \"appKey\": \"8w7jv4qb82uyy\",\n  \"22\": \"cC+jhy4U9zbk1xmbzBlI1WoDLREzxk5A@yhxs.cn.rongnav.com;yhxs.cn.rongcfg.com\",\n  \"11\": \"2t6FYf/24Vzk1xmbzBlI1UHrf1LxVs40@yhxs.cn.rongnav.com;yhxs.cn.rongcfg.com\"\n};\n"
  },
  {
    "path": "chatroom-h5/js/render.js",
    "content": "function render(data, template) {\n    template = template || \"\";\n    data = data || [\"\"];\n    var re = /{{((?:(?!}}).)+)}}/g, reExp = /(^( )?(var|if|for|else|switch|case|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n    var add = function (line, js) {\n        js ? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n            (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n        return add;\n    }\n    var match;\n    while (match = re.exec(template)) {\n        add(template.slice(cursor, match.index))(match[1], true);\n        cursor = match.index + match[0].length;\n    }\n    add(template.substr(cursor, template.length - cursor));\n    code += 'return r.join(\"\");';\n\n    data = isNaN(data.length) ? [data] : data;\n    var html = \"\";\n    for (var i = 0, length = data.length; i < length; i++) {\n        html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n    }\n    return html;\n}\n\nfunction renderUI(data, tpl) {\n    var _tpl = data.content.user ? ['<div class=\"rc-message\">',\n        '<div class=\"rc-message-main\">',\n        '<span class=\"rc-message-name\">{{this.content.user.name}} :</span>',\n        '    <span class=\"rc-message-content\">{{this.content.content}}</span>',\n        '</div>',\n        '</div>'].join(\"\") : ['<div class=\"rc-message\">',\n            '<div class=\"rc-message-main\">',\n            '    <span class=\"rc-message-content rc-content-color\">{{this.content.content}}</span>',\n            '</div>',\n            '</div>'].join(\"\");\n    tpl = tpl || _tpl;\n\n    return render(data, tpl);\n}\n\nfunction renderUserUI(data, tpl) {\n    var _tpl = [' <div class=\"rc-user-main\" id=\"{{this.id}}\">',\n        '<img class=\"rc-user-img\" src=\"{{this.portrait}}\">',\n        '<div class=\"rc-user-info\">',\n        '    <span class=\"rc-user-name\">{{this.name}}</span>',\n        '    <span class=\"rc-user-num\">进入了直播间</span>',\n        '</div></div>'].join(\"\");\n    tpl = tpl || _tpl;\n\n    return render(data, tpl);\n}\n"
  },
  {
    "path": "chatroom-h5/style/chatroom.css",
    "content": "body,\nhtml {\n  height: 100%;\n  margin: 0;\n  padding: 0;\n}\n\n#view {\n  width: 100%;\n  height: 100%;\n  position: relative;\n}\n.rc-video-body{\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  background: url(./img/bg.png) no-repeat;\n  background-size: 100% 100%;\n  background-color: #fff;\n  background-size: cover;\n  -webkit-background-size: cover;\n  -o-background-size: cover;\n  background-position: center 0; \n}\nvideo {\n  width: 100%;\n  height: 100%;\n  padding: 0;\n  margin: 0;\n  object-fit: fill;\n}\n\n.rc-chat {\n  width: 310px;\n  height: 100px;\n  background: rgb(0 0 0 / 0.3);\n  border-radius: 60px;\n  position: absolute;\n  top: 40px;\n  left: 40px;\n  font-size: 28px;\n}\n.rc-chat-name, .rc-chat-num, .rc-user-join span{\n  display: block;\n  color: #FFFFFF;\n}\n.rc-chat-name, .rc-user-name{\n  font-size: 36px;\n}\n.rc-chat-img, .rc-user-img{\n  margin: 12px;\n  width: 80px;\n  height: 80px;\n}\n.rc-user-join {\n  height: 100px;\n  position: absolute;\n  bottom: 440px;\n  left: 40px;\n  font-size: 28px;\n \n}\n\n/* .rc-video-body img{\n  width: 100%;\n  height: 100%;\n} */\n.rc-user-main{\n  background: linear-gradient(180deg, rgb(248 99 50 / 0.5) 0%, rgb(248 29 67 / 0.5) 70%);\n  border-radius: 60px;\n  animation:mymove 1.5s;\n  animation-iteration-count:1;\n  \n  /* Safari and Chrome */\n  -webkit-animation:mymove 1.5s;\n  -webkit-animation-iteration-count:1;\n  position: relative;\n}\n@keyframes mymove\n{\nfrom {left:-200px;opacity: 0;}\nto {left:0px;opacity: 1;}\n}\n\n@-webkit-keyframes mymove /* Safari and Chrome */\n{\n  from {left:-200px;opacity: 0;}\n  to {left:0px;opacity: 1;}\n}\n.rc-user-info {\n  display: inline-block;\n  vertical-align: top;\n  padding-right: 20px;\n  padding-top: 6px;\n}\n.rc-chat-info{\n  display: inline-block;\n  vertical-align: top;\n  padding-top: 10px;\n}\n.rc-main {\n  width: 100%;\n  height: 100%;\n  background: #ccc;\n  padding: 0;\n  margin: 0;\n}\n.rc-chatroom * {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.rc-chatroom {\n  position: fixed;\n  bottom: 0;\n  width: 100%;\n  max-height: 400px;\n}\n\n.rc-message-list-wrapper {\n  /* width: 100%;\n  max-height: 300px;\n  overflow: auto;\n  position: relative; */\n  width: 100%;\n  max-height: 300px;\n  overflow: auto;\n  position: absolute;\n  bottom: 140px;\n  font-size: 28px;\n  font-weight: 400;\n  color: #FFFFFF;\n\n}\n\n.rc-message-list {\n  margin: 8px 24px;\n}\n\n.rc-message {\n  color: #FFFFFF;\n  margin: 12px 0;\n}\n.rc-message-main {\n  display: inline-block;\n  background: rgb(0 0 0 / 0.3);\n  border-radius: 26px;\n  padding: 24px;\n  font-size: 28px;\n  line-height: 28px;\n}\n.rc-message-portrait {\n  display: inline-block;\n  float: left;\n  margin: 5px;\n}\n\n.rc-message-portrait img {\n  width: 40px;\n  height: 40px;\n  border: 1px solid #ccc;\n  border-radius: 50%;\n}\n\n.rc-message-name {\n  display: inline-block;\n  color: #FFD451;\n}\n\n.rc-message-content {\n  margin-left: 0.3em;\n  font-size: 27px;\n}\n\n.rc-chatroom-user {\n  /* height: 30px;\n  padding: 5px;\n  padding-bottom: 10px;\n  position: relative; */\n  position: absolute;\n  bottom: 24px;\n  width: calc(100% - 200px);\n  margin: 24px;\n}\n\n.rc-emoji-panel {\n  display: none;\n  width: 19em;\n  border: 1px solid #ccc;\n  padding: 10px;\n  background: #f5f5f5;\n  position: absolute;\n  left: 3px;\n  bottom: 40px;\n}\n\n.rc-chatroom-emoji {\n  line-height: 30px;\n  font-size: 28px;\n  cursor: pointer;\n}\n\n.rc-chatroom-input {\n  /* width: 72%;\n  height: 24px;\n  padding: 2px;\n  border: 1px solid #ccc;\n  background: #f5f5f5; */\n  width: 100%;\n  height: 76px;\n  background: #000000;\n  border-radius: 38px;\n  opacity: 0.3;\n  border: 1px solid #FFFFFF;\n  color: #E0E0E0;\n  font-size: 30px;\n  padding-left: 30px;\n  -web-kit-appearance:none;\n  -moz-appearance: none;\n}\ninput::-webkit-search-cancel-button{\n  -webkit-appearance: none; \n}\n.rc-chatroom-button {\n  background: #333;\n  color: #fff;\n  border-radius: 3px;\n  padding: 6px 20px;\n}\n\n.rc-liker {\n  position: absolute;\n  bottom: 24px;\n  margin: 24px 0;\n  right: 0px;\n}\n\n.rc-hearts-btn {\n  display: flex;\n  position: absolute;\n  /* left: 50%; */\n  width: 76px;\n  height: 76px;\n  border-radius: 50%;\n  border: none;\n  cursor: pointer;\n  background: url(./img/like.svg);\n  transform: translate(-50%, -100%);\n  outline: none;\n  right: 0;\n}\n\n.rc-hearts-btn:hover {\n  background-color: #F92A82;\n}\n\n\n::-webkit-input-placeholder { /* WebKit browsers */\n  color: #E0E0E0;\n}\n\n::-moz-placeholder { /* Mozilla Firefox 19+ */\n  color: #E0E0E0;\n}\n\n:-ms-input-placeholder { /* Internet Explorer 10+ */\n  color: #E0E0E0;\n}   \n\n.rc-content-color{\n  color: #FFD451\n}\n.rc-send {\n  width: 50px;\n  position: absolute;\n  right: 40px;\n  bottom: 10px;\n  display: none;\n}"
  },
  {
    "path": "chatroom-h5-gif/README.md",
    "content": "## 实现功能\nDemo 中实现了集成 2.x SDK 实现聊天室功能，实现聊天室内发送消息，点赞等功能。\n\n## Demo 启动\n可使用 nginx 代理静态页面。\n\n**访问地址**\n\nhttp://localhost:8080/test/chatroom-demo/demo.html?id=11\n\nhttp://localhost:8080/test/chatroom-demo/demo.html?id=22\n\n## Demo 数据修改说明\n\nDemo 使用了假数据进行测试，Demo 访问前需要您替换成您的相关信息。\n\n操作文件：mock.js\n修改位置如下：\n```js\nconst appInfo = {\n  \"appKey\": \"\",\n  \"22\": \"\",\n  \"11\": \"\"\n};\n```\n"
  },
  {
    "path": "chatroom-h5-gif/demo.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\t<meta charset=\"UTF-8\">\n\t<title>挖财钱堂学院理财小白训练</title>\n\t<meta name=\"screen-orientation\" content=\"portrait\">\n\t<meta name=\"x5-orientation\" content=\"portrait\">\n\t<link rel=\"stylesheet\" href=\"./style/chatroom.css\">\n\n\t<meta name=\"viewport\" id=\"viewport\" content=\"width=device-width, initial-scale=0.5, maximum-scale=0.5\">\n</head>\n\n<body>\n\t<div id='view'>\n\t\t<div class=\"rc-main\">\n\t\t\t<div class=\"rc-video-body\"></div>\n\t\t</div>\n\n\t\t<div class=\"rc-chat\">\n\t\t\t<div class=\"rc-chat-main\">\n\t\t\t\t<img class=\"rc-chat-img\" src=\"./style/img/logo.png\">\n\t\t\t\t<div class=\"rc-chat-info\">\n\t\t\t\t\t<span class=\"rc-chat-name\">[直播回顾]</span>\n\t\t\t\t\t<span class=\"rc-chat-num\"><span class=\"rc-content-color\">4208</span> 人次</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"rc-user-join\" id=\"rc-user-join\"></div>\n\t\t<div class=\"rc-chatroom\">\n\t\t\t<div class=\"rc-message-list-wrapper\" id=\"rc-message-list-wrapper\">\n\t\t\t\t<div class=\"rc-message-list\" id=\"rc-message-list\"></div>\n\t\t\t</div>\n\n\t\t\t<div class=\"rc-chatroom-user\">\n\t\t\t\t<!-- <span class=\"rc-chatroom-emoji\" id=\"rc-chatroom-emoji\">😄</span> -->\n\t\t\t\t<div class=\"rc-emoji-panel\" id=\"rc-emoji-panel\"></div>\n\t\t\t\t<div>\n\t\t\t\t\t<input class=\"rc-chatroom-input\" id=\"rc-chatroom-input\" type=\"search\" placeholder=\"说点什么...\"\n\t\t\t\t\t\tonfocus=\"onFocus()\" onblur=\"onBlur()\">\n\t\t\t\t\t<img class=\"rc-send\" id='send' src=\"./style/img/send.png\" alt=\"\" onclick=\"send()\">\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t\t<div class=\"rc-liker\">\n\t\t\t\t<canvas class=\"rc-hearts-canvas\"></canvas>\n\t\t\t\t<button class=\"rc-hearts-btn\" onclick=\"clicLiker()\"></button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t</div>\n\t<script src=\"./js/RongIMLib-2.5.12.js\"></script>\n\t<!-- <script src=\"//cdn.ronghub.com/RongEmoji-2.2.6.js\"></script> -->\n\t<script src=\"./js/chatroom.js\"></script>\n\t<script src=\"./js/like.js\"></script>\n\t<script src=\"./js/render.js\"></script>\n\t<script src=\"./js/mock.js\"></script>\n\t<script src=\"./js/demo.js\"></script>\n\n</body>\n\n<!-- <script src=\"//bb.img.qq.com/bbcdn/common/vconsole.min.js\"></script>\n<script>\n\tvar vConsole = new VConsole();\n</script> -->\n\n</html>"
  },
  {
    "path": "chatroom-h5-gif/js/RongIMLib-2.5.12.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n    Release Date: Fri Sep 18 2020 10:08:16 GMT+0800 (China Standard Time)\n    CodeVersion: 01fe5ba055933bb524b77ed6f348d712dc875e96\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n// console.warn('SDK VERSION:', '01fe5ba055933bb524b77ed6f348d712dc875e96')\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.setExtraContent = function(b){\n                a.extraContent = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.setExtraContent = function (b) {\n                a.extraContent = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 1] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 2] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * JSON 后的消息体超限, 目前最大 128kb\n         * */\n        ErrorCode[ErrorCode[\"RC_MSG_CONTENT_EXCEED_LIMIT\"] = 30016] = \"RC_MSG_CONTENT_EXCEED_LIMIT\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n    (function (TimeoutEnum) {\n        TimeoutEnum[TimeoutEnum[\"CMP\"] = 10000] = \"CMP\";\n    })(RongIMLib.TimeoutEnum || (RongIMLib.TimeoutEnum = {}));\n    var TimeoutEnum = RongIMLib.TimeoutEnum;\n    (function (MessageExpansionErrorCode) {\n        MessageExpansionErrorCode[MessageExpansionErrorCode[\"NOT_SUPPORT\"] = 34008] = \"NOT_SUPPORT\";\n        MessageExpansionErrorCode[MessageExpansionErrorCode[\"SEND_MESSAGE_KV_FAIL\"] = 34009] = \"SEND_MESSAGE_KV_FAIL\";\n        MessageExpansionErrorCode[MessageExpansionErrorCode[\"EXPANSION_LIMIT_EXCEET\"] = 34010] = \"EXPANSION_LIMIT_EXCEET\";\n    })(RongIMLib.MessageExpansionErrorCode || (RongIMLib.MessageExpansionErrorCode = {}));\n    var MessageExpansionErrorCode = RongIMLib.MessageExpansionErrorCode;\n    (function (MsgEpansionLength) {\n        MsgEpansionLength[MsgEpansionLength[\"TOTAL\"] = 300] = \"TOTAL\";\n        MsgEpansionLength[MsgEpansionLength[\"MSG\"] = 20] = \"MSG\";\n        MsgEpansionLength[MsgEpansionLength[\"KEY\"] = 32] = \"KEY\";\n        MsgEpansionLength[MsgEpansionLength[\"VALUE\"] = 64] = \"VALUE\"; // 扩展 value 长度限制\n    })(RongIMLib.MsgEpansionLength || (RongIMLib.MsgEpansionLength = {}));\n    var MsgEpansionLength = RongIMLib.MsgEpansionLength;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            RongIMClient.settingListeners = [];\n            RongIMClient.conversationStatusListeners = [];\n            RongIMClient.messageExpansionListenerUpdated = [];\n            RongIMClient.messageExpansionListenerDeleted = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.4.0.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300,\n                cmpUrl: '' // 若传入 cmpUrl, 则优先链接此地址\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                isFullConversations: false,\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {},\n                networkUnavailable: false,\n                loggerSwitch: options.loggerSwitch || 'on',\n                autoReconnectTimer: null,\n                cmpTimeoutTimer: null\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ReferenceMessage: { objectName: \"RC:ReferenceMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GIFMessage: { objectName: \"RC:GIFMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                SightMessage: { objectName: \"RC:SightMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                LogCommandMessage: { objectName: 'RC:LogCmdMsg', msgTag: new RongIMLib.MessageTag(false, false) },\n                ExpansionCommandMessage: { objectName: \"RC:MsgExMsg\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                ReferenceMessage: \"ReferenceMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                GIFMessage: 'GIFMessage',\n                SightMessage: 'SightMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage',\n                LogCommandMessage: 'LogCommandMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    appKey: appKey\n                } });\n            return sdkInfo;\n        };\n        ;\n        RongIMClient.setProtocol = function (protocol) {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var HttpProtocol = RongIMClient.HttpProtocol;\n            var WsProtocol = RongIMClient.WsProtocol;\n            if (protocol === HttpProtocol.http) {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.http;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.ws;\n            }\n            else {\n                RongIMClient._memoryStore.depend.protocol = HttpProtocol.https;\n                RongIMClient._memoryStore.depend.wsScheme = WsProtocol.wss;\n            }\n        };\n        RongIMClient.getProtocol = function () {\n            RongIMClient._memoryStore.depend = RongIMClient._memoryStore.depend || {};\n            var depend = RongIMClient._memoryStore.depend;\n            var protocol = depend.protocol, wsScheme = depend.wsScheme;\n            if (!protocol || !wsScheme) {\n                protocol = RongIMClient.HttpProtocol.https;\n                wsScheme = RongIMClient.WsProtocol.wss;\n            }\n            return {\n                protocol: protocol,\n                wsScheme: wsScheme\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            if (RongIMLib.IMHandler.isIncludeNavi(token)) {\n                var protocol = RongIMClient._memoryStore.depend.protocol;\n                var currentNavs = RongIMClient._memoryStore.depend.navigaters;\n                var navList = RongIMLib.IMHandler.getNavsByToken(token, protocol);\n                token = RongIMLib.IMHandler.getToken(token);\n                RongIMClient._memoryStore.depend.navigaters = RongIMLib.RongUtil.concat(navList, currentNavs, true);\n            }\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                    RongIMClient.statusListeners.push(listener.onChanged);\n                }\n            }\n        };\n        RongIMClient.setConversationStatusListener = function (listener) {\n            if (listener && listener.onChanged && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.conversationStatusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.setMessageExpansionListener = function (listener) {\n            if (listener && listener.onUpdated && RongIMLib.RongUtil.isFunction(listener.onUpdated)) {\n                RongIMClient.messageExpansionListenerUpdated.push(listener.onUpdated);\n            }\n            if (listener && listener.onDeleted && RongIMLib.RongUtil.isFunction(listener.onDeleted)) {\n                RongIMClient.messageExpansionListenerDeleted.push(listener.onDeleted);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        RongIMClient.watch = function (watchers) {\n            watchers = watchers || {};\n            var setting = watchers.setting;\n            if (RongIMLib.RongUtil.isFunction(setting)) {\n                RongIMClient.settingListeners.push(setting);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                    RongIMClient.messageListeners.push(listener.onReceived);\n                }\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_DISC_O, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM });\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback, version) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback, version);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global|boolean\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            RongIMClient._dataAccessProvider.setConversationStatus(type, targetId, statusItem, callback);\n        };\n        /**\n         * 更新消息扩展属性\n         * @param expansionDic 要更新的消息扩展信息键值对\n         * @param message      要更新的原始消息体\n        */\n        RongIMClient.prototype.updateMessageExpansion = function (expansionDic, message, callback) {\n            RongIMClient._dataAccessProvider.updateMessageExpansion(expansionDic, message, callback);\n        };\n        /**\n         * 删除消息扩展属性\n         * @param keys 消息扩展信息中待删除的 key 的列表\n         * @param message 要删除消息扩展的原始消息体\n        */\n        RongIMClient.prototype.removeMessageExpansionForKey = function (keys, message, callback) {\n            RongIMClient._dataAccessProvider.removeMessageExpansionForKey(keys, message, callback);\n        };\n        /**\n         *删除特定消息内所有扩展信息\n         *@param message 原始消息体\n        */\n        RongIMClient.prototype.removeMessageAllExpansion = function (message, callback) {\n            RongIMClient._dataAccessProvider.removeMessageAllExpansion(message, callback);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback, params);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageSearchField(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            return RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    if (tempConver.msg) {\n                        conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                        conver.latestMessageId = conver.latestMessage.messageId;\n                        conver.objectName = conver.latestMessage.objectName;\n                        conver.receivedStatus = conver.latestMessage.receivedStatus;\n                        conver.receivedTime = conver.latestMessage.receiveTime;\n                        conver.sentStatus = conver.latestMessage.sentStatus;\n                        conver.sentTime = conver.latestMessage.sentTime;\n                    }\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    var status = RongIMClient._dataAccessProvider.conversationStatusManager.get(tempConver.type, tempConver.userId);\n                    conver.notificationStatus = status.notificationStatus;\n                    conver.isTop = status.isTop;\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback, fileName) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\", \"undefined|null|string\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"), fileName);\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\", \"undefined|null|object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"), data);\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", 'object', \"string\", \"string\", \"object\"], \"setRTCUserTotalRes\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserTotalRes(roomId, message, valueInfo, objectName, callback);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.HttpProtocol = {\n            http: 'http://',\n            https: 'https://'\n        };\n        RongIMClient.WsProtocol = {\n            ws: 'ws://',\n            wss: 'wss://'\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.MaxMessageContentBytes = 131072; // 128kb\n        RongIMClient.NavMarkInToken = '@';\n        RongIMClient.NavSeparatorInToken = ';';\n        RongIMClient.NavExpiredTime = 7200000; // 2 小时\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.10';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.settingListeners = [];\n        RongIMClient.conversationStatusListeners = [];\n        RongIMClient.messageExpansionListenerUpdated = [];\n        RongIMClient.messageExpansionListenerDeleted = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    RongIMLib.StatusTopic = (function () {\n        var ConversationType = RongIMLib.ConversationType;\n        var topic = {};\n        topic[ConversationType.PRIVATE] = 'ppMsgS';\n        topic[ConversationType.GROUP] = 'pgMsgS';\n        return topic;\n    })();\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var customCmpUrl = depend.cmpUrl;\n            if (RongIMLib.RongUtil.isValidWsUrl(customCmpUrl)) {\n                servers = [customCmpUrl];\n            }\n            else {\n                servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            }\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                get: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                        url: url\n                                    } });\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                            url: url,\n                                            code: code\n                                        } });\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    url: server\n                                } });\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PING_WS_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                                desc: 'all websocket addresses are unavailable',\n                                cmp: servers,\n                                ConnectionStatus: RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE,\n                                available: false\n                            } });\n                        clearHandler();\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        var storeServers = storage.getItem('servers');\n                        try {\n                            storeServers = JSON.parse(storeServers);\n                            !RongIMLib.RongUtil.getValidWsUrlList(storeServers).length && RongIMLib.Navigation.clear();\n                        }\n                        catch (e) { }\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                element: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        for (var i = 0; i < servers.length; i++) {\n                            RongIMLib.RongIMClient.invalidWsUrls.push(servers[i]);\n                        }\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                }\n            };\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var connectType = isWSPingJSONP ? 'element' : 'get';\n            connectMap[connectType]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    me.connectionStatus = code;\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                    var unReportCodes = [RongIMLib.ConnectionStatus.CONNECTING, RongIMLib.ConnectionStatus.REQUEST_NAVI, RongIMLib.ConnectionStatus.RESPONSE_NAVI];\n                    var isReportCode = RongIMLib.RongUtil.indexOf(unReportCodes, code) === -1;\n                    if (isReportCode) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_NETC_S, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                ConnectionStatus: code,\n                                available: false\n                            } });\n                    }\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    if (RongIMLib.RongUtil.getValidWsUrlList(servers).length) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", RongIMLib.Transportations._TransportType);\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                    else {\n                        me.changeConnectType();\n                        RongIMLib.RongIMClient.isFirstConnect = false;\n                        RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                    }\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            var self = this;\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n                RongIMLib.RongIMClient._memoryStore.cmpTimeoutTimer = setTimeout(function () {\n                    Bridge._client.handler.connectCallback.readTimeOut(true, RongIMLib.ErrorCode.RC_CONN_ACK_TIMEOUT);\n                    Bridge._client.channel.connectionStatus = -1;\n                }, RongIMLib.TimeoutEnum.CMP);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg, option) {\n            option = option || {};\n            var isNoAck = option.isNoAck;\n            var hasCallback = !!_callback;\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (isNoAck) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                _callback.onSuccess(msg);\n            }\n            else if (hasCallback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            var isPullChatroom = temp.type === 2;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    var errorMsg = \"syncTime:Received messages of chatroom but was not init\";\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CHRM_PULL_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            msg: errorMsg\n                        } });\n                    throw new Error(errorMsg);\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime || isPullChatroom) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            try {\n                                Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                            }\n                            catch (e) {\n                                console.log(e);\n                            }\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                    if (error !== RongIMLib.ErrorCode.TIMEOUT) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_QUERY_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                                action: 'invoke -> queryMessage',\n                                error: error\n                            } });\n                    }\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.prototype.clearCacheMessageIds = function () {\n            this.cacheMessageIds = [];\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                    if (status == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE) {\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = true;\n                    }\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType, params) {\n            params = params || {};\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                var isStatusMessage = params.isStatus;\n                var statusTopic = RongIMLib.StatusTopic[topic];\n                if (isStatusMessage && statusTopic) {\n                    Bridge._client.publishMessage(statusTopic, content, targetId, callback, msg, {\n                        isNoAck: true\n                    });\n                }\n                else {\n                    Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg); // 非状态消息, 逻辑不变\n                }\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'NotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                if (data.type === 2) {\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n                else if (data.type === 3) {\n                    RongIMLib.RongIMClient._dataAccessProvider.conversationStatusManager.pull({\n                        time: timestamp\n                    });\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            if (!msg) {\n                return;\n            }\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    try {\n                        entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    }\n                    catch (e) {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { stack: e, msg: 'MessageHandler -> onReceived' } });\n                        return;\n                    }\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg, isSync);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                var receivedTime = new Date().getTime();\n                con.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.isTop = false;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            if (RongIMLib.LoggerUtil.isLogCmdMsg(message)) {\n                RongIMLib.Logger.reportMNLog(message.content);\n                return;\n            }\n            if (RongIMLib.MessageExpansionHandler.isExpansionMessage(message)) {\n                RongIMLib.MessageExpansionHandler.emitListeners(message);\n                return;\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content;\n                if (RongIMLib.RongUtil.isUndefined(receiptResponseMsg) || RongIMLib.RongUtil.isNull(receiptResponseMsg)) {\n                    receiptResponseMsg = new RongIMLib.ReadReceiptResponseMessage({});\n                }\n                var receiptMessageDic = receiptResponseMsg.receiptMessageDic || {}, uIds = receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                try {\n                    that._onReceived(message, count, hasMore);\n                }\n                catch (e) {\n                    console.error(e);\n                }\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            if (msg && RongIMLib.RongUtil.isObject(msg) && msg.timestamp) {\n                RongIMLib.MessageUtil.setDeltaTime(msg.timestamp);\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_CATCH_UNKNOWN_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            action: 'MessageHandler -> handleMessage',\n                            msg: msg\n                        } });\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout, code) {\n            code = code || RongIMLib.ErrorCode.TIMEOUT;\n            if (isTimeout && this.onError) {\n                this.onError(code);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token,\n                        bosToken: entity.bosToken,\n                        bosDate: entity.bosDate,\n                        path: entity.path\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_DECODE_QUERY_DATA_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            stack: e,\n                            pbtype: pbtype,\n                            msg: 'QueryCallback -> process'\n                        } });\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            clearTimeout(RongIMLib.RongIMClient._memoryStore.cmpTimeoutTimer);\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                RongIMLib.MessageUtil.setDeltaTime(timestamp);\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x, errorCode) {\n            MessageCallback.prototype.readTimeOut.call(this, x, errorCode);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result, naviUrl) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var successNaviProtocol = RongIMLib.RongUtil.getUrlProtocol(naviUrl);\n            // navi 请求成功后, 根据 navi 协议头, 设置连接 websocket 协议头\n            RongIMLib.RongIMClient.setProtocol(successNaviProtocol);\n            storage.setItem(Navigation.StoreProtocolKey, successNaviProtocol);\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            storage.setItem('navi_time', RongIMLib.RongUtil.getTimestamp());\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            var uploadDomains = {\n                qiniu: result.uploadServer || '',\n                bos: result.bosAddr || ''\n            };\n            storage.setItem('upload_domains', JSON.stringify(uploadDomains));\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                var currentTime = RongIMLib.RongUtil.getTimestamp();\n                var naviSavedTime = Number(storage.getItem('navi_time')) || 0;\n                var isNotExpired = currentTime - naviSavedTime < RongIMLib.RongIMClient.NavExpiredTime;\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers) && isNotExpired) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    var storageProtocol = storage.getItem(Navigation.StoreProtocolKey);\n                    storageProtocol && RongIMLib.RongIMClient.setProtocol(storageProtocol);\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    if (RongIMLib.RongUtil.isPrivateService()) {\n                        return _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    }\n                    // 所有导航请求失败，及所有重试失败后，返回预埋导航配置信息，进行连接。预埋导航配置仅适用公有云环境，私有云仍直接抛出\n                    var naviResp = RongIMLib.FixedNaviRespHandler.getResp();\n                    var naviHost = navigaters[0];\n                    context.getNaviSuccess(naviResp, RongIMLib.RongUtil.getValidNavi(naviHost));\n                    _onsuccess();\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                navi = RongIMLib.RongUtil.getValidNavi(navi);\n                indexTools.add();\n                RongIMLib.LoggerUtil.recordFatalLogOfNavi(internalRetry, navigaters);\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result, navi);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n            RongIMLib.Logger.loggerCache.isNewNavi = true;\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            var requestType = \"HTTP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    result = JSON.parse(result);\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                            code: 0,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                    success(result);\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                            code: status,\n                            result: result,\n                            url: url,\n                            requestType: requestType\n                        } });\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            var requestType = \"JSONP\";\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    url: url,\n                    requestType: requestType\n                } });\n            var loggerResult = function (status, result) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        code: status,\n                        result: result,\n                        url: url,\n                        requestType: requestType\n                    } });\n            };\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                loggerResult(code, result);\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                loggerResult(RongIMLib.ConnectionState.TOKEN_INCORRECT, {});\n            };\n        };\n        Navigation.StoreProtocolKey = 'navprotocol';\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            // var UTF = \"\", _arr = arr;\n            // for (let i = 0, len = _arr.length; i < len; i++) {\n            //     if (_arr[i] < 0) { _arr[i] += 256; };\n            //     var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n            //     if (v && one.length == 8) {\n            //         var bytesLength = v[0].length,\n            //             // store = _arr[i].toString(2).slice(7 - bytesLength);\n            //             store = '';\n            //         for (var st = 0; st < bytesLength; st++) {\n            //             store += _arr[st + i].toString(2).slice(2);\n            //         }\n            //         UTF += String.fromCharCode(parseInt(store, 2));\n            //         i += bytesLength - 1;\n            //     } else {\n            //         UTF += String.fromCharCode(_arr[i]);\n            //     }\n            // }\n            // return UTF;\n            var MAX_SIZE = 0x4000;\n            var codeUnits = [];\n            var highSurrogate;\n            var lowSurrogate;\n            var index = -1;\n            var strBytes = arr;\n            var result = '';\n            while (++index < strBytes.length) {\n                var codePoint = Number(strBytes[index]);\n                if (codePoint === (codePoint & 0x7F)) {\n                }\n                else if (0xF0 === (codePoint & 0xF0)) {\n                    codePoint ^= 0xF0;\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                }\n                else if (0xE0 === (codePoint & 0xE0)) {\n                    codePoint ^= 0xE0;\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                }\n                else if (0xC0 === (codePoint & 0xC0)) {\n                    codePoint ^= 0xC0;\n                    codePoint = (codePoint << 6) | (strBytes[++index] ^ 0x80);\n                }\n                if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || Math.floor(codePoint) !== codePoint)\n                    throw RangeError('Invalid code point: ' + codePoint);\n                if (codePoint <= 0xFFFF)\n                    codeUnits.push(codePoint);\n                else {\n                    codePoint -= 0x10000;\n                    highSurrogate = (codePoint >> 10) | 0xD800;\n                    lowSurrogate = (codePoint % 0x400) | 0xDC00;\n                    codeUnits.push(highSurrogate, lowSurrogate);\n                }\n                if (index + 1 === strBytes.length || codeUnits.length > MAX_SIZE) {\n                    result += String.fromCharCode.apply(null, codeUnits);\n                    codeUnits.length = 0;\n                }\n            }\n            return result;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                try {\n                    this.pool = this.pool.concat(b);\n                }\n                catch (e) {\n                    [].push.apply(this.pool, b);\n                }\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (!me.connectedTime || (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime)) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_WS_ERR_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                    error: RongIMLib.ConnectionStatus.WEBSOCKET_ERROR,\n                    msg: 'SocketTransportation -> onError'\n                } });\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:ReferenceMsg\": \"ReferenceMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:GIFMsg\": \"GIFMessage\",\n    \"RC:SightMsg\": \"SightMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\",\n    \"RC:LogCmdMsg\": \"LogCommandMessage\",\n    \"RC:MsgExMsg\": \"ExpansionCommandMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    // 业务层公共方法处理\n    var IMHandler = (function () {\n        function IMHandler() {\n        }\n        IMHandler.isIncludeNavi = function (token) {\n            var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n            var hasNavMark = navMarkIndex !== -1;\n            return hasNavMark;\n        };\n        IMHandler.getToken = function (token) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                token = token.substring(0, navMarkIndex + 1);\n            }\n            return token;\n        };\n        IMHandler.getNavsByToken = function (token, protocol) {\n            var isIncludeNavi = IMHandler.isIncludeNavi(token);\n            var navUrlList = [];\n            if (isIncludeNavi) {\n                var navMarkIndex = RongIMLib.RongUtil.indexOf(token, RongIMLib.RongIMClient.NavMarkInToken);\n                ;\n                var navsText = token.substring(navMarkIndex + 1, token.length);\n                var navDomains = navsText.split(RongIMLib.RongIMClient.NavSeparatorInToken);\n                RongIMLib.RongUtil.forEach(navDomains, function (domain) {\n                    if (RongIMLib.RongUtil.isEmpty(domain)) {\n                        return;\n                    }\n                    var navUrl = RongIMLib.RongUtil.formatProtoclPath({\n                        path: domain, protocol: protocol, sub: true\n                    });\n                    navUrlList.push(navUrl);\n                });\n            }\n            return navUrlList;\n        };\n        IMHandler.getConversationKey = function (type, id) {\n            return type + '_' + id;\n        };\n        return IMHandler;\n    })();\n    RongIMLib.IMHandler = IMHandler;\n    ;\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n            // 向缓存中也设置拉消息时间戳\n            SyncTimeUtil._syncTimeCache[key] = sentTime;\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            /**\n             * 先从缓存中获取时间戳，如果缓存中没有再从 localstorage 中取。\n             * 避免多端重连都从 localstorage 中取时间戳，重连成功时间不一致导致后重连的用户拉消息有断档情况\n            */\n            var pullMsgTimeBox = SyncTimeUtil._syncTimeCache;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            if (RongIMLib.RongUtil.isEmpty(pullMsgTimeBox)) {\n                pullMsgTimeBox[sent] = storage.getItem(sent);\n                pullMsgTimeBox[received] = storage.getItem(received);\n            }\n            return {\n                sent: Number(pullMsgTimeBox[sent] || 0),\n                received: Number(pullMsgTimeBox[received] || 0)\n            };\n        };\n        SyncTimeUtil._syncTimeCache = {};\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        // 下行消息状态位判断, 第 10 位为 disableNotification 开关（ 上行为第 6 位 ）\n        MessageUtil.isDisableNotification = function (status) {\n            return Boolean(status & 0x200);\n        };\n        MessageUtil.getMessageOptionByStatus = function (status) {\n            var disableNotification = false, canIncludeExpansion = false;\n            disableNotification = !!(status & 0x200);\n            canIncludeExpansion = !!(status & 0x400);\n            return {\n                disableNotification: disableNotification,\n                canIncludeExpansion: canIncludeExpansion\n            };\n        };\n        MessageUtil.getMessageOptionBySessionId = function (sessionId) {\n            var disableNotification = false, canIncludeExpansion = false;\n            disableNotification = !!(sessionId & 0x20);\n            canIncludeExpansion = !!(sessionId & 0x40);\n            return {\n                disableNotification: disableNotification,\n                canIncludeExpansion: canIncludeExpansion\n            };\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg, isSync) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_PARSE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: ex,\n                        msg: 'MessageUtil -> messageParser'\n                    } });\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            var receivedTime = new Date().getTime();\n            message.messageUId = entity.msgId;\n            message.receivedTime = RongIMLib.MessageUtil.getCheckedTime(receivedTime);\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            try {\n                if (isSync) {\n                    RongIMLib.RongUtil.extend(MessageUtil.getMessageOptionBySessionId(entity.sessionId), message, null, true);\n                }\n                else {\n                    var status = MessageUtil.int64ToTimestamp(entity.status);\n                    RongIMLib.RongUtil.extend(MessageUtil.getMessageOptionByStatus(status), message, null, true);\n                }\n                entity.extraContent && (message.expansion = MessageExpansionHandler.formatExtraContent(entity.extraContent));\n            }\n            catch (error) {\n                RongIMLib.RongUtil.extend(MessageUtil.getMessageOptionByStatus(status), message, null, true);\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            options.error = options.fail;\n            return RongIMLib.RongUtil.request(options);\n        };\n        MessageUtil.setDeltaTime = function (serverTime) {\n            try {\n                RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - serverTime;\n            }\n            catch (e) { }\n        };\n        MessageUtil.getDeltaTime = function () {\n            var _memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            return _memoryStore.deltaTime || 0;\n        };\n        MessageUtil.getCheckedTime = function (time) {\n            var deltaTime = MessageUtil.getDeltaTime();\n            return time - deltaTime;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            if (!value) {\n                return detail;\n            }\n            value += '';\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n    var ConversationStatusStoreUserKey = '{appkey}{userId}constas';\n    var ConversationStatusPullTimeStoreKey = 'time';\n    var ConversationStatusManager = (function () {\n        function ConversationStatusManager(option) {\n            this.updatedStatus = []; // 更新的会话状态\n            this.statusShangeObserver = new RongIMLib.Observer();\n            this.pullProsumer = new RongIMLib.RongUtil.Prosumer();\n            var appkey = option.appkey, userId = option.userId;\n            this.option = option;\n            this.storageKey = RongIMLib.RongUtil.tplEngine(ConversationStatusStoreUserKey, {\n                appkey: appkey, userId: userId\n            });\n        }\n        ConversationStatusManager.prototype._formatUpdatedStatus = function (status, type, targetId) {\n            var updatedStatus = {\n                conversationType: type,\n                targetId: targetId\n            };\n            delete status.isLastInAPull;\n            return RongIMLib.RongUtil.extend(updatedStatus, status);\n        };\n        ConversationStatusManager.prototype.watchChanged = function (event) {\n            this.statusShangeObserver.add(event);\n        };\n        ConversationStatusManager.prototype.set = function (type, targetId, status) {\n            var currentStatus = this.get(type, targetId);\n            var updateTime = status.updateTime, isLastInAPull = status.isLastInAPull;\n            if (updateTime >= currentStatus.updateTime) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n                var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n                var storeStatus = allStatus[conversationStoreKey] || {};\n                RongIMLib.RongUtil.forEach(status, function (val, key) {\n                    if (!RongIMLib.RongUtil.isUndefined(val)) {\n                        storeStatus[key] = val;\n                    }\n                });\n                allStatus[conversationStoreKey] = storeStatus;\n                RongIMLib.RongUtil.Storage.set(this.storageKey, allStatus);\n                var updatedStatusItem = this._formatUpdatedStatus(status, type, targetId);\n                this.updatedStatus.push(updatedStatusItem);\n                RongIMLib.RongIMClient.getInstance().pottingConversation({\n                    type: type,\n                    userId: targetId\n                });\n            }\n            isLastInAPull && this.statusShangeObserver.emit(this.updatedStatus);\n            this.updatedStatus = [];\n        };\n        ConversationStatusManager.prototype.get = function (type, targetId) {\n            var allStatus = RongIMLib.RongUtil.Storage.get(this.storageKey) || {};\n            var conversationStoreKey = IMHandler.getConversationKey(type, targetId);\n            var status = allStatus[conversationStoreKey] || {};\n            var notificationStatus = status.notificationStatus, isTop = status.isTop, updateTime = status.updateTime;\n            return {\n                notificationStatus: notificationStatus || RongIMLib.ConversationNotificationStatus.NOTIFY,\n                isTop: isTop || false,\n                updateTime: updateTime || 0\n            };\n        };\n        ConversationStatusManager.prototype.pull = function (option) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭会话状态设置\n            option = option || {};\n            var self = this;\n            var _a = this, server = _a.option.server, pullProsumer = _a.pullProsumer, storageKey = _a.storageKey;\n            pullProsumer.produce(option);\n            pullProsumer.consume(function (params, next) {\n                var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                var lastUpdateTime = allStatus[ConversationStatusPullTimeStoreKey] || 0;\n                var updateTime = params.time, isForce = params.isForce;\n                if (lastUpdateTime > updateTime && !isForce) {\n                    return next();\n                }\n                server.pullConversationStatus(lastUpdateTime, {\n                    onStatus: function (type, id, conversationStatus) {\n                        self.set(type, id, conversationStatus);\n                    },\n                    onSuccess: function (updateTime) {\n                        var allStatus = RongIMLib.RongUtil.Storage.get(storageKey) || {};\n                        allStatus[ConversationStatusPullTimeStoreKey] = updateTime; // 更新拉取时间戳\n                        RongIMLib.RongUtil.Storage.set(self.storageKey, allStatus);\n                        next();\n                    },\n                    onError: next\n                });\n            });\n        };\n        return ConversationStatusManager;\n    })();\n    RongIMLib.ConversationStatusManager = ConversationStatusManager;\n    var FixedNaviRespHandler = (function () {\n        function FixedNaviRespHandler() {\n        }\n        FixedNaviRespHandler.modifyVoipCallInfoByAppKey = function () {\n            var me = this;\n            try {\n                var naviResp = me.baseResp;\n                var appKey = RongIMLib.RongIMClient._memoryStore.appKey;\n                var voipCallInfo = naviResp.voipCallInfo;\n                var parseVoipCallInfo = JSON.parse(voipCallInfo);\n                RongIMLib.RongUtil.forEach(parseVoipCallInfo.callEngine, function (item) {\n                    if (item.engineType === 3) {\n                        item.vendorKey = appKey;\n                    }\n                });\n                var jsonVoipCallInfo = JSON.stringify(parseVoipCallInfo);\n                naviResp.voipCallInfo = jsonVoipCallInfo;\n            }\n            catch (error) {\n            }\n            return naviResp;\n        };\n        FixedNaviRespHandler.modifyCmpByProtocol = function () {\n            var me = this;\n            var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n            var isHTTP = protocol === RongIMLib.RongIMClient.HttpProtocol.http;\n            var cmpHost = isHTTP ? me.preparedCMP.WS : me.preparedCMP.WSS;\n            me.baseResp.backupServer = cmpHost;\n        };\n        FixedNaviRespHandler.genUserId = function () {\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            return uid;\n        };\n        FixedNaviRespHandler.getResp = function () {\n            var me = this;\n            me.modifyCmpByProtocol();\n            var naviResp = me.modifyVoipCallInfoByAppKey();\n            naviResp.userId = me.genUserId();\n            return naviResp;\n        };\n        FixedNaviRespHandler.baseResp = {\n            isFixedNaviResp: true,\n            code: 200,\n            userId: '',\n            server: '',\n            backupServer: '',\n            voipCallInfo: '{\"strategy\":1,\"callEngine\":[{\"engineType\":4,\"mediaServer\":\"https://rtc-info.ronghub.com\",\"maxStreamCount\":20},{\"engineType\":3,\"vendorKey\":\"\",\"signKey\":\"\",\"blinkCMPServer\":\"rtccmp.ronghub.com:80\",\"blinkSnifferServer\":\"rtccmp.ronghub.com:80\"}]}',\n            kvStorage: 1,\n            uploadServer: 'upload.qiniup.com',\n            openMp: 1,\n            openUS: 1,\n            logSwitch: 1,\n            logPolicy: '{\"url\": \"logcollection.ronghub.com\",\"level\": 1,\"itv\": 6,\"times\": 5}',\n            bosAddr: 'gz.bcebos.com'\n        };\n        FixedNaviRespHandler.preparedCMP = {\n            WSS: 'wsap-cn.ronghub.com:443',\n            WS: 'wsap-cn.ronghub.com:80'\n        };\n        return FixedNaviRespHandler;\n    })();\n    RongIMLib.FixedNaviRespHandler = FixedNaviRespHandler;\n    var JoinedChatroomSyner = (function () {\n        function JoinedChatroomSyner(option) {\n            this.chrmIds = [];\n            var self = this;\n            option = option || {};\n            self.key = RongIMLib.RongUtil.tplEngine('{appkey}-{userId}-joinedChrm', {\n                appkey: option.appkey,\n                userId: option.userId\n            });\n            self.storage = new RongIMLib.sessionStorageProvider();\n        }\n        JoinedChatroomSyner.prototype.set = function (chrmId) {\n            var self = this;\n            self.chrmIds.push(chrmId);\n            self.storage.setItem(self.key, self.chrmIds);\n        };\n        JoinedChatroomSyner.prototype.get = function () {\n            var chrmIds = this.storage.getItem(this.key);\n            return chrmIds.split(',');\n        };\n        JoinedChatroomSyner.prototype.remove = function (chrmId) {\n            var self = this;\n            RongIMLib.RongUtil.forEach(self.chrmIds, function (id, idx) {\n                if (id == chrmId) {\n                    self.chrmIds.splice(idx, 1);\n                }\n            });\n            self.storage.setItem(self.key, self.chrmIds);\n        };\n        JoinedChatroomSyner.prototype.clear = function () {\n            var self = this;\n            self.storage.setItem(self.key, []);\n        };\n        JoinedChatroomSyner.prototype.isInChrm = function (chrmId) {\n            var chrmIds = this.get();\n            var isInChrm = false;\n            RongIMLib.RongUtil.forEach(chrmIds, (function (id) {\n                if (chrmId === id) {\n                    isInChrm = true;\n                }\n            }));\n            return isInChrm;\n        };\n        return JoinedChatroomSyner;\n    })();\n    RongIMLib.JoinedChatroomSyner = JoinedChatroomSyner;\n    var MessageExpansionHandler = (function () {\n        function MessageExpansionHandler() {\n        }\n        MessageExpansionHandler.isExpansionMessage = function (message) {\n            return message.messageType === \"ExpansionCommandMessage\" && message.objectName === \"RC:MsgExMsg\";\n        };\n        MessageExpansionHandler.validateExpansion = function (expansion) {\n            var REGEXP_EXPANSION_KEY = /^[A-Za-z0-9_=+-]+$/;\n            var expansionKeysLength = RongIMLib.RongUtil.getObjectKeys(expansion).length;\n            if (RongIMLib.RongUtil.isEmpty(expansion)) {\n                return RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER;\n            }\n            if (expansionKeysLength > RongIMLib.MsgEpansionLength.MSG) {\n                return RongIMLib.MessageExpansionErrorCode.EXPANSION_LIMIT_EXCEET;\n            }\n            var error = void 0;\n            RongIMLib.RongUtil.forEach(expansion, function (val, key) {\n                if (!RongIMLib.RongUtil.isString(val)) {\n                    return;\n                }\n                if (key.length > RongIMLib.MsgEpansionLength.KEY || val.length > RongIMLib.MsgEpansionLength.VALUE) {\n                    error = RongIMLib.MessageExpansionErrorCode.EXPANSION_LIMIT_EXCEET;\n                    return;\n                }\n                if (!REGEXP_EXPANSION_KEY.test(key)) {\n                    error = RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER;\n                    return;\n                }\n            });\n            return error;\n        };\n        MessageExpansionHandler.formatExtraContent = function (extraContent) {\n            var expansion = {};\n            var parseExtraContent = JSON.parse(extraContent);\n            RongIMLib.RongUtil.forEach(parseExtraContent, function (value, key) {\n                expansion[key] = value.v;\n            });\n            return expansion;\n        };\n        MessageExpansionHandler.emitListeners = function (message) {\n            var content = message.content || {}, messageUId = content.mid, \n            // sentTime: number = message.sentTime,\n            removeAll = Boolean(message.removeAll);\n            var expansion = content.put, removeDic = content.del;\n            if (!RongIMLib.RongUtil.isEmpty(expansion)) {\n                var events = RongIMLib.RongIMClient.messageExpansionListenerUpdated;\n                RongIMLib.RongUtil.forEach(events, function (event) {\n                    event({ expansion: expansion, messageUId: messageUId });\n                });\n            }\n            if (!RongIMLib.RongUtil.isEmpty(removeDic)) {\n                var events = RongIMLib.RongIMClient.messageExpansionListenerDeleted;\n                RongIMLib.RongUtil.forEach(events, function (event) {\n                    event({ deletedKeys: removeDic, messageUId: messageUId });\n                });\n            }\n        };\n        return MessageExpansionHandler;\n    })();\n    RongIMLib.MessageExpansionHandler = MessageExpansionHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_PROFILE_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_INIT_CMD_NOTI_MSG_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        stack: e,\n                        msg: message.data\n                    } });\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ExpansionCommandMessage = (function () {\n        function ExpansionCommandMessage(message) {\n            this.messageName = \"ExpansionCommandMessage\";\n            message.put && (this.put = message.put);\n            message.del && (this.del = message.del);\n            message.mid && (this.mid = message.mid);\n            message.removeAll && (this.removeAll = message.removeAll);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ExpansionCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ExpansionCommandMessage;\n    })();\n    RongIMLib.ExpansionCommandMessage = ExpansionCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            if (message.burnDuration) {\n                this.burnDuration = message.burnDuration;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            message.burnDuration && (this.burnDuration = message.burnDuration);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.conversationType = message.conversationType;\n            this.summaryList = message.summaryList;\n            this.extra = message.extra;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList, conversationType) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList, conversationType: conversationType });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n    var LogCommandMessage = (function () {\n        function LogCommandMessage(message) {\n            this.messageName = \"LogCommandMessage\";\n            message.uri && (this.uri = message.uri);\n            message.logId && (this.logId = message.logId);\n            message.platform && (this.platform = message.platform);\n            message.packageName && (this.packageName = message.packageName);\n            message.startTime && (this.startTime = message.startTime);\n            message.endTime && (this.endTime = message.endTime);\n            message.user && (this.user = message.user);\n        }\n        LogCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LogCommandMessage;\n    })();\n    RongIMLib.LogCommandMessage = LogCommandMessage;\n    var ReferenceMessage = (function () {\n        function ReferenceMessage(message) {\n            this.messageName = \"ReferenceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.content = message.content;\n            this.referMsgUserId = message.referMsgUserId;\n            this.referMsg = message.referMsg;\n            this.objName = message.objName;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n            this.extra = message.extra;\n        }\n        ReferenceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReferenceMessage;\n    })();\n    RongIMLib.ReferenceMessage = ReferenceMessage;\n    var GIFMessage = (function () {\n        function GIFMessage(message) {\n            this.messageName = \"GIFMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.gifDataSize = message.gifDataSize;\n            this.localPath = message.localPath;\n            this.remoteUrl = message.remoteUrl;\n            this.width = message.width;\n            this.height = message.height;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        GIFMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GIFMessage;\n    })();\n    RongIMLib.GIFMessage = GIFMessage;\n    var SightMessage = (function () {\n        function SightMessage(message) {\n            this.messageName = \"SightMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReferenceMessage.\");\n            }\n            this.sightUrl = message.sightUrl;\n            this.content = message.content;\n            this.duration = message.duration;\n            this.size = message.size;\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        SightMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SightMessage;\n    })();\n    RongIMLib.SightMessage = SightMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse, disableNotification, canIncludeExpansion, expansion) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n            this.disableNotification = disableNotification;\n            this.canIncludeExpansion = canIncludeExpansion;\n            this.expansion = expansion;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            var self = this;\n            RongIMLib.Logger.reportRTLog();\n            option = option || {};\n            var isReconnect = option.isReconnect;\n            var isIgnoreReportStart = option.isIgnoreReportStart;\n            var StartReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_T : RongIMLib.LoggerTag.IM.A_CONN_T;\n            var EndReportTag = isReconnect ? RongIMLib.LoggerTag.IM.L_RECO_R : RongIMLib.LoggerTag.IM.A_CONN_R;\n            !isIgnoreReportStart && RongIMLib.Logger.writeLog({ tag: StartReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { \"token\": token } });\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                        RongIMLib.RongIMClient._memoryStore.networkUnavailable = false;\n                        RongIMLib.Logger.loggerCache.userId = data;\n                        RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: { desc: 'connection succeeded' } });\n                        self.conversationStatusManager = new RongIMLib.ConversationStatusManager({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data,\n                            server: self\n                        });\n                        self.conversationStatusManager.watchChanged(function (status) {\n                            RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.conversationStatusListeners, function (event) {\n                                event(status);\n                            });\n                        });\n                        self.conversationStatusManager.pull({\n                            isForce: true\n                        });\n                        self.joinedChrmManager = new RongIMLib.JoinedChatroomSyner({\n                            appkey: RongIMLib.RongIMClient._memoryStore.appKey,\n                            userId: data\n                        });\n                    });\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var fullnavi = storage.getItem('fullnavi') || '{}';\n                    try {\n                        fullnavi = JSON.parse(fullnavi);\n                    }\n                    catch (e) {\n                        fullnavi = {};\n                    }\n                    var isAutoPull = fullnavi.openUS;\n                    isAutoPull && self.getVoipInfo({\n                        onSuccess: function (VoipInfo) {\n                            try {\n                                VoipInfo && RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.settingListeners, function (listener) {\n                                    listener({ VoipInfo: VoipInfo }); // 与 3.x 保持一致, 方便后续 3.x 兼容\n                                });\n                                if (VoipInfo) {\n                                    var fullnavi_1 = storage.getItem('fullnavi') || '{}';\n                                    fullnavi_1 = JSON.parse(fullnavi_1);\n                                    fullnavi_1.voipCallInfo = VoipInfo;\n                                    storage.setItem('fullnavi', JSON.stringify(fullnavi_1));\n                                }\n                            }\n                            catch (e) {\n                            }\n                        },\n                        onError: function () {\n                            // do nothing\n                        }\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { ConnectionState: RongIMLib.ConnectionState.TOKEN_INCORRECT } });\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                            RongIMLib.Logger.writeLog({ tag: EndReportTag, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: { code: e } });\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                var timer = setTimeout(ping, next);\n                                RongIMLib.RongIMClient._memoryStore.autoReconnectTimer = timer;\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback, null, {\n                                    isIgnoreReportStart: true,\n                                    isReconnect: true\n                                });\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback, null, {\n                            isIgnoreReportStart: true,\n                            isReconnect: true\n                        });\n                    }\n                };\n                handler[key]();\n            }\n            else {\n                var _client = RongIMLib.Bridge._client || {};\n                var _channel = _client.channel || {};\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_RECO_E, level: RongIMLib.LoggerLevel.E, type: RongIMLib.LoggerType.IM, content: {\n                        msg: {\n                            connectionStatus: _channel.connectionStatus\n                        },\n                        action: 'reconnect'\n                    } });\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            var timer = RongIMLib.RongIMClient._memoryStore.autoReconnectTimer;\n            timer && clearTimeout(timer);\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback, params) {\n            params = params || {};\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2, params);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var self = this;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId\n                                        } });\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                    RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                            chatroomId: chatroomId,\n                                            error: errorCode\n                                        } });\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                    chatroomId: chatroomId\n                                } });\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                    self.joinedChrmManager.set(chatroomId);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_JCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: error\n                            } });\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var self = this;\n            RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_T, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                    chatroomId: chatroomId\n                } });\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    RongIMLib.Bridge._client && RongIMLib.Bridge._client.clearCacheMessageIds();\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.I, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId\n                            } });\n                        callback.onSuccess();\n                        self.joinedChrmManager.remove(chatroomId);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.A_QCTR_R, level: RongIMLib.LoggerLevel.W, type: RongIMLib.LoggerType.IM, content: {\n                                chatroomId: chatroomId,\n                                error: errcode\n                            } });\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(!!ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var isInChatRoom = this.joinedChrmManager.isInChrm(chatroomId);\n            if (!isInChatRoom) {\n                return callback.onError(RongIMLib.ErrorCode.NOT_IN_CHATROOM);\n            }\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            var isInChatRoom = this.joinedChrmManager.isInChrm(chatroomId);\n            if (!isInChatRoom) {\n                return callback.onError(RongIMLib.ErrorCode.NOT_IN_CHATROOM);\n            }\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback, fileName) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var fileName = RongIMLib.RongUtil.generateUploadFileName(fileType, fileName);\n            // 获取上传地址\n            var domains = RongIMLib.RongIMClient._storageProvider.getItem('upload_domains') || '{}';\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (res) {\n                    setTimeout(function () {\n                        var data = RongIMLib.RongUtil.extend(JSON.parse(domains), res);\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback, data) {\n            var data = data || {};\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            if (data.isBosRes) {\n                callback.onSuccess(data);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getVoipInfo = function (callback) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling)\n                return; //长轮训关闭实时配置，IE 现不支持音视频\n            // 获取最新值\n            return this.getPullSetting({\n                onSuccess: function (result) {\n                    result = result || {};\n                    var items = result.items || [];\n                    var voipInfo = null;\n                    for (var i = 0, max = items.length; i < max; i++) {\n                        var item = items[i];\n                        if (item.key === 'VoipInfo') {\n                            var value = item.value;\n                            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayForm(value.buffer).slice(value.offset, value.limit) : value);\n                            }\n                            else {\n                                value = new RongIMLib.BinaryHelper().readUTF(value.offset ? RongIMLib.MessageUtil.ArrayFormInput(value.buffer).subarray(value.offset, value.limit) : value);\n                            }\n                            voipInfo = value;\n                        }\n                    }\n                    callback.onSuccess(voipInfo);\n                },\n                onError: callback.onError\n            }, 0);\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback, version) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            version = version || parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            var sessionId;\n            if (mentiondMsg && isGroup) {\n                sessionId = 7;\n                params.disableNotification && (sessionId = sessionId | 0x20);\n                params.canIncludeExpansion && (sessionId = sessionId | 0x40);\n                modules.setSessionId(sessionId);\n            }\n            else {\n                sessionId = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag();\n                params.disableNotification && (sessionId = sessionId | 0x20);\n                params.canIncludeExpansion && (sessionId = sessionId | 0x40);\n                modules.setSessionId(sessionId);\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (params.expansion && params.canIncludeExpansion) {\n                var error = RongIMLib.MessageExpansionHandler.validateExpansion(params.expansion);\n                if (error) {\n                    setTimeout(function () {\n                        sendCallback.onError(error);\n                    });\n                    return;\n                }\n                var extraContent = {};\n                RongIMLib.RongUtil.forEach(params.expansion, function (val, key) {\n                    extraContent[key] = { v: val };\n                });\n                modules.setExtraContent(JSON.stringify(extraContent));\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            var encodedContent = messageContent.encode();\n            if (RongIMLib.RongUtil.getByteLength(encodedContent) > RongIMLib.RongIMClient.MaxMessageContentBytes) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);\n                });\n                return;\n            }\n            modules.setContent(encodedContent);\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            msg.disableNotification = params.disableNotification || false;\n            msg.canIncludeExpansion = params.canIncludeExpansion || false;\n            params.canIncludeExpansion && (msg.expansion = params.expansion);\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType, params);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        /**\n         * 向缓存会话列表内添加新会话或更新会话\n        */\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        /**\n         * 更新缓存会话字段\n        */\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        /**\n         * 移除 IM Server 端会话,并清除缓存内会话\n        */\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!RongIMLib.RongUtil.isNumber(count)) {\n                count = 200;\n            }\n            var isLocalInclude = list.length >= count;\n            if (!isSync && (isLocalInclude || RongIMLib.RongIMClient._memoryStore.isFullConversations)) {\n                setTimeout(function () {\n                    var _list = JSON.parse(JSON.stringify(list));\n                    var localList = _list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    var isFullConversations = count > list.length;\n                    RongIMLib.RongIMClient._memoryStore.isFullConversations = isFullConversations;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n            return count;\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n            var self = this;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionStateModifyReq();\n            var userId = RongIMLib.Bridge._client.userId;\n            var time = +new Date();\n            var stateItemModules = [];\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.notificationStatus)) {\n                var isNotDisturbe = statusItem.notificationStatus === RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                stateItemModules.push({\n                    sessionStateType: 1,\n                    value: isNotDisturbe ? '1' : '0'\n                });\n            }\n            if (!RongIMLib.RongUtil.isUndefined(statusItem.isTop)) {\n                stateItemModules.push({\n                    sessionStateType: 2,\n                    value: statusItem.isTop ? '1' : '0'\n                });\n            }\n            var stateModules = {\n                type: type,\n                channelId: targetId,\n                time: time,\n                stateItem: stateItemModules\n            };\n            modules.setVersion(time);\n            modules.setState([stateModules]);\n            RongIMLib.RongIMClient.bridge.queryMsg('setSeAtt', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var time = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    statusItem.updateTime = time;\n                    statusItem.isLastInAPull = true;\n                    self.conversationStatusManager.set(type, targetId, statusItem);\n                    setTimeout(function () {\n                        callback.onSuccess(time);\n                    });\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStateModifyResp');\n        };\n        ServerDataProvider.prototype.pullConversationStatus = function (time, callback) {\n            time = time || 0;\n            var modules = new RongIMLib.RongIMClient.Protobuf.SessionReq();\n            modules.setTime(time);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg('pullSeAtts', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (result) {\n                    var sessionStateList = result.state, lastTime = result.version;\n                    var sessionLength = sessionStateList.length;\n                    RongIMLib.RongUtil.forEach(sessionStateList, function (state, index) {\n                        var type = state.type, targetId = state.channelId, updateTime = state.time, stateItem = state.stateItem;\n                        var isSilent = false, isTop = false;\n                        RongIMLib.RongUtil.forEach(stateItem, function (item) {\n                            var sessionStateType = item.sessionStateType, value = item.value;\n                            if (sessionStateType === 1) {\n                                isSilent = !!Number(value);\n                            }\n                            if (sessionStateType === 2) {\n                                isTop = !!Number(value);\n                            }\n                        });\n                        var isLastInAPull = index === sessionLength - 1;\n                        callback.onStatus(type, targetId, {\n                            notificationStatus: isSilent ? RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB : RongIMLib.ConversationNotificationStatus.NOTIFY,\n                            isTop: isTop,\n                            updateTime: RongIMLib.MessageUtil.int64ToTimestamp(updateTime),\n                            isLastInAPull: isLastInAPull\n                        });\n                    });\n                    callback.onSuccess(RongIMLib.MessageUtil.int64ToTimestamp(lastTime));\n                },\n                onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SessionStates');\n        };\n        ServerDataProvider.prototype.sendExpansionMessage = function (params, sendMessageCallback) {\n            var self = this;\n            params = params || {};\n            var removeAll = 0;\n            params.removeAll && (removeAll = 1);\n            var msg = new RongIMLib.ExpansionCommandMessage({\n                put: params.updateDic,\n                del: params.removeDic,\n                mid: params.messageUId,\n                removeAll: removeAll\n            });\n            self.sendMessage(params.conversationType, params.targetId, msg, {\n                onBefore: function () { },\n                onSuccess: function () {\n                    sendMessageCallback.onSuccess();\n                },\n                onError: function (errorCode) {\n                    sendMessageCallback.onError(errorCode);\n                }\n            }, false, null, null, null, null);\n        };\n        ServerDataProvider.prototype.updateMessageExpansion = function (expansionDic, message, callback) {\n            var self = this;\n            var msgExpansion = message.expansion || {};\n            var totalExpansion = RongIMLib.RongUtil.extend(expansionDic, msgExpansion);\n            var totalExpansionKeysLength = RongIMLib.RongUtil.getObjectKeys(totalExpansion).length;\n            if (!message.canIncludeExpansion) {\n                return callback.onError(RongIMLib.MessageExpansionErrorCode.NOT_SUPPORT);\n            }\n            if (totalExpansionKeysLength > RongIMLib.MsgEpansionLength.TOTAL) {\n                return callback.onError(RongIMLib.MessageExpansionErrorCode.EXPANSION_LIMIT_EXCEET);\n            }\n            var error = RongIMLib.MessageExpansionHandler.validateExpansion(expansionDic);\n            if (error) {\n                callback.onError(error);\n                return;\n            }\n            message = RongIMLib.RongUtil.extend(message, { updateDic: expansionDic });\n            self.sendExpansionMessage(message, callback);\n        };\n        ServerDataProvider.prototype.removeMessageExpansionForKey = function (keys, message, callback) {\n            var self = this;\n            if (RongIMLib.RongUtil.isEmpty(keys)) {\n                callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n            }\n            ;\n            message = RongIMLib.RongUtil.extend(message, { removeDic: keys });\n            self.sendExpansionMessage(message, callback);\n        };\n        ServerDataProvider.prototype.removeMessageAllExpansion = function (message, callback) {\n            var self = this;\n            RongIMLib.RongUtil.extend(message, { removeAll: true });\n            self.sendExpansionMessage(message, callback);\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        /**\n         * 全量订阅资源修改\n         * @param roomId 房间 Id\n         * @param message 增量数据\n         * @param valueInfo 全量资源信息\n         * @param objectName 消息名称\n         * @param callback\n         */\n        ServerDataProvider.prototype.setRTCTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            // 全量 URI 新增\n            // 全量发布中\n            // valueInfo: key 为 uris，值为 全量的订阅信息\n            // content: key 为增量数据消息 RCRTC:ModifyResource，value 为增量订阅信息\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcUserSetDataInput();\n            modules.setObjectName(objectName);\n            // content\n            var val = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            val.setKey(message.name);\n            val.setValue(message.content);\n            modules.setContent(val);\n            // valueInfo\n            val = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            val.setKey('uris');\n            val.setValue(valueInfo);\n            modules.setValueInfo(val);\n            var arrayBuff = RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer());\n            RongIMLib.RongIMClient.bridge.queryMsg(\"userSetData\", arrayBuff, roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            this.setRTCTotalRes(roomId, message, valueInfo, objectName, callback);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId,\n                token: token\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            var me = this;\n            // this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n            this.addon.connectWithToken(token, userId, function (userId) {\n                me.userId = userId;\n                RongIMLib.Bridge._client.userId = userId;\n            });\n        };\n        VCDataProvider.prototype.setConversationStatus = function (type, targetId, statusItem, callback) {\n        };\n        VCDataProvider.prototype.updateMessageExpansion = function (expansionDic, message, callback) {\n        };\n        VCDataProvider.prototype.removeMessageExpansionForKey = function (keys, message, callback) {\n        };\n        VCDataProvider.prototype.removeMessageAllExpansion = function (messageUId, callback) {\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.connectionStatus = RongIMLib.ConnectionStatus.DISCONNECTED;\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                var isCurrentConnected = me.connectionStatus === RongIMLib.ConnectionStatus.CONNECTED;\n                var code = result;\n                switch (result) {\n                    case 10:\n                        code = RongIMLib.ConnectionStatus.CONNECTING;\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        return;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30010:\n                        if (!isCurrentConnected) {\n                            return;\n                        }\n                        code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                        break;\n                    case 0:\n                    case 33005:\n                        code = RongIMLib.ConnectionStatus.CONNECTED;\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                        });\n                        break;\n                    case 6:\n                        code = RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT;\n                        break;\n                    default:\n                        code = result;\n                        break;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    listener.onChanged(code);\n                });\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            this.addon.setMessageSearchField(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var result = 0;\n            try {\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n            return result;\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) {\n            var token = RongIMLib.Bridge._client.token;\n            this.disconnect();\n            this.connect(token, callback);\n        };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.setRTCUserTotalRes = function (roomId, message, valueInfo, objectName, callback) {\n            // TODO\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (LoggerLevel) {\n        LoggerLevel[LoggerLevel[\"F\"] = 0] = \"F\";\n        LoggerLevel[LoggerLevel[\"E\"] = 1] = \"E\";\n        LoggerLevel[LoggerLevel[\"W\"] = 2] = \"W\";\n        LoggerLevel[LoggerLevel[\"I\"] = 3] = \"I\";\n        LoggerLevel[LoggerLevel[\"D\"] = 4] = \"D\"; //debug\n    })(RongIMLib.LoggerLevel || (RongIMLib.LoggerLevel = {}));\n    var LoggerLevel = RongIMLib.LoggerLevel;\n    (function (LoggerStoreSize) {\n        LoggerStoreSize[LoggerStoreSize[\"ADVANCED\"] = 500] = \"ADVANCED\";\n        LoggerStoreSize[LoggerStoreSize[\"LOW\"] = 500] = \"LOW\";\n    })(RongIMLib.LoggerStoreSize || (RongIMLib.LoggerStoreSize = {}));\n    var LoggerStoreSize = RongIMLib.LoggerStoreSize;\n    var LoggerType = (function () {\n        function LoggerType() {\n        }\n        LoggerType.IM = 'IM';\n        LoggerType.RTC = 'RTC';\n        return LoggerType;\n    })();\n    RongIMLib.LoggerType = LoggerType;\n    var LoggerTag = (function () {\n        function LoggerTag() {\n        }\n        /**\n         * 三段式关键字: \"发起方-任务类型-结果类型\"\n         * A: App 层，L: Lib 层，N: 调用 Native 层接口，P: Protocol 层\n         * O: 操作，S: 状态，T: 任务，R: 结果，E: 错误\n         */\n        LoggerTag.IM = {\n            A_INIT_O: 'A-init-O',\n            A_CONN_T: 'A-connect-T',\n            A_CONN_R: 'A-connect-R',\n            A_CONN_E: 'A-connect-E',\n            L_RECO_T: 'L-reconnect-T',\n            L_RECO_R: 'L-reconnect-R',\n            L_RECO_E: 'L-reconnect-E',\n            L_GETN_T: 'L-get_navi-T',\n            L_GETN_R: 'L-get_navi-R',\n            L_PING_WS_T: 'L-ping_ws-T',\n            L_PING_WS_R: 'L-ping_ws-R',\n            L_NETC_S: 'L-network_changed-S',\n            A_DISC_O: 'A-disconnect-O',\n            A_JCTR_T: 'A-join_chatroom-T',\n            A_JCTR_R: 'A-join_chatroom-R',\n            A_QCTR_T: 'A-quit_chatroom-T',\n            A_QCTR_R: 'A-quit_chatroom-R',\n            A_INIT_CMD_MSG_E: 'A-instantiate_command_message-E',\n            A_INIT_PROFILE_MSG_E: 'A-instantiate_profile_notify_message-E',\n            A_INIT_CMD_NOTI_MSG_E: 'A-instantiate_command_notify_message-E',\n            L_CHRM_PULL_E: 'L-chatroom_pull-E',\n            L_QUERY_MSG_E: 'L-query_message-E',\n            L_DECODE_MSG_E: 'L-decode_upstream_message-E',\n            L_CATCH_UNKNOWN_MSG_E: 'L-catch_unknown_message-E',\n            L_DECODE_QUERY_DATA_E: 'L-decode_query_data-E',\n            L_PARSE_MSG_E: 'L-parse_message-E',\n            L_WS_ERR_E: 'L-websocket-error-E',\n            G_CRAW_E: 'G-crash-E',\n            G_UP_LOG_S: 'G-upload_log-S',\n            G_UP_LOG_E: 'G-upload_log-E'\n        };\n        return LoggerTag;\n    })();\n    RongIMLib.LoggerTag = LoggerTag;\n    var LoggerReportType = (function () {\n        function LoggerReportType() {\n        }\n        LoggerReportType.REAL_TIME_LOG = 'RealTimeLog';\n        LoggerReportType.MSG_NOTIF_LOG = 'MessageNotificationLog';\n        return LoggerReportType;\n    })();\n    RongIMLib.LoggerReportType = LoggerReportType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Logger = (function () {\n        function Logger() {\n        }\n        Logger.writeLog = function (log) {\n            var self = this;\n            if (RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\") {\n                return;\n            }\n            var networkUnavailable = RongIMLib.RongIMClient._memoryStore.networkUnavailable;\n            var isLowLevelBro = RongIMLib.LoggerUtil.isLowLevelBro();\n            log.time = new Date().getTime();\n            log.sessionId = RongIMLib.LoggerUtil.getSessionId();\n            log.content = log.content && JSON.stringify(log.content);\n            if (networkUnavailable) {\n                if (log.level == RongIMLib.LoggerLevel.E || log.level == RongIMLib.LoggerLevel.W) {\n                    log.level = RongIMLib.LoggerLevel.I;\n                }\n            }\n            self.logStore.push(log);\n            var _handleOverflowLog = function (size) {\n                if (self.logStore.length > size) {\n                    var delLength = self.logStore.length - size;\n                    self.logStore.splice(0, delLength);\n                }\n            };\n            if (isLowLevelBro) {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.LOW);\n            }\n            else {\n                _handleOverflowLog(RongIMLib.LoggerStoreSize.ADVANCED);\n            }\n        };\n        Logger.reportRTLog = function () {\n            var self = this;\n            var isUserCloseLogger = RongIMLib.RongIMClient._memoryStore.loggerSwitch === \"off\";\n            if (self.loggerCache.hasStarted || isUserCloseLogger) {\n                return;\n            }\n            self.loggerCache.hasStarted = true;\n            var policy = this.defaultLogPolicy;\n            var isDefaultUpload = true;\n            var currentTime = 1;\n            var _robustUpload = function () {\n                var isOpen = policy.logSwitch;\n                var itv = policy.itv * 1000;\n                var times = policy.times;\n                var url = policy.url;\n                var level = policy.level;\n                var realItv = itv * Math.pow(2, currentTime - 1);\n                if (currentTime < times) {\n                    currentTime++;\n                }\n                if (!isOpen) {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: level, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: url, type: RongIMLib.LoggerReportType.REAL_TIME_LOG });\n                    if (self.loggerCache.isNewNavi) {\n                        currentTime = 1;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        self.loggerCache.isNewNavi = false;\n                    }\n                    if (isDefaultUpload) {\n                        currentTime = 1;\n                        isDefaultUpload = false;\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy(); // 更新 navi 中配置下次用\n                        if (RongIMLib.RongUtil.isPrivateService()) {\n                            //私有云关闭默认第一次上传，私有云没有默认上传地址，值能通过导航下发的配置上传\n                            _robustUpload();\n                            return;\n                        }\n                    }\n                    if (csvLog.length == 0) {\n                        policy = RongIMLib.LoggerUtil.getNaviPolicy();\n                        _robustUpload();\n                        return;\n                    }\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: policy.timeout * 1000,\n                        success: function (data) {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log'\n                                } });\n                            //第一次成功后，如果导航有数据使用导航数据，导航无数据关闭上传。第二次上传成功后返回数据使用返回数据\n                            if (!isOpen) {\n                                return;\n                            }\n                            if (data) {\n                                data = JSON.parse(data);\n                                policy.itv = data.nextTime;\n                                policy.level = data.level;\n                                policy.logSwitch = data.logSwitch;\n                                currentTime = 1;\n                            }\n                            _robustUpload();\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report real-time log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, realItv);\n            };\n            _robustUpload();\n        };\n        Logger.reportMNLog = function (policy) {\n            var self = this;\n            var currentTime = 1;\n            var connectTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n            if (policy.platform !== 'Web' || policy.logId === self.loggerCache.logId) {\n                return;\n            }\n            self.loggerCache.logId = policy.logId;\n            var _robustUpload = function () {\n                var itv = 5000;\n                var times = 3;\n                itv = itv * Math.pow(2, currentTime - 2);\n                if (currentTime === 1) {\n                    itv = 0;\n                }\n                if (currentTime <= times) {\n                    currentTime++;\n                }\n                else {\n                    return;\n                }\n                setTimeout(function () {\n                    var csvLog = RongIMLib.LoggerUtil.handleLog({ level: RongIMLib.LoggerLevel.D, startTime: policy.startTime, endTime: policy.endTime, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    if (csvLog.length === 0 && policy.endTime < connectTime) {\n                        //没有日志且连接时间大于日志消息结束时间，说明此日志消息过期，无需上传\n                        return;\n                    }\n                    else if (csvLog.length === 0 && policy.endTime > connectTime) {\n                        //没有日志且连接时间小于日志消息结束时间，说明用户连接时间在需要获取的时间内,没有日志上传 nodata\n                        csvLog = 'nodata';\n                    }\n                    var encodeCsvLog = RongIMLib.TextCompressor.compress(csvLog);\n                    var entireUrl = RongIMLib.LoggerUtil.getEntireUrl({ url: policy.uri, logId: policy.logId, type: RongIMLib.LoggerReportType.MSG_NOTIF_LOG });\n                    RongIMLib.RongUtil.request({\n                        url: entireUrl,\n                        method: 'POST',\n                        body: encodeCsvLog,\n                        timeout: self.defaultLogPolicy.timeout * 1000,\n                        success: function () {\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_S, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log'\n                                } });\n                        },\n                        error: function (status, resText) {\n                            _robustUpload();\n                            Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.G_UP_LOG_E, level: RongIMLib.LoggerLevel.D, type: RongIMLib.LoggerType.IM, content: {\n                                    desc: 'report message notification log',\n                                    status: status,\n                                    resText: resText\n                                } });\n                        }\n                    });\n                }, itv);\n            };\n            _robustUpload();\n        };\n        Logger.logStore = [];\n        Logger.defaultLogPolicy = {\n            \"logSwitch\": 1,\n            \"url\": 'logcollection.ronghub.com/',\n            \"level\": RongIMLib.LoggerLevel.E,\n            \"itv\": 20,\n            \"times\": 5,\n            \"timeout\": 15\n        };\n        Logger.loggerCache = {\n            userId: '',\n            logId: 'none',\n            isNewNavi: false,\n            hasStarted: false\n        };\n        return Logger;\n    })();\n    RongIMLib.Logger = Logger;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LoggerUtil = (function () {\n        function LoggerUtil() {\n        }\n        LoggerUtil.isLowLevelBro = function () {\n            var flag = false;\n            var bro = RongIMLib.RongUtil.getBrower();\n            if (bro.type == 'IE' && bro.version < 9) {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.isRealTimeLogType = function (type) {\n            return type === RongIMLib.LoggerReportType.REAL_TIME_LOG;\n        };\n        LoggerUtil.handleLog = function (conf) {\n            var self = this;\n            var csvLog = '';\n            var logs = RongIMLib.Logger.logStore;\n            var lastIndex = 0;\n            if (self.isRealTimeLogType(conf.type)) {\n                RongIMLib.RongUtil.forEach(logs, function (log, index) {\n                    if (log.time > self.lastTime && log.level <= conf.level) {\n                        csvLog += self.genCSVLog(log);\n                        lastIndex = index;\n                    }\n                });\n                if (csvLog.length !== 0) {\n                    self.lastTime = logs[lastIndex].time;\n                }\n            }\n            else {\n                RongIMLib.RongUtil.forEach(logs, function (log) {\n                    if (log.level <= conf.level && log.time >= conf.startTime && log.time <= conf.endTime) {\n                        csvLog += self.genCSVLog(log);\n                    }\n                });\n            }\n            return csvLog;\n        };\n        LoggerUtil.getNaviPolicy = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            var fullNavi = navi && JSON.parse(navi);\n            var policy = {};\n            var logPolicy = fullNavi.logPolicy || \"{}\";\n            var logSwitch = fullNavi.logSwitch;\n            policy = logPolicy && JSON.parse(logPolicy);\n            policy.logSwitch = logSwitch;\n            return policy;\n        };\n        LoggerUtil.genDeviceId = function () {\n            var deviceId = '';\n            var key = 'deviceId';\n            var isSupportLS = RongIMLib.RongUtil.supportLocalStorage();\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            var loggerStorage;\n            if (isSupportLS) {\n                loggerStorage = new RongIMLib.LocalStorageProvider();\n            }\n            else if (isSupportSS) {\n                loggerStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                loggerStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasDeviceId = loggerStorage.getItem(key);\n            if (hasDeviceId) {\n                deviceId = loggerStorage.getItem(key);\n            }\n            else {\n                loggerStorage.removeItem(key);\n                var uuid = RongIMLib.RongUtil.getUUID22();\n                loggerStorage.setItem(key, uuid);\n                deviceId = uuid;\n            }\n            return deviceId;\n        };\n        LoggerUtil.getSessionId = function () {\n            var sessionId = '';\n            var key = 'sessionId';\n            var sessionStorage;\n            var isSupportSS = RongIMLib.RongUtil.supportSessionStorage();\n            if (isSupportSS) {\n                sessionStorage = new RongIMLib.sessionStorageProvider();\n            }\n            else {\n                sessionStorage = new RongIMLib.MemeoryProvider();\n            }\n            var hasSessionId = sessionStorage.getItem(key);\n            if (hasSessionId) {\n                sessionId = sessionStorage.getItem(key);\n            }\n            else {\n                sessionStorage.removeItem(key);\n                var val = RongIMLib.RongUtil.getUUID22();\n                sessionStorage.setItem(key, val);\n                sessionId = val;\n            }\n            return sessionId;\n        };\n        LoggerUtil.getDeviceInfo = function () {\n            var self = this;\n            var browerInfo = RongIMLib.RongUtil.getBrower();\n            var sessionId = self.getSessionId().slice(0, 10);\n            var infoTpl = '{brower}|{version}|{sessionId}';\n            return RongIMLib.RongUtil.tplEngine(infoTpl, {\n                brower: browerInfo.type,\n                version: browerInfo.version,\n                sessionId: sessionId\n            });\n        };\n        LoggerUtil.getEntireUrl = function (opt) {\n            var self = this;\n            var tLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var mLogTpl = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n            var entireUrl = '';\n            var protocol = \"https://\";\n            if (location.protocol == \"http:\") {\n                protocol = \"http://\";\n            }\n            var paramObj = {\n                protocol: protocol,\n                url: opt.url,\n                version: RongIMLib.RongIMClient.sdkver || 'Unknown version',\n                appkey: RongIMLib.RongIMClient._memoryStore.appKey || 'Unknown appkey',\n                deviceId: self.genDeviceId(),\n                deviceInfo: self.getDeviceInfo(),\n                platform: 'Web',\n                userId: RongIMLib.Logger.loggerCache.userId || ''\n            };\n            if (self.isRealTimeLogType(opt.type)) {\n                entireUrl = RongIMLib.RongUtil.tplEngine(tLogTpl, paramObj);\n            }\n            else {\n                entireUrl = RongIMLib.RongUtil.tplEngine(mLogTpl, RongIMLib.RongUtil.extend(paramObj, {\n                    logId: opt.logId\n                }));\n            }\n            return entireUrl;\n        };\n        LoggerUtil.genCSVLog = function (log) {\n            var tpl = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n            if (log.content) {\n                var content = '\"' + log.content.replace(/\\\"/g, '\"\"') + '\"';\n            }\n            var csvLog = RongIMLib.RongUtil.tplEngine(tpl, {\n                sessionId: log.sessionId,\n                time: log.time,\n                type: log.type,\n                level: log.level,\n                tag: log.tag,\n                content: content || '\"\"'\n            });\n            return csvLog;\n        };\n        LoggerUtil.isLogCmdMsg = function (message) {\n            var flag = false;\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"LogCommandMessage\"] && message.senderUserId === 'rongcloudsystem') {\n                flag = true;\n            }\n            return flag;\n        };\n        LoggerUtil.recordFatalLogOfNavi = function (internalRetry, navigators) {\n            if (internalRetry === 3) {\n                RongIMLib.Logger.writeLog({ tag: RongIMLib.LoggerTag.IM.L_GETN_R, level: RongIMLib.LoggerLevel.F, type: RongIMLib.LoggerType.IM, content: {\n                        desc: 'Request navigation failed 3 times',\n                        navigators: navigators\n                    } });\n            }\n        };\n        LoggerUtil.lastTime = 0;\n        return LoggerUtil;\n    })();\n    RongIMLib.LoggerUtil = LoggerUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var sessionStorageProvider = (function () {\n        function sessionStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n        }\n        sessionStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.setItem(composedKey, object);\n            }\n        };\n        sessionStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return sessionStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return '';\n        };\n        sessionStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        sessionStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in sessionStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        sessionStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                sessionStorage.removeItem(composedKey.toString());\n            }\n        };\n        sessionStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in sessionStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        sessionStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(sessionStorage).length;\n        };\n        return sessionStorageProvider;\n    })();\n    RongIMLib.sessionStorageProvider = sessionStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback, null, {\n                                    isIgnoreReportStart: true\n                                });\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isNull = function (val) {\n            return Object.prototype.toString.call(val) == '[object Null]';\n        };\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            var isXDR = typeof XDomainRequest == 'function' || typeof XDomainRequest == 'object';\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var body = opts.body;\n            var success = opts.success;\n            var error = opts.error || RongUtil.noop;\n            var method = opts.method || 'GET';\n            var timeout = opts.timeout;\n            var xhr = RongUtil.createXHR();\n            if ('onload' in xhr) {\n                xhr.onload = function () {\n                    xhr.onload = RongUtil.noop;\n                    success(xhr.responseText);\n                };\n                xhr.onerror = function () {\n                    error(xhr.status, xhr.responseText);\n                    xhr.onerror = RongUtil.noop;\n                };\n            }\n            else {\n                xhr.onreadystatechange = function () {\n                    if (xhr.readyState == 4) {\n                        var status = xhr.status;\n                        if (status == 200) {\n                            success(xhr.responseText);\n                        }\n                        else {\n                            error(status, xhr.responseText);\n                        }\n                    }\n                };\n            }\n            xhr.open(method, url, true);\n            if (timeout) {\n                xhr.timeout = timeout;\n            }\n            if (body) {\n                xhr.send(body);\n                return xhr;\n            }\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.getLocalProtocol = function () {\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol === 'https:') {\n                return 'https://';\n            }\n            else {\n                return 'http://';\n            }\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getValidNavi = function (naviHost) {\n            var HttpProtocol = RongIMLib.RongIMClient.HttpProtocol;\n            var flag = '://';\n            var index = naviHost.indexOf(flag);\n            var hasProtocol = index > -1;\n            var navi = naviHost;\n            if (!hasProtocol) {\n                var protocol = RongIMLib.RongIMClient.getProtocol().protocol;\n                navi = protocol + naviHost;\n            }\n            var naviProtocol = RongUtil.getUrlProtocol(navi), localProtocol = RongUtil.getLocalProtocol();\n            // 本地为 https, 但却传入 http 时, 强制转化为 https\n            if (naviProtocol === HttpProtocol.http && localProtocol === 'https://') {\n                navi = RongUtil.formatProtoclPath({\n                    path: navi,\n                    tmpl: '{0}{1}',\n                    protocol: HttpProtocol.https,\n                    sub: true\n                });\n            }\n            return navi;\n        };\n        RongUtil.getUrlProtocol = function (url) {\n            var flag = '://';\n            var index = url.indexOf(flag);\n            if (index > -1) {\n                return url.substring(0, index + flag.length);\n            }\n            else {\n                return 'https://';\n            }\n            ;\n        };\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        RongUtil.supportSessionStorage = function () {\n            var support = false;\n            if (typeof sessionStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    sessionStorage.setItem(key, value);\n                    var localVal = sessionStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('sessionStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.isValidWsUrl = function (url) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            return invalidWsUrls.indexOf(url) === -1 && !RongUtil.isEmpty(url);\n        };\n        RongUtil.getBrower = function () {\n            var userAgent = navigator.userAgent;\n            var version;\n            var type;\n            /* 记录各浏览器名字和匹配条件 */\n            var condition = {\n                IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n                Edge: /Edge\\/([\\d.]+)/,\n                Firefox: /Firefox\\/([\\d.]+)/,\n                Opera: /(?:OPERA|OPR).([\\d.]+)/,\n                WeChat: /MicroMessenger\\/([\\d.]+)/,\n                QQBrowser: /QQBrowser\\/([\\d.]+)/,\n                Chrome: /Chrome\\/([\\d.]+)/,\n                Safari: /Version\\/([\\d.]+).*Safari/,\n                iOSChrome: /Mobile\\/([\\d.]+).*Safari/\n            };\n            for (var key in condition) {\n                if (!condition.hasOwnProperty(key))\n                    continue;\n                var browserContent;\n                if (browserContent = userAgent.match(condition[key])) {\n                    type = key;\n                    version = browserContent[1] || browserContent[2];\n                    break;\n                }\n            }\n            return {\n                type: type || 'UnKonw',\n                version: version || 'UnKonw'\n            };\n        };\n        RongUtil.string10to64 = function (number) {\n            var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''), radix = chars.length + 1, qutient = +number, arr = [];\n            do {\n                var mod = qutient % radix;\n                qutient = (qutient - mod) / radix;\n                arr.unshift(chars[mod]);\n            } while (qutient);\n            return arr.join('');\n        };\n        RongUtil.getUUID = function () {\n            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n                var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n                return v.toString(16);\n            });\n        };\n        /* 获取 22 位的 UUID */\n        RongUtil.getUUID22 = function () {\n            var uuid = this.getUUID();\n            uuid = uuid.replace(/-/g, '') + 'a';\n            uuid = parseInt(uuid, 16);\n            uuid = this.string10to64(uuid);\n            if (uuid.length > 22) {\n                uuid = uuid.slice(0, 22);\n            }\n            if (uuid.length < 22) {\n                var len = 22 - uuid.length;\n                for (var i = 0; i < len; i++) {\n                    uuid = uuid + '0';\n                }\n            }\n            return uuid;\n        };\n        RongUtil.getByteLength = function (str, charset) {\n            charset = charset || 'utf-8';\n            var total = 0, chatCode;\n            if (charset === 'utf-16') {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode <= 0xffff) {\n                        total += 2;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            else {\n                for (var i = 0, max = str.length; i < max; i++) {\n                    chatCode = str.charCodeAt(i);\n                    if (chatCode < 0x007f) {\n                        total += 1;\n                    }\n                    else if (chatCode <= 0x07ff) {\n                        total += 2;\n                    }\n                    else if (chatCode <= 0xffff) {\n                        total += 3;\n                    }\n                    else {\n                        total += 4;\n                    }\n                }\n            }\n            return total;\n        };\n        RongUtil.concat = function (before, after, isDedup) {\n            RongUtil.forEach(after, function (item) {\n                if (!isDedup || RongUtil.indexOf(before, item) === -1) {\n                    before.push(item);\n                }\n            });\n            return before;\n        };\n        RongUtil.getCurrentDate = function (seperator) {\n            var date = new Date();\n            var year = date.getFullYear();\n            var month = date.getMonth() + 1;\n            var day = date.getDate();\n            return RongUtil.tplEngine('{year}{seperator}{month}{seperator}{day}', {\n                year: year,\n                month: month,\n                day: day,\n                seperator: seperator\n            });\n        };\n        RongUtil.generateUploadFileName = function (type, fileName) {\n            var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n            var random = Math.floor((Math.random() * 1000) % 10000);\n            var uuid = this.getUUID();\n            var fileNameArr, extension;\n            if (fileName) {\n                fileNameArr = fileName.split('.');\n                extension = '.' + fileNameArr[fileNameArr.length - 1];\n            }\n            return RongUtil.tplEngine(tpl, {\n                type: type,\n                date: RongUtil.getCurrentDate('-'),\n                random: random,\n                uuid: uuid,\n                timestamp: RongUtil.getTimestamp(),\n                extension: extension || ''\n            });\n        };\n        RongUtil.isPrivateService = function () {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            return isNaviJSONP && isWSPingJSONP;\n        };\n        RongUtil.getObjectKeys = function (obj) {\n            var source = JSON.parse(JSON.stringify(obj));\n            var keys = [];\n            for (var key in source) {\n                keys.push(key);\n            }\n            return keys;\n        };\n        RongUtil.Prosumer = Prosumer;\n        RongUtil.Storage = {\n            set: function (key, value) {\n                try {\n                    RongIMLib.RongIMClient._storageProvider.setItem(key, JSON.stringify(value));\n                }\n                catch (e) { }\n            },\n            get: function (key) {\n                var value = RongIMLib.RongIMClient._storageProvider.getItem(key);\n                try {\n                    return JSON.parse(value);\n                }\n                catch (e) {\n                    return {};\n                }\n            }\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n    var Base64 = (function () {\n        function Base64() {\n        }\n        Base64.utf8_encode = function (string) {\n            string = string.replace(/\\r\\n/g, \"\\n\");\n            var utftext = \"\";\n            for (var n = 0; n < string.length; n++) {\n                var c = string.charCodeAt(n);\n                if (c < 128) {\n                    utftext += String.fromCharCode(c);\n                }\n                else if ((c > 127) && (c < 2048)) {\n                    utftext += String.fromCharCode((c >> 6) | 192);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n                else {\n                    utftext += String.fromCharCode((c >> 12) | 224);\n                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n                    utftext += String.fromCharCode((c & 63) | 128);\n                }\n            }\n            return utftext;\n        };\n        Base64.utf8_decode = function (utftext) {\n            var string = \"\";\n            var i = 0;\n            var c = 0, c1 = 0, c2 = 0, c3;\n            while (i < utftext.length) {\n                c = utftext.charCodeAt(i);\n                if (c < 128) {\n                    string += String.fromCharCode(c);\n                    i++;\n                }\n                else if ((c > 191) && (c < 224)) {\n                    c2 = utftext.charCodeAt(i + 1);\n                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n                    i += 2;\n                }\n                else {\n                    c2 = utftext.charCodeAt(i + 1);\n                    c3 = utftext.charCodeAt(i + 2);\n                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n                    i += 3;\n                }\n            }\n            return string;\n        };\n        Base64.encode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = this.utf8_encode(input);\n            while (i < input.length) {\n                chr1 = input.charCodeAt(i++);\n                chr2 = input.charCodeAt(i++);\n                chr3 = input.charCodeAt(i++);\n                enc1 = chr1 >> 2;\n                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n                enc4 = chr3 & 63;\n                if (isNaN(chr2)) {\n                    enc3 = enc4 = 64;\n                }\n                else if (isNaN(chr3)) {\n                    enc4 = 64;\n                }\n                output = output +\n                    this.keyStr.charAt(enc1) + this.keyStr.charAt(enc2) +\n                    this.keyStr.charAt(enc3) + this.keyStr.charAt(enc4);\n            }\n            return output;\n        };\n        Base64.decode = function (input) {\n            var output = \"\";\n            var chr1, chr2, chr3;\n            var enc1, enc2, enc3, enc4;\n            var i = 0;\n            input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n            while (i < input.length) {\n                enc1 = this.keyStr.indexOf(input.charAt(i++));\n                enc2 = this.keyStr.indexOf(input.charAt(i++));\n                enc3 = this.keyStr.indexOf(input.charAt(i++));\n                enc4 = this.keyStr.indexOf(input.charAt(i++));\n                chr1 = (enc1 << 2) | (enc2 >> 4);\n                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n                chr3 = ((enc3 & 3) << 6) | enc4;\n                output = output + String.fromCharCode(chr1);\n                if (enc3 != 64) {\n                    output = output + String.fromCharCode(chr2);\n                }\n                if (enc4 != 64) {\n                    output = output + String.fromCharCode(chr3);\n                }\n            }\n            output = this.utf8_decode(output);\n            return output;\n        };\n        Base64.keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n        return Base64;\n    })();\n    RongIMLib.Base64 = Base64;\n    var TextCompressor = (function () {\n        function TextCompressor() {\n        }\n        TextCompressor.compress = function (data) {\n            var self = this;\n            var map = {};\n            //构建一个用于反向查询字符位置的 map\n            for (var p = 0; p < data.length - 1; p++) {\n                var c1 = data.charAt(p);\n                var c2 = data.charAt(p + 1);\n                var c = c1 + c2;\n                if (!map.hasOwnProperty(c)) {\n                    map[c] = [p];\n                    continue;\n                }\n                map[c].push(p);\n            }\n            var compressedData = [], normalBlockBuffer = [];\n            //编码未压缩数据块\n            var encodeNormalBlock = function () {\n                if (normalBlockBuffer.length > 0) {\n                    var normalBlock = normalBlockBuffer.join('');\n                    normalBlockBuffer = [];\n                    if (normalBlock.length > 26) {\n                        var normalExtBlockLength = self.numberEncode(normalBlock.length);\n                        var normalExtBlockHeader = String.fromCharCode(self.dataType.NormalExt | normalExtBlockLength.length);\n                        compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n                    }\n                    else {\n                        var normalBlockHeader = String.fromCharCode(self.dataType.Normal | normalBlock.length);\n                        compressedData.push(normalBlockHeader);\n                    }\n                    compressedData.push(normalBlock);\n                }\n            };\n            var i = 0;\n            while (i < data.length) {\n                var r = self.indexOf(map, data, i);\n                if (r.length < 2) {\n                    normalBlockBuffer.push(data.charAt(i++));\n                    continue;\n                }\n                if (r.length < 4) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                var offset = self.numberEncode(i - r.offset);\n                var length = self.numberEncode(r.length);\n                //欲压缩的数据与数据编码后的长度一致，则不进行压缩\n                if (offset.length + length.length >= r.length) {\n                    normalBlockBuffer.push(data.substr(i, r.length));\n                    i += r.length;\n                    continue;\n                }\n                //编码未压缩数据块\n                encodeNormalBlock();\n                //编码压缩数据块\n                var compressedBlockHeader = String.fromCharCode(self.dataType.Compressed | (offset.length << 2) | length.length);\n                compressedData.push(compressedBlockHeader + offset + length);\n                i += r.length;\n            }\n            //编码剩余未压缩数据块\n            encodeNormalBlock();\n            //在数据尾部添加校验和\n            var dataLengthTo62 = self.numberEncode(data.length);\n            var tailBlockHeader = String.fromCharCode(self.dataType.Tail | dataLengthTo62.length);\n            compressedData.push(tailBlockHeader + dataLengthTo62);\n            return compressedData.join('');\n        };\n        TextCompressor.uncompress = function (data) {\n            var self = this;\n            var i = 0;\n            var result = \"\";\n            label1: do {\n                var header = data.charCodeAt(i++);\n                var headerType = header & self.dataType.Mark;\n                var headerVal = header & 0xF;\n                switch (headerType) {\n                    case self.dataType.Compressed:\n                        var p1 = headerVal >> 2;\n                        var p2 = headerVal & 3;\n                        if (p1 == 0 || p2 == 0) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        var offset = self.numberDecode(data.substr(i, p1));\n                        var len = self.numberDecode(data.substr(i += p1, p2));\n                        offset = result.length - offset;\n                        if (offset + len > result.length) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += p2;\n                        result += result.substr(offset, len);\n                        break;\n                    case self.dataType.Tail:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        if (num != result.length) {\n                            console.log(result.length);\n                            console.log(num);\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        i += headerVal;\n                        break label1;\n                    case self.dataType.NormalExt:\n                        var num = self.numberDecode(data.substr(i, headerVal));\n                        result += data.substr(i += headerVal, num);\n                        i += num;\n                        break;\n                    case self.dataType.Normal:\n                        result += data.substr(i, headerVal);\n                        i += headerVal;\n                        break;\n                    case self.dataType.Mark:\n                        if (headerVal > 10) {\n                            throw new Error(\"Data parsing error,at \" + i);\n                        }\n                        result += data.substr(i, 16 + headerVal);\n                        i += (16 + headerVal);\n                        break;\n                    default:\n                        throw new Error(\"Data parsing error,at \" + i + \" header:\" + headerType);\n                }\n            } while (i < data.length);\n            return result;\n        };\n        TextCompressor.indexOf = function (map, source, fromIndex) {\n            var self = this;\n            var result = {\n                length: 0,\n                offset: -1\n            };\n            var sourceLength = source.length;\n            if (fromIndex >= source.length - 1) {\n                return result;\n            }\n            var c1 = source.charAt(fromIndex);\n            var c2 = source.charAt(fromIndex + 1);\n            var items = map[c1 + c2];\n            if (items[0] == fromIndex) {\n                return result;\n            }\n            var space1 = source.length - fromIndex;\n            var lastChar;\n            for (var i = 0, len = items.length; i < len; i++) {\n                var item = items[i];\n                var space2 = fromIndex - item;\n                if (space2 > self.max) {\n                    continue;\n                }\n                var end = Math.min(space1, space2);\n                if (end <= result.length) {\n                    break;\n                }\n                if (result.length > 2) {\n                    if (source.charAt(item + result.length - 1) != source.charAt(fromIndex + result.length - 1)) {\n                        continue;\n                    }\n                }\n                var m = 2;\n                for (var j = m; j < end; j++) {\n                    if (source.charAt(item + j) == source.charAt(fromIndex + j)) {\n                        m++;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                if (m >= result.length) {\n                    result.length = m;\n                    result.offset = item;\n                }\n            }\n            return result;\n        };\n        /*\n        * 将数字转化为 62 进制字符串。\n        */\n        TextCompressor.numberEncode = function (num) {\n            var self = this;\n            var result = [], remainder = 0;\n            do {\n                remainder = num % self.scale;\n                result.push(self.chars.charAt(remainder));\n                num = (num - remainder) / self.scale;\n            } while (num > 0);\n            return result.join('');\n        };\n        /*\n        * 将 62 进制字符串还原为数字。\n        */\n        TextCompressor.numberDecode = function (str) {\n            var self = this;\n            var num = 0, index = 0;\n            for (var i = str.length - 1; i >= 0; i--) {\n                index = self.chars.indexOf(str.charAt(i));\n                if (index == -1) {\n                    throw new Error(\"decode number error, data is \\\"\" + str + \"\\\"\");\n                }\n                num = num * self.scale + index;\n            }\n            return num;\n        };\n        TextCompressor.dataType = {\n            Tail: 0x30,\n            Compressed: 0x40,\n            NormalExt: 0x50,\n            Normal: 0x60,\n            Mark: 0x70\n        };\n        TextCompressor.chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n        TextCompressor.scale = TextCompressor.chars.length;\n        TextCompressor.max = 238327;\n        return TextCompressor;\n    })();\n    RongIMLib.TextCompressor = TextCompressor;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat    \n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "chatroom-h5-gif/js/chatroom.js",
    "content": "; (function (global, factory, namespace) {\n\tif (typeof exports === 'object' && typeof module !== 'undefined') {\n\t\tmodule.exports = factory();\n\t} else if (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t} else {\n\t\tglobal[namespace] = factory();\n\t}\n})(window, function () {\n\t\"use strict\";\n\n\tfunction initApp(appInfo, callbacks) {\n\t\twindow.RongIM = window.RongIM || {};\n\t\tvar RongIMLib = window.RongIMLib;\n\t\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\t\tif (RongIM.ready) {\n\t\t\tcallbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t\tcallbacks.onConnected && callbacks.onConnected(RongIM.instance, RongIM.userInfo);\n\t\t\treturn;\n\t\t} else {\n\t\t\tvar appKey = appInfo.appKey;\n\t\t\tvar token = appInfo[id];\n\n\t\t\tRongIMLib.RongIMClient.init(appKey);\n\t\t\tregisterMessageType();\n\n\t\t\tRongIMClient.connect(token, {\n\t\t\t\tonSuccess: function (userId) {\n\t\t\t\t\tRongIM.ready = true;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata: { userId: userId },\n\t\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\t\tinfo: \"链接成功\"\n\t\t\t\t\t};\n\t\t\t\t\tcallbacks.onConnected && callbacks.onConnected(RongIM.instance, RongIM.userInfo);\n\t\t\t\t},\n\t\t\t\tonError: function (errorCode) {\n\t\t\t\t\tRongIM.ready = false;\n\t\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\t\tdata: {},\n\t\t\t\t\t\tstatus: \"fail\",\n\t\t\t\t\t\tinfo: errorCode\n\t\t\t\t\t};\n\n\t\t\t\t\tfor (var i = 0, len = onConnectList.length; i < len; i++) {\n\t\t\t\t\t\tonConnectList[i](RongIM.instance, RongIM.userInfo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tRongIMClient.setConnectionStatusListener({\n\t\t\tonChanged: function (status) {\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t\t\t\tRongIM.instance = RongIMClient.getInstance();\n\t\t\t\t\t\tcallbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tRongIMClient.setOnReceiveMessageListener({\n\t\t\tonReceived: function (message) {\n\t\t\t\tcallbacks.onMessage && callbacks.onMessage(message)\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction initChatRoom(appInfo, chatRoomInfo, callbacks, modules) {\n\t\tvar chatRoomId = chatRoomInfo.chatRoomId;\n\t\tvar count = chatRoomInfo.count;\n\n\t\twindow.chatRoomCallbacks = {};\n\n\t\tvar initCallbacks = {\n\t\t\tonReady: function (_instance) {\n\t\t\t},\n\t\t\tonMessage: function (message) {\n\t\t\t\tvar onMessage = callbacks.onMessage;\n\t\t\t\tif (message.conversationType == 4 && message.targetId == chatRoomId) {\n\t\t\t\t\tonMessage(message);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonConnected: function (IM, userInfo) {\n\t\t\t\tIM.joinChatRoom(chatRoomId, count, {\n\t\t\t\t\tonSuccess: function () {\n\t\t\t\t\t\tvar chatRoom = {\n\t\t\t\t\t\t\tid: chatRoomId,\n\t\t\t\t\t\t\tcurrentUser: userInfo.data,\n\t\t\t\t\t\t\tgetInfo: function (params, callbacks) {\n\t\t\t\t\t\t\t\tvar order = params.order;\n\t\t\t\t\t\t\t\tvar memberCount = params.memberCount;\n\t\t\t\t\t\t\t\tIM.getChatRoomInfo(chatRoomId, memberCount, order, callbacks);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tquit: function (callbacks) {\n\t\t\t\t\t\t\t\tIM.quitChatRoom(chatRoomId, callbacks);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsendMessage: function (msg, callbacks) {\n\t\t\t\t\t\t\t\tvar conversationType = RongIMLib.ConversationType.CHATROOM;\n\t\t\t\t\t\t\t\tIM.sendMessage(conversationType, chatRoomId, msg, callbacks);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcallbacks.onSuccess && callbacks.onSuccess(chatRoom);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function (error) {\n\t\t\t\t\t\tcallbacks.onError && callbacks.onError(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tinitApp(appInfo, initCallbacks);\n\t}\n\n\tfunction registerMessageType() {\n\t\tvar messageName = 'PersonMessage';\n\t\tvar objectName = 's:person';\n\t\tvar isCounted = true;\n\t\tvar isPersited = true;\n\t\tvar mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited);\n\t\tvar prototypes = ['name', 'portrait', 'id'];\n\t\tRongIMClient.registerMessageType(messageName, objectName, mesasgeTag, prototypes);\n\n\t\tvar messageName = 'LikerMessage';\n\t\tvar objectName = 's:liker';\n\t\tvar isCounted = false;\n\t\tvar isPersited = false;\n\t\tvar mesasgeTag = new RongIMLib.MessageTag(isCounted, isPersited);\n\t\tvar prototypes = ['likerNum'];\n\t\tRongIMClient.registerMessageType(messageName, objectName, mesasgeTag, prototypes);\n\n\t}\n\treturn {\n\t\tinit: initChatRoom\n\t};\n}, \"RongChatRoom\");"
  },
  {
    "path": "chatroom-h5-gif/js/demo.js",
    "content": "var ht = new HeartsFlow({\n  canvasEl: '.rc-hearts-canvas',\n  amount: 1\n});\n\nvar lastTime = new Date(), num = 1, t;\nvar id = window.location.search.replace('?id=', '');\nappInfo.id = id;\n\nconst messageEvent = {\n  'TextMessage': updateMessage,\n  'PersonMessage': userJoinMeeage,\n  'LikerMessage': updateLiker\n}\n\nconst chatRoomInfo = {\n  \"chatRoomId\": \"chatRoomId-001\",\n  \"count\": 0\n};\n// (function () {\n//emoji表情\n// var RongIMEmoji = RongIMLib.RongIMEmoji;\n// window.RongIMEmoji = RongIMEmoji;\n// RongIMEmoji.init();\n\n// var panel = document.getElementById(\"rc-emoji-panel\");\n// var panelBtn = document.getElementById(\"rc-chatroom-emoji\");\nvar input = document.getElementById(\"rc-chatroom-input\");\nvar btn = document.getElementById(\"rc-chatroom-button\");\n\n// var emojis = RongIMEmoji.list;\n// for (var i = 0; i < 24; i++) {\n// \tvar value = RongIMEmoji.list[i];\n// \tpanel.appendChild(value.node);\n// }\n\n// panelBtn.onclick = function () {\n// \tif (panel.style.display == \"block\") {\n// \t\tpanel.style.display = \"none\";\n// \t} else {\n// \t\tpanel.style.display = \"block\";\n// \t}\n// };\n\n// //表情选择\n// panel.onclick = function (event) {\n// \tvar e = event || window.event;\n// \tvar target = e.target || e.srcElement;\n// \tif (document.all && !document.addEventListener === false) {\n// \t\tconsole.log(target);\n// \t}\n// \tinput.value += RongIMEmoji.symbolToEmoji(target.getAttribute(\"name\"));\n// }\n\n\n\nRongChatRoom.init(appInfo, chatRoomInfo, {\n  onSuccess: function (chatRoom) {\n    var msg = new RongIMClient.RegisterMessage.PersonMessage(getUserInfo(appInfo.id));\n    chatRoom.sendMessage(msg, {\n      onSuccess: function (message) {\n        RongIMLib.chatRoom = chatRoom;\n        var welcomeMessageInfo = {\n          content: {\n            content: \"欢迎来到直播间~ 请自行调节手机音量至合适大小。\"\n          }\n        }\n        updateMessage(welcomeMessageInfo);\n      },\n      onError: function (errorCode, message) {\n        console.log(\"发送聊天室消息失败\", errorCode);\n      }\n    });\n  },\n  onError: function (error) {\n    alert('加入聊天室失败。')\n  },\n  onMessage: function (message) {\n    console.info(message);\n    let event = messageEvent[message.messageType];\n    event(message);\n  }\n});\n\nfunction send() {\n  let content = document.getElementById('rc-chatroom-input').value;\n  if (content) {\n    let messageValue = textMessageInfo = {\n      content: content,\n      user: getUserInfo(RongIMLib.chatRoom.currentUser.userId)\n    }\n    var msg = new RongIMLib.TextMessage(messageValue);\n    RongIMLib.chatRoom.sendMessage(msg, {\n      onSuccess: function (message) {\n        updateMessage(message);\n        document.getElementById('rc-chatroom-input').value = '';\n        document.getElementById('send').style.display = 'none';\n      },\n      onError: function (errorCode, message) {\n        console.log(\"发送聊天室消息失败\", errorCode);\n      }\n    });\n  }\n}\n\nfunction clicLiker() {\n  ht.startAnimation();\n  var nowTime = new Date();\n  if (Math.round(nowTime.getTime() - lastTime.getTime()) < 400) {//判断两次点击之间的时间差\n    num++;\n    lastTime = nowTime;\n    return;\n  }\n  clearTimeout(t)\n  t = setTimeout(() => {\n    let msg = new RongIMClient.RegisterMessage.LikerMessage({ likerNum: num });\n    RongIMLib.chatRoom.sendMessage(msg, {\n      onSuccess: function (message) {\n        lastTime = nowTime;\n        num = 1;\n      },\n      onError: function (errorCode, message) {\n        console.log(\"发送聊天室消息失败\", errorCode);\n      }\n    });\n  }, 400)\n  lastTime = nowTime;\n}\n\nfunction onFocus() {\n  document.getElementById('send').style.display = 'block';\n}\n\nfunction onBlur() {\n  let content = document.getElementById('rc-chatroom-input').value;\n  if (!content) {\n    document.getElementById('send').style.display = 'none';\n  }\n}\n\nfunction updateMessage(message) {\n  var t = document.getElementById(\"rc-message-list\");\n  // message.content.content = RongIMEmoji.symbolToEmoji(message.content.content);\n  var html = renderUI(message);\n  t.innerHTML += html;\n  document.getElementById('rc-message-list-wrapper').scrollTop = document.getElementById('rc-message-list-wrapper').scrollHeight;\n}\n\nfunction userJoinMeeage(message) {\n  var t = document.getElementById(\"rc-user-join\");\n  var html = renderUserUI(message.content);\n  t.innerHTML += html;\n  setTimeout(() => {\n    document.getElementById(message.content.id).remove();\n  }, 1500)\n}\n\nfunction updateLiker(message) {\n  let likerNum = message.content.likerNum\n  if (likerNum) {\n    for (let i = 0; i < likerNum; i++) {\n      ht.startAnimation();\n    }\n  }\n}"
  },
  {
    "path": "chatroom-h5-gif/js/like.js",
    "content": "class HeartsFlow {\n  constructor(data) {\n    this.el = document.querySelector(data.canvasEl);\n    this.w = 200;\n    this.h = 400;\n    this.ctx = this.el.getContext('2d');\n    this.colors = [\n      '255, 137, 164', //'#FF89A4',\n      '239, 121, 138', //'#EF798A',\n      '255, 77, 128', //'#FF4D80',\n      '249, 42, 130' //'#F92A82'\n    ];\n    this.heartsAmount = data.amount;\n    this.heartsList = [];\n    this.isAnimate = false;\n    this.raf = null;\n    this.animate = this.animate.bind(this);\n    this.paintHeart = this.paintHeart.bind(this);\n    this.stopAnimation = this.stopAnimation.bind(this);\n    this.init();\n  }\n  getRandomColor() {\n    return this.colors[Math.floor(Math.random() * this.colors.length)];\n  }\n  getRandom(min, max) {\n    return Math.floor(Math.random() * (max - min) + min);\n  }\n  setHeartsList() {\n    let arr = [];\n    for (let i = 0; i < this.heartsAmount; i++) {\n      let currentSize = this.getRandom(40, 50);\n      let dt = {\n        x: this.w / 2,\n        y: this.h,\n        bx: this.w / 2,\n        by: this.h,\n        pos: this.h,\n        _osp: this.getRandom(10, 500) / 100,\n        osp: this.getRandom(10, 12) / 10,\n        vsp: this.getRandom(currentSize, currentSize + i * 2) / 1500,\n        size: currentSize,\n        color: this.getRandomColor(),\n        alfa: 1\n      };\n\n      arr.push(dt);\n    }\n    this.heartsList = [...this.heartsList, ...arr];\n  }\n  getCoordinates({ x, y, size, color, bx, by, _osp, osp, vsp, pos, alfa }) {\n    return {\n      xst: x,\n      yst: y + size / 2,\n      x0: x - size / 1.4,\n      y0: y + size / 4,\n      x1: x - size / 1.3,\n      y1: y - size / 1.3,\n      _x0: x + size / 1.4,\n      _y0: y + size / 4,\n      _x1: x + size / 1.3,\n      _y1: y - size / 1.3,\n      xfn: x,\n      yfn: y - size / 3,\n      bx: bx,\n      by: by,\n      _osp: _osp,\n      osp: osp,\n      vsp: vsp,\n      pos: pos,\n      alfa: alfa,\n      size: size,\n      color: color\n    };\n\n  }\n  paintHeart({ xst, yst, x0, y0, _x0, _y0, x1, y1, _x1, _y1, xfn, yfn, color, alfa }) {\n    this.ctx.globalCompositeOperation = \"lighter\";\n    this.ctx.beginPath();\n    this.ctx.moveTo(xst, yst);\n    this.ctx.bezierCurveTo(x0, y0, x1, y1, xfn, yfn);\n    this.ctx.moveTo(xst, yst);\n    this.ctx.bezierCurveTo(_x0, _y0, _x1, _y1, xfn, yfn);\n    this.ctx.fillStyle = `rgba(${color}, ${alfa})`;\n    this.ctx.strokeStyle = `rgba(${color}, ${alfa})`;\n    // var img = new Image();\n    // img.src = \"like.svg\";\n    // this.ctx.drawImage(img, 5, 5);\n    this.ctx.fill();\n    this.ctx.stroke();\n    this.ctx.closePath();\n  }\n  mutateData() {\n    this.heartsList = this.heartsList.map(item => {\n      let pos = item.pos - 0.05;\n      let x = item.x + Math.sin(pos * item._osp) * ((pos - item.by) / item.osp);\n      let y = pos + (pos - item.by) / item.vsp * 1.6;\n      let alfa = this.normalize0between1(0, this.h, y).toFixed(1);\n      return {\n        ...item, x: x, y: y, pos: pos, alfa: alfa\n      };\n\n    });\n    this.heartsList = this.heartsList.filter(item => item.y > 0);\n  }\n  normalize0between1(min, max, value) {\n    return (value - min) / (max - min);\n  }\n  setCanvas() {\n    this.el.width = this.w;\n    this.el.height = this.h;\n  }\n  startAnimation() {\n    if (!this.isAnimate) {\n      this.isAnimate = true;\n      console.log('start animation');\n      this.setHeartsList();\n      this.animate();\n    } else {\n      this.setHeartsList();\n    }\n  }\n  stopAnimation() {\n    this.isAnimate = false;\n    console.log('stop animation');\n    cancelAnimationFrame(this.raf);\n  }\n  animate() {\n\n    this.ctx.clearRect(0, 0, this.w, this.h);\n\n    if (this.isAnimate) {\n      for (let i = 0, len = this.heartsList.length; i < len; i++) {\n        let hrt = this.getCoordinates(this.heartsList[i]);\n        this.paintHeart(hrt);\n      }\n      this.mutateData();\n    }\n\n    this.raf = requestAnimationFrame(this.animate);\n\n    if (this.heartsList.length === 0 && this.isAnimate) {\n      this.stopAnimation();\n    }\n  }\n  init() {\n    this.setCanvas();\n    this.setHeartsList();\n    this.animate();\n  }\n}\n\n\n"
  },
  {
    "path": "chatroom-h5-gif/js/mock.js",
    "content": "function getUserInfo(id) {\n  let userList = {\n    '11': {\n      portrait: 'http://rongcloud-image.ronghub.com/004d0444c2a1b9fdaa.png?e=1619758376&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:l2iPse-iWrQj5tT-t5mUUUm510c=',\n      name: 'test_11',\n      id: id\n    }, '22': {\n      portrait: 'http://rongcloud-image.ronghub.com/dd61f5411896b925d2.png?e=1619758397&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:EHGy80kzSdt7NqrHctC4KDYtxP8=',\n      name: 'test_22',\n      id: id\n    }\n  }\n  return userList[id];\n}\n\nconst appInfo = {\n  \"appKey\": \"8w7jv4qb82uyy\",\n  \"22\": \"cC+jhy4U9zbk1xmbzBlI1WoDLREzxk5A@yhxs.cn.rongnav.com;yhxs.cn.rongcfg.com\",\n  \"11\": \"2t6FYf/24Vzk1xmbzBlI1UHrf1LxVs40@yhxs.cn.rongnav.com;yhxs.cn.rongcfg.com\"\n};\n"
  },
  {
    "path": "chatroom-h5-gif/js/render.js",
    "content": "function render(data, template) {\n    template = template || \"\";\n    data = data || [\"\"];\n    var re = /{{((?:(?!}}).)+)}}/g, reExp = /(^( )?(var|if|for|else|switch|case|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n    var add = function (line, js) {\n        js ? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n            (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n        return add;\n    }\n    var match;\n    while (match = re.exec(template)) {\n        add(template.slice(cursor, match.index))(match[1], true);\n        cursor = match.index + match[0].length;\n    }\n    add(template.substr(cursor, template.length - cursor));\n    code += 'return r.join(\"\");';\n\n    data = isNaN(data.length) ? [data] : data;\n    var html = \"\";\n    for (var i = 0, length = data.length; i < length; i++) {\n        html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n    }\n    return html;\n}\n\nfunction renderUI(data, tpl) {\n    var _tpl = data.content.user ? ['<div class=\"rc-message\">',\n        '<div class=\"rc-message-main\">',\n        '<span class=\"rc-message-name\">{{this.content.user.name}} :</span>',\n        '    <span class=\"rc-message-content\">{{this.content.content}}</span>',\n        '</div>',\n        '</div>'].join(\"\") : ['<div class=\"rc-message\">',\n            '<div class=\"rc-message-main\">',\n            '    <span class=\"rc-message-content rc-content-color\">{{this.content.content}}</span>',\n            '</div>',\n            '</div>'].join(\"\");\n    tpl = tpl || _tpl;\n\n    return render(data, tpl);\n}\n\nfunction renderUserUI(data, tpl) {\n    var _tpl = [' <div class=\"rc-user-main\" id=\"{{this.id}}\">',\n        '<img class=\"rc-user-img\" src=\"{{this.portrait}}\">',\n        '<div class=\"rc-user-info\">',\n        '    <span class=\"rc-user-name\">{{this.name}}</span>',\n        '    <span class=\"rc-user-num\">进入了直播间</span>',\n        '</div></div>'].join(\"\");\n    tpl = tpl || _tpl;\n\n    return render(data, tpl);\n}\n"
  },
  {
    "path": "chatroom-h5-gif/style/chatroom.css",
    "content": "body,\nhtml {\n  height: 100%;\n  margin: 0;\n  padding: 0;\n}\n\n#view {\n  width: 100%;\n  height: 100%;\n  position: relative;\n}\n.rc-video-body{\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  background: url(./img/backageGif.gif) no-repeat;\n  background-size: 100% 100%;\n  background-color: #fff;\n  background-size: cover;\n  -webkit-background-size: cover;\n  -o-background-size: cover;\n  background-position: center 0; \n}\nvideo {\n  width: 100%;\n  height: 100%;\n  padding: 0;\n  margin: 0;\n  object-fit: fill;\n}\n\n.rc-chat {\n  width: 310px;\n  height: 100px;\n  background: rgb(0 0 0 / 0.3);\n  border-radius: 60px;\n  position: absolute;\n  top: 40px;\n  left: 40px;\n  font-size: 28px;\n}\n.rc-chat-name, .rc-chat-num, .rc-user-join span{\n  display: block;\n  color: #FFFFFF;\n}\n.rc-chat-name, .rc-user-name{\n  font-size: 36px;\n}\n.rc-chat-img, .rc-user-img{\n  margin: 12px;\n  width: 80px;\n  height: 80px;\n}\n.rc-user-join {\n  height: 100px;\n  position: absolute;\n  bottom: 440px;\n  left: 40px;\n  font-size: 28px;\n \n}\n\n/* .rc-video-body img{\n  width: 100%;\n  height: 100%;\n} */\n.rc-user-main{\n  background: linear-gradient(180deg, rgb(248 99 50 / 0.5) 0%, rgb(248 29 67 / 0.5) 70%);\n  border-radius: 60px;\n  animation:mymove 1.5s;\n  animation-iteration-count:1;\n  \n  /* Safari and Chrome */\n  -webkit-animation:mymove 1.5s;\n  -webkit-animation-iteration-count:1;\n  position: relative;\n}\n@keyframes mymove\n{\nfrom {left:-200px;opacity: 0;}\nto {left:0px;opacity: 1;}\n}\n\n@-webkit-keyframes mymove /* Safari and Chrome */\n{\n  from {left:-200px;opacity: 0;}\n  to {left:0px;opacity: 1;}\n}\n.rc-user-info {\n  display: inline-block;\n  vertical-align: top;\n  padding-right: 20px;\n  padding-top: 6px;\n}\n.rc-chat-info{\n  display: inline-block;\n  vertical-align: top;\n  padding-top: 10px;\n}\n.rc-main {\n  width: 100%;\n  height: 100%;\n  background: #ccc;\n  padding: 0;\n  margin: 0;\n}\n.rc-chatroom * {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.rc-chatroom {\n  position: fixed;\n  bottom: 0;\n  width: 100%;\n  max-height: 400px;\n}\n\n.rc-message-list-wrapper {\n  /* width: 100%;\n  max-height: 300px;\n  overflow: auto;\n  position: relative; */\n  width: 100%;\n  max-height: 300px;\n  overflow: auto;\n  position: absolute;\n  bottom: 140px;\n  font-size: 28px;\n  font-weight: 400;\n  color: #FFFFFF;\n\n}\n\n.rc-message-list {\n  margin: 8px 24px;\n}\n\n.rc-message {\n  color: #FFFFFF;\n  margin: 12px 0;\n}\n.rc-message-main {\n  display: inline-block;\n  background: rgb(0 0 0 / 0.3);\n  border-radius: 26px;\n  padding: 24px;\n  font-size: 28px;\n  line-height: 28px;\n}\n.rc-message-portrait {\n  display: inline-block;\n  float: left;\n  margin: 5px;\n}\n\n.rc-message-portrait img {\n  width: 40px;\n  height: 40px;\n  border: 1px solid #ccc;\n  border-radius: 50%;\n}\n\n.rc-message-name {\n  display: inline-block;\n  color: #FFD451;\n}\n\n.rc-message-content {\n  margin-left: 0.3em;\n  font-size: 27px;\n}\n\n.rc-chatroom-user {\n  /* height: 30px;\n  padding: 5px;\n  padding-bottom: 10px;\n  position: relative; */\n  position: absolute;\n  bottom: 24px;\n  width: calc(100% - 200px);\n  margin: 24px;\n}\n\n.rc-emoji-panel {\n  display: none;\n  width: 19em;\n  border: 1px solid #ccc;\n  padding: 10px;\n  background: #f5f5f5;\n  position: absolute;\n  left: 3px;\n  bottom: 40px;\n}\n\n.rc-chatroom-emoji {\n  line-height: 30px;\n  font-size: 28px;\n  cursor: pointer;\n}\n\n.rc-chatroom-input {\n  /* width: 72%;\n  height: 24px;\n  padding: 2px;\n  border: 1px solid #ccc;\n  background: #f5f5f5; */\n  width: 100%;\n  height: 76px;\n  background: #000000;\n  border-radius: 38px;\n  opacity: 0.3;\n  border: 1px solid #FFFFFF;\n  color: #E0E0E0;\n  font-size: 30px;\n  padding-left: 30px;\n  -web-kit-appearance:none;\n  -moz-appearance: none;\n}\ninput::-webkit-search-cancel-button{\n  -webkit-appearance: none; \n}\n.rc-chatroom-button {\n  background: #333;\n  color: #fff;\n  border-radius: 3px;\n  padding: 6px 20px;\n}\n\n.rc-liker {\n  position: absolute;\n  bottom: 24px;\n  margin: 24px 0;\n  right: 0px;\n}\n\n.rc-hearts-btn {\n  display: flex;\n  position: absolute;\n  left: 50%;\n  width: 76px;\n  height: 76px;\n  border-radius: 50%;\n  border: none;\n  cursor: pointer;\n  background: url(./img/like.svg);\n  transform: translate(-50%, -100%);\n  outline: none;\n}\n\n.rc-hearts-btn:hover {\n  background-color: #F92A82;\n}\n\n\n::-webkit-input-placeholder { /* WebKit browsers */\n  color: #E0E0E0;\n}\n\n::-moz-placeholder { /* Mozilla Firefox 19+ */\n  color: #E0E0E0;\n}\n\n:-ms-input-placeholder { /* Internet Explorer 10+ */\n  color: #E0E0E0;\n}   \n\n.rc-content-color{\n  color: #FFD451\n}\n.rc-send {\n  width: 50px;\n  position: absolute;\n  right: 40px;\n  bottom: 10px;\n  display: none;\n}"
  },
  {
    "path": "chrm-kv-demo/README.md",
    "content": "### 聊天室自定义属性 Demo\n\n#### Demo 作用\n\n1. 验证自定义属性功能是否可用\n2. 提供接口直接接口调用, 方便开发者调试\n\n`注:` 若需实现复杂业务逻辑, 开发者可根据以下文档集成\n\n文档: [https://docs.rongcloud.cn/im/imlib/web/chatroom/](https://docs.rongcloud.cn/im/imlib/web/chatroom/)\n\n#### 快速运行\n\n1、配置信息\n\n`位置:` setting.js\n\n```js\nwindow.setting = {\n  appkey: 'appkey', // 开发者获取的融云 AppKey\n  userList: [\n    {\n      token: 'user1 token' // 第一个登陆用户的 token\n    },\n    {\n      token: 'user2 token' // 第二个登陆用户的 token\n    },\n    {\n      token: 'user3 token' // 第三个登陆用户的 token\n    }\n  ],\n  chatRoomIdList: [\n    'kvchatroom1', // 聊天室 1 的 id\n    'kvchatroom2' // 聊天室 2 的 id\n  ]\n};\n```\n\n2、页面运行\n\n`页面:` index.html\n\n通过此页面, 可登陆三个用户(可开启多 tab 页测试)\n\n`用户 1:` localhost/websdk-demo/chrm-kv-demo/?0\n\n`用户 2:` localhost/websdk-demo/chrm-kv-demo/?1\n\n`用户 3:` localhost/websdk-demo/chrm-kv-demo/?2\n\n`注:` 建议使用 [nginx](http://nginx.org/en/download.html) 或 [Node.js puer](https://www.npmjs.com/package/puer) 启动页面"
  },
  {
    "path": "chrm-kv-demo/css/main.css",
    "content": "html, body {\n  width: 100%;\n  height: 100%;\n  color: #333;\n}\n\nhtml button, body button {\n  outline: none;\n}\n\n.rong-chrm-btns {\n  text-align: center;\n}\n\n.rong-chrm-btns button {\n  width: 135px;\n  height: 33px;\n  border: 1px solid #333;\n  color: #333;\n  background-color: white;\n  border-radius: 4px;\n  font-size: 13px;\n  margin: 5px;\n}\n\n.rong-chrm-dialog {\n  position: absolute;\n  top: 35%;\n  width: 100%;\n  text-align: center;\n  border-radius: 3px;\n  background-color: white;\n}\n\n.rong-chrm-dialog .rong-chrm-input-box + .rong-chrm-input-box {\n  margin: 12px 0;\n}\n\n.rong-chrm-dialog .rong-chrm-input-box {\n  font-size: 14px;\n}\n\n.rong-chrm-dialog .rong-chrm-input-box label {\n  display: inline-block;\n  width: 40px;\n  text-align: right;\n  padding-right: 5px;\n}\n\n.rong-chrm-dialog .rong-chrm-input-box input[type=\"text\"] {\n  width: 130px;\n  height: 18px;\n}\n\n.rong-chrm-dialog .rong-chrm-input-box + .rong-chrm-input-btn-box {\n  text-align: center;\n  margin-bottom: 0;\n}\n\n.rong-chrm-dialog .rong-chrm-dialog-box {\n  position: relative;\n  display: inline-block;\n  padding: 9px;\n  border: 1px solid #333;\n  z-index: 12;\n  background-color: white;\n}\n\n.rong-chrm-loading .rong-chrm-loading-box {\n  position: relative;\n  display: inline-block;\n  padding: 12px 30px;\n  border: 1px solid #333;\n}\n\n.rong-tip-show {\n  float: left;\n}\n\n.rong-tip-show li {\n  position: relative;\n  z-index: 11;\n}\n\n.rong-tip-clear {\n  float: left;\n}\n"
  },
  {
    "path": "chrm-kv-demo/css/main.scss",
    "content": "$black: #333;\n\nhtml, body {\n  width: 100%;\n  height: 100%;\n  color: $black;\n  button {\n    outline: none;\n  }\n}\n.rong-chrm-btns {\n  text-align: center;\n  button {\n    width: 135px;\n    height: 33px;\n    border: 1px solid $black;\n    color: $black;\n    background-color: white;\n    border-radius: 4px;\n    font-size: 13px;\n    margin: 5px;\n  }\n}\n.rong-chrm-dialog {\n  position: absolute;\n  top: 35%;\n  width: 100%;\n  text-align: center;\n  border-radius: 3px;\n  background-color: white;\n  .rong-chrm-input-box + .rong-chrm-input-box {\n    margin: 12px 0;\n  }\n  .rong-chrm-input-box {\n    font-size: 14px;\n    label {\n      display: inline-block;\n      width: 40px;\n      text-align: right;\n      padding-right: 5px;\n    }\n    input[type=\"text\"] {\n      width: 130px;\n      height: 18px;\n    }\n  }\n  .rong-chrm-input-box + .rong-chrm-input-btn-box {\n    text-align: center;\n    margin-bottom: 0;\n  }\n  .rong-chrm-dialog-box {\n    position: relative;\n    display: inline-block;\n    padding: 9px;\n    border: 1px solid $black;\n    z-index: 12;\n    background-color: white;\n  }\n}\n.rong-chrm-loading {\n  .rong-chrm-loading-box {\n    position: relative;\n    display: inline-block;\n    padding: 12px 30px;\n    border: 1px solid $black;\n  }\n}\n\n.rong-tip-show {\n  float: left;\n  width: 100%;\n  li {\n    position: relative;\n    z-index: 11;\n  }\n}\n\n.rong-tip-clear {\n  float: left;\n}\n\n// .rong-tip-ws-show {\n//   float: right;\n//   width: 40%;\n// }"
  },
  {
    "path": "chrm-kv-demo/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <link rel=\"stylesheet\" href=\"./css/main.css\">\n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n  <script src=\"setting.js\"></script>\n  <script src=\"./js/init.js\"></script>\n  <script src=\"./js/utils.js\"></script>\n  <title>聊天室 kv 存储 Demo</title>\n</head>\n<body>\n  <div class=\"rong-chrm-btns\">\n    <div id=\"chrmJoining\">\n      <button onclick=\"RongIM.main.joinChatRoom(0)\">加入聊天室1</button>\n      <button onclick=\"RongIM.main.joinChatRoom(1)\">加入聊天室2</button>\n    </div>\n    <div id=\"chrmJoined\" class=\"rong-chrm-joined\" style=\"display: none;\">\n      <button onclick=\"RongIM.main.showChrmSetDialog([], 'setChatroomEntryForce')\">设置 Key（强制）</button>\n      <button onclick=\"RongIM.main.showChrmSetDialog([], 'setChatroomEntry')\">设置 Key（不强制）</button><br>\n      <button onclick=\"RongIM.main.showChrmSetDialog(['chrmSetValueBox', 'chrmSetDeleteBox'], 'removeChatroomEntryForce')\">删除 Key（强制）</button>\n      <button onclick=\"RongIM.main.showChrmSetDialog(['chrmSetValueBox', 'chrmSetDeleteBox'], 'removeChatroomEntry')\">删除 Key（不强制）</button><br>\n      <button onclick=\"RongIM.main.getAllChatroomEntry()\">获取所有 Key</button>\n      <button onclick=\"RongIM.main.showChrmSetDialog(['chrmSetValueBox', 'chrmSetDeleteBox', 'chrmSetExtraBox', 'chrmSetSendBox'], 'getChatroomEntry')\">获取指定 Key</button>\n      <br>\n      <button\n        onclick=\"RongIM.main.quitChatroom()\">退出聊天室</button>\n    </div>\n  </div>\n  <button id=\"chrmTipsClear\" class=\"rong-tip-clear\">点击清屏</button>\n  <ol id=\"chrmTips\" class=\"rong-tip-show\"></ol>\n  <ol id=\"chrmWSTips\" class=\"rong-tip-show rong-tip-ws-show\">\n    <br><br><hr>\n  </ol>\n\n\n  <div id=\"chrmSetDialog\" class=\"rong-chrm-dialog\" style=\"display: none;\">\n    <div class=\"rong-chrm-dialog-box\">\n      <div class=\"rong-chrm-input-box\"><label>key:</label><input id=\"chrmKey\" type=\"text\"></div>\n      <div id=\"chrmSetValueBox\" class=\"rong-chrm-input-box\"><label>value:</label><input id=\"chrmValue\" type=\"text\"></div>\n      <div id=\"chrmSetExtraBox\" class=\"rong-chrm-input-box\"><label>extras:</label><input id=\"chrmExtra\" type=\"text\"></div>\n      <div id=\"chrmSetDeleteBox\" class=\"rong-chrm-input-box\">\n        <label></label>\n        <input id=\"chrmDelete\" type=\"checkbox\">退出是否删除\n      </div>\n      <div id=\"chrmSetSendBox\" class=\"rong-chrm-input-box\">\n        <label></label>\n        <input id=\"chrmSend\" type=\"checkbox\">是否发送通知\n      </div>\n      <div class=\"rong-chrm-input-box rong-chrm-input-btn-box\">\n        <button onclick=\"RongIM.main.confirmSetChrm()\">确定</button>\n        <button onclick=\"RongIM.main.hideChrmSetDialog()\">取消</button>\n      </div>\n    </div>\n  </div>\n\n  <div id=\"chrmLoading\" class=\"rong-chrm-dialog rong-chrm-loading\" style=\"display: none;\">\n    <div class=\"rong-chrm-loading-box\">\n      <p class=\"rong-chrm-loading-content\">\n        正在加载中 ....\n      </p>\n    </div>\n  </div>\n\n</body>\n<script src=\"./js/main.js\"></script>\n</html>"
  },
  {
    "path": "chrm-kv-demo/js/init.js",
    "content": "(function (dependencies) {\n  var win = dependencies.win,\n    RongIMLib = dependencies.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient;\n\n  function reconnect() {\n    var config = {\n      // 默认 false, true 启用自动重连，启用则为必选参数\n      auto: true,\n      // 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n      url: 'cdn.ronghub.com/RongIMLib-2.2.6.min.js',\n      // 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n      rate: [100, 1000, 3000, 6000, 10000, 18000]\n    };\n    RongIMClient.reconnect({\n      onSuccess: function (userId) {\n        console.log('Reconnect successfully.' + userId);\n      },\n      onTokenIncorrect: function () {\n        console.log('Reconnect error token 无效');\n      },\n      onError: function (errorCode) {\n        reconnect();\n        console.log('Reconnet error', errorCode);\n      }\n    }, config);\n  }\n\n  function init(params, callbacks) {\n    callbacks = callbacks || {};\n    var appKey = params.appkey,\n      token = params.token;\n\n    RongIMClient.init(appKey, null, params);\n\n    RongIMClient.setConnectionStatusListener({\n      onChanged: function (status) {\n        switch (status) {\n          case RongIMLib.ConnectionStatus['CONNECTED']:\n          case 0:\n            break;\n          case RongIMLib.ConnectionStatus['CONNECTING']:\n          case 1:\n            console.log('连接中');\n            break;\n          case RongIMLib.ConnectionStatus['DISCONNECTED']:\n          case 2:\n            console.log('当前用户主动断开链接');\n            break;\n          case RongIMLib.ConnectionStatus['NETWORK_UNAVAILABLE']:\n          case 3:\n            reconnect();\n            console.log('网络不可用');\n            break;\n\n          case RongIMLib.ConnectionStatus['CONNECTION_CLOSED']:\n          case 4:\n            console.log('未知原因，连接关闭');\n            break;\n\n          case RongIMLib.ConnectionStatus['KICKED_OFFLINE_BY_OTHER_CLIENT']:\n          case 6:\n            console.log('用户账户在其他设备登录，本机会被踢掉线');\n            break;\n          case RongIMLib.ConnectionStatus['DOMAIN_INCORRECT']:\n          case 12:\n            console.log('当前运行域名错误，请检查安全域名配置');\n            break;\n          default:\n            console.log('Status Changed', status);\n            break;\n        }\n      }\n    });\n\n    RongIMClient.setOnReceiveMessageListener({\n      // 接收到的消息\n      onReceived: function (message) {\n        callbacks.receiveMessages(message);\n      }\n    });\n\n    RongIMClient.connect(token, {\n      onSuccess: function (userId) {\n        console.log('连接成功', userId);\n        callbacks.connected && callbacks.connected(null, userId);\n      },\n      onTokenIncorrect: function (errorCode) {\n        callbacks.connected(errorCode);\n        console.log('token 无效');\n      },\n      onError: function (errorCode) {\n        callbacks.connected(errorCode);\n        console.log('connect error', errorCode);\n      }\n    }, params.userId);\n  }\n\n  win.RongIM = win.RongIM || {};\n  win.RongIM.init = init;\n\n})({\n  win: window,\n  RongIMLib: RongIMLib,\n  RongIMClient: RongIMClient\n});"
  },
  {
    "path": "chrm-kv-demo/js/main.js",
    "content": "(function (dependencies) {\n  var RongIM = dependencies.RongIM,\n    win = dependencies.win,\n    RongIMLib = win.RongIMLib,\n    RongIMClient = RongIMLib.RongIMClient,\n    ErrorCode = RongIMLib.ErrorCode,\n    utils = RongIM.utils;\n\n  var ChrmJoinedDomId = 'chrmJoined',\n    ChrmJoiningDomId = 'chrmJoining',\n    ChrmTipDomId = 'chrmTips',\n    ChrmSetDomId = 'chrmSetDialog',\n    ChrmLoadingDomId = 'chrmLoading';\n    ChrmTipsClearDomId = 'chrmTipsClear';\n\n  var ChrmSetKeyDomId = 'chrmKey',\n    ChrmSetValueDomId = 'chrmValue', ChrmSetValueBoxDomId = 'chrmSetValueBox', \n    ChrmSetExtraDomId = 'chrmExtra', ChrmSetExtraBoxDomId = 'chrmSetExtraBox',\n    ChrmSetDeleteDomId = 'chrmDelete', ChrmSetDeleteBoxDomId = 'chrmSetDeleteBox',\n    ChrmSetSendDomId = 'chrmSend', ChrmSetSendBoxDomId = 'chrmSetSendBox';\n\n  var waitingFunc, joinedChatroomId;\n  \n  function getLoginUser() {\n    var index = location.search.substring(1);\n    return win.setting.userList[index];\n  }\n\n  function getChatRoomId(index) {\n    return win.setting.chatRoomIdList[index];\n  }\n\n  function showJoined() {\n    utils.showDom(ChrmJoinedDomId);\n    utils.hideDom(ChrmJoiningDomId);\n  }\n\n  function clearChrmSetDialogStatus() {\n    var clearDomIds = [ChrmSetKeyDomId, ChrmSetValueDomId, ChrmSetExtraDomId, ChrmSetDeleteDomId, ChrmSetSendDomId];\n    var boxIds = [ChrmSetValueBoxDomId, ChrmSetExtraBoxDomId, ChrmSetDeleteBoxDomId, ChrmSetSendBoxDomId];\n    utils.forEach(clearDomIds, function (domId) {\n      var dom = utils.getDom(domId);\n      dom.value = '';\n      dom.checked = false;\n    });\n    utils.forEach(boxIds, function (domId) {\n      utils.showDom(domId);\n    });\n  }\n\n  function showChrmSetDialog(hideIds, waitingFuncName) {\n    utils.showDom(ChrmSetDomId);\n    utils.forEach(hideIds, function (domId) {\n      utils.hideDom(domId);\n    });\n    waitingFunc = waitingFuncName;\n  }\n\n  function hideChrmSetDialog() {\n    clearChrmSetDialogStatus();\n    utils.hideDom(ChrmSetDomId);\n    waitingFunc = null;\n  }\n\n  function showTips(data) {\n    var dom = document.getElementById(ChrmTipDomId);\n    var time = utils.formatDate(new Date());\n    dom.innerHTML += '<li>' + time + ':  ' + data + '</li>';\n  }\n\n  function clearTips() {\n    var dom = document.getElementById(ChrmTipDomId);\n    dom.innerHTML = '';\n  }\n\n  function showSendWSTips(data) {\n    data = JSON.stringify(data);\n    var dom = document.getElementById('chrmWSTips');\n    var time = utils.formatDate(new Date());\n    dom.innerHTML += '<li>' + time + ':  SendMsg: ' + data + '</li>';\n  }\n  window.showSendWSTips = showSendWSTips;\n\n  function showReceiveWSTips(data) {\n    data = JSON.stringify(data);\n    var dom = document.getElementById('chrmWSTips');\n    var time = utils.formatDate(new Date());\n    dom.innerHTML += '<li>' + time + ':  ReceiveMsg: ' + data + '</li>';\n  }\n  window.showReceiveWSTips = showReceiveWSTips;\n\n  function showLoading() {\n    utils.showDom(ChrmLoadingDomId);\n  }\n\n  function hideLoading() {\n    utils.hideDom(ChrmLoadingDomId);\n  }\n\n  function joinChatRoom(index) {\n    chatRoomId = getChatRoomId(index);\n    showLoading();\n    RongIMClient.getInstance().joinChatRoom(chatRoomId, 50, {\n      onSuccess: function () {\n        hideLoading();\n        showTips('加入聊天室 ' + chatRoomId + ' 成功');\n        showJoined();\n        joinedChatroomId = chatRoomId;\n      },\n      onError: function (error) {\n        showTips('加入聊天室失败' + error + ' ' + ErrorCode[error]);\n      }\n    });\n  }\n\n  function getChrmSetParams() {\n    return {\n      key: utils.getInputValue(ChrmSetKeyDomId),\n      value: utils.getInputValue(ChrmSetValueDomId),\n      notificationExtra: utils.getInputValue(ChrmSetExtraDomId),\n      isAutoDelete: utils.getCheckValue(ChrmSetDeleteDomId),\n      isSendNotification: utils.getCheckValue(ChrmSetSendDomId)\n    };\n  }\n\n  function setChatroomEntry(params) {\n    params = params || getChrmSetParams();\n    RongIMClient.getInstance().setChatroomEntry(joinedChatroomId, params, {\n      onSuccess: function () {\n        showTips('设置 kv 成功 ' + utils.toString(params));\n      },\n      onError: function (error) {\n        showTips('设置 kv 失败 ' + error + ' ' + ErrorCode[error]);\n      }\n    });\n  }\n\n  function setChatroomEntryForce() {\n    var params = getChrmSetParams();\n    params = params || getChrmSetParams();\n    RongIMClient.getInstance().forceSetChatroomEntry(joinedChatroomId, params, {\n      onSuccess: function () {\n        showTips('强制设置 kv 成功 ' + utils.toString(params));\n      },\n      onError: function (error) {\n        showTips('强制设置 kv 失败 ' + error + ' ' + ErrorCode[error]);\n      }\n    });\n  }\n\n  function removeChatroomEntry(params) {\n    params = params || getChrmSetParams();\n    RongIMClient.getInstance().removeChatroomEntry(joinedChatroomId, params, {\n      onSuccess: function () {\n        showTips('删除 kv 成功 ' + utils.toString(params));\n      },\n      onError: function (error) {\n        showTips('删除 kv 失败 ' + error + ' ' + ErrorCode[error]);\n      }\n    });\n  }\n\n  function removeChatroomEntryForce(params) {\n    params = params || getChrmSetParams();\n    RongIMClient.getInstance().forceRemoveChatroomEntry(joinedChatroomId, params, {\n      onSuccess: function () {\n        showTips('强制删除 kv 成功 ' + utils.toString(params));\n      },\n      onError: function (error) {\n        showTips('强制删除 kv 失败 ' + error + ' ' + ErrorCode[error]);\n      }\n    });\n  }\n\n  function getChatroomEntry() {\n    var params = getChrmSetParams();\n    RongIMClient.getInstance().getChatroomEntry(joinedChatroomId, params.key, {\n      onSuccess: function (value) {\n        showTips('获取' + params.key + ' 的 value 成功 ' + value);\n      },\n      onError: function (error) {\n        showTips('获取 value 失败 ' + error + ' ' + ErrorCode[error]);\n      }\n    });\n  }\n\n  function getAllChatroomEntry() {\n    var params = getChrmSetParams();\n    RongIMClient.getInstance().getAllChatroomEntries(joinedChatroomId, {\n      onSuccess: function (items) {\n        showTips('获取所有 kv:' + JSON.stringify(items));\n      },\n      onError: function (error) {\n        showTips('获取所有 kv 失败: ' + error);\n      }\n    });\n  }\n\n  function quitChatroom() {\n    RongIMClient.getInstance().quitChatRoom(joinedChatroomId, {\n      onSuccess: function() {\n        alert('退出' + joinedChatroomId + '成功');\n        window.location.reload();\n      },\n      onError: function(error) {\n        alert('退出失败' + error);\n      }\n    })\n  }\n\n  function confirmSetChrm() {\n    waitingFunc & RongIM.main[waitingFunc]();\n    hideChrmSetDialog();\n  }\n\n  showLoading();\n  window.setting.token = getLoginUser().token;\n  RongIM.init(window.setting, {\n    connected: function (errorCode, userId) {\n      if (errorCode) {\n        showTips('链接失败 ' + errorCode);\n      } else {\n        showTips('链接成功 ' + userId);\n      }\n      hideLoading();\n    },\n    receiveMessages: function (message) {\n      showTips('收到消息 ' + utils.toString(message));\n    }\n  });\n  utils.getDom(ChrmTipsClearDomId).onclick = clearTips;\n\n  RongIM.main = {\n    hideChrmSetDialog: hideChrmSetDialog,\n    showChrmSetDialog: showChrmSetDialog,\n    joinChatRoom: joinChatRoom,\n    confirmSetChrm: confirmSetChrm,\n    \n    setChatroomEntry: setChatroomEntry,\n    setChatroomEntryForce: setChatroomEntryForce,\n    removeChatroomEntry: removeChatroomEntry,\n    removeChatroomEntryForce: removeChatroomEntryForce,\n    getChatroomEntry: getChatroomEntry,\n    getAllChatroomEntry: getAllChatroomEntry,\n    quitChatroom: quitChatroom\n  };\n\n})({\n  win: window,\n  RongIM: window.RongIM\n});"
  },
  {
    "path": "chrm-kv-demo/js/utils.js",
    "content": "(function (dependencies) {\n  var win = dependencies.win;\n\n  var isObject = function (obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  };\n  var isArray = function (arr) {\n    return Object.prototype.toString.call(arr) === '[object Array]';\n  };\n\n  var getDom = function (id) {\n    return document.getElementById(id);\n  }\n  var showDom = function (id) {\n    var dom = getDom(id);\n    dom.style.display = 'block';\n  };\n  var hideDom = function (id) {\n    var dom = getDom(id);\n    dom.style.display = 'none';\n  };\n  var createDom = function (innerHTML) {\n    var div = win.document.createElement('div');\n    div.innerHTML = innerHTML;\n    return div.children[0];\n  }\n  var appendDom = function (tempId) {\n    var temp = document.getElementById(tempId).innerText;\n    var dom = createDom(temp);\n    document.body.appendChild(dom);\n  };\n\n  var getInputValue = function (domId) {\n    var dom = getDom(domId);\n    return dom.value;\n  };\n\n  var getCheckValue = function (domId) {\n    var dom = getDom(domId);\n    return dom.checked;\n  };\n\n  var forEach = function(obj, callback) {\n    callback = callback || noop;\n    var loopObj = function() {\n      for (var key in obj) {\n        callback(obj[key], key, obj);\n      }\n    };\n    var loopArr = function() {\n      for (var i = 0, len = obj.length; i < len; i++) {\n        callback(obj[i], i);\n      }\n    };\n    if (isObject(obj)) {\n      loopObj();\n    }\n    if (isArray(obj)) {\n      loopArr();\n    }\n  };\n\n  function toString(obj) {\n    return JSON.stringify(obj);\n  }\n\n  function formatDate(time) {\n    var year = time.getFullYear();\n    var month = time.getMonth() + 1;\n    var date = time.getDate();\n    var hour = time.getHours();\n    var minute = time.getMinutes();\n    var second = time.getSeconds();\n    return year + '-' + month + '-' + date + ' ' + hour + ':' + minute + ':' + second;\n  }\n\n  RongIM = win.RongIM || {};\n  RongIM.utils = {\n    getDom: getDom,\n    showDom: showDom,\n    hideDom: hideDom,\n    createDom: createDom,\n    appendDom: appendDom,\n    getInputValue: getInputValue,\n    getCheckValue: getCheckValue,\n\n    forEach: forEach,\n    toString: toString,\n    formatDate: formatDate\n  };\n})({\n  win: window\n});"
  },
  {
    "path": "chrm-kv-demo/setting.js",
    "content": "window.setting = {\n  appkey: 'appkey',\n  userList: [\n    {\n      token: 'user1 token'\n    },\n    {\n      token: 'user2 token'\n    },\n    {\n      token: 'user3 token'\n    }\n  ],\n  chatRoomIdList: [\n    'kvchatroom1',\n    'kvchatroom2'\n  ]\n};"
  },
  {
    "path": "common-im/css/common.css",
    "content": "html,body{\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 12px;\n\theight: 100%;\n\twidth: 100%;\n\toverflow: hidden;\n}\n\na{\n\ttext-decoration: none;\n\tcolor: #333;\n}\n\na:hover{\n\tcolor: #53779E;\n\ttransition: all 0.3s;\n}\n\n.rong-input{\n\toutline: none;\n\tborder: none;\n}\n\n.rong-avatar{\n\theight: 40px;\n\twidth: 40px;\n\tbackground-size: contain;\n    border-radius: 20px;\n  border: 1px solid #FFF;\n}\n\n.rong-selected{\n\tbackground-color: #E0E8F2;\n}\n\n.rong-clearfix{\n\tclear: both;\n}"
  },
  {
    "path": "common-im/css/main.css",
    "content": ".rong-im{\n\tposition: relative;\n    width: 100%;\n    height: 100%;\n    min-width: 1200px;\n    background: url(images/main-bg.jpg) no-repeat;\n    background-size: 100%;\n    background-position: center;\n}\n\n.rong-conversation-box{\n\theight: 100%;\n\twidth: 300px;\n\tmin-width: 300px;\n\tfloat: left;\n\tposition: relative;\n}\n\n.rong-conversation-list{\n    height: 100%;\n    overflow-y: auto;\n    background: #202C3B;\n    opacity: 0.9;\n}\n\n.rong-conversation{\n\twidth: 100%;\n    height: 60px;\n    position: relative;\n    box-sizing: border-box;\n    padding-top: 10px;\n    padding-left: 5px;\n    padding-right: 5px;\n    cursor: pointer;\n}\n\n.rong-conversation:hover{\n\tbackground-color: #F3F1F1;\n\ttransition: all 0.5s;\n}\n\n.rong-conversation-user{\n\tfloat: left;\n}\n\n.rong-conversation-avatar{\n\tmargin-right: 10px;\n}\n\n.rong-conversation-title{\n\tfont-size: 13px;\n}\n\n.rong-conversation-message{\n\tfloat: left;\n\tcolor: #999;\n  width: 75%;\n  margin-top: 6px;\n}\n\n.rong-conversation-sendername{\n  float: left;\n}\n\n.rong-conversation-content{\n  display: inline-block;\n  text-overflow: ellipsis;\n  overflow: hidden;\n  white-space: nowrap;\n  width: 80%;\n}\n\n.rong-conversation-senttime{\n\tfloat: right;\n    position: relative;\n    top: -18px;\n}\n\n.rong-main{\n\theight: 100%;\n\tmargin-left: 300px;\n\tposition: relative;\n}\n\n.rong-message-list{\n\twidth: 100%;\n\tposition: absolute;\n\ttop: 10px;\n\tbottom: 60px;\n\toverflow-y: auto;\n}\n\n.rong-message{\n\tmin-height: 40px;\n\tmargin-top: 10px;\n}\n\n.rong-message-receiver{\n\tcolor: #FFF;\n}\n\n.rong-message-receiver-avatar{\n\tfloat: left;\n\tmargin-left: 10px;\n}\n\n.rong-message-content{\n    background-color: #696969;\n    max-width: 600px;\n    min-height: 40px;\n    min-width: 80px;\n    word-wrap: break-word;\n    display: inline-block;\n    padding: 10px 5px 15px 5px;\n    box-sizing: border-box;\n    position: relative;\n    opacity: 0.9;\n    border-radius: 12px;\n    margin-bottom: 10px;\n}\n\n.rong-message-senttime{\n\tdisplay: inline-block;\n\tposition: relative;\n\tcolor: #333;\n}\n\n.rong-message-receiver .rong-message-senttime{\n\ttop: 16px;\n    left: -43px;\n}\n\n.rong-message-receiver .rong-message-content{\n    margin-left: 18px;\n    border: 1px solid #999;\n}\n\n.rong-message-receiver .rong-message-content:before,.rong-message-content:after{\n\tcontent: \"\";\n\twidth: 0;\n  border-top: 14px solid;\n  border-bottom: 0px solid;\n  border-left: 4px solid;\n  border-right: 12px solid;\n\tdisplay: block;\n  position: absolute;\n}\n\n.rong-message-receiver .rong-message-content:before{\n\tborder-color:transparent #999 transparent transparent;\n\tleft: -17px;\n}\n\n.rong-message-receiver .rong-message-content:after{\n\tborder-color:transparent #696969 transparent transparent;\n\ttop: 10px;\n\tleft: -16px;\n}\n\n.rong-message-sender-avatar{\n\tfloat: right;\n\tmargin-right: 10px;\n}\n\n.rong-message-sender .rong-message-content{\n\tfloat: right;\n\tmargin-right: 14px;\n\tbackground-color: #FFF;\n\tcolor: #0099FD;\n}\n\n.rong-message-sender{\n    display: inline-block;\n    position: relative;\n    width: 100%;\n}\n\n.rong-message-sender .rong-message-senttime{\n    position: absolute;\n    bottom: -3px;\n    right: 75px;\n}\n\n\n.rong-message-sender .rong-message-content:after{\n  border-top: 0;\n  border-bottom: 18px solid;\n  border-left: 11px solid;\n  border-right: 12px solid;\n\tright: -20px;\n  top: 11px;\n  border-color: transparent transparent transparent #FFF;\n}\n\n.rong-edior-box{\n\theight: 60px;\n    position: absolute;\n    width: 100%;\n    bottom: 0;\n}\n\n.rong-editor-input{\n\theight: 60px;\n}\n\n.rong-editor-input-content{\n\tbox-sizing: border-box;\n\tpadding: 10px;\n  width: 100%;\n  height: 60px;\n\tmax-height: 60px;\n\tresize: none;\n  line-height: 40px;\n}"
  },
  {
    "path": "common-im/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<title>Rong-IM-Vue</title>\n\t<link rel=\"icon\" type=\"image/png\" href=\"css/images/logo.png\">\n\t<link rel=\"stylesheet\" href=\"css/common.css\">\n\t<link rel=\"stylesheet\" href=\"css/main.css\">\n</head>\n<body>\n\t<div class=\"rong-im\">\n\t\t<!-- 会话列表 -->\n\t\t<div class=\"rong-conversation-box\">\n\t\t\t<div class=\"rong-conversation-list\">\n\t\t\t\t<div class=\"rong-conversation\">\n\t\t\t\t\t<div class=\"rong-conversation-user\">\n\t\t\t\t\t\t<div class=\"rong-conversation-avatar rong-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-conversation-title\">RCE-PC</div>\n\t\t\t\t\t<div class=\"rong-conversation-message\">\n\t\t\t\t\t\t<span class=\"rong-conversation-sendername\">Martin:</span>\n\t\t\t\t\t\t<em class=\"rong-conversation-content\">天气真的不错</em>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-conversation-senttime\">10:40</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-conversation rong-selected\">\n\t\t\t\t\t<div class=\"rong-conversation-user\">\n\t\t\t\t\t\t<div class=\"rong-conversation-avatar rong-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-conversation-title\">RCE-PC</div>\n\t\t\t\t\t<div class=\"rong-conversation-message\">\n\t\t\t\t\t\t<span class=\"rong-conversation-sendername\">Martin:</span>\n\t\t\t\t\t\t<em class=\"rong-conversation-content\">天气真的不错</em>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-conversation-senttime\">10:40</div>\n\t\t\t\t</div>\n\n\n\t\t\t\t<div class=\"rong-conversation\">\n\t\t\t\t\t<div class=\"rong-conversation-user\">\n\t\t\t\t\t\t<div class=\"rong-conversation-avatar rong-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-conversation-title\">RCE-PC</div>\n\t\t\t\t\t<div class=\"rong-conversation-message\">\n\t\t\t\t\t\t<span class=\"rong-conversation-sendername\">Martin:</span>\n\t\t\t\t\t\t<em class=\"rong-conversation-content\">天气真的不错</em>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-conversation-senttime\">10:40</div>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t</div>\n\t\t<!-- 会话窗口 -->\n\t\t<div class=\"rong-main\">\n\t\t\t<!-- 会话窗口消息列表 -->\n\t\t\t<div class=\"rong-message-list\">\n\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\n\t\t\t\t\t\t\t\t<div class=\"rong-message rong-message-receiver\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-receiver-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/Fsn4eFfMA8jBTcvcKJhIuS6dSMFp');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">韦爵爷，我敬你是条汉子，面对一会之主，天下知名，武功高强，嫉恶如仇的陈近南，竟能说出如此振奋人心的大实话，不从屁眼里服气不行啊！只是不知说完之后，韦爵爷会不会变成真的太监</div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"rong-message rong-message-sender\">\n\t\t\t\t\t<div class=\"rong-avatar rong-message-sender-avatar\" style=\"background-image: url('http://oojs2ztoq.bkt.clouddn.com/FtUu6gE0MuHHzx2F1mCz2bhyGSwf');\"></div>\n\t\t\t\t\t<div class=\"rong-message-content\">\n\t\t\t\t\t\t一个人想称赞和鼓励别人，总会找出一点理由的。世界上并不缺少美,而是缺少发现美的眼睛”，如果你实在找不到赞美人的语言，可以把这段话读上50遍，细细体会就行了\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"rong-clearfix\"></div>\n\t\t\t\t\t<div class=\"rong-message-senttime\">\n\t\t\t\t\t\t<em>19:50</em>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"rong-clearfix\"></div>\n\n\t\t\t</div>\n\t\t\t<!-- 消息内容编辑区域 -->\n\t\t\t<div class=\"rong-edior-box\">\n\t\t\t\t<div class=\"rong-editor-input\">\n\t\t\t\t\t<textarea name=\"editor-input\" class=\"rong-input rong-editor-input-content\"></textarea>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</body>\n</html>"
  },
  {
    "path": "common-im/js/service.js",
    "content": "\"use strict\";\n(function(global, factory) {\n  if (typeof exports === 'object' && typeof module !== 'undefined') {\n    module.exports = factory();\n  } else if (typeof define === 'function' && define.amd) {\n    define(factory);\n  } else {\n    global.RongService = factory();\n  }\n})(window, function() {\n\n  var IMLib = null,\n    IMClient = null,\n    imInstance = null;\n\n  var utils = {\n    isFunction: function(func) {\n      return (typeof func == 'function');\n    },\n    isArray: function(arrs) {\n      return (Object.prototype.toString.call(arrs) == '[object Array]');\n    },\n    noop: function() {},\n    forEach: function(arrs, callback) {\n      for (var i = 0, len = arrs.length; i < len; i++) {\n        var item = arrs[i];\n        callback(item, i);\n      }\n    },\n    copy: function(target, source) {\n      for (var key in source) {\n        target[key] = source[key];\n      }\n    }\n  };\n\n  var Logger = {\n    warn: console.warn,\n    log: console.log\n  };\n\n  var Emitter = (function() {\n    var events = {};\n    var fire = function(name, args) {\n      if (name in events) {\n        for (var i = 0, len = events[name].length; i < len; i++) {\n          events[name][i](args);\n        }\n      }\n    };\n\n    var on = function(name, event) {\n      var isFunc = utils.isFunction(event);\n      if (!isFunc) {\n        return;\n      }\n      events[name] = events[name] || [];\n      events[name].push(event);\n    };\n\n    return {\n      fire: fire,\n      on: on\n    };\n  })();\n\n  function Watcher() {\n    var checkIndexOutBound = function(index, bound) {\n      return index > -1 && index < bound;\n    };\n\n    this.watcherList = [];\n\n    this.add = function(observer, force) {\n      if (force) {\n        this.watcherList.length = 0;\n      }\n      this.watcherList.push(observer);\n    };\n\n    this.get = function(index) {\n      if (checkIndexOutBound(index, this.watcherList.length)) {\n        return this.watcherList[index];\n      }\n    };\n\n    this.count = function() {\n      return this.watcherList.length;\n    };\n\n    this.removeAt = function(index) {\n      checkIndexOutBound(index, this.watcherList.length) && this.watcherList.splice(index, 1);\n    };\n\n    this.remove = function(observer) {\n      if (!observer) {\n        this.watcherList.length = 0;\n        return;\n      }\n      var isFunction = (Object.prototype.toString.call(observer) === '[object Function]');\n      var watcherList = isFunction ? [observer] : observer;\n      for (var i = 0, len = this.watcherList.length; i < len; i++) {\n        for (var j = 0; j < watcherList.length; j++) {\n          if (this.watcherList[i] === watcherList[j]) {\n            this.removeAt(i);\n            break;\n          }\n        }\n      }\n    };\n\n    this.notify = function(val) {\n      for (var i = 0, len = this.watcherList.length; i < len; i++) {\n        this.watcherList[i](val);\n      }\n    };\n\n    this.indexOf = function(observer, startIndex) {\n      var i = startIndex || 0,\n        len = this.watcherList.length;\n      while (i < len) {\n        if (this.watcherList[i] === observer) {\n          return i;\n        }\n        i++;\n      }\n      return -1;\n    };\n  }\n\n  var User = {\n    _Cache: {}\n  };\n\n  /*\n    此处只为演示，实际应用需请求应用服务器获取用户信息\n  */\n  User.get = function(user) {\n    var id = user.id;\n\n    //保证不刷新页面情况下，同一个 userId 的信息是一致的\n    user = User._Cache[id];\n    if (user) {\n      return user;\n    }\n\n    var nameList = \"梦琪忆柳之桃慕青问兰尔岚元香初夏沛菡傲珊曼文乐菱痴珊恨玉惜文香寒新柔语蓉海安夜蓉涵柏水桃醉蓝春儿语琴从彤傲晴语兰又菱碧彤元霜怜梦紫寒妙彤曼易南莲紫翠雨寒易烟如萱若南寻真晓亦向珊慕灵以蕊寻雁映易雪柳孤岚笑霜海云\";\n    var nameLen = nameList.length;\n\n    var xingList = \"赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张于\";\n    var xingLen = xingList.length;\n\n    var portraits = [\n      'https://rongcloud-image.cn.ronghub.com/fa33294a358e7f2abf.gif?e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:z2QkbpEqUEMrOPrJtV3tBP4gQYo=',\n      'http://7xogjk.com1.z0.glb.clouddn.com/01fac54313ad977d6e.gif',\n      'https://rongcloud-image.cn.ronghub.com/2fcdba4205860a63fb.gif?e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:m7S0ADf1E-d2bIG3E0vuiZJSH_w=',\n      'http://oqekw07cj.bkt.clouddn.com/9da99c4255a24baba1.gif',\n      'http://2f.zol-img.com.cn/product/172_100x75/267/cepP02EKJTV6.gif',\n      'https://fsprodrcx.cn.ronghub.com/lVMs15VSLeR47CzXlVMs15VbxLGVULo2/timg.gif',\n      'https://fsprodrcx.cn.ronghub.com/FmUv4RZmLtL72i_hFmUv4RYqrWMWbCI7/timg+%284%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/vJiff7ybnkxRJ59_vJiff7zADyO8gW0a/timg+%285%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/5FJuo-RTb5AJ7W6j5FJuo-Rf_-_kU162/timg+%283%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/Jx-MkScejaLKoIyRJx-MkScT89YnHp6U/timg+%282%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/pQjyn6UJ86xIt_KfpQjyn6UGM_6lDaO-/timg+%281%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/1T1xVdU_cGY4gnFV1T1xVdUFyRPVM_4N/test.gif',\n      'https://fsprodrcx.cn.ronghub.com/yn2CV8p8g2QnwoJXyn2CV8ppkNXKdrNS/1512691986120.gif',\n      'https://fsprodrcx.cn.ronghub.com/B0qmIAdLpxPq9aYgB0qmIAdV5acHSrhp/timg.jpeg'\n    ];\n\n    var portraitLen = portraits.length;\n\n    var getIndex = (max) => {\n      return Math.floor(Math.random() * max) || 1;\n    };\n\n    var getName = (len) => {\n      var names = [];\n      for (var i = 0; i < len; i++) {\n        var index = getIndex(nameLen);\n        names.push(nameList[index]);\n      }\n      return names.join('');\n    };\n\n    var getXing = (index) => {\n      return xingList.split('')[index];\n    };\n\n    var getPortrait = (index) => {\n      return portraits[index];\n    };\n\n    var nameIndex = getIndex(3);\n    var xingIndex = getIndex(xingLen);\n    var name = getXing(xingIndex) + getName(nameIndex);\n\n    var portraitIndex = getIndex(portraitLen);\n\n    var portrait = getPortrait(portraitIndex);\n\n    user = {\n      name: name,\n      portrait: portrait\n    };\n    User._Cache[id] = user;\n    return user;\n  };\n\n  var formatSentTime = function(time) {\n    var date = new Date(time);\n    var hours = date.getHours();\n    var minutes = date.getMinutes();\n    return hours + ':' + minutes;\n  }\n\n  var getMessageContent = function(message) {\n    var content = '[暂未解析此类型消息]';\n    var messageMap = {\n      TextMessage: message.content.content,\n      FileMessage: '[文件]',\n      ImageMessage: '[图片]'\n    };\n    var messageType = message.messageType;\n    return messageMap[messageType] || content;\n  };\n\n  var formartMessage = function(message) {\n    var sender = User.get({\n      id: message.senderUserId\n    });\n    var sentTime = message.sentTime;\n    sentTime = formatSentTime(sentTime);\n\n    var direction = (message.messageDirection == 1) ? 'sender' : 'receiver';\n\n    var content = getMessageContent(message);\n\n    utils.copy(message, {\n      _sender: sender,\n      _sentTime: sentTime,\n      _direction: direction,\n      _content: content\n    });\n  }\n\n  var conversationWatcher = new Watcher();\n\n  var Conversation = {};\n\n  Conversation.get = function(callback) {\n    callback = callback || utils.noop;\n    // 过滤会话类型，null 为不过滤，获取全部会话类型, conversationTypes = null | [1, 3]\n    var conversationTypes = null;\n    imInstance.getConversationList({\n      onSuccess: function(conversationList) {\n        var error = null;\n\n        // 示例暂时只演示单聊\n        conversationList = conversationList.filter(function(conversation) {\n          var isPrivate = (conversation.conversationType == IMLib.ConversationType.PRIVATE);\n          return isPrivate;\n        });\n\n        utils.forEach(conversationList, function(conversation) {\n          var target = User.get({\n            id: conversation.targetId\n          });\n\n          var sentTime = conversation.sentTime;\n          sentTime = formatSentTime(sentTime);\n\n          var message = conversation.latestMessage;\n          var content = getMessageContent(message);\n          var sender = User.get({\n            id: message.senderUserId\n          });\n\n          utils.copy(message, {\n            _content: content\n          });\n          utils.copy(conversation, {\n            _target: target,\n            _sentTime: sentTime,\n            _sender: sender\n          });\n        });\n\n        callback(error, conversationList);\n      },\n      onError: function(error) {\n        Logger.log('Conversation.get Error: %s', error);\n        callback(error);\n      }\n    }, conversationTypes);\n  };\n\n  Conversation.watch = function(watcher) {\n    conversationWatcher.add(watcher);\n  };\n\n  Emitter.on('onconversation', function(conversation) {\n    Conversation.get(function(conversationList) {\n      conversationWatcher.notify(conversationList);\n    });\n  });\n\n  var Message = {};\n  var messageWatcher = new Watcher();\n\n  Message.get = function(conversation, callback) {\n    var type = conversation.type;\n    var targetId = conversation.targetId;\n    var count = 20;\n    // 获取历史消息起始时间，0 表示从最近的一条消息开始向前获取 20 条, 详细说明：http://www.rongcloud.cn/docs/web_api_demo.html#message_history\n    var timestrap = 0;\n    imInstance.getHistoryMessages(type, targetId, timestrap, count, {\n      onSuccess: function(messageList) {\n        var error = null;\n\n        utils.forEach(messageList, function(message) {\n            formartMessage(message);\n        });\n\n        callback(error, messageList);\n      },\n      onError: function(error) {\n        Logger.log('Message.get Error: %s', error);\n        callback(error);\n      }\n    });\n  };\n\n  Message.sendTxt = function(message, callback) {\n    callback = callback || utils.noop;\n\n    var content = message.content;\n    var sender = message.sender;\n    var msg = new IMLib.TextMessage({\n      content: content,\n      user: sender\n    });\n\n    var conversationtype = message.type\n    var targetId = message.targetId;\n    imInstance.sendMessage(conversationtype, targetId, msg, {\n      onSuccess: function(message) {\n        var error = null;\n        formartMessage(message);\n        callback(error, message);\n\n        Emitter.fire('onconversation');\n      },\n      onError: function(error) {\n        Logger.log('Message.sendTxt Error: %s', error);\n        callback(error);\n      }\n    });\n  };\n\n  Message.watch = function(watcher) {\n    messageWatcher.add(watcher);\n  };\n\n  Emitter.on('onmessage', function(message) {\n    messageWatcher.notify(message);\n  });\n\n  var setListener = function() {\n    IMClient.setConnectionStatusListener({\n      onChanged: function(status) {\n        //Status 说明可参考 http://www.rongcloud.cn/docs/web_api_demo.html#init_listener\n        Logger.warn('WebSDK Status Changed: %d', status);\n      }\n    });\n\n    IMClient.setOnReceiveMessageListener({\n      onReceived: function(message) {\n        formartMessage(message);\n        Emitter.fire('onmessage', message);\n        Emitter.fire('onconversation');\n      }\n    });\n  };\n\n  var services = {\n    Conversation: Conversation,\n    Message: Message\n  };\n\n  var connect = function(token, callback) {\n    callback = callback || utils.noop;\n    IMClient.connect(token, {\n      onSuccess: function(id) {\n        var currentUser = {\n          id: id\n        };\n        callback(services, currentUser);\n      },\n      onTokenIncorrect: function() {\n        Logger.log('token 无效, 请参考: http://support.rongcloud.cn/kb/NDQ1');\n      },\n      onError: function(code) {\n        Logger.log(code);\n      }\n    });\n  };\n\n  /*\n    var options = {\n      appKey: '',\n      sdk: {\n        navi: '',\n        protobuf: ''\n      }\n    };\n    \n    var callback = function(services, currentUser){\n     \n    };\n\n    var modules = {\n      RongIMLib: RongIMLib,\n      protobuf: protobuf\n    };\n  */\n  var init = function(options, callback, modules) {\n    IMLib = modules.RongIMLib;\n    IMClient = IMLib.RongIMClient;\n\n    var appKey = options.appKey;\n    var sdk = options.sdk;\n    IMClient.init(appKey, null, sdk);\n    imInstance = IMClient.getInstance();\n\n    setListener();\n\n    var token = options.token;\n    connect(token, callback);\n\n  };\n\n  return {\n    init: init\n  };\n\n});"
  },
  {
    "path": "connect-check.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>connect，receive message</title>\n</head>\n<body>\n\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/connect-check.html\" class=\"get-source\">获取源码</a>\n\n\n<style>\nbody{\n\tfont-size:80%;\n}\n.panel span{\n\tdisplay:inline-block;\t\n\twidth:60px;\n}\n.show{\n\twidth:98%;\n\tdisplay:inline-block;\n\toverflow:hidden;\n\tborder:1px solid #ccc;\n}\n.show h3{\n\ttext-indent:10px;\n}\n.show pre{\n\tborder-top:1px dotted #ccc;\n\tpadding:5px 0 0 10px;\n\tline-height:1.5;\n\tcolor:#333;\n\tbackground:#f5f5f5;\n}\n.show pre:nth-child(2n){\n\tbackground:#ccc;\n}\n#joinChatRoom{\n\tdisplay: none;\n\tbackground:#000;\n\tcolor:#fff;\n}\n</style>\n\n<script>\nfunction showResult(id,message){\n\tvar dom = document.getElementById(id);\n\tconsole.log(message.content.content)\n\t// dom.innerHTML += '<pre>' + message.senderUserId + \":   \" +  RongIMLib.RongIMEmoji.emojiToHTML(message.content.content + \"\") + '</pre>';\n\tdom.innerHTML += '<pre>' + JSON.stringify(message,null,\"\\t\") + '</pre>';\n\t//JSON.stringify(message,null,\"\\t\")\n}\t\n</script>\n\n<script src=\"js/message-output.js\"></script>\n\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script src=\"//cdn.ronghub.com/RongEmoji-2.2.5.min.js\"></script>\n<script src=\"./init.js\"></script>\n<script>\n//注册自定义消息\n\nfunction registerMessage(type,propertys){\n\tvar messageName = type; // 消息名称。\n\tvar objectName = \"s:\" + type; // 消息内置名称，请按照此格式命名 *:* 。\n\tvar mesasgeTag = new RongIMLib.MessageTag(true,true); //true true 保存且计数，false false 不保存不计数。\n\n\tRongIMClient.registerMessageType(messageName, objectName, mesasgeTag, propertys);\n}\n\nfunction startInit(user,targetId){\n\tvar params = {\n\t\tappKey : getValue(\"appKey\"),\n\t\ttoken : getValue(\"token\"),\n\t\tnavi : getValue(\"navi\")\n\t};\n\n\tvar userId = \"\";\n\n\tvar callbacks = {\n\t\tgetInstance : function(instance){\n\t\t\tRongIMLib.RongIMEmoji.init();\n\t\t\t//instance.sendMessage\t\n\n\t\t\t//注册 PersonMessage\n\t\t\tvar propertys = [\"name\",\"age\",\"gender\"]; // 消息类中的属性名。\n\t\t\tregisterMessage(\"PersonMessage\",propertys);\n\n\t\t\t//注册 ProductMessage\n\t\t\tvar propertys = [\"price\",\"title\",\"desc\",\"images\"]; // 消息类中的属性名。\n\t\t\tregisterMessage(\"ProductMessage\",propertys);\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\tconsole.log(userInfo.userId);\n\t\t\tuserId = userInfo.userId;\n\t\t\talert(\"链接成功；userid=\" + userInfo.userId);\n\t\t\tdocument.titie = (\"链接成功；userid=\" + userInfo.userId);\n\n\t\t\t//加入聊天室\n\t\t\tjoinChatRoom();\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t\t//判断是否有 @ 自己的消息\n\n\t\t\tconsole.log(message);\n\t\t\t\n\t\t\tvar mentionedInfo = message.content.mentionedInfo || {};\n\t\t\tvar ids = mentionedInfo.userIdList || [];\n\t\t\tfor(var i=0; i < ids.length; i++){\n\t\t\t\tif( ids[i] == userId){\n\t\t\t\t\talert(\"有人 @ 了你！\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tshowResult(\"show1\",message);\n\t\t\tmessageOutput(message);\n\t\t}\n\t};\n\n\tinit(params,callbacks);\n}\n\nfunction getValue(id){\n\treturn document.getElementById(id).value;\n}\n\nfunction joinChatRoom(){\n\tvar chatRoomId = getValue(\"chatRoomId\");\n\t\t// chatRoomId = chatRoomId.replace(/(^\\s*)|(\\s*$)/g, \" \");\n\tif(chatRoomId == \"\"){\n\t\talert(\"请输入聊天室 id！\");\n\t\treturn false;\n\t}\n\n\tvar IM = RongIMClient.getInstance();\n\t\tIM.joinChatRoom(chatRoomId, 50, {\n\t\tonSuccess: function() {\n            alert(\"加入聊天室 \" + chatRoomId + \" 成功\");\n\t\t},\n\t\tonError: function(error) {\n            alert(\"加入聊天室失败\");\n\t\t}\n\t});\n}\n</script>\n\n\n<h1>链接测试、消息接收 (含自定义消息)</h1>\n<div class=\"panel\" id=\"panel\">\n\t<p>\n\t\t<span>appkey</span>\n\t\t<input type=\"text\" id=\"appKey\" size=\"20\" value=\"8w7jv4qb78a9y\">\n\t</p>\n\t<p>\n\t\t<span>token</span>\n\t\t<input type=\"text\" id=\"token\" size=\"110\" value=\"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\">\n\t</p>\n\t<p>\n\t\t<span>navi</span>\n\t\t<input type=\"text\" id=\"navi\" size=\"50\" value=\"\"> <b>此配置项仅针对私有部署，公有云请置空，格式为 10.10.10.10:8080 </b>\n\t</p>\n\t<p>\n\t\t<span>聊天室 id</span>\n\t\t<input type=\"text\" id=\"chatRoomId\" size=\"20\" value=\"\"> \n\t\t<b><input type=\"button\" id=\"joinChatRoom\" onclick=\"joinChatRoom()\" value=\"加入聊天室\"> </b>\n\t</p>\n\t<p>\n\t\t<span>&#160;</span>\n\t\t<input type=\"button\" onclick=\"startInit()\" value=\"初始化链接\">\n\t</p>\n</div>\n\n<p></p>\n\n<div class=\"show\" id=\"show1\">\n\t<h3>消息接收结果(新消息在最下)</h3>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "cs/jx/.gitignore",
    "content": "node_modules\ntemp\n"
  },
  {
    "path": "cs/jx/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>customer-service</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.aptana.ide.core.unifiedBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.aptana.projects.webnature</nature>\n\t</natures>\n\t<filteredResources>\n\t\t<filter>\n\t\t\t<id>1520220294094</id>\n\t\t\t<name></name>\n\t\t\t<type>26</type>\n\t\t\t<matcher>\n\t\t\t\t<id>org.eclipse.ui.ide.multiFilter</id>\n\t\t\t\t<arguments>1.0-name-matches-false-false-node_modules</arguments>\n\t\t\t</matcher>\n\t\t</filter>\n\t</filteredResources>\n</projectDescription>\n"
  },
  {
    "path": "cs/jx/Gruntfile.js",
    "content": "'use strict';\nvar glob = require('glob');\nvar fs = require('fs');\nmodule.exports = function(grunt) {\n    grunt.initConfig({\n        concat: {\n            dist: {\n                src: [\n                    'RongIMemoji.js',\n                    'utils.js',\n                    'qiniu-upload.js',\n                    'template.js',\n                    'emoji.js',\n                    'phiz.js',\n                    'cs.js'\n                ],\n                dest: 'temp/cs.js'\n            }\n        },\n        uglify: {\n            dist: {\n                src: [\n                    'temp/cs.js',\n                    'temp/template.js'\n                ],\n                dest: 'dist/cs.min.js'\n            }\n        },\n        cssmin: {\n            dist: {\n                src: 'cs.css',\n                dest: 'dist/cs.min.css'\n            }\n        },\n        clean: {\n            dist: {\n                src: 'temp'\n            }\n        }\n    });\n\n    grunt.loadNpmTasks('grunt-contrib-concat');\n    grunt.loadNpmTasks('grunt-contrib-uglify');\n    grunt.loadNpmTasks('grunt-contrib-cssmin');\n    grunt.loadNpmTasks('grunt-contrib-clean');\n\n    grunt.registerTask('html-to-js',function () {\n        var template = {};\n        glob.sync('./templates/**/*.html').forEach(filePath => {\n            var content = fs.readFileSync(filePath, {\n                encoding: 'utf8'\n            });\n            var key = filePath.replace(/^\\.\\//, '');\n            template[key] = content;\n        });\n        var dest = './temp/template.js';\n        var outputContent = 'RCS.templateCache=' + JSON.stringify(template, null, 4) + ';';\n        fs.writeFileSync(dest, outputContent);\n    });\n\n    grunt.registerTask('dist', ['concat', 'html-to-js', 'uglify', 'cssmin', 'clean']);\n}"
  },
  {
    "path": "cs/jx/README.md",
    "content": "# 使用说明\n1. 在页面引入以下资源\n```\n<!-- Web SDK 相关资源 SDK 针对自建客服做出了一些修改 -->\n<script src=\"../RongIMLib-cs.js\"></script>\n<script src=\"./RongIMEmoji.js\"></script> \n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n<!-- 客服插件样式表和 js 代码 -->\n<link rel=\"stylesheet\" href=\"cs.css\">\n<script src=\"utils.js\"></script>\n<script src=\"upload.js\"></script>\n<script src=\"template.js\"></script>\n<script src=\"emoji.js\"></script>\n<script src=\"phiz.js\"></script>\n<script src=\"cs.js\"></script>\n\n```\n2. 初始化客服插件\n``` javascript\nRCS.init({\n    appKey: \"x4vkb1qpv6hzk\",// 应用 appkey\n    token: \"xu3bupPl1BfQ6zuh4dt+XgjhgbU7wkXey1sSyxbY7BWzkNfuprj0izKgSClenbiWt6Co1VyMgB0maYIAzQF0S6Ua0Rxnr/45B1H0MUHEn6w=\",// 当前游客或登录用户 token\n    upload: {\n        fileServer: \"http://upload.qiniu.com\",// 文件服务器地址\n        isPrivate: false // 是否是私有云\n    },//非必填\n    target: document.getElementById(\"rcs-app\"),// 要插入到的页面节点\n    customerServiceId: \"KEFUxiaoqiaoPrestaShop1\"// 通过“客服管理后台 - 坐席管理 - 技能组”，对应为技能组列表中的技能组 ID。\n    userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像，在用户没有头像的时候显示\n    csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像，在客服没有头像的时候显示,建议线上地址\n    showButton: true,\n    //是否需要按钮主动发起，设为false的时候，init()方法直接唤起聊天窗口,需客户自己编写按钮，点击之后调用init(),templates中的button模板不可用;设为true的时候，init()首先唤起客服咨询按钮，点击之后才连接客服，唤起聊天窗口，在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token，在获取到token之后，执行init()即可。\n    connectingCallback: function(){\n        console.log('连接中');\n    },//连接中的执行的方法，例如显示加载页面,可不传\n    connectedCallback: function(){},//连接成功之后的方法，例如关闭加载页面,可不传\n    disconnectedCallback: function(){\n        alert('连接断开');\n    },//断开连接之后的操作,可不传\n    extraInfo: {\n        \"userInfo\": {\n            \"userId\": \"\", \n            \"nickName\": \"\", \n            \"loginName\": \"\", \n            \"name\": \"\", \n            \"grade\": \"\", \n            \"birthday\": \"\", \n            \"age\": \"\", \n            \"profession\": \"\", \n            \"portraitUrl\": \"\", \n            \"province\": \"\", \n            \"city\": \"\", \n            \"memo\": \"\"\n        }, \n        \"contactInfo\": {\n            \"mobileNo\": \"\", \n            \"email\": \"\", \n            \"address\": \"\", \n            \"QQ\": \"\", \n            \"weibo\": \"\", \n            \"weixin\": \"\"\n        }, \n        \"requestInfo\": {\n            \"page\": \"\", \n            \"referrer\": \"\", //为来源渠道号，该值通过“客服后台 - IM 客服管理 - 渠道 - App”渠道号列表中获取。\n            \"enterUrl\": \"\", \n            \"skillId\": \"\", \n            \"listUrl\": [\n            ], \n            \"define\": \"\", //自定义信息，如：{carInfo:'宝马车系',userId:'user11',quInfo:'xxx'}\n            \"productId\": \"\"\n        }\n    }//客服携带信息\n});\n```\n3.RC:InfoNtf消息里带有user对象，在接通客服坐席后，会收到一条RC:InfoNtf消息，可以进行保存客服信息（头像、名称等）\n\n# 开发说明\n## 目录结构说明\n- dist \n    发布-合并压缩后的代码\n    + cs.html\n        示例页面\n- templates\n    HTML模板\n\n- cs.css  \n    样式表\n- cs.html  \n    开发测试页面\n- cs.js  \n    客服核心代码\n- emoji.js  \n    表情库调用封装\n- upload.js  \n    上传插件\n- utils.js  \n    工具类\n\n## 合并压缩发布代码\n```\n安装依赖包\nnpm install\n合并压缩代码\nnpm run dist\n```"
  },
  {
    "path": "cs/jx/RongIMemoji.js",
    "content": "/*\n    支持范围\n    IE6+, Chrome, Safari, Firefox, Android, IOS\n */\n(function(global, factory) {\n    \"use strict\";\n    if (typeof exports === \"object\" && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === \"function\" && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    var emojiFactory = {\n        \"u1F600\": { \"en\": \"Grinning Face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F601\": { \"en\": \"Grinning With Smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F602\": { \"en\": \"Laughing Tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F603\": { \"en\": \"Smiley Face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F605\": { \"en\": \"Happy Sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F606\": { \"en\": \"Big Grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F607\": { \"en\": \"Halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F608\": { \"en\": \"Purple Devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F609\": { \"en\": \"Winking Face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F611\": { \"en\": \"Expressionless Face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F612\": { \"en\": \"Dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F613\": { \"en\": \"Sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F614\": { \"en\": \"Pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F615\": { \"en\": \"Confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F616\": { \"en\": \"Confounded Face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F618\": { \"en\": \"Blowing Kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F621\": { \"en\": \"Angry Face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F622\": { \"en\": \"Sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-2075px 0px\" },\n        \"u1F623\": { \"en\": \"Helpless Face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F624\": { \"en\": \"Mad Face\", \"zh\": \"怒气冲冲\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F628\": { \"en\": \"Fearful Face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F629\": { \"en\": \"Weary Face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F630\": { \"en\": \"Cold Sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F631\": { \"en\": \"Scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F632\": { \"en\": \"Shocked Face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F633\": { \"en\": \"Flushed Face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F634\": { \"en\": \"Sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"Dizzy Face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F636\": { \"en\": \"Mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F637\": { \"en\": \"Mask Face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F3A4\": { \"en\": \"Microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B2\": { \"en\": \"Game Die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F3B5\": { \"en\": \"Musical Note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3C0\": { \"en\": \"Basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u1F3C2\": { \"en\": \"Snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3E1\": { \"en\": \"House With Garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F004\": { \"en\": \"Mahjong Red Dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F4A1\": { \"en\": \"Light Bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4A2\": { \"en\": \"Anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A3\": { \"en\": \"Bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F4A4\": { \"en\": \"Zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F4A9\": { \"en\": \"Pile Of Poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F4AA\": { \"en\": \"Flexed Biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F4B0\": { \"en\": \"Money Bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F4DA\": { \"en\": \"Books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F4DE\": { \"en\": \"Telephone Receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"Loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F6AB\": { \"en\": \"Prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u1F6BF\": { \"en\": \"Shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F30F\": { \"en\": \"Globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" },\n        \"u1F33B\": { \"en\": \"Sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F35A\": { \"en\": \"Cooked Rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F36B\": { \"en\": \"Chocolate Bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F37B\": { \"en\": \"Cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u270A\": { \"en\": \"Oncoming Fist\", \"zh\": \"击拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-1350px 0px\" },\n        \"u1F44C\": { \"en\": \"Ok Hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44D\": { \"en\": \"Thumbs Up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"Thumbs Down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F44F\": { \"en\": \"Clapping Hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F46A\": { \"en\": \"Family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"Couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F62C\": { \"en\": \"Grimacing Face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F47B\": { \"en\": \"Ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F47C\": { \"en\": \"Baby Angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F47D\": { \"en\": \"Alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F47F\": { \"en\": \"Devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F48A\": { \"en\": \"Capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F48B\": { \"en\": \"Kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"Ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F52B\": { \"en\": \"Pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F60A\": { \"en\": \"Smiley\", \"zh\": \"微笑\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u1F60B\": { \"en\": \"Hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F60C\": { \"en\": \"Pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F60D\": { \"en\": \"Heart Eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F60E\": { \"en\": \"Sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F60F\": { \"en\": \"Smirking Face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F61A\": { \"en\": \"Kiss Face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"Crazy Face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"Tongue Out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F61E\": { \"en\": \"Disappointed Face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F61F\": { \"en\": \"Worried Face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F62A\": { \"en\": \"Sleepy Face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F62B\": { \"en\": \"Tired Face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F62D\": { \"en\": \"Crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-425px 0px\" },\n        \"u1F62F\": { \"en\": \"Surprised Face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F64A\": { \"en\": \"No Speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F64F\": { \"en\": \"Folded Hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u1F319\": { \"en\": \"Drescent Moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u1F332\": { \"en\": \"Pine Tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F339\": { \"en\": \"Rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F349\": { \"en\": \"Watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F356\": { \"en\": \"Barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F366\": { \"en\": \"Ice Cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F377\": { \"en\": \"Wine Glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F381\": { \"en\": \"Wrapped Gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F382\": { \"en\": \"Birthday Cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F384\": { \"en\": \"Christmas Tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F389\": { \"en\": \"Party Popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F393\": { \"en\": \"Graduation Cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u1F434\": { \"en\": \"Horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"Dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"Pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F451\": { \"en\": \"Crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"Lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F494\": { \"en\": \"Broken Heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"Fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F556\": { \"en\": \"Clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u1F648\": { \"en\": \"See No Monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"Hear No Monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F680\": { \"en\": \"Rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u2B50\": { \"en\": \"Star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u23F0\": { \"en\": \"Alarm Clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"Hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u26A1\": { \"en\": \"Lightning Bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u26BD\": { \"en\": \"Soccer Ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u26C4\": { \"en\": \"Snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u26C5\": { \"en\": \"Cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u261D\": { \"en\": \"Pointing Up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u263A\": { \"en\": \"Cute\", \"zh\": \"萌萌哒\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F44A\": { \"en\": \"Raised Fist\", \"zh\": \"举起拳头\", \"tag\": \"\\u270A\", \"position\": \"-2975px 0px\" },\n        \"u270B\": { \"en\": \"Raised Hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u270C\": { \"en\": \"Victory Hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270F\": { \"en\": \"Pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u2600\": { \"en\": \"Sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u2601\": { \"en\": \"Cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2614\": { \"en\": \"Umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u2615\": { \"en\": \"Coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u2744\": { \"en\": \"Snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" }\n    };\n\n    var detailList = [];\n\n    var emojiRegExp = /(\\uD83D\\uDC76\\uD83C\\uDFFB|\\uD83D\\uDC76\\uD83C\\uDFFC|\\uD83D\\uDC76\\uD83C\\uDFFD|\\uD83D\\uDC76\\uD83C\\uDFFE|\\uD83D\\uDC76\\uD83C\\uDFFF|\\uD83E\\uDDD2\\uD83C\\uDFFB|\\uD83E\\uDDD2\\uD83C\\uDFFC|\\uD83E\\uDDD2\\uD83C\\uDFFD|\\uD83E\\uDDD2\\uD83C\\uDFFE|\\uD83E\\uDDD2\\uD83C\\uDFFF|\\uD83D\\uDC66\\uD83C\\uDFFB|\\uD83D\\uDC66\\uD83C\\uDFFC|\\uD83D\\uDC66\\uD83C\\uDFFD|\\uD83D\\uDC66\\uD83C\\uDFFE|\\uD83D\\uDC66\\uD83C\\uDFFF|\\uD83D\\uDC67\\uD83C\\uDFFB|\\uD83D\\uDC67\\uD83C\\uDFFC|\\uD83D\\uDC67\\uD83C\\uDFFD|\\uD83D\\uDC67\\uD83C\\uDFFE|\\uD83D\\uDC67\\uD83C\\uDFFF|\\uD83E\\uDDD1\\uD83C\\uDFFB|\\uD83E\\uDDD1\\uD83C\\uDFFC|\\uD83E\\uDDD1\\uD83C\\uDFFD|\\uD83E\\uDDD1\\uD83C\\uDFFE|\\uD83E\\uDDD1\\uD83C\\uDFFF|\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83D\\uDC68\\uD83C\\uDFFC|\\uD83D\\uDC68\\uD83C\\uDFFD|\\uD83D\\uDC68\\uD83C\\uDFFE|\\uD83D\\uDC68\\uD83C\\uDFFF|\\uD83D\\uDC69\\uD83C\\uDFFB|\\uD83D\\uDC69\\uD83C\\uDFFC|\\uD83D\\uDC69\\uD83C\\uDFFD|\\uD83D\\uDC69\\uD83C\\uDFFE|\\uD83D\\uDC69\\uD83C\\uDFFF|\\uD83E\\uDDD3\\uD83C\\uDFFB|\\uD83E\\uDDD3\\uD83C\\uDFFC|\\uD83E\\uDDD3\\uD83C\\uDFFD|\\uD83E\\uDDD3\\uD83C\\uDFFE|\\uD83E\\uDDD3\\uD83C\\uDFFF|\\uD83D\\uDC74\\uD83C\\uDFFB|\\uD83D\\uDC74\\uD83C\\uDFFC|\\uD83D\\uDC74\\uD83C\\uDFFD|\\uD83D\\uDC74\\uD83C\\uDFFE|\\uD83D\\uDC74\\uD83C\\uDFFF|\\uD83D\\uDC75\\uD83C\\uDFFB|\\uD83D\\uDC75\\uD83C\\uDFFC|\\uD83D\\uDC75\\uD83C\\uDFFD|\\uD83D\\uDC75\\uD83C\\uDFFE|\\uD83D\\uDC75\\uD83C\\uDFFF|\\uD83D\\uDC68\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDE92|\\uD83D\\uDC6E\\uD83C\\uDFFB|\\uD83D\\uDC6E\\uD83C\\uDFFC|\\uD83D\\uDC6E\\uD83C\\uDFFD|\\uD83D\\uDC6E\\uD83C\\uDFFE|\\uD83D\\uDC6E\\uD83C\\uDFFF|\\uD83D\\uDC6E\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFB|\\uD83D\\uDD75\\uD83C\\uDFFC|\\uD83D\\uDD75\\uD83C\\uDFFD|\\uD83D\\uDD75\\uD83C\\uDFFE|\\uD83D\\uDD75\\uD83C\\uDFFF|\\uD83D\\uDD75\\uD83F\\uDE0F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83F\\uDE0F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFB|\\uD83D\\uDC82\\uD83C\\uDFFC|\\uD83D\\uDC82\\uD83C\\uDFFD|\\uD83D\\uDC82\\uD83C\\uDFFE|\\uD83D\\uDC82\\uD83C\\uDFFF|\\uD83D\\uDC82\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFB|\\uD83D\\uDC77\\uD83C\\uDFFC|\\uD83D\\uDC77\\uD83C\\uDFFD|\\uD83D\\uDC77\\uD83C\\uDFFE|\\uD83D\\uDC77\\uD83C\\uDFFF|\\uD83D\\uDC77\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD34\\uD83C\\uDFFB|\\uD83E\\uDD34\\uD83C\\uDFFC|\\uD83E\\uDD34\\uD83C\\uDFFD|\\uD83E\\uDD34\\uD83C\\uDFFE|\\uD83E\\uDD34\\uD83C\\uDFFF|\\uD83D\\uDC78\\uD83C\\uDFFB|\\uD83D\\uDC78\\uD83C\\uDFFC|\\uD83D\\uDC78\\uD83C\\uDFFD|\\uD83D\\uDC78\\uD83C\\uDFFE|\\uD83D\\uDC78\\uD83C\\uDFFF|\\uD83D\\uDC73\\uD83C\\uDFFB|\\uD83D\\uDC73\\uD83C\\uDFFC|\\uD83D\\uDC73\\uD83C\\uDFFD|\\uD83D\\uDC73\\uD83C\\uDFFE|\\uD83D\\uDC73\\uD83C\\uDFFF|\\uD83D\\uDC73\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC72\\uD83C\\uDFFB|\\uD83D\\uDC72\\uD83C\\uDFFC|\\uD83D\\uDC72\\uD83C\\uDFFD|\\uD83D\\uDC72\\uD83C\\uDFFE|\\uD83D\\uDC72\\uD83C\\uDFFF|\\uD83E\\uDDD5\\uD83C\\uDFFB|\\uD83E\\uDDD5\\uD83C\\uDFFC|\\uD83E\\uDDD5\\uD83C\\uDFFD|\\uD83E\\uDDD5\\uD83C\\uDFFE|\\uD83E\\uDDD5\\uD83C\\uDFFF|\\uD83E\\uDDD4\\uD83C\\uDFFB|\\uD83E\\uDDD4\\uD83C\\uDFFC|\\uD83E\\uDDD4\\uD83C\\uDFFD|\\uD83E\\uDDD4\\uD83C\\uDFFE|\\uD83E\\uDDD4\\uD83C\\uDFFF|\\uD83D\\uDC71\\uD83C\\uDFFB|\\uD83D\\uDC71\\uD83C\\uDFFC|\\uD83D\\uDC71\\uD83C\\uDFFD|\\uD83D\\uDC71\\uD83C\\uDFFE|\\uD83D\\uDC71\\uD83C\\uDFFF|\\uD83D\\uDC71\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD35\\uD83C\\uDFFB|\\uD83E\\uDD35\\uD83C\\uDFFC|\\uD83E\\uDD35\\uD83C\\uDFFD|\\uD83E\\uDD35\\uD83C\\uDFFE|\\uD83E\\uDD35\\uD83C\\uDFFF|\\uD83D\\uDC70\\uD83C\\uDFFB|\\uD83D\\uDC70\\uD83C\\uDFFC|\\uD83D\\uDC70\\uD83C\\uDFFD|\\uD83D\\uDC70\\uD83C\\uDFFE|\\uD83D\\uDC70\\uD83C\\uDFFF|\\uD83E\\uDD30\\uD83C\\uDFFB|\\uD83E\\uDD30\\uD83C\\uDFFC|\\uD83E\\uDD30\\uD83C\\uDFFD|\\uD83E\\uDD30\\uD83C\\uDFFE|\\uD83E\\uDD30\\uD83C\\uDFFF|\\uD83E\\uDD31\\uD83C\\uDFFB|\\uD83E\\uDD31\\uD83C\\uDFFC|\\uD83E\\uDD31\\uD83C\\uDFFD|\\uD83E\\uDD31\\uD83C\\uDFFE|\\uD83E\\uDD31\\uD83C\\uDFFF|\\uD83D\\uDC7C\\uD83C\\uDFFB|\\uD83D\\uDC7C\\uD83C\\uDFFC|\\uD83D\\uDC7C\\uD83C\\uDFFD|\\uD83D\\uDC7C\\uD83C\\uDFFE|\\uD83D\\uDC7C\\uD83C\\uDFFF|\\uD83C\\uDF85\\uD83C\\uDFFB|\\uD83C\\uDF85\\uD83C\\uDFFC|\\uD83C\\uDF85\\uD83C\\uDFFD|\\uD83C\\uDF85\\uD83C\\uDFFE|\\uD83C\\uDF85\\uD83C\\uDFFF|\\uD83E\\uDD36\\uD83C\\uDFFB|\\uD83E\\uDD36\\uD83C\\uDFFC|\\uD83E\\uDD36\\uD83C\\uDFFD|\\uD83E\\uDD36\\uD83C\\uDFFE|\\uD83E\\uDD36\\uD83C\\uDFFF|\\uD83E\\uDDD9\\uD83C\\uDFFB|\\uD83E\\uDDD9\\uD83C\\uDFFC|\\uD83E\\uDDD9\\uD83C\\uDFFD|\\uD83E\\uDDD9\\uD83C\\uDFFE|\\uD83E\\uDDD9\\uD83C\\uDFFF|\\uD83E\\uDDD9\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFB|\\uD83E\\uDDDA\\uD83C\\uDFFC|\\uD83E\\uDDDA\\uD83C\\uDFFD|\\uD83E\\uDDDA\\uD83C\\uDFFE|\\uD83E\\uDDDA\\uD83C\\uDFFF|\\uD83E\\uDDDA\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFB|\\uD83E\\uDDDB\\uD83C\\uDFFC|\\uD83E\\uDDDB\\uD83C\\uDFFD|\\uD83E\\uDDDB\\uD83C\\uDFFE|\\uD83E\\uDDDB\\uD83C\\uDFFF|\\uD83E\\uDDDB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFB|\\uD83E\\uDDDC\\uD83C\\uDFFC|\\uD83E\\uDDDC\\uD83C\\uDFFD|\\uD83E\\uDDDC\\uD83C\\uDFFE|\\uD83E\\uDDDC\\uD83C\\uDFFF|\\uD83E\\uDDDC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFB|\\uD83E\\uDDDD\\uD83C\\uDFFC|\\uD83E\\uDDDD\\uD83C\\uDFFD|\\uD83E\\uDDDD\\uD83C\\uDFFE|\\uD83E\\uDDDD\\uD83C\\uDFFF|\\uD83E\\uDDDD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFB|\\uD83D\\uDE4D\\uD83C\\uDFFC|\\uD83D\\uDE4D\\uD83C\\uDFFD|\\uD83D\\uDE4D\\uD83C\\uDFFE|\\uD83D\\uDE4D\\uD83C\\uDFFF|\\uD83D\\uDE4D\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFB|\\uD83D\\uDE4E\\uD83C\\uDFFC|\\uD83D\\uDE4E\\uD83C\\uDFFD|\\uD83D\\uDE4E\\uD83C\\uDFFE|\\uD83D\\uDE4E\\uD83C\\uDFFF|\\uD83D\\uDE4E\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFB|\\uD83D\\uDE45\\uD83C\\uDFFC|\\uD83D\\uDE45\\uD83C\\uDFFD|\\uD83D\\uDE45\\uD83C\\uDFFE|\\uD83D\\uDE45\\uD83C\\uDFFF|\\uD83D\\uDE45\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFB|\\uD83D\\uDE46\\uD83C\\uDFFC|\\uD83D\\uDE46\\uD83C\\uDFFD|\\uD83D\\uDE46\\uD83C\\uDFFE|\\uD83D\\uDE46\\uD83C\\uDFFF|\\uD83D\\uDE46\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFB|\\uD83D\\uDC81\\uD83C\\uDFFC|\\uD83D\\uDC81\\uD83C\\uDFFD|\\uD83D\\uDC81\\uD83C\\uDFFE|\\uD83D\\uDC81\\uD83C\\uDFFF|\\uD83D\\uDC81\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFB|\\uD83D\\uDE4B\\uD83C\\uDFFC|\\uD83D\\uDE4B\\uD83C\\uDFFD|\\uD83D\\uDE4B\\uD83C\\uDFFE|\\uD83D\\uDE4B\\uD83C\\uDFFF|\\uD83D\\uDE4B\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFB|\\uD83D\\uDE47\\uD83C\\uDFFC|\\uD83D\\uDE47\\uD83C\\uDFFD|\\uD83D\\uDE47\\uD83C\\uDFFE|\\uD83D\\uDE47\\uD83C\\uDFFF|\\uD83D\\uDE47\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFB|\\uD83E\\uDD26\\uD83C\\uDFFC|\\uD83E\\uDD26\\uD83C\\uDFFD|\\uD83E\\uDD26\\uD83C\\uDFFE|\\uD83E\\uDD26\\uD83C\\uDFFF|\\uD83E\\uDD26\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFB|\\uD83E\\uDD37\\uD83C\\uDFFC|\\uD83E\\uDD37\\uD83C\\uDFFD|\\uD83E\\uDD37\\uD83C\\uDFFE|\\uD83E\\uDD37\\uD83C\\uDFFF|\\uD83E\\uDD37\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFB|\\uD83D\\uDC86\\uD83C\\uDFFC|\\uD83D\\uDC86\\uD83C\\uDFFD|\\uD83D\\uDC86\\uD83C\\uDFFE|\\uD83D\\uDC86\\uD83C\\uDFFF|\\uD83D\\uDC86\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFB|\\uD83D\\uDC87\\uD83C\\uDFFC|\\uD83D\\uDC87\\uD83C\\uDFFD|\\uD83D\\uDC87\\uD83C\\uDFFE|\\uD83D\\uDC87\\uD83C\\uDFFF|\\uD83D\\uDC87\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFB|\\uD83D\\uDEB6\\uD83C\\uDFFC|\\uD83D\\uDEB6\\uD83C\\uDFFD|\\uD83D\\uDEB6\\uD83C\\uDFFE|\\uD83D\\uDEB6\\uD83C\\uDFFF|\\uD83D\\uDEB6\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFB|\\uD83C\\uDFC3\\uD83C\\uDFFC|\\uD83C\\uDFC3\\uD83C\\uDFFD|\\uD83C\\uDFC3\\uD83C\\uDFFE|\\uD83C\\uDFC3\\uD83C\\uDFFF|\\uD83C\\uDFC3\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC83\\uD83C\\uDFFB|\\uD83D\\uDC83\\uD83C\\uDFFC|\\uD83D\\uDC83\\uD83C\\uDFFD|\\uD83D\\uDC83\\uD83C\\uDFFE|\\uD83D\\uDC83\\uD83C\\uDFFF|\\uD83D\\uDD7A\\uD83C\\uDFFB|\\uD83D\\uDD7A\\uD83C\\uDFFC|\\uD83D\\uDD7A\\uD83C\\uDFFD|\\uD83D\\uDD7A\\uD83C\\uDFFE|\\uD83D\\uDD7A\\uD83C\\uDFFF|\\uD83D\\uDC6F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFB|\\uD83E\\uDDD6\\uD83C\\uDFFC|\\uD83E\\uDDD6\\uD83C\\uDFFD|\\uD83E\\uDDD6\\uD83C\\uDFFE|\\uD83E\\uDDD6\\uD83C\\uDFFF|\\uD83E\\uDDD6\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFB|\\uD83E\\uDDD7\\uD83C\\uDFFC|\\uD83E\\uDDD7\\uD83C\\uDFFD|\\uD83E\\uDDD7\\uD83C\\uDFFE|\\uD83E\\uDDD7\\uD83C\\uDFFF|\\uD83E\\uDDD7\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFB|\\uD83E\\uDDD8\\uD83C\\uDFFC|\\uD83E\\uDDD8\\uD83C\\uDFFD|\\uD83E\\uDDD8\\uD83C\\uDFFE|\\uD83E\\uDDD8\\uD83C\\uDFFF|\\uD83E\\uDDD8\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEC0\\uD83C\\uDFFB|\\uD83D\\uDEC0\\uD83C\\uDFFC|\\uD83D\\uDEC0\\uD83C\\uDFFD|\\uD83D\\uDEC0\\uD83C\\uDFFE|\\uD83D\\uDEC0\\uD83C\\uDFFF|\\uD83D\\uDECC\\uD83C\\uDFFB|\\uD83D\\uDECC\\uD83C\\uDFFC|\\uD83D\\uDECC\\uD83C\\uDFFD|\\uD83D\\uDECC\\uD83C\\uDFFE|\\uD83D\\uDECC\\uD83C\\uDFFF|\\uD83D\\uDD74\\uD83C\\uDFFB|\\uD83D\\uDD74\\uD83C\\uDFFC|\\uD83D\\uDD74\\uD83C\\uDFFD|\\uD83D\\uDD74\\uD83C\\uDFFE|\\uD83D\\uDD74\\uD83C\\uDFFF|\\uD83C\\uDFC7\\uD83C\\uDFFB|\\uD83C\\uDFC7\\uD83C\\uDFFC|\\uD83C\\uDFC7\\uD83C\\uDFFD|\\uD83C\\uDFC7\\uD83C\\uDFFE|\\uD83C\\uDFC7\\uD83C\\uDFFF|\\uD83C\\uDFC2\\uD83C\\uDFFB|\\uD83C\\uDFC2\\uD83C\\uDFFC|\\uD83C\\uDFC2\\uD83C\\uDFFD|\\uD83C\\uDFC2\\uD83C\\uDFFE|\\uD83C\\uDFC2\\uD83C\\uDFFF|\\uD83C\\uDFCC\\uD83C\\uDFFB|\\uD83C\\uDFCC\\uD83C\\uDFFC|\\uD83C\\uDFCC\\uD83C\\uDFFD|\\uD83C\\uDFCC\\uD83C\\uDFFE|\\uD83C\\uDFCC\\uD83C\\uDFFF|\\uD83C\\uDFCC\\uD83F\\uDE0F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83F\\uDE0F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFB|\\uD83C\\uDFC4\\uD83C\\uDFFC|\\uD83C\\uDFC4\\uD83C\\uDFFD|\\uD83C\\uDFC4\\uD83C\\uDFFE|\\uD83C\\uDFC4\\uD83C\\uDFFF|\\uD83C\\uDFC4\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFB|\\uD83D\\uDEA3\\uD83C\\uDFFC|\\uD83D\\uDEA3\\uD83C\\uDFFD|\\uD83D\\uDEA3\\uD83C\\uDFFE|\\uD83D\\uDEA3\\uD83C\\uDFFF|\\uD83D\\uDEA3\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFB|\\uD83C\\uDFCA\\uD83C\\uDFFC|\\uD83C\\uDFCA\\uD83C\\uDFFD|\\uD83C\\uDFCA\\uD83C\\uDFFE|\\uD83C\\uDFCA\\uD83C\\uDFFF|\\uD83C\\uDFCA\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFB|\\uD83C\\uDFCB\\uD83C\\uDFFC|\\uD83C\\uDFCB\\uD83C\\uDFFD|\\uD83C\\uDFCB\\uD83C\\uDFFE|\\uD83C\\uDFCB\\uD83C\\uDFFF|\\uD83C\\uDFCB\\uD83F\\uDE0F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83F\\uDE0F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFB|\\uD83D\\uDEB4\\uD83C\\uDFFC|\\uD83D\\uDEB4\\uD83C\\uDFFD|\\uD83D\\uDEB4\\uD83C\\uDFFE|\\uD83D\\uDEB4\\uD83C\\uDFFF|\\uD83D\\uDEB4\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFB|\\uD83D\\uDEB5\\uD83C\\uDFFC|\\uD83D\\uDEB5\\uD83C\\uDFFD|\\uD83D\\uDEB5\\uD83C\\uDFFE|\\uD83D\\uDEB5\\uD83C\\uDFFF|\\uD83D\\uDEB5\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFB|\\uD83E\\uDD38\\uD83C\\uDFFC|\\uD83E\\uDD38\\uD83C\\uDFFD|\\uD83E\\uDD38\\uD83C\\uDFFE|\\uD83E\\uDD38\\uD83C\\uDFFF|\\uD83E\\uDD38\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3C\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3C\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFB|\\uD83E\\uDD3D\\uD83C\\uDFFC|\\uD83E\\uDD3D\\uD83C\\uDFFD|\\uD83E\\uDD3D\\uD83C\\uDFFE|\\uD83E\\uDD3D\\uD83C\\uDFFF|\\uD83E\\uDD3D\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFB|\\uD83E\\uDD3E\\uD83C\\uDFFC|\\uD83E\\uDD3E\\uD83C\\uDFFD|\\uD83E\\uDD3E\\uD83C\\uDFFE|\\uD83E\\uDD3E\\uD83C\\uDFFF|\\uD83E\\uDD3E\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFB|\\uD83E\\uDD39\\uD83C\\uDFFC|\\uD83E\\uDD39\\uD83C\\uDFFD|\\uD83E\\uDD39\\uD83C\\uDFFE|\\uD83E\\uDD39\\uD83C\\uDFFF|\\uD83E\\uDD39\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68|\\uD83D\\uDC68\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC8B\\u200D\\uD83D\\uDC69|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC68|\\uD83D\\uDC68\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC68|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC69|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83E\\uDD33\\uD83C\\uDFFB|\\uD83E\\uDD33\\uD83C\\uDFFC|\\uD83E\\uDD33\\uD83C\\uDFFD|\\uD83E\\uDD33\\uD83C\\uDFFE|\\uD83E\\uDD33\\uD83C\\uDFFF|\\uD83D\\uDCAA\\uD83C\\uDFFB|\\uD83D\\uDCAA\\uD83C\\uDFFC|\\uD83D\\uDCAA\\uD83C\\uDFFD|\\uD83D\\uDCAA\\uD83C\\uDFFE|\\uD83D\\uDCAA\\uD83C\\uDFFF|\\uD83D\\uDC48\\uD83C\\uDFFB|\\uD83D\\uDC48\\uD83C\\uDFFC|\\uD83D\\uDC48\\uD83C\\uDFFD|\\uD83D\\uDC48\\uD83C\\uDFFE|\\uD83D\\uDC48\\uD83C\\uDFFF|\\uD83D\\uDC49\\uD83C\\uDFFB|\\uD83D\\uDC49\\uD83C\\uDFFC|\\uD83D\\uDC49\\uD83C\\uDFFD|\\uD83D\\uDC49\\uD83C\\uDFFE|\\uD83D\\uDC49\\uD83C\\uDFFF|\\uD83D\\uDC46\\uD83C\\uDFFB|\\uD83D\\uDC46\\uD83C\\uDFFC|\\uD83D\\uDC46\\uD83C\\uDFFD|\\uD83D\\uDC46\\uD83C\\uDFFE|\\uD83D\\uDC46\\uD83C\\uDFFF|\\uD83D\\uDD95\\uD83C\\uDFFB|\\uD83D\\uDD95\\uD83C\\uDFFC|\\uD83D\\uDD95\\uD83C\\uDFFD|\\uD83D\\uDD95\\uD83C\\uDFFE|\\uD83D\\uDD95\\uD83C\\uDFFF|\\uD83D\\uDC47\\uD83C\\uDFFB|\\uD83D\\uDC47\\uD83C\\uDFFC|\\uD83D\\uDC47\\uD83C\\uDFFD|\\uD83D\\uDC47\\uD83C\\uDFFE|\\uD83D\\uDC47\\uD83C\\uDFFF|\\uD83E\\uDD1E\\uD83C\\uDFFB|\\uD83E\\uDD1E\\uD83C\\uDFFC|\\uD83E\\uDD1E\\uD83C\\uDFFD|\\uD83E\\uDD1E\\uD83C\\uDFFE|\\uD83E\\uDD1E\\uD83C\\uDFFF|\\uD83D\\uDD96\\uD83C\\uDFFB|\\uD83D\\uDD96\\uD83C\\uDFFC|\\uD83D\\uDD96\\uD83C\\uDFFD|\\uD83D\\uDD96\\uD83C\\uDFFE|\\uD83D\\uDD96\\uD83C\\uDFFF|\\uD83E\\uDD18\\uD83C\\uDFFB|\\uD83E\\uDD18\\uD83C\\uDFFC|\\uD83E\\uDD18\\uD83C\\uDFFD|\\uD83E\\uDD18\\uD83C\\uDFFE|\\uD83E\\uDD18\\uD83C\\uDFFF|\\uD83E\\uDD19\\uD83C\\uDFFB|\\uD83E\\uDD19\\uD83C\\uDFFC|\\uD83E\\uDD19\\uD83C\\uDFFD|\\uD83E\\uDD19\\uD83C\\uDFFE|\\uD83E\\uDD19\\uD83C\\uDFFF|\\uD83D\\uDD90\\uD83C\\uDFFB|\\uD83D\\uDD90\\uD83C\\uDFFC|\\uD83D\\uDD90\\uD83C\\uDFFD|\\uD83D\\uDD90\\uD83C\\uDFFE|\\uD83D\\uDD90\\uD83C\\uDFFF|\\uD83D\\uDC4C\\uD83C\\uDFFB|\\uD83D\\uDC4C\\uD83C\\uDFFC|\\uD83D\\uDC4C\\uD83C\\uDFFD|\\uD83D\\uDC4C\\uD83C\\uDFFE|\\uD83D\\uDC4C\\uD83C\\uDFFF|\\uD83D\\uDC4D\\uD83C\\uDFFB|\\uD83D\\uDC4D\\uD83C\\uDFFC|\\uD83D\\uDC4D\\uD83C\\uDFFD|\\uD83D\\uDC4D\\uD83C\\uDFFE|\\uD83D\\uDC4D\\uD83C\\uDFFF|\\uD83D\\uDC4E\\uD83C\\uDFFB|\\uD83D\\uDC4E\\uD83C\\uDFFC|\\uD83D\\uDC4E\\uD83C\\uDFFD|\\uD83D\\uDC4E\\uD83C\\uDFFE|\\uD83D\\uDC4E\\uD83C\\uDFFF|\\uD83D\\uDC4A\\uD83C\\uDFFB|\\uD83D\\uDC4A\\uD83C\\uDFFC|\\uD83D\\uDC4A\\uD83C\\uDFFD|\\uD83D\\uDC4A\\uD83C\\uDFFE|\\uD83D\\uDC4A\\uD83C\\uDFFF|\\uD83E\\uDD1B\\uD83C\\uDFFB|\\uD83E\\uDD1B\\uD83C\\uDFFC|\\uD83E\\uDD1B\\uD83C\\uDFFD|\\uD83E\\uDD1B\\uD83C\\uDFFE|\\uD83E\\uDD1B\\uD83C\\uDFFF|\\uD83E\\uDD1C\\uD83C\\uDFFB|\\uD83E\\uDD1C\\uD83C\\uDFFC|\\uD83E\\uDD1C\\uD83C\\uDFFD|\\uD83E\\uDD1C\\uD83C\\uDFFE|\\uD83E\\uDD1C\\uD83C\\uDFFF|\\uD83E\\uDD1A\\uD83C\\uDFFB|\\uD83E\\uDD1A\\uD83C\\uDFFC|\\uD83E\\uDD1A\\uD83C\\uDFFD|\\uD83E\\uDD1A\\uD83C\\uDFFE|\\uD83E\\uDD1A\\uD83C\\uDFFF|\\uD83D\\uDC4B\\uD83C\\uDFFB|\\uD83D\\uDC4B\\uD83C\\uDFFC|\\uD83D\\uDC4B\\uD83C\\uDFFD|\\uD83D\\uDC4B\\uD83C\\uDFFE|\\uD83D\\uDC4B\\uD83C\\uDFFF|\\uD83E\\uDD1F\\uD83C\\uDFFB|\\uD83E\\uDD1F\\uD83C\\uDFFC|\\uD83E\\uDD1F\\uD83C\\uDFFD|\\uD83E\\uDD1F\\uD83C\\uDFFE|\\uD83E\\uDD1F\\uD83C\\uDFFF|\\uD83D\\uDC4F\\uD83C\\uDFFB|\\uD83D\\uDC4F\\uD83C\\uDFFC|\\uD83D\\uDC4F\\uD83C\\uDFFD|\\uD83D\\uDC4F\\uD83C\\uDFFE|\\uD83D\\uDC4F\\uD83C\\uDFFF|\\uD83D\\uDC50\\uD83C\\uDFFB|\\uD83D\\uDC50\\uD83C\\uDFFC|\\uD83D\\uDC50\\uD83C\\uDFFD|\\uD83D\\uDC50\\uD83C\\uDFFE|\\uD83D\\uDC50\\uD83C\\uDFFF|\\uD83D\\uDE4C\\uD83C\\uDFFB|\\uD83D\\uDE4C\\uD83C\\uDFFC|\\uD83D\\uDE4C\\uD83C\\uDFFD|\\uD83D\\uDE4C\\uD83C\\uDFFE|\\uD83D\\uDE4C\\uD83C\\uDFFF|\\uD83E\\uDD32\\uD83C\\uDFFB|\\uD83E\\uDD32\\uD83C\\uDFFC|\\uD83E\\uDD32\\uD83C\\uDFFD|\\uD83E\\uDD32\\uD83C\\uDFFE|\\uD83E\\uDD32\\uD83C\\uDFFF|\\uD83D\\uDE4F\\uD83C\\uDFFB|\\uD83D\\uDE4F\\uD83C\\uDFFC|\\uD83D\\uDE4F\\uD83C\\uDFFD|\\uD83D\\uDE4F\\uD83C\\uDFFE|\\uD83D\\uDE4F\\uD83C\\uDFFF|\\uD83D\\uDC85\\uD83C\\uDFFB|\\uD83D\\uDC85\\uD83C\\uDFFC|\\uD83D\\uDC85\\uD83C\\uDFFD|\\uD83D\\uDC85\\uD83C\\uDFFE|\\uD83D\\uDC85\\uD83C\\uDFFF|\\uD83D\\uDC42\\uD83C\\uDFFB|\\uD83D\\uDC42\\uD83C\\uDFFC|\\uD83D\\uDC42\\uD83C\\uDFFD|\\uD83D\\uDC42\\uD83C\\uDFFE|\\uD83D\\uDC42\\uD83C\\uDFFF|\\uD83D\\uDC43\\uD83C\\uDFFB|\\uD83D\\uDC43\\uD83C\\uDFFC|\\uD83D\\uDC43\\uD83C\\uDFFD|\\uD83D\\uDC43\\uD83C\\uDFFE|\\uD83D\\uDC43\\uD83C\\uDFFF|\\uD83D\\uDC41\\uD83F\\uDE0F\\u200D\\uD83D\\uDDE8\\uD83F\\uDE0F|\\uD83C\\uDFF3\\uD83F\\uDE0F\\u200D\\uD83C\\uDF08|\\uD83C\\uDDE6\\uD83C\\uDDE8|\\uD83C\\uDDE6\\uD83C\\uDDE9|\\uD83C\\uDDE6\\uD83C\\uDDEA|\\uD83C\\uDDE6\\uD83C\\uDDEB|\\uD83C\\uDDE6\\uD83C\\uDDEC|\\uD83C\\uDDE6\\uD83C\\uDDEE|\\uD83C\\uDDE6\\uD83C\\uDDF1|\\uD83C\\uDDE6\\uD83C\\uDDF2|\\uD83C\\uDDE6\\uD83C\\uDDF4|\\uD83C\\uDDE6\\uD83C\\uDDF6|\\uD83C\\uDDE6\\uD83C\\uDDF7|\\uD83C\\uDDE6\\uD83C\\uDDF8|\\uD83C\\uDDE6\\uD83C\\uDDF9|\\uD83C\\uDDE6\\uD83C\\uDDFA|\\uD83C\\uDDE6\\uD83C\\uDDFC|\\uD83C\\uDDE6\\uD83C\\uDDFD|\\uD83C\\uDDE6\\uD83C\\uDDFF|\\uD83C\\uDDE7\\uD83C\\uDDE6|\\uD83C\\uDDE7\\uD83C\\uDDE7|\\uD83C\\uDDE7\\uD83C\\uDDE9|\\uD83C\\uDDE7\\uD83C\\uDDEA|\\uD83C\\uDDE7\\uD83C\\uDDEB|\\uD83C\\uDDE7\\uD83C\\uDDEC|\\uD83C\\uDDE7\\uD83C\\uDDED|\\uD83C\\uDDE7\\uD83C\\uDDEE|\\uD83C\\uDDE7\\uD83C\\uDDEF|\\uD83C\\uDDE7\\uD83C\\uDDF1|\\uD83C\\uDDE7\\uD83C\\uDDF2|\\uD83C\\uDDE7\\uD83C\\uDDF3|\\uD83C\\uDDE7\\uD83C\\uDDF4|\\uD83C\\uDDE7\\uD83C\\uDDF6|\\uD83C\\uDDE7\\uD83C\\uDDF7|\\uD83C\\uDDE7\\uD83C\\uDDF8|\\uD83C\\uDDE7\\uD83C\\uDDF9|\\uD83C\\uDDE7\\uD83C\\uDDFB|\\uD83C\\uDDE7\\uD83C\\uDDFC|\\uD83C\\uDDE7\\uD83C\\uDDFE|\\uD83C\\uDDE7\\uD83C\\uDDFF|\\uD83C\\uDDE8\\uD83C\\uDDE6|\\uD83C\\uDDE8\\uD83C\\uDDE8|\\uD83C\\uDDE8\\uD83C\\uDDE9|\\uD83C\\uDDE8\\uD83C\\uDDEB|\\uD83C\\uDDE8\\uD83C\\uDDEC|\\uD83C\\uDDE8\\uD83C\\uDDED|\\uD83C\\uDDE8\\uD83C\\uDDEE|\\uD83C\\uDDE8\\uD83C\\uDDF0|\\uD83C\\uDDE8\\uD83C\\uDDF1|\\uD83C\\uDDE8\\uD83C\\uDDF2|\\uD83C\\uDDE8\\uD83C\\uDDF3|\\uD83C\\uDDE8\\uD83C\\uDDF4|\\uD83C\\uDDE8\\uD83C\\uDDF5|\\uD83C\\uDDE8\\uD83C\\uDDF7|\\uD83C\\uDDE8\\uD83C\\uDDFA|\\uD83C\\uDDE8\\uD83C\\uDDFB|\\uD83C\\uDDE8\\uD83C\\uDDFC|\\uD83C\\uDDE8\\uD83C\\uDDFD|\\uD83C\\uDDE8\\uD83C\\uDDFE|\\uD83C\\uDDE8\\uD83C\\uDDFF|\\uD83C\\uDDE9\\uD83C\\uDDEA|\\uD83C\\uDDE9\\uD83C\\uDDEC|\\uD83C\\uDDE9\\uD83C\\uDDEF|\\uD83C\\uDDE9\\uD83C\\uDDF0|\\uD83C\\uDDE9\\uD83C\\uDDF2|\\uD83C\\uDDE9\\uD83C\\uDDF4|\\uD83C\\uDDE9\\uD83C\\uDDFF|\\uD83C\\uDDEA\\uD83C\\uDDE6|\\uD83C\\uDDEA\\uD83C\\uDDE8|\\uD83C\\uDDEA\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDEC|\\uD83C\\uDDEA\\uD83C\\uDDED|\\uD83C\\uDDEA\\uD83C\\uDDF7|\\uD83C\\uDDEA\\uD83C\\uDDF8|\\uD83C\\uDDEA\\uD83C\\uDDF9|\\uD83C\\uDDEA\\uD83C\\uDDFA|\\uD83C\\uDDEB\\uD83C\\uDDEE|\\uD83C\\uDDEB\\uD83C\\uDDEF|\\uD83C\\uDDEB\\uD83C\\uDDF0|\\uD83C\\uDDEB\\uD83C\\uDDF2|\\uD83C\\uDDEB\\uD83C\\uDDF4|\\uD83C\\uDDEB\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE6|\\uD83C\\uDDEC\\uD83C\\uDDE7|\\uD83C\\uDDEC\\uD83C\\uDDE9|\\uD83C\\uDDEC\\uD83C\\uDDEA|\\uD83C\\uDDEC\\uD83C\\uDDEB|\\uD83C\\uDDEC\\uD83C\\uDDEC|\\uD83C\\uDDEC\\uD83C\\uDDED|\\uD83C\\uDDEC\\uD83C\\uDDEE|\\uD83C\\uDDEC\\uD83C\\uDDF1|\\uD83C\\uDDEC\\uD83C\\uDDF2|\\uD83C\\uDDEC\\uD83C\\uDDF3|\\uD83C\\uDDEC\\uD83C\\uDDF5|\\uD83C\\uDDEC\\uD83C\\uDDF6|\\uD83C\\uDDEC\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDF8|\\uD83C\\uDDEC\\uD83C\\uDDF9|\\uD83C\\uDDEC\\uD83C\\uDDFA|\\uD83C\\uDDEC\\uD83C\\uDDFC|\\uD83C\\uDDEC\\uD83C\\uDDFE|\\uD83C\\uDDED\\uD83C\\uDDF0|\\uD83C\\uDDED\\uD83C\\uDDF2|\\uD83C\\uDDED\\uD83C\\uDDF3|\\uD83C\\uDDED\\uD83C\\uDDF7|\\uD83C\\uDDED\\uD83C\\uDDF9|\\uD83C\\uDDED\\uD83C\\uDDFA|\\uD83C\\uDDEE\\uD83C\\uDDE8|\\uD83C\\uDDEE\\uD83C\\uDDE9|\\uD83C\\uDDEE\\uD83C\\uDDEA|\\uD83C\\uDDEE\\uD83C\\uDDF1|\\uD83C\\uDDEE\\uD83C\\uDDF2|\\uD83C\\uDDEE\\uD83C\\uDDF3|\\uD83C\\uDDEE\\uD83C\\uDDF4|\\uD83C\\uDDEE\\uD83C\\uDDF6|\\uD83C\\uDDEE\\uD83C\\uDDF7|\\uD83C\\uDDEE\\uD83C\\uDDF8|\\uD83C\\uDDEE\\uD83C\\uDDF9|\\uD83C\\uDDEF\\uD83C\\uDDEA|\\uD83C\\uDDEF\\uD83C\\uDDF2|\\uD83C\\uDDEF\\uD83C\\uDDF4|\\uD83C\\uDDEF\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDEA|\\uD83C\\uDDF0\\uD83C\\uDDEC|\\uD83C\\uDDF0\\uD83C\\uDDED|\\uD83C\\uDDF0\\uD83C\\uDDEE|\\uD83C\\uDDF0\\uD83C\\uDDF2|\\uD83C\\uDDF0\\uD83C\\uDDF3|\\uD83C\\uDDF0\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDF7|\\uD83C\\uDDF0\\uD83C\\uDDFC|\\uD83C\\uDDF0\\uD83C\\uDDFE|\\uD83C\\uDDF0\\uD83C\\uDDFF|\\uD83C\\uDDF1\\uD83C\\uDDE6|\\uD83C\\uDDF1\\uD83C\\uDDE7|\\uD83C\\uDDF1\\uD83C\\uDDE8|\\uD83C\\uDDF1\\uD83C\\uDDEE|\\uD83C\\uDDF1\\uD83C\\uDDF0|\\uD83C\\uDDF1\\uD83C\\uDDF7|\\uD83C\\uDDF1\\uD83C\\uDDF8|\\uD83C\\uDDF1\\uD83C\\uDDF9|\\uD83C\\uDDF1\\uD83C\\uDDFA|\\uD83C\\uDDF1\\uD83C\\uDDFB|\\uD83C\\uDDF1\\uD83C\\uDDFE|\\uD83C\\uDDF2\\uD83C\\uDDE6|\\uD83C\\uDDF2\\uD83C\\uDDE8|\\uD83C\\uDDF2\\uD83C\\uDDE9|\\uD83C\\uDDF2\\uD83C\\uDDEA|\\uD83C\\uDDF2\\uD83C\\uDDEB|\\uD83C\\uDDF2\\uD83C\\uDDEC|\\uD83C\\uDDF2\\uD83C\\uDDED|\\uD83C\\uDDF2\\uD83C\\uDDF0|\\uD83C\\uDDF2\\uD83C\\uDDF1|\\uD83C\\uDDF2\\uD83C\\uDDF2|\\uD83C\\uDDF2\\uD83C\\uDDF3|\\uD83C\\uDDF2\\uD83C\\uDDF4|\\uD83C\\uDDF2\\uD83C\\uDDF5|\\uD83C\\uDDF2\\uD83C\\uDDF6|\\uD83C\\uDDF2\\uD83C\\uDDF7|\\uD83C\\uDDF2\\uD83C\\uDDF8|\\uD83C\\uDDF2\\uD83C\\uDDF9|\\uD83C\\uDDF2\\uD83C\\uDDFA|\\uD83C\\uDDF2\\uD83C\\uDDFB|\\uD83C\\uDDF2\\uD83C\\uDDFC|\\uD83C\\uDDF2\\uD83C\\uDDFD|\\uD83C\\uDDF2\\uD83C\\uDDFE|\\uD83C\\uDDF2\\uD83C\\uDDFF|\\uD83C\\uDDF3\\uD83C\\uDDE6|\\uD83C\\uDDF3\\uD83C\\uDDE8|\\uD83C\\uDDF3\\uD83C\\uDDEA|\\uD83C\\uDDF3\\uD83C\\uDDEB|\\uD83C\\uDDF3\\uD83C\\uDDEC|\\uD83C\\uDDF3\\uD83C\\uDDEE|\\uD83C\\uDDF3\\uD83C\\uDDF1|\\uD83C\\uDDF3\\uD83C\\uDDF4|\\uD83C\\uDDF3\\uD83C\\uDDF5|\\uD83C\\uDDF3\\uD83C\\uDDF7|\\uD83C\\uDDF3\\uD83C\\uDDFA|\\uD83C\\uDDF3\\uD83C\\uDDFF|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDE6|\\uD83C\\uDDF5\\uD83C\\uDDEA|\\uD83C\\uDDF5\\uD83C\\uDDEB|\\uD83C\\uDDF5\\uD83C\\uDDEC|\\uD83C\\uDDF5\\uD83C\\uDDED|\\uD83C\\uDDF5\\uD83C\\uDDF0|\\uD83C\\uDDF5\\uD83C\\uDDF1|\\uD83C\\uDDF5\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDF3|\\uD83C\\uDDF5\\uD83C\\uDDF7|\\uD83C\\uDDF5\\uD83C\\uDDF8|\\uD83C\\uDDF5\\uD83C\\uDDF9|\\uD83C\\uDDF5\\uD83C\\uDDFC|\\uD83C\\uDDF5\\uD83C\\uDDFE|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF7\\uD83C\\uDDEA|\\uD83C\\uDDF7\\uD83C\\uDDF4|\\uD83C\\uDDF7\\uD83C\\uDDF8|\\uD83C\\uDDF7\\uD83C\\uDDFA|\\uD83C\\uDDF7\\uD83C\\uDDFC|\\uD83C\\uDDF8\\uD83C\\uDDE6|\\uD83C\\uDDF8\\uD83C\\uDDE7|\\uD83C\\uDDF8\\uD83C\\uDDE8|\\uD83C\\uDDF8\\uD83C\\uDDE9|\\uD83C\\uDDF8\\uD83C\\uDDEA|\\uD83C\\uDDF8\\uD83C\\uDDEC|\\uD83C\\uDDF8\\uD83C\\uDDED|\\uD83C\\uDDF8\\uD83C\\uDDEE|\\uD83C\\uDDF8\\uD83C\\uDDEF|\\uD83C\\uDDF8\\uD83C\\uDDF0|\\uD83C\\uDDF8\\uD83C\\uDDF1|\\uD83C\\uDDF8\\uD83C\\uDDF2|\\uD83C\\uDDF8\\uD83C\\uDDF3|\\uD83C\\uDDF8\\uD83C\\uDDF4|\\uD83C\\uDDF8\\uD83C\\uDDF7|\\uD83C\\uDDF8\\uD83C\\uDDF8|\\uD83C\\uDDF8\\uD83C\\uDDF9|\\uD83C\\uDDF8\\uD83C\\uDDFB|\\uD83C\\uDDF8\\uD83C\\uDDFD|\\uD83C\\uDDF8\\uD83C\\uDDFE|\\uD83C\\uDDF8\\uD83C\\uDDFF|\\uD83C\\uDDF9\\uD83C\\uDDE6|\\uD83C\\uDDF9\\uD83C\\uDDE8|\\uD83C\\uDDF9\\uD83C\\uDDE9|\\uD83C\\uDDF9\\uD83C\\uDDEB|\\uD83C\\uDDF9\\uD83C\\uDDEC|\\uD83C\\uDDF9\\uD83C\\uDDED|\\uD83C\\uDDF9\\uD83C\\uDDEF|\\uD83C\\uDDF9\\uD83C\\uDDF0|\\uD83C\\uDDF9\\uD83C\\uDDF1|\\uD83C\\uDDF9\\uD83C\\uDDF2|\\uD83C\\uDDF9\\uD83C\\uDDF3|\\uD83C\\uDDF9\\uD83C\\uDDF4|\\uD83C\\uDDF9\\uD83C\\uDDF7|\\uD83C\\uDDF9\\uD83C\\uDDF9|\\uD83C\\uDDF9\\uD83C\\uDDFB|\\uD83C\\uDDF9\\uD83C\\uDDFC|\\uD83C\\uDDF9\\uD83C\\uDDFF|\\uD83C\\uDDFA\\uD83C\\uDDE6|\\uD83C\\uDDFA\\uD83C\\uDDEC|\\uD83C\\uDDFA\\uD83C\\uDDF2|\\uD83C\\uDDFA\\uD83C\\uDDF3|\\uD83C\\uDDFA\\uD83C\\uDDF8|\\uD83C\\uDDFA\\uD83C\\uDDFE|\\uD83C\\uDDFA\\uD83C\\uDDFF|\\uD83C\\uDDFB\\uD83C\\uDDE6|\\uD83C\\uDDFB\\uD83C\\uDDE8|\\uD83C\\uDDFB\\uD83C\\uDDEA|\\uD83C\\uDDFB\\uD83C\\uDDEC|\\uD83C\\uDDFB\\uD83C\\uDDEE|\\uD83C\\uDDFB\\uD83C\\uDDF3|\\uD83C\\uDDFB\\uD83C\\uDDFA|\\uD83C\\uDDFC\\uD83C\\uDDEB|\\uD83C\\uDDFC\\uD83C\\uDDF8|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDFE\\uD83C\\uDDEA|\\uD83C\\uDDFE\\uD83C\\uDDF9|\\uD83C\\uDDFF\\uD83C\\uDDE6|\\uD83C\\uDDFF\\uD83C\\uDDF2|\\uD83C\\uDDFF\\uD83C\\uDDFC|\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67\\uDB40\\uDC7F|\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74\\uDB40\\uDC7F|\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73\\uDB40\\uDC7F|[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF][\\u200D|\\uFE0F]|[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF]|[0-9|*|#]\\uFE0F\\u20E3|[0-9|#]\\u20E3|[\\u203C-\\u3299]\\uFE0F\\u200D|[\\u203C-\\u3299]\\uFE0F|[\\u2122-\\u2B55]|\\u303D|[\\A9|\\AE]\\u3030|\\uA9|\\uAE|\\u3030)/ig;\n    var unicodeRegExp = /\\uf476\\uf3fb|\\uf476\\uf3fc|\\uf476\\uf3fd|\\uf476\\uf3fe|\\uf476\\uf3ff|\\uf9d2\\uf3fb|\\uf9d2\\uf3fc|\\uf9d2\\uf3fd|\\uf9d2\\uf3fe|\\uf9d2\\uf3ff|\\uf466\\uf3fb|\\uf466\\uf3fc|\\uf466\\uf3fd|\\uf466\\uf3fe|\\uf466\\uf3ff|\\uf467\\uf3fb|\\uf467\\uf3fc|\\uf467\\uf3fd|\\uf467\\uf3fe|\\uf467\\uf3ff|\\uf9d1\\uf3fb|\\uf9d1\\uf3fc|\\uf9d1\\uf3fd|\\uf9d1\\uf3fe|\\uf9d1\\uf3ff|\\uf468\\uf3fb|\\uf468\\uf3fc|\\uf468\\uf3fd|\\uf468\\uf3fe|\\uf468\\uf3ff|\\uf469\\uf3fb|\\uf469\\uf3fc|\\uf469\\uf3fd|\\uf469\\uf3fe|\\uf469\\uf3ff|\\uf9d3\\uf3fb|\\uf9d3\\uf3fc|\\uf9d3\\uf3fd|\\uf9d3\\uf3fe|\\uf9d3\\uf3ff|\\uf474\\uf3fb|\\uf474\\uf3fc|\\uf474\\uf3fd|\\uf474\\uf3fe|\\uf474\\uf3ff|\\uf475\\uf3fb|\\uf475\\uf3fc|\\uf475\\uf3fd|\\uf475\\uf3fe|\\uf475\\uf3ff|\\uf468\\uf3fb\\u200d\\u2695\\ufe0f|\\uf468\\uf3fc\\u200d\\u2695\\ufe0f|\\uf468\\uf3fd\\u200d\\u2695\\ufe0f|\\uf468\\uf3fe\\u200d\\u2695\\ufe0f|\\uf468\\uf3ff\\u200d\\u2695\\ufe0f|\\uf469\\uf3fb\\u200d\\u2695\\ufe0f|\\uf469\\uf3fc\\u200d\\u2695\\ufe0f|\\uf469\\uf3fd\\u200d\\u2695\\ufe0f|\\uf469\\uf3fe\\u200d\\u2695\\ufe0f|\\uf469\\uf3ff\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\uf393|\\uf468\\uf3fc\\u200d\\uf393|\\uf468\\uf3fd\\u200d\\uf393|\\uf468\\uf3fe\\u200d\\uf393|\\uf468\\uf3ff\\u200d\\uf393|\\uf469\\uf3fb\\u200d\\uf393|\\uf469\\uf3fc\\u200d\\uf393|\\uf469\\uf3fd\\u200d\\uf393|\\uf469\\uf3fe\\u200d\\uf393|\\uf469\\uf3ff\\u200d\\uf393|\\uf468\\uf3fb\\u200d\\uf3eb|\\uf468\\uf3fc\\u200d\\uf3eb|\\uf468\\uf3fd\\u200d\\uf3eb|\\uf468\\uf3fe\\u200d\\uf3eb|\\uf468\\uf3ff\\u200d\\uf3eb|\\uf469\\uf3fb\\u200d\\uf3eb|\\uf469\\uf3fc\\u200d\\uf3eb|\\uf469\\uf3fd\\u200d\\uf3eb|\\uf469\\uf3fe\\u200d\\uf3eb|\\uf469\\uf3ff\\u200d\\uf3eb|\\uf468\\uf3fb\\u200d\\u2696\\ufe0f|\\uf468\\uf3fc\\u200d\\u2696\\ufe0f|\\uf468\\uf3fd\\u200d\\u2696\\ufe0f|\\uf468\\uf3fe\\u200d\\u2696\\ufe0f|\\uf468\\uf3ff\\u200d\\u2696\\ufe0f|\\uf469\\uf3fb\\u200d\\u2696\\ufe0f|\\uf469\\uf3fc\\u200d\\u2696\\ufe0f|\\uf469\\uf3fd\\u200d\\u2696\\ufe0f|\\uf469\\uf3fe\\u200d\\u2696\\ufe0f|\\uf469\\uf3ff\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\uf33e|\\uf468\\uf3fc\\u200d\\uf33e|\\uf468\\uf3fd\\u200d\\uf33e|\\uf468\\uf3fe\\u200d\\uf33e|\\uf468\\uf3ff\\u200d\\uf33e|\\uf469\\uf3fb\\u200d\\uf33e|\\uf469\\uf3fc\\u200d\\uf33e|\\uf469\\uf3fd\\u200d\\uf33e|\\uf469\\uf3fe\\u200d\\uf33e|\\uf469\\uf3ff\\u200d\\uf33e|\\uf468\\uf3fb\\u200d\\uf373|\\uf468\\uf3fc\\u200d\\uf373|\\uf468\\uf3fd\\u200d\\uf373|\\uf468\\uf3fe\\u200d\\uf373|\\uf468\\uf3ff\\u200d\\uf373|\\uf469\\uf3fb\\u200d\\uf373|\\uf469\\uf3fc\\u200d\\uf373|\\uf469\\uf3fd\\u200d\\uf373|\\uf469\\uf3fe\\u200d\\uf373|\\uf469\\uf3ff\\u200d\\uf373|\\uf468\\uf3fb\\u200d\\uf527|\\uf468\\uf3fc\\u200d\\uf527|\\uf468\\uf3fd\\u200d\\uf527|\\uf468\\uf3fe\\u200d\\uf527|\\uf468\\uf3ff\\u200d\\uf527|\\uf469\\uf3fb\\u200d\\uf527|\\uf469\\uf3fc\\u200d\\uf527|\\uf469\\uf3fd\\u200d\\uf527|\\uf469\\uf3fe\\u200d\\uf527|\\uf469\\uf3ff\\u200d\\uf527|\\uf468\\uf3fb\\u200d\\uf3ed|\\uf468\\uf3fc\\u200d\\uf3ed|\\uf468\\uf3fd\\u200d\\uf3ed|\\uf468\\uf3fe\\u200d\\uf3ed|\\uf468\\uf3ff\\u200d\\uf3ed|\\uf469\\uf3fb\\u200d\\uf3ed|\\uf469\\uf3fc\\u200d\\uf3ed|\\uf469\\uf3fd\\u200d\\uf3ed|\\uf469\\uf3fe\\u200d\\uf3ed|\\uf469\\uf3ff\\u200d\\uf3ed|\\uf468\\uf3fb\\u200d\\uf4bc|\\uf468\\uf3fc\\u200d\\uf4bc|\\uf468\\uf3fd\\u200d\\uf4bc|\\uf468\\uf3fe\\u200d\\uf4bc|\\uf468\\uf3ff\\u200d\\uf4bc|\\uf469\\uf3fb\\u200d\\uf4bc|\\uf469\\uf3fc\\u200d\\uf4bc|\\uf469\\uf3fd\\u200d\\uf4bc|\\uf469\\uf3fe\\u200d\\uf4bc|\\uf469\\uf3ff\\u200d\\uf4bc|\\uf468\\uf3fb\\u200d\\uf52c|\\uf468\\uf3fc\\u200d\\uf52c|\\uf468\\uf3fd\\u200d\\uf52c|\\uf468\\uf3fe\\u200d\\uf52c|\\uf468\\uf3ff\\u200d\\uf52c|\\uf469\\uf3fb\\u200d\\uf52c|\\uf469\\uf3fc\\u200d\\uf52c|\\uf469\\uf3fd\\u200d\\uf52c|\\uf469\\uf3fe\\u200d\\uf52c|\\uf469\\uf3ff\\u200d\\uf52c|\\uf468\\uf3fb\\u200d\\uf4bb|\\uf468\\uf3fc\\u200d\\uf4bb|\\uf468\\uf3fd\\u200d\\uf4bb|\\uf468\\uf3fe\\u200d\\uf4bb|\\uf468\\uf3ff\\u200d\\uf4bb|\\uf469\\uf3fb\\u200d\\uf4bb|\\uf469\\uf3fc\\u200d\\uf4bb|\\uf469\\uf3fd\\u200d\\uf4bb|\\uf469\\uf3fe\\u200d\\uf4bb|\\uf469\\uf3ff\\u200d\\uf4bb|\\uf468\\uf3fb\\u200d\\uf3a4|\\uf468\\uf3fc\\u200d\\uf3a4|\\uf468\\uf3fd\\u200d\\uf3a4|\\uf468\\uf3fe\\u200d\\uf3a4|\\uf468\\uf3ff\\u200d\\uf3a4|\\uf469\\uf3fb\\u200d\\uf3a4|\\uf469\\uf3fc\\u200d\\uf3a4|\\uf469\\uf3fd\\u200d\\uf3a4|\\uf469\\uf3fe\\u200d\\uf3a4|\\uf469\\uf3ff\\u200d\\uf3a4|\\uf468\\uf3fb\\u200d\\uf3a8|\\uf468\\uf3fc\\u200d\\uf3a8|\\uf468\\uf3fd\\u200d\\uf3a8|\\uf468\\uf3fe\\u200d\\uf3a8|\\uf468\\uf3ff\\u200d\\uf3a8|\\uf469\\uf3fb\\u200d\\uf3a8|\\uf469\\uf3fc\\u200d\\uf3a8|\\uf469\\uf3fd\\u200d\\uf3a8|\\uf469\\uf3fe\\u200d\\uf3a8|\\uf469\\uf3ff\\u200d\\uf3a8|\\uf468\\uf3fb\\u200d\\u2708\\ufe0f|\\uf468\\uf3fc\\u200d\\u2708\\ufe0f|\\uf468\\uf3fd\\u200d\\u2708\\ufe0f|\\uf468\\uf3fe\\u200d\\u2708\\ufe0f|\\uf468\\uf3ff\\u200d\\u2708\\ufe0f|\\uf469\\uf3fb\\u200d\\u2708\\ufe0f|\\uf469\\uf3fc\\u200d\\u2708\\ufe0f|\\uf469\\uf3fd\\u200d\\u2708\\ufe0f|\\uf469\\uf3fe\\u200d\\u2708\\ufe0f|\\uf469\\uf3ff\\u200d\\u2708\\ufe0f|\\uf468\\uf3fb\\u200d\\uf680|\\uf468\\uf3fc\\u200d\\uf680|\\uf468\\uf3fd\\u200d\\uf680|\\uf468\\uf3fe\\u200d\\uf680|\\uf468\\uf3ff\\u200d\\uf680|\\uf469\\uf3fb\\u200d\\uf680|\\uf469\\uf3fc\\u200d\\uf680|\\uf469\\uf3fd\\u200d\\uf680|\\uf469\\uf3fe\\u200d\\uf680|\\uf469\\uf3ff\\u200d\\uf680|\\uf468\\uf3fb\\u200d\\uf692|\\uf468\\uf3fc\\u200d\\uf692|\\uf468\\uf3fd\\u200d\\uf692|\\uf468\\uf3fe\\u200d\\uf692|\\uf468\\uf3ff\\u200d\\uf692|\\uf469\\uf3fb\\u200d\\uf692|\\uf469\\uf3fc\\u200d\\uf692|\\uf469\\uf3fd\\u200d\\uf692|\\uf469\\uf3fe\\u200d\\uf692|\\uf469\\uf3ff\\u200d\\uf692|\\uf46e\\uf3fb|\\uf46e\\uf3fc|\\uf46e\\uf3fd|\\uf46e\\uf3fe|\\uf46e\\uf3ff|\\uf46e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf575\\uf3fb|\\uf575\\uf3fc|\\uf575\\uf3fd|\\uf575\\uf3fe|\\uf575\\uf3ff|\\uf575\\uf3fb\\u200d\\u2642\\ufe0f|\\uf575\\uf3fc\\u200d\\u2642\\ufe0f|\\uf575\\uf3fd\\u200d\\u2642\\ufe0f|\\uf575\\uf3fe\\u200d\\u2642\\ufe0f|\\uf575\\uf3ff\\u200d\\u2642\\ufe0f|\\uf575\\uf3fb\\u200d\\u2640\\ufe0f|\\uf575\\uf3fc\\u200d\\u2640\\ufe0f|\\uf575\\uf3fd\\u200d\\u2640\\ufe0f|\\uf575\\uf3fe\\u200d\\u2640\\ufe0f|\\uf575\\uf3ff\\u200d\\u2640\\ufe0f|\\uf482\\uf3fb|\\uf482\\uf3fc|\\uf482\\uf3fd|\\uf482\\uf3fe|\\uf482\\uf3ff|\\uf482\\uf3fb\\u200d\\u2642\\ufe0f|\\uf482\\uf3fc\\u200d\\u2642\\ufe0f|\\uf482\\uf3fd\\u200d\\u2642\\ufe0f|\\uf482\\uf3fe\\u200d\\u2642\\ufe0f|\\uf482\\uf3ff\\u200d\\u2642\\ufe0f|\\uf482\\uf3fb\\u200d\\u2640\\ufe0f|\\uf482\\uf3fc\\u200d\\u2640\\ufe0f|\\uf482\\uf3fd\\u200d\\u2640\\ufe0f|\\uf482\\uf3fe\\u200d\\u2640\\ufe0f|\\uf482\\uf3ff\\u200d\\u2640\\ufe0f|\\uf477\\uf3fb|\\uf477\\uf3fc|\\uf477\\uf3fd|\\uf477\\uf3fe|\\uf477\\uf3ff|\\uf477\\uf3fb\\u200d\\u2642\\ufe0f|\\uf477\\uf3fc\\u200d\\u2642\\ufe0f|\\uf477\\uf3fd\\u200d\\u2642\\ufe0f|\\uf477\\uf3fe\\u200d\\u2642\\ufe0f|\\uf477\\uf3ff\\u200d\\u2642\\ufe0f|\\uf477\\uf3fb\\u200d\\u2640\\ufe0f|\\uf477\\uf3fc\\u200d\\u2640\\ufe0f|\\uf477\\uf3fd\\u200d\\u2640\\ufe0f|\\uf477\\uf3fe\\u200d\\u2640\\ufe0f|\\uf477\\uf3ff\\u200d\\u2640\\ufe0f|\\uf934\\uf3fb|\\uf934\\uf3fc|\\uf934\\uf3fd|\\uf934\\uf3fe|\\uf934\\uf3ff|\\uf478\\uf3fb|\\uf478\\uf3fc|\\uf478\\uf3fd|\\uf478\\uf3fe|\\uf478\\uf3ff|\\uf473\\uf3fb|\\uf473\\uf3fc|\\uf473\\uf3fd|\\uf473\\uf3fe|\\uf473\\uf3ff|\\uf473\\uf3fb\\u200d\\u2642\\ufe0f|\\uf473\\uf3fc\\u200d\\u2642\\ufe0f|\\uf473\\uf3fd\\u200d\\u2642\\ufe0f|\\uf473\\uf3fe\\u200d\\u2642\\ufe0f|\\uf473\\uf3ff\\u200d\\u2642\\ufe0f|\\uf473\\uf3fb\\u200d\\u2640\\ufe0f|\\uf473\\uf3fc\\u200d\\u2640\\ufe0f|\\uf473\\uf3fd\\u200d\\u2640\\ufe0f|\\uf473\\uf3fe\\u200d\\u2640\\ufe0f|\\uf473\\uf3ff\\u200d\\u2640\\ufe0f|\\uf472\\uf3fb|\\uf472\\uf3fc|\\uf472\\uf3fd|\\uf472\\uf3fe|\\uf472\\uf3ff|\\uf9d5\\uf3fb|\\uf9d5\\uf3fc|\\uf9d5\\uf3fd|\\uf9d5\\uf3fe|\\uf9d5\\uf3ff|\\uf9d4\\uf3fb|\\uf9d4\\uf3fc|\\uf9d4\\uf3fd|\\uf9d4\\uf3fe|\\uf9d4\\uf3ff|\\uf471\\uf3fb|\\uf471\\uf3fc|\\uf471\\uf3fd|\\uf471\\uf3fe|\\uf471\\uf3ff|\\uf471\\uf3fb\\u200d\\u2642\\ufe0f|\\uf471\\uf3fc\\u200d\\u2642\\ufe0f|\\uf471\\uf3fd\\u200d\\u2642\\ufe0f|\\uf471\\uf3fe\\u200d\\u2642\\ufe0f|\\uf471\\uf3ff\\u200d\\u2642\\ufe0f|\\uf471\\uf3fb\\u200d\\u2640\\ufe0f|\\uf471\\uf3fc\\u200d\\u2640\\ufe0f|\\uf471\\uf3fd\\u200d\\u2640\\ufe0f|\\uf471\\uf3fe\\u200d\\u2640\\ufe0f|\\uf471\\uf3ff\\u200d\\u2640\\ufe0f|\\uf935\\uf3fb|\\uf935\\uf3fc|\\uf935\\uf3fd|\\uf935\\uf3fe|\\uf935\\uf3ff|\\uf470\\uf3fb|\\uf470\\uf3fc|\\uf470\\uf3fd|\\uf470\\uf3fe|\\uf470\\uf3ff|\\uf930\\uf3fb|\\uf930\\uf3fc|\\uf930\\uf3fd|\\uf930\\uf3fe|\\uf930\\uf3ff|\\uf931\\uf3fb|\\uf931\\uf3fc|\\uf931\\uf3fd|\\uf931\\uf3fe|\\uf931\\uf3ff|\\uf47c\\uf3fb|\\uf47c\\uf3fc|\\uf47c\\uf3fd|\\uf47c\\uf3fe|\\uf47c\\uf3ff|\\uf385\\uf3fb|\\uf385\\uf3fc|\\uf385\\uf3fd|\\uf385\\uf3fe|\\uf385\\uf3ff|\\uf936\\uf3fb|\\uf936\\uf3fc|\\uf936\\uf3fd|\\uf936\\uf3fe|\\uf936\\uf3ff|\\uf9d9\\uf3fb|\\uf9d9\\uf3fc|\\uf9d9\\uf3fd|\\uf9d9\\uf3fe|\\uf9d9\\uf3ff|\\uf9d9\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fb|\\uf9da\\uf3fc|\\uf9da\\uf3fd|\\uf9da\\uf3fe|\\uf9da\\uf3ff|\\uf9da\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fb|\\uf9db\\uf3fc|\\uf9db\\uf3fd|\\uf9db\\uf3fe|\\uf9db\\uf3ff|\\uf9db\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fb|\\uf9dc\\uf3fc|\\uf9dc\\uf3fd|\\uf9dc\\uf3fe|\\uf9dc\\uf3ff|\\uf9dc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fb|\\uf9dd\\uf3fc|\\uf9dd\\uf3fd|\\uf9dd\\uf3fe|\\uf9dd\\uf3ff|\\uf9dd\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb|\\uf64d\\uf3fc|\\uf64d\\uf3fd|\\uf64d\\uf3fe|\\uf64d\\uf3ff|\\uf64d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fb|\\uf64e\\uf3fc|\\uf64e\\uf3fd|\\uf64e\\uf3fe|\\uf64e\\uf3ff|\\uf64e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf645\\uf3fb|\\uf645\\uf3fc|\\uf645\\uf3fd|\\uf645\\uf3fe|\\uf645\\uf3ff|\\uf645\\uf3fb\\u200d\\u2642\\ufe0f|\\uf645\\uf3fc\\u200d\\u2642\\ufe0f|\\uf645\\uf3fd\\u200d\\u2642\\ufe0f|\\uf645\\uf3fe\\u200d\\u2642\\ufe0f|\\uf645\\uf3ff\\u200d\\u2642\\ufe0f|\\uf645\\uf3fb\\u200d\\u2640\\ufe0f|\\uf645\\uf3fc\\u200d\\u2640\\ufe0f|\\uf645\\uf3fd\\u200d\\u2640\\ufe0f|\\uf645\\uf3fe\\u200d\\u2640\\ufe0f|\\uf645\\uf3ff\\u200d\\u2640\\ufe0f|\\uf646\\uf3fb|\\uf646\\uf3fc|\\uf646\\uf3fd|\\uf646\\uf3fe|\\uf646\\uf3ff|\\uf646\\uf3fb\\u200d\\u2642\\ufe0f|\\uf646\\uf3fc\\u200d\\u2642\\ufe0f|\\uf646\\uf3fd\\u200d\\u2642\\ufe0f|\\uf646\\uf3fe\\u200d\\u2642\\ufe0f|\\uf646\\uf3ff\\u200d\\u2642\\ufe0f|\\uf646\\uf3fb\\u200d\\u2640\\ufe0f|\\uf646\\uf3fc\\u200d\\u2640\\ufe0f|\\uf646\\uf3fd\\u200d\\u2640\\ufe0f|\\uf646\\uf3fe\\u200d\\u2640\\ufe0f|\\uf646\\uf3ff\\u200d\\u2640\\ufe0f|\\uf481\\uf3fb|\\uf481\\uf3fc|\\uf481\\uf3fd|\\uf481\\uf3fe|\\uf481\\uf3ff|\\uf481\\uf3fb\\u200d\\u2642\\ufe0f|\\uf481\\uf3fc\\u200d\\u2642\\ufe0f|\\uf481\\uf3fd\\u200d\\u2642\\ufe0f|\\uf481\\uf3fe\\u200d\\u2642\\ufe0f|\\uf481\\uf3ff\\u200d\\u2642\\ufe0f|\\uf481\\uf3fb\\u200d\\u2640\\ufe0f|\\uf481\\uf3fc\\u200d\\u2640\\ufe0f|\\uf481\\uf3fd\\u200d\\u2640\\ufe0f|\\uf481\\uf3fe\\u200d\\u2640\\ufe0f|\\uf481\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fb|\\uf64b\\uf3fc|\\uf64b\\uf3fd|\\uf64b\\uf3fe|\\uf64b\\uf3ff|\\uf64b\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2640\\ufe0f|\\uf647\\uf3fb|\\uf647\\uf3fc|\\uf647\\uf3fd|\\uf647\\uf3fe|\\uf647\\uf3ff|\\uf647\\uf3fb\\u200d\\u2642\\ufe0f|\\uf647\\uf3fc\\u200d\\u2642\\ufe0f|\\uf647\\uf3fd\\u200d\\u2642\\ufe0f|\\uf647\\uf3fe\\u200d\\u2642\\ufe0f|\\uf647\\uf3ff\\u200d\\u2642\\ufe0f|\\uf647\\uf3fb\\u200d\\u2640\\ufe0f|\\uf647\\uf3fc\\u200d\\u2640\\ufe0f|\\uf647\\uf3fd\\u200d\\u2640\\ufe0f|\\uf647\\uf3fe\\u200d\\u2640\\ufe0f|\\uf647\\uf3ff\\u200d\\u2640\\ufe0f|\\uf926\\uf3fb|\\uf926\\uf3fc|\\uf926\\uf3fd|\\uf926\\uf3fe|\\uf926\\uf3ff|\\uf926\\uf3fb\\u200d\\u2642\\ufe0f|\\uf926\\uf3fc\\u200d\\u2642\\ufe0f|\\uf926\\uf3fd\\u200d\\u2642\\ufe0f|\\uf926\\uf3fe\\u200d\\u2642\\ufe0f|\\uf926\\uf3ff\\u200d\\u2642\\ufe0f|\\uf926\\uf3fb\\u200d\\u2640\\ufe0f|\\uf926\\uf3fc\\u200d\\u2640\\ufe0f|\\uf926\\uf3fd\\u200d\\u2640\\ufe0f|\\uf926\\uf3fe\\u200d\\u2640\\ufe0f|\\uf926\\uf3ff\\u200d\\u2640\\ufe0f|\\uf937\\uf3fb|\\uf937\\uf3fc|\\uf937\\uf3fd|\\uf937\\uf3fe|\\uf937\\uf3ff|\\uf937\\uf3fb\\u200d\\u2642\\ufe0f|\\uf937\\uf3fc\\u200d\\u2642\\ufe0f|\\uf937\\uf3fd\\u200d\\u2642\\ufe0f|\\uf937\\uf3fe\\u200d\\u2642\\ufe0f|\\uf937\\uf3ff\\u200d\\u2642\\ufe0f|\\uf937\\uf3fb\\u200d\\u2640\\ufe0f|\\uf937\\uf3fc\\u200d\\u2640\\ufe0f|\\uf937\\uf3fd\\u200d\\u2640\\ufe0f|\\uf937\\uf3fe\\u200d\\u2640\\ufe0f|\\uf937\\uf3ff\\u200d\\u2640\\ufe0f|\\uf486\\uf3fb|\\uf486\\uf3fc|\\uf486\\uf3fd|\\uf486\\uf3fe|\\uf486\\uf3ff|\\uf486\\uf3fb\\u200d\\u2642\\ufe0f|\\uf486\\uf3fc\\u200d\\u2642\\ufe0f|\\uf486\\uf3fd\\u200d\\u2642\\ufe0f|\\uf486\\uf3fe\\u200d\\u2642\\ufe0f|\\uf486\\uf3ff\\u200d\\u2642\\ufe0f|\\uf486\\uf3fb\\u200d\\u2640\\ufe0f|\\uf486\\uf3fc\\u200d\\u2640\\ufe0f|\\uf486\\uf3fd\\u200d\\u2640\\ufe0f|\\uf486\\uf3fe\\u200d\\u2640\\ufe0f|\\uf486\\uf3ff\\u200d\\u2640\\ufe0f|\\uf487\\uf3fb|\\uf487\\uf3fc|\\uf487\\uf3fd|\\uf487\\uf3fe|\\uf487\\uf3ff|\\uf487\\uf3fb\\u200d\\u2642\\ufe0f|\\uf487\\uf3fc\\u200d\\u2642\\ufe0f|\\uf487\\uf3fd\\u200d\\u2642\\ufe0f|\\uf487\\uf3fe\\u200d\\u2642\\ufe0f|\\uf487\\uf3ff\\u200d\\u2642\\ufe0f|\\uf487\\uf3fb\\u200d\\u2640\\ufe0f|\\uf487\\uf3fc\\u200d\\u2640\\ufe0f|\\uf487\\uf3fd\\u200d\\u2640\\ufe0f|\\uf487\\uf3fe\\u200d\\u2640\\ufe0f|\\uf487\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fb|\\uf6b6\\uf3fc|\\uf6b6\\uf3fd|\\uf6b6\\uf3fe|\\uf6b6\\uf3ff|\\uf6b6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fb|\\uf3c3\\uf3fc|\\uf3c3\\uf3fd|\\uf3c3\\uf3fe|\\uf3c3\\uf3ff|\\uf3c3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf483\\uf3fb|\\uf483\\uf3fc|\\uf483\\uf3fd|\\uf483\\uf3fe|\\uf483\\uf3ff|\\uf57a\\uf3fb|\\uf57a\\uf3fc|\\uf57a\\uf3fd|\\uf57a\\uf3fe|\\uf57a\\uf3ff|\\uf9d6\\uf3fb|\\uf9d6\\uf3fc|\\uf9d6\\uf3fd|\\uf9d6\\uf3fe|\\uf9d6\\uf3ff|\\uf9d6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fb|\\uf9d7\\uf3fc|\\uf9d7\\uf3fd|\\uf9d7\\uf3fe|\\uf9d7\\uf3ff|\\uf9d7\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fb|\\uf9d8\\uf3fc|\\uf9d8\\uf3fd|\\uf9d8\\uf3fe|\\uf9d8\\uf3ff|\\uf9d8\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6c0\\uf3fb|\\uf6c0\\uf3fc|\\uf6c0\\uf3fd|\\uf6c0\\uf3fe|\\uf6c0\\uf3ff|\\uf6cc\\uf3fb|\\uf6cc\\uf3fc|\\uf6cc\\uf3fd|\\uf6cc\\uf3fe|\\uf6cc\\uf3ff|\\uf574\\uf3fb|\\uf574\\uf3fc|\\uf574\\uf3fd|\\uf574\\uf3fe|\\uf574\\uf3ff|\\uf3c7\\uf3fb|\\uf3c7\\uf3fc|\\uf3c7\\uf3fd|\\uf3c7\\uf3fe|\\uf3c7\\uf3ff|\\uf3c2\\uf3fb|\\uf3c2\\uf3fc|\\uf3c2\\uf3fd|\\uf3c2\\uf3fe|\\uf3c2\\uf3ff|\\uf3cc\\uf3fb|\\uf3cc\\uf3fc|\\uf3cc\\uf3fd|\\uf3cc\\uf3fe|\\uf3cc\\uf3ff|\\uf3cc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fb|\\uf3c4\\uf3fc|\\uf3c4\\uf3fd|\\uf3c4\\uf3fe|\\uf3c4\\uf3ff|\\uf3c4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fb|\\uf6a3\\uf3fc|\\uf6a3\\uf3fd|\\uf6a3\\uf3fe|\\uf6a3\\uf3ff|\\uf6a3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fb|\\uf3ca\\uf3fc|\\uf3ca\\uf3fd|\\uf3ca\\uf3fe|\\uf3ca\\uf3ff|\\uf3ca\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fb|\\uf3cb\\uf3fc|\\uf3cb\\uf3fd|\\uf3cb\\uf3fe|\\uf3cb\\uf3ff|\\uf3cb\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fb|\\uf6b4\\uf3fc|\\uf6b4\\uf3fd|\\uf6b4\\uf3fe|\\uf6b4\\uf3ff|\\uf6b4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fb|\\uf6b5\\uf3fc|\\uf6b5\\uf3fd|\\uf6b5\\uf3fe|\\uf6b5\\uf3ff|\\uf6b5\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2640\\ufe0f|\\uf938\\uf3fb|\\uf938\\uf3fc|\\uf938\\uf3fd|\\uf938\\uf3fe|\\uf938\\uf3ff|\\uf938\\uf3fb\\u200d\\u2642\\ufe0f|\\uf938\\uf3fc\\u200d\\u2642\\ufe0f|\\uf938\\uf3fd\\u200d\\u2642\\ufe0f|\\uf938\\uf3fe\\u200d\\u2642\\ufe0f|\\uf938\\uf3ff\\u200d\\u2642\\ufe0f|\\uf938\\uf3fb\\u200d\\u2640\\ufe0f|\\uf938\\uf3fc\\u200d\\u2640\\ufe0f|\\uf938\\uf3fd\\u200d\\u2640\\ufe0f|\\uf938\\uf3fe\\u200d\\u2640\\ufe0f|\\uf938\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fb|\\uf93d\\uf3fc|\\uf93d\\uf3fd|\\uf93d\\uf3fe|\\uf93d\\uf3ff|\\uf93d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fb|\\uf93e\\uf3fc|\\uf93e\\uf3fd|\\uf93e\\uf3fe|\\uf93e\\uf3ff|\\uf93e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf939\\uf3fb|\\uf939\\uf3fc|\\uf939\\uf3fd|\\uf939\\uf3fe|\\uf939\\uf3ff|\\uf939\\uf3fb\\u200d\\u2642\\ufe0f|\\uf939\\uf3fc\\u200d\\u2642\\ufe0f|\\uf939\\uf3fd\\u200d\\u2642\\ufe0f|\\uf939\\uf3fe\\u200d\\u2642\\ufe0f|\\uf939\\uf3ff\\u200d\\u2642\\ufe0f|\\uf939\\uf3fb\\u200d\\u2640\\ufe0f|\\uf939\\uf3fc\\u200d\\u2640\\ufe0f|\\uf939\\uf3fd\\u200d\\u2640\\ufe0f|\\uf939\\uf3fe\\u200d\\u2640\\ufe0f|\\uf939\\uf3ff\\u200d\\u2640\\ufe0f|\\uf933\\uf3fb|\\uf933\\uf3fc|\\uf933\\uf3fd|\\uf933\\uf3fe|\\uf933\\uf3ff|\\uf4aa\\uf3fb|\\uf4aa\\uf3fc|\\uf4aa\\uf3fd|\\uf4aa\\uf3fe|\\uf4aa\\uf3ff|\\uf448\\uf3fb|\\uf448\\uf3fc|\\uf448\\uf3fd|\\uf448\\uf3fe|\\uf448\\uf3ff|\\uf449\\uf3fb|\\uf449\\uf3fc|\\uf449\\uf3fd|\\uf449\\uf3fe|\\uf449\\uf3ff|\\uf446\\uf3fb|\\uf446\\uf3fc|\\uf446\\uf3fd|\\uf446\\uf3fe|\\uf446\\uf3ff|\\uf595\\uf3fb|\\uf595\\uf3fc|\\uf595\\uf3fd|\\uf595\\uf3fe|\\uf595\\uf3ff|\\uf447\\uf3fb|\\uf447\\uf3fc|\\uf447\\uf3fd|\\uf447\\uf3fe|\\uf447\\uf3ff|\\uf91e\\uf3fb|\\uf91e\\uf3fc|\\uf91e\\uf3fd|\\uf91e\\uf3fe|\\uf91e\\uf3ff|\\uf596\\uf3fb|\\uf596\\uf3fc|\\uf596\\uf3fd|\\uf596\\uf3fe|\\uf596\\uf3ff|\\uf918\\uf3fb|\\uf918\\uf3fc|\\uf918\\uf3fd|\\uf918\\uf3fe|\\uf918\\uf3ff|\\uf919\\uf3fb|\\uf919\\uf3fc|\\uf919\\uf3fd|\\uf919\\uf3fe|\\uf919\\uf3ff|\\uf590\\uf3fb|\\uf590\\uf3fc|\\uf590\\uf3fd|\\uf590\\uf3fe|\\uf590\\uf3ff|\\uf44c\\uf3fb|\\uf44c\\uf3fc|\\uf44c\\uf3fd|\\uf44c\\uf3fe|\\uf44c\\uf3ff|\\uf44d\\uf3fb|\\uf44d\\uf3fc|\\uf44d\\uf3fd|\\uf44d\\uf3fe|\\uf44d\\uf3ff|\\uf44e\\uf3fb|\\uf44e\\uf3fc|\\uf44e\\uf3fd|\\uf44e\\uf3fe|\\uf44e\\uf3ff|\\uf44a\\uf3fb|\\uf44a\\uf3fc|\\uf44a\\uf3fd|\\uf44a\\uf3fe|\\uf44a\\uf3ff|\\uf91b\\uf3fb|\\uf91b\\uf3fc|\\uf91b\\uf3fd|\\uf91b\\uf3fe|\\uf91b\\uf3ff|\\uf91c\\uf3fb|\\uf91c\\uf3fc|\\uf91c\\uf3fd|\\uf91c\\uf3fe|\\uf91c\\uf3ff|\\uf91a\\uf3fb|\\uf91a\\uf3fc|\\uf91a\\uf3fd|\\uf91a\\uf3fe|\\uf91a\\uf3ff|\\uf44b\\uf3fb|\\uf44b\\uf3fc|\\uf44b\\uf3fd|\\uf44b\\uf3fe|\\uf44b\\uf3ff|\\uf91f\\uf3fb|\\uf91f\\uf3fc|\\uf91f\\uf3fd|\\uf91f\\uf3fe|\\uf91f\\uf3ff|\\uf44f\\uf3fb|\\uf44f\\uf3fc|\\uf44f\\uf3fd|\\uf44f\\uf3fe|\\uf44f\\uf3ff|\\uf450\\uf3fb|\\uf450\\uf3fc|\\uf450\\uf3fd|\\uf450\\uf3fe|\\uf450\\uf3ff|\\uf64c\\uf3fb|\\uf64c\\uf3fc|\\uf64c\\uf3fd|\\uf64c\\uf3fe|\\uf64c\\uf3ff|\\uf932\\uf3fb|\\uf932\\uf3fc|\\uf932\\uf3fd|\\uf932\\uf3fe|\\uf932\\uf3ff|\\uf64f\\uf3fb|\\uf64f\\uf3fc|\\uf64f\\uf3fd|\\uf64f\\uf3fe|\\uf64f\\uf3ff|\\uf485\\uf3fb|\\uf485\\uf3fc|\\uf485\\uf3fd|\\uf485\\uf3fe|\\uf485\\uf3ff|\\uf442\\uf3fb|\\uf442\\uf3fc|\\uf442\\uf3fd|\\uf442\\uf3fe|\\uf442\\uf3ff|\\uf443\\uf3fb|\\uf443\\uf3fc|\\uf443\\uf3fd|\\uf443\\uf3fe|\\uf443\\uf3ff|\\uf1e6\\uf1e8|\\uf1e6\\uf1e9|\\uf1e6\\uf1ea|\\uf1e6\\uf1eb|\\uf1e6\\uf1ec|\\uf1e6\\uf1ee|\\uf1e6\\uf1f1|\\uf1e6\\uf1f2|\\uf1e6\\uf1f4|\\uf1e6\\uf1f6|\\uf1e6\\uf1f7|\\uf1e6\\uf1f8|\\uf1e6\\uf1f9|\\uf1e6\\uf1fa|\\uf1e6\\uf1fc|\\uf1e6\\uf1fd|\\uf1e6\\uf1ff|\\uf1e7\\uf1e6|\\uf1e7\\uf1e7|\\uf1e7\\uf1e9|\\uf1e7\\uf1ea|\\uf1e7\\uf1eb|\\uf1e7\\uf1ec|\\uf1e7\\uf1ed|\\uf1e7\\uf1ee|\\uf1e7\\uf1ef|\\uf1e7\\uf1f1|\\uf1e7\\uf1f2|\\uf1e7\\uf1f3|\\uf1e7\\uf1f4|\\uf1e7\\uf1f6|\\uf1e7\\uf1f7|\\uf1e7\\uf1f8|\\uf1e7\\uf1f9|\\uf1e7\\uf1fb|\\uf1e7\\uf1fc|\\uf1e7\\uf1fe|\\uf1e7\\uf1ff|\\uf1e8\\uf1e6|\\uf1e8\\uf1e8|\\uf1e8\\uf1e9|\\uf1e8\\uf1eb|\\uf1e8\\uf1ec|\\uf1e8\\uf1ed|\\uf1e8\\uf1ee|\\uf1e8\\uf1f0|\\uf1e8\\uf1f1|\\uf1e8\\uf1f2|\\uf1e8\\uf1f3|\\uf1e8\\uf1f4|\\uf1e8\\uf1f5|\\uf1e8\\uf1f7|\\uf1e8\\uf1fa|\\uf1e8\\uf1fb|\\uf1e8\\uf1fc|\\uf1e8\\uf1fd|\\uf1e8\\uf1fe|\\uf1e8\\uf1ff|\\uf1e9\\uf1ea|\\uf1e9\\uf1ec|\\uf1e9\\uf1ef|\\uf1e9\\uf1f0|\\uf1e9\\uf1f2|\\uf1e9\\uf1f4|\\uf1e9\\uf1ff|\\uf1ea\\uf1e6|\\uf1ea\\uf1e8|\\uf1ea\\uf1ea|\\uf1ea\\uf1ec|\\uf1ea\\uf1ed|\\uf1ea\\uf1f7|\\uf1ea\\uf1f8|\\uf1ea\\uf1f9|\\uf1ea\\uf1fa|\\uf1eb\\uf1ee|\\uf1eb\\uf1ef|\\uf1eb\\uf1f0|\\uf1eb\\uf1f2|\\uf1eb\\uf1f4|\\uf1eb\\uf1f7|\\uf1ec\\uf1e6|\\uf1ec\\uf1e7|\\uf1ec\\uf1e9|\\uf1ec\\uf1ea|\\uf1ec\\uf1eb|\\uf1ec\\uf1ec|\\uf1ec\\uf1ed|\\uf1ec\\uf1ee|\\uf1ec\\uf1f1|\\uf1ec\\uf1f2|\\uf1ec\\uf1f3|\\uf1ec\\uf1f5|\\uf1ec\\uf1f6|\\uf1ec\\uf1f7|\\uf1ec\\uf1f8|\\uf1ec\\uf1f9|\\uf1ec\\uf1fa|\\uf1ec\\uf1fc|\\uf1ec\\uf1fe|\\uf1ed\\uf1f0|\\uf1ed\\uf1f2|\\uf1ed\\uf1f3|\\uf1ed\\uf1f7|\\uf1ed\\uf1f9|\\uf1ed\\uf1fa|\\uf1ee\\uf1e8|\\uf1ee\\uf1e9|\\uf1ee\\uf1ea|\\uf1ee\\uf1f1|\\uf1ee\\uf1f2|\\uf1ee\\uf1f3|\\uf1ee\\uf1f4|\\uf1ee\\uf1f6|\\uf1ee\\uf1f7|\\uf1ee\\uf1f8|\\uf1ee\\uf1f9|\\uf1ef\\uf1ea|\\uf1ef\\uf1f2|\\uf1ef\\uf1f4|\\uf1ef\\uf1f5|\\uf1f0\\uf1ea|\\uf1f0\\uf1ec|\\uf1f0\\uf1ed|\\uf1f0\\uf1ee|\\uf1f0\\uf1f2|\\uf1f0\\uf1f3|\\uf1f0\\uf1f5|\\uf1f0\\uf1f7|\\uf1f0\\uf1fc|\\uf1f0\\uf1fe|\\uf1f0\\uf1ff|\\uf1f1\\uf1e6|\\uf1f1\\uf1e7|\\uf1f1\\uf1e8|\\uf1f1\\uf1ee|\\uf1f1\\uf1f0|\\uf1f1\\uf1f7|\\uf1f1\\uf1f8|\\uf1f1\\uf1f9|\\uf1f1\\uf1fa|\\uf1f1\\uf1fb|\\uf1f1\\uf1fe|\\uf1f2\\uf1e6|\\uf1f2\\uf1e8|\\uf1f2\\uf1e9|\\uf1f2\\uf1ea|\\uf1f2\\uf1eb|\\uf1f2\\uf1ec|\\uf1f2\\uf1ed|\\uf1f2\\uf1f0|\\uf1f2\\uf1f1|\\uf1f2\\uf1f2|\\uf1f2\\uf1f3|\\uf1f2\\uf1f4|\\uf1f2\\uf1f5|\\uf1f2\\uf1f6|\\uf1f2\\uf1f7|\\uf1f2\\uf1f8|\\uf1f2\\uf1f9|\\uf1f2\\uf1fa|\\uf1f2\\uf1fb|\\uf1f2\\uf1fc|\\uf1f2\\uf1fd|\\uf1f2\\uf1fe|\\uf1f2\\uf1ff|\\uf1f3\\uf1e6|\\uf1f3\\uf1e8|\\uf1f3\\uf1ea|\\uf1f3\\uf1eb|\\uf1f3\\uf1ec|\\uf1f3\\uf1ee|\\uf1f3\\uf1f1|\\uf1f3\\uf1f4|\\uf1f3\\uf1f5|\\uf1f3\\uf1f7|\\uf1f3\\uf1fa|\\uf1f3\\uf1ff|\\uf1f4\\uf1f2|\\uf1f5\\uf1e6|\\uf1f5\\uf1ea|\\uf1f5\\uf1eb|\\uf1f5\\uf1ec|\\uf1f5\\uf1ed|\\uf1f5\\uf1f0|\\uf1f5\\uf1f1|\\uf1f5\\uf1f2|\\uf1f5\\uf1f3|\\uf1f5\\uf1f7|\\uf1f5\\uf1f8|\\uf1f5\\uf1f9|\\uf1f5\\uf1fc|\\uf1f5\\uf1fe|\\uf1f6\\uf1e6|\\uf1f7\\uf1ea|\\uf1f7\\uf1f4|\\uf1f7\\uf1f8|\\uf1f7\\uf1fa|\\uf1f7\\uf1fc|\\uf1f8\\uf1e6|\\uf1f8\\uf1e7|\\uf1f8\\uf1e8|\\uf1f8\\uf1e9|\\uf1f8\\uf1ea|\\uf1f8\\uf1ec|\\uf1f8\\uf1ed|\\uf1f8\\uf1ee|\\uf1f8\\uf1ef|\\uf1f8\\uf1f0|\\uf1f8\\uf1f1|\\uf1f8\\uf1f2|\\uf1f8\\uf1f3|\\uf1f8\\uf1f4|\\uf1f8\\uf1f7|\\uf1f8\\uf1f8|\\uf1f8\\uf1f9|\\uf1f8\\uf1fb|\\uf1f8\\uf1fd|\\uf1f8\\uf1fe|\\uf1f8\\uf1ff|\\uf1f9\\uf1e6|\\uf1f9\\uf1e8|\\uf1f9\\uf1e9|\\uf1f9\\uf1eb|\\uf1f9\\uf1ec|\\uf1f9\\uf1ed|\\uf1f9\\uf1ef|\\uf1f9\\uf1f0|\\uf1f9\\uf1f1|\\uf1f9\\uf1f2|\\uf1f9\\uf1f3|\\uf1f9\\uf1f4|\\uf1f9\\uf1f7|\\uf1f9\\uf1f9|\\uf1f9\\uf1fb|\\uf1f9\\uf1fc|\\uf1f9\\uf1ff|\\uf1fa\\uf1e6|\\uf1fa\\uf1ec|\\uf1fa\\uf1f2|\\uf1fa\\uf1f3|\\uf1fa\\uf1f8|\\uf1fa\\uf1fe|\\uf1fa\\uf1ff|\\uf1fb\\uf1e6|\\uf1fb\\uf1e8|\\uf1fb\\uf1ea|\\uf1fb\\uf1ec|\\uf1fb\\uf1ee|\\uf1fb\\uf1f3|\\uf1fb\\uf1fa|\\uf1fc\\uf1eb|\\uf1fc\\uf1f8|\\uf1fd\\uf1f0|\\uf1fe\\uf1ea|\\uf1fe\\uf1f9|\\uf1ff\\uf1e6|\\uf1ff\\uf1f2|\\uf1ff\\uf1fc|\\uf004|\\uf0cf|[\\uf170-\\uf171]|[\\uf17e-\\uf17f]|\\uf18e|[\\uf191-\\uf19a]|[\\uf201-\\uf202]|\\uf21a|\\uf22f|[\\uf232-\\uf23a]|[\\uf250-\\uf251]|[\\uf300-\\uf321]|[\\uf324-\\uf393]|[\\uf396-\\uf397]|[\\uf399-\\uf39b]|[\\uf39e-\\uf3f0]|[\\uf3f3-\\uf3f5]|[\\uf3f7-\\uf3fa]|[\\uf400-\\uf4fd]|[\\uf4ff-\\uf53d]|[\\uf549-\\uf54e]|[\\uf550-\\uf567]|[\\uf56f-\\uf570]|[\\uf573-\\uf57a]|\\uf587|[\\uf58a-\\uf58d]|\\uf590|[\\uf595-\\uf596]|[\\uf5a4-\\uf5a5]|\\uf5a8|[\\uf5b1-\\uf5b2]|\\uf5bc|[\\uf5c2-\\uf5c4]|[\\uf5d1-\\uf5d3]|[\\uf5dc-\\uf5de]|\\uf5e1|\\uf5e3|\\uf5e8|\\uf5ef|\\uf5f3|[\\uf5fa-\\uf64f]|[\\uf680-\\uf6c5]|[\\uf6cb-\\uf6d2]|[\\uf6e0-\\uf6e5]|\\uf6e9|[\\uf6eb-\\uf6ec]|\\uf6f0|[\\uf6f3-\\uf6f8]|[\\uf910-\\uf93a]|[\\uf93c-\\uf93e]|[\\uf940-\\uf945]|[\\uf947-\\uf94c]|[\\uf950-\\uf96b]|[\\uf980-\\uf997]|\\uf9c0|[\\uf9d0-\\uf9e6]/g;\n\n    var formatProtocolPath = function(path) {\n        var protocol = document.location.protocol;\n        var fileFlag = 'file:';\n        var isFile = protocol === fileFlag;\n        return isFile ? 'http:' + path : path;\n    };\n\n    var isUnSupportBgSize = document.all && !document.addEventListener;\n    var normalImagePath = formatProtocolPath(\"//cdn.ronghub.com/css-sprite_bg-2.1.10.png\");\n    var hdImagePath = formatProtocolPath(\"//f2e.cn.ronghub.com/sdk/emoji-48.png\");\n    var configs = {\n        url: isUnSupportBgSize ? normalImagePath : hdImagePath,\n        size: 24,\n        lang: \"zh\",\n        reg: unicodeRegExp\n    };\n\n    var isOpenAdaptOldVersion = true;\n\n    var supportLanguage = [ \"en\" ,\"zh\" ];\n\n    /* 判断是否支持emoji的渲染 */\n    var isSupportEmoji = (function() {\n        var getTextFeature = function(text, color) {\n            try {\n                var canvas = document.createElement(\"canvas\");\n                canvas.width = 20;\n                canvas.height = 20;\n                var ctx = canvas.getContext(\"2d\");\n                ctx.textBaseline = \"top\";\n                ctx.font = \"20px sans-serif\";\n                ctx.fillStyle = color;\n                ctx.fillText(text, 0, 0);\n                var imageData = ctx.getImageData(0, 0, 20, 20).data;\n                var imageDataArr = [];\n                for (var i = 0; i < imageData.length; i++) {\n                    imageDataArr[i] = imageData[i];\n                }\n                var totalColor = 0;\n                for (var i = 0; i < imageDataArr.length; i++) {\n                    totalColor += imageDataArr[i];\n                }\n                var hasColor = totalColor > 0;\n                return hasColor ? imageDataArr.toString() : false;\n            } catch (e) {\n                return false;\n            }\n        };\n        var testEmoji = \"😁\";\n        var mode = getTextFeature(testEmoji, \"#000\");\n        if (mode) {\n            var otherEmoji = \"😨\";\n            var colorFeatrue = getTextFeature(testEmoji, \"#FFF\");\n            var otherFeature = getTextFeature(otherEmoji, \"#000\");\n            //为相同emoji添加不同色, 判断两次上色是否相同, 如果相同, 说明emoji以图片渲染, 支持\n            var isSameColor = mode && mode === colorFeatrue;\n            //为不同emoji添加相同色, 判断两次上色是否不同, 如果不同, 说明emoji以字符渲染, 支持\n            var isDiffColor = mode && mode !== otherFeature;\n            return isSameColor || isDiffColor;\n        } else {\n            return false;\n        }\n    })();\n\n\n    /*! http://mths.be/codepointat v0.1.0 by @mathias,  codePointAt兼容 */\n    if (!String.prototype.codePointAt) {\n      (function() {\n        'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\n        var codePointAt = function(position) {\n          if (this == null) {\n            throw TypeError();\n          }\n          var string = String(this);\n          var size = string.length;\n          // `ToInteger`\n          var index = position ? Number(position) : 0;\n          if (index != index) { // better `isNaN`\n            index = 0;\n          }\n          // Account for out-of-bounds indices:\n          if (index < 0 || index >= size) {\n            return undefined;\n          }\n          // Get the first code unit\n          var first = string.charCodeAt(index);\n          var second;\n          if ( // check if it’s the start of a surrogate pair\n            first >= 0xD800 && first <= 0xDBFF && // high surrogate\n            size > index + 1 // there is a next code unit\n          ) {\n            second = string.charCodeAt(index + 1);\n            if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n              // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n              return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n            }\n          }\n          return first;\n        };\n        var userAgent = navigator.userAgent;\n        var isIE8 = navigator.userAgent.indexOf(\"MSIE 8.0\") > 0;\n        if (Object.defineProperty && !isIE8) {\n          Object.defineProperty(String.prototype, 'codePointAt', {\n            'value': codePointAt,\n            'configurable': true,\n            'writable': true\n          });\n        } else {\n          String.prototype.codePointAt = codePointAt;\n        }\n      }());\n    }\n\n    /*! http://mths.be/fromcodepoint v0.1.0 by @mathias,   fromCodePoint兼容 */\n    if (!String.fromCodePoint) {\n      (function() {\n        var defineProperty = (function() {\n          // IE 8 only supports `Object.defineProperty` on DOM elements\n          try {\n            var object = {};\n            var $defineProperty = Object.defineProperty;\n            var result = $defineProperty(object, object, object) && $defineProperty;\n          } catch(error) {}\n          return result;\n        }());\n        var stringFromCharCode = String.fromCharCode;\n        var floor = Math.floor;\n        var fromCodePoint = function() {\n          var MAX_SIZE = 0x4000;\n          var codeUnits = [];\n          var highSurrogate;\n          var lowSurrogate;\n          var index = -1;\n          var length = arguments.length;\n          if (!length) {\n            return '';\n          }\n          var result = '';\n          while (++index < length) {\n            var codePoint = Number(arguments[index]);\n            if (\n              !isFinite(codePoint) ||       // `NaN`, `+Infinity`, or `-Infinity`\n              codePoint < 0 ||              // not a valid Unicode code point\n              codePoint > 0x10FFFF ||       // not a valid Unicode code point\n              floor(codePoint) != codePoint // not an integer\n            ) {\n              throw RangeError('Invalid code point: ' + codePoint);\n            }\n            if (codePoint <= 0xFFFF) { // BMP code point\n              codeUnits.push(codePoint);\n            } else { // Astral code point; split in surrogate halves\n              // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n              codePoint -= 0x10000;\n              highSurrogate = (codePoint >> 10) + 0xD800;\n              lowSurrogate = (codePoint % 0x400) + 0xDC00;\n              codeUnits.push(highSurrogate, lowSurrogate);\n            }\n            if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n              result += stringFromCharCode.apply(null, codeUnits);\n              codeUnits.length = 0;\n            }\n          }\n          return result;\n        };\n        if (defineProperty) {\n          defineProperty(String, 'fromCodePoint', {\n            'value': fromCodePoint,\n            'configurable': true,\n            'writable': true\n          });\n        } else {\n          String.fromCodePoint = fromCodePoint;\n        }\n      }());\n    }\n    \n\n    var Utils = {\n        symbolRegExp: /\\[([^\\[\\]]+?)\\]/g,\n        toEmoji: function(nativeEmoji, func) {\n            return !func ? nativeEmoji : func(nativeEmoji);\n        },\n        extend: function() {\n            if (arguments.length === 0) {\n                return;\n            }\n            var obj = arguments[0];\n            for (var i = 1, len = arguments.length; i < len; i ++) {\n                var other = arguments[i];\n                for (var item in other) {\n                    obj[item] = other[item];\n                }\n            }\n            return obj;\n        },\n        hasSame: function(moreList, list) {\n            var more = moreList.join(' ');\n            for (var i = 0; i < list.length; i++) {\n                var value = list[i];\n                if (Utils.indexOf(more, value) === -1) {\n                    return false;\n                }\n            }\n            return true;\n        },\n        getDom: function(html) {\n            var div = document.createElement(\"div\");\n            div.innerHTML = html;\n            return div.childNodes[0];\n        },\n        getSymbol: function(name) {\n            return \"[\" + name + \"]\";\n        },\n        cutString: function(string, start, length) {\n            var array = [];\n            for (var i = start; i < start + length; i++) {\n                array.push(string.charAt(i));\n            }\n            return array.join('');\n        },\n        indexOf: function(array, value) {\n            if (typeof array === \"string\") {\n                for (var i = 0; i <= array.length - value.length; i++) {\n                    var string = Utils.cutString(array, i, value.length);\n                    if (array.charAt(i) == value.charAt(0) && Utils.cutString(array, i, value.length) == value) {\n                        return i;\n                    }\n                }\n            } else if (Object.prototype.toString.call(array) === '[object Array]') {\n                for (var i = 0; i < array.length; i++) {\n                    var item = array[i];\n                    if (item == value) {\n                        return i;\n                    }\n                }\n            }\n            return -1;\n        },\n        keys: function(item) {\n            var arr = [];\n            for (var key in item) {\n                arr.push(key);\n            }\n            return arr;\n        },\n        map: function(arr, func) {\n            var tempArr = arr.concat([]);\n            for (var i = 0; i < tempArr.length; i++) {\n                var value = tempArr[i];\n                if (func && typeof func === \"function\") {\n                    tempArr[i] = func(value);\n                }\n            }\n            return tempArr;\n        },\n        filter: function(arr, func) {\n            var array = [];\n            for (var i = 0; i < arr.length; i++) {\n                var value = arr[i];\n                if (func(value)) {\n                    array.push(value);\n                }\n            }\n            return array;\n        },\n        emojiToUnicode: function(emoji) {\n            var unicodes = '';\n            for (var i = 0; i < emoji.length; i = i + 2) {\n                var point = emoji.codePointAt(i).toString(16);\n                var isEmojiSameUnicode = point.indexOf(\"1f\") !== 0;\n                var code;\n                if (isEmojiSameUnicode) {\n                    code = \"%u\" + point;\n                } else {\n                    code = point.replace(\"1f\", \"%uf\");\n                }\n                unicodes += code;\n            }\n            return unescape(unicodes);\n        },\n        newEmojisAdaptOldVersion: function(newEmojis) {\n            if (newEmojis && Utils.hasKey(newEmojis, 'dataSource')) {\n                var dataSource = newEmojis.dataSource;\n                if (dataSource && typeof dataSource === \"object\") {\n                    for (var key in dataSource) {\n                        var position = dataSource.bp || \"0px 0px\";\n                        dataSource[key].position = position;\n                    }\n                }\n                newEmojis.dataSource = dataSource;\n            }\n            return newEmojis;\n        },\n        hasKey: function(object, key) {\n            var has = false;\n            var objectType = CheckParam.getType(object);\n            if (objectType === 'object') {\n                for (var objKey in object) {\n                    if (objKey === key) {\n                        has = true;\n                    }\n                }\n            }\n            return has;\n        },\n        deleteKey: function(object, key) {\n            var newObj = {};\n            for (var objKey in object) {\n                if (objKey !== key) {\n                    newObj[objKey] = object[objKey];\n                }\n            }\n            return newObj;\n        },\n        getInitDetail: function(config) {\n            var newEmojis, opt;\n            var hasExtension = Utils.hasKey(config, \"extension\");\n            var hasDataSource = Utils.hasKey(config, \"dataSource\");\n            if (hasDataSource) {\n                newEmojis = config;\n            } else if (hasExtension) {\n                newEmojis = config.extension;\n                opt = Utils.deleteKey(config, 'extension');\n            } else {\n                opt = config;\n            }\n            return {\n                config: opt,\n                newEmojis: newEmojis\n            };\n        }\n    };\n\n    var errorDesc = \"具体信息请参考文档以及Demo示例: https://rongcloud.github.io/websdk-demo/emoji.html\";\n\n    var Logger = {\n        LogFactory: {\n            \"0\": {\n                code: 0,\n                msg: \"初始化参数错误\",\n                desc: errorDesc\n            },\n            \"1\": {\n                code: 1,\n                msg: \"Emoji参数错误\",\n                desc: errorDesc\n            },\n            \"2\": {\n                code: 2,\n                msg: \"Emoji语言设置错误\",\n                desc: errorDesc\n            },\n            \"3\": {\n                code: 3,\n                msg: \"Emoji扩展错误\",\n                desc: errorDesc\n            },\n            \"4\": {\n                code: 4,\n                msg: \"Emoji设置size错误\",\n                desc: errorDesc\n            },\n            \"5\": {\n                code: 5,\n                msg: \"Emoji设置reg错误\",\n                desc: errorDesc\n            },\n            \"6\": {\n                code: 6,\n                msg: \"Emoji设置背景url错误\",\n                desc: errorDesc\n            }\n        },\n        isShowError: true,\n        showErrorInfo: function(errorInfo) {\n            console.error(errorInfo);\n        },\n        logger: function(params) {\n            var code = params.code;\n            var logInfo = this.LogFactory[code] || params;\n            var errorInfo = JSON.stringify(logInfo);\n            errorInfo = JSON.parse(errorInfo);\n            var message = errorInfo.msg + \": \" + params.msg + \"\\n \" + errorInfo.desc;\n            this.isShowError && this.showErrorInfo(message);\n        }\n    };\n\n    var CheckParam = {\n        getType: function(str) {\n            /* IE下不准确问题 */\n            if (str === undefined) {\n                return \"undefined\";\n            }\n            if (str === null) {\n                return \"null\";\n            }\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        },\n        check: function(typeList, funcName, params) {\n            params = params || [];\n            var maxCount = typeList.length;\n            if (params.length > maxCount) {\n                params.length = maxCount;\n            }\n            for (var i = 0; i < typeList.length; i++) {\n                var paramType = this.getType(params[i]);\n                var sucType = typeList[i];\n                if (!new RegExp(paramType).test(sucType)) {\n                    var msgTemp = \"第{{index}}个参数错误, 传入参数类型为: {{errType}}, 应传参数类型为: {{sucType}}, 错误所在位置为: {{funcName}}\";\n                    var msg = msgTemp.replace(/{{index}}/g, i + 1).replace(/{{errType}}/g, paramType).replace(/{{sucType}}/g, sucType).replace(/{{funcName}}/g, funcName);\n                    Logger.logger({\n                        code: 1,\n                        funcName: funcName,\n                        msg: msg\n                    });\n                }\n            }\n        },\n        checkConfigParam: function(opt, funcName) {\n            var isValidLang = this.checkLanguage(opt.lang || configs.lang, funcName);\n            var isValidSize = this.checkOptType(opt.size || configs.size, \"number\", 4, funcName);\n            var isValidReg = this.checkOptType(opt.reg || configs.reg, \"regexp|string\", 5, funcName);\n            var isValidUrl = this.checkOptType(opt.url || configs.url, \"string\", 6, funcName);\n            return isValidLang && isValidSize && isValidReg && isValidUrl;\n        },\n        checkLanguage: function(lang, funcName) {\n            if (Utils.indexOf(supportLanguage, lang) !== -1) {\n                return true;\n            }\n            var msgTemp = \"不支持语言: {{lang}}, 支持的语言有: {{support}}\";\n            var msg = msgTemp.replace(/{{lang}}/g, lang).replace(/{{support}}/g, supportLanguage.join(', '));\n            Logger.logger({\n                code: 2,\n                msg: msg,\n                funcName: funcName\n            });\n            return false;\n        },\n        checkOptType: function(value, type, code, funcName) {\n            var valueType = this.getType(value);\n            if (!new RegExp(valueType).test(type)) {\n                var msg = \"传入参数类型为: {{errType}}, 应传参数类型为: {{sucType}}\";\n                msg = msg.replace(/{{errType}}/g, valueType).replace(/{{sucType}}/g, type);\n                Logger.logger({\n                    code: code,\n                    msg: msg,\n                    funcName: funcName\n                });\n                return false;\n            }\n            return true;\n        },\n        checkDataSource: function(dataSource, funcName) {\n            var dataParams = [ \"en\", \"zh\", \"tag\", \"position\" ];\n            for (var key in dataSource) {\n                var detail = dataSource[key];\n                if (this.getType(detail) !== \"object\") {\n                    var msg = \"dataSource.{{unicode}}必须是object类型\"\n                    msg = msg.replace(/{{unicode}}/g, key);\n                    Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                    return false;\n                }\n                var allKeys = Utils.keys(detail);\n                if (!Utils.hasSame(allKeys, dataParams)) {\n                    var msgTemp = \"dataSource.{{unicode}}必须包含属性: en, zh, tag, position\";\n                    var msg = msgTemp.replace(/{{unicode}}/g, key);\n                    Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                    return false;\n                }\n            }\n            return true;\n        },\n        checkAddEmoji: function(newEmojis, funcName) {\n            for (var key in newEmojis) {\n                if (key === \"dataSource\") {\n                    var dataSource = newEmojis[key];\n                    if (this.getType(dataSource) !== \"object\") {\n                        var msg = \"dataSource必须是object类型\";\n                        Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                        return false;\n                    } else {\n                        if (!this.checkDataSource(dataSource, funcName)) {\n                            return false;\n                        }\n                    }\n                }\n            }\n            return true;\n        },\n        checkInit: function(config, type) {\n            var objType = CheckParam.getType(config);\n            var isObject = new RegExp(objType).test(type);\n            var msg = \"config参数必须是\" + type + \"类型\";\n            !isObject && Logger.logger({\n                code: 0, msg: msg, funcName: \"init\"\n            });\n            return isObject;\n        }\n    };\n\n    var addBaseCss = function() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden;}\";\n        var style = document.createElement(\"style\");\n        style.setAttribute(\"type\", \"text/css\");\n        var head = document.getElementsByTagName('head')[0];\n        head.appendChild(style);\n        if (style.styleSheet) {\n            style.styleSheet.cssText = baseCss;\n        } else {\n            head = document.createTextNode(baseCss);\n            style.appendChild(head);\n        }\n    };\n\n\n\n    var createEmojiDom = function(item, sizePx) {\n        var position = computeBgPosition(item.position, sizePx);\n        var size = sizePx || configs.size;\n        if (document.all && !document.addEventListener) {\n            position = item.position;\n            size = configs.size;\n        }\n        var emojiObj = {\n            size: size,\n            position: position,\n            background: item.background || configs.url,\n            name: item[configs.lang],\n            tag: item.tag\n        };\n        return getEmojiShadowDom(emojiObj);\n    };\n\n    var getEmojiShadowDom = function(object) {\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px; overflow: hidden; vertical-align: middle; font-size: 0 !important;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='{{style}}'>{{tag}}</span>\"\n        spanTpl = spanTpl.replace(/{{style}}/g, style);\n        var ret = spanTpl.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n            return object[name];\n        });\n        return ret;\n    };\n\n    var computeBgPosition = function(position, sizePx) {\n        var size = sizePx || configs.size;\n        var baseSize = document.all && !document.addEventListener ? 24 : 25;\n        var scale = size / baseSize;\n        position = position.split(\" \");\n        var x = position[0], y = position[1];\n        x = x ? x.split(\"px\")[0] : 0;\n        y = y ? y.split(\"px\")[0] : 0;\n        return parseInt(x) * scale + \"px \" + parseInt(y) * scale + \"px\";\n    };\n\n    var setupEmojiDetails = function() {\n        var tags = [];\n        detailList.length = 0;\n        for (var key in emojiFactory) {\n            var detail = emojiFactory[key];\n            var lang = configs.lang;\n            var shadowDom = createEmojiDom(detail);\n            var symbol = Utils.getSymbol(detail[lang]);\n            var item = {\n                unicode: key,\n                symbol: symbol,\n                emoji: detail.tag,\n                node: Utils.getDom(shadowDom)\n            };\n            detailList.push(item);\n        }\n    };\n\n    var setupEmojiFactory = function(newEmojis) {\n        var newEmojiFactory = {};\n        if (newEmojis) {\n            var _emojiFactory = newEmojis.dataSource;\n            var _url = newEmojis.url || configs.url;\n            for (var key in _emojiFactory) {\n                _emojiFactory[key][\"background\"] = _url;\n                newEmojiFactory[key] = _emojiFactory[key];\n            }\n        }\n        emojiFactory = Utils.extend(emojiFactory, newEmojiFactory);\n    };\n\n    var calculateUTF = function (char) {\n        var unicodes = escape(char).split(\"%u\");\n        unicodes = Utils.filter(unicodes, function(code) {\n            return code !== \"\";\n        });\n        return Utils.map(unicodes, function(code) {\n            if (Utils.indexOf(code, \"f\") !== -1 || Utils.indexOf(code, \"F\") !== -1) {\n                return String.fromCodePoint(\"0x1\" + code);\n            } else {\n                return String.fromCodePoint(\"0x\" + code);\n            }\n        }).join(\"\");\n    };\n\n    var getEmojiBySymbol = function(symbol) {\n        for (var i = 0; i < detailList.length; i++) {\n            var lang = configs.lang;\n            var detail = detailList[i];\n            if(detail.symbol === symbol) {\n                return detail.emoji;\n            }\n        }\n        return symbol;\n    };\n\n    var getDomByEmoji = function(emoji, sizePx) {\n        for (var key in emojiFactory) {\n            var detail = emojiFactory[key];\n            if (detail.tag === emoji) {\n                return createEmojiDom(detail, sizePx);\n            }\n        }\n        return false;\n    };\n\n    var init = function(config) {\n        var newEmojis, opt;\n        if (CheckParam.checkInit(config, 'object|null|undefined')) {\n            var initDetail = Utils.getInitDetail(config);\n            newEmojis = initDetail.newEmojis;\n            opt = initDetail.config;\n        }\n        addEmojis(newEmojis);\n        setConfig(opt);\n        isOpenAdaptOldVersion && adaptOldVersion();\n    };\n\n    /**\n     * 自定义设置\n     * @param  {[object]} opt 可包含 lang, reg, url, size\n     */\n    var setConfig = function(opt) {\n        if (!CheckParam.checkConfigParam(opt || {}, \"init\")) {\n            return;\n        }\n        configs = Utils.extend(configs, opt);\n        setupEmojiDetails();\n    };\n\n    /**\n     * 新增自定义emoji\n     * @param {object} newEmojis 可包含dataSource和url, url表示背景图, dataSource包含自定义的unicode和所对应emoji特性\n     */\n    var addEmojis = function(newEmojis) {\n        newEmojis = Utils.newEmojisAdaptOldVersion(newEmojis);\n        if (!CheckParam.checkAddEmoji(newEmojis || {}, \"init\")) {\n            return;\n        }\n        setupEmojiFactory(newEmojis);\n        setupEmojiDetails();\n    };\n    \n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围。默认为init时设置的regExp，如果不设置，默认为/[\\uf000-\\uf700]/g\n     * @return {string}          转化后的字符串\n     */\n    var unicodeDecode = function(content, reg) {\n        reg = reg || configs.reg;\n        return content.replace(reg, function(emoji) {\n            return calculateUTF(emoji) || emoji;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg     可选，匹配的正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后的字符串\n     */\n    var emojiToSymbol = function(content, reg, func) {\n        CheckParam.check([\"string\", \"regexp|null|undefined\"], \"emojiToSymbol\", arguments);\n        content = unicodeDecode(content, reg);\n        return content.replace(emojiRegExp, function(emojiTag) {\n            var lang = configs.lang;\n            for (var emojiKey in emojiFactory) {\n                var emojiDetail = emojiFactory[emojiKey];\n                if (emojiDetail.tag == emojiTag) {\n                    var name = emojiDetail[lang];\n                    return Utils.getSymbol(name);\n                }\n            }\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} text 必填 包含symbol的字符串\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}\n     */\n    var symbolToEmoji = function(text, func) {\n        CheckParam.check([\"string\"], \"symbolToEmoji\", arguments);\n        text = unicodeDecode(text);\n        var emojiText = text.replace(Utils.symbolRegExp, function(symbol) {\n            return getEmojiBySymbol(symbol);\n        });\n        return emojiText.replace(emojiRegExp, function(emojiTag) {\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} content 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx     可选，html标签的大小\n     * @param  {string} reg     可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(content, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"emojiToHTML\", arguments);\n        content = unicodeDecode(content, reg);\n        var shadowDomContent = content.replace(emojiRegExp, function(emojiTag) {\n            var dom = getDomByEmoji(emojiTag, sizePx);\n            return dom || emojiTag;\n        });\n        return shadowDomContent.replace(emojiRegExp, function(emojiTag) {\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} text 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(text, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"symbolToHTML\", arguments);\n        var htmlText = text.replace(Utils.symbolRegExp, function(symbol) {\n            var emoji = getEmojiBySymbol(symbol);\n            var emojiDom = getDomByEmoji(emoji, sizePx);\n            return emojiDom || symbol;\n        });\n        return htmlText.replace(emojiRegExp, function(emojiTag) {\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    var context = {};\n    var adaptOldVersion = function() {\n        context.emojis = Utils.map(detailList, function(item) {\n            var unicode = item.unicode;\n            var emojiDetail = emojiFactory[unicode];\n            var zh = emojiDetail.zh;\n            var en = emojiDetail.en;\n            var position = emojiDetail.position;\n            en = en.replace(' ', '_').toLowerCase();\n            var oldVersionStyle = \"height: 24px; width: 24px; display: inline-block; font-size: 20px !important; text-align: center; vertical-align: middle;overflow: hidden; line-height: 24px;\";\n            var oldVersionBHtml = \"<b style='width: 24px; height: 24px; display: inline-block; background-image: url({{url}}); background-position: {{position}}'></b>\";\n            oldVersionBHtml = oldVersionBHtml.replace(\"{{url}}\", normalImagePath).replace(\"{{position}}\", position);\n            var oldVersionHtml = \"<span name='[{{zh}}]' class='RongIMExpression_{{en}}' style='{{style}}'>{{b}}</span>\"\n            oldVersionHtml = oldVersionHtml.replace(\"{{zh}}\", zh).replace(\"{{en}}\", en).replace(\"{{b}}\", oldVersionBHtml).replace(\"{{style}}\", oldVersionStyle);\n            var spanHTML = \"<span>\" + oldVersionHtml + \"</span>\";\n            return Utils.getDom(spanHTML);\n        });\n        context.names = (function() {\n            var names = [];\n            for (var key in emojiFactory) {\n                var value = emojiFactory[key];\n                var data = {};\n                for (var i = 0; i < supportLanguage.length; i++) {\n                    var lang = supportLanguage[i];\n                    data[lang] = value[lang];\n                }\n                names.push(data);\n            }\n            return names;\n        })();\n        context.data = Utils.map(detailList, function(item) {\n            var data;\n            for (var key in emojiFactory) {\n                var detail = emojiFactory[key];\n                if (detail.tag === item.emoji) {\n                    data = detail;\n                    detail.html = item.node;\n                }\n            }\n            return data;\n        });\n    };\n\n    (function start() {\n        addBaseCss();\n        setupEmojiDetails();\n        isOpenAdaptOldVersion && adaptOldVersion();\n    })();\n\n    return (function() {\n        return Utils.extend(context, {\n            isSupportEmoji: isSupportEmoji,\n\n            init: init,\n\n            list: detailList,\n            emojiToSymbol: emojiToSymbol,\n            symbolToEmoji: symbolToEmoji,\n            emojiToHTML: emojiToHTML,\n            symbolToHTML: symbolToHTML,\n\n            adaptOldVersion: adaptOldVersion\n        })\n    })();\n});\n"
  },
  {
    "path": "cs/jx/cs.css",
    "content": ".rongcloud-container *,.rongcloud-container *:before,.rongcloud-container *:after {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n    margin: 0;\n    padding: 0;\n    border: 0\n}\n.rongcloud-container * {\n    padding: 0;\n    margin: 0;\n    font-size: 14px;\n    font-weight: 400;\n}\n\n.rongcloud-container a {\n    text-decoration: none;\n    outline: 0;\n}\n\n.rongcloud-container img {\n    border: none;\n    vertical-align: middle;\n}\n\n.rongcloud-container textarea {\n    overflow: auto\n}\n\n.rongcloud-clearfix {\n    *zoom:1}\n\n.rongcloud-clearfix:after {\n    display: table;\n    line-height: 0;\n    content: \"\";\n    clear: both\n}\n.rongcloud-pull-left{\n    float: left!important;\n}\n.rongcloud-pull-right{\n    float: right!important;\n}\n.rongcloud-sprite{\n    background: url(\"//cdn.ronghub.com/customerservice-icon.png\") 0 0/50px auto no-repeat;\n    display: inline-block;\n    z-index: 1;\n}\n/*.rongcloud-sprite-kefu{\n    background: url(\"images/kefuicon.png\") 0 0/50px auto no-repeat;\n    background-size: 20px 20px;\n    margin-right: 4px;\n}*/\n.rongcloud-blueBg{\n    background: url(//cdn.ronghub.com/customerservice-web-bg.png) 0 0/10px auto repeat;\n}\n/*.rongcloud-kefuListBox{\n    width: 194px;\n    height: 470px;\n    position: fixed;\n    right: 520px;\n    bottom: 100px;\n    z-index: 999;\n    box-shadow: 1px 1px #f9fafb;\n    background-color: white;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n    border-radius: 5px;\n}*/\n#zhichiBtnBox .rongcloud-people{\n    background-position: 0 -411px;\n    width: 26px;\n    height: 32px;\n}\n#zhichiBtnBox .rongcloud-kefuBtn .rongcloud-arrow-up{\n    margin-left: 0;\n}\n\n.rongcloud-kefuListBox .rongcloud-kefuList{\n    /*border: 1px solid #cdd7db;*/\n    /*border-bottom: none;*/\n    /*border-radius: 5px 5px 0px 0px;*/\n    overflow: hidden;\n    /*height: 100%;*/\n    box-sizing: border-box;\n    position: absolute;\n    border-radius: 4px;\n\n    width: 194px;\n    height: 470px;\n    position: fixed;\n    right: 520px;\n    bottom: 100px;\n    z-index: 999;\n    box-shadow: 1px 1px #f9fafb;\n    background-color: white;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-rong-header{\n    height: 36px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-toolBar{\n    text-align: center;\n    padding-top: 8px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-people {\n     vertical-align: middle;\n     margin-right: 10px;\n     width: 20px;\n     border: none;\n     height: 20px;\n     background-size: 45px auto;\n}\n\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-arrow-down{\n    background-position: 0 -65px;\n    vertical-align: middle;\n    width: 24px;\n    border: none;\n    height: 24px;\n    margin-left: 10px;\n    margin-right: -5px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-recent{\n    color: #fff;\n    font-size: 14px;\n    margin: 0;\n    padding: 0;\n    cursor:default;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-count{\n    color: #d0d4d7;\n    font-size: 12px;\n    margin: 0;\n    padding: 0;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content{\n    position: absolute;\n    top:36px;\n    bottom: 0px;\n    left: 0px;\n    right: 0px;\n    overflow-x: hidden;\n    overflow-y: auto;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus{\n    height: 40px;\n    padding-left: 18px;\n    background-color: #ffafaf;\n    line-height: 40px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online{\n    background-color: #d3f8d6;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus .rongcloud-sprite{\n    width: 20px;\n    height: 22px;\n    vertical-align: middle;\n    background-position: 0 -139px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online .rongcloud-sprite{\n    background-position: 0 -100px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus span{\n    font-size: 14px;\n    color: #fff;\n    vertical-align: middle;\n    padding-left: 2px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online span{\n    color: #868686;\n}\n\n\n\n\n\n\n\n\n\n\n\n.rongcloud-kefuChat{\n    width:470px;\n    height:470px;\n    border-radius: 5px 5px 5px 5px;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header{\n    height: 36px;\n    border-radius: 4px 4px 0px 0px;\n    position: relative;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-infoBar{\n    height: 36px;\n    line-height: 36px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-infoBarTit{\n    position: relative;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-Presence{\n    border-radius: 50%;\n    width: 8px;\n    height: 8px;\n    top: 14px;\n    left: 16px;\n    border: 0;\n}\n.rongcloud-kefuChat .rongcloud-rong-header.rongcloud-online .rongcloud-Presence{\n    background-color: #20e600;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-kefuName{\n    color: #fff;\n    padding-left: 16px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar{\n    margin-right: 10px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar a{\n    width: 20px;\n    height: 20px;\n    margin-top: 9px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxHide{\n    background-position: 0 -460px;\n    cursor: pointer;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxMin{\n    background-position: 0 -252px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxMax{\n    background-position: 0 -213px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxClose{\n    background-position: 0 -291px;\n    cursor: pointer;\n}\n.rcs-message-box {\n    width: 100%;\n    overflow: auto;\n    padding: 8px 16px;\n    position: absolute;\n    top:36px;\n    bottom: 114px;\n    background-color: white;\n    -webkit-overflow-scrolling:touch;\n}\n\n.rongcloud-kefuChat .rongcloud-outlineBox {\n    height: 40px;\n    padding-left: 18px;\n    background-color: #ffafaf;\n    line-height: 40px;\n\n    position: absolute;\n    top: 36px;\n    z-index: 10;\n    right: 0px;\n    left: 0px;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox .rongcloud-sprite {\n    width: 20px;\n    height: 22px;\n    vertical-align: middle;\n    background-position: 0 -139px;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox span {\n    font-size: 14px;\n    color: #fff;\n    vertical-align: middle;\n    padding-left: 2px;\n}\n\n.rongcloud-Messages-date {\n    text-align: center;\n    padding: 10px 20px;\n    /*border-bottom: 1px solid #e4e7ea;*/\n    margin-bottom: 30px;\n    height: 10px;\n}\n\n.rongcloud-Messages-date b {\n    font-size: 9pt;\n    font-weight: normal;\n    color: #8e969f;\n    background-color: #f9fbfd;\n    display: inline-block;\n    padding: 0 20px;\n    cursor:default;\n}\n.rongcloud-Messages-history {\n    text-align: center;\n    padding: 10px 20px;\n    /*border-bottom: 1px solid #e4e7ea;*/\n    margin-bottom: 30px;\n    height: 10px;\n}\n\n.rongcloud-Messages-history b {\n    font-size: 9pt;\n    font-weight: normal;\n    color: #8e969f;\n    background-color: #f9fbfd;\n    display: inline-block;\n    padding: 0 20px;\n    cursor:pointer;\n}\n.rongcloud-Messages-history b:hover{\n  color: #0099ff;\n}\n\n\n.rongcloud-Message-wrapper > div:last-child {\n    padding-bottom: 10px;\n}\n\n.rongcloud-Message {\n    position: relative;\n    padding-left: 3pc;\n    word-wrap: break-word;\n    word-break: break-all;\n    border-spacing: 1px;\n    margin-bottom: 20px;\n}\n.rongcloud-Message-send.rongcloud-Message{\n    padding-left: 0;\n    padding-right: 3pc;\n}\n\n.rongcloud-Message-header {\n    margin-top: 15px;;\n}\n.rongcloud-Message-send .rongcloud-Message-header{\n    display: table;\n    width: 100%;\n}\n\n.rongcloud-avatar {\n    width: 34px;\n    height: 34px;\n    border-radius: 50%;\n}\n\n.rongcloud-Message img {\n    max-width: 230px;\n    max-height: 250px;\n}\n\n.rongcloud-Message-avatar {\n    position: absolute;\n    margin-left: -3pc;\n    width: 34px;\n    height: 34px;\n}\n.rongcloud-Message-send .rongcloud-Message-avatar {\n    position: absolute;\n    right: 0;\n}\n\n.rongcloud-Message-author {\n    display: inline-block;\n    position: relative;\n    padding-right: 30px;\n}\n.rongcloud-Message-send .rongcloud-Message-author{\n    float: right;\n    padding-right: 0px;\n}\n\n.rongcloud-Message-author .rongcloud-author, .rongcloud-Message-author .rongcloud-time {\n    display: block;\n    float: left;\n    line-height: 1pc;\n}\n\n.rongcloud-Message-author > .rongcloud-author {\n    color: #8e969f;\n    text-decoration: none !important;\n    cursor: default;\n}\n\n.rongcloud-Message-author > .rongcloud-time {\n    color: #8e969f;\n    font-size: 9pt;\n    margin-left: 9pt;\n}\n\n.rongcloud-Message-body {\n    position: relative;\n    /*margin-right: 70px;*/\n    font-size: 14px;\n    line-height: 18px;\n    color: #444;\n}\n.rongcloud-Message-send .rongcloud-Message-body{\n    float: right;\n}\n\n.rongcloud-Message-text, .rongcloud-file-text {\n    position: relative;\n    display: inline-block;\n    max-width: 100%;\n}\n\n.rongcloud-Message-text pre {\n    font-size: 14px;\n    line-height: 18px;\n    color: rgb(68, 68, 68);;\n    word-break: break-all;\n    word-wrap: break-word;\n\n    white-space: pre-wrap;\n\n    background-color: transparent;\n    border: none;\n    border-radius: 0;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n}\n\n.rongcloud-Message-entry {\n    display: inline-block;\n    max-width: 100%;\n}\n\n.rongcloud-Message-entry p {\n    margin-bottom: 5px;\n}\n\n.rongcloud-Message-entry a {\n    text-decoration: none;\n}\n\n.rongcloud-Message-img img {\n    border-radius: 5px;\n}\n\n/*音频消息*/\n.rongcloud-Message-audio .rongcloud-Message-entry{\n    overflow:hidden;\n}\n.rongcloud-Message-audio .rongcloud-audioBox{\n    float: left;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox{\n    float: right;\n}\n.rongcloud-Message-audio .rongcloud-audioBox {\n    display: inline-block;\n    cursor: pointer;\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) 0 0/170px auto no-repeat;\n    width: 165px;\n    height: 36px;\n    padding: 3px 0 3px 15px;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i{\n    float: left;\n    display: inline-block;\n    width: 4px;\n    height: 26px;\n    opacity: 1;\n    -webkit-transition: all 1s ease;\n    -moz-transition: all 1s ease;\n    -ms-transition: all 1s ease;\n    -o-transition: all 1s ease;\n    transition: all 1s ease;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox {\n    display: inline-block;\n    cursor: pointer;\n    background: url(./images/audioRBG.png) 0 0/165px auto no-repeat;\n    width: 165px;\n    height: 36px;\n    padding: 3px 15px 3px 0px;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i{\n    float: right;\n    display: inline-block;\n    width: 4px;\n    height: 26px;\n    opacity: 1;\n    -webkit-transition: all 1s ease;\n    -moz-transition: all 1s ease;\n    -ms-transition: all 1s ease;\n    -o-transition: all 1s ease;\n    transition: all 1s ease;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(1){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) 0px -40px/170px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(2){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) -7px -40px/170px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(3){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) -14px -40px/170px auto no-repeat;\n}\n\n.rongcloud-Message-audio .rongcloud-audioBox.rongcloud-animate i:nth-child(2){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-audioBox.rongcloud-animate i:nth-child(3){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(1){\n    background: url(./images/audioRBG.png) -161px -40px/165px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(2){\n    background: url(./images/audioRBG.png) -154px -40px/165px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(3){\n    background: url(./images/audioRBG.png) -147px -40px/165px auto no-repeat;\n}\n\n.rongcloud-Message-audio .rongcloud-r-audioBox.rongcloud-animate i:nth-child(2){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox.rongcloud-animate i:nth-child(3){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n@keyframes audioAnimate\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-moz-keyframes audioAnimate /* Firefox */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-webkit-keyframes audioAnimate /* Safari 和 Chrome */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-o-keyframes audioAnimate /* Opera */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n.rongcloud-Message-audio .rongcloud-audioTimer{\n    margin-top: 5px;\n    margin-left: 10px;\n    color: #8e969f;\n}\n.rongcloud-Message-audio .rongcloud-audioState{\n    width: 10px;\n    height: 10px;\n    display: inline-block;\n    background-color: #ff7373;\n    margin-top: 13px;\n    border-radius: 5px;\n}\n\n.rongcloud-sys-tips{\n    text-align: center;\n    padding: 10px 0;\n    margin-top: 10px;\n}\n.rongcloud-sys-tips>span{\n    padding:7px 10px;\n    background: #e7ecf2;\n    border-radius: 3px;\n    font-size: 12px;\n    color: #8e969f;\n    line-height: 32px;\n}\n.rongcloud-sys-tips a{\n    font-size: 12px;\n}\n.rongcloud-rong-footer {\n    background: #fff;\n    height: 114px;\n    position: absolute;\n    bottom: 0px;\n    left:0px;\n    right: 0px;\n    border-radius: 0px 0px 5px 5px;\n    /*border: 1px solid #cdd7db;\n    border-top: none;*/\n}\n\n.rongcloud-footer-con {\n    border-top: 1px solid #cdd7db;\n}\n.rongcloud-text-layout {\n    margin: 0 10px;\n}\n.rongcloud-funcPanel {\n    line-height: 22px;\n    height: 22px;\n    position: relative;\n    margin-top: 5px;\n}\n.rongcloud-funcPanel .rongcloud-mode1{\n    float: left;\n\n}\n.rongcloud-funcPanel .rongcloud-mode2{\n    float: right;\n    cursor: pointer;\n    display: none;\n}\n.rongcloud-funcPanel .rongcloud-mode2 a{\n    color: #0099ff;\n    font-size: 12px;\n}\n.rongcloud-robotMode {\n    display: block;\n}\n.rongcloud-text {\n    width: 100%;\n    display: inline-block;\n    height: 80px;\n    padding: 5px;\n    border: 0;\n    color: #999;\n    color: black;\n    resize: none;\n    font-size: 9pt;\n    overflow: auto;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n}\n.rongcloud-text:focus {\n    outline: 0;\n}\n.rongcloud-powBox {\n    position: absolute;\n    right: 0px;\n    /*width: 100%;*/\n    height: 24px;\n}\n.rongcloud-rong-send-btn {\n    position: absolute;\n    top:55px;\n    right: 10px;\n    bottom: 0;\n    margin: 0;\n    padding: 0;\n    cursor: pointer;\n    border: none;\n    width: 60px;\n    height: 24px;\n    line-height: 24px;\n    border-radius: 40px;\n    font-size: 9pt;\n    color: rgb(255, 255, 255);\n    background: #0099ff;\n    outline:0;\n}\n.rongcloud-MessageForm-tool {\n    position: relative;\n    margin-right: 8px;\n    float: left;\n    overflow: hidden;\n}\n.rongcloud-MessageForm-tool input[type=\"file\"] {\n    position: absolute;\n    font-size: 100px;\n    right: 0;\n    top: 0;\n    cursor: pointer;\n    opacity: 0;\n}\n.rongcloud-MessageForm-tool i {\n    width: 20px;\n    height: 20px;\n    line-height: 20px;\n    cursor: pointer;\n    display: inline-block;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-smile {\n    background-size: 45px;\n    background-position: 0 -297px;\n}\n.rongcloud-expressionWrap {\n    border: 1px solid #D9DADC;\n    width: 290px;\n    padding: 5px 8px;\n    position: absolute;\n    left: -2px;\n    top: -198px;\n    height: 180px;\n    background: #fff;\n    z-index: 1100;\n    overflow: auto;\n    -webkit-tap-highlight-color: rgba(0,0,0,0);\n    -webkit-user-select:none;\n    -moz-user-select:none;\n    -ms-user-select:none;\n    user-select:none;\n}\n.rongcloud-expressionContent{\n    width: 100%;\n}\n.rongcloud-expressionContent div{\n    cursor: pointer;\n    margin: 0 2px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-upload {\n    width: 24px;\n    background-size: 45px;\n    background-position: 0 -333px;\n}\n.rongcloud-expressionWrap .rongcloud-arrow {\n    position: absolute;\n    left: 5px;\n    bottom: -9px;\n    display: inline-block;\n    width: 10px;\n    height: 9px;\n    background: url(//cdn.ronghub.com/customerservice-icon.png);\n    background-position: 0 -1476px;\n}\n\n/* 客服评价 */\n.rongcloud-layermbox {\n    /*position: relative;*/\n    position: initial;\n    height: 100%;\n    z-index: 19891014;\n}\n.rongcloud-layermmain {\n    display: table;\n    pointer-events: none;\n}\n.rongcloud-laymshade, .rongcloud-layermmain {\n    position: absolute;\n    left: 0;\n    top: 0;\n    width: 100%;\n    height: 100%;\n    z-index: 1200;\n}\n.rongcloud-laymshade {\n    background-color: rgba(0,0,0, .5);\n    pointer-events: auto;\n}\n.rongcloud-layermmain .rongcloud-section {\n    display: table-cell;\n    vertical-align: middle;\n    text-align: center;\n}\n.rongcloud-layermchild {\n    position: relative;\n    display: inline-block;\n    text-align: left;\n    background-color: #fff;\n    font-size: 14px;\n    border-radius: 3px;\n    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);\n    pointer-events: auto;\n    /*max-width: 250px;*/\n}\n.rongcloud-layermchild h3{\n    text-overflow: ellipsis;\n    overflow: hidden;\n    white-space: nowrap;\n}\n.rongcloud-layermcont{\n    padding: 20px 20px 10px;\n    text-align: center;\n}\n.rongcloud-layermbox .rongcloud-rong-btn{\n    display: inline-block;\n    width: 54px;\n    height: 30px;\n    line-height: 30px;\n    border: 1px solid #c4c4c4;\n    border-radius: 3px;\n    color: #000;\n    overflow: hidden;\n}\n.rongcloud-layermbox .rongcloud-rong-btn:hover{\n    background-color: #0099ff;\n    color: #fff;\n    border-color: #0099ff;\n}\n\n\n\n\n.rongcloud-layermbox .rongcloud-feedback{\n    background-color: rgba(0,0,0,.6);\n    color: #fff;\n    border: none;\n}\n.rongcloud-layermbox .rongcloud-feedback .rongcloud-layermcont{\n    padding: 15px;\n    font-size: 16px;\n}\n\n.cursor-pointer{\n    cursor: pointer;\n}\n/* 图片预览 */\n.rebox{\n    z-index: 999999;\n    position: fixed;\n    width: 100%;\n    height: 100%;\n    top: 0;\n    left: 0;\n    z-index: 1000;\n    background: rgba(0, 0, 0, 0.7);\n}\n.rebox-contents{\n    position: absolute;\n    top: 5%;\n    left: 5%;\n    text-align: center;\n    width: 90%;\n    height: 90%;\n}\n.rebox-contents .rebox-content {\n    border: none!important;\n    box-shadow: 0 0 8px #222!important;\n    cursor: pointer;\n    border: 5px solid #fff;\n    background-color: #fff;\n    border-radius: 1px;\n    max-width: 100%;\n    max-height: 100%; \n    margin: auto;\n    position: absolute;\n    bottom: 0;\n    top: 0;\n    left: 0; \n    right: 0;\n}\n.rebox-close {\n    right: 10px;\n    top: 10px;\n}\n.rebox-button {\n    position: absolute;\n    z-index: 9999;\n    min-width: 40px;\n    height: 40px;\n    line-height: 40px;\n    background: rgb(0, 0, 0);\n    opacity: 0.4;\n    text-decoration: none;\n    font-size: 24px;\n    color: #fff;\n    text-align: center;\n    vertical-align: middle;\n    -webkit-border-radius: 32px;\n    -moz-border-radius: 32px;\n    -ms-border-radius: 32px;\n    border-radius: 32px;\n    -webkit-transition: all 0.3s;\n    -moz-transition: all 0.3s;\n    -ms-transition: all 0.3s;\n    transition: all 0.3s;\n}\n.rebox-button:hover {\n    opacity: 1;\n    -webkit-transform: scale(1.4);\n    -moz-transform: scale(1.4);\n    -ms-transform: scale(1.4);\n    transform: scale(1.4);\n}\n\n/* 小能客服 */\n.rongcloud-layer-title {\n    padding: 5px;\n    text-align: center;\n}\n.rongcloud-evaluate .rongcloud-layer-body label {\n    line-height: 2.3;\n    margin-right: 20px;\n    color: #808586;\n}\n.rongcloud-evaluate .rongcloud-layer-body input {\n    margin-right: 5px;\n    vertical-align: middle;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n}\n.rongcloud-suggest {\n    resize: none;\n    padding: 5px;\n    width: 100%;\n    height: 70px;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n}\n.rongcloud-layer-body .rongcloud-form-item label {\n    width: 52px;\n    display: inline-block;\n    vertical-align: top;\n    text-align: right;\n    white-space: nowrap;\n}\n.rongcloud-layer-body .rongcloud-form-item textarea,input[type=text] {\n    width: 200px;\n}\n.rongcloud-layer-body .rongcloud-form-item textarea {\n    padding: 5px;\n    max-width: 200px;\n    max-height: 160px; \n    resize:none;\n}\n.rongcloud-require:before {\n    content:\"* \";\n    color:#f26868;\n    font-weight:bold;\n}\n\n.rongcloud-evaluate {\n    width: 266px;\n    padding-top: 15px;\n}\n.rongcloud-evaluate .rongcloud-layer-body{\n    padding: 20px 15px 30px;\n    -webkit-tap-highlight-color: rgba(0,0,0,0);\n    -webkit-user-select:none;\n    -moz-user-select:none;\n    -ms-user-select:none;\n    user-select:none;\n}\n.rongcloud.group-title{\n    margin-bottom: 10px;\n}\n.rongcloud-leaveword {\n    width: 300px;\n}\n.rongcloud-foot {\n    text-align: center;\n    padding-bottom: 10px;\n}\n.rongcloud-layer-submit {\n    padding: 5px;\n    width: 100px;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n    background-color: white;\n    outline:none;\n}\n.rongcloud-layer-submit:hover {\n    background-color: #EEE;\n}\n\n.rongcloud-layer-close {\n    position: absolute;\n    font-size: 16px;\n    top: 5px;\n    right: 5px;\n    padding: 6px;\n    line-height: 16px;\n    cursor: pointer;\n}\n.rongcloud-Message-file {\n    position: relative;\n    width: 270px;\n    overflow: hidden;\n    border: 1px solid #b9c1ca;\n    border-radius: 3px;\n}\n.rongcloud-file-icon {\n    float: left;\n    width: 52px;\n    height: 52px;\n    margin: 8px;\n    display: inline-block;\n    border-radius: 5px;\n    background-size: 45px;\n    background-position: 3px -541px;\n    background-color: #3ea9ff;\n}\n.rongcloud-file-name {\n    width: 155px;\n    margin-top: 8px;\n    margin-bottom: 4px;\n    overflow:hidden;\n    text-overflow:ellipsis;\n    white-space:nowrap;\n}\n.rongcloud-file-size {\n    font-size: 12px;\n}\n.rongcloud-file-download {\n    position: absolute;\n    right: 10px;\n    top: 15px;\n    display: inline-block;\n    width: 30px;\n    height: 30px;\n    background-size: 45px;\n    background-position: 0 -611px;\n}\n\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-file {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -443px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-download {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -476px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-evaluate {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -504px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-evaluate[disabled] {\n    background-position: -23px -504px;\n    cursor: default;\n}\n.rongcloud-endconversation {\n    width: 270px;\n    height: 135px;\n    padding: 22px;\n}\n.rongcloud-endconversation .rongcloud-prompt {\n    margin-top: 10px;\n}\n.rongcloud-endconversation .rongcloud-buttons {\n    margin-top: 30px;\n    text-align: center;\n}\n.rongcloud-buttons button+button {\n    margin-left: 50px;\n}\n.rongcloud-button {\n    width: 77px;\n    height: 30px;\n    line-height: 30px;\n    border: 1px solid #D8D8D8;\n    border-radius: 4px;\n    background-color: white;\n    outline:none;\n}\n.rongcloud-button:hover{\n    border-color: #53B4FF;\n    color:#53B4FF;\n}\n.rongcloud-leavemessage {\n    position: absolute;\n    top: 36px;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    background-color: white;\n}\n\n.rongcloud-leavemessage-title {\n    padding: 20px 40px 25px;\n    width: 310px;\n}\n.rongcloud-form-item {\n    margin: 0 40px 25px;\n    font-size: 14px;\n}\n.rongcloud-form-item label {\n    display: inline-block;\n    margin-right: 10px;\n}\n.rongcloud-leavemessage .rongcloud-form-item label {\n    width: 70px;\n    text-align: right;\n}\n.rongcloud-form-error {\n    color: #f26868;\n    margin: 2px 0 -19px 85px;\n    font-size: 13px;\n}\n.rongcloud-form-item textarea {\n    vertical-align: top;\n    width: 270px;\n    height: 120px;\n    padding: 4px;\n    border: 1px solid #cccccc;\n    border-radius: 4px;\n    resize: none;\n}\n.rongcloud-form-item .rongcloud-inputtext{\n    width: 270px;\n    height: 26px;\n    box-shadow: rgba(0, 0, 0, 0.07451) 0px 1px 1px inset;\n    padding: 4px;\n    border: 1px solid #cccccc;\n    border-radius: 4px;\n    outline: none;\n}\n.rongcloud-form-item .rongcloud-form-label{\n    line-height: 26px;\n}\n.rongcloud-leavemessage-form-btns{\n    text-align: center;\n}\n.rongcloud-btn {\n    width: 150px;\n    height: 30px;\n\n    line-height: 30px;\n    color: white;\n    outline: none;\n    background-color: #0099FF;\n    border-radius: 4px;\n    cursor: pointer;\n}\n/*收集用户信息*/\n.rongcloud-collectuserinfo-title{\n    padding: 30px 20px 15px\n}\n.rongcloud-collectuserinfo .rongcloud-form-item{\n    margin: 0 20px 25px;\n}\n.rongcloud-collectuserinfo .rongcloud-form-item .rongcloud-inputtext{\n    width: 200px;\n}\n.rongcloud-collectuserinfo .rongcloud-form-error{\n    margin: 2px 0 -19px 65px;\n}\n.rongcloud-consult {\n  position: fixed;\n  right: 50px;\n  bottom: 10px;\n  width: 195px;\n  text-align: center;\n}\n.rongcloud-consult button {\n  display: block;\n  width: 195px;\n  margin-bottom: 17px;\n  background: #0096f9;\n  border: 0;\n  padding: 0;\n  color: #fff;\n  font-family: 'Microsoft Yahei';\n  font-size: 16px;\n  cursor: pointer;\n}\n.rongcloud-consult button[disabled] {\n  background-color: #EEEEEE;\n  cursor: default;\n}\n.rongcloud-consult span {\n  display: inline-block;\n  padding-left: 43px;\n  line-height: 50px;\n  background: url(//cdn.ronghub.com/customerservice-icon.png) no-repeat 0 -358px;\n  background-size: 45px;\n}\n\n.rong-conversation{\n    font-size:12px;\n    line-height:20px;\n    color:#333;\n    min-height:40px;\n    padding:5px;\n    border-bottom:1px dotted #f5f5f5;\n    cursor:pointer;\n}\n\n.rong-conversation img {\n    width:40px;\n    height:40px;\n    position:absolute;\n}\n.rong-conversation-name,\n.rong-conversation-message{\n    margin-left:45px;\n}\n.rong-conversation-name{\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    width: 140px;\n    display: inline-block;\n}\n\n.rcs-chat-wrapper{\n    position:fixed;\n    bottom: 100px;\n    right: 48px;\n    width: 470px;\n    height: 470px;\n}\n\n.leavemessageHref{\n    cursor: pointer;\n    color: #00A3FF;\n}\n.leavemessageHref:hover{\n    text-decoration: underline;\n}\n\n.rong-link-site, .rong-link-email{\n    color: #008af3;\n}\n.rong-link-site:hover ,.rong-link-email:hover{\n    text-decoration: underline;\n}\n\n.satisfaction-star{\n    display: inline-block;\n    width: 35px;\n    height: 30px;\n    margin-left: 7px;\n    background-image: url(\"./images/star.png\");\n    background-repeat: no-repeat;\n    background-size: 30px;\n    cursor: pointer;\n}\n.satisfaction-star-selected{\n    background-position-y: -30px;\n}\n.rongcloud-evaluate-btn{\n    width: 50%;\n    height: 50px;\n    color: #0099ff;\n    text-align: center;\n    line-height: 50px;\n    background-color: #fff;\n    box-sizing: border-box;\n    cursor: pointer;\n    outline: none;\n}\n.rongcloud-evaluate-btn:active{\n    background-color: #ddd;\n}\n.rongcloud-evaluate-btn:nth-child(1){\n    border-right: 1px solid #c6c6c6;\n    border-bottom-left-radius: 3px;\n}\n.rongcloud-evaluate-btn:nth-child(2){\n    border-bottom-right-radius: 3px;\n}\n.rongcloud-evaluate .rongcloud-foot{\n    padding-bottom: 0px;\n    border-top: 1px solid #c6c6c6;\n}\n.rongcloud-footer-input{\n    height: 80px;\n    padding-right: 80px;\n}\n.rongcloud-footer-textarea{\n    height: 100%;\n}\n\n.rongcloud-phone-infoBar{\n    text-align: center;\n    line-height: 36px;\n    color: #fff;\n}\n.rongcloud-phone-exit{\n    display: inline-block;\n    position: absolute;\n    left: 5px;\n    top: 5px;\n    width: 26px;\n    height: 26px;\n    background-image: url(\"./images/back.png\");\n    background-size: 25px;\n    background-repeat: no-repeat;\n}\n.rongcloud-phone-exit:active{\n    color: #c6c6c6;\n}\n.emojiItem{\n    display: inline-block;\n}\n\n@media screen and (max-width: 600px) {\n    .rcs-chat-wrapper{\n        top: 0;\n    \tleft: 0;\n    \twidth: 100%;\n    \theight: 100%;\n    }\n    .rongcloud-kefuChat{\n    \twidth: 100%;\n    \theight:100%;\n    }\n    .rongcloud-kefuChat .rongcloud-rong-header{\n        border-radius: 0px;\n    }\n    .rcs-message-box{\n        bottom: 65px;\n    }\n    .rongcloud-rong-footer{\n        height: 65px;\n    }\n    .rongcloud-footer-input{\n        height: 35px;\n    }\n    .rongcloud-rong-send-btn{\n        top: 35px;\n    }\n    .rongcloud-text{\n        height: 35px;\n    }\n}"
  },
  {
    "path": "cs/jx/cs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no\">\n<title>CS</title>\n</head>\n<body>\n\n<div id=\"rcs-app\"></div>\n\n<link rel=\"stylesheet\" href=\"cs.css?5\">\n\n<script src=\"./RongIMLib-cs.min.js\"></script>\n<script src=\"./RongIMemoji.js\"></script>\n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n\n<script src=\"utils.js\"></script>\n<script src=\"qiniu-upload.js\"></script>\n\n<script src=\"template.js\"></script>\n<script src=\"emoji.js\"></script>\n<script src=\"phiz.js\"></script>\n<script src=\"cs.js\"></script>\n\n<!-- 实例化 -->\n<script>\n\nRCS.init({\n    appKey: \"c9kqb3rdkbb8j\",\n    token: \"EiFGNTHsjHoqFIGMw0i+fTVgZOtrWuESz8LGXFTVIuFwBdLHjemfRLzTJV3cATKarp3q8R5dDnSak2GABioMEw==\",\n    target: document.getElementById('rcs-app'),\n    customerServiceId: \"service\", // 客服Id\n    upload: {\n        fileServer: \"http://upload.qiniu.com\",// 文件服务器地址\n        isPrivate: false // 是否是私有云\n    },\n    userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像，在用户没有头像的时候显示\n    csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像，在客服没有头像的时候显示,建议线上地址\n    showButton: true,\n    //是否需要按钮主动发起，设为false的时候，init()方法直接唤起聊天窗口,需客户自己编写按钮，点击之后调用init(),templates中的button模板不可用;设为true的时候，init()首先唤起客服咨询按钮，点击之后才连接客服，唤起聊天窗口，在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token，在获取到token之后，执行init()即可。\n    connectingCallback: function(){\n        console.log('连接中');\n    },//连接中的执行的方法，例如显示加载页面,可不传\n    connectedCallback: function(){},//连接成功之后的方法，例如关闭加载页面,可不传\n    disconnectedCallback: function(){\n        alert('连接断开');\n    },//断开连接之后的操作,可不传\n    templates: {\n        button: ['<div class=\"rongcloud-consult\">',\n                '   <button onclick=\"RCS.showCommon()\"><span>客服咨询</span></button>',\n                '</div>',\n                '<div class=\"customer-service\" style=\"display: none;\"></div>'].join('')//\"templates/button.html\",\n        // chat: \"templates/chat.html\",\n        // closebefore: 'templates/closebefore.html',\n        // conversation: 'templates/conversation.html',\n        // endconversation: 'templates/endconversation.html',\n        // evaluate: 'templates/evaluate.html',\n        // imageView: 'templates/imageView.html',\n        // leaveword: 'templates/leaveword.html',\n        // main: 'templates/main.html',\n        // message: 'templates/message.html',\n        // messageTemplate: 'templates/messageTemplate.html',\n        // userInfo: 'templates/userInfo.html', \n    },\n    extraInfo: {\n        // 当前登陆用户信息\n        userInfo: {\n            name: \"游客\",\n            grade: \"VIP\"\n        },\n        // 产品信息\n        requestInfo: {\n            productId: \"123\",\n            referrer: \"10001\",\n            define: \"\" // 自定义信息\n        }\n    }\n});\n</script>\n\t\n</body>\n</html>"
  },
  {
    "path": "cs/jx/cs.js",
    "content": ";(function(RCS){\n\tvar utils = RCS.utils;\n\tvar emoji = RCS.emoji;\n\tvar render = utils.render;\n\tvar conversation = {};\n\tconversation.lastSendTime = 0;\n\tconversation.lastInputTime = 0;\n\tconversation.closeStatus = 1;\n\tconversation.messageContent = [];\n\tvar voicePlay = null;\n\tvar userInfoValue = {};//保存收集用户信息的相关数据\n\tvar templates = {};\n\tvar $ = utils.$;\n\tvar terminal;\n\tvar supportNot = false;//页面是否支持notification\n\tvar sdkConnect = 0;\n\n\t//加载模板\n\tvar getTemplates = function(callback){\n\t\ttemplates = RCS.getTemplates();\n\t\tcallback && callback();\n\t}\n\n\t//键盘回车发送\n\tvar keySend = function(event){\n\t\tif (event.keyCode == '13' && !event.shiftKey) {\n\t\t\tevent.preventDefault()\n\t\t\tsend();\n\t\t} else if(conversation.needTypSts == 1){\n\t\t\tinputChange();\n\t\t}\n\t}\n\t//发送\n\tvar send = function(){\n\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\tvar message = inputMsg.value;\n\t\tif (message) {\n\t\t\tmessage = emoji.symbolToEmoji(message);\n\t\t\tsendMessage(new RongIMLib.TextMessage({content:message,extra:\"附加信息\"}));\n\t\t\tinputMsg.value = '';\n\t\t\tinputMsg.focus();\n\t\t}\n\t}\n\t//每6秒执行一次正在输入消息发送\n\tvar inputChange = function(){\n\t \tvar timespan = new Date().getTime() - conversation.lastSendTime;\n        if (timespan > 1000 * 6) {\n            conversation.lastSendTime += timespan;\n            sendTyping();\n        }\n\t}\n\t//正在输入中\n\tvar sendTyping = function(){\n        if (conversation.targetType == RongIMLib.ConversationType.CUSTOMER_SERVICE) {\n        \tvar msg = new RongIMLib.TypingStatusMessage({\n                typingContentType:'RC:TxtMsg',\n                data:null\n            });\n            var callback = function(){};\n            sendMessage(msg,callback);\n        }\n\t}\n\t//显示表情\n\tvar showemoji = function(event){\n\t\tevent.stopPropagation();\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tif (emojiContent.style.display == 'none') {\n\t\t\tutils.show(emojiContent);\n\t\t} else {\n\t\t\tutils.hide(emojiContent);\n\t\t}\n\t}\n\t//表情点击\n\tvar chooseEmoji = function(event){\n\t\tevent.stopPropagation();\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar textArea = $('.rongcloud-text')[0];\n\t\tvar emojiName = thisTarget.getAttribute('name');\n\t\tif (emojiName) {\n\t\t\ttextArea.value += emojiName;\n\t\t\tutils.hide(emojiContent);\t\n\t\t\tif (terminal == 'pc') {\n\t\t\t\ttextArea.focus();\n\t\t\t\trange = document.createRange();\n\t\t\t\trange.selectNodeContents(textArea);\n\t\t\t\trange.collapse(true);\n\t\t\t\trange.setEnd(textArea, textArea.childNodes.length);\n\t\t\t\trange.setStart(textArea, textArea.childNodes.length);\n\t\t\t\tsel = window.getSelection();\n\t\t\t\tsel.removeAllRanges();\n\t\t\t\tsel.addRange(range);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction textMessageFormat(content) {\n\t    if(content.length === 0){\n\t        return '';\n\t    }\n\n\t    //要处理的到底是message？还是message里的content？\n\t    //str到处都是？\n\t    //传入依赖\n\t    //if-else只处理差异化部分\n\n\t    content = utils.encodeHtmlStr(content);\n\n\t    content = utils.replaceUri(content, function(uri, protocol) {\n\t        var link = uri;\n\t        if (!protocol) {\n\t            link = 'http://' + uri;\n\t        }\n\t        return '<a class=\"rong-link-site\" target=\"_blank\" href=\"'+ link +'\">' + uri + '</a>';\n\t    });\n\n\t    content = utils.replaceEmail(content, function(email) {\n\t        return '<a class=\"rong-link-email\" href=\"mailto:' + email + '\">' + email + '<a>';\n\t    });\n\n\t    content = RongIMLib.RongIMPhiz.phizToHtml(content);\n\t    return emoji.emojiToHTML(content, 18);\n\t}\n\n\t//发送消息\n\tvar sendMessage = function(msg,callback){\n\t\tvar targetId = conversation.id; // 目标 Id\n\t\tRongIMClient.getInstance().sendMessage(conversation.targetType, targetId, msg, {\n            // 发送消息成功\n            onSuccess: function (message) {\n            \tconsole.log(message);\n                //message 为发送的消息对象并且包含服务器返回的消息唯一Id和发送消息时间戳\n                console.log(\"Send successfully\");\n                callback && callback();\n                if (!callback) {\n                \tupdateMessage(message);\n                }\n            },\n            onError: function (errorCode,message) {\n                var info = '';\n                switch (errorCode) {\n                    case RongIMLib.ErrorCode.TIMEOUT:\n                        info = '超时';\n                        break;\n                    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n                        info = '未知错误';\n                        break;\n                    case RongIMLib.ErrorCode.REJECTED_BY_BLACKLIST:\n                        info = '在黑名单中，无法向对方发送消息';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_DISCUSSION:\n                        info = '不在讨论组中';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_GROUP:\n                        info = '不在群组中';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_CHATROOM:\n                        info = '不在聊天室中';\n                        break;\n                    default :\n                        info = x;\n                        break;\n                }\n                console.log('发送失败:' + info);\n            }\n       \t});\n\t}\n\n\t//显示新消息\n\tvar updateMessage = function(message){\n\t\tconversation.messageContent.push(message);\n\t\tvar newMessage = modifyMessage(utils.cloneObj(message));\n\t\tif (message.messageDirection != 1 && supportNot) {\n\t\t\tpushMessage(newMessage);\n\t\t}\n\t\tvar messageList = $(\".rcs-message-box\")[0];\n\t\tif (!messageList) {\n\t\t\treturn;\n\t\t}\n\t\tif (newMessage.sentTime - conversation.lastSendTime >= 60000) {//超过1分钟\n\t\t\tvar messageTime = {};\n\t\t\tmessageTime.content = {};\n\t\t\tmessageTime.messageType = 'TimeMessage';\n\t\t\tmessageTime.sentTime = utils.getTime(newMessage.sentTime);\n\t\t\tmessageList.innerHTML += render(templates.messageTemplate,messageTime);\n\t\t\tconversation.lastSendTime = newMessage.sentTime;\n\t\t}\n\t\tmessageList.innerHTML += render(templates.messageTemplate,newMessage);\n\t\tmessageList.scrollTop = messageList.scrollHeight;\n\t}\n\n\t//web push message\n\tvar pushMessage = function(msg){\n\t\tif (terminal == 'pc') {\n\t\t\tvar title = '客服消息提醒';\n\t\t\tvar options = {\n\t\t        body: \"您有一条新消息，请及时回复\",\n\t\t        icon: (msg.content.user&&msg.content.user.icon) ? msg.content.user.icon : RCS.config.csIcon,\n\t\t    };\n\t\t    var notification = new Notification(title,options);\n\n\t\t    notification.onclick = function(event) {\n\t\t        window.focus();\n\t\t        notification.close();\n\t\t    }\n\t\t    notification.onshow = function() {  \n\t            setTimeout(function() {  \n\t                notification.close();\n\t            }, 5000);  \n\t        };\n\t\t}\n\t}\n\n\t//图片新消息图片加载完毕滚动到最下面\n\tvar scrollBottom = function(){\n\t\tvar messageList = $(\".rcs-message-box\")[0];\n\t\tmessageList.scrollTop = messageList.scrollHeight;\n\t}\n\t//加载历史消息\n\tvar loadHisMessages = function(){\n\t\tvar callbacks = function(list,hasMsg){\n\t\t\tvar messageBox = $(\".rcs-message-box\")[0];\n\t\t\tvar messageList = {};\n\t\t\tmessageList.hasMore = hasMsg;\n\t\t\tmessageList.list = modificateMessage(conversation.messageContent);\n\t\t\tvar oldHeight = messageBox.scrollHeight;\n\t\t\tmessageBox.innerHTML = render(templates.message,messageList);\n\t\t\tvar newHeight = messageBox.scrollHeight;\n\t\t\tmessageBox.scrollTop = newHeight-oldHeight;\n\t\t}\n\t\tgetHisMessage(conversation.id,null,20,callbacks);\n\t}\n\n\t//生成会话列表界面\n\tvar createConversation = function(config){\n\t\tvar data = {\n\t\t\t\"showConversitionList\": config.showConversitionList\n\t\t}\n\t\tif (data.showConversitionList) {\n\t\t\tdata.conversationList = render(templates.conversation,config.customers);\n\t\t}\n\t\t$(\".customer-service\")[0].innerHTML = render(templates.main,data);\n\n\t\tvar conversationList = $(\".rong-conversation\");\n\t\tfor(var i=0;i<conversationList.length;i++){\n\t\t\tconversationList[i].onclick = function(){\n\t\t\t\tif (conversation.id == this.getAttribute(\"_cid\")) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconversation.id = this.getAttribute(\"_cid\");\n\t\t\t\t//初始化客服\n\t\t\t\tstartCustomerServer(conversation.id);\n\t\t\t};\n\t\t}\n\t}\n\n\t//进入指定会话\n\tvar openConversation = function(conversationId){\n\t\tconversation.targetType = RongIMLib.ConversationType.CUSTOMER_SERVICE;\n\t\tvar chat = $(\".rcs-chat-wrapper\")[0];\n\t\tvar data = {};\n\t\tvar messageList = {};\n\t\tmessageList.firstEnter = true;\n\t\tdata.messageList = render(templates.message, messageList);\n\t\tdata.evaEntryPoint = conversation.evaEntryPoint;\n\t\tdata.terminal = terminal;\n\t\t$(\".rcs-chat-wrapper\")[0].innerHTML = render(templates.chat, data);\n\t\t//初始化表情\n\t\tvar emojiList = emoji.getEmoji();\n\t\tvar strHtml = '';\n\t\tfor (var i = 0; i < emojiList.length; i++) {\n\t\t\tstrHtml += '<div class=\"emojiItem\">'+emojiList[i].outerHTML+'</div>';\n\t\t}\n\t\t$('.rongcloud-expressionContent')[0].innerHTML += strHtml;\n\t\tvar callbacks = function(list,hasMsg){\n\t\t\tif (hasMsg || list.length != 0) {\n\t\t\t\t$('.rongcloud-Messages-history')[0].style.display = 'block';\n\t\t\t}\n\t\t}\n\t\tgetHisMessage(conversationId,0,2,callbacks);\n\t}\n\n\t//拉去消息记录\n\tvar getHisMessage = function(conversationId,timestrap,count,callbacks){\n\t\tvar conversationType = RongIMLib.ConversationType.CUSTOMER_SERVICE; //私聊,其他会话选择相应的消息类型即可。\n\t\tvar targetId = conversationId; // 想获取自己和谁的历史消息，targetId 赋值为对方的 Id。\n\t\t// timestrap默认传 null，若从头开始获取历史消息，请赋值为 0 ,timestrap = 0;\n\t\t// count每次获取的历史消息条数，范围 0-20 条，可以多次获取。\n\t\tRongIMLib.RongIMClient.getInstance().getHistoryMessages(conversationType, targetId, timestrap, count, {\n\t\t  onSuccess: function(list, hasMsg) {\n\t\t  \tconversation.messageContent = list.concat(conversation.messageContent);\n\t\t  \tcallbacks(list,hasMsg);\n\t\t  },\n\t\t  onError: function(error) {\n\t\t    console.log(\"GetHistoryMessages,errorcode:\" + error);\n\t\t  }\n\t\t});\n\t}\n\n\t//单条消息修饰\n\tvar modifyMessage = function(msg){\n\t\tif (msg.messageType == 'TextMessage') {\n\t\t\tmsg.content.content = textMessageFormat(msg.content.content);\n\t\t} else if (msg.messageType == 'FileMessage') {\n\t\t\tmsg.content.size = utils.getFileSize(msg.content.size);\t\n\t\t} else if (msg.messageType == 'InfoNtf') {\n\t\t\tmsg.messageType = 'InformationNotificationMessage';\n\t\t} else if (msg.messageType == 'VoiceMessage'){\n\t\t\tRongIMLib.RongIMVoice.preLoaded(msg.content.content);\n\t\t} else if (msg.messageType == 'PullLeaveMessage'){\n        \tmsg.messageType = 'AlertMessage';\n            msg.content.content = msg.content.content.replace('留言', '<a class=\"leavemessageHref\" onclick=\"RCS.leavemessage()\">留言</a>');\n\t\t}\n\t\treturn msg;\n\t}\n\n\t//消息修饰\n\tvar modificateMessage = function(list){\n\t\tvar listTemp = JSON.parse(JSON.stringify(list));\n\t\tvar _list = [];\n\t\tfor (var i = 0; i < listTemp.length; i++) {\n\t\t\tvar messageTime = {\n\t\t\t\tsentTime: utils.getTime(listTemp[i].sentTime),\n\t\t\t\tmessageType: 'TimeMessage'\n\t\t\t};\n\t\t\tvar messageMap = [\n\t\t\t\t\"TextMessage\",\n\t\t\t\t\"FileMessage\",\n\t\t\t\t\"InfoNtf\",\n\t\t\t\t\"ImageMessage\",\n\t\t\t\t\"InformationNotificationMessage\",\n\t\t\t\t\"VoiceMessage\",\n\t\t\t\t\"PullLeaveMessage\"\n\t\t\t];\n\t\t\tif (messageMap.indexOf(listTemp[i].messageType) >= 0) {\n\t\t\t\tlistTemp[i] = modifyMessage(listTemp[i]);\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 0) {\n\t\t\t\t_list.push(messageTime);\n\t\t\t}else if (listTemp[i].sentTime - listTemp[i-1].sentTime >= 6000) {\n\t\t\t\t_list.push(messageTime);\n\t\t\t}\n\t\t\t_list.push(listTemp[i]);\n\t\t}\n\t\treturn _list;\n\t}\n\n\t//客服初始化\n\tvar startCustomerServer = function(targetId){\n\t\tRongIMLib.RongIMClient.getInstance().startCustomService(targetId, {\n            onSuccess: function() {\n                console.log('客服初始化成功');\n                conversation.connect = true;\n            },\n            onError: function() {\n            \tconsole.log('客服初始化失败');\n            }\n        },RCS.config.extraInfo);\n\t}\n\n\t//断开客服连接\n\tvar stopCustomerServer = function(callback){\n\t\tconsole.log(conversation.id);\n\t\tRongIMLib.RongIMClient.getInstance().stopCustomeService(conversation.id, {\n\t\t    onSuccess: function() {\n\t\t    \tconversation.connect = false;\n\t\t    \tconsole.log('客服断开成功');\n\t\t    \tcallback && callback();\n\t\t    },\n\t\t    onError: function(errorcode) {\n\t\t    \tconsole.log('errorcode');\n\t\t    }\n\t\t});\n\t}\n\n\t//改变键盘状态\n\tvar changeServiceState = function(status){\n\t\tif (status == 'robot') {\n\t\t\tconversation.serviceState = 'robot';\n\t\t\tutils.hide($('.rongcloud-mode1')[0]);\n\t\t\tutils.show($('.rongcloud-mode2')[0]);\n\t\t} else {\n\t\t\tconversation.serviceState = 'people';\n\t\t\tutils.hide($('.rongcloud-mode2')[0]);\n\t\t\tutils.show($('.rongcloud-mode1')[0]);\n\t\t}\n\t}\n\n\t//转人工\n\tvar switchPerson = function(){\n\t\tconsole.log(conversation.id);\n\t\tRongIMLib.RongIMClient.getInstance().switchToHumanMode(conversation.id, {\n\t\t\tonSuccess: function() {\n\t\t\t\tconsole.log('转人工成功');\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\n\t\t\t}\n\t\t});\n\t}\n\t//转人工的监听\n\tvar changeModeResponse = function(message){\n\t\tvar systemMsg = null;\n\t\tswitch (message.content.data.status){\n\t\t\tcase 1:\n\t\t\t\tchangeServiceState('people');\n\t\t\t\tbreak;\n\t\t\tcase 2:\n                changeServiceState('robot');\n                break;\n            case 3:\n                systemMsg = '你被拉黑了';//用户被拉黑,灰条消息你被拉黑了\n                break;\n            case 4:\n                systemMsg = '已经是人工了';//用户已经转人工，灰条消息已经是人工了\n                break;\n            default:\n                break;\n\t\t}\n\t\treturn systemMsg;\n\t}\n\t//发送欢迎语\n\tvar addCustomServiceInfo = function(msg){\n\t\tvar message = {};\n\t\tmessage.sentTime = new Date().getTime();\n\t\tmessage.content = {};\n\t\tmessage.messageType = 'TextMessage';\n\t\tmessage.content.content = msg.robotWelcome;\n\t\tmessage.content.user = {};\n\t\tmessage.content.user.icon = msg.robotIcon;\n\t\tmessage.content.user.name = msg.robotName;\n\t\tconsole.log(message);\n\t\tupdateMessage(message);\n\t}\n\t//发送灰条消息\n\tvar addServiceTip = function(content){\n\t\tvar message = {};\n\t\tmessage.sentTime = new Date().getTime();\n\t\tmessage.content = {};\n\t\tmessage.messageType = 'InformationNotificationMessage';\n\t\tmessage.content.message = content;\n\t\tconsole.log(message);\n\t\tupdateMessage(message);\n\t}\n\n\t//播放音频\n\tvar play = function(event, msgContent){\n\t\tRongIMLib.RongIMVoice.stop();\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tif (thisTarget.className.indexOf('rongcloud-animate') != -1) {\n\t\t\tthisTarget.className = thisTarget.className.replace(' rongcloud-animate','');\n\t\t\tclearTimeout(voicePlay);\n\t\t} else {\n\t\t\tvar audioStatusNode = thisTarget.parentNode.querySelector('.rongcloud-audioState');\n\t\t\tif (audioStatusNode) {\n\t\t\t\taudioStatusNode.parentNode.removeChild(audioStatusNode);\n\t\t\t}\n\t\t\tif (voicePlay) {\n\t\t\t\tclearTimeout(voicePlay);\n\t\t\t\tvar voiceList = $('.rongcloud-audioBox');\n\t\t\t\tfor (var i = 0; i < voiceList.length; i++) {\n\t\t\t\t\tvoiceList[i].className = 'rongcloud-audioBox rongcloud-clearfix';\n\t\t\t\t}\n\t\t\t}\n\t\t\tRongIMLib.RongIMVoice.play(msgContent.content, msgContent.duration);\n\t\t\tthisTarget.className = thisTarget.className +' rongcloud-animate';\n\t\t\tvoicePlay = setTimeout(function(){\n\t\t\t\tthisTarget.className = thisTarget.className.replace(' rongcloud-animate','');\n\t\t\t},msgContent.duration * 1000);\n\t\t}\n\t}\n\n\t//播放视频\n\tvar playVideo = function (event) {\n\t\tvar video = event.currentTarget.querySelector('video');\n        var btn = event.currentTarget.querySelector('.play-btn');\n        if (video.paused) {\n            video.play();\n            btn.style.display = \"none\";\n        } else {\n            video.pause();\n            btn.style.display = \"block\";\n        }\n        video.onended = function () {\n            btn.style.display = \"block\";  \n        }\n\t}\n\n\n\t//img上传图片\n\tvar imgUpload = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar _file = thisTarget.files;\n\t\tfor (var i = 0; i < _file.length; i++) {\n\t\t\tRCS.imageStartUpload(_file[i],function(data){\n\t\t\t\tconsole.log(\"文件上传完成：\", data);\n\t\t\t\tgetFileUrl(data);\n\t\t\t});\n\t\t}\n\t\tthisTarget.value = '';\n\t}\n\t//上传文件\n\tvar fileUpload = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar _file = thisTarget.files;\n\t\tfor (var i = 0; i < _file.length; i++) {\n\t\t\tRCS.fileStartUpload(_file[i],function(data){\n\t\t\t\tconsole.log(\"文件上传完成：\", data);\n\t\t\t\tgetFileUrl(data);\n\t\t\t});\n\t\t}\n\t\tthisTarget.value = '';\n\t}\n\n\tvar urlItem = {\n\t\tfile: function(data){\n\t\t\tif (RCS.config.upload && RCS.config.upload.isPrivate) {\n\t\t\t\tif (data.rc_url.type == 1) {\n\t\t\t\t\tdata.downloadUrl = data.rc_url.path;\n\t\t\t\t} else {\n\t\t\t\t\tdata.downloadUrl = RCS.config.upload.fileServer + data.rc_url.path;\n\t\t\t\t}\n\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\tsendMessage(msg);\n\t\t\t} else {\n\t\t\t\tvar fileType = RongIMLib.FileType.FILE;\n\t\t\t\tRongIMClient.getInstance().getFileUrl(fileType, data.filename, data.name, {\n\t\t\t\t\tonSuccess: function(result){\n\t\t\t\t\t\tdata.downloadUrl = result.downloadUrl;\n\t\t\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\t\t\tsendMessage(msg);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error){\n\t\t\t\t\t\tshowResult('getFileToken error:' + error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\timage: function(data){\n\t\t\tif (RCS.config.upload && RCS.config.upload.isPrivate) {\n\t\t\t\tif (data.rc_url.type == 1) {\n\t\t\t\t\tdata.downloadUrl = data.rc_url.path;\n\t\t\t\t} else {\n\t\t\t\t\tdata.downloadUrl = RCS.config.upload.fileServer + data.rc_url.path;\n\t\t\t\t}\n\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\tsendMessage(msg);\n\t\t\t} else {\n\t\t\t\tvar fileType = RongIMLib.FileType.IMAGE;\n\t\t\t\tRongIMClient.getInstance().getFileUrl(fileType, data.filename, null, {\n\t\t\t\t\tonSuccess: function(result){\n\t\t\t\t\t\tdata.downloadUrl = result.downloadUrl;\n\t\t\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\t\t\tsendMessage(msg);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error){\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tvar messageItem = {\n        file: function(file){\n            var name = file.name || '',\n            index = name.lastIndexOf('.') + 1,\n            type = name.substring(index);\n            // 发送文件消息请参考： http://rongcloud.cn/docs/web_api_demo.html#发送消息\n            // 创建文件消息\n            return new RongIMLib.FileMessage({ name: file.name, size: file.size, type: type, fileUrl: file.downloadUrl});\n        },\n        image: function(image){\n            return new RongIMLib.ImageMessage({content: image.thumbnail, imageUri: image.downloadUrl});\n        }\n    };\n\n\tvar getFileUrl = function(data){\n\t\turlItem[data.fileType](data);\n\t}\n\n\t//客服关闭\n\tvar endConversation = function(isCustomerService){\n\t\tif (isCustomerService) {\n\t\t\t//客服主动关闭\n\t\t\tif (conversation.serviceState == 'people') {\n\t\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += templates.evaluate;\n\t\t\t} else {\n\t\t\t\tevaluate(false);\n\t\t\t}\n\t\t} else {\n\t\t\tif (conversation.closeStatus == 1) {\n\t\t\t\t//用户主动关闭\n\t\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += templates.endconversation;\n\t\t\t} else if (conversation.closeStatus == 2) {\n\t\t\t\t//主动留言关闭\n\t\t\t\tutils.removeNode('.rongcloud-leavemessage');\n\t\t\t\tconversation.closeStatus = 1;\n\t\t\t} else if (conversation.closeStatus == 3) {\n\t\t\t\t//拉黑留言关闭\n\t\t\t\tstopCustomerServer();\n\t\t\t\tendComplete();\n\t\t\t\tconversation.closeStatus = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\t//完全关闭\n\tvar endComplete = function(){\n\t\t$(\".rcs-chat-wrapper\")[0].innerHTML = '';\n\t\tutils.hide($('.customer-service')[0]);\n\t\tconversation.lastSendTime = 0;\n\t\tconversation.messageContent = [];//完全退出清空数据\n\t}\n\t//只关闭当前窗口\n\tvar closeEvaluate = function(){\n\t\tutils.removeNode('.rongcloud-evaluate');\n\t}\n\n\t//confirm\n\tvar confirm = function(){\n\t\t//确定关闭\n\t\tclose();\n\t\tif (conversation.serviceState == 'people') {\n\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += templates.evaluate;\n\t\t} else {\n\t\t\tevaluate(false);\n\t\t}\n\t}\n\n\tvar close = function(){\n\t\t//取消关闭\n\t\tutils.removeNode('.rongcloud-layermbox');\n\t}\n\n\tvar chatEnd = function(){\n\t\tstopCustomerServer();//确定关闭了，先关闭客服链接\n\t\tendComplete();\n\t}\n\n\tvar star = function(num){\n\t\tvar starList = $('.satisfaction-star');\n\t\tfor (var i = 0; i < starList.length; i++) {\n\t\t\tstarList[i].className = \"satisfaction-star\";\n\t\t\tif (i<num) {\n\t\t\t\tstarList[i].className = \"satisfaction-star satisfaction-star-selected\"\n\t\t\t}\n\t\t}\n\t}\n\tvar evaluate = function(isForm){\n\t\t//评价\n\t\tvar callback = function(){\n\t\t\tclose();\n\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += templates.closebefore;\n\t\t}\n\t\tif (isForm) {\n\t\t\tvar source = 0;\n\t\t\tvar starList = $('.satisfaction-star');\n\t\t\tfor (var i = 0; i < starList.length; i++) {\n\t\t\t\tif (starList[i].className.indexOf(\"satisfaction-star-selected\") != -1) {\n\t\t\t\t\tsource += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (source == 0) {\n\t\t\t\tcallback();\n\t\t\t} else {\n\t\t\t\tvar data = {\n\t\t\t\t\tsource: source,\n\t\t\t\t\tisresolve: -1\n\t\t\t\t};\n\t\t\t\tvar msg = new RongIMLib.EvaluateMessage(data);\n\t\t\t\tconsole.log(msg);\n\t\t\t\tRongIMClient.getInstance().sendMessage(conversation.targetType,conversation.id,msg,{\n\t\t\t\t\tonSuccess: function() {\n\t\t\t    \t\tconsole.log('发送评价消息成功');\n\t\t\t    \t\tcallback();\n\t\t\t\t    },\n\t\t\t\t    onError: function() {\n\n\t\t\t\t    }\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tcallback();\n\t\t}\n\t}\n\t//主动发起评价\n\tvar startEvaluate = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\t// thisTarget.parentNode.parentNode.removeChild(thisTarget.parentNode);\n\t\tpullEva();\n\t}\n\n\t//客服发送评价\n\tvar pullEva = function(){\n\t\tconversation.evaluateStatus = false;\n        $('.rcs-chat-wrapper')[0].innerHTML += templates.evaluate;\n\t}\n\n\t//获取评价数据\n\tvar getEvaluateValue = function(){\n\t\tvar satisfactionList = document.getElementsByName('satisfaction');\n\t\tvar source = '';\n\t\tfor (var i = 0; i < satisfactionList.length; i++) {\n\t\t\tif (satisfactionList[i].checked) {\n\t\t\t\tsource = satisfactionList[i].value;\n\t\t\t}\n\t\t}\n\t\tvar suggest = document.getElementsByName('suggest')[0].value;\n\t\treturn {\n\t\t\tsource: source,\n\t\t\tsuggest: suggest\n\t\t}\n\t}\n\n\t//留言\n\tvar leavemessage = function(isblack){\n\t\tif (isblack) {\n\t\t\tconversation.closeStatus = 3;\n\t\t} else {\n\t\t\tconversation.closeStatus = 2;\n\t\t}\n\t\tvar messageData = {};\n\t\tmessageData.url = conversation.leaveMsgUrl;\n\t\t$('.rcs-chat-wrapper')[0].innerHTML += render(templates.leaveword,messageData);\n\t}\n\t//留言提交\n\tvar leaveMessageComfirm = function(event){\n\t\tevent.preventDefault();\n\t\tvar formItemList = [];\n\t\tfor (var i = 0; i < conversation.formList.length; i++) {\n\t\t\tformItemList.push(conversation.formList[i].name);\n\t\t}\n\t\tvar isValidate = true;\n\t\tfor (var i = 0; i < formItemList.length; i++) {\n\t\t\tvar thisTarget = document.getElementsByName(formItemList[i])[0];\n\t\t\tif (!validateLeaveMessage(i,thisTarget)) {\n\t\t\t\tisValidate = false;\n\t\t\t}\n\t\t}\n\t\tif (!isValidate) {\n\t\t\treturn;\n\t\t}\n\t\tvar data = utils.getFormValue(formItemList);\n\t\tvar msg = new RongIMClient.RegisterMessage.LeaveMessage(data);//发送留言消息\n\t\tvar callback = function(){\n\t\t\tstopCustomerServer();\n\t\t\tendComplete();\n\t\t}\n\t\tsendMessage(msg,callback);\n\n\t}\n\n\t//留言表单验证\n\tvar validateLeaveMessage = function(index,eventOrTarget){\n\t\tvar verificationMap = {\n            email: '^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$',\n            phone: '^1\\\\d{10}$'\n        }\n\t\tvar thisTarget = (eventOrTarget.target || eventOrTarget.srcElement)? (eventOrTarget.target || eventOrTarget.srcElement):eventOrTarget;\n\t\tvar thisValue = thisTarget.value;\n\t\tvar validateStr = '';\n\t\tvar list = conversation.formList;\n\t\tif (list[index].required) {\n\t\t\tif (!thisValue) {\n\t\t\t\tvalidateStr = list[index].message[0];\n\t\t\t}\n\t\t}\n\t\tif (thisValue && list[index].verification) {\n\t\t\tvar reg = new RegExp(verificationMap[list[index].verification]);\n\t\t\tif (!reg.test(thisValue)) {\n\t\t\t\tvalidateStr = list[index].message[1];\n\t\t\t}\n\t\t}\n\t\tif (thisValue && list[index].max) {\n\t\t\tif (thisValue.length > list[index].max) {\n\t\t\t\tvalidateStr = list[index].message[2];\n\t\t\t}\n\t\t}\n\t\tvar nextTarget = thisTarget.nextElementSibling;\n\t\tif (validateStr) {\n\t\t\tnextTarget.innerHTML = validateStr;\n\t\t\tutils.show(nextTarget);\n\t\t\treturn false;\n\t\t} else {\n\t\t\tnextTarget.innerHTML = '';\n\t\t\tutils.hide(nextTarget);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//最小化\n\tvar minimize = function(){\n\t\tutils.hide($('.customer-service')[0]);\n\t}\n\n\t//预览图片\n\tvar viewImage = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar image = {\n\t\t\timageUrl: thisTarget.getAttribute('data-img')\n\t\t}\n\t\t$('.imageViewBox')[0].innerHTML = render(templates.imageView,image);\n\t\tutils.fadein($('.imageViewBox')[0]);\n\t}\n\tvar escImageView = function(){\n\t\t$('.imageViewBox')[0].innerHTML = '';\n\t\tutils.fadeout($('.imageViewBox')[0]);\n\t}\n\n\t//用户表单验证\n\tvar validateUserInfo = function(eventOrTarget){\n\t\tvar verificationMap = {\n            name: '^[\\u4E00-\\u9FA5A-Za-z0-9]+$',\n            phone: '^1[3|4|5|7|8][0-9]{9}$',\n            email: '^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$'\n        }\n\n\t\tvar thisTarget = (eventOrTarget.target || eventOrTarget.srcElement)? (eventOrTarget.target || eventOrTarget.srcElement):eventOrTarget;\n\t\tvar thisValue = thisTarget.value;\n\t\tvar thisName = thisTarget.getAttribute('name');\n\t\tvar thisLabel = thisTarget.getAttribute('data-label');\n\t\tvar thisRequired = thisTarget.getAttribute('data-required');\n\t\tvar thisRule = thisTarget.getAttribute('data-pattern');\n\t\tvar validateStr = '';\n\t\tif (thisRequired == 'required') {\n\t\t\tif (!thisValue) {\n\t\t\t\tvalidateStr = thisLabel+'不能为空';\n\t\t\t}\n\t\t}\n\n\t\tif (thisValue && thisRule) {\n\t\t\tvar reg = new RegExp(verificationMap[thisName]);\n\t\t\tif (!reg.test(thisValue)) {\n\t\t\t\tvalidateStr = thisRule;\n\t\t\t}\n\t\t}\n\n\n\t\tif (thisValue && thisName == 'name') {\n\t\t\tif (thisValue.length > 20) {\n\t\t\t\tvalidateStr = thisRule;\n\t\t\t}\n\t\t}\n\t\tif (thisValue && thisName == 'email') {\n\t\t\tif (thisValue.length > 30) {\n\t\t\t\tvalidateStr = thisRule;\n\t\t\t}\n\t\t}\n\t\tvar nextTarget = thisTarget.nextElementSibling;\n\t\tif (validateStr) {\n\t\t\tnextTarget.innerHTML = validateStr;\n\t\t\tutils.show(nextTarget);\n\t\t\treturn false;\n\t\t} else {\n\t\t\tnextTarget.innerHTML = '';\n\t\t\tutils.hide(nextTarget);\n\t\t\treturn true;\n\t\t}\n\t}\n\t//收集用户信息\n\tvar collectUserInfo = function(message){\n\t\tutils.removeNode('.userInfoModel');\n\t\tvar userInfo = {};\n\t\tuserInfo.list = message.content.content.fields;\n\t\tuserInfoValue.formid = message.content.content.formid;\n\t\tuserInfoValue.submiturl = message.content.content.submiturl;\n\t\tuserInfoValue.data = [];\n\t\tuserInfoValue.wid = 1;\n\t\tfor (var i = 0; i < userInfo.list.length; i++) {\n\t\t\tvar infoObj = {};\n\t\t\tinfoObj.name = userInfo.list[i].name;\n\t\t\tuserInfoValue.data.push(infoObj);\n\t\t}\n\t\t$('.rcs-chat-wrapper')[0].innerHTML += render(templates.userInfo,userInfo);\n\t}\n\t//用户信息关闭\n\tvar userInfoClose = function(){\n\t\tutils.removeNode('.userInfoModel');\n\t\tuserInfoValue = {};\n\t}\n\t//用户信息提交\n\tvar userInfoConfirm = function(event){\n\t\tevent.preventDefault();\n\t\tvar formItemList = [];\n\t\tfor (var i = 0; i < userInfoValue.data.length; i++) {\n\t\t\tformItemList.push(userInfoValue.data[i].name);\n\t\t}\n\t\tvar isValidate = true;\n\t\tfor (var i = 0; i < formItemList.length; i++) {\n\t\t\tvar thisTarget = document.getElementsByName(formItemList[i])[0];\n\t\t\tif (!validateUserInfo(thisTarget)) {\n\t\t\t\tisValidate = false;\n\t\t\t}\n\t\t}\n\t\tif (!isValidate) {\n\t\t\treturn;\n\t\t}\n\t\tvar data = utils.getFormValue(formItemList);\n\t\tfor (var i = 0; i < userInfoValue.data.length; i++) {\n\t\t\tuserInfoValue.data[i].value = data[userInfoValue.data[i].name];\n\t\t}\n\t\tvar sendUserInfoMsg = {};\n\t\tsendUserInfoMsg.content = userInfoValue;\n\t\tvar msg = new RongIMClient.RegisterMessage.UserInfo(sendUserInfoMsg);//发送用户信息提交消息\n\t\tuserInfoValue = {};\n\t\tvar callback = function(){\n\t\t\tutils.removeNode('.userInfoModel');\n\t\t};\n\t\tsendMessage(msg,callback);\n\t}\n\n\t//下载历史消息\n\tvar getHistoryMsgFile = function(){\n\t\tvar msg = new RongIMClient.RegisterMessage.DownloadHistoryMessage({\n\t\t\tbegin: 0\n\t\t});\n\t\tvar callback = function(){};\n\t\tsendMessage(msg,callback);\n\t}\n\n\t//自定义消息注册\n\tvar registerMessage = function() {\n        var messageName = \"ProductMessage\"; // 消息名称。\n        var objectName = \"cs:product\"; // 消息内置名称，请按照此格式命名。\n        var mesasgeTag = new RongIMLib.MessageTag(true, true);// 消息是否保存是否计数，true true 保存且计数，false false 不保存不计数。\n        var propertys = [\"title\", \"url\", \"content\", \"imageUrl\", \"extra\"]; // 消息类中的属性名。\n        // RongIMLib.RongIMClient.registerMessageType(messageName, objectName, mesasgeTag, propertys);\n        //评价下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"PullEvaMessage\", \"RC:CsPullEva\", mesasgeTag, ['content']);\n        //评价上行消息\n        RongIMLib.RongIMClient.registerMessageType(\"EvaluateMessage\", \"RC:CsEva\", mesasgeTag, ['source','isresolve','suggest']);\n        //留言下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"PullLeaveMessage\", \"RC:CsPLM\", mesasgeTag, ['content']);\n        //留言上行消息\n        RongIMLib.RongIMClient.registerMessageType(\"LeaveMessage\", \"RC:CsLm\", mesasgeTag, ['msg_content','msg_email','msg_name','msg_tel']);\n        // 收集信息下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"CollectUserInfo\", \"RC:CsCEI\", mesasgeTag, ['content','user']);\n        RongIMLib.RongIMClient.registerMessageType(\"UserInfo\", \"RC:CsEI\", mesasgeTag, ['content']);\n        // RC:CsDHM //下载历史消息  先发送这个类型的消息 上行消息\n        RongIMLib.RongIMClient.registerMessageType(\"DownloadHistoryMessage\", \"RC:CsDHM\", mesasgeTag, ['begin']);\n        // RC:CsHM 接受这个类型的消息 下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"HistoryMessage\", \"RC:CsHM\", mesasgeTag, ['fileUrl','name','size','type']);\n    }\n\n\t//sdk初始化\n\tvar sdkInit = function(params, callbacks){\n\t\tif(window.navigator.onLine==false) {　\n\t\t\tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t\treturn;\n\t　　}//如果第一次没有连接网络，直接回调\n\t\tif (sdkConnect == 2) {\n\t\t\tif (!conversation.connect) {\n\t\t\t\tparams.connectingCallback && params.connectingCallback();\n\t\t\t\tcallbacks.getInstance && callbacks.getInstance(RongIMClient.getInstance());\n\t\t\t\tconversation.id = params.customerServiceId;\n\t\t\t}\n\t\t\tcreateButton(params);\n\t\t\treturn;\n\t\t} else if (sdkConnect == 1){\n\t\t\treturn;\n\t\t}\n\n\t\tvar initTimes = 0;\n\t\tsdkConnect = 1;//1为连接中\n\t\tparams.connectingCallback && params.connectingCallback();//连接中回调\n\n\t\tvar appKey = params.appKey;\n\t\tvar token = params.token;\n\t\tvar navi = params.navi || \"\";\n\n\t\tif(navi !== \"\"){\n\t\t\t//私有云\n\t\t\tvar config = {\n\t\t\t\tnavi : navi\n\t\t\t};\n\t\t\tconsole.log(\"私有云\");\n\t\t\tconsole.log(params);\n\t\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\t\t}else{\n\t\t\t//公有云\n\t\t\tconsole.log(\"公有云\");\n\t\t\tconsole.log(params);\n\t\t\tRongIMLib.RongIMClient.init(appKey);\n\t\t}\n\n\t\tvar instance = RongIMClient.getInstance();\n\n\t\t// 连接状态监听器\n\t\tRongIMClient.setConnectionStatusListener({\n\t\t\tonChanged: function (status) {\n\t\t\t\tconsole.log(status);\n\t\t\t\tvar connectDom = $('.rcs-connect-status')[0];\n\t\t\t\tif (connectDom) {\n\t\t\t\t\tconnectDom.style.display = 'block';\n\t\t\t\t}\n\t\t\t    switch (status) {\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t        \tif (connectDom) {\n\t\t\t\t\t\t\tconnectDom.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsdkConnect = 2;\n\t\t\t\t\t\tinitTimes++;\n\t\t\t            callbacks.getInstance && callbacks.getInstance(instance);\n\t\t\t            break;\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t                console.log('正在链接');\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t                console.log('断开连接');\n\t\t                sdkConnect = 0;\n\t\t                params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t                console.log('其他设备登录');\n\t\t                sdkConnect = 0;\n\t\t                params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t              \tcase RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t                console.log('域名不正确');\n\t\t                sdkConnect = 0;\n\t\t                params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t              \tconsole.log('网络不可用');\n\t\t              \t// sdkConnect = 0;\n\t\t              \t// params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t                \tconsole.log('断开连接');\n\t                \tsdkConnect = 0;\n\t                \tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t                case 4:\n\t                \tconsole.log('token无效');\n\t                \tsdkConnect = 0;\n\t                \tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t                default:\n\t                \tconsole.log('未知错误');\n\t                \tsdkConnect = 0;\n\t                \tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t\t        }\n\t\t\t}\n\t\t});\n\n\t\tRongIMClient.setOnReceiveMessageListener({\n\t\t\t// 接收到的消息\n\t\t\tonReceived: function (message) {\n\t\t\t    // 判断消息类型\n\t\t\t    console.log(\"新消息: \" + message.targetId);\n\t\t\t    if (message.offLineMessage) {\n\t\t\t    \treturn;\n\t\t\t    }\n\t            console.log(message);\n\t            var systemMsg = null;\n\t            switch(message.messageType){\n\t            \tcase 'HandShakeResponseMessage'://客服握手响应\n\t            \t\tparams.connectedCallback && params.connectedCallback();\n\t            \t\tsetConversition(message);\n\t            \t\topenConversation(conversation.id);\n\t            \t\tif (message.content.data.serviceType == 1 || message.content.data.serviceType == 3) {//仅机器人、机器人优先\n\t            \t\t\tif (message.content.data.robotWelcome) {addCustomServiceInfo(message.content.data);}\n\t            \t\t\tchangeServiceState('robot');\n\t            \t\t} else {\n\t            \t\t\tchangeServiceState('people');\n\t            \t\t}\n\t            \t\tif (message.content.data.isblack == 1) {\n                            //拉进了黑名单，留言页面\n                            console.log(message.content.data.isblack);\n                            leavemessage(true);\n                        }\n\t            \t\tbreak;\n\t            \tcase 'ChangeModeResponseMessage'://转人工\n\t            \t\tsystemMsg = changeModeResponse(message);\n\t            \t\tbreak;\n\t            \tcase 'TerminateMessage'://客服主动结束会话\n\t            \t\tif ($('.imageViewBox')[0]) {\n\t            \t\t\tutils.fadeout($('.imageViewBox')[0]);\n\t            \t\t}\n\t            \t\tif (!conversation.connect) {\n\t            \t\t\treturn;\n\t            \t\t}\n\t            \t\tif (message.content.code == 0 || conversation.evaEntryPoint == 3) {\n\t            \t\t\t//评价\n                            endConversation(true);//关闭，评价\n                        } else {\n                            changeServiceState('robot');\n                        }\n\t            \t\tbreak;\n\t            \tcase 'CustomerStatusUpdateMessage'://状态改变\n\t            \t\tchangeServiceState('people');\n\t            \t\tbreak;\n\t            \tcase 'InformationNotificationMessage'://提示语\n\t            \t\tupdateMessage(message);\n\t            \t\tbreak;\n\t            \tcase 'InfoNtf'://提示语灰条消息\n\t            \t\tupdateMessage(message);\n\t            \t\tbreak;\n\t            \tcase 'SuspendMessage'://用户主动关闭\n\t            \t\tstopCustomerServer();\n    \t\t\t\t\tendComplete();\n\t            \t\tbreak;\n\t            \tcase 'PullEvaMessage':\n                        //客服主动下发评价,只评价不做任何操作\n                        pullEva();\n                        break;\n                    case 'CollectUserInfo':\n                        //客服发起收取用户信息消息\n                        collectUserInfo(message);\n                        break;\n                    case \"HistoryMessage\"://下载历史消息\n                        var url = message.content.fileUrl;\n                        var name = message.content.name;\n                        utils.downloadHistoryMsgFile(url, name);\n                        //下载文件\n                        break;\n                    case \"TextMessage\"://文本消息\n\t\t\t\t\t\tupdateMessage(message);\n                        break;\n                    case \"ImageMessage\"://图片消息\n                        updateMessage(message);\n                        break;\n                    case \"FileMessage\"://文件消息\n                        updateMessage(message);\n                        break;\n                    case \"VoiceMessage\"://声音消息\n                        updateMessage(message);\n                        break;\n                    case \"PullLeaveMessage\"://留言消息\n                        updateMessage(message);\n                        break;\n\t\t            default:\n\t\t                callbacks.receiveNewMessage && callbacks.receiveNewMessage(message);\n\t\t                break;\n\t\t        }\n\t            if (systemMsg) {\n\t            \tconsole.log(systemMsg);\n\t            \taddServiceTip(systemMsg);\n\t            }\n\t\t\t}\n\t\t});\n\n\t\t//开始链接\n\t\tRongIMClient.connect(token, {\n\t\t\tonSuccess: function(userId) {\n\t\t\t\tcallbacks.getCurrentUser && callbacks.getCurrentUser({userId:userId});\n\t\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t\t\tif (initTimes == 1) {\n\t\t\t\t\tcallbacks.enterConversation && callbacks.enterConversation();\n\t\t\t\t}\n\t\t\t\tinitTimes++;\n\t\t\t},\n\t\t\tonTokenIncorrect: function() {\n\t\t\t\tconsole.log('token无效');\n\t\t\t\tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t\t},\n\t\t\tonError:function(errorCode){\n\t\t\t\tconsole.log(\"=============================================\");\n\t\t\t\tconsole.log(errorCode);\n\t\t\t\tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t\t}\n\t\t});\n\t}\n\t//客服会话初始化一些数据\n\tvar setConversition = function(msg){\n\t\tif (msg.content.data.needTypSts == 1) {\n\t\t\tconversation.needTypSts = 1;\n\t\t}\n\t\tif (msg.content.data.leaveMsgConf) {\n\t\t\tconversation.leaveMsgUrl = msg.content.data.leaveMsgConf.customConf.url;\n\t\t}\n\t\tif (msg.content.data.evaConf) {\n\t\t\tswitch(msg.content.data.evaConf.evaEntryPoint){\n\t\t\t\tcase 1:\n\t\t\t\t\t//啥都不用干\n\t\t\t\t\tconversation.evaEntryPoint = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t//用户不能主动评价\n\t\t\t\t\tconversation.evaEntryPoint = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t//结束会话弹出评价\n\t\t\t\t\tconversation.evaEntryPoint = 3;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t//创建button\n\tvar createButton = function(config){\n\t\tvar obj = {\n\t\t\t\"showButton\": config.showButton\n\t\t}\n\t\tif (!$('.customer-service')[0]) {\n\t\t\tconfig.target.innerHTML = render(templates.button, obj);\n\t\t}\n\t\tif (conversation.connect) {\n\t\t\tshowCommon();\n\t\t\treturn;\n\t\t}\n\t\tcreateConversation(config);\n\t\taddListener();\n\t\tif (!config.showButton) {\n\t\t\tshowCommon();\n\t\t}\n\t}\n\n\t//监听留言提交,页面关闭\n\tvar addListener = function(){\n\t\tvar callback = function(phoneOrPc){\n\t\t\tterminal = phoneOrPc;\n\t\t}\n\t\tutils.browserRedirect(callback);\n\t\t\n\t\tif (terminal == 'pc') {\n\t\t\tdocument.body.onclick = function(){\n\t\t\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\t\t\thideEmoji();\n\t\t\t}\n\t\t\tif (Notification.permission === \"granted\") {\n\t\t\t    supportNot = true;\n\t\t\t}\n\t\t\t// Otherwise, we need to ask the user for permission\n\t\t\telse if (Notification.permission !== \"denied\") {\n\t\t\t    Notification.requestPermission(function (permission) {\n\t\t\t        // If the user accepts, let's create a notification\n\t\t\t        if (permission === \"granted\") {\n\t\t\t            supportNot = true;\n\t\t\t        }\n\t\t\t    });\n\t\t\t}\n\t\t} else {\n\t\t\tdocument.body.ontouchstart = function(event){\n\t\t\t\tif (event.target.className.indexOf('emojiItem') < 0 && event.target.className.indexOf('rong-emoji-content') < 0 && event.target.className.indexOf('rongcloud-expressionContent') < 0 ) {\n\t\t\t\t\thideEmoji();\n\t\t\t\t}\n\t\t\t\tif (event.target.className.indexOf('rongcloud-rong-btn') < 0 && event.target.className.indexOf('rongcloud-text') < 0) {\n\t\t\t\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\t\t\t\tif (inputMsg) {\n\t\t\t\t\t\tinputMsg.blur();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twindow.addEventListener('message',function(e){\n\t\t\tif (e.origin == 'https://web.jiaxincloud.com') {\n\t\t\t\tif (e.data == 'success') {\n\t\t\t\t\tutils.removeNode('.rongcloud-leavemessage');\n\t\t\t\t}\n\t\t\t}\n        },false);\n        window.onbeforeunload = function(event) {\n\t\t    stopCustomerServer();\n\t\t};\n\t}\n\n\tvar hideEmoji = function(){\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tif (emojiContent) {\n\t\t\tutils.hide(emojiContent);\n\t\t}\n\t}\n\n\t//button点击事件\n\tvar showCommon = function(){\n\t\tif (conversation.connect) {\n\t\t\tif ($('.customer-service')[0].style.display != 'none') {\n\t\t\t\tutils.hide($('.customer-service')[0]);\n\t\t\t} else {\n\t\t\t\tutils.show($('.customer-service')[0]);\n\t\t\t\tif (!$('.rcs-chat-wrapper')[0]) {\n\t\t\t\t\tcreateConversation(conversation.id);\n\t\t\t\t\topenConversation(conversation.id);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(conversation.id);\n\t\t\tstartCustomerServer(conversation.id);\n\t\t\tutils.show($('.customer-service')[0]);\n\t\t}\n\t}\n\n\t//cs组件初始化\n\tvar init = function(config){\n\t\tRCS.config = config;\n\t\tvar callbacks = {\n\t\t\tgetInstance : function(instance){\n\t\t\t\tvar callback = function(){\n\t\t\t\t\tif (RCS.config.templates) {\n\t\t\t\t\t\tfor (var index in RCS.config.templates) {\n\t\t\t\t\t\t\tif (!RCS.config.showButton && index == 'button') {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemplates[index] = RCS.config.templates[index];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetTemplates(callback);\n\t\t\t\temoji.init();\n\t\t\t\tRongIMLib.RongIMVoice.init();\n\t\t\t\tregisterMessage();\n\t\t\t},\n\t\t\tgetCurrentUser : function(userInfo){\n\t\t\t\tconsole.log(userInfo.userId);\n\t\t\t},\n\t\t\tenterConversation : function(){\n\t\t\t\tconversation.id = config.customerServiceId;\n\t\t\t\tcreateButton(config);\n\t\t\t}\n\t\t};\n\t\tsdkInit(config,callbacks);\n\t};\n\n\t//H5唤醒键盘的时候输入框显示在视野内\n\tvar keyboard = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tsetTimeout(function(){\n\t\t\tthisTarget.scrollIntoView(true);\n\t\t},500)\n\t}\n\n\t//对外暴露\n\tRCS.init = init;\n\tRCS.send = send;\n\tRCS.keySend = keySend;\n\tRCS.showemoji = showemoji;\n\tRCS.chooseEmoji = chooseEmoji;\n\tRCS.loadHisMessages = loadHisMessages;\n\tRCS.scrollBottom = scrollBottom;\n\tRCS.imgUpload = imgUpload;\n\tRCS.fileUpload = fileUpload;\n\tRCS.switchPerson = switchPerson;\n\tRCS.endConversation = endConversation;\n\tRCS.play = play;\n\tRCS.playVideo = playVideo;\n\tRCS.minimize = minimize;\n\tRCS.showCommon = showCommon;\n\tRCS.confirm = confirm;\n\tRCS.close = close;\n\tRCS.evaluate = evaluate;\n\tRCS.star = star;\n\tRCS.startEvaluate = startEvaluate;\n\tRCS.leavemessage = leavemessage;\n\tRCS.leaveMessageComfirm = leaveMessageComfirm;\n\tRCS.validateUserInfo = validateUserInfo;\n\tRCS.validateLeaveMessage = validateLeaveMessage;\n\tRCS.viewImage = viewImage;\n\tRCS.escImageView = escImageView;\n\tRCS.userInfoClose = userInfoClose;\n\tRCS.userInfoConfirm = userInfoConfirm;\n\tRCS.getHistoryMsgFile = getHistoryMsgFile;\n\tRCS.keyboard = keyboard;\n\tRCS.chatEnd = chatEnd;\n})(RCS);"
  },
  {
    "path": "cs/jx/dist/cs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no\">\n<title>CS</title>\n</head>\n<body>\n\n<div id=\"rcs-app\"></div>\n\n<link rel=\"stylesheet\" href=\"cs.min.css\">\n<!-- 可以将 SDK 下载到本地 配置 gruntfile 与 cs.js 合并压缩成一个 js 文件 -->\n<script src=\"../RongIMLib-cs.min.js\"></script>\n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n<script src=\"cs.min.js\"></script>\n<script>\n    RCS.init({\n        appKey: \"c9kqb3rdkbb8j\",\n        token: \"EiFGNTHsjHoqFIGMw0i+fTVgZOtrWuESz8LGXFTVIuFwBdLHjemfRLzTJV3cATKarp3q8R5dDnSak2GABioMEw==\",\n        target: document.getElementById('rcs-app'),\n        customerServiceId: \"service\", // 客服Id\n        upload: {\n            fileServer: \"http://upload.qiniu.com\",// 文件服务器地址\n            isPrivate: false // 是否是私有云\n        },\n        userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像，在用户没有头像的时候显示\n        csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像，在客服没有头像的时候显示,建议线上地址\n        showButton: true,\n        //是否需要按钮主动发起，设为false的时候，init()方法直接唤起聊天窗口,需客户自己编写按钮，点击之后调用init(),templates中的button模板不可用;设为true的时候，init()首先唤起客服咨询按钮，点击之后才连接客服，唤起聊天窗口，在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token，在获取到token之后，执行init()即可。\n        connectingCallback: function(){\n            console.log('连接中');\n        },//连接中的执行的方法，例如显示加载页面,可不传\n        connectedCallback: function(){},//连接成功之后的方法，例如关闭加载页面,可不传\n        disconnectedCallback: function(){\n            alert('连接断开');\n        },//断开连接之后的操作,可不传\n        templates: {\n            button: ['<div class=\"rongcloud-consult\">',\n                    '   <button onclick=\"RCS.showCommon()\"><span>客服咨询</span></button>',\n                    '</div>',\n                    '<div class=\"customer-service\" style=\"display: none;\"></div>'].join('')//\"templates/button.html\",\n            // chat: \"templates/chat.html\",\n            // closebefore: 'templates/closebefore.html',\n            // conversation: 'templates/conversation.html',\n            // endconversation: 'templates/endconversation.html',\n            // evaluate: 'templates/evaluate.html',\n            // imageView: 'templates/imageView.html',\n            // leaveword: 'templates/leaveword.html',\n            // main: 'templates/main.html',\n            // message: 'templates/message.html',\n            // messageTemplate: 'templates/messageTemplate.html',\n            // userInfo: 'templates/userInfo.html', \n        },\n        extraInfo: {\n            // 当前登陆用户信息\n            userInfo: {\n                name: \"游客\",\n                grade: \"VIP\"\n            },\n            // 产品信息\n            requestInfo: {\n                productId: \"123\",\n                referrer: \"10001\",\n                define: \"\" // 自定义信息\n            }\n        }\n    });\n</script>\n</body>\n</html>"
  },
  {
    "path": "cs/jx/emoji.js",
    "content": ";(function(RCS){\n\tvar emoji = {\n\t\tinit : function(){\n\t\t\tRongIMLib.RongIMEmoji.init();\n\t\t},\n\t\temojiToHTML : function(emojiContent){\n            return RongIMLib.RongIMEmoji.emojiToHTML(emojiContent,24);\n        },\n        symbolToEmoji : function(sym){\n            return RongIMLib.RongIMEmoji.symbolToEmoji(sym);\n        },\n        getEmoji : function(){\n            return RongIMLib.RongIMEmoji.list.map(function(data) {\n                return data.node;\n            });\n        }\n\t}\n\tRCS.emoji = emoji;\n})(RCS);"
  },
  {
    "path": "cs/jx/package.json",
    "content": "{\n  \"name\": \"customer-service\",\n  \"version\": \"1.0.0\",\n  \"description\": \"customerService\",\n  \"scripts\": {\n    \"dist\": \"grunt dist\"\n  },\n  \"devDependencies\": {\n    \"glog\": \"^1.7.0\",\n    \"grunt\": \"^1.0.1\",\n    \"grunt-contrib-clean\": \"^1.1.0\",\n    \"grunt-contrib-concat\": \"^1.0.1\",\n    \"grunt-contrib-cssmin\": \"^2.2.0\",\n    \"grunt-contrib-uglify\": \"^3.0.1\"\n  }\n}\n"
  },
  {
    "path": "cs/jx/phiz.js",
    "content": ";(function (global, factory) {\n    'use strict';\n    if (typeof exports === 'object' && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMPhiz = factory();\n    }\n})(window, function() {\n    var phizFactory = {\n        \"):\": { \"position\": \"0px 0px\" },\n        \":D\": { \"position\": \"0px -32px\" },\n        \";)\": { \"position\": \"0px -64px\" },\n        \":-o\": { \"position\": \"0px -96px\" },\n        \":p\": { \"position\": \"0px -128px\" },\n        \"(H)\": { \"position\": \"0px -160px\" },\n        \":@\": { \"position\": \"0px -192px\" },\n        \":s\": { \"position\": \"0px -224px\" },\n        \":$\": { \"position\": \"0px -256px\" },\n        \":(\": { \"position\": \"0px -288px\" },\n        \":'(\": { \"position\": \"0px -320px\" },\n        \":|\": { \"position\": \"0px -352px\" },\n        \"(a)\": { \"position\": \"0px -384px\" },\n        \"8o|\": { \"position\": \"0px -416px\" },\n        \"8-|\": { \"position\": \"0px -448px\" },\n        \"+o(\": { \"position\": \"0px -480px\" },\n        \"<o)\": { \"position\": \"0px -512px\" },\n        \"|-)\": { \"position\": \"0px -544px\" },\n        \"*-)\": { \"position\": \"0px -576px\" },\n        \":-#\": { \"position\": \"0px -608px\" },\n        \":-*\": { \"position\": \"0px -640px\" },\n        \"^o)\": { \"position\": \"0px -672px\" },\n        \"8-)\": { \"position\": \"0px -704px\" },\n        \"(|)\": { \"position\": \"0px -736px\" },\n        \"(u)\": { \"position\": \"0px -768px\" },\n        \"(S)\": { \"position\": \"0px -800px\" },\n        \"(*)\": { \"position\": \"0px -832px\" },\n        \"(#)\": { \"position\": \"0px -864px\" },\n        \"(R)\": { \"position\": \"0px -896px\" },\n        \"({)\": { \"position\": \"0px -928px\" },\n        \"(})\": { \"position\": \"0px -960px\" },\n        \"(k)\": { \"position\": \"0px -992px\" },\n        \"(F)\": { \"position\": \"0px -1024px\" },\n        \"(W)\": { \"position\": \"0px -1056px\" },\n        \"(D)\": { \"position\": \"0px -1088px\" }\n    };\n\n    var codeReg;\n\n    var configs = {\n        url: \"./images/phiz.png\",\n        size: 24\n    };\n\n    var setupCodeReg = function() {\n        var codeList = [];\n        for (var key in phizFactory) {\n            var code = key;\n            key = key.replace(/\\(|\\)|\\+|\\<|\\>|\\*/g, function(k) {\n                return \"\\\\\" + k;\n            });\n            codeList.push(key);\n        }\n        codeReg = codeList.join(\"|\");\n        codeReg = new RegExp(codeReg, \"g\");\n    };\n\n    var addBaseCss = function() {\n        var baseCss = \".rong-phiz-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden; }\";\n        var style = document.createElement(\"style\");\n        style.setAttribute(\"type\", \"text/css\");\n        var head = document.getElementsByTagName('head')[0];\n        head.appendChild(style);\n        if (style.styleSheet) {\n            style.styleSheet.cssText = baseCss;\n        } else {\n            head = document.createTextNode(baseCss);\n            style.appendChild(head);\n        }\n    };\n\n    var createEmojiDom = function(item, sizePx) {\n        var position = computeBgPosition(item.position, sizePx);\n        if (document.all && !document.addEventListener) {\n            position = item.position;\n        }\n        var emojiObj = {\n            size: sizePx || configs.size,\n            position: position,\n            background: configs.url,\n            name: item.code,\n            tag: item.code\n        };\n        return getEmojiShadowDom(emojiObj);\n    };\n\n    var getEmojiShadowDom = function(object) {\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: {{size}}px auto;\";\n        var spanTpl = \"<span class='rong-phiz-content' name='[{{name}}]' style='{{style}}''></span>\"\n        spanTpl = spanTpl.replace(/{{style}}/g, style);\n        var ret = spanTpl.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n            return object[name];\n        });\n        return ret;\n    };\n\n    var computeBgPosition = function(pos, sizePx) {\n        var size = sizePx || configs.size;\n        var scale = size / 32;\n        var position = pos.split(\" \");\n        var x = position[0], y = position[1];\n        x = x ? x.split(\"px\")[0] : 0;\n        y = y ? y.split(\"px\")[0] : 0;\n        return parseInt(x) * scale + \"px \" + parseInt(y) * scale + \"px\";\n    };\n\n    var phizToHtml = function(string, sizePx) {\n        var bracketsRegExp = /\\[([^\\[\\]]+?)\\]/g;\n        return string.replace(bracketsRegExp, function(code) {\n            code = code.substring(1, code.length - 1);\n            if (code === \":&#39;(\") {\n                code = \":'(\";\n            }\n            if (code === \"&lt;o)\") {\n                code = \"<o)\";\n            }\n            var data = phizFactory[code];\n            if (data && data.position) {\n                var position = data[\"position\"]\n                var item = {\n                    position: position,\n                    code: code\n                };\n                return createEmojiDom(item, sizePx);\n            }\n            return code;\n        });\n    };\n\n    (function() {\n        addBaseCss();\n        setupCodeReg();\n    })();\n\n    return {\n        phizToHtml: phizToHtml\n    };\n\n});"
  },
  {
    "path": "cs/jx/qiniu-upload.js",
    "content": "(function(RCS) {\n\t//qiniu\n\tfunction forEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction buildUrl(url, items) {\n\t\tvar query = '';\n\t\tforEach(items, function(name, value) {\n\t\t\tif (name != 'token') {\n\t\t\t\tquery += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n\t\t\t}\n\t\t});\n\n\t\tif (query) {\n\t\t\turl += (url.indexOf('?') > 0 ? '&' : '?') + query;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tfunction encode2UTF8(argString) {\n\t\tif (argString === null || typeof argString === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\tvar string = (argString + ''); // .replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t\tvar utftext = '',\n\t\t\tstart, end, stringl = 0;\n\t\tstart = end = 0;\n\t\tstringl = string.length;\n\t\tfor (var n = 0; n < stringl; n++) {\n\t\t\tvar c1 = string.charCodeAt(n);\n\t\t\tvar enc = null;\n\n\t\t\tif (c1 < 128) {\n\t\t\t\tend++;\n\t\t\t} else if (c1 > 127 && c1 < 2048) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 6) | 192, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else if (c1 & 0xF800 ^ 0xD800 > 0) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else { // surrogate pairs\n\t\t\t\tif (c1 & 0xFC00 ^ 0xD800 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched trail surrogate at ' + n);\n\t\t\t\t}\n\t\t\t\tvar c2 = string.charCodeAt(++n);\n\t\t\t\tif (c2 & 0xFC00 ^ 0xDC00 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched lead surrogate at ' + (n - 1));\n\t\t\t\t}\n\t\t\t\tc1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (enc !== null) {\n\t\t\t\tif (end > start) {\n\t\t\t\t\tutftext += string.slice(start, end);\n\t\t\t\t}\n\t\t\t\tutftext += enc;\n\t\t\t\tstart = end = n + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end > start) {\n\t\t\tutftext += string.slice(start, stringl);\n\t\t}\n\n\t\treturn utftext;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction encode2Base64(data) {\n\t\tvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\tvar o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n\t\t\tac = 0,\n\t\t\tenc = '',\n\t\t\ttmp_arr = [];\n\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t}\n\n\t\tdata = encode2UTF8(data + '');\n\n\t\tdo { // pack three octets into four hexets\n\t\t\to1 = data.charCodeAt(i++);\n\t\t\to2 = data.charCodeAt(i++);\n\t\t\to3 = data.charCodeAt(i++);\n\n\t\t\tbits = o1 << 16 | o2 << 8 | o3;\n\n\t\t\th1 = bits >> 18 & 0x3f;\n\t\t\th2 = bits >> 12 & 0x3f;\n\t\t\th3 = bits >> 6 & 0x3f;\n\t\t\th4 = bits & 0x3f;\n\n\t\t\t// use hexets to index into b64, and append result to encoded string\n\t\t\ttmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n\t\t} while (i < data.length);\n\n\t\tenc = tmp_arr.join('');\n\n\t\tswitch (data.length % 3) {\n\t\t\tcase 1:\n\t\t\t\tenc = enc.slice(0, -2) + '==';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tenc = enc.slice(0, -1) + '=';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn enc;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction URLSafeBase64Encode(v) {\n\t\tv = encode2Base64(v);\n\t\treturn v.replace(/\\//g, '_').replace(/\\+/g, '-');\n\t}\n\n\tfunction chunkLastStep(data, opts, callback) {\n\t\t// 七牛 URL 规定\n\t\tvar key = '/key/' + URLSafeBase64Encode(data.filename);\n\t\tvar fname = '/fname/' + URLSafeBase64Encode(data.filename);\n\t\tvar url = opts.domain + '/mkfile/' + data.size + key + fname;\n\t\tvar options = {\n\t\t\tdomain: url,\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/octet-stream'\n\t\t\t},\n\t\t\tmulti_parmas: opts.multi_parmas,\n\t\t\tsupport_options: true,\n\t\t\tstream: true\n\t\t};\n\t\tuploadData(data.ctx, options, {\n\t\t\tonCompleted: function(res) {\n\t\t\t\tres.filename = data.filename;\n\t\t\t\tres.name = data.name;\n\t\t\t\tcallback.onCompleted(res);\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tvar offset = 0,\n\t\tctxStore = {};\n\n\tfunction uploadNextChunk(blob, opts, callback) {\n\t\tvar chunk = Math.ceil(offset / opts.chunk_size),\n\t\t\tchunks = Math.ceil(blob.size / opts.chunk_size),\n\t\t\tcurChunkSize = Math.min(opts.chunk_size, blob.size - offset),\n\t\t\tchunkBlob = blob.slice(offset, offset + curChunkSize),\n\t\t\tchunkInfo = {\n\t\t\t\tchunk: chunk,\n\t\t\t\tchunks: chunks,\n\t\t\t\tname: blob.uniqueName\n\t\t\t};\n\t\tforEach(chunkInfo, function(key, value) {\n\t\t\topts.multi_parmas[key] = value;\n\t\t});\n\t\topts.filesize = blob.size;\n\t\topts.headers = {\n\t\t\t'Content-Type': 'application/octet-stream'\n\t\t};\n\t\topts.isChunk = true;\n\t\tuploadData(chunkBlob, opts, {\n\t\t\tonCompleted: function(chunkRes) {\n\t\t\t\toffset += curChunkSize;\n\t\t\t\t// callback.onProgress(Math.floor((chunk + 1) / chunks * blob.size), blob.size);\n\t\t\t\tctxStore[blob.uniqueName] = ctxStore[blob.uniqueName] || [];\n\t\t\t\tctxStore[blob.uniqueName].push(chunkRes.ctx);\n\t\t\t\tif (offset < blob.size) {\n\t\t\t\t\tif (chunkRes.ctx) {\n\t\t\t\t\t\tuploadNextChunk(blob, opts, callback);\n\t\t\t\t\t}else{\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tdelete ctxStore[blob.uniqueName]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toffset = 0;\n\t\t\t\t\tdelete opts.isChunk;\n\t\t\t\t\tdelete opts.headers['Content-Type'];\n\t\t\t\t\tforEach(chunkInfo, function(key, value) {\n\t\t\t\t\t\tdelete opts.multi_parmas[key];\n\t\t\t\t\t});\n\t\t\t\t\tvar ctx = ctxStore[blob.uniqueName].join(',');\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\tctx: ctx,\n\t\t\t\t\t\tname: blob.name,\n\t\t\t\t\t\tsize: blob.size,\n\t\t\t\t\t\tfilename: blob.uniqueName\n\t\t\t\t\t};\n\t\t\t\t\tchunkLastStep(data, opts, callback);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {\n\t\t\t\tvar loaded = chunkLoaded + offset;\n\t\t\t\tcallback.onProgress(loaded, opts.filesize);\n\t\t\t},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction uploadData(data, options, callback) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\tif (xhr.upload && options.support_options) {\n\t\t\txhr.upload.onprogress = function(event) {\n\t\t\t\tcallback.onProgress(event.loaded, event.total);\n\t\t\t};\n\t\t}\n\n\t\txhr.onreadystatechange = function() {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tvar result = xhr.responseText || \"{}\";\n\t\t\t\tresult = JSON.parse(result);\n\t\t\t\tresult.filename = options.unique_value;\n\t\t\t\tcallback.onCompleted(result);\n\t\t\t}\n\t\t};\n\n\t\tvar url = options.domain;\n\t\tif (options.isChunk) {\n\t\t\turl += '/mkblk/' + data.size;\n\t\t\turl = buildUrl(url, options.multi_parmas);\n\t\t}\n\t\txhr.open(options.method, url, true);\n\n\t\tcallback.onOpen(xhr);\n\n\t\tif (options.stream) {\n\t\t\txhr.setRequestHeader('authorization', 'UpToken ' + options.multi_parmas.token);\n\t\t}\n\n\t\tforEach(options.headers, function(key, value) {\n\t\t\txhr.setRequestHeader(key, value);\n\t\t});\n\t\txhr.send(data);\n\t}\n\n\tfunction uploadQiniu(file, opts, callback) {\n\t\tif (file.size && opts.chunk_size < file.size) {\n\t\t\tvar uniqueName = opts['genUId'](file);\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tuniqueName = uniqueName + suffix;\n\t\t\tfile.uniqueName = uniqueName;\n\t\t\topts.stream = true;\n\t\t\tuploadNextChunk(file, opts, callback);\n\t\t} else {\n\t\t\tvar data = opts['data'](file, opts);\n\t\t\tuploadData(data, opts, callback);\n\t\t}\n\t}\n\tvar uploadProcess = uploadQiniu;\n\n\n\n\t//upload\n\tvar dataType = {\n\t\tform: getFormData,\n\t\tjson: getJsonData,\n\t\tdata: getData\n\t};\n\tvar fileConfig = { \n\t\tdomain: 'http://upload.qiniu.com',\n\t\tfileType: RongIMLib.FileType.IMAGE,\n\t\tgetToken: function(callback){\n\t\t\t/****************************\n\t\t\t * 使用融云文件存储注意事项：\n\t\t\t * 1、有效期为 1 个月。\n\t\t\t * 2、文件不可迁移。\n\t\t\t ****************************\n\t\t\t */\n\t\t\tRongIMClient.getInstance().getFileToken(this.fileType, {\n\t\t\t\tonSuccess: function(data){\n\t\t\t\t\tcallback(data.token);\n\t\t\t\t},\n\t\t\t\tonError: function(error){\n\t\t\t\t\tconsole.log('获取上传token失败');\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\tfunction genUId() {\n\t\tvar date = new Date().getTime();\n\t\tvar uuid = 'xxxxxx4xxxyxxxxxxx'.replace(/[xy]/g, function(c) {\n\t\t\tvar r = (date + Math.random() * 16) % 16 | 0;\n\t\t\tdate = Math.floor(date / 16);\n\t\t\treturn (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n\t\t});\n\t\treturn uuid;\n\t};\n\n\tfunction mergeOption(opts) {\n\t\tvar options = {\n\t\t\tdomain: '',\n\t\t\tmethod: 'POST',\n\t\t\tfile_data_name: 'file',\n\t\t\tunique_key: 'key',\n\t\t\tbase64_size: 4 * 1024 * 1024,\n\t\t\tchunk_size: 4 * 1024 * 1024,\n\t\t\theaders: {},\n\t\t\tmulti_parmas: {},\n\t\t\tquery: {},\n\t\t\tsupport_options: true,\n\t\t\tdata: dataType.form,\n\t\t\tgenUId: genUId\n\t\t};\n\t\tif (!opts || !opts.domain) {\n\t\t\tthrow new Error('domain is null');\n\t\t}\n\t\tfor (var key in opts) {\n\t\t\toptions[key] = opts[key];\n\t\t}\n\t\treturn options;\n\t}\n\n\tfunction mEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction getFormData(file, opts) {\n\t\tvar form = new FormData();\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tform.append(opts.unique_key, unique_value);\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tform.append(opts.file_data_name, file);\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tform.append(key, value);\n\t\t});\n\t\treturn form;\n\t}\n\n\tfunction getJsonData(file, opts) {\n\t\tvar data = {};\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tdata[opts.unique_key] = unique_value;\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tdata[opts.file_data_name] = file;\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tdata[key] = value;\n\t\t});\n\t\treturn JSON.stringify(data);\n\t}\n\n\tfunction getData(file, opts) {\n\t\treturn file;\n\t}\n\n\tfunction Upload(options) {\n\t\tthis.options = mergeOption(options);\n\n\t\tthis.setOptions = function(opts) {\n\t\t\tvar me = this;\n\t\t\tmEach(opts, function(key, value) {\n\t\t\t\tme.options[key] = value;\n\t\t\t});\n\t\t};\n\n\t\tthis.upload = function(file, callback) {\n\t\t\tif (!file) {\n\t\t\t\tcallback.onError('upload file is null.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar me = this;\n\t\t\tuploadProcess(file, this.options, {\n\t\t\t\tonProgress: function(loaded, total) {\n\t\t\t\t\tcallback.onProgress(loaded, total);\n\t\t\t\t},\n\t\t\t\tonCompleted: function(data) {\n\t\t\t\t\tcallback.onCompleted(data);\n\t\t\t\t},\n\t\t\t\tonError: function(errorCode) {\n\t\t\t\t\tcallback.onError(errorCode);\n\t\t\t\t},\n\t\t\t\tonOpen: function(xhr) {\n\t\t\t\t\tme.xhr = xhr;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tthis.cancel = function() {\n\t\t\tthis.xhr && this.xhr.abort();\n\t\t};\n\t}\n\n\tfunction init(options) {\n\t\treturn new Upload(options);\n\t}\n\n\tfunction getResizeRatio(imageInfo,config){\n\t\t//hasOwnProperty?\n\n\t\tvar ratio = 1;\n\n\t\tvar oWidth = imageInfo.width;\n\t\tvar maxWidth = config.maxWidth || 0;\n\t\tif(maxWidth > 0 &&  oWidth > maxWidth){\n\t\t\tratio = maxWidth/oWidth;\n\t\t}\n\n\t\tvar oHeight = imageInfo.height;\n\t\tvar maxHeight = config.maxHeight || 0;\n\t\tif(maxHeight > 0 && oHeight > maxHeight){\n\t\t\tvar ratioHeight = maxHeight/oHeight;\n\t\t\tratio = Math.min(ratio,ratioHeight);\n\t\t}\n\n\n\t\tvar maxSize = config.maxSize || 0;\n\t\tvar oSize = Math.ceil(imageInfo.size/1000); //K，Math.ceil(0.3) = 1;\n\t\tif(oSize > maxSize){\n\t\t\tratioSize = maxSize/oSize;\n\t\t\tratio = Math.min(ratio,ratioSize);\n\t\t}\n\n\t\treturn ratio;\n\t}\n\n\tfunction resize(file,config,callback){\n\t\t//file对象没有高宽\n\t\tvar type = file.type; //image format\n\t\tvar canvas = document.createElement(\"canvas\");\n\n\t\tvar reader = new FileReader();\n\n    \treader.readAsDataURL(file);\n\t\treader.onload = function(evt){\n\t\t\tvar imageData = evt.target.result;\n\t\t\tvar img = new Image();\n\t\t\timg.src  = imageData;\n\t\t\tvar width = img.width;\n\t\t\tvar height = img.height;\n\t\t\tvar imageInfo = {\n\t\t\t\twidth : width,\n\t\t\t\theight : height,\n\t\t\t\tsize : evt.total\n\t\t\t}\n\t\t\tvar ratio = getResizeRatio(imageInfo,config);\n\t\t\tvar newImageData = imageData;\n\t\t\tif(ratio < 1){\n\t\t\t\tnewImageData = compress(img, width*ratio, height*ratio);;\n\t\t\t}\n\t\t\tcallback(newImageData);\n\t\t}\n\n\t\tfunction compress(img, width, height){\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\tvar context = canvas.getContext('2d');\n\t\t\t\tcontext.drawImage(img, 0, 0, width, height);\n\n\t\t\t/*\n\t\t\tIf the height or width of the canvas is 0, the string \"data:,\" is returned.\n\t\t\tIf the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.\n\t\t\tChrome also supports the image/webp type.\n\t\t\t*/ \n\n\t\t\tvar supportTypes = {\n\t\t\t\t\"image/jpg\" : true,\n\t\t\t\t\"image/png\" : true,\n\t\t\t\t\"image/webp\" : supportWebP()\n\t\t\t};\n\t\t\t// var exportType = \"image/png\";\n\t\t\t// if(supportTypes[type]){\n\t\t\t// \texportType = type;\n\t\t\t// } \n\t\t\t// 多端一致，缩略图必须是 jpg \n\t\t\tvar exportType = \"image/jpg\";\n\t\t\tvar newImageData = canvas.toDataURL(exportType);\n\t\t\treturn newImageData;\n\t\t}\n\n\t\tfunction supportWebP(){\n\t\t\ttry{\n        \t\treturn (canvas.toDataURL('image/webp').indexOf('data:image/webp') == 0);\n    \t\t}catch(err) {\n\t\t        return  false;\n\t\t    }\n\t\t}\n\t}\n\n\tvar calcPosition = function(width, height, opts) {\n        var isheight = width < height;\n        var scale = isheight ? height / width : width / height;\n        var zoom, x = 0,\n            y = 0,\n            w, h;\n\n        var gtScale = function() {\n            if (isheight) {\n                zoom = width / 100;\n                w = 100;\n                h = height / zoom;\n                y = (h - opts.maxHeight) / 2;\n            } else {\n                zoom = height / 100;\n                h = 100;\n                w = width / zoom;\n                x = (w - opts.maxWidth) / 2;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        \n        var ltScale = function() {\n            if (isheight) {\n                zoom = height / opts.maxHeight;\n                h = opts.maxHeight;\n                w = width / zoom;\n            } else {\n                zoom = width / opts.maxWidth;\n                w = opts.maxWidth;\n                h = height / zoom;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        return scale > opts.scale ? gtScale() : ltScale();\n    };\n\n    var getBlobUrl = function(file) {\n        var URL = window.URL || window.webkitURL;\n        return URL ? URL.createObjectURL(file) : \"\";\n    };\n\n    var getThumbnail = function(file, opts, callback) {\n        var canvas = document.createElement(\"canvas\"),\n            context = canvas.getContext('2d');\n        var img = new Image();\n        img.onload = function() {\n            var pos = calcPosition(img.width, img.height, opts);\n            canvas.width = pos.w > opts.maxWidth ? opts.maxWidth : pos.w;\n            canvas.height = pos.h > opts.maxHeight ? opts.maxHeight : pos.h;\n            context.drawImage(img, pos.x, pos.y, pos.w, pos.h);\n            try {\n                var base64 = canvas.toDataURL(file.type, opts.quality);\n                var reg = new RegExp('^data:image/[^;]+;base64,');\n                base64 = base64.replace(reg, '');\n                callback(base64);\n            } catch (e) {\n                throw new Error(e);\n            }\n        };\n        img.src = typeof file == 'string' ? 'data:image/jpg;base64,' + file : getBlobUrl(file);\n    };\n\n    var _compress = function(data, callback) {\n        var file = data.file;\n        var opts = data.compress;\n        getThumbnail(file, opts, callback);\n    };\n\n    _init = function(config, callback) {\n        if (config.getToken) {\n            config.getToken(function(token) {\n                config.multi_parmas || (config.multi_parmas = {});\n                config.multi_parmas.token = token;\n                config.headers || (config.headers = {});\n                if (config.base64) {\n                    config.headers['Content-type'] = 'application/octet-stream';\n                    config.headers['Authorization'] = 'UpToken ' + token;\n                }\n                var instance = init(config);\n                callback(instance);\n            });\n        } else {\n            config.headers || (config.headers = {});\n            if (config.base64) {\n                config.headers['Content-type'] = 'application/octet-stream';\n            }\n            var instance = init(config);\n            callback(instance);\n        }\n    };\n\n    var _upload = function(data, instance, callback) {\n        instance.upload(data.file, {\n            onError: function(errorCode) {\n                callback.onError(errorCode);\n            },\n            onProgress: function(loaded, total) {\n                callback.onProgress(loaded, total);\n            },\n            onCompleted: function(result) {\n                result.filename || (result.filename = result.hash);\n                var compress = data.compressThumbnail || _compress;\n                if (data.compress) {\n                    compress(data, function(thumbnail) {\n                        result.thumbnail = thumbnail;\n                        callback.onCompleted(result);\n                    });\n                } else {\n                    callback.onCompleted(result);\n                }\n            }\n        });\n    };\n\n    var File = function(instance) {\n        var me = this;\n        this.instance = instance\n        this.upload = function(file, callback) {\n            var data = {\n                file: file\n            };\n            _upload(data, me.instance, callback);\n        };\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initFile = function(config, callback) {\n        _init(config, function(instance) {\n            var UploadFile = new File(instance);\n            callback(UploadFile);\n        });\n    };\n\n    var Img = function(instance, cfg) {\n        var me = this;\n        this.cfg = cfg;\n        this.instance = instance;\n        this.upload = function(file, callback) {\n            var data = {\n                file: file,\n                compress: me.cfg\n            };\n            _upload(data, me.instance, callback);\n        };\n\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initImage = function(config, callback) {\n        _init(config, function(instance) {\n            var compress = {\n                maxHeight: config.height || 240,\n                maxWidth: config.width || 240,\n                quality: config.quality || 0.5,\n                scale: config.scale || 2.4\n            };\n            var uploadImage = new Img(instance, compress);\n            callback(uploadImage);\n        });\n    };\n\n    var ImgBase64 = function(config) {\n        config.base64 = true;\n        Img.call(this, config);\n    };\n\n    var initImgBase64 = function(config, callback) {\n        config.base64 = true;\n        initImage.call(this, config, callback);\n    };\n    var initType = {\n        file: function(file,config,callback){\n            initFile(config, function(uploadFile){\n                uploadFile.upload(file, callback);\n            });\n        },\n        image: function(file,config,callback){\n            initImage(config, function(uploadFile){\n                uploadFile.upload(file, callback);\n            });\n        }\n    };\n\n    var imageStartUpload = function(_file,onSuccess){\n    \tvar callback = {\n\t\t\tonError\t: function (errorCode) { \n\t\t\t\tconsole.log(errorCode);\n\t\t\t},\n\t\t\tonProgress : function (loaded, total) {\n\t\t\t\t// var percent = Math.floor(loaded/total*100);\n\t\t\t\t// var progressBar \t= document.getElementById('progressBar'),\n\t\t\t\t// \tprogressContent = document.getElementById('progressContent');\n\t\t\t\t// \tprogressBar.style.width = percent + '%';\n\t   //      \t\tprogressContent.innerHTML = percent + \"%\";\n\t\t\t},\n\t\t\tonCompleted : function (data) {\n\t\t\t\tdata.fileType = 'image';\n\t\t\t\tonSuccess(data);\n\t\t\t} \n\t\t};\n    \tinitType['image'](_file,fileConfig,callback);\n    }\n    var fileStartUpload = function(_file,onSuccess){\n    \tfileConfig.fileType = RongIMLib.FileType.FILE;\n    \tvar callback = {\n\t\t\tonError\t: function (errorCode) { \n\t\t\t\tconsole.log(errorCode);\n\t\t\t},\n\t\t\tonProgress : function (loaded, total) {\n\t\t\t\t// var percent = Math.floor(loaded/total*100);\n\t\t\t\t// var progressBar \t= document.getElementById('progressBar'),\n\t\t\t\t// \tprogressContent = document.getElementById('progressContent');\n\t\t\t\t// \tprogressBar.style.width = percent + '%';\n\t   //      \t\tprogressContent.innerHTML = percent + \"%\";\n\t\t\t},\n\t\t\tonCompleted : function (data) {\n\t\t\t\tdata.fileType = 'file';\n\t\t\t\tonSuccess(data);\n\t\t\t} \n\t\t};\n    \tinitType['file'](_file,fileConfig,callback);\n    }\n    \n    RCS.imageStartUpload = imageStartUpload;\n    RCS.fileStartUpload = fileStartUpload;\n    RCS.fileConfig = fileConfig;\n})(RCS);"
  },
  {
    "path": "cs/jx/template.js",
    "content": ";(function(RCS){\n\tvar getTemplates = function(callback){\n\t\tvar list = {\n\t        button: 'templates/button.html',\n\t        chat: 'templates/chat.html',\n\t        closebefore: 'templates/closebefore.html',\n\t        conversation: 'templates/conversation.html',\n\t        endconversation: 'templates/endconversation.html',\n\t        evaluate: 'templates/evaluate.html',\n\t        imageView: 'templates/imageView.html',\n\t        leaveword: 'templates/leaveword.html',\n\t        main: 'templates/main.html',\n\t        message: 'templates/message.html',\n\t        messageTemplate: 'templates/messageTemplate.html',\n\t        userInfo: 'templates/userInfo.html',\n\t    };\n\t    var templates = {};\n\t    for (var key in list) {\n\t    \tvar url = list[key];\n\t    \tvar html = RCS.templateCache[url];\n\t    \tif (html) {\n\t    \t\ttemplates[key] = html;\n\t    \t} else {\n\t\t    \tvar xhr = new XMLHttpRequest();\n\t\t    \txhr.open('get', url, false);\n\t\t    \txhr.onreadystatechange = function(){\n\t\t    \t\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\t    \t\t\ttemplates[key] = xhr.responseText;\n\t\t    \t\t}\n\t\t    \t}\n\t\t    \txhr.send(null);\n\t    \t}\n\n\t    }\n\t    return templates;\n\t}\n\tRCS.getTemplates = getTemplates;\n})(RCS);"
  },
  {
    "path": "cs/jx/templates/button.html",
    "content": "<!-- class=\"customer-service\"主页面容器，类名不能修改 -->\n{%if(this.showButton){%}\n<div class=\"rongcloud-consult\">\n    <button onclick=\"RCS.showCommon()\"><span>咨询客服</span></button>\n</div>{%}%}\n<div class=\"customer-service\" style=\"display: none;\"></div>"
  },
  {
    "path": "cs/jx/templates/chat.html",
    "content": "<!-- \nclass=\"rongcloud-text\"消息输入框; \nclass=\"rongcloud-expressionContent\"表情容器;\nclass=\"rcs-message-box\"消息列表容器;\nclass=\"rongcloud-Messages-history\"查看更多消息按钮;\nclass=\"rongcloud-mode1\"、class=\"rongcloud-mode2\"人工、机器人转换按钮的容器(机器人状态时，rongcloud-mode1隐藏，rongcloud-mode1显示);\nclass=\"rcs-connect-status\"connect断开时，状态显示的容器\nclass=\"imageViewBox\"图片预览容器\n以上类名不能被修改\n -->\n<div class=\"rongcloud-kefuChat\">\n    <div id=\"header\" class=\"rongcloud-rong-header rongcloud-blueBg rongcloud-online\">\n        {%if(this.terminal == 'phone'){%}\n        <span class=\"rongcloud-phone-exit\" onclick=\"RCS.endConversation()\"></span>\n        <div class=\"rongcloud-phone-infoBar\">\n            <span class=\"rongcloud-phone-kefuName\">客服</span>\n        </div>\n        {%}else{%}<div class=\"rongcloud-infoBar rongcloud-pull-left\">\n            <div class=\"rongcloud-infoBarTit\">\n                <span class=\"rongcloud-kefuName\">客服</span>\n            </div>\n        </div>\n        <div class=\"rongcloud-toolBar rongcloud-headBtn rongcloud-pull-right\">\n            <div class=\"rongcloud-voice\"></div>\n            <a onclick=\"RCS.minimize()\" class=\"rongcloud-kefuChatBoxHide rongcloud-sprite\" title=\"隐藏\"></a>\n            <a onclick=\"RCS.endConversation()\" class=\"rongcloud-kefuChatBoxClose rongcloud-sprite\" title=\"结束对话\"></a>\n        </div>{%}%}\n    </div>\n    <div class=\"rongcloud-outlineBox rcs-connect-status\" style=\"display:none;\">\n        <div class=\"rongcloud-sprite\"></div>\n        <span>连接断开,请刷新重连</span>\n    </div>\n    <div id=\"rcs-message-list\" class=\"rcs-message-box\">\n        {%this.messageList%}\n    </div>\n\n    <div id=\"rcs-chat-box\" class=\"rongcloud-rong-footer\">\n        <div class=\"rongcloud-footer-con\">\n            <div class=\"rongcloud-text-layout\">\n                <div id=\"funcPanel\" class=\"rongcloud-funcPanel rongcloud-robotMode\">\n                    <div class=\"rongcloud-mode1\" style=\"display: none;\">\n                        <div class=\"rongcloud-MessageForm-tool\" id=\"expressionWrap\" style=\"overflow: visible;\">\n                            <i class=\"rongcloud-sprite rongcloud-iconfont-smile\" onclick=\"RCS.showemoji(event)\"></i>\n                            <div class=\"rongcloud-expressionWrap\" onclick=\"RCS.chooseEmoji(event)\" style=\"display: none;\">\n                                <div class=\"rongcloud-expressionContent\"></div>\n                            </div>\n                        </div>\n                        <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-upload\" id=\"upload-image\">\n                            <input type=\"file\" multiple=\"multiple\" accept=\"image/png,image/gif,image/jpeg\" onchange=\"RCS.imgUpload(event)\"></input>\n                          </i>\n                        </div>\n                        <!-- <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-file\" id=\"upload-file\">\n                            <input type=\"file\" multiple=\"multiple\" onchange=\"RCS.fileUpload(event)\"></input>\n                          </i>\n                        </div> -->\n                        <!-- <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-download\" id=\"download-his\" onclick=\"RCS.getHistoryMsgFile()\">\n                          </i>\n                        </div> -->\n                        {%if(this.evaEntryPoint == 1){%}\n                        <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-evaluate\" onclick=\"RCS.startEvaluate(event)\">\n                          </i>\n                        </div>{%}%}\n                    </div>\n                    <div class=\"rongcloud-mode2\"><a onclick=\"RCS.switchPerson()\" id=\"chatSwitch\" class=\"rongcloud-chatSwitch\">转人工服务</a></div>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-footer-input\">\n            <div class=\"rongcloud-footer-textarea\"\">\n                <textarea class=\"rongcloud-text rongcloud-grey\" placeholder=\"请输入文字...\" onfocus=\"RCS.keyboard(event)\" onkeydown=\"RCS.keySend(event)\"></textarea>\n            </div>\n            <button type=\"button\" style=\"background-color: #0099ff;\" class=\"rongcloud-rong-btn rongcloud-rong-send-btn\" id=\"rong-sendBtn\" onclick=\"RCS.send(event)\">发送</button>\n        </div>\n    </div>\n</div>\n<div class=\"rebox imageViewBox\" onclick=\"RCS.escImageView()\" style=\"display: none;\">\n    \n</div>"
  },
  {
    "path": "cs/jx/templates/closebefore.html",
    "content": "<!-- 客服主动关闭弹出的页面 -->\n<div class=\"rongcloud-layermbox\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">客服会话已结束</p>\n                <div class=\"rongcloud-buttons\" onclick=\"RCS.chatEnd()\"><button class=\"rongcloud-button\">确定</button></div>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "cs/jx/templates/conversation.html",
    "content": "<!-- 会话列表每一个会话\nclass=\"rong-conversation\"会话列表中的每一个会话\n此类名不能被修改\n-->\n<div class=\"rong-conversation\" _cid=\"{%this.cid%}\" _name=\"{%this.name%}\">\n    <img src=\"https://bsetting60.ntalker.com/application/static/setting/images/head.jpg\" alt=\"\">\n    <span class=\"rong-conversation-name\">客服{%this.cid%} - {%this.name%}</span>\n    <div class=\"rong-conversation-message\">...</div>\n</div>"
  },
  {
    "path": "cs/jx/templates/endconversation.html",
    "content": "<!-- endconversation: 用户主动关闭弹出的页面  \nclass=\"rongcloud-layermbox\"弹出层容器\n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">是否要结束当前会话?</p>\n                <div class=\"rongcloud-buttons\"><button class=\"rongcloud-button\" onclick=\"RCS.confirm()\">是</button><button class=\"rongcloud-button\" onclick=\"RCS.close()\">否</button></div>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "cs/jx/templates/evaluate.html",
    "content": "<!-- evaluate: 评价页面  \nclass=\"rongcloud-evaluate\"评价弹出层容器 \n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox rongcloud-evaluate\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-evaluate\">\n                <div class=\"rongcloud-layer-title\">评价客服</div>\n                <div class=\"rongcloud-layer-body\">\n                    <div class=\"rongcloud-group-row\">\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(1)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(2)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(3)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(4)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(5)\"></span>\n                    </div>\n                </div>\n                <div class=\"rongcloud-foot\">\n                    <button class=\"rongcloud-evaluate-btn\" onclick=\"RCS.evaluate(true)\">提交</button><button class=\"rongcloud-evaluate-btn\" onclick=\"RCS.evaluate(false)\">取消</button>\n                </div>\n            </div>\n            <!--反馈提示-->\n            <!-- <div class=\"rongcloud-layermchild rongcloud-feedback\" ng-show=\"end\">\n                <div class=\"rongcloud-layermcont\">\n                    感谢您的反馈 ^ - ^ ！\n                </div>\n            </div> -->\n        </div>\n    </div>\n</div>\n"
  },
  {
    "path": "cs/jx/templates/imageView.html",
    "content": "<!-- imageView: 图片预览页面   -->\n<a href=\"#\" class=\"rebox-close rebox-button\">×</a>\n<div class=\"rebox-contents\">\n\t<img src=\"{%this.imageUrl%}\" class=\"rebox-content\">\n</div>\n"
  },
  {
    "path": "cs/jx/templates/import.html",
    "content": "<script id=\"rcs-templte-button\" type=\"rcs/templte\">\n\t<!--#include file=\"button.html\"-->\n</script>\n\n<script id=\"rcs-templte-main\" type=\"rcs/templte\">\n\t<!--#include file=\"main.html\"-->\n</script>\n\n<script id=\"rcs-templte-conversation\" type=\"rcs/templte\">\n\t<!--#include file=\"conversation.html\"-->\n</script>\n\n<script id=\"rcs-templte-chat\" type=\"rcs/templte\">\n\t<!--#include file=\"chat.html\"-->\n</script>\n\n<script id=\"rcs-templte-message\" type=\"rcs/templte\">\n\t<!--#include file=\"message.html\"-->\n</script>\n\n<script id=\"rcs-templte-message-template\" type=\"rcs/templte\">\n\t<!--#include file=\"messageTemplate.html\"-->\n</script>\n\n\n<script id=\"rcs-templte-closebefore\" type=\"rcs/templte\">\n\t<!--#include file=\"closebefore.html\"-->\n</script>\n\n<script id=\"rcs-templte-endconversation\" type=\"rcs/templte\">\n\t<!--#include file=\"endconversation.html\"-->\n</script>\n\n<script id=\"rcs-templte-evaluate\" type=\"rcs/templte\">\n\t<!--#include file=\"evaluate.html\"-->\n</script>\n\n<script id=\"rcs-templte-leaveword\" type=\"rcs/templte\">\n\t<!--#include file=\"leaveword.html\"-->\n</script>\n\n<script id=\"rcs-templte-imageView\" type=\"rcs/templte\">\n\t<!--#include file=\"imageView.html\"-->\n</script>\n\n<script id=\"rcs-templte-userInfo\" type=\"rcs/templte\">\n\t<!--#include file=\"userInfo.html\"-->\n</script>"
  },
  {
    "path": "cs/jx/templates/leaveword.html",
    "content": "<!-- leaveword: 留言页面  \nclass=\"rongcloud-leavemessage\"留言弹出层容器\n此类名不能被修改-->\n<div class=\"rongcloud-leavemessage\">\n    {%if(this.url){%}\n    <iframe id=\"leavewordIframe\" src=\"{%this.url%}\" frameborder=\"0\" width=\"100%;\" height=\"100%;\"></iframe>\n    {%}else{%}\n    <div class=\"rongcloud-leavemessage-title\">您好，请留言~</div>\n    <form>\n        {%for(var index in this.list){%}\n        <div class=\"rongcloud-form-item\">\n            <label class=\"{%if(this.list[index].required){%}{%'rongcloud-require'%}{%}%}\">{%this.list[index].title%}：</label>\n            {%if(this.list[index].type == 'text'){%}<input class=\"rongcloud-inputtext\" name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" type=\"text\" onblur=\"RCS.validateLeaveMessage({%index%}, event)\"></input>{%}else{%}\n            <textarea name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" onblur=\"RCS.validateLeaveMessage({%index%}, event)\"></textarea>{%}%}\n            <div class=\"rongcloud-form-error\" style=\"display: none;\"></div>\n        </div>{%}%}\n        <div class=\"rongcloud-leavemessage-form-btns\">\n            <button class=\"rongcloud-btn\" onclick=\"RCS.leaveMessageComfirm(event)\">提交</button>\n        </div>\n    </form>{%}%}\n</div>"
  },
  {
    "path": "cs/jx/templates/main.html",
    "content": "<!-- main: 包括客服列表和聊天窗口的主页面  \nclass=\"rcs-chat-wrapper\"聊天窗口的容器 \n此类名不能被修改\n-->\n<div id=\"rcs-main\" class=\"rongcloud-kefuListBox rongcloud-container\">\n    {%if(this.showConversitionList){%}<div class=\"rongcloud-kefuList\">\n        <div class=\"rongcloud-rong-header rongcloud-blueBg\">\n            <div class=\"rongcloud-toolBar rongcloud-headBtn\">\n                <div class=\"rongcloud-voice\"></div>\n                <div class=\"rongcloud-sprite rongcloud-people\"></div>\n                <span class=\"rongcloud-recent\">客服列表</span>\n                <div class=\"rongcloud-sprite rongcloud-arrow-down cursor-pointer\" onclick=\"RCS.minimize()\"></div>\n            </div>\n        </div>\n        <div class=\"rongcloud-content\">\n            <div class=\"rongcloud-netStatus\" style=\"display:none\">\n                <div class=\"rongcloud-sprite\"></div>\n                <span>连接断开,请刷新重连</span>\n            </div>\n            <div class=\"rcs-conversation-list\">\n                {%this.conversationList%}\n                <!-- <div class=\"rcs-conversation-item\"></div> -->\n            </div>\n        </div>\n    </div>{%}%}\n    <div class=\"rcs-chat-wrapper\"></div>\n</div>"
  },
  {
    "path": "cs/jx/templates/message.html",
    "content": "<!-- message: 消息list的页面 -->\n<div class=\"rong-message-list\">\n    {%if(this.firstEnter){%}<div class=\"rongcloud-Messages-history\" style=\"display: none;\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}else if(this.hasMore){%}<div class=\"rongcloud-Messages-history\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}%}{%else{%}<div class=\"rongcloud-Messages-history\"><b>没有更多消息</b></div>{%}%}\n    {%for(var index in this.list){%}{%switch(this.list[index].messageType){%}{%case 'TextMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">{%this.list[index].content.content%}</pre>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'ImageMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-img\">\n                <span class=\"rongcloud-Message-entry\">\n                    <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.list[index].content.imageUri%}\">\n                        <img src=\"{%this.list[index].content.imageUri%}\" data-img=\"{%this.list[index].content.imageUri%}\">\n                    </a>\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'FileMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user){%}{%this.list[index].content.user.name%}{%}else{%} {%'客服'%} {%}%}  {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-file\">\n                <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n                <div class=\"rongcloud-file-name\">{%this.list[index].content.name%}</div>\n                <div class=\"rongcloud-file-size\">{%this.list[index].content.size%}</div>\n                <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.list[index].content.fileUrl%}\" download=\"{%this.list[index].content.name%}\"></a>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'VoiceMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-audio\">\n                <span class=\"rongcloud-Message-entry\">\n                    {%if(this.messageDirection == 1){%}\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                        <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                    {%}else{%}\n                        <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                    {%}%}\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'TimeMessage':%}\n    <div class=\"rongcloud-Messages-date\">\n        <b>{%this.list[index].sentTime%}</b>\n    </div>{%break;%}\n    {%case 'InformationNotificationMessage':%}\n    <div class=\"rongcloud-sys-tips\">\n        <span>{%this.list[index].content.message%}</span>\n    </div>{%break;%}\n    {%case 'AlertMessage':%}\n    <div class=\"rongcloud-sys-tips\">\n        <span>{%this.list[index].content.content%}</span>\n    </div>{%break;%}\n    {%case 'SightMessage': %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n                <video poster=\"{% 'data:image/jpg;base64,' + this.list[index].content.content %}\" src=\"{% this.list[index].content.sightUrl %}\"></video>\n                <div class=\"play-btn\"></div>\n            </div>\n        </div>\n    </div>\n    {%break;%}\n    {%default: %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n            </div>\n        </div>\n    </div>{%}%}{%}%}\n</div>\n\n<!-- <div class=\"rongcloud-emptyBox\">暂时没有新消息</div> -->"
  },
  {
    "path": "cs/jx/templates/messageTemplate.html",
    "content": "<!-- messageTemplate: 一个消息的页面 -->\n<!-- class=\"rongcloud-audioState\"声音消息播放状态\nclass=\"rongcloud-audioBox\" 声音消息容器\n此类名不能被修改 -->\n{%switch(this.messageType){%}{%case 'TextMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">{%this.content.content%}</pre>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'ImageMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-img\">\n            <span class=\"rongcloud-Message-entry\">\n                <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.content.imageUri%}\">\n                    <img src=\"{%this.content.imageUri%}\" onload=\"RCS.scrollBottom()\" data-img=\"{%this.content.imageUri%}\">\n                </a>\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'FileMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-file\">\n            <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n            <div class=\"rongcloud-file-name\">{%this.content.name%}</div>\n            <div class=\"rongcloud-file-size\">{%this.content.size%}</div>\n            <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.content.fileUrl%}\" download=\"{%this.content.name%}\"></a>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'VoiceMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-audio\">\n            <span class=\"rongcloud-Message-entry\">\n                {%if(this.messageDirection == 1){%}\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                    </div>\n                    <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                {%}else{%}\n                    <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                        <span class=\"rongcloud-audioState\"></span>\n                    </div>\n                {%}%}\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'TimeMessage':%}\n<div class=\"rongcloud-Messages-date\">\n    <b>{%this.sentTime%}</b>\n</div>{%break;%}\n{%case 'InformationNotificationMessage':%}\n<div class=\"rongcloud-sys-tips\">\n    <span>{%this.content.message%}</span>\n</div>{%break;%}\n{%case 'AlertMessage':%}\n<div class=\"rongcloud-sys-tips\">\n    <span>{%this.content.content%}</span>\n</div>{%break;%}\n{%case 'SightMessage': %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n            <video poster=\"{% 'data:image/jpg;base64,' + this.content.content %}\" src=\"{% this.content.sightUrl %}\"></video>\n            <div class=\"play-btn\"></div>\n        </div>\n    </div>\n</div>\n{%break;%}\n{%default: %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n        </div>\n    </div>\n</div>{%}%}\n"
  },
  {
    "path": "cs/jx/templates/userInfo.html",
    "content": "<!-- userInfo: 收集用户信息的页面  \nclass=\"userInfoModel\"收集用户信息页面容器 \n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox userInfoModel\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-collectuserinfo\">\n                <form name='userinfo' novalidate=\"true\">\n                    <div class=\"rongcloud-layer-body\">\n                        <div class=\"rongcloud-collectuserinfo-title\">你好，客服邀请您填写如下内容</div>\n                        <a class=\"rongcloud-layer-close\" onclick=\"RCS.userInfoClose()\">×</a>\n                        {%for(var index in this.list){%}\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-form-label {%if(this.list[index].required == 1){%}{%'rongcloud-require'%}{%}%}\">{%this.list[index].label%}：</label>\n                            {%switch(this.list[index].type){%}{%case 'input':%}\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"{%this.list[index].name%}\" data-label=\"{%this.list[index].label%}\" data-pattern=\"{%this.list[index].rule%}\" placeholder=\"{%this.list[index].defaultText%}\" onblur=\"RCS.validateUserInfo(event)\" {%if(this.list[index].required == 1){%}{%'data-required = required'%}{%}%}></input>{%break;%}{%case 'textarea':%}\n                            <textarea name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" data-label=\"{%this.list[index].label%}\" data-pattern=\"{%this.list[index].rule%}\" onblur=\"RCS.validateUserInfo(event)\"></textarea>{%break;%}{%}%}\n                            <div class=\"rongcloud-form-error\" style=\"display: none;\"></div>\n                        </div>{%}%}\n                    </div>\n                    <div class=\"rongcloud-foot\">\n                        <button class=\"rongcloud-btn\" onclick=\"RCS.userInfoConfirm(event)\">提交</button>\n                    </div>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "cs/jx/ui.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>ui</title>\n</head>\n<body>\n<link rel=\"stylesheet\" href=\"cs.css\">\n\n\n<!-- conversationlist.tpl.html -->\n<!--#include file=\"templates/userInfo.html\"-->\n\n<div class=\"rongcloud-Message-body\">\n    <div class=\"rongcloud-Message-audio\">\n        <span class=\"rongcloud-Message-entry\">\n            <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick=\"RCS.play()\">\n                <i></i><i></i><i></i>\n            </span>\n            <div style=\"display:inline-block;\">\n                <span class=\"rongcloud-audioTimer\">{%this.list[index].content.duration%}</span>\n                <span class=\"rongcloud-audioState\"></span>\n            </div>\n        </span>\n    </div>\n</div>\n\n\n\n<!-- main.tpl.html -->\n<div id=\"rong-widget-box\" class=\"rongcloud-container\" style=\"display:none;\">\n    <div class=\"rong-conversation-list\">\n    </div>\n    <div id=\"rong-widget-minbtn\" class=\"rongcloud-kefuBtnBox rongcloud-blueBg\">\n      <a class=\"rongcloud-kefuBtn\" href=\"###\">\n          <div class=\"rongcloud-sprite rongcloud-people\"></div>\n          <span class=\"rongcloud-recent\">联系客服</span>\n          <span class=\"rongcloud-recent\"><span ng-show=\"twinkle\" >(有未读消息)</span></span>\n      </a>\n    </div>\n    <div id=\"rong-widget-minbtn-kefu\" class=\"rongcloud-kefuBtnBox rongcloud-blueBg\">\n      <a class=\"rongcloud-kefuBtn\" href=\"###\">\n          <div class=\"rongcloud-sprite rongcloud-people rongcloud-sprite-kefu\"></div>\n          <span class=\"rongcloud-recent\" >联系客服</span>\n      </a>\n    </div>\n</div>\n\n\n\n\n\n\n\n<!-- expand colsebefore.tpl.html -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">客服会话已结束</p>\n                <div class=\"rongcloud-buttons\" ng-click=\"confirm()\"><button class=\"rongcloud-button\">确定</button></div>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n<!-- expand customerinfo.tpl.html -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-collectuserinfo\">\n                <form name='userinfo' novalidate=\"true\">\n                    <div class=\"rongcloud-layer-body\">\n                        <div class=\"rongcloud-collectuserinfo-title\">你好，客服邀请您填写如下内容</div>\n                        <a class=\"rongcloud-layer-close\" href=\"#\" ng-click=\"close()\">×</a>\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-require\">姓名：</label>\n                            <input class=\"rongcloud-inputtext\"  type=\"text\" name=\"name\" required ng-model=\"user.name\"></input>\n                            <div class=\"rongcloud-form-error\" ng-show=\"(userinfo.name.$dirty || userinfo.$submitted) && userinfo.name.$error.required\">请输入姓名</div>\n                        </div>\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-require\">电话：</label>\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"phone\" required ng-model=\"user.phone\" ng-pattern=\"/^1[0-9]{10}$/\"></input>\n                            <div class=\"rongcloud-form-error\" ng-show=\"(userinfo.phone.$dirty || userinfo.$submitted) && userinfo.phone.$error.required\">请输入电话</div>\n                            <div class=\"rongcloud-form-error\" ng-show=\"(userinfo.phone.$dirty || userinfo.$submitted) && userinfo.phone.$error.pattern\">手机格式不正确</div>\n                        </div>\n                        <div class=\"rongcloud-form-item\">\n                            <label>邮箱：</label>\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"email\" ng-model=\"user.email\"></input>\n                        </div>\n                    </div>\n                    <div class=\"rongcloud-foot\">\n                        <button class=\"rongcloud-btn\" ng-click=\"userinfo.$valid && confirm()\">提交</button>\n                    </div>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n<!-- expand endconversation.tpl -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">是否要结束当前会话?</p>\n                <div class=\"rongcloud-buttons\" ng-click=\"confirm()\"><button class=\"rongcloud-button\">是</button><button class=\"rongcloud-button\" ng-click=\"close()\">否</button></div>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n<!-- expand evaluate.tpl -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-evaluate\">\n                <div class=\"rongcloud-layer-title\">服务评价</div><a href=\"#\" class=\"rongcloud-layer-close\" ng-click=\"close()\">×</a>\n                <div class=\"rongcloud-layer-body\">\n                    <div class=\"rongcloud-group-row\">\n                        <div class=\"rongcloud-group-title\">感谢您的支持，请对我的服务进行评价：</div>\n                        <label for=\"satisfaction5\"><input id=\"satisfaction5\" name=\"satisfaction\" type=\"radio\" value=\"5\" ng-model=\"source\"></input>非常满意</label>\n                        <label for=\"satisfaction4\"><input id=\"satisfaction4\" name=\"satisfaction\" type=\"radio\" value=\"4\" ng-model=\"source\"></input>满意</label>\n                        <label for=\"satisfaction3\"><input id=\"satisfaction3\" name=\"satisfaction\" type=\"radio\" value=\"3\" ng-model=\"source\"></input>一般</label>\n                        <label for=\"satisfaction2\"><input id=\"satisfaction2\" name=\"satisfaction\" type=\"radio\" value=\"2\" ng-model=\"source\"></input>不满意</label>\n                        <br/><label for=\"satisfaction1\"><input id=\"satisfaction1\" name=\"satisfaction\" type=\"radio\" value=\"1\" ng-model=\"source\"></input>非常不满意</label><br/>\n                    </div>\n                    <div class=\"rongcloud-group-row\" ng-show=\"showResolveStatus\">\n                        <div class=\"rongcloud-group-title\">是否解决问题：</div>\n                        <input id=\"resolve\"   name=\"result\" type=\"radio\" value=\"1\" ng-model=\"isresolve\"></input><label for=\"resolve\">已解决</label>\n                        <input id=\"followup\"  name=\"result\" type=\"radio\" value=\"2\" ng-model=\"isresolve\"></input><label for=\"followup\">跟进中</label>\n                        <input id=\"unresolve\" name=\"result\" type=\"radio\" value=\"0\" ng-model=\"isresolve\"></input><label for=\"unresolve\">未解决</label><br/>\n                    </div>\n                    <div class=\"rongcloud-group-row\">\n                        <div>建议：</div>\n                        <textarea class=\"rongcloud-suggest\" placeholder=\"谢谢您的反馈，我们会更加努力！\" ng-model=\"suggest\"></textarea>\n                    </div>\n                </div>\n                <div class=\"rongcloud-foot\">\n                    <button class=\"rongcloud-btn\" ng-click=\"confirm()\">评价</button>\n                </div>\n            </div>\n            <!--反馈提示-->\n            <!-- <div class=\"rongcloud-layermchild rongcloud-feedback\" ng-show=\"end\">\n                <div class=\"rongcloud-layermcont\">\n                    感谢您的反馈 ^ - ^ ！\n                </div>\n            </div> -->\n        </div>\n    </div>\n</div>\n\n\n<!-- expand leaveword -->\n<div class=\"rongcloud-leavemessage\" style=\"display:none;\">\n    <div class=\"rongcloud-leavemessage-title\">{{content}}</div>\n    <form name=\"leave\" novalidate>\n        <div class=\"rongcloud-form-item\" ng-repeat=\"item in formList\">\n            <label ng-class=\"{'rongcloud-require': item.required}\">{{item.title}}</label>\n            <input class=\"rongcloud-inputtext\" ng-if=\" item.type== 'text' \" name=\"{{item.name}}\" placeholder=\"{{item.defaultText}}\" type=\"text\" ng-model=\"item.value\" ng-blur=\"validateItem(item)\"></input>\n            <textarea name=\"leaveword\" ng-if=\" item.type =='textarea' \" name=\"{{item.name}}\" placeholder=\"{{item.defaultText}}\" ng-model=\"item.value\" ng-blur=\"validateItem(item)\"></textarea>\n            <div class=\"rongcloud-form-error\" ng-show=\"item.error\">{{item.error}}</div>\n        </div>\n        <div class=\"rongcloud-leavemessage-form-btns\">\n            <button class=\"rongcloud-btn\" ng-click=\"confirm()\">提交</button>\n        </div>\n    </form>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "cs/jx/utils.js",
    "content": ";var RCS = {\n    templateCache:{}\n};\n\n(function(RCS){\n    /*\n    var tpl = '<a>{{this.key1}} <p>-</p> {{this.value1.c}}</a>';\n    var data = {\"key1\":1,\"value1\":{\"c\":\"cccccc\"}};\n    var html = render(tpl,data);  \n    */\n    function render(template, data) {\n        template = template || \"\";\n        data = data || [\"\"];\n        var re = /{%((?:(?!%}).)+)%}/g, reExp = /(^( )?(var|if|for|else|switch|case|default|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n        var add = function(line, js) {\n            js? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n                (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n            return add;\n        }\n        var match;\n        while(match = re.exec(template)) {\n            add(template.slice(cursor, match.index))(match[1], true);\n            cursor = match.index + match[0].length;\n        }\n        add(template.substr(cursor, template.length - cursor));\n        code += 'return r.join(\"\");';\n        data = isNaN(data.length) ? [data] : data;\n        var html = \"\";\n        for(var i = 0, length = data.length; i < length; i++) {\n            html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n        }\n        return html;    \n    }\n\n\n    var utils = {\n        $ : function(selector){\n            return document.querySelectorAll(selector);\n        },\n        show : function(node){\n            node.style.display = \"block\";\n        },\n        hide : function(node){\n            node.style.display = \"none\";\n        },\n        removeNode : function(selector){\n            var thisNode = utils.$(selector)[0];\n            if (thisNode) {\n                thisNode.parentNode.removeChild(thisNode);\n            }\n        },\n        getStyle : function (node, prop) {\n            if(node.currentStyle) {\n                return node.currentStyle[prop] || '';\n            }\n            else if(window.getComputedStyle) {\n                return window.getComputedStyle(node , null)[prop];\n            }\n        },\n        indexOf : function (array, item) {\n            if (array.indexOf){\n                return array.indexOf(item);\n            }   \n            for (var i = 0, len = array.length; i < len; i++){\n                if (array[i] === item){\n                    return i;\n                }\n            }   \n            return -1;\n        },\n        copy : function(json1, json2, flag, fn){\n            fn = fn || function(e){return e;}\n            for (var key in json2){\n                if (flag || typeof json1[key] === 'undefined' || json1[key] === null){\n                    json1[key] = fn(json2[key]);\n                }\n            }\n            return json1;\n        },\n        isChild : function(node,nodeParent){\n            while (node && node.tagName && node.tagName.toLowerCase() != \"body\"){\n                if (node == nodeParent){\n                    return true;\n                }\n                node = node.parentNode;\n            }\n            return false;\n        },\n        getTime : function(time){\n            var nowDate = new Date();\n            var sendDate = new Date(time);\n            var dateStr = '';\n            if (nowDate.getFullYear() == sendDate.getFullYear() && nowDate.getMonth() == sendDate.getMonth() && nowDate.getDate() == sendDate.getDate()) {\n                dateStr = (sendDate.getHours()>9 ? sendDate.getHours():'0'+sendDate.getHours())+':'+(sendDate.getMinutes()>9 ? sendDate.getMinutes():'0'+sendDate.getMinutes());\n            } else {\n                dateStr = sendDate.getFullYear()+'-'+(sendDate.getMonth()>8 ? (sendDate.getMonth()+1):'0'+(sendDate.getMonth()+1))+'-'+(sendDate.getDate()>9 ? sendDate.getDate():'0'+sendDate.getDate())+' '+(sendDate.getHours()>9 ? sendDate.getHours():'0'+sendDate.getHours())+':'+(sendDate.getMinutes()>9 ? sendDate.getMinutes():'0'+sendDate.getMinutes());\n            }\n            return dateStr;\n        },\n        getFileSize : function(size){\n            var g = Math.pow(1024, 3);\n            var m = Math.pow(1024, 2);\n            var k = Math.pow(1024, 1);\n            if (size > g) {\n                size = (size / g).toFixed(2) + 'G';\n            } else if (size > m) {\n                size = (size / m).toFixed(2) + 'M';\n            } else if (size > k) {\n                size = (size / k).toFixed(2) + 'K';\n            } else {\n                size = size + 'B';\n            }\n            return size;\n        },\n        getFormValue : function(formArray){\n            var formData = {};\n            for (var i = 0; i < formArray.length; i++) {\n                formData[formArray[i]] = document.getElementsByName(formArray[i])[0].value;\n            }\n            return formData;\n        },\n        fadein : function(ele) {\n            ele.style.opacity = 0;\n            ele.style.display = \"block\";\n            if (ele) {\n                var v = 0;\n                var timer = null;\n                timer = setInterval(function() {\n                    v += 1;\n                    setOpacity(ele, v);\n                    if (v == 100) {\n                        clearInterval(timer);\n                    }\n                }, 1);\n            }\n        },\n        fadeout: function(ele) {\n            if (ele) {\n                var v = 100;\n                var timer = null;\n                timer = setInterval(function() {\n                    v -= 1;\n                    setOpacity(ele, v);\n                    if (v == 0) {\n                        ele.style.display = \"none\";\n                        clearInterval(timer);\n                    }\n                }, 1);\n            }\n        },\n        downloadHistoryMsgFile: function(url,name){\n            var a = document.createElement('a');\n            a.href = url;\n            a.setAttribute('download', name || '');\n            a.click();\n        },\n        encodeHtmlStr: function(str) {\n            var replaceRule = [\n                {\n                    symbol: '&',\n                    html: '&amp;'\n                },\n                //下述方法有问题,字符串中如有空格,会多加空格\n                //white-space: pre-wrap; 能实现同样效果,并支持ie9, 故注释掉\n                // {\n                //     symbol: '[\\\\u0020]',\n                //     html: '&nbsp;\\u0020'\n                // },\n                {\n                    symbol: '[\\\\u0009]',\n                    html: '&nbsp;&nbsp;&nbsp;&nbsp;\\u0020'\n                },\n                {\n                    symbol: '<',\n                    html: '&lt;'\n                },\n                {\n                    symbol: '>',\n                    html: '&gt;'\n                },\n                {\n                    symbol: '\"',\n                    html: '&quot;'\n                },\n                {\n                    symbol: '\\'',\n                    html: '&#39;'\n                },\n                {\n                    symbol: '\\\\n\\\\r',\n                    html: '<br/>'\n                },\n                {\n                    symbol: '\\\\r\\\\n',\n                    html: '<br/>'\n                },\n                {\n                    symbol: '\\\\n',\n                    html: '<br/>'\n                }\n            ];\n\n            for (var i = 0, len = replaceRule.length; i < len; i++) {\n                var rule = replaceRule[i];\n                var regExp = new RegExp(rule.symbol, 'g');\n                str = str.replace(regExp, rule.html);\n            }\n\n            return str;\n        },\n        replaceUri: function(str, callback) {\n            var result = '';\n            var protocol = '((?:http|https|ftp)\\\\:\\\\/\\\\/)?';\n            var ip = '(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])\\\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])';\n            var host = '(?!@)(?:[a-z0-9-]{1,36}\\\\.)+[a-z]{2,6}';\n            var port = '(?:\\\\:[0-9]{1,5})?';\n            var path = '(?:[a-zA-Z0-9.,;?\\\\\\'+&%$#=~_\\\\-!()*\\\\/]*)';\n            var uriReg = new RegExp(protocol + '(?:(?:' + ip + ')|(?:' + host +'))' + port + path, 'ig');\n\n            result = str.replace(uriReg, function(uriStr, prot) {\n                var lastIndex = arguments[arguments.length - 2];\n                var prevChar = str.substr(lastIndex - 1, 1);\n                var isEmail = prevChar === '@';\n                var notDomain = !chkDomain(uriStr, prot);\n                if (isEmail || notDomain) {\n                    return uriStr;\n                }\n                return callback.apply(null, arguments);\n            });\n            return result;\n        },\n        replaceEmail: function(str, callback) {\n            var result = '';\n            var emailReg = /\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*/gi;\n\n            result = str.replace(emailReg, callback);\n\n            return result;\n        },\n        cloneObj: function(obj){\n            var str, newobj = obj.constructor === Array ? [] : {};\n            if(typeof obj !== 'object'){\n                return;\n            } else if(window.JSON){\n                str = JSON.stringify(obj), //系列化对象\n                newobj = JSON.parse(str); //还原\n            } else {\n                for(var i in obj){\n                    newobj[i] = typeof obj[i] === 'object' ? \n                    cloneObj(obj[i]) : obj[i]; \n                }\n            }\n            return newobj;\n        },\n        //判断当前是否是移动端\n        browserRedirect: function(callback) {\n            var sUserAgent = navigator.userAgent.toLowerCase();\n            var bIsIpad = sUserAgent.match(/ipad/i) == \"ipad\";\n            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == \"iphone os\";\n            var bIsMidp = sUserAgent.match(/midp/i) == \"midp\";\n            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == \"rv:1.2.3.4\";\n            var bIsUc = sUserAgent.match(/ucweb/i) == \"ucweb\";\n            var bIsAndroid = sUserAgent.match(/android/i) == \"android\";\n            var bIsCE = sUserAgent.match(/windows ce/i) == \"windows ce\";\n            var bIsWM = sUserAgent.match(/windows mobile/i) == \"windows mobile\";\n            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {\n                callback(\"phone\");\n            } else {\n                callback(\"pc\");\n            }\n        }\n    };\n    var setOpacity = function(ele, opacity) {\n        if (ele.style.opacity != undefined) {\n            ///兼容FF和GG和新版本IE\n            ele.style.opacity = opacity / 100;\n        } else {\n            ///兼容老版本ie\n            ele.style.filter = \"alpha(opacity=\" + opacity + \")\";\n        }\n    }\n\n    var domainArray = [\n    '.com', '.net', '.org', '.biz', '.coop', '.info', '.museum', '.name',\n    '.pro', '.edu', '.gov', '.int', '.mil', '.ac', '.ad', '.ae', '.af', '.ag',\n    '.ai', '.al', '.am', '.an', '.ao', '.aq', '.ar', '.as', '.at', '.au', '.aw',\n    '.az', '.ba', '.bb', '.bd', '.be', '.bf', '.bg', '.bh', '.bi', '.bj', '.bm',\n    '.bn', '.bo', '.br', '.bs', '.bt', '.bv', '.bw', '.by', '.bz', '.ca', '.cc',\n    '.cd', '.cf', '.cg', '.ch', '.ci', '.ck', '.cl', '.cm', '.cn', '.co', '.cr',\n    '.cu', '.cv', '.cx', '.cy', '.cz', '.de', '.dj', '.dk', '.dm', '.do', '.dz',\n    '.ec', '.ee', '.eg', '.eh', '.er', '.es', '.et', '.fi', '.fj', '.fk', '.fm',\n    '.fo', '.fr', '.ga', '.gd', '.ge', '.gf', '.gg', '.gh', '.gi', '.gl', '.gm',\n    '.gn', '.gp', '.gq', '.gr', '.gs', '.gt', '.gu', '.gv', '.gy', '.hk', '.hm',\n    '.hn', '.hr', '.ht', '.hu', '.id', '.ie', '.il', '.im', '.in', '.io', '.iq',\n    '.ir', '.is', '.it', '.je', '.jm', '.jo', '.jp', '.ke', '.kg', '.kh', '.ki',\n    '.km', '.kn', '.kp', '.kr', '.kw', '.ky', '.kz', '.la', '.lb', '.lc', '.li',\n    '.lk', '.lr', '.ls', '.lt', '.lu', '.lv', '.ly', '.ma', '.mc', '.md', '.me',\n    '.mh', '.mk', '.ml', '.mm', '.mn', '.mo', '.mp', '.mq', '.mr', '.ms', '.mt',\n    '.mu', '.mv', '.mw', '.mx', '.my', '.mz', '.na', '.nc', '.ne', '.nf', '.ng',\n    '.ni', '.nl', '.no', '.np', '.nr', '.nu', '.nz', '.om', '.pa', '.pe', '.pf',\n    '.pg', '.ph', '.pk', '.pl', '.pm', '.pn', '.pr', '.ps', '.pt', '.pw', '.py',\n    '.qa', '.re', '.ro', '.rw', '.ru', '.sa', '.sb', '.sc', '.sd', '.se', '.sg',\n    '.sh', '.si', '.sj', '.sk', '.sl', '.sm', '.sn', '.so', '.sr', '.st', '.sv',\n    '.sy', '.sz', '.tc', '.td', '.tf', '.tg', '.th', '.tj', '.tk', '.tm', '.tn',\n    '.to', '.tp', '.tr', '.tt', '.tv', '.tw', '.tz', '.ua', '.ug', '.uk', '.um',\n    '.us', '.uy', '.uz', '.va', '.vc', '.ve', '.vg', '.vi', '.vn', '.vu', '.ws',\n    '.wf', '.ye', '.yt', '.yu', '.za', '.zm', '.zw', '.mg'];\n    \n    var getLocation = function(href) {\n        var location = document.createElement('a');\n        location.href = href;\n        return location;\n    };\n\n    function ValidateIPaddress(ipaddress) {\n        if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) {\n            return true;\n        }\n        return false;\n    }\n\n    var chkDomain = function(str, protocol) {\n        var link = str;\n        if(!protocol){\n            link = 'http://' + link;\n        }\n        var location = getLocation(link);\n        if(ValidateIPaddress(location.hostname)){\n            return true;\n        }\n        var domain = location.hostname.replace(/^.+\\./, '');\n        if(domainArray.indexOf('.' + domain) < 0){\n            return false;\n        }\n        return true;\n    };\n\n    \n\n    utils.render = render;\n\n    RCS.utils = utils;   \n})(RCS);"
  },
  {
    "path": "cs/sobot/.gitignore",
    "content": "node_modules\ntemp\n"
  },
  {
    "path": "cs/sobot/Gruntfile.js",
    "content": "'use strict';\nvar glob = require('glob');\nvar fs = require('fs');\nmodule.exports = function(grunt) {\n    grunt.initConfig({\n        concat: {\n            dist: {\n                src: [\n                    'utils.js',\n                    'upload.js',\n                    'template.js',\n                    'emoji.js',\n                    'cs.js'\n                ],\n                dest: 'temp/cs.js'\n            }\n        },\n        uglify: {\n            dist: {\n                src: [\n                    'temp/cs.js',\n                    'temp/template.js'\n                ],\n                dest: 'dist/cs.min.js'\n            }\n        },\n        cssmin: {\n            dist: {\n                src: 'cs.css',\n                dest: 'dist/cs.min.css'\n            }\n        },\n        clean: {\n            dist: {\n                src: 'temp'\n            }\n        }\n    });\n\n    grunt.loadNpmTasks('grunt-contrib-concat');\n    grunt.loadNpmTasks('grunt-contrib-uglify');\n    grunt.loadNpmTasks('grunt-contrib-cssmin');\n    grunt.loadNpmTasks('grunt-contrib-clean');\n\n    grunt.registerTask('html-to-js',function () {\n        var template = {};\n        glob.sync('./templates/**/*.html').forEach(filePath => {\n            var content = fs.readFileSync(filePath, {\n                encoding: 'utf8'\n            });\n            var key = filePath.replace(/^\\.\\//, '');\n            template[key] = content;\n        });\n        var dest = './temp/template.js';\n        var outputContent = 'RCS.templateCache=' + JSON.stringify(template, null, 4) + ';';\n        fs.writeFileSync(dest, outputContent);\n    });\n\n    grunt.registerTask('dist', ['concat', 'html-to-js', 'uglify', 'cssmin', 'clean']);\n}"
  },
  {
    "path": "cs/sobot/README.md",
    "content": "# 使用说明\n1. 在页面引入以下资源\n```\n<!-- Web SDK 相关资源 SDK 针对自建客服做出了一些修改 -->\n<script src=\"../RongIMLib-cs.js\"></script>\n<script src=\"./RongIMEmoji.js\"></script> \n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n<!-- 客服插件样式表和 js 代码 -->\n<link rel=\"stylesheet\" href=\"cs.css\">\n<script src=\"utils.js\"></script>\n<script src=\"upload.js\"></script>\n<script src=\"template.js\"></script>\n<script src=\"emoji.js\"></script>\n<script src=\"cs.js\"></script>\n\n```\n2. 初始化客服插件\n``` javascript\nRCS.init({\n    appKey: \"c9kqb3rdkh4jj\",// 应用 appkey\n    token: \"qjxXwJizd7Y62DTmUEluw5lzpNwuJBCkPrRErVG12EKi1UP6giNGqszv6IQX0IndGKwjoGwevVmUVSN0x458KOqK0LwxTuhy\",// 当前游客或登录用户 token\n    upload: {\n        fileServer: \"http://upload.qiniu.com\",// 文件服务器地址\n        isPrivate: false // 是否是私有云\n    },\n    target: document.getElementById(\"rcs-app\"),// 要插入到的页面节点\n    customerServiceId: \"KEFU150535341165880\",// 客服 Id\n    userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像，在用户没有头像的时候显示\n    csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像，在客服没有头像的时候显示,建议线上地址\n    showButton: true,\n    //是否需要按钮主动发起，设为false的时候，init()方法直接唤起聊天窗口,需客户自己编写按钮，点击之后调用init(),templates中的button模板不可用;设为true的时候，init()首先唤起客服咨询按钮，点击之后才连接客服，唤起聊天窗口，在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token，在获取到token之后，执行init()即可。\n    connectingCallback: function(){\n        console.log('连接中');\n    },//连接中的执行的方法，例如显示加载页面,可不传\n    connectedCallback: function(){},//连接成功之后的方法，例如关闭加载页面,可不传\n    disconnectedCallback: function(){\n        alert('连接断开');\n    }//断开连接之后的操作,可不传\n});\n```\n3.RC:InfoNtf消息里带有user对象，在接通客服坐席后，会收到一条RC:InfoNtf消息，可以进行保存客服信息（头像、名称等）\n\n# 开发说明\n## 目录结构说明\n- dist \n    发布-合并压缩后的代码\n    + cs.html\n        示例页面\n- templates\n    HTML模板\n\n- cs.css  \n    样式表\n- cs.html  \n    开发测试页面\n- cs.js  \n    客服核心代码\n- emoji.js  \n    表情库调用封装\n- upload.js  \n    上传插件\n- utils.js  \n    工具类\n\n## 合并压缩发布代码\n```\n安装依赖包\nnpm install\n合并压缩代码\ngrunt dist\n```"
  },
  {
    "path": "cs/sobot/RongIMEmoji.js",
    "content": "/*\n    支持范围\n    IE6+, Chrome, Safari, Firefox, Android, IOS\n */\n(function(global, factory) {\n    \"use strict\";\n    if (typeof exports === \"object\" && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === \"function\" && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    var emojiFactory = {\n        \"u1F600\": { \"en\": \"Grinning Face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F601\": { \"en\": \"Grinning With Smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F602\": { \"en\": \"Laughing Tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F603\": { \"en\": \"Smiley Face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F605\": { \"en\": \"Happy Sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F606\": { \"en\": \"Big Grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F607\": { \"en\": \"Halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F608\": { \"en\": \"Purple Devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F609\": { \"en\": \"Winking Face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F611\": { \"en\": \"Expressionless Face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F612\": { \"en\": \"Dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F613\": { \"en\": \"Sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F614\": { \"en\": \"Pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F615\": { \"en\": \"Confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F616\": { \"en\": \"Confounded Face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F618\": { \"en\": \"Blowing Kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F621\": { \"en\": \"Angry Face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F622\": { \"en\": \"Sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-2075px 0px\" },\n        \"u1F623\": { \"en\": \"Helpless Face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F624\": { \"en\": \"Mad Face\", \"zh\": \"怒气冲冲\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F628\": { \"en\": \"Fearful Face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F629\": { \"en\": \"Weary Face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F630\": { \"en\": \"Cold Sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F631\": { \"en\": \"Scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F632\": { \"en\": \"Shocked Face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F633\": { \"en\": \"Flushed Face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F634\": { \"en\": \"Sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"Dizzy Face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F636\": { \"en\": \"Mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F637\": { \"en\": \"Mask Face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F3A4\": { \"en\": \"Microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B2\": { \"en\": \"Game Die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F3B5\": { \"en\": \"Musical Note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3C0\": { \"en\": \"Basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u1F3C2\": { \"en\": \"Snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3E1\": { \"en\": \"House With Garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F004\": { \"en\": \"Mahjong Red Dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F4A1\": { \"en\": \"Light Bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4A2\": { \"en\": \"Anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A3\": { \"en\": \"Bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F4A4\": { \"en\": \"Zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F4A9\": { \"en\": \"Pile Of Poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F4AA\": { \"en\": \"Flexed Biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F4B0\": { \"en\": \"Money Bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F4DA\": { \"en\": \"Books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F4DE\": { \"en\": \"Telephone Receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"Loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F6AB\": { \"en\": \"Prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u1F6BF\": { \"en\": \"Shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F30F\": { \"en\": \"Globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" },\n        \"u1F33B\": { \"en\": \"Sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F35A\": { \"en\": \"Cooked Rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F36B\": { \"en\": \"Chocolate Bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F37B\": { \"en\": \"Cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u270A\": { \"en\": \"Oncoming Fist\", \"zh\": \"击拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-1350px 0px\" },\n        \"u1F44C\": { \"en\": \"Ok Hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44D\": { \"en\": \"Thumbs Up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"Thumbs Down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F44F\": { \"en\": \"Clapping Hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F46A\": { \"en\": \"Family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"Couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F62C\": { \"en\": \"Grimacing Face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F47B\": { \"en\": \"Ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F47C\": { \"en\": \"Baby Angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F47D\": { \"en\": \"Alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F47F\": { \"en\": \"Devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F48A\": { \"en\": \"Capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F48B\": { \"en\": \"Kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"Ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F52B\": { \"en\": \"Pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F60A\": { \"en\": \"Smiley\", \"zh\": \"微笑\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u1F60B\": { \"en\": \"Hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F60C\": { \"en\": \"Pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F60D\": { \"en\": \"Heart Eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F60E\": { \"en\": \"Sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F60F\": { \"en\": \"Smirking Face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F61A\": { \"en\": \"Kiss Face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"Crazy Face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"Tongue Out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F61E\": { \"en\": \"Disappointed Face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F61F\": { \"en\": \"Worried Face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F62A\": { \"en\": \"Sleepy Face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F62B\": { \"en\": \"Tired Face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F62D\": { \"en\": \"Crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-425px 0px\" },\n        \"u1F62F\": { \"en\": \"Surprised Face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F64A\": { \"en\": \"No Speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F64F\": { \"en\": \"Folded Hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u1F319\": { \"en\": \"Drescent Moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u1F332\": { \"en\": \"Pine Tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F339\": { \"en\": \"Rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F349\": { \"en\": \"Watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F356\": { \"en\": \"Barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F366\": { \"en\": \"Ice Cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F377\": { \"en\": \"Wine Glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F381\": { \"en\": \"Wrapped Gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F382\": { \"en\": \"Birthday Cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F384\": { \"en\": \"Christmas Tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F389\": { \"en\": \"Party Popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F393\": { \"en\": \"Graduation Cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u1F434\": { \"en\": \"Horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"Dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"Pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F451\": { \"en\": \"Crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"Lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F494\": { \"en\": \"Broken Heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"Fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F556\": { \"en\": \"Clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u1F648\": { \"en\": \"See No Monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"Hear No Monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F680\": { \"en\": \"Rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u2B50\": { \"en\": \"Star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u23F0\": { \"en\": \"Alarm Clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"Hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u26A1\": { \"en\": \"Lightning Bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u26BD\": { \"en\": \"Soccer Ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u26C4\": { \"en\": \"Snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u26C5\": { \"en\": \"Cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u261D\": { \"en\": \"Pointing Up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u263A\": { \"en\": \"Cute\", \"zh\": \"萌萌哒\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F44A\": { \"en\": \"Raised Fist\", \"zh\": \"举起拳头\", \"tag\": \"\\u270A\", \"position\": \"-2975px 0px\" },\n        \"u270B\": { \"en\": \"Raised Hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u270C\": { \"en\": \"Victory Hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270F\": { \"en\": \"Pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u2600\": { \"en\": \"Sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u2601\": { \"en\": \"Cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2614\": { \"en\": \"Umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u2615\": { \"en\": \"Coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u2744\": { \"en\": \"Snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" }\n    };\n\n    var detailList = [];\n\n    var emojiRegExp = /(\\uD83D\\uDC76\\uD83C\\uDFFB|\\uD83D\\uDC76\\uD83C\\uDFFC|\\uD83D\\uDC76\\uD83C\\uDFFD|\\uD83D\\uDC76\\uD83C\\uDFFE|\\uD83D\\uDC76\\uD83C\\uDFFF|\\uD83E\\uDDD2\\uD83C\\uDFFB|\\uD83E\\uDDD2\\uD83C\\uDFFC|\\uD83E\\uDDD2\\uD83C\\uDFFD|\\uD83E\\uDDD2\\uD83C\\uDFFE|\\uD83E\\uDDD2\\uD83C\\uDFFF|\\uD83D\\uDC66\\uD83C\\uDFFB|\\uD83D\\uDC66\\uD83C\\uDFFC|\\uD83D\\uDC66\\uD83C\\uDFFD|\\uD83D\\uDC66\\uD83C\\uDFFE|\\uD83D\\uDC66\\uD83C\\uDFFF|\\uD83D\\uDC67\\uD83C\\uDFFB|\\uD83D\\uDC67\\uD83C\\uDFFC|\\uD83D\\uDC67\\uD83C\\uDFFD|\\uD83D\\uDC67\\uD83C\\uDFFE|\\uD83D\\uDC67\\uD83C\\uDFFF|\\uD83E\\uDDD1\\uD83C\\uDFFB|\\uD83E\\uDDD1\\uD83C\\uDFFC|\\uD83E\\uDDD1\\uD83C\\uDFFD|\\uD83E\\uDDD1\\uD83C\\uDFFE|\\uD83E\\uDDD1\\uD83C\\uDFFF|\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83D\\uDC68\\uD83C\\uDFFC|\\uD83D\\uDC68\\uD83C\\uDFFD|\\uD83D\\uDC68\\uD83C\\uDFFE|\\uD83D\\uDC68\\uD83C\\uDFFF|\\uD83D\\uDC69\\uD83C\\uDFFB|\\uD83D\\uDC69\\uD83C\\uDFFC|\\uD83D\\uDC69\\uD83C\\uDFFD|\\uD83D\\uDC69\\uD83C\\uDFFE|\\uD83D\\uDC69\\uD83C\\uDFFF|\\uD83E\\uDDD3\\uD83C\\uDFFB|\\uD83E\\uDDD3\\uD83C\\uDFFC|\\uD83E\\uDDD3\\uD83C\\uDFFD|\\uD83E\\uDDD3\\uD83C\\uDFFE|\\uD83E\\uDDD3\\uD83C\\uDFFF|\\uD83D\\uDC74\\uD83C\\uDFFB|\\uD83D\\uDC74\\uD83C\\uDFFC|\\uD83D\\uDC74\\uD83C\\uDFFD|\\uD83D\\uDC74\\uD83C\\uDFFE|\\uD83D\\uDC74\\uD83C\\uDFFF|\\uD83D\\uDC75\\uD83C\\uDFFB|\\uD83D\\uDC75\\uD83C\\uDFFC|\\uD83D\\uDC75\\uD83C\\uDFFD|\\uD83D\\uDC75\\uD83C\\uDFFE|\\uD83D\\uDC75\\uD83C\\uDFFF|\\uD83D\\uDC68\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\u2695\\uD83F\\uDE0F|\\uD83D\\uDC68\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDF93|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDF93|\\uD83D\\uDC68\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFEB|\\uD83D\\uDC68\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\u2696\\uD83F\\uDE0F|\\uD83D\\uDC68\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDF3E|\\uD83D\\uDC68\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDF73|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDF73|\\uD83D\\uDC68\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDD27|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDD27|\\uD83D\\uDC68\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFED|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFED|\\uD83D\\uDC68\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBC|\\uD83D\\uDC68\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDD2C|\\uD83D\\uDC68\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDCBB|\\uD83D\\uDC68\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA4|\\uD83D\\uDC68\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83C\\uDFA8|\\uD83D\\uDC68\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\u2708\\uD83F\\uDE0F|\\uD83D\\uDC68\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDE80|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDE80|\\uD83D\\uDC68\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFB\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFC\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFD\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFE\\u200D\\uD83D\\uDE92|\\uD83D\\uDC68\\uD83C\\uDFFF\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83D\\uDE92|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83D\\uDE92|\\uD83D\\uDC6E\\uD83C\\uDFFB|\\uD83D\\uDC6E\\uD83C\\uDFFC|\\uD83D\\uDC6E\\uD83C\\uDFFD|\\uD83D\\uDC6E\\uD83C\\uDFFE|\\uD83D\\uDC6E\\uD83C\\uDFFF|\\uD83D\\uDC6E\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6E\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC6E\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFB|\\uD83D\\uDD75\\uD83C\\uDFFC|\\uD83D\\uDD75\\uD83C\\uDFFD|\\uD83D\\uDD75\\uD83C\\uDFFE|\\uD83D\\uDD75\\uD83C\\uDFFF|\\uD83D\\uDD75\\uD83F\\uDE0F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83F\\uDE0F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDD75\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFB|\\uD83D\\uDC82\\uD83C\\uDFFC|\\uD83D\\uDC82\\uD83C\\uDFFD|\\uD83D\\uDC82\\uD83C\\uDFFE|\\uD83D\\uDC82\\uD83C\\uDFFF|\\uD83D\\uDC82\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC82\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC82\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFB|\\uD83D\\uDC77\\uD83C\\uDFFC|\\uD83D\\uDC77\\uD83C\\uDFFD|\\uD83D\\uDC77\\uD83C\\uDFFE|\\uD83D\\uDC77\\uD83C\\uDFFF|\\uD83D\\uDC77\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC77\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC77\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD34\\uD83C\\uDFFB|\\uD83E\\uDD34\\uD83C\\uDFFC|\\uD83E\\uDD34\\uD83C\\uDFFD|\\uD83E\\uDD34\\uD83C\\uDFFE|\\uD83E\\uDD34\\uD83C\\uDFFF|\\uD83D\\uDC78\\uD83C\\uDFFB|\\uD83D\\uDC78\\uD83C\\uDFFC|\\uD83D\\uDC78\\uD83C\\uDFFD|\\uD83D\\uDC78\\uD83C\\uDFFE|\\uD83D\\uDC78\\uD83C\\uDFFF|\\uD83D\\uDC73\\uD83C\\uDFFB|\\uD83D\\uDC73\\uD83C\\uDFFC|\\uD83D\\uDC73\\uD83C\\uDFFD|\\uD83D\\uDC73\\uD83C\\uDFFE|\\uD83D\\uDC73\\uD83C\\uDFFF|\\uD83D\\uDC73\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC73\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC73\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC72\\uD83C\\uDFFB|\\uD83D\\uDC72\\uD83C\\uDFFC|\\uD83D\\uDC72\\uD83C\\uDFFD|\\uD83D\\uDC72\\uD83C\\uDFFE|\\uD83D\\uDC72\\uD83C\\uDFFF|\\uD83E\\uDDD5\\uD83C\\uDFFB|\\uD83E\\uDDD5\\uD83C\\uDFFC|\\uD83E\\uDDD5\\uD83C\\uDFFD|\\uD83E\\uDDD5\\uD83C\\uDFFE|\\uD83E\\uDDD5\\uD83C\\uDFFF|\\uD83E\\uDDD4\\uD83C\\uDFFB|\\uD83E\\uDDD4\\uD83C\\uDFFC|\\uD83E\\uDDD4\\uD83C\\uDFFD|\\uD83E\\uDDD4\\uD83C\\uDFFE|\\uD83E\\uDDD4\\uD83C\\uDFFF|\\uD83D\\uDC71\\uD83C\\uDFFB|\\uD83D\\uDC71\\uD83C\\uDFFC|\\uD83D\\uDC71\\uD83C\\uDFFD|\\uD83D\\uDC71\\uD83C\\uDFFE|\\uD83D\\uDC71\\uD83C\\uDFFF|\\uD83D\\uDC71\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC71\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC71\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD35\\uD83C\\uDFFB|\\uD83E\\uDD35\\uD83C\\uDFFC|\\uD83E\\uDD35\\uD83C\\uDFFD|\\uD83E\\uDD35\\uD83C\\uDFFE|\\uD83E\\uDD35\\uD83C\\uDFFF|\\uD83D\\uDC70\\uD83C\\uDFFB|\\uD83D\\uDC70\\uD83C\\uDFFC|\\uD83D\\uDC70\\uD83C\\uDFFD|\\uD83D\\uDC70\\uD83C\\uDFFE|\\uD83D\\uDC70\\uD83C\\uDFFF|\\uD83E\\uDD30\\uD83C\\uDFFB|\\uD83E\\uDD30\\uD83C\\uDFFC|\\uD83E\\uDD30\\uD83C\\uDFFD|\\uD83E\\uDD30\\uD83C\\uDFFE|\\uD83E\\uDD30\\uD83C\\uDFFF|\\uD83E\\uDD31\\uD83C\\uDFFB|\\uD83E\\uDD31\\uD83C\\uDFFC|\\uD83E\\uDD31\\uD83C\\uDFFD|\\uD83E\\uDD31\\uD83C\\uDFFE|\\uD83E\\uDD31\\uD83C\\uDFFF|\\uD83D\\uDC7C\\uD83C\\uDFFB|\\uD83D\\uDC7C\\uD83C\\uDFFC|\\uD83D\\uDC7C\\uD83C\\uDFFD|\\uD83D\\uDC7C\\uD83C\\uDFFE|\\uD83D\\uDC7C\\uD83C\\uDFFF|\\uD83C\\uDF85\\uD83C\\uDFFB|\\uD83C\\uDF85\\uD83C\\uDFFC|\\uD83C\\uDF85\\uD83C\\uDFFD|\\uD83C\\uDF85\\uD83C\\uDFFE|\\uD83C\\uDF85\\uD83C\\uDFFF|\\uD83E\\uDD36\\uD83C\\uDFFB|\\uD83E\\uDD36\\uD83C\\uDFFC|\\uD83E\\uDD36\\uD83C\\uDFFD|\\uD83E\\uDD36\\uD83C\\uDFFE|\\uD83E\\uDD36\\uD83C\\uDFFF|\\uD83E\\uDDD9\\uD83C\\uDFFB|\\uD83E\\uDDD9\\uD83C\\uDFFC|\\uD83E\\uDDD9\\uD83C\\uDFFD|\\uD83E\\uDDD9\\uD83C\\uDFFE|\\uD83E\\uDDD9\\uD83C\\uDFFF|\\uD83E\\uDDD9\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD9\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD9\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFB|\\uD83E\\uDDDA\\uD83C\\uDFFC|\\uD83E\\uDDDA\\uD83C\\uDFFD|\\uD83E\\uDDDA\\uD83C\\uDFFE|\\uD83E\\uDDDA\\uD83C\\uDFFF|\\uD83E\\uDDDA\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDA\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDA\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFB|\\uD83E\\uDDDB\\uD83C\\uDFFC|\\uD83E\\uDDDB\\uD83C\\uDFFD|\\uD83E\\uDDDB\\uD83C\\uDFFE|\\uD83E\\uDDDB\\uD83C\\uDFFF|\\uD83E\\uDDDB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDB\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFB|\\uD83E\\uDDDC\\uD83C\\uDFFC|\\uD83E\\uDDDC\\uD83C\\uDFFD|\\uD83E\\uDDDC\\uD83C\\uDFFE|\\uD83E\\uDDDC\\uD83C\\uDFFF|\\uD83E\\uDDDC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDC\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFB|\\uD83E\\uDDDD\\uD83C\\uDFFC|\\uD83E\\uDDDD\\uD83C\\uDFFD|\\uD83E\\uDDDD\\uD83C\\uDFFE|\\uD83E\\uDDDD\\uD83C\\uDFFF|\\uD83E\\uDDDD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDD\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDDF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDDF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFB|\\uD83D\\uDE4D\\uD83C\\uDFFC|\\uD83D\\uDE4D\\uD83C\\uDFFD|\\uD83D\\uDE4D\\uD83C\\uDFFE|\\uD83D\\uDE4D\\uD83C\\uDFFF|\\uD83D\\uDE4D\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4D\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4D\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFB|\\uD83D\\uDE4E\\uD83C\\uDFFC|\\uD83D\\uDE4E\\uD83C\\uDFFD|\\uD83D\\uDE4E\\uD83C\\uDFFE|\\uD83D\\uDE4E\\uD83C\\uDFFF|\\uD83D\\uDE4E\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4E\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4E\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFB|\\uD83D\\uDE45\\uD83C\\uDFFC|\\uD83D\\uDE45\\uD83C\\uDFFD|\\uD83D\\uDE45\\uD83C\\uDFFE|\\uD83D\\uDE45\\uD83C\\uDFFF|\\uD83D\\uDE45\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE45\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE45\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFB|\\uD83D\\uDE46\\uD83C\\uDFFC|\\uD83D\\uDE46\\uD83C\\uDFFD|\\uD83D\\uDE46\\uD83C\\uDFFE|\\uD83D\\uDE46\\uD83C\\uDFFF|\\uD83D\\uDE46\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE46\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE46\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFB|\\uD83D\\uDC81\\uD83C\\uDFFC|\\uD83D\\uDC81\\uD83C\\uDFFD|\\uD83D\\uDC81\\uD83C\\uDFFE|\\uD83D\\uDC81\\uD83C\\uDFFF|\\uD83D\\uDC81\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC81\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC81\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFB|\\uD83D\\uDE4B\\uD83C\\uDFFC|\\uD83D\\uDE4B\\uD83C\\uDFFD|\\uD83D\\uDE4B\\uD83C\\uDFFE|\\uD83D\\uDE4B\\uD83C\\uDFFF|\\uD83D\\uDE4B\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE4B\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE4B\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFB|\\uD83D\\uDE47\\uD83C\\uDFFC|\\uD83D\\uDE47\\uD83C\\uDFFD|\\uD83D\\uDE47\\uD83C\\uDFFE|\\uD83D\\uDE47\\uD83C\\uDFFF|\\uD83D\\uDE47\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDE47\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDE47\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFB|\\uD83E\\uDD26\\uD83C\\uDFFC|\\uD83E\\uDD26\\uD83C\\uDFFD|\\uD83E\\uDD26\\uD83C\\uDFFE|\\uD83E\\uDD26\\uD83C\\uDFFF|\\uD83E\\uDD26\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD26\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD26\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFB|\\uD83E\\uDD37\\uD83C\\uDFFC|\\uD83E\\uDD37\\uD83C\\uDFFD|\\uD83E\\uDD37\\uD83C\\uDFFE|\\uD83E\\uDD37\\uD83C\\uDFFF|\\uD83E\\uDD37\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD37\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD37\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFB|\\uD83D\\uDC86\\uD83C\\uDFFC|\\uD83D\\uDC86\\uD83C\\uDFFD|\\uD83D\\uDC86\\uD83C\\uDFFE|\\uD83D\\uDC86\\uD83C\\uDFFF|\\uD83D\\uDC86\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC86\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC86\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFB|\\uD83D\\uDC87\\uD83C\\uDFFC|\\uD83D\\uDC87\\uD83C\\uDFFD|\\uD83D\\uDC87\\uD83C\\uDFFE|\\uD83D\\uDC87\\uD83C\\uDFFF|\\uD83D\\uDC87\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC87\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC87\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFB|\\uD83D\\uDEB6\\uD83C\\uDFFC|\\uD83D\\uDEB6\\uD83C\\uDFFD|\\uD83D\\uDEB6\\uD83C\\uDFFE|\\uD83D\\uDEB6\\uD83C\\uDFFF|\\uD83D\\uDEB6\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB6\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB6\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFB|\\uD83C\\uDFC3\\uD83C\\uDFFC|\\uD83C\\uDFC3\\uD83C\\uDFFD|\\uD83C\\uDFC3\\uD83C\\uDFFE|\\uD83C\\uDFC3\\uD83C\\uDFFF|\\uD83C\\uDFC3\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC3\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC3\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC83\\uD83C\\uDFFB|\\uD83D\\uDC83\\uD83C\\uDFFC|\\uD83D\\uDC83\\uD83C\\uDFFD|\\uD83D\\uDC83\\uD83C\\uDFFE|\\uD83D\\uDC83\\uD83C\\uDFFF|\\uD83D\\uDD7A\\uD83C\\uDFFB|\\uD83D\\uDD7A\\uD83C\\uDFFC|\\uD83D\\uDD7A\\uD83C\\uDFFD|\\uD83D\\uDD7A\\uD83C\\uDFFE|\\uD83D\\uDD7A\\uD83C\\uDFFF|\\uD83D\\uDC6F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDC6F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFB|\\uD83E\\uDDD6\\uD83C\\uDFFC|\\uD83E\\uDDD6\\uD83C\\uDFFD|\\uD83E\\uDDD6\\uD83C\\uDFFE|\\uD83E\\uDDD6\\uD83C\\uDFFF|\\uD83E\\uDDD6\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD6\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD6\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFB|\\uD83E\\uDDD7\\uD83C\\uDFFC|\\uD83E\\uDDD7\\uD83C\\uDFFD|\\uD83E\\uDDD7\\uD83C\\uDFFE|\\uD83E\\uDDD7\\uD83C\\uDFFF|\\uD83E\\uDDD7\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD7\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD7\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFB|\\uD83E\\uDDD8\\uD83C\\uDFFC|\\uD83E\\uDDD8\\uD83C\\uDFFD|\\uD83E\\uDDD8\\uD83C\\uDFFE|\\uD83E\\uDDD8\\uD83C\\uDFFF|\\uD83E\\uDDD8\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDDD8\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDDD8\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEC0\\uD83C\\uDFFB|\\uD83D\\uDEC0\\uD83C\\uDFFC|\\uD83D\\uDEC0\\uD83C\\uDFFD|\\uD83D\\uDEC0\\uD83C\\uDFFE|\\uD83D\\uDEC0\\uD83C\\uDFFF|\\uD83D\\uDECC\\uD83C\\uDFFB|\\uD83D\\uDECC\\uD83C\\uDFFC|\\uD83D\\uDECC\\uD83C\\uDFFD|\\uD83D\\uDECC\\uD83C\\uDFFE|\\uD83D\\uDECC\\uD83C\\uDFFF|\\uD83D\\uDD74\\uD83C\\uDFFB|\\uD83D\\uDD74\\uD83C\\uDFFC|\\uD83D\\uDD74\\uD83C\\uDFFD|\\uD83D\\uDD74\\uD83C\\uDFFE|\\uD83D\\uDD74\\uD83C\\uDFFF|\\uD83C\\uDFC7\\uD83C\\uDFFB|\\uD83C\\uDFC7\\uD83C\\uDFFC|\\uD83C\\uDFC7\\uD83C\\uDFFD|\\uD83C\\uDFC7\\uD83C\\uDFFE|\\uD83C\\uDFC7\\uD83C\\uDFFF|\\uD83C\\uDFC2\\uD83C\\uDFFB|\\uD83C\\uDFC2\\uD83C\\uDFFC|\\uD83C\\uDFC2\\uD83C\\uDFFD|\\uD83C\\uDFC2\\uD83C\\uDFFE|\\uD83C\\uDFC2\\uD83C\\uDFFF|\\uD83C\\uDFCC\\uD83C\\uDFFB|\\uD83C\\uDFCC\\uD83C\\uDFFC|\\uD83C\\uDFCC\\uD83C\\uDFFD|\\uD83C\\uDFCC\\uD83C\\uDFFE|\\uD83C\\uDFCC\\uD83C\\uDFFF|\\uD83C\\uDFCC\\uD83F\\uDE0F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83F\\uDE0F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCC\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFB|\\uD83C\\uDFC4\\uD83C\\uDFFC|\\uD83C\\uDFC4\\uD83C\\uDFFD|\\uD83C\\uDFC4\\uD83C\\uDFFE|\\uD83C\\uDFC4\\uD83C\\uDFFF|\\uD83C\\uDFC4\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFC4\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFC4\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFB|\\uD83D\\uDEA3\\uD83C\\uDFFC|\\uD83D\\uDEA3\\uD83C\\uDFFD|\\uD83D\\uDEA3\\uD83C\\uDFFE|\\uD83D\\uDEA3\\uD83C\\uDFFF|\\uD83D\\uDEA3\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEA3\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEA3\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFB|\\uD83C\\uDFCA\\uD83C\\uDFFC|\\uD83C\\uDFCA\\uD83C\\uDFFD|\\uD83C\\uDFCA\\uD83C\\uDFFE|\\uD83C\\uDFCA\\uD83C\\uDFFF|\\uD83C\\uDFCA\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCA\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCA\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFB|\\uD83C\\uDFCB\\uD83C\\uDFFC|\\uD83C\\uDFCB\\uD83C\\uDFFD|\\uD83C\\uDFCB\\uD83C\\uDFFE|\\uD83C\\uDFCB\\uD83C\\uDFFF|\\uD83C\\uDFCB\\uD83F\\uDE0F\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83F\\uDE0F\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83C\\uDFCB\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFB|\\uD83D\\uDEB4\\uD83C\\uDFFC|\\uD83D\\uDEB4\\uD83C\\uDFFD|\\uD83D\\uDEB4\\uD83C\\uDFFE|\\uD83D\\uDEB4\\uD83C\\uDFFF|\\uD83D\\uDEB4\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB4\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB4\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFB|\\uD83D\\uDEB5\\uD83C\\uDFFC|\\uD83D\\uDEB5\\uD83C\\uDFFD|\\uD83D\\uDEB5\\uD83C\\uDFFE|\\uD83D\\uDEB5\\uD83C\\uDFFF|\\uD83D\\uDEB5\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83D\\uDEB5\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDEB5\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFB|\\uD83E\\uDD38\\uD83C\\uDFFC|\\uD83E\\uDD38\\uD83C\\uDFFD|\\uD83E\\uDD38\\uD83C\\uDFFE|\\uD83E\\uDD38\\uD83C\\uDFFF|\\uD83E\\uDD38\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD38\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD38\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3C\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3C\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFB|\\uD83E\\uDD3D\\uD83C\\uDFFC|\\uD83E\\uDD3D\\uD83C\\uDFFD|\\uD83E\\uDD3D\\uD83C\\uDFFE|\\uD83E\\uDD3D\\uD83C\\uDFFF|\\uD83E\\uDD3D\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3D\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3D\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFB|\\uD83E\\uDD3E\\uD83C\\uDFFC|\\uD83E\\uDD3E\\uD83C\\uDFFD|\\uD83E\\uDD3E\\uD83C\\uDFFE|\\uD83E\\uDD3E\\uD83C\\uDFFF|\\uD83E\\uDD3E\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD3E\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD3E\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFB|\\uD83E\\uDD39\\uD83C\\uDFFC|\\uD83E\\uDD39\\uD83C\\uDFFD|\\uD83E\\uDD39\\uD83C\\uDFFE|\\uD83E\\uDD39\\uD83C\\uDFFF|\\uD83E\\uDD39\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFB\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFC\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFD\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFE\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFF\\u200D\\u2642\\uD83F\\uDE0F|\\uD83E\\uDD39\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFB\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFC\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFD\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFE\\u200D\\u2640\\uD83F\\uDE0F|\\uD83E\\uDD39\\uD83C\\uDFFF\\u200D\\u2640\\uD83F\\uDE0F|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68|\\uD83D\\uDC68\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC8B\\u200D\\uD83D\\uDC69|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC68|\\uD83D\\uDC68\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC68|\\uD83D\\uDC69\\u200D\\u2764\\uD83F\\uDE0F\\u200D\\uD83D\\uDC69|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC67|\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC68\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D\\uD83D\\uDC67|\\uD83E\\uDD33\\uD83C\\uDFFB|\\uD83E\\uDD33\\uD83C\\uDFFC|\\uD83E\\uDD33\\uD83C\\uDFFD|\\uD83E\\uDD33\\uD83C\\uDFFE|\\uD83E\\uDD33\\uD83C\\uDFFF|\\uD83D\\uDCAA\\uD83C\\uDFFB|\\uD83D\\uDCAA\\uD83C\\uDFFC|\\uD83D\\uDCAA\\uD83C\\uDFFD|\\uD83D\\uDCAA\\uD83C\\uDFFE|\\uD83D\\uDCAA\\uD83C\\uDFFF|\\uD83D\\uDC48\\uD83C\\uDFFB|\\uD83D\\uDC48\\uD83C\\uDFFC|\\uD83D\\uDC48\\uD83C\\uDFFD|\\uD83D\\uDC48\\uD83C\\uDFFE|\\uD83D\\uDC48\\uD83C\\uDFFF|\\uD83D\\uDC49\\uD83C\\uDFFB|\\uD83D\\uDC49\\uD83C\\uDFFC|\\uD83D\\uDC49\\uD83C\\uDFFD|\\uD83D\\uDC49\\uD83C\\uDFFE|\\uD83D\\uDC49\\uD83C\\uDFFF|\\uD83D\\uDC46\\uD83C\\uDFFB|\\uD83D\\uDC46\\uD83C\\uDFFC|\\uD83D\\uDC46\\uD83C\\uDFFD|\\uD83D\\uDC46\\uD83C\\uDFFE|\\uD83D\\uDC46\\uD83C\\uDFFF|\\uD83D\\uDD95\\uD83C\\uDFFB|\\uD83D\\uDD95\\uD83C\\uDFFC|\\uD83D\\uDD95\\uD83C\\uDFFD|\\uD83D\\uDD95\\uD83C\\uDFFE|\\uD83D\\uDD95\\uD83C\\uDFFF|\\uD83D\\uDC47\\uD83C\\uDFFB|\\uD83D\\uDC47\\uD83C\\uDFFC|\\uD83D\\uDC47\\uD83C\\uDFFD|\\uD83D\\uDC47\\uD83C\\uDFFE|\\uD83D\\uDC47\\uD83C\\uDFFF|\\uD83E\\uDD1E\\uD83C\\uDFFB|\\uD83E\\uDD1E\\uD83C\\uDFFC|\\uD83E\\uDD1E\\uD83C\\uDFFD|\\uD83E\\uDD1E\\uD83C\\uDFFE|\\uD83E\\uDD1E\\uD83C\\uDFFF|\\uD83D\\uDD96\\uD83C\\uDFFB|\\uD83D\\uDD96\\uD83C\\uDFFC|\\uD83D\\uDD96\\uD83C\\uDFFD|\\uD83D\\uDD96\\uD83C\\uDFFE|\\uD83D\\uDD96\\uD83C\\uDFFF|\\uD83E\\uDD18\\uD83C\\uDFFB|\\uD83E\\uDD18\\uD83C\\uDFFC|\\uD83E\\uDD18\\uD83C\\uDFFD|\\uD83E\\uDD18\\uD83C\\uDFFE|\\uD83E\\uDD18\\uD83C\\uDFFF|\\uD83E\\uDD19\\uD83C\\uDFFB|\\uD83E\\uDD19\\uD83C\\uDFFC|\\uD83E\\uDD19\\uD83C\\uDFFD|\\uD83E\\uDD19\\uD83C\\uDFFE|\\uD83E\\uDD19\\uD83C\\uDFFF|\\uD83D\\uDD90\\uD83C\\uDFFB|\\uD83D\\uDD90\\uD83C\\uDFFC|\\uD83D\\uDD90\\uD83C\\uDFFD|\\uD83D\\uDD90\\uD83C\\uDFFE|\\uD83D\\uDD90\\uD83C\\uDFFF|\\uD83D\\uDC4C\\uD83C\\uDFFB|\\uD83D\\uDC4C\\uD83C\\uDFFC|\\uD83D\\uDC4C\\uD83C\\uDFFD|\\uD83D\\uDC4C\\uD83C\\uDFFE|\\uD83D\\uDC4C\\uD83C\\uDFFF|\\uD83D\\uDC4D\\uD83C\\uDFFB|\\uD83D\\uDC4D\\uD83C\\uDFFC|\\uD83D\\uDC4D\\uD83C\\uDFFD|\\uD83D\\uDC4D\\uD83C\\uDFFE|\\uD83D\\uDC4D\\uD83C\\uDFFF|\\uD83D\\uDC4E\\uD83C\\uDFFB|\\uD83D\\uDC4E\\uD83C\\uDFFC|\\uD83D\\uDC4E\\uD83C\\uDFFD|\\uD83D\\uDC4E\\uD83C\\uDFFE|\\uD83D\\uDC4E\\uD83C\\uDFFF|\\uD83D\\uDC4A\\uD83C\\uDFFB|\\uD83D\\uDC4A\\uD83C\\uDFFC|\\uD83D\\uDC4A\\uD83C\\uDFFD|\\uD83D\\uDC4A\\uD83C\\uDFFE|\\uD83D\\uDC4A\\uD83C\\uDFFF|\\uD83E\\uDD1B\\uD83C\\uDFFB|\\uD83E\\uDD1B\\uD83C\\uDFFC|\\uD83E\\uDD1B\\uD83C\\uDFFD|\\uD83E\\uDD1B\\uD83C\\uDFFE|\\uD83E\\uDD1B\\uD83C\\uDFFF|\\uD83E\\uDD1C\\uD83C\\uDFFB|\\uD83E\\uDD1C\\uD83C\\uDFFC|\\uD83E\\uDD1C\\uD83C\\uDFFD|\\uD83E\\uDD1C\\uD83C\\uDFFE|\\uD83E\\uDD1C\\uD83C\\uDFFF|\\uD83E\\uDD1A\\uD83C\\uDFFB|\\uD83E\\uDD1A\\uD83C\\uDFFC|\\uD83E\\uDD1A\\uD83C\\uDFFD|\\uD83E\\uDD1A\\uD83C\\uDFFE|\\uD83E\\uDD1A\\uD83C\\uDFFF|\\uD83D\\uDC4B\\uD83C\\uDFFB|\\uD83D\\uDC4B\\uD83C\\uDFFC|\\uD83D\\uDC4B\\uD83C\\uDFFD|\\uD83D\\uDC4B\\uD83C\\uDFFE|\\uD83D\\uDC4B\\uD83C\\uDFFF|\\uD83E\\uDD1F\\uD83C\\uDFFB|\\uD83E\\uDD1F\\uD83C\\uDFFC|\\uD83E\\uDD1F\\uD83C\\uDFFD|\\uD83E\\uDD1F\\uD83C\\uDFFE|\\uD83E\\uDD1F\\uD83C\\uDFFF|\\uD83D\\uDC4F\\uD83C\\uDFFB|\\uD83D\\uDC4F\\uD83C\\uDFFC|\\uD83D\\uDC4F\\uD83C\\uDFFD|\\uD83D\\uDC4F\\uD83C\\uDFFE|\\uD83D\\uDC4F\\uD83C\\uDFFF|\\uD83D\\uDC50\\uD83C\\uDFFB|\\uD83D\\uDC50\\uD83C\\uDFFC|\\uD83D\\uDC50\\uD83C\\uDFFD|\\uD83D\\uDC50\\uD83C\\uDFFE|\\uD83D\\uDC50\\uD83C\\uDFFF|\\uD83D\\uDE4C\\uD83C\\uDFFB|\\uD83D\\uDE4C\\uD83C\\uDFFC|\\uD83D\\uDE4C\\uD83C\\uDFFD|\\uD83D\\uDE4C\\uD83C\\uDFFE|\\uD83D\\uDE4C\\uD83C\\uDFFF|\\uD83E\\uDD32\\uD83C\\uDFFB|\\uD83E\\uDD32\\uD83C\\uDFFC|\\uD83E\\uDD32\\uD83C\\uDFFD|\\uD83E\\uDD32\\uD83C\\uDFFE|\\uD83E\\uDD32\\uD83C\\uDFFF|\\uD83D\\uDE4F\\uD83C\\uDFFB|\\uD83D\\uDE4F\\uD83C\\uDFFC|\\uD83D\\uDE4F\\uD83C\\uDFFD|\\uD83D\\uDE4F\\uD83C\\uDFFE|\\uD83D\\uDE4F\\uD83C\\uDFFF|\\uD83D\\uDC85\\uD83C\\uDFFB|\\uD83D\\uDC85\\uD83C\\uDFFC|\\uD83D\\uDC85\\uD83C\\uDFFD|\\uD83D\\uDC85\\uD83C\\uDFFE|\\uD83D\\uDC85\\uD83C\\uDFFF|\\uD83D\\uDC42\\uD83C\\uDFFB|\\uD83D\\uDC42\\uD83C\\uDFFC|\\uD83D\\uDC42\\uD83C\\uDFFD|\\uD83D\\uDC42\\uD83C\\uDFFE|\\uD83D\\uDC42\\uD83C\\uDFFF|\\uD83D\\uDC43\\uD83C\\uDFFB|\\uD83D\\uDC43\\uD83C\\uDFFC|\\uD83D\\uDC43\\uD83C\\uDFFD|\\uD83D\\uDC43\\uD83C\\uDFFE|\\uD83D\\uDC43\\uD83C\\uDFFF|\\uD83D\\uDC41\\uD83F\\uDE0F\\u200D\\uD83D\\uDDE8\\uD83F\\uDE0F|\\uD83C\\uDFF3\\uD83F\\uDE0F\\u200D\\uD83C\\uDF08|\\uD83C\\uDDE6\\uD83C\\uDDE8|\\uD83C\\uDDE6\\uD83C\\uDDE9|\\uD83C\\uDDE6\\uD83C\\uDDEA|\\uD83C\\uDDE6\\uD83C\\uDDEB|\\uD83C\\uDDE6\\uD83C\\uDDEC|\\uD83C\\uDDE6\\uD83C\\uDDEE|\\uD83C\\uDDE6\\uD83C\\uDDF1|\\uD83C\\uDDE6\\uD83C\\uDDF2|\\uD83C\\uDDE6\\uD83C\\uDDF4|\\uD83C\\uDDE6\\uD83C\\uDDF6|\\uD83C\\uDDE6\\uD83C\\uDDF7|\\uD83C\\uDDE6\\uD83C\\uDDF8|\\uD83C\\uDDE6\\uD83C\\uDDF9|\\uD83C\\uDDE6\\uD83C\\uDDFA|\\uD83C\\uDDE6\\uD83C\\uDDFC|\\uD83C\\uDDE6\\uD83C\\uDDFD|\\uD83C\\uDDE6\\uD83C\\uDDFF|\\uD83C\\uDDE7\\uD83C\\uDDE6|\\uD83C\\uDDE7\\uD83C\\uDDE7|\\uD83C\\uDDE7\\uD83C\\uDDE9|\\uD83C\\uDDE7\\uD83C\\uDDEA|\\uD83C\\uDDE7\\uD83C\\uDDEB|\\uD83C\\uDDE7\\uD83C\\uDDEC|\\uD83C\\uDDE7\\uD83C\\uDDED|\\uD83C\\uDDE7\\uD83C\\uDDEE|\\uD83C\\uDDE7\\uD83C\\uDDEF|\\uD83C\\uDDE7\\uD83C\\uDDF1|\\uD83C\\uDDE7\\uD83C\\uDDF2|\\uD83C\\uDDE7\\uD83C\\uDDF3|\\uD83C\\uDDE7\\uD83C\\uDDF4|\\uD83C\\uDDE7\\uD83C\\uDDF6|\\uD83C\\uDDE7\\uD83C\\uDDF7|\\uD83C\\uDDE7\\uD83C\\uDDF8|\\uD83C\\uDDE7\\uD83C\\uDDF9|\\uD83C\\uDDE7\\uD83C\\uDDFB|\\uD83C\\uDDE7\\uD83C\\uDDFC|\\uD83C\\uDDE7\\uD83C\\uDDFE|\\uD83C\\uDDE7\\uD83C\\uDDFF|\\uD83C\\uDDE8\\uD83C\\uDDE6|\\uD83C\\uDDE8\\uD83C\\uDDE8|\\uD83C\\uDDE8\\uD83C\\uDDE9|\\uD83C\\uDDE8\\uD83C\\uDDEB|\\uD83C\\uDDE8\\uD83C\\uDDEC|\\uD83C\\uDDE8\\uD83C\\uDDED|\\uD83C\\uDDE8\\uD83C\\uDDEE|\\uD83C\\uDDE8\\uD83C\\uDDF0|\\uD83C\\uDDE8\\uD83C\\uDDF1|\\uD83C\\uDDE8\\uD83C\\uDDF2|\\uD83C\\uDDE8\\uD83C\\uDDF3|\\uD83C\\uDDE8\\uD83C\\uDDF4|\\uD83C\\uDDE8\\uD83C\\uDDF5|\\uD83C\\uDDE8\\uD83C\\uDDF7|\\uD83C\\uDDE8\\uD83C\\uDDFA|\\uD83C\\uDDE8\\uD83C\\uDDFB|\\uD83C\\uDDE8\\uD83C\\uDDFC|\\uD83C\\uDDE8\\uD83C\\uDDFD|\\uD83C\\uDDE8\\uD83C\\uDDFE|\\uD83C\\uDDE8\\uD83C\\uDDFF|\\uD83C\\uDDE9\\uD83C\\uDDEA|\\uD83C\\uDDE9\\uD83C\\uDDEC|\\uD83C\\uDDE9\\uD83C\\uDDEF|\\uD83C\\uDDE9\\uD83C\\uDDF0|\\uD83C\\uDDE9\\uD83C\\uDDF2|\\uD83C\\uDDE9\\uD83C\\uDDF4|\\uD83C\\uDDE9\\uD83C\\uDDFF|\\uD83C\\uDDEA\\uD83C\\uDDE6|\\uD83C\\uDDEA\\uD83C\\uDDE8|\\uD83C\\uDDEA\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDEC|\\uD83C\\uDDEA\\uD83C\\uDDED|\\uD83C\\uDDEA\\uD83C\\uDDF7|\\uD83C\\uDDEA\\uD83C\\uDDF8|\\uD83C\\uDDEA\\uD83C\\uDDF9|\\uD83C\\uDDEA\\uD83C\\uDDFA|\\uD83C\\uDDEB\\uD83C\\uDDEE|\\uD83C\\uDDEB\\uD83C\\uDDEF|\\uD83C\\uDDEB\\uD83C\\uDDF0|\\uD83C\\uDDEB\\uD83C\\uDDF2|\\uD83C\\uDDEB\\uD83C\\uDDF4|\\uD83C\\uDDEB\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE6|\\uD83C\\uDDEC\\uD83C\\uDDE7|\\uD83C\\uDDEC\\uD83C\\uDDE9|\\uD83C\\uDDEC\\uD83C\\uDDEA|\\uD83C\\uDDEC\\uD83C\\uDDEB|\\uD83C\\uDDEC\\uD83C\\uDDEC|\\uD83C\\uDDEC\\uD83C\\uDDED|\\uD83C\\uDDEC\\uD83C\\uDDEE|\\uD83C\\uDDEC\\uD83C\\uDDF1|\\uD83C\\uDDEC\\uD83C\\uDDF2|\\uD83C\\uDDEC\\uD83C\\uDDF3|\\uD83C\\uDDEC\\uD83C\\uDDF5|\\uD83C\\uDDEC\\uD83C\\uDDF6|\\uD83C\\uDDEC\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDF8|\\uD83C\\uDDEC\\uD83C\\uDDF9|\\uD83C\\uDDEC\\uD83C\\uDDFA|\\uD83C\\uDDEC\\uD83C\\uDDFC|\\uD83C\\uDDEC\\uD83C\\uDDFE|\\uD83C\\uDDED\\uD83C\\uDDF0|\\uD83C\\uDDED\\uD83C\\uDDF2|\\uD83C\\uDDED\\uD83C\\uDDF3|\\uD83C\\uDDED\\uD83C\\uDDF7|\\uD83C\\uDDED\\uD83C\\uDDF9|\\uD83C\\uDDED\\uD83C\\uDDFA|\\uD83C\\uDDEE\\uD83C\\uDDE8|\\uD83C\\uDDEE\\uD83C\\uDDE9|\\uD83C\\uDDEE\\uD83C\\uDDEA|\\uD83C\\uDDEE\\uD83C\\uDDF1|\\uD83C\\uDDEE\\uD83C\\uDDF2|\\uD83C\\uDDEE\\uD83C\\uDDF3|\\uD83C\\uDDEE\\uD83C\\uDDF4|\\uD83C\\uDDEE\\uD83C\\uDDF6|\\uD83C\\uDDEE\\uD83C\\uDDF7|\\uD83C\\uDDEE\\uD83C\\uDDF8|\\uD83C\\uDDEE\\uD83C\\uDDF9|\\uD83C\\uDDEF\\uD83C\\uDDEA|\\uD83C\\uDDEF\\uD83C\\uDDF2|\\uD83C\\uDDEF\\uD83C\\uDDF4|\\uD83C\\uDDEF\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDEA|\\uD83C\\uDDF0\\uD83C\\uDDEC|\\uD83C\\uDDF0\\uD83C\\uDDED|\\uD83C\\uDDF0\\uD83C\\uDDEE|\\uD83C\\uDDF0\\uD83C\\uDDF2|\\uD83C\\uDDF0\\uD83C\\uDDF3|\\uD83C\\uDDF0\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDF7|\\uD83C\\uDDF0\\uD83C\\uDDFC|\\uD83C\\uDDF0\\uD83C\\uDDFE|\\uD83C\\uDDF0\\uD83C\\uDDFF|\\uD83C\\uDDF1\\uD83C\\uDDE6|\\uD83C\\uDDF1\\uD83C\\uDDE7|\\uD83C\\uDDF1\\uD83C\\uDDE8|\\uD83C\\uDDF1\\uD83C\\uDDEE|\\uD83C\\uDDF1\\uD83C\\uDDF0|\\uD83C\\uDDF1\\uD83C\\uDDF7|\\uD83C\\uDDF1\\uD83C\\uDDF8|\\uD83C\\uDDF1\\uD83C\\uDDF9|\\uD83C\\uDDF1\\uD83C\\uDDFA|\\uD83C\\uDDF1\\uD83C\\uDDFB|\\uD83C\\uDDF1\\uD83C\\uDDFE|\\uD83C\\uDDF2\\uD83C\\uDDE6|\\uD83C\\uDDF2\\uD83C\\uDDE8|\\uD83C\\uDDF2\\uD83C\\uDDE9|\\uD83C\\uDDF2\\uD83C\\uDDEA|\\uD83C\\uDDF2\\uD83C\\uDDEB|\\uD83C\\uDDF2\\uD83C\\uDDEC|\\uD83C\\uDDF2\\uD83C\\uDDED|\\uD83C\\uDDF2\\uD83C\\uDDF0|\\uD83C\\uDDF2\\uD83C\\uDDF1|\\uD83C\\uDDF2\\uD83C\\uDDF2|\\uD83C\\uDDF2\\uD83C\\uDDF3|\\uD83C\\uDDF2\\uD83C\\uDDF4|\\uD83C\\uDDF2\\uD83C\\uDDF5|\\uD83C\\uDDF2\\uD83C\\uDDF6|\\uD83C\\uDDF2\\uD83C\\uDDF7|\\uD83C\\uDDF2\\uD83C\\uDDF8|\\uD83C\\uDDF2\\uD83C\\uDDF9|\\uD83C\\uDDF2\\uD83C\\uDDFA|\\uD83C\\uDDF2\\uD83C\\uDDFB|\\uD83C\\uDDF2\\uD83C\\uDDFC|\\uD83C\\uDDF2\\uD83C\\uDDFD|\\uD83C\\uDDF2\\uD83C\\uDDFE|\\uD83C\\uDDF2\\uD83C\\uDDFF|\\uD83C\\uDDF3\\uD83C\\uDDE6|\\uD83C\\uDDF3\\uD83C\\uDDE8|\\uD83C\\uDDF3\\uD83C\\uDDEA|\\uD83C\\uDDF3\\uD83C\\uDDEB|\\uD83C\\uDDF3\\uD83C\\uDDEC|\\uD83C\\uDDF3\\uD83C\\uDDEE|\\uD83C\\uDDF3\\uD83C\\uDDF1|\\uD83C\\uDDF3\\uD83C\\uDDF4|\\uD83C\\uDDF3\\uD83C\\uDDF5|\\uD83C\\uDDF3\\uD83C\\uDDF7|\\uD83C\\uDDF3\\uD83C\\uDDFA|\\uD83C\\uDDF3\\uD83C\\uDDFF|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDE6|\\uD83C\\uDDF5\\uD83C\\uDDEA|\\uD83C\\uDDF5\\uD83C\\uDDEB|\\uD83C\\uDDF5\\uD83C\\uDDEC|\\uD83C\\uDDF5\\uD83C\\uDDED|\\uD83C\\uDDF5\\uD83C\\uDDF0|\\uD83C\\uDDF5\\uD83C\\uDDF1|\\uD83C\\uDDF5\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDF3|\\uD83C\\uDDF5\\uD83C\\uDDF7|\\uD83C\\uDDF5\\uD83C\\uDDF8|\\uD83C\\uDDF5\\uD83C\\uDDF9|\\uD83C\\uDDF5\\uD83C\\uDDFC|\\uD83C\\uDDF5\\uD83C\\uDDFE|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF7\\uD83C\\uDDEA|\\uD83C\\uDDF7\\uD83C\\uDDF4|\\uD83C\\uDDF7\\uD83C\\uDDF8|\\uD83C\\uDDF7\\uD83C\\uDDFA|\\uD83C\\uDDF7\\uD83C\\uDDFC|\\uD83C\\uDDF8\\uD83C\\uDDE6|\\uD83C\\uDDF8\\uD83C\\uDDE7|\\uD83C\\uDDF8\\uD83C\\uDDE8|\\uD83C\\uDDF8\\uD83C\\uDDE9|\\uD83C\\uDDF8\\uD83C\\uDDEA|\\uD83C\\uDDF8\\uD83C\\uDDEC|\\uD83C\\uDDF8\\uD83C\\uDDED|\\uD83C\\uDDF8\\uD83C\\uDDEE|\\uD83C\\uDDF8\\uD83C\\uDDEF|\\uD83C\\uDDF8\\uD83C\\uDDF0|\\uD83C\\uDDF8\\uD83C\\uDDF1|\\uD83C\\uDDF8\\uD83C\\uDDF2|\\uD83C\\uDDF8\\uD83C\\uDDF3|\\uD83C\\uDDF8\\uD83C\\uDDF4|\\uD83C\\uDDF8\\uD83C\\uDDF7|\\uD83C\\uDDF8\\uD83C\\uDDF8|\\uD83C\\uDDF8\\uD83C\\uDDF9|\\uD83C\\uDDF8\\uD83C\\uDDFB|\\uD83C\\uDDF8\\uD83C\\uDDFD|\\uD83C\\uDDF8\\uD83C\\uDDFE|\\uD83C\\uDDF8\\uD83C\\uDDFF|\\uD83C\\uDDF9\\uD83C\\uDDE6|\\uD83C\\uDDF9\\uD83C\\uDDE8|\\uD83C\\uDDF9\\uD83C\\uDDE9|\\uD83C\\uDDF9\\uD83C\\uDDEB|\\uD83C\\uDDF9\\uD83C\\uDDEC|\\uD83C\\uDDF9\\uD83C\\uDDED|\\uD83C\\uDDF9\\uD83C\\uDDEF|\\uD83C\\uDDF9\\uD83C\\uDDF0|\\uD83C\\uDDF9\\uD83C\\uDDF1|\\uD83C\\uDDF9\\uD83C\\uDDF2|\\uD83C\\uDDF9\\uD83C\\uDDF3|\\uD83C\\uDDF9\\uD83C\\uDDF4|\\uD83C\\uDDF9\\uD83C\\uDDF7|\\uD83C\\uDDF9\\uD83C\\uDDF9|\\uD83C\\uDDF9\\uD83C\\uDDFB|\\uD83C\\uDDF9\\uD83C\\uDDFC|\\uD83C\\uDDF9\\uD83C\\uDDFF|\\uD83C\\uDDFA\\uD83C\\uDDE6|\\uD83C\\uDDFA\\uD83C\\uDDEC|\\uD83C\\uDDFA\\uD83C\\uDDF2|\\uD83C\\uDDFA\\uD83C\\uDDF3|\\uD83C\\uDDFA\\uD83C\\uDDF8|\\uD83C\\uDDFA\\uD83C\\uDDFE|\\uD83C\\uDDFA\\uD83C\\uDDFF|\\uD83C\\uDDFB\\uD83C\\uDDE6|\\uD83C\\uDDFB\\uD83C\\uDDE8|\\uD83C\\uDDFB\\uD83C\\uDDEA|\\uD83C\\uDDFB\\uD83C\\uDDEC|\\uD83C\\uDDFB\\uD83C\\uDDEE|\\uD83C\\uDDFB\\uD83C\\uDDF3|\\uD83C\\uDDFB\\uD83C\\uDDFA|\\uD83C\\uDDFC\\uD83C\\uDDEB|\\uD83C\\uDDFC\\uD83C\\uDDF8|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDFE\\uD83C\\uDDEA|\\uD83C\\uDDFE\\uD83C\\uDDF9|\\uD83C\\uDDFF\\uD83C\\uDDE6|\\uD83C\\uDDFF\\uD83C\\uDDF2|\\uD83C\\uDDFF\\uD83C\\uDDFC|\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67\\uDB40\\uDC7F|\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74\\uDB40\\uDC7F|\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73\\uDB40\\uDC7F|[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF][\\u200D|\\uFE0F]|[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF]|[0-9|*|#]\\uFE0F\\u20E3|[0-9|#]\\u20E3|[\\u203C-\\u3299]\\uFE0F\\u200D|[\\u203C-\\u3299]\\uFE0F|[\\u2122-\\u2B55]|\\u303D|[\\A9|\\AE]\\u3030|\\uA9|\\uAE|\\u3030)/ig;\n    var unicodeRegExp = /\\uf476\\uf3fb|\\uf476\\uf3fc|\\uf476\\uf3fd|\\uf476\\uf3fe|\\uf476\\uf3ff|\\uf9d2\\uf3fb|\\uf9d2\\uf3fc|\\uf9d2\\uf3fd|\\uf9d2\\uf3fe|\\uf9d2\\uf3ff|\\uf466\\uf3fb|\\uf466\\uf3fc|\\uf466\\uf3fd|\\uf466\\uf3fe|\\uf466\\uf3ff|\\uf467\\uf3fb|\\uf467\\uf3fc|\\uf467\\uf3fd|\\uf467\\uf3fe|\\uf467\\uf3ff|\\uf9d1\\uf3fb|\\uf9d1\\uf3fc|\\uf9d1\\uf3fd|\\uf9d1\\uf3fe|\\uf9d1\\uf3ff|\\uf468\\uf3fb|\\uf468\\uf3fc|\\uf468\\uf3fd|\\uf468\\uf3fe|\\uf468\\uf3ff|\\uf469\\uf3fb|\\uf469\\uf3fc|\\uf469\\uf3fd|\\uf469\\uf3fe|\\uf469\\uf3ff|\\uf9d3\\uf3fb|\\uf9d3\\uf3fc|\\uf9d3\\uf3fd|\\uf9d3\\uf3fe|\\uf9d3\\uf3ff|\\uf474\\uf3fb|\\uf474\\uf3fc|\\uf474\\uf3fd|\\uf474\\uf3fe|\\uf474\\uf3ff|\\uf475\\uf3fb|\\uf475\\uf3fc|\\uf475\\uf3fd|\\uf475\\uf3fe|\\uf475\\uf3ff|\\uf468\\uf3fb\\u200d\\u2695\\ufe0f|\\uf468\\uf3fc\\u200d\\u2695\\ufe0f|\\uf468\\uf3fd\\u200d\\u2695\\ufe0f|\\uf468\\uf3fe\\u200d\\u2695\\ufe0f|\\uf468\\uf3ff\\u200d\\u2695\\ufe0f|\\uf469\\uf3fb\\u200d\\u2695\\ufe0f|\\uf469\\uf3fc\\u200d\\u2695\\ufe0f|\\uf469\\uf3fd\\u200d\\u2695\\ufe0f|\\uf469\\uf3fe\\u200d\\u2695\\ufe0f|\\uf469\\uf3ff\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\uf393|\\uf468\\uf3fc\\u200d\\uf393|\\uf468\\uf3fd\\u200d\\uf393|\\uf468\\uf3fe\\u200d\\uf393|\\uf468\\uf3ff\\u200d\\uf393|\\uf469\\uf3fb\\u200d\\uf393|\\uf469\\uf3fc\\u200d\\uf393|\\uf469\\uf3fd\\u200d\\uf393|\\uf469\\uf3fe\\u200d\\uf393|\\uf469\\uf3ff\\u200d\\uf393|\\uf468\\uf3fb\\u200d\\uf3eb|\\uf468\\uf3fc\\u200d\\uf3eb|\\uf468\\uf3fd\\u200d\\uf3eb|\\uf468\\uf3fe\\u200d\\uf3eb|\\uf468\\uf3ff\\u200d\\uf3eb|\\uf469\\uf3fb\\u200d\\uf3eb|\\uf469\\uf3fc\\u200d\\uf3eb|\\uf469\\uf3fd\\u200d\\uf3eb|\\uf469\\uf3fe\\u200d\\uf3eb|\\uf469\\uf3ff\\u200d\\uf3eb|\\uf468\\uf3fb\\u200d\\u2696\\ufe0f|\\uf468\\uf3fc\\u200d\\u2696\\ufe0f|\\uf468\\uf3fd\\u200d\\u2696\\ufe0f|\\uf468\\uf3fe\\u200d\\u2696\\ufe0f|\\uf468\\uf3ff\\u200d\\u2696\\ufe0f|\\uf469\\uf3fb\\u200d\\u2696\\ufe0f|\\uf469\\uf3fc\\u200d\\u2696\\ufe0f|\\uf469\\uf3fd\\u200d\\u2696\\ufe0f|\\uf469\\uf3fe\\u200d\\u2696\\ufe0f|\\uf469\\uf3ff\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\uf33e|\\uf468\\uf3fc\\u200d\\uf33e|\\uf468\\uf3fd\\u200d\\uf33e|\\uf468\\uf3fe\\u200d\\uf33e|\\uf468\\uf3ff\\u200d\\uf33e|\\uf469\\uf3fb\\u200d\\uf33e|\\uf469\\uf3fc\\u200d\\uf33e|\\uf469\\uf3fd\\u200d\\uf33e|\\uf469\\uf3fe\\u200d\\uf33e|\\uf469\\uf3ff\\u200d\\uf33e|\\uf468\\uf3fb\\u200d\\uf373|\\uf468\\uf3fc\\u200d\\uf373|\\uf468\\uf3fd\\u200d\\uf373|\\uf468\\uf3fe\\u200d\\uf373|\\uf468\\uf3ff\\u200d\\uf373|\\uf469\\uf3fb\\u200d\\uf373|\\uf469\\uf3fc\\u200d\\uf373|\\uf469\\uf3fd\\u200d\\uf373|\\uf469\\uf3fe\\u200d\\uf373|\\uf469\\uf3ff\\u200d\\uf373|\\uf468\\uf3fb\\u200d\\uf527|\\uf468\\uf3fc\\u200d\\uf527|\\uf468\\uf3fd\\u200d\\uf527|\\uf468\\uf3fe\\u200d\\uf527|\\uf468\\uf3ff\\u200d\\uf527|\\uf469\\uf3fb\\u200d\\uf527|\\uf469\\uf3fc\\u200d\\uf527|\\uf469\\uf3fd\\u200d\\uf527|\\uf469\\uf3fe\\u200d\\uf527|\\uf469\\uf3ff\\u200d\\uf527|\\uf468\\uf3fb\\u200d\\uf3ed|\\uf468\\uf3fc\\u200d\\uf3ed|\\uf468\\uf3fd\\u200d\\uf3ed|\\uf468\\uf3fe\\u200d\\uf3ed|\\uf468\\uf3ff\\u200d\\uf3ed|\\uf469\\uf3fb\\u200d\\uf3ed|\\uf469\\uf3fc\\u200d\\uf3ed|\\uf469\\uf3fd\\u200d\\uf3ed|\\uf469\\uf3fe\\u200d\\uf3ed|\\uf469\\uf3ff\\u200d\\uf3ed|\\uf468\\uf3fb\\u200d\\uf4bc|\\uf468\\uf3fc\\u200d\\uf4bc|\\uf468\\uf3fd\\u200d\\uf4bc|\\uf468\\uf3fe\\u200d\\uf4bc|\\uf468\\uf3ff\\u200d\\uf4bc|\\uf469\\uf3fb\\u200d\\uf4bc|\\uf469\\uf3fc\\u200d\\uf4bc|\\uf469\\uf3fd\\u200d\\uf4bc|\\uf469\\uf3fe\\u200d\\uf4bc|\\uf469\\uf3ff\\u200d\\uf4bc|\\uf468\\uf3fb\\u200d\\uf52c|\\uf468\\uf3fc\\u200d\\uf52c|\\uf468\\uf3fd\\u200d\\uf52c|\\uf468\\uf3fe\\u200d\\uf52c|\\uf468\\uf3ff\\u200d\\uf52c|\\uf469\\uf3fb\\u200d\\uf52c|\\uf469\\uf3fc\\u200d\\uf52c|\\uf469\\uf3fd\\u200d\\uf52c|\\uf469\\uf3fe\\u200d\\uf52c|\\uf469\\uf3ff\\u200d\\uf52c|\\uf468\\uf3fb\\u200d\\uf4bb|\\uf468\\uf3fc\\u200d\\uf4bb|\\uf468\\uf3fd\\u200d\\uf4bb|\\uf468\\uf3fe\\u200d\\uf4bb|\\uf468\\uf3ff\\u200d\\uf4bb|\\uf469\\uf3fb\\u200d\\uf4bb|\\uf469\\uf3fc\\u200d\\uf4bb|\\uf469\\uf3fd\\u200d\\uf4bb|\\uf469\\uf3fe\\u200d\\uf4bb|\\uf469\\uf3ff\\u200d\\uf4bb|\\uf468\\uf3fb\\u200d\\uf3a4|\\uf468\\uf3fc\\u200d\\uf3a4|\\uf468\\uf3fd\\u200d\\uf3a4|\\uf468\\uf3fe\\u200d\\uf3a4|\\uf468\\uf3ff\\u200d\\uf3a4|\\uf469\\uf3fb\\u200d\\uf3a4|\\uf469\\uf3fc\\u200d\\uf3a4|\\uf469\\uf3fd\\u200d\\uf3a4|\\uf469\\uf3fe\\u200d\\uf3a4|\\uf469\\uf3ff\\u200d\\uf3a4|\\uf468\\uf3fb\\u200d\\uf3a8|\\uf468\\uf3fc\\u200d\\uf3a8|\\uf468\\uf3fd\\u200d\\uf3a8|\\uf468\\uf3fe\\u200d\\uf3a8|\\uf468\\uf3ff\\u200d\\uf3a8|\\uf469\\uf3fb\\u200d\\uf3a8|\\uf469\\uf3fc\\u200d\\uf3a8|\\uf469\\uf3fd\\u200d\\uf3a8|\\uf469\\uf3fe\\u200d\\uf3a8|\\uf469\\uf3ff\\u200d\\uf3a8|\\uf468\\uf3fb\\u200d\\u2708\\ufe0f|\\uf468\\uf3fc\\u200d\\u2708\\ufe0f|\\uf468\\uf3fd\\u200d\\u2708\\ufe0f|\\uf468\\uf3fe\\u200d\\u2708\\ufe0f|\\uf468\\uf3ff\\u200d\\u2708\\ufe0f|\\uf469\\uf3fb\\u200d\\u2708\\ufe0f|\\uf469\\uf3fc\\u200d\\u2708\\ufe0f|\\uf469\\uf3fd\\u200d\\u2708\\ufe0f|\\uf469\\uf3fe\\u200d\\u2708\\ufe0f|\\uf469\\uf3ff\\u200d\\u2708\\ufe0f|\\uf468\\uf3fb\\u200d\\uf680|\\uf468\\uf3fc\\u200d\\uf680|\\uf468\\uf3fd\\u200d\\uf680|\\uf468\\uf3fe\\u200d\\uf680|\\uf468\\uf3ff\\u200d\\uf680|\\uf469\\uf3fb\\u200d\\uf680|\\uf469\\uf3fc\\u200d\\uf680|\\uf469\\uf3fd\\u200d\\uf680|\\uf469\\uf3fe\\u200d\\uf680|\\uf469\\uf3ff\\u200d\\uf680|\\uf468\\uf3fb\\u200d\\uf692|\\uf468\\uf3fc\\u200d\\uf692|\\uf468\\uf3fd\\u200d\\uf692|\\uf468\\uf3fe\\u200d\\uf692|\\uf468\\uf3ff\\u200d\\uf692|\\uf469\\uf3fb\\u200d\\uf692|\\uf469\\uf3fc\\u200d\\uf692|\\uf469\\uf3fd\\u200d\\uf692|\\uf469\\uf3fe\\u200d\\uf692|\\uf469\\uf3ff\\u200d\\uf692|\\uf46e\\uf3fb|\\uf46e\\uf3fc|\\uf46e\\uf3fd|\\uf46e\\uf3fe|\\uf46e\\uf3ff|\\uf46e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf575\\uf3fb|\\uf575\\uf3fc|\\uf575\\uf3fd|\\uf575\\uf3fe|\\uf575\\uf3ff|\\uf575\\uf3fb\\u200d\\u2642\\ufe0f|\\uf575\\uf3fc\\u200d\\u2642\\ufe0f|\\uf575\\uf3fd\\u200d\\u2642\\ufe0f|\\uf575\\uf3fe\\u200d\\u2642\\ufe0f|\\uf575\\uf3ff\\u200d\\u2642\\ufe0f|\\uf575\\uf3fb\\u200d\\u2640\\ufe0f|\\uf575\\uf3fc\\u200d\\u2640\\ufe0f|\\uf575\\uf3fd\\u200d\\u2640\\ufe0f|\\uf575\\uf3fe\\u200d\\u2640\\ufe0f|\\uf575\\uf3ff\\u200d\\u2640\\ufe0f|\\uf482\\uf3fb|\\uf482\\uf3fc|\\uf482\\uf3fd|\\uf482\\uf3fe|\\uf482\\uf3ff|\\uf482\\uf3fb\\u200d\\u2642\\ufe0f|\\uf482\\uf3fc\\u200d\\u2642\\ufe0f|\\uf482\\uf3fd\\u200d\\u2642\\ufe0f|\\uf482\\uf3fe\\u200d\\u2642\\ufe0f|\\uf482\\uf3ff\\u200d\\u2642\\ufe0f|\\uf482\\uf3fb\\u200d\\u2640\\ufe0f|\\uf482\\uf3fc\\u200d\\u2640\\ufe0f|\\uf482\\uf3fd\\u200d\\u2640\\ufe0f|\\uf482\\uf3fe\\u200d\\u2640\\ufe0f|\\uf482\\uf3ff\\u200d\\u2640\\ufe0f|\\uf477\\uf3fb|\\uf477\\uf3fc|\\uf477\\uf3fd|\\uf477\\uf3fe|\\uf477\\uf3ff|\\uf477\\uf3fb\\u200d\\u2642\\ufe0f|\\uf477\\uf3fc\\u200d\\u2642\\ufe0f|\\uf477\\uf3fd\\u200d\\u2642\\ufe0f|\\uf477\\uf3fe\\u200d\\u2642\\ufe0f|\\uf477\\uf3ff\\u200d\\u2642\\ufe0f|\\uf477\\uf3fb\\u200d\\u2640\\ufe0f|\\uf477\\uf3fc\\u200d\\u2640\\ufe0f|\\uf477\\uf3fd\\u200d\\u2640\\ufe0f|\\uf477\\uf3fe\\u200d\\u2640\\ufe0f|\\uf477\\uf3ff\\u200d\\u2640\\ufe0f|\\uf934\\uf3fb|\\uf934\\uf3fc|\\uf934\\uf3fd|\\uf934\\uf3fe|\\uf934\\uf3ff|\\uf478\\uf3fb|\\uf478\\uf3fc|\\uf478\\uf3fd|\\uf478\\uf3fe|\\uf478\\uf3ff|\\uf473\\uf3fb|\\uf473\\uf3fc|\\uf473\\uf3fd|\\uf473\\uf3fe|\\uf473\\uf3ff|\\uf473\\uf3fb\\u200d\\u2642\\ufe0f|\\uf473\\uf3fc\\u200d\\u2642\\ufe0f|\\uf473\\uf3fd\\u200d\\u2642\\ufe0f|\\uf473\\uf3fe\\u200d\\u2642\\ufe0f|\\uf473\\uf3ff\\u200d\\u2642\\ufe0f|\\uf473\\uf3fb\\u200d\\u2640\\ufe0f|\\uf473\\uf3fc\\u200d\\u2640\\ufe0f|\\uf473\\uf3fd\\u200d\\u2640\\ufe0f|\\uf473\\uf3fe\\u200d\\u2640\\ufe0f|\\uf473\\uf3ff\\u200d\\u2640\\ufe0f|\\uf472\\uf3fb|\\uf472\\uf3fc|\\uf472\\uf3fd|\\uf472\\uf3fe|\\uf472\\uf3ff|\\uf9d5\\uf3fb|\\uf9d5\\uf3fc|\\uf9d5\\uf3fd|\\uf9d5\\uf3fe|\\uf9d5\\uf3ff|\\uf9d4\\uf3fb|\\uf9d4\\uf3fc|\\uf9d4\\uf3fd|\\uf9d4\\uf3fe|\\uf9d4\\uf3ff|\\uf471\\uf3fb|\\uf471\\uf3fc|\\uf471\\uf3fd|\\uf471\\uf3fe|\\uf471\\uf3ff|\\uf471\\uf3fb\\u200d\\u2642\\ufe0f|\\uf471\\uf3fc\\u200d\\u2642\\ufe0f|\\uf471\\uf3fd\\u200d\\u2642\\ufe0f|\\uf471\\uf3fe\\u200d\\u2642\\ufe0f|\\uf471\\uf3ff\\u200d\\u2642\\ufe0f|\\uf471\\uf3fb\\u200d\\u2640\\ufe0f|\\uf471\\uf3fc\\u200d\\u2640\\ufe0f|\\uf471\\uf3fd\\u200d\\u2640\\ufe0f|\\uf471\\uf3fe\\u200d\\u2640\\ufe0f|\\uf471\\uf3ff\\u200d\\u2640\\ufe0f|\\uf935\\uf3fb|\\uf935\\uf3fc|\\uf935\\uf3fd|\\uf935\\uf3fe|\\uf935\\uf3ff|\\uf470\\uf3fb|\\uf470\\uf3fc|\\uf470\\uf3fd|\\uf470\\uf3fe|\\uf470\\uf3ff|\\uf930\\uf3fb|\\uf930\\uf3fc|\\uf930\\uf3fd|\\uf930\\uf3fe|\\uf930\\uf3ff|\\uf931\\uf3fb|\\uf931\\uf3fc|\\uf931\\uf3fd|\\uf931\\uf3fe|\\uf931\\uf3ff|\\uf47c\\uf3fb|\\uf47c\\uf3fc|\\uf47c\\uf3fd|\\uf47c\\uf3fe|\\uf47c\\uf3ff|\\uf385\\uf3fb|\\uf385\\uf3fc|\\uf385\\uf3fd|\\uf385\\uf3fe|\\uf385\\uf3ff|\\uf936\\uf3fb|\\uf936\\uf3fc|\\uf936\\uf3fd|\\uf936\\uf3fe|\\uf936\\uf3ff|\\uf9d9\\uf3fb|\\uf9d9\\uf3fc|\\uf9d9\\uf3fd|\\uf9d9\\uf3fe|\\uf9d9\\uf3ff|\\uf9d9\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fb|\\uf9da\\uf3fc|\\uf9da\\uf3fd|\\uf9da\\uf3fe|\\uf9da\\uf3ff|\\uf9da\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fb|\\uf9db\\uf3fc|\\uf9db\\uf3fd|\\uf9db\\uf3fe|\\uf9db\\uf3ff|\\uf9db\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fb|\\uf9dc\\uf3fc|\\uf9dc\\uf3fd|\\uf9dc\\uf3fe|\\uf9dc\\uf3ff|\\uf9dc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fb|\\uf9dd\\uf3fc|\\uf9dd\\uf3fd|\\uf9dd\\uf3fe|\\uf9dd\\uf3ff|\\uf9dd\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb|\\uf64d\\uf3fc|\\uf64d\\uf3fd|\\uf64d\\uf3fe|\\uf64d\\uf3ff|\\uf64d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fb|\\uf64e\\uf3fc|\\uf64e\\uf3fd|\\uf64e\\uf3fe|\\uf64e\\uf3ff|\\uf64e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf645\\uf3fb|\\uf645\\uf3fc|\\uf645\\uf3fd|\\uf645\\uf3fe|\\uf645\\uf3ff|\\uf645\\uf3fb\\u200d\\u2642\\ufe0f|\\uf645\\uf3fc\\u200d\\u2642\\ufe0f|\\uf645\\uf3fd\\u200d\\u2642\\ufe0f|\\uf645\\uf3fe\\u200d\\u2642\\ufe0f|\\uf645\\uf3ff\\u200d\\u2642\\ufe0f|\\uf645\\uf3fb\\u200d\\u2640\\ufe0f|\\uf645\\uf3fc\\u200d\\u2640\\ufe0f|\\uf645\\uf3fd\\u200d\\u2640\\ufe0f|\\uf645\\uf3fe\\u200d\\u2640\\ufe0f|\\uf645\\uf3ff\\u200d\\u2640\\ufe0f|\\uf646\\uf3fb|\\uf646\\uf3fc|\\uf646\\uf3fd|\\uf646\\uf3fe|\\uf646\\uf3ff|\\uf646\\uf3fb\\u200d\\u2642\\ufe0f|\\uf646\\uf3fc\\u200d\\u2642\\ufe0f|\\uf646\\uf3fd\\u200d\\u2642\\ufe0f|\\uf646\\uf3fe\\u200d\\u2642\\ufe0f|\\uf646\\uf3ff\\u200d\\u2642\\ufe0f|\\uf646\\uf3fb\\u200d\\u2640\\ufe0f|\\uf646\\uf3fc\\u200d\\u2640\\ufe0f|\\uf646\\uf3fd\\u200d\\u2640\\ufe0f|\\uf646\\uf3fe\\u200d\\u2640\\ufe0f|\\uf646\\uf3ff\\u200d\\u2640\\ufe0f|\\uf481\\uf3fb|\\uf481\\uf3fc|\\uf481\\uf3fd|\\uf481\\uf3fe|\\uf481\\uf3ff|\\uf481\\uf3fb\\u200d\\u2642\\ufe0f|\\uf481\\uf3fc\\u200d\\u2642\\ufe0f|\\uf481\\uf3fd\\u200d\\u2642\\ufe0f|\\uf481\\uf3fe\\u200d\\u2642\\ufe0f|\\uf481\\uf3ff\\u200d\\u2642\\ufe0f|\\uf481\\uf3fb\\u200d\\u2640\\ufe0f|\\uf481\\uf3fc\\u200d\\u2640\\ufe0f|\\uf481\\uf3fd\\u200d\\u2640\\ufe0f|\\uf481\\uf3fe\\u200d\\u2640\\ufe0f|\\uf481\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fb|\\uf64b\\uf3fc|\\uf64b\\uf3fd|\\uf64b\\uf3fe|\\uf64b\\uf3ff|\\uf64b\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2640\\ufe0f|\\uf647\\uf3fb|\\uf647\\uf3fc|\\uf647\\uf3fd|\\uf647\\uf3fe|\\uf647\\uf3ff|\\uf647\\uf3fb\\u200d\\u2642\\ufe0f|\\uf647\\uf3fc\\u200d\\u2642\\ufe0f|\\uf647\\uf3fd\\u200d\\u2642\\ufe0f|\\uf647\\uf3fe\\u200d\\u2642\\ufe0f|\\uf647\\uf3ff\\u200d\\u2642\\ufe0f|\\uf647\\uf3fb\\u200d\\u2640\\ufe0f|\\uf647\\uf3fc\\u200d\\u2640\\ufe0f|\\uf647\\uf3fd\\u200d\\u2640\\ufe0f|\\uf647\\uf3fe\\u200d\\u2640\\ufe0f|\\uf647\\uf3ff\\u200d\\u2640\\ufe0f|\\uf926\\uf3fb|\\uf926\\uf3fc|\\uf926\\uf3fd|\\uf926\\uf3fe|\\uf926\\uf3ff|\\uf926\\uf3fb\\u200d\\u2642\\ufe0f|\\uf926\\uf3fc\\u200d\\u2642\\ufe0f|\\uf926\\uf3fd\\u200d\\u2642\\ufe0f|\\uf926\\uf3fe\\u200d\\u2642\\ufe0f|\\uf926\\uf3ff\\u200d\\u2642\\ufe0f|\\uf926\\uf3fb\\u200d\\u2640\\ufe0f|\\uf926\\uf3fc\\u200d\\u2640\\ufe0f|\\uf926\\uf3fd\\u200d\\u2640\\ufe0f|\\uf926\\uf3fe\\u200d\\u2640\\ufe0f|\\uf926\\uf3ff\\u200d\\u2640\\ufe0f|\\uf937\\uf3fb|\\uf937\\uf3fc|\\uf937\\uf3fd|\\uf937\\uf3fe|\\uf937\\uf3ff|\\uf937\\uf3fb\\u200d\\u2642\\ufe0f|\\uf937\\uf3fc\\u200d\\u2642\\ufe0f|\\uf937\\uf3fd\\u200d\\u2642\\ufe0f|\\uf937\\uf3fe\\u200d\\u2642\\ufe0f|\\uf937\\uf3ff\\u200d\\u2642\\ufe0f|\\uf937\\uf3fb\\u200d\\u2640\\ufe0f|\\uf937\\uf3fc\\u200d\\u2640\\ufe0f|\\uf937\\uf3fd\\u200d\\u2640\\ufe0f|\\uf937\\uf3fe\\u200d\\u2640\\ufe0f|\\uf937\\uf3ff\\u200d\\u2640\\ufe0f|\\uf486\\uf3fb|\\uf486\\uf3fc|\\uf486\\uf3fd|\\uf486\\uf3fe|\\uf486\\uf3ff|\\uf486\\uf3fb\\u200d\\u2642\\ufe0f|\\uf486\\uf3fc\\u200d\\u2642\\ufe0f|\\uf486\\uf3fd\\u200d\\u2642\\ufe0f|\\uf486\\uf3fe\\u200d\\u2642\\ufe0f|\\uf486\\uf3ff\\u200d\\u2642\\ufe0f|\\uf486\\uf3fb\\u200d\\u2640\\ufe0f|\\uf486\\uf3fc\\u200d\\u2640\\ufe0f|\\uf486\\uf3fd\\u200d\\u2640\\ufe0f|\\uf486\\uf3fe\\u200d\\u2640\\ufe0f|\\uf486\\uf3ff\\u200d\\u2640\\ufe0f|\\uf487\\uf3fb|\\uf487\\uf3fc|\\uf487\\uf3fd|\\uf487\\uf3fe|\\uf487\\uf3ff|\\uf487\\uf3fb\\u200d\\u2642\\ufe0f|\\uf487\\uf3fc\\u200d\\u2642\\ufe0f|\\uf487\\uf3fd\\u200d\\u2642\\ufe0f|\\uf487\\uf3fe\\u200d\\u2642\\ufe0f|\\uf487\\uf3ff\\u200d\\u2642\\ufe0f|\\uf487\\uf3fb\\u200d\\u2640\\ufe0f|\\uf487\\uf3fc\\u200d\\u2640\\ufe0f|\\uf487\\uf3fd\\u200d\\u2640\\ufe0f|\\uf487\\uf3fe\\u200d\\u2640\\ufe0f|\\uf487\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fb|\\uf6b6\\uf3fc|\\uf6b6\\uf3fd|\\uf6b6\\uf3fe|\\uf6b6\\uf3ff|\\uf6b6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fb|\\uf3c3\\uf3fc|\\uf3c3\\uf3fd|\\uf3c3\\uf3fe|\\uf3c3\\uf3ff|\\uf3c3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf483\\uf3fb|\\uf483\\uf3fc|\\uf483\\uf3fd|\\uf483\\uf3fe|\\uf483\\uf3ff|\\uf57a\\uf3fb|\\uf57a\\uf3fc|\\uf57a\\uf3fd|\\uf57a\\uf3fe|\\uf57a\\uf3ff|\\uf9d6\\uf3fb|\\uf9d6\\uf3fc|\\uf9d6\\uf3fd|\\uf9d6\\uf3fe|\\uf9d6\\uf3ff|\\uf9d6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fb|\\uf9d7\\uf3fc|\\uf9d7\\uf3fd|\\uf9d7\\uf3fe|\\uf9d7\\uf3ff|\\uf9d7\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fb|\\uf9d8\\uf3fc|\\uf9d8\\uf3fd|\\uf9d8\\uf3fe|\\uf9d8\\uf3ff|\\uf9d8\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6c0\\uf3fb|\\uf6c0\\uf3fc|\\uf6c0\\uf3fd|\\uf6c0\\uf3fe|\\uf6c0\\uf3ff|\\uf6cc\\uf3fb|\\uf6cc\\uf3fc|\\uf6cc\\uf3fd|\\uf6cc\\uf3fe|\\uf6cc\\uf3ff|\\uf574\\uf3fb|\\uf574\\uf3fc|\\uf574\\uf3fd|\\uf574\\uf3fe|\\uf574\\uf3ff|\\uf3c7\\uf3fb|\\uf3c7\\uf3fc|\\uf3c7\\uf3fd|\\uf3c7\\uf3fe|\\uf3c7\\uf3ff|\\uf3c2\\uf3fb|\\uf3c2\\uf3fc|\\uf3c2\\uf3fd|\\uf3c2\\uf3fe|\\uf3c2\\uf3ff|\\uf3cc\\uf3fb|\\uf3cc\\uf3fc|\\uf3cc\\uf3fd|\\uf3cc\\uf3fe|\\uf3cc\\uf3ff|\\uf3cc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fb|\\uf3c4\\uf3fc|\\uf3c4\\uf3fd|\\uf3c4\\uf3fe|\\uf3c4\\uf3ff|\\uf3c4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fb|\\uf6a3\\uf3fc|\\uf6a3\\uf3fd|\\uf6a3\\uf3fe|\\uf6a3\\uf3ff|\\uf6a3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fb|\\uf3ca\\uf3fc|\\uf3ca\\uf3fd|\\uf3ca\\uf3fe|\\uf3ca\\uf3ff|\\uf3ca\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fb|\\uf3cb\\uf3fc|\\uf3cb\\uf3fd|\\uf3cb\\uf3fe|\\uf3cb\\uf3ff|\\uf3cb\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fb|\\uf6b4\\uf3fc|\\uf6b4\\uf3fd|\\uf6b4\\uf3fe|\\uf6b4\\uf3ff|\\uf6b4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fb|\\uf6b5\\uf3fc|\\uf6b5\\uf3fd|\\uf6b5\\uf3fe|\\uf6b5\\uf3ff|\\uf6b5\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2640\\ufe0f|\\uf938\\uf3fb|\\uf938\\uf3fc|\\uf938\\uf3fd|\\uf938\\uf3fe|\\uf938\\uf3ff|\\uf938\\uf3fb\\u200d\\u2642\\ufe0f|\\uf938\\uf3fc\\u200d\\u2642\\ufe0f|\\uf938\\uf3fd\\u200d\\u2642\\ufe0f|\\uf938\\uf3fe\\u200d\\u2642\\ufe0f|\\uf938\\uf3ff\\u200d\\u2642\\ufe0f|\\uf938\\uf3fb\\u200d\\u2640\\ufe0f|\\uf938\\uf3fc\\u200d\\u2640\\ufe0f|\\uf938\\uf3fd\\u200d\\u2640\\ufe0f|\\uf938\\uf3fe\\u200d\\u2640\\ufe0f|\\uf938\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fb|\\uf93d\\uf3fc|\\uf93d\\uf3fd|\\uf93d\\uf3fe|\\uf93d\\uf3ff|\\uf93d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fb|\\uf93e\\uf3fc|\\uf93e\\uf3fd|\\uf93e\\uf3fe|\\uf93e\\uf3ff|\\uf93e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf939\\uf3fb|\\uf939\\uf3fc|\\uf939\\uf3fd|\\uf939\\uf3fe|\\uf939\\uf3ff|\\uf939\\uf3fb\\u200d\\u2642\\ufe0f|\\uf939\\uf3fc\\u200d\\u2642\\ufe0f|\\uf939\\uf3fd\\u200d\\u2642\\ufe0f|\\uf939\\uf3fe\\u200d\\u2642\\ufe0f|\\uf939\\uf3ff\\u200d\\u2642\\ufe0f|\\uf939\\uf3fb\\u200d\\u2640\\ufe0f|\\uf939\\uf3fc\\u200d\\u2640\\ufe0f|\\uf939\\uf3fd\\u200d\\u2640\\ufe0f|\\uf939\\uf3fe\\u200d\\u2640\\ufe0f|\\uf939\\uf3ff\\u200d\\u2640\\ufe0f|\\uf933\\uf3fb|\\uf933\\uf3fc|\\uf933\\uf3fd|\\uf933\\uf3fe|\\uf933\\uf3ff|\\uf4aa\\uf3fb|\\uf4aa\\uf3fc|\\uf4aa\\uf3fd|\\uf4aa\\uf3fe|\\uf4aa\\uf3ff|\\uf448\\uf3fb|\\uf448\\uf3fc|\\uf448\\uf3fd|\\uf448\\uf3fe|\\uf448\\uf3ff|\\uf449\\uf3fb|\\uf449\\uf3fc|\\uf449\\uf3fd|\\uf449\\uf3fe|\\uf449\\uf3ff|\\uf446\\uf3fb|\\uf446\\uf3fc|\\uf446\\uf3fd|\\uf446\\uf3fe|\\uf446\\uf3ff|\\uf595\\uf3fb|\\uf595\\uf3fc|\\uf595\\uf3fd|\\uf595\\uf3fe|\\uf595\\uf3ff|\\uf447\\uf3fb|\\uf447\\uf3fc|\\uf447\\uf3fd|\\uf447\\uf3fe|\\uf447\\uf3ff|\\uf91e\\uf3fb|\\uf91e\\uf3fc|\\uf91e\\uf3fd|\\uf91e\\uf3fe|\\uf91e\\uf3ff|\\uf596\\uf3fb|\\uf596\\uf3fc|\\uf596\\uf3fd|\\uf596\\uf3fe|\\uf596\\uf3ff|\\uf918\\uf3fb|\\uf918\\uf3fc|\\uf918\\uf3fd|\\uf918\\uf3fe|\\uf918\\uf3ff|\\uf919\\uf3fb|\\uf919\\uf3fc|\\uf919\\uf3fd|\\uf919\\uf3fe|\\uf919\\uf3ff|\\uf590\\uf3fb|\\uf590\\uf3fc|\\uf590\\uf3fd|\\uf590\\uf3fe|\\uf590\\uf3ff|\\uf44c\\uf3fb|\\uf44c\\uf3fc|\\uf44c\\uf3fd|\\uf44c\\uf3fe|\\uf44c\\uf3ff|\\uf44d\\uf3fb|\\uf44d\\uf3fc|\\uf44d\\uf3fd|\\uf44d\\uf3fe|\\uf44d\\uf3ff|\\uf44e\\uf3fb|\\uf44e\\uf3fc|\\uf44e\\uf3fd|\\uf44e\\uf3fe|\\uf44e\\uf3ff|\\uf44a\\uf3fb|\\uf44a\\uf3fc|\\uf44a\\uf3fd|\\uf44a\\uf3fe|\\uf44a\\uf3ff|\\uf91b\\uf3fb|\\uf91b\\uf3fc|\\uf91b\\uf3fd|\\uf91b\\uf3fe|\\uf91b\\uf3ff|\\uf91c\\uf3fb|\\uf91c\\uf3fc|\\uf91c\\uf3fd|\\uf91c\\uf3fe|\\uf91c\\uf3ff|\\uf91a\\uf3fb|\\uf91a\\uf3fc|\\uf91a\\uf3fd|\\uf91a\\uf3fe|\\uf91a\\uf3ff|\\uf44b\\uf3fb|\\uf44b\\uf3fc|\\uf44b\\uf3fd|\\uf44b\\uf3fe|\\uf44b\\uf3ff|\\uf91f\\uf3fb|\\uf91f\\uf3fc|\\uf91f\\uf3fd|\\uf91f\\uf3fe|\\uf91f\\uf3ff|\\uf44f\\uf3fb|\\uf44f\\uf3fc|\\uf44f\\uf3fd|\\uf44f\\uf3fe|\\uf44f\\uf3ff|\\uf450\\uf3fb|\\uf450\\uf3fc|\\uf450\\uf3fd|\\uf450\\uf3fe|\\uf450\\uf3ff|\\uf64c\\uf3fb|\\uf64c\\uf3fc|\\uf64c\\uf3fd|\\uf64c\\uf3fe|\\uf64c\\uf3ff|\\uf932\\uf3fb|\\uf932\\uf3fc|\\uf932\\uf3fd|\\uf932\\uf3fe|\\uf932\\uf3ff|\\uf64f\\uf3fb|\\uf64f\\uf3fc|\\uf64f\\uf3fd|\\uf64f\\uf3fe|\\uf64f\\uf3ff|\\uf485\\uf3fb|\\uf485\\uf3fc|\\uf485\\uf3fd|\\uf485\\uf3fe|\\uf485\\uf3ff|\\uf442\\uf3fb|\\uf442\\uf3fc|\\uf442\\uf3fd|\\uf442\\uf3fe|\\uf442\\uf3ff|\\uf443\\uf3fb|\\uf443\\uf3fc|\\uf443\\uf3fd|\\uf443\\uf3fe|\\uf443\\uf3ff|\\uf1e6\\uf1e8|\\uf1e6\\uf1e9|\\uf1e6\\uf1ea|\\uf1e6\\uf1eb|\\uf1e6\\uf1ec|\\uf1e6\\uf1ee|\\uf1e6\\uf1f1|\\uf1e6\\uf1f2|\\uf1e6\\uf1f4|\\uf1e6\\uf1f6|\\uf1e6\\uf1f7|\\uf1e6\\uf1f8|\\uf1e6\\uf1f9|\\uf1e6\\uf1fa|\\uf1e6\\uf1fc|\\uf1e6\\uf1fd|\\uf1e6\\uf1ff|\\uf1e7\\uf1e6|\\uf1e7\\uf1e7|\\uf1e7\\uf1e9|\\uf1e7\\uf1ea|\\uf1e7\\uf1eb|\\uf1e7\\uf1ec|\\uf1e7\\uf1ed|\\uf1e7\\uf1ee|\\uf1e7\\uf1ef|\\uf1e7\\uf1f1|\\uf1e7\\uf1f2|\\uf1e7\\uf1f3|\\uf1e7\\uf1f4|\\uf1e7\\uf1f6|\\uf1e7\\uf1f7|\\uf1e7\\uf1f8|\\uf1e7\\uf1f9|\\uf1e7\\uf1fb|\\uf1e7\\uf1fc|\\uf1e7\\uf1fe|\\uf1e7\\uf1ff|\\uf1e8\\uf1e6|\\uf1e8\\uf1e8|\\uf1e8\\uf1e9|\\uf1e8\\uf1eb|\\uf1e8\\uf1ec|\\uf1e8\\uf1ed|\\uf1e8\\uf1ee|\\uf1e8\\uf1f0|\\uf1e8\\uf1f1|\\uf1e8\\uf1f2|\\uf1e8\\uf1f3|\\uf1e8\\uf1f4|\\uf1e8\\uf1f5|\\uf1e8\\uf1f7|\\uf1e8\\uf1fa|\\uf1e8\\uf1fb|\\uf1e8\\uf1fc|\\uf1e8\\uf1fd|\\uf1e8\\uf1fe|\\uf1e8\\uf1ff|\\uf1e9\\uf1ea|\\uf1e9\\uf1ec|\\uf1e9\\uf1ef|\\uf1e9\\uf1f0|\\uf1e9\\uf1f2|\\uf1e9\\uf1f4|\\uf1e9\\uf1ff|\\uf1ea\\uf1e6|\\uf1ea\\uf1e8|\\uf1ea\\uf1ea|\\uf1ea\\uf1ec|\\uf1ea\\uf1ed|\\uf1ea\\uf1f7|\\uf1ea\\uf1f8|\\uf1ea\\uf1f9|\\uf1ea\\uf1fa|\\uf1eb\\uf1ee|\\uf1eb\\uf1ef|\\uf1eb\\uf1f0|\\uf1eb\\uf1f2|\\uf1eb\\uf1f4|\\uf1eb\\uf1f7|\\uf1ec\\uf1e6|\\uf1ec\\uf1e7|\\uf1ec\\uf1e9|\\uf1ec\\uf1ea|\\uf1ec\\uf1eb|\\uf1ec\\uf1ec|\\uf1ec\\uf1ed|\\uf1ec\\uf1ee|\\uf1ec\\uf1f1|\\uf1ec\\uf1f2|\\uf1ec\\uf1f3|\\uf1ec\\uf1f5|\\uf1ec\\uf1f6|\\uf1ec\\uf1f7|\\uf1ec\\uf1f8|\\uf1ec\\uf1f9|\\uf1ec\\uf1fa|\\uf1ec\\uf1fc|\\uf1ec\\uf1fe|\\uf1ed\\uf1f0|\\uf1ed\\uf1f2|\\uf1ed\\uf1f3|\\uf1ed\\uf1f7|\\uf1ed\\uf1f9|\\uf1ed\\uf1fa|\\uf1ee\\uf1e8|\\uf1ee\\uf1e9|\\uf1ee\\uf1ea|\\uf1ee\\uf1f1|\\uf1ee\\uf1f2|\\uf1ee\\uf1f3|\\uf1ee\\uf1f4|\\uf1ee\\uf1f6|\\uf1ee\\uf1f7|\\uf1ee\\uf1f8|\\uf1ee\\uf1f9|\\uf1ef\\uf1ea|\\uf1ef\\uf1f2|\\uf1ef\\uf1f4|\\uf1ef\\uf1f5|\\uf1f0\\uf1ea|\\uf1f0\\uf1ec|\\uf1f0\\uf1ed|\\uf1f0\\uf1ee|\\uf1f0\\uf1f2|\\uf1f0\\uf1f3|\\uf1f0\\uf1f5|\\uf1f0\\uf1f7|\\uf1f0\\uf1fc|\\uf1f0\\uf1fe|\\uf1f0\\uf1ff|\\uf1f1\\uf1e6|\\uf1f1\\uf1e7|\\uf1f1\\uf1e8|\\uf1f1\\uf1ee|\\uf1f1\\uf1f0|\\uf1f1\\uf1f7|\\uf1f1\\uf1f8|\\uf1f1\\uf1f9|\\uf1f1\\uf1fa|\\uf1f1\\uf1fb|\\uf1f1\\uf1fe|\\uf1f2\\uf1e6|\\uf1f2\\uf1e8|\\uf1f2\\uf1e9|\\uf1f2\\uf1ea|\\uf1f2\\uf1eb|\\uf1f2\\uf1ec|\\uf1f2\\uf1ed|\\uf1f2\\uf1f0|\\uf1f2\\uf1f1|\\uf1f2\\uf1f2|\\uf1f2\\uf1f3|\\uf1f2\\uf1f4|\\uf1f2\\uf1f5|\\uf1f2\\uf1f6|\\uf1f2\\uf1f7|\\uf1f2\\uf1f8|\\uf1f2\\uf1f9|\\uf1f2\\uf1fa|\\uf1f2\\uf1fb|\\uf1f2\\uf1fc|\\uf1f2\\uf1fd|\\uf1f2\\uf1fe|\\uf1f2\\uf1ff|\\uf1f3\\uf1e6|\\uf1f3\\uf1e8|\\uf1f3\\uf1ea|\\uf1f3\\uf1eb|\\uf1f3\\uf1ec|\\uf1f3\\uf1ee|\\uf1f3\\uf1f1|\\uf1f3\\uf1f4|\\uf1f3\\uf1f5|\\uf1f3\\uf1f7|\\uf1f3\\uf1fa|\\uf1f3\\uf1ff|\\uf1f4\\uf1f2|\\uf1f5\\uf1e6|\\uf1f5\\uf1ea|\\uf1f5\\uf1eb|\\uf1f5\\uf1ec|\\uf1f5\\uf1ed|\\uf1f5\\uf1f0|\\uf1f5\\uf1f1|\\uf1f5\\uf1f2|\\uf1f5\\uf1f3|\\uf1f5\\uf1f7|\\uf1f5\\uf1f8|\\uf1f5\\uf1f9|\\uf1f5\\uf1fc|\\uf1f5\\uf1fe|\\uf1f6\\uf1e6|\\uf1f7\\uf1ea|\\uf1f7\\uf1f4|\\uf1f7\\uf1f8|\\uf1f7\\uf1fa|\\uf1f7\\uf1fc|\\uf1f8\\uf1e6|\\uf1f8\\uf1e7|\\uf1f8\\uf1e8|\\uf1f8\\uf1e9|\\uf1f8\\uf1ea|\\uf1f8\\uf1ec|\\uf1f8\\uf1ed|\\uf1f8\\uf1ee|\\uf1f8\\uf1ef|\\uf1f8\\uf1f0|\\uf1f8\\uf1f1|\\uf1f8\\uf1f2|\\uf1f8\\uf1f3|\\uf1f8\\uf1f4|\\uf1f8\\uf1f7|\\uf1f8\\uf1f8|\\uf1f8\\uf1f9|\\uf1f8\\uf1fb|\\uf1f8\\uf1fd|\\uf1f8\\uf1fe|\\uf1f8\\uf1ff|\\uf1f9\\uf1e6|\\uf1f9\\uf1e8|\\uf1f9\\uf1e9|\\uf1f9\\uf1eb|\\uf1f9\\uf1ec|\\uf1f9\\uf1ed|\\uf1f9\\uf1ef|\\uf1f9\\uf1f0|\\uf1f9\\uf1f1|\\uf1f9\\uf1f2|\\uf1f9\\uf1f3|\\uf1f9\\uf1f4|\\uf1f9\\uf1f7|\\uf1f9\\uf1f9|\\uf1f9\\uf1fb|\\uf1f9\\uf1fc|\\uf1f9\\uf1ff|\\uf1fa\\uf1e6|\\uf1fa\\uf1ec|\\uf1fa\\uf1f2|\\uf1fa\\uf1f3|\\uf1fa\\uf1f8|\\uf1fa\\uf1fe|\\uf1fa\\uf1ff|\\uf1fb\\uf1e6|\\uf1fb\\uf1e8|\\uf1fb\\uf1ea|\\uf1fb\\uf1ec|\\uf1fb\\uf1ee|\\uf1fb\\uf1f3|\\uf1fb\\uf1fa|\\uf1fc\\uf1eb|\\uf1fc\\uf1f8|\\uf1fd\\uf1f0|\\uf1fe\\uf1ea|\\uf1fe\\uf1f9|\\uf1ff\\uf1e6|\\uf1ff\\uf1f2|\\uf1ff\\uf1fc|\\uf004|\\uf0cf|[\\uf170-\\uf171]|[\\uf17e-\\uf17f]|\\uf18e|[\\uf191-\\uf19a]|[\\uf201-\\uf202]|\\uf21a|\\uf22f|[\\uf232-\\uf23a]|[\\uf250-\\uf251]|[\\uf300-\\uf321]|[\\uf324-\\uf393]|[\\uf396-\\uf397]|[\\uf399-\\uf39b]|[\\uf39e-\\uf3f0]|[\\uf3f3-\\uf3f5]|[\\uf3f7-\\uf3fa]|[\\uf400-\\uf4fd]|[\\uf4ff-\\uf53d]|[\\uf549-\\uf54e]|[\\uf550-\\uf567]|[\\uf56f-\\uf570]|[\\uf573-\\uf57a]|\\uf587|[\\uf58a-\\uf58d]|\\uf590|[\\uf595-\\uf596]|[\\uf5a4-\\uf5a5]|\\uf5a8|[\\uf5b1-\\uf5b2]|\\uf5bc|[\\uf5c2-\\uf5c4]|[\\uf5d1-\\uf5d3]|[\\uf5dc-\\uf5de]|\\uf5e1|\\uf5e3|\\uf5e8|\\uf5ef|\\uf5f3|[\\uf5fa-\\uf64f]|[\\uf680-\\uf6c5]|[\\uf6cb-\\uf6d2]|[\\uf6e0-\\uf6e5]|\\uf6e9|[\\uf6eb-\\uf6ec]|\\uf6f0|[\\uf6f3-\\uf6f8]|[\\uf910-\\uf93a]|[\\uf93c-\\uf93e]|[\\uf940-\\uf945]|[\\uf947-\\uf94c]|[\\uf950-\\uf96b]|[\\uf980-\\uf997]|\\uf9c0|[\\uf9d0-\\uf9e6]/g;\n\n    var formatProtocolPath = function(path) {\n        var protocol = document.location.protocol;\n        var fileFlag = 'file:';\n        var isFile = protocol === fileFlag;\n        return isFile ? 'http:' + path : path;\n    };\n\n    var isUnSupportBgSize = document.all && !document.addEventListener;\n    var normalImagePath = formatProtocolPath(\"//cdn.ronghub.com/css-sprite_bg-2.1.10.png\");\n    var hdImagePath = formatProtocolPath(\"//f2e.cn.ronghub.com/sdk/emoji-48.png\");\n    var configs = {\n        url: isUnSupportBgSize ? normalImagePath : hdImagePath,\n        size: 24,\n        lang: \"zh\",\n        reg: unicodeRegExp\n    };\n\n    var isOpenAdaptOldVersion = true;\n\n    var supportLanguage = [ \"en\" ,\"zh\" ];\n\n    /* 判断是否支持emoji的渲染 */\n    var isSupportEmoji = (function() {\n        var getTextFeature = function(text, color) {\n            try {\n                var canvas = document.createElement(\"canvas\");\n                canvas.width = 20;\n                canvas.height = 20;\n                var ctx = canvas.getContext(\"2d\");\n                ctx.textBaseline = \"top\";\n                ctx.font = \"20px sans-serif\";\n                ctx.fillStyle = color;\n                ctx.fillText(text, 0, 0);\n                var imageData = ctx.getImageData(0, 0, 20, 20).data;\n                var imageDataArr = [];\n                for (var i = 0; i < imageData.length; i++) {\n                    imageDataArr[i] = imageData[i];\n                }\n                var totalColor = 0;\n                for (var i = 0; i < imageDataArr.length; i++) {\n                    totalColor += imageDataArr[i];\n                }\n                var hasColor = totalColor > 0;\n                return hasColor ? imageDataArr.toString() : false;\n            } catch (e) {\n                return false;\n            }\n        };\n        var testEmoji = \"😁\";\n        var mode = getTextFeature(testEmoji, \"#000\");\n        if (mode) {\n            var otherEmoji = \"😨\";\n            var colorFeatrue = getTextFeature(testEmoji, \"#FFF\");\n            var otherFeature = getTextFeature(otherEmoji, \"#000\");\n            //为相同emoji添加不同色, 判断两次上色是否相同, 如果相同, 说明emoji以图片渲染, 支持\n            var isSameColor = mode && mode === colorFeatrue;\n            //为不同emoji添加相同色, 判断两次上色是否不同, 如果不同, 说明emoji以字符渲染, 支持\n            var isDiffColor = mode && mode !== otherFeature;\n            return isSameColor || isDiffColor;\n        } else {\n            return false;\n        }\n    })();\n\n\n    /*! http://mths.be/codepointat v0.1.0 by @mathias,  codePointAt兼容 */\n    if (!String.prototype.codePointAt) {\n      (function() {\n        'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\n        var codePointAt = function(position) {\n          if (this == null) {\n            throw TypeError();\n          }\n          var string = String(this);\n          var size = string.length;\n          // `ToInteger`\n          var index = position ? Number(position) : 0;\n          if (index != index) { // better `isNaN`\n            index = 0;\n          }\n          // Account for out-of-bounds indices:\n          if (index < 0 || index >= size) {\n            return undefined;\n          }\n          // Get the first code unit\n          var first = string.charCodeAt(index);\n          var second;\n          if ( // check if it’s the start of a surrogate pair\n            first >= 0xD800 && first <= 0xDBFF && // high surrogate\n            size > index + 1 // there is a next code unit\n          ) {\n            second = string.charCodeAt(index + 1);\n            if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n              // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n              return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n            }\n          }\n          return first;\n        };\n        var userAgent = navigator.userAgent;\n        var isIE8 = navigator.userAgent.indexOf(\"MSIE 8.0\") > 0;\n        if (Object.defineProperty && !isIE8) {\n          Object.defineProperty(String.prototype, 'codePointAt', {\n            'value': codePointAt,\n            'configurable': true,\n            'writable': true\n          });\n        } else {\n          String.prototype.codePointAt = codePointAt;\n        }\n      }());\n    }\n\n    /*! http://mths.be/fromcodepoint v0.1.0 by @mathias,   fromCodePoint兼容 */\n    if (!String.fromCodePoint) {\n      (function() {\n        var defineProperty = (function() {\n          // IE 8 only supports `Object.defineProperty` on DOM elements\n          try {\n            var object = {};\n            var $defineProperty = Object.defineProperty;\n            var result = $defineProperty(object, object, object) && $defineProperty;\n          } catch(error) {}\n          return result;\n        }());\n        var stringFromCharCode = String.fromCharCode;\n        var floor = Math.floor;\n        var fromCodePoint = function() {\n          var MAX_SIZE = 0x4000;\n          var codeUnits = [];\n          var highSurrogate;\n          var lowSurrogate;\n          var index = -1;\n          var length = arguments.length;\n          if (!length) {\n            return '';\n          }\n          var result = '';\n          while (++index < length) {\n            var codePoint = Number(arguments[index]);\n            if (\n              !isFinite(codePoint) ||       // `NaN`, `+Infinity`, or `-Infinity`\n              codePoint < 0 ||              // not a valid Unicode code point\n              codePoint > 0x10FFFF ||       // not a valid Unicode code point\n              floor(codePoint) != codePoint // not an integer\n            ) {\n              throw RangeError('Invalid code point: ' + codePoint);\n            }\n            if (codePoint <= 0xFFFF) { // BMP code point\n              codeUnits.push(codePoint);\n            } else { // Astral code point; split in surrogate halves\n              // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n              codePoint -= 0x10000;\n              highSurrogate = (codePoint >> 10) + 0xD800;\n              lowSurrogate = (codePoint % 0x400) + 0xDC00;\n              codeUnits.push(highSurrogate, lowSurrogate);\n            }\n            if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n              result += stringFromCharCode.apply(null, codeUnits);\n              codeUnits.length = 0;\n            }\n          }\n          return result;\n        };\n        if (defineProperty) {\n          defineProperty(String, 'fromCodePoint', {\n            'value': fromCodePoint,\n            'configurable': true,\n            'writable': true\n          });\n        } else {\n          String.fromCodePoint = fromCodePoint;\n        }\n      }());\n    }\n    \n\n    var Utils = {\n        symbolRegExp: /\\[([^\\[\\]]+?)\\]/g,\n        toEmoji: function(nativeEmoji, func) {\n            return !func ? nativeEmoji : func(nativeEmoji);\n        },\n        extend: function() {\n            if (arguments.length === 0) {\n                return;\n            }\n            var obj = arguments[0];\n            for (var i = 1, len = arguments.length; i < len; i ++) {\n                var other = arguments[i];\n                for (var item in other) {\n                    obj[item] = other[item];\n                }\n            }\n            return obj;\n        },\n        hasSame: function(moreList, list) {\n            var more = moreList.join(' ');\n            for (var i = 0; i < list.length; i++) {\n                var value = list[i];\n                if (Utils.indexOf(more, value) === -1) {\n                    return false;\n                }\n            }\n            return true;\n        },\n        getDom: function(html) {\n            var div = document.createElement(\"div\");\n            div.innerHTML = html;\n            return div.childNodes[0];\n        },\n        getSymbol: function(name) {\n            return \"[\" + name + \"]\";\n        },\n        cutString: function(string, start, length) {\n            var array = [];\n            for (var i = start; i < start + length; i++) {\n                array.push(string.charAt(i));\n            }\n            return array.join('');\n        },\n        indexOf: function(array, value) {\n            if (typeof array === \"string\") {\n                for (var i = 0; i <= array.length - value.length; i++) {\n                    var string = Utils.cutString(array, i, value.length);\n                    if (array.charAt(i) == value.charAt(0) && Utils.cutString(array, i, value.length) == value) {\n                        return i;\n                    }\n                }\n            } else if (Object.prototype.toString.call(array) === '[object Array]') {\n                for (var i = 0; i < array.length; i++) {\n                    var item = array[i];\n                    if (item == value) {\n                        return i;\n                    }\n                }\n            }\n            return -1;\n        },\n        keys: function(item) {\n            var arr = [];\n            for (var key in item) {\n                arr.push(key);\n            }\n            return arr;\n        },\n        map: function(arr, func) {\n            var tempArr = arr.concat([]);\n            for (var i = 0; i < tempArr.length; i++) {\n                var value = tempArr[i];\n                if (func && typeof func === \"function\") {\n                    tempArr[i] = func(value);\n                }\n            }\n            return tempArr;\n        },\n        filter: function(arr, func) {\n            var array = [];\n            for (var i = 0; i < arr.length; i++) {\n                var value = arr[i];\n                if (func(value)) {\n                    array.push(value);\n                }\n            }\n            return array;\n        },\n        emojiToUnicode: function(emoji) {\n            var unicodes = '';\n            for (var i = 0; i < emoji.length; i = i + 2) {\n                var point = emoji.codePointAt(i).toString(16);\n                var isEmojiSameUnicode = point.indexOf(\"1f\") !== 0;\n                var code;\n                if (isEmojiSameUnicode) {\n                    code = \"%u\" + point;\n                } else {\n                    code = point.replace(\"1f\", \"%uf\");\n                }\n                unicodes += code;\n            }\n            return unescape(unicodes);\n        },\n        newEmojisAdaptOldVersion: function(newEmojis) {\n            if (newEmojis && Utils.hasKey(newEmojis, 'dataSource')) {\n                var dataSource = newEmojis.dataSource;\n                if (dataSource && typeof dataSource === \"object\") {\n                    for (var key in dataSource) {\n                        var position = dataSource.bp || \"0px 0px\";\n                        dataSource[key].position = position;\n                    }\n                }\n                newEmojis.dataSource = dataSource;\n            }\n            return newEmojis;\n        },\n        hasKey: function(object, key) {\n            var has = false;\n            var objectType = CheckParam.getType(object);\n            if (objectType === 'object') {\n                for (var objKey in object) {\n                    if (objKey === key) {\n                        has = true;\n                    }\n                }\n            }\n            return has;\n        },\n        deleteKey: function(object, key) {\n            var newObj = {};\n            for (var objKey in object) {\n                if (objKey !== key) {\n                    newObj[objKey] = object[objKey];\n                }\n            }\n            return newObj;\n        },\n        getInitDetail: function(config) {\n            var newEmojis, opt;\n            var hasExtension = Utils.hasKey(config, \"extension\");\n            var hasDataSource = Utils.hasKey(config, \"dataSource\");\n            if (hasDataSource) {\n                newEmojis = config;\n            } else if (hasExtension) {\n                newEmojis = config.extension;\n                opt = Utils.deleteKey(config, 'extension');\n            } else {\n                opt = config;\n            }\n            return {\n                config: opt,\n                newEmojis: newEmojis\n            };\n        }\n    };\n\n    var errorDesc = \"具体信息请参考文档以及Demo示例: https://rongcloud.github.io/websdk-demo/emoji.html\";\n\n    var Logger = {\n        LogFactory: {\n            \"0\": {\n                code: 0,\n                msg: \"初始化参数错误\",\n                desc: errorDesc\n            },\n            \"1\": {\n                code: 1,\n                msg: \"Emoji参数错误\",\n                desc: errorDesc\n            },\n            \"2\": {\n                code: 2,\n                msg: \"Emoji语言设置错误\",\n                desc: errorDesc\n            },\n            \"3\": {\n                code: 3,\n                msg: \"Emoji扩展错误\",\n                desc: errorDesc\n            },\n            \"4\": {\n                code: 4,\n                msg: \"Emoji设置size错误\",\n                desc: errorDesc\n            },\n            \"5\": {\n                code: 5,\n                msg: \"Emoji设置reg错误\",\n                desc: errorDesc\n            },\n            \"6\": {\n                code: 6,\n                msg: \"Emoji设置背景url错误\",\n                desc: errorDesc\n            }\n        },\n        isShowError: true,\n        showErrorInfo: function(errorInfo) {\n            console.error(errorInfo);\n        },\n        logger: function(params) {\n            var code = params.code;\n            var logInfo = this.LogFactory[code] || params;\n            var errorInfo = JSON.stringify(logInfo);\n            errorInfo = JSON.parse(errorInfo);\n            var message = errorInfo.msg + \": \" + params.msg + \"\\n \" + errorInfo.desc;\n            this.isShowError && this.showErrorInfo(message);\n        }\n    };\n\n    var CheckParam = {\n        getType: function(str) {\n            /* IE下不准确问题 */\n            if (str === undefined) {\n                return \"undefined\";\n            }\n            if (str === null) {\n                return \"null\";\n            }\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        },\n        check: function(typeList, funcName, params) {\n            params = params || [];\n            var maxCount = typeList.length;\n            if (params.length > maxCount) {\n                params.length = maxCount;\n            }\n            for (var i = 0; i < typeList.length; i++) {\n                var paramType = this.getType(params[i]);\n                var sucType = typeList[i];\n                if (!new RegExp(paramType).test(sucType)) {\n                    var msgTemp = \"第{{index}}个参数错误, 传入参数类型为: {{errType}}, 应传参数类型为: {{sucType}}, 错误所在位置为: {{funcName}}\";\n                    var msg = msgTemp.replace(/{{index}}/g, i + 1).replace(/{{errType}}/g, paramType).replace(/{{sucType}}/g, sucType).replace(/{{funcName}}/g, funcName);\n                    Logger.logger({\n                        code: 1,\n                        funcName: funcName,\n                        msg: msg\n                    });\n                }\n            }\n        },\n        checkConfigParam: function(opt, funcName) {\n            var isValidLang = this.checkLanguage(opt.lang || configs.lang, funcName);\n            var isValidSize = this.checkOptType(opt.size || configs.size, \"number\", 4, funcName);\n            var isValidReg = this.checkOptType(opt.reg || configs.reg, \"regexp|string\", 5, funcName);\n            var isValidUrl = this.checkOptType(opt.url || configs.url, \"string\", 6, funcName);\n            return isValidLang && isValidSize && isValidReg && isValidUrl;\n        },\n        checkLanguage: function(lang, funcName) {\n            if (Utils.indexOf(supportLanguage, lang) !== -1) {\n                return true;\n            }\n            var msgTemp = \"不支持语言: {{lang}}, 支持的语言有: {{support}}\";\n            var msg = msgTemp.replace(/{{lang}}/g, lang).replace(/{{support}}/g, supportLanguage.join(', '));\n            Logger.logger({\n                code: 2,\n                msg: msg,\n                funcName: funcName\n            });\n            return false;\n        },\n        checkOptType: function(value, type, code, funcName) {\n            var valueType = this.getType(value);\n            if (!new RegExp(valueType).test(type)) {\n                var msg = \"传入参数类型为: {{errType}}, 应传参数类型为: {{sucType}}\";\n                msg = msg.replace(/{{errType}}/g, valueType).replace(/{{sucType}}/g, type);\n                Logger.logger({\n                    code: code,\n                    msg: msg,\n                    funcName: funcName\n                });\n                return false;\n            }\n            return true;\n        },\n        checkDataSource: function(dataSource, funcName) {\n            var dataParams = [ \"en\", \"zh\", \"tag\", \"position\" ];\n            for (var key in dataSource) {\n                var detail = dataSource[key];\n                if (this.getType(detail) !== \"object\") {\n                    var msg = \"dataSource.{{unicode}}必须是object类型\"\n                    msg = msg.replace(/{{unicode}}/g, key);\n                    Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                    return false;\n                }\n                var allKeys = Utils.keys(detail);\n                if (!Utils.hasSame(allKeys, dataParams)) {\n                    var msgTemp = \"dataSource.{{unicode}}必须包含属性: en, zh, tag, position\";\n                    var msg = msgTemp.replace(/{{unicode}}/g, key);\n                    Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                    return false;\n                }\n            }\n            return true;\n        },\n        checkAddEmoji: function(newEmojis, funcName) {\n            for (var key in newEmojis) {\n                if (key === \"dataSource\") {\n                    var dataSource = newEmojis[key];\n                    if (this.getType(dataSource) !== \"object\") {\n                        var msg = \"dataSource必须是object类型\";\n                        Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                        return false;\n                    } else {\n                        if (!this.checkDataSource(dataSource, funcName)) {\n                            return false;\n                        }\n                    }\n                }\n            }\n            return true;\n        },\n        checkInit: function(config, type) {\n            var objType = CheckParam.getType(config);\n            var isObject = new RegExp(objType).test(type);\n            var msg = \"config参数必须是\" + type + \"类型\";\n            !isObject && Logger.logger({\n                code: 0, msg: msg, funcName: \"init\"\n            });\n            return isObject;\n        }\n    };\n\n    var addBaseCss = function() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden;}\";\n        var style = document.createElement(\"style\");\n        style.setAttribute(\"type\", \"text/css\");\n        var head = document.getElementsByTagName('head')[0];\n        head.appendChild(style);\n        if (style.styleSheet) {\n            style.styleSheet.cssText = baseCss;\n        } else {\n            head = document.createTextNode(baseCss);\n            style.appendChild(head);\n        }\n    };\n\n\n\n    var createEmojiDom = function(item, sizePx) {\n        var position = computeBgPosition(item.position, sizePx);\n        var size = sizePx || configs.size;\n        if (document.all && !document.addEventListener) {\n            position = item.position;\n            size = configs.size;\n        }\n        var emojiObj = {\n            size: size,\n            position: position,\n            background: item.background || configs.url,\n            name: item[configs.lang],\n            tag: item.tag\n        };\n        return getEmojiShadowDom(emojiObj);\n    };\n\n    var getEmojiShadowDom = function(object) {\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px; overflow: hidden; vertical-align: middle; font-size: 0 !important;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='{{style}}'>{{tag}}</span>\"\n        spanTpl = spanTpl.replace(/{{style}}/g, style);\n        var ret = spanTpl.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n            return object[name];\n        });\n        return ret;\n    };\n\n    var computeBgPosition = function(position, sizePx) {\n        var size = sizePx || configs.size;\n        var baseSize = document.all && !document.addEventListener ? 24 : 25;\n        var scale = size / baseSize;\n        position = position.split(\" \");\n        var x = position[0], y = position[1];\n        x = x ? x.split(\"px\")[0] : 0;\n        y = y ? y.split(\"px\")[0] : 0;\n        return parseInt(x) * scale + \"px \" + parseInt(y) * scale + \"px\";\n    };\n\n    var setupEmojiDetails = function() {\n        var tags = [];\n        detailList.length = 0;\n        for (var key in emojiFactory) {\n            var detail = emojiFactory[key];\n            var lang = configs.lang;\n            var shadowDom = createEmojiDom(detail);\n            var symbol = Utils.getSymbol(detail[lang]);\n            var item = {\n                unicode: key,\n                symbol: symbol,\n                emoji: detail.tag,\n                node: Utils.getDom(shadowDom)\n            };\n            detailList.push(item);\n        }\n    };\n\n    var setupEmojiFactory = function(newEmojis) {\n        var newEmojiFactory = {};\n        if (newEmojis) {\n            var _emojiFactory = newEmojis.dataSource;\n            var _url = newEmojis.url || configs.url;\n            for (var key in _emojiFactory) {\n                _emojiFactory[key][\"background\"] = _url;\n                newEmojiFactory[key] = _emojiFactory[key];\n            }\n        }\n        emojiFactory = Utils.extend(emojiFactory, newEmojiFactory);\n    };\n\n    var calculateUTF = function (char) {\n        var unicodes = escape(char).split(\"%u\");\n        unicodes = Utils.filter(unicodes, function(code) {\n            return code !== \"\";\n        });\n        return Utils.map(unicodes, function(code) {\n            if (Utils.indexOf(code, \"f\") !== -1 || Utils.indexOf(code, \"F\") !== -1) {\n                return String.fromCodePoint(\"0x1\" + code);\n            } else {\n                return String.fromCodePoint(\"0x\" + code);\n            }\n        }).join(\"\");\n    };\n\n    var getEmojiBySymbol = function(symbol) {\n        for (var i = 0; i < detailList.length; i++) {\n            var lang = configs.lang;\n            var detail = detailList[i];\n            if(detail.symbol === symbol) {\n                return detail.emoji;\n            }\n        }\n        return symbol;\n    };\n\n    var getDomByEmoji = function(emoji, sizePx) {\n        for (var key in emojiFactory) {\n            var detail = emojiFactory[key];\n            if (detail.tag === emoji) {\n                return createEmojiDom(detail, sizePx);\n            }\n        }\n        return false;\n    };\n\n    var init = function(config) {\n        var newEmojis, opt;\n        if (CheckParam.checkInit(config, 'object|null|undefined')) {\n            var initDetail = Utils.getInitDetail(config);\n            newEmojis = initDetail.newEmojis;\n            opt = initDetail.config;\n        }\n        addEmojis(newEmojis);\n        setConfig(opt);\n        isOpenAdaptOldVersion && adaptOldVersion();\n    };\n\n    /**\n     * 自定义设置\n     * @param  {[object]} opt 可包含 lang, reg, url, size\n     */\n    var setConfig = function(opt) {\n        if (!CheckParam.checkConfigParam(opt || {}, \"init\")) {\n            return;\n        }\n        configs = Utils.extend(configs, opt);\n        setupEmojiDetails();\n    };\n\n    /**\n     * 新增自定义emoji\n     * @param {object} newEmojis 可包含dataSource和url, url表示背景图, dataSource包含自定义的unicode和所对应emoji特性\n     */\n    var addEmojis = function(newEmojis) {\n        newEmojis = Utils.newEmojisAdaptOldVersion(newEmojis);\n        if (!CheckParam.checkAddEmoji(newEmojis || {}, \"init\")) {\n            return;\n        }\n        setupEmojiFactory(newEmojis);\n        setupEmojiDetails();\n    };\n    \n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围。默认为init时设置的regExp，如果不设置，默认为/[\\uf000-\\uf700]/g\n     * @return {string}          转化后的字符串\n     */\n    var unicodeDecode = function(content, reg) {\n        reg = reg || configs.reg;\n        return content.replace(reg, function(emoji) {\n            return calculateUTF(emoji) || emoji;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg     可选，匹配的正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后的字符串\n     */\n    var emojiToSymbol = function(content, reg, func) {\n        CheckParam.check([\"string\", \"regexp|null|undefined\"], \"emojiToSymbol\", arguments);\n        content = unicodeDecode(content, reg);\n        return content.replace(emojiRegExp, function(emojiTag) {\n            var lang = configs.lang;\n            for (var emojiKey in emojiFactory) {\n                var emojiDetail = emojiFactory[emojiKey];\n                if (emojiDetail.tag == emojiTag) {\n                    var name = emojiDetail[lang];\n                    return Utils.getSymbol(name);\n                }\n            }\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} text 必填 包含symbol的字符串\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}\n     */\n    var symbolToEmoji = function(text, func) {\n        CheckParam.check([\"string\"], \"symbolToEmoji\", arguments);\n        text = unicodeDecode(text);\n        var emojiText = text.replace(Utils.symbolRegExp, function(symbol) {\n            return getEmojiBySymbol(symbol);\n        });\n        return emojiText.replace(emojiRegExp, function(emojiTag) {\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} content 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx     可选，html标签的大小\n     * @param  {string} reg     可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(content, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"emojiToHTML\", arguments);\n        content = unicodeDecode(content, reg);\n        var shadowDomContent = content.replace(emojiRegExp, function(emojiTag) {\n            var dom = getDomByEmoji(emojiTag, sizePx);\n            return dom || emojiTag;\n        });\n        return shadowDomContent.replace(emojiRegExp, function(emojiTag) {\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} text 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(text, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"symbolToHTML\", arguments);\n        var htmlText = text.replace(Utils.symbolRegExp, function(symbol) {\n            var emoji = getEmojiBySymbol(symbol);\n            var emojiDom = getDomByEmoji(emoji, sizePx);\n            return emojiDom || symbol;\n        });\n        return htmlText.replace(emojiRegExp, function(emojiTag) {\n            return Utils.toEmoji(emojiTag, func);\n        });\n    };\n\n    var context = {};\n    var adaptOldVersion = function() {\n        context.emojis = Utils.map(detailList, function(item) {\n            var unicode = item.unicode;\n            var emojiDetail = emojiFactory[unicode];\n            var zh = emojiDetail.zh;\n            var en = emojiDetail.en;\n            var position = emojiDetail.position;\n            en = en.replace(' ', '_').toLowerCase();\n            var oldVersionStyle = \"height: 24px; width: 24px; display: inline-block; font-size: 20px !important; text-align: center; vertical-align: middle;overflow: hidden; line-height: 24px;\";\n            var oldVersionBHtml = \"<b style='width: 24px; height: 24px; display: inline-block; background-image: url({{url}}); background-position: {{position}}'></b>\";\n            oldVersionBHtml = oldVersionBHtml.replace(\"{{url}}\", normalImagePath).replace(\"{{position}}\", position);\n            var oldVersionHtml = \"<span name='[{{zh}}]' class='RongIMExpression_{{en}}' style='{{style}}'>{{b}}</span>\"\n            oldVersionHtml = oldVersionHtml.replace(\"{{zh}}\", zh).replace(\"{{en}}\", en).replace(\"{{b}}\", oldVersionBHtml).replace(\"{{style}}\", oldVersionStyle);\n            var spanHTML = \"<span>\" + oldVersionHtml + \"</span>\";\n            return Utils.getDom(spanHTML);\n        });\n        context.names = (function() {\n            var names = [];\n            for (var key in emojiFactory) {\n                var value = emojiFactory[key];\n                var data = {};\n                for (var i = 0; i < supportLanguage.length; i++) {\n                    var lang = supportLanguage[i];\n                    data[lang] = value[lang];\n                }\n                names.push(data);\n            }\n            return names;\n        })();\n        context.data = Utils.map(detailList, function(item) {\n            var data;\n            for (var key in emojiFactory) {\n                var detail = emojiFactory[key];\n                if (detail.tag === item.emoji) {\n                    data = detail;\n                    detail.html = item.node;\n                }\n            }\n            return data;\n        });\n    };\n\n    (function start() {\n        addBaseCss();\n        setupEmojiDetails();\n        isOpenAdaptOldVersion && adaptOldVersion();\n    })();\n\n    return (function() {\n        return Utils.extend(context, {\n            isSupportEmoji: isSupportEmoji,\n\n            init: init,\n\n            list: detailList,\n            emojiToSymbol: emojiToSymbol,\n            symbolToEmoji: symbolToEmoji,\n            emojiToHTML: emojiToHTML,\n            symbolToHTML: symbolToHTML,\n\n            adaptOldVersion: adaptOldVersion\n        })\n    })();\n});\n"
  },
  {
    "path": "cs/sobot/cs.css",
    "content": ".rongcloud-container *,.rongcloud-container *:before,.rongcloud-container *:after {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n    margin: 0;\n    padding: 0;\n    border: 0\n}\n.rongcloud-container * {\n    padding: 0;\n    margin: 0;\n    font-size: 14px;\n    font-weight: 400;\n}\n\n.rongcloud-container a {\n    text-decoration: none;\n    outline: 0;\n}\n\n.rongcloud-container img {\n    border: none;\n    vertical-align: middle;\n}\n\n.rongcloud-container textarea {\n    overflow: auto\n}\n\n.rongcloud-clearfix {\n    *zoom:1}\n\n.rongcloud-clearfix:after {\n    display: table;\n    line-height: 0;\n    content: \"\";\n    clear: both\n}\n.rongcloud-pull-left{\n    float: left!important;\n}\n.rongcloud-pull-right{\n    float: right!important;\n}\n.rongcloud-sprite{\n    background: url(\"//cdn.ronghub.com/customerservice-icon.png\") 0 0/50px auto no-repeat;\n    display: inline-block;\n    z-index: 1;\n}\n/*.rongcloud-sprite-kefu{\n    background: url(\"images/kefuicon.png\") 0 0/50px auto no-repeat;\n    background-size: 20px 20px;\n    margin-right: 4px;\n}*/\n.rongcloud-blueBg{\n    background: url(//cdn.ronghub.com/customerservice-web-bg.png) 0 0/10px auto repeat;\n}\n/*.rongcloud-kefuListBox{\n    width: 194px;\n    height: 470px;\n    position: fixed;\n    right: 520px;\n    bottom: 100px;\n    z-index: 999;\n    box-shadow: 1px 1px #f9fafb;\n    background-color: white;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n    border-radius: 5px;\n}*/\n#zhichiBtnBox .rongcloud-people{\n    background-position: 0 -411px;\n    width: 26px;\n    height: 32px;\n}\n#zhichiBtnBox .rongcloud-kefuBtn .rongcloud-arrow-up{\n    margin-left: 0;\n}\n\n.rongcloud-kefuListBox .rongcloud-kefuList{\n    /*border: 1px solid #cdd7db;*/\n    /*border-bottom: none;*/\n    /*border-radius: 5px 5px 0px 0px;*/\n    overflow: hidden;\n    /*height: 100%;*/\n    box-sizing: border-box;\n    position: absolute;\n    border-radius: 4px;\n\n    width: 194px;\n    height: 470px;\n    position: fixed;\n    right: 520px;\n    bottom: 100px;\n    z-index: 999;\n    box-shadow: 1px 1px #f9fafb;\n    background-color: white;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-rong-header{\n    height: 36px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-toolBar{\n    text-align: center;\n    padding-top: 8px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-people {\n     vertical-align: middle;\n     margin-right: 10px;\n     width: 20px;\n     border: none;\n     height: 20px;\n     background-size: 45px auto;\n}\n\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-arrow-down{\n    background-position: 0 -65px;\n    vertical-align: middle;\n    width: 24px;\n    border: none;\n    height: 24px;\n    margin-left: 10px;\n    margin-right: -5px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-recent{\n    color: #fff;\n    font-size: 14px;\n    margin: 0;\n    padding: 0;\n    cursor:default;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-count{\n    color: #d0d4d7;\n    font-size: 12px;\n    margin: 0;\n    padding: 0;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content{\n    position: absolute;\n    top:36px;\n    bottom: 0px;\n    left: 0px;\n    right: 0px;\n    overflow-x: hidden;\n    overflow-y: auto;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus{\n    height: 40px;\n    padding-left: 18px;\n    background-color: #ffafaf;\n    line-height: 40px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online{\n    background-color: #d3f8d6;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus .rongcloud-sprite{\n    width: 20px;\n    height: 22px;\n    vertical-align: middle;\n    background-position: 0 -139px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online .rongcloud-sprite{\n    background-position: 0 -100px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus span{\n    font-size: 14px;\n    color: #fff;\n    vertical-align: middle;\n    padding-left: 2px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online span{\n    color: #868686;\n}\n\n.rongcloud-errorInfo{\n    position: absolute;\n    top: 35px;\n    left: 50%;\n    transform: translateX(-50%);\n    height: 30px;\n    line-height: 30px;\n    text-align: center;\n    width: 180px;\n    background-color: rgba(255,0,0,.8);\n    border-radius: 5px;\n    color: #fff;\n    z-index: 11111;\n}\n\n.rongcloud-kefuChat{\n    width:470px;\n    height:470px;\n    border-radius: 5px 5px 5px 5px;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header{\n    height: 36px;\n    border-radius: 4px 4px 0px 0px;\n    position: relative;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-infoBar{\n    height: 36px;\n    line-height: 36px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-infoBarTit{\n    position: relative;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-Presence{\n    border-radius: 50%;\n    width: 8px;\n    height: 8px;\n    top: 14px;\n    left: 16px;\n    border: 0;\n}\n.rongcloud-kefuChat .rongcloud-rong-header.rongcloud-online .rongcloud-Presence{\n    background-color: #20e600;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-kefuName{\n    color: #fff;\n    padding-left: 16px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar{\n    margin-right: 10px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar a{\n    width: 20px;\n    height: 20px;\n    margin-top: 9px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxHide{\n    background-position: 0 -460px;\n    cursor: pointer;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxMin{\n    background-position: 0 -252px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxMax{\n    background-position: 0 -213px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxClose{\n    background-position: 0 -291px;\n    cursor: pointer;\n}\n.rcs-message-box {\n    width: 100%;\n    overflow: auto;\n    padding: 8px 16px;\n    position: absolute;\n    top:36px;\n    bottom: 114px;\n    background-color: white;\n}\n.rongcloud-box{\n    position: absolute;\n    top: 36px;\n    right: 0px;\n    left: 0px;\n    z-index: 10;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox {\n    height: 40px;\n    padding-left: 18px;\n    background-color: #ffafaf;\n    line-height: 40px;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox .rongcloud-sprite {\n    width: 20px;\n    height: 22px;\n    vertical-align: middle;\n    background-position: 0 -139px;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox span {\n    font-size: 14px;\n    color: #fff;\n    vertical-align: middle;\n    padding-left: 2px;\n}\n.rongcloud-kefuChat .rongcloud-noticeBox {\n    height: 40px;\n    padding: 0px 18px;\n    background-color: #FFF5ED;\n    line-height: 40px;\n}\n.rongcloud-hasNotice{\n    top: 76px;\n}\n.rongcloud-kefuChat .rongcloud-link {\n    cursor: pointer;\n}\n.rongcloud-kefuChat .rongcloud-noticeBox .rongcloud-notice-horn {\n    display: inline-block;\n    width: 25px;\n    height: 22px;\n    vertical-align: middle;\n    background: url('images/Group 7.png');\n    background-repeat: no-repeat;\n    background-size: cover;\n    margin-right: 10px;\n}\n.rongcloud-kefuChat .rongcloud-noticeBox .rongcloud-notice-link{\n    float: right;\n    margin-top: 12px;\n    display: inline-block;\n    width: 9px;\n    height: 16px;\n    vertical-align: middle;\n    background: url('images/Combined Shape.png');\n    background-repeat: no-repeat;\n    background-size: cover;\n}\n.rongcloud-noticeBox-content{\n    font-size: 14px;\n    color: #9D5438;\n    vertical-align: middle;\n    padding-left: 2px;\n    display: inline-block;\n    width: 380px;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n}\n\n.rongcloud-Messages-date {\n    text-align: center;\n    padding: 10px 20px;\n    /*border-bottom: 1px solid #e4e7ea;*/\n    margin-bottom: 30px;\n    height: 10px;\n}\n\n.rongcloud-Messages-date b {\n    font-size: 9pt;\n    font-weight: normal;\n    color: #8e969f;\n    background-color: #f9fbfd;\n    display: inline-block;\n    padding: 0 20px;\n    cursor:default;\n}\n.rongcloud-Messages-history {\n    text-align: center;\n    padding: 10px 20px;\n    /*border-bottom: 1px solid #e4e7ea;*/\n    margin-bottom: 30px;\n    height: 10px;\n}\n\n.rongcloud-Messages-history b {\n    font-size: 9pt;\n    font-weight: normal;\n    color: #8e969f;\n    background-color: #f9fbfd;\n    display: inline-block;\n    padding: 0 20px;\n    cursor:pointer;\n}\n.rongcloud-Messages-history b:hover{\n  color: #0099ff;\n}\n\n\n.rongcloud-Message-wrapper > div:last-child {\n    padding-bottom: 10px;\n}\n\n.rongcloud-Message {\n    position: relative;\n    padding-left: 3pc;\n    word-wrap: break-word;\n    word-break: break-all;\n    border-spacing: 1px;\n    margin-bottom: 20px;\n}\n.rongcloud-Message-send.rongcloud-Message{\n    padding-left: 0;\n    padding-right: 3pc;\n}\n\n.rongcloud-Message-header {\n    margin-top: 15px;;\n}\n.rongcloud-Message-send .rongcloud-Message-header{\n    display: table;\n    width: 100%;\n}\n\n.rongcloud-avatar {\n    width: 34px;\n    height: 34px;\n    border-radius: 50%;\n}\n\n.rongcloud-Message img {\n    max-width: 230px;\n    max-height: 250px;\n}\n\n.rongcloud-Message-avatar {\n    position: absolute;\n    margin-left: -3pc;\n    width: 34px;\n    height: 34px;\n}\n.rongcloud-Message-send .rongcloud-Message-avatar {\n    position: absolute;\n    right: 0;\n}\n\n.rongcloud-Message-author {\n    display: inline-block;\n    position: relative;\n    padding-right: 30px;\n}\n.rongcloud-Message-send .rongcloud-Message-author{\n    float: right;\n    padding-right: 0px;\n}\n\n.rongcloud-Message-author .rongcloud-author, .rongcloud-Message-author .rongcloud-time {\n    display: block;\n    float: left;\n    line-height: 1pc;\n}\n\n.rongcloud-Message-author > .rongcloud-author {\n    color: #8e969f;\n    text-decoration: none !important;\n    cursor: default;\n}\n\n.rongcloud-Message-author > .rongcloud-time {\n    color: #8e969f;\n    font-size: 9pt;\n    margin-left: 9pt;\n}\n\n.rongcloud-Message-body {\n    position: relative;\n    /*margin-right: 70px;*/\n    font-size: 14px;\n    line-height: 18px;\n    color: #444;\n}\n.rongcloud-Message-send .rongcloud-Message-body{\n    float: right;\n}\n\n.rongcloud-Message-text, .rongcloud-file-text {\n    position: relative;\n    display: inline-block;\n    max-width: 100%;\n}\n\n.rongcloud-Message-text pre {\n    font-size: 14px;\n    line-height: 18px;\n    color: rgb(68, 68, 68);;\n    word-break: break-all;\n    word-wrap: break-word;\n\n    white-space: pre-wrap;\n\n    background-color: transparent;\n    border: none;\n    border-radius: 0;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n}\n\n.rongcloud-Message-entry {\n    display: inline-block;\n    max-width: 100%;\n}\n\n.rongcloud-Message-entry p {\n    margin-bottom: 5px;\n}\n\n.rongcloud-Message-entry a {\n    text-decoration: none;\n}\n\n.rongcloud-Message-img img {\n    border-radius: 5px;\n}\n\n/*音频消息*/\n.rongcloud-Message-audio .rongcloud-Message-entry{\n    overflow:hidden;\n}\n.rongcloud-Message-audio .rongcloud-audioBox{\n    float: left;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox{\n    float: right;\n}\n.rongcloud-Message-audio .rongcloud-audioBox {\n    display: inline-block;\n    cursor: pointer;\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) 0 0/170px auto no-repeat;\n    width: 165px;\n    height: 36px;\n    padding: 3px 0 3px 15px;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i{\n    float: left;\n    display: inline-block;\n    width: 4px;\n    height: 26px;\n    opacity: 1;\n    -webkit-transition: all 1s ease;\n    -moz-transition: all 1s ease;\n    -ms-transition: all 1s ease;\n    -o-transition: all 1s ease;\n    transition: all 1s ease;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox {\n    display: inline-block;\n    cursor: pointer;\n    background: url(./images/audioRBG.png) 0 0/165px auto no-repeat;\n    width: 165px;\n    height: 36px;\n    padding: 3px 15px 3px 0px;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i{\n    float: right;\n    display: inline-block;\n    width: 4px;\n    height: 26px;\n    opacity: 1;\n    -webkit-transition: all 1s ease;\n    -moz-transition: all 1s ease;\n    -ms-transition: all 1s ease;\n    -o-transition: all 1s ease;\n    transition: all 1s ease;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(1){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) 0px -40px/170px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(2){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) -7px -40px/170px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(3){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) -14px -40px/170px auto no-repeat;\n}\n\n.rongcloud-Message-audio .rongcloud-audioBox.rongcloud-animate i:nth-child(2){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-audioBox.rongcloud-animate i:nth-child(3){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(1){\n    background: url(./images/audioRBG.png) -161px -40px/165px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(2){\n    background: url(./images/audioRBG.png) -154px -40px/165px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(3){\n    background: url(./images/audioRBG.png) -147px -40px/165px auto no-repeat;\n}\n\n.rongcloud-Message-audio .rongcloud-r-audioBox.rongcloud-animate i:nth-child(2){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox.rongcloud-animate i:nth-child(3){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n@keyframes audioAnimate\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-moz-keyframes audioAnimate /* Firefox */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-webkit-keyframes audioAnimate /* Safari 和 Chrome */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-o-keyframes audioAnimate /* Opera */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n.rongcloud-Message-audio .rongcloud-audioTimer{\n    margin-top: 5px;\n    margin-left: 10px;\n    color: #8e969f;\n}\n.rongcloud-Message-audio .rongcloud-audioState{\n    width: 10px;\n    height: 10px;\n    display: inline-block;\n    background-color: #ff7373;\n    margin-top: 13px;\n    border-radius: 5px;\n}\n\n.rongcloud-sys-tips{\n    text-align: center;\n    padding: 10px 0;\n    margin-top: 10px;\n}\n.rongcloud-sys-tips>span{\n    padding:7px 10px;\n    background: #e7ecf2;\n    border-radius: 3px;\n    font-size: 12px;\n    color: #8e969f;\n    line-height: 32px;\n}\n.rongcloud-sys-tips a{\n    font-size: 12px;\n}\n.rongcloud-rong-footer {\n    background: #fff;\n    height: 114px;\n    position: absolute;\n    bottom: 0px;\n    left:0px;\n    right: 0px;\n    border-radius: 0px 0px 5px 5px;\n    /*border: 1px solid #cdd7db;\n    border-top: none;*/\n}\n\n.rongcloud-footer-con {\n    border-top: 1px solid #cdd7db;\n}\n.rongcloud-text-layout {\n    margin: 0 10px;\n}\n.rongcloud-funcPanel {\n    line-height: 22px;\n    height: 22px;\n    position: relative;\n    margin-top: 5px;\n}\n.rongcloud-funcPanel .rongcloud-mode1{\n    float: left;\n\n}\n.rongcloud-funcPanel .rongcloud-mode2{\n    float: right;\n    cursor: pointer;\n}\n.rongcloud-funcPanel .rongcloud-mode2 a{\n    color: #0099ff;\n    font-size: 12px;\n}\n.rongcloud-robotMode {\n    display: block;\n}\n.rongcloud-text {\n    width: 100%;\n    display: inline-block;\n    height: 80px;\n    padding: 5px;\n    border: 0;\n    color: #999;\n    color: black;\n    resize: none;\n    font-size: 9pt;\n    overflow: auto;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n}\n.rongcloud-text:focus {\n    outline: 0;\n}\n.rongcloud-powBox {\n    position: absolute;\n    right: 0px;\n    /*width: 100%;*/\n    height: 24px;\n}\n.rongcloud-rong-send-btn {\n    position: absolute;\n    top:55px;\n    right: 10px;\n    bottom: 0;\n    margin: 0;\n    padding: 0;\n    cursor: pointer;\n    border: none;\n    width: 60px;\n    height: 24px;\n    line-height: 24px;\n    border-radius: 40px;\n    font-size: 9pt;\n    color: rgb(255, 255, 255);\n    background: #0099ff;\n    outline:0;\n}\n.rongcloud-MessageForm-tool {\n    position: relative;\n    margin-right: 8px;\n    float: left;\n    overflow: hidden;\n}\n.rongcloud-MessageForm-tool input[type=\"file\"] {\n    position: absolute;\n    font-size: 100px;\n    right: 0;\n    top: 0;\n    cursor: pointer;\n    opacity: 0;\n}\n.rongcloud-MessageForm-tool i {\n    width: 20px;\n    height: 20px;\n    line-height: 20px;\n    cursor: pointer;\n    display: inline-block;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-smile {\n    background-size: 45px;\n    background-position: 0 -297px;\n}\n.rongcloud-expressionWrap {\n    border: 1px solid #D9DADC;\n    width: 290px;\n    padding: 5px 8px;\n    position: absolute;\n    left: -2px;\n    top: -198px;\n    height: 180px;\n    background: #fff;\n    z-index: 1100;\n    overflow: auto;\n    -webkit-tap-highlight-color: rgba(0,0,0,0);\n    -webkit-user-select:none;\n    -moz-user-select:none;\n    -ms-user-select:none;\n    user-select:none;\n}\n.rongcloud-expressionContent{\n    width: 100%;\n}\n.rongcloud-expressionContent div{\n    cursor: pointer;\n    margin: 0 2px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-upload {\n    width: 24px;\n    background-size: 45px;\n    background-position: 0 -333px;\n}\n.rongcloud-expressionWrap .rongcloud-arrow {\n    position: absolute;\n    left: 5px;\n    bottom: -9px;\n    display: inline-block;\n    width: 10px;\n    height: 9px;\n    background: url(//cdn.ronghub.com/customerservice-icon.png);\n    background-position: 0 -1476px;\n}\n\n/* 客服评价 */\n.rongcloud-layermbox {\n    /*position: relative;*/\n    position: initial;\n    height: 100%;\n    z-index: 19891014;\n}\n.rongcloud-layermmain {\n    display: table;\n    pointer-events: none;\n}\n.rongcloud-laymshade, .rongcloud-layermmain {\n    position: absolute;\n    left: 0;\n    top: 0;\n    width: 100%;\n    height: 100%;\n    z-index: 1200;\n}\n.rongcloud-laymshade {\n    background-color: rgba(0,0,0, .5);\n    pointer-events: auto;\n}\n.rongcloud-layermmain .rongcloud-section {\n    display: table-cell;\n    vertical-align: middle;\n    text-align: center;\n}\n.rongcloud-layermchild {\n    position: relative;\n    display: inline-block;\n    text-align: left;\n    background-color: #fff;\n    font-size: 14px;\n    border-radius: 3px;\n    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);\n    pointer-events: auto;\n    /*max-width: 250px;*/\n}\n.rongcloud-layermchild h3{\n    text-overflow: ellipsis;\n    overflow: hidden;\n    white-space: nowrap;\n}\n.rongcloud-layermcont{\n    padding: 20px 20px 10px;\n    text-align: center;\n}\n.rongcloud-layermbox .rongcloud-rong-btn{\n    display: inline-block;\n    width: 54px;\n    height: 30px;\n    line-height: 30px;\n    border: 1px solid #c4c4c4;\n    border-radius: 3px;\n    color: #000;\n    overflow: hidden;\n}\n.rongcloud-layermbox .rongcloud-rong-btn:hover{\n    background-color: #0099ff;\n    color: #fff;\n    border-color: #0099ff;\n}\n\n\n\n\n.rongcloud-layermbox .rongcloud-feedback{\n    background-color: rgba(0,0,0,.6);\n    color: #fff;\n    border: none;\n}\n.rongcloud-layermbox .rongcloud-feedback .rongcloud-layermcont{\n    padding: 15px;\n    font-size: 16px;\n}\n\n.cursor-pointer{\n    cursor: pointer;\n}\n/* 图片预览 */\n.rebox{\n    z-index: 999999;\n    position: fixed;\n    width: 100%;\n    height: 100%;\n    top: 0;\n    left: 0;\n    z-index: 1000;\n    background: rgba(0, 0, 0, 0.7);\n}\n.rebox-contents{\n    position: absolute;\n    top: 5%;\n    left: 5%;\n    text-align: center;\n    width: 90%;\n    height: 90%;\n}\n.rebox-contents .rebox-content {\n    border: none!important;\n    box-shadow: 0 0 8px #222!important;\n    cursor: pointer;\n    border: 5px solid #fff;\n    background-color: #fff;\n    border-radius: 1px;\n    max-width: 100%;\n    max-height: 100%; \n    margin: auto;\n    position: absolute;\n    bottom: 0;\n    top: 0;\n    left: 0; \n    right: 0;\n}\n.rebox-close {\n    right: 10px;\n    top: 10px;\n}\n.rebox-button {\n    position: absolute;\n    z-index: 9999;\n    min-width: 40px;\n    height: 40px;\n    line-height: 40px;\n    background: rgb(0, 0, 0);\n    opacity: 0.4;\n    text-decoration: none;\n    font-size: 24px;\n    color: #fff;\n    text-align: center;\n    vertical-align: middle;\n    -webkit-border-radius: 32px;\n    -moz-border-radius: 32px;\n    -ms-border-radius: 32px;\n    border-radius: 32px;\n    -webkit-transition: all 0.3s;\n    -moz-transition: all 0.3s;\n    -ms-transition: all 0.3s;\n    transition: all 0.3s;\n}\n.rebox-button:hover {\n    opacity: 1;\n    -webkit-transform: scale(1.4);\n    -moz-transform: scale(1.4);\n    -ms-transform: scale(1.4);\n    transform: scale(1.4);\n}\n\n/* 小能客服 */\n.rongcloud-layer-title {\n    padding: 5px;\n    text-align: center;\n}\n.rongcloud-evaluate .rongcloud-layer-body label {\n    line-height: 2.3;\n    margin-right: 20px;\n    color: #808586;\n}\n.rongcloud-evaluate .rongcloud-layer-body input {\n    margin-right: 5px;\n    vertical-align: middle;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n}\n.rongcloud-suggest {\n    resize: none;\n    padding: 5px;\n    width: 100%;\n    height: 70px;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n    outline: none;\n}\n.rongcloud-suggest:focus{\n    border-color: #0099ff;\n}\n.rongcloud-layer-body .rongcloud-form-item label {\n    width: 52px;\n    display: inline-block;\n    vertical-align: top;\n    text-align: right;\n    white-space: nowrap;\n}\n.rongcloud-layer-body .rongcloud-form-item textarea,input[type=text] {\n    width: 200px;\n}\n.rongcloud-layer-body .rongcloud-form-item textarea {\n    padding: 5px;\n    max-width: 200px;\n    max-height: 160px; \n    resize:none;\n}\n.rongcloud-require:before {\n    content:\"* \";\n    color:#f26868;\n    font-weight:bold;\n}\n\n.rongcloud-evaluate {\n    width: 266px;\n    padding-top: 10px;\n}\n.rongcloud-evaluate .rongcloud-layer-title{\n    font-size: 14px;\n    color: #333;\n    border-bottom: 1px solid #ddd;\n}\n.rongcloud-evaluate .rongcloud-layer-body{\n    padding: 0px 15px 5px;\n    -webkit-tap-highlight-color: rgba(0,0,0,0);\n    -webkit-user-select:none;\n    -moz-user-select:none;\n    -ms-user-select:none;\n    user-select:none;\n}\n.rongcloud-group-title{\n    text-align: center;\n    line-height: 35px;\n    color: #333;\n    font-size: 14px;\n}\n.rongcloud-group-tag-list{\n    display: table;\n    width: 100%;\n    padding: 0px 5px;\n}\n.rongcloud-group-tag{\n    font-size: 12px;\n    text-align: center;\n    width: 105px;\n    float: left;\n    margin-right: 15px;\n    margin-bottom: 5px;\n    border: 1px solid #B4BDCB;\n    border-radius: 8px;\n    height: 25px;\n    line-height: 22px;\n    color: #B4BDCB;\n    cursor: pointer;\n}\n.rongcloud-group-tag:hover{\n    border: 1px solid #A1A6B7;\n    color: #A1A6B7;\n}\n.rongcloud-group-tag-active,.rongcloud-solve-active{\n    background-color: #1399FF;\n    border-color: #1399FF;\n    color: #fff;\n}\n.rongcloud-group-tag-active:hover,.rongcloud-solve-active:hover{\n    color: #fff;\n    border-color: #1399FF;\n}\n.rongcloud-group-tag-list .rongcloud-group-tag:nth-child(2n){\n    margin-right: 0px;\n}\n.rongcloud.group-title{\n    margin-bottom: 10px;\n}\n.rongcloud-leaveword {\n    width: 300px;\n}\n.rongcloud-foot {\n    text-align: center;\n    padding-bottom: 10px;\n}\n.rongcloud-layer-submit {\n    padding: 5px;\n    width: 100px;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n    background-color: white;\n    outline:none;\n}\n.rongcloud-layer-submit:hover {\n    background-color: #EEE;\n}\n\n.rongcloud-layer-close {\n    position: absolute;\n    font-size: 16px;\n    top: 5px;\n    right: 5px;\n    padding: 6px;\n    line-height: 16px;\n    cursor: pointer;\n}\n.rongcloud-Message-file {\n    position: relative;\n    width: 270px;\n    overflow: hidden;\n    border: 1px solid #b9c1ca;\n    border-radius: 3px;\n}\n.rongcloud-file-icon {\n    float: left;\n    width: 52px;\n    height: 52px;\n    margin: 8px;\n    display: inline-block;\n    border-radius: 5px;\n    background-size: 45px;\n    background-position: 3px -541px;\n    background-color: #3ea9ff;\n}\n.rongcloud-file-name {\n    width: 155px;\n    margin-top: 8px;\n    margin-bottom: 4px;\n    overflow:hidden;\n    text-overflow:ellipsis;\n    white-space:nowrap;\n}\n.rongcloud-file-size {\n    font-size: 12px;\n}\n.rongcloud-file-download {\n    position: absolute;\n    right: 10px;\n    top: 15px;\n    display: inline-block;\n    width: 30px;\n    height: 30px;\n    background-size: 45px;\n    background-position: 0 -611px;\n}\n\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-file {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -443px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-download {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -476px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-evaluate {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -504px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-evaluate[disabled] {\n    background-position: -23px -504px;\n    cursor: default;\n}\n.rongcloud-endconversation {\n    width: 270px;\n    height: 135px;\n    padding: 22px;\n}\n.rongcloud-endconversation .rongcloud-prompt {\n    margin-top: 10px;\n}\n.rongcloud-endconversation .rongcloud-buttons {\n    margin-top: 30px;\n    text-align: center;\n}\n.rongcloud-buttons button+button {\n    margin-left: 50px;\n}\n.rongcloud-button {\n    width: 77px;\n    height: 30px;\n    line-height: 30px;\n    border: 1px solid #D8D8D8;\n    border-radius: 4px;\n    background-color: white;\n    outline:none;\n}\n.rongcloud-button:hover{\n    border-color: #53B4FF;\n    color:#53B4FF;\n}\n.rongcloud-leavemessage {\n    position: absolute;\n    top: 36px;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    background-color: white;\n}\n\n.rongcloud-leavemessage-title {\n    padding: 20px 40px 25px;\n    width: 310px;\n}\n.rongcloud-form-item {\n    margin: 0 40px 25px;\n    font-size: 14px;\n}\n.rongcloud-form-item label {\n    display: inline-block;\n    margin-right: 10px;\n}\n.rongcloud-leavemessage .rongcloud-form-item label {\n    width: 70px;\n    text-align: right;\n}\n.rongcloud-form-error {\n    color: #f26868;\n    margin: 2px 0 -19px 85px;\n    font-size: 13px;\n}\n.rongcloud-form-item textarea {\n    vertical-align: top;\n    width: 270px;\n    height: 120px;\n    padding: 4px;\n    border: 1px solid #cccccc;\n    border-radius: 4px;\n    resize: none;\n}\n.rongcloud-form-item .rongcloud-inputtext{\n    width: 270px;\n    height: 26px;\n    box-shadow: rgba(0, 0, 0, 0.07451) 0px 1px 1px inset;\n    padding: 4px;\n    border: 1px solid #cccccc;\n    border-radius: 4px;\n    outline: none;\n}\n.rongcloud-form-item .rongcloud-form-label{\n    line-height: 26px;\n}\n.rongcloud-leavemessage-form-btns{\n    text-align: center;\n}\n.rongcloud-btn {\n    width: 150px;\n    height: 30px;\n\n    line-height: 30px;\n    color: white;\n    outline: none;\n    background-color: #0099FF;\n    border-radius: 4px;\n    cursor: pointer;\n}\n/*收集用户信息*/\n.rongcloud-collectuserinfo-title{\n    padding: 30px 20px 15px\n}\n.rongcloud-collectuserinfo .rongcloud-form-item{\n    margin: 0 20px 25px;\n}\n.rongcloud-collectuserinfo .rongcloud-form-item .rongcloud-inputtext{\n    width: 200px;\n}\n.rongcloud-collectuserinfo .rongcloud-form-error{\n    margin: 2px 0 -19px 65px;\n}\n.rongcloud-consult {\n  position: fixed;\n  right: 50px;\n  bottom: 10px;\n  width: 195px;\n  text-align: center;\n}\n.rongcloud-consult button {\n  display: block;\n  width: 195px;\n  margin-bottom: 17px;\n  background: #0096f9;\n  border: 0;\n  padding: 0;\n  color: #fff;\n  font-family: 'Microsoft Yahei';\n  font-size: 16px;\n  cursor: pointer;\n}\n.rongcloud-consult button[disabled] {\n  background-color: #EEEEEE;\n  cursor: default;\n}\n.rongcloud-consult span {\n  display: inline-block;\n  padding-left: 43px;\n  line-height: 50px;\n  background: url(//cdn.ronghub.com/customerservice-icon.png) no-repeat 0 -358px;\n  background-size: 45px;\n}\n\n.rong-conversation{\n    font-size:12px;\n    line-height:20px;\n    color:#333;\n    min-height:40px;\n    padding:5px;\n    border-bottom:1px dotted #f5f5f5;\n    cursor:pointer;\n}\n\n.rong-conversation img {\n    width:40px;\n    height:40px;\n    position:absolute;\n}\n.rong-conversation-name,\n.rong-conversation-message{\n    margin-left:45px;\n}\n.rong-conversation-name{\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    width: 140px;\n    display: inline-block;\n}\n\n.rcs-chat-wrapper{\n    position:fixed;\n    bottom: 100px;\n    right: 48px;\n    width: 470px;\n    height: 470px;\n}\n\n.leavemessageHref{\n    cursor: pointer;\n    color: #00A3FF;\n}\n.leavemessageHref:hover{\n    text-decoration: underline;\n}\n\n.rong-link-site, .rong-link-email{\n    color: #008af3;\n}\n.rong-link-site:hover ,.rong-link-email:hover{\n    text-decoration: underline;\n}\n\n.satisfaction-star{\n    display: inline-block;\n    width: 35px;\n    height: 30px;\n    margin-left: 7px;\n    background-image: url(\"./images/star.png\");\n    background-repeat: no-repeat;\n    background-size: 30px;\n    cursor: pointer;\n}\n.satisfaction-star-selected{\n    background-position-y: -30px;\n}\n.rongcloud-evaluate-btn{\n    width: 50%;\n    height: 50px;\n    color: #0099ff;\n    text-align: center;\n    line-height: 50px;\n    background-color: #fff;\n    box-sizing: border-box;\n    cursor: pointer;\n    outline: none;\n}\n.rongcloud-evaluate-btn:active{\n    background-color: #ddd;\n}\n.rongcloud-evaluate-btn:nth-child(1){\n    border-right: 1px solid #c6c6c6;\n    border-bottom-left-radius: 3px;\n}\n.rongcloud-evaluate-btn:nth-child(2){\n    border-bottom-right-radius: 3px;\n}\n.rongcloud-evaluate .rongcloud-foot{\n    padding-bottom: 0px;\n    border-top: 1px solid #c6c6c6;\n}\n.rongcloud-footer-input{\n    height: 80px;\n    padding-right: 80px;\n}\n.rongcloud-footer-textarea{\n    height: 100%;\n}\n\n.rongcloud-phone-infoBar{\n    text-align: center;\n    line-height: 36px;\n    color: #fff;\n}\n.rongcloud-phone-exit{\n    display: inline-block;\n    position: absolute;\n    left: 5px;\n    top: 5px;\n    width: 26px;\n    height: 26px;\n    background-image: url(\"./images/back.png\");\n    background-size: 25px;\n    background-repeat: no-repeat;\n}\n.rongcloud-phone-exit:active{\n    color: #c6c6c6;\n}\n\n.emojiItem{\n    display: inline-block;\n}\n\n@media screen and (max-width: 600px) {\n    .rcs-chat-wrapper{\n        top: 0;\n    \tleft: 0;\n    \twidth: 100%;\n    \theight: 100%;\n    }\n    .rongcloud-kefuChat{\n    \twidth: 100%;\n    \theight:100%;\n    }\n    .rongcloud-kefuChat .rongcloud-rong-header{\n        border-radius: 0px;\n    }\n    .rcs-message-box{\n        bottom: 65px;\n    }\n    .rongcloud-rong-footer{\n        height: 65px;\n    }\n    .rongcloud-footer-input{\n        height: 35px;\n    }\n    .rongcloud-rong-send-btn{\n        top: 35px;\n    }\n    .rongcloud-text{\n        height: 35px;\n    }\n}"
  },
  {
    "path": "cs/sobot/cs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no\">\n<title>CS</title>\n</head>\n<body>\n\n<div id=\"rcs-app\"></div>\n\n<link rel=\"stylesheet\" href=\"cs.css?5\">\n\n<script src=\"./RongIMLib-cs.min.js\"></script>\n<script src=\"./RongIMEmoji.js\"></script> \n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n\n<script src=\"utils.js\"></script>\n<script src=\"upload.js\"></script>\n<script src=\"template.js\"></script>\n<script src=\"emoji.js\"></script>\n<script src=\"cs.js\"></script>\n\n\n\n<!-- 实例化 -->\n<script>\nRCS.init({\n    appKey: \"c9kqb3rdkh4jj\",\n    token: \"qjxXwJizd7Y62DTmUEluw5lzpNwuJBCkPrRErVG12EKi1UP6giNGqszv6IQX0IndGKwjoGwevVmUVSN0x458KOqK0LwxTuhy\",\n    target: document.getElementById('rcs-app'),\n    customerServiceId: \"KEFU150535341165880\", // 客服Id\n    userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像，在用户没有头像的时候显示\n    csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像，在客服没有头像的时候显示,建议线上地址\n    showButton: true,\n    //是否需要按钮主动发起，设为false的时候，init()方法直接唤起聊天窗口,需客户自己编写按钮，点击之后调用init(),templates中的button模板不可用;设为true的时候，init()首先唤起客服咨询按钮，点击之后才连接客服，唤起聊天窗口，在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token，在获取到token之后，执行init()即可。\n    connectingCallback: function(){\n        console.log('连接中');\n    },//连接中的执行的方法，例如显示加载页面,可不传\n    connectedCallback: function(){},//连接成功之后的方法，例如关闭加载页面,可不传\n    disconnectedCallback: function(){\n        alert('连接断开');\n    },//断开连接之后的操作,可不传\n    templates: {\n        button: ['<div class=\"rongcloud-consult\">',\n                '   <button onclick=\"RCS.showCommon()\"><span>客服咨询</span></button>',\n                '</div>',\n                '<div class=\"customer-service\" style=\"display: none;\"></div>'].join('')//\"templates/button.html\",\n        // chat: \"templates/chat.html\",\n        // closebefore: 'templates/closebefore.html',\n        // conversation: 'templates/conversation.html',\n        // endconversation: 'templates/endconversation.html',\n        // evaluate: 'templates/evaluate.html',\n        // imageView: 'templates/imageView.html',\n        // leaveword: 'templates/leaveword.html',\n        // main: 'templates/main.html',\n        // message: 'templates/message.html',\n        // messageTemplate: 'templates/messageTemplate.html',\n        // userInfo: 'templates/userInfo.html', \n    }\n});\n</script>\n\t\n</body>\n</html>"
  },
  {
    "path": "cs/sobot/cs.js",
    "content": ";(function(RCS){\n\tvar utils = RCS.utils;\n\tvar emoji = RCS.emoji;\n\tvar render = utils.render;\n\tvar conversation = {};\n\tconversation.lastSendTime = 0;\n\tconversation.lastInputTime = 0;\n\tconversation.evaluateStatus = true;//判断评价的类型，用户关闭时出现的还是客服主动下发的\n\tconversation.closeStatus = 1;\n\tconversation.messageContent = [];\n\tconversation.evaluateFormValue = {};\n\tconversation.evaluateFormValue.isresolve = 1;\n\tvar voicePlay = null;\n\tvar userInfoValue = {};//保存收集用户信息的相关数据\n\tvar templates = {};\n\tvar $ = utils.$;\n\tvar terminal;\n\tvar supportNot = false;//页面是否支持notification\n\tvar sdkConnect = 0;\n\n\t//加载模板\n\tvar getTemplates = function(callback){\n\t\ttemplates = RCS.getTemplates();\n\t\tcallback && callback();\n\t}\n\n\t//键盘回车发送\n\tvar keySend = function(event){\n\t\tif (event.keyCode == '13' && !event.shiftKey) {\n\t\t\tevent.preventDefault()\n\t\t\tsend();\n\t\t} else if(conversation.needTypSts == 1){\n\t\t\tinputChange();\n\t\t}\n\t}\n\t//发送\n\tvar send = function(){\n\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\tvar message = inputMsg.value;\n\t\tif (message) {\n\t\t\tmessage = emoji.symbolToEmoji(message);\n\t\t\tsendMessage(new RongIMLib.TextMessage({content:message,extra:\"附加信息\"}));\n\t\t\tinputMsg.value = '';\n\t\t\tinputMsg.focus();\n\t\t}\n\t}\n\t//每6秒执行一次正在输入消息发送\n\tvar inputChange = function(){\n\t \tvar timespan = new Date().getTime() - conversation.lastSendTime;\n        if (timespan > 1000 * 6) {\n            conversation.lastSendTime += timespan;\n            sendTyping();\n        }\n\t}\n\t//正在输入中\n\tvar sendTyping = function(){\n        if (conversation.targetType == RongIMLib.ConversationType.CUSTOMER_SERVICE) {\n        \tvar msg = new RongIMLib.TypingStatusMessage({\n                typingContentType:'RC:TxtMsg',\n                data:null\n            });\n            var callback = function(){};\n            sendMessage(msg,callback);\n        }\n\t}\n\t//显示表情\n\tvar showemoji = function(event){\n\t\tevent.stopPropagation();\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tif (emojiContent.style.display == 'none') {\n\t\t\tutils.show(emojiContent);\n\t\t} else {\n\t\t\tutils.hide(emojiContent);\n\t\t}\n\t}\n\t//表情点击\n\tvar chooseEmoji = function(event){\n\t\tevent.stopPropagation();\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar textArea = $('.rongcloud-text')[0];\n\t\tif (thisTarget.className == 'RC_Expression') {\n\t\t\tthisTarget = thisTarget.parentNode;\n\t\t}\n\t\tvar emojiName = thisTarget.getAttribute('name');\n\t\tif (emojiName) {\n\t\t\ttextArea.value += emojiName;\n\t\t\tutils.hide(emojiContent);\t\n\t\t\tif (terminal == 'pc') {\n\t\t\t\ttextArea.focus();\n\t\t\t\trange = document.createRange();\n\t\t\t\trange.selectNodeContents(textArea);\n\t\t\t\trange.collapse(true);\n\t\t\t\trange.setEnd(textArea, textArea.childNodes.length);\n\t\t\t\trange.setStart(textArea, textArea.childNodes.length);\n\t\t\t\tsel = window.getSelection();\n\t\t\t\tsel.removeAllRanges();\n\t\t\t\tsel.addRange(range);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction textMessageFormat(content) {\n\t    if(content.length === 0){\n\t        return '';\n\t    }\n\n\t    content = utils.encodeHtmlStr(content);\n\n\t    content = utils.replaceUri(content, function(uri, protocol) {\n\t        var link = uri;\n\t        if (!protocol) {\n\t            link = 'http://' + uri;\n\t        }\n\t        return '<a class=\"rong-link-site\" target=\"_blank\" href=\"'+ link +'\">' + uri + '</a>';\n\t    });\n\n\t    content = utils.replaceEmail(content, function(email) {\n\t        return '<a class=\"rong-link-email\" href=\"mailto:' + email + '\">' + email + '<a>';\n\t    });\n\t    return emoji.emojiToHTML(content, 18);\n\t}\n\n\t//发送消息\n\tvar sendMessage = function(msg,callback){\n\t\tvar targetId = conversation.id; // 目标 Id\n\t\tRongIMClient.getInstance().sendMessage(conversation.targetType, targetId, msg, {\n            // 发送消息成功\n            onSuccess: function (message) {\n            \tconsole.log(message);\n                //message 为发送的消息对象并且包含服务器返回的消息唯一Id和发送消息时间戳\n                console.log(\"Send successfully\");\n                callback && callback();\n                if (!callback) {\n                \tupdateMessage(message);\n                }\n            },\n            onError: function (errorCode,message) {\n                var info = '';\n                switch (errorCode) {\n                    case RongIMLib.ErrorCode.TIMEOUT:\n                        info = '超时';\n                        break;\n                    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n                        info = '未知错误';\n                        break;\n                    case RongIMLib.ErrorCode.REJECTED_BY_BLACKLIST:\n                        info = '在黑名单中，无法向对方发送消息';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_DISCUSSION:\n                        info = '不在讨论组中';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_GROUP:\n                        info = '不在群组中';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_CHATROOM:\n                        info = '不在聊天室中';\n                        break;\n                    default :\n                        info = x;\n                        break;\n                }\n                console.log('发送失败:' + info);\n            }\n       \t});\n\t}\n\n\t//显示新消息\n\tvar updateMessage = function(message){\n\t\tconversation.messageContent.push(message);\n\t\tvar newMessage = modifyMessage(utils.cloneObj(message));\n\t\tif (message.messageDirection != 1 && supportNot) {\n\t\t\tpushMessage(newMessage);\n\t\t}\n\t\tvar messageList = $(\".rcs-message-box\")[0];\n\t\tif (!messageList) {\n\t\t\treturn;\n\t\t}\n\t\tif (newMessage.sentTime - conversation.lastSendTime >= 60000) {//超过1分钟\n\t\t\tvar messageTime = {};\n\t\t\tmessageTime.content = {};\n\t\t\tmessageTime.messageType = 'TimeMessage';\n\t\t\tmessageTime.sentTime = utils.getTime(newMessage.sentTime);\n\t\t\tmessageList.innerHTML += render(templates.messageTemplate,messageTime);\n\t\t\tconversation.lastSendTime = newMessage.sentTime;\n\t\t}\n\t\tmessageList.innerHTML += render(templates.messageTemplate,newMessage);\n\t\tmessageList.scrollTop = messageList.scrollHeight;\n\t}\n\n\t//web push message\n\tvar pushMessage = function(msg){\n\t\tif (terminal == 'pc') {\n\t\t\tvar title = '客服消息提醒';\n\t\t\tvar options = {\n\t\t        body: \"您有一条新消息，请及时回复\",\n\t\t        icon: (msg.content.user&&msg.content.user.icon) ? msg.content.user.icon : RCS.config.csIcon,\n\t\t    };\n\t\t    var notification = new Notification(title,options);\n\n\t\t    notification.onclick = function(event) {\n\t\t        window.focus();\n\t\t        notification.close();\n\t\t    }\n\t\t    notification.onshow = function() {  \n\t            setTimeout(function() {  \n\t                notification.close();\n\t            }, 5000);  \n\t        };\n\t\t}\n\t}\n\n\t//图片新消息图片加载完毕滚动到最下面\n\tvar scrollBottom = function(){\n\t\tvar messageList = $(\".rcs-message-box\")[0];\n\t\tmessageList.scrollTop = messageList.scrollHeight;\n\t}\n\t//加载历史消息\n\tvar loadHisMessages = function(){\n\t\tvar callbacks = function(list,hasMsg){\n\t\t\tvar messageBox = $(\".rcs-message-box\")[0];\n\t\t\tvar messageList = {};\n\t\t\tmessageList.hasMore = hasMsg;\n\t\t\tmessageList.list = modificateMessage(conversation.messageContent);\n\t\t\tvar oldHeight = messageBox.scrollHeight;\n\t\t\tmessageBox.innerHTML = render(templates.message,messageList);\n\t\t\tvar newHeight = messageBox.scrollHeight;\n\t\t\tmessageBox.scrollTop = newHeight-oldHeight;\n\t\t}\n\t\tgetHisMessage(conversation.id,null,20,callbacks);\n\t}\n\n\t//生成会话列表界面\n\tvar createConversation = function(config){\n\t\tvar data = {\n\t\t\t\"showConversitionList\": config.showConversitionList\n\t\t}\n\t\tif (data.showConversitionList) {\n\t\t\tdata.conversationList = render(templates.conversation,config.customers);\n\t\t}\n\t\t$(\".customer-service\")[0].innerHTML = render(templates.main,data);\n\n\t\tvar conversationList = $(\".rong-conversation\");\n\t\tfor(var i=0;i<conversationList.length;i++){\n\t\t\tconversationList[i].onclick = function(){\n\t\t\t\tif (conversation.id == this.getAttribute(\"_cid\")) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconversation.id = this.getAttribute(\"_cid\");\n\t\t\t\t//初始化客服\n\t\t\t\tstartCustomerServer(conversation.id);\n\t\t\t};\n\t\t}\n\t}\n\n\t//进入指定会话\n\tvar openConversation = function(conversationId){\n\t\tconversation.targetType = RongIMLib.ConversationType.CUSTOMER_SERVICE;\n\t\tvar chat = $(\".rcs-chat-wrapper\")[0];\n\t\tvar data = {};\n\t\tvar messageList = {};\n\t\tmessageList.firstEnter = true;\n\t\tdata.messageList = render(templates.message, messageList);\n\t\tdata.evaEntryPoint = conversation.evaEntryPoint;\n\t\tdata.terminal = terminal;\n\t\tdata.announce = conversation.announce;\n\t\t$(\".rcs-chat-wrapper\")[0].innerHTML = render(templates.chat, data);\n\t\t//初始化表情\n\t\tvar emojiList = emoji.getEmoji();\n\t\tvar strHtml = '';\n\t\tfor (var i = 0; i < emojiList.length; i++) {\n\t\t\tstrHtml += '<div class=\"emojiItem\">'+emojiList[i].outerHTML+'</div>';\n\t\t}\n\t\t$('.rongcloud-expressionContent')[0].innerHTML += strHtml;\n\t\tvar callbacks = function(list,hasMsg){\n\t\t\tif (hasMsg || list.length != 0) {\n\t\t\t\t$('.rongcloud-Messages-history')[0].style.display = 'block';\n\t\t\t}\n\t\t}\n\t\tgetHisMessage(conversationId,0,2,callbacks);\n\t}\n\n\t//拉去消息记录\n\tvar getHisMessage = function(conversationId,timestrap,count,callbacks){\n\t\tvar conversationType = RongIMLib.ConversationType.CUSTOMER_SERVICE; //私聊,其他会话选择相应的消息类型即可。\n\t\tvar targetId = conversationId; // 想获取自己和谁的历史消息，targetId 赋值为对方的 Id。\n\t\t// timestrap默认传 null，若从头开始获取历史消息，请赋值为 0 ,timestrap = 0;\n\t\t// count每次获取的历史消息条数，范围 0-20 条，可以多次获取。\n\t\tRongIMLib.RongIMClient.getInstance().getHistoryMessages(conversationType, targetId, timestrap, count, {\n\t\t  onSuccess: function(list, hasMsg) {\n\t\t  \tconsole.log(list);\n\t\t  \tconversation.messageContent = list.concat(conversation.messageContent);\n\t\t  \tcallbacks(list,hasMsg);\n\t\t  },\n\t\t  onError: function(error) {\n\t\t    console.log(\"GetHistoryMessages,errorcode:\" + error);\n\t\t  }\n\t\t});\n\t}\n\n\t//单条消息修饰\n\tvar modifyMessage = function(msg){\n\t\tif (msg.messageType == 'TextMessage') {\n\t\t\tmsg.content.content = textMessageFormat(msg.content.content);\n\t\t} else if (msg.messageType == 'FileMessage') {\n\t\t\tmsg.content.size = utils.getFileSize(msg.content.size);\t\n\t\t} else if (msg.messageType == 'InfoNtf') {\n\t\t\tmsg.messageType = 'InformationNotificationMessage';\n\t\t} else if (msg.messageType == 'VoiceMessage'){\n\t\t\tRongIMLib.RongIMVoice.preLoaded(msg.content.content);\n\t\t} else if (msg.messageType == 'PullLeaveMessage'){\n        \tmsg.messageType = 'AlertMessage';\n            msg.content.content = msg.content.content.replace('留言', '<a class=\"leavemessageHref\" onclick=\"RCS.leavemessage()\">留言</a>');\n\t\t}\n\t\treturn msg;\n\t}\n\n\t//消息修饰\n\tvar modificateMessage = function(list){\n\t\tvar listTemp = JSON.parse(JSON.stringify(list));\n\t\tvar _list = [];\n\t\tfor (var i = 0; i < listTemp.length; i++) {\n\t\t\tvar messageTime = {\n\t\t\t\tsentTime: utils.getTime(listTemp[i].sentTime),\n\t\t\t\tmessageType: 'TimeMessage'\n\t\t\t};\n\t\t\tvar messageMap = [\n\t\t\t\t\"TextMessage\",\n\t\t\t\t\"FileMessage\",\n\t\t\t\t\"InfoNtf\",\n\t\t\t\t\"ImageMessage\",\n\t\t\t\t\"InformationNotificationMessage\",\n\t\t\t\t\"VoiceMessage\",\n\t\t\t\t\"PullLeaveMessage\"\n\t\t\t];\n\t\t\tif (messageMap.indexOf(listTemp[i].messageType) >= 0) {\n\t\t\t\tlistTemp[i] = modifyMessage(listTemp[i]);\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 0) {\n\t\t\t\t_list.push(messageTime);\n\t\t\t}else if (listTemp[i].sentTime - listTemp[i-1].sentTime >= 6000) {\n\t\t\t\t_list.push(messageTime);\n\t\t\t}\n\t\t\t_list.push(listTemp[i]);\n\t\t}\n\t\treturn _list;\n\t}\n\n\t//客服初始化\n\tvar startCustomerServer = function(targetId){\n\t\tRongIMLib.RongIMClient.getInstance().startCustomService(targetId, {\n            onSuccess: function() {\n                console.log('客服初始化成功');\n                conversation.connect = true;\n            },\n            onError: function() {\n                \n            }\n        },RCS.config.extraInfo);\n\t}\n\n\t//断开客服连接\n\tvar stopCustomerServer = function(callback){\n\t\tconsole.log(conversation.id);\n\t\tRongIMLib.RongIMClient.getInstance().stopCustomeService(conversation.id, {\n\t\t    onSuccess: function() {\n\t\t    \tconversation.connect = false;\n\t\t    \tconsole.log('客服断开成功');\n\t\t    \tcallback && callback();\n\t\t    },\n\t\t    onError: function(errorcode) {\n\t\t    \tconsole.log('errorcode');\n\t\t    }\n\t\t});\n\t}\n\n\t//改变键盘状态\n\tvar changeServiceState = function(status){\n\t\tif (status == 'robot') {\n\t\t\tconversation.serviceState = 'robot';\n\t\t\tutils.hide($('.rongcloud-mode1')[0]);\n\t\t\tutils.show($('.rongcloud-mode2')[0]);\n\t\t} else {\n\t\t\tconversation.serviceState = 'people';\n\t\t\tutils.hide($('.rongcloud-mode2')[0]);\n\t\t\tutils.show($('.rongcloud-mode1')[0]);\n\t\t}\n\t}\n\n\t//转人工\n\tvar switchPerson = function(){\n\t\tconsole.log(conversation.id);\n\t\tRongIMLib.RongIMClient.getInstance().switchToHumanMode(conversation.id, {\n\t\t\tonSuccess: function() {\n\t\t\t\tconsole.log('转人工成功');\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\n\t\t\t}\n\t\t});\n\t}\n\t//转人工的监听\n\tvar changeModeResponse = function(message){\n\t\tconversation.evaluate = message.content.data.satisfaction;\n\t\tvar systemMsg = null;\n\t\tswitch (message.content.data.status){\n\t\t\tcase 1:\n\t\t\t\tchangeServiceState('people');\n\t\t\t\tbreak;\n\t\t\tcase 2:\n                changeServiceState('robot');\n                break;\n            case 3:\n                systemMsg = '你被拉黑了';//用户被拉黑,灰条消息你被拉黑了\n                break;\n            case 4:\n                systemMsg = '已经是人工了';//用户已经转人工，灰条消息已经是人工了\n                break;\n            default:\n                break;\n\t\t}\n\t\treturn systemMsg;\n\t}\n\t//发送欢迎语\n\tvar addCustomServiceInfo = function(msg){\n\t\tvar message = {};\n\t\tmessage.sentTime = new Date().getTime();\n\t\tmessage.content = {};\n\t\tmessage.messageType = 'TextMessage';\n\t\tmessage.content.content = msg.robotWelcome;\n\t\tmessage.content.user = {};\n\t\tmessage.content.user.icon = msg.robotIcon;\n\t\tmessage.content.user.name = msg.robotName;\n\t\tconsole.log(message);\n\t\tupdateMessage(message);\n\t}\n\t//发送灰条消息\n\tvar addServiceTip = function(content){\n\t\tvar message = {};\n\t\tmessage.sentTime = new Date().getTime();\n\t\tmessage.content = {};\n\t\tmessage.messageType = 'InformationNotificationMessage';\n\t\tmessage.content.message = content;\n\t\tconsole.log(message);\n\t\tupdateMessage(message);\n\t}\n\n\t//播放音频\n\tvar play = function(event, msgContent){\n\t\tRongIMLib.RongIMVoice.stop();\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tif (thisTarget.className.indexOf('rongcloud-animate') != -1) {\n\t\t\tthisTarget.className = thisTarget.className.replace(' rongcloud-animate','');\n\t\t\tclearTimeout(voicePlay);\n\t\t} else {\n\t\t\tvar audioStatusNode = thisTarget.parentNode.querySelector('.rongcloud-audioState');\n\t\t\tif (audioStatusNode) {\n\t\t\t\taudioStatusNode.parentNode.removeChild(audioStatusNode);\n\t\t\t}\n\t\t\tif (voicePlay) {\n\t\t\t\tclearTimeout(voicePlay);\n\t\t\t\tvar voiceList = $('.rongcloud-audioBox');\n\t\t\t\tfor (var i = 0; i < voiceList.length; i++) {\n\t\t\t\t\tvoiceList[i].className = 'rongcloud-audioBox rongcloud-clearfix';\n\t\t\t\t}\n\t\t\t}\n\t\t\tRongIMLib.RongIMVoice.play(msgContent.content, msgContent.duration);\n\t\t\tthisTarget.className = thisTarget.className +' rongcloud-animate';\n\t\t\tvoicePlay = setTimeout(function(){\n\t\t\t\tthisTarget.className = thisTarget.className.replace(' rongcloud-animate','');\n\t\t\t},msgContent.duration * 1000);\n\t\t}\n\t}\n\t//播放视频\n\tvar playVideo = function (event) {\n\t\tvar video = event.currentTarget.querySelector('video');\n        var btn = event.currentTarget.querySelector('.play-btn');\n        if (video.paused) {\n            video.play();\n            btn.style.display = \"none\";\n        } else {\n            video.pause();\n            btn.style.display = \"block\";\n        }\n        video.onended = function () {\n            btn.style.display = \"block\";  \n        }\n\t}\n\n\t//播放视频\n\tvar playVideo = function (event) {\n\t\tvar video = event.currentTarget.querySelector('video');\n        var btn = event.currentTarget.querySelector('.play-btn');\n        if (video.paused) {\n            video.play();\n            btn.style.display = \"none\";\n        } else {\n            video.pause();\n            btn.style.display = \"block\";\n        }\n        video.onended = function () {\n            btn.style.display = \"block\";  \n        }\n\t}\n\n\t//img上传图片\n\tvar imgUpload = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar _file = thisTarget.files;\n\t\tfor (var i = 0; i < _file.length; i++) {\n\t\t\tRCS.imageStartUpload(_file[i],function(data){\n\t\t\t\tconsole.log(\"文件上传完成：\", data);\n\t\t\t\tgetFileUrl(data);\n\t\t\t});\n\t\t}\n\t\tthisTarget.value = '';\n\t}\n\t//上传文件\n\tvar fileUpload = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar _file = thisTarget.files;\n\t\tfor (var i = 0; i < _file.length; i++) {\n\t\t\tRCS.fileStartUpload(_file[i],function(data){\n\t\t\t\tconsole.log(\"文件上传完成：\", data);\n\t\t\t\tgetFileUrl(data);\n\t\t\t});\n\t\t}\n\t\tthisTarget.value = '';\n\t}\n\n\tvar urlItem = {\n\t\tfile: function(data){\n\t\t\tif (RCS.config.upload && RCS.config.upload.isPrivate) {\n\t\t\t\tif (data.rc_url.type == 1) {\n\t\t\t\t\tdata.downloadUrl = data.rc_url.path;\n\t\t\t\t} else {\n\t\t\t\t\tdata.downloadUrl = RCS.config.upload.fileServer + data.rc_url.path;\n\t\t\t\t}\n\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\tsendMessage(msg);\n\t\t\t} else {\n\t\t\t\tvar fileType = RongIMLib.FileType.FILE;\n\t\t\t\tRongIMClient.getInstance().getFileUrl(fileType, data.filename, data.name, {\n\t\t\t\t\tonSuccess: function(result){\n\t\t\t\t\t\tdata.downloadUrl = result.downloadUrl;\n\t\t\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\t\t\tsendMessage(msg);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error){\n\t\t\t\t\t\tshowResult('getFileToken error:' + error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\timage: function(data){\n\t\t\tif (RCS.config.upload && RCS.config.upload.isPrivate) {\n\t\t\t\tif (data.rc_url.type == 1) {\n\t\t\t\t\tdata.downloadUrl = data.rc_url.path;\n\t\t\t\t} else {\n\t\t\t\t\tdata.downloadUrl = RCS.config.upload.fileServer + data.rc_url.path;\n\t\t\t\t}\n\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\tsendMessage(msg);\n\t\t\t} else {\n\t\t\t\tvar fileType = RongIMLib.FileType.IMAGE;\n\t\t\t\tRongIMClient.getInstance().getFileUrl(fileType, data.filename, null, {\n\t\t\t\t\tonSuccess: function(result){\n\t\t\t\t\t\tdata.downloadUrl = result.downloadUrl;\n\t\t\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\t\t\tsendMessage(msg);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error){\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tvar messageItem = {\n        file: function(file){\n            var name = file.name || '',\n            index = name.lastIndexOf('.') + 1,\n            type = name.substring(index);\n            // 发送文件消息请参考： http://rongcloud.cn/docs/web_api_demo.html#发送消息\n            // 创建文件消息\n            return new RongIMLib.FileMessage({ name: file.name, size: file.size, type: type, fileUrl: file.downloadUrl});\n        },\n        image: function(image){\n            return new RongIMLib.ImageMessage({content: image.thumbnail, imageUri: image.downloadUrl});\n        }\n    };\n\n\tvar getFileUrl = function(data){\n\t\turlItem[data.fileType](data);\n\t}\n\n\t//客服关闭\n\tvar endConversation = function(isCustomerService){\n\t\tif (isCustomerService) {\n\t\t\t//客服主动关闭\n\t\t\tif (conversation.serviceState == 'people') {\n\t\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += utils.render(templates.evaluate,conversation.evaluate[0]);\n\t\t\t} else {\n\t\t\t\tevaluate(false);\n\t\t\t}\n\t\t} else {\n\t\t\tif (conversation.closeStatus == 1) {\n\t\t\t\t//用户主动关闭\n\t\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += templates.endconversation;\n\t\t\t} else if (conversation.closeStatus == 2) {\n\t\t\t\t//主动留言关闭\n\t\t\t\tutils.removeNode('.rongcloud-leavemessage');\n\t\t\t\tconversation.closeStatus = 1;\n\t\t\t} else if (conversation.closeStatus == 3) {\n\t\t\t\t//拉黑留言关闭\n\t\t\t\tstopCustomerServer();\n\t\t\t\tendComplete();\n\t\t\t\tconversation.closeStatus = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\t//完全关闭\n\tvar endComplete = function(){\n\t\t$(\".rcs-chat-wrapper\")[0].innerHTML = '';\n\t\tutils.hide($('.customer-service')[0]);\n\t\tconversation.lastSendTime = 0;\n\t\tconversation.announce = {};\n\t\tconversation.messageContent = [];//完全退出清空数据\n\t\tconversation.evaluateFormValue = {};\n\t}\n\t//只关闭当前窗口\n\tvar closeEvaluate = function(){\n\t\tutils.removeNode('.rongcloud-evaluate');\n\t}\n\n\t//confirm\n\tvar confirm = function(){\n\t\t//确定关闭\n\t\tclose();\n\t\tif (conversation.serviceState == 'people') {\n\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += utils.render(templates.evaluate,conversation.evaluate[0]);\n\t\t} else {\n\t\t\tevaluate(false);\n\t\t}\n\t}\n\n\tvar close = function(){\n\t\t//取消关闭\n\t\tutils.removeNode('.rongcloud-layermbox');\n\t}\n\n\tvar chatEnd = function(){\n\t\tstopCustomerServer();//确定关闭了，先关闭客服链接\n\t\tendComplete();\n\t}\n\n\tvar star = function(num){\n\t\tvar starList = $('.satisfaction-star');\n\t\tfor (var i = 0; i < starList.length; i++) {\n\t\t\tstarList[i].className = \"satisfaction-star\";\n\t\t\tif (i<num) {\n\t\t\t\tstarList[i].className = \"satisfaction-star satisfaction-star-selected\";\n\t\t\t}\n\t\t}\n\t\tvar evaluateObj = conversation.evaluate[num-1];\n\t\tif (num == 5) {\n\t\t\tevaluateObj.labelNameArray = [];\n\t\t} else {\n\t\t\tconversation.evaluateFormValue.isTagMust = evaluateObj.isTagMust;\n\t\t\tconversation.evaluateFormValue.isInputMust = evaluateObj.isInputMust;\n\t\t\tevaluateObj.labelNameArray = evaluateObj.labelName.split(',');\n\t\t}\n\t\t$('.rongcloud-evaluate-tag')[0].innerHTML = utils.render(templates.evaluateItem,evaluateObj);\n\t}\n\tvar evaluate = function(isForm){\n\t\t//评价\n\t\tvar callback = function(){\n\t\t\tclose();\n\t\t\t$('.rcs-chat-wrapper')[0].innerHTML += templates.closebefore;\n\t\t}\n\t\tif (isForm) {\n\t\t\tif (!validateEvaluate()) {\n\t\t\t\treturn;\n\t\t\t} //表单验证\n\t\t\tif (conversation.evaluate[0].isQuestionFlag != 1) {\n\t\t\t\tconversation.evaluateFormValue.isresolve = -1;\n\t\t\t}\n\t\t\tvar source = 0;\n\t\t\tvar starList = $('.satisfaction-star');\n\t\t\tfor (var i = 0; i < starList.length; i++) {\n\t\t\t\tif (starList[i].className.indexOf(\"satisfaction-star-selected\") != -1) {\n\t\t\t\t\tsource += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconversation.evaluateFormValue.source = source;\n\t\t\tconversation.evaluateFormValue.type = 1;\n\t\t\tvar msg = new RongIMClient.RegisterMessage.EvaluateMessage(conversation.evaluateFormValue);\n\t\t\tconsole.log(msg);\n\t\t\tconsole.log(conversation.evaluateFormValue);\n\t\t\tRongIMClient.getInstance().sendMessage(conversation.targetType,conversation.id,msg,{\n\t\t\t\tonSuccess: function() {\n\t\t    \t\tconsole.log('发送评价消息成功');\n\t\t    \t\tcallback();\n\t\t\t    },\n\t\t\t    onError: function() {\n\n\t\t\t    }\n\t\t\t});\n\t\t} else {\n\t\t\tcallback();\n\t\t}\n\t}\n\t//点击isresolve\n\tvar isresolve = function(event,num){\n\t\tconversation.evaluateFormValue.isresolve = num;\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar solveList = $('.rongcloud-solve-tag');\n\t\tfor (var i = 0; i < solveList.length; i++) {\n\t\t\tsolveList[i].className = 'rongcloud-group-tag rongcloud-solve-tag';\n\t\t}\n\t\tthisTarget.className = 'rongcloud-group-tag rongcloud-solve-tag rongcloud-solve-active';\n\t}\n\n\t//tag点击\n\tvar tagClick = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tif (thisTarget.className.indexOf(\"rongcloud-group-tag-active\") != -1) {\n\t\t\tthisTarget.className = 'rongcloud-group-tag rongcloud-tag-item';\n\t\t} else {\n\t\t\tthisTarget.className = 'rongcloud-group-tag rongcloud-tag-item rongcloud-group-tag-active';\n\t\t}\n\t}\n\n\t//评价表单验证\n\tvar validateEvaluate = function(){\n\t\tvar tagList = $('.rongcloud-tag-item');\n\t\tvar tag = [];\n\t\tfor (var i = 0; i < tagList.length; i++) {\n\t\t\tif (tagList[i].className.indexOf(\"rongcloud-group-tag-active\") != -1) {\n\t\t\t\ttag.push(tagList[i].innerText);\n\t\t\t}\n\t\t}\n\t\tconversation.evaluateFormValue.tag = tag.join();\n\t\tconversation.evaluateFormValue.suggest = $('.rongcloud-evaluate-suggest')[0] ? $('.rongcloud-evaluate-suggest')[0].value : '';\n\t\tif (conversation.evaluateFormValue.isTagMust) {\n\t\t\tif (!conversation.evaluateFormValue.tag) {\n\t\t\t\tshowError('请选择存在的问题');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (conversation.evaluateFormValue.isInputMust) {\n\t\t\tif (!conversation.evaluateFormValue.suggest) {\n\t\t\t\tshowError('请输入评价内容');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t//页面错误提示\n\tfunction showError(str){\n\t\tif ($('.rongcloud-errorInfo')[0]) {\n\t\t\treturn;\n\t\t}\n\t\tvar node=document.createElement(\"div\");\n\t\tnode.className = 'rongcloud-errorInfo';\n\t\tnode.innerText = str;\n\t\t$('.rcs-chat-wrapper')[0].appendChild(node);\n\t\tutils.fadein($('.rongcloud-errorInfo')[0]);\n\t\tsetTimeout(function(){\n\t\t\tutils.fadeout($('.rongcloud-errorInfo')[0]);\n\t\t\tsetTimeout(function(){\n\t\t\t\t$('.rcs-chat-wrapper')[0].removeChild(node);\n\t\t\t},500);\n\t\t},1000);\n\t}\n\n\t//主动发起评价\n\tvar startEvaluate = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\t// thisTarget.parentNode.parentNode.removeChild(thisTarget.parentNode);\n\t\tpullEva();\n\t}\n\n\t//客服发送评价\n\tvar pullEva = function(){\n\t\tconversation.evaluateStatus = false;\n        $('.rcs-chat-wrapper')[0].innerHTML += utils.render(templates.evaluate,conversation.evaluate[0]);\n\t}\n\n\t//获取评价数据\n\t// var getEvaluateValue = function(){\n\t// \tvar satisfactionList = document.getElementsByName('satisfaction');\n\t// \tvar source = '';\n\t// \tfor (var i = 0; i < satisfactionList.length; i++) {\n\t// \t\tif (satisfactionList[i].checked) {\n\t// \t\t\tsource = satisfactionList[i].value;\n\t// \t\t}\n\t// \t}\n\t// \tvar suggest = document.getElementsByName('suggest')[0].value;\n\t// \treturn {\n\t// \t\tsource: source,\n\t// \t\tsuggest: suggest\n\t// \t}\n\t// }\n\n\t//留言\n\tvar leavemessage = function(isblack){\n\t\tif (isblack) {\n\t\t\tconversation.closeStatus = 3;\n\t\t} else {\n\t\t\tconversation.closeStatus = 2;\n\t\t}\n\t\tvar messageData = {};\n\t\t// messageData.url = conversation.leaveMsgUrl;\n\t\tmessageData.list = conversation.formList;\n\t\t$('.rcs-chat-wrapper')[0].innerHTML += render(templates.leaveword,messageData);\n\t}\n\t//留言提交\n\tvar leaveMessageComfirm = function(event){\n\t\tevent.preventDefault();\n\t\tvar formItemList = [];\n\t\tfor (var i = 0; i < conversation.formList.length; i++) {\n\t\t\tformItemList.push(conversation.formList[i].name);\n\t\t}\n\t\tvar isValidate = true;\n\t\tfor (var i = 0; i < formItemList.length; i++) {\n\t\t\tvar thisTarget = document.getElementsByName(formItemList[i])[0];\n\t\t\tif (!validateLeaveMessage(i,thisTarget)) {\n\t\t\t\tisValidate = false;\n\t\t\t}\n\t\t}\n\t\tif (!isValidate) {\n\t\t\treturn;\n\t\t}\n\t\tvar data = utils.getFormValue(formItemList);\n\t\tvar msg = new RongIMClient.RegisterMessage.LeaveMessage(data);//发送留言消息\n\t\tvar callback = function(){\n\t\t\tstopCustomerServer();\n\t\t\tendComplete();\n\t\t}\n\t\tsendMessage(msg,callback);\n\t}\n\n\t//留言表单验证\n\tvar validateLeaveMessage = function(index,eventOrTarget){\n\t\tvar verificationMap = {\n            email: '^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$',\n            phone: '^1\\\\d{10}$'\n        }\n\t\tvar thisTarget = (eventOrTarget.target || eventOrTarget.srcElement)? (eventOrTarget.target || eventOrTarget.srcElement):eventOrTarget;\n\t\tvar thisValue = thisTarget.value;\n\t\tvar validateStr = '';\n\t\tvar list = conversation.formList;\n\t\tif (list[index].required) {\n\t\t\tif (!thisValue) {\n\t\t\t\tvalidateStr = list[index].message[0];\n\t\t\t}\n\t\t}\n\t\tif (thisValue && list[index].verification) {\n\t\t\tvar reg = new RegExp(verificationMap[list[index].verification]);\n\t\t\tif (!reg.test(thisValue)) {\n\t\t\t\tvalidateStr = list[index].message[1];\n\t\t\t}\n\t\t}\n\t\tif (thisValue && list[index].max) {\n\t\t\tif (thisValue.length > list[index].max) {\n\t\t\t\tvalidateStr = list[index].message[2];\n\t\t\t}\n\t\t}\n\t\tvar nextTarget = thisTarget.nextElementSibling;\n\t\tif (validateStr) {\n\t\t\tnextTarget.innerHTML = validateStr;\n\t\t\tutils.show(nextTarget);\n\t\t\treturn false;\n\t\t} else {\n\t\t\tnextTarget.innerHTML = '';\n\t\t\tutils.hide(nextTarget);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//最小化\n\tvar minimize = function(){\n\t\tutils.hide($('.customer-service')[0]);\n\t}\n\n\t//预览图片\n\tvar viewImage = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar image = {\n\t\t\timageUrl: thisTarget.getAttribute('data-img')\n\t\t}\n\t\t$('.imageViewBox')[0].innerHTML = render(templates.imageView,image);\n\t\tutils.fadein($('.imageViewBox')[0]);\n\t}\n\tvar escImageView = function(){\n\t\t$('.imageViewBox')[0].innerHTML = '';\n\t\tutils.fadeout($('.imageViewBox')[0]);\n\t}\n\n\t//用户表单验证\n\tvar validateUserInfo = function(eventOrTarget){\n\t\tvar verificationMap = {\n            name: '^[\\u4E00-\\u9FA5A-Za-z0-9]+$',\n            phone: '^1[3|4|5|7|8][0-9]{9}$',\n            email: '^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$'\n        }\n\n\t\tvar thisTarget = (eventOrTarget.target || eventOrTarget.srcElement)? (eventOrTarget.target || eventOrTarget.srcElement):eventOrTarget;\n\t\tvar thisValue = thisTarget.value;\n\t\tvar thisName = thisTarget.getAttribute('name');\n\t\tvar thisLabel = thisTarget.getAttribute('data-label');\n\t\tvar thisRequired = thisTarget.getAttribute('data-required');\n\t\tvar thisRule = thisTarget.getAttribute('data-pattern');\n\t\tvar validateStr = '';\n\t\tif (thisRequired == 'required') {\n\t\t\tif (!thisValue) {\n\t\t\t\tvalidateStr = thisLabel+'不能为空';\n\t\t\t}\n\t\t}\n\n\t\tif (thisValue && thisRule) {\n\t\t\tvar reg = new RegExp(verificationMap[thisName]);\n\t\t\tif (!reg.test(thisValue)) {\n\t\t\t\tvalidateStr = thisRule;\n\t\t\t}\n\t\t}\n\n\n\t\tif (thisValue && thisName == 'name') {\n\t\t\tif (thisValue.length > 20) {\n\t\t\t\tvalidateStr = thisRule;\n\t\t\t}\n\t\t}\n\t\tif (thisValue && thisName == 'email') {\n\t\t\tif (thisValue.length > 30) {\n\t\t\t\tvalidateStr = thisRule;\n\t\t\t}\n\t\t}\n\t\tvar nextTarget = thisTarget.nextElementSibling;\n\t\tif (validateStr) {\n\t\t\tnextTarget.innerHTML = validateStr;\n\t\t\tutils.show(nextTarget);\n\t\t\treturn false;\n\t\t} else {\n\t\t\tnextTarget.innerHTML = '';\n\t\t\tutils.hide(nextTarget);\n\t\t\treturn true;\n\t\t}\n\t}\n\t//收集用户信息\n\tvar collectUserInfo = function(message){\n\t\tutils.removeNode('.userInfoModel');\n\t\tvar userInfo = {};\n\t\tuserInfo.list = message.content.content.fields;\n\t\tuserInfoValue.formid = message.content.content.formid;\n\t\tuserInfoValue.submiturl = message.content.content.submiturl;\n\t\tuserInfoValue.data = [];\n\t\tuserInfoValue.wid = 1;\n\t\tfor (var i = 0; i < userInfo.list.length; i++) {\n\t\t\tvar infoObj = {};\n\t\t\tinfoObj.name = userInfo.list[i].name;\n\t\t\tuserInfoValue.data.push(infoObj);\n\t\t}\n\t\t$('.rcs-chat-wrapper')[0].innerHTML += render(templates.userInfo,userInfo);\n\t}\n\t//用户信息关闭\n\tvar userInfoClose = function(){\n\t\tutils.removeNode('.userInfoModel');\n\t\tuserInfoValue = {};\n\t}\n\t//用户信息提交\n\tvar userInfoConfirm = function(event){\n\t\tevent.preventDefault();\n\t\tvar formItemList = [];\n\t\tfor (var i = 0; i < userInfoValue.data.length; i++) {\n\t\t\tformItemList.push(userInfoValue.data[i].name);\n\t\t}\n\t\tvar isValidate = true;\n\t\tfor (var i = 0; i < formItemList.length; i++) {\n\t\t\tvar thisTarget = document.getElementsByName(formItemList[i])[0];\n\t\t\tif (!validateUserInfo(thisTarget)) {\n\t\t\t\tisValidate = false;\n\t\t\t}\n\t\t}\n\t\tif (!isValidate) {\n\t\t\treturn;\n\t\t}\n\t\tvar data = utils.getFormValue(formItemList);\n\t\tfor (var i = 0; i < userInfoValue.data.length; i++) {\n\t\t\tuserInfoValue.data[i].value = data[userInfoValue.data[i].name];\n\t\t}\n\t\tvar sendUserInfoMsg = {};\n\t\tsendUserInfoMsg.content = userInfoValue;\n\t\tvar msg = new RongIMClient.RegisterMessage.UserInfo(sendUserInfoMsg);//发送用户信息提交消息\n\t\tuserInfoValue = {};\n\t\tvar callback = function(){\n\t\t\tutils.removeNode('.userInfoModel');\n\t\t};\n\t\tsendMessage(msg,callback);\n\t}\n\n\t//下载历史消息\n\tvar getHistoryMsgFile = function(){\n\t\tvar msg = new RongIMClient.RegisterMessage.DownloadHistoryMessage({\n\t\t\tbegin: 0\n\t\t});\n\t\tvar callback = function(){};\n\t\tsendMessage(msg,callback);\n\t}\n\n\t//自定义消息注册\n\tvar registerMessage = function() {\n        var messageName = \"ProductMessage\"; // 消息名称。\n        var objectName = \"cs:product\"; // 消息内置名称，请按照此格式命名。\n        var mesasgeTag = new RongIMLib.MessageTag(true, true);// 消息是否保存是否计数，true true 保存且计数，false false 不保存不计数。\n        var propertys = [\"title\", \"url\", \"content\", \"imageUrl\", \"extra\"]; // 消息类中的属性名。\n        // RongIMLib.RongIMClient.registerMessageType(messageName, objectName, mesasgeTag, propertys);\n        //评价下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"PullEvaMessage\", \"RC:CsPullEva\", mesasgeTag, ['content']);\n        //评价上行消息\n        RongIMLib.RongIMClient.registerMessageType(\"EvaluateMessage\", \"RC:CsEva\", mesasgeTag, ['sid','pid','uid','source','isresolve','tag','suggest','type']);\n        //留言下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"PullLeaveMessage\", \"RC:CsPLM\", mesasgeTag, ['content']);\n        //留言上行消息\n        RongIMLib.RongIMClient.registerMessageType(\"LeaveMessage\", \"RC:CsLm\", mesasgeTag, ['msg_content','msg_email','msg_name','msg_tel']);\n        // 收集信息下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"CollectUserInfo\", \"RC:CsCEI\", mesasgeTag, ['content','user']);\n        RongIMLib.RongIMClient.registerMessageType(\"UserInfo\", \"RC:CsEI\", mesasgeTag, ['content']);\n        // RC:CsDHM //下载历史消息  先发送这个类型的消息 上行消息\n        RongIMLib.RongIMClient.registerMessageType(\"DownloadHistoryMessage\", \"RC:CsDHM\", mesasgeTag, ['begin']);\n        // RC:CsHM 接受这个类型的消息 下行消息\n        RongIMLib.RongIMClient.registerMessageType(\"HistoryMessage\", \"RC:CsHM\", mesasgeTag, ['fileUrl','name','size','type']);\n    }\n\n\t//sdk初始化\n\tvar sdkInit = function(params, callbacks){\t\n\t\tif(window.navigator.onLine==false) {　\n\t\t\tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t\treturn;\n\t　　}//如果第一次没有连接网络，直接回调\n\t\tif (sdkConnect == 2) {\n\t\t\tif (!conversation.connect) {\n\t\t\t\tparams.connectingCallback && params.connectingCallback();\n\t\t\t\tcallbacks.getInstance && callbacks.getInstance(RongIMClient.getInstance());\n\t\t\t\tconversation.id = params.customerServiceId;\n\t\t\t}\n\t\t\tcreateButton(params);\n\t\t\treturn;\n\t\t} else if (sdkConnect == 1){\n\t\t\treturn;\n\t\t}\n\n\t\tvar initTimes = 0;\n\t\tsdkConnect = 1;//1为连接中\n\t\tparams.connectingCallback && params.connectingCallback();//连接中回调\n\n\t\tvar appKey = params.appKey;\n\t\tvar token = params.token;\n\t\tvar navi = params.navi || \"\";\n\n\n\t\tif(navi !== \"\"){\n\t\t\t//私有云\n\t\t\tvar config = {\n\t\t\t\tnavi : navi\n\t\t\t};\n\t\t\tconsole.log(\"私有云\");\n\t\t\tconsole.log(params);\n\t\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\t\t}else{\n\t\t\t//公有云\n\t\t\tconsole.log(\"公有云\");\n\t\t\tconsole.log(params);\n\t\t\tRongIMLib.RongIMClient.init(appKey);\n\t\t}\n\t\tif (RCS.config.upload && RCS.config.upload.fileServer) {\n\t\t\tRCS.fileConfig.domain = RCS.config.upload.fileServer;\n\t\t}\n\n\t\tvar instance = RongIMClient.getInstance();\n\n\t\t// 连接状态监听器\n\t\tRongIMClient.setConnectionStatusListener({\n\t\t\tonChanged: function (status) {\n\t\t\t\tconsole.log(status);\n\t\t\t\tvar connectDom = $('.rcs-connect-status')[0];\n\t\t\t\tif (connectDom) {\n\t\t\t\t\tconnectDom.style.display = 'block';\n\t\t\t\t}\n\t\t\t    switch (status) {\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t        \tif (connectDom) {\n\t\t\t\t\t\t\tconnectDom.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsdkConnect = 2;\n\t\t\t\t\t\tinitTimes++;\n\t\t\t            callbacks.getInstance && callbacks.getInstance(instance);\n\t\t\t            break;\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t                console.log('正在链接');\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t                console.log('断开连接');\n\t\t                sdkConnect = 0;\n\t\t                params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t                console.log('其他设备登录');\n\t\t                sdkConnect = 0;\n\t\t                params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t              \tcase RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t                console.log('域名不正确');\n\t\t                sdkConnect = 0;\n\t\t                params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t              \tconsole.log('网络不可用');\n\t\t              \t// sdkConnect = 0;\n\t\t              \t// params.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t                \tconsole.log('断开连接');\n\t                \tsdkConnect = 0;\n\t                \tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t                case 4:\n\t                \tconsole.log('token无效');\n\t                \tsdkConnect = 0;\n\t                \tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t                default:\n\t                \tconsole.log('未知错误');\n\t                \tsdkConnect = 0;\n\t                \tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t                break;\n\t\t\t        }\n\t\t\t}\n\t\t});\n\n\t\tRongIMClient.setOnReceiveMessageListener({\n\t\t\t// 接收到的消息\n\t\t\tonReceived: function (message) {\n\t\t\t    // 判断消息类型\n\t\t\t    console.log(\"新消息: \" + message.targetId);\n\t\t\t    if (message.offLineMessage) {\n\t\t\t    \treturn;\n\t\t\t    }\n\t            console.log(message);\n\t            var systemMsg = null;\n\t            switch(message.messageType){\n\t            \tcase 'HandShakeResponseMessage'://客服握手响应\n\t            \t\tparams.connectedCallback && params.connectedCallback();\n\t            \t\tsetConversition(message);\n\t            \t\topenConversation(conversation.id);\n\t            \t\tif (message.content.data.serviceType == 1 || message.content.data.serviceType == 3) {//仅机器人、机器人优先\n\t            \t\t\tif (message.content.data.robotWelcome) {addCustomServiceInfo(message.content.data);}\n\t            \t\t\tchangeServiceState('robot');\n\t            \t\t} else {\n\t            \t\t\tchangeServiceState('people');\n\t            \t\t}\n\t            \t\tif (message.content.data.isblack == 1) {\n                            //拉进了黑名单，留言页面\n                            console.log(message.content.data.isblack);\n                            leavemessage(true);\n                        }\n\t            \t\tbreak;\n\t            \tcase 'ChangeModeResponseMessage'://转人工\n\t            \t\tsystemMsg = changeModeResponse(message);\n\t            \t\tbreak;\n\t            \tcase 'TerminateMessage'://客服主动结束会话\n\t            \t\tif ($('.imageViewBox')[0]) {\n\t            \t\t\tutils.fadeout($('.imageViewBox')[0]);\n\t            \t\t}\n\t            \t\tif ($('.rongcloud-layermbox')[0]) {\n\t            \t\t\treturn;\n\t            \t\t}\n\t            \t\tif (!conversation.connect) {\n\t            \t\t\treturn;\n\t            \t\t}\n\t            \t\tif (message.content.code == 0 || conversation.evaEntryPoint == 3) {\n\t            \t\t\t//评价\n                            endConversation(true);//关闭，评价\n                        } else {\n                            changeServiceState('robot');\n                        }\n\t            \t\tbreak;\n\t            \tcase 'CustomerStatusUpdateMessage'://状态改变\n\t            \t\tchangeServiceState('people');\n\t            \t\tbreak;\n\t            \tcase 'InformationNotificationMessage'://提示语\n\t            \t\tupdateMessage(message);\n\t            \t\tbreak;\n\t            \tcase 'InfoNtf'://提示语灰条消息\n\t            \t\tupdateMessage(message);\n\t            \t\tbreak;\n\t            \tcase 'SuspendMessage'://用户主动关闭\n\t            \t\tstopCustomerServer();\n    \t\t\t\t\tendComplete();\n\t            \t\tbreak;\n\t            \tcase 'PullEvaMessage':\n                        //客服主动下发评价,只评价不做任何操作\n                        pullEva();\n                        break;\n                    case 'CollectUserInfo':\n                        //客服发起收取用户信息消息\n                        collectUserInfo(message);\n                        break;\n                    case \"HistoryMessage\"://下载历史消息\n                        var url = message.content.fileUrl;\n                        var name = message.content.name;\n                        utils.downloadHistoryMsgFile(url, name);\n                        //下载文件\n                        break;\n                    case \"TextMessage\"://文本消息\n\t\t\t\t\t\tupdateMessage(message);\n                        break;\n                    case \"ImageMessage\"://图片消息\n                        updateMessage(message);\n                        break;\n                    case \"FileMessage\"://文件消息\n                        updateMessage(message);\n                        break;\n                    case \"VoiceMessage\"://声音消息\n                        updateMessage(message);\n                        break;\n                    case \"PullLeaveMessage\"://留言消息\n                        updateMessage(message);\n                        break;\n\t\t            default:\n\t\t                callbacks.receiveNewMessage && callbacks.receiveNewMessage(message);\n\t\t                break;\n\t\t        }\n\t            if (systemMsg) {\n\t            \tconsole.log(systemMsg);\n\t            \taddServiceTip(systemMsg);\n\t            }\n\t\t\t}\n\t\t});\n\n\t\t//开始链接\n\t\tRongIMClient.connect(token, {\n\t\t\tonSuccess: function(userId) {\n\t\t\t\tcallbacks.getCurrentUser && callbacks.getCurrentUser({userId:userId});\n\t\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t\t\tif (initTimes == 1) {\n\t\t\t\t\tcallbacks.enterConversation && callbacks.enterConversation();\n\t\t\t\t}\n\t\t\t\tinitTimes++;\n\t\t\t},\n\t\t\tonTokenIncorrect: function() {\n\t\t\t\tconsole.log('token无效');\n\t\t\t\tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t\t},\n\t\t\tonError:function(errorCode){\n\t\t\t\tconsole.log(\"=============================================\");\n\t\t\t\tconsole.log(errorCode);\n\t\t\t\tparams.disconnectedCallback && params.disconnectedCallback();\n\t\t\t}\n\t\t});\n\t}\n\t//客服会话初始化一些数据\n\tvar setConversition = function(msg){\n\t\tif (msg.content.data.leaveMsgConf && msg.content.data.leaveMsgConf.defaultConf) {\n\t\t\tconversation.formList = msg.content.data.leaveMsgConf.defaultConf;\n\t\t}\n\t\tconversation.announce = {\n\t\t\t\"announceMsgFlag\": msg.content.data.announceMsgFlag,\n\t\t\t\"announceMsg\": msg.content.data.announceMsg,\n\t\t\t\"announceClickFlag\": msg.content.data.announceClickFlag,\n\t\t\t\"announceClickUrl\": msg.content.data.announceClickUrl\n\t\t};\n\t\tconversation.evaluateFormValue.uid = msg.content.data.uid;\n\t\tconversation.evaluateFormValue.pid = msg.content.data.pid;\n\t\tconversation.evaluateFormValue.sid = msg.content.data.sid;\n\t\tif (msg.content.data.needTypSts == 1) {\n\t\t\tconversation.needTypSts = 1;\n\t\t}\n\t\t// if (msg.content.data.leaveMsgConf) {\n\t\t// \tconversation.leaveMsgUrl = msg.content.data.leaveMsgConf.customConf.url;\n\t\t// }\n\t\tif (msg.content.data.evaConf) {\n\t\t\tswitch(msg.content.data.evaConf.evaEntryPoint){\n\t\t\t\tcase 1:\n\t\t\t\t\t//啥都不用干\n\t\t\t\t\tconversation.evaEntryPoint = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t//用户不能主动评价\n\t\t\t\t\tconversation.evaEntryPoint = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t//结束会话弹出评价\n\t\t\t\t\tconversation.evaEntryPoint = 3;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t//创建button\n\tvar createButton = function(config){\n\t\tvar obj = {\n\t\t\t\"showButton\": config.showButton\n\t\t}\n\t\tif (!$('.customer-service')[0]) {\n\t\t\tconfig.target.innerHTML = render(templates.button, obj);\n\t\t}\n\t\tif (conversation.connect) {\n\t\t\tshowCommon();\n\t\t\treturn;\n\t\t}\n\t\tcreateConversation(config);\n\t\taddListener();\n\t\tif (!config.showButton) {\n\t\t\tshowCommon();\n\t\t}\n\t}\n\n\n\t//监听留言提交,页面关闭\n\tvar addListener = function(){\n\t\tvar callback = function(phoneOrPc){\n\t\t\tterminal = phoneOrPc;\n\t\t}\n\t\tutils.browserRedirect(callback);\n\t\t\n\t\tif (terminal == 'pc') {\n\t\t\tdocument.body.onclick = function(){\n\t\t\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\t\t\thideEmoji();\n\t\t\t}\n\t\t\tif (Notification.permission === \"granted\") {\n\t\t\t    supportNot = true;\n\t\t\t}\n\t\t\t// Otherwise, we need to ask the user for permission\n\t\t\telse if (Notification.permission !== \"denied\") {\n\t\t\t    Notification.requestPermission(function (permission) {\n\t\t\t        // If the user accepts, let's create a notification\n\t\t\t        if (permission === \"granted\") {\n\t\t\t            supportNot = true;\n\t\t\t        }\n\t\t\t    });\n\t\t\t}\n\t\t} else {\n\t\t\tdocument.body.ontouchstart = function(event){\n\t\t\t\tif (event.target.className.indexOf('emojiItem') < 0 && event.target.className.indexOf('rong-emoji-content') < 0 && event.target.className.indexOf('rongcloud-expressionContent') < 0 ) {\n\t\t\t\t\thideEmoji();\n\t\t\t\t}\n\t\t\t\tif (event.target.className.indexOf('rongcloud-rong-btn') < 0 && event.target.className.indexOf('rongcloud-text') < 0) {\n\t\t\t\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\t\t\t\tif (inputMsg) {\n\t\t\t\t\t\tinputMsg.blur();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twindow.addEventListener('message',function(e){\n\t\t\tif (e.origin == 'https://web.jiaxincloud.com') {\n\t\t\t\tif (e.data == 'success') {\n\t\t\t\t\tutils.removeNode('.rongcloud-leavemessage');\n\t\t\t\t}\n\t\t\t}\n        },false);\n        window.onbeforeunload = function(event) {\n\t\t    stopCustomerServer();\n\t\t};\n\t}\n\n\tvar hideEmoji = function(){\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tif (emojiContent) {\n\t\t\tutils.hide(emojiContent);\n\t\t}\n\t}\n\n\t//button点击事件\n\tvar showCommon = function(){\n\t\tif (conversation.connect) {\n\t\t\tif ($('.customer-service')[0].style.display != 'none') {\n\t\t\t\tutils.hide($('.customer-service')[0]);\n\t\t\t} else {\n\t\t\t\tutils.show($('.customer-service')[0]);\n\t\t\t\tif (!$('.rcs-chat-wrapper')[0]) {\n\t\t\t\t\tcreateConversation(conversation.id);\n\t\t\t\t\topenConversation(conversation.id);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(conversation.id);\n\t\t\tstartCustomerServer(conversation.id);\n\t\t\tutils.show($('.customer-service')[0]);\n\t\t}\n\t}\n\n\n\t//cs组件初始化\n\tvar init = function(config){\n\t\tRCS.config = config;\n\t\tvar callbacks = {\n\t\t\tgetInstance : function(instance){\n\t\t\t\tvar callback = function(){\n\t\t\t\t\tif (RCS.config.templates) {\n\t\t\t\t\t\tfor (var index in RCS.config.templates) {\n\t\t\t\t\t\t\tif (!RCS.config.showButton && index == 'button') {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemplates[index] = RCS.config.templates[index];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetTemplates(callback);\n\t\t\t\temoji.init();\n\t\t\t\tRongIMLib.RongIMVoice.init();\n\t\t\t\tregisterMessage();\n\t\t\t},\n\t\t\tgetCurrentUser : function(userInfo){\n\t\t\t\tconsole.log(userInfo.userId);\n\t\t\t},\n\t\t\tenterConversation : function(){\n\t\t\t\tconversation.id = config.customerServiceId;\n\t\t\t\tcreateButton(config);\n\t\t\t}\n\t\t};\n\t\tsdkInit(config,callbacks);\n\t};\n\n\tvar openNotice = function(url){\n\t\twindow.open(url);\n\t}\n\n\t//H5唤醒键盘的时候输入框显示在视野内\n\tvar keyboard = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tsetTimeout(function(){\n\t\t\tthisTarget.scrollIntoView(true);\n\t\t},500)\n\t}\n\n\t//对外暴露\n\tRCS.init = init;\n\tRCS.send = send;\n\tRCS.keySend = keySend;\n\tRCS.showemoji = showemoji;\n\tRCS.chooseEmoji = chooseEmoji;\n\tRCS.loadHisMessages = loadHisMessages;\n\tRCS.scrollBottom = scrollBottom;\n\tRCS.imgUpload = imgUpload;\n\tRCS.fileUpload = fileUpload;\n\tRCS.switchPerson = switchPerson;\n\tRCS.endConversation = endConversation;\n\tRCS.play = play;\n\tRCS.playVideo = playVideo;\n\tRCS.minimize = minimize;\n\tRCS.showCommon = showCommon;\n\tRCS.confirm = confirm;\n\tRCS.close = close;\n\tRCS.evaluate = evaluate;\n\tRCS.star = star;\n\tRCS.startEvaluate = startEvaluate;\n\tRCS.leavemessage = leavemessage;\n\tRCS.leaveMessageComfirm = leaveMessageComfirm;\n\tRCS.validateUserInfo = validateUserInfo;\n\tRCS.validateLeaveMessage = validateLeaveMessage;\n\tRCS.viewImage = viewImage;\n\tRCS.escImageView = escImageView;\n\tRCS.userInfoClose = userInfoClose;\n\tRCS.userInfoConfirm = userInfoConfirm;\n\tRCS.getHistoryMsgFile = getHistoryMsgFile;\n\tRCS.keyboard = keyboard;\n\tRCS.chatEnd = chatEnd;\n\tRCS.openNotice = openNotice;\n\tRCS.isresolve = isresolve;\n\tRCS.tagClick = tagClick;\n})(RCS);"
  },
  {
    "path": "cs/sobot/dist/cs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no\">\n<title>CS</title>\n</head>\n<body>\n\n<div id=\"rcs-app\"></div>\n\n<link rel=\"stylesheet\" href=\"cs.min.css\">\n<!-- 可以将 SDK 下载到本地 配置 gruntfile 与 cs.js 合并压缩成一个 js 文件 -->\n<script src=\"../RongIMLib-cs.min.js\"></script>\n<script src=\"//cdn.ronghub.com/RongIMVoice-2.2.4.min.js\"></script>\n<script src=\"cs.min.js\"></script>\n<script>\n    RCS.init({\n        appKey: \"c9kqb3rdkh4jj\",\n        token: \"qjxXwJizd7Y62DTmUEluw5lzpNwuJBCkPrRErVG12EKi1UP6giNGqszv6IQX0IndGKwjoGwevVmUVSN0x458KOqK0LwxTuhy\",\n        target: document.getElementById('rcs-app'),\n        customerServiceId: \"KEFU150535341165880\", // 客服Id\n        userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像，在用户没有头像的时候显示\n        csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像，在客服没有头像的时候显示,建议线上地址\n        showButton: true,\n        //是否需要按钮主动发起，设为false的时候，init()方法直接唤起聊天窗口,需客户自己编写按钮，点击之后调用init(),templates中的button模板不可用;设为true的时候，init()首先唤起客服咨询按钮，点击之后才连接客服，唤起聊天窗口，在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token，在获取到token之后，执行init()即可。\n        connectingCallback: function(){\n            console.log('连接中');\n        },//连接中的执行的方法，例如显示加载页面,可不传\n        connectedCallback: function(){},//连接成功之后的方法，例如关闭加载页面,可不传\n        disconnectedCallback: function(){\n            alert('连接断开');\n        },//断开连接之后的操作,可不传\n        templates: {\n            button: ['<div class=\"rongcloud-consult\">',\n                    '   <button onclick=\"RCS.showCommon()\"><span>客服咨询</span></button>',\n                    '</div>',\n                    '<div class=\"customer-service\" style=\"display: none;\"></div>'].join('')//\"templates/button.html\",\n            // chat: \"templates/chat.html\",\n            // closebefore: 'templates/closebefore.html',\n            // conversation: 'templates/conversation.html',\n            // endconversation: 'templates/endconversation.html',\n            // evaluate: 'templates/evaluate.html',\n            // imageView: 'templates/imageView.html',\n            // leaveword: 'templates/leaveword.html',\n            // main: 'templates/main.html',\n            // message: 'templates/message.html',\n            // messageTemplate: 'templates/messageTemplate.html',\n            // userInfo: 'templates/userInfo.html', \n        }\n    });\n\n</script>\n</body>\n</html>"
  },
  {
    "path": "cs/sobot/emoji.js",
    "content": ";(function(RCS){\n    var emoji = {\n        init : function(){\n            RongIMLib.RongIMEmoji.init();\n        },\n        emojiToHTML : function(emojiContent){\n            return RongIMLib.RongIMEmoji.emojiToHTML(emojiContent,24);\n        },\n        symbolToEmoji : function(sym){\n            return RongIMLib.RongIMEmoji.symbolToEmoji(sym);\n        },\n        getEmoji : function(){\n            return RongIMLib.RongIMEmoji.list.map(function(data) {\n                return data.node;\n            });\n        }\n    }\n    RCS.emoji = emoji;\n})(RCS);"
  },
  {
    "path": "cs/sobot/package.json",
    "content": "{\n  \"name\": \"customer-service\",\n  \"version\": \"1.0.0\",\n  \"description\": \"customerService\",\n  \"scripts\": {\n    \"dist\": \"grunt dist\"\n  },\n  \"devDependencies\": {\n    \"glog\": \"^1.7.0\",\n    \"grunt\": \"^1.0.1\",\n    \"grunt-contrib-clean\": \"^1.1.0\",\n    \"grunt-contrib-concat\": \"^1.0.1\",\n    \"grunt-contrib-cssmin\": \"^2.2.0\",\n    \"grunt-contrib-uglify\": \"^3.0.1\"\n  }\n}\n"
  },
  {
    "path": "cs/sobot/qiniu.js",
    "content": "(function(win) {\n\tfunction forEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction buildUrl(url, items) {\n\t\tvar query = '';\n\t\tforEach(items, function(name, value) {\n\t\t\tif (name != 'token') {\n\t\t\t\tquery += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n\t\t\t}\n\t\t});\n\n\t\tif (query) {\n\t\t\turl += (url.indexOf('?') > 0 ? '&' : '?') + query;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tfunction encode2UTF8(argString) {\n\t\tif (argString === null || typeof argString === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\tvar string = (argString + ''); // .replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t\tvar utftext = '',\n\t\t\tstart, end, stringl = 0;\n\t\tstart = end = 0;\n\t\tstringl = string.length;\n\t\tfor (var n = 0; n < stringl; n++) {\n\t\t\tvar c1 = string.charCodeAt(n);\n\t\t\tvar enc = null;\n\n\t\t\tif (c1 < 128) {\n\t\t\t\tend++;\n\t\t\t} else if (c1 > 127 && c1 < 2048) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 6) | 192, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else if (c1 & 0xF800 ^ 0xD800 > 0) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else { // surrogate pairs\n\t\t\t\tif (c1 & 0xFC00 ^ 0xD800 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched trail surrogate at ' + n);\n\t\t\t\t}\n\t\t\t\tvar c2 = string.charCodeAt(++n);\n\t\t\t\tif (c2 & 0xFC00 ^ 0xDC00 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched lead surrogate at ' + (n - 1));\n\t\t\t\t}\n\t\t\t\tc1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (enc !== null) {\n\t\t\t\tif (end > start) {\n\t\t\t\t\tutftext += string.slice(start, end);\n\t\t\t\t}\n\t\t\t\tutftext += enc;\n\t\t\t\tstart = end = n + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end > start) {\n\t\t\tutftext += string.slice(start, stringl);\n\t\t}\n\n\t\treturn utftext;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction encode2Base64(data) {\n\t\tvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\tvar o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n\t\t\tac = 0,\n\t\t\tenc = '',\n\t\t\ttmp_arr = [];\n\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t}\n\n\t\tdata = encode2UTF8(data + '');\n\n\t\tdo { // pack three octets into four hexets\n\t\t\to1 = data.charCodeAt(i++);\n\t\t\to2 = data.charCodeAt(i++);\n\t\t\to3 = data.charCodeAt(i++);\n\n\t\t\tbits = o1 << 16 | o2 << 8 | o3;\n\n\t\t\th1 = bits >> 18 & 0x3f;\n\t\t\th2 = bits >> 12 & 0x3f;\n\t\t\th3 = bits >> 6 & 0x3f;\n\t\t\th4 = bits & 0x3f;\n\n\t\t\t// use hexets to index into b64, and append result to encoded string\n\t\t\ttmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n\t\t} while (i < data.length);\n\n\t\tenc = tmp_arr.join('');\n\n\t\tswitch (data.length % 3) {\n\t\t\tcase 1:\n\t\t\t\tenc = enc.slice(0, -2) + '==';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tenc = enc.slice(0, -1) + '=';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn enc;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction URLSafeBase64Encode(v) {\n\t\tv = encode2Base64(v);\n\t\treturn v.replace(/\\//g, '_').replace(/\\+/g, '-');\n\t}\n\n\tfunction chunkLastStep(data, opts, callback) {\n\t\t// 七牛 URL 规定\n\t\tvar key = '/key/' + URLSafeBase64Encode(data.filename);\n\t\tvar fname = '/fname/' + URLSafeBase64Encode(data.filename);\n\t\tvar url = opts.domain + '/mkfile/' + data.size + key + fname;\n\t\tvar options = {\n\t\t\tdomain: url,\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/octet-stream'\n\t\t\t},\n\t\t\tmulti_parmas: opts.multi_parmas,\n\t\t\tsupport_options: true,\n\t\t\tstream: true\n\t\t};\n\t\tuploadData(data.ctx, options, {\n\t\t\tonCompleted: function(res) {\n\t\t\t\tres.filename = data.filename;\n\t\t\t\tres.name = data.name;\n\t\t\t\tcallback.onCompleted(res);\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tvar offset = 0,\n\t\tctxStore = {};\n\n\tfunction uploadNextChunk(blob, opts, callback) {\n\t\tvar chunk = Math.ceil(offset / opts.chunk_size),\n\t\t\tchunks = Math.ceil(blob.size / opts.chunk_size),\n\t\t\tcurChunkSize = Math.min(opts.chunk_size, blob.size - offset),\n\t\t\tchunkBlob = blob.slice(offset, offset + curChunkSize),\n\t\t\tchunkInfo = {\n\t\t\t\tchunk: chunk,\n\t\t\t\tchunks: chunks,\n\t\t\t\tname: blob.uniqueName\n\t\t\t};\n\t\tforEach(chunkInfo, function(key, value) {\n\t\t\topts.multi_parmas[key] = value;\n\t\t});\n\t\topts.filesize = blob.size;\n\t\topts.headers = {\n\t\t\t'Content-Type': 'application/octet-stream'\n\t\t};\n\t\topts.isChunk = true;\n\t\tuploadData(chunkBlob, opts, {\n\t\t\tonCompleted: function(chunkRes) {\n\t\t\t\toffset += curChunkSize;\n\t\t\t\t// callback.onProgress(Math.floor((chunk + 1) / chunks * blob.size), blob.size);\n\t\t\t\tctxStore[blob.uniqueName] = ctxStore[blob.uniqueName] || [];\n\t\t\t\tctxStore[blob.uniqueName].push(chunkRes.ctx);\n\t\t\t\tif (offset < blob.size) {\n\t\t\t\t\tif (chunkRes.ctx) {\n\t\t\t\t\t\tuploadNextChunk(blob, opts, callback);\n\t\t\t\t\t}else{\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tdelete ctxStore[blob.uniqueName]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toffset = 0;\n\t\t\t\t\tdelete opts.isChunk;\n\t\t\t\t\tdelete opts.headers['Content-Type'];\n\t\t\t\t\tforEach(chunkInfo, function(key, value) {\n\t\t\t\t\t\tdelete opts.multi_parmas[key];\n\t\t\t\t\t});\n\t\t\t\t\tvar ctx = ctxStore[blob.uniqueName].join(',');\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\tctx: ctx,\n\t\t\t\t\t\tname: blob.name,\n\t\t\t\t\t\tsize: blob.size,\n\t\t\t\t\t\tfilename: blob.uniqueName\n\t\t\t\t\t};\n\t\t\t\t\tchunkLastStep(data, opts, callback);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {\n\t\t\t\tvar loaded = chunkLoaded + offset;\n\t\t\t\tcallback.onProgress(loaded, opts.filesize);\n\t\t\t},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction uploadData(data, options, callback) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\tif (xhr.upload && options.support_options) {\n\t\t\txhr.upload.onprogress = function(event) {\n\t\t\t\tcallback.onProgress(event.loaded, event.total);\n\t\t\t};\n\t\t}\n\n\t\txhr.onreadystatechange = function() {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tvar result = xhr.responseText || \"{}\";\n\t\t\t\tresult = JSON.parse(result);\n\t\t\t\tresult.filename = options.unique_value;\n\t\t\t\tcallback.onCompleted(result);\n\t\t\t}\n\t\t};\n\n\t\tvar url = options.domain;\n\t\tif (options.isChunk) {\n\t\t\turl += '/mkblk/' + data.size;\n\t\t\turl = buildUrl(url, options.multi_parmas);\n\t\t}\n\t\txhr.open(options.method, url, true);\n\n\t\tcallback.onOpen(xhr);\n\n\t\tif (options.stream) {\n\t\t\txhr.setRequestHeader('authorization', 'UpToken ' + options.multi_parmas.token);\n\t\t}\n\n\t\tforEach(options.headers, function(key, value) {\n\t\t\txhr.setRequestHeader(key, value);\n\t\t});\n\t\txhr.send(data);\n\t}\n\n\tfunction uploadQiniu(file, opts, callback) {\n\t\tif (file.size && opts.chunk_size < file.size) {\n\t\t\tvar uniqueName = opts['genUId'](file);\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tuniqueName = uniqueName + suffix;\n\t\t\tfile.uniqueName = uniqueName;\n\t\t\topts.stream = true;\n\t\t\tuploadNextChunk(file, opts, callback);\n\t\t} else {\n\t\t\tvar data = opts['data'](file, opts);\n\t\t\tuploadData(data, opts, callback);\n\t\t}\n\t}\n\twin.uploadProcess = uploadQiniu;\n})(window);"
  },
  {
    "path": "cs/sobot/template.js",
    "content": ";(function(RCS){\n\tvar getTemplates = function(callback){\n\t\tvar list = {\n\t        button: 'templates/button.html',\n\t        chat: 'templates/chat.html',\n\t        closebefore: 'templates/closebefore.html',\n\t        conversation: 'templates/conversation.html',\n\t        endconversation: 'templates/endconversation.html',\n\t        evaluate: 'templates/evaluate.html',\n\t        imageView: 'templates/imageView.html',\n\t        leaveword: 'templates/leaveword.html',\n\t        main: 'templates/main.html',\n\t        message: 'templates/message.html',\n\t        messageTemplate: 'templates/messageTemplate.html',\n\t        userInfo: 'templates/userInfo.html',\n\t        evaluateItem: 'templates/evaluateItem.html',\n\t    };\n\t    var templates = {};\n\t    for (var key in list) {\n\t    \tvar url = list[key];\n\t    \tvar html = RCS.templateCache[url];\n\t    \tif (html) {\n\t    \t\ttemplates[key] = html;\n\t    \t} else {\n\t\t    \tvar xhr = new XMLHttpRequest();\n\t\t    \txhr.open('get', url, false);\n\t\t    \txhr.onreadystatechange = function(){\n\t\t    \t\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\t    \t\t\ttemplates[key] = xhr.responseText;\n\t\t    \t\t}\n\t\t    \t}\n\t\t    \txhr.send(null);\n\t    \t}\n\n\t    }\n\t    return templates;\n\t}\n\tRCS.getTemplates = getTemplates;\n})(RCS);"
  },
  {
    "path": "cs/sobot/templates/button.html",
    "content": "<!-- class=\"customer-service\"主页面容器，类名不能修改 -->\n<div class=\"rongcloud-consult\">\n    <button onclick=\"RCS.showCommon()\"><span>咨询客服</span></button>\n</div>\n<div class=\"customer-service\" style=\"display: none;\"></div>"
  },
  {
    "path": "cs/sobot/templates/chat.html",
    "content": "<!-- \nclass=\"rongcloud-text\"消息输入框; \nclass=\"rongcloud-expressionContent\"表情容器;\nclass=\"rcs-message-box\"消息列表容器;\nclass=\"rongcloud-Messages-history\"查看更多消息按钮;\nclass=\"rongcloud-mode1\"、class=\"rongcloud-mode2\"人工、机器人转换按钮的容器(机器人状态时，rongcloud-mode1隐藏，rongcloud-mode1显示);\nclass=\"rcs-connect-status\"connect断开时，状态显示的容器\nclass=\"imageViewBox\"图片预览容器\n以上类名不能被修改\n -->\n<div class=\"rongcloud-kefuChat\">\n    <div id=\"header\" class=\"rongcloud-rong-header rongcloud-blueBg rongcloud-online\">\n        {%if(this.terminal == 'phone'){%}\n        <span class=\"rongcloud-phone-exit\" onclick=\"RCS.endConversation()\"></span>\n        <div class=\"rongcloud-phone-infoBar\">\n            <span class=\"rongcloud-phone-kefuName\">客服</span>\n        </div>\n        {%}else{%}<div class=\"rongcloud-infoBar rongcloud-pull-left\">\n            <div class=\"rongcloud-infoBarTit\">\n                <span class=\"rongcloud-kefuName\">客服</span>\n            </div>\n        </div>\n        <div class=\"rongcloud-toolBar rongcloud-headBtn rongcloud-pull-right\">\n            <div class=\"rongcloud-voice\"></div>\n            <a onclick=\"RCS.minimize()\" class=\"rongcloud-kefuChatBoxHide rongcloud-sprite\" title=\"隐藏\"></a>\n            <a onclick=\"RCS.endConversation()\" class=\"rongcloud-kefuChatBoxClose rongcloud-sprite\" title=\"结束对话\"></a>\n        </div>{%}%}\n    </div>\n    <div class=\"rongcloud-box\">\n        <div class=\"rongcloud-outlineBox rcs-connect-status\" style=\"display:none;\">\n            <div class=\"rongcloud-sprite\"></div>\n            <span>连接断开,请刷新重连</span>\n        </div>\n        {%if(this.announce.announceMsgFlag == 1){%}\n        <div class=\"rongcloud-noticeBox {%if(this.announce.announceClickFlag == 1){%} rongcloud-link {%}%}\" {%if(this.announce.announceClickFlag == 1){%} onclick='RCS.openNotice({%JSON.stringify(this.announce.announceClickUrl)%})' {%}%}>\n            <div class=\"rongcloud-notice-horn\"></div>\n            <span class=\"rongcloud-noticeBox-content\">{%this.announce.announceMsg%}</span>\n            {%if(this.announce.announceClickFlag == 1){%}<div class=\"rongcloud-notice-link\"></div>{%}%}\n        </div>\n        {%}%}\n    </div>\n    \n    <div id=\"rcs-message-list\" class=\"rcs-message-box {%if(this.announce.announceMsgFlag == 1){%} rongcloud-hasNotice {%}%}\">\n        {%this.messageList%}\n    </div>\n\n    <div id=\"rcs-chat-box\" class=\"rongcloud-rong-footer\">\n        <div class=\"rongcloud-footer-con\">\n            <div class=\"rongcloud-text-layout\">\n                <div id=\"funcPanel\" class=\"rongcloud-funcPanel rongcloud-robotMode\">\n                    <div class=\"rongcloud-MessageForm-tool\" id=\"expressionWrap\" style=\"overflow: visible;\">\n                        <i class=\"rongcloud-sprite rongcloud-iconfont-smile\" onclick=\"RCS.showemoji(event)\"></i>\n                        <div class=\"rongcloud-expressionWrap\" onclick=\"RCS.chooseEmoji(event)\" style=\"display: none;\">\n                            <div class=\"rongcloud-expressionContent\"></div>\n                        </div>\n                    </div>\n                    <div class=\"rongcloud-mode1\" style=\"display: none;\">\n                        <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-upload\" id=\"upload-image\">\n                            <input type=\"file\" multiple=\"multiple\" accept=\"image/png,image/gif,image/jpeg\" onchange=\"RCS.imgUpload(event)\"></input>\n                          </i>\n                        </div>\n                        <!-- <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-file\" id=\"upload-file\">\n                            <input type=\"file\" multiple=\"multiple\" onchange=\"RCS.fileUpload(event)\"></input>\n                          </i>\n                        </div> -->\n                        <!-- <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-download\" id=\"download-his\" onclick=\"RCS.getHistoryMsgFile()\">\n                          </i>\n                        </div> -->\n                        {%if(this.evaEntryPoint == 1){%}\n                        <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-evaluate\" onclick=\"RCS.startEvaluate(event)\">\n                          </i>\n                        </div>{%}%}\n                    </div>\n                    <div class=\"rongcloud-mode2\"><a onclick=\"RCS.switchPerson()\" id=\"chatSwitch\" class=\"rongcloud-chatSwitch\">转人工服务</a></div>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-footer-input\">\n            <div class=\"rongcloud-footer-textarea\"\">\n                <textarea class=\"rongcloud-text rongcloud-grey\" placeholder=\"请输入文字...\" onfocus=\"RCS.keyboard(event)\" onkeydown=\"RCS.keySend(event)\"></textarea>\n            </div>\n            <button type=\"button\" style=\"background-color: #0099ff;\" class=\"rongcloud-rong-btn rongcloud-rong-send-btn\" id=\"rong-sendBtn\" onclick=\"RCS.send(event)\">发送</button>\n        </div>\n    </div>\n</div>\n<div class=\"rebox imageViewBox\" onclick=\"RCS.escImageView()\" style=\"display: none;\">\n    \n</div>"
  },
  {
    "path": "cs/sobot/templates/closebefore.html",
    "content": "<!-- 客服主动关闭弹出的页面 -->\n<div class=\"rongcloud-layermbox\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">客服会话已结束</p>\n                <div class=\"rongcloud-buttons\" onclick=\"RCS.chatEnd()\"><button class=\"rongcloud-button\">确定</button></div>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "cs/sobot/templates/conversation.html",
    "content": "<!-- 会话列表每一个会话\nclass=\"rong-conversation\"会话列表中的每一个会话\n此类名不能被修改\n-->\n<div class=\"rong-conversation\" _cid=\"{%this.cid%}\" _name=\"{%this.name%}\">\n    <img src=\"https://bsetting60.ntalker.com/application/static/setting/images/head.jpg\" alt=\"\">\n    <span class=\"rong-conversation-name\">客服{%this.cid%} - {%this.name%}</span>\n    <div class=\"rong-conversation-message\">...</div>\n</div>"
  },
  {
    "path": "cs/sobot/templates/endconversation.html",
    "content": "<!-- endconversation: 用户主动关闭弹出的页面  \nclass=\"rongcloud-layermbox\"弹出层容器\n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">是否要结束当前会话?</p>\n                <div class=\"rongcloud-buttons\"><button class=\"rongcloud-button\" onclick=\"RCS.confirm()\">是</button><button class=\"rongcloud-button\" onclick=\"RCS.close()\">否</button></div>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "cs/sobot/templates/evaluate.html",
    "content": "<!-- evaluate: 评价页面  \nclass=\"rongcloud-evaluate\"评价弹出层容器;\nclass=\"rongcloud-evaluate-tag\"评价tag容器;\n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox rongcloud-evaluate\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-evaluate\">\n                <div class=\"rongcloud-layer-title\">评价客服</div>\n                <div class=\"rongcloud-layer-body\">\n                    {%if(this.isQuestionFlag == 1){%}\n                    <div class=\"rongcloud-group-row\">\n                        <div class=\"rongcloud-group-title\">请问客服是否解决了您的问题</div>\n                        <div class=\"rongcloud-group-tag-list\">\n                            <div class=\"rongcloud-group-tag rongcloud-solve-tag rongcloud-solve-active\" onclick=\"RCS.isresolve(event,1)\">已解决</div>\n                            <div class=\"rongcloud-group-tag rongcloud-solve-tag\" onclick=\"RCS.isresolve(event,0)\">未解决</div>\n                        </div>\n                    </div>{%}%}\n                    <div class=\"rongcloud-group-row\">\n                        <div class=\"rongcloud-group-title\">请您对客服进行评价</div>\n                        <span class=\"satisfaction-star satisfaction-star-selected\" onclick=\"RCS.star(1)\"></span>\n                        <span class=\"satisfaction-star satisfaction-star-selected\" onclick=\"RCS.star(2)\"></span>\n                        <span class=\"satisfaction-star satisfaction-star-selected\" onclick=\"RCS.star(3)\"></span>\n                        <span class=\"satisfaction-star satisfaction-star-selected\" onclick=\"RCS.star(4)\"></span>\n                        <span class=\"satisfaction-star satisfaction-star-selected\" onclick=\"RCS.star(5)\"></span>\n                    </div>\n                    <div class=\"rongcloud-evaluate-tag\">\n                        \n                    </div>\n                </div>\n                <div class=\"rongcloud-foot\">\n                    <button class=\"rongcloud-evaluate-btn\" onclick=\"RCS.evaluate(true)\">提交</button><button class=\"rongcloud-evaluate-btn\" onclick=\"RCS.evaluate(false)\">取消</button>\n                </div>\n            </div>\n            <!--反馈提示-->\n            <!-- <div class=\"rongcloud-layermchild rongcloud-feedback\" ng-show=\"end\">\n                <div class=\"rongcloud-layermcont\">\n                    感谢您的反馈 ^ - ^ ！\n                </div>\n            </div> -->\n        </div>\n    </div>\n</div>\n"
  },
  {
    "path": "cs/sobot/templates/evaluateItem.html",
    "content": "{%if(this.labelNameArray.length != 0){%}\n<div class=\"rongcloud-group-row\">\n    <div class=\"rongcloud-group-title\">存在哪些问题{%if(this.isTagMust == 1){%}(必填){%}%}</div>\n    <div class=\"rongcloud-group-tag-list\">\n    \t{%for(var index in this.labelNameArray){%}\n        <div class=\"rongcloud-group-tag rongcloud-tag-item\" onclick=\"RCS.tagClick(event)\">{%this.labelNameArray[index]%}</div>\n        {%}%}\n    </div>\n</div>\n<div class=\"rongcloud-group-row\">\n    <textarea class=\"rongcloud-evaluate-suggest rongcloud-suggest\" placeholder=\"其他想说的\"></textarea>\n</div>\n{%}%}"
  },
  {
    "path": "cs/sobot/templates/imageView.html",
    "content": "<!-- imageView: 图片预览页面   -->\n<a href=\"#\" class=\"rebox-close rebox-button\">×</a>\n<div class=\"rebox-contents\">\n\t<img src=\"{%this.imageUrl%}\" class=\"rebox-content\">\n</div>\n"
  },
  {
    "path": "cs/sobot/templates/import.html",
    "content": "<script id=\"rcs-templte-button\" type=\"rcs/templte\">\n\t<!--#include file=\"button.html\"-->\n</script>\n\n<script id=\"rcs-templte-main\" type=\"rcs/templte\">\n\t<!--#include file=\"main.html\"-->\n</script>\n\n<script id=\"rcs-templte-conversation\" type=\"rcs/templte\">\n\t<!--#include file=\"conversation.html\"-->\n</script>\n\n<script id=\"rcs-templte-chat\" type=\"rcs/templte\">\n\t<!--#include file=\"chat.html\"-->\n</script>\n\n<script id=\"rcs-templte-message\" type=\"rcs/templte\">\n\t<!--#include file=\"message.html\"-->\n</script>\n\n<script id=\"rcs-templte-message-template\" type=\"rcs/templte\">\n\t<!--#include file=\"messageTemplate.html\"-->\n</script>\n\n\n<script id=\"rcs-templte-closebefore\" type=\"rcs/templte\">\n\t<!--#include file=\"closebefore.html\"-->\n</script>\n\n<script id=\"rcs-templte-endconversation\" type=\"rcs/templte\">\n\t<!--#include file=\"endconversation.html\"-->\n</script>\n\n<script id=\"rcs-templte-evaluate\" type=\"rcs/templte\">\n\t<!--#include file=\"evaluate.html\"-->\n</script>\n\n<script id=\"rcs-templte-leaveword\" type=\"rcs/templte\">\n\t<!--#include file=\"leaveword.html\"-->\n</script>\n\n<script id=\"rcs-templte-imageView\" type=\"rcs/templte\">\n\t<!--#include file=\"imageView.html\"-->\n</script>\n\n<script id=\"rcs-templte-userInfo\" type=\"rcs/templte\">\n\t<!--#include file=\"userInfo.html\"-->\n</script>"
  },
  {
    "path": "cs/sobot/templates/leaveword.html",
    "content": "<!-- leaveword: 留言页面  \nclass=\"rongcloud-leavemessage\"留言弹出层容器\n此类名不能被修改-->\n<div class=\"rongcloud-leavemessage\">\n    {%if(this.url){%}\n    <iframe id=\"leavewordIframe\" src=\"{%this.url%}\" frameborder=\"0\" width=\"100%;\" height=\"100%;\"></iframe>\n    {%}else{%}\n    <div class=\"rongcloud-leavemessage-title\">您好，请留言~</div>\n    <form>\n        {%for(var index in this.list){%}\n        <div class=\"rongcloud-form-item\">\n            <label class=\"{%if(this.list[index].required){%}{%'rongcloud-require'%}{%}%}\">{%this.list[index].title%}：</label>\n            {%if(this.list[index].type == 'text'){%}<input class=\"rongcloud-inputtext\" name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" type=\"text\" onblur=\"RCS.validateLeaveMessage({%index%}, event)\"></input>{%}else{%}\n            <textarea name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" onblur=\"RCS.validateLeaveMessage({%index%}, event)\"></textarea>{%}%}\n            <div class=\"rongcloud-form-error\" style=\"display: none;\"></div>\n        </div>{%}%}\n        <div class=\"rongcloud-leavemessage-form-btns\">\n            <button class=\"rongcloud-btn\" onclick=\"RCS.leaveMessageComfirm(event)\">提交</button>\n        </div>\n    </form>{%}%}\n</div>"
  },
  {
    "path": "cs/sobot/templates/main.html",
    "content": "<!-- main: 包括客服列表和聊天窗口的主页面  \nclass=\"rcs-chat-wrapper\"聊天窗口的容器 \n此类名不能被修改\n-->\n<div id=\"rcs-main\" class=\"rongcloud-kefuListBox rongcloud-container\">\n    {%if(this.showConversitionList){%}<div class=\"rongcloud-kefuList\">\n        <div class=\"rongcloud-rong-header rongcloud-blueBg\">\n            <div class=\"rongcloud-toolBar rongcloud-headBtn\">\n                <div class=\"rongcloud-voice\"></div>\n                <div class=\"rongcloud-sprite rongcloud-people\"></div>\n                <span class=\"rongcloud-recent\">客服列表</span>\n                <div class=\"rongcloud-sprite rongcloud-arrow-down cursor-pointer\" onclick=\"RCS.minimize()\"></div>\n            </div>\n        </div>\n        <div class=\"rongcloud-content\">\n            <div class=\"rongcloud-netStatus\" style=\"display:none\">\n                <div class=\"rongcloud-sprite\"></div>\n                <span>连接断开,请刷新重连</span>\n            </div>\n            <div class=\"rcs-conversation-list\">\n                {%this.conversationList%}\n                <!-- <div class=\"rcs-conversation-item\"></div> -->\n            </div>\n        </div>\n    </div>{%}%}\n    <div class=\"rcs-chat-wrapper\"></div>\n</div>"
  },
  {
    "path": "cs/sobot/templates/message.html",
    "content": "<!-- message: 消息list的页面 -->\n<div class=\"rong-message-list\">\n    {%if(this.firstEnter){%}<div class=\"rongcloud-Messages-history\" style=\"display: none;\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}else if(this.hasMore){%}<div class=\"rongcloud-Messages-history\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}%}{%else{%}<div class=\"rongcloud-Messages-history\"><b>没有更多消息</b></div>{%}%}\n    {%for(var index in this.list){%}{%switch(this.list[index].messageType){%}{%case 'TextMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">{%this.list[index].content.content%}</pre>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'ImageMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-img\">\n                <span class=\"rongcloud-Message-entry\">\n                    <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.list[index].content.imageUri%}\">\n                        <img src=\"{%this.list[index].content.imageUri%}\" data-img=\"{%this.list[index].content.imageUri%}\">\n                    </a>\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'FileMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user){%}{%this.list[index].content.user.name%}{%}else{%} {%'客服'%} {%}%}  {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-file\">\n                <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n                <div class=\"rongcloud-file-name\">{%this.list[index].content.name%}</div>\n                <div class=\"rongcloud-file-size\">{%this.list[index].content.size%}</div>\n                <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.list[index].content.fileUrl%}\" download=\"{%this.list[index].content.name%}\"></a>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'VoiceMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-audio\">\n                <span class=\"rongcloud-Message-entry\">\n                    {%if(this.messageDirection == 1){%}\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                        <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                    {%}else{%}\n                        <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                    {%}%}\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'TimeMessage':%}\n    <div class=\"rongcloud-Messages-date\">\n        <b>{%this.list[index].sentTime%}</b>\n    </div>{%break;%}\n    {%case 'InformationNotificationMessage':%}\n    <div class=\"rongcloud-sys-tips\">\n        <span>{%this.list[index].content.message%}</span>\n    </div>{%break;%}\n    {%case 'AlertMessage':%}\n    <div class=\"rongcloud-sys-tips\">\n        <span>{%this.list[index].content.content%}</span>\n    </div>{%break;%}\n    {%case 'SightMessage': %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n                <video poster=\"{% 'data:image/jpg;base64,' + this.list[index].content.content %}\" src=\"{% this.list[index].content.sightUrl %}\"></video>\n                <div class=\"play-btn\"></div>\n            </div>\n        </div>\n    </div>\n    {%break;%}\n    {%default: %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n            </div>\n        </div>\n    </div>{%}%}{%}%}\n</div>\n\n<!-- <div class=\"rongcloud-emptyBox\">暂时没有新消息</div> -->"
  },
  {
    "path": "cs/sobot/templates/messageTemplate.html",
    "content": "<!-- messageTemplate: 一个消息的页面 -->\n<!-- class=\"rongcloud-audioState\"声音消息播放状态\nclass=\"rongcloud-audioBox\" 声音消息容器\n此类名不能被修改 -->\n{%switch(this.messageType){%}{%case 'TextMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">{%this.content.content%}</pre>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'ImageMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-img\">\n            <span class=\"rongcloud-Message-entry\">\n                <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.content.imageUri%}\">\n                    <img src=\"{%this.content.imageUri%}\" onload=\"RCS.scrollBottom()\" data-img=\"{%this.content.imageUri%}\">\n                </a>\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'FileMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-file\">\n            <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n            <div class=\"rongcloud-file-name\">{%this.content.name%}</div>\n            <div class=\"rongcloud-file-size\">{%this.content.size%}</div>\n            <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.content.fileUrl%}\" download=\"{%this.content.name%}\"></a>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'VoiceMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-audio\">\n            <span class=\"rongcloud-Message-entry\">\n                {%if(this.messageDirection == 1){%}\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                    </div>\n                    <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                {%}else{%}\n                    <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                        <span class=\"rongcloud-audioState\"></span>\n                    </div>\n                {%}%}\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'TimeMessage':%}\n<div class=\"rongcloud-Messages-date\">\n    <b>{%this.sentTime%}</b>\n</div>{%break;%}\n{%case 'InformationNotificationMessage':%}\n<div class=\"rongcloud-sys-tips\">\n    <span>{%this.content.message%}</span>\n</div>{%break;%}\n{%case 'AlertMessage':%}\n<div class=\"rongcloud-sys-tips\">\n    <span>{%this.content.content%}</span>\n</div>{%break;%}\n{%case 'SightMessage': %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n            <video poster=\"{% 'data:image/jpg;base64,' + this.content.content %}\" src=\"{% this.content.sightUrl %}\"></video>\n            <div class=\"play-btn\"></div>\n        </div>\n    </div>\n</div>\n{%break;%}\n{%default: %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n        </div>\n    </div>\n</div>{%}%}\n"
  },
  {
    "path": "cs/sobot/templates/userInfo.html",
    "content": "<!-- userInfo: 收集用户信息的页面  \nclass=\"userInfoModel\"收集用户信息页面容器 \n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox userInfoModel\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-collectuserinfo\">\n                <form name='userinfo' novalidate=\"true\">\n                    <div class=\"rongcloud-layer-body\">\n                        <div class=\"rongcloud-collectuserinfo-title\">你好，客服邀请您填写如下内容</div>\n                        <a class=\"rongcloud-layer-close\" onclick=\"RCS.userInfoClose()\">×</a>\n                        {%for(var index in this.list){%}\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-form-label {%if(this.list[index].required == 1){%}{%'rongcloud-require'%}{%}%}\">{%this.list[index].label%}：</label>\n                            {%switch(this.list[index].type){%}{%case 'input':%}\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"{%this.list[index].name%}\" data-label=\"{%this.list[index].label%}\" data-pattern=\"{%this.list[index].rule%}\" placeholder=\"{%this.list[index].defaultText%}\" onblur=\"RCS.validateUserInfo(event)\" {%if(this.list[index].required == 1){%}{%'data-required = required'%}{%}%}></input>{%break;%}{%case 'textarea':%}\n                            <textarea name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" data-label=\"{%this.list[index].label%}\" data-pattern=\"{%this.list[index].rule%}\" onblur=\"RCS.validateUserInfo(event)\"></textarea>{%break;%}{%}%}\n                            <div class=\"rongcloud-form-error\" style=\"display: none;\"></div>\n                        </div>{%}%}\n                    </div>\n                    <div class=\"rongcloud-foot\">\n                        <button class=\"rongcloud-btn\" onclick=\"RCS.userInfoConfirm(event)\">提交</button>\n                    </div>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "cs/sobot/test.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no\">\n<title>CS</title>\n<style>\n\t.main button{\n\t\tmargin: 100px;\n\t}\n</style>\n</head>\n<body>\n\n<div id=\"main\">\n\t<button onclick=\"send()\">发送</button>\n</div>\n\n<script src=\"./RongIMLib-cs.js\"></script>\n\n<!-- 实例化 -->\n<script>\n\tvar appKey = 'c9kqb3rdkbb8j';\n\tvar token = 'TD9of5Xke0UXQsGOJKN093YNDAey+CFwhZPcG3x/Kb6PKb2ZF1eknWi8hdy8lshmsamlcoe2LxwJ+j6RAml8iw==';\n\tvar navi = 'navqa.cn.ronghub.com';\n\tvar targetId = 'xgs';\n\nvar sdkInit = function(params, callbacks){\n\tif(navi !== \"\"){\n\t\t//私有云\n\t\tvar config = {\n\t\t\tnavi : navi\n\t\t};\n\t\tconsole.log(\"私有云\");\n\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\t}else{\n\t\t//公有云\n\t\tconsole.log(\"公有云\");\n\t\tRongIMLib.RongIMClient.init(appKey);\n\t}\n\n\tvar instance = RongIMClient.getInstance();\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\tconsole.log(status);\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t            registerMessage();\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n                \tconsole.log('断开连接');\n                default:\n                \tbreak;\n\t\t        }\n\t\t}\n\t});\n\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    console.log(\"新消息: \" + message.targetId);\n\t\t    if (message.offLineMessage) {\n\t\t    \treturn;\n\t\t    }\n            console.log(message);\n\t\t}\n\t});\n\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t\tRongIMLib.RongIMClient.getInstance().startCustomService(targetId, {\n\t            onSuccess: function() {\n\t                console.log('客服初始化成功');\n\t                document.getElementById('main').innerHtml = '<button onclick=\"send()\">发送商品消息</button>';\n\t            },\n\t            onError: function() {\n\t                \n\t            }\n\t        });\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\tconsole.log('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  console.log(\"=============================================\");\n\t\t  console.log(errorCode);\n\t\t}\n\t});\n}\n\nvar registerMessage = function() {\n    var messageName = \"ProductMessage\"; // 消息名称。\n    var objectName = \"cs:product\"; // 消息内置名称，请按照此格式命名。\n    var mesasgeTag = new RongIMLib.MessageTag(true, true);// 消息是否保存是否计数，true true 保存且计数，false false 不保存不计数。\n    var propertys = [\"title\", \"url\", \"content\", \"imageUrl\", \"extra\"]; // 消息类中的属性名。\n    // RongIMLib.RongIMClient.registerMessageType(messageName, objectName, mesasgeTag, propertys);\n\n    RongIMLib.RongIMClient.registerMessageType(\"ProductInfoMessage\", \"JX:ProductInfo\", mesasgeTag, ['title','content','url','remoteurl']);\n}\n\nfunction send(){\n\tvar msg = new RongIMClient.RegisterMessage.ProductInfoMessage({\n\t\ttitle: '红米Note2 移动4G手机 双卡双待',\n\t\tcontent: '￥799 16G',\n\t\turl: 'http://www.jiaxincloud.com',\n\t\tremoteurl: 'http://f2e.cn.ronghub.com/desktop-client-qa/css/images/logo.png'\n\t});\n\tvar targetType = RongIMLib.ConversationType.CUSTOMER_SERVICE;\n\tRongIMClient.getInstance().sendMessage(targetType, targetId, msg, {\n        // 发送消息成功\n        onSuccess: function (message) {\n        \tconsole.log(message);\n            console.log(\"Send successfully\");\n        },\n        onError: function (errorCode,message) {\n            var info = '';\n            switch (errorCode) {\n                case RongIMLib.ErrorCode.TIMEOUT:\n                    info = '超时';\n                    break;\n                case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n                    info = '未知错误';\n                    break;\n                case RongIMLib.ErrorCode.REJECTED_BY_BLACKLIST:\n                    info = '在黑名单中，无法向对方发送消息';\n                    break;\n                case RongIMLib.ErrorCode.NOT_IN_DISCUSSION:\n                    info = '不在讨论组中';\n                    break;\n                case RongIMLib.ErrorCode.NOT_IN_GROUP:\n                    info = '不在群组中';\n                    break;\n                case RongIMLib.ErrorCode.NOT_IN_CHATROOM:\n                    info = '不在聊天室中';\n                    break;\n                default :\n                    info = x;\n                    break;\n            }\n            console.log('发送失败:' + info);\n        }\n   \t});\n}\n\nsdkInit();\n\n</script>\n\n\n</body>\n</html>"
  },
  {
    "path": "cs/sobot/ui.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>ui</title>\n</head>\n<body>\n<link rel=\"stylesheet\" href=\"cs.css\">\n\n\n<!-- conversationlist.tpl.html -->\n<!--#include file=\"templates/userInfo.html\"-->\n\n<div class=\"rongcloud-Message-body\">\n    <div class=\"rongcloud-Message-audio\">\n        <span class=\"rongcloud-Message-entry\">\n            <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick=\"RCS.play()\">\n                <i></i><i></i><i></i>\n            </span>\n            <div style=\"display:inline-block;\">\n                <span class=\"rongcloud-audioTimer\">{%this.list[index].content.duration%}</span>\n                <span class=\"rongcloud-audioState\"></span>\n            </div>\n        </span>\n    </div>\n</div>\n\n\n\n<!-- main.tpl.html -->\n<div id=\"rong-widget-box\" class=\"rongcloud-container\" style=\"display:none;\">\n    <div class=\"rong-conversation-list\">\n    </div>\n    <div id=\"rong-widget-minbtn\" class=\"rongcloud-kefuBtnBox rongcloud-blueBg\">\n      <a class=\"rongcloud-kefuBtn\" href=\"###\">\n          <div class=\"rongcloud-sprite rongcloud-people\"></div>\n          <span class=\"rongcloud-recent\">联系客服</span>\n          <span class=\"rongcloud-recent\"><span ng-show=\"twinkle\" >(有未读消息)</span></span>\n      </a>\n    </div>\n    <div id=\"rong-widget-minbtn-kefu\" class=\"rongcloud-kefuBtnBox rongcloud-blueBg\">\n      <a class=\"rongcloud-kefuBtn\" href=\"###\">\n          <div class=\"rongcloud-sprite rongcloud-people rongcloud-sprite-kefu\"></div>\n          <span class=\"rongcloud-recent\" >联系客服</span>\n      </a>\n    </div>\n</div>\n\n\n\n\n\n\n\n<!-- expand colsebefore.tpl.html -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">客服会话已结束</p>\n                <div class=\"rongcloud-buttons\" ng-click=\"confirm()\"><button class=\"rongcloud-button\">确定</button></div>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n<!-- expand customerinfo.tpl.html -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-collectuserinfo\">\n                <form name='userinfo' novalidate=\"true\">\n                    <div class=\"rongcloud-layer-body\">\n                        <div class=\"rongcloud-collectuserinfo-title\">你好，客服邀请您填写如下内容</div>\n                        <a class=\"rongcloud-layer-close\" href=\"#\" ng-click=\"close()\">×</a>\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-require\">姓名：</label>\n                            <input class=\"rongcloud-inputtext\"  type=\"text\" name=\"name\" required ng-model=\"user.name\"></input>\n                            <div class=\"rongcloud-form-error\" ng-show=\"(userinfo.name.$dirty || userinfo.$submitted) && userinfo.name.$error.required\">请输入姓名</div>\n                        </div>\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-require\">电话：</label>\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"phone\" required ng-model=\"user.phone\" ng-pattern=\"/^1[0-9]{10}$/\"></input>\n                            <div class=\"rongcloud-form-error\" ng-show=\"(userinfo.phone.$dirty || userinfo.$submitted) && userinfo.phone.$error.required\">请输入电话</div>\n                            <div class=\"rongcloud-form-error\" ng-show=\"(userinfo.phone.$dirty || userinfo.$submitted) && userinfo.phone.$error.pattern\">手机格式不正确</div>\n                        </div>\n                        <div class=\"rongcloud-form-item\">\n                            <label>邮箱：</label>\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"email\" ng-model=\"user.email\"></input>\n                        </div>\n                    </div>\n                    <div class=\"rongcloud-foot\">\n                        <button class=\"rongcloud-btn\" ng-click=\"userinfo.$valid && confirm()\">提交</button>\n                    </div>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n<!-- expand endconversation.tpl -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">是否要结束当前会话?</p>\n                <div class=\"rongcloud-buttons\" ng-click=\"confirm()\"><button class=\"rongcloud-button\">是</button><button class=\"rongcloud-button\" ng-click=\"close()\">否</button></div>\n            </div>\n        </div>\n    </div>\n</div>\n\n\n<!-- expand evaluate.tpl -->\n<div class=\"rongcloud-layermbox\" ng-show=\"true\" style=\"display:none;\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-evaluate\">\n                <div class=\"rongcloud-layer-title\">服务评价</div><a href=\"#\" class=\"rongcloud-layer-close\" ng-click=\"close()\">×</a>\n                <div class=\"rongcloud-layer-body\">\n                    <div class=\"rongcloud-group-row\">\n                        <div class=\"rongcloud-group-title\">感谢您的支持，请对我的服务进行评价：</div>\n                        <label for=\"satisfaction5\"><input id=\"satisfaction5\" name=\"satisfaction\" type=\"radio\" value=\"5\" ng-model=\"source\"></input>非常满意</label>\n                        <label for=\"satisfaction4\"><input id=\"satisfaction4\" name=\"satisfaction\" type=\"radio\" value=\"4\" ng-model=\"source\"></input>满意</label>\n                        <label for=\"satisfaction3\"><input id=\"satisfaction3\" name=\"satisfaction\" type=\"radio\" value=\"3\" ng-model=\"source\"></input>一般</label>\n                        <label for=\"satisfaction2\"><input id=\"satisfaction2\" name=\"satisfaction\" type=\"radio\" value=\"2\" ng-model=\"source\"></input>不满意</label>\n                        <br/><label for=\"satisfaction1\"><input id=\"satisfaction1\" name=\"satisfaction\" type=\"radio\" value=\"1\" ng-model=\"source\"></input>非常不满意</label><br/>\n                    </div>\n                    <div class=\"rongcloud-group-row\" ng-show=\"showResolveStatus\">\n                        <div class=\"rongcloud-group-title\">是否解决问题：</div>\n                        <input id=\"resolve\"   name=\"result\" type=\"radio\" value=\"1\" ng-model=\"isresolve\"></input><label for=\"resolve\">已解决</label>\n                        <input id=\"followup\"  name=\"result\" type=\"radio\" value=\"2\" ng-model=\"isresolve\"></input><label for=\"followup\">跟进中</label>\n                        <input id=\"unresolve\" name=\"result\" type=\"radio\" value=\"0\" ng-model=\"isresolve\"></input><label for=\"unresolve\">未解决</label><br/>\n                    </div>\n                    <div class=\"rongcloud-group-row\">\n                        <div>建议：</div>\n                        <textarea class=\"rongcloud-suggest\" placeholder=\"谢谢您的反馈，我们会更加努力！\" ng-model=\"suggest\"></textarea>\n                    </div>\n                </div>\n                <div class=\"rongcloud-foot\">\n                    <button class=\"rongcloud-btn\" ng-click=\"confirm()\">评价</button>\n                </div>\n            </div>\n            <!--反馈提示-->\n            <!-- <div class=\"rongcloud-layermchild rongcloud-feedback\" ng-show=\"end\">\n                <div class=\"rongcloud-layermcont\">\n                    感谢您的反馈 ^ - ^ ！\n                </div>\n            </div> -->\n        </div>\n    </div>\n</div>\n\n\n<!-- expand leaveword -->\n<div class=\"rongcloud-leavemessage\" style=\"display:none;\">\n    <div class=\"rongcloud-leavemessage-title\">{{content}}</div>\n    <form name=\"leave\" novalidate>\n        <div class=\"rongcloud-form-item\" ng-repeat=\"item in formList\">\n            <label ng-class=\"{'rongcloud-require': item.required}\">{{item.title}}</label>\n            <input class=\"rongcloud-inputtext\" ng-if=\" item.type== 'text' \" name=\"{{item.name}}\" placeholder=\"{{item.defaultText}}\" type=\"text\" ng-model=\"item.value\" ng-blur=\"validateItem(item)\"></input>\n            <textarea name=\"leaveword\" ng-if=\" item.type =='textarea' \" name=\"{{item.name}}\" placeholder=\"{{item.defaultText}}\" ng-model=\"item.value\" ng-blur=\"validateItem(item)\"></textarea>\n            <div class=\"rongcloud-form-error\" ng-show=\"item.error\">{{item.error}}</div>\n        </div>\n        <div class=\"rongcloud-leavemessage-form-btns\">\n            <button class=\"rongcloud-btn\" ng-click=\"confirm()\">提交</button>\n        </div>\n    </form>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "cs/sobot/upload.js",
    "content": "(function(RCS) {\n\t//qiniu\n\tfunction forEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction buildUrl(url, items) {\n\t\tvar query = '';\n\t\tforEach(items, function(name, value) {\n\t\t\tif (name != 'token') {\n\t\t\t\tquery += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n\t\t\t}\n\t\t});\n\n\t\tif (query) {\n\t\t\turl += (url.indexOf('?') > 0 ? '&' : '?') + query;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tfunction encode2UTF8(argString) {\n\t\tif (argString === null || typeof argString === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\tvar string = (argString + ''); // .replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t\tvar utftext = '',\n\t\t\tstart, end, stringl = 0;\n\t\tstart = end = 0;\n\t\tstringl = string.length;\n\t\tfor (var n = 0; n < stringl; n++) {\n\t\t\tvar c1 = string.charCodeAt(n);\n\t\t\tvar enc = null;\n\n\t\t\tif (c1 < 128) {\n\t\t\t\tend++;\n\t\t\t} else if (c1 > 127 && c1 < 2048) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 6) | 192, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else if (c1 & 0xF800 ^ 0xD800 > 0) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else { // surrogate pairs\n\t\t\t\tif (c1 & 0xFC00 ^ 0xD800 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched trail surrogate at ' + n);\n\t\t\t\t}\n\t\t\t\tvar c2 = string.charCodeAt(++n);\n\t\t\t\tif (c2 & 0xFC00 ^ 0xDC00 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched lead surrogate at ' + (n - 1));\n\t\t\t\t}\n\t\t\t\tc1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (enc !== null) {\n\t\t\t\tif (end > start) {\n\t\t\t\t\tutftext += string.slice(start, end);\n\t\t\t\t}\n\t\t\t\tutftext += enc;\n\t\t\t\tstart = end = n + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end > start) {\n\t\t\tutftext += string.slice(start, stringl);\n\t\t}\n\n\t\treturn utftext;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction encode2Base64(data) {\n\t\tvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\tvar o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n\t\t\tac = 0,\n\t\t\tenc = '',\n\t\t\ttmp_arr = [];\n\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t}\n\n\t\tdata = encode2UTF8(data + '');\n\n\t\tdo { // pack three octets into four hexets\n\t\t\to1 = data.charCodeAt(i++);\n\t\t\to2 = data.charCodeAt(i++);\n\t\t\to3 = data.charCodeAt(i++);\n\n\t\t\tbits = o1 << 16 | o2 << 8 | o3;\n\n\t\t\th1 = bits >> 18 & 0x3f;\n\t\t\th2 = bits >> 12 & 0x3f;\n\t\t\th3 = bits >> 6 & 0x3f;\n\t\t\th4 = bits & 0x3f;\n\n\t\t\t// use hexets to index into b64, and append result to encoded string\n\t\t\ttmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n\t\t} while (i < data.length);\n\n\t\tenc = tmp_arr.join('');\n\n\t\tswitch (data.length % 3) {\n\t\t\tcase 1:\n\t\t\t\tenc = enc.slice(0, -2) + '==';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tenc = enc.slice(0, -1) + '=';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn enc;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction URLSafeBase64Encode(v) {\n\t\tv = encode2Base64(v);\n\t\treturn v.replace(/\\//g, '_').replace(/\\+/g, '-');\n\t}\n\n\tfunction chunkLastStep(data, opts, callback) {\n\t\t// 七牛 URL 规定\n\t\tvar key = '/key/' + URLSafeBase64Encode(data.filename);\n\t\tvar fname = '/fname/' + URLSafeBase64Encode(data.filename);\n\t\tvar url = opts.domain + '/mkfile/' + data.size + key + fname;\n\t\tvar options = {\n\t\t\tdomain: url,\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/octet-stream'\n\t\t\t},\n\t\t\tmulti_parmas: opts.multi_parmas,\n\t\t\tsupport_options: true,\n\t\t\tstream: true\n\t\t};\n\t\tuploadData(data.ctx, options, {\n\t\t\tonCompleted: function(res) {\n\t\t\t\tres.filename = data.filename;\n\t\t\t\tres.name = data.name;\n\t\t\t\tcallback.onCompleted(res);\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tvar offset = 0,\n\t\tctxStore = {};\n\n\tfunction uploadNextChunk(blob, opts, callback) {\n\t\tvar chunk = Math.ceil(offset / opts.chunk_size),\n\t\t\tchunks = Math.ceil(blob.size / opts.chunk_size),\n\t\t\tcurChunkSize = Math.min(opts.chunk_size, blob.size - offset),\n\t\t\tchunkBlob = blob.slice(offset, offset + curChunkSize),\n\t\t\tchunkInfo = {\n\t\t\t\tchunk: chunk,\n\t\t\t\tchunks: chunks,\n\t\t\t\tname: blob.uniqueName\n\t\t\t};\n\t\tforEach(chunkInfo, function(key, value) {\n\t\t\topts.multi_parmas[key] = value;\n\t\t});\n\t\topts.filesize = blob.size;\n\t\topts.headers = {\n\t\t\t'Content-Type': 'application/octet-stream'\n\t\t};\n\t\topts.isChunk = true;\n\t\tuploadData(chunkBlob, opts, {\n\t\t\tonCompleted: function(chunkRes) {\n\t\t\t\toffset += curChunkSize;\n\t\t\t\t// callback.onProgress(Math.floor((chunk + 1) / chunks * blob.size), blob.size);\n\t\t\t\tctxStore[blob.uniqueName] = ctxStore[blob.uniqueName] || [];\n\t\t\t\tctxStore[blob.uniqueName].push(chunkRes.ctx);\n\t\t\t\tif (offset < blob.size) {\n\t\t\t\t\tif (chunkRes.ctx) {\n\t\t\t\t\t\tuploadNextChunk(blob, opts, callback);\n\t\t\t\t\t}else{\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tdelete ctxStore[blob.uniqueName]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toffset = 0;\n\t\t\t\t\tdelete opts.isChunk;\n\t\t\t\t\tdelete opts.headers['Content-Type'];\n\t\t\t\t\tforEach(chunkInfo, function(key, value) {\n\t\t\t\t\t\tdelete opts.multi_parmas[key];\n\t\t\t\t\t});\n\t\t\t\t\tvar ctx = ctxStore[blob.uniqueName].join(',');\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\tctx: ctx,\n\t\t\t\t\t\tname: blob.name,\n\t\t\t\t\t\tsize: blob.size,\n\t\t\t\t\t\tfilename: blob.uniqueName\n\t\t\t\t\t};\n\t\t\t\t\tchunkLastStep(data, opts, callback);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {\n\t\t\t\tvar loaded = chunkLoaded + offset;\n\t\t\t\tcallback.onProgress(loaded, opts.filesize);\n\t\t\t},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction uploadData(data, options, callback) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\tif (xhr.upload && options.support_options) {\n\t\t\txhr.upload.onprogress = function(event) {\n\t\t\t\tcallback.onProgress(event.loaded, event.total);\n\t\t\t};\n\t\t}\n\n\t\txhr.onreadystatechange = function() {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tvar result = xhr.responseText || \"{}\";\n\t\t\t\tresult = JSON.parse(result);\n\t\t\t\tresult.filename = options.unique_value;\n\t\t\t\tcallback.onCompleted(result);\n\t\t\t}\n\t\t};\n\n\t\tvar url = options.domain;\n\t\tif (options.isChunk) {\n\t\t\turl += '/mkblk/' + data.size;\n\t\t\turl = buildUrl(url, options.multi_parmas);\n\t\t}\n\t\txhr.open(options.method, url, true);\n\n\t\tcallback.onOpen(xhr);\n\n\t\tif (options.stream) {\n\t\t\txhr.setRequestHeader('authorization', 'UpToken ' + options.multi_parmas.token);\n\t\t}\n\n\t\tforEach(options.headers, function(key, value) {\n\t\t\txhr.setRequestHeader(key, value);\n\t\t});\n\t\txhr.send(data);\n\t}\n\n\tfunction uploadQiniu(file, opts, callback) {\n\t\tif (file.size && opts.chunk_size < file.size) {\n\t\t\tvar uniqueName = opts['genUId'](file);\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tuniqueName = uniqueName + suffix;\n\t\t\tfile.uniqueName = uniqueName;\n\t\t\topts.stream = true;\n\t\t\tuploadNextChunk(file, opts, callback);\n\t\t} else {\n\t\t\tvar data = opts['data'](file, opts);\n\t\t\tuploadData(data, opts, callback);\n\t\t}\n\t}\n\tvar uploadProcess = uploadQiniu;\n\n\n\n\t//upload\n\tvar dataType = {\n\t\tform: getFormData,\n\t\tjson: getJsonData,\n\t\tdata: getData\n\t};\n\tvar fileConfig = { \n\t\tdomain: 'http://upload.qiniu.com',\n\t\tfileType: RongIMLib.FileType.IMAGE,\n\t\tgetToken: function(callback){\n\t\t\t/****************************\n\t\t\t * 使用融云文件存储注意事项：\n\t\t\t * 1、有效期为 1 个月。\n\t\t\t * 2、文件不可迁移。\n\t\t\t ****************************\n\t\t\t */\n\t\t\tRongIMClient.getInstance().getFileToken(this.fileType, {\n\t\t\t\tonSuccess: function(data){\n\t\t\t\t\tcallback(data.token);\n\t\t\t\t},\n\t\t\t\tonError: function(error){\n\t\t\t\t\tconsole.log('获取上传token失败');\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\tfunction genUId() {\n\t\tvar date = new Date().getTime();\n\t\tvar uuid = 'xxxxxx4xxxyxxxxxxx'.replace(/[xy]/g, function(c) {\n\t\t\tvar r = (date + Math.random() * 16) % 16 | 0;\n\t\t\tdate = Math.floor(date / 16);\n\t\t\treturn (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n\t\t});\n\t\treturn uuid;\n\t};\n\n\tfunction mergeOption(opts) {\n\t\tvar options = {\n\t\t\tdomain: '',\n\t\t\tmethod: 'POST',\n\t\t\tfile_data_name: 'file',\n\t\t\tunique_key: 'key',\n\t\t\tbase64_size: 4 * 1024 * 1024,\n\t\t\tchunk_size: 4 * 1024 * 1024,\n\t\t\theaders: {},\n\t\t\tmulti_parmas: {},\n\t\t\tquery: {},\n\t\t\tsupport_options: true,\n\t\t\tdata: dataType.form,\n\t\t\tgenUId: genUId\n\t\t};\n\t\tif (!opts || !opts.domain) {\n\t\t\tthrow new Error('domain is null');\n\t\t}\n\t\tfor (var key in opts) {\n\t\t\toptions[key] = opts[key];\n\t\t}\n\t\treturn options;\n\t}\n\n\tfunction mEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction getFormData(file, opts) {\n\t\tvar form = new FormData();\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tform.append(opts.unique_key, unique_value);\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tform.append(opts.file_data_name, file);\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tform.append(key, value);\n\t\t});\n\t\treturn form;\n\t}\n\n\tfunction getJsonData(file, opts) {\n\t\tvar data = {};\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tdata[opts.unique_key] = unique_value;\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tdata[opts.file_data_name] = file;\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tdata[key] = value;\n\t\t});\n\t\treturn JSON.stringify(data);\n\t}\n\n\tfunction getData(file, opts) {\n\t\treturn file;\n\t}\n\n\tfunction Upload(options) {\n\t\tthis.options = mergeOption(options);\n\n\t\tthis.setOptions = function(opts) {\n\t\t\tvar me = this;\n\t\t\tmEach(opts, function(key, value) {\n\t\t\t\tme.options[key] = value;\n\t\t\t});\n\t\t};\n\n\t\tthis.upload = function(file, callback) {\n\t\t\tif (!file) {\n\t\t\t\tcallback.onError('upload file is null.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar me = this;\n\t\t\tuploadProcess(file, this.options, {\n\t\t\t\tonProgress: function(loaded, total) {\n\t\t\t\t\tcallback.onProgress(loaded, total);\n\t\t\t\t},\n\t\t\t\tonCompleted: function(data) {\n\t\t\t\t\tcallback.onCompleted(data);\n\t\t\t\t},\n\t\t\t\tonError: function(errorCode) {\n\t\t\t\t\tcallback.onError(errorCode);\n\t\t\t\t},\n\t\t\t\tonOpen: function(xhr) {\n\t\t\t\t\tme.xhr = xhr;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tthis.cancel = function() {\n\t\t\tthis.xhr && this.xhr.abort();\n\t\t};\n\t}\n\n\tfunction init(options) {\n\t\treturn new Upload(options);\n\t}\n\n\tfunction getResizeRatio(imageInfo,config){\n\t\t//hasOwnProperty?\n\n\t\tvar ratio = 1;\n\n\t\tvar oWidth = imageInfo.width;\n\t\tvar maxWidth = config.maxWidth || 0;\n\t\tif(maxWidth > 0 &&  oWidth > maxWidth){\n\t\t\tratio = maxWidth/oWidth;\n\t\t}\n\n\t\tvar oHeight = imageInfo.height;\n\t\tvar maxHeight = config.maxHeight || 0;\n\t\tif(maxHeight > 0 && oHeight > maxHeight){\n\t\t\tvar ratioHeight = maxHeight/oHeight;\n\t\t\tratio = Math.min(ratio,ratioHeight);\n\t\t}\n\n\n\t\tvar maxSize = config.maxSize || 0;\n\t\tvar oSize = Math.ceil(imageInfo.size/1000); //K，Math.ceil(0.3) = 1;\n\t\tif(oSize > maxSize){\n\t\t\tratioSize = maxSize/oSize;\n\t\t\tratio = Math.min(ratio,ratioSize);\n\t\t}\n\n\t\treturn ratio;\n\t}\n\n\tfunction resize(file,config,callback){\n\t\t//file对象没有高宽\n\t\tvar type = file.type; //image format\n\t\tvar canvas = document.createElement(\"canvas\");\n\n\t\tvar reader = new FileReader();\n\n    \treader.readAsDataURL(file);\n\t\treader.onload = function(evt){\n\t\t\tvar imageData = evt.target.result;\n\t\t\tvar img = new Image();\n\t\t\timg.src  = imageData;\n\t\t\tvar width = img.width;\n\t\t\tvar height = img.height;\n\t\t\tvar imageInfo = {\n\t\t\t\twidth : width,\n\t\t\t\theight : height,\n\t\t\t\tsize : evt.total\n\t\t\t}\n\t\t\tvar ratio = getResizeRatio(imageInfo,config);\n\t\t\tvar newImageData = imageData;\n\t\t\tif(ratio < 1){\n\t\t\t\tnewImageData = compress(img, width*ratio, height*ratio);;\n\t\t\t}\n\t\t\tcallback(newImageData);\n\t\t}\n\n\t\tfunction compress(img, width, height){\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\tvar context = canvas.getContext('2d');\n\t\t\t\tcontext.drawImage(img, 0, 0, width, height);\n\n\t\t\t/*\n\t\t\tIf the height or width of the canvas is 0, the string \"data:,\" is returned.\n\t\t\tIf the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.\n\t\t\tChrome also supports the image/webp type.\n\t\t\t*/ \n\n\t\t\tvar supportTypes = {\n\t\t\t\t\"image/jpg\" : true,\n\t\t\t\t\"image/png\" : true,\n\t\t\t\t\"image/webp\" : supportWebP()\n\t\t\t};\n\t\t\t// var exportType = \"image/png\";\n\t\t\t// if(supportTypes[type]){\n\t\t\t// \texportType = type;\n\t\t\t// } \n\t\t\t// 多端一致，缩略图必须是 jpg \n\t\t\tvar exportType = \"image/jpg\";\n\t\t\tvar newImageData = canvas.toDataURL(exportType);\n\t\t\treturn newImageData;\n\t\t}\n\n\t\tfunction supportWebP(){\n\t\t\ttry{\n        \t\treturn (canvas.toDataURL('image/webp').indexOf('data:image/webp') == 0);\n    \t\t}catch(err) {\n\t\t        return  false;\n\t\t    }\n\t\t}\n\t}\n\n\tvar calcPosition = function(width, height, opts) {\n        var isheight = width < height;\n        var scale = isheight ? height / width : width / height;\n        var zoom, x = 0,\n            y = 0,\n            w, h;\n\n        var gtScale = function() {\n            if (isheight) {\n                zoom = width / 100;\n                w = 100;\n                h = height / zoom;\n                y = (h - opts.maxHeight) / 2;\n            } else {\n                zoom = height / 100;\n                h = 100;\n                w = width / zoom;\n                x = (w - opts.maxWidth) / 2;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        \n        var ltScale = function() {\n            if (isheight) {\n                zoom = height / opts.maxHeight;\n                h = opts.maxHeight;\n                w = width / zoom;\n            } else {\n                zoom = width / opts.maxWidth;\n                w = opts.maxWidth;\n                h = height / zoom;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        return scale > opts.scale ? gtScale() : ltScale();\n    };\n\n    var getBlobUrl = function(file) {\n        var URL = window.URL || window.webkitURL;\n        return URL ? URL.createObjectURL(file) : \"\";\n    };\n\n    var getThumbnail = function(file, opts, callback) {\n        var canvas = document.createElement(\"canvas\"),\n            context = canvas.getContext('2d');\n        var img = new Image();\n        img.onload = function() {\n            var pos = calcPosition(img.width, img.height, opts);\n            canvas.width = pos.w > opts.maxWidth ? opts.maxWidth : pos.w;\n            canvas.height = pos.h > opts.maxHeight ? opts.maxHeight : pos.h;\n            context.drawImage(img, pos.x, pos.y, pos.w, pos.h);\n            try {\n                var base64 = canvas.toDataURL(file.type, opts.quality);\n                var reg = new RegExp('^data:image/[^;]+;base64,');\n                base64 = base64.replace(reg, '');\n                callback(base64);\n            } catch (e) {\n                throw new Error(e);\n            }\n        };\n        img.src = typeof file == 'string' ? 'data:image/jpg;base64,' + file : getBlobUrl(file);\n    };\n\n    var _compress = function(data, callback) {\n        var file = data.file;\n        var opts = data.compress;\n        getThumbnail(file, opts, callback);\n    };\n\n    _init = function(config, callback) {\n        if (config.getToken) {\n            config.getToken(function(token) {\n                config.multi_parmas || (config.multi_parmas = {});\n                config.multi_parmas.token = token;\n                config.headers || (config.headers = {});\n                if (config.base64) {\n                    config.headers['Content-type'] = 'application/octet-stream';\n                    config.headers['Authorization'] = 'UpToken ' + token;\n                }\n                var instance = init(config);\n                callback(instance);\n            });\n        } else {\n            config.headers || (config.headers = {});\n            if (config.base64) {\n                config.headers['Content-type'] = 'application/octet-stream';\n            }\n            var instance = init(config);\n            callback(instance);\n        }\n    };\n\n    var _upload = function(data, instance, callback) {\n        instance.upload(data.file, {\n            onError: function(errorCode) {\n                callback.onError(errorCode);\n            },\n            onProgress: function(loaded, total) {\n                callback.onProgress(loaded, total);\n            },\n            onCompleted: function(result) {\n                result.filename || (result.filename = result.hash);\n                var compress = data.compressThumbnail || _compress;\n                if (data.compress) {\n                    compress(data, function(thumbnail) {\n                        result.thumbnail = thumbnail;\n                        callback.onCompleted(result);\n                    });\n                } else {\n                    callback.onCompleted(result);\n                }\n            }\n        });\n    };\n\n    var File = function(instance) {\n        var me = this;\n        this.instance = instance\n        this.upload = function(file, callback) {\n            var data = {\n                file: file\n            };\n            _upload(data, me.instance, callback);\n        };\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initFile = function(config, callback) {\n        _init(config, function(instance) {\n            var UploadFile = new File(instance);\n            callback(UploadFile);\n        });\n    };\n\n    var Img = function(instance, cfg) {\n        var me = this;\n        this.cfg = cfg;\n        this.instance = instance;\n        this.upload = function(file, callback) {\n            var data = {\n                file: file,\n                compress: me.cfg\n            };\n            _upload(data, me.instance, callback);\n        };\n\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initImage = function(config, callback) {\n        _init(config, function(instance) {\n            var compress = {\n                maxHeight: config.height || 240,\n                maxWidth: config.width || 240,\n                quality: config.quality || 0.5,\n                scale: config.scale || 2.4\n            };\n            var uploadImage = new Img(instance, compress);\n            callback(uploadImage);\n        });\n    };\n\n    var ImgBase64 = function(config) {\n        config.base64 = true;\n        Img.call(this, config);\n    };\n\n    var initImgBase64 = function(config, callback) {\n        config.base64 = true;\n        initImage.call(this, config, callback);\n    };\n    var initType = {\n        file: function(file,config,callback){\n            initFile(config, function(uploadFile){\n                uploadFile.upload(file, callback);\n            });\n        },\n        image: function(file,config,callback){\n            initImage(config, function(uploadFile){\n                uploadFile.upload(file, callback);\n            });\n        }\n    };\n\n    var imageStartUpload = function(_file,onSuccess){\n    \tvar callback = {\n\t\t\tonError\t: function (errorCode) { \n\t\t\t\tconsole.log(errorCode);\n\t\t\t},\n\t\t\tonProgress : function (loaded, total) {\n\t\t\t\t// var percent = Math.floor(loaded/total*100);\n\t\t\t\t// var progressBar \t= document.getElementById('progressBar'),\n\t\t\t\t// \tprogressContent = document.getElementById('progressContent');\n\t\t\t\t// \tprogressBar.style.width = percent + '%';\n\t   //      \t\tprogressContent.innerHTML = percent + \"%\";\n\t\t\t},\n\t\t\tonCompleted : function (data) {\n\t\t\t\tdata.fileType = 'image';\n\t\t\t\tonSuccess(data);\n\t\t\t} \n\t\t};\n    \tinitType['image'](_file,fileConfig,callback);\n    }\n    var fileStartUpload = function(_file,onSuccess){\n    \tfileConfig.fileType = RongIMLib.FileType.FILE;\n    \tvar callback = {\n\t\t\tonError\t: function (errorCode) { \n\t\t\t\tconsole.log(errorCode);\n\t\t\t},\n\t\t\tonProgress : function (loaded, total) {\n\t\t\t\t// var percent = Math.floor(loaded/total*100);\n\t\t\t\t// var progressBar \t= document.getElementById('progressBar'),\n\t\t\t\t// \tprogressContent = document.getElementById('progressContent');\n\t\t\t\t// \tprogressBar.style.width = percent + '%';\n\t   //      \t\tprogressContent.innerHTML = percent + \"%\";\n\t\t\t},\n\t\t\tonCompleted : function (data) {\n\t\t\t\tdata.fileType = 'file';\n\t\t\t\tonSuccess(data);\n\t\t\t} \n\t\t};\n    \tinitType['file'](_file,fileConfig,callback);\n    }\n\n    \n    RCS.imageStartUpload = imageStartUpload;\n    RCS.fileStartUpload = fileStartUpload;\n    RCS.fileConfig = fileConfig;\n})(RCS);"
  },
  {
    "path": "cs/sobot/utils.js",
    "content": ";var RCS = {\n    templateCache:{}\n};\n\n(function(RCS){\n    /*\n    var tpl = '<a>{{this.key1}} <p>-</p> {{this.value1.c}}</a>';\n    var data = {\"key1\":1,\"value1\":{\"c\":\"cccccc\"}};\n    var html = render(tpl,data);  \n    */\n    function render(template, data) {\n        template = template || \"\";\n        data = data || [\"\"];\n        var re = /{%((?:(?!%}).)+)%}/g, reExp = /(^( )?(var|if|for|else|switch|case|default|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n        var add = function(line, js) {\n            js? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n                (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n            return add;\n        }\n        var match;\n        while(match = re.exec(template)) {\n            add(template.slice(cursor, match.index))(match[1], true);\n            cursor = match.index + match[0].length;\n        }\n        add(template.substr(cursor, template.length - cursor));\n        code += 'return r.join(\"\");';\n        data = isNaN(data.length) ? [data] : data;\n        var html = \"\";\n        for(var i = 0, length = data.length; i < length; i++) {\n            html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n        }\n        return html;    \n    }\n\n\n    var utils = {\n        $ : function(selector){\n            return document.querySelectorAll(selector);\n        },\n        show : function(node){\n            node.style.display = \"block\";\n        },\n        hide : function(node){\n            node.style.display = \"none\";\n        },\n        removeNode : function(selector){\n            var thisNode = utils.$(selector)[0];\n            if (thisNode) {\n                thisNode.parentNode.removeChild(thisNode);\n            }\n        },\n        getStyle : function (node, prop) {\n            if(node.currentStyle) {\n                return node.currentStyle[prop] || '';\n            }\n            else if(window.getComputedStyle) {\n                return window.getComputedStyle(node , null)[prop];\n            }\n        },\n        indexOf : function (array, item) {\n            if (array.indexOf){\n                return array.indexOf(item);\n            }   \n            for (var i = 0, len = array.length; i < len; i++){\n                if (array[i] === item){\n                    return i;\n                }\n            }   \n            return -1;\n        },\n        copy : function(json1, json2, flag, fn){\n            fn = fn || function(e){return e;}\n            for (var key in json2){\n                if (flag || typeof json1[key] === 'undefined' || json1[key] === null){\n                    json1[key] = fn(json2[key]);\n                }\n            }\n            return json1;\n        },\n        isChild : function(node,nodeParent){\n            while (node && node.tagName && node.tagName.toLowerCase() != \"body\"){\n                if (node == nodeParent){\n                    return true;\n                }\n                node = node.parentNode;\n            }\n            return false;\n        },\n        getTime : function(time){\n            var nowDate = new Date();\n            var sendDate = new Date(time);\n            var dateStr = '';\n            if (nowDate.getFullYear() == sendDate.getFullYear() && nowDate.getMonth() == sendDate.getMonth() && nowDate.getDate() == sendDate.getDate()) {\n                dateStr = (sendDate.getHours()>9 ? sendDate.getHours():'0'+sendDate.getHours())+':'+(sendDate.getMinutes()>9 ? sendDate.getMinutes():'0'+sendDate.getMinutes());\n            } else {\n                dateStr = sendDate.getFullYear()+'-'+(sendDate.getMonth()>8 ? (sendDate.getMonth()+1):'0'+(sendDate.getMonth()+1))+'-'+(sendDate.getDate()>9 ? sendDate.getDate():'0'+sendDate.getDate())+' '+(sendDate.getHours()>9 ? sendDate.getHours():'0'+sendDate.getHours())+':'+(sendDate.getMinutes()>9 ? sendDate.getMinutes():'0'+sendDate.getMinutes());\n            }\n            return dateStr;\n        },\n        getFileSize : function(size){\n            var g = Math.pow(1024, 3);\n            var m = Math.pow(1024, 2);\n            var k = Math.pow(1024, 1);\n            if (size > g) {\n                size = (size / g).toFixed(2) + 'G';\n            } else if (size > m) {\n                size = (size / m).toFixed(2) + 'M';\n            } else if (size > k) {\n                size = (size / k).toFixed(2) + 'K';\n            } else {\n                size = size + 'B';\n            }\n            return size;\n        },\n        getFormValue : function(formArray){\n            var formData = {};\n            for (var i = 0; i < formArray.length; i++) {\n                formData[formArray[i]] = document.getElementsByName(formArray[i])[0].value;\n            }\n            return formData;\n        },\n        fadein : function(ele) {\n            ele.style.opacity = 0;\n            ele.style.display = \"block\";\n            if (ele) {\n                var v = 0;\n                var timer = null;\n                timer = setInterval(function() {\n                    v += 1;\n                    setOpacity(ele, v);\n                    if (v == 100) {\n                        clearInterval(timer);\n                    }\n                }, 1);\n            }\n        },\n        fadeout: function(ele) {\n            if (ele) {\n                var v = 100;\n                var timer = null;\n                timer = setInterval(function() {\n                    v -= 1;\n                    setOpacity(ele, v);\n                    if (v == 0) {\n                        ele.style.display = \"none\";\n                        clearInterval(timer);\n                    }\n                }, 1);\n            }\n        },\n        downloadHistoryMsgFile: function(url,name){\n            var a = document.createElement('a');\n            a.href = url;\n            a.setAttribute('download', name || '');\n            a.click();\n        },\n        encodeHtmlStr: function(str) {\n            var replaceRule = [\n                {\n                    symbol: '&',\n                    html: '&amp;'\n                },\n                //下述方法有问题,字符串中如有空格,会多加空格\n                //white-space: pre-wrap; 能实现同样效果,并支持ie9, 故注释掉\n                // {\n                //     symbol: '[\\\\u0020]',\n                //     html: '&nbsp;\\u0020'\n                // },\n                {\n                    symbol: '[\\\\u0009]',\n                    html: '&nbsp;&nbsp;&nbsp;&nbsp;\\u0020'\n                },\n                {\n                    symbol: '<',\n                    html: '&lt;'\n                },\n                {\n                    symbol: '>',\n                    html: '&gt;'\n                },\n                {\n                    symbol: '\"',\n                    html: '&quot;'\n                },\n                {\n                    symbol: '\\'',\n                    html: '&#39;'\n                },\n                {\n                    symbol: '\\\\n\\\\r',\n                    html: '<br/>'\n                },\n                {\n                    symbol: '\\\\r\\\\n',\n                    html: '<br/>'\n                },\n                {\n                    symbol: '\\\\n',\n                    html: '<br/>'\n                }\n            ];\n\n            for (var i = 0, len = replaceRule.length; i < len; i++) {\n                var rule = replaceRule[i];\n                var regExp = new RegExp(rule.symbol, 'g');\n                str = str.replace(regExp, rule.html);\n            }\n\n            return str;\n        },\n        replaceUri: function(str, callback) {\n            var result = '';\n            var protocol = '((?:http|https|ftp)\\\\:\\\\/\\\\/)?';\n            var ip = '(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])\\\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])';\n            var host = '(?!@)(?:[a-z0-9-]{1,36}\\\\.)+[a-z]{2,6}';\n            var port = '(?:\\\\:[0-9]{1,5})?';\n            var path = '(?:[a-zA-Z0-9.,;?\\\\\\'+&%$#=~_\\\\-!()*\\\\/]*)';\n            var uriReg = new RegExp(protocol + '(?:(?:' + ip + ')|(?:' + host +'))' + port + path, 'ig');\n\n            result = str.replace(uriReg, function(uriStr, prot) {\n                var lastIndex = arguments[arguments.length - 2];\n                var prevChar = str.substr(lastIndex - 1, 1);\n                var isEmail = prevChar === '@';\n                var notDomain = !chkDomain(uriStr, prot);\n                if (isEmail || notDomain) {\n                    return uriStr;\n                }\n                return callback.apply(null, arguments);\n            });\n            return result;\n        },\n        replaceEmail: function(str, callback) {\n            var result = '';\n            var emailReg = /\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*/gi;\n\n            result = str.replace(emailReg, callback);\n\n            return result;\n        },\n        browserRedirect: function(callback) {\n            var sUserAgent = navigator.userAgent.toLowerCase();\n            var bIsIpad = sUserAgent.match(/ipad/i) == \"ipad\";\n            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == \"iphone os\";\n            var bIsMidp = sUserAgent.match(/midp/i) == \"midp\";\n            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == \"rv:1.2.3.4\";\n            var bIsUc = sUserAgent.match(/ucweb/i) == \"ucweb\";\n            var bIsAndroid = sUserAgent.match(/android/i) == \"android\";\n            var bIsCE = sUserAgent.match(/windows ce/i) == \"windows ce\";\n            var bIsWM = sUserAgent.match(/windows mobile/i) == \"windows mobile\";\n            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {\n                callback(\"phone\");\n            } else {\n                callback(\"pc\");\n            }\n        },\n        cloneObj: function(obj){\n            var str, newobj = obj.constructor === Array ? [] : {};\n            if(typeof obj !== 'object'){\n                return;\n            } else if(window.JSON){\n                str = JSON.stringify(obj), //系列化对象\n                newobj = JSON.parse(str); //还原\n            } else {\n                for(var i in obj){\n                    newobj[i] = typeof obj[i] === 'object' ? \n                    cloneObj(obj[i]) : obj[i]; \n                }\n            }\n            return newobj;\n        }\n    };\n    var setOpacity = function(ele, opacity) {\n        if (ele.style.opacity != undefined) {\n            ///兼容FF和GG和新版本IE\n            ele.style.opacity = opacity / 100;\n        } else {\n            ///兼容老版本ie\n            ele.style.filter = \"alpha(opacity=\" + opacity + \")\";\n        }\n    }\n\n    var domainArray = [\n    '.com', '.net', '.org', '.biz', '.coop', '.info', '.museum', '.name',\n    '.pro', '.edu', '.gov', '.int', '.mil', '.ac', '.ad', '.ae', '.af', '.ag',\n    '.ai', '.al', '.am', '.an', '.ao', '.aq', '.ar', '.as', '.at', '.au', '.aw',\n    '.az', '.ba', '.bb', '.bd', '.be', '.bf', '.bg', '.bh', '.bi', '.bj', '.bm',\n    '.bn', '.bo', '.br', '.bs', '.bt', '.bv', '.bw', '.by', '.bz', '.ca', '.cc',\n    '.cd', '.cf', '.cg', '.ch', '.ci', '.ck', '.cl', '.cm', '.cn', '.co', '.cr',\n    '.cu', '.cv', '.cx', '.cy', '.cz', '.de', '.dj', '.dk', '.dm', '.do', '.dz',\n    '.ec', '.ee', '.eg', '.eh', '.er', '.es', '.et', '.fi', '.fj', '.fk', '.fm',\n    '.fo', '.fr', '.ga', '.gd', '.ge', '.gf', '.gg', '.gh', '.gi', '.gl', '.gm',\n    '.gn', '.gp', '.gq', '.gr', '.gs', '.gt', '.gu', '.gv', '.gy', '.hk', '.hm',\n    '.hn', '.hr', '.ht', '.hu', '.id', '.ie', '.il', '.im', '.in', '.io', '.iq',\n    '.ir', '.is', '.it', '.je', '.jm', '.jo', '.jp', '.ke', '.kg', '.kh', '.ki',\n    '.km', '.kn', '.kp', '.kr', '.kw', '.ky', '.kz', '.la', '.lb', '.lc', '.li',\n    '.lk', '.lr', '.ls', '.lt', '.lu', '.lv', '.ly', '.ma', '.mc', '.md', '.me',\n    '.mh', '.mk', '.ml', '.mm', '.mn', '.mo', '.mp', '.mq', '.mr', '.ms', '.mt',\n    '.mu', '.mv', '.mw', '.mx', '.my', '.mz', '.na', '.nc', '.ne', '.nf', '.ng',\n    '.ni', '.nl', '.no', '.np', '.nr', '.nu', '.nz', '.om', '.pa', '.pe', '.pf',\n    '.pg', '.ph', '.pk', '.pl', '.pm', '.pn', '.pr', '.ps', '.pt', '.pw', '.py',\n    '.qa', '.re', '.ro', '.rw', '.ru', '.sa', '.sb', '.sc', '.sd', '.se', '.sg',\n    '.sh', '.si', '.sj', '.sk', '.sl', '.sm', '.sn', '.so', '.sr', '.st', '.sv',\n    '.sy', '.sz', '.tc', '.td', '.tf', '.tg', '.th', '.tj', '.tk', '.tm', '.tn',\n    '.to', '.tp', '.tr', '.tt', '.tv', '.tw', '.tz', '.ua', '.ug', '.uk', '.um',\n    '.us', '.uy', '.uz', '.va', '.vc', '.ve', '.vg', '.vi', '.vn', '.vu', '.ws',\n    '.wf', '.ye', '.yt', '.yu', '.za', '.zm', '.zw', '.mg'];\n    \n    var getLocation = function(href) {\n        var location = document.createElement('a');\n        location.href = href;\n        return location;\n    };\n\n    function ValidateIPaddress(ipaddress) {\n        if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) {\n            return true;\n        }\n        return false;\n    }\n\n    var chkDomain = function(str, protocol) {\n        var link = str;\n        if(!protocol){\n            link = 'http://' + link;\n        }\n        var location = getLocation(link);\n        if(ValidateIPaddress(location.hostname)){\n            return true;\n        }\n        var domain = location.hostname.replace(/^.+\\./, '');\n        if(domainArray.indexOf('.' + domain) < 0){\n            return false;\n        }\n        return true;\n    };\n\n    utils.render = render;\n\n    RCS.utils = utils;   \n})(RCS);"
  },
  {
    "path": "desktop/downloadExtra.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>download in electron</title>\n</head>\n<body>\n<script>\nfunction showProgress(str){\n    str = str || '';\n    var progress = document.getElementById(\"progress\");\n    progress.innerHTML = \"\\n\" + str;\n}  \nfunction showInfo(str){\n    str = str || '';\n    var show = document.getElementById(\"show\");\n    show.innerHTML += \"\\n\" + str;\n}   \n</script>\n<h1>download in electron <input type=\"button\" value=\"主页\" onclick=\"location.href='index.html'\"></h1>\n<ul>\n    <li>下载支持 暂停/恢复, 取消</li>\n</ul>\n<pre id=\"progress\"></pre>\n<pre id=\"show\"></pre>\n\n</br>\n\n<!-- 下载 -->\n<input type=\"button\" value=\"下载vscode\" onclick=\"downloadFile()\">\n<!-- 暂停 -->\n<input id=\"pause\" type=\"button\" value=\"暂停\" onclick=\"toggleButton()\">\n<!-- 取消下载 -->\n<input type=\"button\" value=\"取消下载\" onclick=\"cancelDownload()\">\n<script>\n// var url = 'http://sw.bos.baidu.com/sw-search-sp/software/e335feb5c2f01';\n// var url = 'http://sw.bos.baidu.com/sw-search-sp/software/e335feb5c2f01/WeChatSetup.exe';\nvar url = 'http://vscode.cdn.azure.cn/stable/2648980a697a4c8fb5777dcfb2ab110cec8a2f58/VSCodeSetup-ia32-1.14.1.exe';\n// var url = 'http://test.im.rce.rongcloud.net/desktop-client/config.js';\n// var Downloader = RongDesktop.Downloader;\nvar downloader;\nvar pause = document.getElementById(\"pause\");\n\nfunction downloadFile(){\n    /*\n    url:下载地址,\n    name:默认下载名称\n    */\n    var file = {\n        url: url\n    };\n    downloader = RongDesktop.download(file);\n\n    downloader.onError = function(error){\n        // console.log('error', error);\n        showInfo(error);\n    }\n    // downloader.saveAs();\n    // downloader.save('adsfa.js');\n    downloader.save();\n\n    // 下载准备完毕, 此时可知文件大小 \n    downloader.onReady = function(data){\n        showInfo('full size:' + data.total);\n    }\n\n    // 下载中,返回下载进度\n    downloader.onProgress = function(data){\n        if(data.progress === 0){\n            return;\n        }\n        showProgress(data.loaded + '/' + data.total);\n    }\n    \n    // 下载完成\n    downloader.onComplete = function(data){\n        if(data.loaded >= data.total){\n            showInfo('下载完成');\n        } else {\n            showInfo('下载已取消');\n        }\n    }\n\n}\nfunction cancelDownload(){\n     showProgress();\n    downloader && downloader.abort();\n}\n\nfunction toggleButton(){\n    if (pause.value == '暂停') {\n        downloader && downloader.pause();\n        pause.value = '恢复';\n    }\n    else {\n        downloader && downloader.resume();\n        pause.value = '暂停'\n    }\n}\n</script>\n\n</html>"
  },
  {
    "path": "desktop/file.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>file in electron</title>\n</head>\n<body>\n<script>\nfunction showInfo(str){\n    var show = document.getElementById(\"show\");\n        show.innerHTML += \"<br/>\" + str;\n}   \n</script>\n<h1>file in electron <input type=\"button\" value=\"主页\" onclick=\"location.href='index.html'\"></h1>\n<ul>\n    <li>1. 右键复制硬盘中任意位置的一个或多个文件/文件夹, 点击\"获取复制文件路径\", 将显示被复制 文件/文件夹 的路径</li>\n    <li>2. 点击\"获取文件对象\", 将显示复制文件的对象(不包括文件夹)</li>\n</ul>\n\n<ul id=\"file\"></ul>\n</br>\n<ul id=\"show\"></ul>\n<script>\nvar objPath;\nvar file = document.getElementById(\"file\");\nfunction getFilePaths(){\n    objPath = RongDesktop.file.getPaths();\n    var result = '';\n    for(var i = 0; i < objPath.dirList.length;i++){\n        result += '<li>' + objPath.dirList[i] + '</li>';\n    }\n    for(var i = 0; i < objPath.fileList.length;i++){\n        result += '<li>' + objPath.fileList[i] + '</li>';\n    }\n    file.innerHTML = result;\n}\n\nfunction getFilesByPaths(){\n    getFilePaths();\n    var files = RongDesktop.file.getBlobs(objPath.fileList);\n    var result = '';\n    for(var i = 0; i < files.length;i++){\n        result += '<li>' + files[i].name + '</li>';\n    }\n    showInfo(result);\n}\n\nfunction getFiles(){\n    var fileObj = RongDesktop.file.getFiles();\n    var result = '';\n    for(var i = 0; i < fileObj.fileList.length;i++){\n        result += '<li>' + fileObj.fileList[i].name + ':  ' + fileObj.fileList[i].size + '</li>';\n    }\n\n    for(var i = 0; i < fileObj.dirList.length;i++){\n        result += '<li>' + fileObj.dirList[i].path + ':  ' + fileObj.dirList[i].size + '</li>';\n    }\n    showInfo(result);\n}\n\nvar selectedPath;\nfunction handleFiles(files){\n    selectedFile = files[0];\n}\n\nfunction openFile(){\n    selectedFile && RongDesktop.file.open(selectedFile.path);\n}\n\nfunction chkExists(){\n    if(!selectedFile){\n        return false;\n    }\n    var fileUrl = selectedFile.path;\n    var result = RongDesktop.file.checkExist(fileUrl);\n    var _show = 'file ' + fileUrl + ' is ';\n    _show += result ? 'exist' : 'notexist';\n    showInfo(_show);\n}\n\nfunction openDir(){\n    selectedFile && RongDesktop.file.openDir(selectedFile.path);\n}\n</script>\n\n</br>\n<div>\n    <!-- 获取剪贴板上文件路径 -->\n    <input type=\"button\" value=\"获取复制文件路径\" onclick=\"getFilePaths()\">\n    <!-- 根据路径获取文件对象,返回数组 -->\n    <input type=\"button\" value=\"获取文件对象\" onclick=\"getFilesByPaths()\"> \n    <!-- 根据路径获取文件对象,返回数组 -->\n    <input type=\"button\" value=\"获取剪贴板对象\" onclick=\"getFiles()\"> \n</div>\n</br></br>\n<div>\n    <input type=\"file\" onchange=\"handleFiles(this.files)\" />\n    \n    <!-- 打开文件,基于上述选择文件 -->\n    <input type=\"button\" value=\"打开文件\" onclick=\"openFile()\" />\n    <!-- 检查选择文件是否存在,基于上述选择文件 -->\n    <input type=\"button\" value=\"检查文件是否存在\" onclick=\"chkExists()\" /> \n    <!-- 打开文件所在目录,基于上述选择文件 -->\n    <input type=\"button\" value=\"打开文件所在目录\" onclick=\"openDir()\" />    \n</div>\n\n</html>"
  },
  {
    "path": "desktop/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Demo</title>\n</head>\n<body>\n<h1>Demo</h1>\n<ul>\n  <li><a href='../api-test.html'>SDK API Test</a></li>\n  <li><a href='screenshot.html'>截图</a></li>\n  <li><a href='downloadExtra.html'>文件下载</a></li>\n  <li><a href='file.html'>文件操作</a></li>\n  <li><a href='system.html'>系统操作</a></li>\n  <li><a href='window.html'>窗体操作</a></li>\n</ul>\n</html>"
  },
  {
    "path": "desktop/screenshot.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>requirejs in electron</title>\n</head>\n<body>\n    \n<h1>screenshot in electron <input type=\"button\" value=\"主页\" onclick=\"location.href='index.html'\"></h1>\n<ul>\n    <li>调用前需先注册回调,用于处理获取到的图像数据</li>\n    <li>截图方法返回的是剪切板中的 base64 数据</li>\n</ul>\n\n<input type=\"button\" value=\"screen capture\" onclick=\"startShot()\">\n\n<br/>\n<img style=\"max-width:100px;border:1px solid red;margin:10px;\" id=\"screen\" src=\"http://www.rongcloud.cn/docs/assets/img/index/logo.png\" alt=\"\">\n\n<script>\nvar screen = document.getElementById(\"screen\");\n\nvar completeCallback = function(file){\n   screen.src = file.dataURL;\n}\n\nvar cancelCallback = function(){\n    console.log('exit screenshot');\n    alert('exit screenshot');\n}\n\n// 调用前需先注册回调,用于处理获取到的图像数据\n// RongDesktop.setCallback(callback);\n\nfunction startShot(){\n    RongDesktop.screenshot.captureScreen(completeCallback, cancelCallback);  \n}\n\n</script>\n\n</body>\n</html>"
  },
  {
    "path": "desktop/system.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>system in electron</title>\n</head>\n<body>\n<style>  \n    .result{\n        display:block;\n        background:#f5f5f5;\n        margin-top:30px;\n        width:730px;\n        padding:5px;\n        overflow:hidden;\n    }\n</style>\n\n<script>\nfunction showInfo(str){\n    var show = document.getElementById(\"show\");\n        show.innerText += \"\\n\" + str;\n}   \n</script>\n<h1>system in electron <input type=\"button\" value=\"主页\" onclick=\"location.href='index.html'\"></h1>\n\n<ul id=\"show\" class=\"result\"></ul>\n<script>\nfunction getLocale(){\n    showInfo('getLocale:' + RongDesktop.system.getLocale());\n}\nfunction getDeviceId(){\n    showInfo('getDeviceId:' + RongDesktop.system.deviceId);\n /*   Electron.system.getDeviceId().then(function(address){\n        showInfo('getDeviceId:' + address);\n    });*/\n}\n\nfunction getPlatform(){\n    showInfo('getPlatform:' + RongDesktop.system.platform);\n}\nfunction purgeCache(){\n    RongDesktop.system.clearCache();\n}\nfunction setLanguage(lang) {\n    RongDesktop.system.setLanguage(lang);\n}\n\n</script>\n\n</br>\n<!-- 设置 App 显示语言,主要用于 web 端设置语言后同步到 Desktop 端显示相应语言的菜单等等 -->\n<input type=\"button\" value=\"设置语言\" onclick=\"setLanguage('ch')\">\n<!-- 获取当前 App 语言设置,参考 https://electron.atom.io/docs/api/locales/ -->\n<input type=\"button\" value=\"获取多语言\" onclick=\"getLocale()\">\n<!-- 获取设备 id(MAC 地址) -->\n<input type=\"button\" value=\"获取设备号\" onclick=\"getDeviceId()\">\n<!-- 获取数据库路径, 仅支持 Mac, Windows 由 SDK 处理 内部排错用-->\n<!-- <input type=\"button\" value=\"获取数据库路径\" onclick=\"getDbPath()\"> -->\n<!-- 获取当前平台 -->\n<input type=\"button\" value=\"获取当前平台\" onclick=\"getPlatform()\">\n</br>\n</br>\n<!-- 清除缓存,设置成功后 重启生效 -->\n<input type=\"button\" value=\"清除缓存\" onclick=\"purgeCache()\">\n</html>"
  },
  {
    "path": "desktop/window.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>window in electron</title>\n</head>\n<body>\n<style>\n    input{\n        margin:5px;\n        padding:0;\n        color:#cd0000;\n    }\n    input[type=\"text\"] {\n        color: black;\n    }\n</style>\n<h1>window in electron <input type=\"button\" value=\"主页\" onclick=\"location.href='index.html'\"></h1>  \n<ul>\n    <li>窗体简单操作,参照文档 <a target=\"_blank\" href=\"https://electron.atom.io/docs/api/browser-window/\">https://electron.atom.io/docs/api/browser-window/</a></li>\n</ul>\n</br>\n\n</br>\n<!-- 窗体最大化 -->\n<input type=\"button\" value=\"最大化\" onclick=\"RongDesktop.window.max()\">\n<!-- 窗体最小化 -->\n<input type=\"button\" value=\"最小化\" onclick=\"RongDesktop.window.min()\">\n<!-- 窗体复原,窗体从最大/小化恢复到之前状态 -->\n<input type=\"button\" value=\"复原\" onclick=\"RongDesktop.window.restore()\">\n<!-- 窗体关闭 -->\n<input type=\"button\" value=\"关闭\" onclick=\"RongDesktop.window.close()\">\n<!-- 窗体前置 -->\n<input type=\"button\" value=\"前置\" onclick=\"RongDesktop.window.bringFront(true)\">\n<!-- 窗体获取焦点 -->\n<input type=\"button\" value=\"获取焦点\" onclick=\"RongDesktop.window.focus()\">\n<!-- 窗体非激活状态显示 voip 用到-->\n<input type=\"button\" value=\"showInactive\" onclick=\"RongDesktop.window.showInactive()\">\n<!-- 窗体显示 -->\n<input type=\"button\" value=\"显示\" onclick=\"RongDesktop.window.show()\">\n\n<br/>\n\n<!-- 仅支持 Mac, dock 显示消息数 -->\n<input type=\"button\" value=\"更新 Badge(Mac)\" onclick=\"RongDesktop.window.updateBadgeNumber(22, 'dwdw')(100, '99+')\">\n<!-- 仅支持 windows, 显示气泡弹框 -->\n<input type=\"button\" value=\"示气泡(Win)\" onclick=\"RongDesktop.window.displayBalloon('title', { body: 'content' })\">\n<!-- 仅支持 windows, dock 闪烁 -->\n<input type=\"button\" value=\"flashFrame\" onclick=\"RongDesktop.window.flashFrame()\">\n<!-- 窗体抖动 -->\n<input type=\"button\" value=\"抖动\" onclick=\"RongDesktop.window.shakeWindow()\">\n<!-- 仅支持 Mac, dock click -->\n<input type=\"button\" value=\"监听 DockClick\" onclick=\"bindDockClick()\">\n<!-- 双击任务栏小图标 -->\n<input type=\"button\" value=\"监听 DoubleClick\" onclick=\"bindDoubleClick()\">\n\n<hr/>\n\n<input type=\"text\" placeholder=\"请输入链接地址\" id=\"address\" onkeypress=\"if(event.keyCode === 13) { openBrowserWin() }\">\n<input type=\"submit\" value=\"打开链接\" onclick=\"openBrowserWin()\">\n\n\n<script>\n    function bindDockClick() {\n        RongDesktop.ipcRenderer.on('onDockClick', function() {\n            alert('dockClick');\n        });\n    }\n    function bindDoubleClick() {\n        RongDesktop.ipcRenderer.on('onDoubleClick', function() {\n            alert('doubleClick');\n        });\n    }\n    function openBrowserWin() {\n        var el = document.getElementById('address');\n        var path = el.value;\n        path = path ? path : 'http://www.rongcloud.cn/';\n        RongDesktop.browserWin.create({\n            path: path\n        });\n    }\n</script>\n</html>"
  },
  {
    "path": "electron/desktop_share.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>\n  </title>\n</head>\n<body>\n  \n<h1>桌面分享 capture</h1>\n\n<video src=\"\"></video>\n\n<script>\n// In the renderer process.\n  const {desktopCapturer} = require('electron');\n  \n  desktopCapturer.getSources({types: ['window', 'screen']}, (error, sources) => {\n    if (error) throw error\n    for (let i = 0; i < sources.length; ++i) {\n      console.log(sources[i].name)\n\n      //整个桌面 Entire screen \n      if (sources[i].name.indexOf('Entire screen') > -1) {\n        navigator.mediaDevices.getUserMedia({\n          audio: false,\n          video: {\n            mandatory: {\n              chromeMediaSource: 'desktop',\n              chromeMediaSourceId: sources[i].id,\n              minWidth: 1280,\n              maxWidth: 1280,\n              minHeight: 720,\n              maxHeight: 720\n            }\n          }\n        })\n        .then((stream) => handleStream(stream))\n        .catch((e) => handleError(e))\n        return\n      }\n    }\n  })\n  \n  function handleStream (stream) {\n    const video = document.querySelector('video');\n    console.log(\"get stream\");\n    video.srcObject = stream;\n    video.onloadedmetadata = (e) => video.play()\n    console.log(\"play\");\n  }\n  \n  function handleError (e) {\n    console.log(e)\n  } \n</script>\n\n</body>\n</html>"
  },
  {
    "path": "electron/init.js",
    "content": "function init(RongIMLib,protobuf){\n\tvar appKey = \"8w7jv4qb78a9y\";\n\tvar token = \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\";\n\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\t//初始化\n\tvar config = {};\n\tif(protobuf){\n\t\tconfig.protobuf = protobuf;\n\t}\n\n\tRongIMClient.init(appKey,null,config);\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\tconsole.info(status)\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t            console.log(\"链接成功\");\n\t\t            showInfo(\"链接成功\");\n\t\t            // afterConnected();\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t            console.log('正在链接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t            console.log('断开连接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t            console.log('其他设备登录');\n\t\t            break;\n\t\t          case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t            console.log('域名不正确');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t        \tconsole.log('网络不可用');\n\t\t        \tbreak;\n\t\t        }\n\t\t}\n\t});\n\t\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    // showTips(\"新消息，类型为：\" + message.messageType);\n            // showResult(\"新消息\",message,start);\n\n\t\t    switch(message.messageType){\n\t\t        case RongIMClient.MessageType.TextMessage:\n\t\t        \t/*\n\t\t        \t显示消息方法： \n\t\t        \t消息里是 原生emoji\n\t\t        \tRongIMLib.RongIMEmoji.emojiToHTML(message.content.content);\n\t\t            */\n\t\t            break;\n\t\t        case RongIMClient.MessageType.VoiceMessage:\n\t\t            // 对声音进行预加载                \n\t\t            // message.content.content 格式为 AMR 格式的 base64 码\n\t\t            break;\n\t\t        case RongIMClient.MessageType.ImageMessage:\n\t\t           // message.content.content => 图片缩略图 base64。\n\t\t           // message.content.imageUri => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.DiscussionNotificationMessage:\n\t\t           // message.content.extension => 讨论组中的人员。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.LocationMessage:\n\t\t           // message.content.latiude => 纬度。\n\t\t           // message.content.longitude => 经度。\n\t\t           // message.content.content => 位置图片 base64。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.RichContentMessage:\n\t\t           // message.content.content => 文本消息内容。\n\t\t           // message.content.imageUri => 图片 base64。\n\t\t           // message.content.url => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.InformationNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ContactNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ProfileNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.UnknownMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        default:\n\t\t            // do something...\n\t\t    }\n\t\t}\n\t});\n\t\n\t\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t\tshowInfo(\"链接成功，用户id：\" + userId);\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\tconsole.log('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  var info = '';\n\t\t  switch (errorCode) {\n\t\t    case RongIMLib.ErrorCode.TIMEOUT:\n\t\t      info = '超时';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n\t\t      info = '未知错误';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNACCEPTABLE_PaROTOCOL_VERSION:\n\t\t      info = '不可接受的协议版本';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n\t\t      info = 'appkey不正确';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n\t\t      info = '服务器不可用';\n\t\t      break;\n\t\t  }\n\t\t  console.log(info);\n\t\t}\n\t});\n}"
  },
  {
    "path": "electron/main.js",
    "content": "const {app, BrowserWindow, ipcMain, clipboard} = require('electron')\nconst path = require('path')\n\n\n// Keep a global reference of the window object, if you don't, the window will\n// be closed automatically when the JavaScript object is garbage collected.\nlet win\n\nfunction createWindow () {\n  // Create the browser window.\n  win = new BrowserWindow({\n    width: 800, \n    height: 600\n  })\n\n  // and load the index.html of the app.\n  // win.loadURL(`file://${__dirname}/desktop_share.html`)\n\n  // win.loadURL(`file://${__dirname}/user_media.html`)\n\n  win.loadURL(`file://${__dirname}/requirejs-in-node.html`)\n  \n  // win.loadURL(`file://${__dirname}/normal.html`)\n\n  // Open the DevTools.\n  win.webContents.openDevTools()\n\n  // Emitted when the window is closed.\n  win.on('closed', () => {\n    // Dereference the window object, usually you would store windows\n    // in an array if your app supports multi windows, this is the time\n    // when you should delete the corresponding element.\n    win = null\n  })\n}\n\n\n// This method will be called when Electron has finished\n// initialization and is ready to create browser windows.\n// Some APIs can only be used after this event occurs.\napp.on('ready', function(){\n  //create window\n  createWindow();\n})\n\n// Quit when all windows are closed.\napp.on('window-all-closed', () => {\n  // On macOS it is common for applications and their menu bar\n  // to stay active until the user quits explicitly with Cmd + Q\n  if (process.platform !== 'darwin') {\n    app.quit()\n  }\n})\n\napp.on('activate', () => {\n  // On macOS it's common to re-create a window in the app when the\n  // dock icon is clicked and there are no other windows open.\n  if (win === null) {\n    createWindow()\n  }\n})\n\n// In this file you can include the rest of your app's specific main process\n// code. You can also put them in separate files and require them here."
  },
  {
    "path": "electron/normal.html",
    "content": "<!doctype html> \n<html lang=\"en\"> \n<head> \n<meta charset=\"utf-8\"> \n<title>Normal SDK</title> \n<base href=\"./\"> \n\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> \n<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\"> \n<!--基础css--> \n\n<h1>src in electron</h1>\n<p>请下载代码，修改main.js里的win.loadURL后，在本地electron里运行</p>\n<p>Electron文档：<a href=\"https://electron.atom.io/docs/\">https://electron.atom.io/docs/</a></p>\n\n\n<pre id=\"show\"></pre>\n<script> \nwindow.nodeRequire = require; \ndelete window.require;\ndelete window.exports; \ndelete window.module; \n</script> \n\n<script type=\"text/javascript\" src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script> \n\n</head> \n<body> \n<script> \n// window.require = nodeRequire; \n// const electron = require('electron'); \n// // const sqlite3 = require('sqlite3'); \n\n\n\nfunction showInfo(str){\n\tvar t = document.getElementById(\"show\");\n\t\tt.innerHTML += \"\\n\" + str;\n}\t\n</script> \n\n<script src=\"./init.js\"></script>\n\n<script>\ninit(RongIMLib);\t\n</script>\n<app-root></app-root> \n</body> \n</html> "
  },
  {
    "path": "electron/package.json",
    "content": "{\n  \"name\"    : \"your-app\",\n  \"version\" : \"0.1.0\",\n  \"main\"    : \"main.js\"\n}"
  },
  {
    "path": "electron/requirejs-in-node.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>requirejs in electron</title>\n</head>\n<body>\n<script>\nfunction showInfo(str){\n\tvar t = document.getElementById(\"show\");\n\t\tt.innerHTML += \"\\n\" + str;\n}\t\n</script>\n<h1>requirejs in electron</h1>\n<p>请下载代码，在本地electron里运行</p>\n<p>Require文档：<a href=\"http://requirejs.org/docs/node.html\">http://requirejs.org/docs/node.html</a></p>\n<p>Electron文档：<a href=\"https://electron.atom.io/docs/\">https://electron.atom.io/docs/</a></p>\n\n<pre id=\"show\"></pre>\n\n<script src=\"./init.js\"></script>\n<script>\nvar requirejs = require('requirejs');\n\nrequirejs.config({\n\t// nodeRequire: require,\n    paths: {\n    \tprotobuf: './sdk/protobuf-2.3.6.min', //only suppport local path\n    \tRongIMLib: './sdk/RongIMLib-2.5.1'\n    }\n});\n\nrequirejs(['protobuf','RongIMLib'], function(protobuf,RongIMLib) {\n    showInfo(\"require done\");\n    init(RongIMLib, protobuf);\n});\n</script>\n\n</body>\n</html>"
  },
  {
    "path": "electron/sdk/RongIMLib-2.3.3.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.1.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, groupId) {\n            if (!custId || !callback)\n                return;\n            var msg;\n            if (typeof groupId == 'undefined') {\n                msg = new RongIMLib.HandShakeMessage();\n            }\n            else {\n                msg = new RongIMLib.HandShakeMessage({ groupid: groupId });\n            }\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"boolean|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, direction);\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName));\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: true, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.3.3';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\", \"subUserStatus\", \"cleanHisMsg\"];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                        timers.length = 0;\n                        elements.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var xss = document.createElement(\"script\");\n                            xss.src = url;\n                            document.body.appendChild(xss);\n                            xss.onload = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = xss.src;\n                                callback(url);\n                            };\n                            // 此处不处理 xss.onerror 15 秒不执行 onload 自动超时\n                            elements.push(xss);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            if (temp.type != 2) {\n                //普通消息\n                time = RongIMLib.RongIMClient._storageProvider.getItem(this.userId) || '0';\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    if (str == \"chrmPull\") {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //防止因离线消息造成会话列表不为空而无法从服务器拉取会话列表。\n                    //offlineMsg && (RongIMClient._memoryStore.isSyncRemoteConverList = true);\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        if (!(list[i].msgId in me.cacheMessageIds)) {\n                            count -= 1;\n                            var message = list[i];\n                            var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                            if (sentTime > time) {\n                                Bridge._client.handler.onReceived(message, undefined, offlineMsg, count);\n                                var arrLen = me.cacheMessageIds.unshift(list[i].msgId);\n                                if (arrLen > 20) {\n                                    me.cacheMessageIds.length = 20;\n                                }\n                            }\n                        }\n                    }\n                    var isPullFinished = collection.finished;\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    if (!RongIMLib.RongIMClient._memoryStore.isPullFinished) {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n            if (isSend) {\n                var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                var userId = RongIMLib.Bridge._client.userId;\n                var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                if (message.sentTime <= lastSentTime && !isSync) {\n                    return;\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function (con) {\n                        if (!con) {\n                            con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                        }\n                        if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                            var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                            var key = message.conversationType + '_' + message.targetId, info = {};\n                            if (message.content && message.content.mentionedInfo) {\n                                info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                                mentioneds = JSON.stringify(info);\n                            }\n                            if (mentioneds) {\n                                var info = JSON.parse(mentioneds);\n                                con.mentionedMsg = info[key];\n                            }\n                        }\n                        if (con.conversationType != 0 && message.senderUserId != Bridge._client.userId && message.receivedStatus != RongIMLib.ReceivedStatus.RETRIEVED && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                            con.unreadMessageCount = con.unreadMessageCount + 1;\n                            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                                var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, Number(count) + 1);\n                            }\n                        }\n                        con.receivedTime = new Date().getTime();\n                        con.receivedStatus = message.receivedStatus;\n                        con.senderUserId = message.sendUserId;\n                        con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                        con.latestMessageId = message.messageId;\n                        con.latestMessage = message;\n                        con.sentTime = message.sentTime;\n                        RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n                    },\n                    onError: function (error) { }\n                });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var lcount = leftCount || 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addMessage(message.conversationType, message.targetId, message, {\n                    onSuccess: function (ret) {\n                        setTimeout(function () {\n                            that._onReceived(ret, lcount);\n                        });\n                    },\n                    onError: function (error) {\n                        setTimeout(function () {\n                            that._onReceived(message, lcount);\n                        });\n                    }\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(self.pottingProfile(item), 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var userId = RongIMLib.Bridge._client.userId;\n                var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                stroageProvider.setItem(userId, timestamp);\n                stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                RongIMLib.RongIMClient._memoryStore.lastReadTime.get(userId, timestamp);\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().getServerEndpoint(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && _client.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.RongIMClient._memoryStore.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RCE:UpdateStatus\": \"RCEUpdateStatusMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            message && (this.groupid = message.groupid);\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            var getKey = function () {\n                return [conversationType, targetId].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            if (!isFecth) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMessageInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setDataTime(timestamp);\n            modules.setSize(count);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(conversationType + targetId, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    if (conversationTypes) {\n                        var convers = [];\n                        Array.forEach(conversationTypes, function (converType) {\n                            Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                                if (item.conversationType == converType) {\n                                    convers.push(item);\n                                }\n                            });\n                        });\n                        setTimeout(function () {\n                            callback.onSuccess(convers);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    msg.messageUId = _msg.messageUId;\n                    msg.sentTime = _msg.sentTime;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                setTimeout(function () {\n                    callback.onSuccess(list);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            if (conversationTypes) {\n                for (var i = 0, len = conversationTypes.length; i < len; i++) {\n                    Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                        if (conver.conversationType == conversationTypes[i]) {\n                            count += conver.unreadMessageCount;\n                        }\n                    });\n                }\n            }\n            else {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    count += conver.unreadMessageCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver ? conver.unreadMessageCount : 0);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        conver.mentionedMsg = null;\n                        var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                        if (mentioneds) {\n                            var info = JSON.parse(mentioneds);\n                            delete info[conversationType + \"_\" + targetId];\n                            if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                            }\n                            else {\n                                RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                            }\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount) {\n                var message = me.buildMessage(result);\n                if ((leftCount == 0 && localCount == 1) || leftCount > 0) {\n                    message.offLineMessage = true;\n                }\n                else {\n                    message.offLineMessage = false;\n                }\n                localCount = leftCount;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key, obj);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "electron/sdk/RongIMLib-2.5.1.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.6.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n            this.socket.fire(\"disconnect\", code);\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            modules.setRoomType(0);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            this.observers.push(observer);\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "electron/sdk/init.js",
    "content": "function init(RongIMLib,protobuf){\n\tvar appKey = \"8w7jv4qb78a9y\";\n\tvar token = \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\";\n\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\t//初始化\n\tvar config = {};\n\tif(protobuf){\n\t\tconfig.protobuf = protobuf;\n\t}\n\n\tRongIMClient.init(appKey,null,config);\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\tconsole.info(status)\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t            console.log(\"链接成功\");\n\t\t            showInfo(\"链接成功\");\n\t\t            // afterConnected();\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t            console.log('正在链接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t            console.log('断开连接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t            console.log('其他设备登录');\n\t\t            break;\n\t\t          case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t            console.log('域名不正确');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t        \tconsole.log('网络不可用');\n\t\t        \tbreak;\n\t\t        }\n\t\t}\n\t});\n\t\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    // showTips(\"新消息，类型为：\" + message.messageType);\n            // showResult(\"新消息\",message,start);\n\n\t\t    switch(message.messageType){\n\t\t        case RongIMClient.MessageType.TextMessage:\n\t\t        \t/*\n\t\t        \t显示消息方法： \n\t\t        \t消息里是 原生emoji\n\t\t        \tRongIMLib.RongIMEmoji.emojiToHTML(message.content.content);\n\t\t            */\n\t\t            break;\n\t\t        case RongIMClient.MessageType.VoiceMessage:\n\t\t            // 对声音进行预加载                \n\t\t            // message.content.content 格式为 AMR 格式的 base64 码\n\t\t            break;\n\t\t        case RongIMClient.MessageType.ImageMessage:\n\t\t           // message.content.content => 图片缩略图 base64。\n\t\t           // message.content.imageUri => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.DiscussionNotificationMessage:\n\t\t           // message.content.extension => 讨论组中的人员。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.LocationMessage:\n\t\t           // message.content.latiude => 纬度。\n\t\t           // message.content.longitude => 经度。\n\t\t           // message.content.content => 位置图片 base64。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.RichContentMessage:\n\t\t           // message.content.content => 文本消息内容。\n\t\t           // message.content.imageUri => 图片 base64。\n\t\t           // message.content.url => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.InformationNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ContactNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ProfileNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.UnknownMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        default:\n\t\t            // do something...\n\t\t    }\n\t\t}\n\t});\n\t\n\tfunction getConversationList(){\n\t\tRongIMClient.getInstance().getConversationList({\n\t\t\t\tonSuccess: function(list){\n\t\t\t\t\tshowInfo(JSON.stringify(list, null, '\\t'));\n\t\t\t\t},\n\t\t\t\tonError:function(errorCode){\n\t\t\t\t\t showInfo(errorCode);\n\t\t\t\t}\n\t\t\t}, null, 2);\n\t}\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t\tshowInfo(\"链接成功，用户id：\" + userId);\n\t\t\tgetConversationList();\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\tconsole.log('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  var info = '';\n\t\t  switch (errorCode) {\n\t\t    case RongIMLib.ErrorCode.TIMEOUT:\n\t\t      info = '超时';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n\t\t      info = '未知错误';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNACCEPTABLE_PaROTOCOL_VERSION:\n\t\t      info = '不可接受的协议版本';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n\t\t      info = 'appkey不正确';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n\t\t      info = '服务器不可用';\n\t\t      break;\n\t\t  }\n\t\t  console.log(info);\n\t\t}\n\t});\n}"
  },
  {
    "path": "electron/user_media.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>user media</title>\n</head>\n\n<body>\n\n<h1>获取摄像头</h1>\n\n<section id=\"app\" hidden>\n\t<video id=\"show\" autoplay></video>\n</section>\n\n<script>\nfunction init(){\n\tvar video = document.getElementById(\"show\");\n\tvar app = document.getElementById(\"app\");\n\n\tnavigator.getUserMedia({audio:true, video:true}, gotStream, function(err){\n\t\tconsole.log(\"获取摄像头失败\");\n\t\tconsole.log(err);\n\t});\n\n\tfunction gotStream(stream) {\n\t\tvideo.src = URL.createObjectURL(stream);\n\t\tapp.hidden = false;\n\t}\n}\n</script>\n\n<script>\ninit();\t\n</script>\n</body>\n</html>\n"
  },
  {
    "path": "electron-vue/.babelrc",
    "content": "{\n  \"comments\": false,\n  \"env\": {\n    \"test\": {\n      \"presets\": [\n        [\"env\", {\n          \"targets\": { \"node\": 7 }\n        }],\n        \"stage-0\"\n      ],\n      \"plugins\": [\"istanbul\"]\n    },\n    \"main\": {\n      \"presets\": [\n        [\"env\", {\n          \"targets\": { \"node\": 7 }\n        }],\n        \"stage-0\"\n      ]\n    },\n    \"renderer\": {\n      \"presets\": [\n        [\"env\", {\n          \"modules\": false\n        }],\n        \"stage-0\"\n      ]\n    },\n    \"web\": {\n      \"presets\": [\n        [\"env\", {\n          \"modules\": false\n        }],\n        \"stage-0\"\n      ]\n    }\n  },\n  \"plugins\": [\"transform-runtime\"]\n}\n"
  },
  {
    "path": "electron-vue/.electron-vue/build.js",
    "content": "'use strict'\n\nprocess.env.NODE_ENV = 'production'\n\nconst { say } = require('cfonts')\nconst chalk = require('chalk')\nconst del = require('del')\nconst { spawn } = require('child_process')\nconst webpack = require('webpack')\nconst Multispinner = require('multispinner')\n\n\nconst mainConfig = require('./webpack.main.config')\nconst rendererConfig = require('./webpack.renderer.config')\nconst webConfig = require('./webpack.web.config')\n\nconst doneLog = chalk.bgGreen.white(' DONE ') + ' '\nconst errorLog = chalk.bgRed.white(' ERROR ') + ' '\nconst okayLog = chalk.bgBlue.white(' OKAY ') + ' '\nconst isCI = process.env.CI || false\n\nif (process.env.BUILD_TARGET === 'clean') clean()\nelse if (process.env.BUILD_TARGET === 'web') web()\nelse build()\n\nfunction clean () {\n  del.sync(['build/*', '!build/icons', '!build/icons/icon.*'])\n  console.log(`\\n${doneLog}\\n`)\n  process.exit()\n}\n\nfunction build () {\n  greeting()\n\n  del.sync(['dist/electron/*', '!.gitkeep'])\n\n  const tasks = ['main', 'renderer']\n  const m = new Multispinner(tasks, {\n    preText: 'building',\n    postText: 'process'\n  })\n\n  let results = ''\n\n  m.on('success', () => {\n    process.stdout.write('\\x1B[2J\\x1B[0f')\n    console.log(`\\n\\n${results}`)\n    console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\\n`)\n    process.exit()\n  })\n\n  pack(mainConfig).then(result => {\n    results += result + '\\n\\n'\n    m.success('main')\n  }).catch(err => {\n    m.error('main')\n    console.log(`\\n  ${errorLog}failed to build main process`)\n    console.error(`\\n${err}\\n`)\n    process.exit(1)\n  })\n\n  pack(rendererConfig).then(result => {\n    results += result + '\\n\\n'\n    m.success('renderer')\n  }).catch(err => {\n    m.error('renderer')\n    console.log(`\\n  ${errorLog}failed to build renderer process`)\n    console.error(`\\n${err}\\n`)\n    process.exit(1)\n  })\n}\n\nfunction pack (config) {\n  return new Promise((resolve, reject) => {\n    config.mode = 'production'\n    webpack(config, (err, stats) => {\n      if (err) reject(err.stack || err)\n      else if (stats.hasErrors()) {\n        let err = ''\n\n        stats.toString({\n          chunks: false,\n          colors: true\n        })\n        .split(/\\r?\\n/)\n        .forEach(line => {\n          err += `    ${line}\\n`\n        })\n\n        reject(err)\n      } else {\n        resolve(stats.toString({\n          chunks: false,\n          colors: true\n        }))\n      }\n    })\n  })\n}\n\nfunction web () {\n  del.sync(['dist/web/*', '!.gitkeep'])\n  webConfig.mode = 'production'\n  webpack(webConfig, (err, stats) => {\n    if (err || stats.hasErrors()) console.log(err)\n\n    console.log(stats.toString({\n      chunks: false,\n      colors: true\n    }))\n\n    process.exit()\n  })\n}\n\nfunction greeting () {\n  const cols = process.stdout.columns\n  let text = ''\n\n  if (cols > 85) text = 'lets-build'\n  else if (cols > 60) text = 'lets-|build'\n  else text = false\n\n  if (text && !isCI) {\n    say(text, {\n      colors: ['yellow'],\n      font: 'simple3d',\n      space: false\n    })\n  } else console.log(chalk.yellow.bold('\\n  lets-build'))\n  console.log()\n}"
  },
  {
    "path": "electron-vue/.electron-vue/dev-client.js",
    "content": "const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')\n\nhotClient.subscribe(event => {\n  /**\n   * Reload browser when HTMLWebpackPlugin emits a new index.html\n   *\n   * Currently disabled until jantimon/html-webpack-plugin#680 is resolved.\n   * https://github.com/SimulatedGREG/electron-vue/issues/437\n   * https://github.com/jantimon/html-webpack-plugin/issues/680\n   */\n  // if (event.action === 'reload') {\n  //   window.location.reload()\n  // }\n\n  /**\n   * Notify `mainWindow` when `main` process is compiling,\n   * giving notice for an expected reload of the `electron` process\n   */\n  if (event.action === 'compiling') {\n    document.body.innerHTML += `\n      <style>\n        #dev-client {\n          background: #4fc08d;\n          border-radius: 4px;\n          bottom: 20px;\n          box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);\n          color: #fff;\n          font-family: 'Source Sans Pro', sans-serif;\n          left: 20px;\n          padding: 8px 12px;\n          position: absolute;\n        }\n      </style>\n\n      <div id=\"dev-client\">\n        Compiling Main Process...\n      </div>\n    `\n  }\n})\n"
  },
  {
    "path": "electron-vue/.electron-vue/dev-runner.js",
    "content": "'use strict'\n\nconst chalk = require('chalk')\nconst electron = require('electron')\nconst path = require('path')\nconst { say } = require('cfonts')\nconst { spawn } = require('child_process')\nconst webpack = require('webpack')\nconst WebpackDevServer = require('webpack-dev-server')\nconst webpackHotMiddleware = require('webpack-hot-middleware')\n\nconst mainConfig = require('./webpack.main.config')\nconst rendererConfig = require('./webpack.renderer.config')\n\nlet electronProcess = null\nlet manualRestart = false\nlet hotMiddleware\n\nfunction logStats (proc, data) {\n  let log = ''\n\n  log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`)\n  log += '\\n\\n'\n\n  if (typeof data === 'object') {\n    data.toString({\n      colors: true,\n      chunks: false\n    }).split(/\\r?\\n/).forEach(line => {\n      log += '  ' + line + '\\n'\n    })\n  } else {\n    log += `  ${data}\\n`\n  }\n\n  log += '\\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\\n'\n\n  console.log(log)\n}\n\nfunction startRenderer () {\n  return new Promise((resolve, reject) => {\n    rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)\n    rendererConfig.mode = 'development'\n    const compiler = webpack(rendererConfig)\n    hotMiddleware = webpackHotMiddleware(compiler, {\n      log: false,\n      heartbeat: 2500\n    })\n\n    compiler.hooks.compilation.tap('compilation', compilation => {\n      compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {\n        hotMiddleware.publish({ action: 'reload' })\n        cb()\n      })\n    })\n\n    compiler.hooks.done.tap('done', stats => {\n      logStats('Renderer', stats)\n    })\n\n    const server = new WebpackDevServer(\n      compiler,\n      {\n        contentBase: path.join(__dirname, '../'),\n        quiet: true,\n        before (app, ctx) {\n          app.use(hotMiddleware)\n          ctx.middleware.waitUntilValid(() => {\n            resolve()\n          })\n        }\n      }\n    )\n\n    server.listen(9080)\n  })\n}\n\nfunction startMain () {\n  return new Promise((resolve, reject) => {\n    mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)\n    mainConfig.mode = 'development'\n    const compiler = webpack(mainConfig)\n\n    compiler.hooks.watchRun.tapAsync('watch-run', (compilation, done) => {\n      logStats('Main', chalk.white.bold('compiling...'))\n      hotMiddleware.publish({ action: 'compiling' })\n      done()\n    })\n\n    compiler.watch({}, (err, stats) => {\n      if (err) {\n        console.log(err)\n        return\n      }\n\n      logStats('Main', stats)\n\n      if (electronProcess && electronProcess.kill) {\n        manualRestart = true\n        process.kill(electronProcess.pid)\n        electronProcess = null\n        startElectron()\n\n        setTimeout(() => {\n          manualRestart = false\n        }, 5000)\n      }\n\n      resolve()\n    })\n  })\n}\n\nfunction startElectron () {\n  var args = [\n    '--inspect=5858',\n    path.join(__dirname, '../dist/electron/main.js')\n  ]\n\n  // detect yarn or npm and process commandline args accordingly\n  if (process.env.npm_execpath.endsWith('yarn.js')) {\n    args = args.concat(process.argv.slice(3))\n  } else if (process.env.npm_execpath.endsWith('npm-cli.js')) {\n    args = args.concat(process.argv.slice(2))\n  }\n\n  electronProcess = spawn(electron, args)\n  \n  electronProcess.stdout.on('data', data => {\n    electronLog(data, 'blue')\n  })\n  electronProcess.stderr.on('data', data => {\n    electronLog(data, 'red')\n  })\n\n  electronProcess.on('close', () => {\n    if (!manualRestart) process.exit()\n  })\n}\n\nfunction electronLog (data, color) {\n  let log = ''\n  data = data.toString().split(/\\r?\\n/)\n  data.forEach(line => {\n    log += `  ${line}\\n`\n  })\n  if (/[0-9A-z]+/.test(log)) {\n    console.log(\n      chalk[color].bold('┏ Electron -------------------') +\n      '\\n\\n' +\n      log +\n      chalk[color].bold('┗ ----------------------------') +\n      '\\n'\n    )\n  }\n}\n\nfunction greeting () {\n  const cols = process.stdout.columns\n  let text = ''\n\n  if (cols > 104) text = 'electron-vue'\n  else if (cols > 76) text = 'electron-|vue'\n  else text = false\n\n  if (text) {\n    say(text, {\n      colors: ['yellow'],\n      font: 'simple3d',\n      space: false\n    })\n  } else console.log(chalk.yellow.bold('\\n  electron-vue'))\n  console.log(chalk.blue('  getting ready...') + '\\n')\n}\n\nfunction init () {\n  greeting()\n\n  Promise.all([startRenderer(), startMain()])\n    .then(() => {\n      startElectron()\n    })\n    .catch(err => {\n      console.error(err)\n    })\n}\n\ninit()\n"
  },
  {
    "path": "electron-vue/.electron-vue/webpack.main.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'main'\n\nconst path = require('path')\nconst { dependencies } = require('../package.json')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\n\nlet mainConfig = {\n  entry: {\n    main: path.join(__dirname, '../src/main/index.js')\n  },\n  externals: [\n    ...Object.keys(dependencies || {})\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(js)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.node$/,\n        use: 'node-loader'\n      }\n    ]\n  },\n  node: {\n    __dirname: process.env.NODE_ENV !== 'production',\n    __filename: process.env.NODE_ENV !== 'production'\n  },\n  output: {\n    filename: '[name].js',\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '../dist/electron')\n  },\n  plugins: [\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  resolve: {\n    extensions: ['.js', '.json', '.node']\n  },\n  target: 'electron-main'\n}\n\n/**\n * Adjust mainConfig for development settings\n */\nif (process.env.NODE_ENV !== 'production') {\n  mainConfig.plugins.push(\n    new webpack.DefinePlugin({\n      '__static': `\"${path.join(__dirname, '../static').replace(/\\\\/g, '\\\\\\\\')}\"`\n    })\n  )\n}\n\n/**\n * Adjust mainConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  mainConfig.plugins.push(\n    new BabiliWebpackPlugin(),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    })\n  )\n}\n\nmodule.exports = mainConfig\n"
  },
  {
    "path": "electron-vue/.electron-vue/webpack.renderer.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'renderer'\n\nconst path = require('path')\nconst { dependencies } = require('../package.json')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst { VueLoaderPlugin } = require('vue-loader')\n\n/**\n * List of node_modules to include in webpack bundle\n *\n * Required for specific packages like Vue UI libraries\n * that provide pure *.vue files that need compiling\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals\n */\nlet whiteListedModules = ['vue']\n\nlet rendererConfig = {\n  devtool: '#cheap-module-eval-source-map',\n  entry: {\n    renderer: path.join(__dirname, '../src/renderer/main.js')\n  },\n  externals: [\n    ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(js|vue)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.scss$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader']\n      },\n      {\n        test: /\\.sass$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']\n      },\n      {\n        test: /\\.less$/,\n        use: ['vue-style-loader', 'css-loader', 'less-loader']\n      },\n      {\n        test: /\\.css$/,\n        use: ['vue-style-loader', 'css-loader']\n      },\n      {\n        test: /\\.html$/,\n        use: 'vue-html-loader'\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.node$/,\n        use: 'node-loader'\n      },\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            extractCSS: process.env.NODE_ENV === 'production',\n            loaders: {\n              sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',\n              scss: 'vue-style-loader!css-loader!sass-loader',\n              less: 'vue-style-loader!css-loader!less-loader'\n            }\n          }\n        }\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'imgs/[name]--[folder].[ext]'\n          }\n        }\n      },\n      {\n        test: /\\.(mp4|webm|ogg|mp3|wav|flac|aac)(\\?.*)?$/,\n        loader: 'url-loader',\n        options: {\n          limit: 10000,\n          name: 'media/[name]--[folder].[ext]'\n        }\n      },\n      {\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'fonts/[name]--[folder].[ext]'\n          }\n        }\n      }\n    ]\n  },\n  node: {\n    __dirname: process.env.NODE_ENV !== 'production',\n    __filename: process.env.NODE_ENV !== 'production'\n  },\n  plugins: [\n    new VueLoaderPlugin(),\n    new MiniCssExtractPlugin({filename: 'styles.css'}),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: path.resolve(__dirname, '../src/index.ejs'),\n      minify: {\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true\n      },\n      nodeModules: process.env.NODE_ENV !== 'production'\n        ? path.resolve(__dirname, '../node_modules')\n        : false\n    }),\n    new webpack.HotModuleReplacementPlugin(),\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  output: {\n    filename: '[name].js',\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '../dist/electron')\n  },\n  resolve: {\n    alias: {\n      '@': path.join(__dirname, '../src/renderer'),\n      'vue$': 'vue/dist/vue.esm.js'\n    },\n    extensions: ['.js', '.vue', '.json', '.css', '.node']\n  },\n  target: 'electron-renderer'\n}\n\n/**\n * Adjust rendererConfig for development settings\n */\nif (process.env.NODE_ENV !== 'production') {\n  rendererConfig.plugins.push(\n    new webpack.DefinePlugin({\n      '__static': `\"${path.join(__dirname, '../static').replace(/\\\\/g, '\\\\\\\\')}\"`\n    })\n  )\n}\n\n/**\n * Adjust rendererConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  rendererConfig.devtool = ''\n\n  rendererConfig.plugins.push(\n    new BabiliWebpackPlugin(),\n    new CopyWebpackPlugin([\n      {\n        from: path.join(__dirname, '../static'),\n        to: path.join(__dirname, '../dist/electron/static'),\n        ignore: ['.*']\n      }\n    ]),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    }),\n    new webpack.LoaderOptionsPlugin({\n      minimize: true\n    })\n  )\n}\n\nmodule.exports = rendererConfig\n"
  },
  {
    "path": "electron-vue/.electron-vue/webpack.web.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'web'\n\nconst path = require('path')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst { VueLoaderPlugin } = require('vue-loader')\n\nlet webConfig = {\n  devtool: '#cheap-module-eval-source-map',\n  entry: {\n    web: path.join(__dirname, '../src/renderer/main.js')\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.(js|vue)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.scss$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader']\n      },\n      {\n        test: /\\.sass$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']\n      },\n      {\n        test: /\\.less$/,\n        use: ['vue-style-loader', 'css-loader', 'less-loader']\n      },\n      {\n        test: /\\.css$/,\n        use: ['vue-style-loader', 'css-loader']\n      },\n      {\n        test: /\\.html$/,\n        use: 'vue-html-loader'\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        include: [ path.resolve(__dirname, '../src/renderer') ],\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            extractCSS: true,\n            loaders: {\n              sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',\n              scss: 'vue-style-loader!css-loader!sass-loader',\n              less: 'vue-style-loader!css-loader!less-loader'\n            }\n          }\n        }\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'imgs/[name].[ext]'\n          }\n        }\n      },\n      {\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'fonts/[name].[ext]'\n          }\n        }\n      }\n    ]\n  },\n  plugins: [\n    new VueLoaderPlugin(),\n    new MiniCssExtractPlugin({filename: 'styles.css'}),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: path.resolve(__dirname, '../src/index.ejs'),\n      minify: {\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true\n      },\n      nodeModules: false\n    }),\n    new webpack.DefinePlugin({\n      'process.env.IS_WEB': 'true'\n    }),\n    new webpack.HotModuleReplacementPlugin(),\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  output: {\n    filename: '[name].js',\n    path: path.join(__dirname, '../dist/web')\n  },\n  resolve: {\n    alias: {\n      '@': path.join(__dirname, '../src/renderer'),\n      'vue$': 'vue/dist/vue.esm.js'\n    },\n    extensions: ['.js', '.vue', '.json', '.css']\n  },\n  target: 'web'\n}\n\n/**\n * Adjust webConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  webConfig.devtool = ''\n\n  webConfig.plugins.push(\n    new BabiliWebpackPlugin(),\n    new CopyWebpackPlugin([\n      {\n        from: path.join(__dirname, '../static'),\n        to: path.join(__dirname, '../dist/web/static'),\n        ignore: ['.*']\n      }\n    ]),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    }),\n    new webpack.LoaderOptionsPlugin({\n      minimize: true\n    })\n  )\n}\n\nmodule.exports = webConfig\n"
  },
  {
    "path": "electron-vue/.eslintignore",
    "content": "test/unit/coverage/**\ntest/unit/*.js\ntest/e2e/*.js\nstatic/js/RongIMLib-2.5.0.js\nstatic/js/protobuf-2.3.3.min.js\nstatic/js/protobuf-2.3.4.min.js\nstatic/js/*.js\n"
  },
  {
    "path": "electron-vue/.eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  parser: 'babel-eslint',\n  parserOptions: {\n    sourceType: 'module'\n  },\n  env: {\n    browser: true,\n    node: true\n  },\n  extends: 'standard',\n  globals: {\n    __static: true\n  },\n  plugins: [\n    'html'\n  ],\n  'rules': {\n    // allow paren-less arrow functions\n    'arrow-parens': 0,\n    // allow async-await\n    'generator-star-spacing': 0,\n    // allow debugger during development\n    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0\n  }\n}\n"
  },
  {
    "path": "electron-vue/.gitignore",
    "content": ".DS_Store\ndist/electron/*\ndist/web/*\nbuild/*\n!build/icons\ncoverage\nnode_modules/\nnpm-debug.log\nnpm-debug.log.*\nthumbs.db\n!.gitkeep\npackage-lock.json"
  },
  {
    "path": "electron-vue/.travis.yml",
    "content": "# Commented sections below can be used to run tests on the CI server\n# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing\nosx_image: xcode8.3\nsudo: required\ndist: trusty\nlanguage: c\nmatrix:\n  include:\n  - os: osx\n  - os: linux\n    env: CC=clang CXX=clang++ npm_config_clang=1\n    compiler: clang\ncache:\n  directories:\n  - node_modules\n  - \"$HOME/.electron\"\n  - \"$HOME/.cache\"\naddons:\n  apt:\n    packages:\n    - libgnome-keyring-dev\n    - icnsutils\n    #- xvfb\nbefore_install:\n- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([\n  \"$TRAVIS_OS_NAME\" == \"linux\" ] && echo \"linux\" || echo \"darwin\")-amd64-1.2.1.tar.gz\n  | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull\n- if [[ \"$TRAVIS_OS_NAME\" == \"linux\" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi\ninstall:\n#- export DISPLAY=':99.0'\n#- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n- nvm install 7\n- curl -o- -L https://yarnpkg.com/install.sh | bash\n- source ~/.bashrc\n- npm install -g xvfb-maybe\n- yarn\nscript:\n#- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js\n#- yarn run pack && xvfb-maybe node_modules/.bin/mocha test/e2e\n- yarn run build\nbranches:\n  only:\n  - master\n"
  },
  {
    "path": "electron-vue/README.md",
    "content": "### electron-vue 引入 websdk\n\n`注:` [electron-vue](https://github.com/SimulatedGREG/electron-vue) 本身已经长时间不维护, 且 issues 无人处理. 正常情况下, 不建议使用. 如集成桌面版项目, 可直接使用 [electron](https://www.electronjs.org/) 和 [vue](https://cn.vuejs.org/)\n\n#### 开发环境\n\nnode 8.12.0 及以上版本\n\n#### 启动\n\n1、安装依赖包\n\n```\nnpm install electron@2.0.4 --save-dev\nnpm install\n```\n\n2、运行\n\n```\nnpm run dev\n```\n\n3、打包\n\n```\nnpm run build\n```\n\n#### 相关文件\n\n```\nsrc/renderer/components/init.vue\n```\n\n#### 注意\n\n1、此 Demo 仅为 electron-vue 引入融云 websdk 示例, 非完整项目\n\n2、electron-vue 具体环境安装、打包配置等问题, 请参考 [electron-vue](https://github.com/SimulatedGREG/electron-vue) 文档\n\n3、使用 electron-vue 时, 为避免遇到问题无排查方向, 建议提前了解以下知识:\n\n> Electron: [https://electronjs.org/docs](https://electronjs.org/docs)\n\n> electron-builder: [https://github.com/electron-userland/electron-builder](https://github.com/electron-userland/electron-builder)\n\n> Vue.js: [https://cn.vuejs.org](https://cn.vuejs.org)\n\n> webpack: [https://webpack.js.org](https://webpack.js.org)\n\n"
  },
  {
    "path": "electron-vue/appveyor.yml",
    "content": "# Commented sections below can be used to run tests on the CI server\n# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing\nversion: 0.1.{build}\n\nbranches:\n  only:\n    - master\n\nimage: Visual Studio 2017\nplatform:\n  - x64\n\ncache:\n  - node_modules\n  - '%APPDATA%\\npm-cache'\n  - '%USERPROFILE%\\.electron'\n  - '%USERPROFILE%\\AppData\\Local\\Yarn\\cache'\n\ninit:\n  - git config --global core.autocrlf input\n\ninstall:\n  - ps: Install-Product node 8 x64\n  - git reset --hard HEAD\n  - yarn\n  - node --version\n\nbuild_script:\n  #- yarn test\n  - yarn build\n\ntest: off\n"
  },
  {
    "path": "electron-vue/package.json",
    "content": "{\n  \"name\": \"rong-test\",\n  \"version\": \"1.0.0\",\n  \"author\": \"wangyonghao <wangyonghao@rongcloud.cn>\",\n  \"description\": \"An electron-vue project\",\n  \"license\": null,\n  \"main\": \"./dist/electron/main.js\",\n  \"scripts\": {\n    \"build\": \"node .electron-vue/build.js && electron-builder\",\n    \"build:dir\": \"node .electron-vue/build.js && electron-builder --dir\",\n    \"build:clean\": \"cross-env BUILD_TARGET=clean node .electron-vue/build.js\",\n    \"build:web\": \"cross-env BUILD_TARGET=web node .electron-vue/build.js\",\n    \"dev\": \"node .electron-vue/dev-runner.js\",\n    \"e2e\": \"npm run pack && mocha test/e2e\",\n    \"lint\": \"eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test\",\n    \"lint:fix\": \"eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test\",\n    \"pack\": \"npm run pack:main && npm run pack:renderer\",\n    \"pack:main\": \"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js\",\n    \"pack:renderer\": \"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js\",\n    \"test\": \"npm run unit && npm run e2e\",\n    \"unit\": \"karma start test/unit/karma.conf.js\",\n    \"postinstall\": \"npm run lint:fix\"\n  },\n  \"build\": {\n    \"productName\": \"rong-test\",\n    \"appId\": \"com.example.yourapp\",\n    \"directories\": {\n      \"output\": \"build\"\n    },\n    \"files\": [\n      \"dist/electron/**/*\"\n    ],\n    \"dmg\": {\n      \"contents\": [\n        {\n          \"x\": 410,\n          \"y\": 150,\n          \"type\": \"link\",\n          \"path\": \"/Applications\"\n        },\n        {\n          \"x\": 130,\n          \"y\": 150,\n          \"type\": \"file\"\n        }\n      ]\n    },\n    \"mac\": {\n      \"icon\": \"build/icons/icon.icns\"\n    },\n    \"win\": {\n      \"icon\": \"build/icons/icon.ico\"\n    },\n    \"linux\": {\n      \"icon\": \"build/icons\"\n    }\n  },\n  \"dependencies\": {\n    \"vue\": \"^2.5.16\",\n    \"axios\": \"^0.21.1\",\n    \"vue-electron\": \"^1.0.6\",\n    \"vue-router\": \"^3.0.1\",\n    \"vuex\": \"^3.0.1\",\n    \"vuex-electron\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"ajv\": \"^6.5.0\",\n    \"babel-core\": \"^6.26.3\",\n    \"babel-eslint\": \"^8.2.3\",\n    \"babel-loader\": \"^7.1.4\",\n    \"babel-plugin-istanbul\": \"^4.1.6\",\n    \"babel-plugin-transform-runtime\": \"^6.23.0\",\n    \"babel-preset-env\": \"^1.7.0\",\n    \"babel-preset-stage-0\": \"^6.24.1\",\n    \"babel-register\": \"^6.26.0\",\n    \"babili-webpack-plugin\": \"^0.1.2\",\n    \"cfonts\": \"^2.1.2\",\n    \"chai\": \"^4.1.2\",\n    \"chalk\": \"^2.4.1\",\n    \"copy-webpack-plugin\": \"^4.5.1\",\n    \"cross-env\": \"^5.1.6\",\n    \"css-loader\": \"^0.28.11\",\n    \"del\": \"^3.0.0\",\n    \"devtron\": \"^1.4.0\",\n    \"electron-builder\": \"^20.19.2\",\n    \"electron-debug\": \"^1.5.0\",\n    \"electron-devtools-installer\": \"^2.2.4\",\n    \"eslint\": \"^4.19.1\",\n    \"eslint-config-standard\": \"^11.0.0\",\n    \"eslint-friendly-formatter\": \"^4.0.1\",\n    \"eslint-loader\": \"^2.0.0\",\n    \"eslint-plugin-html\": \"^4.0.3\",\n    \"eslint-plugin-import\": \"^2.12.0\",\n    \"eslint-plugin-node\": \"^6.0.1\",\n    \"eslint-plugin-promise\": \"^3.8.0\",\n    \"eslint-plugin-standard\": \"^3.1.0\",\n    \"file-loader\": \"^1.1.11\",\n    \"html-webpack-plugin\": \"^3.2.0\",\n    \"inject-loader\": \"^4.0.1\",\n    \"karma\": \"^2.0.2\",\n    \"karma-chai\": \"^0.1.0\",\n    \"karma-coverage\": \"^1.1.2\",\n    \"karma-electron\": \"^6.0.0\",\n    \"karma-mocha\": \"^1.3.0\",\n    \"karma-sourcemap-loader\": \"^0.3.7\",\n    \"karma-spec-reporter\": \"^0.0.32\",\n    \"karma-webpack\": \"^3.0.0\",\n    \"mini-css-extract-plugin\": \"0.4.0\",\n    \"mocha\": \"^5.2.0\",\n    \"multispinner\": \"^0.2.1\",\n    \"node-loader\": \"^0.6.0\",\n    \"node-sass\": \"^4.9.2\",\n    \"require-dir\": \"^1.0.0\",\n    \"sass-loader\": \"^7.0.3\",\n    \"spectron\": \"^3.8.0\",\n    \"style-loader\": \"^0.21.0\",\n    \"url-loader\": \"^1.0.1\",\n    \"vue-html-loader\": \"^1.2.4\",\n    \"vue-loader\": \"^15.2.4\",\n    \"vue-style-loader\": \"^4.1.0\",\n    \"vue-template-compiler\": \"^2.5.16\",\n    \"webpack\": \"^4.15.1\",\n    \"webpack-cli\": \"^3.0.8\",\n    \"webpack-dev-server\": \"^3.1.4\",\n    \"webpack-hot-middleware\": \"^2.22.2\",\n    \"webpack-merge\": \"^4.1.3\"\n  }\n}\n"
  },
  {
    "path": "electron-vue/src/index.ejs",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>rong-test</title>\n    <% if (htmlWebpackPlugin.options.nodeModules) { %>\n      <!-- Add `node_modules/` to global paths so `require` works properly in development -->\n      <script>\n        require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\\\/g, '\\\\\\\\') %>')\n      </script>\n    <% } %>\n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <!-- Set `__static` path to static files in production -->\n    <% if (!process.browser) { %>\n      <script>\n        if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\')\n      </script>\n    <% } %>\n\n    <!-- webpack builds are automatically injected -->\n  </body>\n</html>\n"
  },
  {
    "path": "electron-vue/src/main/index.dev.js",
    "content": "/**\n * This file is used specifically and only for development. It installs\n * `electron-debug` & `vue-devtools`. There shouldn't be any need to\n *  modify this file, but it can be used to extend your development\n *  environment.\n */\n\n/* eslint-disable */\n\n// Install `electron-debug` with `devtron`\nrequire('electron-debug')({ showDevTools: true })\n\n// Install `vue-devtools`\nrequire('electron').app.on('ready', () => {\n  let installExtension = require('electron-devtools-installer')\n  installExtension.default(installExtension.VUEJS_DEVTOOLS)\n    .then(() => {})\n    .catch(err => {\n      console.log('Unable to install `vue-devtools`: \\n', err)\n    })\n})\n\n// Require `main` process to boot app\nrequire('./index')"
  },
  {
    "path": "electron-vue/src/main/index.js",
    "content": "'use strict'\n\nimport { app, BrowserWindow } from 'electron'\n\n/**\n * Set `__static` path to static files in production\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html\n */\nif (process.env.NODE_ENV !== 'development') {\n  global.__static = require('path').join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\')\n}\n\nlet mainWindow\nconst winURL = process.env.NODE_ENV === 'development'\n  ? `http://localhost:9080`\n  : `file://${__dirname}/index.html`\n\nfunction createWindow () {\n  /**\n   * Initial window options\n   */\n  mainWindow = new BrowserWindow({\n    height: 563,\n    useContentSize: true,\n    width: 1000\n  })\n\n  mainWindow.loadURL(winURL)\n\n  mainWindow.on('closed', () => {\n    mainWindow = null\n  })\n}\n\napp.on('ready', createWindow)\n\napp.on('window-all-closed', () => {\n  if (process.platform !== 'darwin') {\n    app.quit()\n  }\n})\n\napp.on('activate', () => {\n  if (mainWindow === null) {\n    createWindow()\n  }\n})\n\n/**\n * Auto Updater\n *\n * Uncomment the following code below and install `electron-updater` to\n * support auto updating. Code Signing with a valid certificate is required.\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating\n */\n\n/*\nimport { autoUpdater } from 'electron-updater'\n\nautoUpdater.on('update-downloaded', () => {\n  autoUpdater.quitAndInstall()\n})\n\napp.on('ready', () => {\n  if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()\n})\n */\n"
  },
  {
    "path": "electron-vue/src/renderer/App.vue",
    "content": "<template>\n  <div id=\"app\">\n    <router-view></router-view>\n  </div>\n</template>\n\n<script>\n  export default {\n    name: 'rong-test'\n  }\n</script>\n\n<style>\n  /* CSS */\n</style>\n"
  },
  {
    "path": "electron-vue/src/renderer/assets/.gitkeep",
    "content": ""
  },
  {
    "path": "electron-vue/src/renderer/components/Init.vue",
    "content": "<template>\n  <div>\n    <h1>Web SDK electron-vue</h1>\n    <p class=\"rong-input\">\n      <span>appkey:</span>\n      <input type=\"text\" v-model=\"appkey\" size=\"20\">\n    </p>\n    <p class=\"rong-input\">\n      <span>token:</span><input type=\"text\" size=\"110\" v-model=\"token\">\n    </p>\n    <p class=\"rong-input\">\n      <span>navi:</span><input type=\"text\" size=\"50\" v-model=\"navi\"><i>此配置项仅针对私有部署，公有云请置空，格式为 10.10.10.10:8080</i>\n    </p>\n    <p class=\"rong-input\">\n      <span></span>\n      <button @click=\"init\">初始化链接</button>\n    </p>\n    <div class=\"rong-show-box\">\n      <h3>初始化以及消息接收:</h3>\n      <p v-for=\"data in showDatas\">\n        {{data}}\n      </p>\n    </div>\n  </div>\n</template>\n\n<script>\n  require('../../../static/js/RongIMLib-2.5.1.js')\n  require('../../../static/js/protobuf-2.3.6.min.js')\n  require('../../../static/js/RongEmoji-2.2.7.js')\n  var RongIMLib = window.RongIMLib\n  var RongIMClient = RongIMLib.RongIMClient\n\n  function init (params, addPromptInfo) {\n    var appkey = params.appkey\n    var token = params.token\n    var navi = params.navi\n    var config = {}\n    if (navi) {\n      config.navi = navi\n    }\n    RongIMClient.init(appkey, null, config)\n    RongIMClient.setConnectionStatusListener({\n      onChanged: function (status) {\n        switch (status) {\n          case RongIMLib.ConnectionStatus['CONNECTED']:\n          case 0:\n            addPromptInfo('连接成功')\n            break\n\n          case RongIMLib.ConnectionStatus['CONNECTING']:\n          case 1:\n            addPromptInfo('连接中')\n            break\n\n          case RongIMLib.ConnectionStatus['DISCONNECTED']:\n          case 2:\n            addPromptInfo('当前用户主动断开链接')\n            break\n\n          case RongIMLib.ConnectionStatus['NETWORK_UNAVAILABLE']:\n          case 3:\n            addPromptInfo('网络不可用')\n            break\n\n          case RongIMLib.ConnectionStatus['CONNECTION_CLOSED']:\n          case 4:\n            addPromptInfo('未知原因，连接关闭')\n            break\n\n          case RongIMLib.ConnectionStatus['KICKED_OFFLINE_BY_OTHER_CLIENT']:\n          case 6:\n            addPromptInfo('用户账户在其他设备登录，本机会被踢掉线')\n            break\n\n          case RongIMLib.ConnectionStatus['DOMAIN_INCORRECT']:\n          case 12:\n            addPromptInfo('当前运行域名错误，请检查安全域名配置')\n            break\n        }\n      }\n    })\n\n    RongIMClient.setOnReceiveMessageListener({\n      // 接收到的消息\n      onReceived: function (message) {\n        addPromptInfo('新消息 ' + message.targetId + ':' + JSON.stringify(message))\n      }\n    })\n\n    RongIMClient.connect(token, {\n      onSuccess: function (userId) {\n        addPromptInfo('链接成功，用户id：' + userId)\n      },\n      onTokenIncorrect: function () {\n        addPromptInfo('token无效')\n      },\n      onError: function (errorCode) {\n        addPromptInfo(errorCode)\n      }\n    }, null)\n  }\n\n  export default {\n    name: 'landing-page',\n    data: function () {\n      return {\n        appkey: '',\n        token: '',\n        navi: '',\n        showDatas: []\n      }\n    },\n    methods: {\n      addPromptInfo: function (prompt) {\n        this.showDatas.push(prompt)\n      },\n      init: function () {\n        var appkey = this.appkey\n        var token = this.token\n        if (!appkey || !token) {\n          alert('appkey 和 token 不能为空')\n        } else {\n          init({\n            appkey: appkey,\n            token: token,\n            navi: this.navi\n          }, this.addPromptInfo)\n        }\n      }\n    }\n  }\n</script>\n\n<style>\n.rong-input span {\n  display: inline-block;\n  width: 60px;\n}\n.rong-show-box {\n  border: 1px solid lightgray;\n  padding: 10px;\n}\n.rong-show-box h3, .rong-show-box p {\n  margin: 5px 0;\n}\n\n</style>\n"
  },
  {
    "path": "electron-vue/src/renderer/main.js",
    "content": "import Vue from 'vue'\nimport axios from 'axios'\n\nimport App from './App'\nimport router from './router'\nimport store from './store'\n\nif (!process.env.IS_WEB) Vue.use(require('vue-electron'))\nVue.http = Vue.prototype.$http = axios\nVue.config.productionTip = false\n\n/* eslint-disable no-new */\nnew Vue({\n  components: { App },\n  router,\n  store,\n  template: '<App/>'\n}).$mount('#app')\n"
  },
  {
    "path": "electron-vue/src/renderer/router/index.js",
    "content": "import Vue from 'vue'\nimport Router from 'vue-router'\n\nVue.use(Router)\n\nexport default new Router({\n  routes: [\n    {\n      path: '/',\n      name: 'landing-page',\n      component: require('@/components/Init').default\n    },\n    {\n      path: '*',\n      redirect: '/'\n    }\n  ]\n})\n"
  },
  {
    "path": "electron-vue/src/renderer/store/index.js",
    "content": "import Vue from 'vue'\nimport Vuex from 'vuex'\n\nimport { createPersistedState, createSharedMutations } from 'vuex-electron'\n\nimport modules from './modules'\n\nVue.use(Vuex)\n\nexport default new Vuex.Store({\n  modules,\n  plugins: [\n    createPersistedState(),\n    createSharedMutations()\n  ],\n  strict: process.env.NODE_ENV !== 'production'\n})\n"
  },
  {
    "path": "electron-vue/src/renderer/store/modules/Counter.js",
    "content": "const state = {\n  main: 0\n}\n\nconst mutations = {\n  DECREMENT_MAIN_COUNTER (state) {\n    state.main--\n  },\n  INCREMENT_MAIN_COUNTER (state) {\n    state.main++\n  }\n}\n\nconst actions = {\n  someAsyncTask ({ commit }) {\n    // do something async\n    commit('INCREMENT_MAIN_COUNTER')\n  }\n}\n\nexport default {\n  state,\n  mutations,\n  actions\n}\n"
  },
  {
    "path": "electron-vue/src/renderer/store/modules/index.js",
    "content": "/**\n * The file enables `@/store/index.js` to import all vuex modules\n * in a one-shot manner. There should not be any reason to edit this file.\n */\n\nconst files = require.context('.', false, /\\.js$/)\nconst modules = {}\n\nfiles.keys().forEach(key => {\n  if (key === './index.js') return\n  modules[key.replace(/(\\.\\/|\\.js)/g, '')] = files(key).default\n})\n\nexport default modules\n"
  },
  {
    "path": "electron-vue/static/.gitkeep",
    "content": ""
  },
  {
    "path": "electron-vue/static/js/RongEmoji-2.2.7.js",
    "content": "/*\n    支持范围\n    IE6+, Chrome, Safari, Firefox, Android, IOS\n */\n(function(global, factory) {\n    'use strict';\n    if (typeof exports === 'object' && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    var _export = {};\n    // emoji 默认大小\n    var DefaultSize = 24;\n    // 默认语言, 暂时仅支持 zh, en\n    var DefaultLang = 'zh';\n    // 支持的语言\n    var SupportLangs = ['zh', 'en'];\n    // 24px 的 emoji 图片地址\n    var NornalImagePath = '//cdn.ronghub.com/emojis-normal.png';\n    // 48px(高清图) 的 emoji 图片地址\n    var HdImagePath = '//cdn.ronghub.com/emojis-hd.png';\n    // emoji 的 unicode 正则匹配\n    var UnicodeReg = /\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf48b\\u200d\\uf468|\\uf468\\u200d\\u2764\\ufe0f\\u200d\\uf48b\\u200d\\uf468|\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf48b\\u200d\\uf469|\\uf468\\u200d\\uf469\\u200d\\uf467\\u200d\\uf466|\\uf468\\u200d\\uf469\\u200d\\uf466\\u200d\\uf466|\\uf468\\u200d\\uf469\\u200d\\uf467\\u200d\\uf467|\\uf468\\u200d\\uf468\\u200d\\uf467\\u200d\\uf466|\\uf468\\u200d\\uf468\\u200d\\uf466\\u200d\\uf466|\\uf468\\u200d\\uf468\\u200d\\uf467\\u200d\\uf467|\\uf469\\u200d\\uf469\\u200d\\uf467\\u200d\\uf466|\\uf469\\u200d\\uf469\\u200d\\uf466\\u200d\\uf466|\\uf469\\u200d\\uf469\\u200d\\uf467\\u200d\\uf467|\\uf3f4\\ue0067\\ue0062\\ue0065\\ue006e\\ue0067\\ue007f|\\uf3f4\\ue0067\\ue0062\\ue0073\\ue0063\\ue0074\\ue007f|\\uf3f4\\ue0067\\ue0062\\ue0077\\ue006c\\ue0073\\ue007f|\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf468|\\uf468\\u200d\\u2764\\ufe0f\\u200d\\uf468|\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf469|\\uf468\\uf3fb\\u200d\\u2695\\ufe0f|\\uf468\\uf3fc\\u200d\\u2695\\ufe0f|\\uf468\\uf3fd\\u200d\\u2695\\ufe0f|\\uf468\\uf3fe\\u200d\\u2695\\ufe0f|\\uf468\\uf3ff\\u200d\\u2695\\ufe0f|\\uf469\\uf3fb\\u200d\\u2695\\ufe0f|\\uf469\\uf3fc\\u200d\\u2695\\ufe0f|\\uf469\\uf3fd\\u200d\\u2695\\ufe0f|\\uf469\\uf3fe\\u200d\\u2695\\ufe0f|\\uf469\\uf3ff\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\u2696\\ufe0f|\\uf468\\uf3fc\\u200d\\u2696\\ufe0f|\\uf468\\uf3fd\\u200d\\u2696\\ufe0f|\\uf468\\uf3fe\\u200d\\u2696\\ufe0f|\\uf468\\uf3ff\\u200d\\u2696\\ufe0f|\\uf469\\uf3fb\\u200d\\u2696\\ufe0f|\\uf469\\uf3fc\\u200d\\u2696\\ufe0f|\\uf469\\uf3fd\\u200d\\u2696\\ufe0f|\\uf469\\uf3fe\\u200d\\u2696\\ufe0f|\\uf469\\uf3ff\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\u2708\\ufe0f|\\uf468\\uf3fc\\u200d\\u2708\\ufe0f|\\uf468\\uf3fd\\u200d\\u2708\\ufe0f|\\uf468\\uf3fe\\u200d\\u2708\\ufe0f|\\uf468\\uf3ff\\u200d\\u2708\\ufe0f|\\uf469\\uf3fb\\u200d\\u2708\\ufe0f|\\uf469\\uf3fc\\u200d\\u2708\\ufe0f|\\uf469\\uf3fd\\u200d\\u2708\\ufe0f|\\uf469\\uf3fe\\u200d\\u2708\\ufe0f|\\uf469\\uf3ff\\u200d\\u2708\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf575\\ufe0f\\u200d\\u2642\\ufe0f|\\uf575\\uf3fb\\u200d\\u2642\\ufe0f|\\uf575\\uf3fc\\u200d\\u2642\\ufe0f|\\uf575\\uf3fd\\u200d\\u2642\\ufe0f|\\uf575\\uf3fe\\u200d\\u2642\\ufe0f|\\uf575\\uf3ff\\u200d\\u2642\\ufe0f|\\uf575\\ufe0f\\u200d\\u2640\\ufe0f|\\uf575\\uf3fb\\u200d\\u2640\\ufe0f|\\uf575\\uf3fc\\u200d\\u2640\\ufe0f|\\uf575\\uf3fd\\u200d\\u2640\\ufe0f|\\uf575\\uf3fe\\u200d\\u2640\\ufe0f|\\uf575\\uf3ff\\u200d\\u2640\\ufe0f|\\uf482\\uf3fb\\u200d\\u2642\\ufe0f|\\uf482\\uf3fc\\u200d\\u2642\\ufe0f|\\uf482\\uf3fd\\u200d\\u2642\\ufe0f|\\uf482\\uf3fe\\u200d\\u2642\\ufe0f|\\uf482\\uf3ff\\u200d\\u2642\\ufe0f|\\uf482\\uf3fb\\u200d\\u2640\\ufe0f|\\uf482\\uf3fc\\u200d\\u2640\\ufe0f|\\uf482\\uf3fd\\u200d\\u2640\\ufe0f|\\uf482\\uf3fe\\u200d\\u2640\\ufe0f|\\uf482\\uf3ff\\u200d\\u2640\\ufe0f|\\uf477\\uf3fb\\u200d\\u2642\\ufe0f|\\uf477\\uf3fc\\u200d\\u2642\\ufe0f|\\uf477\\uf3fd\\u200d\\u2642\\ufe0f|\\uf477\\uf3fe\\u200d\\u2642\\ufe0f|\\uf477\\uf3ff\\u200d\\u2642\\ufe0f|\\uf477\\uf3fb\\u200d\\u2640\\ufe0f|\\uf477\\uf3fc\\u200d\\u2640\\ufe0f|\\uf477\\uf3fd\\u200d\\u2640\\ufe0f|\\uf477\\uf3fe\\u200d\\u2640\\ufe0f|\\uf477\\uf3ff\\u200d\\u2640\\ufe0f|\\uf473\\uf3fb\\u200d\\u2642\\ufe0f|\\uf473\\uf3fc\\u200d\\u2642\\ufe0f|\\uf473\\uf3fd\\u200d\\u2642\\ufe0f|\\uf473\\uf3fe\\u200d\\u2642\\ufe0f|\\uf473\\uf3ff\\u200d\\u2642\\ufe0f|\\uf473\\uf3fb\\u200d\\u2640\\ufe0f|\\uf473\\uf3fc\\u200d\\u2640\\ufe0f|\\uf473\\uf3fd\\u200d\\u2640\\ufe0f|\\uf473\\uf3fe\\u200d\\u2640\\ufe0f|\\uf473\\uf3ff\\u200d\\u2640\\ufe0f|\\uf471\\uf3fb\\u200d\\u2642\\ufe0f|\\uf471\\uf3fc\\u200d\\u2642\\ufe0f|\\uf471\\uf3fd\\u200d\\u2642\\ufe0f|\\uf471\\uf3fe\\u200d\\u2642\\ufe0f|\\uf471\\uf3ff\\u200d\\u2642\\ufe0f|\\uf471\\uf3fb\\u200d\\u2640\\ufe0f|\\uf471\\uf3fc\\u200d\\u2640\\ufe0f|\\uf471\\uf3fd\\u200d\\u2640\\ufe0f|\\uf471\\uf3fe\\u200d\\u2640\\ufe0f|\\uf471\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf645\\uf3fb\\u200d\\u2642\\ufe0f|\\uf645\\uf3fc\\u200d\\u2642\\ufe0f|\\uf645\\uf3fd\\u200d\\u2642\\ufe0f|\\uf645\\uf3fe\\u200d\\u2642\\ufe0f|\\uf645\\uf3ff\\u200d\\u2642\\ufe0f|\\uf645\\uf3fb\\u200d\\u2640\\ufe0f|\\uf645\\uf3fc\\u200d\\u2640\\ufe0f|\\uf645\\uf3fd\\u200d\\u2640\\ufe0f|\\uf645\\uf3fe\\u200d\\u2640\\ufe0f|\\uf645\\uf3ff\\u200d\\u2640\\ufe0f|\\uf646\\uf3fb\\u200d\\u2642\\ufe0f|\\uf646\\uf3fc\\u200d\\u2642\\ufe0f|\\uf646\\uf3fd\\u200d\\u2642\\ufe0f|\\uf646\\uf3fe\\u200d\\u2642\\ufe0f|\\uf646\\uf3ff\\u200d\\u2642\\ufe0f|\\uf646\\uf3fb\\u200d\\u2640\\ufe0f|\\uf646\\uf3fc\\u200d\\u2640\\ufe0f|\\uf646\\uf3fd\\u200d\\u2640\\ufe0f|\\uf646\\uf3fe\\u200d\\u2640\\ufe0f|\\uf646\\uf3ff\\u200d\\u2640\\ufe0f|\\uf481\\uf3fb\\u200d\\u2642\\ufe0f|\\uf481\\uf3fc\\u200d\\u2642\\ufe0f|\\uf481\\uf3fd\\u200d\\u2642\\ufe0f|\\uf481\\uf3fe\\u200d\\u2642\\ufe0f|\\uf481\\uf3ff\\u200d\\u2642\\ufe0f|\\uf481\\uf3fb\\u200d\\u2640\\ufe0f|\\uf481\\uf3fc\\u200d\\u2640\\ufe0f|\\uf481\\uf3fd\\u200d\\u2640\\ufe0f|\\uf481\\uf3fe\\u200d\\u2640\\ufe0f|\\uf481\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2640\\ufe0f|\\uf647\\uf3fb\\u200d\\u2642\\ufe0f|\\uf647\\uf3fc\\u200d\\u2642\\ufe0f|\\uf647\\uf3fd\\u200d\\u2642\\ufe0f|\\uf647\\uf3fe\\u200d\\u2642\\ufe0f|\\uf647\\uf3ff\\u200d\\u2642\\ufe0f|\\uf647\\uf3fb\\u200d\\u2640\\ufe0f|\\uf647\\uf3fc\\u200d\\u2640\\ufe0f|\\uf647\\uf3fd\\u200d\\u2640\\ufe0f|\\uf647\\uf3fe\\u200d\\u2640\\ufe0f|\\uf647\\uf3ff\\u200d\\u2640\\ufe0f|\\uf926\\uf3fb\\u200d\\u2642\\ufe0f|\\uf926\\uf3fc\\u200d\\u2642\\ufe0f|\\uf926\\uf3fd\\u200d\\u2642\\ufe0f|\\uf926\\uf3fe\\u200d\\u2642\\ufe0f|\\uf926\\uf3ff\\u200d\\u2642\\ufe0f|\\uf926\\uf3fb\\u200d\\u2640\\ufe0f|\\uf926\\uf3fc\\u200d\\u2640\\ufe0f|\\uf926\\uf3fd\\u200d\\u2640\\ufe0f|\\uf926\\uf3fe\\u200d\\u2640\\ufe0f|\\uf926\\uf3ff\\u200d\\u2640\\ufe0f|\\uf937\\uf3fb\\u200d\\u2642\\ufe0f|\\uf937\\uf3fc\\u200d\\u2642\\ufe0f|\\uf937\\uf3fd\\u200d\\u2642\\ufe0f|\\uf937\\uf3fe\\u200d\\u2642\\ufe0f|\\uf937\\uf3ff\\u200d\\u2642\\ufe0f|\\uf937\\uf3fb\\u200d\\u2640\\ufe0f|\\uf937\\uf3fc\\u200d\\u2640\\ufe0f|\\uf937\\uf3fd\\u200d\\u2640\\ufe0f|\\uf937\\uf3fe\\u200d\\u2640\\ufe0f|\\uf937\\uf3ff\\u200d\\u2640\\ufe0f|\\uf486\\uf3fb\\u200d\\u2642\\ufe0f|\\uf486\\uf3fc\\u200d\\u2642\\ufe0f|\\uf486\\uf3fd\\u200d\\u2642\\ufe0f|\\uf486\\uf3fe\\u200d\\u2642\\ufe0f|\\uf486\\uf3ff\\u200d\\u2642\\ufe0f|\\uf486\\uf3fb\\u200d\\u2640\\ufe0f|\\uf486\\uf3fc\\u200d\\u2640\\ufe0f|\\uf486\\uf3fd\\u200d\\u2640\\ufe0f|\\uf486\\uf3fe\\u200d\\u2640\\ufe0f|\\uf486\\uf3ff\\u200d\\u2640\\ufe0f|\\uf487\\uf3fb\\u200d\\u2642\\ufe0f|\\uf487\\uf3fc\\u200d\\u2642\\ufe0f|\\uf487\\uf3fd\\u200d\\u2642\\ufe0f|\\uf487\\uf3fe\\u200d\\u2642\\ufe0f|\\uf487\\uf3ff\\u200d\\u2642\\ufe0f|\\uf487\\uf3fb\\u200d\\u2640\\ufe0f|\\uf487\\uf3fc\\u200d\\u2640\\ufe0f|\\uf487\\uf3fd\\u200d\\u2640\\ufe0f|\\uf487\\uf3fe\\u200d\\u2640\\ufe0f|\\uf487\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\ufe0f\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\ufe0f\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2640\\ufe0f|\\u26f9\\ufe0f\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fb\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fc\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fd\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fe\\u200d\\u2642\\ufe0f|\\u26f9\\uf3ff\\u200d\\u2642\\ufe0f|\\u26f9\\ufe0f\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fb\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fc\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fd\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fe\\u200d\\u2640\\ufe0f|\\u26f9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3cb\\ufe0f\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cb\\ufe0f\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2640\\ufe0f|\\uf938\\uf3fb\\u200d\\u2642\\ufe0f|\\uf938\\uf3fc\\u200d\\u2642\\ufe0f|\\uf938\\uf3fd\\u200d\\u2642\\ufe0f|\\uf938\\uf3fe\\u200d\\u2642\\ufe0f|\\uf938\\uf3ff\\u200d\\u2642\\ufe0f|\\uf938\\uf3fb\\u200d\\u2640\\ufe0f|\\uf938\\uf3fc\\u200d\\u2640\\ufe0f|\\uf938\\uf3fd\\u200d\\u2640\\ufe0f|\\uf938\\uf3fe\\u200d\\u2640\\ufe0f|\\uf938\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf939\\uf3fb\\u200d\\u2642\\ufe0f|\\uf939\\uf3fc\\u200d\\u2642\\ufe0f|\\uf939\\uf3fd\\u200d\\u2642\\ufe0f|\\uf939\\uf3fe\\u200d\\u2642\\ufe0f|\\uf939\\uf3ff\\u200d\\u2642\\ufe0f|\\uf939\\uf3fb\\u200d\\u2640\\ufe0f|\\uf939\\uf3fc\\u200d\\u2640\\ufe0f|\\uf939\\uf3fd\\u200d\\u2640\\ufe0f|\\uf939\\uf3fe\\u200d\\u2640\\ufe0f|\\uf939\\uf3ff\\u200d\\u2640\\ufe0f|\\uf468\\u200d\\uf469\\u200d\\uf466|\\uf468\\u200d\\uf469\\u200d\\uf467|\\uf468\\u200d\\uf468\\u200d\\uf466|\\uf468\\u200d\\uf468\\u200d\\uf467|\\uf469\\u200d\\uf469\\u200d\\uf466|\\uf469\\u200d\\uf469\\u200d\\uf467|\\uf468\\u200d\\uf466\\u200d\\uf466|\\uf468\\u200d\\uf467\\u200d\\uf466|\\uf468\\u200d\\uf467\\u200d\\uf467|\\uf469\\u200d\\uf466\\u200d\\uf466|\\uf469\\u200d\\uf467\\u200d\\uf466|\\uf469\\u200d\\uf467\\u200d\\uf467|\\uf441\\ufe0f\\u200d\\uf5e8\\ufe0f|\\uf468\\u200d\\u2695\\ufe0f|\\uf469\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\uf393|\\uf468\\uf3fc\\u200d\\uf393|\\uf468\\uf3fd\\u200d\\uf393|\\uf468\\uf3fe\\u200d\\uf393|\\uf468\\uf3ff\\u200d\\uf393|\\uf469\\uf3fb\\u200d\\uf393|\\uf469\\uf3fc\\u200d\\uf393|\\uf469\\uf3fd\\u200d\\uf393|\\uf469\\uf3fe\\u200d\\uf393|\\uf469\\uf3ff\\u200d\\uf393|\\uf468\\uf3fb\\u200d\\uf3eb|\\uf468\\uf3fc\\u200d\\uf3eb|\\uf468\\uf3fd\\u200d\\uf3eb|\\uf468\\uf3fe\\u200d\\uf3eb|\\uf468\\uf3ff\\u200d\\uf3eb|\\uf469\\uf3fb\\u200d\\uf3eb|\\uf469\\uf3fc\\u200d\\uf3eb|\\uf469\\uf3fd\\u200d\\uf3eb|\\uf469\\uf3fe\\u200d\\uf3eb|\\uf469\\uf3ff\\u200d\\uf3eb|\\uf468\\u200d\\u2696\\ufe0f|\\uf469\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\uf33e|\\uf468\\uf3fc\\u200d\\uf33e|\\uf468\\uf3fd\\u200d\\uf33e|\\uf468\\uf3fe\\u200d\\uf33e|\\uf468\\uf3ff\\u200d\\uf33e|\\uf469\\uf3fb\\u200d\\uf33e|\\uf469\\uf3fc\\u200d\\uf33e|\\uf469\\uf3fd\\u200d\\uf33e|\\uf469\\uf3fe\\u200d\\uf33e|\\uf469\\uf3ff\\u200d\\uf33e|\\uf468\\uf3fb\\u200d\\uf373|\\uf468\\uf3fc\\u200d\\uf373|\\uf468\\uf3fd\\u200d\\uf373|\\uf468\\uf3fe\\u200d\\uf373|\\uf468\\uf3ff\\u200d\\uf373|\\uf469\\uf3fb\\u200d\\uf373|\\uf469\\uf3fc\\u200d\\uf373|\\uf469\\uf3fd\\u200d\\uf373|\\uf469\\uf3fe\\u200d\\uf373|\\uf469\\uf3ff\\u200d\\uf373|\\uf468\\uf3fb\\u200d\\uf527|\\uf468\\uf3fc\\u200d\\uf527|\\uf468\\uf3fd\\u200d\\uf527|\\uf468\\uf3fe\\u200d\\uf527|\\uf468\\uf3ff\\u200d\\uf527|\\uf469\\uf3fb\\u200d\\uf527|\\uf469\\uf3fc\\u200d\\uf527|\\uf469\\uf3fd\\u200d\\uf527|\\uf469\\uf3fe\\u200d\\uf527|\\uf469\\uf3ff\\u200d\\uf527|\\uf468\\uf3fb\\u200d\\uf3ed|\\uf468\\uf3fc\\u200d\\uf3ed|\\uf468\\uf3fd\\u200d\\uf3ed|\\uf468\\uf3fe\\u200d\\uf3ed|\\uf468\\uf3ff\\u200d\\uf3ed|\\uf469\\uf3fb\\u200d\\uf3ed|\\uf469\\uf3fc\\u200d\\uf3ed|\\uf469\\uf3fd\\u200d\\uf3ed|\\uf469\\uf3fe\\u200d\\uf3ed|\\uf469\\uf3ff\\u200d\\uf3ed|\\uf468\\uf3fb\\u200d\\uf4bc|\\uf468\\uf3fc\\u200d\\uf4bc|\\uf468\\uf3fd\\u200d\\uf4bc|\\uf468\\uf3fe\\u200d\\uf4bc|\\uf468\\uf3ff\\u200d\\uf4bc|\\uf469\\uf3fb\\u200d\\uf4bc|\\uf469\\uf3fc\\u200d\\uf4bc|\\uf469\\uf3fd\\u200d\\uf4bc|\\uf469\\uf3fe\\u200d\\uf4bc|\\uf469\\uf3ff\\u200d\\uf4bc|\\uf468\\uf3fb\\u200d\\uf52c|\\uf468\\uf3fc\\u200d\\uf52c|\\uf468\\uf3fd\\u200d\\uf52c|\\uf468\\uf3fe\\u200d\\uf52c|\\uf468\\uf3ff\\u200d\\uf52c|\\uf469\\uf3fb\\u200d\\uf52c|\\uf469\\uf3fc\\u200d\\uf52c|\\uf469\\uf3fd\\u200d\\uf52c|\\uf469\\uf3fe\\u200d\\uf52c|\\uf469\\uf3ff\\u200d\\uf52c|\\uf468\\uf3fb\\u200d\\uf4bb|\\uf468\\uf3fc\\u200d\\uf4bb|\\uf468\\uf3fd\\u200d\\uf4bb|\\uf468\\uf3fe\\u200d\\uf4bb|\\uf468\\uf3ff\\u200d\\uf4bb|\\uf469\\uf3fb\\u200d\\uf4bb|\\uf469\\uf3fc\\u200d\\uf4bb|\\uf469\\uf3fd\\u200d\\uf4bb|\\uf469\\uf3fe\\u200d\\uf4bb|\\uf469\\uf3ff\\u200d\\uf4bb|\\uf468\\uf3fb\\u200d\\uf3a4|\\uf468\\uf3fc\\u200d\\uf3a4|\\uf468\\uf3fd\\u200d\\uf3a4|\\uf468\\uf3fe\\u200d\\uf3a4|\\uf468\\uf3ff\\u200d\\uf3a4|\\uf469\\uf3fb\\u200d\\uf3a4|\\uf469\\uf3fc\\u200d\\uf3a4|\\uf469\\uf3fd\\u200d\\uf3a4|\\uf469\\uf3fe\\u200d\\uf3a4|\\uf469\\uf3ff\\u200d\\uf3a4|\\uf468\\uf3fb\\u200d\\uf3a8|\\uf468\\uf3fc\\u200d\\uf3a8|\\uf468\\uf3fd\\u200d\\uf3a8|\\uf468\\uf3fe\\u200d\\uf3a8|\\uf468\\uf3ff\\u200d\\uf3a8|\\uf469\\uf3fb\\u200d\\uf3a8|\\uf469\\uf3fc\\u200d\\uf3a8|\\uf469\\uf3fd\\u200d\\uf3a8|\\uf469\\uf3fe\\u200d\\uf3a8|\\uf469\\uf3ff\\u200d\\uf3a8|\\uf468\\u200d\\u2708\\ufe0f|\\uf469\\u200d\\u2708\\ufe0f|\\uf468\\uf3fb\\u200d\\uf680|\\uf468\\uf3fc\\u200d\\uf680|\\uf468\\uf3fd\\u200d\\uf680|\\uf468\\uf3fe\\u200d\\uf680|\\uf468\\uf3ff\\u200d\\uf680|\\uf469\\uf3fb\\u200d\\uf680|\\uf469\\uf3fc\\u200d\\uf680|\\uf469\\uf3fd\\u200d\\uf680|\\uf469\\uf3fe\\u200d\\uf680|\\uf469\\uf3ff\\u200d\\uf680|\\uf468\\uf3fb\\u200d\\uf692|\\uf468\\uf3fc\\u200d\\uf692|\\uf468\\uf3fd\\u200d\\uf692|\\uf468\\uf3fe\\u200d\\uf692|\\uf468\\uf3ff\\u200d\\uf692|\\uf469\\uf3fb\\u200d\\uf692|\\uf469\\uf3fc\\u200d\\uf692|\\uf469\\uf3fd\\u200d\\uf692|\\uf469\\uf3fe\\u200d\\uf692|\\uf469\\uf3ff\\u200d\\uf692|\\uf46e\\u200d\\u2642\\ufe0f|\\uf46e\\u200d\\u2640\\ufe0f|\\uf482\\u200d\\u2642\\ufe0f|\\uf482\\u200d\\u2640\\ufe0f|\\uf477\\u200d\\u2642\\ufe0f|\\uf477\\u200d\\u2640\\ufe0f|\\uf473\\u200d\\u2642\\ufe0f|\\uf473\\u200d\\u2640\\ufe0f|\\uf471\\u200d\\u2642\\ufe0f|\\uf471\\u200d\\u2640\\ufe0f|\\uf9d9\\u200d\\u2640\\ufe0f|\\uf9d9\\u200d\\u2642\\ufe0f|\\uf9da\\u200d\\u2640\\ufe0f|\\uf9da\\u200d\\u2642\\ufe0f|\\uf9db\\u200d\\u2640\\ufe0f|\\uf9db\\u200d\\u2642\\ufe0f|\\uf9dc\\u200d\\u2640\\ufe0f|\\uf9dc\\u200d\\u2642\\ufe0f|\\uf9dd\\u200d\\u2640\\ufe0f|\\uf9dd\\u200d\\u2642\\ufe0f|\\uf9de\\u200d\\u2640\\ufe0f|\\uf9de\\u200d\\u2642\\ufe0f|\\uf9df\\u200d\\u2640\\ufe0f|\\uf9df\\u200d\\u2642\\ufe0f|\\uf64d\\u200d\\u2642\\ufe0f|\\uf64d\\u200d\\u2640\\ufe0f|\\uf64e\\u200d\\u2642\\ufe0f|\\uf64e\\u200d\\u2640\\ufe0f|\\uf645\\u200d\\u2642\\ufe0f|\\uf645\\u200d\\u2640\\ufe0f|\\uf646\\u200d\\u2642\\ufe0f|\\uf646\\u200d\\u2640\\ufe0f|\\uf481\\u200d\\u2642\\ufe0f|\\uf481\\u200d\\u2640\\ufe0f|\\uf64b\\u200d\\u2642\\ufe0f|\\uf64b\\u200d\\u2640\\ufe0f|\\uf647\\u200d\\u2642\\ufe0f|\\uf647\\u200d\\u2640\\ufe0f|\\uf926\\u200d\\u2642\\ufe0f|\\uf926\\u200d\\u2640\\ufe0f|\\uf937\\u200d\\u2642\\ufe0f|\\uf937\\u200d\\u2640\\ufe0f|\\uf486\\u200d\\u2642\\ufe0f|\\uf486\\u200d\\u2640\\ufe0f|\\uf487\\u200d\\u2642\\ufe0f|\\uf487\\u200d\\u2640\\ufe0f|\\uf6b6\\u200d\\u2642\\ufe0f|\\uf6b6\\u200d\\u2640\\ufe0f|\\uf3c3\\u200d\\u2642\\ufe0f|\\uf3c3\\u200d\\u2640\\ufe0f|\\uf46f\\u200d\\u2642\\ufe0f|\\uf46f\\u200d\\u2640\\ufe0f|\\uf9d6\\u200d\\u2640\\ufe0f|\\uf9d6\\u200d\\u2642\\ufe0f|\\uf9d7\\u200d\\u2640\\ufe0f|\\uf9d7\\u200d\\u2642\\ufe0f|\\uf9d8\\u200d\\u2640\\ufe0f|\\uf9d8\\u200d\\u2642\\ufe0f|\\uf3c4\\u200d\\u2642\\ufe0f|\\uf3c4\\u200d\\u2640\\ufe0f|\\uf6a3\\u200d\\u2642\\ufe0f|\\uf6a3\\u200d\\u2640\\ufe0f|\\uf3ca\\u200d\\u2642\\ufe0f|\\uf3ca\\u200d\\u2640\\ufe0f|\\uf6b4\\u200d\\u2642\\ufe0f|\\uf6b4\\u200d\\u2640\\ufe0f|\\uf6b5\\u200d\\u2642\\ufe0f|\\uf6b5\\u200d\\u2640\\ufe0f|\\uf938\\u200d\\u2642\\ufe0f|\\uf938\\u200d\\u2640\\ufe0f|\\uf93c\\u200d\\u2642\\ufe0f|\\uf93c\\u200d\\u2640\\ufe0f|\\uf93d\\u200d\\u2642\\ufe0f|\\uf93d\\u200d\\u2640\\ufe0f|\\uf93e\\u200d\\u2642\\ufe0f|\\uf93e\\u200d\\u2640\\ufe0f|\\uf939\\u200d\\u2642\\ufe0f|\\uf939\\u200d\\u2640\\ufe0f|\\uf3f3\\ufe0f\\u200d\\uf308|\\uf468\\u200d\\uf393|\\uf469\\u200d\\uf393|\\uf468\\u200d\\uf3eb|\\uf469\\u200d\\uf3eb|\\uf468\\u200d\\uf33e|\\uf469\\u200d\\uf33e|\\uf468\\u200d\\uf373|\\uf469\\u200d\\uf373|\\uf468\\u200d\\uf527|\\uf469\\u200d\\uf527|\\uf468\\u200d\\uf3ed|\\uf469\\u200d\\uf3ed|\\uf468\\u200d\\uf4bc|\\uf469\\u200d\\uf4bc|\\uf468\\u200d\\uf52c|\\uf469\\u200d\\uf52c|\\uf468\\u200d\\uf4bb|\\uf469\\u200d\\uf4bb|\\uf468\\u200d\\uf3a4|\\uf469\\u200d\\uf3a4|\\uf468\\u200d\\uf3a8|\\uf469\\u200d\\uf3a8|\\uf468\\u200d\\uf680|\\uf469\\u200d\\uf680|\\uf468\\u200d\\uf692|\\uf469\\u200d\\uf692|\\uf468\\u200d\\uf466|\\uf468\\u200d\\uf467|\\uf469\\u200d\\uf466|\\uf469\\u200d\\uf467|\\u0023\\ufe0f\\u20e3|\\u002a\\ufe0f\\u20e3|\\u0030\\ufe0f\\u20e3|\\u0031\\ufe0f\\u20e3|\\u0032\\ufe0f\\u20e3|\\u0033\\ufe0f\\u20e3|\\u0034\\ufe0f\\u20e3|\\u0035\\ufe0f\\u20e3|\\u0036\\ufe0f\\u20e3|\\u0037\\ufe0f\\u20e3|\\u0038\\ufe0f\\u20e3|\\u0039\\ufe0f\\u20e3|\\uf476\\uf3fb|\\uf476\\uf3fc|\\uf476\\uf3fd|\\uf476\\uf3fe|\\uf476\\uf3ff|\\uf9d2\\uf3fb|\\uf9d2\\uf3fc|\\uf9d2\\uf3fd|\\uf9d2\\uf3fe|\\uf9d2\\uf3ff|\\uf466\\uf3fb|\\uf466\\uf3fc|\\uf466\\uf3fd|\\uf466\\uf3fe|\\uf466\\uf3ff|\\uf467\\uf3fb|\\uf467\\uf3fc|\\uf467\\uf3fd|\\uf467\\uf3fe|\\uf467\\uf3ff|\\uf9d1\\uf3fb|\\uf9d1\\uf3fc|\\uf9d1\\uf3fd|\\uf9d1\\uf3fe|\\uf9d1\\uf3ff|\\uf468\\uf3fb|\\uf468\\uf3fc|\\uf468\\uf3fd|\\uf468\\uf3fe|\\uf468\\uf3ff|\\uf469\\uf3fb|\\uf469\\uf3fc|\\uf469\\uf3fd|\\uf469\\uf3fe|\\uf469\\uf3ff|\\uf9d3\\uf3fb|\\uf9d3\\uf3fc|\\uf9d3\\uf3fd|\\uf9d3\\uf3fe|\\uf9d3\\uf3ff|\\uf474\\uf3fb|\\uf474\\uf3fc|\\uf474\\uf3fd|\\uf474\\uf3fe|\\uf474\\uf3ff|\\uf475\\uf3fb|\\uf475\\uf3fc|\\uf475\\uf3fd|\\uf475\\uf3fe|\\uf475\\uf3ff|\\uf46e\\uf3fb|\\uf46e\\uf3fc|\\uf46e\\uf3fd|\\uf46e\\uf3fe|\\uf46e\\uf3ff|\\uf575\\uf3fb|\\uf575\\uf3fc|\\uf575\\uf3fd|\\uf575\\uf3fe|\\uf575\\uf3ff|\\uf482\\uf3fb|\\uf482\\uf3fc|\\uf482\\uf3fd|\\uf482\\uf3fe|\\uf482\\uf3ff|\\uf477\\uf3fb|\\uf477\\uf3fc|\\uf477\\uf3fd|\\uf477\\uf3fe|\\uf477\\uf3ff|\\uf934\\uf3fb|\\uf934\\uf3fc|\\uf934\\uf3fd|\\uf934\\uf3fe|\\uf934\\uf3ff|\\uf478\\uf3fb|\\uf478\\uf3fc|\\uf478\\uf3fd|\\uf478\\uf3fe|\\uf478\\uf3ff|\\uf473\\uf3fb|\\uf473\\uf3fc|\\uf473\\uf3fd|\\uf473\\uf3fe|\\uf473\\uf3ff|\\uf472\\uf3fb|\\uf472\\uf3fc|\\uf472\\uf3fd|\\uf472\\uf3fe|\\uf472\\uf3ff|\\uf9d5\\uf3fb|\\uf9d5\\uf3fc|\\uf9d5\\uf3fd|\\uf9d5\\uf3fe|\\uf9d5\\uf3ff|\\uf9d4\\uf3fb|\\uf9d4\\uf3fc|\\uf9d4\\uf3fd|\\uf9d4\\uf3fe|\\uf9d4\\uf3ff|\\uf471\\uf3fb|\\uf471\\uf3fc|\\uf471\\uf3fd|\\uf471\\uf3fe|\\uf471\\uf3ff|\\uf935\\uf3fb|\\uf935\\uf3fc|\\uf935\\uf3fd|\\uf935\\uf3fe|\\uf935\\uf3ff|\\uf470\\uf3fb|\\uf470\\uf3fc|\\uf470\\uf3fd|\\uf470\\uf3fe|\\uf470\\uf3ff|\\uf930\\uf3fb|\\uf930\\uf3fc|\\uf930\\uf3fd|\\uf930\\uf3fe|\\uf930\\uf3ff|\\uf931\\uf3fb|\\uf931\\uf3fc|\\uf931\\uf3fd|\\uf931\\uf3fe|\\uf931\\uf3ff|\\uf47c\\uf3fb|\\uf47c\\uf3fc|\\uf47c\\uf3fd|\\uf47c\\uf3fe|\\uf47c\\uf3ff|\\uf385\\uf3fb|\\uf385\\uf3fc|\\uf385\\uf3fd|\\uf385\\uf3fe|\\uf385\\uf3ff|\\uf936\\uf3fb|\\uf936\\uf3fc|\\uf936\\uf3fd|\\uf936\\uf3fe|\\uf936\\uf3ff|\\uf9d9\\uf3fb|\\uf9d9\\uf3fc|\\uf9d9\\uf3fd|\\uf9d9\\uf3fe|\\uf9d9\\uf3ff|\\uf9da\\uf3fb|\\uf9da\\uf3fc|\\uf9da\\uf3fd|\\uf9da\\uf3fe|\\uf9da\\uf3ff|\\uf9db\\uf3fb|\\uf9db\\uf3fc|\\uf9db\\uf3fd|\\uf9db\\uf3fe|\\uf9db\\uf3ff|\\uf9dc\\uf3fb|\\uf9dc\\uf3fc|\\uf9dc\\uf3fd|\\uf9dc\\uf3fe|\\uf9dc\\uf3ff|\\uf9dd\\uf3fb|\\uf9dd\\uf3fc|\\uf9dd\\uf3fd|\\uf9dd\\uf3fe|\\uf9dd\\uf3ff|\\uf64d\\uf3fb|\\uf64d\\uf3fc|\\uf64d\\uf3fd|\\uf64d\\uf3fe|\\uf64d\\uf3ff|\\uf64e\\uf3fb|\\uf64e\\uf3fc|\\uf64e\\uf3fd|\\uf64e\\uf3fe|\\uf64e\\uf3ff|\\uf645\\uf3fb|\\uf645\\uf3fc|\\uf645\\uf3fd|\\uf645\\uf3fe|\\uf645\\uf3ff|\\uf646\\uf3fb|\\uf646\\uf3fc|\\uf646\\uf3fd|\\uf646\\uf3fe|\\uf646\\uf3ff|\\uf481\\uf3fb|\\uf481\\uf3fc|\\uf481\\uf3fd|\\uf481\\uf3fe|\\uf481\\uf3ff|\\uf64b\\uf3fb|\\uf64b\\uf3fc|\\uf64b\\uf3fd|\\uf64b\\uf3fe|\\uf64b\\uf3ff|\\uf647\\uf3fb|\\uf647\\uf3fc|\\uf647\\uf3fd|\\uf647\\uf3fe|\\uf647\\uf3ff|\\uf926\\uf3fb|\\uf926\\uf3fc|\\uf926\\uf3fd|\\uf926\\uf3fe|\\uf926\\uf3ff|\\uf937\\uf3fb|\\uf937\\uf3fc|\\uf937\\uf3fd|\\uf937\\uf3fe|\\uf937\\uf3ff|\\uf486\\uf3fb|\\uf486\\uf3fc|\\uf486\\uf3fd|\\uf486\\uf3fe|\\uf486\\uf3ff|\\uf487\\uf3fb|\\uf487\\uf3fc|\\uf487\\uf3fd|\\uf487\\uf3fe|\\uf487\\uf3ff|\\uf6b6\\uf3fb|\\uf6b6\\uf3fc|\\uf6b6\\uf3fd|\\uf6b6\\uf3fe|\\uf6b6\\uf3ff|\\uf3c3\\uf3fb|\\uf3c3\\uf3fc|\\uf3c3\\uf3fd|\\uf3c3\\uf3fe|\\uf3c3\\uf3ff|\\uf483\\uf3fb|\\uf483\\uf3fc|\\uf483\\uf3fd|\\uf483\\uf3fe|\\uf483\\uf3ff|\\uf57a\\uf3fb|\\uf57a\\uf3fc|\\uf57a\\uf3fd|\\uf57a\\uf3fe|\\uf57a\\uf3ff|\\uf9d6\\uf3fb|\\uf9d6\\uf3fc|\\uf9d6\\uf3fd|\\uf9d6\\uf3fe|\\uf9d6\\uf3ff|\\uf9d7\\uf3fb|\\uf9d7\\uf3fc|\\uf9d7\\uf3fd|\\uf9d7\\uf3fe|\\uf9d7\\uf3ff|\\uf9d8\\uf3fb|\\uf9d8\\uf3fc|\\uf9d8\\uf3fd|\\uf9d8\\uf3fe|\\uf9d8\\uf3ff|\\uf6c0\\uf3fb|\\uf6c0\\uf3fc|\\uf6c0\\uf3fd|\\uf6c0\\uf3fe|\\uf6c0\\uf3ff|\\uf6cc\\uf3fb|\\uf6cc\\uf3fc|\\uf6cc\\uf3fd|\\uf6cc\\uf3fe|\\uf6cc\\uf3ff|\\uf574\\uf3fb|\\uf574\\uf3fc|\\uf574\\uf3fd|\\uf574\\uf3fe|\\uf574\\uf3ff|\\uf3c7\\uf3fb|\\uf3c7\\uf3fc|\\uf3c7\\uf3fd|\\uf3c7\\uf3fe|\\uf3c7\\uf3ff|\\uf3c2\\uf3fb|\\uf3c2\\uf3fc|\\uf3c2\\uf3fd|\\uf3c2\\uf3fe|\\uf3c2\\uf3ff|\\uf3cc\\uf3fb|\\uf3cc\\uf3fc|\\uf3cc\\uf3fd|\\uf3cc\\uf3fe|\\uf3cc\\uf3ff|\\uf3c4\\uf3fb|\\uf3c4\\uf3fc|\\uf3c4\\uf3fd|\\uf3c4\\uf3fe|\\uf3c4\\uf3ff|\\uf6a3\\uf3fb|\\uf6a3\\uf3fc|\\uf6a3\\uf3fd|\\uf6a3\\uf3fe|\\uf6a3\\uf3ff|\\uf3ca\\uf3fb|\\uf3ca\\uf3fc|\\uf3ca\\uf3fd|\\uf3ca\\uf3fe|\\uf3ca\\uf3ff|\\u26f9\\uf3fb|\\u26f9\\uf3fc|\\u26f9\\uf3fd|\\u26f9\\uf3fe|\\u26f9\\uf3ff|\\uf3cb\\uf3fb|\\uf3cb\\uf3fc|\\uf3cb\\uf3fd|\\uf3cb\\uf3fe|\\uf3cb\\uf3ff|\\uf6b4\\uf3fb|\\uf6b4\\uf3fc|\\uf6b4\\uf3fd|\\uf6b4\\uf3fe|\\uf6b4\\uf3ff|\\uf6b5\\uf3fb|\\uf6b5\\uf3fc|\\uf6b5\\uf3fd|\\uf6b5\\uf3fe|\\uf6b5\\uf3ff|\\uf938\\uf3fb|\\uf938\\uf3fc|\\uf938\\uf3fd|\\uf938\\uf3fe|\\uf938\\uf3ff|\\uf93d\\uf3fb|\\uf93d\\uf3fc|\\uf93d\\uf3fd|\\uf93d\\uf3fe|\\uf93d\\uf3ff|\\uf93e\\uf3fb|\\uf93e\\uf3fc|\\uf93e\\uf3fd|\\uf93e\\uf3fe|\\uf93e\\uf3ff|\\uf939\\uf3fb|\\uf939\\uf3fc|\\uf939\\uf3fd|\\uf939\\uf3fe|\\uf939\\uf3ff|\\uf933\\uf3fb|\\uf933\\uf3fc|\\uf933\\uf3fd|\\uf933\\uf3fe|\\uf933\\uf3ff|\\uf4aa\\uf3fb|\\uf4aa\\uf3fc|\\uf4aa\\uf3fd|\\uf4aa\\uf3fe|\\uf4aa\\uf3ff|\\uf448\\uf3fb|\\uf448\\uf3fc|\\uf448\\uf3fd|\\uf448\\uf3fe|\\uf448\\uf3ff|\\uf449\\uf3fb|\\uf449\\uf3fc|\\uf449\\uf3fd|\\uf449\\uf3fe|\\uf449\\uf3ff|\\u261d\\uf3fb|\\u261d\\uf3fc|\\u261d\\uf3fd|\\u261d\\uf3fe|\\u261d\\uf3ff|\\uf446\\uf3fb|\\uf446\\uf3fc|\\uf446\\uf3fd|\\uf446\\uf3fe|\\uf446\\uf3ff|\\uf595\\uf3fb|\\uf595\\uf3fc|\\uf595\\uf3fd|\\uf595\\uf3fe|\\uf595\\uf3ff|\\uf447\\uf3fb|\\uf447\\uf3fc|\\uf447\\uf3fd|\\uf447\\uf3fe|\\uf447\\uf3ff|\\u270c\\uf3fb|\\u270c\\uf3fc|\\u270c\\uf3fd|\\u270c\\uf3fe|\\u270c\\uf3ff|\\uf91e\\uf3fb|\\uf91e\\uf3fc|\\uf91e\\uf3fd|\\uf91e\\uf3fe|\\uf91e\\uf3ff|\\uf596\\uf3fb|\\uf596\\uf3fc|\\uf596\\uf3fd|\\uf596\\uf3fe|\\uf596\\uf3ff|\\uf918\\uf3fb|\\uf918\\uf3fc|\\uf918\\uf3fd|\\uf918\\uf3fe|\\uf918\\uf3ff|\\uf919\\uf3fb|\\uf919\\uf3fc|\\uf919\\uf3fd|\\uf919\\uf3fe|\\uf919\\uf3ff|\\uf590\\uf3fb|\\uf590\\uf3fc|\\uf590\\uf3fd|\\uf590\\uf3fe|\\uf590\\uf3ff|\\u270b\\uf3fb|\\u270b\\uf3fc|\\u270b\\uf3fd|\\u270b\\uf3fe|\\u270b\\uf3ff|\\uf44c\\uf3fb|\\uf44c\\uf3fc|\\uf44c\\uf3fd|\\uf44c\\uf3fe|\\uf44c\\uf3ff|\\uf44d\\uf3fb|\\uf44d\\uf3fc|\\uf44d\\uf3fd|\\uf44d\\uf3fe|\\uf44d\\uf3ff|\\uf44e\\uf3fb|\\uf44e\\uf3fc|\\uf44e\\uf3fd|\\uf44e\\uf3fe|\\uf44e\\uf3ff|\\u270a\\uf3fb|\\u270a\\uf3fc|\\u270a\\uf3fd|\\u270a\\uf3fe|\\u270a\\uf3ff|\\uf44a\\uf3fb|\\uf44a\\uf3fc|\\uf44a\\uf3fd|\\uf44a\\uf3fe|\\uf44a\\uf3ff|\\uf91b\\uf3fb|\\uf91b\\uf3fc|\\uf91b\\uf3fd|\\uf91b\\uf3fe|\\uf91b\\uf3ff|\\uf91c\\uf3fb|\\uf91c\\uf3fc|\\uf91c\\uf3fd|\\uf91c\\uf3fe|\\uf91c\\uf3ff|\\uf91a\\uf3fb|\\uf91a\\uf3fc|\\uf91a\\uf3fd|\\uf91a\\uf3fe|\\uf91a\\uf3ff|\\uf44b\\uf3fb|\\uf44b\\uf3fc|\\uf44b\\uf3fd|\\uf44b\\uf3fe|\\uf44b\\uf3ff|\\uf91f\\uf3fb|\\uf91f\\uf3fc|\\uf91f\\uf3fd|\\uf91f\\uf3fe|\\uf91f\\uf3ff|\\u270d\\uf3fb|\\u270d\\uf3fc|\\u270d\\uf3fd|\\u270d\\uf3fe|\\u270d\\uf3ff|\\uf44f\\uf3fb|\\uf44f\\uf3fc|\\uf44f\\uf3fd|\\uf44f\\uf3fe|\\uf44f\\uf3ff|\\uf450\\uf3fb|\\uf450\\uf3fc|\\uf450\\uf3fd|\\uf450\\uf3fe|\\uf450\\uf3ff|\\uf64c\\uf3fb|\\uf64c\\uf3fc|\\uf64c\\uf3fd|\\uf64c\\uf3fe|\\uf64c\\uf3ff|\\uf932\\uf3fb|\\uf932\\uf3fc|\\uf932\\uf3fd|\\uf932\\uf3fe|\\uf932\\uf3ff|\\uf64f\\uf3fb|\\uf64f\\uf3fc|\\uf64f\\uf3fd|\\uf64f\\uf3fe|\\uf64f\\uf3ff|\\uf485\\uf3fb|\\uf485\\uf3fc|\\uf485\\uf3fd|\\uf485\\uf3fe|\\uf485\\uf3ff|\\uf442\\uf3fb|\\uf442\\uf3fc|\\uf442\\uf3fd|\\uf442\\uf3fe|\\uf442\\uf3ff|\\uf443\\uf3fb|\\uf443\\uf3fc|\\uf443\\uf3fd|\\uf443\\uf3fe|\\uf443\\uf3ff|\\uf1e6\\uf1e8|\\uf1e6\\uf1e9|\\uf1e6\\uf1ea|\\uf1e6\\uf1eb|\\uf1e6\\uf1ec|\\uf1e6\\uf1ee|\\uf1e6\\uf1f1|\\uf1e6\\uf1f2|\\uf1e6\\uf1f4|\\uf1e6\\uf1f6|\\uf1e6\\uf1f7|\\uf1e6\\uf1f8|\\uf1e6\\uf1f9|\\uf1e6\\uf1fa|\\uf1e6\\uf1fc|\\uf1e6\\uf1fd|\\uf1e6\\uf1ff|\\uf1e7\\uf1e6|\\uf1e7\\uf1e7|\\uf1e7\\uf1e9|\\uf1e7\\uf1ea|\\uf1e7\\uf1eb|\\uf1e7\\uf1ec|\\uf1e7\\uf1ed|\\uf1e7\\uf1ee|\\uf1e7\\uf1ef|\\uf1e7\\uf1f1|\\uf1e7\\uf1f2|\\uf1e7\\uf1f3|\\uf1e7\\uf1f4|\\uf1e7\\uf1f6|\\uf1e7\\uf1f7|\\uf1e7\\uf1f8|\\uf1e7\\uf1f9|\\uf1e7\\uf1fb|\\uf1e7\\uf1fc|\\uf1e7\\uf1fe|\\uf1e7\\uf1ff|\\uf1e8\\uf1e6|\\uf1e8\\uf1e8|\\uf1e8\\uf1e9|\\uf1e8\\uf1eb|\\uf1e8\\uf1ec|\\uf1e8\\uf1ed|\\uf1e8\\uf1ee|\\uf1e8\\uf1f0|\\uf1e8\\uf1f1|\\uf1e8\\uf1f2|\\uf1e8\\uf1f3|\\uf1e8\\uf1f4|\\uf1e8\\uf1f5|\\uf1e8\\uf1f7|\\uf1e8\\uf1fa|\\uf1e8\\uf1fb|\\uf1e8\\uf1fc|\\uf1e8\\uf1fd|\\uf1e8\\uf1fe|\\uf1e8\\uf1ff|\\uf1e9\\uf1ea|\\uf1e9\\uf1ec|\\uf1e9\\uf1ef|\\uf1e9\\uf1f0|\\uf1e9\\uf1f2|\\uf1e9\\uf1f4|\\uf1e9\\uf1ff|\\uf1ea\\uf1e6|\\uf1ea\\uf1e8|\\uf1ea\\uf1ea|\\uf1ea\\uf1ec|\\uf1ea\\uf1ed|\\uf1ea\\uf1f7|\\uf1ea\\uf1f8|\\uf1ea\\uf1f9|\\uf1ea\\uf1fa|\\uf1eb\\uf1ee|\\uf1eb\\uf1ef|\\uf1eb\\uf1f0|\\uf1eb\\uf1f2|\\uf1eb\\uf1f4|\\uf1eb\\uf1f7|\\uf1ec\\uf1e6|\\uf1ec\\uf1e7|\\uf1ec\\uf1e9|\\uf1ec\\uf1ea|\\uf1ec\\uf1eb|\\uf1ec\\uf1ec|\\uf1ec\\uf1ed|\\uf1ec\\uf1ee|\\uf1ec\\uf1f1|\\uf1ec\\uf1f2|\\uf1ec\\uf1f3|\\uf1ec\\uf1f5|\\uf1ec\\uf1f6|\\uf1ec\\uf1f7|\\uf1ec\\uf1f8|\\uf1ec\\uf1f9|\\uf1ec\\uf1fa|\\uf1ec\\uf1fc|\\uf1ec\\uf1fe|\\uf1ed\\uf1f0|\\uf1ed\\uf1f2|\\uf1ed\\uf1f3|\\uf1ed\\uf1f7|\\uf1ed\\uf1f9|\\uf1ed\\uf1fa|\\uf1ee\\uf1e8|\\uf1ee\\uf1e9|\\uf1ee\\uf1ea|\\uf1ee\\uf1f1|\\uf1ee\\uf1f2|\\uf1ee\\uf1f3|\\uf1ee\\uf1f4|\\uf1ee\\uf1f6|\\uf1ee\\uf1f7|\\uf1ee\\uf1f8|\\uf1ee\\uf1f9|\\uf1ef\\uf1ea|\\uf1ef\\uf1f2|\\uf1ef\\uf1f4|\\uf1ef\\uf1f5|\\uf1f0\\uf1ea|\\uf1f0\\uf1ec|\\uf1f0\\uf1ed|\\uf1f0\\uf1ee|\\uf1f0\\uf1f2|\\uf1f0\\uf1f3|\\uf1f0\\uf1f5|\\uf1f0\\uf1f7|\\uf1f0\\uf1fc|\\uf1f0\\uf1fe|\\uf1f0\\uf1ff|\\uf1f1\\uf1e6|\\uf1f1\\uf1e7|\\uf1f1\\uf1e8|\\uf1f1\\uf1ee|\\uf1f1\\uf1f0|\\uf1f1\\uf1f7|\\uf1f1\\uf1f8|\\uf1f1\\uf1f9|\\uf1f1\\uf1fa|\\uf1f1\\uf1fb|\\uf1f1\\uf1fe|\\uf1f2\\uf1e6|\\uf1f2\\uf1e8|\\uf1f2\\uf1e9|\\uf1f2\\uf1ea|\\uf1f2\\uf1eb|\\uf1f2\\uf1ec|\\uf1f2\\uf1ed|\\uf1f2\\uf1f0|\\uf1f2\\uf1f1|\\uf1f2\\uf1f2|\\uf1f2\\uf1f3|\\uf1f2\\uf1f4|\\uf1f2\\uf1f5|\\uf1f2\\uf1f6|\\uf1f2\\uf1f7|\\uf1f2\\uf1f8|\\uf1f2\\uf1f9|\\uf1f2\\uf1fa|\\uf1f2\\uf1fb|\\uf1f2\\uf1fc|\\uf1f2\\uf1fd|\\uf1f2\\uf1fe|\\uf1f2\\uf1ff|\\uf1f3\\uf1e6|\\uf1f3\\uf1e8|\\uf1f3\\uf1ea|\\uf1f3\\uf1eb|\\uf1f3\\uf1ec|\\uf1f3\\uf1ee|\\uf1f3\\uf1f1|\\uf1f3\\uf1f4|\\uf1f3\\uf1f5|\\uf1f3\\uf1f7|\\uf1f3\\uf1fa|\\uf1f3\\uf1ff|\\uf1f4\\uf1f2|\\uf1f5\\uf1e6|\\uf1f5\\uf1ea|\\uf1f5\\uf1eb|\\uf1f5\\uf1ec|\\uf1f5\\uf1ed|\\uf1f5\\uf1f0|\\uf1f5\\uf1f1|\\uf1f5\\uf1f2|\\uf1f5\\uf1f3|\\uf1f5\\uf1f7|\\uf1f5\\uf1f8|\\uf1f5\\uf1f9|\\uf1f5\\uf1fc|\\uf1f5\\uf1fe|\\uf1f6\\uf1e6|\\uf1f7\\uf1ea|\\uf1f7\\uf1f4|\\uf1f7\\uf1f8|\\uf1f7\\uf1fa|\\uf1f7\\uf1fc|\\uf1f8\\uf1e6|\\uf1f8\\uf1e7|\\uf1f8\\uf1e8|\\uf1f8\\uf1e9|\\uf1f8\\uf1ea|\\uf1f8\\uf1ec|\\uf1f8\\uf1ed|\\uf1f8\\uf1ee|\\uf1f8\\uf1ef|\\uf1f8\\uf1f0|\\uf1f8\\uf1f1|\\uf1f8\\uf1f2|\\uf1f8\\uf1f3|\\uf1f8\\uf1f4|\\uf1f8\\uf1f7|\\uf1f8\\uf1f8|\\uf1f8\\uf1f9|\\uf1f8\\uf1fb|\\uf1f8\\uf1fd|\\uf1f8\\uf1fe|\\uf1f8\\uf1ff|\\uf1f9\\uf1e6|\\uf1f9\\uf1e8|\\uf1f9\\uf1e9|\\uf1f9\\uf1eb|\\uf1f9\\uf1ec|\\uf1f9\\uf1ed|\\uf1f9\\uf1ef|\\uf1f9\\uf1f0|\\uf1f9\\uf1f1|\\uf1f9\\uf1f2|\\uf1f9\\uf1f3|\\uf1f9\\uf1f4|\\uf1f9\\uf1f7|\\uf1f9\\uf1f9|\\uf1f9\\uf1fb|\\uf1f9\\uf1fc|\\uf1f9\\uf1ff|\\uf1fa\\uf1e6|\\uf1fa\\uf1ec|\\uf1fa\\uf1f2|\\uf1fa\\uf1f3|\\uf1fa\\uf1f8|\\uf1fa\\uf1fe|\\uf1fa\\uf1ff|\\uf1fb\\uf1e6|\\uf1fb\\uf1e8|\\uf1fb\\uf1ea|\\uf1fb\\uf1ec|\\uf1fb\\uf1ee|\\uf1fb\\uf1f3|\\uf1fb\\uf1fa|\\uf1fc\\uf1eb|\\uf1fc\\uf1f8|\\uf1fd\\uf1f0|\\uf1fe\\uf1ea|\\uf1fe\\uf1f9|\\uf1ff\\uf1e6|\\uf1ff\\uf1f2|\\uf1ff\\uf1fc|\\uf600|\\uf601|\\uf602|\\uf923|\\uf603|\\uf604|\\uf605|\\uf606|\\uf609|\\uf60a|\\uf60b|\\uf60e|\\uf60d|\\uf618|\\uf617|\\uf619|\\uf61a|\\u263a|\\uf642|\\uf917|\\uf929|\\uf914|\\uf928|\\uf610|\\uf611|\\uf636|\\uf644|\\uf60f|\\uf623|\\uf625|\\uf62e|\\uf910|\\uf62f|\\uf62a|\\uf62b|\\uf634|\\uf60c|\\uf61b|\\uf61c|\\uf61d|\\uf924|\\uf612|\\uf613|\\uf614|\\uf615|\\uf643|\\uf911|\\uf632|\\u2639|\\uf641|\\uf616|\\uf61e|\\uf61f|\\uf624|\\uf622|\\uf62d|\\uf626|\\uf627|\\uf628|\\uf629|\\uf92f|\\uf62c|\\uf630|\\uf631|\\uf633|\\uf92a|\\uf635|\\uf621|\\uf620|\\uf92c|\\uf637|\\uf912|\\uf915|\\uf922|\\uf92e|\\uf927|\\uf607|\\uf920|\\uf921|\\uf925|\\uf92b|\\uf92d|\\uf9d0|\\uf913|\\uf608|\\uf47f|\\uf479|\\uf47a|\\uf480|\\u2620|\\uf47b|\\uf47d|\\uf47e|\\uf916|\\uf4a9|\\uf63a|\\uf638|\\uf639|\\uf63b|\\uf63c|\\uf63d|\\uf640|\\uf63f|\\uf63e|\\uf648|\\uf649|\\uf64a|\\uf476|\\uf9d2|\\uf466|\\uf467|\\uf9d1|\\uf468|\\uf469|\\uf9d3|\\uf474|\\uf475|\\uf46e|\\uf575|\\uf482|\\uf477|\\uf934|\\uf478|\\uf473|\\uf472|\\uf9d5|\\uf9d4|\\uf471|\\uf935|\\uf470|\\uf930|\\uf931|\\uf47c|\\uf385|\\uf936|\\uf9d9|\\uf9da|\\uf9db|\\uf9dc|\\uf9dd|\\uf9de|\\uf9df|\\uf64d|\\uf64e|\\uf645|\\uf646|\\uf481|\\uf64b|\\uf647|\\uf926|\\uf937|\\uf486|\\uf487|\\uf6b6|\\uf3c3|\\uf483|\\uf57a|\\uf46f|\\uf9d6|\\uf9d7|\\uf9d8|\\uf6c0|\\uf6cc|\\uf574|\\uf5e3|\\uf464|\\uf465|\\uf93a|\\uf3c7|\\u26f7|\\uf3c2|\\uf3cc|\\uf3c4|\\uf6a3|\\uf3ca|\\u26f9|\\uf3cb|\\uf6b4|\\uf6b5|\\uf3ce|\\uf3cd|\\uf938|\\uf93c|\\uf93d|\\uf93e|\\uf939|\\uf46b|\\uf46c|\\uf46d|\\uf48f|\\uf491|\\uf46a|\\uf933|\\uf4aa|\\uf448|\\uf449|\\u261d|\\uf446|\\uf595|\\uf447|\\u270c|\\uf91e|\\uf596|\\uf918|\\uf919|\\uf590|\\u270b|\\uf44c|\\uf44d|\\uf44e|\\u270a|\\uf44a|\\uf91b|\\uf91c|\\uf91a|\\uf44b|\\uf91f|\\u270d|\\uf44f|\\uf450|\\uf64c|\\uf932|\\uf64f|\\uf91d|\\uf485|\\uf442|\\uf443|\\uf463|\\uf440|\\uf441|\\uf9e0|\\uf445|\\uf444|\\uf48b|\\uf498|\\u2764|\\uf493|\\uf494|\\uf495|\\uf496|\\uf497|\\uf499|\\uf49a|\\uf49b|\\uf9e1|\\uf49c|\\uf5a4|\\uf49d|\\uf49e|\\uf49f|\\u2763|\\uf48c|\\uf4a4|\\uf4a2|\\uf4a3|\\uf4a5|\\uf4a6|\\uf4a8|\\uf4ab|\\uf4ac|\\uf5e8|\\uf5ef|\\uf4ad|\\uf573|\\uf453|\\uf576|\\uf454|\\uf455|\\uf456|\\uf9e3|\\uf9e4|\\uf9e5|\\uf9e6|\\uf457|\\uf458|\\uf459|\\uf45a|\\uf45b|\\uf45c|\\uf45d|\\uf6cd|\\uf392|\\uf45e|\\uf45f|\\uf460|\\uf461|\\uf462|\\uf451|\\uf452|\\uf3a9|\\uf393|\\uf9e2|\\u26d1|\\uf4ff|\\uf484|\\uf48d|\\uf48e|\\uf435|\\uf412|\\uf98d|\\uf436|\\uf415|\\uf429|\\uf43a|\\uf98a|\\uf431|\\uf408|\\uf981|\\uf42f|\\uf405|\\uf406|\\uf434|\\uf40e|\\uf984|\\uf993|\\uf98c|\\uf42e|\\uf402|\\uf403|\\uf404|\\uf437|\\uf416|\\uf417|\\uf43d|\\uf40f|\\uf411|\\uf410|\\uf42a|\\uf42b|\\uf992|\\uf418|\\uf98f|\\uf42d|\\uf401|\\uf400|\\uf439|\\uf430|\\uf407|\\uf43f|\\uf994|\\uf987|\\uf43b|\\uf428|\\uf43c|\\uf43e|\\uf983|\\uf414|\\uf413|\\uf423|\\uf424|\\uf425|\\uf426|\\uf427|\\uf54a|\\uf985|\\uf986|\\uf989|\\uf438|\\uf40a|\\uf422|\\uf98e|\\uf40d|\\uf432|\\uf409|\\uf995|\\uf996|\\uf433|\\uf40b|\\uf42c|\\uf41f|\\uf420|\\uf421|\\uf988|\\uf419|\\uf41a|\\uf980|\\uf990|\\uf991|\\uf40c|\\uf98b|\\uf41b|\\uf41c|\\uf41d|\\uf41e|\\uf997|\\uf577|\\uf578|\\uf982|\\uf490|\\uf338|\\uf4ae|\\uf3f5|\\uf339|\\uf940|\\uf33a|\\uf33b|\\uf33c|\\uf337|\\uf331|\\uf332|\\uf333|\\uf334|\\uf335|\\uf33e|\\uf33f|\\u2618|\\uf340|\\uf341|\\uf342|\\uf343|\\uf347|\\uf348|\\uf349|\\uf34a|\\uf34b|\\uf34c|\\uf34d|\\uf34e|\\uf34f|\\uf350|\\uf351|\\uf352|\\uf353|\\uf95d|\\uf345|\\uf965|\\uf951|\\uf346|\\uf954|\\uf955|\\uf33d|\\uf336|\\uf952|\\uf966|\\uf344|\\uf95c|\\uf330|\\uf35e|\\uf950|\\uf956|\\uf968|\\uf95e|\\uf9c0|\\uf356|\\uf357|\\uf969|\\uf953|\\uf354|\\uf35f|\\uf355|\\uf32d|\\uf96a|\\uf32e|\\uf32f|\\uf959|\\uf95a|\\uf373|\\uf958|\\uf372|\\uf963|\\uf957|\\uf37f|\\uf96b|\\uf371|\\uf358|\\uf359|\\uf35a|\\uf35b|\\uf35c|\\uf35d|\\uf360|\\uf362|\\uf363|\\uf364|\\uf365|\\uf361|\\uf95f|\\uf960|\\uf961|\\uf366|\\uf367|\\uf368|\\uf369|\\uf36a|\\uf382|\\uf370|\\uf967|\\uf36b|\\uf36c|\\uf36d|\\uf36e|\\uf36f|\\uf37c|\\uf95b|\\u2615|\\uf375|\\uf376|\\uf37e|\\uf377|\\uf378|\\uf379|\\uf37a|\\uf37b|\\uf942|\\uf943|\\uf964|\\uf962|\\uf37d|\\uf374|\\uf944|\\uf52a|\\uf3fa|\\uf30d|\\uf30e|\\uf30f|\\uf310|\\uf5fa|\\uf5fe|\\uf3d4|\\u26f0|\\uf30b|\\uf5fb|\\uf3d5|\\uf3d6|\\uf3dc|\\uf3dd|\\uf3de|\\uf3df|\\uf3db|\\uf3d7|\\uf3d8|\\uf3d9|\\uf3da|\\uf3e0|\\uf3e1|\\uf3e2|\\uf3e3|\\uf3e4|\\uf3e5|\\uf3e6|\\uf3e8|\\uf3e9|\\uf3ea|\\uf3eb|\\uf3ec|\\uf3ed|\\uf3ef|\\uf3f0|\\uf492|\\uf5fc|\\uf5fd|\\u26ea|\\uf54c|\\uf54d|\\u26e9|\\uf54b|\\u26f2|\\u26fa|\\uf301|\\uf303|\\uf304|\\uf305|\\uf306|\\uf307|\\uf309|\\u2668|\\uf30c|\\uf3a0|\\uf3a1|\\uf3a2|\\uf488|\\uf3aa|\\uf3ad|\\uf5bc|\\uf3a8|\\uf3b0|\\uf682|\\uf683|\\uf684|\\uf685|\\uf686|\\uf687|\\uf688|\\uf689|\\uf68a|\\uf69d|\\uf69e|\\uf68b|\\uf68c|\\uf68d|\\uf68e|\\uf690|\\uf691|\\uf692|\\uf693|\\uf694|\\uf695|\\uf696|\\uf697|\\uf698|\\uf699|\\uf69a|\\uf69b|\\uf69c|\\uf6b2|\\uf6f4|\\uf6f5|\\uf68f|\\uf6e3|\\uf6e4|\\u26fd|\\uf6a8|\\uf6a5|\\uf6a6|\\uf6a7|\\uf6d1|\\u2693|\\u26f5|\\uf6f6|\\uf6a4|\\uf6f3|\\u26f4|\\uf6e5|\\uf6a2|\\u2708|\\uf6e9|\\uf6eb|\\uf6ec|\\uf4ba|\\uf681|\\uf69f|\\uf6a0|\\uf6a1|\\uf6f0|\\uf680|\\uf6f8|\\uf6ce|\\uf6aa|\\uf6cf|\\uf6cb|\\uf6bd|\\uf6bf|\\uf6c1|\\u231b|\\u23f3|\\u231a|\\u23f0|\\u23f1|\\u23f2|\\uf570|\\uf55b|\\uf567|\\uf550|\\uf55c|\\uf551|\\uf55d|\\uf552|\\uf55e|\\uf553|\\uf55f|\\uf554|\\uf560|\\uf555|\\uf561|\\uf556|\\uf562|\\uf557|\\uf563|\\uf558|\\uf564|\\uf559|\\uf565|\\uf55a|\\uf566|\\uf311|\\uf312|\\uf313|\\uf314|\\uf315|\\uf316|\\uf317|\\uf318|\\uf319|\\uf31a|\\uf31b|\\uf31c|\\uf321|\\u2600|\\uf31d|\\uf31e|\\u2b50|\\uf31f|\\uf320|\\u2601|\\u26c5|\\u26c8|\\uf324|\\uf325|\\uf326|\\uf327|\\uf328|\\uf329|\\uf32a|\\uf32b|\\uf32c|\\uf300|\\uf308|\\uf302|\\u2602|\\u2614|\\u26f1|\\u26a1|\\u2744|\\u2603|\\u26c4|\\u2604|\\uf525|\\uf4a7|\\uf30a|\\uf383|\\uf384|\\uf386|\\uf387|\\u2728|\\uf388|\\uf389|\\uf38a|\\uf38b|\\uf38d|\\uf38e|\\uf38f|\\uf390|\\uf391|\\uf380|\\uf381|\\uf397|\\uf39f|\\uf3ab|\\uf396|\\uf3c6|\\uf3c5|\\uf947|\\uf948|\\uf949|\\u26bd|\\u26be|\\uf3c0|\\uf3d0|\\uf3c8|\\uf3c9|\\uf3be|\\uf3b1|\\uf3b3|\\uf3cf|\\uf3d1|\\uf3d2|\\uf3d3|\\uf3f8|\\uf94a|\\uf94b|\\uf945|\\uf3af|\\u26f3|\\u26f8|\\uf3a3|\\uf3bd|\\uf3bf|\\uf6f7|\\uf94c|\\uf3ae|\\uf579|\\uf3b2|\\u2660|\\u2665|\\u2666|\\u2663|\\uf0cf|\\uf004|\\uf3b4|\\uf507|\\uf508|\\uf509|\\uf50a|\\uf4e2|\\uf4e3|\\uf4ef|\\uf514|\\uf515|\\uf3bc|\\uf3b5|\\uf3b6|\\uf399|\\uf39a|\\uf39b|\\uf3a4|\\uf3a7|\\uf4fb|\\uf3b7|\\uf3b8|\\uf3b9|\\uf3ba|\\uf3bb|\\uf941|\\uf4f1|\\uf4f2|\\u260e|\\uf4de|\\uf4df|\\uf4e0|\\uf50b|\\uf50c|\\uf4bb|\\uf5a5|\\uf5a8|\\u2328|\\uf5b1|\\uf5b2|\\uf4bd|\\uf4be|\\uf4bf|\\uf4c0|\\uf3a5|\\uf39e|\\uf4fd|\\uf3ac|\\uf4fa|\\uf4f7|\\uf4f8|\\uf4f9|\\uf4fc|\\uf50d|\\uf50e|\\uf52c|\\uf52d|\\uf4e1|\\uf56f|\\uf4a1|\\uf526|\\uf3ee|\\uf4d4|\\uf4d5|\\uf4d6|\\uf4d7|\\uf4d8|\\uf4d9|\\uf4da|\\uf4d3|\\uf4d2|\\uf4c3|\\uf4dc|\\uf4c4|\\uf4f0|\\uf5de|\\uf4d1|\\uf516|\\uf3f7|\\uf4b0|\\uf4b4|\\uf4b5|\\uf4b6|\\uf4b7|\\uf4b8|\\uf4b3|\\uf4b9|\\uf4b1|\\uf4b2|\\u2709|\\uf4e7|\\uf4e8|\\uf4e9|\\uf4e4|\\uf4e5|\\uf4e6|\\uf4eb|\\uf4ea|\\uf4ec|\\uf4ed|\\uf4ee|\\uf5f3|\\u270f|\\u2712|\\uf58b|\\uf58a|\\uf58c|\\uf58d|\\uf4dd|\\uf4bc|\\uf4c1|\\uf4c2|\\uf5c2|\\uf4c5|\\uf4c6|\\uf5d2|\\uf5d3|\\uf4c7|\\uf4c8|\\uf4c9|\\uf4ca|\\uf4cb|\\uf4cc|\\uf4cd|\\uf4ce|\\uf587|\\uf4cf|\\uf4d0|\\u2702|\\uf5c3|\\uf5c4|\\uf5d1|\\uf512|\\uf513|\\uf50f|\\uf510|\\uf511|\\uf5dd|\\uf528|\\u26cf|\\u2692|\\uf6e0|\\uf5e1|\\u2694|\\uf52b|\\uf3f9|\\uf6e1|\\uf527|\\uf529|\\u2699|\\uf5dc|\\u2697|\\u2696|\\uf517|\\u26d3|\\uf489|\\uf48a|\\uf6ac|\\u26b0|\\u26b1|\\uf5ff|\\uf6e2|\\uf52e|\\uf6d2|\\uf3e7|\\uf6ae|\\uf6b0|\\u267f|\\uf6b9|\\uf6ba|\\uf6bb|\\uf6bc|\\uf6be|\\uf6c2|\\uf6c3|\\uf6c4|\\uf6c5|\\u26a0|\\uf6b8|\\u26d4|\\uf6ab|\\uf6b3|\\uf6ad|\\uf6af|\\uf6b1|\\uf6b7|\\uf4f5|\\uf51e|\\u2622|\\u2623|\\u2b06|\\u2197|\\u27a1|\\u2198|\\u2b07|\\u2199|\\u2b05|\\u2196|\\u2195|\\u2194|\\u21a9|\\u21aa|\\u2934|\\u2935|\\uf503|\\uf504|\\uf519|\\uf51a|\\uf51b|\\uf51c|\\uf51d|\\uf6d0|\\u269b|\\uf549|\\u2721|\\u2638|\\u262f|\\u271d|\\u2626|\\u262a|\\u262e|\\uf54e|\\uf52f|\\u2648|\\u2649|\\u264a|\\u264b|\\u264c|\\u264d|\\u264e|\\u264f|\\u2650|\\u2651|\\u2652|\\u2653|\\u26ce|\\uf500|\\uf501|\\uf502|\\u25b6|\\u23e9|\\u23ed|\\u23ef|\\u25c0|\\u23ea|\\u23ee|\\uf53c|\\u23eb|\\uf53d|\\u23ec|\\u23f8|\\u23f9|\\u23fa|\\u23cf|\\uf3a6|\\uf505|\\uf506|\\uf4f6|\\uf4f3|\\uf4f4|\\u2640|\\u2642|\\u2695|\\u267b|\\u269c|\\uf531|\\uf4db|\\uf530|\\u2b55|\\u2705|\\u2611|\\u2714|\\u2716|\\u274c|\\u274e|\\u2795|\\u2796|\\u2797|\\u27b0|\\u27bf|\\u303d|\\u2733|\\u2734|\\u2747|\\u203c|\\u2049|\\u2753|\\u2754|\\u2755|\\u2757|\\u3030|\\u00a9|\\u00ae|\\u2122|\\uf51f|\\uf4af|\\uf520|\\uf521|\\uf522|\\uf523|\\uf524|\\uf170|\\uf18e|\\uf171|\\uf191|\\uf192|\\uf193|\\u2139|\\uf194|\\u24c2|\\uf195|\\uf196|\\uf17e|\\uf197|\\uf17f|\\uf198|\\uf199|\\uf19a|\\uf201|\\uf202|\\uf237|\\uf236|\\uf22f|\\uf250|\\uf239|\\uf21a|\\uf232|\\uf251|\\uf238|\\uf234|\\uf233|\\u3297|\\u3299|\\uf23a|\\uf235|\\u25aa|\\u25ab|\\u25fb|\\u25fc|\\u25fd|\\u25fe|\\u2b1b|\\u2b1c|\\uf536|\\uf537|\\uf538|\\uf539|\\uf53a|\\uf53b|\\uf4a0|\\uf518|\\uf532|\\uf533|\\u26aa|\\u26ab|\\uf534|\\uf535|\\uf3c1|\\uf6a9|\\uf38c|\\uf3f4|\\uf3f3/g;\n\n    var EmojiReg;\n\n    var EmojiList = [];\n\n    var isIE8 = document.all && !document.addEventListener;\n\n    // emoji 详情, 扩展时往后叠加\n    var EmojiFactory = {\n        \"u1F603\": { \"en\": \"Smiley Face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F600\": { \"en\": \"Grinning Face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F60A\": { \"en\": \"Smiley\", \"zh\": \"微笑\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u263A\": { \"en\": \"Cute\", \"zh\": \"萌萌哒\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F609\": { \"en\": \"Winking Face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F60D\": { \"en\": \"Heart Eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F618\": { \"en\": \"Blowing Kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F61A\": { \"en\": \"Kiss Face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"Crazy Face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"Tongue Out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F633\": { \"en\": \"Flushed Face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F601\": { \"en\": \"Grinning With Smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F614\": { \"en\": \"Pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F60C\": { \"en\": \"Pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F612\": { \"en\": \"Dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F61F\": { \"en\": \"Worried Face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F61E\": { \"en\": \"Disappointed Face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F623\": { \"en\": \"Helpless Face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F62D\": { \"en\": \"Crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-425px 0px\" },\n        \"u1F602\": { \"en\": \"Laughing Tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F622\": { \"en\": \"Sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-2075px 0px\" },\n        \"u1F62A\": { \"en\": \"Sleepy Face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F630\": { \"en\": \"Cold Sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F605\": { \"en\": \"Happy Sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F613\": { \"en\": \"Sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F62B\": { \"en\": \"Tired Face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F629\": { \"en\": \"Weary Face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F628\": { \"en\": \"Fearful Face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F631\": { \"en\": \"Scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F621\": { \"en\": \"Angry Face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F624\": { \"en\": \"Mad Face\", \"zh\": \"怒气冲冲\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F616\": { \"en\": \"Confounded Face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F606\": { \"en\": \"Big Grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F60B\": { \"en\": \"Hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F637\": { \"en\": \"Mask Face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F60E\": { \"en\": \"Sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F634\": { \"en\": \"Sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"Dizzy Face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F632\": { \"en\": \"Shocked Face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F608\": { \"en\": \"Purple Devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F47F\": { \"en\": \"Devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F62F\": { \"en\": \"Surprised Face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F62C\": { \"en\": \"Grimacing Face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F615\": { \"en\": \"Confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F636\": { \"en\": \"Mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F607\": { \"en\": \"Halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F60F\": { \"en\": \"Smirking Face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F611\": { \"en\": \"Expressionless Face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F648\": { \"en\": \"See No Monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"Hear No Monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F64A\": { \"en\": \"No Speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F47D\": { \"en\": \"Alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F4A9\": { \"en\": \"Pile Of Poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F494\": { \"en\": \"Broken Heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"Fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F4A2\": { \"en\": \"Anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A4\": { \"en\": \"Zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F6AB\": { \"en\": \"Prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u2B50\": { \"en\": \"Star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u26A1\": { \"en\": \"Lightning Bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u1F319\": { \"en\": \"Drescent Moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u2600\": { \"en\": \"Sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u26C5\": { \"en\": \"Cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u2601\": { \"en\": \"Cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2744\": { \"en\": \"Snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" },\n        \"u2614\": { \"en\": \"Umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u26C4\": { \"en\": \"Snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u1F44D\": { \"en\": \"Thumbs Up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"Thumbs Down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F91D\": { \"en\": \"Handshake\", \"zh\": \"握手\", \"tag\": \"\\uD83E\\uDD1D\", \"position\": \"-3200px 0px\" },\n        \"u1F44C\": { \"en\": \"Ok Hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44A\": { \"en\": \"Raised Fist\", \"zh\": \"举起拳头\", \"tag\": \"\\u270A\", \"position\": \"-2975px 0px\" },\n        \"u270A\": { \"en\": \"Oncoming Fist\", \"zh\": \"击拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-1350px 0px\" },\n        \"u270C\": { \"en\": \"Victory Hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270B\": { \"en\": \"Raised Hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u1F64F\": { \"en\": \"Folded Hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u261D\": { \"en\": \"Pointing Up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u1F44F\": { \"en\": \"Clapping Hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F4AA\": { \"en\": \"Flexed Biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F46A\": { \"en\": \"Family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"Couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F47C\": { \"en\": \"Baby Angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F434\": { \"en\": \"Horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"Dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"Pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F47B\": { \"en\": \"Ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F339\": { \"en\": \"Rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F33B\": { \"en\": \"Sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F332\": { \"en\": \"Pine Tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F384\": { \"en\": \"Christmas Tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F381\": { \"en\": \"Wrapped Gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F389\": { \"en\": \"Party Popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F4B0\": { \"en\": \"Money Bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F382\": { \"en\": \"Birthday Cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F356\": { \"en\": \"Barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F35A\": { \"en\": \"Cooked Rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F366\": { \"en\": \"Ice Cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F36B\": { \"en\": \"Chocolate Bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F349\": { \"en\": \"Watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F377\": { \"en\": \"Wine Glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F37B\": { \"en\": \"Cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u2615\": { \"en\": \"Coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u1F3C0\": { \"en\": \"Basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u26BD\": { \"en\": \"Soccer Ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u1F3C2\": { \"en\": \"Snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3A4\": { \"en\": \"Microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B5\": { \"en\": \"Musical Note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3B2\": { \"en\": \"Game Die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F004\": { \"en\": \"Mahjong Red Dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F451\": { \"en\": \"Crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"Lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F48B\": { \"en\": \"Kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"Ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F4DA\": { \"en\": \"Books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F393\": { \"en\": \"Graduation Cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u270F\": { \"en\": \"Pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u1F3E1\": { \"en\": \"House With Garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F6BF\": { \"en\": \"Shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F4A1\": { \"en\": \"Light Bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4DE\": { \"en\": \"Telephone Receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"Loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F556\": { \"en\": \"Clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u23F0\": { \"en\": \"Alarm Clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"Hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u1F4A3\": { \"en\": \"Bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F52B\": { \"en\": \"Pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F48A\": { \"en\": \"Capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F680\": { \"en\": \"Rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u1F30F\": { \"en\": \"Globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" }\n    };\n\n    var Config = {\n        url: getOnlineImagePath(),\n        size: DefaultSize,\n        lang: DefaultLang,\n        reg: UnicodeReg\n    };\n\n    var Utils = {\n        extend: function() {\n            if (arguments.length === 0) {\n                return;\n            }\n            var obj = arguments[0];\n            for (var i = 1, len = arguments.length; i < len; i ++) {\n                var other = arguments[i];\n                for (var item in other) {\n                    obj[item] = other[item];\n                }\n            }\n            return obj;\n        },\n        filter: function(arr, func) {\n            var array = [];\n            for (var i = 0; i < arr.length; i++) {\n                var value = arr[i];\n                if (func(value)) {\n                    array.push(value);\n                }\n            }\n            return array;\n        },\n        cutString: function(string, start, length) {\n            var array = [];\n            for (var i = start; i < start + length; i++) {\n                array.push(string.charAt(i));\n            }\n            return array.join('');\n        },\n        map: function(arr, func) {\n            var tempArr = arr.concat([]);\n            for (var i = 0; i < tempArr.length; i++) {\n                var value = tempArr[i];\n                if (func && typeof func === \"function\") {\n                    tempArr[i] = func(value);\n                }\n            }\n            return tempArr;\n        },\n        indexOf: function(array, value) {\n            if (typeof array === \"string\") {\n                for (var i = 0; i <= array.length - value.length; i++) {\n                    var string = Utils.cutString(array, i, value.length);\n                    if (array.charAt(i) == value.charAt(0) && Utils.cutString(array, i, value.length) == value) {\n                        return i;\n                    }\n                }\n            } else if (Object.prototype.toString.call(array) === '[object Array]') {\n                for (var i = 0; i < array.length; i++) {\n                    var item = array[i];\n                    if (item == value) {\n                        return i;\n                    }\n                }\n            }\n            return -1;\n        },\n        getDom: function(html) {\n            var div = document.createElement(\"div\");\n            div.innerHTML = html;\n            return div.childNodes[0];\n        },\n        render: function(temp, params) {\n            return temp.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n                return params[name] != undefined ? params[name] : match;\n            });\n        }\n    };\n\n    var CheckParam = {\n        getType: function(str) {\n            /* IE下不准确问题 */\n            if (str === undefined) {\n                return \"undefined\";\n            }\n            if (str === null) {\n                return \"null\";\n            }\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        },\n        check: function(typeList, funcName, params) {\n            params = params || [];\n            var maxCount = typeList.length;\n            if (params.length > maxCount) {\n                params.length = maxCount;\n            }\n            for (var i = 0; i < typeList.length; i++) {\n                var paramType = this.getType(params[i]);\n                var sucType = typeList[i];\n                if (!new RegExp(paramType).test(sucType)) {\n                    var msgTemp = \"第{{index}}个参数错误, 传入参数类型为: {{errType}}, 应传参数类型为: {{sucType}}, 错误所在位置为: {{funcName}}\";\n                    var msg = Utils.render(msgTemp, {\n                        index: i + 1,\n                        errType: paramType,\n                        sucType: sucType,\n                        funcName: funcName\n                    });\n                    console.error(msg);\n                }\n            }\n        }\n    };\n\n    var init = function(option) {\n        addBaseCss();\n        option = option || {};\n        Config = Utils.extend(Config, option);\n        extendEmojis(option.extension);\n        setEmojiReg();\n        setEmojiList();\n        adaptOldVersion();\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg     可选，匹配的正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后的字符串\n     */\n    var emojiToSymbol = function(content, reg, func) {\n        CheckParam.check(['string', 'regexp|null|undefined'], 'emojiToSymbol', arguments);\n        content = unicodeToEmoji(content, reg);\n        return content.replace(EmojiReg, function(tag) {\n            var lang = Config.lang;\n            var detail = getDetail('tag', tag);\n            var symbol = detail ? '[' + detail[lang] + ']' : tag;\n            return func ? func(symbol) : symbol;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} text 必填 包含symbol的字符串\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}\n     */\n    var symbolToEmoji = function(text, func) {\n        CheckParam.check(['string'], 'symbolToEmoji', arguments);\n        text = unicodeToEmoji(text);\n        var emojiText = text.replace(/\\[([^\\[\\]]+?)\\]/g, function(symbol) {\n            symbol = symbol.substr(1, symbol.length - 2);\n            var lang = Config.lang;\n            var detail = getDetail(lang, symbol);\n            return detail ? detail.tag : '[' + symbol + ']';\n        });\n        return emojiText.replace(EmojiReg, function(tag) {\n            return func ? func(tag) : tag;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} content 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx     可选，html标签的大小\n     * @param  {string} reg     可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(content, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"emojiToHTML\", arguments);\n        content = unicodeToEmoji(content, reg);\n        var htmlContent = content.replace(EmojiReg, function(tag) {\n            var html = getHTMLByEmoji(tag, sizePx);\n            return html || tag;\n        });\n        return htmlContent.replace(EmojiReg, function(tag) {\n            return func ? func(tag) : tag;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} text 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(text, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"symbolToHTML\", arguments);\n        var emojiText = text.replace(/\\[([^\\[\\]]+?)\\]/g, function(symbol) {\n            var text = symbolToEmoji(symbol);\n            return emojiToHTML(text, sizePx, reg);\n        });\n        return emojiText.replace(EmojiReg, function(tag) {\n            return func ? func(tag) : tag;\n        });\n    };\n\n    function getDetail(key, value) {\n        for (var unicode in EmojiFactory) {\n            var detail = EmojiFactory[unicode];\n            if (detail[key] === value) {\n                return detail;\n            }\n        }\n    }\n\n    function getHTMLByEmoji(emoji, sizePx) {\n        for (var key in EmojiFactory) {\n            var detail = EmojiFactory[key];\n            if (detail.tag === emoji) {\n                return getEmojiHTML(detail, sizePx);\n            }\n        }\n        return false;\n    }\n\n    function getEmojiHTML(item, sizePx) {\n        var size = sizePx || Config.size;\n        var position = getBgPosition(item.position, size);\n        if (isIE8) {\n            position = item.position;\n            size = Config.size;\n        }\n        var emojiObj = {\n            size: size,\n            position: position,\n            background: item.background || Config.url,\n            name: item[Config.lang],\n            tag: item.tag\n        };\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px; overflow: hidden; vertical-align: middle; font-size: 0 !important;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='{{style}}'></span>\"\n        spanTpl = Utils.render(spanTpl, { style: style });\n        return Utils.render(spanTpl, emojiObj);\n    }\n\n    function getBgPosition(position, sizePx) {\n        var size = sizePx || Config.size;\n        var baseSize = isIE8 ? 24 : 25;\n        var scale = size / baseSize;\n        position = position.split(\" \");\n        var x = position[0], y = position[1];\n        x = x ? x.split(\"px\")[0] : 0;\n        y = y ? y.split(\"px\")[0] : 0;\n        var positionTpl = '{{x}}px {{y}}px';\n        return Utils.render(positionTpl, {\n            x: parseInt(x) * scale,\n            y: parseInt(y) * scale\n        });\n    }\n\n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围\n     * @return {string}          转化后的字符串\n     */\n    function unicodeToEmoji(content, reg) {\n        reg = reg || Config.reg;\n        return content.replace(reg, function(unicode) {\n            return calculateUTF(unicode);\n        });\n    }\n\n    function calculateUTF(char) {\n        var unicodes = escape(char).split('%u');\n        unicodes = Utils.filter(unicodes, function(code) {\n            return code !== '';\n        });\n        unicodes = Utils.map(unicodes, function(code) {\n            var startWithF = Utils.indexOf(code, 'f') === 0 || Utils.indexOf(code, 'F') === 0;\n            var isFE0F = code === 'FE0F' || code === 'fe0f';\n            if (startWithF && !isFE0F) {\n                return '0x1' + code;\n            }\n            return '0x' + code;\n        });\n        return String.RongFromCodePoint(unicodes);\n    }\n\n    function extendEmojis(extension) {\n        CheckParam.check(['object|undefined'], 'init', arguments);\n        if (!extension) {\n            return;\n        }\n        var dataSource = extension.dataSource;\n        var url = extension.url || Config.url;\n        for (var key in dataSource) {\n            var detail = dataSource[key];\n            EmojiFactory[key] = detail;\n            EmojiFactory[key].background = url;\n        }\n    }\n\n    function setEmojiList() {\n        EmojiList.length = 0;\n        for (var unicode in EmojiFactory) {\n            var detail = EmojiFactory[unicode];\n            if (detail.tag) {\n                var lang = Config.lang;\n                var html = getHTMLByEmoji(detail.tag);\n                var node = Utils.getDom(html);\n                var symbol = detail[lang];\n                EmojiList.push({\n                    unicode: unicode,\n                    symbol: '[' + symbol + ']',\n                    emoji: detail.tag,\n                    node: node\n                });\n            }\n        }\n    }\n\n    function setEmojiReg() {\n        var reg = [];\n        for (var key in EmojiFactory) {\n            var detail = EmojiFactory[key];\n            reg.push(detail.tag);\n        }\n        reg = reg.join('|');\n        EmojiReg = new RegExp(reg, 'g');\n    }\n\n    function getOnlineImagePath() {\n        var getPath = function(path) {\n            var protocol = document.location.protocol;\n            var isFileProtocol = protocol === 'file:';\n            return isFileProtocol ? 'http:' + path : path;\n        };\n        var normalImgPath = getPath(NornalImagePath);\n        var hdImgPath = getPath(HdImagePath);\n        return isIE8 ? normalImgPath : hdImgPath;\n    }\n\n    function isSupportEmoji() {\n        var getTextFeature = function(text, color) {\n            try {\n                var canvas = document.createElement(\"canvas\");\n                canvas.width = 20;\n                canvas.height = 20;\n                var ctx = canvas.getContext(\"2d\");\n                ctx.textBaseline = \"top\";\n                ctx.font = \"20px sans-serif\";\n                ctx.fillStyle = color;\n                ctx.fillText(text, 0, 0);\n                var imageData = ctx.getImageData(0, 0, 20, 20).data;\n                var imageDataArr = [];\n                for (var i = 0; i < imageData.length; i++) {\n                    imageDataArr[i] = imageData[i];\n                }\n                var totalColor = 0;\n                for (var i = 0; i < imageDataArr.length; i++) {\n                    totalColor += imageDataArr[i];\n                }\n                var hasColor = totalColor > 0;\n                return hasColor ? imageDataArr.toString() : false;\n            } catch (e) {\n                return false;\n            }\n        };\n        var testEmoji = \"😁\";\n        var mode = getTextFeature(testEmoji, \"#000\");\n        if (mode) {\n            var otherEmoji = \"😨\";\n            var colorFeatrue = getTextFeature(testEmoji, \"#FFF\");\n            var otherFeature = getTextFeature(otherEmoji, \"#000\");\n            //为相同emoji添加不同色, 判断两次上色是否相同, 如果相同, 说明emoji以图片渲染, 支持\n            var isSameColor = mode && mode === colorFeatrue;\n            //为不同emoji添加相同色, 判断两次上色是否不同, 如果不同, 说明emoji以字符渲染, 支持\n            var isDiffColor = mode && mode !== otherFeature;\n            return isSameColor || isDiffColor;\n        } else {\n            return false;\n        }\n    }\n\n    function addBaseCss() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden;}\";\n        var style = document.createElement(\"style\");\n        style.setAttribute(\"type\", \"text/css\");\n        var head = document.getElementsByTagName('head')[0];\n        head.appendChild(style);\n        if (style.styleSheet) {\n            style.styleSheet.cssText = baseCss;\n        } else {\n            head = document.createTextNode(baseCss);\n            style.appendChild(head);\n        }\n    }\n\n    /*! http://mths.be/fromcodepoint v0.1.0 by @mathias,   fromCodePoint兼容 */\n      (function() {\n        var defineProperty = (function() {\n          // IE 8 only supports `Object.defineProperty` on DOM elements\n          try {\n            var object = {};\n            var $defineProperty = Object.defineProperty;\n            var result = $defineProperty(object, object, object) && $defineProperty;\n          } catch(error) {}\n          return result;\n        }());\n        var stringFromCharCode = String.fromCharCode;\n        var floor = Math.floor;\n        var RongFromCodePoint = function(codeList) {\n          var MAX_SIZE = 0x4000;\n          var codeUnits = [];\n          var highSurrogate;\n          var lowSurrogate;\n          var index = -1;\n          var length = codeList.length || [];\n          if (!length) {\n            return '';\n          }\n          var result = '';\n          while (++index < length) {\n            var codePoint = Number(codeList[index]);\n            if (\n              !isFinite(codePoint) ||       // `NaN`, `+Infinity`, or `-Infinity`\n              codePoint < 0 ||              // not a valid Unicode code point\n              codePoint > 0x10FFFF ||       // not a valid Unicode code point\n              floor(codePoint) != codePoint // not an integer\n            ) {\n              throw RangeError('Invalid code point: ' + codePoint);\n            }\n            if (codePoint <= 0xFFFF) { // BMP code point\n              codeUnits.push(codePoint);\n            } else { // Astral code point; split in surrogate halves\n              // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n              codePoint -= 0x10000;\n              highSurrogate = (codePoint >> 10) + 0xD800;\n              lowSurrogate = (codePoint % 0x400) + 0xDC00;\n              codeUnits.push(highSurrogate, lowSurrogate);\n            }\n            if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n              result += stringFromCharCode.apply(null, codeUnits);\n              codeUnits.length = 0;\n            }\n          }\n          return result;\n        };\n        if (defineProperty) {\n          defineProperty(String, 'RongFromCodePoint', {\n            'value': RongFromCodePoint,\n            'configurable': true,\n            'writable': true\n          });\n        } else {\n          String.RongFromCodePoint = RongFromCodePoint;\n        }\n      }());\n\n    function adaptOldVersion() {\n        _export.emojis = Utils.map(EmojiList, function(item) {\n            var unicode = item.unicode;\n            var emojiDetail = EmojiFactory[unicode];\n            var zh = emojiDetail.zh;\n            var en = emojiDetail.en;\n            var position = emojiDetail.position;\n            en = en.replace(' ', '_').toLowerCase();\n            var oldVersionStyle = \"height: 24px; width: 24px; display: inline-block; font-size: 20px !important; text-align: center; vertical-align: middle;overflow: hidden; line-height: 24px;\";\n            var oldVersionBHtml = \"<b style='width: 24px; height: 24px; display: inline-block; background-image: url({{url}}); background-position: {{position}}'></b>\";\n            oldVersionBHtml = Utils.render(oldVersionBHtml, {\n                url: NornalImagePath,\n                position: position\n            });\n            var oldVersionHtml = \"<span name='[{{zh}}]' class='RongIMExpression_{{en}}' style='{{style}}'>{{b}}</span>\"\n            oldVersionHtml = Utils.render(oldVersionHtml, {\n                zh: zh,\n                en: en,\n                b: oldVersionBHtml,\n                style: oldVersionStyle\n            });\n            var spanHTML = \"<span>\" + oldVersionHtml + \"</span>\";\n            return Utils.getDom(spanHTML);\n        });\n        _export.name = (function() {\n            var names = [];\n            for (var key in EmojiFactory) {\n                var value = EmojiFactory[key];\n                var data = {};\n                for (var i = 0; i < SupportLangs.length; i++) {\n                    var lang = SupportLangs[i];\n                    data[lang] = value[lang];\n                }\n                names.push(data);\n            }\n            return names;\n        })();\n        _export.data = Utils.map(EmojiList, function(item) {\n            var data;\n            for (var key in EmojiFactory) {\n                var detail = EmojiFactory[key];\n                if (detail.tag === item.emoji) {\n                    data = detail;\n                    detail.html = item.node;\n                }\n            }\n            return data;\n        });\n    }\n\n    return Utils.extend(_export, {\n        isSupportEmoji: isSupportEmoji,\n\n        init: init,\n        list: EmojiList,\n        emojiToSymbol: emojiToSymbol,\n        symbolToEmoji: symbolToEmoji,\n        emojiToHTML: emojiToHTML,\n        symbolToHTML: symbolToHTML\n    });\n});"
  },
  {
    "path": "electron-vue/static/js/RongIMLib-2.5.1.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.6.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n            this.socket.fire(\"disconnect\", code);\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            modules.setRoomType(0);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            this.observers.push(observer);\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "electron-vue/test/.eslintrc",
    "content": "{\n  \"env\": {\n    \"mocha\": true\n  },\n  \"globals\": {\n    \"assert\": true,\n    \"expect\": true,\n    \"should\": true,\n    \"__static\": true\n  }\n}\n"
  },
  {
    "path": "electron-vue/test/e2e/index.js",
    "content": "'use strict'\n\n// Set BABEL_ENV to use proper env config\nprocess.env.BABEL_ENV = 'test'\n\n// Enable use of ES6+ on required files\nrequire('babel-register')({\n  ignore: /node_modules/\n})\n\n// Attach Chai APIs to global scope\nconst { expect, should, assert } = require('chai')\nglobal.expect = expect\nglobal.should = should\nglobal.assert = assert\n\n// Require all JS files in `./specs` for Mocha to consume\nrequire('require-dir')('./specs')\n"
  },
  {
    "path": "electron-vue/test/e2e/specs/Launch.spec.js",
    "content": "import utils from '../utils'\n\ndescribe('Launch', function () {\n  beforeEach(utils.beforeEach)\n  afterEach(utils.afterEach)\n\n  it('shows the proper application title', function () {\n    return this.app.client.getTitle()\n      .then(title => {\n        expect(title).to.equal('rong-test')\n      })\n  })\n})\n"
  },
  {
    "path": "electron-vue/test/e2e/utils.js",
    "content": "import electron from 'electron'\nimport { Application } from 'spectron'\n\nexport default {\n  afterEach () {\n    this.timeout(10000)\n\n    if (this.app && this.app.isRunning()) {\n      return this.app.stop()\n    }\n  },\n  beforeEach () {\n    this.timeout(10000)\n    this.app = new Application({\n      path: electron,\n      args: ['dist/electron/main.js'],\n      startTimeout: 10000,\n      waitTimeout: 10000\n    })\n\n    return this.app.start()\n  }\n}\n"
  },
  {
    "path": "electron-vue/test/unit/index.js",
    "content": "import Vue from 'vue'\nVue.config.devtools = false\nVue.config.productionTip = false\n\n// require all test files (files that ends with .spec.js)\nconst testsContext = require.context('./specs', true, /\\.spec$/)\ntestsContext.keys().forEach(testsContext)\n\n// require all src files except main.js for coverage.\n// you can also change this to match only the subset of files that\n// you want coverage for.\nconst srcContext = require.context('../../src/renderer', true, /^\\.\\/(?!main(\\.js)?$)/)\nsrcContext.keys().forEach(srcContext)\n"
  },
  {
    "path": "electron-vue/test/unit/karma.conf.js",
    "content": "'use strict'\n\nconst path = require('path')\nconst merge = require('webpack-merge')\nconst webpack = require('webpack')\n\nconst baseConfig = require('../../.electron-vue/webpack.renderer.config')\nconst projectRoot = path.resolve(__dirname, '../../src/renderer')\n\n// Set BABEL_ENV to use proper preset config\nprocess.env.BABEL_ENV = 'test'\n\nlet webpackConfig = merge(baseConfig, {\n  devtool: '#inline-source-map',\n  plugins: [\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"testing\"'\n    })\n  ]\n})\n\n// don't treat dependencies as externals\ndelete webpackConfig.entry\ndelete webpackConfig.externals\ndelete webpackConfig.output.libraryTarget\n\n// apply vue option to apply isparta-loader on js\nwebpackConfig.module.rules\n  .find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader'\n\nmodule.exports = config => {\n  config.set({\n    browsers: ['visibleElectron'],\n    client: {\n      useIframe: false\n    },\n    coverageReporter: {\n      dir: './coverage',\n      reporters: [\n        { type: 'lcov', subdir: '.' },\n        { type: 'text-summary' }\n      ]\n    },\n    customLaunchers: {\n      'visibleElectron': {\n        base: 'Electron',\n        flags: ['--show']\n      }\n    },\n    frameworks: ['mocha', 'chai'],\n    files: ['./index.js'],\n    preprocessors: {\n      './index.js': ['webpack', 'sourcemap']\n    },\n    reporters: ['spec', 'coverage'],\n    singleRun: true,\n    webpack: webpackConfig,\n    webpackMiddleware: {\n      noInfo: true\n    }\n  })\n}\n"
  },
  {
    "path": "electron-vue/test/unit/specs/LandingPage.spec.js",
    "content": "import Vue from 'vue'\nimport LandingPage from '@/components/LandingPage'\n\ndescribe('LandingPage.vue', () => {\n  it('should render correct contents', () => {\n    const vm = new Vue({\n      el: document.createElement('div'),\n      render: h => h(LandingPage)\n    }).$mount()\n\n    expect(vm.$el.querySelector('.title').textContent).to.contain('Welcome to your new project!')\n  })\n})\n"
  },
  {
    "path": "electron-vue-sdk-v3/.babelrc",
    "content": "{\n  \"comments\": false,\n  \"env\": {\n    \"test\": {\n      \"presets\": [\n        [\"env\", {\n          \"targets\": { \"node\": 7 }\n        }],\n        \"stage-0\"\n      ],\n      \"plugins\": [\"istanbul\"]\n    },\n    \"main\": {\n      \"presets\": [\n        [\"env\", {\n          \"targets\": { \"node\": 7 }\n        }],\n        \"stage-0\"\n      ]\n    },\n    \"renderer\": {\n      \"presets\": [\n        [\"env\", {\n          \"modules\": false\n        }],\n        \"stage-0\"\n      ]\n    },\n    \"web\": {\n      \"presets\": [\n        [\"env\", {\n          \"modules\": false\n        }],\n        \"stage-0\"\n      ]\n    }\n  },\n  \"plugins\": [\"transform-runtime\"]\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/.electron-vue/build.js",
    "content": "'use strict'\n\nprocess.env.NODE_ENV = 'production'\n\nconst { say } = require('cfonts')\nconst chalk = require('chalk')\nconst del = require('del')\nconst { spawn } = require('child_process')\nconst webpack = require('webpack')\nconst Multispinner = require('multispinner')\n\n\nconst mainConfig = require('./webpack.main.config')\nconst rendererConfig = require('./webpack.renderer.config')\nconst webConfig = require('./webpack.web.config')\n\nconst doneLog = chalk.bgGreen.white(' DONE ') + ' '\nconst errorLog = chalk.bgRed.white(' ERROR ') + ' '\nconst okayLog = chalk.bgBlue.white(' OKAY ') + ' '\nconst isCI = process.env.CI || false\n\nif (process.env.BUILD_TARGET === 'clean') clean()\nelse if (process.env.BUILD_TARGET === 'web') web()\nelse build()\n\nfunction clean () {\n  del.sync(['build/*', '!build/icons', '!build/icons/icon.*'])\n  console.log(`\\n${doneLog}\\n`)\n  process.exit()\n}\n\nfunction build () {\n  greeting()\n\n  del.sync(['dist/electron/*', '!.gitkeep'])\n\n  const tasks = ['main', 'renderer']\n  const m = new Multispinner(tasks, {\n    preText: 'building',\n    postText: 'process'\n  })\n\n  let results = ''\n\n  m.on('success', () => {\n    process.stdout.write('\\x1B[2J\\x1B[0f')\n    console.log(`\\n\\n${results}`)\n    console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\\n`)\n    process.exit()\n  })\n\n  pack(mainConfig).then(result => {\n    results += result + '\\n\\n'\n    m.success('main')\n  }).catch(err => {\n    m.error('main')\n    console.log(`\\n  ${errorLog}failed to build main process`)\n    console.error(`\\n${err}\\n`)\n    process.exit(1)\n  })\n\n  pack(rendererConfig).then(result => {\n    results += result + '\\n\\n'\n    m.success('renderer')\n  }).catch(err => {\n    m.error('renderer')\n    console.log(`\\n  ${errorLog}failed to build renderer process`)\n    console.error(`\\n${err}\\n`)\n    process.exit(1)\n  })\n}\n\nfunction pack (config) {\n  return new Promise((resolve, reject) => {\n    config.mode = 'production'\n    webpack(config, (err, stats) => {\n      if (err) reject(err.stack || err)\n      else if (stats.hasErrors()) {\n        let err = ''\n\n        stats.toString({\n          chunks: false,\n          colors: true\n        })\n        .split(/\\r?\\n/)\n        .forEach(line => {\n          err += `    ${line}\\n`\n        })\n\n        reject(err)\n      } else {\n        resolve(stats.toString({\n          chunks: false,\n          colors: true\n        }))\n      }\n    })\n  })\n}\n\nfunction web () {\n  del.sync(['dist/web/*', '!.gitkeep'])\n  webConfig.mode = 'production'\n  webpack(webConfig, (err, stats) => {\n    if (err || stats.hasErrors()) console.log(err)\n\n    console.log(stats.toString({\n      chunks: false,\n      colors: true\n    }))\n\n    process.exit()\n  })\n}\n\nfunction greeting () {\n  const cols = process.stdout.columns\n  let text = ''\n\n  if (cols > 85) text = 'lets-build'\n  else if (cols > 60) text = 'lets-|build'\n  else text = false\n\n  if (text && !isCI) {\n    say(text, {\n      colors: ['yellow'],\n      font: 'simple3d',\n      space: false\n    })\n  } else console.log(chalk.yellow.bold('\\n  lets-build'))\n  console.log()\n}"
  },
  {
    "path": "electron-vue-sdk-v3/.electron-vue/dev-client.js",
    "content": "const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')\n\nhotClient.subscribe(event => {\n  /**\n   * Reload browser when HTMLWebpackPlugin emits a new index.html\n   *\n   * Currently disabled until jantimon/html-webpack-plugin#680 is resolved.\n   * https://github.com/SimulatedGREG/electron-vue/issues/437\n   * https://github.com/jantimon/html-webpack-plugin/issues/680\n   */\n  // if (event.action === 'reload') {\n  //   window.location.reload()\n  // }\n\n  /**\n   * Notify `mainWindow` when `main` process is compiling,\n   * giving notice for an expected reload of the `electron` process\n   */\n  if (event.action === 'compiling') {\n    document.body.innerHTML += `\n      <style>\n        #dev-client {\n          background: #4fc08d;\n          border-radius: 4px;\n          bottom: 20px;\n          box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);\n          color: #fff;\n          font-family: 'Source Sans Pro', sans-serif;\n          left: 20px;\n          padding: 8px 12px;\n          position: absolute;\n        }\n      </style>\n\n      <div id=\"dev-client\">\n        Compiling Main Process...\n      </div>\n    `\n  }\n})\n"
  },
  {
    "path": "electron-vue-sdk-v3/.electron-vue/dev-runner.js",
    "content": "'use strict'\n\nconst chalk = require('chalk')\nconst electron = require('electron')\nconst path = require('path')\nconst { say } = require('cfonts')\nconst { spawn } = require('child_process')\nconst webpack = require('webpack')\nconst WebpackDevServer = require('webpack-dev-server')\nconst webpackHotMiddleware = require('webpack-hot-middleware')\n\nconst mainConfig = require('./webpack.main.config')\nconst rendererConfig = require('./webpack.renderer.config')\n\nlet electronProcess = null\nlet manualRestart = false\nlet hotMiddleware\n\nfunction logStats (proc, data) {\n  let log = ''\n\n  log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`)\n  log += '\\n\\n'\n\n  if (typeof data === 'object') {\n    data.toString({\n      colors: true,\n      chunks: false\n    }).split(/\\r?\\n/).forEach(line => {\n      log += '  ' + line + '\\n'\n    })\n  } else {\n    log += `  ${data}\\n`\n  }\n\n  log += '\\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\\n'\n\n  console.log(log)\n}\n\nfunction startRenderer () {\n  return new Promise((resolve, reject) => {\n    rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)\n    rendererConfig.mode = 'development'\n    const compiler = webpack(rendererConfig)\n    hotMiddleware = webpackHotMiddleware(compiler, {\n      log: false,\n      heartbeat: 2500\n    })\n\n    compiler.hooks.compilation.tap('compilation', compilation => {\n      compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {\n        hotMiddleware.publish({ action: 'reload' })\n        cb()\n      })\n    })\n\n    compiler.hooks.done.tap('done', stats => {\n      logStats('Renderer', stats)\n    })\n\n    const server = new WebpackDevServer(\n      compiler,\n      {\n        contentBase: path.join(__dirname, '../'),\n        quiet: true,\n        before (app, ctx) {\n          app.use(hotMiddleware)\n          ctx.middleware.waitUntilValid(() => {\n            resolve()\n          })\n        }\n      }\n    )\n\n    server.listen(9080)\n  })\n}\n\nfunction startMain () {\n  return new Promise((resolve, reject) => {\n    mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)\n    mainConfig.mode = 'development'\n    const compiler = webpack(mainConfig)\n\n    compiler.hooks.watchRun.tapAsync('watch-run', (compilation, done) => {\n      logStats('Main', chalk.white.bold('compiling...'))\n      hotMiddleware.publish({ action: 'compiling' })\n      done()\n    })\n\n    compiler.watch({}, (err, stats) => {\n      if (err) {\n        console.log(err)\n        return\n      }\n\n      logStats('Main', stats)\n\n      if (electronProcess && electronProcess.kill) {\n        manualRestart = true\n        process.kill(electronProcess.pid)\n        electronProcess = null\n        startElectron()\n\n        setTimeout(() => {\n          manualRestart = false\n        }, 5000)\n      }\n\n      resolve()\n    })\n  })\n}\n\nfunction startElectron () {\n  var args = [\n    '--inspect=5858',\n    path.join(__dirname, '../dist/electron/main.js')\n  ]\n\n  // detect yarn or npm and process commandline args accordingly\n  if (process.env.npm_execpath.endsWith('yarn.js')) {\n    args = args.concat(process.argv.slice(3))\n  } else if (process.env.npm_execpath.endsWith('npm-cli.js')) {\n    args = args.concat(process.argv.slice(2))\n  }\n\n  electronProcess = spawn(electron, args)\n  \n  electronProcess.stdout.on('data', data => {\n    electronLog(data, 'blue')\n  })\n  electronProcess.stderr.on('data', data => {\n    electronLog(data, 'red')\n  })\n\n  electronProcess.on('close', () => {\n    if (!manualRestart) process.exit()\n  })\n}\n\nfunction electronLog (data, color) {\n  let log = ''\n  data = data.toString().split(/\\r?\\n/)\n  data.forEach(line => {\n    log += `  ${line}\\n`\n  })\n  if (/[0-9A-z]+/.test(log)) {\n    console.log(\n      chalk[color].bold('┏ Electron -------------------') +\n      '\\n\\n' +\n      log +\n      chalk[color].bold('┗ ----------------------------') +\n      '\\n'\n    )\n  }\n}\n\nfunction greeting () {\n  const cols = process.stdout.columns\n  let text = ''\n\n  if (cols > 104) text = 'electron-vue'\n  else if (cols > 76) text = 'electron-|vue'\n  else text = false\n\n  if (text) {\n    say(text, {\n      colors: ['yellow'],\n      font: 'simple3d',\n      space: false\n    })\n  } else console.log(chalk.yellow.bold('\\n  electron-vue'))\n  console.log(chalk.blue('  getting ready...') + '\\n')\n}\n\nfunction init () {\n  greeting()\n\n  Promise.all([startRenderer(), startMain()])\n    .then(() => {\n      startElectron()\n    })\n    .catch(err => {\n      console.error(err)\n    })\n}\n\ninit()\n"
  },
  {
    "path": "electron-vue-sdk-v3/.electron-vue/webpack.main.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'main'\n\nconst path = require('path')\nconst { dependencies } = require('../package.json')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\n\nlet mainConfig = {\n  entry: {\n    main: path.join(__dirname, '../src/main/index.js')\n  },\n  externals: [\n    ...Object.keys(dependencies || {})\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(js)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.node$/,\n        use: 'node-loader'\n      }\n    ]\n  },\n  node: {\n    __dirname: process.env.NODE_ENV !== 'production',\n    __filename: process.env.NODE_ENV !== 'production'\n  },\n  output: {\n    filename: '[name].js',\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '../dist/electron')\n  },\n  plugins: [\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  resolve: {\n    extensions: ['.js', '.json', '.node']\n  },\n  target: 'electron-main'\n}\n\n/**\n * Adjust mainConfig for development settings\n */\nif (process.env.NODE_ENV !== 'production') {\n  mainConfig.plugins.push(\n    new webpack.DefinePlugin({\n      '__static': `\"${path.join(__dirname, '../static').replace(/\\\\/g, '\\\\\\\\')}\"`\n    })\n  )\n}\n\n/**\n * Adjust mainConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  mainConfig.plugins.push(\n    new BabiliWebpackPlugin(),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    })\n  )\n}\n\nmodule.exports = mainConfig\n"
  },
  {
    "path": "electron-vue-sdk-v3/.electron-vue/webpack.renderer.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'renderer'\n\nconst path = require('path')\nconst { dependencies } = require('../package.json')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst { VueLoaderPlugin } = require('vue-loader')\n\n/**\n * List of node_modules to include in webpack bundle\n *\n * Required for specific packages like Vue UI libraries\n * that provide pure *.vue files that need compiling\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals\n */\nlet whiteListedModules = ['vue']\n\nlet rendererConfig = {\n  devtool: '#cheap-module-eval-source-map',\n  entry: {\n    renderer: path.join(__dirname, '../src/renderer/main.js')\n  },\n  externals: [\n    ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.(js|vue)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.scss$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader']\n      },\n      {\n        test: /\\.sass$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']\n      },\n      {\n        test: /\\.less$/,\n        use: ['vue-style-loader', 'css-loader', 'less-loader']\n      },\n      {\n        test: /\\.css$/,\n        use: ['vue-style-loader', 'css-loader']\n      },\n      {\n        test: /\\.html$/,\n        use: 'vue-html-loader'\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.node$/,\n        use: 'node-loader'\n      },\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            extractCSS: process.env.NODE_ENV === 'production',\n            loaders: {\n              sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',\n              scss: 'vue-style-loader!css-loader!sass-loader',\n              less: 'vue-style-loader!css-loader!less-loader'\n            }\n          }\n        }\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'imgs/[name]--[folder].[ext]'\n          }\n        }\n      },\n      {\n        test: /\\.(mp4|webm|ogg|mp3|wav|flac|aac)(\\?.*)?$/,\n        loader: 'url-loader',\n        options: {\n          limit: 10000,\n          name: 'media/[name]--[folder].[ext]'\n        }\n      },\n      {\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'fonts/[name]--[folder].[ext]'\n          }\n        }\n      }\n    ]\n  },\n  node: {\n    __dirname: process.env.NODE_ENV !== 'production',\n    __filename: process.env.NODE_ENV !== 'production'\n  },\n  plugins: [\n    new VueLoaderPlugin(),\n    new MiniCssExtractPlugin({filename: 'styles.css'}),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: path.resolve(__dirname, '../src/index.ejs'),\n      minify: {\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true\n      },\n      nodeModules: process.env.NODE_ENV !== 'production'\n        ? path.resolve(__dirname, '../node_modules')\n        : false\n    }),\n    new webpack.HotModuleReplacementPlugin(),\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  output: {\n    filename: '[name].js',\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '../dist/electron')\n  },\n  resolve: {\n    alias: {\n      '@': path.join(__dirname, '../src/renderer'),\n      'vue$': 'vue/dist/vue.esm.js'\n    },\n    extensions: ['.js', '.vue', '.json', '.css', '.node']\n  },\n  target: 'electron-renderer'\n}\n\n/**\n * Adjust rendererConfig for development settings\n */\nif (process.env.NODE_ENV !== 'production') {\n  rendererConfig.plugins.push(\n    new webpack.DefinePlugin({\n      '__static': `\"${path.join(__dirname, '../static').replace(/\\\\/g, '\\\\\\\\')}\"`\n    })\n  )\n}\n\n/**\n * Adjust rendererConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  rendererConfig.devtool = ''\n\n  rendererConfig.plugins.push(\n    new BabiliWebpackPlugin(),\n    new CopyWebpackPlugin([\n      {\n        from: path.join(__dirname, '../static'),\n        to: path.join(__dirname, '../dist/electron/static'),\n        ignore: ['.*']\n      }\n    ]),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    }),\n    new webpack.LoaderOptionsPlugin({\n      minimize: true\n    })\n  )\n}\n\nmodule.exports = rendererConfig\n"
  },
  {
    "path": "electron-vue-sdk-v3/.electron-vue/webpack.web.config.js",
    "content": "'use strict'\n\nprocess.env.BABEL_ENV = 'web'\n\nconst path = require('path')\nconst webpack = require('webpack')\n\nconst BabiliWebpackPlugin = require('babili-webpack-plugin')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst { VueLoaderPlugin } = require('vue-loader')\n\nlet webConfig = {\n  devtool: '#cheap-module-eval-source-map',\n  entry: {\n    web: path.join(__dirname, '../src/renderer/main.js')\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.(js|vue)$/,\n        enforce: 'pre',\n        exclude: /node_modules/,\n        use: {\n          loader: 'eslint-loader',\n          options: {\n            formatter: require('eslint-friendly-formatter')\n          }\n        }\n      },\n      {\n        test: /\\.scss$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader']\n      },\n      {\n        test: /\\.sass$/,\n        use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']\n      },\n      {\n        test: /\\.less$/,\n        use: ['vue-style-loader', 'css-loader', 'less-loader']\n      },\n      {\n        test: /\\.css$/,\n        use: ['vue-style-loader', 'css-loader']\n      },\n      {\n        test: /\\.html$/,\n        use: 'vue-html-loader'\n      },\n      {\n        test: /\\.js$/,\n        use: 'babel-loader',\n        include: [ path.resolve(__dirname, '../src/renderer') ],\n        exclude: /node_modules/\n      },\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            extractCSS: true,\n            loaders: {\n              sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',\n              scss: 'vue-style-loader!css-loader!sass-loader',\n              less: 'vue-style-loader!css-loader!less-loader'\n            }\n          }\n        }\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'imgs/[name].[ext]'\n          }\n        }\n      },\n      {\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n        use: {\n          loader: 'url-loader',\n          query: {\n            limit: 10000,\n            name: 'fonts/[name].[ext]'\n          }\n        }\n      }\n    ]\n  },\n  plugins: [\n    new VueLoaderPlugin(),\n    new MiniCssExtractPlugin({filename: 'styles.css'}),\n    new HtmlWebpackPlugin({\n      filename: 'index.html',\n      template: path.resolve(__dirname, '../src/index.ejs'),\n      minify: {\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true\n      },\n      nodeModules: false\n    }),\n    new webpack.DefinePlugin({\n      'process.env.IS_WEB': 'true'\n    }),\n    new webpack.HotModuleReplacementPlugin(),\n    new webpack.NoEmitOnErrorsPlugin()\n  ],\n  output: {\n    filename: '[name].js',\n    path: path.join(__dirname, '../dist/web')\n  },\n  resolve: {\n    alias: {\n      '@': path.join(__dirname, '../src/renderer'),\n      'vue$': 'vue/dist/vue.esm.js'\n    },\n    extensions: ['.js', '.vue', '.json', '.css']\n  },\n  target: 'web'\n}\n\n/**\n * Adjust webConfig for production settings\n */\nif (process.env.NODE_ENV === 'production') {\n  webConfig.devtool = ''\n\n  webConfig.plugins.push(\n    new BabiliWebpackPlugin(),\n    new CopyWebpackPlugin([\n      {\n        from: path.join(__dirname, '../static'),\n        to: path.join(__dirname, '../dist/web/static'),\n        ignore: ['.*']\n      }\n    ]),\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"production\"'\n    }),\n    new webpack.LoaderOptionsPlugin({\n      minimize: true\n    })\n  )\n}\n\nmodule.exports = webConfig\n"
  },
  {
    "path": "electron-vue-sdk-v3/.eslintignore",
    "content": "test/unit/coverage/**\ntest/unit/*.js\ntest/e2e/*.js\nstatic/js/RongIMLib-2.5.0.js\nstatic/js/protobuf-2.3.3.min.js\nstatic/js/protobuf-2.3.4.min.js\nstatic/js/*.js\n"
  },
  {
    "path": "electron-vue-sdk-v3/.eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  parser: 'babel-eslint',\n  parserOptions: {\n    sourceType: 'module'\n  },\n  env: {\n    browser: true,\n    node: true\n  },\n  extends: 'standard',\n  globals: {\n    __static: true\n  },\n  plugins: [\n    'html'\n  ],\n  'rules': {\n    // allow paren-less arrow functions\n    'arrow-parens': 0,\n    // allow async-await\n    'generator-star-spacing': 0,\n    // allow debugger during development\n    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0\n  }\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/.gitignore",
    "content": ".DS_Store\ndist/electron/*\ndist/web/*\nbuild/*\n!build/icons\ncoverage\nnode_modules/\nnpm-debug.log\nnpm-debug.log.*\nthumbs.db\n!.gitkeep\n"
  },
  {
    "path": "electron-vue-sdk-v3/.travis.yml",
    "content": "# Commented sections below can be used to run tests on the CI server\n# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing\nosx_image: xcode8.3\nsudo: required\ndist: trusty\nlanguage: c\nmatrix:\n  include:\n  - os: osx\n  - os: linux\n    env: CC=clang CXX=clang++ npm_config_clang=1\n    compiler: clang\ncache:\n  directories:\n  - node_modules\n  - \"$HOME/.electron\"\n  - \"$HOME/.cache\"\naddons:\n  apt:\n    packages:\n    - libgnome-keyring-dev\n    - icnsutils\n    #- xvfb\nbefore_install:\n- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([\n  \"$TRAVIS_OS_NAME\" == \"linux\" ] && echo \"linux\" || echo \"darwin\")-amd64-1.2.1.tar.gz\n  | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull\n- if [[ \"$TRAVIS_OS_NAME\" == \"linux\" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi\ninstall:\n#- export DISPLAY=':99.0'\n#- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n- nvm install 7\n- curl -o- -L https://yarnpkg.com/install.sh | bash\n- source ~/.bashrc\n- npm install -g xvfb-maybe\n- yarn\nscript:\n#- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js\n#- yarn run pack && xvfb-maybe node_modules/.bin/mocha test/e2e\n- yarn run build\nbranches:\n  only:\n  - master\n"
  },
  {
    "path": "electron-vue-sdk-v3/README.md",
    "content": "### electron-vue 引入 websdk\n\n`注:` [electron-vue](https://github.com/SimulatedGREG/electron-vue) 本身已经长时间不维护, 且 issues 无人处理. 正常情况下, 不建议使用. 如集成桌面版项目, 可直接使用 [electron](https://www.electronjs.org/) 和 [vue](https://cn.vuejs.org/)\n\n#### 开发环境\n\nnode 8.12.0 及以上版本\n\n#### 启动\n\n1、安装依赖包\n\n```\nnpm install electron@2.0.4 --save-dev\nnpm install\n```\n\n2、运行\n\n```\nnpm run dev\n```\n\n3、打包\n\n```\nnpm run build\n```\n\n#### 相关文件\n\n```\nsrc/renderer/components/init.vue\n```\n\n#### 注意\n\n1、此 Demo 仅为 electron-vue 引入融云 websdk 示例, 非完整项目\n\n2、electron-vue 具体环境安装、打包配置等问题, 请参考 [electron-vue](https://github.com/SimulatedGREG/electron-vue) 文档\n\n3、使用 electron-vue 时, 为避免遇到问题无排查方向, 建议提前了解以下知识:\n\n> Electron: [https://electronjs.org/docs](https://electronjs.org/docs)\n\n> electron-builder: [https://github.com/electron-userland/electron-builder](https://github.com/electron-userland/electron-builder)\n\n> Vue.js: [https://cn.vuejs.org](https://cn.vuejs.org)\n\n> webpack: [https://webpack.js.org](https://webpack.js.org)\n\n"
  },
  {
    "path": "electron-vue-sdk-v3/appveyor.yml",
    "content": "# Commented sections below can be used to run tests on the CI server\n# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing\nversion: 0.1.{build}\n\nbranches:\n  only:\n    - master\n\nimage: Visual Studio 2017\nplatform:\n  - x64\n\ncache:\n  - node_modules\n  - '%APPDATA%\\npm-cache'\n  - '%USERPROFILE%\\.electron'\n  - '%USERPROFILE%\\AppData\\Local\\Yarn\\cache'\n\ninit:\n  - git config --global core.autocrlf input\n\ninstall:\n  - ps: Install-Product node 8 x64\n  - git reset --hard HEAD\n  - yarn\n  - node --version\n\nbuild_script:\n  #- yarn test\n  - yarn build\n\ntest: off\n"
  },
  {
    "path": "electron-vue-sdk-v3/package.json",
    "content": "{\n  \"name\": \"rong-test\",\n  \"version\": \"1.0.0\",\n  \"author\": \"wangyonghao <wangyonghao@rongcloud.cn>\",\n  \"description\": \"An electron-vue project\",\n  \"license\": null,\n  \"main\": \"./dist/electron/main.js\",\n  \"scripts\": {\n    \"build\": \"node .electron-vue/build.js && electron-builder\",\n    \"build:dir\": \"node .electron-vue/build.js && electron-builder --dir\",\n    \"build:clean\": \"cross-env BUILD_TARGET=clean node .electron-vue/build.js\",\n    \"build:web\": \"cross-env BUILD_TARGET=web node .electron-vue/build.js\",\n    \"dev\": \"node .electron-vue/dev-runner.js\",\n    \"e2e\": \"npm run pack && mocha test/e2e\",\n    \"lint\": \"eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test\",\n    \"lint:fix\": \"eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test\",\n    \"pack\": \"npm run pack:main && npm run pack:renderer\",\n    \"pack:main\": \"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js\",\n    \"pack:renderer\": \"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js\",\n    \"test\": \"npm run unit && npm run e2e\",\n    \"unit\": \"karma start test/unit/karma.conf.js\",\n    \"postinstall\": \"npm run lint:fix\"\n  },\n  \"build\": {\n    \"productName\": \"rong-test\",\n    \"appId\": \"com.example.yourapp\",\n    \"directories\": {\n      \"output\": \"build\"\n    },\n    \"files\": [\n      \"dist/electron/**/*\"\n    ],\n    \"dmg\": {\n      \"contents\": [\n        {\n          \"x\": 410,\n          \"y\": 150,\n          \"type\": \"link\",\n          \"path\": \"/Applications\"\n        },\n        {\n          \"x\": 130,\n          \"y\": 150,\n          \"type\": \"file\"\n        }\n      ]\n    },\n    \"mac\": {\n      \"icon\": \"build/icons/icon.icns\"\n    },\n    \"win\": {\n      \"icon\": \"build/icons/icon.ico\"\n    },\n    \"linux\": {\n      \"icon\": \"build/icons\"\n    }\n  },\n  \"dependencies\": {\n    \"vue\": \"^2.5.16\",\n    \"axios\": \"^0.21.1\",\n    \"vue-electron\": \"^1.0.6\",\n    \"vue-router\": \"^3.0.1\",\n    \"vuex\": \"^3.0.1\",\n    \"vuex-electron\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"ajv\": \"^6.5.0\",\n    \"babel-core\": \"^6.26.3\",\n    \"babel-loader\": \"^7.1.4\",\n    \"babel-plugin-transform-runtime\": \"^6.23.0\",\n    \"babel-preset-env\": \"^1.7.0\",\n    \"babel-preset-stage-0\": \"^6.24.1\",\n    \"babel-register\": \"^6.26.0\",\n    \"babili-webpack-plugin\": \"^0.1.2\",\n    \"cfonts\": \"^2.1.2\",\n    \"chalk\": \"^2.4.1\",\n    \"copy-webpack-plugin\": \"^4.5.1\",\n    \"cross-env\": \"^5.1.6\",\n    \"css-loader\": \"^0.28.11\",\n    \"del\": \"^3.0.0\",\n    \"devtron\": \"^1.4.0\",\n    \"electron-debug\": \"^1.5.0\",\n    \"electron-devtools-installer\": \"^2.2.4\",\n    \"electron-builder\": \"^20.19.2\",\n    \"babel-eslint\": \"^8.2.3\",\n    \"eslint\": \"^4.19.1\",\n    \"eslint-friendly-formatter\": \"^4.0.1\",\n    \"eslint-loader\": \"^2.0.0\",\n    \"eslint-plugin-html\": \"^4.0.3\",\n    \"eslint-config-standard\": \"^11.0.0\",\n    \"eslint-plugin-import\": \"^2.12.0\",\n    \"eslint-plugin-node\": \"^6.0.1\",\n    \"eslint-plugin-promise\": \"^3.8.0\",\n    \"eslint-plugin-standard\": \"^3.1.0\",\n    \"mini-css-extract-plugin\": \"0.4.0\",\n    \"file-loader\": \"^1.1.11\",\n    \"html-webpack-plugin\": \"^3.2.0\",\n    \"inject-loader\": \"^4.0.1\",\n    \"karma\": \"^2.0.2\",\n    \"karma-chai\": \"^0.1.0\",\n    \"karma-coverage\": \"^1.1.2\",\n    \"karma-electron\": \"^6.0.0\",\n    \"karma-mocha\": \"^1.3.0\",\n    \"karma-sourcemap-loader\": \"^0.3.7\",\n    \"karma-spec-reporter\": \"^0.0.32\",\n    \"karma-webpack\": \"^3.0.0\",\n    \"require-dir\": \"^1.0.0\",\n    \"spectron\": \"^3.8.0\",\n    \"babel-plugin-istanbul\": \"^4.1.6\",\n    \"chai\": \"^4.1.2\",\n    \"mocha\": \"^5.2.0\",\n    \"multispinner\": \"^0.2.1\",\n    \"node-loader\": \"^0.6.0\",\n    \"node-sass\": \"^4.9.2\",\n    \"sass-loader\": \"^7.0.3\",\n    \"style-loader\": \"^0.21.0\",\n    \"url-loader\": \"^1.0.1\",\n    \"vue-html-loader\": \"^1.2.4\",\n    \"vue-loader\": \"^15.2.4\",\n    \"vue-style-loader\": \"^4.1.0\",\n    \"vue-template-compiler\": \"^2.5.16\",\n    \"webpack-cli\": \"^3.0.8\",\n    \"webpack\": \"^4.15.1\",\n    \"webpack-dev-server\": \"^3.1.4\",\n    \"webpack-hot-middleware\": \"^2.22.2\",\n    \"webpack-merge\": \"^4.1.3\"\n  }\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/index.ejs",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>rong-test</title>\n    <% if (htmlWebpackPlugin.options.nodeModules) { %>\n      <!-- Add `node_modules/` to global paths so `require` works properly in development -->\n      <script>\n        require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\\\/g, '\\\\\\\\') %>')\n      </script>\n    <% } %>\n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <!-- Set `__static` path to static files in production -->\n    <% if (!process.browser) { %>\n      <script>\n        if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\')\n      </script>\n    <% } %>\n\n    <!-- webpack builds are automatically injected -->\n  </body>\n</html>\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/main/index.dev.js",
    "content": "/**\n * This file is used specifically and only for development. It installs\n * `electron-debug` & `vue-devtools`. There shouldn't be any need to\n *  modify this file, but it can be used to extend your development\n *  environment.\n */\n\n/* eslint-disable */\n\n// Install `electron-debug` with `devtron`\nrequire('electron-debug')({ showDevTools: true })\n\n// Install `vue-devtools`\nrequire('electron').app.on('ready', () => {\n  let installExtension = require('electron-devtools-installer')\n  installExtension.default(installExtension.VUEJS_DEVTOOLS)\n    .then(() => {})\n    .catch(err => {\n      console.log('Unable to install `vue-devtools`: \\n', err)\n    })\n})\n\n// Require `main` process to boot app\nrequire('./index')"
  },
  {
    "path": "electron-vue-sdk-v3/src/main/index.js",
    "content": "'use strict'\n\nimport { app, BrowserWindow } from 'electron'\n\n/**\n * Set `__static` path to static files in production\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html\n */\nif (process.env.NODE_ENV !== 'development') {\n  global.__static = require('path').join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\')\n}\n\nlet mainWindow\nconst winURL = process.env.NODE_ENV === 'development'\n  ? `http://localhost:9080`\n  : `file://${__dirname}/index.html`\n\nfunction createWindow () {\n  /**\n   * Initial window options\n   */\n  mainWindow = new BrowserWindow({\n    height: 563,\n    useContentSize: true,\n    width: 1000\n  })\n\n  mainWindow.loadURL(winURL)\n\n  mainWindow.on('closed', () => {\n    mainWindow = null\n  })\n}\n\napp.on('ready', createWindow)\n\napp.on('window-all-closed', () => {\n  if (process.platform !== 'darwin') {\n    app.quit()\n  }\n})\n\napp.on('activate', () => {\n  if (mainWindow === null) {\n    createWindow()\n  }\n})\n\n/**\n * Auto Updater\n *\n * Uncomment the following code below and install `electron-updater` to\n * support auto updating. Code Signing with a valid certificate is required.\n * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating\n */\n\n/*\nimport { autoUpdater } from 'electron-updater'\n\nautoUpdater.on('update-downloaded', () => {\n  autoUpdater.quitAndInstall()\n})\n\napp.on('ready', () => {\n  if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()\n})\n */\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/App.vue",
    "content": "<template>\n  <div id=\"app\">\n    <router-view></router-view>\n  </div>\n</template>\n\n<script>\n  export default {\n    name: 'rong-test'\n  }\n</script>\n\n<style>\n  /* CSS */\n</style>\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/assets/.gitkeep",
    "content": ""
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/components/Init.vue",
    "content": "<template>\n  <div>\n    <h1>Web SDK electron-vue</h1>\n    <p class=\"rong-input\">\n      <span>appkey:</span>\n      <input type=\"text\" v-model=\"appkey\" size=\"20\">\n    </p>\n    <p class=\"rong-input\">\n      <span>token:</span><input type=\"text\" size=\"110\" v-model=\"token\">\n    </p>\n    <p class=\"rong-input\">\n      <span>navi:</span><input type=\"text\" size=\"50\" v-model=\"navi\"><i>此配置项仅针对私有部署，公有云请置空，格式为 10.10.10.10:8080</i>\n    </p>\n    <p class=\"rong-input\">\n      <span></span>\n      <button @click=\"init\">初始化链接</button>\n    </p>\n    <div class=\"rong-show-box\">\n      <h3>初始化以及消息接收:</h3>\n      <p v-for=\"data in showDatas\">\n        {{data}}\n      </p>\n    </div>\n  </div>\n</template>\n\n<script>\n  import RongIMLib from '../../../static/js/RongIMLib-3.0.1-dev.es.js'\n\n  function init (params, addPromptInfo) {\n    var appkey = params.appkey\n    var token = params.token\n    var navi = params.navi\n    var config = {}\n    if (navi) {\n      config.navi = navi\n    }\n    var im = RongIMLib.init({\n      appkey\n    })\n\n    im.watch({\n      message: (event) => {\n        addPromptInfo('收到消息: ' + JSON.stringify(event))\n      },\n      conversation: (event) => {\n        addPromptInfo('会话变化: ' + JSON.stringify(event))\n      },\n      status: (event) => {\n        addPromptInfo('状态变化: ' + JSON.stringify(event))\n      }\n    })\n\n    im.connect({\n      token\n    }).then((user) => {\n      addPromptInfo('链接成功: ' + user.id)\n      console.log('connect success', user.id)\n    }).catch((e) => {\n      addPromptInfo('链接失败: ' + e.msg)\n      console.log('error')\n    })\n  }\n\n  export default {\n    name: 'landing-page',\n    data: function () {\n      return {\n        appkey: 'n19jmcy59f1q9',\n        token: '5JQlp5czM31GNl99DOZyI3xpRjANxKgfakOnYLFljI+TMvOF0hGaVtR1n9Qp4baLgKBGsyl3w5j4gAWBbNZ3nOKrvnVo8Ldl',\n        navi: '',\n        showDatas: []\n      }\n    },\n    methods: {\n      addPromptInfo: function (prompt) {\n        this.showDatas.push(prompt)\n      },\n      init: function () {\n        var appkey = this.appkey\n        var token = this.token\n        if (!appkey || !token) {\n          alert('appkey 和 token 不能为空')\n        } else {\n          init({\n            appkey: appkey,\n            token: token,\n            navi: this.navi\n          }, this.addPromptInfo)\n        }\n      }\n    }\n  }\n</script>\n\n<style>\n.rong-input span {\n  display: inline-block;\n  width: 60px;\n}\n.rong-show-box {\n  border: 1px solid lightgray;\n  padding: 10px;\n}\n.rong-show-box h3, .rong-show-box p {\n  margin: 5px 0;\n}\n\n</style>\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/main.js",
    "content": "import Vue from 'vue'\nimport axios from 'axios'\n\nimport App from './App'\nimport router from './router'\nimport store from './store'\n\nif (!process.env.IS_WEB) Vue.use(require('vue-electron'))\nVue.http = Vue.prototype.$http = axios\nVue.config.productionTip = false\n\n/* eslint-disable no-new */\nnew Vue({\n  components: { App },\n  router,\n  store,\n  template: '<App/>'\n}).$mount('#app')\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/router/index.js",
    "content": "import Vue from 'vue'\nimport Router from 'vue-router'\n\nVue.use(Router)\n\nexport default new Router({\n  routes: [\n    {\n      path: '/',\n      name: 'landing-page',\n      component: require('@/components/Init').default\n    },\n    {\n      path: '*',\n      redirect: '/'\n    }\n  ]\n})\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/store/index.js",
    "content": "import Vue from 'vue'\nimport Vuex from 'vuex'\n\nimport { createPersistedState, createSharedMutations } from 'vuex-electron'\n\nimport modules from './modules'\n\nVue.use(Vuex)\n\nexport default new Vuex.Store({\n  modules,\n  plugins: [\n    createPersistedState(),\n    createSharedMutations()\n  ],\n  strict: process.env.NODE_ENV !== 'production'\n})\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/store/modules/Counter.js",
    "content": "const state = {\n  main: 0\n}\n\nconst mutations = {\n  DECREMENT_MAIN_COUNTER (state) {\n    state.main--\n  },\n  INCREMENT_MAIN_COUNTER (state) {\n    state.main++\n  }\n}\n\nconst actions = {\n  someAsyncTask ({ commit }) {\n    // do something async\n    commit('INCREMENT_MAIN_COUNTER')\n  }\n}\n\nexport default {\n  state,\n  mutations,\n  actions\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/src/renderer/store/modules/index.js",
    "content": "/**\n * The file enables `@/store/index.js` to import all vuex modules\n * in a one-shot manner. There should not be any reason to edit this file.\n */\n\nconst files = require.context('.', false, /\\.js$/)\nconst modules = {}\n\nfiles.keys().forEach(key => {\n  if (key === './index.js') return\n  modules[key.replace(/(\\.\\/|\\.js)/g, '')] = files(key).default\n})\n\nexport default modules\n"
  },
  {
    "path": "electron-vue-sdk-v3/static/.gitkeep",
    "content": ""
  },
  {
    "path": "electron-vue-sdk-v3/static/js/RongEmoji-2.2.7.js",
    "content": "/*\n    支持范围\n    IE6+, Chrome, Safari, Firefox, Android, IOS\n */\n(function(global, factory) {\n    'use strict';\n    if (typeof exports === 'object' && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    var _export = {};\n    // emoji 默认大小\n    var DefaultSize = 24;\n    // 默认语言, 暂时仅支持 zh, en\n    var DefaultLang = 'zh';\n    // 支持的语言\n    var SupportLangs = ['zh', 'en'];\n    // 24px 的 emoji 图片地址\n    var NornalImagePath = '//cdn.ronghub.com/emojis-normal.png';\n    // 48px(高清图) 的 emoji 图片地址\n    var HdImagePath = '//cdn.ronghub.com/emojis-hd.png';\n    // emoji 的 unicode 正则匹配\n    var UnicodeReg = /\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf48b\\u200d\\uf468|\\uf468\\u200d\\u2764\\ufe0f\\u200d\\uf48b\\u200d\\uf468|\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf48b\\u200d\\uf469|\\uf468\\u200d\\uf469\\u200d\\uf467\\u200d\\uf466|\\uf468\\u200d\\uf469\\u200d\\uf466\\u200d\\uf466|\\uf468\\u200d\\uf469\\u200d\\uf467\\u200d\\uf467|\\uf468\\u200d\\uf468\\u200d\\uf467\\u200d\\uf466|\\uf468\\u200d\\uf468\\u200d\\uf466\\u200d\\uf466|\\uf468\\u200d\\uf468\\u200d\\uf467\\u200d\\uf467|\\uf469\\u200d\\uf469\\u200d\\uf467\\u200d\\uf466|\\uf469\\u200d\\uf469\\u200d\\uf466\\u200d\\uf466|\\uf469\\u200d\\uf469\\u200d\\uf467\\u200d\\uf467|\\uf3f4\\ue0067\\ue0062\\ue0065\\ue006e\\ue0067\\ue007f|\\uf3f4\\ue0067\\ue0062\\ue0073\\ue0063\\ue0074\\ue007f|\\uf3f4\\ue0067\\ue0062\\ue0077\\ue006c\\ue0073\\ue007f|\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf468|\\uf468\\u200d\\u2764\\ufe0f\\u200d\\uf468|\\uf469\\u200d\\u2764\\ufe0f\\u200d\\uf469|\\uf468\\uf3fb\\u200d\\u2695\\ufe0f|\\uf468\\uf3fc\\u200d\\u2695\\ufe0f|\\uf468\\uf3fd\\u200d\\u2695\\ufe0f|\\uf468\\uf3fe\\u200d\\u2695\\ufe0f|\\uf468\\uf3ff\\u200d\\u2695\\ufe0f|\\uf469\\uf3fb\\u200d\\u2695\\ufe0f|\\uf469\\uf3fc\\u200d\\u2695\\ufe0f|\\uf469\\uf3fd\\u200d\\u2695\\ufe0f|\\uf469\\uf3fe\\u200d\\u2695\\ufe0f|\\uf469\\uf3ff\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\u2696\\ufe0f|\\uf468\\uf3fc\\u200d\\u2696\\ufe0f|\\uf468\\uf3fd\\u200d\\u2696\\ufe0f|\\uf468\\uf3fe\\u200d\\u2696\\ufe0f|\\uf468\\uf3ff\\u200d\\u2696\\ufe0f|\\uf469\\uf3fb\\u200d\\u2696\\ufe0f|\\uf469\\uf3fc\\u200d\\u2696\\ufe0f|\\uf469\\uf3fd\\u200d\\u2696\\ufe0f|\\uf469\\uf3fe\\u200d\\u2696\\ufe0f|\\uf469\\uf3ff\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\u2708\\ufe0f|\\uf468\\uf3fc\\u200d\\u2708\\ufe0f|\\uf468\\uf3fd\\u200d\\u2708\\ufe0f|\\uf468\\uf3fe\\u200d\\u2708\\ufe0f|\\uf468\\uf3ff\\u200d\\u2708\\ufe0f|\\uf469\\uf3fb\\u200d\\u2708\\ufe0f|\\uf469\\uf3fc\\u200d\\u2708\\ufe0f|\\uf469\\uf3fd\\u200d\\u2708\\ufe0f|\\uf469\\uf3fe\\u200d\\u2708\\ufe0f|\\uf469\\uf3ff\\u200d\\u2708\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf575\\ufe0f\\u200d\\u2642\\ufe0f|\\uf575\\uf3fb\\u200d\\u2642\\ufe0f|\\uf575\\uf3fc\\u200d\\u2642\\ufe0f|\\uf575\\uf3fd\\u200d\\u2642\\ufe0f|\\uf575\\uf3fe\\u200d\\u2642\\ufe0f|\\uf575\\uf3ff\\u200d\\u2642\\ufe0f|\\uf575\\ufe0f\\u200d\\u2640\\ufe0f|\\uf575\\uf3fb\\u200d\\u2640\\ufe0f|\\uf575\\uf3fc\\u200d\\u2640\\ufe0f|\\uf575\\uf3fd\\u200d\\u2640\\ufe0f|\\uf575\\uf3fe\\u200d\\u2640\\ufe0f|\\uf575\\uf3ff\\u200d\\u2640\\ufe0f|\\uf482\\uf3fb\\u200d\\u2642\\ufe0f|\\uf482\\uf3fc\\u200d\\u2642\\ufe0f|\\uf482\\uf3fd\\u200d\\u2642\\ufe0f|\\uf482\\uf3fe\\u200d\\u2642\\ufe0f|\\uf482\\uf3ff\\u200d\\u2642\\ufe0f|\\uf482\\uf3fb\\u200d\\u2640\\ufe0f|\\uf482\\uf3fc\\u200d\\u2640\\ufe0f|\\uf482\\uf3fd\\u200d\\u2640\\ufe0f|\\uf482\\uf3fe\\u200d\\u2640\\ufe0f|\\uf482\\uf3ff\\u200d\\u2640\\ufe0f|\\uf477\\uf3fb\\u200d\\u2642\\ufe0f|\\uf477\\uf3fc\\u200d\\u2642\\ufe0f|\\uf477\\uf3fd\\u200d\\u2642\\ufe0f|\\uf477\\uf3fe\\u200d\\u2642\\ufe0f|\\uf477\\uf3ff\\u200d\\u2642\\ufe0f|\\uf477\\uf3fb\\u200d\\u2640\\ufe0f|\\uf477\\uf3fc\\u200d\\u2640\\ufe0f|\\uf477\\uf3fd\\u200d\\u2640\\ufe0f|\\uf477\\uf3fe\\u200d\\u2640\\ufe0f|\\uf477\\uf3ff\\u200d\\u2640\\ufe0f|\\uf473\\uf3fb\\u200d\\u2642\\ufe0f|\\uf473\\uf3fc\\u200d\\u2642\\ufe0f|\\uf473\\uf3fd\\u200d\\u2642\\ufe0f|\\uf473\\uf3fe\\u200d\\u2642\\ufe0f|\\uf473\\uf3ff\\u200d\\u2642\\ufe0f|\\uf473\\uf3fb\\u200d\\u2640\\ufe0f|\\uf473\\uf3fc\\u200d\\u2640\\ufe0f|\\uf473\\uf3fd\\u200d\\u2640\\ufe0f|\\uf473\\uf3fe\\u200d\\u2640\\ufe0f|\\uf473\\uf3ff\\u200d\\u2640\\ufe0f|\\uf471\\uf3fb\\u200d\\u2642\\ufe0f|\\uf471\\uf3fc\\u200d\\u2642\\ufe0f|\\uf471\\uf3fd\\u200d\\u2642\\ufe0f|\\uf471\\uf3fe\\u200d\\u2642\\ufe0f|\\uf471\\uf3ff\\u200d\\u2642\\ufe0f|\\uf471\\uf3fb\\u200d\\u2640\\ufe0f|\\uf471\\uf3fc\\u200d\\u2640\\ufe0f|\\uf471\\uf3fd\\u200d\\u2640\\ufe0f|\\uf471\\uf3fe\\u200d\\u2640\\ufe0f|\\uf471\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf645\\uf3fb\\u200d\\u2642\\ufe0f|\\uf645\\uf3fc\\u200d\\u2642\\ufe0f|\\uf645\\uf3fd\\u200d\\u2642\\ufe0f|\\uf645\\uf3fe\\u200d\\u2642\\ufe0f|\\uf645\\uf3ff\\u200d\\u2642\\ufe0f|\\uf645\\uf3fb\\u200d\\u2640\\ufe0f|\\uf645\\uf3fc\\u200d\\u2640\\ufe0f|\\uf645\\uf3fd\\u200d\\u2640\\ufe0f|\\uf645\\uf3fe\\u200d\\u2640\\ufe0f|\\uf645\\uf3ff\\u200d\\u2640\\ufe0f|\\uf646\\uf3fb\\u200d\\u2642\\ufe0f|\\uf646\\uf3fc\\u200d\\u2642\\ufe0f|\\uf646\\uf3fd\\u200d\\u2642\\ufe0f|\\uf646\\uf3fe\\u200d\\u2642\\ufe0f|\\uf646\\uf3ff\\u200d\\u2642\\ufe0f|\\uf646\\uf3fb\\u200d\\u2640\\ufe0f|\\uf646\\uf3fc\\u200d\\u2640\\ufe0f|\\uf646\\uf3fd\\u200d\\u2640\\ufe0f|\\uf646\\uf3fe\\u200d\\u2640\\ufe0f|\\uf646\\uf3ff\\u200d\\u2640\\ufe0f|\\uf481\\uf3fb\\u200d\\u2642\\ufe0f|\\uf481\\uf3fc\\u200d\\u2642\\ufe0f|\\uf481\\uf3fd\\u200d\\u2642\\ufe0f|\\uf481\\uf3fe\\u200d\\u2642\\ufe0f|\\uf481\\uf3ff\\u200d\\u2642\\ufe0f|\\uf481\\uf3fb\\u200d\\u2640\\ufe0f|\\uf481\\uf3fc\\u200d\\u2640\\ufe0f|\\uf481\\uf3fd\\u200d\\u2640\\ufe0f|\\uf481\\uf3fe\\u200d\\u2640\\ufe0f|\\uf481\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2640\\ufe0f|\\uf647\\uf3fb\\u200d\\u2642\\ufe0f|\\uf647\\uf3fc\\u200d\\u2642\\ufe0f|\\uf647\\uf3fd\\u200d\\u2642\\ufe0f|\\uf647\\uf3fe\\u200d\\u2642\\ufe0f|\\uf647\\uf3ff\\u200d\\u2642\\ufe0f|\\uf647\\uf3fb\\u200d\\u2640\\ufe0f|\\uf647\\uf3fc\\u200d\\u2640\\ufe0f|\\uf647\\uf3fd\\u200d\\u2640\\ufe0f|\\uf647\\uf3fe\\u200d\\u2640\\ufe0f|\\uf647\\uf3ff\\u200d\\u2640\\ufe0f|\\uf926\\uf3fb\\u200d\\u2642\\ufe0f|\\uf926\\uf3fc\\u200d\\u2642\\ufe0f|\\uf926\\uf3fd\\u200d\\u2642\\ufe0f|\\uf926\\uf3fe\\u200d\\u2642\\ufe0f|\\uf926\\uf3ff\\u200d\\u2642\\ufe0f|\\uf926\\uf3fb\\u200d\\u2640\\ufe0f|\\uf926\\uf3fc\\u200d\\u2640\\ufe0f|\\uf926\\uf3fd\\u200d\\u2640\\ufe0f|\\uf926\\uf3fe\\u200d\\u2640\\ufe0f|\\uf926\\uf3ff\\u200d\\u2640\\ufe0f|\\uf937\\uf3fb\\u200d\\u2642\\ufe0f|\\uf937\\uf3fc\\u200d\\u2642\\ufe0f|\\uf937\\uf3fd\\u200d\\u2642\\ufe0f|\\uf937\\uf3fe\\u200d\\u2642\\ufe0f|\\uf937\\uf3ff\\u200d\\u2642\\ufe0f|\\uf937\\uf3fb\\u200d\\u2640\\ufe0f|\\uf937\\uf3fc\\u200d\\u2640\\ufe0f|\\uf937\\uf3fd\\u200d\\u2640\\ufe0f|\\uf937\\uf3fe\\u200d\\u2640\\ufe0f|\\uf937\\uf3ff\\u200d\\u2640\\ufe0f|\\uf486\\uf3fb\\u200d\\u2642\\ufe0f|\\uf486\\uf3fc\\u200d\\u2642\\ufe0f|\\uf486\\uf3fd\\u200d\\u2642\\ufe0f|\\uf486\\uf3fe\\u200d\\u2642\\ufe0f|\\uf486\\uf3ff\\u200d\\u2642\\ufe0f|\\uf486\\uf3fb\\u200d\\u2640\\ufe0f|\\uf486\\uf3fc\\u200d\\u2640\\ufe0f|\\uf486\\uf3fd\\u200d\\u2640\\ufe0f|\\uf486\\uf3fe\\u200d\\u2640\\ufe0f|\\uf486\\uf3ff\\u200d\\u2640\\ufe0f|\\uf487\\uf3fb\\u200d\\u2642\\ufe0f|\\uf487\\uf3fc\\u200d\\u2642\\ufe0f|\\uf487\\uf3fd\\u200d\\u2642\\ufe0f|\\uf487\\uf3fe\\u200d\\u2642\\ufe0f|\\uf487\\uf3ff\\u200d\\u2642\\ufe0f|\\uf487\\uf3fb\\u200d\\u2640\\ufe0f|\\uf487\\uf3fc\\u200d\\u2640\\ufe0f|\\uf487\\uf3fd\\u200d\\u2640\\ufe0f|\\uf487\\uf3fe\\u200d\\u2640\\ufe0f|\\uf487\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\ufe0f\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\ufe0f\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2640\\ufe0f|\\u26f9\\ufe0f\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fb\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fc\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fd\\u200d\\u2642\\ufe0f|\\u26f9\\uf3fe\\u200d\\u2642\\ufe0f|\\u26f9\\uf3ff\\u200d\\u2642\\ufe0f|\\u26f9\\ufe0f\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fb\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fc\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fd\\u200d\\u2640\\ufe0f|\\u26f9\\uf3fe\\u200d\\u2640\\ufe0f|\\u26f9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3cb\\ufe0f\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cb\\ufe0f\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2640\\ufe0f|\\uf938\\uf3fb\\u200d\\u2642\\ufe0f|\\uf938\\uf3fc\\u200d\\u2642\\ufe0f|\\uf938\\uf3fd\\u200d\\u2642\\ufe0f|\\uf938\\uf3fe\\u200d\\u2642\\ufe0f|\\uf938\\uf3ff\\u200d\\u2642\\ufe0f|\\uf938\\uf3fb\\u200d\\u2640\\ufe0f|\\uf938\\uf3fc\\u200d\\u2640\\ufe0f|\\uf938\\uf3fd\\u200d\\u2640\\ufe0f|\\uf938\\uf3fe\\u200d\\u2640\\ufe0f|\\uf938\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf939\\uf3fb\\u200d\\u2642\\ufe0f|\\uf939\\uf3fc\\u200d\\u2642\\ufe0f|\\uf939\\uf3fd\\u200d\\u2642\\ufe0f|\\uf939\\uf3fe\\u200d\\u2642\\ufe0f|\\uf939\\uf3ff\\u200d\\u2642\\ufe0f|\\uf939\\uf3fb\\u200d\\u2640\\ufe0f|\\uf939\\uf3fc\\u200d\\u2640\\ufe0f|\\uf939\\uf3fd\\u200d\\u2640\\ufe0f|\\uf939\\uf3fe\\u200d\\u2640\\ufe0f|\\uf939\\uf3ff\\u200d\\u2640\\ufe0f|\\uf468\\u200d\\uf469\\u200d\\uf466|\\uf468\\u200d\\uf469\\u200d\\uf467|\\uf468\\u200d\\uf468\\u200d\\uf466|\\uf468\\u200d\\uf468\\u200d\\uf467|\\uf469\\u200d\\uf469\\u200d\\uf466|\\uf469\\u200d\\uf469\\u200d\\uf467|\\uf468\\u200d\\uf466\\u200d\\uf466|\\uf468\\u200d\\uf467\\u200d\\uf466|\\uf468\\u200d\\uf467\\u200d\\uf467|\\uf469\\u200d\\uf466\\u200d\\uf466|\\uf469\\u200d\\uf467\\u200d\\uf466|\\uf469\\u200d\\uf467\\u200d\\uf467|\\uf441\\ufe0f\\u200d\\uf5e8\\ufe0f|\\uf468\\u200d\\u2695\\ufe0f|\\uf469\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\uf393|\\uf468\\uf3fc\\u200d\\uf393|\\uf468\\uf3fd\\u200d\\uf393|\\uf468\\uf3fe\\u200d\\uf393|\\uf468\\uf3ff\\u200d\\uf393|\\uf469\\uf3fb\\u200d\\uf393|\\uf469\\uf3fc\\u200d\\uf393|\\uf469\\uf3fd\\u200d\\uf393|\\uf469\\uf3fe\\u200d\\uf393|\\uf469\\uf3ff\\u200d\\uf393|\\uf468\\uf3fb\\u200d\\uf3eb|\\uf468\\uf3fc\\u200d\\uf3eb|\\uf468\\uf3fd\\u200d\\uf3eb|\\uf468\\uf3fe\\u200d\\uf3eb|\\uf468\\uf3ff\\u200d\\uf3eb|\\uf469\\uf3fb\\u200d\\uf3eb|\\uf469\\uf3fc\\u200d\\uf3eb|\\uf469\\uf3fd\\u200d\\uf3eb|\\uf469\\uf3fe\\u200d\\uf3eb|\\uf469\\uf3ff\\u200d\\uf3eb|\\uf468\\u200d\\u2696\\ufe0f|\\uf469\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\uf33e|\\uf468\\uf3fc\\u200d\\uf33e|\\uf468\\uf3fd\\u200d\\uf33e|\\uf468\\uf3fe\\u200d\\uf33e|\\uf468\\uf3ff\\u200d\\uf33e|\\uf469\\uf3fb\\u200d\\uf33e|\\uf469\\uf3fc\\u200d\\uf33e|\\uf469\\uf3fd\\u200d\\uf33e|\\uf469\\uf3fe\\u200d\\uf33e|\\uf469\\uf3ff\\u200d\\uf33e|\\uf468\\uf3fb\\u200d\\uf373|\\uf468\\uf3fc\\u200d\\uf373|\\uf468\\uf3fd\\u200d\\uf373|\\uf468\\uf3fe\\u200d\\uf373|\\uf468\\uf3ff\\u200d\\uf373|\\uf469\\uf3fb\\u200d\\uf373|\\uf469\\uf3fc\\u200d\\uf373|\\uf469\\uf3fd\\u200d\\uf373|\\uf469\\uf3fe\\u200d\\uf373|\\uf469\\uf3ff\\u200d\\uf373|\\uf468\\uf3fb\\u200d\\uf527|\\uf468\\uf3fc\\u200d\\uf527|\\uf468\\uf3fd\\u200d\\uf527|\\uf468\\uf3fe\\u200d\\uf527|\\uf468\\uf3ff\\u200d\\uf527|\\uf469\\uf3fb\\u200d\\uf527|\\uf469\\uf3fc\\u200d\\uf527|\\uf469\\uf3fd\\u200d\\uf527|\\uf469\\uf3fe\\u200d\\uf527|\\uf469\\uf3ff\\u200d\\uf527|\\uf468\\uf3fb\\u200d\\uf3ed|\\uf468\\uf3fc\\u200d\\uf3ed|\\uf468\\uf3fd\\u200d\\uf3ed|\\uf468\\uf3fe\\u200d\\uf3ed|\\uf468\\uf3ff\\u200d\\uf3ed|\\uf469\\uf3fb\\u200d\\uf3ed|\\uf469\\uf3fc\\u200d\\uf3ed|\\uf469\\uf3fd\\u200d\\uf3ed|\\uf469\\uf3fe\\u200d\\uf3ed|\\uf469\\uf3ff\\u200d\\uf3ed|\\uf468\\uf3fb\\u200d\\uf4bc|\\uf468\\uf3fc\\u200d\\uf4bc|\\uf468\\uf3fd\\u200d\\uf4bc|\\uf468\\uf3fe\\u200d\\uf4bc|\\uf468\\uf3ff\\u200d\\uf4bc|\\uf469\\uf3fb\\u200d\\uf4bc|\\uf469\\uf3fc\\u200d\\uf4bc|\\uf469\\uf3fd\\u200d\\uf4bc|\\uf469\\uf3fe\\u200d\\uf4bc|\\uf469\\uf3ff\\u200d\\uf4bc|\\uf468\\uf3fb\\u200d\\uf52c|\\uf468\\uf3fc\\u200d\\uf52c|\\uf468\\uf3fd\\u200d\\uf52c|\\uf468\\uf3fe\\u200d\\uf52c|\\uf468\\uf3ff\\u200d\\uf52c|\\uf469\\uf3fb\\u200d\\uf52c|\\uf469\\uf3fc\\u200d\\uf52c|\\uf469\\uf3fd\\u200d\\uf52c|\\uf469\\uf3fe\\u200d\\uf52c|\\uf469\\uf3ff\\u200d\\uf52c|\\uf468\\uf3fb\\u200d\\uf4bb|\\uf468\\uf3fc\\u200d\\uf4bb|\\uf468\\uf3fd\\u200d\\uf4bb|\\uf468\\uf3fe\\u200d\\uf4bb|\\uf468\\uf3ff\\u200d\\uf4bb|\\uf469\\uf3fb\\u200d\\uf4bb|\\uf469\\uf3fc\\u200d\\uf4bb|\\uf469\\uf3fd\\u200d\\uf4bb|\\uf469\\uf3fe\\u200d\\uf4bb|\\uf469\\uf3ff\\u200d\\uf4bb|\\uf468\\uf3fb\\u200d\\uf3a4|\\uf468\\uf3fc\\u200d\\uf3a4|\\uf468\\uf3fd\\u200d\\uf3a4|\\uf468\\uf3fe\\u200d\\uf3a4|\\uf468\\uf3ff\\u200d\\uf3a4|\\uf469\\uf3fb\\u200d\\uf3a4|\\uf469\\uf3fc\\u200d\\uf3a4|\\uf469\\uf3fd\\u200d\\uf3a4|\\uf469\\uf3fe\\u200d\\uf3a4|\\uf469\\uf3ff\\u200d\\uf3a4|\\uf468\\uf3fb\\u200d\\uf3a8|\\uf468\\uf3fc\\u200d\\uf3a8|\\uf468\\uf3fd\\u200d\\uf3a8|\\uf468\\uf3fe\\u200d\\uf3a8|\\uf468\\uf3ff\\u200d\\uf3a8|\\uf469\\uf3fb\\u200d\\uf3a8|\\uf469\\uf3fc\\u200d\\uf3a8|\\uf469\\uf3fd\\u200d\\uf3a8|\\uf469\\uf3fe\\u200d\\uf3a8|\\uf469\\uf3ff\\u200d\\uf3a8|\\uf468\\u200d\\u2708\\ufe0f|\\uf469\\u200d\\u2708\\ufe0f|\\uf468\\uf3fb\\u200d\\uf680|\\uf468\\uf3fc\\u200d\\uf680|\\uf468\\uf3fd\\u200d\\uf680|\\uf468\\uf3fe\\u200d\\uf680|\\uf468\\uf3ff\\u200d\\uf680|\\uf469\\uf3fb\\u200d\\uf680|\\uf469\\uf3fc\\u200d\\uf680|\\uf469\\uf3fd\\u200d\\uf680|\\uf469\\uf3fe\\u200d\\uf680|\\uf469\\uf3ff\\u200d\\uf680|\\uf468\\uf3fb\\u200d\\uf692|\\uf468\\uf3fc\\u200d\\uf692|\\uf468\\uf3fd\\u200d\\uf692|\\uf468\\uf3fe\\u200d\\uf692|\\uf468\\uf3ff\\u200d\\uf692|\\uf469\\uf3fb\\u200d\\uf692|\\uf469\\uf3fc\\u200d\\uf692|\\uf469\\uf3fd\\u200d\\uf692|\\uf469\\uf3fe\\u200d\\uf692|\\uf469\\uf3ff\\u200d\\uf692|\\uf46e\\u200d\\u2642\\ufe0f|\\uf46e\\u200d\\u2640\\ufe0f|\\uf482\\u200d\\u2642\\ufe0f|\\uf482\\u200d\\u2640\\ufe0f|\\uf477\\u200d\\u2642\\ufe0f|\\uf477\\u200d\\u2640\\ufe0f|\\uf473\\u200d\\u2642\\ufe0f|\\uf473\\u200d\\u2640\\ufe0f|\\uf471\\u200d\\u2642\\ufe0f|\\uf471\\u200d\\u2640\\ufe0f|\\uf9d9\\u200d\\u2640\\ufe0f|\\uf9d9\\u200d\\u2642\\ufe0f|\\uf9da\\u200d\\u2640\\ufe0f|\\uf9da\\u200d\\u2642\\ufe0f|\\uf9db\\u200d\\u2640\\ufe0f|\\uf9db\\u200d\\u2642\\ufe0f|\\uf9dc\\u200d\\u2640\\ufe0f|\\uf9dc\\u200d\\u2642\\ufe0f|\\uf9dd\\u200d\\u2640\\ufe0f|\\uf9dd\\u200d\\u2642\\ufe0f|\\uf9de\\u200d\\u2640\\ufe0f|\\uf9de\\u200d\\u2642\\ufe0f|\\uf9df\\u200d\\u2640\\ufe0f|\\uf9df\\u200d\\u2642\\ufe0f|\\uf64d\\u200d\\u2642\\ufe0f|\\uf64d\\u200d\\u2640\\ufe0f|\\uf64e\\u200d\\u2642\\ufe0f|\\uf64e\\u200d\\u2640\\ufe0f|\\uf645\\u200d\\u2642\\ufe0f|\\uf645\\u200d\\u2640\\ufe0f|\\uf646\\u200d\\u2642\\ufe0f|\\uf646\\u200d\\u2640\\ufe0f|\\uf481\\u200d\\u2642\\ufe0f|\\uf481\\u200d\\u2640\\ufe0f|\\uf64b\\u200d\\u2642\\ufe0f|\\uf64b\\u200d\\u2640\\ufe0f|\\uf647\\u200d\\u2642\\ufe0f|\\uf647\\u200d\\u2640\\ufe0f|\\uf926\\u200d\\u2642\\ufe0f|\\uf926\\u200d\\u2640\\ufe0f|\\uf937\\u200d\\u2642\\ufe0f|\\uf937\\u200d\\u2640\\ufe0f|\\uf486\\u200d\\u2642\\ufe0f|\\uf486\\u200d\\u2640\\ufe0f|\\uf487\\u200d\\u2642\\ufe0f|\\uf487\\u200d\\u2640\\ufe0f|\\uf6b6\\u200d\\u2642\\ufe0f|\\uf6b6\\u200d\\u2640\\ufe0f|\\uf3c3\\u200d\\u2642\\ufe0f|\\uf3c3\\u200d\\u2640\\ufe0f|\\uf46f\\u200d\\u2642\\ufe0f|\\uf46f\\u200d\\u2640\\ufe0f|\\uf9d6\\u200d\\u2640\\ufe0f|\\uf9d6\\u200d\\u2642\\ufe0f|\\uf9d7\\u200d\\u2640\\ufe0f|\\uf9d7\\u200d\\u2642\\ufe0f|\\uf9d8\\u200d\\u2640\\ufe0f|\\uf9d8\\u200d\\u2642\\ufe0f|\\uf3c4\\u200d\\u2642\\ufe0f|\\uf3c4\\u200d\\u2640\\ufe0f|\\uf6a3\\u200d\\u2642\\ufe0f|\\uf6a3\\u200d\\u2640\\ufe0f|\\uf3ca\\u200d\\u2642\\ufe0f|\\uf3ca\\u200d\\u2640\\ufe0f|\\uf6b4\\u200d\\u2642\\ufe0f|\\uf6b4\\u200d\\u2640\\ufe0f|\\uf6b5\\u200d\\u2642\\ufe0f|\\uf6b5\\u200d\\u2640\\ufe0f|\\uf938\\u200d\\u2642\\ufe0f|\\uf938\\u200d\\u2640\\ufe0f|\\uf93c\\u200d\\u2642\\ufe0f|\\uf93c\\u200d\\u2640\\ufe0f|\\uf93d\\u200d\\u2642\\ufe0f|\\uf93d\\u200d\\u2640\\ufe0f|\\uf93e\\u200d\\u2642\\ufe0f|\\uf93e\\u200d\\u2640\\ufe0f|\\uf939\\u200d\\u2642\\ufe0f|\\uf939\\u200d\\u2640\\ufe0f|\\uf3f3\\ufe0f\\u200d\\uf308|\\uf468\\u200d\\uf393|\\uf469\\u200d\\uf393|\\uf468\\u200d\\uf3eb|\\uf469\\u200d\\uf3eb|\\uf468\\u200d\\uf33e|\\uf469\\u200d\\uf33e|\\uf468\\u200d\\uf373|\\uf469\\u200d\\uf373|\\uf468\\u200d\\uf527|\\uf469\\u200d\\uf527|\\uf468\\u200d\\uf3ed|\\uf469\\u200d\\uf3ed|\\uf468\\u200d\\uf4bc|\\uf469\\u200d\\uf4bc|\\uf468\\u200d\\uf52c|\\uf469\\u200d\\uf52c|\\uf468\\u200d\\uf4bb|\\uf469\\u200d\\uf4bb|\\uf468\\u200d\\uf3a4|\\uf469\\u200d\\uf3a4|\\uf468\\u200d\\uf3a8|\\uf469\\u200d\\uf3a8|\\uf468\\u200d\\uf680|\\uf469\\u200d\\uf680|\\uf468\\u200d\\uf692|\\uf469\\u200d\\uf692|\\uf468\\u200d\\uf466|\\uf468\\u200d\\uf467|\\uf469\\u200d\\uf466|\\uf469\\u200d\\uf467|\\u0023\\ufe0f\\u20e3|\\u002a\\ufe0f\\u20e3|\\u0030\\ufe0f\\u20e3|\\u0031\\ufe0f\\u20e3|\\u0032\\ufe0f\\u20e3|\\u0033\\ufe0f\\u20e3|\\u0034\\ufe0f\\u20e3|\\u0035\\ufe0f\\u20e3|\\u0036\\ufe0f\\u20e3|\\u0037\\ufe0f\\u20e3|\\u0038\\ufe0f\\u20e3|\\u0039\\ufe0f\\u20e3|\\uf476\\uf3fb|\\uf476\\uf3fc|\\uf476\\uf3fd|\\uf476\\uf3fe|\\uf476\\uf3ff|\\uf9d2\\uf3fb|\\uf9d2\\uf3fc|\\uf9d2\\uf3fd|\\uf9d2\\uf3fe|\\uf9d2\\uf3ff|\\uf466\\uf3fb|\\uf466\\uf3fc|\\uf466\\uf3fd|\\uf466\\uf3fe|\\uf466\\uf3ff|\\uf467\\uf3fb|\\uf467\\uf3fc|\\uf467\\uf3fd|\\uf467\\uf3fe|\\uf467\\uf3ff|\\uf9d1\\uf3fb|\\uf9d1\\uf3fc|\\uf9d1\\uf3fd|\\uf9d1\\uf3fe|\\uf9d1\\uf3ff|\\uf468\\uf3fb|\\uf468\\uf3fc|\\uf468\\uf3fd|\\uf468\\uf3fe|\\uf468\\uf3ff|\\uf469\\uf3fb|\\uf469\\uf3fc|\\uf469\\uf3fd|\\uf469\\uf3fe|\\uf469\\uf3ff|\\uf9d3\\uf3fb|\\uf9d3\\uf3fc|\\uf9d3\\uf3fd|\\uf9d3\\uf3fe|\\uf9d3\\uf3ff|\\uf474\\uf3fb|\\uf474\\uf3fc|\\uf474\\uf3fd|\\uf474\\uf3fe|\\uf474\\uf3ff|\\uf475\\uf3fb|\\uf475\\uf3fc|\\uf475\\uf3fd|\\uf475\\uf3fe|\\uf475\\uf3ff|\\uf46e\\uf3fb|\\uf46e\\uf3fc|\\uf46e\\uf3fd|\\uf46e\\uf3fe|\\uf46e\\uf3ff|\\uf575\\uf3fb|\\uf575\\uf3fc|\\uf575\\uf3fd|\\uf575\\uf3fe|\\uf575\\uf3ff|\\uf482\\uf3fb|\\uf482\\uf3fc|\\uf482\\uf3fd|\\uf482\\uf3fe|\\uf482\\uf3ff|\\uf477\\uf3fb|\\uf477\\uf3fc|\\uf477\\uf3fd|\\uf477\\uf3fe|\\uf477\\uf3ff|\\uf934\\uf3fb|\\uf934\\uf3fc|\\uf934\\uf3fd|\\uf934\\uf3fe|\\uf934\\uf3ff|\\uf478\\uf3fb|\\uf478\\uf3fc|\\uf478\\uf3fd|\\uf478\\uf3fe|\\uf478\\uf3ff|\\uf473\\uf3fb|\\uf473\\uf3fc|\\uf473\\uf3fd|\\uf473\\uf3fe|\\uf473\\uf3ff|\\uf472\\uf3fb|\\uf472\\uf3fc|\\uf472\\uf3fd|\\uf472\\uf3fe|\\uf472\\uf3ff|\\uf9d5\\uf3fb|\\uf9d5\\uf3fc|\\uf9d5\\uf3fd|\\uf9d5\\uf3fe|\\uf9d5\\uf3ff|\\uf9d4\\uf3fb|\\uf9d4\\uf3fc|\\uf9d4\\uf3fd|\\uf9d4\\uf3fe|\\uf9d4\\uf3ff|\\uf471\\uf3fb|\\uf471\\uf3fc|\\uf471\\uf3fd|\\uf471\\uf3fe|\\uf471\\uf3ff|\\uf935\\uf3fb|\\uf935\\uf3fc|\\uf935\\uf3fd|\\uf935\\uf3fe|\\uf935\\uf3ff|\\uf470\\uf3fb|\\uf470\\uf3fc|\\uf470\\uf3fd|\\uf470\\uf3fe|\\uf470\\uf3ff|\\uf930\\uf3fb|\\uf930\\uf3fc|\\uf930\\uf3fd|\\uf930\\uf3fe|\\uf930\\uf3ff|\\uf931\\uf3fb|\\uf931\\uf3fc|\\uf931\\uf3fd|\\uf931\\uf3fe|\\uf931\\uf3ff|\\uf47c\\uf3fb|\\uf47c\\uf3fc|\\uf47c\\uf3fd|\\uf47c\\uf3fe|\\uf47c\\uf3ff|\\uf385\\uf3fb|\\uf385\\uf3fc|\\uf385\\uf3fd|\\uf385\\uf3fe|\\uf385\\uf3ff|\\uf936\\uf3fb|\\uf936\\uf3fc|\\uf936\\uf3fd|\\uf936\\uf3fe|\\uf936\\uf3ff|\\uf9d9\\uf3fb|\\uf9d9\\uf3fc|\\uf9d9\\uf3fd|\\uf9d9\\uf3fe|\\uf9d9\\uf3ff|\\uf9da\\uf3fb|\\uf9da\\uf3fc|\\uf9da\\uf3fd|\\uf9da\\uf3fe|\\uf9da\\uf3ff|\\uf9db\\uf3fb|\\uf9db\\uf3fc|\\uf9db\\uf3fd|\\uf9db\\uf3fe|\\uf9db\\uf3ff|\\uf9dc\\uf3fb|\\uf9dc\\uf3fc|\\uf9dc\\uf3fd|\\uf9dc\\uf3fe|\\uf9dc\\uf3ff|\\uf9dd\\uf3fb|\\uf9dd\\uf3fc|\\uf9dd\\uf3fd|\\uf9dd\\uf3fe|\\uf9dd\\uf3ff|\\uf64d\\uf3fb|\\uf64d\\uf3fc|\\uf64d\\uf3fd|\\uf64d\\uf3fe|\\uf64d\\uf3ff|\\uf64e\\uf3fb|\\uf64e\\uf3fc|\\uf64e\\uf3fd|\\uf64e\\uf3fe|\\uf64e\\uf3ff|\\uf645\\uf3fb|\\uf645\\uf3fc|\\uf645\\uf3fd|\\uf645\\uf3fe|\\uf645\\uf3ff|\\uf646\\uf3fb|\\uf646\\uf3fc|\\uf646\\uf3fd|\\uf646\\uf3fe|\\uf646\\uf3ff|\\uf481\\uf3fb|\\uf481\\uf3fc|\\uf481\\uf3fd|\\uf481\\uf3fe|\\uf481\\uf3ff|\\uf64b\\uf3fb|\\uf64b\\uf3fc|\\uf64b\\uf3fd|\\uf64b\\uf3fe|\\uf64b\\uf3ff|\\uf647\\uf3fb|\\uf647\\uf3fc|\\uf647\\uf3fd|\\uf647\\uf3fe|\\uf647\\uf3ff|\\uf926\\uf3fb|\\uf926\\uf3fc|\\uf926\\uf3fd|\\uf926\\uf3fe|\\uf926\\uf3ff|\\uf937\\uf3fb|\\uf937\\uf3fc|\\uf937\\uf3fd|\\uf937\\uf3fe|\\uf937\\uf3ff|\\uf486\\uf3fb|\\uf486\\uf3fc|\\uf486\\uf3fd|\\uf486\\uf3fe|\\uf486\\uf3ff|\\uf487\\uf3fb|\\uf487\\uf3fc|\\uf487\\uf3fd|\\uf487\\uf3fe|\\uf487\\uf3ff|\\uf6b6\\uf3fb|\\uf6b6\\uf3fc|\\uf6b6\\uf3fd|\\uf6b6\\uf3fe|\\uf6b6\\uf3ff|\\uf3c3\\uf3fb|\\uf3c3\\uf3fc|\\uf3c3\\uf3fd|\\uf3c3\\uf3fe|\\uf3c3\\uf3ff|\\uf483\\uf3fb|\\uf483\\uf3fc|\\uf483\\uf3fd|\\uf483\\uf3fe|\\uf483\\uf3ff|\\uf57a\\uf3fb|\\uf57a\\uf3fc|\\uf57a\\uf3fd|\\uf57a\\uf3fe|\\uf57a\\uf3ff|\\uf9d6\\uf3fb|\\uf9d6\\uf3fc|\\uf9d6\\uf3fd|\\uf9d6\\uf3fe|\\uf9d6\\uf3ff|\\uf9d7\\uf3fb|\\uf9d7\\uf3fc|\\uf9d7\\uf3fd|\\uf9d7\\uf3fe|\\uf9d7\\uf3ff|\\uf9d8\\uf3fb|\\uf9d8\\uf3fc|\\uf9d8\\uf3fd|\\uf9d8\\uf3fe|\\uf9d8\\uf3ff|\\uf6c0\\uf3fb|\\uf6c0\\uf3fc|\\uf6c0\\uf3fd|\\uf6c0\\uf3fe|\\uf6c0\\uf3ff|\\uf6cc\\uf3fb|\\uf6cc\\uf3fc|\\uf6cc\\uf3fd|\\uf6cc\\uf3fe|\\uf6cc\\uf3ff|\\uf574\\uf3fb|\\uf574\\uf3fc|\\uf574\\uf3fd|\\uf574\\uf3fe|\\uf574\\uf3ff|\\uf3c7\\uf3fb|\\uf3c7\\uf3fc|\\uf3c7\\uf3fd|\\uf3c7\\uf3fe|\\uf3c7\\uf3ff|\\uf3c2\\uf3fb|\\uf3c2\\uf3fc|\\uf3c2\\uf3fd|\\uf3c2\\uf3fe|\\uf3c2\\uf3ff|\\uf3cc\\uf3fb|\\uf3cc\\uf3fc|\\uf3cc\\uf3fd|\\uf3cc\\uf3fe|\\uf3cc\\uf3ff|\\uf3c4\\uf3fb|\\uf3c4\\uf3fc|\\uf3c4\\uf3fd|\\uf3c4\\uf3fe|\\uf3c4\\uf3ff|\\uf6a3\\uf3fb|\\uf6a3\\uf3fc|\\uf6a3\\uf3fd|\\uf6a3\\uf3fe|\\uf6a3\\uf3ff|\\uf3ca\\uf3fb|\\uf3ca\\uf3fc|\\uf3ca\\uf3fd|\\uf3ca\\uf3fe|\\uf3ca\\uf3ff|\\u26f9\\uf3fb|\\u26f9\\uf3fc|\\u26f9\\uf3fd|\\u26f9\\uf3fe|\\u26f9\\uf3ff|\\uf3cb\\uf3fb|\\uf3cb\\uf3fc|\\uf3cb\\uf3fd|\\uf3cb\\uf3fe|\\uf3cb\\uf3ff|\\uf6b4\\uf3fb|\\uf6b4\\uf3fc|\\uf6b4\\uf3fd|\\uf6b4\\uf3fe|\\uf6b4\\uf3ff|\\uf6b5\\uf3fb|\\uf6b5\\uf3fc|\\uf6b5\\uf3fd|\\uf6b5\\uf3fe|\\uf6b5\\uf3ff|\\uf938\\uf3fb|\\uf938\\uf3fc|\\uf938\\uf3fd|\\uf938\\uf3fe|\\uf938\\uf3ff|\\uf93d\\uf3fb|\\uf93d\\uf3fc|\\uf93d\\uf3fd|\\uf93d\\uf3fe|\\uf93d\\uf3ff|\\uf93e\\uf3fb|\\uf93e\\uf3fc|\\uf93e\\uf3fd|\\uf93e\\uf3fe|\\uf93e\\uf3ff|\\uf939\\uf3fb|\\uf939\\uf3fc|\\uf939\\uf3fd|\\uf939\\uf3fe|\\uf939\\uf3ff|\\uf933\\uf3fb|\\uf933\\uf3fc|\\uf933\\uf3fd|\\uf933\\uf3fe|\\uf933\\uf3ff|\\uf4aa\\uf3fb|\\uf4aa\\uf3fc|\\uf4aa\\uf3fd|\\uf4aa\\uf3fe|\\uf4aa\\uf3ff|\\uf448\\uf3fb|\\uf448\\uf3fc|\\uf448\\uf3fd|\\uf448\\uf3fe|\\uf448\\uf3ff|\\uf449\\uf3fb|\\uf449\\uf3fc|\\uf449\\uf3fd|\\uf449\\uf3fe|\\uf449\\uf3ff|\\u261d\\uf3fb|\\u261d\\uf3fc|\\u261d\\uf3fd|\\u261d\\uf3fe|\\u261d\\uf3ff|\\uf446\\uf3fb|\\uf446\\uf3fc|\\uf446\\uf3fd|\\uf446\\uf3fe|\\uf446\\uf3ff|\\uf595\\uf3fb|\\uf595\\uf3fc|\\uf595\\uf3fd|\\uf595\\uf3fe|\\uf595\\uf3ff|\\uf447\\uf3fb|\\uf447\\uf3fc|\\uf447\\uf3fd|\\uf447\\uf3fe|\\uf447\\uf3ff|\\u270c\\uf3fb|\\u270c\\uf3fc|\\u270c\\uf3fd|\\u270c\\uf3fe|\\u270c\\uf3ff|\\uf91e\\uf3fb|\\uf91e\\uf3fc|\\uf91e\\uf3fd|\\uf91e\\uf3fe|\\uf91e\\uf3ff|\\uf596\\uf3fb|\\uf596\\uf3fc|\\uf596\\uf3fd|\\uf596\\uf3fe|\\uf596\\uf3ff|\\uf918\\uf3fb|\\uf918\\uf3fc|\\uf918\\uf3fd|\\uf918\\uf3fe|\\uf918\\uf3ff|\\uf919\\uf3fb|\\uf919\\uf3fc|\\uf919\\uf3fd|\\uf919\\uf3fe|\\uf919\\uf3ff|\\uf590\\uf3fb|\\uf590\\uf3fc|\\uf590\\uf3fd|\\uf590\\uf3fe|\\uf590\\uf3ff|\\u270b\\uf3fb|\\u270b\\uf3fc|\\u270b\\uf3fd|\\u270b\\uf3fe|\\u270b\\uf3ff|\\uf44c\\uf3fb|\\uf44c\\uf3fc|\\uf44c\\uf3fd|\\uf44c\\uf3fe|\\uf44c\\uf3ff|\\uf44d\\uf3fb|\\uf44d\\uf3fc|\\uf44d\\uf3fd|\\uf44d\\uf3fe|\\uf44d\\uf3ff|\\uf44e\\uf3fb|\\uf44e\\uf3fc|\\uf44e\\uf3fd|\\uf44e\\uf3fe|\\uf44e\\uf3ff|\\u270a\\uf3fb|\\u270a\\uf3fc|\\u270a\\uf3fd|\\u270a\\uf3fe|\\u270a\\uf3ff|\\uf44a\\uf3fb|\\uf44a\\uf3fc|\\uf44a\\uf3fd|\\uf44a\\uf3fe|\\uf44a\\uf3ff|\\uf91b\\uf3fb|\\uf91b\\uf3fc|\\uf91b\\uf3fd|\\uf91b\\uf3fe|\\uf91b\\uf3ff|\\uf91c\\uf3fb|\\uf91c\\uf3fc|\\uf91c\\uf3fd|\\uf91c\\uf3fe|\\uf91c\\uf3ff|\\uf91a\\uf3fb|\\uf91a\\uf3fc|\\uf91a\\uf3fd|\\uf91a\\uf3fe|\\uf91a\\uf3ff|\\uf44b\\uf3fb|\\uf44b\\uf3fc|\\uf44b\\uf3fd|\\uf44b\\uf3fe|\\uf44b\\uf3ff|\\uf91f\\uf3fb|\\uf91f\\uf3fc|\\uf91f\\uf3fd|\\uf91f\\uf3fe|\\uf91f\\uf3ff|\\u270d\\uf3fb|\\u270d\\uf3fc|\\u270d\\uf3fd|\\u270d\\uf3fe|\\u270d\\uf3ff|\\uf44f\\uf3fb|\\uf44f\\uf3fc|\\uf44f\\uf3fd|\\uf44f\\uf3fe|\\uf44f\\uf3ff|\\uf450\\uf3fb|\\uf450\\uf3fc|\\uf450\\uf3fd|\\uf450\\uf3fe|\\uf450\\uf3ff|\\uf64c\\uf3fb|\\uf64c\\uf3fc|\\uf64c\\uf3fd|\\uf64c\\uf3fe|\\uf64c\\uf3ff|\\uf932\\uf3fb|\\uf932\\uf3fc|\\uf932\\uf3fd|\\uf932\\uf3fe|\\uf932\\uf3ff|\\uf64f\\uf3fb|\\uf64f\\uf3fc|\\uf64f\\uf3fd|\\uf64f\\uf3fe|\\uf64f\\uf3ff|\\uf485\\uf3fb|\\uf485\\uf3fc|\\uf485\\uf3fd|\\uf485\\uf3fe|\\uf485\\uf3ff|\\uf442\\uf3fb|\\uf442\\uf3fc|\\uf442\\uf3fd|\\uf442\\uf3fe|\\uf442\\uf3ff|\\uf443\\uf3fb|\\uf443\\uf3fc|\\uf443\\uf3fd|\\uf443\\uf3fe|\\uf443\\uf3ff|\\uf1e6\\uf1e8|\\uf1e6\\uf1e9|\\uf1e6\\uf1ea|\\uf1e6\\uf1eb|\\uf1e6\\uf1ec|\\uf1e6\\uf1ee|\\uf1e6\\uf1f1|\\uf1e6\\uf1f2|\\uf1e6\\uf1f4|\\uf1e6\\uf1f6|\\uf1e6\\uf1f7|\\uf1e6\\uf1f8|\\uf1e6\\uf1f9|\\uf1e6\\uf1fa|\\uf1e6\\uf1fc|\\uf1e6\\uf1fd|\\uf1e6\\uf1ff|\\uf1e7\\uf1e6|\\uf1e7\\uf1e7|\\uf1e7\\uf1e9|\\uf1e7\\uf1ea|\\uf1e7\\uf1eb|\\uf1e7\\uf1ec|\\uf1e7\\uf1ed|\\uf1e7\\uf1ee|\\uf1e7\\uf1ef|\\uf1e7\\uf1f1|\\uf1e7\\uf1f2|\\uf1e7\\uf1f3|\\uf1e7\\uf1f4|\\uf1e7\\uf1f6|\\uf1e7\\uf1f7|\\uf1e7\\uf1f8|\\uf1e7\\uf1f9|\\uf1e7\\uf1fb|\\uf1e7\\uf1fc|\\uf1e7\\uf1fe|\\uf1e7\\uf1ff|\\uf1e8\\uf1e6|\\uf1e8\\uf1e8|\\uf1e8\\uf1e9|\\uf1e8\\uf1eb|\\uf1e8\\uf1ec|\\uf1e8\\uf1ed|\\uf1e8\\uf1ee|\\uf1e8\\uf1f0|\\uf1e8\\uf1f1|\\uf1e8\\uf1f2|\\uf1e8\\uf1f3|\\uf1e8\\uf1f4|\\uf1e8\\uf1f5|\\uf1e8\\uf1f7|\\uf1e8\\uf1fa|\\uf1e8\\uf1fb|\\uf1e8\\uf1fc|\\uf1e8\\uf1fd|\\uf1e8\\uf1fe|\\uf1e8\\uf1ff|\\uf1e9\\uf1ea|\\uf1e9\\uf1ec|\\uf1e9\\uf1ef|\\uf1e9\\uf1f0|\\uf1e9\\uf1f2|\\uf1e9\\uf1f4|\\uf1e9\\uf1ff|\\uf1ea\\uf1e6|\\uf1ea\\uf1e8|\\uf1ea\\uf1ea|\\uf1ea\\uf1ec|\\uf1ea\\uf1ed|\\uf1ea\\uf1f7|\\uf1ea\\uf1f8|\\uf1ea\\uf1f9|\\uf1ea\\uf1fa|\\uf1eb\\uf1ee|\\uf1eb\\uf1ef|\\uf1eb\\uf1f0|\\uf1eb\\uf1f2|\\uf1eb\\uf1f4|\\uf1eb\\uf1f7|\\uf1ec\\uf1e6|\\uf1ec\\uf1e7|\\uf1ec\\uf1e9|\\uf1ec\\uf1ea|\\uf1ec\\uf1eb|\\uf1ec\\uf1ec|\\uf1ec\\uf1ed|\\uf1ec\\uf1ee|\\uf1ec\\uf1f1|\\uf1ec\\uf1f2|\\uf1ec\\uf1f3|\\uf1ec\\uf1f5|\\uf1ec\\uf1f6|\\uf1ec\\uf1f7|\\uf1ec\\uf1f8|\\uf1ec\\uf1f9|\\uf1ec\\uf1fa|\\uf1ec\\uf1fc|\\uf1ec\\uf1fe|\\uf1ed\\uf1f0|\\uf1ed\\uf1f2|\\uf1ed\\uf1f3|\\uf1ed\\uf1f7|\\uf1ed\\uf1f9|\\uf1ed\\uf1fa|\\uf1ee\\uf1e8|\\uf1ee\\uf1e9|\\uf1ee\\uf1ea|\\uf1ee\\uf1f1|\\uf1ee\\uf1f2|\\uf1ee\\uf1f3|\\uf1ee\\uf1f4|\\uf1ee\\uf1f6|\\uf1ee\\uf1f7|\\uf1ee\\uf1f8|\\uf1ee\\uf1f9|\\uf1ef\\uf1ea|\\uf1ef\\uf1f2|\\uf1ef\\uf1f4|\\uf1ef\\uf1f5|\\uf1f0\\uf1ea|\\uf1f0\\uf1ec|\\uf1f0\\uf1ed|\\uf1f0\\uf1ee|\\uf1f0\\uf1f2|\\uf1f0\\uf1f3|\\uf1f0\\uf1f5|\\uf1f0\\uf1f7|\\uf1f0\\uf1fc|\\uf1f0\\uf1fe|\\uf1f0\\uf1ff|\\uf1f1\\uf1e6|\\uf1f1\\uf1e7|\\uf1f1\\uf1e8|\\uf1f1\\uf1ee|\\uf1f1\\uf1f0|\\uf1f1\\uf1f7|\\uf1f1\\uf1f8|\\uf1f1\\uf1f9|\\uf1f1\\uf1fa|\\uf1f1\\uf1fb|\\uf1f1\\uf1fe|\\uf1f2\\uf1e6|\\uf1f2\\uf1e8|\\uf1f2\\uf1e9|\\uf1f2\\uf1ea|\\uf1f2\\uf1eb|\\uf1f2\\uf1ec|\\uf1f2\\uf1ed|\\uf1f2\\uf1f0|\\uf1f2\\uf1f1|\\uf1f2\\uf1f2|\\uf1f2\\uf1f3|\\uf1f2\\uf1f4|\\uf1f2\\uf1f5|\\uf1f2\\uf1f6|\\uf1f2\\uf1f7|\\uf1f2\\uf1f8|\\uf1f2\\uf1f9|\\uf1f2\\uf1fa|\\uf1f2\\uf1fb|\\uf1f2\\uf1fc|\\uf1f2\\uf1fd|\\uf1f2\\uf1fe|\\uf1f2\\uf1ff|\\uf1f3\\uf1e6|\\uf1f3\\uf1e8|\\uf1f3\\uf1ea|\\uf1f3\\uf1eb|\\uf1f3\\uf1ec|\\uf1f3\\uf1ee|\\uf1f3\\uf1f1|\\uf1f3\\uf1f4|\\uf1f3\\uf1f5|\\uf1f3\\uf1f7|\\uf1f3\\uf1fa|\\uf1f3\\uf1ff|\\uf1f4\\uf1f2|\\uf1f5\\uf1e6|\\uf1f5\\uf1ea|\\uf1f5\\uf1eb|\\uf1f5\\uf1ec|\\uf1f5\\uf1ed|\\uf1f5\\uf1f0|\\uf1f5\\uf1f1|\\uf1f5\\uf1f2|\\uf1f5\\uf1f3|\\uf1f5\\uf1f7|\\uf1f5\\uf1f8|\\uf1f5\\uf1f9|\\uf1f5\\uf1fc|\\uf1f5\\uf1fe|\\uf1f6\\uf1e6|\\uf1f7\\uf1ea|\\uf1f7\\uf1f4|\\uf1f7\\uf1f8|\\uf1f7\\uf1fa|\\uf1f7\\uf1fc|\\uf1f8\\uf1e6|\\uf1f8\\uf1e7|\\uf1f8\\uf1e8|\\uf1f8\\uf1e9|\\uf1f8\\uf1ea|\\uf1f8\\uf1ec|\\uf1f8\\uf1ed|\\uf1f8\\uf1ee|\\uf1f8\\uf1ef|\\uf1f8\\uf1f0|\\uf1f8\\uf1f1|\\uf1f8\\uf1f2|\\uf1f8\\uf1f3|\\uf1f8\\uf1f4|\\uf1f8\\uf1f7|\\uf1f8\\uf1f8|\\uf1f8\\uf1f9|\\uf1f8\\uf1fb|\\uf1f8\\uf1fd|\\uf1f8\\uf1fe|\\uf1f8\\uf1ff|\\uf1f9\\uf1e6|\\uf1f9\\uf1e8|\\uf1f9\\uf1e9|\\uf1f9\\uf1eb|\\uf1f9\\uf1ec|\\uf1f9\\uf1ed|\\uf1f9\\uf1ef|\\uf1f9\\uf1f0|\\uf1f9\\uf1f1|\\uf1f9\\uf1f2|\\uf1f9\\uf1f3|\\uf1f9\\uf1f4|\\uf1f9\\uf1f7|\\uf1f9\\uf1f9|\\uf1f9\\uf1fb|\\uf1f9\\uf1fc|\\uf1f9\\uf1ff|\\uf1fa\\uf1e6|\\uf1fa\\uf1ec|\\uf1fa\\uf1f2|\\uf1fa\\uf1f3|\\uf1fa\\uf1f8|\\uf1fa\\uf1fe|\\uf1fa\\uf1ff|\\uf1fb\\uf1e6|\\uf1fb\\uf1e8|\\uf1fb\\uf1ea|\\uf1fb\\uf1ec|\\uf1fb\\uf1ee|\\uf1fb\\uf1f3|\\uf1fb\\uf1fa|\\uf1fc\\uf1eb|\\uf1fc\\uf1f8|\\uf1fd\\uf1f0|\\uf1fe\\uf1ea|\\uf1fe\\uf1f9|\\uf1ff\\uf1e6|\\uf1ff\\uf1f2|\\uf1ff\\uf1fc|\\uf600|\\uf601|\\uf602|\\uf923|\\uf603|\\uf604|\\uf605|\\uf606|\\uf609|\\uf60a|\\uf60b|\\uf60e|\\uf60d|\\uf618|\\uf617|\\uf619|\\uf61a|\\u263a|\\uf642|\\uf917|\\uf929|\\uf914|\\uf928|\\uf610|\\uf611|\\uf636|\\uf644|\\uf60f|\\uf623|\\uf625|\\uf62e|\\uf910|\\uf62f|\\uf62a|\\uf62b|\\uf634|\\uf60c|\\uf61b|\\uf61c|\\uf61d|\\uf924|\\uf612|\\uf613|\\uf614|\\uf615|\\uf643|\\uf911|\\uf632|\\u2639|\\uf641|\\uf616|\\uf61e|\\uf61f|\\uf624|\\uf622|\\uf62d|\\uf626|\\uf627|\\uf628|\\uf629|\\uf92f|\\uf62c|\\uf630|\\uf631|\\uf633|\\uf92a|\\uf635|\\uf621|\\uf620|\\uf92c|\\uf637|\\uf912|\\uf915|\\uf922|\\uf92e|\\uf927|\\uf607|\\uf920|\\uf921|\\uf925|\\uf92b|\\uf92d|\\uf9d0|\\uf913|\\uf608|\\uf47f|\\uf479|\\uf47a|\\uf480|\\u2620|\\uf47b|\\uf47d|\\uf47e|\\uf916|\\uf4a9|\\uf63a|\\uf638|\\uf639|\\uf63b|\\uf63c|\\uf63d|\\uf640|\\uf63f|\\uf63e|\\uf648|\\uf649|\\uf64a|\\uf476|\\uf9d2|\\uf466|\\uf467|\\uf9d1|\\uf468|\\uf469|\\uf9d3|\\uf474|\\uf475|\\uf46e|\\uf575|\\uf482|\\uf477|\\uf934|\\uf478|\\uf473|\\uf472|\\uf9d5|\\uf9d4|\\uf471|\\uf935|\\uf470|\\uf930|\\uf931|\\uf47c|\\uf385|\\uf936|\\uf9d9|\\uf9da|\\uf9db|\\uf9dc|\\uf9dd|\\uf9de|\\uf9df|\\uf64d|\\uf64e|\\uf645|\\uf646|\\uf481|\\uf64b|\\uf647|\\uf926|\\uf937|\\uf486|\\uf487|\\uf6b6|\\uf3c3|\\uf483|\\uf57a|\\uf46f|\\uf9d6|\\uf9d7|\\uf9d8|\\uf6c0|\\uf6cc|\\uf574|\\uf5e3|\\uf464|\\uf465|\\uf93a|\\uf3c7|\\u26f7|\\uf3c2|\\uf3cc|\\uf3c4|\\uf6a3|\\uf3ca|\\u26f9|\\uf3cb|\\uf6b4|\\uf6b5|\\uf3ce|\\uf3cd|\\uf938|\\uf93c|\\uf93d|\\uf93e|\\uf939|\\uf46b|\\uf46c|\\uf46d|\\uf48f|\\uf491|\\uf46a|\\uf933|\\uf4aa|\\uf448|\\uf449|\\u261d|\\uf446|\\uf595|\\uf447|\\u270c|\\uf91e|\\uf596|\\uf918|\\uf919|\\uf590|\\u270b|\\uf44c|\\uf44d|\\uf44e|\\u270a|\\uf44a|\\uf91b|\\uf91c|\\uf91a|\\uf44b|\\uf91f|\\u270d|\\uf44f|\\uf450|\\uf64c|\\uf932|\\uf64f|\\uf91d|\\uf485|\\uf442|\\uf443|\\uf463|\\uf440|\\uf441|\\uf9e0|\\uf445|\\uf444|\\uf48b|\\uf498|\\u2764|\\uf493|\\uf494|\\uf495|\\uf496|\\uf497|\\uf499|\\uf49a|\\uf49b|\\uf9e1|\\uf49c|\\uf5a4|\\uf49d|\\uf49e|\\uf49f|\\u2763|\\uf48c|\\uf4a4|\\uf4a2|\\uf4a3|\\uf4a5|\\uf4a6|\\uf4a8|\\uf4ab|\\uf4ac|\\uf5e8|\\uf5ef|\\uf4ad|\\uf573|\\uf453|\\uf576|\\uf454|\\uf455|\\uf456|\\uf9e3|\\uf9e4|\\uf9e5|\\uf9e6|\\uf457|\\uf458|\\uf459|\\uf45a|\\uf45b|\\uf45c|\\uf45d|\\uf6cd|\\uf392|\\uf45e|\\uf45f|\\uf460|\\uf461|\\uf462|\\uf451|\\uf452|\\uf3a9|\\uf393|\\uf9e2|\\u26d1|\\uf4ff|\\uf484|\\uf48d|\\uf48e|\\uf435|\\uf412|\\uf98d|\\uf436|\\uf415|\\uf429|\\uf43a|\\uf98a|\\uf431|\\uf408|\\uf981|\\uf42f|\\uf405|\\uf406|\\uf434|\\uf40e|\\uf984|\\uf993|\\uf98c|\\uf42e|\\uf402|\\uf403|\\uf404|\\uf437|\\uf416|\\uf417|\\uf43d|\\uf40f|\\uf411|\\uf410|\\uf42a|\\uf42b|\\uf992|\\uf418|\\uf98f|\\uf42d|\\uf401|\\uf400|\\uf439|\\uf430|\\uf407|\\uf43f|\\uf994|\\uf987|\\uf43b|\\uf428|\\uf43c|\\uf43e|\\uf983|\\uf414|\\uf413|\\uf423|\\uf424|\\uf425|\\uf426|\\uf427|\\uf54a|\\uf985|\\uf986|\\uf989|\\uf438|\\uf40a|\\uf422|\\uf98e|\\uf40d|\\uf432|\\uf409|\\uf995|\\uf996|\\uf433|\\uf40b|\\uf42c|\\uf41f|\\uf420|\\uf421|\\uf988|\\uf419|\\uf41a|\\uf980|\\uf990|\\uf991|\\uf40c|\\uf98b|\\uf41b|\\uf41c|\\uf41d|\\uf41e|\\uf997|\\uf577|\\uf578|\\uf982|\\uf490|\\uf338|\\uf4ae|\\uf3f5|\\uf339|\\uf940|\\uf33a|\\uf33b|\\uf33c|\\uf337|\\uf331|\\uf332|\\uf333|\\uf334|\\uf335|\\uf33e|\\uf33f|\\u2618|\\uf340|\\uf341|\\uf342|\\uf343|\\uf347|\\uf348|\\uf349|\\uf34a|\\uf34b|\\uf34c|\\uf34d|\\uf34e|\\uf34f|\\uf350|\\uf351|\\uf352|\\uf353|\\uf95d|\\uf345|\\uf965|\\uf951|\\uf346|\\uf954|\\uf955|\\uf33d|\\uf336|\\uf952|\\uf966|\\uf344|\\uf95c|\\uf330|\\uf35e|\\uf950|\\uf956|\\uf968|\\uf95e|\\uf9c0|\\uf356|\\uf357|\\uf969|\\uf953|\\uf354|\\uf35f|\\uf355|\\uf32d|\\uf96a|\\uf32e|\\uf32f|\\uf959|\\uf95a|\\uf373|\\uf958|\\uf372|\\uf963|\\uf957|\\uf37f|\\uf96b|\\uf371|\\uf358|\\uf359|\\uf35a|\\uf35b|\\uf35c|\\uf35d|\\uf360|\\uf362|\\uf363|\\uf364|\\uf365|\\uf361|\\uf95f|\\uf960|\\uf961|\\uf366|\\uf367|\\uf368|\\uf369|\\uf36a|\\uf382|\\uf370|\\uf967|\\uf36b|\\uf36c|\\uf36d|\\uf36e|\\uf36f|\\uf37c|\\uf95b|\\u2615|\\uf375|\\uf376|\\uf37e|\\uf377|\\uf378|\\uf379|\\uf37a|\\uf37b|\\uf942|\\uf943|\\uf964|\\uf962|\\uf37d|\\uf374|\\uf944|\\uf52a|\\uf3fa|\\uf30d|\\uf30e|\\uf30f|\\uf310|\\uf5fa|\\uf5fe|\\uf3d4|\\u26f0|\\uf30b|\\uf5fb|\\uf3d5|\\uf3d6|\\uf3dc|\\uf3dd|\\uf3de|\\uf3df|\\uf3db|\\uf3d7|\\uf3d8|\\uf3d9|\\uf3da|\\uf3e0|\\uf3e1|\\uf3e2|\\uf3e3|\\uf3e4|\\uf3e5|\\uf3e6|\\uf3e8|\\uf3e9|\\uf3ea|\\uf3eb|\\uf3ec|\\uf3ed|\\uf3ef|\\uf3f0|\\uf492|\\uf5fc|\\uf5fd|\\u26ea|\\uf54c|\\uf54d|\\u26e9|\\uf54b|\\u26f2|\\u26fa|\\uf301|\\uf303|\\uf304|\\uf305|\\uf306|\\uf307|\\uf309|\\u2668|\\uf30c|\\uf3a0|\\uf3a1|\\uf3a2|\\uf488|\\uf3aa|\\uf3ad|\\uf5bc|\\uf3a8|\\uf3b0|\\uf682|\\uf683|\\uf684|\\uf685|\\uf686|\\uf687|\\uf688|\\uf689|\\uf68a|\\uf69d|\\uf69e|\\uf68b|\\uf68c|\\uf68d|\\uf68e|\\uf690|\\uf691|\\uf692|\\uf693|\\uf694|\\uf695|\\uf696|\\uf697|\\uf698|\\uf699|\\uf69a|\\uf69b|\\uf69c|\\uf6b2|\\uf6f4|\\uf6f5|\\uf68f|\\uf6e3|\\uf6e4|\\u26fd|\\uf6a8|\\uf6a5|\\uf6a6|\\uf6a7|\\uf6d1|\\u2693|\\u26f5|\\uf6f6|\\uf6a4|\\uf6f3|\\u26f4|\\uf6e5|\\uf6a2|\\u2708|\\uf6e9|\\uf6eb|\\uf6ec|\\uf4ba|\\uf681|\\uf69f|\\uf6a0|\\uf6a1|\\uf6f0|\\uf680|\\uf6f8|\\uf6ce|\\uf6aa|\\uf6cf|\\uf6cb|\\uf6bd|\\uf6bf|\\uf6c1|\\u231b|\\u23f3|\\u231a|\\u23f0|\\u23f1|\\u23f2|\\uf570|\\uf55b|\\uf567|\\uf550|\\uf55c|\\uf551|\\uf55d|\\uf552|\\uf55e|\\uf553|\\uf55f|\\uf554|\\uf560|\\uf555|\\uf561|\\uf556|\\uf562|\\uf557|\\uf563|\\uf558|\\uf564|\\uf559|\\uf565|\\uf55a|\\uf566|\\uf311|\\uf312|\\uf313|\\uf314|\\uf315|\\uf316|\\uf317|\\uf318|\\uf319|\\uf31a|\\uf31b|\\uf31c|\\uf321|\\u2600|\\uf31d|\\uf31e|\\u2b50|\\uf31f|\\uf320|\\u2601|\\u26c5|\\u26c8|\\uf324|\\uf325|\\uf326|\\uf327|\\uf328|\\uf329|\\uf32a|\\uf32b|\\uf32c|\\uf300|\\uf308|\\uf302|\\u2602|\\u2614|\\u26f1|\\u26a1|\\u2744|\\u2603|\\u26c4|\\u2604|\\uf525|\\uf4a7|\\uf30a|\\uf383|\\uf384|\\uf386|\\uf387|\\u2728|\\uf388|\\uf389|\\uf38a|\\uf38b|\\uf38d|\\uf38e|\\uf38f|\\uf390|\\uf391|\\uf380|\\uf381|\\uf397|\\uf39f|\\uf3ab|\\uf396|\\uf3c6|\\uf3c5|\\uf947|\\uf948|\\uf949|\\u26bd|\\u26be|\\uf3c0|\\uf3d0|\\uf3c8|\\uf3c9|\\uf3be|\\uf3b1|\\uf3b3|\\uf3cf|\\uf3d1|\\uf3d2|\\uf3d3|\\uf3f8|\\uf94a|\\uf94b|\\uf945|\\uf3af|\\u26f3|\\u26f8|\\uf3a3|\\uf3bd|\\uf3bf|\\uf6f7|\\uf94c|\\uf3ae|\\uf579|\\uf3b2|\\u2660|\\u2665|\\u2666|\\u2663|\\uf0cf|\\uf004|\\uf3b4|\\uf507|\\uf508|\\uf509|\\uf50a|\\uf4e2|\\uf4e3|\\uf4ef|\\uf514|\\uf515|\\uf3bc|\\uf3b5|\\uf3b6|\\uf399|\\uf39a|\\uf39b|\\uf3a4|\\uf3a7|\\uf4fb|\\uf3b7|\\uf3b8|\\uf3b9|\\uf3ba|\\uf3bb|\\uf941|\\uf4f1|\\uf4f2|\\u260e|\\uf4de|\\uf4df|\\uf4e0|\\uf50b|\\uf50c|\\uf4bb|\\uf5a5|\\uf5a8|\\u2328|\\uf5b1|\\uf5b2|\\uf4bd|\\uf4be|\\uf4bf|\\uf4c0|\\uf3a5|\\uf39e|\\uf4fd|\\uf3ac|\\uf4fa|\\uf4f7|\\uf4f8|\\uf4f9|\\uf4fc|\\uf50d|\\uf50e|\\uf52c|\\uf52d|\\uf4e1|\\uf56f|\\uf4a1|\\uf526|\\uf3ee|\\uf4d4|\\uf4d5|\\uf4d6|\\uf4d7|\\uf4d8|\\uf4d9|\\uf4da|\\uf4d3|\\uf4d2|\\uf4c3|\\uf4dc|\\uf4c4|\\uf4f0|\\uf5de|\\uf4d1|\\uf516|\\uf3f7|\\uf4b0|\\uf4b4|\\uf4b5|\\uf4b6|\\uf4b7|\\uf4b8|\\uf4b3|\\uf4b9|\\uf4b1|\\uf4b2|\\u2709|\\uf4e7|\\uf4e8|\\uf4e9|\\uf4e4|\\uf4e5|\\uf4e6|\\uf4eb|\\uf4ea|\\uf4ec|\\uf4ed|\\uf4ee|\\uf5f3|\\u270f|\\u2712|\\uf58b|\\uf58a|\\uf58c|\\uf58d|\\uf4dd|\\uf4bc|\\uf4c1|\\uf4c2|\\uf5c2|\\uf4c5|\\uf4c6|\\uf5d2|\\uf5d3|\\uf4c7|\\uf4c8|\\uf4c9|\\uf4ca|\\uf4cb|\\uf4cc|\\uf4cd|\\uf4ce|\\uf587|\\uf4cf|\\uf4d0|\\u2702|\\uf5c3|\\uf5c4|\\uf5d1|\\uf512|\\uf513|\\uf50f|\\uf510|\\uf511|\\uf5dd|\\uf528|\\u26cf|\\u2692|\\uf6e0|\\uf5e1|\\u2694|\\uf52b|\\uf3f9|\\uf6e1|\\uf527|\\uf529|\\u2699|\\uf5dc|\\u2697|\\u2696|\\uf517|\\u26d3|\\uf489|\\uf48a|\\uf6ac|\\u26b0|\\u26b1|\\uf5ff|\\uf6e2|\\uf52e|\\uf6d2|\\uf3e7|\\uf6ae|\\uf6b0|\\u267f|\\uf6b9|\\uf6ba|\\uf6bb|\\uf6bc|\\uf6be|\\uf6c2|\\uf6c3|\\uf6c4|\\uf6c5|\\u26a0|\\uf6b8|\\u26d4|\\uf6ab|\\uf6b3|\\uf6ad|\\uf6af|\\uf6b1|\\uf6b7|\\uf4f5|\\uf51e|\\u2622|\\u2623|\\u2b06|\\u2197|\\u27a1|\\u2198|\\u2b07|\\u2199|\\u2b05|\\u2196|\\u2195|\\u2194|\\u21a9|\\u21aa|\\u2934|\\u2935|\\uf503|\\uf504|\\uf519|\\uf51a|\\uf51b|\\uf51c|\\uf51d|\\uf6d0|\\u269b|\\uf549|\\u2721|\\u2638|\\u262f|\\u271d|\\u2626|\\u262a|\\u262e|\\uf54e|\\uf52f|\\u2648|\\u2649|\\u264a|\\u264b|\\u264c|\\u264d|\\u264e|\\u264f|\\u2650|\\u2651|\\u2652|\\u2653|\\u26ce|\\uf500|\\uf501|\\uf502|\\u25b6|\\u23e9|\\u23ed|\\u23ef|\\u25c0|\\u23ea|\\u23ee|\\uf53c|\\u23eb|\\uf53d|\\u23ec|\\u23f8|\\u23f9|\\u23fa|\\u23cf|\\uf3a6|\\uf505|\\uf506|\\uf4f6|\\uf4f3|\\uf4f4|\\u2640|\\u2642|\\u2695|\\u267b|\\u269c|\\uf531|\\uf4db|\\uf530|\\u2b55|\\u2705|\\u2611|\\u2714|\\u2716|\\u274c|\\u274e|\\u2795|\\u2796|\\u2797|\\u27b0|\\u27bf|\\u303d|\\u2733|\\u2734|\\u2747|\\u203c|\\u2049|\\u2753|\\u2754|\\u2755|\\u2757|\\u3030|\\u00a9|\\u00ae|\\u2122|\\uf51f|\\uf4af|\\uf520|\\uf521|\\uf522|\\uf523|\\uf524|\\uf170|\\uf18e|\\uf171|\\uf191|\\uf192|\\uf193|\\u2139|\\uf194|\\u24c2|\\uf195|\\uf196|\\uf17e|\\uf197|\\uf17f|\\uf198|\\uf199|\\uf19a|\\uf201|\\uf202|\\uf237|\\uf236|\\uf22f|\\uf250|\\uf239|\\uf21a|\\uf232|\\uf251|\\uf238|\\uf234|\\uf233|\\u3297|\\u3299|\\uf23a|\\uf235|\\u25aa|\\u25ab|\\u25fb|\\u25fc|\\u25fd|\\u25fe|\\u2b1b|\\u2b1c|\\uf536|\\uf537|\\uf538|\\uf539|\\uf53a|\\uf53b|\\uf4a0|\\uf518|\\uf532|\\uf533|\\u26aa|\\u26ab|\\uf534|\\uf535|\\uf3c1|\\uf6a9|\\uf38c|\\uf3f4|\\uf3f3/g;\n\n    var EmojiReg;\n\n    var EmojiList = [];\n\n    var isIE8 = document.all && !document.addEventListener;\n\n    // emoji 详情, 扩展时往后叠加\n    var EmojiFactory = {\n        \"u1F603\": { \"en\": \"Smiley Face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F600\": { \"en\": \"Grinning Face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F60A\": { \"en\": \"Smiley\", \"zh\": \"微笑\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u263A\": { \"en\": \"Cute\", \"zh\": \"萌萌哒\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F609\": { \"en\": \"Winking Face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F60D\": { \"en\": \"Heart Eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F618\": { \"en\": \"Blowing Kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F61A\": { \"en\": \"Kiss Face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"Crazy Face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"Tongue Out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F633\": { \"en\": \"Flushed Face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F601\": { \"en\": \"Grinning With Smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F614\": { \"en\": \"Pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F60C\": { \"en\": \"Pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F612\": { \"en\": \"Dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F61F\": { \"en\": \"Worried Face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F61E\": { \"en\": \"Disappointed Face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F623\": { \"en\": \"Helpless Face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F62D\": { \"en\": \"Crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-425px 0px\" },\n        \"u1F602\": { \"en\": \"Laughing Tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F622\": { \"en\": \"Sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-2075px 0px\" },\n        \"u1F62A\": { \"en\": \"Sleepy Face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F630\": { \"en\": \"Cold Sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F605\": { \"en\": \"Happy Sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F613\": { \"en\": \"Sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F62B\": { \"en\": \"Tired Face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F629\": { \"en\": \"Weary Face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F628\": { \"en\": \"Fearful Face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F631\": { \"en\": \"Scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F621\": { \"en\": \"Angry Face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F624\": { \"en\": \"Mad Face\", \"zh\": \"怒气冲冲\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F616\": { \"en\": \"Confounded Face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F606\": { \"en\": \"Big Grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F60B\": { \"en\": \"Hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F637\": { \"en\": \"Mask Face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F60E\": { \"en\": \"Sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F634\": { \"en\": \"Sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"Dizzy Face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F632\": { \"en\": \"Shocked Face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F608\": { \"en\": \"Purple Devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F47F\": { \"en\": \"Devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F62F\": { \"en\": \"Surprised Face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F62C\": { \"en\": \"Grimacing Face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F615\": { \"en\": \"Confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F636\": { \"en\": \"Mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F607\": { \"en\": \"Halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F60F\": { \"en\": \"Smirking Face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F611\": { \"en\": \"Expressionless Face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F648\": { \"en\": \"See No Monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"Hear No Monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F64A\": { \"en\": \"No Speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F47D\": { \"en\": \"Alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F4A9\": { \"en\": \"Pile Of Poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F494\": { \"en\": \"Broken Heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"Fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F4A2\": { \"en\": \"Anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A4\": { \"en\": \"Zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F6AB\": { \"en\": \"Prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u2B50\": { \"en\": \"Star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u26A1\": { \"en\": \"Lightning Bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u1F319\": { \"en\": \"Drescent Moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u2600\": { \"en\": \"Sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u26C5\": { \"en\": \"Cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u2601\": { \"en\": \"Cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2744\": { \"en\": \"Snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" },\n        \"u2614\": { \"en\": \"Umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u26C4\": { \"en\": \"Snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u1F44D\": { \"en\": \"Thumbs Up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"Thumbs Down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F91D\": { \"en\": \"Handshake\", \"zh\": \"握手\", \"tag\": \"\\uD83E\\uDD1D\", \"position\": \"-3200px 0px\" },\n        \"u1F44C\": { \"en\": \"Ok Hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44A\": { \"en\": \"Raised Fist\", \"zh\": \"举起拳头\", \"tag\": \"\\u270A\", \"position\": \"-2975px 0px\" },\n        \"u270A\": { \"en\": \"Oncoming Fist\", \"zh\": \"击拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-1350px 0px\" },\n        \"u270C\": { \"en\": \"Victory Hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270B\": { \"en\": \"Raised Hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u1F64F\": { \"en\": \"Folded Hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u261D\": { \"en\": \"Pointing Up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u1F44F\": { \"en\": \"Clapping Hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F4AA\": { \"en\": \"Flexed Biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F46A\": { \"en\": \"Family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"Couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F47C\": { \"en\": \"Baby Angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F434\": { \"en\": \"Horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"Dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"Pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F47B\": { \"en\": \"Ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F339\": { \"en\": \"Rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F33B\": { \"en\": \"Sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F332\": { \"en\": \"Pine Tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F384\": { \"en\": \"Christmas Tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F381\": { \"en\": \"Wrapped Gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F389\": { \"en\": \"Party Popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F4B0\": { \"en\": \"Money Bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F382\": { \"en\": \"Birthday Cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F356\": { \"en\": \"Barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F35A\": { \"en\": \"Cooked Rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F366\": { \"en\": \"Ice Cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F36B\": { \"en\": \"Chocolate Bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F349\": { \"en\": \"Watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F377\": { \"en\": \"Wine Glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F37B\": { \"en\": \"Cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u2615\": { \"en\": \"Coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u1F3C0\": { \"en\": \"Basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u26BD\": { \"en\": \"Soccer Ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u1F3C2\": { \"en\": \"Snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3A4\": { \"en\": \"Microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B5\": { \"en\": \"Musical Note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3B2\": { \"en\": \"Game Die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F004\": { \"en\": \"Mahjong Red Dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F451\": { \"en\": \"Crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"Lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F48B\": { \"en\": \"Kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"Ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F4DA\": { \"en\": \"Books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F393\": { \"en\": \"Graduation Cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u270F\": { \"en\": \"Pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u1F3E1\": { \"en\": \"House With Garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F6BF\": { \"en\": \"Shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F4A1\": { \"en\": \"Light Bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4DE\": { \"en\": \"Telephone Receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"Loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F556\": { \"en\": \"Clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u23F0\": { \"en\": \"Alarm Clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"Hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u1F4A3\": { \"en\": \"Bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F52B\": { \"en\": \"Pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F48A\": { \"en\": \"Capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F680\": { \"en\": \"Rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u1F30F\": { \"en\": \"Globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" }\n    };\n\n    var Config = {\n        url: getOnlineImagePath(),\n        size: DefaultSize,\n        lang: DefaultLang,\n        reg: UnicodeReg\n    };\n\n    var Utils = {\n        extend: function() {\n            if (arguments.length === 0) {\n                return;\n            }\n            var obj = arguments[0];\n            for (var i = 1, len = arguments.length; i < len; i ++) {\n                var other = arguments[i];\n                for (var item in other) {\n                    obj[item] = other[item];\n                }\n            }\n            return obj;\n        },\n        filter: function(arr, func) {\n            var array = [];\n            for (var i = 0; i < arr.length; i++) {\n                var value = arr[i];\n                if (func(value)) {\n                    array.push(value);\n                }\n            }\n            return array;\n        },\n        cutString: function(string, start, length) {\n            var array = [];\n            for (var i = start; i < start + length; i++) {\n                array.push(string.charAt(i));\n            }\n            return array.join('');\n        },\n        map: function(arr, func) {\n            var tempArr = arr.concat([]);\n            for (var i = 0; i < tempArr.length; i++) {\n                var value = tempArr[i];\n                if (func && typeof func === \"function\") {\n                    tempArr[i] = func(value);\n                }\n            }\n            return tempArr;\n        },\n        indexOf: function(array, value) {\n            if (typeof array === \"string\") {\n                for (var i = 0; i <= array.length - value.length; i++) {\n                    var string = Utils.cutString(array, i, value.length);\n                    if (array.charAt(i) == value.charAt(0) && Utils.cutString(array, i, value.length) == value) {\n                        return i;\n                    }\n                }\n            } else if (Object.prototype.toString.call(array) === '[object Array]') {\n                for (var i = 0; i < array.length; i++) {\n                    var item = array[i];\n                    if (item == value) {\n                        return i;\n                    }\n                }\n            }\n            return -1;\n        },\n        getDom: function(html) {\n            var div = document.createElement(\"div\");\n            div.innerHTML = html;\n            return div.childNodes[0];\n        },\n        render: function(temp, params) {\n            return temp.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n                return params[name] != undefined ? params[name] : match;\n            });\n        }\n    };\n\n    var CheckParam = {\n        getType: function(str) {\n            /* IE下不准确问题 */\n            if (str === undefined) {\n                return \"undefined\";\n            }\n            if (str === null) {\n                return \"null\";\n            }\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        },\n        check: function(typeList, funcName, params) {\n            params = params || [];\n            var maxCount = typeList.length;\n            if (params.length > maxCount) {\n                params.length = maxCount;\n            }\n            for (var i = 0; i < typeList.length; i++) {\n                var paramType = this.getType(params[i]);\n                var sucType = typeList[i];\n                if (!new RegExp(paramType).test(sucType)) {\n                    var msgTemp = \"第{{index}}个参数错误, 传入参数类型为: {{errType}}, 应传参数类型为: {{sucType}}, 错误所在位置为: {{funcName}}\";\n                    var msg = Utils.render(msgTemp, {\n                        index: i + 1,\n                        errType: paramType,\n                        sucType: sucType,\n                        funcName: funcName\n                    });\n                    console.error(msg);\n                }\n            }\n        }\n    };\n\n    var init = function(option) {\n        addBaseCss();\n        option = option || {};\n        Config = Utils.extend(Config, option);\n        extendEmojis(option.extension);\n        setEmojiReg();\n        setEmojiList();\n        adaptOldVersion();\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg     可选，匹配的正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后的字符串\n     */\n    var emojiToSymbol = function(content, reg, func) {\n        CheckParam.check(['string', 'regexp|null|undefined'], 'emojiToSymbol', arguments);\n        content = unicodeToEmoji(content, reg);\n        return content.replace(EmojiReg, function(tag) {\n            var lang = Config.lang;\n            var detail = getDetail('tag', tag);\n            var symbol = detail ? '[' + detail[lang] + ']' : tag;\n            return func ? func(symbol) : symbol;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} text 必填 包含symbol的字符串\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}\n     */\n    var symbolToEmoji = function(text, func) {\n        CheckParam.check(['string'], 'symbolToEmoji', arguments);\n        text = unicodeToEmoji(text);\n        var emojiText = text.replace(/\\[([^\\[\\]]+?)\\]/g, function(symbol) {\n            symbol = symbol.substr(1, symbol.length - 2);\n            var lang = Config.lang;\n            var detail = getDetail(lang, symbol);\n            return detail ? detail.tag : '[' + symbol + ']';\n        });\n        return emojiText.replace(EmojiReg, function(tag) {\n            return func ? func(tag) : tag;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} content 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx     可选，html标签的大小\n     * @param  {string} reg     可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {string}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(content, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"emojiToHTML\", arguments);\n        content = unicodeToEmoji(content, reg);\n        var htmlContent = content.replace(EmojiReg, function(tag) {\n            var html = getHTMLByEmoji(tag, sizePx);\n            return html || tag;\n        });\n        return htmlContent.replace(EmojiReg, function(tag) {\n            return func ? func(tag) : tag;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} text 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @param  {func} function  可选，emoji的显示方式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(text, sizePx, reg, func) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"symbolToHTML\", arguments);\n        var emojiText = text.replace(/\\[([^\\[\\]]+?)\\]/g, function(symbol) {\n            var text = symbolToEmoji(symbol);\n            return emojiToHTML(text, sizePx, reg);\n        });\n        return emojiText.replace(EmojiReg, function(tag) {\n            return func ? func(tag) : tag;\n        });\n    };\n\n    function getDetail(key, value) {\n        for (var unicode in EmojiFactory) {\n            var detail = EmojiFactory[unicode];\n            if (detail[key] === value) {\n                return detail;\n            }\n        }\n    }\n\n    function getHTMLByEmoji(emoji, sizePx) {\n        for (var key in EmojiFactory) {\n            var detail = EmojiFactory[key];\n            if (detail.tag === emoji) {\n                return getEmojiHTML(detail, sizePx);\n            }\n        }\n        return false;\n    }\n\n    function getEmojiHTML(item, sizePx) {\n        var size = sizePx || Config.size;\n        var position = getBgPosition(item.position, size);\n        if (isIE8) {\n            position = item.position;\n            size = Config.size;\n        }\n        var emojiObj = {\n            size: size,\n            position: position,\n            background: item.background || Config.url,\n            name: item[Config.lang],\n            tag: item.tag\n        };\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px; overflow: hidden; vertical-align: middle; font-size: 0 !important;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='{{style}}'></span>\"\n        spanTpl = Utils.render(spanTpl, { style: style });\n        return Utils.render(spanTpl, emojiObj);\n    }\n\n    function getBgPosition(position, sizePx) {\n        var size = sizePx || Config.size;\n        var baseSize = isIE8 ? 24 : 25;\n        var scale = size / baseSize;\n        position = position.split(\" \");\n        var x = position[0], y = position[1];\n        x = x ? x.split(\"px\")[0] : 0;\n        y = y ? y.split(\"px\")[0] : 0;\n        var positionTpl = '{{x}}px {{y}}px';\n        return Utils.render(positionTpl, {\n            x: parseInt(x) * scale,\n            y: parseInt(y) * scale\n        });\n    }\n\n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围\n     * @return {string}          转化后的字符串\n     */\n    function unicodeToEmoji(content, reg) {\n        reg = reg || Config.reg;\n        return content.replace(reg, function(unicode) {\n            return calculateUTF(unicode);\n        });\n    }\n\n    function calculateUTF(char) {\n        var unicodes = escape(char).split('%u');\n        unicodes = Utils.filter(unicodes, function(code) {\n            return code !== '';\n        });\n        unicodes = Utils.map(unicodes, function(code) {\n            var startWithF = Utils.indexOf(code, 'f') === 0 || Utils.indexOf(code, 'F') === 0;\n            var isFE0F = code === 'FE0F' || code === 'fe0f';\n            if (startWithF && !isFE0F) {\n                return '0x1' + code;\n            }\n            return '0x' + code;\n        });\n        return String.RongFromCodePoint(unicodes);\n    }\n\n    function extendEmojis(extension) {\n        CheckParam.check(['object|undefined'], 'init', arguments);\n        if (!extension) {\n            return;\n        }\n        var dataSource = extension.dataSource;\n        var url = extension.url || Config.url;\n        for (var key in dataSource) {\n            var detail = dataSource[key];\n            EmojiFactory[key] = detail;\n            EmojiFactory[key].background = url;\n        }\n    }\n\n    function setEmojiList() {\n        EmojiList.length = 0;\n        for (var unicode in EmojiFactory) {\n            var detail = EmojiFactory[unicode];\n            if (detail.tag) {\n                var lang = Config.lang;\n                var html = getHTMLByEmoji(detail.tag);\n                var node = Utils.getDom(html);\n                var symbol = detail[lang];\n                EmojiList.push({\n                    unicode: unicode,\n                    symbol: '[' + symbol + ']',\n                    emoji: detail.tag,\n                    node: node\n                });\n            }\n        }\n    }\n\n    function setEmojiReg() {\n        var reg = [];\n        for (var key in EmojiFactory) {\n            var detail = EmojiFactory[key];\n            reg.push(detail.tag);\n        }\n        reg = reg.join('|');\n        EmojiReg = new RegExp(reg, 'g');\n    }\n\n    function getOnlineImagePath() {\n        var getPath = function(path) {\n            var protocol = document.location.protocol;\n            var isFileProtocol = protocol === 'file:';\n            return isFileProtocol ? 'http:' + path : path;\n        };\n        var normalImgPath = getPath(NornalImagePath);\n        var hdImgPath = getPath(HdImagePath);\n        return isIE8 ? normalImgPath : hdImgPath;\n    }\n\n    function isSupportEmoji() {\n        var getTextFeature = function(text, color) {\n            try {\n                var canvas = document.createElement(\"canvas\");\n                canvas.width = 20;\n                canvas.height = 20;\n                var ctx = canvas.getContext(\"2d\");\n                ctx.textBaseline = \"top\";\n                ctx.font = \"20px sans-serif\";\n                ctx.fillStyle = color;\n                ctx.fillText(text, 0, 0);\n                var imageData = ctx.getImageData(0, 0, 20, 20).data;\n                var imageDataArr = [];\n                for (var i = 0; i < imageData.length; i++) {\n                    imageDataArr[i] = imageData[i];\n                }\n                var totalColor = 0;\n                for (var i = 0; i < imageDataArr.length; i++) {\n                    totalColor += imageDataArr[i];\n                }\n                var hasColor = totalColor > 0;\n                return hasColor ? imageDataArr.toString() : false;\n            } catch (e) {\n                return false;\n            }\n        };\n        var testEmoji = \"😁\";\n        var mode = getTextFeature(testEmoji, \"#000\");\n        if (mode) {\n            var otherEmoji = \"😨\";\n            var colorFeatrue = getTextFeature(testEmoji, \"#FFF\");\n            var otherFeature = getTextFeature(otherEmoji, \"#000\");\n            //为相同emoji添加不同色, 判断两次上色是否相同, 如果相同, 说明emoji以图片渲染, 支持\n            var isSameColor = mode && mode === colorFeatrue;\n            //为不同emoji添加相同色, 判断两次上色是否不同, 如果不同, 说明emoji以字符渲染, 支持\n            var isDiffColor = mode && mode !== otherFeature;\n            return isSameColor || isDiffColor;\n        } else {\n            return false;\n        }\n    }\n\n    function addBaseCss() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden;}\";\n        var style = document.createElement(\"style\");\n        style.setAttribute(\"type\", \"text/css\");\n        var head = document.getElementsByTagName('head')[0];\n        head.appendChild(style);\n        if (style.styleSheet) {\n            style.styleSheet.cssText = baseCss;\n        } else {\n            head = document.createTextNode(baseCss);\n            style.appendChild(head);\n        }\n    }\n\n    /*! http://mths.be/fromcodepoint v0.1.0 by @mathias,   fromCodePoint兼容 */\n      (function() {\n        var defineProperty = (function() {\n          // IE 8 only supports `Object.defineProperty` on DOM elements\n          try {\n            var object = {};\n            var $defineProperty = Object.defineProperty;\n            var result = $defineProperty(object, object, object) && $defineProperty;\n          } catch(error) {}\n          return result;\n        }());\n        var stringFromCharCode = String.fromCharCode;\n        var floor = Math.floor;\n        var RongFromCodePoint = function(codeList) {\n          var MAX_SIZE = 0x4000;\n          var codeUnits = [];\n          var highSurrogate;\n          var lowSurrogate;\n          var index = -1;\n          var length = codeList.length || [];\n          if (!length) {\n            return '';\n          }\n          var result = '';\n          while (++index < length) {\n            var codePoint = Number(codeList[index]);\n            if (\n              !isFinite(codePoint) ||       // `NaN`, `+Infinity`, or `-Infinity`\n              codePoint < 0 ||              // not a valid Unicode code point\n              codePoint > 0x10FFFF ||       // not a valid Unicode code point\n              floor(codePoint) != codePoint // not an integer\n            ) {\n              throw RangeError('Invalid code point: ' + codePoint);\n            }\n            if (codePoint <= 0xFFFF) { // BMP code point\n              codeUnits.push(codePoint);\n            } else { // Astral code point; split in surrogate halves\n              // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n              codePoint -= 0x10000;\n              highSurrogate = (codePoint >> 10) + 0xD800;\n              lowSurrogate = (codePoint % 0x400) + 0xDC00;\n              codeUnits.push(highSurrogate, lowSurrogate);\n            }\n            if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n              result += stringFromCharCode.apply(null, codeUnits);\n              codeUnits.length = 0;\n            }\n          }\n          return result;\n        };\n        if (defineProperty) {\n          defineProperty(String, 'RongFromCodePoint', {\n            'value': RongFromCodePoint,\n            'configurable': true,\n            'writable': true\n          });\n        } else {\n          String.RongFromCodePoint = RongFromCodePoint;\n        }\n      }());\n\n    function adaptOldVersion() {\n        _export.emojis = Utils.map(EmojiList, function(item) {\n            var unicode = item.unicode;\n            var emojiDetail = EmojiFactory[unicode];\n            var zh = emojiDetail.zh;\n            var en = emojiDetail.en;\n            var position = emojiDetail.position;\n            en = en.replace(' ', '_').toLowerCase();\n            var oldVersionStyle = \"height: 24px; width: 24px; display: inline-block; font-size: 20px !important; text-align: center; vertical-align: middle;overflow: hidden; line-height: 24px;\";\n            var oldVersionBHtml = \"<b style='width: 24px; height: 24px; display: inline-block; background-image: url({{url}}); background-position: {{position}}'></b>\";\n            oldVersionBHtml = Utils.render(oldVersionBHtml, {\n                url: NornalImagePath,\n                position: position\n            });\n            var oldVersionHtml = \"<span name='[{{zh}}]' class='RongIMExpression_{{en}}' style='{{style}}'>{{b}}</span>\"\n            oldVersionHtml = Utils.render(oldVersionHtml, {\n                zh: zh,\n                en: en,\n                b: oldVersionBHtml,\n                style: oldVersionStyle\n            });\n            var spanHTML = \"<span>\" + oldVersionHtml + \"</span>\";\n            return Utils.getDom(spanHTML);\n        });\n        _export.name = (function() {\n            var names = [];\n            for (var key in EmojiFactory) {\n                var value = EmojiFactory[key];\n                var data = {};\n                for (var i = 0; i < SupportLangs.length; i++) {\n                    var lang = SupportLangs[i];\n                    data[lang] = value[lang];\n                }\n                names.push(data);\n            }\n            return names;\n        })();\n        _export.data = Utils.map(EmojiList, function(item) {\n            var data;\n            for (var key in EmojiFactory) {\n                var detail = EmojiFactory[key];\n                if (detail.tag === item.emoji) {\n                    data = detail;\n                    detail.html = item.node;\n                }\n            }\n            return data;\n        });\n    }\n\n    return Utils.extend(_export, {\n        isSupportEmoji: isSupportEmoji,\n\n        init: init,\n        list: EmojiList,\n        emojiToSymbol: emojiToSymbol,\n        symbolToEmoji: symbolToEmoji,\n        emojiToHTML: emojiToHTML,\n        symbolToHTML: symbolToHTML\n    });\n});"
  },
  {
    "path": "electron-vue-sdk-v3/static/js/RongIMLib-2.5.1.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.6.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n            this.socket.fire(\"disconnect\", code);\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            modules.setRoomType(0);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            this.observers.push(observer);\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "electron-vue-sdk-v3/static/js/RongIMLib-3.0.1-dev.es.js",
    "content": "/*\n* RongIMLib.js v3.0.1\n* Release Date: Tue Apr 28 2020 09:06:24 GMT+0800 (China Standard Time)\n* Copyright 2020 RongCloud\n* Released under the MIT License.\n*/\nvar version = \"3.0.1\";\n\nvar SDK_VERSION = version;\n\nvar ERROR_INFO = {\n  TIMEOUT: {\n    code: -1,\n    msg: 'Network timeout'\n  },\n  SDK_INTERNAL_ERROR: {\n    code: -2,\n    msg: 'SDK internal error'\n  },\n  PARAMETER_ERROR: {\n    code: -3,\n    msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n  },\n  REJECTED_BY_BLACKLIST: {\n    code: 405,\n    msg: 'Blacklisted by the other party'\n  },\n  SEND_TOO_FAST: {\n    code: 20604,\n    msg: 'Sending messages too quickly'\n  },\n  NOT_IN_GROUP: {\n    code: 22406,\n    msg: 'Not in group'\n  },\n  FORBIDDEN_IN_GROUP: {\n    code: 22408,\n    msg: 'Forbbiden from speaking in the group'\n  },\n  NOT_IN_CHATROOM: {\n    code: 23406,\n    msg: 'Not in chatRoom'\n  },\n  FORBIDDEN_IN_CHATROOM: {\n    code: 23408,\n    msg: 'Forbbiden from speaking in the chatRoom'\n  },\n  KICKED_FROM_CHATROOM: {\n    code: 23409,\n    msg: 'Kicked out and forbbiden from joining the chatRoom'\n  },\n  CHATROOM_NOT_EXIST: {\n    code: 23410,\n    msg: 'ChatRoom does not exist'\n  },\n  CHATROOM_IS_FULL: {\n    code: 23411,\n    msg: 'ChatRoom members exceeded'\n  },\n  PARAMETER_INVALID_CHATROOM: {\n    code: 23412,\n    msg: 'Invalid chatRoom parameters'\n  },\n  ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n    code: 23414,\n    msg: 'ChatRoom message roaming service is not open'\n  },\n  RECALLMESSAGE_PARAMETER_INVALID: {\n    code: 25101,\n    msg: 'Invalid recall message parameter'\n  },\n  PUSHSETTING_PARAMETER_INVALID: {\n    code: 26001,\n    msg: 'Invalid push parameter'\n  },\n  OPERATION_BLOCKED: {\n    code: 20605,\n    msg: 'Operation is blocked'\n  },\n  OPERATION_NOT_SUPPORT: {\n    code: 20606,\n    msg: 'Operation is not supported'\n  },\n  MSG_BLOCKED_SENSITIVE_WORD: {\n    code: 21501,\n    msg: 'The sent message contains sensitive words'\n  },\n  REPLACED_SENSITIVE_WORD: {\n    code: 21502,\n    msg: 'Sensitive words in the message have been replaced'\n  },\n  NOT_CONNECTED: {\n    code: 30001,\n    msg: 'Please connect successfully first'\n  },\n  NAVI_REQUEST_ERROR: {\n    code: 30007,\n    msg: 'Navigation http request failed'\n  },\n  CMP_REQUEST_ERROR: {\n    code: 30010,\n    msg: 'CMP sniff http request failed'\n  },\n  CONN_APPKEY_FAKE: {\n    code: 31002,\n    msg: 'Your appkey is fake'\n  },\n  CONN_MINI_SERVICE_NOT_OPEN: {\n    code: 31003,\n    msg: 'Mini program service is not open, Please go to the developer to open this service'\n  },\n  CONN_TOKEN_INCORRECT: {\n    code: 31004,\n    msg: 'Your token is not valid or expired'\n  },\n  CONN_NOT_AUTHRORIZED: {\n    code: 31005,\n    msg: 'AppKey and Token do not match'\n  },\n  CONN_REDIRECTED: {\n    code: 31006,\n    msg: 'Connection redirection'\n  },\n  CONN_APP_BLOCKED_OR_DELETED: {\n    code: 31008,\n    msg: 'AppKey is banned or deleted'\n  },\n  CONN_USER_BLOCKED: {\n    code: 31009,\n    msg: 'User blocked'\n  },\n  CONN_DOMAIN_INCORRECT: {\n    code: 31012,\n    msg: 'Connect domain error, Please check the set security domain'\n  },\n  ROAMING_SERVICE_UNAVAILABLE: {\n    code: 33007,\n    msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n  },\n  RC_CONNECTION_EXIST: {\n    code: 34001,\n    msg: 'Connection already exists'\n  }\n};\nvar ERROR_CODE = {};\nvar ERROR_CODE_TO_INFO = {};\n\nfor (var name$1 in ERROR_INFO) {\n  var info = ERROR_INFO[name$1];\n  var code = info.code;\n  ERROR_CODE[name$1] = code;\n  ERROR_CODE[code] = name$1;\n  ERROR_CODE_TO_INFO[code] = info;\n}\n\nvar SERVER_ERROR_TO_CODE = {\n  '1': ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n};\n\nvar _CONNECT_SERVER_STATU, _SERVER_DISCONNECT_ST, _TRANSPORTER_STATUS_T;\nvar NAVI_ERROR_INFO = {\n  '401': ERROR_INFO.CONN_TOKEN_INCORRECT,\n  '403': ERROR_INFO.CONN_APPKEY_FAKE\n};\nvar CONNECTION_STATUS = {\n  CONNECTED: 0,\n  CONNECTING: 1,\n  DISCONNECTED: 2,\n  NETWORK_UNAVAILABLE: 3,\n  SOCKET_ERROR: 4,\n  KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n  BLOCKED: 12\n};\nvar SERVER_DISCONNECT_STATUS = {\n  KICKED_OFFLINE_BY_OTHER_CLIENT: 1,\n  BLOCKED: 2\n};\nvar CONNECT_SERVER_STATUS = {\n  IDENTIFIER_REJECTED: 2,\n  CONN_MINI_SERVICE_NOT_OPEN: 3,\n  TOKEN_INCORRECT: 4,\n  NOT_AUTHORIZED: 5,\n  REDIRECT: 6,\n  PACKAGE_ERROR: 7,\n  APP_BLOCK_OR_DELETE: 8,\n  BLOCK: 9,\n  TOKEN_EXPIRE: 10,\n  DEVICE_ERROR: 11,\n  DOMAIN_INCORRECT: 12\n};\nvar CONNECT_SERVER_STATUS_MAP_ERROR_INFO = (_CONNECT_SERVER_STATU = {}, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.IDENTIFIER_REJECTED] = ERROR_INFO.CONN_APPKEY_FAKE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.CONN_MINI_SERVICE_NOT_OPEN] = ERROR_INFO.CONN_MINI_SERVICE_NOT_OPEN, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_INCORRECT] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.NOT_AUTHORIZED] = ERROR_INFO.CONN_NOT_AUTHRORIZED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.REDIRECT] = ERROR_INFO.CONN_REDIRECTED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.APP_BLOCK_OR_DELETE] = ERROR_INFO.CONN_APP_BLOCKED_OR_DELETED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.BLOCK] = ERROR_INFO.CONN_USER_BLOCKED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_EXPIRE] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.DOMAIN_INCORRECT] = ERROR_INFO.CONN_DOMAIN_INCORRECT, _CONNECT_SERVER_STATU);\nvar TRANSPORTER_STATUS = {\n  CONNECTED: CONNECTION_STATUS.CONNECTED,\n  KICKED_OFFLINE_BY_OTHER_CLIENT: CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT,\n  BLOCKED: CONNECTION_STATUS.BLOCKED,\n  CLOSE_NORMAL: 1000,\n  CLOSE_GOING_AWAY: 1001,\n  CLOSE_PROTOCOL_ERROR: 1002,\n  CLOSE_UNSUPPORTED: 1003,\n  CLOSE_NO_STATUS: 1005,\n  CLOSE_ABNORMAL: 1006,\n  UNSUPPORTED_DATA: 1007,\n  POLICY_VIOLATION: 1008,\n  CLOSE_TOO_LARGE: 1009,\n  MISSING_EXTENSION: 1010,\n  INTERNAL_ERROR: 1011,\n  SERVICE_RESTART: 1012,\n  TRY_AGAIN_LATER: 1013,\n  TSL_HANDSHAKE: 1015,\n  PING_FIRST_TIMEOUT: 2001,\n  PING_TIMEOUT: 2002,\n  DISCONNECT_TOO_FAST: 2003,\n  EXCEED_MESSAGE_ID_LIMIT: 2004,\n  COMET_REQUEST_ERROR: 2005,\n  MINI_URL_NOT_IN_DOMAIN_LIST: 2006\n};\nvar MINI_ERROR_MSG_TO_STATUS = {\n  'url not in domain list': TRANSPORTER_STATUS.MINI_URL_NOT_IN_DOMAIN_LIST\n};\nvar SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS = (_SERVER_DISCONNECT_ST = {}, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT] = TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.BLOCKED] = TRANSPORTER_STATUS.BLOCKED, _SERVER_DISCONNECT_ST);\nvar TRANSPORTER_STATUS_NEED_UPDATE_CMP = [TRANSPORTER_STATUS.CLOSE_NORMAL, TRANSPORTER_STATUS.CLOSE_GOING_AWAY, TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR, TRANSPORTER_STATUS.CLOSE_UNSUPPORTED, TRANSPORTER_STATUS.UNSUPPORTED_DATA, TRANSPORTER_STATUS.POLICY_VIOLATION, TRANSPORTER_STATUS.MISSING_EXTENSION, TRANSPORTER_STATUS.INTERNAL_ERROR, TRANSPORTER_STATUS.SERVICE_RESTART, TRANSPORTER_STATUS.TRY_AGAIN_LATER, TRANSPORTER_STATUS.TSL_HANDSHAKE, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST, TRANSPORTER_STATUS.COMET_REQUEST_ERROR];\nvar TRANSPORTER_STATUS_NEED_RECONNECT = TRANSPORTER_STATUS_NEED_UPDATE_CMP.concat([TRANSPORTER_STATUS.PING_TIMEOUT, TRANSPORTER_STATUS.CLOSE_ABNORMAL, TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT, TRANSPORTER_STATUS.COMET_REQUEST_ERROR]);\nvar TRANSPORTER_STATUS_TO_CONNECTION_STATUS = (_TRANSPORTER_STATUS_T = {}, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_GOING_AWAY] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_UNSUPPORTED] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_NO_STATUS] = CONNECTION_STATUS.DISCONNECTED, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_ABNORMAL] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.DISCONNECT_TOO_FAST] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.UNSUPPORTED_DATA] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.POLICY_VIOLATION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_TOO_LARGE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.MISSING_EXTENSION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.INTERNAL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.SERVICE_RESTART] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TRY_AGAIN_LATER] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TSL_HANDSHAKE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_FIRST_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.COMET_REQUEST_ERROR] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T);\n\nvar CONNECT_TYPE = {\n  COMET: 'comet',\n  WEBSOCKET: 'websocket'\n};\nvar CONVERSATION_TYPE = {\n  PRIVATE: 1,\n  GROUP: 3,\n  CHATROOM: 4,\n  CUSTOMER_SERVICE: 5,\n  SYSTEM: 6,\n  RTC_ROOM: 12\n};\nvar MESSAGE_DIRECTION = {\n  SEND: 1,\n  RECEIVE: 2\n};\nvar MESSAGS_TIME_ORDER = {\n  DESC: 0,\n  ASC: 1\n};\nvar CHATROOM_ORDER = {\n  ASC: 1,\n  DESC: 2\n};\nvar RECALL_MESSAGE_TYPE = 'RC:RcCmd';\nvar MENTIOND_TYPE = {\n  ALL: 1,\n  SINGAL: 2\n};\nvar MESSAGE_TYPE = {\n  TEXT: 'RC:TxtMsg',\n  VOICE: 'RC:VcMsg',\n  HQ_VOICE: 'RC:HQVCMsg',\n  IMAGE: 'RC:ImgMsg',\n  GIF: 'RC:GIFMsg',\n  RICH_CONTENT: 'RC:ImgTextMsg',\n  LOCATION: 'RC:LBSMsg',\n  FILE: 'RC:FileMsg',\n  SIGHT: 'RC:SightMsg',\n  COMBINE: 'RC:CombineMsg'\n};\nvar RTC_API_TYPE = {\n  ROOM: 1,\n  PERSON: 2\n};\nvar FILE_TYPE = {\n  IMAGE: 1,\n  AUDIO: 2,\n  VIDEO: 3,\n  FILE: 4\n};\nvar product = {\n  CONNECT_TYPE: CONNECT_TYPE,\n  CONNECTION_STATUS: CONNECTION_STATUS,\n  CONVERSATION_TYPE: CONVERSATION_TYPE,\n  MESSAGE_DIRECTION: MESSAGE_DIRECTION,\n  MESSAGS_TIME_ORDER: MESSAGS_TIME_ORDER,\n  CHATROOM_ORDER: CHATROOM_ORDER,\n  RECALL_MESSAGE_TYPE: RECALL_MESSAGE_TYPE,\n  MESSAGE_TYPE: MESSAGE_TYPE,\n  MENTIOND_TYPE: MENTIOND_TYPE,\n  SDK_VERSION: SDK_VERSION,\n  FILE_TYPE: FILE_TYPE\n};\n\nvar IM_TIMEOUT = 30000;\nvar IM_PING_INTERVAL_TIME = 30000;\nvar IM_COMET_PULLMSG_TIMEOUT = 45000;\nvar IM_PING_MAX_TIMEOUT = 6000;\nvar IM_PING_MIN_TIMEOUT = 2000;\nvar HTTP_TIMEOUT = 60000;\nvar PULL_MSG_TIME = 180000;\nvar NAVI_EXPIRED_TIME = 7200000;\nvar CMP_SNIFF_INTERNAL_TIME = 1000;\nvar FIRST_PING_TIMEOUT = 1000;\nvar NAVI_REQUEST_SUCCESS_CODE = 200;\nvar NAVI_SEPARATOR_IN_TOKEN = '@';\nvar DOMAIN_SEPARATOR_IN_NAVLIST = ';';\nvar DOMAIN_SEPARATOR_IN_CMPLIST = ',';\nvar MAX_SINGAL_ID = 65535;\nvar MINIMUM_CONNECT_DURATION = 5000;\nvar TYPE_HAS_CONVERSATION = [CONVERSATION_TYPE.PRIVATE, CONVERSATION_TYPE.GROUP, CONVERSATION_TYPE.SYSTEM];\nvar PLATFORM = {\n  WEB: 'web',\n  WX: 'wx',\n  ZFB: 'zfb',\n  TT: 'tt',\n  BAIDU: 'baidu',\n  QUICK_APP: 'quick_app'\n};\nvar REQUEST_METHOD = {\n  POST: 'post',\n  GET: 'get'\n};\nvar STORAGE_ROOT_KEY = 'rc-';\nvar STORAGE_NAVI = {\n  ROOT_KEY_TPL: 'nav-{appkey}-{UID}',\n  SUB_KEY: {\n    CONNECT_TYPE: 'connettype',\n    TIME_WHEN_SAVED: 'time',\n    RESPONSE: 'resp'\n  }\n};\nvar STORAGE_SYNC_TIME = {\n  ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n  SUB_KEY: {\n    SENDBOX: 'send',\n    INBOX: 'in'\n  }\n};\nvar STORAGE_CONVERSATION = {\n  ROOT_KEY_TPL: 'con-{appkey}-{userId}',\n  SUB_KEY: {\n    ROOT_TPL: '{type}-{id}',\n    UNREAD_COUNT: 'c',\n    UNREAD_LAST_TIME: 't',\n    HAS_MENTIOND: 'hm',\n    MENTIOND_INFO: 'm'\n  }\n};\nvar HTTP_PROTOCOL = {\n  HTTP: 'http:',\n  HTTPS: 'https:'\n};\nvar WS_PROTOCOL = {\n  WSS: 'wss:',\n  WS: 'ws:'\n};\nvar NAVI_CALLBACK_NAME = 'getServerEndpoint';\nvar NAVI_TYPE = {\n  COMET: 'cometnavi',\n  WEBSOCKET: 'navi'\n};\nvar NAVI_URL_TPL = '{url}/{type}.js?appId={appkey}&token={token}&callBack=' + NAVI_CALLBACK_NAME + '&r={random}&v=' + SDK_VERSION;\nvar CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION;\nvar COMET_REQ_HAS_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&topic={topic}&targetid={targetId}&pid={pid}';\nvar COMET_REQ_NO_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&pid={pid}';\nvar COMET_PULL_URL_TPL = '{protocol}//{domain}/pullmsg.js?sessionid={sessionId}&timestrap={timestamp}&pid={pid}';\nvar TIMER_TYPE = {\n  INTERVAL: 'interval',\n  TIMEOUT: 'timeout'\n};\nvar TIMER_STATUS = {\n  PENNDING: 'pendding',\n  BUSY: 'busy',\n  ENDING: 'ending'\n};\n\nvar UnKown = 'UnKown';\n\nvar isMiniEnv = function isMiniEnv(global) {\n  return global !== window;\n};\n\nvar hasMiniBaseEvent = function hasMiniBaseEvent(miniGlobal) {\n  var baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n\n  for (var i = 0, max = baseMiniEventNames.length; i < max; i++) {\n    var baseEventName = baseMiniEventNames[i];\n\n    if (!miniGlobal[baseEventName]) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nvar getEnvInfo = function getEnvInfo() {\n  if (typeof wx !== 'undefined' && hasMiniBaseEvent(wx)) {\n    return {\n      platform: PLATFORM.WX,\n      global: wx\n    };\n  } else if (typeof swan !== 'undefined' && hasMiniBaseEvent(swan)) {\n    return {\n      platform: PLATFORM.BAIDU,\n      global: swan\n    };\n  } else if (typeof tt !== 'undefined' && hasMiniBaseEvent(tt)) {\n    return {\n      platform: PLATFORM.TT,\n      global: tt\n    };\n  } else if (typeof my !== 'undefined' && hasMiniBaseEvent(my)) {\n    return {\n      platform: PLATFORM.ZFB,\n      global: my\n    };\n  } else {\n    return {\n      platform: PLATFORM.WEB,\n      global: window\n    };\n  }\n};\n\nvar getWebSystemInfo = function getWebSystemInfo() {\n  var userAgent = navigator.userAgent;\n  var version, type;\n  var condition = {\n    IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n    Edge: /Edge\\/([\\d.]+)/,\n    Firefox: /Firefox\\/([\\d.]+)/,\n    Opera: /(?:OPERA|OPR).([\\d.]+)/,\n    WeiXin: /MicroMessenger\\/([\\d.]+)/,\n    QQBrowser: /QQBrowser\\/([\\d.]+)/,\n    Chrome: /Chrome\\/([\\d.]+)/,\n    Safari: /Version\\/([\\d.]+).*Safari/\n  };\n\n  for (var key in condition) {\n    if (!condition.hasOwnProperty(key)) continue;\n    var browserContent = userAgent.match(condition[key]);\n\n    if (browserContent) {\n      type = key;\n      version = browserContent[1] || browserContent[2];\n      break;\n    }\n  }\n\n  return {\n    model: type || UnKown,\n    version: version || UnKown\n  };\n};\n\nvar getMiniSystemInfo = function getMiniSystemInfo(global) {\n  var systemInfo = global.getSystemInfoSync() || {};\n  var model = systemInfo.model,\n      brand = systemInfo.brand;\n\n  if (model && brand) {\n    model = model + ' ' + brand;\n  }\n\n  systemInfo.model = model;\n  return systemInfo;\n};\n\nvar getProtocol = function getProtocol(global) {\n  var location = global.location || {};\n  var protocol = {\n    http: location.protocol || HTTP_PROTOCOL.HTTPS,\n    ws: WS_PROTOCOL.WSS\n  };\n  var isHttp = protocol.http === HTTP_PROTOCOL.HTTP;\n\n  if (isHttp) {\n    protocol.ws = WS_PROTOCOL.WS;\n  }\n\n  return protocol;\n};\n\nvar adaptGlobalObjectCreate = function adaptGlobalObjectCreate(global, isMini) {\n  if (!isMini && !global.Object.create) {\n    global.Object.create = function (o, properties) {\n      if (typeof o !== 'object' && typeof o !== 'function') throw new TypeError('Object prototype may only be an Object: ' + o);else if (o === null) throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support \\'null\\' as the first argument.');\n      if (typeof properties !== 'undefined') throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support a second argument.');\n\n      function F() {}\n\n      F.prototype = o;\n      return new F();\n    };\n  }\n};\n\nvar getMiniGlobal = function getMiniGlobal(global) {\n  return Object.assign(global, {\n    JSON: JSON,\n    Promise: Promise,\n    setTimeout: setTimeout,\n    setInterval: setInterval,\n    encodeURIComponent: encodeURIComponent,\n    clearTimeout: function (_clearTimeout) {\n      function clearTimeout(_x) {\n        return _clearTimeout.apply(this, arguments);\n      }\n\n      clearTimeout.toString = function () {\n        return _clearTimeout.toString();\n      };\n\n      return clearTimeout;\n    }(function (id) {\n      clearTimeout(id);\n    }),\n    clearInterval: function (_clearInterval) {\n      function clearInterval(_x2) {\n        return _clearInterval.apply(this, arguments);\n      }\n\n      clearInterval.toString = function () {\n        return _clearInterval.toString();\n      };\n\n      return clearInterval;\n    }(function (id) {\n      clearInterval(id);\n    })\n  });\n};\n\nvar envInfo = getEnvInfo();\nvar platform = envInfo.platform,\n    global$1 = envInfo.global;\nvar isMini = isMiniEnv(global$1);\nvar protocol = getProtocol(global$1);\nvar system = isMini ? getMiniSystemInfo(global$1) : getWebSystemInfo();\nsystem.name = platform;\nadaptGlobalObjectCreate(global$1, isMini);\nglobal$1 = isMini ? getMiniGlobal(global$1) : global$1;\nvar env = {\n  global: global$1,\n  system: system,\n  isMini: isMini,\n  protocol: protocol\n};\n\nvar global$2 = env.global,\n    system$1 = env.system;\nvar isZFB = system$1.name === PLATFORM.ZFB;\n\nvar ZFBStorage = function () {\n  function ZFBStorage() {}\n\n  var _proto = ZFBStorage.prototype;\n\n  _proto.set = function set(key, value) {\n    global$2.setStorageSync({\n      key: key,\n      data: value\n    });\n  };\n\n  _proto.get = function get(key) {\n    return global$2.getStorageSync({\n      key: key\n    });\n  };\n\n  _proto.remove = function remove(key) {\n    return global$2.removeStorageSync({\n      key: key\n    });\n  };\n\n  _proto.getKeys = function getKeys() {\n    var res = my.getStorageInfoSync();\n    return res.keys;\n  };\n\n  return ZFBStorage;\n}();\n\nvar MiniStorage = function () {\n  function MiniStorage() {}\n\n  var _proto2 = MiniStorage.prototype;\n\n  _proto2.set = function set(key, value) {\n    global$2.setStorageSync(key, value);\n  };\n\n  _proto2.get = function get(key) {\n    try {\n      return global$2.getStorageSync(key);\n    } catch (e) {\n      return null;\n    }\n  };\n\n  _proto2.remove = function remove(key) {\n    try {\n      return global$2.removeStorageSync(key);\n    } catch (e) {\n      return null;\n    }\n  };\n\n  _proto2.getKeys = function getKeys() {\n    try {\n      var res = global$2.getStorageInfoSync();\n      return res.keys;\n    } catch (e) {\n      return [];\n    }\n  };\n\n  return MiniStorage;\n}();\n\nvar storage = isZFB ? ZFBStorage : MiniStorage;\n\nvar JSON$1 = {\n  parse: function parse(sJSON) {\n    return new Function('', 'return (' + sJSON + ')')();\n  },\n  stringify: function stringify(value) {\n    return JSON$1.str('', {\n      '': value\n    });\n  },\n  str: function str(key, holder) {\n    var i,\n        k,\n        v,\n        length,\n        partial,\n        value = holder[key],\n        self = JSON$1;\n\n    if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n      value = value.toJSON(key);\n    }\n\n    switch (typeof value) {\n      case 'string':\n        return self.quote(value);\n\n      case 'number':\n        return isFinite(value) ? String(value) : 'null';\n\n      case 'boolean':\n        return String(value);\n\n      case 'object':\n        if (!value) {\n          return 'null';\n        }\n\n        partial = [];\n\n        if (Object.prototype.toString.apply(value) === '[object Array]') {\n          length = value.length;\n\n          for (i = 0; i < length; i += 1) {\n            partial[i] = self.str(i, value) || 'null';\n          }\n\n          v = partial.length === 0 ? '[]' : '[' + partial.join(',') + ']';\n          return v;\n        }\n\n        for (k in value) {\n          if (Object.prototype.hasOwnProperty.call(value, k)) {\n            v = self.str(k, value);\n\n            if (v) {\n              partial.push(self.quote(k) + ':' + v);\n            }\n          }\n        }\n\n        v = partial.length === 0 ? '{}' : '{' + partial.join(',') + '}';\n        return v;\n    }\n  },\n  quote: function quote(string) {\n    var self = JSON$1;\n    self.rx_escapable.lastIndex = 0;\n    return self.rx_escapable.test(string) ? '\"' + string.replace(self.rx_escapable, function (a) {\n      var c = self.meta[a];\n      return typeof c === 'string' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n    }) + '\"' : '\"' + string + '\"';\n  },\n  rx_escapable: new RegExp(\"[\\\\\\\"\\\\\\\\\\\"\\0-\\x1F\\x7F-\\x9F\\xAD\\u0600-\\u0604\\u070F\\u17B4\\u17B5\\u200C-\\u200F\\u2028-\\u202F\\u2060-\\u206F\\uFEFF\\uFFF0-\\uFFFF]\", 'g'),\n  meta: {\n    '\\b': '\\\\b',\n    '\t': '\\\\t',\n    '\\n': '\\\\n',\n    '\\f': '\\\\f',\n    '\\r': '\\\\r',\n    '\"': '\\\\\"',\n    '\\'\\'': '\\\\\\'\\'',\n    '\\\\': '\\\\\\\\'\n  }\n};\n\nvar CacheStorage = function () {\n  function CacheStorage(values) {\n    this.caches = {};\n\n    if (values) {\n      this.caches = values;\n    }\n  }\n\n  var _proto = CacheStorage.prototype;\n\n  _proto.set = function set(key, value) {\n    this.caches[key] = value;\n  };\n\n  _proto.remove = function remove(key) {\n    var val = this.get(key);\n    delete this.caches[key];\n    return val;\n  };\n\n  _proto.get = function get(key) {\n    return this.caches[key];\n  };\n\n  _proto.getKeys = function getKeys() {\n    var keys = [];\n\n    for (var key in this.caches) {\n      keys.push(key);\n    }\n\n    return keys;\n  };\n\n  return CacheStorage;\n}();\n\nvar global$3 = env.global;\nvar TEST_KEY = 'RC_TEST_KEY';\nvar TEST_VALUE = 'RC_TEST_VALUE';\n\nvar isSupportLocalStorage = function isSupportLocalStorage() {\n  var isSupport = false;\n  var localStorage = global$3.localStorage;\n\n  if (localStorage) {\n    try {\n      localStorage.setItem(TEST_KEY, TEST_VALUE);\n      var testVal = localStorage.getItem(TEST_KEY);\n\n      if (testVal === TEST_VALUE) {\n        isSupport = true;\n      }\n\n      localStorage.removeItem(TEST_KEY);\n    } catch (e) {}\n  }\n\n  return isSupport;\n};\n\nvar WebStorage = function () {\n  function WebStorage() {}\n\n  var _proto = WebStorage.prototype;\n\n  _proto.set = function set(key, value) {\n    global$3.localStorage.setItem(key, JSON$1.stringify({\n      d: value\n    }));\n  };\n\n  _proto.get = function get(key) {\n    var value;\n    var localValue = global$3.localStorage.getItem(key);\n\n    try {\n      localValue = JSON$1.parse(localValue);\n    } catch (e) {\n      localValue = {};\n    }\n\n    if (localValue && localValue.d) {\n      value = localValue.d;\n    }\n\n    return value;\n  };\n\n  _proto.remove = function remove(key) {\n    return global$3.localStorage.removeItem(key);\n  };\n\n  _proto.getKeys = function getKeys() {\n    var keyList = [];\n\n    for (var key in global$3.localStorage) {\n      keyList.push(key);\n    }\n\n    return keyList;\n  };\n\n  return WebStorage;\n}();\n\nvar WebStorage$1 = isSupportLocalStorage() ? WebStorage : CacheStorage;\n\nvar isMini$1 = env.isMini;\nvar Storage = isMini$1 ? storage : WebStorage$1,\n    storage$1 = new Storage();\n\nvar global$4 = env.global;\n\nvar Socket = function () {\n  function Socket(options) {\n    this.socket = void 0;\n    this.socket = global$4.connectSocket(options);\n  }\n\n  var _proto = Socket.prototype;\n\n  _proto.send = function send(data) {\n    this.socket.send({\n      data: data\n    });\n  };\n\n  _proto.close = function close() {\n    this.socket.close();\n  };\n\n  _proto.onOpen = function onOpen(callback) {\n    this.socket.onOpen(callback);\n  };\n\n  _proto.onMessage = function onMessage(callback) {\n    this.socket.onMessage(callback);\n  };\n\n  _proto.onError = function onError(callback) {\n    this.socket.onError(callback);\n  };\n\n  _proto.onClose = function onClose(callback) {\n    this.socket.onClose(callback);\n  };\n\n  return Socket;\n}();\n\nvar Socket$1 = function () {\n  function Socket(options) {\n    this.socket = void 0;\n    var url = options.url;\n    this.socket = new WebSocket(url);\n    this.socket.binaryType = 'arraybuffer';\n    return this;\n  }\n\n  var _proto = Socket.prototype;\n\n  _proto.send = function send(data) {\n    return this.socket.send(data);\n  };\n\n  _proto.close = function close() {\n    this.socket.close();\n  };\n\n  _proto.onOpen = function onOpen(callback) {\n    this.socket.addEventListener('open', callback);\n  };\n\n  _proto.onMessage = function onMessage(callback) {\n    this.socket.addEventListener('message', callback);\n  };\n\n  _proto.onError = function onError(callback) {\n    this.socket.addEventListener('error', callback);\n  };\n\n  _proto.onClose = function onClose(callback) {\n    this.socket.addEventListener('close', callback);\n  };\n\n  return Socket;\n}();\n\nvar isMini$2 = env.isMini;\nvar Socket$2 = isMini$2 ? Socket : Socket$1;\n\n/*!\n 基于 es6-promise\n * Github: https://github.com/stefanpenner/es6-promise\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license   Licensed under MIT license\n *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version   v4.2.8+1e68dce6\n */\nvar SparePromise = (function(){function a(a){var b=typeof a;return null!==a&&(\"object\"===b||\"function\"===b)}function b(a){return \"function\"==typeof a}function c(a){P=a;}function d(a){Q=a;}function e(){return function(){return process.nextTick(j)}}function f(){return \"undefined\"!=typeof O?function(){O(j);}:i()}function g(){var a=0,b=new T(j),c=document.createTextNode(\"\");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2;}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.postMessage(0)}}function i(){var a=setTimeout;return function(){return a(j,1)}}function j(){var a,b,c;for(a=0;N>a;a+=2)b=W[a],c=W[a+1],b(c),W[a]=void 0,W[a+1]=void 0;N=0;}function k(){try{var a=Function(\"return this\")().require(\"vertx\");return O=a.runOnLoop||a.runOnContext,f()}catch(b){return i()}}function l(a,b){var e,f,c=this,d=new this.constructor(n);return void 0===d[Y]&&D(d),e=c._state,e?(f=arguments[e-1],Q(function(){return A(e,d,f,c._result)})):y(c,d,a,b),d}function m(a){var c,b=this;return a&&\"object\"==typeof a&&a.constructor===b?a:(c=new b(n),u(c,a),c)}function n(){}function o(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function q(a,b,c,d){try{a.call(b,c,d);}catch(e){return e}}function r(a,b,c){Q(function(a){var d=!1,e=q(c,b,function(c){d||(d=!0,b!==c?u(a,c):w(a,c));},function(b){d||(d=!0,x(a,b));},\"Settle: \"+(a._label||\" unknown promise\"));!d&&e&&(d=!0,x(a,e));},a);}function s(a,b){b._state===$?w(a,b._result):b._state===_?x(a,b._result):y(b,void 0,function(b){return u(a,b)},function(b){return x(a,b)});}function t(a,c,d){c.constructor===a.constructor&&d===l&&c.constructor.resolve===m?s(a,c):void 0===d?w(a,c):b(d)?r(a,c,d):w(a,c);}function u(b,c){if(b===c)x(b,o());else if(a(c)){var d=void 0;try{d=c.then;}catch(e){return void x(b,e)}t(b,c,d);}else w(b,c);}function v(a){a._onerror&&a._onerror(a._result),z(a);}function w(a,b){a._state===Z&&(a._result=b,a._state=$,0!==a._subscribers.length&&Q(z,a));}function x(a,b){a._state===Z&&(a._state=_,a._result=b,Q(v,a));}function y(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+$]=c,e[f+_]=d,0===f&&a._state&&Q(z,a);}function z(a){var d,e,f,g,b=a._subscribers,c=a._state;if(0!==b.length){for(d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0;}}function A(a,c,d,e){var f=b(d),g=void 0,h=void 0,i=!0;if(f){try{g=d(e);}catch(j){i=!1,h=j;}if(c===g)return void x(c,p())}else g=e;c._state!==Z||(f&&i?u(c,g):i===!1?x(c,h):a===$?w(c,g):a===_&&x(c,g));}function B(a,b){try{b(function(b){u(a,b);},function(b){x(a,b);});}catch(c){x(a,c);}}function C(){return ab++}function D(a){a[Y]=ab++,a._state=void 0,a._result=void 0,a._subscribers=[];}function E(){return new Error(\"Array Methods must be provided an Array\")}function F(a){return new bb(this,a).promise}function G(a){var b=this;return new b(M(a)?function(c,d){for(var e=a.length,f=0;e>f;f++)b.resolve(a[f]).then(c,d);}:function(a,b){return b(new TypeError(\"You must pass an array to race.\"))})}function H(a){var b=this,c=new b(n);return x(c,a),c}function I(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function J(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function K(){var c,d,a=void 0;if(\"undefined\"!=typeof global)a=global;else if(\"undefined\"!=typeof self)a=self;else try{a=Function(\"return this\")();}catch(b){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}if(c=a.Promise){d=null;try{d=Object.prototype.toString.call(c.resolve());}catch(b){}if(\"[object Promise]\"===d&&!c.cast)return}a.Promise=cb;}var M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,L=void 0;return L=Array.isArray?Array.isArray:function(a){return \"[object Array]\"===Object.prototype.toString.call(a)},M=L,N=0,O=void 0,P=void 0,Q=function(a,b){W[N]=a,W[N+1]=b,N+=2,2===N&&(P?P(j):X());},R=\"undefined\"!=typeof window?window:void 0,S=R||{},T=S.MutationObserver||S.WebKitMutationObserver,U=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),V=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,W=new Array(1e3),X=void 0,X=U?e():T?g():V?h():void 0===R&&\"function\"==typeof require?k():i(),Y=Math.random().toString(36).substring(2),Z=void 0,$=1,_=2,ab=0,bb=function(){function a(a,b){this._instanceConstructor=a,this.promise=new a(n),this.promise[Y]||D(this.promise),M(b)?(this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(b),0===this._remaining&&w(this.promise,this._result))):x(this.promise,E());}return a.prototype._enumerate=function(a){for(var b=0;this._state===Z&&b<a.length;b++)this._eachEntry(a[b],b);},a.prototype._eachEntry=function(a,b){var e,f,g,i,c=this._instanceConstructor,d=c.resolve;if(d===m){e=void 0,f=void 0,g=!1;try{e=a.then;}catch(h){g=!0,f=h;}e===l&&a._state!==Z?this._settledAt(a._state,b,a._result):\"function\"!=typeof e?(this._remaining--,this._result[b]=a):c===cb?(i=new c(n),g?x(i,f):t(i,a,e),this._willSettleAt(i,b)):this._willSettleAt(new c(function(b){return b(a)}),b);}else this._willSettleAt(d(a),b);},a.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===Z&&(this._remaining--,a===_?x(d,c):this._result[b]=c),0===this._remaining&&w(d,this._result);},a.prototype._willSettleAt=function(a,b){var c=this;y(a,void 0,function(a){return c._settledAt($,b,a)},function(a){return c._settledAt(_,b,a)});},a}(),cb=function(){function a(b){this[Y]=C(),this._result=this._state=void 0,this._subscribers=[],n!==b&&(\"function\"!=typeof b&&I(),this instanceof a?B(this,b):J());}return a.prototype[\"catch\"]=function(a){return this.then(null,a)},a.prototype[\"finally\"]=function(a){var c=this,d=c.constructor;return b(a)?c.then(function(b){return d.resolve(a()).then(function(){return b})},function(b){return d.resolve(a()).then(function(){throw b})}):c.then(a,a)},a}(),cb.prototype.then=l,cb.all=F,cb.race=G,cb.resolve=m,cb.reject=H,cb._setScheduler=c,cb._setAsap=d,cb._asap=Q,cb.polyfill=K,cb.Promise=cb,cb})();\n\nvar global$5 = env.global,\n    system$2 = env.system;\nvar isZFB$1 = system$2.name === PLATFORM.ZFB;\n\nvar zfbRequest = function zfbRequest(option) {\n  var url = option.url,\n      method = option.method,\n      body = option.body,\n      headers = option.headers,\n      timeout = option.timeout;\n  method = method || REQUEST_METHOD.GET;\n  headers = headers || {};\n  timeout = timeout || HTTP_TIMEOUT;\n  return global$5.httpRequest({\n    url: url,\n    method: method,\n    data: body,\n    headers: headers,\n    timeout: timeout,\n    success: option.success,\n    fail: function fail(result) {\n      if (result.status === 202) {\n        option.success(result);\n      } else {\n        option.fail(result);\n      }\n    }\n  });\n};\n\nvar request = isZFB$1 ? zfbRequest : global$5.request;\nvar MiniRequest = (function (option) {\n  var success = option.success,\n      fail = option.fail,\n      body = option.body;\n  option.data = option.data || body;\n  var xhr;\n\n  option.success = function (result) {\n    success(result.data, result.statusCode);\n  };\n\n  option.fail = function (result) {\n    fail(result.data, result.statusCode);\n  };\n\n  xhr = request(option);\n  return xhr;\n});\n\nvar global$6 = env.global;\n\nvar isValidRequest = function isValidRequest(obj) {\n  return typeof obj === 'function' || typeof obj === 'object';\n};\n\nvar createXHR = function createXHR() {\n  var item = {\n    XMLHttpRequest: function (_XMLHttpRequest) {\n      function XMLHttpRequest() {\n        return _XMLHttpRequest.apply(this, arguments);\n      }\n\n      XMLHttpRequest.toString = function () {\n        return _XMLHttpRequest.toString();\n      };\n\n      return XMLHttpRequest;\n    }(function () {\n      return new XMLHttpRequest();\n    }),\n    XDomainRequest: function (_XDomainRequest) {\n      function XDomainRequest() {\n        return _XDomainRequest.apply(this, arguments);\n      }\n\n      XDomainRequest.toString = function () {\n        return _XDomainRequest.toString();\n      };\n\n      return XDomainRequest;\n    }(function () {\n      return new XDomainRequest();\n    }),\n    ActiveXObject: function (_ActiveXObject) {\n      function ActiveXObject() {\n        return _ActiveXObject.apply(this, arguments);\n      }\n\n      ActiveXObject.toString = function () {\n        return _ActiveXObject.toString();\n      };\n\n      return ActiveXObject;\n    }(function () {\n      return new ActiveXObject('Microsoft.XMLHTTP');\n    })\n  };\n  var isXHR = isValidRequest(global$6.XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest();\n  var isXDR = isValidRequest(global$6.XDomainRequest);\n  var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n  return item[key]();\n};\n\nvar request$1 = function request(option) {\n  var url = option.url,\n      method = option.method,\n      body = option.body,\n      headers = option.headers,\n      success = option.success,\n      fail = option.fail,\n      timeout = option.timeout;\n  method = method || REQUEST_METHOD.GET;\n  var xhr = createXHR();\n  xhr.open(method, url);\n\n  if (headers && xhr.setRequestHeader) {\n    for (var key in headers) {\n      xhr.setRequestHeader(key, headers[key]);\n    }\n  }\n\n  if ('onload' in xhr) {\n    xhr.onload = function () {\n      success(xhr.responseText, xhr);\n    };\n\n    xhr.onerror = function () {\n      fail(xhr.responseText, xhr);\n    };\n  } else {\n    xhr.onreadystatechange = function () {\n      if (xhr.readyState === 4) {\n        var result = xhr.responseText,\n            status = xhr.status;\n\n        if (status === 0) {\n          fail(result, xhr, status);\n        } else {\n          success(result, xhr, status);\n        }\n      }\n    };\n  }\n\n  if (timeout) {\n    xhr.timeout = timeout;\n  }\n\n  xhr.send(body);\n  return xhr;\n};\n\nvar request$2 = env.isMini ? MiniRequest : request$1;\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nvar md5 = (function(){function a(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){var h,i,j,k,l,m,n,o,p;for(b[c>>5]|=128<<c%32,b[(c+64>>>9<<4)+14]=c,m=1732584193,n=-271733879,o=-1732584194,p=271733878,h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return [m,n,o,p]}function i(a){var b,c=\"\",d=32*a.length;for(b=0;d>b;b+=8)c+=String.fromCharCode(255&a[b>>5]>>>b%32);return c}function j(a){var b,d,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(d=8*a.length,b=0;d>b;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,g,d=j(a),e=[],f=[];for(e[15]=f[15]=void 0,d.length>16&&(d=h(d,8*a.length)),c=0;16>c;c+=1)e[c]=909522486^d[c],f[c]=1549556828^d[c];return g=h(e.concat(j(b)),512+8*b.length),i(h(f.concat(g),640))}function m(a){var d,e,b=\"0123456789abcdef\",c=\"\";for(e=0;e<a.length;e+=1)d=a.charCodeAt(e),c+=b.charAt(15&d>>>4)+b.charAt(15&d);return c}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s})();\n\nvar global$7 = env.global;\nvar Promise$1 = global$7.Promise;\n\nvar isSupportPromise = function isSupportPromise() {\n  if (!global$7.Promise) return false;\n\n  var defer = function () {\n    return global$7.Promise.resolve();\n  }();\n\n  return defer.then && defer[\"catch\"] && defer[\"finally\"];\n};\n\nvar setTimeout$1 = function setTimeout(event, timeout) {\n  return global$7.setTimeout(event, timeout);\n};\n\nvar clearTimeout$1 = function clearTimeout(id) {\n  return global$7.clearTimeout(id);\n};\n\nvar setInterval$1 = function setInterval(event, timeout) {\n  return global$7.setInterval(event, timeout);\n};\n\nvar clearInterval$1 = function clearInterval(id) {\n  return global$7.clearInterval(id);\n};\n\nvar Defer = isSupportPromise() ? global$7.Promise : SparePromise;\n\nvar noop = function noop(data) {\n  return data;\n};\n\nvar deferNoop = function deferNoop(data) {\n  return Promise$1.resolve(data);\n};\n\nvar JSON$2 = global$7.JSON || JSON$1;\n\nvar allowError = function allowError(event) {\n  var result;\n\n  try {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    result = event.apply(void 0, args);\n  } catch (e) {\n    result = null;\n  }\n\n  return result;\n};\n\nvar toJSON = function toJSON(val) {\n  return allowError(JSON$2.stringify, val);\n};\n\nvar parseJSON = function parseJSON(val) {\n  return allowError(JSON$2.parse, val);\n};\n\nvar copy = function copy(val) {\n  return parseJSON(toJSON(val));\n};\n\nvar isObject = function isObject(val) {\n  return Object.prototype.toString.call(val) === '[object Object]';\n};\n\nvar isArray = function isArray(val) {\n  return Object.prototype.toString.call(val).indexOf('Array') !== -1;\n};\n\nvar isFunction = function isFunction(val) {\n  return Object.prototype.toString.call(val) === '[object Function]';\n};\n\nvar isString = function isString(val) {\n  return Object.prototype.toString.call(val) === '[object String]';\n};\n\nvar isBoolean = function isBoolean(val) {\n  return Object.prototype.toString.call(val) === '[object Boolean]';\n};\n\nvar isUndefined = function isUndefined(val) {\n  return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n};\n\nvar isNull = function isNull(val) {\n  return Object.prototype.toString.call(val) === '[object Null]';\n};\n\nvar isNumber = function isNumber(val) {\n  return Object.prototype.toString.call(val) === '[object Number]';\n};\n\nvar isArrayBuffer = function isArrayBuffer(val) {\n  return Object.prototype.toString.call(val) === '[object ArrayBuffer]';\n};\n\nvar isPromise = function isPromise(val) {\n  var isTrue = false;\n\n  try {\n    isTrue = Object.prototype.toString.call(val) === '[object Promise]' || val && val.then && val[\"catch\"] && val[\"finally\"];\n  } catch (e) {\n    isTrue = false;\n  }\n\n  return isTrue;\n};\n\nvar getTypeName = function getTypeName(data) {\n  var typeName = Object.prototype.toString.call(data);\n  return typeName.substring(8, typeName.length - 1);\n};\n\nvar isEqual = function isEqual(source, target) {\n  return source === target;\n};\n\nvar ArrayBufferToArray = function ArrayBufferToArray(data) {\n  if (isArrayBuffer(data)) {\n    return [].slice.call(new Int8Array(data));\n  }\n\n  return data;\n};\n\nvar ArrayBufferToUint8Array = function ArrayBufferToUint8Array(data) {\n  if (isArrayBuffer(data)) {\n    return new Uint8Array(data);\n  }\n\n  return data;\n};\n\nvar forEach = function forEach(source, event, options) {\n  options = options || {};\n  event = event || noop;\n  var _options = options,\n      isReverse = _options.isReverse;\n\n  var loopObj = function loopObj() {\n    for (var key in source) {\n      event(source[key], key, source);\n    }\n  };\n\n  var loopArr = function loopArr() {\n    if (isReverse) {\n      for (var i = source.length - 1; i >= 0; i--) {\n        event(source[i], i);\n      }\n    } else {\n      for (var j = 0, len = source.length; j < len; j++) {\n        event(source[j], j);\n      }\n    }\n  };\n\n  if (isObject(source)) {\n    loopObj();\n  }\n\n  if (isArray(source) || isString(source)) {\n    loopArr();\n  }\n};\n\nvar isEmpty = function isEmpty(val) {\n  var result = true;\n\n  if (isObject(val)) {\n    forEach(val, function () {\n      result = false;\n    });\n  }\n\n  if (isString(val) || isArray(val)) {\n    result = val.length === 0;\n  }\n\n  if (isNumber(val)) {\n    result = val === 0;\n  }\n\n  return result;\n};\n\nvar isNumberData = function isNumberData(val) {\n  var isEmptyVal = isEmpty(val);\n  val = Number(val);\n  return isNumber(val) && !isEmptyVal;\n};\n\nvar getKeys = function getKeys(obj) {\n  var keyList = [];\n  forEach(obj, function (val, key) {\n    keyList.push(key);\n  });\n  return keyList;\n};\n\nvar getValues = function getValues(obj) {\n  var valList = [];\n  forEach(obj, function (val) {\n    valList.push(val);\n  });\n  return valList;\n};\n\nvar getTimestamp = function getTimestamp(time) {\n  return new Date(time).getTime();\n};\n\nvar getCurrentTimestamp = function getCurrentTimestamp() {\n  return new Date().getTime();\n};\n\nvar formatTime = function formatTime(timestamp, options) {\n  options = options || {};\n  var temp = options.temp;\n  var date = new Date(timestamp),\n      formateds = {};\n  formateds['YY'] = date.getFullYear();\n  formateds['MM'] = date.getMonth() + 1;\n  formateds['DD'] = date.getDate();\n  formateds['hh'] = date.getHours();\n  formateds['mm'] = date.getMinutes();\n  formateds['ss'] = date.getSeconds();\n  forEach(formateds, function (val, key) {\n    formateds[key] = val >= 10 ? val : '0' + val;\n  });\n\n  if (temp) {\n    var formatedText = temp;\n    forEach(formateds, function (val, key) {\n      formatedText = formatedText.replace(key, val);\n    });\n    return formatedText;\n  }\n\n  return formateds.YY + '-' + formateds.MM + '-' + formateds.DD + ' ' + formateds.hh + ':' + formateds.mm + ':' + formateds.ss;\n};\n\nvar isValidJSON = function isValidJSON(jsonStr) {\n  if (isObject(jsonStr)) {\n    return true;\n  }\n\n  var isValid = false;\n\n  try {\n    var obj = JSON$2.parse(jsonStr);\n    var str = JSON$2.stringify(obj);\n    isValid = str === jsonStr;\n  } catch (e) {\n    isValid = false;\n  }\n\n  return isValid;\n};\n\nvar isSupportSocket = function isSupportSocket() {\n  var isMini = env.isMini;\n\n  if (isMini) {\n    return true;\n  }\n\n  var Socket = global$7.WebSocket;\n\n  if (isUndefined(Socket)) {\n    return false;\n  }\n\n  var hasWS = false,\n      isIntegrity = false;\n\n  try {\n    hasWS = typeof Socket === 'object' || typeof Socket === 'function';\n    isIntegrity = typeof Socket.OPEN === 'number';\n  } catch (e) {}\n\n  return hasWS && isIntegrity;\n};\n\nvar indexOf = function indexOf(source, searchVal) {\n  if (source.indexOf) {\n    return source.indexOf(searchVal);\n  }\n\n  var index = -1;\n  forEach(source, function (sub, i) {\n    if (searchVal === sub) {\n      index = i;\n      return;\n    }\n  });\n  return index;\n};\n\nvar lastIndexOf = function lastIndexOf(source, searchVal) {\n  if (source.lastIndexOf) {\n    return source.lastIndexOf(searchVal);\n  }\n\n  var index = -1;\n  forEach(source, function (sub, i) {\n    if (searchVal === sub) {\n      index = i;\n      return;\n    }\n  }, {\n    isReverse: true\n  });\n  return index;\n};\n\nvar isInclude = function isInclude(source, searchVal) {\n  var index = indexOf(source, searchVal);\n  return index !== -1;\n};\n\nvar substring = function substring(source, start, end) {\n  return source.substring(start, end);\n};\n\nvar spliceByChild = function spliceByChild(arr, item) {\n  forEach(arr, function (child, index) {\n    if (isEqual(child, item)) {\n      arr.splice(index, 1);\n    }\n  }, {\n    isReverse: true\n  });\n};\n\nvar parse16To10 = function parse16To10(num) {\n  return parseInt(num, 16);\n};\n\nvar isPlus = function isPlus(num) {\n  return +num === num;\n};\n\nvar filter = function filter(source, event) {\n  var newArr = [];\n\n  for (var i = 0, max = source.length; i < max; i++) {\n    var data = source[i];\n\n    if (event(data, i)) {\n      newArr.push(data);\n    }\n  }\n\n  return newArr;\n};\n\nvar map = function map(source, event) {\n  forEach(source, function (item, index) {\n    source[index] = event(item, index);\n  });\n  return source;\n};\n\nvar extend = function extend(destination, sources) {\n  destination = destination || {};\n  sources = sources || {};\n\n  for (var key in sources) {\n    var value = sources[key];\n\n    if (!isUndefined(value)) {\n      destination[key] = value;\n    }\n  }\n\n  return destination;\n};\n\nvar extendInShallow = function extendInShallow(destination, sources) {\n  destination = destination || {};\n  sources = sources || {};\n  destination = copy(destination);\n  sources = copy(sources);\n  return extend(destination, sources);\n};\n\nvar deferred = function deferred(callbacks) {\n  return new Defer(callbacks);\n};\n\nvar deferTimeout = function deferTimeout(timeout) {\n  return deferred(function (resolve) {\n    var timeouter = setTimeout$1(function () {\n      resolve(timeouter);\n    }, timeout);\n  });\n};\n\nvar tplEngine = function tplEngine(temp, data, regexp) {\n  var replaceAction = function replaceAction(obj) {\n    return temp.replace(regexp || /{([^}]+)}/g, function (match, name) {\n      if (match.charAt(0) === '\\\\') {\n        return match.slice(1);\n      }\n\n      return obj[name] !== undefined ? obj[name] : '{' + name + '}';\n    });\n  };\n\n  if (!isArray(data)) {\n    data = [data];\n  }\n\n  var ret = [];\n  forEach(data, function (item) {\n    ret.push(replaceAction(item));\n  });\n  return ret.join('');\n};\n\nvar getRandomNum = function getRandomNum(max, min) {\n  min = min || 0;\n  var range = max - min,\n      random = Math.random();\n  return min + Math.round(random * range);\n};\n\nvar Timer = function () {\n  function Timer(options) {\n    this._timerId = void 0;\n    this._timerEvent = void 0;\n    this._timerClearEvent = void 0;\n    this.timeout = 0;\n    this.type = TIMER_TYPE.TIMEOUT;\n    this.status = TIMER_STATUS.PENNDING;\n    var self = this;\n    extend(self, options);\n    var type = self.type;\n    var isTimeout = type === TIMER_TYPE.TIMEOUT;\n\n    if (isTimeout) {\n      self._timerEvent = setTimeout$1;\n      self._timerClearEvent = clearTimeout$1;\n    } else {\n      self._timerEvent = setInterval$1;\n      self._timerClearEvent = clearInterval$1;\n    }\n\n    return self;\n  }\n\n  var _proto = Timer.prototype;\n\n  _proto.start = function start(event, options) {\n    options = options || {};\n    var self = this,\n        isTimeout = self.type === TIMER_TYPE.TIMEOUT;\n    var _options2 = options,\n        args = _options2.args,\n        thisArg = _options2.thisArg;\n    self.stop();\n    self._timerId = self._timerEvent.call(global$7, function () {\n      isTimeout && self.stop();\n\n      if (thisArg) {\n        event.apply(thisArg, args);\n      } else {\n        event(args);\n      }\n    }, self.timeout);\n    self.status = TIMER_STATUS.BUSY;\n  };\n\n  _proto.stop = function stop() {\n    var self = this;\n\n    if (self._timerId) {\n      self._timerClearEvent.call(global$7, self._timerId);\n\n      self.status = TIMER_STATUS.ENDING;\n    }\n  };\n\n  return Timer;\n}();\n\nvar DeferHandler = function () {\n  function DeferHandler(options) {\n    this._list = {};\n    this.timeout = IM_TIMEOUT;\n    extend(this, options);\n  }\n\n  var _proto2 = DeferHandler.prototype;\n\n  _proto2._isInvalid = function _isInvalid(id) {\n    var handlers = this._list[id];\n    return !isArray(handlers) || isEmpty(handlers);\n  };\n\n  _proto2._exec = function _exec(id, isError, data) {\n    var self = this;\n\n    if (self._isInvalid(id)) {\n      return;\n    }\n\n    var handlers = self._list[id],\n        handler = handlers[0];\n    isError ? handler.reject(data) : handler.resolve(data);\n    handlers.splice(0, 1);\n  };\n\n  _proto2.add = function add(id, defer, options) {\n    options = options || {};\n    var self = this;\n    var resolve = defer.resolve,\n        reject = defer.reject;\n    var timeout = options.timeout || self.timeout;\n\n    if (self._isInvalid(id)) {\n      self._list[id] = [];\n    }\n\n    var timer = new Timer({\n      timeout: timeout\n    });\n    timer.start(function () {\n      self.reject(id, ERROR_INFO.TIMEOUT.code);\n    });\n\n    self._list[id].push({\n      resolve: resolve,\n      reject: reject,\n      timer: timer\n    });\n  };\n\n  _proto2.resolve = function resolve(id, data) {\n    this._exec(id, false, data);\n  };\n\n  _proto2.reject = function reject(id, error) {\n    this._exec(id, true, error);\n  };\n\n  return DeferHandler;\n}();\n\nvar EventEmitter = function () {\n  function EventEmitter() {\n    this._events = void 0;\n    this._events = {};\n  }\n\n  var _proto3 = EventEmitter.prototype;\n\n  _proto3.on = function on(name, event) {\n    var _events = this._events[name] || [];\n\n    _events.push(event);\n\n    this._events[name] = _events;\n  };\n\n  _proto3.off = function off(name, offEvent) {\n    if (offEvent) {\n      var _events = this._events[name] || [];\n\n      spliceByChild(_events, offEvent);\n    } else {\n      delete this._events[name];\n    }\n  };\n\n  _proto3.emit = function emit(name, data, error) {\n    var _events = this._events[name];\n    forEach(_events, function (event) {\n      event(data, error);\n    });\n  };\n\n  _proto3.clear = function clear() {\n    this._events = {};\n  };\n\n  return EventEmitter;\n}();\n\nvar decodeURI = function decodeURI(uri) {\n  return global$7.decodeURIComponent(uri);\n};\n\nvar encodeURI = function encodeURI(uri) {\n  return global$7.encodeURIComponent(uri);\n};\n\nvar int64ToTimestamp = function int64ToTimestamp(obj) {\n  if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n    return obj;\n  }\n\n  var low = obj.low;\n\n  if (low < 0) {\n    low += 0xffffffff + 1;\n  }\n\n  low = low.toString(16);\n  var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n  return timestamp;\n};\n\nvar batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n  forEach(data, function (item, key) {\n    if (isObject(item)) {\n      data[key] = int64ToTimestamp(item);\n    }\n  });\n  return data;\n};\n\nvar Queue = function () {\n  function Queue(defaultConfig) {\n    this._isRunning = false;\n    this._list = [];\n    this._defaultConfig = void 0;\n    this._defaultConfig = defaultConfig;\n  }\n\n  var _proto4 = Queue.prototype;\n\n  _proto4.add = function add(params) {\n    params = params || this._defaultConfig;\n\n    this._list.push(params);\n\n    this.run();\n  };\n\n  _proto4.run = function run() {\n    var self = this;\n    var _isRunning = self._isRunning,\n        _list = self._list;\n    var isFinished = isEmpty(_list);\n\n    if (_isRunning || isFinished) {\n      return;\n    }\n\n    var firstItem = _list.splice(0, 1)[0];\n\n    var event = firstItem.event,\n        args = firstItem.args,\n        thisArg = firstItem.thisArg;\n\n    var next = function next() {\n      self._isRunning = false;\n      self.run();\n    };\n\n    if (!event) {\n      return next();\n    }\n\n    self._isRunning = true;\n    event.apply(thisArg, args)[\"finally\"](next);\n  };\n\n  return Queue;\n}();\n\nvar secondsToMilliseconds = function secondsToMilliseconds(seconds) {\n  return seconds * 1000;\n};\n\nvar request$3 = function request(url, options) {\n  options = options || {};\n  return deferred(function (resolve, reject) {\n    options = extend(options, {\n      url: url,\n      success: function success(responseText, xhr, status) {\n        resolve({\n          responseText: responseText,\n          xhr: xhr,\n          status: status\n        });\n      },\n      fail: function fail(result, xhr, status) {\n        reject({\n          result: result,\n          xhr: xhr,\n          status: status\n        });\n      }\n    });\n    request$2(options);\n  });\n};\n\nvar requestByUrlList = function requestByUrlList(urlList, options) {\n  if (isEmpty(urlList)) {\n    return Defer.reject();\n  }\n\n  var url = urlList[0];\n  return request$3(url, options).then(function (result) {\n    result = result || {};\n    result.urlList = urlList;\n    return result;\n  })[\"catch\"](function (error) {\n    urlList.splice(0, 1);\n\n    if (isEmpty(urlList)) {\n      return Defer.reject(error);\n    } else {\n      return requestByUrlList(urlList, options);\n    }\n  });\n};\n\nvar requestForFaster = function requestForFaster(urlList, option) {\n  option = option || {};\n  var timeInterval = option.timeInterval || 0;\n  var faildCount = 0,\n      totalCount = urlList.length;\n  var requestXhrs = [];\n  var totalTimer = new Timer({\n    timeout: 15 * 1000\n  });\n  var reqCountdownTimers = [];\n\n  var clearAll = function clearAll() {\n    forEach(reqCountdownTimers, function (timer) {\n      timer.stop();\n    });\n    forEach(requestXhrs, function (xhr) {\n      xhr.abort();\n    });\n    reqCountdownTimers.length = 0;\n    requestXhrs.length = 0;\n  };\n\n  var isAllFaild = function isAllFaild() {\n    return faildCount === totalCount;\n  };\n\n  return deferred(function (resolve, reject) {\n    var _success = function success(url, index) {\n      clearAll();\n      resolve({\n        url: url,\n        index: index\n      });\n    };\n\n    var _fail = function fail() {\n      clearAll();\n      reject();\n    };\n\n    forEach(urlList, function (url, index) {\n      var timer = new Timer({\n        timeout: timeInterval * index\n      });\n      timer.start(function () {\n        var xhr;\n        var opt = extend({\n          url: url,\n          success: function success() {\n            _success(url, index);\n          },\n          fail: function fail() {\n            faildCount++;\n            isAllFaild() && _fail();\n          }\n        }, option);\n        xhr = request$2(opt);\n        requestXhrs.push(xhr);\n      });\n      reqCountdownTimers.push(timer);\n    });\n    totalTimer.start(_fail);\n  });\n};\n\nvar NetworkDetecter = function () {\n  function NetworkDetecter(option) {\n    this._option = void 0;\n    this._detectCount = 0;\n    this._timeoutId = void 0;\n    this._option = option;\n  }\n\n  var _proto5 = NetworkDetecter.prototype;\n\n  _proto5._detect = function _detect() {\n    var self = this;\n    var _detectCount = self._detectCount,\n        _option = self._option;\n    var url = _option.url,\n        timeout = _option.intervalTime,\n        max = _option.max;\n    _detectCount++;\n    return request$3(url).then(function () {\n      return;\n    }, function (_ref) {\n      var status = _ref.status;\n\n      if (isEqual(status, 404)) {\n        return;\n      }\n\n      var isAlreadyMax = max && isEqual(max, _detectCount);\n\n      if (isAlreadyMax) {\n        return Defer.reject();\n      }\n\n      return deferTimeout(timeout).then(function (timeoutId) {\n        self._detectCount = _detectCount;\n        self._timeoutId = timeoutId;\n        return self._detect();\n      });\n    });\n  };\n\n  _proto5.start = function start() {\n    return this._detect();\n  };\n\n  _proto5.stop = function stop() {\n    var timeoutId = this._timeoutId;\n\n    if (timeoutId) {\n      clearTimeout$1(timeoutId);\n    }\n  };\n\n  return NetworkDetecter;\n}();\n\nvar toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n  if (isUndefined(startIndex) || isUndefined(endIndex)) {\n    return str.toUpperCase();\n  }\n\n  var sliceStr = str.slice(startIndex, endIndex);\n  str = str.replace(sliceStr, function (text) {\n    return text.toUpperCase();\n  });\n  return str;\n};\n\nvar getDomainByUrl = function getDomainByUrl(url) {\n  var StartMark = '://',\n      EndMark = '/';\n  var urlProtocolIndex = indexOf(url, StartMark);\n  var hasProtocol = urlProtocolIndex > -1;\n\n  if (hasProtocol) {\n    urlProtocolIndex = urlProtocolIndex + StartMark.length;\n    url = substring(url, urlProtocolIndex, url.length);\n  }\n\n  var urlPathIndex = indexOf(url, EndMark);\n  var hasPath = urlPathIndex > -1;\n\n  if (hasPath) {\n    url = substring(url, 0, urlPathIndex);\n  }\n\n  return url;\n};\n\nvar getValidUrl = function getValidUrl(url, option) {\n  option = option || {};\n  var ProtocolMark = '://';\n  var hasProtocol = isInclude(url, ProtocolMark);\n  var localProtocol = env.protocol.http;\n  var _option2 = option,\n      protocol = _option2.protocol;\n\n  if (protocol) {\n    var domain = getDomainByUrl(url);\n    url = protocol + \"//\" + domain;\n  }\n\n  if (hasProtocol) {\n    var urlProtocolIndex = indexOf(url, ProtocolMark) + 1;\n    var urlProtocol = substring(url, 0, urlProtocolIndex);\n    var isHttpUrl = urlProtocol === HTTP_PROTOCOL.HTTP;\n    var isLocalHttps = localProtocol === HTTP_PROTOCOL.HTTPS;\n\n    if (isHttpUrl && isLocalHttps) {\n      var _domain = getDomainByUrl(url);\n\n      return HTTP_PROTOCOL.HTTPS + \"//\" + _domain;\n    } else {\n      return url;\n    }\n  } else {\n    return localProtocol + \"//\" + url;\n  }\n};\n\nvar quickSort = function quickSort(arr, event) {\n  var sort = function sort(array, left, right, event) {\n    event = event || function (a, b) {\n      return a <= b;\n    };\n\n    if (left < right) {\n      var x = array[right],\n          i = left - 1,\n          temp;\n\n      for (var j = left; j <= right; j++) {\n        if (event(array[j], x)) {\n          i++;\n          temp = array[i];\n          array[i] = array[j];\n          array[j] = temp;\n        }\n      }\n\n      sort(array, left, i - 1, event);\n      sort(array, i + 1, right, event);\n    }\n\n    return array;\n  };\n\n  return sort(arr, 0, arr.length - 1, event);\n};\n\nvar unique = function unique(arr, event) {\n  var keyEvent = event || function (data) {\n    return data;\n  };\n\n  var hashTable = {};\n  var newArr = [];\n  forEach(arr, function (data) {\n    var key = keyEvent(data);\n\n    if (!hashTable[key]) {\n      hashTable[key] = true;\n      newArr.push(data);\n    }\n  });\n  return newArr;\n};\n\nvar consoleError = function consoleError() {\n  var _console;\n\n  return (_console = console).error.apply(_console, arguments);\n};\n\nvar utils = {\n  Storage: storage$1,\n  Socket: Socket$2,\n  Cache: CacheStorage,\n  JSON: JSON$2,\n  Defer: Defer,\n  httpRequest: request$2,\n  request: request$3,\n  requestByUrlList: requestByUrlList,\n  requestForFaster: requestForFaster,\n  md5: md5,\n  DeferHandler: DeferHandler,\n  EventEmitter: EventEmitter,\n  Timer: Timer,\n  Queue: Queue,\n  consoleError: consoleError,\n  noop: noop,\n  deferNoop: deferNoop,\n  setTimeout: setTimeout$1,\n  toJSON: toJSON,\n  parseJSON: parseJSON,\n  copy: copy,\n  isObject: isObject,\n  isArray: isArray,\n  isFunction: isFunction,\n  isArrayBuffer: isArrayBuffer,\n  isString: isString,\n  isBoolean: isBoolean,\n  isUndefined: isUndefined,\n  isNull: isNull,\n  isNumber: isNumber,\n  isNumberData: isNumberData,\n  isPromise: isPromise,\n  getTypeName: getTypeName,\n  isPlus: isPlus,\n  isEmpty: isEmpty,\n  isEqual: isEqual,\n  isValidJSON: isValidJSON,\n  isSupportSocket: isSupportSocket,\n  ArrayBufferToArray: ArrayBufferToArray,\n  ArrayBufferToUint8Array: ArrayBufferToUint8Array,\n  indexOf: indexOf,\n  lastIndexOf: lastIndexOf,\n  isInclude: isInclude,\n  substring: substring,\n  getKeys: getKeys,\n  getValues: getValues,\n  getTimestamp: getTimestamp,\n  getCurrentTimestamp: getCurrentTimestamp,\n  formatTime: formatTime,\n  parse16To10: parse16To10,\n  forEach: forEach,\n  map: map,\n  filter: filter,\n  extend: extend,\n  extendInShallow: extendInShallow,\n  deferred: deferred,\n  tplEngine: tplEngine,\n  getRandomNum: getRandomNum,\n  int64ToTimestamp: int64ToTimestamp,\n  batchInt64ToTimestamp: batchInt64ToTimestamp,\n  encodeURI: encodeURI,\n  decodeURI: decodeURI,\n  secondsToMilliseconds: secondsToMilliseconds,\n  NetworkDetecter: NetworkDetecter,\n  toUpperCase: toUpperCase,\n  getDomainByUrl: getDomainByUrl,\n  getValidUrl: getValidUrl,\n  quickSort: quickSort,\n  unique: unique\n};\n\nfunction _inheritsLoose(subClass, superClass) {\n  subClass.prototype = Object.create(superClass.prototype);\n  subClass.prototype.constructor = subClass;\n  subClass.__proto__ = superClass;\n}\n\nvar _PUBLISH_TOPIC_TO_CON, _CONVERSATION_TYPE_TO, _CONVERSATION_TYPE_TO2, _CONVERSATION_TYPE_TO3, _CONVERSATION_TYPE_TO4;\nvar SUCCESS_CODE = 0;\nvar PULL_MSG_TYPE = {\n  NORMAL: 1,\n  CHATROOM: 2\n};\nvar MESSAGE_NAME = {\n  CONN_ACK: 'ConnAckMessage',\n  DISCONNECT: 'DisconnectMessage',\n  PING_REQ: 'PingReqMessage',\n  PING_RESP: 'PingRespMessage',\n  PUBLISH: 'PublishMessage',\n  PUB_ACK: 'PubAckMessage',\n  QUERY: 'QueryMessage',\n  QUERY_CON: 'QueryConMessage',\n  QUERY_ACK: 'QueryAckMessage'\n};\nvar QOS = {\n  AT_MOST_ONCE: 0,\n  AT_LEAST_ONCE: 1,\n  EXACTLY_ONCE: 2,\n  DEFAULT: 3,\n  '0': 'AT_MOST_ONCE',\n  '1': 'AT_LEAST_ONCE',\n  '2': 'EXACTLY_ONCE',\n  '3': 'DEFAULT'\n};\nvar OPERATE_TYPE = {\n  CONNECT: 1,\n  '1': 'CONNECT',\n  CONNACK: 2,\n  '2': 'CONNACK',\n  PUBLISH: 3,\n  '3': 'PUBLISH',\n  PUBACK: 4,\n  '4': 'PUBACK',\n  QUERY: 5,\n  '5': 'QUERY',\n  QUERYACK: 6,\n  '6': 'QUERYACK',\n  QUERYCON: 7,\n  '7': 'QUERYCON',\n  SUBSCRIBE: 8,\n  '8': 'SUBSCRIBE',\n  SUBACK: 9,\n  '9': 'SUBACK',\n  UNSUBSCRIBE: 10,\n  '10': 'UNSUBSCRIBE',\n  UNSUBACK: 11,\n  '11': 'UNSUBACK',\n  PINGREQ: 12,\n  '12': 'PINGREQ',\n  PINGRESP: 13,\n  '13': 'PINGRESP',\n  DISCONNECT: 14,\n  '14': 'DISCONNECT'\n};\nvar MESSAGE_TAG = {\n  NONE: 0,\n  PERSIT_ONLY: 1,\n  COUNT_ONLY: 2,\n  PERSIT_AND_COUNT: 3\n};\nvar PUBLISH_TOPIC = {\n  PRIVATE: 'ppMsgP',\n  GROUP: 'pgMsgP',\n  CHATROOM: 'chatMsg',\n  CUSTOMER_SERVICE: 'pcMsgP',\n  RECALL: 'recallMsg',\n  NOTIFY_PULL_MSG: 's_ntf',\n  RECEIVE_MSG: 's_msg',\n  SYNC_STATUS: 's_stat',\n  SYNC_CHRM_KV: 's_cmd'\n};\nvar PUBLISH_STATUS_TOPIC = {\n  PRIVATE: 'ppMsgS',\n  GROUP: 'pgMsgS'\n};\nvar QUERY_TOPIC = {\n  GET_SYNC_TIME: 'qrySessionsAtt',\n  PULL_MSG: 'pullMsg',\n  GET_CONVERSATION_LIST: 'qrySessions',\n  REMOVE_CONVERSATION_LIST: 'delSessions',\n  DELETE_MESSAGES: 'delMsg',\n  CLEAR_UNREAD_COUNT: 'updRRTime',\n  PULL_CHRM_MSG: 'chrmPull',\n  JOIN_CHATROOM: 'joinChrm',\n  QUIT_CHATROOM: 'exitChrm',\n  GET_CHATROOM_INFO: 'queryChrmI',\n  GET_OLD_CONVERSATION_LIST: 'qryRelation',\n  REMOVE_OLD_CONVERSATION: 'delRelation',\n  GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n  GET_UPLOAD_FILE_URL: 'qnUrl',\n  CLEAR_MESSAGES: {\n    PRIVATE: 'cleanPMsg',\n    GROUP: 'cleanGMsg',\n    CUSTOMER_SERVICE: 'cleanCMsg',\n    SYSTEM: 'cleanSMsg'\n  },\n  JOIN_RTC_ROOM: 'rtcRJoin_data',\n  QUIT_RTC_ROOM: 'rtcRExit',\n  PING_RTC: 'rtcPing',\n  SET_RTC_DATA: 'rtcSetData',\n  GET_RTC_DATA: 'rtcQryData',\n  DEL_RTC_DATA: 'rtcDelData',\n  SET_RTC_OUT_DATA: 'rtcSetOutData',\n  GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n  GET_RTC_TOKEN: 'rtcToken',\n  SET_RTC_STATE: 'rtcUserState',\n  GET_RTC_ROOM_INFO: 'rtcRInfo',\n  GET_RTC_USER_INFO_LIST: 'rtcUData',\n  SET_RTC_USER_INFO: 'rtcUPut',\n  DEL_RTC_USER_INFO: 'rtcUDel',\n  GET_RTC_USER_LIST: 'rtcUList'\n};\nvar QUERY_HISTORY_TOPIC = {\n  PRIVATE: 'qryPMsg',\n  GROUP: 'qryGMsg',\n  CHATROOM: 'qryCHMsg',\n  CUSTOMER_SERVICE: 'qryCMsg',\n  SYSTEM: 'qrySMsg'\n};\nvar PUBLISH_TOPIC_TO_CONVERSATION_TYPE = (_PUBLISH_TOPIC_TO_CON = {}, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CUSTOMER_SERVICE] = CONVERSATION_TYPE.CUSTOMER_SERVICE, _PUBLISH_TOPIC_TO_CON);\nvar CONVERSATION_TYPE_TO_PUBLISH_TOPIC = (_CONVERSATION_TYPE_TO = {}, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.PRIVATE] = PUBLISH_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.GROUP] = PUBLISH_TOPIC.GROUP, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CHATROOM] = PUBLISH_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CUSTOMER_SERVICE] = PUBLISH_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO);\nvar CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC = (_CONVERSATION_TYPE_TO2 = {}, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.PRIVATE] = PUBLISH_STATUS_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.GROUP] = PUBLISH_STATUS_TOPIC.GROUP, _CONVERSATION_TYPE_TO2);\nvar CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC = (_CONVERSATION_TYPE_TO3 = {}, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.PRIVATE] = QUERY_HISTORY_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.GROUP] = QUERY_HISTORY_TOPIC.GROUP, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CHATROOM] = QUERY_HISTORY_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_HISTORY_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.SYSTEM] = QUERY_HISTORY_TOPIC.SYSTEM, _CONVERSATION_TYPE_TO3);\nvar CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC = (_CONVERSATION_TYPE_TO4 = {}, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.PRIVATE] = QUERY_TOPIC.CLEAR_MESSAGES.PRIVATE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.GROUP] = QUERY_TOPIC.CLEAR_MESSAGES.GROUP, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_TOPIC.CLEAR_MESSAGES.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.SYSTEM] = QUERY_TOPIC.CLEAR_MESSAGES.SYSTEM, _CONVERSATION_TYPE_TO4);\n\nvar Header = function () {\n  function Header(_type, _retain, _qos, _dup) {\n    this.type = void 0;\n    this.retain = false;\n    this.qos = QOS.AT_LEAST_ONCE;\n    this.dup = false;\n    this.syncMsg = false;\n    var isPlusType = utils.isPlus(_type);\n\n    if (_type && isPlusType && arguments.length === 1) {\n      this.retain = (_type & 1) > 0;\n      this.qos = (_type & 6) >> 1;\n      this.dup = (_type & 8) > 0;\n      this.type = _type >> 4 & 15;\n      this.syncMsg = (_type & 8) === 8;\n    } else {\n      this.type = _type;\n      this.retain = _retain === undefined ? false : _retain;\n      this.qos = _qos === undefined ? QOS.AT_LEAST_ONCE : _qos;\n      this.dup = _dup === undefined ? false : _dup;\n    }\n  }\n\n  var _proto = Header.prototype;\n\n  _proto.encode = function encode() {\n    var self = this;\n    var validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT];\n    utils.forEach(validQosList, function (qos) {\n      if (self.qos === QOS[qos]) {\n        self.qos = qos;\n      }\n    });\n\n    var _byte = self.type << 4;\n\n    _byte |= self.retain ? 1 : 0;\n    _byte |= self.qos << 1;\n    _byte |= self.dup ? 8 : 0;\n    return _byte;\n  };\n\n  return Header;\n}();\n\nvar BinaryHelper = {\n  writeUTF: function writeUTF(str, isGetBytes) {\n    var back = [],\n        byteSize = 0;\n    utils.forEach(str, function (_char, i) {\n      var code = str.charCodeAt(i);\n\n      if (code >= 0 && code <= 127) {\n        byteSize += 1;\n        back.push(code);\n      } else if (code >= 128 && code <= 2047) {\n        byteSize += 2;\n        back.push(192 | 31 & code >> 6);\n        back.push(128 | 63 & code);\n      } else if (code >= 2048 && code <= 65535) {\n        byteSize += 3;\n        back.push(224 | 15 & code >> 12);\n        back.push(128 | 63 & code >> 6);\n        back.push(128 | 63 & code);\n      }\n    });\n    utils.forEach(back, function (_char2, i) {\n      if (_char2 > 255) {\n        back[i] &= 255;\n      }\n    });\n\n    if (isGetBytes) {\n      return back;\n    }\n\n    if (byteSize <= 255) {\n      return [0, byteSize].concat(back);\n    } else {\n      return [byteSize >> 8, byteSize & 255].concat(back);\n    }\n  },\n  readUTF: function readUTF(arr) {\n    var UTF = '';\n\n    for (var i = 0, len = arr.length; i < len; i++) {\n      var _char3 = arr[i];\n\n      if (_char3 < 0) {\n        arr[i] += 256;\n      }\n\n      var one = arr[i].toString(2),\n          v = one.match(/^1+?(?=0)/);\n\n      if (v && one.length === 8) {\n        var bytesLength = v[0].length,\n            store = '';\n\n        for (var st = 0; st < bytesLength; st++) {\n          store += arr[st + i].toString(2).slice(2);\n        }\n\n        UTF += String.fromCharCode(parseInt(store, 2));\n        i += bytesLength - 1;\n      } else {\n        UTF += String.fromCharCode(arr[i]);\n      }\n    }\n\n    return UTF;\n  }\n};\n\nvar RongStreamReader = function () {\n  function RongStreamReader(arr) {\n    this.pool = void 0;\n    this.position = 0;\n    this.poolLen = 0;\n    this.pool = arr;\n    this.poolLen = arr.length;\n  }\n\n  var _proto2 = RongStreamReader.prototype;\n\n  _proto2.check = function check() {\n    return this.position >= this.pool.length;\n  };\n\n  _proto2.readInt = function readInt() {\n    var self = this;\n\n    if (self.check()) {\n      return -1;\n    }\n\n    var end = '';\n\n    for (var i = 0; i < 4; i++) {\n      var t = self.pool[self.position++].toString(16);\n\n      if (t.length === 1) {\n        t = '0' + t;\n      }\n\n      end += t.toString();\n    }\n\n    return utils.parse16To10(end);\n  };\n\n  _proto2.readLong = function readLong() {\n    var self = this;\n\n    if (self.check()) {\n      return -1;\n    }\n\n    var end = '';\n\n    for (var i = 0; i < 8; i++) {\n      var t = self.pool[self.position++].toString(16);\n\n      if (t.length === 1) {\n        t = '0' + t;\n      }\n\n      end += t;\n    }\n\n    return utils.parse16To10(end);\n  };\n\n  _proto2.readByte = function readByte() {\n    if (this.check()) {\n      return -1;\n    }\n\n    var val = this.pool[this.position++];\n\n    if (val > 255) {\n      val &= 255;\n    }\n\n    return val;\n  };\n\n  _proto2.readUTF = function readUTF() {\n    if (this.check()) {\n      return '';\n    }\n\n    var big = this.readByte() << 8 | this.readByte();\n    var pool = this.pool.subarray(this.position, this.position += big);\n    return BinaryHelper.readUTF(pool);\n  };\n\n  _proto2.readAll = function readAll() {\n    return this.pool.subarray(this.position, this.poolLen);\n  };\n\n  return RongStreamReader;\n}();\n\nvar RongStreamWriter = function () {\n  function RongStreamWriter() {\n    this.pool = [];\n    this.position = 0;\n    this.writen = 0;\n  }\n\n  var _proto3 = RongStreamWriter.prototype;\n\n  _proto3.write = function write(_byte2) {\n    if (utils.isArray(_byte2)) {\n      this.pool = this.pool.concat(_byte2);\n    } else if (utils.isPlus(_byte2)) {\n      if (_byte2 > 255) {\n        _byte2 &= 255;\n      }\n\n      this.pool.push(_byte2);\n      this.writen++;\n    }\n\n    return _byte2;\n  };\n\n  _proto3.writeArr = function writeArr(_byte3) {\n    this.pool = this.pool.concat(_byte3);\n    return _byte3;\n  };\n\n  _proto3.writeUTF = function writeUTF(str) {\n    var val = BinaryHelper.writeUTF(str);\n    this.pool = this.pool.concat(val);\n    this.writen += val.length;\n  };\n\n  _proto3.getBytesArray = function getBytesArray() {\n    return this.pool;\n  };\n\n  return RongStreamWriter;\n}();\n\nvar IDENTIFIER = {\n  PUB: 'pub',\n  QUERY: 'qry'\n};\n\nvar _getIdentifier = function getIdentifier(messageId, identifier) {\n  if (messageId && identifier) {\n    return identifier + '_' + messageId;\n  } else if (messageId) {\n    return messageId;\n  } else {\n    return utils.getCurrentTimestamp();\n  }\n};\n\nvar BaseReader = function () {\n  function BaseReader(header) {\n    this._name = void 0;\n    this._header = void 0;\n    this.lengthSize = 0;\n    this.messageId = void 0;\n    this.timestamp = void 0;\n    this.identifier = void 0;\n    this._header = header;\n  }\n\n  var _proto = BaseReader.prototype;\n\n  _proto.getIdentifier = function getIdentifier() {\n    var messageId = this.messageId,\n        identifier = this.identifier;\n    return _getIdentifier(messageId, identifier);\n  };\n\n  _proto.read = function read(stream, length) {\n    this.readMessage(stream, length);\n  };\n\n  _proto.readMessage = function readMessage(stream, length) {\n    return {\n      stream: stream,\n      length: length\n    };\n  };\n\n  return BaseReader;\n}();\n\nvar BaseWriter = function () {\n  function BaseWriter(headerType) {\n    this._header = void 0;\n    this.lengthSize = 0;\n    this.data = void 0;\n    this.messageId = void 0;\n    this.topic = void 0;\n    this.targetId = void 0;\n    this.identifier = void 0;\n    this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n  }\n\n  var _proto2 = BaseWriter.prototype;\n\n  _proto2.getIdentifier = function getIdentifier() {\n    var messageId = this.messageId,\n        identifier = this.identifier;\n    return _getIdentifier(messageId, identifier);\n  };\n\n  _proto2.write = function write(stream) {\n    var headerCode = this.getHeaderFlag();\n    stream.write(headerCode);\n    this.writeMessage(stream);\n  };\n\n  _proto2.writeMessage = function writeMessage(stream) {\n    return stream;\n  };\n\n  _proto2.setHeaderQos = function setHeaderQos(qos) {\n    this._header.qos = qos;\n  };\n\n  _proto2.getHeaderFlag = function getHeaderFlag() {\n    return this._header.encode();\n  };\n\n  _proto2.getLengthSize = function getLengthSize() {\n    return this.lengthSize;\n  };\n\n  _proto2.getBufferData = function getBufferData() {\n    var stream = new RongStreamWriter();\n    this.write(stream);\n    var val = stream.getBytesArray();\n    var binary = new Int8Array(val);\n    return binary;\n  };\n\n  _proto2.getCometData = function getCometData() {\n    var data = this.data || {};\n    return utils.toJSON(data);\n  };\n\n  return BaseWriter;\n}();\n\nvar ConnAckReader = function (_BaseReader) {\n  _inheritsLoose(ConnAckReader, _BaseReader);\n\n  function ConnAckReader() {\n    var _this;\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    _this = _BaseReader.call.apply(_BaseReader, [this].concat(args)) || this;\n    _this._name = MESSAGE_NAME.CONN_ACK;\n    _this.status = void 0;\n    _this.userId = void 0;\n    _this.timestamp = void 0;\n    return _this;\n  }\n\n  var _proto3 = ConnAckReader.prototype;\n\n  _proto3.readMessage = function readMessage(stream, msgLength) {\n    stream.readByte();\n    this.status = +stream.readByte();\n\n    if (msgLength > ConnAckReader.MESSAGE_LENGTH) {\n      this.userId = stream.readUTF();\n      stream.readUTF();\n      this.timestamp = stream.readLong();\n    }\n  };\n\n  return ConnAckReader;\n}(BaseReader);\n\nConnAckReader.MESSAGE_LENGTH = 2;\n\nvar DisconnectReader = function (_BaseReader2) {\n  _inheritsLoose(DisconnectReader, _BaseReader2);\n\n  function DisconnectReader() {\n    var _this2;\n\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n\n    _this2 = _BaseReader2.call.apply(_BaseReader2, [this].concat(args)) || this;\n    _this2._name = MESSAGE_NAME.DISCONNECT;\n    _this2.status = void 0;\n    return _this2;\n  }\n\n  var _proto4 = DisconnectReader.prototype;\n\n  _proto4.readMessage = function readMessage(stream) {\n    stream.readByte();\n    this.status = +stream.readByte();\n  };\n\n  return DisconnectReader;\n}(BaseReader);\n\nDisconnectReader.MESSAGE_LENGTH = 2;\n\nvar PingReqWriter = function (_BaseWriter) {\n  _inheritsLoose(PingReqWriter, _BaseWriter);\n\n  function PingReqWriter() {\n    var _this3;\n\n    _this3 = _BaseWriter.call(this, OPERATE_TYPE.PINGREQ) || this;\n    _this3._name = MESSAGE_NAME.PING_REQ;\n    return _this3;\n  }\n\n  return PingReqWriter;\n}(BaseWriter);\n\nvar PingRespReader = function (_BaseReader3) {\n  _inheritsLoose(PingRespReader, _BaseReader3);\n\n  function PingRespReader() {\n    var _this4;\n\n    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n      args[_key3] = arguments[_key3];\n    }\n\n    _this4 = _BaseReader3.call.apply(_BaseReader3, [this].concat(args)) || this;\n    _this4._name = MESSAGE_NAME.PING_RESP;\n    return _this4;\n  }\n\n  return PingRespReader;\n}(BaseReader);\n\nvar RetryableReader = function (_BaseReader4) {\n  _inheritsLoose(RetryableReader, _BaseReader4);\n\n  function RetryableReader() {\n    var _this5;\n\n    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n      args[_key4] = arguments[_key4];\n    }\n\n    _this5 = _BaseReader4.call.apply(_BaseReader4, [this].concat(args)) || this;\n    _this5.messageId = void 0;\n    return _this5;\n  }\n\n  var _proto5 = RetryableReader.prototype;\n\n  _proto5.readMessage = function readMessage(stream) {\n    var msgId = stream.readByte() * 256 + stream.readByte();\n    this.messageId = parseInt(msgId, 10);\n  };\n\n  return RetryableReader;\n}(BaseReader);\n\nvar RetryableWriter = function (_BaseWriter2) {\n  _inheritsLoose(RetryableWriter, _BaseWriter2);\n\n  function RetryableWriter() {\n    var _this6;\n\n    for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n      args[_key5] = arguments[_key5];\n    }\n\n    _this6 = _BaseWriter2.call.apply(_BaseWriter2, [this].concat(args)) || this;\n    _this6.messageId = void 0;\n    return _this6;\n  }\n\n  var _proto6 = RetryableWriter.prototype;\n\n  _proto6.writeMessage = function writeMessage(stream) {\n    var id = this.messageId;\n    var lsb = id & 255;\n    var msb = (id & 65280) >> 8;\n    stream.write(msb);\n    stream.write(lsb);\n  };\n\n  return RetryableWriter;\n}(BaseWriter);\n\nvar PublishReader = function (_RetryableReader) {\n  _inheritsLoose(PublishReader, _RetryableReader);\n\n  function PublishReader() {\n    var _this7;\n\n    for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n      args[_key6] = arguments[_key6];\n    }\n\n    _this7 = _RetryableReader.call.apply(_RetryableReader, [this].concat(args)) || this;\n    _this7._name = MESSAGE_NAME.PUBLISH;\n    _this7.topic = void 0;\n    _this7.data = void 0;\n    _this7.targetId = void 0;\n    _this7.date = void 0;\n    _this7.syncMsg = false;\n    _this7.identifier = IDENTIFIER.PUB;\n    return _this7;\n  }\n\n  var _proto7 = PublishReader.prototype;\n\n  _proto7.readMessage = function readMessage(stream) {\n    this.date = stream.readInt();\n    this.topic = stream.readUTF();\n    this.targetId = stream.readUTF();\n    RetryableReader.prototype.readMessage.apply(this, arguments);\n    this.data = stream.readAll();\n  };\n\n  return PublishReader;\n}(RetryableReader);\n\nvar PublishWriter = function (_RetryableWriter) {\n  _inheritsLoose(PublishWriter, _RetryableWriter);\n\n  function PublishWriter(topic, data, targetId) {\n    var _this8;\n\n    _this8 = _RetryableWriter.call(this, OPERATE_TYPE.PUBLISH) || this;\n    _this8._name = MESSAGE_NAME.PUBLISH;\n    _this8.topic = void 0;\n    _this8.data = void 0;\n    _this8.targetId = void 0;\n    _this8.date = void 0;\n    _this8.syncMsg = false;\n    _this8.identifier = IDENTIFIER.PUB;\n    _this8.topic = topic;\n    _this8.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n    _this8.targetId = targetId;\n    return _this8;\n  }\n\n  var _proto8 = PublishWriter.prototype;\n\n  _proto8.writeMessage = function writeMessage(stream) {\n    stream.writeUTF(this.topic);\n    stream.writeUTF(this.targetId);\n    RetryableWriter.prototype.writeMessage.apply(this, arguments);\n    stream.write(this.data);\n  };\n\n  return PublishWriter;\n}(RetryableWriter);\n\nvar PubAckReader = function (_RetryableReader2) {\n  _inheritsLoose(PubAckReader, _RetryableReader2);\n\n  function PubAckReader() {\n    var _this9;\n\n    for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n      args[_key7] = arguments[_key7];\n    }\n\n    _this9 = _RetryableReader2.call.apply(_RetryableReader2, [this].concat(args)) || this;\n    _this9._name = MESSAGE_NAME.PUB_ACK;\n    _this9.status = void 0;\n    _this9.date = 0;\n    _this9.data = void 0;\n    _this9.millisecond = 0;\n    _this9.messageUId = void 0;\n    _this9.timestamp = 0;\n    _this9.identifier = IDENTIFIER.PUB;\n    return _this9;\n  }\n\n  var _proto9 = PubAckReader.prototype;\n\n  _proto9.readMessage = function readMessage(stream) {\n    RetryableReader.prototype.readMessage.call(this, stream);\n    this.date = stream.readInt();\n    this.status = stream.readByte() * 256 + stream.readByte();\n    this.millisecond = stream.readByte() * 256 + stream.readByte();\n    this.timestamp = this.date * 1000 + this.millisecond;\n    this.messageUId = stream.readUTF();\n  };\n\n  return PubAckReader;\n}(RetryableReader);\n\nvar PubAckWriter = function (_RetryableWriter2) {\n  _inheritsLoose(PubAckWriter, _RetryableWriter2);\n\n  function PubAckWriter(messageId) {\n    var _this10;\n\n    _this10 = _RetryableWriter2.call(this, OPERATE_TYPE.PUBACK) || this;\n    _this10._name = MESSAGE_NAME.PUB_ACK;\n    _this10.status = void 0;\n    _this10.date = 0;\n    _this10.millisecond = 0;\n    _this10.messageUId = void 0;\n    _this10.timestamp = 0;\n    _this10.messageId = messageId;\n    return _this10;\n  }\n\n  var _proto10 = PubAckWriter.prototype;\n\n  _proto10.writeMessage = function writeMessage(stream) {\n    RetryableWriter.prototype.writeMessage.call(this, stream);\n  };\n\n  return PubAckWriter;\n}(RetryableWriter);\n\nvar QueryWriter = function (_RetryableWriter3) {\n  _inheritsLoose(QueryWriter, _RetryableWriter3);\n\n  function QueryWriter(topic, data, targetId) {\n    var _this11;\n\n    _this11 = _RetryableWriter3.call(this, OPERATE_TYPE.QUERY) || this;\n    _this11._name = MESSAGE_NAME.QUERY;\n    _this11.topic = void 0;\n    _this11.data = void 0;\n    _this11.targetId = void 0;\n    _this11.identifier = IDENTIFIER.QUERY;\n    _this11.topic = topic;\n    _this11.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n    _this11.targetId = targetId;\n    return _this11;\n  }\n\n  var _proto11 = QueryWriter.prototype;\n\n  _proto11.writeMessage = function writeMessage(stream) {\n    stream.writeUTF(this.topic);\n    stream.writeUTF(this.targetId);\n    RetryableWriter.prototype.writeMessage.call(this, stream);\n    stream.write(this.data);\n  };\n\n  return QueryWriter;\n}(RetryableWriter);\n\nvar QueryConWriter = function (_RetryableWriter4) {\n  _inheritsLoose(QueryConWriter, _RetryableWriter4);\n\n  function QueryConWriter(messageId) {\n    var _this12;\n\n    _this12 = _RetryableWriter4.call(this, OPERATE_TYPE.QUERYCON) || this;\n    _this12._name = MESSAGE_NAME.QUERY_CON;\n    _this12.messageId = messageId;\n    return _this12;\n  }\n\n  return QueryConWriter;\n}(RetryableWriter);\n\nvar QueryAckReader = function (_RetryableReader3) {\n  _inheritsLoose(QueryAckReader, _RetryableReader3);\n\n  function QueryAckReader() {\n    var _this13;\n\n    for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n      args[_key8] = arguments[_key8];\n    }\n\n    _this13 = _RetryableReader3.call.apply(_RetryableReader3, [this].concat(args)) || this;\n    _this13._name = MESSAGE_NAME.QUERY_ACK;\n    _this13.data = void 0;\n    _this13.status = void 0;\n    _this13.date = void 0;\n    _this13.identifier = IDENTIFIER.QUERY;\n    return _this13;\n  }\n\n  var _proto12 = QueryAckReader.prototype;\n\n  _proto12.readMessage = function readMessage(stream) {\n    RetryableReader.prototype.readMessage.call(this, stream);\n    this.date = stream.readInt();\n    this.status = stream.readByte() * 256 + stream.readByte();\n    this.data = stream.readAll();\n  };\n\n  return QueryAckReader;\n}(RetryableReader);\n\nvar getReaderByHeader = function getReaderByHeader(header) {\n  var type = header.type,\n      msg = new BaseReader(header);\n\n  switch (type) {\n    case OPERATE_TYPE.CONNACK:\n      msg = new ConnAckReader(header);\n      break;\n\n    case OPERATE_TYPE.PUBLISH:\n      msg = new PublishReader(header);\n      msg.syncMsg = header.syncMsg;\n      break;\n\n    case OPERATE_TYPE.PUBACK:\n      msg = new PubAckReader(header);\n      break;\n\n    case OPERATE_TYPE.QUERYACK:\n      msg = new QueryAckReader(header);\n      break;\n\n    case OPERATE_TYPE.SUBACK:\n    case OPERATE_TYPE.UNSUBACK:\n    case OPERATE_TYPE.PINGRESP:\n      msg = new PingRespReader(header);\n      break;\n\n    case OPERATE_TYPE.DISCONNECT:\n      msg = new DisconnectReader(header);\n      break;\n\n    default:\n      throw new Error('No support for deserializing ' + type + ' messages');\n  }\n\n  return msg;\n};\n\nvar readWSBuffer = function readWSBuffer(data) {\n  var arr = new Uint8Array(data);\n  var stream = new RongStreamReader(arr);\n  var flags = stream.readByte(),\n      header = new Header(flags);\n  var msg = getReaderByHeader(header);\n  msg.read(stream, arr.length - 1);\n  return msg;\n};\n\nvar readCometData = function readCometData(data) {\n  var flags = data.headerCode,\n      header = new Header(flags);\n  var msg = getReaderByHeader(header);\n  utils.forEach(data, function (item, key) {\n    if (key in msg) {\n      msg[key] = item;\n    }\n  });\n  return msg;\n};\n\nvar _PUBLISH_TOPIC_MAP_SE;\nvar ENGINE_EVENT = {\n  WATCH: 'watch',\n  UN_WATCH: 'unwatch',\n  CONNECT: 'connect',\n  RECONNECT: 'reconnect',\n  DISCONNECT: 'disconnect',\n  CHANGE_USER: 'changeUser',\n  GET_CONNECTION_STATUS: 'getConnectionStatus',\n  GET_CONNECTION_USER_ID: 'getConnectionUserId',\n  GET_APP_INFO: 'getAppInfo',\n  GET_CONVERSATION_LIST: 'getConversationList',\n  REMOVE_CONVERSATION_LIST: 'removeConversationList',\n  REMOVE_CONVERSATION: 'removeConversation',\n  GET_TOTAL_UNREAD_COUNT: 'getTotalUnreadCount',\n  CLEAR_UNREAD_COUNT: 'clearUnreadCount',\n  GET_LOCAL_CONVERSATION: 'getLocalConversation',\n  SEND_MESSAGE: 'sendMessage',\n  GET_HISTORY_MSGS: 'getHistoryMessages',\n  DELETE_MESSAGES: 'deleteHistoryMessages',\n  CLEAR_MESSAGES: 'clearHistoryMessages',\n  RECALL_MESSAGE: 'recallMessage',\n  JOIN_CHATROOM: 'joinChatRoom',\n  QUIT_CHATROOM: 'quitChatRoom',\n  GET_CHATROOM_INFO: 'getChatRoomInfo',\n  GET_CHATROOM_MSGS: 'getChatRoomHistoryMessages',\n  JOIN_RTC: 'joinRTCRoom',\n  QUIT_RTC: 'quitRTCRoom',\n  PING_RTC: 'RTCPing',\n  GET_RTC_ROOM_INFO: 'getRTCRoomInfo',\n  SET_RTC_DATA: 'setRTCData',\n  GET_RTC_DATA: 'getRTCData',\n  DEL_RTC_DATA: 'removeRTCData',\n  SET_RTC_OUT_DATA: 'setRTCOutData',\n  GET_RTC_OUT_DATA: 'getRTCOutData',\n  GET_RTC_TOKEN: 'getRTCToken',\n  SET_RTC_STATE: 'setRTCState',\n  GET_RTC_USER_INFO_LIST: 'getRTCUserInfoList',\n  SET_RTC_USER_INFO: 'setRTCUserInfo',\n  DEL_RTC_USER_INFO: 'removeRTCUserInfo',\n  GET_RTC_USER_LIST: 'getRTCUserList',\n  GET_UPLOAD_TOKEN: 'getFileToken',\n  GET_UPLOAD_URL: 'getFileUrl'\n};\nvar ENGINE_EVENT_NEED_CONNECTED = [ENGINE_EVENT.GET_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION, ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT, ENGINE_EVENT.CLEAR_UNREAD_COUNT, ENGINE_EVENT.SEND_MESSAGE, ENGINE_EVENT.GET_HISTORY_MSGS, ENGINE_EVENT.DELETE_MESSAGES, ENGINE_EVENT.CLEAR_MESSAGES, ENGINE_EVENT.RECALL_MESSAGE, ENGINE_EVENT.JOIN_CHATROOM, ENGINE_EVENT.QUIT_CHATROOM, ENGINE_EVENT.GET_CHATROOM_INFO, ENGINE_EVENT.GET_CHATROOM_MSGS];\nvar ENGINE_EVENT_NEED_DISCONNECTED = [ENGINE_EVENT.CONNECT, ENGINE_EVENT.RECONNECT];\nvar IM_EVENT = {\n  STATUS: 'status',\n  MESSAGE: 'message',\n  CONVERSATION: 'conversation'\n};\nvar TRANSPORT_EVENT = {\n  SIGNAL: 'signal',\n  STATUS: 'status'\n};\nvar SERVER_TASK = {\n  DISCONNECTED: 'disconnected',\n  SYNC_SELF_MSG: 'sync_self_other_client_msg',\n  NOTIFY_PULL: 'notify_pull_msg',\n  RECEIVE_MSG: 'receive_msg',\n  SYNC_STATUS: 'sync_status',\n  SYNC_CHRM_KV: 'sync_chrm_kv'\n};\nvar PUBLISH_TOPIC_MAP_SERVER_TASK = (_PUBLISH_TOPIC_MAP_SE = {}, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.NOTIFY_PULL_MSG] = SERVER_TASK.NOTIFY_PULL, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.RECEIVE_MSG] = SERVER_TASK.RECEIVE_MSG, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.SYNC_STATUS] = SERVER_TASK.SYNC_STATUS, _PUBLISH_TOPIC_MAP_SE[PUBLISH_TOPIC.SYNC_CHRM_KV] = SERVER_TASK.SYNC_CHRM_KV, _PUBLISH_TOPIC_MAP_SE);\n\nvar isEmpty$1 = utils.isEmpty,\n    tplEngine$1 = utils.tplEngine,\n    getRandomNum$1 = utils.getRandomNum;\n\nvar getTransporterUrl = function getTransporterUrl(option) {\n  var domain = option.domain,\n      appkey = option.appkey,\n      token = option.token,\n      connectType = option.connectType,\n      protocol = option.protocol;\n  var isComet = connectType === CONNECT_TYPE.COMET;\n\n  if (isEmpty$1(protocol)) {\n    protocol = isComet ? env.protocol.http : env.protocol.ws;\n  }\n\n  return tplEngine$1(CMP_URL_TPL, {\n    domain: domain,\n    appkey: appkey,\n    protocol: protocol,\n    apiVer: getRandomNum$1(1e6),\n    token: utils.encodeURI(token)\n  });\n};\n\nvar isGroup = function isGroup(type) {\n  return type === CONVERSATION_TYPE.GROUP;\n};\n\nvar isChatRoom = function isChatRoom(type) {\n  return type === CONVERSATION_TYPE.CHATROOM;\n};\n\nvar getConversationTypeList = function getConversationTypeList() {\n  return utils.getValues(CONVERSATION_TYPE);\n};\n\nvar isValidConversationType = function isValidConversationType(type) {\n  var conversationTypeList = getConversationTypeList();\n  return utils.isNumber(type) && utils.isInclude(conversationTypeList, type);\n};\n\nvar getSessionId = function getSessionId(option) {\n  var isStatusMessage = option.isStatusMessage;\n  var isPersited = option.isPersited,\n      isCounted = option.isCounted,\n      isMentiond = option.isMentiond;\n\n  if (isStatusMessage) {\n    isPersited = isCounted = false;\n  }\n\n  var sessionId = 0;\n\n  if (isPersited) {\n    sessionId = sessionId | 0x01;\n  }\n\n  if (isCounted) {\n    sessionId = sessionId | 0x02;\n  }\n\n  if (isMentiond) {\n    sessionId = sessionId | 0x04;\n  }\n\n  return sessionId;\n};\n\nvar getPersitedAndCountedBySessionId = function getPersitedAndCountedBySessionId(sessionId) {\n  var isPersited, isCounted;\n\n  switch (sessionId) {\n    case MESSAGE_TAG.COUNT_ONLY:\n      isPersited = false;\n      isCounted = true;\n      break;\n\n    case MESSAGE_TAG.PERSIT_ONLY:\n      isPersited = true;\n      isCounted = false;\n      break;\n\n    case MESSAGE_TAG.NONE:\n      isPersited = isCounted = false;\n      break;\n\n    case MESSAGE_TAG.PERSIT_AND_COUNT:\n    default:\n      isPersited = isCounted = true;\n      break;\n  }\n\n  return {\n    isPersited: isPersited,\n    isCounted: isCounted\n  };\n};\n\nvar getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n  var isPersited = true,\n      isCounted = true,\n      isMentiond = false;\n  isPersited = !!(status & 0x10);\n  isCounted = !!(status & 0x20);\n  isMentiond = !!(status & 0x40);\n  return {\n    isPersited: isPersited,\n    isCounted: isCounted,\n    isMentiond: isMentiond\n  };\n};\n\nvar SignalId = {\n  ids: {},\n  temp: '{appkey}_{userId}',\n  get: function get(option) {\n    var key = utils.tplEngine(SignalId.temp, option);\n    var id = SignalId.ids[key] || 0;\n    id++;\n    SignalId.ids[key] = id;\n    return id;\n  },\n  clear: function clear(option) {\n    var key = utils.tplEngine(SignalId.temp, option);\n    SignalId.ids[key] = 0;\n  },\n  isExceedLimit: function isExceedLimit(id) {\n    return id > MAX_SINGAL_ID;\n  }\n};\n\nvar RCSocket = function () {\n  function RCSocket(options) {\n    this._socket = void 0;\n    this.eventEmitter = new utils.EventEmitter();\n    this.KEY = {\n      OPEN: 'open',\n      MSG: 'msg',\n      ERROR: 'error',\n      CLOSE: 'close'\n    };\n    var self = this;\n    var KEY = self.KEY;\n    self._socket = new utils.Socket(options);\n\n    self._socket.onOpen(function (data) {\n      self.eventEmitter.emit(KEY.OPEN, data);\n    });\n\n    self._socket.onMessage(function (data) {\n      self.eventEmitter.emit(KEY.MSG, data);\n    });\n\n    self._socket.onError(function (data) {\n      data = self._formatCloseData(data);\n      self.eventEmitter.emit(KEY.ERROR, data);\n    });\n\n    self._socket.onClose(function (data) {\n      data = self._formatCloseData(data);\n      self.eventEmitter.emit(KEY.CLOSE, data);\n    });\n  }\n\n  var _proto = RCSocket.prototype;\n\n  _proto._formatCloseData = function _formatCloseData(data) {\n    if (env.isMini) {\n      data = data || {};\n      var _data = data,\n          errMsg = _data.errMsg;\n      data.code = MINI_ERROR_MSG_TO_STATUS[errMsg];\n    }\n\n    return data;\n  };\n\n  _proto.send = function send(data) {\n    return this._socket.send(data);\n  };\n\n  _proto.close = function close() {\n    this.eventEmitter.clear();\n\n    this._socket.close();\n  };\n\n  _proto.onOpen = function onOpen(event) {\n    this.eventEmitter.on(this.KEY.OPEN, event);\n  };\n\n  _proto.onMessage = function onMessage(event) {\n    this.eventEmitter.on(this.KEY.MSG, event);\n  };\n\n  _proto.onError = function onError(event) {\n    this.eventEmitter.on(this.KEY.ERROR, event);\n  };\n\n  _proto.onClose = function onClose(event) {\n    this.eventEmitter.on(this.KEY.CLOSE, event);\n  };\n\n  return RCSocket;\n}();\n\nvar RCStorage = function () {\n  function RCStorage(suffix) {\n    var _utils$Cache;\n\n    this._cache = void 0;\n    this.STORAGE_KEY = void 0;\n    var storageKey = suffix ? STORAGE_ROOT_KEY + suffix : STORAGE_ROOT_KEY;\n    var localCache = utils.Storage.get(storageKey) || {};\n    this._cache = new utils.Cache((_utils$Cache = {}, _utils$Cache[storageKey] = localCache, _utils$Cache));\n    this.STORAGE_KEY = storageKey;\n  }\n\n  var _proto2 = RCStorage.prototype;\n\n  _proto2._get = function _get() {\n    var KEY = this.STORAGE_KEY;\n    return this._cache.get(KEY) || {};\n  };\n\n  _proto2._set = function _set(cache) {\n    var KEY = this.STORAGE_KEY;\n    cache = cache || {};\n\n    this._cache.set(KEY, cache);\n\n    utils.Storage.set(KEY, cache);\n  };\n\n  _proto2.set = function set(key, value) {\n    var localValue = this._get();\n\n    localValue[key] = value;\n\n    this._set(localValue);\n  };\n\n  _proto2.remove = function remove(key) {\n    var localValue = this._get();\n\n    delete localValue[key];\n\n    this._set(localValue);\n  };\n\n  _proto2.clear = function clear() {\n    var KEY = this.STORAGE_KEY;\n    utils.Storage.remove(KEY);\n\n    this._cache.remove(KEY);\n  };\n\n  _proto2.get = function get(key) {\n    var localValue = this._get();\n\n    return localValue[key];\n  };\n\n  _proto2.getKeys = function getKeys() {\n    var localValue = this._get();\n\n    return utils.getKeys(localValue);\n  };\n\n  _proto2.getValues = function getValues() {\n    return this._get() || {};\n  };\n\n  return RCStorage;\n}();\n\nvar formatSyncTime = function formatSyncTime(_syncTime) {\n  _syncTime = _syncTime || {};\n  _syncTime.inboxTime = _syncTime.inboxTime || 0;\n  _syncTime.sendboxTime = _syncTime.sendboxTime || 0;\n  return _syncTime;\n};\n\nvar MessageTimeSyner = function () {\n  function MessageTimeSyner(option) {\n    this._syncTime = void 0;\n    this._storage = void 0;\n    option = option || {};\n    var _option = option,\n        startSyncTime = _option.startSyncTime;\n\n    this._initStorage(option);\n\n    if (startSyncTime) {\n      this._syncTime = formatSyncTime(startSyncTime);\n    }\n  }\n\n  var _proto3 = MessageTimeSyner.prototype;\n\n  _proto3._initStorage = function _initStorage(option) {\n    var appkey = option.appkey,\n        userId = option.userId;\n    var ROOT_KEY = utils.tplEngine(STORAGE_SYNC_TIME.ROOT_KEY_TPL, {\n      appkey: appkey,\n      userId: userId\n    });\n    var storage = new RCStorage(ROOT_KEY);\n    var syncTime = {\n      sendboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX),\n      inboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.INBOX)\n    };\n    this._storage = storage;\n    this._syncTime = formatSyncTime(syncTime);\n  };\n\n  _proto3.setInbox = function setInbox(time) {\n    var beforeTime = this._syncTime.inboxTime || 0;\n\n    if (beforeTime < time) {\n      this._syncTime.inboxTime = time;\n\n      this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.INBOX, time);\n    }\n  };\n\n  _proto3.setSendbox = function setSendbox(time) {\n    var beforeTime = this._syncTime.sendboxTime || 0;\n\n    if (beforeTime < time) {\n      this._syncTime.sendboxTime = time;\n\n      this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX, time);\n    }\n  };\n\n  _proto3.setByMessage = function setByMessage(msg) {\n    var messageDirection = msg.messageDirection,\n        sentTime = msg.sentTime;\n    var isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND;\n    isSelfSend ? this.setSendbox(sentTime) : this.setInbox(sentTime);\n  };\n\n  _proto3.get = function get() {\n    return formatSyncTime(this._syncTime);\n  };\n\n  return MessageTimeSyner;\n}();\n\nvar ChatRoomMessageTimeSyner = function () {\n  function ChatRoomMessageTimeSyner() {\n    this._pullTimes = {};\n  }\n\n  var _proto4 = ChatRoomMessageTimeSyner.prototype;\n\n  _proto4.set = function set(chrmId, time) {\n    this._pullTimes[chrmId] = time;\n  };\n\n  _proto4.get = function get(chrmId) {\n    return this._pullTimes[chrmId] || 0;\n  };\n\n  _proto4.setByMessage = function setByMessage(msg) {\n    var sentTime = msg.sentTime;\n    var chrmId = msg.targetId;\n    var beforeTime = this.get(chrmId);\n\n    if (beforeTime < sentTime) {\n      this.set(chrmId, sentTime);\n    }\n  };\n\n  return ChatRoomMessageTimeSyner;\n}();\n\nvar getUIDByToken = function getUIDByToken(token) {\n  return utils.md5(token).slice(8, 16);\n};\n\nvar isIncludeNavi = function isIncludeNavi(token) {\n  return utils.isInclude(token, NAVI_SEPARATOR_IN_TOKEN);\n};\n\nvar getNaviListByToken = function getNaviListByToken(token) {\n  var navDomainList = [];\n\n  if (isIncludeNavi(token)) {\n    var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n    var navsText = token.substring(separatorIndex + 1, token.length);\n    var domainList = navsText.split(DOMAIN_SEPARATOR_IN_NAVLIST);\n    utils.forEach(domainList, function (domain) {\n      if (!isEmpty$1(domain)) {\n        navDomainList.push(domain);\n      }\n    });\n  }\n\n  return navDomainList;\n};\n\nvar getCMPDomainList = function getCMPDomainList(option) {\n  var server = option.server,\n      backupServer = option.backupServer;\n  server = server || '';\n  backupServer = backupServer || '';\n  var backupCMPList = backupServer.split(DOMAIN_SEPARATOR_IN_CMPLIST);\n  var cmpList = [];\n\n  if (!utils.isEmpty(server)) {\n    cmpList.push(server);\n  }\n\n  utils.forEach(backupCMPList, function (cmp) {\n    if (!utils.isEmpty(cmp)) {\n      cmpList.push(cmp);\n    }\n  });\n  return cmpList;\n};\n\nvar getValidToken = function getValidToken(token) {\n  if (isIncludeNavi(token)) {\n    var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n    token = token.substring(0, separatorIndex + 1);\n  }\n\n  return token;\n};\n\nvar getConnectType = function getConnectType(option) {\n  if (env.isMini) {\n    return CONNECT_TYPE.COMET;\n  }\n\n  var connectType = option.connectType;\n  var isSpecifiedSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n  var isSocket = isSpecifiedSocket && utils.isSupportSocket();\n  return isSocket ? CONNECT_TYPE.WEBSOCKET : CONNECT_TYPE.COMET;\n};\n\nvar isConnected = function isConnected(status) {\n  return utils.isEqual(status, CONNECTION_STATUS.CONNECTED);\n};\n\nvar isConnecting = function isConnecting(status) {\n  return utils.isEqual(status, CONNECTION_STATUS.CONNECTING);\n};\n\nvar isDisconnected = function isDisconnected(status) {\n  return !isConnected(status) && !isConnecting(status);\n};\n\nvar getNavReqOption = function getNavReqOption(option, user) {\n  option = utils.copy(option);\n  option.token = user.token;\n  return option;\n};\n\nvar getPingTimeout = function getPingTimeout(timeSpentConnect) {\n  var timeout = timeSpentConnect * 3;\n\n  if (timeout < IM_PING_MIN_TIMEOUT) {\n    return IM_PING_MIN_TIMEOUT;\n  }\n\n  if (timeout > IM_PING_MAX_TIMEOUT) {\n    return IM_PING_MAX_TIMEOUT;\n  }\n\n  return timeout;\n};\n\nvar fixConversationData = function fixConversationData(conversation) {\n  conversation = conversation || {};\n  conversation.latestMessage = conversation.latestMessage || {};\n  conversation.latestMessage.sentTime = conversation.latestMessage.sentTime || 0;\n  return conversation;\n};\n\nvar sortConversationList = function sortConversationList(conversationList) {\n  return utils.quickSort(conversationList, function (before, after) {\n    before = fixConversationData(before);\n    after = fixConversationData(after);\n    return after.latestMessage.sentTime <= before.latestMessage.sentTime;\n  });\n};\n\nvar DelayTimer = {\n  _delayTime: 0,\n  setTime: function setTime(time) {\n    var currentTime = utils.getCurrentTimestamp();\n    DelayTimer._delayTime = currentTime - time;\n  },\n  getTime: function getTime() {\n    var delayTime = DelayTimer._delayTime;\n    var currentTime = utils.getCurrentTimestamp();\n    return currentTime - delayTime;\n  }\n};\n\nvar isSupportStatusMessage = function isSupportStatusMessage(type) {\n  return !!CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n};\n\nvar getConversationKey = function getConversationKey(option) {\n  var type = option.type,\n      targetId = option.targetId;\n  return type + '_' + targetId;\n};\n\nvar common = {\n  isConnected: isConnected,\n  isConnecting: isConnecting,\n  isDisconnected: isDisconnected,\n  getConnectType: getConnectType,\n  getTransporterUrl: getTransporterUrl,\n  isGroup: isGroup,\n  isChatRoom: isChatRoom,\n  getConversationTypeList: getConversationTypeList,\n  isValidConversationType: isValidConversationType,\n  getUIDByToken: getUIDByToken,\n  getSessionId: getSessionId,\n  getMessageOptionByStatus: getMessageOptionByStatus,\n  getPersitedAndCountedBySessionId: getPersitedAndCountedBySessionId,\n  SignalId: SignalId,\n  MessageTimeSyner: MessageTimeSyner,\n  ChatRoomMessageTimeSyner: ChatRoomMessageTimeSyner,\n  getCMPDomainList: getCMPDomainList,\n  getNaviListByToken: getNaviListByToken,\n  getValidToken: getValidToken,\n  RCSocket: RCSocket,\n  RCStorage: RCStorage,\n  getNavReqOption: getNavReqOption,\n  getPingTimeout: getPingTimeout,\n  fixConversationData: fixConversationData,\n  sortConversationList: sortConversationList,\n  DelayTimer: DelayTimer,\n  isSupportStatusMessage: isSupportStatusMessage,\n  getConversationKey: getConversationKey\n};\n\nvar EventEmitter$1 = utils.EventEmitter,\n    DeferHandler$1 = utils.DeferHandler,\n    Timer$1 = utils.Timer;\nvar RCSocket$1 = common.RCSocket;\nvar TransHandlerID = {\n  CONNECT: 'connect',\n  PING: 'ping'\n};\n\nvar Heartbeat = function () {\n  function Heartbeat(transporter, option) {\n    this._transporter = void 0;\n    this._timer = void 0;\n    option = option || {};\n    var timeout = option.timeout;\n    this._transporter = transporter;\n    this._timer = new Timer$1({\n      type: TIMER_TYPE.INTERVAL,\n      timeout: timeout\n    });\n  }\n\n  var _proto = Heartbeat.prototype;\n\n  _proto.check = function check(timeout) {\n    var _transporter = this._transporter;\n    var _deferHandler = _transporter._deferHandler;\n    var pingReqSignal = new PingReqWriter();\n\n    _transporter.sendSignal(pingReqSignal);\n\n    return utils.deferred(function (resolve, reject) {\n      _deferHandler.add(TransHandlerID.PING, {\n        resolve: resolve,\n        reject: reject\n      }, {\n        timeout: timeout\n      });\n    });\n  };\n\n  _proto.start = function start(timeout, onError) {\n    var self = this;\n\n    self._timer.start(function () {\n      self.check(timeout).then(utils.noop)[\"catch\"](onError);\n    });\n  };\n\n  _proto.stop = function stop() {\n    this._timer && this._timer.stop();\n  };\n\n  return Heartbeat;\n}();\n\nvar SocketTransporter = function () {\n  function SocketTransporter(option) {\n    this._socket = void 0;\n    this._option = void 0;\n    this._transporterEventEmiiter = new EventEmitter$1();\n    this._deferHandler = new DeferHandler$1();\n    this._heartbeat = new Heartbeat(this, {\n      timeout: IM_PING_INTERVAL_TIME\n    });\n    this._connectedTime = void 0;\n    this._option = option;\n  }\n\n  var _proto2 = SocketTransporter.prototype;\n\n  _proto2._createSocket = function _createSocket(url) {\n    var self = this;\n    var _transporterEventEmiiter = self._transporterEventEmiiter;\n    var socket = new RCSocket$1({\n      url: url\n    });\n\n    var onClose = function onClose(event) {\n      event = event || {};\n      var code = event.code || TRANSPORTER_STATUS.CLOSE_ABNORMAL;\n\n      _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, code);\n\n      self.disconnect();\n    };\n\n    socket.onMessage(function (msg) {\n      var data = msg.data;\n\n      if (!utils.isArrayBuffer(data)) {\n        throw new Error('Error socket signal');\n      }\n\n      var signal = readWSBuffer(data);\n      self.handleSignal(signal);\n    });\n    socket.onError(onClose);\n    socket.onClose(onClose);\n    return socket;\n  };\n\n  _proto2._startHeartbeat = function _startHeartbeat(timeSpentConnect) {\n    var self = this;\n    var _heartbeat = self._heartbeat,\n        _transporterEventEmiiter = self._transporterEventEmiiter;\n\n    _heartbeat.check(FIRST_PING_TIMEOUT).then(utils.noop)[\"catch\"](function () {\n      _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT);\n\n      self.disconnect();\n    });\n\n    var pingTimeout = common.getPingTimeout(timeSpentConnect);\n\n    _heartbeat.start(pingTimeout, function () {\n      _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n      self.disconnect();\n    });\n  };\n\n  _proto2._stopHeartbeat = function _stopHeartbeat() {\n    this._heartbeat.stop();\n  };\n\n  _proto2.watchSignal = function watchSignal(watcher) {\n    this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, watcher);\n  };\n\n  _proto2.watchStatus = function watchStatus(watcher) {\n    this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, watcher);\n  };\n\n  _proto2.connect = function connect(user, option) {\n    var self = this;\n    var _self$_option = self._option,\n        appkey = _self$_option.appkey,\n        connectType = _self$_option.connectType,\n        _deferHandler = self._deferHandler;\n    var token = user.token;\n    var domain = option.domain;\n    var url = common.getTransporterUrl({\n      domain: domain,\n      appkey: appkey,\n      connectType: connectType,\n      token: token\n    });\n    var timeBeforeConnect = utils.getCurrentTimestamp();\n    self._socket = this._createSocket(url);\n    return utils.deferred(function (resolve, reject) {\n      _deferHandler.add(TransHandlerID.CONNECT, {\n        resolve: resolve,\n        reject: reject\n      });\n    }).then(function (result) {\n      var timeAfterConnect = utils.getCurrentTimestamp();\n      var timeSpentConnect = timeAfterConnect - timeBeforeConnect;\n\n      self._startHeartbeat(timeSpentConnect);\n\n      return result;\n    });\n  };\n\n  _proto2.sendSignal = function sendSignal(writer) {\n    var binary = writer.getBufferData();\n\n    this._socket.send(binary.buffer);\n  };\n\n  _proto2.handleSignal = function handleSignal(signal) {\n    var _transporterEventEmiiter = this._transporterEventEmiiter,\n        _deferHandler = this._deferHandler;\n\n    if (signal instanceof ConnAckReader) {\n      this.handleConnAck(signal);\n    } else if (signal instanceof PingRespReader) {\n      _deferHandler.resolve(TransHandlerID.PING);\n    } else {\n      _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n    }\n\n    if (signal && utils.isNumber(signal.timestamp)) {\n      common.DelayTimer.setTime(signal.timestamp);\n    }\n  };\n\n  _proto2.handleConnAck = function handleConnAck(signal) {\n    var self = this;\n    var _deferHandler = self._deferHandler,\n        _transporterEventEmiiter = self._transporterEventEmiiter;\n    var status = signal.status;\n    var isConnected = status === SUCCESS_CODE;\n    var event = isConnected ? _deferHandler.resolve : _deferHandler.reject;\n    event.call(_deferHandler, TransHandlerID.CONNECT, signal);\n\n    if (isConnected) {\n      self._connectedTime = utils.getCurrentTimestamp();\n    }\n\n    isConnected && _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.CONNECTED);\n  };\n\n  _proto2.disconnect = function disconnect() {\n    this._stopHeartbeat();\n\n    this._socket && this._socket.close();\n  };\n\n  return SocketTransporter;\n}();\n\nvar Option = {\n  isShowLocal: false,\n  platform: 'Web'\n};\nvar eventEmitter = new utils.EventEmitter();\nvar LogPrefix = '[RongCloud]';\nvar EventName = {\n  Log: 'log'\n};\nvar Logger = {\n  _events: [],\n  setOption: function setOption(option) {\n    Option = utils.extend(Option, option);\n  },\n  watch: function watch(event) {\n    eventEmitter.on(EventName.Log, event);\n\n    Logger._events.push(event);\n  },\n  write: function write(log) {\n    var time = utils.getCurrentTimestamp();\n\n    if (utils.isObject(log)) {\n      log.time = time;\n    }\n\n    var formatedTime = utils.formatTime(time);\n    var logContent = LogPrefix + \":\" + formatedTime + \": \" + utils.toJSON(log);\n    eventEmitter.emit(EventName.Log, logContent);\n\n    if (Option.isShowLocal) {\n      console.log(logContent);\n    }\n  }\n};\n\nvar EventEmitter$2 = utils.EventEmitter,\n    DeferHandler$2 = utils.DeferHandler,\n    httpRequest = utils.httpRequest,\n    request$4 = utils.request,\n    Defer$1 = utils.Defer;\n\nvar CometTransporter = function () {\n  function CometTransporter(option) {\n    this._option = void 0;\n    this._transporterEventEmiiter = new EventEmitter$2();\n    this._deferHandler = new DeferHandler$2();\n    this._pid = utils.encodeURI(utils.getCurrentTimestamp() + Math.random() + '');\n    this._domain = void 0;\n    this._sessionid = void 0;\n    this._xhrCache = new utils.Cache();\n    this._pullSignalTimer = new utils.Timer({\n      timeout: IM_COMET_PULLMSG_TIMEOUT\n    });\n    this._isDisconnected = true;\n    this._option = option;\n  }\n\n  var _proto = CometTransporter.prototype;\n\n  _proto._startPullSignal = function _startPullSignal() {\n    var self = this;\n    var _domain = self._domain,\n        _sessionid = self._sessionid,\n        _pid = self._pid,\n        _transporterEventEmiiter = self._transporterEventEmiiter,\n        _pullSignalTimer = self._pullSignalTimer;\n    var timestamp = utils.getCurrentTimestamp();\n    var protocol = env.protocol.http;\n    var url = utils.tplEngine(COMET_PULL_URL_TPL, {\n      protocol: protocol,\n      timestamp: timestamp,\n      domain: _domain,\n      sessionId: _sessionid,\n      pid: _pid\n    });\n    var xhr = httpRequest({\n      url: url,\n      body: {\n        pid: _pid\n      },\n      timeout: IM_COMET_PULLMSG_TIMEOUT,\n      success: function success(responseText) {\n        _pullSignalTimer.stop();\n\n        var isSuccess = self.handleCometResponse(responseText);\n\n        if (isSuccess) {\n          !self._isDisconnected && self._startPullSignal();\n        } else if (!self._isDisconnected) {\n          _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n        }\n\n        self._xhrCache.remove(url);\n      },\n      fail: function fail() {\n        _pullSignalTimer.stop();\n\n        if (!self._isDisconnected) {\n          _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n        }\n\n        self._xhrCache.remove(url);\n      }\n    });\n\n    _pullSignalTimer.start(function () {\n      if (!self._isDisconnected) {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n        self.disconnect();\n      }\n    });\n\n    self._xhrCache.set(url, xhr);\n  };\n\n  _proto.watchSignal = function watchSignal(event) {\n    this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, event);\n  };\n\n  _proto.watchStatus = function watchStatus(event) {\n    this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, function (status) {\n      event && event(status);\n    });\n  };\n\n  _proto.connect = function connect(user, option) {\n    var self = this;\n    var _transporterEventEmiiter = self._transporterEventEmiiter,\n        _pid = self._pid,\n        _self$_option = self._option,\n        appkey = _self$_option.appkey,\n        connectType = _self$_option.connectType;\n    var token = user.token;\n    var domain = option.domain;\n    var url = common.getTransporterUrl({\n      domain: domain,\n      appkey: appkey,\n      token: token,\n      connectType: connectType\n    });\n    self._domain = domain;\n    self._isDisconnected = false;\n\n    var success = function success(_ref) {\n      var responseText = _ref.responseText;\n\n      if (!utils.isValidJSON(responseText)) {\n        return Defer$1.reject();\n      }\n\n      var response = utils.isObject(responseText) ? responseText : utils.parseJSON(responseText);\n      var isConnectSuccess = utils.isEqual(response.status, SUCCESS_CODE);\n\n      if (isConnectSuccess && utils.isObject(response) && utils.isNumber(response.timestamp)) {\n        common.DelayTimer.setTime(response.timestamp);\n      }\n\n      return isConnectSuccess ? Defer$1.resolve(response) : Defer$1.reject(response);\n    };\n\n    return request$4(url, {\n      body: {\n        pid: _pid\n      }\n    }).then(success).then(function (response) {\n      _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, CONNECTION_STATUS.CONNECTED);\n\n      self._sessionid = response.sessionid;\n\n      self._startPullSignal();\n\n      return response;\n    });\n  };\n\n  _proto.sendSignal = function sendSignal(writer) {\n    var self = this;\n    var _domain = self._domain,\n        _sessionid = self._sessionid,\n        _pid = self._pid;\n    var messageId = writer.messageId,\n        topic = writer.topic,\n        targetId = writer.targetId;\n    var headerCode = writer.getHeaderFlag();\n    var protocol = env.protocol.http;\n    var TPL = topic ? COMET_REQ_HAS_TOPIC_URL_TPL : COMET_REQ_NO_TOPIC_URL_TPL;\n    var url = utils.tplEngine(TPL, {\n      protocol: protocol,\n      messageId: messageId,\n      headerCode: headerCode,\n      topic: topic,\n      targetId: targetId,\n      pid: _pid,\n      sessionId: _sessionid,\n      domain: _domain\n    });\n    var currentTime = utils.getCurrentTimestamp() + '';\n    var xhr = httpRequest({\n      url: url,\n      method: REQUEST_METHOD.POST,\n      body: writer.getCometData(),\n      success: function success(responseText) {\n        var isSuccess = self.handleCometResponse(responseText);\n\n        if (!isSuccess) {\n          self.handleError(messageId);\n        }\n\n        self._xhrCache.remove(currentTime);\n      },\n      fail: function fail(error) {\n        self.handleError(messageId);\n\n        self._xhrCache.remove(currentTime);\n\n        Logger.write({\n          content: {\n            info: 'comet error',\n            error: error\n          }\n        });\n      }\n    });\n\n    self._xhrCache.set(currentTime, xhr);\n  };\n\n  _proto.handleCometResponse = function handleCometResponse(responseText) {\n    var self = this;\n    var _transporterEventEmiiter = self._transporterEventEmiiter;\n    var response = utils.isString(responseText) ? utils.parseJSON(responseText) : responseText;\n\n    if (!response) {\n      return false;\n    }\n\n    if (!response || !utils.isArray(response)) {\n      return true;\n    }\n\n    utils.forEach(response, function (data) {\n      var sessionid = data.sessionid;\n\n      if (sessionid) {\n        self._sessionid = sessionid;\n      }\n\n      var signal = readCometData(data);\n\n      _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n\n      if (signal && utils.isNumber(signal.timestamp)) {\n        common.DelayTimer.setTime(signal.timestamp);\n      }\n    });\n    return true;\n  };\n\n  _proto.handleError = function handleError(messageId, status) {\n    var signal = {\n      messageId: messageId,\n      status: status || ERROR_CODE.TIMEOUT\n    };\n\n    this._transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n  };\n\n  _proto.disconnect = function disconnect() {\n    var self = this;\n    self._isDisconnected = true;\n    var _xhrCache = self._xhrCache,\n        _pullSignalTimer = self._pullSignalTimer;\n\n    var xhrKeys = _xhrCache.getKeys();\n\n    _pullSignalTimer.stop();\n\n    utils.forEach(xhrKeys, function (key) {\n      var xhr = _xhrCache.get(key);\n\n      xhr.abort();\n\n      _xhrCache.remove(key);\n    });\n  };\n\n  return CometTransporter;\n}();\n\nvar Transporter = (function (option) {\n  var connectType = option.connectType;\n  var isSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n  var Transporter = isSocket ? SocketTransporter : CometTransporter;\n  return new Transporter(option);\n});\n\nvar PBName = {\n  UpStreamMessage: 'UpStreamMessage',\n  DownStreamMessage: 'DownStreamMessage',\n  DownStreamMessages: 'DownStreamMessages',\n  SessionsAttQryInput: 'SessionsAttQryInput',\n  SessionsAttOutput: 'SessionsAttOutput',\n  SyncRequestMsg: 'SyncRequestMsg',\n  ChrmPullMsg: 'ChrmPullMsg',\n  NotifyMsg: 'NotifyMsg',\n  HistoryMsgInput: 'HistoryMsgInput',\n  HistoryMsgOuput: 'HistoryMsgOuput',\n  RelationQryInput: 'RelationQryInput',\n  RelationsOutput: 'RelationsOutput',\n  DeleteSessionsInput: 'DeleteSessionsInput',\n  SessionInfo: 'SessionInfo',\n  DeleteSessionsOutput: 'DeleteSessionsOutput',\n  RelationsInput: 'RelationsInput',\n  DeleteMsgInput: 'DeleteMsgInput',\n  CleanHisMsgInput: 'CleanHisMsgInput',\n  SessionMsgReadInput: 'SessionMsgReadInput',\n  ChrmInput: 'ChrmInput',\n  QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n  QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n  RtcInput: 'RtcInput',\n  RtcUserListOutput: 'RtcUserListOutput',\n  SetUserStatusInput: 'SetUserStatusInput',\n  RtcSetDataInput: 'RtcSetDataInput',\n  RtcDataInput: 'RtcDataInput',\n  RtcSetOutDataInput: 'RtcSetOutDataInput',\n  MCFollowInput: 'MCFollowInput',\n  RtcTokenOutput: 'RtcTokenOutput',\n  RtcQryOutput: 'RtcQryOutput',\n  RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n  RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n  RtcQueryListInput: 'RtcQueryListInput',\n  RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n  RtcValueInfo: 'RtcValueInfo',\n  RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n  GetQNupTokenInput: 'GetQNupTokenInput',\n  GetQNupTokenOutput: 'GetQNupTokenOutput',\n  GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n  GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput'\n};\n\nvar _SSMsg;\nvar SSMsg = (_SSMsg = {}, _SSMsg[PBName.UpStreamMessage] = ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData'], _SSMsg[PBName.DownStreamMessages] = ['list', 'syncTime', 'finished'], _SSMsg[PBName.DownStreamMessage] = ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId'], _SSMsg[PBName.SessionsAttQryInput] = ['nothing'], _SSMsg[PBName.SessionsAttOutput] = ['inboxTime', 'sendboxTime', 'totalUnreadCount'], _SSMsg[PBName.SyncRequestMsg] = ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'], _SSMsg[PBName.ChrmPullMsg] = ['syncTime', 'count'], _SSMsg[PBName.NotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.HistoryMsgInput] = ['targetId', 'time', 'count', 'order'], _SSMsg[PBName.HistoryMsgOuput] = ['list', 'syncTime', 'hasMsg'], _SSMsg[PBName.RelationQryInput] = ['type', 'count', 'startTime', 'order'], _SSMsg[PBName.RelationsOutput] = ['info'], _SSMsg[PBName.DeleteSessionsInput] = ['sessions'], _SSMsg[PBName.SessionInfo] = ['type', 'channelId'], _SSMsg[PBName.DeleteSessionsOutput] = ['nothing'], _SSMsg[PBName.RelationsInput] = ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'], _SSMsg[PBName.DeleteMsgInput] = ['type', 'conversationId', 'msgs'], _SSMsg[PBName.CleanHisMsgInput] = ['targetId', 'dataTime', 'conversationType'], _SSMsg[PBName.SessionMsgReadInput] = ['type', 'msgTime', 'channelId'], _SSMsg[PBName.ChrmInput] = ['nothing'], _SSMsg[PBName.QueryChatRoomInfoInput] = ['count', 'order'], _SSMsg[PBName.QueryChatRoomInfoOutput] = ['userTotalNums', 'userInfos'], _SSMsg[PBName.GetQNupTokenInput] = ['type'], _SSMsg[PBName.GetQNdownloadUrlInput] = ['type', 'key', 'fileName'], _SSMsg[PBName.GetQNupTokenOutput] = ['deadline', 'token'], _SSMsg[PBName.GetQNdownloadUrlOutput] = ['downloadUrl'], _SSMsg);\n\nvar Codec = {};\nutils.forEach(SSMsg, function (paramList, name) {\n  Codec[name] = function () {};\n\n  Codec[name].prototype.data = {};\n\n  Codec[name].prototype.getData = function () {\n    return this.data;\n  };\n\n  utils.forEach(paramList, function (param) {\n    var setEventName = 'set' + utils.toUpperCase(param, 0, 1);\n\n    Codec[name].prototype[setEventName] = function (item) {\n      this.data[param] = item;\n    };\n  });\n\n  Codec[name].decode = function (data) {\n    var decodeResult = {};\n\n    if (utils.isString(data)) {\n      data = utils.parseJSON(data);\n    }\n\n    var _loop = function _loop(key) {\n      var getEventName = 'get' + utils.toUpperCase(key, 0, 1);\n      decodeResult[key] = data[key];\n\n      decodeResult[getEventName] = function () {\n        return data[key];\n      };\n    };\n\n    for (var key in data) {\n      _loop(key);\n    }\n\n    return decodeResult;\n  };\n});\n\nCodec.getModule = function (pbName) {\n  var modules = new Codec[pbName]();\n\n  modules.getArrayData = function () {\n    return modules.getData();\n  };\n\n  return modules;\n};\n\nfunction protobuf(a){var b=void 0,c=function(){function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c;}function b(a){return (a&&a.__isLong__)===!0}function e(a,b){var e,f,h;return b?(a>>>=0,(h=a>=0&&256>a)&&(f=d[a])?f:(e=g(a,0>(0|a)?-1:0,!0),h&&(d[a]=e),e)):(a|=0,(h=a>=-128&&128>a)&&(f=c[a])?f:(e=g(a,0>a?-1:0,!1),h&&(c[a]=e),e))}function f(a,b){if(isNaN(a)||!isFinite(a))return b?r:q;if(b){if(0>a)return r;if(a>=n)return w}else{if(-o>=a)return x;if(a+1>=o)return v}return 0>a?f(-a,b).neg():g(0|a%m,0|a/m,b)}function g(b,c,d){return new a(b,c,d)}function i(a,b,c){var d,e,g,j,k,l,m;if(0===a.length)throw Error(\"empty string\");if(\"NaN\"===a||\"Infinity\"===a||\"+Infinity\"===a||\"-Infinity\"===a)return q;if(\"number\"==typeof b?(c=b,b=!1):b=!!b,c=c||10,2>c||c>36)throw RangeError(\"radix\");if((d=a.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===d)return i(a.substring(1),b,c).neg();for(e=f(h(c,8)),g=q,j=0;j<a.length;j+=8)k=Math.min(8,a.length-j),l=parseInt(a.substring(j,j+k),c),8>k?(m=f(h(c,k)),g=g.mul(m).add(f(l))):(g=g.mul(e),g=g.add(f(l)));return g.unsigned=b,g}function j(b){return b instanceof a?b:\"number\"==typeof b?f(b):\"string\"==typeof b?i(b):g(b.low,b.high,b.unsigned)}var c,d,h,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return Object.defineProperty(a.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b,c={},d={},a.fromInt=e,a.fromNumber=f,a.fromBits=g,h=Math.pow,a.fromString=i,a.fromValue=j,k=65536,l=1<<24,m=k*k,n=m*m,o=n/2,p=e(l),q=e(0),a.ZERO=q,r=e(0,!0),a.UZERO=r,s=e(1),a.ONE=s,t=e(1,!0),a.UONE=t,u=e(-1),a.NEG_ONE=u,v=g(-1,2147483647,!1),a.MAX_VALUE=v,w=g(-1,-1,!0),a.MAX_UNSIGNED_VALUE=w,x=g(0,-2147483648,!1),a.MIN_VALUE=x,y=a.prototype,y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},y.toString=function(a){var b,c,d,e,g,i,j,k,l;if(a=a||10,2>a||a>36)throw RangeError(\"radix\");if(this.isZero())return \"0\";if(this.isNegative())return this.eq(x)?(b=f(a),c=this.div(b),d=c.mul(b).sub(this),c.toString(a)+d.toInt().toString(a)):\"-\"+this.neg().toString(a);for(e=f(h(a,6),this.unsigned),g=this,i=\"\";;){if(j=g.div(e),k=g.sub(j.mul(e)).toInt()>>>0,l=k.toString(a),g=j,g.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i;}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var a,b;if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return !this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1===(1&this.low)},y.isEven=function(){return 0===(1&this.low)},y.equals=function(a){return b(a)||(a=j(a)),this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low},y.eq=y.equals,y.notEquals=function(a){return !this.eq(a)},y.neq=y.notEquals,y.lessThan=function(a){return this.comp(a)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(a){return this.comp(a)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(a){return this.comp(a)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(a){return this.comp(a)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(a){if(b(a)||(a=j(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return !this.unsigned&&this.eq(x)?x:this.not().add(s)},y.neg=y.negate,y.add=function(a){var c,d,e,f,h,i,k,l,m,n,o,p;return b(a)||(a=j(a)),c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,h=a.high>>>16,i=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0,p+=f+l,o+=p>>>16,p&=65535,o+=e+k,n+=o>>>16,o&=65535,n+=d+i,m+=n>>>16,n&=65535,m+=c+h,m&=65535,g(o<<16|p,m<<16|n,this.unsigned)},y.subtract=function(a){return b(a)||(a=j(a)),this.add(a.neg())},y.sub=y.subtract,y.multiply=function(a){var c,d,e,h,i,k,l,m,n,o,r,s;return this.isZero()?q:(b(a)||(a=j(a)),a.isZero()?q:this.eq(x)?a.isOdd()?x:q:a.eq(x)?this.isOdd()?x:q:this.isNegative()?a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg():a.isNegative()?this.mul(a.neg()).neg():this.lt(p)&&a.lt(p)?f(this.toNumber()*a.toNumber(),this.unsigned):(c=this.high>>>16,d=65535&this.high,e=this.low>>>16,h=65535&this.low,i=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,o=0,r=0,s=0,s+=h*m,r+=s>>>16,s&=65535,r+=e*m,o+=r>>>16,r&=65535,r+=h*l,o+=r>>>16,r&=65535,o+=d*m,n+=o>>>16,o&=65535,o+=e*l,n+=o>>>16,o&=65535,o+=h*k,n+=o>>>16,o&=65535,n+=c*m+d*l+e*k+h*i,n&=65535,g(r<<16|s,n<<16|o,this.unsigned)))},y.mul=y.multiply,y.divide=function(a){var c,d,e,g,i,k,l,m;if(b(a)||(a=j(a)),a.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?r:q;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return r;if(a.gt(this.shru(1)))return t;e=r;}else{if(this.eq(x))return a.eq(s)||a.eq(u)?x:a.eq(x)?s:(g=this.shr(1),c=g.div(a).shl(1),c.eq(q)?a.isNegative()?s:u:(d=this.sub(a.mul(c)),e=c.add(d.div(a))));if(a.eq(x))return this.unsigned?r:q;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();e=q;}for(d=this;d.gte(a);){for(c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),i=Math.ceil(Math.log(c)/Math.LN2),k=48>=i?1:h(2,i-48),l=f(c),m=l.mul(a);m.isNegative()||m.gt(d);)c-=k,l=f(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=s),e=e.add(l),d=d.sub(m);}return e},y.div=y.divide,y.modulo=function(a){return b(a)||(a=j(a)),this.sub(this.div(a).mul(a))},y.mod=y.modulo,y.not=function(){return g(~this.low,~this.high,this.unsigned)},y.and=function(a){return b(a)||(a=j(a)),g(this.low&a.low,this.high&a.high,this.unsigned)},y.or=function(a){return b(a)||(a=j(a)),g(this.low|a.low,this.high|a.high,this.unsigned)},y.xor=function(a){return b(a)||(a=j(a)),g(this.low^a.low,this.high^a.high,this.unsigned)},y.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):g(0,this.low<<a-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):g(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(a){var c,d;return b(a)&&(a=a.toInt()),a&=63,0===a?this:(c=this.high,32>a?(d=this.low,g(d>>>a|c<<32-a,c>>>a,this.unsigned)):32===a?g(c,0,this.unsigned):g(c>>>a-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},y.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var a=this.high,b=this.low;return [255&b,255&b>>>8,255&b>>>16,255&b>>>24,255&a,255&a>>>8,255&a>>>16,255&a>>>24]},y.toBytesBE=function(){var a=this.high,b=this.low;return [255&a>>>24,255&a>>>16,255&a>>>8,255&a,255&b>>>24,255&b>>>16,255&b>>>8,255&b]},a}(),d=function(a){function f(a){var b=0;return function(){return b<a.length?a.charCodeAt(b++):null}}function g(){var a=[],b=[];return function(){return 0===arguments.length?b.join(\"\")+e.apply(String,a):(a.length+arguments.length>1024&&(b.push(e.apply(String,a)),a.length=0),Array.prototype.push.apply(a,arguments),void 0)}}function h(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j;}return (n?-1:1)*g*Math.pow(2,f-d)}function i(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p;}var c,d,e,j,k,b=function(a,c,e){if(\"undefined\"==typeof a&&(a=b.DEFAULT_CAPACITY),\"undefined\"==typeof c&&(c=b.DEFAULT_ENDIAN),\"undefined\"==typeof e&&(e=b.DEFAULT_NOASSERT),!e){if(a=0|a,0>a)throw RangeError(\"Illegal capacity\");c=!!c,e=!!e;}this.buffer=0===a?d:new ArrayBuffer(a),this.view=0===a?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=a,this.littleEndian=c,this.noAssert=e;};return b.VERSION=\"5.0.1\",b.LITTLE_ENDIAN=!0,b.BIG_ENDIAN=!1,b.DEFAULT_CAPACITY=16,b.DEFAULT_ENDIAN=b.BIG_ENDIAN,b.DEFAULT_NOASSERT=!1,b.Long=a||null,c=b.prototype,c.__isByteBuffer__,Object.defineProperty(c,\"__isByteBuffer__\",{value:!0,enumerable:!1,configurable:!1}),d=new ArrayBuffer(0),e=String.fromCharCode,b.accessor=function(){return Uint8Array},b.allocate=function(a,c,d){return new b(a,c,d)},b.concat=function(a,c,d,e){var f,i,g,h,k,j;for((\"boolean\"==typeof c||\"string\"!=typeof c)&&(e=d,d=c,c=void 0),f=0,g=0,h=a.length;h>g;++g)b.isByteBuffer(a[g])||(a[g]=b.wrap(a[g],c)),i=a[g].limit-a[g].offset,i>0&&(f+=i);if(0===f)return new b(0,d,e);for(j=new b(f,d,e),g=0;h>g;)k=a[g++],i=k.limit-k.offset,0>=i||(j.view.set(k.view.subarray(k.offset,k.limit),j.offset),j.offset+=i);return j.limit=j.offset,j.offset=0,j},b.isByteBuffer=function(a){return (a&&a.__isByteBuffer__)===!0},b.type=function(){return ArrayBuffer},b.wrap=function(a,d,e,f){var g,h;if(\"string\"!=typeof d&&(f=e,e=d,d=void 0),\"string\"==typeof a)switch(\"undefined\"==typeof d&&(d=\"utf8\"),d){case\"base64\":return b.fromBase64(a,e);case\"hex\":return b.fromHex(a,e);case\"binary\":return b.fromBinary(a,e);case\"utf8\":return b.fromUTF8(a,e);case\"debug\":return b.fromDebug(a,e);default:throw Error(\"Unsupported encoding: \"+d)}if(null===a||\"object\"!=typeof a)throw TypeError(\"Illegal buffer\");if(b.isByteBuffer(a))return g=c.clone.call(a),g.markedOffset=-1,g;if(a instanceof Uint8Array)g=new b(0,e,f),a.length>0&&(g.buffer=a.buffer,g.offset=a.byteOffset,g.limit=a.byteOffset+a.byteLength,g.view=new Uint8Array(a.buffer));else if(a instanceof ArrayBuffer)g=new b(0,e,f),a.byteLength>0&&(g.buffer=a,g.offset=0,g.limit=a.byteLength,g.view=a.byteLength>0?new Uint8Array(a):null);else{if(\"[object Array]\"!==Object.prototype.toString.call(a))throw TypeError(\"Illegal buffer\");for(g=new b(a.length,e,f),g.limit=a.length,h=0;h<a.length;++h)g.view[h]=a[h];}return g},c.writeBitSet=function(a,b){var h,d,e,f,g,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(!(a instanceof Array))throw TypeError(\"Illegal BitSet: Not an array\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(d=b,e=a.length,f=e>>3,g=0,b+=this.writeVarint32(e,b);f--;)h=1&!!a[g++]|(1&!!a[g++])<<1|(1&!!a[g++])<<2|(1&!!a[g++])<<3|(1&!!a[g++])<<4|(1&!!a[g++])<<5|(1&!!a[g++])<<6|(1&!!a[g++])<<7,this.writeByte(h,b++);if(e>g){for(i=0,h=0;e>g;)h|=(1&!!a[g++])<<i++;this.writeByte(h,b++);}return c?(this.offset=b,this):b-d},c.readBitSet=function(a){var h,c,d,e,f,g,i,b=\"undefined\"==typeof a;for(b&&(a=this.offset),c=this.readVarint32(a),d=c.value,e=d>>3,f=0,g=[],a+=c.length;e--;)h=this.readByte(a++),g[f++]=!!(1&h),g[f++]=!!(2&h),g[f++]=!!(4&h),g[f++]=!!(8&h),g[f++]=!!(16&h),g[f++]=!!(32&h),g[f++]=!!(64&h),g[f++]=!!(128&h);if(d>f)for(i=0,h=this.readByte(a++);d>f;)g[f++]=!!(1&h>>i++);return b&&(this.offset=a),g},c.readBytes=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+a+\") <= \"+this.buffer.byteLength)}return d=this.slice(b,b+a),c&&(this.offset+=a),d},c.writeBytes=c.append,c.writeInt8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeByte=c.writeInt8,c.readInt8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],128===(128&c)&&(c=-(255-c+1)),b&&(this.offset+=1),c},c.readByte=c.readInt8,c.writeUint8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeUInt8=c.writeUint8,c.readUint8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],b&&(this.offset+=1),c},c.readUInt8=c.readUint8,c.writeInt16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeShort=c.writeInt16,c.readInt16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),32768===(32768&c)&&(c=-(65535-c+1)),b&&(this.offset+=2),c},c.readShort=c.readInt16,c.writeUint16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeUInt16=c.writeUint16,c.readUint16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),b&&(this.offset+=2),c},c.readUInt16=c.readUint16,c.writeInt32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeInt=c.writeInt32,c.readInt32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),c|=0,b&&(this.offset+=4),c},c.readInt=c.readInt32,c.writeUint32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeUInt32=c.writeUint32,c.readUint32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),b&&(this.offset+=4),c},c.readUInt32=c.readUint32,a&&(c.writeInt64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeLong=c.writeInt64,c.readInt64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!1),c&&(this.offset+=8),f},c.readLong=c.readInt64,c.writeUint64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeUInt64=c.writeUint64,c.readUint64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!0),c&&(this.offset+=8),f},c.readUInt64=c.readUint64),c.writeFloat32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,i(this.view,a,b,this.littleEndian,23,4),c&&(this.offset+=4),this},c.writeFloat=c.writeFloat32,c.readFloat32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,23,4),b&&(this.offset+=4),c},c.readFloat=c.readFloat32,c.writeFloat64=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=8,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=8,i(this.view,a,b,this.littleEndian,52,8),c&&(this.offset+=8),this},c.writeDouble=c.writeFloat64,c.readFloat64=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,52,8),b&&(this.offset+=8),c},c.readDouble=c.readFloat64,b.MAX_VARINT32_BYTES=5,b.calculateVarint32=function(a){return a>>>=0,128>a?1:16384>a?2:1<<21>a?3:1<<28>a?4:5},b.zigZagEncode32=function(a){return ((a|=0)<<1^a>>31)>>>0},b.zigZagDecode32=function(a){return 0|a>>>1^-(1&a)},c.writeVarint32=function(a,c){var f,e,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(e=b.calculateVarint32(a),c+=e,g=this.buffer.byteLength,c>g&&this.resize((g*=2)>c?g:c),c-=e,a>>>=0;a>=128;)f=128|127&a,this.view[c++]=f,a>>>=7;return this.view[c++]=a,d?(this.offset=c,this):e},c.writeVarint32ZigZag=function(a,c){return this.writeVarint32(b.zigZagEncode32(a),c)},c.readVarint32=function(a){var e,c,d,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}c=0,d=0;do{if(!this.noAssert&&a>this.limit)throw f=Error(\"Truncated\"),f.truncated=!0,f;e=this.view[a++],5>c&&(d|=(127&e)<<7*c),++c;}while(0!==(128&e));return d|=0,b?(this.offset=a,d):{value:d,length:c}},c.readVarint32ZigZag=function(a){var c=this.readVarint32(a);return \"object\"==typeof c?c.value=b.zigZagDecode32(c.value):c=b.zigZagDecode32(c),c},a&&(b.MAX_VARINT64_BYTES=10,b.calculateVarint64=function(b){\"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b));var c=b.toInt()>>>0,d=b.shiftRightUnsigned(28).toInt()>>>0,e=b.shiftRightUnsigned(56).toInt()>>>0;return 0==e?0==d?16384>c?128>c?1:2:1<<21>c?3:4:16384>d?128>d?5:6:1<<21>d?7:8:128>e?9:10},b.zigZagEncode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned()},b.zigZagDecode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned()},c.writeVarint64=function(c,d){var f,g,h,i,j,e=\"undefined\"==typeof d;if(e&&(d=this.offset),!this.noAssert){if(\"number\"==typeof c)c=a.fromNumber(c);else if(\"string\"==typeof c)c=a.fromString(c);else if(!(c&&c instanceof a))throw TypeError(\"Illegal value: \"+c+\" (not an integer or Long)\");if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}switch(\"number\"==typeof c?c=a.fromNumber(c,!1):\"string\"==typeof c?c=a.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),f=b.calculateVarint64(c),g=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,i=c.shiftRightUnsigned(56).toInt()>>>0,d+=f,j=this.buffer.byteLength,d>j&&this.resize((j*=2)>d?j:d),d-=f,f){case 10:this.view[d+9]=1&i>>>7;case 9:this.view[d+8]=9!==f?128|i:127&i;case 8:this.view[d+7]=8!==f?128|h>>>21:127&h>>>21;case 7:this.view[d+6]=7!==f?128|h>>>14:127&h>>>14;case 6:this.view[d+5]=6!==f?128|h>>>7:127&h>>>7;case 5:this.view[d+4]=5!==f?128|h:127&h;case 4:this.view[d+3]=4!==f?128|g>>>21:127&g>>>21;case 3:this.view[d+2]=3!==f?128|g>>>14:127&g>>>14;case 2:this.view[d+1]=2!==f?128|g>>>7:127&g>>>7;case 1:this.view[d]=1!==f?128|g:127&g;}return e?(this.offset+=f,this):f},c.writeVarint64ZigZag=function(a,c){return this.writeVarint64(b.zigZagEncode64(a),c)},c.readVarint64=function(b){var d,e,f,g,h,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+1+\") <= \"+this.buffer.byteLength)}if(d=b,e=0,f=0,g=0,h=0,h=this.view[b++],e=127&h,128&h&&(h=this.view[b++],e|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g|=(127&h)<<7,128&h||this.noAssert&&\"undefined\"==typeof h))))))))))throw Error(\"Buffer overrun\");return i=a.fromBits(e|f<<28,f>>>4|g<<24,!1),c?(this.offset=b,i):{value:i,length:b-d}},c.readVarint64ZigZag=function(c){var d=this.readVarint64(c);return d&&d.value instanceof a?d.value=b.zigZagDecode64(d.value):d=b.zigZagDecode64(d),d}),c.writeCString=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),e=a.length,!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");for(d=0;e>d;++d)if(0===a.charCodeAt(d))throw RangeError(\"Illegal str: Contains NULL-characters\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=k.calculateUTF16asUTF8(f(a))[1],b+=e+1,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=e+1,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),this.view[b++]=0,c?(this.offset=b,this):e},c.readCString=function(a){var c,e,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=a,f=-1,k.decodeUTF8toUTF16(function(){if(0===f)return null;if(a>=this.limit)throw RangeError(\"Illegal range: Truncated data, \"+a+\" < \"+this.limit);return f=this.view[a++],0===f?null:f}.bind(this),e=g(),!0),b?(this.offset=a,e()):{string:e(),length:a-c}},c.writeIString=function(a,b){var e,d,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(d=b,e=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],b+=4+e,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=4+e,this.littleEndian?(this.view[b+3]=255&e>>>24,this.view[b+2]=255&e>>>16,this.view[b+1]=255&e>>>8,this.view[b]=255&e):(this.view[b]=255&e>>>24,this.view[b+1]=255&e>>>16,this.view[b+2]=255&e>>>8,this.view[b+3]=255&e),b+=4,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),b!==d+4+e)throw RangeError(\"Illegal range: Truncated data, \"+b+\" == \"+(b+4+e));return c?(this.offset=b,this):b-d},c.readIString=function(a){var d,e,f,c=\"undefined\"==typeof a;\nif(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readUint32(a),f=this.readUTF8String(e,b.METRICS_BYTES,a+=4),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},b.METRICS_CHARS=\"c\",b.METRICS_BYTES=\"b\",c.writeUTF8String=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=b,d=k.calculateUTF16asUTF8(f(a))[1],b+=d,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=d,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),c?(this.offset=b,this):b-e},c.writeString=c.writeUTF8String,b.calculateUTF8Chars=function(a){return k.calculateUTF16asUTF8(f(a))[0]},b.calculateUTF8Bytes=function(a){return k.calculateUTF16asUTF8(f(a))[1]},b.calculateString=b.calculateUTF8Bytes,c.readUTF8String=function(a,c,d){var e,i,f,h,j;if(\"number\"==typeof c&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),\"undefined\"==typeof c&&(c=b.METRICS_CHARS),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(f=0,h=d,c===b.METRICS_CHARS){if(i=g(),k.decodeUTF8(function(){return a>f&&d<this.limit?this.view[d++]:null}.bind(this),function(a){++f,k.UTF8toUTF16(a,i);}),f!==a)throw RangeError(\"Illegal range: Truncated data, \"+f+\" == \"+a);return e?(this.offset=d,i()):{string:i(),length:d-h}}if(c===b.METRICS_BYTES){if(!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+a+\") <= \"+this.buffer.byteLength)}if(j=d+a,k.decodeUTF8toUTF16(function(){return j>d?this.view[d++]:null}.bind(this),i=g(),this.noAssert),d!==j)throw RangeError(\"Illegal range: Truncated data, \"+d+\" == \"+j);return e?(this.offset=d,i()):{string:i(),length:d-h}}throw TypeError(\"Unsupported metrics: \"+c)},c.readString=c.readUTF8String,c.writeVString=function(a,c){var g,h,e,i,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(e=c,g=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],h=b.calculateVarint32(g),c+=h+g,i=this.buffer.byteLength,c>i&&this.resize((i*=2)>c?i:c),c-=h+g,c+=this.writeVarint32(g,c),k.encodeUTF16toUTF8(f(a),function(a){this.view[c++]=a;}.bind(this)),c!==e+g+h)throw RangeError(\"Illegal range: Truncated data, \"+c+\" == \"+(c+g+h));return d?(this.offset=c,this):c-e},c.readVString=function(a){var d,e,f,c=\"undefined\"==typeof a;if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readVarint32(a),f=this.readUTF8String(e.value,b.METRICS_BYTES,a+=e.length),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},c.append=function(a,c,d){var e,f,g;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(d+=f,g=this.buffer.byteLength,d>g&&this.resize((g*=2)>d?g:d),d-=f,this.view.set(a.view.subarray(a.offset,a.limit),d),a.offset+=f,e&&(this.offset+=f),this)},c.appendTo=function(a,b){return a.append(this,b),this},c.assert=function(a){return this.noAssert=!a,this},c.capacity=function(){return this.buffer.byteLength},c.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},c.clone=function(a){var c=new b(0,this.littleEndian,this.noAssert);return a?(c.buffer=new ArrayBuffer(this.buffer.byteLength),c.view=new Uint8Array(c.buffer)):(c.buffer=this.buffer,c.view=this.view),c.offset=this.offset,c.markedOffset=this.markedOffset,c.limit=this.limit,c},c.compact=function(a,b){var c,e,f;if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return 0===a&&b===this.buffer.byteLength?this:(c=b-a,0===c?(this.buffer=d,this.view=null,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=0,this):(e=new ArrayBuffer(c),f=new Uint8Array(e),f.set(this.view.subarray(a,b)),this.buffer=e,this.view=f,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=c,this))},c.copy=function(a,c){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>a||a>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(a===c)return new b(0,this.littleEndian,this.noAssert);var d=c-a,e=new b(d,this.littleEndian,this.noAssert);return e.offset=0,e.limit=d,e.markedOffset>=0&&(e.markedOffset-=a),this.copyTo(e,0,a,c),e},c.copyTo=function(a,c,d,e){var f,g,h;if(!this.noAssert&&!b.isByteBuffer(a))throw TypeError(\"Illegal target: Not a ByteBuffer\");if(c=(g=\"undefined\"==typeof c)?a.offset:0|c,d=(f=\"undefined\"==typeof d)?this.offset:0|d,e=\"undefined\"==typeof e?this.limit:0|e,0>c||c>a.buffer.byteLength)throw RangeError(\"Illegal target range: 0 <= \"+c+\" <= \"+a.buffer.byteLength);if(0>d||e>this.buffer.byteLength)throw RangeError(\"Illegal source range: 0 <= \"+d+\" <= \"+this.buffer.byteLength);return h=e-d,0===h?a:(a.ensureCapacity(c+h),a.view.set(this.view.subarray(d,e),c),f&&(this.offset+=h),g&&(a.offset+=h),this)},c.ensureCapacity=function(a){var b=this.buffer.byteLength;return a>b?this.resize((b*=2)>a?b:a):this},c.fill=function(a,b,c){var d=\"undefined\"==typeof b;if(d&&(b=this.offset),\"string\"==typeof a&&a.length>0&&(a=a.charCodeAt(0)),\"undefined\"==typeof b&&(b=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal begin: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(b>=c)return this;for(;c>b;)this.view[b++]=a;return d&&(this.offset=b),this},c.flip=function(){return this.limit=this.offset,this.offset=0,this},c.mark=function(a){if(a=\"undefined\"==typeof a?this.offset:a,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return this.markedOffset=a,this},c.order=function(a){if(!this.noAssert&&\"boolean\"!=typeof a)throw TypeError(\"Illegal littleEndian: Not a boolean\");return this.littleEndian=!!a,this},c.LE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!!a:!0,this},c.BE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!a:!1,this},c.prepend=function(a,c,d){var e,f,g,h,i;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(g=f-d,g>0?(h=new ArrayBuffer(this.buffer.byteLength+g),i=new Uint8Array(h),i.set(this.view.subarray(d,this.buffer.byteLength),f),this.buffer=h,this.view=i,this.offset+=g,this.markedOffset>=0&&(this.markedOffset+=g),this.limit+=g,d+=g):new Uint8Array(this.buffer),this.view.set(a.view.subarray(a.offset,a.limit),d-f),a.offset=a.limit,e&&(this.offset-=f),this)},c.prependTo=function(a,b){return a.prepend(this,b),this},c.printDebug=function(a){\"function\"!=typeof a&&(a=console.log.bind(console)),a(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(!0));},c.remaining=function(){return this.limit-this.offset},c.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},c.resize=function(a){var b,c;if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal capacity: \"+a+\" (not an integer)\");if(a|=0,0>a)throw RangeError(\"Illegal capacity: 0 <= \"+a)}return this.buffer.byteLength<a&&(b=new ArrayBuffer(a),c=new Uint8Array(b),c.set(this.view),this.buffer=b,this.view=c),this},c.reverse=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return a===b?this:(Array.prototype.reverse.call(this.view.subarray(a,b)),this)},c.skip=function(a){if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");a|=0;}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+a+\" <= \"+this.buffer.byteLength);return this.offset=b,this},c.slice=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c=this.clone();return c.offset=a,c.limit=b,c},c.toBuffer=function(a){var e,b=this.offset,c=this.limit;if(!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal limit: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}return a||0!==b||c!==this.buffer.byteLength?b===c?d:(e=new ArrayBuffer(c-b),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b,c),0),e):this.buffer},c.toArrayBuffer=c.toBuffer,c.toString=function(a,b,c){if(\"undefined\"==typeof a)return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";switch(\"number\"==typeof a&&(a=\"utf8\",b=a,c=b),a){case\"utf8\":return this.toUTF8(b,c);case\"base64\":return this.toBase64(b,c);case\"hex\":return this.toHex(b,c);case\"binary\":return this.toBinary(b,c);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+a)}},j=function(){var d,e,a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[];for(d=0,e=b.length;e>d;++d)c[b[d]]=d;return a.encode=function(a,c){for(var d,e;null!==(d=a());)c(b[63&d>>2]),e=(3&d)<<4,null!==(d=a())?(e|=15&d>>4,c(b[63&(e|15&d>>4)]),e=(15&d)<<2,null!==(d=a())?(c(b[63&(e|3&d>>6)]),c(b[63&d])):(c(b[63&e]),c(61))):(c(b[63&e]),c(61),c(61));},a.decode=function(a,b){function g(a){throw Error(\"Illegal character code: \"+a)}for(var d,e,f;null!==(d=a());)if(e=c[d],\"undefined\"==typeof e&&g(d),null!==(d=a())&&(f=c[d],\"undefined\"==typeof f&&g(d),b(e<<2>>>0|(48&f)>>4),null!==(d=a()))){if(e=c[d],\"undefined\"==typeof e){if(61===d)break;g(d);}if(b((15&f)<<4>>>0|(60&e)>>2),null!==(d=a())){if(f=c[d],\"undefined\"==typeof f){if(61===d)break;g(d);}b((3&e)<<6>>>0|f);}}},a.test=function(a){return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a)},a}(),c.toBase64=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a=0|a,b=0|b,0>a||b>this.capacity||a>b)throw RangeError(\"begin, end\");var c;return j.encode(function(){return b>a?this.view[a++]:null}.bind(this),c=g()),c()},b.fromBase64=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");var d=new b(3*(a.length/4),c),e=0;return j.decode(f(a),function(a){d.view[e++]=a;}),d.limit=e,d},b.btoa=function(a){return b.fromBinary(a).toBase64()},b.atob=function(a){return b.fromBase64(a).toBinary()},c.toBinary=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a|=0,b|=0,0>a||b>this.capacity()||a>b)throw RangeError(\"begin, end\");if(a===b)return \"\";for(var c=[],d=[];b>a;)c.push(this.view[a++]),c.length>=1024&&(d.push(String.fromCharCode.apply(String,c)),c=[]);return d.join(\"\")+String.fromCharCode.apply(String,c)},b.fromBinary=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");for(var f,d=0,e=a.length,g=new b(e,c);e>d;){if(f=a.charCodeAt(d),f>255)throw RangeError(\"illegal char code: \"+f);g.view[d++]=f;}return g.limit=e,g},c.toDebug=function(a){for(var d,b=-1,c=this.buffer.byteLength,e=\"\",f=\"\",g=\"\";c>b;){if(-1!==b&&(d=this.view[b],e+=16>d?\"0\"+d.toString(16).toUpperCase():d.toString(16).toUpperCase(),a&&(f+=d>32&&127>d?String.fromCharCode(d):\".\")),++b,a&&b>0&&0===b%16&&b!==c){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\",e=f=\"\";}e+=b===this.offset&&b===this.limit?b===this.markedOffset?\"!\":\"|\":b===this.offset?b===this.markedOffset?\"[\":\"<\":b===this.limit?b===this.markedOffset?\"]\":\">\":b===this.markedOffset?\"'\":a||0!==b&&b!==c?\" \":\"\";}if(a&&\" \"!==e){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\";}return a?g:e},b.fromDebug=function(a,c,d){for(var i,j,e=a.length,f=new b(0|(e+1)/3,c,d),g=0,h=0,k=!1,l=!1,m=!1,n=!1,o=!1;e>g;){switch(i=a.charAt(g++)){case\"!\":if(!d){if(l||m||n){o=!0;break}l=m=n=!0;}f.offset=f.markedOffset=f.limit=h,k=!1;break;case\"|\":if(!d){if(l||n){o=!0;break}l=n=!0;}f.offset=f.limit=h,k=!1;break;case\"[\":if(!d){if(l||m){o=!0;break}l=m=!0;}f.offset=f.markedOffset=h,k=!1;break;case\"<\":if(!d){if(l){o=!0;break}l=!0;}f.offset=h,k=!1;break;case\"]\":if(!d){if(n||m){o=!0;break}n=m=!0;}f.limit=f.markedOffset=h,k=!1;break;case\">\":if(!d){if(n){o=!0;break}n=!0;}f.limit=h,k=!1;break;case\"'\":if(!d){if(m){o=!0;break}m=!0;}f.markedOffset=h,k=!1;break;case\" \":k=!1;break;default:if(!d&&k){o=!0;break}if(j=parseInt(i+a.charAt(g++),16),!d&&(isNaN(j)||0>j||j>255))throw TypeError(\"Illegal str: Not a debug encoded string\");f.view[h++]=j,k=!0;}if(o)throw TypeError(\"Illegal str: Invalid symbol at \"+g)}if(!d){if(!l||!n)throw TypeError(\"Illegal str: Missing offset or limit\");if(h<f.buffer.byteLength)throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+h+\" < \"+e)}return f},c.toHex=function(a,b){if(a=\"undefined\"==typeof a?this.offset:a,b=\"undefined\"==typeof b?this.limit:b,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}for(var d,c=new Array(b-a);b>a;)d=this.view[a++],16>d?c.push(\"0\",d.toString(16)):c.push(d.toString(16));return c.join(\"\")},b.fromHex=function(a,c,d){var g,e,f,h,i;if(!d){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(0!==a.length%2)throw TypeError(\"Illegal str: Length not a multiple of 2\")}for(e=a.length,f=new b(0|e/2,c),h=0,i=0;e>h;h+=2){if(g=parseInt(a.substring(h,h+2),16),!d&&(!isFinite(g)||0>g||g>255))throw TypeError(\"Illegal str: Contains non-hex characters\");f.view[i++]=g;}return f.limit=i,f},k=function(){var a={};return a.MAX_CODEPOINT=1114111,a.encodeUTF8=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)128>c?b(127&c):2048>c?(b(192|31&c>>6),b(128|63&c)):65536>c?(b(224|15&c>>12),b(128|63&c>>6),b(128|63&c)):(b(240|7&c>>18),b(128|63&c>>12),b(128|63&c>>6),b(128|63&c)),c=null;},a.decodeUTF8=function(a,b){for(var c,d,e,f,g=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());throw b.name=\"TruncatedError\",b.bytes=a,b};null!==(c=a());)if(0===(128&c))b(c);else if(192===(224&c))null===(d=a())&&g([c,d]),b((31&c)<<6|63&d);else if(224===(240&c))(null===(d=a())||null===(e=a()))&&g([c,d,e]),b((15&c)<<12|(63&d)<<6|63&e);else{if(240!==(248&c))throw RangeError(\"Illegal starting byte: \"+c);(null===(d=a())||null===(e=a())||null===(f=a()))&&g([c,d,e,f]),b((7&c)<<18|(63&d)<<12|(63&e)<<6|63&f);}},a.UTF16toUTF8=function(a,b){for(var c,d=null;;){if(null===(c=null!==d?d:a()))break;c>=55296&&57343>=c&&null!==(d=a())&&d>=56320&&57343>=d?(b(1024*(c-55296)+d-56320+65536),d=null):b(c);}null!==d&&b(d);},a.UTF8toUTF16=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)),c=null;},a.encodeUTF16toUTF8=function(b,c){a.UTF16toUTF8(b,function(b){a.encodeUTF8(b,c);});},a.decodeUTF8toUTF16=function(b,c){a.decodeUTF8(b,function(b){a.UTF8toUTF16(b,c);});},a.calculateCodePoint=function(a){return 128>a?1:2048>a?2:65536>a?3:4},a.calculateUTF8=function(a){for(var b,c=0;null!==(b=a());)c+=128>b?1:2048>b?2:65536>b?3:4;return c},a.calculateUTF16asUTF8=function(b){var c=0,d=0;return a.UTF16toUTF8(b,function(a){++c,d+=128>a?1:2048>a?2:65536>a?3:4;}),[c,d]},a}(),c.toUTF8=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c;try{k.decodeUTF8toUTF16(function(){return b>a?this.view[a++]:null}.bind(this),c=g());}catch(d){if(a!==b)throw RangeError(\"Illegal range: Truncated data, \"+a+\" != \"+b)}return c()},b.fromUTF8=function(a,c,d){if(!d&&\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");var e=new b(k.calculateUTF16asUTF8(f(a),!0)[1],c,d),g=0;return k.encodeUTF16toUTF8(f(a),function(a){e.view[g++]=a;}),e.limit=g,e},b}(c),e=function(b,c){var f,h,i,e={};return e.ByteBuffer=b,e.c=b,f=b,e.Long=c||null,e.VERSION=\"5.0.1\",e.WIRE_TYPES={},e.WIRE_TYPES.VARINT=0,e.WIRE_TYPES.BITS64=1,e.WIRE_TYPES.LDELIM=2,e.WIRE_TYPES.STARTGROUP=3,e.WIRE_TYPES.ENDGROUP=4,e.WIRE_TYPES.BITS32=5,e.PACKABLE_WIRE_TYPES=[e.WIRE_TYPES.VARINT,e.WIRE_TYPES.BITS64,e.WIRE_TYPES.BITS32],e.TYPES={int32:{name:\"int32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},uint64:{name:\"uint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.UZERO:void 0},sint64:{name:\"sint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},bool:{name:\"bool\",wireType:e.WIRE_TYPES.VARINT,defaultValue:!1},\"double\":{name:\"double\",wireType:e.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.UZERO:void 0},sfixed64:{name:\"sfixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.ZERO:void 0},\"float\":{name:\"float\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:e.WIRE_TYPES.STARTGROUP,defaultValue:null}},e.MAP_KEY_TYPES=[e.TYPES.int32,e.TYPES.sint32,e.TYPES.sfixed32,e.TYPES.uint32,e.TYPES.fixed32,e.TYPES.int64,e.TYPES.sint64,e.TYPES.sfixed64,e.TYPES.uint64,e.TYPES.fixed64,e.TYPES.bool,e.TYPES.string,e.TYPES.bytes],e.ID_MIN=1,e.ID_MAX=536870911,e.convertFieldsToCamelCase=!1,e.populateAccessors=!0,e.populateDefaults=!0,e.Util=function(){var a={};return a.IS_NODE=!(\"object\"!=typeof process||\"[object process]\"!=process+\"\"||process.browser),a.XHR=function(){var c,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}],b=null;for(c=0;c<a.length;c++){try{b=a[c]();}catch(d){continue}break}if(!b)throw Error(\"XMLHttpRequest is not supported\");return b},a.fetch=function(b,c){if(c&&\"function\"!=typeof c&&(c=null),a.IS_NODE)if(c)g.readFile(b,function(a,b){a?c(null):c(\"\"+b);});else try{return g.readFileSync(b)}catch(d){return null}else{var e=a.XHR();if(e.open(\"GET\",b,c?!0:!1),e.setRequestHeader(\"Accept\",\"text/plain\"),\"function\"==typeof e.overrideMimeType&&e.overrideMimeType(\"text/plain\"),!c)return e.send(null),200==e.status||0==e.status&&\"string\"==typeof e.responseText?e.responseText:null;if(e.onreadystatechange=function(){4==e.readyState&&(200==e.status||0==e.status&&\"string\"==typeof e.responseText?c(e.responseText):c(null));},4==e.readyState)return;e.send(null);}},a.toCamelCase=function(a){return a.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},a}(),e.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g},e.DotProto=function(a,b){function h(a,c){var d=-1,e=1;if(\"-\"==a.charAt(0)&&(e=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))d=parseInt(a);else if(b.NUMBER_HEX.test(a))d=parseInt(a.substring(2),16);else{if(!b.NUMBER_OCT.test(a))throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);d=parseInt(a.substring(1),8);}if(d=0|e*d,!c&&0>d)throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);return d}function i(a){var c=1;if(\"-\"==a.charAt(0)&&(c=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))return c*parseInt(a,10);if(b.NUMBER_HEX.test(a))return c*parseInt(a.substring(2),16);if(b.NUMBER_OCT.test(a))return c*parseInt(a.substring(1),8);if(\"inf\"===a)return 1/0*c;if(\"nan\"===a)return 0/0;if(b.NUMBER_FLT.test(a))return c*parseFloat(a);throw Error(\"illegal number value: \"+(0>c?\"-\":\"\")+a)}function j(a,b,c){\"undefined\"==typeof a[b]?a[b]=c:(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(c));}var f,g,c={},d=function(a){this.source=a+\"\",this.index=0,this.line=1,this.stack=[],this._stringOpen=null;},e=d.prototype;return e._readString=function(){var c,a='\"'===this._stringOpen?b.STRING_DQ:b.STRING_SQ;if(a.lastIndex=this.index-1,c=a.exec(this.source),!c)throw Error(\"unterminated string\");return this.index=a.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,c[1]},e.next=function(){var a,c,d,e,f,g;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(a=!1;b.WHITESPACE.test(d=this.source.charAt(this.index));)if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;if(\"/\"===this.source.charAt(this.index))if(++this.index,\"/\"===this.source.charAt(this.index)){for(;\"\\n\"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,a=!0;}else{if(\"*\"!==(d=this.source.charAt(this.index)))return \"/\";do{if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;c=d,d=this.source.charAt(this.index);}while(\"*\"!==c||\"/\"!==d);++this.index,a=!0;}}while(a);if(this.index===this.source.length)return null;if(e=this.index,b.DELIM.lastIndex=0,f=b.DELIM.test(this.source.charAt(e++)),!f)for(;e<this.source.length&&!b.DELIM.test(this.source.charAt(e));)++e;return g=this.source.substring(this.index,this.index=e),('\"'===g||\"'\"===g)&&(this._stringOpen=g),g},e.peek=function(){if(0===this.stack.length){var a=this.next();if(null===a)return null;this.stack.push(a);}return this.stack[0]},e.skip=function(a){var b=this.next();if(b!==a)throw Error(\"illegal '\"+b+\"', '\"+a+\"' expected\")},e.omit=function(a){return this.peek()===a?(this.next(),!0):!1},e.toString=function(){return \"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"},c.Tokenizer=d,f=function(a){this.tn=new d(a),this.proto3=!1;},g=f.prototype,g.parse=function(){var c,a={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]},d=!0;try{for(;c=this.tn.next();)switch(c){case\"package\":if(!d||null!==a[\"package\"])throw Error(\"unexpected 'package'\");if(c=this.tn.next(),!b.TYPEREF.test(c))throw Error(\"illegal package name: \"+c);this.tn.skip(\";\"),a[\"package\"]=c;break;case\"import\":if(!d)throw Error(\"unexpected 'import'\");c=this.tn.peek(),\"public\"===c&&this.tn.next(),c=this._readString(),this.tn.skip(\";\"),a.imports.push(c);break;case\"syntax\":if(!d)throw Error(\"unexpected 'syntax'\");this.tn.skip(\"=\"),\"proto3\"===(a.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(\";\");break;case\"message\":this._parseMessage(a,null),d=!1;break;case\"enum\":this._parseEnum(a),d=!1;break;case\"option\":this._parseOption(a);break;case\"service\":this._parseService(a);break;case\"extend\":this._parseExtend(a);break;default:throw Error(\"unexpected '\"+c+\"'\")}}catch(e){throw e.message=\"Parse error at line \"+this.tn.line+\": \"+e.message,e}return delete a.name,a},f.parse=function(a){return new f(a).parse()},g._readString=function(){var b,c,a=\"\";do{if(c=this.tn.next(),\"'\"!==c&&'\"'!==c)throw Error(\"illegal string delimiter: \"+c);a+=this.tn.next(),this.tn.skip(c),b=this.tn.peek();}while('\"'===b||'\"'===b);return a},g._readValue=function(a){var c=this.tn.peek();if('\"'===c||\"'\"===c)return this._readString();if(this.tn.next(),b.NUMBER.test(c))return i(c);if(b.BOOL.test(c))return \"true\"===c.toLowerCase();if(a&&b.TYPEREF.test(c))return c;throw Error(\"illegal value: \"+c)},g._parseOption=function(a,c){var f,d=this.tn.next(),e=!1;if(\"(\"===d&&(e=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal option name: \"+d);f=d,e&&(this.tn.skip(\")\"),f=\"(\"+f+\")\",d=this.tn.peek(),b.FQTYPEREF.test(d)&&(f+=d,this.tn.next())),this.tn.skip(\"=\"),this._parseOptionValue(a,f),c||this.tn.skip(\";\");},g._parseOptionValue=function(a,c){var d=this.tn.peek();if(\"{\"!==d)j(a.options,c,this._readValue(!0));else for(this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());){if(!b.NAME.test(d))throw Error(\"illegal option name: \"+c+\".\"+d);this.tn.omit(\":\")?j(a.options,c+\".\"+d,this._readValue(!0)):this._parseOptionValue(a,c+\".\"+d);}},g._parseService=function(a){var d,e,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal service name at line \"+this.tn.line+\": \"+c);for(d=c,e={name:d,rpc:{},options:{}},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(\"option\"===c)this._parseOption(e);else{if(\"rpc\"!==c)throw Error(\"illegal service token: \"+c);this._parseServiceRPC(e);}this.tn.omit(\";\"),a.services.push(e);},g._parseServiceRPC=function(a){var e,f,c=\"rpc\",d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal rpc service method name: \"+d);if(e=d,f={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.request_stream=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal rpc service request type: \"+d);if(f.request=d,this.tn.skip(\")\"),d=this.tn.next(),\"returns\"!==d.toLowerCase())throw Error(\"illegal rpc service request type delimiter: \"+d);if(this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.response_stream=!0,d=this.tn.next()),f.response=d,this.tn.skip(\")\"),d=this.tn.peek(),\"{\"===d){for(this.tn.next();\"}\"!==(d=this.tn.next());){if(\"option\"!==d)throw Error(\"illegal rpc service token: \"+d);this._parseOption(f);}this.tn.omit(\";\");}else this.tn.skip(\";\");\"undefined\"==typeof a[c]&&(a[c]={}),a[c][e]=f;},g._parseMessage=function(a,c){var d=!!c,e=this.tn.next(),f={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!b.NAME.test(e))throw Error(\"illegal \"+(d?\"group\":\"message\")+\" name: \"+e);for(f.name=e,d&&(this.tn.skip(\"=\"),c.id=h(this.tn.next()),f.isGroup=!0),e=this.tn.peek(),\"[\"===e&&c&&this._parseFieldOptions(c),this.tn.skip(\"{\");\"}\"!==(e=this.tn.next());)if(b.RULE.test(e))this._parseMessageField(f,e);else if(\"oneof\"===e)this._parseMessageOneOf(f);else if(\"enum\"===e)this._parseEnum(f);else if(\"message\"===e)this._parseMessage(f);else if(\"option\"===e)this._parseOption(f);else if(\"service\"===e)this._parseService(f);else if(\"extensions\"===e)f.extensions=this._parseExtensionRanges();else if(\"reserved\"===e)this._parseIgnored();else if(\"extend\"===e)this._parseExtend(f);else{if(!b.TYPEREF.test(e))throw Error(\"illegal message token: \"+e);if(!this.proto3)throw Error(\"illegal field rule: \"+e);this._parseMessageField(f,\"optional\",e);}return this.tn.omit(\";\"),a.messages.push(f),f},g._parseIgnored=function(){for(;\";\"!==this.tn.peek();)this.tn.next();this.tn.skip(\";\");},g._parseMessageField=function(a,c,d){var e,f,g;if(!b.RULE.test(c))throw Error(\"illegal message field rule: \"+c);if(e={rule:c,type:\"\",name:\"\",options:{},id:0},\"map\"===c){if(d)throw Error(\"illegal type: \"+d);if(this.tn.skip(\"<\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field type: \"+f);if(e.keytype=f,this.tn.skip(\",\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field: \"+f);if(e.type=f,this.tn.skip(\">\"),f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}else if(d=\"undefined\"!=typeof d?d:this.tn.next(),\"group\"===d){if(g=this._parseMessage(a,e),!/^[A-Z]/.test(g.name))throw Error(\"illegal group name: \"+g.name);e.type=g.name,e.name=g.name.toLowerCase(),this.tn.omit(\";\");}else{if(!b.TYPE.test(d)&&!b.TYPEREF.test(d))throw Error(\"illegal message field type: \"+d);if(e.type=d,f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);\ne.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}return a.fields.push(e),e},g._parseMessageOneOf=function(a){var e,d,f,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal oneof name: \"+c);for(d=c,f=[],this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)e=this._parseMessageField(a,\"optional\",c),e.oneof=d,f.push(e.id);this.tn.omit(\";\"),a.oneofs[d]=f;},g._parseFieldOptions=function(a){this.tn.skip(\"[\");for(var b,c=!0;\"]\"!==(b=this.tn.peek());)c||this.tn.skip(\",\"),this._parseOption(a,!0),c=!1;this.tn.next();},g._parseEnum=function(a){var e,c={name:\"\",values:[],options:{}},d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);for(c.name=d,this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());)if(\"option\"===d)this._parseOption(c);else{if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);this.tn.skip(\"=\"),e={name:d,id:h(this.tn.next(),!0)},d=this.tn.peek(),\"[\"===d&&this._parseFieldOptions({options:{}}),this.tn.skip(\";\"),c.values.push(e);}this.tn.omit(\";\"),a.enums.push(c);},g._parseExtensionRanges=function(){var c,d,e,b=[];do{for(d=[];;){switch(c=this.tn.next()){case\"min\":e=a.ID_MIN;break;case\"max\":e=a.ID_MAX;break;default:e=i(c);}if(d.push(e),2===d.length)break;if(\"to\"!==this.tn.peek()){d.push(e);break}this.tn.next();}b.push(d);}while(this.tn.omit(\",\"));return this.tn.skip(\";\"),b},g._parseExtend=function(a){var d,c=this.tn.next();if(!b.TYPEREF.test(c))throw Error(\"illegal extend reference: \"+c);for(d={ref:c,fields:[]},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(b.RULE.test(c))this._parseMessageField(d,c);else{if(!b.TYPEREF.test(c))throw Error(\"illegal extend token: \"+c);if(!this.proto3)throw Error(\"illegal field rule: \"+c);this._parseMessageField(d,\"optional\",c);}return this.tn.omit(\";\"),a.messages.push(d),d},g.toString=function(){return \"Parser at line \"+this.tn.line},c.Parser=f,c}(e,e.Lang),e.Reflect=function(a){function k(b){if(\"string\"==typeof b&&(b=a.TYPES[b]),\"undefined\"==typeof b.defaultValue)throw Error(\"default value for type \"+b.name+\" is not supported\");return b==a.TYPES.bytes?new f(0):b.defaultValue}function l(b,c){if(b&&\"number\"==typeof b.low&&\"number\"==typeof b.high&&\"boolean\"==typeof b.unsigned&&b.low===b.low&&b.high===b.high)return new a.Long(b.low,b.high,\"undefined\"==typeof c?b.unsigned:c);if(\"string\"==typeof b)return a.Long.fromString(b,c||!1,10);if(\"number\"==typeof b)return a.Long.fromNumber(b,c||!1);throw Error(\"not convertible to Long\")}function o(b,c){var d=c.readVarint32(),e=7&d,f=d>>>3;switch(e){case a.WIRE_TYPES.VARINT:do d=c.readUint8();while(128===(128&d));break;case a.WIRE_TYPES.BITS64:c.offset+=8;break;case a.WIRE_TYPES.LDELIM:d=c.readVarint32(),c.offset+=d;break;case a.WIRE_TYPES.STARTGROUP:o(f,c);break;case a.WIRE_TYPES.ENDGROUP:if(f===b)return !1;throw Error(\"Illegal GROUPEND after unknown group: \"+f+\" (\"+b+\" expected)\");case a.WIRE_TYPES.BITS32:c.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+b+\": \"+e)}return !0}var g,h,i,j,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,c={},d=function(a,b,c){this.builder=a,this.parent=b,this.name=c,this.className;},e=d.prototype;return e.fqn=function(){for(var a=this.name,b=this;;){if(b=b.parent,null==b)break;a=b.name+\".\"+a;}return a},e.toString=function(a){return (a?this.className+\" \":\"\")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+\" cannot be built directly\")},c.T=d,g=function(a,b,c,e,f){d.call(this,a,b,c),this.className=\"Namespace\",this.children=[],this.options=e||{},this.syntax=f||\"proto2\";},h=g.prototype=Object.create(d.prototype),h.getChildren=function(a){var b,c,d;if(a=a||null,null==a)return this.children.slice();for(b=[],c=0,d=this.children.length;d>c;++c)this.children[c]instanceof a&&b.push(this.children[c]);return b},h.addChild=function(a){var b;if(b=this.getChild(a.name))if(b instanceof m.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else{if(!(a instanceof m.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName)))throw Error(\"Duplicate name in namespace \"+this.toString(!0)+\": \"+a.name);a.name=a.originalName;}this.children.push(a);},h.getChild=function(a){var c,d,b=\"number\"==typeof a?\"id\":\"name\";for(c=0,d=this.children.length;d>c;++c)if(this.children[c][b]===a)return this.children[c];return null},h.resolve=function(a,b){var g,d=\"string\"==typeof a?a.split(\".\"):a,e=this,f=0;if(\"\"===d[f]){for(;null!==e.parent;)e=e.parent;f++;}do{do{if(!(e instanceof c.Namespace)){e=null;break}if(g=e.getChild(d[f]),!(g&&g instanceof c.T&&(!b||g instanceof c.Namespace))){e=null;break}e=g,f++;}while(f<d.length);if(null!=e)break;if(null!==this.parent)return this.parent.resolve(a,b)}while(null!=e);return e},h.qn=function(a){var e,f,b=[],d=a;do b.unshift(d.name),d=d.parent;while(null!==d);for(e=1;e<=b.length;e++)if(f=b.slice(b.length-e),a===this.resolve(f,a instanceof c.Namespace))return f.join(\".\");return a.fqn()},h.build=function(){var e,c,d,a={},b=this.children;for(c=0,d=b.length;d>c;++c)e=b[c],e instanceof g&&(a[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(a,\"$options\",{value:this.buildOpt()}),a},h.buildOpt=function(){var c,d,e,f,a={},b=Object.keys(this.options);for(c=0,d=b.length;d>c;++c)e=b[c],f=this.options[b[c]],a[e]=f;return a},h.getOption=function(a){return \"undefined\"==typeof a?this.options:\"undefined\"!=typeof this.options[a]?this.options[a]:null},c.Namespace=g,i=function(b,c,d,e){if(this.type=b,this.resolvedType=c,this.isMapKey=d,this.syntax=e,d&&a.MAP_KEY_TYPES.indexOf(b)<0)throw Error(\"Invalid map key type: \"+b.name)},j=i.prototype,i.defaultFieldValue=k,j.verifyValue=function(c){var f,g,h,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this);switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),c>4294967295?0|c:c;case a.TYPES.uint32:case a.TYPES.fixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),0>c?c>>>0:c;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if(a.Long)try{return l(c,!1)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.uint64:case a.TYPES.fixed64:if(a.Long)try{return l(c,!0)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.bool:return \"boolean\"!=typeof c&&d(typeof c,\"not a boolean\"),c;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return \"number\"!=typeof c&&d(typeof c,\"not a number\"),c;case a.TYPES.string:return \"string\"==typeof c||c&&c instanceof String||d(typeof c,\"not a string\"),\"\"+c;case a.TYPES.bytes:return b.isByteBuffer(c)?c:b.wrap(c);case a.TYPES[\"enum\"]:for(f=this.resolvedType.getChildren(a.Reflect.Enum.Value),h=0;h<f.length;h++){if(f[h].name==c)return f[h].id;if(f[h].id==c)return f[h].id}if(\"proto3\"===this.syntax)return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),(c>4294967295||0>c)&&d(typeof c,\"not in range for uint32\"),c;d(c,\"not a valid enum value\");case a.TYPES.group:case a.TYPES.message:if(c&&\"object\"==typeof c||d(typeof c,\"object expected\"),c instanceof this.resolvedType.clazz)return c;if(c instanceof a.Builder.Message){g={};for(h in c)c.hasOwnProperty(h)&&(g[h]=c[h]);c=g;}return new this.resolvedType.clazz(c)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(!0)+\": \"+c+\" (undefined type \"+this.type+\")\")},j.calculateLength=function(b,c){if(null===c)return 0;var d;switch(this.type){case a.TYPES.int32:return 0>c?f.calculateVarint64(c):f.calculateVarint32(c);case a.TYPES.uint32:return f.calculateVarint32(c);case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c));case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES[\"float\"]:return 4;case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c);case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c));case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8;case a.TYPES.bool:return 1;case a.TYPES[\"enum\"]:return f.calculateVarint32(c);case a.TYPES[\"double\"]:return 8;case a.TYPES.string:return d=f.calculateUTF8Bytes(c),f.calculateVarint32(d)+d;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");return f.calculateVarint32(c.remaining())+c.remaining();case a.TYPES.message:return d=this.resolvedType.calculate(c),f.calculateVarint32(d)+d;case a.TYPES.group:return d=this.resolvedType.calculate(c),d+f.calculateVarint32(b<<3|a.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")},j.encodeValue=function(b,c,d){var e,g;if(null===c)return d;switch(this.type){case a.TYPES.int32:0>c?d.writeVarint64(c):d.writeVarint32(c);break;case a.TYPES.uint32:d.writeVarint32(c);break;case a.TYPES.sint32:d.writeVarint32ZigZag(c);break;case a.TYPES.fixed32:d.writeUint32(c);break;case a.TYPES.sfixed32:d.writeInt32(c);break;case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c);break;case a.TYPES.sint64:d.writeVarint64ZigZag(c);break;case a.TYPES.fixed64:d.writeUint64(c);break;case a.TYPES.sfixed64:d.writeInt64(c);break;case a.TYPES.bool:\"string\"==typeof c?d.writeVarint32(\"false\"===c.toLowerCase()?0:!!c):d.writeVarint32(c?1:0);break;case a.TYPES[\"enum\"]:d.writeVarint32(c);break;case a.TYPES[\"float\"]:d.writeFloat32(c);break;case a.TYPES[\"double\"]:d.writeFloat64(c);break;case a.TYPES.string:d.writeVString(c);break;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");e=c.offset,d.writeVarint32(c.remaining()),d.append(c),c.offset=e;break;case a.TYPES.message:g=(new f).LE(),this.resolvedType.encode(c,g),d.writeVarint32(g.offset),d.append(g.flip());break;case a.TYPES.group:this.resolvedType.encode(c,d),d.writeVarint32(b<<3|a.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")}return d},j.decode=function(b,c,d){if(c!=this.type.wireType)throw Error(\"Unexpected wire type for element\");var e,f;switch(this.type){case a.TYPES.int32:return 0|b.readVarint32();case a.TYPES.uint32:return b.readVarint32()>>>0;case a.TYPES.sint32:return 0|b.readVarint32ZigZag();case a.TYPES.fixed32:return b.readUint32()>>>0;case a.TYPES.sfixed32:return 0|b.readInt32();case a.TYPES.int64:return b.readVarint64();case a.TYPES.uint64:return b.readVarint64().toUnsigned();case a.TYPES.sint64:return b.readVarint64ZigZag();case a.TYPES.fixed64:return b.readUint64();case a.TYPES.sfixed64:return b.readInt64();case a.TYPES.bool:return !!b.readVarint32();case a.TYPES[\"enum\"]:return b.readVarint32();case a.TYPES[\"float\"]:return b.readFloat();case a.TYPES[\"double\"]:return b.readDouble();case a.TYPES.string:return b.readVString();case a.TYPES.bytes:if(f=b.readVarint32(),b.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+b.remaining());return e=b.clone(),e.limit=e.offset+f,b.offset+=f,e;case a.TYPES.message:return f=b.readVarint32(),this.resolvedType.decode(b,f);case a.TYPES.group:return this.resolvedType.decode(b,-1,d)}throw Error(\"[INTERNAL] Illegal decode type\")},j.valueFromString=function(b){if(!this.isMapKey)throw Error(\"valueFromString() called on non-map-key element\");switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b));case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b);case a.TYPES.bool:return \"true\"===b;case a.TYPES.string:return this.verifyValue(b);case a.TYPES.bytes:return f.fromBinary(b)}},j.valueToString=function(b){if(!this.isMapKey)throw Error(\"valueToString() called on non-map-key element\");return this.type===a.TYPES.bytes?b.toString(\"binary\"):b.toString()},c.Element=i,m=function(a,b,c,d,e,f){g.call(this,a,b,c,d,f),this.className=\"Message\",this.extensions=void 0,this.clazz=null,this.isGroup=!!e,this._fields=null,this._fieldsById=null,this._fieldsByName=null;},n=m.prototype=Object.create(g.prototype),n.build=function(c){var d,h,e,g;if(this.clazz&&!c)return this.clazz;for(d=function(a,c){function k(b,c,d,e){var g,h,i,j,l,m,n;if(null===b||\"object\"!=typeof b)return e&&e instanceof a.Reflect.Enum&&(g=a.Reflect.Enum.getName(e.object,b),null!==g)?g:b;if(f.isByteBuffer(b))return c?b.toBase64():b.toBuffer();if(a.Long.isLong(b))return d?b.toString():a.Long.fromValue(b);if(Array.isArray(b))return h=[],b.forEach(function(a,b){h[b]=k(a,c,d,e);}),h;if(h={},b instanceof a.Map){for(i=b.entries(),j=i.next();!j.done;j=i.next())h[b.keyElem.valueToString(j.value[0])]=k(j.value[1],c,d,b.valueElem.resolvedType);return h}l=b.$type,m=void 0;for(n in b)b.hasOwnProperty(n)&&(h[n]=l&&(m=l.getChild(n))?k(b[n],c,d,m.resolvedType):k(b[n],c,d));return h}var i,j,d=c.getChildren(a.Reflect.Message.Field),e=c.getChildren(a.Reflect.Message.OneOf),g=function(b){var i,j,k,l;for(a.Builder.Message.call(this),i=0,j=e.length;j>i;++i)this[e[i].name]=null;for(i=0,j=d.length;j>i;++i)k=d[i],this[k.name]=k.repeated?[]:k.map?new a.Map(k):null,!k.required&&\"proto3\"!==c.syntax||null===k.defaultValue||(this[k.name]=k.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===b||\"object\"!=typeof b||!(\"function\"!=typeof b.encode||b instanceof g)||Array.isArray(b)||b instanceof a.Map||f.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(i=0,j=arguments.length;j>i;++i)\"undefined\"!=typeof(l=arguments[i])&&this.$set(d[i].name,l);else this.$set(b);},h=g.prototype=Object.create(a.Builder.Message.prototype);for(h.add=function(b,d,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+\"#\"+b+\" is undefined\");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+f.toString(!0));if(!f.repeated)throw Error(this+\"#\"+b+\" is not a repeated field\");d=f.verifyValue(d,!0);}return null===this[b]&&(this[b]=[]),this[b].push(d),this},h.$add=h.add,h.set=function(b,d,e){var f,g,h;if(b&&\"object\"==typeof b){e=d;for(f in b)b.hasOwnProperty(f)&&\"undefined\"!=typeof(d=b[f])&&this.$set(f,d,e);return this}if(g=c._fieldsByName[b],e)this[b]=d;else{if(!g)throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(g instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+g.toString(!0));this[g.name]=d=g.verifyValue(d);}return g&&g.oneof&&(h=this[g.oneof.name],null!==d?(null!==h&&h!==g.name&&(this[h]=null),this[g.oneof.name]=g.name):h===b&&(this[g.oneof.name]=null)),this},h.$set=h.set,h.get=function(b,d){if(d)return this[b];var e=c._fieldsByName[b];if(!(e&&e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+e.toString(!0));return this[e.name]},h.$get=h.get,i=0;i<d.length;i++)j=d[i],j instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var d,e,f,b=a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace(\"_\",\"\")});b=b.substring(0,1).toUpperCase()+b.substring(1),d=a.originalName.replace(/([A-Z])/g,function(a){return \"_\"+a}),e=function(b,c){return this[a.name]=c?b:a.verifyValue(b),this},f=function(){return this[a.name]},null===c.getChild(\"set\"+b)&&(h[\"set\"+b]=e),null===c.getChild(\"set_\"+d)&&(h[\"set_\"+d]=e),null===c.getChild(\"get\"+b)&&(h[\"get\"+b]=f),null===c.getChild(\"get_\"+d)&&(h[\"get_\"+d]=f);}(j);return h.encode=function(a,d){var e,f;\"boolean\"==typeof a&&(d=a,a=void 0),e=!1,a||(a=new b,e=!0),f=a.littleEndian;try{return c.encode(this,a.LE(),d),(e?a.flip():a).LE(f)}catch(g){throw a.LE(f),g}},g.encode=function(a,b,c){return new g(a).encode(b,c)},h.calculate=function(){return c.calculate(this)},h.encodeDelimited=function(a){var d,b=!1;return a||(a=new f,b=!0),d=(new f).LE(),c.encode(this,d).flip(),a.writeVarint32(d.remaining()),a.append(d),b?a.flip():a},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toArrayBuffer()),a}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a}},h.toHex=h.encodeHex,h.toRaw=function(a,b){return k(this,!!a,!!b,this.$type)},h.encodeJSON=function(){return JSON.stringify(k(this,!0,!0,this.$type))},g.decode=function(a,b){var d,e;\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),d=a.littleEndian;try{return e=c.decode(a.LE()),a.LE(d),e}catch(g){throw a.LE(d),g}},g.decodeDelimited=function(a,b){var d,e,g;if(\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),a.remaining()<1)return null;if(d=a.offset,e=a.readVarint32(),a.remaining()<e)return a.offset=d,null;try{return g=c.decode(a.slice(a.offset,a.offset+e).LE()),a.offset+=e,g}catch(h){throw a.offset+=e,h}},g.decode64=function(a){return g.decode(a,\"base64\")},g.decodeHex=function(a){return g.decode(a,\"hex\")},g.decodeJSON=function(a){return new g(JSON.parse(a))},h.toString=function(){return c.toString()},Object.defineProperty&&(Object.defineProperty(g,\"$options\",{value:c.buildOpt()}),Object.defineProperty(h,\"$options\",{value:g[\"$options\"]}),Object.defineProperty(g,\"$type\",{value:c}),Object.defineProperty(h,\"$type\",{value:c})),g}(a,this),this._fields=[],this._fieldsById={},this._fieldsByName={},e=0,g=this.children.length;g>e;e++)if(h=this.children[e],h instanceof t||h instanceof m||h instanceof x){if(d.hasOwnProperty(h.name))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+h.toString(!0)+\" cannot override static property '\"+h.name+\"'\");d[h.name]=h.build();}else if(h instanceof m.Field)h.build(),this._fields.push(h),this._fieldsById[h.id]=h,this._fieldsByName[h.name]=h;else if(!(h instanceof m.OneOf||h instanceof w))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+this.children[e].toString(!0));return this.clazz=d},n.encode=function(a,b,c){var e,h,f,g,i,d=null;for(f=0,g=this._fields.length;g>f;++f)e=this._fields[f],h=a[e.name],e.required&&null===h?null===d&&(d=e):e.encode(c?h:e.verifyValue(h),b,a);if(null!==d)throw i=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+d),i.encoded=b,i;return b},n.calculate=function(a){for(var e,f,b=0,c=0,d=this._fields.length;d>c;++c){if(e=this._fields[c],f=a[e.name],e.required&&null===f)throw Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+e);b+=e.calculate(f,a);}return b},n.decode=function(b,c,d){var g,h,i,j,e,f,k,l,m,n,p,q;for(c=\"number\"==typeof c?c:-1,e=b.offset,f=new this.clazz;b.offset<e+c||-1===c&&b.remaining()>0;){if(g=b.readVarint32(),h=7&g,i=g>>>3,h===a.WIRE_TYPES.ENDGROUP){if(i!==d)throw Error(\"Illegal group end indicator for \"+this.toString(!0)+\": \"+i+\" (\"+(d?d+\" expected\":\"not a group\")+\")\");break}if(j=this._fieldsById[i])j.repeated&&!j.options.packed?f[j.name].push(j.decode(h,b)):j.map?(l=j.decode(h,b),f[j.name].set(l[0],l[1])):(f[j.name]=j.decode(h,b),j.oneof&&(m=f[j.oneof.name],null!==m&&m!==j.name&&(f[m]=null),f[j.oneof.name]=j.name));else switch(h){case a.WIRE_TYPES.VARINT:b.readVarint32();break;case a.WIRE_TYPES.BITS32:b.offset+=4;break;case a.WIRE_TYPES.BITS64:b.offset+=8;break;case a.WIRE_TYPES.LDELIM:k=b.readVarint32(),b.offset+=k;break;case a.WIRE_TYPES.STARTGROUP:for(;o(i,b););break;default:throw Error(\"Illegal wire type for unknown field \"+i+\" in \"+this.toString(!0)+\"#decode: \"+h)}}for(n=0,p=this._fields.length;p>n;++n)if(j=this._fields[n],null===f[j.name])if(\"proto3\"===this.syntax)f[j.name]=j.defaultValue;else{if(j.required)throw q=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+j.name),q.decoded=f,q;a.populateDefaults&&null!==j.defaultValue&&(f[j.name]=j.defaultValue);}return f},c.Message=m,p=function(b,c,e,f,g,h,i,j,k,l){d.call(this,b,c,h),this.className=\"Message.Field\",this.required=\"required\"===e,this.repeated=\"repeated\"===e,this.map=\"map\"===e,this.keyType=f||null,this.type=g,this.resolvedType=null,this.id=i,this.options=j||{},this.defaultValue=null,this.oneof=k||null,this.syntax=l||\"proto2\",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof m.ExtensionField||(this.name=a.Util.toCamelCase(this.name));},q=p.prototype=Object.create(d.prototype),q.build=function(){this.element=new i(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new i(this.keyType,void 0,!0,this.syntax)),\"proto3\"!==this.syntax||this.repeated||this.map?\"undefined\"!=typeof this.options[\"default\"]&&(this.defaultValue=this.verifyValue(this.options[\"default\"])):this.defaultValue=i.defaultFieldValue(this.type);},q.verifyValue=function(b,c){var d,e,f;if(c=c||!1,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this),null===b)return this.required&&d(typeof b,\"required\"),\"proto3\"===this.syntax&&this.type!==a.TYPES.message&&d(typeof b,\"proto3 field without field presence cannot be null\"),null;if(this.repeated&&!c){for(Array.isArray(b)||(b=[b]),f=[],e=0;e<b.length;e++)f.push(this.element.verifyValue(b[e]));return f}return this.map&&!c?b instanceof a.Map?b:(b instanceof Object||d(typeof b,\"expected ProtoBuf.Map or raw object for map field\"),new a.Map(this,b)):(!this.repeated&&Array.isArray(b)&&d(typeof b,\"no array expected\"),this.element.verifyValue(b))},q.hasWirePresence=function(b,c){if(\"proto3\"!==this.syntax)return null!==b;if(this.oneof&&c[this.oneof.name]===this.name)return !0;switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return 0!==b;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return 0!==b.low||0!==b.high;case a.TYPES.bool:return b;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return 0!==b;case a.TYPES.string:return b.length>0;case a.TYPES.bytes:return b.remaining()>0;case a.TYPES[\"enum\"]:return 0!==b;case a.TYPES.message:return null!==b;default:return !0}},q.encode=function(b,c,d){var e,g,h,i,j;if(null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return c;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.ensureCapacity(c.offset+=1),g=c.offset,e=0;e<b.length;e++)this.element.encodeValue(this.id,b[e],c);h=c.offset-g,i=f.calculateVarint32(h),i>1&&(j=c.slice(g,c.offset),g+=i-1,c.offset=g,c.append(j)),c.writeVarint32(h,g-i);}else for(e=0;e<b.length;e++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[e],c);else this.map?b.forEach(function(b,d){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.writeVarint32(g),c.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,d,c),c.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,b,c);},this):this.hasWirePresence(b,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,c));}catch(k){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+k+\")\")}return c},q.calculate=function(b,c){var d,e,g;if(b=this.verifyValue(b),null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return 0;d=0;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),g=0,e=0;e<b.length;e++)g+=this.element.calculateLength(this.id,b[e]);d+=f.calculateVarint32(g),d+=g;}else for(e=0;e<b.length;e++)d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b[e]);else this.map?b.forEach(function(b,c){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),d+=f.calculateVarint32(g),d+=g;},this):this.hasWirePresence(b,c)&&(d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b));}catch(h){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+h+\")\")}return d},q.decode=function(b,c,d){var e,f,h,j,k,l,m,g=!this.map&&b==this.type.wireType||!d&&this.repeated&&this.options.packed&&b==a.WIRE_TYPES.LDELIM||this.map&&b==a.WIRE_TYPES.LDELIM;if(!g)throw Error(\"Illegal wire type for field \"+this.toString(!0)+\": \"+b+\" (\"+this.type.wireType+\" expected)\");if(b==a.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!d){for(f=c.readVarint32(),f=c.offset+f,h=[];c.offset<f;)h.push(this.decode(this.type.wireType,c,!0));return h}if(this.map){if(j=i.defaultFieldValue(this.keyType),e=i.defaultFieldValue(this.type),f=c.readVarint32(),c.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+c.remaining());for(k=c.clone(),k.limit=k.offset+f,c.offset+=f;k.remaining()>0;)if(l=k.readVarint32(),b=7&l,m=l>>>3,1===m)j=this.keyElement.decode(k,b,m);else{if(2!==m)throw Error(\"Unexpected tag in map field key/value submessage\");e=this.element.decode(k,b,m);}return [j,e]}return this.element.decode(c,b,this.id)},c.Message.Field=p,r=function(a,b,c,d,e,f,g){p.call(this,a,b,c,null,d,e,f,g),this.extension;},r.prototype=Object.create(p.prototype),c.Message.ExtensionField=r,s=function(a,b,c){d.call(this,a,b,c),this.fields=[];},c.Message.OneOf=s,t=function(a,b,c,d,e){g.call(this,a,b,c,d,e),this.className=\"Enum\",this.object=null;},t.getName=function(a,b){var e,d,c=Object.keys(a);for(d=0;d<c.length;++d)if(a[e=c[d]]===b)return e;return null},u=t.prototype=Object.create(g.prototype),u.build=function(b){var c,d,e,f;if(this.object&&!b)return this.object;for(c=new a.Builder.Enum,d=this.getChildren(t.Value),e=0,f=d.length;f>e;++e)c[d[e][\"name\"]]=d[e][\"id\"];return Object.defineProperty&&Object.defineProperty(c,\"$options\",{value:this.buildOpt(),enumerable:!1}),this.object=c},c.Enum=t,v=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Enum.Value\",this.id=e;},v.prototype=Object.create(d.prototype),c.Enum.Value=v,w=function(a,b,c,e){d.call(this,a,b,c),this.field=e;},w.prototype=Object.create(d.prototype),c.Extension=w,x=function(a,b,c,d){g.call(this,a,b,c,d),this.className=\"Service\",this.clazz=null;},y=x.prototype=Object.create(g.prototype),y.build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(a,b){var g,c=function(b){a.Builder.Service.call(this),this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0);};},d=c.prototype=Object.create(a.Builder.Service.prototype),e=b.getChildren(a.Reflect.Service.RPCMethod);for(g=0;g<e.length;g++)!function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(f.wrap(c));}catch(e){if(!(e instanceof TypeError))throw e}if(null===c||\"object\"!=typeof c)throw Error(\"Illegal arguments\");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c)),this.rpcImpl(a.fqn(),c,function(c,e){if(c)return d(c),void 0;try{e=a.resolvedResponseType.clazz.decode(e);}catch(f){}return e&&e instanceof a.resolvedResponseType.clazz?(d(null,e),void 0):(d(Error(\"Illegal response type received in service method \"+b.name+\"#\"+a.name)),void 0)});}catch(e){setTimeout(d.bind(this,e),0);}},c[a.name]=function(b,d,e){new c(b)[a.name](d,e);},Object.defineProperty&&(Object.defineProperty(c[a.name],\"$options\",{value:a.buildOpt()}),Object.defineProperty(d[a.name],\"$options\",{value:c[a.name][\"$options\"]}));}(e[g]);return Object.defineProperty&&(Object.defineProperty(c,\"$options\",{value:b.buildOpt()}),Object.defineProperty(d,\"$options\",{value:c[\"$options\"]}),Object.defineProperty(c,\"$type\",{value:b}),Object.defineProperty(d,\"$type\",{value:b})),c}(a,this)},c.Service=x,z=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Service.Method\",this.options=e||{};},A=z.prototype=Object.create(d.prototype),A.buildOpt=h.buildOpt,c.Service.Method=z,B=function(a,b,c,d,e,f,g,h){z.call(this,a,b,c,h),this.className=\"Service.RPCMethod\",this.requestName=d,this.responseName=e,this.requestStream=f,this.responseStream=g,this.resolvedRequestType=null,this.resolvedResponseType=null;},B.prototype=Object.create(z.prototype),c.Service.RPCMethod=B,c}(e),e.Builder=function(a,b,c){function f(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax,f(b);}),a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax;});}var d=function(a){this.ns=new c.Namespace(this,null,\"\"),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=a||{};},e=d.prototype;return d.isMessage=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values||\"undefined\"!=typeof a.rpc?!1:!0},d.isMessageField=function(a){return \"string\"!=typeof a.rule||\"string\"!=typeof a.name||\"string\"!=typeof a.type||\"undefined\"==typeof a.id?!1:!0},d.isEnum=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1},d.isService=function(a){return \"string\"==typeof a.name&&\"object\"==typeof a.rpc&&a.rpc?!0:!1},d.isExtend=function(a){return \"string\"!=typeof a.ref?!1:!0},e.reset=function(){return this.ptr=this.ns,this},e.define=function(a){if(\"string\"!=typeof a||!b.TYPEREF.test(a))throw Error(\"illegal namespace: \"+a);return a.split(\".\").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new c.Namespace(this,this.ptr,a)),this.ptr=b;},this),this},e.create=function(b){var e,f,g,h,i;if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice();}else b=[b];for(e=[b];e.length>0;){if(b=e.pop(),!Array.isArray(b))throw Error(\"not a valid namespace: \"+JSON.stringify(b));for(;b.length>0;){if(f=b.shift(),d.isMessage(f)){if(g=new c.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),h={},f.oneofs&&Object.keys(f.oneofs).forEach(function(a){g.addChild(h[a]=new c.Message.OneOf(this,g,a));},this),f.fields&&f.fields.forEach(function(a){if(null!==g.getChild(0|a.id))throw Error(\"duplicate or invalid field id in \"+g.name+\": \"+a.id);if(a.options&&\"object\"!=typeof a.options)throw Error(\"illegal field options in \"+g.name+\"#\"+a.name);var b=null;if(\"string\"==typeof a.oneof&&!(b=h[a.oneof]))throw Error(\"illegal oneof in \"+g.name+\"#\"+a.name+\": \"+a.oneof);a=new c.Message.Field(this,g,a.rule,a.keytype,a.type,a.name,a.id,a.options,b,f.syntax),b&&b.fields.push(a),g.addChild(a);},this),i=[],f.enums&&f.enums.forEach(function(a){i.push(a);}),f.messages&&f.messages.forEach(function(a){i.push(a);}),f.services&&f.services.forEach(function(a){i.push(a);}),f.extensions&&(g.extensions=\"number\"==typeof f.extensions[0]?[f.extensions]:f.extensions),this.ptr.addChild(g),i.length>0){e.push(b),b=i,i=null,this.ptr=g,g=null;continue}i=null;}else if(d.isEnum(f))g=new c.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(a){g.addChild(new c.Enum.Value(this,g,a.name,a.id));},this),this.ptr.addChild(g);else if(d.isService(f))g=new c.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(a){var b=f.rpc[a];g.addChild(new c.Service.RPCMethod(this,g,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options));},this),this.ptr.addChild(g);else{if(!d.isExtend(f))throw Error(\"not a valid definition: \"+JSON.stringify(f));if(g=this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){var d,e,f,h;if(null!==g.getChild(0|b.id))throw Error(\"duplicate extended field id in \"+g.name+\": \"+b.id);\nif(g.extensions&&(d=!1,g.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(d=!0);}),!d))throw Error(\"illegal extended field id in \"+g.name+\": \"+b.id+\" (not within valid ranges)\");e=b.name,this.options.convertFieldsToCamelCase&&(e=a.Util.toCamelCase(e)),f=new c.Message.ExtensionField(this,g,b.rule,b.type,this.ptr.fqn()+\".\"+e,b.id,b.options),h=new c.Extension(this,this.ptr,b.name,f),f.extension=h,this.ptr.addChild(h),g.addChild(f);},this);else if(!/\\.?google\\.protobuf\\./.test(f.ref))throw Error(\"extended message \"+f.ref+\" is not defined\")}f=null,g=null;}b=null,this.ptr=this.ptr.parent;}return this.resolved=!1,this.result=null,this},e[\"import\"]=function(b,c){var e,g,h,i,j,k,l,m,d=\"/\";if(\"string\"==typeof c){if(a.Util.IS_NODE,this.files[c]===!0)return this.reset();this.files[c]=!0;}else if(\"object\"==typeof c){if(e=c.root,a.Util.IS_NODE,(e.indexOf(\"\\\\\")>=0||c.file.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\"),g=e+d+c.file,this.files[g]===!0)return this.reset();this.files[g]=!0;}if(b.imports&&b.imports.length>0){for(i=!1,\"object\"==typeof c?(this.importRoot=c.root,i=!0,h=this.importRoot,c=c.file,(h.indexOf(\"\\\\\")>=0||c.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\")):\"string\"==typeof c?this.importRoot?h=this.importRoot:c.indexOf(\"/\")>=0?(h=c.replace(/\\/[^\\/]*$/,\"\"),\"\"===h&&(h=\"/\")):c.indexOf(\"\\\\\")>=0?(h=c.replace(/\\\\[^\\\\]*$/,\"\"),d=\"\\\\\"):h=\".\":h=null,j=0;j<b.imports.length;j++)if(\"string\"==typeof b.imports[j]){if(!h)throw Error(\"cannot determine import root\");if(k=b.imports[j],\"google/protobuf/descriptor.proto\"===k)continue;if(k=h+d+k,this.files[k]===!0)continue;if(/\\.proto$/i.test(k)&&!a.DotProto&&(k=k.replace(/\\.proto$/,\".json\")),l=a.Util.fetch(k),null===l)throw Error(\"failed to import '\"+k+\"' in '\"+c+\"': file not found\");/\\.json$/i.test(k)?this[\"import\"](JSON.parse(l+\"\"),k):this[\"import\"](a.DotProto.Parser.parse(l),k);}else c?/\\.(\\w+)$/.test(c)?this[\"import\"](b.imports[j],c.replace(/^(.+)\\.(\\w+)$/,function(a,b,c){return b+\"_import\"+j+\".\"+c})):this[\"import\"](b.imports[j],c+\"_import\"+j):this[\"import\"](b.imports[j]);i&&(this.importRoot=null);}return b[\"package\"]&&this.define(b[\"package\"]),b.syntax&&f(b),m=this.ptr,b.options&&Object.keys(b.options).forEach(function(a){m.options[a]=b.options[a];}),b.messages&&(this.create(b.messages),this.ptr=m),b.enums&&(this.create(b.enums),this.ptr=m),b.services&&(this.create(b.services),this.ptr=m),b[\"extends\"]&&this.create(b[\"extends\"]),this.reset()},e.resolveAll=function(){var d;if(null==this.ptr||\"object\"==typeof this.ptr.type)return this;if(this.ptr instanceof c.Namespace)this.ptr.children.forEach(function(a){this.ptr=a,this.resolveAll();},this);else if(this.ptr instanceof c.Message.Field){if(b.TYPE.test(this.ptr.type))this.ptr.type=a.TYPES[this.ptr.type];else{if(!b.TYPEREF.test(this.ptr.type))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(d=(this.ptr instanceof c.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!d)throw Error(\"unresolvable type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(this.ptr.resolvedType=d,d instanceof c.Enum){if(this.ptr.type=a.TYPES[\"enum\"],\"proto3\"===this.ptr.syntax&&\"proto3\"!==d.syntax)throw Error(\"proto3 message cannot reference proto2 enum\")}else{if(!(d instanceof c.Message))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);this.ptr.type=d.isGroup?a.TYPES.group:a.TYPES.message;}}if(this.ptr.map){if(!b.TYPE.test(this.ptr.keyType))throw Error(\"illegal key type for map field in \"+this.ptr.toString(!0)+\": \"+this.ptr.keyType);this.ptr.keyType=a.TYPES[this.ptr.keyType];}}else if(this.ptr instanceof a.Reflect.Service.Method){if(!(this.ptr instanceof a.Reflect.Service.RPCMethod))throw Error(\"illegal service type in \"+this.ptr.toString(!0));if(d=this.ptr.parent.resolve(this.ptr.requestName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.requestName);if(this.ptr.resolvedRequestType=d,d=this.ptr.parent.resolve(this.ptr.responseName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.responseName);this.ptr.resolvedResponseType=d;}else if(!(this.ptr instanceof a.Reflect.Message.OneOf||this.ptr instanceof a.Reflect.Extension||this.ptr instanceof a.Reflect.Enum.Value))throw Error(\"illegal object in namespace: \"+typeof this.ptr+\": \"+this.ptr);return this.reset()},e.build=function(a){var b,c,d;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!a)return this.result;for(b=\"string\"==typeof a?a.split(\".\"):a,c=this.result,d=0;d<b.length;d++){if(!c[b[d]]){c=null;break}c=c[b[d]];}return c},e.lookup=function(a,b){return a?this.ns.resolve(a,b):this.ns},e.toString=function(){return \"Builder\"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(e,e.Lang,e.Reflect),e.Map=function(a,b){function e(a){var b=0;return {next:function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}}var c=function(a,c){var d,e,f,g;if(!a.map)throw Error(\"field is not a map\");if(this.field=a,this.keyElem=new b.Element(a.keyType,null,!0,a.syntax),this.valueElem=new b.Element(a.type,a.resolvedType,!1,a.syntax),this.map={},Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}}),c)for(d=Object.keys(c),e=0;e<d.length;e++)f=this.keyElem.valueFromString(d[e]),g=this.valueElem.verifyValue(c[d[e]]),this.map[this.keyElem.valueToString(f)]={key:f,value:g};},d=c.prototype;return d.clear=function(){this.map={};},d[\"delete\"]=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a)),c=b in this.map;return delete this.map[b],c},d.entries=function(){var d,c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push([(d=this.map[b[c]]).key,d.value]);return e(a)},d.keys=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].key);return e(a)},d.values=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].value);return e(a)},d.forEach=function(a,b){var e,d,c=Object.keys(this.map);for(d=0;d<c.length;d++)a.call(b,(e=this.map[c[d]]).value,e.key,this);},d.set=function(a,b){var c=this.keyElem.verifyValue(a),d=this.valueElem.verifyValue(b);return this.map[this.keyElem.valueToString(c)]={key:c,value:d},this},d.get=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map?this.map[b].value:void 0},d.has=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map},c}(e,e.Reflect),e.loadProto=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=void 0),e.loadJson(e.DotProto.Parser.parse(a),b,c)},e.protoFromString=e.loadProto,e.loadProtoFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadProto(d,c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadProto(d,c,a)},e.protoFromFile=e.loadProtoFile,e.newBuilder=function(a){return a=a||{},\"undefined\"==typeof a.convertFieldsToCamelCase&&(a.convertFieldsToCamelCase=e.convertFieldsToCamelCase),\"undefined\"==typeof a.populateAccessors&&(a.populateAccessors=e.populateAccessors),new e.Builder(a)},e.loadJson=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=null),b&&\"object\"==typeof b||(b=e.newBuilder()),\"string\"==typeof a&&(a=JSON.parse(a)),b[\"import\"](a,c),b.resolveAll(),b},e.loadJsonFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadJson(JSON.parse(d),c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadJson(JSON.parse(d),c,a)},h=a,i=e.loadProto(h,void 0,\"\").build(\"Modules\").probuf}(d,c,b);return e}\n\nvar SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message \" + PBName.SetUserStatusInput + \"\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \" + PBName.NotifyMsg + \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SyncRequestMsg + \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \" + PBName.UpStreamMessage + \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n  }\\n  message \" + PBName.DownStreamMessages + \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \" + PBName.DownStreamMessage + \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = \" + FILE_TYPE.IMAGE + \";\\n    audio = \" + FILE_TYPE.AUDIO + \";\\n    video = \" + FILE_TYPE.VIDEO + \";\\n    file = \" + FILE_TYPE.FILE + \";\\n  }\\n  message \" + PBName.GetQNupTokenInput + \" {\\n    required FileType type = 1;\\n  }\\n  message \" + PBName.GetQNdownloadUrlInput + \" {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message \" + PBName.GetQNupTokenOutput + \" {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n  }\\n  message \" + PBName.GetQNdownloadUrlOutput + \" {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \" + PBName.ChrmInput + \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.ChrmPullMsg + \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.RelationQryInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \" + PBName.RelationsInput + \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \" + PBName.RelationsOutput + \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \" + PBName.CleanHisMsgInput + \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \" + PBName.QueryChatRoomInfoInput + \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \" + PBName.QueryChatRoomInfoOutput + \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message \" + PBName.MCFollowInput + \"\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \" + PBName.HistoryMsgInput + \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \" + PBName.HistoryMsgOuput + \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message \" + PBName.RtcQueryListInput + \"{\\n    optional int32 order=1;\\n  }\\n\\n  message \" + PBName.RtcKeyDeleteInput + \"{\\n    repeated string key=1;\\n  }\\n\\n  message \" + PBName.RtcValueInfo + \"{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated \" + PBName.RtcValueInfo + \" userData=2;\\n  }\\n\\n  message \" + PBName.RtcUserListOutput + \"{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated \" + PBName.RtcValueInfo + \" roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message \" + PBName.RtcInput + \"{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message \" + PBName.RtcQryOutput + \"{\\n    repeated \" + PBName.RtcValueInfo + \" outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message \" + PBName.RtcDataInput + \"{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message \" + PBName.RtcSetDataInput + \"{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.RtcTokenOutput + \"{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message \" + PBName.RtcSetOutDataInput + \"{\\n    required targetType target=1;\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message \" + PBName.RtcQryUserOutDataInput + \"{\\n    repeated string userId = 1;\\n  }\\n  message \" + PBName.RtcUserOutDataOutput + \"{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \" + PBName.SessionsAttQryInput + \"{\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.SessionsAttOutput + \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \" + PBName.SessionMsgReadInput + \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteSessionsInput + \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \" + PBName.SessionInfo + \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \" + PBName.DeleteSessionsOutput + \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteMsgInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n\\n}\\n\";\n\nvar Codec$1 = {};\n\ntry {\n  Codec$1 = protobuf(SSMsg$1);\n} catch (e) {\n  Codec$1 = {};\n}\n\nCodec$1.getModule = function (pbName) {\n  var modules = new Codec$1[pbName]();\n\n  modules.getArrayData = function () {\n    var data = modules.toArrayBuffer();\n    data = utils.ArrayBufferToArray(data);\n    return data;\n  };\n\n  return modules;\n};\n\nvar SocketCodec = Codec$1;\n\nvar isGroup$1 = common.isGroup,\n    isChatRoom$1 = common.isChatRoom;\n\nvar Codec$2 = function () {\n  function Codec$$1(option) {\n    this.codec = SocketCodec;\n    option = option || {};\n    var type = option.connectType;\n    type && this.setCodecType(type);\n  }\n\n  var _proto = Codec$$1.prototype;\n\n  _proto.setCodecType = function setCodecType(type) {\n    this.codec = type === CONNECT_TYPE.COMET ? Codec : SocketCodec;\n  };\n\n  _proto.decodeByPBName = function decodeByPBName(data, pbName, option) {\n    var _formatEventMap;\n\n    var self = this;\n    var formatEventMap = (_formatEventMap = {}, _formatEventMap[PBName.DownStreamMessages] = self.formatSyncMessages, _formatEventMap[PBName.DownStreamMessage] = self.formatReceivedMessage, _formatEventMap[PBName.UpStreamMessage] = self.formatSentMessage, _formatEventMap[PBName.HistoryMsgOuput] = self.formatHistoryMessages, _formatEventMap[PBName.RelationsOutput] = self.formatConversationList, _formatEventMap[PBName.QueryChatRoomInfoOutput] = self.formatChatRoomInfos, _formatEventMap[PBName.RtcUserListOutput] = self.formatRTCUserList, _formatEventMap[PBName.RtcQryOutput] = self.formatRTCData, _formatEventMap);\n    var decodedData = data;\n    var formatEvent = formatEventMap[pbName];\n\n    try {\n      decodedData = self.codec[pbName].decode(data);\n\n      if (utils.isObject(decodedData)) {\n        decodedData = utils.batchInt64ToTimestamp(decodedData);\n      }\n\n      if (utils.isFunction(formatEvent)) {\n        decodedData = formatEvent.call(self, decodedData, option);\n      }\n    } catch (e) {}\n\n    return decodedData;\n  };\n\n  _proto.formatMessageContent = function formatMessageContent(content) {\n    try {\n      var _content = content,\n          offset = _content.offset,\n          buffer = _content.buffer,\n          limit = _content.limit;\n\n      if (offset) {\n        content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit);\n        content = BinaryHelper.readUTF(content);\n      }\n\n      content = utils.parseJSON(content);\n    } catch (e) {}\n\n    return content;\n  };\n\n  _proto.formatSyncMessages = function formatSyncMessages(data, option) {\n    option = option || {};\n    var self = this,\n        onMessage = option.onMessage || utils.noop,\n        list = data.list,\n        syncTime = data.syncTime,\n        maxListIndex = list.length - 1;\n    var finished = data.finished;\n\n    if (utils.isUndefined(finished)) {\n      data.finished = finished = true;\n    }\n\n    data.syncTime = utils.int64ToTimestamp(syncTime);\n    data.list = utils.map(list, function (msgData, index) {\n      var message = self.formatReceivedMessage(msgData, option),\n          isLastInAPull = utils.isEqual(index, maxListIndex),\n          isFinished = isLastInAPull && finished;\n\n      try {\n        onMessage({\n          isLastInAPull: isLastInAPull,\n          message: message,\n          finished: isFinished\n        });\n      } catch (e) {\n        utils.consoleError(e);\n      }\n\n      return message;\n    });\n    return data;\n  };\n\n  _proto.formatReceivedMessage = function formatReceivedMessage(data, option) {\n    option = option || {};\n    var self = this;\n\n    var _option = option,\n        currentUserId = _option.currentUserId,\n        connectedTime = _option.connectedTime,\n        content = data.content,\n        fromUserId = data.fromUserId,\n        type = data.type,\n        groupId = data.groupId,\n        status = data.status,\n        dataTime = data.dataTime,\n        messageType = data.classname,\n        messageUId = data.msgId,\n        direction = data.direction || MESSAGE_DIRECTION.RECEIVE,\n        isSelfSend = utils.isEqual(direction, MESSAGE_DIRECTION.SEND),\n        _common$getMessageOpt = common.getMessageOptionByStatus(status),\n        isPersited = _common$getMessageOpt.isPersited,\n        isCounted = _common$getMessageOpt.isCounted,\n        isMentiond = _common$getMessageOpt.isMentiond,\n        targetId = isGroup$1(type) || isChatRoom$1(type) ? groupId : fromUserId,\n        senderUserId = isSelfSend ? currentUserId : fromUserId,\n        sentTime = utils.int64ToTimestamp(dataTime),\n        isOffLineMessage = sentTime < connectedTime,\n        isChatRoomMsg = common.isChatRoom(type);\n\n    var messageDirection = isSelfSend ? MESSAGE_DIRECTION.SEND : MESSAGE_DIRECTION.RECEIVE;\n\n    if (isChatRoomMsg && utils.isEqual(fromUserId, currentUserId)) {\n      messageDirection = MESSAGE_DIRECTION.SEND;\n    }\n\n    return {\n      type: type,\n      targetId: targetId,\n      senderUserId: senderUserId,\n      messageType: messageType,\n      messageUId: messageUId,\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond,\n      sentTime: sentTime,\n      isOffLineMessage: isOffLineMessage,\n      messageDirection: messageDirection,\n      receivedTime: common.DelayTimer.getTime(),\n      content: self.formatMessageContent(content)\n    };\n  };\n\n  _proto.formatSentMessage = function formatSentMessage(data, option) {\n    var self = this;\n\n    var content = data.content,\n        messageType = data.classname,\n        sessionId = data.sessionId,\n        messageUId = data.msgId,\n        signal = option.signal,\n        currentUserId = option.currentUserId,\n        date = signal.date,\n        topic = signal.topic,\n        targetId = signal.targetId,\n        _common$getPersitedAn = common.getPersitedAndCountedBySessionId(sessionId),\n        isPersited = _common$getPersitedAn.isPersited,\n        isCounted = _common$getPersitedAn.isCounted,\n        type = PUBLISH_TOPIC_TO_CONVERSATION_TYPE[topic] || CONVERSATION_TYPE.PRIVATE;\n\n    return {\n      type: type,\n      targetId: targetId,\n      messageType: messageType,\n      messageUId: messageUId,\n      isPersited: isPersited,\n      isCounted: isCounted,\n      senderUserId: currentUserId,\n      content: self.formatMessageContent(content),\n      sentTime: utils.secondsToMilliseconds(date),\n      receivedTime: common.DelayTimer.getTime(),\n      messageDirection: MESSAGE_DIRECTION.SEND,\n      isOffLineMessage: false\n    };\n  };\n\n  _proto.formatHistoryMessages = function formatHistoryMessages(data, option) {\n    var self = this;\n    var conversation = option.conversation || {},\n        msgList = data.list,\n        hasMsg = data.hasMsg,\n        targetId = conversation.targetId,\n        syncTime = utils.int64ToTimestamp(data.syncTime);\n    var list = [];\n    utils.forEach(msgList, function (msgData) {\n      var msg = self.formatReceivedMessage(msgData, option);\n      msg.targetId = targetId;\n      list.push(msg);\n    }, {\n      isReverse: true\n    });\n    return {\n      syncTime: syncTime,\n      list: list,\n      hasMore: !!hasMsg\n    };\n  };\n\n  _proto.formatConversationList = function formatConversationList(serverData, option) {\n    var self = this;\n    var conversationList = serverData.info;\n    var afterDecode = option.afterDecode || utils.noop;\n    conversationList = utils.map(conversationList, function (serverConversation) {\n      var msg = serverConversation.msg,\n          userId = serverConversation.userId,\n          type = serverConversation.type,\n          unreadCount = serverConversation.unreadCount;\n      msg = self.formatReceivedMessage(msg, option);\n      msg.targetId = userId;\n      var conversation = {\n        targetId: userId,\n        type: type,\n        unreadMessageCount: unreadCount,\n        latestMessage: msg\n      };\n      return afterDecode(conversation) || conversation;\n    });\n    return conversationList || [];\n  };\n\n  _proto.formatChatRoomInfos = function formatChatRoomInfos(data) {\n    var userTotalNums = data.userTotalNums,\n        userInfos = data.userInfos;\n    userInfos = utils.map(userInfos, function (user) {\n      var id = user.id,\n          time = user.time;\n      time = utils.int64ToTimestamp(time);\n      return {\n        id: id,\n        time: time\n      };\n    });\n    return {\n      userCount: userTotalNums,\n      userInfos: userInfos\n    };\n  };\n\n  _proto.formatRTCUserList = function formatRTCUserList(rtcInfos) {\n    var list = rtcInfos.list,\n        token = rtcInfos.token,\n        sessionId = rtcInfos.sessionId;\n    var users = {};\n    utils.forEach(list, function (item) {\n      var userId = item.userId,\n          userData = item.userData;\n      var tmpData = {};\n      utils.forEach(userData, function (data) {\n        var key = data.key,\n            value = data.value;\n        tmpData[key] = value;\n      });\n      users[userId] = tmpData;\n    });\n    return {\n      users: users,\n      token: token,\n      sessionId: sessionId\n    };\n  };\n\n  _proto.formatRTCData = function formatRTCData(data) {\n    var list = data.outInfo;\n    var props = {};\n    utils.forEach(list, function (item) {\n      props[item.key] = item.value;\n    });\n    return props;\n  };\n\n  _proto.formatRTCRoomInfo = function formatRTCRoomInfo(data) {\n    var id = data.roomId,\n        total = data.userCount,\n        roomData = data.roomData;\n    var room = {\n      id: id,\n      total: total\n    };\n    utils.forEach(roomData, function (data) {\n      room[data.key] = data.value;\n    });\n    return room;\n  };\n\n  _proto.encodeServerConfParams = function encodeServerConfParams() {\n    var modules = this.codec.getModule(PBName.SessionsAttQryInput);\n    modules.setNothing(1);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeUpMsg = function encodeUpMsg(conversation, option) {\n    var type = conversation.type;\n    var messageType = option.messageType,\n        isMentiond = option.isMentiond,\n        mentiondType = option.mentiondType,\n        mentiondUserIdList = option.mentiondUserIdList,\n        content = option.content,\n        pushContent = option.pushContent,\n        pushData = option.pushData,\n        directionalUserIdList = option.directionalUserIdList,\n        isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n        isVoipPush = option.isVoipPush;\n    var isGroupType = common.isGroup(type);\n    var flag = 0;\n    var modules = this.codec.getModule(PBName.UpStreamMessage);\n    var sessionId = common.getSessionId(option);\n    modules.setSessionId(sessionId);\n\n    if (isGroupType && isMentiond && content) {\n      content.mentionedInfo = {\n        userIdList: mentiondUserIdList,\n        type: mentiondType || MENTIOND_TYPE.ALL\n      };\n    }\n\n    pushContent && modules.setPushText(pushContent);\n    pushData && modules.setAppData(pushData);\n    directionalUserIdList && modules.setUserId(directionalUserIdList);\n    flag |= isVoipPush ? 0x01 : 0;\n    flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n    modules.setConfigFlag(flag);\n    modules.setClassname(messageType);\n    modules.setContent(utils.toJSON(content));\n    return modules.getArrayData();\n  };\n\n  _proto.encodeSyncMsg = function encodeSyncMsg(syncMsgArgs) {\n    var sendboxTime = syncMsgArgs.sendboxTime,\n        inboxTime = syncMsgArgs.inboxTime;\n    var modules = this.codec.getModule(PBName.SyncRequestMsg);\n    modules.setIspolling(false);\n    modules.setIsPullSend(true);\n    modules.setSendBoxSyncTime(sendboxTime);\n    modules.setSyncTime(inboxTime);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeChrmSyncMsg = function encodeChrmSyncMsg(time, count) {\n    time = time || 0;\n    count = count || 0;\n    var modules = this.codec.getModule(PBName.ChrmPullMsg);\n    modules.setCount(count);\n    modules.setSyncTime(time);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetHistoryMsg = function encodeGetHistoryMsg(conversation, option) {\n    var targetId = conversation.targetId;\n    var count = option.count,\n        order = option.order,\n        timestrap = option.timestrap;\n    var modules = this.codec.getModule(PBName.HistoryMsgInput);\n    modules.setTargetId(targetId);\n    modules.setTime(timestrap);\n    modules.setCount(count);\n    modules.setOrder(order);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetConversationList = function encodeGetConversationList(option) {\n    option = option || {};\n    var _option2 = option,\n        count = _option2.count,\n        startTime = _option2.startTime;\n    var modules = this.codec.getModule(PBName.RelationQryInput);\n    modules.setType(1);\n    modules.setCount(count);\n    modules.setStartTime(startTime);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeOldConversationList = function encodeOldConversationList(option) {\n    option = option || {};\n    var _option3 = option,\n        count = _option3.count,\n        type = _option3.type;\n    var modules = this.codec.getModule(PBName.RelationsInput);\n    type = type || CONVERSATION_TYPE.PRIVATE;\n    count = count || 0;\n    modules.setType(type);\n    modules.setCount(count);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeRemoveConversationList = function encodeRemoveConversationList(conversationList) {\n    var _this = this;\n\n    var modules = this.codec.getModule(PBName.DeleteSessionsInput);\n    var sessions = [];\n    utils.forEach(conversationList, function (conversation) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n\n      var session = _this.codec.getModule(PBName.SessionInfo);\n\n      session.setType(type);\n      session.setChannelId(targetId);\n      sessions.push(session);\n    });\n    modules.setSessions(sessions);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeDeleteMessages = function encodeDeleteMessages(conversation, messages) {\n    var type = conversation.type,\n        targetId = conversation.targetId;\n    var modules = this.codec.getModule(PBName.DeleteMsgInput);\n    var encodeMsgs = [];\n    utils.forEach(messages, function (message) {\n      encodeMsgs.push({\n        msgId: message.messageUId,\n        msgDataTime: message.sentTime,\n        direct: message.messageDirection\n      });\n    });\n    modules.setType(type);\n    modules.setConversationId(targetId);\n    modules.setMsgs(encodeMsgs);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeClearMessages = function encodeClearMessages(conversation, option) {\n    var targetId = conversation.targetId;\n    var timestrap = option.timestrap;\n    var modules = this.codec.getModule(PBName.CleanHisMsgInput);\n    timestrap = timestrap || utils.getCurrentTimestamp();\n    modules.setDataTime(timestrap);\n    modules.setTargetId(targetId);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeClearUnreadCount = function encodeClearUnreadCount(conversation, option) {\n    var type = conversation.type,\n        targetId = conversation.targetId;\n    var timestrap = option.timestrap;\n    var modules = this.codec.getModule(PBName.SessionMsgReadInput);\n    timestrap = timestrap || +new Date();\n    modules.setType(type);\n    modules.setChannelId(targetId);\n    modules.setMsgTime(timestrap);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeJoinOrQuitChatRoom = function encodeJoinOrQuitChatRoom() {\n    var modules = this.codec.getModule(PBName.ChrmInput);\n    modules.setNothing(1);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetChatRoomInfo = function encodeGetChatRoomInfo(option) {\n    option = option || {};\n    var _option4 = option,\n        count = _option4.count,\n        order = _option4.order;\n    var modules = this.codec.getModule(PBName.QueryChatRoomInfoInput);\n    modules.setCount(count);\n    modules.setOrder(order);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeJoinRTCRoom = function encodeJoinRTCRoom(room) {\n    var mode = room.mode,\n        broadcastType = room.broadcastType;\n    var modules = this.codec.getModule(PBName.RtcInput);\n    mode = mode || 0;\n    modules.setRoomType(mode);\n    !utils.isUndefined(broadcastType) && modules.setBroadcastType(broadcastType);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeQuitRTCRoom = function encodeQuitRTCRoom() {\n    return this.codec.getModule(PBName.SetUserStatusInput).getArrayData();\n  };\n\n  _proto.encodeSetRTCData = function encodeSetRTCData(key, value, isInner, apiType, message) {\n    var modules = this.codec.getModule(PBName.RtcSetDataInput);\n    modules.setInterior(isInner);\n    modules.setTarget(apiType);\n    modules.setKey(key);\n    modules.setValue(value);\n    message = message || {};\n    var _message = message,\n        name = _message.name,\n        content = _message.content;\n    !utils.isUndefined(name) && modules.setObjectName(name);\n\n    if (!utils.isUndefined(content)) {\n      if (utils.isObject(content)) {\n        content = utils.toJSON(content);\n      }\n\n      modules.setContent(content);\n    }\n\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetRTCData = function encodeGetRTCData(keys, isInner, apiType) {\n    var modules = this.codec.getModule(PBName.RtcDataInput);\n    modules.setInterior(isInner);\n    modules.setTarget(apiType);\n    modules.setKey(keys);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeRemoveRTCData = function encodeRemoveRTCData(keys, isInner, apiType, message) {\n    var modules = this.codec.getModule(PBName.RtcDataInput);\n    modules.setInterior(isInner);\n    modules.setTarget(apiType);\n    modules.setKey(keys);\n    message = message || {};\n    var _message2 = message,\n        name = _message2.name,\n        content = _message2.content;\n    !utils.isUndefined(name) && modules.setObjectName(name);\n\n    if (!utils.isUndefined(content)) {\n      if (utils.isObject(content)) {\n        content = utils.toJSON(content);\n      }\n\n      modules.setContent(content);\n    }\n\n    return modules.getArrayData();\n  };\n\n  _proto.encodeSetRTCOutData = function encodeSetRTCOutData(data, type, message) {\n    var modules = this.codec.getModule(PBName.RtcSetOutDataInput);\n    modules.setTarget(type);\n\n    if (!utils.isArray(data)) {\n      data = [data];\n    }\n\n    utils.forEach(data, function (item, index) {\n      item.key = item.key ? item.key.toString() : item.key;\n      item.value = item.value ? item.value.toString() : item.value;\n      data[index] = item;\n    });\n    modules.setValueInfo(data);\n    message = message || {};\n    var _message3 = message,\n        name = _message3.name,\n        content = _message3.content;\n    !utils.isUndefined(name) && modules.setObjectName(name);\n\n    if (!utils.isUndefined(content)) {\n      if (utils.isObject(content)) {\n        content = utils.toJSON(content);\n      }\n\n      modules.setContent(content);\n    }\n\n    return modules.getArrayData();\n  };\n\n  _proto.ecnodeGetRTCOutData = function ecnodeGetRTCOutData(userIds) {\n    var modules = this.codec.getModule(PBName.RtcQryUserOutDataInput);\n    modules.setUserId(userIds);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeSetRTCState = function encodeSetRTCState(content) {\n    var modules = this.codec.getModule(PBName.MCFollowInput);\n    var report = content.report;\n    modules.setId(report);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetRTCRoomInfo = function encodeGetRTCRoomInfo() {\n    var modules = this.codec.getModule(PBName.RtcQueryListInput);\n    modules.setOrder(2);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeSetRTCUserInfo = function encodeSetRTCUserInfo(info) {\n    var modules = this.codec.getModule(PBName.RtcValueInfo);\n    var key = info.key,\n        value = info.value;\n    modules.setKey(key);\n    modules.setValue(value);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeRemoveRTCUserInfo = function encodeRemoveRTCUserInfo(info) {\n    var modules = this.codec.getModule(PBName.RtcKeyDeleteInput);\n    var keys = info.keys || [];\n\n    if (!utils.isArray(keys)) {\n      keys = [keys];\n    }\n\n    modules.setKey(keys);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetFileToken = function encodeGetFileToken(fileType) {\n    var modules = this.codec.getModule(PBName.GetQNupTokenInput);\n    modules.setType(fileType);\n    return modules.getArrayData();\n  };\n\n  _proto.encodeGetFileUrl = function encodeGetFileUrl(fileType, fileName, originName) {\n    var modules = this.codec.getModule(PBName.GetQNdownloadUrlInput);\n    modules.setType(fileType);\n    modules.setKey(fileName);\n\n    if (originName) {\n      modules.setFileName(originName);\n    }\n\n    return modules.getArrayData();\n  };\n\n  return Codec$$1;\n}();\n\nvar Defer$2 = utils.Defer;\nvar MessageTimeSyner$1 = common.MessageTimeSyner,\n    ChatRoomMessageTimeSyner$1 = common.ChatRoomMessageTimeSyner;\nvar EVENT_NAME = {\n  MESSAGE_RECEIVED: 'msg-received'\n};\n\nvar MessagePullManager = function () {\n  function MessagePullManager(serverEngine, option) {\n    this.isPulling = true;\n    this._sentMsgCacheInPolling = {};\n    this._serverEngine = void 0;\n    this._eventEmitter = new utils.EventEmitter();\n    this._messageTimeSyner = void 0;\n    this._chatRoomMessageTimeSyner = new ChatRoomMessageTimeSyner$1();\n    this._pullMessageQueue = new utils.Queue();\n    this._pullMessageTimer = new utils.Timer({\n      type: TIMER_TYPE.INTERVAL,\n      timeout: PULL_MSG_TIME\n    });\n    var self = this;\n    var startSyncTime = option.startSyncTime;\n    var appkey = serverEngine.option.appkey,\n        userId = serverEngine._selfUserId;\n    utils.extend(self, {\n      _serverEngine: serverEngine,\n      _messageTimeSyner: new MessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId,\n        startSyncTime: startSyncTime\n      })\n    });\n    self.pull();\n\n    self._pullMessageTimer.start(self.pull, {\n      thisArg: self\n    });\n  }\n\n  var _proto = MessagePullManager.prototype;\n\n  _proto.watchMessage = function watchMessage(event) {\n    this._eventEmitter.on(EVENT_NAME.MESSAGE_RECEIVED, event);\n  };\n\n  _proto.pull = function pull(option) {\n    this._pullMessageQueue.add({\n      event: this._pullMessageList,\n      args: [option],\n      thisArg: this\n    });\n  };\n\n  _proto.setReceivedMessage = function setReceivedMessage(message) {\n    this._setPullTime(message);\n  };\n\n  _proto.setSentMessage = function setSentMessage(message) {\n    if (this.isPulling) {\n      this._setSentMsgCacheInPolling(message);\n    } else {\n      this._setPullTime(message);\n    }\n  };\n\n  _proto.resetChrmTime = function resetChrmTime(id) {\n    this._chatRoomMessageTimeSyner.set(id, 0);\n  };\n\n  _proto.close = function close() {\n    this._pullMessageTimer.stop();\n\n    this._sentMsgCacheInPolling = {};\n  };\n\n  _proto._setPullTime = function _setPullTime(message) {\n    var isChatRoom = message.type === CONVERSATION_TYPE.CHATROOM;\n    isChatRoom ? this._chatRoomMessageTimeSyner.setByMessage(message) : this._messageTimeSyner.setByMessage(message);\n  };\n\n  _proto._setSentMsgCacheInPolling = function _setSentMsgCacheInPolling(message) {\n    var messageUId = message.messageUId;\n\n    if (utils.isUndefined(messageUId)) {\n      return;\n    }\n\n    this._sentMsgCacheInPolling[messageUId] = message;\n  };\n\n  _proto._consumeSentMsgCacheInPolling = function _consumeSentMsgCacheInPolling() {\n    var self = this;\n    var _sentMsgCacheInPolling = self._sentMsgCacheInPolling;\n    utils.forEach(_sentMsgCacheInPolling, function (message) {\n      self._setPullTime(message);\n    });\n    self._sentMsgCacheInPolling = {};\n  };\n\n  _proto._displatchMessages = function _displatchMessages(option) {\n    var self = this;\n    var message = option.message,\n        finished = option.finished,\n        isPullChatRoomMsg = option.isPullChatRoomMsg,\n        normalSyncTime = option.normalSyncTime,\n        isLastInAPull = option.isLastInAPull;\n    var inboxTime = normalSyncTime.inboxTime,\n        sendboxTime = normalSyncTime.sendboxTime;\n    var sentTime = message.sentTime,\n        messageDirection = message.messageDirection,\n        messageUId = message.messageUId;\n    var isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND;\n    var pullTime = isSelfSend ? sendboxTime : inboxTime;\n\n    if (sentTime <= pullTime && !isPullChatRoomMsg) {\n      return;\n    }\n\n    if (self._sentMsgCacheInPolling[messageUId]) {\n      return;\n    }\n\n    self._eventEmitter.emit(EVENT_NAME.MESSAGE_RECEIVED, {\n      message: message,\n      finished: finished,\n      isLastInAPull: isLastInAPull\n    });\n  };\n\n  _proto._pullMessageList = function _pullMessageList(option) {\n    var self = this;\n    self.isPulling = true;\n    var _serverEngine = self._serverEngine,\n        _messageTimeSyner = self._messageTimeSyner,\n        _chatRoomMessageTimeSyner = self._chatRoomMessageTimeSyner;\n\n    var _ref = option || {},\n        serverPullTime = _ref.time,\n        type = _ref.type,\n        chrmId = _ref.chrmId,\n        count = _ref.count;\n\n    var isPullChatRoomMsg = type === PULL_MSG_TYPE.CHATROOM;\n\n    var syncTime = _messageTimeSyner.get();\n\n    var currentReceiveTime = isPullChatRoomMsg ? _chatRoomMessageTimeSyner.get(chrmId) : syncTime.inboxTime;\n    syncTime = utils.copy(syncTime);\n\n    if (serverPullTime && serverPullTime < currentReceiveTime) {\n      return Defer$2.resolve();\n    }\n\n    var onMessage = function onMessage(event) {\n      var message = event.message,\n          finished = event.finished,\n          isLastInAPull = event.isLastInAPull;\n\n      self._displatchMessages({\n        message: message,\n        finished: finished,\n        isPullChatRoomMsg: isPullChatRoomMsg,\n        isLastInAPull: isLastInAPull,\n        normalSyncTime: syncTime,\n        chatRoomReceiveTime: currentReceiveTime\n      });\n    };\n\n    var pullOption = {\n      onMessage: onMessage\n    };\n    var defer = isPullChatRoomMsg ? _serverEngine.pullChrmMessageList(chrmId, currentReceiveTime, count, pullOption) : _serverEngine.pullMessageList(syncTime, pullOption);\n    return defer.then(function (result) {\n      var finished = result.finished;\n\n      if (finished) {\n        self._consumeSentMsgCacheInPolling();\n      }\n\n      self.isPulling = !finished;\n      return result;\n    })[\"catch\"](function (error) {\n      self.isPulling = false;\n      Logger.write({\n        content: {\n          info: 'end pull error',\n          error: error\n        }\n      });\n    });\n  };\n\n  return MessagePullManager;\n}();\n\nvar DeferHandler$3 = utils.DeferHandler,\n    Defer$3 = utils.Defer;\nvar SignalId$1 = common.SignalId;\nvar EmitterName = IM_EVENT;\n\nvar ServerEngine = function () {\n  function ServerEngine(option) {\n    this._transporter = void 0;\n    this._serverEventEmitter = new utils.EventEmitter();\n    this._deferHandler = new DeferHandler$3();\n    this._messagePullManager = void 0;\n    this._serverDataCodec = void 0;\n    this._selfUserId = void 0;\n    this._connectedTime = void 0;\n    this.option = void 0;\n    var self = this;\n    var transporter = new Transporter(option);\n    transporter.watchSignal(function (signal) {\n      self._handleSignal(signal);\n    });\n    transporter.watchStatus(function (status) {\n      Logger.write({\n        content: {\n          info: 'server status changed',\n          status: status\n        }\n      });\n\n      self._handleStatus(status);\n    });\n\n    self._watchServerTask();\n\n    self._serverDataCodec = new Codec$2(option);\n    utils.extend(self, {\n      _transporter: transporter,\n      option: option\n    });\n  }\n\n  var _proto = ServerEngine.prototype;\n\n  _proto._afterConnect = function _afterConnect(_ref) {\n    var userId = _ref.userId,\n        timestamp = _ref.timestamp;\n    var self = this;\n    var isOldServer = self.option.isOldServer;\n    var getServerConfig = isOldServer ? self.getOldServerConfig : self.getServerConfig;\n    self._selfUserId = userId;\n    self._connectedTime = timestamp;\n    return getServerConfig.call(self, userId).then(function (syncTime) {\n      var messagePullManager = new MessagePullManager(self, {\n        startSyncTime: syncTime\n      });\n      messagePullManager.watchMessage(function (_ref2) {\n        var message = _ref2.message,\n            finished = _ref2.finished,\n            isLastInAPull = _ref2.isLastInAPull;\n        messagePullManager.setReceivedMessage(message);\n\n        self._notifyMessage(message, finished, isLastInAPull);\n      });\n      self._messagePullManager = messagePullManager;\n      return {\n        id: userId\n      };\n    });\n  };\n\n  _proto._handleStatus = function _handleStatus(status) {\n    if (common.isDisconnected(status)) {\n      this.disconnect();\n      var currentTime = utils.getCurrentTimestamp();\n      var isDisconnectTooFast = currentTime - this._connectedTime < MINIMUM_CONNECT_DURATION;\n      var NotSwitchStauts = [TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT];\n\n      if (isDisconnectTooFast && !utils.isInclude(NotSwitchStauts, status)) {\n        return this._serverEventEmitter.emit(EmitterName.STATUS, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST);\n      }\n    }\n\n    this._serverEventEmitter.emit(EmitterName.STATUS, status);\n  };\n\n  _proto._handleSignalAck = function _handleSignalAck(signal) {\n    var _transporter = this._transporter;\n    var messageId = signal.messageId;\n    var isQosNeedAck = signal._header && signal._header.qos !== QOS.AT_MOST_ONCE;\n\n    if (signal instanceof PublishReader && !signal.syncMsg && isQosNeedAck) {\n      var writer = new PubAckWriter(messageId);\n\n      _transporter.sendSignal(writer);\n    }\n\n    if (signal instanceof QueryAckReader && isQosNeedAck) {\n      var _writer = new QueryConWriter(messageId);\n\n      _transporter.sendSignal(_writer);\n    }\n  };\n\n  _proto._handleSignal = function _handleSignal(signal) {\n    var self = this;\n    var _deferHandler = self._deferHandler;\n    var messageId = signal.messageId;\n\n    if (messageId && signal.getIdentifier) {\n      var deferId = signal.getIdentifier();\n\n      _deferHandler.resolve(deferId, signal);\n    }\n\n    self._handleSignalAck(signal);\n\n    self._dispatchTask(signal);\n  };\n\n  _proto._watchServerTask = function _watchServerTask() {\n    var self = this;\n    var _serverEventEmitter = self._serverEventEmitter,\n        currentUserId = self._selfUserId,\n        connectedTime = self._connectedTime;\n\n    _serverEventEmitter.on(SERVER_TASK.SYNC_SELF_MSG, function (signal) {\n      self._receiveMsgFromOtherDevice(signal);\n    });\n\n    _serverEventEmitter.on(SERVER_TASK.NOTIFY_PULL, function (signal) {\n      var notifyPullConfig = self._serverDataCodec.decodeByPBName(signal.data, PBName.NotifyMsg);\n\n      self._messagePullManager.pull(notifyPullConfig);\n    });\n\n    _serverEventEmitter.on(SERVER_TASK.RECEIVE_MSG, function (signal) {\n      var _messagePullManager = self._messagePullManager;\n\n      if (!_messagePullManager || _messagePullManager.isPulling) {\n        return;\n      }\n\n      var msg = self._serverDataCodec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n        currentUserId: currentUserId,\n        connectedTime: connectedTime\n      });\n\n      self._messagePullManager.setReceivedMessage(msg);\n\n      self._notifyMessage(msg);\n    });\n  };\n\n  _proto._dispatchTask = function _dispatchTask(signal) {\n    var _serverEventEmitter = this._serverEventEmitter;\n\n    if (signal instanceof DisconnectReader) {\n      var status = signal.status;\n      status = SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS[status] || status;\n      return this._handleStatus(status);\n    }\n\n    if (signal instanceof PublishReader) {\n      var isSyncMsgSentBySelfOtherClient = signal.syncMsg,\n          topic = signal.topic;\n      var task = isSyncMsgSentBySelfOtherClient ? SERVER_TASK.SYNC_SELF_MSG : PUBLISH_TOPIC_MAP_SERVER_TASK[topic];\n      task && _serverEventEmitter.emit(task, signal);\n    }\n  };\n\n  _proto._sendSignal = function _sendSignal(writer, decodePBName, option) {\n    var appkey = this.option.appkey,\n        _serverDataCodec = this._serverDataCodec;\n    var _transporter = this._transporter,\n        _deferHandler = this._deferHandler,\n        currentUserId = this._selfUserId,\n        connectedTime = this._connectedTime;\n    var signalId = SignalId$1.get({\n      appkey: appkey,\n      userId: currentUserId\n    });\n\n    if (SignalId$1.isExceedLimit(signalId)) {\n      this._handleStatus(TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT);\n\n      return utils.Defer.reject(ERROR_INFO.TIMEOUT);\n    }\n\n    writer.messageId = signalId;\n    var deferId = writer.getIdentifier();\n    return utils.deferred(function (resolve, reject) {\n      _deferHandler.add(deferId, {\n        resolve: resolve,\n        reject: reject\n      });\n\n      _transporter.sendSignal(writer);\n    }).then(function (signal) {\n      var status = signal.status,\n          data = signal.data;\n      var isSuccess = utils.isEqual(status, SUCCESS_CODE);\n      var result = isSuccess ? signal : {\n        status: SERVER_ERROR_TO_CODE[status] || status\n      };\n\n      if (isSuccess && decodePBName) {\n        signal.data = _serverDataCodec.decodeByPBName(data, decodePBName, utils.extend({\n          signal: signal,\n          currentUserId: currentUserId,\n          connectedTime: connectedTime\n        }, option));\n      }\n\n      var exec = isSuccess ? Defer$3.resolve : Defer$3.reject;\n      return exec.call(Defer$3, result);\n    });\n  };\n\n  _proto._sendSignalForData = function _sendSignalForData(writer, decodePBName, option) {\n    return this._sendSignal(writer, decodePBName, option).then(function (successSignal) {\n      var data = decodePBName ? successSignal.data : undefined;\n      return data;\n    });\n  };\n\n  _proto._receiveMsgFromOtherDevice = function _receiveMsgFromOtherDevice(signal) {\n    var self = this;\n    var _messagePullManager = self._messagePullManager,\n        _deferHandler = self._deferHandler,\n        currentUserId = self._selfUserId,\n        connectType = self.option.connectType,\n        _serverDataCodec = self._serverDataCodec;\n    var isComet = connectType === CONNECT_TYPE.COMET;\n\n    var msg = _serverDataCodec.decodeByPBName(signal.data, PBName.UpStreamMessage, {\n      currentUserId: currentUserId,\n      signal: signal\n    });\n\n    if (isComet && !_messagePullManager.isPulling) {\n      msg.sentTime = common.DelayTimer.getTime();\n\n      _messagePullManager.setReceivedMessage(msg);\n\n      return self._notifyMessage(msg);\n    }\n\n    return utils.deferred(function (resolve, reject) {\n      var deferId = signal.getIdentifier();\n\n      _deferHandler.add(deferId, {\n        resolve: resolve,\n        reject: reject\n      });\n    }).then(function (ackSignal) {\n      msg.messageUId = ackSignal.messageUId;\n      msg.sentTime = ackSignal.timestamp;\n\n      if (!_messagePullManager.isPulling) {\n        _messagePullManager.setReceivedMessage(msg);\n\n        self._notifyMessage(msg);\n      }\n    })[\"catch\"](function (error) {\n      Logger.write({\n        content: {\n          info: 'received msg from other device error',\n          error: error,\n          msg: msg\n        }\n      });\n    });\n  };\n\n  _proto._notifyMessage = function _notifyMessage(message, finished, isLastInAPull) {\n    var self = this;\n    var _serverEventEmitter = self._serverEventEmitter;\n    finished = utils.isUndefined(finished) ? true : finished;\n\n    _serverEventEmitter.emit(EmitterName.MESSAGE, {\n      message: message,\n      isLastInAPull: isLastInAPull,\n      hasMore: !finished\n    });\n  };\n\n  _proto.watchMessage = function watchMessage(watcher) {\n    this._serverEventEmitter.on(EmitterName.MESSAGE, watcher);\n  };\n\n  _proto.watchStatus = function watchStatus(watcher) {\n    this._serverEventEmitter.on(EmitterName.STATUS, watcher);\n  };\n\n  _proto.connect = function connect(user, option) {\n    var self = this;\n    var _transporter = self._transporter;\n    return _transporter.connect(user, option).then(function (result) {\n      var isConnectSuccess = utils.isEqual(result.status, SUCCESS_CODE);\n      return isConnectSuccess ? Defer$3.resolve(result) : Defer$3.reject(result);\n    }).then(function (result) {\n      return self._afterConnect(result);\n    }, function (_ref3) {\n      var status = _ref3.status;\n      var errorInfo = CONNECT_SERVER_STATUS_MAP_ERROR_INFO[status] || {\n        code: status\n      };\n      return utils.Defer.reject(errorInfo);\n    });\n  };\n\n  _proto.disconnect = function disconnect() {\n    var appkey = this.option.appkey,\n        _messagePullManager = this._messagePullManager;\n    var _transporter = this._transporter,\n        _selfUserId = this._selfUserId;\n    _messagePullManager && _messagePullManager.close();\n    _transporter && _transporter.disconnect();\n    SignalId$1.clear({\n      appkey: appkey,\n      userId: _selfUserId\n    });\n    return Defer$3.resolve(_selfUserId);\n  };\n\n  _proto.getServerConfig = function getServerConfig() {\n    var _selfUserId = this._selfUserId,\n        _serverDataCodec = this._serverDataCodec;\n\n    var data = _serverDataCodec.encodeServerConfParams();\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_SYNC_TIME, data, _selfUserId);\n    return this._sendSignalForData(writer, PBName.SessionsAttOutput);\n  };\n\n  _proto.pullMessageList = function pullMessageList(syncMsgArgs, option) {\n    var _selfUserId = this._selfUserId,\n        _serverDataCodec = this._serverDataCodec;\n\n    var data = _serverDataCodec.encodeSyncMsg(syncMsgArgs);\n\n    var writer = new QueryWriter(QUERY_TOPIC.PULL_MSG, data, _selfUserId);\n    writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n    return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n  };\n\n  _proto.pullChrmMessageList = function pullChrmMessageList(chatRoomId, time, count, option) {\n    time = time || 0;\n    count = count || 0;\n\n    var data = this._serverDataCodec.encodeChrmSyncMsg(time, count);\n\n    var writer = new QueryWriter(QUERY_TOPIC.PULL_CHRM_MSG, data, chatRoomId);\n    writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n    return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n  };\n\n  _proto.sendMessage = function sendMessage(conversation, sendOption, topic) {\n    var self = this;\n    var currentUserId = self._selfUserId,\n        _serverDataCodec = self._serverDataCodec;\n    var type = conversation.type,\n        targetId = conversation.targetId;\n    var isStatusMessage = sendOption.isStatusMessage;\n    isStatusMessage = isStatusMessage && common.isSupportStatusMessage(type);\n    var publishTopic = topic || CONVERSATION_TYPE_TO_PUBLISH_TOPIC[type] || PUBLISH_TOPIC.PRIVATE;\n\n    if (isStatusMessage && utils.isUndefined(topic)) {\n      publishTopic = CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n    }\n\n    var data = _serverDataCodec.encodeUpMsg(conversation, sendOption);\n\n    var signal = new PublishWriter(publishTopic, data, targetId);\n    signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n\n    var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n      signal: signal,\n      currentUserId: currentUserId\n    });\n\n    if (isStatusMessage) {\n      self._sendSignal(signal)[\"catch\"](function () {});\n\n      msg.sentTime = common.DelayTimer.getTime();\n      return utils.Defer.resolve(msg);\n    }\n\n    return self._sendSignal(signal).then(function (_ref4) {\n      var messageUId = _ref4.messageUId,\n          timestamp = _ref4.timestamp;\n      msg.messageUId = messageUId;\n      msg.sentTime = timestamp;\n\n      self._messagePullManager.setSentMessage(msg);\n\n      return msg;\n    });\n  };\n\n  _proto.recallMessage = function recallMessage(conversation, message, option) {\n    var upMsgArgs = utils.extend(option || {}, message);\n    var type = conversation.type,\n        targetId = conversation.targetId;\n    var messageUId = message.messageUId,\n        sentTime = message.sentTime;\n    upMsgArgs.messageType = RECALL_MESSAGE_TYPE;\n    upMsgArgs.content = {\n      conversationType: type,\n      targetId: targetId,\n      messageUId: messageUId,\n      sentTime: sentTime\n    };\n    return this.sendMessage({\n      type: type,\n      targetId: this._selfUserId\n    }, upMsgArgs, PUBLISH_TOPIC.RECALL);\n  };\n\n  _proto.getFileToken = function getFileToken(fileType) {\n    var data = this._serverDataCodec.encodeGetFileToken(fileType);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_TOKEN, data, this._selfUserId);\n    return this._sendSignalForData(writer, PBName.GetQNupTokenOutput);\n  };\n\n  _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n    var data = this._serverDataCodec.encodeGetFileUrl(fileType, fileName, originName);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_URL, data, this._selfUserId);\n    return this._sendSignalForData(writer, PBName.GetQNdownloadUrlOutput);\n  };\n\n  _proto.getConversationList = function getConversationList(option) {\n    var _selfUserId = this._selfUserId,\n        _serverDataCodec = this._serverDataCodec;\n\n    var data = _serverDataCodec.encodeGetConversationList(option);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_LIST, data, _selfUserId);\n    return this._sendSignalForData(writer, PBName.RelationsOutput);\n  };\n\n  _proto.removeConversationList = function removeConversationList(conversationList) {\n    var _selfUserId = this._selfUserId,\n        _serverDataCodec = this._serverDataCodec;\n\n    var data = _serverDataCodec.encodeRemoveConversationList(conversationList);\n\n    var writer = new QueryWriter(QUERY_TOPIC.REMOVE_CONVERSATION_LIST, data, _selfUserId);\n    return this._sendSignalForData(writer, PBName.DeleteSessionsOutput);\n  };\n\n  _proto.removeConversation = function removeConversation(conversation) {\n    return this.removeConversationList([conversation]);\n  };\n\n  _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n    var _selfUserId = this._selfUserId,\n        _serverDataCodec = this._serverDataCodec;\n    var type = conversation.type;\n    var historyTopic = CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC[type] || QUERY_HISTORY_TOPIC.PRIVATE;\n\n    var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n    var writer = new QueryWriter(historyTopic, data, _selfUserId);\n    return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n      conversation: conversation\n    });\n  };\n\n  _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n    var _selfUserId = this._selfUserId;\n\n    var data = this._serverDataCodec.encodeDeleteMessages(conversation, messages);\n\n    var writer = new QueryWriter(QUERY_TOPIC.DELETE_MESSAGES, data, _selfUserId);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n    var _selfUserId = this._selfUserId;\n    var type = conversation.type;\n\n    var data = this._serverDataCodec.encodeClearMessages(conversation, option);\n\n    var topic = CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC[type];\n    var writer = new QueryWriter(topic, data, _selfUserId);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n    return this.getServerConfig().then(function (_ref5) {\n      var totalUnreadCount = _ref5.totalUnreadCount;\n      return totalUnreadCount;\n    });\n  };\n\n  _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n    var _selfUserId = this._selfUserId;\n\n    var data = this._serverDataCodec.encodeClearUnreadCount(conversation, option);\n\n    var writer = new QueryWriter(QUERY_TOPIC.CLEAR_UNREAD_COUNT, data, _selfUserId);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n    var self = this;\n    var id = chrm.id;\n    var count = option.count;\n\n    var data = self._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n    var writer = new QueryWriter(QUERY_TOPIC.JOIN_CHATROOM, data, id);\n    return self._sendSignalForData(writer).then(function (result) {\n      self._messagePullManager.resetChrmTime(id);\n\n      self._messagePullManager.pull({\n        count: count,\n        type: PULL_MSG_TYPE.CHATROOM,\n        time: 0,\n        chrmId: id\n      });\n\n      return result;\n    });\n  };\n\n  _proto.quitChatRoom = function quitChatRoom(chrm) {\n    var id = chrm.id;\n\n    var data = this._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n    var writer = new QueryWriter(QUERY_TOPIC.QUIT_CHATROOM, data, id);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n    var id = chrm.id;\n\n    var data = this._serverDataCodec.encodeGetChatRoomInfo(option);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_CHATROOM_INFO, data, id);\n    return this._sendSignalForData(writer, PBName.QueryChatRoomInfoOutput);\n  };\n\n  _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n    var _selfUserId = this._selfUserId,\n        _serverDataCodec = this._serverDataCodec;\n    var targetId = chrm.id;\n    var type = CONVERSATION_TYPE.CHATROOM;\n    var conversation = {\n      type: type,\n      targetId: targetId\n    };\n    var historyTopic = QUERY_HISTORY_TOPIC.CHATROOM;\n\n    var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n    var writer = new QueryWriter(historyTopic, data, _selfUserId);\n    return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n      conversation: conversation\n    });\n  };\n\n  _proto.joinRTCRoom = function joinRTCRoom(room) {\n    var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n    var writer = new QueryWriter(QUERY_TOPIC.JOIN_RTC_ROOM, data, room.id);\n    return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n  };\n\n  _proto.quitRTCRoom = function quitRTCRoom(room) {\n    var data = this._serverDataCodec.encodeQuitRTCRoom();\n\n    var writer = new QueryWriter(QUERY_TOPIC.QUIT_RTC_ROOM, data, room.id);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.RTCPing = function RTCPing(room) {\n    var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n    var writer = new PublishWriter(QUERY_TOPIC.PING_RTC, data, room.id);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.getRTCRoomInfo = function getRTCRoomInfo(room) {\n    var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_ROOM_INFO, data, room.id);\n    return this._sendSignalForData(writer, PBName.RtcRoomInfoOutput);\n  };\n\n  _proto.getRTCUserInfoList = function getRTCUserInfoList(room) {\n    var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_INFO_LIST, data, room.id);\n    return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n  };\n\n  _proto.setRTCUserInfo = function setRTCUserInfo(room, info) {\n    var data = this._serverDataCodec.encodeSetRTCUserInfo(info);\n\n    var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_USER_INFO, data, room.id);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.removeRTCUserInfo = function removeRTCUserInfo(room, info) {\n    var data = this._serverDataCodec.encodeRemoveRTCUserInfo(info);\n\n    var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_USER_INFO, data, room.id);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.setRTCData = function setRTCData(roomId, key, value, isInner, apiType, message) {\n    var data = this._serverDataCodec.encodeSetRTCData(key, value, isInner, apiType, message);\n\n    var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_DATA, data, roomId);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.getRTCData = function getRTCData(roomId, keys, isInner, apiType) {\n    var data = this._serverDataCodec.encodeGetRTCData(keys, isInner, apiType);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_DATA, data, roomId);\n    return this._sendSignalForData(writer, PBName.RtcQryOutput);\n  };\n\n  _proto.removeRTCData = function removeRTCData(roomId, keys, isInner, apiType, message) {\n    var data = this._serverDataCodec.encodeRemoveRTCData(keys, isInner, apiType, message);\n\n    var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_DATA, data, roomId);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.setRTCOutData = function setRTCOutData(roomId, rtcData, type, message) {\n    var data = this._serverDataCodec.encodeSetRTCOutData(rtcData, type, message);\n\n    var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_OUT_DATA, data, roomId);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.getRTCOutData = function getRTCOutData(roomId, userIds) {\n    var data = this._serverDataCodec.ecnodeGetRTCOutData(userIds);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_OUT_DATA, data, roomId);\n    return this._sendSignalForData(writer, PBName.RtcUserOutDataOutput);\n  };\n\n  _proto.getRTCToken = function getRTCToken(room) {\n    var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_TOKEN, data, room.id);\n    return this._sendSignalForData(writer, PBName.RtcTokenOutput);\n  };\n\n  _proto.setRTCState = function setRTCState(room, content) {\n    var data = this._serverDataCodec.encodeSetRTCState(content);\n\n    var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_STATE, data, room.id);\n    return this._sendSignalForData(writer);\n  };\n\n  _proto.getRTCUserList = function getRTCUserList(room) {\n    var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_LIST, data, room.id);\n    return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n  };\n\n  _proto.getOldServerConfig = function getOldServerConfig(userId) {\n    var appkey = this.option.appkey;\n    var syncTime = new common.MessageTimeSyner({\n      appkey: appkey,\n      userId: userId\n    }).get();\n    return Defer$3.resolve(syncTime);\n  };\n\n  _proto.getOldConversationList = function getOldConversationList(option, formatOpt) {\n    var self = this;\n    var _selfUserId = self._selfUserId;\n\n    var data = self._serverDataCodec.encodeOldConversationList(option);\n\n    var writer = new QueryWriter(QUERY_TOPIC.GET_OLD_CONVERSATION_LIST, data, _selfUserId);\n    return self._sendSignalForData(writer, PBName.RelationsOutput, formatOpt);\n  };\n\n  _proto.removeOldConversation = function removeOldConversation(conversation) {\n    var type = conversation.type,\n        targetId = conversation.targetId;\n\n    var data = this._serverDataCodec.encodeOldConversationList({\n      type: type\n    });\n\n    var writer = new QueryWriter(QUERY_TOPIC.REMOVE_OLD_CONVERSATION, data, targetId);\n    return this._sendSignalForData(writer);\n  };\n\n  return ServerEngine;\n}();\n\nvar NAVIGATORS = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\nvar MINI_SOCKET_DOMAIN_LIST = ['wsproxy.cn.ronghub.com'];\nvar MINI_COMET_DOMAIN_LIST = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\nvar NETWORK_DETECT_OPTION = {\n  url: 'https://cdn.ronghub.com/im_detecting',\n  intervalTime: 1500\n};\nvar IM_OPTION = {\n  connectType: CONNECT_TYPE.WEBSOCKET,\n  navigators: NAVIGATORS,\n  detect: NETWORK_DETECT_OPTION,\n  isOldServer: true,\n  debug: false\n};\nvar GET_MESSAGES_OPTION = {\n  count: 20,\n  order: MESSAGS_TIME_ORDER.DESC,\n  timestrap: 0\n};\nvar SEND_MESSAGE_OPTION = {\n  isMentiond: false,\n  isCounted: true,\n  isPersited: true\n};\nvar GET_CHATROOM_INFO_OPTION = {\n  count: 20,\n  order: CHATROOM_ORDER.DESC\n};\nvar JOIN_CHATROOM_OPTION = {\n  count: -1\n};\nvar GET_CHATROOM_MESSAGES = {\n  count: 20,\n  order: MESSAGS_TIME_ORDER.DESC\n};\nvar SEND_MESSAGE_TYPE_OPTION = {\n  'RC:TxtMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:ImgMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:VcMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:ImgTextMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:FileMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:HQVCMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:LBSMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:PSImgTxtMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:PSMultiImgTxtMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RCJrmf:RpMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RCJrmf:RpOpendMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:CombineMsg': {\n    isCounted: true,\n    isPersited: true\n  },\n  'RC:InfoNtf': {\n    isCounted: false,\n    isPersited: true\n  },\n  'RC:ContactNtf': {\n    isCounted: false,\n    isPersited: true\n  },\n  'RC:ProfileNtf': {\n    isCounted: false,\n    isPersited: true\n  },\n  'RC:CmdNtf': {\n    isCounted: false,\n    isPersited: true\n  },\n  'RC:GrpNtf': {\n    isCounted: false,\n    isPersited: true\n  },\n  'RC:RcCmd': {\n    isCounted: false,\n    isPersited: true\n  },\n  'RC:CmdMsg': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:TypSts': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:PSCmd': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:SRSMsg': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:RRReqMsg': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:RRRspMsg': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsChaR': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CSCha': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsEva': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsContact': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsHs': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsHsR': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsSp': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsEnd': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:CsUpdate': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:ReadNtf': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:chrmKVNotiMsg': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCAccept': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCRinging': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCSummary': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCHangup': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCInvite': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCModifyMedia': {\n    isCounted: false,\n    isPersited: false\n  },\n  'RC:VCModifyMem': {\n    isCounted: false,\n    isPersited: false\n  }\n};\n\nvar RCStorage$1 = common.RCStorage;\n\nvar LocalNaviHandler = function () {\n  function LocalNaviHandler(option) {\n    this.storage = void 0;\n    this.option = void 0;\n    var appkey = option.appkey,\n        token = option.token;\n    var UID = common.getUIDByToken(token);\n    var KEY = utils.tplEngine(STORAGE_NAVI.ROOT_KEY_TPL, {\n      appkey: appkey,\n      UID: UID\n    });\n    this.storage = new RCStorage$1(KEY);\n    this.option = option;\n  }\n\n  var _proto = LocalNaviHandler.prototype;\n\n  _proto.set = function set(resp) {\n    var connectType = this.option.connectType;\n    this.storage.set(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE, connectType);\n    this.storage.set(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED, utils.getCurrentTimestamp());\n    this.storage.set(STORAGE_NAVI.SUB_KEY.RESPONSE, resp);\n  };\n\n  _proto.clear = function clear() {\n    this.storage.clear();\n  };\n\n  _proto.getResp = function getResp() {\n    return this.storage.get(STORAGE_NAVI.SUB_KEY.RESPONSE);\n  };\n\n  _proto.isValid = function isValid() {\n    var storage = this.storage,\n        connectType = this.option.connectType;\n    var resp = this.getResp();\n\n    if (utils.isEmpty(resp)) {\n      return false;\n    }\n\n    var oldConnectType = storage.get(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE);\n    var timeWhenSaved = storage.get(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED);\n    var isSameConnectType = utils.isEqual(oldConnectType, connectType);\n    var isNotExpired = utils.getCurrentTimestamp() - timeWhenSaved < NAVI_EXPIRED_TIME;\n    return isSameConnectType && isNotExpired;\n  };\n\n  return LocalNaviHandler;\n}();\n\nvar getNaviUrl = function getNaviUrl(url, option) {\n  var appkey = option.appkey,\n      connectType = option.connectType,\n      token = option.token;\n  var encodeToken = utils.encodeURI(token);\n  var protocol = env.protocol.http;\n  var type = connectType === CONNECT_TYPE.COMET ? NAVI_TYPE.COMET : NAVI_TYPE.WEBSOCKET;\n  var random = utils.getCurrentTimestamp();\n  url = utils.getValidUrl(url);\n  var naviUrlOption = {\n    protocol: protocol,\n    url: url,\n    type: type,\n    appkey: appkey,\n    random: random,\n    token: encodeToken\n  };\n  return utils.tplEngine(NAVI_URL_TPL, naviUrlOption);\n};\n\nvar parseNaviResponse = function parseNaviResponse(responseText) {\n  var startText = NAVI_CALLBACK_NAME + '(';\n  var endText = ')';\n  var startIndex = utils.indexOf(responseText, startText) + startText.length;\n  var endIndex = utils.lastIndexOf(responseText, endText);\n\n  if (startIndex === -1 || endIndex === -1) {\n    return utils.parseJSON(responseText);\n  }\n\n  var response = utils.substring(responseText, startIndex, endIndex);\n\n  if (utils.isValidJSON(response)) {\n    return utils.parseJSON(response);\n  } else {\n    return {};\n  }\n};\n\nvar getMiniNavi = function getMiniNavi(option) {\n  var connectType = option.connectType;\n  var isComet = utils.isEqual(connectType, CONNECT_TYPE.COMET);\n  var CmpDomainList = isComet ? MINI_COMET_DOMAIN_LIST : MINI_SOCKET_DOMAIN_LIST;\n  var naviResp = {\n    backupServer: CmpDomainList.join(DOMAIN_SEPARATOR_IN_CMPLIST)\n  };\n  return utils.Defer.resolve(naviResp);\n};\n\nvar NaviManager = function () {\n  function NaviManager(option) {\n    this.option = void 0;\n    this.localNaviHandler = void 0;\n    this.option = option;\n    this.localNaviHandler = new LocalNaviHandler(option);\n  }\n\n  var _proto2 = NaviManager.prototype;\n\n  _proto2.get = function get() {\n    var self = this;\n    var option = self.option,\n        localNaviHandler = self.localNaviHandler;\n    var navigators = option.navigators,\n        token = option.token;\n\n    if (env.isMini) {\n      return getMiniNavi(option);\n    }\n\n    Logger.write({\n      content: {\n        navigators: navigators,\n        token: token\n      }\n    });\n    var localConfigForNavi = self.getLocalConfig();\n\n    if (localNaviHandler.isValid()) {\n      Logger.write({\n        content: {\n          info: 'get local navi',\n          localConfigForNavi: localConfigForNavi\n        }\n      });\n      return utils.Defer.resolve(localConfigForNavi);\n    }\n\n    var naviListInToken = common.getNaviListByToken(token);\n    navigators = naviListInToken.concat(navigators);\n    option.token = common.getValidToken(token);\n    var urlList = utils.map(navigators, function (url) {\n      return getNaviUrl(url, option);\n    });\n    return utils.requestByUrlList(urlList).then(function (_ref) {\n      var responseText = _ref.responseText;\n      Logger.write({\n        content: {\n          info: 'get remote navi resp',\n          responseText: responseText\n        }\n      });\n      var resp = parseNaviResponse(responseText);\n      var code = resp.code;\n      var isSuccess = code === NAVI_REQUEST_SUCCESS_CODE;\n\n      if (isSuccess) {\n        localNaviHandler.set(resp);\n        return resp;\n      } else if (resp && code) {\n        var error = utils.extendInShallow(NAVI_ERROR_INFO[code], {\n          msg: resp.errorMessage\n        });\n        return utils.Defer.reject(error);\n      } else {\n        return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n          error: responseText\n        }));\n      }\n    }, function (error) {\n      return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n        error: error\n      }));\n    });\n  };\n\n  _proto2.getLocalConfig = function getLocalConfig() {\n    return this.localNaviHandler.getResp();\n  };\n\n  _proto2.clear = function clear() {\n    var option = this.option;\n    var localNaviHanlder = new LocalNaviHandler(option);\n    localNaviHanlder.clear();\n  };\n\n  return NaviManager;\n}();\n\nvar CMPManager = function () {\n  function CMPManager() {\n    this.cmpDomainList = [];\n    this.invalidDomainList = [];\n    this.option = void 0;\n  }\n\n  var _proto = CMPManager.prototype;\n\n  _proto.setDomainList = function setDomainList(cmpDomainList, option) {\n    this.cmpDomainList = cmpDomainList;\n    this.option = option || {};\n  };\n\n  _proto.getFaster = function getFaster() {\n    var cmpDomainList = this.cmpDomainList,\n        invalidDomainList = this.invalidDomainList,\n        option = this.option;\n    var sniffUrlList = utils.filter(cmpDomainList, function (domain) {\n      return !utils.isInclude(invalidDomainList, domain);\n    });\n    sniffUrlList = utils.map(sniffUrlList, function (domain) {\n      var timestamp = utils.getCurrentTimestamp();\n      var url = domain + \"/ping?r=\" + timestamp;\n      return utils.getValidUrl(url, option);\n    });\n\n    if (utils.isEmpty(sniffUrlList)) {\n      return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n    }\n\n    return utils.requestForFaster(sniffUrlList, {\n      timeInterval: CMP_SNIFF_INTERNAL_TIME\n    }).then(function (_ref) {\n      var url = _ref.url,\n          index = _ref.index;\n      return {\n        url: url,\n        index: index,\n        domain: utils.getDomainByUrl(url)\n      };\n    })[\"catch\"](function () {\n      return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n    });\n  };\n\n  _proto.addInvalid = function addInvalid(domain) {\n    this.invalidDomainList.push(domain);\n  };\n\n  _proto.clearInvalid = function clearInvalid() {\n    this.invalidDomainList.length = 0;\n  };\n\n  _proto.isAllInvalid = function isAllInvalid() {\n    var cmpDomainList = this.cmpDomainList,\n        invalidDomainList = this.invalidDomainList;\n    return utils.isEqual(cmpDomainList.length, invalidDomainList.length);\n  };\n\n  return CMPManager;\n}();\n\nvar RCStorage$2 = common.RCStorage;\nvar SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n\nvar ConversationManager = function () {\n  function ConversationManager(option) {\n    this._storage = void 0;\n    this._onChanged = void 0;\n    this.updatedConversations = {};\n    var StorageKey = utils.tplEngine(STORAGE_CONVERSATION.ROOT_KEY_TPL, option);\n    this._storage = new RCStorage$2(StorageKey);\n    this._onChanged = option.onChanged || utils.noop;\n  }\n\n  var _proto = ConversationManager.prototype;\n\n  _proto._getUpdatedConversationList = function _getUpdatedConversationList() {\n    var self = this;\n    var updatedConversations = self.updatedConversations;\n    var updatedConversationList = [];\n    utils.forEach(updatedConversations, function (conversation) {\n      var storageConversation = self.get(conversation);\n      conversation.unreadMessageCount = storageConversation.unreadMessageCount || 0, conversation.hasMentiond = storageConversation.hasMentiond || false, conversation.mentiondInfo = storageConversation.mentiondInfo;\n      updatedConversationList.push(conversation);\n    });\n\n    if (utils.isEmpty(updatedConversationList)) {\n      return [];\n    }\n\n    return common.sortConversationList(updatedConversationList);\n  };\n\n  _proto._update = function _update() {\n    var self = this;\n\n    var updatedConversationList = self._getUpdatedConversationList();\n\n    if (!utils.isEmpty(updatedConversationList)) {\n      (function (list) {\n        utils.setTimeout(function () {\n          self._onChanged(list);\n\n          self.updatedConversations = {};\n        }, 0);\n      })(updatedConversationList);\n    }\n  };\n\n  _proto.addMessage = function addMessage(message, option) {\n    option = option || {};\n    var self = this,\n        _option = option,\n        isLastInAPull = _option.isLastInAPull,\n        type = message.type,\n        sentTime = message.sentTime,\n        messageDirection = message.messageDirection,\n        targetId = message.targetId,\n        content = message.content,\n        messageType = message.messageType,\n        isMentiond = message.isMentiond,\n        isCounted = message.isCounted,\n        isHasConversationType = utils.isInclude(TYPE_HAS_CONVERSATION, type);\n\n    if (!isHasConversationType) {\n      return;\n    }\n\n    var isRecall = utils.isEqual(messageType, RECALL_MESSAGE_TYPE);\n    var hasContent = utils.isObject(content);\n    var isOtherSend = messageDirection === MESSAGE_DIRECTION.RECEIVE;\n    var storageConversation = self.get({\n      type: type,\n      targetId: targetId\n    });\n    var hasChanged = false;\n    var lastUnreadTime = storageConversation.lastUnreadTime || 0;\n    var unreadMessageCount = storageConversation.unreadMessageCount || 0;\n    var isNotAdded = sentTime > lastUnreadTime;\n\n    if (isOtherSend && isCounted && isNotAdded && (hasChanged = true)) {\n      storageConversation.unreadMessageCount = unreadMessageCount + 1;\n      storageConversation.lastUnreadTime = sentTime;\n    } else if (isOtherSend && isRecall && hasContent && (hasChanged = true)) {\n      var isRecallMsgNotRead = lastUnreadTime >= content.sentTime;\n\n      if (isRecallMsgNotRead && unreadMessageCount) {\n        storageConversation.unreadMessageCount = unreadMessageCount - 1;\n      }\n    }\n\n    if (isOtherSend && isMentiond && hasContent && content.mentionedInfo && (hasChanged = true)) {\n      storageConversation.hasMentiond = true;\n      storageConversation.mentiondInfo = content.mentionedInfo;\n    }\n\n    if (hasChanged) {\n      self.set(message, storageConversation);\n    }\n\n    self._setCache(message);\n\n    var isNeedNotifyUpdate = utils.isUndefined(isLastInAPull) ? true : isLastInAPull;\n\n    if (isNeedNotifyUpdate) {\n      self._update();\n    }\n  };\n\n  _proto._setCache = function _setCache(message) {\n    var self = this;\n    var type = message.type,\n        targetId = message.targetId,\n        isPersited = message.isPersited;\n    var key = common.getConversationKey(message);\n    var cacheConversation = self.updatedConversations[key] || {};\n    cacheConversation = common.fixConversationData(cacheConversation);\n    var cacheMsgSentTime = cacheConversation.latestMessage.sentTime || 0;\n    var newMsgSentTime = message.sentTime;\n    var isMsgNotAdded = cacheMsgSentTime <= newMsgSentTime;\n\n    if (isPersited && isMsgNotAdded) {\n      cacheConversation = {\n        type: type,\n        targetId: targetId,\n        latestMessage: message\n      };\n      self.updatedConversations[key] = cacheConversation;\n    }\n  };\n\n  _proto.set = function set(option, storageConversationOption) {\n    var _setVals;\n\n    var unreadMessageCount = storageConversationOption.unreadMessageCount,\n        lastUnreadTime = storageConversationOption.lastUnreadTime,\n        hasMentiond = storageConversationOption.hasMentiond,\n        mentiondInfo = storageConversationOption.mentiondInfo,\n        key = common.getConversationKey(option),\n        storageConversation = this._storage.get(key) || {},\n        setVals = (_setVals = {}, _setVals[SUB_KEY.UNREAD_COUNT] = {\n      val: unreadMessageCount\n    }, _setVals[SUB_KEY.UNREAD_LAST_TIME] = {\n      val: lastUnreadTime\n    }, _setVals[SUB_KEY.HAS_MENTIOND] = {\n      val: hasMentiond,\n      checkEvent: function checkEvent(val) {\n        return val;\n      }\n    }, _setVals[SUB_KEY.MENTIOND_INFO] = {\n      val: mentiondInfo,\n      checkEvent: utils.isObject\n    }, _setVals);\n    utils.forEach(setVals, function (_ref, key) {\n      var val = _ref.val,\n          checkEvent = _ref.checkEvent;\n\n      checkEvent = checkEvent || function (val) {\n        return !utils.isEmpty(val);\n      };\n\n      if (utils.isUndefined(val)) {\n        return;\n      }\n\n      if (checkEvent(val)) {\n        storageConversation[key] = val;\n      } else {\n        delete storageConversation[key];\n      }\n    });\n\n    this._storage.set(key, storageConversation);\n  };\n\n  _proto.get = function get(option) {\n    var key = common.getConversationKey(option);\n    var storageConversation = this._storage.get(key) || {};\n    return {\n      unreadMessageCount: storageConversation[SUB_KEY.UNREAD_COUNT] || 0,\n      lastUnreadTime: storageConversation[SUB_KEY.UNREAD_LAST_TIME] || 0,\n      hasMentiond: storageConversation[SUB_KEY.HAS_MENTIOND] || false,\n      mentiondInfo: storageConversation[SUB_KEY.MENTIOND_INFO]\n    };\n  };\n\n  _proto.remove = function remove(option) {\n    var key = common.getConversationKey(option);\n\n    this._storage.remove(key);\n  };\n\n  _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n    var allVals = this._storage.getValues() || {};\n    var totalCount = 0;\n    utils.forEach(allVals, function (val) {\n      var count = val[SUB_KEY.UNREAD_COUNT] || 0;\n      totalCount += count;\n    });\n    return totalCount;\n  };\n\n  _proto.read = function read(option) {\n    var self = this;\n    var key = common.getConversationKey(option);\n    var localConversation = self.get(option) || {};\n    var localUnread = localConversation.unreadMessageCount;\n\n    if (localUnread) {\n      self.remove(option);\n      var cacheConversation = self.updatedConversations[key];\n\n      if (cacheConversation) ; else {\n        self.updatedConversations[key] = option;\n      }\n\n      self._update();\n    }\n  };\n\n  return ConversationManager;\n}();\n\nvar WebIMEngine = function () {\n  function WebIMEngine(option) {\n    this._option = void 0;\n    this._user = void 0;\n    this._naviManager = void 0;\n    this._cmpManager = new CMPManager();\n    this._conversationManager = void 0;\n    this._serverEngine = void 0;\n    this._imEventEmitter = new utils.EventEmitter();\n    this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n    this._connectedDomain = void 0;\n    this._networkDetecter = void 0;\n    var self = this;\n    var _imEventEmitter = self._imEventEmitter;\n    var detect = option.detect;\n    var serverEngine = new ServerEngine(option);\n    serverEngine.watchStatus(function (status) {\n      self._handleConnectionStatus(status);\n    });\n    serverEngine.watchMessage(function (event) {\n      var message = event.message,\n          hasMore = event.hasMore,\n          isLastInAPull = event.isLastInAPull;\n\n      self._conversationManager.addMessage(message, {\n        hasMore: hasMore,\n        isLastInAPull: isLastInAPull\n      });\n\n      _imEventEmitter.emit(IM_EVENT.MESSAGE, {\n        message: message,\n        hasMore: hasMore\n      });\n    });\n    this._serverEngine = serverEngine;\n    this._option = option;\n    this._networkDetecter = new utils.NetworkDetecter(detect);\n    utils.forEach(ServerEngine.prototype, function (event, eventName) {\n      var server = serverEngine,\n          web = self;\n      var selfEvent = web[eventName],\n          serverEvent = server[eventName];\n\n      if (!selfEvent && serverEvent && utils.isFunction(serverEvent)) {\n        web[eventName] = function () {\n          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n            args[_key] = arguments[_key];\n          }\n\n          return serverEvent.call.apply(serverEvent, [server].concat(args));\n        };\n      }\n    });\n  }\n\n  var _proto = WebIMEngine.prototype;\n\n  _proto._handleConnectionStatus = function _handleConnectionStatus(status) {\n    var _cmpManager = this._cmpManager,\n        _naviManager = this._naviManager,\n        _connectedDomain = this._connectedDomain;\n    var isNeedUpdateCMPList = utils.isInclude(TRANSPORTER_STATUS_NEED_UPDATE_CMP, status);\n    var isNeedReconnect = utils.isInclude(TRANSPORTER_STATUS_NEED_RECONNECT, status);\n\n    if (isNeedUpdateCMPList) {\n      _cmpManager.addInvalid(_connectedDomain);\n\n      if (_cmpManager.isAllInvalid()) {\n        _naviManager.clear();\n\n        _cmpManager.clearInvalid();\n      }\n    }\n\n    if (isNeedReconnect) {\n      this.reconnect();\n    }\n\n    var connectionStatus = TRANSPORTER_STATUS_TO_CONNECTION_STATUS[status] || status;\n    this._connectionStatus = connectionStatus;\n\n    this._imEventEmitter.emit(IM_EVENT.STATUS, {\n      status: connectionStatus\n    });\n  };\n\n  _proto._handleConnectError = function _handleConnectError(errorInfo) {\n    var _user = this._user;\n    var code = errorInfo.code || errorInfo.status;\n\n    this._serverEngine.disconnect();\n\n    if (code === ERROR_INFO.CONN_REDIRECTED.code) {\n      this._naviManager.clear();\n\n      return this.connect(_user);\n    }\n\n    this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n    return utils.Defer.reject(errorInfo);\n  };\n\n  _proto.watch = function watch(watchers) {\n    var statusWatcher = watchers.status,\n        messageWatcher = watchers.message,\n        conversationWatcher = watchers.conversation;\n\n    this._imEventEmitter.on(IM_EVENT.STATUS, function (event) {\n      statusWatcher && statusWatcher(event);\n    });\n\n    this._imEventEmitter.on(IM_EVENT.MESSAGE, function (event) {\n      messageWatcher && messageWatcher(event);\n    });\n\n    this._imEventEmitter.on(IM_EVENT.CONVERSATION, function (event) {\n      conversationWatcher && conversationWatcher(event);\n    });\n  };\n\n  _proto.unwatch = function unwatch(watchers) {\n    var _imEventEmitter = this._imEventEmitter;\n\n    if (watchers) {\n      var statusWatcher = watchers.status,\n          messageWatcher = watchers.message,\n          conversationWatcher = watchers.conversation;\n      statusWatcher && _imEventEmitter.off(IM_EVENT.STATUS, statusWatcher);\n      messageWatcher && _imEventEmitter.off(IM_EVENT.MESSAGE, messageWatcher);\n      conversationWatcher && _imEventEmitter.off(IM_EVENT.CONVERSATION, conversationWatcher);\n    } else {\n      _imEventEmitter.clear();\n    }\n  };\n\n  _proto.getConnectionStatus = function getConnectionStatus() {\n    return this._connectionStatus;\n  };\n\n  _proto.getConnectionUserId = function getConnectionUserId() {\n    var user = this._user || {};\n    return user.id;\n  };\n\n  _proto.getAppInfo = function getAppInfo() {\n    var _option = this._option,\n        _naviManager = this._naviManager;\n    return utils.extend({\n      navi: _naviManager.getLocalConfig()\n    }, _option);\n  };\n\n  _proto.connect = function connect(user) {\n    this._handleConnectionStatus(CONNECTION_STATUS.CONNECTING);\n\n    var self = this;\n    var _option = self._option,\n        _serverEngine = self._serverEngine,\n        _cmpManager = self._cmpManager,\n        _imEventEmitter = self._imEventEmitter;\n    var naviOpt = common.getNavReqOption(_option, user);\n    var naviManager = new NaviManager(naviOpt);\n    self._user = utils.copy(user);\n    self._naviManager = naviManager;\n    return naviManager.get().then(function (configForNavi) {\n      var cmpDomainList = common.getCMPDomainList(configForNavi);\n\n      _cmpManager.setDomainList(cmpDomainList);\n\n      return _cmpManager.getFaster();\n    }).then(function (_ref) {\n      var domain = _ref.domain;\n      self._connectedDomain = domain;\n      return _serverEngine.connect(user, {\n        domain: domain\n      });\n    }).then(function (connectUser) {\n      var id = connectUser.id;\n      self._conversationManager = new ConversationManager({\n        appkey: _option.appkey,\n        userId: id,\n        onChanged: function onChanged(updatedConversationList) {\n          _imEventEmitter.emit(IM_EVENT.CONVERSATION, {\n            updatedConversationList: updatedConversationList\n          });\n        }\n      });\n      self._user.id = id;\n      return connectUser;\n    }, function (error) {\n      return self._handleConnectError(error);\n    });\n  };\n\n  _proto.reconnect = function reconnect() {\n    var self = this;\n    var _user = self._user;\n\n    if (utils.isUndefined(_user)) {\n      return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n    }\n\n    return self._networkDetecter.start().then(function () {\n      return self.connect(_user);\n    });\n  };\n\n  _proto.disconnect = function disconnect() {\n    this._handleConnectionStatus(CONNECTION_STATUS.DISCONNECTED);\n\n    this._networkDetecter.stop();\n\n    return this._serverEngine.disconnect();\n  };\n\n  _proto.changeUser = function changeUser(user) {\n    this.disconnect();\n    return this.connect(user);\n  };\n\n  _proto.sendMessage = function sendMessage(conversation, option) {\n    var self = this;\n    return self._serverEngine.sendMessage(conversation, option).then(function (message) {\n      self._conversationManager.addMessage(message);\n\n      return message;\n    });\n  };\n\n  _proto.recallMessage = function recallMessage(conversation, message, option) {\n    var self = this;\n    return self._serverEngine.recallMessage(conversation, message, option).then(function (message) {\n      self._conversationManager.addMessage(message);\n\n      return message;\n    });\n  };\n\n  _proto.getConversationList = function getConversationList(option) {\n    var isOldServer = this._option.isOldServer,\n        _serverEngine = this._serverEngine,\n        _conversationManager = this._conversationManager;\n    var func = isOldServer ? _serverEngine.getOldConversationList : _serverEngine.getConversationList;\n    return func.call(_serverEngine, option, {\n      afterDecode: function afterDecode(conversation) {\n        var localConversation = _conversationManager.get(conversation);\n\n        conversation.unreadMessageCount = localConversation.unreadMessageCount || 0;\n        conversation.hasMentiond = localConversation.hasMentiond || false;\n        conversation.mentiondInfo = localConversation.mentiondInfo;\n        return conversation;\n      }\n    });\n  };\n\n  _proto.getLocalConversation = function getLocalConversation(conversation) {\n    var local = this._conversationManager.get(conversation);\n\n    return {\n      unreadMessageCount: local.unreadMessageCount || 0,\n      hasMentiond: local.hasMentiond || false,\n      mentiondInfo: local.mentiondInfo\n    };\n  };\n\n  _proto.removeConversation = function removeConversation(conversation) {\n    var isOldServer = this._option.isOldServer,\n        _serverEngine = this._serverEngine;\n    var func = isOldServer ? _serverEngine.removeOldConversation : _serverEngine.removeConversation;\n    return func.call(_serverEngine, conversation);\n  };\n\n  _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n    var isOldServer = this._option.isOldServer,\n        _serverEngine = this._serverEngine;\n\n    if (isOldServer) {\n      var totalCount = this._conversationManager.getTotalUnreadCount();\n\n      return utils.Defer.resolve(totalCount);\n    } else {\n      return _serverEngine.getTotalUnreadCount();\n    }\n  };\n\n  _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n    var isOldServer = this._option.isOldServer,\n        _serverEngine = this._serverEngine;\n\n    if (isOldServer) {\n      this._conversationManager.read(conversation);\n\n      return utils.Defer.resolve();\n    } else {\n      return _serverEngine.clearUnreadCount(conversation, option);\n    }\n  };\n\n  return WebIMEngine;\n}();\n\nvar Engine = (function (imArg) {\n  return new WebIMEngine(imArg);\n});\n\nvar execEngineByEvent = function execEngineByEvent(params, engine) {\n  var eventName = params.event,\n      args = params.args;\n  args = args || [];\n\n  var engineEvent = engine[eventName] || function () {\n    return utils.Defer.reject(ERROR_INFO.SDK_INTERNAL_ERROR);\n  };\n\n  return engineEvent.apply(engine, args);\n};\n\nvar EngineDispatcher = function () {\n  function EngineDispatcher(option) {\n    this._engine = void 0;\n    this._engine = new Engine(option);\n  }\n\n  var _proto = EngineDispatcher.prototype;\n\n  _proto.exec = function exec(params) {\n    var event = params.event;\n    var engine = this._engine;\n    var connectionStatus = engine.getConnectionStatus();\n    var isNotConnected = connectionStatus !== CONNECTION_STATUS.CONNECTED;\n    var isEventNeedConnected = utils.isInclude(ENGINE_EVENT_NEED_CONNECTED, event);\n\n    if (isNotConnected && isEventNeedConnected) {\n      return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n    }\n\n    var isConnecting = common.isConnected(connectionStatus) || common.isConnecting(connectionStatus);\n    var isEventNeedDisconnected = utils.isInclude(ENGINE_EVENT_NEED_DISCONNECTED, event);\n\n    if (isConnecting && isEventNeedDisconnected) {\n      return utils.Defer.reject(ERROR_INFO.RC_CONNECTION_EXIST);\n    }\n\n    var execResult = execEngineByEvent(params, engine);\n    return utils.isPromise(execResult) ? execResult[\"catch\"](function (error) {\n      var errorCode = error.status || error.code || error;\n      var errorInfo = ERROR_CODE_TO_INFO[errorCode] || {\n        code: errorCode\n      };\n      var isValidErrorCode = utils.isNumberData(errorCode);\n\n      if (!isValidErrorCode) {\n        Logger.write({\n          content: {\n            info: 'SDK Error',\n            error: error\n          }\n        });\n        errorInfo = utils.extendInShallow(ERROR_INFO.SDK_INTERNAL_ERROR, {\n          error: error\n        });\n      }\n\n      return utils.Defer.reject(errorInfo);\n    }) : execResult;\n  };\n\n  return EngineDispatcher;\n}();\n\nvar Type = function Type(name, validator) {\n  var self = this;\n  self.validate = validator;\n  self.name = name;\n\n  self.canBeNull = function () {\n    self.validate = function (data) {\n      return utils.isUndefined(data) || utils.isNull(data) || validator(data);\n    };\n\n    return self;\n  };\n};\n\nType.isType = function (type) {\n  return type instanceof Type;\n};\n\nType.String = new Type('String', utils.isString);\nType.Number = new Type('Number', utils.isNumber);\nType.Boolean = new Type('Boolean', utils.isBoolean);\nType.Function = new Type('Function', utils.isFunction);\nType.Object = new Type('Object', utils.isObject);\nType.Array = new Type('Array', utils.isArray);\nvar conversationType = common.getConversationTypeList().join('、');\nType.ConversationType = new Type(conversationType, common.isValidConversationType);\n\nvar Struct = function () {\n  function Struct(structure, funcName, paths) {\n    if (paths === void 0) {\n      paths = [];\n    }\n\n    if (!(this instanceof Struct)) {\n      return new Struct(structure, funcName, paths);\n    }\n\n    var self = this;\n    self.structure = structure;\n    self.paths = paths;\n    self.funcName = funcName;\n\n    if (Type.isType(structure)) {\n      self.validate = self._validateType;\n    } else if (utils.isArray(structure)) {\n      self.validate = self._validateArray;\n    } else if (utils.isObject(structure)) {\n      self.validate = self._validateObject;\n    } else {\n      self.validate = self._validateOther;\n    }\n  }\n\n  var _proto = Struct.prototype;\n\n  _proto._validateType = function _validateType(data) {\n    var structure = this.structure;\n    var isValid = structure.validate(data);\n    return isValid ? this._getSuccess() : this._getError(data);\n  };\n\n  _proto._validateArray = function _validateArray(data) {\n    var structure = this.structure;\n\n    if (utils.isEmpty(structure)) {\n      return this._getSuccess();\n    }\n\n    if (!utils.isArray(data)) {\n      return this._getError(data);\n    }\n\n    var typer = structure[0];\n\n    for (var filed in data) {\n      var val = data[filed];\n\n      var result = this._validateField(typer, filed, val);\n\n      if (result.isError) {\n        return result;\n      }\n    }\n\n    return this._getSuccess();\n  };\n\n  _proto._validateObject = function _validateObject(data) {\n    var structure = this.structure,\n        paths = this.paths;\n    data = data || {};\n\n    if (utils.isEmpty(structure)) {\n      return this._getSuccess();\n    }\n\n    if (!utils.isObject(data)) {\n      return this._getError(data);\n    }\n\n    var checkedField = [];\n\n    for (var filed in data) {\n      var typer = structure[filed],\n          val = data[filed];\n\n      var result = this._validateField(typer, filed, val);\n\n      if (result.isError) {\n        return result;\n      }\n\n      checkedField.push(filed);\n    }\n\n    for (var checkField in structure) {\n      var _typer = structure[checkField];\n      var unCheckData = data[checkField];\n\n      if (!utils.isInclude(checkedField, checkField) && !_typer.validate(unCheckData)) {\n        var errPaths = utils.copy(paths);\n        errPaths.push(checkField);\n        return this._getError(unCheckData, {\n          paths: errPaths,\n          expect: _typer.name\n        });\n      }\n    }\n\n    return this._getSuccess();\n  };\n\n  _proto._validateOther = function _validateOther(data) {\n    var self = this;\n    var structure = self.structure;\n\n    if (utils.isEqual(structure, data) || utils.isEmpty(structure)) {\n      return self._getSuccess();\n    } else {\n      return self._getError(data, {\n        current: data,\n        expect: structure\n      });\n    }\n  };\n\n  _proto._validateField = function _validateField(typer, filed, value) {\n    var paths = this.paths,\n        funcName = this.funcName;\n    var newPaths = utils.copy(paths);\n    newPaths.push(filed);\n    return new Struct(typer, funcName, newPaths).validate(value);\n  };\n\n  _proto._getError = function _getError(data, options) {\n    if (options === void 0) {\n      options = [];\n    }\n\n    var structure = this.structure,\n        paths = this.paths,\n        funcName = this.funcName;\n    options = utils.extend({\n      current: data,\n      expect: structure.name || utils.getTypeName(structure),\n      paths: paths\n    }, options);\n    paths = options.paths;\n    var _options = options,\n        current = _options.current,\n        expect = _options.expect;\n    var param = utils.isEmpty(paths) ? 'param' : paths.join('.');\n    var currentType = utils.getTypeName(current);\n    current = utils.toJSON(current) || current;\n    current = current + \"(\" + currentType + \")\";\n    var msg = utils.tplEngine(ERROR_INFO.PARAMETER_ERROR.msg, {\n      param: param,\n      expect: expect,\n      current: current\n    });\n    var info = {\n      code: ERROR_INFO.PARAMETER_ERROR.code,\n      funcName: funcName,\n      msg: msg\n    };\n    var jsonInfo = utils.toJSON(info);\n    if (utils.isEmpty(funcName)) delete info[funcName];\n    return {\n      isError: true,\n      info: info,\n      jsonInfo: jsonInfo\n    };\n  };\n\n  _proto._getSuccess = function _getSuccess() {\n    return {\n      isError: false\n    };\n  };\n\n  return Struct;\n}();\n\nvar validate = (function (struct, params, eventName) {\n  return Struct(struct, eventName).validate(params);\n});\n\nvar _MESSAGE_TYPE_VALIDAT;\nvar MESSAGE_TYPE_VALIDATE = (_MESSAGE_TYPE_VALIDAT = {}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.TEXT] = {\n  content: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.VOICE] = {\n  content: Type.String,\n  duration: Type.Number\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.HQ_VOICE] = {\n  remoteUrl: Type.String,\n  duration: Type.Number\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.IMAGE] = {\n  content: Type.String,\n  imageUri: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.GIF] = {\n  gifDataSize: Type.Number,\n  width: Type.Number,\n  height: Type.Number,\n  remoteUrl: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.RICH_CONTENT] = {\n  title: Type.String,\n  content: Type.String,\n  imageUri: Type.String,\n  url: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.LOCATION] = {\n  content: Type.String,\n  latitude: Type.Number,\n  longitude: Type.Number,\n  poi: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.FILE] = {\n  name: Type.String,\n  size: Type.Number,\n  type: Type.String,\n  fileUrl: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.SIGHT] = {\n  sightUrl: Type.String,\n  content: Type.String,\n  duration: Type.Number,\n  size: Type.Number,\n  name: Type.String\n}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.COMBINE] = {\n  remoteUrl: Type.String,\n  conversationType: Type.Number,\n  nameList: Type.Array,\n  summaryList: Type.Array\n}, _MESSAGE_TYPE_VALIDAT);\nvar validateMsgContent = (function (objectName, option, eventName) {\n  var validateByObjectName = MESSAGE_TYPE_VALIDATE[objectName];\n\n  if (validateByObjectName) {\n    return validate(validateByObjectName, option, eventName);\n  } else {\n    return {\n      isError: false,\n      info: ''\n    };\n  }\n});\n\nvar Conversation = (function (_engineDispatcher) {\n  var _temp;\n\n  return _temp = function () {\n    Conversation.create = function create(option) {\n      return new Conversation(option);\n    };\n\n    Conversation.get = function get(option) {\n      return new Conversation(option);\n    };\n\n    Conversation.merge = function merge(option) {\n      try {\n        var conversationList = option.conversationList,\n            updatedConversationList = option.updatedConversationList;\n        conversationList = updatedConversationList.concat(conversationList);\n        conversationList = common.sortConversationList(conversationList);\n        var hashTable = {};\n        var newList = [];\n        utils.forEach(conversationList, function (conversation) {\n          if (!utils.isObject(conversation)) {\n            return;\n          }\n\n          var type = conversation.type,\n              targetId = conversation.targetId;\n          var localConversation = _engineDispatcher.exec({\n            event: ENGINE_EVENT.GET_LOCAL_CONVERSATION,\n            args: [conversation]\n          }) || {};\n          localConversation.unreadMessageCount = localConversation.unreadMessageCount || 0;\n          var key = type + '_' + targetId;\n          var hashItem = hashTable[key];\n\n          if (hashItem) {\n            var index = hashItem.index,\n                val = hashItem.val;\n            val = utils.extend(conversation, val);\n            val.unreadMessageCount = localConversation.unreadMessageCount;\n            newList[index] = val;\n            hashTable[key].val = val;\n          } else {\n            conversation.unreadMessageCount = localConversation.unreadMessageCount;\n            newList.push(conversation);\n            hashTable[key] = {\n              index: newList.length - 1,\n              val: conversation\n            };\n          }\n        });\n        return newList;\n      } catch (e) {\n        utils.consoleError(e);\n      }\n    };\n\n    Conversation.remove = function remove(option) {\n      var _validate = validate({\n        type: Type.ConversationType,\n        targetId: Type.String\n      }, option, 'Conversation.remove'),\n          isError = _validate.isError,\n          info = _validate.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.REMOVE_CONVERSATION,\n        args: [option]\n      });\n    };\n\n    Conversation.getList = function getList(option) {\n      var _validate2 = validate({\n        count: Type.Number.canBeNull(),\n        startTime: Type.Number.canBeNull()\n      }, option, 'Conversation.getList'),\n          isError = _validate2.isError,\n          info = _validate2.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONVERSATION_LIST,\n        args: [option]\n      });\n    };\n\n    Conversation.getTotalUnreadCount = function getTotalUnreadCount() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT\n      });\n    };\n\n    function Conversation(option) {\n      this.type = void 0;\n      this.targetId = void 0;\n\n      var _validate3 = validate({\n        type: Type.ConversationType,\n        targetId: Type.String\n      }, option, 'new Conversation'),\n          isError = _validate3.isError,\n          jsonInfo = _validate3.jsonInfo;\n\n      if (isError) {\n        utils.consoleError(jsonInfo);\n        return jsonInfo;\n      }\n\n      utils.extend(this, option);\n    }\n\n    var _proto = Conversation.prototype;\n\n    _proto.send = function send(option) {\n      var eventName = 'conversation.send';\n\n      var _validate4 = validate({\n        messageType: Type.String,\n        content: Type.Object\n      }, option, eventName),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var _option = option,\n          messageType = _option.messageType,\n          content = _option.content;\n\n      var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n          isContentError = _validateMsgContent.isError,\n          formatInfo = _validateMsgContent.info;\n\n      if (isContentError) {\n        return utils.Defer.reject(formatInfo);\n      }\n\n      option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n      option = utils.extendInShallow(SEND_MESSAGE_OPTION, option);\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SEND_MESSAGE,\n        args: [this, option]\n      });\n    };\n\n    _proto.recall = function recall(message, option) {\n      var _validate5 = validate({\n        sentTime: Type.Number,\n        messageUId: Type.String\n      }, message, 'conversation.recall'),\n          isError = _validate5.isError,\n          info = _validate5.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.RECALL_MESSAGE,\n        args: [this, message, option]\n      });\n    };\n\n    _proto.read = function read(option) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.CLEAR_UNREAD_COUNT,\n        args: [this, option]\n      });\n    };\n\n    _proto.getMessages = function getMessages(option) {\n      var _validate6 = validate({\n        order: Type.Number.canBeNull(),\n        count: Type.Number.canBeNull(),\n        timestrap: Type.Number.canBeNull()\n      }, option, 'conversation.getMessages'),\n          isError = _validate6.isError,\n          info = _validate6.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      option = utils.extendInShallow(GET_MESSAGES_OPTION, option);\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_HISTORY_MSGS,\n        args: [this, option]\n      });\n    };\n\n    _proto.deleteMessages = function deleteMessages(messages) {\n      var _validate7 = validate([{\n        sentTime: Type.Number,\n        messageUId: Type.String,\n        messageDirection: Type.Number\n      }], messages, 'conversation.deleteMessages'),\n          isError = _validate7.isError,\n          info = _validate7.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.DELETE_MESSAGES,\n        args: [this, messages]\n      });\n    };\n\n    _proto.clearMessages = function clearMessages(option) {\n      var _validate8 = validate({\n        timestrap: Type.Number\n      }, option, 'conversation.clearMessages'),\n          isError = _validate8.isError,\n          info = _validate8.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.CLEAR_MESSAGES,\n        args: [this, option]\n      });\n    };\n\n    _proto.destory = function destory() {\n      var conversation = this;\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.REMOVE_CONVERSATION,\n        args: [conversation]\n      });\n    };\n\n    return Conversation;\n  }(), _temp;\n});\n\nvar ChatRoom = (function (_engineDispatcher) {\n  var _temp;\n\n  return _temp = function () {\n    ChatRoom.get = function get(option) {\n      return new ChatRoom(option);\n    };\n\n    function ChatRoom(option) {\n      this.id = void 0;\n\n      var _validate = validate({\n        id: Type.String\n      }, option, 'new ChatRoom'),\n          isError = _validate.isError,\n          jsonInfo = _validate.jsonInfo;\n\n      if (isError) {\n        utils.consoleError(jsonInfo);\n        return jsonInfo;\n      }\n\n      utils.extend(this, option);\n    }\n\n    var _proto = ChatRoom.prototype;\n\n    _proto.join = function join(option) {\n      var _validate2 = validate({\n        count: Type.Number.canBeNull()\n      }, option, 'chatRoom.join'),\n          isError = _validate2.isError,\n          info = _validate2.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.JOIN_CHATROOM,\n        args: [this, option]\n      });\n    };\n\n    _proto.quit = function quit() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.QUIT_CHATROOM,\n        args: [this]\n      });\n    };\n\n    _proto.getInfo = function getInfo(option) {\n      var _validate3 = validate({\n        count: Type.Number.canBeNull(),\n        order: Type.Number.canBeNull()\n      }, option, 'chatRoom.getInfo'),\n          isError = _validate3.isError,\n          info = _validate3.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      option = utils.extendInShallow(GET_CHATROOM_INFO_OPTION, option);\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CHATROOM_INFO,\n        args: [this, option]\n      });\n    };\n\n    _proto.send = function send(option) {\n      var eventName = 'chatRoom.send';\n\n      var _validate4 = validate({\n        messageType: Type.String,\n        content: Type.Object\n      }, option, eventName),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var id = this.id;\n      var _option = option,\n          messageType = _option.messageType,\n          content = _option.content;\n\n      var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n          isContentError = _validateMsgContent.isError,\n          formatInfo = _validateMsgContent.info;\n\n      if (isContentError) {\n        return utils.Defer.reject(formatInfo);\n      }\n\n      var conversation = {\n        type: CONVERSATION_TYPE.CHATROOM,\n        targetId: id\n      };\n      option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SEND_MESSAGE,\n        args: [conversation, option]\n      });\n    };\n\n    _proto.getMessages = function getMessages(option) {\n      var _validate5 = validate({\n        count: Type.Number.canBeNull(),\n        order: Type.Number.canBeNull(),\n        timestrap: Type.Number\n      }, option, 'chatRoom.getInfo'),\n          isError = _validate5.isError,\n          info = _validate5.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      option = utils.extendInShallow(GET_CHATROOM_MESSAGES, option);\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CHATROOM_MSGS,\n        args: [this, option]\n      });\n    };\n\n    return ChatRoom;\n  }(), _temp;\n});\n\nvar RTC = (function (_engineDispatcher) {\n  var _temp;\n\n  return _temp = function () {\n    RTC.get = function get(option) {\n      return new RTC(option);\n    };\n\n    function RTC(option) {\n      this.roomId = void 0;\n      this.option = void 0;\n      this.roomId = option.id;\n      this.option = option;\n    }\n\n    var _proto = RTC.prototype;\n\n    _proto.join = function join() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.JOIN_RTC,\n        args: [this.option]\n      });\n    };\n\n    _proto.quit = function quit() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.QUIT_RTC,\n        args: [this.option]\n      });\n    };\n\n    _proto.ping = function ping() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.PING_RTC,\n        args: [this.option]\n      });\n    };\n\n    _proto.getRoomInfo = function getRoomInfo() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_RTC_ROOM_INFO,\n        args: [this.option]\n      });\n    };\n\n    _proto.getUserInfoList = function getUserInfoList() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_RTC_USER_INFO_LIST,\n        args: [this.option]\n      });\n    };\n\n    _proto.setUserInfo = function setUserInfo(info) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SET_RTC_USER_INFO,\n        args: [this.option, info]\n      });\n    };\n\n    _proto.removeUserInfo = function removeUserInfo(info) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.DEL_RTC_USER_INFO,\n        args: [this.option, info]\n      });\n    };\n\n    _proto.setData = function setData(key, value, isInner, apiType, message) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SET_RTC_DATA,\n        args: [this.roomId, key, value, isInner, apiType, message]\n      });\n    };\n\n    _proto.getData = function getData(keys, isInner, apiType) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_RTC_DATA,\n        args: [this.roomId, keys, isInner, apiType]\n      });\n    };\n\n    _proto.removeData = function removeData(keys, isInner, apiType, message) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.DEL_RTC_DATA,\n        args: [this.roomId, keys, isInner, apiType, message]\n      });\n    };\n\n    _proto.setUserData = function setUserData(key, value, isInner, message) {\n      return this.setData(key, value, isInner, RTC_API_TYPE.PERSON, message);\n    };\n\n    _proto.getUserData = function getUserData(keys, isInner) {\n      return this.getData(keys, isInner, RTC_API_TYPE.PERSON);\n    };\n\n    _proto.removeUserData = function removeUserData(keys, isInner, message) {\n      return this.removeData(keys, isInner, RTC_API_TYPE.PERSON, message);\n    };\n\n    _proto.setRoomData = function setRoomData(key, value, isInner, message) {\n      return this.setData(key, value, isInner, RTC_API_TYPE.ROOM, message);\n    };\n\n    _proto.getRoomData = function getRoomData(keys, isInner) {\n      return this.getData(keys, isInner, RTC_API_TYPE.ROOM);\n    };\n\n    _proto.removeRoomData = function removeRoomData(keys, isInner, message) {\n      return this.removeData(keys, isInner, RTC_API_TYPE.ROOM, message);\n    };\n\n    _proto.getUserList = function getUserList() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_RTC_USER_LIST,\n        args: [this.option]\n      });\n    };\n\n    _proto.setOutData = function setOutData(rtcData, type, message) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SET_RTC_OUT_DATA,\n        args: [this.roomId, rtcData, type, message]\n      });\n    };\n\n    _proto.getOutData = function getOutData(userIds) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_RTC_OUT_DATA,\n        args: [this.roomId, userIds]\n      });\n    };\n\n    _proto.getToken = function getToken() {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_RTC_TOKEN,\n        args: [this.option]\n      });\n    };\n\n    _proto.setState = function setState(content) {\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SET_RTC_STATE,\n        args: [this.option, content]\n      });\n    };\n\n    _proto.send = function send(option) {\n      var id = this.roomId;\n      var conversation = {\n        type: CONVERSATION_TYPE.RTC_ROOM,\n        targetId: id\n      };\n      return _engineDispatcher.exec({\n        event: ENGINE_EVENT.SEND_MESSAGE,\n        args: [conversation, option]\n      });\n    };\n\n    return RTC;\n  }(), _temp;\n});\n\nvar IM = function () {\n  function IM(option) {\n    this._engineDispatcher = void 0;\n\n    var _validate = validate({\n      appkey: Type.String\n    }, option, 'RongIMLib.init'),\n        isError = _validate.isError,\n        jsonInfo = _validate.jsonInfo;\n\n    if (isError) {\n      throw Error(jsonInfo);\n    }\n\n    var engineHandler = new EngineDispatcher(option);\n    this._engineDispatcher = engineHandler;\n    var Modules = {\n      Conversation: Conversation(engineHandler),\n      ChatRoom: ChatRoom(engineHandler),\n      RTC: RTC(engineHandler)\n    };\n    utils.extend(this, Modules);\n  }\n\n  var _proto = IM.prototype;\n\n  _proto.getConnectionStatus = function getConnectionStatus() {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.GET_CONNECTION_STATUS\n    });\n  };\n\n  _proto.getConnectionUserId = function getConnectionUserId() {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.GET_CONNECTION_USER_ID\n    });\n  };\n\n  _proto.getAppInfo = function getAppInfo() {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.GET_APP_INFO\n    });\n  };\n\n  _proto.watch = function watch(watchers) {\n    var _validate2 = validate({\n      conversation: Type.Function.canBeNull(),\n      message: Type.Function.canBeNull(),\n      status: Type.Function.canBeNull()\n    }, watchers, 'im.watch'),\n        isError = _validate2.isError,\n        jsonInfo = _validate2.jsonInfo;\n\n    if (isError) {\n      utils.consoleError(jsonInfo);\n      return jsonInfo;\n    }\n\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.WATCH,\n      args: [watchers]\n    });\n  };\n\n  _proto.unwatch = function unwatch(watchers) {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.UN_WATCH,\n      args: [watchers]\n    });\n  };\n\n  _proto.connect = function connect(user) {\n    var _validate3 = validate({\n      token: Type.String\n    }, user, 'im.connect'),\n        isError = _validate3.isError,\n        info = _validate3.info;\n\n    if (isError) {\n      return utils.Defer.reject(info);\n    }\n\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.CONNECT,\n      args: [user]\n    });\n  };\n\n  _proto.reconnect = function reconnect() {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.RECONNECT\n    });\n  };\n\n  _proto.disconnect = function disconnect() {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.DISCONNECT\n    });\n  };\n\n  _proto.changeUser = function changeUser(user) {\n    var _validate4 = validate({\n      token: Type.String\n    }, user, 'im.changeUser'),\n        isError = _validate4.isError,\n        info = _validate4.info;\n\n    if (isError) {\n      return utils.Defer.reject(info);\n    }\n\n    var self = this;\n    return self.disconnect().then(function () {\n      return self.connect(user);\n    });\n  };\n\n  _proto.getFileToken = function getFileToken(fileType) {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.GET_UPLOAD_TOKEN,\n      args: [fileType]\n    });\n  };\n\n  _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n    return this._engineDispatcher.exec({\n      event: ENGINE_EVENT.GET_UPLOAD_URL,\n      args: [fileType, fileName, originName]\n    });\n  };\n\n  return IM;\n}();\n\nvar imInstance;\n\nvar init = function init(option) {\n  option = utils.extendInShallow(IM_OPTION, option);\n  option.connectType = common.getConnectType(option);\n  var _option = option,\n      logger = _option.logger,\n      debug = _option.debug;\n  utils.isFunction(logger) && Logger.watch(logger);\n  debug && Logger.setOption({\n    isShowLocal: true\n  });\n\n  if (!imInstance) {\n    imInstance = new IM(option);\n  }\n\n  return imInstance;\n};\n\nvar getInstance = function getInstance() {\n  return imInstance;\n};\n\nvar index = utils.extend({\n  init: init,\n  getInstance: getInstance,\n  env: env,\n  common: common,\n  ERROR_CODE: ERROR_CODE,\n  Logger: Logger\n}, product);\n\nexport default index;\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/.eslintrc",
    "content": "{\n  \"env\": {\n    \"mocha\": true\n  },\n  \"globals\": {\n    \"assert\": true,\n    \"expect\": true,\n    \"should\": true,\n    \"__static\": true\n  }\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/e2e/index.js",
    "content": "'use strict'\n\n// Set BABEL_ENV to use proper env config\nprocess.env.BABEL_ENV = 'test'\n\n// Enable use of ES6+ on required files\nrequire('babel-register')({\n  ignore: /node_modules/\n})\n\n// Attach Chai APIs to global scope\nconst { expect, should, assert } = require('chai')\nglobal.expect = expect\nglobal.should = should\nglobal.assert = assert\n\n// Require all JS files in `./specs` for Mocha to consume\nrequire('require-dir')('./specs')\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/e2e/specs/Launch.spec.js",
    "content": "import utils from '../utils'\n\ndescribe('Launch', function () {\n  beforeEach(utils.beforeEach)\n  afterEach(utils.afterEach)\n\n  it('shows the proper application title', function () {\n    return this.app.client.getTitle()\n      .then(title => {\n        expect(title).to.equal('rong-test')\n      })\n  })\n})\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/e2e/utils.js",
    "content": "import electron from 'electron'\nimport { Application } from 'spectron'\n\nexport default {\n  afterEach () {\n    this.timeout(10000)\n\n    if (this.app && this.app.isRunning()) {\n      return this.app.stop()\n    }\n  },\n  beforeEach () {\n    this.timeout(10000)\n    this.app = new Application({\n      path: electron,\n      args: ['dist/electron/main.js'],\n      startTimeout: 10000,\n      waitTimeout: 10000\n    })\n\n    return this.app.start()\n  }\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/unit/index.js",
    "content": "import Vue from 'vue'\nVue.config.devtools = false\nVue.config.productionTip = false\n\n// require all test files (files that ends with .spec.js)\nconst testsContext = require.context('./specs', true, /\\.spec$/)\ntestsContext.keys().forEach(testsContext)\n\n// require all src files except main.js for coverage.\n// you can also change this to match only the subset of files that\n// you want coverage for.\nconst srcContext = require.context('../../src/renderer', true, /^\\.\\/(?!main(\\.js)?$)/)\nsrcContext.keys().forEach(srcContext)\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/unit/karma.conf.js",
    "content": "'use strict'\n\nconst path = require('path')\nconst merge = require('webpack-merge')\nconst webpack = require('webpack')\n\nconst baseConfig = require('../../.electron-vue/webpack.renderer.config')\nconst projectRoot = path.resolve(__dirname, '../../src/renderer')\n\n// Set BABEL_ENV to use proper preset config\nprocess.env.BABEL_ENV = 'test'\n\nlet webpackConfig = merge(baseConfig, {\n  devtool: '#inline-source-map',\n  plugins: [\n    new webpack.DefinePlugin({\n      'process.env.NODE_ENV': '\"testing\"'\n    })\n  ]\n})\n\n// don't treat dependencies as externals\ndelete webpackConfig.entry\ndelete webpackConfig.externals\ndelete webpackConfig.output.libraryTarget\n\n// apply vue option to apply isparta-loader on js\nwebpackConfig.module.rules\n  .find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader'\n\nmodule.exports = config => {\n  config.set({\n    browsers: ['visibleElectron'],\n    client: {\n      useIframe: false\n    },\n    coverageReporter: {\n      dir: './coverage',\n      reporters: [\n        { type: 'lcov', subdir: '.' },\n        { type: 'text-summary' }\n      ]\n    },\n    customLaunchers: {\n      'visibleElectron': {\n        base: 'Electron',\n        flags: ['--show']\n      }\n    },\n    frameworks: ['mocha', 'chai'],\n    files: ['./index.js'],\n    preprocessors: {\n      './index.js': ['webpack', 'sourcemap']\n    },\n    reporters: ['spec', 'coverage'],\n    singleRun: true,\n    webpack: webpackConfig,\n    webpackMiddleware: {\n      noInfo: true\n    }\n  })\n}\n"
  },
  {
    "path": "electron-vue-sdk-v3/test/unit/specs/LandingPage.spec.js",
    "content": "import Vue from 'vue'\nimport LandingPage from '@/components/LandingPage'\n\ndescribe('LandingPage.vue', () => {\n  it('should render correct contents', () => {\n    const vm = new Vue({\n      el: document.createElement('div'),\n      render: h => h(LandingPage)\n    }).$mount()\n\n    expect(vm.$el.querySelector('.title').textContent).to.contain('Welcome to your new project!')\n  })\n})\n"
  },
  {
    "path": "emoji.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Emoji</title>\n</head>\n<body>\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/emoji.html\" class=\"get-source\">获取源码</a>\n<style>\nbody{\n    font-family:arial;\n    font-size: 14px;\n    color: #333;\n    line-height: 1.42857143;\n}\n.chatbox {\n    margin-bottom: 20px;\n}\n.get-source {\n    text-decoration:none;\n    background:#000;\n    color:#fff;\n    padding:10px 30px;\n    border-radius:5px;\n    position:fixed;\n    right:5px;\n    top:5px;\n}\npre.code{\n    padding:5px;\n    border:1px solid #ccc;\n    background:#f5f5f5;\n    border-radius:3px;\n    font-family:arial;\n    line-height:2;\n}\np {\n    margin: 5px;\n    margin-left: 0;\n}\nh1 {\n    font-size: 36px;\n}\nh2 {\n    font-size: 30px;\n}\nol li {\n    margin-bottom: 10px;\n}\nol ol, ol ul, ul ol, ul ul {\n    padding-left: 17px;\n}\n.support-list{\n    background:#f5f5f5;\n    line-height: 2;\n    font-size: 12px;\n}   \n.doc-content {\n    font-size: 13px;\n    background:#f5f5f5;\n    padding-bottom: 10px;\n    padding-top: 10px;\n}\n\na {\n    cursor: pointer;\n    color: #337ab7;\n    text-decoration: none;\n}\na:hover {\n    text-decoration: underline;\n}\n\npre {\n    margin: 0;\n    border: none;\n    background-color: #f5f5f5;\n    padding: 9.5px;\n    font-size: 13px;\n}\n.table-bordered, td, tr, th {\n    border: 1px solid #ddd;\n}\n\n.table>caption+thead>tr:first-child>td, .table>caption+thead>tr:first-child>th, .table>colgroup+thead>tr:first-child>td, .table>colgroup+thead>tr:first-child>th, .table>thead:first-child>tr:first-child>td, .table>thead:first-child>tr:first-child>th {\n    border-top: none;\n}\ntd, th {\n    padding: 8px;\n    vertical-align: top;\n    border-top: 1px solid #ddd;\n}\nth {\n    vertical-align: bottom;\n}\n#chatbox-send {\n    margin-left: 1%;\n}\n\n.chatbox-emoji-btn {\n    margin-left: 1%;\n}\n\n.chatbox-emoji-panel {\n    margin-left: 1%;\n    width: 50%;\n}\n.chatbox-message {\n    margin-left: 1%;\n    width: 50%;\n    height: 150px;\n    font-size: 14px;\n}\n.chatbox-show {\n    float: right;\n    width: 365px;\n    height: 150px;\n    border: 1px solid black;\n    overflow: auto;\n    margin-right: 2%;\n}\n.chatbox-btn {\n    margin-left: 1%;\n    padding: 2px 5px;\n}\n\n</style>\n    \n<script src=\"https://cdn.ronghub.com/RongEmoji-2.2.7.js\"></script> \n\n<h1>Emoji</h1>\n\n<h2>融云消息 message 里的 emoji 说明</h2>\n<ol>\n    <li>\n        <p>发消息时, 必须直接发送emoji原生字符. 如：😀 , 转换方法：symbolToEmoji</p>\n    </li>\n    <li>\n        <p>Web SDK接收消息时接收到的是unicode编码格式, 如：”ef600”.需要转化才能正确显示原生emoji</p>\n    </li>\n</ol>\n\n<h2>Emoji 说明</h2>\n<ol>\n    <li>\n        <p>emoji 插件内置了128个emoji表情的图片, <strong>主要是为了做消息输入框的表情选项, </strong>也可自行扩展配置.</p>\n    </li>\n    <li>\n        <p>\n            支持范围: \n            <p>(1), IE7+、Edge、Chrome 30+、Firefox 30+、Safari 10+ 等主流桌面版浏览器</p>\n            <p>(2), Android 4.4+系统的Chrome浏览器以及微信浏览器</p>\n            <p>(3), iPhone 操作系统iOS 8.0+ 的Safari浏览器以及微信浏览器</p>\n        </p>\n    </li>\n    <li>\n        <p><a onclick=\"setupExpand('initCode')\">Emoji 初始化设置</a></p>\n        <pre id=\"initCode\" style=\"display: none\">\n    // 直接初始化\n    RongIMLib.RongIMEmoji.init();\n\n    // 通过配置初始化\n    // 表情信息可参考 <a href=\"http://unicode.org/emoji/charts/full-emoji-list.html\">http://unicode.org/emoji/charts/full-emoji-list.html</a>\n    var config = {\n        size: 24, // 大小, 默认 24, 建议15 - 55\n        url: '//f2e.cn.ronghub.com/sdk/emoji-48.png', // 所有 emoji 的背景图片\n        lang: 'zh', // 选择的语言, 默认 zh\n        // 扩展表情\n        extension: {\n            dataSource: {\n                \"u1F914\":{  \n                    \"en\":\"thinking face\", // 英文名称\n                    \"zh\":\"思考\", // 中文名称\n                    \"tag\":\"🤔\", // 原生emoji\n                    \"position\":\"0px 0px\" // 所在背景图位置坐标\n                },\n                .....\n                .....\n            },\n            // 新增 emoji 的背景图 url\n            url: 'https://emojipedia-us.s3.amazonaws.com/thumbs/160/apple/96/thinking-face_1f914.png'\n        }\n    };\n    RongIMLib.RongIMEmoji.init(config);\n\n        </pre>\n    </li>\n\n    <li>\n        <p><a onclick=\"setupExpand('sdkFuc')\">Emoji API</a></p>\n        <table id=\"sdkFuc\" class=\"table table-bordered\" style=\"display: none; width: 97%\">\n            <thead>\n                <tr>\n                    <th>方法</th>\n                    <th>使用示例</th>\n                    <th>方法说明</th>\n                </tr>\n            </thead>\n            <tbody>\n                <tr>\n                    <td>list</td>\n                    <td>\n<!-- start -->                        \n                        <pre>\nvar list = RongIMEmoji.list;</pre>\n<!-- end -->\n                    </td>\n                    <td>获取所有数据，方便二次开发<br>\n                        [{unicode: \"u1F600\", emoji: \"😀\", symbol:\"[笑嘻嘻]\", shadowDom: span }, { }, ………]\n                    </td>\n                </tr>\n                <tr>\n                    <td>emojiToSymbol(emoji, reg, func)</td>\n                    <td>\n<!-- start -->\n                        <pre>\nvar symbol = RongIMEmoji.emojiToSymbol('我是一个表情😁');\n<strong>返回值: 我是一个表情[露齿而笑]</strong></pre>\n<!-- end -->\n                    </td>\n                    <td>将原生emoji转化为对应文字</td>\n                </tr>\n                <tr>\n                    <td>symbolToEmoji(symbol, func)</td>\n                    <td>\n<!-- start -->\n                        <pre>\nvar emoji = RongIMEmoji.symbolToEmoji('我是一个表情[露齿而笑]');\n<strong>返回值: 我是一个表情😁</strong>\nvar emoji = RongIMEmoji.symbolToEmoji('我是一个表情[露齿而笑]', function(emoji) { \n    return '[emoji]'; \n}); \n<strong>返回值: 我是一个表情[emoji]</strong></pre>\n<!-- end -->\n                    </td>\n                    <td>将emoji的对应名称转化为原生emoji字符</td>\n                </tr>\n                <tr>\n                    <td>emojiToHTML(emoji, size, reg, func)</td>\n                    <td>\n<!-- start -->\n                        <pre>\nvar html = RongIMEmoji.emojiToHTML('我是一个表情😁');</pre>\n<!-- end -->\n                    </td>\n                    <td>将原生emoji转化为span标签, 默认标签大小为24px</td>\n                </tr>\n                <tr>\n                    <td>symbolToHTML(symbol, size, reg, func)</td>\n                    <td>\n<!-- start -->\n                        <pre>\nvar html = RongIMEmoji.symbolToHTML('我是一个表情[露齿而笑]')</pre>\n<!-- end -->\n                    </td>\n                    <td>将原生emoji转化为span标签</td>\n                </tr>\n                <tr>\n                    <td>isSupportEmoji</td>\n                    <td>\n<!-- start -->\n                        <pre>\nvar isSupportEmoji = RongIMEmoji.isSupportEmoji;</pre>\n<!-- end -->                            \n                    </td>\n                    <td>判断是否支持emoji的渲染</td>\n                </tr>\n            </tbody>\n        </table>\n    </li>\n</ol>\n\n\n\n<script>\nfunction setupExpand(expandId) {\n    var expandDom = document.getElementById(expandId);\n    var display = expandDom.style.display;\n    display = display === \"none\" ? \"block\" : \"none\";\n    expandDom.style.display = display;\n}\n</script>\n\n<div class=\"chatbox\">\n    <h2>发送表情极简demo</h3>\n    <div class=\"chatbox-tools\">\n        <div class=\"chatbox-tools-emoji\">\n            <a href=\"#emoji\" class=\"chatbox-emoji-btn\" id=\"chatbox-emoji-btn\">表情</a>\n            <div class=\"chatbox-emoji-panel\" id=\"chatbox-emoji-panel\"></div>\n        </div>\n    </div>\n    <ol class=\"chatbox-show\" id=\"chatbox-show\"></ol>\n    <textarea class=\"chatbox-message\" id=\"chatbox-message\">今天心情很不错[笑嘻嘻]</textarea>\n    <p> \n        <a class=\"chatbox-btn\" id=\"symbol-emoji\">SymbolToEmoji</a>\n        <a class=\"chatbox-btn\" id=\"emoji-symbol\" onclick=\"emojiToSymbol\">EmojiToSymbol</a> \n        <a class=\"chatbox-btn\" id=\"emoji-html\" onclick=\"emojiToHtml\">EmojiToHtml</a> \n        <a class=\"chatbox-btn\" id=\"symbol-html\" onclick=\"symbolToHtml\">SymbolToHtml</a> \n    </p>\n    <p>\n        <a class=\"chatbox-btn\" id=\"symbol-emoji-invalid\">SymbolToEmoji( 不支持emoji时, 原生emoji字符显示为 [emoji] )</a>\n    </p>\n</div>\n\n\n<script>\n/*\n发送表情极简Demo\n */\n(function(){\n    var chatbox = document.getElementById(\"chatbox-message\");\n    var btn = document.getElementById(\"chatbox-emoji-btn\");\n    var panel = document.getElementById(\"chatbox-emoji-panel\");\n    var chatshow = document.getElementById(\"chatbox-show\");\n\n    var RongIMEmoji = RongIMLib.RongIMEmoji;\n\n    var config = {\n        size: 24,\n        // url: '//cdn.ronghub.com/emojis-hd.png?replace', // 传入服务器路径\n        url: 'res/emojis-hd.png?replace', // 传入本地路径\n        lang: 'zh',\n        extension: {\n            dataSource: {\n                u1F914: {\n                    zh: '思考',\n                    en: 'thinking face',\n                    tag: '🤔',\n                    position: '0px 0px'\n                }\n            },\n            url: 'https://cdn.ronghub.com/thinking-face.png'\n        }\n    };\n\n    RongIMEmoji.init(config);\n    appendChild('init: 初始化RongIMEmoji');\n    \n    btn.onclick = function(){\n        panel.style.display = \"block\";\n        var emojis = getEmojiDetailList();\n        bindClickEmoji(emojis);\n        return false;\n    };\n\n    var symbolToEmojiBtn = document.getElementById(\"symbol-emoji\");\n    symbolToEmojiBtn.onclick = function(){\n        var message = chatbox.value;\n        message = RongIMEmoji.symbolToEmoji(message);\n        appendChild('symbolToEmoji: ' + message);\n        return false;\n    };\n\n    var emojiToSymbol = document.getElementById(\"emoji-symbol\");\n    emojiToSymbol.onclick = function(){\n        var message = chatbox.value;\n        message = RongIMEmoji.emojiToSymbol(message);\n        appendChild('emojiToSymbol: ' + message);\n        return false;\n    };\n\n\n    var emojiToHtmlBtn = document.getElementById(\"emoji-html\");\n    emojiToHtmlBtn.onclick = function(){\n        var message = chatbox.value;\n        message = RongIMEmoji.emojiToHTML(message, 33);\n        appendChild('emojiToHtml: ' + message);\n        return false;\n    };\n\n    var symbolToHtmlBtn = document.getElementById(\"symbol-html\");\n    symbolToHtmlBtn.onclick = function(){\n        var message = chatbox.value;\n        message = RongIMEmoji.symbolToHTML(message);\n        appendChild('symbolToHtml: ' + message);\n        return false;\n    };\n\n    var symbolToEmojiInvalid = document.getElementById(\"symbol-emoji-invalid\");\n    symbolToEmojiInvalid.onclick = function() {\n        var message = chatbox.value;\n        var isSupportEmoji = RongIMEmoji.isSupportEmoji;\n        message = RongIMEmoji.symbolToEmoji(message, function(emoji) {\n            return isSupportEmoji ? emoji : '<span style=\"color: rgb(182, 182, 182)\">[emoji]</span>';\n        });\n        appendChild('symbolToEmoji: ' + message);\n        return false;\n    };\n\n\n    function appendChild(text) {\n        var div = document.createElement('div');\n        div.innerHTML = '<li>' + text + '</li>';\n        var child = div.childNodes[0];\n        chatshow.appendChild(child);\n    }\n\n    function getEmojiDetailList() {\n        var shadowDomList = [];\n        for (var i = 0; i < RongIMEmoji.list.length; i++) {\n            var value = RongIMEmoji.list[i];\n            shadowDomList.push(value.node);\n        }\n        return shadowDomList;\n    }\n\n    function bindClickEmoji(emojis) {\n        for(var i=0;i<emojis.length;i++){\n            var emojiHtml = emojis[i];\n            panel.appendChild(emojiHtml);\n            emojiHtml.onclick = clickEmoji;\n        }\n    }\n\n    function clickEmoji(event) {\n        var e = event || window.event;\n        var target = e.target || e.srcElement;\n        if (document.all && !document.addEventListener === false) {\n            console.log(target);\n        }\n        chatbox.value = chatbox.value + target.getAttribute(\"name\");\n    }\n\n\n})();\n</script>\n\n</body>\n</html>"
  },
  {
    "path": "faq.md",
    "content": "# 融云 SDK 常见问题\n\n## 一、引入 SDK （连接融云服务器）\n\n\n### 参考文档：[http://www.rongcloud.cn/docs/web.html#sdk](http://www.rongcloud.cn/docs/web.html#sdk)\n\n### WebIM 集成引导：[https://rongcloud.github.io/websdk-demo/integrate/guide.html](https://rongcloud.github.io/websdk-demo/integrate/guide.html)\n\n### IE9 下 RequireJS 加载时 protobuf 文件报错 (不支持 websocket 内核的浏览器会报错)\n\n（1）通过 script 直接引入的方式，SDK 有判断，IE9 下使用长链接，并且不引入 protobuf\n\n（2）如果是 Require 方式加载，需要加个判断，在不支持 websocket 的浏览器里不引入 protobuf，只在支持的浏览器引入\n\n（3）RequireJS 加载 SDK demo: [https://rongcloud.github.io/websdk-demo/require.html](https://rongcloud.github.io/websdk-demo/require.html)\n\n\n### 集成 electron 问题 报错：Cannot find module 'ByteBuffer' \n\n（1）由于 Electron 集成了 Node.js，有一些额外的符号被插入到 DOM，比如 module， exports， require。这对于某些库会引发问题，因为它们可能需要插入同名的符号。\n\n（2）在 Electron 中关闭 Node 集成\n\n```\n\n// In the main process.\nconst {BrowserWindow} = require('electron')\nlet win = new BrowserWindow({\n  webPreferences: {\n    nodeIntegration: false\n  }\n})\nwin.show()\n\n```\n\n（3）确定 electron 引入 SDK 是通过 RequireJS 引入，或者通过 页面 引入的\n\n（4）如果是通过 RequireJS 引入的 SDK，参考 demo：[https://rongcloud.github.io/websdk-demo/electron/requirejs-in-node.html](https://rongcloud.github.io/websdk-demo/electron/requirejs-in-node.html)\n\n（5）如果是通过 页面直接引入的 SDK，如果保留使用 Node.js 和 Electron APIs 的能力，必须要在引用其它库之前在页面中重命名这些符号：\n\n```\n\n<head>\n<script>\nwindow.nodeRequire = require;\ndelete window.require;\ndelete window.exports;\ndelete window.module;\n</script>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n</head>\n\n```\n\n参考 demo ：[https://rongcloud.github.io/websdk-demo/electron/normal.html](https://rongcloud.github.io/websdk-demo/electron/normal.html)\n\n（6）参考文档：\n\n[https://www.kancloud.cn/simon_chang/electron/227476](https://www.kancloud.cn/simon_chang/electron/227476)\n\n[http://requirejs.org/docs/node.html](http://requirejs.org/docs/node.html)\n\n\n###  如何动态获取 token\n\n（1）动态获取 token 需要在 APP server 端获取\n\n（2）参考文档：[http://www.rongcloud.cn/docs/server.html#user_get_token](http://www.rongcloud.cn/docs/server.html#user_get_token)\n\n\n### token 失效问题\n\nToken无效一般有以下两种原因：\n\n（1）token错误，请您检查客户端初始化使用的AppKey和您服务器获取token使用的AppKey是否一致\n\n（2）token过期，是因为您在开发者后台设置了token过期时间，您需要请求您的服务器重新获取token并再次用新的token建立连接。\n\n所以：\n\n（1）请确认一下  AppKey 和 token 是否匹配。\n\n（2）请在开发者后台确认 token 是否在有效期。\n\n（3）请使用工具：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html) 来测试一下能否链接成功。\n\n\n### 连接成功后，聊天界面一直开着，过一段时间，会自动断开\n\n（1）请确认该 token 是否有在其他端登录。判断方法：在开发者工具console里看错误信息，是否输出了 “其他端登录” 的信息\n\n（2）断开连接时网络是否正常，请查看一下开发者工具console里的输出的断开原因，截图一下\n\n（3）WebSDK有重链的方法，但是没有默认自动重链，请根据自己需要处理\n\n（4）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n### 重连错误\n\n（1）执行重连过程：融云连接状态监听器 setConnectionStatusListener 监听到 断开连接（这里的断开连接是指 连接融云服务器断开），可以执行重连方法。\n\n（2）融云连接状态监听器 setConnectionStatusListener 监听到 网络不可用，开始检测当前网络是否已连接，当网络正常连接后，再执行重连方法。\n\n（3）reconnect 方法是监听到连接融云服务器断开后调用的重连方法，如果是网络断开连接了，需要先进行网络嗅探，在确认网络连接成功后再进行重连。\n\n（4）在提示 其他端登录 不要使用重连方法，会造成两个页面互踢的情况，需要同一个 userid 同时登录多个页面，需要开通 多设备消息同步 服务，此服务为增值服务，开发环境免费，生产环境付费。\n\n（5）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n（6）多设备消息同步 服务参考链接：[http://www.rongcloud.cn/docs/payment.html#multi_device_message_sync](http://www.rongcloud.cn/docs/payment.html#multi_device_message_sync)\n\n\n###  Web 端获取对方在线状态\n\n（1）不能通过消息来判断用户是否在线，需要通过应用服务器处理\n\n（2）用户是否在线需要用 server 端的在线状态订阅，具体可以参看用户状态相关文档：[http://www.rongcloud.cn/docs/server.html#online_status](http://www.rongcloud.cn/docs/server.html#online_status)\n\n\n## 二、会话列表\n\n### 获取会话列表问题\n\n（1）获取会话列表 需要开通 单群聊消息云端存储 服务，该服务在开发环境是免费的，您可以在开发者后台 - 付费功能中自行开通！\n\n（2）确认开通服务后，在init初始化以及连接融云服务器成功后，再调用同步会话列表方法\n\n（3）确认在开通服务后有过消息收发\n\n（4）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n（5）提供 appKey 和 token / 线上的测试地址\n\n（6）单群聊消息云端存储 服务说明连接：[http://www.rongcloud.cn/docs/payment.html#history_message_cloud_storage](http://www.rongcloud.cn/docs/payment.html#history_message_cloud_storage)\n\n### 获取会话列表的参数问题\n\n（1）获取会话列表应该有两个参数传入\n\n（2）conservationType 默认为 null，具体格式设置需要补充（现在传具体会话类型不能过滤，属于 bug ）\n\n（3）limit 获取会话的数量，不传或者传 null 为获取全部，暂时不支持分页\n\n### 会话列表顺序问题\n\n（1）确定一下顺序问题是 一直有问题，还是最近出现的问题 \n\n（2）如果是一直有问题 sortConversationList() 方法可以改变顺序\n\n（3）如果是最近出现的问题，提供 appKey 以及出现问题的 token  / 提供线上的测试地址，Web 端复现问题，server 端有没有更改\n\n### 会话列表和聊天页面分成两个页面\n\n（1）Web 端默认只支持一个页面链接，属于单页面应用，单页面应用只需 init 和 connect 一次， connect 后客户端和服务器会一直保持长连接。\n\n（2）开页面就要分别对每个页面初始化 和 connect ，会提示其他设备登录，需要多页面链接需要开通 多设备消息同步 服务。\n\n（3）参考链接：[http://www.rongcloud.cn/docs/advanced_features.html#multi_device_message_sync](http://www.rongcloud.cn/docs/advanced_features.html#multi_device_message_sync)\n\n### 聊天插件中删除会话列表问题\n\n（1）聊天插件中点击删除最近联系人会话中的一个会话，没有效果，刷新页面重新登录就已经删除成功\n\n（2）属于聊天插件的 bug ，建议修改 删除逻辑，根据 id 在本地做隐藏，或者等待 SDK 的版本更新\n\n### 未读消息数量\n\n（1）获取未读消息数必须在获取会话列表和收到实时消息之后，未读消息储存在 localstorage 中\n\n（2）在获取会话列表后，每次有收到新的消息时会执行 获取未读消息( getUnreadCount() ) 方法，数量 count 会不断累加，执行清除未读消息 方法后，count 清零。\n\n（3）清除未读消息( clearUnreadCount() ) 方法可以清除当前端的未读数，并不会多端同步，多端同步需要发送 SynReadStatusMessage ,同步给多端请参考 SendSynReadStatusMessage 。\n\n（4）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n（5）参考文档：[http://www.rongcloud.cn/docs/web_api_demo.html#conversation_unread_message](http://www.rongcloud.cn/docs/web_api_demo.html#conversation_unread_message)\n\n\n## 三、历史消息\n\n\n### 获取历史消息出错或者为空\n\n（1）获取历史消息 需要开通 单群聊消息云端存储 服务，该服务在开发环境是免费的，您可以在开发者后台 - 付费功能中自行开通！\n\n（2）确认开通服务后，在init初始化以及连接融云服务器成功后，再调用 获取历史消息 方法\n\n（3）确认在开通服务后有过消息收发\n\n（4）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n（5）参考文档：[http://www.rongcloud.cn/docs/web.html#history_message](http://www.rongcloud.cn/docs/web.html#history_message)\n\n（6）提供 appKey 和 token / 提供线上的测试地址\n\n（7）单群聊消息云端存储 服务说明连接：[http://www.rongcloud.cn/docs/payment.html#history_message_cloud_storage](http://www.rongcloud.cn/docs/payment.html#history_message_cloud_storage)\n\n### 获取历史消息方法中的参数 conversationType 可以指定多种消息会话类型\n\n（1）消息会话类型请参考文档：[http://www.rongcloud.cn/docs/web_api_demo.html#conversation_type](http://www.rongcloud.cn/docs/web_api_demo.html#conversation_type)\n\n```\n\n（1）私聊  RongIMLib.ConversationType.PRIVATE, conversationType = 1\n（2）讨论组 RongIMLib.ConversationType.DISCUSSION,  conversationType = 2\n（3）群组 RongIMLib.ConversationType.GROUP, conversationType = 3\n（4）聊天室 RongIMLib.ConversationType.CHATROOM, conversationType = 4\n（5）客服 RongIMLib.ConversationType.CUSTOMER_SERVICE, conversationType = 5\n（6）系统消息 RongIMLib.ConversationType.SYSTEM, conversationType = 6\n（7）应用内默认关注得公众账号 RongIMLib.ConversationType.APP_PUBLIC_SERVICE, conversationType = 7\n（8）手动关注的公众账号  RongIMLib.ConversationType.PUBLIC_SERVICE, conversationType = 8\n\n```\n\n### 历史消息下载问题\n\n（1）消息历史记录下载地址获取方法 请参考：[http://rongcloud.cn/docs/server.html#history_message](http://rongcloud.cn/docs/server.html#history_message)\n\n### 获取历史消息方法中的参数 timestrap\n\n（1）默认传 null \n\n（2）若从头开始获取历史消息,timestrap = 0\n\n（3）timestrap 可以为时间戳, 当 timestrap 为时间戳时，获取的是 消息发送时间（sentTime）之前的历史消息\n\n### 获取历史消息循环拉取问题\n\n（1）拉取历史消息最多一次性拉取 20 条消息。拉取顺序按时间倒序拉取，一次性拉取最少为 2 条消息。\n\n（2）在点击会话列表第一次进入聊天界面时，获取历史消息应该是从头拉取的，此时 timestrap 设为 0，可以保证每次进入聊天界面时都是从头拉取的\n\n（3）在获取 更多历史消息 的时候，timestrap 拉取必须为 null 才能实现循环拉取（ timestrap 传 0 或着时间戳时不能循环拉取 ）\n\n### 离线消息\n\n（1）获取离线消息使用获取 历史消息的方法\n\n（2）在获取历史消息方法返回的消息体中 有 offLineMessage 属性，标识是否为离线消息，如果为 true ，则为离线消息，反之，则是普通消息\n\n### Web 端清除聊天记录\n\n（1）RongIMClient.getInstance().clearMessages() 方法清除本地会话中的历史消息（不能清除服务器中的历史消息记录）\n\n### Web 端用户信息( 用户头像和昵称 )的获取\n\n（1）用户数据 和 用户好友消息 保存在您的应用服务器上，用户信息（昵称、头像地址等）需要在自己的数据库进行获取以及维护，通过 targetId 和 userId 进行匹配,得到相应的用户信息\n\n（2）参考 SDK 架构说明文档：[http://www.rongcloud.cn/docs/quick_start.html](http://www.rongcloud.cn/docs/quick_start.html)\n\n消息中显示用户信息有两种方式：\n\n（1）通过消息中的 senderUserId 匹配自己的用户信息\n\n（2）在消息体体中携带用户信息，请参考：[http://support.rongcloud.cn/kb/NDMy](http://support.rongcloud.cn/kb/NDMy)\n\n### targetId 和 senderUserId 问题\n\n（1）在发送端，targetId 和 senderUserId 不同，targetId 为 目标Id ，senderUserId 为发送者Id\n\n（2）在接收端，targetId 和 senderUserId 相同\n\n## 四、发送接收消息\n\n\n### 发送图片消息\n\n（1）web发送图片时,要传参数content和imageUri,其中content为图片的base64缩略图，imageUri 为大图的网络路径，七牛上传完图片后可得到。\n\n（2）图片消息中，缩略图必须是 base64 码的 jpg 图，而且不带前缀，到晓不得超过 100 kb。\n\n（3）七牛云上传图片，正式业务中需要使用自己的七牛账号或者其他的文件存储服务（可以通过任意方式上传图片，然后使用上传后的url和生成的base64缩略图构造消息即可）\n\n（4）发送图片消息的步骤：\n\n```\n\n（1）上传图片文件到服务器，获取网络路径（即 原图的 url ）\n\n（2）本地构造 base64 缩略图\n\n（3）构造消息体（需要 base64 格式缩略图 和 原图的 url），发送消息。\n\n```\n\n（5）图片消息体：\n\n```\nvar content = {\n    imageUri: \"http://rongcloud.cn/images/newVersion/log_wx.png\",   //此处为图片的网络路径\n    content: getBase64Image()  //这里是 base64码的 jpg 图\n};\n\nvar msg = new RongIMLib.ImageMessage(content);\n\n```\n\n（6）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n（7）参考文档：[http://www.rongcloud.cn/docs/web_api_demo.html#message_send](http://www.rongcloud.cn/docs/web_api_demo.html#message_send)\n\n### Web 端聊天插件提示音\n\n（1）WebIMWidget.init中配置 voiceUrl 路径\n\n（2）在收到消息时，在插件中的消息监听 setOnReceiveMessageListener 方法 onReceived 中执行 play 方法\n\n### Web 端聊天插件收不到客服消息\n\n（1）消息接收 demo ：[https://rongcloud.github.io/websdk-demo/connect-check.html](https://rongcloud.github.io/websdk-demo/connect-check.html)\n\n（2）使用 demo 检测下能不能收到客服发过来的消息\n\n（3）与客服对话需要先发起握手消息\n\n（4）参考 demo ：[https://rongcloud.github.io/rongcloud-web-im-widget/demo/customerservice/](https://rongcloud.github.io/rongcloud-web-im-widget/demo/customerservice/)\n\n（5）参考文档：[http://www.rongcloud.cn/docs/web.html#custom_service_widget](http://www.rongcloud.cn/docs/web.html#custom_service_widget)\n\n### Web 端语音消息\n\n（1）Web 端支持语音消息类型，但没有 发送语音消息 的方法，如果可以自行解决录音和转码问题，Web 端就可以发送语音消息\n\n（2）转码需要转成 amr 格式的 base64 str \n\n（3）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n### Emoji 表情\n\n（1）融云表情库只支持 128 个 emoji 表情\n\n（2）emoji 表情无法显示，先确认一下表情是否在融云支持范围内\n\n（3）移动端支持原生 emoji 字符，Web 端不支持时使用 emoji 转 HTML 方法，转换成 HTML 用图片来呈现 \n\n（4）Android 端页面 emoji 表情不清晰，需要自行更换高清表情图，因为涉及版权问题，emoji表情只提供代码和示例图片，正式使用请自行解决版权问题\n\n（5）接入emoji表情报错（RongEmoji-2.2.4.min.js:1 Uncaught TypeError: Cannot read property 'emojiImage' of undefined）：在初始化 Web SDK ( RongIMClient.init(appkey) )之后再执行 初始化表情库 ( RongIMLib.RongIMEmoji.init() )操作\n\n（6）有一端显示 emoji 表情为灰色，样式不对，确实一下是不是样式有冲突\n\n（7）emoji 网络素材 [http://emojipedia.org/](http://emojipedia.org/)\n\n（8）emoji 参考文档：[http://www.rongcloud.cn/docs/web.html#emoji](http://www.rongcloud.cn/docs/web.html#emoji)\n\n### 群组管理禁言和拉入黑名单权限 \n\n（1）融云提供接口，谁有权限把谁禁言都需要自己在服务器实现\n\n（2）参考文档：[http://www.rongcloud.cn/docs/server.html#group_user_gag](http://www.rongcloud.cn/docs/server.html#group_user_gag)\n\n（3）SDK 架构说明：[http://www.rongcloud.cn/docs/quick_start.html](http://www.rongcloud.cn/docs/quick_start.html)\n\n### 服务端发送消息用户接收不到\n\n（1）需要确认发送消息是否成功（注意消息类型，可以使用融云开发者后台的功能发送）\n\n（2）在端上消息监听里看是否能收到消息\n\n（3）如果还是收不到消息，请提供 appKey 和 token 以及发送消息的时间等，继续排查\n\n### 确认发送消息成功的方法\n\n（1）执行了发送消息成功 onSuccess 方法\n\n（2）看 message 中是否包含 messageUId ，如果有 messageUId 说明成功了。\n\n### 是否可以在 server 端获取聊天记录\n\n（1）可以的，需要开通 服务端实时消息路由 服务，请参考：[http://www.rongcloud.cn/docs/payment.html#server_message_sync](http://www.rongcloud.cn/docs/payment.html#server_message_sync)\n\n## 五、聊天室问题\n\n\n### 创建聊天室问题\n\n（1）聊天室服务端自动创建 joinChatRoom 填入聊天室 Id 即可。\n\n（2）聊天室 1 个小时后无人说话就会自动销毁\n\n### 进入聊天室拉取消息问题\n\n（1）聊天室不支持通过 getHistoryMessage() 方法获取历史消息\n\n（2）可以在 joinChatRoom 时拉取最近的消息，最多五十条\n\n（3）参考文档：[http://www.rongcloud.cn/docs/web_api_demo.html#chatroom](http://www.rongcloud.cn/docs/web_api_demo.html#chatroom)\n\n### 加入聊天室失败\n\n（1）需要在init初始化以及连接融云服务器成功后，再调用加入聊天室方法\n\n（2）demo ：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n### 提示 xxx 进入聊天室 / 群组的方法\n\n（1）在用户进入聊天室或者群组后自动发送一条消息，其他用户通过消息监听可以知道有用户进入\n\n（2）消息类型和内容都可以由您自己决定，可以根据实际情况设计标识，并通过标识判断是否为新用户\n\n（3）具体类型可以参考文档：[http://www.rongcloud.cn/docs/server.html#message](http://www.rongcloud.cn/docs/server.html#message)\n\n### 手机环境下，进入聊天室，然后手机待机一段时间，重新唤醒屏幕，消息不能发送，提示超时。\n\n（1）手机待机后，系统会有一些节能的操作，浏览器的很多活动会被限制甚至被回收。\n\n（2）建议在浏览器监听window.onfous时间来获取唤醒的时机，唤醒时刷新页面重新开始。\n\n### 聊天室人数上限问题\n\n（1）融云直播聊天室人数无上限\n\n（2）参考文档：[http://www.rongcloud.cn/docs/live_chatroom.html](http://www.rongcloud.cn/docs/live_chatroom.html)\n\n### 游客进入融云聊天室问题\n\n（1）融云要求用户必须根据id等获取token，并链接才能加入聊天室\n\n（2）给游客分配一个id，获取token，链接融云，再调用方法加入聊天室\n\n### Web 端直接关闭网页，退出聊天室问题\n\n（1）网页关闭后，用户会有 保活策略，过了保活期会自动退出\n\n（2）在保活期内重新打开可直接恢复\n\n（3）过了保护期重新打开需要重新加入聊天室\n\n（4）参考文档：[http://www.rongcloud.cn/docs/web_api_demo.html#chatroom](http://www.rongcloud.cn/docs/web_api_demo.html#chatroom)\n\n（5）聊天室规则：[http://www.rongcloud.cn/docs/server.html#chatroom](http://www.rongcloud.cn/docs/server.html#chatroom)\n\n### 关闭网页，用户保活策略问题\n\n（1）使用 session 保存用户信息，超时后自动销毁，在没有超时的一段时间里，就是保活期\n\n（2）目前我们没有保护期，用户在线时直接关闭网页，再次打开网页需要重新登录\n\n### 聊天室续活方法\n\n（1）通过定时向聊天室发消息，例如：server端每隔不到1个小时发送一条cmdMsg。\n\n### Web 端发送聊天室消息，APP 接收不到问题\n\n（1）需要确认 APP 端和 Web 端的 appkey 的是否一致\n\n（2）确认 Web 端用户有没有加入对应聊天室（APP端发消息的和web端加入的是否是同一个聊天室id）\n\n（3）反过来， APP 发消息，Web 端 是否可以收到消息\n\n\n## 六、音视频问题\n\n\n### web 端音视频支持问题\n\n（1）WebCallLib 只支持两台电脑一对一视频通话\n\n（2）WebCallLib 只支持windows 和 mac \n\n### 错误代码问题\n\n```\n\n（1）VOIPCLOSE = 24016 \n（2）CLOSE_BEFORE_OPEN = 51001 \n（3）ALREADY_IN_USE = 51002 \n（4）INVALID_CHANNEL_NAME = 51003 \n（5）VIDEU_CONTAINER_IS_NULL = 51004 \n\n```\n\n### 设置视频的清晰度\n\n（1）目前不支持清晰度定制 \n\n### 主叫呼叫后，被叫未接通，主叫挂断，被叫如何获取挂断消息？\n\n（1）挂断时，主叫和被叫都会收到summaryMessage ，监听对方的消息就可以获取挂断消息\n\n（2）demo 主叫： [https://rongcloud.github.io/websdk-demo/voip.html](https://rongcloud.github.io/websdk-demo/voip.html)\n\n（3）demo 被叫： [https://rongcloud.github.io/websdk-demo/voip.html?userId=receiver](https://rongcloud.github.io/websdk-demo/voip.html?userId=receiver)\n\n### 视频聊天步骤\n\n（1）A 向 B 发起音视频请求\n\n（2）B 收到音视频请求 InviteMessage\n\n（3）A 收到响铃消息 RingingMessage\n\n（4）B 接受音视频请求 joincall\n\n（5）A 收到 B 接受视频请求的消息 AcceptMessage \n\n（6）成功建立视频通话\n\n（7）demo 主叫： [https://rongcloud.github.io/websdk-demo/voip.html](https://rongcloud.github.io/websdk-demo/voip.html)\n\n（8）demo 被叫： [https://rongcloud.github.io/websdk-demo/voip.html?userId=receiver](https://rongcloud.github.io/websdk-demo/voip.html?userId=receiver)\n\n### wss://localhost.agora.io:8921/ 服务器访问不到\n\n（1）确认是否安装 agoraWebAgent 插件并启动 \n\n（2）两台电脑一对一视频通话\n\n（3）windows 插件下载地址：[http://cdn.ronghub.com/AgoraWebAgentSetup.exe](http://cdn.ronghub.com/AgoraWebAgentSetup.exe)\n\n（4）mac 插件下载地址：[http://cdn.ronghub.com/AgoraWebAgent.pkg](http://cdn.ronghub.com/AgoraWebAgent.pkg)\n\n### 发起通话报错 18\n\n（1）[http://www.rongcloud.cn/docs/web_calllib.html#status](http://www.rongcloud.cn/docs/web_calllib.html#status)\n\n（2）VOIP 不可用，确认一下是否开启了音视频服务\n\n（3）音视频开通方式说明：[http://www.rongcloud.cn/docs/call.html#open](http://www.rongcloud.cn/docs/call.html#open)\n\n### 将 VOIP 和 Web 聊天插件结合\n\n（1）在聊天界面中增加发起视频或语音通话按钮（通过修改模板加入新的 dom 节点，赋予相应的 css 做好样式，通过 AngularJS 的双向绑定方式添加相应的事件）\n\n（2）用户点击按钮发起会话 \n\n（3）接收方点击接受，开始通讯\n\n### b._voipProvider is undefind\n\n（1）根据错误提示应该是 音视频 SDK 未初始化\n\n（2）参考文档: [http://www.rongcloud.cn/docs/web_calllib.html](http://www.rongcloud.cn/docs/web_calllib.html)\n\n### 通过 H5 写的 web 型 APP 集成音视频\n\n（1）在 引入 SDK 之前设置 window[\"SCHEMETYPE\"] = \"http\";\n\n（2）参考文档；[http://www.rongcloud.cn/docs/web_api_demo.html#other](http://www.rongcloud.cn/docs/web_api_demo.html#other)\n\n\n## 消息体\n\n```\n\n{\n    \"content\": {\n        \"messageName\": \"TextMessage\",\n        \"content\": \"hello\",  //消息内容\n        \"extra\": \"RongCloud\"\n    },\n    \"conversationType\": 1,   // 会话类型（单聊、群聊、聊天室等）\n    \"objectName\": \"RC:TxtMsg\",  \n    \"messageDirection\": 1,\n    \"messageId\": 36,\n    \"senderUserId\": \"user8\",    //发送者id\n    \"sentStatus\": 30,    //消息状态\n    \"sentTime\": 1484621850284,   //发送时间，自己转化格式\n    \"targetId\": \"user9\",    // 目标Id\n    \"messageType\": \"TextMessage\",\n    \"messageUId\": \"5CQK-MT6L-G43A-D3EE\"   // 消息唯一标示 ，消息Id\n}\n\n```\n\n\n## 参考文档\n\n（1）SDK 架构：[http://www.rongcloud.cn/docs/quick_start.html](http://www.rongcloud.cn/docs/quick_start.html)\n\n（2）Web SDK 开发指南：[http://www.rongcloud.cn/docs/web.html](http://www.rongcloud.cn/docs/web.html)\n\n（3）Web SDK API 示例：[http://www.rongcloud.cn/docs/web_api_demo.html](http://www.rongcloud.cn/docs/web_api_demo.html)\n\n（4）Web SDK API 文件：<a href=\"http://www.rongcloud.cn/docs/api/js/RongIMClient.js.html\">http://www.rongcloud.cn/docs/api/js/RongIMClient.js.html\n\n（5）Server 开发指南：[http://www.rongcloud.cn/docs/server.html](http://www.rongcloud.cn/docs/server.html)\n\n（6）聊天插件下载地址：[https://github.com/rongcloud/rongcloud-web-im-widget](https://github.com/rongcloud/rongcloud-web-im-widget)\n\n（7）聊天插件的开发文档：[https://github.com/rongcloud/rongcloud-web-im-widget/blob/master/doc/%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3.md](https://github.com/rongcloud/rongcloud-web-im-widget/blob/master/doc/%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3.md)\n\n（8）Web 端 H5 插件：[https://github.com/rongcloud/rongcloud-web-im-widget-h5](https://github.com/rongcloud/rongcloud-web-im-widget-h5)\n\n（9）WebIM 集成引导：[https://rongcloud.github.io/websdk-demo/integrate/guide.html](https://rongcloud.github.io/websdk-demo/integrate/guide.html)\n\n\n## 参考 demo \n\n（1）demo：[https://rongcloud.github.io/websdk-demo/api-test.html](https://rongcloud.github.io/websdk-demo/api-test.html)\n\n（2）消息接收 demo:[https://rongcloud.github.io/websdk-demo/connect-check.html](https://rongcloud.github.io/websdk-demo/connect-check.html)\n\n（3）聊天插件在线 demo：[http://rongcloud.github.io/rongcloud-web-im-widget/demo/](http://rongcloud.github.io/rongcloud-web-im-widget/demo/)\n\n（4）RequireJS 加载 SDK demo: [https://rongcloud.github.io/websdk-demo/require.html](https://rongcloud.github.io/websdk-demo/require.html)\n\n\n"
  },
  {
    "path": "histroy-messages.html",
    "content": "\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>histroy messages</title>\n</head>\n<body>\n\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/histroy-messages.html\" class=\"get-source\">获取源码</a>\n\n<style>\n\tbody{\n\t\tfont-size:14px;\n\t\tline-height:2;\n\t\tcolor:#333;\n\t}\n\th1,h2,h3{\n\t\tmargin:0;\n\t}\n\t.panel span{\n\t\tdisplay:inline-block;\t\n\t\twidth:60px;\n\t}\n\t.show{\n\t\tdisplay:none;\n\t\tfont-size:12px;\n\t\tborder:1px solid #ccc;\n\t\tbackground:#fff;\n\t\tpadding:10px 30px;\n\t\twidth:300px;\n\t\toverflow:auto;\n\t\tposition:fixed;\n\t\tright:10px;\n\t\ttop:0;\n\t\tbottom:10px;\n\t}\n\t.btns{\n\t\tdisplay:none;\n\t}\n\t.btns input,\n\t.btns a{\n\t\tfont-size:12px;\n\t\tmargin:20px 10px 0 10px;\n\t}\t\n\t.result{\n\t\tdisplay:none;\n\t\tbackground:#f5f5f5;\n\t\tmargin-top:30px;\n\t\twidth:730px;\n\t\tpadding:5px;\n\t\toverflow:hidden;\n\t}\n\t.result h2{\n\t\tfont-size:14px;\n\t\tmargin:0;\n\t\tpadding:0;\n\t}\n\t.result btn{\n\t\tmargin:5px;\n\t\tpadding:0;\n\t\tcolor:#cd0000;\n\t}\n\t.result-code{\n\t\tfloat:right;\n\t\tmargin:0 5px 5px 0;\n\t\tcolor:#fff;\n\t\tbackground:#000;\n\t\tborder:none;\n\t}\n\t#result-body{\n\t\tposition: relative;\n\t}\n\t.code-copy{\n\t\tposition:absolute;\n\t\tright:5px;\n\t\ttop:5px;\n\t}\n\t.title {\n\t\tbackground:#f5f5f5;\n\t\tpadding-left:1em;\n\t\tpadding-bottom:1em;\n\t}\n\t.title h2{\n\t\tdisplay: inline;\n\t\tfont-size:14px;\n\t\tmargin-right:0.5em;\n\t}\n\t.docs{\n\t\tdisplay:inline-block;\n\t\tbackground:#f5f5f5;\n\t\tpadding:10px;\n\t\tborder:1px solid #ccc;\n\t\tfont-family:arial;\n\t}\n</style>\n\n<!-- \nhttp://www.ghostchina.com/adding-syntax-highlighting-to-ghost-using-highlight-js/\n-->\n<link href=\"res/monokai_sublime.min.css\" rel=\"stylesheet\">  \n<script src=\"res/highlight.min.js\"></script> \n\n<script type=\"text/javascript\" src=\"lib/jquery-3.1.1.js\"></script>\n<link rel=\"stylesheet\" href=\"json-view/jsonview.css\" />\n<script type=\"text/javascript\" src=\"json-view/jquery.jsonview.js\"></script>\n\n\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n\n<!-- 二次封装的初始化代码 -->\n<script src=\"init.js\"></script>\n\n<script>\n\"use strict\";\nfunction showTips(data){\n\tvar dom = document.getElementById(\"show\");\n\t\tdom.style.display = \"block\";\n\tif(data){\n\t\tdom.innerHTML += \"<li>\" + data + \"</li>\";\n\t}else{\n\t\tdom.innerHTML = \"\";\n\t}\n}\t\nfunction showResult(title,code){\n\tvar dom = document.getElementById(\"result-area\");\n\t\tdom.style.display = \"block\";\n\n\tjsonOprators(code);\n}\n\nfunction jsonOprators(json){\n\tvar jt = $('#result-body');\n\n\tif(typeof json == 'function'){\n\t\tjt.html('<pre class=\"jsonview\"><code id=\"result-code\">' + json + '</code></pre>');\n\t\t$('pre > code').each(function(i, block) {\n\t\t\thljs.highlightBlock(block);\n\t\t});\n\t}else{\n\t\tjson = JSON.stringify(json);\n\t\tjt.JSONView(json);\n\t}\n\n\t$('#collapse-btn').on('click', function() {\n\t\tjt.JSONView('collapse');\n\t});\n\n\t$('#expand-btn').on('click', function() {\n\t\tjt.JSONView('expand');\n\t});\n\n\t$('#toggle-btn').on('click', function() {\n\t\tjt.JSONView('toggle');\n\t});\n\n\t$('#toggle-level1-btn').on('click', function() {\n\t\tjt.JSONView('toggle', 1);\n\t});\n\n\t$('#toggle-level2-btn').on('click', function() {\n\t\tjt.JSONView('toggle', 2);\n\t});\n}\n\n\nfunction getTimer(begin){\n\tvar now = new Date().getTime();\n\treturn \" time:\" + (now - begin) + \" ms\";\n}\n</script>\n\n<script>\nvar instance = null;\n\n(function(){\n\tvar appKey = \"8w7jv4qb78a9y\";\n\tvar token = \"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\";\n\n\n\tvar params = {\n\t\tappKey : appKey,\n\t\ttoken : token\n\t};\n\n\n\tvar callbacks = {\n\t\tgetInstance : function(_instance){\n\t\t\tinstance = _instance;\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\t$(\"#login\").html(userInfo.userId);\n\t\t\t$(\"#btns\").show();\n\t\t    getHistroyMessage();\n\t\t}\n\t};\n\tinit(params,callbacks);\n})();\n\n\nvar from = 0;\nvar isCircle = true;\nvar hasMsg = true;\n\n//必须成功初始化链接后才可执行\nfunction getHistroyMessage(){\n\tvar count = 20;  // 2 <= count <= 20\n\tvar targetId = \"user11\";\t\n\tvar conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n\n\t/*\n\tfrom 参数解释 1483950413013\n\t获取历史消息的起始位置，服务器端时间，message.sentTime\n\t0 为最新\n\t*/\n\n\tconsole.log(\"getHistroyMessage\")\n\tconsole.log(from)\n\n\t//无更多历史消息时直接返回\n\tif(!hasMsg){\n\t\treturn;\n\t}\n\n\tinstance.getHistoryMessages(conversationType, targetId, from, count, {\n\t\tonSuccess: function(list, _hasMsg) {\n\t\t\thasMsg = _hasMsg;\n\t\t\t$(\"#time\").html(\"起始时间：\" + from + \"；还有更多历史消息 \" + hasMsg);\n\n\t\t\t//删除多余信息，看结果对比方便\n            list.forEach(function(item, index){\n            \tdelete item[\"content\"];\n            \tdelete item.messageDirection;\n            \tdelete item.receivedStatus;\n            \tdelete item.sentStatus;\n            \tdelete item.offLineMessage;\n            \tdelete item.messageId;\n            \tdelete item.messageType;\n            });\n\n\n            showResult(\"获取历史消息成功\",list);\n            if(isCircle && hasMsg){\n            \tfrom = list[0].sentTime;\n            }\n\t\t},\n\t\tonError: function(error) {\n            showResult(\"获取历史消息失败\",error);\n\t\t}\n\t});\n} \n\n\n</script>\n\n<h1>历史消息 <small>当前登录用户 id：<span id=\"login\"></span></small></h1>\n\n<pre class=\"docs\">\n设计改进：\n\t1. 简化 timestrap 参数功能，仅保留时间戳功能\n\t2. 新增 isCircle 参数标识是否循环拉取\n\t3. 不论 timestrap 为何值，均可在 isCircle == true 时循环拉取 (应用场景：搜索定位到某条消息后需要上翻查看)\n\t4. 拉取到无记录时不再执行，而不是又重新返回最新的消息\n\n思考：\n\t1. 定位到某条消息可以上翻了，但下翻还无解决方案\n</pre>\n\n\n<div class=\"btns\" id=\"btns\">\n\t<input type=\"button\" value=\"获取历史消息\" onclick=\"getHistroyMessage();\"> \n</div>\n\n\n<div class=\"result\" id=\"result-area\">\n\t<h3 id=\"result-title\">运行结果：</h3>\n\t<div id=\"time\"></div>\n\n\t<div class=\"result-btns\">\n\t\t<button id=\"collapse-btn\">Collapse</button>\n\t\t<button id=\"expand-btn\">Expand</button>\n\t\t<button id=\"toggle-btn\">Toggle</button>\n\t\t<button id=\"toggle-level1-btn\">Toggle level1</button>\n\t\t<button id=\"toggle-level2-btn\">Toggle level2</button>\n\t\t\n\t\t<button class=\"result-code\" id=\"result-code-btn\">查看代码</button>\n\t</div>\n\n\t<div id=\"result-body\"></div>\n</div>\n\n\n</body>\n</html>"
  },
  {
    "path": "im/.gitignore",
    "content": "node_modules\ntemp\n"
  },
  {
    "path": "im/Gruntfile.js",
    "content": "'use strict';\nvar glob = require('glob');\nvar fs = require('fs');\nmodule.exports = function(grunt) {\n    grunt.initConfig({\n        concat: {\n            dist: {\n                src: [\n                    'libs/RongEmoji.js',\n                    'libs/utils.js',\n                    'libs/qiniu-upload.js',\n                    'template.js',\n                    'emoji.js',\n                    'im.js'\n                ],\n                dest: 'temp/im.js'\n            }\n        },\n        uglify: {\n            dist: {\n                src: [\n                    'temp/im.js',\n                    'temp/template.js'\n                ],\n                dest: 'dist/im.min.js'\n            }\n        },\n        cssmin: {\n            dist: {\n                src: 'im.css',\n                dest: 'dist/im.min.css'\n            }\n        },\n        clean: {\n            dist: {\n                src: 'temp'\n            }\n        }\n    });\n\n    grunt.loadNpmTasks('grunt-contrib-concat');\n    grunt.loadNpmTasks('grunt-contrib-uglify');\n    grunt.loadNpmTasks('grunt-contrib-cssmin');\n    grunt.loadNpmTasks('grunt-contrib-clean');\n\n    grunt.registerTask('html-to-js',function () {\n        var template = {};\n        glob.sync('./templates/**/*.html').forEach(filePath => {\n            var content = fs.readFileSync(filePath, {\n                encoding: 'utf8'\n            });\n            var key = filePath.replace(/^\\.\\//, '');\n            template[key] = content;\n        });\n        var dest = './temp/template.js';\n        var outputContent = 'RCS.templateCache=' + JSON.stringify(template, null, 4) + ';';\n        fs.writeFileSync(dest, outputContent);\n    });\n\n    grunt.registerTask('dist', ['concat', 'html-to-js', 'uglify', 'cssmin', 'clean']);\n}"
  },
  {
    "path": "im/README.md",
    "content": "# 开发说明\n\n## 注意事项\n- 在线预览地址 https://rongcloud.github.io/websdk-demo/im/im.html\n- 本地开发调试必须在 http(s):// 协议下运行\n\n## 目录结构说明\n- dist \n    发布-合并压缩后的代码\n    \n- templates\n    HTML模板\n\n- im.css  \n    样式表\n- im.html  \n    开发测试页面\n- im.js  \n    im核心代码\n- emoji.js  \n    表情库调用封装\n- libs/qiniu-upload.js  \n    上传插件\n- libs/utils.js  \n    工具类\n\n## 合并压缩发布代码\n```\n安装依赖包\nnpm install\n\n合并压缩代码\ngrunt dist\n```\n\n## 参考文档\n- 用户数据处理 http://support.rongcloud.cn/kb/NjQ5\n- 消息状态 http://support.rongcloud.cn/kb/NjMz\n- 集成指南 https://rongcloud.github.io/websdk-demo/integrate/guide.html\n- 其他 demo https://github.com/rongcloud/websdk-demo"
  },
  {
    "path": "im/emoji.js",
    "content": ";(function(RCS){\n\tvar emoji = {\n\t\tinit : function(){\n\t\t\tRongIMLib.RongIMEmoji.init();\n\t\t},\n\t\temojiToHTML : function(emojiContent){\n            return RongIMLib.RongIMEmoji.emojiToHTML(emojiContent);\n        },\n        symbolToEmoji : function(sym){\n            return RongIMLib.RongIMEmoji.symbolToEmoji(sym);\n        },\n        getEmoji : function(){\n            return RongIMLib.RongIMEmoji.list.map(function(data) {\n                return data.node;\n            });\n        }\n\t}\n\tRCS.emoji = emoji;\n})(RCS);"
  },
  {
    "path": "im/im.css",
    "content": ".rongcloud-container *,.rongcloud-container *:before,.rongcloud-container *:after {\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n    margin: 0;\n    padding: 0;\n    border: 0\n}\n.rongcloud-container * {\n    padding: 0;\n    margin: 0;\n    font-size: 14px;\n    font-weight: 400;\n}\n\n.rongcloud-container a {\n    text-decoration: none;\n    outline: 0;\n}\n\n.rongcloud-container img {\n    border: none;\n    vertical-align: middle;\n}\n\n.rongcloud-container textarea {\n    overflow: auto\n}\n\n.rongcloud-clearfix {\n    *zoom:1}\n\n.rongcloud-clearfix:after {\n    display: table;\n    line-height: 0;\n    content: \"\";\n    clear: both\n}\n.rongcloud-pull-left{\n    float: left!important;\n}\n.rongcloud-pull-right{\n    float: right!important;\n}\n.rongcloud-sprite{\n    background: url(\"//cdn.ronghub.com/customerservice-icon.png\") 0 0/50px auto no-repeat;\n    display: inline-block;\n    z-index: 1;\n}\n/*.rongcloud-sprite-kefu{\n    background: url(\"images/kefuicon.png\") 0 0/50px auto no-repeat;\n    background-size: 20px 20px;\n    margin-right: 4px;\n}*/\n.rongcloud-blueBg{\n    background: url(//cdn.ronghub.com/customerservice-web-bg.png) 0 0/10px auto repeat;\n}\n/*.rongcloud-kefuListBox{\n    width: 194px;\n    height: 470px;\n    position: fixed;\n    right: 520px;\n    bottom: 100px;\n    z-index: 999;\n    box-shadow: 1px 1px #f9fafb;\n    background-color: white;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n    border-radius: 5px;\n}*/\n#zhichiBtnBox .rongcloud-people{\n    background-position: 0 -411px;\n    width: 26px;\n    height: 32px;\n}\n#zhichiBtnBox .rongcloud-kefuBtn .rongcloud-arrow-up{\n    margin-left: 0;\n}\n\n.rongcloud-kefuListBox .rongcloud-kefuList{\n    /*border: 1px solid #cdd7db;*/\n    /*border-bottom: none;*/\n    /*border-radius: 5px 5px 0px 0px;*/\n    overflow: hidden;\n    /*height: 100%;*/\n    box-sizing: border-box;\n    position: absolute;\n    border-radius: 4px;\n\n    width: 194px;\n    height: 470px;\n    position: fixed;\n    right: 520px;\n    bottom: 100px;\n    z-index: 999;\n    box-shadow: 1px 1px #f9fafb;\n    background-color: white;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n}\n.rongcloud-imList{\n    left: 50px;\n    right: auto;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-rong-header{\n    height: 36px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-toolBar{\n    text-align: center;\n    padding-top: 8px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-people {\n     vertical-align: middle;\n     margin-right: 10px;\n     width: 20px;\n     border: none;\n     height: 20px;\n     background-size: 45px auto;\n}\n\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-arrow-down{\n    background-position: 0 -65px;\n    vertical-align: middle;\n    width: 24px;\n    border: none;\n    height: 24px;\n    margin-left: 10px;\n    margin-right: -5px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-recent{\n    color: #fff;\n    font-size: 14px;\n    margin: 0;\n    padding: 0;\n    cursor:default;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-count{\n    color: #d0d4d7;\n    font-size: 12px;\n    margin: 0;\n    padding: 0;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content{\n    position: absolute;\n    top:36px;\n    bottom: 0px;\n    left: 0px;\n    right: 0px;\n    overflow-x: hidden;\n    overflow-y: auto;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus{\n    height: 40px;\n    padding-left: 18px;\n    background-color: #ffafaf;\n    line-height: 40px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online{\n    background-color: #d3f8d6;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus .rongcloud-sprite{\n    width: 20px;\n    height: 22px;\n    vertical-align: middle;\n    background-position: 0 -139px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online .rongcloud-sprite{\n    background-position: 0 -100px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus span{\n    font-size: 14px;\n    color: #fff;\n    vertical-align: middle;\n    padding-left: 2px;\n}\n.rongcloud-kefuListBox .rongcloud-kefuList .rongcloud-content .rongcloud-netStatus.rongcloud-online span{\n    color: #868686;\n}\n\n\n\n\n\n\n\n\n\n\n\n.rongcloud-kefuChat{\n    width:470px;\n    height:470px;\n    border-radius: 5px 5px 5px 5px;\n    box-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 5px 2px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header{\n    height: 36px;\n    border-radius: 4px 4px 0px 0px;\n    position: relative;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-infoBar{\n    height: 36px;\n    line-height: 36px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-infoBarTit{\n    position: relative;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-Presence{\n    border-radius: 50%;\n    width: 8px;\n    height: 8px;\n    top: 14px;\n    left: 16px;\n    border: 0;\n}\n.rongcloud-kefuChat .rongcloud-rong-header.rongcloud-online .rongcloud-Presence{\n    background-color: #20e600;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-kefuName{\n    color: #fff;\n    padding-left: 16px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar{\n    margin-right: 10px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar a{\n    width: 20px;\n    height: 20px;\n    margin-top: 9px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxHide{\n    background-position: 0 -460px;\n    cursor: pointer;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxMin{\n    background-position: 0 -252px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxMax{\n    background-position: 0 -213px;\n}\n.rongcloud-kefuChat .rongcloud-rong-header .rongcloud-toolBar .rongcloud-kefuChatBoxClose{\n    background-position: 0 -291px;\n    cursor: pointer;\n}\n.rcs-message-box {\n    width: 100%;\n    overflow: auto;\n    padding: 8px 16px;\n    position: absolute;\n    top:36px;\n    bottom: 114px;\n    background-color: white;\n    -webkit-overflow-scrolling:touch;\n}\n\n.rongcloud-kefuChat .rongcloud-outlineBox {\n    height: 40px;\n    padding-left: 18px;\n    background-color: #ffafaf;\n    line-height: 40px;\n\n    position: absolute;\n    top: 36px;\n    z-index: 10;\n    right: 0px;\n    left: 0px;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox .rongcloud-sprite {\n    width: 20px;\n    height: 22px;\n    vertical-align: middle;\n    background-position: 0 -139px;\n}\n.rongcloud-kefuChat .rongcloud-outlineBox span {\n    font-size: 14px;\n    color: #fff;\n    vertical-align: middle;\n    padding-left: 2px;\n}\n\n.rongcloud-Messages-date {\n    text-align: center;\n    padding: 10px 20px;\n    /*border-bottom: 1px solid #e4e7ea;*/\n    margin-bottom: 30px;\n    height: 10px;\n}\n\n.rongcloud-Messages-date b {\n    font-size: 9pt;\n    font-weight: normal;\n    color: #8e969f;\n    background-color: #f9fbfd;\n    display: inline-block;\n    padding: 0 20px;\n    cursor:default;\n}\n.rongcloud-Messages-history {\n    text-align: center;\n    padding: 10px 20px;\n    /*border-bottom: 1px solid #e4e7ea;*/\n    margin-bottom: 30px;\n    height: 10px;\n}\n\n.rongcloud-Messages-history b {\n    font-size: 9pt;\n    font-weight: normal;\n    color: #8e969f;\n    background-color: #f9fbfd;\n    display: inline-block;\n    padding: 0 20px;\n    cursor:pointer;\n}\n.rongcloud-Messages-history b:hover{\n  color: #0099ff;\n}\n\n\n.rongcloud-Message-wrapper > div:last-child {\n    padding-bottom: 10px;\n}\n\n.rongcloud-Message {\n    position: relative;\n    padding-left: 3pc;\n    word-wrap: break-word;\n    word-break: break-all;\n    border-spacing: 1px;\n    margin-bottom: 20px;\n}\n.rongcloud-Message-send.rongcloud-Message{\n    padding-left: 0;\n    padding-right: 3pc;\n}\n\n.rongcloud-Message-header {\n    margin-top: 15px;;\n}\n.rongcloud-Message-send .rongcloud-Message-header{\n    display: table;\n    width: 100%;\n}\n\n.rongcloud-avatar {\n    width: 34px;\n    height: 34px;\n    border-radius: 50%;\n}\n\n.rongcloud-Message img {\n    max-width: 230px;\n    max-height: 250px;\n}\n\n.rongcloud-Message-avatar {\n    position: absolute;\n    margin-left: -3pc;\n    width: 34px;\n    height: 34px;\n}\n.rongcloud-Message-send .rongcloud-Message-avatar {\n    position: absolute;\n    right: 0;\n}\n\n.rongcloud-Message-author {\n    display: inline-block;\n    position: relative;\n    padding-right: 30px;\n}\n.rongcloud-Message-send .rongcloud-Message-author{\n    float: right;\n    padding-right: 0px;\n}\n\n.rongcloud-Message-author .rongcloud-author, .rongcloud-Message-author .rongcloud-time {\n    display: block;\n    float: left;\n    line-height: 1pc;\n}\n\n.rongcloud-Message-author > .rongcloud-author {\n    color: #8e969f;\n    text-decoration: none !important;\n    cursor: default;\n}\n\n.rongcloud-Message-author > .rongcloud-time {\n    color: #8e969f;\n    font-size: 9pt;\n    margin-left: 9pt;\n}\n\n.rongcloud-Message-body {\n    position: relative;\n    /*margin-right: 70px;*/\n    font-size: 14px;\n    line-height: 18px;\n    color: #444;\n}\n.rongcloud-Message-send .rongcloud-Message-body{\n    float: right;\n}\n\n.rongcloud-Message-text, .rongcloud-file-text {\n    position: relative;\n    display: inline-block;\n    max-width: 100%;\n}\n\n.rongcloud-Message-text pre {\n    font-size: 14px;\n    line-height: 18px;\n    color: rgb(68, 68, 68);;\n    word-break: break-all;\n    word-wrap: break-word;\n\n    white-space: pre-wrap;\n\n    background-color: transparent;\n    border: none;\n    border-radius: 0;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n}\n\n.rongcloud-Message-entry {\n    display: inline-block;\n    max-width: 100%;\n}\n\n.rongcloud-Message-entry p {\n    margin-bottom: 5px;\n}\n\n.rongcloud-Message-entry a {\n    text-decoration: none;\n}\n\n.rongcloud-Message-img img {\n    border-radius: 5px;\n}\n\n/*音频消息*/\n.rongcloud-Message-audio .rongcloud-Message-entry{\n    overflow:hidden;\n}\n.rongcloud-Message-audio .rongcloud-audioBox{\n    float: left;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox{\n    float: right;\n}\n.rongcloud-Message-audio .rongcloud-audioBox {\n    display: inline-block;\n    cursor: pointer;\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) 0 0/170px auto no-repeat;\n    width: 165px;\n    height: 36px;\n    padding: 3px 0 3px 15px;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i{\n    float: left;\n    display: inline-block;\n    width: 4px;\n    height: 26px;\n    opacity: 1;\n    -webkit-transition: all 1s ease;\n    -moz-transition: all 1s ease;\n    -ms-transition: all 1s ease;\n    -o-transition: all 1s ease;\n    transition: all 1s ease;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox {\n    display: inline-block;\n    cursor: pointer;\n    background: url(./images/audioRBG.png) 0 0/165px auto no-repeat;\n    width: 165px;\n    height: 36px;\n    padding: 3px 15px 3px 0px;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i{\n    float: right;\n    display: inline-block;\n    width: 4px;\n    height: 26px;\n    opacity: 1;\n    -webkit-transition: all 1s ease;\n    -moz-transition: all 1s ease;\n    -ms-transition: all 1s ease;\n    -o-transition: all 1s ease;\n    transition: all 1s ease;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(1){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) 0px -40px/170px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(2){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) -7px -40px/170px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-audioBox i:nth-child(3){\n    background: url(//cdn.ronghub.com/customerservice-audio-bg.png) -14px -40px/170px auto no-repeat;\n}\n\n.rongcloud-Message-audio .rongcloud-audioBox.rongcloud-animate i:nth-child(2){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-audioBox.rongcloud-animate i:nth-child(3){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(1){\n    background: url(./images/audioRBG.png) -161px -40px/165px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(2){\n    background: url(./images/audioRBG.png) -154px -40px/165px auto no-repeat;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox i:nth-child(3){\n    background: url(./images/audioRBG.png) -147px -40px/165px auto no-repeat;\n}\n\n.rongcloud-Message-audio .rongcloud-r-audioBox.rongcloud-animate i:nth-child(2){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n.rongcloud-Message-audio .rongcloud-r-audioBox.rongcloud-animate i:nth-child(3){\n    animation: audioAnimate 1s linear 0s infinite ;\n    /* Firefox: */\n    -moz-animation: audioAnimate 1s linear 0s infinite ;\n    /* Safari 和 Chrome: */\n    -webkit-animation: audioAnimate 1s linear 0s infinite ;\n    /* Opera: */\n    -o-animation: audioAnimate 1s linear 0s infinite ;\n}\n@keyframes audioAnimate\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-moz-keyframes audioAnimate /* Firefox */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-webkit-keyframes audioAnimate /* Safari 和 Chrome */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n\n@-o-keyframes audioAnimate /* Opera */\n{\n    from {opacity: 0;}\n    to {opacity: 1;}\n}\n.rongcloud-Message-audio .rongcloud-audioTimer{\n    margin-top: 5px;\n    margin-left: 10px;\n    color: #8e969f;\n}\n.rongcloud-Message-audio .rongcloud-audioState{\n    width: 10px;\n    height: 10px;\n    display: inline-block;\n    background-color: #ff7373;\n    margin-top: 13px;\n    border-radius: 5px;\n}\n\n.rongcloud-sys-tips{\n    text-align: center;\n    padding: 10px 0;\n    margin-top: 10px;\n}\n.rongcloud-sys-tips>span{\n    padding:7px 10px;\n    background: #e7ecf2;\n    border-radius: 3px;\n    font-size: 12px;\n    color: #8e969f;\n    line-height: 32px;\n}\n.rongcloud-sys-tips a{\n    font-size: 12px;\n}\n.rongcloud-rong-footer {\n    background: #fff;\n    height: 114px;\n    position: absolute;\n    bottom: 0px;\n    left:0px;\n    right: 0px;\n    border-radius: 0px 0px 5px 5px;\n    /*border: 1px solid #cdd7db;\n    border-top: none;*/\n}\n\n.rongcloud-footer-con {\n    border-top: 1px solid #cdd7db;\n}\n.rongcloud-text-layout {\n    margin: 0 10px;\n}\n.rongcloud-funcPanel {\n    line-height: 22px;\n    height: 22px;\n    position: relative;\n    margin-top: 5px;\n}\n.rongcloud-funcPanel .rongcloud-mode1{\n    float: left;\n\n}\n.rongcloud-funcPanel .rongcloud-mode2{\n    float: right;\n    cursor: pointer;\n}\n.rongcloud-funcPanel .rongcloud-mode2 a{\n    color: #0099ff;\n    font-size: 12px;\n}\n.rongcloud-robotMode {\n    display: block;\n}\n.rongcloud-text {\n    width: 100%;\n    display: inline-block;\n    height: 80px;\n    padding: 5px;\n    border: 0;\n    color: #999;\n    color: black;\n    resize: none;\n    font-size: 9pt;\n    overflow: auto;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n}\n.rongcloud-text:focus {\n    outline: 0;\n}\n.rongcloud-powBox {\n    position: absolute;\n    right: 0px;\n    /*width: 100%;*/\n    height: 24px;\n}\n.rongcloud-rong-send-btn {\n    position: absolute;\n    top:55px;\n    right: 10px;\n    bottom: 0;\n    margin: 0;\n    padding: 0;\n    cursor: pointer;\n    border: none;\n    width: 60px;\n    height: 24px;\n    line-height: 24px;\n    border-radius: 40px;\n    font-size: 9pt;\n    color: rgb(255, 255, 255);\n    background: #0099ff;\n    outline:0;\n}\n.rongcloud-MessageForm-tool {\n    position: relative;\n    margin-right: 8px;\n    float: left;\n    overflow: hidden;\n}\n.rongcloud-MessageForm-tool input[type=\"file\"] {\n    position: absolute;\n    font-size: 100px;\n    right: 0;\n    top: 0;\n    cursor: pointer;\n    opacity: 0;\n}\n.rongcloud-MessageForm-tool i {\n    width: 20px;\n    height: 20px;\n    line-height: 20px;\n    cursor: pointer;\n    display: inline-block;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-smile {\n    background-size: 45px;\n    background-position: 0 -297px;\n}\n.rongcloud-expressionWrap {\n    border: 1px solid #D9DADC;\n    width: 290px;\n    padding: 5px 8px;\n    position: absolute;\n    left: -2px;\n    top: -198px;\n    height: 180px;\n    background: #fff;\n    z-index: 1100;\n    overflow: auto;\n    -webkit-tap-highlight-color: rgba(0,0,0,0);\n    -webkit-user-select:none;\n    -moz-user-select:none;\n    -ms-user-select:none;\n    user-select:none;\n}\n.rongcloud-expressionContent{\n    width: 100%;\n}\n.rongcloud-expressionContent div{\n    cursor: pointer;\n    margin: 0 2px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-upload {\n    width: 24px;\n    background-size: 45px;\n    background-position: 0 -333px;\n}\n.rongcloud-expressionWrap .rongcloud-arrow {\n    position: absolute;\n    left: 5px;\n    bottom: -9px;\n    display: inline-block;\n    width: 10px;\n    height: 9px;\n    background: url(//cdn.ronghub.com/customerservice-icon.png);\n    background-position: 0 -1476px;\n}\n\n/* 客服评价 */\n.rongcloud-layermbox {\n    /*position: relative;*/\n    position: initial;\n    height: 100%;\n    z-index: 19891014;\n}\n.rongcloud-layermmain {\n    display: table;\n    pointer-events: none;\n}\n.rongcloud-laymshade, .rongcloud-layermmain {\n    position: absolute;\n    left: 0;\n    top: 0;\n    width: 100%;\n    height: 100%;\n    z-index: 1200;\n}\n.rongcloud-laymshade {\n    background-color: rgba(0,0,0, .5);\n    pointer-events: auto;\n}\n.rongcloud-layermmain .rongcloud-section {\n    display: table-cell;\n    vertical-align: middle;\n    text-align: center;\n}\n.rongcloud-layermchild {\n    position: relative;\n    display: inline-block;\n    text-align: left;\n    background-color: #fff;\n    font-size: 14px;\n    border-radius: 3px;\n    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);\n    pointer-events: auto;\n    /*max-width: 250px;*/\n}\n.rongcloud-layermchild h3{\n    text-overflow: ellipsis;\n    overflow: hidden;\n    white-space: nowrap;\n}\n.rongcloud-layermcont{\n    padding: 20px 20px 10px;\n    text-align: center;\n}\n.rongcloud-layermbox .rongcloud-rong-btn{\n    display: inline-block;\n    width: 54px;\n    height: 30px;\n    line-height: 30px;\n    border: 1px solid #c4c4c4;\n    border-radius: 3px;\n    color: #000;\n    overflow: hidden;\n}\n.rongcloud-layermbox .rongcloud-rong-btn:hover{\n    background-color: #0099ff;\n    color: #fff;\n    border-color: #0099ff;\n}\n\n\n\n\n.rongcloud-layermbox .rongcloud-feedback{\n    background-color: rgba(0,0,0,.6);\n    color: #fff;\n    border: none;\n}\n.rongcloud-layermbox .rongcloud-feedback .rongcloud-layermcont{\n    padding: 15px;\n    font-size: 16px;\n}\n\n.cursor-pointer{\n    cursor: pointer;\n}\n/* 图片预览 */\n.rebox{\n    z-index: 999999;\n    position: fixed;\n    width: 100%;\n    height: 100%;\n    top: 0;\n    left: 0;\n    z-index: 1000;\n    background: rgba(0, 0, 0, 0.7);\n}\n.rebox-contents{\n    position: absolute;\n    top: 5%;\n    left: 5%;\n    text-align: center;\n    width: 90%;\n    height: 90%;\n}\n.rebox-contents .rebox-content {\n    border: none!important;\n    box-shadow: 0 0 8px #222!important;\n    cursor: pointer;\n    border: 5px solid #fff;\n    background-color: #fff;\n    border-radius: 1px;\n    max-width: 100%;\n    max-height: 100%; \n    margin: auto;\n    position: absolute;\n    bottom: 0;\n    top: 0;\n    left: 0; \n    right: 0;\n}\n.rebox-close {\n    right: 10px;\n    top: 10px;\n}\n.rebox-button {\n    position: absolute;\n    z-index: 9999;\n    min-width: 40px;\n    height: 40px;\n    line-height: 40px;\n    background: rgb(0, 0, 0);\n    opacity: 0.4;\n    text-decoration: none;\n    font-size: 24px;\n    color: #fff;\n    text-align: center;\n    vertical-align: middle;\n    -webkit-border-radius: 32px;\n    -moz-border-radius: 32px;\n    -ms-border-radius: 32px;\n    border-radius: 32px;\n    -webkit-transition: all 0.3s;\n    -moz-transition: all 0.3s;\n    -ms-transition: all 0.3s;\n    transition: all 0.3s;\n}\n.rebox-button:hover {\n    opacity: 1;\n    -webkit-transform: scale(1.4);\n    -moz-transform: scale(1.4);\n    -ms-transform: scale(1.4);\n    transform: scale(1.4);\n}\n\n/* 小能客服 */\n.rongcloud-layer-title {\n    padding: 5px;\n    text-align: center;\n}\n.rongcloud-evaluate .rongcloud-layer-body label {\n    line-height: 2.3;\n    margin-right: 20px;\n    color: #808586;\n}\n.rongcloud-evaluate .rongcloud-layer-body input {\n    margin-right: 5px;\n    vertical-align: middle;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n}\n.rongcloud-suggest {\n    resize: none;\n    padding: 5px;\n    width: 100%;\n    height: 70px;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n}\n.rongcloud-layer-body .rongcloud-form-item label {\n    width: 52px;\n    display: inline-block;\n    vertical-align: top;\n    text-align: right;\n    white-space: nowrap;\n}\n.rongcloud-layer-body .rongcloud-form-item textarea,input[type=text] {\n    width: 200px;\n}\n.rongcloud-layer-body .rongcloud-form-item textarea {\n    padding: 5px;\n    max-width: 200px;\n    max-height: 160px; \n    resize:none;\n}\n.rongcloud-require:before {\n    content:\"* \";\n    color:#f26868;\n    font-weight:bold;\n}\n\n.rongcloud-evaluate {\n    width: 266px;\n    padding-top: 15px;\n}\n.rongcloud-evaluate .rongcloud-layer-body{\n    padding: 20px 15px 30px;\n    -webkit-tap-highlight-color: rgba(0,0,0,0);\n    -webkit-user-select:none;\n    -moz-user-select:none;\n    -ms-user-select:none;\n    user-select:none;\n}\n.rongcloud.group-title{\n    margin-bottom: 10px;\n}\n.rongcloud-leaveword {\n    width: 300px;\n}\n.rongcloud-foot {\n    text-align: center;\n    padding-bottom: 10px;\n}\n.rongcloud-layer-submit {\n    padding: 5px;\n    width: 100px;\n    border: 1px solid #BBBBBB;\n    border-radius: 5px;\n    background-color: white;\n    outline:none;\n}\n.rongcloud-layer-submit:hover {\n    background-color: #EEE;\n}\n\n.rongcloud-layer-close {\n    position: absolute;\n    font-size: 16px;\n    top: 5px;\n    right: 5px;\n    padding: 6px;\n    line-height: 16px;\n    cursor: pointer;\n}\n.rongcloud-Message-file {\n    position: relative;\n    width: 270px;\n    overflow: hidden;\n    border: 1px solid #b9c1ca;\n    border-radius: 3px;\n}\n.rongcloud-file-icon {\n    float: left;\n    width: 52px;\n    height: 52px;\n    margin: 8px;\n    display: inline-block;\n    border-radius: 5px;\n    background-size: 45px;\n    background-position: 3px -541px;\n    background-color: #3ea9ff;\n}\n.rongcloud-file-name {\n    width: 155px;\n    margin-top: 8px;\n    margin-bottom: 4px;\n    overflow:hidden;\n    text-overflow:ellipsis;\n    white-space:nowrap;\n}\n.rongcloud-file-size {\n    font-size: 12px;\n}\n.rongcloud-file-download {\n    position: absolute;\n    right: 10px;\n    top: 15px;\n    display: inline-block;\n    width: 30px;\n    height: 30px;\n    background-size: 45px;\n    background-position: 0 -611px;\n}\n\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-file {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -443px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-download {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -476px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-evaluate {\n    width: 24px;\n    height: 24px;\n    background-size: 45px;\n    background-position: 0 -504px;\n}\n.rongcloud-MessageForm-tool i.rongcloud-iconfont-evaluate[disabled] {\n    background-position: -23px -504px;\n    cursor: default;\n}\n.rongcloud-endconversation {\n    width: 270px;\n    height: 135px;\n    padding: 22px;\n}\n.rongcloud-endconversation .rongcloud-prompt {\n    margin-top: 10px;\n}\n.rongcloud-endconversation .rongcloud-buttons {\n    margin-top: 30px;\n    text-align: center;\n}\n.rongcloud-buttons button+button {\n    margin-left: 50px;\n}\n.rongcloud-button {\n    width: 77px;\n    height: 30px;\n    line-height: 30px;\n    border: 1px solid #D8D8D8;\n    border-radius: 4px;\n    background-color: white;\n    outline:none;\n}\n.rongcloud-button:hover{\n    border-color: #53B4FF;\n    color:#53B4FF;\n}\n.rongcloud-leavemessage {\n    position: absolute;\n    top: 36px;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    background-color: white;\n}\n\n.rongcloud-leavemessage-title {\n    padding: 20px 40px 25px;\n    width: 310px;\n}\n.rongcloud-form-item {\n    margin: 0 40px 25px;\n    font-size: 14px;\n}\n.rongcloud-form-item label {\n    display: inline-block;\n    margin-right: 10px;\n}\n.rongcloud-leavemessage .rongcloud-form-item label {\n    width: 70px;\n    text-align: right;\n}\n.rongcloud-form-error {\n    color: #f26868;\n    margin: 2px 0 -19px 85px;\n    font-size: 13px;\n}\n.rongcloud-form-item textarea {\n    vertical-align: top;\n    width: 270px;\n    height: 120px;\n    padding: 4px;\n    border: 1px solid #cccccc;\n    border-radius: 4px;\n    resize: none;\n}\n.rongcloud-form-item .rongcloud-inputtext{\n    width: 270px;\n    height: 26px;\n    box-shadow: rgba(0, 0, 0, 0.07451) 0px 1px 1px inset;\n    padding: 4px;\n    border: 1px solid #cccccc;\n    border-radius: 4px;\n    outline: none;\n}\n.rongcloud-form-item .rongcloud-form-label{\n    line-height: 26px;\n}\n.rongcloud-leavemessage-form-btns{\n    text-align: center;\n}\n.rongcloud-btn {\n    width: 150px;\n    height: 30px;\n\n    line-height: 30px;\n    color: white;\n    outline: none;\n    background-color: #0099FF;\n    border-radius: 4px;\n    cursor: pointer;\n}\n/*收集用户信息*/\n.rongcloud-collectuserinfo-title{\n    padding: 30px 20px 15px\n}\n.rongcloud-collectuserinfo .rongcloud-form-item{\n    margin: 0 20px 25px;\n}\n.rongcloud-collectuserinfo .rongcloud-form-item .rongcloud-inputtext{\n    width: 200px;\n}\n.rongcloud-collectuserinfo .rongcloud-form-error{\n    margin: 2px 0 -19px 65px;\n}\n.rongcloud-consult {\n  position: fixed;\n  right: 50px;\n  bottom: 10px;\n  width: 195px;\n  text-align: center;\n}\n.rongcloud-im-consult{\n    left: 50px;\n    right: auto;\n}\n.rongcloud-consult button {\n  display: block;\n  width: 195px;\n  margin-bottom: 17px;\n  background: #0096f9;\n  border: 0;\n  padding: 0;\n  color: #fff;\n  font-family: 'Microsoft Yahei';\n  font-size: 16px;\n  cursor: pointer;\n}\n.rongcloud-consult button[disabled] {\n  background-color: #EEEEEE;\n  cursor: default;\n}\n.rongcloud-cs-icon {\n  display: inline-block;\n  padding-left: 43px;\n  line-height: 50px;\n  background: url(//cdn.ronghub.com/customerservice-icon.png) no-repeat 0 -358px;\n  background-size: 45px;\n}\n.rongcloud-im-icon{\n    display: inline-block;\n    padding-left: 43px;\n    line-height: 50px;\n    background: url(//cdn.ronghub.com/customerservice-icon.png) 0 12px/50px auto no-repeat;\n    background-size: 58px;\n}\n\n.rong-conversation{\n    font-size:12px;\n    color:#333;\n    padding: 10px 0px 10px 12px;\n    height: 56px;\n    border-bottom:1px dotted #e1e9f1;\n    cursor:pointer;\n}\n.rongcloud-photo{\n    float: left;\n    margin-right: 10px;\n    position: relative;\n    margin-top: 2px;\n}\n.rongcloud-info{\n    overflow: hidden;\n}\n.rongcloud-nickname{\n    font-weight: 400;\n    color: #000;\n    margin: 0;\n    height: 36px;\n    line-height: 36px;\n    font-size: 16px;\n}\n.rongcloud-nickname_text{\n    display: inline-block;\n    vertical-align: top;\n    width: 100%;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    word-wrap: normal;\n    color: #606164;\n    text-align: left;\n}\n.rongcloud-ext{\n    float: right;\n    color: #6b6f7c;\n    font-size: 13px;\n    text-align: right;\n    min-width: 55px;\n}\n.rongcloud-attr{\n    height: 22px;\n    font-size: 12px;\n    margin-top: 10px;\n}\n.rongcloud-badge{\n    display: inline-block;\n    min-width: 10px;\n    padding: 3px 7px;\n    font-size: 12px;\n    font-weight: bold;\n    line-height: 1;\n    color: #fff;\n    text-align: center;\n    white-space: nowrap;\n    vertical-align: baseline;\n    background-color: #999;\n    border-radius: 10px;\n    float: left;\n    background-color: #0099ff;\n    font-weight: normal;\n    margin-left: 3px;\n}\n.rongcloud-no-remind{\n    width: 20px;\n    height: 20px;\n    vertical-align: middle;\n    float: right;\n    background-position: 0 -177px;\n}\n\n.rcs-chat-wrapper{\n    position:fixed;\n    bottom: 100px;\n    right: 48px;\n    width: 470px;\n    height: 470px;\n}\n.rcs-chat-im-wrapper{\n    left: 247px;\n    right: auto;\n}\n\n.leavemessageHref{\n    cursor: pointer;\n    color: #00A3FF;\n}\n.leavemessageHref:hover{\n    text-decoration: underline;\n}\n\n.rong-link-site, .rong-link-email{\n    color: #008af3;\n}\n.rong-link-site:hover ,.rong-link-email:hover{\n    text-decoration: underline;\n}\n\n.satisfaction-star{\n    display: inline-block;\n    width: 35px;\n    height: 30px;\n    margin-left: 7px;\n    background-image: url(\"./images/star.png\");\n    background-repeat: no-repeat;\n    background-size: 30px;\n    cursor: pointer;\n}\n.satisfaction-star-selected{\n    background-position-y: -30px;\n}\n.rongcloud-evaluate-btn{\n    width: 50%;\n    height: 50px;\n    color: #0099ff;\n    text-align: center;\n    line-height: 50px;\n    background-color: #fff;\n    box-sizing: border-box;\n    cursor: pointer;\n    outline: none;\n}\n.rongcloud-evaluate-btn:active{\n    background-color: #ddd;\n}\n.rongcloud-evaluate-btn:nth-child(1){\n    border-right: 1px solid #c6c6c6;\n    border-bottom-left-radius: 3px;\n}\n.rongcloud-evaluate-btn:nth-child(2){\n    border-bottom-right-radius: 3px;\n}\n.rongcloud-evaluate .rongcloud-foot{\n    padding-bottom: 0px;\n    border-top: 1px solid #c6c6c6;\n}\n.rongcloud-footer-input{\n    height: 80px;\n    padding-right: 80px;\n}\n.rongcloud-footer-textarea{\n    height: 100%;\n}\n\n.rongcloud-phone-infoBar{\n    text-align: center;\n    line-height: 36px;\n    color: #fff;\n}\n.rongcloud-phone-exit{\n    display: inline-block;\n    position: absolute;\n    left: 5px;\n    top: 5px;\n    width: 26px;\n    height: 26px;\n    background-image: url(\"./images/back.png\");\n    background-size: 25px;\n    background-repeat: no-repeat;\n}\n.rongcloud-phone-exit:active{\n    color: #c6c6c6;\n}\n.emojiItem{\n    display: inline-block;\n}\n\n@media screen and (max-width: 600px) {\n    .rcs-chat-wrapper{\n        top: 0;\n    \tleft: 0;\n    \twidth: 100%;\n    \theight: 100%;\n    }\n    .rongcloud-kefuChat{\n    \twidth: 100%;\n    \theight:100%;\n    }\n    .rongcloud-kefuChat .rongcloud-rong-header{\n        border-radius: 0px;\n    }\n    .rcs-message-box{\n        bottom: 65px;\n    }\n    .rongcloud-rong-footer{\n        height: 65px;\n    }\n    .rongcloud-footer-input{\n        height: 35px;\n    }\n    .rongcloud-rong-send-btn{\n        top: 35px;\n    }\n    .rongcloud-text{\n        height: 35px;\n    }\n}\n.rongcloud-img{\n    display: block;\n    width: 32px;\n    height: 32px;\n    border-radius: 50%;\n    -moz-border-radius: 50%;\n    -webkit-border-radius: 50%;\n}"
  },
  {
    "path": "im/im.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no\">\n<title>IM</title>\n<link rel=\"stylesheet\" href=\"im.css\">\n</head>\n<body>\n\t\n<div id=\"rcs-app\"></div>\n\n</body>\n\n<!-- \nSDK 文档：http://www.rongcloud.cn/docs/web.html#sdk\n-->\n<script src=\"//cdn.ronghub.com/RongIMLib-2.3.0.js\"></script>\n<!-- <script src=\"./libs/RongEmoji.js\"></script> -->\n<script src=\"//cdn.ronghub.com/RongEmoji-2.2.6.min.js\"></script> \n\n<script src=\"./libs/utils.js\"></script>\n<script src=\"./libs/qiniu-upload.js\"></script>\n\n<script src=\"./template.js\"></script>\n<script src=\"./emoji.js\"></script>\n<script src=\"./im.js\"></script>\n\n<!-- 实例化 -->\n<script>\n/*\n具体使用时：\n1：切换到自己的 key 和 token\n2：移除 im.js 里的 sendTextMessage(instance); 这行代码\n3：自行二次开发\n4：参考\n    - 用户数据处理 http://support.rongcloud.cn/kb/NjQ5\n    - 消息状态 http://support.rongcloud.cn/kb/NjMz\n    - 集成指南 https://rongcloud.github.io/websdk-demo/integrate/guide.html\n    - 其他 demo https://github.com/rongcloud/websdk-demo\n*/    \n(function(){\n    var appKey = \"3argexb6r934e\";\n    var token = \"b/jvjEFD41TIVT0nsf9+L3ryPPkHsvRwWZV8SVI5ICcZ2I5Nl4OdNO01OjZxjjmVlD2dmk4RZ90=\";\n\n    RCS.init({\n        appKey: appKey,\n        token: token,\n        target: document.getElementById('rcs-app'),\n        showConversitionList: true,\n        templates: {\n            button: ['<div class=\"rongcloud-consult rongcloud-im-consult\">',\n                    '   <button onclick=\"RCS.showCommon()\"><span class=\"rongcloud-im-icon\">进入 IM</span></button>',\n                    '</div>',\n                    '<div class=\"customer-service\" style=\"display: none;\"></div>'].join('')//\"templates/button.html\",\n            // chat: \"templates/chat.html\",\n            // closebefore: 'templates/closebefore.html',\n            // conversation: 'templates/conversation.html',\n            // endconversation: 'templates/endconversation.html',\n            // evaluate: 'templates/evaluate.html',\n            // imageView: 'templates/imageView.html',\n            // leaveword: 'templates/leaveword.html',\n            // main: 'templates/main.html',\n            // message: 'templates/message.html',\n            // messageTemplate: 'templates/messageTemplate.html',\n            // userInfo: 'templates/userInfo.html', \n        },\n        extraInfo: {\n            // 当前登陆用户信息\n            userInfo: {\n                name: \"游客\",\n                grade: \"VIP\"\n            },\n            // 产品信息\n            requestInfo: {\n                productId: \"123\",\n                referrer: \"10001\",\n                define: \"\" // 自定义信息\n            }\n        }\n    });\n})()\n\n\n</script>\n\n</html>"
  },
  {
    "path": "im/im.js",
    "content": ";(function(RCS){\n\tvar utils = RCS.utils;\n\tvar emoji = RCS.emoji;\n\tvar render = utils.render;\n\tvar conversation = {};\n\tconversation.lastSendTime = 0;\n\tconversation.messageContent = [];\n\tvar voicePlay = null;\n\tvar userInfoValue = {};//保存收集用户信息的相关数据\n\tvar templates = {};\n\tvar $ = utils.$;\n\tvar terminal;\n\tvar supportNot = false;//页面是否支持notification\n\n\t//加载模板\n\tvar getTemplates = function(callback){\n\t\ttemplates = RCS.getTemplates();\n\t\tcallback && callback();\n\t}\n\n\t//键盘回车发送\n\tvar keySend = function(event){\n\t\tif (event.keyCode == '13' && !event.shiftKey) {\n\t\t\tevent.preventDefault()\n\t\t\tsend();\n\t\t} else {\n\t\t\tinputChange();\n\t\t}\n\t}\n\t//发送\n\tvar send = function(){\n\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\tvar message = inputMsg.value;\n\t\tif (message) {\n\t\t\tmessage = emoji.symbolToEmoji(message);\n\t\t\tsendMessage(new RongIMLib.TextMessage({content:message,extra:\"附加信息\"}));\n\t\t\tinputMsg.value = '';\n\t\t\tinputMsg.focus();\n\t\t}\n\t}\n\t//每6秒执行一次正在输入消息发送\n\tvar inputChange = function(){\n\t \tvar timespan = new Date().getTime() - conversation.lastSendTime;\n        if (timespan > 1000 * 6) {\n            conversation.lastSendTime += timespan;\n            sendTyping();\n        }\n\t}\n\t//正在输入中\n\tvar sendTyping = function(){\n        if (conversation.targetType == RongIMLib.ConversationType.CUSTOMER_SERVICE) {\n        \tvar msg = new RongIMLib.TypingStatusMessage({\n                typingContentType:'RC:TxtMsg',\n                data:null\n            });\n            var callback = function(){};\n            sendMessage(msg,callback);\n        }\n\t}\n\t//显示表情\n\tvar showemoji = function(event){\n\t\tevent.stopPropagation();\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tif (emojiContent.style.display == 'none') {\n\t\t\tutils.show(emojiContent);\n\t\t} else {\n\t\t\tutils.hide(emojiContent);\n\t\t}\n\t}\n\t//表情点击\n\tvar chooseEmoji = function(event){\n\t\tevent.stopPropagation();\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar textArea = $('.rongcloud-text')[0];\n\t\tvar emojiName = thisTarget.getAttribute('name');\n\t\tif (emojiName) {\n\t\t\ttextArea.value += emojiName;\n\t\t\tutils.hide(emojiContent);\t\n\t\t\tif (terminal == 'pc') {\n\t\t\t\ttextArea.focus();\n\t\t\t\trange = document.createRange();\n\t\t\t\trange.selectNodeContents(textArea);\n\t\t\t\trange.collapse(true);\n\t\t\t\trange.setEnd(textArea, textArea.childNodes.length);\n\t\t\t\trange.setStart(textArea, textArea.childNodes.length);\n\t\t\t\tsel = window.getSelection();\n\t\t\t\tsel.removeAllRanges();\n\t\t\t\tsel.addRange(range);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction textMessageFormat(content) {\n\t    if(content.length === 0){\n\t        return '';\n\t    }\n\n\t    content = utils.encodeHtmlStr(content);\n\n\t    content = utils.replaceUri(content, function(uri, protocol) {\n\t        var link = uri;\n\t        if (!protocol) {\n\t            link = 'http://' + uri;\n\t        }\n\t        return '<a class=\"rong-link-site\" target=\"_blank\" href=\"'+ link +'\">' + uri + '</a>';\n\t    });\n\n\t    content = utils.replaceEmail(content, function(email) {\n\t        return '<a class=\"rong-link-email\" href=\"mailto:' + email + '\">' + email + '<a>';\n\t    });\n\n\t    return emoji.emojiToHTML(content, 18);\n\t}\n\n\t//发送消息\n\tvar sendMessage = function(msg,callback){\n\t\tvar targetId = conversation.id; // 目标 Id\n\t\tRongIMClient.getInstance().sendMessage(conversation.targetType, targetId, msg, {\n            // 发送消息成功\n            onSuccess: function (message) {\n            \tconsole.log(message);\n                //message 为发送的消息对象并且包含服务器返回的消息唯一Id和发送消息时间戳\n                console.log(\"Send successfully\");\n                callback && callback();\n                if (!callback) {\n                \tupdateConversationList();\n                \tupdateMessage(message);\n                }\n            },\n            onError: function (errorCode,message) {\n                var info = '';\n                switch (errorCode) {\n                    case RongIMLib.ErrorCode.TIMEOUT:\n                        info = '超时';\n                        break;\n                    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n                        info = '未知错误';\n                        break;\n                    case RongIMLib.ErrorCode.REJECTED_BY_BLACKLIST:\n                        info = '在黑名单中，无法向对方发送消息';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_DISCUSSION:\n                        info = '不在讨论组中';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_GROUP:\n                        info = '不在群组中';\n                        break;\n                    case RongIMLib.ErrorCode.NOT_IN_CHATROOM:\n                        info = '不在聊天室中';\n                        break;\n                    default :\n                        info = x;\n                        break;\n                }\n                console.log('发送失败:' + info);\n            }\n       \t});\n\t}\n\n\t//显示新消息\n\tvar updateMessage = function(message){\n\t\tif (message.messageType == 'ReadReceiptMessage') {\n\t\t\treturn;//ReadReceiptMessage的messageType\n\t\t}\n\t\tconversation.messageContent.push(message);\n\t\tvar newMessage = modifyMessage(utils.cloneObj(message));\n\t\tif (message.messageDirection != 1 && supportNot) {\n\t\t\tpushMessage(newMessage);\n\t\t}\n\t\tvar messageList = $(\".rcs-message-box\")[0];\n\t\tif (!messageList) {\n\t\t\treturn;\n\t\t}\n\t\tif (newMessage.sentTime - conversation.lastSendTime >= 60000) {//超过1分钟\n\t\t\tvar messageTime = {};\n\t\t\tmessageTime.content = {};\n\t\t\tmessageTime.messageType = 'TimeMessage';\n\t\t\tmessageTime.sentTime = utils.getTime(newMessage.sentTime);\n\t\t\tmessageList.innerHTML += render(templates.imMessageTemplate,messageTime);\n\t\t\tconversation.lastSendTime = newMessage.sentTime;\n\t\t}\n\t\tmessageList.innerHTML += render(templates.imMessageTemplate,newMessage);\n\t\tmessageList.scrollTop = messageList.scrollHeight;\n\t}\n\n\t//web push message\n\tvar pushMessage = function(msg){\n\t\tif (terminal == 'pc') {\n\t\t\tvar title = '消息提醒';\n\t\t\tvar options = {\n\t\t        body: \"您有一条新消息，请及时回复\",\n\t\t        icon: (msg.content.user&&msg.content.user.icon) ? msg.content.user.icon : \"./images/kefu.png\",\n\t\t    };\n\t\t    var notification = new Notification(title,options);\n\n\t\t    notification.onclick = function(event) {\n\t\t        window.focus();\n\t\t        notification.close();\n\t\t    }\n\t\t    notification.onshow = function() {  \n\t            setTimeout(function() {  \n\t                notification.close();\n\t            }, 5000);  \n\t        };\n\t\t}\n\t}\n\n\t//图片新消息图片加载完毕滚动到最下面\n\tvar scrollBottom = function(){\n\t\tvar messageList = $(\".rcs-message-box\")[0];\n\t\tmessageList.scrollTop = messageList.scrollHeight;\n\t}\n\t//加载历史消息\n\tvar loadHisMessages = function(){\n\t\tvar callbacks = function(list,hasMsg){\n\t\t\tvar messageBox = $(\".rcs-message-box\")[0];\n\t\t\tvar messageList = {};\n\t\t\tmessageList.hasMore = hasMsg;\n\t\t\tmessageList.list = modificateMessage(conversation.messageContent);\n\t\t\tvar oldHeight = messageBox.scrollHeight;\n\t\t\tmessageBox.innerHTML = render(templates.imMessage,messageList);\n\t\t\tvar newHeight = messageBox.scrollHeight;\n\t\t\tmessageBox.scrollTop = newHeight-oldHeight;\n\t\t}\n\t\tgetHisMessage(conversation.id,null,20,callbacks);\n\t}\n\n\tvar createIMConversation = function(config){\n\t\tvar data = {\n\t\t\t\"showConversitionList\": true\n\t\t}\n\t\tvar callback = function(list){\n\t\t\tvar obj = {};\n\t\t\tobj.list = list;\n\t\t\tdata.conversationList = render(templates.conversation, obj);\n\t\t\t$(\".customer-service\")[0].innerHTML = render(templates.imMain,data);\n\t\t}\n\t\tgetConversationList(callback);\n\t}\n\n\t//开始会话\n\tvar startConversation = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tif (thisTarget.className.indexOf('rongcloud-sprite') != -1) {\n\t\t\tevent.currentTarget.parentNode.removeChild(event.currentTarget);\n\t\t\tremoveConversation(event.currentTarget.getAttribute(\"_cid\"));\n\t\t\tif (conversation.id == event.currentTarget.getAttribute(\"_cid\")) {\n\t\t\t\t$('.rcs-chat-wrapper')[0].innerHTML = '';\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (conversation.id == event.currentTarget.getAttribute(\"_cid\")) {\n\t\t\treturn;\n\t\t}\n\t\tconversation.messageContent = [];\n\t\tconversation.id = event.currentTarget.getAttribute(\"_cid\");\n\t\tconversation.mcount = event.currentTarget.getAttribute('_mcount');\n\t\tif (conversation.mcount != 0) {\n\t\t\tvar badge = event.currentTarget.querySelector('.rongcloud-badge');\n\t\t\tif (badge) {\n\t\t\t\tbadge.parentNode.removeChild(badge);\n\t\t\t\tclearUnreadCount(conversation.id);\n\t\t\t}\n\t\t}\n\t\t//打开会话\n\t\topenConversation(conversation);\n\t}\n\n\t//删除会话\n\tvar removeConversation = function(targetId){\n\t\tRongIMClient.getInstance().removeConversation(RongIMLib.ConversationType.PRIVATE,targetId,{\n\t\t    onSuccess:function(bool){\n\t\t    \tconsole.log('删除会话成功');\n\t\t       // 删除会话成功。\n\t\t    },\n\t\t    onError:function(error){\n\t\t       // error => 删除会话的错误码\n\t\t    }\n\t\t});\n\t}\n\n\t//获取会话列表\n\tvar getConversationList = function(callback){\n\t\tRongIMClient.getInstance().getConversationList({\n\t\t  \tonSuccess: function(list) {\n\t\t  \t\t//用户信息处理 http://support.rongcloud.cn/kb/NjQ5\n\t\t  \t\tvar _list = [];\n\t\t    \tfor (var i = 0; i < list.length; i++) {\n\t\t    \t\tif (list[i].conversationType == RongIMLib.ConversationType.PRIVATE) {\n\t\t    \t\t\t_list.push(list[i]);\n\t\t    \t\t}\n\t\t    \t}\n\t\t    \tvar temp = _list[0];\n\t\t    \tfor (var i = 0; i < _list.length; i++) {\n\t\t    \t\tfor (var j = i+1; j < _list.length; j++) {\n\t\t    \t\t\tif (_list[i].sentTime < _list[j].sentTime) {\n\t\t    \t\t\t\tvar temp = _list[i];\n\t\t    \t\t\t\t_list[i] = _list[j];\n\t\t    \t\t\t\t_list[j] = temp;\n\t\t    \t\t\t}\n\t\t    \t\t}\n\t\t    \t}\n\t\t    \tcallback && callback(_list);\n\t\t  \t},\n\t\t  \tonError: function(error) {\n\t\t     \t// do something...\n\t\t  \t}\n\t\t},null);\n\t}\n\n\t//更新会话列表\n\tvar updateConversationList = function(){\n\t\tvar callback = function(list){\n\t\t\tvar obj = {};\n\t\t\tobj.list = list;\n\t\t\t$('.rcs-conversation-list')[0].innerHTML = render(templates.conversation, obj);\n\t\t}\n\t\tgetConversationList(callback);\n\t}\n\n\t//清楚未读消息数\n\tvar clearUnreadCount = function(targetId){\n\t\tvar conversationType = RongIMLib.ConversationType.PRIVATE;\n\t\tRongIMClient.getInstance().clearUnreadCount(conversationType,targetId,{\n\t\t    onSuccess:function(){\n\t\t    \tconsole.log('清除未读消息成功');\n\t\t        // 清除未读消息成功。\n\t\t    },\n\t\t    onError:function(error){\n\t\t        // error => 清除未读消息数错误码。\n\t\t    }\n\t\t});\n\t}\n\n\t//进入指定会话\n\tvar openConversation = function(conversation){\n\t\tconversation.targetType = RongIMLib.ConversationType.PRIVATE;\n\t\tvar chat = $(\".rcs-chat-wrapper\")[0];\n\t\tvar callbacks = function(list,hasMsg){\n\t\t\tvar data = {};\n\t\t\tvar messageList = {};\n\t\t\tmessageList.firstEnter = true;\n\t\t\tmessageList.list = modificateMessage(list);\n\n\t\t\tdata.messageList = render(templates.imMessage, messageList);\n\t\t\tdata.targetName = '用户：'+conversation.id;\n\t\t\tdata.terminal = terminal;\n\t\t\t$(\".rcs-chat-wrapper\")[0].innerHTML = render(templates.chat, data);\n\t\t\tscrollBottom();\n\t\t\tutils.hide($('.rongcloud-mode2')[0]);\n\t\t\tutils.show($('.rongcloud-mode1')[0]);\n\t\t\t//初始化表情\n\t\t\tvar emojiList = emoji.getEmoji();\n\t\t\tvar strHtml = '';\n\t\t\tfor (var i = 0; i < emojiList.length; i++) {\n\t\t\t\tstrHtml += '<div class=\"emojiItem\">'+emojiList[i].outerHTML+'</div>';\n\t\t\t}\n\t\t\t$('.rongcloud-expressionContent')[0].innerHTML += strHtml;\n\n\t\t\tif (hasMsg) {\n\t\t\t\t$('.rongcloud-Messages-history')[0].style.display = 'block';\n\t\t\t}\n\t\t}\n\t\tvar count = conversation.mcount < 2 ? 2 : (conversation.mcount > 20 ? 20 : conversation.mcount);\n\t\tgetHisMessage(conversation.id,0,parseInt(count),callbacks);\n\t}\n\n\t//拉去消息记录\n\tvar getHisMessage = function(conversationId,timestrap,count,callbacks){\n\t\tvar conversationType = RongIMLib.ConversationType.PRIVATE; //私聊,其他会话选择相应的消息类型即可。\n\t\tvar targetId = conversationId; // 想获取自己和谁的历史消息，targetId 赋值为对方的 Id。\n\t\t// timestrap默认传 null，若从头开始获取历史消息，请赋值为 0 ,timestrap = 0;\n\t\t// count每次获取的历史消息条数，范围 0-20 条，可以多次获取。\n\t\tRongIMLib.RongIMClient.getInstance().getHistoryMessages(conversationType, targetId, timestrap, count, {\n\t\t  onSuccess: function(list, hasMsg) {\n\t\t  \tconversation.messageContent = list.concat(conversation.messageContent);\n\t\t  \tcallbacks(list,hasMsg);\n\t\t  },\n\t\t  onError: function(error) {\n\t\t    console.log(\"GetHistoryMessages,errorcode:\" + error);\n\t\t  }\n\t\t});\n\t}\n\n\t//单条消息修饰\n\tvar modifyMessage = function(msg){\n\t\tif (msg.messageType == 'TextMessage') {\n\t\t\tmsg.content.content = textMessageFormat(msg.content.content);\n\t\t} else if (msg.messageType == 'FileMessage') {\n\t\t\tmsg.content.size = utils.getFileSize(msg.content.size);\t\n\t\t} else if (msg.messageType == 'VoiceMessage'){\n\t\t\tRongIMLib.RongIMVoice.preLoaded(msg.content.content);\n\t\t}\n\t\treturn msg;\n\t}\n\n\t//消息修饰，2条消息之间相差6000毫秒，显示消息发送时间\n\tvar modificateMessage = function(list){\n\t\tvar listTemp = JSON.parse(JSON.stringify(list));\n\t\tvar _list = [];\n\t\tfor (var i = 0; i < listTemp.length; i++) {\n\t\t\tvar messageTime = {\n\t\t\t\tsentTime: utils.getTime(listTemp[i].sentTime),\n\t\t\t\tmessageType: 'TimeMessage'\n\t\t\t};\n\t\t\tvar messageMap = [\n\t\t\t\t\"TextMessage\",\n\t\t\t\t\"FileMessage\",\n\t\t\t\t\"SightMessage\",\n\t\t\t\t\"ImageMessage\",\n\t\t\t\t\"VoiceMessage\",\n\n\t\t\t];\n\t\t\tif (messageMap.indexOf(listTemp[i].messageType) >= 0) {\n\t\t\t\tlistTemp[i] = modifyMessage(listTemp[i]);\n\t\t\t} else {\n\t\t\t\tlistTemp[i].messageType = 'UnknownMessage';\n\t\t\t}\n\t\t\tif (i == 0) {\n\t\t\t\t_list.push(messageTime);\n\t\t\t}else if (listTemp[i].sentTime - listTemp[i-1].sentTime >= 60000) {\n\t\t\t\t_list.push(messageTime);\n\t\t\t}\n\t\t\t_list.push(listTemp[i]);\n\t\t}\n\t\treturn _list;\n\t}\n\n\t//播放音频\n\tvar play = function(event, msgContent){\n\t\tRongIMLib.RongIMVoice.stop();\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tif (thisTarget.className.indexOf('rongcloud-animate') != -1) {\n\t\t\tthisTarget.className = thisTarget.className.replace(' rongcloud-animate','');\n\t\t\tclearTimeout(voicePlay);\n\t\t} else {\n\t\t\tvar audioStatusNode = thisTarget.parentNode.querySelector('.rongcloud-audioState');\n\t\t\tif (audioStatusNode) {\n\t\t\t\taudioStatusNode.parentNode.removeChild(audioStatusNode);\n\t\t\t}\n\t\t\tif (voicePlay) {\n\t\t\t\tclearTimeout(voicePlay);\n\t\t\t\tvar voiceList = $('.rongcloud-audioBox');\n\t\t\t\tfor (var i = 0; i < voiceList.length; i++) {\n\t\t\t\t\tvoiceList[i].className = 'rongcloud-audioBox rongcloud-clearfix';\n\t\t\t\t}\n\t\t\t}\n\t\t\tRongIMLib.RongIMVoice.play(msgContent.content, msgContent.duration);\n\t\t\tthisTarget.className = thisTarget.className +' rongcloud-animate';\n\t\t\tvoicePlay = setTimeout(function(){\n\t\t\t\tthisTarget.className = thisTarget.className.replace(' rongcloud-animate','');\n\t\t\t},msgContent.duration * 1000);\n\t\t}\n\t}\n\n\t//播放视频\n\tvar playVideo = function (event) {\n\t\tvar video = event.currentTarget.querySelector('video');\n        var btn = event.currentTarget.querySelector('.play-btn');\n        if (video.paused) {\n            video.play();\n            btn.style.display = \"none\";\n        } else {\n            video.pause();\n            btn.style.display = \"block\";\n        }\n        video.onended = function () {\n            btn.style.display = \"block\";  \n        }\n\t}\n\n\n\t//img上传图片\n\tvar imgUpload = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar _file = thisTarget.files;\n\t\tfor (var i = 0; i < _file.length; i++) {\n\t\t\tRCS.imageStartUpload(_file[i],function(data){\n\t\t\t\tconsole.log(\"文件上传完成：\", data);\n\t\t\t\tgetFileUrl(data);\n\t\t\t});\n\t\t}\n\t\tthisTarget.value = '';\n\t}\n\t//上传文件\n\tvar fileUpload = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar _file = thisTarget.files;\n\t\tfor (var i = 0; i < _file.length; i++) {\n\t\t\tRCS.fileStartUpload(_file[i],function(data){\n\t\t\t\tconsole.log(\"文件上传完成：\", data);\n\t\t\t\tgetFileUrl(data);\n\t\t\t});\n\t\t}\n\t\tthisTarget.value = '';\n\t}\n\n\tvar urlItem = {\n\t\tfile: function(data){\n\t\t\tif (RCS.config.fileConfig && RCS.config.fileConfig.isPrivate) {\n\t\t\t\tif (data.rc_url.type == 1) {\n\t\t\t\t\tdata.downloadUrl = data.rc_url.path;\n\t\t\t\t} else {\n\t\t\t\t\tdata.downloadUrl = RCS.config.fileConfig.fileServer + data.rc_url.path;\n\t\t\t\t}\n\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\tsendMessage(msg);\n\t\t\t} else {\n\t\t\t\tvar fileType = RongIMLib.FileType.FILE;\n\t\t\t\tRongIMClient.getInstance().getFileUrl(fileType, data.filename, data.name, {\n\t\t\t\t\tonSuccess: function(result){\n\t\t\t\t\t\tdata.downloadUrl = result.downloadUrl;\n\t\t\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\t\t\tsendMessage(msg);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error){\n\t\t\t\t\t\tshowResult('getFileToken error:' + error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\timage: function(data){\n\t\t\tif (RCS.config.upload && RCS.config.upload.isPrivate) {\n\t\t\t\tif (data.rc_url.type == 1) {\n\t\t\t\t\tdata.downloadUrl = data.rc_url.path;\n\t\t\t\t} else {\n\t\t\t\t\tdata.downloadUrl = RCS.config.upload.fileServer + data.rc_url.path;\n\t\t\t\t}\n\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\tsendMessage(msg);\n\t\t\t} else {\n\t\t\t\tvar fileType = RongIMLib.FileType.IMAGE;\n\t\t\t\tRongIMClient.getInstance().getFileUrl(fileType, data.filename, null, {\n\t\t\t\t\tonSuccess: function(result){\n\t\t\t\t\t\tdata.downloadUrl = result.downloadUrl;\n\t\t\t\t\t\tvar msg = messageItem[data.fileType](data);\n\t\t\t\t\t\tsendMessage(msg);\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error){\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tvar messageItem = {\n        file: function(file){\n            var name = file.name || '',\n            index = name.lastIndexOf('.') + 1,\n            type = name.substring(index);\n            // 发送文件消息请参考： http://rongcloud.cn/docs/web_api_demo.html#发送消息\n            // 创建文件消息\n            return new RongIMLib.FileMessage({ name: file.name, size: file.size, type: type, fileUrl: file.downloadUrl});\n        },\n        image: function(image){\n            return new RongIMLib.ImageMessage({content: image.thumbnail, imageUri: image.downloadUrl});\n        }\n    };\n\n\tvar getFileUrl = function(data){\n\t\turlItem[data.fileType](data);\n\t}\n\n\t//关闭聊天窗口\n\tvar endConversation = function(){\n\t\t$('.rcs-chat-wrapper')[0].innerHTML = '';\n\t}\n\n\t//最小化\n\tvar minimize = function(){\n\t\tutils.hide($('.customer-service')[0]);\n\t}\n\n\t//预览图片\n\tvar viewImage = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tvar image = {\n\t\t\timageUrl: thisTarget.getAttribute('data-img')\n\t\t}\n\t\t$('.imageViewBox')[0].innerHTML = render(templates.imageView,image);\n\t\tutils.fadein($('.imageViewBox')[0]);\n\t}\n\tvar escImageView = function(){\n\t\t$('.imageViewBox')[0].innerHTML = '';\n\t\tutils.fadeout($('.imageViewBox')[0]);\n\t}\n\n\t//sdk初始化\n\tvar sdkInit = function(params, callbacks){\n\t\tvar appKey = params.appKey;\n\t\tvar token = params.token;\n\t\tvar navi = params.navi || \"\";\n\n\t\tif(navi !== \"\"){\n\t\t\t//私有云\n\t\t\tvar config = {\n\t\t\t\tnavi : navi\n\t\t\t};\n\t\t\tconsole.log(\"私有云\");\n\t\t\tconsole.log(params);\n\t\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\t\t}else{\n\t\t\t//公有云\n\t\t\tconsole.log(\"公有云\");\n\t\t\tconsole.log(params);\n\t\t\tRongIMLib.RongIMClient.init(appKey);\n\t\t}\n\n\t\tvar instance = RongIMClient.getInstance();\n\n\t\t// 连接状态监听器\n\t\tRongIMClient.setConnectionStatusListener({\n\t\t\tonChanged: function (status) {\n\t\t\t\tconsole.log(status);\n\t\t\t\tvar connectDom = $('.rcs-connect-status')[0];\n\t\t\t\tif (connectDom) {\n\t\t\t\t\tconnectDom.style.display = 'block';\n\t\t\t\t}\n\t\t\t    switch (status) {\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t        \tif (connectDom) {\n\t\t\t\t\t\t\tconnectDom.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t            callbacks.getInstance && callbacks.getInstance(instance);\n\t\t\t            break;\n\t\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t                console.log('正在链接');\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t                console.log('断开连接');\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t                console.log('其他设备登录');\n\t\t                break;\n\t              \tcase RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t                console.log('域名不正确');\n\t\t                break;\n\t\t            case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t              \tconsole.log('网络不可用');\n\t\t                break;\n\t\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t                \tconsole.log('断开连接');\n\t\t                break;\n\t                case 4:\n\t                \tconsole.log('token无效');\n\t\t                break;\n\t                default:\n\t                \tconsole.log('未知错误');\n\t\t                break;\n\t\t\t        }\n\t\t\t}\n\t\t});\n\n\t\tRongIMClient.setOnReceiveMessageListener({\n\t\t\t// 接收到的消息\n\t\t\tonReceived: function (message) {\n\t\t\t    // 判断消息类型\n\t\t\t    console.log(\"新消息: \" + message.targetId);\n\t\t\t    if (message.offLineMessage) {\n\t\t\t    \treturn;\n\t\t\t    }\n\t            console.log(message);\n\t            if (message.conversationType == RongIMLib.ConversationType.PRIVATE) {\n\t            \tif (message.targetId == conversation.id) {\n\t            \t\tupdateMessage(message);\n\t            \t\tclearUnreadCount(conversation.id);\n\t            \t}\n\t            \tupdateConversationList();\n\t            }\n\t\t\t}\n\t\t});\n\n\t\t//开始链接\n\t\tRongIMClient.connect(token, {\n\t\t\tonSuccess: function(userId) {\n\t\t\t\tcallbacks.getCurrentUser && callbacks.getCurrentUser(userId);\n\t\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\n\t\t\t},\n\t\t\tonTokenIncorrect: function() {\n\t\t\t\tconsole.log('token无效');\n\t\t\t},\n\t\t\tonError:function(errorCode){\n\t\t\t\tconsole.log(\"=============================================\");\n\t\t\t\tconsole.log(errorCode);\n\t\t\t}\n\t\t});\n\t}\n\n\t//创建button\n\tvar createButton = function(config){\n\t\tconfig.target.innerHTML = render(templates.button);\n\t\tcreateIMConversation(config);\t\n\t\taddListener(config);\n\t}\n\n\tvar addListener = function(config){\n\t\tvar callback = function(phoneOrPc){\n\t\t\tterminal = phoneOrPc;\n\t\t}\n\t\tutils.browserRedirect(callback);\n\t\tif (terminal == 'pc') {\n\t\t\tdocument.body.onclick = function(){\n\t\t\t\thideEmoji();\n\t\t\t}\n\t\t\tif (Notification.permission === \"granted\") {\n\t\t\t    supportNot = true;\n\t\t\t}\n\t\t\t// Otherwise, we need to ask the user for permission\n\t\t\telse if (Notification.permission !== \"denied\") {\n\t\t\t    Notification.requestPermission(function (permission) {\n\t\t\t        // If the user accepts, let's create a notification\n\t\t\t        if (permission === \"granted\") {\n\t\t\t            supportNot = true;\n\t\t\t        }\n\t\t\t    });\n\t\t\t}\n\t\t} else {\n\t\t\tdocument.body.ontouchstart = function(event){\n\t\t\t\tif (event.target.className.indexOf('emojiItem') < 0 && event.target.className.indexOf('rong-emoji-content') < 0 && event.target.className.indexOf('rongcloud-expressionContent') < 0 ) {\n\t\t\t\t\thideEmoji();\n\t\t\t\t}\n\t\t\t\tif (event.target.className.indexOf('rongcloud-rong-btn') < 0 && event.target.className.indexOf('rongcloud-text') < 0) {\n\t\t\t\t\tvar inputMsg = $(\".rongcloud-text\")[0];\n\t\t\t\t\tif (inputMsg) {\n\t\t\t\t\t\tinputMsg.blur();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar hideEmoji = function(){\n\t\tvar emojiContent = $('.rongcloud-expressionWrap')[0];\n\t\tif (emojiContent) {\n\t\t\tutils.hide(emojiContent);\n\t\t}\n\t}\n\n\t//button点击事件\n\tvar showCommon = function(){\n\t\tvar csContext = $('.customer-service')[0];\n\t\tif (csContext.style.display == 'none') {\n\t\t\tutils.show($('.customer-service')[0]);\n\t\t} else {\n\t\t\tutils.hide($('.customer-service')[0]);\n\t\t}\n\t}\n\n\tvar sendTextMessage = function(instance){\n\t\tvar content = {\n\t\t\tcontent: [\n\t\t\t\t\"这是一条测试各种字符的消息\",\n\t\t\t\t\"阿拉伯语：الشرق الأوسط \",\n\t\t\t\t\"希伯来语：המזרח התיכון\",\n\t\t\t\t\"希腊字母： π，α，β, \",\n\t\t\t\t\"数字单位部分字符 如：× \",\n\t\t\t\t\"拉丁文所有字符 如：Ο Ρ σ Ï Æ \",\n\t\t\t\t\"拼音所有字符 如： ě ì ň \",\n\t\t\t\t\"英文音标部分字符 如 ： ə ʃ \",\n\t\t\t\t\"俄文部分字符 如 ：ш ; ⊇ â Œ Š ™ \"\n\t\t\t].join(\",\")\n\t\t};\n\n\t\tvar msg = new RongIMLib.TextMessage(content);\n\n\t\tvar conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n\t\tvar targetId = \"bb\";\n\t\tinstance.sendMessage(conversationType, targetId, msg, {\n\t        onSuccess: function (message) {\n\t        \tconsole.log(message);\n\t        },\n\t        onError: function (errorCode,message) {\n\t\t\t\tconsole.log(errorCode);\t        \n\t\t\t}\n\t    });\n\t}\n\n\t//im组件初始化\n\tvar init = function(config){\n\t\tRCS.config = config;\n\t\tconfig.isIM = true;\n\t\tvar callbacks = {\n\t\t\tgetInstance: function(instance){\n\t\t\t\tvar callback = function(){\n\t\t\t\t\tif (RCS.config.templates) {\n\t\t\t\t\t\tfor (var index in RCS.config.templates) {\n\t\t\t\t\t\t\ttemplates[index] = RCS.config.templates[index];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetTemplates(callback);\n\t\t\t\temoji.init();\n\t\t\t\tcreateButton(config);\n\n\t\t\t\t//发送一条消息，为了确保有会话，实际使用时请删除\n\t\t\t\tsendTextMessage(instance);\n\t\t\t},\n\t\t\tgetCurrentUser: function(userId){\n\t\t\t\tshowInfo(userId);\n\t\t\t}\n\t\t}\n\t\tsdkInit(config,callbacks);\n\t}\n\n\t//H5唤醒键盘的时候输入框显示在视野内\n\tvar keyboard = function(event){\n\t\tvar thisTarget = event.target || event.srcElement;\n\t\tsetTimeout(function(){\n\t\t\tthisTarget.scrollIntoView(true);\n\t\t},500)\n\t}\n\n\t//页面显示当前用户信息\n\tvar showInfo = function(userId){\n\t\tvar dialog = document.createElement('h2');\n\t\tdialog.innerText = '当前用户：';\n\t\tvar userInfo = document.createElement('span');\n\t\tuserInfo.innerText = userId;\n\t\tdialog.appendChild(userInfo);\n\t\tdocument.body.appendChild(dialog);\n\t}\n\n\t//对外暴露\n\tRCS.init = init;\n\tRCS.send = send;\n\tRCS.keySend = keySend;\n\tRCS.showemoji = showemoji;\n\tRCS.chooseEmoji = chooseEmoji;\n\tRCS.loadHisMessages = loadHisMessages;\n\tRCS.scrollBottom = scrollBottom;\n\tRCS.imgUpload = imgUpload;\n\tRCS.fileUpload = fileUpload;\n\tRCS.endConversation = endConversation;\n\tRCS.play = play;\n\tRCS.playVideo = playVideo;\n\tRCS.minimize = minimize;\n\tRCS.showCommon = showCommon;\n\tRCS.confirm = confirm;\n\tRCS.close = close;\n\tRCS.viewImage = viewImage;\n\tRCS.escImageView = escImageView;\n\tRCS.keyboard = keyboard;\n\tRCS.startConversation = startConversation;\n})(RCS);"
  },
  {
    "path": "im/libs/RongEmoji.js",
    "content": ";(function(global, factory) {\n    \"use strict\";\n    if (typeof exports === \"object\" && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === \"function\" && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    var emojiFactory = {\n        \"u1F600\": { \"en\": \"Grinning Face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F601\": { \"en\": \"Grinning With Smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F602\": { \"en\": \"Laughing Tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F603\": { \"en\": \"Smiley Face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F605\": { \"en\": \"Happy Sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F606\": { \"en\": \"Big Grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F607\": { \"en\": \"Halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F608\": { \"en\": \"Purple Devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F609\": { \"en\": \"Winking Face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F611\": { \"en\": \"Expressionless Face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F612\": { \"en\": \"Dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F613\": { \"en\": \"Sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F614\": { \"en\": \"Pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F615\": { \"en\": \"Confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F616\": { \"en\": \"Confounded Face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F618\": { \"en\": \"Blowing Kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F621\": { \"en\": \"Angry Face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F622\": { \"en\": \"Sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-2075px 0px\" },\n        \"u1F623\": { \"en\": \"Helpless Face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F624\": { \"en\": \"Mad Face\", \"zh\": \"怒气冲冲\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F628\": { \"en\": \"Fearful Face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F629\": { \"en\": \"Weary Face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F630\": { \"en\": \"Cold Sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F631\": { \"en\": \"Scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F632\": { \"en\": \"Shocked Face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F633\": { \"en\": \"Flushed Face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F634\": { \"en\": \"Sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"Dizzy Face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F636\": { \"en\": \"Mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F637\": { \"en\": \"Mask Face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F3A4\": { \"en\": \"Microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B2\": { \"en\": \"Game Die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F3B5\": { \"en\": \"Musical Note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3C0\": { \"en\": \"Basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u1F3C2\": { \"en\": \"Snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3E1\": { \"en\": \"House With Garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F004\": { \"en\": \"Mahjong Red Dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F4A1\": { \"en\": \"Light Bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4A2\": { \"en\": \"Anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A3\": { \"en\": \"Bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F4A4\": { \"en\": \"Zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F4A9\": { \"en\": \"Pile Of Poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F4AA\": { \"en\": \"Flexed Biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F4B0\": { \"en\": \"Money Bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F4DA\": { \"en\": \"Books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F4DE\": { \"en\": \"Telephone Receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"Loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F6AB\": { \"en\": \"Prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u1F6BF\": { \"en\": \"Shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F30F\": { \"en\": \"Globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" },\n        \"u1F33B\": { \"en\": \"Sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F35A\": { \"en\": \"Cooked Rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F36B\": { \"en\": \"Chocolate Bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F37B\": { \"en\": \"Cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u270A\": { \"en\": \"Oncoming Fist\", \"zh\": \"击拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-1350px 0px\" },\n        \"u1F44C\": { \"en\": \"Ok Hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44D\": { \"en\": \"Thumbs Up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"Thumbs Down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F44F\": { \"en\": \"Clapping Hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F46A\": { \"en\": \"Family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"Couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F62C\": { \"en\": \"Grimacing Face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F47B\": { \"en\": \"Ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F47C\": { \"en\": \"Baby Angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F47D\": { \"en\": \"Alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F47F\": { \"en\": \"Devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F48A\": { \"en\": \"Capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F48B\": { \"en\": \"Kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"Ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F52B\": { \"en\": \"Pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F60A\": { \"en\": \"Smiley\", \"zh\": \"微笑\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u1F60B\": { \"en\": \"Hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F60C\": { \"en\": \"Pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F60D\": { \"en\": \"Heart Eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F60E\": { \"en\": \"Sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F60F\": { \"en\": \"Smirking Face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F61A\": { \"en\": \"Kiss Face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"Crazy Face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"Tongue Out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F61E\": { \"en\": \"Disappointed Face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F61F\": { \"en\": \"Worried Face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F62A\": { \"en\": \"Sleepy Face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F62B\": { \"en\": \"Tired Face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F62D\": { \"en\": \"Crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-425px 0px\" },\n        \"u1F62F\": { \"en\": \"Surprised Face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F64A\": { \"en\": \"No Speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F64F\": { \"en\": \"Folded Hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u1F319\": { \"en\": \"Drescent Moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u1F332\": { \"en\": \"Pine Tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F339\": { \"en\": \"Rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F349\": { \"en\": \"Watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F356\": { \"en\": \"Barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F366\": { \"en\": \"Ice Cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F377\": { \"en\": \"Wine Glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F381\": { \"en\": \"Wrapped Gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F382\": { \"en\": \"Birthday Cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F384\": { \"en\": \"Christmas Tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F389\": { \"en\": \"Party Popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F393\": { \"en\": \"Graduation Cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u1F434\": { \"en\": \"Horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"Dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"Pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F451\": { \"en\": \"Crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"Lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F494\": { \"en\": \"Broken Heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"Fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F556\": { \"en\": \"Clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u1F648\": { \"en\": \"See No Monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"Hear No Monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F680\": { \"en\": \"Rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u2B50\": { \"en\": \"Star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u23F0\": { \"en\": \"Alarm Clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"Hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u26A1\": { \"en\": \"Lightning Bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u26BD\": { \"en\": \"Soccer Ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u26C4\": { \"en\": \"Snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u26C5\": { \"en\": \"Cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u261D\": { \"en\": \"Pointing Up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u263A\": { \"en\": \"Cute\", \"zh\": \"萌萌哒\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F44A\": { \"en\": \"Raised Fist\", \"zh\": \"举起拳头\", \"tag\": \"\\u270A\", \"position\": \"-2975px 0px\" },\n        \"u270B\": { \"en\": \"Raised Hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u270C\": { \"en\": \"Victory Hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270F\": { \"en\": \"Pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u2600\": { \"en\": \"Sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u2601\": { \"en\": \"Cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2614\": { \"en\": \"Umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u2615\": { \"en\": \"Coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u2744\": { \"en\": \"Snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" }\n    };\n\n    var list = [];\n\n    var emojiRegExp;\n    var unicodeRegExp = /\\uf476\\uf3fb|\\uf476\\uf3fc|\\uf476\\uf3fd|\\uf476\\uf3fe|\\uf476\\uf3ff|\\uf9d2\\uf3fb|\\uf9d2\\uf3fc|\\uf9d2\\uf3fd|\\uf9d2\\uf3fe|\\uf9d2\\uf3ff|\\uf466\\uf3fb|\\uf466\\uf3fc|\\uf466\\uf3fd|\\uf466\\uf3fe|\\uf466\\uf3ff|\\uf467\\uf3fb|\\uf467\\uf3fc|\\uf467\\uf3fd|\\uf467\\uf3fe|\\uf467\\uf3ff|\\uf9d1\\uf3fb|\\uf9d1\\uf3fc|\\uf9d1\\uf3fd|\\uf9d1\\uf3fe|\\uf9d1\\uf3ff|\\uf468\\uf3fb|\\uf468\\uf3fc|\\uf468\\uf3fd|\\uf468\\uf3fe|\\uf468\\uf3ff|\\uf469\\uf3fb|\\uf469\\uf3fc|\\uf469\\uf3fd|\\uf469\\uf3fe|\\uf469\\uf3ff|\\uf9d3\\uf3fb|\\uf9d3\\uf3fc|\\uf9d3\\uf3fd|\\uf9d3\\uf3fe|\\uf9d3\\uf3ff|\\uf474\\uf3fb|\\uf474\\uf3fc|\\uf474\\uf3fd|\\uf474\\uf3fe|\\uf474\\uf3ff|\\uf475\\uf3fb|\\uf475\\uf3fc|\\uf475\\uf3fd|\\uf475\\uf3fe|\\uf475\\uf3ff|\\uf468\\uf3fb\\u200d\\u2695\\ufe0f|\\uf468\\uf3fc\\u200d\\u2695\\ufe0f|\\uf468\\uf3fd\\u200d\\u2695\\ufe0f|\\uf468\\uf3fe\\u200d\\u2695\\ufe0f|\\uf468\\uf3ff\\u200d\\u2695\\ufe0f|\\uf469\\uf3fb\\u200d\\u2695\\ufe0f|\\uf469\\uf3fc\\u200d\\u2695\\ufe0f|\\uf469\\uf3fd\\u200d\\u2695\\ufe0f|\\uf469\\uf3fe\\u200d\\u2695\\ufe0f|\\uf469\\uf3ff\\u200d\\u2695\\ufe0f|\\uf468\\uf3fb\\u200d\\uf393|\\uf468\\uf3fc\\u200d\\uf393|\\uf468\\uf3fd\\u200d\\uf393|\\uf468\\uf3fe\\u200d\\uf393|\\uf468\\uf3ff\\u200d\\uf393|\\uf469\\uf3fb\\u200d\\uf393|\\uf469\\uf3fc\\u200d\\uf393|\\uf469\\uf3fd\\u200d\\uf393|\\uf469\\uf3fe\\u200d\\uf393|\\uf469\\uf3ff\\u200d\\uf393|\\uf468\\uf3fb\\u200d\\uf3eb|\\uf468\\uf3fc\\u200d\\uf3eb|\\uf468\\uf3fd\\u200d\\uf3eb|\\uf468\\uf3fe\\u200d\\uf3eb|\\uf468\\uf3ff\\u200d\\uf3eb|\\uf469\\uf3fb\\u200d\\uf3eb|\\uf469\\uf3fc\\u200d\\uf3eb|\\uf469\\uf3fd\\u200d\\uf3eb|\\uf469\\uf3fe\\u200d\\uf3eb|\\uf469\\uf3ff\\u200d\\uf3eb|\\uf468\\uf3fb\\u200d\\u2696\\ufe0f|\\uf468\\uf3fc\\u200d\\u2696\\ufe0f|\\uf468\\uf3fd\\u200d\\u2696\\ufe0f|\\uf468\\uf3fe\\u200d\\u2696\\ufe0f|\\uf468\\uf3ff\\u200d\\u2696\\ufe0f|\\uf469\\uf3fb\\u200d\\u2696\\ufe0f|\\uf469\\uf3fc\\u200d\\u2696\\ufe0f|\\uf469\\uf3fd\\u200d\\u2696\\ufe0f|\\uf469\\uf3fe\\u200d\\u2696\\ufe0f|\\uf469\\uf3ff\\u200d\\u2696\\ufe0f|\\uf468\\uf3fb\\u200d\\uf33e|\\uf468\\uf3fc\\u200d\\uf33e|\\uf468\\uf3fd\\u200d\\uf33e|\\uf468\\uf3fe\\u200d\\uf33e|\\uf468\\uf3ff\\u200d\\uf33e|\\uf469\\uf3fb\\u200d\\uf33e|\\uf469\\uf3fc\\u200d\\uf33e|\\uf469\\uf3fd\\u200d\\uf33e|\\uf469\\uf3fe\\u200d\\uf33e|\\uf469\\uf3ff\\u200d\\uf33e|\\uf468\\uf3fb\\u200d\\uf373|\\uf468\\uf3fc\\u200d\\uf373|\\uf468\\uf3fd\\u200d\\uf373|\\uf468\\uf3fe\\u200d\\uf373|\\uf468\\uf3ff\\u200d\\uf373|\\uf469\\uf3fb\\u200d\\uf373|\\uf469\\uf3fc\\u200d\\uf373|\\uf469\\uf3fd\\u200d\\uf373|\\uf469\\uf3fe\\u200d\\uf373|\\uf469\\uf3ff\\u200d\\uf373|\\uf468\\uf3fb\\u200d\\uf527|\\uf468\\uf3fc\\u200d\\uf527|\\uf468\\uf3fd\\u200d\\uf527|\\uf468\\uf3fe\\u200d\\uf527|\\uf468\\uf3ff\\u200d\\uf527|\\uf469\\uf3fb\\u200d\\uf527|\\uf469\\uf3fc\\u200d\\uf527|\\uf469\\uf3fd\\u200d\\uf527|\\uf469\\uf3fe\\u200d\\uf527|\\uf469\\uf3ff\\u200d\\uf527|\\uf468\\uf3fb\\u200d\\uf3ed|\\uf468\\uf3fc\\u200d\\uf3ed|\\uf468\\uf3fd\\u200d\\uf3ed|\\uf468\\uf3fe\\u200d\\uf3ed|\\uf468\\uf3ff\\u200d\\uf3ed|\\uf469\\uf3fb\\u200d\\uf3ed|\\uf469\\uf3fc\\u200d\\uf3ed|\\uf469\\uf3fd\\u200d\\uf3ed|\\uf469\\uf3fe\\u200d\\uf3ed|\\uf469\\uf3ff\\u200d\\uf3ed|\\uf468\\uf3fb\\u200d\\uf4bc|\\uf468\\uf3fc\\u200d\\uf4bc|\\uf468\\uf3fd\\u200d\\uf4bc|\\uf468\\uf3fe\\u200d\\uf4bc|\\uf468\\uf3ff\\u200d\\uf4bc|\\uf469\\uf3fb\\u200d\\uf4bc|\\uf469\\uf3fc\\u200d\\uf4bc|\\uf469\\uf3fd\\u200d\\uf4bc|\\uf469\\uf3fe\\u200d\\uf4bc|\\uf469\\uf3ff\\u200d\\uf4bc|\\uf468\\uf3fb\\u200d\\uf52c|\\uf468\\uf3fc\\u200d\\uf52c|\\uf468\\uf3fd\\u200d\\uf52c|\\uf468\\uf3fe\\u200d\\uf52c|\\uf468\\uf3ff\\u200d\\uf52c|\\uf469\\uf3fb\\u200d\\uf52c|\\uf469\\uf3fc\\u200d\\uf52c|\\uf469\\uf3fd\\u200d\\uf52c|\\uf469\\uf3fe\\u200d\\uf52c|\\uf469\\uf3ff\\u200d\\uf52c|\\uf468\\uf3fb\\u200d\\uf4bb|\\uf468\\uf3fc\\u200d\\uf4bb|\\uf468\\uf3fd\\u200d\\uf4bb|\\uf468\\uf3fe\\u200d\\uf4bb|\\uf468\\uf3ff\\u200d\\uf4bb|\\uf469\\uf3fb\\u200d\\uf4bb|\\uf469\\uf3fc\\u200d\\uf4bb|\\uf469\\uf3fd\\u200d\\uf4bb|\\uf469\\uf3fe\\u200d\\uf4bb|\\uf469\\uf3ff\\u200d\\uf4bb|\\uf468\\uf3fb\\u200d\\uf3a4|\\uf468\\uf3fc\\u200d\\uf3a4|\\uf468\\uf3fd\\u200d\\uf3a4|\\uf468\\uf3fe\\u200d\\uf3a4|\\uf468\\uf3ff\\u200d\\uf3a4|\\uf469\\uf3fb\\u200d\\uf3a4|\\uf469\\uf3fc\\u200d\\uf3a4|\\uf469\\uf3fd\\u200d\\uf3a4|\\uf469\\uf3fe\\u200d\\uf3a4|\\uf469\\uf3ff\\u200d\\uf3a4|\\uf468\\uf3fb\\u200d\\uf3a8|\\uf468\\uf3fc\\u200d\\uf3a8|\\uf468\\uf3fd\\u200d\\uf3a8|\\uf468\\uf3fe\\u200d\\uf3a8|\\uf468\\uf3ff\\u200d\\uf3a8|\\uf469\\uf3fb\\u200d\\uf3a8|\\uf469\\uf3fc\\u200d\\uf3a8|\\uf469\\uf3fd\\u200d\\uf3a8|\\uf469\\uf3fe\\u200d\\uf3a8|\\uf469\\uf3ff\\u200d\\uf3a8|\\uf468\\uf3fb\\u200d\\u2708\\ufe0f|\\uf468\\uf3fc\\u200d\\u2708\\ufe0f|\\uf468\\uf3fd\\u200d\\u2708\\ufe0f|\\uf468\\uf3fe\\u200d\\u2708\\ufe0f|\\uf468\\uf3ff\\u200d\\u2708\\ufe0f|\\uf469\\uf3fb\\u200d\\u2708\\ufe0f|\\uf469\\uf3fc\\u200d\\u2708\\ufe0f|\\uf469\\uf3fd\\u200d\\u2708\\ufe0f|\\uf469\\uf3fe\\u200d\\u2708\\ufe0f|\\uf469\\uf3ff\\u200d\\u2708\\ufe0f|\\uf468\\uf3fb\\u200d\\uf680|\\uf468\\uf3fc\\u200d\\uf680|\\uf468\\uf3fd\\u200d\\uf680|\\uf468\\uf3fe\\u200d\\uf680|\\uf468\\uf3ff\\u200d\\uf680|\\uf469\\uf3fb\\u200d\\uf680|\\uf469\\uf3fc\\u200d\\uf680|\\uf469\\uf3fd\\u200d\\uf680|\\uf469\\uf3fe\\u200d\\uf680|\\uf469\\uf3ff\\u200d\\uf680|\\uf468\\uf3fb\\u200d\\uf692|\\uf468\\uf3fc\\u200d\\uf692|\\uf468\\uf3fd\\u200d\\uf692|\\uf468\\uf3fe\\u200d\\uf692|\\uf468\\uf3ff\\u200d\\uf692|\\uf469\\uf3fb\\u200d\\uf692|\\uf469\\uf3fc\\u200d\\uf692|\\uf469\\uf3fd\\u200d\\uf692|\\uf469\\uf3fe\\u200d\\uf692|\\uf469\\uf3ff\\u200d\\uf692|\\uf46e\\uf3fb|\\uf46e\\uf3fc|\\uf46e\\uf3fd|\\uf46e\\uf3fe|\\uf46e\\uf3ff|\\uf46e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf46e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf46e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf46e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf575\\uf3fb|\\uf575\\uf3fc|\\uf575\\uf3fd|\\uf575\\uf3fe|\\uf575\\uf3ff|\\uf575\\uf3fb\\u200d\\u2642\\ufe0f|\\uf575\\uf3fc\\u200d\\u2642\\ufe0f|\\uf575\\uf3fd\\u200d\\u2642\\ufe0f|\\uf575\\uf3fe\\u200d\\u2642\\ufe0f|\\uf575\\uf3ff\\u200d\\u2642\\ufe0f|\\uf575\\uf3fb\\u200d\\u2640\\ufe0f|\\uf575\\uf3fc\\u200d\\u2640\\ufe0f|\\uf575\\uf3fd\\u200d\\u2640\\ufe0f|\\uf575\\uf3fe\\u200d\\u2640\\ufe0f|\\uf575\\uf3ff\\u200d\\u2640\\ufe0f|\\uf482\\uf3fb|\\uf482\\uf3fc|\\uf482\\uf3fd|\\uf482\\uf3fe|\\uf482\\uf3ff|\\uf482\\uf3fb\\u200d\\u2642\\ufe0f|\\uf482\\uf3fc\\u200d\\u2642\\ufe0f|\\uf482\\uf3fd\\u200d\\u2642\\ufe0f|\\uf482\\uf3fe\\u200d\\u2642\\ufe0f|\\uf482\\uf3ff\\u200d\\u2642\\ufe0f|\\uf482\\uf3fb\\u200d\\u2640\\ufe0f|\\uf482\\uf3fc\\u200d\\u2640\\ufe0f|\\uf482\\uf3fd\\u200d\\u2640\\ufe0f|\\uf482\\uf3fe\\u200d\\u2640\\ufe0f|\\uf482\\uf3ff\\u200d\\u2640\\ufe0f|\\uf477\\uf3fb|\\uf477\\uf3fc|\\uf477\\uf3fd|\\uf477\\uf3fe|\\uf477\\uf3ff|\\uf477\\uf3fb\\u200d\\u2642\\ufe0f|\\uf477\\uf3fc\\u200d\\u2642\\ufe0f|\\uf477\\uf3fd\\u200d\\u2642\\ufe0f|\\uf477\\uf3fe\\u200d\\u2642\\ufe0f|\\uf477\\uf3ff\\u200d\\u2642\\ufe0f|\\uf477\\uf3fb\\u200d\\u2640\\ufe0f|\\uf477\\uf3fc\\u200d\\u2640\\ufe0f|\\uf477\\uf3fd\\u200d\\u2640\\ufe0f|\\uf477\\uf3fe\\u200d\\u2640\\ufe0f|\\uf477\\uf3ff\\u200d\\u2640\\ufe0f|\\uf934\\uf3fb|\\uf934\\uf3fc|\\uf934\\uf3fd|\\uf934\\uf3fe|\\uf934\\uf3ff|\\uf478\\uf3fb|\\uf478\\uf3fc|\\uf478\\uf3fd|\\uf478\\uf3fe|\\uf478\\uf3ff|\\uf473\\uf3fb|\\uf473\\uf3fc|\\uf473\\uf3fd|\\uf473\\uf3fe|\\uf473\\uf3ff|\\uf473\\uf3fb\\u200d\\u2642\\ufe0f|\\uf473\\uf3fc\\u200d\\u2642\\ufe0f|\\uf473\\uf3fd\\u200d\\u2642\\ufe0f|\\uf473\\uf3fe\\u200d\\u2642\\ufe0f|\\uf473\\uf3ff\\u200d\\u2642\\ufe0f|\\uf473\\uf3fb\\u200d\\u2640\\ufe0f|\\uf473\\uf3fc\\u200d\\u2640\\ufe0f|\\uf473\\uf3fd\\u200d\\u2640\\ufe0f|\\uf473\\uf3fe\\u200d\\u2640\\ufe0f|\\uf473\\uf3ff\\u200d\\u2640\\ufe0f|\\uf472\\uf3fb|\\uf472\\uf3fc|\\uf472\\uf3fd|\\uf472\\uf3fe|\\uf472\\uf3ff|\\uf9d5\\uf3fb|\\uf9d5\\uf3fc|\\uf9d5\\uf3fd|\\uf9d5\\uf3fe|\\uf9d5\\uf3ff|\\uf9d4\\uf3fb|\\uf9d4\\uf3fc|\\uf9d4\\uf3fd|\\uf9d4\\uf3fe|\\uf9d4\\uf3ff|\\uf471\\uf3fb|\\uf471\\uf3fc|\\uf471\\uf3fd|\\uf471\\uf3fe|\\uf471\\uf3ff|\\uf471\\uf3fb\\u200d\\u2642\\ufe0f|\\uf471\\uf3fc\\u200d\\u2642\\ufe0f|\\uf471\\uf3fd\\u200d\\u2642\\ufe0f|\\uf471\\uf3fe\\u200d\\u2642\\ufe0f|\\uf471\\uf3ff\\u200d\\u2642\\ufe0f|\\uf471\\uf3fb\\u200d\\u2640\\ufe0f|\\uf471\\uf3fc\\u200d\\u2640\\ufe0f|\\uf471\\uf3fd\\u200d\\u2640\\ufe0f|\\uf471\\uf3fe\\u200d\\u2640\\ufe0f|\\uf471\\uf3ff\\u200d\\u2640\\ufe0f|\\uf935\\uf3fb|\\uf935\\uf3fc|\\uf935\\uf3fd|\\uf935\\uf3fe|\\uf935\\uf3ff|\\uf470\\uf3fb|\\uf470\\uf3fc|\\uf470\\uf3fd|\\uf470\\uf3fe|\\uf470\\uf3ff|\\uf930\\uf3fb|\\uf930\\uf3fc|\\uf930\\uf3fd|\\uf930\\uf3fe|\\uf930\\uf3ff|\\uf931\\uf3fb|\\uf931\\uf3fc|\\uf931\\uf3fd|\\uf931\\uf3fe|\\uf931\\uf3ff|\\uf47c\\uf3fb|\\uf47c\\uf3fc|\\uf47c\\uf3fd|\\uf47c\\uf3fe|\\uf47c\\uf3ff|\\uf385\\uf3fb|\\uf385\\uf3fc|\\uf385\\uf3fd|\\uf385\\uf3fe|\\uf385\\uf3ff|\\uf936\\uf3fb|\\uf936\\uf3fc|\\uf936\\uf3fd|\\uf936\\uf3fe|\\uf936\\uf3ff|\\uf9d9\\uf3fb|\\uf9d9\\uf3fc|\\uf9d9\\uf3fd|\\uf9d9\\uf3fe|\\uf9d9\\uf3ff|\\uf9d9\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d9\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d9\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fb|\\uf9da\\uf3fc|\\uf9da\\uf3fd|\\uf9da\\uf3fe|\\uf9da\\uf3ff|\\uf9da\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9da\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9da\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9da\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fb|\\uf9db\\uf3fc|\\uf9db\\uf3fd|\\uf9db\\uf3fe|\\uf9db\\uf3ff|\\uf9db\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9db\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9db\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9db\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fb|\\uf9dc\\uf3fc|\\uf9dc\\uf3fd|\\uf9dc\\uf3fe|\\uf9dc\\uf3ff|\\uf9dc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fb|\\uf9dd\\uf3fc|\\uf9dd\\uf3fd|\\uf9dd\\uf3fe|\\uf9dd\\uf3ff|\\uf9dd\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9dd\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9dd\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb|\\uf64d\\uf3fc|\\uf64d\\uf3fd|\\uf64d\\uf3fe|\\uf64d\\uf3ff|\\uf64d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fb|\\uf64e\\uf3fc|\\uf64e\\uf3fd|\\uf64e\\uf3fe|\\uf64e\\uf3ff|\\uf64e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf645\\uf3fb|\\uf645\\uf3fc|\\uf645\\uf3fd|\\uf645\\uf3fe|\\uf645\\uf3ff|\\uf645\\uf3fb\\u200d\\u2642\\ufe0f|\\uf645\\uf3fc\\u200d\\u2642\\ufe0f|\\uf645\\uf3fd\\u200d\\u2642\\ufe0f|\\uf645\\uf3fe\\u200d\\u2642\\ufe0f|\\uf645\\uf3ff\\u200d\\u2642\\ufe0f|\\uf645\\uf3fb\\u200d\\u2640\\ufe0f|\\uf645\\uf3fc\\u200d\\u2640\\ufe0f|\\uf645\\uf3fd\\u200d\\u2640\\ufe0f|\\uf645\\uf3fe\\u200d\\u2640\\ufe0f|\\uf645\\uf3ff\\u200d\\u2640\\ufe0f|\\uf646\\uf3fb|\\uf646\\uf3fc|\\uf646\\uf3fd|\\uf646\\uf3fe|\\uf646\\uf3ff|\\uf646\\uf3fb\\u200d\\u2642\\ufe0f|\\uf646\\uf3fc\\u200d\\u2642\\ufe0f|\\uf646\\uf3fd\\u200d\\u2642\\ufe0f|\\uf646\\uf3fe\\u200d\\u2642\\ufe0f|\\uf646\\uf3ff\\u200d\\u2642\\ufe0f|\\uf646\\uf3fb\\u200d\\u2640\\ufe0f|\\uf646\\uf3fc\\u200d\\u2640\\ufe0f|\\uf646\\uf3fd\\u200d\\u2640\\ufe0f|\\uf646\\uf3fe\\u200d\\u2640\\ufe0f|\\uf646\\uf3ff\\u200d\\u2640\\ufe0f|\\uf481\\uf3fb|\\uf481\\uf3fc|\\uf481\\uf3fd|\\uf481\\uf3fe|\\uf481\\uf3ff|\\uf481\\uf3fb\\u200d\\u2642\\ufe0f|\\uf481\\uf3fc\\u200d\\u2642\\ufe0f|\\uf481\\uf3fd\\u200d\\u2642\\ufe0f|\\uf481\\uf3fe\\u200d\\u2642\\ufe0f|\\uf481\\uf3ff\\u200d\\u2642\\ufe0f|\\uf481\\uf3fb\\u200d\\u2640\\ufe0f|\\uf481\\uf3fc\\u200d\\u2640\\ufe0f|\\uf481\\uf3fd\\u200d\\u2640\\ufe0f|\\uf481\\uf3fe\\u200d\\u2640\\ufe0f|\\uf481\\uf3ff\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fb|\\uf64b\\uf3fc|\\uf64b\\uf3fd|\\uf64b\\uf3fe|\\uf64b\\uf3ff|\\uf64b\\uf3fb\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2642\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2642\\ufe0f|\\uf64b\\uf3fb\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fc\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fd\\u200d\\u2640\\ufe0f|\\uf64b\\uf3fe\\u200d\\u2640\\ufe0f|\\uf64b\\uf3ff\\u200d\\u2640\\ufe0f|\\uf647\\uf3fb|\\uf647\\uf3fc|\\uf647\\uf3fd|\\uf647\\uf3fe|\\uf647\\uf3ff|\\uf647\\uf3fb\\u200d\\u2642\\ufe0f|\\uf647\\uf3fc\\u200d\\u2642\\ufe0f|\\uf647\\uf3fd\\u200d\\u2642\\ufe0f|\\uf647\\uf3fe\\u200d\\u2642\\ufe0f|\\uf647\\uf3ff\\u200d\\u2642\\ufe0f|\\uf647\\uf3fb\\u200d\\u2640\\ufe0f|\\uf647\\uf3fc\\u200d\\u2640\\ufe0f|\\uf647\\uf3fd\\u200d\\u2640\\ufe0f|\\uf647\\uf3fe\\u200d\\u2640\\ufe0f|\\uf647\\uf3ff\\u200d\\u2640\\ufe0f|\\uf926\\uf3fb|\\uf926\\uf3fc|\\uf926\\uf3fd|\\uf926\\uf3fe|\\uf926\\uf3ff|\\uf926\\uf3fb\\u200d\\u2642\\ufe0f|\\uf926\\uf3fc\\u200d\\u2642\\ufe0f|\\uf926\\uf3fd\\u200d\\u2642\\ufe0f|\\uf926\\uf3fe\\u200d\\u2642\\ufe0f|\\uf926\\uf3ff\\u200d\\u2642\\ufe0f|\\uf926\\uf3fb\\u200d\\u2640\\ufe0f|\\uf926\\uf3fc\\u200d\\u2640\\ufe0f|\\uf926\\uf3fd\\u200d\\u2640\\ufe0f|\\uf926\\uf3fe\\u200d\\u2640\\ufe0f|\\uf926\\uf3ff\\u200d\\u2640\\ufe0f|\\uf937\\uf3fb|\\uf937\\uf3fc|\\uf937\\uf3fd|\\uf937\\uf3fe|\\uf937\\uf3ff|\\uf937\\uf3fb\\u200d\\u2642\\ufe0f|\\uf937\\uf3fc\\u200d\\u2642\\ufe0f|\\uf937\\uf3fd\\u200d\\u2642\\ufe0f|\\uf937\\uf3fe\\u200d\\u2642\\ufe0f|\\uf937\\uf3ff\\u200d\\u2642\\ufe0f|\\uf937\\uf3fb\\u200d\\u2640\\ufe0f|\\uf937\\uf3fc\\u200d\\u2640\\ufe0f|\\uf937\\uf3fd\\u200d\\u2640\\ufe0f|\\uf937\\uf3fe\\u200d\\u2640\\ufe0f|\\uf937\\uf3ff\\u200d\\u2640\\ufe0f|\\uf486\\uf3fb|\\uf486\\uf3fc|\\uf486\\uf3fd|\\uf486\\uf3fe|\\uf486\\uf3ff|\\uf486\\uf3fb\\u200d\\u2642\\ufe0f|\\uf486\\uf3fc\\u200d\\u2642\\ufe0f|\\uf486\\uf3fd\\u200d\\u2642\\ufe0f|\\uf486\\uf3fe\\u200d\\u2642\\ufe0f|\\uf486\\uf3ff\\u200d\\u2642\\ufe0f|\\uf486\\uf3fb\\u200d\\u2640\\ufe0f|\\uf486\\uf3fc\\u200d\\u2640\\ufe0f|\\uf486\\uf3fd\\u200d\\u2640\\ufe0f|\\uf486\\uf3fe\\u200d\\u2640\\ufe0f|\\uf486\\uf3ff\\u200d\\u2640\\ufe0f|\\uf487\\uf3fb|\\uf487\\uf3fc|\\uf487\\uf3fd|\\uf487\\uf3fe|\\uf487\\uf3ff|\\uf487\\uf3fb\\u200d\\u2642\\ufe0f|\\uf487\\uf3fc\\u200d\\u2642\\ufe0f|\\uf487\\uf3fd\\u200d\\u2642\\ufe0f|\\uf487\\uf3fe\\u200d\\u2642\\ufe0f|\\uf487\\uf3ff\\u200d\\u2642\\ufe0f|\\uf487\\uf3fb\\u200d\\u2640\\ufe0f|\\uf487\\uf3fc\\u200d\\u2640\\ufe0f|\\uf487\\uf3fd\\u200d\\u2640\\ufe0f|\\uf487\\uf3fe\\u200d\\u2640\\ufe0f|\\uf487\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fb|\\uf6b6\\uf3fc|\\uf6b6\\uf3fd|\\uf6b6\\uf3fe|\\uf6b6\\uf3ff|\\uf6b6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fb|\\uf3c3\\uf3fc|\\uf3c3\\uf3fd|\\uf3c3\\uf3fe|\\uf3c3\\uf3ff|\\uf3c3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf483\\uf3fb|\\uf483\\uf3fc|\\uf483\\uf3fd|\\uf483\\uf3fe|\\uf483\\uf3ff|\\uf57a\\uf3fb|\\uf57a\\uf3fc|\\uf57a\\uf3fd|\\uf57a\\uf3fe|\\uf57a\\uf3ff|\\uf9d6\\uf3fb|\\uf9d6\\uf3fc|\\uf9d6\\uf3fd|\\uf9d6\\uf3fe|\\uf9d6\\uf3ff|\\uf9d6\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d6\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d6\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fb|\\uf9d7\\uf3fc|\\uf9d7\\uf3fd|\\uf9d7\\uf3fe|\\uf9d7\\uf3ff|\\uf9d7\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d7\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d7\\uf3ff\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fb|\\uf9d8\\uf3fc|\\uf9d8\\uf3fd|\\uf9d8\\uf3fe|\\uf9d8\\uf3ff|\\uf9d8\\uf3fb\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2640\\ufe0f|\\uf9d8\\uf3fb\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fc\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fd\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3fe\\u200d\\u2642\\ufe0f|\\uf9d8\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6c0\\uf3fb|\\uf6c0\\uf3fc|\\uf6c0\\uf3fd|\\uf6c0\\uf3fe|\\uf6c0\\uf3ff|\\uf6cc\\uf3fb|\\uf6cc\\uf3fc|\\uf6cc\\uf3fd|\\uf6cc\\uf3fe|\\uf6cc\\uf3ff|\\uf574\\uf3fb|\\uf574\\uf3fc|\\uf574\\uf3fd|\\uf574\\uf3fe|\\uf574\\uf3ff|\\uf3c7\\uf3fb|\\uf3c7\\uf3fc|\\uf3c7\\uf3fd|\\uf3c7\\uf3fe|\\uf3c7\\uf3ff|\\uf3c2\\uf3fb|\\uf3c2\\uf3fc|\\uf3c2\\uf3fd|\\uf3c2\\uf3fe|\\uf3c2\\uf3ff|\\uf3cc\\uf3fb|\\uf3cc\\uf3fc|\\uf3cc\\uf3fd|\\uf3cc\\uf3fe|\\uf3cc\\uf3ff|\\uf3cc\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cc\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cc\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fb|\\uf3c4\\uf3fc|\\uf3c4\\uf3fd|\\uf3c4\\uf3fe|\\uf3c4\\uf3ff|\\uf3c4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3c4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3c4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fb|\\uf6a3\\uf3fc|\\uf6a3\\uf3fd|\\uf6a3\\uf3fe|\\uf6a3\\uf3ff|\\uf6a3\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6a3\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6a3\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fb|\\uf3ca\\uf3fc|\\uf3ca\\uf3fd|\\uf3ca\\uf3fe|\\uf3ca\\uf3ff|\\uf3ca\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3ca\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3ca\\uf3ff\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fb|\\uf3cb\\uf3fc|\\uf3cb\\uf3fd|\\uf3cb\\uf3fe|\\uf3cb\\uf3ff|\\uf3cb\\uf3fb\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2642\\ufe0f|\\uf3cb\\uf3fb\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fc\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fd\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3fe\\u200d\\u2640\\ufe0f|\\uf3cb\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fb|\\uf6b4\\uf3fc|\\uf6b4\\uf3fd|\\uf6b4\\uf3fe|\\uf6b4\\uf3ff|\\uf6b4\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b4\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b4\\uf3ff\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fb|\\uf6b5\\uf3fc|\\uf6b5\\uf3fd|\\uf6b5\\uf3fe|\\uf6b5\\uf3ff|\\uf6b5\\uf3fb\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2642\\ufe0f|\\uf6b5\\uf3fb\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fc\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fd\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3fe\\u200d\\u2640\\ufe0f|\\uf6b5\\uf3ff\\u200d\\u2640\\ufe0f|\\uf938\\uf3fb|\\uf938\\uf3fc|\\uf938\\uf3fd|\\uf938\\uf3fe|\\uf938\\uf3ff|\\uf938\\uf3fb\\u200d\\u2642\\ufe0f|\\uf938\\uf3fc\\u200d\\u2642\\ufe0f|\\uf938\\uf3fd\\u200d\\u2642\\ufe0f|\\uf938\\uf3fe\\u200d\\u2642\\ufe0f|\\uf938\\uf3ff\\u200d\\u2642\\ufe0f|\\uf938\\uf3fb\\u200d\\u2640\\ufe0f|\\uf938\\uf3fc\\u200d\\u2640\\ufe0f|\\uf938\\uf3fd\\u200d\\u2640\\ufe0f|\\uf938\\uf3fe\\u200d\\u2640\\ufe0f|\\uf938\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fb|\\uf93d\\uf3fc|\\uf93d\\uf3fd|\\uf93d\\uf3fe|\\uf93d\\uf3ff|\\uf93d\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93d\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93d\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93d\\uf3ff\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fb|\\uf93e\\uf3fc|\\uf93e\\uf3fd|\\uf93e\\uf3fe|\\uf93e\\uf3ff|\\uf93e\\uf3fb\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2642\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2642\\ufe0f|\\uf93e\\uf3fb\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fc\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fd\\u200d\\u2640\\ufe0f|\\uf93e\\uf3fe\\u200d\\u2640\\ufe0f|\\uf93e\\uf3ff\\u200d\\u2640\\ufe0f|\\uf939\\uf3fb|\\uf939\\uf3fc|\\uf939\\uf3fd|\\uf939\\uf3fe|\\uf939\\uf3ff|\\uf939\\uf3fb\\u200d\\u2642\\ufe0f|\\uf939\\uf3fc\\u200d\\u2642\\ufe0f|\\uf939\\uf3fd\\u200d\\u2642\\ufe0f|\\uf939\\uf3fe\\u200d\\u2642\\ufe0f|\\uf939\\uf3ff\\u200d\\u2642\\ufe0f|\\uf939\\uf3fb\\u200d\\u2640\\ufe0f|\\uf939\\uf3fc\\u200d\\u2640\\ufe0f|\\uf939\\uf3fd\\u200d\\u2640\\ufe0f|\\uf939\\uf3fe\\u200d\\u2640\\ufe0f|\\uf939\\uf3ff\\u200d\\u2640\\ufe0f|\\uf933\\uf3fb|\\uf933\\uf3fc|\\uf933\\uf3fd|\\uf933\\uf3fe|\\uf933\\uf3ff|\\uf4aa\\uf3fb|\\uf4aa\\uf3fc|\\uf4aa\\uf3fd|\\uf4aa\\uf3fe|\\uf4aa\\uf3ff|\\uf448\\uf3fb|\\uf448\\uf3fc|\\uf448\\uf3fd|\\uf448\\uf3fe|\\uf448\\uf3ff|\\uf449\\uf3fb|\\uf449\\uf3fc|\\uf449\\uf3fd|\\uf449\\uf3fe|\\uf449\\uf3ff|\\uf446\\uf3fb|\\uf446\\uf3fc|\\uf446\\uf3fd|\\uf446\\uf3fe|\\uf446\\uf3ff|\\uf595\\uf3fb|\\uf595\\uf3fc|\\uf595\\uf3fd|\\uf595\\uf3fe|\\uf595\\uf3ff|\\uf447\\uf3fb|\\uf447\\uf3fc|\\uf447\\uf3fd|\\uf447\\uf3fe|\\uf447\\uf3ff|\\uf91e\\uf3fb|\\uf91e\\uf3fc|\\uf91e\\uf3fd|\\uf91e\\uf3fe|\\uf91e\\uf3ff|\\uf596\\uf3fb|\\uf596\\uf3fc|\\uf596\\uf3fd|\\uf596\\uf3fe|\\uf596\\uf3ff|\\uf918\\uf3fb|\\uf918\\uf3fc|\\uf918\\uf3fd|\\uf918\\uf3fe|\\uf918\\uf3ff|\\uf919\\uf3fb|\\uf919\\uf3fc|\\uf919\\uf3fd|\\uf919\\uf3fe|\\uf919\\uf3ff|\\uf590\\uf3fb|\\uf590\\uf3fc|\\uf590\\uf3fd|\\uf590\\uf3fe|\\uf590\\uf3ff|\\uf44c\\uf3fb|\\uf44c\\uf3fc|\\uf44c\\uf3fd|\\uf44c\\uf3fe|\\uf44c\\uf3ff|\\uf44d\\uf3fb|\\uf44d\\uf3fc|\\uf44d\\uf3fd|\\uf44d\\uf3fe|\\uf44d\\uf3ff|\\uf44e\\uf3fb|\\uf44e\\uf3fc|\\uf44e\\uf3fd|\\uf44e\\uf3fe|\\uf44e\\uf3ff|\\uf44a\\uf3fb|\\uf44a\\uf3fc|\\uf44a\\uf3fd|\\uf44a\\uf3fe|\\uf44a\\uf3ff|\\uf91b\\uf3fb|\\uf91b\\uf3fc|\\uf91b\\uf3fd|\\uf91b\\uf3fe|\\uf91b\\uf3ff|\\uf91c\\uf3fb|\\uf91c\\uf3fc|\\uf91c\\uf3fd|\\uf91c\\uf3fe|\\uf91c\\uf3ff|\\uf91a\\uf3fb|\\uf91a\\uf3fc|\\uf91a\\uf3fd|\\uf91a\\uf3fe|\\uf91a\\uf3ff|\\uf44b\\uf3fb|\\uf44b\\uf3fc|\\uf44b\\uf3fd|\\uf44b\\uf3fe|\\uf44b\\uf3ff|\\uf91f\\uf3fb|\\uf91f\\uf3fc|\\uf91f\\uf3fd|\\uf91f\\uf3fe|\\uf91f\\uf3ff|\\uf44f\\uf3fb|\\uf44f\\uf3fc|\\uf44f\\uf3fd|\\uf44f\\uf3fe|\\uf44f\\uf3ff|\\uf450\\uf3fb|\\uf450\\uf3fc|\\uf450\\uf3fd|\\uf450\\uf3fe|\\uf450\\uf3ff|\\uf64c\\uf3fb|\\uf64c\\uf3fc|\\uf64c\\uf3fd|\\uf64c\\uf3fe|\\uf64c\\uf3ff|\\uf932\\uf3fb|\\uf932\\uf3fc|\\uf932\\uf3fd|\\uf932\\uf3fe|\\uf932\\uf3ff|\\uf64f\\uf3fb|\\uf64f\\uf3fc|\\uf64f\\uf3fd|\\uf64f\\uf3fe|\\uf64f\\uf3ff|\\uf485\\uf3fb|\\uf485\\uf3fc|\\uf485\\uf3fd|\\uf485\\uf3fe|\\uf485\\uf3ff|\\uf442\\uf3fb|\\uf442\\uf3fc|\\uf442\\uf3fd|\\uf442\\uf3fe|\\uf442\\uf3ff|\\uf443\\uf3fb|\\uf443\\uf3fc|\\uf443\\uf3fd|\\uf443\\uf3fe|\\uf443\\uf3ff|\\uf1e6\\uf1e8|\\uf1e6\\uf1e9|\\uf1e6\\uf1ea|\\uf1e6\\uf1eb|\\uf1e6\\uf1ec|\\uf1e6\\uf1ee|\\uf1e6\\uf1f1|\\uf1e6\\uf1f2|\\uf1e6\\uf1f4|\\uf1e6\\uf1f6|\\uf1e6\\uf1f7|\\uf1e6\\uf1f8|\\uf1e6\\uf1f9|\\uf1e6\\uf1fa|\\uf1e6\\uf1fc|\\uf1e6\\uf1fd|\\uf1e6\\uf1ff|\\uf1e7\\uf1e6|\\uf1e7\\uf1e7|\\uf1e7\\uf1e9|\\uf1e7\\uf1ea|\\uf1e7\\uf1eb|\\uf1e7\\uf1ec|\\uf1e7\\uf1ed|\\uf1e7\\uf1ee|\\uf1e7\\uf1ef|\\uf1e7\\uf1f1|\\uf1e7\\uf1f2|\\uf1e7\\uf1f3|\\uf1e7\\uf1f4|\\uf1e7\\uf1f6|\\uf1e7\\uf1f7|\\uf1e7\\uf1f8|\\uf1e7\\uf1f9|\\uf1e7\\uf1fb|\\uf1e7\\uf1fc|\\uf1e7\\uf1fe|\\uf1e7\\uf1ff|\\uf1e8\\uf1e6|\\uf1e8\\uf1e8|\\uf1e8\\uf1e9|\\uf1e8\\uf1eb|\\uf1e8\\uf1ec|\\uf1e8\\uf1ed|\\uf1e8\\uf1ee|\\uf1e8\\uf1f0|\\uf1e8\\uf1f1|\\uf1e8\\uf1f2|\\uf1e8\\uf1f3|\\uf1e8\\uf1f4|\\uf1e8\\uf1f5|\\uf1e8\\uf1f7|\\uf1e8\\uf1fa|\\uf1e8\\uf1fb|\\uf1e8\\uf1fc|\\uf1e8\\uf1fd|\\uf1e8\\uf1fe|\\uf1e8\\uf1ff|\\uf1e9\\uf1ea|\\uf1e9\\uf1ec|\\uf1e9\\uf1ef|\\uf1e9\\uf1f0|\\uf1e9\\uf1f2|\\uf1e9\\uf1f4|\\uf1e9\\uf1ff|\\uf1ea\\uf1e6|\\uf1ea\\uf1e8|\\uf1ea\\uf1ea|\\uf1ea\\uf1ec|\\uf1ea\\uf1ed|\\uf1ea\\uf1f7|\\uf1ea\\uf1f8|\\uf1ea\\uf1f9|\\uf1ea\\uf1fa|\\uf1eb\\uf1ee|\\uf1eb\\uf1ef|\\uf1eb\\uf1f0|\\uf1eb\\uf1f2|\\uf1eb\\uf1f4|\\uf1eb\\uf1f7|\\uf1ec\\uf1e6|\\uf1ec\\uf1e7|\\uf1ec\\uf1e9|\\uf1ec\\uf1ea|\\uf1ec\\uf1eb|\\uf1ec\\uf1ec|\\uf1ec\\uf1ed|\\uf1ec\\uf1ee|\\uf1ec\\uf1f1|\\uf1ec\\uf1f2|\\uf1ec\\uf1f3|\\uf1ec\\uf1f5|\\uf1ec\\uf1f6|\\uf1ec\\uf1f7|\\uf1ec\\uf1f8|\\uf1ec\\uf1f9|\\uf1ec\\uf1fa|\\uf1ec\\uf1fc|\\uf1ec\\uf1fe|\\uf1ed\\uf1f0|\\uf1ed\\uf1f2|\\uf1ed\\uf1f3|\\uf1ed\\uf1f7|\\uf1ed\\uf1f9|\\uf1ed\\uf1fa|\\uf1ee\\uf1e8|\\uf1ee\\uf1e9|\\uf1ee\\uf1ea|\\uf1ee\\uf1f1|\\uf1ee\\uf1f2|\\uf1ee\\uf1f3|\\uf1ee\\uf1f4|\\uf1ee\\uf1f6|\\uf1ee\\uf1f7|\\uf1ee\\uf1f8|\\uf1ee\\uf1f9|\\uf1ef\\uf1ea|\\uf1ef\\uf1f2|\\uf1ef\\uf1f4|\\uf1ef\\uf1f5|\\uf1f0\\uf1ea|\\uf1f0\\uf1ec|\\uf1f0\\uf1ed|\\uf1f0\\uf1ee|\\uf1f0\\uf1f2|\\uf1f0\\uf1f3|\\uf1f0\\uf1f5|\\uf1f0\\uf1f7|\\uf1f0\\uf1fc|\\uf1f0\\uf1fe|\\uf1f0\\uf1ff|\\uf1f1\\uf1e6|\\uf1f1\\uf1e7|\\uf1f1\\uf1e8|\\uf1f1\\uf1ee|\\uf1f1\\uf1f0|\\uf1f1\\uf1f7|\\uf1f1\\uf1f8|\\uf1f1\\uf1f9|\\uf1f1\\uf1fa|\\uf1f1\\uf1fb|\\uf1f1\\uf1fe|\\uf1f2\\uf1e6|\\uf1f2\\uf1e8|\\uf1f2\\uf1e9|\\uf1f2\\uf1ea|\\uf1f2\\uf1eb|\\uf1f2\\uf1ec|\\uf1f2\\uf1ed|\\uf1f2\\uf1f0|\\uf1f2\\uf1f1|\\uf1f2\\uf1f2|\\uf1f2\\uf1f3|\\uf1f2\\uf1f4|\\uf1f2\\uf1f5|\\uf1f2\\uf1f6|\\uf1f2\\uf1f7|\\uf1f2\\uf1f8|\\uf1f2\\uf1f9|\\uf1f2\\uf1fa|\\uf1f2\\uf1fb|\\uf1f2\\uf1fc|\\uf1f2\\uf1fd|\\uf1f2\\uf1fe|\\uf1f2\\uf1ff|\\uf1f3\\uf1e6|\\uf1f3\\uf1e8|\\uf1f3\\uf1ea|\\uf1f3\\uf1eb|\\uf1f3\\uf1ec|\\uf1f3\\uf1ee|\\uf1f3\\uf1f1|\\uf1f3\\uf1f4|\\uf1f3\\uf1f5|\\uf1f3\\uf1f7|\\uf1f3\\uf1fa|\\uf1f3\\uf1ff|\\uf1f4\\uf1f2|\\uf1f5\\uf1e6|\\uf1f5\\uf1ea|\\uf1f5\\uf1eb|\\uf1f5\\uf1ec|\\uf1f5\\uf1ed|\\uf1f5\\uf1f0|\\uf1f5\\uf1f1|\\uf1f5\\uf1f2|\\uf1f5\\uf1f3|\\uf1f5\\uf1f7|\\uf1f5\\uf1f8|\\uf1f5\\uf1f9|\\uf1f5\\uf1fc|\\uf1f5\\uf1fe|\\uf1f6\\uf1e6|\\uf1f7\\uf1ea|\\uf1f7\\uf1f4|\\uf1f7\\uf1f8|\\uf1f7\\uf1fa|\\uf1f7\\uf1fc|\\uf1f8\\uf1e6|\\uf1f8\\uf1e7|\\uf1f8\\uf1e8|\\uf1f8\\uf1e9|\\uf1f8\\uf1ea|\\uf1f8\\uf1ec|\\uf1f8\\uf1ed|\\uf1f8\\uf1ee|\\uf1f8\\uf1ef|\\uf1f8\\uf1f0|\\uf1f8\\uf1f1|\\uf1f8\\uf1f2|\\uf1f8\\uf1f3|\\uf1f8\\uf1f4|\\uf1f8\\uf1f7|\\uf1f8\\uf1f8|\\uf1f8\\uf1f9|\\uf1f8\\uf1fb|\\uf1f8\\uf1fd|\\uf1f8\\uf1fe|\\uf1f8\\uf1ff|\\uf1f9\\uf1e6|\\uf1f9\\uf1e8|\\uf1f9\\uf1e9|\\uf1f9\\uf1eb|\\uf1f9\\uf1ec|\\uf1f9\\uf1ed|\\uf1f9\\uf1ef|\\uf1f9\\uf1f0|\\uf1f9\\uf1f1|\\uf1f9\\uf1f2|\\uf1f9\\uf1f3|\\uf1f9\\uf1f4|\\uf1f9\\uf1f7|\\uf1f9\\uf1f9|\\uf1f9\\uf1fb|\\uf1f9\\uf1fc|\\uf1f9\\uf1ff|\\uf1fa\\uf1e6|\\uf1fa\\uf1ec|\\uf1fa\\uf1f2|\\uf1fa\\uf1f3|\\uf1fa\\uf1f8|\\uf1fa\\uf1fe|\\uf1fa\\uf1ff|\\uf1fb\\uf1e6|\\uf1fb\\uf1e8|\\uf1fb\\uf1ea|\\uf1fb\\uf1ec|\\uf1fb\\uf1ee|\\uf1fb\\uf1f3|\\uf1fb\\uf1fa|\\uf1fc\\uf1eb|\\uf1fc\\uf1f8|\\uf1fd\\uf1f0|\\uf1fe\\uf1ea|\\uf1fe\\uf1f9|\\uf1ff\\uf1e6|\\uf1ff\\uf1f2|\\uf1ff\\uf1fc|\\uf004|\\uf0cf|[\\uf170-\\uf171]|[\\uf17e-\\uf17f]|\\uf18e|[\\uf191-\\uf19a]|[\\uf201-\\uf202]|\\uf21a|\\uf22f|[\\uf232-\\uf23a]|[\\uf250-\\uf251]|[\\uf300-\\uf321]|[\\uf324-\\uf393]|[\\uf396-\\uf397]|[\\uf399-\\uf39b]|[\\uf39e-\\uf3f0]|[\\uf3f3-\\uf3f5]|[\\uf3f7-\\uf3fa]|[\\uf400-\\uf4fd]|[\\uf4ff-\\uf53d]|[\\uf549-\\uf54e]|[\\uf550-\\uf567]|[\\uf56f-\\uf570]|[\\uf573-\\uf57a]|\\uf587|[\\uf58a-\\uf58d]|\\uf590|[\\uf595-\\uf596]|[\\uf5a4-\\uf5a5]|\\uf5a8|[\\uf5b1-\\uf5b2]|\\uf5bc|[\\uf5c2-\\uf5c4]|[\\uf5d1-\\uf5d3]|[\\uf5dc-\\uf5de]|\\uf5e1|\\uf5e3|\\uf5e8|\\uf5ef|\\uf5f3|[\\uf5fa-\\uf64f]|[\\uf680-\\uf6c5]|[\\uf6cb-\\uf6d2]|[\\uf6e0-\\uf6e5]|\\uf6e9|[\\uf6eb-\\uf6ec]|\\uf6f0|[\\uf6f3-\\uf6f8]|[\\uf910-\\uf93a]|[\\uf93c-\\uf93e]|[\\uf940-\\uf945]|[\\uf947-\\uf94c]|[\\uf950-\\uf96b]|[\\uf980-\\uf997]|\\uf9c0|[\\uf9d0-\\uf9e6]/g;\n\n    var configs = {\n        url: \"//f2e.cn.ronghub.com/sdk/emoji-48.png\",\n        size: 24,\n        lang: \"zh\",\n        reg: unicodeRegExp\n    };\n\n    var supportLanguage = [ \"en\" ,\"zh\" ];\n\n    var Utils = {\n        symbolRegExp: /\\[([^\\[\\]]+?)\\]/g,\n        extend: function() {\n            if (arguments.length === 0) {\n                return;\n            }\n            var obj = arguments[0];\n            for (var i = 1, len = arguments.length; i < len; i ++) {\n                var other = arguments[i];\n                for (var item in other) {\n                    obj[item] = other[item];\n                }\n            }\n            return obj;\n        },\n        hasSame: function(moreList, list) {\n            var more = moreList.join(' ');\n            for (var i = 0; i < list.length; i++) {\n                var value = list[i];\n                if (Utils.indexOf(more, value) === -1) {\n                    return false;\n                }\n            }\n            return true;\n        },\n        getDom: function(html) {\n            var div = document.createElement(\"div\");\n            div.innerHTML = html;\n            return div.childNodes[0];\n        },\n        getSymbol: function(name) {\n            return \"[\" + name + \"]\";\n        },\n        cutString: function(string, start, length) {\n            var array = [];\n            for (var i = start; i < start + length; i++) {\n                array.push(string.charAt(i));\n            }\n            return array.join('');\n        },\n        indexOf: function(array, value) {\n            if (typeof array === \"string\") {\n                for (var i = 0; i <= array.length - value.length; i++) {\n                    var string = Utils.cutString(array, i, value.length);\n                    if (array.charAt(i) == value.charAt(0) && Utils.cutString(array, i, value.length) == value) {\n                        return i;\n                    }\n                }\n            } else if (Object.prototype.toString.call(array) === '[object Array]') {\n                for (var i = 0; i < array.length; i++) {\n                    var item = array[i];\n                    if (item == value) {\n                        return i;\n                    }\n                }\n            }\n            return -1;\n        },\n        keys: function(item) {\n            var arr = [];\n            for (var key in item) {\n                arr.push(key);\n            }\n            return arr;\n        },\n        map: function(arr, func) {\n            var tempArr = arr.concat([]);\n            for (var i = 0; i < tempArr.length; i++) {\n                var value = tempArr[i];\n                if (func && typeof func === \"function\") {\n                    tempArr[i] = func(value);\n                }\n            }\n            return tempArr;\n        },\n        filter: function(arr, func) {\n            var array = [];\n            for (var i = 0; i < arr.length; i++) {\n                var value = arr[i];\n                if (func(value)) {\n                    array.push[value];\n                }\n            }\n            return array;\n        }\n    };\n\n    var Logger = {\n        LogFactory: {\n            \"1\": {\n                code: 1,\n                msg: \"Emoji参数错误\"\n            },\n            \"2\": {\n                code: 2,\n                msg: \"Emoji语言设置错误\"\n            },\n            \"3\": {\n                code: 3,\n                msg: \"新增Emoji错误\"\n            },\n            \"4\": {\n                code: 4,\n                msg: \"设置size错误\"\n            },\n            \"5\": {\n                code: 5,\n                msg: \"设置reg错误\"\n            },\n            \"6\": {\n                code: 6,\n                msg: \"设置背景url错误\"\n            }\n        },\n        isShowError: true,\n        showErrorInfo: function(errorInfo) {\n            console.error(JSON.stringify(errorInfo));\n        },\n        logger: function(params) {\n            var code = params.code;\n            var logInfo = this.LogFactory[code] || params;\n            var errorInfo = JSON.stringify(logInfo);\n            errorInfo = JSON.parse(errorInfo);\n            errorInfo.funcName = \"RongIMEmoji.\" + params.funcName;\n            errorInfo.msg += \", \" + params.msg;\n            this.isShowError && this.showErrorInfo(errorInfo);\n        }\n    };\n\n    var CheckParam = {\n        getType: function(str) {\n            /* IE下不准确问题 */\n            if (str === undefined) {\n                return \"undefined\";\n            }\n            if (str === null) {\n                return \"null\";\n            }\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        },\n        check: function(typeList, funcName, params) {\n            params = params || [];\n            var maxCount = typeList.length;\n            if (params.length > maxCount) {\n                params.length = maxCount;\n            }\n            for (var i = 0; i < typeList.length; i++) {\n                var paramType = this.getType(params[i]);\n                var sucType = typeList[i];\n                if (!new RegExp(paramType).test(sucType)) {\n                    var msgTemp = \"第{{index}}个参数错误, 错误类型: {{errType}}[{{sucType}}] -> 位置: {{funcName}}\";\n                    var msg = msgTemp.replace(/{{index}}/g, i + 1).replace(/{{errType}}/g, paramType).replace(/{{sucType}}/g, sucType).replace(/{{funcName}}/g, funcName);\n                    Logger.logger({\n                        code: 1,\n                        funcName: funcName,\n                        msg: msg\n                    });\n                }\n            }\n        },\n        checkConfigParam: function(opt, funcName) {\n            this.checkLanguage(opt.lang || configs.lang, funcName);\n            this.checkOptType(opt.size || configs.size, \"number\", 4, funcName);\n            this.checkOptType(opt.reg || configs.reg, \"regexp|string\", 5, funcName);\n            this.checkOptType(opt.url || configs.url, \"string\", 6, funcName);\n        },\n        checkLanguage: function(lang, funcName) {\n            if (Utils.indexOf(supportLanguage, lang) !== -1) {\n                return true;\n            } else {\n                var msgTemp = \"不支持语言: {{lang}}, 支持的语言有: {{support}}\";\n                var msg = msgTemp.replace(/{{lang}}/g, lang).replace(/{{support}}/g, supportLanguage.join(', '));\n                Logger.logger({\n                    code: 2,\n                    msg: msg,\n                    funcName: funcName\n                });\n            }\n        },\n        checkOptType: function(value, type, code, funcName) {\n            var valueType = this.getType(value);\n            if (!new RegExp(valueType).test(type)) {\n                var msg = \"错误的类型: {{errType}}[sucType]\";\n                msg = msg.replace(/{{errType}}/g, valueType).replace(/{{sucType}}/g, type);\n                Logger.logger({\n                    code: code,\n                    msg: msg,\n                    funcName: funcName\n                });\n            }\n        },\n        checkDataSource: function(dataSource, funcName) {\n            var dataParams = [ \"en\", \"zh\", \"tag\", \"position\" ];\n            for (var key in dataSource) {\n                var detail = dataSource[key];\n                if (this.getType(detail) !== \"object\") {\n                    var msg = \"dataSource.{{unicode}}必须是object类型\"\n                    msg = msg.replace(/{{unicode}}/g, key);\n                    return Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                }\n                var allKeys = Utils.keys(detail);\n                if (!Utils.hasSame(allKeys, dataParams)) {\n                    var msgTemp = \"dataSource.{{unicode}}必须包含属性: en, zh, tag, position\";\n                    var msg = msgTemp.replace(/{{unicode}}/g, key);\n                    return Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                }\n            }\n        },\n        checkAddEmoji: function(newEmojis, funcName) {\n            for (var key in newEmojis) {\n                if (key === \"dataSource\") {\n                    var dataSource = newEmojis[key];\n                    if (this.getType(dataSource) !== \"object\") {\n                        var msg = \"dataSource必须是object类型\";\n                        Logger.logger({ code: 3, msg: msg, funcName: funcName });\n                    } else {\n                        this.checkDataSource(dataSource, funcName);\n                    }\n                }\n            }\n        }\n    };\n\n    /* 判断是否支持emoji的渲染 */\n    var isSupportEmoji = (function() {\n        var getTextFeature = function(text, color) {\n            try {\n                var canvas = document.createElement(\"canvas\");\n                canvas.width = 2;\n                canvas.height = 2;\n                var ctx = canvas.getContext(\"2d\");\n                ctx.textBaseline = \"top\";\n                ctx.font = \"100px sans-serif\";\n                ctx.fillStyle = color;\n                ctx.scale(0.02, 0.02);\n                ctx.fillText(text, 0, 0);\n                var imageData = ctx.getImageData(0, 0, 2, 2).data;\n                var imageDataArr = [];\n                for (var i = 0; i < imageData.length; i++) {\n                    imageDataArr[i] = imageData[i];\n                }\n                var totalColor = 0;\n                for (var i = 0; i < imageDataArr.length; i++) {\n                    totalColor += imageDataArr[i];\n                }\n                var hasColor = totalColor > 0;\n                return hasColor ? imageDataArr.toString() : false;\n            } catch (e) {\n                return false;\n            }\n        };\n        var testEmoji = \"😁\";\n        var mode = getTextFeature(testEmoji, \"#000\");\n        if (mode) {\n            var otherEmoji = \"😨\";\n            var colorFeatrue = getTextFeature(testEmoji, \"#FFF\");\n            var otherFeature = getTextFeature(otherEmoji, \"#000\");\n            //为相同emoji添加不同色, 判断两次上色是否相同, 如果相同, 说明emoji以图片渲染, 支持\n            var isSameColor = mode && mode === colorFeatrue;\n            //为不同emoji添加相同色, 判断两次上色是否不同, 如果不同, 说明emoji以字符渲染, 支持\n            var isDiffColor = mode && mode !== otherFeature;\n            return isSameColor || isDiffColor;\n        } else {\n            return false;\n        }\n    })();\n\n\n    var addBaseCss = function() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden; }\";\n        var style = document.createElement(\"style\");\n        style.setAttribute(\"type\", \"text/css\");\n        var head = document.getElementsByTagName('head')[0];\n        head.appendChild(style);\n        if (style.styleSheet) {\n            style.styleSheet.cssText = baseCss;\n        } else {\n            head = document.createTextNode(baseCss);\n            style.appendChild(head);\n        }\n    };\n\n    var createEmojiDom = function(item, sizePx) {\n        var position = computeBgPosition(item.position, sizePx);\n        if (document.all && !document.addEventListener) {\n            position = item.position;\n        }\n        var emojiObj = {\n            size: sizePx || configs.size,\n            position: computeBgPosition(item.position, sizePx),\n            background: item.background || configs.url,\n            name: item[configs.lang],\n            tag: item.tag\n        };\n        return getEmojiShadowDom(emojiObj);\n    };\n\n    var getEmojiShadowDom = function(object) {\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='{{style}}''></span>\"\n        spanTpl = spanTpl.replace(/{{style}}/g, style);\n        var ret = spanTpl.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n            return object[name];\n        });\n        return ret;\n    };\n\n    var computeBgPosition = function(position, sizePx) {\n        var size = sizePx || configs.size;\n        var scale = size / 25;\n        position = position.split(\" \");\n        var x = position[0], y = position[1];\n        x = x ? x.split(\"px\")[0] : 0;\n        y = y ? y.split(\"px\")[0] : 0;\n        return parseInt(x) * scale + \"px \" + parseInt(y) * scale + \"px\";\n    };\n\n    var setupEmojiDetails = function() {\n        var tags = [];\n        list.length = 0;\n        for (var key in emojiFactory) {\n            var detail = emojiFactory[key];\n            var lang = configs.lang;\n            var shadowDom = createEmojiDom(detail);\n            var symbol = Utils.getSymbol(detail[lang]);\n            var item = {\n                unicode: key,\n                symbol: symbol,\n                emoji: detail.tag,\n                shadowDom: Utils.getDom(shadowDom)\n            };\n            list.push(item);\n            tags.push(escape(detail.tag));\n        }\n        tags = tags.join(\"|\");\n        tags = tags.replace(/%/g, function() {\n            return \"\\\\\";\n        });\n        emojiRegExp = new RegExp(\"(\" + tags + \")\", \"g\");\n    };\n\n    var setupEmojiFactory = function(newEmojis) {\n        var newEmojiFactory = {};\n        if (newEmojis) {\n            var _emojiFactory = newEmojis.dataSource;\n            var _url = newEmojis.url || configs.url;\n            for (var key in _emojiFactory) {\n                _emojiFactory[key][\"background\"] = _url;\n                newEmojiFactory[key] = _emojiFactory[key];\n            }\n        }\n        emojiFactory = Utils.extend(emojiFactory, newEmojiFactory);\n    };\n\n    var calculateUTF = function (char) {\n        var unicodes = escape(char).split(\"%u\");\n        unicodes = Utils.filter(unicodes, function(code) {\n            return code !== \"\";\n        });\n        return Utils.map(unicodes, function(code) {\n            if (Utils.indexOf(code, \"f\") !== -1 || Utils.indexOf(code, \"F\") !== -1) {\n                return String.fromCodePoint(\"0x1\" + code);\n            } else {\n                return String.fromCodePoint(\"0x\" + code);\n            }\n        }).join(\"\");\n    };\n\n    var getEmojiBySymbol = function(symbol) {\n        for (var i = 0; i < list.length; i++) {\n            var lang = configs.lang;\n            var detail = list[i];\n            if(detail.symbol === symbol) {\n                return detail.emoji;\n            }\n        }\n        return symbol;\n    };\n\n    var getDomByEmoji = function(emoji, sizePx) {\n        for (var key in emojiFactory) {\n            var detail = emojiFactory[key];\n            if (detail.tag === emoji) {\n                return createEmojiDom(detail, sizePx);\n            }\n        }\n        return false;\n    };\n\n    /**\n     * 自定义设置\n     * @param  {[object]} opt 可包含 lang, reg, url, size\n     */\n    var setConfig = function(opt) {\n        CheckParam.checkConfigParam(opt || {}, \"setConfig\");\n        configs = Utils.extend(configs, opt);\n        setupEmojiDetails();\n    };\n\n    /**\n     * 新增自定义emoji\n     * @param {object} newEmojis 可包含dataSource和url, url表示背景图, dataSource包含自定义的unicode和所对应emoji特性\n     */\n    var addEmojis = function(newEmojis) {\n        CheckParam.checkAddEmoji(newEmojis || {}, \"addEmojis\");\n        setupEmojiFactory(newEmojis);\n        setupEmojiDetails();\n    };\n    \n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围。默认为init时设置的regExp，如果不设置，默认为/[\\uf000-\\uf700]/g\n     * @return {string}          转化后的字符串\n     */\n    var unicodeDecode = function(content, reg) {\n        reg = reg || configs.reg;\n        return content.replace(reg, function(emoji) {\n            return calculateUTF(emoji) || emoji;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} content 必填，需要转化的包含emoji的字符串\n     * @param  {regExp} reg     可选，匹配的正则表达式\n     * @return {string}         转化后的字符串\n     */\n    var emojiToSymbol = function(content, reg) {\n        CheckParam.check([\"string\", \"regexp|null|undefined\"], \"emojiToSymbol\", arguments);\n        content = unicodeDecode(content, reg);\n        return content.replace(emojiRegExp, function(emojiTag) {\n            var lang = configs.lang;\n            for (var emojiKey in emojiFactory) {\n                var emojiDetail = emojiFactory[emojiKey];\n                if (emojiDetail.tag == emojiTag) {\n                    var name = emojiDetail[lang];\n                    return Utils.getSymbol(name);\n                }\n            }\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} text 必填 包含symbol的字符串\n     * @return {string}\n     */\n    var symbolToEmoji = function(text) {\n        CheckParam.check([\"string\"], \"symbolToEmoji\", arguments);\n        text = unicodeDecode(text);\n        return text.replace(Utils.symbolRegExp, function(symbol) {\n            return getEmojiBySymbol(symbol);\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} content 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx     可选，html标签的大小\n     * @param  {string} reg     可选，正则表达式\n     * @return {string}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(content, sizePx, reg) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"emojiToHTML\", arguments);\n        content = unicodeDecode(content, reg);\n        return content.replace(emojiRegExp, function(emojiTag) {\n            var dom = getDomByEmoji(emojiTag, sizePx);\n            return dom || emojiTag;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} text 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(text, sizePx, reg) {\n        CheckParam.check([\"string\", \"number|null|undefined\", \"regexp|null|undefined\"], \"symbolToHTML\", arguments);\n        return text.replace(Utils.symbolRegExp, function(symbol) {\n            var emoji = getEmojiBySymbol(symbol);\n            var emojiDom = getDomByEmoji(emoji, sizePx);\n            return emojiDom || symbol;\n        });\n    };\n\n    var adaptOldVersion = function() {\n        var context = RongIMLib.RongIMEmoji;\n        context.init = function(newEmojis, opt) {\n            CheckParam.checkConfigParam(opt, \"init\");\n            CheckParam.checkAddEmoji(newEmojis, \"init\");\n            configs = Utils.extend(configs, opt);\n            setupEmojiFactory(newEmojis);\n            setupEmojiDetails();\n        };\n\n        context.emojis = Utils.map(context.list, function(item) {\n            return item.shadowDom;\n        });\n        context.names = (function() {\n            var names = [];\n            for (var key in emojiFactory) {\n                var value = emojiFactory[key];\n                var data = {};\n                for (var i = 0; i < supportLanguage.length; i++) {\n                    var lang = supportLanguage[i];\n                    data[lang] = value[lang];\n                }\n                names.push(data);\n            }\n            return names;\n        })();\n        context.data = Utils.map(context.list, function(item) {\n            var data;\n            for (var key in emojiFactory) {\n                var detail = emojiFactory[key];\n                if (detail.tag === item.emoji) {\n                    data = detail;\n                    detail.html = item.shadowDom;\n                }\n            }\n            return data;\n        });\n    };\n\n    (function init() {\n        addBaseCss();\n        setupEmojiDetails();\n    })();\n\n    return {\n        isSupportEmoji: isSupportEmoji,\n\n        setConfig: setConfig,\n        addEmojis: addEmojis,\n\n        list: list,\n        emojiToSymbol: emojiToSymbol,\n        symbolToEmoji: symbolToEmoji,\n        emojiToHTML: emojiToHTML,\n        symbolToHTML: symbolToHTML,\n\n        adaptOldVersion: adaptOldVersion\n    };\n\n});"
  },
  {
    "path": "im/libs/qiniu-upload.js",
    "content": "(function(RCS) {\n\t//qiniu\n\tfunction forEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction buildUrl(url, items) {\n\t\tvar query = '';\n\t\tforEach(items, function(name, value) {\n\t\t\tif (name != 'token') {\n\t\t\t\tquery += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n\t\t\t}\n\t\t});\n\n\t\tif (query) {\n\t\t\turl += (url.indexOf('?') > 0 ? '&' : '?') + query;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tfunction encode2UTF8(argString) {\n\t\tif (argString === null || typeof argString === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\tvar string = (argString + ''); // .replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t\tvar utftext = '',\n\t\t\tstart, end, stringl = 0;\n\t\tstart = end = 0;\n\t\tstringl = string.length;\n\t\tfor (var n = 0; n < stringl; n++) {\n\t\t\tvar c1 = string.charCodeAt(n);\n\t\t\tvar enc = null;\n\n\t\t\tif (c1 < 128) {\n\t\t\t\tend++;\n\t\t\t} else if (c1 > 127 && c1 < 2048) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 6) | 192, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else if (c1 & 0xF800 ^ 0xD800 > 0) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else { // surrogate pairs\n\t\t\t\tif (c1 & 0xFC00 ^ 0xD800 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched trail surrogate at ' + n);\n\t\t\t\t}\n\t\t\t\tvar c2 = string.charCodeAt(++n);\n\t\t\t\tif (c2 & 0xFC00 ^ 0xDC00 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched lead surrogate at ' + (n - 1));\n\t\t\t\t}\n\t\t\t\tc1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (enc !== null) {\n\t\t\t\tif (end > start) {\n\t\t\t\t\tutftext += string.slice(start, end);\n\t\t\t\t}\n\t\t\t\tutftext += enc;\n\t\t\t\tstart = end = n + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end > start) {\n\t\t\tutftext += string.slice(start, stringl);\n\t\t}\n\n\t\treturn utftext;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction encode2Base64(data) {\n\t\tvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\tvar o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n\t\t\tac = 0,\n\t\t\tenc = '',\n\t\t\ttmp_arr = [];\n\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t}\n\n\t\tdata = encode2UTF8(data + '');\n\n\t\tdo { // pack three octets into four hexets\n\t\t\to1 = data.charCodeAt(i++);\n\t\t\to2 = data.charCodeAt(i++);\n\t\t\to3 = data.charCodeAt(i++);\n\n\t\t\tbits = o1 << 16 | o2 << 8 | o3;\n\n\t\t\th1 = bits >> 18 & 0x3f;\n\t\t\th2 = bits >> 12 & 0x3f;\n\t\t\th3 = bits >> 6 & 0x3f;\n\t\t\th4 = bits & 0x3f;\n\n\t\t\t// use hexets to index into b64, and append result to encoded string\n\t\t\ttmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n\t\t} while (i < data.length);\n\n\t\tenc = tmp_arr.join('');\n\n\t\tswitch (data.length % 3) {\n\t\t\tcase 1:\n\t\t\t\tenc = enc.slice(0, -2) + '==';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tenc = enc.slice(0, -1) + '=';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn enc;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction URLSafeBase64Encode(v) {\n\t\tv = encode2Base64(v);\n\t\treturn v.replace(/\\//g, '_').replace(/\\+/g, '-');\n\t}\n\n\tfunction chunkLastStep(data, opts, callback) {\n\t\t// 七牛 URL 规定\n\t\tvar key = '/key/' + URLSafeBase64Encode(data.filename);\n\t\tvar fname = '/fname/' + URLSafeBase64Encode(data.filename);\n\t\tvar url = opts.domain + '/mkfile/' + data.size + key + fname;\n\t\tvar options = {\n\t\t\tdomain: url,\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/octet-stream'\n\t\t\t},\n\t\t\tmulti_parmas: opts.multi_parmas,\n\t\t\tsupport_options: true,\n\t\t\tstream: true\n\t\t};\n\t\tuploadData(data.ctx, options, {\n\t\t\tonCompleted: function(res) {\n\t\t\t\tres.filename = data.filename;\n\t\t\t\tres.name = data.name;\n\t\t\t\tcallback.onCompleted(res);\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tvar offset = 0,\n\t\tctxStore = {};\n\n\tfunction uploadNextChunk(blob, opts, callback) {\n\t\tvar chunk = Math.ceil(offset / opts.chunk_size),\n\t\t\tchunks = Math.ceil(blob.size / opts.chunk_size),\n\t\t\tcurChunkSize = Math.min(opts.chunk_size, blob.size - offset),\n\t\t\tchunkBlob = blob.slice(offset, offset + curChunkSize),\n\t\t\tchunkInfo = {\n\t\t\t\tchunk: chunk,\n\t\t\t\tchunks: chunks,\n\t\t\t\tname: blob.uniqueName\n\t\t\t};\n\t\tforEach(chunkInfo, function(key, value) {\n\t\t\topts.multi_parmas[key] = value;\n\t\t});\n\t\topts.filesize = blob.size;\n\t\topts.headers = {\n\t\t\t'Content-Type': 'application/octet-stream'\n\t\t};\n\t\topts.isChunk = true;\n\t\tuploadData(chunkBlob, opts, {\n\t\t\tonCompleted: function(chunkRes) {\n\t\t\t\toffset += curChunkSize;\n\t\t\t\t// callback.onProgress(Math.floor((chunk + 1) / chunks * blob.size), blob.size);\n\t\t\t\tctxStore[blob.uniqueName] = ctxStore[blob.uniqueName] || [];\n\t\t\t\tctxStore[blob.uniqueName].push(chunkRes.ctx);\n\t\t\t\tif (offset < blob.size) {\n\t\t\t\t\tif (chunkRes.ctx) {\n\t\t\t\t\t\tuploadNextChunk(blob, opts, callback);\n\t\t\t\t\t}else{\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tdelete ctxStore[blob.uniqueName]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toffset = 0;\n\t\t\t\t\tdelete opts.isChunk;\n\t\t\t\t\tdelete opts.headers['Content-Type'];\n\t\t\t\t\tforEach(chunkInfo, function(key, value) {\n\t\t\t\t\t\tdelete opts.multi_parmas[key];\n\t\t\t\t\t});\n\t\t\t\t\tvar ctx = ctxStore[blob.uniqueName].join(',');\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\tctx: ctx,\n\t\t\t\t\t\tname: blob.name,\n\t\t\t\t\t\tsize: blob.size,\n\t\t\t\t\t\tfilename: blob.uniqueName\n\t\t\t\t\t};\n\t\t\t\t\tchunkLastStep(data, opts, callback);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {\n\t\t\t\tvar loaded = chunkLoaded + offset;\n\t\t\t\tcallback.onProgress(loaded, opts.filesize);\n\t\t\t},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction uploadData(data, options, callback) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\tif (xhr.upload && options.support_options) {\n\t\t\txhr.upload.onprogress = function(event) {\n\t\t\t\tcallback.onProgress(event.loaded, event.total);\n\t\t\t};\n\t\t}\n\n\t\txhr.onreadystatechange = function() {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tvar result = xhr.responseText || \"{}\";\n\t\t\t\tresult = JSON.parse(result);\n\t\t\t\tresult.filename = options.unique_value;\n\t\t\t\tcallback.onCompleted(result);\n\t\t\t}\n\t\t};\n\n\t\tvar url = options.domain;\n\t\tif (options.isChunk) {\n\t\t\turl += '/mkblk/' + data.size;\n\t\t\turl = buildUrl(url, options.multi_parmas);\n\t\t}\n\t\txhr.open(options.method, url, true);\n\n\t\tcallback.onOpen(xhr);\n\n\t\tif (options.stream) {\n\t\t\txhr.setRequestHeader('authorization', 'UpToken ' + options.multi_parmas.token);\n\t\t}\n\n\t\tforEach(options.headers, function(key, value) {\n\t\t\txhr.setRequestHeader(key, value);\n\t\t});\n\t\txhr.send(data);\n\t}\n\n\tfunction uploadQiniu(file, opts, callback) {\n\t\tif (file.size && opts.chunk_size < file.size) {\n\t\t\tvar uniqueName = opts['genUId'](file);\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tuniqueName = uniqueName + suffix;\n\t\t\tfile.uniqueName = uniqueName;\n\t\t\topts.stream = true;\n\t\t\tuploadNextChunk(file, opts, callback);\n\t\t} else {\n\t\t\tvar data = opts['data'](file, opts);\n\t\t\tuploadData(data, opts, callback);\n\t\t}\n\t}\n\tvar uploadProcess = uploadQiniu;\n\n\n\n\t//upload\n\tvar dataType = {\n\t\tform: getFormData,\n\t\tjson: getJsonData,\n\t\tdata: getData\n\t};\n\tvar fileConfig = { \n\t\tdomain: 'http://upload.qiniu.com',\n\t\tfileType: RongIMLib.FileType.IMAGE,\n\t\tgetToken: function(callback){\n\t\t\t/****************************\n\t\t\t * 使用融云文件存储注意事项：\n\t\t\t * 1、有效期为 1 个月。\n\t\t\t * 2、文件不可迁移。\n\t\t\t ****************************\n\t\t\t */\n\t\t\tRongIMClient.getInstance().getFileToken(this.fileType, {\n\t\t\t\tonSuccess: function(data){\n\t\t\t\t\tcallback(data.token);\n\t\t\t\t},\n\t\t\t\tonError: function(error){\n\t\t\t\t\tconsole.log('获取上传token失败');\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\tfunction genUId() {\n\t\tvar date = new Date().getTime();\n\t\tvar uuid = 'xxxxxx4xxxyxxxxxxx'.replace(/[xy]/g, function(c) {\n\t\t\tvar r = (date + Math.random() * 16) % 16 | 0;\n\t\t\tdate = Math.floor(date / 16);\n\t\t\treturn (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n\t\t});\n\t\treturn uuid;\n\t};\n\n\tfunction mergeOption(opts) {\n\t\tvar options = {\n\t\t\tdomain: '',\n\t\t\tmethod: 'POST',\n\t\t\tfile_data_name: 'file',\n\t\t\tunique_key: 'key',\n\t\t\tbase64_size: 4 * 1024 * 1024,\n\t\t\tchunk_size: 4 * 1024 * 1024,\n\t\t\theaders: {},\n\t\t\tmulti_parmas: {},\n\t\t\tquery: {},\n\t\t\tsupport_options: true,\n\t\t\tdata: dataType.form,\n\t\t\tgenUId: genUId\n\t\t};\n\t\tif (!opts || !opts.domain) {\n\t\t\tthrow new Error('domain is null');\n\t\t}\n\t\tfor (var key in opts) {\n\t\t\toptions[key] = opts[key];\n\t\t}\n\t\treturn options;\n\t}\n\n\tfunction mEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction getFormData(file, opts) {\n\t\tvar form = new FormData();\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tform.append(opts.unique_key, unique_value);\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tform.append(opts.file_data_name, file);\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tform.append(key, value);\n\t\t});\n\t\treturn form;\n\t}\n\n\tfunction getJsonData(file, opts) {\n\t\tvar data = {};\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tdata[opts.unique_key] = unique_value;\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tdata[opts.file_data_name] = file;\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tdata[key] = value;\n\t\t});\n\t\treturn JSON.stringify(data);\n\t}\n\n\tfunction getData(file, opts) {\n\t\treturn file;\n\t}\n\n\tfunction Upload(options) {\n\t\tthis.options = mergeOption(options);\n\n\t\tthis.setOptions = function(opts) {\n\t\t\tvar me = this;\n\t\t\tmEach(opts, function(key, value) {\n\t\t\t\tme.options[key] = value;\n\t\t\t});\n\t\t};\n\n\t\tthis.upload = function(file, callback) {\n\t\t\tif (!file) {\n\t\t\t\tcallback.onError('upload file is null.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar me = this;\n\t\t\tuploadProcess(file, this.options, {\n\t\t\t\tonProgress: function(loaded, total) {\n\t\t\t\t\tcallback.onProgress(loaded, total);\n\t\t\t\t},\n\t\t\t\tonCompleted: function(data) {\n\t\t\t\t\tcallback.onCompleted(data);\n\t\t\t\t},\n\t\t\t\tonError: function(errorCode) {\n\t\t\t\t\tcallback.onError(errorCode);\n\t\t\t\t},\n\t\t\t\tonOpen: function(xhr) {\n\t\t\t\t\tme.xhr = xhr;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tthis.cancel = function() {\n\t\t\tthis.xhr && this.xhr.abort();\n\t\t};\n\t}\n\n\tfunction init(options) {\n\t\treturn new Upload(options);\n\t}\n\n\tfunction getResizeRatio(imageInfo,config){\n\t\t//hasOwnProperty?\n\n\t\tvar ratio = 1;\n\n\t\tvar oWidth = imageInfo.width;\n\t\tvar maxWidth = config.maxWidth || 0;\n\t\tif(maxWidth > 0 &&  oWidth > maxWidth){\n\t\t\tratio = maxWidth/oWidth;\n\t\t}\n\n\t\tvar oHeight = imageInfo.height;\n\t\tvar maxHeight = config.maxHeight || 0;\n\t\tif(maxHeight > 0 && oHeight > maxHeight){\n\t\t\tvar ratioHeight = maxHeight/oHeight;\n\t\t\tratio = Math.min(ratio,ratioHeight);\n\t\t}\n\n\n\t\tvar maxSize = config.maxSize || 0;\n\t\tvar oSize = Math.ceil(imageInfo.size/1000); //K，Math.ceil(0.3) = 1;\n\t\tif(oSize > maxSize){\n\t\t\tratioSize = maxSize/oSize;\n\t\t\tratio = Math.min(ratio,ratioSize);\n\t\t}\n\n\t\treturn ratio;\n\t}\n\n\tfunction resize(file,config,callback){\n\t\t//file对象没有高宽\n\t\tvar type = file.type; //image format\n\t\tvar canvas = document.createElement(\"canvas\");\n\n\t\tvar reader = new FileReader();\n\n    \treader.readAsDataURL(file);\n\t\treader.onload = function(evt){\n\t\t\tvar imageData = evt.target.result;\n\t\t\tvar img = new Image();\n\t\t\timg.src  = imageData;\n\t\t\tvar width = img.width;\n\t\t\tvar height = img.height;\n\t\t\tvar imageInfo = {\n\t\t\t\twidth : width,\n\t\t\t\theight : height,\n\t\t\t\tsize : evt.total\n\t\t\t}\n\t\t\tvar ratio = getResizeRatio(imageInfo,config);\n\t\t\tvar newImageData = imageData;\n\t\t\tif(ratio < 1){\n\t\t\t\tnewImageData = compress(img, width*ratio, height*ratio);;\n\t\t\t}\n\t\t\tcallback(newImageData);\n\t\t}\n\n\t\tfunction compress(img, width, height){\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\tvar context = canvas.getContext('2d');\n\t\t\t\tcontext.drawImage(img, 0, 0, width, height);\n\n\t\t\t/*\n\t\t\tIf the height or width of the canvas is 0, the string \"data:,\" is returned.\n\t\t\tIf the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.\n\t\t\tChrome also supports the image/webp type.\n\t\t\t*/ \n\n\t\t\tvar supportTypes = {\n\t\t\t\t\"image/jpg\" : true,\n\t\t\t\t\"image/png\" : true,\n\t\t\t\t\"image/webp\" : supportWebP()\n\t\t\t};\n\t\t\t// var exportType = \"image/png\";\n\t\t\t// if(supportTypes[type]){\n\t\t\t// \texportType = type;\n\t\t\t// } \n\t\t\t// 多端一致，缩略图必须是 jpg \n\t\t\tvar exportType = \"image/jpg\";\n\t\t\tvar newImageData = canvas.toDataURL(exportType);\n\t\t\treturn newImageData;\n\t\t}\n\n\t\tfunction supportWebP(){\n\t\t\ttry{\n        \t\treturn (canvas.toDataURL('image/webp').indexOf('data:image/webp') == 0);\n    \t\t}catch(err) {\n\t\t        return  false;\n\t\t    }\n\t\t}\n\t}\n\n\tvar calcPosition = function(width, height, opts) {\n        var isheight = width < height;\n        var scale = isheight ? height / width : width / height;\n        var zoom, x = 0,\n            y = 0,\n            w, h;\n\n        var gtScale = function() {\n            if (isheight) {\n                zoom = width / 100;\n                w = 100;\n                h = height / zoom;\n                y = (h - opts.maxHeight) / 2;\n            } else {\n                zoom = height / 100;\n                h = 100;\n                w = width / zoom;\n                x = (w - opts.maxWidth) / 2;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        \n        var ltScale = function() {\n            if (isheight) {\n                zoom = height / opts.maxHeight;\n                h = opts.maxHeight;\n                w = width / zoom;\n            } else {\n                zoom = width / opts.maxWidth;\n                w = opts.maxWidth;\n                h = height / zoom;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        return scale > opts.scale ? gtScale() : ltScale();\n    };\n\n    var getBlobUrl = function(file) {\n        var URL = window.URL || window.webkitURL;\n        return URL ? URL.createObjectURL(file) : \"\";\n    };\n\n    var getThumbnail = function(file, opts, callback) {\n        var canvas = document.createElement(\"canvas\"),\n            context = canvas.getContext('2d');\n        var img = new Image();\n        img.onload = function() {\n            var pos = calcPosition(img.width, img.height, opts);\n            canvas.width = pos.w > opts.maxWidth ? opts.maxWidth : pos.w;\n            canvas.height = pos.h > opts.maxHeight ? opts.maxHeight : pos.h;\n            context.drawImage(img, pos.x, pos.y, pos.w, pos.h);\n            try {\n                var base64 = canvas.toDataURL(file.type, opts.quality);\n                var reg = new RegExp('^data:image/[^;]+;base64,');\n                base64 = base64.replace(reg, '');\n                callback(base64);\n            } catch (e) {\n                throw new Error(e);\n            }\n        };\n        img.src = typeof file == 'string' ? 'data:image/jpg;base64,' + file : getBlobUrl(file);\n    };\n\n    var _compress = function(data, callback) {\n        var file = data.file;\n        var opts = data.compress;\n        getThumbnail(file, opts, callback);\n    };\n\n    _init = function(config, callback) {\n        if (config.getToken) {\n            config.getToken(function(token) {\n                config.multi_parmas || (config.multi_parmas = {});\n                config.multi_parmas.token = token;\n                config.headers || (config.headers = {});\n                if (config.base64) {\n                    config.headers['Content-type'] = 'application/octet-stream';\n                    config.headers['Authorization'] = 'UpToken ' + token;\n                }\n                var instance = init(config);\n                callback(instance);\n            });\n        } else {\n            config.headers || (config.headers = {});\n            if (config.base64) {\n                config.headers['Content-type'] = 'application/octet-stream';\n            }\n            var instance = init(config);\n            callback(instance);\n        }\n    };\n\n    var _upload = function(data, instance, callback) {\n        instance.upload(data.file, {\n            onError: function(errorCode) {\n                callback.onError(errorCode);\n            },\n            onProgress: function(loaded, total) {\n                callback.onProgress(loaded, total);\n            },\n            onCompleted: function(result) {\n                result.filename || (result.filename = result.hash);\n                var compress = data.compressThumbnail || _compress;\n                if (data.compress) {\n                    compress(data, function(thumbnail) {\n                        result.thumbnail = thumbnail;\n                        callback.onCompleted(result);\n                    });\n                } else {\n                    callback.onCompleted(result);\n                }\n            }\n        });\n    };\n\n    var File = function(instance) {\n        var me = this;\n        this.instance = instance\n        this.upload = function(file, callback) {\n            var data = {\n                file: file\n            };\n            _upload(data, me.instance, callback);\n        };\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initFile = function(config, callback) {\n        _init(config, function(instance) {\n            var UploadFile = new File(instance);\n            callback(UploadFile);\n        });\n    };\n\n    var Img = function(instance, cfg) {\n        var me = this;\n        this.cfg = cfg;\n        this.instance = instance;\n        this.upload = function(file, callback) {\n            var data = {\n                file: file,\n                compress: me.cfg\n            };\n            _upload(data, me.instance, callback);\n        };\n\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initImage = function(config, callback) {\n        _init(config, function(instance) {\n            var compress = {\n                maxHeight: config.height || 240,\n                maxWidth: config.width || 240,\n                quality: config.quality || 0.5,\n                scale: config.scale || 2.4\n            };\n            var uploadImage = new Img(instance, compress);\n            callback(uploadImage);\n        });\n    };\n\n    var ImgBase64 = function(config) {\n        config.base64 = true;\n        Img.call(this, config);\n    };\n\n    var initImgBase64 = function(config, callback) {\n        config.base64 = true;\n        initImage.call(this, config, callback);\n    };\n    var initType = {\n        file: function(file,config,callback){\n            initFile(config, function(uploadFile){\n                uploadFile.upload(file, callback);\n            });\n        },\n        image: function(file,config,callback){\n            initImage(config, function(uploadFile){\n                uploadFile.upload(file, callback);\n            });\n        }\n    };\n\n    var imageStartUpload = function(_file,onSuccess){\n    \tvar callback = {\n\t\t\tonError\t: function (errorCode) { \n\t\t\t\tconsole.log(errorCode);\n\t\t\t},\n\t\t\tonProgress : function (loaded, total) {\n\t\t\t\t// var percent = Math.floor(loaded/total*100);\n\t\t\t\t// var progressBar \t= document.getElementById('progressBar'),\n\t\t\t\t// \tprogressContent = document.getElementById('progressContent');\n\t\t\t\t// \tprogressBar.style.width = percent + '%';\n\t   //      \t\tprogressContent.innerHTML = percent + \"%\";\n\t\t\t},\n\t\t\tonCompleted : function (data) {\n\t\t\t\tdata.fileType = 'image';\n\t\t\t\tonSuccess(data);\n\t\t\t} \n\t\t};\n    \tinitType['image'](_file,fileConfig,callback);\n    }\n    var fileStartUpload = function(_file,onSuccess){\n    \tfileConfig.fileType = RongIMLib.FileType.FILE;\n    \tvar callback = {\n\t\t\tonError\t: function (errorCode) { \n\t\t\t\tconsole.log(errorCode);\n\t\t\t},\n\t\t\tonProgress : function (loaded, total) {\n\t\t\t\t// var percent = Math.floor(loaded/total*100);\n\t\t\t\t// var progressBar \t= document.getElementById('progressBar'),\n\t\t\t\t// \tprogressContent = document.getElementById('progressContent');\n\t\t\t\t// \tprogressBar.style.width = percent + '%';\n\t   //      \t\tprogressContent.innerHTML = percent + \"%\";\n\t\t\t},\n\t\t\tonCompleted : function (data) {\n\t\t\t\tdata.fileType = 'file';\n\t\t\t\tonSuccess(data);\n\t\t\t} \n\t\t};\n    \tinitType['file'](_file,fileConfig,callback);\n    }\n\n    \n    RCS.imageStartUpload = imageStartUpload;\n    RCS.fileStartUpload = fileStartUpload;\n    RCS.fileConfig = fileConfig;\n})(RCS);"
  },
  {
    "path": "im/libs/utils.js",
    "content": ";var RCS = {\n    templateCache:{}\n};\n\n(function(RCS){\n    /*\n    var tpl = '<a>{{this.key1}} <p>-</p> {{this.value1.c}}</a>';\n    var data = {\"key1\":1,\"value1\":{\"c\":\"cccccc\"}};\n    var html = render(tpl,data);\n    详见 http://blog.jobbole.com/56689/\n    */\n    function render(template, data) {\n        template = template || \"\";\n        data = data || [\"\"];\n        var re = /{%((?:(?!%}).)+)%}/g, reExp = /(^( )?(var|if|for|else|switch|case|default|break|{|}))(.*)?/g, code = 'var r=[];\\n', cursor = 0;\n        var add = function(line, js) {\n            js? (code += line.match(reExp) ? line + '\\n' : 'r.push(' + line + ');\\n') :\n                (code += line != '' ? 'r.push(\"' + line.replace(/\"/g, '\\\\\"') + '\");\\n' : '');\n            return add;\n        }\n        var match;\n        while(match = re.exec(template)) {\n            add(template.slice(cursor, match.index))(match[1], true);\n            cursor = match.index + match[0].length;\n        }\n        add(template.substr(cursor, template.length - cursor));\n        code += 'return r.join(\"\");';\n        data = isNaN(data.length) ? [data] : data;\n        var html = \"\";\n        for(var i = 0, length = data.length; i < length; i++) {\n            html += new Function(code.replace(/[\\r\\t\\n]/g, '')).apply(data[i]);\n        }\n        return html;    \n    }\n\n\n    var utils = {\n        $ : function(selector){\n            return document.querySelectorAll(selector);\n        },\n        show : function(node){\n            node.style.display = \"block\";\n        },\n        hide : function(node){\n            node.style.display = \"none\";\n        },\n        removeNode : function(selector){\n            var thisNode = utils.$(selector)[0];\n            if (thisNode) {\n                thisNode.parentNode.removeChild(thisNode);\n            }\n        },\n        getStyle : function (node, prop) {\n            if(node.currentStyle) {\n                return node.currentStyle[prop] || '';\n            }\n            else if(window.getComputedStyle) {\n                return window.getComputedStyle(node , null)[prop];\n            }\n        },\n        indexOf : function (array, item) {\n            if (array.indexOf){\n                return array.indexOf(item);\n            }   \n            for (var i = 0, len = array.length; i < len; i++){\n                if (array[i] === item){\n                    return i;\n                }\n            }   \n            return -1;\n        },\n        copy : function(json1, json2, flag, fn){\n            fn = fn || function(e){return e;}\n            for (var key in json2){\n                if (flag || typeof json1[key] === 'undefined' || json1[key] === null){\n                    json1[key] = fn(json2[key]);\n                }\n            }\n            return json1;\n        },\n        isChild : function(node,nodeParent){\n            while (node && node.tagName && node.tagName.toLowerCase() != \"body\"){\n                if (node == nodeParent){\n                    return true;\n                }\n                node = node.parentNode;\n            }\n            return false;\n        },\n        getTime : function(time){\n            var nowDate = new Date();\n            var sendDate = new Date(time);\n            var dateStr = '';\n            if (nowDate.getFullYear() == sendDate.getFullYear() && nowDate.getMonth() == sendDate.getMonth() && nowDate.getDate() == sendDate.getDate()) {\n                dateStr = (sendDate.getHours()>9 ? sendDate.getHours():'0'+sendDate.getHours())+':'+(sendDate.getMinutes()>9 ? sendDate.getMinutes():'0'+sendDate.getMinutes());\n            } else {\n                dateStr = sendDate.getFullYear()+'-'+(sendDate.getMonth()>8 ? (sendDate.getMonth()+1):'0'+(sendDate.getMonth()+1))+'-'+(sendDate.getDate()>9 ? sendDate.getDate():'0'+sendDate.getDate())+' '+(sendDate.getHours()>9 ? sendDate.getHours():'0'+sendDate.getHours())+':'+(sendDate.getMinutes()>9 ? sendDate.getMinutes():'0'+sendDate.getMinutes());\n            }\n            return dateStr;\n        },\n        getFileSize : function(size){\n            var g = Math.pow(1024, 3);\n            var m = Math.pow(1024, 2);\n            var k = Math.pow(1024, 1);\n            if (size > g) {\n                size = (size / g).toFixed(2) + 'G';\n            } else if (size > m) {\n                size = (size / m).toFixed(2) + 'M';\n            } else if (size > k) {\n                size = (size / k).toFixed(2) + 'K';\n            } else {\n                size = size + 'B';\n            }\n            return size;\n        },\n        getFormValue : function(formArray){\n            var formData = {};\n            for (var i = 0; i < formArray.length; i++) {\n                formData[formArray[i]] = document.getElementsByName(formArray[i])[0].value;\n            }\n            return formData;\n        },\n        fadein : function(ele) {\n            ele.style.opacity = 0;\n            ele.style.display = \"block\";\n            if (ele) {\n                var v = 0;\n                var timer = null;\n                timer = setInterval(function() {\n                    v += 1;\n                    setOpacity(ele, v);\n                    if (v == 100) {\n                        clearInterval(timer);\n                    }\n                }, 1);\n            }\n        },\n        fadeout: function(ele) {\n            if (ele) {\n                var v = 100;\n                var timer = null;\n                timer = setInterval(function() {\n                    v -= 1;\n                    setOpacity(ele, v);\n                    if (v == 0) {\n                        ele.style.display = \"none\";\n                        clearInterval(timer);\n                    }\n                }, 1);\n            }\n        },\n        downloadHistoryMsgFile: function(url,name){\n            var a = document.createElement('a');\n            a.href = url;\n            a.setAttribute('download', name || '');\n            a.click();\n        },\n        encodeHtmlStr: function(str) {\n            var replaceRule = [\n                {\n                    symbol: '&',\n                    html: '&amp;'\n                },\n                //下述方法有问题,字符串中如有空格,会多加空格\n                //white-space: pre-wrap; 能实现同样效果,并支持ie9, 故注释掉\n                // {\n                //     symbol: '[\\\\u0020]',\n                //     html: '&nbsp;\\u0020'\n                // },\n                {\n                    symbol: '[\\\\u0009]',\n                    html: '&nbsp;&nbsp;&nbsp;&nbsp;\\u0020'\n                },\n                {\n                    symbol: '<',\n                    html: '&lt;'\n                },\n                {\n                    symbol: '>',\n                    html: '&gt;'\n                },\n                {\n                    symbol: '\"',\n                    html: '&quot;'\n                },\n                {\n                    symbol: '\\'',\n                    html: '&#39;'\n                },\n                {\n                    symbol: '\\\\n\\\\r',\n                    html: '<br/>'\n                },\n                {\n                    symbol: '\\\\r\\\\n',\n                    html: '<br/>'\n                },\n                {\n                    symbol: '\\\\n',\n                    html: '<br/>'\n                }\n            ];\n\n            for (var i = 0, len = replaceRule.length; i < len; i++) {\n                var rule = replaceRule[i];\n                var regExp = new RegExp(rule.symbol, 'g');\n                str = str.replace(regExp, rule.html);\n            }\n\n            return str;\n        },\n        replaceUri: function(str, callback) {\n            var result = '';\n            var protocol = '((?:http|https|ftp)\\\\:\\\\/\\\\/)?';\n            var ip = '(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])\\\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])';\n            var host = '(?!@)(?:[a-z0-9-]{1,36}\\\\.)+[a-z]{2,6}';\n            var port = '(?:\\\\:[0-9]{1,5})?';\n            var path = '(?:[a-zA-Z0-9.,;?\\\\\\'+&%$#=~_\\\\-!()*\\\\/]*)';\n            var uriReg = new RegExp(protocol + '(?:(?:' + ip + ')|(?:' + host +'))' + port + path, 'ig');\n\n            result = str.replace(uriReg, function(uriStr, prot) {\n                var lastIndex = arguments[arguments.length - 2];\n                var prevChar = str.substr(lastIndex - 1, 1);\n                var isEmail = prevChar === '@';\n                var notDomain = !chkDomain(uriStr, prot);\n                if (isEmail || notDomain) {\n                    return uriStr;\n                }\n                return callback.apply(null, arguments);\n            });\n            return result;\n        },\n        replaceEmail: function(str, callback) {\n            var result = '';\n            var emailReg = /\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*/gi;\n\n            result = str.replace(emailReg, callback);\n\n            return result;\n        },\n        cloneObj: function(obj){\n            var str, newobj = obj.constructor === Array ? [] : {};\n            if(typeof obj !== 'object'){\n                return;\n            } else if(window.JSON){\n                str = JSON.stringify(obj), //系列化对象\n                newobj = JSON.parse(str); //还原\n            } else {\n                for(var i in obj){\n                    newobj[i] = typeof obj[i] === 'object' ? \n                    cloneObj(obj[i]) : obj[i]; \n                }\n            }\n            return newobj;\n        },\n        //判断当前是否是移动端\n        browserRedirect: function(callback) {\n            var sUserAgent = navigator.userAgent.toLowerCase();\n            var bIsIpad = sUserAgent.match(/ipad/i) == \"ipad\";\n            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == \"iphone os\";\n            var bIsMidp = sUserAgent.match(/midp/i) == \"midp\";\n            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == \"rv:1.2.3.4\";\n            var bIsUc = sUserAgent.match(/ucweb/i) == \"ucweb\";\n            var bIsAndroid = sUserAgent.match(/android/i) == \"android\";\n            var bIsCE = sUserAgent.match(/windows ce/i) == \"windows ce\";\n            var bIsWM = sUserAgent.match(/windows mobile/i) == \"windows mobile\";\n            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {\n                callback(\"phone\");\n            } else {\n                callback(\"pc\");\n            }\n        }\n    };\n    var setOpacity = function(ele, opacity) {\n        if (ele.style.opacity != undefined) {\n            ///兼容FF和GG和新版本IE\n            ele.style.opacity = opacity / 100;\n        } else {\n            ///兼容老版本ie\n            ele.style.filter = \"alpha(opacity=\" + opacity + \")\";\n        }\n    }\n\n    var domainArray = [\n    '.com', '.net', '.org', '.biz', '.coop', '.info', '.museum', '.name',\n    '.pro', '.edu', '.gov', '.int', '.mil', '.ac', '.ad', '.ae', '.af', '.ag',\n    '.ai', '.al', '.am', '.an', '.ao', '.aq', '.ar', '.as', '.at', '.au', '.aw',\n    '.az', '.ba', '.bb', '.bd', '.be', '.bf', '.bg', '.bh', '.bi', '.bj', '.bm',\n    '.bn', '.bo', '.br', '.bs', '.bt', '.bv', '.bw', '.by', '.bz', '.ca', '.cc',\n    '.cd', '.cf', '.cg', '.ch', '.ci', '.ck', '.cl', '.cm', '.cn', '.co', '.cr',\n    '.cu', '.cv', '.cx', '.cy', '.cz', '.de', '.dj', '.dk', '.dm', '.do', '.dz',\n    '.ec', '.ee', '.eg', '.eh', '.er', '.es', '.et', '.fi', '.fj', '.fk', '.fm',\n    '.fo', '.fr', '.ga', '.gd', '.ge', '.gf', '.gg', '.gh', '.gi', '.gl', '.gm',\n    '.gn', '.gp', '.gq', '.gr', '.gs', '.gt', '.gu', '.gv', '.gy', '.hk', '.hm',\n    '.hn', '.hr', '.ht', '.hu', '.id', '.ie', '.il', '.im', '.in', '.io', '.iq',\n    '.ir', '.is', '.it', '.je', '.jm', '.jo', '.jp', '.ke', '.kg', '.kh', '.ki',\n    '.km', '.kn', '.kp', '.kr', '.kw', '.ky', '.kz', '.la', '.lb', '.lc', '.li',\n    '.lk', '.lr', '.ls', '.lt', '.lu', '.lv', '.ly', '.ma', '.mc', '.md', '.me',\n    '.mh', '.mk', '.ml', '.mm', '.mn', '.mo', '.mp', '.mq', '.mr', '.ms', '.mt',\n    '.mu', '.mv', '.mw', '.mx', '.my', '.mz', '.na', '.nc', '.ne', '.nf', '.ng',\n    '.ni', '.nl', '.no', '.np', '.nr', '.nu', '.nz', '.om', '.pa', '.pe', '.pf',\n    '.pg', '.ph', '.pk', '.pl', '.pm', '.pn', '.pr', '.ps', '.pt', '.pw', '.py',\n    '.qa', '.re', '.ro', '.rw', '.ru', '.sa', '.sb', '.sc', '.sd', '.se', '.sg',\n    '.sh', '.si', '.sj', '.sk', '.sl', '.sm', '.sn', '.so', '.sr', '.st', '.sv',\n    '.sy', '.sz', '.tc', '.td', '.tf', '.tg', '.th', '.tj', '.tk', '.tm', '.tn',\n    '.to', '.tp', '.tr', '.tt', '.tv', '.tw', '.tz', '.ua', '.ug', '.uk', '.um',\n    '.us', '.uy', '.uz', '.va', '.vc', '.ve', '.vg', '.vi', '.vn', '.vu', '.ws',\n    '.wf', '.ye', '.yt', '.yu', '.za', '.zm', '.zw', '.mg'];\n    \n    var getLocation = function(href) {\n        var location = document.createElement('a');\n        location.href = href;\n        return location;\n    };\n\n    function ValidateIPaddress(ipaddress) {\n        if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) {\n            return true;\n        }\n        return false;\n    }\n\n    var chkDomain = function(str, protocol) {\n        var link = str;\n        if(!protocol){\n            link = 'http://' + link;\n        }\n        var location = getLocation(link);\n        if(ValidateIPaddress(location.hostname)){\n            return true;\n        }\n        var domain = location.hostname.replace(/^.+\\./, '');\n        if(domainArray.indexOf('.' + domain) < 0){\n            return false;\n        }\n        return true;\n    };\n\n    \n\n    utils.render = render;\n\n    RCS.utils = utils;   \n})(RCS);"
  },
  {
    "path": "im/package.json",
    "content": "{\n  \"name\": \"customer-service\",\n  \"version\": \"1.0.0\",\n  \"description\": \"customerService\",\n  \"scripts\": {\n    \"dist\": \"grunt dist\"\n  },\n  \"devDependencies\": {\n    \"glog\": \"^1.7.0\",\n    \"grunt\": \"^1.0.1\",\n    \"grunt-contrib-clean\": \"^1.1.0\",\n    \"grunt-contrib-concat\": \"^1.0.1\",\n    \"grunt-contrib-cssmin\": \"^2.2.0\",\n    \"grunt-contrib-uglify\": \"^3.0.1\"\n  }\n}\n"
  },
  {
    "path": "im/template.js",
    "content": ";(function(RCS){\n\tvar getTemplates = function(callback){\n\t\tvar list = {\n\t        button: 'templates/button.html',\n\t        chat: 'templates/chat.html',\n\t        closebefore: 'templates/closebefore.html',\n\t        conversation: 'templates/conversation.html',\n\t        endconversation: 'templates/endconversation.html',\n\t        evaluate: 'templates/evaluate.html',\n\t        imageView: 'templates/imageView.html',\n\t        leaveword: 'templates/leaveword.html',\n\t        main: 'templates/main.html',\n\t        imMain: 'templates/imMain.html',\n\t        message: 'templates/message.html',\n\t        imMessage: 'templates/imMessage.html',\n\t        messageTemplate: 'templates/messageTemplate.html',\n\t        imMessageTemplate: 'templates/imMessageTemplate.html',\n\t        userInfo: 'templates/userInfo.html',\n\t    };\n\t    var templates = {};\n\t    for (var key in list) {\n\t    \tvar url = list[key];\n\t    \tvar html = RCS.templateCache[url];\n\t    \tif (html) {\n\t    \t\ttemplates[key] = html;\n\t    \t} else {\n\t\t    \tvar xhr = new XMLHttpRequest();\n\t\t    \txhr.open('get', url, false);\n\t\t    \txhr.onreadystatechange = function(){\n\t\t    \t\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\t    \t\t\ttemplates[key] = xhr.responseText;\n\t\t    \t\t}\n\t\t    \t}\n\t\t    \txhr.send(null);\n\t    \t}\n\n\t    }\n\t    return templates;\n\t}\n\tRCS.getTemplates = getTemplates;\n})(RCS);"
  },
  {
    "path": "im/templates/button.html",
    "content": "<!-- class=\"customer-service\"主页面容器，类名不能修改 -->\n<div class=\"rongcloud-consult\">\n    <button onclick=\"RCS.showCommon()\"><span class=\"rongcloud-cs-icon\">咨询客服</span></button>\n</div>\n<div class=\"customer-service\" style=\"display: none;\"></div>"
  },
  {
    "path": "im/templates/chat.html",
    "content": "<!-- \nclass=\"rongcloud-text\"消息输入框; \nclass=\"rongcloud-expressionContent\"表情容器;\nclass=\"rcs-message-box\"消息列表容器;\nclass=\"rongcloud-Messages-history\"查看更多消息按钮;\nclass=\"rongcloud-mode1\"、class=\"rongcloud-mode2\"人工、机器人转换按钮的容器(机器人状态时，rongcloud-mode1隐藏，rongcloud-mode1显示);\nclass=\"rcs-connect-status\"connect断开时，状态显示的容器\nclass=\"imageViewBox\"图片预览容器\n以上类名不能被修改\n -->\n<div class=\"rongcloud-kefuChat\">\n    <div id=\"header\" class=\"rongcloud-rong-header rongcloud-blueBg rongcloud-online\">\n        {%if(this.terminal == 'phone'){%}\n        <span class=\"rongcloud-phone-exit\" onclick=\"RCS.endConversation()\"></span>\n        <div class=\"rongcloud-phone-infoBar\">\n            <span class=\"rongcloud-phone-kefuName\">{%this.targetName%}</span>\n        </div>\n        {%}else{%}<div class=\"rongcloud-infoBar rongcloud-pull-left\">\n            <div class=\"rongcloud-infoBarTit\">\n                <span class=\"rongcloud-kefuName\">{%this.targetName%}</span>\n            </div>\n        </div>\n        <div class=\"rongcloud-toolBar rongcloud-headBtn rongcloud-pull-right\">\n            <div class=\"rongcloud-voice\"></div>\n            <a onclick=\"RCS.minimize()\" class=\"rongcloud-kefuChatBoxHide rongcloud-sprite\" title=\"隐藏\"></a>\n            <a onclick=\"RCS.endConversation()\" class=\"rongcloud-kefuChatBoxClose rongcloud-sprite\" title=\"结束对话\"></a>\n        </div>{%}%}\n    </div>\n    <div class=\"rongcloud-outlineBox rcs-connect-status\" style=\"display:none;\">\n        <div class=\"rongcloud-sprite\"></div>\n        <span>连接断开,请刷新重连</span>\n    </div>\n    <div id=\"rcs-message-list\" class=\"rcs-message-box\">\n        {%this.messageList%}\n    </div>\n\n    <div id=\"rcs-chat-box\" class=\"rongcloud-rong-footer\">\n        <div class=\"rongcloud-footer-con\">\n            <div class=\"rongcloud-text-layout\">\n                <div id=\"funcPanel\" class=\"rongcloud-funcPanel rongcloud-robotMode\">\n                    <div class=\"rongcloud-mode1\" style=\"display: none;\">\n                        <div class=\"rongcloud-MessageForm-tool\" id=\"expressionWrap\" style=\"overflow: visible;\">\n                            <i class=\"rongcloud-sprite rongcloud-iconfont-smile\" onclick=\"RCS.showemoji(event)\"></i>\n                            <div class=\"rongcloud-expressionWrap\" onclick=\"RCS.chooseEmoji(event)\" style=\"display: none;\">\n                                <div class=\"rongcloud-expressionContent\"></div>\n                            </div>\n                        </div>\n                        <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-upload\" id=\"upload-image\">\n                            <input type=\"file\" multiple=\"multiple\" accept=\"image/png,image/gif,image/jpeg\" onchange=\"RCS.imgUpload(event)\"></input>\n                          </i>\n                        </div>\n                        <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-file\" id=\"upload-file\">\n                            <input type=\"file\" multiple=\"multiple\" onchange=\"RCS.fileUpload(event)\"></input>\n                          </i>\n                        </div>\n                        <!-- <div class=\"rongcloud-MessageForm-tool\">\n                          <i class=\"rongcloud-sprite rongcloud-iconfont-download\" id=\"download-his\" onclick=\"RCS.getHistoryMsgFile()\">\n                          </i>\n                        </div> -->\n                    </div>\n                    <div class=\"rongcloud-mode2\"><a onclick=\"RCS.switchPerson()\" id=\"chatSwitch\" class=\"rongcloud-chatSwitch\">转人工服务</a></div>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-footer-input\">\n            <div class=\"rongcloud-footer-textarea\"\">\n                <textarea class=\"rongcloud-text rongcloud-grey\" placeholder=\"请输入文字...\" onfocus=\"RCS.keyboard(event)\" onkeydown=\"RCS.keySend(event)\"></textarea>\n            </div>\n            <button type=\"button\" style=\"background-color: #0099ff;\" class=\"rongcloud-rong-btn rongcloud-rong-send-btn\" id=\"rong-sendBtn\" onclick=\"RCS.send(event)\">发送</button>\n        </div>\n    </div>\n</div>\n<div class=\"rebox imageViewBox\" onclick=\"RCS.escImageView()\" style=\"display: none;\">\n    \n</div>"
  },
  {
    "path": "im/templates/closebefore.html",
    "content": "<!-- 客服主动关闭弹出的页面 -->\n<div class=\"rongcloud-layermbox\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">客服会话已结束</p>\n                <div class=\"rongcloud-buttons\" onclick=\"RCS.chatEnd()\"><button class=\"rongcloud-button\">确定</button></div>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "im/templates/conversation.html",
    "content": "<!-- 会话列表每一个会话\nclass=\"rong-conversation\"会话列表中的每一个会话\n此类名不能被修改\n-->\n{%for(var index in this.list){%}\n<div class=\"rong-conversation\" _cid=\"{%this.list[index].targetId%}\" _mcount=\"{%this.list[index].unreadMessageCount%}\" onclick=\"RCS.startConversation(event)\">\n\t<div class=\"rongcloud-ext\">\n\t\t<p class=\"rongcloud-attr\">\n\t\t\t{%if(this.list[index].unreadMessageCount){%}<span class=\"rongcloud-badge\">{%this.list[index].unreadMessageCount%}</span>{%}%}\n\t\t\t<i class=\"rongcloud-sprite rongcloud-no-remind\"></i>\n\t\t</p>\n\t</div>\n\t<div class=\"rongcloud-photo\">\n\t\t<img class=\"rongcloud-img\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n\t</div>\n    <div class=\"rongcloud-info\">\n    \t<h3 class=\"rongcloud-nickname\">\n    \t\t<span class=\"rongcloud-nickname_text\">用户：{%this.list[index].targetId%}</span>\n    \t</h3>\n    </div>\n</div>{%}%}"
  },
  {
    "path": "im/templates/endconversation.html",
    "content": "<!-- endconversation: 用户主动关闭弹出的页面  \nclass=\"rongcloud-layermbox\"弹出层容器\n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-endconversation\">\n                <p class=\"rongcloud-prompt\">是否要结束当前会话?</p>\n                <div class=\"rongcloud-buttons\"><button class=\"rongcloud-button\" onclick=\"RCS.confirm()\">是</button><button class=\"rongcloud-button\" onclick=\"RCS.close()\">否</button></div>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "im/templates/evaluate.html",
    "content": "<!-- evaluate: 评价页面  \nclass=\"rongcloud-evaluate\"评价弹出层容器 \n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox rongcloud-evaluate\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-evaluate\">\n                <div class=\"rongcloud-layer-title\">评价客服</div>\n                <div class=\"rongcloud-layer-body\">\n                    <div class=\"rongcloud-group-row\">\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(1)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(2)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(3)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(4)\"></span>\n                        <span class=\"satisfaction-star\" onclick=\"RCS.star(5)\"></span>\n                    </div>\n                </div>\n                <div class=\"rongcloud-foot\">\n                    <button class=\"rongcloud-evaluate-btn\" onclick=\"RCS.evaluate(true)\">提交</button><button class=\"rongcloud-evaluate-btn\" onclick=\"RCS.evaluate(false)\">取消</button>\n                </div>\n            </div>\n            <!--反馈提示-->\n            <!-- <div class=\"rongcloud-layermchild rongcloud-feedback\" ng-show=\"end\">\n                <div class=\"rongcloud-layermcont\">\n                    感谢您的反馈 ^ - ^ ！\n                </div>\n            </div> -->\n        </div>\n    </div>\n</div>\n"
  },
  {
    "path": "im/templates/imMain.html",
    "content": "<!-- main: 包括客服列表和聊天窗口的主页面  \nclass=\"rcs-chat-wrapper\"聊天窗口的容器 \n此类名不能被修改\n-->\n<div id=\"rcs-main\" class=\"rongcloud-kefuListBox rongcloud-container\">\n    {%if(this.showConversitionList){%}<div class=\"rongcloud-kefuList rongcloud-imList\">\n        <div class=\"rongcloud-rong-header rongcloud-blueBg\">\n            <div class=\"rongcloud-toolBar rongcloud-headBtn\">\n                <div class=\"rongcloud-voice\"></div>\n                <div class=\"rongcloud-sprite rongcloud-people\"></div>\n                <span class=\"rongcloud-recent\">最近联系人</span>\n                <div class=\"rongcloud-sprite rongcloud-arrow-down cursor-pointer\" onclick=\"RCS.minimize()\"></div>\n            </div>\n        </div>\n        <div class=\"rongcloud-content\">\n            <div class=\"rongcloud-netStatus\" style=\"display:none\">\n                <div class=\"rongcloud-sprite\"></div>\n                <span>连接断开,请刷新重连</span>\n            </div>\n            <div class=\"rcs-conversation-list\">\n                {%this.conversationList%}\n                <!-- <div class=\"rcs-conversation-item\"></div> -->\n            </div>\n        </div>\n    </div>{%}%}\n    <div class=\"rcs-chat-wrapper rcs-chat-im-wrapper\"></div>\n</div>"
  },
  {
    "path": "im/templates/imMessage.html",
    "content": "<!-- message: 消息list的页面 -->\n<div class=\"rong-message-list\">\n    {%if(this.firstEnter){%}<div class=\"rongcloud-Messages-history\" style=\"display: none;\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}else if(this.hasMore){%}<div class=\"rongcloud-Messages-history\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}%}{%else{%}<div class=\"rongcloud-Messages-history\"><b>没有更多消息</b></div>{%}%}\n    {%for(var index in this.list){%}{%switch(this.list[index].messageType){%}{%case 'TextMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%'用户：'+this.list[index].targetId%} {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">{%this.list[index].content.content%}</pre>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'ImageMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%'用户：'+this.list[index].targetId%} {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-img\">\n                <span class=\"rongcloud-Message-entry\">\n                    <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.list[index].content.imageUri%}\">\n                        <img src=\"{%this.list[index].content.imageUri%}\" data-img=\"{%this.list[index].content.imageUri%}\">\n                    </a>\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'FileMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%'用户：'+this.list[index].targetId%} {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-file\">\n                <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n                <div class=\"rongcloud-file-name\">{%this.list[index].content.name%}</div>\n                <div class=\"rongcloud-file-size\">{%this.list[index].content.size%}</div>\n                <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.list[index].content.fileUrl%}\" download=\"{%this.list[index].content.name%}\"></a>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'VoiceMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%'用户：'+this.list[index].targetId%} {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-audio\">\n                <span class=\"rongcloud-Message-entry\">\n                    {%if(this.messageDirection == 1){%}\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                        <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                    {%}else{%}\n                        <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                    {%}%}\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'TimeMessage':%}\n    <div class=\"rongcloud-Messages-date\">\n        <b>{%this.list[index].sentTime%}</b>\n    </div>{%break;%}\n    {%case 'SightMessage': %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%'用户：'+this.list[index].targetId%} {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n                <video poster=\"{% 'data:image/jpg;base64,' + this.list[index].content.content %}\" src=\"{% this.list[index].content.sightUrl %}\"></video>\n                <div class=\"play-btn\"></div>\n            </div>\n        </div>\n    </div>\n    {%break;%}\n    {%default: %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%'用户：'+this.list[index].targetId%} {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n            </div>\n        </div>\n    </div>{%}%}{%}%}\n</div>\n\n<!-- <div class=\"rongcloud-emptyBox\">暂时没有新消息</div> -->"
  },
  {
    "path": "im/templates/imMessageTemplate.html",
    "content": "<!-- messageTemplate: 一个消息的页面 -->\n<!-- class=\"rongcloud-audioState\"声音消息播放状态\nclass=\"rongcloud-audioBox\" 声音消息容器\n此类名不能被修改 -->\n{%switch(this.messageType){%}{%case 'TextMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%} {%'用户：'+this.targetId%} {%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">{%this.content.content%}</pre>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'ImageMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%} {%'用户：'+this.targetId%} {%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-img\">\n            <span class=\"rongcloud-Message-entry\">\n                <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.content.imageUri%}\">\n                    <img src=\"{%this.content.imageUri%}\" onload=\"RCS.scrollBottom()\" data-img=\"{%this.content.imageUri%}\">\n                </a>\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'FileMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%} {%'用户：'+this.targetId%} {%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-file\">\n            <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n            <div class=\"rongcloud-file-name\">{%this.content.name%}</div>\n            <div class=\"rongcloud-file-size\">{%this.content.size%}</div>\n            <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.content.fileUrl%}\" download=\"{%this.content.name%}\"></a>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'VoiceMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%} {%'用户：'+this.targetId%} {%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-audio\">\n            <span class=\"rongcloud-Message-entry\">\n                {%if(this.messageDirection == 1){%}\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                    </div>\n                    <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                {%}else{%}\n                    <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                        <span class=\"rongcloud-audioState\"></span>\n                    </div>\n                {%}%}\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'TimeMessage':%}\n<div class=\"rongcloud-Messages-date\">\n    <b>{%this.sentTime%}</b>\n</div>{%break;%}\n{%case 'SightMessage': %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%} {%'用户：'+this.targetId%} {%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n            <video poster=\"{% 'data:image/jpg;base64,' + this.content.content %}\" src=\"{% this.content.sightUrl %}\"></video>\n            <div class=\"play-btn\"></div>\n        </div>\n    </div>\n</div>\n{%break;%}\n{%default: %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%} {%'用户：'+this.targetId%} {%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n        </div>\n    </div>\n</div>{%}%}\n"
  },
  {
    "path": "im/templates/imageView.html",
    "content": "<!-- imageView: 图片预览页面   -->\n<a href=\"#\" class=\"rebox-close rebox-button\">×</a>\n<div class=\"rebox-contents\">\n\t<img src=\"{%this.imageUrl%}\" class=\"rebox-content\">\n</div>\n"
  },
  {
    "path": "im/templates/import.html",
    "content": "<script id=\"rcs-templte-button\" type=\"rcs/templte\">\n\t<!--#include file=\"button.html\"-->\n</script>\n\n<script id=\"rcs-templte-main\" type=\"rcs/templte\">\n\t<!--#include file=\"main.html\"-->\n</script>\n\n<script id=\"rcs-templte-conversation\" type=\"rcs/templte\">\n\t<!--#include file=\"conversation.html\"-->\n</script>\n\n<script id=\"rcs-templte-chat\" type=\"rcs/templte\">\n\t<!--#include file=\"chat.html\"-->\n</script>\n\n<script id=\"rcs-templte-message\" type=\"rcs/templte\">\n\t<!--#include file=\"message.html\"-->\n</script>\n\n<script id=\"rcs-templte-message-template\" type=\"rcs/templte\">\n\t<!--#include file=\"messageTemplate.html\"-->\n</script>\n\n\n<script id=\"rcs-templte-closebefore\" type=\"rcs/templte\">\n\t<!--#include file=\"closebefore.html\"-->\n</script>\n\n<script id=\"rcs-templte-endconversation\" type=\"rcs/templte\">\n\t<!--#include file=\"endconversation.html\"-->\n</script>\n\n<script id=\"rcs-templte-evaluate\" type=\"rcs/templte\">\n\t<!--#include file=\"evaluate.html\"-->\n</script>\n\n<script id=\"rcs-templte-leaveword\" type=\"rcs/templte\">\n\t<!--#include file=\"leaveword.html\"-->\n</script>\n\n<script id=\"rcs-templte-imageView\" type=\"rcs/templte\">\n\t<!--#include file=\"imageView.html\"-->\n</script>\n\n<script id=\"rcs-templte-userInfo\" type=\"rcs/templte\">\n\t<!--#include file=\"userInfo.html\"-->\n</script>"
  },
  {
    "path": "im/templates/leaveword.html",
    "content": "<!-- leaveword: 留言页面  \nclass=\"rongcloud-leavemessage\"留言弹出层容器\n此类名不能被修改-->\n<div class=\"rongcloud-leavemessage\">\n    {%if(this.url){%}\n    <iframe id=\"leavewordIframe\" src=\"{%this.url%}\" frameborder=\"0\" width=\"100%;\" height=\"100%;\"></iframe>\n    {%}else{%}\n    <div class=\"rongcloud-leavemessage-title\">您好，请留言~</div>\n    <form>\n        {%for(var index in this.list){%}\n        <div class=\"rongcloud-form-item\">\n            <label class=\"{%if(this.list[index].required){%}{%'rongcloud-require'%}{%}%}\">{%this.list[index].title%}：</label>\n            {%if(this.list[index].type == 'text'){%}<input class=\"rongcloud-inputtext\" name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" type=\"text\" onblur=\"RCS.validateLeaveMessage({%index%}, event)\"></input>{%}else{%}\n            <textarea name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" onblur=\"RCS.validateLeaveMessage({%index%}, event)\"></textarea>{%}%}\n            <div class=\"rongcloud-form-error\" style=\"display: none;\"></div>\n        </div>{%}%}\n        <div class=\"rongcloud-leavemessage-form-btns\">\n            <button class=\"rongcloud-btn\" onclick=\"RCS.leaveMessageComfirm(event)\">提交</button>\n        </div>\n    </form>{%}%}\n</div>"
  },
  {
    "path": "im/templates/main.html",
    "content": "<!-- main: 包括客服列表和聊天窗口的主页面  \nclass=\"rcs-chat-wrapper\"聊天窗口的容器 \n此类名不能被修改\n-->\n<div id=\"rcs-main\" class=\"rongcloud-kefuListBox rongcloud-container\">\n    {%if(this.showConversitionList){%}<div class=\"rongcloud-kefuList\">\n        <div class=\"rongcloud-rong-header rongcloud-blueBg\">\n            <div class=\"rongcloud-toolBar rongcloud-headBtn\">\n                <div class=\"rongcloud-voice\"></div>\n                <div class=\"rongcloud-sprite rongcloud-people\"></div>\n                <span class=\"rongcloud-recent\">客服列表</span>\n                <div class=\"rongcloud-sprite rongcloud-arrow-down cursor-pointer\" onclick=\"RCS.minimize()\"></div>\n            </div>\n        </div>\n        <div class=\"rongcloud-content\">\n            <div class=\"rongcloud-netStatus\" style=\"display:none\">\n                <div class=\"rongcloud-sprite\"></div>\n                <span>连接断开,请刷新重连</span>\n            </div>\n            <div class=\"rcs-conversation-list\">\n                {%this.conversationList%}\n                <!-- <div class=\"rcs-conversation-item\"></div> -->\n            </div>\n        </div>\n    </div>{%}%}\n    <div class=\"rcs-chat-wrapper\"></div>\n</div>"
  },
  {
    "path": "im/templates/message.html",
    "content": "<!-- message: 消息list的页面 -->\n<div class=\"rong-message-list\">\n    {%if(this.firstEnter){%}<div class=\"rongcloud-Messages-history\" style=\"display: none;\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}else if(this.hasMore){%}<div class=\"rongcloud-Messages-history\"><b onclick=\"RCS.loadHisMessages()\">查看历史消息</b></div>{%}%}{%else{%}<div class=\"rongcloud-Messages-history\"><b>没有更多消息</b></div>{%}%}\n    {%for(var index in this.list){%}{%switch(this.list[index].messageType){%}{%case 'TextMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">{%this.list[index].content.content%}</pre>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'ImageMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-img\">\n                <span class=\"rongcloud-Message-entry\">\n                    <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.list[index].content.imageUri%}\">\n                        <img src=\"{%this.list[index].content.imageUri%}\" data-img=\"{%this.list[index].content.imageUri%}\">\n                    </a>\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'FileMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user){%}{%this.list[index].content.user.name%}{%}else{%} {%'客服'%} {%}%}  {%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-file\">\n                <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n                <div class=\"rongcloud-file-name\">{%this.list[index].content.name%}</div>\n                <div class=\"rongcloud-file-size\">{%this.list[index].content.size%}</div>\n                <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.list[index].content.fileUrl%}\" download=\"{%this.list[index].content.name%}\"></a>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'VoiceMessage':%}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-audio\">\n                <span class=\"rongcloud-Message-entry\">\n                    {%if(this.messageDirection == 1){%}\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                        <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                    {%}else{%}\n                        <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.list[index].content)%})'>\n                            <i></i><i></i><i></i>\n                        </span>\n                        <div style=\"display:inline-block;\">\n                            <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.list[index].content.duration || this.list[index].content.duration / 1024)%}''</span>\n                        </div>\n                    {%}%}\n                </span>\n            </div>\n        </div>\n    </div>{%break;%}\n    {%case 'TimeMessage':%}\n    <div class=\"rongcloud-Messages-date\">\n        <b>{%this.list[index].sentTime%}</b>\n    </div>{%break;%}\n    {%case 'InformationNotificationMessage':%}\n    <div class=\"rongcloud-sys-tips\">\n        <span>{%this.list[index].content.message%}</span>\n    </div>{%break;%}\n    {%case 'PullLeaveMessage':%}\n    <div class=\"rongcloud-sys-tips\">\n        <span>{%this.list[index].content.content%}</span>\n    </div>{%break;%}\n    {%case 'SightMessage': %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n                <video poster=\"{% 'data:image/jpg;base64,' + this.list[index].content.content %}\" src=\"{% this.list[index].content.sightUrl %}\"></video>\n                <div class=\"play-btn\"></div>\n            </div>\n        </div>\n    </div>\n    {%break;%}\n    {%default: %}\n    <div class=\"rongcloud-Message rongcloud-clearfix {%if(this.list[index].messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n        <div>\n            <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.list[index].messageDirection != 1){%} {%if(this.list[index].content.user.icon){%}{%this.list[index].content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n                <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n                  <a class=\"rongcloud-author\">{%if(this.list[index].messageDirection != 1){%}{%this.list[index].content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n                </div>\n            </div>\n        </div>\n        <div class=\"rongcloud-Message-body\">\n            <div class=\"rongcloud-Message-text\">\n                <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n            </div>\n        </div>\n    </div>{%}%}{%}%}\n</div>\n\n<!-- <div class=\"rongcloud-emptyBox\">暂时没有新消息</div> -->"
  },
  {
    "path": "im/templates/messageTemplate.html",
    "content": "<!-- messageTemplate: 一个消息的页面 -->\n<!-- class=\"rongcloud-audioState\"声音消息播放状态\nclass=\"rongcloud-audioBox\" 声音消息容器\n此类名不能被修改 -->\n{%switch(this.messageType){%}{%case 'TextMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">{%this.content.content%}</pre>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'ImageMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-img\">\n            <span class=\"rongcloud-Message-entry\">\n                <a onclick=\"RCS.viewImage(event)\" class=\"cursor-pointer\" data-img=\"{%this.content.imageUri%}\">\n                    <img src=\"{%this.content.imageUri%}\" onload=\"RCS.scrollBottom()\" data-img=\"{%this.content.imageUri%}\">\n                </a>\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'FileMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-file\">\n            <div class=\"rongcloud-sprite rongcloud-file-icon\"></div>\n            <div class=\"rongcloud-file-name\">{%this.content.name%}</div>\n            <div class=\"rongcloud-file-size\">{%this.content.size%}</div>\n            <a class=\"rongcloud-sprite rongcloud-file-download\" href=\"{%this.content.fileUrl%}\" download=\"{%this.content.name%}\"></a>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'VoiceMessage':%}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-audio\">\n            <span class=\"rongcloud-Message-entry\">\n                {%if(this.messageDirection == 1){%}\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                    </div>\n                    <span class=\"rongcloud-r-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                {%}else{%}\n                    <span class=\"rongcloud-audioBox rongcloud-clearfix\" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>\n                        <i></i><i></i><i></i>\n                    </span>\n                    <div style=\"display:inline-block;\">\n                        <span class=\"rongcloud-audioTimer\">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>\n                        <span class=\"rongcloud-audioState\"></span>\n                    </div>\n                {%}%}\n            </span>\n        </div>\n    </div>\n</div>{%break;%}\n{%case 'TimeMessage':%}\n<div class=\"rongcloud-Messages-date\">\n    <b>{%this.sentTime%}</b>\n</div>{%break;%}\n{%case 'InformationNotificationMessage':%}\n<div class=\"rongcloud-sys-tips\">\n    <span>{%this.content.message%}</span>\n</div>{%break;%}\n{%case 'PullLeaveMessage':%}\n<div class=\"rongcloud-sys-tips\">\n    <span>{%this.content.content%}</span>\n</div>{%break;%}\n{%case 'SightMessage': %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-sight\" onclick=\"RCS.playVideo(event)\">\n            <video poster=\"{% 'data:image/jpg;base64,' + this.content.content %}\" src=\"{% this.content.sightUrl %}\"></video>\n            <div class=\"play-btn\"></div>\n        </div>\n    </div>\n</div>\n{%break;%}\n{%default: %}\n<div class=\"rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}\" id=\"rcs-templte-message-text\">\n    <div>\n        <div class=\"rongcloud-Message-header\"><img class=\"rongcloud-img rongcloud-Message-avatar rongcloud-avatar\" src=\"{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%'./images/kefu.png'%} {%}%} {%}else{%} {%'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png'%} {%}%}\" alt=\"\">\n            <div class=\"rongcloud-Message-author rongcloud-clearfix\">\n              <a class=\"rongcloud-author\">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>\n            </div>\n        </div>\n    </div>\n    <div class=\"rongcloud-Message-body\">\n        <div class=\"rongcloud-Message-text\">\n            <pre class=\"rongcloud-Message-entry\">当前版本暂不支持查看此消息</pre>\n        </div>\n    </div>\n</div>{%}%}\n"
  },
  {
    "path": "im/templates/userInfo.html",
    "content": "<!-- userInfo: 收集用户信息的页面  \nclass=\"userInfoModel\"收集用户信息页面容器 \n此类名不能被修改\n-->\n<div class=\"rongcloud-layermbox userInfoModel\">\n    <div class=\"rongcloud-laymshade\"></div>\n    <div class=\"rongcloud-layermmain\">\n        <div class=\"rongcloud-section\">\n            <div class=\"rongcloud-layermchild rongcloud-collectuserinfo\">\n                <form name='userinfo' novalidate=\"true\">\n                    <div class=\"rongcloud-layer-body\">\n                        <div class=\"rongcloud-collectuserinfo-title\">你好，客服邀请您填写如下内容</div>\n                        <a class=\"rongcloud-layer-close\" onclick=\"RCS.userInfoClose()\">×</a>\n                        {%for(var index in this.list){%}\n                        <div class=\"rongcloud-form-item\">\n                            <label class=\"rongcloud-form-label {%if(this.list[index].required == 1){%}{%'rongcloud-require'%}{%}%}\">{%this.list[index].label%}：</label>\n                            {%switch(this.list[index].type){%}{%case 'input':%}\n                            <input class=\"rongcloud-inputtext\" type=\"text\" name=\"{%this.list[index].name%}\" data-label=\"{%this.list[index].label%}\" data-pattern=\"{%this.list[index].rule%}\" placeholder=\"{%this.list[index].defaultText%}\" onblur=\"RCS.validateUserInfo(event)\" {%if(this.list[index].required == 1){%}{%'data-required = required'%}{%}%}></input>{%break;%}{%case 'textarea':%}\n                            <textarea name=\"{%this.list[index].name%}\" placeholder=\"{%this.list[index].defaultText%}\" data-label=\"{%this.list[index].label%}\" data-pattern=\"{%this.list[index].rule%}\" onblur=\"RCS.validateUserInfo(event)\"></textarea>{%break;%}{%}%}\n                            <div class=\"rongcloud-form-error\" style=\"display: none;\"></div>\n                        </div>{%}%}\n                    </div>\n                    <div class=\"rongcloud-foot\">\n                        <button class=\"rongcloud-btn\" onclick=\"RCS.userInfoConfirm(event)\">提交</button>\n                    </div>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "im-ui-mod/component-ui.css",
    "content": ".mod {\n    overflow:hidden;\n    border:1px solid #ccc;\n    margin:1em 1em 1em 0;\n}\n.mod h2{\n    font-size:1.5em;\n    padding-top:0.5em;\n    text-indent:1em;\n    background:#f6f6f6;\n}\n.mod-inline-block{\n    display:inline-block;\n    vertical-align:top;\n    max-width:300px;\n    min-width:140px;\n}\n.mod-conversation{\n    border:1px solid #ccc;\n}\n\n.conversation{\n    border:1px solid #ccc;\n    background:#f5f5f5;\n    padding:1em;\n    margin:1em;\n}\n.message{\n    border:1px solid #ccc;\n    background:#fff;\n    padding:1em;\n    margin:1em;\n    font-size:14px;\n}\n.user{\n    display:inline-block;\n    border:1px solid #ccc;\n    background:#f5f6f6;\n    margin:1em;\n    padding:1em;\n    text-align:center;\n}\n.user-portrait{\n    max-width:140px;\n    max-height:140px;\n    margin:0.5em ;\n    border:1px solid #ddd;\n    padding:1px;\n    background:#f5f5f5;\n}\n.user-name{\n    display:block;\n    font-size:12px;\n}"
  },
  {
    "path": "im-ui-mod/reset.css",
    "content": "* {\n    font-size:100%;\n    font-family:verdana;\n    line-height:1.5;\n    padding:0;\n    margin:0;\n    list-style:none;\n} \nbody{\n    padding:2em;\n}   \nh1{\n    font-size:2em;\n}"
  },
  {
    "path": "im-ui-mod/ui.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>ui</title>\n</head>\n<body>\n<link rel=\"stylesheet\" href=\"reset.css\">\n<link rel=\"stylesheet\" href=\"component-ui.css\">\n\n<div class=\"mod mod-inline-block\">\n    <h2>登录用户</h2>\n    <div class=\"user\">\n    \t<img class=\"user-portrait\" src=\"https://avatars1.githubusercontent.com/u/10265829?s=96&amp;login-user\"><span class=\"user-name\">我是user9 (id:user9)</span>\n    </div> \n</div>\n\n<div class=\"mod mod-inline-block\">\n    <h2>新消息</h2>\n    <div id=\"messages\"><div>\n    \t<ul class=\"message\">\n    \t\t<li class=\"message-type\">消息类型：RC:TxtMsg</li>\n    \t\t<li class=\"message-uid\">消息UId：5H3Q-GIE2-S43A-D3ED</li>\n    \t\t<li class=\"message-content\">消息正文：这是一条来自React demo的消息</li>\n    \t\t<li class=\"message-sender\">发送者：user9</li>\n    \t</ul>\n    </div></div>\n</div>\n\n<div class=\"mod mod-conversation\">\n    <h2>会话列表</h2>\n    <div id=\"conversations\"><div>\n    \t<ul class=\"conversation\">\n    \t\t<li class=\"conversation-type\">会话类型： 1</li>\n    \t\t<li class=\"conversation-type\">会话对象： user8</li>\n    \t\t<li>\n    \t\t\t<ul class=\"message\">\n    \t\t\t\t<li>\n    \t\t\t\t\t<div class=\"user\">\n    \t\t\t\t\t\t<img class=\"user-portrait\" src=\"https://avatars1.githubusercontent.com/u/14857191?s=96&amp;v=4\">\n    \t\t\t\t\t\t<span class=\"user-name\">李四 (id:sender)</span>\n    \t\t\t\t\t</div>\n    \t\t\t\t</li>\n    \t\t\t\t<li class=\"message-sender\">发送者Id：user9</li>\n    \t\t\t\t<li class=\"message-type\">消息类型：RC:TxtMsg</li>\n    \t\t\t\t<li class=\"message-uid\">消息UId：5H3Q-GRDK-K43A-D3ED</li>\n    \t\t\t\t<li class=\"message-content\">消息正文：这是一条来自React demo的消息</li>\n    \t\t\t</ul>\n    \t\t</li>\n    \t</ul>\n\t</div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "init-muti.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>im init</title>\n</head>\n<body>\n<style>\ntd{\n\ttext-align:left;\n}\t\npre{\n\tdisplay:inline-block;\n\twidth:500px;\n\tfont-size:12px;\t\n\tline-height:1.5;\n\tfont-family:verdana;\n\tpadding:5px;\n\tbackground:#f5f5f5;\n\tborder:1px solid #333;\n\toverflow:hidden;\n}\n</style>\n<h1>IM 初始化的回调队列</h1>\n<h3>发消息页面(使用默认配置) <a href=\"https://rongcloud.github.io/websdk-demo/api-test.html\">https://rongcloud.github.io/websdk-demo/api-test.html</a></h3>\n\n<table>\n\t<tr>\n\t\t<td id=\"t1\"></td>\n\t\t<td id=\"t2\"></td>\n\t</tr>\n\t<tr>\n\t\t<td><pre id=\"m1\"></pre></td>\n\t\t<td><pre id=\"m2\"></pre></td>\n\t</tr>\n</table>\n\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script src=\"init-muti.js\"></script>\n<script>\nvar appInfo = {\n\tappKey : \"8w7jv4qb78a9y\",\n\ttoken : \"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\"\n};\n\n//第一次注册调用\nvar message1 = [];\nvar callbacks1 = {\n\tonReady : function(instance){\n\t\tconsole.log(\"第一次 instance\");\n\t\tconsole.log(instance);\n\t},\n\tonConnect : function(userInfo){\n\t\tconsole.log(\"第一次 userInfo\");\n\t\tconsole.log(userInfo);\t\t\t\t\n\t\tuserId = userInfo.data.userId;\n\t\tdocument.getElementById(\"t1\").innerHTML = \"第一次调动，userId = \" + userId;\n\t},\n\tonMessage : function(message){\n\t\tconsole.log(\"第一次注册 接收新消息\");\n\t\tconsole.log(message.messageUId);\n\t\tconsole.log(message);\n\t\tmessage1.push(message);\n\t\tmessage1 = message1.splice(0,3);\n\t\tdocument.getElementById(\"m1\").innerHTML = JSON.stringify(message1,null,\"    \");\n\t}\n};\n\ninitMuti(callbacks1,appInfo);\n\n\n//第二次注册调用\nvar message2 = [];\nvar callbacks2 = {\n\tonReady : function(instance){\n\t\tconsole.log(\"第二次 instance\");\n\t\tconsole.log(instance);\n\t},\n\tonConnect : function(userInfo){\n\t\tconsole.log(\"第二次 userInfo\");\n\t\tconsole.log(userInfo);\n\t\tuserId = userInfo.data.userId;\n\t\tdocument.getElementById(\"t2\").innerHTML = \"第二次调动，userId = \" + userId;\n\n\t},\n\tonMessage : function(message){\n\t\tconsole.log(\"第二次注册 接收新消息\");\n\t\tconsole.log(message.messageUId);\n\t\tconsole.log(message);\n\t\tmessage2.push(message);\n\t\tmessage2 = message2.splice(0,3);\n\t\tdocument.getElementById(\"m2\").innerHTML = JSON.stringify(message2,null,\"    \");\n\t}\n};\n\n//第二次无需appInfo\nsetTimeout(function(){\n\tinitMuti(callbacks2);\n},0);\n\n</script>\n</body>\n</html>"
  },
  {
    "path": "init-muti.js",
    "content": "function initMuti(callbacks, appInfo, modules){\t\n\twindow.RongIM = window.RongIM || {};\n\tRongIM.appInfo = RongIM.appInfo || appInfo;\n\n\t//缓存消息回调队列\n\tonMessageList = window.onMessageList || [];\n\tonMessageList.push(callbacks.onMessage);\n\n\t//缓存状态队列\n\tonConnectList = window.onConnectList || [];\n\tonConnectList.push(callbacks.onConnect);\n\n\tmodules = modules || {};\n\tvar RongIMLib = modules.RongIMLib || window.RongIMLib;\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\tif(RongIM.ready){\n\t\tcallbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\tcallbacks.onConnect && callbacks.onConnect(RongIM.userInfo);\n\t\treturn;\n\t}else{\n\t\tvar appInfo = RongIM.appInfo;\n\t\tvar appKey = appInfo.appKey;\n\t\tvar token = appInfo.token;\n\t\tvar navi = appInfo.navi || \"\";\n\n\t\tvar protobuf = modules.protobuf || null;\n\n\t\tvar config = {};\n\n\t\t//私有云\n\t\tif(navi !== \"\"){\n\t\t\tconfig.navi = navi;\n\t\t}\n\n\t\t//support protobuf url + module\n\t\tif(protobuf != null){\n\t\t\tconfig.protobuf = protobuf;\n\t\t};\n\n\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\n\t\t//开始链接\n\t\tRongIMClient.connect(token, {\n\t\t\tonSuccess: function(userId) {\n\t\t\t\tRongIM.ready = true;\n\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\tdata : {userId: userId},\n\t\t\t\t\tstatus : \"ok\",\n\t\t\t\t\tinfo : \"链接成功\"\n\t\t\t\t};\n\n\t\t\t\tfor(var i = 0, len = onConnectList.length; i<len; i++){\n\t            \tonConnectList[i](RongIM.userInfo);\n\t            }\n\t\t\t},\n\t\t\tonTokenIncorrect: function() {\n\t\t\t\t// console.log('token无效');\n\t\t\t\tRongIM.ready = false;\n\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\tdata : {},\n\t\t\t\t\tstatus : \"fail\",\n\t\t\t\t\tinfo : \"token无效\"\n\t\t\t\t};\n\n\t\t\t\tfor(var i = 0, len = onConnectList.length; i<len; i++){\n\t            \tonConnectList[i](userInfo);\n\t            }\n\t\t\t},\n\t\t\tonError:function(errorCode){\n\t\t\t\t// console.log(\"connect error\");\n\t\t\t\t// console.log(errorCode);\n\n\t\t\t\tRongIM.ready = false;\n\t\t\t\tRongIM.userInfo = {\n\t\t\t\t\tdata : {},\n\t\t\t\t\tstatus : \"fail\",\n\t\t\t\t\tinfo : errorCode\n\t\t\t\t};\n\n\t\t\t\tfor(var i = 0, len = onConnectList.length; i<len; i++){\n\t            \tonConnectList[i](userInfo);\n\t            }\n\t\t\t}\n\t\t});\n\t}\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\t// console.log(status);\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t        \tRongIM.instance = RongIMClient.getInstance();\n\t\t            callbacks.onReady && callbacks.onReady(RongIM.instance);\n\t\t            break;\n\t\t        }\n\t\t}\n\t});\n\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    // console.log(\"新消息: \" + message.targetId);\n            // console.log(message);\n            for(var i = 0, len = onMessageList.length; i<len; i++){\n            \tonMessageList[i](message);\n            }\n\t\t}\n\t});\n}"
  },
  {
    "path": "init.js",
    "content": "function init(params, callbacks, modules){\t\n\tvar appKey = params.appKey;\n\tvar token = params.token;\n\tvar navi = params.navi || \"\";\n\n\tmodules = modules || {};\n\tvar RongIMLib = modules.RongIMLib || window.RongIMLib;\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\tvar protobuf = modules.protobuf || null;\n\n\tvar config = {};\n\n\t//私有云切换navi导航，私有云格式 '120.92.10.214:8888'\n\tif(navi !== \"\"){\n\t\tconfig.navi = navi;\n\t}\n\n\t//私有云切换api,私有云格式 '172.20.210.38:81:8888'\n\tvar api = params.api || \"\";\n\tif(api !== \"\"){\n\t\tconfig.api = api;\n\t}\n\n\t//support protobuf url + function\n\tif(protobuf != null){\n\t\tconfig.protobuf = protobuf;\n\t};\n\n\tvar dataProvider = null;\n\tvar imClient = params.imClient;\n\tif (imClient) {\n\t\tdataProvider = new RongIMLib.VCDataProvider(imClient);\n\t}\n\tRongIMLib.RongIMClient.init(appKey, dataProvider, config);\n\n\tvar instance = RongIMClient.getInstance();\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\t// console.log(status);\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus[\"CONNECTED\"]:\n\t\t        case 0:\n\t\t        \tconsole.log(\"连接成功\")\n\t\t            callbacks.getInstance && callbacks.getInstance(instance);\n\t\t            break;\n\n\t\t        case RongIMLib.ConnectionStatus[\"CONNECTING\"]:\n\t\t        case 1:\n\t\t        \tconsole.log(\"连接中\")\n\t\t            break;\n\n\t\t        case RongIMLib.ConnectionStatus[\"DISCONNECTED\"]:\n\t\t        case 2:\n\t\t        \tconsole.log(\"当前用户主动断开链接\")\n\t\t            break;\n\n\t\t        case RongIMLib.ConnectionStatus[\"NETWORK_UNAVAILABLE\"]:\n\t\t        case 3:\n\t\t        \tconsole.log(\"网络不可用\")\n\t\t            break;\n\n\t\t        case RongIMLib.ConnectionStatus[\"CONNECTION_CLOSED\"]:\n\t\t        case 4:\n\t\t        \tconsole.log(\"未知原因，连接关闭\")\n\t\t            break;\n\n\t\t        case RongIMLib.ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"]:\n\t\t        case 6:\n\t\t        \tconsole.log(\"用户账户在其他设备登录，本机会被踢掉线\")\n\t\t            break;\n\n\t\t        case RongIMLib.ConnectionStatus[\"DOMAIN_INCORRECT\"]:\n\t\t        case 12:\n\t\t        \tconsole.log(\"当前运行域名错误，请检查安全域名配置\")\n\t\t            break;\n\t\t    }\n\t\t}\n\t});\n\n\t/*\n\t文档：http://www.rongcloud.cn/docs/web.html#3、设置消息监听器\n\n\t注意事项：\n\t\t1：为了看到接收效果，需要另外一个用户向本用户发消息\n\t\t2：判断会话唯一性 ：conversationType + targetId\n\t\t3：显示消息在页面前，需要判断是否属于当前会话，避免消息错乱。\n\t\t4：消息体属性说明可参考：http://rongcloud.cn/docs/api/js/index.html\n\t*/\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t\tconsole.log(\"新消息: \" + message.targetId);\n\t\t\tconsole.log(message);\n\t\t\tcallbacks.receiveNewMessage && callbacks.receiveNewMessage(message);\n\t\t}\n\t});\n\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tcallbacks.getCurrentUser && callbacks.getCurrentUser({userId:userId});\n\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\tconsole.log('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t\tconsole.log(errorCode);\n\t\t}\n\t}, params.userId);\n}"
  },
  {
    "path": "integrate/chat/chat-guide.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>聊天窗口 集成引导</title>\n</head>\n<link rel=\"stylesheet\" href=\"../integrate.css\">\n<body>\n<div class=\"wrap\">\n    <h1>聊天窗口 集成引导</h1>\n\t<p>聊天窗口由两部分组成，历史消息的列表以及发送消息的窗口，getHistroyMessage，sendMessage，消息旁的用户信息与会话列表处理方式一致</p>\n\t<p>获取历史消息文档: <a href=\"http://www.rongcloud.cn/docs/web.html#history_message\">http://www.rongcloud.cn/docs/web.html#history_message</a></p>\n    <p>发送消息文档: <a href=\"http://www.rongcloud.cn/docs/web_api_demo.html#message_send\">http://www.rongcloud.cn/docs/web_api_demo.html#message_send</a></p>\n\t<p>集成 demo: <a href=\"chat.html\">chat.html</a></p>\n    <div class=\"guide\">\n        <div class=\"steps\">\n            <h2>1.历史消息列表</h2>\n            <div class=\"content\">\n\t\t\t\t<p>模拟的历史消息数据: <a href=\"chat.json\">chat.json</a> 中的 \"historyMessage\"</p>\n<pre>\n/*\n * getHistoryMessages 拉取本地历史消息记录，如果本地没有历史消息，会自动从融云服务器拉去历史消息。\n * @param  {ConversationType}          conversationType 会话类型\n * @param  {string}                    targetId         用户 Id\n * @param  {number|null}               pullMessageTime  拉取历史消息起始位置(格式为毫秒数)，可以为 null\n * @param  {number}                    count            历史消息数量\n * @param  {ResultCallback \"Message[]\"} callback         回调函数\n */\ninstance.getHistoryMessages(conversationType, targetId, null, 20, {\n\tonSuccess: function (list, hasMsg) {\n\t\t// list 为拉取到的历史消息列表\n\t\t// hasMsg 为 boolean 值，如果为 true 则表示还有剩余历史消息可拉取，为 false 的话表示没有剩余历史消息可供拉取。\n\t\t// renderHistoryMessages 为自定义的渲染页面方法\n\t\trenderHistoryMessages(list, hasMsg, instance);\n\t}\n});\n</pre>\n            </div>\n        </div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>2.发送消息窗口</h2>\n\t\t\t<div class=\"content\">\n<pre>\n/*\n * sendMessage 发送消息。\n * @param  {ConversationType}        conversationType 会话类型\n * @param  {string}                  targetId         目标 Id\n * @param  {MessageContent}          messageContent   消息类型\n * @param  {SendMessageCallback}     sendCallback\n * @param  {ResultCallback \"Message\"} resultCallback   返回值，函数回调\n */\ninstance.sendMessage(conversationType, targetId, msg, {\n\t\t// 发送消息成功\n\t\tonSuccess: function (message) {\n\t\t}\n\t}\n);\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\t</div>\n\n</div>\n\n\n</body>\n</html>"
  },
  {
    "path": "integrate/chat/chat.css",
    "content": "/* header */\n\n.header {\n    position: absolute;\n    display: flex;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 1.16rem;\n    line-height: 1.16rem;\n    background: #393a3f;\n    z-index: 99;\n    color: #fff;\n}\n\n.header .title {\n    flex: 1;\n    font-size: 0.45rem;\n    padding:0 0.3rem;\n    text-align: center;\n}\n\n/* chat */\n.chat-content {\n    position: absolute;\n    z-index: 1;\n    top: 1.16rem;\n    bottom: 1.21rem;\n    left: 0;\n    width: 100%;\n    overflow-y: scroll;\n    background-color: #ebebeb;\n}\n\n.chat-content .message-wrapper {\n    padding: 0 0.5rem;\n}\n\n.message-item:nth-child(n+1) {\n    margin-top: 0.4rem;\n}\n\n.message-item:last-child {\n    margin-bottom: 0.4rem;\n}\n\n.message-text {\n    display: flex;\n    font-size: 0.4rem;\n}\n\n.my-msg .message-text {\n    flex-direction: row-reverse;\n}\n\n.you-msg .message-text {\n    padding-left: 1.39rem;\n}\n\n.message-text .rong-avatar {\n    flex-shrink: 0;\n    width: 1.1rem;\n    height: 1.1rem;\n    overflow: hidden;\n}\n\n.message-text .rong-avatar img {\n    width: 100%;\n}\n\n.message-text .message-body {\n    position: relative;\n    color: #353535;\n    padding: 0.25rem;\n    max-width: 100%;\n    min-height: 1em;\n    display: inline-block;\n    vertical-align: top;\n    text-align: left;\n    border-radius: 3px;\n    -moz-border-radius: 3px;\n    -webkit-border-radius: 3px;\n}\n\n.message-text .message-body pre {\n    white-space: normal;\n}\n\n.my-msg .message-text .message-body {\n    margin-right: 0.25rem;\n    background: #b2e281;\n}\n\n.my-msg .message-text .message-body:after {\n    position: absolute;\n    top: 0.32rem;\n    right: -0.3rem;\n    border: 0.2rem solid transparent;\n    content: \" \";\n    border-left-color: #b2e281;\n    border-left-width: 0.15rem;\n}\n\n.your-msg .message-text .message-body {\n    margin-left: 0.25rem;\n    background: #fff;\n}\n\n.your-msg .message-text .message-body:before {\n    position: absolute;\n    top: 0.32rem;\n    left: -0.3rem;\n    border: 0.2rem solid transparent;\n    content: \" \";\n    border-right-color: #fff;\n    border-right-width: 0.15rem;\n\n}\n\n/* footer */\n.footer {\n    display: flex;\n    height: 1.20625rem;\n    line-height: 1.20625rem;\n    position: absolute;\n    left: 0;\n    bottom: 0;\n    width: 100%;\n    text-align: center;\n    z-index: 99;\n    background-color: #f8f8f8;\n}\n\n.footer .message-wrap {\n    flex: 1;\n    overflow: hidden;\n    padding: 0.321538rem 0;\n}\n\n.footer .message-content {\n    padding: 0 0.386rem;\n    width: 100%;\n    background-color: #f8f8f8;\n    resize: none;\n    line-height: 0.6369rem;\n    border: none;\n    font-size: 0.375rem;\n}\n\n.footer .send-btn {\n    display: inline-block;\n    width: 1.4rem;\n    height: 0.7rem;\n    font-size: 0.4rem;\n    color: #fff;\n    border: 1px solid #179e16;\n    border-radius: 3px;\n    background-color: #1aad19;\n    line-height: 0.7rem;\n    margin-top: 0.25rem;\n    margin-right: 0.4rem;\n}"
  },
  {
    "path": "integrate/chat/chat.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no\">\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">\n    <meta name=\"format-detection\" content=\"telephone=no\"/>\n    <meta name=\"format-detection\" content=\"address=no\">\n    <title>chat demo</title>\n    <link rel=\"stylesheet\" href=\"../reset.css\">\n    <link rel=\"stylesheet\" href=\"chat.css\">\n\n    <script src=\"../lib/jquery-3.1.1.js\"></script>\n    <script src=\"../lib/vue-2.1.4.js\"></script>\n    <script src=\"//cdn.ronghub.com/RongIMLib-2.5.0.js\"></script>\n\n\n    <script src=\"../init.js\"></script>\n    <script src=\"chat.js\"></script>\n\n</head>\n<body>\n<div id=\"chatPage\">\n    <component :is=\"stat.currentView\" :stat=\"stat\"></component>\n</div>\n</body>\n<template id=\"chat\">\n    <div class=\"chat\">\n        <!--header-->\n        <header class=\"header\">\n            <h2 class=\"title\">{{stat.currentUserInfo.nickname}}</h2>\n        </header>\n        <!--header-->\n\n        <!--chat-content-->\n        <div class=\"chat-content\">\n            <div class=\"message-wrapper\">\n                <div class=\"message-item\" v-for=\"msg in stat.messageList\"\n                     :class=\"[msg.messageDirection == 1 ? 'my-msg' : 'your-msg']\">\n                    <div v-if=\"msg.messageType == 'TextMessage'\" class=\"message-text\">\n                        <div class=\"rong-avatar\">\n                            <img v-if=\"msg.messageDirection == 1\" :src=\"stat.currentUserInfo.portraitUri\"\n                                 class=\"rong-avatar-bd\">\n                            <img v-else :src=\"stat.targetUserInfo.portraitUri\" class=\"rong-avatar-bd\">\n                        </div>\n                        <div class=\"message-body\">\n                            <pre class=\"user-msg\" v-if=\"msg.content.messageName == 'TextMessage'\">{{msg.content.content}}</pre>\n                            <img class=\"image-message\" :src=\"msg.content.imageUri\" alt=\"image\"\n                                 v-if=\"msg.content.messageName == 'ImageMessage'\">\n                        </div>\n                    </div>\n\n                </div>\n            </div>\n        </div>\n        <!--chat-content-->\n\n        <!--footer-->\n        <footer class=\"footer\">\n            <div class=\"message-wrap\"><textarea v-model=\"stat.sendMsgVal\" id=\"message-content\" placeholder=\"请输入文字...\"\n                                                class=\"message-content\"></textarea></div>\n            <span class=\"send-btn\" @touchend=\"sendMsg\">发送</span>\n        </footer>\n        <!--footer-->\n    </div>\n</template>\n<script type=\"text/javascript\">\n\n    //初始化\n    var userInfo = {\n        appKey: \"82hegw5u8mqwx\",\n        token: \"oUh0wcHH6E2LiuTpEKp/+jCvQwRQ4mI0ws9X674LamLVDfNK14vl8UoEcZT0otHeuyNsIi1T4wZ8UwVl0ZqyZA==\"\n    };\n    var callbacks = {\n        CONNECTED: function (instance) { //传入实例参数\n            //获取历史消息\n            var conversationType = RongIMLib.ConversationType.PRIVATE;\n            var targetId = 'user2';\n            instance.getHistoryMessages(conversationType, targetId, null, 20, {\n                onSuccess: function (list, hasMsg) {\n                    //渲染会话列表\n                    renderHistoryMessages(list, hasMsg, instance);\n                }\n            }, null);\n\n        },\n        Success: function (id) {\n        },\n        Received: function (message) {\n        }\n    };\n    init(userInfo, callbacks);\n</script>\n</html>"
  },
  {
    "path": "integrate/chat/chat.js",
    "content": "function renderHistoryMessages(list, hasMsg, instance) {\n    return new Vue({\n        el: '#chatPage',\n        data: {\n            stat: {\n                currentView: 'chat',\n                currentUserInfo: {\n                    \"id\": \"user1\",\n                    \"nickname\": \"产品\",\n                    \"region\": \"86\",\n                    \"phone\": \"13269772701\",\n                    \"portraitUri\": \"http://img.duoziwang.com/2016/12/08/18594927932.jpg\"\n                },\n                targetUserInfo: {\n                    \"id\": \"user2\",\n                    \"nickname\": \"开发\",\n                    \"region\": \"86\",\n                    \"phone\": \"13269772702\",\n                    \"portraitUri\": \"http://www.tshseo.com/uploads/allimg/141012/21130U347-12.jpg\"\n                },\n                messageList: list,\n                sendMsgVal: ''\n            }\n        },\n        components: {\n            chat: {\n                props: ['stat'],\n                template: '#chat',\n                methods: {\n                    sendMsg: function () {\n                        var text = this.stat.sendMsgVal;\n                        if (!text) {\n                            return false;\n                        }\n                        var msg = new RongIMLib.TextMessage({content: text, extra: \"附加信息\"});\n                        var conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n                        var targetId = \"user2\"; // 目标 Id\n                        var that = this;\n                        instance.sendMessage(conversationType, targetId, msg, {\n                                // 发送消息成功\n                                onSuccess: function (message) {\n                                    that.stat.sendMsgVal = '';\n                                    that.stat.messageList.push(message);\n                                    that.$nextTick(that.scrollEnd);\n                                }\n                            }\n                        );\n                    },\n                    scrollEnd: function () {\n                        //添加完消息 跳转到最后一条\n                        var list = document.querySelectorAll('.message-item');\n                        if (list.length > 1) {\n                            var last = list[list.length - 1];\n                            last.scrollIntoView();\n                        }\n                    }\n                },\n                mounted: function () {\n                    this.scrollEnd();\n                }\n            }\n        }\n    });\n}\n\n"
  },
  {
    "path": "integrate/chat/chat.json",
    "content": "{\n  \"historyMessage\": [\n    {\n      \"content\": {\n        \"messageName\": \"TextMessage\",\n        \"content\": \"欢迎关注融云公众号！融云提供的即时通讯云服务是将即时通讯技术封装成 SDK 供全球开发者下载使用，并向开发者提供平台环境、技术支持以及后期运维等服务，使开发者的业务能够快速获得即时通讯的能力，实现单聊、群聊等功能，满足社交、客服、聊天室等场景需要。\",\n        \"extra\": \"helloExtra\"\n      },\n      \"conversationType\": 1,\n      \"objectName\": \"RC:TxtMsg\",\n      \"messageDirection\": 2,\n      \"messageId\": \"1_8667435\",\n      \"receivedStatus\": 1,\n      \"receivedTime\": 1493257272432,\n      \"senderUserId\": \"user2\",\n      \"sentTime\": 1493200373450,\n      \"targetId\": \"user2\",\n      \"messageType\": \"TextMessage\",\n      \"messageUId\": \"5DQJ-BC6P-843A-D3E6\",\n      \"offLineMessage\": true\n    },\n    {\n      \"content\": {\n        \"messageName\": \"TextMessage\",\n        \"content\": \"好的\",\n        \"extra\": \"附加信息\"\n      },\n      \"conversationType\": 1,\n      \"objectName\": \"RC:TxtMsg\",\n      \"messageDirection\": 1,\n      \"messageId\": \"1_148333\",\n      \"receivedStatus\": 1,\n      \"receivedTime\": 1493257272432,\n      \"senderUserId\": \"user1\",\n      \"sentTime\": 1493201413193,\n      \"targetId\": \"\",\n      \"messageType\": \"TextMessage\",\n      \"messageUId\": \"5DQJ-FB49-443A-D3E7\",\n      \"offLineMessage\": true\n    }\n  ]\n}"
  },
  {
    "path": "integrate/conversation-list/conversation-list-guide.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>会话列表 集成引导</title>\n</head>\n<link rel=\"stylesheet\" href=\"../integrate.css\">\n<body>\n<div class=\"wrap\">\n    <h1>会话列表 集成引导</h1>\n\t<p>文档: <a href=\"http://www.rongcloud.cn/docs/web_api_demo.html#conversation\">http://www.rongcloud.cn/docs/web_api_demo.html#conversation</a>（请注意一定要开启 单群聊消息云端存储功能\n\t\t<a href=\"http://www.rongcloud.cn/pricing/#pay\">收费详情</a>）</p>\n\t<p>集成 demo: <a href=\"conversation-list.html\">conversation-list.html</a></p>\n\t<p>\n\t\t会话列表的数据分两部分，<br>\n\t\t一部分是会话列表（包含最后一条消息），SDK 提供了 getConversationList 方法获取数据；<br>\n\t\t另外一部分是会话对象（联系人，群等）的基本信息，需要应用服务器提供接口\n\t</p>\n    <div class=\"guide\">\n        <div class=\"steps\">\n            <h2>1.用户登录成功后，获取 appKey，token，链接云端</h2>\n            <div class=\"content\">\n\t\t\t\t<p>模拟的用户及群组信息数据: <a href=\"conversation-list.json\">conversation-list.json</a> 中的 \"userInfos,groupInfos\"</p>\n\t\t\t\t<p>调用 init() 初始化，链接云端</p>\n<pre>\nvar userInfo = {\n\tappKey: \"\",\n\ttoken: \"\"\n};\nvar callbacks = {\n\tCONNECTED: function (instance) {\n\t},\n\tSuccess: function (id) {\n\t},\n\tReceived: function (message) {\n\t}\n};\ninit(userInfo, callbacks);\n</pre>\n            </div>\n        </div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>2.获取会话列表，处理会话列表（拼接应用服务器提供的用户或群组信息），渲染会话列表</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>模拟的会话列表数据: <a href=\"conversation-list.json\">conversation-list.json</a> 中的 \"conversation\"</p>\n\t\t\t\t<p>拼接后会话列表数据: <a href=\"conversation-list.json\">conversation-list.json</a> 中的 \"translate-conversation\"</p>\n\n<pre>\n//同步会话列表\n//@param  {ResultCallback} callback 返回值，参数回调\n//@param {array} conversationTypes 可选参数，可以获取指定会话类型的会话，默认请传 null\ninstance.getConversationList({\n\tonSuccess: function (conversations) {\n\t\t//处理会话列表\n\t\ttransConversations(conversations, function (translatedConversations) {\n\t\t\t//处理完成后，渲染会话列表\n\t\t\trenderConversationView(translatedConversations,instance);\n\t\t})\n\t}\n}, null);\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>3.删除指定会话/清除会话列表</h2>\n\t\t\t<div class=\"content\">\n<pre>\ninstance.removeConversation(conversationType,targetId,{\n\tonSuccess:function(bool){\n\t\t//删除会话成功。\n\t\tconsole.log(bool);\n\t},\n\tonError:function(error){\n\t\t// error => 删除会话的错误码\n\t\tconsole.log(error);\n\t}\n});\n</pre>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n</div>\n\n\n</body>\n</html>"
  },
  {
    "path": "integrate/conversation-list/conversation-list.css",
    "content": "/* header */\n\n.header {\n    position: absolute;\n    display: flex;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 1.16rem;\n    line-height: 1.16rem;\n    background: #393a3f;\n    z-index: 99;\n    color: #fff;\n}\n\n.header .title {\n    flex: 1;\n    font-size: 0.45rem;\n    padding:0 0.3rem;\n    text-align: center;\n}\n\n/* conversation-list */\n\n.chat-list {\n    margin-top: 1.16rem;\n    overflow-y: auto;\n}\n\n.chat-item {\n    display: flex;\n    height: 1.6405rem;\n    line-height: 1.6405rem;\n    background: #F5F5F5;\n}\n\n.chat-item:nth-child(n+1) {\n    border-top: 1px solid #e1e1e1;\n}\n\n.chat-item-portrait {\n    width: 1.0615rem;\n    height: 1.0615rem;\n    margin-top: 0.2895rem;\n    margin-left: 0.386rem;\n    border-radius: 50%;\n    overflow: hidden;\n}\n.chat-item-portrait img{\n    width: 100%;\n}\n.chat-item-name {\n    flex: 1;\n    display: inline-block;\n    width: 100%;\n    vertical-align: top;\n    padding-left: 0.43425rem;\n    padding-right: 0.772rem;\n    font-size: 0.386rem;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    -o-text-overflow: ellipsis;\n}\n\n.unread-count {\n    font-size: 0.386rem;\n    background: #d44950;\n    height: 0.574rem;\n    display: inline-block;\n    min-width: 0.3rem;\n    padding: 0.094rem 0.219rem;\n    font-weight: 700;\n    line-height: 1;\n    color: #fff;\n    text-align: center;\n    white-space: nowrap;\n    vertical-align: middle;\n    border-radius: 0.313rem;\n    margin-top: 0.533rem;\n    margin-right: 0.3rem;\n}\n.remove-conversation{\n    font-size: 0.5rem;\n    margin-right: 0.3rem;\n}\n"
  },
  {
    "path": "integrate/conversation-list/conversation-list.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no\">\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">\n    <meta name=\"format-detection\" content=\"telephone=no\"/>\n    <meta name=\"format-detection\" content=\"address=no\">\n    <title>conversation list demo</title>\n    <link rel=\"stylesheet\" href=\"../reset.css\">\n    <link rel=\"stylesheet\" href=\"conversation-list.css\">\n\n    <script src=\"../lib/jquery-3.1.1.js\"></script>\n    <script src=\"../lib/vue-2.1.4.js\"></script>\n    <script src=\"//cdn.ronghub.com/RongIMLib-2.5.0.js\"></script>\n\n\n    <script src=\"../init.js\"></script>\n    <script src=\"conversation-list.js\"></script>\n\n</head>\n<body>\n<div id=\"conversationListPage\">\n    <component :is=\"stat.currentView\" :stat=\"stat\"></component>\n</div>\n</body>\n<template id=\"conversationList\">\n    <div class=\"conversationList\">\n        <!--header-->\n        <header class=\"header\">\n            <h2 class=\"title\">{{stat.currentUserInfo.nickname}}</h2>\n        </header>\n        <!--header-->\n        <!--chat-list-->\n        <ul class=\"chat-list\">\n            <li class=\"chat-item\" v-for=\"(item,index) in stat.conversationList\">\n                <!--<pre>{{stat.conversationList}}</pre>-->\n                <div class=\"chat-item-portrait\"><img :src=\"item.userInfo.portraitUri\" class=\"rong-avatar-bd\"></div>\n                <div class=\"chat-item-name\" v-if=\"item.conversationType === 1\">{{item.userInfo.nickname}} :\n                    {{item.latestMessage.content.content ||\n                    '' }}\n                </div>\n                <div class=\"chat-item-name\" v-if=\"item.conversationType === 3\">{{item.userInfo.name}} :\n                    {{item.latestMessage.content.content ||\n                    '' }}\n                </div>\n                <div class=\"unread-count\" v-if=\"item.unreadMessageCount\">{{item.unreadMessageCount}}</div>\n                <div class=\"remove-conversation\" @touchend=\"removeConversation(item.conversationType,item.latestMessage.targetId , index)\">&times;</div>\n            </li>\n        </ul>\n        <!--chat-list-->\n    </div>\n</template>\n<script type=\"text/javascript\">\n\n    //初始化\n    var userInfo = {\n        appKey: \"82hegw5u8mqwx\",\n        token: \"oUh0wcHH6E2LiuTpEKp/+jCvQwRQ4mI0ws9X674LamLVDfNK14vl8UoEcZT0otHeuyNsIi1T4wZ8UwVl0ZqyZA==\"\n    };\n    var callbacks = {\n        CONNECTED: function (instance) { //传入实例参数\n            //获取会话列表\n            instance.getConversationList({\n                onSuccess: function (conversations) {\n                    //处理会话列表\n                    transConversations(conversations, function (translatedConversations) {\n                        // 因 Demo 用户数据为 Mock 数据，过滤没有用户信息的会话，若数据完整可省略此项\n                        translatedConversations = translatedConversations.filter((conversation) => {\n                            return conversation.userInfo != null;\n                        });\n                        //渲染会话列表\n                        renderConversationView(translatedConversations,instance);\n                    })\n                }\n            }, null);\n\n        },\n        Success: function (id) {\n        },\n        Received: function (message) {\n        }\n    };\n    init(userInfo, callbacks);\n</script>\n</html>"
  },
  {
    "path": "integrate/conversation-list/conversation-list.js",
    "content": "function getMockData(url, params, callback) {\n    //url 处理 '/user/get_user'\n\n    $.getJSON('conversation-list.json', function (data) {\n\n\n        var userInfos = {};\n\n        params.forEach(function (item) {\n            if (item.conversationType === 1) {\n                userInfos[item.id] = data['userInfos'][item.id];\n            } else if (item.conversationType === 3) {\n                userInfos[item.id] = data['groupInfos'][item.id];\n            }\n        });\n\n        callback(userInfos)\n    });\n}\n\n\nfunction transConversations(conversations, callback) {\n\n    if (conversations.length) {\n\n        //获取需要查询用户列表\n        var conversationUsers = [], userInfos;\n        conversations.forEach(function (item) {\n            conversationUsers.push({conversationType: item.conversationType, id: item.targetId});\n        });\n\n        //获取用户信息\n        getMockData(\"/user/get_user\", conversationUsers, function (data) {\n            userInfos = data;\n\n            conversations.forEach(function (item) {\n\n                item[\"userInfo\"] = userInfos[item.targetId];\n\n            });\n\n            callback(conversations);\n        });\n\n\n    } else {\n        callback(conversations);\n    }\n\n}\n\nfunction renderConversationView(translatedConversations, instance) {\n\n    return new Vue({\n        el: '#conversationListPage',\n        data: {\n            stat: {\n                currentView: 'conversationList',\n                currentUserInfo: {\n                    \"id\": \"user1\",\n                    \"nickname\": \"产品\",\n                    \"region\": \"86\",\n                    \"phone\": \"13269772701\",\n                    \"portraitUri\": \"http://img.duoziwang.com/2016/12/08/18594927932.jpg\"\n                },\n                conversationList: translatedConversations\n            }\n        },\n        components: {\n            conversationList: {\n                props: ['stat'],\n                template: '#conversationList',\n                methods: {\n                    removeConversation: function (conversationType, targetId, index) {\n                        var that = this;\n                        instance.removeConversation(conversationType, targetId, {\n                            onSuccess: function (bool) {\n                                //删除会话成功。\n                                console.log(bool);\n                                //删除本地数据\n                                that.stat.conversationList.splice(index, 1);\n                            },\n                            onError: function (error) {\n                                // error => 删除会话的错误码\n                                console.log(error);\n                            }\n                        });\n                    },\n\n                    clearConversation: function () {\n                        var conversationTypes = [RongIMLib.ConversationType.PRIVATE, RongIMLib.ConversationType.GROUP];\n                        instance.clearConversations(conversationTypes, {\n                            onSuccess: function (bool) {\n                                // 清除会话成功\n                                console.log(bool);\n                            },\n                            onError: function (error) {\n                                // error => 清除会话错误码。\n                            }\n                        });\n                    }\n                }\n            }\n        }\n    });\n}"
  },
  {
    "path": "integrate/conversation-list/conversation-list.json",
    "content": "{\n  \"userInfos\": {\n    \"user1\": {\n      \"id\": \"user1\",\n      \"nickname\": \"产品\",\n      \"region\": \"86\",\n      \"phone\": \"13269772701\",\n      \"portraitUri\": \"http://img.duoziwang.com/2016/12/08/18594927932.jpg\"\n    },\n    \"user2\": {\n      \"id\": \"user2\",\n      \"nickname\": \"开发\",\n      \"region\": \"86\",\n      \"phone\": \"13269772702\",\n      \"portraitUri\": \"http://www.tshseo.com/uploads/allimg/141012/21130U347-12.jpg\"\n    },\n    \"user3\": {\n      \"id\": \"user3\",\n      \"nickname\": \"测试\",\n      \"region\": \"86\",\n      \"phone\": \"13269772703\",\n      \"portraitUri\": \"http://www.yangshuai.net/wp-content/uploads/2012/01/812.jpg\"\n    }\n  },\n  \"groupInfos\": {\n    \"workGroup\": {\n      \"id\": \"workGroup\",\n      \"name\": \"工作群\",\n      \"portraitUri\": \"http://intern.wargaming.net/wp-content/uploads/2016/04/community-icon-01-1.png\",\n      \"creatorId\": \"user1\",\n      \"memberCount\": 3,\n      \"maxMemberCount\": 500\n    }\n  },\n  \"conversation\": [\n    {\n      \"conversationType\": 1,\n      \"latestMessage\": {\n        \"content\": {\n          \"messageName\": \"TextMessage\",\n          \"content\": \"  你好 \",\n          \"extra\": \"helloExtra\"\n        },\n        \"conversationType\": 1,\n        \"objectName\": \"RC:TxtMsg\",\n        \"messageDirection\": 2,\n        \"messageId\": \"1_5709252\",\n        \"receivedStatus\": 1,\n        \"receivedTime\": 1493029390272,\n        \"senderUserId\": \"user3\",\n        \"sentTime\": 1493027215795,\n        \"targetId\": \"user3\",\n        \"messageType\": \"TextMessage\",\n        \"messageUId\": \"5DPU-MQPM-C43A-D3E6\",\n        \"offLineMessage\": true\n      },\n      \"latestMessageId\": \"1_5709252\",\n      \"objectName\": \"RC:TxtMsg\",\n      \"receivedStatus\": 1,\n      \"sentTime\": 1493027215795,\n      \"targetId\": \"user3\",\n      \"unreadMessageCount\": 0\n    },\n    {\n      \"conversationType\": 1,\n      \"latestMessage\": {\n        \"content\": {\n          \"messageName\": \"TextMessage\",\n          \"content\": \"  你好 \",\n          \"extra\": \"helloExtra\"\n        },\n        \"conversationType\": 1,\n        \"objectName\": \"RC:TxtMsg\",\n        \"messageDirection\": 2,\n        \"messageId\": \"1_2422848\",\n        \"receivedStatus\": 1,\n        \"receivedTime\": 1493029390272,\n        \"senderUserId\": \"user2\",\n        \"sentTime\": 1493027180162,\n        \"targetId\": \"user2\",\n        \"messageType\": \"TextMessage\",\n        \"messageUId\": \"5DPU-MMEG-843A-D3E6\",\n        \"offLineMessage\": true\n      },\n      \"latestMessageId\": \"1_2422848\",\n      \"objectName\": \"RC:TxtMsg\",\n      \"receivedStatus\": 1,\n      \"sentTime\": 1493027180162,\n      \"targetId\": \"user2\",\n      \"unreadMessageCount\": 0\n    },\n    {\n      \"conversationType\": 3,\n      \"latestMessage\": {\n        \"content\": {\n          \"messageName\": \"TextMessage\",\n          \"content\": \"hello\",\n          \"extra\": \"helloExtra\"\n        },\n        \"conversationType\": 3,\n        \"objectName\": \"RC:TxtMsg\",\n        \"messageDirection\": 2,\n        \"messageId\": \"3_13985191\",\n        \"receivedStatus\": 1,\n        \"receivedTime\": 1493029390271,\n        \"senderUserId\": \"user2\",\n        \"sentTime\": 1493024687146,\n        \"targetId\": \"workGroup\",\n        \"messageType\": \"TextMessage\",\n        \"messageUId\": \"5DPU-D645-8CVQ-Q0FE\",\n        \"offLineMessage\": true\n      },\n      \"latestMessageId\": \"3_13985191\",\n      \"objectName\": \"RC:TxtMsg\",\n      \"receivedStatus\": 1,\n      \"sentTime\": 1493024687146,\n      \"targetId\": \"workGroup\",\n      \"unreadMessageCount\": 0\n    }\n  ],\n  \"translate-conversation\": [\n    {\n      \"conversationType\": 1,\n      \"latestMessage\": {\n        \"content\": {\n          \"messageName\": \"TextMessage\",\n          \"content\": \"  你好 \",\n          \"extra\": \"helloExtra\"\n        },\n        \"conversationType\": 1,\n        \"objectName\": \"RC:TxtMsg\",\n        \"messageDirection\": 2,\n        \"messageId\": \"1_5709252\",\n        \"receivedStatus\": 1,\n        \"receivedTime\": 1493029390272,\n        \"senderUserId\": \"user3\",\n        \"sentTime\": 1493027215795,\n        \"targetId\": \"user3\",\n        \"messageType\": \"TextMessage\",\n        \"messageUId\": \"5DPU-MQPM-C43A-D3E6\",\n        \"offLineMessage\": true\n      },\n      \"latestMessageId\": \"1_5709252\",\n      \"objectName\": \"RC:TxtMsg\",\n      \"receivedStatus\": 1,\n      \"sentTime\": 1493027215795,\n      \"targetId\": \"user3\",\n      \"unreadMessageCount\": 0,\n      \"userInfo\": {\n        \"id\": \"user3\",\n        \"nickname\": \"测试\",\n        \"region\": \"86\",\n        \"phone\": \"13269772703\",\n        \"portraitUri\": \"http://www.yangshuai.net/wp-content/uploads/2012/01/812.jpg\"\n      }\n    },\n    {\n      \"conversationType\": 1,\n      \"latestMessage\": {\n        \"content\": {\n          \"messageName\": \"TextMessage\",\n          \"content\": \"  你好 \",\n          \"extra\": \"helloExtra\"\n        },\n        \"conversationType\": 1,\n        \"objectName\": \"RC:TxtMsg\",\n        \"messageDirection\": 2,\n        \"messageId\": \"1_2422848\",\n        \"receivedStatus\": 1,\n        \"receivedTime\": 1493029390272,\n        \"senderUserId\": \"user2\",\n        \"sentTime\": 1493027180162,\n        \"targetId\": \"user2\",\n        \"messageType\": \"TextMessage\",\n        \"messageUId\": \"5DPU-MMEG-843A-D3E6\",\n        \"offLineMessage\": true\n      },\n      \"latestMessageId\": \"1_2422848\",\n      \"objectName\": \"RC:TxtMsg\",\n      \"receivedStatus\": 1,\n      \"sentTime\": 1493027180162,\n      \"targetId\": \"user2\",\n      \"unreadMessageCount\": 0,\n      \"userInfo\": {\n        \"id\": \"user2\",\n        \"nickname\": \"开发\",\n        \"region\": \"86\",\n        \"phone\": \"13269772702\",\n        \"portraitUri\": \"http://www.tshseo.com/uploads/allimg/141012/21130U347-12.jpg\"\n      }\n    },\n    {\n      \"conversationType\": 3,\n      \"latestMessage\": {\n        \"content\": {\n          \"messageName\": \"TextMessage\",\n          \"content\": \"hello\",\n          \"extra\": \"helloExtra\"\n        },\n        \"conversationType\": 3,\n        \"objectName\": \"RC:TxtMsg\",\n        \"messageDirection\": 2,\n        \"messageId\": \"3_13985191\",\n        \"receivedStatus\": 1,\n        \"receivedTime\": 1493029390271,\n        \"senderUserId\": \"user2\",\n        \"sentTime\": 1493024687146,\n        \"targetId\": \"workGroup\",\n        \"messageType\": \"TextMessage\",\n        \"messageUId\": \"5DPU-D645-8CVQ-Q0FE\",\n        \"offLineMessage\": true\n      },\n      \"latestMessageId\": \"3_13985191\",\n      \"objectName\": \"RC:TxtMsg\",\n      \"receivedStatus\": 1,\n      \"sentTime\": 1493024687146,\n      \"targetId\": \"workGroup\",\n      \"unreadMessageCount\": 0,\n      \"userInfo\": {\n        \"id\": \"workGroup\",\n        \"name\": \"工作群\",\n        \"portraitUri\": \"http://intern.wargaming.net/wp-content/uploads/2016/04/community-icon-01-1.png\",\n        \"creatorId\": \"user1\",\n        \"memberCount\": 3,\n        \"maxMemberCount\": 500\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "integrate/guide.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>集成 引导</title>\n</head>\n<link rel=\"stylesheet\" href=\"integrate.css\">\n<body>\n\n<div class=\"wrap\">\n    <h1>WebIM 集成引导</h1>\n\n    <div class=\"guide\">\n        <div class=\"steps\">\n            <h2>1.准备工作</h2>\n            <div class=\"content\">\n                <p>架构说明: <a href=\"http://www.rongcloud.cn/docs/quick_start.html#framework\">http://www.rongcloud.cn/docs/quick_start.html#framework</a>\n                </p>\n                <p>应用服务器必须要处理的有: </p>\n                <ol>\n                    <li>1.维护用户信息，群组信息，好友关系，并提供对应接口供集成使用</li>\n                    <li>2.获取并存储 token</li>\n                    <li>3.系统消息，通知等</li>\n                </ol>\n\n                <p>\n                    搭建应用服务器: <a href=\"https://github.com/sealtalk/sealtalk-server\">https://github.com/sealtalk/sealtalk-server</a>\n                    <br>\n                    开发文档 <a href=\"http://www.rongcloud.cn/docs/server.html\">http://www.rongcloud.cn/docs/server.html</a>\n                </p>\n            </div>\n        </div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>2.自行设计并 UI 界面</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>集成的思路: </p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>1.根据功能选择 SDK 里对应的 API</li>\n\t\t\t\t\t<li>2.应用服务器提供其他 API 之外所有的数据和功能支持</li>\n\t\t\t\t\t<li>3.合并两部分数据，通过模板渲染呈现（为了实时响应数据变化，建议使用双向绑定）</li>\n\t\t\t\t\t<li>4.注册对应的事件，包括 API 的方法（比如发送消息等）或者自行实现的业务方法（注册登录等）</li>\n\t\t\t\t</ol>\n\t\t\t\t<br>\n\n\t\t\t\t<p>SDK API调用示例：<a href=\"https://rongcloud.github.io/websdk-demo/api-test.html\">https://rongcloud.github.io/websdk-demo/api-test.html</a></p>\n\t\t\t\t<!-- <ol>\n\t\t\t\t\t<li>1.链接相关</li>\n\t\t\t\t\t<li>2.收发消息</li>\n\t\t\t\t\t<li>3.群组相关</li>\n\t\t\t\t\t<li>4.聊天室相关</li>\n\t\t\t\t\t<li>5.公众服务相关</li>\n\t\t\t\t</ol> -->\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>3.引入 SDK，并完成初始化、链接云端</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t文档: <a href=\"http://www.rongcloud.cn/docs/web.html\">http://www.rongcloud.cn/docs/web.html</a> <br>\n\t\t\t\t参考: <a href=\"https://rongcloud.github.io/websdk-demo/connect-check.html\">https://rongcloud.github.io/websdk-demo/connect-check.html</a>\n\n\t\t\t\t<div class=\"helps\">\n\t\t\t\t\t<h3>常见问题: </h3>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li><a href=\"https://rongcloud.github.io/websdk-demo/require.html\">项目已使用 require 或其他模块化加载，应该如何初始化？</a></li>\n\t\t\t\t\t\t<li><a href=\"https://rongcloud.github.io/websdk-demo/init.js\">私有云如何初始化？</a></li>\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\" id=\"login\">\n\t\t\t<h2>4.登录的实现</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>可以根据业务需要设计用户名和密码规则，具体的流程: </p>\n\t\t\t\t<ul>\n                    <li>1.应用服务器处理用户的注册及校验，注册成功后，通过应用服务器访问融云服务器获取用户 token 并存储在应用服务器</li>\n                    <li>2.用户成功登录后，通过应用服务器返回 token</li>\n                    <li>3.端上用户使用 token 链接融云服务器</li>\n                    <li>4.用户的在线状态</li>\n\t\t\t\t</ul>\n\n\t\t\t\t获取 token 文档: <a href=\"http://www.rongcloud.cn/docs/server.html#user_get_token\">http://www.rongcloud.cn/docs/server.html#user_get_token</a>\n\t\t\t\t<br>\n\t\t\t\t使用 token 链接融云服务器文档: <a href=\"http://www.rongcloud.cn/docs/web.html#connect\">http://www.rongcloud.cn/docs/web.html#connect</a> <br>\n\n\t\t\t\t<a href=\"./login/login.html\">登录 demo</a>\n\n\t\t\t\t<div class=\"helps\">\n\t\t\t\t\t<h3>常见问题: </h3>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li><a href=\"http://support.rongcloud.cn/search?changetype=1&q=%E6%B8%B8%E5%AE%A2\">如何实现游客无需注册登录聊天？</a></li>\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\" id=\"friends\">\n\t\t\t<h2>5.好友关系，群组</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>在应用服务器维护数据，并同步至融云: </p>\n\n\t\t\t\t<ul>\n\t\t\t\t\t<li>1.添加好友</li>\n\t\t\t\t\t<li>2.创建并加入群组</li>\n\t\t\t\t\t<li>3.禁言及黑名单</li>\n\t\t\t\t\t<li>4.无用户身份处理</li>\n\t\t\t\t</ul>\n\n\t\t\t\t<p>开发文档: <a href=\"http://www.rongcloud.cn/docs/server.html\">http://www.rongcloud.cn/docs/server.html</a></p>\n\t\t\t\t<p>应用服务器 node 版代码: <a href=\"https://github.com/sealtalk/sealtalk-server\">https://github.com/sealtalk/sealtalk-server</a></p>\n\t\t\t\t<p><a href=\"./server-api.md\">接口文档</a></p>\n\n\n\t\t\t\t<div class=\"helps\">\n\t\t\t\t\t<h3>常见问题: </h3>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li>用户与消息通过 id 关联，userId == message.senderUserId</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\" id=\"conversation\">\n\t\t\t<h2>6.会话列表的实现</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t文档: <a href=\"http://www.rongcloud.cn/docs/web.html#conversation\">http://www.rongcloud.cn/docs/web.html#conversation</a> （请注意一定要开启 单群聊消息云端存储功能\n\t\t\t\t<a href=\"http://www.rongcloud.cn/pricing/#pay\">收费详情</a>） <br>\n\t\t\t\t参考: <a href=\"./conversation-list/conversation-list.html\">conversation-list.html</a>\n\t\t\t\t<p>\n\t\t\t\t\t会话列表的数据分两部分，<br>一部分是会话列表（包含最后一条消息），SDK 提供了 getConversationList 方法获取数据； <br>\n\t\t\t\t\t另外一部分是会话对象（联系人，群等）的基本信息，需要应用服务器提供接口\n\t\t\t\t</p>\n\t\t\t\t<br>\n\t\t\t\t<p>1.用户登录成功后，获取 appKey，token，链接云端</p>\n\t\t\t\t<p>模拟的用户及群组信息数据 : <a href=\"./conversation-list/conversation-list.json\">conversation-list.json</a> 中的 \"userInfos,groupInfos\"</p>\n\t\t\t\t<p>调用 init() 初始化，链接云端</p>\n\t\t\t\t<pre>\nvar userInfo = {\n\tappKey: \"\",\n\ttoken: \"\"\n};\nvar callbacks = {\n\tCONNECTED: function (instance) {\n\t},\n\tSuccess: function (id) {\n\t},\n\tReceived: function (message) {\n\t}\n};\ninit(userInfo, callbacks);\n</pre>\n\t\t\t\t<p>2.获取会话列表，处理会话列表（拼接应用服务器提供的用户或群组信息），渲染会话列表</p>\n\t\t\t\t<p>模拟的会话列表数据 : <a href=\"./conversation-list/conversation-list.json\">conversation-list.json</a> 中的 \"conversation\"</p>\n\t\t\t\t<p>拼接后会话列表数据 : <a href=\"./conversation-list/conversation-list.json\">conversation-list.json</a> 中的 \"translate-conversation\"</p>\n<pre>\n//同步会话列表\n//@param  {ResultCallback} callback 返回值，参数回调\n//@param {array} conversationTypes 可选参数，可以获取指定会话类型的会话，默认请传 null\ninstance.getConversationList({\n\tonSuccess: function (conversations) {\n\t\t//处理会话列表\n\t\ttransConversations(conversations, function (translatedConversations) {\n\t\t\t//处理完成后，渲染会话列表\n\t\t\trenderConversationView(translatedConversations,instance);\n\t\t})\n\t}\n}, null);\n</pre>\n\t\t\t\t<p>3.删除指定会话/清除会话列表</p>\n<pre>\ninstance.removeConversation(conversationType,targetId,{\n\tonSuccess:function(bool){\n\t\t//删除会话成功。\n\t\tconsole.log(bool);\n\t},\n\tonError:function(error){\n\t\t// error => 删除会话的错误码\n\t\tconsole.log(error);\n\t}\n});\n</pre>\n\n\t\t\t\t<p>4.新消息接受</p>\n\t\t\t\t<p><a href=\"https://github.com/rongcloud/websdk-demo/blob/master/connect-check.html\">参考消息接受</a>， 消息都是统一接受的，需要开发者根据消息的conversationType和targetId来判断消息属于哪个会话并在对应会话中更新</p>\n\t\t\t\t<p>在接受新消息后重新计算未读消息数，并根据用户操作清除未读数，最后再同步状态到多端。具体实现请参考：<a href=\"http://support.rongcloud.cn/kb/NjE0\">消息状态及处理方式</a></p>\n\t\t\t\t\n\t\t\t\t<div class=\"helps\">\n\t\t\t\t\t<h3>常见问题: </h3>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li><a href=\"http://support.rongcloud.cn/kb/NjE1\">@消息的实现方法</a></li>\n\t\t\t\t\t\t<li><a href=\"http://support.rongcloud.cn/kb/NjE0\">消息状态及处理方式</a></li>\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>7.聊天窗口的实现</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>聊天窗口由两部分组成，历史消息的列表以及发送消息的窗口，SDK 提供了两个对应的方法，getHistroyMessage，sendMessage，消息旁的用户信息与会话列表处理方式一致</p>\n\t\t\t\t<p>获取历史消息文档: <a href=\"http://www.rongcloud.cn/docs/web.html#history_message\">http://www.rongcloud.cn/docs/web.html#history_message</a></p>\n\t\t\t\t<p>发送消息文档: <a href=\"http://www.rongcloud.cn/docs/web_api_demo.html#message_send\">http://www.rongcloud.cn/docs/web_api_demo.html#message_send</a></p>\n\t\t\t\t<p>集成 demo : <a href=\"./chat/chat.html\">chat.html</a></p>\n\t\t\t\t<br>\n\t\t\t\t<p>1.历史消息列表</p>\n\t\t\t\t<p>模拟的历史消息数据: <a href=\"./chat/chat.json\">chat.json</a> 中的 \"historyMessage\"</p>\n<pre>\n/*\n * getHistoryMessages 拉取本地历史消息记录，如果本地没有历史消息，会自动从融云服务器拉去历史消息。\n * @param  {ConversationType}          conversationType 会话类型\n * @param  {string}                    targetId         用户 Id\n * @param  {number|null}               pullMessageTime  拉取历史消息起始位置(格式为毫秒数)，可以为 null\n * @param  {number}                    count            历史消息数量\n * @param  {ResultCallback} callback         回调函数\n */\ninstance.getHistoryMessages(conversationType, targetId, null, 20, {\n\tonSuccess: function (list, hasMsg) {\n\t\t// list 为拉取到的历史消息列表\n\t\t// hasMsg 为 boolean 值，如果为 true 则表示还有剩余历史消息可拉取，为 false 的话表示没有剩余历史消息可供拉取。\n\t\t// renderHistoryMessages 为自定义的渲染页面方法\n\t\trenderHistoryMessages(list, hasMsg, instance);\n\t}\n});\n</pre>\n\t\t\t\t<p>2.发送消息窗口</p>\n<pre>\n/*\n * sendMessage 发送消息。\n * @param  {ConversationType}        conversationType 会话类型\n * @param  {string}                  targetId         目标 Id\n * @param  {MessageContent}          messageContent   消息类型\n * @param  {SendMessageCallback}     sendCallback\n * @param  {ResultCallback} resultCallback   返回值，函数回调\n */\ninstance.sendMessage(conversationType, targetId, msg, {\n\t\t// 发送消息成功\n\t\tonSuccess: function (message) {\n\t\t}\n\t}\n);\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>8.发送消息的功能增强</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>图片消息，文件消息，自定义消息</p>\n\t\t\t\t<p>消息接口文档: <a href=\"http://www.rongcloud.cn/docs/web_api_demo.html#message\">http://www.rongcloud.cn/docs/web_api_demo.html#message</a></p>\n\t\t\t\t<p>集成 demo: <a href=\"./message/message.html\">message.html</a></p>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>1.图片消息</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>模拟接收图片消息的数据: <a href=\"./message/message.json\">message.json</a> 中的 \"messageType\" 为 \"ImageMessage\"</p>\n\t\t\t\t\t\t<p>模拟发送服务器图片: <a href=\"//developer.rongcloud.cn\">开发者站点</a> => API 调试 => 发送单聊消息 =>   \"objectName\" == \"RC:ImgMsg\"</p>\n\t\t\t\t\t\t<p>1.上传图片,</p>\n\t\t\t\t\t\t<p>上传插件文档: <a href=\"http://www.rongcloud.cn/docs/web.html#upload_widget\">http://www.rongcloud.cn/docs/web.html#upload_widget</a></p>\n\t\t\t\t\t\t<p>图片上传插件以七牛云为例，依次引入 <a href=\"./message/upload/qiniu.js\">qiniu.js</a>，<a href=\"./message/upload/upload.js\">upload.js</a>，<a href=\"./message/upload/uploadInit.js\">uploadInit.js</a>，为上传按钮添加监听事件，<a href=\"./message/message.js\">message.js</a> 中 watchUpload 方法</p>\n\t\t\t\t\t\t<p>2.上传图片后，生成图片消息 createMessage</p>\n\t\t\t\t\t\t<p>3.调用 sendMessage 发送图片消息</p>\n\t\t\t\t\t\t<pre>\ninstance.sendMessage(conversationType, targetId, msg, {\n\t\tonSuccess: function (message) {\n\t\t\tconsole.log(\"Send successfully\");\n\t\t}\n\t}\n);\n</pre>\n\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>2.文件消息</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>模拟接收文件消息的数据 : <a href=\"./message/message.json\">message.json</a> 中的 \"messageType\" 为 \"FileMessage\"</p>\n\t\t\t\t\t\t<p>实现方法同图片消息</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>3.自定义消息</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>1.定义消息类型</p>\n\t\t\t\t\t\t<pre>\nvar messageName = \"PersonMessage\"; // 消息名称。\nvar objectName = \"s:person\"; // 消息内置名称，请按照此格式命名。\nvar mesasgeTag = new RongIMLib.MessageTag(true,true);// 消息是否保存是否计数，true true 保存且计数，false false 不保存不计数。\nvar propertys = [\"name\",\"age\"]; // 消息类中的属性名。\nRongIMClient.registerMessageType(messageName,objectName,mesasgeTag,propertys);\n</pre>\n\t\t\t\t\t\t<p>2.发送消息</p>\n\t\t\t\t\t\t<pre>\nvar conversationType = RongIMLib.ConversationType.PRIVATE; //私聊,其他会话选择相应的消息类型即可。\nvar msg = new RongIMClient.RegisterMessage.PersonMessage({name:\"zhang\",age:12});\ninstance.sendMessage(conversationType,targetId, msg, {\n    onSuccess: function (message) {\n    }\n});\n</pre>\n\t\t\t\t\t\t<p>3.接收消息</p>\n\t\t\t\t\t\t<p>接收消息与其他内置消息一致，在上文中提到的 setOnReceiveMessageListener 中 onReceived 获取</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<!--<div class=\"steps\">\n\t\t\t\t\t<h2>emoji 表情</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<pre>\n//获取全部表情\nvar emojis = RongIMLib.RongIMEmoji.emojis;\n//把表情循环添加进表情框中，这里假设是 body\nemojis.forEach(function(item){document.body.append(item)})\n//给每个表情绑定点击事件 获取当前点击表情的序号，这里随机假设是 nth\nvar nth = Math.round((emojis.length-1) * Math.random());\n//获取点击表情的内容，添加在用户输入框中\nvar emojiItem=emojis[nth].innerHTML;\nvar reg=/name=\"([[\\w\\W]+])\"/;\nemojiContent= reg.exec(emojiItem)[1];\n</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>-->\n\n\t\t\t\t<div class=\"helps\">\n\t\t\t\t\t<h3>常见问题: </h3>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li><a href=\"#\">emoji 的发送、接收、解码与显示处理逻辑</a></li>\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\" id=\"public\">\n\t\t\t<h2>9.公众号</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>1.准备工作</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>公众号创建流程: </p>\n\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t<li>1.在公众号系统: <a href=\"http://public.rongcloud.cn\">http://public.rongcloud.cn</a>  创建公众号并更新发布</li>\n\t\t\t\t\t\t\t<li>2.登录 开发者管理后台 <a href=\"https://developer.rongcloud.cn\">https://developer.rongcloud.cn</a> 通过 “公众服务平台 => 添加私有公众号”给 app 添加公众号,添加私有公众号需要应用申请上线，上线后页面右上角出现添加私有公众号按钮（公众号为填写公众平台 => 公众号设置 => 公众号，公众号识别码为公众平台 => APP 接入模式设置 => 私有模式 => 当前识别码）</li>\n\t\t\t\t\t\t\t<li>3.用户可以在第二步的添加结果里进行搜索和关注操作，关注后可以通过消息监听接受公众号的推送，用户也可以给公众号留言，具体细节参考页面里的示例代码和注释。</li>\n\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t<p>调试 demo: <a href=\"https://rongcloud.github.io/websdk-demo/api-test.html\">https://rongcloud.github.io/websdk-demo/api-test.html</a></p>\n\t\t\t\t\t\t<p>集成 demo: <a href=\"./public/public.html\">public.html</a></p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>2. 集成的思路</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>页面分配</p>\n\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t<li>0.公众号模板主页 <a href=\"./public/public.html\">public.html</a></li>\n\t\t\t\t\t\t\t<li>1.公众号列表页 <a href=\"./public/template/public-list.html\">public-list.html</a></li>\n\t\t\t\t\t\t\t<li>2.公众号搜索页 <a href=\"./public/template/public-search.html\">public-search.html</a></li>\n\t\t\t\t\t\t\t<li>3.公众号详情页 <a href=\"./public/template/public-info.html\">public-info.html</a></li>\n\t\t\t\t\t\t\t<li>4.公众号聊天页 <a href=\"./public/template/public-chat.html\">public-chat.html</a></li>\n\t\t\t\t\t\t\t<li>5.公众号推送文章页 <a href=\"./public/template/public-article.html\">public-article.html</a></li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>3.引入SDK，并完成初始化、链接云端</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>初始化参考: <a href=\"./init.js\">init.js</a></p>\n<pre>\nvar userInfo = {\n\tappKey: \"\",\n\ttoken: \"\"\n};\nvar callbacks = {\n\tCONNECTED: function (instance) {\n\t},\n\tSuccess: function (id) {\n\t},\n\tReceived: function (message) {\n\t}\n};\ninit(userInfo, callbacks);\n</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>4.公众号列表页</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>html: <a href=\"./public/template/public-list.html\">public-list.html</a></p>\n\t\t\t\t\t\t<p>js: <a href=\"./public/js/public-list.js\">public-list.js</a></p>\n\t\t\t\t\t\t<p>公众号列表数据模型 <a href=\"./public/public-mock-data.json\">public-mock-data.json</a> 中的 \"publicList\"</p>\n\t\t\t\t\t\t<p>变量解释: </p>\n\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t<li>conversationType : 7, 私有云里只有应用公众服务（MC） 8, 公有公众服务（MP）</li>\n\t\t\t\t\t\t\t<li>hasFollowed : 是否关注 </li>\n\t\t\t\t\t\t\t<li>introduction : 功能描述</li>\n\t\t\t\t\t\t\t<li>isGlobal : 是否全局</li>\n\t\t\t\t\t\t\t<li>menu : 自定义菜单</li>\n\t\t\t\t\t\t\t<li>name : 昵称</li>\n\t\t\t\t\t\t\t<li>portraitUri : 头像 url</li>\n\t\t\t\t\t\t\t<li>publicServiceId : 公众号 id</li>\n\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t<pre>\n//获取已关注公众号\nRongIMClient.getInstance().getPublicServiceList({\n\tonSuccess: function (list) {\n\t\tconsole.log(\"获取已关注公众号成功\");\n\t}\n});\n</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>5.公众号搜索页</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>html: <a href=\"./public/template/public-search.html\">public-search.html</a></p>\n\t\t\t\t\t\t<p>js: <a href=\"./public/js/public-search.js\">public-search.js</a></p>\n\t\t\t\t\t\t<p>公众号搜索数据模型 <a href=\"./public/public-mock-data.json\">public-mock-data.json</a> 中的 \"searchList\"</p>\n\t\t\t\t\t\t<pre>\n//根据用户输入关键字搜索未关注公众号\nvar keywords = this.stat.searchVal;\nvar searchType = 1; //[0-exact 1-fuzzy]\nRongIMClient.getInstance().searchPublicService(searchType, keywords, {\n\tonSuccess: function (list) {\n\t\t//console.log(\"查找公众号成功\");\n\t\t//list 为匹配到的所以结果\n\t\t//that.stat.searchList=list;\n\t\tvar listUnFollowed = [];\n\t\t$(list).each(function () {\n\t\t\tthis.hasFollowed == false && listUnFollowed.push(this);\n\t\t});\n\t}\n});\n</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>6.公众号详情页</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>html: <a href=\"./public/template/public-info.html\">public-info.html</a></p>\n\t\t\t\t\t\t<p>js: <a href=\"./public/js/public-info.js\">public-info.js</a></p>\n\t\t\t\t\t\t<p>公众号详情数据模型 <a href=\"./public/public-mock-data.json\">public-mock-data.json</a> \"searchList\" 中的对象</p>\n\t\t\t\t\t\t<pre>\n//订阅公众号\nvar publicServiceType = RongIMLib.ConversationType.PUBLIC_SERVICE;\nRongIMClient.getInstance().subscribePublicService(publicServiceType, publicServiceId, {\n\tonSuccess: function (list) {\n\t\tconsole.log(\"订阅公众号成功\");\n\t}\n});\n\n//取消订阅公众号\nRongIMClient.getInstance().unsubscribePublicService(publicServiceType, publicServiceId, {\n\tonSuccess: function (list) {\n\t\tconsole.log(\"取消订阅公众号成功\");\n\t}\n});\n</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>7.公众号聊天页</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>html: <a href=\"./public/template/public-chat.html\">public-chat.html</a></p>\n\t\t\t\t\t\t<p>js: <a href=\"./public/js/public-chat.js\">public-chat.js</a></p>\n\t\t\t\t\t\t<p>公众号回复用户消息在 <a href=\"http://public.rongcloud.cn\">公众平台</a> => 用户回复</p>\n\t\t\t\t\t\t<p>公众号聊天消息数据模型 <a href=\"./public/public-mock-data.json\">public-mock-data.json</a> \"msgList\" 中 \"messageType\" = \"TextMessage\" 为文本消息，\"messageType\" = \"PublicServiceMultiRichContentMessage\"为公众号推送多图文消息</p>\n\t\t\t\t\t\t<p>变量解释: </p>\n\t\t\t\t\t\t<ol>\n\t\t\t\t\t\t\t<li>messageDirection : 1, 发送消息方 2, 接收消息方</li>\n\t\t\t\t\t\t\t<li>messageType : 消息类型 </li>\n\t\t\t\t\t\t\t<li>articles : 公众号推送图文</li>\n\t\t\t\t\t\t\t<li>picurl : 文章预览图 url 地址</li>\n\t\t\t\t\t\t\t<li>title : 文章标题</li>\n\t\t\t\t\t\t\t<li>url : 文章地址</li>\n\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t<pre>\n//发送消息\nvar text = this.stat.sendMsgVal ;\nvar msg = new RongIMLib.TextMessage({content: text, extra: \"公众号\"});\nRongIMClient.getInstance().sendMessage(conversationtype, publicServiceId, msg, {\n\tonSuccess: function (message) {\n\t\t//发送成功后 渲染已发送消息\n\t\tthat.stat.msgList.push(message);\n\t}\n});\n</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"steps\">\n\t\t\t\t\t<h2>8.公众号推送文章页</h2>\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<p>html: <a href=\"./public/template/public-article.html\">public-article.html</a></p>\n\t\t\t\t\t\t<p>js: <a href=\"./public/js/public-article.js\">public-article.js</a></p>\n\t\t\t\t\t\t<p>公众号向用户推送文章在 <a href=\"http://public.rongcloud.cn\">公众平台</a> => 消息推送</p>\n\t\t\t\t\t\t<p>公众号推送文章地址为 <a href=\"./public/public-mock-data.json\">public-mock-data.json</a> \"msgList\" 中 \"messageType\" = \"PublicServiceMultiRichContentMessage\" 公众号推送多图文消息 articles.url</p>\n\t\t\t\t\t\t<pre>\n//文章内容嵌套在 iframe 中\n&lt;iframe :src=\"stat.articleUrl\">&lt;/iframe>\n</pre>\n\t\t\t\t\t</div>\n\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"helps\">\n\t\t\t\t\t<h3>常见问题: </h3>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li><a href=\"#\">公众号账号的维护添加</a></li>\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\n\t\t\t\t\n\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n\n\n<!--  \n1: 架构说明，收费服务说明，两个链接\n\t\tAppServer https://github.com/sealtalk/sealtalk-server\n\t\tServer开发文档  http://www.rongcloud.cn/docs/server.html\n\t2: 基本主要的流程\n\t\t引入SDK，初始化，监听消息，链接服务器，收发消息，会话，历史消息\n\t3: 所有API的文档和调用示例\n\t\thttps://shuise.github.io/tech-research/web-sdk-test/web-sdk-test.html\n\t\thttp://www.rongcloud.cn/docs/api/js/index.html\n\t4: 各种扩展，组件\n\t\t表情库 http://www.rongcloud.cn/docs/web.html#emoji\n\t\t声音库 http://www.rongcloud.cn/docs/web.html#voice\n\t\t上传组件 http://www.rongcloud.cn/docs/web.html#upload_widget\n\t\t商量个约定: 技术解决方案都叫组件，业务解决方案才叫插件，行么？\n\t5: 各种产品demo，插件\n\t\t聊天插件 http://www.rongcloud.cn/docs/web.html#im_widget\n\t\t客服插件 http://www.rongcloud.cn/docs/web.html#custom_service_widget\n\t\tVoIP  http://www.rongcloud.cn/docs/web.html#call\n\t\tIM（Web+PC）\n-->\n\n</body>\n</html>"
  },
  {
    "path": "integrate/init.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>token check</title>\n</head>\n<body>\n<style>\nbody{\n\tfont-size:80%;\n}\n.panel span{\n\tdisplay:inline-block;\t\n\twidth:60px;\n}\n.show{\n\twidth:98%;\n\tdisplay:inline-block;\n\toverflow:hidden;\n\tborder:1px solid #ccc;\n}\n.show h3{\n\ttext-indent:10px;\n}\n.show pre{\n\tborder-top:1px dotted #ccc;\n\tpadding:5px 0 0 10px;\n}\n</style>\n\n<script>\nfunction showResult(id,message){\n\tvar dom = document.getElementById(id);\n\tdom.innerHTML += '<pre>' + message.senderUserId + \":   \" +  message.content.content + '</pre>';\n\t//JSON.stringify(message,null,\"\\t\")\n}\t\n</script>\n\n\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.1.js\"></script>\n\n<script>\nfunction init(params,callbacks){\t\n\tvar appKey = params.appKey;\n\tvar token = params.token;\n\tvar navi = params.navi;\n\n\tif(navi !== \"\"){\n\t\t//私有云\n\t\tvar config = {\n\t\t\tnavi : navi\n\t\t}\n\t\tRongIMLib.RongIMClient.init(appKey,null,config);\n\t}else{\n\t\t//公有云\n\t\tRongIMLib.RongIMClient.init(appKey);\n\t}\n\n\tinstance = RongIMClient.getInstance();\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\tconsole.log(status);\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t            callbacks.getInstance && callbacks.getInstance(instance);\n\t\t            break;\n\t\t        }\n\t\t}\n\t});\n\n\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    console.log(\"新消息: \" + message.targetId);\n            console.log(message);\n            callbacks.receiveNewMessage && callbacks.receiveNewMessage(message);\n\t\t}\n\t});\n\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tcallbacks.getCurrentUser && callbacks.getCurrentUser({userId:userId});\n\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\t//console.log('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  console.log(\"=============================================\");\n\t\t  console.log(info);\n\t\t}\n\t});\n}\n\nfunction startInit(user,targetId){\n\tvar params = {\n\t\tappKey : getValue(\"appKey\"),\n\t\ttoken : getValue(\"token\"),\n\t\tnavi : getValue(\"navi\")\n\t};\n\n\tvar callbacks = {\n\t\tgetInstance : function(instance){\n\t\t\t//instance.sendMessage\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\tconsole.log(userInfo.userId);\n\t\t\talert(\"链接成功；userid=\" + userInfo.userId);\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t\tshowResult(\"show1\",message);\n\t\t}\n\t};\n\n\tinit(params,callbacks);\n}\n\nfunction getValue(id){\n\treturn document.getElementById(id).value;\n}\n</script>\n\n\n<h1>token check</h1>\n<div class=\"panel\" id=\"panel\">\n\t<p>\n\t\t<span>appkey</span>\n\t\t<input type=\"text\" id=\"appKey\" size=\"20\" value=\"8w7jv4qb78a9y\">\n\t</p>\n\t<p>\n\t\t<span>token</span>\n\t\t<input type=\"text\" id=\"token\" size=\"110\" value=\"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\">\n\t</p>\n\t<p>\n\t\t<span>navi</span>\n\t\t<input type=\"text\" id=\"navi\" size=\"20\" value=\"\"> <b>此配置项仅针对私有部署，公有云请置空，格式为 10.10.10.10:8080</b>\n\t</p>\n\t<p>\n\t\t<span>&#160;</span>\n\t\t<input type=\"button\" onclick=\"startInit()\" value=\"start check\">\n\t</p>\n</div>\n\n<p></p>\n\n<div class=\"show\" id=\"show1\">\n\t<h3>消息接收结果</h3>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "integrate/init.js",
    "content": "\nfunction init(userInfo,callbacks) {\n    if (!userInfo.appKey || !userInfo.token){\n        return false;\n    }\n\n    //公有云初始化\n    RongIMLib.RongIMClient.init(userInfo.appKey);\n    var instance = RongIMClient.getInstance();\n\n    //连接状态监听器\n    RongIMClient.setConnectionStatusListener({\n        onChanged: function (status) {\n            switch (status) {\n                case RongIMLib.ConnectionStatus.CONNECTED:\n                    console.log(\"链接成功 \");\n                    callbacks.CONNECTED && callbacks.CONNECTED(instance);\n                    break;\n                case RongIMLib.ConnectionStatus.CONNECTING:\n                    console.log('正在链接');\n                    break;\n                case RongIMLib.ConnectionStatus.DISCONNECTED:\n                    console.log('断开连接');\n                    break;\n                case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n                    console.log('其他设备登录');\n                    break;\n                case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n                    console.log('域名不正确');\n                    break;\n                case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n                    console.log('网络不可用');\n                    break;\n            }\n        }\n    });\n\n\n    RongIMClient.setOnReceiveMessageListener({\n        // 接收到的消息\n        onReceived: function (message) {\n            callbacks.Received && callbacks.Received(message);\n        }\n    });\n\n\n    //开始链接\n    RongIMClient.connect(userInfo.token, {\n        onSuccess: function (id) {\n            callbacks.Success && callbacks.Success(id);\n        },\n        onTokenIncorrect: function () {\n            console.log('token无效');\n        },\n        onError: function (errorCode) {\n            var info = '';\n            switch (errorCode) {\n                case RongIMLib.ErrorCode.TIMEOUT:\n                    info = '超时';\n                    break;\n                case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n                    info = '未知错误';\n                    break;\n                case RongIMLib.ErrorCode.UNACCEPTABLE_PaROTOCOL_VERSION:\n                    info = '不可接受的协议版本';\n                    break;\n                case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n                    info = 'appkey不正确';\n                    break;\n                case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n                    info = '服务器不可用';\n                    break;\n            }\n            console.log(info);\n        }\n    });\n\n}"
  },
  {
    "path": "integrate/integrate.css",
    "content": "*{\n\tmargin:0;\n\tpadding:0;\n\tlist-style:none;\n}\nh1{\n\tfont-size:150%;\n\tmargin-bottom: 0.5em;\n}\n\nh2{\n\tfont-size:120%;\n}\np{\n    font-size: 14px;\n}\nbody{\n\tfont-size:100%;\n\tfont-family:arial;\n}\n.wrap{\n\tmargin:1em;\n}\n.steps{\n\tborder-top:1px dotted #ccc;\n\tmargin:1em 0;\n\tpadding-top:0.5em;\n}\n.content{\n\tfont-size:14px;\n\tline-height:1.8;\n\tcolor:#333;\n\tmargin-left:1em;\n}\n.helps{\n\tmargin-top:1em;\n\tborder:1px solid skyblue;\n\tbackground:skyblue;\n\tpadding:10px;\n}\n.helps h3{\n\tfont-weight:400;\n\tfont-size:14px;\n}\n.helps ol{\n\tmargin-left:2em;\n}\npre{\n\tfont-family:verdana;\n\tborder:1px solid #ccc;\n\tbackground:#f5f5f5;\n\tpadding:0.5em;\n\tmargin:0.5em 0;\n}"
  },
  {
    "path": "integrate/lib/jquery-3.1.1.js",
    "content": "/*!\n * jQuery JavaScript Library v3.1.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2016-09-22T22:30Z\n */\n( function( global, factory ) {\n\n    \"use strict\";\n\n    if ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n        // For CommonJS and CommonJS-like environments where a proper `window`\n        // is present, execute the factory and get jQuery.\n        // For environments that do not have a `window` with a `document`\n        // (such as Node.js), expose a factory as module.exports.\n        // This accentuates the need for the creation of a real `window`.\n        // e.g. var jQuery = require(\"jquery\")(window);\n        // See ticket #14549 for more info.\n        module.exports = global.document ?\n            factory( global, true ) :\n            function( w ) {\n                if ( !w.document ) {\n                    throw new Error( \"jQuery requires a window with a document\" );\n                }\n                return factory( w );\n            };\n    } else {\n        factory( global );\n    }\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar document = window.document;\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\n\n\n    function DOMEval( code, doc ) {\n        doc = doc || document;\n\n        var script = doc.createElement( \"script\" );\n\n        script.text = code;\n        doc.head.appendChild( script ).parentNode.removeChild( script );\n    }\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n    version = \"3.1.1\",\n\n    // Define a local copy of jQuery\n    jQuery = function( selector, context ) {\n\n        // The jQuery object is actually just the init constructor 'enhanced'\n        // Need init if jQuery is called (just allow error to be thrown if not included)\n        return new jQuery.fn.init( selector, context );\n    },\n\n    // Support: Android <=4.0 only\n    // Make sure we trim BOM and NBSP\n    rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\n\n    // Matches dashed string for camelizing\n    rmsPrefix = /^-ms-/,\n    rdashAlpha = /-([a-z])/g,\n\n    // Used by jQuery.camelCase as callback to replace()\n    fcamelCase = function( all, letter ) {\n        return letter.toUpperCase();\n    };\n\njQuery.fn = jQuery.prototype = {\n\n    // The current version of jQuery being used\n    jquery: version,\n\n    constructor: jQuery,\n\n    // The default length of a jQuery object is 0\n    length: 0,\n\n    toArray: function() {\n        return slice.call( this );\n    },\n\n    // Get the Nth element in the matched element set OR\n    // Get the whole matched element set as a clean array\n    get: function( num ) {\n\n        // Return all the elements in a clean array\n        if ( num == null ) {\n            return slice.call( this );\n        }\n\n        // Return just the one element from the set\n        return num < 0 ? this[ num + this.length ] : this[ num ];\n    },\n\n    // Take an array of elements and push it onto the stack\n    // (returning the new matched element set)\n    pushStack: function( elems ) {\n\n        // Build a new jQuery matched element set\n        var ret = jQuery.merge( this.constructor(), elems );\n\n        // Add the old object onto the stack (as a reference)\n        ret.prevObject = this;\n\n        // Return the newly-formed element set\n        return ret;\n    },\n\n    // Execute a callback for every element in the matched set.\n    each: function( callback ) {\n        return jQuery.each( this, callback );\n    },\n\n    map: function( callback ) {\n        return this.pushStack( jQuery.map( this, function( elem, i ) {\n            return callback.call( elem, i, elem );\n        } ) );\n    },\n\n    slice: function() {\n        return this.pushStack( slice.apply( this, arguments ) );\n    },\n\n    first: function() {\n        return this.eq( 0 );\n    },\n\n    last: function() {\n        return this.eq( -1 );\n    },\n\n    eq: function( i ) {\n        var len = this.length,\n            j = +i + ( i < 0 ? len : 0 );\n        return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n    },\n\n    end: function() {\n        return this.prevObject || this.constructor();\n    },\n\n    // For internal use only.\n    // Behaves like an Array's method, not like a jQuery method.\n    push: push,\n    sort: arr.sort,\n    splice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n    var options, name, src, copy, copyIsArray, clone,\n        target = arguments[ 0 ] || {},\n        i = 1,\n        length = arguments.length,\n        deep = false;\n\n    // Handle a deep copy situation\n    if ( typeof target === \"boolean\" ) {\n        deep = target;\n\n        // Skip the boolean and the target\n        target = arguments[ i ] || {};\n        i++;\n    }\n\n    // Handle case when target is a string or something (possible in deep copy)\n    if ( typeof target !== \"object\" && !jQuery.isFunction( target ) ) {\n        target = {};\n    }\n\n    // Extend jQuery itself if only one argument is passed\n    if ( i === length ) {\n        target = this;\n        i--;\n    }\n\n    for ( ; i < length; i++ ) {\n\n        // Only deal with non-null/undefined values\n        if ( ( options = arguments[ i ] ) != null ) {\n\n            // Extend the base object\n            for ( name in options ) {\n                src = target[ name ];\n                copy = options[ name ];\n\n                // Prevent never-ending loop\n                if ( target === copy ) {\n                    continue;\n                }\n\n                // Recurse if we're merging plain objects or arrays\n                if ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n                    ( copyIsArray = jQuery.isArray( copy ) ) ) ) {\n\n                    if ( copyIsArray ) {\n                        copyIsArray = false;\n                        clone = src && jQuery.isArray( src ) ? src : [];\n\n                    } else {\n                        clone = src && jQuery.isPlainObject( src ) ? src : {};\n                    }\n\n                    // Never move original objects, clone them\n                    target[ name ] = jQuery.extend( deep, clone, copy );\n\n                // Don't bring in undefined values\n                } else if ( copy !== undefined ) {\n                    target[ name ] = copy;\n                }\n            }\n        }\n    }\n\n    // Return the modified object\n    return target;\n};\n\njQuery.extend( {\n\n    // Unique for each copy of jQuery on the page\n    expando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n    // Assume jQuery is ready without the ready module\n    isReady: true,\n\n    error: function( msg ) {\n        throw new Error( msg );\n    },\n\n    noop: function() {},\n\n    isFunction: function( obj ) {\n        return jQuery.type( obj ) === \"function\";\n    },\n\n    isArray: Array.isArray,\n\n    isWindow: function( obj ) {\n        return obj != null && obj === obj.window;\n    },\n\n    isNumeric: function( obj ) {\n\n        // As of jQuery 3.0, isNumeric is limited to\n        // strings and numbers (primitives or objects)\n        // that can be coerced to finite numbers (gh-2662)\n        var type = jQuery.type( obj );\n        return ( type === \"number\" || type === \"string\" ) &&\n\n            // parseFloat NaNs numeric-cast false positives (\"\")\n            // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n            // subtraction forces infinities to NaN\n            !isNaN( obj - parseFloat( obj ) );\n    },\n\n    isPlainObject: function( obj ) {\n        var proto, Ctor;\n\n        // Detect obvious negatives\n        // Use toString instead of jQuery.type to catch host objects\n        if ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n            return false;\n        }\n\n        proto = getProto( obj );\n\n        // Objects with no prototype (e.g., `Object.create( null )`) are plain\n        if ( !proto ) {\n            return true;\n        }\n\n        // Objects with prototype are plain iff they were constructed by a global Object function\n        Ctor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n        return typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n    },\n\n    isEmptyObject: function( obj ) {\n\n        /* eslint-disable no-unused-vars */\n        // See https://github.com/eslint/eslint/issues/6125\n        var name;\n\n        for ( name in obj ) {\n            return false;\n        }\n        return true;\n    },\n\n    type: function( obj ) {\n        if ( obj == null ) {\n            return obj + \"\";\n        }\n\n        // Support: Android <=2.3 only (functionish RegExp)\n        return typeof obj === \"object\" || typeof obj === \"function\" ?\n            class2type[ toString.call( obj ) ] || \"object\" :\n            typeof obj;\n    },\n\n    // Evaluates a script in a global context\n    globalEval: function( code ) {\n        DOMEval( code );\n    },\n\n    // Convert dashed to camelCase; used by the css and data modules\n    // Support: IE <=9 - 11, Edge 12 - 13\n    // Microsoft forgot to hump their vendor prefix (#9572)\n    camelCase: function( string ) {\n        return string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n    },\n\n    nodeName: function( elem, name ) {\n        return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n    },\n\n    each: function( obj, callback ) {\n        var length, i = 0;\n\n        if ( isArrayLike( obj ) ) {\n            length = obj.length;\n            for ( ; i < length; i++ ) {\n                if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n                    break;\n                }\n            }\n        } else {\n            for ( i in obj ) {\n                if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n                    break;\n                }\n            }\n        }\n\n        return obj;\n    },\n\n    // Support: Android <=4.0 only\n    trim: function( text ) {\n        return text == null ?\n            \"\" :\n            ( text + \"\" ).replace( rtrim, \"\" );\n    },\n\n    // results is for internal usage only\n    makeArray: function( arr, results ) {\n        var ret = results || [];\n\n        if ( arr != null ) {\n            if ( isArrayLike( Object( arr ) ) ) {\n                jQuery.merge( ret,\n                    typeof arr === \"string\" ?\n                    [ arr ] : arr\n                );\n            } else {\n                push.call( ret, arr );\n            }\n        }\n\n        return ret;\n    },\n\n    inArray: function( elem, arr, i ) {\n        return arr == null ? -1 : indexOf.call( arr, elem, i );\n    },\n\n    // Support: Android <=4.0 only, PhantomJS 1 only\n    // push.apply(_, arraylike) throws on ancient WebKit\n    merge: function( first, second ) {\n        var len = +second.length,\n            j = 0,\n            i = first.length;\n\n        for ( ; j < len; j++ ) {\n            first[ i++ ] = second[ j ];\n        }\n\n        first.length = i;\n\n        return first;\n    },\n\n    grep: function( elems, callback, invert ) {\n        var callbackInverse,\n            matches = [],\n            i = 0,\n            length = elems.length,\n            callbackExpect = !invert;\n\n        // Go through the array, only saving the items\n        // that pass the validator function\n        for ( ; i < length; i++ ) {\n            callbackInverse = !callback( elems[ i ], i );\n            if ( callbackInverse !== callbackExpect ) {\n                matches.push( elems[ i ] );\n            }\n        }\n\n        return matches;\n    },\n\n    // arg is for internal usage only\n    map: function( elems, callback, arg ) {\n        var length, value,\n            i = 0,\n            ret = [];\n\n        // Go through the array, translating each of the items to their new values\n        if ( isArrayLike( elems ) ) {\n            length = elems.length;\n            for ( ; i < length; i++ ) {\n                value = callback( elems[ i ], i, arg );\n\n                if ( value != null ) {\n                    ret.push( value );\n                }\n            }\n\n        // Go through every key on the object,\n        } else {\n            for ( i in elems ) {\n                value = callback( elems[ i ], i, arg );\n\n                if ( value != null ) {\n                    ret.push( value );\n                }\n            }\n        }\n\n        // Flatten any nested arrays\n        return concat.apply( [], ret );\n    },\n\n    // A global GUID counter for objects\n    guid: 1,\n\n    // Bind a function to a context, optionally partially applying any\n    // arguments.\n    proxy: function( fn, context ) {\n        var tmp, args, proxy;\n\n        if ( typeof context === \"string\" ) {\n            tmp = fn[ context ];\n            context = fn;\n            fn = tmp;\n        }\n\n        // Quick check to determine if target is callable, in the spec\n        // this throws a TypeError, but we will just return undefined.\n        if ( !jQuery.isFunction( fn ) ) {\n            return undefined;\n        }\n\n        // Simulated bind\n        args = slice.call( arguments, 2 );\n        proxy = function() {\n            return fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n        };\n\n        // Set the guid of unique handler to the same of original handler, so it can be removed\n        proxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n        return proxy;\n    },\n\n    now: Date.now,\n\n    // jQuery.support is not used in Core but other projects attach their\n    // properties to it so it needs to exist.\n    support: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n    jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( i, name ) {\n    class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n    // Support: real iOS 8.2 only (not reproducible in simulator)\n    // `in` check used to prevent JIT error (gh-2145)\n    // hasOwn isn't used here due to false negatives\n    // regarding Nodelist length in IE\n    var length = !!obj && \"length\" in obj && obj.length,\n        type = jQuery.type( obj );\n\n    if ( type === \"function\" || jQuery.isWindow( obj ) ) {\n        return false;\n    }\n\n    return type === \"array\" || length === 0 ||\n        typeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.3\n * https://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2016-08-08\n */\n(function( window ) {\n\nvar i,\n    support,\n    Expr,\n    getText,\n    isXML,\n    tokenize,\n    compile,\n    select,\n    outermostContext,\n    sortInput,\n    hasDuplicate,\n\n    // Local document vars\n    setDocument,\n    document,\n    docElem,\n    documentIsHTML,\n    rbuggyQSA,\n    rbuggyMatches,\n    matches,\n    contains,\n\n    // Instance-specific data\n    expando = \"sizzle\" + 1 * new Date(),\n    preferredDoc = window.document,\n    dirruns = 0,\n    done = 0,\n    classCache = createCache(),\n    tokenCache = createCache(),\n    compilerCache = createCache(),\n    sortOrder = function( a, b ) {\n        if ( a === b ) {\n            hasDuplicate = true;\n        }\n        return 0;\n    },\n\n    // Instance methods\n    hasOwn = ({}).hasOwnProperty,\n    arr = [],\n    pop = arr.pop,\n    push_native = arr.push,\n    push = arr.push,\n    slice = arr.slice,\n    // Use a stripped-down indexOf as it's faster than native\n    // https://jsperf.com/thor-indexof-vs-for/5\n    indexOf = function( list, elem ) {\n        var i = 0,\n            len = list.length;\n        for ( ; i < len; i++ ) {\n            if ( list[i] === elem ) {\n                return i;\n            }\n        }\n        return -1;\n    },\n\n    booleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n    // Regular expressions\n\n    // http://www.w3.org/TR/css3-selectors/#whitespace\n    whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n    // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n    identifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",\n\n    // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n    attributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n        // Operator (capture 2)\n        \"*([*^$|!~]?=)\" + whitespace +\n        // \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n        \"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n        \"*\\\\]\",\n\n    pseudos = \":(\" + identifier + \")(?:\\\\((\" +\n        // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n        // 1. quoted (capture 3; capture 4 or capture 5)\n        \"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n        // 2. simple (capture 6)\n        \"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n        // 3. anything else (capture 2)\n        \".*\" +\n        \")\\\\)|)\",\n\n    // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n    rwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n    rtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n    rcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n    rcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n    rattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*?)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n    rpseudo = new RegExp( pseudos ),\n    ridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n    matchExpr = {\n        \"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n        \"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n        \"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n        \"ATTR\": new RegExp( \"^\" + attributes ),\n        \"PSEUDO\": new RegExp( \"^\" + pseudos ),\n        \"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n            \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n            \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n        \"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n        // For use in libraries implementing .is()\n        // We use this for POS matching in `select`\n        \"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n            whitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n    },\n\n    rinputs = /^(?:input|select|textarea|button)$/i,\n    rheader = /^h\\d$/i,\n\n    rnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n    // Easily-parseable/retrievable ID or TAG or CLASS selectors\n    rquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n    rsibling = /[+~]/,\n\n    // CSS escapes\n    // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n    runescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n    funescape = function( _, escaped, escapedWhitespace ) {\n        var high = \"0x\" + escaped - 0x10000;\n        // NaN means non-codepoint\n        // Support: Firefox<24\n        // Workaround erroneous numeric interpretation of +\"0x\"\n        return high !== high || escapedWhitespace ?\n            escaped :\n            high < 0 ?\n                // BMP codepoint\n                String.fromCharCode( high + 0x10000 ) :\n                // Supplemental Plane codepoint (surrogate pair)\n                String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n    },\n\n    // CSS string/identifier serialization\n    // https://drafts.csswg.org/cssom/#common-serializing-idioms\n    rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n    fcssescape = function( ch, asCodePoint ) {\n        if ( asCodePoint ) {\n\n            // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n            if ( ch === \"\\0\" ) {\n                return \"\\uFFFD\";\n            }\n\n            // Control characters and (dependent upon position) numbers get escaped as code points\n            return ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n        }\n\n        // Other potentially-special ASCII characters get backslash-escaped\n        return \"\\\\\" + ch;\n    },\n\n    // Used for iframes\n    // See setDocument()\n    // Removing the function wrapper causes a \"Permission Denied\"\n    // error in IE\n    unloadHandler = function() {\n        setDocument();\n    },\n\n    disabledAncestor = addCombinator(\n        function( elem ) {\n            return elem.disabled === true && (\"form\" in elem || \"label\" in elem);\n        },\n        { dir: \"parentNode\", next: \"legend\" }\n    );\n\n// Optimize for push.apply( _, NodeList )\ntry {\n    push.apply(\n        (arr = slice.call( preferredDoc.childNodes )),\n        preferredDoc.childNodes\n    );\n    // Support: Android<4.0\n    // Detect silently failing push.apply\n    arr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n    push = { apply: arr.length ?\n\n        // Leverage slice if possible\n        function( target, els ) {\n            push_native.apply( target, slice.call(els) );\n        } :\n\n        // Support: IE<9\n        // Otherwise append directly\n        function( target, els ) {\n            var j = target.length,\n                i = 0;\n            // Can't trust NodeList.length\n            while ( (target[j++] = els[i++]) ) {}\n            target.length = j - 1;\n        }\n    };\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n    var m, i, elem, nid, match, groups, newSelector,\n        newContext = context && context.ownerDocument,\n\n        // nodeType defaults to 9, since context defaults to document\n        nodeType = context ? context.nodeType : 9;\n\n    results = results || [];\n\n    // Return early from calls with invalid selector or context\n    if ( typeof selector !== \"string\" || !selector ||\n        nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n        return results;\n    }\n\n    // Try to shortcut find operations (as opposed to filters) in HTML documents\n    if ( !seed ) {\n\n        if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n            setDocument( context );\n        }\n        context = context || document;\n\n        if ( documentIsHTML ) {\n\n            // If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n            // (excepting DocumentFragment context, where the methods don't exist)\n            if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\n                // ID selector\n                if ( (m = match[1]) ) {\n\n                    // Document context\n                    if ( nodeType === 9 ) {\n                        if ( (elem = context.getElementById( m )) ) {\n\n                            // Support: IE, Opera, Webkit\n                            // TODO: identify versions\n                            // getElementById can match elements by name instead of ID\n                            if ( elem.id === m ) {\n                                results.push( elem );\n                                return results;\n                            }\n                        } else {\n                            return results;\n                        }\n\n                    // Element context\n                    } else {\n\n                        // Support: IE, Opera, Webkit\n                        // TODO: identify versions\n                        // getElementById can match elements by name instead of ID\n                        if ( newContext && (elem = newContext.getElementById( m )) &&\n                            contains( context, elem ) &&\n                            elem.id === m ) {\n\n                            results.push( elem );\n                            return results;\n                        }\n                    }\n\n                // Type selector\n                } else if ( match[2] ) {\n                    push.apply( results, context.getElementsByTagName( selector ) );\n                    return results;\n\n                // Class selector\n                } else if ( (m = match[3]) && support.getElementsByClassName &&\n                    context.getElementsByClassName ) {\n\n                    push.apply( results, context.getElementsByClassName( m ) );\n                    return results;\n                }\n            }\n\n            // Take advantage of querySelectorAll\n            if ( support.qsa &&\n                !compilerCache[ selector + \" \" ] &&\n                (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\n                if ( nodeType !== 1 ) {\n                    newContext = context;\n                    newSelector = selector;\n\n                // qSA looks outside Element context, which is not what we want\n                // Thanks to Andrew Dupont for this workaround technique\n                // Support: IE <=8\n                // Exclude object elements\n                } else if ( context.nodeName.toLowerCase() !== \"object\" ) {\n\n                    // Capture the context ID, setting it first if necessary\n                    if ( (nid = context.getAttribute( \"id\" )) ) {\n                        nid = nid.replace( rcssescape, fcssescape );\n                    } else {\n                        context.setAttribute( \"id\", (nid = expando) );\n                    }\n\n                    // Prefix every selector in the list\n                    groups = tokenize( selector );\n                    i = groups.length;\n                    while ( i-- ) {\n                        groups[i] = \"#\" + nid + \" \" + toSelector( groups[i] );\n                    }\n                    newSelector = groups.join( \",\" );\n\n                    // Expand context for sibling selectors\n                    newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n                        context;\n                }\n\n                if ( newSelector ) {\n                    try {\n                        push.apply( results,\n                            newContext.querySelectorAll( newSelector )\n                        );\n                        return results;\n                    } catch ( qsaError ) {\n                    } finally {\n                        if ( nid === expando ) {\n                            context.removeAttribute( \"id\" );\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    // All others\n    return select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *  property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *  deleting the oldest entry\n */\nfunction createCache() {\n    var keys = [];\n\n    function cache( key, value ) {\n        // Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n        if ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n            // Only keep the most recent entries\n            delete cache[ keys.shift() ];\n        }\n        return (cache[ key + \" \" ] = value);\n    }\n    return cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n    fn[ expando ] = true;\n    return fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n    var el = document.createElement(\"fieldset\");\n\n    try {\n        return !!fn( el );\n    } catch (e) {\n        return false;\n    } finally {\n        // Remove from its parent by default\n        if ( el.parentNode ) {\n            el.parentNode.removeChild( el );\n        }\n        // release memory in IE\n        el = null;\n    }\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n    var arr = attrs.split(\"|\"),\n        i = arr.length;\n\n    while ( i-- ) {\n        Expr.attrHandle[ arr[i] ] = handler;\n    }\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n    var cur = b && a,\n        diff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n            a.sourceIndex - b.sourceIndex;\n\n    // Use IE sourceIndex if available on both nodes\n    if ( diff ) {\n        return diff;\n    }\n\n    // Check if b follows a\n    if ( cur ) {\n        while ( (cur = cur.nextSibling) ) {\n            if ( cur === b ) {\n                return -1;\n            }\n        }\n    }\n\n    return a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n    return function( elem ) {\n        var name = elem.nodeName.toLowerCase();\n        return name === \"input\" && elem.type === type;\n    };\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n    return function( elem ) {\n        var name = elem.nodeName.toLowerCase();\n        return (name === \"input\" || name === \"button\") && elem.type === type;\n    };\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n    // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n    return function( elem ) {\n\n        // Only certain elements can match :enabled or :disabled\n        // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n        // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n        if ( \"form\" in elem ) {\n\n            // Check for inherited disabledness on relevant non-disabled elements:\n            // * listed form-associated elements in a disabled fieldset\n            //   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n            //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n            // * option elements in a disabled optgroup\n            //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n            // All such elements have a \"form\" property.\n            if ( elem.parentNode && elem.disabled === false ) {\n\n                // Option elements defer to a parent optgroup if present\n                if ( \"label\" in elem ) {\n                    if ( \"label\" in elem.parentNode ) {\n                        return elem.parentNode.disabled === disabled;\n                    } else {\n                        return elem.disabled === disabled;\n                    }\n                }\n\n                // Support: IE 6 - 11\n                // Use the isDisabled shortcut property to check for disabled fieldset ancestors\n                return elem.isDisabled === disabled ||\n\n                    // Where there is no isDisabled, check manually\n                    /* jshint -W018 */\n                    elem.isDisabled !== !disabled &&\n                        disabledAncestor( elem ) === disabled;\n            }\n\n            return elem.disabled === disabled;\n\n        // Try to winnow out elements that can't be disabled before trusting the disabled property.\n        // Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n        // even exist on them, let alone have a boolean value.\n        } else if ( \"label\" in elem ) {\n            return elem.disabled === disabled;\n        }\n\n        // Remaining elements are neither :enabled nor :disabled\n        return false;\n    };\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n    return markFunction(function( argument ) {\n        argument = +argument;\n        return markFunction(function( seed, matches ) {\n            var j,\n                matchIndexes = fn( [], seed.length, argument ),\n                i = matchIndexes.length;\n\n            // Match elements found at the specified indexes\n            while ( i-- ) {\n                if ( seed[ (j = matchIndexes[i]) ] ) {\n                    seed[j] = !(matches[j] = seed[j]);\n                }\n            }\n        });\n    });\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n    return context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n    // documentElement is verified for cases where it doesn't yet exist\n    // (such as loading iframes in IE - #4833)\n    var documentElement = elem && (elem.ownerDocument || elem).documentElement;\n    return documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n    var hasCompare, subWindow,\n        doc = node ? node.ownerDocument || node : preferredDoc;\n\n    // Return early if doc is invalid or already selected\n    if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n        return document;\n    }\n\n    // Update global variables\n    document = doc;\n    docElem = document.documentElement;\n    documentIsHTML = !isXML( document );\n\n    // Support: IE 9-11, Edge\n    // Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n    if ( preferredDoc !== document &&\n        (subWindow = document.defaultView) && subWindow.top !== subWindow ) {\n\n        // Support: IE 11, Edge\n        if ( subWindow.addEventListener ) {\n            subWindow.addEventListener( \"unload\", unloadHandler, false );\n\n        // Support: IE 9 - 10 only\n        } else if ( subWindow.attachEvent ) {\n            subWindow.attachEvent( \"onunload\", unloadHandler );\n        }\n    }\n\n    /* Attributes\n    ---------------------------------------------------------------------- */\n\n    // Support: IE<8\n    // Verify that getAttribute really returns attributes and not properties\n    // (excepting IE8 booleans)\n    support.attributes = assert(function( el ) {\n        el.className = \"i\";\n        return !el.getAttribute(\"className\");\n    });\n\n    /* getElement(s)By*\n    ---------------------------------------------------------------------- */\n\n    // Check if getElementsByTagName(\"*\") returns only elements\n    support.getElementsByTagName = assert(function( el ) {\n        el.appendChild( document.createComment(\"\") );\n        return !el.getElementsByTagName(\"*\").length;\n    });\n\n    // Support: IE<9\n    support.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n    // Support: IE<10\n    // Check if getElementById returns elements by name\n    // The broken getElementById methods don't pick up programmatically-set names,\n    // so use a roundabout getElementsByName test\n    support.getById = assert(function( el ) {\n        docElem.appendChild( el ).id = expando;\n        return !document.getElementsByName || !document.getElementsByName( expando ).length;\n    });\n\n    // ID filter and find\n    if ( support.getById ) {\n        Expr.filter[\"ID\"] = function( id ) {\n            var attrId = id.replace( runescape, funescape );\n            return function( elem ) {\n                return elem.getAttribute(\"id\") === attrId;\n            };\n        };\n        Expr.find[\"ID\"] = function( id, context ) {\n            if ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n                var elem = context.getElementById( id );\n                return elem ? [ elem ] : [];\n            }\n        };\n    } else {\n        Expr.filter[\"ID\"] =  function( id ) {\n            var attrId = id.replace( runescape, funescape );\n            return function( elem ) {\n                var node = typeof elem.getAttributeNode !== \"undefined\" &&\n                    elem.getAttributeNode(\"id\");\n                return node && node.value === attrId;\n            };\n        };\n\n        // Support: IE 6 - 7 only\n        // getElementById is not reliable as a find shortcut\n        Expr.find[\"ID\"] = function( id, context ) {\n            if ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n                var node, i, elems,\n                    elem = context.getElementById( id );\n\n                if ( elem ) {\n\n                    // Verify the id attribute\n                    node = elem.getAttributeNode(\"id\");\n                    if ( node && node.value === id ) {\n                        return [ elem ];\n                    }\n\n                    // Fall back on getElementsByName\n                    elems = context.getElementsByName( id );\n                    i = 0;\n                    while ( (elem = elems[i++]) ) {\n                        node = elem.getAttributeNode(\"id\");\n                        if ( node && node.value === id ) {\n                            return [ elem ];\n                        }\n                    }\n                }\n\n                return [];\n            }\n        };\n    }\n\n    // Tag\n    Expr.find[\"TAG\"] = support.getElementsByTagName ?\n        function( tag, context ) {\n            if ( typeof context.getElementsByTagName !== \"undefined\" ) {\n                return context.getElementsByTagName( tag );\n\n            // DocumentFragment nodes don't have gEBTN\n            } else if ( support.qsa ) {\n                return context.querySelectorAll( tag );\n            }\n        } :\n\n        function( tag, context ) {\n            var elem,\n                tmp = [],\n                i = 0,\n                // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n                results = context.getElementsByTagName( tag );\n\n            // Filter out possible comments\n            if ( tag === \"*\" ) {\n                while ( (elem = results[i++]) ) {\n                    if ( elem.nodeType === 1 ) {\n                        tmp.push( elem );\n                    }\n                }\n\n                return tmp;\n            }\n            return results;\n        };\n\n    // Class\n    Expr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n        if ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n            return context.getElementsByClassName( className );\n        }\n    };\n\n    /* QSA/matchesSelector\n    ---------------------------------------------------------------------- */\n\n    // QSA and matchesSelector support\n\n    // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n    rbuggyMatches = [];\n\n    // qSa(:focus) reports false when true (Chrome 21)\n    // We allow this because of a bug in IE8/9 that throws an error\n    // whenever `document.activeElement` is accessed on an iframe\n    // So, we allow :focus to pass through QSA all the time to avoid the IE error\n    // See https://bugs.jquery.com/ticket/13378\n    rbuggyQSA = [];\n\n    if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {\n        // Build QSA regex\n        // Regex strategy adopted from Diego Perini\n        assert(function( el ) {\n            // Select is set to empty string on purpose\n            // This is to test IE's treatment of not explicitly\n            // setting a boolean content attribute,\n            // since its presence should be enough\n            // https://bugs.jquery.com/ticket/12359\n            docElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n                \"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n                \"<option selected=''></option></select>\";\n\n            // Support: IE8, Opera 11-12.16\n            // Nothing should be selected when empty strings follow ^= or $= or *=\n            // The test attribute must be unknown in Opera but \"safe\" for WinRT\n            // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n            if ( el.querySelectorAll(\"[msallowcapture^='']\").length ) {\n                rbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n            }\n\n            // Support: IE8\n            // Boolean attributes and \"value\" are not treated correctly\n            if ( !el.querySelectorAll(\"[selected]\").length ) {\n                rbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n            }\n\n            // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n            if ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n                rbuggyQSA.push(\"~=\");\n            }\n\n            // Webkit/Opera - :checked should return selected option elements\n            // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n            // IE8 throws error here and will not see later tests\n            if ( !el.querySelectorAll(\":checked\").length ) {\n                rbuggyQSA.push(\":checked\");\n            }\n\n            // Support: Safari 8+, iOS 8+\n            // https://bugs.webkit.org/show_bug.cgi?id=136851\n            // In-page `selector#id sibling-combinator selector` fails\n            if ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n                rbuggyQSA.push(\".#.+[+~]\");\n            }\n        });\n\n        assert(function( el ) {\n            el.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n                \"<select disabled='disabled'><option/></select>\";\n\n            // Support: Windows 8 Native Apps\n            // The type and name attributes are restricted during .innerHTML assignment\n            var input = document.createElement(\"input\");\n            input.setAttribute( \"type\", \"hidden\" );\n            el.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n            // Support: IE8\n            // Enforce case-sensitivity of name attribute\n            if ( el.querySelectorAll(\"[name=d]\").length ) {\n                rbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n            }\n\n            // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n            // IE8 throws error here and will not see later tests\n            if ( el.querySelectorAll(\":enabled\").length !== 2 ) {\n                rbuggyQSA.push( \":enabled\", \":disabled\" );\n            }\n\n            // Support: IE9-11+\n            // IE's :disabled selector does not pick up the children of disabled fieldsets\n            docElem.appendChild( el ).disabled = true;\n            if ( el.querySelectorAll(\":disabled\").length !== 2 ) {\n                rbuggyQSA.push( \":enabled\", \":disabled\" );\n            }\n\n            // Opera 10-11 does not throw on post-comma invalid pseudos\n            el.querySelectorAll(\"*,:x\");\n            rbuggyQSA.push(\",.*:\");\n        });\n    }\n\n    if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\n        docElem.webkitMatchesSelector ||\n        docElem.mozMatchesSelector ||\n        docElem.oMatchesSelector ||\n        docElem.msMatchesSelector) )) ) {\n\n        assert(function( el ) {\n            // Check to see if it's possible to do matchesSelector\n            // on a disconnected node (IE 9)\n            support.disconnectedMatch = matches.call( el, \"*\" );\n\n            // This should fail with an exception\n            // Gecko does not error, returns false instead\n            matches.call( el, \"[s!='']:x\" );\n            rbuggyMatches.push( \"!=\", pseudos );\n        });\n    }\n\n    rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n    rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n    /* Contains\n    ---------------------------------------------------------------------- */\n    hasCompare = rnative.test( docElem.compareDocumentPosition );\n\n    // Element contains another\n    // Purposefully self-exclusive\n    // As in, an element does not contain itself\n    contains = hasCompare || rnative.test( docElem.contains ) ?\n        function( a, b ) {\n            var adown = a.nodeType === 9 ? a.documentElement : a,\n                bup = b && b.parentNode;\n            return a === bup || !!( bup && bup.nodeType === 1 && (\n                adown.contains ?\n                    adown.contains( bup ) :\n                    a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n            ));\n        } :\n        function( a, b ) {\n            if ( b ) {\n                while ( (b = b.parentNode) ) {\n                    if ( b === a ) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        };\n\n    /* Sorting\n    ---------------------------------------------------------------------- */\n\n    // Document order sorting\n    sortOrder = hasCompare ?\n    function( a, b ) {\n\n        // Flag for duplicate removal\n        if ( a === b ) {\n            hasDuplicate = true;\n            return 0;\n        }\n\n        // Sort on method existence if only one input has compareDocumentPosition\n        var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n        if ( compare ) {\n            return compare;\n        }\n\n        // Calculate position if both inputs belong to the same document\n        compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n            a.compareDocumentPosition( b ) :\n\n            // Otherwise we know they are disconnected\n            1;\n\n        // Disconnected nodes\n        if ( compare & 1 ||\n            (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n            // Choose the first element that is related to our preferred document\n            if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n                return -1;\n            }\n            if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n                return 1;\n            }\n\n            // Maintain original order\n            return sortInput ?\n                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n                0;\n        }\n\n        return compare & 4 ? -1 : 1;\n    } :\n    function( a, b ) {\n        // Exit early if the nodes are identical\n        if ( a === b ) {\n            hasDuplicate = true;\n            return 0;\n        }\n\n        var cur,\n            i = 0,\n            aup = a.parentNode,\n            bup = b.parentNode,\n            ap = [ a ],\n            bp = [ b ];\n\n        // Parentless nodes are either documents or disconnected\n        if ( !aup || !bup ) {\n            return a === document ? -1 :\n                b === document ? 1 :\n                aup ? -1 :\n                bup ? 1 :\n                sortInput ?\n                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n                0;\n\n        // If the nodes are siblings, we can do a quick check\n        } else if ( aup === bup ) {\n            return siblingCheck( a, b );\n        }\n\n        // Otherwise we need full lists of their ancestors for comparison\n        cur = a;\n        while ( (cur = cur.parentNode) ) {\n            ap.unshift( cur );\n        }\n        cur = b;\n        while ( (cur = cur.parentNode) ) {\n            bp.unshift( cur );\n        }\n\n        // Walk down the tree looking for a discrepancy\n        while ( ap[i] === bp[i] ) {\n            i++;\n        }\n\n        return i ?\n            // Do a sibling check if the nodes have a common ancestor\n            siblingCheck( ap[i], bp[i] ) :\n\n            // Otherwise nodes in our document sort first\n            ap[i] === preferredDoc ? -1 :\n            bp[i] === preferredDoc ? 1 :\n            0;\n    };\n\n    return document;\n};\n\nSizzle.matches = function( expr, elements ) {\n    return Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n    // Set document vars if needed\n    if ( ( elem.ownerDocument || elem ) !== document ) {\n        setDocument( elem );\n    }\n\n    // Make sure that attribute selectors are quoted\n    expr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n    if ( support.matchesSelector && documentIsHTML &&\n        !compilerCache[ expr + \" \" ] &&\n        ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n        ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n        try {\n            var ret = matches.call( elem, expr );\n\n            // IE 9's matchesSelector returns false on disconnected nodes\n            if ( ret || support.disconnectedMatch ||\n                    // As well, disconnected nodes are said to be in a document\n                    // fragment in IE 9\n                    elem.document && elem.document.nodeType !== 11 ) {\n                return ret;\n            }\n        } catch (e) {}\n    }\n\n    return Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n    // Set document vars if needed\n    if ( ( context.ownerDocument || context ) !== document ) {\n        setDocument( context );\n    }\n    return contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n    // Set document vars if needed\n    if ( ( elem.ownerDocument || elem ) !== document ) {\n        setDocument( elem );\n    }\n\n    var fn = Expr.attrHandle[ name.toLowerCase() ],\n        // Don't get fooled by Object.prototype properties (jQuery #13807)\n        val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n            fn( elem, name, !documentIsHTML ) :\n            undefined;\n\n    return val !== undefined ?\n        val :\n        support.attributes || !documentIsHTML ?\n            elem.getAttribute( name ) :\n            (val = elem.getAttributeNode(name)) && val.specified ?\n                val.value :\n                null;\n};\n\nSizzle.escape = function( sel ) {\n    return (sel + \"\").replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n    throw new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n    var elem,\n        duplicates = [],\n        j = 0,\n        i = 0;\n\n    // Unless we *know* we can detect duplicates, assume their presence\n    hasDuplicate = !support.detectDuplicates;\n    sortInput = !support.sortStable && results.slice( 0 );\n    results.sort( sortOrder );\n\n    if ( hasDuplicate ) {\n        while ( (elem = results[i++]) ) {\n            if ( elem === results[ i ] ) {\n                j = duplicates.push( i );\n            }\n        }\n        while ( j-- ) {\n            results.splice( duplicates[ j ], 1 );\n        }\n    }\n\n    // Clear input after sorting to release objects\n    // See https://github.com/jquery/sizzle/pull/225\n    sortInput = null;\n\n    return results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n    var node,\n        ret = \"\",\n        i = 0,\n        nodeType = elem.nodeType;\n\n    if ( !nodeType ) {\n        // If no nodeType, this is expected to be an array\n        while ( (node = elem[i++]) ) {\n            // Do not traverse comment nodes\n            ret += getText( node );\n        }\n    } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n        // Use textContent for elements\n        // innerText usage removed for consistency of new lines (jQuery #11153)\n        if ( typeof elem.textContent === \"string\" ) {\n            return elem.textContent;\n        } else {\n            // Traverse its children\n            for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n                ret += getText( elem );\n            }\n        }\n    } else if ( nodeType === 3 || nodeType === 4 ) {\n        return elem.nodeValue;\n    }\n    // Do not include comment or processing instruction nodes\n\n    return ret;\n};\n\nExpr = Sizzle.selectors = {\n\n    // Can be adjusted by the user\n    cacheLength: 50,\n\n    createPseudo: markFunction,\n\n    match: matchExpr,\n\n    attrHandle: {},\n\n    find: {},\n\n    relative: {\n        \">\": { dir: \"parentNode\", first: true },\n        \" \": { dir: \"parentNode\" },\n        \"+\": { dir: \"previousSibling\", first: true },\n        \"~\": { dir: \"previousSibling\" }\n    },\n\n    preFilter: {\n        \"ATTR\": function( match ) {\n            match[1] = match[1].replace( runescape, funescape );\n\n            // Move the given value to match[3] whether quoted or unquoted\n            match[3] = ( match[3] || match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n            if ( match[2] === \"~=\" ) {\n                match[3] = \" \" + match[3] + \" \";\n            }\n\n            return match.slice( 0, 4 );\n        },\n\n        \"CHILD\": function( match ) {\n            /* matches from matchExpr[\"CHILD\"]\n                1 type (only|nth|...)\n                2 what (child|of-type)\n                3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n                4 xn-component of xn+y argument ([+-]?\\d*n|)\n                5 sign of xn-component\n                6 x of xn-component\n                7 sign of y-component\n                8 y of y-component\n            */\n            match[1] = match[1].toLowerCase();\n\n            if ( match[1].slice( 0, 3 ) === \"nth\" ) {\n                // nth-* requires argument\n                if ( !match[3] ) {\n                    Sizzle.error( match[0] );\n                }\n\n                // numeric x and y parameters for Expr.filter.CHILD\n                // remember that false/true cast respectively to 0/1\n                match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n                match[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n            // other types prohibit arguments\n            } else if ( match[3] ) {\n                Sizzle.error( match[0] );\n            }\n\n            return match;\n        },\n\n        \"PSEUDO\": function( match ) {\n            var excess,\n                unquoted = !match[6] && match[2];\n\n            if ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n                return null;\n            }\n\n            // Accept quoted arguments as-is\n            if ( match[3] ) {\n                match[2] = match[4] || match[5] || \"\";\n\n            // Strip excess characters from unquoted arguments\n            } else if ( unquoted && rpseudo.test( unquoted ) &&\n                // Get excess from tokenize (recursively)\n                (excess = tokenize( unquoted, true )) &&\n                // advance to the next closing parenthesis\n                (excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n                // excess is a negative index\n                match[0] = match[0].slice( 0, excess );\n                match[2] = unquoted.slice( 0, excess );\n            }\n\n            // Return only captures needed by the pseudo filter method (type and argument)\n            return match.slice( 0, 3 );\n        }\n    },\n\n    filter: {\n\n        \"TAG\": function( nodeNameSelector ) {\n            var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n            return nodeNameSelector === \"*\" ?\n                function() { return true; } :\n                function( elem ) {\n                    return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n                };\n        },\n\n        \"CLASS\": function( className ) {\n            var pattern = classCache[ className + \" \" ];\n\n            return pattern ||\n                (pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n                classCache( className, function( elem ) {\n                    return pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\" );\n                });\n        },\n\n        \"ATTR\": function( name, operator, check ) {\n            return function( elem ) {\n                var result = Sizzle.attr( elem, name );\n\n                if ( result == null ) {\n                    return operator === \"!=\";\n                }\n                if ( !operator ) {\n                    return true;\n                }\n\n                result += \"\";\n\n                return operator === \"=\" ? result === check :\n                    operator === \"!=\" ? result !== check :\n                    operator === \"^=\" ? check && result.indexOf( check ) === 0 :\n                    operator === \"*=\" ? check && result.indexOf( check ) > -1 :\n                    operator === \"$=\" ? check && result.slice( -check.length ) === check :\n                    operator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n                    operator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n                    false;\n            };\n        },\n\n        \"CHILD\": function( type, what, argument, first, last ) {\n            var simple = type.slice( 0, 3 ) !== \"nth\",\n                forward = type.slice( -4 ) !== \"last\",\n                ofType = what === \"of-type\";\n\n            return first === 1 && last === 0 ?\n\n                // Shortcut for :nth-*(n)\n                function( elem ) {\n                    return !!elem.parentNode;\n                } :\n\n                function( elem, context, xml ) {\n                    var cache, uniqueCache, outerCache, node, nodeIndex, start,\n                        dir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n                        parent = elem.parentNode,\n                        name = ofType && elem.nodeName.toLowerCase(),\n                        useCache = !xml && !ofType,\n                        diff = false;\n\n                    if ( parent ) {\n\n                        // :(first|last|only)-(child|of-type)\n                        if ( simple ) {\n                            while ( dir ) {\n                                node = elem;\n                                while ( (node = node[ dir ]) ) {\n                                    if ( ofType ?\n                                        node.nodeName.toLowerCase() === name :\n                                        node.nodeType === 1 ) {\n\n                                        return false;\n                                    }\n                                }\n                                // Reverse direction for :only-* (if we haven't yet done so)\n                                start = dir = type === \"only\" && !start && \"nextSibling\";\n                            }\n                            return true;\n                        }\n\n                        start = [ forward ? parent.firstChild : parent.lastChild ];\n\n                        // non-xml :nth-child(...) stores cache data on `parent`\n                        if ( forward && useCache ) {\n\n                            // Seek `elem` from a previously-cached index\n\n                            // ...in a gzip-friendly way\n                            node = parent;\n                            outerCache = node[ expando ] || (node[ expando ] = {});\n\n                            // Support: IE <9 only\n                            // Defend against cloned attroperties (jQuery gh-1709)\n                            uniqueCache = outerCache[ node.uniqueID ] ||\n                                (outerCache[ node.uniqueID ] = {});\n\n                            cache = uniqueCache[ type ] || [];\n                            nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n                            diff = nodeIndex && cache[ 2 ];\n                            node = nodeIndex && parent.childNodes[ nodeIndex ];\n\n                            while ( (node = ++nodeIndex && node && node[ dir ] ||\n\n                                // Fallback to seeking `elem` from the start\n                                (diff = nodeIndex = 0) || start.pop()) ) {\n\n                                // When found, cache indexes on `parent` and break\n                                if ( node.nodeType === 1 && ++diff && node === elem ) {\n                                    uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n                                    break;\n                                }\n                            }\n\n                        } else {\n                            // Use previously-cached element index if available\n                            if ( useCache ) {\n                                // ...in a gzip-friendly way\n                                node = elem;\n                                outerCache = node[ expando ] || (node[ expando ] = {});\n\n                                // Support: IE <9 only\n                                // Defend against cloned attroperties (jQuery gh-1709)\n                                uniqueCache = outerCache[ node.uniqueID ] ||\n                                    (outerCache[ node.uniqueID ] = {});\n\n                                cache = uniqueCache[ type ] || [];\n                                nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n                                diff = nodeIndex;\n                            }\n\n                            // xml :nth-child(...)\n                            // or :nth-last-child(...) or :nth(-last)?-of-type(...)\n                            if ( diff === false ) {\n                                // Use the same loop as above to seek `elem` from the start\n                                while ( (node = ++nodeIndex && node && node[ dir ] ||\n                                    (diff = nodeIndex = 0) || start.pop()) ) {\n\n                                    if ( ( ofType ?\n                                        node.nodeName.toLowerCase() === name :\n                                        node.nodeType === 1 ) &&\n                                        ++diff ) {\n\n                                        // Cache the index of each encountered element\n                                        if ( useCache ) {\n                                            outerCache = node[ expando ] || (node[ expando ] = {});\n\n                                            // Support: IE <9 only\n                                            // Defend against cloned attroperties (jQuery gh-1709)\n                                            uniqueCache = outerCache[ node.uniqueID ] ||\n                                                (outerCache[ node.uniqueID ] = {});\n\n                                            uniqueCache[ type ] = [ dirruns, diff ];\n                                        }\n\n                                        if ( node === elem ) {\n                                            break;\n                                        }\n                                    }\n                                }\n                            }\n                        }\n\n                        // Incorporate the offset, then check against cycle size\n                        diff -= last;\n                        return diff === first || ( diff % first === 0 && diff / first >= 0 );\n                    }\n                };\n        },\n\n        \"PSEUDO\": function( pseudo, argument ) {\n            // pseudo-class names are case-insensitive\n            // http://www.w3.org/TR/selectors/#pseudo-classes\n            // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n            // Remember that setFilters inherits from pseudos\n            var args,\n                fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n                    Sizzle.error( \"unsupported pseudo: \" + pseudo );\n\n            // The user may use createPseudo to indicate that\n            // arguments are needed to create the filter function\n            // just as Sizzle does\n            if ( fn[ expando ] ) {\n                return fn( argument );\n            }\n\n            // But maintain support for old signatures\n            if ( fn.length > 1 ) {\n                args = [ pseudo, pseudo, \"\", argument ];\n                return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n                    markFunction(function( seed, matches ) {\n                        var idx,\n                            matched = fn( seed, argument ),\n                            i = matched.length;\n                        while ( i-- ) {\n                            idx = indexOf( seed, matched[i] );\n                            seed[ idx ] = !( matches[ idx ] = matched[i] );\n                        }\n                    }) :\n                    function( elem ) {\n                        return fn( elem, 0, args );\n                    };\n            }\n\n            return fn;\n        }\n    },\n\n    pseudos: {\n        // Potentially complex pseudos\n        \"not\": markFunction(function( selector ) {\n            // Trim the selector passed to compile\n            // to avoid treating leading and trailing\n            // spaces as combinators\n            var input = [],\n                results = [],\n                matcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n            return matcher[ expando ] ?\n                markFunction(function( seed, matches, context, xml ) {\n                    var elem,\n                        unmatched = matcher( seed, null, xml, [] ),\n                        i = seed.length;\n\n                    // Match elements unmatched by `matcher`\n                    while ( i-- ) {\n                        if ( (elem = unmatched[i]) ) {\n                            seed[i] = !(matches[i] = elem);\n                        }\n                    }\n                }) :\n                function( elem, context, xml ) {\n                    input[0] = elem;\n                    matcher( input, null, xml, results );\n                    // Don't keep the element (issue #299)\n                    input[0] = null;\n                    return !results.pop();\n                };\n        }),\n\n        \"has\": markFunction(function( selector ) {\n            return function( elem ) {\n                return Sizzle( selector, elem ).length > 0;\n            };\n        }),\n\n        \"contains\": markFunction(function( text ) {\n            text = text.replace( runescape, funescape );\n            return function( elem ) {\n                return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n            };\n        }),\n\n        // \"Whether an element is represented by a :lang() selector\n        // is based solely on the element's language value\n        // being equal to the identifier C,\n        // or beginning with the identifier C immediately followed by \"-\".\n        // The matching of C against the element's language value is performed case-insensitively.\n        // The identifier C does not have to be a valid language name.\"\n        // http://www.w3.org/TR/selectors/#lang-pseudo\n        \"lang\": markFunction( function( lang ) {\n            // lang value must be a valid identifier\n            if ( !ridentifier.test(lang || \"\") ) {\n                Sizzle.error( \"unsupported lang: \" + lang );\n            }\n            lang = lang.replace( runescape, funescape ).toLowerCase();\n            return function( elem ) {\n                var elemLang;\n                do {\n                    if ( (elemLang = documentIsHTML ?\n                        elem.lang :\n                        elem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n                        elemLang = elemLang.toLowerCase();\n                        return elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n                    }\n                } while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n                return false;\n            };\n        }),\n\n        // Miscellaneous\n        \"target\": function( elem ) {\n            var hash = window.location && window.location.hash;\n            return hash && hash.slice( 1 ) === elem.id;\n        },\n\n        \"root\": function( elem ) {\n            return elem === docElem;\n        },\n\n        \"focus\": function( elem ) {\n            return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n        },\n\n        // Boolean properties\n        \"enabled\": createDisabledPseudo( false ),\n        \"disabled\": createDisabledPseudo( true ),\n\n        \"checked\": function( elem ) {\n            // In CSS3, :checked should return both checked and selected elements\n            // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n            var nodeName = elem.nodeName.toLowerCase();\n            return (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n        },\n\n        \"selected\": function( elem ) {\n            // Accessing this property makes selected-by-default\n            // options in Safari work properly\n            if ( elem.parentNode ) {\n                elem.parentNode.selectedIndex;\n            }\n\n            return elem.selected === true;\n        },\n\n        // Contents\n        \"empty\": function( elem ) {\n            // http://www.w3.org/TR/selectors/#empty-pseudo\n            // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n            //   but not by others (comment: 8; processing instruction: 7; etc.)\n            // nodeType < 6 works because attributes (2) do not appear as children\n            for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n                if ( elem.nodeType < 6 ) {\n                    return false;\n                }\n            }\n            return true;\n        },\n\n        \"parent\": function( elem ) {\n            return !Expr.pseudos[\"empty\"]( elem );\n        },\n\n        // Element/input types\n        \"header\": function( elem ) {\n            return rheader.test( elem.nodeName );\n        },\n\n        \"input\": function( elem ) {\n            return rinputs.test( elem.nodeName );\n        },\n\n        \"button\": function( elem ) {\n            var name = elem.nodeName.toLowerCase();\n            return name === \"input\" && elem.type === \"button\" || name === \"button\";\n        },\n\n        \"text\": function( elem ) {\n            var attr;\n            return elem.nodeName.toLowerCase() === \"input\" &&\n                elem.type === \"text\" &&\n\n                // Support: IE<8\n                // New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n                ( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\n        },\n\n        // Position-in-collection\n        \"first\": createPositionalPseudo(function() {\n            return [ 0 ];\n        }),\n\n        \"last\": createPositionalPseudo(function( matchIndexes, length ) {\n            return [ length - 1 ];\n        }),\n\n        \"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n            return [ argument < 0 ? argument + length : argument ];\n        }),\n\n        \"even\": createPositionalPseudo(function( matchIndexes, length ) {\n            var i = 0;\n            for ( ; i < length; i += 2 ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        }),\n\n        \"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n            var i = 1;\n            for ( ; i < length; i += 2 ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        }),\n\n        \"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n            var i = argument < 0 ? argument + length : argument;\n            for ( ; --i >= 0; ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        }),\n\n        \"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n            var i = argument < 0 ? argument + length : argument;\n            for ( ; ++i < length; ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        })\n    }\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n    Expr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n    Expr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n    var matched, match, tokens, type,\n        soFar, groups, preFilters,\n        cached = tokenCache[ selector + \" \" ];\n\n    if ( cached ) {\n        return parseOnly ? 0 : cached.slice( 0 );\n    }\n\n    soFar = selector;\n    groups = [];\n    preFilters = Expr.preFilter;\n\n    while ( soFar ) {\n\n        // Comma and first run\n        if ( !matched || (match = rcomma.exec( soFar )) ) {\n            if ( match ) {\n                // Don't consume trailing commas as valid\n                soFar = soFar.slice( match[0].length ) || soFar;\n            }\n            groups.push( (tokens = []) );\n        }\n\n        matched = false;\n\n        // Combinators\n        if ( (match = rcombinators.exec( soFar )) ) {\n            matched = match.shift();\n            tokens.push({\n                value: matched,\n                // Cast descendant combinators to space\n                type: match[0].replace( rtrim, \" \" )\n            });\n            soFar = soFar.slice( matched.length );\n        }\n\n        // Filters\n        for ( type in Expr.filter ) {\n            if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n                (match = preFilters[ type ]( match ))) ) {\n                matched = match.shift();\n                tokens.push({\n                    value: matched,\n                    type: type,\n                    matches: match\n                });\n                soFar = soFar.slice( matched.length );\n            }\n        }\n\n        if ( !matched ) {\n            break;\n        }\n    }\n\n    // Return the length of the invalid excess\n    // if we're just parsing\n    // Otherwise, throw an error or return tokens\n    return parseOnly ?\n        soFar.length :\n        soFar ?\n            Sizzle.error( selector ) :\n            // Cache the tokens\n            tokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n    var i = 0,\n        len = tokens.length,\n        selector = \"\";\n    for ( ; i < len; i++ ) {\n        selector += tokens[i].value;\n    }\n    return selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n    var dir = combinator.dir,\n        skip = combinator.next,\n        key = skip || dir,\n        checkNonElements = base && key === \"parentNode\",\n        doneName = done++;\n\n    return combinator.first ?\n        // Check against closest ancestor/preceding element\n        function( elem, context, xml ) {\n            while ( (elem = elem[ dir ]) ) {\n                if ( elem.nodeType === 1 || checkNonElements ) {\n                    return matcher( elem, context, xml );\n                }\n            }\n            return false;\n        } :\n\n        // Check against all ancestor/preceding elements\n        function( elem, context, xml ) {\n            var oldCache, uniqueCache, outerCache,\n                newCache = [ dirruns, doneName ];\n\n            // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n            if ( xml ) {\n                while ( (elem = elem[ dir ]) ) {\n                    if ( elem.nodeType === 1 || checkNonElements ) {\n                        if ( matcher( elem, context, xml ) ) {\n                            return true;\n                        }\n                    }\n                }\n            } else {\n                while ( (elem = elem[ dir ]) ) {\n                    if ( elem.nodeType === 1 || checkNonElements ) {\n                        outerCache = elem[ expando ] || (elem[ expando ] = {});\n\n                        // Support: IE <9 only\n                        // Defend against cloned attroperties (jQuery gh-1709)\n                        uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});\n\n                        if ( skip && skip === elem.nodeName.toLowerCase() ) {\n                            elem = elem[ dir ] || elem;\n                        } else if ( (oldCache = uniqueCache[ key ]) &&\n                            oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n                            // Assign to newCache so results back-propagate to previous elements\n                            return (newCache[ 2 ] = oldCache[ 2 ]);\n                        } else {\n                            // Reuse newcache so results back-propagate to previous elements\n                            uniqueCache[ key ] = newCache;\n\n                            // A match means we're done; a fail means we have to keep checking\n                            if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n            return false;\n        };\n}\n\nfunction elementMatcher( matchers ) {\n    return matchers.length > 1 ?\n        function( elem, context, xml ) {\n            var i = matchers.length;\n            while ( i-- ) {\n                if ( !matchers[i]( elem, context, xml ) ) {\n                    return false;\n                }\n            }\n            return true;\n        } :\n        matchers[0];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n    var i = 0,\n        len = contexts.length;\n    for ( ; i < len; i++ ) {\n        Sizzle( selector, contexts[i], results );\n    }\n    return results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n    var elem,\n        newUnmatched = [],\n        i = 0,\n        len = unmatched.length,\n        mapped = map != null;\n\n    for ( ; i < len; i++ ) {\n        if ( (elem = unmatched[i]) ) {\n            if ( !filter || filter( elem, context, xml ) ) {\n                newUnmatched.push( elem );\n                if ( mapped ) {\n                    map.push( i );\n                }\n            }\n        }\n    }\n\n    return newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n    if ( postFilter && !postFilter[ expando ] ) {\n        postFilter = setMatcher( postFilter );\n    }\n    if ( postFinder && !postFinder[ expando ] ) {\n        postFinder = setMatcher( postFinder, postSelector );\n    }\n    return markFunction(function( seed, results, context, xml ) {\n        var temp, i, elem,\n            preMap = [],\n            postMap = [],\n            preexisting = results.length,\n\n            // Get initial elements from seed or context\n            elems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n            // Prefilter to get matcher input, preserving a map for seed-results synchronization\n            matcherIn = preFilter && ( seed || !selector ) ?\n                condense( elems, preMap, preFilter, context, xml ) :\n                elems,\n\n            matcherOut = matcher ?\n                // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n                postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n                    // ...intermediate processing is necessary\n                    [] :\n\n                    // ...otherwise use results directly\n                    results :\n                matcherIn;\n\n        // Find primary matches\n        if ( matcher ) {\n            matcher( matcherIn, matcherOut, context, xml );\n        }\n\n        // Apply postFilter\n        if ( postFilter ) {\n            temp = condense( matcherOut, postMap );\n            postFilter( temp, [], context, xml );\n\n            // Un-match failing elements by moving them back to matcherIn\n            i = temp.length;\n            while ( i-- ) {\n                if ( (elem = temp[i]) ) {\n                    matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n                }\n            }\n        }\n\n        if ( seed ) {\n            if ( postFinder || preFilter ) {\n                if ( postFinder ) {\n                    // Get the final matcherOut by condensing this intermediate into postFinder contexts\n                    temp = [];\n                    i = matcherOut.length;\n                    while ( i-- ) {\n                        if ( (elem = matcherOut[i]) ) {\n                            // Restore matcherIn since elem is not yet a final match\n                            temp.push( (matcherIn[i] = elem) );\n                        }\n                    }\n                    postFinder( null, (matcherOut = []), temp, xml );\n                }\n\n                // Move matched elements from seed to results to keep them synchronized\n                i = matcherOut.length;\n                while ( i-- ) {\n                    if ( (elem = matcherOut[i]) &&\n                        (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\n\n                        seed[temp] = !(results[temp] = elem);\n                    }\n                }\n            }\n\n        // Add elements to results, through postFinder if defined\n        } else {\n            matcherOut = condense(\n                matcherOut === results ?\n                    matcherOut.splice( preexisting, matcherOut.length ) :\n                    matcherOut\n            );\n            if ( postFinder ) {\n                postFinder( null, results, matcherOut, xml );\n            } else {\n                push.apply( results, matcherOut );\n            }\n        }\n    });\n}\n\nfunction matcherFromTokens( tokens ) {\n    var checkContext, matcher, j,\n        len = tokens.length,\n        leadingRelative = Expr.relative[ tokens[0].type ],\n        implicitRelative = leadingRelative || Expr.relative[\" \"],\n        i = leadingRelative ? 1 : 0,\n\n        // The foundational matcher ensures that elements are reachable from top-level context(s)\n        matchContext = addCombinator( function( elem ) {\n            return elem === checkContext;\n        }, implicitRelative, true ),\n        matchAnyContext = addCombinator( function( elem ) {\n            return indexOf( checkContext, elem ) > -1;\n        }, implicitRelative, true ),\n        matchers = [ function( elem, context, xml ) {\n            var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n                (checkContext = context).nodeType ?\n                    matchContext( elem, context, xml ) :\n                    matchAnyContext( elem, context, xml ) );\n            // Avoid hanging onto element (issue #299)\n            checkContext = null;\n            return ret;\n        } ];\n\n    for ( ; i < len; i++ ) {\n        if ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n            matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n        } else {\n            matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n            // Return special upon seeing a positional matcher\n            if ( matcher[ expando ] ) {\n                // Find the next relative operator (if any) for proper handling\n                j = ++i;\n                for ( ; j < len; j++ ) {\n                    if ( Expr.relative[ tokens[j].type ] ) {\n                        break;\n                    }\n                }\n                return setMatcher(\n                    i > 1 && elementMatcher( matchers ),\n                    i > 1 && toSelector(\n                        // If the preceding token was a descendant combinator, insert an implicit any-element `*`\n                        tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n                    ).replace( rtrim, \"$1\" ),\n                    matcher,\n                    i < j && matcherFromTokens( tokens.slice( i, j ) ),\n                    j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n                    j < len && toSelector( tokens )\n                );\n            }\n            matchers.push( matcher );\n        }\n    }\n\n    return elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n    var bySet = setMatchers.length > 0,\n        byElement = elementMatchers.length > 0,\n        superMatcher = function( seed, context, xml, results, outermost ) {\n            var elem, j, matcher,\n                matchedCount = 0,\n                i = \"0\",\n                unmatched = seed && [],\n                setMatched = [],\n                contextBackup = outermostContext,\n                // We must always have either seed elements or outermost context\n                elems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\n                // Use integer dirruns iff this is the outermost matcher\n                dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\n                len = elems.length;\n\n            if ( outermost ) {\n                outermostContext = context === document || context || outermost;\n            }\n\n            // Add elements passing elementMatchers directly to results\n            // Support: IE<9, Safari\n            // Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n            for ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n                if ( byElement && elem ) {\n                    j = 0;\n                    if ( !context && elem.ownerDocument !== document ) {\n                        setDocument( elem );\n                        xml = !documentIsHTML;\n                    }\n                    while ( (matcher = elementMatchers[j++]) ) {\n                        if ( matcher( elem, context || document, xml) ) {\n                            results.push( elem );\n                            break;\n                        }\n                    }\n                    if ( outermost ) {\n                        dirruns = dirrunsUnique;\n                    }\n                }\n\n                // Track unmatched elements for set filters\n                if ( bySet ) {\n                    // They will have gone through all possible matchers\n                    if ( (elem = !matcher && elem) ) {\n                        matchedCount--;\n                    }\n\n                    // Lengthen the array for every element, matched or not\n                    if ( seed ) {\n                        unmatched.push( elem );\n                    }\n                }\n            }\n\n            // `i` is now the count of elements visited above, and adding it to `matchedCount`\n            // makes the latter nonnegative.\n            matchedCount += i;\n\n            // Apply set filters to unmatched elements\n            // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n            // equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n            // no element matchers and no seed.\n            // Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n            // case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n            // numerically zero.\n            if ( bySet && i !== matchedCount ) {\n                j = 0;\n                while ( (matcher = setMatchers[j++]) ) {\n                    matcher( unmatched, setMatched, context, xml );\n                }\n\n                if ( seed ) {\n                    // Reintegrate element matches to eliminate the need for sorting\n                    if ( matchedCount > 0 ) {\n                        while ( i-- ) {\n                            if ( !(unmatched[i] || setMatched[i]) ) {\n                                setMatched[i] = pop.call( results );\n                            }\n                        }\n                    }\n\n                    // Discard index placeholder values to get only actual matches\n                    setMatched = condense( setMatched );\n                }\n\n                // Add matches to results\n                push.apply( results, setMatched );\n\n                // Seedless set matches succeeding multiple successful matchers stipulate sorting\n                if ( outermost && !seed && setMatched.length > 0 &&\n                    ( matchedCount + setMatchers.length ) > 1 ) {\n\n                    Sizzle.uniqueSort( results );\n                }\n            }\n\n            // Override manipulation of globals by nested matchers\n            if ( outermost ) {\n                dirruns = dirrunsUnique;\n                outermostContext = contextBackup;\n            }\n\n            return unmatched;\n        };\n\n    return bySet ?\n        markFunction( superMatcher ) :\n        superMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n    var i,\n        setMatchers = [],\n        elementMatchers = [],\n        cached = compilerCache[ selector + \" \" ];\n\n    if ( !cached ) {\n        // Generate a function of recursive functions that can be used to check each element\n        if ( !match ) {\n            match = tokenize( selector );\n        }\n        i = match.length;\n        while ( i-- ) {\n            cached = matcherFromTokens( match[i] );\n            if ( cached[ expando ] ) {\n                setMatchers.push( cached );\n            } else {\n                elementMatchers.push( cached );\n            }\n        }\n\n        // Cache the compiled function\n        cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n        // Save selector and tokenization\n        cached.selector = selector;\n    }\n    return cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n    var i, tokens, token, type, find,\n        compiled = typeof selector === \"function\" && selector,\n        match = !seed && tokenize( (selector = compiled.selector || selector) );\n\n    results = results || [];\n\n    // Try to minimize operations if there is only one selector in the list and no seed\n    // (the latter of which guarantees us context)\n    if ( match.length === 1 ) {\n\n        // Reduce context if the leading compound selector is an ID\n        tokens = match[0] = match[0].slice( 0 );\n        if ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n                context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {\n\n            context = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n            if ( !context ) {\n                return results;\n\n            // Precompiled matchers will still verify ancestry, so step up a level\n            } else if ( compiled ) {\n                context = context.parentNode;\n            }\n\n            selector = selector.slice( tokens.shift().value.length );\n        }\n\n        // Fetch a seed set for right-to-left matching\n        i = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n        while ( i-- ) {\n            token = tokens[i];\n\n            // Abort if we hit a combinator\n            if ( Expr.relative[ (type = token.type) ] ) {\n                break;\n            }\n            if ( (find = Expr.find[ type ]) ) {\n                // Search, expanding context for leading sibling combinators\n                if ( (seed = find(\n                    token.matches[0].replace( runescape, funescape ),\n                    rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n                )) ) {\n\n                    // If seed is empty or no tokens remain, we can return early\n                    tokens.splice( i, 1 );\n                    selector = seed.length && toSelector( tokens );\n                    if ( !selector ) {\n                        push.apply( results, seed );\n                        return results;\n                    }\n\n                    break;\n                }\n            }\n        }\n    }\n\n    // Compile and execute a filtering function if one is not provided\n    // Provide `match` to avoid retokenization if we modified the selector above\n    ( compiled || compile( selector, match ) )(\n        seed,\n        context,\n        !documentIsHTML,\n        results,\n        !context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n    );\n    return results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( el ) {\n    // Should return 1, but returns 4 (following)\n    return el.compareDocumentPosition( document.createElement(\"fieldset\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( el ) {\n    el.innerHTML = \"<a href='#'></a>\";\n    return el.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n    addHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n        if ( !isXML ) {\n            return elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n        }\n    });\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( el ) {\n    el.innerHTML = \"<input/>\";\n    el.firstChild.setAttribute( \"value\", \"\" );\n    return el.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n    addHandle( \"value\", function( elem, name, isXML ) {\n        if ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n            return elem.defaultValue;\n        }\n    });\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( el ) {\n    return el.getAttribute(\"disabled\") == null;\n}) ) {\n    addHandle( booleans, function( elem, name, isXML ) {\n        var val;\n        if ( !isXML ) {\n            return elem[ name ] === true ? name.toLowerCase() :\n                    (val = elem.getAttributeNode( name )) && val.specified ?\n                    val.value :\n                null;\n        }\n    });\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n    var matched = [],\n        truncate = until !== undefined;\n\n    while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n        if ( elem.nodeType === 1 ) {\n            if ( truncate && jQuery( elem ).is( until ) ) {\n                break;\n            }\n            matched.push( elem );\n        }\n    }\n    return matched;\n};\n\n\nvar siblings = function( n, elem ) {\n    var matched = [];\n\n    for ( ; n; n = n.nextSibling ) {\n        if ( n.nodeType === 1 && n !== elem ) {\n            matched.push( n );\n        }\n    }\n\n    return matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\nvar risSimple = /^.[^:#\\[\\.,]*$/;\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n    if ( jQuery.isFunction( qualifier ) ) {\n        return jQuery.grep( elements, function( elem, i ) {\n            return !!qualifier.call( elem, i, elem ) !== not;\n        } );\n    }\n\n    // Single element\n    if ( qualifier.nodeType ) {\n        return jQuery.grep( elements, function( elem ) {\n            return ( elem === qualifier ) !== not;\n        } );\n    }\n\n    // Arraylike of elements (jQuery, arguments, Array)\n    if ( typeof qualifier !== \"string\" ) {\n        return jQuery.grep( elements, function( elem ) {\n            return ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n        } );\n    }\n\n    // Simple selector that can be filtered directly, removing non-Elements\n    if ( risSimple.test( qualifier ) ) {\n        return jQuery.filter( qualifier, elements, not );\n    }\n\n    // Complex selector, compare the two sets, removing non-Elements\n    qualifier = jQuery.filter( qualifier, elements );\n    return jQuery.grep( elements, function( elem ) {\n        return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;\n    } );\n}\n\njQuery.filter = function( expr, elems, not ) {\n    var elem = elems[ 0 ];\n\n    if ( not ) {\n        expr = \":not(\" + expr + \")\";\n    }\n\n    if ( elems.length === 1 && elem.nodeType === 1 ) {\n        return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n    }\n\n    return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n        return elem.nodeType === 1;\n    } ) );\n};\n\njQuery.fn.extend( {\n    find: function( selector ) {\n        var i, ret,\n            len = this.length,\n            self = this;\n\n        if ( typeof selector !== \"string\" ) {\n            return this.pushStack( jQuery( selector ).filter( function() {\n                for ( i = 0; i < len; i++ ) {\n                    if ( jQuery.contains( self[ i ], this ) ) {\n                        return true;\n                    }\n                }\n            } ) );\n        }\n\n        ret = this.pushStack( [] );\n\n        for ( i = 0; i < len; i++ ) {\n            jQuery.find( selector, self[ i ], ret );\n        }\n\n        return len > 1 ? jQuery.uniqueSort( ret ) : ret;\n    },\n    filter: function( selector ) {\n        return this.pushStack( winnow( this, selector || [], false ) );\n    },\n    not: function( selector ) {\n        return this.pushStack( winnow( this, selector || [], true ) );\n    },\n    is: function( selector ) {\n        return !!winnow(\n            this,\n\n            // If this is a positional/relative selector, check membership in the returned set\n            // so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n            typeof selector === \"string\" && rneedsContext.test( selector ) ?\n                jQuery( selector ) :\n                selector || [],\n            false\n        ).length;\n    }\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n    // A simple way to check for HTML strings\n    // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n    // Strict HTML recognition (#11290: must start with <)\n    // Shortcut simple #id case for speed\n    rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n    init = jQuery.fn.init = function( selector, context, root ) {\n        var match, elem;\n\n        // HANDLE: $(\"\"), $(null), $(undefined), $(false)\n        if ( !selector ) {\n            return this;\n        }\n\n        // Method init() accepts an alternate rootjQuery\n        // so migrate can support jQuery.sub (gh-2101)\n        root = root || rootjQuery;\n\n        // Handle HTML strings\n        if ( typeof selector === \"string\" ) {\n            if ( selector[ 0 ] === \"<\" &&\n                selector[ selector.length - 1 ] === \">\" &&\n                selector.length >= 3 ) {\n\n                // Assume that strings that start and end with <> are HTML and skip the regex check\n                match = [ null, selector, null ];\n\n            } else {\n                match = rquickExpr.exec( selector );\n            }\n\n            // Match html or make sure no context is specified for #id\n            if ( match && ( match[ 1 ] || !context ) ) {\n\n                // HANDLE: $(html) -> $(array)\n                if ( match[ 1 ] ) {\n                    context = context instanceof jQuery ? context[ 0 ] : context;\n\n                    // Option to run scripts is true for back-compat\n                    // Intentionally let the error be thrown if parseHTML is not present\n                    jQuery.merge( this, jQuery.parseHTML(\n                        match[ 1 ],\n                        context && context.nodeType ? context.ownerDocument || context : document,\n                        true\n                    ) );\n\n                    // HANDLE: $(html, props)\n                    if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n                        for ( match in context ) {\n\n                            // Properties of context are called as methods if possible\n                            if ( jQuery.isFunction( this[ match ] ) ) {\n                                this[ match ]( context[ match ] );\n\n                            // ...and otherwise set as attributes\n                            } else {\n                                this.attr( match, context[ match ] );\n                            }\n                        }\n                    }\n\n                    return this;\n\n                // HANDLE: $(#id)\n                } else {\n                    elem = document.getElementById( match[ 2 ] );\n\n                    if ( elem ) {\n\n                        // Inject the element directly into the jQuery object\n                        this[ 0 ] = elem;\n                        this.length = 1;\n                    }\n                    return this;\n                }\n\n            // HANDLE: $(expr, $(...))\n            } else if ( !context || context.jquery ) {\n                return ( context || root ).find( selector );\n\n            // HANDLE: $(expr, context)\n            // (which is just equivalent to: $(context).find(expr)\n            } else {\n                return this.constructor( context ).find( selector );\n            }\n\n        // HANDLE: $(DOMElement)\n        } else if ( selector.nodeType ) {\n            this[ 0 ] = selector;\n            this.length = 1;\n            return this;\n\n        // HANDLE: $(function)\n        // Shortcut for document ready\n        } else if ( jQuery.isFunction( selector ) ) {\n            return root.ready !== undefined ?\n                root.ready( selector ) :\n\n                // Execute immediately if ready is not present\n                selector( jQuery );\n        }\n\n        return jQuery.makeArray( selector, this );\n    };\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n    // Methods guaranteed to produce a unique set when starting from a unique set\n    guaranteedUnique = {\n        children: true,\n        contents: true,\n        next: true,\n        prev: true\n    };\n\njQuery.fn.extend( {\n    has: function( target ) {\n        var targets = jQuery( target, this ),\n            l = targets.length;\n\n        return this.filter( function() {\n            var i = 0;\n            for ( ; i < l; i++ ) {\n                if ( jQuery.contains( this, targets[ i ] ) ) {\n                    return true;\n                }\n            }\n        } );\n    },\n\n    closest: function( selectors, context ) {\n        var cur,\n            i = 0,\n            l = this.length,\n            matched = [],\n            targets = typeof selectors !== \"string\" && jQuery( selectors );\n\n        // Positional selectors never match, since there's no _selection_ context\n        if ( !rneedsContext.test( selectors ) ) {\n            for ( ; i < l; i++ ) {\n                for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n                    // Always skip document fragments\n                    if ( cur.nodeType < 11 && ( targets ?\n                        targets.index( cur ) > -1 :\n\n                        // Don't pass non-elements to Sizzle\n                        cur.nodeType === 1 &&\n                            jQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n                        matched.push( cur );\n                        break;\n                    }\n                }\n            }\n        }\n\n        return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n    },\n\n    // Determine the position of an element within the set\n    index: function( elem ) {\n\n        // No argument, return index in parent\n        if ( !elem ) {\n            return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n        }\n\n        // Index in selector\n        if ( typeof elem === \"string\" ) {\n            return indexOf.call( jQuery( elem ), this[ 0 ] );\n        }\n\n        // Locate the position of the desired element\n        return indexOf.call( this,\n\n            // If it receives a jQuery object, the first element is used\n            elem.jquery ? elem[ 0 ] : elem\n        );\n    },\n\n    add: function( selector, context ) {\n        return this.pushStack(\n            jQuery.uniqueSort(\n                jQuery.merge( this.get(), jQuery( selector, context ) )\n            )\n        );\n    },\n\n    addBack: function( selector ) {\n        return this.add( selector == null ?\n            this.prevObject : this.prevObject.filter( selector )\n        );\n    }\n} );\n\nfunction sibling( cur, dir ) {\n    while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n    return cur;\n}\n\njQuery.each( {\n    parent: function( elem ) {\n        var parent = elem.parentNode;\n        return parent && parent.nodeType !== 11 ? parent : null;\n    },\n    parents: function( elem ) {\n        return dir( elem, \"parentNode\" );\n    },\n    parentsUntil: function( elem, i, until ) {\n        return dir( elem, \"parentNode\", until );\n    },\n    next: function( elem ) {\n        return sibling( elem, \"nextSibling\" );\n    },\n    prev: function( elem ) {\n        return sibling( elem, \"previousSibling\" );\n    },\n    nextAll: function( elem ) {\n        return dir( elem, \"nextSibling\" );\n    },\n    prevAll: function( elem ) {\n        return dir( elem, \"previousSibling\" );\n    },\n    nextUntil: function( elem, i, until ) {\n        return dir( elem, \"nextSibling\", until );\n    },\n    prevUntil: function( elem, i, until ) {\n        return dir( elem, \"previousSibling\", until );\n    },\n    siblings: function( elem ) {\n        return siblings( ( elem.parentNode || {} ).firstChild, elem );\n    },\n    children: function( elem ) {\n        return siblings( elem.firstChild );\n    },\n    contents: function( elem ) {\n        return elem.contentDocument || jQuery.merge( [], elem.childNodes );\n    }\n}, function( name, fn ) {\n    jQuery.fn[ name ] = function( until, selector ) {\n        var matched = jQuery.map( this, fn, until );\n\n        if ( name.slice( -5 ) !== \"Until\" ) {\n            selector = until;\n        }\n\n        if ( selector && typeof selector === \"string\" ) {\n            matched = jQuery.filter( selector, matched );\n        }\n\n        if ( this.length > 1 ) {\n\n            // Remove duplicates\n            if ( !guaranteedUnique[ name ] ) {\n                jQuery.uniqueSort( matched );\n            }\n\n            // Reverse order for parents* and prev-derivatives\n            if ( rparentsprev.test( name ) ) {\n                matched.reverse();\n            }\n        }\n\n        return this.pushStack( matched );\n    };\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n    var object = {};\n    jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n        object[ flag ] = true;\n    } );\n    return object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *  options: an optional list of space-separated options that will change how\n *          the callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *  once:           will ensure the callback list can only be fired once (like a Deferred)\n *\n *  memory:         will keep track of previous values and will call any callback added\n *                  after the list has been fired right away with the latest \"memorized\"\n *                  values (like a Deferred)\n *\n *  unique:         will ensure a callback can only be added once (no duplicate in the list)\n *\n *  stopOnFalse:    interrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n    // Convert options from String-formatted to Object-formatted if needed\n    // (we check in cache first)\n    options = typeof options === \"string\" ?\n        createOptions( options ) :\n        jQuery.extend( {}, options );\n\n    var // Flag to know if list is currently firing\n        firing,\n\n        // Last fire value for non-forgettable lists\n        memory,\n\n        // Flag to know if list was already fired\n        fired,\n\n        // Flag to prevent firing\n        locked,\n\n        // Actual callback list\n        list = [],\n\n        // Queue of execution data for repeatable lists\n        queue = [],\n\n        // Index of currently firing callback (modified by add/remove as needed)\n        firingIndex = -1,\n\n        // Fire callbacks\n        fire = function() {\n\n            // Enforce single-firing\n            locked = options.once;\n\n            // Execute callbacks for all pending executions,\n            // respecting firingIndex overrides and runtime changes\n            fired = firing = true;\n            for ( ; queue.length; firingIndex = -1 ) {\n                memory = queue.shift();\n                while ( ++firingIndex < list.length ) {\n\n                    // Run callback and check for early termination\n                    if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n                        options.stopOnFalse ) {\n\n                        // Jump to end and forget the data so .add doesn't re-fire\n                        firingIndex = list.length;\n                        memory = false;\n                    }\n                }\n            }\n\n            // Forget the data if we're done with it\n            if ( !options.memory ) {\n                memory = false;\n            }\n\n            firing = false;\n\n            // Clean up if we're done firing for good\n            if ( locked ) {\n\n                // Keep an empty list if we have data for future add calls\n                if ( memory ) {\n                    list = [];\n\n                // Otherwise, this object is spent\n                } else {\n                    list = \"\";\n                }\n            }\n        },\n\n        // Actual Callbacks object\n        self = {\n\n            // Add a callback or a collection of callbacks to the list\n            add: function() {\n                if ( list ) {\n\n                    // If we have memory from a past run, we should fire after adding\n                    if ( memory && !firing ) {\n                        firingIndex = list.length - 1;\n                        queue.push( memory );\n                    }\n\n                    ( function add( args ) {\n                        jQuery.each( args, function( _, arg ) {\n                            if ( jQuery.isFunction( arg ) ) {\n                                if ( !options.unique || !self.has( arg ) ) {\n                                    list.push( arg );\n                                }\n                            } else if ( arg && arg.length && jQuery.type( arg ) !== \"string\" ) {\n\n                                // Inspect recursively\n                                add( arg );\n                            }\n                        } );\n                    } )( arguments );\n\n                    if ( memory && !firing ) {\n                        fire();\n                    }\n                }\n                return this;\n            },\n\n            // Remove a callback from the list\n            remove: function() {\n                jQuery.each( arguments, function( _, arg ) {\n                    var index;\n                    while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n                        list.splice( index, 1 );\n\n                        // Handle firing indexes\n                        if ( index <= firingIndex ) {\n                            firingIndex--;\n                        }\n                    }\n                } );\n                return this;\n            },\n\n            // Check if a given callback is in the list.\n            // If no argument is given, return whether or not list has callbacks attached.\n            has: function( fn ) {\n                return fn ?\n                    jQuery.inArray( fn, list ) > -1 :\n                    list.length > 0;\n            },\n\n            // Remove all callbacks from the list\n            empty: function() {\n                if ( list ) {\n                    list = [];\n                }\n                return this;\n            },\n\n            // Disable .fire and .add\n            // Abort any current/pending executions\n            // Clear all callbacks and values\n            disable: function() {\n                locked = queue = [];\n                list = memory = \"\";\n                return this;\n            },\n            disabled: function() {\n                return !list;\n            },\n\n            // Disable .fire\n            // Also disable .add unless we have memory (since it would have no effect)\n            // Abort any pending executions\n            lock: function() {\n                locked = queue = [];\n                if ( !memory && !firing ) {\n                    list = memory = \"\";\n                }\n                return this;\n            },\n            locked: function() {\n                return !!locked;\n            },\n\n            // Call all callbacks with the given context and arguments\n            fireWith: function( context, args ) {\n                if ( !locked ) {\n                    args = args || [];\n                    args = [ context, args.slice ? args.slice() : args ];\n                    queue.push( args );\n                    if ( !firing ) {\n                        fire();\n                    }\n                }\n                return this;\n            },\n\n            // Call all the callbacks with the given arguments\n            fire: function() {\n                self.fireWith( this, arguments );\n                return this;\n            },\n\n            // To know if the callbacks have already been called at least once\n            fired: function() {\n                return !!fired;\n            }\n        };\n\n    return self;\n};\n\n\nfunction Identity( v ) {\n    return v;\n}\nfunction Thrower( ex ) {\n    throw ex;\n}\n\nfunction adoptValue( value, resolve, reject ) {\n    var method;\n\n    try {\n\n        // Check for promise aspect first to privilege synchronous behavior\n        if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {\n            method.call( value ).done( resolve ).fail( reject );\n\n        // Other thenables\n        } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {\n            method.call( value, resolve, reject );\n\n        // Other non-thenables\n        } else {\n\n            // Support: Android 4.0 only\n            // Strict mode functions invoked without .call/.apply get global-object context\n            resolve.call( undefined, value );\n        }\n\n    // For Promises/A+, convert exceptions into rejections\n    // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n    // Deferred#then to conditionally suppress rejection.\n    } catch ( value ) {\n\n        // Support: Android 4.0 only\n        // Strict mode functions invoked without .call/.apply get global-object context\n        reject.call( undefined, value );\n    }\n}\n\njQuery.extend( {\n\n    Deferred: function( func ) {\n        var tuples = [\n\n                // action, add listener, callbacks,\n                // ... .then handlers, argument index, [final state]\n                [ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n                    jQuery.Callbacks( \"memory\" ), 2 ],\n                [ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n                    jQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n                [ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n                    jQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n            ],\n            state = \"pending\",\n            promise = {\n                state: function() {\n                    return state;\n                },\n                always: function() {\n                    deferred.done( arguments ).fail( arguments );\n                    return this;\n                },\n                \"catch\": function( fn ) {\n                    return promise.then( null, fn );\n                },\n\n                // Keep pipe for back-compat\n                pipe: function( /* fnDone, fnFail, fnProgress */ ) {\n                    var fns = arguments;\n\n                    return jQuery.Deferred( function( newDefer ) {\n                        jQuery.each( tuples, function( i, tuple ) {\n\n                            // Map tuples (progress, done, fail) to arguments (done, fail, progress)\n                            var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n                            // deferred.progress(function() { bind to newDefer or newDefer.notify })\n                            // deferred.done(function() { bind to newDefer or newDefer.resolve })\n                            // deferred.fail(function() { bind to newDefer or newDefer.reject })\n                            deferred[ tuple[ 1 ] ]( function() {\n                                var returned = fn && fn.apply( this, arguments );\n                                if ( returned && jQuery.isFunction( returned.promise ) ) {\n                                    returned.promise()\n                                        .progress( newDefer.notify )\n                                        .done( newDefer.resolve )\n                                        .fail( newDefer.reject );\n                                } else {\n                                    newDefer[ tuple[ 0 ] + \"With\" ](\n                                        this,\n                                        fn ? [ returned ] : arguments\n                                    );\n                                }\n                            } );\n                        } );\n                        fns = null;\n                    } ).promise();\n                },\n                then: function( onFulfilled, onRejected, onProgress ) {\n                    var maxDepth = 0;\n                    function resolve( depth, deferred, handler, special ) {\n                        return function() {\n                            var that = this,\n                                args = arguments,\n                                mightThrow = function() {\n                                    var returned, then;\n\n                                    // Support: Promises/A+ section 2.3.3.3.3\n                                    // https://promisesaplus.com/#point-59\n                                    // Ignore double-resolution attempts\n                                    if ( depth < maxDepth ) {\n                                        return;\n                                    }\n\n                                    returned = handler.apply( that, args );\n\n                                    // Support: Promises/A+ section 2.3.1\n                                    // https://promisesaplus.com/#point-48\n                                    if ( returned === deferred.promise() ) {\n                                        throw new TypeError( \"Thenable self-resolution\" );\n                                    }\n\n                                    // Support: Promises/A+ sections 2.3.3.1, 3.5\n                                    // https://promisesaplus.com/#point-54\n                                    // https://promisesaplus.com/#point-75\n                                    // Retrieve `then` only once\n                                    then = returned &&\n\n                                        // Support: Promises/A+ section 2.3.4\n                                        // https://promisesaplus.com/#point-64\n                                        // Only check objects and functions for thenability\n                                        ( typeof returned === \"object\" ||\n                                            typeof returned === \"function\" ) &&\n                                        returned.then;\n\n                                    // Handle a returned thenable\n                                    if ( jQuery.isFunction( then ) ) {\n\n                                        // Special processors (notify) just wait for resolution\n                                        if ( special ) {\n                                            then.call(\n                                                returned,\n                                                resolve( maxDepth, deferred, Identity, special ),\n                                                resolve( maxDepth, deferred, Thrower, special )\n                                            );\n\n                                        // Normal processors (resolve) also hook into progress\n                                        } else {\n\n                                            // ...and disregard older resolution values\n                                            maxDepth++;\n\n                                            then.call(\n                                                returned,\n                                                resolve( maxDepth, deferred, Identity, special ),\n                                                resolve( maxDepth, deferred, Thrower, special ),\n                                                resolve( maxDepth, deferred, Identity,\n                                                    deferred.notifyWith )\n                                            );\n                                        }\n\n                                    // Handle all other returned values\n                                    } else {\n\n                                        // Only substitute handlers pass on context\n                                        // and multiple values (non-spec behavior)\n                                        if ( handler !== Identity ) {\n                                            that = undefined;\n                                            args = [ returned ];\n                                        }\n\n                                        // Process the value(s)\n                                        // Default process is resolve\n                                        ( special || deferred.resolveWith )( that, args );\n                                    }\n                                },\n\n                                // Only normal processors (resolve) catch and reject exceptions\n                                process = special ?\n                                    mightThrow :\n                                    function() {\n                                        try {\n                                            mightThrow();\n                                        } catch ( e ) {\n\n                                            if ( jQuery.Deferred.exceptionHook ) {\n                                                jQuery.Deferred.exceptionHook( e,\n                                                    process.stackTrace );\n                                            }\n\n                                            // Support: Promises/A+ section 2.3.3.3.4.1\n                                            // https://promisesaplus.com/#point-61\n                                            // Ignore post-resolution exceptions\n                                            if ( depth + 1 >= maxDepth ) {\n\n                                                // Only substitute handlers pass on context\n                                                // and multiple values (non-spec behavior)\n                                                if ( handler !== Thrower ) {\n                                                    that = undefined;\n                                                    args = [ e ];\n                                                }\n\n                                                deferred.rejectWith( that, args );\n                                            }\n                                        }\n                                    };\n\n                            // Support: Promises/A+ section 2.3.3.3.1\n                            // https://promisesaplus.com/#point-57\n                            // Re-resolve promises immediately to dodge false rejection from\n                            // subsequent errors\n                            if ( depth ) {\n                                process();\n                            } else {\n\n                                // Call an optional hook to record the stack, in case of exception\n                                // since it's otherwise lost when execution goes async\n                                if ( jQuery.Deferred.getStackHook ) {\n                                    process.stackTrace = jQuery.Deferred.getStackHook();\n                                }\n                                window.setTimeout( process );\n                            }\n                        };\n                    }\n\n                    return jQuery.Deferred( function( newDefer ) {\n\n                        // progress_handlers.add( ... )\n                        tuples[ 0 ][ 3 ].add(\n                            resolve(\n                                0,\n                                newDefer,\n                                jQuery.isFunction( onProgress ) ?\n                                    onProgress :\n                                    Identity,\n                                newDefer.notifyWith\n                            )\n                        );\n\n                        // fulfilled_handlers.add( ... )\n                        tuples[ 1 ][ 3 ].add(\n                            resolve(\n                                0,\n                                newDefer,\n                                jQuery.isFunction( onFulfilled ) ?\n                                    onFulfilled :\n                                    Identity\n                            )\n                        );\n\n                        // rejected_handlers.add( ... )\n                        tuples[ 2 ][ 3 ].add(\n                            resolve(\n                                0,\n                                newDefer,\n                                jQuery.isFunction( onRejected ) ?\n                                    onRejected :\n                                    Thrower\n                            )\n                        );\n                    } ).promise();\n                },\n\n                // Get a promise for this deferred\n                // If obj is provided, the promise aspect is added to the object\n                promise: function( obj ) {\n                    return obj != null ? jQuery.extend( obj, promise ) : promise;\n                }\n            },\n            deferred = {};\n\n        // Add list-specific methods\n        jQuery.each( tuples, function( i, tuple ) {\n            var list = tuple[ 2 ],\n                stateString = tuple[ 5 ];\n\n            // promise.progress = list.add\n            // promise.done = list.add\n            // promise.fail = list.add\n            promise[ tuple[ 1 ] ] = list.add;\n\n            // Handle state\n            if ( stateString ) {\n                list.add(\n                    function() {\n\n                        // state = \"resolved\" (i.e., fulfilled)\n                        // state = \"rejected\"\n                        state = stateString;\n                    },\n\n                    // rejected_callbacks.disable\n                    // fulfilled_callbacks.disable\n                    tuples[ 3 - i ][ 2 ].disable,\n\n                    // progress_callbacks.lock\n                    tuples[ 0 ][ 2 ].lock\n                );\n            }\n\n            // progress_handlers.fire\n            // fulfilled_handlers.fire\n            // rejected_handlers.fire\n            list.add( tuple[ 3 ].fire );\n\n            // deferred.notify = function() { deferred.notifyWith(...) }\n            // deferred.resolve = function() { deferred.resolveWith(...) }\n            // deferred.reject = function() { deferred.rejectWith(...) }\n            deferred[ tuple[ 0 ] ] = function() {\n                deferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n                return this;\n            };\n\n            // deferred.notifyWith = list.fireWith\n            // deferred.resolveWith = list.fireWith\n            // deferred.rejectWith = list.fireWith\n            deferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n        } );\n\n        // Make the deferred a promise\n        promise.promise( deferred );\n\n        // Call given func if any\n        if ( func ) {\n            func.call( deferred, deferred );\n        }\n\n        // All done!\n        return deferred;\n    },\n\n    // Deferred helper\n    when: function( singleValue ) {\n        var\n\n            // count of uncompleted subordinates\n            remaining = arguments.length,\n\n            // count of unprocessed arguments\n            i = remaining,\n\n            // subordinate fulfillment data\n            resolveContexts = Array( i ),\n            resolveValues = slice.call( arguments ),\n\n            // the master Deferred\n            master = jQuery.Deferred(),\n\n            // subordinate callback factory\n            updateFunc = function( i ) {\n                return function( value ) {\n                    resolveContexts[ i ] = this;\n                    resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n                    if ( !( --remaining ) ) {\n                        master.resolveWith( resolveContexts, resolveValues );\n                    }\n                };\n            };\n\n        // Single- and empty arguments are adopted like Promise.resolve\n        if ( remaining <= 1 ) {\n            adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );\n\n            // Use .then() to unwrap secondary thenables (cf. gh-3000)\n            if ( master.state() === \"pending\" ||\n                jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n                return master.then();\n            }\n        }\n\n        // Multiple arguments are aggregated like Promise.all array elements\n        while ( i-- ) {\n            adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n        }\n\n        return master.promise();\n    }\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n    // Support: IE 8 - 9 only\n    // Console exists when dev tools are open, which can happen at any time\n    if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n        window.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n    }\n};\n\n\n\n\njQuery.readyException = function( error ) {\n    window.setTimeout( function() {\n        throw error;\n    } );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n    readyList\n        .then( fn )\n\n        // Wrap jQuery.readyException in a function so that the lookup\n        // happens at the time of error handling instead of callback\n        // registration.\n        .catch( function( error ) {\n            jQuery.readyException( error );\n        } );\n\n    return this;\n};\n\njQuery.extend( {\n\n    // Is the DOM ready to be used? Set to true once it occurs.\n    isReady: false,\n\n    // A counter to track how many items to wait for before\n    // the ready event fires. See #6781\n    readyWait: 1,\n\n    // Hold (or release) the ready event\n    holdReady: function( hold ) {\n        if ( hold ) {\n            jQuery.readyWait++;\n        } else {\n            jQuery.ready( true );\n        }\n    },\n\n    // Handle when the DOM is ready\n    ready: function( wait ) {\n\n        // Abort if there are pending holds or we're already ready\n        if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n            return;\n        }\n\n        // Remember that the DOM is ready\n        jQuery.isReady = true;\n\n        // If a normal DOM Ready event fired, decrement, and wait if need be\n        if ( wait !== true && --jQuery.readyWait > 0 ) {\n            return;\n        }\n\n        // If there are functions bound, to execute\n        readyList.resolveWith( document, [ jQuery ] );\n    }\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n    document.removeEventListener( \"DOMContentLoaded\", completed );\n    window.removeEventListener( \"load\", completed );\n    jQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n    ( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n    // Handle it asynchronously to allow scripts the opportunity to delay ready\n    window.setTimeout( jQuery.ready );\n\n} else {\n\n    // Use the handy event callback\n    document.addEventListener( \"DOMContentLoaded\", completed );\n\n    // A fallback to window.onload, that will always work\n    window.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n    var i = 0,\n        len = elems.length,\n        bulk = key == null;\n\n    // Sets many values\n    if ( jQuery.type( key ) === \"object\" ) {\n        chainable = true;\n        for ( i in key ) {\n            access( elems, fn, i, key[ i ], true, emptyGet, raw );\n        }\n\n    // Sets one value\n    } else if ( value !== undefined ) {\n        chainable = true;\n\n        if ( !jQuery.isFunction( value ) ) {\n            raw = true;\n        }\n\n        if ( bulk ) {\n\n            // Bulk operations run against the entire set\n            if ( raw ) {\n                fn.call( elems, value );\n                fn = null;\n\n            // ...except when executing function values\n            } else {\n                bulk = fn;\n                fn = function( elem, key, value ) {\n                    return bulk.call( jQuery( elem ), value );\n                };\n            }\n        }\n\n        if ( fn ) {\n            for ( ; i < len; i++ ) {\n                fn(\n                    elems[ i ], key, raw ?\n                    value :\n                    value.call( elems[ i ], i, fn( elems[ i ], key ) )\n                );\n            }\n        }\n    }\n\n    if ( chainable ) {\n        return elems;\n    }\n\n    // Gets\n    if ( bulk ) {\n        return fn.call( elems );\n    }\n\n    return len ? fn( elems[ 0 ], key ) : emptyGet;\n};\nvar acceptData = function( owner ) {\n\n    // Accepts only:\n    //  - Node\n    //    - Node.ELEMENT_NODE\n    //    - Node.DOCUMENT_NODE\n    //  - Object\n    //    - Any\n    return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n    this.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n    cache: function( owner ) {\n\n        // Check if the owner object already has a cache\n        var value = owner[ this.expando ];\n\n        // If not, create one\n        if ( !value ) {\n            value = {};\n\n            // We can accept data for non-element nodes in modern browsers,\n            // but we should not, see #8335.\n            // Always return an empty object.\n            if ( acceptData( owner ) ) {\n\n                // If it is a node unlikely to be stringify-ed or looped over\n                // use plain assignment\n                if ( owner.nodeType ) {\n                    owner[ this.expando ] = value;\n\n                // Otherwise secure it in a non-enumerable property\n                // configurable must be true to allow the property to be\n                // deleted when data is removed\n                } else {\n                    Object.defineProperty( owner, this.expando, {\n                        value: value,\n                        configurable: true\n                    } );\n                }\n            }\n        }\n\n        return value;\n    },\n    set: function( owner, data, value ) {\n        var prop,\n            cache = this.cache( owner );\n\n        // Handle: [ owner, key, value ] args\n        // Always use camelCase key (gh-2257)\n        if ( typeof data === \"string\" ) {\n            cache[ jQuery.camelCase( data ) ] = value;\n\n        // Handle: [ owner, { properties } ] args\n        } else {\n\n            // Copy the properties one-by-one to the cache object\n            for ( prop in data ) {\n                cache[ jQuery.camelCase( prop ) ] = data[ prop ];\n            }\n        }\n        return cache;\n    },\n    get: function( owner, key ) {\n        return key === undefined ?\n            this.cache( owner ) :\n\n            // Always use camelCase key (gh-2257)\n            owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];\n    },\n    access: function( owner, key, value ) {\n\n        // In cases where either:\n        //\n        //   1. No key was specified\n        //   2. A string key was specified, but no value provided\n        //\n        // Take the \"read\" path and allow the get method to determine\n        // which value to return, respectively either:\n        //\n        //   1. The entire cache object\n        //   2. The data stored at the key\n        //\n        if ( key === undefined ||\n                ( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n            return this.get( owner, key );\n        }\n\n        // When the key is not a string, or both a key and value\n        // are specified, set or extend (existing objects) with either:\n        //\n        //   1. An object of properties\n        //   2. A key and value\n        //\n        this.set( owner, key, value );\n\n        // Since the \"set\" path can have two possible entry points\n        // return the expected data based on which path was taken[*]\n        return value !== undefined ? value : key;\n    },\n    remove: function( owner, key ) {\n        var i,\n            cache = owner[ this.expando ];\n\n        if ( cache === undefined ) {\n            return;\n        }\n\n        if ( key !== undefined ) {\n\n            // Support array or space separated string of keys\n            if ( jQuery.isArray( key ) ) {\n\n                // If key is an array of keys...\n                // We always set camelCase keys, so remove that.\n                key = key.map( jQuery.camelCase );\n            } else {\n                key = jQuery.camelCase( key );\n\n                // If a key with the spaces exists, use it.\n                // Otherwise, create an array by matching non-whitespace\n                key = key in cache ?\n                    [ key ] :\n                    ( key.match( rnothtmlwhite ) || [] );\n            }\n\n            i = key.length;\n\n            while ( i-- ) {\n                delete cache[ key[ i ] ];\n            }\n        }\n\n        // Remove the expando if there's no more data\n        if ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n            // Support: Chrome <=35 - 45\n            // Webkit & Blink performance suffers when deleting properties\n            // from DOM nodes, so set to undefined instead\n            // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n            if ( owner.nodeType ) {\n                owner[ this.expando ] = undefined;\n            } else {\n                delete owner[ this.expando ];\n            }\n        }\n    },\n    hasData: function( owner ) {\n        var cache = owner[ this.expando ];\n        return cache !== undefined && !jQuery.isEmptyObject( cache );\n    }\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//  Implementation Summary\n//\n//  1. Enforce API surface and semantic compatibility with 1.9.x branch\n//  2. Improve the module's maintainability by reducing the storage\n//      paths to a single mechanism.\n//  3. Use the same single mechanism to support \"private\" and \"user\" data.\n//  4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//  5. Avoid exposing implementation details on user objects (eg. expando properties)\n//  6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n    rmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n    if ( data === \"true\" ) {\n        return true;\n    }\n\n    if ( data === \"false\" ) {\n        return false;\n    }\n\n    if ( data === \"null\" ) {\n        return null;\n    }\n\n    // Only convert to a number if it doesn't change the string\n    if ( data === +data + \"\" ) {\n        return +data;\n    }\n\n    if ( rbrace.test( data ) ) {\n        return JSON.parse( data );\n    }\n\n    return data;\n}\n\nfunction dataAttr( elem, key, data ) {\n    var name;\n\n    // If nothing was found internally, try to fetch any\n    // data from the HTML5 data-* attribute\n    if ( data === undefined && elem.nodeType === 1 ) {\n        name = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n        data = elem.getAttribute( name );\n\n        if ( typeof data === \"string\" ) {\n            try {\n                data = getData( data );\n            } catch ( e ) {}\n\n            // Make sure we set the data so it isn't changed later\n            dataUser.set( elem, key, data );\n        } else {\n            data = undefined;\n        }\n    }\n    return data;\n}\n\njQuery.extend( {\n    hasData: function( elem ) {\n        return dataUser.hasData( elem ) || dataPriv.hasData( elem );\n    },\n\n    data: function( elem, name, data ) {\n        return dataUser.access( elem, name, data );\n    },\n\n    removeData: function( elem, name ) {\n        dataUser.remove( elem, name );\n    },\n\n    // TODO: Now that all calls to _data and _removeData have been replaced\n    // with direct calls to dataPriv methods, these can be deprecated.\n    _data: function( elem, name, data ) {\n        return dataPriv.access( elem, name, data );\n    },\n\n    _removeData: function( elem, name ) {\n        dataPriv.remove( elem, name );\n    }\n} );\n\njQuery.fn.extend( {\n    data: function( key, value ) {\n        var i, name, data,\n            elem = this[ 0 ],\n            attrs = elem && elem.attributes;\n\n        // Gets all values\n        if ( key === undefined ) {\n            if ( this.length ) {\n                data = dataUser.get( elem );\n\n                if ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n                    i = attrs.length;\n                    while ( i-- ) {\n\n                        // Support: IE 11 only\n                        // The attrs elements can be null (#14894)\n                        if ( attrs[ i ] ) {\n                            name = attrs[ i ].name;\n                            if ( name.indexOf( \"data-\" ) === 0 ) {\n                                name = jQuery.camelCase( name.slice( 5 ) );\n                                dataAttr( elem, name, data[ name ] );\n                            }\n                        }\n                    }\n                    dataPriv.set( elem, \"hasDataAttrs\", true );\n                }\n            }\n\n            return data;\n        }\n\n        // Sets multiple values\n        if ( typeof key === \"object\" ) {\n            return this.each( function() {\n                dataUser.set( this, key );\n            } );\n        }\n\n        return access( this, function( value ) {\n            var data;\n\n            // The calling jQuery object (element matches) is not empty\n            // (and therefore has an element appears at this[ 0 ]) and the\n            // `value` parameter was not undefined. An empty jQuery object\n            // will result in `undefined` for elem = this[ 0 ] which will\n            // throw an exception if an attempt to read a data cache is made.\n            if ( elem && value === undefined ) {\n\n                // Attempt to get data from the cache\n                // The key will always be camelCased in Data\n                data = dataUser.get( elem, key );\n                if ( data !== undefined ) {\n                    return data;\n                }\n\n                // Attempt to \"discover\" the data in\n                // HTML5 custom data-* attrs\n                data = dataAttr( elem, key );\n                if ( data !== undefined ) {\n                    return data;\n                }\n\n                // We tried really hard, but the data doesn't exist.\n                return;\n            }\n\n            // Set the data...\n            this.each( function() {\n\n                // We always store the camelCased key\n                dataUser.set( this, key, value );\n            } );\n        }, null, value, arguments.length > 1, null, true );\n    },\n\n    removeData: function( key ) {\n        return this.each( function() {\n            dataUser.remove( this, key );\n        } );\n    }\n} );\n\n\njQuery.extend( {\n    queue: function( elem, type, data ) {\n        var queue;\n\n        if ( elem ) {\n            type = ( type || \"fx\" ) + \"queue\";\n            queue = dataPriv.get( elem, type );\n\n            // Speed up dequeue by getting out quickly if this is just a lookup\n            if ( data ) {\n                if ( !queue || jQuery.isArray( data ) ) {\n                    queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n                } else {\n                    queue.push( data );\n                }\n            }\n            return queue || [];\n        }\n    },\n\n    dequeue: function( elem, type ) {\n        type = type || \"fx\";\n\n        var queue = jQuery.queue( elem, type ),\n            startLength = queue.length,\n            fn = queue.shift(),\n            hooks = jQuery._queueHooks( elem, type ),\n            next = function() {\n                jQuery.dequeue( elem, type );\n            };\n\n        // If the fx queue is dequeued, always remove the progress sentinel\n        if ( fn === \"inprogress\" ) {\n            fn = queue.shift();\n            startLength--;\n        }\n\n        if ( fn ) {\n\n            // Add a progress sentinel to prevent the fx queue from being\n            // automatically dequeued\n            if ( type === \"fx\" ) {\n                queue.unshift( \"inprogress\" );\n            }\n\n            // Clear up the last queue stop function\n            delete hooks.stop;\n            fn.call( elem, next, hooks );\n        }\n\n        if ( !startLength && hooks ) {\n            hooks.empty.fire();\n        }\n    },\n\n    // Not public - generate a queueHooks object, or return the current one\n    _queueHooks: function( elem, type ) {\n        var key = type + \"queueHooks\";\n        return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n            empty: jQuery.Callbacks( \"once memory\" ).add( function() {\n                dataPriv.remove( elem, [ type + \"queue\", key ] );\n            } )\n        } );\n    }\n} );\n\njQuery.fn.extend( {\n    queue: function( type, data ) {\n        var setter = 2;\n\n        if ( typeof type !== \"string\" ) {\n            data = type;\n            type = \"fx\";\n            setter--;\n        }\n\n        if ( arguments.length < setter ) {\n            return jQuery.queue( this[ 0 ], type );\n        }\n\n        return data === undefined ?\n            this :\n            this.each( function() {\n                var queue = jQuery.queue( this, type, data );\n\n                // Ensure a hooks for this queue\n                jQuery._queueHooks( this, type );\n\n                if ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n                    jQuery.dequeue( this, type );\n                }\n            } );\n    },\n    dequeue: function( type ) {\n        return this.each( function() {\n            jQuery.dequeue( this, type );\n        } );\n    },\n    clearQueue: function( type ) {\n        return this.queue( type || \"fx\", [] );\n    },\n\n    // Get a promise resolved when queues of a certain type\n    // are emptied (fx is the type by default)\n    promise: function( type, obj ) {\n        var tmp,\n            count = 1,\n            defer = jQuery.Deferred(),\n            elements = this,\n            i = this.length,\n            resolve = function() {\n                if ( !( --count ) ) {\n                    defer.resolveWith( elements, [ elements ] );\n                }\n            };\n\n        if ( typeof type !== \"string\" ) {\n            obj = type;\n            type = undefined;\n        }\n        type = type || \"fx\";\n\n        while ( i-- ) {\n            tmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n            if ( tmp && tmp.empty ) {\n                count++;\n                tmp.empty.add( resolve );\n            }\n        }\n        resolve();\n        return defer.promise( obj );\n    }\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar isHiddenWithinTree = function( elem, el ) {\n\n        // isHiddenWithinTree might be called from jQuery#filter function;\n        // in that case, element will be second argument\n        elem = el || elem;\n\n        // Inline style trumps all\n        return elem.style.display === \"none\" ||\n            elem.style.display === \"\" &&\n\n            // Otherwise, check computed style\n            // Support: Firefox <=43 - 45\n            // Disconnected elements can have computed display: none, so first confirm that elem is\n            // in the document.\n            jQuery.contains( elem.ownerDocument, elem ) &&\n\n            jQuery.css( elem, \"display\" ) === \"none\";\n    };\n\nvar swap = function( elem, options, callback, args ) {\n    var ret, name,\n        old = {};\n\n    // Remember the old values, and insert the new ones\n    for ( name in options ) {\n        old[ name ] = elem.style[ name ];\n        elem.style[ name ] = options[ name ];\n    }\n\n    ret = callback.apply( elem, args || [] );\n\n    // Revert the old values\n    for ( name in options ) {\n        elem.style[ name ] = old[ name ];\n    }\n\n    return ret;\n};\n\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n    var adjusted,\n        scale = 1,\n        maxIterations = 20,\n        currentValue = tween ?\n            function() {\n                return tween.cur();\n            } :\n            function() {\n                return jQuery.css( elem, prop, \"\" );\n            },\n        initial = currentValue(),\n        unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n        // Starting value computation is required for potential unit mismatches\n        initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n            rcssNum.exec( jQuery.css( elem, prop ) );\n\n    if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n        // Trust units reported by jQuery.css\n        unit = unit || initialInUnit[ 3 ];\n\n        // Make sure we update the tween properties later on\n        valueParts = valueParts || [];\n\n        // Iteratively approximate from a nonzero starting point\n        initialInUnit = +initial || 1;\n\n        do {\n\n            // If previous iteration zeroed out, double until we get *something*.\n            // Use string for doubling so we don't accidentally see scale as unchanged below\n            scale = scale || \".5\";\n\n            // Adjust and apply\n            initialInUnit = initialInUnit / scale;\n            jQuery.style( elem, prop, initialInUnit + unit );\n\n        // Update scale, tolerating zero or NaN from tween.cur()\n        // Break the loop if scale is unchanged or perfect, or if we've just had enough.\n        } while (\n            scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations\n        );\n    }\n\n    if ( valueParts ) {\n        initialInUnit = +initialInUnit || +initial || 0;\n\n        // Apply relative offset (+=/-=) if specified\n        adjusted = valueParts[ 1 ] ?\n            initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n            +valueParts[ 2 ];\n        if ( tween ) {\n            tween.unit = unit;\n            tween.start = initialInUnit;\n            tween.end = adjusted;\n        }\n    }\n    return adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n    var temp,\n        doc = elem.ownerDocument,\n        nodeName = elem.nodeName,\n        display = defaultDisplayMap[ nodeName ];\n\n    if ( display ) {\n        return display;\n    }\n\n    temp = doc.body.appendChild( doc.createElement( nodeName ) );\n    display = jQuery.css( temp, \"display\" );\n\n    temp.parentNode.removeChild( temp );\n\n    if ( display === \"none\" ) {\n        display = \"block\";\n    }\n    defaultDisplayMap[ nodeName ] = display;\n\n    return display;\n}\n\nfunction showHide( elements, show ) {\n    var display, elem,\n        values = [],\n        index = 0,\n        length = elements.length;\n\n    // Determine new display value for elements that need to change\n    for ( ; index < length; index++ ) {\n        elem = elements[ index ];\n        if ( !elem.style ) {\n            continue;\n        }\n\n        display = elem.style.display;\n        if ( show ) {\n\n            // Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n            // check is required in this first loop unless we have a nonempty display value (either\n            // inline or about-to-be-restored)\n            if ( display === \"none\" ) {\n                values[ index ] = dataPriv.get( elem, \"display\" ) || null;\n                if ( !values[ index ] ) {\n                    elem.style.display = \"\";\n                }\n            }\n            if ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n                values[ index ] = getDefaultDisplay( elem );\n            }\n        } else {\n            if ( display !== \"none\" ) {\n                values[ index ] = \"none\";\n\n                // Remember what we're overwriting\n                dataPriv.set( elem, \"display\", display );\n            }\n        }\n    }\n\n    // Set the display of the elements in a second loop to avoid constant reflow\n    for ( index = 0; index < length; index++ ) {\n        if ( values[ index ] != null ) {\n            elements[ index ].style.display = values[ index ];\n        }\n    }\n\n    return elements;\n}\n\njQuery.fn.extend( {\n    show: function() {\n        return showHide( this, true );\n    },\n    hide: function() {\n        return showHide( this );\n    },\n    toggle: function( state ) {\n        if ( typeof state === \"boolean\" ) {\n            return state ? this.show() : this.hide();\n        }\n\n        return this.each( function() {\n            if ( isHiddenWithinTree( this ) ) {\n                jQuery( this ).show();\n            } else {\n                jQuery( this ).hide();\n            }\n        } );\n    }\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]+)/i );\n\nvar rscriptType = ( /^$|\\/(?:java|ecma)script/i );\n\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n    // Support: IE <=9 only\n    option: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n    // XHTML parsers do not magically insert elements in the\n    // same way that tag soup parsers do. So we cannot shorten\n    // this by omitting <tbody> or other required elements.\n    thead: [ 1, \"<table>\", \"</table>\" ],\n    col: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n    tr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n    td: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n    _default: [ 0, \"\", \"\" ]\n};\n\n// Support: IE <=9 only\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction getAll( context, tag ) {\n\n    // Support: IE <=9 - 11 only\n    // Use typeof to avoid zero-argument method invocation on host objects (#15151)\n    var ret;\n\n    if ( typeof context.getElementsByTagName !== \"undefined\" ) {\n        ret = context.getElementsByTagName( tag || \"*\" );\n\n    } else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n        ret = context.querySelectorAll( tag || \"*\" );\n\n    } else {\n        ret = [];\n    }\n\n    if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {\n        return jQuery.merge( [ context ], ret );\n    }\n\n    return ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n    var i = 0,\n        l = elems.length;\n\n    for ( ; i < l; i++ ) {\n        dataPriv.set(\n            elems[ i ],\n            \"globalEval\",\n            !refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n        );\n    }\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n    var elem, tmp, tag, wrap, contains, j,\n        fragment = context.createDocumentFragment(),\n        nodes = [],\n        i = 0,\n        l = elems.length;\n\n    for ( ; i < l; i++ ) {\n        elem = elems[ i ];\n\n        if ( elem || elem === 0 ) {\n\n            // Add nodes directly\n            if ( jQuery.type( elem ) === \"object\" ) {\n\n                // Support: Android <=4.0 only, PhantomJS 1 only\n                // push.apply(_, arraylike) throws on ancient WebKit\n                jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n            // Convert non-html into a text node\n            } else if ( !rhtml.test( elem ) ) {\n                nodes.push( context.createTextNode( elem ) );\n\n            // Convert html into DOM nodes\n            } else {\n                tmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n                // Deserialize a standard representation\n                tag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n                wrap = wrapMap[ tag ] || wrapMap._default;\n                tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n                // Descend through wrappers to the right content\n                j = wrap[ 0 ];\n                while ( j-- ) {\n                    tmp = tmp.lastChild;\n                }\n\n                // Support: Android <=4.0 only, PhantomJS 1 only\n                // push.apply(_, arraylike) throws on ancient WebKit\n                jQuery.merge( nodes, tmp.childNodes );\n\n                // Remember the top-level container\n                tmp = fragment.firstChild;\n\n                // Ensure the created nodes are orphaned (#12392)\n                tmp.textContent = \"\";\n            }\n        }\n    }\n\n    // Remove wrapper from fragment\n    fragment.textContent = \"\";\n\n    i = 0;\n    while ( ( elem = nodes[ i++ ] ) ) {\n\n        // Skip elements already in the context collection (trac-4087)\n        if ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n            if ( ignored ) {\n                ignored.push( elem );\n            }\n            continue;\n        }\n\n        contains = jQuery.contains( elem.ownerDocument, elem );\n\n        // Append to fragment\n        tmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n        // Preserve script evaluation history\n        if ( contains ) {\n            setGlobalEval( tmp );\n        }\n\n        // Capture executables\n        if ( scripts ) {\n            j = 0;\n            while ( ( elem = tmp[ j++ ] ) ) {\n                if ( rscriptType.test( elem.type || \"\" ) ) {\n                    scripts.push( elem );\n                }\n            }\n        }\n    }\n\n    return fragment;\n}\n\n\n( function() {\n    var fragment = document.createDocumentFragment(),\n        div = fragment.appendChild( document.createElement( \"div\" ) ),\n        input = document.createElement( \"input\" );\n\n    // Support: Android 4.0 - 4.3 only\n    // Check state lost if the name is set (#11217)\n    // Support: Windows Web Apps (WWA)\n    // `name` and `type` must use .setAttribute for WWA (#14901)\n    input.setAttribute( \"type\", \"radio\" );\n    input.setAttribute( \"checked\", \"checked\" );\n    input.setAttribute( \"name\", \"t\" );\n\n    div.appendChild( input );\n\n    // Support: Android <=4.1 only\n    // Older WebKit doesn't clone checked state correctly in fragments\n    support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n    // Support: IE <=11 only\n    // Make sure textarea (and checkbox) defaultValue is properly cloned\n    div.innerHTML = \"<textarea>x</textarea>\";\n    support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n} )();\nvar documentElement = document.documentElement;\n\n\n\nvar\n    rkeyEvent = /^key/,\n    rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n    rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n    return true;\n}\n\nfunction returnFalse() {\n    return false;\n}\n\n// Support: IE <=9 only\n// See #13393 for more info\nfunction safeActiveElement() {\n    try {\n        return document.activeElement;\n    } catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n    var origFn, type;\n\n    // Types can be a map of types/handlers\n    if ( typeof types === \"object\" ) {\n\n        // ( types-Object, selector, data )\n        if ( typeof selector !== \"string\" ) {\n\n            // ( types-Object, data )\n            data = data || selector;\n            selector = undefined;\n        }\n        for ( type in types ) {\n            on( elem, type, selector, data, types[ type ], one );\n        }\n        return elem;\n    }\n\n    if ( data == null && fn == null ) {\n\n        // ( types, fn )\n        fn = selector;\n        data = selector = undefined;\n    } else if ( fn == null ) {\n        if ( typeof selector === \"string\" ) {\n\n            // ( types, selector, fn )\n            fn = data;\n            data = undefined;\n        } else {\n\n            // ( types, data, fn )\n            fn = data;\n            data = selector;\n            selector = undefined;\n        }\n    }\n    if ( fn === false ) {\n        fn = returnFalse;\n    } else if ( !fn ) {\n        return elem;\n    }\n\n    if ( one === 1 ) {\n        origFn = fn;\n        fn = function( event ) {\n\n            // Can use an empty set, since event contains the info\n            jQuery().off( event );\n            return origFn.apply( this, arguments );\n        };\n\n        // Use same guid so caller can remove using origFn\n        fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n    }\n    return elem.each( function() {\n        jQuery.event.add( this, types, fn, data, selector );\n    } );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n    global: {},\n\n    add: function( elem, types, handler, data, selector ) {\n\n        var handleObjIn, eventHandle, tmp,\n            events, t, handleObj,\n            special, handlers, type, namespaces, origType,\n            elemData = dataPriv.get( elem );\n\n        // Don't attach events to noData or text/comment nodes (but allow plain objects)\n        if ( !elemData ) {\n            return;\n        }\n\n        // Caller can pass in an object of custom data in lieu of the handler\n        if ( handler.handler ) {\n            handleObjIn = handler;\n            handler = handleObjIn.handler;\n            selector = handleObjIn.selector;\n        }\n\n        // Ensure that invalid selectors throw exceptions at attach time\n        // Evaluate against documentElement in case elem is a non-element node (e.g., document)\n        if ( selector ) {\n            jQuery.find.matchesSelector( documentElement, selector );\n        }\n\n        // Make sure that the handler has a unique ID, used to find/remove it later\n        if ( !handler.guid ) {\n            handler.guid = jQuery.guid++;\n        }\n\n        // Init the element's event structure and main handler, if this is the first\n        if ( !( events = elemData.events ) ) {\n            events = elemData.events = {};\n        }\n        if ( !( eventHandle = elemData.handle ) ) {\n            eventHandle = elemData.handle = function( e ) {\n\n                // Discard the second event of a jQuery.event.trigger() and\n                // when an event is called after a page has unloaded\n                return typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n                    jQuery.event.dispatch.apply( elem, arguments ) : undefined;\n            };\n        }\n\n        // Handle multiple events separated by a space\n        types = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n        t = types.length;\n        while ( t-- ) {\n            tmp = rtypenamespace.exec( types[ t ] ) || [];\n            type = origType = tmp[ 1 ];\n            namespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n            // There *must* be a type, no attaching namespace-only handlers\n            if ( !type ) {\n                continue;\n            }\n\n            // If event changes its type, use the special event handlers for the changed type\n            special = jQuery.event.special[ type ] || {};\n\n            // If selector defined, determine special event api type, otherwise given type\n            type = ( selector ? special.delegateType : special.bindType ) || type;\n\n            // Update special based on newly reset type\n            special = jQuery.event.special[ type ] || {};\n\n            // handleObj is passed to all event handlers\n            handleObj = jQuery.extend( {\n                type: type,\n                origType: origType,\n                data: data,\n                handler: handler,\n                guid: handler.guid,\n                selector: selector,\n                needsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n                namespace: namespaces.join( \".\" )\n            }, handleObjIn );\n\n            // Init the event handler queue if we're the first\n            if ( !( handlers = events[ type ] ) ) {\n                handlers = events[ type ] = [];\n                handlers.delegateCount = 0;\n\n                // Only use addEventListener if the special events handler returns false\n                if ( !special.setup ||\n                    special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n                    if ( elem.addEventListener ) {\n                        elem.addEventListener( type, eventHandle );\n                    }\n                }\n            }\n\n            if ( special.add ) {\n                special.add.call( elem, handleObj );\n\n                if ( !handleObj.handler.guid ) {\n                    handleObj.handler.guid = handler.guid;\n                }\n            }\n\n            // Add to the element's handler list, delegates in front\n            if ( selector ) {\n                handlers.splice( handlers.delegateCount++, 0, handleObj );\n            } else {\n                handlers.push( handleObj );\n            }\n\n            // Keep track of which events have ever been used, for event optimization\n            jQuery.event.global[ type ] = true;\n        }\n\n    },\n\n    // Detach an event or set of events from an element\n    remove: function( elem, types, handler, selector, mappedTypes ) {\n\n        var j, origCount, tmp,\n            events, t, handleObj,\n            special, handlers, type, namespaces, origType,\n            elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n        if ( !elemData || !( events = elemData.events ) ) {\n            return;\n        }\n\n        // Once for each type.namespace in types; type may be omitted\n        types = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n        t = types.length;\n        while ( t-- ) {\n            tmp = rtypenamespace.exec( types[ t ] ) || [];\n            type = origType = tmp[ 1 ];\n            namespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n            // Unbind all events (on this namespace, if provided) for the element\n            if ( !type ) {\n                for ( type in events ) {\n                    jQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n                }\n                continue;\n            }\n\n            special = jQuery.event.special[ type ] || {};\n            type = ( selector ? special.delegateType : special.bindType ) || type;\n            handlers = events[ type ] || [];\n            tmp = tmp[ 2 ] &&\n                new RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n            // Remove matching events\n            origCount = j = handlers.length;\n            while ( j-- ) {\n                handleObj = handlers[ j ];\n\n                if ( ( mappedTypes || origType === handleObj.origType ) &&\n                    ( !handler || handler.guid === handleObj.guid ) &&\n                    ( !tmp || tmp.test( handleObj.namespace ) ) &&\n                    ( !selector || selector === handleObj.selector ||\n                        selector === \"**\" && handleObj.selector ) ) {\n                    handlers.splice( j, 1 );\n\n                    if ( handleObj.selector ) {\n                        handlers.delegateCount--;\n                    }\n                    if ( special.remove ) {\n                        special.remove.call( elem, handleObj );\n                    }\n                }\n            }\n\n            // Remove generic event handler if we removed something and no more handlers exist\n            // (avoids potential for endless recursion during removal of special event handlers)\n            if ( origCount && !handlers.length ) {\n                if ( !special.teardown ||\n                    special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n                    jQuery.removeEvent( elem, type, elemData.handle );\n                }\n\n                delete events[ type ];\n            }\n        }\n\n        // Remove data and the expando if it's no longer used\n        if ( jQuery.isEmptyObject( events ) ) {\n            dataPriv.remove( elem, \"handle events\" );\n        }\n    },\n\n    dispatch: function( nativeEvent ) {\n\n        // Make a writable jQuery.Event from the native event object\n        var event = jQuery.event.fix( nativeEvent );\n\n        var i, j, ret, matched, handleObj, handlerQueue,\n            args = new Array( arguments.length ),\n            handlers = ( dataPriv.get( this, \"events\" ) || {} )[ event.type ] || [],\n            special = jQuery.event.special[ event.type ] || {};\n\n        // Use the fix-ed jQuery.Event rather than the (read-only) native event\n        args[ 0 ] = event;\n\n        for ( i = 1; i < arguments.length; i++ ) {\n            args[ i ] = arguments[ i ];\n        }\n\n        event.delegateTarget = this;\n\n        // Call the preDispatch hook for the mapped type, and let it bail if desired\n        if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n            return;\n        }\n\n        // Determine handlers\n        handlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n        // Run delegates first; they may want to stop propagation beneath us\n        i = 0;\n        while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n            event.currentTarget = matched.elem;\n\n            j = 0;\n            while ( ( handleObj = matched.handlers[ j++ ] ) &&\n                !event.isImmediatePropagationStopped() ) {\n\n                // Triggered event must either 1) have no namespace, or 2) have namespace(s)\n                // a subset or equal to those in the bound event (both can have no namespace).\n                if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {\n\n                    event.handleObj = handleObj;\n                    event.data = handleObj.data;\n\n                    ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n                        handleObj.handler ).apply( matched.elem, args );\n\n                    if ( ret !== undefined ) {\n                        if ( ( event.result = ret ) === false ) {\n                            event.preventDefault();\n                            event.stopPropagation();\n                        }\n                    }\n                }\n            }\n        }\n\n        // Call the postDispatch hook for the mapped type\n        if ( special.postDispatch ) {\n            special.postDispatch.call( this, event );\n        }\n\n        return event.result;\n    },\n\n    handlers: function( event, handlers ) {\n        var i, handleObj, sel, matchedHandlers, matchedSelectors,\n            handlerQueue = [],\n            delegateCount = handlers.delegateCount,\n            cur = event.target;\n\n        // Find delegate handlers\n        if ( delegateCount &&\n\n            // Support: IE <=9\n            // Black-hole SVG <use> instance trees (trac-13180)\n            cur.nodeType &&\n\n            // Support: Firefox <=42\n            // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n            // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n            // Support: IE 11 only\n            // ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n            !( event.type === \"click\" && event.button >= 1 ) ) {\n\n            for ( ; cur !== this; cur = cur.parentNode || this ) {\n\n                // Don't check non-elements (#13208)\n                // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n                if ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n                    matchedHandlers = [];\n                    matchedSelectors = {};\n                    for ( i = 0; i < delegateCount; i++ ) {\n                        handleObj = handlers[ i ];\n\n                        // Don't conflict with Object.prototype properties (#13203)\n                        sel = handleObj.selector + \" \";\n\n                        if ( matchedSelectors[ sel ] === undefined ) {\n                            matchedSelectors[ sel ] = handleObj.needsContext ?\n                                jQuery( sel, this ).index( cur ) > -1 :\n                                jQuery.find( sel, this, null, [ cur ] ).length;\n                        }\n                        if ( matchedSelectors[ sel ] ) {\n                            matchedHandlers.push( handleObj );\n                        }\n                    }\n                    if ( matchedHandlers.length ) {\n                        handlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n                    }\n                }\n            }\n        }\n\n        // Add the remaining (directly-bound) handlers\n        cur = this;\n        if ( delegateCount < handlers.length ) {\n            handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n        }\n\n        return handlerQueue;\n    },\n\n    addProp: function( name, hook ) {\n        Object.defineProperty( jQuery.Event.prototype, name, {\n            enumerable: true,\n            configurable: true,\n\n            get: jQuery.isFunction( hook ) ?\n                function() {\n                    if ( this.originalEvent ) {\n                            return hook( this.originalEvent );\n                    }\n                } :\n                function() {\n                    if ( this.originalEvent ) {\n                            return this.originalEvent[ name ];\n                    }\n                },\n\n            set: function( value ) {\n                Object.defineProperty( this, name, {\n                    enumerable: true,\n                    configurable: true,\n                    writable: true,\n                    value: value\n                } );\n            }\n        } );\n    },\n\n    fix: function( originalEvent ) {\n        return originalEvent[ jQuery.expando ] ?\n            originalEvent :\n            new jQuery.Event( originalEvent );\n    },\n\n    special: {\n        load: {\n\n            // Prevent triggered image.load events from bubbling to window.load\n            noBubble: true\n        },\n        focus: {\n\n            // Fire native event if possible so blur/focus sequence is correct\n            trigger: function() {\n                if ( this !== safeActiveElement() && this.focus ) {\n                    this.focus();\n                    return false;\n                }\n            },\n            delegateType: \"focusin\"\n        },\n        blur: {\n            trigger: function() {\n                if ( this === safeActiveElement() && this.blur ) {\n                    this.blur();\n                    return false;\n                }\n            },\n            delegateType: \"focusout\"\n        },\n        click: {\n\n            // For checkbox, fire native event so checked state will be right\n            trigger: function() {\n                if ( this.type === \"checkbox\" && this.click && jQuery.nodeName( this, \"input\" ) ) {\n                    this.click();\n                    return false;\n                }\n            },\n\n            // For cross-browser consistency, don't fire native .click() on links\n            _default: function( event ) {\n                return jQuery.nodeName( event.target, \"a\" );\n            }\n        },\n\n        beforeunload: {\n            postDispatch: function( event ) {\n\n                // Support: Firefox 20+\n                // Firefox doesn't alert if the returnValue field is not set.\n                if ( event.result !== undefined && event.originalEvent ) {\n                    event.originalEvent.returnValue = event.result;\n                }\n            }\n        }\n    }\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n    // This \"if\" is needed for plain objects\n    if ( elem.removeEventListener ) {\n        elem.removeEventListener( type, handle );\n    }\n};\n\njQuery.Event = function( src, props ) {\n\n    // Allow instantiation without the 'new' keyword\n    if ( !( this instanceof jQuery.Event ) ) {\n        return new jQuery.Event( src, props );\n    }\n\n    // Event object\n    if ( src && src.type ) {\n        this.originalEvent = src;\n        this.type = src.type;\n\n        // Events bubbling up the document may have been marked as prevented\n        // by a handler lower down the tree; reflect the correct value.\n        this.isDefaultPrevented = src.defaultPrevented ||\n                src.defaultPrevented === undefined &&\n\n                // Support: Android <=2.3 only\n                src.returnValue === false ?\n            returnTrue :\n            returnFalse;\n\n        // Create target properties\n        // Support: Safari <=6 - 7 only\n        // Target should not be a text node (#504, #13143)\n        this.target = ( src.target && src.target.nodeType === 3 ) ?\n            src.target.parentNode :\n            src.target;\n\n        this.currentTarget = src.currentTarget;\n        this.relatedTarget = src.relatedTarget;\n\n    // Event type\n    } else {\n        this.type = src;\n    }\n\n    // Put explicitly provided properties onto the event object\n    if ( props ) {\n        jQuery.extend( this, props );\n    }\n\n    // Create a timestamp if incoming event doesn't have one\n    this.timeStamp = src && src.timeStamp || jQuery.now();\n\n    // Mark it as fixed\n    this[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n    constructor: jQuery.Event,\n    isDefaultPrevented: returnFalse,\n    isPropagationStopped: returnFalse,\n    isImmediatePropagationStopped: returnFalse,\n    isSimulated: false,\n\n    preventDefault: function() {\n        var e = this.originalEvent;\n\n        this.isDefaultPrevented = returnTrue;\n\n        if ( e && !this.isSimulated ) {\n            e.preventDefault();\n        }\n    },\n    stopPropagation: function() {\n        var e = this.originalEvent;\n\n        this.isPropagationStopped = returnTrue;\n\n        if ( e && !this.isSimulated ) {\n            e.stopPropagation();\n        }\n    },\n    stopImmediatePropagation: function() {\n        var e = this.originalEvent;\n\n        this.isImmediatePropagationStopped = returnTrue;\n\n        if ( e && !this.isSimulated ) {\n            e.stopImmediatePropagation();\n        }\n\n        this.stopPropagation();\n    }\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n    altKey: true,\n    bubbles: true,\n    cancelable: true,\n    changedTouches: true,\n    ctrlKey: true,\n    detail: true,\n    eventPhase: true,\n    metaKey: true,\n    pageX: true,\n    pageY: true,\n    shiftKey: true,\n    view: true,\n    \"char\": true,\n    charCode: true,\n    key: true,\n    keyCode: true,\n    button: true,\n    buttons: true,\n    clientX: true,\n    clientY: true,\n    offsetX: true,\n    offsetY: true,\n    pointerId: true,\n    pointerType: true,\n    screenX: true,\n    screenY: true,\n    targetTouches: true,\n    toElement: true,\n    touches: true,\n\n    which: function( event ) {\n        var button = event.button;\n\n        // Add which for key events\n        if ( event.which == null && rkeyEvent.test( event.type ) ) {\n            return event.charCode != null ? event.charCode : event.keyCode;\n        }\n\n        // Add which for click: 1 === left; 2 === middle; 3 === right\n        if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n            if ( button & 1 ) {\n                return 1;\n            }\n\n            if ( button & 2 ) {\n                return 3;\n            }\n\n            if ( button & 4 ) {\n                return 2;\n            }\n\n            return 0;\n        }\n\n        return event.which;\n    }\n}, jQuery.event.addProp );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n    mouseenter: \"mouseover\",\n    mouseleave: \"mouseout\",\n    pointerenter: \"pointerover\",\n    pointerleave: \"pointerout\"\n}, function( orig, fix ) {\n    jQuery.event.special[ orig ] = {\n        delegateType: fix,\n        bindType: fix,\n\n        handle: function( event ) {\n            var ret,\n                target = this,\n                related = event.relatedTarget,\n                handleObj = event.handleObj;\n\n            // For mouseenter/leave call the handler if related is outside the target.\n            // NB: No relatedTarget if the mouse left/entered the browser window\n            if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n                event.type = handleObj.origType;\n                ret = handleObj.handler.apply( this, arguments );\n                event.type = fix;\n            }\n            return ret;\n        }\n    };\n} );\n\njQuery.fn.extend( {\n\n    on: function( types, selector, data, fn ) {\n        return on( this, types, selector, data, fn );\n    },\n    one: function( types, selector, data, fn ) {\n        return on( this, types, selector, data, fn, 1 );\n    },\n    off: function( types, selector, fn ) {\n        var handleObj, type;\n        if ( types && types.preventDefault && types.handleObj ) {\n\n            // ( event )  dispatched jQuery.Event\n            handleObj = types.handleObj;\n            jQuery( types.delegateTarget ).off(\n                handleObj.namespace ?\n                    handleObj.origType + \".\" + handleObj.namespace :\n                    handleObj.origType,\n                handleObj.selector,\n                handleObj.handler\n            );\n            return this;\n        }\n        if ( typeof types === \"object\" ) {\n\n            // ( types-object [, selector] )\n            for ( type in types ) {\n                this.off( type, selector, types[ type ] );\n            }\n            return this;\n        }\n        if ( selector === false || typeof selector === \"function\" ) {\n\n            // ( types [, fn] )\n            fn = selector;\n            selector = undefined;\n        }\n        if ( fn === false ) {\n            fn = returnFalse;\n        }\n        return this.each( function() {\n            jQuery.event.remove( this, types, fn, selector );\n        } );\n    }\n} );\n\n\nvar\n\n    /* eslint-disable max-len */\n\n    // See https://github.com/eslint/eslint/issues/3229\n    rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,\n\n    /* eslint-enable */\n\n    // Support: IE <=10 - 11, Edge 12 - 13\n    // In IE/Edge using regex groups here causes severe slowdowns.\n    // See https://connect.microsoft.com/IE/feedback/details/1736512/\n    rnoInnerhtml = /<script|<style|<link/i,\n\n    // checked=\"checked\" or checked\n    rchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n    rscriptTypeMasked = /^true\\/(.*)/,\n    rcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\nfunction manipulationTarget( elem, content ) {\n    if ( jQuery.nodeName( elem, \"table\" ) &&\n        jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n        return elem.getElementsByTagName( \"tbody\" )[ 0 ] || elem;\n    }\n\n    return elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n    elem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n    return elem;\n}\nfunction restoreScript( elem ) {\n    var match = rscriptTypeMasked.exec( elem.type );\n\n    if ( match ) {\n        elem.type = match[ 1 ];\n    } else {\n        elem.removeAttribute( \"type\" );\n    }\n\n    return elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n    var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n    if ( dest.nodeType !== 1 ) {\n        return;\n    }\n\n    // 1. Copy private data: events, handlers, etc.\n    if ( dataPriv.hasData( src ) ) {\n        pdataOld = dataPriv.access( src );\n        pdataCur = dataPriv.set( dest, pdataOld );\n        events = pdataOld.events;\n\n        if ( events ) {\n            delete pdataCur.handle;\n            pdataCur.events = {};\n\n            for ( type in events ) {\n                for ( i = 0, l = events[ type ].length; i < l; i++ ) {\n                    jQuery.event.add( dest, type, events[ type ][ i ] );\n                }\n            }\n        }\n    }\n\n    // 2. Copy user data\n    if ( dataUser.hasData( src ) ) {\n        udataOld = dataUser.access( src );\n        udataCur = jQuery.extend( {}, udataOld );\n\n        dataUser.set( dest, udataCur );\n    }\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n    var nodeName = dest.nodeName.toLowerCase();\n\n    // Fails to persist the checked state of a cloned checkbox or radio button.\n    if ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n        dest.checked = src.checked;\n\n    // Fails to return the selected option to the default selected state when cloning options\n    } else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n        dest.defaultValue = src.defaultValue;\n    }\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n    // Flatten any nested arrays\n    args = concat.apply( [], args );\n\n    var fragment, first, scripts, hasScripts, node, doc,\n        i = 0,\n        l = collection.length,\n        iNoClone = l - 1,\n        value = args[ 0 ],\n        isFunction = jQuery.isFunction( value );\n\n    // We can't cloneNode fragments that contain checked, in WebKit\n    if ( isFunction ||\n            ( l > 1 && typeof value === \"string\" &&\n                !support.checkClone && rchecked.test( value ) ) ) {\n        return collection.each( function( index ) {\n            var self = collection.eq( index );\n            if ( isFunction ) {\n                args[ 0 ] = value.call( this, index, self.html() );\n            }\n            domManip( self, args, callback, ignored );\n        } );\n    }\n\n    if ( l ) {\n        fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n        first = fragment.firstChild;\n\n        if ( fragment.childNodes.length === 1 ) {\n            fragment = first;\n        }\n\n        // Require either new content or an interest in ignored elements to invoke the callback\n        if ( first || ignored ) {\n            scripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n            hasScripts = scripts.length;\n\n            // Use the original fragment for the last item\n            // instead of the first because it can end up\n            // being emptied incorrectly in certain situations (#8070).\n            for ( ; i < l; i++ ) {\n                node = fragment;\n\n                if ( i !== iNoClone ) {\n                    node = jQuery.clone( node, true, true );\n\n                    // Keep references to cloned scripts for later restoration\n                    if ( hasScripts ) {\n\n                        // Support: Android <=4.0 only, PhantomJS 1 only\n                        // push.apply(_, arraylike) throws on ancient WebKit\n                        jQuery.merge( scripts, getAll( node, \"script\" ) );\n                    }\n                }\n\n                callback.call( collection[ i ], node, i );\n            }\n\n            if ( hasScripts ) {\n                doc = scripts[ scripts.length - 1 ].ownerDocument;\n\n                // Reenable scripts\n                jQuery.map( scripts, restoreScript );\n\n                // Evaluate executable scripts on first document insertion\n                for ( i = 0; i < hasScripts; i++ ) {\n                    node = scripts[ i ];\n                    if ( rscriptType.test( node.type || \"\" ) &&\n                        !dataPriv.access( node, \"globalEval\" ) &&\n                        jQuery.contains( doc, node ) ) {\n\n                        if ( node.src ) {\n\n                            // Optional AJAX dependency, but won't run scripts if not present\n                            if ( jQuery._evalUrl ) {\n                                jQuery._evalUrl( node.src );\n                            }\n                        } else {\n                            DOMEval( node.textContent.replace( rcleanScript, \"\" ), doc );\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    return collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n    var node,\n        nodes = selector ? jQuery.filter( selector, elem ) : elem,\n        i = 0;\n\n    for ( ; ( node = nodes[ i ] ) != null; i++ ) {\n        if ( !keepData && node.nodeType === 1 ) {\n            jQuery.cleanData( getAll( node ) );\n        }\n\n        if ( node.parentNode ) {\n            if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {\n                setGlobalEval( getAll( node, \"script\" ) );\n            }\n            node.parentNode.removeChild( node );\n        }\n    }\n\n    return elem;\n}\n\njQuery.extend( {\n    htmlPrefilter: function( html ) {\n        return html.replace( rxhtmlTag, \"<$1></$2>\" );\n    },\n\n    clone: function( elem, dataAndEvents, deepDataAndEvents ) {\n        var i, l, srcElements, destElements,\n            clone = elem.cloneNode( true ),\n            inPage = jQuery.contains( elem.ownerDocument, elem );\n\n        // Fix IE cloning issues\n        if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n                !jQuery.isXMLDoc( elem ) ) {\n\n            // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n            destElements = getAll( clone );\n            srcElements = getAll( elem );\n\n            for ( i = 0, l = srcElements.length; i < l; i++ ) {\n                fixInput( srcElements[ i ], destElements[ i ] );\n            }\n        }\n\n        // Copy the events from the original to the clone\n        if ( dataAndEvents ) {\n            if ( deepDataAndEvents ) {\n                srcElements = srcElements || getAll( elem );\n                destElements = destElements || getAll( clone );\n\n                for ( i = 0, l = srcElements.length; i < l; i++ ) {\n                    cloneCopyEvent( srcElements[ i ], destElements[ i ] );\n                }\n            } else {\n                cloneCopyEvent( elem, clone );\n            }\n        }\n\n        // Preserve script evaluation history\n        destElements = getAll( clone, \"script\" );\n        if ( destElements.length > 0 ) {\n            setGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n        }\n\n        // Return the cloned set\n        return clone;\n    },\n\n    cleanData: function( elems ) {\n        var data, elem, type,\n            special = jQuery.event.special,\n            i = 0;\n\n        for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n            if ( acceptData( elem ) ) {\n                if ( ( data = elem[ dataPriv.expando ] ) ) {\n                    if ( data.events ) {\n                        for ( type in data.events ) {\n                            if ( special[ type ] ) {\n                                jQuery.event.remove( elem, type );\n\n                            // This is a shortcut to avoid jQuery.event.remove's overhead\n                            } else {\n                                jQuery.removeEvent( elem, type, data.handle );\n                            }\n                        }\n                    }\n\n                    // Support: Chrome <=35 - 45+\n                    // Assign undefined instead of using delete, see Data#remove\n                    elem[ dataPriv.expando ] = undefined;\n                }\n                if ( elem[ dataUser.expando ] ) {\n\n                    // Support: Chrome <=35 - 45+\n                    // Assign undefined instead of using delete, see Data#remove\n                    elem[ dataUser.expando ] = undefined;\n                }\n            }\n        }\n    }\n} );\n\njQuery.fn.extend( {\n    detach: function( selector ) {\n        return remove( this, selector, true );\n    },\n\n    remove: function( selector ) {\n        return remove( this, selector );\n    },\n\n    text: function( value ) {\n        return access( this, function( value ) {\n            return value === undefined ?\n                jQuery.text( this ) :\n                this.empty().each( function() {\n                    if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n                        this.textContent = value;\n                    }\n                } );\n        }, null, value, arguments.length );\n    },\n\n    append: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n                var target = manipulationTarget( this, elem );\n                target.appendChild( elem );\n            }\n        } );\n    },\n\n    prepend: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n                var target = manipulationTarget( this, elem );\n                target.insertBefore( elem, target.firstChild );\n            }\n        } );\n    },\n\n    before: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.parentNode ) {\n                this.parentNode.insertBefore( elem, this );\n            }\n        } );\n    },\n\n    after: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.parentNode ) {\n                this.parentNode.insertBefore( elem, this.nextSibling );\n            }\n        } );\n    },\n\n    empty: function() {\n        var elem,\n            i = 0;\n\n        for ( ; ( elem = this[ i ] ) != null; i++ ) {\n            if ( elem.nodeType === 1 ) {\n\n                // Prevent memory leaks\n                jQuery.cleanData( getAll( elem, false ) );\n\n                // Remove any remaining nodes\n                elem.textContent = \"\";\n            }\n        }\n\n        return this;\n    },\n\n    clone: function( dataAndEvents, deepDataAndEvents ) {\n        dataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n        deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n        return this.map( function() {\n            return jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n        } );\n    },\n\n    html: function( value ) {\n        return access( this, function( value ) {\n            var elem = this[ 0 ] || {},\n                i = 0,\n                l = this.length;\n\n            if ( value === undefined && elem.nodeType === 1 ) {\n                return elem.innerHTML;\n            }\n\n            // See if we can take a shortcut and just use innerHTML\n            if ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n                !wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n                value = jQuery.htmlPrefilter( value );\n\n                try {\n                    for ( ; i < l; i++ ) {\n                        elem = this[ i ] || {};\n\n                        // Remove element nodes and prevent memory leaks\n                        if ( elem.nodeType === 1 ) {\n                            jQuery.cleanData( getAll( elem, false ) );\n                            elem.innerHTML = value;\n                        }\n                    }\n\n                    elem = 0;\n\n                // If using innerHTML throws an exception, use the fallback method\n                } catch ( e ) {}\n            }\n\n            if ( elem ) {\n                this.empty().append( value );\n            }\n        }, null, value, arguments.length );\n    },\n\n    replaceWith: function() {\n        var ignored = [];\n\n        // Make the changes, replacing each non-ignored context element with the new content\n        return domManip( this, arguments, function( elem ) {\n            var parent = this.parentNode;\n\n            if ( jQuery.inArray( this, ignored ) < 0 ) {\n                jQuery.cleanData( getAll( this ) );\n                if ( parent ) {\n                    parent.replaceChild( elem, this );\n                }\n            }\n\n        // Force callback invocation\n        }, ignored );\n    }\n} );\n\njQuery.each( {\n    appendTo: \"append\",\n    prependTo: \"prepend\",\n    insertBefore: \"before\",\n    insertAfter: \"after\",\n    replaceAll: \"replaceWith\"\n}, function( name, original ) {\n    jQuery.fn[ name ] = function( selector ) {\n        var elems,\n            ret = [],\n            insert = jQuery( selector ),\n            last = insert.length - 1,\n            i = 0;\n\n        for ( ; i <= last; i++ ) {\n            elems = i === last ? this : this.clone( true );\n            jQuery( insert[ i ] )[ original ]( elems );\n\n            // Support: Android <=4.0 only, PhantomJS 1 only\n            // .get() because push.apply(_, arraylike) throws on ancient WebKit\n            push.apply( ret, elems.get() );\n        }\n\n        return this.pushStack( ret );\n    };\n} );\nvar rmargin = ( /^margin/ );\n\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n        // Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n        // IE throws on elements created in popups\n        // FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n        var view = elem.ownerDocument.defaultView;\n\n        if ( !view || !view.opener ) {\n            view = window;\n        }\n\n        return view.getComputedStyle( elem );\n    };\n\n\n\n( function() {\n\n    // Executing both pixelPosition & boxSizingReliable tests require only one layout\n    // so they're executed at the same time to save the second computation.\n    function computeStyleTests() {\n\n        // This is a singleton, we need to execute it only once\n        if ( !div ) {\n            return;\n        }\n\n        div.style.cssText =\n            \"box-sizing:border-box;\" +\n            \"position:relative;display:block;\" +\n            \"margin:auto;border:1px;padding:1px;\" +\n            \"top:1%;width:50%\";\n        div.innerHTML = \"\";\n        documentElement.appendChild( container );\n\n        var divStyle = window.getComputedStyle( div );\n        pixelPositionVal = divStyle.top !== \"1%\";\n\n        // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n        reliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n        boxSizingReliableVal = divStyle.width === \"4px\";\n\n        // Support: Android 4.0 - 4.3 only\n        // Some styles come back with percentage values, even though they shouldn't\n        div.style.marginRight = \"50%\";\n        pixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n        documentElement.removeChild( container );\n\n        // Nullify the div so it wouldn't be stored in the memory and\n        // it will also be a sign that checks already performed\n        div = null;\n    }\n\n    var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,\n        container = document.createElement( \"div\" ),\n        div = document.createElement( \"div\" );\n\n    // Finish early in limited (non-browser) environments\n    if ( !div.style ) {\n        return;\n    }\n\n    // Support: IE <=9 - 11 only\n    // Style of cloned element affects source element cloned (#8908)\n    div.style.backgroundClip = \"content-box\";\n    div.cloneNode( true ).style.backgroundClip = \"\";\n    support.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n    container.style.cssText = \"border:0;width:8px;height:0;top:0;left:-9999px;\" +\n        \"padding:0;margin-top:1px;position:absolute\";\n    container.appendChild( div );\n\n    jQuery.extend( support, {\n        pixelPosition: function() {\n            computeStyleTests();\n            return pixelPositionVal;\n        },\n        boxSizingReliable: function() {\n            computeStyleTests();\n            return boxSizingReliableVal;\n        },\n        pixelMarginRight: function() {\n            computeStyleTests();\n            return pixelMarginRightVal;\n        },\n        reliableMarginLeft: function() {\n            computeStyleTests();\n            return reliableMarginLeftVal;\n        }\n    } );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n    var width, minWidth, maxWidth, ret,\n        style = elem.style;\n\n    computed = computed || getStyles( elem );\n\n    // Support: IE <=9 only\n    // getPropertyValue is only needed for .css('filter') (#12537)\n    if ( computed ) {\n        ret = computed.getPropertyValue( name ) || computed[ name ];\n\n        if ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n            ret = jQuery.style( elem, name );\n        }\n\n        // A tribute to the \"awesome hack by Dean Edwards\"\n        // Android Browser returns percentage for some values,\n        // but width seems to be reliably pixels.\n        // This is against the CSSOM draft spec:\n        // https://drafts.csswg.org/cssom/#resolved-values\n        if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n            // Remember the original values\n            width = style.width;\n            minWidth = style.minWidth;\n            maxWidth = style.maxWidth;\n\n            // Put in the new values to get a computed value out\n            style.minWidth = style.maxWidth = style.width = ret;\n            ret = computed.width;\n\n            // Revert the changed values\n            style.width = width;\n            style.minWidth = minWidth;\n            style.maxWidth = maxWidth;\n        }\n    }\n\n    return ret !== undefined ?\n\n        // Support: IE <=9 - 11 only\n        // IE returns zIndex value as an integer.\n        ret + \"\" :\n        ret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n    // Define the hook, we'll check on the first run if it's really needed.\n    return {\n        get: function() {\n            if ( conditionFn() ) {\n\n                // Hook not needed (or it's not possible to use it due\n                // to missing dependency), remove it.\n                delete this.get;\n                return;\n            }\n\n            // Hook needed; redefine it so that the support test is not executed again.\n            return ( this.get = hookFn ).apply( this, arguments );\n        }\n    };\n}\n\n\nvar\n\n    // Swappable if display is none or starts with table\n    // except \"table\", \"table-cell\", or \"table-caption\"\n    // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n    rdisplayswap = /^(none|table(?!-c[ea]).+)/,\n    cssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n    cssNormalTransform = {\n        letterSpacing: \"0\",\n        fontWeight: \"400\"\n    },\n\n    cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n    emptyStyle = document.createElement( \"div\" ).style;\n\n// Return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( name ) {\n\n    // Shortcut for names that are not vendor prefixed\n    if ( name in emptyStyle ) {\n        return name;\n    }\n\n    // Check for vendor prefixed names\n    var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n        i = cssPrefixes.length;\n\n    while ( i-- ) {\n        name = cssPrefixes[ i ] + capName;\n        if ( name in emptyStyle ) {\n            return name;\n        }\n    }\n}\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\n    // Any relative (+/-) values have already been\n    // normalized at this point\n    var matches = rcssNum.exec( value );\n    return matches ?\n\n        // Guard against undefined \"subtract\", e.g., when used as in cssHooks\n        Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n        value;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n    var i,\n        val = 0;\n\n    // If we already have the right measurement, avoid augmentation\n    if ( extra === ( isBorderBox ? \"border\" : \"content\" ) ) {\n        i = 4;\n\n    // Otherwise initialize for horizontal or vertical properties\n    } else {\n        i = name === \"width\" ? 1 : 0;\n    }\n\n    for ( ; i < 4; i += 2 ) {\n\n        // Both box models exclude margin, so add it if we want it\n        if ( extra === \"margin\" ) {\n            val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n        }\n\n        if ( isBorderBox ) {\n\n            // border-box includes padding, so remove it if we want content\n            if ( extra === \"content\" ) {\n                val -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n            }\n\n            // At this point, extra isn't border nor margin, so remove border\n            if ( extra !== \"margin\" ) {\n                val -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n            }\n        } else {\n\n            // At this point, extra isn't content, so add padding\n            val += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n            // At this point, extra isn't content nor padding, so add border\n            if ( extra !== \"padding\" ) {\n                val += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n            }\n        }\n    }\n\n    return val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n    // Start with offset property, which is equivalent to the border-box value\n    var val,\n        valueIsBorderBox = true,\n        styles = getStyles( elem ),\n        isBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n    // Support: IE <=11 only\n    // Running getBoundingClientRect on a disconnected node\n    // in IE throws an error.\n    if ( elem.getClientRects().length ) {\n        val = elem.getBoundingClientRect()[ name ];\n    }\n\n    // Some non-html elements return undefined for offsetWidth, so check for null/undefined\n    // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n    // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n    if ( val <= 0 || val == null ) {\n\n        // Fall back to computed then uncomputed css if necessary\n        val = curCSS( elem, name, styles );\n        if ( val < 0 || val == null ) {\n            val = elem.style[ name ];\n        }\n\n        // Computed unit is not pixels. Stop here and return.\n        if ( rnumnonpx.test( val ) ) {\n            return val;\n        }\n\n        // Check for style in case a browser which returns unreliable values\n        // for getComputedStyle silently falls back to the reliable elem.style\n        valueIsBorderBox = isBorderBox &&\n            ( support.boxSizingReliable() || val === elem.style[ name ] );\n\n        // Normalize \"\", auto, and prepare for extra\n        val = parseFloat( val ) || 0;\n    }\n\n    // Use the active box-sizing model to add/subtract irrelevant styles\n    return ( val +\n        augmentWidthOrHeight(\n            elem,\n            name,\n            extra || ( isBorderBox ? \"border\" : \"content\" ),\n            valueIsBorderBox,\n            styles\n        )\n    ) + \"px\";\n}\n\njQuery.extend( {\n\n    // Add in style property hooks for overriding the default\n    // behavior of getting and setting a style property\n    cssHooks: {\n        opacity: {\n            get: function( elem, computed ) {\n                if ( computed ) {\n\n                    // We should always get a number back from opacity\n                    var ret = curCSS( elem, \"opacity\" );\n                    return ret === \"\" ? \"1\" : ret;\n                }\n            }\n        }\n    },\n\n    // Don't automatically add \"px\" to these possibly-unitless properties\n    cssNumber: {\n        \"animationIterationCount\": true,\n        \"columnCount\": true,\n        \"fillOpacity\": true,\n        \"flexGrow\": true,\n        \"flexShrink\": true,\n        \"fontWeight\": true,\n        \"lineHeight\": true,\n        \"opacity\": true,\n        \"order\": true,\n        \"orphans\": true,\n        \"widows\": true,\n        \"zIndex\": true,\n        \"zoom\": true\n    },\n\n    // Add in properties whose names you wish to fix before\n    // setting or getting the value\n    cssProps: {\n        \"float\": \"cssFloat\"\n    },\n\n    // Get and set the style property on a DOM Node\n    style: function( elem, name, value, extra ) {\n\n        // Don't set styles on text and comment nodes\n        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n            return;\n        }\n\n        // Make sure that we're working with the right name\n        var ret, type, hooks,\n            origName = jQuery.camelCase( name ),\n            style = elem.style;\n\n        name = jQuery.cssProps[ origName ] ||\n            ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );\n\n        // Gets hook for the prefixed version, then unprefixed version\n        hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n        // Check if we're setting a value\n        if ( value !== undefined ) {\n            type = typeof value;\n\n            // Convert \"+=\" or \"-=\" to relative numbers (#7345)\n            if ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n                value = adjustCSS( elem, name, ret );\n\n                // Fixes bug #9237\n                type = \"number\";\n            }\n\n            // Make sure that null and NaN values aren't set (#7116)\n            if ( value == null || value !== value ) {\n                return;\n            }\n\n            // If a number was passed in, add the unit (except for certain CSS properties)\n            if ( type === \"number\" ) {\n                value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n            }\n\n            // background-* props affect original clone's values\n            if ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n                style[ name ] = \"inherit\";\n            }\n\n            // If a hook was provided, use that value, otherwise just set the specified value\n            if ( !hooks || !( \"set\" in hooks ) ||\n                ( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n                style[ name ] = value;\n            }\n\n        } else {\n\n            // If a hook was provided get the non-computed value from there\n            if ( hooks && \"get\" in hooks &&\n                ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n                return ret;\n            }\n\n            // Otherwise just get the value from the style object\n            return style[ name ];\n        }\n    },\n\n    css: function( elem, name, extra, styles ) {\n        var val, num, hooks,\n            origName = jQuery.camelCase( name );\n\n        // Make sure that we're working with the right name\n        name = jQuery.cssProps[ origName ] ||\n            ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );\n\n        // Try prefixed name followed by the unprefixed name\n        hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n        // If a hook was provided get the computed value from there\n        if ( hooks && \"get\" in hooks ) {\n            val = hooks.get( elem, true, extra );\n        }\n\n        // Otherwise, if a way to get the computed value exists, use that\n        if ( val === undefined ) {\n            val = curCSS( elem, name, styles );\n        }\n\n        // Convert \"normal\" to computed value\n        if ( val === \"normal\" && name in cssNormalTransform ) {\n            val = cssNormalTransform[ name ];\n        }\n\n        // Make numeric if forced or a qualifier was provided and val looks numeric\n        if ( extra === \"\" || extra ) {\n            num = parseFloat( val );\n            return extra === true || isFinite( num ) ? num || 0 : val;\n        }\n        return val;\n    }\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( i, name ) {\n    jQuery.cssHooks[ name ] = {\n        get: function( elem, computed, extra ) {\n            if ( computed ) {\n\n                // Certain elements can have dimension info if we invisibly show them\n                // but it must have a current display style that would benefit\n                return rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n                    // Support: Safari 8+\n                    // Table columns in Safari have non-zero offsetWidth & zero\n                    // getBoundingClientRect().width unless display is changed.\n                    // Support: IE <=11 only\n                    // Running getBoundingClientRect on a disconnected node\n                    // in IE throws an error.\n                    ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n                        swap( elem, cssShow, function() {\n                            return getWidthOrHeight( elem, name, extra );\n                        } ) :\n                        getWidthOrHeight( elem, name, extra );\n            }\n        },\n\n        set: function( elem, value, extra ) {\n            var matches,\n                styles = extra && getStyles( elem ),\n                subtract = extra && augmentWidthOrHeight(\n                    elem,\n                    name,\n                    extra,\n                    jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n                    styles\n                );\n\n            // Convert to pixels if value adjustment is needed\n            if ( subtract && ( matches = rcssNum.exec( value ) ) &&\n                ( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n                elem.style[ name ] = value;\n                value = jQuery.css( elem, name );\n            }\n\n            return setPositiveNumber( elem, value, subtract );\n        }\n    };\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n    function( elem, computed ) {\n        if ( computed ) {\n            return ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n                elem.getBoundingClientRect().left -\n                    swap( elem, { marginLeft: 0 }, function() {\n                        return elem.getBoundingClientRect().left;\n                    } )\n                ) + \"px\";\n        }\n    }\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n    margin: \"\",\n    padding: \"\",\n    border: \"Width\"\n}, function( prefix, suffix ) {\n    jQuery.cssHooks[ prefix + suffix ] = {\n        expand: function( value ) {\n            var i = 0,\n                expanded = {},\n\n                // Assumes a single number if not a string\n                parts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n            for ( ; i < 4; i++ ) {\n                expanded[ prefix + cssExpand[ i ] + suffix ] =\n                    parts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n            }\n\n            return expanded;\n        }\n    };\n\n    if ( !rmargin.test( prefix ) ) {\n        jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n    }\n} );\n\njQuery.fn.extend( {\n    css: function( name, value ) {\n        return access( this, function( elem, name, value ) {\n            var styles, len,\n                map = {},\n                i = 0;\n\n            if ( jQuery.isArray( name ) ) {\n                styles = getStyles( elem );\n                len = name.length;\n\n                for ( ; i < len; i++ ) {\n                    map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n                }\n\n                return map;\n            }\n\n            return value !== undefined ?\n                jQuery.style( elem, name, value ) :\n                jQuery.css( elem, name );\n        }, name, value, arguments.length > 1 );\n    }\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n    return new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n    constructor: Tween,\n    init: function( elem, options, prop, end, easing, unit ) {\n        this.elem = elem;\n        this.prop = prop;\n        this.easing = easing || jQuery.easing._default;\n        this.options = options;\n        this.start = this.now = this.cur();\n        this.end = end;\n        this.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n    },\n    cur: function() {\n        var hooks = Tween.propHooks[ this.prop ];\n\n        return hooks && hooks.get ?\n            hooks.get( this ) :\n            Tween.propHooks._default.get( this );\n    },\n    run: function( percent ) {\n        var eased,\n            hooks = Tween.propHooks[ this.prop ];\n\n        if ( this.options.duration ) {\n            this.pos = eased = jQuery.easing[ this.easing ](\n                percent, this.options.duration * percent, 0, 1, this.options.duration\n            );\n        } else {\n            this.pos = eased = percent;\n        }\n        this.now = ( this.end - this.start ) * eased + this.start;\n\n        if ( this.options.step ) {\n            this.options.step.call( this.elem, this.now, this );\n        }\n\n        if ( hooks && hooks.set ) {\n            hooks.set( this );\n        } else {\n            Tween.propHooks._default.set( this );\n        }\n        return this;\n    }\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n    _default: {\n        get: function( tween ) {\n            var result;\n\n            // Use a property on the element directly when it is not a DOM element,\n            // or when there is no matching style property that exists.\n            if ( tween.elem.nodeType !== 1 ||\n                tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n                return tween.elem[ tween.prop ];\n            }\n\n            // Passing an empty string as a 3rd parameter to .css will automatically\n            // attempt a parseFloat and fallback to a string if the parse fails.\n            // Simple values such as \"10px\" are parsed to Float;\n            // complex values such as \"rotate(1rad)\" are returned as-is.\n            result = jQuery.css( tween.elem, tween.prop, \"\" );\n\n            // Empty strings, null, undefined and \"auto\" are converted to 0.\n            return !result || result === \"auto\" ? 0 : result;\n        },\n        set: function( tween ) {\n\n            // Use step hook for back compat.\n            // Use cssHook if its there.\n            // Use .style if available and use plain properties where available.\n            if ( jQuery.fx.step[ tween.prop ] ) {\n                jQuery.fx.step[ tween.prop ]( tween );\n            } else if ( tween.elem.nodeType === 1 &&\n                ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||\n                    jQuery.cssHooks[ tween.prop ] ) ) {\n                jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n            } else {\n                tween.elem[ tween.prop ] = tween.now;\n            }\n        }\n    }\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n    set: function( tween ) {\n        if ( tween.elem.nodeType && tween.elem.parentNode ) {\n            tween.elem[ tween.prop ] = tween.now;\n        }\n    }\n};\n\njQuery.easing = {\n    linear: function( p ) {\n        return p;\n    },\n    swing: function( p ) {\n        return 0.5 - Math.cos( p * Math.PI ) / 2;\n    },\n    _default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n    fxNow, timerId,\n    rfxtypes = /^(?:toggle|show|hide)$/,\n    rrun = /queueHooks$/;\n\nfunction raf() {\n    if ( timerId ) {\n        window.requestAnimationFrame( raf );\n        jQuery.fx.tick();\n    }\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n    window.setTimeout( function() {\n        fxNow = undefined;\n    } );\n    return ( fxNow = jQuery.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n    var which,\n        i = 0,\n        attrs = { height: type };\n\n    // If we include width, step value is 1 to do all cssExpand values,\n    // otherwise step value is 2 to skip over Left and Right\n    includeWidth = includeWidth ? 1 : 0;\n    for ( ; i < 4; i += 2 - includeWidth ) {\n        which = cssExpand[ i ];\n        attrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n    }\n\n    if ( includeWidth ) {\n        attrs.opacity = attrs.width = type;\n    }\n\n    return attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n    var tween,\n        collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n        index = 0,\n        length = collection.length;\n    for ( ; index < length; index++ ) {\n        if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n            // We're done with this property\n            return tween;\n        }\n    }\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n    var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n        isBox = \"width\" in props || \"height\" in props,\n        anim = this,\n        orig = {},\n        style = elem.style,\n        hidden = elem.nodeType && isHiddenWithinTree( elem ),\n        dataShow = dataPriv.get( elem, \"fxshow\" );\n\n    // Queue-skipping animations hijack the fx hooks\n    if ( !opts.queue ) {\n        hooks = jQuery._queueHooks( elem, \"fx\" );\n        if ( hooks.unqueued == null ) {\n            hooks.unqueued = 0;\n            oldfire = hooks.empty.fire;\n            hooks.empty.fire = function() {\n                if ( !hooks.unqueued ) {\n                    oldfire();\n                }\n            };\n        }\n        hooks.unqueued++;\n\n        anim.always( function() {\n\n            // Ensure the complete handler is called before this completes\n            anim.always( function() {\n                hooks.unqueued--;\n                if ( !jQuery.queue( elem, \"fx\" ).length ) {\n                    hooks.empty.fire();\n                }\n            } );\n        } );\n    }\n\n    // Detect show/hide animations\n    for ( prop in props ) {\n        value = props[ prop ];\n        if ( rfxtypes.test( value ) ) {\n            delete props[ prop ];\n            toggle = toggle || value === \"toggle\";\n            if ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n                // Pretend to be hidden if this is a \"show\" and\n                // there is still data from a stopped show/hide\n                if ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n                    hidden = true;\n\n                // Ignore all other no-op show/hide data\n                } else {\n                    continue;\n                }\n            }\n            orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n        }\n    }\n\n    // Bail out if this is a no-op like .hide().hide()\n    propTween = !jQuery.isEmptyObject( props );\n    if ( !propTween && jQuery.isEmptyObject( orig ) ) {\n        return;\n    }\n\n    // Restrict \"overflow\" and \"display\" styles during box animations\n    if ( isBox && elem.nodeType === 1 ) {\n\n        // Support: IE <=9 - 11, Edge 12 - 13\n        // Record all 3 overflow attributes because IE does not infer the shorthand\n        // from identically-valued overflowX and overflowY\n        opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n        // Identify a display type, preferring old show/hide data over the CSS cascade\n        restoreDisplay = dataShow && dataShow.display;\n        if ( restoreDisplay == null ) {\n            restoreDisplay = dataPriv.get( elem, \"display\" );\n        }\n        display = jQuery.css( elem, \"display\" );\n        if ( display === \"none\" ) {\n            if ( restoreDisplay ) {\n                display = restoreDisplay;\n            } else {\n\n                // Get nonempty value(s) by temporarily forcing visibility\n                showHide( [ elem ], true );\n                restoreDisplay = elem.style.display || restoreDisplay;\n                display = jQuery.css( elem, \"display\" );\n                showHide( [ elem ] );\n            }\n        }\n\n        // Animate inline elements as inline-block\n        if ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n            if ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n                // Restore the original display value at the end of pure show/hide animations\n                if ( !propTween ) {\n                    anim.done( function() {\n                        style.display = restoreDisplay;\n                    } );\n                    if ( restoreDisplay == null ) {\n                        display = style.display;\n                        restoreDisplay = display === \"none\" ? \"\" : display;\n                    }\n                }\n                style.display = \"inline-block\";\n            }\n        }\n    }\n\n    if ( opts.overflow ) {\n        style.overflow = \"hidden\";\n        anim.always( function() {\n            style.overflow = opts.overflow[ 0 ];\n            style.overflowX = opts.overflow[ 1 ];\n            style.overflowY = opts.overflow[ 2 ];\n        } );\n    }\n\n    // Implement show/hide animations\n    propTween = false;\n    for ( prop in orig ) {\n\n        // General show/hide setup for this element animation\n        if ( !propTween ) {\n            if ( dataShow ) {\n                if ( \"hidden\" in dataShow ) {\n                    hidden = dataShow.hidden;\n                }\n            } else {\n                dataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n            }\n\n            // Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n            if ( toggle ) {\n                dataShow.hidden = !hidden;\n            }\n\n            // Show elements before animating them\n            if ( hidden ) {\n                showHide( [ elem ], true );\n            }\n\n            /* eslint-disable no-loop-func */\n\n            anim.done( function() {\n\n            /* eslint-enable no-loop-func */\n\n                // The final step of a \"hide\" animation is actually hiding the element\n                if ( !hidden ) {\n                    showHide( [ elem ] );\n                }\n                dataPriv.remove( elem, \"fxshow\" );\n                for ( prop in orig ) {\n                    jQuery.style( elem, prop, orig[ prop ] );\n                }\n            } );\n        }\n\n        // Per-property setup\n        propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n        if ( !( prop in dataShow ) ) {\n            dataShow[ prop ] = propTween.start;\n            if ( hidden ) {\n                propTween.end = propTween.start;\n                propTween.start = 0;\n            }\n        }\n    }\n}\n\nfunction propFilter( props, specialEasing ) {\n    var index, name, easing, value, hooks;\n\n    // camelCase, specialEasing and expand cssHook pass\n    for ( index in props ) {\n        name = jQuery.camelCase( index );\n        easing = specialEasing[ name ];\n        value = props[ index ];\n        if ( jQuery.isArray( value ) ) {\n            easing = value[ 1 ];\n            value = props[ index ] = value[ 0 ];\n        }\n\n        if ( index !== name ) {\n            props[ name ] = value;\n            delete props[ index ];\n        }\n\n        hooks = jQuery.cssHooks[ name ];\n        if ( hooks && \"expand\" in hooks ) {\n            value = hooks.expand( value );\n            delete props[ name ];\n\n            // Not quite $.extend, this won't overwrite existing keys.\n            // Reusing 'index' because we have the correct \"name\"\n            for ( index in value ) {\n                if ( !( index in props ) ) {\n                    props[ index ] = value[ index ];\n                    specialEasing[ index ] = easing;\n                }\n            }\n        } else {\n            specialEasing[ name ] = easing;\n        }\n    }\n}\n\nfunction Animation( elem, properties, options ) {\n    var result,\n        stopped,\n        index = 0,\n        length = Animation.prefilters.length,\n        deferred = jQuery.Deferred().always( function() {\n\n            // Don't match elem in the :animated selector\n            delete tick.elem;\n        } ),\n        tick = function() {\n            if ( stopped ) {\n                return false;\n            }\n            var currentTime = fxNow || createFxNow(),\n                remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n                // Support: Android 2.3 only\n                // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n                temp = remaining / animation.duration || 0,\n                percent = 1 - temp,\n                index = 0,\n                length = animation.tweens.length;\n\n            for ( ; index < length; index++ ) {\n                animation.tweens[ index ].run( percent );\n            }\n\n            deferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n            if ( percent < 1 && length ) {\n                return remaining;\n            } else {\n                deferred.resolveWith( elem, [ animation ] );\n                return false;\n            }\n        },\n        animation = deferred.promise( {\n            elem: elem,\n            props: jQuery.extend( {}, properties ),\n            opts: jQuery.extend( true, {\n                specialEasing: {},\n                easing: jQuery.easing._default\n            }, options ),\n            originalProperties: properties,\n            originalOptions: options,\n            startTime: fxNow || createFxNow(),\n            duration: options.duration,\n            tweens: [],\n            createTween: function( prop, end ) {\n                var tween = jQuery.Tween( elem, animation.opts, prop, end,\n                        animation.opts.specialEasing[ prop ] || animation.opts.easing );\n                animation.tweens.push( tween );\n                return tween;\n            },\n            stop: function( gotoEnd ) {\n                var index = 0,\n\n                    // If we are going to the end, we want to run all the tweens\n                    // otherwise we skip this part\n                    length = gotoEnd ? animation.tweens.length : 0;\n                if ( stopped ) {\n                    return this;\n                }\n                stopped = true;\n                for ( ; index < length; index++ ) {\n                    animation.tweens[ index ].run( 1 );\n                }\n\n                // Resolve when we played the last frame; otherwise, reject\n                if ( gotoEnd ) {\n                    deferred.notifyWith( elem, [ animation, 1, 0 ] );\n                    deferred.resolveWith( elem, [ animation, gotoEnd ] );\n                } else {\n                    deferred.rejectWith( elem, [ animation, gotoEnd ] );\n                }\n                return this;\n            }\n        } ),\n        props = animation.props;\n\n    propFilter( props, animation.opts.specialEasing );\n\n    for ( ; index < length; index++ ) {\n        result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n        if ( result ) {\n            if ( jQuery.isFunction( result.stop ) ) {\n                jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n                    jQuery.proxy( result.stop, result );\n            }\n            return result;\n        }\n    }\n\n    jQuery.map( props, createTween, animation );\n\n    if ( jQuery.isFunction( animation.opts.start ) ) {\n        animation.opts.start.call( elem, animation );\n    }\n\n    jQuery.fx.timer(\n        jQuery.extend( tick, {\n            elem: elem,\n            anim: animation,\n            queue: animation.opts.queue\n        } )\n    );\n\n    // attach callbacks from options\n    return animation.progress( animation.opts.progress )\n        .done( animation.opts.done, animation.opts.complete )\n        .fail( animation.opts.fail )\n        .always( animation.opts.always );\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n    tweeners: {\n        \"*\": [ function( prop, value ) {\n            var tween = this.createTween( prop, value );\n            adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n            return tween;\n        } ]\n    },\n\n    tweener: function( props, callback ) {\n        if ( jQuery.isFunction( props ) ) {\n            callback = props;\n            props = [ \"*\" ];\n        } else {\n            props = props.match( rnothtmlwhite );\n        }\n\n        var prop,\n            index = 0,\n            length = props.length;\n\n        for ( ; index < length; index++ ) {\n            prop = props[ index ];\n            Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n            Animation.tweeners[ prop ].unshift( callback );\n        }\n    },\n\n    prefilters: [ defaultPrefilter ],\n\n    prefilter: function( callback, prepend ) {\n        if ( prepend ) {\n            Animation.prefilters.unshift( callback );\n        } else {\n            Animation.prefilters.push( callback );\n        }\n    }\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n    var opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n        complete: fn || !fn && easing ||\n            jQuery.isFunction( speed ) && speed,\n        duration: speed,\n        easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n    };\n\n    // Go to the end state if fx are off or if document is hidden\n    if ( jQuery.fx.off || document.hidden ) {\n        opt.duration = 0;\n\n    } else {\n        if ( typeof opt.duration !== \"number\" ) {\n            if ( opt.duration in jQuery.fx.speeds ) {\n                opt.duration = jQuery.fx.speeds[ opt.duration ];\n\n            } else {\n                opt.duration = jQuery.fx.speeds._default;\n            }\n        }\n    }\n\n    // Normalize opt.queue - true/undefined/null -> \"fx\"\n    if ( opt.queue == null || opt.queue === true ) {\n        opt.queue = \"fx\";\n    }\n\n    // Queueing\n    opt.old = opt.complete;\n\n    opt.complete = function() {\n        if ( jQuery.isFunction( opt.old ) ) {\n            opt.old.call( this );\n        }\n\n        if ( opt.queue ) {\n            jQuery.dequeue( this, opt.queue );\n        }\n    };\n\n    return opt;\n};\n\njQuery.fn.extend( {\n    fadeTo: function( speed, to, easing, callback ) {\n\n        // Show any hidden elements after setting opacity to 0\n        return this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n            // Animate to the value specified\n            .end().animate( { opacity: to }, speed, easing, callback );\n    },\n    animate: function( prop, speed, easing, callback ) {\n        var empty = jQuery.isEmptyObject( prop ),\n            optall = jQuery.speed( speed, easing, callback ),\n            doAnimation = function() {\n\n                // Operate on a copy of prop so per-property easing won't be lost\n                var anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n                // Empty animations, or finishing resolves immediately\n                if ( empty || dataPriv.get( this, \"finish\" ) ) {\n                    anim.stop( true );\n                }\n            };\n            doAnimation.finish = doAnimation;\n\n        return empty || optall.queue === false ?\n            this.each( doAnimation ) :\n            this.queue( optall.queue, doAnimation );\n    },\n    stop: function( type, clearQueue, gotoEnd ) {\n        var stopQueue = function( hooks ) {\n            var stop = hooks.stop;\n            delete hooks.stop;\n            stop( gotoEnd );\n        };\n\n        if ( typeof type !== \"string\" ) {\n            gotoEnd = clearQueue;\n            clearQueue = type;\n            type = undefined;\n        }\n        if ( clearQueue && type !== false ) {\n            this.queue( type || \"fx\", [] );\n        }\n\n        return this.each( function() {\n            var dequeue = true,\n                index = type != null && type + \"queueHooks\",\n                timers = jQuery.timers,\n                data = dataPriv.get( this );\n\n            if ( index ) {\n                if ( data[ index ] && data[ index ].stop ) {\n                    stopQueue( data[ index ] );\n                }\n            } else {\n                for ( index in data ) {\n                    if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n                        stopQueue( data[ index ] );\n                    }\n                }\n            }\n\n            for ( index = timers.length; index--; ) {\n                if ( timers[ index ].elem === this &&\n                    ( type == null || timers[ index ].queue === type ) ) {\n\n                    timers[ index ].anim.stop( gotoEnd );\n                    dequeue = false;\n                    timers.splice( index, 1 );\n                }\n            }\n\n            // Start the next in the queue if the last step wasn't forced.\n            // Timers currently will call their complete callbacks, which\n            // will dequeue but only if they were gotoEnd.\n            if ( dequeue || !gotoEnd ) {\n                jQuery.dequeue( this, type );\n            }\n        } );\n    },\n    finish: function( type ) {\n        if ( type !== false ) {\n            type = type || \"fx\";\n        }\n        return this.each( function() {\n            var index,\n                data = dataPriv.get( this ),\n                queue = data[ type + \"queue\" ],\n                hooks = data[ type + \"queueHooks\" ],\n                timers = jQuery.timers,\n                length = queue ? queue.length : 0;\n\n            // Enable finishing flag on private data\n            data.finish = true;\n\n            // Empty the queue first\n            jQuery.queue( this, type, [] );\n\n            if ( hooks && hooks.stop ) {\n                hooks.stop.call( this, true );\n            }\n\n            // Look for any active animations, and finish them\n            for ( index = timers.length; index--; ) {\n                if ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n                    timers[ index ].anim.stop( true );\n                    timers.splice( index, 1 );\n                }\n            }\n\n            // Look for any animations in the old queue and finish them\n            for ( index = 0; index < length; index++ ) {\n                if ( queue[ index ] && queue[ index ].finish ) {\n                    queue[ index ].finish.call( this );\n                }\n            }\n\n            // Turn off finishing flag\n            delete data.finish;\n        } );\n    }\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n    var cssFn = jQuery.fn[ name ];\n    jQuery.fn[ name ] = function( speed, easing, callback ) {\n        return speed == null || typeof speed === \"boolean\" ?\n            cssFn.apply( this, arguments ) :\n            this.animate( genFx( name, true ), speed, easing, callback );\n    };\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n    slideDown: genFx( \"show\" ),\n    slideUp: genFx( \"hide\" ),\n    slideToggle: genFx( \"toggle\" ),\n    fadeIn: { opacity: \"show\" },\n    fadeOut: { opacity: \"hide\" },\n    fadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n    jQuery.fn[ name ] = function( speed, easing, callback ) {\n        return this.animate( props, speed, easing, callback );\n    };\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n    var timer,\n        i = 0,\n        timers = jQuery.timers;\n\n    fxNow = jQuery.now();\n\n    for ( ; i < timers.length; i++ ) {\n        timer = timers[ i ];\n\n        // Checks the timer has not already been removed\n        if ( !timer() && timers[ i ] === timer ) {\n            timers.splice( i--, 1 );\n        }\n    }\n\n    if ( !timers.length ) {\n        jQuery.fx.stop();\n    }\n    fxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n    jQuery.timers.push( timer );\n    if ( timer() ) {\n        jQuery.fx.start();\n    } else {\n        jQuery.timers.pop();\n    }\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n    if ( !timerId ) {\n        timerId = window.requestAnimationFrame ?\n            window.requestAnimationFrame( raf ) :\n            window.setInterval( jQuery.fx.tick, jQuery.fx.interval );\n    }\n};\n\njQuery.fx.stop = function() {\n    if ( window.cancelAnimationFrame ) {\n        window.cancelAnimationFrame( timerId );\n    } else {\n        window.clearInterval( timerId );\n    }\n\n    timerId = null;\n};\n\njQuery.fx.speeds = {\n    slow: 600,\n    fast: 200,\n\n    // Default speed\n    _default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n    time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n    type = type || \"fx\";\n\n    return this.queue( type, function( next, hooks ) {\n        var timeout = window.setTimeout( next, time );\n        hooks.stop = function() {\n            window.clearTimeout( timeout );\n        };\n    } );\n};\n\n\n( function() {\n    var input = document.createElement( \"input\" ),\n        select = document.createElement( \"select\" ),\n        opt = select.appendChild( document.createElement( \"option\" ) );\n\n    input.type = \"checkbox\";\n\n    // Support: Android <=4.3 only\n    // Default value for a checkbox should be \"on\"\n    support.checkOn = input.value !== \"\";\n\n    // Support: IE <=11 only\n    // Must access selectedIndex to make default options select\n    support.optSelected = opt.selected;\n\n    // Support: IE <=11 only\n    // An input loses its value after becoming a radio\n    input = document.createElement( \"input\" );\n    input.value = \"t\";\n    input.type = \"radio\";\n    support.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n    attrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n    attr: function( name, value ) {\n        return access( this, jQuery.attr, name, value, arguments.length > 1 );\n    },\n\n    removeAttr: function( name ) {\n        return this.each( function() {\n            jQuery.removeAttr( this, name );\n        } );\n    }\n} );\n\njQuery.extend( {\n    attr: function( elem, name, value ) {\n        var ret, hooks,\n            nType = elem.nodeType;\n\n        // Don't get/set attributes on text, comment and attribute nodes\n        if ( nType === 3 || nType === 8 || nType === 2 ) {\n            return;\n        }\n\n        // Fallback to prop when attributes are not supported\n        if ( typeof elem.getAttribute === \"undefined\" ) {\n            return jQuery.prop( elem, name, value );\n        }\n\n        // Attribute hooks are determined by the lowercase version\n        // Grab necessary hook if one is defined\n        if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n            hooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n                ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n        }\n\n        if ( value !== undefined ) {\n            if ( value === null ) {\n                jQuery.removeAttr( elem, name );\n                return;\n            }\n\n            if ( hooks && \"set\" in hooks &&\n                ( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n                return ret;\n            }\n\n            elem.setAttribute( name, value + \"\" );\n            return value;\n        }\n\n        if ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n            return ret;\n        }\n\n        ret = jQuery.find.attr( elem, name );\n\n        // Non-existent attributes return null, we normalize to undefined\n        return ret == null ? undefined : ret;\n    },\n\n    attrHooks: {\n        type: {\n            set: function( elem, value ) {\n                if ( !support.radioValue && value === \"radio\" &&\n                    jQuery.nodeName( elem, \"input\" ) ) {\n                    var val = elem.value;\n                    elem.setAttribute( \"type\", value );\n                    if ( val ) {\n                        elem.value = val;\n                    }\n                    return value;\n                }\n            }\n        }\n    },\n\n    removeAttr: function( elem, value ) {\n        var name,\n            i = 0,\n\n            // Attribute names can contain non-HTML whitespace characters\n            // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n            attrNames = value && value.match( rnothtmlwhite );\n\n        if ( attrNames && elem.nodeType === 1 ) {\n            while ( ( name = attrNames[ i++ ] ) ) {\n                elem.removeAttribute( name );\n            }\n        }\n    }\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n    set: function( elem, value, name ) {\n        if ( value === false ) {\n\n            // Remove boolean attributes when set to false\n            jQuery.removeAttr( elem, name );\n        } else {\n            elem.setAttribute( name, name );\n        }\n        return name;\n    }\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n    var getter = attrHandle[ name ] || jQuery.find.attr;\n\n    attrHandle[ name ] = function( elem, name, isXML ) {\n        var ret, handle,\n            lowercaseName = name.toLowerCase();\n\n        if ( !isXML ) {\n\n            // Avoid an infinite loop by temporarily removing this function from the getter\n            handle = attrHandle[ lowercaseName ];\n            attrHandle[ lowercaseName ] = ret;\n            ret = getter( elem, name, isXML ) != null ?\n                lowercaseName :\n                null;\n            attrHandle[ lowercaseName ] = handle;\n        }\n        return ret;\n    };\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n    rclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n    prop: function( name, value ) {\n        return access( this, jQuery.prop, name, value, arguments.length > 1 );\n    },\n\n    removeProp: function( name ) {\n        return this.each( function() {\n            delete this[ jQuery.propFix[ name ] || name ];\n        } );\n    }\n} );\n\njQuery.extend( {\n    prop: function( elem, name, value ) {\n        var ret, hooks,\n            nType = elem.nodeType;\n\n        // Don't get/set properties on text, comment and attribute nodes\n        if ( nType === 3 || nType === 8 || nType === 2 ) {\n            return;\n        }\n\n        if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n            // Fix name and attach hooks\n            name = jQuery.propFix[ name ] || name;\n            hooks = jQuery.propHooks[ name ];\n        }\n\n        if ( value !== undefined ) {\n            if ( hooks && \"set\" in hooks &&\n                ( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n                return ret;\n            }\n\n            return ( elem[ name ] = value );\n        }\n\n        if ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n            return ret;\n        }\n\n        return elem[ name ];\n    },\n\n    propHooks: {\n        tabIndex: {\n            get: function( elem ) {\n\n                // Support: IE <=9 - 11 only\n                // elem.tabIndex doesn't always return the\n                // correct value when it hasn't been explicitly set\n                // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n                // Use proper attribute retrieval(#12072)\n                var tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n                if ( tabindex ) {\n                    return parseInt( tabindex, 10 );\n                }\n\n                if (\n                    rfocusable.test( elem.nodeName ) ||\n                    rclickable.test( elem.nodeName ) &&\n                    elem.href\n                ) {\n                    return 0;\n                }\n\n                return -1;\n            }\n        }\n    },\n\n    propFix: {\n        \"for\": \"htmlFor\",\n        \"class\": \"className\"\n    }\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n    jQuery.propHooks.selected = {\n        get: function( elem ) {\n\n            /* eslint no-unused-expressions: \"off\" */\n\n            var parent = elem.parentNode;\n            if ( parent && parent.parentNode ) {\n                parent.parentNode.selectedIndex;\n            }\n            return null;\n        },\n        set: function( elem ) {\n\n            /* eslint no-unused-expressions: \"off\" */\n\n            var parent = elem.parentNode;\n            if ( parent ) {\n                parent.selectedIndex;\n\n                if ( parent.parentNode ) {\n                    parent.parentNode.selectedIndex;\n                }\n            }\n        }\n    };\n}\n\njQuery.each( [\n    \"tabIndex\",\n    \"readOnly\",\n    \"maxLength\",\n    \"cellSpacing\",\n    \"cellPadding\",\n    \"rowSpan\",\n    \"colSpan\",\n    \"useMap\",\n    \"frameBorder\",\n    \"contentEditable\"\n], function() {\n    jQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n    // Strip and collapse whitespace according to HTML spec\n    // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace\n    function stripAndCollapse( value ) {\n        var tokens = value.match( rnothtmlwhite ) || [];\n        return tokens.join( \" \" );\n    }\n\n\nfunction getClass( elem ) {\n    return elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\njQuery.fn.extend( {\n    addClass: function( value ) {\n        var classes, elem, cur, curValue, clazz, j, finalValue,\n            i = 0;\n\n        if ( jQuery.isFunction( value ) ) {\n            return this.each( function( j ) {\n                jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n            } );\n        }\n\n        if ( typeof value === \"string\" && value ) {\n            classes = value.match( rnothtmlwhite ) || [];\n\n            while ( ( elem = this[ i++ ] ) ) {\n                curValue = getClass( elem );\n                cur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n                if ( cur ) {\n                    j = 0;\n                    while ( ( clazz = classes[ j++ ] ) ) {\n                        if ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n                            cur += clazz + \" \";\n                        }\n                    }\n\n                    // Only assign if different to avoid unneeded rendering.\n                    finalValue = stripAndCollapse( cur );\n                    if ( curValue !== finalValue ) {\n                        elem.setAttribute( \"class\", finalValue );\n                    }\n                }\n            }\n        }\n\n        return this;\n    },\n\n    removeClass: function( value ) {\n        var classes, elem, cur, curValue, clazz, j, finalValue,\n            i = 0;\n\n        if ( jQuery.isFunction( value ) ) {\n            return this.each( function( j ) {\n                jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n            } );\n        }\n\n        if ( !arguments.length ) {\n            return this.attr( \"class\", \"\" );\n        }\n\n        if ( typeof value === \"string\" && value ) {\n            classes = value.match( rnothtmlwhite ) || [];\n\n            while ( ( elem = this[ i++ ] ) ) {\n                curValue = getClass( elem );\n\n                // This expression is here for better compressibility (see addClass)\n                cur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n                if ( cur ) {\n                    j = 0;\n                    while ( ( clazz = classes[ j++ ] ) ) {\n\n                        // Remove *all* instances\n                        while ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n                            cur = cur.replace( \" \" + clazz + \" \", \" \" );\n                        }\n                    }\n\n                    // Only assign if different to avoid unneeded rendering.\n                    finalValue = stripAndCollapse( cur );\n                    if ( curValue !== finalValue ) {\n                        elem.setAttribute( \"class\", finalValue );\n                    }\n                }\n            }\n        }\n\n        return this;\n    },\n\n    toggleClass: function( value, stateVal ) {\n        var type = typeof value;\n\n        if ( typeof stateVal === \"boolean\" && type === \"string\" ) {\n            return stateVal ? this.addClass( value ) : this.removeClass( value );\n        }\n\n        if ( jQuery.isFunction( value ) ) {\n            return this.each( function( i ) {\n                jQuery( this ).toggleClass(\n                    value.call( this, i, getClass( this ), stateVal ),\n                    stateVal\n                );\n            } );\n        }\n\n        return this.each( function() {\n            var className, i, self, classNames;\n\n            if ( type === \"string\" ) {\n\n                // Toggle individual class names\n                i = 0;\n                self = jQuery( this );\n                classNames = value.match( rnothtmlwhite ) || [];\n\n                while ( ( className = classNames[ i++ ] ) ) {\n\n                    // Check each className given, space separated list\n                    if ( self.hasClass( className ) ) {\n                        self.removeClass( className );\n                    } else {\n                        self.addClass( className );\n                    }\n                }\n\n            // Toggle whole class name\n            } else if ( value === undefined || type === \"boolean\" ) {\n                className = getClass( this );\n                if ( className ) {\n\n                    // Store className if set\n                    dataPriv.set( this, \"__className__\", className );\n                }\n\n                // If the element has a class name or if we're passed `false`,\n                // then remove the whole classname (if there was one, the above saved it).\n                // Otherwise bring back whatever was previously saved (if anything),\n                // falling back to the empty string if nothing was stored.\n                if ( this.setAttribute ) {\n                    this.setAttribute( \"class\",\n                        className || value === false ?\n                        \"\" :\n                        dataPriv.get( this, \"__className__\" ) || \"\"\n                    );\n                }\n            }\n        } );\n    },\n\n    hasClass: function( selector ) {\n        var className, elem,\n            i = 0;\n\n        className = \" \" + selector + \" \";\n        while ( ( elem = this[ i++ ] ) ) {\n            if ( elem.nodeType === 1 &&\n                ( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n                    return true;\n            }\n        }\n\n        return false;\n    }\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n    val: function( value ) {\n        var hooks, ret, isFunction,\n            elem = this[ 0 ];\n\n        if ( !arguments.length ) {\n            if ( elem ) {\n                hooks = jQuery.valHooks[ elem.type ] ||\n                    jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n                if ( hooks &&\n                    \"get\" in hooks &&\n                    ( ret = hooks.get( elem, \"value\" ) ) !== undefined\n                ) {\n                    return ret;\n                }\n\n                ret = elem.value;\n\n                // Handle most common string cases\n                if ( typeof ret === \"string\" ) {\n                    return ret.replace( rreturn, \"\" );\n                }\n\n                // Handle cases where value is null/undef or number\n                return ret == null ? \"\" : ret;\n            }\n\n            return;\n        }\n\n        isFunction = jQuery.isFunction( value );\n\n        return this.each( function( i ) {\n            var val;\n\n            if ( this.nodeType !== 1 ) {\n                return;\n            }\n\n            if ( isFunction ) {\n                val = value.call( this, i, jQuery( this ).val() );\n            } else {\n                val = value;\n            }\n\n            // Treat null/undefined as \"\"; convert numbers to string\n            if ( val == null ) {\n                val = \"\";\n\n            } else if ( typeof val === \"number\" ) {\n                val += \"\";\n\n            } else if ( jQuery.isArray( val ) ) {\n                val = jQuery.map( val, function( value ) {\n                    return value == null ? \"\" : value + \"\";\n                } );\n            }\n\n            hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n            // If set returns undefined, fall back to normal setting\n            if ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n                this.value = val;\n            }\n        } );\n    }\n} );\n\njQuery.extend( {\n    valHooks: {\n        option: {\n            get: function( elem ) {\n\n                var val = jQuery.find.attr( elem, \"value\" );\n                return val != null ?\n                    val :\n\n                    // Support: IE <=10 - 11 only\n                    // option.text throws exceptions (#14686, #14858)\n                    // Strip and collapse whitespace\n                    // https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n                    stripAndCollapse( jQuery.text( elem ) );\n            }\n        },\n        select: {\n            get: function( elem ) {\n                var value, option, i,\n                    options = elem.options,\n                    index = elem.selectedIndex,\n                    one = elem.type === \"select-one\",\n                    values = one ? null : [],\n                    max = one ? index + 1 : options.length;\n\n                if ( index < 0 ) {\n                    i = max;\n\n                } else {\n                    i = one ? index : 0;\n                }\n\n                // Loop through all the selected options\n                for ( ; i < max; i++ ) {\n                    option = options[ i ];\n\n                    // Support: IE <=9 only\n                    // IE8-9 doesn't update selected after form reset (#2551)\n                    if ( ( option.selected || i === index ) &&\n\n                            // Don't return options that are disabled or in a disabled optgroup\n                            !option.disabled &&\n                            ( !option.parentNode.disabled ||\n                                !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n                        // Get the specific value for the option\n                        value = jQuery( option ).val();\n\n                        // We don't need an array for one selects\n                        if ( one ) {\n                            return value;\n                        }\n\n                        // Multi-Selects return an array\n                        values.push( value );\n                    }\n                }\n\n                return values;\n            },\n\n            set: function( elem, value ) {\n                var optionSet, option,\n                    options = elem.options,\n                    values = jQuery.makeArray( value ),\n                    i = options.length;\n\n                while ( i-- ) {\n                    option = options[ i ];\n\n                    /* eslint-disable no-cond-assign */\n\n                    if ( option.selected =\n                        jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n                    ) {\n                        optionSet = true;\n                    }\n\n                    /* eslint-enable no-cond-assign */\n                }\n\n                // Force browsers to behave consistently when non-matching value is set\n                if ( !optionSet ) {\n                    elem.selectedIndex = -1;\n                }\n                return values;\n            }\n        }\n    }\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n    jQuery.valHooks[ this ] = {\n        set: function( elem, value ) {\n            if ( jQuery.isArray( value ) ) {\n                return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n            }\n        }\n    };\n    if ( !support.checkOn ) {\n        jQuery.valHooks[ this ].get = function( elem ) {\n            return elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n        };\n    }\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;\n\njQuery.extend( jQuery.event, {\n\n    trigger: function( event, data, elem, onlyHandlers ) {\n\n        var i, cur, tmp, bubbleType, ontype, handle, special,\n            eventPath = [ elem || document ],\n            type = hasOwn.call( event, \"type\" ) ? event.type : event,\n            namespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n        cur = tmp = elem = elem || document;\n\n        // Don't do events on text and comment nodes\n        if ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n            return;\n        }\n\n        // focus/blur morphs to focusin/out; ensure we're not firing them right now\n        if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n            return;\n        }\n\n        if ( type.indexOf( \".\" ) > -1 ) {\n\n            // Namespaced trigger; create a regexp to match event type in handle()\n            namespaces = type.split( \".\" );\n            type = namespaces.shift();\n            namespaces.sort();\n        }\n        ontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n        // Caller can pass in a jQuery.Event object, Object, or just an event type string\n        event = event[ jQuery.expando ] ?\n            event :\n            new jQuery.Event( type, typeof event === \"object\" && event );\n\n        // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n        event.isTrigger = onlyHandlers ? 2 : 3;\n        event.namespace = namespaces.join( \".\" );\n        event.rnamespace = event.namespace ?\n            new RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n            null;\n\n        // Clean up the event in case it is being reused\n        event.result = undefined;\n        if ( !event.target ) {\n            event.target = elem;\n        }\n\n        // Clone any incoming data and prepend the event, creating the handler arg list\n        data = data == null ?\n            [ event ] :\n            jQuery.makeArray( data, [ event ] );\n\n        // Allow special events to draw outside the lines\n        special = jQuery.event.special[ type ] || {};\n        if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n            return;\n        }\n\n        // Determine event propagation path in advance, per W3C events spec (#9951)\n        // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n        if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n            bubbleType = special.delegateType || type;\n            if ( !rfocusMorph.test( bubbleType + type ) ) {\n                cur = cur.parentNode;\n            }\n            for ( ; cur; cur = cur.parentNode ) {\n                eventPath.push( cur );\n                tmp = cur;\n            }\n\n            // Only add window if we got to document (e.g., not plain obj or detached DOM)\n            if ( tmp === ( elem.ownerDocument || document ) ) {\n                eventPath.push( tmp.defaultView || tmp.parentWindow || window );\n            }\n        }\n\n        // Fire handlers on the event path\n        i = 0;\n        while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\n            event.type = i > 1 ?\n                bubbleType :\n                special.bindType || type;\n\n            // jQuery handler\n            handle = ( dataPriv.get( cur, \"events\" ) || {} )[ event.type ] &&\n                dataPriv.get( cur, \"handle\" );\n            if ( handle ) {\n                handle.apply( cur, data );\n            }\n\n            // Native handler\n            handle = ontype && cur[ ontype ];\n            if ( handle && handle.apply && acceptData( cur ) ) {\n                event.result = handle.apply( cur, data );\n                if ( event.result === false ) {\n                    event.preventDefault();\n                }\n            }\n        }\n        event.type = type;\n\n        // If nobody prevented the default action, do it now\n        if ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n            if ( ( !special._default ||\n                special._default.apply( eventPath.pop(), data ) === false ) &&\n                acceptData( elem ) ) {\n\n                // Call a native DOM method on the target with the same name as the event.\n                // Don't do default actions on window, that's where global variables be (#6170)\n                if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {\n\n                    // Don't re-trigger an onFOO event when we call its FOO() method\n                    tmp = elem[ ontype ];\n\n                    if ( tmp ) {\n                        elem[ ontype ] = null;\n                    }\n\n                    // Prevent re-triggering of the same event, since we already bubbled it above\n                    jQuery.event.triggered = type;\n                    elem[ type ]();\n                    jQuery.event.triggered = undefined;\n\n                    if ( tmp ) {\n                        elem[ ontype ] = tmp;\n                    }\n                }\n            }\n        }\n\n        return event.result;\n    },\n\n    // Piggyback on a donor event to simulate a different one\n    // Used only for `focus(in | out)` events\n    simulate: function( type, elem, event ) {\n        var e = jQuery.extend(\n            new jQuery.Event(),\n            event,\n            {\n                type: type,\n                isSimulated: true\n            }\n        );\n\n        jQuery.event.trigger( e, null, elem );\n    }\n\n} );\n\njQuery.fn.extend( {\n\n    trigger: function( type, data ) {\n        return this.each( function() {\n            jQuery.event.trigger( type, data, this );\n        } );\n    },\n    triggerHandler: function( type, data ) {\n        var elem = this[ 0 ];\n        if ( elem ) {\n            return jQuery.event.trigger( type, data, elem, true );\n        }\n    }\n} );\n\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n    \"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n    \"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n    function( i, name ) {\n\n    // Handle event binding\n    jQuery.fn[ name ] = function( data, fn ) {\n        return arguments.length > 0 ?\n            this.on( name, null, data, fn ) :\n            this.trigger( name );\n    };\n} );\n\njQuery.fn.extend( {\n    hover: function( fnOver, fnOut ) {\n        return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n    }\n} );\n\n\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n    jQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n        // Attach a single capturing handler on the document while someone wants focusin/focusout\n        var handler = function( event ) {\n            jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n        };\n\n        jQuery.event.special[ fix ] = {\n            setup: function() {\n                var doc = this.ownerDocument || this,\n                    attaches = dataPriv.access( doc, fix );\n\n                if ( !attaches ) {\n                    doc.addEventListener( orig, handler, true );\n                }\n                dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n            },\n            teardown: function() {\n                var doc = this.ownerDocument || this,\n                    attaches = dataPriv.access( doc, fix ) - 1;\n\n                if ( !attaches ) {\n                    doc.removeEventListener( orig, handler, true );\n                    dataPriv.remove( doc, fix );\n\n                } else {\n                    dataPriv.access( doc, fix, attaches );\n                }\n            }\n        };\n    } );\n}\nvar location = window.location;\n\nvar nonce = jQuery.now();\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n    var xml;\n    if ( !data || typeof data !== \"string\" ) {\n        return null;\n    }\n\n    // Support: IE 9 - 11 only\n    // IE throws on parseFromString with invalid input.\n    try {\n        xml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n    } catch ( e ) {\n        xml = undefined;\n    }\n\n    if ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n        jQuery.error( \"Invalid XML: \" + data );\n    }\n    return xml;\n};\n\n\nvar\n    rbracket = /\\[\\]$/,\n    rCRLF = /\\r?\\n/g,\n    rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n    rsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n    var name;\n\n    if ( jQuery.isArray( obj ) ) {\n\n        // Serialize array item.\n        jQuery.each( obj, function( i, v ) {\n            if ( traditional || rbracket.test( prefix ) ) {\n\n                // Treat each array item as a scalar.\n                add( prefix, v );\n\n            } else {\n\n                // Item is non-scalar (array or object), encode its numeric index.\n                buildParams(\n                    prefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n                    v,\n                    traditional,\n                    add\n                );\n            }\n        } );\n\n    } else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\n        // Serialize object item.\n        for ( name in obj ) {\n            buildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n        }\n\n    } else {\n\n        // Serialize scalar item.\n        add( prefix, obj );\n    }\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n    var prefix,\n        s = [],\n        add = function( key, valueOrFunction ) {\n\n            // If value is a function, invoke it and use its return value\n            var value = jQuery.isFunction( valueOrFunction ) ?\n                valueOrFunction() :\n                valueOrFunction;\n\n            s[ s.length ] = encodeURIComponent( key ) + \"=\" +\n                encodeURIComponent( value == null ? \"\" : value );\n        };\n\n    // If an array was passed in, assume that it is an array of form elements.\n    if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n        // Serialize the form elements\n        jQuery.each( a, function() {\n            add( this.name, this.value );\n        } );\n\n    } else {\n\n        // If traditional, encode the \"old\" way (the way 1.3.2 or older\n        // did it), otherwise encode params recursively.\n        for ( prefix in a ) {\n            buildParams( prefix, a[ prefix ], traditional, add );\n        }\n    }\n\n    // Return the resulting serialization\n    return s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n    serialize: function() {\n        return jQuery.param( this.serializeArray() );\n    },\n    serializeArray: function() {\n        return this.map( function() {\n\n            // Can add propHook for \"elements\" to filter or add form elements\n            var elements = jQuery.prop( this, \"elements\" );\n            return elements ? jQuery.makeArray( elements ) : this;\n        } )\n        .filter( function() {\n            var type = this.type;\n\n            // Use .is( \":disabled\" ) so that fieldset[disabled] works\n            return this.name && !jQuery( this ).is( \":disabled\" ) &&\n                rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n                ( this.checked || !rcheckableType.test( type ) );\n        } )\n        .map( function( i, elem ) {\n            var val = jQuery( this ).val();\n\n            if ( val == null ) {\n                return null;\n            }\n\n            if ( jQuery.isArray( val ) ) {\n                return jQuery.map( val, function( val ) {\n                    return { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n                } );\n            }\n\n            return { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n        } ).get();\n    }\n} );\n\n\nvar\n    r20 = /%20/g,\n    rhash = /#.*$/,\n    rantiCache = /([?&])_=[^&]*/,\n    rheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n    // #7653, #8125, #8152: local protocol detection\n    rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n    rnoContent = /^(?:GET|HEAD)$/,\n    rprotocol = /^\\/\\//,\n\n    /* Prefilters\n     * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n     * 2) These are called:\n     *    - BEFORE asking for a transport\n     *    - AFTER param serialization (s.data is a string if s.processData is true)\n     * 3) key is the dataType\n     * 4) the catchall symbol \"*\" can be used\n     * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n     */\n    prefilters = {},\n\n    /* Transports bindings\n     * 1) key is the dataType\n     * 2) the catchall symbol \"*\" can be used\n     * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n     */\n    transports = {},\n\n    // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n    allTypes = \"*/\".concat( \"*\" ),\n\n    // Anchor tag for parsing the document origin\n    originAnchor = document.createElement( \"a\" );\n    originAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n    // dataTypeExpression is optional and defaults to \"*\"\n    return function( dataTypeExpression, func ) {\n\n        if ( typeof dataTypeExpression !== \"string\" ) {\n            func = dataTypeExpression;\n            dataTypeExpression = \"*\";\n        }\n\n        var dataType,\n            i = 0,\n            dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n        if ( jQuery.isFunction( func ) ) {\n\n            // For each dataType in the dataTypeExpression\n            while ( ( dataType = dataTypes[ i++ ] ) ) {\n\n                // Prepend if requested\n                if ( dataType[ 0 ] === \"+\" ) {\n                    dataType = dataType.slice( 1 ) || \"*\";\n                    ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n                // Otherwise append\n                } else {\n                    ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n                }\n            }\n        }\n    };\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n    var inspected = {},\n        seekingTransport = ( structure === transports );\n\n    function inspect( dataType ) {\n        var selected;\n        inspected[ dataType ] = true;\n        jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n            var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n            if ( typeof dataTypeOrTransport === \"string\" &&\n                !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n                options.dataTypes.unshift( dataTypeOrTransport );\n                inspect( dataTypeOrTransport );\n                return false;\n            } else if ( seekingTransport ) {\n                return !( selected = dataTypeOrTransport );\n            }\n        } );\n        return selected;\n    }\n\n    return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n    var key, deep,\n        flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n    for ( key in src ) {\n        if ( src[ key ] !== undefined ) {\n            ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n        }\n    }\n    if ( deep ) {\n        jQuery.extend( true, target, deep );\n    }\n\n    return target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n    var ct, type, finalDataType, firstDataType,\n        contents = s.contents,\n        dataTypes = s.dataTypes;\n\n    // Remove auto dataType and get content-type in the process\n    while ( dataTypes[ 0 ] === \"*\" ) {\n        dataTypes.shift();\n        if ( ct === undefined ) {\n            ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n        }\n    }\n\n    // Check if we're dealing with a known content-type\n    if ( ct ) {\n        for ( type in contents ) {\n            if ( contents[ type ] && contents[ type ].test( ct ) ) {\n                dataTypes.unshift( type );\n                break;\n            }\n        }\n    }\n\n    // Check to see if we have a response for the expected dataType\n    if ( dataTypes[ 0 ] in responses ) {\n        finalDataType = dataTypes[ 0 ];\n    } else {\n\n        // Try convertible dataTypes\n        for ( type in responses ) {\n            if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n                finalDataType = type;\n                break;\n            }\n            if ( !firstDataType ) {\n                firstDataType = type;\n            }\n        }\n\n        // Or just use first one\n        finalDataType = finalDataType || firstDataType;\n    }\n\n    // If we found a dataType\n    // We add the dataType to the list if needed\n    // and return the corresponding response\n    if ( finalDataType ) {\n        if ( finalDataType !== dataTypes[ 0 ] ) {\n            dataTypes.unshift( finalDataType );\n        }\n        return responses[ finalDataType ];\n    }\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n    var conv2, current, conv, tmp, prev,\n        converters = {},\n\n        // Work with a copy of dataTypes in case we need to modify it for conversion\n        dataTypes = s.dataTypes.slice();\n\n    // Create converters map with lowercased keys\n    if ( dataTypes[ 1 ] ) {\n        for ( conv in s.converters ) {\n            converters[ conv.toLowerCase() ] = s.converters[ conv ];\n        }\n    }\n\n    current = dataTypes.shift();\n\n    // Convert to each sequential dataType\n    while ( current ) {\n\n        if ( s.responseFields[ current ] ) {\n            jqXHR[ s.responseFields[ current ] ] = response;\n        }\n\n        // Apply the dataFilter if provided\n        if ( !prev && isSuccess && s.dataFilter ) {\n            response = s.dataFilter( response, s.dataType );\n        }\n\n        prev = current;\n        current = dataTypes.shift();\n\n        if ( current ) {\n\n            // There's only work to do if current dataType is non-auto\n            if ( current === \"*\" ) {\n\n                current = prev;\n\n            // Convert response if prev dataType is non-auto and differs from current\n            } else if ( prev !== \"*\" && prev !== current ) {\n\n                // Seek a direct converter\n                conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n                // If none found, seek a pair\n                if ( !conv ) {\n                    for ( conv2 in converters ) {\n\n                        // If conv2 outputs current\n                        tmp = conv2.split( \" \" );\n                        if ( tmp[ 1 ] === current ) {\n\n                            // If prev can be converted to accepted input\n                            conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n                                converters[ \"* \" + tmp[ 0 ] ];\n                            if ( conv ) {\n\n                                // Condense equivalence converters\n                                if ( conv === true ) {\n                                    conv = converters[ conv2 ];\n\n                                // Otherwise, insert the intermediate dataType\n                                } else if ( converters[ conv2 ] !== true ) {\n                                    current = tmp[ 0 ];\n                                    dataTypes.unshift( tmp[ 1 ] );\n                                }\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                // Apply converter (if not an equivalence)\n                if ( conv !== true ) {\n\n                    // Unless errors are allowed to bubble, catch and return them\n                    if ( conv && s.throws ) {\n                        response = conv( response );\n                    } else {\n                        try {\n                            response = conv( response );\n                        } catch ( e ) {\n                            return {\n                                state: \"parsererror\",\n                                error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n                            };\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    return { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n    // Counter for holding the number of active queries\n    active: 0,\n\n    // Last-Modified header cache for next request\n    lastModified: {},\n    etag: {},\n\n    ajaxSettings: {\n        url: location.href,\n        type: \"GET\",\n        isLocal: rlocalProtocol.test( location.protocol ),\n        global: true,\n        processData: true,\n        async: true,\n        contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n        /*\n        timeout: 0,\n        data: null,\n        dataType: null,\n        username: null,\n        password: null,\n        cache: null,\n        throws: false,\n        traditional: false,\n        headers: {},\n        */\n\n        accepts: {\n            \"*\": allTypes,\n            text: \"text/plain\",\n            html: \"text/html\",\n            xml: \"application/xml, text/xml\",\n            json: \"application/json, text/javascript\"\n        },\n\n        contents: {\n            xml: /\\bxml\\b/,\n            html: /\\bhtml/,\n            json: /\\bjson\\b/\n        },\n\n        responseFields: {\n            xml: \"responseXML\",\n            text: \"responseText\",\n            json: \"responseJSON\"\n        },\n\n        // Data converters\n        // Keys separate source (or catchall \"*\") and destination types with a single space\n        converters: {\n\n            // Convert anything to text\n            \"* text\": String,\n\n            // Text to html (true = no transformation)\n            \"text html\": true,\n\n            // Evaluate text as a json expression\n            \"text json\": JSON.parse,\n\n            // Parse text as xml\n            \"text xml\": jQuery.parseXML\n        },\n\n        // For options that shouldn't be deep extended:\n        // you can add your own custom options here if\n        // and when you create one that shouldn't be\n        // deep extended (see ajaxExtend)\n        flatOptions: {\n            url: true,\n            context: true\n        }\n    },\n\n    // Creates a full fledged settings object into target\n    // with both ajaxSettings and settings fields.\n    // If target is omitted, writes into ajaxSettings.\n    ajaxSetup: function( target, settings ) {\n        return settings ?\n\n            // Building a settings object\n            ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n            // Extending ajaxSettings\n            ajaxExtend( jQuery.ajaxSettings, target );\n    },\n\n    ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n    ajaxTransport: addToPrefiltersOrTransports( transports ),\n\n    // Main method\n    ajax: function( url, options ) {\n\n        // If url is an object, simulate pre-1.5 signature\n        if ( typeof url === \"object\" ) {\n            options = url;\n            url = undefined;\n        }\n\n        // Force options to be an object\n        options = options || {};\n\n        var transport,\n\n            // URL without anti-cache param\n            cacheURL,\n\n            // Response headers\n            responseHeadersString,\n            responseHeaders,\n\n            // timeout handle\n            timeoutTimer,\n\n            // Url cleanup var\n            urlAnchor,\n\n            // Request state (becomes false upon send and true upon completion)\n            completed,\n\n            // To know if global events are to be dispatched\n            fireGlobals,\n\n            // Loop variable\n            i,\n\n            // uncached part of the url\n            uncached,\n\n            // Create the final options object\n            s = jQuery.ajaxSetup( {}, options ),\n\n            // Callbacks context\n            callbackContext = s.context || s,\n\n            // Context for global events is callbackContext if it is a DOM node or jQuery collection\n            globalEventContext = s.context &&\n                ( callbackContext.nodeType || callbackContext.jquery ) ?\n                    jQuery( callbackContext ) :\n                    jQuery.event,\n\n            // Deferreds\n            deferred = jQuery.Deferred(),\n            completeDeferred = jQuery.Callbacks( \"once memory\" ),\n\n            // Status-dependent callbacks\n            statusCode = s.statusCode || {},\n\n            // Headers (they are sent all at once)\n            requestHeaders = {},\n            requestHeadersNames = {},\n\n            // Default abort message\n            strAbort = \"canceled\",\n\n            // Fake xhr\n            jqXHR = {\n                readyState: 0,\n\n                // Builds headers hashtable if needed\n                getResponseHeader: function( key ) {\n                    var match;\n                    if ( completed ) {\n                        if ( !responseHeaders ) {\n                            responseHeaders = {};\n                            while ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n                                responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];\n                            }\n                        }\n                        match = responseHeaders[ key.toLowerCase() ];\n                    }\n                    return match == null ? null : match;\n                },\n\n                // Raw string\n                getAllResponseHeaders: function() {\n                    return completed ? responseHeadersString : null;\n                },\n\n                // Caches the header\n                setRequestHeader: function( name, value ) {\n                    if ( completed == null ) {\n                        name = requestHeadersNames[ name.toLowerCase() ] =\n                            requestHeadersNames[ name.toLowerCase() ] || name;\n                        requestHeaders[ name ] = value;\n                    }\n                    return this;\n                },\n\n                // Overrides response content-type header\n                overrideMimeType: function( type ) {\n                    if ( completed == null ) {\n                        s.mimeType = type;\n                    }\n                    return this;\n                },\n\n                // Status-dependent callbacks\n                statusCode: function( map ) {\n                    var code;\n                    if ( map ) {\n                        if ( completed ) {\n\n                            // Execute the appropriate callbacks\n                            jqXHR.always( map[ jqXHR.status ] );\n                        } else {\n\n                            // Lazy-add the new callbacks in a way that preserves old ones\n                            for ( code in map ) {\n                                statusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n                            }\n                        }\n                    }\n                    return this;\n                },\n\n                // Cancel the request\n                abort: function( statusText ) {\n                    var finalText = statusText || strAbort;\n                    if ( transport ) {\n                        transport.abort( finalText );\n                    }\n                    done( 0, finalText );\n                    return this;\n                }\n            };\n\n        // Attach deferreds\n        deferred.promise( jqXHR );\n\n        // Add protocol if not provided (prefilters might expect it)\n        // Handle falsy url in the settings object (#10093: consistency with old signature)\n        // We also use the url parameter if available\n        s.url = ( ( url || s.url || location.href ) + \"\" )\n            .replace( rprotocol, location.protocol + \"//\" );\n\n        // Alias method option to type as per ticket #12004\n        s.type = options.method || options.type || s.method || s.type;\n\n        // Extract dataTypes list\n        s.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n        // A cross-domain request is in order when the origin doesn't match the current origin.\n        if ( s.crossDomain == null ) {\n            urlAnchor = document.createElement( \"a\" );\n\n            // Support: IE <=8 - 11, Edge 12 - 13\n            // IE throws exception on accessing the href property if url is malformed,\n            // e.g. http://example.com:80x/\n            try {\n                urlAnchor.href = s.url;\n\n                // Support: IE <=8 - 11 only\n                // Anchor's host property isn't correctly set when s.url is relative\n                urlAnchor.href = urlAnchor.href;\n                s.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n                    urlAnchor.protocol + \"//\" + urlAnchor.host;\n            } catch ( e ) {\n\n                // If there is an error parsing the URL, assume it is crossDomain,\n                // it can be rejected by the transport if it is invalid\n                s.crossDomain = true;\n            }\n        }\n\n        // Convert data if not already a string\n        if ( s.data && s.processData && typeof s.data !== \"string\" ) {\n            s.data = jQuery.param( s.data, s.traditional );\n        }\n\n        // Apply prefilters\n        inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n        // If request was aborted inside a prefilter, stop there\n        if ( completed ) {\n            return jqXHR;\n        }\n\n        // We can fire global events as of now if asked to\n        // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n        fireGlobals = jQuery.event && s.global;\n\n        // Watch for a new set of requests\n        if ( fireGlobals && jQuery.active++ === 0 ) {\n            jQuery.event.trigger( \"ajaxStart\" );\n        }\n\n        // Uppercase the type\n        s.type = s.type.toUpperCase();\n\n        // Determine if request has content\n        s.hasContent = !rnoContent.test( s.type );\n\n        // Save the URL in case we're toying with the If-Modified-Since\n        // and/or If-None-Match header later on\n        // Remove hash to simplify url manipulation\n        cacheURL = s.url.replace( rhash, \"\" );\n\n        // More options handling for requests with no content\n        if ( !s.hasContent ) {\n\n            // Remember the hash so we can put it back\n            uncached = s.url.slice( cacheURL.length );\n\n            // If data is available, append data to url\n            if ( s.data ) {\n                cacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n                // #9682: remove data so that it's not used in an eventual retry\n                delete s.data;\n            }\n\n            // Add or update anti-cache param if needed\n            if ( s.cache === false ) {\n                cacheURL = cacheURL.replace( rantiCache, \"$1\" );\n                uncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce++ ) + uncached;\n            }\n\n            // Put hash and anti-cache on the URL that will be requested (gh-1732)\n            s.url = cacheURL + uncached;\n\n        // Change '%20' to '+' if this is encoded form body content (gh-2658)\n        } else if ( s.data && s.processData &&\n            ( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n            s.data = s.data.replace( r20, \"+\" );\n        }\n\n        // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n        if ( s.ifModified ) {\n            if ( jQuery.lastModified[ cacheURL ] ) {\n                jqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n            }\n            if ( jQuery.etag[ cacheURL ] ) {\n                jqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n            }\n        }\n\n        // Set the correct header, if data is being sent\n        if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n            jqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n        }\n\n        // Set the Accepts header for the server, depending on the dataType\n        jqXHR.setRequestHeader(\n            \"Accept\",\n            s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n                s.accepts[ s.dataTypes[ 0 ] ] +\n                    ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n                s.accepts[ \"*\" ]\n        );\n\n        // Check for headers option\n        for ( i in s.headers ) {\n            jqXHR.setRequestHeader( i, s.headers[ i ] );\n        }\n\n        // Allow custom headers/mimetypes and early abort\n        if ( s.beforeSend &&\n            ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n            // Abort if not done already and return\n            return jqXHR.abort();\n        }\n\n        // Aborting is no longer a cancellation\n        strAbort = \"abort\";\n\n        // Install callbacks on deferreds\n        completeDeferred.add( s.complete );\n        jqXHR.done( s.success );\n        jqXHR.fail( s.error );\n\n        // Get transport\n        transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n        // If no transport, we auto-abort\n        if ( !transport ) {\n            done( -1, \"No Transport\" );\n        } else {\n            jqXHR.readyState = 1;\n\n            // Send global event\n            if ( fireGlobals ) {\n                globalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n            }\n\n            // If request was aborted inside ajaxSend, stop there\n            if ( completed ) {\n                return jqXHR;\n            }\n\n            // Timeout\n            if ( s.async && s.timeout > 0 ) {\n                timeoutTimer = window.setTimeout( function() {\n                    jqXHR.abort( \"timeout\" );\n                }, s.timeout );\n            }\n\n            try {\n                completed = false;\n                transport.send( requestHeaders, done );\n            } catch ( e ) {\n\n                // Rethrow post-completion exceptions\n                if ( completed ) {\n                    throw e;\n                }\n\n                // Propagate others as results\n                done( -1, e );\n            }\n        }\n\n        // Callback for when everything is done\n        function done( status, nativeStatusText, responses, headers ) {\n            var isSuccess, success, error, response, modified,\n                statusText = nativeStatusText;\n\n            // Ignore repeat invocations\n            if ( completed ) {\n                return;\n            }\n\n            completed = true;\n\n            // Clear timeout if it exists\n            if ( timeoutTimer ) {\n                window.clearTimeout( timeoutTimer );\n            }\n\n            // Dereference transport for early garbage collection\n            // (no matter how long the jqXHR object will be used)\n            transport = undefined;\n\n            // Cache response headers\n            responseHeadersString = headers || \"\";\n\n            // Set readyState\n            jqXHR.readyState = status > 0 ? 4 : 0;\n\n            // Determine if successful\n            isSuccess = status >= 200 && status < 300 || status === 304;\n\n            // Get response data\n            if ( responses ) {\n                response = ajaxHandleResponses( s, jqXHR, responses );\n            }\n\n            // Convert no matter what (that way responseXXX fields are always set)\n            response = ajaxConvert( s, response, jqXHR, isSuccess );\n\n            // If successful, handle type chaining\n            if ( isSuccess ) {\n\n                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n                if ( s.ifModified ) {\n                    modified = jqXHR.getResponseHeader( \"Last-Modified\" );\n                    if ( modified ) {\n                        jQuery.lastModified[ cacheURL ] = modified;\n                    }\n                    modified = jqXHR.getResponseHeader( \"etag\" );\n                    if ( modified ) {\n                        jQuery.etag[ cacheURL ] = modified;\n                    }\n                }\n\n                // if no content\n                if ( status === 204 || s.type === \"HEAD\" ) {\n                    statusText = \"nocontent\";\n\n                // if not modified\n                } else if ( status === 304 ) {\n                    statusText = \"notmodified\";\n\n                // If we have data, let's convert it\n                } else {\n                    statusText = response.state;\n                    success = response.data;\n                    error = response.error;\n                    isSuccess = !error;\n                }\n            } else {\n\n                // Extract error from statusText and normalize for non-aborts\n                error = statusText;\n                if ( status || !statusText ) {\n                    statusText = \"error\";\n                    if ( status < 0 ) {\n                        status = 0;\n                    }\n                }\n            }\n\n            // Set data for the fake xhr object\n            jqXHR.status = status;\n            jqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n            // Success/Error\n            if ( isSuccess ) {\n                deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n            } else {\n                deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n            }\n\n            // Status-dependent callbacks\n            jqXHR.statusCode( statusCode );\n            statusCode = undefined;\n\n            if ( fireGlobals ) {\n                globalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n                    [ jqXHR, s, isSuccess ? success : error ] );\n            }\n\n            // Complete\n            completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n            if ( fireGlobals ) {\n                globalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n                // Handle the global AJAX counter\n                if ( !( --jQuery.active ) ) {\n                    jQuery.event.trigger( \"ajaxStop\" );\n                }\n            }\n        }\n\n        return jqXHR;\n    },\n\n    getJSON: function( url, data, callback ) {\n        return jQuery.get( url, data, callback, \"json\" );\n    },\n\n    getScript: function( url, callback ) {\n        return jQuery.get( url, undefined, callback, \"script\" );\n    }\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n    jQuery[ method ] = function( url, data, callback, type ) {\n\n        // Shift arguments if data argument was omitted\n        if ( jQuery.isFunction( data ) ) {\n            type = type || callback;\n            callback = data;\n            data = undefined;\n        }\n\n        // The url can be an options object (which then must have .url)\n        return jQuery.ajax( jQuery.extend( {\n            url: url,\n            type: method,\n            dataType: type,\n            data: data,\n            success: callback\n        }, jQuery.isPlainObject( url ) && url ) );\n    };\n} );\n\n\njQuery._evalUrl = function( url ) {\n    return jQuery.ajax( {\n        url: url,\n\n        // Make this explicit, since user can override this through ajaxSetup (#11264)\n        type: \"GET\",\n        dataType: \"script\",\n        cache: true,\n        async: false,\n        global: false,\n        \"throws\": true\n    } );\n};\n\n\njQuery.fn.extend( {\n    wrapAll: function( html ) {\n        var wrap;\n\n        if ( this[ 0 ] ) {\n            if ( jQuery.isFunction( html ) ) {\n                html = html.call( this[ 0 ] );\n            }\n\n            // The elements to wrap the target around\n            wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n            if ( this[ 0 ].parentNode ) {\n                wrap.insertBefore( this[ 0 ] );\n            }\n\n            wrap.map( function() {\n                var elem = this;\n\n                while ( elem.firstElementChild ) {\n                    elem = elem.firstElementChild;\n                }\n\n                return elem;\n            } ).append( this );\n        }\n\n        return this;\n    },\n\n    wrapInner: function( html ) {\n        if ( jQuery.isFunction( html ) ) {\n            return this.each( function( i ) {\n                jQuery( this ).wrapInner( html.call( this, i ) );\n            } );\n        }\n\n        return this.each( function() {\n            var self = jQuery( this ),\n                contents = self.contents();\n\n            if ( contents.length ) {\n                contents.wrapAll( html );\n\n            } else {\n                self.append( html );\n            }\n        } );\n    },\n\n    wrap: function( html ) {\n        var isFunction = jQuery.isFunction( html );\n\n        return this.each( function( i ) {\n            jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );\n        } );\n    },\n\n    unwrap: function( selector ) {\n        this.parent( selector ).not( \"body\" ).each( function() {\n            jQuery( this ).replaceWith( this.childNodes );\n        } );\n        return this;\n    }\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n    return !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n    return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n    try {\n        return new window.XMLHttpRequest();\n    } catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n        // File protocol always yields status code 0, assume 200\n        0: 200,\n\n        // Support: IE <=9 only\n        // #1450: sometimes IE returns 1223 when it should be 204\n        1223: 204\n    },\n    xhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n    var callback, errorCallback;\n\n    // Cross domain only allowed if supported through XMLHttpRequest\n    if ( support.cors || xhrSupported && !options.crossDomain ) {\n        return {\n            send: function( headers, complete ) {\n                var i,\n                    xhr = options.xhr();\n\n                xhr.open(\n                    options.type,\n                    options.url,\n                    options.async,\n                    options.username,\n                    options.password\n                );\n\n                // Apply custom fields if provided\n                if ( options.xhrFields ) {\n                    for ( i in options.xhrFields ) {\n                        xhr[ i ] = options.xhrFields[ i ];\n                    }\n                }\n\n                // Override mime type if needed\n                if ( options.mimeType && xhr.overrideMimeType ) {\n                    xhr.overrideMimeType( options.mimeType );\n                }\n\n                // X-Requested-With header\n                // For cross-domain requests, seeing as conditions for a preflight are\n                // akin to a jigsaw puzzle, we simply never set it to be sure.\n                // (it can always be set on a per-request basis or even using ajaxSetup)\n                // For same-domain requests, won't change header if already provided.\n                if ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n                    headers[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n                }\n\n                // Set headers\n                for ( i in headers ) {\n                    xhr.setRequestHeader( i, headers[ i ] );\n                }\n\n                // Callback\n                callback = function( type ) {\n                    return function() {\n                        if ( callback ) {\n                            callback = errorCallback = xhr.onload =\n                                xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;\n\n                            if ( type === \"abort\" ) {\n                                xhr.abort();\n                            } else if ( type === \"error\" ) {\n\n                                // Support: IE <=9 only\n                                // On a manual native abort, IE9 throws\n                                // errors on any property access that is not readyState\n                                if ( typeof xhr.status !== \"number\" ) {\n                                    complete( 0, \"error\" );\n                                } else {\n                                    complete(\n\n                                        // File: protocol always yields status 0; see #8605, #14207\n                                        xhr.status,\n                                        xhr.statusText\n                                    );\n                                }\n                            } else {\n                                complete(\n                                    xhrSuccessStatus[ xhr.status ] || xhr.status,\n                                    xhr.statusText,\n\n                                    // Support: IE <=9 only\n                                    // IE9 has no XHR2 but throws on binary (trac-11426)\n                                    // For XHR2 non-text, let the caller handle it (gh-2498)\n                                    ( xhr.responseType || \"text\" ) !== \"text\"  ||\n                                    typeof xhr.responseText !== \"string\" ?\n                                        { binary: xhr.response } :\n                                        { text: xhr.responseText },\n                                    xhr.getAllResponseHeaders()\n                                );\n                            }\n                        }\n                    };\n                };\n\n                // Listen to events\n                xhr.onload = callback();\n                errorCallback = xhr.onerror = callback( \"error\" );\n\n                // Support: IE 9 only\n                // Use onreadystatechange to replace onabort\n                // to handle uncaught aborts\n                if ( xhr.onabort !== undefined ) {\n                    xhr.onabort = errorCallback;\n                } else {\n                    xhr.onreadystatechange = function() {\n\n                        // Check readyState before timeout as it changes\n                        if ( xhr.readyState === 4 ) {\n\n                            // Allow onerror to be called first,\n                            // but that will not handle a native abort\n                            // Also, save errorCallback to a variable\n                            // as xhr.onerror cannot be accessed\n                            window.setTimeout( function() {\n                                if ( callback ) {\n                                    errorCallback();\n                                }\n                            } );\n                        }\n                    };\n                }\n\n                // Create the abort callback\n                callback = callback( \"abort\" );\n\n                try {\n\n                    // Do send the request (this may raise an exception)\n                    xhr.send( options.hasContent && options.data || null );\n                } catch ( e ) {\n\n                    // #14683: Only rethrow if this hasn't been notified as an error yet\n                    if ( callback ) {\n                        throw e;\n                    }\n                }\n            },\n\n            abort: function() {\n                if ( callback ) {\n                    callback();\n                }\n            }\n        };\n    }\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n    if ( s.crossDomain ) {\n        s.contents.script = false;\n    }\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n    accepts: {\n        script: \"text/javascript, application/javascript, \" +\n            \"application/ecmascript, application/x-ecmascript\"\n    },\n    contents: {\n        script: /\\b(?:java|ecma)script\\b/\n    },\n    converters: {\n        \"text script\": function( text ) {\n            jQuery.globalEval( text );\n            return text;\n        }\n    }\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n    if ( s.cache === undefined ) {\n        s.cache = false;\n    }\n    if ( s.crossDomain ) {\n        s.type = \"GET\";\n    }\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n    // This transport only deals with cross domain requests\n    if ( s.crossDomain ) {\n        var script, callback;\n        return {\n            send: function( _, complete ) {\n                script = jQuery( \"<script>\" ).prop( {\n                    charset: s.scriptCharset,\n                    src: s.url\n                } ).on(\n                    \"load error\",\n                    callback = function( evt ) {\n                        script.remove();\n                        callback = null;\n                        if ( evt ) {\n                            complete( evt.type === \"error\" ? 404 : 200, evt.type );\n                        }\n                    }\n                );\n\n                // Use native DOM manipulation to avoid our domManip AJAX trickery\n                document.head.appendChild( script[ 0 ] );\n            },\n            abort: function() {\n                if ( callback ) {\n                    callback();\n                }\n            }\n        };\n    }\n} );\n\n\n\n\nvar oldCallbacks = [],\n    rjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n    jsonp: \"callback\",\n    jsonpCallback: function() {\n        var callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\n        this[ callback ] = true;\n        return callback;\n    }\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n    var callbackName, overwritten, responseContainer,\n        jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n            \"url\" :\n            typeof s.data === \"string\" &&\n                ( s.contentType || \"\" )\n                    .indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n                rjsonp.test( s.data ) && \"data\"\n        );\n\n    // Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n    if ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n        // Get callback name, remembering preexisting value associated with it\n        callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n            s.jsonpCallback() :\n            s.jsonpCallback;\n\n        // Insert callback into url or form data\n        if ( jsonProp ) {\n            s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n        } else if ( s.jsonp !== false ) {\n            s.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n        }\n\n        // Use data converter to retrieve json after script execution\n        s.converters[ \"script json\" ] = function() {\n            if ( !responseContainer ) {\n                jQuery.error( callbackName + \" was not called\" );\n            }\n            return responseContainer[ 0 ];\n        };\n\n        // Force json dataType\n        s.dataTypes[ 0 ] = \"json\";\n\n        // Install callback\n        overwritten = window[ callbackName ];\n        window[ callbackName ] = function() {\n            responseContainer = arguments;\n        };\n\n        // Clean-up function (fires after converters)\n        jqXHR.always( function() {\n\n            // If previous value didn't exist - remove it\n            if ( overwritten === undefined ) {\n                jQuery( window ).removeProp( callbackName );\n\n            // Otherwise restore preexisting value\n            } else {\n                window[ callbackName ] = overwritten;\n            }\n\n            // Save back as free\n            if ( s[ callbackName ] ) {\n\n                // Make sure that re-using the options doesn't screw things around\n                s.jsonpCallback = originalSettings.jsonpCallback;\n\n                // Save the callback name for future use\n                oldCallbacks.push( callbackName );\n            }\n\n            // Call if it was a function and we have a response\n            if ( responseContainer && jQuery.isFunction( overwritten ) ) {\n                overwritten( responseContainer[ 0 ] );\n            }\n\n            responseContainer = overwritten = undefined;\n        } );\n\n        // Delegate to script\n        return \"script\";\n    }\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n    var body = document.implementation.createHTMLDocument( \"\" ).body;\n    body.innerHTML = \"<form></form><form></form>\";\n    return body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n    if ( typeof data !== \"string\" ) {\n        return [];\n    }\n    if ( typeof context === \"boolean\" ) {\n        keepScripts = context;\n        context = false;\n    }\n\n    var base, parsed, scripts;\n\n    if ( !context ) {\n\n        // Stop scripts or inline event handlers from being executed immediately\n        // by using document.implementation\n        if ( support.createHTMLDocument ) {\n            context = document.implementation.createHTMLDocument( \"\" );\n\n            // Set the base href for the created document\n            // so any parsed elements with URLs\n            // are based on the document's URL (gh-2965)\n            base = context.createElement( \"base\" );\n            base.href = document.location.href;\n            context.head.appendChild( base );\n        } else {\n            context = document;\n        }\n    }\n\n    parsed = rsingleTag.exec( data );\n    scripts = !keepScripts && [];\n\n    // Single tag\n    if ( parsed ) {\n        return [ context.createElement( parsed[ 1 ] ) ];\n    }\n\n    parsed = buildFragment( [ data ], context, scripts );\n\n    if ( scripts && scripts.length ) {\n        jQuery( scripts ).remove();\n    }\n\n    return jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n    var selector, type, response,\n        self = this,\n        off = url.indexOf( \" \" );\n\n    if ( off > -1 ) {\n        selector = stripAndCollapse( url.slice( off ) );\n        url = url.slice( 0, off );\n    }\n\n    // If it's a function\n    if ( jQuery.isFunction( params ) ) {\n\n        // We assume that it's the callback\n        callback = params;\n        params = undefined;\n\n    // Otherwise, build a param string\n    } else if ( params && typeof params === \"object\" ) {\n        type = \"POST\";\n    }\n\n    // If we have elements to modify, make the request\n    if ( self.length > 0 ) {\n        jQuery.ajax( {\n            url: url,\n\n            // If \"type\" variable is undefined, then \"GET\" method will be used.\n            // Make value of this field explicit since\n            // user can override it through ajaxSetup method\n            type: type || \"GET\",\n            dataType: \"html\",\n            data: params\n        } ).done( function( responseText ) {\n\n            // Save response for use in complete callback\n            response = arguments;\n\n            self.html( selector ?\n\n                // If a selector was specified, locate the right elements in a dummy div\n                // Exclude scripts to avoid IE 'Permission Denied' errors\n                jQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n                // Otherwise use the full result\n                responseText );\n\n        // If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n        // but they are ignored because response was set above.\n        // If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n        } ).always( callback && function( jqXHR, status ) {\n            self.each( function() {\n                callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n            } );\n        } );\n    }\n\n    return this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [\n    \"ajaxStart\",\n    \"ajaxStop\",\n    \"ajaxComplete\",\n    \"ajaxError\",\n    \"ajaxSuccess\",\n    \"ajaxSend\"\n], function( i, type ) {\n    jQuery.fn[ type ] = function( fn ) {\n        return this.on( type, fn );\n    };\n} );\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n    return jQuery.grep( jQuery.timers, function( fn ) {\n        return elem === fn.elem;\n    } ).length;\n};\n\n\n\n\n/**\n * Gets a window from an element\n */\nfunction getWindow( elem ) {\n    return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}\n\njQuery.offset = {\n    setOffset: function( elem, options, i ) {\n        var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n            position = jQuery.css( elem, \"position\" ),\n            curElem = jQuery( elem ),\n            props = {};\n\n        // Set position first, in-case top/left are set even on static elem\n        if ( position === \"static\" ) {\n            elem.style.position = \"relative\";\n        }\n\n        curOffset = curElem.offset();\n        curCSSTop = jQuery.css( elem, \"top\" );\n        curCSSLeft = jQuery.css( elem, \"left\" );\n        calculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n            ( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n        // Need to be able to calculate position if either\n        // top or left is auto and position is either absolute or fixed\n        if ( calculatePosition ) {\n            curPosition = curElem.position();\n            curTop = curPosition.top;\n            curLeft = curPosition.left;\n\n        } else {\n            curTop = parseFloat( curCSSTop ) || 0;\n            curLeft = parseFloat( curCSSLeft ) || 0;\n        }\n\n        if ( jQuery.isFunction( options ) ) {\n\n            // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n            options = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n        }\n\n        if ( options.top != null ) {\n            props.top = ( options.top - curOffset.top ) + curTop;\n        }\n        if ( options.left != null ) {\n            props.left = ( options.left - curOffset.left ) + curLeft;\n        }\n\n        if ( \"using\" in options ) {\n            options.using.call( elem, props );\n\n        } else {\n            curElem.css( props );\n        }\n    }\n};\n\njQuery.fn.extend( {\n    offset: function( options ) {\n\n        // Preserve chaining for setter\n        if ( arguments.length ) {\n            return options === undefined ?\n                this :\n                this.each( function( i ) {\n                    jQuery.offset.setOffset( this, options, i );\n                } );\n        }\n\n        var docElem, win, rect, doc,\n            elem = this[ 0 ];\n\n        if ( !elem ) {\n            return;\n        }\n\n        // Support: IE <=11 only\n        // Running getBoundingClientRect on a\n        // disconnected node in IE throws an error\n        if ( !elem.getClientRects().length ) {\n            return { top: 0, left: 0 };\n        }\n\n        rect = elem.getBoundingClientRect();\n\n        // Make sure element is not hidden (display: none)\n        if ( rect.width || rect.height ) {\n            doc = elem.ownerDocument;\n            win = getWindow( doc );\n            docElem = doc.documentElement;\n\n            return {\n                top: rect.top + win.pageYOffset - docElem.clientTop,\n                left: rect.left + win.pageXOffset - docElem.clientLeft\n            };\n        }\n\n        // Return zeros for disconnected and hidden elements (gh-2310)\n        return rect;\n    },\n\n    position: function() {\n        if ( !this[ 0 ] ) {\n            return;\n        }\n\n        var offsetParent, offset,\n            elem = this[ 0 ],\n            parentOffset = { top: 0, left: 0 };\n\n        // Fixed elements are offset from window (parentOffset = {top:0, left: 0},\n        // because it is its only offset parent\n        if ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n            // Assume getBoundingClientRect is there when computed position is fixed\n            offset = elem.getBoundingClientRect();\n\n        } else {\n\n            // Get *real* offsetParent\n            offsetParent = this.offsetParent();\n\n            // Get correct offsets\n            offset = this.offset();\n            if ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n                parentOffset = offsetParent.offset();\n            }\n\n            // Add offsetParent borders\n            parentOffset = {\n                top: parentOffset.top + jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true ),\n                left: parentOffset.left + jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true )\n            };\n        }\n\n        // Subtract parent offsets and element margins\n        return {\n            top: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n            left: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n        };\n    },\n\n    // This method will return documentElement in the following cases:\n    // 1) For the element inside the iframe without offsetParent, this method will return\n    //    documentElement of the parent window\n    // 2) For the hidden or detached element\n    // 3) For body or html element, i.e. in case of the html node - it will return itself\n    //\n    // but those exceptions were never presented as a real life use-cases\n    // and might be considered as more preferable results.\n    //\n    // This logic, however, is not guaranteed and can change at any point in the future\n    offsetParent: function() {\n        return this.map( function() {\n            var offsetParent = this.offsetParent;\n\n            while ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n                offsetParent = offsetParent.offsetParent;\n            }\n\n            return offsetParent || documentElement;\n        } );\n    }\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n    var top = \"pageYOffset\" === prop;\n\n    jQuery.fn[ method ] = function( val ) {\n        return access( this, function( elem, method, val ) {\n            var win = getWindow( elem );\n\n            if ( val === undefined ) {\n                return win ? win[ prop ] : elem[ method ];\n            }\n\n            if ( win ) {\n                win.scrollTo(\n                    !top ? val : win.pageXOffset,\n                    top ? val : win.pageYOffset\n                );\n\n            } else {\n                elem[ method ] = val;\n            }\n        }, method, val, arguments.length );\n    };\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n    jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n        function( elem, computed ) {\n            if ( computed ) {\n                computed = curCSS( elem, prop );\n\n                // If curCSS returns percentage, fallback to offset\n                return rnumnonpx.test( computed ) ?\n                    jQuery( elem ).position()[ prop ] + \"px\" :\n                    computed;\n            }\n        }\n    );\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n    jQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n        function( defaultExtra, funcName ) {\n\n        // Margin is only for outerHeight, outerWidth\n        jQuery.fn[ funcName ] = function( margin, value ) {\n            var chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n                extra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n            return access( this, function( elem, type, value ) {\n                var doc;\n\n                if ( jQuery.isWindow( elem ) ) {\n\n                    // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n                    return funcName.indexOf( \"outer\" ) === 0 ?\n                        elem[ \"inner\" + name ] :\n                        elem.document.documentElement[ \"client\" + name ];\n                }\n\n                // Get document width or height\n                if ( elem.nodeType === 9 ) {\n                    doc = elem.documentElement;\n\n                    // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n                    // whichever is greatest\n                    return Math.max(\n                        elem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n                        elem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n                        doc[ \"client\" + name ]\n                    );\n                }\n\n                return value === undefined ?\n\n                    // Get width or height on the element, requesting but not forcing parseFloat\n                    jQuery.css( elem, type, extra ) :\n\n                    // Set width or height on the element\n                    jQuery.style( elem, type, value, extra );\n            }, type, chainable ? margin : undefined, chainable );\n        };\n    } );\n} );\n\n\njQuery.fn.extend( {\n\n    bind: function( types, data, fn ) {\n        return this.on( types, null, data, fn );\n    },\n    unbind: function( types, fn ) {\n        return this.off( types, null, fn );\n    },\n\n    delegate: function( selector, types, data, fn ) {\n        return this.on( types, selector, data, fn );\n    },\n    undelegate: function( selector, types, fn ) {\n\n        // ( namespace ) or ( selector, types [, fn] )\n        return arguments.length === 1 ?\n            this.off( selector, \"**\" ) :\n            this.off( types, selector || \"**\", fn );\n    }\n} );\n\njQuery.parseJSON = JSON.parse;\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n    define( \"jquery\", [], function() {\n        return jQuery;\n    } );\n}\n\n\n\n\nvar\n\n    // Map over jQuery in case of overwrite\n    _jQuery = window.jQuery,\n\n    // Map over the $ in case of overwrite\n    _$ = window.$;\n\njQuery.noConflict = function( deep ) {\n    if ( window.$ === jQuery ) {\n        window.$ = _$;\n    }\n\n    if ( deep && window.jQuery === jQuery ) {\n        window.jQuery = _jQuery;\n    }\n\n    return jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( !noGlobal ) {\n    window.jQuery = window.$ = jQuery;\n}\n\n\n\n\n\nreturn jQuery;\n} );"
  },
  {
    "path": "integrate/lib/vue-2.1.4.js",
    "content": "/*!\n * Vue.js v2.1.4\n * (c) 2014-2016 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.Vue = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction _toString (val) {\n  return val == null\n    ? ''\n    : typeof val === 'object'\n      ? JSON.stringify(val, null, 2)\n      : String(val)\n}\n\n/**\n * Convert a input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n  var n = parseFloat(val, 10);\n  return (n || n === 0) ? n : val\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n  str,\n  expectsLowerCase\n) {\n  var map = Object.create(null);\n  var list = str.split(',');\n  for (var i = 0; i < list.length; i++) {\n    map[list[i]] = true;\n  }\n  return expectsLowerCase\n    ? function (val) { return map[val.toLowerCase()]; }\n    : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Remove an item from an array\n */\nfunction remove$1 (arr, item) {\n  if (arr.length) {\n    var index = arr.indexOf(item);\n    if (index > -1) {\n      return arr.splice(index, 1)\n    }\n  }\n}\n\n/**\n * Check whether the object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n  return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Check if value is primitive\n */\nfunction isPrimitive (value) {\n  return typeof value === 'string' || typeof value === 'number'\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n  var cache = Object.create(null);\n  return function cachedFn (str) {\n    var hit = cache[str];\n    return hit || (cache[str] = fn(str))\n  }\n}\n\n/**\n * Camelize a hyphen-delmited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n  return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /([^-])([A-Z])/g;\nvar hyphenate = cached(function (str) {\n  return str\n    .replace(hyphenateRE, '$1-$2')\n    .replace(hyphenateRE, '$1-$2')\n    .toLowerCase()\n});\n\n/**\n * Simple bind, faster than native\n */\nfunction bind$1 (fn, ctx) {\n  function boundFn (a) {\n    var l = arguments.length;\n    return l\n      ? l > 1\n        ? fn.apply(ctx, arguments)\n        : fn.call(ctx, a)\n      : fn.call(ctx)\n  }\n  // record original fn length\n  boundFn._length = fn.length;\n  return boundFn\n}\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n  start = start || 0;\n  var i = list.length - start;\n  var ret = new Array(i);\n  while (i--) {\n    ret[i] = list[i + start];\n  }\n  return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n  for (var key in _from) {\n    to[key] = _from[key];\n  }\n  return to\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n  return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n  return toString.call(obj) === OBJECT_STRING\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n  var res = {};\n  for (var i = 0; i < arr.length; i++) {\n    if (arr[i]) {\n      extend(res, arr[i]);\n    }\n  }\n  return res\n}\n\n/**\n * Perform no operation.\n */\nfunction noop () {}\n\n/**\n * Always return false.\n */\nvar no = function () { return false; };\n\n/**\n * Generate a static keys string from compiler modules.\n */\nfunction genStaticKeys (modules) {\n  return modules.reduce(function (keys, m) {\n    return keys.concat(m.staticKeys || [])\n  }, []).join(',')\n}\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n  /* eslint-disable eqeqeq */\n  return a == b || (\n    isObject(a) && isObject(b)\n      ? JSON.stringify(a) === JSON.stringify(b)\n      : false\n  )\n  /* eslint-enable eqeqeq */\n}\n\nfunction looseIndexOf (arr, val) {\n  for (var i = 0; i < arr.length; i++) {\n    if (looseEqual(arr[i], val)) { return i }\n  }\n  return -1\n}\n\n/*  */\n\nvar config = {\n  /**\n   * Option merge strategies (used in core/util/options)\n   */\n  optionMergeStrategies: Object.create(null),\n\n  /**\n   * Whether to suppress warnings.\n   */\n  silent: false,\n\n  /**\n   * Whether to enable devtools\n   */\n  devtools: \"development\" !== 'production',\n\n  /**\n   * Error handler for watcher errors\n   */\n  errorHandler: null,\n\n  /**\n   * Ignore certain custom elements\n   */\n  ignoredElements: null,\n\n  /**\n   * Custom user key aliases for v-on\n   */\n  keyCodes: Object.create(null),\n\n  /**\n   * Check if a tag is reserved so that it cannot be registered as a\n   * component. This is platform-dependent and may be overwritten.\n   */\n  isReservedTag: no,\n\n  /**\n   * Check if a tag is an unknown element.\n   * Platform-dependent.\n   */\n  isUnknownElement: no,\n\n  /**\n   * Get the namespace of an element\n   */\n  getTagNamespace: noop,\n\n  /**\n   * Check if an attribute must be bound using property, e.g. value\n   * Platform-dependent.\n   */\n  mustUseProp: no,\n\n  /**\n   * List of asset types that a component can own.\n   */\n  _assetTypes: [\n    'component',\n    'directive',\n    'filter'\n  ],\n\n  /**\n   * List of lifecycle hooks.\n   */\n  _lifecycleHooks: [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated'\n  ],\n\n  /**\n   * Max circular updates allowed in a scheduler flush cycle.\n   */\n  _maxUpdateCount: 100\n};\n\n/*  */\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n  var c = (str + '').charCodeAt(0);\n  return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n  Object.defineProperty(obj, key, {\n    value: val,\n    enumerable: !!enumerable,\n    writable: true,\n    configurable: true\n  });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = /[^\\w.$]/;\nfunction parsePath (path) {\n  if (bailRE.test(path)) {\n    return\n  } else {\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n}\n\n/*  */\n/* globals MutationObserver */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = UA && UA.indexOf('android') > 0;\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n  if (_isServer === undefined) {\n    /* istanbul ignore if */\n    if (!inBrowser && typeof global !== 'undefined') {\n      // detect presence of vue-server-renderer and avoid\n      // Webpack shimming the process\n      _isServer = global['process'].env.VUE_ENV === 'server';\n    } else {\n      _isServer = false;\n    }\n  }\n  return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n  return /native code/.test(Ctor.toString())\n}\n\n/**\n * Defer a task to execute it asynchronously.\n */\nvar nextTick = (function () {\n  var callbacks = [];\n  var pending = false;\n  var timerFunc;\n\n  function nextTickHandler () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // the nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore if */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    var logError = function (err) { console.error(err); };\n    timerFunc = function () {\n      p.then(nextTickHandler).catch(logError);\n      // in problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n  } else if (typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS IE11, iOS7, Android 4.4\n    var counter = 1;\n    var observer = new MutationObserver(nextTickHandler);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n  } else {\n    // fallback to setTimeout\n    /* istanbul ignore next */\n    timerFunc = function () {\n      setTimeout(nextTickHandler, 0);\n    };\n  }\n\n  return function queueNextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) { cb.call(ctx); }\n      if (_resolve) { _resolve(ctx); }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n})();\n\nvar _Set;\n/* istanbul ignore if */\nif (typeof Set !== 'undefined' && isNative(Set)) {\n  // use native Set when available.\n  _Set = Set;\n} else {\n  // a non-standard Set polyfill that only works with primitive keys.\n  _Set = (function () {\n    function Set () {\n      this.set = Object.create(null);\n    }\n    Set.prototype.has = function has (key) {\n      return this.set[key] !== undefined\n    };\n    Set.prototype.add = function add (key) {\n      this.set[key] = 1;\n    };\n    Set.prototype.clear = function clear () {\n      this.set = Object.create(null);\n    };\n\n    return Set;\n  }());\n}\n\nvar warn = noop;\nvar formatComponentName;\n\n{\n  var hasConsole = typeof console !== 'undefined';\n\n  warn = function (msg, vm) {\n    if (hasConsole && (!config.silent)) {\n      console.error(\"[Vue warn]: \" + msg + \" \" + (\n        vm ? formatLocation(formatComponentName(vm)) : ''\n      ));\n    }\n  };\n\n  formatComponentName = function (vm) {\n    if (vm.$root === vm) {\n      return 'root instance'\n    }\n    var name = vm._isVue\n      ? vm.$options.name || vm.$options._componentTag\n      : vm.name;\n    return (\n      (name ? (\"component <\" + name + \">\") : \"anonymous component\") +\n      (vm._isVue && vm.$options.__file ? (\" at \" + (vm.$options.__file)) : '')\n    )\n  };\n\n  var formatLocation = function (str) {\n    if (str === 'anonymous component') {\n      str += \" - use the \\\"name\\\" option for better debugging messages.\";\n    }\n    return (\"\\n(found in \" + str + \")\")\n  };\n}\n\n/*  */\n\n\nvar uid$1 = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n  this.id = uid$1++;\n  this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n  this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n  remove$1(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n  if (Dep.target) {\n    Dep.target.addDep(this);\n  }\n};\n\nDep.prototype.notify = function notify () {\n  // stablize the subscriber list first\n  var subs = this.subs.slice();\n  for (var i = 0, l = subs.length; i < l; i++) {\n    subs[i].update();\n  }\n};\n\n// the current target watcher being evaluated.\n// this is globally unique because there could be only one\n// watcher being evaluated at any time.\nDep.target = null;\nvar targetStack = [];\n\nfunction pushTarget (_target) {\n  if (Dep.target) { targetStack.push(Dep.target); }\n  Dep.target = _target;\n}\n\nfunction popTarget () {\n  Dep.target = targetStack.pop();\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);[\n  'push',\n  'pop',\n  'shift',\n  'unshift',\n  'splice',\n  'sort',\n  'reverse'\n]\n.forEach(function (method) {\n  // cache original method\n  var original = arrayProto[method];\n  def(arrayMethods, method, function mutator () {\n    var arguments$1 = arguments;\n\n    // avoid leaking arguments:\n    // http://jsperf.com/closure-with-arguments\n    var i = arguments.length;\n    var args = new Array(i);\n    while (i--) {\n      args[i] = arguments$1[i];\n    }\n    var result = original.apply(this, args);\n    var ob = this.__ob__;\n    var inserted;\n    switch (method) {\n      case 'push':\n        inserted = args;\n        break\n      case 'unshift':\n        inserted = args;\n        break\n      case 'splice':\n        inserted = args.slice(2);\n        break\n    }\n    if (inserted) { ob.observeArray(inserted); }\n    // notify change\n    ob.dep.notify();\n    return result\n  });\n});\n\n/*  */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * By default, when a reactive property is set, the new value is\n * also converted to become reactive. However when passing down props,\n * we don't want to force conversion because the value may be a nested value\n * under a frozen data structure. Converting it would defeat the optimization.\n */\nvar observerState = {\n  shouldConvert: true,\n  isSettingProps: false\n};\n\n/**\n * Observer class that are attached to each observed\n * object. Once attached, the observer converts target\n * object's property keys into getter/setters that\n * collect dependencies and dispatches updates.\n */\nvar Observer = function Observer (value) {\n  this.value = value;\n  this.dep = new Dep();\n  this.vmCount = 0;\n  def(value, '__ob__', this);\n  if (Array.isArray(value)) {\n    var augment = hasProto\n      ? protoAugment\n      : copyAugment;\n    augment(value, arrayMethods, arrayKeys);\n    this.observeArray(value);\n  } else {\n    this.walk(value);\n  }\n};\n\n/**\n * Walk through each property and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n  var keys = Object.keys(obj);\n  for (var i = 0; i < keys.length; i++) {\n    defineReactive$$1(obj, keys[i], obj[keys[i]]);\n  }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n  for (var i = 0, l = items.length; i < l; i++) {\n    observe(items[i]);\n  }\n};\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src) {\n  /* eslint-disable no-proto */\n  target.__proto__ = src;\n  /* eslint-enable no-proto */\n}\n\n/**\n * Augment an target Object or Array by defining\n * hidden properties.\n *\n * istanbul ignore next\n */\nfunction copyAugment (target, src, keys) {\n  for (var i = 0, l = keys.length; i < l; i++) {\n    var key = keys[i];\n    def(target, key, src[key]);\n  }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value) {\n  if (!isObject(value)) {\n    return\n  }\n  var ob;\n  if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n    ob = value.__ob__;\n  } else if (\n    observerState.shouldConvert &&\n    !isServerRendering() &&\n    (Array.isArray(value) || isPlainObject(value)) &&\n    Object.isExtensible(value) &&\n    !value._isVue\n  ) {\n    ob = new Observer(value);\n  }\n  return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive$$1 (\n  obj,\n  key,\n  val,\n  customSetter\n) {\n  var dep = new Dep();\n\n  var property = Object.getOwnPropertyDescriptor(obj, key);\n  if (property && property.configurable === false) {\n    return\n  }\n\n  // cater for pre-defined getter/setters\n  var getter = property && property.get;\n  var setter = property && property.set;\n\n  var childOb = observe(val);\n  Object.defineProperty(obj, key, {\n    enumerable: true,\n    configurable: true,\n    get: function reactiveGetter () {\n      var value = getter ? getter.call(obj) : val;\n      if (Dep.target) {\n        dep.depend();\n        if (childOb) {\n          childOb.dep.depend();\n        }\n        if (Array.isArray(value)) {\n          dependArray(value);\n        }\n      }\n      return value\n    },\n    set: function reactiveSetter (newVal) {\n      var value = getter ? getter.call(obj) : val;\n      /* eslint-disable no-self-compare */\n      if (newVal === value || (newVal !== newVal && value !== value)) {\n        return\n      }\n      /* eslint-enable no-self-compare */\n      if (\"development\" !== 'production' && customSetter) {\n        customSetter();\n      }\n      if (setter) {\n        setter.call(obj, newVal);\n      } else {\n        val = newVal;\n      }\n      childOb = observe(newVal);\n      dep.notify();\n    }\n  });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set$1 (obj, key, val) {\n  if (Array.isArray(obj)) {\n    obj.length = Math.max(obj.length, key);\n    obj.splice(key, 1, val);\n    return val\n  }\n  if (hasOwn(obj, key)) {\n    obj[key] = val;\n    return\n  }\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid adding reactive properties to a Vue instance or its root $data ' +\n      'at runtime - declare it upfront in the data option.'\n    );\n    return\n  }\n  if (!ob) {\n    obj[key] = val;\n    return\n  }\n  defineReactive$$1(ob.value, key, val);\n  ob.dep.notify();\n  return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (obj, key) {\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid deleting properties on a Vue instance or its root $data ' +\n      '- just set it to null.'\n    );\n    return\n  }\n  if (!hasOwn(obj, key)) {\n    return\n  }\n  delete obj[key];\n  if (!ob) {\n    return\n  }\n  ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n  for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n    e = value[i];\n    e && e.__ob__ && e.__ob__.dep.depend();\n    if (Array.isArray(e)) {\n      dependArray(e);\n    }\n  }\n}\n\n/*  */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\n{\n  strats.el = strats.propsData = function (parent, child, vm, key) {\n    if (!vm) {\n      warn(\n        \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n        'creation with the `new` keyword.'\n      );\n    }\n    return defaultStrat(parent, child)\n  };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n  if (!from) { return to }\n  var key, toVal, fromVal;\n  var keys = Object.keys(from);\n  for (var i = 0; i < keys.length; i++) {\n    key = keys[i];\n    toVal = to[key];\n    fromVal = from[key];\n    if (!hasOwn(to, key)) {\n      set$1(to, key, fromVal);\n    } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {\n      mergeData(toVal, fromVal);\n    }\n  }\n  return to\n}\n\n/**\n * Data\n */\nstrats.data = function (\n  parentVal,\n  childVal,\n  vm\n) {\n  if (!vm) {\n    // in a Vue.extend merge, both should be functions\n    if (!childVal) {\n      return parentVal\n    }\n    if (typeof childVal !== 'function') {\n      \"development\" !== 'production' && warn(\n        'The \"data\" option should be a function ' +\n        'that returns a per-instance value in component ' +\n        'definitions.',\n        vm\n      );\n      return parentVal\n    }\n    if (!parentVal) {\n      return childVal\n    }\n    // when parentVal & childVal are both present,\n    // we need to return a function that returns the\n    // merged result of both functions... no need to\n    // check if parentVal is a function here because\n    // it has to be a function to pass previous merges.\n    return function mergedDataFn () {\n      return mergeData(\n        childVal.call(this),\n        parentVal.call(this)\n      )\n    }\n  } else if (parentVal || childVal) {\n    return function mergedInstanceDataFn () {\n      // instance merge\n      var instanceData = typeof childVal === 'function'\n        ? childVal.call(vm)\n        : childVal;\n      var defaultData = typeof parentVal === 'function'\n        ? parentVal.call(vm)\n        : undefined;\n      if (instanceData) {\n        return mergeData(instanceData, defaultData)\n      } else {\n        return defaultData\n      }\n    }\n  }\n};\n\n/**\n * Hooks and param attributes are merged as arrays.\n */\nfunction mergeHook (\n  parentVal,\n  childVal\n) {\n  return childVal\n    ? parentVal\n      ? parentVal.concat(childVal)\n      : Array.isArray(childVal)\n        ? childVal\n        : [childVal]\n    : parentVal\n}\n\nconfig._lifecycleHooks.forEach(function (hook) {\n  strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (parentVal, childVal) {\n  var res = Object.create(parentVal || null);\n  return childVal\n    ? extend(res, childVal)\n    : res\n}\n\nconfig._assetTypes.forEach(function (type) {\n  strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (parentVal, childVal) {\n  /* istanbul ignore if */\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = {};\n  extend(ret, parentVal);\n  for (var key in childVal) {\n    var parent = ret[key];\n    var child = childVal[key];\n    if (parent && !Array.isArray(parent)) {\n      parent = [parent];\n    }\n    ret[key] = parent\n      ? parent.concat(child)\n      : [child];\n  }\n  return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.computed = function (parentVal, childVal) {\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = Object.create(null);\n  extend(ret, parentVal);\n  extend(ret, childVal);\n  return ret\n};\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n  return childVal === undefined\n    ? parentVal\n    : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n  for (var key in options.components) {\n    var lower = key.toLowerCase();\n    if (isBuiltInTag(lower) || config.isReservedTag(lower)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + key\n      );\n    }\n  }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options) {\n  var props = options.props;\n  if (!props) { return }\n  var res = {};\n  var i, val, name;\n  if (Array.isArray(props)) {\n    i = props.length;\n    while (i--) {\n      val = props[i];\n      if (typeof val === 'string') {\n        name = camelize(val);\n        res[name] = { type: null };\n      } else {\n        warn('props must be strings when using array syntax.');\n      }\n    }\n  } else if (isPlainObject(props)) {\n    for (var key in props) {\n      val = props[key];\n      name = camelize(key);\n      res[name] = isPlainObject(val)\n        ? val\n        : { type: val };\n    }\n  }\n  options.props = res;\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n  var dirs = options.directives;\n  if (dirs) {\n    for (var key in dirs) {\n      var def = dirs[key];\n      if (typeof def === 'function') {\n        dirs[key] = { bind: def, update: def };\n      }\n    }\n  }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n  parent,\n  child,\n  vm\n) {\n  {\n    checkComponents(child);\n  }\n  normalizeProps(child);\n  normalizeDirectives(child);\n  var extendsFrom = child.extends;\n  if (extendsFrom) {\n    parent = typeof extendsFrom === 'function'\n      ? mergeOptions(parent, extendsFrom.options, vm)\n      : mergeOptions(parent, extendsFrom, vm);\n  }\n  if (child.mixins) {\n    for (var i = 0, l = child.mixins.length; i < l; i++) {\n      var mixin = child.mixins[i];\n      if (mixin.prototype instanceof Vue$3) {\n        mixin = mixin.options;\n      }\n      parent = mergeOptions(parent, mixin, vm);\n    }\n  }\n  var options = {};\n  var key;\n  for (key in parent) {\n    mergeField(key);\n  }\n  for (key in child) {\n    if (!hasOwn(parent, key)) {\n      mergeField(key);\n    }\n  }\n  function mergeField (key) {\n    var strat = strats[key] || defaultStrat;\n    options[key] = strat(parent[key], child[key], vm, key);\n  }\n  return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n  options,\n  type,\n  id,\n  warnMissing\n) {\n  /* istanbul ignore if */\n  if (typeof id !== 'string') {\n    return\n  }\n  var assets = options[type];\n  var res = assets[id] ||\n    // camelCase ID\n    assets[camelize(id)] ||\n    // Pascal Case ID\n    assets[capitalize(camelize(id))];\n  if (\"development\" !== 'production' && warnMissing && !res) {\n    warn(\n      'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n      options\n    );\n  }\n  return res\n}\n\n/*  */\n\nfunction validateProp (\n  key,\n  propOptions,\n  propsData,\n  vm\n) {\n  var prop = propOptions[key];\n  var absent = !hasOwn(propsData, key);\n  var value = propsData[key];\n  // handle boolean props\n  if (isBooleanType(prop.type)) {\n    if (absent && !hasOwn(prop, 'default')) {\n      value = false;\n    } else if (value === '' || value === hyphenate(key)) {\n      value = true;\n    }\n  }\n  // check default value\n  if (value === undefined) {\n    value = getPropDefaultValue(vm, prop, key);\n    // since the default value is a fresh copy,\n    // make sure to observe it.\n    var prevShouldConvert = observerState.shouldConvert;\n    observerState.shouldConvert = true;\n    observe(value);\n    observerState.shouldConvert = prevShouldConvert;\n  }\n  {\n    assertProp(prop, key, value, vm, absent);\n  }\n  return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n  // no default, return undefined\n  if (!hasOwn(prop, 'default')) {\n    return undefined\n  }\n  var def = prop.default;\n  // warn against non-factory defaults for Object & Array\n  if (isObject(def)) {\n    \"development\" !== 'production' && warn(\n      'Invalid default value for prop \"' + key + '\": ' +\n      'Props with type Object/Array must use a factory function ' +\n      'to return the default value.',\n      vm\n    );\n  }\n  // the raw prop value was also undefined from previous render,\n  // return previous default value to avoid unnecessary watcher trigger\n  if (vm && vm.$options.propsData &&\n    vm.$options.propsData[key] === undefined &&\n    vm[key] !== undefined) {\n    return vm[key]\n  }\n  // call factory function for non-Function types\n  return typeof def === 'function' && prop.type !== Function\n    ? def.call(vm)\n    : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n  prop,\n  name,\n  value,\n  vm,\n  absent\n) {\n  if (prop.required && absent) {\n    warn(\n      'Missing required prop: \"' + name + '\"',\n      vm\n    );\n    return\n  }\n  if (value == null && !prop.required) {\n    return\n  }\n  var type = prop.type;\n  var valid = !type || type === true;\n  var expectedTypes = [];\n  if (type) {\n    if (!Array.isArray(type)) {\n      type = [type];\n    }\n    for (var i = 0; i < type.length && !valid; i++) {\n      var assertedType = assertType(value, type[i]);\n      expectedTypes.push(assertedType.expectedType);\n      valid = assertedType.valid;\n    }\n  }\n  if (!valid) {\n    warn(\n      'Invalid prop: type check failed for prop \"' + name + '\".' +\n      ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n      ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n      vm\n    );\n    return\n  }\n  var validator = prop.validator;\n  if (validator) {\n    if (!validator(value)) {\n      warn(\n        'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n        vm\n      );\n    }\n  }\n}\n\n/**\n * Assert the type of a value\n */\nfunction assertType (value, type) {\n  var valid;\n  var expectedType = getType(type);\n  if (expectedType === 'String') {\n    valid = typeof value === (expectedType = 'string');\n  } else if (expectedType === 'Number') {\n    valid = typeof value === (expectedType = 'number');\n  } else if (expectedType === 'Boolean') {\n    valid = typeof value === (expectedType = 'boolean');\n  } else if (expectedType === 'Function') {\n    valid = typeof value === (expectedType = 'function');\n  } else if (expectedType === 'Object') {\n    valid = isPlainObject(value);\n  } else if (expectedType === 'Array') {\n    valid = Array.isArray(value);\n  } else {\n    valid = value instanceof type;\n  }\n  return {\n    valid: valid,\n    expectedType: expectedType\n  }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n  var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n  return match && match[1]\n}\n\nfunction isBooleanType (fn) {\n  if (!Array.isArray(fn)) {\n    return getType(fn) === 'Boolean'\n  }\n  for (var i = 0, len = fn.length; i < len; i++) {\n    if (getType(fn[i]) === 'Boolean') {\n      return true\n    }\n  }\n  /* istanbul ignore next */\n  return false\n}\n\n\n\nvar util = Object.freeze({\n  defineReactive: defineReactive$$1,\n  _toString: _toString,\n  toNumber: toNumber,\n  makeMap: makeMap,\n  isBuiltInTag: isBuiltInTag,\n  remove: remove$1,\n  hasOwn: hasOwn,\n  isPrimitive: isPrimitive,\n  cached: cached,\n  camelize: camelize,\n  capitalize: capitalize,\n  hyphenate: hyphenate,\n  bind: bind$1,\n  toArray: toArray,\n  extend: extend,\n  isObject: isObject,\n  isPlainObject: isPlainObject,\n  toObject: toObject,\n  noop: noop,\n  no: no,\n  genStaticKeys: genStaticKeys,\n  looseEqual: looseEqual,\n  looseIndexOf: looseIndexOf,\n  isReserved: isReserved,\n  def: def,\n  parsePath: parsePath,\n  hasProto: hasProto,\n  inBrowser: inBrowser,\n  UA: UA,\n  isIE: isIE,\n  isIE9: isIE9,\n  isEdge: isEdge,\n  isAndroid: isAndroid,\n  isIOS: isIOS,\n  isServerRendering: isServerRendering,\n  devtools: devtools,\n  nextTick: nextTick,\n  get _Set () { return _Set; },\n  mergeOptions: mergeOptions,\n  resolveAsset: resolveAsset,\n  get warn () { return warn; },\n  get formatComponentName () { return formatComponentName; },\n  validateProp: validateProp\n});\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\n{\n  var allowedGlobals = makeMap(\n    'Infinity,undefined,NaN,isFinite,isNaN,' +\n    'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n    'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n    'require' // for Webpack/Browserify\n  );\n\n  var warnNonPresent = function (target, key) {\n    warn(\n      \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n      \"referenced during render. Make sure to declare reactive data \" +\n      \"properties in the data option.\",\n      target\n    );\n  };\n\n  var hasProxy =\n    typeof Proxy !== 'undefined' &&\n    Proxy.toString().match(/native code/);\n\n  if (hasProxy) {\n    var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');\n    config.keyCodes = new Proxy(config.keyCodes, {\n      set: function set (target, key, value) {\n        if (isBuiltInModifier(key)) {\n          warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n          return false\n        } else {\n          target[key] = value;\n          return true\n        }\n      }\n    });\n  }\n\n  var hasHandler = {\n    has: function has (target, key) {\n      var has = key in target;\n      var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';\n      if (!has && !isAllowed) {\n        warnNonPresent(target, key);\n      }\n      return has || !isAllowed\n    }\n  };\n\n  var getHandler = {\n    get: function get (target, key) {\n      if (typeof key === 'string' && !(key in target)) {\n        warnNonPresent(target, key);\n      }\n      return target[key]\n    }\n  };\n\n  initProxy = function initProxy (vm) {\n    if (hasProxy) {\n      // determine which proxy handler to use\n      var options = vm.$options;\n      var handlers = options.render && options.render._withStripped\n        ? getHandler\n        : hasHandler;\n      vm._renderProxy = new Proxy(vm, handlers);\n    } else {\n      vm._renderProxy = vm;\n    }\n  };\n}\n\n/*  */\n\n\nvar queue = [];\nvar has$1 = {};\nvar circular = {};\nvar waiting = false;\nvar flushing = false;\nvar index = 0;\n\n/**\n * Reset the scheduler's state.\n */\nfunction resetSchedulerState () {\n  queue.length = 0;\n  has$1 = {};\n  {\n    circular = {};\n  }\n  waiting = flushing = false;\n}\n\n/**\n * Flush both queues and run the watchers.\n */\nfunction flushSchedulerQueue () {\n  flushing = true;\n\n  // Sort queue before flush.\n  // This ensures that:\n  // 1. Components are updated from parent to child. (because parent is always\n  //    created before the child)\n  // 2. A component's user watchers are run before its render watcher (because\n  //    user watchers are created before the render watcher)\n  // 3. If a component is destroyed during a parent component's watcher run,\n  //    its watchers can be skipped.\n  queue.sort(function (a, b) { return a.id - b.id; });\n\n  // do not cache length because more watchers might be pushed\n  // as we run existing watchers\n  for (index = 0; index < queue.length; index++) {\n    var watcher = queue[index];\n    var id = watcher.id;\n    has$1[id] = null;\n    watcher.run();\n    // in dev build, check and stop circular updates.\n    if (\"development\" !== 'production' && has$1[id] != null) {\n      circular[id] = (circular[id] || 0) + 1;\n      if (circular[id] > config._maxUpdateCount) {\n        warn(\n          'You may have an infinite update loop ' + (\n            watcher.user\n              ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n              : \"in a component render function.\"\n          ),\n          watcher.vm\n        );\n        break\n      }\n    }\n  }\n\n  // devtool hook\n  /* istanbul ignore if */\n  if (devtools && config.devtools) {\n    devtools.emit('flush');\n  }\n\n  resetSchedulerState();\n}\n\n/**\n * Push a watcher into the watcher queue.\n * Jobs with duplicate IDs will be skipped unless it's\n * pushed when the queue is being flushed.\n */\nfunction queueWatcher (watcher) {\n  var id = watcher.id;\n  if (has$1[id] == null) {\n    has$1[id] = true;\n    if (!flushing) {\n      queue.push(watcher);\n    } else {\n      // if already flushing, splice the watcher based on its id\n      // if already past its id, it will be run next immediately.\n      var i = queue.length - 1;\n      while (i >= 0 && queue[i].id > watcher.id) {\n        i--;\n      }\n      queue.splice(Math.max(i, index) + 1, 0, watcher);\n    }\n    // queue the flush\n    if (!waiting) {\n      waiting = true;\n      nextTick(flushSchedulerQueue);\n    }\n  }\n}\n\n/*  */\n\nvar uid$2 = 0;\n\n/**\n * A watcher parses an expression, collects dependencies,\n * and fires callback when the expression value changes.\n * This is used for both the $watch() api and directives.\n */\nvar Watcher = function Watcher (\n  vm,\n  expOrFn,\n  cb,\n  options\n) {\n  if ( options === void 0 ) options = {};\n\n  this.vm = vm;\n  vm._watchers.push(this);\n  // options\n  this.deep = !!options.deep;\n  this.user = !!options.user;\n  this.lazy = !!options.lazy;\n  this.sync = !!options.sync;\n  this.expression = expOrFn.toString();\n  this.cb = cb;\n  this.id = ++uid$2; // uid for batching\n  this.active = true;\n  this.dirty = this.lazy; // for lazy watchers\n  this.deps = [];\n  this.newDeps = [];\n  this.depIds = new _Set();\n  this.newDepIds = new _Set();\n  // parse expression for getter\n  if (typeof expOrFn === 'function') {\n    this.getter = expOrFn;\n  } else {\n    this.getter = parsePath(expOrFn);\n    if (!this.getter) {\n      this.getter = function () {};\n      \"development\" !== 'production' && warn(\n        \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n        'Watcher only accepts simple dot-delimited paths. ' +\n        'For full control, use a function instead.',\n        vm\n      );\n    }\n  }\n  this.value = this.lazy\n    ? undefined\n    : this.get();\n};\n\n/**\n * Evaluate the getter, and re-collect dependencies.\n */\nWatcher.prototype.get = function get () {\n  pushTarget(this);\n  var value = this.getter.call(this.vm, this.vm);\n  // \"touch\" every property so they are all tracked as\n  // dependencies for deep watching\n  if (this.deep) {\n    traverse(value);\n  }\n  popTarget();\n  this.cleanupDeps();\n  return value\n};\n\n/**\n * Add a dependency to this directive.\n */\nWatcher.prototype.addDep = function addDep (dep) {\n  var id = dep.id;\n  if (!this.newDepIds.has(id)) {\n    this.newDepIds.add(id);\n    this.newDeps.push(dep);\n    if (!this.depIds.has(id)) {\n      dep.addSub(this);\n    }\n  }\n};\n\n/**\n * Clean up for dependency collection.\n */\nWatcher.prototype.cleanupDeps = function cleanupDeps () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    var dep = this$1.deps[i];\n    if (!this$1.newDepIds.has(dep.id)) {\n      dep.removeSub(this$1);\n    }\n  }\n  var tmp = this.depIds;\n  this.depIds = this.newDepIds;\n  this.newDepIds = tmp;\n  this.newDepIds.clear();\n  tmp = this.deps;\n  this.deps = this.newDeps;\n  this.newDeps = tmp;\n  this.newDeps.length = 0;\n};\n\n/**\n * Subscriber interface.\n * Will be called when a dependency changes.\n */\nWatcher.prototype.update = function update () {\n  /* istanbul ignore else */\n  if (this.lazy) {\n    this.dirty = true;\n  } else if (this.sync) {\n    this.run();\n  } else {\n    queueWatcher(this);\n  }\n};\n\n/**\n * Scheduler job interface.\n * Will be called by the scheduler.\n */\nWatcher.prototype.run = function run () {\n  if (this.active) {\n    var value = this.get();\n      if (\n        value !== this.value ||\n      // Deep watchers and watchers on Object/Arrays should fire even\n      // when the value is the same, because the value may\n      // have mutated.\n      isObject(value) ||\n      this.deep\n    ) {\n      // set new value\n      var oldValue = this.value;\n      this.value = value;\n      if (this.user) {\n        try {\n          this.cb.call(this.vm, value, oldValue);\n        } catch (e) {\n          /* istanbul ignore else */\n          if (config.errorHandler) {\n            config.errorHandler.call(null, e, this.vm);\n          } else {\n            \"development\" !== 'production' && warn(\n              (\"Error in watcher \\\"\" + (this.expression) + \"\\\"\"),\n              this.vm\n            );\n            throw e\n          }\n        }\n      } else {\n        this.cb.call(this.vm, value, oldValue);\n      }\n    }\n  }\n};\n\n/**\n * Evaluate the value of the watcher.\n * This only gets called for lazy watchers.\n */\nWatcher.prototype.evaluate = function evaluate () {\n  this.value = this.get();\n  this.dirty = false;\n};\n\n/**\n * Depend on all deps collected by this watcher.\n */\nWatcher.prototype.depend = function depend () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    this$1.deps[i].depend();\n  }\n};\n\n/**\n * Remove self from all dependencies' subscriber list.\n */\nWatcher.prototype.teardown = function teardown () {\n    var this$1 = this;\n\n  if (this.active) {\n    // remove self from vm's watcher list\n    // this is a somewhat expensive operation so we skip it\n    // if the vm is being destroyed or is performing a v-for\n    // re-render (the watcher list is then filtered by v-for).\n    if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {\n      remove$1(this.vm._watchers, this);\n    }\n    var i = this.deps.length;\n    while (i--) {\n      this$1.deps[i].removeSub(this$1);\n    }\n    this.active = false;\n  }\n};\n\n/**\n * Recursively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n */\nvar seenObjects = new _Set();\nfunction traverse (val) {\n  seenObjects.clear();\n  _traverse(val, seenObjects);\n}\n\nfunction _traverse (val, seen) {\n  var i, keys;\n  var isA = Array.isArray(val);\n  if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {\n    return\n  }\n  if (val.__ob__) {\n    var depId = val.__ob__.dep.id;\n    if (seen.has(depId)) {\n      return\n    }\n    seen.add(depId);\n  }\n  if (isA) {\n    i = val.length;\n    while (i--) { _traverse(val[i], seen); }\n  } else {\n    keys = Object.keys(val);\n    i = keys.length;\n    while (i--) { _traverse(val[keys[i]], seen); }\n  }\n}\n\n/*  */\n\nfunction initState (vm) {\n  vm._watchers = [];\n  initProps(vm);\n  initMethods(vm);\n  initData(vm);\n  initComputed(vm);\n  initWatch(vm);\n}\n\nvar isReservedProp = { key: 1, ref: 1, slot: 1 };\n\nfunction initProps (vm) {\n  var props = vm.$options.props;\n  if (props) {\n    var propsData = vm.$options.propsData || {};\n    var keys = vm.$options._propKeys = Object.keys(props);\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    observerState.shouldConvert = isRoot;\n    var loop = function ( i ) {\n      var key = keys[i];\n      /* istanbul ignore else */\n      {\n        if (isReservedProp[key]) {\n          warn(\n            (\"\\\"\" + key + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {\n          if (vm.$parent && !observerState.isSettingProps) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n    };\n\n    for (var i = 0; i < keys.length; i++) loop( i );\n    observerState.shouldConvert = true;\n  }\n}\n\nfunction initData (vm) {\n  var data = vm.$options.data;\n  data = vm._data = typeof data === 'function'\n    ? data.call(vm)\n    : data || {};\n  if (!isPlainObject(data)) {\n    data = {};\n    \"development\" !== 'production' && warn(\n      'data functions should return an object.',\n      vm\n    );\n  }\n  // proxy data on instance\n  var keys = Object.keys(data);\n  var props = vm.$options.props;\n  var i = keys.length;\n  while (i--) {\n    if (props && hasOwn(props, keys[i])) {\n      \"development\" !== 'production' && warn(\n        \"The data property \\\"\" + (keys[i]) + \"\\\" is already declared as a prop. \" +\n        \"Use prop default value instead.\",\n        vm\n      );\n    } else {\n      proxy(vm, keys[i]);\n    }\n  }\n  // observe data\n  observe(data);\n  data.__ob__ && data.__ob__.vmCount++;\n}\n\nvar computedSharedDefinition = {\n  enumerable: true,\n  configurable: true,\n  get: noop,\n  set: noop\n};\n\nfunction initComputed (vm) {\n  var computed = vm.$options.computed;\n  if (computed) {\n    for (var key in computed) {\n      var userDef = computed[key];\n      if (typeof userDef === 'function') {\n        computedSharedDefinition.get = makeComputedGetter(userDef, vm);\n        computedSharedDefinition.set = noop;\n      } else {\n        computedSharedDefinition.get = userDef.get\n          ? userDef.cache !== false\n            ? makeComputedGetter(userDef.get, vm)\n            : bind$1(userDef.get, vm)\n          : noop;\n        computedSharedDefinition.set = userDef.set\n          ? bind$1(userDef.set, vm)\n          : noop;\n      }\n      Object.defineProperty(vm, key, computedSharedDefinition);\n    }\n  }\n}\n\nfunction makeComputedGetter (getter, owner) {\n  var watcher = new Watcher(owner, getter, noop, {\n    lazy: true\n  });\n  return function computedGetter () {\n    if (watcher.dirty) {\n      watcher.evaluate();\n    }\n    if (Dep.target) {\n      watcher.depend();\n    }\n    return watcher.value\n  }\n}\n\nfunction initMethods (vm) {\n  var methods = vm.$options.methods;\n  if (methods) {\n    for (var key in methods) {\n      vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);\n      if (\"development\" !== 'production' && methods[key] == null) {\n        warn(\n          \"method \\\"\" + key + \"\\\" has an undefined value in the component definition. \" +\n          \"Did you reference the function correctly?\",\n          vm\n        );\n      }\n    }\n  }\n}\n\nfunction initWatch (vm) {\n  var watch = vm.$options.watch;\n  if (watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n}\n\nfunction createWatcher (vm, key, handler) {\n  var options;\n  if (isPlainObject(handler)) {\n    options = handler;\n    handler = handler.handler;\n  }\n  if (typeof handler === 'string') {\n    handler = vm[handler];\n  }\n  vm.$watch(key, handler, options);\n}\n\nfunction stateMixin (Vue) {\n  // flow somehow has problems with directly declared definition object\n  // when using Object.defineProperty, so we have to procedurally build up\n  // the object here.\n  var dataDef = {};\n  dataDef.get = function () {\n    return this._data\n  };\n  {\n    dataDef.set = function (newData) {\n      warn(\n        'Avoid replacing instance root $data. ' +\n        'Use nested data properties instead.',\n        this\n      );\n    };\n  }\n  Object.defineProperty(Vue.prototype, '$data', dataDef);\n\n  Vue.prototype.$set = set$1;\n  Vue.prototype.$delete = del;\n\n  Vue.prototype.$watch = function (\n    expOrFn,\n    cb,\n    options\n  ) {\n    var vm = this;\n    options = options || {};\n    options.user = true;\n    var watcher = new Watcher(vm, expOrFn, cb, options);\n    if (options.immediate) {\n      cb.call(vm, watcher.value);\n    }\n    return function unwatchFn () {\n      watcher.teardown();\n    }\n  };\n}\n\nfunction proxy (vm, key) {\n  if (!isReserved(key)) {\n    Object.defineProperty(vm, key, {\n      configurable: true,\n      enumerable: true,\n      get: function proxyGetter () {\n        return vm._data[key]\n      },\n      set: function proxySetter (val) {\n        vm._data[key] = val;\n      }\n    });\n  }\n}\n\n/*  */\n\nvar VNode = function VNode (\n  tag,\n  data,\n  children,\n  text,\n  elm,\n  ns,\n  context,\n  componentOptions\n) {\n  this.tag = tag;\n  this.data = data;\n  this.children = children;\n  this.text = text;\n  this.elm = elm;\n  this.ns = ns;\n  this.context = context;\n  this.functionalContext = undefined;\n  this.key = data && data.key;\n  this.componentOptions = componentOptions;\n  this.child = undefined;\n  this.parent = undefined;\n  this.raw = false;\n  this.isStatic = false;\n  this.isRootInsert = true;\n  this.isComment = false;\n  this.isCloned = false;\n  this.isOnce = false;\n};\n\nvar emptyVNode = function () {\n  var node = new VNode();\n  node.text = '';\n  node.isComment = true;\n  return node\n};\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n  var cloned = new VNode(\n    vnode.tag,\n    vnode.data,\n    vnode.children,\n    vnode.text,\n    vnode.elm,\n    vnode.ns,\n    vnode.context,\n    vnode.componentOptions\n  );\n  cloned.isStatic = vnode.isStatic;\n  cloned.key = vnode.key;\n  cloned.isCloned = true;\n  return cloned\n}\n\nfunction cloneVNodes (vnodes) {\n  var res = new Array(vnodes.length);\n  for (var i = 0; i < vnodes.length; i++) {\n    res[i] = cloneVNode(vnodes[i]);\n  }\n  return res\n}\n\n/*  */\n\nfunction mergeVNodeHook (def, hookKey, hook, key) {\n  key = key + hookKey;\n  var injectedHash = def.__injected || (def.__injected = {});\n  if (!injectedHash[key]) {\n    injectedHash[key] = true;\n    var oldHook = def[hookKey];\n    if (oldHook) {\n      def[hookKey] = function () {\n        oldHook.apply(this, arguments);\n        hook.apply(this, arguments);\n      };\n    } else {\n      def[hookKey] = hook;\n    }\n  }\n}\n\n/*  */\n\nfunction updateListeners (\n  on,\n  oldOn,\n  add,\n  remove$$1,\n  vm\n) {\n  var name, cur, old, fn, event, capture, once;\n  for (name in on) {\n    cur = on[name];\n    old = oldOn[name];\n    if (!cur) {\n      \"development\" !== 'production' && warn(\n        \"Invalid handler for event \\\"\" + name + \"\\\": got \" + String(cur),\n        vm\n      );\n    } else if (!old) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      if (Array.isArray(cur)) {\n        add(event, (cur.invoker = arrInvoker(cur)), once, capture);\n      } else {\n        if (!cur.invoker) {\n          fn = cur;\n          cur = on[name] = {};\n          cur.fn = fn;\n          cur.invoker = fnInvoker(cur);\n        }\n        add(event, cur.invoker, once, capture);\n      }\n    } else if (cur !== old) {\n      if (Array.isArray(old)) {\n        old.length = cur.length;\n        for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }\n        on[name] = old;\n      } else {\n        old.fn = cur;\n        on[name] = old;\n      }\n    }\n  }\n  for (name in oldOn) {\n    if (!on[name]) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      remove$$1(event, oldOn[name].invoker, capture);\n    }\n  }\n}\n\nfunction arrInvoker (arr) {\n  return function (ev) {\n    var arguments$1 = arguments;\n\n    var single = arguments.length === 1;\n    for (var i = 0; i < arr.length; i++) {\n      single ? arr[i](ev) : arr[i].apply(null, arguments$1);\n    }\n  }\n}\n\nfunction fnInvoker (o) {\n  return function (ev) {\n    var single = arguments.length === 1;\n    single ? o.fn(ev) : o.fn.apply(null, arguments);\n  }\n}\n\n/*  */\n\nfunction normalizeChildren (\n  children,\n  ns,\n  nestedIndex\n) {\n  if (isPrimitive(children)) {\n    return [createTextVNode(children)]\n  }\n  if (Array.isArray(children)) {\n    var res = [];\n    for (var i = 0, l = children.length; i < l; i++) {\n      var c = children[i];\n      var last = res[res.length - 1];\n      //  nested\n      if (Array.isArray(c)) {\n        res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + \"_\" + i)));\n      } else if (isPrimitive(c)) {\n        if (last && last.text) {\n          last.text += String(c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else if (c instanceof VNode) {\n        if (c.text && last && last.text) {\n          if (!last.isCloned) {\n            last.text += c.text;\n          }\n        } else {\n          // inherit parent namespace\n          if (ns) {\n            applyNS(c, ns);\n          }\n          // default key for nested array children (likely generated by v-for)\n          if (c.tag && c.key == null && nestedIndex != null) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n}\n\nfunction createTextVNode (val) {\n  return new VNode(undefined, undefined, undefined, String(val))\n}\n\nfunction applyNS (vnode, ns) {\n  if (vnode.tag && !vnode.ns) {\n    vnode.ns = ns;\n    if (vnode.children) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        applyNS(vnode.children[i], ns);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction getFirstComponentChild (children) {\n  return children && children.filter(function (c) { return c && c.componentOptions; })[0]\n}\n\n/*  */\n\nvar activeInstance = null;\n\nfunction initLifecycle (vm) {\n  var options = vm.$options;\n\n  // locate first non-abstract parent\n  var parent = options.parent;\n  if (parent && !options.abstract) {\n    while (parent.$options.abstract && parent.$parent) {\n      parent = parent.$parent;\n    }\n    parent.$children.push(vm);\n  }\n\n  vm.$parent = parent;\n  vm.$root = parent ? parent.$root : vm;\n\n  vm.$children = [];\n  vm.$refs = {};\n\n  vm._watcher = null;\n  vm._inactive = false;\n  vm._isMounted = false;\n  vm._isDestroyed = false;\n  vm._isBeingDestroyed = false;\n}\n\nfunction lifecycleMixin (Vue) {\n  Vue.prototype._mount = function (\n    el,\n    hydrating\n  ) {\n    var vm = this;\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = emptyVNode;\n      {\n        /* istanbul ignore if */\n        if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'option is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n    vm._watcher = new Watcher(vm, function () {\n      vm._update(vm._render(), hydrating);\n    }, noop);\n    hydrating = false;\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  };\n\n  Vue.prototype._update = function (vnode, hydrating) {\n    var vm = this;\n    if (vm._isMounted) {\n      callHook(vm, 'beforeUpdate');\n    }\n    var prevEl = vm.$el;\n    var prevVnode = vm._vnode;\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    vm._vnode = vnode;\n    // Vue.prototype.__patch__ is injected in entry points\n    // based on the rendering backend used.\n    if (!prevVnode) {\n      // initial render\n      vm.$el = vm.__patch__(\n        vm.$el, vnode, hydrating, false /* removeOnly */,\n        vm.$options._parentElm,\n        vm.$options._refElm\n      );\n    } else {\n      // updates\n      vm.$el = vm.__patch__(prevVnode, vnode);\n    }\n    activeInstance = prevActiveInstance;\n    // update __vue__ reference\n    if (prevEl) {\n      prevEl.__vue__ = null;\n    }\n    if (vm.$el) {\n      vm.$el.__vue__ = vm;\n    }\n    // if parent is an HOC, update its $el as well\n    if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n      vm.$parent.$el = vm.$el;\n    }\n    if (vm._isMounted) {\n      callHook(vm, 'updated');\n    }\n  };\n\n  Vue.prototype._updateFromParent = function (\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    var vm = this;\n    var hasChildren = !!(vm.$options._renderChildren || renderChildren);\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n    // update props\n    if (propsData && vm.$options.props) {\n      observerState.shouldConvert = false;\n      {\n        observerState.isSettingProps = true;\n      }\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        vm[key] = validateProp(key, vm.$options.props, propsData, vm);\n      }\n      observerState.shouldConvert = true;\n      {\n        observerState.isSettingProps = false;\n      }\n      vm.$options.propsData = propsData;\n    }\n    // update listeners\n    if (listeners) {\n      var oldListeners = vm.$options._parentListeners;\n      vm.$options._parentListeners = listeners;\n      vm._updateListeners(listeners, oldListeners);\n    }\n    // resolve slots + force update if has children\n    if (hasChildren) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n  };\n\n  Vue.prototype.$forceUpdate = function () {\n    var vm = this;\n    if (vm._watcher) {\n      vm._watcher.update();\n    }\n  };\n\n  Vue.prototype.$destroy = function () {\n    var vm = this;\n    if (vm._isBeingDestroyed) {\n      return\n    }\n    callHook(vm, 'beforeDestroy');\n    vm._isBeingDestroyed = true;\n    // remove self from parent\n    var parent = vm.$parent;\n    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n      remove$1(parent.$children, vm);\n    }\n    // teardown watchers\n    if (vm._watcher) {\n      vm._watcher.teardown();\n    }\n    var i = vm._watchers.length;\n    while (i--) {\n      vm._watchers[i].teardown();\n    }\n    // remove reference from data ob\n    // frozen object may not have observer.\n    if (vm._data.__ob__) {\n      vm._data.__ob__.vmCount--;\n    }\n    // call the last hook...\n    vm._isDestroyed = true;\n    callHook(vm, 'destroyed');\n    // turn off all instance listeners.\n    vm.$off();\n    // remove __vue__ reference\n    if (vm.$el) {\n      vm.$el.__vue__ = null;\n    }\n    // invoke destroy hooks on current rendered tree\n    vm.__patch__(vm._vnode, null);\n  };\n}\n\nfunction callHook (vm, hook) {\n  var handlers = vm.$options[hook];\n  if (handlers) {\n    for (var i = 0, j = handlers.length; i < j; i++) {\n      handlers[i].call(vm);\n    }\n  }\n  vm.$emit('hook:' + hook);\n}\n\n/*  */\n\nvar hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };\nvar hooksToMerge = Object.keys(hooks);\n\nfunction createComponent (\n  Ctor,\n  data,\n  context,\n  children,\n  tag\n) {\n  if (!Ctor) {\n    return\n  }\n\n  var baseCtor = context.$options._base;\n  if (isObject(Ctor)) {\n    Ctor = baseCtor.extend(Ctor);\n  }\n\n  if (typeof Ctor !== 'function') {\n    {\n      warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n    }\n    return\n  }\n\n  // async component\n  if (!Ctor.cid) {\n    if (Ctor.resolved) {\n      Ctor = Ctor.resolved;\n    } else {\n      Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {\n        // it's ok to queue this on every render because\n        // $forceUpdate is buffered by the scheduler.\n        context.$forceUpdate();\n      });\n      if (!Ctor) {\n        // return nothing if this is indeed an async component\n        // wait for the callback to trigger parent update.\n        return\n      }\n    }\n  }\n\n  // resolve constructor options in case global mixins are applied after\n  // component constructor creation\n  resolveConstructorOptions(Ctor);\n\n  data = data || {};\n\n  // extract props\n  var propsData = extractProps(data, Ctor);\n\n  // functional component\n  if (Ctor.options.functional) {\n    return createFunctionalComponent(Ctor, propsData, data, context, children)\n  }\n\n  // extract listeners, since these needs to be treated as\n  // child component listeners instead of DOM listeners\n  var listeners = data.on;\n  // replace with listeners with .native modifier\n  data.on = data.nativeOn;\n\n  if (Ctor.options.abstract) {\n    // abstract components do not keep anything\n    // other than props & listeners\n    data = {};\n  }\n\n  // merge component management hooks onto the placeholder node\n  mergeHooks(data);\n\n  // return a placeholder vnode\n  var name = Ctor.options.name || tag;\n  var vnode = new VNode(\n    (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n    data, undefined, undefined, undefined, undefined, context,\n    { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }\n  );\n  return vnode\n}\n\nfunction createFunctionalComponent (\n  Ctor,\n  propsData,\n  data,\n  context,\n  children\n) {\n  var props = {};\n  var propOptions = Ctor.options.props;\n  if (propOptions) {\n    for (var key in propOptions) {\n      props[key] = validateProp(key, propOptions, propsData);\n    }\n  }\n  var vnode = Ctor.options.render.call(\n    null,\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    bind$1(createElement, { _self: Object.create(context) }),\n    {\n      props: props,\n      data: data,\n      parent: context,\n      children: normalizeChildren(children),\n      slots: function () { return resolveSlots(children, context); }\n    }\n  );\n  if (vnode instanceof VNode) {\n    vnode.functionalContext = context;\n    if (data.slot) {\n      (vnode.data || (vnode.data = {})).slot = data.slot;\n    }\n  }\n  return vnode\n}\n\nfunction createComponentInstanceForVnode (\n  vnode, // we know it's MountedComponentVNode but flow doesn't\n  parent, // activeInstance in lifecycle state\n  parentElm,\n  refElm\n) {\n  var vnodeComponentOptions = vnode.componentOptions;\n  var options = {\n    _isComponent: true,\n    parent: parent,\n    propsData: vnodeComponentOptions.propsData,\n    _componentTag: vnodeComponentOptions.tag,\n    _parentVnode: vnode,\n    _parentListeners: vnodeComponentOptions.listeners,\n    _renderChildren: vnodeComponentOptions.children,\n    _parentElm: parentElm || null,\n    _refElm: refElm || null\n  };\n  // check inline-template render functions\n  var inlineTemplate = vnode.data.inlineTemplate;\n  if (inlineTemplate) {\n    options.render = inlineTemplate.render;\n    options.staticRenderFns = inlineTemplate.staticRenderFns;\n  }\n  return new vnodeComponentOptions.Ctor(options)\n}\n\nfunction init (\n  vnode,\n  hydrating,\n  parentElm,\n  refElm\n) {\n  if (!vnode.child || vnode.child._isDestroyed) {\n    var child = vnode.child = createComponentInstanceForVnode(\n      vnode,\n      activeInstance,\n      parentElm,\n      refElm\n    );\n    child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n  } else if (vnode.data.keepAlive) {\n    // kept-alive components, treat as a patch\n    var mountedNode = vnode; // work around flow\n    prepatch(mountedNode, mountedNode);\n  }\n}\n\nfunction prepatch (\n  oldVnode,\n  vnode\n) {\n  var options = vnode.componentOptions;\n  var child = vnode.child = oldVnode.child;\n  child._updateFromParent(\n    options.propsData, // updated props\n    options.listeners, // updated listeners\n    vnode, // new parent vnode\n    options.children // new children\n  );\n}\n\nfunction insert (vnode) {\n  if (!vnode.child._isMounted) {\n    vnode.child._isMounted = true;\n    callHook(vnode.child, 'mounted');\n  }\n  if (vnode.data.keepAlive) {\n    vnode.child._inactive = false;\n    callHook(vnode.child, 'activated');\n  }\n}\n\nfunction destroy$1 (vnode) {\n  if (!vnode.child._isDestroyed) {\n    if (!vnode.data.keepAlive) {\n      vnode.child.$destroy();\n    } else {\n      vnode.child._inactive = true;\n      callHook(vnode.child, 'deactivated');\n    }\n  }\n}\n\nfunction resolveAsyncComponent (\n  factory,\n  baseCtor,\n  cb\n) {\n  if (factory.requested) {\n    // pool callbacks\n    factory.pendingCallbacks.push(cb);\n  } else {\n    factory.requested = true;\n    var cbs = factory.pendingCallbacks = [cb];\n    var sync = true;\n\n    var resolve = function (res) {\n      if (isObject(res)) {\n        res = baseCtor.extend(res);\n      }\n      // cache resolved\n      factory.resolved = res;\n      // invoke callbacks only if this is not a synchronous resolve\n      // (async resolves are shimmed as synchronous during SSR)\n      if (!sync) {\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          cbs[i](res);\n        }\n      }\n    };\n\n    var reject = function (reason) {\n      \"development\" !== 'production' && warn(\n        \"Failed to resolve async component: \" + (String(factory)) +\n        (reason ? (\"\\nReason: \" + reason) : '')\n      );\n    };\n\n    var res = factory(resolve, reject);\n\n    // handle promise\n    if (res && typeof res.then === 'function' && !factory.resolved) {\n      res.then(resolve, reject);\n    }\n\n    sync = false;\n    // return in case resolved synchronously\n    return factory.resolved\n  }\n}\n\nfunction extractProps (data, Ctor) {\n  // we are only extracting raw values here.\n  // validation and default values are handled in the child\n  // component itself.\n  var propOptions = Ctor.options.props;\n  if (!propOptions) {\n    return\n  }\n  var res = {};\n  var attrs = data.attrs;\n  var props = data.props;\n  var domProps = data.domProps;\n  if (attrs || props || domProps) {\n    for (var key in propOptions) {\n      var altKey = hyphenate(key);\n      checkProp(res, props, key, altKey, true) ||\n      checkProp(res, attrs, key, altKey) ||\n      checkProp(res, domProps, key, altKey);\n    }\n  }\n  return res\n}\n\nfunction checkProp (\n  res,\n  hash,\n  key,\n  altKey,\n  preserve\n) {\n  if (hash) {\n    if (hasOwn(hash, key)) {\n      res[key] = hash[key];\n      if (!preserve) {\n        delete hash[key];\n      }\n      return true\n    } else if (hasOwn(hash, altKey)) {\n      res[key] = hash[altKey];\n      if (!preserve) {\n        delete hash[altKey];\n      }\n      return true\n    }\n  }\n  return false\n}\n\nfunction mergeHooks (data) {\n  if (!data.hook) {\n    data.hook = {};\n  }\n  for (var i = 0; i < hooksToMerge.length; i++) {\n    var key = hooksToMerge[i];\n    var fromParent = data.hook[key];\n    var ours = hooks[key];\n    data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;\n  }\n}\n\nfunction mergeHook$1 (one, two) {\n  return function (a, b, c, d) {\n    one(a, b, c, d);\n    two(a, b, c, d);\n  }\n}\n\n/*  */\n\n// wrapper function for providing a more flexible interface\n// without getting yelled at by flow\nfunction createElement (\n  tag,\n  data,\n  children\n) {\n  if (data && (Array.isArray(data) || typeof data !== 'object')) {\n    children = data;\n    data = undefined;\n  }\n  // make sure to use real instance instead of proxy as context\n  return _createElement(this._self, tag, data, children)\n}\n\nfunction _createElement (\n  context,\n  tag,\n  data,\n  children\n) {\n  if (data && data.__ob__) {\n    \"development\" !== 'production' && warn(\n      \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n      'Always create fresh vnode data objects in each render!',\n      context\n    );\n    return\n  }\n  if (!tag) {\n    // in case of component :is set to falsy value\n    return emptyVNode()\n  }\n  // support single function children as default scoped slot\n  if (Array.isArray(children) &&\n      typeof children[0] === 'function') {\n    data = data || {};\n    data.scopedSlots = { default: children[0] };\n    children.length = 0;\n  }\n  if (typeof tag === 'string') {\n    var Ctor;\n    var ns = config.getTagNamespace(tag);\n    if (config.isReservedTag(tag)) {\n      // platform built-in elements\n      return new VNode(\n        tag, data, normalizeChildren(children, ns),\n        undefined, undefined, ns, context\n      )\n    } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {\n      // component\n      return createComponent(Ctor, data, context, children, tag)\n    } else {\n      // unknown or unlisted namespaced elements\n      // check at runtime because it may get assigned a namespace when its\n      // parent normalizes children\n      var childNs = tag === 'foreignObject' ? 'xhtml' : ns;\n      return new VNode(\n        tag, data, normalizeChildren(children, childNs),\n        undefined, undefined, ns, context\n      )\n    }\n  } else {\n    // direct component options / constructor\n    return createComponent(tag, data, context, children)\n  }\n}\n\n/*  */\n\nfunction initRender (vm) {\n  vm.$vnode = null; // the placeholder node in parent tree\n  vm._vnode = null; // the root of the child tree\n  vm._staticTrees = null;\n  var parentVnode = vm.$options._parentVnode;\n  var renderContext = parentVnode && parentVnode.context;\n  vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);\n  vm.$scopedSlots = {};\n  // bind the public createElement fn to this instance\n  // so that we get proper render context inside it.\n  vm.$createElement = bind$1(createElement, vm);\n  if (vm.$options.el) {\n    vm.$mount(vm.$options.el);\n  }\n}\n\nfunction renderMixin (Vue) {\n  Vue.prototype.$nextTick = function (fn) {\n    return nextTick(fn, this)\n  };\n\n  Vue.prototype._render = function () {\n    var vm = this;\n    var ref = vm.$options;\n    var render = ref.render;\n    var staticRenderFns = ref.staticRenderFns;\n    var _parentVnode = ref._parentVnode;\n\n    if (vm._isMounted) {\n      // clone slot nodes on re-renders\n      for (var key in vm.$slots) {\n        vm.$slots[key] = cloneVNodes(vm.$slots[key]);\n      }\n    }\n\n    if (_parentVnode && _parentVnode.data.scopedSlots) {\n      vm.$scopedSlots = _parentVnode.data.scopedSlots;\n    }\n\n    if (staticRenderFns && !vm._staticTrees) {\n      vm._staticTrees = [];\n    }\n    // set parent vnode. this allows render functions to have access\n    // to the data on the placeholder node.\n    vm.$vnode = _parentVnode;\n    // render self\n    var vnode;\n    try {\n      vnode = render.call(vm._renderProxy, vm.$createElement);\n    } catch (e) {\n      /* istanbul ignore else */\n      if (config.errorHandler) {\n        config.errorHandler.call(null, e, vm);\n      } else {\n        {\n          warn((\"Error when rendering \" + (formatComponentName(vm)) + \":\"));\n        }\n        throw e\n      }\n      // return previous vnode to prevent render error causing blank component\n      vnode = vm._vnode;\n    }\n    // return empty vnode in case the render function errored out\n    if (!(vnode instanceof VNode)) {\n      if (\"development\" !== 'production' && Array.isArray(vnode)) {\n        warn(\n          'Multiple root nodes returned from render function. Render function ' +\n          'should return a single root node.',\n          vm\n        );\n      }\n      vnode = emptyVNode();\n    }\n    // set parent\n    vnode.parent = _parentVnode;\n    return vnode\n  };\n\n  // shorthands used in render functions\n  Vue.prototype._h = createElement;\n  // toString for mustaches\n  Vue.prototype._s = _toString;\n  // number conversion\n  Vue.prototype._n = toNumber;\n  // empty vnode\n  Vue.prototype._e = emptyVNode;\n  // loose equal\n  Vue.prototype._q = looseEqual;\n  // loose indexOf\n  Vue.prototype._i = looseIndexOf;\n\n  // render static tree by index\n  Vue.prototype._m = function renderStatic (\n    index,\n    isInFor\n  ) {\n    var tree = this._staticTrees[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree by doing a shallow clone.\n    if (tree && !isInFor) {\n      return Array.isArray(tree)\n        ? cloneVNodes(tree)\n        : cloneVNode(tree)\n    }\n    // otherwise, render a fresh tree.\n    tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  };\n\n  // mark node as static (v-once)\n  Vue.prototype._o = function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  };\n\n  function markStatic (tree, key, isOnce) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  // filter resolution helper\n  var identity = function (_) { return _; };\n  Vue.prototype._f = function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  };\n\n  // render v-for\n  Vue.prototype._l = function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val)) {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      keys = Object.keys(val);\n      ret = new Array(keys.length);\n      for (i = 0, l = keys.length; i < l; i++) {\n        key = keys[i];\n        ret[i] = render(val[key], key, i);\n      }\n    }\n    return ret\n  };\n\n  // renderSlot\n  Vue.prototype._t = function (\n    name,\n    fallback,\n    props\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    if (scopedSlotFn) { // scoped slot\n      return scopedSlotFn(props || {}) || fallback\n    } else {\n      var slotNodes = this.$slots[name];\n      // warn duplicate slot usage\n      if (slotNodes && \"development\" !== 'production') {\n        slotNodes._rendered && warn(\n          \"Duplicate presence of slot \\\"\" + name + \"\\\" found in the same render tree \" +\n          \"- this will likely cause render errors.\",\n          this\n        );\n        slotNodes._rendered = true;\n      }\n      return slotNodes || fallback\n    }\n  };\n\n  // apply v-bind object\n  Vue.prototype._b = function bindProps (\n    data,\n    tag,\n    value,\n    asProp\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        \"development\" !== 'production' && warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        for (var key in value) {\n          if (key === 'class' || key === 'style') {\n            data[key] = value[key];\n          } else {\n            var hash = asProp || config.mustUseProp(tag, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n            hash[key] = value[key];\n          }\n        }\n      }\n    }\n    return data\n  };\n\n  // check v-on keyCodes\n  Vue.prototype._k = function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInAlias\n  ) {\n    var keyCodes = config.keyCodes[key] || builtInAlias;\n    if (Array.isArray(keyCodes)) {\n      return keyCodes.indexOf(eventKeyCode) === -1\n    } else {\n      return keyCodes !== eventKeyCode\n    }\n  };\n}\n\nfunction resolveSlots (\n  renderChildren,\n  context\n) {\n  var slots = {};\n  if (!renderChildren) {\n    return slots\n  }\n  var children = normalizeChildren(renderChildren) || [];\n  var defaultSlot = [];\n  var name, child;\n  for (var i = 0, l = children.length; i < l; i++) {\n    child = children[i];\n    // named slots should only be respected if the vnode was rendered in the\n    // same context.\n    if ((child.context === context || child.functionalContext === context) &&\n        child.data && (name = child.data.slot)) {\n      var slot = (slots[name] || (slots[name] = []));\n      if (child.tag === 'template') {\n        slot.push.apply(slot, child.children);\n      } else {\n        slot.push(child);\n      }\n    } else {\n      defaultSlot.push(child);\n    }\n  }\n  // ignore single whitespace\n  if (defaultSlot.length && !(\n    defaultSlot.length === 1 &&\n    (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)\n  )) {\n    slots.default = defaultSlot;\n  }\n  return slots\n}\n\n/*  */\n\nfunction initEvents (vm) {\n  vm._events = Object.create(null);\n  // init parent attached events\n  var listeners = vm.$options._parentListeners;\n  var add = function (event, fn, once) {\n    once ? vm.$once(event, fn) : vm.$on(event, fn);\n  };\n  var remove$$1 = bind$1(vm.$off, vm);\n  vm._updateListeners = function (listeners, oldListeners) {\n    updateListeners(listeners, oldListeners || {}, add, remove$$1, vm);\n  };\n  if (listeners) {\n    vm._updateListeners(listeners);\n  }\n}\n\nfunction eventsMixin (Vue) {\n  Vue.prototype.$on = function (event, fn) {\n    var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);\n    return vm\n  };\n\n  Vue.prototype.$once = function (event, fn) {\n    var vm = this;\n    function on () {\n      vm.$off(event, on);\n      fn.apply(vm, arguments);\n    }\n    on.fn = fn;\n    vm.$on(event, on);\n    return vm\n  };\n\n  Vue.prototype.$off = function (event, fn) {\n    var vm = this;\n    // all\n    if (!arguments.length) {\n      vm._events = Object.create(null);\n      return vm\n    }\n    // specific event\n    var cbs = vm._events[event];\n    if (!cbs) {\n      return vm\n    }\n    if (arguments.length === 1) {\n      vm._events[event] = null;\n      return vm\n    }\n    // specific handler\n    var cb;\n    var i = cbs.length;\n    while (i--) {\n      cb = cbs[i];\n      if (cb === fn || cb.fn === fn) {\n        cbs.splice(i, 1);\n        break\n      }\n    }\n    return vm\n  };\n\n  Vue.prototype.$emit = function (event) {\n    var vm = this;\n    var cbs = vm._events[event];\n    if (cbs) {\n      cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n      var args = toArray(arguments, 1);\n      for (var i = 0, l = cbs.length; i < l; i++) {\n        cbs[i].apply(vm, args);\n      }\n    }\n    return vm\n  };\n}\n\n/*  */\n\nvar uid = 0;\n\nfunction initMixin (Vue) {\n  Vue.prototype._init = function (options) {\n    var vm = this;\n    // a uid\n    vm._uid = uid++;\n    // a flag to avoid this being observed\n    vm._isVue = true;\n    // merge options\n    if (options && options._isComponent) {\n      // optimize internal component instantiation\n      // since dynamic options merging is pretty slow, and none of the\n      // internal component options needs special treatment.\n      initInternalComponent(vm, options);\n    } else {\n      vm.$options = mergeOptions(\n        resolveConstructorOptions(vm.constructor),\n        options || {},\n        vm\n      );\n    }\n    /* istanbul ignore else */\n    {\n      initProxy(vm);\n    }\n    // expose real self\n    vm._self = vm;\n    initLifecycle(vm);\n    initEvents(vm);\n    callHook(vm, 'beforeCreate');\n    initState(vm);\n    callHook(vm, 'created');\n    initRender(vm);\n  };\n}\n\nfunction initInternalComponent (vm, options) {\n  var opts = vm.$options = Object.create(vm.constructor.options);\n  // doing this because it's faster than dynamic enumeration.\n  opts.parent = options.parent;\n  opts.propsData = options.propsData;\n  opts._parentVnode = options._parentVnode;\n  opts._parentListeners = options._parentListeners;\n  opts._renderChildren = options._renderChildren;\n  opts._componentTag = options._componentTag;\n  opts._parentElm = options._parentElm;\n  opts._refElm = options._refElm;\n  if (options.render) {\n    opts.render = options.render;\n    opts.staticRenderFns = options.staticRenderFns;\n  }\n}\n\nfunction resolveConstructorOptions (Ctor) {\n  var options = Ctor.options;\n  if (Ctor.super) {\n    var superOptions = Ctor.super.options;\n    var cachedSuperOptions = Ctor.superOptions;\n    var extendOptions = Ctor.extendOptions;\n    if (superOptions !== cachedSuperOptions) {\n      // super option changed\n      Ctor.superOptions = superOptions;\n      extendOptions.render = options.render;\n      extendOptions.staticRenderFns = options.staticRenderFns;\n      extendOptions._scopeId = options._scopeId;\n      options = Ctor.options = mergeOptions(superOptions, extendOptions);\n      if (options.name) {\n        options.components[options.name] = Ctor;\n      }\n    }\n  }\n  return options\n}\n\nfunction Vue$3 (options) {\n  if (\"development\" !== 'production' &&\n    !(this instanceof Vue$3)) {\n    warn('Vue is a constructor and should be called with the `new` keyword');\n  }\n  this._init(options);\n}\n\ninitMixin(Vue$3);\nstateMixin(Vue$3);\neventsMixin(Vue$3);\nlifecycleMixin(Vue$3);\nrenderMixin(Vue$3);\n\n/*  */\n\nfunction initUse (Vue) {\n  Vue.use = function (plugin) {\n    /* istanbul ignore if */\n    if (plugin.installed) {\n      return\n    }\n    // additional parameters\n    var args = toArray(arguments, 1);\n    args.unshift(this);\n    if (typeof plugin.install === 'function') {\n      plugin.install.apply(plugin, args);\n    } else {\n      plugin.apply(null, args);\n    }\n    plugin.installed = true;\n    return this\n  };\n}\n\n/*  */\n\nfunction initMixin$1 (Vue) {\n  Vue.mixin = function (mixin) {\n    this.options = mergeOptions(this.options, mixin);\n  };\n}\n\n/*  */\n\nfunction initExtend (Vue) {\n  /**\n   * Each instance constructor, including Vue, has a unique\n   * cid. This enables us to create wrapped \"child\n   * constructors\" for prototypal inheritance and cache them.\n   */\n  Vue.cid = 0;\n  var cid = 1;\n\n  /**\n   * Class inheritance\n   */\n  Vue.extend = function (extendOptions) {\n    extendOptions = extendOptions || {};\n    var Super = this;\n    var SuperId = Super.cid;\n    var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n    if (cachedCtors[SuperId]) {\n      return cachedCtors[SuperId]\n    }\n    var name = extendOptions.name || Super.options.name;\n    {\n      if (!/^[a-zA-Z][\\w-]*$/.test(name)) {\n        warn(\n          'Invalid component name: \"' + name + '\". Component names ' +\n          'can only contain alphanumeric characaters and the hyphen.'\n        );\n      }\n    }\n    var Sub = function VueComponent (options) {\n      this._init(options);\n    };\n    Sub.prototype = Object.create(Super.prototype);\n    Sub.prototype.constructor = Sub;\n    Sub.cid = cid++;\n    Sub.options = mergeOptions(\n      Super.options,\n      extendOptions\n    );\n    Sub['super'] = Super;\n    // allow further extension/mixin/plugin usage\n    Sub.extend = Super.extend;\n    Sub.mixin = Super.mixin;\n    Sub.use = Super.use;\n    // create asset registers, so extended classes\n    // can have their private assets too.\n    config._assetTypes.forEach(function (type) {\n      Sub[type] = Super[type];\n    });\n    // enable recursive self-lookup\n    if (name) {\n      Sub.options.components[name] = Sub;\n    }\n    // keep a reference to the super options at extension time.\n    // later at instantiation we can check if Super's options have\n    // been updated.\n    Sub.superOptions = Super.options;\n    Sub.extendOptions = extendOptions;\n    // cache constructor\n    cachedCtors[SuperId] = Sub;\n    return Sub\n  };\n}\n\n/*  */\n\nfunction initAssetRegisters (Vue) {\n  /**\n   * Create asset registration methods.\n   */\n  config._assetTypes.forEach(function (type) {\n    Vue[type] = function (\n      id,\n      definition\n    ) {\n      if (!definition) {\n        return this.options[type + 's'][id]\n      } else {\n        /* istanbul ignore if */\n        {\n          if (type === 'component' && config.isReservedTag(id)) {\n            warn(\n              'Do not use built-in or reserved HTML elements as component ' +\n              'id: ' + id\n            );\n          }\n        }\n        if (type === 'component' && isPlainObject(definition)) {\n          definition.name = definition.name || id;\n          definition = this.options._base.extend(definition);\n        }\n        if (type === 'directive' && typeof definition === 'function') {\n          definition = { bind: definition, update: definition };\n        }\n        this.options[type + 's'][id] = definition;\n        return definition\n      }\n    };\n  });\n}\n\n/*  */\n\nvar patternTypes = [String, RegExp];\n\nfunction matches (pattern, name) {\n  if (typeof pattern === 'string') {\n    return pattern.split(',').indexOf(name) > -1\n  } else {\n    return pattern.test(name)\n  }\n}\n\nvar KeepAlive = {\n  name: 'keep-alive',\n  abstract: true,\n  props: {\n    include: patternTypes,\n    exclude: patternTypes\n  },\n  created: function created () {\n    this.cache = Object.create(null);\n  },\n  render: function render () {\n    var vnode = getFirstComponentChild(this.$slots.default);\n    if (vnode && vnode.componentOptions) {\n      var opts = vnode.componentOptions;\n      // check pattern\n      var name = opts.Ctor.options.name || opts.tag;\n      if (name && (\n        (this.include && !matches(this.include, name)) ||\n        (this.exclude && matches(this.exclude, name))\n      )) {\n        return vnode\n      }\n      var key = vnode.key == null\n        // same constructor may get registered as different local components\n        // so cid alone is not enough (#3269)\n        ? opts.Ctor.cid + (opts.tag ? (\"::\" + (opts.tag)) : '')\n        : vnode.key;\n      if (this.cache[key]) {\n        vnode.child = this.cache[key].child;\n      } else {\n        this.cache[key] = vnode;\n      }\n      vnode.data.keepAlive = true;\n    }\n    return vnode\n  },\n  destroyed: function destroyed () {\n    var this$1 = this;\n\n    for (var key in this.cache) {\n      var vnode = this$1.cache[key];\n      callHook(vnode.child, 'deactivated');\n      vnode.child.$destroy();\n    }\n  }\n};\n\nvar builtInComponents = {\n  KeepAlive: KeepAlive\n};\n\n/*  */\n\nfunction initGlobalAPI (Vue) {\n  // config\n  var configDef = {};\n  configDef.get = function () { return config; };\n  {\n    configDef.set = function () {\n      warn(\n        'Do not replace the Vue.config object, set individual fields instead.'\n      );\n    };\n  }\n  Object.defineProperty(Vue, 'config', configDef);\n  Vue.util = util;\n  Vue.set = set$1;\n  Vue.delete = del;\n  Vue.nextTick = nextTick;\n\n  Vue.options = Object.create(null);\n  config._assetTypes.forEach(function (type) {\n    Vue.options[type + 's'] = Object.create(null);\n  });\n\n  // this is used to identify the \"base\" constructor to extend all plain-object\n  // components with in Weex's multi-instance scenarios.\n  Vue.options._base = Vue;\n\n  extend(Vue.options.components, builtInComponents);\n\n  initUse(Vue);\n  initMixin$1(Vue);\n  initExtend(Vue);\n  initAssetRegisters(Vue);\n}\n\ninitGlobalAPI(Vue$3);\n\nObject.defineProperty(Vue$3.prototype, '$isServer', {\n  get: isServerRendering\n});\n\nVue$3.version = '2.1.4';\n\n/*  */\n\n// attributes that should be using props for binding\nvar mustUseProp = function (tag, attr) {\n  return (\n    (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||\n    (attr === 'selected' && tag === 'option') ||\n    (attr === 'checked' && tag === 'input') ||\n    (attr === 'muted' && tag === 'video')\n  )\n};\n\nvar isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\nvar isBooleanAttr = makeMap(\n  'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n  'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n  'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n  'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n  'required,reversed,scoped,seamless,selected,sortable,translate,' +\n  'truespeed,typemustmatch,visible'\n);\n\nvar xlinkNS = 'http://www.w3.org/1999/xlink';\n\nvar isXlink = function (name) {\n  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n};\n\nvar getXlinkProp = function (name) {\n  return isXlink(name) ? name.slice(6, name.length) : ''\n};\n\nvar isFalsyAttrValue = function (val) {\n  return val == null || val === false\n};\n\n/*  */\n\nfunction genClassForVnode (vnode) {\n  var data = vnode.data;\n  var parentNode = vnode;\n  var childNode = vnode;\n  while (childNode.child) {\n    childNode = childNode.child._vnode;\n    if (childNode.data) {\n      data = mergeClassData(childNode.data, data);\n    }\n  }\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data) {\n      data = mergeClassData(data, parentNode.data);\n    }\n  }\n  return genClassFromData(data)\n}\n\nfunction mergeClassData (child, parent) {\n  return {\n    staticClass: concat(child.staticClass, parent.staticClass),\n    class: child.class\n      ? [child.class, parent.class]\n      : parent.class\n  }\n}\n\nfunction genClassFromData (data) {\n  var dynamicClass = data.class;\n  var staticClass = data.staticClass;\n  if (staticClass || dynamicClass) {\n    return concat(staticClass, stringifyClass(dynamicClass))\n  }\n  /* istanbul ignore next */\n  return ''\n}\n\nfunction concat (a, b) {\n  return a ? b ? (a + ' ' + b) : a : (b || '')\n}\n\nfunction stringifyClass (value) {\n  var res = '';\n  if (!value) {\n    return res\n  }\n  if (typeof value === 'string') {\n    return value\n  }\n  if (Array.isArray(value)) {\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (value[i]) {\n        if ((stringified = stringifyClass(value[i]))) {\n          res += stringified + ' ';\n        }\n      }\n    }\n    return res.slice(0, -1)\n  }\n  if (isObject(value)) {\n    for (var key in value) {\n      if (value[key]) { res += key + ' '; }\n    }\n    return res.slice(0, -1)\n  }\n  /* istanbul ignore next */\n  return res\n}\n\n/*  */\n\nvar namespaceMap = {\n  svg: 'http://www.w3.org/2000/svg',\n  math: 'http://www.w3.org/1998/Math/MathML',\n  xhtml: 'http://www.w3.org/1999/xhtml'\n};\n\nvar isHTMLTag = makeMap(\n  'html,body,base,head,link,meta,style,title,' +\n  'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n  'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +\n  'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n  's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n  'embed,object,param,source,canvas,script,noscript,del,ins,' +\n  'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n  'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n  'output,progress,select,textarea,' +\n  'details,dialog,menu,menuitem,summary,' +\n  'content,element,shadow,template'\n);\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nvar isSVG = makeMap(\n  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +\n  'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n  'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n  true\n);\n\nvar isPreTag = function (tag) { return tag === 'pre'; };\n\nvar isReservedTag = function (tag) {\n  return isHTMLTag(tag) || isSVG(tag)\n};\n\nfunction getTagNamespace (tag) {\n  if (isSVG(tag)) {\n    return 'svg'\n  }\n  // basic support for MathML\n  // note it doesn't support other MathML elements being component roots\n  if (tag === 'math') {\n    return 'math'\n  }\n}\n\nvar unknownElementCache = Object.create(null);\nfunction isUnknownElement (tag) {\n  /* istanbul ignore if */\n  if (!inBrowser) {\n    return true\n  }\n  if (isReservedTag(tag)) {\n    return false\n  }\n  tag = tag.toLowerCase();\n  /* istanbul ignore if */\n  if (unknownElementCache[tag] != null) {\n    return unknownElementCache[tag]\n  }\n  var el = document.createElement(tag);\n  if (tag.indexOf('-') > -1) {\n    // http://stackoverflow.com/a/28210364/1070244\n    return (unknownElementCache[tag] = (\n      el.constructor === window.HTMLUnknownElement ||\n      el.constructor === window.HTMLElement\n    ))\n  } else {\n    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n  }\n}\n\n/*  */\n\n/**\n * Query an element selector if it's not an element already.\n */\nfunction query (el) {\n  if (typeof el === 'string') {\n    var selector = el;\n    el = document.querySelector(el);\n    if (!el) {\n      \"development\" !== 'production' && warn(\n        'Cannot find element: ' + selector\n      );\n      return document.createElement('div')\n    }\n  }\n  return el\n}\n\n/*  */\n\nfunction createElement$1 (tagName, vnode) {\n  var elm = document.createElement(tagName);\n  if (tagName !== 'select') {\n    return elm\n  }\n  if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {\n    elm.setAttribute('multiple', 'multiple');\n  }\n  return elm\n}\n\nfunction createElementNS (namespace, tagName) {\n  return document.createElementNS(namespaceMap[namespace], tagName)\n}\n\nfunction createTextNode (text) {\n  return document.createTextNode(text)\n}\n\nfunction createComment (text) {\n  return document.createComment(text)\n}\n\nfunction insertBefore (parentNode, newNode, referenceNode) {\n  parentNode.insertBefore(newNode, referenceNode);\n}\n\nfunction removeChild (node, child) {\n  node.removeChild(child);\n}\n\nfunction appendChild (node, child) {\n  node.appendChild(child);\n}\n\nfunction parentNode (node) {\n  return node.parentNode\n}\n\nfunction nextSibling (node) {\n  return node.nextSibling\n}\n\nfunction tagName (node) {\n  return node.tagName\n}\n\nfunction setTextContent (node, text) {\n  node.textContent = text;\n}\n\nfunction childNodes (node) {\n  return node.childNodes\n}\n\nfunction setAttribute (node, key, val) {\n  node.setAttribute(key, val);\n}\n\n\nvar nodeOps = Object.freeze({\n  createElement: createElement$1,\n  createElementNS: createElementNS,\n  createTextNode: createTextNode,\n  createComment: createComment,\n  insertBefore: insertBefore,\n  removeChild: removeChild,\n  appendChild: appendChild,\n  parentNode: parentNode,\n  nextSibling: nextSibling,\n  tagName: tagName,\n  setTextContent: setTextContent,\n  childNodes: childNodes,\n  setAttribute: setAttribute\n});\n\n/*  */\n\nvar ref = {\n  create: function create (_, vnode) {\n    registerRef(vnode);\n  },\n  update: function update (oldVnode, vnode) {\n    if (oldVnode.data.ref !== vnode.data.ref) {\n      registerRef(oldVnode, true);\n      registerRef(vnode);\n    }\n  },\n  destroy: function destroy (vnode) {\n    registerRef(vnode, true);\n  }\n};\n\nfunction registerRef (vnode, isRemoval) {\n  var key = vnode.data.ref;\n  if (!key) { return }\n\n  var vm = vnode.context;\n  var ref = vnode.child || vnode.elm;\n  var refs = vm.$refs;\n  if (isRemoval) {\n    if (Array.isArray(refs[key])) {\n      remove$1(refs[key], ref);\n    } else if (refs[key] === ref) {\n      refs[key] = undefined;\n    }\n  } else {\n    if (vnode.data.refInFor) {\n      if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {\n        refs[key].push(ref);\n      } else {\n        refs[key] = [ref];\n      }\n    } else {\n      refs[key] = ref;\n    }\n  }\n}\n\n/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n *\n * modified by Evan You (@yyx990803)\n *\n\n/*\n * Not type-checking this because this file is perf-critical and the cost\n * of making flow understand it is not worth it.\n */\n\nvar emptyNode = new VNode('', {}, []);\n\nvar hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];\n\nfunction isUndef (s) {\n  return s == null\n}\n\nfunction isDef (s) {\n  return s != null\n}\n\nfunction sameVnode (vnode1, vnode2) {\n  return (\n    vnode1.key === vnode2.key &&\n    vnode1.tag === vnode2.tag &&\n    vnode1.isComment === vnode2.isComment &&\n    !vnode1.data === !vnode2.data\n  )\n}\n\nfunction createKeyToOldIdx (children, beginIdx, endIdx) {\n  var i, key;\n  var map = {};\n  for (i = beginIdx; i <= endIdx; ++i) {\n    key = children[i].key;\n    if (isDef(key)) { map[key] = i; }\n  }\n  return map\n}\n\nfunction createPatchFunction (backend) {\n  var i, j;\n  var cbs = {};\n\n  var modules = backend.modules;\n  var nodeOps = backend.nodeOps;\n\n  for (i = 0; i < hooks$1.length; ++i) {\n    cbs[hooks$1[i]] = [];\n    for (j = 0; j < modules.length; ++j) {\n      if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }\n    }\n  }\n\n  function emptyNodeAt (elm) {\n    return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n  }\n\n  function createRmCb (childElm, listeners) {\n    function remove$$1 () {\n      if (--remove$$1.listeners === 0) {\n        removeElement(childElm);\n      }\n    }\n    remove$$1.listeners = listeners;\n    return remove$$1\n  }\n\n  function removeElement (el) {\n    var parent = nodeOps.parentNode(el);\n    // element may have already been removed due to v-html\n    if (parent) {\n      nodeOps.removeChild(parent, el);\n    }\n  }\n\n  var inPre = 0;\n  function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {\n    vnode.isRootInsert = !nested; // for transition enter check\n    if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n      return\n    }\n\n    var data = vnode.data;\n    var children = vnode.children;\n    var tag = vnode.tag;\n    if (isDef(tag)) {\n      {\n        if (data && data.pre) {\n          inPre++;\n        }\n        if (\n          !inPre &&\n          !vnode.ns &&\n          !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&\n          config.isUnknownElement(tag)\n        ) {\n          warn(\n            'Unknown custom element: <' + tag + '> - did you ' +\n            'register the component correctly? For recursive components, ' +\n            'make sure to provide the \"name\" option.',\n            vnode.context\n          );\n        }\n      }\n      vnode.elm = vnode.ns\n        ? nodeOps.createElementNS(vnode.ns, tag)\n        : nodeOps.createElement(tag, vnode);\n      setScope(vnode);\n\n      /* istanbul ignore if */\n      {\n        createChildren(vnode, children, insertedVnodeQueue);\n        if (isDef(data)) {\n          invokeCreateHooks(vnode, insertedVnodeQueue);\n        }\n        insert(parentElm, vnode.elm, refElm);\n      }\n\n      if (\"development\" !== 'production' && data && data.pre) {\n        inPre--;\n      }\n    } else if (vnode.isComment) {\n      vnode.elm = nodeOps.createComment(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    } else {\n      vnode.elm = nodeOps.createTextNode(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    }\n  }\n\n  function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i = vnode.data;\n    if (isDef(i)) {\n      var isReactivated = isDef(vnode.child) && i.keepAlive;\n      if (isDef(i = i.hook) && isDef(i = i.init)) {\n        i(vnode, false /* hydrating */, parentElm, refElm);\n      }\n      // after calling the init hook, if the vnode is a child component\n      // it should've created a child instance and mounted it. the child\n      // component also has set the placeholder vnode's elm.\n      // in that case we can just return the element and be done.\n      if (isDef(vnode.child)) {\n        initComponent(vnode, insertedVnodeQueue);\n        if (isReactivated) {\n          reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n        }\n        return true\n      }\n    }\n  }\n\n  function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i;\n    // hack for #4339: a reactivated component with inner transition\n    // does not trigger because the inner node's created hooks are not called\n    // again. It's not ideal to involve module-specific logic in here but\n    // there doesn't seem to be a better way to do it.\n    var innerNode = vnode;\n    while (innerNode.child) {\n      innerNode = innerNode.child._vnode;\n      if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n        for (i = 0; i < cbs.activate.length; ++i) {\n          cbs.activate[i](emptyNode, innerNode);\n        }\n        insertedVnodeQueue.push(innerNode);\n        break\n      }\n    }\n    // unlike a newly created component,\n    // a reactivated keep-alive component doesn't insert itself\n    insert(parentElm, vnode.elm, refElm);\n  }\n\n  function insert (parent, elm, ref) {\n    if (parent) {\n      nodeOps.insertBefore(parent, elm, ref);\n    }\n  }\n\n  function createChildren (vnode, children, insertedVnodeQueue) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; ++i) {\n        createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);\n      }\n    } else if (isPrimitive(vnode.text)) {\n      nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));\n    }\n  }\n\n  function isPatchable (vnode) {\n    while (vnode.child) {\n      vnode = vnode.child._vnode;\n    }\n    return isDef(vnode.tag)\n  }\n\n  function invokeCreateHooks (vnode, insertedVnodeQueue) {\n    for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n      cbs.create[i$1](emptyNode, vnode);\n    }\n    i = vnode.data.hook; // Reuse variable\n    if (isDef(i)) {\n      if (i.create) { i.create(emptyNode, vnode); }\n      if (i.insert) { insertedVnodeQueue.push(vnode); }\n    }\n  }\n\n  function initComponent (vnode, insertedVnodeQueue) {\n    if (vnode.data.pendingInsert) {\n      insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n    }\n    vnode.elm = vnode.child.$el;\n    if (isPatchable(vnode)) {\n      invokeCreateHooks(vnode, insertedVnodeQueue);\n      setScope(vnode);\n    } else {\n      // empty component root.\n      // skip all element-related modules except for ref (#3455)\n      registerRef(vnode);\n      // make sure to invoke the insert hook\n      insertedVnodeQueue.push(vnode);\n    }\n  }\n\n  // set scope id attribute for scoped CSS.\n  // this is implemented as a special case to avoid the overhead\n  // of going through the normal attribute patching process.\n  function setScope (vnode) {\n    var i;\n    if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n    if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n  }\n\n  function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);\n    }\n  }\n\n  function invokeDestroyHook (vnode) {\n    var i, j;\n    var data = vnode.data;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n      for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n    }\n    if (isDef(i = vnode.children)) {\n      for (j = 0; j < vnode.children.length; ++j) {\n        invokeDestroyHook(vnode.children[j]);\n      }\n    }\n  }\n\n  function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      var ch = vnodes[startIdx];\n      if (isDef(ch)) {\n        if (isDef(ch.tag)) {\n          removeAndInvokeRemoveHook(ch);\n          invokeDestroyHook(ch);\n        } else { // Text node\n          nodeOps.removeChild(parentElm, ch.elm);\n        }\n      }\n    }\n  }\n\n  function removeAndInvokeRemoveHook (vnode, rm) {\n    if (rm || isDef(vnode.data)) {\n      var listeners = cbs.remove.length + 1;\n      if (!rm) {\n        // directly removing\n        rm = createRmCb(vnode.elm, listeners);\n      } else {\n        // we have a recursively passed down rm callback\n        // increase the listeners count\n        rm.listeners += listeners;\n      }\n      // recursively invoke hooks on child component root node\n      if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {\n        removeAndInvokeRemoveHook(i, rm);\n      }\n      for (i = 0; i < cbs.remove.length; ++i) {\n        cbs.remove[i](vnode, rm);\n      }\n      if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n        i(vnode, rm);\n      } else {\n        rm();\n      }\n    } else {\n      removeElement(vnode.elm);\n    }\n  }\n\n  function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n    var oldStartIdx = 0;\n    var newStartIdx = 0;\n    var oldEndIdx = oldCh.length - 1;\n    var oldStartVnode = oldCh[0];\n    var oldEndVnode = oldCh[oldEndIdx];\n    var newEndIdx = newCh.length - 1;\n    var newStartVnode = newCh[0];\n    var newEndVnode = newCh[newEndIdx];\n    var oldKeyToIdx, idxInOld, elmToMove, refElm;\n\n    // removeOnly is a special flag used only by <transition-group>\n    // to ensure removed elements stay in correct relative positions\n    // during leaving transitions\n    var canMove = !removeOnly;\n\n    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n      if (isUndef(oldStartVnode)) {\n        oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n      } else if (isUndef(oldEndVnode)) {\n        oldEndVnode = oldCh[--oldEndIdx];\n      } else if (sameVnode(oldStartVnode, newStartVnode)) {\n        patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);\n        oldStartVnode = oldCh[++oldStartIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else if (sameVnode(oldEndVnode, newEndVnode)) {\n        patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n        patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n        oldStartVnode = oldCh[++oldStartIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n        patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else {\n        if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n        idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;\n        if (isUndef(idxInOld)) { // New element\n          createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          elmToMove = oldCh[idxInOld];\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !elmToMove) {\n            warn(\n              'It seems there are duplicate keys that is causing an update error. ' +\n              'Make sure each v-for item has a unique key.'\n            );\n          }\n          if (elmToMove.tag !== newStartVnode.tag) {\n            // same key but different element. treat as new element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          } else {\n            patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);\n            oldCh[idxInOld] = undefined;\n            canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          }\n        }\n      }\n    }\n    if (oldStartIdx > oldEndIdx) {\n      refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n      addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n    } else if (newStartIdx > newEndIdx) {\n      removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n    }\n  }\n\n  function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {\n    if (oldVnode === vnode) {\n      return\n    }\n    // reuse element for static trees.\n    // note we only do this if the vnode is cloned -\n    // if the new node is not cloned it means the render functions have been\n    // reset by the hot-reload-api and we need to do a proper re-render.\n    if (vnode.isStatic &&\n        oldVnode.isStatic &&\n        vnode.key === oldVnode.key &&\n        (vnode.isCloned || vnode.isOnce)) {\n      vnode.elm = oldVnode.elm;\n      vnode.child = oldVnode.child;\n      return\n    }\n    var i;\n    var data = vnode.data;\n    var hasData = isDef(data);\n    if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n      i(oldVnode, vnode);\n    }\n    var elm = vnode.elm = oldVnode.elm;\n    var oldCh = oldVnode.children;\n    var ch = vnode.children;\n    if (hasData && isPatchable(vnode)) {\n      for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n      if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n    }\n    if (isUndef(vnode.text)) {\n      if (isDef(oldCh) && isDef(ch)) {\n        if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n      } else if (isDef(ch)) {\n        if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n        addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n      } else if (isDef(oldCh)) {\n        removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n      } else if (isDef(oldVnode.text)) {\n        nodeOps.setTextContent(elm, '');\n      }\n    } else if (oldVnode.text !== vnode.text) {\n      nodeOps.setTextContent(elm, vnode.text);\n    }\n    if (hasData) {\n      if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n    }\n  }\n\n  function invokeInsertHook (vnode, queue, initial) {\n    // delay insert hooks for component root nodes, invoke them after the\n    // element is really inserted\n    if (initial && vnode.parent) {\n      vnode.parent.data.pendingInsert = queue;\n    } else {\n      for (var i = 0; i < queue.length; ++i) {\n        queue[i].data.hook.insert(queue[i]);\n      }\n    }\n  }\n\n  var bailed = false;\n  function hydrate (elm, vnode, insertedVnodeQueue) {\n    {\n      if (!assertNodeMatch(elm, vnode)) {\n        return false\n      }\n    }\n    vnode.elm = elm;\n    var tag = vnode.tag;\n    var data = vnode.data;\n    var children = vnode.children;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n      if (isDef(i = vnode.child)) {\n        // child component. it should have hydrated its own tree.\n        initComponent(vnode, insertedVnodeQueue);\n        return true\n      }\n    }\n    if (isDef(tag)) {\n      if (isDef(children)) {\n        var childNodes = nodeOps.childNodes(elm);\n        // empty element, allow client to pick up and populate children\n        if (!childNodes.length) {\n          createChildren(vnode, children, insertedVnodeQueue);\n        } else {\n          var childrenMatch = true;\n          if (childNodes.length !== children.length) {\n            childrenMatch = false;\n          } else {\n            for (var i$1 = 0; i$1 < children.length; i$1++) {\n              if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {\n                childrenMatch = false;\n                break\n              }\n            }\n          }\n          if (!childrenMatch) {\n            if (\"development\" !== 'production' &&\n                typeof console !== 'undefined' &&\n                !bailed) {\n              bailed = true;\n              console.warn('Parent: ', elm);\n              console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);\n            }\n            return false\n          }\n        }\n      }\n      if (isDef(data)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n      }\n    }\n    return true\n  }\n\n  function assertNodeMatch (node, vnode) {\n    if (vnode.tag) {\n      return (\n        vnode.tag.indexOf('vue-component') === 0 ||\n        vnode.tag.toLowerCase() === nodeOps.tagName(node).toLowerCase()\n      )\n    } else {\n      return _toString(vnode.text) === node.data\n    }\n  }\n\n  return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {\n    if (!vnode) {\n      if (oldVnode) { invokeDestroyHook(oldVnode); }\n      return\n    }\n\n    var elm, parent;\n    var isInitialPatch = false;\n    var insertedVnodeQueue = [];\n\n    if (!oldVnode) {\n      // empty mount (likely as component), create new root element\n      isInitialPatch = true;\n      createElm(vnode, insertedVnodeQueue, parentElm, refElm);\n    } else {\n      var isRealElement = isDef(oldVnode.nodeType);\n      if (!isRealElement && sameVnode(oldVnode, vnode)) {\n        // patch existing root node\n        patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);\n      } else {\n        if (isRealElement) {\n          // mounting to a real element\n          // check if this is server-rendered content and if we can perform\n          // a successful hydration.\n          if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {\n            oldVnode.removeAttribute('server-rendered');\n            hydrating = true;\n          }\n          if (hydrating) {\n            if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n              invokeInsertHook(vnode, insertedVnodeQueue, true);\n              return oldVnode\n            } else {\n              warn(\n                'The client-side rendered virtual DOM tree is not matching ' +\n                'server-rendered content. This is likely caused by incorrect ' +\n                'HTML markup, for example nesting block-level elements inside ' +\n                '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                'full client-side render.'\n              );\n            }\n          }\n          // either not server-rendered, or hydration failed.\n          // create an empty node and replace it\n          oldVnode = emptyNodeAt(oldVnode);\n        }\n\n        // replacing existing element\n        elm = oldVnode.elm;\n        parent = nodeOps.parentNode(elm);\n        createElm(vnode, insertedVnodeQueue, parent, nodeOps.nextSibling(elm));\n\n        if (vnode.parent) {\n          // component root element replaced.\n          // update parent placeholder node element, recursively\n          var ancestor = vnode.parent;\n          while (ancestor) {\n            ancestor.elm = vnode.elm;\n            ancestor = ancestor.parent;\n          }\n          if (isPatchable(vnode)) {\n            for (var i = 0; i < cbs.create.length; ++i) {\n              cbs.create[i](emptyNode, vnode.parent);\n            }\n          }\n        }\n\n        if (parent !== null) {\n          removeVnodes(parent, [oldVnode], 0, 0);\n        } else if (isDef(oldVnode.tag)) {\n          invokeDestroyHook(oldVnode);\n        }\n      }\n    }\n\n    invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n    return vnode.elm\n  }\n}\n\n/*  */\n\nvar directives = {\n  create: updateDirectives,\n  update: updateDirectives,\n  destroy: function unbindDirectives (vnode) {\n    updateDirectives(vnode, emptyNode);\n  }\n};\n\nfunction updateDirectives (\n  oldVnode,\n  vnode\n) {\n  if (!oldVnode.data.directives && !vnode.data.directives) {\n    return\n  }\n  var isCreate = oldVnode === emptyNode;\n  var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n  var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n  var dirsWithInsert = [];\n  var dirsWithPostpatch = [];\n\n  var key, oldDir, dir;\n  for (key in newDirs) {\n    oldDir = oldDirs[key];\n    dir = newDirs[key];\n    if (!oldDir) {\n      // new directive, bind\n      callHook$1(dir, 'bind', vnode, oldVnode);\n      if (dir.def && dir.def.inserted) {\n        dirsWithInsert.push(dir);\n      }\n    } else {\n      // existing directive, update\n      dir.oldValue = oldDir.value;\n      callHook$1(dir, 'update', vnode, oldVnode);\n      if (dir.def && dir.def.componentUpdated) {\n        dirsWithPostpatch.push(dir);\n      }\n    }\n  }\n\n  if (dirsWithInsert.length) {\n    var callInsert = function () {\n      dirsWithInsert.forEach(function (dir) {\n        callHook$1(dir, 'inserted', vnode, oldVnode);\n      });\n    };\n    if (isCreate) {\n      mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');\n    } else {\n      callInsert();\n    }\n  }\n\n  if (dirsWithPostpatch.length) {\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {\n      dirsWithPostpatch.forEach(function (dir) {\n        callHook$1(dir, 'componentUpdated', vnode, oldVnode);\n      });\n    }, 'dir-postpatch');\n  }\n\n  if (!isCreate) {\n    for (key in oldDirs) {\n      if (!newDirs[key]) {\n        // no longer present, unbind\n        callHook$1(oldDirs[key], 'unbind', oldVnode);\n      }\n    }\n  }\n}\n\nvar emptyModifiers = Object.create(null);\n\nfunction normalizeDirectives$1 (\n  dirs,\n  vm\n) {\n  var res = Object.create(null);\n  if (!dirs) {\n    return res\n  }\n  var i, dir;\n  for (i = 0; i < dirs.length; i++) {\n    dir = dirs[i];\n    if (!dir.modifiers) {\n      dir.modifiers = emptyModifiers;\n    }\n    res[getRawDirName(dir)] = dir;\n    dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n  }\n  return res\n}\n\nfunction getRawDirName (dir) {\n  return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n}\n\nfunction callHook$1 (dir, hook, vnode, oldVnode) {\n  var fn = dir.def && dir.def[hook];\n  if (fn) {\n    fn(vnode.elm, dir, vnode, oldVnode);\n  }\n}\n\nvar baseModules = [\n  ref,\n  directives\n];\n\n/*  */\n\nfunction updateAttrs (oldVnode, vnode) {\n  if (!oldVnode.data.attrs && !vnode.data.attrs) {\n    return\n  }\n  var key, cur, old;\n  var elm = vnode.elm;\n  var oldAttrs = oldVnode.data.attrs || {};\n  var attrs = vnode.data.attrs || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (attrs.__ob__) {\n    attrs = vnode.data.attrs = extend({}, attrs);\n  }\n\n  for (key in attrs) {\n    cur = attrs[key];\n    old = oldAttrs[key];\n    if (old !== cur) {\n      setAttr(elm, key, cur);\n    }\n  }\n  for (key in oldAttrs) {\n    if (attrs[key] == null) {\n      if (isXlink(key)) {\n        elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else if (!isEnumeratedAttr(key)) {\n        elm.removeAttribute(key);\n      }\n    }\n  }\n}\n\nfunction setAttr (el, key, value) {\n  if (isBooleanAttr(key)) {\n    // set attribute for blank value\n    // e.g. <option disabled>Select one</option>\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, key);\n    }\n  } else if (isEnumeratedAttr(key)) {\n    el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');\n  } else if (isXlink(key)) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n    } else {\n      el.setAttributeNS(xlinkNS, key, value);\n    }\n  } else {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, value);\n    }\n  }\n}\n\nvar attrs = {\n  create: updateAttrs,\n  update: updateAttrs\n};\n\n/*  */\n\nfunction updateClass (oldVnode, vnode) {\n  var el = vnode.elm;\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n  if (!data.staticClass && !data.class &&\n      (!oldData || (!oldData.staticClass && !oldData.class))) {\n    return\n  }\n\n  var cls = genClassForVnode(vnode);\n\n  // handle transition classes\n  var transitionClass = el._transitionClasses;\n  if (transitionClass) {\n    cls = concat(cls, stringifyClass(transitionClass));\n  }\n\n  // set the class\n  if (cls !== el._prevClass) {\n    el.setAttribute('class', cls);\n    el._prevClass = cls;\n  }\n}\n\nvar klass = {\n  create: updateClass,\n  update: updateClass\n};\n\n// skip type checking this file because we need to attach private properties\n// to elements\n\nfunction updateDOMListeners (oldVnode, vnode) {\n  if (!oldVnode.data.on && !vnode.data.on) {\n    return\n  }\n  var on = vnode.data.on || {};\n  var oldOn = oldVnode.data.on || {};\n  var add = vnode.elm._v_add || (\n    vnode.elm._v_add = function (event, handler, once, capture) {\n      if (once) {\n        var oldHandler = handler;\n        handler = function (ev) {\n          remove(event, handler, capture);\n          arguments.length === 1\n            ? oldHandler(ev)\n            : oldHandler.apply(null, arguments);\n        };\n      }\n      vnode.elm.addEventListener(event, handler, capture);\n    }\n  );\n  var remove = vnode.elm._v_remove || (\n    vnode.elm._v_remove = function (event, handler, capture) {\n      vnode.elm.removeEventListener(event, handler, capture);\n    }\n  );\n  updateListeners(on, oldOn, add, remove, vnode.context);\n}\n\nvar events = {\n  create: updateDOMListeners,\n  update: updateDOMListeners\n};\n\n/*  */\n\nfunction updateDOMProps (oldVnode, vnode) {\n  if (!oldVnode.data.domProps && !vnode.data.domProps) {\n    return\n  }\n  var key, cur;\n  var elm = vnode.elm;\n  var oldProps = oldVnode.data.domProps || {};\n  var props = vnode.data.domProps || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (props.__ob__) {\n    props = vnode.data.domProps = extend({}, props);\n  }\n\n  for (key in oldProps) {\n    if (props[key] == null) {\n      elm[key] = '';\n    }\n  }\n  for (key in props) {\n    cur = props[key];\n    // ignore children if the node has textContent or innerHTML,\n    // as these will throw away existing DOM nodes and cause removal errors\n    // on subsequent patches (#3360)\n    if (key === 'textContent' || key === 'innerHTML') {\n      if (vnode.children) { vnode.children.length = 0; }\n      if (cur === oldProps[key]) { continue }\n    }\n    if (key === 'value') {\n      // store value as _value as well since\n      // non-string values will be stringified\n      elm._value = cur;\n      // avoid resetting cursor position when value is the same\n      var strCur = cur == null ? '' : String(cur);\n      if (elm.value !== strCur && !elm.composing) {\n        elm.value = strCur;\n      }\n    } else {\n      elm[key] = cur;\n    }\n  }\n}\n\nvar domProps = {\n  create: updateDOMProps,\n  update: updateDOMProps\n};\n\n/*  */\n\nvar parseStyleText = cached(function (cssText) {\n  var res = {};\n  var listDelimiter = /;(?![^(]*\\))/g;\n  var propertyDelimiter = /:(.+)/;\n  cssText.split(listDelimiter).forEach(function (item) {\n    if (item) {\n      var tmp = item.split(propertyDelimiter);\n      tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n    }\n  });\n  return res\n});\n\n// merge static and dynamic style data on the same vnode\nfunction normalizeStyleData (data) {\n  var style = normalizeStyleBinding(data.style);\n  // static style is pre-processed into an object during compilation\n  // and is always a fresh object, so it's safe to merge into it\n  return data.staticStyle\n    ? extend(data.staticStyle, style)\n    : style\n}\n\n// normalize possible array / string values into Object\nfunction normalizeStyleBinding (bindingStyle) {\n  if (Array.isArray(bindingStyle)) {\n    return toObject(bindingStyle)\n  }\n  if (typeof bindingStyle === 'string') {\n    return parseStyleText(bindingStyle)\n  }\n  return bindingStyle\n}\n\n/**\n * parent component style should be after child's\n * so that parent component's style could override it\n */\nfunction getStyle (vnode, checkChild) {\n  var res = {};\n  var styleData;\n\n  if (checkChild) {\n    var childNode = vnode;\n    while (childNode.child) {\n      childNode = childNode.child._vnode;\n      if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n        extend(res, styleData);\n      }\n    }\n  }\n\n  if ((styleData = normalizeStyleData(vnode.data))) {\n    extend(res, styleData);\n  }\n\n  var parentNode = vnode;\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n      extend(res, styleData);\n    }\n  }\n  return res\n}\n\n/*  */\n\nvar cssVarRE = /^--/;\nvar importantRE = /\\s*!important$/;\nvar setProp = function (el, name, val) {\n  /* istanbul ignore if */\n  if (cssVarRE.test(name)) {\n    el.style.setProperty(name, val);\n  } else if (importantRE.test(val)) {\n    el.style.setProperty(name, val.replace(importantRE, ''), 'important');\n  } else {\n    el.style[normalize(name)] = val;\n  }\n};\n\nvar prefixes = ['Webkit', 'Moz', 'ms'];\n\nvar testEl;\nvar normalize = cached(function (prop) {\n  testEl = testEl || document.createElement('div');\n  prop = camelize(prop);\n  if (prop !== 'filter' && (prop in testEl.style)) {\n    return prop\n  }\n  var upper = prop.charAt(0).toUpperCase() + prop.slice(1);\n  for (var i = 0; i < prefixes.length; i++) {\n    var prefixed = prefixes[i] + upper;\n    if (prefixed in testEl.style) {\n      return prefixed\n    }\n  }\n});\n\nfunction updateStyle (oldVnode, vnode) {\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n\n  if (!data.staticStyle && !data.style &&\n      !oldData.staticStyle && !oldData.style) {\n    return\n  }\n\n  var cur, name;\n  var el = vnode.elm;\n  var oldStaticStyle = oldVnode.data.staticStyle;\n  var oldStyleBinding = oldVnode.data.style || {};\n\n  // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n  var oldStyle = oldStaticStyle || oldStyleBinding;\n\n  var style = normalizeStyleBinding(vnode.data.style) || {};\n\n  vnode.data.style = style.__ob__ ? extend({}, style) : style;\n\n  var newStyle = getStyle(vnode, true);\n\n  for (name in oldStyle) {\n    if (newStyle[name] == null) {\n      setProp(el, name, '');\n    }\n  }\n  for (name in newStyle) {\n    cur = newStyle[name];\n    if (cur !== oldStyle[name]) {\n      // ie9 setting to null has no effect, must use empty string\n      setProp(el, name, cur == null ? '' : cur);\n    }\n  }\n}\n\nvar style = {\n  create: updateStyle,\n  update: updateStyle\n};\n\n/*  */\n\n/**\n * Add class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction addClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n    } else {\n      el.classList.add(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    if (cur.indexOf(' ' + cls + ' ') < 0) {\n      el.setAttribute('class', (cur + cls).trim());\n    }\n  }\n}\n\n/**\n * Remove class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction removeClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.remove(c); });\n    } else {\n      el.classList.remove(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    var tar = ' ' + cls + ' ';\n    while (cur.indexOf(tar) >= 0) {\n      cur = cur.replace(tar, ' ');\n    }\n    el.setAttribute('class', cur.trim());\n  }\n}\n\n/*  */\n\nvar hasTransition = inBrowser && !isIE9;\nvar TRANSITION = 'transition';\nvar ANIMATION = 'animation';\n\n// Transition property/event sniffing\nvar transitionProp = 'transition';\nvar transitionEndEvent = 'transitionend';\nvar animationProp = 'animation';\nvar animationEndEvent = 'animationend';\nif (hasTransition) {\n  /* istanbul ignore if */\n  if (window.ontransitionend === undefined &&\n    window.onwebkittransitionend !== undefined) {\n    transitionProp = 'WebkitTransition';\n    transitionEndEvent = 'webkitTransitionEnd';\n  }\n  if (window.onanimationend === undefined &&\n    window.onwebkitanimationend !== undefined) {\n    animationProp = 'WebkitAnimation';\n    animationEndEvent = 'webkitAnimationEnd';\n  }\n}\n\nvar raf = (inBrowser && window.requestAnimationFrame) || setTimeout;\nfunction nextFrame (fn) {\n  raf(function () {\n    raf(fn);\n  });\n}\n\nfunction addTransitionClass (el, cls) {\n  (el._transitionClasses || (el._transitionClasses = [])).push(cls);\n  addClass(el, cls);\n}\n\nfunction removeTransitionClass (el, cls) {\n  if (el._transitionClasses) {\n    remove$1(el._transitionClasses, cls);\n  }\n  removeClass(el, cls);\n}\n\nfunction whenTransitionEnds (\n  el,\n  expectedType,\n  cb\n) {\n  var ref = getTransitionInfo(el, expectedType);\n  var type = ref.type;\n  var timeout = ref.timeout;\n  var propCount = ref.propCount;\n  if (!type) { return cb() }\n  var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n  var ended = 0;\n  var end = function () {\n    el.removeEventListener(event, onEnd);\n    cb();\n  };\n  var onEnd = function (e) {\n    if (e.target === el) {\n      if (++ended >= propCount) {\n        end();\n      }\n    }\n  };\n  setTimeout(function () {\n    if (ended < propCount) {\n      end();\n    }\n  }, timeout + 1);\n  el.addEventListener(event, onEnd);\n}\n\nvar transformRE = /\\b(transform|all)(,|$)/;\n\nfunction getTransitionInfo (el, expectedType) {\n  var styles = window.getComputedStyle(el);\n  var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');\n  var transitionDurations = styles[transitionProp + 'Duration'].split(', ');\n  var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);\n  var animationDelays = styles[animationProp + 'Delay'].split(', ');\n  var animationDurations = styles[animationProp + 'Duration'].split(', ');\n  var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n  var type;\n  var timeout = 0;\n  var propCount = 0;\n  /* istanbul ignore if */\n  if (expectedType === TRANSITION) {\n    if (transitionTimeout > 0) {\n      type = TRANSITION;\n      timeout = transitionTimeout;\n      propCount = transitionDurations.length;\n    }\n  } else if (expectedType === ANIMATION) {\n    if (animationTimeout > 0) {\n      type = ANIMATION;\n      timeout = animationTimeout;\n      propCount = animationDurations.length;\n    }\n  } else {\n    timeout = Math.max(transitionTimeout, animationTimeout);\n    type = timeout > 0\n      ? transitionTimeout > animationTimeout\n        ? TRANSITION\n        : ANIMATION\n      : null;\n    propCount = type\n      ? type === TRANSITION\n        ? transitionDurations.length\n        : animationDurations.length\n      : 0;\n  }\n  var hasTransform =\n    type === TRANSITION &&\n    transformRE.test(styles[transitionProp + 'Property']);\n  return {\n    type: type,\n    timeout: timeout,\n    propCount: propCount,\n    hasTransform: hasTransform\n  }\n}\n\nfunction getTimeout (delays, durations) {\n  /* istanbul ignore next */\n  while (delays.length < durations.length) {\n    delays = delays.concat(delays);\n  }\n\n  return Math.max.apply(null, durations.map(function (d, i) {\n    return toMs(d) + toMs(delays[i])\n  }))\n}\n\nfunction toMs (s) {\n  return Number(s.slice(0, -1)) * 1000\n}\n\n/*  */\n\nfunction enter (vnode) {\n  var el = vnode.elm;\n\n  // call leave callback now\n  if (el._leaveCb) {\n    el._leaveCb.cancelled = true;\n    el._leaveCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return\n  }\n\n  /* istanbul ignore if */\n  if (el._enterCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var enterClass = data.enterClass;\n  var enterActiveClass = data.enterActiveClass;\n  var appearClass = data.appearClass;\n  var appearActiveClass = data.appearActiveClass;\n  var beforeEnter = data.beforeEnter;\n  var enter = data.enter;\n  var afterEnter = data.afterEnter;\n  var enterCancelled = data.enterCancelled;\n  var beforeAppear = data.beforeAppear;\n  var appear = data.appear;\n  var afterAppear = data.afterAppear;\n  var appearCancelled = data.appearCancelled;\n\n  // activeInstance will always be the <transition> component managing this\n  // transition. One edge case to check is when the <transition> is placed\n  // as the root node of a child component. In that case we need to check\n  // <transition>'s parent for appear check.\n  var context = activeInstance;\n  var transitionNode = activeInstance.$vnode;\n  while (transitionNode && transitionNode.parent) {\n    transitionNode = transitionNode.parent;\n    context = transitionNode.context;\n  }\n\n  var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  var startClass = isAppear ? appearClass : enterClass;\n  var activeClass = isAppear ? appearActiveClass : enterActiveClass;\n  var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;\n  var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;\n  var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;\n  var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    enterHook &&\n    // enterHook may be a bound method which exposes\n    // the length of original fn as _length\n    (enterHook._length || enterHook.length) > 1;\n\n  var cb = el._enterCb = once(function () {\n    if (expectsCSS) {\n      removeTransitionClass(el, activeClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass);\n      }\n      enterCancelledHook && enterCancelledHook(el);\n    } else {\n      afterEnterHook && afterEnterHook(el);\n    }\n    el._enterCb = null;\n  });\n\n  if (!vnode.data.show) {\n    // remove pending leave element on enter by injecting an insert hook\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {\n      var parent = el.parentNode;\n      var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n      if (pendingNode &&\n          pendingNode.context === vnode.context &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb) {\n        pendingNode.elm._leaveCb();\n      }\n      enterHook && enterHook(el, cb);\n    }, 'transition-insert');\n  }\n\n  // start enter transition\n  beforeEnterHook && beforeEnterHook(el);\n  if (expectsCSS) {\n    addTransitionClass(el, startClass);\n    addTransitionClass(el, activeClass);\n    nextFrame(function () {\n      removeTransitionClass(el, startClass);\n      if (!cb.cancelled && !userWantsControl) {\n        whenTransitionEnds(el, type, cb);\n      }\n    });\n  }\n\n  if (vnode.data.show) {\n    enterHook && enterHook(el, cb);\n  }\n\n  if (!expectsCSS && !userWantsControl) {\n    cb();\n  }\n}\n\nfunction leave (vnode, rm) {\n  var el = vnode.elm;\n\n  // call enter callback now\n  if (el._enterCb) {\n    el._enterCb.cancelled = true;\n    el._enterCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return rm()\n  }\n\n  /* istanbul ignore if */\n  if (el._leaveCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var leaveClass = data.leaveClass;\n  var leaveActiveClass = data.leaveActiveClass;\n  var beforeLeave = data.beforeLeave;\n  var leave = data.leave;\n  var afterLeave = data.afterLeave;\n  var leaveCancelled = data.leaveCancelled;\n  var delayLeave = data.delayLeave;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    leave &&\n    // leave hook may be a bound method which exposes\n    // the length of original fn as _length\n    (leave._length || leave.length) > 1;\n\n  var cb = el._leaveCb = once(function () {\n    if (el.parentNode && el.parentNode._pending) {\n      el.parentNode._pending[vnode.key] = null;\n    }\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveActiveClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass);\n      }\n      leaveCancelled && leaveCancelled(el);\n    } else {\n      rm();\n      afterLeave && afterLeave(el);\n    }\n    el._leaveCb = null;\n  });\n\n  if (delayLeave) {\n    delayLeave(performLeave);\n  } else {\n    performLeave();\n  }\n\n  function performLeave () {\n    // the delayed leave may have already been cancelled\n    if (cb.cancelled) {\n      return\n    }\n    // record leaving element\n    if (!vnode.data.show) {\n      (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;\n    }\n    beforeLeave && beforeLeave(el);\n    if (expectsCSS) {\n      addTransitionClass(el, leaveClass);\n      addTransitionClass(el, leaveActiveClass);\n      nextFrame(function () {\n        removeTransitionClass(el, leaveClass);\n        if (!cb.cancelled && !userWantsControl) {\n          whenTransitionEnds(el, type, cb);\n        }\n      });\n    }\n    leave && leave(el, cb);\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n}\n\nfunction resolveTransition (def$$1) {\n  if (!def$$1) {\n    return\n  }\n  /* istanbul ignore else */\n  if (typeof def$$1 === 'object') {\n    var res = {};\n    if (def$$1.css !== false) {\n      extend(res, autoCssTransition(def$$1.name || 'v'));\n    }\n    extend(res, def$$1);\n    return res\n  } else if (typeof def$$1 === 'string') {\n    return autoCssTransition(def$$1)\n  }\n}\n\nvar autoCssTransition = cached(function (name) {\n  return {\n    enterClass: (name + \"-enter\"),\n    leaveClass: (name + \"-leave\"),\n    appearClass: (name + \"-enter\"),\n    enterActiveClass: (name + \"-enter-active\"),\n    leaveActiveClass: (name + \"-leave-active\"),\n    appearActiveClass: (name + \"-enter-active\")\n  }\n});\n\nfunction once (fn) {\n  var called = false;\n  return function () {\n    if (!called) {\n      called = true;\n      fn();\n    }\n  }\n}\n\nfunction _enter (_, vnode) {\n  if (!vnode.data.show) {\n    enter(vnode);\n  }\n}\n\nvar transition = inBrowser ? {\n  create: _enter,\n  activate: _enter,\n  remove: function remove (vnode, rm) {\n    /* istanbul ignore else */\n    if (!vnode.data.show) {\n      leave(vnode, rm);\n    } else {\n      rm();\n    }\n  }\n} : {};\n\nvar platformModules = [\n  attrs,\n  klass,\n  events,\n  domProps,\n  style,\n  transition\n];\n\n/*  */\n\n// the directive module should be applied last, after all\n// built-in modules have been applied.\nvar modules = platformModules.concat(baseModules);\n\nvar patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n/**\n * Not type checking this file because flow doesn't like attaching\n * properties to Elements.\n */\n\nvar modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;\n\n/* istanbul ignore if */\nif (isIE9) {\n  // http://www.matts411.com/post/internet-explorer-9-oninput/\n  document.addEventListener('selectionchange', function () {\n    var el = document.activeElement;\n    if (el && el.vmodel) {\n      trigger(el, 'input');\n    }\n  });\n}\n\nvar model = {\n  inserted: function inserted (el, binding, vnode) {\n    {\n      if (!modelableTagRE.test(vnode.tag)) {\n        warn(\n          \"v-model is not supported on element type: <\" + (vnode.tag) + \">. \" +\n          'If you are working with contenteditable, it\\'s recommended to ' +\n          'wrap a library dedicated for that purpose inside a custom component.',\n          vnode.context\n        );\n      }\n    }\n    if (vnode.tag === 'select') {\n      var cb = function () {\n        setSelected(el, binding, vnode.context);\n      };\n      cb();\n      /* istanbul ignore if */\n      if (isIE || isEdge) {\n        setTimeout(cb, 0);\n      }\n    } else if (\n      (vnode.tag === 'textarea' || el.type === 'text') &&\n      !binding.modifiers.lazy\n    ) {\n      if (!isAndroid) {\n        el.addEventListener('compositionstart', onCompositionStart);\n        el.addEventListener('compositionend', onCompositionEnd);\n      }\n      /* istanbul ignore if */\n      if (isIE9) {\n        el.vmodel = true;\n      }\n    }\n  },\n  componentUpdated: function componentUpdated (el, binding, vnode) {\n    if (vnode.tag === 'select') {\n      setSelected(el, binding, vnode.context);\n      // in case the options rendered by v-for have changed,\n      // it's possible that the value is out-of-sync with the rendered options.\n      // detect such cases and filter out values that no longer has a matching\n      // option in the DOM.\n      var needReset = el.multiple\n        ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })\n        : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);\n      if (needReset) {\n        trigger(el, 'change');\n      }\n    }\n  }\n};\n\nfunction setSelected (el, binding, vm) {\n  var value = binding.value;\n  var isMultiple = el.multiple;\n  if (isMultiple && !Array.isArray(value)) {\n    \"development\" !== 'production' && warn(\n      \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n      \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n      vm\n    );\n    return\n  }\n  var selected, option;\n  for (var i = 0, l = el.options.length; i < l; i++) {\n    option = el.options[i];\n    if (isMultiple) {\n      selected = looseIndexOf(value, getValue(option)) > -1;\n      if (option.selected !== selected) {\n        option.selected = selected;\n      }\n    } else {\n      if (looseEqual(getValue(option), value)) {\n        if (el.selectedIndex !== i) {\n          el.selectedIndex = i;\n        }\n        return\n      }\n    }\n  }\n  if (!isMultiple) {\n    el.selectedIndex = -1;\n  }\n}\n\nfunction hasNoMatchingOption (value, options) {\n  for (var i = 0, l = options.length; i < l; i++) {\n    if (looseEqual(getValue(options[i]), value)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction getValue (option) {\n  return '_value' in option\n    ? option._value\n    : option.value\n}\n\nfunction onCompositionStart (e) {\n  e.target.composing = true;\n}\n\nfunction onCompositionEnd (e) {\n  e.target.composing = false;\n  trigger(e.target, 'input');\n}\n\nfunction trigger (el, type) {\n  var e = document.createEvent('HTMLEvents');\n  e.initEvent(type, true, true);\n  el.dispatchEvent(e);\n}\n\n/*  */\n\n// recursively search for possible transition defined inside the component root\nfunction locateNode (vnode) {\n  return vnode.child && (!vnode.data || !vnode.data.transition)\n    ? locateNode(vnode.child._vnode)\n    : vnode\n}\n\nvar show = {\n  bind: function bind (el, ref, vnode) {\n    var value = ref.value;\n\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (value && transition && !isIE9) {\n      enter(vnode);\n    }\n    var originalDisplay = el.style.display === 'none' ? '' : el.style.display;\n    el.style.display = value ? originalDisplay : 'none';\n    el.__vOriginalDisplay = originalDisplay;\n  },\n  update: function update (el, ref, vnode) {\n    var value = ref.value;\n    var oldValue = ref.oldValue;\n\n    /* istanbul ignore if */\n    if (value === oldValue) { return }\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (transition && !isIE9) {\n      if (value) {\n        enter(vnode);\n        el.style.display = el.__vOriginalDisplay;\n      } else {\n        leave(vnode, function () {\n          el.style.display = 'none';\n        });\n      }\n    } else {\n      el.style.display = value ? el.__vOriginalDisplay : 'none';\n    }\n  }\n};\n\nvar platformDirectives = {\n  model: model,\n  show: show\n};\n\n/*  */\n\n// Provides transition support for a single element/component.\n// supports transition mode (out-in / in-out)\n\nvar transitionProps = {\n  name: String,\n  appear: Boolean,\n  css: Boolean,\n  mode: String,\n  type: String,\n  enterClass: String,\n  leaveClass: String,\n  enterActiveClass: String,\n  leaveActiveClass: String,\n  appearClass: String,\n  appearActiveClass: String\n};\n\n// in case the child is also an abstract component, e.g. <keep-alive>\n// we want to recursively retrieve the real component to be rendered\nfunction getRealChild (vnode) {\n  var compOptions = vnode && vnode.componentOptions;\n  if (compOptions && compOptions.Ctor.options.abstract) {\n    return getRealChild(getFirstComponentChild(compOptions.children))\n  } else {\n    return vnode\n  }\n}\n\nfunction extractTransitionData (comp) {\n  var data = {};\n  var options = comp.$options;\n  // props\n  for (var key in options.propsData) {\n    data[key] = comp[key];\n  }\n  // events.\n  // extract listeners and pass them directly to the transition methods\n  var listeners = options._parentListeners;\n  for (var key$1 in listeners) {\n    data[camelize(key$1)] = listeners[key$1].fn;\n  }\n  return data\n}\n\nfunction placeholder (h, rawChild) {\n  return /\\d-keep-alive$/.test(rawChild.tag)\n    ? h('keep-alive')\n    : null\n}\n\nfunction hasParentTransition (vnode) {\n  while ((vnode = vnode.parent)) {\n    if (vnode.data.transition) {\n      return true\n    }\n  }\n}\n\nvar Transition = {\n  name: 'transition',\n  props: transitionProps,\n  abstract: true,\n  render: function render (h) {\n    var this$1 = this;\n\n    var children = this.$slots.default;\n    if (!children) {\n      return\n    }\n\n    // filter out text nodes (possible whitespaces)\n    children = children.filter(function (c) { return c.tag; });\n    /* istanbul ignore if */\n    if (!children.length) {\n      return\n    }\n\n    // warn multiple elements\n    if (\"development\" !== 'production' && children.length > 1) {\n      warn(\n        '<transition> can only be used on a single element. Use ' +\n        '<transition-group> for lists.',\n        this.$parent\n      );\n    }\n\n    var mode = this.mode;\n\n    // warn invalid mode\n    if (\"development\" !== 'production' &&\n        mode && mode !== 'in-out' && mode !== 'out-in') {\n      warn(\n        'invalid <transition> mode: ' + mode,\n        this.$parent\n      );\n    }\n\n    var rawChild = children[0];\n\n    // if this is a component root node and the component's\n    // parent container node also has transition, skip.\n    if (hasParentTransition(this.$vnode)) {\n      return rawChild\n    }\n\n    // apply transition data to child\n    // use getRealChild() to ignore abstract components e.g. keep-alive\n    var child = getRealChild(rawChild);\n    /* istanbul ignore if */\n    if (!child) {\n      return rawChild\n    }\n\n    if (this._leaving) {\n      return placeholder(h, rawChild)\n    }\n\n    var key = child.key = child.key == null || child.isStatic\n      ? (\"__v\" + (child.tag + this._uid) + \"__\")\n      : child.key;\n    var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n    var oldRawChild = this._vnode;\n    var oldChild = getRealChild(oldRawChild);\n\n    // mark v-show\n    // so that the transition module can hand over the control to the directive\n    if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {\n      child.data.show = true;\n    }\n\n    if (oldChild && oldChild.data && oldChild.key !== key) {\n      // replace old child transition data with fresh one\n      // important for dynamic transitions!\n      var oldData = oldChild.data.transition = extend({}, data);\n\n      // handle transition mode\n      if (mode === 'out-in') {\n        // return placeholder node and queue update when leave finishes\n        this._leaving = true;\n        mergeVNodeHook(oldData, 'afterLeave', function () {\n          this$1._leaving = false;\n          this$1.$forceUpdate();\n        }, key);\n        return placeholder(h, rawChild)\n      } else if (mode === 'in-out') {\n        var delayedLeave;\n        var performLeave = function () { delayedLeave(); };\n        mergeVNodeHook(data, 'afterEnter', performLeave, key);\n        mergeVNodeHook(data, 'enterCancelled', performLeave, key);\n        mergeVNodeHook(oldData, 'delayLeave', function (leave) {\n          delayedLeave = leave;\n        }, key);\n      }\n    }\n\n    return rawChild\n  }\n};\n\n/*  */\n\n// Provides transition support for list items.\n// supports move transitions using the FLIP technique.\n\n// Because the vdom's children update algorithm is \"unstable\" - i.e.\n// it doesn't guarantee the relative positioning of removed elements,\n// we force transition-group to update its children into two passes:\n// in the first pass, we remove all nodes that need to be removed,\n// triggering their leaving transition; in the second pass, we insert/move\n// into the final disired state. This way in the second pass removed\n// nodes will remain where they should be.\n\nvar props = extend({\n  tag: String,\n  moveClass: String\n}, transitionProps);\n\ndelete props.mode;\n\nvar TransitionGroup = {\n  props: props,\n\n  render: function render (h) {\n    var tag = this.tag || this.$vnode.data.tag || 'span';\n    var map = Object.create(null);\n    var prevChildren = this.prevChildren = this.children;\n    var rawChildren = this.$slots.default || [];\n    var children = this.children = [];\n    var transitionData = extractTransitionData(this);\n\n    for (var i = 0; i < rawChildren.length; i++) {\n      var c = rawChildren[i];\n      if (c.tag) {\n        if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n          children.push(c);\n          map[c.key] = c\n          ;(c.data || (c.data = {})).transition = transitionData;\n        } else {\n          var opts = c.componentOptions;\n          var name = opts\n            ? (opts.Ctor.options.name || opts.tag)\n            : c.tag;\n          warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n        }\n      }\n    }\n\n    if (prevChildren) {\n      var kept = [];\n      var removed = [];\n      for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n        var c$1 = prevChildren[i$1];\n        c$1.data.transition = transitionData;\n        c$1.data.pos = c$1.elm.getBoundingClientRect();\n        if (map[c$1.key]) {\n          kept.push(c$1);\n        } else {\n          removed.push(c$1);\n        }\n      }\n      this.kept = h(tag, null, kept);\n      this.removed = removed;\n    }\n\n    return h(tag, null, children)\n  },\n\n  beforeUpdate: function beforeUpdate () {\n    // force removing pass\n    this.__patch__(\n      this._vnode,\n      this.kept,\n      false, // hydrating\n      true // removeOnly (!important, avoids unnecessary moves)\n    );\n    this._vnode = this.kept;\n  },\n\n  updated: function updated () {\n    var children = this.prevChildren;\n    var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n    if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n      return\n    }\n\n    // we divide the work into three loops to avoid mixing DOM reads and writes\n    // in each iteration - which helps prevent layout thrashing.\n    children.forEach(callPendingCbs);\n    children.forEach(recordPosition);\n    children.forEach(applyTranslation);\n\n    // force reflow to put everything in position\n    var f = document.body.offsetHeight; // eslint-disable-line\n\n    children.forEach(function (c) {\n      if (c.data.moved) {\n        var el = c.elm;\n        var s = el.style;\n        addTransitionClass(el, moveClass);\n        s.transform = s.WebkitTransform = s.transitionDuration = '';\n        el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n          if (!e || /transform$/.test(e.propertyName)) {\n            el.removeEventListener(transitionEndEvent, cb);\n            el._moveCb = null;\n            removeTransitionClass(el, moveClass);\n          }\n        });\n      }\n    });\n  },\n\n  methods: {\n    hasMove: function hasMove (el, moveClass) {\n      /* istanbul ignore if */\n      if (!hasTransition) {\n        return false\n      }\n      if (this._hasMove != null) {\n        return this._hasMove\n      }\n      addTransitionClass(el, moveClass);\n      var info = getTransitionInfo(el);\n      removeTransitionClass(el, moveClass);\n      return (this._hasMove = info.hasTransform)\n    }\n  }\n};\n\nfunction callPendingCbs (c) {\n  /* istanbul ignore if */\n  if (c.elm._moveCb) {\n    c.elm._moveCb();\n  }\n  /* istanbul ignore if */\n  if (c.elm._enterCb) {\n    c.elm._enterCb();\n  }\n}\n\nfunction recordPosition (c) {\n  c.data.newPos = c.elm.getBoundingClientRect();\n}\n\nfunction applyTranslation (c) {\n  var oldPos = c.data.pos;\n  var newPos = c.data.newPos;\n  var dx = oldPos.left - newPos.left;\n  var dy = oldPos.top - newPos.top;\n  if (dx || dy) {\n    c.data.moved = true;\n    var s = c.elm.style;\n    s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n    s.transitionDuration = '0s';\n  }\n}\n\nvar platformComponents = {\n  Transition: Transition,\n  TransitionGroup: TransitionGroup\n};\n\n/*  */\n\n// install platform specific utils\nVue$3.config.isUnknownElement = isUnknownElement;\nVue$3.config.isReservedTag = isReservedTag;\nVue$3.config.getTagNamespace = getTagNamespace;\nVue$3.config.mustUseProp = mustUseProp;\n\n// install platform runtime directives & components\nextend(Vue$3.options.directives, platformDirectives);\nextend(Vue$3.options.components, platformComponents);\n\n// install platform patch function\nVue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;\n\n// wrap mount\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && inBrowser ? query(el) : undefined;\n  return this._mount(el, hydrating)\n};\n\n// devtools global hook\n/* istanbul ignore next */\nsetTimeout(function () {\n  if (config.devtools) {\n    if (devtools) {\n      devtools.emit('init', Vue$3);\n    } else if (\n      \"development\" !== 'production' &&\n      inBrowser && /Chrome\\/\\d+/.test(window.navigator.userAgent)\n    ) {\n      console.log(\n        'Download the Vue Devtools for a better development experience:\\n' +\n        'https://github.com/vuejs/vue-devtools'\n      );\n    }\n  }\n}, 0);\n\n/*  */\n\n// check whether current browser encodes a char inside attribute values\nfunction shouldDecode (content, encoded) {\n  var div = document.createElement('div');\n  div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n  return div.innerHTML.indexOf(encoded) > 0\n}\n\n// #3663\n// IE encodes newlines inside attribute values while other browsers don't\nvar shouldDecodeNewlines = inBrowser ? shouldDecode('\\n', '&#10;') : false;\n\n/*  */\n\nvar decoder;\n\nfunction decode (html) {\n  decoder = decoder || document.createElement('div');\n  decoder.innerHTML = html;\n  return decoder.textContent\n}\n\n/*  */\n\nvar isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n  'link,meta,param,source,track,wbr',\n  true\n);\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nvar canBeLeftOpenTag = makeMap(\n  'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',\n  true\n);\n\n// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\nvar isNonPhrasingTag = makeMap(\n  'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n  'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n  'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n  'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n  'title,tr,track',\n  true\n);\n\n/**\n * Not type-checking this file because it's mostly vendor code.\n */\n\n/*!\n * HTML Parser By John Resig (ejohn.org)\n * Modified by Juriy \"kangax\" Zaytsev\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n */\n\n// Regular Expressions for parsing tags and attributes\nvar singleAttrIdentifier = /([^\\s\"'<>/=]+)/;\nvar singleAttrAssign = /(?:=)/;\nvar singleAttrValues = [\n  // attr value double quotes\n  /\"([^\"]*)\"+/.source,\n  // attr value, single quotes\n  /'([^']*)'+/.source,\n  // attr value, no quotes\n  /([^\\s\"'=<>`]+)/.source\n];\nvar attribute = new RegExp(\n  '^\\\\s*' + singleAttrIdentifier.source +\n  '(?:\\\\s*(' + singleAttrAssign.source + ')' +\n  '\\\\s*(?:' + singleAttrValues.join('|') + '))?'\n);\n\n// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName\n// but for Vue templates we can enforce a simple charset\nvar ncname = '[a-zA-Z_][\\\\w\\\\-\\\\.]*';\nvar qnameCapture = '((?:' + ncname + '\\\\:)?' + ncname + ')';\nvar startTagOpen = new RegExp('^<' + qnameCapture);\nvar startTagClose = /^\\s*(\\/?)>/;\nvar endTag = new RegExp('^<\\\\/' + qnameCapture + '[^>]*>');\nvar doctype = /^<!DOCTYPE [^>]+>/i;\nvar comment = /^<!--/;\nvar conditionalComment = /^<!\\[/;\n\nvar IS_REGEX_CAPTURING_BROKEN = false;\n'x'.replace(/x(.)?/g, function (m, g) {\n  IS_REGEX_CAPTURING_BROKEN = g === '';\n});\n\n// Special Elements (can contain anything)\nvar isScriptOrStyle = makeMap('script,style', true);\nvar hasLang = function (attr) { return attr.name === 'lang' && attr.value !== 'html'; };\nvar isSpecialTag = function (tag, isSFC, stack) {\n  if (isScriptOrStyle(tag)) {\n    return true\n  }\n  if (isSFC && stack.length === 1) {\n    // top-level template that has no pre-processor\n    if (tag === 'template' && !stack[0].attrs.some(hasLang)) {\n      return false\n    } else {\n      return true\n    }\n  }\n  return false\n};\n\nvar reCache = {};\n\nvar ltRE = /&lt;/g;\nvar gtRE = /&gt;/g;\nvar nlRE = /&#10;/g;\nvar ampRE = /&amp;/g;\nvar quoteRE = /&quot;/g;\n\nfunction decodeAttr (value, shouldDecodeNewlines) {\n  if (shouldDecodeNewlines) {\n    value = value.replace(nlRE, '\\n');\n  }\n  return value\n    .replace(ltRE, '<')\n    .replace(gtRE, '>')\n    .replace(ampRE, '&')\n    .replace(quoteRE, '\"')\n}\n\nfunction parseHTML (html, options) {\n  var stack = [];\n  var expectHTML = options.expectHTML;\n  var isUnaryTag$$1 = options.isUnaryTag || no;\n  var index = 0;\n  var last, lastTag;\n  while (html) {\n    last = html;\n    // Make sure we're not in a script or style element\n    if (!lastTag || !isSpecialTag(lastTag, options.sfc, stack)) {\n      var textEnd = html.indexOf('<');\n      if (textEnd === 0) {\n        // Comment:\n        if (comment.test(html)) {\n          var commentEnd = html.indexOf('-->');\n\n          if (commentEnd >= 0) {\n            advance(commentEnd + 3);\n            continue\n          }\n        }\n\n        // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n        if (conditionalComment.test(html)) {\n          var conditionalEnd = html.indexOf(']>');\n\n          if (conditionalEnd >= 0) {\n            advance(conditionalEnd + 2);\n            continue\n          }\n        }\n\n        // Doctype:\n        var doctypeMatch = html.match(doctype);\n        if (doctypeMatch) {\n          advance(doctypeMatch[0].length);\n          continue\n        }\n\n        // End tag:\n        var endTagMatch = html.match(endTag);\n        if (endTagMatch) {\n          var curIndex = index;\n          advance(endTagMatch[0].length);\n          parseEndTag(endTagMatch[0], endTagMatch[1], curIndex, index);\n          continue\n        }\n\n        // Start tag:\n        var startTagMatch = parseStartTag();\n        if (startTagMatch) {\n          handleStartTag(startTagMatch);\n          continue\n        }\n      }\n\n      var text = (void 0), rest$1 = (void 0), next = (void 0);\n      if (textEnd > 0) {\n        rest$1 = html.slice(textEnd);\n        while (\n          !endTag.test(rest$1) &&\n          !startTagOpen.test(rest$1) &&\n          !comment.test(rest$1) &&\n          !conditionalComment.test(rest$1)\n        ) {\n          // < in plain text, be forgiving and treat it as text\n          next = rest$1.indexOf('<', 1);\n          if (next < 0) { break }\n          textEnd += next;\n          rest$1 = html.slice(textEnd);\n        }\n        text = html.substring(0, textEnd);\n        advance(textEnd);\n      }\n\n      if (textEnd < 0) {\n        text = html;\n        html = '';\n      }\n\n      if (options.chars && text) {\n        options.chars(text);\n      }\n    } else {\n      var stackedTag = lastTag.toLowerCase();\n      var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n      var endTagLength = 0;\n      var rest = html.replace(reStackedTag, function (all, text, endTag) {\n        endTagLength = endTag.length;\n        if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {\n          text = text\n            .replace(/<!--([\\s\\S]*?)-->/g, '$1')\n            .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n        }\n        if (options.chars) {\n          options.chars(text);\n        }\n        return ''\n      });\n      index += html.length - rest.length;\n      html = rest;\n      parseEndTag('</' + stackedTag + '>', stackedTag, index - endTagLength, index);\n    }\n\n    if (html === last && options.chars) {\n      options.chars(html);\n      break\n    }\n  }\n\n  // Clean up any remaining tags\n  parseEndTag();\n\n  function advance (n) {\n    index += n;\n    html = html.substring(n);\n  }\n\n  function parseStartTag () {\n    var start = html.match(startTagOpen);\n    if (start) {\n      var match = {\n        tagName: start[1],\n        attrs: [],\n        start: index\n      };\n      advance(start[0].length);\n      var end, attr;\n      while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {\n        advance(attr[0].length);\n        match.attrs.push(attr);\n      }\n      if (end) {\n        match.unarySlash = end[1];\n        advance(end[0].length);\n        match.end = index;\n        return match\n      }\n    }\n  }\n\n  function handleStartTag (match) {\n    var tagName = match.tagName;\n    var unarySlash = match.unarySlash;\n\n    if (expectHTML) {\n      if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n        parseEndTag('', lastTag);\n      }\n      if (canBeLeftOpenTag(tagName) && lastTag === tagName) {\n        parseEndTag('', tagName);\n      }\n    }\n\n    var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;\n\n    var l = match.attrs.length;\n    var attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      var args = match.attrs[i];\n      // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778\n      if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('\"\"') === -1) {\n        if (args[3] === '') { delete args[3]; }\n        if (args[4] === '') { delete args[4]; }\n        if (args[5] === '') { delete args[5]; }\n      }\n      var value = args[3] || args[4] || args[5] || '';\n      attrs[i] = {\n        name: args[1],\n        value: decodeAttr(\n          value,\n          options.shouldDecodeNewlines\n        )\n      };\n    }\n\n    if (!unary) {\n      stack.push({ tag: tagName, attrs: attrs });\n      lastTag = tagName;\n      unarySlash = '';\n    }\n\n    if (options.start) {\n      options.start(tagName, attrs, unary, match.start, match.end);\n    }\n  }\n\n  function parseEndTag (tag, tagName, start, end) {\n    var pos;\n    if (start == null) { start = index; }\n    if (end == null) { end = index; }\n\n    // Find the closest opened tag of the same type\n    if (tagName) {\n      var needle = tagName.toLowerCase();\n      for (pos = stack.length - 1; pos >= 0; pos--) {\n        if (stack[pos].tag.toLowerCase() === needle) {\n          break\n        }\n      }\n    } else {\n      // If no tag name is provided, clean shop\n      pos = 0;\n    }\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (var i = stack.length - 1; i >= pos; i--) {\n        if (options.end) {\n          options.end(stack[i].tag, start, end);\n        }\n      }\n\n      // Remove the open elements from the stack\n      stack.length = pos;\n      lastTag = pos && stack[pos - 1].tag;\n    } else if (tagName.toLowerCase() === 'br') {\n      if (options.start) {\n        options.start(tagName, [], true, start, end);\n      }\n    } else if (tagName.toLowerCase() === 'p') {\n      if (options.start) {\n        options.start(tagName, [], false, start, end);\n      }\n      if (options.end) {\n        options.end(tagName, start, end);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction parseFilters (exp) {\n  var inSingle = false;\n  var inDouble = false;\n  var inTemplateString = false;\n  var inRegex = false;\n  var curly = 0;\n  var square = 0;\n  var paren = 0;\n  var lastFilterIndex = 0;\n  var c, prev, i, expression, filters;\n\n  for (i = 0; i < exp.length; i++) {\n    prev = c;\n    c = exp.charCodeAt(i);\n    if (inSingle) {\n      if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n    } else if (inDouble) {\n      if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n    } else if (inTemplateString) {\n      if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n    } else if (inRegex) {\n      if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n    } else if (\n      c === 0x7C && // pipe\n      exp.charCodeAt(i + 1) !== 0x7C &&\n      exp.charCodeAt(i - 1) !== 0x7C &&\n      !curly && !square && !paren\n    ) {\n      if (expression === undefined) {\n        // first filter, end of expression\n        lastFilterIndex = i + 1;\n        expression = exp.slice(0, i).trim();\n      } else {\n        pushFilter();\n      }\n    } else {\n      switch (c) {\n        case 0x22: inDouble = true; break         // \"\n        case 0x27: inSingle = true; break         // '\n        case 0x60: inTemplateString = true; break // `\n        case 0x2f: inRegex = true; break          // /\n        case 0x28: paren++; break                 // (\n        case 0x29: paren--; break                 // )\n        case 0x5B: square++; break                // [\n        case 0x5D: square--; break                // ]\n        case 0x7B: curly++; break                 // {\n        case 0x7D: curly--; break                 // }\n      }\n    }\n  }\n\n  if (expression === undefined) {\n    expression = exp.slice(0, i).trim();\n  } else if (lastFilterIndex !== 0) {\n    pushFilter();\n  }\n\n  function pushFilter () {\n    (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n    lastFilterIndex = i + 1;\n  }\n\n  if (filters) {\n    for (i = 0; i < filters.length; i++) {\n      expression = wrapFilter(expression, filters[i]);\n    }\n  }\n\n  return expression\n}\n\nfunction wrapFilter (exp, filter) {\n  var i = filter.indexOf('(');\n  if (i < 0) {\n    // _f: resolveFilter\n    return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n  } else {\n    var name = filter.slice(0, i);\n    var args = filter.slice(i + 1);\n    return (\"_f(\\\"\" + name + \"\\\")(\" + exp + \",\" + args)\n  }\n}\n\n/*  */\n\nvar defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g;\nvar regexEscapeRE = /[-.*+?^${}()|[\\]/\\\\]/g;\n\nvar buildRegex = cached(function (delimiters) {\n  var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n  var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n  return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n});\n\nfunction parseText (\n  text,\n  delimiters\n) {\n  var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n  if (!tagRE.test(text)) {\n    return\n  }\n  var tokens = [];\n  var lastIndex = tagRE.lastIndex = 0;\n  var match, index;\n  while ((match = tagRE.exec(text))) {\n    index = match.index;\n    // push text token\n    if (index > lastIndex) {\n      tokens.push(JSON.stringify(text.slice(lastIndex, index)));\n    }\n    // tag token\n    var exp = parseFilters(match[1].trim());\n    tokens.push((\"_s(\" + exp + \")\"));\n    lastIndex = index + match[0].length;\n  }\n  if (lastIndex < text.length) {\n    tokens.push(JSON.stringify(text.slice(lastIndex)));\n  }\n  return tokens.join('+')\n}\n\n/*  */\n\nfunction baseWarn (msg) {\n  console.error((\"[Vue parser]: \" + msg));\n}\n\nfunction pluckModuleFunction (\n  modules,\n  key\n) {\n  return modules\n    ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n    : []\n}\n\nfunction addProp (el, name, value) {\n  (el.props || (el.props = [])).push({ name: name, value: value });\n}\n\nfunction addAttr (el, name, value) {\n  (el.attrs || (el.attrs = [])).push({ name: name, value: value });\n}\n\nfunction addDirective (\n  el,\n  name,\n  rawName,\n  value,\n  arg,\n  modifiers\n) {\n  (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });\n}\n\nfunction addHandler (\n  el,\n  name,\n  value,\n  modifiers,\n  important\n) {\n  // check capture modifier\n  if (modifiers && modifiers.capture) {\n    delete modifiers.capture;\n    name = '!' + name; // mark the event as captured\n  }\n  if (modifiers && modifiers.once) {\n    delete modifiers.once;\n    name = '~' + name; // mark the event as once\n  }\n  var events;\n  if (modifiers && modifiers.native) {\n    delete modifiers.native;\n    events = el.nativeEvents || (el.nativeEvents = {});\n  } else {\n    events = el.events || (el.events = {});\n  }\n  var newHandler = { value: value, modifiers: modifiers };\n  var handlers = events[name];\n  /* istanbul ignore if */\n  if (Array.isArray(handlers)) {\n    important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n  } else if (handlers) {\n    events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n  } else {\n    events[name] = newHandler;\n  }\n}\n\nfunction getBindingAttr (\n  el,\n  name,\n  getStatic\n) {\n  var dynamicValue =\n    getAndRemoveAttr(el, ':' + name) ||\n    getAndRemoveAttr(el, 'v-bind:' + name);\n  if (dynamicValue != null) {\n    return parseFilters(dynamicValue)\n  } else if (getStatic !== false) {\n    var staticValue = getAndRemoveAttr(el, name);\n    if (staticValue != null) {\n      return JSON.stringify(staticValue)\n    }\n  }\n}\n\nfunction getAndRemoveAttr (el, name) {\n  var val;\n  if ((val = el.attrsMap[name]) != null) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      if (list[i].name === name) {\n        list.splice(i, 1);\n        break\n      }\n    }\n  }\n  return val\n}\n\nvar len;\nvar str;\nvar chr;\nvar index$1;\nvar expressionPos;\nvar expressionEndPos;\n\n/**\n * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)\n *\n * for loop possible cases:\n *\n * - test\n * - test[idx]\n * - test[test1[idx]]\n * - test[\"a\"][idx]\n * - xxx.test[a[a].test1[idx]]\n * - test.xxx.a[\"asa\"][test1[idx]]\n *\n */\n\nfunction parseModel (val) {\n  str = val;\n  len = str.length;\n  index$1 = expressionPos = expressionEndPos = 0;\n\n  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n    return {\n      exp: val,\n      idx: null\n    }\n  }\n\n  while (!eof()) {\n    chr = next();\n    /* istanbul ignore if */\n    if (isStringStart(chr)) {\n      parseString(chr);\n    } else if (chr === 0x5B) {\n      parseBracket(chr);\n    }\n  }\n\n  return {\n    exp: val.substring(0, expressionPos),\n    idx: val.substring(expressionPos + 1, expressionEndPos)\n  }\n}\n\nfunction next () {\n  return str.charCodeAt(++index$1)\n}\n\nfunction eof () {\n  return index$1 >= len\n}\n\nfunction isStringStart (chr) {\n  return chr === 0x22 || chr === 0x27\n}\n\nfunction parseBracket (chr) {\n  var inBracket = 1;\n  expressionPos = index$1;\n  while (!eof()) {\n    chr = next();\n    if (isStringStart(chr)) {\n      parseString(chr);\n      continue\n    }\n    if (chr === 0x5B) { inBracket++; }\n    if (chr === 0x5D) { inBracket--; }\n    if (inBracket === 0) {\n      expressionEndPos = index$1;\n      break\n    }\n  }\n}\n\nfunction parseString (chr) {\n  var stringQuote = chr;\n  while (!eof()) {\n    chr = next();\n    if (chr === stringQuote) {\n      break\n    }\n  }\n}\n\n/*  */\n\nvar dirRE = /^v-|^@|^:/;\nvar forAliasRE = /(.*?)\\s+(?:in|of)\\s+(.*)/;\nvar forIteratorRE = /\\((\\{[^}]*\\}|[^,]*),([^,]*)(?:,([^,]*))?\\)/;\nvar bindRE = /^:|^v-bind:/;\nvar onRE = /^@|^v-on:/;\nvar argRE = /:(.*)$/;\nvar modifierRE = /\\.[^.]+/g;\n\nvar decodeHTMLCached = cached(decode);\n\n// configurable state\nvar warn$1;\nvar platformGetTagNamespace;\nvar platformMustUseProp;\nvar platformIsPreTag;\nvar preTransforms;\nvar transforms;\nvar postTransforms;\nvar delimiters;\n\n/**\n * Convert HTML string to AST.\n */\nfunction parse (\n  template,\n  options\n) {\n  warn$1 = options.warn || baseWarn;\n  platformGetTagNamespace = options.getTagNamespace || no;\n  platformMustUseProp = options.mustUseProp || no;\n  platformIsPreTag = options.isPreTag || no;\n  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n  transforms = pluckModuleFunction(options.modules, 'transformNode');\n  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n  delimiters = options.delimiters;\n  var stack = [];\n  var preserveWhitespace = options.preserveWhitespace !== false;\n  var root;\n  var currentParent;\n  var inVPre = false;\n  var inPre = false;\n  var warned = false;\n  parseHTML(template, {\n    expectHTML: options.expectHTML,\n    isUnaryTag: options.isUnaryTag,\n    shouldDecodeNewlines: options.shouldDecodeNewlines,\n    start: function start (tag, attrs, unary) {\n      // check namespace.\n      // inherit parent ns if there is one\n      var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n      // handle IE svg bug\n      /* istanbul ignore if */\n      if (isIE && ns === 'svg') {\n        attrs = guardIESVGBug(attrs);\n      }\n\n      var element = {\n        type: 1,\n        tag: tag,\n        attrsList: attrs,\n        attrsMap: makeAttrsMap(attrs),\n        parent: currentParent,\n        children: []\n      };\n      if (ns) {\n        element.ns = ns;\n      }\n\n      if (isForbiddenTag(element) && !isServerRendering()) {\n        element.forbidden = true;\n        \"development\" !== 'production' && warn$1(\n          'Templates should only be responsible for mapping the state to the ' +\n          'UI. Avoid placing tags with side-effects in your templates, such as ' +\n          \"<\" + tag + \">.\"\n        );\n      }\n\n      // apply pre-transforms\n      for (var i = 0; i < preTransforms.length; i++) {\n        preTransforms[i](element, options);\n      }\n\n      if (!inVPre) {\n        processPre(element);\n        if (element.pre) {\n          inVPre = true;\n        }\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = true;\n      }\n      if (inVPre) {\n        processRawAttrs(element);\n      } else {\n        processFor(element);\n        processIf(element);\n        processOnce(element);\n        processKey(element);\n\n        // determine whether this is a plain element after\n        // removing structural attributes\n        element.plain = !element.key && !attrs.length;\n\n        processRef(element);\n        processSlot(element);\n        processComponent(element);\n        for (var i$1 = 0; i$1 < transforms.length; i$1++) {\n          transforms[i$1](element, options);\n        }\n        processAttrs(element);\n      }\n\n      function checkRootConstraints (el) {\n        if (\"development\" !== 'production' && !warned) {\n          if (el.tag === 'slot' || el.tag === 'template') {\n            warned = true;\n            warn$1(\n              \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n              'contain multiple nodes:\\n' + template\n            );\n          }\n          if (el.attrsMap.hasOwnProperty('v-for')) {\n            warned = true;\n            warn$1(\n              'Cannot use v-for on stateful component root element because ' +\n              'it renders multiple elements:\\n' + template\n            );\n          }\n        }\n      }\n\n      // tree management\n      if (!root) {\n        root = element;\n        checkRootConstraints(root);\n      } else if (!stack.length) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          checkRootConstraints(element);\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else if (\"development\" !== 'production' && !warned) {\n          warned = true;\n          warn$1(\n            \"Component template should contain exactly one root element:\" +\n            \"\\n\\n\" + template + \"\\n\\n\" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\"\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else if (element.slotScope) { // scoped slot\n          currentParent.plain = false;\n          var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n        } else {\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n      if (!unary) {\n        currentParent = element;\n        stack.push(element);\n      }\n      // apply post-transforms\n      for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {\n        postTransforms[i$2](element, options);\n      }\n    },\n\n    end: function end () {\n      // remove trailing whitespace\n      var element = stack[stack.length - 1];\n      var lastNode = element.children[element.children.length - 1];\n      if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {\n        element.children.pop();\n      }\n      // pop stack\n      stack.length -= 1;\n      currentParent = stack[stack.length - 1];\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n    },\n\n    chars: function chars (text) {\n      if (!currentParent) {\n        if (\"development\" !== 'production' && !warned && text === template) {\n          warned = true;\n          warn$1(\n            'Component template requires a root element, rather than just text:\\n\\n' + template\n          );\n        }\n        return\n      }\n      // IE textarea placeholder bug\n      /* istanbul ignore if */\n      if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text) {\n        return\n      }\n      text = inPre || text.trim()\n        ? decodeHTMLCached(text)\n        // only preserve whitespace if its not right after a starting tag\n        : preserveWhitespace && currentParent.children.length ? ' ' : '';\n      if (text) {\n        var expression;\n        if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {\n          currentParent.children.push({\n            type: 2,\n            expression: expression,\n            text: text\n          });\n        } else {\n          currentParent.children.push({\n            type: 3,\n            text: text\n          });\n        }\n      }\n    }\n  });\n  return root\n}\n\nfunction processPre (el) {\n  if (getAndRemoveAttr(el, 'v-pre') != null) {\n    el.pre = true;\n  }\n}\n\nfunction processRawAttrs (el) {\n  var l = el.attrsList.length;\n  if (l) {\n    var attrs = el.attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      attrs[i] = {\n        name: el.attrsList[i].name,\n        value: JSON.stringify(el.attrsList[i].value)\n      };\n    }\n  } else if (!el.pre) {\n    // non root node in pre blocks with no attributes\n    el.plain = true;\n  }\n}\n\nfunction processKey (el) {\n  var exp = getBindingAttr(el, 'key');\n  if (exp) {\n    if (\"development\" !== 'production' && el.tag === 'template') {\n      warn$1(\"<template> cannot be keyed. Place the key on real elements instead.\");\n    }\n    el.key = exp;\n  }\n}\n\nfunction processRef (el) {\n  var ref = getBindingAttr(el, 'ref');\n  if (ref) {\n    el.ref = ref;\n    el.refInFor = checkInFor(el);\n  }\n}\n\nfunction processFor (el) {\n  var exp;\n  if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) {\n      \"development\" !== 'production' && warn$1(\n        (\"Invalid v-for expression: \" + exp)\n      );\n      return\n    }\n    el.for = inMatch[2].trim();\n    var alias = inMatch[1].trim();\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      el.alias = iteratorMatch[1].trim();\n      el.iterator1 = iteratorMatch[2].trim();\n      if (iteratorMatch[3]) {\n        el.iterator2 = iteratorMatch[3].trim();\n      }\n    } else {\n      el.alias = alias;\n    }\n  }\n}\n\nfunction processIf (el) {\n  var exp = getAndRemoveAttr(el, 'v-if');\n  if (exp) {\n    el.if = exp;\n    addIfCondition(el, {\n      exp: exp,\n      block: el\n    });\n  } else {\n    if (getAndRemoveAttr(el, 'v-else') != null) {\n      el.else = true;\n    }\n    var elseif = getAndRemoveAttr(el, 'v-else-if');\n    if (elseif) {\n      el.elseif = elseif;\n    }\n  }\n}\n\nfunction processIfConditions (el, parent) {\n  var prev = findPrevElement(parent.children);\n  if (prev && prev.if) {\n    addIfCondition(prev, {\n      exp: el.elseif,\n      block: el\n    });\n  } else {\n    warn$1(\n      \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n      \"used on element <\" + (el.tag) + \"> without corresponding v-if.\"\n    );\n  }\n}\n\nfunction addIfCondition (el, condition) {\n  if (!el.ifConditions) {\n    el.ifConditions = [];\n  }\n  el.ifConditions.push(condition);\n}\n\nfunction processOnce (el) {\n  var once = getAndRemoveAttr(el, 'v-once');\n  if (once != null) {\n    el.once = true;\n  }\n}\n\nfunction processSlot (el) {\n  if (el.tag === 'slot') {\n    el.slotName = getBindingAttr(el, 'name');\n    if (\"development\" !== 'production' && el.key) {\n      warn$1(\n        \"`key` does not work on <slot> because slots are abstract outlets \" +\n        \"and can possibly expand into multiple elements. \" +\n        \"Use the key on a wrapping element instead.\"\n      );\n    }\n  } else {\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n    }\n    if (el.tag === 'template') {\n      el.slotScope = getAndRemoveAttr(el, 'scope');\n    }\n  }\n}\n\nfunction processComponent (el) {\n  var binding;\n  if ((binding = getBindingAttr(el, 'is'))) {\n    el.component = binding;\n  }\n  if (getAndRemoveAttr(el, 'inline-template') != null) {\n    el.inlineTemplate = true;\n  }\n}\n\nfunction processAttrs (el) {\n  var list = el.attrsList;\n  var i, l, name, rawName, value, arg, modifiers, isProp;\n  for (i = 0, l = list.length; i < l; i++) {\n    name = rawName = list[i].name;\n    value = list[i].value;\n    if (dirRE.test(name)) {\n      // mark element as dynamic\n      el.hasBindings = true;\n      // modifiers\n      modifiers = parseModifiers(name);\n      if (modifiers) {\n        name = name.replace(modifierRE, '');\n      }\n      if (bindRE.test(name)) { // v-bind\n        name = name.replace(bindRE, '');\n        value = parseFilters(value);\n        if (modifiers) {\n          if (modifiers.prop) {\n            isProp = true;\n            name = camelize(name);\n            if (name === 'innerHtml') { name = 'innerHTML'; }\n          }\n          if (modifiers.camel) {\n            name = camelize(name);\n          }\n        }\n        if (isProp || platformMustUseProp(el.tag, name)) {\n          addProp(el, name, value);\n        } else {\n          addAttr(el, name, value);\n        }\n      } else if (onRE.test(name)) { // v-on\n        name = name.replace(onRE, '');\n        addHandler(el, name, value, modifiers);\n      } else { // normal directives\n        name = name.replace(dirRE, '');\n        // parse arg\n        var argMatch = name.match(argRE);\n        if (argMatch && (arg = argMatch[1])) {\n          name = name.slice(0, -(arg.length + 1));\n        }\n        addDirective(el, name, rawName, value, arg, modifiers);\n        if (\"development\" !== 'production' && name === 'model') {\n          checkForAliasModel(el, value);\n        }\n      }\n    } else {\n      // literal attribute\n      {\n        var expression = parseText(value, delimiters);\n        if (expression) {\n          warn$1(\n            name + \"=\\\"\" + value + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.'\n          );\n        }\n      }\n      addAttr(el, name, JSON.stringify(value));\n    }\n  }\n}\n\nfunction checkInFor (el) {\n  var parent = el;\n  while (parent) {\n    if (parent.for !== undefined) {\n      return true\n    }\n    parent = parent.parent;\n  }\n  return false\n}\n\nfunction parseModifiers (name) {\n  var match = name.match(modifierRE);\n  if (match) {\n    var ret = {};\n    match.forEach(function (m) { ret[m.slice(1)] = true; });\n    return ret\n  }\n}\n\nfunction makeAttrsMap (attrs) {\n  var map = {};\n  for (var i = 0, l = attrs.length; i < l; i++) {\n    if (\"development\" !== 'production' && map[attrs[i].name] && !isIE) {\n      warn$1('duplicate attribute: ' + attrs[i].name);\n    }\n    map[attrs[i].name] = attrs[i].value;\n  }\n  return map\n}\n\nfunction findPrevElement (children) {\n  var i = children.length;\n  while (i--) {\n    if (children[i].tag) { return children[i] }\n  }\n}\n\nfunction isForbiddenTag (el) {\n  return (\n    el.tag === 'style' ||\n    (el.tag === 'script' && (\n      !el.attrsMap.type ||\n      el.attrsMap.type === 'text/javascript'\n    ))\n  )\n}\n\nvar ieNSBug = /^xmlns:NS\\d+/;\nvar ieNSPrefix = /^NS\\d+:/;\n\n/* istanbul ignore next */\nfunction guardIESVGBug (attrs) {\n  var res = [];\n  for (var i = 0; i < attrs.length; i++) {\n    var attr = attrs[i];\n    if (!ieNSBug.test(attr.name)) {\n      attr.name = attr.name.replace(ieNSPrefix, '');\n      res.push(attr);\n    }\n  }\n  return res\n}\n\nfunction checkForAliasModel (el, value) {\n  var _el = el;\n  while (_el) {\n    if (_el.for && _el.alias === value) {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"You are binding v-model directly to a v-for iteration alias. \" +\n        \"This will not be able to modify the v-for source array because \" +\n        \"writing to the alias is like modifying a function local variable. \" +\n        \"Consider using an array of objects and use v-model on an object property instead.\"\n      );\n    }\n    _el = _el.parent;\n  }\n}\n\n/*  */\n\nvar isStaticKey;\nvar isPlatformReservedTag;\n\nvar genStaticKeysCached = cached(genStaticKeys$1);\n\n/**\n * Goal of the optimizer: walk the generated template AST tree\n * and detect sub-trees that are purely static, i.e. parts of\n * the DOM that never needs to change.\n *\n * Once we detect these sub-trees, we can:\n *\n * 1. Hoist them into constants, so that we no longer need to\n *    create fresh nodes for them on each re-render;\n * 2. Completely skip them in the patching process.\n */\nfunction optimize (root, options) {\n  if (!root) { return }\n  isStaticKey = genStaticKeysCached(options.staticKeys || '');\n  isPlatformReservedTag = options.isReservedTag || no;\n  // first pass: mark all non-static nodes.\n  markStatic(root);\n  // second pass: mark static roots.\n  markStaticRoots(root, false);\n}\n\nfunction genStaticKeys$1 (keys) {\n  return makeMap(\n    'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +\n    (keys ? ',' + keys : '')\n  )\n}\n\nfunction markStatic (node) {\n  node.static = isStatic(node);\n  if (node.type === 1) {\n    // do not make component slot content static. this avoids\n    // 1. components not able to mutate slot nodes\n    // 2. static slot content fails for hot-reloading\n    if (\n      !isPlatformReservedTag(node.tag) &&\n      node.tag !== 'slot' &&\n      node.attrsMap['inline-template'] == null\n    ) {\n      return\n    }\n    for (var i = 0, l = node.children.length; i < l; i++) {\n      var child = node.children[i];\n      markStatic(child);\n      if (!child.static) {\n        node.static = false;\n      }\n    }\n  }\n}\n\nfunction markStaticRoots (node, isInFor) {\n  if (node.type === 1) {\n    if (node.static || node.once) {\n      node.staticInFor = isInFor;\n    }\n    // For a node to qualify as a static root, it should have children that\n    // are not just static text. Otherwise the cost of hoisting out will\n    // outweigh the benefits and it's better off to just always render it fresh.\n    if (node.static && node.children.length && !(\n      node.children.length === 1 &&\n      node.children[0].type === 3\n    )) {\n      node.staticRoot = true;\n      return\n    } else {\n      node.staticRoot = false;\n    }\n    if (node.children) {\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        markStaticRoots(node.children[i], isInFor || !!node.for);\n      }\n    }\n    if (node.ifConditions) {\n      walkThroughConditionsBlocks(node.ifConditions, isInFor);\n    }\n  }\n}\n\nfunction walkThroughConditionsBlocks (conditionBlocks, isInFor) {\n  for (var i = 1, len = conditionBlocks.length; i < len; i++) {\n    markStaticRoots(conditionBlocks[i].block, isInFor);\n  }\n}\n\nfunction isStatic (node) {\n  if (node.type === 2) { // expression\n    return false\n  }\n  if (node.type === 3) { // text\n    return true\n  }\n  return !!(node.pre || (\n    !node.hasBindings && // no dynamic bindings\n    !node.if && !node.for && // not v-if or v-for or v-else\n    !isBuiltInTag(node.tag) && // not a built-in\n    isPlatformReservedTag(node.tag) && // not a component\n    !isDirectChildOfTemplateFor(node) &&\n    Object.keys(node).every(isStaticKey)\n  ))\n}\n\nfunction isDirectChildOfTemplateFor (node) {\n  while (node.parent) {\n    node = node.parent;\n    if (node.tag !== 'template') {\n      return false\n    }\n    if (node.for) {\n      return true\n    }\n  }\n  return false\n}\n\n/*  */\n\nvar fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\nvar simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/;\n\n// keyCode aliases\nvar keyCodes = {\n  esc: 27,\n  tab: 9,\n  enter: 13,\n  space: 32,\n  up: 38,\n  left: 37,\n  right: 39,\n  down: 40,\n  'delete': [8, 46]\n};\n\nvar modifierCode = {\n  stop: '$event.stopPropagation();',\n  prevent: '$event.preventDefault();',\n  self: 'if($event.target !== $event.currentTarget)return;',\n  ctrl: 'if(!$event.ctrlKey)return;',\n  shift: 'if(!$event.shiftKey)return;',\n  alt: 'if(!$event.altKey)return;',\n  meta: 'if(!$event.metaKey)return;'\n};\n\nfunction genHandlers (events, native) {\n  var res = native ? 'nativeOn:{' : 'on:{';\n  for (var name in events) {\n    res += \"\\\"\" + name + \"\\\":\" + (genHandler(name, events[name])) + \",\";\n  }\n  return res.slice(0, -1) + '}'\n}\n\nfunction genHandler (\n  name,\n  handler\n) {\n  if (!handler) {\n    return 'function(){}'\n  } else if (Array.isArray(handler)) {\n    return (\"[\" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + \"]\")\n  } else if (!handler.modifiers) {\n    return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)\n      ? handler.value\n      : (\"function($event){\" + (handler.value) + \"}\")\n  } else {\n    var code = '';\n    var keys = [];\n    for (var key in handler.modifiers) {\n      if (modifierCode[key]) {\n        code += modifierCode[key];\n      } else {\n        keys.push(key);\n      }\n    }\n    if (keys.length) {\n      code = genKeyFilter(keys) + code;\n    }\n    var handlerCode = simplePathRE.test(handler.value)\n      ? handler.value + '($event)'\n      : handler.value;\n    return 'function($event){' + code + handlerCode + '}'\n  }\n}\n\nfunction genKeyFilter (keys) {\n  return (\"if(\" + (keys.map(genFilterCode).join('&&')) + \")return;\")\n}\n\nfunction genFilterCode (key) {\n  var keyVal = parseInt(key, 10);\n  if (keyVal) {\n    return (\"$event.keyCode!==\" + keyVal)\n  }\n  var alias = keyCodes[key];\n  return (\"_k($event.keyCode,\" + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + \")\")\n}\n\n/*  */\n\nfunction bind$2 (el, dir) {\n  el.wrapData = function (code) {\n    return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + \")\")\n  };\n}\n\nvar baseDirectives = {\n  bind: bind$2,\n  cloak: noop\n};\n\n/*  */\n\n// configurable state\nvar warn$2;\nvar transforms$1;\nvar dataGenFns;\nvar platformDirectives$1;\nvar staticRenderFns;\nvar onceCount;\nvar currentOptions;\n\nfunction generate (\n  ast,\n  options\n) {\n  // save previous staticRenderFns so generate calls can be nested\n  var prevStaticRenderFns = staticRenderFns;\n  var currentStaticRenderFns = staticRenderFns = [];\n  var prevOnceCount = onceCount;\n  onceCount = 0;\n  currentOptions = options;\n  warn$2 = options.warn || baseWarn;\n  transforms$1 = pluckModuleFunction(options.modules, 'transformCode');\n  dataGenFns = pluckModuleFunction(options.modules, 'genData');\n  platformDirectives$1 = options.directives || {};\n  var code = ast ? genElement(ast) : '_h(\"div\")';\n  staticRenderFns = prevStaticRenderFns;\n  onceCount = prevOnceCount;\n  return {\n    render: (\"with(this){return \" + code + \"}\"),\n    staticRenderFns: currentStaticRenderFns\n  }\n}\n\nfunction genElement (el) {\n  if (el.staticRoot && !el.staticProcessed) {\n    return genStatic(el)\n  } else if (el.once && !el.onceProcessed) {\n    return genOnce(el)\n  } else if (el.for && !el.forProcessed) {\n    return genFor(el)\n  } else if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.tag === 'template' && !el.slotTarget) {\n    return genChildren(el) || 'void 0'\n  } else if (el.tag === 'slot') {\n    return genSlot(el)\n  } else {\n    // component or element\n    var code;\n    if (el.component) {\n      code = genComponent(el.component, el);\n    } else {\n      var data = el.plain ? undefined : genData(el);\n\n      var children = el.inlineTemplate ? null : genChildren(el);\n      code = \"_h('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n    }\n    // module transforms\n    for (var i = 0; i < transforms$1.length; i++) {\n      code = transforms$1[i](el, code);\n    }\n    return code\n  }\n}\n\n// hoist static sub-trees out\nfunction genStatic (el) {\n  el.staticProcessed = true;\n  staticRenderFns.push((\"with(this){return \" + (genElement(el)) + \"}\"));\n  return (\"_m(\" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n}\n\n// v-once\nfunction genOnce (el) {\n  el.onceProcessed = true;\n  if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.staticInFor) {\n    var key = '';\n    var parent = el.parent;\n    while (parent) {\n      if (parent.for) {\n        key = parent.key;\n        break\n      }\n      parent = parent.parent;\n    }\n    if (!key) {\n      \"development\" !== 'production' && warn$2(\n        \"v-once can only be used inside v-for that is keyed. \"\n      );\n      return genElement(el)\n    }\n    return (\"_o(\" + (genElement(el)) + \",\" + (onceCount++) + (key ? (\",\" + key) : \"\") + \")\")\n  } else {\n    return genStatic(el)\n  }\n}\n\nfunction genIf (el) {\n  el.ifProcessed = true; // avoid recursion\n  return genIfConditions(el.ifConditions.slice())\n}\n\nfunction genIfConditions (conditions) {\n  if (!conditions.length) {\n    return '_e()'\n  }\n\n  var condition = conditions.shift();\n  if (condition.exp) {\n    return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions)))\n  } else {\n    return (\"\" + (genTernaryExp(condition.block)))\n  }\n\n  // v-if with v-once should generate code like (a)?_m(0):_m(1)\n  function genTernaryExp (el) {\n    return el.once ? genOnce(el) : genElement(el)\n  }\n}\n\nfunction genFor (el) {\n  var exp = el.for;\n  var alias = el.alias;\n  var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n  var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n  el.forProcessed = true; // avoid recursion\n  return \"_l((\" + exp + \"),\" +\n    \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n      \"return \" + (genElement(el)) +\n    '})'\n}\n\nfunction genData (el) {\n  var data = '{';\n\n  // directives first.\n  // directives may mutate the el's other properties before they are generated.\n  var dirs = genDirectives(el);\n  if (dirs) { data += dirs + ','; }\n\n  // key\n  if (el.key) {\n    data += \"key:\" + (el.key) + \",\";\n  }\n  // ref\n  if (el.ref) {\n    data += \"ref:\" + (el.ref) + \",\";\n  }\n  if (el.refInFor) {\n    data += \"refInFor:true,\";\n  }\n  // pre\n  if (el.pre) {\n    data += \"pre:true,\";\n  }\n  // record original tag name for components using \"is\" attribute\n  if (el.component) {\n    data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n  }\n  // module data generation functions\n  for (var i = 0; i < dataGenFns.length; i++) {\n    data += dataGenFns[i](el);\n  }\n  // attributes\n  if (el.attrs) {\n    data += \"attrs:{\" + (genProps(el.attrs)) + \"},\";\n  }\n  // DOM props\n  if (el.props) {\n    data += \"domProps:{\" + (genProps(el.props)) + \"},\";\n  }\n  // event handlers\n  if (el.events) {\n    data += (genHandlers(el.events)) + \",\";\n  }\n  if (el.nativeEvents) {\n    data += (genHandlers(el.nativeEvents, true)) + \",\";\n  }\n  // slot target\n  if (el.slotTarget) {\n    data += \"slot:\" + (el.slotTarget) + \",\";\n  }\n  // scoped slots\n  if (el.scopedSlots) {\n    data += (genScopedSlots(el.scopedSlots)) + \",\";\n  }\n  // inline-template\n  if (el.inlineTemplate) {\n    var inlineTemplate = genInlineTemplate(el);\n    if (inlineTemplate) {\n      data += inlineTemplate + \",\";\n    }\n  }\n  data = data.replace(/,$/, '') + '}';\n  // v-bind data wrap\n  if (el.wrapData) {\n    data = el.wrapData(data);\n  }\n  return data\n}\n\nfunction genDirectives (el) {\n  var dirs = el.directives;\n  if (!dirs) { return }\n  var res = 'directives:[';\n  var hasRuntime = false;\n  var i, l, dir, needRuntime;\n  for (i = 0, l = dirs.length; i < l; i++) {\n    dir = dirs[i];\n    needRuntime = true;\n    var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];\n    if (gen) {\n      // compile-time directive that manipulates AST.\n      // returns true if it also needs a runtime counterpart.\n      needRuntime = !!gen(el, dir, warn$2);\n    }\n    if (needRuntime) {\n      hasRuntime = true;\n      res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\\\"\" + (dir.arg) + \"\\\"\") : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n    }\n  }\n  if (hasRuntime) {\n    return res.slice(0, -1) + ']'\n  }\n}\n\nfunction genInlineTemplate (el) {\n  var ast = el.children[0];\n  if (\"development\" !== 'production' && (\n    el.children.length > 1 || ast.type !== 1\n  )) {\n    warn$2('Inline-template components must have exactly one child element.');\n  }\n  if (ast.type === 1) {\n    var inlineRenderFns = generate(ast, currentOptions);\n    return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n  }\n}\n\nfunction genScopedSlots (slots) {\n  return (\"scopedSlots:{\" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + \"}\")\n}\n\nfunction genScopedSlot (key, el) {\n  return key + \":function(\" + (String(el.attrsMap.scope)) + \"){\" +\n    \"return \" + (el.tag === 'template'\n      ? genChildren(el) || 'void 0'\n      : genElement(el)) + \"}\"\n}\n\nfunction genChildren (el) {\n  if (el.children.length) {\n    return '[' + el.children.map(genNode).join(',') + ']'\n  }\n}\n\nfunction genNode (node) {\n  if (node.type === 1) {\n    return genElement(node)\n  } else {\n    return genText(node)\n  }\n}\n\nfunction genText (text) {\n  return text.type === 2\n    ? text.expression // no need for () because already wrapped in _s()\n    : transformSpecialNewlines(JSON.stringify(text.text))\n}\n\nfunction genSlot (el) {\n  var slotName = el.slotName || '\"default\"';\n  var children = genChildren(el);\n  return (\"_t(\" + slotName + (children ? (\",\" + children) : '') + (el.attrs ? ((children ? '' : ',null') + \",{\" + (el.attrs.map(function (a) { return ((camelize(a.name)) + \":\" + (a.value)); }).join(',')) + \"}\") : '') + \")\")\n}\n\n// componentName is el.component, take it as argument to shun flow's pessimistic refinement\nfunction genComponent (componentName, el) {\n  var children = el.inlineTemplate ? null : genChildren(el);\n  return (\"_h(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}\n\nfunction genProps (props) {\n  var res = '';\n  for (var i = 0; i < props.length; i++) {\n    var prop = props[i];\n    res += \"\\\"\" + (prop.name) + \"\\\":\" + (transformSpecialNewlines(prop.value)) + \",\";\n  }\n  return res.slice(0, -1)\n}\n\n// #3895, #4268\nfunction transformSpecialNewlines (text) {\n  return text\n    .replace(/\\u2028/g, '\\\\u2028')\n    .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/*  */\n\n/**\n * Compile a template.\n */\nfunction compile$1 (\n  template,\n  options\n) {\n  var ast = parse(template.trim(), options);\n  optimize(ast, options);\n  var code = generate(ast, options);\n  return {\n    ast: ast,\n    render: code.render,\n    staticRenderFns: code.staticRenderFns\n  }\n}\n\n/*  */\n\n// operators like typeof, instanceof and in are allowed\nvar prohibitedKeywordRE = new RegExp('\\\\b' + (\n  'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n  'super,throw,while,yield,delete,export,import,return,switch,default,' +\n  'extends,finally,continue,debugger,function,arguments'\n).split(',').join('\\\\b|\\\\b') + '\\\\b');\n// check valid identifier for v-for\nvar identRE = /[A-Za-z_$][\\w$]*/;\n// strip strings in expressions\nvar stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n// detect problematic expressions in a template\nfunction detectErrors (ast) {\n  var errors = [];\n  if (ast) {\n    checkNode(ast, errors);\n  }\n  return errors\n}\n\nfunction checkNode (node, errors) {\n  if (node.type === 1) {\n    for (var name in node.attrsMap) {\n      if (dirRE.test(name)) {\n        var value = node.attrsMap[name];\n        if (value) {\n          if (name === 'v-for') {\n            checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), errors);\n          } else {\n            checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), errors);\n          }\n        }\n      }\n    }\n    if (node.children) {\n      for (var i = 0; i < node.children.length; i++) {\n        checkNode(node.children[i], errors);\n      }\n    }\n  } else if (node.type === 2) {\n    checkExpression(node.expression, node.text, errors);\n  }\n}\n\nfunction checkFor (node, text, errors) {\n  checkExpression(node.for || '', text, errors);\n  checkIdentifier(node.alias, 'v-for alias', text, errors);\n  checkIdentifier(node.iterator1, 'v-for iterator', text, errors);\n  checkIdentifier(node.iterator2, 'v-for iterator', text, errors);\n}\n\nfunction checkIdentifier (ident, type, text, errors) {\n  if (typeof ident === 'string' && !identRE.test(ident)) {\n    errors.push((\"- invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + text));\n  }\n}\n\nfunction checkExpression (exp, text, errors) {\n  try {\n    new Function((\"return \" + exp));\n  } catch (e) {\n    var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n    if (keywordMatch) {\n      errors.push(\n        \"- avoid using JavaScript keyword as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + text\n      );\n    } else {\n      errors.push((\"- invalid expression: \" + text));\n    }\n  }\n}\n\n/*  */\n\nfunction transformNode (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticClass = getAndRemoveAttr(el, 'class');\n  if (\"development\" !== 'production' && staticClass) {\n    var expression = parseText(staticClass, options.delimiters);\n    if (expression) {\n      warn(\n        \"class=\\\"\" + staticClass + \"\\\": \" +\n        'Interpolation inside attributes has been removed. ' +\n        'Use v-bind or the colon shorthand instead. For example, ' +\n        'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.'\n      );\n    }\n  }\n  if (staticClass) {\n    el.staticClass = JSON.stringify(staticClass);\n  }\n  var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n  if (classBinding) {\n    el.classBinding = classBinding;\n  }\n}\n\nfunction genData$1 (el) {\n  var data = '';\n  if (el.staticClass) {\n    data += \"staticClass:\" + (el.staticClass) + \",\";\n  }\n  if (el.classBinding) {\n    data += \"class:\" + (el.classBinding) + \",\";\n  }\n  return data\n}\n\nvar klass$1 = {\n  staticKeys: ['staticClass'],\n  transformNode: transformNode,\n  genData: genData$1\n};\n\n/*  */\n\nfunction transformNode$1 (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticStyle = getAndRemoveAttr(el, 'style');\n  if (staticStyle) {\n    /* istanbul ignore if */\n    {\n      var expression = parseText(staticStyle, options.delimiters);\n      if (expression) {\n        warn(\n          \"style=\\\"\" + staticStyle + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.'\n        );\n      }\n    }\n    el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n  }\n\n  var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n  if (styleBinding) {\n    el.styleBinding = styleBinding;\n  }\n}\n\nfunction genData$2 (el) {\n  var data = '';\n  if (el.staticStyle) {\n    data += \"staticStyle:\" + (el.staticStyle) + \",\";\n  }\n  if (el.styleBinding) {\n    data += \"style:(\" + (el.styleBinding) + \"),\";\n  }\n  return data\n}\n\nvar style$1 = {\n  staticKeys: ['staticStyle'],\n  transformNode: transformNode$1,\n  genData: genData$2\n};\n\nvar modules$1 = [\n  klass$1,\n  style$1\n];\n\n/*  */\n\nvar warn$3;\n\nfunction model$1 (\n  el,\n  dir,\n  _warn\n) {\n  warn$3 = _warn;\n  var value = dir.value;\n  var modifiers = dir.modifiers;\n  var tag = el.tag;\n  var type = el.attrsMap.type;\n  {\n    var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n    if (tag === 'input' && dynamicType) {\n      warn$3(\n        \"<input :type=\\\"\" + dynamicType + \"\\\" v-model=\\\"\" + value + \"\\\">:\\n\" +\n        \"v-model does not support dynamic input types. Use v-if branches instead.\"\n      );\n    }\n  }\n  if (tag === 'select') {\n    genSelect(el, value, modifiers);\n  } else if (tag === 'input' && type === 'checkbox') {\n    genCheckboxModel(el, value, modifiers);\n  } else if (tag === 'input' && type === 'radio') {\n    genRadioModel(el, value, modifiers);\n  } else {\n    genDefaultModel(el, value, modifiers);\n  }\n  // ensure runtime directive metadata\n  return true\n}\n\nfunction genCheckboxModel (\n  el,\n  value,\n  modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n  var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n  addProp(el, 'checked',\n    \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" +\n      \":_q(\" + value + \",\" + trueValueBinding + \")\"\n  );\n  addHandler(el, 'change',\n    \"var $$a=\" + value + \",\" +\n        '$$el=$event.target,' +\n        \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n    'if(Array.isArray($$a)){' +\n      \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n          '$$i=_i($$a,$$v);' +\n      \"if($$c){$$i<0&&(\" + value + \"=$$a.concat($$v))}\" +\n      \"else{$$i>-1&&(\" + value + \"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}\" +\n    \"}else{\" + value + \"=$$c}\",\n    null, true\n  );\n}\n\nfunction genRadioModel (\n    el,\n    value,\n    modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n  addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n  addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n}\n\nfunction genDefaultModel (\n  el,\n  value,\n  modifiers\n) {\n  {\n    if (el.tag === 'input' && el.attrsMap.value) {\n      warn$3(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" value=\\\"\" + (el.attrsMap.value) + \"\\\">:\\n\" +\n        'inline value attributes will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n    if (el.tag === 'textarea' && el.children.length) {\n      warn$3(\n        \"<textarea v-model=\\\"\" + value + \"\\\">:\\n\" +\n        'inline content inside <textarea> will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n  }\n\n  var type = el.attrsMap.type;\n  var ref = modifiers || {};\n  var lazy = ref.lazy;\n  var number = ref.number;\n  var trim = ref.trim;\n  var event = lazy || (isIE && type === 'range') ? 'change' : 'input';\n  var needCompositionGuard = !lazy && type !== 'range';\n  var isNative = el.tag === 'input' || el.tag === 'textarea';\n\n  var valueExpression = isNative\n    ? (\"$event.target.value\" + (trim ? '.trim()' : ''))\n    : trim ? \"(typeof $event === 'string' ? $event.trim() : $event)\" : \"$event\";\n  valueExpression = number || type === 'number'\n    ? (\"_n(\" + valueExpression + \")\")\n    : valueExpression;\n  var code = genAssignmentCode(value, valueExpression);\n  if (isNative && needCompositionGuard) {\n    code = \"if($event.target.composing)return;\" + code;\n  }\n  // inputs with type=\"file\" are read only and setting the input's\n  // value will throw an error.\n  if (\"development\" !== 'production' &&\n      type === 'file') {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n      \"File inputs are read only. Use a v-on:change listener instead.\"\n    );\n  }\n  addProp(el, 'value', isNative ? (\"_s(\" + value + \")\") : (\"(\" + value + \")\"));\n  addHandler(el, event, code, null, true);\n}\n\nfunction genSelect (\n    el,\n    value,\n    modifiers\n) {\n  {\n    el.children.some(checkOptionWarning);\n  }\n\n  var number = modifiers && modifiers.number;\n  var assignment = \"Array.prototype.filter\" +\n    \".call($event.target.options,function(o){return o.selected})\" +\n    \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n    \"return \" + (number ? '_n(val)' : 'val') + \"})\" +\n    (el.attrsMap.multiple == null ? '[0]' : '');\n\n  var code = genAssignmentCode(value, assignment);\n  addHandler(el, 'change', code, null, true);\n}\n\nfunction checkOptionWarning (option) {\n  if (option.type === 1 &&\n    option.tag === 'option' &&\n    option.attrsMap.selected != null) {\n    warn$3(\n      \"<select v-model=\\\"\" + (option.parent.attrsMap['v-model']) + \"\\\">:\\n\" +\n      'inline selected attributes on <option> will be ignored when using v-model. ' +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n    return true\n  }\n  return false\n}\n\nfunction genAssignmentCode (value, assignment) {\n  var modelRs = parseModel(value);\n  if (modelRs.idx === null) {\n    return (value + \"=\" + assignment)\n  } else {\n    return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n      \"if (!Array.isArray($$exp)){\" +\n        value + \"=\" + assignment + \"}\" +\n      \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n  }\n}\n\n/*  */\n\nfunction text (el, dir) {\n  if (dir.value) {\n    addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\n/*  */\n\nfunction html (el, dir) {\n  if (dir.value) {\n    addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\nvar directives$1 = {\n  model: model$1,\n  text: text,\n  html: html\n};\n\n/*  */\n\nvar cache = Object.create(null);\n\nvar baseOptions = {\n  expectHTML: true,\n  modules: modules$1,\n  staticKeys: genStaticKeys(modules$1),\n  directives: directives$1,\n  isReservedTag: isReservedTag,\n  isUnaryTag: isUnaryTag,\n  mustUseProp: mustUseProp,\n  getTagNamespace: getTagNamespace,\n  isPreTag: isPreTag\n};\n\nfunction compile$$1 (\n  template,\n  options\n) {\n  options = options\n    ? extend(extend({}, baseOptions), options)\n    : baseOptions;\n  return compile$1(template, options)\n}\n\nfunction compileToFunctions (\n  template,\n  options,\n  vm\n) {\n  var _warn = (options && options.warn) || warn;\n  // detect possible CSP restriction\n  /* istanbul ignore if */\n  {\n    try {\n      new Function('return 1');\n    } catch (e) {\n      if (e.toString().match(/unsafe-eval|CSP/)) {\n        _warn(\n          'It seems you are using the standalone build of Vue.js in an ' +\n          'environment with Content Security Policy that prohibits unsafe-eval. ' +\n          'The template compiler cannot work in this environment. Consider ' +\n          'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n          'templates into render functions.'\n        );\n      }\n    }\n  }\n  var key = options && options.delimiters\n    ? String(options.delimiters) + template\n    : template;\n  if (cache[key]) {\n    return cache[key]\n  }\n  var res = {};\n  var compiled = compile$$1(template, options);\n  res.render = makeFunction(compiled.render);\n  var l = compiled.staticRenderFns.length;\n  res.staticRenderFns = new Array(l);\n  for (var i = 0; i < l; i++) {\n    res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);\n  }\n  {\n    if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {\n      _warn(\n        \"failed to compile template:\\n\\n\" + template + \"\\n\\n\" +\n        detectErrors(compiled.ast).join('\\n') +\n        '\\n\\n',\n        vm\n      );\n    }\n  }\n  return (cache[key] = res)\n}\n\nfunction makeFunction (code) {\n  try {\n    return new Function(code)\n  } catch (e) {\n    return noop\n  }\n}\n\n/*  */\n\nvar idToTemplate = cached(function (id) {\n  var el = query(id);\n  return el && el.innerHTML\n});\n\nvar mount = Vue$3.prototype.$mount;\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && query(el);\n\n  /* istanbul ignore if */\n  if (el === document.body || el === document.documentElement) {\n    \"development\" !== 'production' && warn(\n      \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n    );\n    return this\n  }\n\n  var options = this.$options;\n  // resolve template/el and convert to render function\n  if (!options.render) {\n    var template = options.template;\n    if (template) {\n      if (typeof template === 'string') {\n        if (template.charAt(0) === '#') {\n          template = idToTemplate(template);\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !template) {\n            warn(\n              (\"Template element not found or is empty: \" + (options.template)),\n              this\n            );\n          }\n        }\n      } else if (template.nodeType) {\n        template = template.innerHTML;\n      } else {\n        {\n          warn('invalid template option:' + template, this);\n        }\n        return this\n      }\n    } else if (el) {\n      template = getOuterHTML(el);\n    }\n    if (template) {\n      var ref = compileToFunctions(template, {\n        warn: warn,\n        shouldDecodeNewlines: shouldDecodeNewlines,\n        delimiters: options.delimiters\n      }, this);\n      var render = ref.render;\n      var staticRenderFns = ref.staticRenderFns;\n      options.render = render;\n      options.staticRenderFns = staticRenderFns;\n    }\n  }\n  return mount.call(this, el, hydrating)\n};\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n */\nfunction getOuterHTML (el) {\n  if (el.outerHTML) {\n    return el.outerHTML\n  } else {\n    var container = document.createElement('div');\n    container.appendChild(el.cloneNode(true));\n    return container.innerHTML\n  }\n}\n\nVue$3.compile = compileToFunctions;\n\nreturn Vue$3;\n\n})));"
  },
  {
    "path": "integrate/login/login.css",
    "content": ".login {\n\twidth:600px;\n\tmargin:100px auto 0;\n}\n.login div {\n\tmargin:10px;\n}\n.login button{\n\tmargin-left:2.4em;\n}"
  },
  {
    "path": "integrate/login/login.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>登录</title>\n</head>\n<body>\n\n<!-- common -->\n<script src=\"../lib/jquery-3.1.1.js\"></script>\n<script src=\"../lib/vue-2.1.4.js\"></script>\n<link rel=\"stylesheet\" href=\"../reset.css\">\n\n<!-- login -->\n<link rel=\"stylesheet\" href=\"login.css\">\n\n<div class=\"login\" id=\"login\">\n\t<div class=\"name\">\n\t\t<label for=\"\">手机</label>\n\t\t<input type=\"text\" value=\"13912345678\">\n\t</div>\n\t<div class=\"password\">\n\t\t<label for=\"\">密码</label>\n\t\t<input type=\"password\" value=\"P@ssw0rd\">\n\t</div>\n\t<div class=\"btn\">\n\t\t<button class=\"button\" onclick=\"login()\">登录</button>\n\t</div>\n</div>\n\n<script src=\"login.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "integrate/login/login.js",
    "content": "function login(id){\n\tvar data = {\n\t\t\"region\": 86,\n\t\t\"phone\": $(\".name input\").eq(0).val()/1,\n\t\t\"password\": $(\".password input\").eq(0).val()\n\t};\n\n\t$.post(\"login.json\", function(data){\n\t\tif(data.code == 200){\n\t\t\tvar result = data.result;\n\t\t\tvar token = result.token;\n\t\t\t\n\t\t\talert(token);\n\n\t\t\t//use token+appKey connect\n\t\t}\n\t});\n}"
  },
  {
    "path": "integrate/login/login.json",
    "content": "{\n\t\"code\": 200,\n\t\"result\": {\n\t\t\"id\": \"rongcloud\",\n\t\t\"token\": \"C4nEgo1TK0Ly6xxxxxx\",\n\n\t\t\"name\" : \"融云\",\n\t\t\"portraitUri\" : \"https://developer.rongcloud.cn/static/imgs/logo.png\"\n\t}\n}"
  },
  {
    "path": "integrate/message/message-guide.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>发送消息的功能增强 集成引导</title>\n</head>\n<link rel=\"stylesheet\" href=\"../integrate.css\">\n<body>\n<div class=\"wrap\">\n    <h1>发送消息的功能增强 集成引导</h1>\n\t<p>图片消息，文件消息，自定义消息</p>\n\t<p>消息接口文档: <a href=\"http://www.rongcloud.cn/docs/web_api_demo.html#message\">http://www.rongcloud.cn/docs/web_api_demo.html#message</a></p>\n\t<p>集成 demo: <a href=\"message.html\">message.html</a></p>\n    <div class=\"guide\">\n        <div class=\"steps\">\n            <h2>1.图片消息</h2>\n            <div class=\"content\">\n\t\t\t\t<p>模拟接收图片消息的数据: <a href=\"message.json\">message.json</a> 中的 \"messageType\" 为 \"ImageMessage\"</p>\n\t\t\t\t<p>模拟发送服务器图片: <a href=\"//developer.rongcloud.cn\">开发者站点</a> => API 调试 => 发送单聊消息 =>   \"objectName\" == \"RC:ImgMsg\"</p>\n\t\t\t\t<p>1.上传图片,</p>\n\t\t\t\t<p>上传插件文档: <a href=\"http://www.rongcloud.cn/docs/web.html#upload_widget\">http://www.rongcloud.cn/docs/web.html#upload_widget</a></p>\n\t\t\t\t<p>图片上传插件以七牛云为例，依次引入 <a href=\"upload/qiniu.js\">qiniu.js</a>，<a href=\"upload/upload.js\">upload.js</a>，<a href=\"upload/uploadInit.js\">uploadInit.js</a>，为上传按钮添加监听事件，<a href=\"message.js\">message.js</a> 中 watchUpload 方法</p>\n\t\t\t\t<p>2.上传图片后，生成图片消息 createMessage</p>\n\t\t\t\t<p>3.调用 sendMessage 发送图片消息</p>\n<pre>\ninstance.sendMessage(conversationType, targetId, msg, {\n\t\tonSuccess: function (message) {\n\t\t\tconsole.log(\"Send successfully\");\n\t\t}\n\t}\n);\n</pre>\n\n            </div>\n        </div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>2.文件消息</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>模拟接收文件消息的数据 : <a href=\"message.json\">message.json</a> 中的 \"messageType\" 为 \"FileMessage\"</p>\n\t\t\t\t<p>实现方法同图片消息</p>\n\t\t\t</div>\n\t\t</div>\n\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>3.自定义消息</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>1.定义消息类型</p>\n<pre>\nvar messageName = \"PersonMessage\"; // 消息名称。\nvar objectName = \"s:person\"; // 消息内置名称，请按照此格式命名。\nvar mesasgeTag = new RongIMLib.MessageTag(true,true);// 消息是否保存是否计数，true true 保存且计数，false false 不保存不计数。\nvar propertys = [\"name\",\"age\"]; // 消息类中的属性名。\nRongIMClient.registerMessageType(messageName,objectName,mesasgeTag,propertys);\n</pre>\n\t\t\t\t<p>2.发送消息</p>\n<pre>\nvar conversationType = RongIMLib.ConversationType.PRIVATE; //私聊,其他会话选择相应的消息类型即可。\nvar msg = new RongIMClient.RegisterMessage.PersonMessage({name:\"zhang\",age:12});\ninstance.sendMessage(conversationType,targetId, msg, {\n    onSuccess: function (message) {\n    }\n});\n</pre>\n\t\t\t\t<p>3.接收消息</p>\n\t\t\t\t<p>接收消息与其他内置消息一致，在上文中提到的 setOnReceiveMessageListener 中 onReceived 获取</p>\n\t\t\t\t<br>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n</div>\n\n\n</body>\n</html>"
  },
  {
    "path": "integrate/message/message.css",
    "content": "/* header */\n\n.header {\n    position: absolute;\n    display: flex;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 1.16rem;\n    line-height: 1.16rem;\n    background: #393a3f;\n    z-index: 99;\n    color: #fff;\n}\n\n.header .title {\n    flex: 1;\n    font-size: 0.45rem;\n    padding:0 0.3rem;\n    text-align: center;\n}\n\n/* chat */\n.chat-content {\n    position: absolute;\n    z-index: 1;\n    top: 1.16rem;\n    bottom: 1.21rem;\n    left: 0;\n    width: 100%;\n    overflow-y: scroll;\n    background-color: #ebebeb;\n}\n\n.chat-content .message-wrapper {\n    padding: 0 0.5rem;\n}\n\n.message-item:nth-child(n+1) {\n    margin-top: 0.4rem;\n}\n\n.message-item:last-child {\n    margin-bottom: 0.4rem;\n}\n\n.message-text {\n    display: flex;\n    font-size: 0.4rem;\n}\n\n.my-msg .message-text {\n    flex-direction: row-reverse;\n}\n\n.you-msg .message-text {\n    padding-left: 1.39rem;\n}\n\n.message-item .rong-avatar {\n    flex-shrink: 0;\n    width: 1.1rem;\n    height: 1.1rem;\n    overflow: hidden;\n}\n\n.message-item .rong-avatar img {\n    width: 100%;\n}\n\n.message-text .message-body {\n    position: relative;\n    color: #353535;\n    padding: 0.25rem;\n    max-width: 100%;\n    min-height: 1em;\n    display: inline-block;\n    vertical-align: top;\n    text-align: left;\n    border-radius: 3px;\n    -moz-border-radius: 3px;\n    -webkit-border-radius: 3px;\n}\n\n.message-text .message-body pre {\n    white-space: normal;\n}\n\n.my-msg .message-text .message-body {\n    margin-right: 0.25rem;\n    background: #b2e281;\n}\n\n.my-msg .message-text .message-body:after {\n    position: absolute;\n    top: 0.32rem;\n    right: -0.3rem;\n    border: 0.2rem solid transparent;\n    content: \" \";\n    border-left-color: #b2e281;\n    border-left-width: 0.15rem;\n}\n\n.your-msg .message-text .message-body {\n    margin-left: 0.25rem;\n    background: #fff;\n}\n\n.your-msg .message-text .message-body:before {\n    position: absolute;\n    top: 0.32rem;\n    left: -0.3rem;\n    border: 0.2rem solid transparent;\n    content: \" \";\n    border-right-color: #fff;\n    border-right-width: 0.15rem;\n\n}\n\n.message-img {\n    display: flex;\n}\n\n.message-img img {\n    width: 100%;\n}\n\n.my-msg .message-img {\n    flex-direction: row-reverse;\n}\n\n.my-msg .message-img .message-body {\n    margin-right: 0.25rem;\n}\n\n.your-msg .message-img .message-body {\n    margin-left: 0.25rem;\n}\n\n\n.message-file {\n    display: flex;\n    font-size: 0.4rem;\n}\n.message-file img {\n    width: 100%;\n}\n\n.message-file .message-body{\n    display: flex;\n    border: 1px solid #ccc;\n    padding: 0.2rem;\n    border-radius: 0.2rem;\n}\n.file-ava{\n    flex-shrink: 0;\n    width: 1.1rem;\n    height: 1.1rem;\n    margin-right: 0.2rem;\n}\n.file-info{\n    margin-right: 0.2rem;\n}\n.file-name{\n    color: #343434;\n}\n.file-size{\n    color: #8e969f;\n    font-size: 0.36rem;\n}\n.file-download{\n    width: 0.7rem;\n    height: 0.7rem;\n    flex-shrink: 0;\n    background-image: url(\"http://web.sealtalk.im/assets/img/uploadbtn.png\");\n    background-repeat: no-repeat;\n    background-position: 0 -0.73rem;\n    background-size: 1.44rem auto;\n    font-size: 0;\n    align-self: center;\n}\n.my-msg .message-file {\n    flex-direction: row-reverse;\n}\n\n.my-msg .message-file .message-body {\n    margin-right: 0.25rem;\n}\n\n.your-msg .message-file .message-body {\n    margin-left: 0.25rem;\n}\n/* footer */\n.footer {\n    display: flex;\n    height: 1.20625rem;\n    line-height: 1.20625rem;\n    position: absolute;\n    left: 0;\n    bottom: 0;\n    width: 100%;\n    text-align: center;\n    z-index: 99;\n    background-color: #f8f8f8;\n}\n\n.footer .message-wrap {\n    flex: 1;\n    overflow: hidden;\n    padding: 0.321538rem 0;\n}\n\n.footer .message-content {\n    padding: 0 0.386rem;\n    width: 100%;\n    background-color: #f8f8f8;\n    resize: none;\n    line-height: 0.6369rem;\n    border: none;\n    font-size: 0.375rem;\n}\n\n.footer .send-btn,\n.footer .send-img,\n.footer .upload-img,\n.footer .send-file,\n.footer .upload-file {\n    display: inline-block;\n    width: 1.4rem;\n    height: 0.7rem;\n    font-size: 0.4rem;\n    color: #fff;\n    border: 1px solid #179e16;\n    border-radius: 3px;\n    background-color: #1aad19;\n    line-height: 0.7rem;\n    margin-top: 0.25rem;\n    margin-right: 0.4rem;\n}\n\n.footer .send-img {\n    position: relative;\n}\n\n.footer .upload-img {\n    position: absolute;\n    top: 0;\n    left: 0;\n    opacity: 0;\n    margin: 0;\n}\n.footer .send-file {\n    position: relative;\n}\n\n.footer .upload-file {\n    position: absolute;\n    top: 0;\n    left: 0;\n    opacity: 0;\n    margin: 0;\n}"
  },
  {
    "path": "integrate/message/message.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no\">\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">\n    <meta name=\"format-detection\" content=\"telephone=no\"/>\n    <meta name=\"format-detection\" content=\"address=no\">\n    <title>message demo</title>\n    <link rel=\"stylesheet\" href=\"../reset.css\">\n    <link rel=\"stylesheet\" href=\"message.css\">\n\n    <script src=\"../lib/jquery-3.1.1.js\"></script>\n    <script src=\"../lib/vue-2.1.4.js\"></script>\n    <script src=\"upload/qiniu.js\"></script>\n    <script src=\"upload/upload.js\"></script>\n    <script src=\"upload/uploadInit.js\"></script>\n    <script src=\"//cdn.ronghub.com/RongIMLib-2.5.0.js\"></script>\n\n\n    <script src=\"../init.js\"></script>\n    <script src=\"message.js\"></script>\n\n</head>\n<body>\n<div id=\"messagePage\">\n    <component :is=\"stat.currentView\" :stat=\"stat\"></component>\n</div>\n</body>\n<template id=\"message\">\n    <div class=\"message\">\n        <!--header-->\n        <header class=\"header\">\n            <h2 class=\"title\">{{stat.currentUserInfo.nickname}}</h2>\n        </header>\n        <!--header-->\n\n        <!--chat-content-->\n        <div class=\"chat-content\">\n            <div class=\"message-wrapper\">\n                <div class=\"message-item\" v-for=\"msg in stat.messageList\"\n                     :class=\"[msg.messageDirection == 1 ? 'my-msg' : 'your-msg']\">\n                    <div v-if=\"msg.messageType == 'TextMessage'\" class=\"message-text\">\n                        <div class=\"rong-avatar\">\n                            <img v-if=\"msg.messageDirection == 1\" :src=\"stat.currentUserInfo.portraitUri\"\n                                 class=\"rong-avatar-bd\">\n                            <img v-else :src=\"stat.targetUserInfo.portraitUri\" class=\"rong-avatar-bd\">\n                        </div>\n                        <div class=\"message-body\">\n                            <pre class=\"user-msg\">{{msg.content.content}}</pre>\n                        </div>\n                    </div>\n\n                    <div v-if=\"msg.messageType == 'ImageMessage'\" class=\"message-img\">\n                        <div class=\"rong-avatar\">\n                            <img v-if=\"msg.messageDirection == 1\" :src=\"stat.currentUserInfo.portraitUri\"\n                                 class=\"rong-avatar-bd\">\n                            <img v-else :src=\"stat.targetUserInfo.portraitUri\" class=\"rong-avatar-bd\">\n                        </div>\n                        <div class=\"message-body\">\n                            <img class=\"image-message\" :src=\"msg.content.imageUri\" alt=\"image\">\n                        </div>\n                    </div>\n\n                    <div v-if=\"msg.messageType == 'FileMessage'\" class=\"message-file\">\n                        <div class=\"rong-avatar\">\n                            <img v-if=\"msg.messageDirection == 1\" :src=\"stat.currentUserInfo.portraitUri\"\n                                 class=\"rong-avatar-bd\">\n                            <img v-else :src=\"stat.targetUserInfo.portraitUri\" class=\"rong-avatar-bd\">\n                        </div>\n                        <div class=\"message-body\">\n                            <div class=\"file-ava\"><img ng-src=\"assets/img/undefined.png\" src=\"http://web.sealtalk.im/assets/img/undefined.png\"></div>\n                            <div class=\"file-info\"><p class=\"file-name\">{{msg.content.name}}</p><p class=\"file-size\">{{msg.content.size/1000}} K</p></div>\n                            <a class=\"file-download\" :href=\"msg.content.fileUrl\" target=\"_blank\">下载</a>\n                        </div>\n                    </div>\n\n                    <div v-if=\"msg.messageType == 'PersonMessage'\" class=\"message-text\">\n                        <div class=\"rong-avatar\">\n                            <img v-if=\"msg.messageDirection == 1\" :src=\"stat.currentUserInfo.portraitUri\"\n                                 class=\"rong-avatar-bd\">\n                            <img v-else :src=\"stat.targetUserInfo.portraitUri\" class=\"rong-avatar-bd\">\n                        </div>\n                        <div class=\"message-body\">\n                            <pre class=\"user-msg\">{{msg.content.content}}（自定义消息）</pre>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <!--chat-content-->\n\n        <!--footer-->\n        <footer class=\"footer\">\n            <div class=\"message-wrap\"><textarea v-model=\"stat.sendMsgVal\" id=\"message-content\" placeholder=\"请输入文字...\"\n                                                class=\"message-content\"></textarea></div>\n\n            <span class=\"send-img\"><input type=\"file\" id=\"upload-img\" value=\"upload-file\" class=\"upload-img\">图片</span>\n            <span class=\"send-file\"><input type=\"file\" id=\"upload-file\" value=\"upload-file\" class=\"upload-file\">文件</span>\n            <span class=\"send-btn\" @touchend=\"sendMsg\">发送</span>\n            <span class=\"send-btn\" @touchend=\"sendPersonal\">自定义</span>\n        </footer>\n        <!--footer-->\n    </div>\n</template>\n<script type=\"text/javascript\">\n\n    //初始化\n    var app;\n    var userInfo = {\n        appKey: \"82hegw5u8mqwx\",\n        token: \"oUh0wcHH6E2LiuTpEKp/+jCvQwRQ4mI0ws9X674LamLVDfNK14vl8UoEcZT0otHeuyNsIi1T4wZ8UwVl0ZqyZA==\"\n    };\n    var callbacks = {\n        CONNECTED: function (instance) { //传入实例参数\n            //注册自定义消息\n            registerMessage();\n\n            //获取历史消息\n            var conversationType = RongIMLib.ConversationType.PRIVATE;\n            var targetId = 'user2';\n            instance.getHistoryMessages(conversationType, targetId, null, 20, {\n                onSuccess: function (list, hasMsg) {\n                    console.log(list);\n                    //渲染会话列表\n                    app = renderHistoryMessages(list, hasMsg, instance);\n                }\n            }, null);\n\n        },\n        Success: function (id) {\n\n        },\n        Received: function (message) {\n            console.log(message);\n            app.stat.messageList.push(message);\n        }\n    };\n    init(userInfo, callbacks);\n</script>\n</html>"
  },
  {
    "path": "integrate/message/message.js",
    "content": "function renderHistoryMessages(list, hasMsg, instance) {\n    return new Vue({\n        el: '#messagePage',\n        data: {\n            stat: {\n                currentView: 'message',\n                currentUserInfo: {\n                    \"id\": \"user1\",\n                    \"nickname\": \"产品\",\n                    \"region\": \"86\",\n                    \"phone\": \"13269772701\",\n                    \"portraitUri\": \"http://img.duoziwang.com/2016/12/08/18594927932.jpg\"\n                },\n                targetUserInfo: {\n                    \"id\": \"user2\",\n                    \"nickname\": \"开发\",\n                    \"region\": \"86\",\n                    \"phone\": \"13269772702\",\n                    \"portraitUri\": \"http://www.tshseo.com/uploads/allimg/141012/21130U347-12.jpg\"\n                },\n                messageList: list,\n                sendMsgVal: ''\n            }\n        },\n        components: {\n            message: {\n                props: ['stat'],\n                template: '#message',\n                methods: {\n                    sendMsg: function () {\n                        var text = this.stat.sendMsgVal;\n                        if (!text) {\n                            return false;\n                        }\n                        var msg = new RongIMLib.TextMessage({content: text, extra: \"附加信息\"});\n                        var conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n                        var targetId = \"user2\"; // 目标 Id\n                        var that = this;\n                        instance.sendMessage(conversationType, targetId, msg, {\n                                // 发送消息成功\n                                onSuccess: function (message) {\n                                    that.stat.sendMsgVal = '';\n                                    that.stat.messageList.push(message);\n                                    that.$nextTick(that.scrollEnd);\n                                }\n                            }\n                        );\n                    },\n                    scrollEnd: function () {\n                        //添加完消息 跳转到最后一条\n                        var list = document.querySelectorAll('.message-item');\n                        if (list.length > 1) {\n                            var last = list[list.length - 1];\n                            last.scrollIntoView();\n                        }\n                    },\n                    sendImg:function (msg) {\n\n                        var that=this;\n\n                        var conversationtype = RongIMLib.ConversationType.PRIVATE; // 私聊,其他会话选择相应的消息类型即可。\n                        var targetId = this.stat.targetUserInfo.id; // 目标 Id\n                        RongIMClient.getInstance().sendMessage(conversationtype, targetId, msg, {\n                                onSuccess: function (message) {\n                                    console.log(\"Send \" + message.messageType + \" successfully\");\n                                    console.log(message);\n                                    that.stat.messageList.push(message);\n                                    that.$nextTick(that.scrollEnd);\n                                }\n                            }\n                        );\n                    },\n                    sendPersonal:function () {\n                        var text = this.stat.sendMsgVal || 'personalMsg';\n                        var msg = new RongIMClient.RegisterMessage.PersonMessage({content:text,type:\"personal\"});\n                        var conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n                        var targetId = \"user2\"; // 目标 Id\n                        var that = this;\n                        instance.sendMessage(conversationType, targetId, msg, {\n                                // 发送消息成功\n                                onSuccess: function (message) {\n                                    that.stat.sendMsgVal = '';\n                                    that.stat.messageList.push(message);\n                                    that.$nextTick(that.scrollEnd);\n                                }\n                            }\n                        );\n                    }\n                },\n                mounted: function () {\n                    this.scrollEnd();\n                    var that=this;\n                    watchUpload(instance,that);\n                }\n            }\n        }\n    });\n}\n\n\nfunction watchUpload(im,that){\n\n    var messageItem = {\n        file: function(file){\n            var name = file.name || '',\n                index = name.lastIndexOf('.') + 1,\n                type = name.substring(index);\n\n            // 发送文件消息请参考： http://rongcloud.cn/docs/web_api_demo.html#发送消息\n            // 创建文件消息\n            return new RongIMLib.FileMessage({ name: file.name, size: file.size, type: type, fileUrl: file.downloadUrl});\n        },\n        image: function(image){\n            return new RongIMLib.ImageMessage({content: image.thumbnail, imageUri: image.downloadUrl});\n        }\n    };\n    var createMessage = function(file){\n\n        var msg = messageItem[file.fileType](file);\n\n        console.log(\"创建文件消息: \", msg);\n\n        that.sendImg(msg);\n\n    };\n\n    var urlItem = {\n        file: function(data){\n            var fileType = RongIMLib.FileType.FILE;\n            im.getFileUrl(fileType, data.filename, data.name, {\n                onSuccess: function(result){\n                    console.log(\"获取文件 URL：\", result);\n                    data.downloadUrl = result.downloadUrl;\n                    createMessage(data);\n                },\n                onError: function(error){\n                    console.log('getFileToken error:' + error);\n                }\n            });\n        },\n        image: function(data){\n            var fileType = RongIMLib.FileType.IMAGE;\n            im.getFileUrl(fileType, data.filename, null, {\n                onSuccess: function(result){\n                    console.log(\"获取文件 URL：\", result);\n                    data.downloadUrl = result.downloadUrl;\n                    createMessage(data);\n                },\n                onError: function(error){\n                    console.log('getFileToken error:' + error);\n                }\n            });\n        }\n    };\n    var getFileUrl = function(data){\n        urlItem[data.fileType](data);\n    };\n\n    var getFileType = function(filename){\n        // 默认支持两种图片格式，可自行扩展\n        var imageType = {\n            'jpg': 1,\n            'png': 2\n        };\n        var index = filename.lastIndexOf('.') + 1,\n            type = filename.substring(index);\n        return type.toLocaleLowerCase() in imageType ? 'image': 'file';\n    };\n\n    var callback = {\n        onError\t: function (errorCode) {\n            console.log(errorCode);\n        },\n        onProgress : function (loaded, total) {\n            var percent = Math.floor(loaded/total*100);\n            console.log(percent);\n        },\n        onCompleted : function (data) {\n            console.log(\"文件上传完成：\", data);\n\n            data.fileType = getFileType(data.name);\n            getFileUrl(data);\n        }\n    };\n\n    // 上传文件\n    var img = document.getElementById(\"upload-img\");\n    var file = document.getElementById(\"upload-file\");\n\n    var config = {\n        domain: 'http://upload.qiniu.com',\n        fileType: RongIMLib.FileType.IMAGE,\n        getToken: function(callback){\n            /****************************\n             * 使用融云文件存储注意事项：\n             * 1、有效期为 1 个月。\n             * 2、文件不可迁移。\n             ****************************\n             */\n            im.getFileToken(this.fileType, {\n                onSuccess: function(data){\n                    callback(data.token);\n                },\n                onError: function(error){\n                    console.log('getFileToken error:' + error);\n                }\n            });\n        }\n    };\n\n    var initType = {\n        file: function(_file){\n            config.fileType = RongIMLib.FileType.FILE;\n            UploadClient.initFile(config, function(uploadFile){\n                uploadFile.upload(_file, callback);\n            });\n        },\n        image: function(_file){\n            UploadClient.initImage(config, function(uploadFile){\n                uploadFile.upload(_file, callback);\n            });\n        }\n    };\n\n    img.onchange = file.onchange = function(){\n        var _file = this.files[0];\n        initType[getFileType(_file.name)](_file);\n    };\n}\n\n\nfunction registerMessage(opt) {\n    var defaultOpt = {\n        messageName: \"PersonMessage\",// 消息名称。\n        objectName: \"s:person\",// 消息内置名称，请按照此格式命名。\n        messageTag: [true, true],// 消息是否保存是否计数，true true 保存且计数，false false 不保存不计数。\n        propertys: [\"content\", \"type\"]// 消息类中的属性名。\n    };\n    opt = $.extend(defaultOpt, opt || {});\n    var messageName = opt.messageName;\n    var objectName = opt.objectName;\n    var messageTag = new RongIMLib.MessageTag(opt.messageTag[0],opt.messageTag[1]);\n    var propertys = opt.propertys;\n    RongIMClient.registerMessageType(messageName, objectName, messageTag, propertys);\n}\n"
  },
  {
    "path": "integrate/message/message.json",
    "content": "{\n  \"historyMessage\": [\n    {\n      \"content\": {\n        \"messageName\": \"TextMessage\",\n        \"content\": \"欢迎关注融云公众号！融云提供的即时通讯云服务是将即时通讯技术封装成 SDK 供全球开发者下载使用，并向开发者提供平台环境、技术支持以及后期运维等服务，使开发者的业务能够快速获得即时通讯的能力，实现单聊、群聊等功能，满足社交、客服、聊天室等场景需要。\",\n        \"extra\": \"helloExtra\"\n      },\n      \"conversationType\": 1,\n      \"objectName\": \"RC:TxtMsg\",\n      \"messageDirection\": 2,\n      \"messageId\": \"1_8667435\",\n      \"receivedStatus\": 1,\n      \"receivedTime\": 1493257272432,\n      \"senderUserId\": \"user2\",\n      \"sentTime\": 1493200373450,\n      \"targetId\": \"user2\",\n      \"messageType\": \"TextMessage\",\n      \"messageUId\": \"5DQJ-BC6P-843A-D3E6\",\n      \"offLineMessage\": true\n    },\n    {\n      \"content\": {\n        \"messageName\": \"TextMessage\",\n        \"content\": \"好的\",\n        \"extra\": \"附加信息\"\n      },\n      \"conversationType\": 1,\n      \"objectName\": \"RC:TxtMsg\",\n      \"messageDirection\": 1,\n      \"messageId\": \"1_148333\",\n      \"receivedStatus\": 1,\n      \"receivedTime\": 1493257272432,\n      \"senderUserId\": \"user1\",\n      \"sentTime\": 1493201413193,\n      \"targetId\": \"\",\n      \"messageType\": \"TextMessage\",\n      \"messageUId\": \"5DQJ-FB49-443A-D3E7\",\n      \"offLineMessage\": true\n    },\n    {\n      \"content\": {\n        \"messageName\": \"ImageMessage\",\n        \"content\": \"iVBORw0KGgoAAAANSUhEUgAAAIcAAADwCAYAAAAqwHdzAAAgAElEQVR4Xu2dB3hV1dKGv5yQBAKEJr0IiNJUqlcBRbFXfhRRwQJYEFRAxS6iIip2BTsKiuhVEPUqiopdELHQRUWvKNJLqKGl/c+7cifsnJyTxgnmJHt4eJKcs/faa818e9asWTOzYiRlyiefAyE4EOODw8dFOA5EFByBGdvcc+5oXE4rv/9B42u2dX9nnFTZl8B+4MCYMWN0xBFHZD/pjz/+0IUXXpjryVOmTAnbm/Xr1+uqq65y3+cCx1tvvaVzzjnHfVmrVi3Vr19fc+bMUXx8vG688Ua9/fbbCgQCWrp0qdLS0lSuXLnsBwGOJsMv1n9veUmBNonKfHu5Yg6vXaLAERcXp+TkZFWunAXYevXqaeXKlYqJgRVZlJCQoF27drnP5s6dq/bt2+vKK6/Uc889tx9EXLRHzJ49W0899ZQmT56s6tWra9u2bapbt65eeeUVnXHGGW7MNt5Vq1Zp0aJFIR8EL0499dSc4EhKStLMmTN1yCGHOMFDxx57rB566CFdfvnl7u/+/fvr66+/1o8//qgqVapo0qRJuuiii7IfEjtjm66qGqOx90xVTPUGymzSSrGdKyr9pKSijbiY7urbt69efvll1zqMmD59ugPCcccdpy+++EJDhw7V448/7j4bOXKkRowYoczMzBwAKqau7VOzAGTHjh167bXXdPLJJ6tRo0bq1KlTjjYBxWGHHebAkZGRoTZt2ui6667TpZde6q4LCQ7vW7N792735xtvvKHzzz9fAGfr1q3Z4Ni4caPef/99oba84EBzxNz1hNJjN6lK3yHaMmmSArdco4xTquzToCN9s4EDgS9YsMAxyDTH33//LcbHZ2hLtGTTpk21ZMmSEg8OtDjgjo2NdWDu3LlzLtZ5wcGXzz77rAYOHJh9XUhwwIT7779fN998s5o0aeK0Byr4r7/+0ujRo/XSSy85BvF28RnMQ5Nce+212Q0Djszxdys28UQdflhdzXu8j2LGfVuiphU669Uc/G1awasd7PfU1FT16tVL7733ntLT0yON02Jpr06dOlqzZk3YtplKw9H48eNzTyuR6GXMKRdK1etIxsSYgBSfoMxX7o9E834bBeTAN998E1JrFPD27Msiulop7MP960s2B2I6dT7Wd4KVbBn9Y73zwfGPsb7kP9gHR8mX0T/WQx8c/xjrS/6DfXCUfBn9Yz30wfGPsb7kP7hA4MDjti8OoOHDb9GoUaNDcqNSpUravn17ju/q1K6tNWvXus/OOOM0vf/+9Bzfn3NOD7311jsKdW/JZ/k/28MjjzxCjz36kOvErbfdoS+//Dpsh/IFxzezvlDnLsft04heGPeMLr9ikGujWbOD9Pvv/9UVV2T58oNp3Ljx+vdrExUXV04DBw3WDTdc5y7ZtXOX7rp7lC66qLf+r/tZbtOvUaOGev+DD/X99z9oxoxP96mPZeXmKZNfU/36WR5Stkm6HX9K0cCxr8Bo1aql27UdMvgqB45ZMz/X8Secot2797gO9Tq3Z3bHmjRprAcfesT9/fJLL6hvv8vVtevRDgCDBg5Ql6O7qXXrVlq/foPeeXuyA2zv3udr8DWD3He4u33KnwN9ep+va67JelEnTnxVzz43rvDg+PKLGW5vJZiKokW8msPbHruGRm0OP1TvTfvA/Qkohw27RbO//db93a5dW9054nb1OLuX+/uTGdOVmFjBAeSLzz/Wcd1Ozp8r/hXZHIC/UH6yzHNamfHx++rdp682bNhQZNY2bdpEt916U/a04m3onpEjdMeIke6jW265UaNHZ82FPPeJMU9p2v/AgsZBO0CvTpqguLh4NWhQX8ced5Imv/Gqzu3Ve59soiIPLgpvZIf9w+nvup7DPzYWw1G+Ngdv5qmndXfBL4Ul1H/Pc3vruWefzAYHcSBbtmzRG69P0kUX98/RubffmqyzzzlPp59+qnr2PFuXXXaleyQGMfdt2rTJbZsTh2BT3ltT39A5Pc8vbNfK5PW8ZN6gJpjAdGwvXjBT8gVHcXOxevVqSk7elOsx2CoYnUaEFAAKn4rGgVDA8LYUaor5x8FRtKH6d+0PDvjg2B9cjtJn+OCIUsHtj2774NgfXI7SZ/jgiFLB7Y9ux6xfvz6ka/GAAw4I+XxSF8h7SElJcaHvpCccc8wxLtSd78j5ICnm6aefdveTP8Gqg/U1/7t06aKPP/7YhdCzAilfvry7zqLA161b5/JlIJbP5I0QRU0kuAX9koNx9NFHa/78+dl9JGqaHJvSSIu/+0JT/v2C/tWqhZI3rNK2TeuUum21DmxUXctW/aUK5cvrpwWrFa+Azup+mA5s0VKvvjNfW+pU1kvj39ZVFx6uW/tfokC5OopvlDvJKZwfq9Dg6Nevn3M4AQqiuCEi06HffvvNAeaaa67Rk08+6YAyb948993UqVNddDvg+Oqrrxwwzj33XJEKQC4MxPJ13LhxzqdBlDs5I2+++aaLpO7evbv+85//aM+ePQ4EDRo0yAEO1u+l1YW+Z9cO3Taghxoe3FQHN2ms339eol8X/aoDD6yieUuWqeNRR2h7ykatWr5cieUS1ffCnprx5SzVqVdX8YlbtGTOl7rqrG6q1OpoVWw1ONf7EzFwoFFWr17t3mS8a2SO7dy50z3wp59+0qGHHpr9cIRF6h2h/ZA3ZL527dr66KOP1LJlS5155pmqUKGC3n33XaE5CI+/5ZZbdPzxx2vWrFlug2jAgAG6/vrr1apVK5fRVZbAkbY7XTE7F+q9UWdrVWwbrdsVUIMm7VW3TpL+8+Z7Oq13H21OXqXFC/6r9clrdMHp3TTjw4/0y8+/qGmddN11yxCVT5muii16KdB4SPGBgww40iKNyK2sWbOmrr76apfDcuSRR+q8887T2LFj3d4MggUkTB9kYvXp08fdinBXrFjhvqcNcmUA2++//65mzZq5a7za4PTTT3ffMYWhQYLBkV+uRjRPN5lp0u7UbdK3Q7X0s4+0YkdlLY1vqTkLVis1NqAVK9cpbU+CGjdtpOV/LVOHdkeoSdN4/fDNUiWv/0u39jtJMWvm689VGbp0QpYm91LENEc4cPCwiRMnugw4phU0AFMCXk2mAlL1unXL2h8JBgfTj9kTZnMceOCBWrx4sdNQfA+RrwqRs9q2bdsyM60oI1OZStfu3dsVt/gprfnwCW3emaldcXHakNBIm9Jq6YtfNmjrzkTNns/UXl+b165Q28MO1aDBQ7X0P8+o1q4FSqxdX11HzCw+cJAqWKNGjewHBCdT8wU2Am8yxH5ItWrVnAFbsWLF7J9oAQxUjE8MTMBBu7/++quaN2+e3f6ff/6pxo0b5xgQGgZtk1fmVjRriuC+N23cRL/8sthp4vSMDMWm79KuOXcr+eu3tGXHFmVmxCg1PUGKLa/UuIqKSUrUrjQpEIjT2pREVWjcUYG5z6jF8f3U6Jwnig8cpYnp0TKWpo0bKSYQo8y0NE0YP0Fdux7LnOtKJKQF0lQufYfSN/+m9LXLtGfrFgWoGHBAE8UlHahyNSorI1BbmRnpysjMVHx81uqwWKaVaGFoaernud3P1O+//axtKbuVnp6mlJSdbqqGyKJnuj6wcWMRXsmKb8fOHVq5YqW++/47zZo5S8v//EsxsbEifOLHhblLL0TM5ihNTI+WsaxY/pcDw57UVDf98j8jI1MZmRmuaJdbwodIbLXtefuJ/da8RQtfc0SL4EtCP33NURKkUEL7EBFw4M3clxSFEsqbMtMtvNLeuF0beETAUWa4WMYG6oOjjAm8MMP1wVEYbpWwa9nYpNZX6u49zuu5Y+d2bdywUkf+q4kqxSfpw3c/VmZSA7Vu1Upr1i3T4YcepqTKVbVnd6riEtLVMKGCKsUG9OGcBRp0e1a0v+/nKGFCLmp3qP63acNGJSaUV9WqSWrWrLEWzFuoBrWrqka1ilqzbrOatGqr2g3qqP4BlVWvXl2lp0l7du1Uiyrxql2jmhb+sEC/Birp2mG3+eAoqiBK4n0HNWqouhWrqEK1iqqcWF5JFStofUqKqldNUqcOjRUbm6BVq3fq3FPO0PZdm/CbK3lnhrZu2axT2zXTz3O+06i3PlKvPher/+VZ2W7FqjmioS5nYQVtY2KzEMu+pNClF/ZQ2+Z1NG/+32rZqplq1aqpdRu26ps532nrinWKyQyoWqWKSi8fo/IJCapdt4ZatumgalWqatWib/XlNwvU7tQz1bx1a51/QTEG+wQnxcBAmGqbasZQYzBLX5KS2IZns83IylkSn0G0l1UUDicQIsrYqIPYoGMDMMtTmCVI294P7kdwEBC7yjfddJMefPBB3XHHHbrnnntcCEK4cVl/gtshMeuggw4K+wYGX0+IAWOlv59+mpX0XdDgpDGj71SF+J1atzFGr70+RcnJW5SpNB1Qs6YqVUrU669P0ogRN2r4TXfpjYnjdHm/3rp1xL2at/BPJcUnaNQ9d2r55s0KVKqkCy+8pHg1B3VI2VKHLLwPAFiUV2Jioitgy86slW8IBgcxIJRfZteWICETfDhwcD9z7zvvvON2adn5JciI9iGYTiQafwM8E479JIINw+67777LIdTHHntMo0aNcsVaqbNKGwcffLCr3tyz595E72Bhv/rqq/rss8/cXgYhBbRjfaE/VatW1ebNm3MMh9DGRx55JDsMAbAUhMbdPFJf/f6zPp05Q5WTaig1PU21qtXUCV2PVuq29Ro28Ayt/+Uz1e14trYnr1ZCoIJ2xlbUUy9OVaX6TfXc40+odbODNOzWW3Raj7OLFxwwkMrGMIU4DSj4jQ3uQTA4iDn94IMPdPvtt7sY0+HDhzshhSO26QkMQsMAKMBARJgFHj388MO64YYb1KFDB11wwQUOHGgbrucnMSYWzmjPoE1LFie6rWHDhi5sEfARKgB4w2kOgpkgC0Xg98GD94bghQpbpOQ08bOffPKJTjjhhAJXRD6t03H68dfFqly1kpq3aqlRI0epSf1EadNfStm0R9+Pe0jbkrcpqd1BOqBcOc346id16NJRm9dv0KfrMhR/4JGaNmmcHrr/Xl30v9BOL58jupS1t4sH8Cb36NEjFziCbZJgcFCwZdmyZS6OlBgOIsgowB+OEAahg/Y2TpgwwYUOIgQLaOYnwgIEPB/1DXiZPozQCl5C23E9AAXgABCN9/PPP7s4lHBkoCDCzYKl7VqqHZ911lkuHvaKK65wHzOdzZgxQ88//3yu+JT8tEfFypV05umn69qBA/TwjXdo6KCz1bxxohZ99Z4SKh2sHZXrKX3dL6pWq6KWrtis5K2ZqhuXruoNGmjd8jWa+dcanT/sQX392QyNuKOYVysIhFhSmHLUUUc5IaBeefMQ+LBhw1zQMCrcKBgcp512mqvyz1sKM++++25ne7BzaNvRXqYFR6WfeOKJrpD/fffd5zQDJbiJRSV4GXsATcJUgXZhmkObUOObvnvVOcHKvM3YRmihRx99NEesq/WBoymYSoy43nJ5uR+tgCZFE9EfQMM1PNtqyXMvdsrFF1/sxkrMbEGoZq26GnPjrfr41cnatGmjMlM36NKhl2rbHz8rZd1yJVY/QIlJCUrVHm1K36UatRsoJjZBv/62QZuSU7Sz/AE68bzemvnZTD069tFcj4yo5ijIgPxrIseBk08+U6vnzNfWjG2qHhuv1NhUDT69g2Z/N1cJSfW0Ys06ZVSvpbaH1NPtjz2ol0bdpxMuu1Kb167Vu29OVs2qldX5nH6a8tAEPfLeXoBbD0s0OCK1LI5UO5ETa2Rauq7z+Tr6mvN0x83DVKtaFZ12wtGqHbtT5culqlmXYzX/i0/U56oBmvfdj6pRMV7jHn1aA++9Swu+nKGkWo2Vkia9+fQn6ti8na6b8g+ECZrNQIoBpwURIc6cbSqVn6hd1DpTB9MEahy3MPYH8zyrFu/0EapQndX3MLYzp7/wwgsuGp12UOu0YUSMqvfvyIhr/7Yy7ur79eDrTyqmQjk9+vTjatn8UC3597Nal7JOq7fvEiegtO96kho0bawJdzygbu276D+TXtPK+hW1bvVKHXb48aqWVEUnxtZRz8n37P9phaUpSz+z8DEgUVcA4fPPP3fLXMgsdpai2BbLly93Ri1ZdKQuGDjM2seWwBA1P4f5BshnoU0AxMoF4LGKAZxeKg3JTvOX/KURPS7S7OWLtGf3LiUFyimhapw6d+qko7p2UaXKlbU+eauW/vabPvvkU21atVp7EuJUP76aUpOqqk27I1S9TkPdXr6mGo/ZewTKfptWEAIWPAYYZKkD4cABkMiC4/gHwANISDlgJYQ/A02D0crf/EdjcCCQgcO0Cv4LTl0CHKalvM6l0gCO5et3a1DnEzVn5WKl7NmpDKWrcoXy2r1nj2IDAaWnpik2JqC0jDRlElxMIHFMQAdUqqnEWrVVo2Yd1avfRHcMGKrmJ+6N7N9v4EDABLpiuSM4VjEsDcOBgxUOmXBY7aQ6co4aS0rTHMFLW86eA1AWQ8mqBEcVy0O0EU40tFGw5iCfFqBGM61avEGLZ3+vO++9WQtX/a50pSuQKecMi1esCx+FMgMZWR7jmBgllSuvhEB5VWnUWJUrVtVtQ27SgfUaqvXJuR1vETdIg99IwIFwHnjgAZcfyxTB8o/rOAYLoEB4TrENAAHLYVzfTEEcLIjH0XJevLaHCZblMolS+AyYVox4BktozmXD5uB773cFdVOXVABtXPRfZdRtpJvP6a0pc6YrlS0JxfwvKi9dsTGxUma60gMx7neAk1QuQZmBWDVr1U4V45J0xSm9nKv95BuL2UMKE9euXSvyXX0qfg5smLJU8bHrVS4pU937DtT3G/5Ualqae7FIcgpkZoicOMolAJpysQHFZEgVExLVpHEr3XTRYNVVovak7lTnO8/b/wZp8bOo7D5h9aQlyszgdMqA4mJ369n77tKrq37Ums0btSOQobhArNLTsuyO+ECsMtPSFRcbq4PqN1XXY05SfKC8ksrHq8UhjXXWDVmVEbwU8Wml7Ipq/4981Rs/KyEmVpmpOxW3Yq1SVm/SgBfu1i971ikhIV4pgXRXy2RX6h6X1YZRys/Oh3TQIU1aq369hjrwoDpq0Liujr3wTB8c+1+E0ftEX3NEr+yKvec+OIqdxdH7AB8c0Su7Yu+5D45iZ3H0PqDQ4PDTHqNX2IXpOQ5CnIuhKGw1wcI8wL+2dHLAB0fplGtERuWDIyJsLJ2N+OAonXKNyKh8cESEjaWzER8cpVOuERmVD46IsLF0NuKDo3TKNSKj8sERETaWzkZ8cJROuUZkVGUOHIQ3FpXKWlikD45CIMUHRyGYFY2XejUHUfFEwwcTmXokSLVo0cJVALDodR8c0SjxQvTZwEGqBMIGHJbZT0EaCtOQmEUFAah169YuTRPywVEIRkfjpcGag9AEOxodYKAt+IwSVZRRoEQEtTp8cESjtAvZZy84rJKPNWFHi5E1R0kpTrtcunRp9hN8zVFIZkfb5f5qpeAS81crBeQVKZd23m0Bb4n6y8ocOKJeYvtxAD449iOzo+1RPjiiTWL7sb8+OPYjs6PtUT44SojE3tp8i+IrZR37XhjKSJfOin88R8Hb/gP7a9q0aZwuqgULFyomLlbjnnlWVatUdcfD49RLi0nVtUOuVfqeDP33v/91VZn4rmK5StmP98FRGEkU47Xvpw0tcuvr1wbUr/5j2ffXbZx14HNaarr69rtE9z44WrGZWefQGqUH0tyvJx57kn755RdX64PCLyv/XOWDo8iSKKYb9wUcq1bt1hWNns3uWa2GNcWpopWTKmnhwoXZpbDYI7ICe3ZxqjJc5aWM3alKT8/Q+hXrfXAUk4yL3GwkwVGzbk3FlJNWrlzptgaYMqjBxn4RddhGjBjhqktTDjQuMas8d4uDDnb1xNb97YOjyEIsrhsjCY6Fvy7QXXfdpX+/OdlV/Hn3rXfUs3sPPTl2rM67qI9WrFihNi1bu93mQOUKYsI5sH5DlS+foGW//OlrjuISclHbDQZHRnqmArF7rYTnzvtdV05u5ppfPH2LDj2tSvajtm7NVO/qY/baE3FpStmeooSKia4++/2j7tXKZX9pwvjxiq+U6Ep2zpn5jSvlmbxzm7M3xjz2hK4dMkTlMuJ9cBRViMV1XzA4dmxKU2K1rATn6aNXa/ncFAeOuVOTVaFqObU8IetgomwDc1Ndda95i/tzxeZVLrwgkJ51WFFqTKbiUjO0aWOyqtep5a4BIFRzpFxUIDagtEC64tJjFJue4IOjuIRc1Hbzm1a8muPnT7fmAgfPrb6lmzrV6KFz+pytyZOnZK9OKiZU0JZNm1yl6OmfzhCHAnX515HuQKW4xAqKCcQoNTNdMcpU+fS9FaD9pWxRpRnh+/YVHJnJTXRmrazS1fc+PMqVBDda9OM8Z5R26tRJ67dscmVCG9au6+JW0CQUl9uTkaa+fS/RlAmTfc0RYdnuc3P5geOHKcnq2Ku6e876P3arZtO96n/DhnT1rfNkdh/qN6mvv1cszw5v5PwZSoRT7fnbb7911aWp7Dx58uSsitD/+9egVkOtXbU3ANvXHPss1sg0kB848npKsJ+jZv2aenH8Czr99NPdbUS04e8ACCxhWc5yEAHTiivcEiPdfNPNmvjiK1q3Zu+JEz44IiPbfW4lkuAgwo0po2OXDnrjjTccADihgumEGvEAg8MH7GTNJx5/Qg+Oesg5yDjjzsgHxz6LNTINRBoc9CotNtX5MI7rdpwmTZrkViYQwOGUigsu6K21a9a6JXPc/5awPjgiI8+IthJJcHTs3MFpi4y0DLmq6JTGDsgtWTPSMqWYrCrHCalSWlxAsXEB7UlJVWxsjL779gdfc0RUshFobFrqkAIfJRr8uKMzR6hKXI3sj6dOe9OBgxMk4hPi1ahhI+cM41DG//u//1Ot2rW0s5w06ZkX1Lz5Ifr1l1/V65JzlZKyUw0rN/TBEQF5lvomfJuj1Iu46AP0wVF03pX6O31wlHoRF32APjiKzrtSf2cOcLBLV1Ty1s9mHV3WUgeLyrfiug+HF06tfaFiAQeRRY0aNdqXfvn37iMHiALjONV9IR8c+8K9EnyvD44SLJx/umvFAg6rYkOAWqYLF+FASsj7O59lhbCRYAx5bY5Q08rxxx+vp59+2tW/MHrqqady8fCUU05xbbGtbEQZBMohQI899pi6du2qDh066MYbb3RnyFJL46CDDsruy7PPPquBAwdm33/OOeeIQ4uDiXwN7isIbdqSompVKmrWD7+pS8eDs2+598l31bRRVnQV1Lv73n6PfWmGBvc7SUv/WKNDmmalC4x+epqGDTjN/R7gHNhAoCCPL/Q1xQKOjPQMbR03RttrrFOFQ+qpapN+Wr/gda3IfES/beuv5O0t9OrCeB0UG6cBZ9TXMUdmCdsLjmDDlggkoo++//57dzQ5gr788stzDfiaa67Rk08+qQ8++MBtN48aNUrDhw93wm/WrJnOOusst5PIDiNxj1Tkee+991w7gJpTrI1efPFFt/MIBYOD+ynIQrEWtq2hNm3ahBXAl3N+UaXEBE37dIHuvLbHXiAMfkY3DzxdbVtntRFMu3anqnxCnFJ27FbFxARt3Lxd1498TS8/OkCfzvpJ3Tq1cgApDioWcKRlpGvT+NFSw53afUCa6rW+Tat+narl237U7D8aa8nGloorV10/fL5YN118iHr16OreWMCBgGrWrBlyrHzfp08f9z3XcWK1EUecc+R4MDgInWcvYPXq1apbt646d+7s9giMiE0wYoVE+H316tWdVqFPqampLmHHaNiwYe44dcACARIABoXSLHbfyrWbdOsDUzTx0QGaMPkr9T+vq/uKPI8t23ZoQ/J29/cLb3ypu68/W1/PWaqTux7qPus9+Bkd3qKBbr36LP2xfJ1uf+hNHdXuIC34+W+1adVIQ/ufXBzYcGkJETdIeTO3z3lHCc0PVfL6aarZoL92bftLa7b+pm1qp9/X7tTOnQHF70rXKUc3UZWqiQoEYrPBgdawqcY7aqYaBPHnn386LWD08MMPu3S8Z555Jhc40C79+/dXx44d3UA5/pyIJi8ZQAAHQbMUe1u/fr0DIeC47777si//5JNP3OaTkU0rtPvqq6+GFdJ7n8zTWSe2y/7+xntf10O3X6DFv67Qoc0bZH8+auy7Gj64uy645mm9/uRVevDZ93XTwDNytPvw89O1dsMW1T6gin5YuMxdVxxULODAxsg0M4NeO1Njr42RNRCvHRLjcjLzmlZOOukkV/gEAWzcuNHFE4QqhGKaIzk52WmXGjVq6Prrr3dJN9gREG0R7obgOfeewBYIrfLKK69owIABLqr62muvdVqG6Qyw3nDDDW6X8v777y80OBD2xMcGKD4uKxp80O0v65l7c5/sbODgmkuue04TH7vSXf/B5wt0eresaevHRcs0f8nfatuqoR56bnq0gaNoOM7PIKVVIpBQ+4StBdM999zjDEzvd4Ao2JGDwO1Msrlz56p9+/a52rLpYtmyZWrSpIn7PlRbduNLL72kfv36hR0408F7n8zX0EtPdu/J/2zwHNdPnDpLPU/r6GyLtRu2qvYBSfp7VbKzKerXqZZ97a7dezwa6A2NHXlx0Riez13FpDmK1teCgKNoLft3FYUDPjiKwrUyco8PjjIi6KIM0wdHUbhWRu7xwVFGBF2UYUYcHEXpRKh7/F3ZSHGy6O344Cg670r9nT44Sr2Iiz5AHxxF512pv9MHR6kXcdEHGDXg2LZtm15//XWXyEtsKTug06dPdxttEJtn//rXv9zvd999txYvXux+J97j6quvdr8fe+yx7ueiRYs0ZMgQdx3b/3feeWc2B2mDYzEgnmFt2uYcf/P7zTffrMsuu8yFDrC1z57PZ5995u4jnuSjjz7KLl9gm4gTJkxQ9+7d3T7Pyy+/7EIJvvzyy5D9tOfyZbt27XTTTQGIbkwAABowSURBVDe5uBFvf9hoHDRoUHbfzb3P3tDzzz/vPu/du7f7Cf8qV67sfv/3v//t/j7hhBNyIMe7Q80XUQUOmM5mGsxmf4TBwGATCp+xjzJ79mw3aLb3EYgRu7IvvPCCEzqbd2yuISgAYsSO8nXXXacnnnjCfUSxkjPPPNM9C2Lrn/gP4koOPvhgFwZA1rmFBHDGCs85//zz3efEg7CB99VXX6lLly5iBxlgeSlUP2nnuOOOcxuEt912m9q2beviVwAHsS316tXLAfwTTzxR7BjPmTMnR0zKlClT9OGHHzoAjxw50lUBNLDwDOpuVKlSxSVIB8fsRhU4nnvuObHbysYbMRX8BxwE9CAMNsneffdd1alTR+PHj3dvp72Z5513nis0whtN3Ic3qAfBv/nmm04r0Q67tezmWpwGAqFgCZ8fc8wx2UAhugyA0BaAYCufXV4AQHQZYN28ebPb+kegBBoFgyNcPxEkoIAAF9ryjjvucOAwoAIWwA6xc4yWQEt6wwd4megLgH/00UezgUloAuDlHDpCFAAKBwh5KWrAgSCoJAPzET6EwA0cFqdh4OB7wgpNqxg4TPOceuqp6tu3r6ujyXSF4GEwbx5ElTymLYiIMiLLUMOoY4SD6uY/cSLsBDdv3ty92dzPVIYw6S9vpMV/oPZDaY5Q/Zw5c6YLYeDwQNr+5ptv9OCDDzpw0Be0HlMU44VMc/A7wUkWSgkgjRgjIQdoPton5MFAQj8PP/zw6AQHCIe8W+ggHnAQzAPx5vB2IORgcFCJBhVrBDgQJm+VAYK33IBQtWpVd+kZZ5yh999/3/2OcJlm7M0FsNgnHPZ3wQUXOJD9+OOPORjMH0SV2f35gcP6ifAYB+1xPxqNIiqAg4MHH3jgAfe72Rn8ThgCIOIFQGsBBIhwApvqmKqY4kwDmeYwkESl5sjFcf+DYudA1Ewrxc4J/wG5OOCDwwdFWA5EDTi863uvxc78Sh1ujD/maTP6fJnvOweiBhwMlfhRVgEYhfgy8GlgsBEgvHv3brdKGD16dHaFu31nT9luIerAgfPn0ksvdX4MCC/hFVdc4XJTyGPBoeNTZDgQVeAgRwQXMEs2HGEGDvwEpB+gPXA1szz1ad85EDXgwN2N1xJ7A8fWH3/84Zw2tr+APwLHzyOPPOISnCx/NVyO676zrvS3EDXgKKoogvcaitpOWbyv1IOjLAo1UmP2wREpTpbCdnxwlEKhRmpIPjgixclS2I4PjlIo1EgNyQdHpDhZCtvxwVEKhRqpIfngiBQnS2E7PjhKoVAjNaRSAQ52a9mQIzbSGzNJ8TfC4kKVaA4VUFsQphJKaCGEXL9u3bqQ5aesLTsDrSBtB19j95JmceihWcXjjDhCKzhanGpEXrIAaT4jAp3QSC9ZTOlPP/2k1q1b5+piVIGDCO4ePbLKNHpjOhg0+y7sv8AEIwTH3ooVfKP2KETgLownwNZiKIMZO3ToUBcCQHsEG1vuCcXmiDiHCCwmdtRKTFopKcIIvJHcjRs3dnGmocieS7wo8SgQQrU4WAKIK1Wq5J7jrVZI3s2YMXuPF+c+gqitn8TaevNQ4ANjhuAjm5UQ+1REt1MPjfu9FFXgYHPNSwT+EtlNugAaglpgBo7Bgwe7ZCWEDBGdTSAyUdbkiZCvQnQ5DLHAYwrJsbNLAG5wyUrSD9inoZIhwgac3qqCVpIRppNrUtiC8l6w099u3bq5nBsAjMCD0wa4ntgVEzIvAkQR36uuyqouSAA2RL6MlwCNRauTpkGKRyiKGnAgMN4ifpoGIJKbt40MNmI6SD7i7bDBoiEI4Q9mvFdzeFMQYFC4eqZEnKGGKWyLhuB3q9RsjDU17i1ZWdDpiz62atXK5aHQPglKlLucOnWqew45O97CvYAcjfnFF19ky5UIdSOK51qujUWh8x3TLtMvgDn77LNdhURSLpiCgylqwGEdt+147xTDQGfNmuWYZZoDrcBRlxy5zZSDJjC1DDh4E9E0vJX2H6FCvPVezUHaJFoD1Qv4YDpk2WKWW2J9RKC80by5aDdiTLCJ8iIDsFU6ZCxURsYeIPrNCw67FtAgQEvfpKIyR4qTrARZOW97LlqRg4OPOOKIHHku4foVNeAgV7Rp06auHjlq84cffnBzqjchyAsOSlzz1tqUwbWWm+HNQ0UTmLCNScSIwGTeKiOAQU4IRDsEHTHVADKEQbKTvcXYEQCHTDdLpsoTGUE2lF3LFIZ25Hnk+ZKbayGSdg3ABNRMo7z91HUnu40cFzSJXc8YmWYthxcNMm3aNNcMubOAz6uF+DxqwJEfc/3vI88BHxyR52mpaTGqwGFF7rOP7IiJcUdms963KcPW7laBGPVuSziz3sNJb8GCBXmefJCX1FktkHbI9JcfecMYsUmCV2F2P/3GKGUKwIbCdoKwabAzyNPFjvAuky3RPL8+2Pe2lA91fdSAA/vBam6wPKVEAoYVtgBreJKHiR8FFIAAi58yCeaDwGIPVWzfmMLcjp1BkjY/CViGiHTH0KPehZ3jbvdga5DkDJE3e9FFFzk7iKUsy2IjwIygATIrGuZ4VlfcA5gxWLEpWIXRD4jPAQUGNjYSLwblHqDt27e7PB3zhdhzvKswfCD4QsIRLw2EXWXPDI7cjxpw2CApSn/rrbdmj5kB8CZibAEWhMBgKcuAgMM5n4KZZm8cqxQMXwMHTEQrWfH84Pt4HsKnD4DDamd4336MQoryAwKuxydDaQgrnkKaBcnRgBIfCoQWow9WNoHEaU6KAHT4V4ITsnG88dLg0OrZs2cO/004gNAH84wuWbIk20Vg10cNOEJV8GFFYisPlq3UpkBQ+AggHF3UuHj88cfz1bIwFHUNIRADh/dGnG22TESTWXmHYM1h9zDFUDYBIgkLkPA3tUCoFWKnPjAlGSjsXjQHPhiec+WVV7p7rNxCuFIOpjlYJeHcQoPlRaxuWrZs6S7hsCLzH0UdOOgwgufIC5Zd+DW8xJFdaAv8BLaHgCOIpR3zs3dZGo5h5sIm74W30Ls3wT34O6xEFFMDJR9Q8ZRtwHll04qlT+A1NQcUUyL2AeUU8E6yjKQ+CMRU+Pbbb+fqli3N0SKkWuBGh/ICB/s+5sbneXkdpsO0ZZqVFytqwcFbh8q2s2ZxEzNvw3w23piP8XmgmvFHwCDvKUpWp8skgFbxTjnmHgeAACqU5qBck7nj8TLyRhthP7Aph78BQeP0oi2vP8EKxwAKAE6OL8Y0tpJ3qqRN2sHxxv4NWo3+mybwggOvsPkr4JE58tBwpkFDvQxeX499H7U1wfKdF/wLIs6BqLE5Ij5yv8F8ORB14KAInM3V3tHhMmY68BLuZqroBd/D/gL7FgweYsMLstJKqGbc6sFLX++2OtfbjiYGL6uE0kZRAw52Xs3it7mbMo7BO64mIAxTDFKvY8tbxxPjFeEaYelb5j4rg3PPPTfboYVNY3EkXM/cjA3Arib3YLhi+e/rSYolDVxRAw4YZ44db+U8s/aNsRiivPV5GVx8Bzis3KTX+WPn0HoFZZFmOKqsdCWbc8RbsGy0FYu3vui8efOcXyOaKWrAwVKV5SvLM4tJYLXBzqWRRUfhM+AaXM/snvJmAxiWqJSHHDt2rKs5ij8Dwgtp7Xh3Uc33YODw+j8AB9vpRFyhwVjm+poj96sQs379eu9BoRF5WUKdt2JlFYM1hx0Fao4sm368Szk8qxbQwlQDOGgHAjgQ+wwshQkLwOHE54TnsR0PsMw24VrAQbggdg7gICrLe3okGsbKaUeEIf9AI1GjOeANLm60gRH7GgjSzotl/qeIrVX+JdbBiOq/eCUhHFK0QyieEUYu04QBBXeyFwz4JHBCAQp8ElyLXwMjFb8K+y/WD9pE0wXHifwD8t2nR0YVOPZppP7NheaAD45Cs6zs3OCDo+zIutAj9cFRaJaVnRt8cJQdWRd6pD44Cs2ysnODD46yI+tCj9QHR6FZVnZu8MFRdmRd6JH64Cg0y8rODVEFDvY7ONeMOFLo4osvdvseFMW3kED2RuxYLrLp+W87tAT0mlublAbbC8H9zV4ORFwo8aGQhRFaWIA33dIgEvwZoQJs9xOszJ4P4QWcPkmAdHAYHn/zPaUe+J4YTnaVLXCZVAjyeW2jMT9YEtlO6IEFLnN9qN1pSlLAL2JfjQhzDM6tjRpwwECIHVT2RCzGE3Cw4WbBtKQSAA62z4m/JIqb4GJyWYhW95I34pzP2a0ldtNLVj+Dnd1gIFgytzePlnsNgKQPcL/t9Vi77AfRF4CA8LgfIFJBgPNpCUSyzUX2iixfxzYKw4EEYPCfIGh2kr0lIuye4NISvDycNuFNtLJrowYclhnGG0kQjxcc4Q7PhVGAhDcQjUAwrsVr8JYSiwHRJoX20UQW1W5b9wQRE8yMlrE3GKESJcbGHoHN3ngQ0hfITCOBG+bybDupkWcFZ5ixkWeaCi0ybNgwF1jEmAgcRnMQKsDneREgY+MRrcH/YOCHKy1h+TpsRBo/og4caABAQWKPN66CKQXi0F+ExBvIKY0wFW1CtZ/69euHPKAnmIGhjvCkbZt+vJrDPkM7sZ1vQkfAeT03FDiIVgdEZLkzdQIOb1hCXimTXsBY3goVCHgJrCqA95Qrr+YgEo7QSLQH4QXe+h+0GzWaA6ZTawOm3X777Y4nzNlMI7zdpC0yQFQ22+lEeQEk1DSCtJxStuKJ50CTeI8hpb3CgIPr2eZnKiIUgHRJ+hPuuSbEYHDQX5KaECzTik1VpBnYCdahNIb3QCL73orV5KVhDBx2eje2FnEugDNqyz55C7VZgROYYPGkoc5F5XvmfAsd5G9LtOZ3S2W0Ek1kfQEoAEdch539bs8IV1gtlDCCn2t95RlWU4zPTJ3bT++Z89Yu4AZAlivL58Hn2Fv78Aayqc/bNzQBbVjMipd/ocYQNZojzwnX/7JYOOCDo1jYWjoajRpwYCMETwtm5fM5kemE5bGM9JYeCM4X9Rpn3Gc+DKuFwVKWYGNSFFl5QMzLGL7kk0KsdOyMOVsFeOHAlIJtxFxO+CDHjVmcq/kTLM6V+8izZflt9UNItmYJS94Ny0zsGsZxzz33uHITkLcQHbXOrH2+C46xNeOZ4GpsIyNsM5K1+/Xr52qLsMryFpeLGnAwIBKHsMDxC8A4Anu98zK2gzd205aeXmZh6LGkNYcUqxzyXqnthY2BbcPqgZwU/mauBxwsJa0MAz6K4cOHuxVBMDgQtFcA9C/Y+RVcQ5UKAYCNpTSlGOx+uw6fBekPOKmo9UVtEm/xW1uV8CxAbOfhUdPDxh58nBnGLwavt4qgN4+HtqIKHDi/DNkIx7LCLeMdoVmpBpa9JF3jTZ04caIuueQSl3ht2sLKMKIdTHiWXG3tcS3XAQKAZ4Ykzq1w4DCmerUaTjgKyVA/hKUjfcPRhaAhVhl4RdEALNMxGlmNsLJh9eLVFCZA857yHeP7+++/XfsYz2iIcePGufsIgEbrovUuvPBCt3qDaJeXZ9CgQdkvWDCoowocOIXMxYvaBRympllhEB2O8wh3NZ+z8kCowWoWt/EHH3zgrmV14AUHhVX4DmLdT+VCwACDeRONAMeIESNyaA4r2XDXXXe5DHc8lEStewu/4GwDtLjYKeWEMOfOnev8G+S+2HQR7nNWZYyHPjOV4NshQ8/Iym7iKwEA3rFT/cjrkGO68aZPWAVlaytqwGE1NJm/IRgf7E6mQjH1L0x7sM/Cf3JPcIzhOaT+Fk4lCOYwzRg4YCxLXZaJEG1BaBRveWkAZ3m0wdMK8zf5uUxdaDnc/oCD+R3Qkb5g2o8phGcCYjSc+WNIjuKND/U5S1Qr2Y2gmXqYMrAZQrXP+LiHqQfAsdS15/O8yy+/3GlBpi0rkRV14Mh+NUrYL/tS+L6EDSVXd6JGc5R0RpbG/vngKI1SjdCYogocoQq/58UHc3ezImGpin2AAYphZj4RtreZq7Hk2Wthn4Q5HaORJa7ZN+yZYPdwL6sCy8PF7rGVC9eyg4uN4t0Ct3pk2EksiS0ehZJPdhoCn7GU9RJlJ+xMFfaDbHVGPzGQvemW7AJbFQL6HlzfKxSfWA1hY3njP7zXRRU4vBn1LEvzqpZntbHwV7AC8W7x4wfAMsfow+kFCACEZdOzwqDIHMnXGHIsg4NLO9oqAN9LqGqFwYYqBintYMjC9ODSlZSS9JZwQEgscY2o8cVqCBAHE8tTgAKAeRFYtprTMK+Xh/YxSNnBxnHnPc+F+6IKHAjPiB3RvMCBo4jibhyeg/ANHBiQLIO9wrMTDdiS5w3m7WcpiPXOW8rbGwwOr6eVtxSnkpeCwWHtsNLBJxEMDoDKPRZ9ZhtwLHPbt2+fHWjE5yzBzUPLasyCetAeeDwZb37ggAesYuxQIlv6RqXmwHNJMAvqlTJO4co/eQdn8Rqh6oqieahWjEsaQt1TFRiPIQEwOIQIEYBClXb0+g/saI28wGHtAI5gF74BCc2CQwsycJjH12JJECbPtuU23lXGwNRl3mOW4PmBwzQT7dF/xt6rV68cAI8azQFziFSCeahD6m0iRCs9ybTgVYvsXVDmifoZqEzcyrzhCGDkyJHOSYa3EeYzxbDOB0z4QLAh2ELHHqGacShwoMLxZOJoon3eRDSMVf4xmwZuoxUAhe1xeDUHsShoOVQ75K0eRBAOIMXvQf/NOUfcidVDxdXPtIZHFpuDZwS762k3mD98xvEa+I0ACBFwURvPkdfcyXfBewf5XV/Wvi8Kf6JGc5Q1YZaE8ZYqcFjEljHWe/TG/mZ2OM9pqM//yX7mxZeoAgdMZBeRDTY7BsLLbJaClHeyGuEsSZlrLaoaewJ7hdwXYiewM1geYtRhu7Dc9K4iMPysvijzOktblolWHD8cY9nmJ6SA+Aj2PIzCfR6qn+Gea5/bspu26RsbctQ5Y7/GymJ6bQ82A/lfGIoacCAYDEpbzmJ84YhiXU9MJELmb3Y9iTbHuGJZyg4tRiNGJicEWJANG2N8zkYUxiDGGYE5drgvBiX32KokuHZ6OCZbQA3gJd/EwBHuc5aeofqZ33NDBRnBG4KDzPBlRWZpE+wA86zCUNSAI9ygWB0AmlAH7diqBicYKxI0DysHVix4OyGYTIAOy1pvdhjaBXB4l51WPL8gDAZ4/Ge14T19IdTnofppNVItot2y+IJXNAZatCD+DwsrYGeaFYztwAZH2hdkDFEFDgtw4S1gaWuAYGphSQojrQogS1XiI3AWsZzFU2rucO8pSqzxuY+3nDRB3njc3zwLLRIcC1IQptKWvcXeaSXU5+H6md9zWY6T/eeNAuOZjJelL8tgb8BRQfodfE1UgQOhIkx8AVQIZhqxIzJ5w5s0aeIECwgI0sEDiIB5q5irLY/Ue/YKnk3AwZ4JkWQwFo8jZ6cQi8q0xU8cRHgr0VTUWTcKlUJJbXX6R9tEdNmJ0KE+D9dPfC6hnktEGTGmJFOhhXgZ8HXgvGOsaECLP7W4FfqKj8SbG1sQsEQVOAoyoP19DcAzA3h/P7u4n+eDo7g5HMXt++CIYuEVd9d9cBQ3h6O4/RILDtbqtqkWxfyN6q5740mKOpBiOTWhqJ3x7ytZHPDBUbLkUaJ644OjRImjZHXGB0fJkkeJ6o0PjhIljpLVmZjt27dH7BgvYieDjwkvWcP1e1MYDvjgKAy3yti1PjjKmMALM9z9Co4dO3Zq8tS31e/iPq6Py/78S78u/V2nnnxCYfpcZq4lhuXRMU9r2NCsqkTQw48/pWFDrwoZAxOOMaHaeeSJp3T9kLzbyQUOb7W/vKQw7YOPdObpp+S4JC+bY/zLr+rSvrkzvmgA0CQmVigzQi/IQBcs/EltDm8d9tIf5y1Qh3Zt8m0qv3a++fY7dT7qXyHbyQWOLVu3qkpSUr4PDXVBOHA8/+LLGnBZ3zzb3L17jxIS4ov03NJ2U0rKDlWsmJjvsLZvT1GlShXDXrd58xZVrVolx/fvvv+hup9xao7PkjdtVvVqVXO1ExYcox9+XLfccK0eemxsrptuvC5njXG7IBQ4wkVy33P/wxp+y7Ac6nHMU89ryNUD8mVKab9g67ZtSqpcOd9hegvPhbo4VDsj73tII267Mcfl4doJC47Z336vTkcdobnzFuR6bvsw6iwUOMY+M06DB2XV8zJ68JExumnYEIXqaL4cKeUXBL9MwTwK/tt7kraXNeHMg3A89xYAtnbCgmPr1m1KSqqs3Xv25BJHQnxo9R8KHJ9/OVPdjj06u42vZ32rVatX6/xzz/bBEQLoCxYuVpvDD83+ZvGSX3RoqxZh/54953t1OvKIXC3Nnb9Q7dtmldnyUjhwfPHVLB3XtUuOa8OC4/Y7R+neu4eLn8HE56EoFDiCHzp56juqUb2aTuh2rA+OEEycv3Cx2nrAkZ+i/HrWbB3TpVOuyxb9tESHtW5VYHB8/8M8HdGxXcHAkV+nCgqOsU+P0+Crck4rhl5/WsnNRe+0An/CkdkN4aaVcPcVhuch/RzL/16p2NhAnviYMvU/unbwwBzXhNIc6ekZIdvC7uB+r7t9zJPPacg1VxYFl6XqHlvab9u2XY+NzaqO6KXrBg90RXiDKzwHX7d5yxZVrZJztRIKHCk7dqhiYu7V0X5xgj07boIGXtE/TwGmplJGsVypEnJRBxO8RH348SezfEEVKuiG667JbhbwVK5cKexj7Hg07wVvvv2ezj37rBz3hANZgcCB3VG/Xl1ddeVleY43LyfYcy+8pCsv7xfyfpZcINeOxygqU0vTfV/NnK2uR+e2JWyMwYZ+uLEvXPSTDj8svDPth7nz1bF925C3FwgcBZ3X8tuVZQU0bfrH6nN+T9eZv5av0KLFP+XytJYmIe/LWHB7j3n6eQ29eu9U+wRT79UDCuU+x47B9hvqmbJp95qBl+c4vyW4rwUCR0EHmB84CtqOf13J4IAPjpIhhxLZCx8cJVIsJaNT/w+KYXaiLoEEWQAAAABJRU5ErkJggg==\",\n        \"imageUri\": \"http://rongcloud-image.ronghub.com/04e8e84ee9a5ce7dda.png?e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:l8s0gCF2rKLHdKI8h6nn-eCjZ9A=\"\n      },\n      \"conversationType\": 1,\n      \"objectName\": \"RC:ImgMsg\",\n      \"messageDirection\": 1,\n      \"messageId\": \"1_15420460\",\n      \"receivedStatus\": 1,\n      \"receivedTime\": 1493284791403,\n      \"senderUserId\": \"user1\",\n      \"sentTime\": 1493276792938,\n      \"targetId\": \"\",\n      \"messageType\": \"ImageMessage\",\n      \"messageUId\": \"5DQS-ESOD-843A-D3E7\",\n      \"offLineMessage\": true\n    },\n    {\n      \"content\": {\n        \"messageName\": \"FileMessage\",\n        \"name\": \"WechatIMG1.png.zip\",\n        \"size\": 169349,\n        \"type\": \"zip\",\n        \"fileUrl\": \"http://rongcloud-file.ronghub.com/1248024327a52d9886.zip?attname=WechatIMG1.png.zip&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:4c6C5nkq2hurakvE3lmuK_yMOUI=\"\n      },\n      \"conversationType\": 1,\n      \"objectName\": \"RC:FileMsg\",\n      \"messageDirection\": 1,\n      \"messageId\": \"1_13001410\",\n      \"receivedStatus\": 1,\n      \"receivedTime\": 1493284791403,\n      \"senderUserId\": \"user1\",\n      \"sentTime\": 1493280499476,\n      \"targetId\": \"\",\n      \"messageType\": \"FileMessage\",\n      \"messageUId\": \"5DQS-T172-G43A-D3E7\",\n      \"offLineMessage\": true\n    }\n  ]\n}"
  },
  {
    "path": "integrate/message/upload/qiniu.js",
    "content": "(function(win) {\n\tfunction forEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction buildUrl(url, items) {\n\t\tvar query = '';\n\t\tforEach(items, function(name, value) {\n\t\t\tif (name != 'token') {\n\t\t\t\tquery += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n\t\t\t}\n\t\t});\n\n\t\tif (query) {\n\t\t\turl += (url.indexOf('?') > 0 ? '&' : '?') + query;\n\t\t}\n\n\t\treturn url;\n\t}\n\n\tfunction encode2UTF8(argString) {\n\t\tif (argString === null || typeof argString === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\tvar string = (argString + ''); // .replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\t\tvar utftext = '',\n\t\t\tstart, end, stringl = 0;\n\t\tstart = end = 0;\n\t\tstringl = string.length;\n\t\tfor (var n = 0; n < stringl; n++) {\n\t\t\tvar c1 = string.charCodeAt(n);\n\t\t\tvar enc = null;\n\n\t\t\tif (c1 < 128) {\n\t\t\t\tend++;\n\t\t\t} else if (c1 > 127 && c1 < 2048) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 6) | 192, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else if (c1 & 0xF800 ^ 0xD800 > 0) {\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t} else { // surrogate pairs\n\t\t\t\tif (c1 & 0xFC00 ^ 0xD800 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched trail surrogate at ' + n);\n\t\t\t\t}\n\t\t\t\tvar c2 = string.charCodeAt(++n);\n\t\t\t\tif (c2 & 0xFC00 ^ 0xDC00 > 0) {\n\t\t\t\t\tthrow new RangeError('Unmatched lead surrogate at ' + (n - 1));\n\t\t\t\t}\n\t\t\t\tc1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000;\n\t\t\t\tenc = String.fromCharCode(\n\t\t\t\t\t(c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (enc !== null) {\n\t\t\t\tif (end > start) {\n\t\t\t\t\tutftext += string.slice(start, end);\n\t\t\t\t}\n\t\t\t\tutftext += enc;\n\t\t\t\tstart = end = n + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (end > start) {\n\t\t\tutftext += string.slice(start, stringl);\n\t\t}\n\n\t\treturn utftext;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction encode2Base64(data) {\n\t\tvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\tvar o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n\t\t\tac = 0,\n\t\t\tenc = '',\n\t\t\ttmp_arr = [];\n\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t}\n\n\t\tdata = encode2UTF8(data + '');\n\n\t\tdo { // pack three octets into four hexets\n\t\t\to1 = data.charCodeAt(i++);\n\t\t\to2 = data.charCodeAt(i++);\n\t\t\to3 = data.charCodeAt(i++);\n\n\t\t\tbits = o1 << 16 | o2 << 8 | o3;\n\n\t\t\th1 = bits >> 18 & 0x3f;\n\t\t\th2 = bits >> 12 & 0x3f;\n\t\t\th3 = bits >> 6 & 0x3f;\n\t\t\th4 = bits & 0x3f;\n\n\t\t\t// use hexets to index into b64, and append result to encoded string\n\t\t\ttmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n\t\t} while (i < data.length);\n\n\t\tenc = tmp_arr.join('');\n\n\t\tswitch (data.length % 3) {\n\t\t\tcase 1:\n\t\t\t\tenc = enc.slice(0, -2) + '==';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tenc = enc.slice(0, -1) + '=';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn enc;\n\t}\n\t// Copy 七牛 SDK 方法\n\tfunction URLSafeBase64Encode(v) {\n\t\tv = encode2Base64(v);\n\t\treturn v.replace(/\\//g, '_').replace(/\\+/g, '-');\n\t}\n\n\tfunction chunkLastStep(data, opts, callback) {\n\t\t// 七牛 URL 规定\n\t\tvar key = '/key/' + URLSafeBase64Encode(data.filename);\n\t\tvar fname = '/fname/' + URLSafeBase64Encode(data.filename);\n\t\tvar url = opts.domain + '/mkfile/' + data.size + key + fname;\n\t\tvar options = {\n\t\t\tdomain: url,\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/octet-stream'\n\t\t\t},\n\t\t\tmulti_parmas: opts.multi_parmas,\n\t\t\tsupport_options: true,\n\t\t\tstream: true\n\t\t};\n\t\tuploadData(data.ctx, options, {\n\t\t\tonCompleted: function(res) {\n\t\t\t\tres.filename = data.filename;\n\t\t\t\tres.name = data.name;\n\t\t\t\tcallback.onCompleted(res);\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tvar offset = 0,\n\t\tctxStore = {};\n\n\tfunction uploadNextChunk(blob, opts, callback) {\n\t\tvar chunk = Math.ceil(offset / opts.chunk_size),\n\t\t\tchunks = Math.ceil(blob.size / opts.chunk_size),\n\t\t\tcurChunkSize = Math.min(opts.chunk_size, blob.size - offset),\n\t\t\tchunkBlob = blob.slice(offset, offset + curChunkSize),\n\t\t\tchunkInfo = {\n\t\t\t\tchunk: chunk,\n\t\t\t\tchunks: chunks,\n\t\t\t\tname: blob.uniqueName\n\t\t\t};\n\t\tforEach(chunkInfo, function(key, value) {\n\t\t\topts.multi_parmas[key] = value;\n\t\t});\n\t\topts.filesize = blob.size;\n\t\topts.headers = {\n\t\t\t'Content-Type': 'application/octet-stream'\n\t\t};\n\t\topts.isChunk = true;\n\t\tuploadData(chunkBlob, opts, {\n\t\t\tonCompleted: function(chunkRes) {\n\t\t\t\toffset += curChunkSize;\n\t\t\t\t// callback.onProgress(Math.floor((chunk + 1) / chunks * blob.size), blob.size);\n\t\t\t\tctxStore[blob.uniqueName] = ctxStore[blob.uniqueName] || [];\n\t\t\t\tctxStore[blob.uniqueName].push(chunkRes.ctx);\n\t\t\t\tif (offset < blob.size) {\n\t\t\t\t\tif (chunkRes.ctx) {\n\t\t\t\t\t\tuploadNextChunk(blob, opts, callback);\n\t\t\t\t\t}else{\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tdelete ctxStore[blob.uniqueName]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toffset = 0;\n\t\t\t\t\tdelete opts.isChunk;\n\t\t\t\t\tdelete opts.headers['Content-Type'];\n\t\t\t\t\tforEach(chunkInfo, function(key, value) {\n\t\t\t\t\t\tdelete opts.multi_parmas[key];\n\t\t\t\t\t});\n\t\t\t\t\tvar ctx = ctxStore[blob.uniqueName].join(',');\n\t\t\t\t\tvar data = {\n\t\t\t\t\t\tctx: ctx,\n\t\t\t\t\t\tname: blob.name,\n\t\t\t\t\t\tsize: blob.size,\n\t\t\t\t\t\tfilename: blob.uniqueName\n\t\t\t\t\t};\n\t\t\t\t\tchunkLastStep(data, opts, callback);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function() {\n\t\t\t\tthrow new Error('qiniu uploadChunk error');\n\t\t\t},\n\t\t\tonProgress: function(chunkLoaded, total) {\n\t\t\t\tvar loaded = chunkLoaded + offset;\n\t\t\t\tcallback.onProgress(loaded, opts.filesize);\n\t\t\t},\n\t\t\tonOpen: function(xhr) {\n\t\t\t\tcallback.onOpen(xhr);\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction uploadData(data, options, callback) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\tif (xhr.upload && options.support_options) {\n\t\t\txhr.upload.onprogress = function(event) {\n\t\t\t\tcallback.onProgress(event.loaded, event.total);\n\t\t\t};\n\t\t}\n\n\t\txhr.onreadystatechange = function() {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tvar result = xhr.responseText || \"{}\";\n\t\t\t\tresult = JSON.parse(result);\n\t\t\t\tresult.filename = options.unique_value;\n\t\t\t\tcallback.onCompleted(result);\n\t\t\t}\n\t\t};\n\n\t\tvar url = options.domain;\n\t\tif (options.isChunk) {\n\t\t\turl += '/mkblk/' + data.size;\n\t\t\turl = buildUrl(url, options.multi_parmas);\n\t\t}\n\t\txhr.open(options.method, url, true);\n\n\t\tcallback.onOpen(xhr);\n\n\t\tif (options.stream) {\n\t\t\txhr.setRequestHeader('authorization', 'UpToken ' + options.multi_parmas.token);\n\t\t}\n\n\t\tforEach(options.headers, function(key, value) {\n\t\t\txhr.setRequestHeader(key, value);\n\t\t});\n\t\txhr.send(data);\n\t}\n\n\tfunction uploadQiniu(file, opts, callback) {\n\t\tif (file.size && opts.chunk_size < file.size) {\n\t\t\tvar uniqueName = opts['genUId'](file);\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tuniqueName = uniqueName + suffix;\n\t\t\tfile.uniqueName = uniqueName;\n\t\t\topts.stream = true;\n\t\t\tuploadNextChunk(file, opts, callback);\n\t\t} else {\n\t\t\tvar data = opts['data'](file, opts);\n\t\t\tuploadData(data, opts, callback);\n\t\t}\n\t}\n\twin.uploadProcess = uploadQiniu;\n})(window);"
  },
  {
    "path": "integrate/message/upload/upload.js",
    "content": "(function(win) {\n\n\tvar dataType = {\n\t\tform: getFormData,\n\t\tjson: getJsonData,\n\t\tdata: getData\n\t};\n\n\tfunction genUId() {\n\t\tvar date = new Date().getTime();\n\t\tvar uuid = 'xxxxxx4xxxyxxxxxxx'.replace(/[xy]/g, function(c) {\n\t\t\tvar r = (date + Math.random() * 16) % 16 | 0;\n\t\t\tdate = Math.floor(date / 16);\n\t\t\treturn (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n\t\t});\n\t\treturn uuid;\n\t};\n\n\tfunction mergeOption(opts) {\n\t\tvar options = {\n\t\t\tdomain: '',\n\t\t\tmethod: 'POST',\n\t\t\tfile_data_name: 'file',\n\t\t\tunique_key: 'key',\n\t\t\tbase64_size: 4 * 1024 * 1024,\n\t\t\tchunk_size: 4 * 1024 * 1024,\n\t\t\theaders: {},\n\t\t\tmulti_parmas: {},\n\t\t\tquery: {},\n\t\t\tsupport_options: true,\n\t\t\tdata: dataType.form,\n\t\t\tgenUId: genUId\n\t\t};\n\t\tif (!opts || !opts.domain) {\n\t\t\tthrow new Error('domain is null');\n\t\t}\n\t\tfor (var key in opts) {\n\t\t\toptions[key] = opts[key];\n\t\t}\n\t\treturn options;\n\t}\n\n\tfunction mEach(m, callback) {\n\t\tfor (var key in m) {\n\t\t\tcallback(key, m[key]);\n\t\t}\n\t}\n\n\tfunction getFormData(file, opts) {\n\t\tvar form = new FormData();\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tform.append(opts.unique_key, unique_value);\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tform.append(opts.file_data_name, file);\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tform.append(key, value);\n\t\t});\n\t\treturn form;\n\t}\n\n\tfunction getJsonData(file, opts) {\n\t\tvar data = {};\n\t\tif (opts.unique_key) {\n\t\t\tvar suffix = file.name.substr(file.name.lastIndexOf('.'));\n\t\t\tvar unique_value = genUId() + suffix;\n\t\t\tdata[opts.unique_key] = unique_value;\n\t\t\topts.unique_value = unique_value;\n\t\t}\n\t\tdata[opts.file_data_name] = file;\n\t\tmEach(opts.multi_parmas, function(key, value) {\n\t\t\tdata[key] = value;\n\t\t});\n\t\treturn JSON.stringify(data);\n\t}\n\n\tfunction getData(file, opts) {\n\t\treturn file;\n\t}\n\n\tfunction Upload(options) {\n\t\tthis.options = mergeOption(options);\n\n\t\tthis.setOptions = function(opts) {\n\t\t\tvar me = this;\n\t\t\tmEach(opts, function(key, value) {\n\t\t\t\tme.options[key] = value;\n\t\t\t});\n\t\t};\n\n\t\tthis.upload = function(file, callback) {\n\t\t\tif (!file) {\n\t\t\t\tcallback.onError('upload file is null.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar me = this;\n\t\t\tuploadProcess(file, this.options, {\n\t\t\t\tonProgress: function(loaded, total) {\n\t\t\t\t\tcallback.onProgress(loaded, total);\n\t\t\t\t},\n\t\t\t\tonCompleted: function(data) {\n\t\t\t\t\tcallback.onCompleted(data);\n\t\t\t\t},\n\t\t\t\tonError: function(errorCode) {\n\t\t\t\t\tcallback.onError(errorCode);\n\t\t\t\t},\n\t\t\t\tonOpen: function(xhr) {\n\t\t\t\t\tme.xhr = xhr;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tthis.cancel = function() {\n\t\t\tthis.xhr && this.xhr.abort();\n\t\t};\n\t}\n\n\tfunction init(options) {\n\t\treturn new Upload(options);\n\t}\n\n\tfunction getResizeRatio(imageInfo,config){\n\t\t//hasOwnProperty?\n\n\t\tvar ratio = 1;\n\n\t\tvar oWidth = imageInfo.width;\n\t\tvar maxWidth = config.maxWidth || 0;\n\t\tif(maxWidth > 0 &&  oWidth > maxWidth){\n\t\t\tratio = maxWidth/oWidth;\n\t\t}\n\n\t\tvar oHeight = imageInfo.height;\n\t\tvar maxHeight = config.maxHeight || 0;\n\t\tif(maxHeight > 0 && oHeight > maxHeight){\n\t\t\tvar ratioHeight = maxHeight/oHeight;\n\t\t\tratio = Math.min(ratio,ratioHeight);\n\t\t}\n\n\n\t\tvar maxSize = config.maxSize || 0;\n\t\tvar oSize = Math.ceil(imageInfo.size/1000); //K，Math.ceil(0.3) = 1;\n\t\tif(oSize > maxSize){\n\t\t\tratioSize = maxSize/oSize;\n\t\t\tratio = Math.min(ratio,ratioSize);\n\t\t}\n\n\t\treturn ratio;\n\t}\n\n\tfunction resize(file,config,callback){\n\t\t//file对象没有高宽\n\t\tvar type = file.type; //image format\n\t\tvar canvas = document.createElement(\"canvas\");\n\n\t\tvar reader = new FileReader();\n\n    \treader.readAsDataURL(file);\n\t\treader.onload = function(evt){\n\t\t\tvar imageData = evt.target.result;\n\t\t\tvar img = new Image();\n\t\t\timg.src  = imageData;\n\t\t\tvar width = img.width;\n\t\t\tvar height = img.height;\n\t\t\tvar imageInfo = {\n\t\t\t\twidth : width,\n\t\t\t\theight : height,\n\t\t\t\tsize : evt.total\n\t\t\t}\n\t\t\tvar ratio = getResizeRatio(imageInfo,config);\n\t\t\tvar newImageData = imageData;\n\t\t\tif(ratio < 1){\n\t\t\t\tnewImageData = compress(img, width*ratio, height*ratio);;\n\t\t\t}\n\t\t\tcallback(newImageData);\n\t\t}\n\n\t\tfunction compress(img, width, height){\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\tvar context = canvas.getContext('2d');\n\t\t\t\tcontext.drawImage(img, 0, 0, width, height);\n\n\t\t\t/*\n\t\t\tIf the height or width of the canvas is 0, the string \"data:,\" is returned.\n\t\t\tIf the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.\n\t\t\tChrome also supports the image/webp type.\n\t\t\t*/ \n\n\t\t\tvar supportTypes = {\n\t\t\t\t\"image/jpg\" : true,\n\t\t\t\t\"image/png\" : true,\n\t\t\t\t\"image/webp\" : supportWebP()\n\t\t\t};\n\t\t\t// var exportType = \"image/png\";\n\t\t\t// if(supportTypes[type]){\n\t\t\t// \texportType = type;\n\t\t\t// } \n\t\t\t// 多端一致，缩略图必须是 jpg \n\t\t\tvar exportType = \"image/jpg\";\n\t\t\tvar newImageData = canvas.toDataURL(exportType);\n\t\t\treturn newImageData;\n\t\t}\n\n\t\tfunction supportWebP(){\n\t\t\ttry{\n        \t\treturn (canvas.toDataURL('image/webp').indexOf('data:image/webp') == 0);\n    \t\t}catch(err) {\n\t\t        return  false;\n\t\t    }\n\t\t}\n\t}\n\n\twin.UploadFile = {\n\t\tinit: init,\n\t\tdataType: dataType,\n\t\tresize : resize\n\t};\n})(window);"
  },
  {
    "path": "integrate/message/upload/uploadInit.js",
    "content": "(function(global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n        typeof define === 'function' && define.amd ? define(factory) : (global.UploadClient = factory());\n}(this, function() {\n    var calcPosition = function(width, height, opts) {\n        var isheight = width < height;\n        var scale = isheight ? height / width : width / height;\n        var zoom, x = 0,\n            y = 0,\n            w, h;\n\n        var gtScale = function() {\n            if (isheight) {\n                zoom = width / 100;\n                w = 100;\n                h = height / zoom;\n                y = (h - opts.maxHeight) / 2;\n            } else {\n                zoom = height / 100;\n                h = 100;\n                w = width / zoom;\n                x = (w - opts.maxWidth) / 2;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        \n        var ltScale = function() {\n            if (isheight) {\n                zoom = height / opts.maxHeight;\n                h = opts.maxHeight;\n                w = width / zoom;\n            } else {\n                zoom = width / opts.maxWidth;\n                w = opts.maxWidth;\n                h = height / zoom;\n            }\n            return {\n                w: w,\n                h: h,\n                x: -x,\n                y: -y\n            };\n        };\n        return scale > opts.scale ? gtScale() : ltScale();\n    };\n\n    var getBlobUrl = function(file) {\n        var URL = window.URL || window.webkitURL;\n        return URL ? URL.createObjectURL(file) : \"\";\n    };\n\n    var getThumbnail = function(file, opts, callback) {\n        var canvas = document.createElement(\"canvas\"),\n            context = canvas.getContext('2d');\n        var img = new Image();\n        img.onload = function() {\n            var pos = calcPosition(img.width, img.height, opts);\n            canvas.width = pos.w > opts.maxWidth ? opts.maxWidth : pos.w;\n            canvas.height = pos.h > opts.maxHeight ? opts.maxHeight : pos.h;\n            context.drawImage(img, pos.x, pos.y, pos.w, pos.h);\n            try {\n                var base64 = canvas.toDataURL(file.type, opts.quality);\n                var reg = new RegExp('^data:image/[^;]+;base64,');\n                base64 = base64.replace(reg, '');\n                callback(base64);\n            } catch (e) {\n                throw new Error(e);\n            }\n        };\n        img.src = typeof file == 'string' ? 'data:image/jpg;base64,' + file : getBlobUrl(file);\n    };\n\n    var _compress = function(data, callback) {\n        var file = data.file;\n        var opts = data.compress;\n        getThumbnail(file, opts, callback);\n    };\n\n    _init = function(config, callback) {\n        if (config.getToken) {\n            config.getToken(function(token) {\n                config.multi_parmas || (config.multi_parmas = {});\n                config.multi_parmas.token = token;\n                config.headers || (config.headers = {});\n                if (config.base64) {\n                    config.headers['Content-type'] = 'application/octet-stream';\n                    config.headers['Authorization'] = 'UpToken ' + token;\n                }\n                var instance = UploadFile.init(config);\n                callback(instance);\n            });\n        } else {\n            config.headers || (config.headers = {});\n            if (config.base64) {\n                config.headers['Content-type'] = 'application/octet-stream';\n            }\n            var instance = UploadFile.init(config);\n            callback(instance);\n        }\n    };\n\n    var _upload = function(data, instance, callback) {\n        instance.upload(data.file, {\n            onError: function(errorCode) {\n                callback.onError(errorCode);\n            },\n            onProgress: function(loaded, total) {\n                callback.onProgress(loaded, total);\n            },\n            onCompleted: function(result) {\n                result.filename || (result.filename = result.hash);\n                var compress = data.compressThumbnail || _compress;\n                if (data.compress) {\n                    compress(data, function(thumbnail) {\n                        result.thumbnail = thumbnail;\n                        callback.onCompleted(result);\n                    });\n                } else {\n                    callback.onCompleted(result);\n                }\n            }\n        });\n    };\n\n    var File = function(instance) {\n        var me = this;\n        this.instance = instance\n        this.upload = function(file, callback) {\n            var data = {\n                file: file\n            };\n            _upload(data, me.instance, callback);\n        };\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initFile = function(config, callback) {\n        _init(config, function(instance) {\n            var uploadFile = new File(instance);\n            callback(uploadFile);\n        });\n    };\n\n    var Img = function(instance, cfg) {\n        var me = this;\n        this.cfg = cfg;\n        this.instance = instance;\n        this.upload = function(file, callback) {\n            var data = {\n                file: file,\n                compress: me.cfg\n            };\n            _upload(data, me.instance, callback);\n        };\n\n        this.cancel = function() {\n            me.instance.cancel();\n        };\n    };\n\n    var initImage = function(config, callback) {\n        _init(config, function(instance) {\n            var compress = {\n                maxHeight: config.height || 240,\n                maxWidth: config.width || 240,\n                quality: config.quality || 0.5,\n                scale: config.scale || 2.4\n            };\n            var uploadImage = new Img(instance, compress);\n            callback(uploadImage);\n        });\n    };\n\n    var ImgBase64 = function(config) {\n        config.base64 = true;\n        Img.call(this, config);\n    };\n\n    var initImgBase64 = function(config, callback) {\n        config.base64 = true;\n        initImage.call(this, config, callback);\n    };\n\n    return {\n        initFile: initFile,\n        initImage: initImage,\n        initImgBase64: initImgBase64,\n        dataType: UploadFile.dataType\n    };\n}));"
  },
  {
    "path": "integrate/public/js/public-article.js",
    "content": "/**\n * Created by wangchengkuo on 17/4/12.\n */\nfunction getPublicArticle(_options) {\n    var options = {\n        props: ['stat'],\n        template: 'template/public-article.html',\n        methods: {\n            goPublicChat: function () {\n                this.stat.currentView = 'publicChat';\n            }\n        },\n        mounted:function () {\n            $('title').text(this.stat.currentView);\n        }\n    };\n    return common.getComponent(options);\n}"
  },
  {
    "path": "integrate/public/js/public-chat.js",
    "content": "/**\n * Created by wangchengkuo on 17/4/12.\n */\nfunction getPublicChat(instance,_options) {\n    var options = {\n        props: ['stat'],\n        template: 'template/public-chat.html',\n        methods: {\n            goPublicList: function () {\n                this.stat.currentView = 'publicList';\n            },\n            goPublicInfo: function () {\n                this.stat.currentView = 'publicInfo';\n            },\n            goPublicArticle: function (url) {\n                this.stat.currentView = 'publicArticle';\n                this.stat.articleUrl = url;\n            },\n            sendMsg: function () {\n                var that = this;\n                var text = this.stat.sendMsgVal || 'hello';\n                var msg = new RongIMLib.TextMessage({content: text, extra: \"公众号\"});\n                var conversationtype = RongIMLib.ConversationType.PUBLIC_SERVICE;\n                var targetId = this.stat.currentPublic.publicServiceId;\n                instance.sendMessage(conversationtype, targetId, msg, {\n                        // 发送消息成功\n                        onSuccess: function (message) {\n                            //message 为发送的消息对象并且包含服务器返回的消息唯一Id和发送消息时间戳\n                            console.log(\"Send successfully\");\n                            that.stat.msgList.push(message);\n                            that.stat.sendMsgVal = '';\n                            that.$nextTick(that.scrollEnd);\n                        },\n                        onError: function (errorCode, message) {\n                            var info = '';\n                            switch (errorCode) {\n                                case RongIMLib.ErrorCode.TIMEOUT:\n                                    info = '超时';\n                                    break;\n                                case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n                                    info = '未知错误';\n                                    break;\n                                case RongIMLib.ErrorCode.REJECTED_BY_BLACKLIST:\n                                    info = '在黑名单中，无法向对方发送消息';\n                                    break;\n                                case RongIMLib.ErrorCode.NOT_IN_DISCUSSION:\n                                    info = '不在讨论组中';\n                                    break;\n                                case RongIMLib.ErrorCode.NOT_IN_GROUP:\n                                    info = '不在群组中';\n                                    break;\n                                case RongIMLib.ErrorCode.NOT_IN_CHATROOM:\n                                    info = '不在聊天室中';\n                                    break;\n                                default :\n                                    info = '未知';\n                                    break;\n                            }\n                            console.log('发送失败:' + info);\n                        }\n                    }\n                );\n            },\n            renderHistoryMessages: function (targetId, callback) {\n                //获取历史消息\n                instance.getHistoryMessages(RongIMLib.ConversationType.PUBLIC_SERVICE, targetId, 0, 20, {\n                    onSuccess: function (list, hasMsg) {\n                        //console.log(arguments);\n                        callback(list, hasMsg);\n                        // hasMsg为boolean值，如果为true则表示还有剩余历史消息可拉取，为false的话表示没有剩余历史消息可供拉取。\n                        // list 为拉取到的历史消息列表\n                    },\n                    onError: function (error) {\n                        console.log('获取历史消息error' + error);\n                        // APP未开启消息漫游或处理异常\n                        // throw new ERROR ......\n                    }\n                });\n            },\n            scrollEnd: function () {\n                //添加完消息 跳转到最后一条\n                var list = document.querySelectorAll('.message-item');\n                if (list.length && list.length - 1) {\n                    var last = list[list.length - 1];\n                    last.scrollIntoView();\n                }\n\n\n            }\n        },\n        mounted: function () {\n            //console.log(this.stat.currentPublic.menu);\n            var that = this;\n            var targetId = this.stat.currentPublic.publicServiceId;\n\n\n            //渲染历史消息\n            /*this.renderHistoryMessages(targetId,function (list,hasMsg) {\n             if (list.length) {\n             that.stat.msgList=list;\n             console.log(list)\n             }\n             that.$nextTick(that.scrollEnd);\n             });*/\n\n\n            //模拟获取历史消息\n            //获取用户info\n            $.getJSON('public-mock-data.json?11', function (data) {\n                console.log(data);\n                var userInfo = data.userInfo;\n                that.stat.userInfo = userInfo;\n                var msgList = data.msgList;\n                that.stat.msgList = msgList;\n            });\n\n            $('title').text(this.stat.currentView);\n\n        }\n    };\n    return common.getComponent(options);\n}"
  },
  {
    "path": "integrate/public/js/public-common.js",
    "content": "/**\n * Created by wangchengkuo on 17/4/12.\n */\n(function (window) {\n    \"use strict\";\n\n    function getComponent(options) {\n        return function (resolve, reject) {\n            $.get(options.template).then(function (html) {\n                var component = $.extend({}, options, {template: html});\n                resolve(component);\n            }).fail(function (xhr, status, error) {\n                console.info('getComponent error', options);\n                reject(error);\n            });\n        };\n    }\n\n    window.common = {\n        getComponent: getComponent\n    };\n})(window);"
  },
  {
    "path": "integrate/public/js/public-info.js",
    "content": "/**\n * Created by wangchengkuo on 17/4/12.\n */\nfunction getPublicInfo(instance,_options) {\n    var options = {\n        props: ['stat'],\n        template: 'template/public-info.html',\n        methods: {\n            goPublicChat: function () {\n                this.stat.currentView = 'publicChat';\n            },\n            unsubscribePublic: function () {\n                var that=this;\n                var publicServiceType = RongIMLib.ConversationType.APP_PUBLIC_SERVICE; //固定值\n                if(this.stat.currentPublic.conversationType == 8){\n                    publicServiceType = RongIMLib.ConversationType.PUBLIC_SERVICE\n                }\n                var publicServiceId = this.stat.currentPublic.publicServiceId;\n                instance.unsubscribePublicService(publicServiceType, publicServiceId, {\n                    onSuccess: function (list) {\n                        console.log(\"取消订阅公众号 成功\");\n                        console.log(list);\n                        that.stat.currentPublic.hasFollowed=false;\n                    },\n                    onError: function (error) {\n                        console.log(\"取消订阅公众号 失败\");\n                    }\n                });\n            },\n            subscribePublic: function () {\n                var that=this;\n\n                var publicServiceType = RongIMLib.ConversationType.APP_PUBLIC_SERVICE; //固定值\n                if(this.stat.currentPublic.conversationType == 8){\n                    publicServiceType = RongIMLib.ConversationType.PUBLIC_SERVICE\n                }\n                var publicServiceId = this.stat.currentPublic.publicServiceId;\n                instance.subscribePublicService(publicServiceType, publicServiceId, {\n                    onSuccess: function (list) {\n                        console.log(\"订阅公众号 成功\");\n                        console.log(list);\n                        that.stat.currentPublic.hasFollowed=true;\n                    },\n                    onError: function (error) {\n                        console.log(\"订阅公众号 失败\");\n                    }\n                });\n            },\n            goPublicSearch: function () {\n                this.stat.currentView = 'publicSearch';\n            }\n        },\n        mounted: function () {\n            $('title').text(this.stat.currentView);\n        }\n    };\n    return common.getComponent(options);\n}"
  },
  {
    "path": "integrate/public/js/public-list.js",
    "content": "/**\n * Created by wangchengkuo on 17/4/12.\n */\nfunction getPublicList(instance,_options) {\n    var options = {\n        props: ['stat'],\n        template: 'template/public-list.html',\n        methods: {\n            getPublicServiceList: function () {\n                /*\n                 getRemotePublicServiceList = function (mpId, conversationType, pullMessageTime, callback)\n                 */\n                var that = this;\n\n                /*$.getJSON('public-mock-data.json', function (data) {\n                    console.log(data);\n                    that.stat.publicList = data.publicList;\n                    return false;\n                });*/\n\n\n                instance.getPublicServiceList({\n                    onSuccess: function (list) {\n                        console.log(\"获取已关注公众号 成功\");\n                        that.stat.publicList = list;\n                    },\n                    onError: function (error) {\n                        console.log(\"获取已关注公众号 失败\");\n                    }\n                });\n            },\n            publicAdd: function () {\n                this.stat.currentView = \"publicSearch\";\n            },\n            goPublicChat: function (item) {\n                this.stat.currentView = 'publicChat';\n                this.stat.currentPublic = item;\n            }\n        },\n        mounted: function () {\n            this.getPublicServiceList();\n            $('title').text(this.stat.currentView);\n        }\n    };\n    return common.getComponent(options);\n}"
  },
  {
    "path": "integrate/public/js/public-search.js",
    "content": "/**\n * Created by wangchengkuo on 17/4/12.\n */\nfunction getPublicSearch(instance,_options) {\n    var options = {\n        props: ['stat'],\n        template: 'template/public-search.html',\n        methods: {\n            publicSearch: function () {\n\n                var that = this;\n                /*$.getJSON('public-mock-data.json', function (data) {\n                    var listUnFollowed = [];\n                    $(data.searchList).each(function () {\n                        this.hasFollowed == false && listUnFollowed.push(this);\n                    });\n\n                    that.stat.searchList = listUnFollowed;\n\n                });\n                return false;*/\n\n                var keywords = this.stat.searchVal;\n                var searchType = 1; //[0-exact 1-fuzzy]\n                instance.searchPublicService(searchType, keywords, {\n                    onSuccess: function (list) {\n                        //console.log(\"查找公众号 成功\");\n                        //that.stat.searchList=list;\n                        var listUnFollowed = [];\n                        $(list).each(function () {\n                            this.hasFollowed == false && listUnFollowed.push(this);\n                        });\n                        if(listUnFollowed.length == 0){\n                            that.stat.searchResult = false;\n                            that.stat.searchList=[];\n                        }else {\n                            that.stat.searchResult = true;\n                            that.stat.searchList = listUnFollowed;\n                        }\n\n\n                    },\n                    onError: function (error) {\n                        console.log(\"查找公众号 失败\");\n                    }\n                });\n            },\n            goPublicInfo: function (item) {\n                this.stat.currentView = 'publicInfo';\n                this.stat.currentPublic = item;\n            },\n            goPublicList: function () {\n                this.stat.currentView = \"publicList\";\n            }\n        },\n        mounted: function () {\n            $('title').text(this.stat.currentView);\n        }\n    };\n    return common.getComponent(options);\n}"
  },
  {
    "path": "integrate/public/public-guide.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>公众号 集成引导</title>\n</head>\n<link rel=\"stylesheet\" href=\"../integrate.css\">\n<script src=\"../lib/jquery-3.1.1.js\"></script>\n<body>\n<div class=\"wrap\">\n    <h1>公众号 集成引导</h1>\n\n    <div class=\"guide\">\n        <div class=\"steps\">\n            <h2>1.准备工作</h2>\n            <div class=\"content\">\n                <p>公众号创建流程: </p>\n                <ol>\n                    <li>1.在公众号系统: <a href=\"http://public.rongcloud.cn\">http://public.rongcloud.cn</a>  创建公众号并更新发布</li>\n                    <li>2.登录 开发者管理后台 <a href=\"https://developer.rongcloud.cn\">https://developer.rongcloud.cn</a> 通过 “公众服务平台 => 添加私有公众号”给 app 添加公众号,添加私有公众号需要应用申请上线，上线后页面右上角出现添加私有公众号按钮（公众号为填写公众平台 => 公众号设置 => 公众号，公众号识别码为公众平台 => APP 接入模式设置 => 私有模式 => 当前识别码）</li>\n                    <li>3.用户可以在第二步的添加结果里进行搜索和关注操作，关注后可以通过消息监听接受公众号的推送，用户也可以给公众号留言，具体细节参考页面里的示例代码和注释。</li>\n                </ol>\n                <p>调试 demo: <a href=\"https://rongcloud.github.io/websdk-demo/api-test.html\">https://rongcloud.github.io/websdk-demo/api-test.html</a></p>\n\t\t\t\t<p>集成 demo: <a href=\"public.html\">public.html</a></p>\n            </div>\n        </div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>2.集成的思路</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>页面分配</p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>0.公众号模板主页 <a href=\"public.html\">public.html</a></li>\n\t\t\t\t\t<li>1.公众号列表页 <a class=\"transSource\" href=\"template/public-list.html\">public-list.html</a></li>\n\t\t\t\t\t<li>2.公众号搜索页 <a class=\"transSource\" href=\"template/public-search.html\">public-search.html</a></li>\n\t\t\t\t\t<li>3.公众号详情页 <a class=\"transSource\" href=\"template/public-info.html\">public-info.html</a></li>\n\t\t\t\t\t<li>4.公众号聊天页 <a class=\"transSource\" href=\"template/public-chat.html\">hpublic-chat.html</a></li>\n\t\t\t\t\t<li>5.公众号推送文章页 <a class=\"transSource\" href=\"template/public-article.html\">public-article.html</a></li>\n\t\t\t\t</ol>\n\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>3.引入 SDK，并完成初始化、链接云端</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>初始化参考: <a href=\"../init.js\">init.js</a></p>\n<pre>\nvar userInfo = {\n\tappKey: \"\",\n\ttoken: \"\"\n};\nvar callbacks = {\n\tCONNECTED: function (instance) {\n\t},\n\tSuccess: function (id) {\n\t},\n\tReceived: function (message) {\n\t}\n};\ninit(userInfo, callbacks);\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>4.公众号列表页</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>html: <a class=\"transSource\" href=\"template/public-list.html\">public-list.html</a></p>\n\t\t\t\t<p>js: <a href=\"js/public-list.js\">public-list.js</a></p>\n\t\t\t\t<p>公众号列表数据模型 <a href=\"public-mock-data.json\">public-mock-data.json</a> 中的 \"publicList\"</p>\n\t\t\t\t<p>变量解释: </p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>conversationType : 7, 私有云里只有应用公众服务（MC） 8, 公有公众服务（MP）</li>\n\t\t\t\t\t<li>hasFollowed : 是否关注 </li>\n\t\t\t\t\t<li>introduction : 功能描述</li>\n\t\t\t\t\t<li>isGlobal : 是否全局</li>\n\t\t\t\t\t<li>menu : 自定义菜单</li>\n\t\t\t\t\t<li>name : 昵称</li>\n\t\t\t\t\t<li>portraitUri : 头像 url</li>\n\t\t\t\t\t<li>publicServiceId : 公众号 id</li>\n\t\t\t\t</ol>\n<pre>\n//获取已关注公众号\nRongIMClient.getInstance().getPublicServiceList({\n\tonSuccess: function (list) {\n\t\tconsole.log(\"获取已关注公众号成功\");\n\t}\n});\n</pre>\n\n\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>5.公众号搜索页</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>html: <a class=\"transSource\" href=\"template/public-search.html\">public-search.html</a></p>\n\t\t\t\t<p>js: <a href=\"js/public-search.js\">public-search.js</a></p>\n\t\t\t\t<p>公众号搜索数据模型 <a href=\"public-mock-data.json\">public-mock-data.json</a> 中的 \"searchList\"</p>\n<pre>\n//根据用户输入关键字搜索未关注公众号\nvar keywords = this.stat.searchVal;\nvar searchType = 1; //[0-exact 1-fuzzy]\nRongIMClient.getInstance().searchPublicService(searchType, keywords, {\n\tonSuccess: function (list) {\n\t\t//console.log(\"查找公众号成功\");\n\t\t//list 为匹配到的所以结果\n\t\t//that.stat.searchList=list;\n\t\tvar listUnFollowed = [];\n\t\t$(list).each(function () {\n\t\t\tthis.hasFollowed == false && listUnFollowed.push(this);\n\t\t});\n\t}\n});\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>6.公众号详情页</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>html: <a class=\"transSource\" href=\"template/public-info.html\">public-info.html</a></p>\n\t\t\t\t<p>js: <a href=\"js/public-info.js\">public-info.js</a></p>\n\t\t\t\t<p>公众号详情数据模型 <a href=\"public-mock-data.json\">public-mock-data.json</a> \"searchList\" 中的对象</p>\n<pre>\n//订阅公众号\nvar publicServiceType = RongIMLib.ConversationType.PUBLIC_SERVICE;\nRongIMClient.getInstance().subscribePublicService(publicServiceType, publicServiceId, {\n\tonSuccess: function (list) {\n\t\tconsole.log(\"订阅公众号成功\");\n\t}\n});\n\n//取消订阅公众号\nRongIMClient.getInstance().unsubscribePublicService(publicServiceType, publicServiceId, {\n\tonSuccess: function (list) {\n\t\tconsole.log(\"取消订阅公众号成功\");\n\t}\n});\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>7.公众号聊天页</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>html: <a class=\"transSource\" href=\"template/public-chat.html\">public-chat.html</a></p>\n\t\t\t\t<p>js: <a href=\"js/public-chat.js\">public-chat.js</a></p>\n\t\t\t\t<p>公众号回复用户消息在 <a href=\"http://public.rongcloud.cn\">公众平台</a> => 用户回复</p>\n\t\t\t\t<p>公众号聊天消息数据模型 <a href=\"public-mock-data.json\">public-mock-data.json</a> \"msgList\" 中 \"messageType\" = \"TextMessage\" 为文本消息，\"messageType\" = \"PublicServiceMultiRichContentMessage\"为公众号推送多图文消息</p>\n\t\t\t\t<p>变量解释: </p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>messageDirection : 1, 发送消息方 2, 接收消息方</li>\n\t\t\t\t\t<li>messageType : 消息类型 </li>\n\t\t\t\t\t<li>articles : 公众号推送图文</li>\n\t\t\t\t\t<li>picurl : 文章预览图 url 地址</li>\n\t\t\t\t\t<li>title : 文章标题</li>\n\t\t\t\t\t<li>url : 文章地址</li>\n\t\t\t\t</ol>\n<pre>\n//发送消息\nvar text = this.stat.sendMsgVal ;\nvar msg = new RongIMLib.TextMessage({content: text, extra: \"公众号\"});\nRongIMClient.getInstance().sendMessage(conversationtype, publicServiceId, msg, {\n\tonSuccess: function (message) {\n\t\t//发送成功后 渲染已发送消息\n\t\tthat.stat.msgList.push(message);\n\t}\n});\n</pre>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"steps\">\n\t\t\t<h2>8.公众号推送文章页</h2>\n\t\t\t<div class=\"content\">\n\t\t\t\t<p>html: <a class=\"transSource\" href=\"template/public-article.html\">public-article.html</a></p>\n\t\t\t\t<p>js: <a href=\"js/public-article.js\">public-article.js</a></p>\n\t\t\t\t<p>公众号向用户推送文章在 <a href=\"http://public.rongcloud.cn\">公众平台</a> => 消息推送</p>\n\t\t\t\t<p>公众号推送文章地址为 <a href=\"public-mock-data.json\">public-mock-data.json</a> \"msgList\" 中 \"messageType\" = \"PublicServiceMultiRichContentMessage\" 公众号推送多图文消息 articles.url</p>\n<pre>\n//文章内容嵌套在 iframe 中\n&lt;iframe :src=\"stat.articleUrl\">&lt;/iframe>\n</pre>\n\t\t\t</div>\n\n\t\t</div>\n\n\t</div>\n\n</div>\n\n\n</body>\n</html>"
  },
  {
    "path": "integrate/public/public-mock-data.json",
    "content": "{\n  \"publicList\": [\n    {\n      \"conversationType\": 8,\n      \"introduction\": \"北京吃货--专注北京本地美食推荐、分享、试吃、活动。配合探店、线下活动、爆料等。【北京吃货】北京地区第一美食微信平台！\",\n      \"name\": \"北京吃货\",\n      \"menu\": [],\n      \"portraitUri\": \"http://rongcloud-file.ronghub.com/4a962843f4b0a43230.jpeg?attname=bjch.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:yzX_Dk3ZcvajMk9H715dwBZ-LIs=\",\n      \"publicServiceId\": \"beijingchihuo\",\n      \"hasFollowed\": true,\n      \"isGlobal\": false\n    },\n    {\n      \"conversationType\": 8,\n      \"introduction\": \"认准仅此一号！！其余都是山寨！！！我们致力于打造成为北京地区最具影响力和最有价值的新媒体。新浪微博@北京全攻略 唯一公众平台。\",\n      \"name\": \"北京全攻略\",\n      \"menu\": [],\n      \"portraitUri\": \"http://rongcloud-file.ronghub.com/3629434a209b942faf.jpeg?attname=bjqgl.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:14AC6jMdam60M4_yS53WE_8BFeE=\",\n      \"publicServiceId\": \"beijingquangonglv\",\n      \"hasFollowed\": true,\n      \"isGlobal\": false\n    }\n  ],\n  \"searchList\":[\n    {\n      \"conversationType\": 8,\n      \"introduction\": \"北京旅游官方微信，订门票，查攻略，品美食，给您推荐京郊哪好玩儿，周末去哪玩儿，还有免费门票大派送！是玩货们必备的公众号！\",\n      \"name\": \"北京旅游\",\n      \"menu\": [],\n      \"portraitUri\": \"http://rongcloud-file.ronghub.com/48d1b84d1eb2d50f36.jpeg?attname=bjly.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:1z1wIXiLBVFJoQzv2tahCoTCChs=\",\n      \"publicServiceId\": \"beijinglvyou\",\n      \"hasFollowed\": false,\n      \"isGlobal\": false\n    },\n    {\n      \"conversationType\": 8,\n      \"introduction\": \"认准大脸头像的啊！！！其余都是山寨！！！\",\n      \"name\": \"吃喝玩乐在北京\",\n      \"menu\": [],\n      \"portraitUri\": \"http://rongcloud-file.ronghub.com/6cafd84689bdbeb278.jpeg?attname=chwl.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:rfAEX7TpJCs7VkfGVrzMLlsAuIE=\",\n      \"publicServiceId\": \"beijingchihe\",\n      \"hasFollowed\": false,\n      \"isGlobal\": false\n    },\n    {\n      \"conversationType\": 8,\n      \"introduction\": \"北京吃货--专注北京本地美食推荐、分享、试吃、活动。配合探店、线下活动、爆料等。【北京吃货】北京地区第一美食微信平台！\",\n      \"name\": \"北京吃货\",\n      \"menu\": [],\n      \"portraitUri\": \"http://rongcloud-file.ronghub.com/4a962843f4b0a43230.jpeg?attname=bjch.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:yzX_Dk3ZcvajMk9H715dwBZ-LIs=\",\n      \"publicServiceId\": \"beijingchihuo\",\n      \"hasFollowed\": true,\n      \"isGlobal\": false\n    },\n    {\n      \"conversationType\": 8,\n      \"introduction\": \"认准仅此一号！！其余都是山寨！！！我们致力于打造成为北京地区最具影响力和最有价值的新媒体。新浪微博@北京全攻略 唯一公众平台。\",\n      \"name\": \"北京全攻略\",\n      \"menu\": [],\n      \"portraitUri\": \"http://rongcloud-file.ronghub.com/3629434a209b942faf.jpeg?attname=bjqgl.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:14AC6jMdam60M4_yS53WE_8BFeE=\",\n      \"publicServiceId\": \"beijingquangonglv\",\n      \"hasFollowed\": true,\n      \"isGlobal\": false\n    }\n  ],\n  \"userInfo\":{\n    \"user1\": {\n      \"appKey\": \"82hegw5u8mqwx\",\n      \"userId\": \"1\",\n      \"userToken\": \"pQn8OduE596/gGzLZVUheTCvQwRQ4mI0ws9X674LamI4CpgvufNZRf5krbtH6T1AuPrNawarRocdJ9HGgnMMVA==\",\n      \"userName\": \"user1\",\n      \"portraitUri\": \"http://img.duoziwang.com/2016/12/08/18594927932.jpg\"\n    }\n  },\n  \"msgList\":[\n    {\n      \"content\": {\n        \"messageName\": \"PublicServiceMultiRichContentMessage\",\n        \"richContentMessages\": {\n          \"articles\": [\n            {\n              \"digest\": \"\",\n              \"picurl\": \"http://7xi6ox.com1.z0.glb.clouddn.com/22c7962d13ca81da353f003e4af42347\",\n              \"title\": \"如果你来过了北京，就等于去了全世界!\",\n              \"url\": \"//public.rongcloud.cn/view/5F3DBDAAEE94639438CC1AFF2601A035\"\n            },\n            {\n              \"digest\": \"\",\n              \"picurl\": \"http://www.rongcloud.cn/images/newVersion/ewm.png?0721\",\n              \"title\": \"融云 SDK 版本更新（ Android 2.8.9 Stable；iOS 2.8.9 Stable ）\",\n              \"url\": \"//public.rongcloud.cn/view/95B92A7E6DA604E6AADDE20A8110067E\"\n            }\n          ],\n          \"extra\": \"\",\n          \"user\": {\n            \"id\": \"\",\n            \"name\": \"\",\n            \"portrait\": \"\"\n          }\n        }\n      },\n      \"conversationType\": 8,\n      \"objectName\": \"RC:PSMultiImgTxtMsg\",\n      \"messageDirection\": 2,\n      \"messageId\": \"8_2526138\",\n      \"receivedStatus\": 0,\n      \"receivedTime\": 1492566484293,\n      \"senderUserId\": \"Ddaijia\",\n      \"sentTime\": 1492566483541,\n      \"targetId\": \"Ddaijia\",\n      \"messageType\": \"PublicServiceMultiRichContentMessage\",\n      \"messageUId\": \"5DO7-P929-L2KP-MC3I\",\n      \"offLineMessage\": false\n    },\n    {\n      \"content\": {\n        \"messageName\": \"TextMessage\",\n        \"content\": \"欢迎关注融云公众号！融云提供的即时通讯云服务是将即时通讯技术封装成 SDK 供全球开发者下载使用，并向开发者提供平台环境、技术支持以及后期运维等服务，使开发者的业务能够快速获得即时通讯的能力，实现单聊、群聊等功能，满足社交、客服、聊天室等场景需要。\",\n        \"extra\": \"\",\n        \"user\": {\n          \"id\": \"\",\n          \"name\": \"\",\n          \"portrait\": \"\"\n        }\n      },\n      \"conversationType\": 8,\n      \"objectName\": \"RC:TxtMsg\",\n      \"messageDirection\": 2,\n      \"messageId\": \"8_9610526\",\n      \"receivedStatus\": 0,\n      \"receivedTime\": 1492567191203,\n      \"senderUserId\": \"Ddaijia\",\n      \"sentTime\": 1492567169609,\n      \"targetId\": \"Ddaijia\",\n      \"messageType\": \"TextMessage\",\n      \"messageUId\": \"5DO7-RSQ9-5000-001H\",\n      \"offLineMessage\": true\n    }\n  ]\n}"
  },
  {
    "path": "integrate/public/public.css",
    "content": "@charset \"utf-8\";\n\nhtml, body {\n    height: 100%;\n}\n\n.hide {\n    display: none !important;\n}\n\n.header {\n    position: absolute;\n    display: flex;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 1.16rem;\n    line-height: 1.16rem;\n    background: #393a3f;\n    z-index: 99;\n    color: #fff;\n}\n\n.header .title {\n    flex: 1;\n    font-size: 0.45rem;\n    padding-left: 0.3rem;\n}\n\n#publicPage {\n    width: 100%;\n    height: 100%;\n}\n\n#publicPage em {\n    font-style: normal;\n}\n\n.icons {\n    display: inline-block;\n    width: 1.16rem;\n    height: 1.16rem;\n    background-color: transparent;\n    background-image: url(images/public-icons.png?11);\n    background-size: 1.2rem auto;\n    background-repeat: no-repeat;\n    background-position: 0.35rem 0.35rem;\n}\n\n.icon-return:after {\n    content: '';\n    display: block;\n    width: 1px;\n    height: 0.76rem;\n    background-color: #2e2d32;\n    margin-left: 1.16rem;\n    margin-top: 0.2rem;\n}\n\n.icon-search,\n.icon-add {\n    color: #fff;\n    border: none;\n    font-size: 0;\n}\n\n.icon-search {\n    background-position: 0.35rem -0.8rem\n}\n\n.icon-add {\n    background-position: 0.35rem -3.02rem;\n    margin-right: 0.1rem;\n}\n\n.public-search-btn {\n    display: inline-block;\n    width: 1.4rem;\n    height: 0.7rem;\n    font-size: 0.4rem;\n    color: #fff;\n    border: 1px solid #179e16;\n    border-radius: 3px;\n    background-color: #1aad19;\n\n}\n\n/* 公众号列表页 */\n.public-list-content {\n    margin-top: 1.16rem;\n    overflow-y: auto;\n}\n\n.public-list-item {\n    display: flex;\n    align-items: center;\n    padding: 0.3rem;\n    font-size: 0.4rem;\n    border-top: 1px solid #dfdfdf;\n}\n\n.public-list-item.item-without {\n    justify-content: center;\n    background: none;\n    margin-top: 2rem;\n    font-size: 0.42rem;\n    border: 0;\n}\n\n.public-list-item .rong-avatar {\n    border-radius: 0;\n    border: 0;\n}\n\n.rong-item-main {\n    overflow: hidden;\n    width: 100%;\n}\n\n.public-letter-title {\n    width: 100%;\n    height: 0.5rem;\n    line-height: 0.5rem;\n    background-color: #ebebeb;\n    padding-left: 0.5rem;\n    font-size: 0.3rem;\n}\n\n.public-letter-content {\n    padding: 0 0.5rem;\n}\n\n.rong-avatar {\n    border: 1px solid #d2d0ce;\n    border-radius: 50%;\n    width: 1.1rem;\n    height: 1.1rem;\n    overflow: hidden;\n}\n\n.public-item-content {\n    display: flex;\n    width: 100%;\n    padding: 0.25rem 0;\n    font-size: 0.4rem;\n    align-items: center;\n}\n\n.rong-avatar img {\n    width: 100%;\n}\n\n.rong-conversation-attr {\n    margin-left: 0.5rem;\n    display: flex;\n    justify-content: space-between;\n}\n\n.rong-conversation-name {\n    color: #363636;\n    font-size: 0.4rem;\n}\n\n.rong-conversation-time {\n    color: #bbbbbb;\n    font-size: 0.25rem;\n}\n\n.rong-conversation-message {\n    margin-left: 0.5rem;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n    padding-right: 1.5rem;\n    color: #989898;\n    font-size: 0.35rem;\n    margin-top: 0.05rem;\n}\n\n/*\n.public-item-content:nth-child(n+1) {\n    border-top: 1px solid #e1e1e1;\n}*/\n\n/* 公众号搜索页 */\n.public-search-wrap {\n    display: flex;\n    align-items: center;\n    border-bottom: 1px solid #45bf1b;\n    width: 100%;\n    margin: 0.15rem 0.3rem;\n}\n\n.public-search-field {\n    display: inline-block;\n    vertical-align: top;\n    border: 0;\n    background: transparent;\n    font-size: 0.4rem;\n    width: 80%;\n    height: 0.7rem;\n    text-indent: 0.2rem;\n    color: #fff;\n}\n\n.public-search-result {\n    background-color: #fdfdfd;\n    margin-top: 1.16rem;\n    padding: 0.4rem;\n}\n\n.public-search-result .title {\n    font-size: 0.44rem;\n    color: #a0a0a0;\n    height: 1rem;\n}\n\n.public-search-item {\n    display: flex;\n    align-items: center;\n    padding: 0.3rem;\n    font-size: 0.4rem;\n    overflow: hidden;\n}\n\n.public-search-item:nth-child(n+1) {\n    border-bottom: 1px solid #dfdfdf;\n}\n\n.public-search-item .rong-avatar {\n    border: 0;\n}\n\n.public-search-item .rong-conversation-message {\n    padding-right: 0;\n    display: -webkit-box;\n    overflow: hidden;\n    white-space: normal;\n    text-overflow: ellipsis;\n    word-break: break-all;\n    -webkit-box-orient: vertical;\n    -webkit-line-clamp: 2;\n}\n\n/* 公众号信息页面 */\n.public-info {\n    width: 100%;\n    height: 100%;\n    background-color: #ebebeb;\n}\n\n.public-info-con {\n    margin-top: 1.16rem;\n}\n\n.public-info-avatar {\n    display: flex;\n    align-items: center;\n    padding: 0.5rem;\n}\n\n.public-info-avatar .rong-avatar {\n    width: 1.8rem;\n    height: 1.8rem;\n}\n\n.public-info-name {\n    margin-left: 0.5rem;\n    font-size: 0.6rem;\n    overflow: hidden;\n    color: #353535;\n}\n\n.public-info-intro {\n    display: flex;\n    background-color: #fff;\n    padding: 0.4rem 0.4rem;\n}\n\n.public-info-intro .title {\n    font-size: 0.45rem;\n    color: #353535;\n    white-space: nowrap;\n}\n\n.public-introduction {\n    font-size: 0.4rem;\n    margin-left: 0.4rem;\n    color: #999999;\n}\n\n.public-info-history {\n    display: flex;\n    background-color: #fff;\n    padding: 0.4rem 0.4rem;\n    margin-top: 0.5rem;\n}\n\n.public-info-history .title {\n    font-size: 0.45rem;\n    color: #353535;\n    white-space: nowrap;\n}\n\n.subscribePublic,\n.enterPublic,\n.unsubscribePublic {\n    display: inline-block;\n    width: 100%;\n    padding: 0 0.3rem;\n    height: 1.2rem;\n    vertical-align: top;\n    font-size: 0.4rem;\n    border: 1px solid #179e16;\n    border-radius: 3px;\n    background: #1aad19;\n    color: #fff;\n    margin-bottom: 0.4rem;\n}\n\n.public-info-btns {\n    margin-top: 0.5rem;\n    padding: 0 0.4rem;\n}\n\n/* 公众号消息页面 */\n.public-info-btn {\n    font-size: 0;\n    border: 0;\n    background-position: 0.25rem -4.2rem;\n}\n\n.chat-content {\n    position: absolute;\n    z-index: 1;\n    top: 1.16rem;\n    bottom: 1.21rem;\n    left: 0;\n    width: 100%;\n    overflow-y: scroll;\n    background-color: #ebebeb;\n}\n\n.chat-content .message-wrapper {\n    padding: 0 0.5rem;\n}\n\n.message-item:nth-child(n+1) {\n    margin-top: 0.4rem;\n}\n\n.message-text {\n    display: flex;\n    /*padding: 0.3rem 0;*/\n    font-size: 0.4rem;\n}\n\n.my-msg .message-text {\n    flex-direction: row-reverse;\n}\n\n.you-msg .message-text {\n    padding-left: 1.39rem;\n}\n\n.message-text .rong-avatar {\n    border-radius: 0;\n    border: 0;\n}\n\n.message-text .message-body {\n    flex: 1;\n    position: relative;\n    color: #353535;\n    padding: 0.25rem;\n    max-width: 100%;\n    min-height: 1em;\n    display: inline-block;\n    vertical-align: top;\n    text-align: left;\n    border-radius: 3px;\n    -moz-border-radius: 3px;\n    -webkit-border-radius: 3px;\n}\n.message-text .message-body pre{\n    white-space: normal;\n}\n.my-msg .message-text .message-body {\n    margin-right: 0.25rem;\n    background: #b2e281;\n}\n\n.my-msg .message-text .message-body:after {\n    position: absolute;\n    top: 0.32rem;\n    right: -0.3rem;\n    border: 0.2rem solid transparent;\n    content: \" \";\n    border-left-color: #b2e281;\n    border-left-width: 0.15rem;\n}\n\n.your-msg .message-text .message-body {\n    margin-left: 0.25rem;\n    background: #fff;\n}\n\n.your-msg .message-text .message-body:before {\n    position: absolute;\n    top: 0.32rem;\n    left: -0.3rem;\n    border: 0.2rem solid transparent;\n    content: \" \";\n    border-right-color: #fff;\n    border-right-width: 0.15rem;\n\n}\n\n.message-multi {\n    background-color: #fff;\n    border: 1px solid #d2d2d2;\n    padding: 0.4rem;\n    font-size: 0.4rem;\n}\n\n.message-multi-first {\n    position: relative;\n    margin-bottom: 0.3rem;\n}\n\n.message-multi-first .material-cover-img {\n    width: 100%;\n    overflow: hidden;\n    text-align: center;\n    height: 4rem;\n}\n\n.message-multi-first .material-cover-img img {\n    height: 4rem;\n    width: 100%;\n}\n\n.message-multi-first .material-title {\n    display: -webkit-box;\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    width: 100%;\n    max-height: 1.4rem;\n    line-height: 1.4;\n    color: #fff;\n    font-size: 0.36rem;\n    background-color: rgba(0, 0, 0, 0.8);\n    opacity: 0.9;\n    padding: 0.15rem 0.2rem;\n    overflow: hidden;\n    white-space: normal;\n    text-overflow: ellipsis;\n    word-break: break-all;\n    -webkit-box-orient: vertical;\n    -webkit-line-clamp: 2;\n\n}\n\n.message-multi-second {\n    display: flex;\n    flex-direction: row-reverse;\n    border-top: 1px solid #d8d8d8;\n    padding: 0.3rem 0;\n}\n\n.message-multi-second .material-cover-img {\n    width: 1.3rem;\n    height: 1.3rem;\n    overflow: hidden;\n    margin-left: 0.5rem;\n\n}\n\n.message-multi-second .material-cover-img img {\n    width: 1.3rem;\n    height: 1.3rem;\n}\n\n.message-multi-second .material-title {\n    flex: 1;\n    padding-right: 0;\n    padding-top: 0.15rem;\n    display: -webkit-box;\n    overflow: hidden;\n    white-space: normal;\n    text-overflow: ellipsis;\n    word-break: break-all;\n    -webkit-box-orient: vertical;\n    -webkit-line-clamp: 2;\n}\n\n.message-multi-second:last-child {\n    padding-bottom: 0;\n}\n\n.footer {\n    display: flex;\n    height: 1.20625rem;\n    line-height: 1.20625rem;\n    position: absolute;\n    left: 0;\n    bottom: 0;\n    width: 100%;\n    text-align: center;\n    z-index: 99;\n    background-color: #f8f8f8;\n}\n\n.footer .message-wrap {\n    flex: 1;\n    overflow: hidden;\n    padding: 0.321538rem 0;\n}\n\n.footer .message-content {\n    padding: 0 0.386rem;\n    width: 100%;\n    background-color: #f8f8f8;\n    resize: none;\n    line-height: 0.6369rem;\n    border: none;\n    font-size: 0.375rem;\n}\n\n.footer .send-btn {\n    display: inline-block;\n    width: 1.4rem;\n    height: 0.7rem;\n    font-size: 0.4rem;\n    color: #fff;\n    border: 1px solid #179e16;\n    border-radius: 3px;\n    background-color: #1aad19;\n    line-height: 0.7rem;\n    margin-top: 0.25rem;\n    margin-right: 0.4rem;\n}\n\n/* 公众号文章页面 */\n.public-article {\n    height: 100%;\n}\n\n.public-article-content {\n    height: 100%;\n    margin-top: 1.16rem;\n    /*padding: 0.5rem;*/\n}\n\n.article-title {\n    margin-bottom: 0.5rem;\n    line-height: 1.4;\n    font-weight: 400;\n    font-size: 0.6rem;\n    color: #000;\n}\n\n.article-attr {\n    display: flex;\n    margin-bottom: 0.6rem;\n}\n\n.article-time {\n    font-size: 0.4rem;\n    color: #8c8c8c;\n    margin-right: 0.3rem;\n}\n\n.article-author {\n    font-size: 0.4rem;\n    color: #0099ff;\n}\n\n.rich_media_content {\n    font-size: 0.4rem;\n    width: 100%;\n    overflow: hidden;\n}\n\n.rich_media_content * {\n    max-width: 100% !important;\n    box-sizing: border-box !important;\n    -webkit-box-sizing: border-box !important;\n    word-wrap: break-word !important;\n    font-size: 0.4rem;\n}"
  },
  {
    "path": "integrate/public/public.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no\">\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">\n    <meta name=\"format-detection\" content=\"telephone=no\"/>\n    <meta name=\"format-detection\" content=\"address=no\">\n    <title>public demo</title>\n    <link rel=\"stylesheet\" href=\"../reset.css\">\n    <link rel=\"stylesheet\" href=\"public.css?0414\">\n\n    <script src=\"../lib/jquery-3.1.1.js\"></script>\n    <script src=\"../lib/vue-2.1.4.js\"></script>\n    <script src=\"js/public-common.js\"></script>\n    <script src=\"//cdn.ronghub.com/RongIMLib-2.5.0.js\"></script>\n    <script src=\"//cdn.ronghub.com/RongEmoji-2.2.5.min.js\"></script>\n\n\n    <script src=\"../init.js\"></script>\n\n    <script src=\"js/public-chat.js\"></script>\n    <script src=\"js/public-info.js\"></script>\n    <script src=\"js/public-list.js\"></script>\n    <script src=\"js/public-search.js\"></script>\n    <script src=\"js/public-article.js\"></script>\n</head>\n<body>\n<div id=\"publicPage\">\n    <!--公众号搜索页->搜索\n    公众号列表页\n    公众号信息页->搜索结果 点击关注 取消关注公众号\n    公众号消息详情页->接收公众号推送-->\n\n    <component :is=\"stat.currentView\" :stat=\"stat\"></component>\n\n\n</div>\n</body>\n<script type=\"text/javascript\">\n    //初始化\n    var publicApp;\n    var userInfo = {\n        appKey: \"e0x9wycfeazyq\",\n        token: \"RMmWBeca3K1iQ4yVKrWy6OKSeuOyOAQ/XPr4sUlvw/p2OWJL0P5SG28RhmHYnEOOK2NQ8457HM0=\"\n    };\n    var callbacks = {\n        CONNECTED: function (instance) { //传入实例参数\n            publicApp=initVue(instance);\n\n        },\n        Success: function (id) {\n        },\n        Received: function (message) {\n            if (message.messageType == RongIMClient.MessageType.TextMessage || message.messageType == \"PublicServiceMultiRichContentMessage\"){\n                publicApp.stat.msgList.push(message);\n            }\n        }\n    };\n    init(userInfo, callbacks);\n    function initVue(instance) {\n        var publicPage = new Vue({\n            el: '#publicPage',\n            data: {\n                stat: {\n                    currentView: 'publicList',\n                    publicList: [],\n                    searchVal: 'e',\n                    searchList: [],\n                    searchResult: true,\n                    currentPublic: {},\n                    sendMsgVal: '',\n                    msgList: [],\n                    userInfo: '',\n                    articleUrl: ''\n\n                }\n            },\n            components: {\n                publicChat: getPublicChat(instance),\n                publicInfo: getPublicInfo(instance),\n                publicList: getPublicList(instance),\n                publicSearch: getPublicSearch(instance),\n                publicArticle: getPublicArticle(instance)\n            },\n            methods: {}\n        });\n\n        //转换emoji表情\n        Vue.filter('transEmoji', function (input) {\n            return RongIMLib.RongIMEmoji.symbolToEmoji(input)\n        });\n\n        return publicPage;\n    }\n\n</script>\n</html>"
  },
  {
    "path": "integrate/public/template/public-article.html",
    "content": "<div class=\"public-article\">\n    <header class=\"header\">\n        <i class=\"icons icon-return\" @touchend=\"goPublicChat\"  @click=\"goPublicChat\"></i>\n        <h2 class=\"title\">{{stat.currentPublic.name}}</h2>\n    </header>\n\n    <div class=\"public-article-content\">\n        <iframe frameborder=\"0\" :src=\"stat.articleUrl\" width=\"100%\" height=\"100%\"></iframe>\n        <!--<h2 class=\"article-title\">如果你来过了北京，就等于去了全世界！</h2>\n        <div class=\"article-attr\"><span class=\"article-time\">2017-04-14</span><span class=\"article-author\"> 北京旅游</span>\n        </div>\n        <div class=\"rich_media_content\">\n\n\n            <p style=\"text-align: center; line-height: 2em;\"><span style=\"line-height: 1.6;\"></span></p>\n            <p style=\"text-align: center; line-height: 2em;\">世界那么大，好想去看看！</p>\n            <p style=\"text-align: center; line-height: 2em;\">可是出国花费高，时间也不够，</p>\n            <p style=\"text-align: center; line-height: 2em;\">怎么办呢？</p>\n            <p style=\"text-align: center; line-height: 2em;\"><strong style=\"line-height: 2em;\">其实根本不用出北京，</strong></p>\n            <p style=\"text-align: center; line-height: 2em;\"><strong>我们就可以环游世界啊！</strong></p>\n            <p style=\"text-align: center; line-height: 2em;\">不信的话，泥萌自己看咯！</p>\n            <p style=\"text-align: center; line-height: 2em;\"><span\n                    style=\"color: rgb(62, 62, 62); font-size: 16px; line-height: 28px; text-align: center;  background-color: rgb(255, 255, 255);\">☟</span><span\n                    style=\"color: rgb(62, 62, 62); font-size: 16px; line-height: 28px; text-align: center;  background-color: rgb(255, 255, 255);\">☟</span><span\n                    style=\"color: rgb(62, 62, 62); font-size: 16px; line-height: 28px; text-align: center;  background-color: rgb(255, 255, 255);\">☟</span>\n            </p>\n            <section style=\"box-sizing: border-box; background-color: rgb(255, 255, 255);\">\n                <section class=\"\" style=\"   box-sizing: border-box; \" powered-by=\"xiumi.us\">\n                    <section class=\"\"\n                             style=\" margin-top: 0.5em; margin-bottom: 0.5em; text-align: center;  box-sizing: border-box; \">\n                        <section class=\"\" style=\"display: inline-block; box-sizing: border-box;\">\n                            <section style=\"display: inline-block; vertical-align: top; box-sizing: border-box;\">\n                                <section\n                                        style=\"display: inline-block; vertical-align: top; border-right-width: 0.5em; border-right-style: solid; border-bottom-width: 1em; border-bottom-style: solid; border-right-color: rgb(199, 122, 246); border-bottom-color: rgb(199, 122, 246); border-left-width: 0.5em !important; border-left-style: solid !important; border-left-color: transparent !important; border-top-width: 1em !important; border-top-style: solid !important; border-top-color: transparent !important; box-sizing: border-box;\"></section>\n                                <section class=\"\"\n                                         style=\"display: inline-block; vertical-align: top; height: 2em; padding-right: 0.5em; padding-left: 0.5em; line-height: 2em; overflow: hidden; color: rgb(255, 255, 255); box-sizing: border-box; min-width: 6em !important; max-width: 7.5em !important; background-color: rgb(199, 122, 246);\">\n                                    <p style=\"box-sizing: border-box;\"><strong\n                                            style=\"box-sizing: border-box;\">美国</strong></p></section>\n                            </section>\n                            <section style=\"display: inline-block; vertical-align: top; box-sizing: border-box;\">\n                                <section class=\"\"\n                                         style=\"display: inline-block; vertical-align: top; height: 2em; padding-right: 0.5em; padding-left: 0.5em; line-height: 2em; overflow: hidden; color: rgb(255, 255, 255); box-sizing: border-box; min-width: 6em !important; max-width: 7.5em !important; background-color: rgb(19, 246, 231);\">\n                                    <p style=\"box-sizing: border-box;\"><strong\n                                            style=\"box-sizing: border-box;\">北京</strong></p></section>\n                                <section\n                                        style=\"display: inline-block; vertical-align: top; border-left-width: 0.5em; border-left-style: solid; border-top-width: 1em; border-top-style: solid; border-left-color: rgb(19, 246, 231); border-top-color: rgb(19, 246, 231); border-right-width: 0.5em !important; border-right-style: solid !important; border-right-color: transparent !important; border-bottom-width: 1em !important; border-bottom-style: solid !important; border-bottom-color: transparent !important; box-sizing: border-box;\"></section>\n                            </section>\n                            <section style=\"margin-top: -2.25em; box-sizing: border-box;\">\n                                <section class=\"\"\n                                         style=\"overflow: hidden; display: inline-block; vertical-align: top; width: 2.5em; height: 2.5em; line-height: 2.5em; margin: auto; border-radius: 100%; box-sizing: border-box; background-color: rgb(254, 255, 255);\">\n                                    <section style=\"box-sizing: border-box;\">VS</section>\n                                </section>\n                            </section>\n                        </section>\n                    </section>\n                </section>\n            </section>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; font-size: 14px; box-sizing: border-box !important; word-wrap: break-word !important;\"><br></span></strong>\n            </p>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"font-size: 16px;\"><strong\n                        style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">美国·纽约</span></strong></span><br>\n            </p>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; font-size: 10px; color: rgb(87, 87, 87); box-sizing: border-box !important; word-wrap: break-word !important;\">▼</span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; font-size: 14px; box-sizing: border-box !important; word-wrap: break-word !important;\"><img\n                        style=\"font-size: 16px; white-space: normal; color: rgb(62, 62, 62); font-family: 微软雅黑; line-height: 25.6px; box-sizing: border-box !important; word-wrap: break-word !important; visibility: visible !important; width: auto !important; height: auto !important;\"\n                        width=\"auto\" _width=\"auto\"\n                        src=\"http://rongcloud-file.ronghub.com/e2d9ef4d0185f7ea5d.jpeg?attname=1.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:WaY6IRF10KAJI-8AH8tD11XF_Ac=.jpeg\"></span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; font-size: 14px; box-sizing: border-box !important; word-wrap: break-word !important;\"><br></span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"font-size: 16px;\"><strong\n                        style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"></span></strong></span>\n            </p>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; color: rgb(87, 87, 87); font-size: 16px; box-sizing: border-box !important; word-wrap: break-word !important;\"><strong\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">北京·CBD</strong></span>\n            </p>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; color: rgb(87, 87, 87); font-size: 16px; box-sizing: border-box !important; word-wrap: break-word !important;\">▼</span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <img style=\"color: rgb(62, 62, 62); font-family: 微软雅黑; font-size: 16px; line-height: 25.6px; white-space: normal; box-sizing: border-box !important; word-wrap: break-word !important; visibility: visible !important; width: 640px !important; height: 375px !important;\"\n                     src=\"http://rongcloud-file.ronghub.com/98c12b4b29b4e7990b.jpeg?attname=2.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:4-fmjpx10bkvuREglOL6F7ESQU4=\"><strong\n                    style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                    style=\"max-width: 100%; font-size: 14px; box-sizing: border-box !important; word-wrap: break-word !important;\"><br></span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <br></p>\n            <p style=\"text-align: center; line-height: 2em;\">区域内摩天大楼林立，</p>\n            <p style=\"text-align: center; line-height: 2em;\">国际感、现代感、时尚感十足。</p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <br></p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; font-size: 14px; box-sizing: border-box !important; word-wrap: break-word !important;\">美国·大峡谷空中走廊</span></strong><br>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; font-size: 10px; color: rgb(87, 87, 87); box-sizing: border-box !important; word-wrap: break-word !important;\">▼</span>\n            </p>\n            <p><img data-ratio=\"0.7490909090909091\" data-s=\"300,640\"\n                    data-src=\"http://mmbiz.qpic.cn/mmbiz/I3ujV0JnQKgtKrTFPDPicO0QKrptFP6Wjkn0bmKyS2CqiaJonTgMv2AWEJN0MBjWD20fYmkd4oCbu40mvpCIGib9A/640?wx_fmt=jpeg\"\n                    data-type=\"jpeg\" data-w=\"550\"\n                    style=\"color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; text-align: center; white-space: normal; box-sizing: border-box !important; word-wrap: break-word !important; visibility: visible !important; width: 550px !important; height: 412px !important;\"\n                    width=\"auto\" _width=\"auto\"\n                    src=\"http://rongcloud-file.ronghub.com/ca29774d43a23f9476.jpeg?attname=3.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:6kwR_i4ew2Me78p5RkCRVwHAQ8Q=\">\n            </p>\n            <p><br></p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; font-size: 14px; color: rgb(87, 87, 87); box-sizing: border-box !important; word-wrap: break-word !important;\"><strong\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">北京·平谷石林峡玻璃观景台</span></strong></span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; font-size: 10px; color: rgb(87, 87, 87); box-sizing: border-box !important; word-wrap: break-word !important;\">▼</span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; font-size: 10px; color: rgb(87, 87, 87); box-sizing: border-box !important; word-wrap: break-word !important;\"><img\n                        data-ratio=\"0.5609375\" data-s=\"300,640\"\n                        data-src=\"http://mmbiz.qpic.cn/mmbiz/I3ujV0JnQKgtKrTFPDPicO0QKrptFP6WjjJITN1TrBXMj3gx1HEZAvNpugwYRpvbYdaEMJ3x6QPp9k5huU5giauQ/640?wx_fmt=jpeg\"\n                        data-type=\"jpeg\" data-w=\"640\"\n                        style=\"color: rgb(136, 136, 136); font-family: 微软雅黑; font-size: 14px; line-height: 24.8889px; text-align: center; white-space: normal; box-sizing: border-box !important; word-wrap: break-word !important; visibility: visible !important; width: 640px !important; height: 359px !important; background-color: rgb(255, 255, 255);\"\n                        width=\"auto\" _width=\"auto\"\n                        src=\"http://rongcloud-file.ronghub.com/6c9ad44674b672fbe5.jpeg?attname=4.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:hPu-Q2VKi0WDX78KjzXBHlMvTPs=\"></span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <br></p>\n            <p style=\"text-align: center; line-height: 2em;\">这座悬空跨度32.8米的观景台，</p>\n            <p style=\"text-align: center; line-height: 2em;\">比美国科罗拉多大峡谷的廊桥还长11.4米；</p>\n            <p style=\"text-align: center; line-height: 2em;\">415平米的载员面积，</p>\n            <p style=\"text-align: center; line-height: 2em;\">是迄今为止世界上面积最大的观景平台<span style=\"line-height: 2em;\">。</span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <br></p>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); line-height: 25.6px; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span\n                        style=\"max-width: 100%; font-size: 14px; box-sizing: border-box !important; word-wrap: break-word !important;\">美国·火鸡</span></strong><br>\n            </p>\n            <p style=\"font-size: 16px; white-space: normal; max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <span style=\"max-width: 100%; font-size: 10px; color: rgb(87, 87, 87); box-sizing: border-box !important; word-wrap: break-word !important;\">▼</span>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 14px; line-height: 25.6px; text-align: center; white-space: normal; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><img\n                        class=\"\" data-ratio=\"1\"\n                        data-src=\"http://mmbiz.qpic.cn/mmbiz_jpg/eMweGmfI9SJzHxmfsy7eMdE8mkCzIMzbAdvQMiahiaTb5O5hhfdhVdxaSP2VnvVjxmaHECmPeKOtBmvhMMQlwEkg/640?wx_fmt=jpeg\"\n                        data-type=\"jpeg\" data-w=\"500\"\n                        style=\"color: rgb(62, 62, 62); font-family: 微软雅黑; font-size: 16px; line-height: 25.6px; text-align: center; white-space: normal; box-sizing: border-box !important; word-wrap: break-word !important; visibility: visible !important; width: 500px !important; height: 500px !important;\"\n                        width=\"auto\" _width=\"auto\"\n                        src=\"http://rongcloud-file.ronghub.com/464a50408b819d9cb2.jpeg?attname=5.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:9SC75zUMKd5yLSwpLVm-t08NIzo=\"></span></strong><br>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 14px; line-height: 25.6px; text-align: center; white-space: normal; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><br></span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 14px; line-height: 25.6px; text-align: center; white-space: normal; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">北京·烤鸭</span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 14px; line-height: 25.6px; text-align: center; white-space: normal; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\"><span\n                        style=\"max-width: 100%; color: rgb(87, 87, 87); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 13.3333px; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">▼</span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <strong style=\"color: rgb(87, 87, 87); font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; font-size: 14px; line-height: 25.6px; text-align: center; white-space: normal; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\"><span\n                        style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><img\n                        data-ratio=\"0.571875\" data-s=\"300,640\"\n                        data-src=\"http://mmbiz.qpic.cn/mmbiz_jpg/I3ujV0JnQKjTI1lAEMtxqAJRwEwKicERJmtJU0DEE9xsWh7QT0x6pYgOucJ8jgADuSOzwQwEHDWFonBA4JYHcAA/640?wx_fmt=jpeg\"\n                        data-type=\"jpeg\" data-w=\"640\"\n                        style=\"color: rgb(62, 62, 62); font-family: 微软雅黑; font-size: 16px; line-height: 25.6px; text-align: center; white-space: normal; box-sizing: border-box !important; word-wrap: break-word !important; visibility: visible !important; width: 640px !important; height: 366px !important;\"\n                        width=\"auto\" _width=\"auto\"\n                        src=\"http://rongcloud-file.ronghub.com/3a6ff946a29968924a.jpeg?attname=6.jpeg&e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:N37S5NM9YB2awZNoeCh9q-h80eM=\"></span></strong>\n            </p>\n            <p style=\"max-width: 100%; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; font-family: 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; line-height: 25.6px; text-align: center; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <br></p>\n            <p style=\"text-align: left;\">我大北京美食中的金字招牌，皮十分香脆，这也是其最吸引食客的地方，内里肉质鲜嫩多汁，用小薄饼卷上，再配以葱段和海鲜酱或甜面酱，味道更是一绝！</p>\n            <section data-id=\"85927\" data-color=\"rgb(89, 195, 249)\" data-custom=\"rgb(30, 155, 232)\"\n                     style=\"max-width: 100%; color: rgb(62, 62, 62); font-size: 16px; white-space: normal; line-height: 25.6px; font-family: 微软雅黑; box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(255, 255, 255);\">\n                <section\n                        style=\"margin-top: 10px; margin-bottom: 10px; max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n                    <section data-width=\"100%\"\n                             style=\"padding: 0.3em 0.5em; max-width: 100%; box-sizing: border-box; display: inline-block; width: 556px; font-size: 14px; color: rgb(255, 255, 255); word-wrap: break-word !important; background-color: rgb(89, 195, 249);\">\n                        <span style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">精彩推荐</span>\n                    </section>\n                    <section\n                            style=\"padding: 10px; max-width: 100%; box-sizing: border-box; border: 1px solid rgb(89, 195, 249); word-wrap: break-word !important;\">\n                        <p style=\"max-width: 100%; min-height: 1em; line-height: 25.6px; box-sizing: border-box !important; word-wrap: break-word !important;\">\n                            <a href=\"http://mp.weixin.qq.com/s?__biz=MjM5NDcxMTE2NA==&amp;mid=2656831712&amp;idx=1&amp;sn=49ac8e90af65bfbf8ff1687c58a36cd0&amp;chksm=bd2b3bf38a5cb2e524fa446bffe4864887fdc9f99db962f496be89a83b979e0e03fa0da7018e&amp;scene=21#wechat_redirect\"\n                               target=\"_blank\"\n                               data_ue_src=\"http://mp.weixin.qq.com/s?__biz=MjM5NDcxMTE2NA==&amp;mid=2656831712&amp;idx=1&amp;sn=49ac8e90af65bfbf8ff1687c58a36cd0&amp;chksm=bd2b3bf38a5cb2e524fa446bffe4864887fdc9f99db962f496be89a83b979e0e03fa0da7018e&amp;scene=21#wechat_redirect\">天上掉馅饼了！北京人下月去这个省高速全免、所有景点都免费玩！</a><br\n                                style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">\n                        </p>\n                        <p style=\"max-width: 100%; min-height: 1em; line-height: 25.6px; box-sizing: border-box !important; word-wrap: break-word !important;\">\n                            <br style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">\n                        </p>\n                        <p style=\"max-width: 100%; min-height: 1em; line-height: 25.6px; box-sizing: border-box !important; word-wrap: break-word !important;\">\n                            <a href=\"http://mp.weixin.qq.com/s?__biz=MjM5NDcxMTE2NA==&amp;mid=2656831531&amp;idx=1&amp;sn=8af0b6ef80b4d894d8c20f405c3f2d7d&amp;chksm=bd2b3b388a5cb22e01bbe6678b8f8e97dbaaeff9a5bbb325bb4c2124074425ad7aaef9774e33&amp;scene=21#wechat_redirect\"\n                               target=\"_blank\"\n                               data_ue_src=\"http://mp.weixin.qq.com/s?__biz=MjM5NDcxMTE2NA==&amp;mid=2656831531&amp;idx=1&amp;sn=8af0b6ef80b4d894d8c20f405c3f2d7d&amp;chksm=bd2b3b388a5cb22e01bbe6678b8f8e97dbaaeff9a5bbb325bb4c2124074425ad7aaef9774e33&amp;scene=21#wechat_redirect\">全北京最不可错过的12碗销魂饭，吃完幸福满满！</a><br\n                                style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\">\n                        </p></section>\n                </section>\n            </section>\n        </div>-->\n    </div>\n</div>"
  },
  {
    "path": "integrate/public/template/public-chat.html",
    "content": "<div class=\"public-chat\">\n    <header class=\"header\">\n        <i class=\"icons icon-return\" @touchend=\"goPublicList\" @click=\"goPublicList\"></i>\n        <h2 class=\"title\">{{stat.currentPublic.name}}</h2>\n        <button type=\"button\" class=\"icons public-info-btn\" @touchend=\"goPublicInfo\"  @click=\"goPublicInfo\">信息</button>\n    </header>\n\n    <div class=\"chat-content\">\n        <div class=\"message-wrapper\">\n            <!--<div class=\"message-item message-multi\" @touchend=\"goPublicArticle\">\n                <div class=\"message-multi-first\">\n                    <div class=\"material-cover-img\">\n                        <img src=\"http://rongcloud-file.ronghub.com/e2d9ef4d0185f7ea5d.jpeg?attname=1.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:WaY6IRF10KAJI-8AH8tD11XF_Ac=.jpeg\">\n                    </div>\n                    <div class=\"material-title\">\n                        如果你来过了北京，就等于去了全世界！\n                    </div>\n                </div>\n                <div class=\"message-multi-second\">\n                    <div class=\"material-title\">\n                        厉害了，北京交通又将大爆发，全国都羡慕！\n                    </div>\n                    <div class=\"material-cover-img\">\n                        <img src=\"http://rongcloud-file.ronghub.com/37852c41c6a2909050.jpeg?attname=7.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:-Wk2QaYWCupt1GOaS2dPUfFbf28=\">\n                    </div>\n                </div>\n                <div class=\"message-multi-second\">\n                    <div class=\"material-title\">\n                        走过帝都这几座古桥，你已经历了宋朝，度过了明朝 ...\n                    </div>\n                    <div class=\"material-cover-img\">\n                        <img src=\"http://rongcloud-file.ronghub.com/bdc7634574888cfc4a.jpeg?attname=8.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:DbrGVrCshcxwYRvhhujOaScwlB0=\">\n                    </div>\n                </div>\n            </div>\n\n\n\n            <div class=\"message-item your-msg\">\n                <div class=\"message-text\">\n                    <div class=\"rong-avatar\">&lt;!&ndash;:src=\"item.portraitUri\"&ndash;&gt;\n                        <img src=\"http://public.rongcloud.cn/static/uploadImage/2015/11/23/rc_80x80_1c7cd4dd_1448247905.png\" class=\"rong-avatar-bd\">\n                    </div>\n                    <div class=\"message-body\">\n                        <pre class=\"user-msg\">hello</pre>\n                    </div>\n                </div>\n            </div>\n\n            <div class=\"message-item my-msg\">\n                <div class=\"message-text\">\n                    <div class=\"rong-avatar\">&lt;!&ndash;:src=\"item.portraitUri\"&ndash;&gt;\n                        <img src=\"http://img.duoziwang.com/2016/12/08/18594927932.jpg\" class=\"rong-avatar-bd\">\n                    </div>\n                    <div class=\"message-body\">\n                        <pre class=\"user-msg\">hello</pre>\n                    </div>\n                </div>\n            </div>-->\n\n            <div class=\"message-item\" v-for=\"msg in stat.msgList\"\n                 :class=\"[msg.messageDirection == 1 ? 'my-msg' : 'your-msg']\">\n\n                <div v-if=\"msg.messageType == 'TextMessage'\" class=\"message-text\">\n                    <div class=\"rong-avatar\"><!--:src=\"item.portraitUri\"-->\n                        <img v-if=\"msg.messageDirection == 1\" :src=\"stat.userInfo.user1.portraitUri\"\n                             class=\"rong-avatar-bd\">\n                        <img v-else :src=\"stat.currentPublic.portraitUri\" class=\"rong-avatar-bd\">\n                    </div>\n                    <div class=\"message-body\">\n                        <pre class=\"user-msg\" v-if=\"msg.content.messageName == 'TextMessage'\">{{msg.content.content | transEmoji}}</pre>\n                        <img class=\"image-message\" :src=\"msg.content.imageUri\" alt=\"image\"\n                             v-if=\"msg.content.messageName == 'ImageMessage'\">\n                    </div>\n                </div>\n\n                <div v-if=\"msg.messageType == 'PublicServiceMultiRichContentMessage'\" class=\"message-multi\">\n\n                    <div v-for=\"(article , index) in msg.content.richContentMessages.articles\"\n                         :class=\"index == 0 ? 'message-multi-first' : 'message-multi-second' \"\n                         @touchend=\"goPublicArticle(article.url)\" @click=\"goPublicArticle(article.url)\">\n                        <div class=\"material-cover-img\">\n                            <img :src=\"article.picurl\">\n                        </div>\n                        <div class=\"material-title\">\n                            {{article.title}}\n                        </div>\n                    </div>\n                    <!--<div class=\"message-multi-first\">\n                        <div class=\"material-cover-img\">\n                            <img src=\"http://rongcloud-file.ronghub.com/e2d9ef4d0185f7ea5d.jpeg?attname=1.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:WaY6IRF10KAJI-8AH8tD11XF_Ac=.jpeg\">\n                        </div>\n                        <div class=\"material-title\">\n                            如果你来过了北京，就等于去了全世界！\n                        </div>\n                    </div>\n                    <div class=\"message-multi-second\">\n                        <div class=\"material-cover-img\">\n                            <img src=\"http://rongcloud-file.ronghub.com/37852c41c6a2909050.jpeg?attname=7.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:-Wk2QaYWCupt1GOaS2dPUfFbf28=\">\n                        </div>\n                        <div class=\"material-title\">\n                            厉害了，北京交通又将大爆发，全国都羡慕！\n                        </div>\n                    </div>\n                    <div class=\"message-multi-second\">\n                        <div class=\"material-cover-img\">\n                            <img src=\"http://rongcloud-file.ronghub.com/bdc7634574888cfc4a.jpeg?attname=8.jpeg&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:DbrGVrCshcxwYRvhhujOaScwlB0=\">\n                        </div>\n                        <div class=\"material-title\">\n                            走过帝都这几座古桥，你已经历了宋朝，度过了明朝 ...\n                        </div>\n                    </div>-->\n                </div>\n\n\n            </div>\n\n\n        </div>\n    </div>\n\n    <footer class=\"footer\">\n        <div class=\"message-wrap\"><textarea v-model=\"stat.sendMsgVal\" id=\"message-content\" placeholder=\"请输入文字...\"\n                                            class=\"message-content\"></textarea></div>\n        <span class=\"send-btn\" @touchend=\"sendMsg\"  @click=\"sendMsg\">发送</span>\n    </footer>\n</div>"
  },
  {
    "path": "integrate/public/template/public-info.html",
    "content": "<div class=\"public-info\">\n    <header class=\"header\">\n        <i class=\"icons icon-return\" @touchend=\"goPublicSearch\"  @click=\"goPublicSearch\"></i>\n        <h2 class=\"title\">详情资料</h2>\n    </header>\n    <div class=\"public-info-con\">\n        <div class=\"public-info-avatar\">\n            <div class=\"rong-avatar\"><img :src=\"stat.currentPublic.portraitUri\" class=\"rong-avatar-bd\"></div>\n            <div class=\"public-info-name\">{{stat.currentPublic.name}}</div>\n        </div>\n\n        <div class=\"public-info-intro\">\n            <span class=\"title\">功能介绍</span>\n            <div class=\"public-introduction\">\n                {{stat.currentPublic.introduction}}\n            </div>\n        </div>\n\n        <div class=\"public-info-history\">\n            <span class=\"title\">查看历史消息</span>\n        </div>\n\n        <div v-if=\"stat.currentPublic.hasFollowed\" class=\"public-info-btns\">\n            <button type=\"button\" class=\"enterPublic\" @touchend=\"goPublicChat\"  @click=\"goPublicChat\">进入公众号</button>\n            <br>\n            <button type=\"button\" class=\"unsubscribePublic\" @touchend=\"unsubscribePublic\"  @click=\"unsubscribePublic\">取消订阅公众号</button>\n        </div>\n\n        <div v-else class=\"public-info-btns\">\n            <button type=\"button\" class=\"subscribePublic\" @touchend=\"subscribePublic\" @click=\"subscribePublic\">订阅公众号</button>\n        </div>\n    </div>\n</div>"
  },
  {
    "path": "integrate/public/template/public-list.html",
    "content": "<div class=\"public-list\">\n    <header class=\"header\"><!--<i class=\"icons icon-return\"></i>--><h2 class=\"title\">公众号</h2>\n        <!--<button type=\"button\" class=\"icons icon-search\">搜索</button>-->\n        <button type=\"button\" class=\"public-add-btn icons icon-add\" @touchend=\"publicAdd\" @click=\"publicAdd\">添加</button>\n    </header>\n    <ul class=\"public-list-content\">\n        <li v-if=\"stat.publicList.length == 0\" class=\"public-list-item item-without\">暂无订阅号消息</li>\n\n\n        <li v-else class=\"public-list-item\" v-for=\"item in stat.publicList\" @touchend=\"goPublicChat( item )\" @click=\"goPublicChat( item )\">\n            <div class=\"rong-conversation-aside\">\n                <div class=\"rong-avatar\"><img :src=\"item.portraitUri\" class=\"rong-avatar-bd\"></div>\n            </div>\n            <div class=\"rong-item-main\">\n\n                <div class=\"rong-conversation-attr\"><em class=\"rong-conversation-name\">{{item.name}}</em><span\n                        class=\"rong-conversation-time\">{{item.time}}</span></div>\n                <div class=\"rong-conversation-message\">{{item.latestMessage}}</div>\n            </div>\n        </li>\n\n\n    </ul>\n</div>"
  },
  {
    "path": "integrate/public/template/public-search.html",
    "content": "<div class=\"public-search\">\n\n    <header class=\"header\">\n        <i class=\"icons icon-return\" @touchend=\"goPublicList\" @click=\"goPublicList\"></i>\n        <div class=\"public-search-wrap\">\n            <span class=\"icons icon-search\">搜索公众号</span>\n            <input type=\"text\" placeholder=\"搜索公众号\" class=\"public-search-field\" v-model=\"stat.searchVal\">\n            <button v-if=\"stat.searchVal !== ''\" type=\"button\" class=\"public-search-btn\" @touchend=\"publicSearch\" @click=\"publicSearch\">搜索\n            </button>\n        </div>\n    </header>\n\n    <div class=\"public-search-result\">\n        <ul class=\"public-search-list\">\n            <li v-if=\"stat.searchList.length !== 0\" class=\"public-search-item\" v-for=\"item in stat.searchList\"\n                @touchend=\"goPublicInfo( item )\" \n                @click=\"goPublicInfo( item )\">\n                <div class=\"rong-conversation-aside\">\n                    <div class=\"rong-avatar\"><img :src=\"item.portraitUri\" class=\"rong-avatar-bd\"></div>\n                </div>\n                <div class=\"rong-item-main\">\n                    <div class=\"rong-conversation-attr\"><em class=\"rong-conversation-name\">{{item.name}}</em></div>\n                    <div class=\"rong-conversation-message\">{{item.introduction}}</div>\n                </div>\n            </li>\n            <li v-show=\"!stat.searchResult\" class=\"public-search-item\">搜索不到公众号</li>\n        </ul>\n    </div>\n\n</div>"
  },
  {
    "path": "integrate/reset.css",
    "content": "/* 清除内外边距 */\nbody, div, h1, h2, h3, h4, h5, h6, hr, p, blockquote, /* structural elements 结构元素 */\ndl, dt, dd, ul, ol, li, /* list elements 列表元素 */\npre, /* text formatting elements 文本格式元素 */\nfieldset, lengend, button, input, textarea, form,/* form elements 表单元素 */\nth, td , header, footer{ /* table elements 表格元素 */\n    margin: 0;\n    padding: 0;\n    -webkit-box-sizing: border-box;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    -webkit-text-size-adjust: none;\n    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n/* 设置默认字体 */\nbody, button, input, select, textarea { /* for ie */\n    color: #495d64;\n    font:0.75rem/1.42857143  \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n    outline:0;\n    -webkit-text-size-adjust: 100%;\n    -ms-text-size-adjust: 100%\n}\n\n.button{\n    border-radius:10px;\n    outline:none;\n    padding:5px 20px;\n    margin:10px 0;\n    cursor:pointer;\n}\n\ncode, kbd, pre, samp, tt {\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif;\n}\n\n/* 重置列表元素 */\nul, ol {\n    list-style: none;\n}\n\nh1, h2, h3, h4, h5, h6{\n    font-size: 100%;\n    font-weight: normal;\n}\n\n/* 重置表格元素 */\ntable {\n    border-collapse: collapse;\n    border-spacing: 0;\n}\n\nimg {\n    vertical-align: top;\n    border: 0;\n}\n\na {\n    color: #2b98fc;\n    text-decoration: none;\n}\n\na:hover,\na:focus {\n    color: #2a6496;\n    text-decoration: none;\n    outline: none;\n}\n\n@media only screen and ( max-width:319px ) {    /*老式安卓手机                 */\n    html { font-size: 31.9px; }\n}\n@media only screen and ( width:320px ) {        /*iphone4/4s/5/5s竖屏         */\n    html { font-size: 32px; }\n}\n@media only screen and ( min-width:360px ) {    /*小米、三星note系列专用竖屏    */\n    html { font-size: 36px; }\n}\n@media only screen and ( min-width:375px ) {    /*iphone6                    */\n    html { font-size: 37.5px; }\n}\n@media only screen and ( min-width:414px )  {   /*iphone6 plus               */\n    html { font-size: 41.4px; }\n}\n@media only screen and ( min-width:481px ) {    /*大部分安卓手机以及其他手机      */\n    html { font-size: 48.1px; }\n}\n@media only screen and ( min-width:500px ) {    /*大部分安卓手机以及其他手机      */\n    html { font-size: 50px; }\n}"
  },
  {
    "path": "integrate/server-api.md",
    "content": "## Desktop-Client Server API 接口文档\n\n*   [用户模块](#usermodel)\n    *   [发送验证码](#usermodel-sendcode)\n    *   [校验验证码](#usermodel-verifycode)\n    *   [校验手机号是否可用](#usermodel-check_p_available)\n    *   [注册](#usermodel-register)\n    *   [登录](#usermodel-login)\n    *   [退出](#usermodel-logout)\n    *   [重置密码](#usermodel-reset-pwd)\n    *   [修改密码](#usermodel-change-pwd)\n    *   [设置自己的昵称](#usermodel-set-nickname)\n    *   [设置自己的头像](#usermodel-set-portrait-uri)\n    *   [获取融云 Token ](#usermodel-get-token)\n    *   [同步信息](#usermodel-sync-version)\n    *   [获取多个用户信息](#usermodel-batch)\n    *   [获取单个用户信息](#usermodel-user-id)\n    *   [根据手机号找人](#usermodel-find-by-phone)\n*   [好友模块](#block)\n    *   [请求加好友](#friendmodel-invite)\n    *   [同意加好友](#friendmodel-agree)\n    *   [忽略加好友](#friendmodel-ignore)\n    *   [删除好友](#friendmodel-delete)\n    *   [设置好友备注](#friendmodel-set-displayname)\n    *   [获取好友列表](#friendmodel-all)\n    *   [获取好友信息](#friendmodel-find-id)\n*   [群组模块](#groupmodel)\n    *   [创建群](#groupmodel-create)\n    *   [添加成员](#groupmodel-add)\n    *   [加入群组](#groupmodel-join)\n    *   [群组踢人](#groupmodel-kick)\n    *   [退出群组](#groupmodel-quit)\n    *   [解散群组](#groupmodel-dismiss)\n    *   [转让管理员](#groupmodel-transfer)\n    *   [群组重命名](#groupmodel-rename)\n    *   [发布群公告](#groupmodel-notice)\n    *   [设置群头像](#groupmodel-portrait)\n    *   [设置自己的群昵称](#groupmodel-nickname)\n    *   [获取群列表](#groupmodel-all)\n    *   [获取单个群信息](#groupmodel-group-id)\n    *   [获取群成员](#groupmodel-member)\n*   [星标联系人](#starmodel)\n    *   [星标联系人列表](#starmodel-all)\n    *   [设置星标联系人](#starmodel-star)\n    *   [取消星标联系人](#starmodel-unstar)\n*   [黑名单](#blacklist)\n    *   [黑名单列表](#blacklist-all)\n    *   [加入黑名单](#blacklist-join)\n    *   [移除黑名单](#blacklist-remove)\n*   [组织机构](#department)\n    *   [获取部门列表](#department-all)\n    *   [获取部门下人员列表](#department-depart-members)\n    *   [获取部门信息](#department-info)\n\n<h3 id=\"usermodel\">用户模块</h3>\n\n<h4 id=\"usermodel-sendcode\">发送验证码</h4>\n\n注册、修改密码发送验证码给用户输入的手机号。\n\n生产环境频率限制为 `1` 分钟 `1` 条，开发测试环境中 `5` 秒 `1` 条。\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/send_code HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数   | 必传  |类型   | 说明\n|:----- |:----- |:------|:---------\n|phone  |  YES  |string | 手机号 e.g. 13269772761\n|region |  YES  |string | 区域标识 e.g. 86\n\n##### 响应：\n\n```js\n// 成功\n{ \n    \"code\" : 200\n}\n\n// 失败\n{ \n    \"code\" : 1001\n}\n```\n\n##### 错误码：\n\n| 错误码| 说明\n|:------|:---------\n| 1001  | 手机号、区域标识无效\n| 1002  | 发送验证平率超限\n\n\n<h4 id=\"usermodel-verifycode\">校验验证码</h4>\n\n校验用户输入的验证码是否合法。\n\n```js\nPOST http://api.sealtalk.im/user/verify_code HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数   | 必传  |类型   | 说明\n|:----- |:----- |:------|:---------\n|phone  |  YES  |string | 手机号 e.g. 13269772761\n|region |  YES  |string | 区域标识 e.g. 86\n|code   |  YES  |string | 验证码 e.g. 8937\n\n##### 响应：\n\nverification_token 是验证秘钥，调用注册接口传回服务端。\n\n```js\n// 成功\n{ \n    \"code\" : 200,\n    \"result\" : {\n        \"verification_token\":\"5c633e80-c75e-11e6-b33c-f5d29ae4ef33\"\n    }\n}\n\n// 失败\n{ \n    \"code\" : 1001\n}\n\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 手机号没有找到\n| 1002  | 验证码无效\n| 1003  | 验证码已过期\n\n<h4 id=\"usermodel-check_p_available\">校验手机号是否可用</h4>\n\n检查用户输入的手机号是否可以用（是否为非法有手机号或者已注册）。\n\n```js\nPOST http://api.sealtalk.im/user/check_phone_available HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数   | 必传  |类型   | 说明\n|:----- |:----- |:------|:---------\n|phone  |  YES  |string | 手机号 e.g. 13269772761\n|region |  YES  |string | 区域标识 e.g. 86\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码  | 说明\n|:-------|:---------\n| 1001   | 手机号已被注册\n| 1002   | 手机号、区域标识无效\n\n<h4 id=\"usermodel-register\">注册</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/register HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数               | 必传  |类型   | 说明\n|:----------------- |:----- |:------|:---------\n|nickname           |  YES  |string | 用户名称\n|password           |  YES  |string | 密码\n|verification_token |  YES  |string | 验证码秘钥 [校验验证码](#usermodel-verifycode) 接口返回\n\n##### 响应：\n\n```json\n// 成功\n{\n    \"code\": 200,\n    \"result\": {\n    \"id\": \"SjV8zI76D\"\n    }\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n\n```\n\n失败：\n\n|错误码  | 说明\n|:-------|:---------\n| 1001   | 密码中包含空格\n| 1002   | 用户名长度无效\n| 1003   | 密码长度无效\n| 1004   | 验证码秘钥无效\n| 1005   | 手机号已存在\n| 1006   | 未知的验证码\n\n<h4 id=\"usermodel-login\">登录</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/login HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数     | 必传  |类型   | 说明\n|:------- |:----- |:------|:---------\n|region   |  YES  |string | 区域标识 e.g. 86\n|phone    |  YES  |string | 手机号 e.g. 13269772761\n|password |  YES  |string | 密码\n\n##### 响应：\n\n```js\n/**\n * 成功\n * 当前用户 userId\n * 融云 token ，调用 WebSDK 连接融云服务器方法使用\n */\n{\n    \"code\": 200,\n    \"result\": {\n        \"id\": \"AUj8X32w1\",\n        \"token\": \"vCHlXy3FChNg+Zoroy6R3trk7Uncrwg4vvug==\"\n    }\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 手机号无效\n| 1002  | 手机号或密码错误\n\n<h4 id=\"usermodel-logout\">退出</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/logout HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n```\n<h4 id=\"usermodel-reset-pwd\">重置密码</h4>\n\n未登录通过手机号重置密码。\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/reset_password HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数               | 必传  |类型   | 说明\n|:----------------- |:----- |:------|:---------\n|password           |  YES  |string | 密码\n|verification_token |  YES  |string | 验证码秘钥 [校验验证码](#usermodel-verifycode) 接口返回\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 密码不能包含空格\n| 1002  | 密码长度不正确\n| 1003  | 验证码秘钥不正确\n\n<h4 id=\"usermodel-change-pwd\">修改密码</h4>\n\n已登录通过旧密码修改密码。\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/change_password HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数        | 必传  |类型   | 说明\n|:-----------|:----- |:------|:---------\n|newPassword |  YES  |string | 新密码\n|oldPassword |  YES  |string | 旧密码\n\n##### 响应：\n\n```js\n// 成功：\n{\n    \"code\": 200\n}\n\n// 失败：\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 新密码不能包含空格\n| 1002  | 密码长度不正确\n| 1003  | 旧密码不正确\n\n<h4 id=\"usermodel-set-nickname\">设置自己的昵称</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/set_nickname HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数     | 必传  |类型   | 说明\n|:--------|:----- |:------|:---------\n|nickname |  YES  |string | 用户昵称\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 用户昵称长度不正确\n\n<h4 id=\"usermodel-set-portrait-uri\">设置自己的头像</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/user/set_portrait_uri HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数        | 必传  |类型   | 说明\n|:-----------|:----- |:------|:---------\n|portraitUri |  YES  |string | 用户头像\n\n##### 响应：\n\n```json\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码:\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 头像长度不正确\n\n<h4 id=\"usermodel-get-token\">获取融云 Token</h4>\n\n需要重新获取融云 Token 时使用，用户登录成功后会返回当前用户可用的 Token，无需调用此方法\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/user/get_token HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": {\n        \"userId\": \"Sxsndk10d\",\n        \"token\": \"pioepssdoecvnfdk\\daaa==\"\n    }\n}\n```\n\n<h4 id=\"usermodel-sync-version\">同步信息</h4>\n\n同步用户的好友、黑名单、群组、群组成员数据，调用时机：客户端打开时。\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/user/sync/:version HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|version |  YES  |integer| 同步版本号\n\n##### 响应：\n\n```js\n// 成功\n//TODO 成功 JOSN\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | version 不是数值类型\n\n<h4 id=\"usermodel-batch\">获取多个用户信息</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/user/batch HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|ids     |  YES  |arrya  | 用户 id 数组\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"id\": \"675NdFjkx\",\n            \"nickname\": \"Martin\",\n            \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/675NdFjkx1466733699776768066\"\n        }\n    ]\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 批量获取用户失败\n\n<h4 id=\"usermodel-user-id\">获取单个用户信息</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/user/:id HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": {\n        \"id\": \"OIBbeKlkx\",\n        \"nickname\": \"Martin\",\n        \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/u0LUuhzHm1466557920584458984\",\n        \"phone\": \"13269772769\"\n    }\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:---------\n| 1001  | 用户不存在\n\n<h4 id=\"usermodel-find-by-phone\">根据手机号找人</h4>\n\n#### 请求：\n\n```js\nGET http://api.sealtalk.im/user/find/:region/:phone HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": {\n        \"id\": \"u0LUuhzHm\",\n        \"nickname\": \"Martin\",\n        \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/u0LUuhzHm1466557920584458984\"\n    }\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n##### 错误码：\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 用户不存在\n\n<h3 id=\"friendmodel\">好友模块</h3>\n\n<h4 id=\"friendmodel-invite\">请求加好友</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/friend/invite HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数     | 必传  |类型   | 说明\n|:--------|:----- |:------|:---------\n|friendId | YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n/**\n * 成功\n * action.Added : 添加成功\n * action.Sent : 已经发送\n */\n{\n    \"code\": 200,\n    \"result\": {\n        \"action\": \"Added\"\n    }\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码：\n\n|错误码 | 说明\n|:------|:--------\n| 1001  |已经是好友\n\n<h4 id=\"friendmodel-agree\">同意加好友</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/friend/agree HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|friendId | YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  |没有收到加好友请求\n\n<h4 id=\"friendmodel-ignore\">忽略加好友</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/friend/ignore HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|friendId| YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  |没有收到加好友请求\n\n<h4 id=\"friendmodel-delete\">删除好友</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/friend/delete HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|friendId| YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  |不是好友关系\n\n<h4 id=\"friendmodel-set-displayname\">设置好友备注</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/friend/set_display_name HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数       | 必传  |类型   | 说明\n|:----------|:----- |:------|:---------\n|friendId   | YES   |string | 好友 Id\n|displayName| YES   |string | 备注名\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  |不是好友关系\n\n<h4 id=\"friendmodel-all\">获取好友列表</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/friend/all HTTP/1.1\nContent-Type:application/json\n```\n##### 响应：\n\n```js\n/**\n * status 说明：\n * status == 10 ：正在请求加好友\n * status == 11 ：已经发起过加好友请求\n * status == 20 ：已经是好友\n * status == 21 ：忽略好友请求\n * status == 30 ：好友已删除\n */\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"displayName\": \"备注名称\",\n            \"message\": \"加好友时的描述信息\",\n            \"status\": 20,\n            \"updatedAt\": \"2016-11-25T06:48:36.000Z\",\n            \"user\": {\n                \"id\": \"OIBbeKlkx\",\n                \"nickname\": \"Martin\",\n                \"region\": \"86\",\n                \"phone\": \"13269772769\",\n                \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/u0LUuhzHm1466557920584458984\"\n            }\n        }\n    ]\n}\n\n```\n\n<h4 id=\"friendmodel-find-id\">获取好友信息</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/friend/:friendId/profile HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|friendId| YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n/**\n * 成功\n * status 说明：\n * status == 10 ：正在请求加好友\n * status == 11 ：已经发起过加好友请求\n * status == 20 ：已经是好友\n * status == 21 ：忽略好友请求\n * status == 30 ：好友已删除\n */\n{\n    \"code\": 200,\n    \"result\": {\n        \"displayName\": \"备注名称\",\n        \"message\": \"加好友时的描述信息\",\n        \"status\": 20,\n        \"updatedAt\": \"2016-11-25T06:48:36.000Z\",\n        \"user\": {\n            \"id\": \"OIBbeKlkx\",\n            \"nickname\": \"Martin\",\n            \"region\": \"86\",\n            \"phone\": \"13269772769\",\n            \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/u0LUuhzHm1466557920584458984\"\n        }\n    }\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  |传入的 friendId 与当前用户不是好友关系\n\n<h3 id=\"groupmodel\">群组模块</h3>\n\n<h4 id=\"groupmodel-create\">创建群</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/create HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数     | 必传  |类型   | 说明\n|:------- |:----- |:------|:---------\n|name     | YES   |string | 群组名称\n|memberIds| YES   |array  | 群成员 Id 数组\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\":{\n        \"id\":\"Ixhfkd2ld\"\n    }\n}\n\n// 失败\n\n{\n    \"code\": 1001\n}\n\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群名称长度超限制\n| 1002  | 群成员人数必须大于 1 人\n| 1003  | 群成员人数超过群总人数限制\n| 1004  | 当前用户创建群个数超限\n\n<h4 id=\"groupmodel-add\">添加成员</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/add HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数     | 必传  |类型   | 说明\n|:------- |:----- |:------|:---------\n|groupId  | YES   |string | 群 Id\n|memberIds| YES   |array  | 群成员 Id 数组\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群组不存在\n| 1002  | 群成员人数超过群总人数限制\n\n<h4 id=\"groupmodel-join\">加入群组</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/create/join HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId  | YES   |string | 群 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群组不存在\n| 1002  | 群成员人数超过群总人数限制\n\n<h4 id=\"groupmodel-kick\">群组踢人</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/kick HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId  | YES   |string | 群 Id\n|memberIds| YES   |array  | 群成员 Id 数组\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群组不存在\n| 1002  | 不能踢出自己\n| 1003  | 当前用户不是群主\n\n<h4 id=\"groupmodel-quit\">退出群组</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/quit HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群组不存在\n| 1002  | 当前用户不在群中\n\n<h4 id=\"groupmodel-dismiss\">解散群组</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/dismiss HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 当前用户不是群主\n\n<h4 id=\"groupmodel-transfer\">转让管理员</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/transfer HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n|userId  | YES   |string | 新的群主 Id\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 当前用户不是群主\n| 1002  | 新群主不在群中\n\n<h4 id=\"groupmodel-rename\">群组重命名</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/rename HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n|name    | YES   |string | 群名称\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群名称长度超限\n| 1002  | 当前用户不是群主\n\n<h4 id=\"groupmodel-notice\">发布群公告</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/set_bulletin HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n|bulletin| YES   |string | 公告内容\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 公告长度超限\n| 1002  | 当前用户不是群主\n\n<h4 id=\"groupmodel-portrait\">设置群头像</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/set_portrait_uri HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数       | 必传  |类型   | 说明\n|:-------   |:----- |:------|:---------\n|groupId    | YES   |string | 群 Id\n|portraitUri| YES   |string | 头像地址\n\n##### 响应：\n\n```js\n{\n    \"code\": 200\n}\n\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 头像地址不正确\n| 1002  | 头像长度超限\n| 1003  | 当前用户不是群主\n\n<h4 id=\"groupmodel-nickname\">设置自己的群昵称</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/group/set_display_name HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数       | 必传  |类型   | 说明\n|:----------|:----- |:------|:---------\n|groupId    | YES   |string | 群 Id\n|displayName| YES   |string | 自己的群昵称\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\":200\n}\n\n// 失败\n{\n    \"code\":1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 名字长度超限\n| 1002  | 群组不存在\n\n<h4 id=\"groupmodel-all\">获取群列表</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/group/groups HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"role\": 1,\n            \"group\": {\n                \"id\": \"群 Id\",\n                \"name\": \"群名称\",\n                \"portraitUri\": \"群头像\",\n                \"creatorId\": \"群主 Id\",\n                \"memberCount\": \"已加群人数\",\n                \"maxMemberCount\": \"群人数上限\"\n            }\n        },\n        {\n            \"role\": 1,\n            \"group\": {\n                \"id\": \"D6Vh5Iga7W\",\n                \"name\": \"RongCloud\",\n                \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/FliXi6zl_U3YJF6K1DkZsY51trWw\",\n                \"creatorId\": \"Tp9mLyUKX\",\n                \"memberCount\": 98,\n                \"maxMemberCount\": 500\n            }\n        }\n    ]\n}\n\n```\n\n<h4 id=\"groupmodel-group-id\">获取单个群信息</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/group/:id HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n\n##### 响应：\n\n```js\n// TODO 群公告\n{\n    \"code\": 200,\n    \"result\": {\n        \"id\": \"群 Id\",\n        \"name\": \"群名称\",\n        \"portraitUri\": \"群头像\",\n        \"memberCount\": \"已加群人数\",\n        \"maxMemberCount\": \"群人数上限\",\n        \"creatorId\": \"群主 Id\",\n        \"bulletin\": \"公告\",\n        \"deletedAt\": \"解散日期\"\n    }\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群组不存在\n\n<h4 id=\"groupmodel-member\">获取群成员</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/group/:id/members HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|groupId | YES   |string | 群 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"displayName\": \"\",\n            \"role\": \"1 是群成员, 0 群主\",\n            \"createdAt\": \"2016-12-08T10:14:42.000Z\",\n            \"updatedAt\": \"2016-12-08T10:14:42.000Z\",\n            \"user\": {\n                \"id\": \"用户 Id\",\n                \"nickname\": \"名称\",\n                \"portraitUri\": \"头像\"\n            }\n        },\n        {\n            \"displayName\": \"\",\n            \"role\": 0,\n            \"createdAt\": \"2016-12-08T05:51:57.000Z\",\n            \"updatedAt\": \"2016-12-08T05:51:57.000Z\",\n            \"user\": {\n                \"id\": \"u0LUhzdHm\",\n                \"nickname\": \"Martin\",\n                \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/FpUeAftgRyYJasAm_Y1HJpmXlM9h\"\n            }\n        }\n    ]\n}\n\n// 失败\n{\n    \"code\":1001\n}\n\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 群组不存在\n| 1002  | 当前用户不在群中\n\n<h3 id=\"starmodel\">星标联系人</h3>\n\n<h4 id=\"starmodel-all\">星标联系人列表</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/star/starlist HTTP/1.1\nContent-Type:application/json\n```\n##### 响应：\n\n```js\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"star\": true,\n            \"user\": {\n                \"id\": \"OIBbe90kx\",\n                \"nickname\": \"Martin\",\n                \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/u0LUuhzHm1466557920584458984\",\n                \"region\": \"86\",\n                \"phone\": \"13269772769\",\n                \"email\": \"\"\n            }\n        }\n    ]\n}\n```\n\n<h4 id=\"starmodel-star\">设置星标联系人</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/star/star HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|targetId| YES   |string | 用户 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\":200\n}\n\n// 失败\n{\n    \"code\":1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | targetId 无效\n\n<h4 id=\"starmodel-unstar\">取消星标联系人</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/star/unstar HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|targetId| YES   |string | 用户 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\":200\n}\n\n// 失败\n{\n    \"code\":1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | targetId 无效\n\n<h3 id=\"blacklist\">黑名单</h3>\n\n<h4 id=\"blacklist-all\">黑名单列表</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/blacklist/all HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"user\": {\n                \"id\": \"675NfFjkx\",\n                \"nickname\": \"Martin\",\n                \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/675NdFjkx1466733699776768066\",\n                \"updatedAt\": \"2016-11-29T06:28:23.000Z\"\n            }\n        }\n    ]\n}\n\n```\n\n<h4 id=\"blacklist-join\">加入黑名单</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/blacklist/add HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|friendId| YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\":200\n}\n\n// 失败\n{\n    \"code\":1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 好友不存在\n\n<h4 id=\"blacklist-remove\">移除黑名单</h4>\n\n##### 请求：\n\n```js\nPOST http://api.sealtalk.im/blacklist/remove HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|friendId| YES   |string | 好友 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\":200\n}\n\n// 失败\n{\n    \"code\":1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 好友不存在\n\n<h3 id=\"department\">组织机构</h3>\n\n<h4 id=\"department-all\">获取部门列表</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/dept/all HTTP/1.1\nContent-Type:application/json\n```\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"id\": \"部门 Id\",\n            \"deptName\": \"部门名称\",\n            \"sort\": \"排序规则\",\n            \"timestamp\": 1477965673928,\n            \"parentId\": 0\n        }\n    ]\n}\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 当前用户不在组织机构内\n\n<h4 id=\"department-depart-members\">获取部门下人员列表</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/dept/:deptId/members HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|deptId  | YES   |string | 部门 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": [\n        {\n            \"deptId\": \"部门 Id\",\n            \"userId\": \"成员 Id\",\n            \"displayName\": \"成员名称\",\n            \"managerId\": \"上级成员 Id\",\n            \"timestamp\": 1478137573919,\n            \"user\": {\n                \"id\": \"成员 Id\",\n                \"nickname\": \"成员名称\",\n                \"portraitUri\": \"http://7xogjk.com1.z0.glb.clouddn.com/675NdFjkx1466733699776768066\",\n                \"region\": \"86\",\n                \"phone\": \"13269772769\",\n                \"email\": \"\"\n            },\n            \"duty\": {\n                \"dutyName\": \"职位名称\"\n            }\n        }\n    ]\n}\n// 失败\n{\n    \"code\": 1001\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 当前用户不在组织机构内\n\n<h4 id=\"department-info\">获取部门信息</h4>\n\n##### 请求：\n\n```js\nGET http://api.sealtalk.im/dept/:deptId HTTP/1.1\nContent-Type:application/json\n```\n<br/>\n\n|参数    | 必传  |类型   | 说明\n|:-------|:----- |:------|:---------\n|deptId  | YES   |string | 部门 Id\n\n##### 响应：\n\n```js\n// 成功\n{\n    \"code\": 200,\n    \"result\": {\n        \"id\": \"部门 Id\",\n        \"deptName\": \"部门名称\",\n        \"sort\": \"排序规则\",\n        \"timestamp\": 1477965673928,\n        \"parentId\": \"上级部门 Id\"\n    }\n}\n\n// 失败\n{\n    \"code\": 1001,\n}\n```\n\n##### 错误码\n\n|错误码 | 说明\n|:------|:--------\n| 1001  | 当前用户不在组织机构内"
  },
  {
    "path": "js/message-output.js",
    "content": "/*\n接收消息，并导出为文本\n\n1. 接受存储新消息\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    messageOutput(message);\n\t\t}\n\t});\n2. 控制台运行 messageOutput.show(); 获得blobUrl\n3. 保存\n*/\nfunction messageOutput(message){\n\t/* message 数据结构\n\t{\n\t\t\"content\": {\n\t\t\t\"messageName\": \"TextMessage\",\n\t\t\t\"content\": \"阿拉部\",\n\t\t\t\"extra\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"age\": 12\n\t\t\t},\n\t\t\t\"user\": {\n\t\t\t\t\"userId\": \"this-is-a-test-id\",\n\t\t\t\t\"name\": \"张三\",\n\t\t\t\t\"portraitUri\": \"http://rongcloud.cn/images/newVersion/log_wx.png\"\n\t\t\t}\n\t\t},\n\t\t\"conversationType\": 1,\n\t\t\"objectName\": \"RC:TxtMsg\",\n\t\t\"messageDirection\": 2,\n\t\t\"messageId\": \"1_13887103\",\n\t\t\"receivedStatus\": 0,\n\t\t\"receivedTime\": 1496373353260,\n\t\t\"senderUserId\": \"user10\",\n\t\t\"sentTime\": 1496287140858,\n\t\t\"targetId\": \"user10\",\n\t\t\"messageType\": \"TextMessage\",\n\t\t\"messageUId\": \"5E63-AERV-843A-D3EE\",\n\t\t\"offLineMessage\": true\n\t}\n\t*/\n\n\tmessageOutput[\"list\"] = messageOutput[\"list\"] || [];\n\n\tvar msg = {\n\t\t\"content\" : message.content.content,\n\t\t\"messageUId\" : message.messageUId,\n\t\t\"senderUserId\" : message.senderUserId,\n\t\t\"sentTime\" : message.sentTime\n\t};\n\n\tmessageOutput[\"list\"].push(JSON.stringify(msg) + \"\\n\");\n\n\tvar id = \"messageOutputBtn\";\n\tvar target = document.getElementById(id);\n\tif(!target){\n\t\ttarget = document.createElement(\"span\");\n\t\ttarget.id = id;\n\t\ttarget.style.cssText = \"position:fixed;right:1em;top:4em;border:1px solid #ccc;background:#f5f5f5;border-radius:5px;font-size:14px;padding:10px;cursor:pointer;\";\n\t\tdocument.body.appendChild(target);\n\t\ttarget.onclick = function(){\n\t\t\tvar list = messageOutput[\"list\"];\n\t\t\tvar file = new Blob(list, { \"type\" : \"text\\/plain\" }); // the blob\n\n\t\t\tvar url = window.URL.createObjectURL(file);\n\t\t\twindow.open(url);\n\t\t}\n\t}\n\ttarget.innerHTML = \"导出消息(\" + messageOutput[\"list\"].length + \")\";\n}"
  },
  {
    "path": "js/pre-check.js",
    "content": "/*\n环境检测代码：建议放在融云 SDK 运行的上下文环境进行测试\n*/\n\n;(function(){\n\t//模块化下载判断\n\tif(typeof exports === 'object' && typeof module !== 'undefined'){\n        alert(\"当前环境使用了 CMD 协议，必须使用 CMD 协议加载 SDK.\"); \n    }else if(typeof define === 'function' && define.amd){\n        alert(\"当前环境使用了 AMD 协议，必须 AMD 协议加载 SDK.\"); \n    }else{\n        alert(\"当前环境没使用 CMD 或 AMD，可以通过 src 的方式引入 SDK\"); \n    }\n\n\t//protocal\n\t(function(){\n\t\tvar url = location.href;\n\t\tif(url.indexOf(\"http://\") == -1 && url.indexOf(\"https://\") == -1){\n\t\t\talert(\"页面必须运行在 http(s) 协议下\");\n\t\t}else{\n\t\t\tconsole.log(\"location.protocal ok\");\n\t\t}\n\t})();\n\n\t//WebSocket\n\tcheckFunctionPure(\"WebSocket\");\n\n\n\t//localStorage\n\tsupportStorage();\n\n\tfunction supportStorage(){\n\t\tvar store = window.localStorage;\n\t\tif(!store){\n\t\t\talert(\"当前浏览器不支持 localStorage.\")\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar key = \"test\" + new Date().getTime();\n\n\t\ttry {\n            store.setItem(key, key);\n            store.removeItem(key);\n        } catch (err) {\n        \talert(\"隐私模式 localStorage 被禁用.\");\n        }\n\t}\n\n\n\tfunction checkFunctionPure(funcName){\n\t\tvar d = document, w = window;\n\t\tvar id = \"RongCloudCloud-API-Test\";\n\t\tvar iframe = d.getElementById(id);\n\t\tif(!iframe){\n\t\t\tiframe = d.createElement(\"iframe\");\n\t\t\tiframe.id = id;\n\t\t\tiframe.style.display = \"none\";\n\t\t\td.body.appendChild(iframe);\n\t\t}\n\t\tvar funcPure = iframe.contentWindow[funcName];\n\t\tvar funcNow = w[funcName];\n\n\t\tif(funcPure.toString() == funcNow.toString()){\n\t\t\tconsole.log(funcName + \" ok\");\n\t\t}else{\n\t\t\talert(\"原生 \" + funcName + \" 被重定义，无法使用\");\n\t\t}\n\t\t//function WebSocket() { [native code] }\n\t}\n})();"
  },
  {
    "path": "json-view/jquery.jsonview.js",
    "content": "\n/*!\njQuery JSONView.\nLicensed under the MIT License.\n */\n(function(jQuery) {\n  var $, Collapser, JSONFormatter, JSONView, JSON_VALUE_TYPES;\n  JSON_VALUE_TYPES = ['object', 'array', 'number', 'string', 'boolean', 'null'];\n  JSONFormatter = (function() {\n    function JSONFormatter(options) {\n      if (options == null) {\n        options = {};\n      }\n      this.options = options;\n    }\n\n    JSONFormatter.prototype.htmlEncode = function(html) {\n      if (html !== null) {\n        return html.toString().replace(/&/g, \"&amp;\").replace(/\"/g, \"&quot;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n      } else {\n        return '';\n      }\n    };\n\n    JSONFormatter.prototype.jsString = function(s) {\n      s = JSON.stringify(s).slice(1, -1);\n      return this.htmlEncode(s);\n    };\n\n    JSONFormatter.prototype.decorateWithSpan = function(value, className) {\n      return \"<span class=\\\"\" + className + \"\\\">\" + (this.htmlEncode(value)) + \"</span>\";\n    };\n\n    JSONFormatter.prototype.valueToHTML = function(value, level) {\n      var valueType;\n      if (level == null) {\n        level = 0;\n      }\n      valueType = Object.prototype.toString.call(value).match(/\\s(.+)]/)[1].toLowerCase();\n      if (this.options.strict && !jQuery.inArray(valueType, JSON_VALUE_TYPES)) {\n        throw new Error(\"\" + valueType + \" is not a valid JSON value type\");\n      }\n      return this[\"\" + valueType + \"ToHTML\"].call(this, value, level);\n    };\n\n    JSONFormatter.prototype.nullToHTML = function(value) {\n      return this.decorateWithSpan('null', 'null');\n    };\n\n    JSONFormatter.prototype.undefinedToHTML = function() {\n      return this.decorateWithSpan('undefined', 'undefined');\n    };\n\n    JSONFormatter.prototype.numberToHTML = function(value) {\n      return this.decorateWithSpan(value, 'num');\n    };\n\n    JSONFormatter.prototype.stringToHTML = function(value) {\n      var multilineClass, newLinePattern;\n      if (/^(http|https|file):\\/\\/[^\\s]+$/i.test(value)) {\n        return \"<a href=\\\"\" + (this.htmlEncode(value)) + \"\\\"><span class=\\\"q\\\">\\\"</span>\" + (this.jsString(value)) + \"<span class=\\\"q\\\">\\\"</span></a>\";\n      } else {\n        multilineClass = '';\n        value = this.jsString(value);\n        if (this.options.nl2br) {\n          newLinePattern = /([^>\\\\r\\\\n]?)(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n)/g;\n          if (newLinePattern.test(value)) {\n            multilineClass = ' multiline';\n            value = (value + '').replace(newLinePattern, '$1' + '<br />');\n          }\n        }\n        return \"<span class=\\\"string\" + multilineClass + \"\\\">\\\"\" + value + \"\\\"</span>\";\n      }\n    };\n\n    JSONFormatter.prototype.booleanToHTML = function(value) {\n      return this.decorateWithSpan(value, 'bool');\n    };\n\n    JSONFormatter.prototype.arrayToHTML = function(array, level) {\n      var collapsible, hasContents, index, numProps, output, value, _i, _len;\n      if (level == null) {\n        level = 0;\n      }\n      hasContents = false;\n      output = '';\n      numProps = array.length;\n      for (index = _i = 0, _len = array.length; _i < _len; index = ++_i) {\n        value = array[index];\n        hasContents = true;\n        output += '<li>' + this.valueToHTML(value, level + 1);\n        if (numProps > 1) {\n          output += ',';\n        }\n        output += '</li>';\n        numProps--;\n      }\n      if (hasContents) {\n        collapsible = level === 0 ? '' : ' collapsible';\n        return \"[<ul class=\\\"array level\" + level + collapsible + \"\\\">\" + output + \"</ul>]\";\n      } else {\n        return '[ ]';\n      }\n    };\n\n    JSONFormatter.prototype.objectToHTML = function(object, level) {\n      var collapsible, hasContents, key, numProps, output, prop, value;\n      if (level == null) {\n        level = 0;\n      }\n      hasContents = false;\n      output = '';\n      numProps = 0;\n      for (prop in object) {\n        numProps++;\n      }\n      for (prop in object) {\n        value = object[prop];\n        hasContents = true;\n        key = this.options.escape ? this.jsString(prop) : prop;\n        output += \"<li><a class=\\\"prop\\\" href=\\\"javascript:;\\\"><span class=\\\"q\\\">\\\"</span>\" + key + \"<span class=\\\"q\\\">\\\"</span></a>: \" + (this.valueToHTML(value, level + 1));\n        if (numProps > 1) {\n          output += ',';\n        }\n        output += '</li>';\n        numProps--;\n      }\n      if (hasContents) {\n        collapsible = level === 0 ? '' : ' collapsible';\n        return \"{<ul class=\\\"obj level\" + level + collapsible + \"\\\">\" + output + \"</ul>}\";\n      } else {\n        return '{ }';\n      }\n    };\n\n    JSONFormatter.prototype.jsonToHTML = function(json) {\n      return \"<div class=\\\"jsonview\\\">\" + (this.valueToHTML(json)) + \"</div>\";\n    };\n\n    return JSONFormatter;\n\n  })();\n  (typeof module !== \"undefined\" && module !== null) && (module.exports = JSONFormatter);\n  Collapser = (function() {\n    function Collapser() {}\n\n    Collapser.bindEvent = function(item, options) {\n      var collapser;\n      item.firstChild.addEventListener('click', (function(_this) {\n        return function(event) {\n          return _this.toggle(event.target.parentNode.firstChild, options);\n        };\n      })(this));\n      collapser = document.createElement('div');\n      collapser.className = 'collapser';\n      collapser.innerHTML = options.collapsed ? '+' : '-';\n      collapser.addEventListener('click', (function(_this) {\n        return function(event) {\n          return _this.toggle(event.target, options);\n        };\n      })(this));\n      item.insertBefore(collapser, item.firstChild);\n      if (options.collapsed) {\n        return this.collapse(collapser);\n      }\n    };\n\n    Collapser.expand = function(collapser) {\n      var ellipsis, target;\n      target = this.collapseTarget(collapser);\n      if (target.style.display === '') {\n        return;\n      }\n      ellipsis = target.parentNode.getElementsByClassName('ellipsis')[0];\n      target.parentNode.removeChild(ellipsis);\n      target.style.display = '';\n      return collapser.innerHTML = '-';\n    };\n\n    Collapser.collapse = function(collapser) {\n      var ellipsis, target;\n      target = this.collapseTarget(collapser);\n      if (target.style.display === 'none') {\n        return;\n      }\n      target.style.display = 'none';\n      ellipsis = document.createElement('span');\n      ellipsis.className = 'ellipsis';\n      ellipsis.innerHTML = ' &hellip; ';\n      target.parentNode.insertBefore(ellipsis, target);\n      return collapser.innerHTML = '+';\n    };\n\n    Collapser.toggle = function(collapser, options) {\n      var action, collapsers, target, _i, _len, _results;\n      if (options == null) {\n        options = {};\n      }\n      target = this.collapseTarget(collapser);\n      action = target.style.display === 'none' ? 'expand' : 'collapse';\n      if (options.recursive_collapser) {\n        collapsers = collapser.parentNode.getElementsByClassName('collapser');\n        _results = [];\n        for (_i = 0, _len = collapsers.length; _i < _len; _i++) {\n          collapser = collapsers[_i];\n          _results.push(this[action](collapser));\n        }\n        return _results;\n      } else {\n        return this[action](collapser);\n      }\n    };\n\n    Collapser.collapseTarget = function(collapser) {\n      var target, targets;\n      targets = collapser.parentNode.getElementsByClassName('collapsible');\n      if (!targets.length) {\n        return;\n      }\n      return target = targets[0];\n    };\n\n    return Collapser;\n\n  })();\n  $ = jQuery;\n  JSONView = {\n    collapse: function(el) {\n      if (el.innerHTML === '-') {\n        return Collapser.collapse(el);\n      }\n    },\n    expand: function(el) {\n      if (el.innerHTML === '+') {\n        return Collapser.expand(el);\n      }\n    },\n    toggle: function(el) {\n      return Collapser.toggle(el);\n    }\n  };\n  return $.fn.JSONView = function() {\n    var args, defaultOptions, formatter, json, method, options, outputDoc;\n    args = arguments;\n    if (JSONView[args[0]] != null) {\n      method = args[0];\n      return this.each(function() {\n        var $this, level;\n        $this = $(this);\n        if (args[1] != null) {\n          level = args[1];\n          return $this.find(\".jsonview .collapsible.level\" + level).siblings('.collapser').each(function() {\n            return JSONView[method](this);\n          });\n        } else {\n          return $this.find('.jsonview > ul > li .collapsible').siblings('.collapser').each(function() {\n            return JSONView[method](this);\n          });\n        }\n      });\n    } else {\n      json = args[0];\n      options = args[1] || {};\n      defaultOptions = {\n        collapsed: false,\n        nl2br: false,\n        recursive_collapser: false,\n        escape: true,\n        strict: false\n      };\n      options = $.extend(defaultOptions, options);\n      formatter = new JSONFormatter(options);\n      if (Object.prototype.toString.call(json) === '[object String]') {\n        json = JSON.parse(json);\n      }\n      outputDoc = formatter.jsonToHTML(json);\n      return this.each(function() {\n        var $this, item, items, _i, _len, _results;\n        $this = $(this);\n        $this.html(outputDoc);\n        items = $this[0].getElementsByClassName('collapsible');\n        _results = [];\n        for (_i = 0, _len = items.length; _i < _len; _i++) {\n          item = items[_i];\n          if (item.parentNode.nodeName === 'LI') {\n            _results.push(Collapser.bindEvent(item.parentNode, options));\n          } else {\n            _results.push(void 0);\n          }\n        }\n        return _results;\n      });\n    }\n  };\n})(jQuery);\n"
  },
  {
    "path": "json-view/jsonview.css",
    "content": "@charset \"UTF-8\";\n.jsonview {\n  border:1px solid #333;\n  padding:5px;\n  background:#000;\n  color:#f5f5f5;\n  font-size:12px;\n}\n  .jsonview .prop {\n    text-decoration: none;\n    color: #f5f5f5; }\n  .jsonview .null {\n    color: red; }\n  .jsonview .undefined {\n    color: red; }\n  .jsonview .bool {\n    color: blue; }\n  .jsonview .num {\n    color: blue; }\n  .jsonview .string {\n    color: green;\n  }\n  .jsonview .string.multiline {\n      display: inline-block;\n      vertical-align: text-top; \n  }\n  .jsonview .collapser {\n    position: absolute;\n    left: -1em;\n    cursor: pointer; }\n  .jsonview .collapsible {\n    transition: height 1.2s;\n    transition: width 1.2s; \n  }\n  .jsonview .collapsible.collapsed {\n    height: .8em;\n    width: 1em;\n    display: inline-block;\n    overflow: hidden;\n    margin: 0; \n  }\n  .jsonview .collapsible.collapsed:before {\n    content: \"…\";\n    width: 1em;\n    margin-left: .2em; \n  }\n  .jsonview .collapser.collapsed {\n    transform: rotate(0deg); \n  }\n  .jsonview .q {\n    display: inline-block;\n    width: 0px;\n    color: transparent; \n  }\n  .jsonview li {\n    position: relative; \n  }\n  .jsonview ul {\n    list-style: none;\n    margin: 0 0 0 2em;\n    padding: 0; \n  }\n  .jsonview h1 {\n    font-size: 1.2em; \n  }"
  },
  {
    "path": "lib/RongCallLib.js",
    "content": "var RongIMLib;\n(function (RongIMLib) {\n    var RongCallLib = (function () {\n        function RongCallLib(opt) {\n            this._memorySessions = {\n                timeoutMillis: 30000,\n                resolution: \"480p\",\n                maxFrameRate: 15,\n                videoSize: { height: 300, width: 400 },\n                container: {\n                    local: null,\n                    remote: null\n                },\n                remoteStreamList: {},\n                startVoIPTime: 0,\n                isActiveCall: false,\n                message: null,\n                getChildNode: function (localId, remoteStreamId) {\n                    var remoteWindow = document.createElement(\"div\");\n                    remoteWindow.id = localId + '_' + remoteStreamId;\n                    remoteWindow.className = 'rong-calllib-remote';\n                    return remoteWindow;\n                }\n            };\n            var that = this;\n            if (opt && opt.container) {\n                that._memorySessions.container = opt.container;\n            }\n            else {\n                throw new Error(\"Error:VIDEO_CONTAINER_IS_NULL.\");\n            }\n            var script = document.createElement(\"script\");\n            var head = document.getElementsByTagName(\"head\")[0];\n            script.src = \"//cdn.ronghub.com/AgoraRtcAgentSDK-1.4.2.js\";\n            head.appendChild(script);\n            script.onload = function () {\n                that._memorySessions.client = AgoraRTC.createRtcClient();\n                that._memorySessions.client.on('stream-added', function (evt) {\n                    var stream = evt.stream;\n                    that._memorySessions.client.subscribe(stream, function (err) {\n                        console.log(\"Subscribe stream failed\", err);\n                    });\n                });\n                that._memorySessions.client.on('peer-leave', function (evt) {\n                    for (var key in that._memorySessions.remoteStreamList) {\n                        if (key == evt.uid) {\n                            that._memorySessions.remoteStreamList[key].stop();\n                            delete that._memorySessions.remoteStreamList[key];\n                            break;\n                        }\n                    }\n                    if (that.isEmptyObject()) {\n                        that._memorySessions.localStream.stop();\n                        that._memorySessions.client.close();\n                    }\n                });\n                that._memorySessions.client.on('stream-subscribed', function (evt) {\n                    var stream = evt.stream;\n                    that._memorySessions.remoteStreamList[stream.getId()] = stream;\n                    that.displayStream(stream);\n                });\n                that._memorySessions.client.on(\"stream-removed\", function (evt) {\n                    var stream = evt.stream;\n                });\n            };\n        }\n        RongCallLib.init = function (opt) {\n            this._instance = new RongCallLib(opt);\n            this._rongIMClient = RongIMLib.RongIMClient.getInstance();\n            RongIMLib.RongIMClient._voipProvider = this._instance;\n        };\n        RongCallLib.getInstance = function () {\n            if (!this._instance) {\n                throw new Error(\"RongCallLib is not init!\");\n            }\n            return this._instance;\n        };\n        RongCallLib.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            if (this._memorySessions[\"isActiveCall\"]) {\n                callback.onError(RongIMLib.ErrorCode.BUSYLINE);\n                return;\n            }\n            var that = this;\n            var channelId = 'chnl_' + targetId;\n            if (channelId.length > 63) {\n                channelId = channelId.substr(0, 63);\n            }\n            that._memorySessions.startCallback = callback;\n            that._memorySessions[\"mediaType\"] = mediaType;\n            RongCallLib._rongIMClient.getAgoraDynamicKey(1, channelId, {\n                onSuccess: function (data) {\n                    that._memorySessions[channelId] = new RongIMLib.ChannelInfo(channelId, data.dynamicKey);\n                    var msg = new RongIMLib.InviteMessage({ callId: channelId, engineType: 1, channelInfo: that._memorySessions[channelId], mediaType: mediaType, inviteUserIds: userIds, extra: extra });\n                    that.sendMessage(converType, targetId, msg, {\n                        onSuccess: function (data) {\n                            callback.onSuccess();\n                            that._memorySessions[\"sentTime\"] = data.sentTime;\n                            that._memorySessions[\"timer\"] = setTimeout(function () {\n                                that.hungupCall(converType, targetId, RongIMLib.ErrorCode.REMOTE_BUSYLINE);\n                            }, that._memorySessions.timeoutMillis);\n                        },\n                        onError: callback.onError\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        RongCallLib.prototype.hungupCall = function (converType, targetId, reason) {\n            var that = this, isSend = false;\n            that.closeRemoteStream();\n            if (!that.isEmptyObject() || that._memorySessions[\"isActiveCall\"]) {\n                that._memorySessions.client.leave();\n                that._memorySessions.client.close();\n            }\n            that._memorySessions[\"isActiveCall\"] = false;\n            var channelInfo = that._memorySessions['chnl_' + targetId];\n            if (channelInfo) {\n                var msg = new RongIMLib.HungupMessage({ callId: channelInfo.Id, reason: RongIMLib.ErrorCode.REMOTE_HANGUP });\n                that.sendMessage(converType, targetId, msg);\n            }\n            var content = new RongIMLib.HungupMessage({ callId: RongIMLib.Bridge._client.userId, reason: reason });\n            var msgContent = new RongIMLib.Message();\n            msgContent.conversationType = converType;\n            msgContent.targetId = targetId;\n            msgContent.messageDirection = RongIMLib.MessageDirection.SEND;\n            msgContent.messageType = \"HungupMessage\";\n            msgContent.content = content;\n            that.onReceived(msgContent);\n        };\n        RongCallLib.prototype.joinCall = function (mediaType, callback) {\n            if (this._memorySessions[\"isActiveCall\"]) {\n                callback.onError(RongIMLib.ErrorCode.BUSYLINE);\n                return;\n            }\n            var that = this;\n            var inviteMsg = that._memorySessions.message.content;\n            RongCallLib._rongIMClient.getAgoraDynamicKey(1, inviteMsg.callId, {\n                onSuccess: function (data) {\n                    that._memorySessions.client.init(data.dynamicKey, function (obj) {\n                        var msg = new RongIMLib.AcceptMessage({ callId: inviteMsg.callId, mediaType: inviteMsg.mediaType });\n                        that.sendMessage(that._memorySessions.message.conversationType, that._memorySessions.message.targetId, msg, {\n                            onSuccess: function (message) {\n                                that._memorySessions.client.join(data.dynamicKey, inviteMsg.callId, message.sentTime & 0x7fffffff, function (uid) {\n                                    that._memorySessions[\"startVoIPTime\"] = +new Date;\n                                    that._memorySessions[\"isActiveCall\"] = true;\n                                    that._memorySessions[\"mediaType\"] = inviteMsg.mediaType;\n                                    that.initLocalStream(uid, inviteMsg.mediaType);\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: callback.onError\n                        });\n                    }, function (err) {\n                        if (err) {\n                            switch (err.reason) {\n                                case 'CLOSE_BEFORE_OPEN':\n                                    callback.onError(RongIMLib.ErrorCode.CLOSE_BEFORE_OPEN);\n                                    break;\n                                case 'ALREADY_IN_USE':\n                                    callback.onError(RongIMLib.ErrorCode.ALREADY_IN_USE);\n                                    break;\n                                case \"INVALID_CHANNEL_NAME\":\n                                    callback.onError(RongIMLib.ErrorCode.INVALID_CHANNEL_NAME);\n                                    break;\n                            }\n                        }\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        RongCallLib.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            var that = this, channelInfo = that._memorySessions['chnl_' + targetId], msg = new RongIMLib.MediaModifyMessage({ callId: channelInfo.Id, mediaType: RongIMLib.VoIPMediaType.MEDIA_AUDIO });\n            if (mediaType == RongIMLib.VoIPMediaType.MEDIA_VEDIO) {\n                that.sendMessage(converType, targetId, msg);\n                if (!that._memorySessions.localStream.videoEnabled) {\n                    that._memorySessions.localStream.videoEnabled = true;\n                    that._memorySessions.localStream.close();\n                    that.closeRemoteStream();\n                    callback.onSuccess();\n                }\n            }\n            else if (mediaType == RongIMLib.VoIPMediaType.MEDIA_AUDIO) {\n                if (!that._memorySessions.localStream.audioEnabled) {\n                    that._memorySessions.localStream.audioEnabled = true;\n                    that._memorySessions.client.disableAudio(that._memorySessions.localStream, function () {\n                        callback.onSuccess();\n                    });\n                }\n                else {\n                    that._memorySessions.localStream.audioEnabled = false;\n                    that._memorySessions.client.enableAudio(that._memorySessions.localStream, function () {\n                        callback.onSuccess();\n                    });\n                }\n            }\n        };\n        RongCallLib.prototype.mute = function (callback) {\n            var memory = this._memorySessions, stream = memory.localStream;\n            stream.audioEnabled = false;\n            memory.client.disableAudio(stream, function () {\n                callback();\n            });\n        };\n        RongCallLib.prototype.unmute = function (callback) {\n            var memory = this._memorySessions, stream = memory.localStream;\n            stream.audioEnabled = true;\n            memory.client.enableAudio(stream, function () {\n                callback();\n            });\n        };\n        RongCallLib.prototype.audioToVideo = function (conversationType, targetId, callback) {\n            var info = {\n                conversationType: conversationType,\n                targetId: targetId,\n                type: RongIMLib.VoIPMediaType.MEDIA_VEDIO,\n                disable: false,\n                method: 'enableVideo',\n                callback: callback\n            };\n            this.switchMedia(info);\n        };\n        RongCallLib.prototype.videoToAudio = function (conversationType, targetId, callback) {\n            var info = {\n                conversationType: conversationType,\n                targetId: targetId,\n                type: RongIMLib.VoIPMediaType.MEDIA_AUDIO,\n                disable: true,\n                method: 'disableViode',\n                callback: callback\n            };\n            this.switchMedia(info);\n        };\n        RongCallLib.prototype.switchMedia = function (info) {\n            var channelInfo = this._memorySessions['chnl_' + info.targetId], msg = new RongIMLib.MediaModifyMessage({ callId: channelInfo.Id, mediaType: info.type });\n            var me = this;\n            me.sendMessage(info.conversationType, info.targetId, msg);\n            var client = me._memorySessions.client, stream = me._memorySessions.localStream;\n            var item = {\n                disableVideo: function () {\n                    stream.videoEnabled = true;\n                    stream.close();\n                    me.closeRemoteStream();\n                },\n                enableVideo: function () {\n                    me.initLocalStream(me._memorySessions.uid, info.type);\n                }\n            };\n            item[info.method]();\n        };\n        RongCallLib.prototype.getSummaryMessage = function (message) {\n            var that = this, startTime = this._memorySessions[\"startVoIPTime\"], dateTime = startTime == 0 ? 0 : +new Date - startTime;\n            that._memorySessions[\"startVoIPTime\"] = 0;\n            var hungupMsg = message.content;\n            return new RongIMLib.SummaryMessage({\n                caller: RongIMLib.Bridge._client.userId,\n                inviter: message.targetId,\n                mediaType: that._memorySessions[\"mediaType\"],\n                startTime: startTime,\n                duration: Math.floor(dateTime / 1000),\n                status: hungupMsg.reason\n            });\n        };\n        RongCallLib.prototype.closeRemoteStream = function (stream) {\n            var that = this;\n            var localWindow = that._memorySessions.container.local;\n            var remoteWindow = that._memorySessions.container.remote;\n            if (stream) {\n                stream.close();\n                localWindow.removeChild(localWindow);\n            }\n            else {\n                var remoteList = that._memorySessions.remoteStreamList;\n                for (var key in remoteList) {\n                    remoteList[key].close();\n                    localWindow.removeChild(remoteWindow);\n                    delete that._memorySessions.remoteStreamList[key];\n                }\n            }\n        };\n        RongCallLib.prototype.isEmptyObject = function () {\n            var isEmpty = true, that = this;\n            for (var key in that._memorySessions[\"remoteStreamList\"]) {\n                isEmpty = false;\n                break;\n            }\n            return isEmpty;\n        };\n        RongCallLib.prototype.initLocalStream = function (uId, mediaType) {\n            var that = this, videoProfile = that.generateVideoProfile();\n            if (that._memorySessions.localStream) {\n                that._memorySessions.client.unpublish(that._memorySessions.localStream, function (err) {\n                    console.log(\"Unpublish failed with error: \", err);\n                });\n                that._memorySessions.localStream.close();\n            }\n            that._memorySessions.localStream = AgoraRTC.createStream({\n                streamID: uId,\n                local: true\n            });\n            if (mediaType == RongIMLib.VoIPMediaType.MEDIA_AUDIO) {\n                that._memorySessions.client.disableVideo(that._memorySessions.localStream);\n                that._memorySessions.client.enableAudio(that._memorySessions.localStream);\n                that._memorySessions.localStream.audioEnabled = false;\n                that._memorySessions.localStream.videoEnabled = true;\n            }\n            else {\n                that._memorySessions.localStream.audioEnabled = false;\n                that._memorySessions.localStream.videoEnabled = false;\n                that._memorySessions.localStream.setVideoProfile(videoProfile);\n                that._memorySessions.localStream.init(function () {\n                    var size = that._memorySessions.videoSize;\n                    that.displayStream();\n                    that._memorySessions.client.publish(that._memorySessions.localStream, function (err) { });\n                    that._memorySessions.client.on('stream-published');\n                }, function (err) {\n                    console.log(\"Local stream init failed.\", err);\n                });\n            }\n        };\n        RongCallLib.prototype.displayStream = function (stream) {\n            var that = this;\n            var session = that._memorySessions;\n            var local = session.container.local;\n            if (!stream) {\n                session.localStream.play(local.id);\n            }\n            else {\n                var remoteWindow = session.getChildNode(local.id, stream.getId());\n                session.container.remote = remoteWindow;\n                console.log(stream.getId());\n                local.appendChild(remoteWindow);\n                stream.play(remoteWindow.id, function (err) {\n                    throw new Error(err);\n                });\n            }\n        };\n        RongCallLib.prototype.generateVideoProfile = function () {\n            var result = \"480P_2\", that = this;\n            switch (that._memorySessions.resolution) {\n                case '120p':\n                    result = \"120P\";\n                    break;\n                case '240p':\n                    result = \"240P\";\n                    break;\n                case '360p':\n                    result = \"360P\";\n                    break;\n                case '480p':\n                    if (that._memorySessions.maxFrameRate === 15) {\n                        result = \"480P\";\n                    }\n                    else {\n                        result = \"480P_2\";\n                    }\n                    break;\n                case '720p':\n                    if (that._memorySessions.maxFrameRate === 15) {\n                        result = \"720P\";\n                    }\n                    else {\n                        result = \"720P_2\";\n                    }\n                    break;\n                case '1080p':\n                    if (that._memorySessions.maxFrameRate === 15) {\n                        result = \"1080P\";\n                    }\n                    else {\n                        result = \"1080P_2\";\n                    }\n                    break;\n                default:\n                    break;\n            }\n            return result;\n        };\n        RongCallLib.prototype.onReceived = function (message) {\n            var that = this, channelInfo = that._memorySessions['chnl_' + message.targetId];\n            switch (message.messageType) {\n                case RongIMLib.RongIMClient.MessageType[\"InviteMessage\"]:\n                    var ret = message.content;\n                    if (that._memorySessions[\"isActiveCall\"]) {\n                        var rejectMsg = new RongIMLib.HungupMessage({ callId: ret.callId, reason: RongIMLib.ErrorCode.REMOTE_BUSYLINE });\n                        that.sendMessage(message.conversationType, message.targetId, rejectMsg);\n                        return;\n                    }\n                    that._memorySessions.message = message;\n                    that._memorySessions['chnl_' + message.targetId] = { Id: ret.callId, Key: \"\" };\n                    var msg = new RongIMLib.RingingMessage({ callId: ret.callId });\n                    that.sendMessage(message.conversationType, message.targetId, msg);\n                    var content = message.content;\n                    that._memorySessions[\"mediaType\"] = content.mediaType;\n                    RongIMLib.Channel._ReceiveMessageListener.onReceived(message);\n                    break;\n                case RongIMLib.RongIMClient.MessageType[\"RingingMessage\"]:\n                    RongIMLib.Channel._ReceiveMessageListener.onReceived(message);\n                    break;\n                case RongIMLib.RongIMClient.MessageType[\"AcceptMessage\"]:\n                    if (!channelInfo)\n                        return;\n                    clearTimeout(that._memorySessions[\"timer\"]);\n                    var accMsg = message.content;\n                    that._memorySessions[\"mediaType\"] = accMsg.mediaType;\n                    that._memorySessions.client.init(channelInfo.Key, function (obj) {\n                        that._memorySessions.client.join(channelInfo.Key, channelInfo.Id, that._memorySessions[\"sentTime\"] & 0x7fffffff, function (uid) {\n                            that._memorySessions[\"startVoIPTime\"] = +new Date;\n                            that._memorySessions[\"isActiveCall\"] = true;\n                            that.initLocalStream(uid, accMsg.mediaType);\n                        });\n                    }, function (err) {\n                        if (err) {\n                            switch (err.reason) {\n                                case 'CLOSE_BEFORE_OPEN':\n                                    that._memorySessions.startCallback.onError(RongIMLib.ErrorCode.CLOSE_BEFORE_OPEN);\n                                    break;\n                                case 'ALREADY_IN_USE':\n                                    that._memorySessions.startCallback.onError(RongIMLib.ErrorCode.ALREADY_IN_USE);\n                                    break;\n                                case \"INVALID_CHANNEL_NAME\":\n                                    that._memorySessions.startCallback.onError(RongIMLib.ErrorCode.INVALID_CHANNEL_NAME);\n                                    break;\n                            }\n                        }\n                    });\n                    RongIMLib.Channel._ReceiveMessageListener.onReceived(message);\n                    break;\n                case RongIMLib.RongIMClient.MessageType[\"HungupMessage\"]:\n                    clearTimeout(that._memorySessions[\"timer\"]);\n                    if (!that.isEmptyObject()) {\n                        that._memorySessions.client.leave();\n                        that._memorySessions.client.close();\n                        that.closeRemoteStream();\n                    }\n                    message.messageType = \"SummaryMessage\";\n                    message.content = that.getSummaryMessage(message);\n                    that._memorySessions[\"isActiveCall\"] = false;\n                    RongIMLib.Channel._ReceiveMessageListener.onReceived(message);\n                    break;\n                case RongIMLib.RongIMClient.MessageType[\"MediaModifyMessage\"]:\n                    var modMsg = message.content;\n                    if (modMsg.mediaType == RongIMLib.VoIPMediaType.MEDIA_AUDIO) {\n                        that._memorySessions.localStream.close();\n                        that.closeRemoteStream();\n                    }\n                    RongIMLib.Channel._ReceiveMessageListener.onReceived(message);\n                    break;\n                case RongIMLib.RongIMClient.MessageType[\"MemberModifyMessage\"]:\n                    RongIMLib.Channel._ReceiveMessageListener.onReceived(message);\n                    break;\n            }\n            return true;\n        };\n        RongCallLib.prototype.sendMessage = function (converType, targetId, msg, callback) {\n            RongCallLib._rongIMClient.sendMessage(converType, targetId, msg, {\n                onSuccess: function (message) {\n                    if (callback) {\n                        callback.onSuccess(message);\n                    }\n                },\n                onError: function (error) {\n                    if (callback) {\n                        callback.onError(error);\n                    }\n                },\n                onBefore: function () { }\n            });\n        };\n        RongCallLib._instance = null;\n        return RongCallLib;\n    }());\n    RongIMLib.RongCallLib = RongCallLib;\n})(RongIMLib || (RongIMLib = {}));"
  },
  {
    "path": "lib/RongEmoji-dev.js",
    "content": ";(function (global, factory) {\n    'use strict';\n    if (typeof exports === 'object' && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    /* 所有emoji转化为span组成的数组 */\n    var emojiHtmls = []; \n    /* 所有emoji的名称，语言为init中设置的语言 */\n    var emojiSymbols = [];\n    /* 所有emoji的具体信息，包括tag, en, zh, name, html */\n    var emojiDetails = [];\n\n    var emojiFactory = {\n        \"u1F600\": { \"en\": \"grinning_face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F601\": { \"en\": \"grinning_with_smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F602\": { \"en\": \"laughing_tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F603\": { \"en\": \"smiley_face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F605\": { \"en\": \"happy_sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F606\": { \"en\": \"big_grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F607\": { \"en\": \"halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F608\": { \"en\": \"purple_devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F609\": { \"en\": \"winking_face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F611\": { \"en\": \"expressionless_face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F612\": { \"en\": \"dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F613\": { \"en\": \"sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F614\": { \"en\": \"pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F615\": { \"en\": \"confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F616\": { \"en\": \"confounded_face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F618\": { \"en\": \"blowing_kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F621\": { \"en\": \"angry_face\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F622\": { \"en\": \"crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-2075px 0px\" },\n        \"u1F623\": { \"en\": \"helpless_face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F624\": { \"en\": \"mad_face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F628\": { \"en\": \"fearful_face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F629\": { \"en\": \"weary_face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F630\": { \"en\": \"cold_sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F631\": { \"en\": \"scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F632\": { \"en\": \"shocked_face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F633\": { \"en\": \"flushed_face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F634\": { \"en\": \"sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"dizzy_face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F636\": { \"en\": \"mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F637\": { \"en\": \"mask_face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F3A4\": { \"en\": \"microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B2\": { \"en\": \"game_die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F3B5\": { \"en\": \"musical_note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3C0\": { \"en\": \"basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u1F3C2\": { \"en\": \"snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3E1\": { \"en\": \"house_with_garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F004\": { \"en\": \"mahjong_red_dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F4A1\": { \"en\": \"light_bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4A2\": { \"en\": \"anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A3\": { \"en\": \"bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F4A4\": { \"en\": \"zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F4A9\": { \"en\": \"pile_of_poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F4AA\": { \"en\": \"flexed_biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F4B0\": { \"en\": \"money_bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F4DA\": { \"en\": \"books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F4DE\": { \"en\": \"telephone_receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F6AB\": { \"en\": \"prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u1F6BF\": { \"en\": \"shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F30F\": { \"en\": \"globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" },\n        \"u1F33B\": { \"en\": \"sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F35A\": { \"en\": \"cooked_rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F36B\": { \"en\": \"chocolate_bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F37B\": { \"en\": \"cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u270A\": { \"en\": \"oncoming_fist\", \"zh\": \"拳头\", \"tag\": \"\\u270A\", \"position\": \"-1350px 0px\" },\n        \"u1F44C\": { \"en\": \"ok_hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44D\": { \"en\": \"thumbs_up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"thumbs_down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F44F\": { \"en\": \"clapping_hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F46A\": { \"en\": \"family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F62C\": { \"en\": \"grimacing_face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F47B\": { \"en\": \"ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F47C\": { \"en\": \"baby_angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F47D\": { \"en\": \"alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F47F\": { \"en\": \"devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F48A\": { \"en\": \"capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F48B\": { \"en\": \"kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F52B\": { \"en\": \"pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F60A\": { \"en\": \"lovely\", \"zh\": \"可爱\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u1F60B\": { \"en\": \"hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F60C\": { \"en\": \"pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F60D\": { \"en\": \"heart_eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F60E\": { \"en\": \"sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F60F\": { \"en\": \"smirking_face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F61A\": { \"en\": \"kiss_face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"crazy_face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"tongue_out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F61E\": { \"en\": \"disappointed_face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F61F\": { \"en\": \"worried_face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F62A\": { \"en\": \"sleepy_face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F62B\": { \"en\": \"tired_face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F62D\": { \"en\": \"sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-425px 0px\" },\n        \"u1F62F\": { \"en\": \"surprised_face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F64A\": { \"en\": \"no_speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F64F\": { \"en\": \"folded_hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u1F319\": { \"en\": \"crescent_moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u1F332\": { \"en\": \"pine_tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F339\": { \"en\": \"rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F349\": { \"en\": \"watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F356\": { \"en\": \"barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F366\": { \"en\": \"ice_cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F377\": { \"en\": \"wine_glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F381\": { \"en\": \"wrapped_gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F382\": { \"en\": \"birthday_cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F384\": { \"en\": \"christmas_tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F389\": { \"en\": \"party_popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F393\": { \"en\": \"graduation_cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u1F434\": { \"en\": \"horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F451\": { \"en\": \"crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F494\": { \"en\": \"broken_heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F556\": { \"en\": \"clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u1F648\": { \"en\": \"see_no_monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"hear_no_monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F680\": { \"en\": \"rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u2B50\": { \"en\": \"star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u23F0\": { \"en\": \"alarm_clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u26A1\": { \"en\": \"lightning_bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u26BD\": { \"en\": \"soccer_ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u26C4\": { \"en\": \"snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u26C5\": { \"en\": \"cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u261D\": { \"en\": \"pointing_up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u263A\": { \"en\": \"smiling\", \"zh\": \"微笑\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F44A\": { \"en\": \"raised_fist\", \"zh\": \"举拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-2975px 0px\" },\n        \"u270B\": { \"en\": \"raised_hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u270C\": { \"en\": \"victory_hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270F\": { \"en\": \"pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u2600\": { \"en\": \"sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u2601\": { \"en\": \"cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2614\": { \"en\": \"umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u2615\": { \"en\": \"coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u2744\": { \"en\": \"snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" }\n    };\n\n    // config\n    var configs = {\n        url: \"//cdn.ronghub.com/css-sprite_bg-2.1.10.png\",\n        size: 24,\n        lang: \"zh\",\n        reg: /[\\uf000-\\uf700]/g\n    };\n\n    var supportLanguage = [ \"en\" ,\"zh\" ];\n\n    /* 用于 emoji 正则匹配 */\n    var regExpTag;\n\n    /* 判断是否支持emoji的渲染 */\n    var isSupportEmoji = (function() {\n        var node = document.createElement(\"canvas\");\n        if (!node.getContext || !node.getContext(\"2d\") || typeof node.getContext(\"2d\").fillText !== \"function\") {\n            return false;\n        }\n        var ctx = node.getContext(\"2d\");\n        ctx.textBaseline = \"top\";\n        ctx.font = \"32px Arial\";\n        ctx.fillText('\\ud83d\\ude03', 0, 0);\n        return ctx.getImageData(16, 16, 1, 1).data[0] !== 0;\n    })();\n\n    /**\n     * 初始化\n     * @param  {object} emoji  可选，包含dataSource和url。 dataSource包含扩展的表情信息, key为标识表情的unicode码\n     * @param  {object} config 可选，包括size, lang, url, regExp 四个可选属性。分别表示html大小，输出语言，图片背景图，匹配unicode码的正则表达式\n     */\n    var init = function(newEmojis, opt) {\n        addBaseCss();\n\n        configs = extend(configs, opt);\n\n        var newEmojiFactory = getNewEmojiFactory(newEmojis, configs);\n        emojiFactory = extend(emojiFactory, newEmojiFactory);\n\n        setupEmojiRegExp(emojiFactory);\n    };\n\n    var extend = function() {\n        if (arguments.length === 0) {\n            return;\n        }\n        var obj = arguments[0];\n        for (var i = 1, len = arguments.length; i < len; i++) {\n            var other = arguments[i];\n            for (var item in other) {\n                obj[item] = other[item];\n            }\n        }\n        return obj;\n    }\n\n    var addBaseCss = function() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden; }\"\n        var head = document.getElementsByTagName(\"head\")[0];\n        var style = document.createElement(\"style\");\n        style.type = \"text/css\";\n        style.innerHTML = baseCss;\n        head.appendChild(style);\n    }\n\n    var getNewEmojiFactory = function(newEmojis, opt) {\n        var newEmojiFactory = {};\n        if (newEmojis) {\n            var _emojiFactory = newEmojis.dataSource;\n            var _url = newEmojis.url || opt.url;\n            for (var key in _emojiFactory) {\n                _emojiFactory[key][\"background\"] = _url;\n                newEmojiFactory[key] = _emojiFactory[key];\n            }\n        }\n        return newEmojiFactory;\n    }\n\n    var setupEmojiRegExp = function(emojiFac ,tagReg) {\n        emojiSymbols.length = 0;\n        emojiHtmls.length = 0;\n\n        var tags = [];\n        var lang = configs.lang;\n        for (var key in emojiFac) {\n            var emoji = emojiFac[key];\n            tags.push(escape(emoji.tag));\n            setupEmojiDetail(emoji);\n        }\n        tags = tags.join(\"|\");\n        var regExp = new RegExp(\"%\", \"g\");\n        tags = tags.replace(regExp, function (x) { return \"\\\\\"; });\n        regExpTag = new RegExp(\"(\" + tags + \")\", \"g\");\n    };\n\n    function setupEmojiDetail(emoji) {\n        var lang = configs.lang;\n        var span = createSpan(emoji);\n        emojiSymbols.push(emoji[lang]);\n        emojiHtmls.push(getDom(span));\n        emojiDetails.push({\n            name: \"[\" + emoji[lang] + \"]\",\n            tag: emoji.tag,\n            zh: emoji.zh,\n            en: emoji.en,\n            html: span\n        });\n    }\n\n    function getDom(html) {\n        var div = document.createElement('div');\n        div.innerHTML = html;\n        return div.childNodes[0];\n    }\n\n    var computeBgPosition = function(position, sizePx) {\n        var sizePx = sizePx || configs.size;\n        var scale = sizePx / 24;\n        var position = position.split(' ');\n        var x = position[0], y = position[1];\n        x = x.split(\"px\")[0];\n        y = y.split(\"px\")[0];\n        return parseInt(x) * scale + \"px \" + parseInt(y) * scale + \"px\";\n    }\n\n    var getEmojiHtml = function(object) {\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='\" + style + \"''></span>\"\n        var ret = spanTpl.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n            return object[name];\n        })\n        return ret;\n    };\n\n    var createSpan = function(emojiDetail, sizePx) {\n        var emojiObj = {\n            size: sizePx || configs.size,\n            position: computeBgPosition(emojiDetail.position, sizePx),\n            background: emojiDetail.background || configs.url,\n            name: emojiDetail[configs.lang],\n            tag: emojiDetail.tag\n        };\n        return getEmojiHtml(emojiObj);\n    };\n\n    var calculateUTF = function (nativeEmoji) {\n        if (61440 < nativeEmoji.charCodeAt(0)) {\n            var emojiUnicodeKey = escape(nativeEmoji).replace(\"%u\", \"u1\");\n            var emoji = emojiFactory[emojiUnicodeKey];\n            if (emoji){\n                return emoji.tag;\n            }\n        }\n        return nativeEmoji;\n    };\n\n    var getEmojiBySymbol = function(symbol) {\n        var temp = symbol.slice(1, symbol.length - 1);\n        for (var i = 0; i < emojiDetails.length; i++) {\n            var lang = configs.lang;\n            var emoji = emojiDetails[i];\n            if(emoji[lang] === temp) {\n                return emoji.tag;\n            }\n        }\n        return \"[\" + symbol + \"]\";\n    };\n\n\n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} emoji 必填，需要转化的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围。默认为init时设置的regExp，如果不设置，默认为/[\\uf000-\\uf700]/g\n     * @return {string}          转化后的字符串\n     */\n    var emojiDecode = function(emojis, reg) {\n        reg = reg || configs.reg;\n        return emojis.replace(reg, function(emoji) {\n            return calculateUTF(emoji) || emoji;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} emojis 必填，需要转化的字符串\n     * @param  {regExp} reg      可选，匹配的正则表达式\n     * @return {string}          转化后的字符串\n     */\n    var emojiToSymbol = function(emojis, reg) {\n        emojis = emojiDecode(emojis, reg);\n        var emojiSymbol = {};\n        emojiSymbol = emojis.replace(regExpTag, function(emojiTag) {\n            var lang = configs.lang;\n            for (var emojiKey in emojiFactory) {\n                if (emojiFactory[emojiKey].tag == emojiTag) {\n                    return \"[\" + emojiFactory[emojiKey][lang] + \"]\";\n                }\n            }\n        });\n        return emojiSymbol;\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} symbols 必填\n     * @return {string}           \n     */\n    var symbolToEmoji = function(symbols) {\n        return symbols.replace(/\\[([^\\[\\]]+?)\\]/g, function(symbol) {\n            return getEmojiBySymbol(symbol);\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} emojiStr 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx      可选，html标签的大小\n     * @param  {string} reg      可选，正则表达式\n     * @return {span标签}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(emojis, sizePx, reg) {\n        emojis = emojiDecode(emojis, reg);\n        return emojis.replace(regExpTag, function(emojiTag) {\n            var span;\n            for (var key in emojiFactory) {\n                if (emojiFactory[key].tag == emojiTag) {\n                    span = createSpan(emojiFactory[key], sizePx);\n                    break;\n                }\n            }\n            return span;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} symbol 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(symbol, sizePx, reg) {\n        var emoji = symbolToEmoji(symbol);\n        return emojiToHTML(emoji, sizePx, reg);\n    };\n\n    /**\n     * 获取所有emoji的详情\n     * @return {array} 包含多个object，每个object包括tag, en, zh, name, html\n     */\n    var getAllEmoji = function() {\n        return emojiDetails;\n    };\n\n\n\n    return {\n        init: init,\n        supportLanguage: supportLanguage,\n        emojis: emojiHtmls,\n        names: emojiSymbols,\n        getAllEmoji: getAllEmoji,\n        emojiToSymbol: emojiToSymbol,\n        symbolToEmoji: symbolToEmoji,\n        emojiToHTML: emojiToHTML,\n        symbolToHTML: symbolToHTML,\n        messageDecode: emojiDecode,\n        isSupportEmoji: isSupportEmoji\n    }\n});"
  },
  {
    "path": "lib/RongIMVoice-2.2.6.js",
    "content": "var RongIMLib; (function(RongIMLib) {\n    var RongIMVoice = (function() {\n        function RongIMVoice() {}\n        RongIMVoice.init = function() {\n            if (this.notSupportH5) {\n                var div = document.createElement(\"div\");\n                div.setAttribute(\"id\", \"flashContent\");\n                document.body.appendChild(div);\n                var script = document.createElement(\"script\");\n                script.src = (RongIMLib.RongIMClient && RongIMLib.RongIMClient._memoryStore && RongIMLib.RongIMClient._memoryStore.depend && RongIMLib.RongIMClient._memoryStore.depend.voiceSwfobjct) || \"//cdn.ronghub.com/swfobject-2.0.0.min.js\";\n                var header = document.getElementsByTagName(\"head\")[0];\n                header.appendChild(script);\n                var browser=navigator.appName; \n                var b_version=navigator.appVersion; \n                var version=b_version.split(\";\"); \n                var trim_Version=version[1].replace(/[ ]/g,\"\"); \n                script.onload  = function() {\n                    var swfVersionStr = \"11.4.0\";\n                    var flashvars = {};\n                    var params = {};\n                    params.quality = \"high\";\n                    params.bgcolor = \"#ffffff\";\n                    params.allowscriptaccess = \"always\";\n                    params.allowScriptAccess = \"always\";\n                    params.allowfullscreen = \"true\";\n                    var attributes = {};\n                    attributes.id = \"player\";\n                    attributes.name = \"player\";\n                    attributes.align = \"middle\";\n                    swfobject.embedSWF((RongIMLib.RongIMClient && RongIMLib.RongIMClient._memoryStore && RongIMLib.RongIMClient._memoryStore.depend && RongIMLib.RongIMClient._memoryStore.depend.voicePlaySwf) || \"//cdn.ronghub.com/player-2.0.2.swf\", \"flashContent\", \"1\", \"1\", swfVersionStr, null, flashvars, params, attributes)\n                    var f_version = swfobject.getFlashPlayerVersion();\n                    if(f_version['major'] <= 0 ){\n                        console.error(\"You haven't installed the flash Player yet.\");\n                    }\n                }\n                if(!(browser==\"Microsoft Internet Explorer\" && trim_Version==\"MSIE9.0\" || trim_Version==\"MSIE10.0\")) {\n                    script.onreadystatechange = script.onload;\n                }\n            }\n            this.isInit = true\n        };\n        RongIMVoice.play = function(data, duration) {\n            this.checkInit(\"play\");\n            var me = this;\n            if (me.notSupportH5) {\n                if(me.thisMovie().doAction){\n                    me.thisMovie().doAction(\"init\", data);\n                } else {\n                    setTimeout(function(){me.play(data, duration);},500);\n                }\n            } else {\n                var key = data.substr( - 10);\n                if (this.element[key]) {\n                    this.element[key].play();\n                }\n                me.onCompleted(duration)\n            }\n        };\n        RongIMVoice.stop = function(base64Data) {\n            this.checkInit(\"stop\");\n            var me = this;\n            if (me.notSupportH5) {\n                me.thisMovie().doAction(\"stop\")\n            } else {\n                if (base64Data) {\n                    var key = base64Data.substr( - 10);\n                    if (me.element[key]) {\n                        me.element[key].pause();\n                        me.element[key].currentTime = 0\n                    }\n                } else {\n                    for (var key_1 in me.element) {\n                        me.element[key_1].pause();\n                        me.element[key_1].currentTime = 0\n                    }\n                }\n            }\n        };\n        RongIMVoice.preLoaded = function(base64Data, callback) {\n            var str = base64Data.substr( - 10),\n            me = this;\n            if (me.element[str]) {\n                callback && callback();\n                return\n            }\n            // if (/android/i.test(navigator.userAgent) && /MicroMessenger/i.test(navigator.userAgent)) {\n            if(false){    \n                var audio = new Audio();\n                audio.src = \"data:audio/amr;base64,\" + base64Data;\n                me.element[str] = audio;\n                callback && callback()\n            } else {\n                if (!me.notSupportH5) {\n                    if (str in me.element) {\n                        return\n                    }\n                    var audio = new Audio();\n                    audio.src = \"\";\n                    var nopromise = {\n                       catch: new Function()\n                    };\n                    (audio.play() || nopromise).catch(function () { });  //解决浏览器报错 The play() request was interrupted by a new load request\n\n                    var blob = me.base64ToBlob(base64Data, \"audio/amr\");\n                    var reader = new FileReader();\n                    reader.onload = function(e) {\n                        var data = new Uint8Array(e.target.result);\n                        var samples = AMR.decode(data);\n                        var pcm = PCMData.encode({\n                            sampleRate: 8000,\n                            channelCount: 1,\n                            bytesPerSample: 2,\n                            data: samples\n                        }); \n                        audio.src = \"data:audio/wav;base64,\" + btoa(pcm);\n                        me.element[str] = audio;\n                        callback && callback() \n                    };        \n                    reader.readAsArrayBuffer(blob)\n                }else {\n                    callback && callback()\n                }\n            }\n        };\n        RongIMVoice.onprogress = function() {};\n        RongIMVoice.checkInit = function(position) {\n            if (!this.isInit) {\n                throw new Error(\"RongIMVoice is not init,position:\" + position)\n            }\n        };\n        RongIMVoice.thisMovie = function() {\n            return eval(\"window['player']\")\n        };\n        RongIMVoice.onCompleted = function(duration) {\n            var me = this;\n            var count = 0;\n            var timer = setInterval(function() {\n                count++;\n                me.onprogress();\n                if (count >= duration) {\n                    clearInterval(timer)\n                }\n            },\n            1000);\n            if (me.notSupportH5) {\n                me.thisMovie().doAction(\"play\")\n            }\n        };\n        RongIMVoice.base64ToBlob = function(base64Data, type) {\n            var mimeType;\n            if (type) {\n                mimeType = {\n                    type: type\n                }\n            }\n            base64Data = base64Data.replace(/^(.*)[,]/, \"\");\n            var sliceSize = 1024;\n            var byteCharacters = atob(base64Data);\n            var bytesLength = byteCharacters.length;\n            var slicesCount = Math.ceil(bytesLength / sliceSize);\n            var byteArrays = new Array(slicesCount);\n            for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {\n                var begin = sliceIndex * sliceSize;\n                var end = Math.min(begin + sliceSize, bytesLength);\n                var bytes = new Array(end - begin);\n                for (var offset = begin,\n                i = 0; offset < end; ++i, ++offset) {\n                    bytes[i] = byteCharacters[offset].charCodeAt(0)\n                }\n                byteArrays[sliceIndex] = new Uint8Array(bytes)\n            }\n            return new Blob(byteArrays, mimeType)\n        };\n        RongIMVoice.notSupportH5 = /Trident/.test(navigator.userAgent);\n        RongIMVoice.element = {};\n        RongIMVoice.isInit = false;\n        return RongIMVoice\n    } ());\n    RongIMLib.RongIMVoice = RongIMVoice;\n    if (\"function\" === typeof require && \"object\" === typeof module && module && module.id && \"object\" === typeof exports && exports) {\n        module.exports = RongIMVoice\n    } else {\n        if (\"function\" === typeof define && define.amd) {\n            define(\"RongIMVoice\", [],\n            function() {\n                return RongIMVoice\n            })\n        }\n    }\n})(RongIMLib || (RongIMLib = {}));"
  },
  {
    "path": "lib/jquery-3.1.1.js",
    "content": "/*!\n * jQuery JavaScript Library v3.1.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2016-09-22T22:30Z\n */\n( function( global, factory ) {\n\n    \"use strict\";\n\n    if ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n        // For CommonJS and CommonJS-like environments where a proper `window`\n        // is present, execute the factory and get jQuery.\n        // For environments that do not have a `window` with a `document`\n        // (such as Node.js), expose a factory as module.exports.\n        // This accentuates the need for the creation of a real `window`.\n        // e.g. var jQuery = require(\"jquery\")(window);\n        // See ticket #14549 for more info.\n        module.exports = global.document ?\n            factory( global, true ) :\n            function( w ) {\n                if ( !w.document ) {\n                    throw new Error( \"jQuery requires a window with a document\" );\n                }\n                return factory( w );\n            };\n    } else {\n        factory( global );\n    }\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar document = window.document;\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\n\n\n    function DOMEval( code, doc ) {\n        doc = doc || document;\n\n        var script = doc.createElement( \"script\" );\n\n        script.text = code;\n        doc.head.appendChild( script ).parentNode.removeChild( script );\n    }\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n    version = \"3.1.1\",\n\n    // Define a local copy of jQuery\n    jQuery = function( selector, context ) {\n\n        // The jQuery object is actually just the init constructor 'enhanced'\n        // Need init if jQuery is called (just allow error to be thrown if not included)\n        return new jQuery.fn.init( selector, context );\n    },\n\n    // Support: Android <=4.0 only\n    // Make sure we trim BOM and NBSP\n    rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\n\n    // Matches dashed string for camelizing\n    rmsPrefix = /^-ms-/,\n    rdashAlpha = /-([a-z])/g,\n\n    // Used by jQuery.camelCase as callback to replace()\n    fcamelCase = function( all, letter ) {\n        return letter.toUpperCase();\n    };\n\njQuery.fn = jQuery.prototype = {\n\n    // The current version of jQuery being used\n    jquery: version,\n\n    constructor: jQuery,\n\n    // The default length of a jQuery object is 0\n    length: 0,\n\n    toArray: function() {\n        return slice.call( this );\n    },\n\n    // Get the Nth element in the matched element set OR\n    // Get the whole matched element set as a clean array\n    get: function( num ) {\n\n        // Return all the elements in a clean array\n        if ( num == null ) {\n            return slice.call( this );\n        }\n\n        // Return just the one element from the set\n        return num < 0 ? this[ num + this.length ] : this[ num ];\n    },\n\n    // Take an array of elements and push it onto the stack\n    // (returning the new matched element set)\n    pushStack: function( elems ) {\n\n        // Build a new jQuery matched element set\n        var ret = jQuery.merge( this.constructor(), elems );\n\n        // Add the old object onto the stack (as a reference)\n        ret.prevObject = this;\n\n        // Return the newly-formed element set\n        return ret;\n    },\n\n    // Execute a callback for every element in the matched set.\n    each: function( callback ) {\n        return jQuery.each( this, callback );\n    },\n\n    map: function( callback ) {\n        return this.pushStack( jQuery.map( this, function( elem, i ) {\n            return callback.call( elem, i, elem );\n        } ) );\n    },\n\n    slice: function() {\n        return this.pushStack( slice.apply( this, arguments ) );\n    },\n\n    first: function() {\n        return this.eq( 0 );\n    },\n\n    last: function() {\n        return this.eq( -1 );\n    },\n\n    eq: function( i ) {\n        var len = this.length,\n            j = +i + ( i < 0 ? len : 0 );\n        return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n    },\n\n    end: function() {\n        return this.prevObject || this.constructor();\n    },\n\n    // For internal use only.\n    // Behaves like an Array's method, not like a jQuery method.\n    push: push,\n    sort: arr.sort,\n    splice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n    var options, name, src, copy, copyIsArray, clone,\n        target = arguments[ 0 ] || {},\n        i = 1,\n        length = arguments.length,\n        deep = false;\n\n    // Handle a deep copy situation\n    if ( typeof target === \"boolean\" ) {\n        deep = target;\n\n        // Skip the boolean and the target\n        target = arguments[ i ] || {};\n        i++;\n    }\n\n    // Handle case when target is a string or something (possible in deep copy)\n    if ( typeof target !== \"object\" && !jQuery.isFunction( target ) ) {\n        target = {};\n    }\n\n    // Extend jQuery itself if only one argument is passed\n    if ( i === length ) {\n        target = this;\n        i--;\n    }\n\n    for ( ; i < length; i++ ) {\n\n        // Only deal with non-null/undefined values\n        if ( ( options = arguments[ i ] ) != null ) {\n\n            // Extend the base object\n            for ( name in options ) {\n                src = target[ name ];\n                copy = options[ name ];\n\n                // Prevent never-ending loop\n                if ( target === copy ) {\n                    continue;\n                }\n\n                // Recurse if we're merging plain objects or arrays\n                if ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n                    ( copyIsArray = jQuery.isArray( copy ) ) ) ) {\n\n                    if ( copyIsArray ) {\n                        copyIsArray = false;\n                        clone = src && jQuery.isArray( src ) ? src : [];\n\n                    } else {\n                        clone = src && jQuery.isPlainObject( src ) ? src : {};\n                    }\n\n                    // Never move original objects, clone them\n                    target[ name ] = jQuery.extend( deep, clone, copy );\n\n                // Don't bring in undefined values\n                } else if ( copy !== undefined ) {\n                    target[ name ] = copy;\n                }\n            }\n        }\n    }\n\n    // Return the modified object\n    return target;\n};\n\njQuery.extend( {\n\n    // Unique for each copy of jQuery on the page\n    expando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n    // Assume jQuery is ready without the ready module\n    isReady: true,\n\n    error: function( msg ) {\n        throw new Error( msg );\n    },\n\n    noop: function() {},\n\n    isFunction: function( obj ) {\n        return jQuery.type( obj ) === \"function\";\n    },\n\n    isArray: Array.isArray,\n\n    isWindow: function( obj ) {\n        return obj != null && obj === obj.window;\n    },\n\n    isNumeric: function( obj ) {\n\n        // As of jQuery 3.0, isNumeric is limited to\n        // strings and numbers (primitives or objects)\n        // that can be coerced to finite numbers (gh-2662)\n        var type = jQuery.type( obj );\n        return ( type === \"number\" || type === \"string\" ) &&\n\n            // parseFloat NaNs numeric-cast false positives (\"\")\n            // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n            // subtraction forces infinities to NaN\n            !isNaN( obj - parseFloat( obj ) );\n    },\n\n    isPlainObject: function( obj ) {\n        var proto, Ctor;\n\n        // Detect obvious negatives\n        // Use toString instead of jQuery.type to catch host objects\n        if ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n            return false;\n        }\n\n        proto = getProto( obj );\n\n        // Objects with no prototype (e.g., `Object.create( null )`) are plain\n        if ( !proto ) {\n            return true;\n        }\n\n        // Objects with prototype are plain iff they were constructed by a global Object function\n        Ctor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n        return typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n    },\n\n    isEmptyObject: function( obj ) {\n\n        /* eslint-disable no-unused-vars */\n        // See https://github.com/eslint/eslint/issues/6125\n        var name;\n\n        for ( name in obj ) {\n            return false;\n        }\n        return true;\n    },\n\n    type: function( obj ) {\n        if ( obj == null ) {\n            return obj + \"\";\n        }\n\n        // Support: Android <=2.3 only (functionish RegExp)\n        return typeof obj === \"object\" || typeof obj === \"function\" ?\n            class2type[ toString.call( obj ) ] || \"object\" :\n            typeof obj;\n    },\n\n    // Evaluates a script in a global context\n    globalEval: function( code ) {\n        DOMEval( code );\n    },\n\n    // Convert dashed to camelCase; used by the css and data modules\n    // Support: IE <=9 - 11, Edge 12 - 13\n    // Microsoft forgot to hump their vendor prefix (#9572)\n    camelCase: function( string ) {\n        return string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n    },\n\n    nodeName: function( elem, name ) {\n        return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n    },\n\n    each: function( obj, callback ) {\n        var length, i = 0;\n\n        if ( isArrayLike( obj ) ) {\n            length = obj.length;\n            for ( ; i < length; i++ ) {\n                if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n                    break;\n                }\n            }\n        } else {\n            for ( i in obj ) {\n                if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n                    break;\n                }\n            }\n        }\n\n        return obj;\n    },\n\n    // Support: Android <=4.0 only\n    trim: function( text ) {\n        return text == null ?\n            \"\" :\n            ( text + \"\" ).replace( rtrim, \"\" );\n    },\n\n    // results is for internal usage only\n    makeArray: function( arr, results ) {\n        var ret = results || [];\n\n        if ( arr != null ) {\n            if ( isArrayLike( Object( arr ) ) ) {\n                jQuery.merge( ret,\n                    typeof arr === \"string\" ?\n                    [ arr ] : arr\n                );\n            } else {\n                push.call( ret, arr );\n            }\n        }\n\n        return ret;\n    },\n\n    inArray: function( elem, arr, i ) {\n        return arr == null ? -1 : indexOf.call( arr, elem, i );\n    },\n\n    // Support: Android <=4.0 only, PhantomJS 1 only\n    // push.apply(_, arraylike) throws on ancient WebKit\n    merge: function( first, second ) {\n        var len = +second.length,\n            j = 0,\n            i = first.length;\n\n        for ( ; j < len; j++ ) {\n            first[ i++ ] = second[ j ];\n        }\n\n        first.length = i;\n\n        return first;\n    },\n\n    grep: function( elems, callback, invert ) {\n        var callbackInverse,\n            matches = [],\n            i = 0,\n            length = elems.length,\n            callbackExpect = !invert;\n\n        // Go through the array, only saving the items\n        // that pass the validator function\n        for ( ; i < length; i++ ) {\n            callbackInverse = !callback( elems[ i ], i );\n            if ( callbackInverse !== callbackExpect ) {\n                matches.push( elems[ i ] );\n            }\n        }\n\n        return matches;\n    },\n\n    // arg is for internal usage only\n    map: function( elems, callback, arg ) {\n        var length, value,\n            i = 0,\n            ret = [];\n\n        // Go through the array, translating each of the items to their new values\n        if ( isArrayLike( elems ) ) {\n            length = elems.length;\n            for ( ; i < length; i++ ) {\n                value = callback( elems[ i ], i, arg );\n\n                if ( value != null ) {\n                    ret.push( value );\n                }\n            }\n\n        // Go through every key on the object,\n        } else {\n            for ( i in elems ) {\n                value = callback( elems[ i ], i, arg );\n\n                if ( value != null ) {\n                    ret.push( value );\n                }\n            }\n        }\n\n        // Flatten any nested arrays\n        return concat.apply( [], ret );\n    },\n\n    // A global GUID counter for objects\n    guid: 1,\n\n    // Bind a function to a context, optionally partially applying any\n    // arguments.\n    proxy: function( fn, context ) {\n        var tmp, args, proxy;\n\n        if ( typeof context === \"string\" ) {\n            tmp = fn[ context ];\n            context = fn;\n            fn = tmp;\n        }\n\n        // Quick check to determine if target is callable, in the spec\n        // this throws a TypeError, but we will just return undefined.\n        if ( !jQuery.isFunction( fn ) ) {\n            return undefined;\n        }\n\n        // Simulated bind\n        args = slice.call( arguments, 2 );\n        proxy = function() {\n            return fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n        };\n\n        // Set the guid of unique handler to the same of original handler, so it can be removed\n        proxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n        return proxy;\n    },\n\n    now: Date.now,\n\n    // jQuery.support is not used in Core but other projects attach their\n    // properties to it so it needs to exist.\n    support: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n    jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( i, name ) {\n    class2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n    // Support: real iOS 8.2 only (not reproducible in simulator)\n    // `in` check used to prevent JIT error (gh-2145)\n    // hasOwn isn't used here due to false negatives\n    // regarding Nodelist length in IE\n    var length = !!obj && \"length\" in obj && obj.length,\n        type = jQuery.type( obj );\n\n    if ( type === \"function\" || jQuery.isWindow( obj ) ) {\n        return false;\n    }\n\n    return type === \"array\" || length === 0 ||\n        typeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.3\n * https://sizzlejs.com/\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2016-08-08\n */\n(function( window ) {\n\nvar i,\n    support,\n    Expr,\n    getText,\n    isXML,\n    tokenize,\n    compile,\n    select,\n    outermostContext,\n    sortInput,\n    hasDuplicate,\n\n    // Local document vars\n    setDocument,\n    document,\n    docElem,\n    documentIsHTML,\n    rbuggyQSA,\n    rbuggyMatches,\n    matches,\n    contains,\n\n    // Instance-specific data\n    expando = \"sizzle\" + 1 * new Date(),\n    preferredDoc = window.document,\n    dirruns = 0,\n    done = 0,\n    classCache = createCache(),\n    tokenCache = createCache(),\n    compilerCache = createCache(),\n    sortOrder = function( a, b ) {\n        if ( a === b ) {\n            hasDuplicate = true;\n        }\n        return 0;\n    },\n\n    // Instance methods\n    hasOwn = ({}).hasOwnProperty,\n    arr = [],\n    pop = arr.pop,\n    push_native = arr.push,\n    push = arr.push,\n    slice = arr.slice,\n    // Use a stripped-down indexOf as it's faster than native\n    // https://jsperf.com/thor-indexof-vs-for/5\n    indexOf = function( list, elem ) {\n        var i = 0,\n            len = list.length;\n        for ( ; i < len; i++ ) {\n            if ( list[i] === elem ) {\n                return i;\n            }\n        }\n        return -1;\n    },\n\n    booleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n    // Regular expressions\n\n    // http://www.w3.org/TR/css3-selectors/#whitespace\n    whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n    // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n    identifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",\n\n    // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n    attributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n        // Operator (capture 2)\n        \"*([*^$|!~]?=)\" + whitespace +\n        // \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n        \"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n        \"*\\\\]\",\n\n    pseudos = \":(\" + identifier + \")(?:\\\\((\" +\n        // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n        // 1. quoted (capture 3; capture 4 or capture 5)\n        \"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n        // 2. simple (capture 6)\n        \"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n        // 3. anything else (capture 2)\n        \".*\" +\n        \")\\\\)|)\",\n\n    // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n    rwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n    rtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n    rcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n    rcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n    rattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*?)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n    rpseudo = new RegExp( pseudos ),\n    ridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n    matchExpr = {\n        \"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n        \"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n        \"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n        \"ATTR\": new RegExp( \"^\" + attributes ),\n        \"PSEUDO\": new RegExp( \"^\" + pseudos ),\n        \"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n            \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n            \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n        \"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n        // For use in libraries implementing .is()\n        // We use this for POS matching in `select`\n        \"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n            whitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n    },\n\n    rinputs = /^(?:input|select|textarea|button)$/i,\n    rheader = /^h\\d$/i,\n\n    rnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n    // Easily-parseable/retrievable ID or TAG or CLASS selectors\n    rquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n    rsibling = /[+~]/,\n\n    // CSS escapes\n    // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n    runescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n    funescape = function( _, escaped, escapedWhitespace ) {\n        var high = \"0x\" + escaped - 0x10000;\n        // NaN means non-codepoint\n        // Support: Firefox<24\n        // Workaround erroneous numeric interpretation of +\"0x\"\n        return high !== high || escapedWhitespace ?\n            escaped :\n            high < 0 ?\n                // BMP codepoint\n                String.fromCharCode( high + 0x10000 ) :\n                // Supplemental Plane codepoint (surrogate pair)\n                String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n    },\n\n    // CSS string/identifier serialization\n    // https://drafts.csswg.org/cssom/#common-serializing-idioms\n    rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n    fcssescape = function( ch, asCodePoint ) {\n        if ( asCodePoint ) {\n\n            // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n            if ( ch === \"\\0\" ) {\n                return \"\\uFFFD\";\n            }\n\n            // Control characters and (dependent upon position) numbers get escaped as code points\n            return ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n        }\n\n        // Other potentially-special ASCII characters get backslash-escaped\n        return \"\\\\\" + ch;\n    },\n\n    // Used for iframes\n    // See setDocument()\n    // Removing the function wrapper causes a \"Permission Denied\"\n    // error in IE\n    unloadHandler = function() {\n        setDocument();\n    },\n\n    disabledAncestor = addCombinator(\n        function( elem ) {\n            return elem.disabled === true && (\"form\" in elem || \"label\" in elem);\n        },\n        { dir: \"parentNode\", next: \"legend\" }\n    );\n\n// Optimize for push.apply( _, NodeList )\ntry {\n    push.apply(\n        (arr = slice.call( preferredDoc.childNodes )),\n        preferredDoc.childNodes\n    );\n    // Support: Android<4.0\n    // Detect silently failing push.apply\n    arr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n    push = { apply: arr.length ?\n\n        // Leverage slice if possible\n        function( target, els ) {\n            push_native.apply( target, slice.call(els) );\n        } :\n\n        // Support: IE<9\n        // Otherwise append directly\n        function( target, els ) {\n            var j = target.length,\n                i = 0;\n            // Can't trust NodeList.length\n            while ( (target[j++] = els[i++]) ) {}\n            target.length = j - 1;\n        }\n    };\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n    var m, i, elem, nid, match, groups, newSelector,\n        newContext = context && context.ownerDocument,\n\n        // nodeType defaults to 9, since context defaults to document\n        nodeType = context ? context.nodeType : 9;\n\n    results = results || [];\n\n    // Return early from calls with invalid selector or context\n    if ( typeof selector !== \"string\" || !selector ||\n        nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n        return results;\n    }\n\n    // Try to shortcut find operations (as opposed to filters) in HTML documents\n    if ( !seed ) {\n\n        if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n            setDocument( context );\n        }\n        context = context || document;\n\n        if ( documentIsHTML ) {\n\n            // If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n            // (excepting DocumentFragment context, where the methods don't exist)\n            if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\n                // ID selector\n                if ( (m = match[1]) ) {\n\n                    // Document context\n                    if ( nodeType === 9 ) {\n                        if ( (elem = context.getElementById( m )) ) {\n\n                            // Support: IE, Opera, Webkit\n                            // TODO: identify versions\n                            // getElementById can match elements by name instead of ID\n                            if ( elem.id === m ) {\n                                results.push( elem );\n                                return results;\n                            }\n                        } else {\n                            return results;\n                        }\n\n                    // Element context\n                    } else {\n\n                        // Support: IE, Opera, Webkit\n                        // TODO: identify versions\n                        // getElementById can match elements by name instead of ID\n                        if ( newContext && (elem = newContext.getElementById( m )) &&\n                            contains( context, elem ) &&\n                            elem.id === m ) {\n\n                            results.push( elem );\n                            return results;\n                        }\n                    }\n\n                // Type selector\n                } else if ( match[2] ) {\n                    push.apply( results, context.getElementsByTagName( selector ) );\n                    return results;\n\n                // Class selector\n                } else if ( (m = match[3]) && support.getElementsByClassName &&\n                    context.getElementsByClassName ) {\n\n                    push.apply( results, context.getElementsByClassName( m ) );\n                    return results;\n                }\n            }\n\n            // Take advantage of querySelectorAll\n            if ( support.qsa &&\n                !compilerCache[ selector + \" \" ] &&\n                (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\n                if ( nodeType !== 1 ) {\n                    newContext = context;\n                    newSelector = selector;\n\n                // qSA looks outside Element context, which is not what we want\n                // Thanks to Andrew Dupont for this workaround technique\n                // Support: IE <=8\n                // Exclude object elements\n                } else if ( context.nodeName.toLowerCase() !== \"object\" ) {\n\n                    // Capture the context ID, setting it first if necessary\n                    if ( (nid = context.getAttribute( \"id\" )) ) {\n                        nid = nid.replace( rcssescape, fcssescape );\n                    } else {\n                        context.setAttribute( \"id\", (nid = expando) );\n                    }\n\n                    // Prefix every selector in the list\n                    groups = tokenize( selector );\n                    i = groups.length;\n                    while ( i-- ) {\n                        groups[i] = \"#\" + nid + \" \" + toSelector( groups[i] );\n                    }\n                    newSelector = groups.join( \",\" );\n\n                    // Expand context for sibling selectors\n                    newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n                        context;\n                }\n\n                if ( newSelector ) {\n                    try {\n                        push.apply( results,\n                            newContext.querySelectorAll( newSelector )\n                        );\n                        return results;\n                    } catch ( qsaError ) {\n                    } finally {\n                        if ( nid === expando ) {\n                            context.removeAttribute( \"id\" );\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    // All others\n    return select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *  property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *  deleting the oldest entry\n */\nfunction createCache() {\n    var keys = [];\n\n    function cache( key, value ) {\n        // Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n        if ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n            // Only keep the most recent entries\n            delete cache[ keys.shift() ];\n        }\n        return (cache[ key + \" \" ] = value);\n    }\n    return cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n    fn[ expando ] = true;\n    return fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n    var el = document.createElement(\"fieldset\");\n\n    try {\n        return !!fn( el );\n    } catch (e) {\n        return false;\n    } finally {\n        // Remove from its parent by default\n        if ( el.parentNode ) {\n            el.parentNode.removeChild( el );\n        }\n        // release memory in IE\n        el = null;\n    }\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n    var arr = attrs.split(\"|\"),\n        i = arr.length;\n\n    while ( i-- ) {\n        Expr.attrHandle[ arr[i] ] = handler;\n    }\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n    var cur = b && a,\n        diff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n            a.sourceIndex - b.sourceIndex;\n\n    // Use IE sourceIndex if available on both nodes\n    if ( diff ) {\n        return diff;\n    }\n\n    // Check if b follows a\n    if ( cur ) {\n        while ( (cur = cur.nextSibling) ) {\n            if ( cur === b ) {\n                return -1;\n            }\n        }\n    }\n\n    return a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n    return function( elem ) {\n        var name = elem.nodeName.toLowerCase();\n        return name === \"input\" && elem.type === type;\n    };\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n    return function( elem ) {\n        var name = elem.nodeName.toLowerCase();\n        return (name === \"input\" || name === \"button\") && elem.type === type;\n    };\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n    // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n    return function( elem ) {\n\n        // Only certain elements can match :enabled or :disabled\n        // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n        // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n        if ( \"form\" in elem ) {\n\n            // Check for inherited disabledness on relevant non-disabled elements:\n            // * listed form-associated elements in a disabled fieldset\n            //   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n            //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n            // * option elements in a disabled optgroup\n            //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n            // All such elements have a \"form\" property.\n            if ( elem.parentNode && elem.disabled === false ) {\n\n                // Option elements defer to a parent optgroup if present\n                if ( \"label\" in elem ) {\n                    if ( \"label\" in elem.parentNode ) {\n                        return elem.parentNode.disabled === disabled;\n                    } else {\n                        return elem.disabled === disabled;\n                    }\n                }\n\n                // Support: IE 6 - 11\n                // Use the isDisabled shortcut property to check for disabled fieldset ancestors\n                return elem.isDisabled === disabled ||\n\n                    // Where there is no isDisabled, check manually\n                    /* jshint -W018 */\n                    elem.isDisabled !== !disabled &&\n                        disabledAncestor( elem ) === disabled;\n            }\n\n            return elem.disabled === disabled;\n\n        // Try to winnow out elements that can't be disabled before trusting the disabled property.\n        // Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n        // even exist on them, let alone have a boolean value.\n        } else if ( \"label\" in elem ) {\n            return elem.disabled === disabled;\n        }\n\n        // Remaining elements are neither :enabled nor :disabled\n        return false;\n    };\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n    return markFunction(function( argument ) {\n        argument = +argument;\n        return markFunction(function( seed, matches ) {\n            var j,\n                matchIndexes = fn( [], seed.length, argument ),\n                i = matchIndexes.length;\n\n            // Match elements found at the specified indexes\n            while ( i-- ) {\n                if ( seed[ (j = matchIndexes[i]) ] ) {\n                    seed[j] = !(matches[j] = seed[j]);\n                }\n            }\n        });\n    });\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n    return context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n    // documentElement is verified for cases where it doesn't yet exist\n    // (such as loading iframes in IE - #4833)\n    var documentElement = elem && (elem.ownerDocument || elem).documentElement;\n    return documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n    var hasCompare, subWindow,\n        doc = node ? node.ownerDocument || node : preferredDoc;\n\n    // Return early if doc is invalid or already selected\n    if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n        return document;\n    }\n\n    // Update global variables\n    document = doc;\n    docElem = document.documentElement;\n    documentIsHTML = !isXML( document );\n\n    // Support: IE 9-11, Edge\n    // Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n    if ( preferredDoc !== document &&\n        (subWindow = document.defaultView) && subWindow.top !== subWindow ) {\n\n        // Support: IE 11, Edge\n        if ( subWindow.addEventListener ) {\n            subWindow.addEventListener( \"unload\", unloadHandler, false );\n\n        // Support: IE 9 - 10 only\n        } else if ( subWindow.attachEvent ) {\n            subWindow.attachEvent( \"onunload\", unloadHandler );\n        }\n    }\n\n    /* Attributes\n    ---------------------------------------------------------------------- */\n\n    // Support: IE<8\n    // Verify that getAttribute really returns attributes and not properties\n    // (excepting IE8 booleans)\n    support.attributes = assert(function( el ) {\n        el.className = \"i\";\n        return !el.getAttribute(\"className\");\n    });\n\n    /* getElement(s)By*\n    ---------------------------------------------------------------------- */\n\n    // Check if getElementsByTagName(\"*\") returns only elements\n    support.getElementsByTagName = assert(function( el ) {\n        el.appendChild( document.createComment(\"\") );\n        return !el.getElementsByTagName(\"*\").length;\n    });\n\n    // Support: IE<9\n    support.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n    // Support: IE<10\n    // Check if getElementById returns elements by name\n    // The broken getElementById methods don't pick up programmatically-set names,\n    // so use a roundabout getElementsByName test\n    support.getById = assert(function( el ) {\n        docElem.appendChild( el ).id = expando;\n        return !document.getElementsByName || !document.getElementsByName( expando ).length;\n    });\n\n    // ID filter and find\n    if ( support.getById ) {\n        Expr.filter[\"ID\"] = function( id ) {\n            var attrId = id.replace( runescape, funescape );\n            return function( elem ) {\n                return elem.getAttribute(\"id\") === attrId;\n            };\n        };\n        Expr.find[\"ID\"] = function( id, context ) {\n            if ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n                var elem = context.getElementById( id );\n                return elem ? [ elem ] : [];\n            }\n        };\n    } else {\n        Expr.filter[\"ID\"] =  function( id ) {\n            var attrId = id.replace( runescape, funescape );\n            return function( elem ) {\n                var node = typeof elem.getAttributeNode !== \"undefined\" &&\n                    elem.getAttributeNode(\"id\");\n                return node && node.value === attrId;\n            };\n        };\n\n        // Support: IE 6 - 7 only\n        // getElementById is not reliable as a find shortcut\n        Expr.find[\"ID\"] = function( id, context ) {\n            if ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n                var node, i, elems,\n                    elem = context.getElementById( id );\n\n                if ( elem ) {\n\n                    // Verify the id attribute\n                    node = elem.getAttributeNode(\"id\");\n                    if ( node && node.value === id ) {\n                        return [ elem ];\n                    }\n\n                    // Fall back on getElementsByName\n                    elems = context.getElementsByName( id );\n                    i = 0;\n                    while ( (elem = elems[i++]) ) {\n                        node = elem.getAttributeNode(\"id\");\n                        if ( node && node.value === id ) {\n                            return [ elem ];\n                        }\n                    }\n                }\n\n                return [];\n            }\n        };\n    }\n\n    // Tag\n    Expr.find[\"TAG\"] = support.getElementsByTagName ?\n        function( tag, context ) {\n            if ( typeof context.getElementsByTagName !== \"undefined\" ) {\n                return context.getElementsByTagName( tag );\n\n            // DocumentFragment nodes don't have gEBTN\n            } else if ( support.qsa ) {\n                return context.querySelectorAll( tag );\n            }\n        } :\n\n        function( tag, context ) {\n            var elem,\n                tmp = [],\n                i = 0,\n                // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n                results = context.getElementsByTagName( tag );\n\n            // Filter out possible comments\n            if ( tag === \"*\" ) {\n                while ( (elem = results[i++]) ) {\n                    if ( elem.nodeType === 1 ) {\n                        tmp.push( elem );\n                    }\n                }\n\n                return tmp;\n            }\n            return results;\n        };\n\n    // Class\n    Expr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n        if ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n            return context.getElementsByClassName( className );\n        }\n    };\n\n    /* QSA/matchesSelector\n    ---------------------------------------------------------------------- */\n\n    // QSA and matchesSelector support\n\n    // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n    rbuggyMatches = [];\n\n    // qSa(:focus) reports false when true (Chrome 21)\n    // We allow this because of a bug in IE8/9 that throws an error\n    // whenever `document.activeElement` is accessed on an iframe\n    // So, we allow :focus to pass through QSA all the time to avoid the IE error\n    // See https://bugs.jquery.com/ticket/13378\n    rbuggyQSA = [];\n\n    if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {\n        // Build QSA regex\n        // Regex strategy adopted from Diego Perini\n        assert(function( el ) {\n            // Select is set to empty string on purpose\n            // This is to test IE's treatment of not explicitly\n            // setting a boolean content attribute,\n            // since its presence should be enough\n            // https://bugs.jquery.com/ticket/12359\n            docElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n                \"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n                \"<option selected=''></option></select>\";\n\n            // Support: IE8, Opera 11-12.16\n            // Nothing should be selected when empty strings follow ^= or $= or *=\n            // The test attribute must be unknown in Opera but \"safe\" for WinRT\n            // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n            if ( el.querySelectorAll(\"[msallowcapture^='']\").length ) {\n                rbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n            }\n\n            // Support: IE8\n            // Boolean attributes and \"value\" are not treated correctly\n            if ( !el.querySelectorAll(\"[selected]\").length ) {\n                rbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n            }\n\n            // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n            if ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n                rbuggyQSA.push(\"~=\");\n            }\n\n            // Webkit/Opera - :checked should return selected option elements\n            // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n            // IE8 throws error here and will not see later tests\n            if ( !el.querySelectorAll(\":checked\").length ) {\n                rbuggyQSA.push(\":checked\");\n            }\n\n            // Support: Safari 8+, iOS 8+\n            // https://bugs.webkit.org/show_bug.cgi?id=136851\n            // In-page `selector#id sibling-combinator selector` fails\n            if ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n                rbuggyQSA.push(\".#.+[+~]\");\n            }\n        });\n\n        assert(function( el ) {\n            el.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n                \"<select disabled='disabled'><option/></select>\";\n\n            // Support: Windows 8 Native Apps\n            // The type and name attributes are restricted during .innerHTML assignment\n            var input = document.createElement(\"input\");\n            input.setAttribute( \"type\", \"hidden\" );\n            el.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n            // Support: IE8\n            // Enforce case-sensitivity of name attribute\n            if ( el.querySelectorAll(\"[name=d]\").length ) {\n                rbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n            }\n\n            // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n            // IE8 throws error here and will not see later tests\n            if ( el.querySelectorAll(\":enabled\").length !== 2 ) {\n                rbuggyQSA.push( \":enabled\", \":disabled\" );\n            }\n\n            // Support: IE9-11+\n            // IE's :disabled selector does not pick up the children of disabled fieldsets\n            docElem.appendChild( el ).disabled = true;\n            if ( el.querySelectorAll(\":disabled\").length !== 2 ) {\n                rbuggyQSA.push( \":enabled\", \":disabled\" );\n            }\n\n            // Opera 10-11 does not throw on post-comma invalid pseudos\n            el.querySelectorAll(\"*,:x\");\n            rbuggyQSA.push(\",.*:\");\n        });\n    }\n\n    if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\n        docElem.webkitMatchesSelector ||\n        docElem.mozMatchesSelector ||\n        docElem.oMatchesSelector ||\n        docElem.msMatchesSelector) )) ) {\n\n        assert(function( el ) {\n            // Check to see if it's possible to do matchesSelector\n            // on a disconnected node (IE 9)\n            support.disconnectedMatch = matches.call( el, \"*\" );\n\n            // This should fail with an exception\n            // Gecko does not error, returns false instead\n            matches.call( el, \"[s!='']:x\" );\n            rbuggyMatches.push( \"!=\", pseudos );\n        });\n    }\n\n    rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n    rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n    /* Contains\n    ---------------------------------------------------------------------- */\n    hasCompare = rnative.test( docElem.compareDocumentPosition );\n\n    // Element contains another\n    // Purposefully self-exclusive\n    // As in, an element does not contain itself\n    contains = hasCompare || rnative.test( docElem.contains ) ?\n        function( a, b ) {\n            var adown = a.nodeType === 9 ? a.documentElement : a,\n                bup = b && b.parentNode;\n            return a === bup || !!( bup && bup.nodeType === 1 && (\n                adown.contains ?\n                    adown.contains( bup ) :\n                    a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n            ));\n        } :\n        function( a, b ) {\n            if ( b ) {\n                while ( (b = b.parentNode) ) {\n                    if ( b === a ) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        };\n\n    /* Sorting\n    ---------------------------------------------------------------------- */\n\n    // Document order sorting\n    sortOrder = hasCompare ?\n    function( a, b ) {\n\n        // Flag for duplicate removal\n        if ( a === b ) {\n            hasDuplicate = true;\n            return 0;\n        }\n\n        // Sort on method existence if only one input has compareDocumentPosition\n        var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n        if ( compare ) {\n            return compare;\n        }\n\n        // Calculate position if both inputs belong to the same document\n        compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n            a.compareDocumentPosition( b ) :\n\n            // Otherwise we know they are disconnected\n            1;\n\n        // Disconnected nodes\n        if ( compare & 1 ||\n            (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n            // Choose the first element that is related to our preferred document\n            if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n                return -1;\n            }\n            if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n                return 1;\n            }\n\n            // Maintain original order\n            return sortInput ?\n                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n                0;\n        }\n\n        return compare & 4 ? -1 : 1;\n    } :\n    function( a, b ) {\n        // Exit early if the nodes are identical\n        if ( a === b ) {\n            hasDuplicate = true;\n            return 0;\n        }\n\n        var cur,\n            i = 0,\n            aup = a.parentNode,\n            bup = b.parentNode,\n            ap = [ a ],\n            bp = [ b ];\n\n        // Parentless nodes are either documents or disconnected\n        if ( !aup || !bup ) {\n            return a === document ? -1 :\n                b === document ? 1 :\n                aup ? -1 :\n                bup ? 1 :\n                sortInput ?\n                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n                0;\n\n        // If the nodes are siblings, we can do a quick check\n        } else if ( aup === bup ) {\n            return siblingCheck( a, b );\n        }\n\n        // Otherwise we need full lists of their ancestors for comparison\n        cur = a;\n        while ( (cur = cur.parentNode) ) {\n            ap.unshift( cur );\n        }\n        cur = b;\n        while ( (cur = cur.parentNode) ) {\n            bp.unshift( cur );\n        }\n\n        // Walk down the tree looking for a discrepancy\n        while ( ap[i] === bp[i] ) {\n            i++;\n        }\n\n        return i ?\n            // Do a sibling check if the nodes have a common ancestor\n            siblingCheck( ap[i], bp[i] ) :\n\n            // Otherwise nodes in our document sort first\n            ap[i] === preferredDoc ? -1 :\n            bp[i] === preferredDoc ? 1 :\n            0;\n    };\n\n    return document;\n};\n\nSizzle.matches = function( expr, elements ) {\n    return Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n    // Set document vars if needed\n    if ( ( elem.ownerDocument || elem ) !== document ) {\n        setDocument( elem );\n    }\n\n    // Make sure that attribute selectors are quoted\n    expr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n    if ( support.matchesSelector && documentIsHTML &&\n        !compilerCache[ expr + \" \" ] &&\n        ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n        ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n        try {\n            var ret = matches.call( elem, expr );\n\n            // IE 9's matchesSelector returns false on disconnected nodes\n            if ( ret || support.disconnectedMatch ||\n                    // As well, disconnected nodes are said to be in a document\n                    // fragment in IE 9\n                    elem.document && elem.document.nodeType !== 11 ) {\n                return ret;\n            }\n        } catch (e) {}\n    }\n\n    return Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n    // Set document vars if needed\n    if ( ( context.ownerDocument || context ) !== document ) {\n        setDocument( context );\n    }\n    return contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n    // Set document vars if needed\n    if ( ( elem.ownerDocument || elem ) !== document ) {\n        setDocument( elem );\n    }\n\n    var fn = Expr.attrHandle[ name.toLowerCase() ],\n        // Don't get fooled by Object.prototype properties (jQuery #13807)\n        val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n            fn( elem, name, !documentIsHTML ) :\n            undefined;\n\n    return val !== undefined ?\n        val :\n        support.attributes || !documentIsHTML ?\n            elem.getAttribute( name ) :\n            (val = elem.getAttributeNode(name)) && val.specified ?\n                val.value :\n                null;\n};\n\nSizzle.escape = function( sel ) {\n    return (sel + \"\").replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n    throw new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n    var elem,\n        duplicates = [],\n        j = 0,\n        i = 0;\n\n    // Unless we *know* we can detect duplicates, assume their presence\n    hasDuplicate = !support.detectDuplicates;\n    sortInput = !support.sortStable && results.slice( 0 );\n    results.sort( sortOrder );\n\n    if ( hasDuplicate ) {\n        while ( (elem = results[i++]) ) {\n            if ( elem === results[ i ] ) {\n                j = duplicates.push( i );\n            }\n        }\n        while ( j-- ) {\n            results.splice( duplicates[ j ], 1 );\n        }\n    }\n\n    // Clear input after sorting to release objects\n    // See https://github.com/jquery/sizzle/pull/225\n    sortInput = null;\n\n    return results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n    var node,\n        ret = \"\",\n        i = 0,\n        nodeType = elem.nodeType;\n\n    if ( !nodeType ) {\n        // If no nodeType, this is expected to be an array\n        while ( (node = elem[i++]) ) {\n            // Do not traverse comment nodes\n            ret += getText( node );\n        }\n    } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n        // Use textContent for elements\n        // innerText usage removed for consistency of new lines (jQuery #11153)\n        if ( typeof elem.textContent === \"string\" ) {\n            return elem.textContent;\n        } else {\n            // Traverse its children\n            for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n                ret += getText( elem );\n            }\n        }\n    } else if ( nodeType === 3 || nodeType === 4 ) {\n        return elem.nodeValue;\n    }\n    // Do not include comment or processing instruction nodes\n\n    return ret;\n};\n\nExpr = Sizzle.selectors = {\n\n    // Can be adjusted by the user\n    cacheLength: 50,\n\n    createPseudo: markFunction,\n\n    match: matchExpr,\n\n    attrHandle: {},\n\n    find: {},\n\n    relative: {\n        \">\": { dir: \"parentNode\", first: true },\n        \" \": { dir: \"parentNode\" },\n        \"+\": { dir: \"previousSibling\", first: true },\n        \"~\": { dir: \"previousSibling\" }\n    },\n\n    preFilter: {\n        \"ATTR\": function( match ) {\n            match[1] = match[1].replace( runescape, funescape );\n\n            // Move the given value to match[3] whether quoted or unquoted\n            match[3] = ( match[3] || match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n            if ( match[2] === \"~=\" ) {\n                match[3] = \" \" + match[3] + \" \";\n            }\n\n            return match.slice( 0, 4 );\n        },\n\n        \"CHILD\": function( match ) {\n            /* matches from matchExpr[\"CHILD\"]\n                1 type (only|nth|...)\n                2 what (child|of-type)\n                3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n                4 xn-component of xn+y argument ([+-]?\\d*n|)\n                5 sign of xn-component\n                6 x of xn-component\n                7 sign of y-component\n                8 y of y-component\n            */\n            match[1] = match[1].toLowerCase();\n\n            if ( match[1].slice( 0, 3 ) === \"nth\" ) {\n                // nth-* requires argument\n                if ( !match[3] ) {\n                    Sizzle.error( match[0] );\n                }\n\n                // numeric x and y parameters for Expr.filter.CHILD\n                // remember that false/true cast respectively to 0/1\n                match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n                match[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n            // other types prohibit arguments\n            } else if ( match[3] ) {\n                Sizzle.error( match[0] );\n            }\n\n            return match;\n        },\n\n        \"PSEUDO\": function( match ) {\n            var excess,\n                unquoted = !match[6] && match[2];\n\n            if ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n                return null;\n            }\n\n            // Accept quoted arguments as-is\n            if ( match[3] ) {\n                match[2] = match[4] || match[5] || \"\";\n\n            // Strip excess characters from unquoted arguments\n            } else if ( unquoted && rpseudo.test( unquoted ) &&\n                // Get excess from tokenize (recursively)\n                (excess = tokenize( unquoted, true )) &&\n                // advance to the next closing parenthesis\n                (excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n                // excess is a negative index\n                match[0] = match[0].slice( 0, excess );\n                match[2] = unquoted.slice( 0, excess );\n            }\n\n            // Return only captures needed by the pseudo filter method (type and argument)\n            return match.slice( 0, 3 );\n        }\n    },\n\n    filter: {\n\n        \"TAG\": function( nodeNameSelector ) {\n            var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n            return nodeNameSelector === \"*\" ?\n                function() { return true; } :\n                function( elem ) {\n                    return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n                };\n        },\n\n        \"CLASS\": function( className ) {\n            var pattern = classCache[ className + \" \" ];\n\n            return pattern ||\n                (pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n                classCache( className, function( elem ) {\n                    return pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\" );\n                });\n        },\n\n        \"ATTR\": function( name, operator, check ) {\n            return function( elem ) {\n                var result = Sizzle.attr( elem, name );\n\n                if ( result == null ) {\n                    return operator === \"!=\";\n                }\n                if ( !operator ) {\n                    return true;\n                }\n\n                result += \"\";\n\n                return operator === \"=\" ? result === check :\n                    operator === \"!=\" ? result !== check :\n                    operator === \"^=\" ? check && result.indexOf( check ) === 0 :\n                    operator === \"*=\" ? check && result.indexOf( check ) > -1 :\n                    operator === \"$=\" ? check && result.slice( -check.length ) === check :\n                    operator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n                    operator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n                    false;\n            };\n        },\n\n        \"CHILD\": function( type, what, argument, first, last ) {\n            var simple = type.slice( 0, 3 ) !== \"nth\",\n                forward = type.slice( -4 ) !== \"last\",\n                ofType = what === \"of-type\";\n\n            return first === 1 && last === 0 ?\n\n                // Shortcut for :nth-*(n)\n                function( elem ) {\n                    return !!elem.parentNode;\n                } :\n\n                function( elem, context, xml ) {\n                    var cache, uniqueCache, outerCache, node, nodeIndex, start,\n                        dir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n                        parent = elem.parentNode,\n                        name = ofType && elem.nodeName.toLowerCase(),\n                        useCache = !xml && !ofType,\n                        diff = false;\n\n                    if ( parent ) {\n\n                        // :(first|last|only)-(child|of-type)\n                        if ( simple ) {\n                            while ( dir ) {\n                                node = elem;\n                                while ( (node = node[ dir ]) ) {\n                                    if ( ofType ?\n                                        node.nodeName.toLowerCase() === name :\n                                        node.nodeType === 1 ) {\n\n                                        return false;\n                                    }\n                                }\n                                // Reverse direction for :only-* (if we haven't yet done so)\n                                start = dir = type === \"only\" && !start && \"nextSibling\";\n                            }\n                            return true;\n                        }\n\n                        start = [ forward ? parent.firstChild : parent.lastChild ];\n\n                        // non-xml :nth-child(...) stores cache data on `parent`\n                        if ( forward && useCache ) {\n\n                            // Seek `elem` from a previously-cached index\n\n                            // ...in a gzip-friendly way\n                            node = parent;\n                            outerCache = node[ expando ] || (node[ expando ] = {});\n\n                            // Support: IE <9 only\n                            // Defend against cloned attroperties (jQuery gh-1709)\n                            uniqueCache = outerCache[ node.uniqueID ] ||\n                                (outerCache[ node.uniqueID ] = {});\n\n                            cache = uniqueCache[ type ] || [];\n                            nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n                            diff = nodeIndex && cache[ 2 ];\n                            node = nodeIndex && parent.childNodes[ nodeIndex ];\n\n                            while ( (node = ++nodeIndex && node && node[ dir ] ||\n\n                                // Fallback to seeking `elem` from the start\n                                (diff = nodeIndex = 0) || start.pop()) ) {\n\n                                // When found, cache indexes on `parent` and break\n                                if ( node.nodeType === 1 && ++diff && node === elem ) {\n                                    uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n                                    break;\n                                }\n                            }\n\n                        } else {\n                            // Use previously-cached element index if available\n                            if ( useCache ) {\n                                // ...in a gzip-friendly way\n                                node = elem;\n                                outerCache = node[ expando ] || (node[ expando ] = {});\n\n                                // Support: IE <9 only\n                                // Defend against cloned attroperties (jQuery gh-1709)\n                                uniqueCache = outerCache[ node.uniqueID ] ||\n                                    (outerCache[ node.uniqueID ] = {});\n\n                                cache = uniqueCache[ type ] || [];\n                                nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n                                diff = nodeIndex;\n                            }\n\n                            // xml :nth-child(...)\n                            // or :nth-last-child(...) or :nth(-last)?-of-type(...)\n                            if ( diff === false ) {\n                                // Use the same loop as above to seek `elem` from the start\n                                while ( (node = ++nodeIndex && node && node[ dir ] ||\n                                    (diff = nodeIndex = 0) || start.pop()) ) {\n\n                                    if ( ( ofType ?\n                                        node.nodeName.toLowerCase() === name :\n                                        node.nodeType === 1 ) &&\n                                        ++diff ) {\n\n                                        // Cache the index of each encountered element\n                                        if ( useCache ) {\n                                            outerCache = node[ expando ] || (node[ expando ] = {});\n\n                                            // Support: IE <9 only\n                                            // Defend against cloned attroperties (jQuery gh-1709)\n                                            uniqueCache = outerCache[ node.uniqueID ] ||\n                                                (outerCache[ node.uniqueID ] = {});\n\n                                            uniqueCache[ type ] = [ dirruns, diff ];\n                                        }\n\n                                        if ( node === elem ) {\n                                            break;\n                                        }\n                                    }\n                                }\n                            }\n                        }\n\n                        // Incorporate the offset, then check against cycle size\n                        diff -= last;\n                        return diff === first || ( diff % first === 0 && diff / first >= 0 );\n                    }\n                };\n        },\n\n        \"PSEUDO\": function( pseudo, argument ) {\n            // pseudo-class names are case-insensitive\n            // http://www.w3.org/TR/selectors/#pseudo-classes\n            // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n            // Remember that setFilters inherits from pseudos\n            var args,\n                fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n                    Sizzle.error( \"unsupported pseudo: \" + pseudo );\n\n            // The user may use createPseudo to indicate that\n            // arguments are needed to create the filter function\n            // just as Sizzle does\n            if ( fn[ expando ] ) {\n                return fn( argument );\n            }\n\n            // But maintain support for old signatures\n            if ( fn.length > 1 ) {\n                args = [ pseudo, pseudo, \"\", argument ];\n                return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n                    markFunction(function( seed, matches ) {\n                        var idx,\n                            matched = fn( seed, argument ),\n                            i = matched.length;\n                        while ( i-- ) {\n                            idx = indexOf( seed, matched[i] );\n                            seed[ idx ] = !( matches[ idx ] = matched[i] );\n                        }\n                    }) :\n                    function( elem ) {\n                        return fn( elem, 0, args );\n                    };\n            }\n\n            return fn;\n        }\n    },\n\n    pseudos: {\n        // Potentially complex pseudos\n        \"not\": markFunction(function( selector ) {\n            // Trim the selector passed to compile\n            // to avoid treating leading and trailing\n            // spaces as combinators\n            var input = [],\n                results = [],\n                matcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n            return matcher[ expando ] ?\n                markFunction(function( seed, matches, context, xml ) {\n                    var elem,\n                        unmatched = matcher( seed, null, xml, [] ),\n                        i = seed.length;\n\n                    // Match elements unmatched by `matcher`\n                    while ( i-- ) {\n                        if ( (elem = unmatched[i]) ) {\n                            seed[i] = !(matches[i] = elem);\n                        }\n                    }\n                }) :\n                function( elem, context, xml ) {\n                    input[0] = elem;\n                    matcher( input, null, xml, results );\n                    // Don't keep the element (issue #299)\n                    input[0] = null;\n                    return !results.pop();\n                };\n        }),\n\n        \"has\": markFunction(function( selector ) {\n            return function( elem ) {\n                return Sizzle( selector, elem ).length > 0;\n            };\n        }),\n\n        \"contains\": markFunction(function( text ) {\n            text = text.replace( runescape, funescape );\n            return function( elem ) {\n                return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n            };\n        }),\n\n        // \"Whether an element is represented by a :lang() selector\n        // is based solely on the element's language value\n        // being equal to the identifier C,\n        // or beginning with the identifier C immediately followed by \"-\".\n        // The matching of C against the element's language value is performed case-insensitively.\n        // The identifier C does not have to be a valid language name.\"\n        // http://www.w3.org/TR/selectors/#lang-pseudo\n        \"lang\": markFunction( function( lang ) {\n            // lang value must be a valid identifier\n            if ( !ridentifier.test(lang || \"\") ) {\n                Sizzle.error( \"unsupported lang: \" + lang );\n            }\n            lang = lang.replace( runescape, funescape ).toLowerCase();\n            return function( elem ) {\n                var elemLang;\n                do {\n                    if ( (elemLang = documentIsHTML ?\n                        elem.lang :\n                        elem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n                        elemLang = elemLang.toLowerCase();\n                        return elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n                    }\n                } while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n                return false;\n            };\n        }),\n\n        // Miscellaneous\n        \"target\": function( elem ) {\n            var hash = window.location && window.location.hash;\n            return hash && hash.slice( 1 ) === elem.id;\n        },\n\n        \"root\": function( elem ) {\n            return elem === docElem;\n        },\n\n        \"focus\": function( elem ) {\n            return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n        },\n\n        // Boolean properties\n        \"enabled\": createDisabledPseudo( false ),\n        \"disabled\": createDisabledPseudo( true ),\n\n        \"checked\": function( elem ) {\n            // In CSS3, :checked should return both checked and selected elements\n            // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n            var nodeName = elem.nodeName.toLowerCase();\n            return (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n        },\n\n        \"selected\": function( elem ) {\n            // Accessing this property makes selected-by-default\n            // options in Safari work properly\n            if ( elem.parentNode ) {\n                elem.parentNode.selectedIndex;\n            }\n\n            return elem.selected === true;\n        },\n\n        // Contents\n        \"empty\": function( elem ) {\n            // http://www.w3.org/TR/selectors/#empty-pseudo\n            // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n            //   but not by others (comment: 8; processing instruction: 7; etc.)\n            // nodeType < 6 works because attributes (2) do not appear as children\n            for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n                if ( elem.nodeType < 6 ) {\n                    return false;\n                }\n            }\n            return true;\n        },\n\n        \"parent\": function( elem ) {\n            return !Expr.pseudos[\"empty\"]( elem );\n        },\n\n        // Element/input types\n        \"header\": function( elem ) {\n            return rheader.test( elem.nodeName );\n        },\n\n        \"input\": function( elem ) {\n            return rinputs.test( elem.nodeName );\n        },\n\n        \"button\": function( elem ) {\n            var name = elem.nodeName.toLowerCase();\n            return name === \"input\" && elem.type === \"button\" || name === \"button\";\n        },\n\n        \"text\": function( elem ) {\n            var attr;\n            return elem.nodeName.toLowerCase() === \"input\" &&\n                elem.type === \"text\" &&\n\n                // Support: IE<8\n                // New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n                ( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\n        },\n\n        // Position-in-collection\n        \"first\": createPositionalPseudo(function() {\n            return [ 0 ];\n        }),\n\n        \"last\": createPositionalPseudo(function( matchIndexes, length ) {\n            return [ length - 1 ];\n        }),\n\n        \"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n            return [ argument < 0 ? argument + length : argument ];\n        }),\n\n        \"even\": createPositionalPseudo(function( matchIndexes, length ) {\n            var i = 0;\n            for ( ; i < length; i += 2 ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        }),\n\n        \"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n            var i = 1;\n            for ( ; i < length; i += 2 ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        }),\n\n        \"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n            var i = argument < 0 ? argument + length : argument;\n            for ( ; --i >= 0; ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        }),\n\n        \"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n            var i = argument < 0 ? argument + length : argument;\n            for ( ; ++i < length; ) {\n                matchIndexes.push( i );\n            }\n            return matchIndexes;\n        })\n    }\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n    Expr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n    Expr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n    var matched, match, tokens, type,\n        soFar, groups, preFilters,\n        cached = tokenCache[ selector + \" \" ];\n\n    if ( cached ) {\n        return parseOnly ? 0 : cached.slice( 0 );\n    }\n\n    soFar = selector;\n    groups = [];\n    preFilters = Expr.preFilter;\n\n    while ( soFar ) {\n\n        // Comma and first run\n        if ( !matched || (match = rcomma.exec( soFar )) ) {\n            if ( match ) {\n                // Don't consume trailing commas as valid\n                soFar = soFar.slice( match[0].length ) || soFar;\n            }\n            groups.push( (tokens = []) );\n        }\n\n        matched = false;\n\n        // Combinators\n        if ( (match = rcombinators.exec( soFar )) ) {\n            matched = match.shift();\n            tokens.push({\n                value: matched,\n                // Cast descendant combinators to space\n                type: match[0].replace( rtrim, \" \" )\n            });\n            soFar = soFar.slice( matched.length );\n        }\n\n        // Filters\n        for ( type in Expr.filter ) {\n            if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n                (match = preFilters[ type ]( match ))) ) {\n                matched = match.shift();\n                tokens.push({\n                    value: matched,\n                    type: type,\n                    matches: match\n                });\n                soFar = soFar.slice( matched.length );\n            }\n        }\n\n        if ( !matched ) {\n            break;\n        }\n    }\n\n    // Return the length of the invalid excess\n    // if we're just parsing\n    // Otherwise, throw an error or return tokens\n    return parseOnly ?\n        soFar.length :\n        soFar ?\n            Sizzle.error( selector ) :\n            // Cache the tokens\n            tokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n    var i = 0,\n        len = tokens.length,\n        selector = \"\";\n    for ( ; i < len; i++ ) {\n        selector += tokens[i].value;\n    }\n    return selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n    var dir = combinator.dir,\n        skip = combinator.next,\n        key = skip || dir,\n        checkNonElements = base && key === \"parentNode\",\n        doneName = done++;\n\n    return combinator.first ?\n        // Check against closest ancestor/preceding element\n        function( elem, context, xml ) {\n            while ( (elem = elem[ dir ]) ) {\n                if ( elem.nodeType === 1 || checkNonElements ) {\n                    return matcher( elem, context, xml );\n                }\n            }\n            return false;\n        } :\n\n        // Check against all ancestor/preceding elements\n        function( elem, context, xml ) {\n            var oldCache, uniqueCache, outerCache,\n                newCache = [ dirruns, doneName ];\n\n            // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n            if ( xml ) {\n                while ( (elem = elem[ dir ]) ) {\n                    if ( elem.nodeType === 1 || checkNonElements ) {\n                        if ( matcher( elem, context, xml ) ) {\n                            return true;\n                        }\n                    }\n                }\n            } else {\n                while ( (elem = elem[ dir ]) ) {\n                    if ( elem.nodeType === 1 || checkNonElements ) {\n                        outerCache = elem[ expando ] || (elem[ expando ] = {});\n\n                        // Support: IE <9 only\n                        // Defend against cloned attroperties (jQuery gh-1709)\n                        uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});\n\n                        if ( skip && skip === elem.nodeName.toLowerCase() ) {\n                            elem = elem[ dir ] || elem;\n                        } else if ( (oldCache = uniqueCache[ key ]) &&\n                            oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n                            // Assign to newCache so results back-propagate to previous elements\n                            return (newCache[ 2 ] = oldCache[ 2 ]);\n                        } else {\n                            // Reuse newcache so results back-propagate to previous elements\n                            uniqueCache[ key ] = newCache;\n\n                            // A match means we're done; a fail means we have to keep checking\n                            if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n            return false;\n        };\n}\n\nfunction elementMatcher( matchers ) {\n    return matchers.length > 1 ?\n        function( elem, context, xml ) {\n            var i = matchers.length;\n            while ( i-- ) {\n                if ( !matchers[i]( elem, context, xml ) ) {\n                    return false;\n                }\n            }\n            return true;\n        } :\n        matchers[0];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n    var i = 0,\n        len = contexts.length;\n    for ( ; i < len; i++ ) {\n        Sizzle( selector, contexts[i], results );\n    }\n    return results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n    var elem,\n        newUnmatched = [],\n        i = 0,\n        len = unmatched.length,\n        mapped = map != null;\n\n    for ( ; i < len; i++ ) {\n        if ( (elem = unmatched[i]) ) {\n            if ( !filter || filter( elem, context, xml ) ) {\n                newUnmatched.push( elem );\n                if ( mapped ) {\n                    map.push( i );\n                }\n            }\n        }\n    }\n\n    return newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n    if ( postFilter && !postFilter[ expando ] ) {\n        postFilter = setMatcher( postFilter );\n    }\n    if ( postFinder && !postFinder[ expando ] ) {\n        postFinder = setMatcher( postFinder, postSelector );\n    }\n    return markFunction(function( seed, results, context, xml ) {\n        var temp, i, elem,\n            preMap = [],\n            postMap = [],\n            preexisting = results.length,\n\n            // Get initial elements from seed or context\n            elems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n            // Prefilter to get matcher input, preserving a map for seed-results synchronization\n            matcherIn = preFilter && ( seed || !selector ) ?\n                condense( elems, preMap, preFilter, context, xml ) :\n                elems,\n\n            matcherOut = matcher ?\n                // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n                postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n                    // ...intermediate processing is necessary\n                    [] :\n\n                    // ...otherwise use results directly\n                    results :\n                matcherIn;\n\n        // Find primary matches\n        if ( matcher ) {\n            matcher( matcherIn, matcherOut, context, xml );\n        }\n\n        // Apply postFilter\n        if ( postFilter ) {\n            temp = condense( matcherOut, postMap );\n            postFilter( temp, [], context, xml );\n\n            // Un-match failing elements by moving them back to matcherIn\n            i = temp.length;\n            while ( i-- ) {\n                if ( (elem = temp[i]) ) {\n                    matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n                }\n            }\n        }\n\n        if ( seed ) {\n            if ( postFinder || preFilter ) {\n                if ( postFinder ) {\n                    // Get the final matcherOut by condensing this intermediate into postFinder contexts\n                    temp = [];\n                    i = matcherOut.length;\n                    while ( i-- ) {\n                        if ( (elem = matcherOut[i]) ) {\n                            // Restore matcherIn since elem is not yet a final match\n                            temp.push( (matcherIn[i] = elem) );\n                        }\n                    }\n                    postFinder( null, (matcherOut = []), temp, xml );\n                }\n\n                // Move matched elements from seed to results to keep them synchronized\n                i = matcherOut.length;\n                while ( i-- ) {\n                    if ( (elem = matcherOut[i]) &&\n                        (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\n\n                        seed[temp] = !(results[temp] = elem);\n                    }\n                }\n            }\n\n        // Add elements to results, through postFinder if defined\n        } else {\n            matcherOut = condense(\n                matcherOut === results ?\n                    matcherOut.splice( preexisting, matcherOut.length ) :\n                    matcherOut\n            );\n            if ( postFinder ) {\n                postFinder( null, results, matcherOut, xml );\n            } else {\n                push.apply( results, matcherOut );\n            }\n        }\n    });\n}\n\nfunction matcherFromTokens( tokens ) {\n    var checkContext, matcher, j,\n        len = tokens.length,\n        leadingRelative = Expr.relative[ tokens[0].type ],\n        implicitRelative = leadingRelative || Expr.relative[\" \"],\n        i = leadingRelative ? 1 : 0,\n\n        // The foundational matcher ensures that elements are reachable from top-level context(s)\n        matchContext = addCombinator( function( elem ) {\n            return elem === checkContext;\n        }, implicitRelative, true ),\n        matchAnyContext = addCombinator( function( elem ) {\n            return indexOf( checkContext, elem ) > -1;\n        }, implicitRelative, true ),\n        matchers = [ function( elem, context, xml ) {\n            var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n                (checkContext = context).nodeType ?\n                    matchContext( elem, context, xml ) :\n                    matchAnyContext( elem, context, xml ) );\n            // Avoid hanging onto element (issue #299)\n            checkContext = null;\n            return ret;\n        } ];\n\n    for ( ; i < len; i++ ) {\n        if ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n            matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n        } else {\n            matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n            // Return special upon seeing a positional matcher\n            if ( matcher[ expando ] ) {\n                // Find the next relative operator (if any) for proper handling\n                j = ++i;\n                for ( ; j < len; j++ ) {\n                    if ( Expr.relative[ tokens[j].type ] ) {\n                        break;\n                    }\n                }\n                return setMatcher(\n                    i > 1 && elementMatcher( matchers ),\n                    i > 1 && toSelector(\n                        // If the preceding token was a descendant combinator, insert an implicit any-element `*`\n                        tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n                    ).replace( rtrim, \"$1\" ),\n                    matcher,\n                    i < j && matcherFromTokens( tokens.slice( i, j ) ),\n                    j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n                    j < len && toSelector( tokens )\n                );\n            }\n            matchers.push( matcher );\n        }\n    }\n\n    return elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n    var bySet = setMatchers.length > 0,\n        byElement = elementMatchers.length > 0,\n        superMatcher = function( seed, context, xml, results, outermost ) {\n            var elem, j, matcher,\n                matchedCount = 0,\n                i = \"0\",\n                unmatched = seed && [],\n                setMatched = [],\n                contextBackup = outermostContext,\n                // We must always have either seed elements or outermost context\n                elems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\n                // Use integer dirruns iff this is the outermost matcher\n                dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\n                len = elems.length;\n\n            if ( outermost ) {\n                outermostContext = context === document || context || outermost;\n            }\n\n            // Add elements passing elementMatchers directly to results\n            // Support: IE<9, Safari\n            // Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n            for ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n                if ( byElement && elem ) {\n                    j = 0;\n                    if ( !context && elem.ownerDocument !== document ) {\n                        setDocument( elem );\n                        xml = !documentIsHTML;\n                    }\n                    while ( (matcher = elementMatchers[j++]) ) {\n                        if ( matcher( elem, context || document, xml) ) {\n                            results.push( elem );\n                            break;\n                        }\n                    }\n                    if ( outermost ) {\n                        dirruns = dirrunsUnique;\n                    }\n                }\n\n                // Track unmatched elements for set filters\n                if ( bySet ) {\n                    // They will have gone through all possible matchers\n                    if ( (elem = !matcher && elem) ) {\n                        matchedCount--;\n                    }\n\n                    // Lengthen the array for every element, matched or not\n                    if ( seed ) {\n                        unmatched.push( elem );\n                    }\n                }\n            }\n\n            // `i` is now the count of elements visited above, and adding it to `matchedCount`\n            // makes the latter nonnegative.\n            matchedCount += i;\n\n            // Apply set filters to unmatched elements\n            // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n            // equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n            // no element matchers and no seed.\n            // Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n            // case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n            // numerically zero.\n            if ( bySet && i !== matchedCount ) {\n                j = 0;\n                while ( (matcher = setMatchers[j++]) ) {\n                    matcher( unmatched, setMatched, context, xml );\n                }\n\n                if ( seed ) {\n                    // Reintegrate element matches to eliminate the need for sorting\n                    if ( matchedCount > 0 ) {\n                        while ( i-- ) {\n                            if ( !(unmatched[i] || setMatched[i]) ) {\n                                setMatched[i] = pop.call( results );\n                            }\n                        }\n                    }\n\n                    // Discard index placeholder values to get only actual matches\n                    setMatched = condense( setMatched );\n                }\n\n                // Add matches to results\n                push.apply( results, setMatched );\n\n                // Seedless set matches succeeding multiple successful matchers stipulate sorting\n                if ( outermost && !seed && setMatched.length > 0 &&\n                    ( matchedCount + setMatchers.length ) > 1 ) {\n\n                    Sizzle.uniqueSort( results );\n                }\n            }\n\n            // Override manipulation of globals by nested matchers\n            if ( outermost ) {\n                dirruns = dirrunsUnique;\n                outermostContext = contextBackup;\n            }\n\n            return unmatched;\n        };\n\n    return bySet ?\n        markFunction( superMatcher ) :\n        superMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n    var i,\n        setMatchers = [],\n        elementMatchers = [],\n        cached = compilerCache[ selector + \" \" ];\n\n    if ( !cached ) {\n        // Generate a function of recursive functions that can be used to check each element\n        if ( !match ) {\n            match = tokenize( selector );\n        }\n        i = match.length;\n        while ( i-- ) {\n            cached = matcherFromTokens( match[i] );\n            if ( cached[ expando ] ) {\n                setMatchers.push( cached );\n            } else {\n                elementMatchers.push( cached );\n            }\n        }\n\n        // Cache the compiled function\n        cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n        // Save selector and tokenization\n        cached.selector = selector;\n    }\n    return cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n    var i, tokens, token, type, find,\n        compiled = typeof selector === \"function\" && selector,\n        match = !seed && tokenize( (selector = compiled.selector || selector) );\n\n    results = results || [];\n\n    // Try to minimize operations if there is only one selector in the list and no seed\n    // (the latter of which guarantees us context)\n    if ( match.length === 1 ) {\n\n        // Reduce context if the leading compound selector is an ID\n        tokens = match[0] = match[0].slice( 0 );\n        if ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n                context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {\n\n            context = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n            if ( !context ) {\n                return results;\n\n            // Precompiled matchers will still verify ancestry, so step up a level\n            } else if ( compiled ) {\n                context = context.parentNode;\n            }\n\n            selector = selector.slice( tokens.shift().value.length );\n        }\n\n        // Fetch a seed set for right-to-left matching\n        i = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n        while ( i-- ) {\n            token = tokens[i];\n\n            // Abort if we hit a combinator\n            if ( Expr.relative[ (type = token.type) ] ) {\n                break;\n            }\n            if ( (find = Expr.find[ type ]) ) {\n                // Search, expanding context for leading sibling combinators\n                if ( (seed = find(\n                    token.matches[0].replace( runescape, funescape ),\n                    rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n                )) ) {\n\n                    // If seed is empty or no tokens remain, we can return early\n                    tokens.splice( i, 1 );\n                    selector = seed.length && toSelector( tokens );\n                    if ( !selector ) {\n                        push.apply( results, seed );\n                        return results;\n                    }\n\n                    break;\n                }\n            }\n        }\n    }\n\n    // Compile and execute a filtering function if one is not provided\n    // Provide `match` to avoid retokenization if we modified the selector above\n    ( compiled || compile( selector, match ) )(\n        seed,\n        context,\n        !documentIsHTML,\n        results,\n        !context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n    );\n    return results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( el ) {\n    // Should return 1, but returns 4 (following)\n    return el.compareDocumentPosition( document.createElement(\"fieldset\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( el ) {\n    el.innerHTML = \"<a href='#'></a>\";\n    return el.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n    addHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n        if ( !isXML ) {\n            return elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n        }\n    });\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( el ) {\n    el.innerHTML = \"<input/>\";\n    el.firstChild.setAttribute( \"value\", \"\" );\n    return el.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n    addHandle( \"value\", function( elem, name, isXML ) {\n        if ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n            return elem.defaultValue;\n        }\n    });\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( el ) {\n    return el.getAttribute(\"disabled\") == null;\n}) ) {\n    addHandle( booleans, function( elem, name, isXML ) {\n        var val;\n        if ( !isXML ) {\n            return elem[ name ] === true ? name.toLowerCase() :\n                    (val = elem.getAttributeNode( name )) && val.specified ?\n                    val.value :\n                null;\n        }\n    });\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n    var matched = [],\n        truncate = until !== undefined;\n\n    while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n        if ( elem.nodeType === 1 ) {\n            if ( truncate && jQuery( elem ).is( until ) ) {\n                break;\n            }\n            matched.push( elem );\n        }\n    }\n    return matched;\n};\n\n\nvar siblings = function( n, elem ) {\n    var matched = [];\n\n    for ( ; n; n = n.nextSibling ) {\n        if ( n.nodeType === 1 && n !== elem ) {\n            matched.push( n );\n        }\n    }\n\n    return matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\nvar risSimple = /^.[^:#\\[\\.,]*$/;\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n    if ( jQuery.isFunction( qualifier ) ) {\n        return jQuery.grep( elements, function( elem, i ) {\n            return !!qualifier.call( elem, i, elem ) !== not;\n        } );\n    }\n\n    // Single element\n    if ( qualifier.nodeType ) {\n        return jQuery.grep( elements, function( elem ) {\n            return ( elem === qualifier ) !== not;\n        } );\n    }\n\n    // Arraylike of elements (jQuery, arguments, Array)\n    if ( typeof qualifier !== \"string\" ) {\n        return jQuery.grep( elements, function( elem ) {\n            return ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n        } );\n    }\n\n    // Simple selector that can be filtered directly, removing non-Elements\n    if ( risSimple.test( qualifier ) ) {\n        return jQuery.filter( qualifier, elements, not );\n    }\n\n    // Complex selector, compare the two sets, removing non-Elements\n    qualifier = jQuery.filter( qualifier, elements );\n    return jQuery.grep( elements, function( elem ) {\n        return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;\n    } );\n}\n\njQuery.filter = function( expr, elems, not ) {\n    var elem = elems[ 0 ];\n\n    if ( not ) {\n        expr = \":not(\" + expr + \")\";\n    }\n\n    if ( elems.length === 1 && elem.nodeType === 1 ) {\n        return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n    }\n\n    return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n        return elem.nodeType === 1;\n    } ) );\n};\n\njQuery.fn.extend( {\n    find: function( selector ) {\n        var i, ret,\n            len = this.length,\n            self = this;\n\n        if ( typeof selector !== \"string\" ) {\n            return this.pushStack( jQuery( selector ).filter( function() {\n                for ( i = 0; i < len; i++ ) {\n                    if ( jQuery.contains( self[ i ], this ) ) {\n                        return true;\n                    }\n                }\n            } ) );\n        }\n\n        ret = this.pushStack( [] );\n\n        for ( i = 0; i < len; i++ ) {\n            jQuery.find( selector, self[ i ], ret );\n        }\n\n        return len > 1 ? jQuery.uniqueSort( ret ) : ret;\n    },\n    filter: function( selector ) {\n        return this.pushStack( winnow( this, selector || [], false ) );\n    },\n    not: function( selector ) {\n        return this.pushStack( winnow( this, selector || [], true ) );\n    },\n    is: function( selector ) {\n        return !!winnow(\n            this,\n\n            // If this is a positional/relative selector, check membership in the returned set\n            // so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n            typeof selector === \"string\" && rneedsContext.test( selector ) ?\n                jQuery( selector ) :\n                selector || [],\n            false\n        ).length;\n    }\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n    // A simple way to check for HTML strings\n    // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n    // Strict HTML recognition (#11290: must start with <)\n    // Shortcut simple #id case for speed\n    rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n    init = jQuery.fn.init = function( selector, context, root ) {\n        var match, elem;\n\n        // HANDLE: $(\"\"), $(null), $(undefined), $(false)\n        if ( !selector ) {\n            return this;\n        }\n\n        // Method init() accepts an alternate rootjQuery\n        // so migrate can support jQuery.sub (gh-2101)\n        root = root || rootjQuery;\n\n        // Handle HTML strings\n        if ( typeof selector === \"string\" ) {\n            if ( selector[ 0 ] === \"<\" &&\n                selector[ selector.length - 1 ] === \">\" &&\n                selector.length >= 3 ) {\n\n                // Assume that strings that start and end with <> are HTML and skip the regex check\n                match = [ null, selector, null ];\n\n            } else {\n                match = rquickExpr.exec( selector );\n            }\n\n            // Match html or make sure no context is specified for #id\n            if ( match && ( match[ 1 ] || !context ) ) {\n\n                // HANDLE: $(html) -> $(array)\n                if ( match[ 1 ] ) {\n                    context = context instanceof jQuery ? context[ 0 ] : context;\n\n                    // Option to run scripts is true for back-compat\n                    // Intentionally let the error be thrown if parseHTML is not present\n                    jQuery.merge( this, jQuery.parseHTML(\n                        match[ 1 ],\n                        context && context.nodeType ? context.ownerDocument || context : document,\n                        true\n                    ) );\n\n                    // HANDLE: $(html, props)\n                    if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n                        for ( match in context ) {\n\n                            // Properties of context are called as methods if possible\n                            if ( jQuery.isFunction( this[ match ] ) ) {\n                                this[ match ]( context[ match ] );\n\n                            // ...and otherwise set as attributes\n                            } else {\n                                this.attr( match, context[ match ] );\n                            }\n                        }\n                    }\n\n                    return this;\n\n                // HANDLE: $(#id)\n                } else {\n                    elem = document.getElementById( match[ 2 ] );\n\n                    if ( elem ) {\n\n                        // Inject the element directly into the jQuery object\n                        this[ 0 ] = elem;\n                        this.length = 1;\n                    }\n                    return this;\n                }\n\n            // HANDLE: $(expr, $(...))\n            } else if ( !context || context.jquery ) {\n                return ( context || root ).find( selector );\n\n            // HANDLE: $(expr, context)\n            // (which is just equivalent to: $(context).find(expr)\n            } else {\n                return this.constructor( context ).find( selector );\n            }\n\n        // HANDLE: $(DOMElement)\n        } else if ( selector.nodeType ) {\n            this[ 0 ] = selector;\n            this.length = 1;\n            return this;\n\n        // HANDLE: $(function)\n        // Shortcut for document ready\n        } else if ( jQuery.isFunction( selector ) ) {\n            return root.ready !== undefined ?\n                root.ready( selector ) :\n\n                // Execute immediately if ready is not present\n                selector( jQuery );\n        }\n\n        return jQuery.makeArray( selector, this );\n    };\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n    // Methods guaranteed to produce a unique set when starting from a unique set\n    guaranteedUnique = {\n        children: true,\n        contents: true,\n        next: true,\n        prev: true\n    };\n\njQuery.fn.extend( {\n    has: function( target ) {\n        var targets = jQuery( target, this ),\n            l = targets.length;\n\n        return this.filter( function() {\n            var i = 0;\n            for ( ; i < l; i++ ) {\n                if ( jQuery.contains( this, targets[ i ] ) ) {\n                    return true;\n                }\n            }\n        } );\n    },\n\n    closest: function( selectors, context ) {\n        var cur,\n            i = 0,\n            l = this.length,\n            matched = [],\n            targets = typeof selectors !== \"string\" && jQuery( selectors );\n\n        // Positional selectors never match, since there's no _selection_ context\n        if ( !rneedsContext.test( selectors ) ) {\n            for ( ; i < l; i++ ) {\n                for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n                    // Always skip document fragments\n                    if ( cur.nodeType < 11 && ( targets ?\n                        targets.index( cur ) > -1 :\n\n                        // Don't pass non-elements to Sizzle\n                        cur.nodeType === 1 &&\n                            jQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n                        matched.push( cur );\n                        break;\n                    }\n                }\n            }\n        }\n\n        return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n    },\n\n    // Determine the position of an element within the set\n    index: function( elem ) {\n\n        // No argument, return index in parent\n        if ( !elem ) {\n            return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n        }\n\n        // Index in selector\n        if ( typeof elem === \"string\" ) {\n            return indexOf.call( jQuery( elem ), this[ 0 ] );\n        }\n\n        // Locate the position of the desired element\n        return indexOf.call( this,\n\n            // If it receives a jQuery object, the first element is used\n            elem.jquery ? elem[ 0 ] : elem\n        );\n    },\n\n    add: function( selector, context ) {\n        return this.pushStack(\n            jQuery.uniqueSort(\n                jQuery.merge( this.get(), jQuery( selector, context ) )\n            )\n        );\n    },\n\n    addBack: function( selector ) {\n        return this.add( selector == null ?\n            this.prevObject : this.prevObject.filter( selector )\n        );\n    }\n} );\n\nfunction sibling( cur, dir ) {\n    while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n    return cur;\n}\n\njQuery.each( {\n    parent: function( elem ) {\n        var parent = elem.parentNode;\n        return parent && parent.nodeType !== 11 ? parent : null;\n    },\n    parents: function( elem ) {\n        return dir( elem, \"parentNode\" );\n    },\n    parentsUntil: function( elem, i, until ) {\n        return dir( elem, \"parentNode\", until );\n    },\n    next: function( elem ) {\n        return sibling( elem, \"nextSibling\" );\n    },\n    prev: function( elem ) {\n        return sibling( elem, \"previousSibling\" );\n    },\n    nextAll: function( elem ) {\n        return dir( elem, \"nextSibling\" );\n    },\n    prevAll: function( elem ) {\n        return dir( elem, \"previousSibling\" );\n    },\n    nextUntil: function( elem, i, until ) {\n        return dir( elem, \"nextSibling\", until );\n    },\n    prevUntil: function( elem, i, until ) {\n        return dir( elem, \"previousSibling\", until );\n    },\n    siblings: function( elem ) {\n        return siblings( ( elem.parentNode || {} ).firstChild, elem );\n    },\n    children: function( elem ) {\n        return siblings( elem.firstChild );\n    },\n    contents: function( elem ) {\n        return elem.contentDocument || jQuery.merge( [], elem.childNodes );\n    }\n}, function( name, fn ) {\n    jQuery.fn[ name ] = function( until, selector ) {\n        var matched = jQuery.map( this, fn, until );\n\n        if ( name.slice( -5 ) !== \"Until\" ) {\n            selector = until;\n        }\n\n        if ( selector && typeof selector === \"string\" ) {\n            matched = jQuery.filter( selector, matched );\n        }\n\n        if ( this.length > 1 ) {\n\n            // Remove duplicates\n            if ( !guaranteedUnique[ name ] ) {\n                jQuery.uniqueSort( matched );\n            }\n\n            // Reverse order for parents* and prev-derivatives\n            if ( rparentsprev.test( name ) ) {\n                matched.reverse();\n            }\n        }\n\n        return this.pushStack( matched );\n    };\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n    var object = {};\n    jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n        object[ flag ] = true;\n    } );\n    return object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *  options: an optional list of space-separated options that will change how\n *          the callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *  once:           will ensure the callback list can only be fired once (like a Deferred)\n *\n *  memory:         will keep track of previous values and will call any callback added\n *                  after the list has been fired right away with the latest \"memorized\"\n *                  values (like a Deferred)\n *\n *  unique:         will ensure a callback can only be added once (no duplicate in the list)\n *\n *  stopOnFalse:    interrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n    // Convert options from String-formatted to Object-formatted if needed\n    // (we check in cache first)\n    options = typeof options === \"string\" ?\n        createOptions( options ) :\n        jQuery.extend( {}, options );\n\n    var // Flag to know if list is currently firing\n        firing,\n\n        // Last fire value for non-forgettable lists\n        memory,\n\n        // Flag to know if list was already fired\n        fired,\n\n        // Flag to prevent firing\n        locked,\n\n        // Actual callback list\n        list = [],\n\n        // Queue of execution data for repeatable lists\n        queue = [],\n\n        // Index of currently firing callback (modified by add/remove as needed)\n        firingIndex = -1,\n\n        // Fire callbacks\n        fire = function() {\n\n            // Enforce single-firing\n            locked = options.once;\n\n            // Execute callbacks for all pending executions,\n            // respecting firingIndex overrides and runtime changes\n            fired = firing = true;\n            for ( ; queue.length; firingIndex = -1 ) {\n                memory = queue.shift();\n                while ( ++firingIndex < list.length ) {\n\n                    // Run callback and check for early termination\n                    if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n                        options.stopOnFalse ) {\n\n                        // Jump to end and forget the data so .add doesn't re-fire\n                        firingIndex = list.length;\n                        memory = false;\n                    }\n                }\n            }\n\n            // Forget the data if we're done with it\n            if ( !options.memory ) {\n                memory = false;\n            }\n\n            firing = false;\n\n            // Clean up if we're done firing for good\n            if ( locked ) {\n\n                // Keep an empty list if we have data for future add calls\n                if ( memory ) {\n                    list = [];\n\n                // Otherwise, this object is spent\n                } else {\n                    list = \"\";\n                }\n            }\n        },\n\n        // Actual Callbacks object\n        self = {\n\n            // Add a callback or a collection of callbacks to the list\n            add: function() {\n                if ( list ) {\n\n                    // If we have memory from a past run, we should fire after adding\n                    if ( memory && !firing ) {\n                        firingIndex = list.length - 1;\n                        queue.push( memory );\n                    }\n\n                    ( function add( args ) {\n                        jQuery.each( args, function( _, arg ) {\n                            if ( jQuery.isFunction( arg ) ) {\n                                if ( !options.unique || !self.has( arg ) ) {\n                                    list.push( arg );\n                                }\n                            } else if ( arg && arg.length && jQuery.type( arg ) !== \"string\" ) {\n\n                                // Inspect recursively\n                                add( arg );\n                            }\n                        } );\n                    } )( arguments );\n\n                    if ( memory && !firing ) {\n                        fire();\n                    }\n                }\n                return this;\n            },\n\n            // Remove a callback from the list\n            remove: function() {\n                jQuery.each( arguments, function( _, arg ) {\n                    var index;\n                    while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n                        list.splice( index, 1 );\n\n                        // Handle firing indexes\n                        if ( index <= firingIndex ) {\n                            firingIndex--;\n                        }\n                    }\n                } );\n                return this;\n            },\n\n            // Check if a given callback is in the list.\n            // If no argument is given, return whether or not list has callbacks attached.\n            has: function( fn ) {\n                return fn ?\n                    jQuery.inArray( fn, list ) > -1 :\n                    list.length > 0;\n            },\n\n            // Remove all callbacks from the list\n            empty: function() {\n                if ( list ) {\n                    list = [];\n                }\n                return this;\n            },\n\n            // Disable .fire and .add\n            // Abort any current/pending executions\n            // Clear all callbacks and values\n            disable: function() {\n                locked = queue = [];\n                list = memory = \"\";\n                return this;\n            },\n            disabled: function() {\n                return !list;\n            },\n\n            // Disable .fire\n            // Also disable .add unless we have memory (since it would have no effect)\n            // Abort any pending executions\n            lock: function() {\n                locked = queue = [];\n                if ( !memory && !firing ) {\n                    list = memory = \"\";\n                }\n                return this;\n            },\n            locked: function() {\n                return !!locked;\n            },\n\n            // Call all callbacks with the given context and arguments\n            fireWith: function( context, args ) {\n                if ( !locked ) {\n                    args = args || [];\n                    args = [ context, args.slice ? args.slice() : args ];\n                    queue.push( args );\n                    if ( !firing ) {\n                        fire();\n                    }\n                }\n                return this;\n            },\n\n            // Call all the callbacks with the given arguments\n            fire: function() {\n                self.fireWith( this, arguments );\n                return this;\n            },\n\n            // To know if the callbacks have already been called at least once\n            fired: function() {\n                return !!fired;\n            }\n        };\n\n    return self;\n};\n\n\nfunction Identity( v ) {\n    return v;\n}\nfunction Thrower( ex ) {\n    throw ex;\n}\n\nfunction adoptValue( value, resolve, reject ) {\n    var method;\n\n    try {\n\n        // Check for promise aspect first to privilege synchronous behavior\n        if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {\n            method.call( value ).done( resolve ).fail( reject );\n\n        // Other thenables\n        } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {\n            method.call( value, resolve, reject );\n\n        // Other non-thenables\n        } else {\n\n            // Support: Android 4.0 only\n            // Strict mode functions invoked without .call/.apply get global-object context\n            resolve.call( undefined, value );\n        }\n\n    // For Promises/A+, convert exceptions into rejections\n    // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n    // Deferred#then to conditionally suppress rejection.\n    } catch ( value ) {\n\n        // Support: Android 4.0 only\n        // Strict mode functions invoked without .call/.apply get global-object context\n        reject.call( undefined, value );\n    }\n}\n\njQuery.extend( {\n\n    Deferred: function( func ) {\n        var tuples = [\n\n                // action, add listener, callbacks,\n                // ... .then handlers, argument index, [final state]\n                [ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n                    jQuery.Callbacks( \"memory\" ), 2 ],\n                [ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n                    jQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n                [ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n                    jQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n            ],\n            state = \"pending\",\n            promise = {\n                state: function() {\n                    return state;\n                },\n                always: function() {\n                    deferred.done( arguments ).fail( arguments );\n                    return this;\n                },\n                \"catch\": function( fn ) {\n                    return promise.then( null, fn );\n                },\n\n                // Keep pipe for back-compat\n                pipe: function( /* fnDone, fnFail, fnProgress */ ) {\n                    var fns = arguments;\n\n                    return jQuery.Deferred( function( newDefer ) {\n                        jQuery.each( tuples, function( i, tuple ) {\n\n                            // Map tuples (progress, done, fail) to arguments (done, fail, progress)\n                            var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n                            // deferred.progress(function() { bind to newDefer or newDefer.notify })\n                            // deferred.done(function() { bind to newDefer or newDefer.resolve })\n                            // deferred.fail(function() { bind to newDefer or newDefer.reject })\n                            deferred[ tuple[ 1 ] ]( function() {\n                                var returned = fn && fn.apply( this, arguments );\n                                if ( returned && jQuery.isFunction( returned.promise ) ) {\n                                    returned.promise()\n                                        .progress( newDefer.notify )\n                                        .done( newDefer.resolve )\n                                        .fail( newDefer.reject );\n                                } else {\n                                    newDefer[ tuple[ 0 ] + \"With\" ](\n                                        this,\n                                        fn ? [ returned ] : arguments\n                                    );\n                                }\n                            } );\n                        } );\n                        fns = null;\n                    } ).promise();\n                },\n                then: function( onFulfilled, onRejected, onProgress ) {\n                    var maxDepth = 0;\n                    function resolve( depth, deferred, handler, special ) {\n                        return function() {\n                            var that = this,\n                                args = arguments,\n                                mightThrow = function() {\n                                    var returned, then;\n\n                                    // Support: Promises/A+ section 2.3.3.3.3\n                                    // https://promisesaplus.com/#point-59\n                                    // Ignore double-resolution attempts\n                                    if ( depth < maxDepth ) {\n                                        return;\n                                    }\n\n                                    returned = handler.apply( that, args );\n\n                                    // Support: Promises/A+ section 2.3.1\n                                    // https://promisesaplus.com/#point-48\n                                    if ( returned === deferred.promise() ) {\n                                        throw new TypeError( \"Thenable self-resolution\" );\n                                    }\n\n                                    // Support: Promises/A+ sections 2.3.3.1, 3.5\n                                    // https://promisesaplus.com/#point-54\n                                    // https://promisesaplus.com/#point-75\n                                    // Retrieve `then` only once\n                                    then = returned &&\n\n                                        // Support: Promises/A+ section 2.3.4\n                                        // https://promisesaplus.com/#point-64\n                                        // Only check objects and functions for thenability\n                                        ( typeof returned === \"object\" ||\n                                            typeof returned === \"function\" ) &&\n                                        returned.then;\n\n                                    // Handle a returned thenable\n                                    if ( jQuery.isFunction( then ) ) {\n\n                                        // Special processors (notify) just wait for resolution\n                                        if ( special ) {\n                                            then.call(\n                                                returned,\n                                                resolve( maxDepth, deferred, Identity, special ),\n                                                resolve( maxDepth, deferred, Thrower, special )\n                                            );\n\n                                        // Normal processors (resolve) also hook into progress\n                                        } else {\n\n                                            // ...and disregard older resolution values\n                                            maxDepth++;\n\n                                            then.call(\n                                                returned,\n                                                resolve( maxDepth, deferred, Identity, special ),\n                                                resolve( maxDepth, deferred, Thrower, special ),\n                                                resolve( maxDepth, deferred, Identity,\n                                                    deferred.notifyWith )\n                                            );\n                                        }\n\n                                    // Handle all other returned values\n                                    } else {\n\n                                        // Only substitute handlers pass on context\n                                        // and multiple values (non-spec behavior)\n                                        if ( handler !== Identity ) {\n                                            that = undefined;\n                                            args = [ returned ];\n                                        }\n\n                                        // Process the value(s)\n                                        // Default process is resolve\n                                        ( special || deferred.resolveWith )( that, args );\n                                    }\n                                },\n\n                                // Only normal processors (resolve) catch and reject exceptions\n                                process = special ?\n                                    mightThrow :\n                                    function() {\n                                        try {\n                                            mightThrow();\n                                        } catch ( e ) {\n\n                                            if ( jQuery.Deferred.exceptionHook ) {\n                                                jQuery.Deferred.exceptionHook( e,\n                                                    process.stackTrace );\n                                            }\n\n                                            // Support: Promises/A+ section 2.3.3.3.4.1\n                                            // https://promisesaplus.com/#point-61\n                                            // Ignore post-resolution exceptions\n                                            if ( depth + 1 >= maxDepth ) {\n\n                                                // Only substitute handlers pass on context\n                                                // and multiple values (non-spec behavior)\n                                                if ( handler !== Thrower ) {\n                                                    that = undefined;\n                                                    args = [ e ];\n                                                }\n\n                                                deferred.rejectWith( that, args );\n                                            }\n                                        }\n                                    };\n\n                            // Support: Promises/A+ section 2.3.3.3.1\n                            // https://promisesaplus.com/#point-57\n                            // Re-resolve promises immediately to dodge false rejection from\n                            // subsequent errors\n                            if ( depth ) {\n                                process();\n                            } else {\n\n                                // Call an optional hook to record the stack, in case of exception\n                                // since it's otherwise lost when execution goes async\n                                if ( jQuery.Deferred.getStackHook ) {\n                                    process.stackTrace = jQuery.Deferred.getStackHook();\n                                }\n                                window.setTimeout( process );\n                            }\n                        };\n                    }\n\n                    return jQuery.Deferred( function( newDefer ) {\n\n                        // progress_handlers.add( ... )\n                        tuples[ 0 ][ 3 ].add(\n                            resolve(\n                                0,\n                                newDefer,\n                                jQuery.isFunction( onProgress ) ?\n                                    onProgress :\n                                    Identity,\n                                newDefer.notifyWith\n                            )\n                        );\n\n                        // fulfilled_handlers.add( ... )\n                        tuples[ 1 ][ 3 ].add(\n                            resolve(\n                                0,\n                                newDefer,\n                                jQuery.isFunction( onFulfilled ) ?\n                                    onFulfilled :\n                                    Identity\n                            )\n                        );\n\n                        // rejected_handlers.add( ... )\n                        tuples[ 2 ][ 3 ].add(\n                            resolve(\n                                0,\n                                newDefer,\n                                jQuery.isFunction( onRejected ) ?\n                                    onRejected :\n                                    Thrower\n                            )\n                        );\n                    } ).promise();\n                },\n\n                // Get a promise for this deferred\n                // If obj is provided, the promise aspect is added to the object\n                promise: function( obj ) {\n                    return obj != null ? jQuery.extend( obj, promise ) : promise;\n                }\n            },\n            deferred = {};\n\n        // Add list-specific methods\n        jQuery.each( tuples, function( i, tuple ) {\n            var list = tuple[ 2 ],\n                stateString = tuple[ 5 ];\n\n            // promise.progress = list.add\n            // promise.done = list.add\n            // promise.fail = list.add\n            promise[ tuple[ 1 ] ] = list.add;\n\n            // Handle state\n            if ( stateString ) {\n                list.add(\n                    function() {\n\n                        // state = \"resolved\" (i.e., fulfilled)\n                        // state = \"rejected\"\n                        state = stateString;\n                    },\n\n                    // rejected_callbacks.disable\n                    // fulfilled_callbacks.disable\n                    tuples[ 3 - i ][ 2 ].disable,\n\n                    // progress_callbacks.lock\n                    tuples[ 0 ][ 2 ].lock\n                );\n            }\n\n            // progress_handlers.fire\n            // fulfilled_handlers.fire\n            // rejected_handlers.fire\n            list.add( tuple[ 3 ].fire );\n\n            // deferred.notify = function() { deferred.notifyWith(...) }\n            // deferred.resolve = function() { deferred.resolveWith(...) }\n            // deferred.reject = function() { deferred.rejectWith(...) }\n            deferred[ tuple[ 0 ] ] = function() {\n                deferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n                return this;\n            };\n\n            // deferred.notifyWith = list.fireWith\n            // deferred.resolveWith = list.fireWith\n            // deferred.rejectWith = list.fireWith\n            deferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n        } );\n\n        // Make the deferred a promise\n        promise.promise( deferred );\n\n        // Call given func if any\n        if ( func ) {\n            func.call( deferred, deferred );\n        }\n\n        // All done!\n        return deferred;\n    },\n\n    // Deferred helper\n    when: function( singleValue ) {\n        var\n\n            // count of uncompleted subordinates\n            remaining = arguments.length,\n\n            // count of unprocessed arguments\n            i = remaining,\n\n            // subordinate fulfillment data\n            resolveContexts = Array( i ),\n            resolveValues = slice.call( arguments ),\n\n            // the master Deferred\n            master = jQuery.Deferred(),\n\n            // subordinate callback factory\n            updateFunc = function( i ) {\n                return function( value ) {\n                    resolveContexts[ i ] = this;\n                    resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n                    if ( !( --remaining ) ) {\n                        master.resolveWith( resolveContexts, resolveValues );\n                    }\n                };\n            };\n\n        // Single- and empty arguments are adopted like Promise.resolve\n        if ( remaining <= 1 ) {\n            adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );\n\n            // Use .then() to unwrap secondary thenables (cf. gh-3000)\n            if ( master.state() === \"pending\" ||\n                jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n                return master.then();\n            }\n        }\n\n        // Multiple arguments are aggregated like Promise.all array elements\n        while ( i-- ) {\n            adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n        }\n\n        return master.promise();\n    }\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n    // Support: IE 8 - 9 only\n    // Console exists when dev tools are open, which can happen at any time\n    if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n        window.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n    }\n};\n\n\n\n\njQuery.readyException = function( error ) {\n    window.setTimeout( function() {\n        throw error;\n    } );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n    readyList\n        .then( fn )\n\n        // Wrap jQuery.readyException in a function so that the lookup\n        // happens at the time of error handling instead of callback\n        // registration.\n        .catch( function( error ) {\n            jQuery.readyException( error );\n        } );\n\n    return this;\n};\n\njQuery.extend( {\n\n    // Is the DOM ready to be used? Set to true once it occurs.\n    isReady: false,\n\n    // A counter to track how many items to wait for before\n    // the ready event fires. See #6781\n    readyWait: 1,\n\n    // Hold (or release) the ready event\n    holdReady: function( hold ) {\n        if ( hold ) {\n            jQuery.readyWait++;\n        } else {\n            jQuery.ready( true );\n        }\n    },\n\n    // Handle when the DOM is ready\n    ready: function( wait ) {\n\n        // Abort if there are pending holds or we're already ready\n        if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n            return;\n        }\n\n        // Remember that the DOM is ready\n        jQuery.isReady = true;\n\n        // If a normal DOM Ready event fired, decrement, and wait if need be\n        if ( wait !== true && --jQuery.readyWait > 0 ) {\n            return;\n        }\n\n        // If there are functions bound, to execute\n        readyList.resolveWith( document, [ jQuery ] );\n    }\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n    document.removeEventListener( \"DOMContentLoaded\", completed );\n    window.removeEventListener( \"load\", completed );\n    jQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n    ( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n    // Handle it asynchronously to allow scripts the opportunity to delay ready\n    window.setTimeout( jQuery.ready );\n\n} else {\n\n    // Use the handy event callback\n    document.addEventListener( \"DOMContentLoaded\", completed );\n\n    // A fallback to window.onload, that will always work\n    window.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n    var i = 0,\n        len = elems.length,\n        bulk = key == null;\n\n    // Sets many values\n    if ( jQuery.type( key ) === \"object\" ) {\n        chainable = true;\n        for ( i in key ) {\n            access( elems, fn, i, key[ i ], true, emptyGet, raw );\n        }\n\n    // Sets one value\n    } else if ( value !== undefined ) {\n        chainable = true;\n\n        if ( !jQuery.isFunction( value ) ) {\n            raw = true;\n        }\n\n        if ( bulk ) {\n\n            // Bulk operations run against the entire set\n            if ( raw ) {\n                fn.call( elems, value );\n                fn = null;\n\n            // ...except when executing function values\n            } else {\n                bulk = fn;\n                fn = function( elem, key, value ) {\n                    return bulk.call( jQuery( elem ), value );\n                };\n            }\n        }\n\n        if ( fn ) {\n            for ( ; i < len; i++ ) {\n                fn(\n                    elems[ i ], key, raw ?\n                    value :\n                    value.call( elems[ i ], i, fn( elems[ i ], key ) )\n                );\n            }\n        }\n    }\n\n    if ( chainable ) {\n        return elems;\n    }\n\n    // Gets\n    if ( bulk ) {\n        return fn.call( elems );\n    }\n\n    return len ? fn( elems[ 0 ], key ) : emptyGet;\n};\nvar acceptData = function( owner ) {\n\n    // Accepts only:\n    //  - Node\n    //    - Node.ELEMENT_NODE\n    //    - Node.DOCUMENT_NODE\n    //  - Object\n    //    - Any\n    return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n    this.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n    cache: function( owner ) {\n\n        // Check if the owner object already has a cache\n        var value = owner[ this.expando ];\n\n        // If not, create one\n        if ( !value ) {\n            value = {};\n\n            // We can accept data for non-element nodes in modern browsers,\n            // but we should not, see #8335.\n            // Always return an empty object.\n            if ( acceptData( owner ) ) {\n\n                // If it is a node unlikely to be stringify-ed or looped over\n                // use plain assignment\n                if ( owner.nodeType ) {\n                    owner[ this.expando ] = value;\n\n                // Otherwise secure it in a non-enumerable property\n                // configurable must be true to allow the property to be\n                // deleted when data is removed\n                } else {\n                    Object.defineProperty( owner, this.expando, {\n                        value: value,\n                        configurable: true\n                    } );\n                }\n            }\n        }\n\n        return value;\n    },\n    set: function( owner, data, value ) {\n        var prop,\n            cache = this.cache( owner );\n\n        // Handle: [ owner, key, value ] args\n        // Always use camelCase key (gh-2257)\n        if ( typeof data === \"string\" ) {\n            cache[ jQuery.camelCase( data ) ] = value;\n\n        // Handle: [ owner, { properties } ] args\n        } else {\n\n            // Copy the properties one-by-one to the cache object\n            for ( prop in data ) {\n                cache[ jQuery.camelCase( prop ) ] = data[ prop ];\n            }\n        }\n        return cache;\n    },\n    get: function( owner, key ) {\n        return key === undefined ?\n            this.cache( owner ) :\n\n            // Always use camelCase key (gh-2257)\n            owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];\n    },\n    access: function( owner, key, value ) {\n\n        // In cases where either:\n        //\n        //   1. No key was specified\n        //   2. A string key was specified, but no value provided\n        //\n        // Take the \"read\" path and allow the get method to determine\n        // which value to return, respectively either:\n        //\n        //   1. The entire cache object\n        //   2. The data stored at the key\n        //\n        if ( key === undefined ||\n                ( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n            return this.get( owner, key );\n        }\n\n        // When the key is not a string, or both a key and value\n        // are specified, set or extend (existing objects) with either:\n        //\n        //   1. An object of properties\n        //   2. A key and value\n        //\n        this.set( owner, key, value );\n\n        // Since the \"set\" path can have two possible entry points\n        // return the expected data based on which path was taken[*]\n        return value !== undefined ? value : key;\n    },\n    remove: function( owner, key ) {\n        var i,\n            cache = owner[ this.expando ];\n\n        if ( cache === undefined ) {\n            return;\n        }\n\n        if ( key !== undefined ) {\n\n            // Support array or space separated string of keys\n            if ( jQuery.isArray( key ) ) {\n\n                // If key is an array of keys...\n                // We always set camelCase keys, so remove that.\n                key = key.map( jQuery.camelCase );\n            } else {\n                key = jQuery.camelCase( key );\n\n                // If a key with the spaces exists, use it.\n                // Otherwise, create an array by matching non-whitespace\n                key = key in cache ?\n                    [ key ] :\n                    ( key.match( rnothtmlwhite ) || [] );\n            }\n\n            i = key.length;\n\n            while ( i-- ) {\n                delete cache[ key[ i ] ];\n            }\n        }\n\n        // Remove the expando if there's no more data\n        if ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n            // Support: Chrome <=35 - 45\n            // Webkit & Blink performance suffers when deleting properties\n            // from DOM nodes, so set to undefined instead\n            // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n            if ( owner.nodeType ) {\n                owner[ this.expando ] = undefined;\n            } else {\n                delete owner[ this.expando ];\n            }\n        }\n    },\n    hasData: function( owner ) {\n        var cache = owner[ this.expando ];\n        return cache !== undefined && !jQuery.isEmptyObject( cache );\n    }\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//  Implementation Summary\n//\n//  1. Enforce API surface and semantic compatibility with 1.9.x branch\n//  2. Improve the module's maintainability by reducing the storage\n//      paths to a single mechanism.\n//  3. Use the same single mechanism to support \"private\" and \"user\" data.\n//  4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//  5. Avoid exposing implementation details on user objects (eg. expando properties)\n//  6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n    rmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n    if ( data === \"true\" ) {\n        return true;\n    }\n\n    if ( data === \"false\" ) {\n        return false;\n    }\n\n    if ( data === \"null\" ) {\n        return null;\n    }\n\n    // Only convert to a number if it doesn't change the string\n    if ( data === +data + \"\" ) {\n        return +data;\n    }\n\n    if ( rbrace.test( data ) ) {\n        return JSON.parse( data );\n    }\n\n    return data;\n}\n\nfunction dataAttr( elem, key, data ) {\n    var name;\n\n    // If nothing was found internally, try to fetch any\n    // data from the HTML5 data-* attribute\n    if ( data === undefined && elem.nodeType === 1 ) {\n        name = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n        data = elem.getAttribute( name );\n\n        if ( typeof data === \"string\" ) {\n            try {\n                data = getData( data );\n            } catch ( e ) {}\n\n            // Make sure we set the data so it isn't changed later\n            dataUser.set( elem, key, data );\n        } else {\n            data = undefined;\n        }\n    }\n    return data;\n}\n\njQuery.extend( {\n    hasData: function( elem ) {\n        return dataUser.hasData( elem ) || dataPriv.hasData( elem );\n    },\n\n    data: function( elem, name, data ) {\n        return dataUser.access( elem, name, data );\n    },\n\n    removeData: function( elem, name ) {\n        dataUser.remove( elem, name );\n    },\n\n    // TODO: Now that all calls to _data and _removeData have been replaced\n    // with direct calls to dataPriv methods, these can be deprecated.\n    _data: function( elem, name, data ) {\n        return dataPriv.access( elem, name, data );\n    },\n\n    _removeData: function( elem, name ) {\n        dataPriv.remove( elem, name );\n    }\n} );\n\njQuery.fn.extend( {\n    data: function( key, value ) {\n        var i, name, data,\n            elem = this[ 0 ],\n            attrs = elem && elem.attributes;\n\n        // Gets all values\n        if ( key === undefined ) {\n            if ( this.length ) {\n                data = dataUser.get( elem );\n\n                if ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n                    i = attrs.length;\n                    while ( i-- ) {\n\n                        // Support: IE 11 only\n                        // The attrs elements can be null (#14894)\n                        if ( attrs[ i ] ) {\n                            name = attrs[ i ].name;\n                            if ( name.indexOf( \"data-\" ) === 0 ) {\n                                name = jQuery.camelCase( name.slice( 5 ) );\n                                dataAttr( elem, name, data[ name ] );\n                            }\n                        }\n                    }\n                    dataPriv.set( elem, \"hasDataAttrs\", true );\n                }\n            }\n\n            return data;\n        }\n\n        // Sets multiple values\n        if ( typeof key === \"object\" ) {\n            return this.each( function() {\n                dataUser.set( this, key );\n            } );\n        }\n\n        return access( this, function( value ) {\n            var data;\n\n            // The calling jQuery object (element matches) is not empty\n            // (and therefore has an element appears at this[ 0 ]) and the\n            // `value` parameter was not undefined. An empty jQuery object\n            // will result in `undefined` for elem = this[ 0 ] which will\n            // throw an exception if an attempt to read a data cache is made.\n            if ( elem && value === undefined ) {\n\n                // Attempt to get data from the cache\n                // The key will always be camelCased in Data\n                data = dataUser.get( elem, key );\n                if ( data !== undefined ) {\n                    return data;\n                }\n\n                // Attempt to \"discover\" the data in\n                // HTML5 custom data-* attrs\n                data = dataAttr( elem, key );\n                if ( data !== undefined ) {\n                    return data;\n                }\n\n                // We tried really hard, but the data doesn't exist.\n                return;\n            }\n\n            // Set the data...\n            this.each( function() {\n\n                // We always store the camelCased key\n                dataUser.set( this, key, value );\n            } );\n        }, null, value, arguments.length > 1, null, true );\n    },\n\n    removeData: function( key ) {\n        return this.each( function() {\n            dataUser.remove( this, key );\n        } );\n    }\n} );\n\n\njQuery.extend( {\n    queue: function( elem, type, data ) {\n        var queue;\n\n        if ( elem ) {\n            type = ( type || \"fx\" ) + \"queue\";\n            queue = dataPriv.get( elem, type );\n\n            // Speed up dequeue by getting out quickly if this is just a lookup\n            if ( data ) {\n                if ( !queue || jQuery.isArray( data ) ) {\n                    queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n                } else {\n                    queue.push( data );\n                }\n            }\n            return queue || [];\n        }\n    },\n\n    dequeue: function( elem, type ) {\n        type = type || \"fx\";\n\n        var queue = jQuery.queue( elem, type ),\n            startLength = queue.length,\n            fn = queue.shift(),\n            hooks = jQuery._queueHooks( elem, type ),\n            next = function() {\n                jQuery.dequeue( elem, type );\n            };\n\n        // If the fx queue is dequeued, always remove the progress sentinel\n        if ( fn === \"inprogress\" ) {\n            fn = queue.shift();\n            startLength--;\n        }\n\n        if ( fn ) {\n\n            // Add a progress sentinel to prevent the fx queue from being\n            // automatically dequeued\n            if ( type === \"fx\" ) {\n                queue.unshift( \"inprogress\" );\n            }\n\n            // Clear up the last queue stop function\n            delete hooks.stop;\n            fn.call( elem, next, hooks );\n        }\n\n        if ( !startLength && hooks ) {\n            hooks.empty.fire();\n        }\n    },\n\n    // Not public - generate a queueHooks object, or return the current one\n    _queueHooks: function( elem, type ) {\n        var key = type + \"queueHooks\";\n        return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n            empty: jQuery.Callbacks( \"once memory\" ).add( function() {\n                dataPriv.remove( elem, [ type + \"queue\", key ] );\n            } )\n        } );\n    }\n} );\n\njQuery.fn.extend( {\n    queue: function( type, data ) {\n        var setter = 2;\n\n        if ( typeof type !== \"string\" ) {\n            data = type;\n            type = \"fx\";\n            setter--;\n        }\n\n        if ( arguments.length < setter ) {\n            return jQuery.queue( this[ 0 ], type );\n        }\n\n        return data === undefined ?\n            this :\n            this.each( function() {\n                var queue = jQuery.queue( this, type, data );\n\n                // Ensure a hooks for this queue\n                jQuery._queueHooks( this, type );\n\n                if ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n                    jQuery.dequeue( this, type );\n                }\n            } );\n    },\n    dequeue: function( type ) {\n        return this.each( function() {\n            jQuery.dequeue( this, type );\n        } );\n    },\n    clearQueue: function( type ) {\n        return this.queue( type || \"fx\", [] );\n    },\n\n    // Get a promise resolved when queues of a certain type\n    // are emptied (fx is the type by default)\n    promise: function( type, obj ) {\n        var tmp,\n            count = 1,\n            defer = jQuery.Deferred(),\n            elements = this,\n            i = this.length,\n            resolve = function() {\n                if ( !( --count ) ) {\n                    defer.resolveWith( elements, [ elements ] );\n                }\n            };\n\n        if ( typeof type !== \"string\" ) {\n            obj = type;\n            type = undefined;\n        }\n        type = type || \"fx\";\n\n        while ( i-- ) {\n            tmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n            if ( tmp && tmp.empty ) {\n                count++;\n                tmp.empty.add( resolve );\n            }\n        }\n        resolve();\n        return defer.promise( obj );\n    }\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar isHiddenWithinTree = function( elem, el ) {\n\n        // isHiddenWithinTree might be called from jQuery#filter function;\n        // in that case, element will be second argument\n        elem = el || elem;\n\n        // Inline style trumps all\n        return elem.style.display === \"none\" ||\n            elem.style.display === \"\" &&\n\n            // Otherwise, check computed style\n            // Support: Firefox <=43 - 45\n            // Disconnected elements can have computed display: none, so first confirm that elem is\n            // in the document.\n            jQuery.contains( elem.ownerDocument, elem ) &&\n\n            jQuery.css( elem, \"display\" ) === \"none\";\n    };\n\nvar swap = function( elem, options, callback, args ) {\n    var ret, name,\n        old = {};\n\n    // Remember the old values, and insert the new ones\n    for ( name in options ) {\n        old[ name ] = elem.style[ name ];\n        elem.style[ name ] = options[ name ];\n    }\n\n    ret = callback.apply( elem, args || [] );\n\n    // Revert the old values\n    for ( name in options ) {\n        elem.style[ name ] = old[ name ];\n    }\n\n    return ret;\n};\n\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n    var adjusted,\n        scale = 1,\n        maxIterations = 20,\n        currentValue = tween ?\n            function() {\n                return tween.cur();\n            } :\n            function() {\n                return jQuery.css( elem, prop, \"\" );\n            },\n        initial = currentValue(),\n        unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n        // Starting value computation is required for potential unit mismatches\n        initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n            rcssNum.exec( jQuery.css( elem, prop ) );\n\n    if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n        // Trust units reported by jQuery.css\n        unit = unit || initialInUnit[ 3 ];\n\n        // Make sure we update the tween properties later on\n        valueParts = valueParts || [];\n\n        // Iteratively approximate from a nonzero starting point\n        initialInUnit = +initial || 1;\n\n        do {\n\n            // If previous iteration zeroed out, double until we get *something*.\n            // Use string for doubling so we don't accidentally see scale as unchanged below\n            scale = scale || \".5\";\n\n            // Adjust and apply\n            initialInUnit = initialInUnit / scale;\n            jQuery.style( elem, prop, initialInUnit + unit );\n\n        // Update scale, tolerating zero or NaN from tween.cur()\n        // Break the loop if scale is unchanged or perfect, or if we've just had enough.\n        } while (\n            scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations\n        );\n    }\n\n    if ( valueParts ) {\n        initialInUnit = +initialInUnit || +initial || 0;\n\n        // Apply relative offset (+=/-=) if specified\n        adjusted = valueParts[ 1 ] ?\n            initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n            +valueParts[ 2 ];\n        if ( tween ) {\n            tween.unit = unit;\n            tween.start = initialInUnit;\n            tween.end = adjusted;\n        }\n    }\n    return adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n    var temp,\n        doc = elem.ownerDocument,\n        nodeName = elem.nodeName,\n        display = defaultDisplayMap[ nodeName ];\n\n    if ( display ) {\n        return display;\n    }\n\n    temp = doc.body.appendChild( doc.createElement( nodeName ) );\n    display = jQuery.css( temp, \"display\" );\n\n    temp.parentNode.removeChild( temp );\n\n    if ( display === \"none\" ) {\n        display = \"block\";\n    }\n    defaultDisplayMap[ nodeName ] = display;\n\n    return display;\n}\n\nfunction showHide( elements, show ) {\n    var display, elem,\n        values = [],\n        index = 0,\n        length = elements.length;\n\n    // Determine new display value for elements that need to change\n    for ( ; index < length; index++ ) {\n        elem = elements[ index ];\n        if ( !elem.style ) {\n            continue;\n        }\n\n        display = elem.style.display;\n        if ( show ) {\n\n            // Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n            // check is required in this first loop unless we have a nonempty display value (either\n            // inline or about-to-be-restored)\n            if ( display === \"none\" ) {\n                values[ index ] = dataPriv.get( elem, \"display\" ) || null;\n                if ( !values[ index ] ) {\n                    elem.style.display = \"\";\n                }\n            }\n            if ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n                values[ index ] = getDefaultDisplay( elem );\n            }\n        } else {\n            if ( display !== \"none\" ) {\n                values[ index ] = \"none\";\n\n                // Remember what we're overwriting\n                dataPriv.set( elem, \"display\", display );\n            }\n        }\n    }\n\n    // Set the display of the elements in a second loop to avoid constant reflow\n    for ( index = 0; index < length; index++ ) {\n        if ( values[ index ] != null ) {\n            elements[ index ].style.display = values[ index ];\n        }\n    }\n\n    return elements;\n}\n\njQuery.fn.extend( {\n    show: function() {\n        return showHide( this, true );\n    },\n    hide: function() {\n        return showHide( this );\n    },\n    toggle: function( state ) {\n        if ( typeof state === \"boolean\" ) {\n            return state ? this.show() : this.hide();\n        }\n\n        return this.each( function() {\n            if ( isHiddenWithinTree( this ) ) {\n                jQuery( this ).show();\n            } else {\n                jQuery( this ).hide();\n            }\n        } );\n    }\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]+)/i );\n\nvar rscriptType = ( /^$|\\/(?:java|ecma)script/i );\n\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n    // Support: IE <=9 only\n    option: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n    // XHTML parsers do not magically insert elements in the\n    // same way that tag soup parsers do. So we cannot shorten\n    // this by omitting <tbody> or other required elements.\n    thead: [ 1, \"<table>\", \"</table>\" ],\n    col: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n    tr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n    td: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n    _default: [ 0, \"\", \"\" ]\n};\n\n// Support: IE <=9 only\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction getAll( context, tag ) {\n\n    // Support: IE <=9 - 11 only\n    // Use typeof to avoid zero-argument method invocation on host objects (#15151)\n    var ret;\n\n    if ( typeof context.getElementsByTagName !== \"undefined\" ) {\n        ret = context.getElementsByTagName( tag || \"*\" );\n\n    } else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n        ret = context.querySelectorAll( tag || \"*\" );\n\n    } else {\n        ret = [];\n    }\n\n    if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {\n        return jQuery.merge( [ context ], ret );\n    }\n\n    return ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n    var i = 0,\n        l = elems.length;\n\n    for ( ; i < l; i++ ) {\n        dataPriv.set(\n            elems[ i ],\n            \"globalEval\",\n            !refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n        );\n    }\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n    var elem, tmp, tag, wrap, contains, j,\n        fragment = context.createDocumentFragment(),\n        nodes = [],\n        i = 0,\n        l = elems.length;\n\n    for ( ; i < l; i++ ) {\n        elem = elems[ i ];\n\n        if ( elem || elem === 0 ) {\n\n            // Add nodes directly\n            if ( jQuery.type( elem ) === \"object\" ) {\n\n                // Support: Android <=4.0 only, PhantomJS 1 only\n                // push.apply(_, arraylike) throws on ancient WebKit\n                jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n            // Convert non-html into a text node\n            } else if ( !rhtml.test( elem ) ) {\n                nodes.push( context.createTextNode( elem ) );\n\n            // Convert html into DOM nodes\n            } else {\n                tmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n                // Deserialize a standard representation\n                tag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n                wrap = wrapMap[ tag ] || wrapMap._default;\n                tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n                // Descend through wrappers to the right content\n                j = wrap[ 0 ];\n                while ( j-- ) {\n                    tmp = tmp.lastChild;\n                }\n\n                // Support: Android <=4.0 only, PhantomJS 1 only\n                // push.apply(_, arraylike) throws on ancient WebKit\n                jQuery.merge( nodes, tmp.childNodes );\n\n                // Remember the top-level container\n                tmp = fragment.firstChild;\n\n                // Ensure the created nodes are orphaned (#12392)\n                tmp.textContent = \"\";\n            }\n        }\n    }\n\n    // Remove wrapper from fragment\n    fragment.textContent = \"\";\n\n    i = 0;\n    while ( ( elem = nodes[ i++ ] ) ) {\n\n        // Skip elements already in the context collection (trac-4087)\n        if ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n            if ( ignored ) {\n                ignored.push( elem );\n            }\n            continue;\n        }\n\n        contains = jQuery.contains( elem.ownerDocument, elem );\n\n        // Append to fragment\n        tmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n        // Preserve script evaluation history\n        if ( contains ) {\n            setGlobalEval( tmp );\n        }\n\n        // Capture executables\n        if ( scripts ) {\n            j = 0;\n            while ( ( elem = tmp[ j++ ] ) ) {\n                if ( rscriptType.test( elem.type || \"\" ) ) {\n                    scripts.push( elem );\n                }\n            }\n        }\n    }\n\n    return fragment;\n}\n\n\n( function() {\n    var fragment = document.createDocumentFragment(),\n        div = fragment.appendChild( document.createElement( \"div\" ) ),\n        input = document.createElement( \"input\" );\n\n    // Support: Android 4.0 - 4.3 only\n    // Check state lost if the name is set (#11217)\n    // Support: Windows Web Apps (WWA)\n    // `name` and `type` must use .setAttribute for WWA (#14901)\n    input.setAttribute( \"type\", \"radio\" );\n    input.setAttribute( \"checked\", \"checked\" );\n    input.setAttribute( \"name\", \"t\" );\n\n    div.appendChild( input );\n\n    // Support: Android <=4.1 only\n    // Older WebKit doesn't clone checked state correctly in fragments\n    support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n    // Support: IE <=11 only\n    // Make sure textarea (and checkbox) defaultValue is properly cloned\n    div.innerHTML = \"<textarea>x</textarea>\";\n    support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n} )();\nvar documentElement = document.documentElement;\n\n\n\nvar\n    rkeyEvent = /^key/,\n    rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n    rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n    return true;\n}\n\nfunction returnFalse() {\n    return false;\n}\n\n// Support: IE <=9 only\n// See #13393 for more info\nfunction safeActiveElement() {\n    try {\n        return document.activeElement;\n    } catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n    var origFn, type;\n\n    // Types can be a map of types/handlers\n    if ( typeof types === \"object\" ) {\n\n        // ( types-Object, selector, data )\n        if ( typeof selector !== \"string\" ) {\n\n            // ( types-Object, data )\n            data = data || selector;\n            selector = undefined;\n        }\n        for ( type in types ) {\n            on( elem, type, selector, data, types[ type ], one );\n        }\n        return elem;\n    }\n\n    if ( data == null && fn == null ) {\n\n        // ( types, fn )\n        fn = selector;\n        data = selector = undefined;\n    } else if ( fn == null ) {\n        if ( typeof selector === \"string\" ) {\n\n            // ( types, selector, fn )\n            fn = data;\n            data = undefined;\n        } else {\n\n            // ( types, data, fn )\n            fn = data;\n            data = selector;\n            selector = undefined;\n        }\n    }\n    if ( fn === false ) {\n        fn = returnFalse;\n    } else if ( !fn ) {\n        return elem;\n    }\n\n    if ( one === 1 ) {\n        origFn = fn;\n        fn = function( event ) {\n\n            // Can use an empty set, since event contains the info\n            jQuery().off( event );\n            return origFn.apply( this, arguments );\n        };\n\n        // Use same guid so caller can remove using origFn\n        fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n    }\n    return elem.each( function() {\n        jQuery.event.add( this, types, fn, data, selector );\n    } );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n    global: {},\n\n    add: function( elem, types, handler, data, selector ) {\n\n        var handleObjIn, eventHandle, tmp,\n            events, t, handleObj,\n            special, handlers, type, namespaces, origType,\n            elemData = dataPriv.get( elem );\n\n        // Don't attach events to noData or text/comment nodes (but allow plain objects)\n        if ( !elemData ) {\n            return;\n        }\n\n        // Caller can pass in an object of custom data in lieu of the handler\n        if ( handler.handler ) {\n            handleObjIn = handler;\n            handler = handleObjIn.handler;\n            selector = handleObjIn.selector;\n        }\n\n        // Ensure that invalid selectors throw exceptions at attach time\n        // Evaluate against documentElement in case elem is a non-element node (e.g., document)\n        if ( selector ) {\n            jQuery.find.matchesSelector( documentElement, selector );\n        }\n\n        // Make sure that the handler has a unique ID, used to find/remove it later\n        if ( !handler.guid ) {\n            handler.guid = jQuery.guid++;\n        }\n\n        // Init the element's event structure and main handler, if this is the first\n        if ( !( events = elemData.events ) ) {\n            events = elemData.events = {};\n        }\n        if ( !( eventHandle = elemData.handle ) ) {\n            eventHandle = elemData.handle = function( e ) {\n\n                // Discard the second event of a jQuery.event.trigger() and\n                // when an event is called after a page has unloaded\n                return typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n                    jQuery.event.dispatch.apply( elem, arguments ) : undefined;\n            };\n        }\n\n        // Handle multiple events separated by a space\n        types = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n        t = types.length;\n        while ( t-- ) {\n            tmp = rtypenamespace.exec( types[ t ] ) || [];\n            type = origType = tmp[ 1 ];\n            namespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n            // There *must* be a type, no attaching namespace-only handlers\n            if ( !type ) {\n                continue;\n            }\n\n            // If event changes its type, use the special event handlers for the changed type\n            special = jQuery.event.special[ type ] || {};\n\n            // If selector defined, determine special event api type, otherwise given type\n            type = ( selector ? special.delegateType : special.bindType ) || type;\n\n            // Update special based on newly reset type\n            special = jQuery.event.special[ type ] || {};\n\n            // handleObj is passed to all event handlers\n            handleObj = jQuery.extend( {\n                type: type,\n                origType: origType,\n                data: data,\n                handler: handler,\n                guid: handler.guid,\n                selector: selector,\n                needsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n                namespace: namespaces.join( \".\" )\n            }, handleObjIn );\n\n            // Init the event handler queue if we're the first\n            if ( !( handlers = events[ type ] ) ) {\n                handlers = events[ type ] = [];\n                handlers.delegateCount = 0;\n\n                // Only use addEventListener if the special events handler returns false\n                if ( !special.setup ||\n                    special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n                    if ( elem.addEventListener ) {\n                        elem.addEventListener( type, eventHandle );\n                    }\n                }\n            }\n\n            if ( special.add ) {\n                special.add.call( elem, handleObj );\n\n                if ( !handleObj.handler.guid ) {\n                    handleObj.handler.guid = handler.guid;\n                }\n            }\n\n            // Add to the element's handler list, delegates in front\n            if ( selector ) {\n                handlers.splice( handlers.delegateCount++, 0, handleObj );\n            } else {\n                handlers.push( handleObj );\n            }\n\n            // Keep track of which events have ever been used, for event optimization\n            jQuery.event.global[ type ] = true;\n        }\n\n    },\n\n    // Detach an event or set of events from an element\n    remove: function( elem, types, handler, selector, mappedTypes ) {\n\n        var j, origCount, tmp,\n            events, t, handleObj,\n            special, handlers, type, namespaces, origType,\n            elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n        if ( !elemData || !( events = elemData.events ) ) {\n            return;\n        }\n\n        // Once for each type.namespace in types; type may be omitted\n        types = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n        t = types.length;\n        while ( t-- ) {\n            tmp = rtypenamespace.exec( types[ t ] ) || [];\n            type = origType = tmp[ 1 ];\n            namespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n            // Unbind all events (on this namespace, if provided) for the element\n            if ( !type ) {\n                for ( type in events ) {\n                    jQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n                }\n                continue;\n            }\n\n            special = jQuery.event.special[ type ] || {};\n            type = ( selector ? special.delegateType : special.bindType ) || type;\n            handlers = events[ type ] || [];\n            tmp = tmp[ 2 ] &&\n                new RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n            // Remove matching events\n            origCount = j = handlers.length;\n            while ( j-- ) {\n                handleObj = handlers[ j ];\n\n                if ( ( mappedTypes || origType === handleObj.origType ) &&\n                    ( !handler || handler.guid === handleObj.guid ) &&\n                    ( !tmp || tmp.test( handleObj.namespace ) ) &&\n                    ( !selector || selector === handleObj.selector ||\n                        selector === \"**\" && handleObj.selector ) ) {\n                    handlers.splice( j, 1 );\n\n                    if ( handleObj.selector ) {\n                        handlers.delegateCount--;\n                    }\n                    if ( special.remove ) {\n                        special.remove.call( elem, handleObj );\n                    }\n                }\n            }\n\n            // Remove generic event handler if we removed something and no more handlers exist\n            // (avoids potential for endless recursion during removal of special event handlers)\n            if ( origCount && !handlers.length ) {\n                if ( !special.teardown ||\n                    special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n                    jQuery.removeEvent( elem, type, elemData.handle );\n                }\n\n                delete events[ type ];\n            }\n        }\n\n        // Remove data and the expando if it's no longer used\n        if ( jQuery.isEmptyObject( events ) ) {\n            dataPriv.remove( elem, \"handle events\" );\n        }\n    },\n\n    dispatch: function( nativeEvent ) {\n\n        // Make a writable jQuery.Event from the native event object\n        var event = jQuery.event.fix( nativeEvent );\n\n        var i, j, ret, matched, handleObj, handlerQueue,\n            args = new Array( arguments.length ),\n            handlers = ( dataPriv.get( this, \"events\" ) || {} )[ event.type ] || [],\n            special = jQuery.event.special[ event.type ] || {};\n\n        // Use the fix-ed jQuery.Event rather than the (read-only) native event\n        args[ 0 ] = event;\n\n        for ( i = 1; i < arguments.length; i++ ) {\n            args[ i ] = arguments[ i ];\n        }\n\n        event.delegateTarget = this;\n\n        // Call the preDispatch hook for the mapped type, and let it bail if desired\n        if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n            return;\n        }\n\n        // Determine handlers\n        handlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n        // Run delegates first; they may want to stop propagation beneath us\n        i = 0;\n        while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n            event.currentTarget = matched.elem;\n\n            j = 0;\n            while ( ( handleObj = matched.handlers[ j++ ] ) &&\n                !event.isImmediatePropagationStopped() ) {\n\n                // Triggered event must either 1) have no namespace, or 2) have namespace(s)\n                // a subset or equal to those in the bound event (both can have no namespace).\n                if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {\n\n                    event.handleObj = handleObj;\n                    event.data = handleObj.data;\n\n                    ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n                        handleObj.handler ).apply( matched.elem, args );\n\n                    if ( ret !== undefined ) {\n                        if ( ( event.result = ret ) === false ) {\n                            event.preventDefault();\n                            event.stopPropagation();\n                        }\n                    }\n                }\n            }\n        }\n\n        // Call the postDispatch hook for the mapped type\n        if ( special.postDispatch ) {\n            special.postDispatch.call( this, event );\n        }\n\n        return event.result;\n    },\n\n    handlers: function( event, handlers ) {\n        var i, handleObj, sel, matchedHandlers, matchedSelectors,\n            handlerQueue = [],\n            delegateCount = handlers.delegateCount,\n            cur = event.target;\n\n        // Find delegate handlers\n        if ( delegateCount &&\n\n            // Support: IE <=9\n            // Black-hole SVG <use> instance trees (trac-13180)\n            cur.nodeType &&\n\n            // Support: Firefox <=42\n            // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n            // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n            // Support: IE 11 only\n            // ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n            !( event.type === \"click\" && event.button >= 1 ) ) {\n\n            for ( ; cur !== this; cur = cur.parentNode || this ) {\n\n                // Don't check non-elements (#13208)\n                // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n                if ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n                    matchedHandlers = [];\n                    matchedSelectors = {};\n                    for ( i = 0; i < delegateCount; i++ ) {\n                        handleObj = handlers[ i ];\n\n                        // Don't conflict with Object.prototype properties (#13203)\n                        sel = handleObj.selector + \" \";\n\n                        if ( matchedSelectors[ sel ] === undefined ) {\n                            matchedSelectors[ sel ] = handleObj.needsContext ?\n                                jQuery( sel, this ).index( cur ) > -1 :\n                                jQuery.find( sel, this, null, [ cur ] ).length;\n                        }\n                        if ( matchedSelectors[ sel ] ) {\n                            matchedHandlers.push( handleObj );\n                        }\n                    }\n                    if ( matchedHandlers.length ) {\n                        handlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n                    }\n                }\n            }\n        }\n\n        // Add the remaining (directly-bound) handlers\n        cur = this;\n        if ( delegateCount < handlers.length ) {\n            handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n        }\n\n        return handlerQueue;\n    },\n\n    addProp: function( name, hook ) {\n        Object.defineProperty( jQuery.Event.prototype, name, {\n            enumerable: true,\n            configurable: true,\n\n            get: jQuery.isFunction( hook ) ?\n                function() {\n                    if ( this.originalEvent ) {\n                            return hook( this.originalEvent );\n                    }\n                } :\n                function() {\n                    if ( this.originalEvent ) {\n                            return this.originalEvent[ name ];\n                    }\n                },\n\n            set: function( value ) {\n                Object.defineProperty( this, name, {\n                    enumerable: true,\n                    configurable: true,\n                    writable: true,\n                    value: value\n                } );\n            }\n        } );\n    },\n\n    fix: function( originalEvent ) {\n        return originalEvent[ jQuery.expando ] ?\n            originalEvent :\n            new jQuery.Event( originalEvent );\n    },\n\n    special: {\n        load: {\n\n            // Prevent triggered image.load events from bubbling to window.load\n            noBubble: true\n        },\n        focus: {\n\n            // Fire native event if possible so blur/focus sequence is correct\n            trigger: function() {\n                if ( this !== safeActiveElement() && this.focus ) {\n                    this.focus();\n                    return false;\n                }\n            },\n            delegateType: \"focusin\"\n        },\n        blur: {\n            trigger: function() {\n                if ( this === safeActiveElement() && this.blur ) {\n                    this.blur();\n                    return false;\n                }\n            },\n            delegateType: \"focusout\"\n        },\n        click: {\n\n            // For checkbox, fire native event so checked state will be right\n            trigger: function() {\n                if ( this.type === \"checkbox\" && this.click && jQuery.nodeName( this, \"input\" ) ) {\n                    this.click();\n                    return false;\n                }\n            },\n\n            // For cross-browser consistency, don't fire native .click() on links\n            _default: function( event ) {\n                return jQuery.nodeName( event.target, \"a\" );\n            }\n        },\n\n        beforeunload: {\n            postDispatch: function( event ) {\n\n                // Support: Firefox 20+\n                // Firefox doesn't alert if the returnValue field is not set.\n                if ( event.result !== undefined && event.originalEvent ) {\n                    event.originalEvent.returnValue = event.result;\n                }\n            }\n        }\n    }\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n    // This \"if\" is needed for plain objects\n    if ( elem.removeEventListener ) {\n        elem.removeEventListener( type, handle );\n    }\n};\n\njQuery.Event = function( src, props ) {\n\n    // Allow instantiation without the 'new' keyword\n    if ( !( this instanceof jQuery.Event ) ) {\n        return new jQuery.Event( src, props );\n    }\n\n    // Event object\n    if ( src && src.type ) {\n        this.originalEvent = src;\n        this.type = src.type;\n\n        // Events bubbling up the document may have been marked as prevented\n        // by a handler lower down the tree; reflect the correct value.\n        this.isDefaultPrevented = src.defaultPrevented ||\n                src.defaultPrevented === undefined &&\n\n                // Support: Android <=2.3 only\n                src.returnValue === false ?\n            returnTrue :\n            returnFalse;\n\n        // Create target properties\n        // Support: Safari <=6 - 7 only\n        // Target should not be a text node (#504, #13143)\n        this.target = ( src.target && src.target.nodeType === 3 ) ?\n            src.target.parentNode :\n            src.target;\n\n        this.currentTarget = src.currentTarget;\n        this.relatedTarget = src.relatedTarget;\n\n    // Event type\n    } else {\n        this.type = src;\n    }\n\n    // Put explicitly provided properties onto the event object\n    if ( props ) {\n        jQuery.extend( this, props );\n    }\n\n    // Create a timestamp if incoming event doesn't have one\n    this.timeStamp = src && src.timeStamp || jQuery.now();\n\n    // Mark it as fixed\n    this[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n    constructor: jQuery.Event,\n    isDefaultPrevented: returnFalse,\n    isPropagationStopped: returnFalse,\n    isImmediatePropagationStopped: returnFalse,\n    isSimulated: false,\n\n    preventDefault: function() {\n        var e = this.originalEvent;\n\n        this.isDefaultPrevented = returnTrue;\n\n        if ( e && !this.isSimulated ) {\n            e.preventDefault();\n        }\n    },\n    stopPropagation: function() {\n        var e = this.originalEvent;\n\n        this.isPropagationStopped = returnTrue;\n\n        if ( e && !this.isSimulated ) {\n            e.stopPropagation();\n        }\n    },\n    stopImmediatePropagation: function() {\n        var e = this.originalEvent;\n\n        this.isImmediatePropagationStopped = returnTrue;\n\n        if ( e && !this.isSimulated ) {\n            e.stopImmediatePropagation();\n        }\n\n        this.stopPropagation();\n    }\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n    altKey: true,\n    bubbles: true,\n    cancelable: true,\n    changedTouches: true,\n    ctrlKey: true,\n    detail: true,\n    eventPhase: true,\n    metaKey: true,\n    pageX: true,\n    pageY: true,\n    shiftKey: true,\n    view: true,\n    \"char\": true,\n    charCode: true,\n    key: true,\n    keyCode: true,\n    button: true,\n    buttons: true,\n    clientX: true,\n    clientY: true,\n    offsetX: true,\n    offsetY: true,\n    pointerId: true,\n    pointerType: true,\n    screenX: true,\n    screenY: true,\n    targetTouches: true,\n    toElement: true,\n    touches: true,\n\n    which: function( event ) {\n        var button = event.button;\n\n        // Add which for key events\n        if ( event.which == null && rkeyEvent.test( event.type ) ) {\n            return event.charCode != null ? event.charCode : event.keyCode;\n        }\n\n        // Add which for click: 1 === left; 2 === middle; 3 === right\n        if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n            if ( button & 1 ) {\n                return 1;\n            }\n\n            if ( button & 2 ) {\n                return 3;\n            }\n\n            if ( button & 4 ) {\n                return 2;\n            }\n\n            return 0;\n        }\n\n        return event.which;\n    }\n}, jQuery.event.addProp );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n    mouseenter: \"mouseover\",\n    mouseleave: \"mouseout\",\n    pointerenter: \"pointerover\",\n    pointerleave: \"pointerout\"\n}, function( orig, fix ) {\n    jQuery.event.special[ orig ] = {\n        delegateType: fix,\n        bindType: fix,\n\n        handle: function( event ) {\n            var ret,\n                target = this,\n                related = event.relatedTarget,\n                handleObj = event.handleObj;\n\n            // For mouseenter/leave call the handler if related is outside the target.\n            // NB: No relatedTarget if the mouse left/entered the browser window\n            if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n                event.type = handleObj.origType;\n                ret = handleObj.handler.apply( this, arguments );\n                event.type = fix;\n            }\n            return ret;\n        }\n    };\n} );\n\njQuery.fn.extend( {\n\n    on: function( types, selector, data, fn ) {\n        return on( this, types, selector, data, fn );\n    },\n    one: function( types, selector, data, fn ) {\n        return on( this, types, selector, data, fn, 1 );\n    },\n    off: function( types, selector, fn ) {\n        var handleObj, type;\n        if ( types && types.preventDefault && types.handleObj ) {\n\n            // ( event )  dispatched jQuery.Event\n            handleObj = types.handleObj;\n            jQuery( types.delegateTarget ).off(\n                handleObj.namespace ?\n                    handleObj.origType + \".\" + handleObj.namespace :\n                    handleObj.origType,\n                handleObj.selector,\n                handleObj.handler\n            );\n            return this;\n        }\n        if ( typeof types === \"object\" ) {\n\n            // ( types-object [, selector] )\n            for ( type in types ) {\n                this.off( type, selector, types[ type ] );\n            }\n            return this;\n        }\n        if ( selector === false || typeof selector === \"function\" ) {\n\n            // ( types [, fn] )\n            fn = selector;\n            selector = undefined;\n        }\n        if ( fn === false ) {\n            fn = returnFalse;\n        }\n        return this.each( function() {\n            jQuery.event.remove( this, types, fn, selector );\n        } );\n    }\n} );\n\n\nvar\n\n    /* eslint-disable max-len */\n\n    // See https://github.com/eslint/eslint/issues/3229\n    rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,\n\n    /* eslint-enable */\n\n    // Support: IE <=10 - 11, Edge 12 - 13\n    // In IE/Edge using regex groups here causes severe slowdowns.\n    // See https://connect.microsoft.com/IE/feedback/details/1736512/\n    rnoInnerhtml = /<script|<style|<link/i,\n\n    // checked=\"checked\" or checked\n    rchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n    rscriptTypeMasked = /^true\\/(.*)/,\n    rcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\nfunction manipulationTarget( elem, content ) {\n    if ( jQuery.nodeName( elem, \"table\" ) &&\n        jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n        return elem.getElementsByTagName( \"tbody\" )[ 0 ] || elem;\n    }\n\n    return elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n    elem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n    return elem;\n}\nfunction restoreScript( elem ) {\n    var match = rscriptTypeMasked.exec( elem.type );\n\n    if ( match ) {\n        elem.type = match[ 1 ];\n    } else {\n        elem.removeAttribute( \"type\" );\n    }\n\n    return elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n    var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n    if ( dest.nodeType !== 1 ) {\n        return;\n    }\n\n    // 1. Copy private data: events, handlers, etc.\n    if ( dataPriv.hasData( src ) ) {\n        pdataOld = dataPriv.access( src );\n        pdataCur = dataPriv.set( dest, pdataOld );\n        events = pdataOld.events;\n\n        if ( events ) {\n            delete pdataCur.handle;\n            pdataCur.events = {};\n\n            for ( type in events ) {\n                for ( i = 0, l = events[ type ].length; i < l; i++ ) {\n                    jQuery.event.add( dest, type, events[ type ][ i ] );\n                }\n            }\n        }\n    }\n\n    // 2. Copy user data\n    if ( dataUser.hasData( src ) ) {\n        udataOld = dataUser.access( src );\n        udataCur = jQuery.extend( {}, udataOld );\n\n        dataUser.set( dest, udataCur );\n    }\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n    var nodeName = dest.nodeName.toLowerCase();\n\n    // Fails to persist the checked state of a cloned checkbox or radio button.\n    if ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n        dest.checked = src.checked;\n\n    // Fails to return the selected option to the default selected state when cloning options\n    } else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n        dest.defaultValue = src.defaultValue;\n    }\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n    // Flatten any nested arrays\n    args = concat.apply( [], args );\n\n    var fragment, first, scripts, hasScripts, node, doc,\n        i = 0,\n        l = collection.length,\n        iNoClone = l - 1,\n        value = args[ 0 ],\n        isFunction = jQuery.isFunction( value );\n\n    // We can't cloneNode fragments that contain checked, in WebKit\n    if ( isFunction ||\n            ( l > 1 && typeof value === \"string\" &&\n                !support.checkClone && rchecked.test( value ) ) ) {\n        return collection.each( function( index ) {\n            var self = collection.eq( index );\n            if ( isFunction ) {\n                args[ 0 ] = value.call( this, index, self.html() );\n            }\n            domManip( self, args, callback, ignored );\n        } );\n    }\n\n    if ( l ) {\n        fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n        first = fragment.firstChild;\n\n        if ( fragment.childNodes.length === 1 ) {\n            fragment = first;\n        }\n\n        // Require either new content or an interest in ignored elements to invoke the callback\n        if ( first || ignored ) {\n            scripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n            hasScripts = scripts.length;\n\n            // Use the original fragment for the last item\n            // instead of the first because it can end up\n            // being emptied incorrectly in certain situations (#8070).\n            for ( ; i < l; i++ ) {\n                node = fragment;\n\n                if ( i !== iNoClone ) {\n                    node = jQuery.clone( node, true, true );\n\n                    // Keep references to cloned scripts for later restoration\n                    if ( hasScripts ) {\n\n                        // Support: Android <=4.0 only, PhantomJS 1 only\n                        // push.apply(_, arraylike) throws on ancient WebKit\n                        jQuery.merge( scripts, getAll( node, \"script\" ) );\n                    }\n                }\n\n                callback.call( collection[ i ], node, i );\n            }\n\n            if ( hasScripts ) {\n                doc = scripts[ scripts.length - 1 ].ownerDocument;\n\n                // Reenable scripts\n                jQuery.map( scripts, restoreScript );\n\n                // Evaluate executable scripts on first document insertion\n                for ( i = 0; i < hasScripts; i++ ) {\n                    node = scripts[ i ];\n                    if ( rscriptType.test( node.type || \"\" ) &&\n                        !dataPriv.access( node, \"globalEval\" ) &&\n                        jQuery.contains( doc, node ) ) {\n\n                        if ( node.src ) {\n\n                            // Optional AJAX dependency, but won't run scripts if not present\n                            if ( jQuery._evalUrl ) {\n                                jQuery._evalUrl( node.src );\n                            }\n                        } else {\n                            DOMEval( node.textContent.replace( rcleanScript, \"\" ), doc );\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    return collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n    var node,\n        nodes = selector ? jQuery.filter( selector, elem ) : elem,\n        i = 0;\n\n    for ( ; ( node = nodes[ i ] ) != null; i++ ) {\n        if ( !keepData && node.nodeType === 1 ) {\n            jQuery.cleanData( getAll( node ) );\n        }\n\n        if ( node.parentNode ) {\n            if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {\n                setGlobalEval( getAll( node, \"script\" ) );\n            }\n            node.parentNode.removeChild( node );\n        }\n    }\n\n    return elem;\n}\n\njQuery.extend( {\n    htmlPrefilter: function( html ) {\n        return html.replace( rxhtmlTag, \"<$1></$2>\" );\n    },\n\n    clone: function( elem, dataAndEvents, deepDataAndEvents ) {\n        var i, l, srcElements, destElements,\n            clone = elem.cloneNode( true ),\n            inPage = jQuery.contains( elem.ownerDocument, elem );\n\n        // Fix IE cloning issues\n        if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n                !jQuery.isXMLDoc( elem ) ) {\n\n            // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n            destElements = getAll( clone );\n            srcElements = getAll( elem );\n\n            for ( i = 0, l = srcElements.length; i < l; i++ ) {\n                fixInput( srcElements[ i ], destElements[ i ] );\n            }\n        }\n\n        // Copy the events from the original to the clone\n        if ( dataAndEvents ) {\n            if ( deepDataAndEvents ) {\n                srcElements = srcElements || getAll( elem );\n                destElements = destElements || getAll( clone );\n\n                for ( i = 0, l = srcElements.length; i < l; i++ ) {\n                    cloneCopyEvent( srcElements[ i ], destElements[ i ] );\n                }\n            } else {\n                cloneCopyEvent( elem, clone );\n            }\n        }\n\n        // Preserve script evaluation history\n        destElements = getAll( clone, \"script\" );\n        if ( destElements.length > 0 ) {\n            setGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n        }\n\n        // Return the cloned set\n        return clone;\n    },\n\n    cleanData: function( elems ) {\n        var data, elem, type,\n            special = jQuery.event.special,\n            i = 0;\n\n        for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n            if ( acceptData( elem ) ) {\n                if ( ( data = elem[ dataPriv.expando ] ) ) {\n                    if ( data.events ) {\n                        for ( type in data.events ) {\n                            if ( special[ type ] ) {\n                                jQuery.event.remove( elem, type );\n\n                            // This is a shortcut to avoid jQuery.event.remove's overhead\n                            } else {\n                                jQuery.removeEvent( elem, type, data.handle );\n                            }\n                        }\n                    }\n\n                    // Support: Chrome <=35 - 45+\n                    // Assign undefined instead of using delete, see Data#remove\n                    elem[ dataPriv.expando ] = undefined;\n                }\n                if ( elem[ dataUser.expando ] ) {\n\n                    // Support: Chrome <=35 - 45+\n                    // Assign undefined instead of using delete, see Data#remove\n                    elem[ dataUser.expando ] = undefined;\n                }\n            }\n        }\n    }\n} );\n\njQuery.fn.extend( {\n    detach: function( selector ) {\n        return remove( this, selector, true );\n    },\n\n    remove: function( selector ) {\n        return remove( this, selector );\n    },\n\n    text: function( value ) {\n        return access( this, function( value ) {\n            return value === undefined ?\n                jQuery.text( this ) :\n                this.empty().each( function() {\n                    if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n                        this.textContent = value;\n                    }\n                } );\n        }, null, value, arguments.length );\n    },\n\n    append: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n                var target = manipulationTarget( this, elem );\n                target.appendChild( elem );\n            }\n        } );\n    },\n\n    prepend: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n                var target = manipulationTarget( this, elem );\n                target.insertBefore( elem, target.firstChild );\n            }\n        } );\n    },\n\n    before: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.parentNode ) {\n                this.parentNode.insertBefore( elem, this );\n            }\n        } );\n    },\n\n    after: function() {\n        return domManip( this, arguments, function( elem ) {\n            if ( this.parentNode ) {\n                this.parentNode.insertBefore( elem, this.nextSibling );\n            }\n        } );\n    },\n\n    empty: function() {\n        var elem,\n            i = 0;\n\n        for ( ; ( elem = this[ i ] ) != null; i++ ) {\n            if ( elem.nodeType === 1 ) {\n\n                // Prevent memory leaks\n                jQuery.cleanData( getAll( elem, false ) );\n\n                // Remove any remaining nodes\n                elem.textContent = \"\";\n            }\n        }\n\n        return this;\n    },\n\n    clone: function( dataAndEvents, deepDataAndEvents ) {\n        dataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n        deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n        return this.map( function() {\n            return jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n        } );\n    },\n\n    html: function( value ) {\n        return access( this, function( value ) {\n            var elem = this[ 0 ] || {},\n                i = 0,\n                l = this.length;\n\n            if ( value === undefined && elem.nodeType === 1 ) {\n                return elem.innerHTML;\n            }\n\n            // See if we can take a shortcut and just use innerHTML\n            if ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n                !wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n                value = jQuery.htmlPrefilter( value );\n\n                try {\n                    for ( ; i < l; i++ ) {\n                        elem = this[ i ] || {};\n\n                        // Remove element nodes and prevent memory leaks\n                        if ( elem.nodeType === 1 ) {\n                            jQuery.cleanData( getAll( elem, false ) );\n                            elem.innerHTML = value;\n                        }\n                    }\n\n                    elem = 0;\n\n                // If using innerHTML throws an exception, use the fallback method\n                } catch ( e ) {}\n            }\n\n            if ( elem ) {\n                this.empty().append( value );\n            }\n        }, null, value, arguments.length );\n    },\n\n    replaceWith: function() {\n        var ignored = [];\n\n        // Make the changes, replacing each non-ignored context element with the new content\n        return domManip( this, arguments, function( elem ) {\n            var parent = this.parentNode;\n\n            if ( jQuery.inArray( this, ignored ) < 0 ) {\n                jQuery.cleanData( getAll( this ) );\n                if ( parent ) {\n                    parent.replaceChild( elem, this );\n                }\n            }\n\n        // Force callback invocation\n        }, ignored );\n    }\n} );\n\njQuery.each( {\n    appendTo: \"append\",\n    prependTo: \"prepend\",\n    insertBefore: \"before\",\n    insertAfter: \"after\",\n    replaceAll: \"replaceWith\"\n}, function( name, original ) {\n    jQuery.fn[ name ] = function( selector ) {\n        var elems,\n            ret = [],\n            insert = jQuery( selector ),\n            last = insert.length - 1,\n            i = 0;\n\n        for ( ; i <= last; i++ ) {\n            elems = i === last ? this : this.clone( true );\n            jQuery( insert[ i ] )[ original ]( elems );\n\n            // Support: Android <=4.0 only, PhantomJS 1 only\n            // .get() because push.apply(_, arraylike) throws on ancient WebKit\n            push.apply( ret, elems.get() );\n        }\n\n        return this.pushStack( ret );\n    };\n} );\nvar rmargin = ( /^margin/ );\n\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n        // Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n        // IE throws on elements created in popups\n        // FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n        var view = elem.ownerDocument.defaultView;\n\n        if ( !view || !view.opener ) {\n            view = window;\n        }\n\n        return view.getComputedStyle( elem );\n    };\n\n\n\n( function() {\n\n    // Executing both pixelPosition & boxSizingReliable tests require only one layout\n    // so they're executed at the same time to save the second computation.\n    function computeStyleTests() {\n\n        // This is a singleton, we need to execute it only once\n        if ( !div ) {\n            return;\n        }\n\n        div.style.cssText =\n            \"box-sizing:border-box;\" +\n            \"position:relative;display:block;\" +\n            \"margin:auto;border:1px;padding:1px;\" +\n            \"top:1%;width:50%\";\n        div.innerHTML = \"\";\n        documentElement.appendChild( container );\n\n        var divStyle = window.getComputedStyle( div );\n        pixelPositionVal = divStyle.top !== \"1%\";\n\n        // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n        reliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n        boxSizingReliableVal = divStyle.width === \"4px\";\n\n        // Support: Android 4.0 - 4.3 only\n        // Some styles come back with percentage values, even though they shouldn't\n        div.style.marginRight = \"50%\";\n        pixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n        documentElement.removeChild( container );\n\n        // Nullify the div so it wouldn't be stored in the memory and\n        // it will also be a sign that checks already performed\n        div = null;\n    }\n\n    var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,\n        container = document.createElement( \"div\" ),\n        div = document.createElement( \"div\" );\n\n    // Finish early in limited (non-browser) environments\n    if ( !div.style ) {\n        return;\n    }\n\n    // Support: IE <=9 - 11 only\n    // Style of cloned element affects source element cloned (#8908)\n    div.style.backgroundClip = \"content-box\";\n    div.cloneNode( true ).style.backgroundClip = \"\";\n    support.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n    container.style.cssText = \"border:0;width:8px;height:0;top:0;left:-9999px;\" +\n        \"padding:0;margin-top:1px;position:absolute\";\n    container.appendChild( div );\n\n    jQuery.extend( support, {\n        pixelPosition: function() {\n            computeStyleTests();\n            return pixelPositionVal;\n        },\n        boxSizingReliable: function() {\n            computeStyleTests();\n            return boxSizingReliableVal;\n        },\n        pixelMarginRight: function() {\n            computeStyleTests();\n            return pixelMarginRightVal;\n        },\n        reliableMarginLeft: function() {\n            computeStyleTests();\n            return reliableMarginLeftVal;\n        }\n    } );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n    var width, minWidth, maxWidth, ret,\n        style = elem.style;\n\n    computed = computed || getStyles( elem );\n\n    // Support: IE <=9 only\n    // getPropertyValue is only needed for .css('filter') (#12537)\n    if ( computed ) {\n        ret = computed.getPropertyValue( name ) || computed[ name ];\n\n        if ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n            ret = jQuery.style( elem, name );\n        }\n\n        // A tribute to the \"awesome hack by Dean Edwards\"\n        // Android Browser returns percentage for some values,\n        // but width seems to be reliably pixels.\n        // This is against the CSSOM draft spec:\n        // https://drafts.csswg.org/cssom/#resolved-values\n        if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n            // Remember the original values\n            width = style.width;\n            minWidth = style.minWidth;\n            maxWidth = style.maxWidth;\n\n            // Put in the new values to get a computed value out\n            style.minWidth = style.maxWidth = style.width = ret;\n            ret = computed.width;\n\n            // Revert the changed values\n            style.width = width;\n            style.minWidth = minWidth;\n            style.maxWidth = maxWidth;\n        }\n    }\n\n    return ret !== undefined ?\n\n        // Support: IE <=9 - 11 only\n        // IE returns zIndex value as an integer.\n        ret + \"\" :\n        ret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n    // Define the hook, we'll check on the first run if it's really needed.\n    return {\n        get: function() {\n            if ( conditionFn() ) {\n\n                // Hook not needed (or it's not possible to use it due\n                // to missing dependency), remove it.\n                delete this.get;\n                return;\n            }\n\n            // Hook needed; redefine it so that the support test is not executed again.\n            return ( this.get = hookFn ).apply( this, arguments );\n        }\n    };\n}\n\n\nvar\n\n    // Swappable if display is none or starts with table\n    // except \"table\", \"table-cell\", or \"table-caption\"\n    // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n    rdisplayswap = /^(none|table(?!-c[ea]).+)/,\n    cssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n    cssNormalTransform = {\n        letterSpacing: \"0\",\n        fontWeight: \"400\"\n    },\n\n    cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n    emptyStyle = document.createElement( \"div\" ).style;\n\n// Return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( name ) {\n\n    // Shortcut for names that are not vendor prefixed\n    if ( name in emptyStyle ) {\n        return name;\n    }\n\n    // Check for vendor prefixed names\n    var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n        i = cssPrefixes.length;\n\n    while ( i-- ) {\n        name = cssPrefixes[ i ] + capName;\n        if ( name in emptyStyle ) {\n            return name;\n        }\n    }\n}\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\n    // Any relative (+/-) values have already been\n    // normalized at this point\n    var matches = rcssNum.exec( value );\n    return matches ?\n\n        // Guard against undefined \"subtract\", e.g., when used as in cssHooks\n        Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n        value;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n    var i,\n        val = 0;\n\n    // If we already have the right measurement, avoid augmentation\n    if ( extra === ( isBorderBox ? \"border\" : \"content\" ) ) {\n        i = 4;\n\n    // Otherwise initialize for horizontal or vertical properties\n    } else {\n        i = name === \"width\" ? 1 : 0;\n    }\n\n    for ( ; i < 4; i += 2 ) {\n\n        // Both box models exclude margin, so add it if we want it\n        if ( extra === \"margin\" ) {\n            val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n        }\n\n        if ( isBorderBox ) {\n\n            // border-box includes padding, so remove it if we want content\n            if ( extra === \"content\" ) {\n                val -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n            }\n\n            // At this point, extra isn't border nor margin, so remove border\n            if ( extra !== \"margin\" ) {\n                val -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n            }\n        } else {\n\n            // At this point, extra isn't content, so add padding\n            val += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n            // At this point, extra isn't content nor padding, so add border\n            if ( extra !== \"padding\" ) {\n                val += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n            }\n        }\n    }\n\n    return val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n    // Start with offset property, which is equivalent to the border-box value\n    var val,\n        valueIsBorderBox = true,\n        styles = getStyles( elem ),\n        isBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n    // Support: IE <=11 only\n    // Running getBoundingClientRect on a disconnected node\n    // in IE throws an error.\n    if ( elem.getClientRects().length ) {\n        val = elem.getBoundingClientRect()[ name ];\n    }\n\n    // Some non-html elements return undefined for offsetWidth, so check for null/undefined\n    // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n    // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n    if ( val <= 0 || val == null ) {\n\n        // Fall back to computed then uncomputed css if necessary\n        val = curCSS( elem, name, styles );\n        if ( val < 0 || val == null ) {\n            val = elem.style[ name ];\n        }\n\n        // Computed unit is not pixels. Stop here and return.\n        if ( rnumnonpx.test( val ) ) {\n            return val;\n        }\n\n        // Check for style in case a browser which returns unreliable values\n        // for getComputedStyle silently falls back to the reliable elem.style\n        valueIsBorderBox = isBorderBox &&\n            ( support.boxSizingReliable() || val === elem.style[ name ] );\n\n        // Normalize \"\", auto, and prepare for extra\n        val = parseFloat( val ) || 0;\n    }\n\n    // Use the active box-sizing model to add/subtract irrelevant styles\n    return ( val +\n        augmentWidthOrHeight(\n            elem,\n            name,\n            extra || ( isBorderBox ? \"border\" : \"content\" ),\n            valueIsBorderBox,\n            styles\n        )\n    ) + \"px\";\n}\n\njQuery.extend( {\n\n    // Add in style property hooks for overriding the default\n    // behavior of getting and setting a style property\n    cssHooks: {\n        opacity: {\n            get: function( elem, computed ) {\n                if ( computed ) {\n\n                    // We should always get a number back from opacity\n                    var ret = curCSS( elem, \"opacity\" );\n                    return ret === \"\" ? \"1\" : ret;\n                }\n            }\n        }\n    },\n\n    // Don't automatically add \"px\" to these possibly-unitless properties\n    cssNumber: {\n        \"animationIterationCount\": true,\n        \"columnCount\": true,\n        \"fillOpacity\": true,\n        \"flexGrow\": true,\n        \"flexShrink\": true,\n        \"fontWeight\": true,\n        \"lineHeight\": true,\n        \"opacity\": true,\n        \"order\": true,\n        \"orphans\": true,\n        \"widows\": true,\n        \"zIndex\": true,\n        \"zoom\": true\n    },\n\n    // Add in properties whose names you wish to fix before\n    // setting or getting the value\n    cssProps: {\n        \"float\": \"cssFloat\"\n    },\n\n    // Get and set the style property on a DOM Node\n    style: function( elem, name, value, extra ) {\n\n        // Don't set styles on text and comment nodes\n        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n            return;\n        }\n\n        // Make sure that we're working with the right name\n        var ret, type, hooks,\n            origName = jQuery.camelCase( name ),\n            style = elem.style;\n\n        name = jQuery.cssProps[ origName ] ||\n            ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );\n\n        // Gets hook for the prefixed version, then unprefixed version\n        hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n        // Check if we're setting a value\n        if ( value !== undefined ) {\n            type = typeof value;\n\n            // Convert \"+=\" or \"-=\" to relative numbers (#7345)\n            if ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n                value = adjustCSS( elem, name, ret );\n\n                // Fixes bug #9237\n                type = \"number\";\n            }\n\n            // Make sure that null and NaN values aren't set (#7116)\n            if ( value == null || value !== value ) {\n                return;\n            }\n\n            // If a number was passed in, add the unit (except for certain CSS properties)\n            if ( type === \"number\" ) {\n                value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n            }\n\n            // background-* props affect original clone's values\n            if ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n                style[ name ] = \"inherit\";\n            }\n\n            // If a hook was provided, use that value, otherwise just set the specified value\n            if ( !hooks || !( \"set\" in hooks ) ||\n                ( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n                style[ name ] = value;\n            }\n\n        } else {\n\n            // If a hook was provided get the non-computed value from there\n            if ( hooks && \"get\" in hooks &&\n                ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n                return ret;\n            }\n\n            // Otherwise just get the value from the style object\n            return style[ name ];\n        }\n    },\n\n    css: function( elem, name, extra, styles ) {\n        var val, num, hooks,\n            origName = jQuery.camelCase( name );\n\n        // Make sure that we're working with the right name\n        name = jQuery.cssProps[ origName ] ||\n            ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );\n\n        // Try prefixed name followed by the unprefixed name\n        hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n        // If a hook was provided get the computed value from there\n        if ( hooks && \"get\" in hooks ) {\n            val = hooks.get( elem, true, extra );\n        }\n\n        // Otherwise, if a way to get the computed value exists, use that\n        if ( val === undefined ) {\n            val = curCSS( elem, name, styles );\n        }\n\n        // Convert \"normal\" to computed value\n        if ( val === \"normal\" && name in cssNormalTransform ) {\n            val = cssNormalTransform[ name ];\n        }\n\n        // Make numeric if forced or a qualifier was provided and val looks numeric\n        if ( extra === \"\" || extra ) {\n            num = parseFloat( val );\n            return extra === true || isFinite( num ) ? num || 0 : val;\n        }\n        return val;\n    }\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( i, name ) {\n    jQuery.cssHooks[ name ] = {\n        get: function( elem, computed, extra ) {\n            if ( computed ) {\n\n                // Certain elements can have dimension info if we invisibly show them\n                // but it must have a current display style that would benefit\n                return rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n                    // Support: Safari 8+\n                    // Table columns in Safari have non-zero offsetWidth & zero\n                    // getBoundingClientRect().width unless display is changed.\n                    // Support: IE <=11 only\n                    // Running getBoundingClientRect on a disconnected node\n                    // in IE throws an error.\n                    ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n                        swap( elem, cssShow, function() {\n                            return getWidthOrHeight( elem, name, extra );\n                        } ) :\n                        getWidthOrHeight( elem, name, extra );\n            }\n        },\n\n        set: function( elem, value, extra ) {\n            var matches,\n                styles = extra && getStyles( elem ),\n                subtract = extra && augmentWidthOrHeight(\n                    elem,\n                    name,\n                    extra,\n                    jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n                    styles\n                );\n\n            // Convert to pixels if value adjustment is needed\n            if ( subtract && ( matches = rcssNum.exec( value ) ) &&\n                ( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n                elem.style[ name ] = value;\n                value = jQuery.css( elem, name );\n            }\n\n            return setPositiveNumber( elem, value, subtract );\n        }\n    };\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n    function( elem, computed ) {\n        if ( computed ) {\n            return ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n                elem.getBoundingClientRect().left -\n                    swap( elem, { marginLeft: 0 }, function() {\n                        return elem.getBoundingClientRect().left;\n                    } )\n                ) + \"px\";\n        }\n    }\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n    margin: \"\",\n    padding: \"\",\n    border: \"Width\"\n}, function( prefix, suffix ) {\n    jQuery.cssHooks[ prefix + suffix ] = {\n        expand: function( value ) {\n            var i = 0,\n                expanded = {},\n\n                // Assumes a single number if not a string\n                parts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n            for ( ; i < 4; i++ ) {\n                expanded[ prefix + cssExpand[ i ] + suffix ] =\n                    parts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n            }\n\n            return expanded;\n        }\n    };\n\n    if ( !rmargin.test( prefix ) ) {\n        jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n    }\n} );\n\njQuery.fn.extend( {\n    css: function( name, value ) {\n        return access( this, function( elem, name, value ) {\n            var styles, len,\n                map = {},\n                i = 0;\n\n            if ( jQuery.isArray( name ) ) {\n                styles = getStyles( elem );\n                len = name.length;\n\n                for ( ; i < len; i++ ) {\n                    map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n                }\n\n                return map;\n            }\n\n            return value !== undefined ?\n                jQuery.style( elem, name, value ) :\n                jQuery.css( elem, name );\n        }, name, value, arguments.length > 1 );\n    }\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n    return new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n    constructor: Tween,\n    init: function( elem, options, prop, end, easing, unit ) {\n        this.elem = elem;\n        this.prop = prop;\n        this.easing = easing || jQuery.easing._default;\n        this.options = options;\n        this.start = this.now = this.cur();\n        this.end = end;\n        this.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n    },\n    cur: function() {\n        var hooks = Tween.propHooks[ this.prop ];\n\n        return hooks && hooks.get ?\n            hooks.get( this ) :\n            Tween.propHooks._default.get( this );\n    },\n    run: function( percent ) {\n        var eased,\n            hooks = Tween.propHooks[ this.prop ];\n\n        if ( this.options.duration ) {\n            this.pos = eased = jQuery.easing[ this.easing ](\n                percent, this.options.duration * percent, 0, 1, this.options.duration\n            );\n        } else {\n            this.pos = eased = percent;\n        }\n        this.now = ( this.end - this.start ) * eased + this.start;\n\n        if ( this.options.step ) {\n            this.options.step.call( this.elem, this.now, this );\n        }\n\n        if ( hooks && hooks.set ) {\n            hooks.set( this );\n        } else {\n            Tween.propHooks._default.set( this );\n        }\n        return this;\n    }\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n    _default: {\n        get: function( tween ) {\n            var result;\n\n            // Use a property on the element directly when it is not a DOM element,\n            // or when there is no matching style property that exists.\n            if ( tween.elem.nodeType !== 1 ||\n                tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n                return tween.elem[ tween.prop ];\n            }\n\n            // Passing an empty string as a 3rd parameter to .css will automatically\n            // attempt a parseFloat and fallback to a string if the parse fails.\n            // Simple values such as \"10px\" are parsed to Float;\n            // complex values such as \"rotate(1rad)\" are returned as-is.\n            result = jQuery.css( tween.elem, tween.prop, \"\" );\n\n            // Empty strings, null, undefined and \"auto\" are converted to 0.\n            return !result || result === \"auto\" ? 0 : result;\n        },\n        set: function( tween ) {\n\n            // Use step hook for back compat.\n            // Use cssHook if its there.\n            // Use .style if available and use plain properties where available.\n            if ( jQuery.fx.step[ tween.prop ] ) {\n                jQuery.fx.step[ tween.prop ]( tween );\n            } else if ( tween.elem.nodeType === 1 &&\n                ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||\n                    jQuery.cssHooks[ tween.prop ] ) ) {\n                jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n            } else {\n                tween.elem[ tween.prop ] = tween.now;\n            }\n        }\n    }\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n    set: function( tween ) {\n        if ( tween.elem.nodeType && tween.elem.parentNode ) {\n            tween.elem[ tween.prop ] = tween.now;\n        }\n    }\n};\n\njQuery.easing = {\n    linear: function( p ) {\n        return p;\n    },\n    swing: function( p ) {\n        return 0.5 - Math.cos( p * Math.PI ) / 2;\n    },\n    _default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n    fxNow, timerId,\n    rfxtypes = /^(?:toggle|show|hide)$/,\n    rrun = /queueHooks$/;\n\nfunction raf() {\n    if ( timerId ) {\n        window.requestAnimationFrame( raf );\n        jQuery.fx.tick();\n    }\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n    window.setTimeout( function() {\n        fxNow = undefined;\n    } );\n    return ( fxNow = jQuery.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n    var which,\n        i = 0,\n        attrs = { height: type };\n\n    // If we include width, step value is 1 to do all cssExpand values,\n    // otherwise step value is 2 to skip over Left and Right\n    includeWidth = includeWidth ? 1 : 0;\n    for ( ; i < 4; i += 2 - includeWidth ) {\n        which = cssExpand[ i ];\n        attrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n    }\n\n    if ( includeWidth ) {\n        attrs.opacity = attrs.width = type;\n    }\n\n    return attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n    var tween,\n        collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n        index = 0,\n        length = collection.length;\n    for ( ; index < length; index++ ) {\n        if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n            // We're done with this property\n            return tween;\n        }\n    }\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n    var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n        isBox = \"width\" in props || \"height\" in props,\n        anim = this,\n        orig = {},\n        style = elem.style,\n        hidden = elem.nodeType && isHiddenWithinTree( elem ),\n        dataShow = dataPriv.get( elem, \"fxshow\" );\n\n    // Queue-skipping animations hijack the fx hooks\n    if ( !opts.queue ) {\n        hooks = jQuery._queueHooks( elem, \"fx\" );\n        if ( hooks.unqueued == null ) {\n            hooks.unqueued = 0;\n            oldfire = hooks.empty.fire;\n            hooks.empty.fire = function() {\n                if ( !hooks.unqueued ) {\n                    oldfire();\n                }\n            };\n        }\n        hooks.unqueued++;\n\n        anim.always( function() {\n\n            // Ensure the complete handler is called before this completes\n            anim.always( function() {\n                hooks.unqueued--;\n                if ( !jQuery.queue( elem, \"fx\" ).length ) {\n                    hooks.empty.fire();\n                }\n            } );\n        } );\n    }\n\n    // Detect show/hide animations\n    for ( prop in props ) {\n        value = props[ prop ];\n        if ( rfxtypes.test( value ) ) {\n            delete props[ prop ];\n            toggle = toggle || value === \"toggle\";\n            if ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n                // Pretend to be hidden if this is a \"show\" and\n                // there is still data from a stopped show/hide\n                if ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n                    hidden = true;\n\n                // Ignore all other no-op show/hide data\n                } else {\n                    continue;\n                }\n            }\n            orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n        }\n    }\n\n    // Bail out if this is a no-op like .hide().hide()\n    propTween = !jQuery.isEmptyObject( props );\n    if ( !propTween && jQuery.isEmptyObject( orig ) ) {\n        return;\n    }\n\n    // Restrict \"overflow\" and \"display\" styles during box animations\n    if ( isBox && elem.nodeType === 1 ) {\n\n        // Support: IE <=9 - 11, Edge 12 - 13\n        // Record all 3 overflow attributes because IE does not infer the shorthand\n        // from identically-valued overflowX and overflowY\n        opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n        // Identify a display type, preferring old show/hide data over the CSS cascade\n        restoreDisplay = dataShow && dataShow.display;\n        if ( restoreDisplay == null ) {\n            restoreDisplay = dataPriv.get( elem, \"display\" );\n        }\n        display = jQuery.css( elem, \"display\" );\n        if ( display === \"none\" ) {\n            if ( restoreDisplay ) {\n                display = restoreDisplay;\n            } else {\n\n                // Get nonempty value(s) by temporarily forcing visibility\n                showHide( [ elem ], true );\n                restoreDisplay = elem.style.display || restoreDisplay;\n                display = jQuery.css( elem, \"display\" );\n                showHide( [ elem ] );\n            }\n        }\n\n        // Animate inline elements as inline-block\n        if ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n            if ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n                // Restore the original display value at the end of pure show/hide animations\n                if ( !propTween ) {\n                    anim.done( function() {\n                        style.display = restoreDisplay;\n                    } );\n                    if ( restoreDisplay == null ) {\n                        display = style.display;\n                        restoreDisplay = display === \"none\" ? \"\" : display;\n                    }\n                }\n                style.display = \"inline-block\";\n            }\n        }\n    }\n\n    if ( opts.overflow ) {\n        style.overflow = \"hidden\";\n        anim.always( function() {\n            style.overflow = opts.overflow[ 0 ];\n            style.overflowX = opts.overflow[ 1 ];\n            style.overflowY = opts.overflow[ 2 ];\n        } );\n    }\n\n    // Implement show/hide animations\n    propTween = false;\n    for ( prop in orig ) {\n\n        // General show/hide setup for this element animation\n        if ( !propTween ) {\n            if ( dataShow ) {\n                if ( \"hidden\" in dataShow ) {\n                    hidden = dataShow.hidden;\n                }\n            } else {\n                dataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n            }\n\n            // Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n            if ( toggle ) {\n                dataShow.hidden = !hidden;\n            }\n\n            // Show elements before animating them\n            if ( hidden ) {\n                showHide( [ elem ], true );\n            }\n\n            /* eslint-disable no-loop-func */\n\n            anim.done( function() {\n\n            /* eslint-enable no-loop-func */\n\n                // The final step of a \"hide\" animation is actually hiding the element\n                if ( !hidden ) {\n                    showHide( [ elem ] );\n                }\n                dataPriv.remove( elem, \"fxshow\" );\n                for ( prop in orig ) {\n                    jQuery.style( elem, prop, orig[ prop ] );\n                }\n            } );\n        }\n\n        // Per-property setup\n        propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n        if ( !( prop in dataShow ) ) {\n            dataShow[ prop ] = propTween.start;\n            if ( hidden ) {\n                propTween.end = propTween.start;\n                propTween.start = 0;\n            }\n        }\n    }\n}\n\nfunction propFilter( props, specialEasing ) {\n    var index, name, easing, value, hooks;\n\n    // camelCase, specialEasing and expand cssHook pass\n    for ( index in props ) {\n        name = jQuery.camelCase( index );\n        easing = specialEasing[ name ];\n        value = props[ index ];\n        if ( jQuery.isArray( value ) ) {\n            easing = value[ 1 ];\n            value = props[ index ] = value[ 0 ];\n        }\n\n        if ( index !== name ) {\n            props[ name ] = value;\n            delete props[ index ];\n        }\n\n        hooks = jQuery.cssHooks[ name ];\n        if ( hooks && \"expand\" in hooks ) {\n            value = hooks.expand( value );\n            delete props[ name ];\n\n            // Not quite $.extend, this won't overwrite existing keys.\n            // Reusing 'index' because we have the correct \"name\"\n            for ( index in value ) {\n                if ( !( index in props ) ) {\n                    props[ index ] = value[ index ];\n                    specialEasing[ index ] = easing;\n                }\n            }\n        } else {\n            specialEasing[ name ] = easing;\n        }\n    }\n}\n\nfunction Animation( elem, properties, options ) {\n    var result,\n        stopped,\n        index = 0,\n        length = Animation.prefilters.length,\n        deferred = jQuery.Deferred().always( function() {\n\n            // Don't match elem in the :animated selector\n            delete tick.elem;\n        } ),\n        tick = function() {\n            if ( stopped ) {\n                return false;\n            }\n            var currentTime = fxNow || createFxNow(),\n                remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n                // Support: Android 2.3 only\n                // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n                temp = remaining / animation.duration || 0,\n                percent = 1 - temp,\n                index = 0,\n                length = animation.tweens.length;\n\n            for ( ; index < length; index++ ) {\n                animation.tweens[ index ].run( percent );\n            }\n\n            deferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n            if ( percent < 1 && length ) {\n                return remaining;\n            } else {\n                deferred.resolveWith( elem, [ animation ] );\n                return false;\n            }\n        },\n        animation = deferred.promise( {\n            elem: elem,\n            props: jQuery.extend( {}, properties ),\n            opts: jQuery.extend( true, {\n                specialEasing: {},\n                easing: jQuery.easing._default\n            }, options ),\n            originalProperties: properties,\n            originalOptions: options,\n            startTime: fxNow || createFxNow(),\n            duration: options.duration,\n            tweens: [],\n            createTween: function( prop, end ) {\n                var tween = jQuery.Tween( elem, animation.opts, prop, end,\n                        animation.opts.specialEasing[ prop ] || animation.opts.easing );\n                animation.tweens.push( tween );\n                return tween;\n            },\n            stop: function( gotoEnd ) {\n                var index = 0,\n\n                    // If we are going to the end, we want to run all the tweens\n                    // otherwise we skip this part\n                    length = gotoEnd ? animation.tweens.length : 0;\n                if ( stopped ) {\n                    return this;\n                }\n                stopped = true;\n                for ( ; index < length; index++ ) {\n                    animation.tweens[ index ].run( 1 );\n                }\n\n                // Resolve when we played the last frame; otherwise, reject\n                if ( gotoEnd ) {\n                    deferred.notifyWith( elem, [ animation, 1, 0 ] );\n                    deferred.resolveWith( elem, [ animation, gotoEnd ] );\n                } else {\n                    deferred.rejectWith( elem, [ animation, gotoEnd ] );\n                }\n                return this;\n            }\n        } ),\n        props = animation.props;\n\n    propFilter( props, animation.opts.specialEasing );\n\n    for ( ; index < length; index++ ) {\n        result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n        if ( result ) {\n            if ( jQuery.isFunction( result.stop ) ) {\n                jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n                    jQuery.proxy( result.stop, result );\n            }\n            return result;\n        }\n    }\n\n    jQuery.map( props, createTween, animation );\n\n    if ( jQuery.isFunction( animation.opts.start ) ) {\n        animation.opts.start.call( elem, animation );\n    }\n\n    jQuery.fx.timer(\n        jQuery.extend( tick, {\n            elem: elem,\n            anim: animation,\n            queue: animation.opts.queue\n        } )\n    );\n\n    // attach callbacks from options\n    return animation.progress( animation.opts.progress )\n        .done( animation.opts.done, animation.opts.complete )\n        .fail( animation.opts.fail )\n        .always( animation.opts.always );\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n    tweeners: {\n        \"*\": [ function( prop, value ) {\n            var tween = this.createTween( prop, value );\n            adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n            return tween;\n        } ]\n    },\n\n    tweener: function( props, callback ) {\n        if ( jQuery.isFunction( props ) ) {\n            callback = props;\n            props = [ \"*\" ];\n        } else {\n            props = props.match( rnothtmlwhite );\n        }\n\n        var prop,\n            index = 0,\n            length = props.length;\n\n        for ( ; index < length; index++ ) {\n            prop = props[ index ];\n            Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n            Animation.tweeners[ prop ].unshift( callback );\n        }\n    },\n\n    prefilters: [ defaultPrefilter ],\n\n    prefilter: function( callback, prepend ) {\n        if ( prepend ) {\n            Animation.prefilters.unshift( callback );\n        } else {\n            Animation.prefilters.push( callback );\n        }\n    }\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n    var opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n        complete: fn || !fn && easing ||\n            jQuery.isFunction( speed ) && speed,\n        duration: speed,\n        easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n    };\n\n    // Go to the end state if fx are off or if document is hidden\n    if ( jQuery.fx.off || document.hidden ) {\n        opt.duration = 0;\n\n    } else {\n        if ( typeof opt.duration !== \"number\" ) {\n            if ( opt.duration in jQuery.fx.speeds ) {\n                opt.duration = jQuery.fx.speeds[ opt.duration ];\n\n            } else {\n                opt.duration = jQuery.fx.speeds._default;\n            }\n        }\n    }\n\n    // Normalize opt.queue - true/undefined/null -> \"fx\"\n    if ( opt.queue == null || opt.queue === true ) {\n        opt.queue = \"fx\";\n    }\n\n    // Queueing\n    opt.old = opt.complete;\n\n    opt.complete = function() {\n        if ( jQuery.isFunction( opt.old ) ) {\n            opt.old.call( this );\n        }\n\n        if ( opt.queue ) {\n            jQuery.dequeue( this, opt.queue );\n        }\n    };\n\n    return opt;\n};\n\njQuery.fn.extend( {\n    fadeTo: function( speed, to, easing, callback ) {\n\n        // Show any hidden elements after setting opacity to 0\n        return this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n            // Animate to the value specified\n            .end().animate( { opacity: to }, speed, easing, callback );\n    },\n    animate: function( prop, speed, easing, callback ) {\n        var empty = jQuery.isEmptyObject( prop ),\n            optall = jQuery.speed( speed, easing, callback ),\n            doAnimation = function() {\n\n                // Operate on a copy of prop so per-property easing won't be lost\n                var anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n                // Empty animations, or finishing resolves immediately\n                if ( empty || dataPriv.get( this, \"finish\" ) ) {\n                    anim.stop( true );\n                }\n            };\n            doAnimation.finish = doAnimation;\n\n        return empty || optall.queue === false ?\n            this.each( doAnimation ) :\n            this.queue( optall.queue, doAnimation );\n    },\n    stop: function( type, clearQueue, gotoEnd ) {\n        var stopQueue = function( hooks ) {\n            var stop = hooks.stop;\n            delete hooks.stop;\n            stop( gotoEnd );\n        };\n\n        if ( typeof type !== \"string\" ) {\n            gotoEnd = clearQueue;\n            clearQueue = type;\n            type = undefined;\n        }\n        if ( clearQueue && type !== false ) {\n            this.queue( type || \"fx\", [] );\n        }\n\n        return this.each( function() {\n            var dequeue = true,\n                index = type != null && type + \"queueHooks\",\n                timers = jQuery.timers,\n                data = dataPriv.get( this );\n\n            if ( index ) {\n                if ( data[ index ] && data[ index ].stop ) {\n                    stopQueue( data[ index ] );\n                }\n            } else {\n                for ( index in data ) {\n                    if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n                        stopQueue( data[ index ] );\n                    }\n                }\n            }\n\n            for ( index = timers.length; index--; ) {\n                if ( timers[ index ].elem === this &&\n                    ( type == null || timers[ index ].queue === type ) ) {\n\n                    timers[ index ].anim.stop( gotoEnd );\n                    dequeue = false;\n                    timers.splice( index, 1 );\n                }\n            }\n\n            // Start the next in the queue if the last step wasn't forced.\n            // Timers currently will call their complete callbacks, which\n            // will dequeue but only if they were gotoEnd.\n            if ( dequeue || !gotoEnd ) {\n                jQuery.dequeue( this, type );\n            }\n        } );\n    },\n    finish: function( type ) {\n        if ( type !== false ) {\n            type = type || \"fx\";\n        }\n        return this.each( function() {\n            var index,\n                data = dataPriv.get( this ),\n                queue = data[ type + \"queue\" ],\n                hooks = data[ type + \"queueHooks\" ],\n                timers = jQuery.timers,\n                length = queue ? queue.length : 0;\n\n            // Enable finishing flag on private data\n            data.finish = true;\n\n            // Empty the queue first\n            jQuery.queue( this, type, [] );\n\n            if ( hooks && hooks.stop ) {\n                hooks.stop.call( this, true );\n            }\n\n            // Look for any active animations, and finish them\n            for ( index = timers.length; index--; ) {\n                if ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n                    timers[ index ].anim.stop( true );\n                    timers.splice( index, 1 );\n                }\n            }\n\n            // Look for any animations in the old queue and finish them\n            for ( index = 0; index < length; index++ ) {\n                if ( queue[ index ] && queue[ index ].finish ) {\n                    queue[ index ].finish.call( this );\n                }\n            }\n\n            // Turn off finishing flag\n            delete data.finish;\n        } );\n    }\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n    var cssFn = jQuery.fn[ name ];\n    jQuery.fn[ name ] = function( speed, easing, callback ) {\n        return speed == null || typeof speed === \"boolean\" ?\n            cssFn.apply( this, arguments ) :\n            this.animate( genFx( name, true ), speed, easing, callback );\n    };\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n    slideDown: genFx( \"show\" ),\n    slideUp: genFx( \"hide\" ),\n    slideToggle: genFx( \"toggle\" ),\n    fadeIn: { opacity: \"show\" },\n    fadeOut: { opacity: \"hide\" },\n    fadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n    jQuery.fn[ name ] = function( speed, easing, callback ) {\n        return this.animate( props, speed, easing, callback );\n    };\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n    var timer,\n        i = 0,\n        timers = jQuery.timers;\n\n    fxNow = jQuery.now();\n\n    for ( ; i < timers.length; i++ ) {\n        timer = timers[ i ];\n\n        // Checks the timer has not already been removed\n        if ( !timer() && timers[ i ] === timer ) {\n            timers.splice( i--, 1 );\n        }\n    }\n\n    if ( !timers.length ) {\n        jQuery.fx.stop();\n    }\n    fxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n    jQuery.timers.push( timer );\n    if ( timer() ) {\n        jQuery.fx.start();\n    } else {\n        jQuery.timers.pop();\n    }\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n    if ( !timerId ) {\n        timerId = window.requestAnimationFrame ?\n            window.requestAnimationFrame( raf ) :\n            window.setInterval( jQuery.fx.tick, jQuery.fx.interval );\n    }\n};\n\njQuery.fx.stop = function() {\n    if ( window.cancelAnimationFrame ) {\n        window.cancelAnimationFrame( timerId );\n    } else {\n        window.clearInterval( timerId );\n    }\n\n    timerId = null;\n};\n\njQuery.fx.speeds = {\n    slow: 600,\n    fast: 200,\n\n    // Default speed\n    _default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n    time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n    type = type || \"fx\";\n\n    return this.queue( type, function( next, hooks ) {\n        var timeout = window.setTimeout( next, time );\n        hooks.stop = function() {\n            window.clearTimeout( timeout );\n        };\n    } );\n};\n\n\n( function() {\n    var input = document.createElement( \"input\" ),\n        select = document.createElement( \"select\" ),\n        opt = select.appendChild( document.createElement( \"option\" ) );\n\n    input.type = \"checkbox\";\n\n    // Support: Android <=4.3 only\n    // Default value for a checkbox should be \"on\"\n    support.checkOn = input.value !== \"\";\n\n    // Support: IE <=11 only\n    // Must access selectedIndex to make default options select\n    support.optSelected = opt.selected;\n\n    // Support: IE <=11 only\n    // An input loses its value after becoming a radio\n    input = document.createElement( \"input\" );\n    input.value = \"t\";\n    input.type = \"radio\";\n    support.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n    attrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n    attr: function( name, value ) {\n        return access( this, jQuery.attr, name, value, arguments.length > 1 );\n    },\n\n    removeAttr: function( name ) {\n        return this.each( function() {\n            jQuery.removeAttr( this, name );\n        } );\n    }\n} );\n\njQuery.extend( {\n    attr: function( elem, name, value ) {\n        var ret, hooks,\n            nType = elem.nodeType;\n\n        // Don't get/set attributes on text, comment and attribute nodes\n        if ( nType === 3 || nType === 8 || nType === 2 ) {\n            return;\n        }\n\n        // Fallback to prop when attributes are not supported\n        if ( typeof elem.getAttribute === \"undefined\" ) {\n            return jQuery.prop( elem, name, value );\n        }\n\n        // Attribute hooks are determined by the lowercase version\n        // Grab necessary hook if one is defined\n        if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n            hooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n                ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n        }\n\n        if ( value !== undefined ) {\n            if ( value === null ) {\n                jQuery.removeAttr( elem, name );\n                return;\n            }\n\n            if ( hooks && \"set\" in hooks &&\n                ( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n                return ret;\n            }\n\n            elem.setAttribute( name, value + \"\" );\n            return value;\n        }\n\n        if ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n            return ret;\n        }\n\n        ret = jQuery.find.attr( elem, name );\n\n        // Non-existent attributes return null, we normalize to undefined\n        return ret == null ? undefined : ret;\n    },\n\n    attrHooks: {\n        type: {\n            set: function( elem, value ) {\n                if ( !support.radioValue && value === \"radio\" &&\n                    jQuery.nodeName( elem, \"input\" ) ) {\n                    var val = elem.value;\n                    elem.setAttribute( \"type\", value );\n                    if ( val ) {\n                        elem.value = val;\n                    }\n                    return value;\n                }\n            }\n        }\n    },\n\n    removeAttr: function( elem, value ) {\n        var name,\n            i = 0,\n\n            // Attribute names can contain non-HTML whitespace characters\n            // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n            attrNames = value && value.match( rnothtmlwhite );\n\n        if ( attrNames && elem.nodeType === 1 ) {\n            while ( ( name = attrNames[ i++ ] ) ) {\n                elem.removeAttribute( name );\n            }\n        }\n    }\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n    set: function( elem, value, name ) {\n        if ( value === false ) {\n\n            // Remove boolean attributes when set to false\n            jQuery.removeAttr( elem, name );\n        } else {\n            elem.setAttribute( name, name );\n        }\n        return name;\n    }\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n    var getter = attrHandle[ name ] || jQuery.find.attr;\n\n    attrHandle[ name ] = function( elem, name, isXML ) {\n        var ret, handle,\n            lowercaseName = name.toLowerCase();\n\n        if ( !isXML ) {\n\n            // Avoid an infinite loop by temporarily removing this function from the getter\n            handle = attrHandle[ lowercaseName ];\n            attrHandle[ lowercaseName ] = ret;\n            ret = getter( elem, name, isXML ) != null ?\n                lowercaseName :\n                null;\n            attrHandle[ lowercaseName ] = handle;\n        }\n        return ret;\n    };\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n    rclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n    prop: function( name, value ) {\n        return access( this, jQuery.prop, name, value, arguments.length > 1 );\n    },\n\n    removeProp: function( name ) {\n        return this.each( function() {\n            delete this[ jQuery.propFix[ name ] || name ];\n        } );\n    }\n} );\n\njQuery.extend( {\n    prop: function( elem, name, value ) {\n        var ret, hooks,\n            nType = elem.nodeType;\n\n        // Don't get/set properties on text, comment and attribute nodes\n        if ( nType === 3 || nType === 8 || nType === 2 ) {\n            return;\n        }\n\n        if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n            // Fix name and attach hooks\n            name = jQuery.propFix[ name ] || name;\n            hooks = jQuery.propHooks[ name ];\n        }\n\n        if ( value !== undefined ) {\n            if ( hooks && \"set\" in hooks &&\n                ( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n                return ret;\n            }\n\n            return ( elem[ name ] = value );\n        }\n\n        if ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n            return ret;\n        }\n\n        return elem[ name ];\n    },\n\n    propHooks: {\n        tabIndex: {\n            get: function( elem ) {\n\n                // Support: IE <=9 - 11 only\n                // elem.tabIndex doesn't always return the\n                // correct value when it hasn't been explicitly set\n                // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n                // Use proper attribute retrieval(#12072)\n                var tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n                if ( tabindex ) {\n                    return parseInt( tabindex, 10 );\n                }\n\n                if (\n                    rfocusable.test( elem.nodeName ) ||\n                    rclickable.test( elem.nodeName ) &&\n                    elem.href\n                ) {\n                    return 0;\n                }\n\n                return -1;\n            }\n        }\n    },\n\n    propFix: {\n        \"for\": \"htmlFor\",\n        \"class\": \"className\"\n    }\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n    jQuery.propHooks.selected = {\n        get: function( elem ) {\n\n            /* eslint no-unused-expressions: \"off\" */\n\n            var parent = elem.parentNode;\n            if ( parent && parent.parentNode ) {\n                parent.parentNode.selectedIndex;\n            }\n            return null;\n        },\n        set: function( elem ) {\n\n            /* eslint no-unused-expressions: \"off\" */\n\n            var parent = elem.parentNode;\n            if ( parent ) {\n                parent.selectedIndex;\n\n                if ( parent.parentNode ) {\n                    parent.parentNode.selectedIndex;\n                }\n            }\n        }\n    };\n}\n\njQuery.each( [\n    \"tabIndex\",\n    \"readOnly\",\n    \"maxLength\",\n    \"cellSpacing\",\n    \"cellPadding\",\n    \"rowSpan\",\n    \"colSpan\",\n    \"useMap\",\n    \"frameBorder\",\n    \"contentEditable\"\n], function() {\n    jQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n    // Strip and collapse whitespace according to HTML spec\n    // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace\n    function stripAndCollapse( value ) {\n        var tokens = value.match( rnothtmlwhite ) || [];\n        return tokens.join( \" \" );\n    }\n\n\nfunction getClass( elem ) {\n    return elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\njQuery.fn.extend( {\n    addClass: function( value ) {\n        var classes, elem, cur, curValue, clazz, j, finalValue,\n            i = 0;\n\n        if ( jQuery.isFunction( value ) ) {\n            return this.each( function( j ) {\n                jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n            } );\n        }\n\n        if ( typeof value === \"string\" && value ) {\n            classes = value.match( rnothtmlwhite ) || [];\n\n            while ( ( elem = this[ i++ ] ) ) {\n                curValue = getClass( elem );\n                cur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n                if ( cur ) {\n                    j = 0;\n                    while ( ( clazz = classes[ j++ ] ) ) {\n                        if ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n                            cur += clazz + \" \";\n                        }\n                    }\n\n                    // Only assign if different to avoid unneeded rendering.\n                    finalValue = stripAndCollapse( cur );\n                    if ( curValue !== finalValue ) {\n                        elem.setAttribute( \"class\", finalValue );\n                    }\n                }\n            }\n        }\n\n        return this;\n    },\n\n    removeClass: function( value ) {\n        var classes, elem, cur, curValue, clazz, j, finalValue,\n            i = 0;\n\n        if ( jQuery.isFunction( value ) ) {\n            return this.each( function( j ) {\n                jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n            } );\n        }\n\n        if ( !arguments.length ) {\n            return this.attr( \"class\", \"\" );\n        }\n\n        if ( typeof value === \"string\" && value ) {\n            classes = value.match( rnothtmlwhite ) || [];\n\n            while ( ( elem = this[ i++ ] ) ) {\n                curValue = getClass( elem );\n\n                // This expression is here for better compressibility (see addClass)\n                cur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n                if ( cur ) {\n                    j = 0;\n                    while ( ( clazz = classes[ j++ ] ) ) {\n\n                        // Remove *all* instances\n                        while ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n                            cur = cur.replace( \" \" + clazz + \" \", \" \" );\n                        }\n                    }\n\n                    // Only assign if different to avoid unneeded rendering.\n                    finalValue = stripAndCollapse( cur );\n                    if ( curValue !== finalValue ) {\n                        elem.setAttribute( \"class\", finalValue );\n                    }\n                }\n            }\n        }\n\n        return this;\n    },\n\n    toggleClass: function( value, stateVal ) {\n        var type = typeof value;\n\n        if ( typeof stateVal === \"boolean\" && type === \"string\" ) {\n            return stateVal ? this.addClass( value ) : this.removeClass( value );\n        }\n\n        if ( jQuery.isFunction( value ) ) {\n            return this.each( function( i ) {\n                jQuery( this ).toggleClass(\n                    value.call( this, i, getClass( this ), stateVal ),\n                    stateVal\n                );\n            } );\n        }\n\n        return this.each( function() {\n            var className, i, self, classNames;\n\n            if ( type === \"string\" ) {\n\n                // Toggle individual class names\n                i = 0;\n                self = jQuery( this );\n                classNames = value.match( rnothtmlwhite ) || [];\n\n                while ( ( className = classNames[ i++ ] ) ) {\n\n                    // Check each className given, space separated list\n                    if ( self.hasClass( className ) ) {\n                        self.removeClass( className );\n                    } else {\n                        self.addClass( className );\n                    }\n                }\n\n            // Toggle whole class name\n            } else if ( value === undefined || type === \"boolean\" ) {\n                className = getClass( this );\n                if ( className ) {\n\n                    // Store className if set\n                    dataPriv.set( this, \"__className__\", className );\n                }\n\n                // If the element has a class name or if we're passed `false`,\n                // then remove the whole classname (if there was one, the above saved it).\n                // Otherwise bring back whatever was previously saved (if anything),\n                // falling back to the empty string if nothing was stored.\n                if ( this.setAttribute ) {\n                    this.setAttribute( \"class\",\n                        className || value === false ?\n                        \"\" :\n                        dataPriv.get( this, \"__className__\" ) || \"\"\n                    );\n                }\n            }\n        } );\n    },\n\n    hasClass: function( selector ) {\n        var className, elem,\n            i = 0;\n\n        className = \" \" + selector + \" \";\n        while ( ( elem = this[ i++ ] ) ) {\n            if ( elem.nodeType === 1 &&\n                ( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n                    return true;\n            }\n        }\n\n        return false;\n    }\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n    val: function( value ) {\n        var hooks, ret, isFunction,\n            elem = this[ 0 ];\n\n        if ( !arguments.length ) {\n            if ( elem ) {\n                hooks = jQuery.valHooks[ elem.type ] ||\n                    jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n                if ( hooks &&\n                    \"get\" in hooks &&\n                    ( ret = hooks.get( elem, \"value\" ) ) !== undefined\n                ) {\n                    return ret;\n                }\n\n                ret = elem.value;\n\n                // Handle most common string cases\n                if ( typeof ret === \"string\" ) {\n                    return ret.replace( rreturn, \"\" );\n                }\n\n                // Handle cases where value is null/undef or number\n                return ret == null ? \"\" : ret;\n            }\n\n            return;\n        }\n\n        isFunction = jQuery.isFunction( value );\n\n        return this.each( function( i ) {\n            var val;\n\n            if ( this.nodeType !== 1 ) {\n                return;\n            }\n\n            if ( isFunction ) {\n                val = value.call( this, i, jQuery( this ).val() );\n            } else {\n                val = value;\n            }\n\n            // Treat null/undefined as \"\"; convert numbers to string\n            if ( val == null ) {\n                val = \"\";\n\n            } else if ( typeof val === \"number\" ) {\n                val += \"\";\n\n            } else if ( jQuery.isArray( val ) ) {\n                val = jQuery.map( val, function( value ) {\n                    return value == null ? \"\" : value + \"\";\n                } );\n            }\n\n            hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n            // If set returns undefined, fall back to normal setting\n            if ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n                this.value = val;\n            }\n        } );\n    }\n} );\n\njQuery.extend( {\n    valHooks: {\n        option: {\n            get: function( elem ) {\n\n                var val = jQuery.find.attr( elem, \"value\" );\n                return val != null ?\n                    val :\n\n                    // Support: IE <=10 - 11 only\n                    // option.text throws exceptions (#14686, #14858)\n                    // Strip and collapse whitespace\n                    // https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n                    stripAndCollapse( jQuery.text( elem ) );\n            }\n        },\n        select: {\n            get: function( elem ) {\n                var value, option, i,\n                    options = elem.options,\n                    index = elem.selectedIndex,\n                    one = elem.type === \"select-one\",\n                    values = one ? null : [],\n                    max = one ? index + 1 : options.length;\n\n                if ( index < 0 ) {\n                    i = max;\n\n                } else {\n                    i = one ? index : 0;\n                }\n\n                // Loop through all the selected options\n                for ( ; i < max; i++ ) {\n                    option = options[ i ];\n\n                    // Support: IE <=9 only\n                    // IE8-9 doesn't update selected after form reset (#2551)\n                    if ( ( option.selected || i === index ) &&\n\n                            // Don't return options that are disabled or in a disabled optgroup\n                            !option.disabled &&\n                            ( !option.parentNode.disabled ||\n                                !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n                        // Get the specific value for the option\n                        value = jQuery( option ).val();\n\n                        // We don't need an array for one selects\n                        if ( one ) {\n                            return value;\n                        }\n\n                        // Multi-Selects return an array\n                        values.push( value );\n                    }\n                }\n\n                return values;\n            },\n\n            set: function( elem, value ) {\n                var optionSet, option,\n                    options = elem.options,\n                    values = jQuery.makeArray( value ),\n                    i = options.length;\n\n                while ( i-- ) {\n                    option = options[ i ];\n\n                    /* eslint-disable no-cond-assign */\n\n                    if ( option.selected =\n                        jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n                    ) {\n                        optionSet = true;\n                    }\n\n                    /* eslint-enable no-cond-assign */\n                }\n\n                // Force browsers to behave consistently when non-matching value is set\n                if ( !optionSet ) {\n                    elem.selectedIndex = -1;\n                }\n                return values;\n            }\n        }\n    }\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n    jQuery.valHooks[ this ] = {\n        set: function( elem, value ) {\n            if ( jQuery.isArray( value ) ) {\n                return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n            }\n        }\n    };\n    if ( !support.checkOn ) {\n        jQuery.valHooks[ this ].get = function( elem ) {\n            return elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n        };\n    }\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;\n\njQuery.extend( jQuery.event, {\n\n    trigger: function( event, data, elem, onlyHandlers ) {\n\n        var i, cur, tmp, bubbleType, ontype, handle, special,\n            eventPath = [ elem || document ],\n            type = hasOwn.call( event, \"type\" ) ? event.type : event,\n            namespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n        cur = tmp = elem = elem || document;\n\n        // Don't do events on text and comment nodes\n        if ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n            return;\n        }\n\n        // focus/blur morphs to focusin/out; ensure we're not firing them right now\n        if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n            return;\n        }\n\n        if ( type.indexOf( \".\" ) > -1 ) {\n\n            // Namespaced trigger; create a regexp to match event type in handle()\n            namespaces = type.split( \".\" );\n            type = namespaces.shift();\n            namespaces.sort();\n        }\n        ontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n        // Caller can pass in a jQuery.Event object, Object, or just an event type string\n        event = event[ jQuery.expando ] ?\n            event :\n            new jQuery.Event( type, typeof event === \"object\" && event );\n\n        // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n        event.isTrigger = onlyHandlers ? 2 : 3;\n        event.namespace = namespaces.join( \".\" );\n        event.rnamespace = event.namespace ?\n            new RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n            null;\n\n        // Clean up the event in case it is being reused\n        event.result = undefined;\n        if ( !event.target ) {\n            event.target = elem;\n        }\n\n        // Clone any incoming data and prepend the event, creating the handler arg list\n        data = data == null ?\n            [ event ] :\n            jQuery.makeArray( data, [ event ] );\n\n        // Allow special events to draw outside the lines\n        special = jQuery.event.special[ type ] || {};\n        if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n            return;\n        }\n\n        // Determine event propagation path in advance, per W3C events spec (#9951)\n        // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n        if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n            bubbleType = special.delegateType || type;\n            if ( !rfocusMorph.test( bubbleType + type ) ) {\n                cur = cur.parentNode;\n            }\n            for ( ; cur; cur = cur.parentNode ) {\n                eventPath.push( cur );\n                tmp = cur;\n            }\n\n            // Only add window if we got to document (e.g., not plain obj or detached DOM)\n            if ( tmp === ( elem.ownerDocument || document ) ) {\n                eventPath.push( tmp.defaultView || tmp.parentWindow || window );\n            }\n        }\n\n        // Fire handlers on the event path\n        i = 0;\n        while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\n            event.type = i > 1 ?\n                bubbleType :\n                special.bindType || type;\n\n            // jQuery handler\n            handle = ( dataPriv.get( cur, \"events\" ) || {} )[ event.type ] &&\n                dataPriv.get( cur, \"handle\" );\n            if ( handle ) {\n                handle.apply( cur, data );\n            }\n\n            // Native handler\n            handle = ontype && cur[ ontype ];\n            if ( handle && handle.apply && acceptData( cur ) ) {\n                event.result = handle.apply( cur, data );\n                if ( event.result === false ) {\n                    event.preventDefault();\n                }\n            }\n        }\n        event.type = type;\n\n        // If nobody prevented the default action, do it now\n        if ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n            if ( ( !special._default ||\n                special._default.apply( eventPath.pop(), data ) === false ) &&\n                acceptData( elem ) ) {\n\n                // Call a native DOM method on the target with the same name as the event.\n                // Don't do default actions on window, that's where global variables be (#6170)\n                if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {\n\n                    // Don't re-trigger an onFOO event when we call its FOO() method\n                    tmp = elem[ ontype ];\n\n                    if ( tmp ) {\n                        elem[ ontype ] = null;\n                    }\n\n                    // Prevent re-triggering of the same event, since we already bubbled it above\n                    jQuery.event.triggered = type;\n                    elem[ type ]();\n                    jQuery.event.triggered = undefined;\n\n                    if ( tmp ) {\n                        elem[ ontype ] = tmp;\n                    }\n                }\n            }\n        }\n\n        return event.result;\n    },\n\n    // Piggyback on a donor event to simulate a different one\n    // Used only for `focus(in | out)` events\n    simulate: function( type, elem, event ) {\n        var e = jQuery.extend(\n            new jQuery.Event(),\n            event,\n            {\n                type: type,\n                isSimulated: true\n            }\n        );\n\n        jQuery.event.trigger( e, null, elem );\n    }\n\n} );\n\njQuery.fn.extend( {\n\n    trigger: function( type, data ) {\n        return this.each( function() {\n            jQuery.event.trigger( type, data, this );\n        } );\n    },\n    triggerHandler: function( type, data ) {\n        var elem = this[ 0 ];\n        if ( elem ) {\n            return jQuery.event.trigger( type, data, elem, true );\n        }\n    }\n} );\n\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n    \"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n    \"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n    function( i, name ) {\n\n    // Handle event binding\n    jQuery.fn[ name ] = function( data, fn ) {\n        return arguments.length > 0 ?\n            this.on( name, null, data, fn ) :\n            this.trigger( name );\n    };\n} );\n\njQuery.fn.extend( {\n    hover: function( fnOver, fnOut ) {\n        return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n    }\n} );\n\n\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n    jQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n        // Attach a single capturing handler on the document while someone wants focusin/focusout\n        var handler = function( event ) {\n            jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n        };\n\n        jQuery.event.special[ fix ] = {\n            setup: function() {\n                var doc = this.ownerDocument || this,\n                    attaches = dataPriv.access( doc, fix );\n\n                if ( !attaches ) {\n                    doc.addEventListener( orig, handler, true );\n                }\n                dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n            },\n            teardown: function() {\n                var doc = this.ownerDocument || this,\n                    attaches = dataPriv.access( doc, fix ) - 1;\n\n                if ( !attaches ) {\n                    doc.removeEventListener( orig, handler, true );\n                    dataPriv.remove( doc, fix );\n\n                } else {\n                    dataPriv.access( doc, fix, attaches );\n                }\n            }\n        };\n    } );\n}\nvar location = window.location;\n\nvar nonce = jQuery.now();\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n    var xml;\n    if ( !data || typeof data !== \"string\" ) {\n        return null;\n    }\n\n    // Support: IE 9 - 11 only\n    // IE throws on parseFromString with invalid input.\n    try {\n        xml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n    } catch ( e ) {\n        xml = undefined;\n    }\n\n    if ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n        jQuery.error( \"Invalid XML: \" + data );\n    }\n    return xml;\n};\n\n\nvar\n    rbracket = /\\[\\]$/,\n    rCRLF = /\\r?\\n/g,\n    rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n    rsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n    var name;\n\n    if ( jQuery.isArray( obj ) ) {\n\n        // Serialize array item.\n        jQuery.each( obj, function( i, v ) {\n            if ( traditional || rbracket.test( prefix ) ) {\n\n                // Treat each array item as a scalar.\n                add( prefix, v );\n\n            } else {\n\n                // Item is non-scalar (array or object), encode its numeric index.\n                buildParams(\n                    prefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n                    v,\n                    traditional,\n                    add\n                );\n            }\n        } );\n\n    } else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\n        // Serialize object item.\n        for ( name in obj ) {\n            buildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n        }\n\n    } else {\n\n        // Serialize scalar item.\n        add( prefix, obj );\n    }\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n    var prefix,\n        s = [],\n        add = function( key, valueOrFunction ) {\n\n            // If value is a function, invoke it and use its return value\n            var value = jQuery.isFunction( valueOrFunction ) ?\n                valueOrFunction() :\n                valueOrFunction;\n\n            s[ s.length ] = encodeURIComponent( key ) + \"=\" +\n                encodeURIComponent( value == null ? \"\" : value );\n        };\n\n    // If an array was passed in, assume that it is an array of form elements.\n    if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n        // Serialize the form elements\n        jQuery.each( a, function() {\n            add( this.name, this.value );\n        } );\n\n    } else {\n\n        // If traditional, encode the \"old\" way (the way 1.3.2 or older\n        // did it), otherwise encode params recursively.\n        for ( prefix in a ) {\n            buildParams( prefix, a[ prefix ], traditional, add );\n        }\n    }\n\n    // Return the resulting serialization\n    return s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n    serialize: function() {\n        return jQuery.param( this.serializeArray() );\n    },\n    serializeArray: function() {\n        return this.map( function() {\n\n            // Can add propHook for \"elements\" to filter or add form elements\n            var elements = jQuery.prop( this, \"elements\" );\n            return elements ? jQuery.makeArray( elements ) : this;\n        } )\n        .filter( function() {\n            var type = this.type;\n\n            // Use .is( \":disabled\" ) so that fieldset[disabled] works\n            return this.name && !jQuery( this ).is( \":disabled\" ) &&\n                rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n                ( this.checked || !rcheckableType.test( type ) );\n        } )\n        .map( function( i, elem ) {\n            var val = jQuery( this ).val();\n\n            if ( val == null ) {\n                return null;\n            }\n\n            if ( jQuery.isArray( val ) ) {\n                return jQuery.map( val, function( val ) {\n                    return { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n                } );\n            }\n\n            return { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n        } ).get();\n    }\n} );\n\n\nvar\n    r20 = /%20/g,\n    rhash = /#.*$/,\n    rantiCache = /([?&])_=[^&]*/,\n    rheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n    // #7653, #8125, #8152: local protocol detection\n    rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n    rnoContent = /^(?:GET|HEAD)$/,\n    rprotocol = /^\\/\\//,\n\n    /* Prefilters\n     * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n     * 2) These are called:\n     *    - BEFORE asking for a transport\n     *    - AFTER param serialization (s.data is a string if s.processData is true)\n     * 3) key is the dataType\n     * 4) the catchall symbol \"*\" can be used\n     * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n     */\n    prefilters = {},\n\n    /* Transports bindings\n     * 1) key is the dataType\n     * 2) the catchall symbol \"*\" can be used\n     * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n     */\n    transports = {},\n\n    // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n    allTypes = \"*/\".concat( \"*\" ),\n\n    // Anchor tag for parsing the document origin\n    originAnchor = document.createElement( \"a\" );\n    originAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n    // dataTypeExpression is optional and defaults to \"*\"\n    return function( dataTypeExpression, func ) {\n\n        if ( typeof dataTypeExpression !== \"string\" ) {\n            func = dataTypeExpression;\n            dataTypeExpression = \"*\";\n        }\n\n        var dataType,\n            i = 0,\n            dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n        if ( jQuery.isFunction( func ) ) {\n\n            // For each dataType in the dataTypeExpression\n            while ( ( dataType = dataTypes[ i++ ] ) ) {\n\n                // Prepend if requested\n                if ( dataType[ 0 ] === \"+\" ) {\n                    dataType = dataType.slice( 1 ) || \"*\";\n                    ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n                // Otherwise append\n                } else {\n                    ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n                }\n            }\n        }\n    };\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n    var inspected = {},\n        seekingTransport = ( structure === transports );\n\n    function inspect( dataType ) {\n        var selected;\n        inspected[ dataType ] = true;\n        jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n            var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n            if ( typeof dataTypeOrTransport === \"string\" &&\n                !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n                options.dataTypes.unshift( dataTypeOrTransport );\n                inspect( dataTypeOrTransport );\n                return false;\n            } else if ( seekingTransport ) {\n                return !( selected = dataTypeOrTransport );\n            }\n        } );\n        return selected;\n    }\n\n    return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n    var key, deep,\n        flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n    for ( key in src ) {\n        if ( src[ key ] !== undefined ) {\n            ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n        }\n    }\n    if ( deep ) {\n        jQuery.extend( true, target, deep );\n    }\n\n    return target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n    var ct, type, finalDataType, firstDataType,\n        contents = s.contents,\n        dataTypes = s.dataTypes;\n\n    // Remove auto dataType and get content-type in the process\n    while ( dataTypes[ 0 ] === \"*\" ) {\n        dataTypes.shift();\n        if ( ct === undefined ) {\n            ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n        }\n    }\n\n    // Check if we're dealing with a known content-type\n    if ( ct ) {\n        for ( type in contents ) {\n            if ( contents[ type ] && contents[ type ].test( ct ) ) {\n                dataTypes.unshift( type );\n                break;\n            }\n        }\n    }\n\n    // Check to see if we have a response for the expected dataType\n    if ( dataTypes[ 0 ] in responses ) {\n        finalDataType = dataTypes[ 0 ];\n    } else {\n\n        // Try convertible dataTypes\n        for ( type in responses ) {\n            if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n                finalDataType = type;\n                break;\n            }\n            if ( !firstDataType ) {\n                firstDataType = type;\n            }\n        }\n\n        // Or just use first one\n        finalDataType = finalDataType || firstDataType;\n    }\n\n    // If we found a dataType\n    // We add the dataType to the list if needed\n    // and return the corresponding response\n    if ( finalDataType ) {\n        if ( finalDataType !== dataTypes[ 0 ] ) {\n            dataTypes.unshift( finalDataType );\n        }\n        return responses[ finalDataType ];\n    }\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n    var conv2, current, conv, tmp, prev,\n        converters = {},\n\n        // Work with a copy of dataTypes in case we need to modify it for conversion\n        dataTypes = s.dataTypes.slice();\n\n    // Create converters map with lowercased keys\n    if ( dataTypes[ 1 ] ) {\n        for ( conv in s.converters ) {\n            converters[ conv.toLowerCase() ] = s.converters[ conv ];\n        }\n    }\n\n    current = dataTypes.shift();\n\n    // Convert to each sequential dataType\n    while ( current ) {\n\n        if ( s.responseFields[ current ] ) {\n            jqXHR[ s.responseFields[ current ] ] = response;\n        }\n\n        // Apply the dataFilter if provided\n        if ( !prev && isSuccess && s.dataFilter ) {\n            response = s.dataFilter( response, s.dataType );\n        }\n\n        prev = current;\n        current = dataTypes.shift();\n\n        if ( current ) {\n\n            // There's only work to do if current dataType is non-auto\n            if ( current === \"*\" ) {\n\n                current = prev;\n\n            // Convert response if prev dataType is non-auto and differs from current\n            } else if ( prev !== \"*\" && prev !== current ) {\n\n                // Seek a direct converter\n                conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n                // If none found, seek a pair\n                if ( !conv ) {\n                    for ( conv2 in converters ) {\n\n                        // If conv2 outputs current\n                        tmp = conv2.split( \" \" );\n                        if ( tmp[ 1 ] === current ) {\n\n                            // If prev can be converted to accepted input\n                            conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n                                converters[ \"* \" + tmp[ 0 ] ];\n                            if ( conv ) {\n\n                                // Condense equivalence converters\n                                if ( conv === true ) {\n                                    conv = converters[ conv2 ];\n\n                                // Otherwise, insert the intermediate dataType\n                                } else if ( converters[ conv2 ] !== true ) {\n                                    current = tmp[ 0 ];\n                                    dataTypes.unshift( tmp[ 1 ] );\n                                }\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                // Apply converter (if not an equivalence)\n                if ( conv !== true ) {\n\n                    // Unless errors are allowed to bubble, catch and return them\n                    if ( conv && s.throws ) {\n                        response = conv( response );\n                    } else {\n                        try {\n                            response = conv( response );\n                        } catch ( e ) {\n                            return {\n                                state: \"parsererror\",\n                                error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n                            };\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    return { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n    // Counter for holding the number of active queries\n    active: 0,\n\n    // Last-Modified header cache for next request\n    lastModified: {},\n    etag: {},\n\n    ajaxSettings: {\n        url: location.href,\n        type: \"GET\",\n        isLocal: rlocalProtocol.test( location.protocol ),\n        global: true,\n        processData: true,\n        async: true,\n        contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n        /*\n        timeout: 0,\n        data: null,\n        dataType: null,\n        username: null,\n        password: null,\n        cache: null,\n        throws: false,\n        traditional: false,\n        headers: {},\n        */\n\n        accepts: {\n            \"*\": allTypes,\n            text: \"text/plain\",\n            html: \"text/html\",\n            xml: \"application/xml, text/xml\",\n            json: \"application/json, text/javascript\"\n        },\n\n        contents: {\n            xml: /\\bxml\\b/,\n            html: /\\bhtml/,\n            json: /\\bjson\\b/\n        },\n\n        responseFields: {\n            xml: \"responseXML\",\n            text: \"responseText\",\n            json: \"responseJSON\"\n        },\n\n        // Data converters\n        // Keys separate source (or catchall \"*\") and destination types with a single space\n        converters: {\n\n            // Convert anything to text\n            \"* text\": String,\n\n            // Text to html (true = no transformation)\n            \"text html\": true,\n\n            // Evaluate text as a json expression\n            \"text json\": JSON.parse,\n\n            // Parse text as xml\n            \"text xml\": jQuery.parseXML\n        },\n\n        // For options that shouldn't be deep extended:\n        // you can add your own custom options here if\n        // and when you create one that shouldn't be\n        // deep extended (see ajaxExtend)\n        flatOptions: {\n            url: true,\n            context: true\n        }\n    },\n\n    // Creates a full fledged settings object into target\n    // with both ajaxSettings and settings fields.\n    // If target is omitted, writes into ajaxSettings.\n    ajaxSetup: function( target, settings ) {\n        return settings ?\n\n            // Building a settings object\n            ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n            // Extending ajaxSettings\n            ajaxExtend( jQuery.ajaxSettings, target );\n    },\n\n    ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n    ajaxTransport: addToPrefiltersOrTransports( transports ),\n\n    // Main method\n    ajax: function( url, options ) {\n\n        // If url is an object, simulate pre-1.5 signature\n        if ( typeof url === \"object\" ) {\n            options = url;\n            url = undefined;\n        }\n\n        // Force options to be an object\n        options = options || {};\n\n        var transport,\n\n            // URL without anti-cache param\n            cacheURL,\n\n            // Response headers\n            responseHeadersString,\n            responseHeaders,\n\n            // timeout handle\n            timeoutTimer,\n\n            // Url cleanup var\n            urlAnchor,\n\n            // Request state (becomes false upon send and true upon completion)\n            completed,\n\n            // To know if global events are to be dispatched\n            fireGlobals,\n\n            // Loop variable\n            i,\n\n            // uncached part of the url\n            uncached,\n\n            // Create the final options object\n            s = jQuery.ajaxSetup( {}, options ),\n\n            // Callbacks context\n            callbackContext = s.context || s,\n\n            // Context for global events is callbackContext if it is a DOM node or jQuery collection\n            globalEventContext = s.context &&\n                ( callbackContext.nodeType || callbackContext.jquery ) ?\n                    jQuery( callbackContext ) :\n                    jQuery.event,\n\n            // Deferreds\n            deferred = jQuery.Deferred(),\n            completeDeferred = jQuery.Callbacks( \"once memory\" ),\n\n            // Status-dependent callbacks\n            statusCode = s.statusCode || {},\n\n            // Headers (they are sent all at once)\n            requestHeaders = {},\n            requestHeadersNames = {},\n\n            // Default abort message\n            strAbort = \"canceled\",\n\n            // Fake xhr\n            jqXHR = {\n                readyState: 0,\n\n                // Builds headers hashtable if needed\n                getResponseHeader: function( key ) {\n                    var match;\n                    if ( completed ) {\n                        if ( !responseHeaders ) {\n                            responseHeaders = {};\n                            while ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n                                responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];\n                            }\n                        }\n                        match = responseHeaders[ key.toLowerCase() ];\n                    }\n                    return match == null ? null : match;\n                },\n\n                // Raw string\n                getAllResponseHeaders: function() {\n                    return completed ? responseHeadersString : null;\n                },\n\n                // Caches the header\n                setRequestHeader: function( name, value ) {\n                    if ( completed == null ) {\n                        name = requestHeadersNames[ name.toLowerCase() ] =\n                            requestHeadersNames[ name.toLowerCase() ] || name;\n                        requestHeaders[ name ] = value;\n                    }\n                    return this;\n                },\n\n                // Overrides response content-type header\n                overrideMimeType: function( type ) {\n                    if ( completed == null ) {\n                        s.mimeType = type;\n                    }\n                    return this;\n                },\n\n                // Status-dependent callbacks\n                statusCode: function( map ) {\n                    var code;\n                    if ( map ) {\n                        if ( completed ) {\n\n                            // Execute the appropriate callbacks\n                            jqXHR.always( map[ jqXHR.status ] );\n                        } else {\n\n                            // Lazy-add the new callbacks in a way that preserves old ones\n                            for ( code in map ) {\n                                statusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n                            }\n                        }\n                    }\n                    return this;\n                },\n\n                // Cancel the request\n                abort: function( statusText ) {\n                    var finalText = statusText || strAbort;\n                    if ( transport ) {\n                        transport.abort( finalText );\n                    }\n                    done( 0, finalText );\n                    return this;\n                }\n            };\n\n        // Attach deferreds\n        deferred.promise( jqXHR );\n\n        // Add protocol if not provided (prefilters might expect it)\n        // Handle falsy url in the settings object (#10093: consistency with old signature)\n        // We also use the url parameter if available\n        s.url = ( ( url || s.url || location.href ) + \"\" )\n            .replace( rprotocol, location.protocol + \"//\" );\n\n        // Alias method option to type as per ticket #12004\n        s.type = options.method || options.type || s.method || s.type;\n\n        // Extract dataTypes list\n        s.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n        // A cross-domain request is in order when the origin doesn't match the current origin.\n        if ( s.crossDomain == null ) {\n            urlAnchor = document.createElement( \"a\" );\n\n            // Support: IE <=8 - 11, Edge 12 - 13\n            // IE throws exception on accessing the href property if url is malformed,\n            // e.g. http://example.com:80x/\n            try {\n                urlAnchor.href = s.url;\n\n                // Support: IE <=8 - 11 only\n                // Anchor's host property isn't correctly set when s.url is relative\n                urlAnchor.href = urlAnchor.href;\n                s.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n                    urlAnchor.protocol + \"//\" + urlAnchor.host;\n            } catch ( e ) {\n\n                // If there is an error parsing the URL, assume it is crossDomain,\n                // it can be rejected by the transport if it is invalid\n                s.crossDomain = true;\n            }\n        }\n\n        // Convert data if not already a string\n        if ( s.data && s.processData && typeof s.data !== \"string\" ) {\n            s.data = jQuery.param( s.data, s.traditional );\n        }\n\n        // Apply prefilters\n        inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n        // If request was aborted inside a prefilter, stop there\n        if ( completed ) {\n            return jqXHR;\n        }\n\n        // We can fire global events as of now if asked to\n        // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n        fireGlobals = jQuery.event && s.global;\n\n        // Watch for a new set of requests\n        if ( fireGlobals && jQuery.active++ === 0 ) {\n            jQuery.event.trigger( \"ajaxStart\" );\n        }\n\n        // Uppercase the type\n        s.type = s.type.toUpperCase();\n\n        // Determine if request has content\n        s.hasContent = !rnoContent.test( s.type );\n\n        // Save the URL in case we're toying with the If-Modified-Since\n        // and/or If-None-Match header later on\n        // Remove hash to simplify url manipulation\n        cacheURL = s.url.replace( rhash, \"\" );\n\n        // More options handling for requests with no content\n        if ( !s.hasContent ) {\n\n            // Remember the hash so we can put it back\n            uncached = s.url.slice( cacheURL.length );\n\n            // If data is available, append data to url\n            if ( s.data ) {\n                cacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n                // #9682: remove data so that it's not used in an eventual retry\n                delete s.data;\n            }\n\n            // Add or update anti-cache param if needed\n            if ( s.cache === false ) {\n                cacheURL = cacheURL.replace( rantiCache, \"$1\" );\n                uncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce++ ) + uncached;\n            }\n\n            // Put hash and anti-cache on the URL that will be requested (gh-1732)\n            s.url = cacheURL + uncached;\n\n        // Change '%20' to '+' if this is encoded form body content (gh-2658)\n        } else if ( s.data && s.processData &&\n            ( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n            s.data = s.data.replace( r20, \"+\" );\n        }\n\n        // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n        if ( s.ifModified ) {\n            if ( jQuery.lastModified[ cacheURL ] ) {\n                jqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n            }\n            if ( jQuery.etag[ cacheURL ] ) {\n                jqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n            }\n        }\n\n        // Set the correct header, if data is being sent\n        if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n            jqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n        }\n\n        // Set the Accepts header for the server, depending on the dataType\n        jqXHR.setRequestHeader(\n            \"Accept\",\n            s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n                s.accepts[ s.dataTypes[ 0 ] ] +\n                    ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n                s.accepts[ \"*\" ]\n        );\n\n        // Check for headers option\n        for ( i in s.headers ) {\n            jqXHR.setRequestHeader( i, s.headers[ i ] );\n        }\n\n        // Allow custom headers/mimetypes and early abort\n        if ( s.beforeSend &&\n            ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n            // Abort if not done already and return\n            return jqXHR.abort();\n        }\n\n        // Aborting is no longer a cancellation\n        strAbort = \"abort\";\n\n        // Install callbacks on deferreds\n        completeDeferred.add( s.complete );\n        jqXHR.done( s.success );\n        jqXHR.fail( s.error );\n\n        // Get transport\n        transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n        // If no transport, we auto-abort\n        if ( !transport ) {\n            done( -1, \"No Transport\" );\n        } else {\n            jqXHR.readyState = 1;\n\n            // Send global event\n            if ( fireGlobals ) {\n                globalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n            }\n\n            // If request was aborted inside ajaxSend, stop there\n            if ( completed ) {\n                return jqXHR;\n            }\n\n            // Timeout\n            if ( s.async && s.timeout > 0 ) {\n                timeoutTimer = window.setTimeout( function() {\n                    jqXHR.abort( \"timeout\" );\n                }, s.timeout );\n            }\n\n            try {\n                completed = false;\n                transport.send( requestHeaders, done );\n            } catch ( e ) {\n\n                // Rethrow post-completion exceptions\n                if ( completed ) {\n                    throw e;\n                }\n\n                // Propagate others as results\n                done( -1, e );\n            }\n        }\n\n        // Callback for when everything is done\n        function done( status, nativeStatusText, responses, headers ) {\n            var isSuccess, success, error, response, modified,\n                statusText = nativeStatusText;\n\n            // Ignore repeat invocations\n            if ( completed ) {\n                return;\n            }\n\n            completed = true;\n\n            // Clear timeout if it exists\n            if ( timeoutTimer ) {\n                window.clearTimeout( timeoutTimer );\n            }\n\n            // Dereference transport for early garbage collection\n            // (no matter how long the jqXHR object will be used)\n            transport = undefined;\n\n            // Cache response headers\n            responseHeadersString = headers || \"\";\n\n            // Set readyState\n            jqXHR.readyState = status > 0 ? 4 : 0;\n\n            // Determine if successful\n            isSuccess = status >= 200 && status < 300 || status === 304;\n\n            // Get response data\n            if ( responses ) {\n                response = ajaxHandleResponses( s, jqXHR, responses );\n            }\n\n            // Convert no matter what (that way responseXXX fields are always set)\n            response = ajaxConvert( s, response, jqXHR, isSuccess );\n\n            // If successful, handle type chaining\n            if ( isSuccess ) {\n\n                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n                if ( s.ifModified ) {\n                    modified = jqXHR.getResponseHeader( \"Last-Modified\" );\n                    if ( modified ) {\n                        jQuery.lastModified[ cacheURL ] = modified;\n                    }\n                    modified = jqXHR.getResponseHeader( \"etag\" );\n                    if ( modified ) {\n                        jQuery.etag[ cacheURL ] = modified;\n                    }\n                }\n\n                // if no content\n                if ( status === 204 || s.type === \"HEAD\" ) {\n                    statusText = \"nocontent\";\n\n                // if not modified\n                } else if ( status === 304 ) {\n                    statusText = \"notmodified\";\n\n                // If we have data, let's convert it\n                } else {\n                    statusText = response.state;\n                    success = response.data;\n                    error = response.error;\n                    isSuccess = !error;\n                }\n            } else {\n\n                // Extract error from statusText and normalize for non-aborts\n                error = statusText;\n                if ( status || !statusText ) {\n                    statusText = \"error\";\n                    if ( status < 0 ) {\n                        status = 0;\n                    }\n                }\n            }\n\n            // Set data for the fake xhr object\n            jqXHR.status = status;\n            jqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n            // Success/Error\n            if ( isSuccess ) {\n                deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n            } else {\n                deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n            }\n\n            // Status-dependent callbacks\n            jqXHR.statusCode( statusCode );\n            statusCode = undefined;\n\n            if ( fireGlobals ) {\n                globalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n                    [ jqXHR, s, isSuccess ? success : error ] );\n            }\n\n            // Complete\n            completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n            if ( fireGlobals ) {\n                globalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n                // Handle the global AJAX counter\n                if ( !( --jQuery.active ) ) {\n                    jQuery.event.trigger( \"ajaxStop\" );\n                }\n            }\n        }\n\n        return jqXHR;\n    },\n\n    getJSON: function( url, data, callback ) {\n        return jQuery.get( url, data, callback, \"json\" );\n    },\n\n    getScript: function( url, callback ) {\n        return jQuery.get( url, undefined, callback, \"script\" );\n    }\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n    jQuery[ method ] = function( url, data, callback, type ) {\n\n        // Shift arguments if data argument was omitted\n        if ( jQuery.isFunction( data ) ) {\n            type = type || callback;\n            callback = data;\n            data = undefined;\n        }\n\n        // The url can be an options object (which then must have .url)\n        return jQuery.ajax( jQuery.extend( {\n            url: url,\n            type: method,\n            dataType: type,\n            data: data,\n            success: callback\n        }, jQuery.isPlainObject( url ) && url ) );\n    };\n} );\n\n\njQuery._evalUrl = function( url ) {\n    return jQuery.ajax( {\n        url: url,\n\n        // Make this explicit, since user can override this through ajaxSetup (#11264)\n        type: \"GET\",\n        dataType: \"script\",\n        cache: true,\n        async: false,\n        global: false,\n        \"throws\": true\n    } );\n};\n\n\njQuery.fn.extend( {\n    wrapAll: function( html ) {\n        var wrap;\n\n        if ( this[ 0 ] ) {\n            if ( jQuery.isFunction( html ) ) {\n                html = html.call( this[ 0 ] );\n            }\n\n            // The elements to wrap the target around\n            wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n            if ( this[ 0 ].parentNode ) {\n                wrap.insertBefore( this[ 0 ] );\n            }\n\n            wrap.map( function() {\n                var elem = this;\n\n                while ( elem.firstElementChild ) {\n                    elem = elem.firstElementChild;\n                }\n\n                return elem;\n            } ).append( this );\n        }\n\n        return this;\n    },\n\n    wrapInner: function( html ) {\n        if ( jQuery.isFunction( html ) ) {\n            return this.each( function( i ) {\n                jQuery( this ).wrapInner( html.call( this, i ) );\n            } );\n        }\n\n        return this.each( function() {\n            var self = jQuery( this ),\n                contents = self.contents();\n\n            if ( contents.length ) {\n                contents.wrapAll( html );\n\n            } else {\n                self.append( html );\n            }\n        } );\n    },\n\n    wrap: function( html ) {\n        var isFunction = jQuery.isFunction( html );\n\n        return this.each( function( i ) {\n            jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );\n        } );\n    },\n\n    unwrap: function( selector ) {\n        this.parent( selector ).not( \"body\" ).each( function() {\n            jQuery( this ).replaceWith( this.childNodes );\n        } );\n        return this;\n    }\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n    return !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n    return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n    try {\n        return new window.XMLHttpRequest();\n    } catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n        // File protocol always yields status code 0, assume 200\n        0: 200,\n\n        // Support: IE <=9 only\n        // #1450: sometimes IE returns 1223 when it should be 204\n        1223: 204\n    },\n    xhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n    var callback, errorCallback;\n\n    // Cross domain only allowed if supported through XMLHttpRequest\n    if ( support.cors || xhrSupported && !options.crossDomain ) {\n        return {\n            send: function( headers, complete ) {\n                var i,\n                    xhr = options.xhr();\n\n                xhr.open(\n                    options.type,\n                    options.url,\n                    options.async,\n                    options.username,\n                    options.password\n                );\n\n                // Apply custom fields if provided\n                if ( options.xhrFields ) {\n                    for ( i in options.xhrFields ) {\n                        xhr[ i ] = options.xhrFields[ i ];\n                    }\n                }\n\n                // Override mime type if needed\n                if ( options.mimeType && xhr.overrideMimeType ) {\n                    xhr.overrideMimeType( options.mimeType );\n                }\n\n                // X-Requested-With header\n                // For cross-domain requests, seeing as conditions for a preflight are\n                // akin to a jigsaw puzzle, we simply never set it to be sure.\n                // (it can always be set on a per-request basis or even using ajaxSetup)\n                // For same-domain requests, won't change header if already provided.\n                if ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n                    headers[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n                }\n\n                // Set headers\n                for ( i in headers ) {\n                    xhr.setRequestHeader( i, headers[ i ] );\n                }\n\n                // Callback\n                callback = function( type ) {\n                    return function() {\n                        if ( callback ) {\n                            callback = errorCallback = xhr.onload =\n                                xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;\n\n                            if ( type === \"abort\" ) {\n                                xhr.abort();\n                            } else if ( type === \"error\" ) {\n\n                                // Support: IE <=9 only\n                                // On a manual native abort, IE9 throws\n                                // errors on any property access that is not readyState\n                                if ( typeof xhr.status !== \"number\" ) {\n                                    complete( 0, \"error\" );\n                                } else {\n                                    complete(\n\n                                        // File: protocol always yields status 0; see #8605, #14207\n                                        xhr.status,\n                                        xhr.statusText\n                                    );\n                                }\n                            } else {\n                                complete(\n                                    xhrSuccessStatus[ xhr.status ] || xhr.status,\n                                    xhr.statusText,\n\n                                    // Support: IE <=9 only\n                                    // IE9 has no XHR2 but throws on binary (trac-11426)\n                                    // For XHR2 non-text, let the caller handle it (gh-2498)\n                                    ( xhr.responseType || \"text\" ) !== \"text\"  ||\n                                    typeof xhr.responseText !== \"string\" ?\n                                        { binary: xhr.response } :\n                                        { text: xhr.responseText },\n                                    xhr.getAllResponseHeaders()\n                                );\n                            }\n                        }\n                    };\n                };\n\n                // Listen to events\n                xhr.onload = callback();\n                errorCallback = xhr.onerror = callback( \"error\" );\n\n                // Support: IE 9 only\n                // Use onreadystatechange to replace onabort\n                // to handle uncaught aborts\n                if ( xhr.onabort !== undefined ) {\n                    xhr.onabort = errorCallback;\n                } else {\n                    xhr.onreadystatechange = function() {\n\n                        // Check readyState before timeout as it changes\n                        if ( xhr.readyState === 4 ) {\n\n                            // Allow onerror to be called first,\n                            // but that will not handle a native abort\n                            // Also, save errorCallback to a variable\n                            // as xhr.onerror cannot be accessed\n                            window.setTimeout( function() {\n                                if ( callback ) {\n                                    errorCallback();\n                                }\n                            } );\n                        }\n                    };\n                }\n\n                // Create the abort callback\n                callback = callback( \"abort\" );\n\n                try {\n\n                    // Do send the request (this may raise an exception)\n                    xhr.send( options.hasContent && options.data || null );\n                } catch ( e ) {\n\n                    // #14683: Only rethrow if this hasn't been notified as an error yet\n                    if ( callback ) {\n                        throw e;\n                    }\n                }\n            },\n\n            abort: function() {\n                if ( callback ) {\n                    callback();\n                }\n            }\n        };\n    }\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n    if ( s.crossDomain ) {\n        s.contents.script = false;\n    }\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n    accepts: {\n        script: \"text/javascript, application/javascript, \" +\n            \"application/ecmascript, application/x-ecmascript\"\n    },\n    contents: {\n        script: /\\b(?:java|ecma)script\\b/\n    },\n    converters: {\n        \"text script\": function( text ) {\n            jQuery.globalEval( text );\n            return text;\n        }\n    }\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n    if ( s.cache === undefined ) {\n        s.cache = false;\n    }\n    if ( s.crossDomain ) {\n        s.type = \"GET\";\n    }\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n    // This transport only deals with cross domain requests\n    if ( s.crossDomain ) {\n        var script, callback;\n        return {\n            send: function( _, complete ) {\n                script = jQuery( \"<script>\" ).prop( {\n                    charset: s.scriptCharset,\n                    src: s.url\n                } ).on(\n                    \"load error\",\n                    callback = function( evt ) {\n                        script.remove();\n                        callback = null;\n                        if ( evt ) {\n                            complete( evt.type === \"error\" ? 404 : 200, evt.type );\n                        }\n                    }\n                );\n\n                // Use native DOM manipulation to avoid our domManip AJAX trickery\n                document.head.appendChild( script[ 0 ] );\n            },\n            abort: function() {\n                if ( callback ) {\n                    callback();\n                }\n            }\n        };\n    }\n} );\n\n\n\n\nvar oldCallbacks = [],\n    rjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n    jsonp: \"callback\",\n    jsonpCallback: function() {\n        var callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\n        this[ callback ] = true;\n        return callback;\n    }\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n    var callbackName, overwritten, responseContainer,\n        jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n            \"url\" :\n            typeof s.data === \"string\" &&\n                ( s.contentType || \"\" )\n                    .indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n                rjsonp.test( s.data ) && \"data\"\n        );\n\n    // Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n    if ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n        // Get callback name, remembering preexisting value associated with it\n        callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n            s.jsonpCallback() :\n            s.jsonpCallback;\n\n        // Insert callback into url or form data\n        if ( jsonProp ) {\n            s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n        } else if ( s.jsonp !== false ) {\n            s.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n        }\n\n        // Use data converter to retrieve json after script execution\n        s.converters[ \"script json\" ] = function() {\n            if ( !responseContainer ) {\n                jQuery.error( callbackName + \" was not called\" );\n            }\n            return responseContainer[ 0 ];\n        };\n\n        // Force json dataType\n        s.dataTypes[ 0 ] = \"json\";\n\n        // Install callback\n        overwritten = window[ callbackName ];\n        window[ callbackName ] = function() {\n            responseContainer = arguments;\n        };\n\n        // Clean-up function (fires after converters)\n        jqXHR.always( function() {\n\n            // If previous value didn't exist - remove it\n            if ( overwritten === undefined ) {\n                jQuery( window ).removeProp( callbackName );\n\n            // Otherwise restore preexisting value\n            } else {\n                window[ callbackName ] = overwritten;\n            }\n\n            // Save back as free\n            if ( s[ callbackName ] ) {\n\n                // Make sure that re-using the options doesn't screw things around\n                s.jsonpCallback = originalSettings.jsonpCallback;\n\n                // Save the callback name for future use\n                oldCallbacks.push( callbackName );\n            }\n\n            // Call if it was a function and we have a response\n            if ( responseContainer && jQuery.isFunction( overwritten ) ) {\n                overwritten( responseContainer[ 0 ] );\n            }\n\n            responseContainer = overwritten = undefined;\n        } );\n\n        // Delegate to script\n        return \"script\";\n    }\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n    var body = document.implementation.createHTMLDocument( \"\" ).body;\n    body.innerHTML = \"<form></form><form></form>\";\n    return body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n    if ( typeof data !== \"string\" ) {\n        return [];\n    }\n    if ( typeof context === \"boolean\" ) {\n        keepScripts = context;\n        context = false;\n    }\n\n    var base, parsed, scripts;\n\n    if ( !context ) {\n\n        // Stop scripts or inline event handlers from being executed immediately\n        // by using document.implementation\n        if ( support.createHTMLDocument ) {\n            context = document.implementation.createHTMLDocument( \"\" );\n\n            // Set the base href for the created document\n            // so any parsed elements with URLs\n            // are based on the document's URL (gh-2965)\n            base = context.createElement( \"base\" );\n            base.href = document.location.href;\n            context.head.appendChild( base );\n        } else {\n            context = document;\n        }\n    }\n\n    parsed = rsingleTag.exec( data );\n    scripts = !keepScripts && [];\n\n    // Single tag\n    if ( parsed ) {\n        return [ context.createElement( parsed[ 1 ] ) ];\n    }\n\n    parsed = buildFragment( [ data ], context, scripts );\n\n    if ( scripts && scripts.length ) {\n        jQuery( scripts ).remove();\n    }\n\n    return jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n    var selector, type, response,\n        self = this,\n        off = url.indexOf( \" \" );\n\n    if ( off > -1 ) {\n        selector = stripAndCollapse( url.slice( off ) );\n        url = url.slice( 0, off );\n    }\n\n    // If it's a function\n    if ( jQuery.isFunction( params ) ) {\n\n        // We assume that it's the callback\n        callback = params;\n        params = undefined;\n\n    // Otherwise, build a param string\n    } else if ( params && typeof params === \"object\" ) {\n        type = \"POST\";\n    }\n\n    // If we have elements to modify, make the request\n    if ( self.length > 0 ) {\n        jQuery.ajax( {\n            url: url,\n\n            // If \"type\" variable is undefined, then \"GET\" method will be used.\n            // Make value of this field explicit since\n            // user can override it through ajaxSetup method\n            type: type || \"GET\",\n            dataType: \"html\",\n            data: params\n        } ).done( function( responseText ) {\n\n            // Save response for use in complete callback\n            response = arguments;\n\n            self.html( selector ?\n\n                // If a selector was specified, locate the right elements in a dummy div\n                // Exclude scripts to avoid IE 'Permission Denied' errors\n                jQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n                // Otherwise use the full result\n                responseText );\n\n        // If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n        // but they are ignored because response was set above.\n        // If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n        } ).always( callback && function( jqXHR, status ) {\n            self.each( function() {\n                callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n            } );\n        } );\n    }\n\n    return this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [\n    \"ajaxStart\",\n    \"ajaxStop\",\n    \"ajaxComplete\",\n    \"ajaxError\",\n    \"ajaxSuccess\",\n    \"ajaxSend\"\n], function( i, type ) {\n    jQuery.fn[ type ] = function( fn ) {\n        return this.on( type, fn );\n    };\n} );\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n    return jQuery.grep( jQuery.timers, function( fn ) {\n        return elem === fn.elem;\n    } ).length;\n};\n\n\n\n\n/**\n * Gets a window from an element\n */\nfunction getWindow( elem ) {\n    return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}\n\njQuery.offset = {\n    setOffset: function( elem, options, i ) {\n        var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n            position = jQuery.css( elem, \"position\" ),\n            curElem = jQuery( elem ),\n            props = {};\n\n        // Set position first, in-case top/left are set even on static elem\n        if ( position === \"static\" ) {\n            elem.style.position = \"relative\";\n        }\n\n        curOffset = curElem.offset();\n        curCSSTop = jQuery.css( elem, \"top\" );\n        curCSSLeft = jQuery.css( elem, \"left\" );\n        calculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n            ( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n        // Need to be able to calculate position if either\n        // top or left is auto and position is either absolute or fixed\n        if ( calculatePosition ) {\n            curPosition = curElem.position();\n            curTop = curPosition.top;\n            curLeft = curPosition.left;\n\n        } else {\n            curTop = parseFloat( curCSSTop ) || 0;\n            curLeft = parseFloat( curCSSLeft ) || 0;\n        }\n\n        if ( jQuery.isFunction( options ) ) {\n\n            // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n            options = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n        }\n\n        if ( options.top != null ) {\n            props.top = ( options.top - curOffset.top ) + curTop;\n        }\n        if ( options.left != null ) {\n            props.left = ( options.left - curOffset.left ) + curLeft;\n        }\n\n        if ( \"using\" in options ) {\n            options.using.call( elem, props );\n\n        } else {\n            curElem.css( props );\n        }\n    }\n};\n\njQuery.fn.extend( {\n    offset: function( options ) {\n\n        // Preserve chaining for setter\n        if ( arguments.length ) {\n            return options === undefined ?\n                this :\n                this.each( function( i ) {\n                    jQuery.offset.setOffset( this, options, i );\n                } );\n        }\n\n        var docElem, win, rect, doc,\n            elem = this[ 0 ];\n\n        if ( !elem ) {\n            return;\n        }\n\n        // Support: IE <=11 only\n        // Running getBoundingClientRect on a\n        // disconnected node in IE throws an error\n        if ( !elem.getClientRects().length ) {\n            return { top: 0, left: 0 };\n        }\n\n        rect = elem.getBoundingClientRect();\n\n        // Make sure element is not hidden (display: none)\n        if ( rect.width || rect.height ) {\n            doc = elem.ownerDocument;\n            win = getWindow( doc );\n            docElem = doc.documentElement;\n\n            return {\n                top: rect.top + win.pageYOffset - docElem.clientTop,\n                left: rect.left + win.pageXOffset - docElem.clientLeft\n            };\n        }\n\n        // Return zeros for disconnected and hidden elements (gh-2310)\n        return rect;\n    },\n\n    position: function() {\n        if ( !this[ 0 ] ) {\n            return;\n        }\n\n        var offsetParent, offset,\n            elem = this[ 0 ],\n            parentOffset = { top: 0, left: 0 };\n\n        // Fixed elements are offset from window (parentOffset = {top:0, left: 0},\n        // because it is its only offset parent\n        if ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n            // Assume getBoundingClientRect is there when computed position is fixed\n            offset = elem.getBoundingClientRect();\n\n        } else {\n\n            // Get *real* offsetParent\n            offsetParent = this.offsetParent();\n\n            // Get correct offsets\n            offset = this.offset();\n            if ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n                parentOffset = offsetParent.offset();\n            }\n\n            // Add offsetParent borders\n            parentOffset = {\n                top: parentOffset.top + jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true ),\n                left: parentOffset.left + jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true )\n            };\n        }\n\n        // Subtract parent offsets and element margins\n        return {\n            top: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n            left: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n        };\n    },\n\n    // This method will return documentElement in the following cases:\n    // 1) For the element inside the iframe without offsetParent, this method will return\n    //    documentElement of the parent window\n    // 2) For the hidden or detached element\n    // 3) For body or html element, i.e. in case of the html node - it will return itself\n    //\n    // but those exceptions were never presented as a real life use-cases\n    // and might be considered as more preferable results.\n    //\n    // This logic, however, is not guaranteed and can change at any point in the future\n    offsetParent: function() {\n        return this.map( function() {\n            var offsetParent = this.offsetParent;\n\n            while ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n                offsetParent = offsetParent.offsetParent;\n            }\n\n            return offsetParent || documentElement;\n        } );\n    }\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n    var top = \"pageYOffset\" === prop;\n\n    jQuery.fn[ method ] = function( val ) {\n        return access( this, function( elem, method, val ) {\n            var win = getWindow( elem );\n\n            if ( val === undefined ) {\n                return win ? win[ prop ] : elem[ method ];\n            }\n\n            if ( win ) {\n                win.scrollTo(\n                    !top ? val : win.pageXOffset,\n                    top ? val : win.pageYOffset\n                );\n\n            } else {\n                elem[ method ] = val;\n            }\n        }, method, val, arguments.length );\n    };\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n    jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n        function( elem, computed ) {\n            if ( computed ) {\n                computed = curCSS( elem, prop );\n\n                // If curCSS returns percentage, fallback to offset\n                return rnumnonpx.test( computed ) ?\n                    jQuery( elem ).position()[ prop ] + \"px\" :\n                    computed;\n            }\n        }\n    );\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n    jQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n        function( defaultExtra, funcName ) {\n\n        // Margin is only for outerHeight, outerWidth\n        jQuery.fn[ funcName ] = function( margin, value ) {\n            var chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n                extra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n            return access( this, function( elem, type, value ) {\n                var doc;\n\n                if ( jQuery.isWindow( elem ) ) {\n\n                    // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n                    return funcName.indexOf( \"outer\" ) === 0 ?\n                        elem[ \"inner\" + name ] :\n                        elem.document.documentElement[ \"client\" + name ];\n                }\n\n                // Get document width or height\n                if ( elem.nodeType === 9 ) {\n                    doc = elem.documentElement;\n\n                    // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n                    // whichever is greatest\n                    return Math.max(\n                        elem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n                        elem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n                        doc[ \"client\" + name ]\n                    );\n                }\n\n                return value === undefined ?\n\n                    // Get width or height on the element, requesting but not forcing parseFloat\n                    jQuery.css( elem, type, extra ) :\n\n                    // Set width or height on the element\n                    jQuery.style( elem, type, value, extra );\n            }, type, chainable ? margin : undefined, chainable );\n        };\n    } );\n} );\n\n\njQuery.fn.extend( {\n\n    bind: function( types, data, fn ) {\n        return this.on( types, null, data, fn );\n    },\n    unbind: function( types, fn ) {\n        return this.off( types, null, fn );\n    },\n\n    delegate: function( selector, types, data, fn ) {\n        return this.on( types, selector, data, fn );\n    },\n    undelegate: function( selector, types, fn ) {\n\n        // ( namespace ) or ( selector, types [, fn] )\n        return arguments.length === 1 ?\n            this.off( selector, \"**\" ) :\n            this.off( types, selector || \"**\", fn );\n    }\n} );\n\njQuery.parseJSON = JSON.parse;\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n    define( \"jquery\", [], function() {\n        return jQuery;\n    } );\n}\n\n\n\n\nvar\n\n    // Map over jQuery in case of overwrite\n    _jQuery = window.jQuery,\n\n    // Map over the $ in case of overwrite\n    _$ = window.$;\n\njQuery.noConflict = function( deep ) {\n    if ( window.$ === jQuery ) {\n        window.$ = _$;\n    }\n\n    if ( deep && window.jQuery === jQuery ) {\n        window.jQuery = _jQuery;\n    }\n\n    return jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( !noGlobal ) {\n    window.jQuery = window.$ = jQuery;\n}\n\n\n\n\n\nreturn jQuery;\n} );"
  },
  {
    "path": "lib/require.js",
    "content": "/** vim: et:ts=4:sw=4:sts=4\n * @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.\n * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE\n */\n//Not using strict: uneven strict support in browsers, #392, and causes\n//problems with requirejs.exec()/transpiler plugins that may not be strict.\n/*jslint regexp: true, nomen: true, sloppy: true */\n/*global window, navigator, document, importScripts, setTimeout, opera */\n\nvar requirejs, require, define;\n(function (global, setTimeout) {\n    var req, s, head, baseElement, dataMain, src,\n        interactiveScript, currentlyAddingScript, mainScript, subPath,\n        version = '2.3.2',\n        commentRegExp = /\\/\\*[\\s\\S]*?\\*\\/|([^:\"'=]|^)\\/\\/.*$/mg,\n        cjsRequireRegExp = /[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,\n        jsSuffixRegExp = /\\.js$/,\n        currDirRegExp = /^\\.\\//,\n        op = Object.prototype,\n        ostring = op.toString,\n        hasOwn = op.hasOwnProperty,\n        isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),\n        isWebWorker = !isBrowser && typeof importScripts !== 'undefined',\n        //PS3 indicates loaded and complete, but need to wait for complete\n        //specifically. Sequence is 'loading', 'loaded', execution,\n        // then 'complete'. The UA check is unfortunate, but not sure how\n        //to feature test w/o causing perf issues.\n        readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?\n                      /^complete$/ : /^(complete|loaded)$/,\n        defContextName = '_',\n        //Oh the tragedy, detecting opera. See the usage of isOpera for reason.\n        isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',\n        contexts = {},\n        cfg = {},\n        globalDefQueue = [],\n        useInteractive = false;\n\n    //Could match something like ')//comment', do not lose the prefix to comment.\n    function commentReplace(match, singlePrefix) {\n        return singlePrefix || '';\n    }\n\n    function isFunction(it) {\n        return ostring.call(it) === '[object Function]';\n    }\n\n    function isArray(it) {\n        return ostring.call(it) === '[object Array]';\n    }\n\n    /**\n     * Helper function for iterating over an array. If the func returns\n     * a true value, it will break out of the loop.\n     */\n    function each(ary, func) {\n        if (ary) {\n            var i;\n            for (i = 0; i < ary.length; i += 1) {\n                if (ary[i] && func(ary[i], i, ary)) {\n                    break;\n                }\n            }\n        }\n    }\n\n    /**\n     * Helper function for iterating over an array backwards. If the func\n     * returns a true value, it will break out of the loop.\n     */\n    function eachReverse(ary, func) {\n        if (ary) {\n            var i;\n            for (i = ary.length - 1; i > -1; i -= 1) {\n                if (ary[i] && func(ary[i], i, ary)) {\n                    break;\n                }\n            }\n        }\n    }\n\n    function hasProp(obj, prop) {\n        return hasOwn.call(obj, prop);\n    }\n\n    function getOwn(obj, prop) {\n        return hasProp(obj, prop) && obj[prop];\n    }\n\n    /**\n     * Cycles over properties in an object and calls a function for each\n     * property value. If the function returns a truthy value, then the\n     * iteration is stopped.\n     */\n    function eachProp(obj, func) {\n        var prop;\n        for (prop in obj) {\n            if (hasProp(obj, prop)) {\n                if (func(obj[prop], prop)) {\n                    break;\n                }\n            }\n        }\n    }\n\n    /**\n     * Simple function to mix in properties from source into target,\n     * but only if target does not already have a property of the same name.\n     */\n    function mixin(target, source, force, deepStringMixin) {\n        if (source) {\n            eachProp(source, function (value, prop) {\n                if (force || !hasProp(target, prop)) {\n                    if (deepStringMixin && typeof value === 'object' && value &&\n                        !isArray(value) && !isFunction(value) &&\n                        !(value instanceof RegExp)) {\n\n                        if (!target[prop]) {\n                            target[prop] = {};\n                        }\n                        mixin(target[prop], value, force, deepStringMixin);\n                    } else {\n                        target[prop] = value;\n                    }\n                }\n            });\n        }\n        return target;\n    }\n\n    //Similar to Function.prototype.bind, but the 'this' object is specified\n    //first, since it is easier to read/figure out what 'this' will be.\n    function bind(obj, fn) {\n        return function () {\n            return fn.apply(obj, arguments);\n        };\n    }\n\n    function scripts() {\n        return document.getElementsByTagName('script');\n    }\n\n    function defaultOnError(err) {\n        throw err;\n    }\n\n    //Allow getting a global that is expressed in\n    //dot notation, like 'a.b.c'.\n    function getGlobal(value) {\n        if (!value) {\n            return value;\n        }\n        var g = global;\n        each(value.split('.'), function (part) {\n            g = g[part];\n        });\n        return g;\n    }\n\n    /**\n     * Constructs an error with a pointer to an URL with more information.\n     * @param {String} id the error ID that maps to an ID on a web page.\n     * @param {String} message human readable error.\n     * @param {Error} [err] the original error, if there is one.\n     *\n     * @returns {Error}\n     */\n    function makeError(id, msg, err, requireModules) {\n        var e = new Error(msg + '\\nhttp://requirejs.org/docs/errors.html#' + id);\n        e.requireType = id;\n        e.requireModules = requireModules;\n        if (err) {\n            e.originalError = err;\n        }\n        return e;\n    }\n\n    if (typeof define !== 'undefined') {\n        //If a define is already in play via another AMD loader,\n        //do not overwrite.\n        return;\n    }\n\n    if (typeof requirejs !== 'undefined') {\n        if (isFunction(requirejs)) {\n            //Do not overwrite an existing requirejs instance.\n            return;\n        }\n        cfg = requirejs;\n        requirejs = undefined;\n    }\n\n    //Allow for a require config object\n    if (typeof require !== 'undefined' && !isFunction(require)) {\n        //assume it is a config object.\n        cfg = require;\n        require = undefined;\n    }\n\n    function newContext(contextName) {\n        var inCheckLoaded, Module, context, handlers,\n            checkLoadedTimeoutId,\n            config = {\n                //Defaults. Do not set a default for map\n                //config to speed up normalize(), which\n                //will run faster if there is no default.\n                waitSeconds: 7,\n                baseUrl: './',\n                paths: {},\n                bundles: {},\n                pkgs: {},\n                shim: {},\n                config: {}\n            },\n            registry = {},\n            //registry of just enabled modules, to speed\n            //cycle breaking code when lots of modules\n            //are registered, but not activated.\n            enabledRegistry = {},\n            undefEvents = {},\n            defQueue = [],\n            defined = {},\n            urlFetched = {},\n            bundlesMap = {},\n            requireCounter = 1,\n            unnormalizedCounter = 1;\n\n        /**\n         * Trims the . and .. from an array of path segments.\n         * It will keep a leading path segment if a .. will become\n         * the first path segment, to help with module name lookups,\n         * which act like paths, but can be remapped. But the end result,\n         * all paths that use this function should look normalized.\n         * NOTE: this method MODIFIES the input array.\n         * @param {Array} ary the array of path segments.\n         */\n        function trimDots(ary) {\n            var i, part;\n            for (i = 0; i < ary.length; i++) {\n                part = ary[i];\n                if (part === '.') {\n                    ary.splice(i, 1);\n                    i -= 1;\n                } else if (part === '..') {\n                    // If at the start, or previous value is still ..,\n                    // keep them so that when converted to a path it may\n                    // still work when converted to a path, even though\n                    // as an ID it is less than ideal. In larger point\n                    // releases, may be better to just kick out an error.\n                    if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {\n                        continue;\n                    } else if (i > 0) {\n                        ary.splice(i - 1, 2);\n                        i -= 2;\n                    }\n                }\n            }\n        }\n\n        /**\n         * Given a relative module name, like ./something, normalize it to\n         * a real name that can be mapped to a path.\n         * @param {String} name the relative name\n         * @param {String} baseName a real name that the name arg is relative\n         * to.\n         * @param {Boolean} applyMap apply the map config to the value. Should\n         * only be done if this normalization is for a dependency ID.\n         * @returns {String} normalized name\n         */\n        function normalize(name, baseName, applyMap) {\n            var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,\n                foundMap, foundI, foundStarMap, starI, normalizedBaseParts,\n                baseParts = (baseName && baseName.split('/')),\n                map = config.map,\n                starMap = map && map['*'];\n\n            //Adjust any relative paths.\n            if (name) {\n                name = name.split('/');\n                lastIndex = name.length - 1;\n\n                // If wanting node ID compatibility, strip .js from end\n                // of IDs. Have to do this here, and not in nameToUrl\n                // because node allows either .js or non .js to map\n                // to same file.\n                if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\n                    name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\n                }\n\n                // Starts with a '.' so need the baseName\n                if (name[0].charAt(0) === '.' && baseParts) {\n                    //Convert baseName to array, and lop off the last part,\n                    //so that . matches that 'directory' and not name of the baseName's\n                    //module. For instance, baseName of 'one/two/three', maps to\n                    //'one/two/three.js', but we want the directory, 'one/two' for\n                    //this normalization.\n                    normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);\n                    name = normalizedBaseParts.concat(name);\n                }\n\n                trimDots(name);\n                name = name.join('/');\n            }\n\n            //Apply map config if available.\n            if (applyMap && map && (baseParts || starMap)) {\n                nameParts = name.split('/');\n\n                outerLoop: for (i = nameParts.length; i > 0; i -= 1) {\n                    nameSegment = nameParts.slice(0, i).join('/');\n\n                    if (baseParts) {\n                        //Find the longest baseName segment match in the config.\n                        //So, do joins on the biggest to smallest lengths of baseParts.\n                        for (j = baseParts.length; j > 0; j -= 1) {\n                            mapValue = getOwn(map, baseParts.slice(0, j).join('/'));\n\n                            //baseName segment has config, find if it has one for\n                            //this name.\n                            if (mapValue) {\n                                mapValue = getOwn(mapValue, nameSegment);\n                                if (mapValue) {\n                                    //Match, update name to the new value.\n                                    foundMap = mapValue;\n                                    foundI = i;\n                                    break outerLoop;\n                                }\n                            }\n                        }\n                    }\n\n                    //Check for a star map match, but just hold on to it,\n                    //if there is a shorter segment match later in a matching\n                    //config, then favor over this star map.\n                    if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {\n                        foundStarMap = getOwn(starMap, nameSegment);\n                        starI = i;\n                    }\n                }\n\n                if (!foundMap && foundStarMap) {\n                    foundMap = foundStarMap;\n                    foundI = starI;\n                }\n\n                if (foundMap) {\n                    nameParts.splice(0, foundI, foundMap);\n                    name = nameParts.join('/');\n                }\n            }\n\n            // If the name points to a package's name, use\n            // the package main instead.\n            pkgMain = getOwn(config.pkgs, name);\n\n            return pkgMain ? pkgMain : name;\n        }\n\n        function removeScript(name) {\n            if (isBrowser) {\n                each(scripts(), function (scriptNode) {\n                    if (scriptNode.getAttribute('data-requiremodule') === name &&\n                            scriptNode.getAttribute('data-requirecontext') === context.contextName) {\n                        scriptNode.parentNode.removeChild(scriptNode);\n                        return true;\n                    }\n                });\n            }\n        }\n\n        function hasPathFallback(id) {\n            var pathConfig = getOwn(config.paths, id);\n            if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {\n                //Pop off the first array value, since it failed, and\n                //retry\n                pathConfig.shift();\n                context.require.undef(id);\n\n                //Custom require that does not do map translation, since\n                //ID is \"absolute\", already mapped/resolved.\n                context.makeRequire(null, {\n                    skipMap: true\n                })([id]);\n\n                return true;\n            }\n        }\n\n        //Turns a plugin!resource to [plugin, resource]\n        //with the plugin being undefined if the name\n        //did not have a plugin prefix.\n        function splitPrefix(name) {\n            var prefix,\n                index = name ? name.indexOf('!') : -1;\n            if (index > -1) {\n                prefix = name.substring(0, index);\n                name = name.substring(index + 1, name.length);\n            }\n            return [prefix, name];\n        }\n\n        /**\n         * Creates a module mapping that includes plugin prefix, module\n         * name, and path. If parentModuleMap is provided it will\n         * also normalize the name via require.normalize()\n         *\n         * @param {String} name the module name\n         * @param {String} [parentModuleMap] parent module map\n         * for the module name, used to resolve relative names.\n         * @param {Boolean} isNormalized: is the ID already normalized.\n         * This is true if this call is done for a define() module ID.\n         * @param {Boolean} applyMap: apply the map config to the ID.\n         * Should only be true if this map is for a dependency.\n         *\n         * @returns {Object}\n         */\n        function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {\n            var url, pluginModule, suffix, nameParts,\n                prefix = null,\n                parentName = parentModuleMap ? parentModuleMap.name : null,\n                originalName = name,\n                isDefine = true,\n                normalizedName = '';\n\n            //If no name, then it means it is a require call, generate an\n            //internal name.\n            if (!name) {\n                isDefine = false;\n                name = '_@r' + (requireCounter += 1);\n            }\n\n            nameParts = splitPrefix(name);\n            prefix = nameParts[0];\n            name = nameParts[1];\n\n            if (prefix) {\n                prefix = normalize(prefix, parentName, applyMap);\n                pluginModule = getOwn(defined, prefix);\n            }\n\n            //Account for relative paths if there is a base name.\n            if (name) {\n                if (prefix) {\n                    if (pluginModule && pluginModule.normalize) {\n                        //Plugin is loaded, use its normalize method.\n                        normalizedName = pluginModule.normalize(name, function (name) {\n                            return normalize(name, parentName, applyMap);\n                        });\n                    } else {\n                        // If nested plugin references, then do not try to\n                        // normalize, as it will not normalize correctly. This\n                        // places a restriction on resourceIds, and the longer\n                        // term solution is not to normalize until plugins are\n                        // loaded and all normalizations to allow for async\n                        // loading of a loader plugin. But for now, fixes the\n                        // common uses. Details in #1131\n                        normalizedName = name.indexOf('!') === -1 ?\n                                         normalize(name, parentName, applyMap) :\n                                         name;\n                    }\n                } else {\n                    //A regular module.\n                    normalizedName = normalize(name, parentName, applyMap);\n\n                    //Normalized name may be a plugin ID due to map config\n                    //application in normalize. The map config values must\n                    //already be normalized, so do not need to redo that part.\n                    nameParts = splitPrefix(normalizedName);\n                    prefix = nameParts[0];\n                    normalizedName = nameParts[1];\n                    isNormalized = true;\n\n                    url = context.nameToUrl(normalizedName);\n                }\n            }\n\n            //If the id is a plugin id that cannot be determined if it needs\n            //normalization, stamp it with a unique ID so two matching relative\n            //ids that may conflict can be separate.\n            suffix = prefix && !pluginModule && !isNormalized ?\n                     '_unnormalized' + (unnormalizedCounter += 1) :\n                     '';\n\n            return {\n                prefix: prefix,\n                name: normalizedName,\n                parentMap: parentModuleMap,\n                unnormalized: !!suffix,\n                url: url,\n                originalName: originalName,\n                isDefine: isDefine,\n                id: (prefix ?\n                        prefix + '!' + normalizedName :\n                        normalizedName) + suffix\n            };\n        }\n\n        function getModule(depMap) {\n            var id = depMap.id,\n                mod = getOwn(registry, id);\n\n            if (!mod) {\n                mod = registry[id] = new context.Module(depMap);\n            }\n\n            return mod;\n        }\n\n        function on(depMap, name, fn) {\n            var id = depMap.id,\n                mod = getOwn(registry, id);\n\n            if (hasProp(defined, id) &&\n                    (!mod || mod.defineEmitComplete)) {\n                if (name === 'defined') {\n                    fn(defined[id]);\n                }\n            } else {\n                mod = getModule(depMap);\n                if (mod.error && name === 'error') {\n                    fn(mod.error);\n                } else {\n                    mod.on(name, fn);\n                }\n            }\n        }\n\n        function onError(err, errback) {\n            var ids = err.requireModules,\n                notified = false;\n\n            if (errback) {\n                errback(err);\n            } else {\n                each(ids, function (id) {\n                    var mod = getOwn(registry, id);\n                    if (mod) {\n                        //Set error on module, so it skips timeout checks.\n                        mod.error = err;\n                        if (mod.events.error) {\n                            notified = true;\n                            mod.emit('error', err);\n                        }\n                    }\n                });\n\n                if (!notified) {\n                    req.onError(err);\n                }\n            }\n        }\n\n        /**\n         * Internal method to transfer globalQueue items to this context's\n         * defQueue.\n         */\n        function takeGlobalQueue() {\n            //Push all the globalDefQueue items into the context's defQueue\n            if (globalDefQueue.length) {\n                each(globalDefQueue, function(queueItem) {\n                    var id = queueItem[0];\n                    if (typeof id === 'string') {\n                        context.defQueueMap[id] = true;\n                    }\n                    defQueue.push(queueItem);\n                });\n                globalDefQueue = [];\n            }\n        }\n\n        handlers = {\n            'require': function (mod) {\n                if (mod.require) {\n                    return mod.require;\n                } else {\n                    return (mod.require = context.makeRequire(mod.map));\n                }\n            },\n            'exports': function (mod) {\n                mod.usingExports = true;\n                if (mod.map.isDefine) {\n                    if (mod.exports) {\n                        return (defined[mod.map.id] = mod.exports);\n                    } else {\n                        return (mod.exports = defined[mod.map.id] = {});\n                    }\n                }\n            },\n            'module': function (mod) {\n                if (mod.module) {\n                    return mod.module;\n                } else {\n                    return (mod.module = {\n                        id: mod.map.id,\n                        uri: mod.map.url,\n                        config: function () {\n                            return getOwn(config.config, mod.map.id) || {};\n                        },\n                        exports: mod.exports || (mod.exports = {})\n                    });\n                }\n            }\n        };\n\n        function cleanRegistry(id) {\n            //Clean up machinery used for waiting modules.\n            delete registry[id];\n            delete enabledRegistry[id];\n        }\n\n        function breakCycle(mod, traced, processed) {\n            var id = mod.map.id;\n\n            if (mod.error) {\n                mod.emit('error', mod.error);\n            } else {\n                traced[id] = true;\n                each(mod.depMaps, function (depMap, i) {\n                    var depId = depMap.id,\n                        dep = getOwn(registry, depId);\n\n                    //Only force things that have not completed\n                    //being defined, so still in the registry,\n                    //and only if it has not been matched up\n                    //in the module already.\n                    if (dep && !mod.depMatched[i] && !processed[depId]) {\n                        if (getOwn(traced, depId)) {\n                            mod.defineDep(i, defined[depId]);\n                            mod.check(); //pass false?\n                        } else {\n                            breakCycle(dep, traced, processed);\n                        }\n                    }\n                });\n                processed[id] = true;\n            }\n        }\n\n        function checkLoaded() {\n            var err, usingPathFallback,\n                waitInterval = config.waitSeconds * 1000,\n                //It is possible to disable the wait interval by using waitSeconds of 0.\n                expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),\n                noLoads = [],\n                reqCalls = [],\n                stillLoading = false,\n                needCycleCheck = true;\n\n            //Do not bother if this call was a result of a cycle break.\n            if (inCheckLoaded) {\n                return;\n            }\n\n            inCheckLoaded = true;\n\n            //Figure out the state of all the modules.\n            eachProp(enabledRegistry, function (mod) {\n                var map = mod.map,\n                    modId = map.id;\n\n                //Skip things that are not enabled or in error state.\n                if (!mod.enabled) {\n                    return;\n                }\n\n                if (!map.isDefine) {\n                    reqCalls.push(mod);\n                }\n\n                if (!mod.error) {\n                    //If the module should be executed, and it has not\n                    //been inited and time is up, remember it.\n                    if (!mod.inited && expired) {\n                        if (hasPathFallback(modId)) {\n                            usingPathFallback = true;\n                            stillLoading = true;\n                        } else {\n                            noLoads.push(modId);\n                            removeScript(modId);\n                        }\n                    } else if (!mod.inited && mod.fetched && map.isDefine) {\n                        stillLoading = true;\n                        if (!map.prefix) {\n                            //No reason to keep looking for unfinished\n                            //loading. If the only stillLoading is a\n                            //plugin resource though, keep going,\n                            //because it may be that a plugin resource\n                            //is waiting on a non-plugin cycle.\n                            return (needCycleCheck = false);\n                        }\n                    }\n                }\n            });\n\n            if (expired && noLoads.length) {\n                //If wait time expired, throw error of unloaded modules.\n                err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);\n                err.contextName = context.contextName;\n                return onError(err);\n            }\n\n            //Not expired, check for a cycle.\n            if (needCycleCheck) {\n                each(reqCalls, function (mod) {\n                    breakCycle(mod, {}, {});\n                });\n            }\n\n            //If still waiting on loads, and the waiting load is something\n            //other than a plugin resource, or there are still outstanding\n            //scripts, then just try back later.\n            if ((!expired || usingPathFallback) && stillLoading) {\n                //Something is still waiting to load. Wait for it, but only\n                //if a timeout is not already in effect.\n                if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {\n                    checkLoadedTimeoutId = setTimeout(function () {\n                        checkLoadedTimeoutId = 0;\n                        checkLoaded();\n                    }, 50);\n                }\n            }\n\n            inCheckLoaded = false;\n        }\n\n        Module = function (map) {\n            this.events = getOwn(undefEvents, map.id) || {};\n            this.map = map;\n            this.shim = getOwn(config.shim, map.id);\n            this.depExports = [];\n            this.depMaps = [];\n            this.depMatched = [];\n            this.pluginMaps = {};\n            this.depCount = 0;\n\n            /* this.exports this.factory\n               this.depMaps = [],\n               this.enabled, this.fetched\n            */\n        };\n\n        Module.prototype = {\n            init: function (depMaps, factory, errback, options) {\n                options = options || {};\n\n                //Do not do more inits if already done. Can happen if there\n                //are multiple define calls for the same module. That is not\n                //a normal, common case, but it is also not unexpected.\n                if (this.inited) {\n                    return;\n                }\n\n                this.factory = factory;\n\n                if (errback) {\n                    //Register for errors on this module.\n                    this.on('error', errback);\n                } else if (this.events.error) {\n                    //If no errback already, but there are error listeners\n                    //on this module, set up an errback to pass to the deps.\n                    errback = bind(this, function (err) {\n                        this.emit('error', err);\n                    });\n                }\n\n                //Do a copy of the dependency array, so that\n                //source inputs are not modified. For example\n                //\"shim\" deps are passed in here directly, and\n                //doing a direct modification of the depMaps array\n                //would affect that config.\n                this.depMaps = depMaps && depMaps.slice(0);\n\n                this.errback = errback;\n\n                //Indicate this module has be initialized\n                this.inited = true;\n\n                this.ignore = options.ignore;\n\n                //Could have option to init this module in enabled mode,\n                //or could have been previously marked as enabled. However,\n                //the dependencies are not known until init is called. So\n                //if enabled previously, now trigger dependencies as enabled.\n                if (options.enabled || this.enabled) {\n                    //Enable this module and dependencies.\n                    //Will call this.check()\n                    this.enable();\n                } else {\n                    this.check();\n                }\n            },\n\n            defineDep: function (i, depExports) {\n                //Because of cycles, defined callback for a given\n                //export can be called more than once.\n                if (!this.depMatched[i]) {\n                    this.depMatched[i] = true;\n                    this.depCount -= 1;\n                    this.depExports[i] = depExports;\n                }\n            },\n\n            fetch: function () {\n                if (this.fetched) {\n                    return;\n                }\n                this.fetched = true;\n\n                context.startTime = (new Date()).getTime();\n\n                var map = this.map;\n\n                //If the manager is for a plugin managed resource,\n                //ask the plugin to load it now.\n                if (this.shim) {\n                    context.makeRequire(this.map, {\n                        enableBuildCallback: true\n                    })(this.shim.deps || [], bind(this, function () {\n                        return map.prefix ? this.callPlugin() : this.load();\n                    }));\n                } else {\n                    //Regular dependency.\n                    return map.prefix ? this.callPlugin() : this.load();\n                }\n            },\n\n            load: function () {\n                var url = this.map.url;\n\n                //Regular dependency.\n                if (!urlFetched[url]) {\n                    urlFetched[url] = true;\n                    context.load(this.map.id, url);\n                }\n            },\n\n            /**\n             * Checks if the module is ready to define itself, and if so,\n             * define it.\n             */\n            check: function () {\n                if (!this.enabled || this.enabling) {\n                    return;\n                }\n\n                var err, cjsModule,\n                    id = this.map.id,\n                    depExports = this.depExports,\n                    exports = this.exports,\n                    factory = this.factory;\n\n                if (!this.inited) {\n                    // Only fetch if not already in the defQueue.\n                    if (!hasProp(context.defQueueMap, id)) {\n                        this.fetch();\n                    }\n                } else if (this.error) {\n                    this.emit('error', this.error);\n                } else if (!this.defining) {\n                    //The factory could trigger another require call\n                    //that would result in checking this module to\n                    //define itself again. If already in the process\n                    //of doing that, skip this work.\n                    this.defining = true;\n\n                    if (this.depCount < 1 && !this.defined) {\n                        if (isFunction(factory)) {\n                            //If there is an error listener, favor passing\n                            //to that instead of throwing an error. However,\n                            //only do it for define()'d  modules. require\n                            //errbacks should not be called for failures in\n                            //their callbacks (#699). However if a global\n                            //onError is set, use that.\n                            if ((this.events.error && this.map.isDefine) ||\n                                req.onError !== defaultOnError) {\n                                try {\n                                    exports = context.execCb(id, factory, depExports, exports);\n                                } catch (e) {\n                                    err = e;\n                                }\n                            } else {\n                                exports = context.execCb(id, factory, depExports, exports);\n                            }\n\n                            // Favor return value over exports. If node/cjs in play,\n                            // then will not have a return value anyway. Favor\n                            // module.exports assignment over exports object.\n                            if (this.map.isDefine && exports === undefined) {\n                                cjsModule = this.module;\n                                if (cjsModule) {\n                                    exports = cjsModule.exports;\n                                } else if (this.usingExports) {\n                                    //exports already set the defined value.\n                                    exports = this.exports;\n                                }\n                            }\n\n                            if (err) {\n                                err.requireMap = this.map;\n                                err.requireModules = this.map.isDefine ? [this.map.id] : null;\n                                err.requireType = this.map.isDefine ? 'define' : 'require';\n                                return onError((this.error = err));\n                            }\n\n                        } else {\n                            //Just a literal value\n                            exports = factory;\n                        }\n\n                        this.exports = exports;\n\n                        if (this.map.isDefine && !this.ignore) {\n                            defined[id] = exports;\n\n                            if (req.onResourceLoad) {\n                                var resLoadMaps = [];\n                                each(this.depMaps, function (depMap) {\n                                    resLoadMaps.push(depMap.normalizedMap || depMap);\n                                });\n                                req.onResourceLoad(context, this.map, resLoadMaps);\n                            }\n                        }\n\n                        //Clean up\n                        cleanRegistry(id);\n\n                        this.defined = true;\n                    }\n\n                    //Finished the define stage. Allow calling check again\n                    //to allow define notifications below in the case of a\n                    //cycle.\n                    this.defining = false;\n\n                    if (this.defined && !this.defineEmitted) {\n                        this.defineEmitted = true;\n                        this.emit('defined', this.exports);\n                        this.defineEmitComplete = true;\n                    }\n\n                }\n            },\n\n            callPlugin: function () {\n                var map = this.map,\n                    id = map.id,\n                    //Map already normalized the prefix.\n                    pluginMap = makeModuleMap(map.prefix);\n\n                //Mark this as a dependency for this plugin, so it\n                //can be traced for cycles.\n                this.depMaps.push(pluginMap);\n\n                on(pluginMap, 'defined', bind(this, function (plugin) {\n                    var load, normalizedMap, normalizedMod,\n                        bundleId = getOwn(bundlesMap, this.map.id),\n                        name = this.map.name,\n                        parentName = this.map.parentMap ? this.map.parentMap.name : null,\n                        localRequire = context.makeRequire(map.parentMap, {\n                            enableBuildCallback: true\n                        });\n\n                    //If current map is not normalized, wait for that\n                    //normalized name to load instead of continuing.\n                    if (this.map.unnormalized) {\n                        //Normalize the ID if the plugin allows it.\n                        if (plugin.normalize) {\n                            name = plugin.normalize(name, function (name) {\n                                return normalize(name, parentName, true);\n                            }) || '';\n                        }\n\n                        //prefix and name should already be normalized, no need\n                        //for applying map config again either.\n                        normalizedMap = makeModuleMap(map.prefix + '!' + name,\n                                                      this.map.parentMap);\n                        on(normalizedMap,\n                            'defined', bind(this, function (value) {\n                                this.map.normalizedMap = normalizedMap;\n                                this.init([], function () { return value; }, null, {\n                                    enabled: true,\n                                    ignore: true\n                                });\n                            }));\n\n                        normalizedMod = getOwn(registry, normalizedMap.id);\n                        if (normalizedMod) {\n                            //Mark this as a dependency for this plugin, so it\n                            //can be traced for cycles.\n                            this.depMaps.push(normalizedMap);\n\n                            if (this.events.error) {\n                                normalizedMod.on('error', bind(this, function (err) {\n                                    this.emit('error', err);\n                                }));\n                            }\n                            normalizedMod.enable();\n                        }\n\n                        return;\n                    }\n\n                    //If a paths config, then just load that file instead to\n                    //resolve the plugin, as it is built into that paths layer.\n                    if (bundleId) {\n                        this.map.url = context.nameToUrl(bundleId);\n                        this.load();\n                        return;\n                    }\n\n                    load = bind(this, function (value) {\n                        this.init([], function () { return value; }, null, {\n                            enabled: true\n                        });\n                    });\n\n                    load.error = bind(this, function (err) {\n                        this.inited = true;\n                        this.error = err;\n                        err.requireModules = [id];\n\n                        //Remove temp unnormalized modules for this module,\n                        //since they will never be resolved otherwise now.\n                        eachProp(registry, function (mod) {\n                            if (mod.map.id.indexOf(id + '_unnormalized') === 0) {\n                                cleanRegistry(mod.map.id);\n                            }\n                        });\n\n                        onError(err);\n                    });\n\n                    //Allow plugins to load other code without having to know the\n                    //context or how to 'complete' the load.\n                    load.fromText = bind(this, function (text, textAlt) {\n                        /*jslint evil: true */\n                        var moduleName = map.name,\n                            moduleMap = makeModuleMap(moduleName),\n                            hasInteractive = useInteractive;\n\n                        //As of 2.1.0, support just passing the text, to reinforce\n                        //fromText only being called once per resource. Still\n                        //support old style of passing moduleName but discard\n                        //that moduleName in favor of the internal ref.\n                        if (textAlt) {\n                            text = textAlt;\n                        }\n\n                        //Turn off interactive script matching for IE for any define\n                        //calls in the text, then turn it back on at the end.\n                        if (hasInteractive) {\n                            useInteractive = false;\n                        }\n\n                        //Prime the system by creating a module instance for\n                        //it.\n                        getModule(moduleMap);\n\n                        //Transfer any config to this other module.\n                        if (hasProp(config.config, id)) {\n                            config.config[moduleName] = config.config[id];\n                        }\n\n                        try {\n                            req.exec(text);\n                        } catch (e) {\n                            return onError(makeError('fromtexteval',\n                                             'fromText eval for ' + id +\n                                            ' failed: ' + e,\n                                             e,\n                                             [id]));\n                        }\n\n                        if (hasInteractive) {\n                            useInteractive = true;\n                        }\n\n                        //Mark this as a dependency for the plugin\n                        //resource\n                        this.depMaps.push(moduleMap);\n\n                        //Support anonymous modules.\n                        context.completeLoad(moduleName);\n\n                        //Bind the value of that module to the value for this\n                        //resource ID.\n                        localRequire([moduleName], load);\n                    });\n\n                    //Use parentName here since the plugin's name is not reliable,\n                    //could be some weird string with no path that actually wants to\n                    //reference the parentName's path.\n                    plugin.load(map.name, localRequire, load, config);\n                }));\n\n                context.enable(pluginMap, this);\n                this.pluginMaps[pluginMap.id] = pluginMap;\n            },\n\n            enable: function () {\n                enabledRegistry[this.map.id] = this;\n                this.enabled = true;\n\n                //Set flag mentioning that the module is enabling,\n                //so that immediate calls to the defined callbacks\n                //for dependencies do not trigger inadvertent load\n                //with the depCount still being zero.\n                this.enabling = true;\n\n                //Enable each dependency\n                each(this.depMaps, bind(this, function (depMap, i) {\n                    var id, mod, handler;\n\n                    if (typeof depMap === 'string') {\n                        //Dependency needs to be converted to a depMap\n                        //and wired up to this module.\n                        depMap = makeModuleMap(depMap,\n                                               (this.map.isDefine ? this.map : this.map.parentMap),\n                                               false,\n                                               !this.skipMap);\n                        this.depMaps[i] = depMap;\n\n                        handler = getOwn(handlers, depMap.id);\n\n                        if (handler) {\n                            this.depExports[i] = handler(this);\n                            return;\n                        }\n\n                        this.depCount += 1;\n\n                        on(depMap, 'defined', bind(this, function (depExports) {\n                            if (this.undefed) {\n                                return;\n                            }\n                            this.defineDep(i, depExports);\n                            this.check();\n                        }));\n\n                        if (this.errback) {\n                            on(depMap, 'error', bind(this, this.errback));\n                        } else if (this.events.error) {\n                            // No direct errback on this module, but something\n                            // else is listening for errors, so be sure to\n                            // propagate the error correctly.\n                            on(depMap, 'error', bind(this, function(err) {\n                                this.emit('error', err);\n                            }));\n                        }\n                    }\n\n                    id = depMap.id;\n                    mod = registry[id];\n\n                    //Skip special modules like 'require', 'exports', 'module'\n                    //Also, don't call enable if it is already enabled,\n                    //important in circular dependency cases.\n                    if (!hasProp(handlers, id) && mod && !mod.enabled) {\n                        context.enable(depMap, this);\n                    }\n                }));\n\n                //Enable each plugin that is used in\n                //a dependency\n                eachProp(this.pluginMaps, bind(this, function (pluginMap) {\n                    var mod = getOwn(registry, pluginMap.id);\n                    if (mod && !mod.enabled) {\n                        context.enable(pluginMap, this);\n                    }\n                }));\n\n                this.enabling = false;\n\n                this.check();\n            },\n\n            on: function (name, cb) {\n                var cbs = this.events[name];\n                if (!cbs) {\n                    cbs = this.events[name] = [];\n                }\n                cbs.push(cb);\n            },\n\n            emit: function (name, evt) {\n                each(this.events[name], function (cb) {\n                    cb(evt);\n                });\n                if (name === 'error') {\n                    //Now that the error handler was triggered, remove\n                    //the listeners, since this broken Module instance\n                    //can stay around for a while in the registry.\n                    delete this.events[name];\n                }\n            }\n        };\n\n        function callGetModule(args) {\n            //Skip modules already defined.\n            if (!hasProp(defined, args[0])) {\n                getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);\n            }\n        }\n\n        function removeListener(node, func, name, ieName) {\n            //Favor detachEvent because of IE9\n            //issue, see attachEvent/addEventListener comment elsewhere\n            //in this file.\n            if (node.detachEvent && !isOpera) {\n                //Probably IE. If not it will throw an error, which will be\n                //useful to know.\n                if (ieName) {\n                    node.detachEvent(ieName, func);\n                }\n            } else {\n                node.removeEventListener(name, func, false);\n            }\n        }\n\n        /**\n         * Given an event from a script node, get the requirejs info from it,\n         * and then removes the event listeners on the node.\n         * @param {Event} evt\n         * @returns {Object}\n         */\n        function getScriptData(evt) {\n            //Using currentTarget instead of target for Firefox 2.0's sake. Not\n            //all old browsers will be supported, but this one was easy enough\n            //to support and still makes sense.\n            var node = evt.currentTarget || evt.srcElement;\n\n            //Remove the listeners once here.\n            removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');\n            removeListener(node, context.onScriptError, 'error');\n\n            return {\n                node: node,\n                id: node && node.getAttribute('data-requiremodule')\n            };\n        }\n\n        function intakeDefines() {\n            var args;\n\n            //Any defined modules in the global queue, intake them now.\n            takeGlobalQueue();\n\n            //Make sure any remaining defQueue items get properly processed.\n            while (defQueue.length) {\n                args = defQueue.shift();\n                if (args[0] === null) {\n                    return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +\n                        args[args.length - 1]));\n                } else {\n                    //args are id, deps, factory. Should be normalized by the\n                    //define() function.\n                    callGetModule(args);\n                }\n            }\n            context.defQueueMap = {};\n        }\n\n        context = {\n            config: config,\n            contextName: contextName,\n            registry: registry,\n            defined: defined,\n            urlFetched: urlFetched,\n            defQueue: defQueue,\n            defQueueMap: {},\n            Module: Module,\n            makeModuleMap: makeModuleMap,\n            nextTick: req.nextTick,\n            onError: onError,\n\n            /**\n             * Set a configuration for the context.\n             * @param {Object} cfg config object to integrate.\n             */\n            configure: function (cfg) {\n                //Make sure the baseUrl ends in a slash.\n                if (cfg.baseUrl) {\n                    if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {\n                        cfg.baseUrl += '/';\n                    }\n                }\n\n                // Convert old style urlArgs string to a function.\n                if (typeof cfg.urlArgs === 'string') {\n                    var urlArgs = cfg.urlArgs;\n                    cfg.urlArgs = function(id, url) {\n                        return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;\n                    };\n                }\n\n                //Save off the paths since they require special processing,\n                //they are additive.\n                var shim = config.shim,\n                    objs = {\n                        paths: true,\n                        bundles: true,\n                        config: true,\n                        map: true\n                    };\n\n                eachProp(cfg, function (value, prop) {\n                    if (objs[prop]) {\n                        if (!config[prop]) {\n                            config[prop] = {};\n                        }\n                        mixin(config[prop], value, true, true);\n                    } else {\n                        config[prop] = value;\n                    }\n                });\n\n                //Reverse map the bundles\n                if (cfg.bundles) {\n                    eachProp(cfg.bundles, function (value, prop) {\n                        each(value, function (v) {\n                            if (v !== prop) {\n                                bundlesMap[v] = prop;\n                            }\n                        });\n                    });\n                }\n\n                //Merge shim\n                if (cfg.shim) {\n                    eachProp(cfg.shim, function (value, id) {\n                        //Normalize the structure\n                        if (isArray(value)) {\n                            value = {\n                                deps: value\n                            };\n                        }\n                        if ((value.exports || value.init) && !value.exportsFn) {\n                            value.exportsFn = context.makeShimExports(value);\n                        }\n                        shim[id] = value;\n                    });\n                    config.shim = shim;\n                }\n\n                //Adjust packages if necessary.\n                if (cfg.packages) {\n                    each(cfg.packages, function (pkgObj) {\n                        var location, name;\n\n                        pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;\n\n                        name = pkgObj.name;\n                        location = pkgObj.location;\n                        if (location) {\n                            config.paths[name] = pkgObj.location;\n                        }\n\n                        //Save pointer to main module ID for pkg name.\n                        //Remove leading dot in main, so main paths are normalized,\n                        //and remove any trailing .js, since different package\n                        //envs have different conventions: some use a module name,\n                        //some use a file name.\n                        config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')\n                                     .replace(currDirRegExp, '')\n                                     .replace(jsSuffixRegExp, '');\n                    });\n                }\n\n                //If there are any \"waiting to execute\" modules in the registry,\n                //update the maps for them, since their info, like URLs to load,\n                //may have changed.\n                eachProp(registry, function (mod, id) {\n                    //If module already has init called, since it is too\n                    //late to modify them, and ignore unnormalized ones\n                    //since they are transient.\n                    if (!mod.inited && !mod.map.unnormalized) {\n                        mod.map = makeModuleMap(id, null, true);\n                    }\n                });\n\n                //If a deps array or a config callback is specified, then call\n                //require with those args. This is useful when require is defined as a\n                //config object before require.js is loaded.\n                if (cfg.deps || cfg.callback) {\n                    context.require(cfg.deps || [], cfg.callback);\n                }\n            },\n\n            makeShimExports: function (value) {\n                function fn() {\n                    var ret;\n                    if (value.init) {\n                        ret = value.init.apply(global, arguments);\n                    }\n                    return ret || (value.exports && getGlobal(value.exports));\n                }\n                return fn;\n            },\n\n            makeRequire: function (relMap, options) {\n                options = options || {};\n\n                function localRequire(deps, callback, errback) {\n                    var id, map, requireMod;\n\n                    if (options.enableBuildCallback && callback && isFunction(callback)) {\n                        callback.__requireJsBuild = true;\n                    }\n\n                    if (typeof deps === 'string') {\n                        if (isFunction(callback)) {\n                            //Invalid call\n                            return onError(makeError('requireargs', 'Invalid require call'), errback);\n                        }\n\n                        //If require|exports|module are requested, get the\n                        //value for them from the special handlers. Caveat:\n                        //this only works while module is being defined.\n                        if (relMap && hasProp(handlers, deps)) {\n                            return handlers[deps](registry[relMap.id]);\n                        }\n\n                        //Synchronous access to one module. If require.get is\n                        //available (as in the Node adapter), prefer that.\n                        if (req.get) {\n                            return req.get(context, deps, relMap, localRequire);\n                        }\n\n                        //Normalize module name, if it contains . or ..\n                        map = makeModuleMap(deps, relMap, false, true);\n                        id = map.id;\n\n                        if (!hasProp(defined, id)) {\n                            return onError(makeError('notloaded', 'Module name \"' +\n                                        id +\n                                        '\" has not been loaded yet for context: ' +\n                                        contextName +\n                                        (relMap ? '' : '. Use require([])')));\n                        }\n                        return defined[id];\n                    }\n\n                    //Grab defines waiting in the global queue.\n                    intakeDefines();\n\n                    //Mark all the dependencies as needing to be loaded.\n                    context.nextTick(function () {\n                        //Some defines could have been added since the\n                        //require call, collect them.\n                        intakeDefines();\n\n                        requireMod = getModule(makeModuleMap(null, relMap));\n\n                        //Store if map config should be applied to this require\n                        //call for dependencies.\n                        requireMod.skipMap = options.skipMap;\n\n                        requireMod.init(deps, callback, errback, {\n                            enabled: true\n                        });\n\n                        checkLoaded();\n                    });\n\n                    return localRequire;\n                }\n\n                mixin(localRequire, {\n                    isBrowser: isBrowser,\n\n                    /**\n                     * Converts a module name + .extension into an URL path.\n                     * *Requires* the use of a module name. It does not support using\n                     * plain URLs like nameToUrl.\n                     */\n                    toUrl: function (moduleNamePlusExt) {\n                        var ext,\n                            index = moduleNamePlusExt.lastIndexOf('.'),\n                            segment = moduleNamePlusExt.split('/')[0],\n                            isRelative = segment === '.' || segment === '..';\n\n                        //Have a file extension alias, and it is not the\n                        //dots from a relative path.\n                        if (index !== -1 && (!isRelative || index > 1)) {\n                            ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);\n                            moduleNamePlusExt = moduleNamePlusExt.substring(0, index);\n                        }\n\n                        return context.nameToUrl(normalize(moduleNamePlusExt,\n                                                relMap && relMap.id, true), ext,  true);\n                    },\n\n                    defined: function (id) {\n                        return hasProp(defined, makeModuleMap(id, relMap, false, true).id);\n                    },\n\n                    specified: function (id) {\n                        id = makeModuleMap(id, relMap, false, true).id;\n                        return hasProp(defined, id) || hasProp(registry, id);\n                    }\n                });\n\n                //Only allow undef on top level require calls\n                if (!relMap) {\n                    localRequire.undef = function (id) {\n                        //Bind any waiting define() calls to this context,\n                        //fix for #408\n                        takeGlobalQueue();\n\n                        var map = makeModuleMap(id, relMap, true),\n                            mod = getOwn(registry, id);\n\n                        mod.undefed = true;\n                        removeScript(id);\n\n                        delete defined[id];\n                        delete urlFetched[map.url];\n                        delete undefEvents[id];\n\n                        //Clean queued defines too. Go backwards\n                        //in array so that the splices do not\n                        //mess up the iteration.\n                        eachReverse(defQueue, function(args, i) {\n                            if (args[0] === id) {\n                                defQueue.splice(i, 1);\n                            }\n                        });\n                        delete context.defQueueMap[id];\n\n                        if (mod) {\n                            //Hold on to listeners in case the\n                            //module will be attempted to be reloaded\n                            //using a different config.\n                            if (mod.events.defined) {\n                                undefEvents[id] = mod.events;\n                            }\n\n                            cleanRegistry(id);\n                        }\n                    };\n                }\n\n                return localRequire;\n            },\n\n            /**\n             * Called to enable a module if it is still in the registry\n             * awaiting enablement. A second arg, parent, the parent module,\n             * is passed in for context, when this method is overridden by\n             * the optimizer. Not shown here to keep code compact.\n             */\n            enable: function (depMap) {\n                var mod = getOwn(registry, depMap.id);\n                if (mod) {\n                    getModule(depMap).enable();\n                }\n            },\n\n            /**\n             * Internal method used by environment adapters to complete a load event.\n             * A load event could be a script load or just a load pass from a synchronous\n             * load call.\n             * @param {String} moduleName the name of the module to potentially complete.\n             */\n            completeLoad: function (moduleName) {\n                var found, args, mod,\n                    shim = getOwn(config.shim, moduleName) || {},\n                    shExports = shim.exports;\n\n                takeGlobalQueue();\n\n                while (defQueue.length) {\n                    args = defQueue.shift();\n                    if (args[0] === null) {\n                        args[0] = moduleName;\n                        //If already found an anonymous module and bound it\n                        //to this name, then this is some other anon module\n                        //waiting for its completeLoad to fire.\n                        if (found) {\n                            break;\n                        }\n                        found = true;\n                    } else if (args[0] === moduleName) {\n                        //Found matching define call for this script!\n                        found = true;\n                    }\n\n                    callGetModule(args);\n                }\n                context.defQueueMap = {};\n\n                //Do this after the cycle of callGetModule in case the result\n                //of those calls/init calls changes the registry.\n                mod = getOwn(registry, moduleName);\n\n                if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {\n                    if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {\n                        if (hasPathFallback(moduleName)) {\n                            return;\n                        } else {\n                            return onError(makeError('nodefine',\n                                             'No define call for ' + moduleName,\n                                             null,\n                                             [moduleName]));\n                        }\n                    } else {\n                        //A script that does not call define(), so just simulate\n                        //the call for it.\n                        callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);\n                    }\n                }\n\n                checkLoaded();\n            },\n\n            /**\n             * Converts a module name to a file path. Supports cases where\n             * moduleName may actually be just an URL.\n             * Note that it **does not** call normalize on the moduleName,\n             * it is assumed to have already been normalized. This is an\n             * internal API, not a public one. Use toUrl for the public API.\n             */\n            nameToUrl: function (moduleName, ext, skipExt) {\n                var paths, syms, i, parentModule, url,\n                    parentPath, bundleId,\n                    pkgMain = getOwn(config.pkgs, moduleName);\n\n                if (pkgMain) {\n                    moduleName = pkgMain;\n                }\n\n                bundleId = getOwn(bundlesMap, moduleName);\n\n                if (bundleId) {\n                    return context.nameToUrl(bundleId, ext, skipExt);\n                }\n\n                //If a colon is in the URL, it indicates a protocol is used and it is just\n                //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)\n                //or ends with .js, then assume the user meant to use an url and not a module id.\n                //The slash is important for protocol-less URLs as well as full paths.\n                if (req.jsExtRegExp.test(moduleName)) {\n                    //Just a plain path, not module name lookup, so just return it.\n                    //Add extension if it is included. This is a bit wonky, only non-.js things pass\n                    //an extension, this method probably needs to be reworked.\n                    url = moduleName + (ext || '');\n                } else {\n                    //A module that needs to be converted to a path.\n                    paths = config.paths;\n\n                    syms = moduleName.split('/');\n                    //For each module name segment, see if there is a path\n                    //registered for it. Start with most specific name\n                    //and work up from it.\n                    for (i = syms.length; i > 0; i -= 1) {\n                        parentModule = syms.slice(0, i).join('/');\n\n                        parentPath = getOwn(paths, parentModule);\n                        if (parentPath) {\n                            //If an array, it means there are a few choices,\n                            //Choose the one that is desired\n                            if (isArray(parentPath)) {\n                                parentPath = parentPath[0];\n                            }\n                            syms.splice(0, i, parentPath);\n                            break;\n                        }\n                    }\n\n                    //Join the path parts together, then figure out if baseUrl is needed.\n                    url = syms.join('/');\n                    url += (ext || (/^data\\:|^blob\\:|\\?/.test(url) || skipExt ? '' : '.js'));\n                    url = (url.charAt(0) === '/' || url.match(/^[\\w\\+\\.\\-]+:/) ? '' : config.baseUrl) + url;\n                }\n\n                return config.urlArgs && !/^blob\\:/.test(url) ?\n                       url + config.urlArgs(moduleName, url) : url;\n            },\n\n            //Delegates to req.load. Broken out as a separate function to\n            //allow overriding in the optimizer.\n            load: function (id, url) {\n                req.load(context, id, url);\n            },\n\n            /**\n             * Executes a module callback function. Broken out as a separate function\n             * solely to allow the build system to sequence the files in the built\n             * layer in the right sequence.\n             *\n             * @private\n             */\n            execCb: function (name, callback, args, exports) {\n                return callback.apply(exports, args);\n            },\n\n            /**\n             * callback for script loads, used to check status of loading.\n             *\n             * @param {Event} evt the event from the browser for the script\n             * that was loaded.\n             */\n            onScriptLoad: function (evt) {\n                //Using currentTarget instead of target for Firefox 2.0's sake. Not\n                //all old browsers will be supported, but this one was easy enough\n                //to support and still makes sense.\n                if (evt.type === 'load' ||\n                        (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {\n                    //Reset interactive script so a script node is not held onto for\n                    //to long.\n                    interactiveScript = null;\n\n                    //Pull out the name of the module and the context.\n                    var data = getScriptData(evt);\n                    context.completeLoad(data.id);\n                }\n            },\n\n            /**\n             * Callback for script errors.\n             */\n            onScriptError: function (evt) {\n                var data = getScriptData(evt);\n                if (!hasPathFallback(data.id)) {\n                    var parents = [];\n                    eachProp(registry, function(value, key) {\n                        if (key.indexOf('_@r') !== 0) {\n                            each(value.depMaps, function(depMap) {\n                                if (depMap.id === data.id) {\n                                    parents.push(key);\n                                    return true;\n                                }\n                            });\n                        }\n                    });\n                    return onError(makeError('scripterror', 'Script error for \"' + data.id +\n                                             (parents.length ?\n                                             '\", needed by: ' + parents.join(', ') :\n                                             '\"'), evt, [data.id]));\n                }\n            }\n        };\n\n        context.require = context.makeRequire();\n        return context;\n    }\n\n    /**\n     * Main entry point.\n     *\n     * If the only argument to require is a string, then the module that\n     * is represented by that string is fetched for the appropriate context.\n     *\n     * If the first argument is an array, then it will be treated as an array\n     * of dependency string names to fetch. An optional function callback can\n     * be specified to execute when all of those dependencies are available.\n     *\n     * Make a local req variable to help Caja compliance (it assumes things\n     * on a require that are not standardized), and to give a short\n     * name for minification/local scope use.\n     */\n    req = requirejs = function (deps, callback, errback, optional) {\n\n        //Find the right context, use default\n        var context, config,\n            contextName = defContextName;\n\n        // Determine if have config object in the call.\n        if (!isArray(deps) && typeof deps !== 'string') {\n            // deps is a config object\n            config = deps;\n            if (isArray(callback)) {\n                // Adjust args if there are dependencies\n                deps = callback;\n                callback = errback;\n                errback = optional;\n            } else {\n                deps = [];\n            }\n        }\n\n        if (config && config.context) {\n            contextName = config.context;\n        }\n\n        context = getOwn(contexts, contextName);\n        if (!context) {\n            context = contexts[contextName] = req.s.newContext(contextName);\n        }\n\n        if (config) {\n            context.configure(config);\n        }\n\n        return context.require(deps, callback, errback);\n    };\n\n    /**\n     * Support require.config() to make it easier to cooperate with other\n     * AMD loaders on globally agreed names.\n     */\n    req.config = function (config) {\n        return req(config);\n    };\n\n    /**\n     * Execute something after the current tick\n     * of the event loop. Override for other envs\n     * that have a better solution than setTimeout.\n     * @param  {Function} fn function to execute later.\n     */\n    req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {\n        setTimeout(fn, 4);\n    } : function (fn) { fn(); };\n\n    /**\n     * Export require as a global, but only if it does not already exist.\n     */\n    if (!require) {\n        require = req;\n    }\n\n    req.version = version;\n\n    //Used to filter out dependencies that are already paths.\n    req.jsExtRegExp = /^\\/|:|\\?|\\.js$/;\n    req.isBrowser = isBrowser;\n    s = req.s = {\n        contexts: contexts,\n        newContext: newContext\n    };\n\n    //Create default context.\n    req({});\n\n    //Exports some context-sensitive methods on global require.\n    each([\n        'toUrl',\n        'undef',\n        'defined',\n        'specified'\n    ], function (prop) {\n        //Reference from contexts instead of early binding to default context,\n        //so that during builds, the latest instance of the default context\n        //with its config gets used.\n        req[prop] = function () {\n            var ctx = contexts[defContextName];\n            return ctx.require[prop].apply(ctx, arguments);\n        };\n    });\n\n    if (isBrowser) {\n        head = s.head = document.getElementsByTagName('head')[0];\n        //If BASE tag is in play, using appendChild is a problem for IE6.\n        //When that browser dies, this can be removed. Details in this jQuery bug:\n        //http://dev.jquery.com/ticket/2709\n        baseElement = document.getElementsByTagName('base')[0];\n        if (baseElement) {\n            head = s.head = baseElement.parentNode;\n        }\n    }\n\n    /**\n     * Any errors that require explicitly generates will be passed to this\n     * function. Intercept/override it if you want custom error handling.\n     * @param {Error} err the error object.\n     */\n    req.onError = defaultOnError;\n\n    /**\n     * Creates the node for the load command. Only used in browser envs.\n     */\n    req.createNode = function (config, moduleName, url) {\n        var node = config.xhtml ?\n                document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :\n                document.createElement('script');\n        node.type = config.scriptType || 'text/javascript';\n        node.charset = 'utf-8';\n        node.async = true;\n        return node;\n    };\n\n    /**\n     * Does the request to load a module for the browser case.\n     * Make this a separate function to allow other environments\n     * to override it.\n     *\n     * @param {Object} context the require context to find state.\n     * @param {String} moduleName the name of the module.\n     * @param {Object} url the URL to the module.\n     */\n    req.load = function (context, moduleName, url) {\n        var config = (context && context.config) || {},\n            node;\n        if (isBrowser) {\n            //In the browser so use a script tag\n            node = req.createNode(config, moduleName, url);\n\n            node.setAttribute('data-requirecontext', context.contextName);\n            node.setAttribute('data-requiremodule', moduleName);\n\n            //Set up load listener. Test attachEvent first because IE9 has\n            //a subtle issue in its addEventListener and script onload firings\n            //that do not match the behavior of all other browsers with\n            //addEventListener support, which fire the onload event for a\n            //script right after the script execution. See:\n            //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution\n            //UNFORTUNATELY Opera implements attachEvent but does not follow the script\n            //script execution mode.\n            if (node.attachEvent &&\n                    //Check if node.attachEvent is artificially added by custom script or\n                    //natively supported by browser\n                    //read https://github.com/requirejs/requirejs/issues/187\n                    //if we can NOT find [native code] then it must NOT natively supported.\n                    //in IE8, node.attachEvent does not have toString()\n                    //Note the test for \"[native code\" with no closing brace, see:\n                    //https://github.com/requirejs/requirejs/issues/273\n                    !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&\n                    !isOpera) {\n                //Probably IE. IE (at least 6-8) do not fire\n                //script onload right after executing the script, so\n                //we cannot tie the anonymous define call to a name.\n                //However, IE reports the script as being in 'interactive'\n                //readyState at the time of the define call.\n                useInteractive = true;\n\n                node.attachEvent('onreadystatechange', context.onScriptLoad);\n                //It would be great to add an error handler here to catch\n                //404s in IE9+. However, onreadystatechange will fire before\n                //the error handler, so that does not help. If addEventListener\n                //is used, then IE will fire error before load, but we cannot\n                //use that pathway given the connect.microsoft.com issue\n                //mentioned above about not doing the 'script execute,\n                //then fire the script load event listener before execute\n                //next script' that other browsers do.\n                //Best hope: IE10 fixes the issues,\n                //and then destroys all installs of IE 6-9.\n                //node.attachEvent('onerror', context.onScriptError);\n            } else {\n                node.addEventListener('load', context.onScriptLoad, false);\n                node.addEventListener('error', context.onScriptError, false);\n            }\n            node.src = url;\n\n            //Calling onNodeCreated after all properties on the node have been\n            //set, but before it is placed in the DOM.\n            if (config.onNodeCreated) {\n                config.onNodeCreated(node, config, moduleName, url);\n            }\n\n            //For some cache cases in IE 6-8, the script executes before the end\n            //of the appendChild execution, so to tie an anonymous define\n            //call to the module name (which is stored on the node), hold on\n            //to a reference to this node, but clear after the DOM insertion.\n            currentlyAddingScript = node;\n            if (baseElement) {\n                head.insertBefore(node, baseElement);\n            } else {\n                head.appendChild(node);\n            }\n            currentlyAddingScript = null;\n\n            return node;\n        } else if (isWebWorker) {\n            try {\n                //In a web worker, use importScripts. This is not a very\n                //efficient use of importScripts, importScripts will block until\n                //its script is downloaded and evaluated. However, if web workers\n                //are in play, the expectation is that a build has been done so\n                //that only one script needs to be loaded anyway. This may need\n                //to be reevaluated if other use cases become common.\n\n                // Post a task to the event loop to work around a bug in WebKit\n                // where the worker gets garbage-collected after calling\n                // importScripts(): https://webkit.org/b/153317\n                setTimeout(function() {}, 0);\n                importScripts(url);\n\n                //Account for anonymous modules\n                context.completeLoad(moduleName);\n            } catch (e) {\n                context.onError(makeError('importscripts',\n                                'importScripts failed for ' +\n                                    moduleName + ' at ' + url,\n                                e,\n                                [moduleName]));\n            }\n        }\n    };\n\n    function getInteractiveScript() {\n        if (interactiveScript && interactiveScript.readyState === 'interactive') {\n            return interactiveScript;\n        }\n\n        eachReverse(scripts(), function (script) {\n            if (script.readyState === 'interactive') {\n                return (interactiveScript = script);\n            }\n        });\n        return interactiveScript;\n    }\n\n    //Look for a data-main script attribute, which could also adjust the baseUrl.\n    if (isBrowser && !cfg.skipDataMain) {\n        //Figure out baseUrl. Get it from the script tag with require.js in it.\n        eachReverse(scripts(), function (script) {\n            //Set the 'head' where we can append children by\n            //using the script's parent.\n            if (!head) {\n                head = script.parentNode;\n            }\n\n            //Look for a data-main attribute to set main script for the page\n            //to load. If it is there, the path to data main becomes the\n            //baseUrl, if it is not already set.\n            dataMain = script.getAttribute('data-main');\n            if (dataMain) {\n                //Preserve dataMain in case it is a path (i.e. contains '?')\n                mainScript = dataMain;\n\n                //Set final baseUrl if there is not already an explicit one,\n                //but only do so if the data-main value is not a loader plugin\n                //module ID.\n                if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {\n                    //Pull off the directory of data-main for use as the\n                    //baseUrl.\n                    src = mainScript.split('/');\n                    mainScript = src.pop();\n                    subPath = src.length ? src.join('/')  + '/' : './';\n\n                    cfg.baseUrl = subPath;\n                }\n\n                //Strip off any trailing .js since mainScript is now\n                //like a module name.\n                mainScript = mainScript.replace(jsSuffixRegExp, '');\n\n                //If mainScript is still a path, fall back to dataMain\n                if (req.jsExtRegExp.test(mainScript)) {\n                    mainScript = dataMain;\n                }\n\n                //Put the data-main script in the files to load.\n                cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];\n\n                return true;\n            }\n        });\n    }\n\n    /**\n     * The function that handles definitions of modules. Differs from\n     * require() in that a string for the module should be the first argument,\n     * and the function to execute after dependencies are loaded should\n     * return a value to define the module corresponding to the first argument's\n     * name.\n     */\n    define = function (name, deps, callback) {\n        var node, context;\n\n        //Allow for anonymous modules\n        if (typeof name !== 'string') {\n            //Adjust args appropriately\n            callback = deps;\n            deps = name;\n            name = null;\n        }\n\n        //This module may not have dependencies\n        if (!isArray(deps)) {\n            callback = deps;\n            deps = null;\n        }\n\n        //If no name, and callback is a function, then figure out if it a\n        //CommonJS thing with dependencies.\n        if (!deps && isFunction(callback)) {\n            deps = [];\n            //Remove comments from the callback string,\n            //look for require calls, and pull them into the dependencies,\n            //but only if there are function args.\n            if (callback.length) {\n                callback\n                    .toString()\n                    .replace(commentRegExp, commentReplace)\n                    .replace(cjsRequireRegExp, function (match, dep) {\n                        deps.push(dep);\n                    });\n\n                //May be a CommonJS thing even without require calls, but still\n                //could use exports, and module. Avoid doing exports and module\n                //work though if it just needs require.\n                //REQUIRES the function to expect the CommonJS variables in the\n                //order listed below.\n                deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);\n            }\n        }\n\n        //If in IE 6-8 and hit an anonymous define() call, do the interactive\n        //work.\n        if (useInteractive) {\n            node = currentlyAddingScript || getInteractiveScript();\n            if (node) {\n                if (!name) {\n                    name = node.getAttribute('data-requiremodule');\n                }\n                context = contexts[node.getAttribute('data-requirecontext')];\n            }\n        }\n\n        //Always save off evaluating the def call until the script onload handler.\n        //This allows multiple modules to be in a file without prematurely\n        //tracing dependencies, and allows for anonymous module support,\n        //where the module name is not known until the script onload event\n        //occurs. If no context, use the global queue, and get it processed\n        //in the onscript load callback.\n        if (context) {\n            context.defQueue.push([name, deps, callback]);\n            context.defQueueMap[name] = true;\n        } else {\n            globalDefQueue.push([name, deps, callback]);\n        }\n    };\n\n    define.amd = {\n        jQuery: true\n    };\n\n    /**\n     * Executes the text. Normally just uses eval, but can be modified\n     * to use a better, environment-specific call. Only used for transpiling\n     * loader plugins, not for plain JS modules.\n     * @param {String} text the text to execute/evaluate.\n     */\n    req.exec = function (text) {\n        /*jslint evil: true */\n        return eval(text);\n    };\n\n    //Set up with config info.\n    req(cfg);\n}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));\n"
  },
  {
    "path": "lib/seajs-2.1.1.js",
    "content": "/*! Sea.js 2.1.1 | seajs.org/LICENSE.md\n//# sourceMappingURL=sea.js.map\n*/(function(t,u){function v(b){return function(c){return Object.prototype.toString.call(c)===\"[object \"+b+\"]\"}}function Q(){return w++}function I(b,c){var a;a=b.charAt(0);if(R.test(b))a=b;else if(\".\"===a){a=(c?c.match(E)[0]:h.cwd)+b;for(a=a.replace(S,\"/\");a.match(J);)a=a.replace(J,\"/\")}else a=\"/\"===a?(a=h.cwd.match(T))?a[0]+b.substring(1):b:h.base+b;return a}function K(b,c){if(!b)return\"\";var a=b,d=h.alias,a=b=d&&F(d[a])?d[a]:a,d=h.paths,g;if(d&&(g=a.match(U))&&F(d[g[1]]))a=d[g[1]]+g[2];g=a;var e=h.vars;\ne&&-1<g.indexOf(\"{\")&&(g=g.replace(V,function(a,b){return F(e[b])?e[b]:a}));a=g.length-1;d=g.charAt(a);b=\"#\"===d?g.substring(0,a):\".js\"===g.substring(a-2)||0<g.indexOf(\"?\")||\".css\"===g.substring(a-3)||\"/\"===d?g:g+\".js\";g=I(b,c);var a=h.map,l=g;if(a)for(var d=0,f=a.length;d<f&&!(l=a[d],l=x(l)?l(g)||g:g.replace(l[0],l[1]),l!==g);d++);return l}function L(b,c){var a=b.sheet,d;if(M)a&&(d=!0);else if(a)try{a.cssRules&&(d=!0)}catch(g){\"NS_ERROR_DOM_SECURITY_ERR\"===g.name&&(d=!0)}setTimeout(function(){d?\nc():L(b,c)},20)}function W(){if(y)return y;if(z&&\"interactive\"===z.readyState)return z;for(var b=s.getElementsByTagName(\"script\"),c=b.length-1;0<=c;c--){var a=b[c];if(\"interactive\"===a.readyState)return z=a}}function e(b,c){this.uri=b;this.dependencies=c||[];this.exports=null;this.status=0;this._waitings={};this._remain=0}if(!t.seajs){var f=t.seajs={version:\"2.1.1\"},h=f.data={},X=v(\"Object\"),F=v(\"String\"),A=Array.isArray||v(\"Array\"),x=v(\"Function\"),w=0,p=h.events={};f.on=function(b,c){(p[b]||(p[b]=\n[])).push(c);return f};f.off=function(b,c){if(!b&&!c)return p=h.events={},f;var a=p[b];if(a)if(c)for(var d=a.length-1;0<=d;d--)a[d]===c&&a.splice(d,1);else delete p[b];return f};var m=f.emit=function(b,c){var a=p[b],d;if(a)for(a=a.slice();d=a.shift();)d(c);return f},E=/[^?#]*\\//,S=/\\/\\.\\//g,J=/\\/[^/]+\\/\\.\\.\\//,U=/^([^/:]+)(\\/.+)$/,V=/{([^{]+)}/g,R=/^\\/\\/.|:\\//,T=/^.*?\\/\\/.*?\\//,n=document,q=location,B=q.href.match(E)[0],k=n.getElementsByTagName(\"script\"),k=n.getElementById(\"seajsnode\")||k[k.length-\n1],k=((k.hasAttribute?k.src:k.getAttribute(\"src\",4))||B).match(E)[0],s=n.getElementsByTagName(\"head\")[0]||n.documentElement,N=s.getElementsByTagName(\"base\")[0],O=/\\.css(?:\\?|$)/i,Y=/^(?:loaded|complete|undefined)$/,y,z,M=536>1*navigator.userAgent.replace(/.*AppleWebKit\\/(\\d+)\\..*/,\"$1\"),Z=/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'|\\/\\*[\\S\\s]*?\\*\\/|\\/(?:\\\\\\/|[^\\/\\r\\n])+\\/(?=[^\\/])|\\/\\/.*|\\.\\s*require|(?:^|[^$])\\brequire\\s*\\(\\s*([\"'])(.+?)\\1\\s*\\)/g,$=/\\\\\\\\/g,r=f.cache={},C,G={},H={},D={},j=e.STATUS={FETCHING:1,\nSAVED:2,LOADING:3,LOADED:4,EXECUTING:5,EXECUTED:6};e.prototype.resolve=function(){for(var b=this.dependencies,c=[],a=0,d=b.length;a<d;a++)c[a]=e.resolve(b[a],this.uri);return c};e.prototype.load=function(){if(!(this.status>=j.LOADING)){this.status=j.LOADING;var b=this.resolve();m(\"load\",b);for(var c=this._remain=b.length,a,d=0;d<c;d++)a=e.get(b[d]),a.status<j.LOADED?a._waitings[this.uri]=(a._waitings[this.uri]||0)+1:this._remain--;if(0===this._remain)this.onload();else{for(var g={},d=0;d<c;d++)a=\nr[b[d]],a.status<j.FETCHING?a.fetch(g):a.status===j.SAVED&&a.load();for(var h in g)if(g.hasOwnProperty(h))g[h]()}}};e.prototype.onload=function(){this.status=j.LOADED;this.callback&&this.callback();var b=this._waitings,c,a;for(c in b)if(b.hasOwnProperty(c)&&(a=r[c],a._remain-=b[c],0===a._remain))a.onload();delete this._waitings;delete this._remain};e.prototype.fetch=function(b){function c(){var a=g.requestUri,b=g.onRequest,c=g.charset,d=O.test(a),e=n.createElement(d?\"link\":\"script\");if(c&&(c=x(c)?\nc(a):c))e.charset=c;var f=e;d&&(M||!(\"onload\"in f))?setTimeout(function(){L(f,b)},1):f.onload=f.onerror=f.onreadystatechange=function(){Y.test(f.readyState)&&(f.onload=f.onerror=f.onreadystatechange=null,!d&&!h.debug&&s.removeChild(f),f=null,b())};d?(e.rel=\"stylesheet\",e.href=a):(e.async=!0,e.src=a);y=e;N?s.insertBefore(e,N):s.appendChild(e);y=null}function a(){delete G[f];H[f]=!0;C&&(e.save(d,C),C=null);var a,b=D[f];for(delete D[f];a=b.shift();)a.load()}var d=this.uri;this.status=j.FETCHING;var g=\n{uri:d};m(\"fetch\",g);var f=g.requestUri||d;!f||H[f]?this.load():G[f]?D[f].push(this):(G[f]=!0,D[f]=[this],m(\"request\",g={uri:d,requestUri:f,onRequest:a,charset:h.charset}),g.requested||(b?b[g.requestUri]=c:c()))};e.prototype.exec=function(){function b(a){return e.get(b.resolve(a)).exec()}if(this.status>=j.EXECUTING)return this.exports;this.status=j.EXECUTING;var c=this.uri;b.resolve=function(a){return e.resolve(a,c)};b.async=function(a,g){e.use(a,g,c+\"_async_\"+w++);return b};var a=this.factory,a=\nx(a)?a(b,this.exports={},this):a;a===u&&(a=this.exports);null===a&&!O.test(c)&&m(\"error\",this);delete this.factory;this.exports=a;this.status=j.EXECUTED;m(\"exec\",this);return a};e.resolve=function(b,c){var a={id:b,refUri:c};m(\"resolve\",a);return a.uri||K(a.id,c)};e.define=function(b,c,a){var d=arguments.length;1===d?(a=b,b=u):2===d&&(a=c,A(b)?(c=b,b=u):c=u);if(!A(c)&&x(a)){var g=[];a.toString().replace($,\"\").replace(Z,function(a,b,c){c&&g.push(c)});c=g}d={id:b,uri:e.resolve(b),deps:c,factory:a};if(!d.uri&&\nn.attachEvent){var f=W();f&&(d.uri=f.src)}m(\"define\",d);d.uri?e.save(d.uri,d):C=d};e.save=function(b,c){var a=e.get(b);a.status<j.SAVED&&(a.id=c.id||b,a.dependencies=c.deps||[],a.factory=c.factory,a.status=j.SAVED)};e.get=function(b,c){return r[b]||(r[b]=new e(b,c))};e.use=function(b,c,a){var d=e.get(a,A(b)?b:[b]);d.callback=function(){for(var a=[],b=d.resolve(),e=0,f=b.length;e<f;e++)a[e]=r[b[e]].exec();c&&c.apply(t,a);delete d.callback};d.load()};e.preload=function(b){var c=h.preload,a=c.length;\na?e.use(c,function(){c.splice(0,a);e.preload(b)},h.cwd+\"_preload_\"+w++):b()};f.use=function(b,c){e.preload(function(){e.use(b,c,h.cwd+\"_use_\"+w++)});return f};e.define.cmd={};t.define=e.define;f.Module=e;h.fetchedList=H;h.cid=Q;f.resolve=K;f.require=function(b){return(r[e.resolve(b)]||{}).exports};h.base=(k.match(/^(.+?\\/)(\\?\\?)?(seajs\\/)+/)||[\"\",k])[1];h.dir=k;h.cwd=B;h.charset=\"utf-8\";var B=h,P=[],q=q.search.replace(/(seajs-\\w+)(&|$)/g,\"$1=1$2\"),q=q+(\" \"+n.cookie);q.replace(/(seajs-\\w+)=1/g,function(b,\nc){P.push(c)});B.preload=P;f.config=function(b){for(var c in b){var a=b[c],d=h[c];if(d&&X(d))for(var e in a)d[e]=a[e];else A(d)?a=d.concat(a):\"base\"===c&&(\"/\"===a.slice(-1)||(a+=\"/\"),a=I(a)),h[c]=a}m(\"config\",b);return f}}})(this);\n"
  },
  {
    "path": "lib/vue-2.1.4.js",
    "content": "/*!\n * Vue.js v2.1.4\n * (c) 2014-2016 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.Vue = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction _toString (val) {\n  return val == null\n    ? ''\n    : typeof val === 'object'\n      ? JSON.stringify(val, null, 2)\n      : String(val)\n}\n\n/**\n * Convert a input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n  var n = parseFloat(val, 10);\n  return (n || n === 0) ? n : val\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n  str,\n  expectsLowerCase\n) {\n  var map = Object.create(null);\n  var list = str.split(',');\n  for (var i = 0; i < list.length; i++) {\n    map[list[i]] = true;\n  }\n  return expectsLowerCase\n    ? function (val) { return map[val.toLowerCase()]; }\n    : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Remove an item from an array\n */\nfunction remove$1 (arr, item) {\n  if (arr.length) {\n    var index = arr.indexOf(item);\n    if (index > -1) {\n      return arr.splice(index, 1)\n    }\n  }\n}\n\n/**\n * Check whether the object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n  return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Check if value is primitive\n */\nfunction isPrimitive (value) {\n  return typeof value === 'string' || typeof value === 'number'\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n  var cache = Object.create(null);\n  return function cachedFn (str) {\n    var hit = cache[str];\n    return hit || (cache[str] = fn(str))\n  }\n}\n\n/**\n * Camelize a hyphen-delmited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n  return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /([^-])([A-Z])/g;\nvar hyphenate = cached(function (str) {\n  return str\n    .replace(hyphenateRE, '$1-$2')\n    .replace(hyphenateRE, '$1-$2')\n    .toLowerCase()\n});\n\n/**\n * Simple bind, faster than native\n */\nfunction bind$1 (fn, ctx) {\n  function boundFn (a) {\n    var l = arguments.length;\n    return l\n      ? l > 1\n        ? fn.apply(ctx, arguments)\n        : fn.call(ctx, a)\n      : fn.call(ctx)\n  }\n  // record original fn length\n  boundFn._length = fn.length;\n  return boundFn\n}\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n  start = start || 0;\n  var i = list.length - start;\n  var ret = new Array(i);\n  while (i--) {\n    ret[i] = list[i + start];\n  }\n  return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n  for (var key in _from) {\n    to[key] = _from[key];\n  }\n  return to\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n  return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n  return toString.call(obj) === OBJECT_STRING\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n  var res = {};\n  for (var i = 0; i < arr.length; i++) {\n    if (arr[i]) {\n      extend(res, arr[i]);\n    }\n  }\n  return res\n}\n\n/**\n * Perform no operation.\n */\nfunction noop () {}\n\n/**\n * Always return false.\n */\nvar no = function () { return false; };\n\n/**\n * Generate a static keys string from compiler modules.\n */\nfunction genStaticKeys (modules) {\n  return modules.reduce(function (keys, m) {\n    return keys.concat(m.staticKeys || [])\n  }, []).join(',')\n}\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n  /* eslint-disable eqeqeq */\n  return a == b || (\n    isObject(a) && isObject(b)\n      ? JSON.stringify(a) === JSON.stringify(b)\n      : false\n  )\n  /* eslint-enable eqeqeq */\n}\n\nfunction looseIndexOf (arr, val) {\n  for (var i = 0; i < arr.length; i++) {\n    if (looseEqual(arr[i], val)) { return i }\n  }\n  return -1\n}\n\n/*  */\n\nvar config = {\n  /**\n   * Option merge strategies (used in core/util/options)\n   */\n  optionMergeStrategies: Object.create(null),\n\n  /**\n   * Whether to suppress warnings.\n   */\n  silent: false,\n\n  /**\n   * Whether to enable devtools\n   */\n  devtools: \"development\" !== 'production',\n\n  /**\n   * Error handler for watcher errors\n   */\n  errorHandler: null,\n\n  /**\n   * Ignore certain custom elements\n   */\n  ignoredElements: null,\n\n  /**\n   * Custom user key aliases for v-on\n   */\n  keyCodes: Object.create(null),\n\n  /**\n   * Check if a tag is reserved so that it cannot be registered as a\n   * component. This is platform-dependent and may be overwritten.\n   */\n  isReservedTag: no,\n\n  /**\n   * Check if a tag is an unknown element.\n   * Platform-dependent.\n   */\n  isUnknownElement: no,\n\n  /**\n   * Get the namespace of an element\n   */\n  getTagNamespace: noop,\n\n  /**\n   * Check if an attribute must be bound using property, e.g. value\n   * Platform-dependent.\n   */\n  mustUseProp: no,\n\n  /**\n   * List of asset types that a component can own.\n   */\n  _assetTypes: [\n    'component',\n    'directive',\n    'filter'\n  ],\n\n  /**\n   * List of lifecycle hooks.\n   */\n  _lifecycleHooks: [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated'\n  ],\n\n  /**\n   * Max circular updates allowed in a scheduler flush cycle.\n   */\n  _maxUpdateCount: 100\n};\n\n/*  */\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n  var c = (str + '').charCodeAt(0);\n  return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n  Object.defineProperty(obj, key, {\n    value: val,\n    enumerable: !!enumerable,\n    writable: true,\n    configurable: true\n  });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = /[^\\w.$]/;\nfunction parsePath (path) {\n  if (bailRE.test(path)) {\n    return\n  } else {\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n}\n\n/*  */\n/* globals MutationObserver */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = UA && UA.indexOf('android') > 0;\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n  if (_isServer === undefined) {\n    /* istanbul ignore if */\n    if (!inBrowser && typeof global !== 'undefined') {\n      // detect presence of vue-server-renderer and avoid\n      // Webpack shimming the process\n      _isServer = global['process'].env.VUE_ENV === 'server';\n    } else {\n      _isServer = false;\n    }\n  }\n  return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n  return /native code/.test(Ctor.toString())\n}\n\n/**\n * Defer a task to execute it asynchronously.\n */\nvar nextTick = (function () {\n  var callbacks = [];\n  var pending = false;\n  var timerFunc;\n\n  function nextTickHandler () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // the nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore if */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    var logError = function (err) { console.error(err); };\n    timerFunc = function () {\n      p.then(nextTickHandler).catch(logError);\n      // in problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n  } else if (typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS IE11, iOS7, Android 4.4\n    var counter = 1;\n    var observer = new MutationObserver(nextTickHandler);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n  } else {\n    // fallback to setTimeout\n    /* istanbul ignore next */\n    timerFunc = function () {\n      setTimeout(nextTickHandler, 0);\n    };\n  }\n\n  return function queueNextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) { cb.call(ctx); }\n      if (_resolve) { _resolve(ctx); }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n})();\n\nvar _Set;\n/* istanbul ignore if */\nif (typeof Set !== 'undefined' && isNative(Set)) {\n  // use native Set when available.\n  _Set = Set;\n} else {\n  // a non-standard Set polyfill that only works with primitive keys.\n  _Set = (function () {\n    function Set () {\n      this.set = Object.create(null);\n    }\n    Set.prototype.has = function has (key) {\n      return this.set[key] !== undefined\n    };\n    Set.prototype.add = function add (key) {\n      this.set[key] = 1;\n    };\n    Set.prototype.clear = function clear () {\n      this.set = Object.create(null);\n    };\n\n    return Set;\n  }());\n}\n\nvar warn = noop;\nvar formatComponentName;\n\n{\n  var hasConsole = typeof console !== 'undefined';\n\n  warn = function (msg, vm) {\n    if (hasConsole && (!config.silent)) {\n      console.error(\"[Vue warn]: \" + msg + \" \" + (\n        vm ? formatLocation(formatComponentName(vm)) : ''\n      ));\n    }\n  };\n\n  formatComponentName = function (vm) {\n    if (vm.$root === vm) {\n      return 'root instance'\n    }\n    var name = vm._isVue\n      ? vm.$options.name || vm.$options._componentTag\n      : vm.name;\n    return (\n      (name ? (\"component <\" + name + \">\") : \"anonymous component\") +\n      (vm._isVue && vm.$options.__file ? (\" at \" + (vm.$options.__file)) : '')\n    )\n  };\n\n  var formatLocation = function (str) {\n    if (str === 'anonymous component') {\n      str += \" - use the \\\"name\\\" option for better debugging messages.\";\n    }\n    return (\"\\n(found in \" + str + \")\")\n  };\n}\n\n/*  */\n\n\nvar uid$1 = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n  this.id = uid$1++;\n  this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n  this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n  remove$1(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n  if (Dep.target) {\n    Dep.target.addDep(this);\n  }\n};\n\nDep.prototype.notify = function notify () {\n  // stablize the subscriber list first\n  var subs = this.subs.slice();\n  for (var i = 0, l = subs.length; i < l; i++) {\n    subs[i].update();\n  }\n};\n\n// the current target watcher being evaluated.\n// this is globally unique because there could be only one\n// watcher being evaluated at any time.\nDep.target = null;\nvar targetStack = [];\n\nfunction pushTarget (_target) {\n  if (Dep.target) { targetStack.push(Dep.target); }\n  Dep.target = _target;\n}\n\nfunction popTarget () {\n  Dep.target = targetStack.pop();\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);[\n  'push',\n  'pop',\n  'shift',\n  'unshift',\n  'splice',\n  'sort',\n  'reverse'\n]\n.forEach(function (method) {\n  // cache original method\n  var original = arrayProto[method];\n  def(arrayMethods, method, function mutator () {\n    var arguments$1 = arguments;\n\n    // avoid leaking arguments:\n    // http://jsperf.com/closure-with-arguments\n    var i = arguments.length;\n    var args = new Array(i);\n    while (i--) {\n      args[i] = arguments$1[i];\n    }\n    var result = original.apply(this, args);\n    var ob = this.__ob__;\n    var inserted;\n    switch (method) {\n      case 'push':\n        inserted = args;\n        break\n      case 'unshift':\n        inserted = args;\n        break\n      case 'splice':\n        inserted = args.slice(2);\n        break\n    }\n    if (inserted) { ob.observeArray(inserted); }\n    // notify change\n    ob.dep.notify();\n    return result\n  });\n});\n\n/*  */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * By default, when a reactive property is set, the new value is\n * also converted to become reactive. However when passing down props,\n * we don't want to force conversion because the value may be a nested value\n * under a frozen data structure. Converting it would defeat the optimization.\n */\nvar observerState = {\n  shouldConvert: true,\n  isSettingProps: false\n};\n\n/**\n * Observer class that are attached to each observed\n * object. Once attached, the observer converts target\n * object's property keys into getter/setters that\n * collect dependencies and dispatches updates.\n */\nvar Observer = function Observer (value) {\n  this.value = value;\n  this.dep = new Dep();\n  this.vmCount = 0;\n  def(value, '__ob__', this);\n  if (Array.isArray(value)) {\n    var augment = hasProto\n      ? protoAugment\n      : copyAugment;\n    augment(value, arrayMethods, arrayKeys);\n    this.observeArray(value);\n  } else {\n    this.walk(value);\n  }\n};\n\n/**\n * Walk through each property and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n  var keys = Object.keys(obj);\n  for (var i = 0; i < keys.length; i++) {\n    defineReactive$$1(obj, keys[i], obj[keys[i]]);\n  }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n  for (var i = 0, l = items.length; i < l; i++) {\n    observe(items[i]);\n  }\n};\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src) {\n  /* eslint-disable no-proto */\n  target.__proto__ = src;\n  /* eslint-enable no-proto */\n}\n\n/**\n * Augment an target Object or Array by defining\n * hidden properties.\n *\n * istanbul ignore next\n */\nfunction copyAugment (target, src, keys) {\n  for (var i = 0, l = keys.length; i < l; i++) {\n    var key = keys[i];\n    def(target, key, src[key]);\n  }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value) {\n  if (!isObject(value)) {\n    return\n  }\n  var ob;\n  if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n    ob = value.__ob__;\n  } else if (\n    observerState.shouldConvert &&\n    !isServerRendering() &&\n    (Array.isArray(value) || isPlainObject(value)) &&\n    Object.isExtensible(value) &&\n    !value._isVue\n  ) {\n    ob = new Observer(value);\n  }\n  return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive$$1 (\n  obj,\n  key,\n  val,\n  customSetter\n) {\n  var dep = new Dep();\n\n  var property = Object.getOwnPropertyDescriptor(obj, key);\n  if (property && property.configurable === false) {\n    return\n  }\n\n  // cater for pre-defined getter/setters\n  var getter = property && property.get;\n  var setter = property && property.set;\n\n  var childOb = observe(val);\n  Object.defineProperty(obj, key, {\n    enumerable: true,\n    configurable: true,\n    get: function reactiveGetter () {\n      var value = getter ? getter.call(obj) : val;\n      if (Dep.target) {\n        dep.depend();\n        if (childOb) {\n          childOb.dep.depend();\n        }\n        if (Array.isArray(value)) {\n          dependArray(value);\n        }\n      }\n      return value\n    },\n    set: function reactiveSetter (newVal) {\n      var value = getter ? getter.call(obj) : val;\n      /* eslint-disable no-self-compare */\n      if (newVal === value || (newVal !== newVal && value !== value)) {\n        return\n      }\n      /* eslint-enable no-self-compare */\n      if (\"development\" !== 'production' && customSetter) {\n        customSetter();\n      }\n      if (setter) {\n        setter.call(obj, newVal);\n      } else {\n        val = newVal;\n      }\n      childOb = observe(newVal);\n      dep.notify();\n    }\n  });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set$1 (obj, key, val) {\n  if (Array.isArray(obj)) {\n    obj.length = Math.max(obj.length, key);\n    obj.splice(key, 1, val);\n    return val\n  }\n  if (hasOwn(obj, key)) {\n    obj[key] = val;\n    return\n  }\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid adding reactive properties to a Vue instance or its root $data ' +\n      'at runtime - declare it upfront in the data option.'\n    );\n    return\n  }\n  if (!ob) {\n    obj[key] = val;\n    return\n  }\n  defineReactive$$1(ob.value, key, val);\n  ob.dep.notify();\n  return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (obj, key) {\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid deleting properties on a Vue instance or its root $data ' +\n      '- just set it to null.'\n    );\n    return\n  }\n  if (!hasOwn(obj, key)) {\n    return\n  }\n  delete obj[key];\n  if (!ob) {\n    return\n  }\n  ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n  for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n    e = value[i];\n    e && e.__ob__ && e.__ob__.dep.depend();\n    if (Array.isArray(e)) {\n      dependArray(e);\n    }\n  }\n}\n\n/*  */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\n{\n  strats.el = strats.propsData = function (parent, child, vm, key) {\n    if (!vm) {\n      warn(\n        \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n        'creation with the `new` keyword.'\n      );\n    }\n    return defaultStrat(parent, child)\n  };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n  if (!from) { return to }\n  var key, toVal, fromVal;\n  var keys = Object.keys(from);\n  for (var i = 0; i < keys.length; i++) {\n    key = keys[i];\n    toVal = to[key];\n    fromVal = from[key];\n    if (!hasOwn(to, key)) {\n      set$1(to, key, fromVal);\n    } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {\n      mergeData(toVal, fromVal);\n    }\n  }\n  return to\n}\n\n/**\n * Data\n */\nstrats.data = function (\n  parentVal,\n  childVal,\n  vm\n) {\n  if (!vm) {\n    // in a Vue.extend merge, both should be functions\n    if (!childVal) {\n      return parentVal\n    }\n    if (typeof childVal !== 'function') {\n      \"development\" !== 'production' && warn(\n        'The \"data\" option should be a function ' +\n        'that returns a per-instance value in component ' +\n        'definitions.',\n        vm\n      );\n      return parentVal\n    }\n    if (!parentVal) {\n      return childVal\n    }\n    // when parentVal & childVal are both present,\n    // we need to return a function that returns the\n    // merged result of both functions... no need to\n    // check if parentVal is a function here because\n    // it has to be a function to pass previous merges.\n    return function mergedDataFn () {\n      return mergeData(\n        childVal.call(this),\n        parentVal.call(this)\n      )\n    }\n  } else if (parentVal || childVal) {\n    return function mergedInstanceDataFn () {\n      // instance merge\n      var instanceData = typeof childVal === 'function'\n        ? childVal.call(vm)\n        : childVal;\n      var defaultData = typeof parentVal === 'function'\n        ? parentVal.call(vm)\n        : undefined;\n      if (instanceData) {\n        return mergeData(instanceData, defaultData)\n      } else {\n        return defaultData\n      }\n    }\n  }\n};\n\n/**\n * Hooks and param attributes are merged as arrays.\n */\nfunction mergeHook (\n  parentVal,\n  childVal\n) {\n  return childVal\n    ? parentVal\n      ? parentVal.concat(childVal)\n      : Array.isArray(childVal)\n        ? childVal\n        : [childVal]\n    : parentVal\n}\n\nconfig._lifecycleHooks.forEach(function (hook) {\n  strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (parentVal, childVal) {\n  var res = Object.create(parentVal || null);\n  return childVal\n    ? extend(res, childVal)\n    : res\n}\n\nconfig._assetTypes.forEach(function (type) {\n  strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (parentVal, childVal) {\n  /* istanbul ignore if */\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = {};\n  extend(ret, parentVal);\n  for (var key in childVal) {\n    var parent = ret[key];\n    var child = childVal[key];\n    if (parent && !Array.isArray(parent)) {\n      parent = [parent];\n    }\n    ret[key] = parent\n      ? parent.concat(child)\n      : [child];\n  }\n  return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.computed = function (parentVal, childVal) {\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = Object.create(null);\n  extend(ret, parentVal);\n  extend(ret, childVal);\n  return ret\n};\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n  return childVal === undefined\n    ? parentVal\n    : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n  for (var key in options.components) {\n    var lower = key.toLowerCase();\n    if (isBuiltInTag(lower) || config.isReservedTag(lower)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + key\n      );\n    }\n  }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options) {\n  var props = options.props;\n  if (!props) { return }\n  var res = {};\n  var i, val, name;\n  if (Array.isArray(props)) {\n    i = props.length;\n    while (i--) {\n      val = props[i];\n      if (typeof val === 'string') {\n        name = camelize(val);\n        res[name] = { type: null };\n      } else {\n        warn('props must be strings when using array syntax.');\n      }\n    }\n  } else if (isPlainObject(props)) {\n    for (var key in props) {\n      val = props[key];\n      name = camelize(key);\n      res[name] = isPlainObject(val)\n        ? val\n        : { type: val };\n    }\n  }\n  options.props = res;\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n  var dirs = options.directives;\n  if (dirs) {\n    for (var key in dirs) {\n      var def = dirs[key];\n      if (typeof def === 'function') {\n        dirs[key] = { bind: def, update: def };\n      }\n    }\n  }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n  parent,\n  child,\n  vm\n) {\n  {\n    checkComponents(child);\n  }\n  normalizeProps(child);\n  normalizeDirectives(child);\n  var extendsFrom = child.extends;\n  if (extendsFrom) {\n    parent = typeof extendsFrom === 'function'\n      ? mergeOptions(parent, extendsFrom.options, vm)\n      : mergeOptions(parent, extendsFrom, vm);\n  }\n  if (child.mixins) {\n    for (var i = 0, l = child.mixins.length; i < l; i++) {\n      var mixin = child.mixins[i];\n      if (mixin.prototype instanceof Vue$3) {\n        mixin = mixin.options;\n      }\n      parent = mergeOptions(parent, mixin, vm);\n    }\n  }\n  var options = {};\n  var key;\n  for (key in parent) {\n    mergeField(key);\n  }\n  for (key in child) {\n    if (!hasOwn(parent, key)) {\n      mergeField(key);\n    }\n  }\n  function mergeField (key) {\n    var strat = strats[key] || defaultStrat;\n    options[key] = strat(parent[key], child[key], vm, key);\n  }\n  return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n  options,\n  type,\n  id,\n  warnMissing\n) {\n  /* istanbul ignore if */\n  if (typeof id !== 'string') {\n    return\n  }\n  var assets = options[type];\n  var res = assets[id] ||\n    // camelCase ID\n    assets[camelize(id)] ||\n    // Pascal Case ID\n    assets[capitalize(camelize(id))];\n  if (\"development\" !== 'production' && warnMissing && !res) {\n    warn(\n      'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n      options\n    );\n  }\n  return res\n}\n\n/*  */\n\nfunction validateProp (\n  key,\n  propOptions,\n  propsData,\n  vm\n) {\n  var prop = propOptions[key];\n  var absent = !hasOwn(propsData, key);\n  var value = propsData[key];\n  // handle boolean props\n  if (isBooleanType(prop.type)) {\n    if (absent && !hasOwn(prop, 'default')) {\n      value = false;\n    } else if (value === '' || value === hyphenate(key)) {\n      value = true;\n    }\n  }\n  // check default value\n  if (value === undefined) {\n    value = getPropDefaultValue(vm, prop, key);\n    // since the default value is a fresh copy,\n    // make sure to observe it.\n    var prevShouldConvert = observerState.shouldConvert;\n    observerState.shouldConvert = true;\n    observe(value);\n    observerState.shouldConvert = prevShouldConvert;\n  }\n  {\n    assertProp(prop, key, value, vm, absent);\n  }\n  return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n  // no default, return undefined\n  if (!hasOwn(prop, 'default')) {\n    return undefined\n  }\n  var def = prop.default;\n  // warn against non-factory defaults for Object & Array\n  if (isObject(def)) {\n    \"development\" !== 'production' && warn(\n      'Invalid default value for prop \"' + key + '\": ' +\n      'Props with type Object/Array must use a factory function ' +\n      'to return the default value.',\n      vm\n    );\n  }\n  // the raw prop value was also undefined from previous render,\n  // return previous default value to avoid unnecessary watcher trigger\n  if (vm && vm.$options.propsData &&\n    vm.$options.propsData[key] === undefined &&\n    vm[key] !== undefined) {\n    return vm[key]\n  }\n  // call factory function for non-Function types\n  return typeof def === 'function' && prop.type !== Function\n    ? def.call(vm)\n    : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n  prop,\n  name,\n  value,\n  vm,\n  absent\n) {\n  if (prop.required && absent) {\n    warn(\n      'Missing required prop: \"' + name + '\"',\n      vm\n    );\n    return\n  }\n  if (value == null && !prop.required) {\n    return\n  }\n  var type = prop.type;\n  var valid = !type || type === true;\n  var expectedTypes = [];\n  if (type) {\n    if (!Array.isArray(type)) {\n      type = [type];\n    }\n    for (var i = 0; i < type.length && !valid; i++) {\n      var assertedType = assertType(value, type[i]);\n      expectedTypes.push(assertedType.expectedType);\n      valid = assertedType.valid;\n    }\n  }\n  if (!valid) {\n    warn(\n      'Invalid prop: type check failed for prop \"' + name + '\".' +\n      ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n      ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n      vm\n    );\n    return\n  }\n  var validator = prop.validator;\n  if (validator) {\n    if (!validator(value)) {\n      warn(\n        'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n        vm\n      );\n    }\n  }\n}\n\n/**\n * Assert the type of a value\n */\nfunction assertType (value, type) {\n  var valid;\n  var expectedType = getType(type);\n  if (expectedType === 'String') {\n    valid = typeof value === (expectedType = 'string');\n  } else if (expectedType === 'Number') {\n    valid = typeof value === (expectedType = 'number');\n  } else if (expectedType === 'Boolean') {\n    valid = typeof value === (expectedType = 'boolean');\n  } else if (expectedType === 'Function') {\n    valid = typeof value === (expectedType = 'function');\n  } else if (expectedType === 'Object') {\n    valid = isPlainObject(value);\n  } else if (expectedType === 'Array') {\n    valid = Array.isArray(value);\n  } else {\n    valid = value instanceof type;\n  }\n  return {\n    valid: valid,\n    expectedType: expectedType\n  }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n  var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n  return match && match[1]\n}\n\nfunction isBooleanType (fn) {\n  if (!Array.isArray(fn)) {\n    return getType(fn) === 'Boolean'\n  }\n  for (var i = 0, len = fn.length; i < len; i++) {\n    if (getType(fn[i]) === 'Boolean') {\n      return true\n    }\n  }\n  /* istanbul ignore next */\n  return false\n}\n\n\n\nvar util = Object.freeze({\n  defineReactive: defineReactive$$1,\n  _toString: _toString,\n  toNumber: toNumber,\n  makeMap: makeMap,\n  isBuiltInTag: isBuiltInTag,\n  remove: remove$1,\n  hasOwn: hasOwn,\n  isPrimitive: isPrimitive,\n  cached: cached,\n  camelize: camelize,\n  capitalize: capitalize,\n  hyphenate: hyphenate,\n  bind: bind$1,\n  toArray: toArray,\n  extend: extend,\n  isObject: isObject,\n  isPlainObject: isPlainObject,\n  toObject: toObject,\n  noop: noop,\n  no: no,\n  genStaticKeys: genStaticKeys,\n  looseEqual: looseEqual,\n  looseIndexOf: looseIndexOf,\n  isReserved: isReserved,\n  def: def,\n  parsePath: parsePath,\n  hasProto: hasProto,\n  inBrowser: inBrowser,\n  UA: UA,\n  isIE: isIE,\n  isIE9: isIE9,\n  isEdge: isEdge,\n  isAndroid: isAndroid,\n  isIOS: isIOS,\n  isServerRendering: isServerRendering,\n  devtools: devtools,\n  nextTick: nextTick,\n  get _Set () { return _Set; },\n  mergeOptions: mergeOptions,\n  resolveAsset: resolveAsset,\n  get warn () { return warn; },\n  get formatComponentName () { return formatComponentName; },\n  validateProp: validateProp\n});\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\n{\n  var allowedGlobals = makeMap(\n    'Infinity,undefined,NaN,isFinite,isNaN,' +\n    'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n    'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n    'require' // for Webpack/Browserify\n  );\n\n  var warnNonPresent = function (target, key) {\n    warn(\n      \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n      \"referenced during render. Make sure to declare reactive data \" +\n      \"properties in the data option.\",\n      target\n    );\n  };\n\n  var hasProxy =\n    typeof Proxy !== 'undefined' &&\n    Proxy.toString().match(/native code/);\n\n  if (hasProxy) {\n    var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');\n    config.keyCodes = new Proxy(config.keyCodes, {\n      set: function set (target, key, value) {\n        if (isBuiltInModifier(key)) {\n          warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n          return false\n        } else {\n          target[key] = value;\n          return true\n        }\n      }\n    });\n  }\n\n  var hasHandler = {\n    has: function has (target, key) {\n      var has = key in target;\n      var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';\n      if (!has && !isAllowed) {\n        warnNonPresent(target, key);\n      }\n      return has || !isAllowed\n    }\n  };\n\n  var getHandler = {\n    get: function get (target, key) {\n      if (typeof key === 'string' && !(key in target)) {\n        warnNonPresent(target, key);\n      }\n      return target[key]\n    }\n  };\n\n  initProxy = function initProxy (vm) {\n    if (hasProxy) {\n      // determine which proxy handler to use\n      var options = vm.$options;\n      var handlers = options.render && options.render._withStripped\n        ? getHandler\n        : hasHandler;\n      vm._renderProxy = new Proxy(vm, handlers);\n    } else {\n      vm._renderProxy = vm;\n    }\n  };\n}\n\n/*  */\n\n\nvar queue = [];\nvar has$1 = {};\nvar circular = {};\nvar waiting = false;\nvar flushing = false;\nvar index = 0;\n\n/**\n * Reset the scheduler's state.\n */\nfunction resetSchedulerState () {\n  queue.length = 0;\n  has$1 = {};\n  {\n    circular = {};\n  }\n  waiting = flushing = false;\n}\n\n/**\n * Flush both queues and run the watchers.\n */\nfunction flushSchedulerQueue () {\n  flushing = true;\n\n  // Sort queue before flush.\n  // This ensures that:\n  // 1. Components are updated from parent to child. (because parent is always\n  //    created before the child)\n  // 2. A component's user watchers are run before its render watcher (because\n  //    user watchers are created before the render watcher)\n  // 3. If a component is destroyed during a parent component's watcher run,\n  //    its watchers can be skipped.\n  queue.sort(function (a, b) { return a.id - b.id; });\n\n  // do not cache length because more watchers might be pushed\n  // as we run existing watchers\n  for (index = 0; index < queue.length; index++) {\n    var watcher = queue[index];\n    var id = watcher.id;\n    has$1[id] = null;\n    watcher.run();\n    // in dev build, check and stop circular updates.\n    if (\"development\" !== 'production' && has$1[id] != null) {\n      circular[id] = (circular[id] || 0) + 1;\n      if (circular[id] > config._maxUpdateCount) {\n        warn(\n          'You may have an infinite update loop ' + (\n            watcher.user\n              ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n              : \"in a component render function.\"\n          ),\n          watcher.vm\n        );\n        break\n      }\n    }\n  }\n\n  // devtool hook\n  /* istanbul ignore if */\n  if (devtools && config.devtools) {\n    devtools.emit('flush');\n  }\n\n  resetSchedulerState();\n}\n\n/**\n * Push a watcher into the watcher queue.\n * Jobs with duplicate IDs will be skipped unless it's\n * pushed when the queue is being flushed.\n */\nfunction queueWatcher (watcher) {\n  var id = watcher.id;\n  if (has$1[id] == null) {\n    has$1[id] = true;\n    if (!flushing) {\n      queue.push(watcher);\n    } else {\n      // if already flushing, splice the watcher based on its id\n      // if already past its id, it will be run next immediately.\n      var i = queue.length - 1;\n      while (i >= 0 && queue[i].id > watcher.id) {\n        i--;\n      }\n      queue.splice(Math.max(i, index) + 1, 0, watcher);\n    }\n    // queue the flush\n    if (!waiting) {\n      waiting = true;\n      nextTick(flushSchedulerQueue);\n    }\n  }\n}\n\n/*  */\n\nvar uid$2 = 0;\n\n/**\n * A watcher parses an expression, collects dependencies,\n * and fires callback when the expression value changes.\n * This is used for both the $watch() api and directives.\n */\nvar Watcher = function Watcher (\n  vm,\n  expOrFn,\n  cb,\n  options\n) {\n  if ( options === void 0 ) options = {};\n\n  this.vm = vm;\n  vm._watchers.push(this);\n  // options\n  this.deep = !!options.deep;\n  this.user = !!options.user;\n  this.lazy = !!options.lazy;\n  this.sync = !!options.sync;\n  this.expression = expOrFn.toString();\n  this.cb = cb;\n  this.id = ++uid$2; // uid for batching\n  this.active = true;\n  this.dirty = this.lazy; // for lazy watchers\n  this.deps = [];\n  this.newDeps = [];\n  this.depIds = new _Set();\n  this.newDepIds = new _Set();\n  // parse expression for getter\n  if (typeof expOrFn === 'function') {\n    this.getter = expOrFn;\n  } else {\n    this.getter = parsePath(expOrFn);\n    if (!this.getter) {\n      this.getter = function () {};\n      \"development\" !== 'production' && warn(\n        \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n        'Watcher only accepts simple dot-delimited paths. ' +\n        'For full control, use a function instead.',\n        vm\n      );\n    }\n  }\n  this.value = this.lazy\n    ? undefined\n    : this.get();\n};\n\n/**\n * Evaluate the getter, and re-collect dependencies.\n */\nWatcher.prototype.get = function get () {\n  pushTarget(this);\n  var value = this.getter.call(this.vm, this.vm);\n  // \"touch\" every property so they are all tracked as\n  // dependencies for deep watching\n  if (this.deep) {\n    traverse(value);\n  }\n  popTarget();\n  this.cleanupDeps();\n  return value\n};\n\n/**\n * Add a dependency to this directive.\n */\nWatcher.prototype.addDep = function addDep (dep) {\n  var id = dep.id;\n  if (!this.newDepIds.has(id)) {\n    this.newDepIds.add(id);\n    this.newDeps.push(dep);\n    if (!this.depIds.has(id)) {\n      dep.addSub(this);\n    }\n  }\n};\n\n/**\n * Clean up for dependency collection.\n */\nWatcher.prototype.cleanupDeps = function cleanupDeps () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    var dep = this$1.deps[i];\n    if (!this$1.newDepIds.has(dep.id)) {\n      dep.removeSub(this$1);\n    }\n  }\n  var tmp = this.depIds;\n  this.depIds = this.newDepIds;\n  this.newDepIds = tmp;\n  this.newDepIds.clear();\n  tmp = this.deps;\n  this.deps = this.newDeps;\n  this.newDeps = tmp;\n  this.newDeps.length = 0;\n};\n\n/**\n * Subscriber interface.\n * Will be called when a dependency changes.\n */\nWatcher.prototype.update = function update () {\n  /* istanbul ignore else */\n  if (this.lazy) {\n    this.dirty = true;\n  } else if (this.sync) {\n    this.run();\n  } else {\n    queueWatcher(this);\n  }\n};\n\n/**\n * Scheduler job interface.\n * Will be called by the scheduler.\n */\nWatcher.prototype.run = function run () {\n  if (this.active) {\n    var value = this.get();\n      if (\n        value !== this.value ||\n      // Deep watchers and watchers on Object/Arrays should fire even\n      // when the value is the same, because the value may\n      // have mutated.\n      isObject(value) ||\n      this.deep\n    ) {\n      // set new value\n      var oldValue = this.value;\n      this.value = value;\n      if (this.user) {\n        try {\n          this.cb.call(this.vm, value, oldValue);\n        } catch (e) {\n          /* istanbul ignore else */\n          if (config.errorHandler) {\n            config.errorHandler.call(null, e, this.vm);\n          } else {\n            \"development\" !== 'production' && warn(\n              (\"Error in watcher \\\"\" + (this.expression) + \"\\\"\"),\n              this.vm\n            );\n            throw e\n          }\n        }\n      } else {\n        this.cb.call(this.vm, value, oldValue);\n      }\n    }\n  }\n};\n\n/**\n * Evaluate the value of the watcher.\n * This only gets called for lazy watchers.\n */\nWatcher.prototype.evaluate = function evaluate () {\n  this.value = this.get();\n  this.dirty = false;\n};\n\n/**\n * Depend on all deps collected by this watcher.\n */\nWatcher.prototype.depend = function depend () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    this$1.deps[i].depend();\n  }\n};\n\n/**\n * Remove self from all dependencies' subscriber list.\n */\nWatcher.prototype.teardown = function teardown () {\n    var this$1 = this;\n\n  if (this.active) {\n    // remove self from vm's watcher list\n    // this is a somewhat expensive operation so we skip it\n    // if the vm is being destroyed or is performing a v-for\n    // re-render (the watcher list is then filtered by v-for).\n    if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {\n      remove$1(this.vm._watchers, this);\n    }\n    var i = this.deps.length;\n    while (i--) {\n      this$1.deps[i].removeSub(this$1);\n    }\n    this.active = false;\n  }\n};\n\n/**\n * Recursively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n */\nvar seenObjects = new _Set();\nfunction traverse (val) {\n  seenObjects.clear();\n  _traverse(val, seenObjects);\n}\n\nfunction _traverse (val, seen) {\n  var i, keys;\n  var isA = Array.isArray(val);\n  if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {\n    return\n  }\n  if (val.__ob__) {\n    var depId = val.__ob__.dep.id;\n    if (seen.has(depId)) {\n      return\n    }\n    seen.add(depId);\n  }\n  if (isA) {\n    i = val.length;\n    while (i--) { _traverse(val[i], seen); }\n  } else {\n    keys = Object.keys(val);\n    i = keys.length;\n    while (i--) { _traverse(val[keys[i]], seen); }\n  }\n}\n\n/*  */\n\nfunction initState (vm) {\n  vm._watchers = [];\n  initProps(vm);\n  initMethods(vm);\n  initData(vm);\n  initComputed(vm);\n  initWatch(vm);\n}\n\nvar isReservedProp = { key: 1, ref: 1, slot: 1 };\n\nfunction initProps (vm) {\n  var props = vm.$options.props;\n  if (props) {\n    var propsData = vm.$options.propsData || {};\n    var keys = vm.$options._propKeys = Object.keys(props);\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    observerState.shouldConvert = isRoot;\n    var loop = function ( i ) {\n      var key = keys[i];\n      /* istanbul ignore else */\n      {\n        if (isReservedProp[key]) {\n          warn(\n            (\"\\\"\" + key + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {\n          if (vm.$parent && !observerState.isSettingProps) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n    };\n\n    for (var i = 0; i < keys.length; i++) loop( i );\n    observerState.shouldConvert = true;\n  }\n}\n\nfunction initData (vm) {\n  var data = vm.$options.data;\n  data = vm._data = typeof data === 'function'\n    ? data.call(vm)\n    : data || {};\n  if (!isPlainObject(data)) {\n    data = {};\n    \"development\" !== 'production' && warn(\n      'data functions should return an object.',\n      vm\n    );\n  }\n  // proxy data on instance\n  var keys = Object.keys(data);\n  var props = vm.$options.props;\n  var i = keys.length;\n  while (i--) {\n    if (props && hasOwn(props, keys[i])) {\n      \"development\" !== 'production' && warn(\n        \"The data property \\\"\" + (keys[i]) + \"\\\" is already declared as a prop. \" +\n        \"Use prop default value instead.\",\n        vm\n      );\n    } else {\n      proxy(vm, keys[i]);\n    }\n  }\n  // observe data\n  observe(data);\n  data.__ob__ && data.__ob__.vmCount++;\n}\n\nvar computedSharedDefinition = {\n  enumerable: true,\n  configurable: true,\n  get: noop,\n  set: noop\n};\n\nfunction initComputed (vm) {\n  var computed = vm.$options.computed;\n  if (computed) {\n    for (var key in computed) {\n      var userDef = computed[key];\n      if (typeof userDef === 'function') {\n        computedSharedDefinition.get = makeComputedGetter(userDef, vm);\n        computedSharedDefinition.set = noop;\n      } else {\n        computedSharedDefinition.get = userDef.get\n          ? userDef.cache !== false\n            ? makeComputedGetter(userDef.get, vm)\n            : bind$1(userDef.get, vm)\n          : noop;\n        computedSharedDefinition.set = userDef.set\n          ? bind$1(userDef.set, vm)\n          : noop;\n      }\n      Object.defineProperty(vm, key, computedSharedDefinition);\n    }\n  }\n}\n\nfunction makeComputedGetter (getter, owner) {\n  var watcher = new Watcher(owner, getter, noop, {\n    lazy: true\n  });\n  return function computedGetter () {\n    if (watcher.dirty) {\n      watcher.evaluate();\n    }\n    if (Dep.target) {\n      watcher.depend();\n    }\n    return watcher.value\n  }\n}\n\nfunction initMethods (vm) {\n  var methods = vm.$options.methods;\n  if (methods) {\n    for (var key in methods) {\n      vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);\n      if (\"development\" !== 'production' && methods[key] == null) {\n        warn(\n          \"method \\\"\" + key + \"\\\" has an undefined value in the component definition. \" +\n          \"Did you reference the function correctly?\",\n          vm\n        );\n      }\n    }\n  }\n}\n\nfunction initWatch (vm) {\n  var watch = vm.$options.watch;\n  if (watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n}\n\nfunction createWatcher (vm, key, handler) {\n  var options;\n  if (isPlainObject(handler)) {\n    options = handler;\n    handler = handler.handler;\n  }\n  if (typeof handler === 'string') {\n    handler = vm[handler];\n  }\n  vm.$watch(key, handler, options);\n}\n\nfunction stateMixin (Vue) {\n  // flow somehow has problems with directly declared definition object\n  // when using Object.defineProperty, so we have to procedurally build up\n  // the object here.\n  var dataDef = {};\n  dataDef.get = function () {\n    return this._data\n  };\n  {\n    dataDef.set = function (newData) {\n      warn(\n        'Avoid replacing instance root $data. ' +\n        'Use nested data properties instead.',\n        this\n      );\n    };\n  }\n  Object.defineProperty(Vue.prototype, '$data', dataDef);\n\n  Vue.prototype.$set = set$1;\n  Vue.prototype.$delete = del;\n\n  Vue.prototype.$watch = function (\n    expOrFn,\n    cb,\n    options\n  ) {\n    var vm = this;\n    options = options || {};\n    options.user = true;\n    var watcher = new Watcher(vm, expOrFn, cb, options);\n    if (options.immediate) {\n      cb.call(vm, watcher.value);\n    }\n    return function unwatchFn () {\n      watcher.teardown();\n    }\n  };\n}\n\nfunction proxy (vm, key) {\n  if (!isReserved(key)) {\n    Object.defineProperty(vm, key, {\n      configurable: true,\n      enumerable: true,\n      get: function proxyGetter () {\n        return vm._data[key]\n      },\n      set: function proxySetter (val) {\n        vm._data[key] = val;\n      }\n    });\n  }\n}\n\n/*  */\n\nvar VNode = function VNode (\n  tag,\n  data,\n  children,\n  text,\n  elm,\n  ns,\n  context,\n  componentOptions\n) {\n  this.tag = tag;\n  this.data = data;\n  this.children = children;\n  this.text = text;\n  this.elm = elm;\n  this.ns = ns;\n  this.context = context;\n  this.functionalContext = undefined;\n  this.key = data && data.key;\n  this.componentOptions = componentOptions;\n  this.child = undefined;\n  this.parent = undefined;\n  this.raw = false;\n  this.isStatic = false;\n  this.isRootInsert = true;\n  this.isComment = false;\n  this.isCloned = false;\n  this.isOnce = false;\n};\n\nvar emptyVNode = function () {\n  var node = new VNode();\n  node.text = '';\n  node.isComment = true;\n  return node\n};\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n  var cloned = new VNode(\n    vnode.tag,\n    vnode.data,\n    vnode.children,\n    vnode.text,\n    vnode.elm,\n    vnode.ns,\n    vnode.context,\n    vnode.componentOptions\n  );\n  cloned.isStatic = vnode.isStatic;\n  cloned.key = vnode.key;\n  cloned.isCloned = true;\n  return cloned\n}\n\nfunction cloneVNodes (vnodes) {\n  var res = new Array(vnodes.length);\n  for (var i = 0; i < vnodes.length; i++) {\n    res[i] = cloneVNode(vnodes[i]);\n  }\n  return res\n}\n\n/*  */\n\nfunction mergeVNodeHook (def, hookKey, hook, key) {\n  key = key + hookKey;\n  var injectedHash = def.__injected || (def.__injected = {});\n  if (!injectedHash[key]) {\n    injectedHash[key] = true;\n    var oldHook = def[hookKey];\n    if (oldHook) {\n      def[hookKey] = function () {\n        oldHook.apply(this, arguments);\n        hook.apply(this, arguments);\n      };\n    } else {\n      def[hookKey] = hook;\n    }\n  }\n}\n\n/*  */\n\nfunction updateListeners (\n  on,\n  oldOn,\n  add,\n  remove$$1,\n  vm\n) {\n  var name, cur, old, fn, event, capture, once;\n  for (name in on) {\n    cur = on[name];\n    old = oldOn[name];\n    if (!cur) {\n      \"development\" !== 'production' && warn(\n        \"Invalid handler for event \\\"\" + name + \"\\\": got \" + String(cur),\n        vm\n      );\n    } else if (!old) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      if (Array.isArray(cur)) {\n        add(event, (cur.invoker = arrInvoker(cur)), once, capture);\n      } else {\n        if (!cur.invoker) {\n          fn = cur;\n          cur = on[name] = {};\n          cur.fn = fn;\n          cur.invoker = fnInvoker(cur);\n        }\n        add(event, cur.invoker, once, capture);\n      }\n    } else if (cur !== old) {\n      if (Array.isArray(old)) {\n        old.length = cur.length;\n        for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }\n        on[name] = old;\n      } else {\n        old.fn = cur;\n        on[name] = old;\n      }\n    }\n  }\n  for (name in oldOn) {\n    if (!on[name]) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      remove$$1(event, oldOn[name].invoker, capture);\n    }\n  }\n}\n\nfunction arrInvoker (arr) {\n  return function (ev) {\n    var arguments$1 = arguments;\n\n    var single = arguments.length === 1;\n    for (var i = 0; i < arr.length; i++) {\n      single ? arr[i](ev) : arr[i].apply(null, arguments$1);\n    }\n  }\n}\n\nfunction fnInvoker (o) {\n  return function (ev) {\n    var single = arguments.length === 1;\n    single ? o.fn(ev) : o.fn.apply(null, arguments);\n  }\n}\n\n/*  */\n\nfunction normalizeChildren (\n  children,\n  ns,\n  nestedIndex\n) {\n  if (isPrimitive(children)) {\n    return [createTextVNode(children)]\n  }\n  if (Array.isArray(children)) {\n    var res = [];\n    for (var i = 0, l = children.length; i < l; i++) {\n      var c = children[i];\n      var last = res[res.length - 1];\n      //  nested\n      if (Array.isArray(c)) {\n        res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + \"_\" + i)));\n      } else if (isPrimitive(c)) {\n        if (last && last.text) {\n          last.text += String(c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else if (c instanceof VNode) {\n        if (c.text && last && last.text) {\n          if (!last.isCloned) {\n            last.text += c.text;\n          }\n        } else {\n          // inherit parent namespace\n          if (ns) {\n            applyNS(c, ns);\n          }\n          // default key for nested array children (likely generated by v-for)\n          if (c.tag && c.key == null && nestedIndex != null) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n}\n\nfunction createTextVNode (val) {\n  return new VNode(undefined, undefined, undefined, String(val))\n}\n\nfunction applyNS (vnode, ns) {\n  if (vnode.tag && !vnode.ns) {\n    vnode.ns = ns;\n    if (vnode.children) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        applyNS(vnode.children[i], ns);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction getFirstComponentChild (children) {\n  return children && children.filter(function (c) { return c && c.componentOptions; })[0]\n}\n\n/*  */\n\nvar activeInstance = null;\n\nfunction initLifecycle (vm) {\n  var options = vm.$options;\n\n  // locate first non-abstract parent\n  var parent = options.parent;\n  if (parent && !options.abstract) {\n    while (parent.$options.abstract && parent.$parent) {\n      parent = parent.$parent;\n    }\n    parent.$children.push(vm);\n  }\n\n  vm.$parent = parent;\n  vm.$root = parent ? parent.$root : vm;\n\n  vm.$children = [];\n  vm.$refs = {};\n\n  vm._watcher = null;\n  vm._inactive = false;\n  vm._isMounted = false;\n  vm._isDestroyed = false;\n  vm._isBeingDestroyed = false;\n}\n\nfunction lifecycleMixin (Vue) {\n  Vue.prototype._mount = function (\n    el,\n    hydrating\n  ) {\n    var vm = this;\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = emptyVNode;\n      {\n        /* istanbul ignore if */\n        if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'option is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n    vm._watcher = new Watcher(vm, function () {\n      vm._update(vm._render(), hydrating);\n    }, noop);\n    hydrating = false;\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  };\n\n  Vue.prototype._update = function (vnode, hydrating) {\n    var vm = this;\n    if (vm._isMounted) {\n      callHook(vm, 'beforeUpdate');\n    }\n    var prevEl = vm.$el;\n    var prevVnode = vm._vnode;\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    vm._vnode = vnode;\n    // Vue.prototype.__patch__ is injected in entry points\n    // based on the rendering backend used.\n    if (!prevVnode) {\n      // initial render\n      vm.$el = vm.__patch__(\n        vm.$el, vnode, hydrating, false /* removeOnly */,\n        vm.$options._parentElm,\n        vm.$options._refElm\n      );\n    } else {\n      // updates\n      vm.$el = vm.__patch__(prevVnode, vnode);\n    }\n    activeInstance = prevActiveInstance;\n    // update __vue__ reference\n    if (prevEl) {\n      prevEl.__vue__ = null;\n    }\n    if (vm.$el) {\n      vm.$el.__vue__ = vm;\n    }\n    // if parent is an HOC, update its $el as well\n    if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n      vm.$parent.$el = vm.$el;\n    }\n    if (vm._isMounted) {\n      callHook(vm, 'updated');\n    }\n  };\n\n  Vue.prototype._updateFromParent = function (\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    var vm = this;\n    var hasChildren = !!(vm.$options._renderChildren || renderChildren);\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n    // update props\n    if (propsData && vm.$options.props) {\n      observerState.shouldConvert = false;\n      {\n        observerState.isSettingProps = true;\n      }\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        vm[key] = validateProp(key, vm.$options.props, propsData, vm);\n      }\n      observerState.shouldConvert = true;\n      {\n        observerState.isSettingProps = false;\n      }\n      vm.$options.propsData = propsData;\n    }\n    // update listeners\n    if (listeners) {\n      var oldListeners = vm.$options._parentListeners;\n      vm.$options._parentListeners = listeners;\n      vm._updateListeners(listeners, oldListeners);\n    }\n    // resolve slots + force update if has children\n    if (hasChildren) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n  };\n\n  Vue.prototype.$forceUpdate = function () {\n    var vm = this;\n    if (vm._watcher) {\n      vm._watcher.update();\n    }\n  };\n\n  Vue.prototype.$destroy = function () {\n    var vm = this;\n    if (vm._isBeingDestroyed) {\n      return\n    }\n    callHook(vm, 'beforeDestroy');\n    vm._isBeingDestroyed = true;\n    // remove self from parent\n    var parent = vm.$parent;\n    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n      remove$1(parent.$children, vm);\n    }\n    // teardown watchers\n    if (vm._watcher) {\n      vm._watcher.teardown();\n    }\n    var i = vm._watchers.length;\n    while (i--) {\n      vm._watchers[i].teardown();\n    }\n    // remove reference from data ob\n    // frozen object may not have observer.\n    if (vm._data.__ob__) {\n      vm._data.__ob__.vmCount--;\n    }\n    // call the last hook...\n    vm._isDestroyed = true;\n    callHook(vm, 'destroyed');\n    // turn off all instance listeners.\n    vm.$off();\n    // remove __vue__ reference\n    if (vm.$el) {\n      vm.$el.__vue__ = null;\n    }\n    // invoke destroy hooks on current rendered tree\n    vm.__patch__(vm._vnode, null);\n  };\n}\n\nfunction callHook (vm, hook) {\n  var handlers = vm.$options[hook];\n  if (handlers) {\n    for (var i = 0, j = handlers.length; i < j; i++) {\n      handlers[i].call(vm);\n    }\n  }\n  vm.$emit('hook:' + hook);\n}\n\n/*  */\n\nvar hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };\nvar hooksToMerge = Object.keys(hooks);\n\nfunction createComponent (\n  Ctor,\n  data,\n  context,\n  children,\n  tag\n) {\n  if (!Ctor) {\n    return\n  }\n\n  var baseCtor = context.$options._base;\n  if (isObject(Ctor)) {\n    Ctor = baseCtor.extend(Ctor);\n  }\n\n  if (typeof Ctor !== 'function') {\n    {\n      warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n    }\n    return\n  }\n\n  // async component\n  if (!Ctor.cid) {\n    if (Ctor.resolved) {\n      Ctor = Ctor.resolved;\n    } else {\n      Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {\n        // it's ok to queue this on every render because\n        // $forceUpdate is buffered by the scheduler.\n        context.$forceUpdate();\n      });\n      if (!Ctor) {\n        // return nothing if this is indeed an async component\n        // wait for the callback to trigger parent update.\n        return\n      }\n    }\n  }\n\n  // resolve constructor options in case global mixins are applied after\n  // component constructor creation\n  resolveConstructorOptions(Ctor);\n\n  data = data || {};\n\n  // extract props\n  var propsData = extractProps(data, Ctor);\n\n  // functional component\n  if (Ctor.options.functional) {\n    return createFunctionalComponent(Ctor, propsData, data, context, children)\n  }\n\n  // extract listeners, since these needs to be treated as\n  // child component listeners instead of DOM listeners\n  var listeners = data.on;\n  // replace with listeners with .native modifier\n  data.on = data.nativeOn;\n\n  if (Ctor.options.abstract) {\n    // abstract components do not keep anything\n    // other than props & listeners\n    data = {};\n  }\n\n  // merge component management hooks onto the placeholder node\n  mergeHooks(data);\n\n  // return a placeholder vnode\n  var name = Ctor.options.name || tag;\n  var vnode = new VNode(\n    (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n    data, undefined, undefined, undefined, undefined, context,\n    { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }\n  );\n  return vnode\n}\n\nfunction createFunctionalComponent (\n  Ctor,\n  propsData,\n  data,\n  context,\n  children\n) {\n  var props = {};\n  var propOptions = Ctor.options.props;\n  if (propOptions) {\n    for (var key in propOptions) {\n      props[key] = validateProp(key, propOptions, propsData);\n    }\n  }\n  var vnode = Ctor.options.render.call(\n    null,\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    bind$1(createElement, { _self: Object.create(context) }),\n    {\n      props: props,\n      data: data,\n      parent: context,\n      children: normalizeChildren(children),\n      slots: function () { return resolveSlots(children, context); }\n    }\n  );\n  if (vnode instanceof VNode) {\n    vnode.functionalContext = context;\n    if (data.slot) {\n      (vnode.data || (vnode.data = {})).slot = data.slot;\n    }\n  }\n  return vnode\n}\n\nfunction createComponentInstanceForVnode (\n  vnode, // we know it's MountedComponentVNode but flow doesn't\n  parent, // activeInstance in lifecycle state\n  parentElm,\n  refElm\n) {\n  var vnodeComponentOptions = vnode.componentOptions;\n  var options = {\n    _isComponent: true,\n    parent: parent,\n    propsData: vnodeComponentOptions.propsData,\n    _componentTag: vnodeComponentOptions.tag,\n    _parentVnode: vnode,\n    _parentListeners: vnodeComponentOptions.listeners,\n    _renderChildren: vnodeComponentOptions.children,\n    _parentElm: parentElm || null,\n    _refElm: refElm || null\n  };\n  // check inline-template render functions\n  var inlineTemplate = vnode.data.inlineTemplate;\n  if (inlineTemplate) {\n    options.render = inlineTemplate.render;\n    options.staticRenderFns = inlineTemplate.staticRenderFns;\n  }\n  return new vnodeComponentOptions.Ctor(options)\n}\n\nfunction init (\n  vnode,\n  hydrating,\n  parentElm,\n  refElm\n) {\n  if (!vnode.child || vnode.child._isDestroyed) {\n    var child = vnode.child = createComponentInstanceForVnode(\n      vnode,\n      activeInstance,\n      parentElm,\n      refElm\n    );\n    child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n  } else if (vnode.data.keepAlive) {\n    // kept-alive components, treat as a patch\n    var mountedNode = vnode; // work around flow\n    prepatch(mountedNode, mountedNode);\n  }\n}\n\nfunction prepatch (\n  oldVnode,\n  vnode\n) {\n  var options = vnode.componentOptions;\n  var child = vnode.child = oldVnode.child;\n  child._updateFromParent(\n    options.propsData, // updated props\n    options.listeners, // updated listeners\n    vnode, // new parent vnode\n    options.children // new children\n  );\n}\n\nfunction insert (vnode) {\n  if (!vnode.child._isMounted) {\n    vnode.child._isMounted = true;\n    callHook(vnode.child, 'mounted');\n  }\n  if (vnode.data.keepAlive) {\n    vnode.child._inactive = false;\n    callHook(vnode.child, 'activated');\n  }\n}\n\nfunction destroy$1 (vnode) {\n  if (!vnode.child._isDestroyed) {\n    if (!vnode.data.keepAlive) {\n      vnode.child.$destroy();\n    } else {\n      vnode.child._inactive = true;\n      callHook(vnode.child, 'deactivated');\n    }\n  }\n}\n\nfunction resolveAsyncComponent (\n  factory,\n  baseCtor,\n  cb\n) {\n  if (factory.requested) {\n    // pool callbacks\n    factory.pendingCallbacks.push(cb);\n  } else {\n    factory.requested = true;\n    var cbs = factory.pendingCallbacks = [cb];\n    var sync = true;\n\n    var resolve = function (res) {\n      if (isObject(res)) {\n        res = baseCtor.extend(res);\n      }\n      // cache resolved\n      factory.resolved = res;\n      // invoke callbacks only if this is not a synchronous resolve\n      // (async resolves are shimmed as synchronous during SSR)\n      if (!sync) {\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          cbs[i](res);\n        }\n      }\n    };\n\n    var reject = function (reason) {\n      \"development\" !== 'production' && warn(\n        \"Failed to resolve async component: \" + (String(factory)) +\n        (reason ? (\"\\nReason: \" + reason) : '')\n      );\n    };\n\n    var res = factory(resolve, reject);\n\n    // handle promise\n    if (res && typeof res.then === 'function' && !factory.resolved) {\n      res.then(resolve, reject);\n    }\n\n    sync = false;\n    // return in case resolved synchronously\n    return factory.resolved\n  }\n}\n\nfunction extractProps (data, Ctor) {\n  // we are only extracting raw values here.\n  // validation and default values are handled in the child\n  // component itself.\n  var propOptions = Ctor.options.props;\n  if (!propOptions) {\n    return\n  }\n  var res = {};\n  var attrs = data.attrs;\n  var props = data.props;\n  var domProps = data.domProps;\n  if (attrs || props || domProps) {\n    for (var key in propOptions) {\n      var altKey = hyphenate(key);\n      checkProp(res, props, key, altKey, true) ||\n      checkProp(res, attrs, key, altKey) ||\n      checkProp(res, domProps, key, altKey);\n    }\n  }\n  return res\n}\n\nfunction checkProp (\n  res,\n  hash,\n  key,\n  altKey,\n  preserve\n) {\n  if (hash) {\n    if (hasOwn(hash, key)) {\n      res[key] = hash[key];\n      if (!preserve) {\n        delete hash[key];\n      }\n      return true\n    } else if (hasOwn(hash, altKey)) {\n      res[key] = hash[altKey];\n      if (!preserve) {\n        delete hash[altKey];\n      }\n      return true\n    }\n  }\n  return false\n}\n\nfunction mergeHooks (data) {\n  if (!data.hook) {\n    data.hook = {};\n  }\n  for (var i = 0; i < hooksToMerge.length; i++) {\n    var key = hooksToMerge[i];\n    var fromParent = data.hook[key];\n    var ours = hooks[key];\n    data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;\n  }\n}\n\nfunction mergeHook$1 (one, two) {\n  return function (a, b, c, d) {\n    one(a, b, c, d);\n    two(a, b, c, d);\n  }\n}\n\n/*  */\n\n// wrapper function for providing a more flexible interface\n// without getting yelled at by flow\nfunction createElement (\n  tag,\n  data,\n  children\n) {\n  if (data && (Array.isArray(data) || typeof data !== 'object')) {\n    children = data;\n    data = undefined;\n  }\n  // make sure to use real instance instead of proxy as context\n  return _createElement(this._self, tag, data, children)\n}\n\nfunction _createElement (\n  context,\n  tag,\n  data,\n  children\n) {\n  if (data && data.__ob__) {\n    \"development\" !== 'production' && warn(\n      \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n      'Always create fresh vnode data objects in each render!',\n      context\n    );\n    return\n  }\n  if (!tag) {\n    // in case of component :is set to falsy value\n    return emptyVNode()\n  }\n  // support single function children as default scoped slot\n  if (Array.isArray(children) &&\n      typeof children[0] === 'function') {\n    data = data || {};\n    data.scopedSlots = { default: children[0] };\n    children.length = 0;\n  }\n  if (typeof tag === 'string') {\n    var Ctor;\n    var ns = config.getTagNamespace(tag);\n    if (config.isReservedTag(tag)) {\n      // platform built-in elements\n      return new VNode(\n        tag, data, normalizeChildren(children, ns),\n        undefined, undefined, ns, context\n      )\n    } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {\n      // component\n      return createComponent(Ctor, data, context, children, tag)\n    } else {\n      // unknown or unlisted namespaced elements\n      // check at runtime because it may get assigned a namespace when its\n      // parent normalizes children\n      var childNs = tag === 'foreignObject' ? 'xhtml' : ns;\n      return new VNode(\n        tag, data, normalizeChildren(children, childNs),\n        undefined, undefined, ns, context\n      )\n    }\n  } else {\n    // direct component options / constructor\n    return createComponent(tag, data, context, children)\n  }\n}\n\n/*  */\n\nfunction initRender (vm) {\n  vm.$vnode = null; // the placeholder node in parent tree\n  vm._vnode = null; // the root of the child tree\n  vm._staticTrees = null;\n  var parentVnode = vm.$options._parentVnode;\n  var renderContext = parentVnode && parentVnode.context;\n  vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);\n  vm.$scopedSlots = {};\n  // bind the public createElement fn to this instance\n  // so that we get proper render context inside it.\n  vm.$createElement = bind$1(createElement, vm);\n  if (vm.$options.el) {\n    vm.$mount(vm.$options.el);\n  }\n}\n\nfunction renderMixin (Vue) {\n  Vue.prototype.$nextTick = function (fn) {\n    return nextTick(fn, this)\n  };\n\n  Vue.prototype._render = function () {\n    var vm = this;\n    var ref = vm.$options;\n    var render = ref.render;\n    var staticRenderFns = ref.staticRenderFns;\n    var _parentVnode = ref._parentVnode;\n\n    if (vm._isMounted) {\n      // clone slot nodes on re-renders\n      for (var key in vm.$slots) {\n        vm.$slots[key] = cloneVNodes(vm.$slots[key]);\n      }\n    }\n\n    if (_parentVnode && _parentVnode.data.scopedSlots) {\n      vm.$scopedSlots = _parentVnode.data.scopedSlots;\n    }\n\n    if (staticRenderFns && !vm._staticTrees) {\n      vm._staticTrees = [];\n    }\n    // set parent vnode. this allows render functions to have access\n    // to the data on the placeholder node.\n    vm.$vnode = _parentVnode;\n    // render self\n    var vnode;\n    try {\n      vnode = render.call(vm._renderProxy, vm.$createElement);\n    } catch (e) {\n      /* istanbul ignore else */\n      if (config.errorHandler) {\n        config.errorHandler.call(null, e, vm);\n      } else {\n        {\n          warn((\"Error when rendering \" + (formatComponentName(vm)) + \":\"));\n        }\n        throw e\n      }\n      // return previous vnode to prevent render error causing blank component\n      vnode = vm._vnode;\n    }\n    // return empty vnode in case the render function errored out\n    if (!(vnode instanceof VNode)) {\n      if (\"development\" !== 'production' && Array.isArray(vnode)) {\n        warn(\n          'Multiple root nodes returned from render function. Render function ' +\n          'should return a single root node.',\n          vm\n        );\n      }\n      vnode = emptyVNode();\n    }\n    // set parent\n    vnode.parent = _parentVnode;\n    return vnode\n  };\n\n  // shorthands used in render functions\n  Vue.prototype._h = createElement;\n  // toString for mustaches\n  Vue.prototype._s = _toString;\n  // number conversion\n  Vue.prototype._n = toNumber;\n  // empty vnode\n  Vue.prototype._e = emptyVNode;\n  // loose equal\n  Vue.prototype._q = looseEqual;\n  // loose indexOf\n  Vue.prototype._i = looseIndexOf;\n\n  // render static tree by index\n  Vue.prototype._m = function renderStatic (\n    index,\n    isInFor\n  ) {\n    var tree = this._staticTrees[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree by doing a shallow clone.\n    if (tree && !isInFor) {\n      return Array.isArray(tree)\n        ? cloneVNodes(tree)\n        : cloneVNode(tree)\n    }\n    // otherwise, render a fresh tree.\n    tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  };\n\n  // mark node as static (v-once)\n  Vue.prototype._o = function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  };\n\n  function markStatic (tree, key, isOnce) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  // filter resolution helper\n  var identity = function (_) { return _; };\n  Vue.prototype._f = function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  };\n\n  // render v-for\n  Vue.prototype._l = function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val)) {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      keys = Object.keys(val);\n      ret = new Array(keys.length);\n      for (i = 0, l = keys.length; i < l; i++) {\n        key = keys[i];\n        ret[i] = render(val[key], key, i);\n      }\n    }\n    return ret\n  };\n\n  // renderSlot\n  Vue.prototype._t = function (\n    name,\n    fallback,\n    props\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    if (scopedSlotFn) { // scoped slot\n      return scopedSlotFn(props || {}) || fallback\n    } else {\n      var slotNodes = this.$slots[name];\n      // warn duplicate slot usage\n      if (slotNodes && \"development\" !== 'production') {\n        slotNodes._rendered && warn(\n          \"Duplicate presence of slot \\\"\" + name + \"\\\" found in the same render tree \" +\n          \"- this will likely cause render errors.\",\n          this\n        );\n        slotNodes._rendered = true;\n      }\n      return slotNodes || fallback\n    }\n  };\n\n  // apply v-bind object\n  Vue.prototype._b = function bindProps (\n    data,\n    tag,\n    value,\n    asProp\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        \"development\" !== 'production' && warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        for (var key in value) {\n          if (key === 'class' || key === 'style') {\n            data[key] = value[key];\n          } else {\n            var hash = asProp || config.mustUseProp(tag, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n            hash[key] = value[key];\n          }\n        }\n      }\n    }\n    return data\n  };\n\n  // check v-on keyCodes\n  Vue.prototype._k = function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInAlias\n  ) {\n    var keyCodes = config.keyCodes[key] || builtInAlias;\n    if (Array.isArray(keyCodes)) {\n      return keyCodes.indexOf(eventKeyCode) === -1\n    } else {\n      return keyCodes !== eventKeyCode\n    }\n  };\n}\n\nfunction resolveSlots (\n  renderChildren,\n  context\n) {\n  var slots = {};\n  if (!renderChildren) {\n    return slots\n  }\n  var children = normalizeChildren(renderChildren) || [];\n  var defaultSlot = [];\n  var name, child;\n  for (var i = 0, l = children.length; i < l; i++) {\n    child = children[i];\n    // named slots should only be respected if the vnode was rendered in the\n    // same context.\n    if ((child.context === context || child.functionalContext === context) &&\n        child.data && (name = child.data.slot)) {\n      var slot = (slots[name] || (slots[name] = []));\n      if (child.tag === 'template') {\n        slot.push.apply(slot, child.children);\n      } else {\n        slot.push(child);\n      }\n    } else {\n      defaultSlot.push(child);\n    }\n  }\n  // ignore single whitespace\n  if (defaultSlot.length && !(\n    defaultSlot.length === 1 &&\n    (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)\n  )) {\n    slots.default = defaultSlot;\n  }\n  return slots\n}\n\n/*  */\n\nfunction initEvents (vm) {\n  vm._events = Object.create(null);\n  // init parent attached events\n  var listeners = vm.$options._parentListeners;\n  var add = function (event, fn, once) {\n    once ? vm.$once(event, fn) : vm.$on(event, fn);\n  };\n  var remove$$1 = bind$1(vm.$off, vm);\n  vm._updateListeners = function (listeners, oldListeners) {\n    updateListeners(listeners, oldListeners || {}, add, remove$$1, vm);\n  };\n  if (listeners) {\n    vm._updateListeners(listeners);\n  }\n}\n\nfunction eventsMixin (Vue) {\n  Vue.prototype.$on = function (event, fn) {\n    var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);\n    return vm\n  };\n\n  Vue.prototype.$once = function (event, fn) {\n    var vm = this;\n    function on () {\n      vm.$off(event, on);\n      fn.apply(vm, arguments);\n    }\n    on.fn = fn;\n    vm.$on(event, on);\n    return vm\n  };\n\n  Vue.prototype.$off = function (event, fn) {\n    var vm = this;\n    // all\n    if (!arguments.length) {\n      vm._events = Object.create(null);\n      return vm\n    }\n    // specific event\n    var cbs = vm._events[event];\n    if (!cbs) {\n      return vm\n    }\n    if (arguments.length === 1) {\n      vm._events[event] = null;\n      return vm\n    }\n    // specific handler\n    var cb;\n    var i = cbs.length;\n    while (i--) {\n      cb = cbs[i];\n      if (cb === fn || cb.fn === fn) {\n        cbs.splice(i, 1);\n        break\n      }\n    }\n    return vm\n  };\n\n  Vue.prototype.$emit = function (event) {\n    var vm = this;\n    var cbs = vm._events[event];\n    if (cbs) {\n      cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n      var args = toArray(arguments, 1);\n      for (var i = 0, l = cbs.length; i < l; i++) {\n        cbs[i].apply(vm, args);\n      }\n    }\n    return vm\n  };\n}\n\n/*  */\n\nvar uid = 0;\n\nfunction initMixin (Vue) {\n  Vue.prototype._init = function (options) {\n    var vm = this;\n    // a uid\n    vm._uid = uid++;\n    // a flag to avoid this being observed\n    vm._isVue = true;\n    // merge options\n    if (options && options._isComponent) {\n      // optimize internal component instantiation\n      // since dynamic options merging is pretty slow, and none of the\n      // internal component options needs special treatment.\n      initInternalComponent(vm, options);\n    } else {\n      vm.$options = mergeOptions(\n        resolveConstructorOptions(vm.constructor),\n        options || {},\n        vm\n      );\n    }\n    /* istanbul ignore else */\n    {\n      initProxy(vm);\n    }\n    // expose real self\n    vm._self = vm;\n    initLifecycle(vm);\n    initEvents(vm);\n    callHook(vm, 'beforeCreate');\n    initState(vm);\n    callHook(vm, 'created');\n    initRender(vm);\n  };\n}\n\nfunction initInternalComponent (vm, options) {\n  var opts = vm.$options = Object.create(vm.constructor.options);\n  // doing this because it's faster than dynamic enumeration.\n  opts.parent = options.parent;\n  opts.propsData = options.propsData;\n  opts._parentVnode = options._parentVnode;\n  opts._parentListeners = options._parentListeners;\n  opts._renderChildren = options._renderChildren;\n  opts._componentTag = options._componentTag;\n  opts._parentElm = options._parentElm;\n  opts._refElm = options._refElm;\n  if (options.render) {\n    opts.render = options.render;\n    opts.staticRenderFns = options.staticRenderFns;\n  }\n}\n\nfunction resolveConstructorOptions (Ctor) {\n  var options = Ctor.options;\n  if (Ctor.super) {\n    var superOptions = Ctor.super.options;\n    var cachedSuperOptions = Ctor.superOptions;\n    var extendOptions = Ctor.extendOptions;\n    if (superOptions !== cachedSuperOptions) {\n      // super option changed\n      Ctor.superOptions = superOptions;\n      extendOptions.render = options.render;\n      extendOptions.staticRenderFns = options.staticRenderFns;\n      extendOptions._scopeId = options._scopeId;\n      options = Ctor.options = mergeOptions(superOptions, extendOptions);\n      if (options.name) {\n        options.components[options.name] = Ctor;\n      }\n    }\n  }\n  return options\n}\n\nfunction Vue$3 (options) {\n  if (\"development\" !== 'production' &&\n    !(this instanceof Vue$3)) {\n    warn('Vue is a constructor and should be called with the `new` keyword');\n  }\n  this._init(options);\n}\n\ninitMixin(Vue$3);\nstateMixin(Vue$3);\neventsMixin(Vue$3);\nlifecycleMixin(Vue$3);\nrenderMixin(Vue$3);\n\n/*  */\n\nfunction initUse (Vue) {\n  Vue.use = function (plugin) {\n    /* istanbul ignore if */\n    if (plugin.installed) {\n      return\n    }\n    // additional parameters\n    var args = toArray(arguments, 1);\n    args.unshift(this);\n    if (typeof plugin.install === 'function') {\n      plugin.install.apply(plugin, args);\n    } else {\n      plugin.apply(null, args);\n    }\n    plugin.installed = true;\n    return this\n  };\n}\n\n/*  */\n\nfunction initMixin$1 (Vue) {\n  Vue.mixin = function (mixin) {\n    this.options = mergeOptions(this.options, mixin);\n  };\n}\n\n/*  */\n\nfunction initExtend (Vue) {\n  /**\n   * Each instance constructor, including Vue, has a unique\n   * cid. This enables us to create wrapped \"child\n   * constructors\" for prototypal inheritance and cache them.\n   */\n  Vue.cid = 0;\n  var cid = 1;\n\n  /**\n   * Class inheritance\n   */\n  Vue.extend = function (extendOptions) {\n    extendOptions = extendOptions || {};\n    var Super = this;\n    var SuperId = Super.cid;\n    var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n    if (cachedCtors[SuperId]) {\n      return cachedCtors[SuperId]\n    }\n    var name = extendOptions.name || Super.options.name;\n    {\n      if (!/^[a-zA-Z][\\w-]*$/.test(name)) {\n        warn(\n          'Invalid component name: \"' + name + '\". Component names ' +\n          'can only contain alphanumeric characaters and the hyphen.'\n        );\n      }\n    }\n    var Sub = function VueComponent (options) {\n      this._init(options);\n    };\n    Sub.prototype = Object.create(Super.prototype);\n    Sub.prototype.constructor = Sub;\n    Sub.cid = cid++;\n    Sub.options = mergeOptions(\n      Super.options,\n      extendOptions\n    );\n    Sub['super'] = Super;\n    // allow further extension/mixin/plugin usage\n    Sub.extend = Super.extend;\n    Sub.mixin = Super.mixin;\n    Sub.use = Super.use;\n    // create asset registers, so extended classes\n    // can have their private assets too.\n    config._assetTypes.forEach(function (type) {\n      Sub[type] = Super[type];\n    });\n    // enable recursive self-lookup\n    if (name) {\n      Sub.options.components[name] = Sub;\n    }\n    // keep a reference to the super options at extension time.\n    // later at instantiation we can check if Super's options have\n    // been updated.\n    Sub.superOptions = Super.options;\n    Sub.extendOptions = extendOptions;\n    // cache constructor\n    cachedCtors[SuperId] = Sub;\n    return Sub\n  };\n}\n\n/*  */\n\nfunction initAssetRegisters (Vue) {\n  /**\n   * Create asset registration methods.\n   */\n  config._assetTypes.forEach(function (type) {\n    Vue[type] = function (\n      id,\n      definition\n    ) {\n      if (!definition) {\n        return this.options[type + 's'][id]\n      } else {\n        /* istanbul ignore if */\n        {\n          if (type === 'component' && config.isReservedTag(id)) {\n            warn(\n              'Do not use built-in or reserved HTML elements as component ' +\n              'id: ' + id\n            );\n          }\n        }\n        if (type === 'component' && isPlainObject(definition)) {\n          definition.name = definition.name || id;\n          definition = this.options._base.extend(definition);\n        }\n        if (type === 'directive' && typeof definition === 'function') {\n          definition = { bind: definition, update: definition };\n        }\n        this.options[type + 's'][id] = definition;\n        return definition\n      }\n    };\n  });\n}\n\n/*  */\n\nvar patternTypes = [String, RegExp];\n\nfunction matches (pattern, name) {\n  if (typeof pattern === 'string') {\n    return pattern.split(',').indexOf(name) > -1\n  } else {\n    return pattern.test(name)\n  }\n}\n\nvar KeepAlive = {\n  name: 'keep-alive',\n  abstract: true,\n  props: {\n    include: patternTypes,\n    exclude: patternTypes\n  },\n  created: function created () {\n    this.cache = Object.create(null);\n  },\n  render: function render () {\n    var vnode = getFirstComponentChild(this.$slots.default);\n    if (vnode && vnode.componentOptions) {\n      var opts = vnode.componentOptions;\n      // check pattern\n      var name = opts.Ctor.options.name || opts.tag;\n      if (name && (\n        (this.include && !matches(this.include, name)) ||\n        (this.exclude && matches(this.exclude, name))\n      )) {\n        return vnode\n      }\n      var key = vnode.key == null\n        // same constructor may get registered as different local components\n        // so cid alone is not enough (#3269)\n        ? opts.Ctor.cid + (opts.tag ? (\"::\" + (opts.tag)) : '')\n        : vnode.key;\n      if (this.cache[key]) {\n        vnode.child = this.cache[key].child;\n      } else {\n        this.cache[key] = vnode;\n      }\n      vnode.data.keepAlive = true;\n    }\n    return vnode\n  },\n  destroyed: function destroyed () {\n    var this$1 = this;\n\n    for (var key in this.cache) {\n      var vnode = this$1.cache[key];\n      callHook(vnode.child, 'deactivated');\n      vnode.child.$destroy();\n    }\n  }\n};\n\nvar builtInComponents = {\n  KeepAlive: KeepAlive\n};\n\n/*  */\n\nfunction initGlobalAPI (Vue) {\n  // config\n  var configDef = {};\n  configDef.get = function () { return config; };\n  {\n    configDef.set = function () {\n      warn(\n        'Do not replace the Vue.config object, set individual fields instead.'\n      );\n    };\n  }\n  Object.defineProperty(Vue, 'config', configDef);\n  Vue.util = util;\n  Vue.set = set$1;\n  Vue.delete = del;\n  Vue.nextTick = nextTick;\n\n  Vue.options = Object.create(null);\n  config._assetTypes.forEach(function (type) {\n    Vue.options[type + 's'] = Object.create(null);\n  });\n\n  // this is used to identify the \"base\" constructor to extend all plain-object\n  // components with in Weex's multi-instance scenarios.\n  Vue.options._base = Vue;\n\n  extend(Vue.options.components, builtInComponents);\n\n  initUse(Vue);\n  initMixin$1(Vue);\n  initExtend(Vue);\n  initAssetRegisters(Vue);\n}\n\ninitGlobalAPI(Vue$3);\n\nObject.defineProperty(Vue$3.prototype, '$isServer', {\n  get: isServerRendering\n});\n\nVue$3.version = '2.1.4';\n\n/*  */\n\n// attributes that should be using props for binding\nvar mustUseProp = function (tag, attr) {\n  return (\n    (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||\n    (attr === 'selected' && tag === 'option') ||\n    (attr === 'checked' && tag === 'input') ||\n    (attr === 'muted' && tag === 'video')\n  )\n};\n\nvar isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\nvar isBooleanAttr = makeMap(\n  'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n  'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n  'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n  'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n  'required,reversed,scoped,seamless,selected,sortable,translate,' +\n  'truespeed,typemustmatch,visible'\n);\n\nvar xlinkNS = 'http://www.w3.org/1999/xlink';\n\nvar isXlink = function (name) {\n  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n};\n\nvar getXlinkProp = function (name) {\n  return isXlink(name) ? name.slice(6, name.length) : ''\n};\n\nvar isFalsyAttrValue = function (val) {\n  return val == null || val === false\n};\n\n/*  */\n\nfunction genClassForVnode (vnode) {\n  var data = vnode.data;\n  var parentNode = vnode;\n  var childNode = vnode;\n  while (childNode.child) {\n    childNode = childNode.child._vnode;\n    if (childNode.data) {\n      data = mergeClassData(childNode.data, data);\n    }\n  }\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data) {\n      data = mergeClassData(data, parentNode.data);\n    }\n  }\n  return genClassFromData(data)\n}\n\nfunction mergeClassData (child, parent) {\n  return {\n    staticClass: concat(child.staticClass, parent.staticClass),\n    class: child.class\n      ? [child.class, parent.class]\n      : parent.class\n  }\n}\n\nfunction genClassFromData (data) {\n  var dynamicClass = data.class;\n  var staticClass = data.staticClass;\n  if (staticClass || dynamicClass) {\n    return concat(staticClass, stringifyClass(dynamicClass))\n  }\n  /* istanbul ignore next */\n  return ''\n}\n\nfunction concat (a, b) {\n  return a ? b ? (a + ' ' + b) : a : (b || '')\n}\n\nfunction stringifyClass (value) {\n  var res = '';\n  if (!value) {\n    return res\n  }\n  if (typeof value === 'string') {\n    return value\n  }\n  if (Array.isArray(value)) {\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (value[i]) {\n        if ((stringified = stringifyClass(value[i]))) {\n          res += stringified + ' ';\n        }\n      }\n    }\n    return res.slice(0, -1)\n  }\n  if (isObject(value)) {\n    for (var key in value) {\n      if (value[key]) { res += key + ' '; }\n    }\n    return res.slice(0, -1)\n  }\n  /* istanbul ignore next */\n  return res\n}\n\n/*  */\n\nvar namespaceMap = {\n  svg: 'http://www.w3.org/2000/svg',\n  math: 'http://www.w3.org/1998/Math/MathML',\n  xhtml: 'http://www.w3.org/1999/xhtml'\n};\n\nvar isHTMLTag = makeMap(\n  'html,body,base,head,link,meta,style,title,' +\n  'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n  'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +\n  'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n  's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n  'embed,object,param,source,canvas,script,noscript,del,ins,' +\n  'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n  'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n  'output,progress,select,textarea,' +\n  'details,dialog,menu,menuitem,summary,' +\n  'content,element,shadow,template'\n);\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nvar isSVG = makeMap(\n  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +\n  'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n  'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n  true\n);\n\nvar isPreTag = function (tag) { return tag === 'pre'; };\n\nvar isReservedTag = function (tag) {\n  return isHTMLTag(tag) || isSVG(tag)\n};\n\nfunction getTagNamespace (tag) {\n  if (isSVG(tag)) {\n    return 'svg'\n  }\n  // basic support for MathML\n  // note it doesn't support other MathML elements being component roots\n  if (tag === 'math') {\n    return 'math'\n  }\n}\n\nvar unknownElementCache = Object.create(null);\nfunction isUnknownElement (tag) {\n  /* istanbul ignore if */\n  if (!inBrowser) {\n    return true\n  }\n  if (isReservedTag(tag)) {\n    return false\n  }\n  tag = tag.toLowerCase();\n  /* istanbul ignore if */\n  if (unknownElementCache[tag] != null) {\n    return unknownElementCache[tag]\n  }\n  var el = document.createElement(tag);\n  if (tag.indexOf('-') > -1) {\n    // http://stackoverflow.com/a/28210364/1070244\n    return (unknownElementCache[tag] = (\n      el.constructor === window.HTMLUnknownElement ||\n      el.constructor === window.HTMLElement\n    ))\n  } else {\n    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n  }\n}\n\n/*  */\n\n/**\n * Query an element selector if it's not an element already.\n */\nfunction query (el) {\n  if (typeof el === 'string') {\n    var selector = el;\n    el = document.querySelector(el);\n    if (!el) {\n      \"development\" !== 'production' && warn(\n        'Cannot find element: ' + selector\n      );\n      return document.createElement('div')\n    }\n  }\n  return el\n}\n\n/*  */\n\nfunction createElement$1 (tagName, vnode) {\n  var elm = document.createElement(tagName);\n  if (tagName !== 'select') {\n    return elm\n  }\n  if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {\n    elm.setAttribute('multiple', 'multiple');\n  }\n  return elm\n}\n\nfunction createElementNS (namespace, tagName) {\n  return document.createElementNS(namespaceMap[namespace], tagName)\n}\n\nfunction createTextNode (text) {\n  return document.createTextNode(text)\n}\n\nfunction createComment (text) {\n  return document.createComment(text)\n}\n\nfunction insertBefore (parentNode, newNode, referenceNode) {\n  parentNode.insertBefore(newNode, referenceNode);\n}\n\nfunction removeChild (node, child) {\n  node.removeChild(child);\n}\n\nfunction appendChild (node, child) {\n  node.appendChild(child);\n}\n\nfunction parentNode (node) {\n  return node.parentNode\n}\n\nfunction nextSibling (node) {\n  return node.nextSibling\n}\n\nfunction tagName (node) {\n  return node.tagName\n}\n\nfunction setTextContent (node, text) {\n  node.textContent = text;\n}\n\nfunction childNodes (node) {\n  return node.childNodes\n}\n\nfunction setAttribute (node, key, val) {\n  node.setAttribute(key, val);\n}\n\n\nvar nodeOps = Object.freeze({\n  createElement: createElement$1,\n  createElementNS: createElementNS,\n  createTextNode: createTextNode,\n  createComment: createComment,\n  insertBefore: insertBefore,\n  removeChild: removeChild,\n  appendChild: appendChild,\n  parentNode: parentNode,\n  nextSibling: nextSibling,\n  tagName: tagName,\n  setTextContent: setTextContent,\n  childNodes: childNodes,\n  setAttribute: setAttribute\n});\n\n/*  */\n\nvar ref = {\n  create: function create (_, vnode) {\n    registerRef(vnode);\n  },\n  update: function update (oldVnode, vnode) {\n    if (oldVnode.data.ref !== vnode.data.ref) {\n      registerRef(oldVnode, true);\n      registerRef(vnode);\n    }\n  },\n  destroy: function destroy (vnode) {\n    registerRef(vnode, true);\n  }\n};\n\nfunction registerRef (vnode, isRemoval) {\n  var key = vnode.data.ref;\n  if (!key) { return }\n\n  var vm = vnode.context;\n  var ref = vnode.child || vnode.elm;\n  var refs = vm.$refs;\n  if (isRemoval) {\n    if (Array.isArray(refs[key])) {\n      remove$1(refs[key], ref);\n    } else if (refs[key] === ref) {\n      refs[key] = undefined;\n    }\n  } else {\n    if (vnode.data.refInFor) {\n      if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {\n        refs[key].push(ref);\n      } else {\n        refs[key] = [ref];\n      }\n    } else {\n      refs[key] = ref;\n    }\n  }\n}\n\n/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n *\n * modified by Evan You (@yyx990803)\n *\n\n/*\n * Not type-checking this because this file is perf-critical and the cost\n * of making flow understand it is not worth it.\n */\n\nvar emptyNode = new VNode('', {}, []);\n\nvar hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];\n\nfunction isUndef (s) {\n  return s == null\n}\n\nfunction isDef (s) {\n  return s != null\n}\n\nfunction sameVnode (vnode1, vnode2) {\n  return (\n    vnode1.key === vnode2.key &&\n    vnode1.tag === vnode2.tag &&\n    vnode1.isComment === vnode2.isComment &&\n    !vnode1.data === !vnode2.data\n  )\n}\n\nfunction createKeyToOldIdx (children, beginIdx, endIdx) {\n  var i, key;\n  var map = {};\n  for (i = beginIdx; i <= endIdx; ++i) {\n    key = children[i].key;\n    if (isDef(key)) { map[key] = i; }\n  }\n  return map\n}\n\nfunction createPatchFunction (backend) {\n  var i, j;\n  var cbs = {};\n\n  var modules = backend.modules;\n  var nodeOps = backend.nodeOps;\n\n  for (i = 0; i < hooks$1.length; ++i) {\n    cbs[hooks$1[i]] = [];\n    for (j = 0; j < modules.length; ++j) {\n      if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }\n    }\n  }\n\n  function emptyNodeAt (elm) {\n    return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n  }\n\n  function createRmCb (childElm, listeners) {\n    function remove$$1 () {\n      if (--remove$$1.listeners === 0) {\n        removeElement(childElm);\n      }\n    }\n    remove$$1.listeners = listeners;\n    return remove$$1\n  }\n\n  function removeElement (el) {\n    var parent = nodeOps.parentNode(el);\n    // element may have already been removed due to v-html\n    if (parent) {\n      nodeOps.removeChild(parent, el);\n    }\n  }\n\n  var inPre = 0;\n  function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {\n    vnode.isRootInsert = !nested; // for transition enter check\n    if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n      return\n    }\n\n    var data = vnode.data;\n    var children = vnode.children;\n    var tag = vnode.tag;\n    if (isDef(tag)) {\n      {\n        if (data && data.pre) {\n          inPre++;\n        }\n        if (\n          !inPre &&\n          !vnode.ns &&\n          !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&\n          config.isUnknownElement(tag)\n        ) {\n          warn(\n            'Unknown custom element: <' + tag + '> - did you ' +\n            'register the component correctly? For recursive components, ' +\n            'make sure to provide the \"name\" option.',\n            vnode.context\n          );\n        }\n      }\n      vnode.elm = vnode.ns\n        ? nodeOps.createElementNS(vnode.ns, tag)\n        : nodeOps.createElement(tag, vnode);\n      setScope(vnode);\n\n      /* istanbul ignore if */\n      {\n        createChildren(vnode, children, insertedVnodeQueue);\n        if (isDef(data)) {\n          invokeCreateHooks(vnode, insertedVnodeQueue);\n        }\n        insert(parentElm, vnode.elm, refElm);\n      }\n\n      if (\"development\" !== 'production' && data && data.pre) {\n        inPre--;\n      }\n    } else if (vnode.isComment) {\n      vnode.elm = nodeOps.createComment(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    } else {\n      vnode.elm = nodeOps.createTextNode(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    }\n  }\n\n  function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i = vnode.data;\n    if (isDef(i)) {\n      var isReactivated = isDef(vnode.child) && i.keepAlive;\n      if (isDef(i = i.hook) && isDef(i = i.init)) {\n        i(vnode, false /* hydrating */, parentElm, refElm);\n      }\n      // after calling the init hook, if the vnode is a child component\n      // it should've created a child instance and mounted it. the child\n      // component also has set the placeholder vnode's elm.\n      // in that case we can just return the element and be done.\n      if (isDef(vnode.child)) {\n        initComponent(vnode, insertedVnodeQueue);\n        if (isReactivated) {\n          reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n        }\n        return true\n      }\n    }\n  }\n\n  function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i;\n    // hack for #4339: a reactivated component with inner transition\n    // does not trigger because the inner node's created hooks are not called\n    // again. It's not ideal to involve module-specific logic in here but\n    // there doesn't seem to be a better way to do it.\n    var innerNode = vnode;\n    while (innerNode.child) {\n      innerNode = innerNode.child._vnode;\n      if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n        for (i = 0; i < cbs.activate.length; ++i) {\n          cbs.activate[i](emptyNode, innerNode);\n        }\n        insertedVnodeQueue.push(innerNode);\n        break\n      }\n    }\n    // unlike a newly created component,\n    // a reactivated keep-alive component doesn't insert itself\n    insert(parentElm, vnode.elm, refElm);\n  }\n\n  function insert (parent, elm, ref) {\n    if (parent) {\n      nodeOps.insertBefore(parent, elm, ref);\n    }\n  }\n\n  function createChildren (vnode, children, insertedVnodeQueue) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; ++i) {\n        createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);\n      }\n    } else if (isPrimitive(vnode.text)) {\n      nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));\n    }\n  }\n\n  function isPatchable (vnode) {\n    while (vnode.child) {\n      vnode = vnode.child._vnode;\n    }\n    return isDef(vnode.tag)\n  }\n\n  function invokeCreateHooks (vnode, insertedVnodeQueue) {\n    for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n      cbs.create[i$1](emptyNode, vnode);\n    }\n    i = vnode.data.hook; // Reuse variable\n    if (isDef(i)) {\n      if (i.create) { i.create(emptyNode, vnode); }\n      if (i.insert) { insertedVnodeQueue.push(vnode); }\n    }\n  }\n\n  function initComponent (vnode, insertedVnodeQueue) {\n    if (vnode.data.pendingInsert) {\n      insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n    }\n    vnode.elm = vnode.child.$el;\n    if (isPatchable(vnode)) {\n      invokeCreateHooks(vnode, insertedVnodeQueue);\n      setScope(vnode);\n    } else {\n      // empty component root.\n      // skip all element-related modules except for ref (#3455)\n      registerRef(vnode);\n      // make sure to invoke the insert hook\n      insertedVnodeQueue.push(vnode);\n    }\n  }\n\n  // set scope id attribute for scoped CSS.\n  // this is implemented as a special case to avoid the overhead\n  // of going through the normal attribute patching process.\n  function setScope (vnode) {\n    var i;\n    if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n    if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n  }\n\n  function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);\n    }\n  }\n\n  function invokeDestroyHook (vnode) {\n    var i, j;\n    var data = vnode.data;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n      for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n    }\n    if (isDef(i = vnode.children)) {\n      for (j = 0; j < vnode.children.length; ++j) {\n        invokeDestroyHook(vnode.children[j]);\n      }\n    }\n  }\n\n  function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      var ch = vnodes[startIdx];\n      if (isDef(ch)) {\n        if (isDef(ch.tag)) {\n          removeAndInvokeRemoveHook(ch);\n          invokeDestroyHook(ch);\n        } else { // Text node\n          nodeOps.removeChild(parentElm, ch.elm);\n        }\n      }\n    }\n  }\n\n  function removeAndInvokeRemoveHook (vnode, rm) {\n    if (rm || isDef(vnode.data)) {\n      var listeners = cbs.remove.length + 1;\n      if (!rm) {\n        // directly removing\n        rm = createRmCb(vnode.elm, listeners);\n      } else {\n        // we have a recursively passed down rm callback\n        // increase the listeners count\n        rm.listeners += listeners;\n      }\n      // recursively invoke hooks on child component root node\n      if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {\n        removeAndInvokeRemoveHook(i, rm);\n      }\n      for (i = 0; i < cbs.remove.length; ++i) {\n        cbs.remove[i](vnode, rm);\n      }\n      if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n        i(vnode, rm);\n      } else {\n        rm();\n      }\n    } else {\n      removeElement(vnode.elm);\n    }\n  }\n\n  function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n    var oldStartIdx = 0;\n    var newStartIdx = 0;\n    var oldEndIdx = oldCh.length - 1;\n    var oldStartVnode = oldCh[0];\n    var oldEndVnode = oldCh[oldEndIdx];\n    var newEndIdx = newCh.length - 1;\n    var newStartVnode = newCh[0];\n    var newEndVnode = newCh[newEndIdx];\n    var oldKeyToIdx, idxInOld, elmToMove, refElm;\n\n    // removeOnly is a special flag used only by <transition-group>\n    // to ensure removed elements stay in correct relative positions\n    // during leaving transitions\n    var canMove = !removeOnly;\n\n    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n      if (isUndef(oldStartVnode)) {\n        oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n      } else if (isUndef(oldEndVnode)) {\n        oldEndVnode = oldCh[--oldEndIdx];\n      } else if (sameVnode(oldStartVnode, newStartVnode)) {\n        patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);\n        oldStartVnode = oldCh[++oldStartIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else if (sameVnode(oldEndVnode, newEndVnode)) {\n        patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n        patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n        oldStartVnode = oldCh[++oldStartIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n        patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else {\n        if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n        idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;\n        if (isUndef(idxInOld)) { // New element\n          createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          elmToMove = oldCh[idxInOld];\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !elmToMove) {\n            warn(\n              'It seems there are duplicate keys that is causing an update error. ' +\n              'Make sure each v-for item has a unique key.'\n            );\n          }\n          if (elmToMove.tag !== newStartVnode.tag) {\n            // same key but different element. treat as new element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          } else {\n            patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);\n            oldCh[idxInOld] = undefined;\n            canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          }\n        }\n      }\n    }\n    if (oldStartIdx > oldEndIdx) {\n      refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n      addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n    } else if (newStartIdx > newEndIdx) {\n      removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n    }\n  }\n\n  function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {\n    if (oldVnode === vnode) {\n      return\n    }\n    // reuse element for static trees.\n    // note we only do this if the vnode is cloned -\n    // if the new node is not cloned it means the render functions have been\n    // reset by the hot-reload-api and we need to do a proper re-render.\n    if (vnode.isStatic &&\n        oldVnode.isStatic &&\n        vnode.key === oldVnode.key &&\n        (vnode.isCloned || vnode.isOnce)) {\n      vnode.elm = oldVnode.elm;\n      vnode.child = oldVnode.child;\n      return\n    }\n    var i;\n    var data = vnode.data;\n    var hasData = isDef(data);\n    if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n      i(oldVnode, vnode);\n    }\n    var elm = vnode.elm = oldVnode.elm;\n    var oldCh = oldVnode.children;\n    var ch = vnode.children;\n    if (hasData && isPatchable(vnode)) {\n      for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n      if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n    }\n    if (isUndef(vnode.text)) {\n      if (isDef(oldCh) && isDef(ch)) {\n        if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n      } else if (isDef(ch)) {\n        if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n        addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n      } else if (isDef(oldCh)) {\n        removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n      } else if (isDef(oldVnode.text)) {\n        nodeOps.setTextContent(elm, '');\n      }\n    } else if (oldVnode.text !== vnode.text) {\n      nodeOps.setTextContent(elm, vnode.text);\n    }\n    if (hasData) {\n      if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n    }\n  }\n\n  function invokeInsertHook (vnode, queue, initial) {\n    // delay insert hooks for component root nodes, invoke them after the\n    // element is really inserted\n    if (initial && vnode.parent) {\n      vnode.parent.data.pendingInsert = queue;\n    } else {\n      for (var i = 0; i < queue.length; ++i) {\n        queue[i].data.hook.insert(queue[i]);\n      }\n    }\n  }\n\n  var bailed = false;\n  function hydrate (elm, vnode, insertedVnodeQueue) {\n    {\n      if (!assertNodeMatch(elm, vnode)) {\n        return false\n      }\n    }\n    vnode.elm = elm;\n    var tag = vnode.tag;\n    var data = vnode.data;\n    var children = vnode.children;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n      if (isDef(i = vnode.child)) {\n        // child component. it should have hydrated its own tree.\n        initComponent(vnode, insertedVnodeQueue);\n        return true\n      }\n    }\n    if (isDef(tag)) {\n      if (isDef(children)) {\n        var childNodes = nodeOps.childNodes(elm);\n        // empty element, allow client to pick up and populate children\n        if (!childNodes.length) {\n          createChildren(vnode, children, insertedVnodeQueue);\n        } else {\n          var childrenMatch = true;\n          if (childNodes.length !== children.length) {\n            childrenMatch = false;\n          } else {\n            for (var i$1 = 0; i$1 < children.length; i$1++) {\n              if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {\n                childrenMatch = false;\n                break\n              }\n            }\n          }\n          if (!childrenMatch) {\n            if (\"development\" !== 'production' &&\n                typeof console !== 'undefined' &&\n                !bailed) {\n              bailed = true;\n              console.warn('Parent: ', elm);\n              console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);\n            }\n            return false\n          }\n        }\n      }\n      if (isDef(data)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n      }\n    }\n    return true\n  }\n\n  function assertNodeMatch (node, vnode) {\n    if (vnode.tag) {\n      return (\n        vnode.tag.indexOf('vue-component') === 0 ||\n        vnode.tag.toLowerCase() === nodeOps.tagName(node).toLowerCase()\n      )\n    } else {\n      return _toString(vnode.text) === node.data\n    }\n  }\n\n  return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {\n    if (!vnode) {\n      if (oldVnode) { invokeDestroyHook(oldVnode); }\n      return\n    }\n\n    var elm, parent;\n    var isInitialPatch = false;\n    var insertedVnodeQueue = [];\n\n    if (!oldVnode) {\n      // empty mount (likely as component), create new root element\n      isInitialPatch = true;\n      createElm(vnode, insertedVnodeQueue, parentElm, refElm);\n    } else {\n      var isRealElement = isDef(oldVnode.nodeType);\n      if (!isRealElement && sameVnode(oldVnode, vnode)) {\n        // patch existing root node\n        patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);\n      } else {\n        if (isRealElement) {\n          // mounting to a real element\n          // check if this is server-rendered content and if we can perform\n          // a successful hydration.\n          if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {\n            oldVnode.removeAttribute('server-rendered');\n            hydrating = true;\n          }\n          if (hydrating) {\n            if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n              invokeInsertHook(vnode, insertedVnodeQueue, true);\n              return oldVnode\n            } else {\n              warn(\n                'The client-side rendered virtual DOM tree is not matching ' +\n                'server-rendered content. This is likely caused by incorrect ' +\n                'HTML markup, for example nesting block-level elements inside ' +\n                '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                'full client-side render.'\n              );\n            }\n          }\n          // either not server-rendered, or hydration failed.\n          // create an empty node and replace it\n          oldVnode = emptyNodeAt(oldVnode);\n        }\n\n        // replacing existing element\n        elm = oldVnode.elm;\n        parent = nodeOps.parentNode(elm);\n        createElm(vnode, insertedVnodeQueue, parent, nodeOps.nextSibling(elm));\n\n        if (vnode.parent) {\n          // component root element replaced.\n          // update parent placeholder node element, recursively\n          var ancestor = vnode.parent;\n          while (ancestor) {\n            ancestor.elm = vnode.elm;\n            ancestor = ancestor.parent;\n          }\n          if (isPatchable(vnode)) {\n            for (var i = 0; i < cbs.create.length; ++i) {\n              cbs.create[i](emptyNode, vnode.parent);\n            }\n          }\n        }\n\n        if (parent !== null) {\n          removeVnodes(parent, [oldVnode], 0, 0);\n        } else if (isDef(oldVnode.tag)) {\n          invokeDestroyHook(oldVnode);\n        }\n      }\n    }\n\n    invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n    return vnode.elm\n  }\n}\n\n/*  */\n\nvar directives = {\n  create: updateDirectives,\n  update: updateDirectives,\n  destroy: function unbindDirectives (vnode) {\n    updateDirectives(vnode, emptyNode);\n  }\n};\n\nfunction updateDirectives (\n  oldVnode,\n  vnode\n) {\n  if (!oldVnode.data.directives && !vnode.data.directives) {\n    return\n  }\n  var isCreate = oldVnode === emptyNode;\n  var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n  var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n  var dirsWithInsert = [];\n  var dirsWithPostpatch = [];\n\n  var key, oldDir, dir;\n  for (key in newDirs) {\n    oldDir = oldDirs[key];\n    dir = newDirs[key];\n    if (!oldDir) {\n      // new directive, bind\n      callHook$1(dir, 'bind', vnode, oldVnode);\n      if (dir.def && dir.def.inserted) {\n        dirsWithInsert.push(dir);\n      }\n    } else {\n      // existing directive, update\n      dir.oldValue = oldDir.value;\n      callHook$1(dir, 'update', vnode, oldVnode);\n      if (dir.def && dir.def.componentUpdated) {\n        dirsWithPostpatch.push(dir);\n      }\n    }\n  }\n\n  if (dirsWithInsert.length) {\n    var callInsert = function () {\n      dirsWithInsert.forEach(function (dir) {\n        callHook$1(dir, 'inserted', vnode, oldVnode);\n      });\n    };\n    if (isCreate) {\n      mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');\n    } else {\n      callInsert();\n    }\n  }\n\n  if (dirsWithPostpatch.length) {\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {\n      dirsWithPostpatch.forEach(function (dir) {\n        callHook$1(dir, 'componentUpdated', vnode, oldVnode);\n      });\n    }, 'dir-postpatch');\n  }\n\n  if (!isCreate) {\n    for (key in oldDirs) {\n      if (!newDirs[key]) {\n        // no longer present, unbind\n        callHook$1(oldDirs[key], 'unbind', oldVnode);\n      }\n    }\n  }\n}\n\nvar emptyModifiers = Object.create(null);\n\nfunction normalizeDirectives$1 (\n  dirs,\n  vm\n) {\n  var res = Object.create(null);\n  if (!dirs) {\n    return res\n  }\n  var i, dir;\n  for (i = 0; i < dirs.length; i++) {\n    dir = dirs[i];\n    if (!dir.modifiers) {\n      dir.modifiers = emptyModifiers;\n    }\n    res[getRawDirName(dir)] = dir;\n    dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n  }\n  return res\n}\n\nfunction getRawDirName (dir) {\n  return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n}\n\nfunction callHook$1 (dir, hook, vnode, oldVnode) {\n  var fn = dir.def && dir.def[hook];\n  if (fn) {\n    fn(vnode.elm, dir, vnode, oldVnode);\n  }\n}\n\nvar baseModules = [\n  ref,\n  directives\n];\n\n/*  */\n\nfunction updateAttrs (oldVnode, vnode) {\n  if (!oldVnode.data.attrs && !vnode.data.attrs) {\n    return\n  }\n  var key, cur, old;\n  var elm = vnode.elm;\n  var oldAttrs = oldVnode.data.attrs || {};\n  var attrs = vnode.data.attrs || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (attrs.__ob__) {\n    attrs = vnode.data.attrs = extend({}, attrs);\n  }\n\n  for (key in attrs) {\n    cur = attrs[key];\n    old = oldAttrs[key];\n    if (old !== cur) {\n      setAttr(elm, key, cur);\n    }\n  }\n  for (key in oldAttrs) {\n    if (attrs[key] == null) {\n      if (isXlink(key)) {\n        elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else if (!isEnumeratedAttr(key)) {\n        elm.removeAttribute(key);\n      }\n    }\n  }\n}\n\nfunction setAttr (el, key, value) {\n  if (isBooleanAttr(key)) {\n    // set attribute for blank value\n    // e.g. <option disabled>Select one</option>\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, key);\n    }\n  } else if (isEnumeratedAttr(key)) {\n    el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');\n  } else if (isXlink(key)) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n    } else {\n      el.setAttributeNS(xlinkNS, key, value);\n    }\n  } else {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, value);\n    }\n  }\n}\n\nvar attrs = {\n  create: updateAttrs,\n  update: updateAttrs\n};\n\n/*  */\n\nfunction updateClass (oldVnode, vnode) {\n  var el = vnode.elm;\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n  if (!data.staticClass && !data.class &&\n      (!oldData || (!oldData.staticClass && !oldData.class))) {\n    return\n  }\n\n  var cls = genClassForVnode(vnode);\n\n  // handle transition classes\n  var transitionClass = el._transitionClasses;\n  if (transitionClass) {\n    cls = concat(cls, stringifyClass(transitionClass));\n  }\n\n  // set the class\n  if (cls !== el._prevClass) {\n    el.setAttribute('class', cls);\n    el._prevClass = cls;\n  }\n}\n\nvar klass = {\n  create: updateClass,\n  update: updateClass\n};\n\n// skip type checking this file because we need to attach private properties\n// to elements\n\nfunction updateDOMListeners (oldVnode, vnode) {\n  if (!oldVnode.data.on && !vnode.data.on) {\n    return\n  }\n  var on = vnode.data.on || {};\n  var oldOn = oldVnode.data.on || {};\n  var add = vnode.elm._v_add || (\n    vnode.elm._v_add = function (event, handler, once, capture) {\n      if (once) {\n        var oldHandler = handler;\n        handler = function (ev) {\n          remove(event, handler, capture);\n          arguments.length === 1\n            ? oldHandler(ev)\n            : oldHandler.apply(null, arguments);\n        };\n      }\n      vnode.elm.addEventListener(event, handler, capture);\n    }\n  );\n  var remove = vnode.elm._v_remove || (\n    vnode.elm._v_remove = function (event, handler, capture) {\n      vnode.elm.removeEventListener(event, handler, capture);\n    }\n  );\n  updateListeners(on, oldOn, add, remove, vnode.context);\n}\n\nvar events = {\n  create: updateDOMListeners,\n  update: updateDOMListeners\n};\n\n/*  */\n\nfunction updateDOMProps (oldVnode, vnode) {\n  if (!oldVnode.data.domProps && !vnode.data.domProps) {\n    return\n  }\n  var key, cur;\n  var elm = vnode.elm;\n  var oldProps = oldVnode.data.domProps || {};\n  var props = vnode.data.domProps || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (props.__ob__) {\n    props = vnode.data.domProps = extend({}, props);\n  }\n\n  for (key in oldProps) {\n    if (props[key] == null) {\n      elm[key] = '';\n    }\n  }\n  for (key in props) {\n    cur = props[key];\n    // ignore children if the node has textContent or innerHTML,\n    // as these will throw away existing DOM nodes and cause removal errors\n    // on subsequent patches (#3360)\n    if (key === 'textContent' || key === 'innerHTML') {\n      if (vnode.children) { vnode.children.length = 0; }\n      if (cur === oldProps[key]) { continue }\n    }\n    if (key === 'value') {\n      // store value as _value as well since\n      // non-string values will be stringified\n      elm._value = cur;\n      // avoid resetting cursor position when value is the same\n      var strCur = cur == null ? '' : String(cur);\n      if (elm.value !== strCur && !elm.composing) {\n        elm.value = strCur;\n      }\n    } else {\n      elm[key] = cur;\n    }\n  }\n}\n\nvar domProps = {\n  create: updateDOMProps,\n  update: updateDOMProps\n};\n\n/*  */\n\nvar parseStyleText = cached(function (cssText) {\n  var res = {};\n  var listDelimiter = /;(?![^(]*\\))/g;\n  var propertyDelimiter = /:(.+)/;\n  cssText.split(listDelimiter).forEach(function (item) {\n    if (item) {\n      var tmp = item.split(propertyDelimiter);\n      tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n    }\n  });\n  return res\n});\n\n// merge static and dynamic style data on the same vnode\nfunction normalizeStyleData (data) {\n  var style = normalizeStyleBinding(data.style);\n  // static style is pre-processed into an object during compilation\n  // and is always a fresh object, so it's safe to merge into it\n  return data.staticStyle\n    ? extend(data.staticStyle, style)\n    : style\n}\n\n// normalize possible array / string values into Object\nfunction normalizeStyleBinding (bindingStyle) {\n  if (Array.isArray(bindingStyle)) {\n    return toObject(bindingStyle)\n  }\n  if (typeof bindingStyle === 'string') {\n    return parseStyleText(bindingStyle)\n  }\n  return bindingStyle\n}\n\n/**\n * parent component style should be after child's\n * so that parent component's style could override it\n */\nfunction getStyle (vnode, checkChild) {\n  var res = {};\n  var styleData;\n\n  if (checkChild) {\n    var childNode = vnode;\n    while (childNode.child) {\n      childNode = childNode.child._vnode;\n      if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n        extend(res, styleData);\n      }\n    }\n  }\n\n  if ((styleData = normalizeStyleData(vnode.data))) {\n    extend(res, styleData);\n  }\n\n  var parentNode = vnode;\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n      extend(res, styleData);\n    }\n  }\n  return res\n}\n\n/*  */\n\nvar cssVarRE = /^--/;\nvar importantRE = /\\s*!important$/;\nvar setProp = function (el, name, val) {\n  /* istanbul ignore if */\n  if (cssVarRE.test(name)) {\n    el.style.setProperty(name, val);\n  } else if (importantRE.test(val)) {\n    el.style.setProperty(name, val.replace(importantRE, ''), 'important');\n  } else {\n    el.style[normalize(name)] = val;\n  }\n};\n\nvar prefixes = ['Webkit', 'Moz', 'ms'];\n\nvar testEl;\nvar normalize = cached(function (prop) {\n  testEl = testEl || document.createElement('div');\n  prop = camelize(prop);\n  if (prop !== 'filter' && (prop in testEl.style)) {\n    return prop\n  }\n  var upper = prop.charAt(0).toUpperCase() + prop.slice(1);\n  for (var i = 0; i < prefixes.length; i++) {\n    var prefixed = prefixes[i] + upper;\n    if (prefixed in testEl.style) {\n      return prefixed\n    }\n  }\n});\n\nfunction updateStyle (oldVnode, vnode) {\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n\n  if (!data.staticStyle && !data.style &&\n      !oldData.staticStyle && !oldData.style) {\n    return\n  }\n\n  var cur, name;\n  var el = vnode.elm;\n  var oldStaticStyle = oldVnode.data.staticStyle;\n  var oldStyleBinding = oldVnode.data.style || {};\n\n  // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n  var oldStyle = oldStaticStyle || oldStyleBinding;\n\n  var style = normalizeStyleBinding(vnode.data.style) || {};\n\n  vnode.data.style = style.__ob__ ? extend({}, style) : style;\n\n  var newStyle = getStyle(vnode, true);\n\n  for (name in oldStyle) {\n    if (newStyle[name] == null) {\n      setProp(el, name, '');\n    }\n  }\n  for (name in newStyle) {\n    cur = newStyle[name];\n    if (cur !== oldStyle[name]) {\n      // ie9 setting to null has no effect, must use empty string\n      setProp(el, name, cur == null ? '' : cur);\n    }\n  }\n}\n\nvar style = {\n  create: updateStyle,\n  update: updateStyle\n};\n\n/*  */\n\n/**\n * Add class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction addClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n    } else {\n      el.classList.add(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    if (cur.indexOf(' ' + cls + ' ') < 0) {\n      el.setAttribute('class', (cur + cls).trim());\n    }\n  }\n}\n\n/**\n * Remove class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction removeClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.remove(c); });\n    } else {\n      el.classList.remove(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    var tar = ' ' + cls + ' ';\n    while (cur.indexOf(tar) >= 0) {\n      cur = cur.replace(tar, ' ');\n    }\n    el.setAttribute('class', cur.trim());\n  }\n}\n\n/*  */\n\nvar hasTransition = inBrowser && !isIE9;\nvar TRANSITION = 'transition';\nvar ANIMATION = 'animation';\n\n// Transition property/event sniffing\nvar transitionProp = 'transition';\nvar transitionEndEvent = 'transitionend';\nvar animationProp = 'animation';\nvar animationEndEvent = 'animationend';\nif (hasTransition) {\n  /* istanbul ignore if */\n  if (window.ontransitionend === undefined &&\n    window.onwebkittransitionend !== undefined) {\n    transitionProp = 'WebkitTransition';\n    transitionEndEvent = 'webkitTransitionEnd';\n  }\n  if (window.onanimationend === undefined &&\n    window.onwebkitanimationend !== undefined) {\n    animationProp = 'WebkitAnimation';\n    animationEndEvent = 'webkitAnimationEnd';\n  }\n}\n\nvar raf = (inBrowser && window.requestAnimationFrame) || setTimeout;\nfunction nextFrame (fn) {\n  raf(function () {\n    raf(fn);\n  });\n}\n\nfunction addTransitionClass (el, cls) {\n  (el._transitionClasses || (el._transitionClasses = [])).push(cls);\n  addClass(el, cls);\n}\n\nfunction removeTransitionClass (el, cls) {\n  if (el._transitionClasses) {\n    remove$1(el._transitionClasses, cls);\n  }\n  removeClass(el, cls);\n}\n\nfunction whenTransitionEnds (\n  el,\n  expectedType,\n  cb\n) {\n  var ref = getTransitionInfo(el, expectedType);\n  var type = ref.type;\n  var timeout = ref.timeout;\n  var propCount = ref.propCount;\n  if (!type) { return cb() }\n  var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n  var ended = 0;\n  var end = function () {\n    el.removeEventListener(event, onEnd);\n    cb();\n  };\n  var onEnd = function (e) {\n    if (e.target === el) {\n      if (++ended >= propCount) {\n        end();\n      }\n    }\n  };\n  setTimeout(function () {\n    if (ended < propCount) {\n      end();\n    }\n  }, timeout + 1);\n  el.addEventListener(event, onEnd);\n}\n\nvar transformRE = /\\b(transform|all)(,|$)/;\n\nfunction getTransitionInfo (el, expectedType) {\n  var styles = window.getComputedStyle(el);\n  var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');\n  var transitionDurations = styles[transitionProp + 'Duration'].split(', ');\n  var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);\n  var animationDelays = styles[animationProp + 'Delay'].split(', ');\n  var animationDurations = styles[animationProp + 'Duration'].split(', ');\n  var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n  var type;\n  var timeout = 0;\n  var propCount = 0;\n  /* istanbul ignore if */\n  if (expectedType === TRANSITION) {\n    if (transitionTimeout > 0) {\n      type = TRANSITION;\n      timeout = transitionTimeout;\n      propCount = transitionDurations.length;\n    }\n  } else if (expectedType === ANIMATION) {\n    if (animationTimeout > 0) {\n      type = ANIMATION;\n      timeout = animationTimeout;\n      propCount = animationDurations.length;\n    }\n  } else {\n    timeout = Math.max(transitionTimeout, animationTimeout);\n    type = timeout > 0\n      ? transitionTimeout > animationTimeout\n        ? TRANSITION\n        : ANIMATION\n      : null;\n    propCount = type\n      ? type === TRANSITION\n        ? transitionDurations.length\n        : animationDurations.length\n      : 0;\n  }\n  var hasTransform =\n    type === TRANSITION &&\n    transformRE.test(styles[transitionProp + 'Property']);\n  return {\n    type: type,\n    timeout: timeout,\n    propCount: propCount,\n    hasTransform: hasTransform\n  }\n}\n\nfunction getTimeout (delays, durations) {\n  /* istanbul ignore next */\n  while (delays.length < durations.length) {\n    delays = delays.concat(delays);\n  }\n\n  return Math.max.apply(null, durations.map(function (d, i) {\n    return toMs(d) + toMs(delays[i])\n  }))\n}\n\nfunction toMs (s) {\n  return Number(s.slice(0, -1)) * 1000\n}\n\n/*  */\n\nfunction enter (vnode) {\n  var el = vnode.elm;\n\n  // call leave callback now\n  if (el._leaveCb) {\n    el._leaveCb.cancelled = true;\n    el._leaveCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return\n  }\n\n  /* istanbul ignore if */\n  if (el._enterCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var enterClass = data.enterClass;\n  var enterActiveClass = data.enterActiveClass;\n  var appearClass = data.appearClass;\n  var appearActiveClass = data.appearActiveClass;\n  var beforeEnter = data.beforeEnter;\n  var enter = data.enter;\n  var afterEnter = data.afterEnter;\n  var enterCancelled = data.enterCancelled;\n  var beforeAppear = data.beforeAppear;\n  var appear = data.appear;\n  var afterAppear = data.afterAppear;\n  var appearCancelled = data.appearCancelled;\n\n  // activeInstance will always be the <transition> component managing this\n  // transition. One edge case to check is when the <transition> is placed\n  // as the root node of a child component. In that case we need to check\n  // <transition>'s parent for appear check.\n  var context = activeInstance;\n  var transitionNode = activeInstance.$vnode;\n  while (transitionNode && transitionNode.parent) {\n    transitionNode = transitionNode.parent;\n    context = transitionNode.context;\n  }\n\n  var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  var startClass = isAppear ? appearClass : enterClass;\n  var activeClass = isAppear ? appearActiveClass : enterActiveClass;\n  var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;\n  var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;\n  var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;\n  var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    enterHook &&\n    // enterHook may be a bound method which exposes\n    // the length of original fn as _length\n    (enterHook._length || enterHook.length) > 1;\n\n  var cb = el._enterCb = once(function () {\n    if (expectsCSS) {\n      removeTransitionClass(el, activeClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass);\n      }\n      enterCancelledHook && enterCancelledHook(el);\n    } else {\n      afterEnterHook && afterEnterHook(el);\n    }\n    el._enterCb = null;\n  });\n\n  if (!vnode.data.show) {\n    // remove pending leave element on enter by injecting an insert hook\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {\n      var parent = el.parentNode;\n      var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n      if (pendingNode &&\n          pendingNode.context === vnode.context &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb) {\n        pendingNode.elm._leaveCb();\n      }\n      enterHook && enterHook(el, cb);\n    }, 'transition-insert');\n  }\n\n  // start enter transition\n  beforeEnterHook && beforeEnterHook(el);\n  if (expectsCSS) {\n    addTransitionClass(el, startClass);\n    addTransitionClass(el, activeClass);\n    nextFrame(function () {\n      removeTransitionClass(el, startClass);\n      if (!cb.cancelled && !userWantsControl) {\n        whenTransitionEnds(el, type, cb);\n      }\n    });\n  }\n\n  if (vnode.data.show) {\n    enterHook && enterHook(el, cb);\n  }\n\n  if (!expectsCSS && !userWantsControl) {\n    cb();\n  }\n}\n\nfunction leave (vnode, rm) {\n  var el = vnode.elm;\n\n  // call enter callback now\n  if (el._enterCb) {\n    el._enterCb.cancelled = true;\n    el._enterCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return rm()\n  }\n\n  /* istanbul ignore if */\n  if (el._leaveCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var leaveClass = data.leaveClass;\n  var leaveActiveClass = data.leaveActiveClass;\n  var beforeLeave = data.beforeLeave;\n  var leave = data.leave;\n  var afterLeave = data.afterLeave;\n  var leaveCancelled = data.leaveCancelled;\n  var delayLeave = data.delayLeave;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    leave &&\n    // leave hook may be a bound method which exposes\n    // the length of original fn as _length\n    (leave._length || leave.length) > 1;\n\n  var cb = el._leaveCb = once(function () {\n    if (el.parentNode && el.parentNode._pending) {\n      el.parentNode._pending[vnode.key] = null;\n    }\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveActiveClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass);\n      }\n      leaveCancelled && leaveCancelled(el);\n    } else {\n      rm();\n      afterLeave && afterLeave(el);\n    }\n    el._leaveCb = null;\n  });\n\n  if (delayLeave) {\n    delayLeave(performLeave);\n  } else {\n    performLeave();\n  }\n\n  function performLeave () {\n    // the delayed leave may have already been cancelled\n    if (cb.cancelled) {\n      return\n    }\n    // record leaving element\n    if (!vnode.data.show) {\n      (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;\n    }\n    beforeLeave && beforeLeave(el);\n    if (expectsCSS) {\n      addTransitionClass(el, leaveClass);\n      addTransitionClass(el, leaveActiveClass);\n      nextFrame(function () {\n        removeTransitionClass(el, leaveClass);\n        if (!cb.cancelled && !userWantsControl) {\n          whenTransitionEnds(el, type, cb);\n        }\n      });\n    }\n    leave && leave(el, cb);\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n}\n\nfunction resolveTransition (def$$1) {\n  if (!def$$1) {\n    return\n  }\n  /* istanbul ignore else */\n  if (typeof def$$1 === 'object') {\n    var res = {};\n    if (def$$1.css !== false) {\n      extend(res, autoCssTransition(def$$1.name || 'v'));\n    }\n    extend(res, def$$1);\n    return res\n  } else if (typeof def$$1 === 'string') {\n    return autoCssTransition(def$$1)\n  }\n}\n\nvar autoCssTransition = cached(function (name) {\n  return {\n    enterClass: (name + \"-enter\"),\n    leaveClass: (name + \"-leave\"),\n    appearClass: (name + \"-enter\"),\n    enterActiveClass: (name + \"-enter-active\"),\n    leaveActiveClass: (name + \"-leave-active\"),\n    appearActiveClass: (name + \"-enter-active\")\n  }\n});\n\nfunction once (fn) {\n  var called = false;\n  return function () {\n    if (!called) {\n      called = true;\n      fn();\n    }\n  }\n}\n\nfunction _enter (_, vnode) {\n  if (!vnode.data.show) {\n    enter(vnode);\n  }\n}\n\nvar transition = inBrowser ? {\n  create: _enter,\n  activate: _enter,\n  remove: function remove (vnode, rm) {\n    /* istanbul ignore else */\n    if (!vnode.data.show) {\n      leave(vnode, rm);\n    } else {\n      rm();\n    }\n  }\n} : {};\n\nvar platformModules = [\n  attrs,\n  klass,\n  events,\n  domProps,\n  style,\n  transition\n];\n\n/*  */\n\n// the directive module should be applied last, after all\n// built-in modules have been applied.\nvar modules = platformModules.concat(baseModules);\n\nvar patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n/**\n * Not type checking this file because flow doesn't like attaching\n * properties to Elements.\n */\n\nvar modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;\n\n/* istanbul ignore if */\nif (isIE9) {\n  // http://www.matts411.com/post/internet-explorer-9-oninput/\n  document.addEventListener('selectionchange', function () {\n    var el = document.activeElement;\n    if (el && el.vmodel) {\n      trigger(el, 'input');\n    }\n  });\n}\n\nvar model = {\n  inserted: function inserted (el, binding, vnode) {\n    {\n      if (!modelableTagRE.test(vnode.tag)) {\n        warn(\n          \"v-model is not supported on element type: <\" + (vnode.tag) + \">. \" +\n          'If you are working with contenteditable, it\\'s recommended to ' +\n          'wrap a library dedicated for that purpose inside a custom component.',\n          vnode.context\n        );\n      }\n    }\n    if (vnode.tag === 'select') {\n      var cb = function () {\n        setSelected(el, binding, vnode.context);\n      };\n      cb();\n      /* istanbul ignore if */\n      if (isIE || isEdge) {\n        setTimeout(cb, 0);\n      }\n    } else if (\n      (vnode.tag === 'textarea' || el.type === 'text') &&\n      !binding.modifiers.lazy\n    ) {\n      if (!isAndroid) {\n        el.addEventListener('compositionstart', onCompositionStart);\n        el.addEventListener('compositionend', onCompositionEnd);\n      }\n      /* istanbul ignore if */\n      if (isIE9) {\n        el.vmodel = true;\n      }\n    }\n  },\n  componentUpdated: function componentUpdated (el, binding, vnode) {\n    if (vnode.tag === 'select') {\n      setSelected(el, binding, vnode.context);\n      // in case the options rendered by v-for have changed,\n      // it's possible that the value is out-of-sync with the rendered options.\n      // detect such cases and filter out values that no longer has a matching\n      // option in the DOM.\n      var needReset = el.multiple\n        ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })\n        : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);\n      if (needReset) {\n        trigger(el, 'change');\n      }\n    }\n  }\n};\n\nfunction setSelected (el, binding, vm) {\n  var value = binding.value;\n  var isMultiple = el.multiple;\n  if (isMultiple && !Array.isArray(value)) {\n    \"development\" !== 'production' && warn(\n      \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n      \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n      vm\n    );\n    return\n  }\n  var selected, option;\n  for (var i = 0, l = el.options.length; i < l; i++) {\n    option = el.options[i];\n    if (isMultiple) {\n      selected = looseIndexOf(value, getValue(option)) > -1;\n      if (option.selected !== selected) {\n        option.selected = selected;\n      }\n    } else {\n      if (looseEqual(getValue(option), value)) {\n        if (el.selectedIndex !== i) {\n          el.selectedIndex = i;\n        }\n        return\n      }\n    }\n  }\n  if (!isMultiple) {\n    el.selectedIndex = -1;\n  }\n}\n\nfunction hasNoMatchingOption (value, options) {\n  for (var i = 0, l = options.length; i < l; i++) {\n    if (looseEqual(getValue(options[i]), value)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction getValue (option) {\n  return '_value' in option\n    ? option._value\n    : option.value\n}\n\nfunction onCompositionStart (e) {\n  e.target.composing = true;\n}\n\nfunction onCompositionEnd (e) {\n  e.target.composing = false;\n  trigger(e.target, 'input');\n}\n\nfunction trigger (el, type) {\n  var e = document.createEvent('HTMLEvents');\n  e.initEvent(type, true, true);\n  el.dispatchEvent(e);\n}\n\n/*  */\n\n// recursively search for possible transition defined inside the component root\nfunction locateNode (vnode) {\n  return vnode.child && (!vnode.data || !vnode.data.transition)\n    ? locateNode(vnode.child._vnode)\n    : vnode\n}\n\nvar show = {\n  bind: function bind (el, ref, vnode) {\n    var value = ref.value;\n\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (value && transition && !isIE9) {\n      enter(vnode);\n    }\n    var originalDisplay = el.style.display === 'none' ? '' : el.style.display;\n    el.style.display = value ? originalDisplay : 'none';\n    el.__vOriginalDisplay = originalDisplay;\n  },\n  update: function update (el, ref, vnode) {\n    var value = ref.value;\n    var oldValue = ref.oldValue;\n\n    /* istanbul ignore if */\n    if (value === oldValue) { return }\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (transition && !isIE9) {\n      if (value) {\n        enter(vnode);\n        el.style.display = el.__vOriginalDisplay;\n      } else {\n        leave(vnode, function () {\n          el.style.display = 'none';\n        });\n      }\n    } else {\n      el.style.display = value ? el.__vOriginalDisplay : 'none';\n    }\n  }\n};\n\nvar platformDirectives = {\n  model: model,\n  show: show\n};\n\n/*  */\n\n// Provides transition support for a single element/component.\n// supports transition mode (out-in / in-out)\n\nvar transitionProps = {\n  name: String,\n  appear: Boolean,\n  css: Boolean,\n  mode: String,\n  type: String,\n  enterClass: String,\n  leaveClass: String,\n  enterActiveClass: String,\n  leaveActiveClass: String,\n  appearClass: String,\n  appearActiveClass: String\n};\n\n// in case the child is also an abstract component, e.g. <keep-alive>\n// we want to recursively retrieve the real component to be rendered\nfunction getRealChild (vnode) {\n  var compOptions = vnode && vnode.componentOptions;\n  if (compOptions && compOptions.Ctor.options.abstract) {\n    return getRealChild(getFirstComponentChild(compOptions.children))\n  } else {\n    return vnode\n  }\n}\n\nfunction extractTransitionData (comp) {\n  var data = {};\n  var options = comp.$options;\n  // props\n  for (var key in options.propsData) {\n    data[key] = comp[key];\n  }\n  // events.\n  // extract listeners and pass them directly to the transition methods\n  var listeners = options._parentListeners;\n  for (var key$1 in listeners) {\n    data[camelize(key$1)] = listeners[key$1].fn;\n  }\n  return data\n}\n\nfunction placeholder (h, rawChild) {\n  return /\\d-keep-alive$/.test(rawChild.tag)\n    ? h('keep-alive')\n    : null\n}\n\nfunction hasParentTransition (vnode) {\n  while ((vnode = vnode.parent)) {\n    if (vnode.data.transition) {\n      return true\n    }\n  }\n}\n\nvar Transition = {\n  name: 'transition',\n  props: transitionProps,\n  abstract: true,\n  render: function render (h) {\n    var this$1 = this;\n\n    var children = this.$slots.default;\n    if (!children) {\n      return\n    }\n\n    // filter out text nodes (possible whitespaces)\n    children = children.filter(function (c) { return c.tag; });\n    /* istanbul ignore if */\n    if (!children.length) {\n      return\n    }\n\n    // warn multiple elements\n    if (\"development\" !== 'production' && children.length > 1) {\n      warn(\n        '<transition> can only be used on a single element. Use ' +\n        '<transition-group> for lists.',\n        this.$parent\n      );\n    }\n\n    var mode = this.mode;\n\n    // warn invalid mode\n    if (\"development\" !== 'production' &&\n        mode && mode !== 'in-out' && mode !== 'out-in') {\n      warn(\n        'invalid <transition> mode: ' + mode,\n        this.$parent\n      );\n    }\n\n    var rawChild = children[0];\n\n    // if this is a component root node and the component's\n    // parent container node also has transition, skip.\n    if (hasParentTransition(this.$vnode)) {\n      return rawChild\n    }\n\n    // apply transition data to child\n    // use getRealChild() to ignore abstract components e.g. keep-alive\n    var child = getRealChild(rawChild);\n    /* istanbul ignore if */\n    if (!child) {\n      return rawChild\n    }\n\n    if (this._leaving) {\n      return placeholder(h, rawChild)\n    }\n\n    var key = child.key = child.key == null || child.isStatic\n      ? (\"__v\" + (child.tag + this._uid) + \"__\")\n      : child.key;\n    var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n    var oldRawChild = this._vnode;\n    var oldChild = getRealChild(oldRawChild);\n\n    // mark v-show\n    // so that the transition module can hand over the control to the directive\n    if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {\n      child.data.show = true;\n    }\n\n    if (oldChild && oldChild.data && oldChild.key !== key) {\n      // replace old child transition data with fresh one\n      // important for dynamic transitions!\n      var oldData = oldChild.data.transition = extend({}, data);\n\n      // handle transition mode\n      if (mode === 'out-in') {\n        // return placeholder node and queue update when leave finishes\n        this._leaving = true;\n        mergeVNodeHook(oldData, 'afterLeave', function () {\n          this$1._leaving = false;\n          this$1.$forceUpdate();\n        }, key);\n        return placeholder(h, rawChild)\n      } else if (mode === 'in-out') {\n        var delayedLeave;\n        var performLeave = function () { delayedLeave(); };\n        mergeVNodeHook(data, 'afterEnter', performLeave, key);\n        mergeVNodeHook(data, 'enterCancelled', performLeave, key);\n        mergeVNodeHook(oldData, 'delayLeave', function (leave) {\n          delayedLeave = leave;\n        }, key);\n      }\n    }\n\n    return rawChild\n  }\n};\n\n/*  */\n\n// Provides transition support for list items.\n// supports move transitions using the FLIP technique.\n\n// Because the vdom's children update algorithm is \"unstable\" - i.e.\n// it doesn't guarantee the relative positioning of removed elements,\n// we force transition-group to update its children into two passes:\n// in the first pass, we remove all nodes that need to be removed,\n// triggering their leaving transition; in the second pass, we insert/move\n// into the final disired state. This way in the second pass removed\n// nodes will remain where they should be.\n\nvar props = extend({\n  tag: String,\n  moveClass: String\n}, transitionProps);\n\ndelete props.mode;\n\nvar TransitionGroup = {\n  props: props,\n\n  render: function render (h) {\n    var tag = this.tag || this.$vnode.data.tag || 'span';\n    var map = Object.create(null);\n    var prevChildren = this.prevChildren = this.children;\n    var rawChildren = this.$slots.default || [];\n    var children = this.children = [];\n    var transitionData = extractTransitionData(this);\n\n    for (var i = 0; i < rawChildren.length; i++) {\n      var c = rawChildren[i];\n      if (c.tag) {\n        if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n          children.push(c);\n          map[c.key] = c\n          ;(c.data || (c.data = {})).transition = transitionData;\n        } else {\n          var opts = c.componentOptions;\n          var name = opts\n            ? (opts.Ctor.options.name || opts.tag)\n            : c.tag;\n          warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n        }\n      }\n    }\n\n    if (prevChildren) {\n      var kept = [];\n      var removed = [];\n      for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n        var c$1 = prevChildren[i$1];\n        c$1.data.transition = transitionData;\n        c$1.data.pos = c$1.elm.getBoundingClientRect();\n        if (map[c$1.key]) {\n          kept.push(c$1);\n        } else {\n          removed.push(c$1);\n        }\n      }\n      this.kept = h(tag, null, kept);\n      this.removed = removed;\n    }\n\n    return h(tag, null, children)\n  },\n\n  beforeUpdate: function beforeUpdate () {\n    // force removing pass\n    this.__patch__(\n      this._vnode,\n      this.kept,\n      false, // hydrating\n      true // removeOnly (!important, avoids unnecessary moves)\n    );\n    this._vnode = this.kept;\n  },\n\n  updated: function updated () {\n    var children = this.prevChildren;\n    var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n    if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n      return\n    }\n\n    // we divide the work into three loops to avoid mixing DOM reads and writes\n    // in each iteration - which helps prevent layout thrashing.\n    children.forEach(callPendingCbs);\n    children.forEach(recordPosition);\n    children.forEach(applyTranslation);\n\n    // force reflow to put everything in position\n    var f = document.body.offsetHeight; // eslint-disable-line\n\n    children.forEach(function (c) {\n      if (c.data.moved) {\n        var el = c.elm;\n        var s = el.style;\n        addTransitionClass(el, moveClass);\n        s.transform = s.WebkitTransform = s.transitionDuration = '';\n        el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n          if (!e || /transform$/.test(e.propertyName)) {\n            el.removeEventListener(transitionEndEvent, cb);\n            el._moveCb = null;\n            removeTransitionClass(el, moveClass);\n          }\n        });\n      }\n    });\n  },\n\n  methods: {\n    hasMove: function hasMove (el, moveClass) {\n      /* istanbul ignore if */\n      if (!hasTransition) {\n        return false\n      }\n      if (this._hasMove != null) {\n        return this._hasMove\n      }\n      addTransitionClass(el, moveClass);\n      var info = getTransitionInfo(el);\n      removeTransitionClass(el, moveClass);\n      return (this._hasMove = info.hasTransform)\n    }\n  }\n};\n\nfunction callPendingCbs (c) {\n  /* istanbul ignore if */\n  if (c.elm._moveCb) {\n    c.elm._moveCb();\n  }\n  /* istanbul ignore if */\n  if (c.elm._enterCb) {\n    c.elm._enterCb();\n  }\n}\n\nfunction recordPosition (c) {\n  c.data.newPos = c.elm.getBoundingClientRect();\n}\n\nfunction applyTranslation (c) {\n  var oldPos = c.data.pos;\n  var newPos = c.data.newPos;\n  var dx = oldPos.left - newPos.left;\n  var dy = oldPos.top - newPos.top;\n  if (dx || dy) {\n    c.data.moved = true;\n    var s = c.elm.style;\n    s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n    s.transitionDuration = '0s';\n  }\n}\n\nvar platformComponents = {\n  Transition: Transition,\n  TransitionGroup: TransitionGroup\n};\n\n/*  */\n\n// install platform specific utils\nVue$3.config.isUnknownElement = isUnknownElement;\nVue$3.config.isReservedTag = isReservedTag;\nVue$3.config.getTagNamespace = getTagNamespace;\nVue$3.config.mustUseProp = mustUseProp;\n\n// install platform runtime directives & components\nextend(Vue$3.options.directives, platformDirectives);\nextend(Vue$3.options.components, platformComponents);\n\n// install platform patch function\nVue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;\n\n// wrap mount\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && inBrowser ? query(el) : undefined;\n  return this._mount(el, hydrating)\n};\n\n// devtools global hook\n/* istanbul ignore next */\nsetTimeout(function () {\n  if (config.devtools) {\n    if (devtools) {\n      devtools.emit('init', Vue$3);\n    } else if (\n      \"development\" !== 'production' &&\n      inBrowser && /Chrome\\/\\d+/.test(window.navigator.userAgent)\n    ) {\n      console.log(\n        'Download the Vue Devtools for a better development experience:\\n' +\n        'https://github.com/vuejs/vue-devtools'\n      );\n    }\n  }\n}, 0);\n\n/*  */\n\n// check whether current browser encodes a char inside attribute values\nfunction shouldDecode (content, encoded) {\n  var div = document.createElement('div');\n  div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n  return div.innerHTML.indexOf(encoded) > 0\n}\n\n// #3663\n// IE encodes newlines inside attribute values while other browsers don't\nvar shouldDecodeNewlines = inBrowser ? shouldDecode('\\n', '&#10;') : false;\n\n/*  */\n\nvar decoder;\n\nfunction decode (html) {\n  decoder = decoder || document.createElement('div');\n  decoder.innerHTML = html;\n  return decoder.textContent\n}\n\n/*  */\n\nvar isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n  'link,meta,param,source,track,wbr',\n  true\n);\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nvar canBeLeftOpenTag = makeMap(\n  'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',\n  true\n);\n\n// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\nvar isNonPhrasingTag = makeMap(\n  'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n  'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n  'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n  'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n  'title,tr,track',\n  true\n);\n\n/**\n * Not type-checking this file because it's mostly vendor code.\n */\n\n/*!\n * HTML Parser By John Resig (ejohn.org)\n * Modified by Juriy \"kangax\" Zaytsev\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n */\n\n// Regular Expressions for parsing tags and attributes\nvar singleAttrIdentifier = /([^\\s\"'<>/=]+)/;\nvar singleAttrAssign = /(?:=)/;\nvar singleAttrValues = [\n  // attr value double quotes\n  /\"([^\"]*)\"+/.source,\n  // attr value, single quotes\n  /'([^']*)'+/.source,\n  // attr value, no quotes\n  /([^\\s\"'=<>`]+)/.source\n];\nvar attribute = new RegExp(\n  '^\\\\s*' + singleAttrIdentifier.source +\n  '(?:\\\\s*(' + singleAttrAssign.source + ')' +\n  '\\\\s*(?:' + singleAttrValues.join('|') + '))?'\n);\n\n// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName\n// but for Vue templates we can enforce a simple charset\nvar ncname = '[a-zA-Z_][\\\\w\\\\-\\\\.]*';\nvar qnameCapture = '((?:' + ncname + '\\\\:)?' + ncname + ')';\nvar startTagOpen = new RegExp('^<' + qnameCapture);\nvar startTagClose = /^\\s*(\\/?)>/;\nvar endTag = new RegExp('^<\\\\/' + qnameCapture + '[^>]*>');\nvar doctype = /^<!DOCTYPE [^>]+>/i;\nvar comment = /^<!--/;\nvar conditionalComment = /^<!\\[/;\n\nvar IS_REGEX_CAPTURING_BROKEN = false;\n'x'.replace(/x(.)?/g, function (m, g) {\n  IS_REGEX_CAPTURING_BROKEN = g === '';\n});\n\n// Special Elements (can contain anything)\nvar isScriptOrStyle = makeMap('script,style', true);\nvar hasLang = function (attr) { return attr.name === 'lang' && attr.value !== 'html'; };\nvar isSpecialTag = function (tag, isSFC, stack) {\n  if (isScriptOrStyle(tag)) {\n    return true\n  }\n  if (isSFC && stack.length === 1) {\n    // top-level template that has no pre-processor\n    if (tag === 'template' && !stack[0].attrs.some(hasLang)) {\n      return false\n    } else {\n      return true\n    }\n  }\n  return false\n};\n\nvar reCache = {};\n\nvar ltRE = /&lt;/g;\nvar gtRE = /&gt;/g;\nvar nlRE = /&#10;/g;\nvar ampRE = /&amp;/g;\nvar quoteRE = /&quot;/g;\n\nfunction decodeAttr (value, shouldDecodeNewlines) {\n  if (shouldDecodeNewlines) {\n    value = value.replace(nlRE, '\\n');\n  }\n  return value\n    .replace(ltRE, '<')\n    .replace(gtRE, '>')\n    .replace(ampRE, '&')\n    .replace(quoteRE, '\"')\n}\n\nfunction parseHTML (html, options) {\n  var stack = [];\n  var expectHTML = options.expectHTML;\n  var isUnaryTag$$1 = options.isUnaryTag || no;\n  var index = 0;\n  var last, lastTag;\n  while (html) {\n    last = html;\n    // Make sure we're not in a script or style element\n    if (!lastTag || !isSpecialTag(lastTag, options.sfc, stack)) {\n      var textEnd = html.indexOf('<');\n      if (textEnd === 0) {\n        // Comment:\n        if (comment.test(html)) {\n          var commentEnd = html.indexOf('-->');\n\n          if (commentEnd >= 0) {\n            advance(commentEnd + 3);\n            continue\n          }\n        }\n\n        // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n        if (conditionalComment.test(html)) {\n          var conditionalEnd = html.indexOf(']>');\n\n          if (conditionalEnd >= 0) {\n            advance(conditionalEnd + 2);\n            continue\n          }\n        }\n\n        // Doctype:\n        var doctypeMatch = html.match(doctype);\n        if (doctypeMatch) {\n          advance(doctypeMatch[0].length);\n          continue\n        }\n\n        // End tag:\n        var endTagMatch = html.match(endTag);\n        if (endTagMatch) {\n          var curIndex = index;\n          advance(endTagMatch[0].length);\n          parseEndTag(endTagMatch[0], endTagMatch[1], curIndex, index);\n          continue\n        }\n\n        // Start tag:\n        var startTagMatch = parseStartTag();\n        if (startTagMatch) {\n          handleStartTag(startTagMatch);\n          continue\n        }\n      }\n\n      var text = (void 0), rest$1 = (void 0), next = (void 0);\n      if (textEnd > 0) {\n        rest$1 = html.slice(textEnd);\n        while (\n          !endTag.test(rest$1) &&\n          !startTagOpen.test(rest$1) &&\n          !comment.test(rest$1) &&\n          !conditionalComment.test(rest$1)\n        ) {\n          // < in plain text, be forgiving and treat it as text\n          next = rest$1.indexOf('<', 1);\n          if (next < 0) { break }\n          textEnd += next;\n          rest$1 = html.slice(textEnd);\n        }\n        text = html.substring(0, textEnd);\n        advance(textEnd);\n      }\n\n      if (textEnd < 0) {\n        text = html;\n        html = '';\n      }\n\n      if (options.chars && text) {\n        options.chars(text);\n      }\n    } else {\n      var stackedTag = lastTag.toLowerCase();\n      var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n      var endTagLength = 0;\n      var rest = html.replace(reStackedTag, function (all, text, endTag) {\n        endTagLength = endTag.length;\n        if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {\n          text = text\n            .replace(/<!--([\\s\\S]*?)-->/g, '$1')\n            .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n        }\n        if (options.chars) {\n          options.chars(text);\n        }\n        return ''\n      });\n      index += html.length - rest.length;\n      html = rest;\n      parseEndTag('</' + stackedTag + '>', stackedTag, index - endTagLength, index);\n    }\n\n    if (html === last && options.chars) {\n      options.chars(html);\n      break\n    }\n  }\n\n  // Clean up any remaining tags\n  parseEndTag();\n\n  function advance (n) {\n    index += n;\n    html = html.substring(n);\n  }\n\n  function parseStartTag () {\n    var start = html.match(startTagOpen);\n    if (start) {\n      var match = {\n        tagName: start[1],\n        attrs: [],\n        start: index\n      };\n      advance(start[0].length);\n      var end, attr;\n      while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {\n        advance(attr[0].length);\n        match.attrs.push(attr);\n      }\n      if (end) {\n        match.unarySlash = end[1];\n        advance(end[0].length);\n        match.end = index;\n        return match\n      }\n    }\n  }\n\n  function handleStartTag (match) {\n    var tagName = match.tagName;\n    var unarySlash = match.unarySlash;\n\n    if (expectHTML) {\n      if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n        parseEndTag('', lastTag);\n      }\n      if (canBeLeftOpenTag(tagName) && lastTag === tagName) {\n        parseEndTag('', tagName);\n      }\n    }\n\n    var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;\n\n    var l = match.attrs.length;\n    var attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      var args = match.attrs[i];\n      // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778\n      if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('\"\"') === -1) {\n        if (args[3] === '') { delete args[3]; }\n        if (args[4] === '') { delete args[4]; }\n        if (args[5] === '') { delete args[5]; }\n      }\n      var value = args[3] || args[4] || args[5] || '';\n      attrs[i] = {\n        name: args[1],\n        value: decodeAttr(\n          value,\n          options.shouldDecodeNewlines\n        )\n      };\n    }\n\n    if (!unary) {\n      stack.push({ tag: tagName, attrs: attrs });\n      lastTag = tagName;\n      unarySlash = '';\n    }\n\n    if (options.start) {\n      options.start(tagName, attrs, unary, match.start, match.end);\n    }\n  }\n\n  function parseEndTag (tag, tagName, start, end) {\n    var pos;\n    if (start == null) { start = index; }\n    if (end == null) { end = index; }\n\n    // Find the closest opened tag of the same type\n    if (tagName) {\n      var needle = tagName.toLowerCase();\n      for (pos = stack.length - 1; pos >= 0; pos--) {\n        if (stack[pos].tag.toLowerCase() === needle) {\n          break\n        }\n      }\n    } else {\n      // If no tag name is provided, clean shop\n      pos = 0;\n    }\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (var i = stack.length - 1; i >= pos; i--) {\n        if (options.end) {\n          options.end(stack[i].tag, start, end);\n        }\n      }\n\n      // Remove the open elements from the stack\n      stack.length = pos;\n      lastTag = pos && stack[pos - 1].tag;\n    } else if (tagName.toLowerCase() === 'br') {\n      if (options.start) {\n        options.start(tagName, [], true, start, end);\n      }\n    } else if (tagName.toLowerCase() === 'p') {\n      if (options.start) {\n        options.start(tagName, [], false, start, end);\n      }\n      if (options.end) {\n        options.end(tagName, start, end);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction parseFilters (exp) {\n  var inSingle = false;\n  var inDouble = false;\n  var inTemplateString = false;\n  var inRegex = false;\n  var curly = 0;\n  var square = 0;\n  var paren = 0;\n  var lastFilterIndex = 0;\n  var c, prev, i, expression, filters;\n\n  for (i = 0; i < exp.length; i++) {\n    prev = c;\n    c = exp.charCodeAt(i);\n    if (inSingle) {\n      if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n    } else if (inDouble) {\n      if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n    } else if (inTemplateString) {\n      if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n    } else if (inRegex) {\n      if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n    } else if (\n      c === 0x7C && // pipe\n      exp.charCodeAt(i + 1) !== 0x7C &&\n      exp.charCodeAt(i - 1) !== 0x7C &&\n      !curly && !square && !paren\n    ) {\n      if (expression === undefined) {\n        // first filter, end of expression\n        lastFilterIndex = i + 1;\n        expression = exp.slice(0, i).trim();\n      } else {\n        pushFilter();\n      }\n    } else {\n      switch (c) {\n        case 0x22: inDouble = true; break         // \"\n        case 0x27: inSingle = true; break         // '\n        case 0x60: inTemplateString = true; break // `\n        case 0x2f: inRegex = true; break          // /\n        case 0x28: paren++; break                 // (\n        case 0x29: paren--; break                 // )\n        case 0x5B: square++; break                // [\n        case 0x5D: square--; break                // ]\n        case 0x7B: curly++; break                 // {\n        case 0x7D: curly--; break                 // }\n      }\n    }\n  }\n\n  if (expression === undefined) {\n    expression = exp.slice(0, i).trim();\n  } else if (lastFilterIndex !== 0) {\n    pushFilter();\n  }\n\n  function pushFilter () {\n    (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n    lastFilterIndex = i + 1;\n  }\n\n  if (filters) {\n    for (i = 0; i < filters.length; i++) {\n      expression = wrapFilter(expression, filters[i]);\n    }\n  }\n\n  return expression\n}\n\nfunction wrapFilter (exp, filter) {\n  var i = filter.indexOf('(');\n  if (i < 0) {\n    // _f: resolveFilter\n    return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n  } else {\n    var name = filter.slice(0, i);\n    var args = filter.slice(i + 1);\n    return (\"_f(\\\"\" + name + \"\\\")(\" + exp + \",\" + args)\n  }\n}\n\n/*  */\n\nvar defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g;\nvar regexEscapeRE = /[-.*+?^${}()|[\\]/\\\\]/g;\n\nvar buildRegex = cached(function (delimiters) {\n  var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n  var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n  return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n});\n\nfunction parseText (\n  text,\n  delimiters\n) {\n  var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n  if (!tagRE.test(text)) {\n    return\n  }\n  var tokens = [];\n  var lastIndex = tagRE.lastIndex = 0;\n  var match, index;\n  while ((match = tagRE.exec(text))) {\n    index = match.index;\n    // push text token\n    if (index > lastIndex) {\n      tokens.push(JSON.stringify(text.slice(lastIndex, index)));\n    }\n    // tag token\n    var exp = parseFilters(match[1].trim());\n    tokens.push((\"_s(\" + exp + \")\"));\n    lastIndex = index + match[0].length;\n  }\n  if (lastIndex < text.length) {\n    tokens.push(JSON.stringify(text.slice(lastIndex)));\n  }\n  return tokens.join('+')\n}\n\n/*  */\n\nfunction baseWarn (msg) {\n  console.error((\"[Vue parser]: \" + msg));\n}\n\nfunction pluckModuleFunction (\n  modules,\n  key\n) {\n  return modules\n    ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n    : []\n}\n\nfunction addProp (el, name, value) {\n  (el.props || (el.props = [])).push({ name: name, value: value });\n}\n\nfunction addAttr (el, name, value) {\n  (el.attrs || (el.attrs = [])).push({ name: name, value: value });\n}\n\nfunction addDirective (\n  el,\n  name,\n  rawName,\n  value,\n  arg,\n  modifiers\n) {\n  (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });\n}\n\nfunction addHandler (\n  el,\n  name,\n  value,\n  modifiers,\n  important\n) {\n  // check capture modifier\n  if (modifiers && modifiers.capture) {\n    delete modifiers.capture;\n    name = '!' + name; // mark the event as captured\n  }\n  if (modifiers && modifiers.once) {\n    delete modifiers.once;\n    name = '~' + name; // mark the event as once\n  }\n  var events;\n  if (modifiers && modifiers.native) {\n    delete modifiers.native;\n    events = el.nativeEvents || (el.nativeEvents = {});\n  } else {\n    events = el.events || (el.events = {});\n  }\n  var newHandler = { value: value, modifiers: modifiers };\n  var handlers = events[name];\n  /* istanbul ignore if */\n  if (Array.isArray(handlers)) {\n    important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n  } else if (handlers) {\n    events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n  } else {\n    events[name] = newHandler;\n  }\n}\n\nfunction getBindingAttr (\n  el,\n  name,\n  getStatic\n) {\n  var dynamicValue =\n    getAndRemoveAttr(el, ':' + name) ||\n    getAndRemoveAttr(el, 'v-bind:' + name);\n  if (dynamicValue != null) {\n    return parseFilters(dynamicValue)\n  } else if (getStatic !== false) {\n    var staticValue = getAndRemoveAttr(el, name);\n    if (staticValue != null) {\n      return JSON.stringify(staticValue)\n    }\n  }\n}\n\nfunction getAndRemoveAttr (el, name) {\n  var val;\n  if ((val = el.attrsMap[name]) != null) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      if (list[i].name === name) {\n        list.splice(i, 1);\n        break\n      }\n    }\n  }\n  return val\n}\n\nvar len;\nvar str;\nvar chr;\nvar index$1;\nvar expressionPos;\nvar expressionEndPos;\n\n/**\n * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)\n *\n * for loop possible cases:\n *\n * - test\n * - test[idx]\n * - test[test1[idx]]\n * - test[\"a\"][idx]\n * - xxx.test[a[a].test1[idx]]\n * - test.xxx.a[\"asa\"][test1[idx]]\n *\n */\n\nfunction parseModel (val) {\n  str = val;\n  len = str.length;\n  index$1 = expressionPos = expressionEndPos = 0;\n\n  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n    return {\n      exp: val,\n      idx: null\n    }\n  }\n\n  while (!eof()) {\n    chr = next();\n    /* istanbul ignore if */\n    if (isStringStart(chr)) {\n      parseString(chr);\n    } else if (chr === 0x5B) {\n      parseBracket(chr);\n    }\n  }\n\n  return {\n    exp: val.substring(0, expressionPos),\n    idx: val.substring(expressionPos + 1, expressionEndPos)\n  }\n}\n\nfunction next () {\n  return str.charCodeAt(++index$1)\n}\n\nfunction eof () {\n  return index$1 >= len\n}\n\nfunction isStringStart (chr) {\n  return chr === 0x22 || chr === 0x27\n}\n\nfunction parseBracket (chr) {\n  var inBracket = 1;\n  expressionPos = index$1;\n  while (!eof()) {\n    chr = next();\n    if (isStringStart(chr)) {\n      parseString(chr);\n      continue\n    }\n    if (chr === 0x5B) { inBracket++; }\n    if (chr === 0x5D) { inBracket--; }\n    if (inBracket === 0) {\n      expressionEndPos = index$1;\n      break\n    }\n  }\n}\n\nfunction parseString (chr) {\n  var stringQuote = chr;\n  while (!eof()) {\n    chr = next();\n    if (chr === stringQuote) {\n      break\n    }\n  }\n}\n\n/*  */\n\nvar dirRE = /^v-|^@|^:/;\nvar forAliasRE = /(.*?)\\s+(?:in|of)\\s+(.*)/;\nvar forIteratorRE = /\\((\\{[^}]*\\}|[^,]*),([^,]*)(?:,([^,]*))?\\)/;\nvar bindRE = /^:|^v-bind:/;\nvar onRE = /^@|^v-on:/;\nvar argRE = /:(.*)$/;\nvar modifierRE = /\\.[^.]+/g;\n\nvar decodeHTMLCached = cached(decode);\n\n// configurable state\nvar warn$1;\nvar platformGetTagNamespace;\nvar platformMustUseProp;\nvar platformIsPreTag;\nvar preTransforms;\nvar transforms;\nvar postTransforms;\nvar delimiters;\n\n/**\n * Convert HTML string to AST.\n */\nfunction parse (\n  template,\n  options\n) {\n  warn$1 = options.warn || baseWarn;\n  platformGetTagNamespace = options.getTagNamespace || no;\n  platformMustUseProp = options.mustUseProp || no;\n  platformIsPreTag = options.isPreTag || no;\n  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n  transforms = pluckModuleFunction(options.modules, 'transformNode');\n  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n  delimiters = options.delimiters;\n  var stack = [];\n  var preserveWhitespace = options.preserveWhitespace !== false;\n  var root;\n  var currentParent;\n  var inVPre = false;\n  var inPre = false;\n  var warned = false;\n  parseHTML(template, {\n    expectHTML: options.expectHTML,\n    isUnaryTag: options.isUnaryTag,\n    shouldDecodeNewlines: options.shouldDecodeNewlines,\n    start: function start (tag, attrs, unary) {\n      // check namespace.\n      // inherit parent ns if there is one\n      var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n      // handle IE svg bug\n      /* istanbul ignore if */\n      if (isIE && ns === 'svg') {\n        attrs = guardIESVGBug(attrs);\n      }\n\n      var element = {\n        type: 1,\n        tag: tag,\n        attrsList: attrs,\n        attrsMap: makeAttrsMap(attrs),\n        parent: currentParent,\n        children: []\n      };\n      if (ns) {\n        element.ns = ns;\n      }\n\n      if (isForbiddenTag(element) && !isServerRendering()) {\n        element.forbidden = true;\n        \"development\" !== 'production' && warn$1(\n          'Templates should only be responsible for mapping the state to the ' +\n          'UI. Avoid placing tags with side-effects in your templates, such as ' +\n          \"<\" + tag + \">.\"\n        );\n      }\n\n      // apply pre-transforms\n      for (var i = 0; i < preTransforms.length; i++) {\n        preTransforms[i](element, options);\n      }\n\n      if (!inVPre) {\n        processPre(element);\n        if (element.pre) {\n          inVPre = true;\n        }\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = true;\n      }\n      if (inVPre) {\n        processRawAttrs(element);\n      } else {\n        processFor(element);\n        processIf(element);\n        processOnce(element);\n        processKey(element);\n\n        // determine whether this is a plain element after\n        // removing structural attributes\n        element.plain = !element.key && !attrs.length;\n\n        processRef(element);\n        processSlot(element);\n        processComponent(element);\n        for (var i$1 = 0; i$1 < transforms.length; i$1++) {\n          transforms[i$1](element, options);\n        }\n        processAttrs(element);\n      }\n\n      function checkRootConstraints (el) {\n        if (\"development\" !== 'production' && !warned) {\n          if (el.tag === 'slot' || el.tag === 'template') {\n            warned = true;\n            warn$1(\n              \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n              'contain multiple nodes:\\n' + template\n            );\n          }\n          if (el.attrsMap.hasOwnProperty('v-for')) {\n            warned = true;\n            warn$1(\n              'Cannot use v-for on stateful component root element because ' +\n              'it renders multiple elements:\\n' + template\n            );\n          }\n        }\n      }\n\n      // tree management\n      if (!root) {\n        root = element;\n        checkRootConstraints(root);\n      } else if (!stack.length) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          checkRootConstraints(element);\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else if (\"development\" !== 'production' && !warned) {\n          warned = true;\n          warn$1(\n            \"Component template should contain exactly one root element:\" +\n            \"\\n\\n\" + template + \"\\n\\n\" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\"\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else if (element.slotScope) { // scoped slot\n          currentParent.plain = false;\n          var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n        } else {\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n      if (!unary) {\n        currentParent = element;\n        stack.push(element);\n      }\n      // apply post-transforms\n      for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {\n        postTransforms[i$2](element, options);\n      }\n    },\n\n    end: function end () {\n      // remove trailing whitespace\n      var element = stack[stack.length - 1];\n      var lastNode = element.children[element.children.length - 1];\n      if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {\n        element.children.pop();\n      }\n      // pop stack\n      stack.length -= 1;\n      currentParent = stack[stack.length - 1];\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n    },\n\n    chars: function chars (text) {\n      if (!currentParent) {\n        if (\"development\" !== 'production' && !warned && text === template) {\n          warned = true;\n          warn$1(\n            'Component template requires a root element, rather than just text:\\n\\n' + template\n          );\n        }\n        return\n      }\n      // IE textarea placeholder bug\n      /* istanbul ignore if */\n      if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text) {\n        return\n      }\n      text = inPre || text.trim()\n        ? decodeHTMLCached(text)\n        // only preserve whitespace if its not right after a starting tag\n        : preserveWhitespace && currentParent.children.length ? ' ' : '';\n      if (text) {\n        var expression;\n        if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {\n          currentParent.children.push({\n            type: 2,\n            expression: expression,\n            text: text\n          });\n        } else {\n          currentParent.children.push({\n            type: 3,\n            text: text\n          });\n        }\n      }\n    }\n  });\n  return root\n}\n\nfunction processPre (el) {\n  if (getAndRemoveAttr(el, 'v-pre') != null) {\n    el.pre = true;\n  }\n}\n\nfunction processRawAttrs (el) {\n  var l = el.attrsList.length;\n  if (l) {\n    var attrs = el.attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      attrs[i] = {\n        name: el.attrsList[i].name,\n        value: JSON.stringify(el.attrsList[i].value)\n      };\n    }\n  } else if (!el.pre) {\n    // non root node in pre blocks with no attributes\n    el.plain = true;\n  }\n}\n\nfunction processKey (el) {\n  var exp = getBindingAttr(el, 'key');\n  if (exp) {\n    if (\"development\" !== 'production' && el.tag === 'template') {\n      warn$1(\"<template> cannot be keyed. Place the key on real elements instead.\");\n    }\n    el.key = exp;\n  }\n}\n\nfunction processRef (el) {\n  var ref = getBindingAttr(el, 'ref');\n  if (ref) {\n    el.ref = ref;\n    el.refInFor = checkInFor(el);\n  }\n}\n\nfunction processFor (el) {\n  var exp;\n  if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) {\n      \"development\" !== 'production' && warn$1(\n        (\"Invalid v-for expression: \" + exp)\n      );\n      return\n    }\n    el.for = inMatch[2].trim();\n    var alias = inMatch[1].trim();\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      el.alias = iteratorMatch[1].trim();\n      el.iterator1 = iteratorMatch[2].trim();\n      if (iteratorMatch[3]) {\n        el.iterator2 = iteratorMatch[3].trim();\n      }\n    } else {\n      el.alias = alias;\n    }\n  }\n}\n\nfunction processIf (el) {\n  var exp = getAndRemoveAttr(el, 'v-if');\n  if (exp) {\n    el.if = exp;\n    addIfCondition(el, {\n      exp: exp,\n      block: el\n    });\n  } else {\n    if (getAndRemoveAttr(el, 'v-else') != null) {\n      el.else = true;\n    }\n    var elseif = getAndRemoveAttr(el, 'v-else-if');\n    if (elseif) {\n      el.elseif = elseif;\n    }\n  }\n}\n\nfunction processIfConditions (el, parent) {\n  var prev = findPrevElement(parent.children);\n  if (prev && prev.if) {\n    addIfCondition(prev, {\n      exp: el.elseif,\n      block: el\n    });\n  } else {\n    warn$1(\n      \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n      \"used on element <\" + (el.tag) + \"> without corresponding v-if.\"\n    );\n  }\n}\n\nfunction addIfCondition (el, condition) {\n  if (!el.ifConditions) {\n    el.ifConditions = [];\n  }\n  el.ifConditions.push(condition);\n}\n\nfunction processOnce (el) {\n  var once = getAndRemoveAttr(el, 'v-once');\n  if (once != null) {\n    el.once = true;\n  }\n}\n\nfunction processSlot (el) {\n  if (el.tag === 'slot') {\n    el.slotName = getBindingAttr(el, 'name');\n    if (\"development\" !== 'production' && el.key) {\n      warn$1(\n        \"`key` does not work on <slot> because slots are abstract outlets \" +\n        \"and can possibly expand into multiple elements. \" +\n        \"Use the key on a wrapping element instead.\"\n      );\n    }\n  } else {\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n    }\n    if (el.tag === 'template') {\n      el.slotScope = getAndRemoveAttr(el, 'scope');\n    }\n  }\n}\n\nfunction processComponent (el) {\n  var binding;\n  if ((binding = getBindingAttr(el, 'is'))) {\n    el.component = binding;\n  }\n  if (getAndRemoveAttr(el, 'inline-template') != null) {\n    el.inlineTemplate = true;\n  }\n}\n\nfunction processAttrs (el) {\n  var list = el.attrsList;\n  var i, l, name, rawName, value, arg, modifiers, isProp;\n  for (i = 0, l = list.length; i < l; i++) {\n    name = rawName = list[i].name;\n    value = list[i].value;\n    if (dirRE.test(name)) {\n      // mark element as dynamic\n      el.hasBindings = true;\n      // modifiers\n      modifiers = parseModifiers(name);\n      if (modifiers) {\n        name = name.replace(modifierRE, '');\n      }\n      if (bindRE.test(name)) { // v-bind\n        name = name.replace(bindRE, '');\n        value = parseFilters(value);\n        if (modifiers) {\n          if (modifiers.prop) {\n            isProp = true;\n            name = camelize(name);\n            if (name === 'innerHtml') { name = 'innerHTML'; }\n          }\n          if (modifiers.camel) {\n            name = camelize(name);\n          }\n        }\n        if (isProp || platformMustUseProp(el.tag, name)) {\n          addProp(el, name, value);\n        } else {\n          addAttr(el, name, value);\n        }\n      } else if (onRE.test(name)) { // v-on\n        name = name.replace(onRE, '');\n        addHandler(el, name, value, modifiers);\n      } else { // normal directives\n        name = name.replace(dirRE, '');\n        // parse arg\n        var argMatch = name.match(argRE);\n        if (argMatch && (arg = argMatch[1])) {\n          name = name.slice(0, -(arg.length + 1));\n        }\n        addDirective(el, name, rawName, value, arg, modifiers);\n        if (\"development\" !== 'production' && name === 'model') {\n          checkForAliasModel(el, value);\n        }\n      }\n    } else {\n      // literal attribute\n      {\n        var expression = parseText(value, delimiters);\n        if (expression) {\n          warn$1(\n            name + \"=\\\"\" + value + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.'\n          );\n        }\n      }\n      addAttr(el, name, JSON.stringify(value));\n    }\n  }\n}\n\nfunction checkInFor (el) {\n  var parent = el;\n  while (parent) {\n    if (parent.for !== undefined) {\n      return true\n    }\n    parent = parent.parent;\n  }\n  return false\n}\n\nfunction parseModifiers (name) {\n  var match = name.match(modifierRE);\n  if (match) {\n    var ret = {};\n    match.forEach(function (m) { ret[m.slice(1)] = true; });\n    return ret\n  }\n}\n\nfunction makeAttrsMap (attrs) {\n  var map = {};\n  for (var i = 0, l = attrs.length; i < l; i++) {\n    if (\"development\" !== 'production' && map[attrs[i].name] && !isIE) {\n      warn$1('duplicate attribute: ' + attrs[i].name);\n    }\n    map[attrs[i].name] = attrs[i].value;\n  }\n  return map\n}\n\nfunction findPrevElement (children) {\n  var i = children.length;\n  while (i--) {\n    if (children[i].tag) { return children[i] }\n  }\n}\n\nfunction isForbiddenTag (el) {\n  return (\n    el.tag === 'style' ||\n    (el.tag === 'script' && (\n      !el.attrsMap.type ||\n      el.attrsMap.type === 'text/javascript'\n    ))\n  )\n}\n\nvar ieNSBug = /^xmlns:NS\\d+/;\nvar ieNSPrefix = /^NS\\d+:/;\n\n/* istanbul ignore next */\nfunction guardIESVGBug (attrs) {\n  var res = [];\n  for (var i = 0; i < attrs.length; i++) {\n    var attr = attrs[i];\n    if (!ieNSBug.test(attr.name)) {\n      attr.name = attr.name.replace(ieNSPrefix, '');\n      res.push(attr);\n    }\n  }\n  return res\n}\n\nfunction checkForAliasModel (el, value) {\n  var _el = el;\n  while (_el) {\n    if (_el.for && _el.alias === value) {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"You are binding v-model directly to a v-for iteration alias. \" +\n        \"This will not be able to modify the v-for source array because \" +\n        \"writing to the alias is like modifying a function local variable. \" +\n        \"Consider using an array of objects and use v-model on an object property instead.\"\n      );\n    }\n    _el = _el.parent;\n  }\n}\n\n/*  */\n\nvar isStaticKey;\nvar isPlatformReservedTag;\n\nvar genStaticKeysCached = cached(genStaticKeys$1);\n\n/**\n * Goal of the optimizer: walk the generated template AST tree\n * and detect sub-trees that are purely static, i.e. parts of\n * the DOM that never needs to change.\n *\n * Once we detect these sub-trees, we can:\n *\n * 1. Hoist them into constants, so that we no longer need to\n *    create fresh nodes for them on each re-render;\n * 2. Completely skip them in the patching process.\n */\nfunction optimize (root, options) {\n  if (!root) { return }\n  isStaticKey = genStaticKeysCached(options.staticKeys || '');\n  isPlatformReservedTag = options.isReservedTag || no;\n  // first pass: mark all non-static nodes.\n  markStatic(root);\n  // second pass: mark static roots.\n  markStaticRoots(root, false);\n}\n\nfunction genStaticKeys$1 (keys) {\n  return makeMap(\n    'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +\n    (keys ? ',' + keys : '')\n  )\n}\n\nfunction markStatic (node) {\n  node.static = isStatic(node);\n  if (node.type === 1) {\n    // do not make component slot content static. this avoids\n    // 1. components not able to mutate slot nodes\n    // 2. static slot content fails for hot-reloading\n    if (\n      !isPlatformReservedTag(node.tag) &&\n      node.tag !== 'slot' &&\n      node.attrsMap['inline-template'] == null\n    ) {\n      return\n    }\n    for (var i = 0, l = node.children.length; i < l; i++) {\n      var child = node.children[i];\n      markStatic(child);\n      if (!child.static) {\n        node.static = false;\n      }\n    }\n  }\n}\n\nfunction markStaticRoots (node, isInFor) {\n  if (node.type === 1) {\n    if (node.static || node.once) {\n      node.staticInFor = isInFor;\n    }\n    // For a node to qualify as a static root, it should have children that\n    // are not just static text. Otherwise the cost of hoisting out will\n    // outweigh the benefits and it's better off to just always render it fresh.\n    if (node.static && node.children.length && !(\n      node.children.length === 1 &&\n      node.children[0].type === 3\n    )) {\n      node.staticRoot = true;\n      return\n    } else {\n      node.staticRoot = false;\n    }\n    if (node.children) {\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        markStaticRoots(node.children[i], isInFor || !!node.for);\n      }\n    }\n    if (node.ifConditions) {\n      walkThroughConditionsBlocks(node.ifConditions, isInFor);\n    }\n  }\n}\n\nfunction walkThroughConditionsBlocks (conditionBlocks, isInFor) {\n  for (var i = 1, len = conditionBlocks.length; i < len; i++) {\n    markStaticRoots(conditionBlocks[i].block, isInFor);\n  }\n}\n\nfunction isStatic (node) {\n  if (node.type === 2) { // expression\n    return false\n  }\n  if (node.type === 3) { // text\n    return true\n  }\n  return !!(node.pre || (\n    !node.hasBindings && // no dynamic bindings\n    !node.if && !node.for && // not v-if or v-for or v-else\n    !isBuiltInTag(node.tag) && // not a built-in\n    isPlatformReservedTag(node.tag) && // not a component\n    !isDirectChildOfTemplateFor(node) &&\n    Object.keys(node).every(isStaticKey)\n  ))\n}\n\nfunction isDirectChildOfTemplateFor (node) {\n  while (node.parent) {\n    node = node.parent;\n    if (node.tag !== 'template') {\n      return false\n    }\n    if (node.for) {\n      return true\n    }\n  }\n  return false\n}\n\n/*  */\n\nvar fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\nvar simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/;\n\n// keyCode aliases\nvar keyCodes = {\n  esc: 27,\n  tab: 9,\n  enter: 13,\n  space: 32,\n  up: 38,\n  left: 37,\n  right: 39,\n  down: 40,\n  'delete': [8, 46]\n};\n\nvar modifierCode = {\n  stop: '$event.stopPropagation();',\n  prevent: '$event.preventDefault();',\n  self: 'if($event.target !== $event.currentTarget)return;',\n  ctrl: 'if(!$event.ctrlKey)return;',\n  shift: 'if(!$event.shiftKey)return;',\n  alt: 'if(!$event.altKey)return;',\n  meta: 'if(!$event.metaKey)return;'\n};\n\nfunction genHandlers (events, native) {\n  var res = native ? 'nativeOn:{' : 'on:{';\n  for (var name in events) {\n    res += \"\\\"\" + name + \"\\\":\" + (genHandler(name, events[name])) + \",\";\n  }\n  return res.slice(0, -1) + '}'\n}\n\nfunction genHandler (\n  name,\n  handler\n) {\n  if (!handler) {\n    return 'function(){}'\n  } else if (Array.isArray(handler)) {\n    return (\"[\" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + \"]\")\n  } else if (!handler.modifiers) {\n    return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)\n      ? handler.value\n      : (\"function($event){\" + (handler.value) + \"}\")\n  } else {\n    var code = '';\n    var keys = [];\n    for (var key in handler.modifiers) {\n      if (modifierCode[key]) {\n        code += modifierCode[key];\n      } else {\n        keys.push(key);\n      }\n    }\n    if (keys.length) {\n      code = genKeyFilter(keys) + code;\n    }\n    var handlerCode = simplePathRE.test(handler.value)\n      ? handler.value + '($event)'\n      : handler.value;\n    return 'function($event){' + code + handlerCode + '}'\n  }\n}\n\nfunction genKeyFilter (keys) {\n  return (\"if(\" + (keys.map(genFilterCode).join('&&')) + \")return;\")\n}\n\nfunction genFilterCode (key) {\n  var keyVal = parseInt(key, 10);\n  if (keyVal) {\n    return (\"$event.keyCode!==\" + keyVal)\n  }\n  var alias = keyCodes[key];\n  return (\"_k($event.keyCode,\" + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + \")\")\n}\n\n/*  */\n\nfunction bind$2 (el, dir) {\n  el.wrapData = function (code) {\n    return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + \")\")\n  };\n}\n\nvar baseDirectives = {\n  bind: bind$2,\n  cloak: noop\n};\n\n/*  */\n\n// configurable state\nvar warn$2;\nvar transforms$1;\nvar dataGenFns;\nvar platformDirectives$1;\nvar staticRenderFns;\nvar onceCount;\nvar currentOptions;\n\nfunction generate (\n  ast,\n  options\n) {\n  // save previous staticRenderFns so generate calls can be nested\n  var prevStaticRenderFns = staticRenderFns;\n  var currentStaticRenderFns = staticRenderFns = [];\n  var prevOnceCount = onceCount;\n  onceCount = 0;\n  currentOptions = options;\n  warn$2 = options.warn || baseWarn;\n  transforms$1 = pluckModuleFunction(options.modules, 'transformCode');\n  dataGenFns = pluckModuleFunction(options.modules, 'genData');\n  platformDirectives$1 = options.directives || {};\n  var code = ast ? genElement(ast) : '_h(\"div\")';\n  staticRenderFns = prevStaticRenderFns;\n  onceCount = prevOnceCount;\n  return {\n    render: (\"with(this){return \" + code + \"}\"),\n    staticRenderFns: currentStaticRenderFns\n  }\n}\n\nfunction genElement (el) {\n  if (el.staticRoot && !el.staticProcessed) {\n    return genStatic(el)\n  } else if (el.once && !el.onceProcessed) {\n    return genOnce(el)\n  } else if (el.for && !el.forProcessed) {\n    return genFor(el)\n  } else if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.tag === 'template' && !el.slotTarget) {\n    return genChildren(el) || 'void 0'\n  } else if (el.tag === 'slot') {\n    return genSlot(el)\n  } else {\n    // component or element\n    var code;\n    if (el.component) {\n      code = genComponent(el.component, el);\n    } else {\n      var data = el.plain ? undefined : genData(el);\n\n      var children = el.inlineTemplate ? null : genChildren(el);\n      code = \"_h('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n    }\n    // module transforms\n    for (var i = 0; i < transforms$1.length; i++) {\n      code = transforms$1[i](el, code);\n    }\n    return code\n  }\n}\n\n// hoist static sub-trees out\nfunction genStatic (el) {\n  el.staticProcessed = true;\n  staticRenderFns.push((\"with(this){return \" + (genElement(el)) + \"}\"));\n  return (\"_m(\" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n}\n\n// v-once\nfunction genOnce (el) {\n  el.onceProcessed = true;\n  if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.staticInFor) {\n    var key = '';\n    var parent = el.parent;\n    while (parent) {\n      if (parent.for) {\n        key = parent.key;\n        break\n      }\n      parent = parent.parent;\n    }\n    if (!key) {\n      \"development\" !== 'production' && warn$2(\n        \"v-once can only be used inside v-for that is keyed. \"\n      );\n      return genElement(el)\n    }\n    return (\"_o(\" + (genElement(el)) + \",\" + (onceCount++) + (key ? (\",\" + key) : \"\") + \")\")\n  } else {\n    return genStatic(el)\n  }\n}\n\nfunction genIf (el) {\n  el.ifProcessed = true; // avoid recursion\n  return genIfConditions(el.ifConditions.slice())\n}\n\nfunction genIfConditions (conditions) {\n  if (!conditions.length) {\n    return '_e()'\n  }\n\n  var condition = conditions.shift();\n  if (condition.exp) {\n    return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions)))\n  } else {\n    return (\"\" + (genTernaryExp(condition.block)))\n  }\n\n  // v-if with v-once should generate code like (a)?_m(0):_m(1)\n  function genTernaryExp (el) {\n    return el.once ? genOnce(el) : genElement(el)\n  }\n}\n\nfunction genFor (el) {\n  var exp = el.for;\n  var alias = el.alias;\n  var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n  var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n  el.forProcessed = true; // avoid recursion\n  return \"_l((\" + exp + \"),\" +\n    \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n      \"return \" + (genElement(el)) +\n    '})'\n}\n\nfunction genData (el) {\n  var data = '{';\n\n  // directives first.\n  // directives may mutate the el's other properties before they are generated.\n  var dirs = genDirectives(el);\n  if (dirs) { data += dirs + ','; }\n\n  // key\n  if (el.key) {\n    data += \"key:\" + (el.key) + \",\";\n  }\n  // ref\n  if (el.ref) {\n    data += \"ref:\" + (el.ref) + \",\";\n  }\n  if (el.refInFor) {\n    data += \"refInFor:true,\";\n  }\n  // pre\n  if (el.pre) {\n    data += \"pre:true,\";\n  }\n  // record original tag name for components using \"is\" attribute\n  if (el.component) {\n    data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n  }\n  // module data generation functions\n  for (var i = 0; i < dataGenFns.length; i++) {\n    data += dataGenFns[i](el);\n  }\n  // attributes\n  if (el.attrs) {\n    data += \"attrs:{\" + (genProps(el.attrs)) + \"},\";\n  }\n  // DOM props\n  if (el.props) {\n    data += \"domProps:{\" + (genProps(el.props)) + \"},\";\n  }\n  // event handlers\n  if (el.events) {\n    data += (genHandlers(el.events)) + \",\";\n  }\n  if (el.nativeEvents) {\n    data += (genHandlers(el.nativeEvents, true)) + \",\";\n  }\n  // slot target\n  if (el.slotTarget) {\n    data += \"slot:\" + (el.slotTarget) + \",\";\n  }\n  // scoped slots\n  if (el.scopedSlots) {\n    data += (genScopedSlots(el.scopedSlots)) + \",\";\n  }\n  // inline-template\n  if (el.inlineTemplate) {\n    var inlineTemplate = genInlineTemplate(el);\n    if (inlineTemplate) {\n      data += inlineTemplate + \",\";\n    }\n  }\n  data = data.replace(/,$/, '') + '}';\n  // v-bind data wrap\n  if (el.wrapData) {\n    data = el.wrapData(data);\n  }\n  return data\n}\n\nfunction genDirectives (el) {\n  var dirs = el.directives;\n  if (!dirs) { return }\n  var res = 'directives:[';\n  var hasRuntime = false;\n  var i, l, dir, needRuntime;\n  for (i = 0, l = dirs.length; i < l; i++) {\n    dir = dirs[i];\n    needRuntime = true;\n    var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];\n    if (gen) {\n      // compile-time directive that manipulates AST.\n      // returns true if it also needs a runtime counterpart.\n      needRuntime = !!gen(el, dir, warn$2);\n    }\n    if (needRuntime) {\n      hasRuntime = true;\n      res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\\\"\" + (dir.arg) + \"\\\"\") : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n    }\n  }\n  if (hasRuntime) {\n    return res.slice(0, -1) + ']'\n  }\n}\n\nfunction genInlineTemplate (el) {\n  var ast = el.children[0];\n  if (\"development\" !== 'production' && (\n    el.children.length > 1 || ast.type !== 1\n  )) {\n    warn$2('Inline-template components must have exactly one child element.');\n  }\n  if (ast.type === 1) {\n    var inlineRenderFns = generate(ast, currentOptions);\n    return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n  }\n}\n\nfunction genScopedSlots (slots) {\n  return (\"scopedSlots:{\" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + \"}\")\n}\n\nfunction genScopedSlot (key, el) {\n  return key + \":function(\" + (String(el.attrsMap.scope)) + \"){\" +\n    \"return \" + (el.tag === 'template'\n      ? genChildren(el) || 'void 0'\n      : genElement(el)) + \"}\"\n}\n\nfunction genChildren (el) {\n  if (el.children.length) {\n    return '[' + el.children.map(genNode).join(',') + ']'\n  }\n}\n\nfunction genNode (node) {\n  if (node.type === 1) {\n    return genElement(node)\n  } else {\n    return genText(node)\n  }\n}\n\nfunction genText (text) {\n  return text.type === 2\n    ? text.expression // no need for () because already wrapped in _s()\n    : transformSpecialNewlines(JSON.stringify(text.text))\n}\n\nfunction genSlot (el) {\n  var slotName = el.slotName || '\"default\"';\n  var children = genChildren(el);\n  return (\"_t(\" + slotName + (children ? (\",\" + children) : '') + (el.attrs ? ((children ? '' : ',null') + \",{\" + (el.attrs.map(function (a) { return ((camelize(a.name)) + \":\" + (a.value)); }).join(',')) + \"}\") : '') + \")\")\n}\n\n// componentName is el.component, take it as argument to shun flow's pessimistic refinement\nfunction genComponent (componentName, el) {\n  var children = el.inlineTemplate ? null : genChildren(el);\n  return (\"_h(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}\n\nfunction genProps (props) {\n  var res = '';\n  for (var i = 0; i < props.length; i++) {\n    var prop = props[i];\n    res += \"\\\"\" + (prop.name) + \"\\\":\" + (transformSpecialNewlines(prop.value)) + \",\";\n  }\n  return res.slice(0, -1)\n}\n\n// #3895, #4268\nfunction transformSpecialNewlines (text) {\n  return text\n    .replace(/\\u2028/g, '\\\\u2028')\n    .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/*  */\n\n/**\n * Compile a template.\n */\nfunction compile$1 (\n  template,\n  options\n) {\n  var ast = parse(template.trim(), options);\n  optimize(ast, options);\n  var code = generate(ast, options);\n  return {\n    ast: ast,\n    render: code.render,\n    staticRenderFns: code.staticRenderFns\n  }\n}\n\n/*  */\n\n// operators like typeof, instanceof and in are allowed\nvar prohibitedKeywordRE = new RegExp('\\\\b' + (\n  'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n  'super,throw,while,yield,delete,export,import,return,switch,default,' +\n  'extends,finally,continue,debugger,function,arguments'\n).split(',').join('\\\\b|\\\\b') + '\\\\b');\n// check valid identifier for v-for\nvar identRE = /[A-Za-z_$][\\w$]*/;\n// strip strings in expressions\nvar stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n// detect problematic expressions in a template\nfunction detectErrors (ast) {\n  var errors = [];\n  if (ast) {\n    checkNode(ast, errors);\n  }\n  return errors\n}\n\nfunction checkNode (node, errors) {\n  if (node.type === 1) {\n    for (var name in node.attrsMap) {\n      if (dirRE.test(name)) {\n        var value = node.attrsMap[name];\n        if (value) {\n          if (name === 'v-for') {\n            checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), errors);\n          } else {\n            checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), errors);\n          }\n        }\n      }\n    }\n    if (node.children) {\n      for (var i = 0; i < node.children.length; i++) {\n        checkNode(node.children[i], errors);\n      }\n    }\n  } else if (node.type === 2) {\n    checkExpression(node.expression, node.text, errors);\n  }\n}\n\nfunction checkFor (node, text, errors) {\n  checkExpression(node.for || '', text, errors);\n  checkIdentifier(node.alias, 'v-for alias', text, errors);\n  checkIdentifier(node.iterator1, 'v-for iterator', text, errors);\n  checkIdentifier(node.iterator2, 'v-for iterator', text, errors);\n}\n\nfunction checkIdentifier (ident, type, text, errors) {\n  if (typeof ident === 'string' && !identRE.test(ident)) {\n    errors.push((\"- invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + text));\n  }\n}\n\nfunction checkExpression (exp, text, errors) {\n  try {\n    new Function((\"return \" + exp));\n  } catch (e) {\n    var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n    if (keywordMatch) {\n      errors.push(\n        \"- avoid using JavaScript keyword as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + text\n      );\n    } else {\n      errors.push((\"- invalid expression: \" + text));\n    }\n  }\n}\n\n/*  */\n\nfunction transformNode (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticClass = getAndRemoveAttr(el, 'class');\n  if (\"development\" !== 'production' && staticClass) {\n    var expression = parseText(staticClass, options.delimiters);\n    if (expression) {\n      warn(\n        \"class=\\\"\" + staticClass + \"\\\": \" +\n        'Interpolation inside attributes has been removed. ' +\n        'Use v-bind or the colon shorthand instead. For example, ' +\n        'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.'\n      );\n    }\n  }\n  if (staticClass) {\n    el.staticClass = JSON.stringify(staticClass);\n  }\n  var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n  if (classBinding) {\n    el.classBinding = classBinding;\n  }\n}\n\nfunction genData$1 (el) {\n  var data = '';\n  if (el.staticClass) {\n    data += \"staticClass:\" + (el.staticClass) + \",\";\n  }\n  if (el.classBinding) {\n    data += \"class:\" + (el.classBinding) + \",\";\n  }\n  return data\n}\n\nvar klass$1 = {\n  staticKeys: ['staticClass'],\n  transformNode: transformNode,\n  genData: genData$1\n};\n\n/*  */\n\nfunction transformNode$1 (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticStyle = getAndRemoveAttr(el, 'style');\n  if (staticStyle) {\n    /* istanbul ignore if */\n    {\n      var expression = parseText(staticStyle, options.delimiters);\n      if (expression) {\n        warn(\n          \"style=\\\"\" + staticStyle + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.'\n        );\n      }\n    }\n    el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n  }\n\n  var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n  if (styleBinding) {\n    el.styleBinding = styleBinding;\n  }\n}\n\nfunction genData$2 (el) {\n  var data = '';\n  if (el.staticStyle) {\n    data += \"staticStyle:\" + (el.staticStyle) + \",\";\n  }\n  if (el.styleBinding) {\n    data += \"style:(\" + (el.styleBinding) + \"),\";\n  }\n  return data\n}\n\nvar style$1 = {\n  staticKeys: ['staticStyle'],\n  transformNode: transformNode$1,\n  genData: genData$2\n};\n\nvar modules$1 = [\n  klass$1,\n  style$1\n];\n\n/*  */\n\nvar warn$3;\n\nfunction model$1 (\n  el,\n  dir,\n  _warn\n) {\n  warn$3 = _warn;\n  var value = dir.value;\n  var modifiers = dir.modifiers;\n  var tag = el.tag;\n  var type = el.attrsMap.type;\n  {\n    var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n    if (tag === 'input' && dynamicType) {\n      warn$3(\n        \"<input :type=\\\"\" + dynamicType + \"\\\" v-model=\\\"\" + value + \"\\\">:\\n\" +\n        \"v-model does not support dynamic input types. Use v-if branches instead.\"\n      );\n    }\n  }\n  if (tag === 'select') {\n    genSelect(el, value, modifiers);\n  } else if (tag === 'input' && type === 'checkbox') {\n    genCheckboxModel(el, value, modifiers);\n  } else if (tag === 'input' && type === 'radio') {\n    genRadioModel(el, value, modifiers);\n  } else {\n    genDefaultModel(el, value, modifiers);\n  }\n  // ensure runtime directive metadata\n  return true\n}\n\nfunction genCheckboxModel (\n  el,\n  value,\n  modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n  var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n  addProp(el, 'checked',\n    \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" +\n      \":_q(\" + value + \",\" + trueValueBinding + \")\"\n  );\n  addHandler(el, 'change',\n    \"var $$a=\" + value + \",\" +\n        '$$el=$event.target,' +\n        \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n    'if(Array.isArray($$a)){' +\n      \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n          '$$i=_i($$a,$$v);' +\n      \"if($$c){$$i<0&&(\" + value + \"=$$a.concat($$v))}\" +\n      \"else{$$i>-1&&(\" + value + \"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}\" +\n    \"}else{\" + value + \"=$$c}\",\n    null, true\n  );\n}\n\nfunction genRadioModel (\n    el,\n    value,\n    modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n  addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n  addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n}\n\nfunction genDefaultModel (\n  el,\n  value,\n  modifiers\n) {\n  {\n    if (el.tag === 'input' && el.attrsMap.value) {\n      warn$3(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" value=\\\"\" + (el.attrsMap.value) + \"\\\">:\\n\" +\n        'inline value attributes will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n    if (el.tag === 'textarea' && el.children.length) {\n      warn$3(\n        \"<textarea v-model=\\\"\" + value + \"\\\">:\\n\" +\n        'inline content inside <textarea> will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n  }\n\n  var type = el.attrsMap.type;\n  var ref = modifiers || {};\n  var lazy = ref.lazy;\n  var number = ref.number;\n  var trim = ref.trim;\n  var event = lazy || (isIE && type === 'range') ? 'change' : 'input';\n  var needCompositionGuard = !lazy && type !== 'range';\n  var isNative = el.tag === 'input' || el.tag === 'textarea';\n\n  var valueExpression = isNative\n    ? (\"$event.target.value\" + (trim ? '.trim()' : ''))\n    : trim ? \"(typeof $event === 'string' ? $event.trim() : $event)\" : \"$event\";\n  valueExpression = number || type === 'number'\n    ? (\"_n(\" + valueExpression + \")\")\n    : valueExpression;\n  var code = genAssignmentCode(value, valueExpression);\n  if (isNative && needCompositionGuard) {\n    code = \"if($event.target.composing)return;\" + code;\n  }\n  // inputs with type=\"file\" are read only and setting the input's\n  // value will throw an error.\n  if (\"development\" !== 'production' &&\n      type === 'file') {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n      \"File inputs are read only. Use a v-on:change listener instead.\"\n    );\n  }\n  addProp(el, 'value', isNative ? (\"_s(\" + value + \")\") : (\"(\" + value + \")\"));\n  addHandler(el, event, code, null, true);\n}\n\nfunction genSelect (\n    el,\n    value,\n    modifiers\n) {\n  {\n    el.children.some(checkOptionWarning);\n  }\n\n  var number = modifiers && modifiers.number;\n  var assignment = \"Array.prototype.filter\" +\n    \".call($event.target.options,function(o){return o.selected})\" +\n    \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n    \"return \" + (number ? '_n(val)' : 'val') + \"})\" +\n    (el.attrsMap.multiple == null ? '[0]' : '');\n\n  var code = genAssignmentCode(value, assignment);\n  addHandler(el, 'change', code, null, true);\n}\n\nfunction checkOptionWarning (option) {\n  if (option.type === 1 &&\n    option.tag === 'option' &&\n    option.attrsMap.selected != null) {\n    warn$3(\n      \"<select v-model=\\\"\" + (option.parent.attrsMap['v-model']) + \"\\\">:\\n\" +\n      'inline selected attributes on <option> will be ignored when using v-model. ' +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n    return true\n  }\n  return false\n}\n\nfunction genAssignmentCode (value, assignment) {\n  var modelRs = parseModel(value);\n  if (modelRs.idx === null) {\n    return (value + \"=\" + assignment)\n  } else {\n    return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n      \"if (!Array.isArray($$exp)){\" +\n        value + \"=\" + assignment + \"}\" +\n      \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n  }\n}\n\n/*  */\n\nfunction text (el, dir) {\n  if (dir.value) {\n    addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\n/*  */\n\nfunction html (el, dir) {\n  if (dir.value) {\n    addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\nvar directives$1 = {\n  model: model$1,\n  text: text,\n  html: html\n};\n\n/*  */\n\nvar cache = Object.create(null);\n\nvar baseOptions = {\n  expectHTML: true,\n  modules: modules$1,\n  staticKeys: genStaticKeys(modules$1),\n  directives: directives$1,\n  isReservedTag: isReservedTag,\n  isUnaryTag: isUnaryTag,\n  mustUseProp: mustUseProp,\n  getTagNamespace: getTagNamespace,\n  isPreTag: isPreTag\n};\n\nfunction compile$$1 (\n  template,\n  options\n) {\n  options = options\n    ? extend(extend({}, baseOptions), options)\n    : baseOptions;\n  return compile$1(template, options)\n}\n\nfunction compileToFunctions (\n  template,\n  options,\n  vm\n) {\n  var _warn = (options && options.warn) || warn;\n  // detect possible CSP restriction\n  /* istanbul ignore if */\n  {\n    try {\n      new Function('return 1');\n    } catch (e) {\n      if (e.toString().match(/unsafe-eval|CSP/)) {\n        _warn(\n          'It seems you are using the standalone build of Vue.js in an ' +\n          'environment with Content Security Policy that prohibits unsafe-eval. ' +\n          'The template compiler cannot work in this environment. Consider ' +\n          'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n          'templates into render functions.'\n        );\n      }\n    }\n  }\n  var key = options && options.delimiters\n    ? String(options.delimiters) + template\n    : template;\n  if (cache[key]) {\n    return cache[key]\n  }\n  var res = {};\n  var compiled = compile$$1(template, options);\n  res.render = makeFunction(compiled.render);\n  var l = compiled.staticRenderFns.length;\n  res.staticRenderFns = new Array(l);\n  for (var i = 0; i < l; i++) {\n    res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);\n  }\n  {\n    if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {\n      _warn(\n        \"failed to compile template:\\n\\n\" + template + \"\\n\\n\" +\n        detectErrors(compiled.ast).join('\\n') +\n        '\\n\\n',\n        vm\n      );\n    }\n  }\n  return (cache[key] = res)\n}\n\nfunction makeFunction (code) {\n  try {\n    return new Function(code)\n  } catch (e) {\n    return noop\n  }\n}\n\n/*  */\n\nvar idToTemplate = cached(function (id) {\n  var el = query(id);\n  return el && el.innerHTML\n});\n\nvar mount = Vue$3.prototype.$mount;\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && query(el);\n\n  /* istanbul ignore if */\n  if (el === document.body || el === document.documentElement) {\n    \"development\" !== 'production' && warn(\n      \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n    );\n    return this\n  }\n\n  var options = this.$options;\n  // resolve template/el and convert to render function\n  if (!options.render) {\n    var template = options.template;\n    if (template) {\n      if (typeof template === 'string') {\n        if (template.charAt(0) === '#') {\n          template = idToTemplate(template);\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !template) {\n            warn(\n              (\"Template element not found or is empty: \" + (options.template)),\n              this\n            );\n          }\n        }\n      } else if (template.nodeType) {\n        template = template.innerHTML;\n      } else {\n        {\n          warn('invalid template option:' + template, this);\n        }\n        return this\n      }\n    } else if (el) {\n      template = getOuterHTML(el);\n    }\n    if (template) {\n      var ref = compileToFunctions(template, {\n        warn: warn,\n        shouldDecodeNewlines: shouldDecodeNewlines,\n        delimiters: options.delimiters\n      }, this);\n      var render = ref.render;\n      var staticRenderFns = ref.staticRenderFns;\n      options.render = render;\n      options.staticRenderFns = staticRenderFns;\n    }\n  }\n  return mount.call(this, el, hydrating)\n};\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n */\nfunction getOuterHTML (el) {\n  if (el.outerHTML) {\n    return el.outerHTML\n  } else {\n    var container = document.createElement('div');\n    container.appendChild(el.cloneNode(true));\n    return container.innerHTML\n  }\n}\n\nVue$3.compile = compileToFunctions;\n\nreturn Vue$3;\n\n})));"
  },
  {
    "path": "local-sdks/README.md",
    "content": "# 注意事项\n\n1. sdk文件夹里一共5个js文件需要重新部署\n2. RongIMLib 页面 src 引入，依赖的 protobuf 通过 init 参数传入，文档里有写具体的格式，请注意\n3. Libamr、RongEmoji、RongIMVoice 其他均为页面直接src并且无其他依赖\n4. 提供 im.html、emoji.html、voice.html 三个测试页面，重新部署后可进行直接测试确认\n\n\n# 说明\n\n请访问官方获取最新版本的 sdk 文件，地址 http://www.rongcloud.cn/docs/web.html#sdk"
  },
  {
    "path": "local-sdks/emoji.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Emoji</title>\n</head>\n<body>\n\n<style>\n#supportList{\n\tbackground:#f5f5f5;\n\tfont-size:12px;\n\tline-height: 2;\n}\t\n</style>\n\t\n<!-- <script src=\"./lib/RongEmoji-dev.js\"></script>  -->\n<script src=\"./sdk/RongEmoji-2.2.5.min.js\"></script>\n\n<h1>Emoji</h1>\n<h3>官网文档：<a href=\"http://www.rongcloud.cn/docs/web.html#emoji\">http://www.rongcloud.cn/docs/web.html#emoji</a></h3>\n\n<h2>融云消息 message 里的 emoji 说明</h2>\n<ol>\n\t<li>发消息 ，直接发送 😀 原生 emoji 字符</li>\n\t<li>Web SDK 接收消息会被转码成 “uf600” 格式</li>\n\t<li>emoji SDK 内置了128个emoji表情的图片，也可自行扩展配置</li>\n\t<li>特殊说明：emoji图片提供的是一个质量很差的版本，因为版权问题，如果要商用，请自行解决版权问题。</li>\n\t<li id=\"supportList\"></li>\n</ol>\n\n\n<h3>测试 ([狞笑]不支持，[露齿而笑]支持)</h3>\n\n<pre class=\"code\" id=\"show\"></pre>\n\n<script>\ntest(RongIMLib.RongIMEmoji);\n\nfunction test(RongIMEmoji){\n\tRongIMEmoji.init();\n\n\n\tvar list = document.querySelector('#supportList');\n\t\tlist.innerHTML = \"支持的128：\";\n\t\tfor(var i=0;i<RongIMEmoji.emojis.length;i++){\n\t\t\tlist.appendChild(RongIMEmoji.emojis[i]);\n\t\t}\n\n\tvar t = document.querySelector('#show');\n\n\tvar str = \"[狞笑] [露齿而笑]  测试Emoji\";\n\n\n\t//symbolToEmoji\n\tt.innerHTML += \"symbolToEmoji \\n\";\n\n\tstr = RongIMEmoji.symbolToEmoji(str);\n\tt.innerHTML += \"\\t\" + str + \"\\n\\n\";\n\n\n\t//emojiToSymbol\n\tt.innerHTML += \"emojiToSymbol \\n\";\n\n\tstr = RongIMEmoji.emojiToSymbol(str);\n\tt.innerHTML += \"\\t\" + str + \"\\n\\n\";\t\n\n\n\n\t//emojiToHTML\n\tvar str = \"我收到了一个表情 \\uf600 \\uf601 很酷\";\n\tt.innerHTML += \"emojiToHTML \\n\";\n\tstr = RongIMEmoji.emojiToHTML(str);\n\tt.innerHTML += \"\\t\" + str + \"\\n\\n\";\t\n\n\n\n\t//symbolToHTML\n\tt.innerHTML += \"symbolToHTML \\n\";\n\n\tvar str = \"[狞笑] [露齿而笑]  测试Emoji\";\n\tstr = RongIMEmoji.symbolToHTML(str);\n\tt.innerHTML +=  \"\\t\" + str + \"\\n\";\n}\t\n</script>\n\n<!-- require load -->\n<!-- <script src=\"lib/require.js\"></script>\n<script>\nrequire.config({\n    paths: {\n    \tRongIMEmoji: './lib/RongEmoji-dev'\n    }\n});\n\nrequire(['RongIMEmoji'], function(RongIMEmoji) {\n    test(RongIMEmoji);\n});\t\n</script> -->\n</body>\n</html>"
  },
  {
    "path": "local-sdks/im.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>connect，receive message</title>\n</head>\n<body>\n\n<h1>Web IM SDK</h1>\n<h3>官网文档：<a href=\"http://www.rongcloud.cn/docs/web.html\">http://www.rongcloud.cn/docs/web.html</a></h3>\n\n\n<style>\nbody{\n\tfont-size:80%;\n}\n.panel span{\n\tdisplay:inline-block;\t\n\twidth:60px;\n}\n.show{\n\tpadding:10px;\n\twidth:98%;\n\tdisplay:inline-block;\n\toverflow:hidden;\n\tborder:1px solid #ccc;\n}\n.show h3{\n\ttext-indent:10px;\n}\n.show pre{\n\tborder-top:1px dotted #ccc;\n\tpadding:5px 0 0 10px;\n\tline-height:1.5;\n\tcolor:#333;\n\tbackground:#f5f5f5;\n}\n</style>\n\n<div class=\"show\" id=\"show\"></div>\n\n<script src=\"./sdk/RongIMLib-2.5.3.js\"></script>\n\n<script>\nvar t1 = new Date().getTime();\n\ninit();\n\nfunction showInfo(str){\n\tvar t = document.getElementById(\"show\");\n\tvar dt = new Date().getTime() - t1 + \" ms 后: \"\n\tt.innerHTML += dt + str + \"<br>\";\n}\n\nfunction init(){\n\tvar appKey = \"8w7jv4qb78a9y\";\n\tvar token = \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\";\n\t\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\tvar config = {};\n\n\t/*\n\t重新部署后替换为新路径\n\t路径格式说明：不带http(s)://，为了自动从页面继承协议方便\n\t*/\n\tconfig.protobuf =  \"./sdk/protobuf-2.3.6.min.js\",\n\t\n\t//私有云导航地址参数\n\t//config.navi =  \"\"; \n\n\t//初始化\n\tRongIMClient.init(appKey,null,config);\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\tconsole.info(status)\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t            showInfo(\"链接成功\");\n\t\t            console.log('链接成功');\n\t\t            // afterConnected();\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t            console.log('正在链接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t            console.log('断开连接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t            console.log('其他设备登录');\n\t\t            break;\n\t\t          case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t            console.log('域名不正确');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t        \tconsole.log('网络不可用');\n\t\t        \tbreak;\n\t\t        }\n\t\t}\n\t});\n\t\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    // showTips(\"新消息，类型为：\" + message.messageType);\n            // showResult(\"新消息\",message,start);\n            console.log(message)\n\t\t    switch(message.messageType){\n\t\t        case RongIMClient.MessageType.TextMessage:\n\t\t        \t/*\n\t\t        \t显示消息方法： \n\t\t        \t消息里是 原生emoji\n\t\t        \tRongIMLib.RongIMEmoji.emojiToHTML(message.content.content);\n\t\t            */\n\t\t            break;\n\t\t        case RongIMClient.MessageType.VoiceMessage:\n\t\t            // 对声音进行预加载                \n\t\t            // message.content.content 格式为 AMR 格式的 base64 码\n\t\t            break;\n\t\t        case RongIMClient.MessageType.ImageMessage:\n\t\t           // message.content.content => 图片缩略图 base64。\n\t\t           // message.content.imageUri => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.DiscussionNotificationMessage:\n\t\t           // message.content.extension => 讨论组中的人员。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.LocationMessage:\n\t\t           // message.content.latiude => 纬度。\n\t\t           // message.content.longitude => 经度。\n\t\t           // message.content.content => 位置图片 base64。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.RichContentMessage:\n\t\t           // message.content.content => 文本消息内容。\n\t\t           // message.content.imageUri => 图片 base64。\n\t\t           // message.content.url => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.InformationNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ContactNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ProfileNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.UnknownMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        default:\n\t\t            // do something...\n\t\t    }\n\t\t}\n\t});\n\t\n\t\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tshowInfo(\"链接成功，用户id：\" + userId);\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\tshowInfo('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  var info = '';\n\t\t  switch (errorCode) {\n\t\t    case RongIMLib.ErrorCode.TIMEOUT:\n\t\t      info = '超时';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n\t\t      info = '未知错误';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNACCEPTABLE_PaROTOCOL_VERSION:\n\t\t      info = '不可接受的协议版本';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n\t\t      info = 'appkey不正确';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n\t\t      info = '服务器不可用';\n\t\t      break;\n\t\t  }\n\t\t  console.log(info);\n\t\t}\n\t});\n}\n</script>\n\n</body>\n</html>"
  },
  {
    "path": "local-sdks/sdk/RongIMLib-2.3.4.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.3.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: true, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.3.4';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\", \"subUserStatus\", \"cleanHisMsg\"];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                        timers.length = 0;\n                        elements.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var xss = document.createElement(\"script\");\n                            xss.src = url;\n                            document.body.appendChild(xss);\n                            xss.onload = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = xss.src;\n                                callback(url);\n                            };\n                            // 此处不处理 xss.onerror 15 秒不执行 onload 自动超时\n                            elements.push(xss);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            var isFirstConnect = true;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                var sentBoxTime = localSyncTime.sent;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    if (str == \"chrmPull\") {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //防止因离线消息造成会话列表不为空而无法从服务器拉取会话列表。\n                    //offlineMsg && (RongIMClient._memoryStore.isSyncRemoteConverList = true);\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        if (!(list[i].msgId in me.cacheMessageIds)) {\n                            count -= 1;\n                            var message = list[i];\n                            var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                            if (sentTime > time) {\n                                Bridge._client.handler.onReceived(message, undefined, offlineMsg, count);\n                                var arrLen = me.cacheMessageIds.unshift(list[i].msgId);\n                                if (arrLen > 20) {\n                                    me.cacheMessageIds.length = 20;\n                                }\n                            }\n                        }\n                    }\n                    var isPullFinished = collection.finished;\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    if (!RongIMLib.RongIMClient._memoryStore.isPullFinished) {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            if (msgTag == 3 || msgTag == 2 || msgTag == 1 || msgTag == 0) {\n                RongIMLib.SyncTimeUtil.set(message);\n            }\n            var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n            if (isSend) {\n                var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                var userId = RongIMLib.Bridge._client.userId;\n                var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                if (message.sentTime <= lastSentTime && !isSync) {\n                    return;\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function (con) {\n                        if (!con) {\n                            con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                        }\n                        if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                            var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                            var key = message.conversationType + '_' + message.targetId, info = {};\n                            if (message.content && message.content.mentionedInfo) {\n                                info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                                mentioneds = JSON.stringify(info);\n                            }\n                            if (mentioneds) {\n                                var info = JSON.parse(mentioneds);\n                                con.mentionedMsg = info[key];\n                            }\n                        }\n                        var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                        if (isReceiver) {\n                            con.unreadMessageCount = con.unreadMessageCount + 1;\n                            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                                var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, Number(count) + 1);\n                            }\n                        }\n                        con.receivedTime = new Date().getTime();\n                        con.receivedStatus = message.receivedStatus;\n                        con.senderUserId = message.sendUserId;\n                        con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                        con.latestMessageId = message.messageId;\n                        con.latestMessage = message;\n                        con.sentTime = message.sentTime;\n                        RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n                    },\n                    onError: function (error) { }\n                });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var lcount = leftCount || 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addMessage(message.conversationType, message.targetId, message, {\n                    onSuccess: function (ret) {\n                        setTimeout(function () {\n                            that._onReceived(ret, lcount);\n                        });\n                    },\n                    onError: function (error) {\n                        setTimeout(function () {\n                            that._onReceived(message, lcount);\n                        });\n                    }\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var userId = RongIMLib.Bridge._client.userId;\n                var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                RongIMLib.SyncTimeUtil.set({\n                    messageDirection: RongIMLib.MessageDirection.SEND,\n                    sentTime: timestamp\n                });\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().getServerEndpoint(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && _client.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.RongIMClient._memoryStore.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RCE:UpdateStatus\": \"RCEUpdateStatusMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    if (conversationTypes) {\n                        var convers = [];\n                        Array.forEach(conversationTypes, function (converType) {\n                            Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                                if (item.conversationType == converType) {\n                                    convers.push(item);\n                                }\n                            });\n                        });\n                        setTimeout(function () {\n                            callback.onSuccess(convers);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    msg.messageUId = _msg.messageUId;\n                    msg.sentTime = _msg.sentTime;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                setTimeout(function () {\n                    callback.onSuccess(list);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            if (conversationTypes) {\n                for (var i = 0, len = conversationTypes.length; i < len; i++) {\n                    Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                        if (conver.conversationType == conversationTypes[i]) {\n                            count += conver.unreadMessageCount;\n                        }\n                    });\n                }\n            }\n            else {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    count += conver.unreadMessageCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver ? conver.unreadMessageCount : 0);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        conver.mentionedMsg = null;\n                        var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                        if (mentioneds) {\n                            var info = JSON.parse(mentioneds);\n                            delete info[conversationType + \"_\" + targetId];\n                            if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                            }\n                            else {\n                                RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                            }\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key, obj);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "local-sdks/sdk/RongIMLib-2.3.5.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.3.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.3.5';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\", \"subUserStatus\", \"cleanHisMsg\"];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                        timers.length = 0;\n                        elements.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var xss = document.createElement(\"script\");\n                            xss.src = url;\n                            document.body.appendChild(xss);\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = xss.src;\n                                callback(url);\n                            };\n                            xss.onload = onSuccess;\n                            xss.onerror = onSuccess;\n                            elements.push(xss);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            var isFirstConnect = true;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.fromUserId == Bridge._client.userId;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            Bridge._client.handler.onReceived(message, undefined, offlineMsg, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().getServerEndpoint(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && _client.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.RongIMClient._memoryStore.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    msg.messageUId = _msg.messageUId;\n                    msg.sentTime = _msg.sentTime;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key, obj);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "local-sdks/sdk/RongIMLib-2.4.0.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.4.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000\n            };\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, callback);\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, callback);\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.4.0';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect();\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                return RongIMLib.RongIMClient.RTCListener(message);\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().getServerEndpoint(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && _client.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (result) {\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                storage.setItem('fullnavi', JSON.stringify(result));\n                var server = result.server;\n                if (server) {\n                    server += ',';\n                }\n                var backupServer = result.backupServer || '';\n                var tpl = '{server}{backupServer}';\n                var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                    server: server,\n                    backupServer: backupServer\n                });\n                servers = servers.split(',');\n                storage.setItem('servers', JSON.stringify(servers));\n                var token = RongIMLib.RongIMClient._memoryStore.token;\n                var uid = RongIMLib.InnerUtil.getUId(token);\n                storage.setItem('rc_uid', uid);\n                var userId = result.userId;\n                storage.setItem('current_user', userId);\n                if (result.voipCallInfo) {\n                    var callInfo = JSON.parse(result.voipCallInfo);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    storage.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                var openMp = result.openMp;\n                storage.setItem('openMp' + uid, openMp);\n                RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n            };\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var domain = depend.navi;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{domain}/{path}.js?appId={appId}&token={token}&callBack=getServerEndpoint&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                domain: domain,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user) {\n            this.id = id;\n            this.user = user;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            ;\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getNavi = function () {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timer = null;\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            this.timer = setTimeout(callback, this.timeout);\n        };\n        Timer.prototype.pause = function () {\n            clearTimeout(this.timer);\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "local-sdks/sdk/RongIMLib-2.5.0.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.5.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, callback);\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, callback);\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.0';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                return RongIMLib.RongIMClient.RTCListener(message);\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var context = this;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = context.request(navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack=null&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random\n            });\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('null(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            // 复用 PB\n            modules.setNothing(room.mode);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getNavi = function () {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "local-sdks/sdk/RongIMLib-2.5.1.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.6.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\"\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (typeof watcher == 'function') {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                var errorCode = RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"deleteRemoteMessages\"\n                });\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [], isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.1';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                ws: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var type = isPolling ? 'comet' : 'ws';\n            connectMap[type]();\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var isPersited = (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var originUnreadCount = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        var newUnreadCount = Number(originUnreadCount) + 1;\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                setTimeout(function () {\n                    that._onReceived(message, count, hasMore);\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n            this.socket.fire(\"disconnect\", code);\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var watcher = {\n                onChanged: function (status) {\n                    listener.onChanged(status);\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        watch(status);\n                    });\n                }\n            };\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(watcher);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(watcher);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            if (conversationTypes) {\n                RongIMLib.RongUtil.forEach(conversationTypes, function (type) {\n                    var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId + type);\n                    RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                        var unread = storageProvider.getItem(key);\n                        var unreadCount = Number(unread) || 0;\n                        count += unreadCount;\n                    });\n                });\n            }\n            else {\n                var unreadKeys = storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n                RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                    var unread = storageProvider.getItem(key);\n                    var unreadCount = Number(unread) || 0;\n                    count += unreadCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            var storageProvider = RongIMLib.RongIMClient._storageProvider;\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            storageProvider.setItem(key, count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var key = \"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId;\n            var unread = RongIMLib.RongIMClient._storageProvider.getItem(key);\n            var unreadCount = Number(unread);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            // 1. 获取所有 key 2. 清除\n            var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(\"cu\" + RongIMLib.Bridge._client.userId);\n            RongIMLib.RongUtil.forEach(unreadKeys, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            modules.setRoomType(0);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            this.observers.push(observer);\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "local-sdks/sdk/RongIMLib-2.5.3.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && (define.amd || define.cmd)) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(window, function(){\n// {WebStart} WebSDK 内容开始的标识, 方便小程序 SDK 定位\nvar Polling = {\n        SetUserStatusInput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SetUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        GetUserStatusInput: function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n\n        GetUserStatusOutput: function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            };\n            this.setSubUserId = function(b){\n                a.subUserId = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicInput: function(){\n            var a = {};\n            this.setEngineType = function(b){\n                a.engineType = b;\n            };\n            this.setChannelName = function(b){\n                a.channelName = b;\n            };\n            this.setChannelExtra = function(b){\n                a.channelExtra = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        VoipDynamicOutput: function(){\n            var a = {};\n            this.setDynamicKey = function(b){\n                a.dynamicKey = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusInput: function(){\n            var a = {};\n            this.setUserid = function(b){\n                a.userid = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        SubUserStatusOutput: function(){\n            var a = {};\n            this.setNothing = function(b){\n               a.nothing = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        CleanHisMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setDataTime = function(b){\n                a.dataTime = b;\n            };\n            this.setConversationType = function(b){\n                a.conversationType = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.setSendBoxSyncTime = function (b) {\n                a.sendBoxSyncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setConfigFlag = function (b) {\n                a.configFlag = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.setFinished = function(b){\n                a.finished = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        RtcQueryListInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n        },\n        RtcKeyDeleteInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n        },\n        RtcValueInfo: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n        },\n        // RtcUserInfo: function () {\n        //     var a = {};\n        // },\n        RtcUserListOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n        },\n        RtcRoomInfoOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomId = function (b) {\n                a.roomId = b;\n            };\n            this.setRoomData = function (b) {\n                a.roomData = b;\n            };\n            this.setUserCount = function (b) {\n                a.userCount = b;\n            };\n            this.setList = function (b) {\n                a.list = b;\n            }\n        },\n        RtcInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRoomType = function (b) {\n                a.roomType = b;\n            };\n            this.setBroadcastType = function (b) {\n                a.broadcastType = b;\n            }\n        },\n        // RtcQryInput: function () {\n        //     var a = {};\n        // },\n        RtcQryOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setOutInfo = function (b) {\n                a.outInfo = b;\n            };\n        },\n        // RtcDelDataInput: function () {\n        //     var a = {};\n        // },\n        RtcDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcSetDataInput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setInterior = function (b) {\n                a.interior = b;\n            };\n            this.setTarget = function (b) {\n                a.target = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setValue = function (b) {\n                a.value = b;\n            };\n            this.setObjectName = function (b) {\n                a.objectName = b;\n            };\n            this.setContent = function (b) {\n                a.content = b;\n            };\n        },\n        RtcOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n        },\n        RtcTokenOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function(){\n                return a;\n            };\n            this.setRtcToken = function (b) {\n                a.rtcToken = b;\n            }\n        },\n        /**\n         * 聊天室 KV 存储\n         */\n\n        ChrmNotifyMsg: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function (b) {\n                a.chrmId = b;\n            };\n        },\n        ChrmKVEntity: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setKey = function (key) {\n                a.key = key;\n            };\n            this.setValue = function (value) {\n                a.value = value;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n            this.setUid = function (b) {\n                a.uid = b;\n            };\n        },\n        SetChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b.toArrayBuffer();\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        },\n        ChrmKVOutput: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntries = function (b) {\n                this.entries = b;\n            };\n            this.setBFullUpdate = function (b) {\n                this.bFullUpdate = b;\n            };\n            this.setSyncTime = function (b) {\n                this.syncTime = b;\n            };\n        },\n        QueryChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setTimestamp = function (b) {\n                a.timestamp = b;\n            };\n        },\n        DeleteChrmKV: function () {\n            var a = {};\n            this.toArrayBuffer = function () {\n                return a;\n            };\n            this.setEntry = function (b) {\n                a.entry = b;\n            };\n            this.setBNotify = function (b) {\n                a.bNotify = b;\n            };\n            this.setNotification = function (b) {\n                a.notification = b;\n            };\n            this.setType = function (b) {\n                a.type = b;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\nvar md5 = (function () {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    return md5;\n}());\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * websocket 连接失败\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_UNAVAILABLE\"] = 7] = \"WEBSOCKET_UNAVAILABLE\";\n        /**\n         * websocket 报错\n         */\n        ConnectionStatus[ConnectionStatus[\"WEBSOCKET_ERROR\"] = 8] = \"WEBSOCKET_ERROR\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n         * appkey 不正确\n         */\n        ConnectionStatus[ConnectionStatus[\"APPKEY_IS_FAKE\"] = 20] = \"APPKEY_IS_FAKE\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n        /*\n            互踢次数过多（count > 5），此时可能出现：在其它他设备登陆有 reconnect 逻辑\n        */\n        ConnectionStatus[ConnectionStatus[\"ULTRALIMIT\"] = 1101] = \"ULTRALIMIT\";\n        /*\n            开始请求导航\n        */\n        ConnectionStatus[ConnectionStatus[\"REQUEST_NAVI\"] = 201] = \"REQUEST_NAVI\";\n        /*\n            请求导航结束\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI\"] = 202] = \"RESPONSE_NAVI\";\n        /*\n            请求导航失败\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_ERROR\"] = 203] = \"RESPONSE_NAVI_ERROR\";\n        /*\n            请求导航超时\n        */\n        ConnectionStatus[ConnectionStatus[\"RESPONSE_NAVI_TIMEOUT\"] = 204] = \"RESPONSE_NAVI_TIMEOUT\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /* 超时 */\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /* 参数错误 */\n        ErrorCode[ErrorCode[\"PARAMETER_ERROR\"] = -3] = \"PARAMETER_ERROR\";\n        ErrorCode[ErrorCode[\"RECALL_MESSAGE\"] = 25101] = \"RECALL_MESSAGE\";\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        /**\n         * 聊天室 KV 设置超出最大值(已满, 默认最多设置 100 个)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_EXCEED\"] = 23423] = \"CHATROOM_KV_EXCEED\";\n        /**\n         * 聊天室 KV 设置失败(kv 已存在, 需覆盖设置)\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_OVERWRITE_INVALID\"] = 23424] = \"CHATROOM_KV_OVERWRITE_INVALID\";\n        /**\n         * 聊天室 KV 存储功能没有开通\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_STORE_NOT_OPEN\"] = 23426] = \"CHATROOM_KV_STORE_NOT_OPEN\";\n        /**\n         * 聊天室Key不存在\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_KEY_NOT_EXIST\"] = 23427] = \"CHATROOM_KEY_NOT_EXIST\";\n        /**\n         * 敏感词屏蔽\n         */\n        ErrorCode[ErrorCode[\"SENSITIVE_SHIELD\"] = 21501] = \"SENSITIVE_SHIELD\";\n        ErrorCode[ErrorCode[\"SENSITIVE_REPLACE\"] = 21502] = \"SENSITIVE_REPLACE\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_ERROR\"] = 34010] = \"CLEAR_HIS_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TYPE_ERROR\"] = 34008] = \"CLEAR_HIS_TYPE_ERROR\";\n        ErrorCode[ErrorCode[\"CLEAR_HIS_TIME_ERROR\"] = 34011] = \"CLEAR_HIS_TIME_ERROR\";\n        /*\n            \n        */\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34009] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        /**\n         * 聊天室 kv 未找到\n         * */\n        ErrorCode[ErrorCode[\"CHATROOM_KV_NOT_FOUND\"] = 36004] = \"CHATROOM_KV_NOT_FOUND\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VIDEO\"] = 2] = \"MEDIA_VIDEO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (ReadStatus) {\n        ReadStatus[ReadStatus[\"READ\"] = 1] = \"READ\";\n        ReadStatus[ReadStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReadStatus[ReadStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReadStatus[ReadStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReadStatus[ReadStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReadStatus || (RongIMLib.ReadStatus = {}));\n    var ReadStatus = RongIMLib.ReadStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n    (function (RTCAPIType) {\n        RTCAPIType[RTCAPIType[\"ROOM\"] = 1] = \"ROOM\";\n        RTCAPIType[RTCAPIType[\"PERSON\"] = 2] = \"PERSON\";\n    })(RongIMLib.RTCAPIType || (RongIMLib.RTCAPIType = {}));\n    var RTCAPIType = RongIMLib.RTCAPIType;\n    (function (ChatroomEntityOpt) {\n        ChatroomEntityOpt[ChatroomEntityOpt[\"UPDATE\"] = 1] = \"UPDATE\";\n        ChatroomEntityOpt[ChatroomEntityOpt[\"DELETE\"] = 2] = \"DELETE\";\n    })(RongIMLib.ChatroomEntityOpt || (RongIMLib.ChatroomEntityOpt = {}));\n    var ChatroomEntityOpt = RongIMLib.ChatroomEntityOpt;\n    (function (ChatroomEntityLimit) {\n        ChatroomEntityLimit[ChatroomEntityLimit[\"KEY\"] = 128] = \"KEY\";\n        ChatroomEntityLimit[ChatroomEntityLimit[\"VALUE\"] = 4096] = \"VALUE\";\n    })(RongIMLib.ChatroomEntityLimit || (RongIMLib.ChatroomEntityLimit = {}));\n    var ChatroomEntityLimit = RongIMLib.ChatroomEntityLimit;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        RongIMClient.showError = function (errorInfo) {\n            var hasConsole = (console && console.error);\n            if (hasConsole) {\n                console.error(JSON.stringify(errorInfo));\n            }\n        };\n        RongIMClient.logger = function (params) {\n            var code = params.code;\n            var errorInfo = RongIMClient.LogFactory[code] || params;\n            errorInfo.funcName = params.funcName;\n            errorInfo.msg = params.msg || errorInfo.msg;\n            if (RongIMClient._memoryStore.depend.showError) {\n                RongIMClient.showError(errorInfo);\n            }\n        };\n        RongIMClient.logCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n        };\n        ;\n        RongIMClient.logSendCallback = function (callback, funcName) {\n            return {\n                onSuccess: callback.onSuccess,\n                onError: function (errorCode, result) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: funcName\n                    });\n                    callback.onError(errorCode, result);\n                },\n                onBefore: callback.onBefore\n            };\n        };\n        ;\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            RongIMClient.statusListeners = [];\n            RongIMClient.messageListeners = [];\n            if (RongIMClient._instance) {\n                return RongIMClient._memoryStore.sdkInfo;\n            }\n            RongIMClient._instance = new RongIMClient();\n            options = options || {};\n            var protocol = \"http://\", wsScheme = 'ws://';\n            var isLocationInvalid = typeof location !== 'object'; // 未找到全局 location 变量, 则协议为 https. 比如小程序\n            if (isLocationInvalid || location.protocol == 'https:') {\n                wsScheme = 'wss://';\n                protocol = 'https://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var isIntegrity = function () {\n                //iOS 9 \n                var hasWS = (typeof WebSocket);\n                var integrity = (typeof WebSocket.OPEN == 'number');\n                return (hasWS && integrity);\n            };\n            if (typeof WebSocket == 'object' && isIntegrity()) {\n                isPolling = false;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var serverIndex = RongIMClient._storageProvider.getItem('serverIndex');\n            RongIMClient.serverStore.index = serverIndex || 0;\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var navigaters = options.navigaters || [];\n            if (options.navi) {\n                navigaters = [options.navi];\n            }\n            if (!options.navi && RongIMLib.RongUtil.isEqual(navigaters.length, 0)) {\n                navigaters = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n            }\n            RongIMLib.RongUtil.forEach(navigaters, function (navi, index) {\n                var config = {\n                    path: navi,\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                navi = RongIMLib.RongUtil.formatProtoclPath(config);\n                navigaters[index] = navi;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.3.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extend(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                showError: true,\n                openMp: true,\n                snifferTime: 2000,\n                naviTimeout: 5000,\n                navigaters: navigaters,\n                maxNaviRetry: 10,\n                isNaviJSONP: false,\n                isWSPingJSONP: false,\n                isNotifyConversationList: false,\n                maxConversationCount: 300\n            };\n            delete options.navigaters;\n            RongIMLib.RongUtil.extend(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            RongIMClient.userStatusObserver = new RongIMLib.RongObserver();\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                historyMessageLimit: new RongIMLib.MemoryCache(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            var isCPlusSDK = dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\";\n            if (isCPlusSDK) {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            options.appCallback = callback;\n            var sdkInfo = RongIMClient._dataAccessProvider.init(appKey, options);\n            RongIMClient._memoryStore.sdkInfo = sdkInfo;\n            if (isCPlusSDK) {\n                // 兼容 c++ 设置导航，Web 端不生效\n                RongIMClient._dataAccessProvider.setServerInfo({ navi: location.protocol + options.navi + '/navi.xml' });\n            }\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HQVoiceMessage: { objectName: \"RC:HQVCMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfRedPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(false, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCCombineMessage: { objectName: \"RC:CombineMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ChrmKVNotificationMessage: { objectName: 'RC:chrmKVNotiMsg', msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                HQVoiceMessage: 'HQVoiceMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfRedPacketMessage: \"JrmfRedPacketMessage\",\n                JrmfRedPacketOpenedMessage: \"JrmfRedPacketOpenedMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\",\n                RCCombineMessage: \"RCCombineMessage\",\n                ChrmKVNotificationMessage: 'ChrmKVNotificationMessage'\n            };\n            RongIMClient.LogFactory = {\n                /**\n                 * 个人\n                 */\n                \"-1\": {\n                    code: \"-1\",\n                    msg: \"服务器超时\"\n                },\n                \"-2\": {\n                    code: \"-2\",\n                    msg: \"未知原因失败\"\n                },\n                \"-3\": {\n                    code: \"-3\",\n                    msg: \"参数错误\"\n                },\n                \"-4\": {\n                    code: \"-4\",\n                    msg: \"参数不正确或尚未实例化\"\n                },\n                \"25101\": {\n                    code: \"25101\",\n                    msg: \"撤回消息参数错误\",\n                    desc: \"请检查撤回消息参数 https://rongcloud.github.io/websdk-demo/api-test.html\"\n                },\n                \"25102\": {\n                    code: \"25101\",\n                    msg: \"只能撤回自发发送的消息\"\n                },\n                \"20604\": {\n                    code: \"20604\",\n                    msg: \"发送频率过快\",\n                    desc: \"https://developer.rongcloud.cn/ticket/info/9Q3L6vRKd1cLS7rycA==?type=1\"\n                },\n                \"20406\": {\n                    code: \"20406\",\n                    msg: \"被禁言\"\n                },\n                \"23407\": {\n                    code: \"23407\",\n                    msg: \"获取用户失败\"\n                },\n                /**\n                 * 群组\n                 */\n                \"20407\": {\n                    code: \"20407\",\n                    msg: \"群组Id无效\"\n                },\n                \"22408\": {\n                    code: \"22408\",\n                    msg: \"群组被禁言\"\n                },\n                \"22406\": {\n                    code: \"22406\",\n                    msg: \"不在群组\"\n                },\n                \"35001\": {\n                    code: \"35001\",\n                    msg: \"群组同步异常\"\n                },\n                \"35002\": {\n                    code: \"35002\",\n                    msg: \"匹配群信息异常\"\n                },\n                /**\n                 * 讨论组\n                 */\n                \"21406\": {\n                    code: \"21406\",\n                    msg: \"不在讨论组\"\n                },\n                \"21407\": {\n                    code: \"21407\",\n                    msg: \"加入讨论失败\"\n                },\n                \"21408\": {\n                    code: \"21408\",\n                    msg: \"创建讨论组失败\"\n                },\n                \"21409\": {\n                    code: \"21409\",\n                    msg: \"设置讨论组邀请状态失败\"\n                },\n                /**\n                 * 聊天室\n                 */\n                \"23406\": {\n                    code: \"23406\",\n                    msg: \"不在聊天室\"\n                },\n                \"23408\": {\n                    code: \"23408\",\n                    msg: \"聊天室被禁言\"\n                },\n                \"23409\": {\n                    code: \"23409\",\n                    msg: \"聊天室中成员被踢出\"\n                },\n                \"23410\": {\n                    code: \"23410\",\n                    msg: \"聊天室不存在\"\n                },\n                \"23411\": {\n                    code: \"23411\",\n                    msg: \"聊天室成员已满\"\n                },\n                \"23412\": {\n                    code: \"23412\",\n                    msg: \"获取聊天室信息参数无效\"\n                },\n                \"23413\": {\n                    code: \"23413\",\n                    msg: \"聊天室异常\"\n                },\n                \"23414\": {\n                    code: \"23414\",\n                    msg: \"没有打开聊天室消息存储\"\n                },\n                \"36001\": {\n                    code: \"36001\",\n                    msg: \"加入聊天室Id为空\"\n                },\n                \"36002\": {\n                    code: \"36002\",\n                    msg: \"加入聊天室失败\"\n                },\n                \"36003\": {\n                    code: \"36003\",\n                    msg: \"拉取聊天室历史消息失败\"\n                },\n                /**\n                 * voip\n                 */\n                \"24001\": {\n                    code: \"24001\",\n                    msg: \"没有注册DeviveId 也就是用户没有登陆\"\n                },\n                \"24002\": {\n                    code: \"24002\",\n                    msg: \"用户已经存在\"\n                },\n                \"0\": {\n                    code: \"0\",\n                    msg: \"成功\"\n                },\n                \"24009\": {\n                    code: \"24009\",\n                    msg: \"没有对应的用户或token\"\n                },\n                \"24013\": {\n                    code: \"24013\",\n                    msg: \"voip为空\"\n                },\n                \"24010\": {\n                    code: \"24010\",\n                    msg: \"不支持的Voip引擎\"\n                },\n                \"24011\": {\n                    code: \"24011\",\n                    msg: \"channelName 是空\"\n                },\n                \"24012\": {\n                    code: \"24012\",\n                    msg: \"生成Voipkey失败\"\n                },\n                \"24014\": {\n                    code: \"24014\",\n                    msg: \"没有配置voip\"\n                },\n                \"24015\": {\n                    code: \"24015\",\n                    msg: \"服务器内部错误\"\n                },\n                \"24016\": {\n                    code: \"24016\",\n                    msg: \"VOIP close\"\n                },\n                /**\n                 * 通讯、导航\n                 */\n                \"30001\": {\n                    code: \"30001\",\n                    msg: \"通信过程中，当前Socket不存在\"\n                },\n                \"30002\": {\n                    code: \"30002\",\n                    msg: \"Socket连接不可用\"\n                },\n                \"30003\": {\n                    code: \"30003\",\n                    msg: \"通信超时\"\n                },\n                \"30004\": {\n                    code: \"30004\",\n                    msg: \"导航操作时，Http请求失败\"\n                },\n                \"30005\": {\n                    code: \"30005\",\n                    msg: \"HTTP请求失败\"\n                },\n                \"30006\": {\n                    code: \"30006\",\n                    msg: \"HTTP接收失败\"\n                },\n                \"30007\": {\n                    code: \"30007\",\n                    msg: \"导航资源错误\"\n                },\n                \"30008\": {\n                    code: \"30008\",\n                    msg: \"没有有效数据\"\n                },\n                \"30009\": {\n                    code: \"30009\",\n                    msg: \"不存在有效 IP 地址\"\n                },\n                \"30010\": {\n                    code: \"30010\",\n                    msg: \"创建 Socket 失败\"\n                },\n                \"30011\": {\n                    code: \"30011\",\n                    msg: \" Socket 被断开\"\n                },\n                \"30012\": {\n                    code: \"30012\",\n                    msg: \"PING 操作失败\"\n                },\n                \"30013\": {\n                    code: \"30013\",\n                    msg: \"PING 超时\"\n                },\n                \"30014\": {\n                    code: \"30014\",\n                    msg: \"消息发送失败\"\n                },\n                \"30016\": {\n                    code: \"30016\",\n                    msg: \"消息大小超限，最大 128 KB\"\n                },\n                /**\n                 * 连接\n                 */\n                \"31000\": {\n                    code: \"31000\",\n                    msg: \"做 connect 连接时，收到的 ACK 超时\"\n                },\n                \"31001\": {\n                    code: \"31001\",\n                    msg: \"参数错误\"\n                },\n                \"31002\": {\n                    code: \"31002\",\n                    msg: \"参数错误，App Id 错误\"\n                },\n                \"31003\": {\n                    code: \"31003\",\n                    msg: \"服务器不可用\"\n                },\n                \"31004\": {\n                    code: \"31004\",\n                    msg: \"Token 错误\"\n                },\n                \"31005\": {\n                    code: \"31005\",\n                    msg: \"App Id 与 Token 不匹配\"\n                },\n                \"31006\": {\n                    code: \"31006\",\n                    msg: \"重定向，地址错误\"\n                },\n                \"31007\": {\n                    code: \"31007\",\n                    msg: \"NAME 与后台注册信息不一致\"\n                },\n                \"31008\": {\n                    code: \"31008\",\n                    msg: \"APP 被屏蔽、删除或不存在\"\n                },\n                \"31009\": {\n                    code: \"31009\",\n                    msg: \"用户被屏蔽\"\n                },\n                \"31010\": {\n                    code: \"31010\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                \"31011\": {\n                    code: \"31011\",\n                    msg: \"Disconnect，由服务器返回，比如用户互踢\"\n                },\n                /**\n                 * 协议\n                 */\n                \"32001\": {\n                    code: \"32001\",\n                    msg: \"协议层内部错误。query，上传下载过程中数据错误\"\n                },\n                \"32002\": {\n                    code: \"32002\",\n                    msg: \"协议层内部错误\"\n                },\n                /**\n                 * BIZ\n                 */\n                \"33001\": {\n                    code: \"33001\",\n                    msg: \"未调用 init 初始化函数\"\n                },\n                \"33002\": {\n                    code: \"33002\",\n                    msg: \"数据库初始化失败\"\n                },\n                \"33003\": {\n                    code: \"33003\",\n                    msg: \"传入参数无效\"\n                },\n                \"33004\": {\n                    code: \"33004\",\n                    msg: \"通道无效\"\n                },\n                \"33005\": {\n                    code: \"33005\",\n                    msg: \"重新连接成功\"\n                },\n                \"33006\": {\n                    code: \"33006\",\n                    msg: \"连接中，再调用 connect 被拒绝\"\n                },\n                \"33007\": {\n                    code: \"33007\",\n                    msg: \"消息漫游服务未开通\"\n                },\n                \"33008\": {\n                    code: \"33008\",\n                    msg: \"消息添加失败\"\n                },\n                \"33009\": {\n                    code: \"33009\",\n                    msg: \"消息删除失败\"\n                },\n                /**\n                 * 会话\n                 */\n                \"34001\": {\n                    code: \"34001\",\n                    msg: \"删除会话失败\"\n                },\n                \"34002\": {\n                    code: \"34002\",\n                    msg: \"拉取历史消息失败\"\n                },\n                \"34003\": {\n                    code: \"34003\",\n                    msg: \"会话指定异常\"\n                },\n                \"34004\": {\n                    code: \"34004\",\n                    msg: \"获取会话未读消息总数失败\"\n                },\n                \"34005\": {\n                    code: \"34005\",\n                    msg: \"获取指定会话类型未读消息数异常\"\n                },\n                \"34006\": {\n                    code: \"34006\",\n                    msg: \"获取指定用户ID&会话类型未读消息数异常\"\n                },\n                \"34007\": {\n                    code: \"34007\",\n                    msg: \"清除会话消息异常\"\n                },\n                \"34008\": {\n                    code: \"34008\",\n                    msg: \"获取会话消息异常\"\n                },\n                \"34009\": {\n                    code: \"34009\",\n                    msg: \"清除历史消息会话类型不正确\"\n                },\n                \"34010\": {\n                    code: \"34010\",\n                    msg: \"清除历史消息失败，请检查传入参数\"\n                },\n                /**\n                 * 黑名单异常\n                 */\n                \"37001\": {\n                    code: \"37001\",\n                    msg: \"加入黑名单异常\"\n                },\n                \"37002\": {\n                    code: \"37002\",\n                    msg: \"获得指定人员再黑名单中的状态异常\"\n                },\n                \"37003\": {\n                    code: \"37003\",\n                    msg: \"移除黑名单异常\"\n                },\n                \"405\": {\n                    code: \"405\",\n                    msg: \"在黑名单中\"\n                },\n                /**\n                 * 草稿\n                 */\n                \"38001\": {\n                    code: \"38001\",\n                    msg: \"获取草稿失败\"\n                },\n                \"38002\": {\n                    code: \"38002\",\n                    msg: \"保存草稿失败\"\n                },\n                \"38003\": {\n                    code: \"38003\",\n                    msg: \"删除草稿失败\"\n                },\n                /**\n                 * 公众号\n                 */\n                \"39001\": {\n                    code: \"39001\",\n                    msg: \"关注公众号失败\"\n                },\n                /**\n                 * 文件\n                 */\n                \"41001\": {\n                    code: \"41001\",\n                    msg: \"文件类型错误\"\n                },\n                \"41002\": {\n                    code: \"41002\",\n                    msg: \"获取七牛token失败\"\n                },\n                /**\n                 *\n                 */\n                \"51001\": {\n                    code: \"51001\",\n                    msg: \"未安装或未启动插件\"\n                },\n                \"51002\": {\n                    code: \"51002\",\n                    msg: \"视频已经存在\"\n                },\n                \"51003\": {\n                    code: \"51003\",\n                    msg: \"无效的channelName\"\n                },\n                \"51004\": {\n                    code: \"51004\",\n                    msg: \"视频内容为空\"\n                },\n                /**\n                 *\n                 */\n                \"61001\": {\n                    code: \"61001\",\n                    msg: \"删除消息数组长度为 0\"\n                }\n            };\n            var handler = function (message, uris, callback) {\n                var userId = message.senderUserId;\n                var _uris = RongIMClient.roomInfo.users[userId].uris || '[]';\n                if (RongIMLib.RongUtil.isString(_uris)) {\n                    _uris = JSON.parse(_uris);\n                }\n                var tUris = JSON.parse(JSON.stringify(_uris));\n                RongIMLib.RongUtil.forEach(tUris, function (_uri, index) {\n                    RongIMLib.RongUtil.forEach(uris, function (uri) {\n                        if (uri.uri == _uri.uri) {\n                            callback(_uri, uri, _uris, index);\n                        }\n                    });\n                });\n                RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n            };\n            var RTCMessage = {\n                RTCPublishResourceMessage: function (message, uris) {\n                    var userId = message.senderUserId;\n                    var user = RongIMClient.roomInfo.users[userId];\n                    if (!user) {\n                        user = {};\n                        RongIMClient.roomInfo.users[userId] = {};\n                    }\n                    var _uris = user.uris || '[]';\n                    if (RongIMLib.RongUtil.isString(_uris)) {\n                        _uris = JSON.parse(_uris);\n                    }\n                    _uris = _uris.concat(uris);\n                    RongIMClient.roomInfo.users[userId].uris = JSON.stringify(_uris);\n                },\n                RTCUnpublishResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri, _uris, index) {\n                        _uris.splice(index, 1);\n                    });\n                },\n                RTCModifyResourceMessage: function (message, uris) {\n                    handler(message, uris, function (_uri, uri) {\n                        _uri.state = uri.state;\n                    });\n                },\n                RTCUserChangeMessage: function (message) {\n                    var content = message.content;\n                    var users = content.users;\n                    var UserState = {\n                        JOINED: 0,\n                        LEFT: 1,\n                        OFFLINE: 2\n                    };\n                    RongIMLib.RongUtil.forEach(users, function (user) {\n                        var state = user.state;\n                        var userId = user.userId;\n                        switch (+state) {\n                            case UserState.JOINED:\n                                RongIMClient.roomInfo.users[userId] = {};\n                                break;\n                            case UserState.LEFT:\n                            case UserState.OFFLINE:\n                                delete RongIMClient.roomInfo.users[userId];\n                                break;\n                        }\n                    });\n                }\n            };\n            RongIMClient.RTCInnerListener = function (message) {\n                var func = RTCMessage[message.messageType] || function () { };\n                var content = message.content;\n                var uris = content.uris;\n                func(message, uris);\n            };\n            RongIMClient.Conversation = RongIMClient._dataAccessProvider.Conversation;\n            return sdkInfo;\n        };\n        ;\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, _callback, userId, serverConf) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\", \"object|null|global|undefined\"], \"connect\", true, arguments);\n            var connectCallback = {\n                onSuccess: _callback.onSuccess,\n                onTokenIncorrect: _callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    _callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.connect(token, connectCallback, userId, serverConf);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            var connectCallback = {\n                onSuccess: callback.onSuccess,\n                onTokenIncorrect: callback.onTokenIncorrect,\n                onError: function (errorCode) {\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"connect\"\n                    });\n                    callback.onError(errorCode);\n                }\n            };\n            RongIMClient._dataAccessProvider.reconnect(connectCallback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent, searchProps);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        RongIMClient.prototype.registerMessageTypes = function (types) {\n            types = types || {};\n            RongIMClient._dataAccessProvider.registerMessageTypes(types);\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        RongIMClient.statusWatch = function (watcher) {\n            if (RongIMLib.RongUtil.isFunction(watcher)) {\n                RongIMClient.statusListeners.push(watcher);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, content) {\n            if (!custId || !callback)\n                return;\n            var msg = new RongIMLib.HandShakeMessage(content);\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMClient._dataAccessProvider.getAgoraDynamicKey(engineType, channelName, callback);\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, RongIMClient.logCallback(callback, \"getMessage\"));\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, RongIMClient.logCallback(callback, \"deleteLocalMessages\"));\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, RongIMClient.logCallback(callback, \"updateMessage\"));\n        };\n        RongIMClient.prototype.clearData = function () {\n            return RongIMClient._dataAccessProvider.clearData();\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearMessagesUnreadStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // deleteRemoteMessages(conversationType: ConversationType, targetId: string, delMsgs: DeleteMessage[], callback: ResultCallback<boolean>) {\n        //     CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n        //     if (delMsgs.length == 0) {\n        //         var errorCode = ErrorCode.DELETE_MESSAGE_ID_IS_NULL;\n        //         RongIMClient.logger({\n        //             code: errorCode,\n        //             funcName: \"deleteRemoteMessages\"\n        //         });\n        //         callback.onError(ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n        //         return;\n        //     } else if (delMsgs.length > 100) {\n        //         delMsgs.length = 100;\n        //     }\n        //     // 后续增加，去掉注释即可\n        //     callback.onSuccess(true);\n        //     // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n        //     // modules.setType(conversationType);\n        //     // modules.setConversationId(targetId);\n        //     // modules.setMsgs(delMsgs);\n        //     // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n        //     //     onSuccess: function(info: any) {\n        //     //         callback.onSuccess(true);\n        //     //     },\n        //     //     onError: function(err: any) {\n        //     //         callback.onError(err);\n        //     //     }\n        //     // }, \"DeleteMsgOutput\");\n        // }\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, messages, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"deleteMessages\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, RongIMClient.logSendCallback(callback, \"sendLocalMessage\"));\n        };\n        RongIMClient.prototype.getPullSetting = function (callback) {\n            RongIMClient._dataAccessProvider.getPullSetting(callback);\n        };\n        RongIMClient.prototype.setOfflineMessageDuration = function (duration, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"setOfflineMessageDuration\", true, arguments);\n            RongIMClient._dataAccessProvider.setOfflineMessageDuration(duration, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            if (!RongIMLib.RongUtil.isString(targetId)) {\n                return sendCallback.onError(RongIMLib.ErrorCode.PARAMETER_ERROR);\n            }\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, RongIMClient.logSendCallback(sendCallback, \"sendMessage\"), mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, RongIMClient.logSendCallback(sendCallback, \"sendReceiptResponse\"));\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, RongIMClient.logSendCallback(sendCallback, \"sendTypingStatusMessage\"));\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, RongIMClient.logSendCallback(sendMessageCallback, \"sendTextMessage\"));\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n            var senderUserId = content.senderUserId;\n            var userId = RongIMLib.Bridge._client.userId;\n            var isOther = (senderUserId != userId);\n            if (isOther) {\n                var callback = RongIMClient.logSendCallback(sendMessageCallback, \"sendRecallMessage\");\n                callback.onError(RongIMLib.ErrorCode.RECALL_MESSAGE, content);\n                return;\n            }\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, callback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, RongIMClient.logCallback(callback, \"insertMessage\"));\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        RongIMClient.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, searchFiles);\n        };\n        ;\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"number|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, \"getHistoryMessages\"), objectname, order);\n        };\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|null|global|object\"], \"getRemoteHistoryMessages\", false, arguments);\n            var funcName = \"getRemoteHistoryMessages\";\n            var log = {\n                errorCode: RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,\n                funcName: \"getRemoteHistoryMessages\"\n            };\n            if (count > 20) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                RongIMClient.logger(log);\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, RongIMClient.logCallback(callback, funcName), config);\n        };\n        RongIMClient.prototype.clearHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearHistoryMessages(params, callback);\n        };\n        RongIMClient.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            RongIMClient._dataAccessProvider.clearRemoteHistoryMessages(params, RongIMClient.logCallback(callback, \"clearRemoteHistoryMessages\"));\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            RongIMClient._dataAccessProvider.deleteRemoteMessages(conversationType, targetId, messages, RongIMClient.logCallback(callback, \"deleteRemoteMessages\"));\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, RongIMClient.logCallback(callback, \"hasRemoteUnreadMessages\"));\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getTotalUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getConversationUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"getUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setUnreadCount = function (conversationType, targetId, count) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"setUnreadCount\", false, arguments);\n            RongIMClient._dataAccessProvider.setUnreadCount(conversationType, targetId, count);\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, RongIMClient.logCallback(callback, \"clearUnreadCountByTimestamp\"));\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearUnreadCount\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearTotalUnreadCount = function (callback) {\n            RongIMClient._dataAccessProvider.clearTotalUnreadCount({\n                onSuccess: function (bool) {\n                    callback.onSuccess(bool);\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: 'clearTotalUnreadCount'\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageExtra\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageReceivedStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, RongIMClient.logCallback(callback, \"setMessageStatus\"));\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setMessageSentStatus\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, RongIMClient.logCallback(callback, \"searchConversationByContent\"), conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, RongIMClient.logCallback(callback, \"searchMessageByContent\"));\n        };\n        RongIMClient.prototype.clearCache = function () {\n            RongIMClient._dataAccessProvider.clearCache();\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"clearConversations\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversation\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = RongIMLib.UnreadCountHandler.get(tempConver.type, tempConver.userId);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.addConversation = function (conversation, callback) {\n            RongIMClient._dataAccessProvider.addConversation(conversation, callback);\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: error,\n                            funcName: \"getConversationList\"\n                        });\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(RongIMClient.logCallback(callback, \"getRemoteConversationList\"), conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            // var unreadContent: string = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            // var unreadCount = Number(unreadContent) || 0;\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, RongIMClient.logCallback(callback, \"removeConversation\"));\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"setConversationToTop\"\n                        });\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"getConversationNotificationStatus\"));\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, RongIMClient.logCallback(callback, \"setConversationNotificationStatus\"));\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, RongIMClient.logCallback(callback, \"addMemberToDiscussion\"));\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, RongIMClient.logCallback(callback, \"getDiscussion\"));\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, RongIMClient.logCallback(callback, \"quitDiscussion\"));\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, RongIMClient.logCallback(callback, \"removeMemberFromDiscussion\"));\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, RongIMClient.logCallback(callback, \"setDiscussionInviteStatus\"));\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, RongIMClient.logCallback(callback, \"setDiscussionName\"));\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    var errorCode = RongIMLib.ErrorCode.CHATROOM_ID_ISNULL;\n                    RongIMClient.logger({\n                        code: errorCode,\n                        funcName: \"joinChatRoom\"\n                    });\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, RongIMClient.logCallback(callback, \"joinChatRoom\"));\n        };\n        RongIMClient.prototype.setDeviceInfo = function (device) {\n            RongIMClient._dataAccessProvider.setDeviceInfo(device);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomHistoryMessages\"));\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, RongIMClient.logCallback(callback, \"getChatRoomInfo\"));\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, RongIMClient.logCallback(callback, \"quitChatRoom\"));\n        };\n        RongIMClient.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'setChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceSetChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'string', 'object'], 'getChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.getChatroomEntry(chatroomId, key, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object'], 'getAllChatroomEntries', false, arguments);\n            RongIMClient._dataAccessProvider.getAllChatroomEntries(chatroomId, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.removeChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        RongIMClient.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            RongIMLib.CheckParam.getInstance().check(['string', 'object', 'object'], 'removeChatroomEntry', false, arguments);\n            RongIMClient._dataAccessProvider.forceRemoveChatroomEntry(chatroomId, chatroomEntry, RongIMClient.logCallback(callback, \"setChatroomEntry\"));\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            RongIMClient._dataAccessProvider.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getRemotePublicServiceList\"), pullMessageTime);\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(RongIMClient.logCallback(callback, \"getPublicServiceList\"));\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                RongIMClient._dataAccessProvider.getPublicServiceProfile(publicServiceType, publicServiceId, RongIMClient.logCallback(callback, \"getPublicServiceProfile\"));\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicService\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, RongIMClient.logCallback(callback, \"searchPublicServiceByType\"), \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"subscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        var errorCode = code;\n                        RongIMClient.logger({\n                            code: errorCode,\n                            funcName: \"unsubscribePublicService\"\n                        });\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, RongIMClient.logCallback(callback, \"addToBlacklist\"));\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, RongIMClient.logCallback(callback, \"getBlacklistStatus\"));\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, RongIMClient.logCallback(callback, \"removeFromBlacklist\"));\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQngetFileTokenTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, RongIMClient.logCallback(callback, \"getFileToken\"));\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getFileUrl\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, RongIMClient.logCallback(callback, \"getFileUrl\"));\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, RongIMClient.logCallback(callback, \"startCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"startCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, RongIMClient.logCallback(callback, \"joinCall\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"joinCall\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, RongIMClient.logCallback(callback, \"changeMediaType\"));\n            }\n            else {\n                var errorCode = RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE;\n                RongIMClient.logger({\n                    code: errorCode,\n                    funcName: \"changeMediaType\"\n                });\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, RongIMClient.logCallback(callback, \"getUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, RongIMClient.logCallback(callback, \"setUserStatus\"));\n        };\n        RongIMClient.prototype.setUserStatusListener = function (params, callback) {\n            var userIds = params.userIds;\n            var multiple = params.multiple;\n            RongIMClient.userStatusObserver.watch({\n                key: userIds,\n                func: callback,\n                multiple: multiple\n            });\n            RongIMClient._dataAccessProvider.setUserStatusListener(params, callback);\n        };\n        // UserStaus end\n        // RTC start\n        RongIMClient.messageWatch = function (watcher) {\n            RongIMClient.RTCListener = watcher;\n        };\n        RongIMClient.messageSignalWatch = function (watcher) {\n            RongIMClient.RTCSignalLisener = watcher;\n        };\n        /*\n            var data = {\n                key1: 123,\n                key2: 345\n            };\n        */\n        RongIMClient.prototype.getRTCUserInfoList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserInfoList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserInfoList(room, callback);\n        };\n        RongIMClient.prototype.getRTCUserList = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCUserList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserList(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCUserInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCUserInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserInfo(room, info, callback);\n        };\n        RongIMClient.prototype.getRTCRoomInfo = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomInfo(room, callback);\n        };\n        RongIMClient.prototype.setRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"removeRTCRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomInfo(room, info, callback);\n        };\n        RongIMClient.prototype.joinRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"joinRTCRoom\", false, arguments);\n            if (RongIMClient.isJoinedRTCRoom) {\n                return callback.onSuccess(RongIMClient.roomInfo);\n            }\n            RongIMClient._dataAccessProvider.joinRTCRoom(room, {\n                onSuccess: function (result) {\n                    RongIMClient.roomInfo = result;\n                    RongIMClient.isJoinedRTCRoom = true;\n                    callback.onSuccess(result);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.quitRTCRoom = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"quitRTCRoom\", false, arguments);\n            RongIMClient.isJoinedRTCRoom = false;\n            RongIMClient._dataAccessProvider.quitRTCRoom(room, {\n                onSuccess: function () {\n                    RongIMClient.roomInfo = {\n                        users: {},\n                        token: ''\n                    };\n                    callback.onSuccess(true);\n                },\n                onError: callback.onError\n            });\n        };\n        RongIMClient.prototype.RTCPing = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"RTCPing\", false, arguments);\n            RongIMClient._dataAccessProvider.RTCPing(room, callback);\n        };\n        RongIMClient.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCUserData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCUserData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null\"], \"getRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCUserData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCUserData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCUserData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"string\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"setRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.setRTCRoomData(roomId, key, value, isInner, callback, message);\n        };\n        RongIMClient.prototype.getRTCRoomData = function (roomId, keys, isInner, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\"], \"getRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.getRTCRoomData(roomId, keys, isInner, callback);\n        };\n        RongIMClient.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"boolean\", \"object\", \"global|object|null|undefined\"], \"removeRTCRoomData\", false, arguments);\n            RongIMClient._dataAccessProvider.removeRTCRoomData(roomId, keys, isInner, callback, message);\n        };\n        RongIMClient.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            RongIMClient._dataAccessProvider.setRTCOutData(roomId, data, type, callback, message);\n        };\n        // 信令 SDK 新增\n        RongIMClient.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            RongIMClient._dataAccessProvider.getRTCOutData(roomId, userIds, callback);\n        };\n        RongIMClient.prototype.getNavi = function () {\n            return RongIMClient._dataAccessProvider.getNavi();\n        };\n        RongIMClient.prototype.getRTCToken = function (room, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"getRTCToken\", false, arguments);\n            return RongIMClient._dataAccessProvider.getRTCToken(room, callback);\n        };\n        RongIMClient.prototype.setRTCState = function (room, content, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\", \"object\"], \"setRTCState\", false, arguments);\n            return RongIMClient._dataAccessProvider.setRTCState(room, content, callback);\n        };\n        RongIMClient.prototype.getAppInfo = function () {\n            var appKey = RongIMClient._memoryStore.appKey;\n            return {\n                appKey: appKey\n            };\n        };\n        RongIMClient.prototype.getSDKInfo = function () {\n            return {\n                version: RongIMClient.sdkver\n            };\n        };\n        RongIMClient.RTCListener = function () { };\n        RongIMClient.RTCInnerListener = function () { };\n        RongIMClient.RTCSignalLisener = function () { };\n        RongIMClient.currentServer = '';\n        RongIMClient.LogFactory = {};\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { isPullFinished: false, syncMsgQueue: [] };\n        RongIMClient.isNotPullMsg = false;\n        RongIMClient.userStatusObserver = null;\n        RongIMClient.sdkver = '2.5.3';\n        RongIMClient.otherDeviceLoginCount = 0;\n        RongIMClient.serverStore = { index: 0 };\n        RongIMClient.isFirstConnect = true;\n        RongIMClient.roomInfo = {\n            users: {},\n            token: ''\n        };\n        RongIMClient.invalidWsUrls = [];\n        RongIMClient.isJoinedRTCRoom = false;\n        RongIMClient.statusListeners = [];\n        RongIMClient.messageListeners = [];\n        RongIMClient.userStatusListener = null;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\n        \"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\", \"\", \"\", \"\", \"prMsgS\", \"prMsgP\"],\n        \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\", \"createChrm\", \"exitChrm\", \"queryChrm\",\n        \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\",\n        \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\",\n        \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\", \"getUserStatus\", \"setUserStatus\",\n        \"subUserStatus\", \"cleanHisMsg\"\n    ];\n    var Channel = (function () {\n        function Channel(cb, self) {\n            this.connectionStatus = -1;\n            var appId = self.appId;\n            var token = encodeURIComponent(self.token);\n            var sdkVer = self.sdkVer;\n            var apiVer = self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            var that = this;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            var servers = storage.getItem('servers');\n            servers = JSON.parse(servers) || [];\n            servers = RongIMLib.RongUtil.getValidWsUrlList(servers);\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var startConnect = function (host) {\n                var tpl = '{host}/websocket?appId={appId}&token={token}&sdkVer={sdkVer}&apiVer={apiVer}';\n                that.url = RongIMLib.RongUtil.tplEngine(tpl, {\n                    host: host,\n                    appId: appId,\n                    token: token,\n                    sdkVer: sdkVer,\n                    apiVer: apiVer\n                });\n                that.socket.connect(that.url, cb);\n                // 临时兼容 Comet 逻辑，Comet 中用到\n                var userId = storage.getItem('rong_current_user');\n                RongIMLib.Navigation.Endpoint = {\n                    host: host,\n                    userId: userId\n                };\n            };\n            var connectMap = {\n                wsFromGet: function () {\n                    // 所有链接计算器，超过 15 秒后认为所有 CMP 地址均不可用\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var xhrs = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < xhrs.length; i++) {\n                            var xhr = xhrs[i];\n                            xhr.abort();\n                        }\n                        timers.length = 0;\n                        xhrs.length = 0;\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var onSuccess = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                callback(url);\n                            };\n                            var xhr = RongIMLib.MessageUtil.detectCMP({\n                                url: url,\n                                success: onSuccess,\n                                fail: function (code) {\n                                    console.log(code);\n                                }\n                            });\n                            xhrs.push(xhr);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        RongIMLib.RongIMClient.currentServer = host;\n                        startConnect(host);\n                    };\n                    var snifferTpl = '{protocol}{server}/ping?r={random}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = servers[i];\n                        if (server) {\n                            server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                                protocol: depend.protocol,\n                                server: server,\n                                random: RongIMLib.RongUtil.getTimestamp()\n                            });\n                            request({\n                                url: server,\n                                time: i * 1000\n                            }, snifferCallback);\n                        }\n                    }\n                    totalTimer.resume(function () {\n                        RongIMLib.Navigation.clear();\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                wsFromEl: function () {\n                    var totalTimer = new RongIMLib.Timer({\n                        timeout: 1 * 1000 * 15\n                    });\n                    var timers = [];\n                    var elements = [];\n                    var isFinished = false;\n                    var clearHandler = function () {\n                        for (var i = 0; i < timers.length; i++) {\n                            var timer = timers[i];\n                            clearTimeout(timer);\n                        }\n                        for (var i = 0; i < elements.length; i++) {\n                            var el = elements[i];\n                            document.body.removeChild(el);\n                        }\n                    };\n                    var request = function (config, callback) {\n                        var url = config.url;\n                        var time = config.time;\n                        if (isFinished) {\n                            return;\n                        }\n                        var timer = setTimeout(function () {\n                            var el = document.createElement('script');\n                            el.src = url;\n                            document.body.appendChild(el);\n                            el.onerror = function () {\n                                if (isFinished) {\n                                    return;\n                                }\n                                clearHandler();\n                                isFinished = true;\n                                totalTimer.pause();\n                                var url = el.src;\n                                callback(url);\n                            };\n                            elements.push(el);\n                        }, time);\n                        timers.push(timer);\n                    };\n                    var snifferCallback = function (url) {\n                        var reg = /(http|https):\\/\\/([^\\/]+)/i;\n                        var host = url.match(reg)[2];\n                        startConnect(host);\n                    };\n                    var snifferTpl = '//{server}/{path}';\n                    for (var i = 0; i < servers.length; i++) {\n                        var server = RongIMLib.RongUtil.tplEngine(snifferTpl, {\n                            server: servers[i],\n                            path: i\n                        });\n                        request({\n                            url: server,\n                            time: i * 1000\n                        }, snifferCallback);\n                    }\n                    totalTimer.resume(function () {\n                        clearHandler();\n                        that.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                    });\n                },\n                comet: function () {\n                    var host = servers[0];\n                    startConnect(host);\n                }\n            };\n            var isPolling = depend.isPolling;\n            var isWSPingJSONP = depend.isWSPingJSONP;\n            if (isPolling) {\n                connectMap['comet']();\n            }\n            else {\n                var connectType = isWSPingJSONP ? 'wsFromEl' : 'wsFromGet';\n                connectMap[connectType]();\n            }\n            //注册状态改变观察者\n            var StatusEvent = Channel._ConnectionStatusListener;\n            var hasEvent = (typeof StatusEvent == \"object\");\n            var me = this;\n            me.socket.on(\"StatusChanged\", function (code) {\n                if (RongIMLib.Bridge && RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && me !== RongIMLib.Bridge._client.channel) {\n                    return;\n                }\n                if (!hasEvent) {\n                    throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n                }\n                var isNetworkUnavailable = (code == RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n                var isWebSocket = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n                if (RongIMLib.RongIMClient.isFirstConnect && isNetworkUnavailable && isWebSocket) {\n                    code = RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE;\n                }\n                if (isNetworkUnavailable) {\n                    var storage = RongIMLib.RongIMClient._storageProvider;\n                    var servers = storage.getItem('servers');\n                    servers = JSON.parse(servers);\n                    var currentServer = RongIMLib.RongIMClient.currentServer;\n                    if (currentServer) {\n                        var index = RongIMLib.RongUtil.indexOf(servers, currentServer);\n                        // 如果 currentServer 是 servers 的最后一个，不再替换位置\n                        if (!RongIMLib.RongUtil.isEqual(index, -1)) {\n                            var server = servers.splice(index, 1)[0];\n                            servers.push(server);\n                            storage.setItem('servers', JSON.stringify(servers));\n                        }\n                    }\n                }\n                me.connectionStatus = code;\n                setTimeout(function () {\n                    StatusEvent.onChanged(code);\n                });\n                var isDisconnected = (code == RongIMLib.ConnectionStatus.DISCONNECTED);\n                if (isDisconnected) {\n                    self.clearHeartbeat();\n                }\n                var isOtherDevice = (code == RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                if (isOtherDevice) {\n                    // 累计其他设备登陆次数，超过 5 次后，自动销毁内部对象\n                    // 删除位置：ServerDataProivder.prototype.connect\n                    RongIMLib.RongIMClient.otherDeviceLoginCount++;\n                }\n                var isConnected = (code == RongIMLib.ConnectionStatus.CONNECTED);\n                if (isConnected) {\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                }\n                var isWebsocketUnAvailable = (code == RongIMLib.ConnectionStatus.WEBSOCKET_UNAVAILABLE);\n                if (isWebsocketUnAvailable) {\n                    me.changeConnectType();\n                    RongIMLib.RongIMClient.isFirstConnect = false;\n                    RongIMLib.RongIMClient.connect(self.token, RongIMLib.RongIMClient._memoryStore.callback);\n                }\n            });\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                that.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.changeConnectType = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling = !RongIMLib.RongIMClient._memoryStore.depend.isPolling;\n            new RongIMLib.FeatureDectector();\n        };\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 6000;\n            this.timeout_ = 0;\n            this.sdkVer = '';\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n            this.sdkVer = RongIMLib.RongIMClient.sdkver;\n        }\n        Client.prototype.resumeTimer = function () {\n            var me = this;\n            this.timeout_ = setTimeout(function () {\n                me.channel.disconnect(RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }, this.timeoutMillis);\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            //实例消息处理类\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(_callback);\n            //实例通道类型\n            var me = this;\n            this.channel = new Channel(function () {\n                RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n            }, this);\n            //触发状态改变观察者\n            this.channel.socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTING);\n            //没有返回地址就手动抛出错误\n            //_callback.onError(ConnectionState.NOT_AUTHORIZED);\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var count = 0;\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    clearInterval(checkTimeout);\n                    callback.onSuccess();\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 100);\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            var localSyncTime = RongIMLib.SyncTimeUtil.get();\n            var sentBoxTime = localSyncTime.sent;\n            if (temp.type != 2) {\n                //普通消息\n                time = localSyncTime.received;\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n                modules.setSendBoxSyncTime(sentBoxTime);\n            }\n            else {\n                //聊天室消息\n                target = temp.chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target, offlineMsg);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    var isChrmPull = str == 'chrmPull';\n                    if (isChrmPull) {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    var isPullFinished = collection.finished;\n                    // chrmPull 没有 finished 字段，自动设置为拉取完成\n                    if (isChrmPull) {\n                        isPullFinished = true;\n                    }\n                    // 兼容长轮训 finished 为空的造成丢消息情况\n                    if (typeof isPullFinished == 'undefined') {\n                        isPullFinished = true;\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isPullFinished = isPullFinished;\n                    var connectAckTime = RongIMLib.RongIMClient._memoryStore.connectAckTime;\n                    var len = list.length;\n                    for (var i = 0, count = len; i < len; i++) {\n                        count -= 1;\n                        var message = list[i];\n                        var sentTime = RongIMLib.MessageUtil.int64ToTimestamp(message.dataTime);\n                        var isSender = message.direction == RongIMLib.MessageDirection.SEND;\n                        var compareTime = isSender ? sentBoxTime : time;\n                        if (sentTime > compareTime) {\n                            var isSyncMessage = false;\n                            var isOffLineMessage = sentTime < connectAckTime;\n                            Bridge._client.handler.onReceived(message, undefined, isOffLineMessage, count, isSyncMessage, isPullFinished);\n                        }\n                    }\n                    if (len <= 200 && str == 'pullMsg') {\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                        Conversation._notify(conversationList);\n                    }\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target, offlineMsg);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime, chrmId: chrmId });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.handler = new MessageHandler(this);\n            //设置连接回调\n            this.handler.setConnectCallback(RongIMLib.RongIMClient._memoryStore.callback);\n            this.channel = new Channel(f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function () {\n            Channel._ConnectionStatusListener = {\n                onChanged: function (status) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.statusListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(status);\n                    });\n                }\n            };\n            Channel._ReceiveMessageListener = {\n                onReceived: function (msg, count, hasMore) {\n                    RongIMLib.RongUtil.forEach(RongIMLib.RongIMClient.messageListeners, function (watch) {\n                        RongIMLib.RongUtil.isFunction(watch) && watch(msg, count, hasMore);\n                    });\n                }\n            };\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n            }\n        };\n        MessageHandler.prototype.handleChrmKVPullMsg = function (msg) {\n            try {\n                var pbtype = 'ChrmNotifyMsg';\n                var data = RongIMLib.CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(msg.data), pbtype);\n                if (data.type === 2) {\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(data.time);\n                    RongIMLib.ChrmKVHandler.pull(data.chrmId, timestamp);\n                }\n            }\n            catch (e) {\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount, isSync) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con, \n            // 是否为直发消息\n            isStraightMsg = false;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    isStraightMsg = true;\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else if (msg.getTopic() == \"s_stat\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.GetUserStatusOutput.decode(msg.getData());\n                    entity = RongIMLib.RongInnerTools.convertUserStatus(entity);\n                    RongIMLib.RongIMClient.userStatusObserver.notify({\n                        key: entity.userId,\n                        entity: entity\n                    });\n                    return;\n                }\n                else if (msg.getTopic() === 's_cmd') {\n                    this.handleChrmKVPullMsg(msg);\n                    return;\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n            // PullMsg 没有拉取完成，抛弃所有直发在线消息，抛弃的消息会在 PullMsg 中返回\n            if (!isPullFinished && !offlineMsg && isStraightMsg) {\n                return;\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            var isRTCMessage = message.conversationType == 12;\n            if (isRTCMessage) {\n                RongIMLib.RongIMClient.RTCListener(message);\n                RongIMLib.RongIMClient.RTCInnerListener(message);\n                RongIMLib.RongIMClient.RTCSignalLisener(message);\n                return;\n            }\n            var isRecall = (msg.getTopic && msg.getTopic() == \"recallMsg\");\n            if (isRecall) {\n                var content = message.content;\n                message.conversationType = content.conversationType;\n                message.targetId = content.targetId;\n                message.messageId = null;\n            }\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, message.sentTime);\n            }\n            if (message === null) {\n                return;\n            }\n            var isChatroomMessage = message.conversationType == RongIMLib.ConversationType.CHATROOM;\n            if (!isChatroomMessage) {\n                var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n                if (msgTag >= 0) {\n                    RongIMLib.SyncTimeUtil.set(message);\n                }\n                var isSend = (message.messageDirection == RongIMLib.MessageDirection.SEND);\n                if (isSend) {\n                    var storageProvider = RongIMLib.RongIMClient._storageProvider;\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var lastSentTime = storageProvider.getItem('last_sentTime_' + userId) || 0;\n                    if (message.sentTime <= lastSentTime && !isSync) {\n                        return;\n                    }\n                }\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            // var isPersited = (RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0);\n            var msgTag = RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag();\n            var isPersited = msgTag === 3 || msgTag === 2;\n            if (isPersited) {\n                con = RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function () { },\n                    onError: function () { }\n                });\n                if (!con) {\n                    con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                }\n                if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                    var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                    var key = message.conversationType + '_' + message.targetId, info = {};\n                    if (message.content && message.content.mentionedInfo) {\n                        info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                        mentioneds = JSON.stringify(info);\n                    }\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        con.mentionedMsg = info[key];\n                    }\n                }\n                var isReceiver = message.messageDirection == RongIMLib.MessageDirection.RECEIVE;\n                if (isReceiver && message.senderUserId != Bridge._client.userId) {\n                    con.unreadMessageCount = con.unreadMessageCount + 1;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var originUnreadCount = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                        // var newUnreadCount = Number(originUnreadCount) + 1;\n                        // RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, newUnreadCount);\n                        var newUnreadCount = RongIMLib.UnreadCountHandler.add(con.conversationType, message.targetId, 1, message.sentTime);\n                        con.unreadMessageCount = newUnreadCount;\n                    }\n                }\n                con.receivedTime = new Date().getTime();\n                con.receivedStatus = message.receivedStatus;\n                con.senderUserId = message.sendUserId;\n                con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                con.latestMessageId = message.messageId;\n                con.latestMessage = message;\n                con.sentTime = message.sentTime;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) {\n                        if (!offlineMsg) {\n                            var Conversation_1 = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                            Conversation_1._notify(conversationList);\n                        }\n                    }, onError: function () { } });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            cbuIds.push(uIds[i]);\n                            sentObj.count += 1;\n                            sentObj.userIds[message.senderUserId] = message.sentTime;\n                            message.receiptResponse[uIds[i]] = sentObj.count;\n                            RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                setTimeout(function () {\n                    RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                });\n            }\n            else {\n                var count = leftCount || 0;\n                var hasMore = !isPullFinished;\n                that._onReceived(message, count, hasMore);\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        var userId = RongIMLib.Bridge._client.userId;\n                        RongIMLib.RongIMClient._storageProvider.setItem('last_sentTime_' + userId, msg.timestamp);\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg, null, null, true);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(function () {\n                                self.pottingProfile(item);\n                            }, 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                var isPullFinished = RongIMLib.RongIMClient._memoryStore.isPullFinished;\n                if (isPullFinished) {\n                    var userId = RongIMLib.Bridge._client.userId;\n                    var stroageProvider = RongIMLib.RongIMClient._storageProvider;\n                    stroageProvider.setItem('last_sentTime_' + userId, timestamp);\n                    RongIMLib.SyncTimeUtil.set({\n                        messageDirection: RongIMLib.MessageDirection.SEND,\n                        sentTime: timestamp\n                    });\n                }\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status, {\n                    messageUId: messageUId,\n                    sentTime: timestamp\n                });\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                this._client.userId = userId;\n                var self = this;\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    me._cb(userId);\n                    // setTimeout(function() { me._cb(userId); }, 500);\n                    var depend = RongIMLib.RongIMClient._memoryStore.depend;\n                    var maxConversationCount = depend.maxConversationCount;\n                    var isNotifyConversationList = depend.isNotifyConversationList;\n                    isNotifyConversationList && RongIMLib.RongIMClient._dataAccessProvider.getRemoteConversationList({\n                        onSuccess: function (conversationList) {\n                            var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                            Conversation._notify(conversationList);\n                        },\n                        onError: function (code) {\n                            console.log('内部获取列表失败: %d', code);\n                        }\n                    }, null, maxConversationCount);\n                }\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                RongIMLib.RongIMClient.getInstance().disconnect();\n                //重定向 连错 CMP\n                var me = this;\n                var _client = me._client;\n                var appId = _client.appId, token = _client.token;\n                new RongIMLib.Navigation().requestNavi(token, appId, function () {\n                    _client.clearHeartbeat();\n                    var newClient = new RongIMLib.Client(token, appId);\n                    RongIMLib.Bridge._client = newClient;\n                    newClient.__init(function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && newClient.keepLive();\n                    });\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n        }\n        Navigation.clear = function () {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.removeItem('rc_uid');\n            storage.removeItem('serverIndex');\n            storage.removeItem('rongSDK');\n        };\n        Navigation.prototype.getNaviSuccess = function (result) {\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem('fullnavi', JSON.stringify(result));\n            var server = result.server;\n            if (server) {\n                server += ',';\n            }\n            var backupServer = result.backupServer || '';\n            var tpl = '{server}{backupServer}';\n            var servers = RongIMLib.RongUtil.tplEngine(tpl, {\n                server: server,\n                backupServer: backupServer\n            });\n            servers = servers.split(',');\n            storage.setItem('servers', JSON.stringify(servers));\n            var token = RongIMLib.RongIMClient._memoryStore.token;\n            var uid = RongIMLib.InnerUtil.getUId(token);\n            storage.setItem('rc_uid', uid);\n            var userId = result.userId;\n            storage.setItem('current_user', userId);\n            if (result.voipCallInfo) {\n                var callInfo = JSON.parse(result.voipCallInfo);\n                RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                storage.setItem(\"voipStrategy\", callInfo.strategy);\n            }\n            //替换本地存储的导航信息 \n            var openMp = result.openMp;\n            storage.setItem('openMp' + uid, openMp);\n            RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n        };\n        ;\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            this.requestNavi(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.requestNavi = function (token, appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var uId = md5(token).slice(8, 16);\n                var storage = RongIMLib.RongIMClient._storageProvider;\n                var transportType = storage.getItem(\"rongSDK\");\n                var isSameType = (RongIMLib.Transportations._TransportType == transportType);\n                var _old = storage.getItem('rc_uid');\n                var isSameUser = (_old == uId);\n                var servers = storage.getItem('servers');\n                var hasServers = (typeof servers == 'string');\n                if (isSameUser && isSameType && hasServers && RongIMLib.RongUtil.hasValidWsUrl(servers)) {\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = storage.getItem(\"voipStrategy\");\n                    var openMp = storage.getItem('openMp' + uId);\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = openMp;\n                    _onsuccess();\n                    return;\n                }\n            }\n            Navigation.clear();\n            RongIMLib.RongIMClient.invalidWsUrls = [];\n            var context = this;\n            var StatusEvent = RongIMLib.Channel._ConnectionStatusListener;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var navigaters = depend.navigaters;\n            var naviTimeout = depend.naviTimeout;\n            var maxNaviRetry = depend.maxNaviRetry;\n            var isNaviJSONP = depend.isNaviJSONP;\n            var isSupportRequestHeaders = RongIMLib.RongUtil.isSupportRequestHeaders();\n            var isRequestJSONP = !isSupportRequestHeaders || isNaviJSONP;\n            var requestFunc = isRequestJSONP ? context.requestJSONP : context.request;\n            var timer = new RongIMLib.Timer({\n                timeout: naviTimeout\n            });\n            var internalRetry = 1;\n            var isRange = function () {\n                return internalRetry >= maxNaviRetry;\n            };\n            var indexTools = new RongIMLib.IndexTools({\n                items: navigaters,\n                onwheel: function () {\n                    internalRetry += 1;\n                }\n            });\n            var consume = function () {\n                if (isRange()) {\n                    _onerror(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    return;\n                }\n                var index = indexTools.get();\n                var navi = navigaters[index];\n                indexTools.add();\n                var success = function (result) {\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI);\n                    var code = result.code;\n                    if (RongIMLib.RongUtil.isEqual(code, 200)) {\n                        context.getNaviSuccess(result);\n                        _onsuccess();\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 401)) {\n                        _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                    }\n                    if (RongIMLib.RongUtil.isEqual(code, 403)) {\n                        StatusEvent.onChanged(RongIMLib.ConnectionStatus.APPKEY_IS_FAKE);\n                    }\n                };\n                var error = function (status) {\n                    if (RongIMLib.RongUtil.isEqual(status, 0)) {\n                        return;\n                    }\n                    timer.pause();\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_ERROR);\n                    consume();\n                };\n                StatusEvent.onChanged(RongIMLib.ConnectionStatus.REQUEST_NAVI);\n                var xhr = requestFunc.call(context, navi, appId, token, success, error);\n                timer.resume(function () {\n                    StatusEvent.onChanged(RongIMLib.ConnectionStatus.RESPONSE_NAVI_TIMEOUT);\n                    xhr.abort();\n                    consume();\n                });\n            };\n            consume();\n        };\n        Navigation.prototype.getPath = function (navi, appId, token, callbackName) {\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var path = (depend.isPolling ? 'cometnavi' : 'navi');\n            token = encodeURIComponent(token);\n            var sdkver = RongIMLib.RongIMClient.sdkver;\n            var random = RongIMLib.RongUtil.getTimestamp();\n            var tpl = '{navi}/{path}.js?appId={appId}&token={token}&callBack={callback}&v={sdkver}&r={random}';\n            var url = RongIMLib.RongUtil.tplEngine(tpl, {\n                navi: navi,\n                path: path,\n                appId: appId,\n                token: token,\n                sdkver: sdkver,\n                random: random,\n                callback: callbackName\n            });\n            return url;\n        };\n        Navigation.prototype.request = function (navi, appId, token, success, error) {\n            var url = this.getPath(navi, appId, token, 'getServerEndpoint');\n            return RongIMLib.RongUtil.request({\n                url: url,\n                success: function (result) {\n                    result = result.replace('getServerEndpoint(', '').replace(');', '');\n                    // 兼容私有云无分号\n                    var lastIndex = result.lastIndexOf(')');\n                    var maxIndex = result.length - 1;\n                    if (lastIndex == maxIndex) {\n                        result = result.substr(0, lastIndex);\n                    }\n                    success(JSON.parse(result));\n                },\n                error: function (status, result) {\n                    if (status == 401 || status == 403) {\n                        success(JSON.parse(result));\n                    }\n                    else {\n                        error(status);\n                    }\n                }\n            });\n        };\n        Navigation.prototype.requestJSONP = function (navi, appId, token, success, error) {\n            var callbackName = 'getServerEndpoint';\n            window.getServerEndpoint = function (result) {\n                var code = result.code;\n                if (code !== 200) {\n                    return error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n                }\n                success(result);\n            };\n            var url = this.getPath(navi, appId, token, callbackName);\n            var xss = document.createElement('script');\n            xss.src = url;\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                error(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            var depend = RongIMLib.RongIMClient._memoryStore.depend;\n            var wsScheme = depend.wsScheme;\n            var tpl = '{wsScheme}{url}';\n            url = RongIMLib.RongUtil.tplEngine(tpl, {\n                wsScheme: wsScheme,\n                url: url\n            });\n            this.socket = new WebSocket(url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                var currentTime = new Date().getTime();\n                if (currentTime - me.connectedTime <= SocketTransportation.MinConnectTime) {\n                    var host = RongIMLib.RongUtil.getUrlHost(me.url);\n                    RongIMLib.RongIMClient.invalidWsUrls.push(host);\n                }\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.WEBSOCKET_ERROR);\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n                self.connectedTime = new Date().getTime();\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                me.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        SocketTransportation.prototype.close = function () {\n            this.socket.close();\n        };\n        // 最短链接时长(若 5000ms 内, ws 自动断开, 此 ws 地址置为不可用)\n        SocketTransportation.MinConnectTime = 5000;\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            // reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            var timer = new RongIMLib.Timer({ timeout: 45000 });\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    timer.pause();\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    timer.pause();\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    timer.pause();\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            timer.resume(function () {\n                me.onError();\n            });\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            if (this.connected) {\n                this.connected = false;\n                var code = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                this.socket.fire(\"disconnect\", code);\n            }\n        };\n        PollingTransportation.prototype.close = function () {\n            this.xhr.abort();\n            this.sendxhr = null;\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:HQVCMsg\": \"HQVoiceMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfRedPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfRedPacketOpenedMessage\",\n    \"RC:CombineMsg\": \"RCCombineMessage\",\n    \"RC:chrmKVNotiMsg\": \"ChrmKVNotificationMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var SyncTimeUtil = (function () {\n        function SyncTimeUtil() {\n        }\n        SyncTimeUtil.$getKey = function (message) {\n            var client = RongIMLib.Bridge._client;\n            var userId = client.userId;\n            var direction = (message.messageDirection == 1 ? 'send' : 'receive');\n            var appkey = RongIMLib.RongIMClient._memoryStore.appKey;\n            var tpl = '{appkey}_{userId}_{direction}box';\n            return RongIMLib.RongUtil.tplEngine(tpl, {\n                appkey: appkey,\n                userId: userId,\n                direction: direction\n            });\n        };\n        SyncTimeUtil.set = function (message) {\n            var key = SyncTimeUtil.$getKey(message);\n            var sentTime = message.sentTime;\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            storage.setItem(key, sentTime);\n        };\n        SyncTimeUtil.get = function () {\n            var sent = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.SEND\n            });\n            var received = SyncTimeUtil.$getKey({\n                messageDirection: RongIMLib.MessageDirection.RECEIVE\n            });\n            var storage = RongIMLib.RongIMClient._storageProvider;\n            return {\n                sent: Number(storage.getItem(sent) || 0),\n                received: Number(storage.getItem(received) || 0)\n            };\n        };\n        return SyncTimeUtil;\n    })();\n    RongIMLib.SyncTimeUtil = SyncTimeUtil;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            var IMLib = RongIMLib;\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var typeName = typeMapping[objectName];\n                message.content = new IMLib[typeName](de);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var typeName = registerMessageTypeMapping[objectName];\n                var regMsg = new IMLib.RongIMClient.RegisterMessage[typeName](de);\n                if (isUseDef) {\n                    message.content = regMsg.decode(de);\n                }\n                else {\n                    message.content = regMsg;\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            var selfUserId = RongIMLib.Bridge._client.userId;\n            // 解决多端在线收自己发的消息时, messageDirection 为 2(接收), 导致未读数增加\n            var isSelfSend = entity.direction == 1 || message.senderUserId === selfUserId;\n            if (isSelfSend) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            // 自己给自己发的消息, messageDirection 为 2(接收)\n            var isSelfToSelf = message.senderUserId === selfUserId && message.targetId === selfUserId;\n            if (isSelfToSelf) {\n                message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        MessageUtil.detectCMP = function (options) {\n            var xhr = new XMLHttpRequest();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        options.success();\n                    }\n                    else {\n                        options.fail(xhr.status);\n                    }\n                }\n            };\n            var method = options.url;\n            var url = options.url;\n            var method = options.method || 'GET';\n            xhr.open(method, url);\n            var headers = options.headers;\n            for (var key in headers) {\n                var value = headers[key];\n                xhr.setRequestHeader(key, value);\n            }\n            var body = JSON.stringify(options.body || {});\n            xhr.send(body);\n            return xhr;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                this.messageId = 0;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n    var ChrmKVCaches = (function () {\n        function ChrmKVCaches() {\n            this.time = 0;\n            this.cache = {};\n        }\n        ChrmKVCaches.prototype.setTime = function (time) {\n            this.time = time;\n        };\n        ChrmKVCaches.prototype.getTime = function () {\n            return this.time;\n        };\n        ChrmKVCaches.prototype.setValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            this.cache[key] = {\n                value: kvContent.value,\n                userId: kvContent.userId,\n                isDeleted: false,\n                timestamp: timestamp\n            };\n        };\n        ChrmKVCaches.prototype.removeValue = function (kvContent) {\n            var key = kvContent.key, timestamp = kvContent.timestamp;\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            this.cache[key] = RongIMLib.RongUtil.extend(cache, {\n                isDeleted: true,\n                userId: kvContent.userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVCaches.prototype.getValue = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            return cache.isDeleted ? null : cache.value;\n        };\n        ChrmKVCaches.prototype.getAllKV = function () {\n            var kv = {};\n            RongIMLib.RongUtil.forEach(this.cache, function (item, key) {\n                if (!item.isDeleted) {\n                    kv[key] = item.value;\n                }\n            });\n            return kv;\n        };\n        ChrmKVCaches.prototype.getSetUserId = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            return this.cache[key].userId;\n        };\n        ChrmKVCaches.prototype.isKeyExisted = function (key) {\n            this.cache[key] = this.cache[key] || {};\n            var cache = this.cache[key];\n            var hasValue = !RongIMLib.RongUtil.isEmpty(cache.value);\n            return hasValue && !cache.isDeleted;\n        };\n        ChrmKVCaches.prototype.clear = function () {\n            this.cache = {};\n        };\n        return ChrmKVCaches;\n    })();\n    var chrmKVCaches = {};\n    var chrmKVProsumerCaches = {};\n    var getKVCache = function (chrmId) {\n        var chrmKVCache = chrmKVCaches[chrmId];\n        if (!chrmKVCache) {\n            chrmKVCache = chrmKVCaches[chrmId] = new ChrmKVCaches();\n        }\n        return chrmKVCache;\n    };\n    var getKVProsumer = function (chrmId) {\n        var kvProsumer = chrmKVProsumerCaches[chrmId];\n        if (!kvProsumer) {\n            kvProsumer = chrmKVProsumerCaches[chrmId] = new RongIMLib.RongUtil.Prosumer();\n        }\n        return kvProsumer;\n    };\n    var ChrmKVHandler = (function () {\n        function ChrmKVHandler() {\n        }\n        ChrmKVHandler.pull = function (chrmId, time) {\n            var prosumer = getKVProsumer(chrmId);\n            var event = RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry;\n            prosumer.produce({ event: event, chrmId: chrmId, time: time });\n            prosumer.consume(function (params, next) {\n                var event = params.event, chrmId = params.chrmId, time = params.time;\n                var kvCache = getKVCache(chrmId);\n                var currentTime = kvCache.getTime();\n                var isKVNeedUpdated = currentTime < time;\n                if (isKVNeedUpdated) {\n                    event(chrmId, currentTime, {\n                        onSuccess: function (result) {\n                            ChrmKVHandler.setEntries(chrmId, result);\n                            next();\n                        },\n                        onError: next\n                    });\n                }\n                else {\n                    next();\n                }\n            });\n        };\n        ChrmKVHandler.setEntries = function (chrmId, entity) {\n            var entries = entity.entries, isFullUpdate = entity.bFullUpdate, syncTime = entity.syncTime;\n            var event = isFullUpdate ? ChrmKVHandler.setFullEntries : ChrmKVHandler.setIncreEntries;\n            var kvCache = getKVCache(chrmId);\n            syncTime = MessageUtil.int64ToTimestamp(syncTime);\n            if (RongIMLib.RongUtil.isArray(entries)) {\n                RongIMLib.RongUtil.forEach(entries, function (item) {\n                    var setTime = item.timestamp;\n                    if (!RongIMLib.RongUtil.isNumber(setTime)) {\n                        item.timestamp = MessageUtil.int64ToTimestamp(setTime);\n                    }\n                });\n            }\n            kvCache.setTime(syncTime); // 更新拉取时间\n            event(chrmId, entries); // 更新 kv 值\n        };\n        ChrmKVHandler.setEntry = function (chrmId, chatroomEntry, status, userId) {\n            var kvCache = getKVCache(chrmId);\n            var timestamp = chatroomEntry.timestamp || +new Date();\n            var isDelete = RongInnerTools.getChrmEntityByStatus(status).isDelete;\n            var eventName = isDelete ? 'removeValue' : 'setValue';\n            kvCache[eventName]({\n                key: chatroomEntry.key,\n                value: chatroomEntry.value,\n                userId: userId,\n                timestamp: timestamp\n            });\n        };\n        ChrmKVHandler.setFullEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            kvCache.clear();\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                entity.timestamp = MessageUtil.int64ToTimestamp(entity.timestamp);\n                kvCache.setValue({\n                    key: entity.key,\n                    value: entity.value,\n                    userId: entity.uid,\n                    timestamp: entity.timestamp\n                });\n            });\n        };\n        ChrmKVHandler.setIncreEntries = function (chrmId, entries) {\n            var kvCache = getKVCache(chrmId);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var optEvent = function (entity, isOverwrite, eventName) {\n                var key = entity.key, value = entity.value;\n                var isLatestedKeySetBySelf = kvCache.getSetUserId(key) === currentUserId;\n                var isKeyNotExist = !kvCache.isKeyExisted(key);\n                /*\n                    1. 需覆盖时, 不管 key 是否已存在, 都直接设置\n                    2. 不覆盖时, 必须最后一次 key 为自己设置的或此 key 还未设置过, 才能继续\n                 */\n                if (isOverwrite || isLatestedKeySetBySelf || isKeyNotExist) {\n                    kvCache[eventName]({\n                        key: key,\n                        value: value,\n                        userId: entity.uid,\n                        timestamp: entity.timestamp\n                    });\n                }\n            };\n            RongIMLib.RongUtil.forEach(entries, function (entity) {\n                var entityContent = RongInnerTools.getChrmEntityByStatus(entity.status);\n                var eventName = entityContent.isDelete ? 'removeValue' : 'setValue';\n                optEvent(entity, entityContent.isOverwrite, eventName);\n            });\n        };\n        ChrmKVHandler.getEntityValue = function (chrmId, key) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getValue(key);\n        };\n        ChrmKVHandler.getAllEntityValue = function (chrmId) {\n            var kvCache = getKVCache(chrmId);\n            return kvCache.getAllKV();\n        };\n        ChrmKVHandler.isKeyValid = function (key) {\n            return /^[A-Za-z0-9_=+-]+$/.test(key);\n        };\n        return ChrmKVHandler;\n    })();\n    RongIMLib.ChrmKVHandler = ChrmKVHandler;\n    var AutoDeleteCode = 0x0001;\n    var OverwriteCode = 0x0002;\n    var DeleteOperationCode = 0x0004;\n    var RongInnerTools = (function () {\n        function RongInnerTools() {\n        }\n        RongInnerTools.convertUserStatus = function (entity) {\n            entity = RongIMLib.RongUtil.rename(entity, { subUserId: 'userId' });\n            var status = JSON.parse(entity.status);\n            var us = status.us;\n            if (!us) {\n                return entity;\n            }\n            entity.status = RongIMLib.RongUtil.rename(us, { o: 'online', 'p': 'platform', s: 'status' });\n            return entity;\n        };\n        RongInnerTools.getChrmEntityStatus = function (entity, chatroomOpt) {\n            var status = 0;\n            // 是否自动清理\n            if (entity.isAutoDelete) {\n                status = status | AutoDeleteCode;\n            }\n            // 是否覆盖\n            if (entity.isOverwrite) {\n                status = status | OverwriteCode;\n            }\n            // 操作类型\n            switch (chatroomOpt) {\n                case RongIMLib.ChatroomEntityOpt.DELETE:\n                    status = status | DeleteOperationCode;\n                    break;\n                default:\n                    break;\n            }\n            return status;\n        };\n        RongInnerTools.getChrmEntityByStatus = function (status) {\n            var isDelete = !!(status & DeleteOperationCode);\n            var entityOpt = isDelete ? RongIMLib.ChatroomEntityOpt.DELETE : RongIMLib.ChatroomEntityOpt.UPDATE;\n            return {\n                isAutoDelete: !!(status & AutoDeleteCode),\n                isOverwrite: !!(status & OverwriteCode),\n                entityOpt: entityOpt,\n                isDelete: isDelete\n            };\n        };\n        return RongInnerTools;\n    })();\n    RongIMLib.RongInnerTools = RongInnerTools;\n    var UnreadCountHandler = (function () {\n        function UnreadCountHandler() {\n        }\n        UnreadCountHandler.getKey = function (type, targetId) {\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            return RongIMLib.RongUtil.tplEngine(UnreadCountHandler.KeyTemp, {\n                selfId: selfId,\n                type: type,\n                targetId: targetId\n            });\n        };\n        UnreadCountHandler.getDetailByKey = function (key) {\n            var detail = { count: 0, sentTime: 0 };\n            var value = RongIMLib.RongIMClient._storageProvider.getItem(key) + '';\n            if (!value) {\n                return detail;\n            }\n            var unreadItems = value.split('_');\n            var hasUnderline = unreadItems.length > 1;\n            detail.count = Number(unreadItems[0]);\n            if (hasUnderline) {\n                detail.sentTime = Number(unreadItems[1]);\n            }\n            return detail;\n        };\n        UnreadCountHandler.getDetail = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            var detail = UnreadCountHandler.getDetailByKey(key);\n            return detail;\n        };\n        UnreadCountHandler.set = function (type, id, count, sentTime) {\n            var key = UnreadCountHandler.getKey(type, id);\n            var value = sentTime ? RongIMLib.RongUtil.tplEngine(UnreadCountHandler.ValueTemp, {\n                count: count,\n                sentTime: sentTime\n            }) : count;\n            RongIMLib.RongIMClient._storageProvider.setItem(key, value);\n            return count;\n        };\n        UnreadCountHandler.add = function (type, id, plusCount, sentTime) {\n            var detail = UnreadCountHandler.getDetail(type, id), count = detail.count, oldSentTime = detail.sentTime;\n            if (sentTime && sentTime > oldSentTime) {\n                count = count + plusCount;\n                UnreadCountHandler.set(type, id, count, sentTime);\n            }\n            return count;\n        };\n        UnreadCountHandler.get = function (type, id) {\n            var detail = UnreadCountHandler.getDetail(type, id);\n            return detail.count;\n        };\n        UnreadCountHandler.getAll = function (types) {\n            var total = 0;\n            var selfId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var setTotal = function (keyList) {\n                RongIMLib.RongUtil.forEach(keyList, function (key) {\n                    var detail = UnreadCountHandler.getDetailByKey(key);\n                    total += detail.count;\n                });\n            };\n            if (types) {\n                RongIMLib.RongUtil.forEach(types, function (type) {\n                    var key = UnreadCountHandler.getKey(type, '');\n                    var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                    setTotal(unreadKeys);\n                });\n            }\n            else {\n                var key = UnreadCountHandler.getKey('', '');\n                var unreadKeys = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n                setTotal(unreadKeys);\n            }\n            return total;\n        };\n        UnreadCountHandler.remove = function (type, targetId) {\n            var key = UnreadCountHandler.getKey(type, targetId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(key);\n        };\n        UnreadCountHandler.clear = function () {\n            var key = UnreadCountHandler.getKey('', '');\n            var keyList = RongIMLib.RongIMClient._storageProvider.getItemKeyList(key);\n            RongIMLib.RongUtil.forEach(keyList, function (key) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(key);\n            });\n        };\n        UnreadCountHandler.KeyTemp = 'cu{selfId}{type}{targetId}';\n        UnreadCountHandler.ValueTemp = '{count}_{sentTime}';\n        return UnreadCountHandler;\n    })();\n    RongIMLib.UnreadCountHandler = UnreadCountHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            // if (fields.length < 1) {\n            //     throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            // }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    me[fields[index]] = message[fields[index]];\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            if (message) {\n                this.requestInfo = message.requestInfo;\n                this.userInfo = message.userInfo;\n            }\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfRedPacketMessage = (function () {\n        function JrmfRedPacketMessage(message) {\n            this.messageName = 'JrmfRedPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketMessage;\n    })();\n    RongIMLib.JrmfRedPacketMessage = JrmfRedPacketMessage;\n    var JrmfRedPacketOpenedMessage = (function () {\n        function JrmfRedPacketOpenedMessage(message) {\n            this.messageName = 'JrmfRedPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfRedPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfRedPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfRedPacketOpenedMessage = JrmfRedPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var HQVoiceMessage = (function () {\n        function HQVoiceMessage(message) {\n            this.messageName = \"HQVoiceMessage\";\n            this.type = message.type || 'aac';\n            message.localPath && (this.localPath = message.localPath);\n            message.remoteUrl && (this.remoteUrl = message.remoteUrl);\n            message.duration && (this.duration = message.duration);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        HQVoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HQVoiceMessage;\n    })();\n    RongIMLib.HQVoiceMessage = HQVoiceMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.mediaId = message.mediaId;\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n            this.existedUserPofiles = message.existedUserPofiles;\n            this.observerUserIds = message.observerUserIds;\n            this.mode = message.mode;\n            this.subInfo = message.subInfo;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n    var RCCombineMessage = (function () {\n        function RCCombineMessage(message) {\n            this.messageName = \"RCCombineMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RCCombineMessage.\");\n            }\n            this.nameList = message.nameList;\n            this.remoteUrl = message.remoteUrl;\n            if (message.user) {\n                this.user = message.user;\n            }\n            this.summaryList = message.summaryList;\n        }\n        RCCombineMessage.obtain = function (remoteUrl, nameList, summaryList) {\n            return new RCCombineMessage({ extra: \"\", content: remoteUrl, nameList: nameList, summaryList: summaryList });\n        };\n        RCCombineMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RCCombineMessage;\n    })();\n    RongIMLib.RCCombineMessage = RCCombineMessage;\n    var ChrmKVNotificationMessage = (function () {\n        function ChrmKVNotificationMessage(message) {\n            this.messageName = \"ChrmKVNotificationMessage\";\n            message.key && (this.key = message.key);\n            message.value && (this.value = message.value);\n            message.type && (this.type = message.type);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        ChrmKVNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChrmKVNotificationMessage;\n    })();\n    RongIMLib.ChrmKVNotificationMessage = ChrmKVNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention, _readTime) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n            this._readTime = _readTime;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        MessageTag.getTagByStatus = function (status) {\n            var statusMap = {\n                3: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                2: {\n                    isCounted: true,\n                    isPersited: false\n                },\n                1: {\n                    isCounted: true,\n                    isPersited: true\n                },\n                0: {\n                    isCounted: true,\n                    isPersited: true\n                }\n            };\n            return statusMap[status] || statusMap[3];\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n    var User = (function () {\n        function User(id, token) {\n            this.id = id;\n            this.token = token;\n        }\n        return User;\n    })();\n    RongIMLib.User = User;\n    var Room = (function () {\n        function Room(id, user, mode, broadcastType, type) {\n            this.id = id;\n            this.user = user;\n            this.mode = mode;\n            this.broadcastType = broadcastType;\n            this.type = type;\n        }\n        return Room;\n    })();\n    RongIMLib.Room = Room;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n            this.userStatusListener = null;\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                    this.watcher.add(_watcher);\n                    var conversationList = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    this.watcher.emit(conversationList);\n                },\n                unwatch: function (_watcher) {\n                    this.watcher.remove(_watcher);\n                },\n                _notify: function (conversationList) {\n                    this.watcher.emit(conversationList);\n                }\n            };\n        }\n        ServerDataProvider.prototype.init = function (appKey, options) {\n            new RongIMLib.FeatureDectector(options.appCallback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback, userId, option) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            userId = userId || '';\n            option = option || {};\n            var isConnecting = false, isConnected = false;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel) {\n                isConnecting = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING);\n                isConnected = (RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED);\n            }\n            if (isConnected || isConnecting) {\n                return;\n            }\n            var isGreater = (RongIMLib.RongIMClient.otherDeviceLoginCount > 5);\n            if (isGreater) {\n                callback.onError(RongIMLib.ConnectionStatus.ULTRALIMIT);\n                return;\n            }\n            // 清除本地导航缓存\n            if (option.force) {\n                RongIMLib.RongIMClient._storageProvider.removeItem('servers');\n            }\n            RongIMLib.RongIMClient.bridge.setListener();\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            config = config || {};\n            var order = config.order || 0;\n            var getKey = function () {\n                return [conversationType, targetId, '_', order].join('');\n            };\n            var key = getKey();\n            if (!RongIMLib.RongUtil.isNumber(timestamp)) {\n                timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(key);\n            }\n            var memoryStore = RongIMLib.RongIMClient._memoryStore;\n            var historyMessageLimit = memoryStore.historyMessageLimit;\n            /*\n                limit 属性:\n                var limit = {\n                    time: '时间戳, 最后一次拉取时间',\n                    hasMore: '是否还有历史消息, bool 值'\n                };\n            */\n            var limit = historyMessageLimit.get(key) || {};\n            var hasMore = limit.hasMore;\n            var isFecth = (hasMore || limit.time != timestamp);\n            // 正序获取消息时不做限制，防止有新消息导致无法获取\n            if (!isFecth && order == 0) {\n                return callback.onSuccess([], hasMore);\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput(), self = this;\n            modules.setTargetId(targetId);\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            var topic = HistoryMsgType[conversationType] || HistoryMsgType[RongIMLib.ConversationType.PRIVATE];\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    var fetchTime = RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(key, fetchTime);\n                    historyMessageLimit.set(key, {\n                        hasMore: !!data.hasMsg,\n                        time: fetchTime\n                    });\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            tempMsg.targetId = targetId;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + RongIMLib.RongUtil.getTimestamp();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    setTimeout(function () {\n                        if (conversationTypes) {\n                            return callback.onSuccess(self.filterConversations(conversationTypes, conversations));\n                        }\n                        callback.onSuccess(conversations);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    var navi = RongIMLib.RongIMClient.getInstance().getNavi();\n                    var isOpenKVStorage = navi.kvStorage;\n                    if (isOpenKVStorage) {\n                        RongIMLib.RongIMClient._dataAccessProvider.pullChatroomEntry(chatroomId, 0, {\n                            onSuccess: function (result) {\n                                RongIMLib.ChrmKVHandler.setEntries(chatroomId, result);\n                                setTimeout(function () {\n                                    callback.onSuccess();\n                                });\n                            },\n                            onError: function (errorCode) {\n                                setTimeout(function () {\n                                    callback.onError(errorCode);\n                                });\n                            }\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess();\n                        });\n                    }\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var list = collection.list;\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            var latestMessage = list[list.length - 1];\n                            if (latestMessage) {\n                                latestMessage = RongIMLib.MessageUtil.messageParser(latestMessage);\n                                sync = latestMessage.sentTime;\n                            }\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var _client = RongIMLib.Bridge._client;\n                            for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                var uId = 'R' + list[i].msgId;\n                                if (!(uId in _client.cacheMessageIds)) {\n                                    _client.cacheMessageIds[uId] = true;\n                                    var cacheUIds = RongIMLib.RongUtil.keys(_client.cacheMessageIds);\n                                    if (cacheUIds.length > 10) {\n                                        uId = cacheUIds[0];\n                                        delete _client.cacheMessageIds[uId];\n                                    }\n                                    if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                        for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                            if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                                _client.handler.onReceived(list[i]);\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        _client.handler.onReceived(list[i]);\n                                    }\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.UPDATE;\n            var key = chatroomEntry.key, value = chatroomEntry.value;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            var isValueInValid = !RongIMLib.RongUtil.isLengthLimit(value, RongIMLib.ChatroomEntityLimit.VALUE, 1);\n            if (isKeyInValid || isValueInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.setChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            var opt = RongIMLib.ChatroomEntityOpt.DELETE;\n            var key = chatroomEntry.key;\n            var isKeyInValid = !RongIMLib.RongUtil.isLengthLimit(key, RongIMLib.ChatroomEntityLimit.KEY, 1) || !RongIMLib.ChrmKVHandler.isKeyValid(key);\n            if (isKeyInValid) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.BIZ_ERROR_INVALID_PARAMETER);\n                });\n            }\n            else {\n                this.refreshChatroomEntry(chatroomId, chatroomEntry, opt, callback);\n            }\n        };\n        ServerDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n            chatroomEntry.isOverwrite = true;\n            this.removeChatroomEntry(chatroomId, chatroomEntry, callback);\n        };\n        ServerDataProvider.prototype.refreshChatroomEntry = function (chatroomId, chatroomEntry, chatroomEntryOpt, callback) {\n            var modules, topic;\n            var key = chatroomEntry.key, value = chatroomEntry.value || '', extra = chatroomEntry.notificationExtra;\n            if (chatroomEntryOpt === RongIMLib.ChatroomEntityOpt.DELETE) {\n                modules = new RongIMLib.RongIMClient.Protobuf.DeleteChrmKV();\n                topic = 'delKV';\n            }\n            else {\n                modules = new RongIMLib.RongIMClient.Protobuf.SetChrmKV();\n                topic = 'setKV';\n            }\n            var status = RongIMLib.RongInnerTools.getChrmEntityStatus(chatroomEntry, chatroomEntryOpt);\n            var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n            var entry = {\n                key: key,\n                value: value,\n                uid: currentUserId\n            };\n            if (status) {\n                entry.status = status;\n            }\n            modules.setEntry(entry);\n            if (chatroomEntry.isSendNotification) {\n                modules.setBNotify(true);\n                var msgModules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n                var msg = new RongIMLib.ChrmKVNotificationMessage({\n                    key: key,\n                    value: value,\n                    extra: extra,\n                    type: chatroomEntryOpt\n                });\n                msgModules.setSessionId(RongIMLib.RongIMClient.MessageParams[msg.messageName].msgTag.getMessageTag());\n                msgModules.setClassname(RongIMLib.RongIMClient.MessageParams[msg.messageName].objectName);\n                msgModules.setContent(msg.encode());\n                modules.setNotification(msgModules);\n                // 默认设置为 聊天室消息\n                modules.setType(RongIMLib.ConversationType.CHATROOM);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (ret) {\n                    var currentUserId = RongIMLib.RongIMClient.getInstance().getCurrentUserId();\n                    RongIMLib.ChrmKVHandler.setEntry(chatroomId, chatroomEntry, status, currentUserId);\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'ChrmOutput');\n        };\n        ServerDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n            var value = RongIMLib.ChrmKVHandler.getEntityValue(chatroomId, key);\n            setTimeout(function () {\n                if (RongIMLib.RongUtil.isEmpty(value)) {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_KEY_NOT_EXIST);\n                }\n                else {\n                    callback.onSuccess(value);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n            setTimeout(function () {\n                var entries = RongIMLib.ChrmKVHandler.getAllEntityValue(chatroomId);\n                callback.onSuccess(entries);\n            });\n        };\n        ServerDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChrmKV();\n            modules.setTimestamp(time);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullKV', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmKVOutput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        ServerDataProvider.prototype.getPullSetting = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.PullUserSettingInput();\n            var version = parseInt(RongIMLib.RongIMClient.sdkver);\n            modules.setVersion(version);\n            RongIMLib.RongIMClient.bridge.queryMsg('pullUS', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    result = result || {};\n                    result.version = RongIMLib.MessageUtil.int64ToTimestamp(result.version);\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errcode) {\n                    setTimeout(function () {\n                        callback.onError(errcode);\n                    });\n                }\n            }, 'PullUserSettingOutput');\n        };\n        ServerDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.getPullSetting({\n                onSuccess: function (result) {\n                    /**\n                     * GetQNupTokenOutput 第一位为 int64, 第二位为 string, 与设置离线消息一致\n                     * 为避免修改 Protobuf 带来的更新成本. 仅复用, 不重新命名\n                    */\n                    var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenOutput();\n                    var version = result.version;\n                    modules.setDeadline(version);\n                    modules.setToken(duration + '');\n                    RongIMLib.RongIMClient.bridge.queryMsg('setOfflineMsgDur', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                        onSuccess: function (data) {\n                            setTimeout(function () {\n                                callback.onSuccess(data);\n                            });\n                        },\n                        onError: function (errcode) {\n                            setTimeout(function () {\n                                callback.onError(errcode);\n                            });\n                        }\n                    });\n                },\n                onError: callback.onError\n            });\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                });\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                setTimeout(function () {\n                    sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                });\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (userIds) {\n                modules.setUserId(userIds);\n            }\n            var flag = 0;\n            if (params.isPush || params.isVoipPush) {\n                flag |= 0x01;\n            }\n            if (params.isFilerWhiteBlacklist) {\n                flag |= 0x02;\n            }\n            modules.setConfigFlag(flag);\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var me = this, msg = new RongIMLib.Message();\n            var c = this.getConversation(conversationType, targetId);\n            if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                if (!c) {\n                    c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                }\n                c.sentTime = new Date().getTime();\n                c.sentStatus = RongIMLib.SentStatus.SENDING;\n                c.senderUserName = \"\";\n                c.senderUserId = RongIMLib.Bridge._client.userId;\n                c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                c.latestMessage = msg;\n                c.unreadMessageCount = 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n            }\n            RongIMLib.RongIMClient._memoryStore.converStore = c;\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        var Conversation = RongIMLib.RongIMClient._dataAccessProvider.Conversation;\n                        Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        msg.messageUId = data.messageUId;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode, _msg) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (_msg) {\n                        msg.messageUId = _msg.messageUId;\n                        msg.sentTime = _msg.sentTime;\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onChanged)) {\n                RongIMLib.RongIMClient.statusListeners.push(listener.onChanged);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongUtil.isObject(listener) && RongIMLib.RongUtil.isFunction(listener.onReceived)) {\n                RongIMLib.RongIMClient.messageListeners.push(listener.onReceived);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    // RongIMClient._memoryStore.conversationList[i] = conversation;\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback && callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var isRemoved = false;\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            isRemoved = true;\n                            break;\n                        }\n                    }\n                    isRemoved && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf.DeleteMsgInput) {\n                throw new Error('SDK Protobuf version is too low');\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.DeleteMsgInput();\n            var msgs = [];\n            RongIMLib.RongUtil.forEach(messages, function (msg) {\n                msgs.push({\n                    msgId: msg.messageUId,\n                    msgDataTime: msg.sentTime,\n                    direct: msg.messageDirection\n                });\n            });\n            modules.setType(conversationType);\n            modules.setConversationId(targetId);\n            modules.setMsgs(msgs);\n            RongIMLib.RongIMClient.bridge.queryMsg('delMsg', RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, 'DeleteMsgOutput');\n        };\n        ServerDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CleanHisMsgInput();\n            var conversationType = params.conversationType;\n            var _topic = {\n                1: 'cleanPMsg',\n                2: 'cleanDMsg',\n                3: 'cleanGMsg',\n                5: 'cleanCMsg',\n                6: 'cleanSMsg'\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            var timestamp = params.timestamp;\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            modules.setDataTime(timestamp);\n            var targetId = params.targetId;\n            modules.setTargetId(targetId);\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (result) {\n                    callback.onSuccess(!result);\n                }, onError: function (error) {\n                    // error 1 历史消息云存储没有开通、传入时间大于服务器时间 清除失败，1 与其他错误码冲突，所以自定义错误码返回\n                    if (error == 1) {\n                        error = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                    }\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            this.clearRemoteHistoryMessages(params, callback);\n        };\n        // 兼容老版本\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            setTimeout(function () {\n                                callback.onError(errorCode);\n                            });\n                        }\n                    }, null);\n                }\n            }\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n                        var count = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            setTimeout(function () {\n                callback && callback.onSuccess(conver);\n            });\n            return conver;\n        };\n        ServerDataProvider.prototype.filterConversations = function (types, list) {\n            var conversaions = [];\n            RongIMLib.RongUtil.forEach(types, function (type) {\n                RongIMLib.RongUtil.forEach(list, function (conversation) {\n                    if (conversation.conversationType == type) {\n                        conversaions.push(conversation);\n                    }\n                });\n            });\n            return conversaions;\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var that = this;\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var isLocalInclude = list.length > count;\n            if (!isSync && isLocalInclude) {\n                setTimeout(function () {\n                    var localList = list.slice(0, count);\n                    if (conversationTypes) {\n                        localList = that.filterConversations(conversationTypes, localList);\n                    }\n                    callback.onSuccess(localList);\n                });\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            // var count = RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + item.conversationType + item.targetId);\n                            var count = RongIMLib.UnreadCountHandler.get(item.conversationType, item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    setTimeout(function () {\n                        callback.onSuccess(list);\n                    });\n                },\n                onError: function (errorcode) {\n                    setTimeout(function () {\n                        callback.onError(errorcode);\n                    });\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList = true;\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, order) {\n            var config = {\n                objectname: objectname,\n                order: order\n            };\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback, config);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = RongIMLib.UnreadCountHandler.getAll(conversationTypes);\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            setTimeout(function () {\n                callback.onSuccess(count);\n            });\n        };\n        //由于 Web 端未读消息数按会话统计，撤回消息会导致未读数不准确，提供设置未读数接口，桌面版不实现此方法\n        ServerDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count, sentTime) {\n            sentTime = sentTime || new Date().getTime();\n            RongIMLib.UnreadCountHandler.set(conversationType, targetId, count, sentTime);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            var unreadCount = RongIMLib.UnreadCountHandler.get(conversationType, targetId);\n            setTimeout(function () {\n                callback.onSuccess(unreadCount || 0);\n            });\n        };\n        ServerDataProvider.prototype.cleanMentioneds = function (conver) {\n            if (conver) {\n                conver.mentionedMsg = null;\n                var targetId = conver.targetId;\n                var conversationType = conver.conversationType;\n                var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                if (mentioneds) {\n                    var info = JSON.parse(mentioneds);\n                    delete info[conversationType + \"_\" + targetId];\n                    if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                        RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                    }\n                    else {\n                        RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                    }\n                }\n            }\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            var me = this;\n            // RongIMClient._storageProvider.removeItem(\"cu\" + Bridge._client.userId + conversationType + targetId);\n            RongIMLib.UnreadCountHandler.remove(conversationType, targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver = conver || new RongIMLib.Conversation();\n                    var isNotifyConversation = conver.unreadMessageCount;\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                        isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            var me = this;\n            var isNotifyConversation = false;\n            if (list) {\n                // 清除 mentioneds、清除 list 中的 unreadMessageCount\n                for (var i = 0; i < list.length; i++) {\n                    var conver = list[i];\n                    if (conver) {\n                        isNotifyConversation = conver.unreadMessageCount ? true : isNotifyConversation;\n                        conver.unreadMessageCount = 0;\n                        me.cleanMentioneds(conver);\n                    }\n                }\n            }\n            RongIMLib.UnreadCountHandler.clear();\n            setTimeout(function () {\n                callback.onSuccess(true);\n                isNotifyConversation && RongIMLib.RongIMClient._dataAccessProvider.Conversation._notify(RongIMLib.RongIMClient._memoryStore.conversationList);\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                setTimeout(function () {\n                    callback.onSuccess(status);\n                });\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                setTimeout(function () {\n                    callback.onError(error);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetUserStatusInput();\n            userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(35, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    status = RongIMLib.RongInnerTools.convertUserStatus(status);\n                    setTimeout(function () {\n                        callback.onSuccess(status);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'GetUserStatusOutput');\n            // callback.onSuccess(new UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            if (status) {\n                modules.setStatus(status);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(36, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback.onError(e);\n                    });\n                }\n            }, 'SetUserStatusOutput');\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SubUserStatusInput();\n            var userId = RongIMLib.Bridge._client.userId;\n            modules.setUserid(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(37, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback && callback.onSuccess(true);\n                    });\n                }, onError: function (e) {\n                    setTimeout(function () {\n                        callback && callback.onError(e);\n                    });\n                }\n            }, 'SubUserStatusOutput');\n        };\n        ServerDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            RongIMLib.RongIMClient.userStatusListener = callback;\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            setTimeout(function () {\n                callback.onSuccess(true);\n            });\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            setTimeout(function () {\n                callback.onSuccess([]);\n            });\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            var client = RongIMLib.Bridge._client || {};\n            var channel = client.channel || {};\n            var status = RongIMLib.ConnectionStatus.CONNECTION_CLOSED;\n            if (typeof channel.connectionStatus == 'number') {\n                status = channel.connectionStatus;\n            }\n            return status;\n        };\n        ServerDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMLib.RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (result) {\n                    setTimeout(function () {\n                        callback.onSuccess(result);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"VoipDynamicOutput\");\n        };\n        ServerDataProvider.prototype.setDeviceInfo = function (deviceId) {\n        };\n        ServerDataProvider.prototype.setEnvironment = function (isPrivate) {\n        };\n        ServerDataProvider.prototype.clearData = function () {\n            return true;\n        };\n        ServerDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            setTimeout(function () {\n                callback.onSuccess(profile);\n            });\n        };\n        ServerDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMLib.RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMLib.RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMLib.RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        setTimeout(function () {\n                            callback && callback.onSuccess(data);\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            callback && callback.onError(errorCode);\n                        });\n                    }\n                }, \"PullMpOutput\");\n            }\n        };\n        ServerDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            // 1 是正序,2是倒序\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess(users);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.getRTCUserList = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUList\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess({\n                        users: result.list\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQueryListInput();\n            modules.setOrder(2);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRInfo\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var room = {\n                        id: result.roomId,\n                        total: result.userCount\n                    };\n                    RongIMLib.RongUtil.forEach(result.roomData, function (data) {\n                        room[data.key] = data.value;\n                    });\n                    callback.onSuccess(room);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcRoomInfoOutput\");\n        };\n        ServerDataProvider.prototype.setRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcValueInfo();\n            modules.setKey(info.key);\n            modules.setValue(info.value);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRPut\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeRTCRoomInfo = function (room, info, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcKeyDeleteInput();\n            var keys = info.keys || [];\n            if (!RongIMLib.RongUtil.isArray(keys)) {\n                keys = [keys];\n            }\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRDel\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRJoin_data\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    var users = {};\n                    var list = result.list, token = result.token, sessionId = result.sessionId;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        var userId = item.userId;\n                        var tmpData = {};\n                        RongIMLib.RongUtil.forEach(item.userData, function (data) {\n                            var key = data.key;\n                            var value = data.value;\n                            tmpData[key] = value;\n                        });\n                        users[userId] = tmpData;\n                    });\n                    callback.onSuccess({\n                        users: users,\n                        token: token,\n                        sessionId: sessionId\n                    });\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcUserListOutput\");\n        };\n        ServerDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.SetUserStatusInput();\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcRExit\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function () {\n                    callback.onSuccess(true);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.RTCPing = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcPing\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, callback);\n        };\n        ServerDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(key);\n            modules.setValue(value);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, {\n                onSuccess: function (result) {\n                    var props = {};\n                    var list = result.outInfo;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                },\n                onError: callback.onError\n            }, \"RtcQryOutput\");\n        };\n        ServerDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcDataInput();\n            modules.setInterior(isInner);\n            modules.setTarget(apiType);\n            modules.setKey(keys);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcDelData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        ServerDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback);\n        };\n        ServerDataProvider.prototype.removeRTCUserData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        ServerDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        ServerDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        ServerDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcSetOutDataInput();\n            modules.setTarget(type);\n            if (!RongIMLib.RongUtil.isArray(data)) {\n                data = [data];\n            }\n            for (var i = 0; i < data.length; i++) {\n                var item = data[i];\n                if (item.key) {\n                    item.key = item.key.toString();\n                }\n                if (item.value) {\n                    item.value = item.value.toString();\n                }\n            }\n            modules.setValueInfo(data);\n            message = message || {};\n            var name = message.name;\n            var content = message.content;\n            if (name) {\n                modules.setObjectName(name);\n            }\n            if (content) {\n                if (!RongIMLib.RongUtil.isString(content)) {\n                    content = JSON.stringify(content);\n                }\n                modules.setContent(content);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcSetOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcOutput\");\n        };\n        // 信令 SDK 新增\n        ServerDataProvider.prototype.getRTCOutData = function (roomId, userIds, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcQryUserOutDataInput();\n            modules.setUserId(userIds);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcQryUserOutData\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), roomId, callback, \"RtcUserOutDataOutput\");\n        };\n        ServerDataProvider.prototype.getNavi = function () {\n            var navi = RongIMLib.RongIMClient._storageProvider.getItem(\"fullnavi\") || \"{}\";\n            return JSON.parse(navi);\n        };\n        ServerDataProvider.prototype.getRTCToken = function (room, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RtcInput();\n            var mode = room.mode || 0;\n            modules.setRoomType(mode);\n            if (room.broadcastType) {\n                modules.setBroadcastType(room.broadcastType);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcToken\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcTokenOutput\");\n        };\n        ServerDataProvider.prototype.setRTCState = function (room, content, callback) {\n            // MCFollowInput 为 PB 复用，字段：一个必传 string（第一位）\n            var modules = new RongIMLib.RongIMClient.Protobuf.MCFollowInput();\n            var report = content.report;\n            modules.setId(report);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"rtcUserState\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), room.id, {\n                onSuccess: function (result) {\n                    callback.onSuccess(result);\n                },\n                onError: function (errorCode) {\n                    callback.onError(errorCode);\n                }\n            }, \"RtcOutput\");\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.Conversation = {\n                watcher: new RongIMLib.Observer(),\n                watch: function (_watcher) {\n                },\n                unwatch: function (_watcher) {\n                },\n                _notify: function (conversationList) {\n                }\n            };\n            // C++ 需要的 SDK 版本号\n            this.version = '2.8.27';\n            this.userId = \"\";\n            this.useConsole = false;\n            this.appKey = \"\";\n            this.token = \"\";\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey, config) {\n            this.appKey = appKey;\n            this.useConsole && console.log(\"init\");\n            config = config || {};\n            config.version = this.version;\n            var sdkInfo = this.addon.initWithAppkey(appKey, config.dbPath, config);\n            if (sdkInfo) {\n                sdkInfo = JSON.parse(sdkInfo);\n            }\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n            return sdkInfo;\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId, serverConf) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            RongIMLib.Bridge._client = {\n                userId: userId\n            };\n            serverConf = serverConf || {};\n            var openmp = !!serverConf.openMp;\n            var openus = !!serverConf.openUS;\n            if (serverConf.type) {\n                this.addon.setEnvironment(true);\n            }\n            this.addon.connectWithToken(token, userId, serverConf.serverList, openmp, openus);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.clearData = function () {\n            this.useConsole && console.log(\"clearData\");\n            return this.addon.clearData();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6,\t// 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        });\n                        break;\n                    case 31004:\n                        setTimeout(function () {\n                            me.connectCallback.onTokenIncorrect();\n                        });\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        });\n                        break;\n                    case 0:\n                    case 33005:\n                        setTimeout(function () {\n                            me.connectCallback.onSuccess(me.userId);\n                            listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        });\n                        break;\n                    case 6:\n                        setTimeout(function () {\n                            listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        });\n                        break;\n                    default:\n                        setTimeout(function () {\n                            listener.onChanged(result);\n                        });\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount, offline, hasMore) {\n                var message = me.buildMessage(result);\n                message.offLineMessage = offline;\n                setTimeout(function () {\n                    var voipMsgTypes = ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'];\n                    var isVoIPMsg = voipMsgTypes.indexOf(message.messageType) > -1;\n                    if (isVoIPMsg) {\n                        RongIMLib.RongIMClient._voipProvider && RongIMLib.RongIMClient._voipProvider.onReceived(message);\n                    }\n                    else if (message.conversationType == 12) {\n                        RongIMLib.RongIMClient.RTCListener(message);\n                        RongIMLib.RongIMClient.RTCInnerListener(message);\n                        RongIMLib.RongIMClient.RTCSignalLisener(message);\n                    }\n                    else {\n                        listener.onReceived(message, leftCount, hasMore);\n                    }\n                });\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback, config) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len_1 = list.length; i < len_1; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj != \"\") {\n                        if (obj.isHidden == 1 && isGetHiddenConvers) {\n                            continue;\n                        }\n                        convers[index] = me.buildConversation(tmpObj);\n                        index++;\n                    }\n                }\n                convers.reverse();\n                var len = convers.length;\n                count = count || len;\n                if (len > count) {\n                    convers.length = count;\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceSetChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.getChatroomEntry = function (chatroomId, key, callback) {\n        };\n        VCDataProvider.prototype.getAllChatroomEntries = function (chatroomId, callback) {\n        };\n        VCDataProvider.prototype.removeChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.forceRemoveChatroomEntry = function (chatroomId, chatroomEntry, callback) {\n        };\n        VCDataProvider.prototype.pullChatroomEntry = function (chatroomId, time, callback) {\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message, code) {\n                var msg = me.buildMessage(message);\n                var errorCode = RongIMLib.ErrorCode.SENSITIVE_REPLACE;\n                if (code == errorCode) {\n                    return sendCallback.onError(errorCode, msg);\n                }\n                sendCallback.onSuccess(msg);\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users, mentiondMsg);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent, searchProps) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag(), searchProps);\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.registerMessageTypes = function (messages) {\n            var types = [];\n            var getProtos = function (proto) {\n                var protos = [];\n                for (var p in proto) {\n                    protos.push(p);\n                }\n                return protos;\n            };\n            //转换消息为自定义消息参数格式\n            for (var name in messages) {\n                var message = messages[name];\n                var proto = message.proto;\n                var protos = getProtos(proto);\n                var flag = message.flag || 3;\n                var tag = RongIMLib.MessageTag.getTagByStatus(flag);\n                flag = new RongIMLib.MessageTag(tag.isCounted, tag.isPersited);\n                types.push({\n                    type: name,\n                    name: message.name,\n                    flag: flag,\n                    protos: protos\n                });\n            }\n            var register = function (message) {\n                var type = message.type;\n                var name = message.name;\n                var flag = message.flag;\n                var protos = message.protos;\n                RongIMLib.RongIMClient.registerMessageType(type, name, flag, protos);\n            };\n            for (var i = 0, len = types.length; i < len; i++) {\n                var message = types[i];\n                register(message);\n            }\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.deleteRemoteMessages = function (conversationType, targetId, messages, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        // Web 端接口，桌面版无需实现\n        VCDataProvider.prototype.setUnreadCount = function (conversationType, targetId, count) {\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearCache = function () {\n            var memoryStore = RongIMLib.RongIMClient._memoryStore || {};\n            memoryStore.conversationList = [];\n            memoryStore.isSyncRemoteConverList;\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.setMessageSearchField = function (messageId, content, searchFiles) {\n            content = JSON.stringify(content);\n            this.addon.setMessageContent(messageId, content, searchFiles);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            direction = typeof direction == 'undefined' || direction;\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearRemoteHistoryMessages = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var timestamp = params.timestamp;\n            var _topic = {\n                1: true,\n                2: true,\n                3: true,\n                5: true,\n                6: true\n            };\n            var topic = _topic[conversationType];\n            if (!topic) {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TYPE_ERROR);\n                return;\n            }\n            if (typeof timestamp != 'number') {\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_TIME_ERROR);\n                return;\n            }\n            this.addon.clearRemoteHistoryMessages(+conversationType, targetId, timestamp, function () {\n                callback.onSuccess(true);\n            }, function (errorCode) {\n                if (errorCode == 1) {\n                    // 没有开通历史消息云存储\n                    errorCode = RongIMLib.ErrorCode.CLEAR_HIS_ERROR;\n                }\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.clearHistoryMessages = function (params, callback) {\n            var conversationType = +params.conversationType;\n            var targetId = params.targetId;\n            try {\n                this.addon.clearMessages(conversationType, targetId);\n                var isSuccess = true;\n                callback.onSuccess(isSuccess);\n            }\n            catch (e) {\n                console.log(e);\n                callback.onError(RongIMLib.ErrorCode.CLEAR_HIS_ERROR);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearTotalUnreadCount = function (callback) {\n            this.useConsole && console.log(\"clearTotalUnreadCount\");\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPullSetting = function (callback) {\n            this.useConsole && console.log(\"getPullSetting\");\n        };\n        VCDataProvider.prototype.setOfflineMessageDuration = function (duration, callback) {\n            this.useConsole && console.log(\"setOfflineMessageDuration\");\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    status: status,\n                    userId: ''\n                });\n                callback.onSuccess(entity);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (status, callback) {\n            this.addon.setUserStatus(status, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback && callback.onSuccess(true);\n            }, function (code) {\n                callback && callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatusListener = function (params, callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                var entity = RongIMLib.RongInnerTools.convertUserStatus({\n                    userId: userId,\n                    status: status\n                });\n                RongIMLib.RongIMClient.userStatusObserver.notify({\n                    key: userId,\n                    entity: entity\n                });\n            });\n            var userIds = params.userIds || [];\n            if (userIds.length) {\n                RongIMLib.RongIMClient._dataAccessProvider.subscribeUserStatus(userIds);\n            }\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var me = this;\n            me.addon.recallMessage(\"RC:RcCmd\", JSON.stringify(content), content.push || \"\", function () {\n                content.objectName = 'RC:RcCmd';\n                sendMessageCallback.onSuccess(me.buildMessage(JSON.stringify(content)));\n            }, function (errorCode) {\n                sendMessageCallback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.setEnvironment = function (isPrivate) {\n            this.addon.setEnvironment(isPrivate);\n        };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            var extra = \"\";\n            this.addon.getVoIPKey(engineType, channelName, extra, function (token) {\n                callback.onSuccess(token);\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            var profile = RongIMLib.RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n            callback.onSuccess(profile);\n        };\n        VCDataProvider.prototype.setDeviceInfo = function (device) {\n            var id = device.id || '';\n            this.addon.setDeviceId(id);\n        };\n        VCDataProvider.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            var publicList = [];\n            var ret = this.addon.getAccounts();\n            var transformProto = function (ret) {\n                var result = {\n                    hasFollowed: false,\n                    isGlobal: false,\n                    menu: null\n                };\n                if (!ret.obj) {\n                    var error = { error: ret };\n                    throw new Error('公众账号数据格式错误: ' + JSON.stringify(error));\n                }\n                var obj = JSON.parse(ret.obj);\n                var protoMap = {\n                    aType: 'conversationType',\n                    aId: 'publicServiceId',\n                    aName: 'introduction',\n                    aUri: 'portraitUri',\n                    follow: 'hasFollowed',\n                    isGlobal: 'isGlobal'\n                };\n                for (var key in obj) {\n                    var val = obj[key];\n                    if (key == 'aExtra') {\n                        var extra = JSON.parse(val);\n                        result[\"hasFollowed\"] = extra.follow;\n                        result[\"isGlobal\"] = extra.isGlobal;\n                        result[\"menu\"] = extra.menu;\n                    }\n                    var uId = protoMap[key];\n                    if (uId) {\n                        result[uId] = val;\n                    }\n                }\n                return result;\n            };\n            if (ret) {\n                ret = JSON.parse(ret);\n                var list = ret.list;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var item = list[i];\n                    item = transformProto(item);\n                    publicList.push(item);\n                }\n            }\n            if (publicList.length > 0) {\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList = publicList;\n            }\n            callback.onSuccess(RongIMLib.RongIMClient._memoryStore.publicServiceMap.publicServiceList);\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            if (val === '') {\n                return null;\n            }\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        VCDataProvider.prototype.getRTCUserInfoList = function (room, callback) {\n            this.addon.getRTCUsers(room.id, 1, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getRTCRoomInfo = function (room, callback) {\n            var order = 2;\n            this.addon.getRTCResouce(room.id, order, function (result) {\n                callback.onSuccess(JSON.parse(result));\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.joinRTCRoom = function (room, callback) {\n            var id = room.id;\n            var type = room.type || 0;\n            this.addon.joinRTCRoom(id, type, function (result, token) {\n                var res = JSON.parse(result);\n                var users = {};\n                var list = res.list;\n                RongIMLib.RongUtil.forEach(list, function (item) {\n                    var userId = item.id;\n                    var tmpData = {};\n                    RongIMLib.RongUtil.forEach(item.data, function (data) {\n                        var key = data.key;\n                        var value = data.value;\n                        tmpData[key] = value;\n                    });\n                    users[userId] = tmpData;\n                });\n                callback.onSuccess({\n                    users: users,\n                    token: token\n                });\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitRTCRoom = function (room, callback) {\n            this.addon.exitRTCRoom(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.RTCPing = function (room, callback) {\n            this.addon.sendRTCPing(room.id, function () {\n                callback.onSuccess(true);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setRTCData = function (roomId, key, value, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                room_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, key, value, name, content, success, error);\n                },\n                user_inner: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCInnerData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                },\n                user_outer: function (roomId, key, value, name, content, success, error) {\n                    context.addon.setRTCOuterData(roomId, RongIMLib.RTCAPIType.PERSON, key, value, name, content, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name;\n                var content = message.content;\n                handler(roomId, key, value, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.setRTCRoomData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.ROOM, callback, message);\n        };\n        VCDataProvider.prototype.getRTCData = function (roomId, keys, isInner, apiType, callback) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, success, error) {\n                    context.addon.getRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                },\n                room_outer: function (roomId, keys, success, error) {\n                    context.addon.getRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, success, error);\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                handler(roomId, keys, function (result) {\n                    var res = JSON.parse(result);\n                    var props = {};\n                    var list = res.list;\n                    RongIMLib.RongUtil.forEach(list, function (item) {\n                        props[item.key] = item.value;\n                    });\n                    callback.onSuccess(props);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.getRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.getRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.removeRTCData = function (roomId, keys, isInner, apiType, callback, message) {\n            var context = this;\n            var hanlders = {\n                room_inner: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCInnerData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                room_outer: function (roomId, keys, name, content, success, error) {\n                    context.addon.deleteRTCOuterData(roomId, RongIMLib.RTCAPIType.ROOM, keys, name, content, success, error);\n                },\n                user_inner: function (roomId, keys, name, content, success, error) {\n                },\n                user_outer: function (roomId, keys, name, content, success, error) {\n                }\n            };\n            var type = RongIMLib.RTCAPIType.PERSON == apiType ? 'user' : 'room';\n            var direction = isInner ? 'inner' : 'outer';\n            var tpl = '{type}_{direction}';\n            var name = RongIMLib.RongUtil.tplEngine(tpl, {\n                type: type,\n                direction: direction\n            });\n            var handler = hanlders[name];\n            if (handler) {\n                message = message || {};\n                var name = message.name || '';\n                var content = message.content || '';\n                handler(roomId, keys, name, content, function () {\n                    callback.onSuccess(true);\n                }, function (code) {\n                    callback.onError(code);\n                });\n            }\n        };\n        VCDataProvider.prototype.removeRTCRoomData = function (roomId, keys, isInner, callback, message) {\n            this.removeRTCData(roomId, keys, isInner, RongIMLib.RTCAPIType.ROOM, callback);\n        };\n        VCDataProvider.prototype.getNavi = function () {\n            var nav = this.addon.getNav();\n            return nav[this.userId];\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.setRTCOutData = function (roomId, data, type, callback, message) {\n        };\n        // 信令 SDK 新增\n        VCDataProvider.prototype.getRTCOutData = function (roomId, userId, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.removeRTCUserInfo = function (room, info, callback) {\n        };\n        VCDataProvider.prototype.getRTCUserList = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.removeRTCRoomInfo = function (room, data, callback) {\n        };\n        VCDataProvider.prototype.setRTCUserData = function (roomId, key, value, isInner, callback, message) {\n            this.setRTCData(roomId, key, value, isInner, RongIMLib.RTCAPIType.PERSON, callback, message);\n        };\n        VCDataProvider.prototype.getRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.removeRTCUserData = function (roomId, key, isInner, callback, message) {\n        };\n        VCDataProvider.prototype.getRTCToken = function (room, callback) {\n        };\n        VCDataProvider.prototype.setRTCState = function (room, content, callback) {\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.getItemKeyList = function (regStr) {\n            var prefix = this.prefix;\n            var me = this, itemList = [], reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    key = key.substring(prefix.length);\n                    itemList.push(key);\n                }\n            }\n            return itemList;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.getItemKeyList = function (composedStr) {\n            var itemList = [], keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            var prefix = this.prefix;\n            var _key = prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        var keyName = keyNameArray[i];\n                        keyName = keyName.substring(prefix.length);\n                        itemList.push(keyNameArray[i]);\n                    }\n                }\n            }\n            return itemList;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"\t\": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ScriptLoader = (function () {\n        function ScriptLoader() {\n        }\n        ScriptLoader.prototype.load = function (src, onLoad, onError) {\n            var script = document.createElement(\"script\");\n            script.async = true;\n            if (onLoad) {\n                if (script.addEventListener) {\n                    script.addEventListener(\"load\", function (event) {\n                        var target = event.target || event.srcElement;\n                        onLoad(target.src);\n                    }, false);\n                }\n                else if (script.readyState) {\n                    script.onreadystatechange = function (event) {\n                        var target = event.srcElement;\n                        onLoad(target.src);\n                    };\n                }\n            }\n            if (onError) {\n                script.onerror = function (event) {\n                    var target = event.target || event.srcElement;\n                    onError(target.src);\n                };\n            }\n            (document.head || document.getElementsByTagName(\"head\")[0]).appendChild(script);\n            script.src = src;\n        };\n        return ScriptLoader;\n    })();\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.logger = function (code, funcName, msg) {\n            RongIMLib.RongIMClient.logger({\n                code: code,\n                funcName: funcName,\n                msg: msg\n            });\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        // throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                        var msg = \"第\" + (g + 1) + \"个参数错误, 错误类型：\" + this.getType(c[g]) + \" [\" + f[g] + \"] -> 位置:\" + position;\n                        this.logger(\"-3\", position, msg);\n                    }\n                }\n            }\n            else {\n                var msg = \"该参数不正确或尚未实例化RongIMClient -> 位置:\" + position;\n                this.logger(\"-4\", position, msg);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var MemoryCache = (function () {\n        function MemoryCache() {\n            this.cache = {};\n        }\n        MemoryCache.prototype.set = function (key, value) {\n            this.cache[key] = value;\n        };\n        MemoryCache.prototype.get = function (key) {\n            return this.cache[key];\n        };\n        MemoryCache.prototype.remove = function (key) {\n            delete this.cache[key];\n        };\n        return MemoryCache;\n    })();\n    RongIMLib.MemoryCache = MemoryCache;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    function Prosumer() {\n        var data = [], isConsuming = false;\n        this.produce = function (res) {\n            data.push(res);\n        };\n        this.consume = function (callback, finished) {\n            if (isConsuming) {\n                return;\n            }\n            isConsuming = true;\n            var next = function () {\n                var res = data.shift();\n                if (RongUtil.isUndefined(res)) {\n                    isConsuming = false;\n                    finished && finished();\n                    return;\n                }\n                callback(res, next);\n            };\n            next();\n        };\n        this.isExeuting = function () {\n            return isConsuming;\n        };\n    }\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var result = true;\n            if (RongUtil.isObject(obj)) {\n                RongUtil.forEach(obj, function () {\n                    result = false;\n                });\n            }\n            if (RongUtil.isString(obj) || RongUtil.isArray(obj)) {\n                return obj.length === 0;\n            }\n            if (RongUtil.isNumber(obj)) {\n                return obj === 0;\n            }\n            return result;\n        };\n        RongUtil.isLengthLimit = function (str, maxLen, minLen) {\n            minLen = minLen || 0;\n            var strLen = str.length;\n            return strLen <= maxLen && strLen >= minLen;\n        };\n        RongUtil.MD5 = function (str, key, raw) {\n            return md5(str, key, raw);\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isString = function (array) {\n            return Object.prototype.toString.call(array) == '[object String]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.isUndefined = function (str) {\n            return Object.prototype.toString.call(str) == '[object Undefined]';\n        };\n        ;\n        RongUtil.isEqual = function (a, b) {\n            return a === b;\n        };\n        ;\n        RongUtil.indexOf = function (arrs, item) {\n            var index = -1;\n            for (var i = 0; i < arrs.length; i++) {\n                if (item === arrs[i]) {\n                    index = i;\n                    break;\n                }\n            }\n            return index;\n        };\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.tplEngine = function (temp, data, regexp) {\n            if (!(Object.prototype.toString.call(data) === \"[object Array]\")) {\n                data = [data];\n            }\n            var ret = [];\n            for (var i = 0, j = data.length; i < j; i++) {\n                ret.push(replaceAction(data[i]));\n            }\n            return ret.join(\"\");\n            function replaceAction(object) {\n                return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n                    if (match.charAt(0) == '\\\\') {\n                        return match.slice(1);\n                    }\n                    return (object[name] != undefined) ? object[name] : '{' + name + '}';\n                });\n            }\n        };\n        ;\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        callback(obj[key], key, obj);\n                    }\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extend = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            if (window.navigator) {\n                var browserAgent = window.navigator.userAgent.toLowerCase();\n                var isIPhone = browserAgent.indexOf('iphone') > -1;\n                if (isIPhone && isXHR == false) {\n                    isXHR = (typeof XMLHttpRequest == 'object');\n                }\n            }\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    var status = xhr.status;\n                    if (status == 200) {\n                        success(xhr.responseText);\n                    }\n                    else {\n                        error(status, xhr.responseText);\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n            return xhr;\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.getUrlHost = function (url) {\n            var index = RongUtil.indexOf(url, '/');\n            return url.substring(0, index);\n        };\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        /*\n            //返回新引用，不破坏原始对象\n            rename({n: 'martin'}, {n: 'name'}); => {name: 'martin'}\n            rename([{n: 'martin'}, {a: 18}], {n: 'name', a: 'age'});\n            => [{name: 'martin'}, {age: 18}]\n        */\n        RongUtil.rename = function (origin, newNames) {\n            var isObject = RongUtil.isObject(origin);\n            if (isObject) {\n                origin = [origin];\n            }\n            origin = JSON.parse(JSON.stringify(origin));\n            var updateProperty = function (val, key, obj) {\n                delete obj[key];\n                key = newNames[key];\n                obj[key] = val;\n            };\n            RongUtil.forEach(origin, function (item) {\n                RongUtil.forEach(item, function (val, key, obj) {\n                    var isRename = (key in newNames);\n                    (isRename ? updateProperty : RongUtil.noop)(val, key, obj);\n                });\n            });\n            return isObject ? origin[0] : origin;\n        };\n        RongUtil.some = function (arrs, callback) {\n            var has = false;\n            for (var i = 0, len = arrs.length; i < len; i++) {\n                if (callback(arrs[i])) {\n                    has = true;\n                    break;\n                }\n            }\n            return has;\n        };\n        RongUtil.keys = function (obj) {\n            var props = [];\n            for (var key in obj) {\n                props.push(key);\n            }\n            return props;\n        };\n        RongUtil.isNumber = function (num) {\n            return Object.prototype.toString.call(num) == '[object Number]';\n        };\n        RongUtil.getTimestamp = function () {\n            var date = new Date();\n            return date.getTime();\n        };\n        RongUtil.isSupportRequestHeaders = function () {\n            var userAgent = navigator.userAgent;\n            var isIE = window.ActiveXObject || 'ActiveXObject' in window;\n            if (isIE) {\n                var reIE = new RegExp('MSIE (\\\\d+\\\\.\\\\d+);');\n                reIE.test(userAgent);\n                var fIEVersion = parseFloat(RegExp['$1']);\n                return fIEVersion > 9;\n            }\n            return true;\n        };\n        RongUtil.hasValidWsUrl = function (urls) {\n            try {\n                urls = JSON.parse(urls);\n            }\n            catch (e) {\n                return false;\n            }\n            var validUrlList = RongUtil.getValidWsUrlList(urls);\n            return validUrlList.length > 0;\n        };\n        RongUtil.getValidWsUrlList = function (urls) {\n            var invalidWsUrls = RongIMLib.RongIMClient.invalidWsUrls;\n            var validUrlList = [];\n            RongUtil.forEach(urls, function (url) {\n                if (RongUtil.indexOf(invalidWsUrls, url) === -1) {\n                    validUrlList.push(url);\n                }\n            });\n            return validUrlList;\n        };\n        RongUtil.Prosumer = Prosumer;\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n    /*\n        var observer = new RongObserver();\n        observer.watch({\n            key: 'key',\n            func: function(entity){\n                \n            }\n        });\n\n    */\n    var RongObserver = (function () {\n        function RongObserver() {\n            this.watchers = {};\n        }\n        RongObserver.prototype.genUId = function (key) {\n            var time = new Date().getTime();\n            return [key, time].join('_');\n        };\n        RongObserver.prototype.watch = function (params) {\n            var me = this;\n            var key = params.key;\n            var multiple = params.multiple;\n            key = RongUtil.isArray(key) ? key : [key];\n            var func = params.func;\n            RongUtil.forEach(key, function (k) {\n                k = multiple ? me.genUId(k) : k;\n                me.watchers[k] = func;\n            });\n        };\n        RongObserver.prototype.notify = function (params) {\n            var me = this;\n            var key = params.key;\n            var entity = params.entity;\n            for (var k in me.watchers) {\n                var isNotify = (k.indexOf(key) == 0);\n                if (isNotify) {\n                    me.watchers[k](entity);\n                }\n            }\n        };\n        RongObserver.prototype.remove = function () {\n        };\n        return RongObserver;\n    })();\n    RongIMLib.RongObserver = RongObserver;\n    var Observer = (function () {\n        function Observer() {\n            this.observers = [];\n        }\n        Observer.prototype.add = function (observer, force) {\n            if (force) {\n                this.observers = [observer];\n            }\n            if (RongUtil.isFunction(observer)) {\n                this.observers.push(observer);\n            }\n        };\n        Observer.prototype.emit = function (data) {\n            RongUtil.forEach(this.observers, function (observer) {\n                observer(data);\n            });\n        };\n        Observer.prototype.clear = function () {\n            this.observers = [];\n        };\n        Observer.prototype.checkIndexOutBound = function (index, bound) {\n            var isOutBound = (index > -1 && index < bound);\n            return isOutBound;\n        };\n        Observer.prototype.removeAt = function (index) {\n            var isOutBound = this.checkIndexOutBound(index, this.observers.length);\n            if (isOutBound) {\n                this.observers.splice(index, 1);\n            }\n        };\n        Observer.prototype.remove = function (observer) {\n            var me = this;\n            if (!observer) {\n                me.clear();\n                return;\n            }\n            if (!RongUtil.isFunction(observer)) {\n                return;\n            }\n            var observerList = me.observers;\n            for (var i = observerList.length - 1; i >= 0; i--) {\n                if (observer === observerList[i]) {\n                    me.removeAt(i);\n                }\n            }\n        };\n        return Observer;\n    })();\n    RongIMLib.Observer = Observer;\n    var Timer = (function () {\n        function Timer(config) {\n            this.timeout = 0;\n            this.timers = [];\n            this.timeout = config.timeout;\n        }\n        Timer.prototype.resume = function (callback) {\n            var timer = setTimeout(callback, this.timeout);\n            this.timers.push(timer);\n        };\n        Timer.prototype.pause = function () {\n            RongUtil.forEach(this.timers, function (timer) {\n                clearTimeout(timer);\n            });\n        };\n        return Timer;\n    })();\n    RongIMLib.Timer = Timer;\n    var IndexTools = (function () {\n        function IndexTools(config) {\n            this.items = [];\n            this.index = 0;\n            this.onwheel = function () { };\n            this.items = config.items;\n            this.onwheel = config.onwheel;\n        }\n        IndexTools.prototype.get = function () {\n            var context = this;\n            var items = context.items;\n            var index = context.index;\n            var isWheel = index >= items.length;\n            if (isWheel) {\n                context.onwheel();\n            }\n            return isWheel ? 0 : index;\n        };\n        IndexTools.prototype.add = function () {\n            this.index += 1;\n        };\n        return IndexTools;\n    })();\n    RongIMLib.IndexTools = IndexTools;\n    var InnerUtil = (function () {\n        function InnerUtil() {\n        }\n        InnerUtil.getUId = function (token) {\n            return md5(token).slice(8, 16);\n        };\n        return InnerUtil;\n    })();\n    RongIMLib.InnerUtil = InnerUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n// {WebEnd} WebSDK 内容开始的标识, 方便小程序 SDK 定位\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "local-sdks/voice-amr-base64.json",
    "content": "var voice = \"IyFBTVIKLNEafAAeef/hgmeAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALGOZ4sj90f3jNsZmd0zTB+hv2UiILKcq8B7gAevlY0Ne9XuTxaG9hGeMLGlBXh/xgN8RwHNruSbA1Wu1t5BsLFsQqB/AlYSOzWptJD4Nk1YDU7lyLHRH3w7ADLUOgi/D8b5m8sia7BlILGlmkh/gFJyrWINe7dmE0m6ea5BGLFKhmh/hQ9TFKLyueRE1SZJwWZ3ULFywoh/iu7tj4mtPk9ErsqzPEpamLEq2MB/AaRNLzBOH/q+6pFmZef4eLE4ZKpcxAYR2vyfHoxH2d3xgd+lCLCdBeB/oQZtJxpU9Ead66lb1V4FGLCcrwB/pAd4QxRh3bxLJDiWLtQy8LEgkGB/hAcNT67nM4H3eXcfkI6+QLESLSh/gAd6oG8n/0S9GmmZHk+FALFqQRyyBmc5B5mCl9zSjVw+MRsYSLJxNePMO4b3xBTdj5r7MdveGkhyYLEgWRJdggaA0SU8YdQbE1mkwxheeLF7meYZpMZNXjJ5otNatPMzIYNN0LGkRlJdhUbQVPX+9sed3OK1W0c4oLHSbRYZhCVNiUEq3dcUmHH8jfN8OLIoWEj3BNOA9Ye5YFNwqNYcTeG9wLE4CNB/gNyQekksW2BGI42XIk3OyLIT0NB/gC13ZHTX0FqWIvCsX/ZqcLGgANB/gYgixq1a/LpS5LN5KBPWwLFyjih/gMZaQkE/eSRJFPLn1akVwLEijUh+sA0Q2alotATqHbNTmYIA6LJHtSh/hmbH/y4Lxdih+1Nw5G19wLEYkoh/iJPDp/N7VL0zWSk586WPCLFsGHw7wycYI76p3ZXjS60/jVbjiLE6wwUqwgZyqrYjEaF0ewxoYJ3COLBENOj3AWLKsOYe/x6xKyqWjrjomLA06OaQVZj5PzPQXjkMwXj9y8J6eLBWj5rTeptSV/LpxEWnPi0WM8u60LBnhSWmPh4HkSHFr2Tx6NwG1WQf0LBj9FrUeB4YWDuS9T+j3RXKK14QILBj94tM+R4YSA4WlebpcPEIF+K1ALBjNScI+R4YGAedlGLvseGfkvuGwLBj94yzeB4NvSrNcuFh1jHCAV38uLBlL4yzcJ4YQDZ77NymI2SpQCma+LBjS1rVeB4NZ1nDcrAehU2W/9+fELBnh1pZcJ4YPjsi8KFq62DQartLqLBp21yyeJ5tORhDL0A1EnSDewBqQLA51/pdYZ54MDtEDRFH2etaSd8n6LBnh12geJ5n9cKyTeUyE1nyhiu3QLBr9wtI5Z5tAbRkKWHNBJvbU+m2MLCDSGSzFpzmwz/WVurgHMzXFhl64LBAeoJdh5nmjOJOG2hjJQuNFrJ20LEk7NB/hxm5FpIRqJ/qGc4ELcQgULHSb/h/gRNSTBJ/pTlchtbCFNqRaLHIhNB/hrgYknYxYg7w4x1m1x/feLJrbnpdiTylyQxD/ynA0Vmd1o4UQLHatRD3F1FYU2RUHO+N+3L0Tgt3wLJF+Jlugr4zBPEFfEXxiqUcbAmgGLFOK6B/gBn33sg/tBnsYwn26BzGELE9+HwvRI2GlF/lHlu+G0moY1CaILIQq6Q6gwz8Nu2dUtdpYhavAizOELKAmONIgN/zxV63TRMACSuUfSZp+LMXCRB/pBpZfybCOa1Mth0bAJiNsLHGdE8JuPxylZp4RUPeIm9zQ+MIGLHOYl/AfhiZInK/r+YKOuGoKNIg4LHL2N+gYJtSH3gn10FRP+OD7M+7sLHLyL6TdtsH/+b724zbFylx1rEToLKD2N8I+p44FH+RRoH2nn4IDJkkqLKGsL+Eeh54QmddD1Y1qa5IrfdlgLKGsL6VeJ+YAOZOOSIvKOMDv0dImLHD2yUrlp/taevWj5Iu+pjikQPrYLHbyLvGeDVYDESShWhG6LYSACGzeLHCoInmcOA4/EnkYKzp5RWENKyu6LHGsIrWPGGyie0GVBZ0K8zsoaha0LHOsI0p4eMHrer57Z/QFJb21h850LKVkI0rkzqrr9CeK+LlBLnbqRcwQLHPsNtJkfQMU31zZb1sFI6pbOpmWLHaRIqWmXkJ+lnx24MFoy/1BRS3MLGnINnGADu5kFvQrzRrulcTI4bokLGiuGpZIgcyzx/3fn4jxOxfU11uGLGgBDQ7AHz8HUy7PaNJA/ZKkIESYLE1PNtMghLNCV7LV8AdOcPm5MIPyLEyuWB/g2olMZbYlNHNB493hLLvcLEiBDB+xx5H+YjUsHLBpsNlsTLYQLHCuNh/yj2sNoe9hBEYfRcZ97ELyLKdT5h/Azy5fiSk3pD7aJjTwUE1oLHSfzB/hF2L+gQb/s5aQd9M2F1AQLHSYjrVAp5ngUiFW4Hpxtag8lbhMLJLajrVAUexW0naX4BAwZ8gj+yf6LJOGj0qgGbSDk0eKcL17SPOzZhd8LGqYOrUBR7N3WMKUNMCHxQwdhsDaLKaYOj3BD47ZIc/0yxSYdBdAoW0sLJbbOh/gjLC+UNx79DIVmszFnCeaLKAE5+ADEX4ggPDev2ZZgz5qQAryLJCKdpdgGqW/vk6VeBcNdMN0AnMWLDBjNt+O/2GwTgjT6B7VgwEsuUIALGgVN2nGh6YNT9noVCIgbWK0Hui0LGNQNvEeh+YJjpJub8L3mM8hm7XqLGIVNtM+R+Hz7/8v1TFQclHYZyi4LGNPNtM+x+4bDwYrJOBql8WE9aAYLGLgN2jeB/4CDjHpkJuHutoTaMXiLFIVNrWSx/nkbnrLpn4qTshYYKWwLFNrGw7+B/4WD4jXRgwZLnyi9xsOLFDgNrV+B/tDztzpQwqRLtCIlkbULC9rpNIh5/4ZtyH1QZ6TjslZ6VjiLCrgDQ7vGAYCApDcAjv+U2h/EtGCLCS26h+B+AS+Ae4tLvoCUmaf2bCoLBeVqSweEqtMUiB0mrygMUTj0F8kLBUrqB/LUqnyet7jXNjdGaLrNldQLBdBDQ5rR/YIhaE2+rnlKTGaZDssLCI32j1cJ8ykrRZZdiny00eSJvNuLBGVzB67x5GcMZRHrLFAhsPqUTGSLBKhdB+B7yHuYHNeDX8UXVobXtS+LBCWiJc6RjSzctBVrQq2S4OH4JMgLEFYQB+AhnPPvrN8cnGox3fvmDCYLC2VDQ7pZnZB1GpQa3KM3SO2fvN8LGglslugEJYzy8O4RRHrVVZYbS0qLGoAjtMuernXk7GjRfd54qdFYiZKLMEaH8IkrrTD00eHjcbEUmSrwf9SLIUNfaRAKCimG+zfEOfmWj85ubowLMQKtPEAD6eYBhm23UfSK1RifGPmLEcNfeAAg6t7cm5HrB+5GnvaKfmULMWF1eAAJB7kwoOY1GKlNeJcm2X0LEEca8Koh+pmPLSb7n2EHJnuNrCuLIC0h+AARxKVexe1xhUnUeR3F/hCLB6Vj6RiNww843N3zdkuXZAZfWuULC7yj8I9JsZTl1LkLwYBmZYgMpxuLDBqDQ7tJ44LFTtpARgHGVcwM4XwLCvkdlq+B54Onyf4z6sIfIViiUNMLCufjlu+B+YUy64WzTbzBicKZMo4LCtQdlu8LVYQXx6a7PnRfRELbNzALDWf6pc+GAYNqcGzCE7FM1c1EUYiLDvbd0s8+DSpJgqjYlHjuUdEA3roLDufDLVcOGNBzK0t+l+cOxEMU7LgLDryqFrLOHSXKmMDUbNqTTzm6SM2LFIXd0qmK55E1hrhqS+SYr1cwBqULFvHNNIi/+aCTPu1zoHk8n5vDARYLGmZAB75FeHab5QZwZMOc7+ybqT4LGiIWQ90Ap0fd4DH0eoQO5lzwyNaLFq24h/o96Ht7vc6+gxg6tcjoAs8LEQ3qUolh2sY0XYroiHHuS2SYQJqLCDBQD1DxnMZWKgVYVC3xsVVcqFQLCwhqJZh5m4DsacEsvgO9FidzYuCLGoc1B/oR9c2J7siJrJG7QLzMs8oLFcrRB7oA8Sa6DkgT7cbpRlni77qLF8rHB9AAN4WjsH59/MBxj2oaXKKLDsrVB/gl22w1k2/6Kvcv6FEYVc4LE4kOh/kin5kyDb9Ek2ir16UOchsLEHtsh/gG4TgVYeo5/T/mSSl9PKiLEWGOh/0z8lJ6Lw5lnoQq4qcg7joLGikgh/gBKCaNxoP/qOYUxyzECNoLEiw5h/gJxiwiVk+51kPWn+TWwkELFKfRh/gAqmdt62FL2jW4Crj14DKLIUEgh+hV/5ff400ryadvWIqb35ALFMGwFugE1SANa/zSp1nhmt1F4pgLFwMOyzQBp7gkQ3VNThbLQt0w/cULGuGMB7wEly4OG3cLgLdTl88U3A8LCyhqB/gcrtz05GUJQu7Z0jUc31MLCmaQYb5hsskV1fy9ypV2CvnpKQQLEY3O8I2jVYDGKtAKcW1bUdU8+48LDuaDLVPGDNFRdcsZFPi12JIW9XuLC5pRnmWmDnpv3YKum5BeRyXWm52LDTzQD3S3/4iZtrFvyoSrRJyx2ioLCrzDB/8eHNEzAMvuMbNuM5wvDeqLCrzQFufGGYDrthotBhBpEUeYbyaLCWOQFo+GH4bHqfJ8Dm/BsN34SBQLB1DzA/4eNYPOYI4yYC1J4ZZHFHmLCq3QD1Ks+yeL4slPkz4OVYab+wQLDFtqIdBfsNQ8ygB5HJCYvwaIY6WLDRJnFPCJ6m6ToTbZCPhqXhv2Dw+LE8Nkh7gK6YRKWNP1B2Ry3YZIStILDSjHB7gP5tQ4jn5ATgS0tjJcjD6LGgkNJcAJOZCzKuKU6RXlTcuMn5sLKOVBB7l5On+r8eLdj3+R8VY1wmoLKftdYZgBi0UeXlPkxpZkLn6RKpyLHSh4SzAPV4qoThEgSBltvo2JhjGLHVBDFqCbgCu/X+eYSY+WRprEs92LHSBeFugQlSwB7TgEtKs/U+5uRgCLHQRkw7xFHuqWFjF5tNBhTOGLKMWLFStrh/kF6Gq+JcQ88YC7TlfDGOcLFoZoh+gV7nmzQJ/xKwiZTp39IzoLGQZDB/hAmcJpKq3QEIFb2XfB4eILGgkHh7gCyx4n6ddcccc2UU64A/sLGMrih9RF92+6HZuseFsq96sUbC8LGgkQB/lvQjkvqAKO8F+XNGQbmTSLDgP/h/Sh5nk4xlqA0A7G3bJHXc0LBRUOYY8hgNej/+N7fVXzj9p2LfYLCTVgNInp+NQX/FbslaOxzkRgQ90LBd2flupR+YjiAn+cpLmUrXFye7SLDpHCPl+7dNopT5B25GJgoT+FkqULDFhu6R95+NNZrIGu5wUz9LKSFfALDCvyaRrR+4BFFeFLBiD0WUZSPemLDE7vFv2x+tZQUcrxFtFuNeUeHXaLDCv9aUeJ/4ME6YLt2LuFTBnLlmyLDF4jS3eDVYFHmLP6ikvKSaOWa0uLDUtvS3eWAYMuQSCBUeSXSAP1ttWLDNqGQ7rWByysquMU14dU8/ZGlEcLFTkHw7nmH4d9oAagWUHNrfeAX4QLDv3GFulG6mrCxSdK2HOR9yzGB6eLDpKDB/glfyqVdBmPGr4OYYFyPS8LFXFHj0BnyYP1lE5d9FvD9T1LebaLCruqJYJVptWGswmyBthddtlcM70LCxH4h3kB3ortwu6hwZEC5FLUZ7YLC1cdw6wx4NCVmUiZFLSeVqOidscLJGGeB6hTytZzuXGacMKN5ntpmOSLFok4h9lCST559KwmyrVaWIkKA1CLGgksh/gXOdBLb8owPcjPqEPxHW0LHVFKB6glLRVdo+2yy3iIjCXIZ/MLFGGoh/APNyjiobXj5p0C9zzOYEALFKfmB8EJjzvmx63l9hZB7U/yaEELHKAwB/wRn2gzB+4gBIba3YRs1CELFMQoh/lhnNE7EUjuC4eCMIUd+yeLGOEgj0QZmNczuWYJF0Cr70fNLeYLE9FwB/hwxsaDcgMa+kVV3GikkQQLGghQB/ilnSTp0bfGo6FnFqS6KGqLJaYmD/Go1N2ioRZ6uzrKPEOOeY6LJGFHngR3YJz6wQ9IFQrmTE1oP9ELNA1zaRw1TS0yhomy68wcni1WUQiLJcUH+ABrHx8kv5eykNFZyFUxWQ4LJ3NUeFglQvZcAagM83NAsvBbOaiLJqDveAAD5t9isUv/qIbqCoXQF3mLJY1xeGAgc0z7K2P5zHmxOaDau+oLE5uxeEgCTVtneohZlh9NriSHYZGLAd1n+AMw2btmu7/7pVGxZpUWtcQLBYg8Jfg5+4H0BPUVzSuUkj7OaWuLA/MtyyfLVYXDWoIJtbuvNmNgJGKLBZkm6RfGANJ0MXhBITfky4CABqOLBl1zw78Mq41FeI7rDwNJte9bze6LBfhwh/8OANeV8QDEi0a40JWRV5CLBlprw7pcqNAmdkGzYKd0XrT4tUSLBGQoNMQ55Sws2KidEZFdQxPuUo0LECjew7iR45KfimJGBBhIzqUOQ+wLHHBKB/oJzNDh7hNMhanWTjT2E0yLJMRoJZAaYQXetOQ2Hs0zl9Lj6kiLE5FHB/gHUGSvj3+ONd1Cyee6goyLHsGgh/gGyXhL3nLsGB68ccaZLuILHEQ8w7AROwqrg8oj1jkkjK8p7i8LHSjHB/AH4NWZsc6zFfJOdG0XBkULKCADB6hxqteFf44HdaFj3pM9j9QLHhHKh/APG4HFpPjaSGgdJgZXo62LHEGRh/AJsb2fxeKVnjkdo0IoHmOLKHtRh/hMINYBw0sq9vzksf4Oh4KLHSjKh+go9ZND9GUUqEZmyfDwLrOLE4kRw7ACltKP7awJ4v6tpB1DIQYLGsQgw7hCSYBlhPo0YhzJHquE+64LGhvxB+wGdptSzBt0FpnXHpCsDRcLEwZRh9AF0Mf1pD555afVNsz965QLF/tRh+hQfz0Dv08wUuHOFYZ9NJGLFOGOh9IQbNf6c6uuLcIxMU8LwICLFIZHQ5h20zqdpJtTSiv35uQY9OGLE0rRh/gNiQ0FtHLyPlvINYuW8HmLKCL5h/wH/IGkAxx2d79W3sAjRX+LFtBCh+j5nnr6DBIHhLKEPbiReFQLGCfrw7odmYAGIkJCDuOfaBBLP9WLHpHOh/kBHiksaKRZ2gF11xqKjJYLGWGOh+kE2znAD2kgwQW3ADyXjNULGgmOh7k7kywoE1tToUFjyMZ0cekLHmWRh7ATF5TRqk2/ORpiteIwWOKLGgMOh7QhNtW4XX5sFaEukArBENoLFuWRB9gS8GkaPP4+gp9gVE2eUIELHWGzB8hRk6N4d4vx+brHg83xrveLFcqCh5ADraeiSn5JKcCLP5ZT5EmLHQksh+hjgTEhZA1ROB00X1AN99cLGlmxB+li4ZMmtU9iEYrmLKZK104LKEG/h/gkjHJJqBstjV1TZIMVQ9GLFMqoh7AF92qdC8033bD5l75l+0+LGkQwh/AKdND1quXzewahKPVHtraLJCjGB/hBKt5CriqQDfu/EaqXQkeLFafrh7AOeT3KJ/ACkwhOrSbpYQsLJBHzB/ga8tJoefCznqPEOPxVBIiLE+GoB5gHdj8eJH6CbpHCxkVddquLE8rGB7ALuCisqE67liVp78DB4t0LGmF6JdgpJuRGznAFm6YNK+8XN6cLE4kwh9kFmQZX5mqCCW2hqUTyK1KLHKYdh9gVzGZ7m+ttHopsTtVOlMG\";"
  },
  {
    "path": "local-sdks/voice.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>voice</title>\n</head>\n<body>\n\n\n<h1>声音库</h1>\n<h3>官网文档：<a href=\"http://www.rongcloud.cn/docs/web.html#voice\">http://www.rongcloud.cn/docs/web.html#voice</a></h3>\n\n<script src=\"./sdk/Libamr-2.2.5.min.js\"></script>\n<script src=\"./sdk/RongIMVoice-2.2.5.min.js\"></script>\n\n<!-- 引入base64编码的arm音频数据 -->\n<script src=\"./voice-amr-base64.json\"></script>\n\n<button id=\"btn\">播放base64</button>\n\n<script>\nvar RongIMVoice = RongIMLib.RongIMVoice;\n\tRongIMVoice.init();\n\n//voice define in voice-mar-base64.json\nvar duration = voice.length/1024;\n\nvar btn = document.getElementById(\"btn\");\n\nvar isPlay = false;\nbtn.onclick = function(){\n\tif(isPlay){\n\t\tstop();\n\t\tisPlay = false;\n\t\tbtn.innerHTML = \"播放base64\";\n\t}else{\n\t\tplay();\n\t\tisPlay = true;\n\t\tbtn.innerHTML = \"停止播放\";\n\t}\n}\n\nfunction play(){\n\t// 音频持续大概时间(秒)\n    //预加载 + 播放\n\tRongIMLib.RongIMVoice.preLoaded(voice, function(){\n    \t// 播放声音\n    \tRongIMLib.RongIMVoice.play(voice,duration);\n\t});\n}\n\nfunction stop(){\n\tRongIMLib.RongIMVoice.stop(voice);\n}\n</script>\n\n\n</body>\n</html>"
  },
  {
    "path": "miniprogram-upload/README.md",
    "content": "## 小程序 IM 上传文件 Demo\n\n### 目录说明\n\n```\nupload-miniprogram\n├── pages\n│   ├── index \n│   │   ├── index.wxml 上传页面\n│   │   ├── index.js   上传逻辑\n│   ├── lib 依赖库\n│   │   ├── RongIMLib-3.0.4-dev.js 融云小程序 SDK\n│   └── services.js 服务层，连接IM、上传模块封装\n```\n\n### 上传模块说明\n\n**注意：IM 下 getFileToken、 getFileUrl 必须在连接成功后调用**\n\n融云小程序提供两种上传服务，上传七牛云，若上传七牛云失败降级上传到百度 BOS\n1、上传使用小程序 SDK 的 `getFileToken` 方法获取上传认证信息， 使用 `getFileUrl` 获取上传成功后的可访问地址\n2、上传接口使用微信官方接口 `wx.uploadFile` 和 `wx.request` 方法\n\n```js\n/**\n* 上传百度 BOS\n*/\nconst uploadBos = (url, fileInfo, header) => {\n  return new Promise((resolve, reject) => {\n    const fileData = wx.getFileSystemManager().readFileSync(fileInfo.path);\n    wx.request({\n      url: url,\n      header: header,\n      method: 'POST',\n      data: fileData,\n      success: function(res) {\n        console.log(res);\n        let data = {\n          downloadUrl: url, //上传成功的 url 即为下载 url\n          isBosRes: true // 判断是否是百度返回\n        }\n        resolve(data);\n      },\n      fail: reject\n    });\n  });\n}\n\n/**\n* 上传七牛云\n*/\nconst uploadQiNiu = (fileInfo, token, bosHeaders, bosUrl) => {\n  const url = user.qiniuHost;\n  return new Promise((resolve, reject) => {\n    wx.uploadFile({\n      url: url,\n      filePath: fileInfo.path,\n      name: 'file',\n      formData: {\n        token: token\n      },\n      success: resolve,\n      fail: function(err){\n        console.log('upload qiniu failed', err);\n        uploadBos(bosUrl, fileInfo, bosHeaders).then(function(res) {\n          resolve(res);\n        },function(err) {\n          reject(err);\n        });\n      }\n    })\n  });\n};\n\n/**\n* 上传\n*/\nconst upload = (fileInfo, uploadType) => {\n  let fileType = uploadType || RongIMLib.FILE_TYPE.FILE;\n  let fileName = fileInfo.name || '';\n  /**\n   * 获取 七牛、百度 上传认证信息\n  */\n  return imInstance.getFileToken(fileType, fileName).then(result => {\n    /**\n     * token 七牛认证信息\n     * bosToken 百度上传认证 authorization 请求头\n     * bosDate 百度上传 x-bce-date 请求头\n     * bos 百度上传域名\n     * path 百度上传路径\n    */\n    let { token, bosToken, bosDate, bos, path } = result;\n    let bosHeaders = {\n      'authorization': bosToken,\n      'x-bce-date': bosDate,\n      'Content-Type': 'multipart/form-data',\n    }\n    const bosUploadUrl = bos + path;\n    return uploadQiNiu(fileInfo, token, bosHeaders, bosUploadUrl);\n  }).then(res => {\n    let qiniuHash, qiniuName;\n    /**\n     * isBosRes: 是否是百度返回结果，不是百度返回结果需传入返回的 hash、name\n    */\n    if(!res.isBosRes){\n      const { data } = res;\n      const { hash, name } = JSON.parse(data);\n      qiniuHash = hash, qiniuName = name;\n    }\n    return imInstance.getFileUrl(fileType, qiniuHash, qiniuName, res);\n  })\n}\n```"
  },
  {
    "path": "miniprogram-upload/app.js",
    "content": "//app.js\nApp({\n  onLaunch: function () {\n    // 展示本地存储能力\n    var logs = wx.getStorageSync('logs') || []\n    logs.unshift(Date.now())\n    wx.setStorageSync('logs', logs)\n\n    // 登录\n    wx.login({\n      success: res => {\n        // 发送 res.code 到后台换取 openId, sessionKey, unionId\n      }\n    })\n    // 获取用户信息\n    wx.getSetting({\n      success: res => {\n        if (res.authSetting['scope.userInfo']) {\n          // 已经授权，可以直接调用 getUserInfo 获取头像昵称，不会弹框\n          wx.getUserInfo({\n            success: res => {\n              // 可以将 res 发送给后台解码出 unionId\n              this.globalData.userInfo = res.userInfo\n\n              // 由于 getUserInfo 是网络请求，可能会在 Page.onLoad 之后才返回\n              // 所以此处加入 callback 以防止这种情况\n              if (this.userInfoReadyCallback) {\n                this.userInfoReadyCallback(res)\n              }\n            }\n          })\n        }\n      }\n    })\n  },\n  globalData: {\n    userInfo: null\n  }\n})"
  },
  {
    "path": "miniprogram-upload/app.json",
    "content": "{\n  \"pages\":[\n    \"pages/index/index\"\n  ],\n  \"window\":{\n    \"backgroundTextStyle\":\"light\",\n    \"navigationBarBackgroundColor\": \"#fff\",\n    \"navigationBarTitleText\": \"WeChat\",\n    \"navigationBarTextStyle\":\"black\"\n  },\n  \"style\": \"v2\",\n  \"sitemapLocation\": \"sitemap.json\"\n}\n"
  },
  {
    "path": "miniprogram-upload/app.wxss",
    "content": "/**app.wxss**/\n.container {\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: space-between;\n  padding: 200rpx 0;\n  box-sizing: border-box;\n} \n"
  },
  {
    "path": "miniprogram-upload/pages/index/index.js",
    "content": "//index.js\n//获取应用实例\nconst app = getApp()\nconst { Status, File } = require('../services');\n\nPage({\n  data: {\n    title: 'IM Upload Demo',\n    userInfo: {},\n    hasUserInfo: false,\n    canIUse: wx.canIUse('button.open-type.getUserInfo')\n  },\n  onLoad: function () {\n    console.log(Status);\n    Status.connect();\n  },\n  getUserInfo: function(e) {\n    console.log(e)\n    app.globalData.userInfo = e.detail.userInfo\n    this.setData({\n      userInfo: e.detail.userInfo,\n      hasUserInfo: true\n    })\n  },\n  upload: function() {\n    wx.chooseImage({\n      count: 1,\n      sizeType: ['original'],\n      sourceType: ['album', 'camera'],\n      success: (res) => {\n        let { tempFilePaths, tempFiles } = res;\n        let tempFilePath = tempFilePaths[0];\n        console.log('tempFiles',tempFiles);\n        File.upload({\n          path: tempFilePath,\n          name: 'image.png'\n        }, 1).then(res => {\n          console.log('可下载地址:', res.downloadUrl);\n        });\n      }\n    });\n    \n  },\n  uploadFile: function() {\n    wx.chooseMessageFile({\n      count: 1,\n      type: 'file',\n      success: function(res) {\n        console.log(res);\n        let { tempFiles } = res;\n        File.upload(tempFiles[0], 4).then(res => {\n          console.log('可下载地址:', res.downloadUrl);\n        });;\n      }\n    })\n  }\n})\n"
  },
  {
    "path": "miniprogram-upload/pages/index/index.json",
    "content": "{\n  \"usingComponents\": {}\n}"
  },
  {
    "path": "miniprogram-upload/pages/index/index.wxml",
    "content": "<!--index.wxml-->\n<view class=\"container\">\n  <view class=\"usermotto\">\n    <text class=\"user-motto\">{{title}}</text>\n  </view>\n  <view class=\"userinfo\">\n    <button bindtap=\"upload\"> 上传图片 </button>\n  </view>\n  <view class=\"userinfo\">\n    <button bindtap=\"uploadFile\"> 上传文件</button>\n  </view>\n</view>\n"
  },
  {
    "path": "miniprogram-upload/pages/index/index.wxss",
    "content": "/**index.wxss**/\n.userinfo {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  margin: 10px;\n}\n\n.userinfo button {\n  background-color: #cccccc47;\n}\n.userinfo-avatar {\n  width: 128rpx;\n  height: 128rpx;\n  margin: 20rpx;\n  border-radius: 50%;\n}\n\n.userinfo-nickname {\n  color: #aaa;\n}\n\n.usermotto {\n  margin-top: 20px;\n  margin-bottom: 30px;\n  font-weight: 900;\n  font-size: 20px;\n}"
  },
  {
    "path": "miniprogram-upload/pages/lib/RongIMLib-3.0.4-dev.js",
    "content": "/*\n* RongIMLib.js v3.0.4-dev\n* CodeVersion: 3e685c44daec435ae51dfc40d676b247265868e3\n* Release Date: Tue Jun 16 2020 10:40:53 GMT+0800 (China Standard Time)\n* Copyright 2020 RongCloud\n* Released under the MIT License.\n*/\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.RongIMLib = factory());\n}(this, (function () { 'use strict';\n\n  var versionToServer = \"3.0.4\";\n\n  var SDK_VERSION = versionToServer;\n\n  var ERROR_INFO = {\n    TIMEOUT: {\n      code: -1,\n      msg: 'Network timeout'\n    },\n    SDK_INTERNAL_ERROR: {\n      code: -2,\n      msg: 'SDK internal error'\n    },\n    PARAMETER_ERROR: {\n      code: -3,\n      msg: 'Please check the parameters, the {param} expected a value of {expect} but received {current}'\n    },\n    REJECTED_BY_BLACKLIST: {\n      code: 405,\n      msg: 'Blacklisted by the other party'\n    },\n    SEND_TOO_FAST: {\n      code: 20604,\n      msg: 'Sending messages too quickly'\n    },\n    NOT_IN_GROUP: {\n      code: 22406,\n      msg: 'Not in group'\n    },\n    FORBIDDEN_IN_GROUP: {\n      code: 22408,\n      msg: 'Forbbiden from speaking in the group'\n    },\n    NOT_IN_CHATROOM: {\n      code: 23406,\n      msg: 'Not in chatRoom'\n    },\n    FORBIDDEN_IN_CHATROOM: {\n      code: 23408,\n      msg: 'Forbbiden from speaking in the chatRoom'\n    },\n    KICKED_FROM_CHATROOM: {\n      code: 23409,\n      msg: 'Kicked out and forbbiden from joining the chatRoom'\n    },\n    CHATROOM_NOT_EXIST: {\n      code: 23410,\n      msg: 'ChatRoom does not exist'\n    },\n    CHATROOM_IS_FULL: {\n      code: 23411,\n      msg: 'ChatRoom members exceeded'\n    },\n    PARAMETER_INVALID_CHATROOM: {\n      code: 23412,\n      msg: 'Invalid chatRoom parameters'\n    },\n    ROAMING_SERVICE_UNAVAILABLE_CHATROOM: {\n      code: 23414,\n      msg: 'ChatRoom message roaming service is not open, Please go to the developer to open this service'\n    },\n    RECALLMESSAGE_PARAMETER_INVALID: {\n      code: 25101,\n      msg: 'Invalid recall message parameter'\n    },\n    PUSHSETTING_PARAMETER_INVALID: {\n      code: 26001,\n      msg: 'Invalid push parameter'\n    },\n    OPERATION_BLOCKED: {\n      code: 20605,\n      msg: 'Operation is blocked'\n    },\n    OPERATION_NOT_SUPPORT: {\n      code: 20606,\n      msg: 'Operation is not supported'\n    },\n    MSG_BLOCKED_SENSITIVE_WORD: {\n      code: 21501,\n      msg: 'The sent message contains sensitive words'\n    },\n    REPLACED_SENSITIVE_WORD: {\n      code: 21502,\n      msg: 'Sensitive words in the message have been replaced'\n    },\n    NOT_CONNECTED: {\n      code: 30001,\n      msg: 'Please connect successfully first'\n    },\n    NAVI_REQUEST_ERROR: {\n      code: 30007,\n      msg: 'Navigation http request failed'\n    },\n    CMP_REQUEST_ERROR: {\n      code: 30010,\n      msg: 'CMP sniff http request failed'\n    },\n    CONN_APPKEY_FAKE: {\n      code: 31002,\n      msg: 'Your appkey is fake'\n    },\n    CONN_MINI_SERVICE_NOT_OPEN: {\n      code: 31003,\n      msg: 'Mini program service is not open, Please go to the developer to open this service'\n    },\n    CONN_TOKEN_INCORRECT: {\n      code: 31004,\n      msg: 'Your token is not valid or expired'\n    },\n    CONN_NOT_AUTHRORIZED: {\n      code: 31005,\n      msg: 'AppKey and Token do not match'\n    },\n    CONN_REDIRECTED: {\n      code: 31006,\n      msg: 'Connection redirection'\n    },\n    CONN_APP_BLOCKED_OR_DELETED: {\n      code: 31008,\n      msg: 'AppKey is banned or deleted'\n    },\n    CONN_USER_BLOCKED: {\n      code: 31009,\n      msg: 'User blocked'\n    },\n    CONN_DOMAIN_INCORRECT: {\n      code: 31012,\n      msg: 'Connect domain error, Please check the set security domain'\n    },\n    ROAMING_SERVICE_UNAVAILABLE: {\n      code: 33007,\n      msg: 'Roaming service cloud is not open, Please go to the developer to open this service'\n    },\n    RC_CONNECTION_EXIST: {\n      code: 34001,\n      msg: 'Connection already exists'\n    },\n    CHATROOM_KV_EXCEED: {\n      code: 23423,\n      msg: 'ChatRoom KV setting exceeds maximum'\n    },\n    CHATROOM_KV_OVERWRITE_INVALID: {\n      code: 23424,\n      msg: 'ChatRoom KV already exists'\n    },\n    CHATROOM_KV_STORE_NOT_OPEN: {\n      code: 23426,\n      msg: 'ChatRoom KV storage service is not open, Please go to the developer to open this service'\n    },\n    CHATROOM_KEY_NOT_EXIST: {\n      code: 23427,\n      msg: 'ChatRoom key does not exist'\n    }\n  };\n  var ERROR_CODE = {};\n  var ERROR_CODE_TO_INFO = {};\n\n  for (var name$1 in ERROR_INFO) {\n    var info = ERROR_INFO[name$1];\n    var code = info.code;\n    ERROR_CODE[name$1] = code;\n    ERROR_CODE[code] = name$1;\n    ERROR_CODE_TO_INFO[code] = info;\n  }\n\n  var SERVER_ERROR_TO_CODE = {\n    '1': ERROR_INFO.ROAMING_SERVICE_UNAVAILABLE.code\n  };\n\n  var _CONNECT_SERVER_STATU, _SERVER_DISCONNECT_ST, _TRANSPORTER_STATUS_T;\n  var NAVI_ERROR_INFO = {\n    '401': ERROR_INFO.CONN_TOKEN_INCORRECT,\n    '403': ERROR_INFO.CONN_APPKEY_FAKE\n  };\n  var CONNECTION_STATUS = {\n    CONNECTED: 0,\n    CONNECTING: 1,\n    DISCONNECTED: 2,\n    NETWORK_UNAVAILABLE: 3,\n    SOCKET_ERROR: 4,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 6,\n    BLOCKED: 12\n  };\n  var SERVER_DISCONNECT_STATUS = {\n    KICKED_OFFLINE_BY_OTHER_CLIENT: 1,\n    BLOCKED: 2\n  };\n  var CONNECT_SERVER_STATUS = {\n    IDENTIFIER_REJECTED: 2,\n    CONN_MINI_SERVICE_NOT_OPEN: 3,\n    TOKEN_INCORRECT: 4,\n    NOT_AUTHORIZED: 5,\n    REDIRECT: 6,\n    PACKAGE_ERROR: 7,\n    APP_BLOCK_OR_DELETE: 8,\n    BLOCK: 9,\n    TOKEN_EXPIRE: 10,\n    DEVICE_ERROR: 11,\n    DOMAIN_INCORRECT: 12\n  };\n  var CONNECT_SERVER_STATUS_MAP_ERROR_INFO = (_CONNECT_SERVER_STATU = {}, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.IDENTIFIER_REJECTED] = ERROR_INFO.CONN_APPKEY_FAKE, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.CONN_MINI_SERVICE_NOT_OPEN] = ERROR_INFO.CONN_MINI_SERVICE_NOT_OPEN, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_INCORRECT] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.NOT_AUTHORIZED] = ERROR_INFO.CONN_NOT_AUTHRORIZED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.REDIRECT] = ERROR_INFO.CONN_REDIRECTED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.APP_BLOCK_OR_DELETE] = ERROR_INFO.CONN_APP_BLOCKED_OR_DELETED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.BLOCK] = ERROR_INFO.CONN_USER_BLOCKED, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.TOKEN_EXPIRE] = ERROR_INFO.CONN_TOKEN_INCORRECT, _CONNECT_SERVER_STATU[CONNECT_SERVER_STATUS.DOMAIN_INCORRECT] = ERROR_INFO.CONN_DOMAIN_INCORRECT, _CONNECT_SERVER_STATU);\n  var TRANSPORTER_STATUS = {\n    CONNECTED: CONNECTION_STATUS.CONNECTED,\n    KICKED_OFFLINE_BY_OTHER_CLIENT: CONNECTION_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT,\n    BLOCKED: CONNECTION_STATUS.BLOCKED,\n    CLOSE_NORMAL: 1000,\n    CLOSE_GOING_AWAY: 1001,\n    CLOSE_PROTOCOL_ERROR: 1002,\n    CLOSE_UNSUPPORTED: 1003,\n    CLOSE_NO_STATUS: 1005,\n    CLOSE_ABNORMAL: 1006,\n    UNSUPPORTED_DATA: 1007,\n    POLICY_VIOLATION: 1008,\n    CLOSE_TOO_LARGE: 1009,\n    MISSING_EXTENSION: 1010,\n    INTERNAL_ERROR: 1011,\n    SERVICE_RESTART: 1012,\n    TRY_AGAIN_LATER: 1013,\n    TSL_HANDSHAKE: 1015,\n    PING_FIRST_TIMEOUT: 2001,\n    PING_TIMEOUT: 2002,\n    DISCONNECT_TOO_FAST: 2003,\n    EXCEED_MESSAGE_ID_LIMIT: 2004,\n    COMET_REQUEST_ERROR: 2005,\n    MINI_URL_NOT_IN_DOMAIN_LIST: 2006\n  };\n  var MINI_ERROR_MSG_TO_STATUS = {\n    'url not in domain list': TRANSPORTER_STATUS.MINI_URL_NOT_IN_DOMAIN_LIST\n  };\n  var SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS = (_SERVER_DISCONNECT_ST = {}, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT] = TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT, _SERVER_DISCONNECT_ST[SERVER_DISCONNECT_STATUS.BLOCKED] = TRANSPORTER_STATUS.BLOCKED, _SERVER_DISCONNECT_ST);\n  var TRANSPORTER_STATUS_NEED_UPDATE_CMP = [TRANSPORTER_STATUS.CLOSE_NORMAL, TRANSPORTER_STATUS.CLOSE_GOING_AWAY, TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR, TRANSPORTER_STATUS.CLOSE_UNSUPPORTED, TRANSPORTER_STATUS.UNSUPPORTED_DATA, TRANSPORTER_STATUS.POLICY_VIOLATION, TRANSPORTER_STATUS.MISSING_EXTENSION, TRANSPORTER_STATUS.INTERNAL_ERROR, TRANSPORTER_STATUS.SERVICE_RESTART, TRANSPORTER_STATUS.TRY_AGAIN_LATER, TRANSPORTER_STATUS.TSL_HANDSHAKE, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST, TRANSPORTER_STATUS.COMET_REQUEST_ERROR];\n  var TRANSPORTER_STATUS_NEED_RECONNECT = TRANSPORTER_STATUS_NEED_UPDATE_CMP.concat([TRANSPORTER_STATUS.PING_TIMEOUT, TRANSPORTER_STATUS.CLOSE_ABNORMAL, TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT, TRANSPORTER_STATUS.COMET_REQUEST_ERROR]);\n  var TRANSPORTER_STATUS_TO_CONNECTION_STATUS = (_TRANSPORTER_STATUS_T = {}, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_GOING_AWAY] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_PROTOCOL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_UNSUPPORTED] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_NO_STATUS] = CONNECTION_STATUS.DISCONNECTED, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_ABNORMAL] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.DISCONNECT_TOO_FAST] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.UNSUPPORTED_DATA] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.POLICY_VIOLATION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.CLOSE_TOO_LARGE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.MISSING_EXTENSION] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.INTERNAL_ERROR] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.SERVICE_RESTART] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TRY_AGAIN_LATER] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.TSL_HANDSHAKE] = CONNECTION_STATUS.SOCKET_ERROR, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_FIRST_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.PING_TIMEOUT] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T[TRANSPORTER_STATUS.COMET_REQUEST_ERROR] = CONNECTION_STATUS.NETWORK_UNAVAILABLE, _TRANSPORTER_STATUS_T);\n\n  var CONNECT_TYPE = {\n    COMET: 'comet',\n    WEBSOCKET: 'websocket'\n  };\n  var CONVERSATION_TYPE = {\n    PRIVATE: 1,\n    GROUP: 3,\n    CHATROOM: 4,\n    CUSTOMER_SERVICE: 5,\n    SYSTEM: 6,\n    RTC_ROOM: 12\n  };\n  var MESSAGE_DIRECTION = {\n    SEND: 1,\n    RECEIVE: 2\n  };\n  var MESSAGS_TIME_ORDER = {\n    DESC: 0,\n    ASC: 1\n  };\n  var CHATROOM_ORDER = {\n    ASC: 1,\n    DESC: 2\n  };\n  var RECALL_MESSAGE_TYPE = 'RC:RcCmd';\n  var MENTIOND_TYPE = {\n    ALL: 1,\n    SINGAL: 2\n  };\n  var MESSAGE_TYPE = {\n    TEXT: 'RC:TxtMsg',\n    VOICE: 'RC:VcMsg',\n    HQ_VOICE: 'RC:HQVCMsg',\n    IMAGE: 'RC:ImgMsg',\n    GIF: 'RC:GIFMsg',\n    RICH_CONTENT: 'RC:ImgTextMsg',\n    LOCATION: 'RC:LBSMsg',\n    FILE: 'RC:FileMsg',\n    SIGHT: 'RC:SightMsg',\n    COMBINE: 'RC:CombineMsg',\n    CHRM_KV_NOTIFY: 'RC:chrmKVNotiMsg',\n    LOG_COMMAND: 'RC:LogCmdMsg'\n  };\n  var RTC_API_TYPE = {\n    ROOM: 1,\n    PERSON: 2\n  };\n  var FILE_TYPE = {\n    IMAGE: 1,\n    AUDIO: 2,\n    VIDEO: 3,\n    FILE: 4\n  };\n  var CHATROOM_ENTRY_TYPE = {\n    UPDATE: 1,\n    DELETE: 2\n  };\n  var NOTIFICATION_STATUS = {\n    DO_NOT_DISTURB: 1,\n    NOTIFY: 2\n  };\n  var product = {\n    CONNECT_TYPE: CONNECT_TYPE,\n    CONNECTION_STATUS: CONNECTION_STATUS,\n    CONVERSATION_TYPE: CONVERSATION_TYPE,\n    MESSAGE_DIRECTION: MESSAGE_DIRECTION,\n    MESSAGS_TIME_ORDER: MESSAGS_TIME_ORDER,\n    CHATROOM_ORDER: CHATROOM_ORDER,\n    RECALL_MESSAGE_TYPE: RECALL_MESSAGE_TYPE,\n    MESSAGE_TYPE: MESSAGE_TYPE,\n    MENTIOND_TYPE: MENTIOND_TYPE,\n    SDK_VERSION: SDK_VERSION,\n    FILE_TYPE: FILE_TYPE,\n    CHATROOM_ENTRY_TYPE: CHATROOM_ENTRY_TYPE,\n    NOTIFICATION_STATUS: NOTIFICATION_STATUS\n  };\n\n  var IM_TIMEOUT = 30000;\n  var IM_PING_INTERVAL_TIME = 30000;\n  var IM_COMET_PULLMSG_TIMEOUT = 45000;\n  var IM_PING_MAX_TIMEOUT = 6000;\n  var IM_PING_MIN_TIMEOUT = 2000;\n  var HTTP_TIMEOUT = 60000;\n  var PULL_MSG_TIME = 180000;\n  var NAVI_EXPIRED_TIME = 7200000;\n  var CMP_SNIFF_INTERNAL_TIME = 1000;\n  var FIRST_PING_TIMEOUT = 1000;\n  var NAVI_REQUEST_SUCCESS_CODE = 200;\n  var NAVI_SEPARATOR_IN_TOKEN = '@';\n  var DOMAIN_SEPARATOR_IN_NAVLIST = ';';\n  var DOMAIN_SEPARATOR_IN_CMPLIST = ',';\n  var MAX_SINGAL_ID = 65535;\n  var MINIMUM_CONNECT_DURATION = 5000;\n  var CHATROOM_KEY_LENGTH = {\n    MAX: 128,\n    MIN: 1\n  };\n  var CHATROOM_VALUE_LENGTH = {\n    MAX: 4096,\n    MIN: 1\n  };\n  var TYPE_HAS_CONVERSATION = [CONVERSATION_TYPE.PRIVATE, CONVERSATION_TYPE.GROUP, CONVERSATION_TYPE.SYSTEM];\n  var PLATFORM = {\n    WEB: 'web',\n    WX: 'wx',\n    ZFB: 'zfb',\n    TT: 'tt',\n    BAIDU: 'baidu',\n    QUICK_APP: 'quick_app'\n  };\n  var REQUEST_METHOD = {\n    POST: 'post',\n    GET: 'get'\n  };\n  var STORAGE_ROOT_KEY = 'rc-';\n  var STORAGE_DEVICE_ID_KEY = STORAGE_ROOT_KEY + 'deviceId';\n  var STORAGE_SESSION_ID_KEY = STORAGE_ROOT_KEY + 'sessionId';\n  var STORAGE_NAVI = {\n    ROOT_KEY_TPL: 'nav-{appkey}-{UID}',\n    SUB_KEY: {\n      CONNECT_TYPE: 'connettype',\n      TIME_WHEN_SAVED: 'time',\n      RESPONSE: 'resp'\n    }\n  };\n  var STORAGE_SYNC_TIME = {\n    ROOT_KEY_TPL: 'sync-{appkey}-{userId}',\n    SUB_KEY: {\n      SENDBOX: 'send',\n      INBOX: 'in'\n    }\n  };\n  var STORAGE_CONVERSATION = {\n    ROOT_KEY_TPL: 'con-{appkey}-{userId}',\n    SUB_KEY: {\n      ROOT_TPL: '{type}-{id}',\n      UNREAD_COUNT: 'c',\n      UNREAD_LAST_TIME: 't',\n      HAS_MENTIOND: 'hm',\n      MENTIOND_INFO: 'm',\n      NOTIFICATION: 'no',\n      TOP: 'to'\n    }\n  };\n  var STORAGE_CONVERSATION_STATUS = {\n    ROOT_KEY_TPL: 'con-s-{appkey}-{userId}',\n    SUB_KEY: {\n      TIME: 't'\n    }\n  };\n  var STORAGE_USER_SETTING = {\n    ROOT_KEY_TPL: 'sett-{appkey}-{userId}',\n    SUB_KEY: {\n      VERSION: 'v',\n      SETTINGS: 's'\n    }\n  };\n  var HTTP_PROTOCOL = {\n    HTTP: 'http:',\n    HTTPS: 'https:',\n    FILE: 'file:'\n  };\n  var WS_PROTOCOL = {\n    WSS: 'wss:',\n    WS: 'ws:'\n  };\n  var NAVI_CALLBACK_NAME = 'getServerEndpoint';\n  var NAVI_TYPE = {\n    COMET: 'cometnavi',\n    WEBSOCKET: 'navi'\n  };\n  var NAVI_URL_TPL = '{url}/{type}.js?appId={appkey}&token={token}&callBack=' + NAVI_CALLBACK_NAME + '&r={random}&v=' + SDK_VERSION;\n  var CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION;\n  var MINI_CMP_URL_TPL = '{protocol}//{domain}/websocket?appId={appkey}&token={token}&apiVer={apiVer}&sdkVer=' + SDK_VERSION + '&platform={platform}';\n  var COMET_REQ_HAS_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&topic={topic}&targetid={targetId}&pid={pid}';\n  var COMET_REQ_NO_TOPIC_URL_TPL = '{protocol}//{domain}/websocket?messageid={messageId}&header={headerCode}&sessionid={sessionId}&pid={pid}';\n  var COMET_PULL_URL_TPL = '{protocol}//{domain}/pullmsg.js?sessionid={sessionId}&timestrap={timestamp}&pid={pid}';\n  var TIMER_TYPE = {\n    INTERVAL: 'interval',\n    TIMEOUT: 'timeout'\n  };\n  var TIMER_STATUS = {\n    PENNDING: 'pendding',\n    BUSY: 'busy',\n    ENDING: 'ending'\n  };\n  var PLATFORM_TYPE = {\n    MINI: 'Miniprogram',\n    WEB: 'Web'\n  };\n\n  var UnKown = 'UnKown';\n\n  var isMiniEnv = function isMiniEnv(global) {\n    return global !== window;\n  };\n\n  var hasMiniBaseEvent = function hasMiniBaseEvent(miniGlobal) {\n    var baseMiniEventNames = ['canIUse', 'getSystemInfo'];\n\n    for (var i = 0, max = baseMiniEventNames.length; i < max; i++) {\n      var baseEventName = baseMiniEventNames[i];\n\n      if (!miniGlobal[baseEventName]) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n  var getEnvInfo = function getEnvInfo() {\n    if (typeof wx !== 'undefined' && hasMiniBaseEvent(wx)) {\n      return {\n        platform: PLATFORM.WX,\n        global: wx\n      };\n    } else if (typeof swan !== 'undefined' && hasMiniBaseEvent(swan)) {\n      return {\n        platform: PLATFORM.BAIDU,\n        global: swan\n      };\n    } else if (typeof tt !== 'undefined' && hasMiniBaseEvent(tt)) {\n      return {\n        platform: PLATFORM.TT,\n        global: tt\n      };\n    } else if (typeof my !== 'undefined' && hasMiniBaseEvent(my)) {\n      return {\n        platform: PLATFORM.ZFB,\n        global: my\n      };\n    } else {\n      return {\n        platform: PLATFORM.WEB,\n        global: window\n      };\n    }\n  };\n\n  var getWebSystemInfo = function getWebSystemInfo() {\n    var userAgent = navigator.userAgent;\n    var version, type;\n    var condition = {\n      IE: /rv:([\\d.]+)\\) like Gecko|MSIE ([\\d.]+)/,\n      Edge: /Edge\\/([\\d.]+)/,\n      Firefox: /Firefox\\/([\\d.]+)/,\n      Opera: /(?:OPERA|OPR).([\\d.]+)/,\n      WeiXin: /MicroMessenger\\/([\\d.]+)/,\n      QQBrowser: /QQBrowser\\/([\\d.]+)/,\n      Chrome: /Chrome\\/([\\d.]+)/,\n      Safari: /Version\\/([\\d.]+).*Safari/\n    };\n\n    for (var key in condition) {\n      if (!condition.hasOwnProperty(key)) continue;\n      var browserContent = userAgent.match(condition[key]);\n\n      if (browserContent) {\n        type = key;\n        version = browserContent[1] || browserContent[2];\n        break;\n      }\n    }\n\n    return {\n      model: type || UnKown,\n      version: version || UnKown\n    };\n  };\n\n  var getMiniSystemInfo = function getMiniSystemInfo(global) {\n    var systemInfo = global.getSystemInfoSync() || {};\n    var model = systemInfo.model,\n        brand = systemInfo.brand;\n\n    if (model && brand) {\n      model = model + ' ' + brand;\n    }\n\n    systemInfo.model = model;\n    return systemInfo;\n  };\n\n  var getProtocol = function getProtocol(global) {\n    var location = global.location || {};\n    var isHttp = location.protocol === HTTP_PROTOCOL.HTTP || location.protocol === HTTP_PROTOCOL.FILE;\n    var protocol = {\n      http: isHttp ? HTTP_PROTOCOL.HTTP : HTTP_PROTOCOL.HTTPS,\n      ws: WS_PROTOCOL.WSS\n    };\n\n    if (isHttp) {\n      protocol.ws = WS_PROTOCOL.WS;\n    }\n\n    return protocol;\n  };\n\n  var adaptGlobalObjectCreate = function adaptGlobalObjectCreate(global, isMini) {\n    if (!isMini && !global.Object.create) {\n      global.Object.create = function (o, properties) {\n        if (typeof o !== 'object' && typeof o !== 'function') throw new TypeError('Object prototype may only be an Object: ' + o);else if (o === null) throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support \\'null\\' as the first argument.');\n        if (typeof properties !== 'undefined') throw new Error('This browser\\'s implementation of Object.create is a shim and doesn\\'t support a second argument.');\n\n        function F() {}\n\n        F.prototype = o;\n        return new F();\n      };\n    }\n  };\n\n  var getMiniGlobal = function getMiniGlobal(global) {\n    return Object.assign(global, {\n      JSON: JSON,\n      Promise: Promise,\n      setTimeout: setTimeout,\n      setInterval: setInterval,\n      encodeURIComponent: encodeURIComponent,\n      clearTimeout: function (_clearTimeout) {\n        function clearTimeout(_x) {\n          return _clearTimeout.apply(this, arguments);\n        }\n\n        clearTimeout.toString = function () {\n          return _clearTimeout.toString();\n        };\n\n        return clearTimeout;\n      }(function (id) {\n        clearTimeout(id);\n      }),\n      clearInterval: function (_clearInterval) {\n        function clearInterval(_x2) {\n          return _clearInterval.apply(this, arguments);\n        }\n\n        clearInterval.toString = function () {\n          return _clearInterval.toString();\n        };\n\n        return clearInterval;\n      }(function (id) {\n        clearInterval(id);\n      })\n    });\n  };\n\n  var envInfo = getEnvInfo();\n  var platform = envInfo.platform,\n      global$1 = envInfo.global;\n  var isMini = isMiniEnv(global$1);\n  var protocol = getProtocol(global$1);\n  var system = isMini ? getMiniSystemInfo(global$1) : getWebSystemInfo();\n  system.name = platform;\n  adaptGlobalObjectCreate(global$1, isMini);\n  global$1 = isMini ? getMiniGlobal(global$1) : global$1;\n  var env = {\n    global: global$1,\n    system: system,\n    isMini: isMini,\n    protocol: protocol\n  };\n\n  var global$2 = env.global,\n      system$1 = env.system;\n  var isZFB = system$1.name === PLATFORM.ZFB;\n\n  var ZFBStorage = function () {\n    function ZFBStorage() {}\n\n    var _proto = ZFBStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$2.setStorageSync({\n        key: key,\n        data: value\n      });\n    };\n\n    _proto.get = function get(key) {\n      return global$2.getStorageSync({\n        key: key\n      });\n    };\n\n    _proto.remove = function remove(key) {\n      return global$2.removeStorageSync({\n        key: key\n      });\n    };\n\n    _proto.getKeys = function getKeys() {\n      var res = my.getStorageInfoSync();\n      return res.keys;\n    };\n\n    return ZFBStorage;\n  }();\n\n  var MiniStorage = function () {\n    function MiniStorage() {}\n\n    var _proto2 = MiniStorage.prototype;\n\n    _proto2.set = function set(key, value) {\n      global$2.setStorageSync(key, value);\n    };\n\n    _proto2.get = function get(key) {\n      try {\n        return global$2.getStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.remove = function remove(key) {\n      try {\n        return global$2.removeStorageSync(key);\n      } catch (e) {\n        return null;\n      }\n    };\n\n    _proto2.getKeys = function getKeys() {\n      try {\n        var res = global$2.getStorageInfoSync();\n        return res.keys;\n      } catch (e) {\n        return [];\n      }\n    };\n\n    return MiniStorage;\n  }();\n\n  var storage = isZFB ? ZFBStorage : MiniStorage;\n\n  var JSON$1 = {\n    parse: function parse(sJSON) {\n      return new Function('', 'return (' + sJSON + ')')();\n    },\n    stringify: function stringify(value) {\n      return JSON$1.str('', {\n        '': value\n      });\n    },\n    str: function str(key, holder) {\n      var i,\n          k,\n          v,\n          length,\n          partial,\n          value = holder[key],\n          self = JSON$1;\n\n      if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n        value = value.toJSON(key);\n      }\n\n      switch (typeof value) {\n        case 'string':\n          return self.quote(value);\n\n        case 'number':\n          return isFinite(value) ? String(value) : 'null';\n\n        case 'boolean':\n          return String(value);\n\n        case 'object':\n          if (!value) {\n            return 'null';\n          }\n\n          partial = [];\n\n          if (Object.prototype.toString.apply(value) === '[object Array]') {\n            length = value.length;\n\n            for (i = 0; i < length; i += 1) {\n              partial[i] = self.str(i, value) || 'null';\n            }\n\n            v = partial.length === 0 ? '[]' : '[' + partial.join(',') + ']';\n            return v;\n          }\n\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = self.str(k, value);\n\n              if (v) {\n                partial.push(self.quote(k) + ':' + v);\n              }\n            }\n          }\n\n          v = partial.length === 0 ? '{}' : '{' + partial.join(',') + '}';\n          return v;\n      }\n    },\n    quote: function quote(string) {\n      var self = JSON$1;\n      self.rx_escapable.lastIndex = 0;\n      return self.rx_escapable.test(string) ? '\"' + string.replace(self.rx_escapable, function (a) {\n        var c = self.meta[a];\n        return typeof c === 'string' ? c : \"\\\\u\" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n      }) + '\"' : '\"' + string + '\"';\n    },\n    rx_escapable: new RegExp(\"[\\\\\\\"\\\\\\\\\\\"\\0-\\x1F\\x7F-\\x9F\\xAD\\u0600-\\u0604\\u070F\\u17B4\\u17B5\\u200C-\\u200F\\u2028-\\u202F\\u2060-\\u206F\\uFEFF\\uFFF0-\\uFFFF]\", 'g'),\n    meta: {\n      '\\b': '\\\\b',\n      '\t': '\\\\t',\n      '\\n': '\\\\n',\n      '\\f': '\\\\f',\n      '\\r': '\\\\r',\n      '\"': '\\\\\"',\n      '\\'\\'': '\\\\\\'\\'',\n      '\\\\': '\\\\\\\\'\n    }\n  };\n\n  var CacheStorage = function () {\n    function CacheStorage(values) {\n      this.caches = {};\n\n      if (values) {\n        this.caches = values;\n      }\n    }\n\n    var _proto = CacheStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      this.caches[key] = value;\n    };\n\n    _proto.remove = function remove(key) {\n      var val = this.get(key);\n      delete this.caches[key];\n      return val;\n    };\n\n    _proto.get = function get(key) {\n      return this.caches[key];\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keys = [];\n\n      for (var key in this.caches) {\n        keys.push(key);\n      }\n\n      return keys;\n    };\n\n    return CacheStorage;\n  }();\n\n  var global$3 = env.global;\n  var TEST_KEY = 'RC_TEST_KEY';\n  var TEST_VALUE = 'RC_TEST_VALUE';\n\n  var isSupportLocalStorage = function isSupportLocalStorage() {\n    var isSupport = false;\n    var localStorage = global$3.localStorage;\n\n    if (localStorage) {\n      try {\n        localStorage.setItem(TEST_KEY, TEST_VALUE);\n        var testVal = localStorage.getItem(TEST_KEY);\n\n        if (testVal === TEST_VALUE) {\n          isSupport = true;\n        }\n\n        localStorage.removeItem(TEST_KEY);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebStorage = function () {\n    function WebStorage() {}\n\n    var _proto = WebStorage.prototype;\n\n    _proto.set = function set(key, value) {\n      global$3.localStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$3.localStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$3.localStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$3.localStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebStorage;\n  }();\n\n  var WebStorage$1 = isSupportLocalStorage() ? WebStorage : CacheStorage;\n\n  var isMini$1 = env.isMini;\n  var Storage = isMini$1 ? storage : WebStorage$1,\n      storage$1 = new Storage();\n\n  var global$4 = env.global;\n  var TEST_KEY$1 = 'RC_TEST_KEY';\n  var TEST_VALUE$1 = 'RC_TEST_VALUE';\n\n  var isSupportSessionStorage = function isSupportSessionStorage() {\n    var isSupport = false;\n    var sessionStorage = global$4.sessionStorage;\n\n    if (sessionStorage) {\n      try {\n        sessionStorage.setItem(TEST_KEY$1, TEST_VALUE$1);\n        var testVal = sessionStorage.getItem(TEST_KEY$1);\n\n        if (testVal === TEST_VALUE$1) {\n          isSupport = true;\n        }\n\n        sessionStorage.removeItem(TEST_KEY$1);\n      } catch (e) {}\n    }\n\n    return isSupport;\n  };\n\n  var WebSession = function () {\n    function WebSession() {}\n\n    var _proto = WebSession.prototype;\n\n    _proto.set = function set(key, value) {\n      global$4.sessionStorage.setItem(key, JSON$1.stringify({\n        d: value\n      }));\n    };\n\n    _proto.get = function get(key) {\n      var value;\n      var localValue = global$4.sessionStorage.getItem(key);\n\n      try {\n        localValue = JSON$1.parse(localValue);\n      } catch (e) {\n        localValue = {};\n      }\n\n      if (localValue && localValue.d) {\n        value = localValue.d;\n      }\n\n      return value;\n    };\n\n    _proto.remove = function remove(key) {\n      return global$4.sessionStorage.removeItem(key);\n    };\n\n    _proto.getKeys = function getKeys() {\n      var keyList = [];\n\n      for (var key in global$4.sessionStorage) {\n        keyList.push(key);\n      }\n\n      return keyList;\n    };\n\n    return WebSession;\n  }();\n\n  var WebSession$1 = isSupportSessionStorage() ? WebSession : CacheStorage;\n\n  var isMini$2 = env.isMini;\n  var Session = isMini$2 ? CacheStorage : WebSession$1,\n      session = new Session();\n\n  var global$5 = env.global;\n\n  var Socket = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      this.socket = global$5.connectSocket(options);\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      this.socket.send({\n        data: data\n      });\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.onOpen(callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.onMessage(callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.onError(callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.onClose(callback);\n    };\n\n    return Socket;\n  }();\n\n  var Socket$1 = function () {\n    function Socket(options) {\n      this.socket = void 0;\n      var url = options.url;\n      this.socket = new WebSocket(url);\n      this.socket.binaryType = 'arraybuffer';\n      return this;\n    }\n\n    var _proto = Socket.prototype;\n\n    _proto.send = function send(data) {\n      return this.socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.socket.close();\n    };\n\n    _proto.onOpen = function onOpen(callback) {\n      this.socket.addEventListener('open', callback);\n    };\n\n    _proto.onMessage = function onMessage(callback) {\n      this.socket.addEventListener('message', callback);\n    };\n\n    _proto.onError = function onError(callback) {\n      this.socket.addEventListener('error', callback);\n    };\n\n    _proto.onClose = function onClose(callback) {\n      this.socket.addEventListener('close', callback);\n    };\n\n    return Socket;\n  }();\n\n  var isMini$3 = env.isMini;\n  var Socket$2 = isMini$3 ? Socket : Socket$1;\n\n  /*!\n   基于 es6-promise\n   * Github: https://github.com/stefanpenner/es6-promise\n   * @overview es6-promise - a tiny implementation of Promises/A+.\n   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n   * @license   Licensed under MIT license\n   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n   * @version   v4.2.8+1e68dce6\n   */\n  var SparePromise = (function(){function a(a){var b=typeof a;return null!==a&&(\"object\"===b||\"function\"===b)}function b(a){return \"function\"==typeof a}function c(a){P=a;}function d(a){Q=a;}function e(){return function(){return process.nextTick(j)}}function f(){return \"undefined\"!=typeof O?function(){O(j);}:i()}function g(){var a=0,b=new T(j),c=document.createTextNode(\"\");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2;}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){return a.port2.postMessage(0)}}function i(){var a=setTimeout;return function(){return a(j,1)}}function j(){var a,b,c;for(a=0;N>a;a+=2)b=W[a],c=W[a+1],b(c),W[a]=void 0,W[a+1]=void 0;N=0;}function k(){try{var a=Function(\"return this\")().require(\"vertx\");return O=a.runOnLoop||a.runOnContext,f()}catch(b){return i()}}function l(a,b){var e,f,c=this,d=new this.constructor(n);return void 0===d[Y]&&D(d),e=c._state,e?(f=arguments[e-1],Q(function(){return A(e,d,f,c._result)})):y(c,d,a,b),d}function m(a){var c,b=this;return a&&\"object\"==typeof a&&a.constructor===b?a:(c=new b(n),u(c,a),c)}function n(){}function o(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function q(a,b,c,d){try{a.call(b,c,d);}catch(e){return e}}function r(a,b,c){Q(function(a){var d=!1,e=q(c,b,function(c){d||(d=!0,b!==c?u(a,c):w(a,c));},function(b){d||(d=!0,x(a,b));},\"Settle: \"+(a._label||\" unknown promise\"));!d&&e&&(d=!0,x(a,e));},a);}function s(a,b){b._state===$?w(a,b._result):b._state===_?x(a,b._result):y(b,void 0,function(b){return u(a,b)},function(b){return x(a,b)});}function t(a,c,d){c.constructor===a.constructor&&d===l&&c.constructor.resolve===m?s(a,c):void 0===d?w(a,c):b(d)?r(a,c,d):w(a,c);}function u(b,c){if(b===c)x(b,o());else if(a(c)){var d=void 0;try{d=c.then;}catch(e){return void x(b,e)}t(b,c,d);}else w(b,c);}function v(a){a._onerror&&a._onerror(a._result),z(a);}function w(a,b){a._state===Z&&(a._result=b,a._state=$,0!==a._subscribers.length&&Q(z,a));}function x(a,b){a._state===Z&&(a._state=_,a._result=b,Q(v,a));}function y(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+$]=c,e[f+_]=d,0===f&&a._state&&Q(z,a);}function z(a){var d,e,f,g,b=a._subscribers,c=a._state;if(0!==b.length){for(d=void 0,e=void 0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0;}}function A(a,c,d,e){var f=b(d),g=void 0,h=void 0,i=!0;if(f){try{g=d(e);}catch(j){i=!1,h=j;}if(c===g)return void x(c,p())}else g=e;c._state!==Z||(f&&i?u(c,g):i===!1?x(c,h):a===$?w(c,g):a===_&&x(c,g));}function B(a,b){try{b(function(b){u(a,b);},function(b){x(a,b);});}catch(c){x(a,c);}}function C(){return ab++}function D(a){a[Y]=ab++,a._state=void 0,a._result=void 0,a._subscribers=[];}function E(){return new Error(\"Array Methods must be provided an Array\")}function F(a){return new bb(this,a).promise}function G(a){var b=this;return new b(M(a)?function(c,d){for(var e=a.length,f=0;e>f;f++)b.resolve(a[f]).then(c,d);}:function(a,b){return b(new TypeError(\"You must pass an array to race.\"))})}function H(a){var b=this,c=new b(n);return x(c,a),c}function I(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function J(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function K(){var c,d,a=void 0;if(\"undefined\"!=typeof global)a=global;else if(\"undefined\"!=typeof self)a=self;else try{a=Function(\"return this\")();}catch(b){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}if(c=a.Promise){d=null;try{d=Object.prototype.toString.call(c.resolve());}catch(b){}if(\"[object Promise]\"===d&&!c.cast)return}a.Promise=cb;}var M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,L=void 0;return L=Array.isArray?Array.isArray:function(a){return \"[object Array]\"===Object.prototype.toString.call(a)},M=L,N=0,O=void 0,P=void 0,Q=function(a,b){W[N]=a,W[N+1]=b,N+=2,2===N&&(P?P(j):X());},R=\"undefined\"!=typeof window?window:void 0,S=R||{},T=S.MutationObserver||S.WebKitMutationObserver,U=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),V=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,W=new Array(1e3),X=void 0,X=U?e():T?g():V?h():void 0===R&&\"function\"==typeof require?k():i(),Y=Math.random().toString(36).substring(2),Z=void 0,$=1,_=2,ab=0,bb=function(){function a(a,b){this._instanceConstructor=a,this.promise=new a(n),this.promise[Y]||D(this.promise),M(b)?(this.length=b.length,this._remaining=b.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(b),0===this._remaining&&w(this.promise,this._result))):x(this.promise,E());}return a.prototype._enumerate=function(a){for(var b=0;this._state===Z&&b<a.length;b++)this._eachEntry(a[b],b);},a.prototype._eachEntry=function(a,b){var e,f,g,i,c=this._instanceConstructor,d=c.resolve;if(d===m){e=void 0,f=void 0,g=!1;try{e=a.then;}catch(h){g=!0,f=h;}e===l&&a._state!==Z?this._settledAt(a._state,b,a._result):\"function\"!=typeof e?(this._remaining--,this._result[b]=a):c===cb?(i=new c(n),g?x(i,f):t(i,a,e),this._willSettleAt(i,b)):this._willSettleAt(new c(function(b){return b(a)}),b);}else this._willSettleAt(d(a),b);},a.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===Z&&(this._remaining--,a===_?x(d,c):this._result[b]=c),0===this._remaining&&w(d,this._result);},a.prototype._willSettleAt=function(a,b){var c=this;y(a,void 0,function(a){return c._settledAt($,b,a)},function(a){return c._settledAt(_,b,a)});},a}(),cb=function(){function a(b){this[Y]=C(),this._result=this._state=void 0,this._subscribers=[],n!==b&&(\"function\"!=typeof b&&I(),this instanceof a?B(this,b):J());}return a.prototype[\"catch\"]=function(a){return this.then(null,a)},a.prototype[\"finally\"]=function(a){var c=this,d=c.constructor;return b(a)?c.then(function(b){return d.resolve(a()).then(function(){return b})},function(b){return d.resolve(a()).then(function(){throw b})}):c.then(a,a)},a}(),cb.prototype.then=l,cb.all=F,cb.race=G,cb.resolve=m,cb.reject=H,cb._setScheduler=c,cb._setAsap=d,cb._asap=Q,cb.polyfill=K,cb.Promise=cb,cb})();\n\n  var global$6 = env.global,\n      system$2 = env.system;\n  var isZFB$1 = system$2.name === PLATFORM.ZFB;\n\n  var zfbRequest = function zfbRequest(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    headers = headers || {};\n    timeout = timeout || HTTP_TIMEOUT;\n    return global$6.httpRequest({\n      url: url,\n      method: method,\n      data: body,\n      headers: headers,\n      timeout: timeout,\n      success: option.success,\n      fail: function fail(result) {\n        if (result.status === 202) {\n          option.success(result);\n        } else {\n          option.fail(result);\n        }\n      }\n    });\n  };\n\n  var request = isZFB$1 ? zfbRequest : global$6.request;\n  var MiniRequest = (function (option) {\n    var success = option.success,\n        fail = option.fail,\n        body = option.body;\n    option.data = option.data || body;\n    var xhr;\n\n    option.success = function (result) {\n      success(result.data, result.statusCode);\n    };\n\n    option.fail = function (result) {\n      fail(result.data, result.statusCode);\n    };\n\n    xhr = request(option);\n    return xhr;\n  });\n\n  var global$7 = env.global;\n\n  var isXDomainRequest = function isXDomainRequest(xhr) {\n    return Object.prototype.toString.call(xhr) === '[object XDomainRequest]' || typeof XDomainRequest === 'object';\n  };\n\n  var isValidRequest = function isValidRequest(obj) {\n    return typeof obj === 'function' || typeof obj === 'object';\n  };\n\n  var createXHR = function createXHR() {\n    var item = {\n      XMLHttpRequest: function (_XMLHttpRequest) {\n        function XMLHttpRequest() {\n          return _XMLHttpRequest.apply(this, arguments);\n        }\n\n        XMLHttpRequest.toString = function () {\n          return _XMLHttpRequest.toString();\n        };\n\n        return XMLHttpRequest;\n      }(function () {\n        return new XMLHttpRequest();\n      }),\n      XDomainRequest: function (_XDomainRequest) {\n        function XDomainRequest() {\n          return _XDomainRequest.apply(this, arguments);\n        }\n\n        XDomainRequest.toString = function () {\n          return _XDomainRequest.toString();\n        };\n\n        return XDomainRequest;\n      }(function () {\n        return new XDomainRequest();\n      }),\n      ActiveXObject: function (_ActiveXObject) {\n        function ActiveXObject() {\n          return _ActiveXObject.apply(this, arguments);\n        }\n\n        ActiveXObject.toString = function () {\n          return _ActiveXObject.toString();\n        };\n\n        return ActiveXObject;\n      }(function () {\n        return new ActiveXObject('Microsoft.XMLHTTP');\n      })\n    };\n    var isXHR = isValidRequest(global$7.XMLHttpRequest) && 'withCredentials' in new XMLHttpRequest();\n    var isXDR = isValidRequest(global$7.XDomainRequest);\n    var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n    return item[key]();\n  };\n\n  var request$1 = function request(option) {\n    var url = option.url,\n        method = option.method,\n        body = option.body,\n        headers = option.headers,\n        success = option.success,\n        fail = option.fail,\n        timeout = option.timeout;\n    method = method || REQUEST_METHOD.GET;\n    var xhr = createXHR();\n    xhr.open(method, url);\n\n    if (headers && xhr.setRequestHeader) {\n      for (var key in headers) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n\n    if ('onload' in xhr) {\n      xhr.onload = function () {\n        success(xhr.responseText, xhr);\n      };\n\n      xhr.onerror = function () {\n        fail(xhr.responseText, xhr);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 4) {\n          var result = xhr.responseText,\n              status = xhr.status;\n\n          if (status === 0) {\n            fail(result, xhr, status);\n          } else {\n            success(result, xhr, status);\n          }\n        }\n      };\n    }\n\n    if (timeout) {\n      xhr.timeout = timeout;\n    }\n\n    if (isXDomainRequest(xhr) && typeof body === 'object') {\n      body = JSON$1.stringify(body);\n    }\n\n    xhr.send(body);\n    return xhr;\n  };\n\n  var request$2 = env.isMini ? MiniRequest : request$1;\n\n  /*\n   * JavaScript MD5\n   * https://github.com/blueimp/JavaScript-MD5\n   *\n   * Copyright 2011, Sebastian Tschan\n   * https://blueimp.net\n   *\n   * Licensed under the MIT license:\n   * https://opensource.org/licenses/MIT\n   *\n   * Based on\n   * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n   * Digest Algorithm, as defined in RFC 1321.\n   * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n   * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n   * Distributed under the BSD License\n   * See http://pajhome.org.uk/crypt/md5 for more info.\n   */\n  var md5 = (function(){function a(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function b(a,b){return a<<b|a>>>32-b}function c(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}function h(b,c){var h,i,j,k,l,m,n,o,p;for(b[c>>5]|=128<<c%32,b[(c+64>>>9<<4)+14]=c,m=1732584193,n=-271733879,o=-1732584194,p=271733878,h=0;h<b.length;h+=16)i=m,j=n,k=o,l=p,m=d(m,n,o,p,b[h],7,-680876936),p=d(p,m,n,o,b[h+1],12,-389564586),o=d(o,p,m,n,b[h+2],17,606105819),n=d(n,o,p,m,b[h+3],22,-1044525330),m=d(m,n,o,p,b[h+4],7,-176418897),p=d(p,m,n,o,b[h+5],12,1200080426),o=d(o,p,m,n,b[h+6],17,-1473231341),n=d(n,o,p,m,b[h+7],22,-45705983),m=d(m,n,o,p,b[h+8],7,1770035416),p=d(p,m,n,o,b[h+9],12,-1958414417),o=d(o,p,m,n,b[h+10],17,-42063),n=d(n,o,p,m,b[h+11],22,-1990404162),m=d(m,n,o,p,b[h+12],7,1804603682),p=d(p,m,n,o,b[h+13],12,-40341101),o=d(o,p,m,n,b[h+14],17,-1502002290),n=d(n,o,p,m,b[h+15],22,1236535329),m=e(m,n,o,p,b[h+1],5,-165796510),p=e(p,m,n,o,b[h+6],9,-1069501632),o=e(o,p,m,n,b[h+11],14,643717713),n=e(n,o,p,m,b[h],20,-373897302),m=e(m,n,o,p,b[h+5],5,-701558691),p=e(p,m,n,o,b[h+10],9,38016083),o=e(o,p,m,n,b[h+15],14,-660478335),n=e(n,o,p,m,b[h+4],20,-405537848),m=e(m,n,o,p,b[h+9],5,568446438),p=e(p,m,n,o,b[h+14],9,-1019803690),o=e(o,p,m,n,b[h+3],14,-187363961),n=e(n,o,p,m,b[h+8],20,1163531501),m=e(m,n,o,p,b[h+13],5,-1444681467),p=e(p,m,n,o,b[h+2],9,-51403784),o=e(o,p,m,n,b[h+7],14,1735328473),n=e(n,o,p,m,b[h+12],20,-1926607734),m=f(m,n,o,p,b[h+5],4,-378558),p=f(p,m,n,o,b[h+8],11,-2022574463),o=f(o,p,m,n,b[h+11],16,1839030562),n=f(n,o,p,m,b[h+14],23,-35309556),m=f(m,n,o,p,b[h+1],4,-1530992060),p=f(p,m,n,o,b[h+4],11,1272893353),o=f(o,p,m,n,b[h+7],16,-155497632),n=f(n,o,p,m,b[h+10],23,-1094730640),m=f(m,n,o,p,b[h+13],4,681279174),p=f(p,m,n,o,b[h],11,-358537222),o=f(o,p,m,n,b[h+3],16,-722521979),n=f(n,o,p,m,b[h+6],23,76029189),m=f(m,n,o,p,b[h+9],4,-640364487),p=f(p,m,n,o,b[h+12],11,-421815835),o=f(o,p,m,n,b[h+15],16,530742520),n=f(n,o,p,m,b[h+2],23,-995338651),m=g(m,n,o,p,b[h],6,-198630844),p=g(p,m,n,o,b[h+7],10,1126891415),o=g(o,p,m,n,b[h+14],15,-1416354905),n=g(n,o,p,m,b[h+5],21,-57434055),m=g(m,n,o,p,b[h+12],6,1700485571),p=g(p,m,n,o,b[h+3],10,-1894986606),o=g(o,p,m,n,b[h+10],15,-1051523),n=g(n,o,p,m,b[h+1],21,-2054922799),m=g(m,n,o,p,b[h+8],6,1873313359),p=g(p,m,n,o,b[h+15],10,-30611744),o=g(o,p,m,n,b[h+6],15,-1560198380),n=g(n,o,p,m,b[h+13],21,1309151649),m=g(m,n,o,p,b[h+4],6,-145523070),p=g(p,m,n,o,b[h+11],10,-1120210379),o=g(o,p,m,n,b[h+2],15,718787259),n=g(n,o,p,m,b[h+9],21,-343485551),m=a(m,i),n=a(n,j),o=a(o,k),p=a(p,l);return [m,n,o,p]}function i(a){var b,c=\"\",d=32*a.length;for(b=0;d>b;b+=8)c+=String.fromCharCode(255&a[b>>5]>>>b%32);return c}function j(a){var b,d,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b<c.length;b+=1)c[b]=0;for(d=8*a.length,b=0;d>b;b+=8)c[b>>5]|=(255&a.charCodeAt(b/8))<<b%32;return c}function k(a){return i(h(j(a),8*a.length))}function l(a,b){var c,g,d=j(a),e=[],f=[];for(e[15]=f[15]=void 0,d.length>16&&(d=h(d,8*a.length)),c=0;16>c;c+=1)e[c]=909522486^d[c],f[c]=1549556828^d[c];return g=h(e.concat(j(b)),512+8*b.length),i(h(f.concat(g),640))}function m(a){var d,e,b=\"0123456789abcdef\",c=\"\";for(e=0;e<a.length;e+=1)d=a.charCodeAt(e),c+=b.charAt(15&d>>>4)+b.charAt(15&d);return c}function n(a){return unescape(encodeURIComponent(a))}function o(a){return k(n(a))}function p(a){return m(o(a))}function q(a,b){return l(n(a),n(b))}function r(a,b){return m(q(a,b))}function s(a,b,c){return b?c?q(b,a):r(b,a):c?o(a):p(a)}return s})();\n\n  var global$8 = env.global;\n  var Promise$1 = global$8.Promise;\n\n  var isSupportPromise = function isSupportPromise() {\n    if (!global$8.Promise) return false;\n\n    var defer = function () {\n      return global$8.Promise.resolve();\n    }();\n\n    return defer.then && defer[\"catch\"] && defer[\"finally\"];\n  };\n\n  var setTimeout$1 = function setTimeout(event, timeout) {\n    return global$8.setTimeout(event, timeout);\n  };\n\n  var clearTimeout$1 = function clearTimeout(id) {\n    return global$8.clearTimeout(id);\n  };\n\n  var setInterval$1 = function setInterval(event, timeout) {\n    return global$8.setInterval(event, timeout);\n  };\n\n  var clearInterval$1 = function clearInterval(id) {\n    return global$8.clearInterval(id);\n  };\n\n  var Defer = isSupportPromise() ? global$8.Promise : SparePromise;\n\n  var noop = function noop(data) {\n    return data;\n  };\n\n  var deferNoop = function deferNoop(data) {\n    return Promise$1.resolve(data);\n  };\n\n  var JSON$2 = global$8.JSON || JSON$1;\n\n  var allowError = function allowError(event) {\n    var result;\n\n    try {\n      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n\n      result = event.apply(void 0, args);\n    } catch (e) {\n      result = null;\n    }\n\n    return result;\n  };\n\n  var toJSON = function toJSON(val) {\n    return allowError(JSON$2.stringify, val);\n  };\n\n  var parseJSON = function parseJSON(val) {\n    return allowError(JSON$2.parse, val);\n  };\n\n  var copy = function copy(val) {\n    return parseJSON(toJSON(val));\n  };\n\n  var isObject = function isObject(val) {\n    return Object.prototype.toString.call(val) === '[object Object]';\n  };\n\n  var isArray = function isArray(val) {\n    return Object.prototype.toString.call(val).indexOf('Array') !== -1;\n  };\n\n  var isFunction = function isFunction(val) {\n    return Object.prototype.toString.call(val) === '[object Function]';\n  };\n\n  var isString = function isString(val) {\n    return Object.prototype.toString.call(val) === '[object String]';\n  };\n\n  var isBoolean = function isBoolean(val) {\n    return Object.prototype.toString.call(val) === '[object Boolean]';\n  };\n\n  var isUndefined = function isUndefined(val) {\n    return val === undefined || Object.prototype.toString.call(val) === '[object Undefined]';\n  };\n\n  var isNull = function isNull(val) {\n    return Object.prototype.toString.call(val) === '[object Null]';\n  };\n\n  var isNumber = function isNumber(val) {\n    return Object.prototype.toString.call(val) === '[object Number]';\n  };\n\n  var isArrayBuffer = function isArrayBuffer(val) {\n    return Object.prototype.toString.call(val) === '[object ArrayBuffer]';\n  };\n\n  var isPromise = function isPromise(val) {\n    var isTrue = false;\n\n    try {\n      isTrue = Object.prototype.toString.call(val) === '[object Promise]' || val && val.then && val[\"catch\"] && val[\"finally\"];\n    } catch (e) {\n      isTrue = false;\n    }\n\n    return isTrue;\n  };\n\n  var getTypeName = function getTypeName(data) {\n    var typeName = Object.prototype.toString.call(data);\n    return typeName.substring(8, typeName.length - 1);\n  };\n\n  var isEqual = function isEqual(source, target) {\n    return source === target;\n  };\n\n  var ArrayBufferToArray = function ArrayBufferToArray(data) {\n    if (isArrayBuffer(data)) {\n      return [].slice.call(new Int8Array(data));\n    }\n\n    return data;\n  };\n\n  var ArrayBufferToUint8Array = function ArrayBufferToUint8Array(data) {\n    if (isArrayBuffer(data)) {\n      return new Uint8Array(data);\n    }\n\n    return data;\n  };\n\n  var forEach = function forEach(source, event, options) {\n    options = options || {};\n    event = event || noop;\n    var _options = options,\n        isReverse = _options.isReverse;\n\n    var loopObj = function loopObj() {\n      for (var key in source) {\n        event(source[key], key, source);\n      }\n    };\n\n    var loopArr = function loopArr() {\n      if (isReverse) {\n        for (var i = source.length - 1; i >= 0; i--) {\n          event(source[i], i);\n        }\n      } else {\n        for (var j = 0, len = source.length; j < len; j++) {\n          event(source[j], j);\n        }\n      }\n    };\n\n    if (isObject(source)) {\n      loopObj();\n    }\n\n    if (isArray(source) || isString(source)) {\n      loopArr();\n    }\n  };\n\n  var isFalse = function isFalse(val) {\n    return val === false;\n  };\n\n  var isEmpty = function isEmpty(val) {\n    var result = true;\n\n    if (isObject(val)) {\n      forEach(val, function () {\n        result = false;\n      });\n    }\n\n    if (isString(val) || isArray(val)) {\n      result = val.length === 0;\n    }\n\n    if (isNumber(val)) {\n      result = val === 0;\n    }\n\n    return result;\n  };\n\n  var isNumberData = function isNumberData(val) {\n    var isEmptyVal = isEmpty(val);\n    val = Number(val);\n    return isNumber(val) && !isEmptyVal;\n  };\n\n  var getKeys = function getKeys(obj) {\n    var keyList = [];\n    forEach(obj, function (val, key) {\n      keyList.push(key);\n    });\n    return keyList;\n  };\n\n  var getValues = function getValues(obj) {\n    var valList = [];\n    forEach(obj, function (val) {\n      valList.push(val);\n    });\n    return valList;\n  };\n\n  var getTimestamp = function getTimestamp(time) {\n    return new Date(time).getTime();\n  };\n\n  var getCurrentTimestamp = function getCurrentTimestamp() {\n    return new Date().getTime();\n  };\n\n  var formatTime = function formatTime(timestamp, options) {\n    timestamp = timestamp || getCurrentTimestamp();\n    options = options || {};\n    var temp = options.temp;\n    var date = new Date(timestamp),\n        formateds = {};\n    formateds['YY'] = date.getFullYear();\n    formateds['MM'] = date.getMonth() + 1;\n    formateds['DD'] = date.getDate();\n    formateds['hh'] = date.getHours();\n    formateds['mm'] = date.getMinutes();\n    formateds['ss'] = date.getSeconds();\n    forEach(formateds, function (val, key) {\n      formateds[key] = val >= 10 ? val : '0' + val;\n    });\n\n    if (temp) {\n      var formatedText = temp;\n      forEach(formateds, function (val, key) {\n        formatedText = formatedText.replace(key, val);\n      });\n      return formatedText;\n    }\n\n    return formateds.YY + '-' + formateds.MM + '-' + formateds.DD + ' ' + formateds.hh + ':' + formateds.mm + ':' + formateds.ss;\n  };\n\n  var isValidJSON = function isValidJSON(jsonStr) {\n    if (isObject(jsonStr)) {\n      return true;\n    }\n\n    var isValid = false;\n\n    try {\n      var obj = JSON$2.parse(jsonStr);\n      var str = JSON$2.stringify(obj);\n      isValid = str === jsonStr;\n    } catch (e) {\n      isValid = false;\n    }\n\n    return isValid;\n  };\n\n  var isSupportSocket = function isSupportSocket() {\n    var isMini = env.isMini;\n\n    if (isMini) {\n      return true;\n    }\n\n    var Socket = global$8.WebSocket;\n\n    if (isUndefined(Socket)) {\n      return false;\n    }\n\n    var hasWS = false,\n        isIntegrity = false;\n\n    try {\n      hasWS = typeof Socket === 'object' || typeof Socket === 'function';\n      isIntegrity = typeof Socket.OPEN === 'number';\n    } catch (e) {}\n\n    return hasWS && isIntegrity;\n  };\n\n  var indexOf = function indexOf(source, searchVal) {\n    if (source.indexOf) {\n      return source.indexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    });\n    return index;\n  };\n\n  var lastIndexOf = function lastIndexOf(source, searchVal) {\n    if (source.lastIndexOf) {\n      return source.lastIndexOf(searchVal);\n    }\n\n    var index = -1;\n    forEach(source, function (sub, i) {\n      if (searchVal === sub) {\n        index = i;\n        return;\n      }\n    }, {\n      isReverse: true\n    });\n    return index;\n  };\n\n  var isInclude = function isInclude(source, searchVal) {\n    var index = indexOf(source, searchVal);\n    return index !== -1;\n  };\n\n  var substring = function substring(source, start, end) {\n    return source.substring(start, end);\n  };\n\n  var spliceByChild = function spliceByChild(arr, item) {\n    forEach(arr, function (child, index) {\n      if (isEqual(child, item)) {\n        arr.splice(index, 1);\n      }\n    }, {\n      isReverse: true\n    });\n  };\n\n  var parse16To10 = function parse16To10(num) {\n    return parseInt(num, 16);\n  };\n\n  var isPlus = function isPlus(num) {\n    return +num === num;\n  };\n\n  var filter = function filter(source, event) {\n    var newArr = [];\n\n    for (var i = 0, max = source.length; i < max; i++) {\n      var data = source[i];\n\n      if (event(data, i)) {\n        newArr.push(data);\n      }\n    }\n\n    return newArr;\n  };\n\n  var map = function map(source, event) {\n    forEach(source, function (item, index) {\n      source[index] = event(item, index);\n    });\n    return source;\n  };\n\n  var extend = function extend(destination, sources, option) {\n    option = option || {};\n    var _option2 = option,\n        isAllowNull = _option2.isAllowNull;\n    destination = destination || {};\n    sources = sources || {};\n\n    for (var key in sources) {\n      var value = sources[key];\n\n      if (!isUndefined(value) || isAllowNull) {\n        destination[key] = value;\n      }\n    }\n\n    return destination;\n  };\n\n  var extendAllowNull = function extendAllowNull(destination, sources) {\n    return extend(destination, sources, {\n      isAllowNull: true\n    });\n  };\n\n  var extendInShallow = function extendInShallow(destination, sources) {\n    destination = destination || {};\n    sources = sources || {};\n    destination = copy(destination);\n    sources = copy(sources);\n    return extend(destination, sources);\n  };\n\n  var deferred = function deferred(callbacks) {\n    return new Defer(callbacks);\n  };\n\n  var deferTimeout = function deferTimeout(timeout) {\n    return deferred(function (resolve) {\n      var timeouter = setTimeout$1(function () {\n        resolve(timeouter);\n      }, timeout);\n    });\n  };\n\n  var tplEngine = function tplEngine(temp, data, regexp) {\n    var replaceAction = function replaceAction(obj) {\n      return temp.replace(regexp || /{([^}]+)}/g, function (match, name) {\n        if (match.charAt(0) === '\\\\') {\n          return match.slice(1);\n        }\n\n        return obj[name] !== undefined ? obj[name] : '{' + name + '}';\n      });\n    };\n\n    if (!isArray(data)) {\n      data = [data];\n    }\n\n    var ret = [];\n    forEach(data, function (item) {\n      ret.push(replaceAction(item));\n    });\n    return ret.join('');\n  };\n\n  var getRandomNum = function getRandomNum(max, min) {\n    min = min || 0;\n    var range = max - min,\n        random = Math.random();\n    return min + Math.round(random * range);\n  };\n\n  var Timer = function () {\n    function Timer(options) {\n      this._timerId = void 0;\n      this._timerEvent = void 0;\n      this._timerClearEvent = void 0;\n      this.timeout = 0;\n      this.type = TIMER_TYPE.TIMEOUT;\n      this.status = TIMER_STATUS.PENNDING;\n      var self = this;\n      extend(self, options);\n      var type = self.type;\n      var isTimeout = type === TIMER_TYPE.TIMEOUT;\n\n      if (isTimeout) {\n        self._timerEvent = setTimeout$1;\n        self._timerClearEvent = clearTimeout$1;\n      } else {\n        self._timerEvent = setInterval$1;\n        self._timerClearEvent = clearInterval$1;\n      }\n\n      return self;\n    }\n\n    var _proto = Timer.prototype;\n\n    _proto.start = function start(event, options) {\n      options = options || {};\n      var self = this,\n          isTimeout = self.type === TIMER_TYPE.TIMEOUT;\n      var _options2 = options,\n          args = _options2.args,\n          thisArg = _options2.thisArg;\n      self.stop();\n      self._timerId = self._timerEvent.call(global$8, function () {\n        isTimeout && self.stop();\n\n        if (thisArg) {\n          event.apply(thisArg, args);\n        } else {\n          event(args);\n        }\n      }, self.timeout);\n      self.status = TIMER_STATUS.BUSY;\n    };\n\n    _proto.stop = function stop() {\n      var self = this;\n\n      if (self._timerId) {\n        self._timerClearEvent.call(global$8, self._timerId);\n\n        self.status = TIMER_STATUS.ENDING;\n      }\n    };\n\n    return Timer;\n  }();\n\n  var DeferHandler = function () {\n    function DeferHandler(options) {\n      this._list = {};\n      this.timeout = IM_TIMEOUT;\n      extend(this, options);\n    }\n\n    var _proto2 = DeferHandler.prototype;\n\n    _proto2._isInvalid = function _isInvalid(id) {\n      var handlers = this._list[id];\n      return !isArray(handlers) || isEmpty(handlers);\n    };\n\n    _proto2._exec = function _exec(id, isError, data) {\n      var self = this;\n\n      if (self._isInvalid(id)) {\n        return;\n      }\n\n      var handlers = self._list[id],\n          handler = handlers[0];\n      isError ? handler.reject(data) : handler.resolve(data);\n      handlers.splice(0, 1);\n    };\n\n    _proto2.add = function add(id, defer, options) {\n      options = options || {};\n      var self = this;\n      var resolve = defer.resolve,\n          reject = defer.reject;\n      var timeout = options.timeout || self.timeout;\n\n      if (self._isInvalid(id)) {\n        self._list[id] = [];\n      }\n\n      var timer = new Timer({\n        timeout: timeout\n      });\n      timer.start(function () {\n        self.reject(id, ERROR_INFO.TIMEOUT.code);\n      });\n\n      self._list[id].push({\n        resolve: resolve,\n        reject: reject,\n        timer: timer\n      });\n    };\n\n    _proto2.resolve = function resolve(id, data) {\n      this._exec(id, false, data);\n    };\n\n    _proto2.reject = function reject(id, error) {\n      this._exec(id, true, error);\n    };\n\n    return DeferHandler;\n  }();\n\n  var EventEmitter = function () {\n    function EventEmitter() {\n      this._events = void 0;\n      this._events = {};\n    }\n\n    var _proto3 = EventEmitter.prototype;\n\n    _proto3.on = function on(name, event) {\n      var _events = this._events[name] || [];\n\n      _events.push(event);\n\n      this._events[name] = _events;\n    };\n\n    _proto3.off = function off(name, offEvent) {\n      if (offEvent) {\n        var _events = this._events[name] || [];\n\n        spliceByChild(_events, offEvent);\n      } else {\n        delete this._events[name];\n      }\n    };\n\n    _proto3.emit = function emit(name, data, error) {\n      var _events = this._events[name];\n      forEach(_events, function (event) {\n        isFunction(event) && event(data, error);\n      });\n    };\n\n    _proto3.clear = function clear() {\n      this._events = {};\n    };\n\n    return EventEmitter;\n  }();\n\n  var decodeURI = function decodeURI(uri) {\n    return global$8.decodeURIComponent(uri);\n  };\n\n  var encodeURI = function encodeURI(uri) {\n    return global$8.encodeURIComponent(uri);\n  };\n\n  var int64ToTimestamp = function int64ToTimestamp(obj) {\n    if (!isObject(obj) || obj.low === undefined || obj.high === undefined) {\n      return obj;\n    }\n\n    var low = obj.low;\n\n    if (low < 0) {\n      low += 0xffffffff + 1;\n    }\n\n    low = low.toString(16);\n    var timestamp = parseInt(obj.high.toString(16) + '00000000'.replace(new RegExp('0{' + low.length + '}$'), low), 16);\n    return timestamp;\n  };\n\n  var batchInt64ToTimestamp = function batchInt64ToTimestamp(data) {\n    forEach(data, function (item, key) {\n      if (isObject(item)) {\n        data[key] = int64ToTimestamp(item);\n      }\n    });\n    return data;\n  };\n\n  var Queue = function () {\n    function Queue(defaultConfig) {\n      this._isRunning = false;\n      this._list = [];\n      this._defaultConfig = void 0;\n      this._defaultConfig = defaultConfig;\n    }\n\n    var _proto4 = Queue.prototype;\n\n    _proto4.add = function add(params) {\n      params = params || this._defaultConfig;\n\n      this._list.push(params);\n\n      this.run();\n    };\n\n    _proto4.run = function run() {\n      var self = this;\n      var _isRunning = self._isRunning,\n          _list = self._list;\n      var isFinished = isEmpty(_list);\n\n      if (_isRunning || isFinished) {\n        return;\n      }\n\n      var firstItem = _list.splice(0, 1)[0];\n\n      var event = firstItem.event,\n          args = firstItem.args,\n          thisArg = firstItem.thisArg;\n\n      var next = function next() {\n        self._isRunning = false;\n        self.run();\n      };\n\n      if (!event) {\n        return next();\n      }\n\n      self._isRunning = true;\n      event.apply(thisArg, args).then(next)[\"catch\"](next);\n    };\n\n    return Queue;\n  }();\n\n  var secondsToMilliseconds = function secondsToMilliseconds(seconds) {\n    return seconds * 1000;\n  };\n\n  var request$3 = function request(url, options) {\n    options = options || {};\n    return deferred(function (resolve, reject) {\n      options = extend(options, {\n        url: url,\n        success: function success(responseText, xhr, status) {\n          resolve({\n            responseText: responseText,\n            xhr: xhr,\n            status: status\n          });\n        },\n        fail: function fail(result, xhr, status) {\n          reject({\n            result: result,\n            xhr: xhr,\n            status: status\n          });\n        }\n      });\n      request$2(options);\n    });\n  };\n\n  var requestByUrlList = function requestByUrlList(urlList, options) {\n    if (isEmpty(urlList)) {\n      return Defer.reject();\n    }\n\n    var url = urlList[0];\n    return request$3(url, options).then(function (result) {\n      result = result || {};\n      result.urlList = urlList;\n      return result;\n    })[\"catch\"](function (error) {\n      urlList.splice(0, 1);\n\n      if (isEmpty(urlList)) {\n        return Defer.reject(error);\n      } else {\n        return requestByUrlList(urlList, options);\n      }\n    });\n  };\n\n  var requestForFaster = function requestForFaster(urlList, option) {\n    option = option || {};\n    var timeInterval = option.timeInterval || 0;\n    var faildCount = 0,\n        totalCount = urlList.length;\n    var requestXhrs = [];\n    var totalTimer = new Timer({\n      timeout: 15 * 1000\n    });\n    var reqCountdownTimers = [];\n\n    var clearAll = function clearAll() {\n      forEach(reqCountdownTimers, function (timer) {\n        timer.stop();\n      });\n      forEach(requestXhrs, function (xhr) {\n        xhr.abort();\n      });\n      reqCountdownTimers.length = 0;\n      requestXhrs.length = 0;\n    };\n\n    var isAllFaild = function isAllFaild() {\n      return faildCount === totalCount;\n    };\n\n    return deferred(function (resolve, reject) {\n      var _success = function success(url, index) {\n        clearAll();\n        resolve({\n          url: url,\n          index: index\n        });\n      };\n\n      var _fail = function fail() {\n        clearAll();\n        reject();\n      };\n\n      forEach(urlList, function (url, index) {\n        var timer = new Timer({\n          timeout: timeInterval * index\n        });\n        timer.start(function () {\n          var xhr;\n          var opt = extend({\n            url: url,\n            success: function success() {\n              _success(url, index);\n            },\n            fail: function fail() {\n              faildCount++;\n              isAllFaild() && _fail();\n            }\n          }, option);\n          xhr = request$2(opt);\n          requestXhrs.push(xhr);\n        });\n        reqCountdownTimers.push(timer);\n      });\n      totalTimer.start(_fail);\n    });\n  };\n\n  var NetworkDetecter = function () {\n    function NetworkDetecter(option) {\n      this._option = void 0;\n      this._detectCount = 0;\n      this._timeoutId = void 0;\n      this._option = option;\n    }\n\n    var _proto5 = NetworkDetecter.prototype;\n\n    _proto5._detect = function _detect() {\n      var self = this;\n      var _detectCount = self._detectCount,\n          _option = self._option;\n      var url = _option.url,\n          timeout = _option.intervalTime,\n          max = _option.max;\n      _detectCount++;\n      return request$3(url).then(function () {\n        return;\n      }, function (_ref) {\n        var status = _ref.status;\n\n        if (isEqual(status, 404)) {\n          return;\n        }\n\n        var isAlreadyMax = max && isEqual(max, _detectCount);\n\n        if (isAlreadyMax) {\n          return Defer.reject();\n        }\n\n        return deferTimeout(timeout).then(function (timeoutId) {\n          self._detectCount = _detectCount;\n          self._timeoutId = timeoutId;\n          return self._detect();\n        });\n      });\n    };\n\n    _proto5.start = function start() {\n      return this._detect();\n    };\n\n    _proto5.stop = function stop() {\n      var timeoutId = this._timeoutId;\n\n      if (timeoutId) {\n        clearTimeout$1(timeoutId);\n      }\n    };\n\n    return NetworkDetecter;\n  }();\n\n  var toUpperCase = function toUpperCase(str, startIndex, endIndex) {\n    if (isUndefined(startIndex) || isUndefined(endIndex)) {\n      return str.toUpperCase();\n    }\n\n    var sliceStr = str.slice(startIndex, endIndex);\n    str = str.replace(sliceStr, function (text) {\n      return text.toUpperCase();\n    });\n    return str;\n  };\n\n  var getDomainByUrl = function getDomainByUrl(url) {\n    var StartMark = '://',\n        EndMark = '/';\n    var urlProtocolIndex = indexOf(url, StartMark);\n    var hasProtocol = urlProtocolIndex > -1;\n\n    if (hasProtocol) {\n      urlProtocolIndex = urlProtocolIndex + StartMark.length;\n      url = substring(url, urlProtocolIndex, url.length);\n    }\n\n    var urlPathIndex = indexOf(url, EndMark);\n    var hasPath = urlPathIndex > -1;\n\n    if (hasPath) {\n      url = substring(url, 0, urlPathIndex);\n    }\n\n    return url;\n  };\n\n  var getValidUrl = function getValidUrl(url, option) {\n    option = option || {};\n    var ProtocolMark = '://';\n    var hasProtocol = isInclude(url, ProtocolMark);\n    var localProtocol = env.protocol.http;\n    var _option3 = option,\n        protocol = _option3.protocol;\n\n    if (protocol) {\n      var domain = getDomainByUrl(url);\n      url = protocol + \"//\" + domain;\n    }\n\n    if (hasProtocol) {\n      var urlProtocolIndex = indexOf(url, ProtocolMark) + 1;\n      var urlProtocol = substring(url, 0, urlProtocolIndex);\n      var isHttpUrl = urlProtocol === HTTP_PROTOCOL.HTTP;\n      var isLocalHttps = localProtocol === HTTP_PROTOCOL.HTTPS;\n\n      if (isHttpUrl && isLocalHttps) {\n        var _domain = getDomainByUrl(url);\n\n        return HTTP_PROTOCOL.HTTPS + \"//\" + _domain;\n      } else {\n        return url;\n      }\n    } else {\n      return localProtocol + \"//\" + url;\n    }\n  };\n\n  var quickSort = function quickSort(arr, event) {\n    var sort = function sort(array, left, right, event) {\n      event = event || function (a, b) {\n        return a <= b;\n      };\n\n      if (left < right) {\n        var x = array[right],\n            i = left - 1,\n            temp;\n\n        for (var j = left; j <= right; j++) {\n          if (event(array[j], x)) {\n            i++;\n            temp = array[i];\n            array[i] = array[j];\n            array[j] = temp;\n          }\n        }\n\n        sort(array, left, i - 1, event);\n        sort(array, i + 1, right, event);\n      }\n\n      return array;\n    };\n\n    return sort(arr, 0, arr.length - 1, event);\n  };\n\n  var unique = function unique(arr, event) {\n    var keyEvent = event || function (data) {\n      return data;\n    };\n\n    var hashTable = {};\n    var newArr = [];\n    forEach(arr, function (data) {\n      var key = keyEvent(data);\n\n      if (!hashTable[key]) {\n        hashTable[key] = true;\n        newArr.push(data);\n      }\n    });\n    return newArr;\n  };\n\n  var isStackError = function isStackError(error) {\n    error = error || {};\n    return error.stack && error.stack.toString;\n  };\n\n  var consoleError = function consoleError() {\n    var _console;\n\n    return (_console = console).error.apply(_console, arguments);\n  };\n\n  var consoleLog = function consoleLog() {\n    var _console2;\n\n    return (_console2 = console).log.apply(_console2, arguments);\n  };\n\n  var string10to64 = function string10to64(number) {\n    var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0'.split(''),\n        radix = chars.length + 1,\n        qutient = +number,\n        arr = [];\n\n    do {\n      var mod = qutient % radix;\n      qutient = (qutient - mod) / radix;\n      arr.unshift(chars[mod]);\n    } while (qutient);\n\n    return arr.join('');\n  };\n\n  var getUUID = function getUUID() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      var r = Math.random() * 16 | 0,\n          v = c === 'x' ? r : r & 0x3 | 0x8;\n      return v.toString(16);\n    });\n  };\n\n  var getUUID22 = function getUUID22() {\n    var uuid = getUUID();\n    uuid = uuid.replace(/-/g, '') + 'a';\n    uuid = parseInt(uuid, 16);\n    uuid = string10to64(uuid);\n\n    if (uuid.length > 22) {\n      uuid = uuid.slice(0, 22);\n    } else {\n      var len = 22 - uuid.length;\n\n      for (var i = 0; i < len; i++) {\n        uuid = uuid + '0';\n      }\n    }\n\n    return uuid;\n  };\n\n  var isValidTimestamp = function isValidTimestamp(time) {\n    return isNumber(time) && time !== 0;\n  };\n\n  var formateDate = function formateDate(seperator) {\n    var date = new Date();\n    var year = date.getFullYear();\n    var month = date.getMonth() + 1;\n    var day = date.getDate();\n    return tplEngine('{year}{seperator}{month}{seperator}{day}', {\n      year: year,\n      month: month,\n      day: day,\n      seperator: seperator\n    });\n  };\n\n  var utils = {\n    Storage: storage$1,\n    Session: session,\n    Socket: Socket$2,\n    Cache: CacheStorage,\n    JSON: JSON$2,\n    Defer: Defer,\n    httpRequest: request$2,\n    request: request$3,\n    requestByUrlList: requestByUrlList,\n    requestForFaster: requestForFaster,\n    md5: md5,\n    DeferHandler: DeferHandler,\n    EventEmitter: EventEmitter,\n    Timer: Timer,\n    Queue: Queue,\n    consoleError: consoleError,\n    consoleLog: consoleLog,\n    noop: noop,\n    deferNoop: deferNoop,\n    setTimeout: setTimeout$1,\n    toJSON: toJSON,\n    parseJSON: parseJSON,\n    copy: copy,\n    isObject: isObject,\n    isArray: isArray,\n    isFunction: isFunction,\n    isArrayBuffer: isArrayBuffer,\n    isString: isString,\n    isBoolean: isBoolean,\n    isUndefined: isUndefined,\n    isNull: isNull,\n    isNumber: isNumber,\n    isNumberData: isNumberData,\n    isPromise: isPromise,\n    getTypeName: getTypeName,\n    isPlus: isPlus,\n    isEmpty: isEmpty,\n    isFalse: isFalse,\n    isEqual: isEqual,\n    isValidJSON: isValidJSON,\n    isSupportSocket: isSupportSocket,\n    ArrayBufferToArray: ArrayBufferToArray,\n    ArrayBufferToUint8Array: ArrayBufferToUint8Array,\n    indexOf: indexOf,\n    lastIndexOf: lastIndexOf,\n    isInclude: isInclude,\n    substring: substring,\n    getKeys: getKeys,\n    getValues: getValues,\n    getTimestamp: getTimestamp,\n    getCurrentTimestamp: getCurrentTimestamp,\n    formatTime: formatTime,\n    parse16To10: parse16To10,\n    forEach: forEach,\n    map: map,\n    filter: filter,\n    extend: extend,\n    extendAllowNull: extendAllowNull,\n    extendInShallow: extendInShallow,\n    deferred: deferred,\n    tplEngine: tplEngine,\n    getRandomNum: getRandomNum,\n    int64ToTimestamp: int64ToTimestamp,\n    batchInt64ToTimestamp: batchInt64ToTimestamp,\n    encodeURI: encodeURI,\n    decodeURI: decodeURI,\n    secondsToMilliseconds: secondsToMilliseconds,\n    NetworkDetecter: NetworkDetecter,\n    toUpperCase: toUpperCase,\n    getDomainByUrl: getDomainByUrl,\n    getValidUrl: getValidUrl,\n    quickSort: quickSort,\n    unique: unique,\n    isStackError: isStackError,\n    getUUID: getUUID,\n    getUUID22: getUUID22,\n    isValidTimestamp: isValidTimestamp,\n    formateDate: formateDate\n  };\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__proto__ = superClass;\n  }\n\n  var _PUBLISH_TOPIC_TO_CON, _CONVERSATION_TYPE_TO, _CONVERSATION_TYPE_TO2, _CONVERSATION_TYPE_TO3, _CONVERSATION_TYPE_TO4;\n  var SUCCESS_CODE = 0;\n  var PULL_MSG_TYPE = {\n    NORMAL: 1,\n    CHATROOM: 2\n  };\n  var MESSAGE_NAME = {\n    CONN_ACK: 'ConnAckMessage',\n    DISCONNECT: 'DisconnectMessage',\n    PING_REQ: 'PingReqMessage',\n    PING_RESP: 'PingRespMessage',\n    PUBLISH: 'PublishMessage',\n    PUB_ACK: 'PubAckMessage',\n    QUERY: 'QueryMessage',\n    QUERY_CON: 'QueryConMessage',\n    QUERY_ACK: 'QueryAckMessage'\n  };\n  var QOS = {\n    AT_MOST_ONCE: 0,\n    AT_LEAST_ONCE: 1,\n    EXACTLY_ONCE: 2,\n    DEFAULT: 3,\n    '0': 'AT_MOST_ONCE',\n    '1': 'AT_LEAST_ONCE',\n    '2': 'EXACTLY_ONCE',\n    '3': 'DEFAULT'\n  };\n  var OPERATE_TYPE = {\n    CONNECT: 1,\n    '1': 'CONNECT',\n    CONNACK: 2,\n    '2': 'CONNACK',\n    PUBLISH: 3,\n    '3': 'PUBLISH',\n    PUBACK: 4,\n    '4': 'PUBACK',\n    QUERY: 5,\n    '5': 'QUERY',\n    QUERYACK: 6,\n    '6': 'QUERYACK',\n    QUERYCON: 7,\n    '7': 'QUERYCON',\n    SUBSCRIBE: 8,\n    '8': 'SUBSCRIBE',\n    SUBACK: 9,\n    '9': 'SUBACK',\n    UNSUBSCRIBE: 10,\n    '10': 'UNSUBSCRIBE',\n    UNSUBACK: 11,\n    '11': 'UNSUBACK',\n    PINGREQ: 12,\n    '12': 'PINGREQ',\n    PINGRESP: 13,\n    '13': 'PINGRESP',\n    DISCONNECT: 14,\n    '14': 'DISCONNECT'\n  };\n  var MESSAGE_TAG = {\n    NONE: 0,\n    PERSIT_ONLY: 1,\n    COUNT_ONLY: 2,\n    PERSIT_AND_COUNT: 3\n  };\n  var PUBLISH_TOPIC = {\n    PRIVATE: 'ppMsgP',\n    GROUP: 'pgMsgP',\n    CHATROOM: 'chatMsg',\n    CUSTOMER_SERVICE: 'pcMsgP',\n    RECALL: 'recallMsg',\n    NOTIFY_PULL_MSG: 's_ntf',\n    RECEIVE_MSG: 's_msg',\n    SYNC_STATUS: 's_stat',\n    SERVER_NOTIFY: 's_cmd',\n    SETTING_NOTIFY: 's_us'\n  };\n  var PUBLISH_STATUS_TOPIC = {\n    PRIVATE: 'ppMsgS',\n    GROUP: 'pgMsgS'\n  };\n  var QUERY_TOPIC = {\n    GET_SYNC_TIME: 'qrySessionsAtt',\n    PULL_MSG: 'pullMsg',\n    GET_CONVERSATION_LIST: 'qrySessions',\n    REMOVE_CONVERSATION_LIST: 'delSessions',\n    DELETE_MESSAGES: 'delMsg',\n    CLEAR_UNREAD_COUNT: 'updRRTime',\n    PULL_USER_SETTING: 'pullUS',\n    PULL_CHRM_MSG: 'chrmPull',\n    JOIN_CHATROOM: 'joinChrm',\n    QUIT_CHATROOM: 'exitChrm',\n    GET_CHATROOM_INFO: 'queryChrmI',\n    UPDATE_CHATROOM_KV: 'setKV',\n    DELETE_CHATROOM_KV: 'delKV',\n    PULL_CHATROOM_KV: 'pullKV',\n    GET_OLD_CONVERSATION_LIST: 'qryRelation',\n    REMOVE_OLD_CONVERSATION: 'delRelation',\n    GET_CONVERSATION_STATUS: 'pullSeAtts',\n    SET_CONVERSATION_STATUS: 'setSeAtt',\n    GET_UPLOAD_FILE_TOKEN: 'qnTkn',\n    GET_UPLOAD_FILE_URL: 'qnUrl',\n    CLEAR_MESSAGES: {\n      PRIVATE: 'cleanPMsg',\n      GROUP: 'cleanGMsg',\n      CUSTOMER_SERVICE: 'cleanCMsg',\n      SYSTEM: 'cleanSMsg'\n    },\n    JOIN_RTC_ROOM: 'rtcRJoin_data',\n    QUIT_RTC_ROOM: 'rtcRExit',\n    PING_RTC: 'rtcPing',\n    SET_RTC_DATA: 'rtcSetData',\n    GET_RTC_DATA: 'rtcQryData',\n    DEL_RTC_DATA: 'rtcDelData',\n    SET_RTC_OUT_DATA: 'rtcSetOutData',\n    GET_RTC_OUT_DATA: 'rtcQryUserOutData',\n    GET_RTC_TOKEN: 'rtcToken',\n    SET_RTC_STATE: 'rtcUserState',\n    GET_RTC_ROOM_INFO: 'rtcRInfo',\n    GET_RTC_USER_INFO_LIST: 'rtcUData',\n    SET_RTC_USER_INFO: 'rtcUPut',\n    DEL_RTC_USER_INFO: 'rtcUDel',\n    GET_RTC_USER_LIST: 'rtcUList'\n  };\n  var QUERY_HISTORY_TOPIC = {\n    PRIVATE: 'qryPMsg',\n    GROUP: 'qryGMsg',\n    CHATROOM: 'qryCHMsg',\n    CUSTOMER_SERVICE: 'qryCMsg',\n    SYSTEM: 'qrySMsg'\n  };\n  var SERVER_NOTIFY_TYPE = {\n    KV_CHANGED: 2,\n    CONVERSATION_STATUS_CHANGED: 3\n  };\n  var CHATROOM_KV_STATUS_CODE = {\n    AUTO_DELETE: 0x0001,\n    OVERWRITE: 0x0002,\n    OPERATE: 0x0004\n  };\n  var PUBLISH_TOPIC_TO_CONVERSATION_TYPE = (_PUBLISH_TOPIC_TO_CON = {}, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.PRIVATE] = CONVERSATION_TYPE.PRIVATE, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.GROUP] = CONVERSATION_TYPE.GROUP, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CHATROOM] = CONVERSATION_TYPE.CHATROOM, _PUBLISH_TOPIC_TO_CON[PUBLISH_TOPIC.CUSTOMER_SERVICE] = CONVERSATION_TYPE.CUSTOMER_SERVICE, _PUBLISH_TOPIC_TO_CON);\n  var CONVERSATION_TYPE_TO_PUBLISH_TOPIC = (_CONVERSATION_TYPE_TO = {}, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.PRIVATE] = PUBLISH_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.GROUP] = PUBLISH_TOPIC.GROUP, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CHATROOM] = PUBLISH_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO[CONVERSATION_TYPE.CUSTOMER_SERVICE] = PUBLISH_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO);\n  var CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC = (_CONVERSATION_TYPE_TO2 = {}, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.PRIVATE] = PUBLISH_STATUS_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO2[CONVERSATION_TYPE.GROUP] = PUBLISH_STATUS_TOPIC.GROUP, _CONVERSATION_TYPE_TO2);\n  var CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC = (_CONVERSATION_TYPE_TO3 = {}, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.PRIVATE] = QUERY_HISTORY_TOPIC.PRIVATE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.GROUP] = QUERY_HISTORY_TOPIC.GROUP, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CHATROOM] = QUERY_HISTORY_TOPIC.CHATROOM, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_HISTORY_TOPIC.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO3[CONVERSATION_TYPE.SYSTEM] = QUERY_HISTORY_TOPIC.SYSTEM, _CONVERSATION_TYPE_TO3);\n  var CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC = (_CONVERSATION_TYPE_TO4 = {}, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.PRIVATE] = QUERY_TOPIC.CLEAR_MESSAGES.PRIVATE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.GROUP] = QUERY_TOPIC.CLEAR_MESSAGES.GROUP, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.CUSTOMER_SERVICE] = QUERY_TOPIC.CLEAR_MESSAGES.CUSTOMER_SERVICE, _CONVERSATION_TYPE_TO4[CONVERSATION_TYPE.SYSTEM] = QUERY_TOPIC.CLEAR_MESSAGES.SYSTEM, _CONVERSATION_TYPE_TO4);\n  var USER_SETTING_STATUS = {\n    ADD: 1,\n    UPDATE: 2,\n    DELETE: 3\n  };\n  var CONVERSATION_STATUS_CONFIG = {\n    ENABLED: '1',\n    DISABLED: '0'\n  };\n  var CONVERSATION_STATUS_TYPE = {\n    DO_NOT_DISTURB: 1,\n    TOP: 2\n  };\n\n  var Header = function () {\n    function Header(_type, _retain, _qos, _dup) {\n      this.type = void 0;\n      this.retain = false;\n      this.qos = QOS.AT_LEAST_ONCE;\n      this.dup = false;\n      this.syncMsg = false;\n      var isPlusType = utils.isPlus(_type);\n\n      if (_type && isPlusType && arguments.length === 1) {\n        this.retain = (_type & 1) > 0;\n        this.qos = (_type & 6) >> 1;\n        this.dup = (_type & 8) > 0;\n        this.type = _type >> 4 & 15;\n        this.syncMsg = (_type & 8) === 8;\n      } else {\n        this.type = _type;\n        this.retain = _retain === undefined ? false : _retain;\n        this.qos = _qos === undefined ? QOS.AT_LEAST_ONCE : _qos;\n        this.dup = _dup === undefined ? false : _dup;\n      }\n    }\n\n    var _proto = Header.prototype;\n\n    _proto.encode = function encode() {\n      var self = this;\n      var validQosList = [QOS.AT_MOST_ONCE, QOS.AT_LEAST_ONCE, QOS.EXACTLY_ONCE, QOS.DEFAULT];\n      utils.forEach(validQosList, function (qos) {\n        if (self.qos === QOS[qos]) {\n          self.qos = qos;\n        }\n      });\n\n      var _byte = self.type << 4;\n\n      _byte |= self.retain ? 1 : 0;\n      _byte |= self.qos << 1;\n      _byte |= self.dup ? 8 : 0;\n      return _byte;\n    };\n\n    return Header;\n  }();\n\n  var BinaryHelper = {\n    writeUTF: function writeUTF(str, isGetBytes) {\n      var back = [],\n          byteSize = 0;\n      utils.forEach(str, function (_char, i) {\n        var code = str.charCodeAt(i);\n\n        if (code >= 0 && code <= 127) {\n          byteSize += 1;\n          back.push(code);\n        } else if (code >= 128 && code <= 2047) {\n          byteSize += 2;\n          back.push(192 | 31 & code >> 6);\n          back.push(128 | 63 & code);\n        } else if (code >= 2048 && code <= 65535) {\n          byteSize += 3;\n          back.push(224 | 15 & code >> 12);\n          back.push(128 | 63 & code >> 6);\n          back.push(128 | 63 & code);\n        }\n      });\n      utils.forEach(back, function (_char2, i) {\n        if (_char2 > 255) {\n          back[i] &= 255;\n        }\n      });\n\n      if (isGetBytes) {\n        return back;\n      }\n\n      if (byteSize <= 255) {\n        return [0, byteSize].concat(back);\n      } else {\n        return [byteSize >> 8, byteSize & 255].concat(back);\n      }\n    },\n    readUTF: function readUTF(arr) {\n      var UTF = '';\n\n      for (var i = 0, len = arr.length; i < len; i++) {\n        var _char3 = arr[i];\n\n        if (_char3 < 0) {\n          arr[i] += 256;\n        }\n\n        var one = arr[i].toString(2),\n            v = one.match(/^1+?(?=0)/);\n\n        if (v && one.length === 8) {\n          var bytesLength = v[0].length,\n              store = '';\n\n          for (var st = 0; st < bytesLength; st++) {\n            store += arr[st + i].toString(2).slice(2);\n          }\n\n          UTF += String.fromCharCode(parseInt(store, 2));\n          i += bytesLength - 1;\n        } else {\n          UTF += String.fromCharCode(arr[i]);\n        }\n      }\n\n      return UTF;\n    }\n  };\n\n  var RongStreamReader = function () {\n    function RongStreamReader(arr) {\n      this.pool = void 0;\n      this.position = 0;\n      this.poolLen = 0;\n      this.pool = arr;\n      this.poolLen = arr.length;\n    }\n\n    var _proto2 = RongStreamReader.prototype;\n\n    _proto2.check = function check() {\n      return this.position >= this.pool.length;\n    };\n\n    _proto2.readInt = function readInt() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 4; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t.toString();\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readLong = function readLong() {\n      var self = this;\n\n      if (self.check()) {\n        return -1;\n      }\n\n      var end = '';\n\n      for (var i = 0; i < 8; i++) {\n        var t = self.pool[self.position++].toString(16);\n\n        if (t.length === 1) {\n          t = '0' + t;\n        }\n\n        end += t;\n      }\n\n      return utils.parse16To10(end);\n    };\n\n    _proto2.readByte = function readByte() {\n      if (this.check()) {\n        return -1;\n      }\n\n      var val = this.pool[this.position++];\n\n      if (val > 255) {\n        val &= 255;\n      }\n\n      return val;\n    };\n\n    _proto2.readUTF = function readUTF() {\n      if (this.check()) {\n        return '';\n      }\n\n      var big = this.readByte() << 8 | this.readByte();\n      var pool = this.pool.subarray(this.position, this.position += big);\n      return BinaryHelper.readUTF(pool);\n    };\n\n    _proto2.readAll = function readAll() {\n      return this.pool.subarray(this.position, this.poolLen);\n    };\n\n    return RongStreamReader;\n  }();\n\n  var RongStreamWriter = function () {\n    function RongStreamWriter() {\n      this.pool = [];\n      this.position = 0;\n      this.writen = 0;\n    }\n\n    var _proto3 = RongStreamWriter.prototype;\n\n    _proto3.write = function write(_byte2) {\n      if (utils.isArray(_byte2)) {\n        this.pool = this.pool.concat(_byte2);\n      } else if (utils.isPlus(_byte2)) {\n        if (_byte2 > 255) {\n          _byte2 &= 255;\n        }\n\n        this.pool.push(_byte2);\n        this.writen++;\n      }\n\n      return _byte2;\n    };\n\n    _proto3.writeArr = function writeArr(_byte3) {\n      this.pool = this.pool.concat(_byte3);\n      return _byte3;\n    };\n\n    _proto3.writeUTF = function writeUTF(str) {\n      var val = BinaryHelper.writeUTF(str);\n      this.pool = this.pool.concat(val);\n      this.writen += val.length;\n    };\n\n    _proto3.getBytesArray = function getBytesArray() {\n      return this.pool;\n    };\n\n    return RongStreamWriter;\n  }();\n\n  var IDENTIFIER = {\n    PUB: 'pub',\n    QUERY: 'qry'\n  };\n\n  var _getIdentifier = function getIdentifier(messageId, identifier) {\n    if (messageId && identifier) {\n      return identifier + '_' + messageId;\n    } else if (messageId) {\n      return messageId;\n    } else {\n      return utils.getCurrentTimestamp();\n    }\n  };\n\n  var BaseReader = function () {\n    function BaseReader(header) {\n      this._name = void 0;\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.messageId = void 0;\n      this.timestamp = void 0;\n      this.identifier = void 0;\n      this._header = header;\n    }\n\n    var _proto = BaseReader.prototype;\n\n    _proto.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto.read = function read(stream, length) {\n      this.readMessage(stream, length);\n    };\n\n    _proto.readMessage = function readMessage(stream, length) {\n      return {\n        stream: stream,\n        length: length\n      };\n    };\n\n    return BaseReader;\n  }();\n\n  var BaseWriter = function () {\n    function BaseWriter(headerType) {\n      this._header = void 0;\n      this.lengthSize = 0;\n      this.data = void 0;\n      this.messageId = void 0;\n      this.topic = void 0;\n      this.targetId = void 0;\n      this.identifier = void 0;\n      this._header = new Header(headerType, false, QOS.AT_MOST_ONCE, false);\n    }\n\n    var _proto2 = BaseWriter.prototype;\n\n    _proto2.getIdentifier = function getIdentifier() {\n      var messageId = this.messageId,\n          identifier = this.identifier;\n      return _getIdentifier(messageId, identifier);\n    };\n\n    _proto2.write = function write(stream) {\n      var headerCode = this.getHeaderFlag();\n      stream.write(headerCode);\n      this.writeMessage(stream);\n    };\n\n    _proto2.writeMessage = function writeMessage(stream) {\n      return stream;\n    };\n\n    _proto2.setHeaderQos = function setHeaderQos(qos) {\n      this._header.qos = qos;\n    };\n\n    _proto2.getHeaderFlag = function getHeaderFlag() {\n      return this._header.encode();\n    };\n\n    _proto2.getLengthSize = function getLengthSize() {\n      return this.lengthSize;\n    };\n\n    _proto2.getBufferData = function getBufferData() {\n      var stream = new RongStreamWriter();\n      this.write(stream);\n      var val = stream.getBytesArray();\n      var binary = new Int8Array(val);\n      return binary;\n    };\n\n    _proto2.getCometData = function getCometData() {\n      var data = this.data || {};\n      return utils.toJSON(data);\n    };\n\n    return BaseWriter;\n  }();\n\n  var ConnAckReader = function (_BaseReader) {\n    _inheritsLoose(ConnAckReader, _BaseReader);\n\n    function ConnAckReader() {\n      var _this;\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this = _BaseReader.call.apply(_BaseReader, [this].concat(args)) || this;\n      _this._name = MESSAGE_NAME.CONN_ACK;\n      _this.status = void 0;\n      _this.userId = void 0;\n      _this.timestamp = void 0;\n      return _this;\n    }\n\n    var _proto3 = ConnAckReader.prototype;\n\n    _proto3.readMessage = function readMessage(stream, msgLength) {\n      stream.readByte();\n      this.status = +stream.readByte();\n\n      if (msgLength > ConnAckReader.MESSAGE_LENGTH) {\n        this.userId = stream.readUTF();\n        stream.readUTF();\n        this.timestamp = stream.readLong();\n      }\n    };\n\n    return ConnAckReader;\n  }(BaseReader);\n\n  ConnAckReader.MESSAGE_LENGTH = 2;\n\n  var DisconnectReader = function (_BaseReader2) {\n    _inheritsLoose(DisconnectReader, _BaseReader2);\n\n    function DisconnectReader() {\n      var _this2;\n\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      _this2 = _BaseReader2.call.apply(_BaseReader2, [this].concat(args)) || this;\n      _this2._name = MESSAGE_NAME.DISCONNECT;\n      _this2.status = void 0;\n      return _this2;\n    }\n\n    var _proto4 = DisconnectReader.prototype;\n\n    _proto4.readMessage = function readMessage(stream) {\n      stream.readByte();\n      this.status = +stream.readByte();\n    };\n\n    return DisconnectReader;\n  }(BaseReader);\n\n  DisconnectReader.MESSAGE_LENGTH = 2;\n\n  var PingReqWriter = function (_BaseWriter) {\n    _inheritsLoose(PingReqWriter, _BaseWriter);\n\n    function PingReqWriter() {\n      var _this3;\n\n      _this3 = _BaseWriter.call(this, OPERATE_TYPE.PINGREQ) || this;\n      _this3._name = MESSAGE_NAME.PING_REQ;\n      return _this3;\n    }\n\n    return PingReqWriter;\n  }(BaseWriter);\n\n  var PingRespReader = function (_BaseReader3) {\n    _inheritsLoose(PingRespReader, _BaseReader3);\n\n    function PingRespReader() {\n      var _this4;\n\n      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n        args[_key3] = arguments[_key3];\n      }\n\n      _this4 = _BaseReader3.call.apply(_BaseReader3, [this].concat(args)) || this;\n      _this4._name = MESSAGE_NAME.PING_RESP;\n      return _this4;\n    }\n\n    return PingRespReader;\n  }(BaseReader);\n\n  var RetryableReader = function (_BaseReader4) {\n    _inheritsLoose(RetryableReader, _BaseReader4);\n\n    function RetryableReader() {\n      var _this5;\n\n      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n        args[_key4] = arguments[_key4];\n      }\n\n      _this5 = _BaseReader4.call.apply(_BaseReader4, [this].concat(args)) || this;\n      _this5.messageId = void 0;\n      return _this5;\n    }\n\n    var _proto5 = RetryableReader.prototype;\n\n    _proto5.readMessage = function readMessage(stream) {\n      var msgId = stream.readByte() * 256 + stream.readByte();\n      this.messageId = parseInt(msgId, 10);\n    };\n\n    return RetryableReader;\n  }(BaseReader);\n\n  var RetryableWriter = function (_BaseWriter2) {\n    _inheritsLoose(RetryableWriter, _BaseWriter2);\n\n    function RetryableWriter() {\n      var _this6;\n\n      for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n        args[_key5] = arguments[_key5];\n      }\n\n      _this6 = _BaseWriter2.call.apply(_BaseWriter2, [this].concat(args)) || this;\n      _this6.messageId = void 0;\n      return _this6;\n    }\n\n    var _proto6 = RetryableWriter.prototype;\n\n    _proto6.writeMessage = function writeMessage(stream) {\n      var id = this.messageId;\n      var lsb = id & 255;\n      var msb = (id & 65280) >> 8;\n      stream.write(msb);\n      stream.write(lsb);\n    };\n\n    return RetryableWriter;\n  }(BaseWriter);\n\n  var PublishReader = function (_RetryableReader) {\n    _inheritsLoose(PublishReader, _RetryableReader);\n\n    function PublishReader() {\n      var _this7;\n\n      for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n        args[_key6] = arguments[_key6];\n      }\n\n      _this7 = _RetryableReader.call.apply(_RetryableReader, [this].concat(args)) || this;\n      _this7._name = MESSAGE_NAME.PUBLISH;\n      _this7.topic = void 0;\n      _this7.data = void 0;\n      _this7.targetId = void 0;\n      _this7.date = void 0;\n      _this7.syncMsg = false;\n      _this7.identifier = IDENTIFIER.PUB;\n      return _this7;\n    }\n\n    var _proto7 = PublishReader.prototype;\n\n    _proto7.readMessage = function readMessage(stream) {\n      this.date = stream.readInt();\n      this.topic = stream.readUTF();\n      this.targetId = stream.readUTF();\n      RetryableReader.prototype.readMessage.apply(this, arguments);\n      this.data = stream.readAll();\n    };\n\n    return PublishReader;\n  }(RetryableReader);\n\n  var PublishWriter = function (_RetryableWriter) {\n    _inheritsLoose(PublishWriter, _RetryableWriter);\n\n    function PublishWriter(topic, data, targetId) {\n      var _this8;\n\n      _this8 = _RetryableWriter.call(this, OPERATE_TYPE.PUBLISH) || this;\n      _this8._name = MESSAGE_NAME.PUBLISH;\n      _this8.topic = void 0;\n      _this8.data = void 0;\n      _this8.targetId = void 0;\n      _this8.date = void 0;\n      _this8.syncMsg = false;\n      _this8.identifier = IDENTIFIER.PUB;\n      _this8.topic = topic;\n      _this8.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this8.targetId = targetId;\n      return _this8;\n    }\n\n    var _proto8 = PublishWriter.prototype;\n\n    _proto8.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.apply(this, arguments);\n      stream.write(this.data);\n    };\n\n    return PublishWriter;\n  }(RetryableWriter);\n\n  var PubAckReader = function (_RetryableReader2) {\n    _inheritsLoose(PubAckReader, _RetryableReader2);\n\n    function PubAckReader() {\n      var _this9;\n\n      for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n        args[_key7] = arguments[_key7];\n      }\n\n      _this9 = _RetryableReader2.call.apply(_RetryableReader2, [this].concat(args)) || this;\n      _this9._name = MESSAGE_NAME.PUB_ACK;\n      _this9.status = void 0;\n      _this9.date = 0;\n      _this9.data = void 0;\n      _this9.millisecond = 0;\n      _this9.messageUId = void 0;\n      _this9.timestamp = 0;\n      _this9.identifier = IDENTIFIER.PUB;\n      return _this9;\n    }\n\n    var _proto9 = PubAckReader.prototype;\n\n    _proto9.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.millisecond = stream.readByte() * 256 + stream.readByte();\n      this.timestamp = this.date * 1000 + this.millisecond;\n      this.messageUId = stream.readUTF();\n    };\n\n    return PubAckReader;\n  }(RetryableReader);\n\n  var PubAckWriter = function (_RetryableWriter2) {\n    _inheritsLoose(PubAckWriter, _RetryableWriter2);\n\n    function PubAckWriter(messageId) {\n      var _this10;\n\n      _this10 = _RetryableWriter2.call(this, OPERATE_TYPE.PUBACK) || this;\n      _this10._name = MESSAGE_NAME.PUB_ACK;\n      _this10.status = void 0;\n      _this10.date = 0;\n      _this10.millisecond = 0;\n      _this10.messageUId = void 0;\n      _this10.timestamp = 0;\n      _this10.messageId = messageId;\n      return _this10;\n    }\n\n    var _proto10 = PubAckWriter.prototype;\n\n    _proto10.writeMessage = function writeMessage(stream) {\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n    };\n\n    return PubAckWriter;\n  }(RetryableWriter);\n\n  var QueryWriter = function (_RetryableWriter3) {\n    _inheritsLoose(QueryWriter, _RetryableWriter3);\n\n    function QueryWriter(topic, data, targetId) {\n      var _this11;\n\n      _this11 = _RetryableWriter3.call(this, OPERATE_TYPE.QUERY) || this;\n      _this11._name = MESSAGE_NAME.QUERY;\n      _this11.topic = void 0;\n      _this11.data = void 0;\n      _this11.targetId = void 0;\n      _this11.identifier = IDENTIFIER.QUERY;\n      _this11.topic = topic;\n      _this11.data = utils.isString(data) ? BinaryHelper.writeUTF(data) : data;\n      _this11.targetId = targetId;\n      return _this11;\n    }\n\n    var _proto11 = QueryWriter.prototype;\n\n    _proto11.writeMessage = function writeMessage(stream) {\n      stream.writeUTF(this.topic);\n      stream.writeUTF(this.targetId);\n      RetryableWriter.prototype.writeMessage.call(this, stream);\n      stream.write(this.data);\n    };\n\n    return QueryWriter;\n  }(RetryableWriter);\n\n  var QueryConWriter = function (_RetryableWriter4) {\n    _inheritsLoose(QueryConWriter, _RetryableWriter4);\n\n    function QueryConWriter(messageId) {\n      var _this12;\n\n      _this12 = _RetryableWriter4.call(this, OPERATE_TYPE.QUERYCON) || this;\n      _this12._name = MESSAGE_NAME.QUERY_CON;\n      _this12.messageId = messageId;\n      return _this12;\n    }\n\n    return QueryConWriter;\n  }(RetryableWriter);\n\n  var QueryAckReader = function (_RetryableReader3) {\n    _inheritsLoose(QueryAckReader, _RetryableReader3);\n\n    function QueryAckReader() {\n      var _this13;\n\n      for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n        args[_key8] = arguments[_key8];\n      }\n\n      _this13 = _RetryableReader3.call.apply(_RetryableReader3, [this].concat(args)) || this;\n      _this13._name = MESSAGE_NAME.QUERY_ACK;\n      _this13.data = void 0;\n      _this13.status = void 0;\n      _this13.date = void 0;\n      _this13.identifier = IDENTIFIER.QUERY;\n      return _this13;\n    }\n\n    var _proto12 = QueryAckReader.prototype;\n\n    _proto12.readMessage = function readMessage(stream) {\n      RetryableReader.prototype.readMessage.call(this, stream);\n      this.date = stream.readInt();\n      this.status = stream.readByte() * 256 + stream.readByte();\n      this.data = stream.readAll();\n    };\n\n    return QueryAckReader;\n  }(RetryableReader);\n\n  var getReaderByHeader = function getReaderByHeader(header) {\n    var type = header.type,\n        msg = new BaseReader(header);\n\n    switch (type) {\n      case OPERATE_TYPE.CONNACK:\n        msg = new ConnAckReader(header);\n        break;\n\n      case OPERATE_TYPE.PUBLISH:\n        msg = new PublishReader(header);\n        msg.syncMsg = header.syncMsg;\n        break;\n\n      case OPERATE_TYPE.PUBACK:\n        msg = new PubAckReader(header);\n        break;\n\n      case OPERATE_TYPE.QUERYACK:\n        msg = new QueryAckReader(header);\n        break;\n\n      case OPERATE_TYPE.SUBACK:\n      case OPERATE_TYPE.UNSUBACK:\n      case OPERATE_TYPE.PINGRESP:\n        msg = new PingRespReader(header);\n        break;\n\n      case OPERATE_TYPE.DISCONNECT:\n        msg = new DisconnectReader(header);\n        break;\n\n      default:\n        throw new Error('No support for deserializing ' + type + ' messages');\n    }\n\n    return msg;\n  };\n\n  var readWSBuffer = function readWSBuffer(data) {\n    var arr = new Uint8Array(data);\n    var stream = new RongStreamReader(arr);\n    var flags = stream.readByte(),\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    msg.read(stream, arr.length - 1);\n    return msg;\n  };\n\n  var readCometData = function readCometData(data) {\n    var flags = data.headerCode,\n        header = new Header(flags);\n    var msg = getReaderByHeader(header);\n    utils.forEach(data, function (item, key) {\n      if (key in msg) {\n        msg[key] = item;\n      }\n    });\n    return msg;\n  };\n\n  var ENGINE_EVENT = {\n    WATCH: 'watch',\n    UN_WATCH: 'unwatch',\n    CONNECT: 'connect',\n    RECONNECT: 'reconnect',\n    DISCONNECT: 'disconnect',\n    CHANGE_USER: 'changeUser',\n    GET_CONNECTION_STATUS: 'getConnectionStatus',\n    GET_CONNECTION_USER_ID: 'getConnectionUserId',\n    GET_CONNECTED_TIME: 'getConnectedTime',\n    GET_APP_INFO: 'getAppInfo',\n    GET_CONVERSATION_LIST: 'getConversationList',\n    REMOVE_CONVERSATION_LIST: 'removeConversationList',\n    REMOVE_CONVERSATION: 'removeConversation',\n    GET_TOTAL_UNREAD_COUNT: 'getTotalUnreadCount',\n    CLEAR_UNREAD_COUNT: 'clearUnreadCount',\n    GET_UNREAD_COUNT: 'getUnreadCount',\n    GET_LOCAL_CONVERSATION: 'getLocalConversation',\n    SET_CONVERSATION_STATUS_LIST: 'setConversationStatusList',\n    SEND_MESSAGE: 'sendMessage',\n    GET_HISTORY_MSGS: 'getHistoryMessages',\n    DELETE_MESSAGES: 'deleteHistoryMessages',\n    CLEAR_MESSAGES: 'clearHistoryMessages',\n    RECALL_MESSAGE: 'recallMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    QUIT_CHATROOM: 'quitChatRoom',\n    GET_CHATROOM_INFO: 'getChatRoomInfo',\n    GET_CHATROOM_MSGS: 'getChatRoomHistoryMessages',\n    SET_KV: 'setChatRoomKV',\n    FORCE_SET_KV: 'forceSetChatRoomKV',\n    DEL_KV: 'removeChatRoomKV',\n    FORCE_DEL_KV: 'forceRemoveChatRoomKV',\n    GET_KV: 'getChatRoomKV',\n    GET_ALL_KV: 'getAllChatRoomKV',\n    JOIN_RTC: 'joinRTCRoom',\n    QUIT_RTC: 'quitRTCRoom',\n    PING_RTC: 'RTCPing',\n    GET_RTC_ROOM_INFO: 'getRTCRoomInfo',\n    SET_RTC_DATA: 'setRTCData',\n    GET_RTC_DATA: 'getRTCData',\n    DEL_RTC_DATA: 'removeRTCData',\n    SET_RTC_OUT_DATA: 'setRTCOutData',\n    GET_RTC_OUT_DATA: 'getRTCOutData',\n    GET_RTC_TOKEN: 'getRTCToken',\n    SET_RTC_STATE: 'setRTCState',\n    GET_RTC_USER_INFO_LIST: 'getRTCUserInfoList',\n    SET_RTC_USER_INFO: 'setRTCUserInfo',\n    DEL_RTC_USER_INFO: 'removeRTCUserInfo',\n    GET_RTC_USER_LIST: 'getRTCUserList',\n    GET_UPLOAD_TOKEN: 'getFileToken',\n    GET_UPLOAD_URL: 'getFileUrl'\n  };\n  var ENGINE_EVENT_NEED_CONNECTED = [ENGINE_EVENT.GET_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION_LIST, ENGINE_EVENT.REMOVE_CONVERSATION, ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT, ENGINE_EVENT.CLEAR_UNREAD_COUNT, ENGINE_EVENT.SEND_MESSAGE, ENGINE_EVENT.GET_HISTORY_MSGS, ENGINE_EVENT.DELETE_MESSAGES, ENGINE_EVENT.CLEAR_MESSAGES, ENGINE_EVENT.RECALL_MESSAGE, ENGINE_EVENT.JOIN_CHATROOM, ENGINE_EVENT.QUIT_CHATROOM, ENGINE_EVENT.GET_CHATROOM_INFO, ENGINE_EVENT.GET_CHATROOM_MSGS];\n  var ENGINE_EVENT_NEED_DISCONNECTED = [ENGINE_EVENT.CONNECT, ENGINE_EVENT.RECONNECT];\n  var IM_EVENT = {\n    STATUS: 'status',\n    MESSAGE: 'message',\n    CONVERSATION: 'conversation',\n    SETTING: 'setting'\n  };\n  var TRANSPORT_EVENT = {\n    SIGNAL: 'signal',\n    STATUS: 'status'\n  };\n  var SERVER_EVENT_NAME = {\n    STATUS: 'status',\n    NOTIFY_PULL: 'notifyPull',\n    DIRECT_MSG: 'directMessage',\n    CHRM_KV_CHANGED: 'chatRoomKV',\n    CHRM_KV_SET: 'chatRoomKVSet',\n    MESSAGE_SEND: 'sendMessage',\n    JOIN_CHATROOM: 'joinChatRoom',\n    BEFORE_JOIN_CHATROOM: 'beforeJoinChatRoom',\n    USER_SETTING_CHANGED: 'userSetting',\n    CONVERSATION_STATUS_CHANGED: 'converStatusChanged',\n    CONVERSATION_STATUS_SETED: 'converStatusSeted'\n  };\n\n  var _APP_ENGINE_EVENT_LOG;\n  var PLATFORM$1 = 'Web';\n  var LEVEL = {\n    FATAL: 0,\n    ERROR: 1,\n    WARN: 2,\n    INFO: 3,\n    DEBUG: 4\n  };\n  var STORE_SIZE = {\n    ADVANCED: 500,\n    LOW: 500\n  };\n  var LOG_TYPE = {\n    'IM': 'IM',\n    'RTC': 'RTC'\n  };\n  var TAG = {\n    L_GET_NAVI_T: 'L-get_navi-T',\n    L_GET_NAVI_R: 'L-get_navi-R',\n    L_PING_WS_T: 'L-ping_ws-T',\n    L_PING_WS_R: 'L-ping_ws-R',\n    L_NETWORK_CHANGED_S: 'L-network_changed-S',\n    L_DECODE_MSG_E: 'L-decode_msg-E',\n    L_RECONNECT_T: 'L-reconnect-T',\n    L_RECONNECT_R: 'L-reconnect-R',\n    L_PULL_CHRM_KV_T: 'L-pull-chrm-kv-T',\n    L_PULL_CHRM_KV_R: 'L-pull-chrm-kv-R',\n    L_PING_S: 'L-ping-S',\n    L_CRASH_F: 'L-crash_web-F',\n    A_INIT_O: 'A-init-O',\n    A_CONNECT_T: 'A-connect-T',\n    A_CONNECT_R: 'A-connect-R',\n    A_DISCONNECT_T: 'A-disconnect-T',\n    A_DISCONNECT_R: 'A-disconnect-R',\n    A_RECONNECT_T: 'A-reconnect-T',\n    A_RECONNECT_R: 'A-reconnect-R',\n    A_JOIN_CHATROOM_T: 'A-join_chatroom-T',\n    A_JOIN_CHATROOM_R: 'A-join_chatroom-R',\n    A_QUIT_CHATROOM_T: 'A-quit_chatroom-T',\n    A_QUIT_CHATROOM_R: 'A-quit_chatroom-R',\n    P_NOTIFY_CHRM_KV_S: 'P-notify-chrm-kv-R',\n    G_CRASH_E: 'G-crash-E',\n    G_UPLOAD_LOG_S: 'G-upload_log-S',\n    G_UPLOAD_LOG_E: 'G-upload_log-E'\n  };\n  var APP_ENGINE_EVENT_LOG_TAG = (_APP_ENGINE_EVENT_LOG = {}, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.CONNECT] = {\n    req: TAG.A_CONNECT_T,\n    resp: TAG.A_CONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.DISCONNECT] = {\n    req: TAG.A_DISCONNECT_T,\n    resp: TAG.A_DISCONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.RECONNECT] = {\n    req: TAG.A_RECONNECT_T,\n    resp: TAG.A_RECONNECT_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.JOIN_CHATROOM] = {\n    req: TAG.A_JOIN_CHATROOM_T,\n    resp: TAG.A_JOIN_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG[ENGINE_EVENT.QUIT_CHATROOM] = {\n    req: TAG.A_QUIT_CHATROOM_T,\n    resp: TAG.A_QUIT_CHATROOM_R\n  }, _APP_ENGINE_EVENT_LOG);\n  var REPORT_TYPE = {\n    REALTIME: 0,\n    FULL: 1\n  };\n  var CSV_LOG_TPL = '{sessionId},{time},{type},{level},{tag},{content}\\n';\n  var REALTIME_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var MSGNOTIF_URL_TPL = '{protocol}{url}?version={version}&appkey={appkey}&userId={userId}&logId={logId}&deviceId={deviceId}&deviceInfo={deviceInfo}&platform={platform}';\n  var LOG_CMD_MSG_SENDER = 'rongcloudsystem';\n  var NO_FULL_LOG = 'nodata';\n  var REQUEST_TIMEOUT = 15000;\n  var DEFAULT_SERVER_OPTION = {\n    isOpen: true,\n    url: 'logcollection.ronghub.com',\n    realtimeLevel: LEVEL.ERROR,\n    realtimeInterval: 20000,\n    realtimeMaxTimes: 5,\n    fullInterval: 5000,\n    fullMaxTimes: 3,\n    fullLevel: LEVEL.DEBUG\n  };\n\n  var isEmpty$1 = utils.isEmpty,\n      tplEngine$1 = utils.tplEngine,\n      getRandomNum$1 = utils.getRandomNum;\n\n  var getTransporterUrl = function getTransporterUrl(option) {\n    var domain = option.domain,\n        appkey = option.appkey,\n        token = option.token,\n        connectType = option.connectType,\n        protocol = option.protocol;\n    var isComet = connectType === CONNECT_TYPE.COMET;\n    var cmpTpl = CMP_URL_TPL;\n\n    if (isEmpty$1(protocol)) {\n      protocol = isComet ? env.protocol.http : env.protocol.ws;\n    }\n\n    var tplOption = {\n      domain: domain,\n      appkey: appkey,\n      protocol: protocol,\n      apiVer: getRandomNum$1(1e6),\n      token: utils.encodeURI(token)\n    };\n\n    if (env.isMini) {\n      cmpTpl = MINI_CMP_URL_TPL;\n      utils.extend(tplOption, {\n        platform: PLATFORM_TYPE.MINI\n      });\n    }\n\n    return tplEngine$1(cmpTpl, tplOption);\n  };\n\n  var isGroup = function isGroup(type) {\n    return type === CONVERSATION_TYPE.GROUP;\n  };\n\n  var isChatRoom = function isChatRoom(type) {\n    return type === CONVERSATION_TYPE.CHATROOM;\n  };\n\n  var getConversationTypeList = function getConversationTypeList() {\n    return utils.getValues(CONVERSATION_TYPE);\n  };\n\n  var isValidConversationType = function isValidConversationType(type) {\n    var conversationTypeList = getConversationTypeList();\n    return utils.isNumber(type) && utils.isInclude(conversationTypeList, type);\n  };\n\n  var getSessionId = function getSessionId(option) {\n    var isStatusMessage = option.isStatusMessage;\n    var isPersited = option.isPersited,\n        isCounted = option.isCounted,\n        isMentiond = option.isMentiond;\n\n    if (isStatusMessage) {\n      isPersited = isCounted = false;\n    }\n\n    var sessionId = 0;\n\n    if (isPersited) {\n      sessionId = sessionId | 0x01;\n    }\n\n    if (isCounted) {\n      sessionId = sessionId | 0x02;\n    }\n\n    if (isMentiond) {\n      sessionId = sessionId | 0x04;\n    }\n\n    return sessionId;\n  };\n\n  var getPersitedAndCountedBySessionId = function getPersitedAndCountedBySessionId(sessionId) {\n    var isPersited, isCounted;\n\n    switch (sessionId) {\n      case MESSAGE_TAG.COUNT_ONLY:\n        isPersited = false;\n        isCounted = true;\n        break;\n\n      case MESSAGE_TAG.PERSIT_ONLY:\n        isPersited = true;\n        isCounted = false;\n        break;\n\n      case MESSAGE_TAG.NONE:\n        isPersited = isCounted = false;\n        break;\n\n      case MESSAGE_TAG.PERSIT_AND_COUNT:\n      default:\n        isPersited = isCounted = true;\n        break;\n    }\n\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted\n    };\n  };\n\n  var getMessageOptionByStatus = function getMessageOptionByStatus(status) {\n    var isPersited = true,\n        isCounted = true,\n        isMentiond = false;\n    isPersited = !!(status & 0x10);\n    isCounted = !!(status & 0x20);\n    isMentiond = !!(status & 0x40);\n    return {\n      isPersited: isPersited,\n      isCounted: isCounted,\n      isMentiond: isMentiond\n    };\n  };\n\n  var SignalId = {\n    ids: {},\n    temp: '{appkey}_{userId}',\n    get: function get(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      var id = SignalId.ids[key] || 0;\n      id++;\n      SignalId.ids[key] = id;\n      return id;\n    },\n    clear: function clear(option) {\n      var key = utils.tplEngine(SignalId.temp, option);\n      SignalId.ids[key] = 0;\n    },\n    isExceedLimit: function isExceedLimit(id) {\n      return id > MAX_SINGAL_ID;\n    }\n  };\n\n  var RCSocket = function () {\n    function RCSocket(options) {\n      this._socket = void 0;\n      this.eventEmitter = new utils.EventEmitter();\n      this.KEY = {\n        OPEN: 'open',\n        MSG: 'msg',\n        ERROR: 'error',\n        CLOSE: 'close'\n      };\n      var self = this;\n      var KEY = self.KEY;\n      self._socket = new utils.Socket(options);\n\n      self._socket.onOpen(function (data) {\n        self.eventEmitter.emit(KEY.OPEN, data);\n      });\n\n      self._socket.onMessage(function (data) {\n        self.eventEmitter.emit(KEY.MSG, data);\n      });\n\n      self._socket.onError(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.ERROR, data);\n      });\n\n      self._socket.onClose(function (data) {\n        data = self._formatCloseData(data);\n        self.eventEmitter.emit(KEY.CLOSE, data);\n      });\n    }\n\n    var _proto = RCSocket.prototype;\n\n    _proto._formatCloseData = function _formatCloseData(data) {\n      if (env.isMini) {\n        data = data || {};\n        var _data = data,\n            errMsg = _data.errMsg;\n        data.code = MINI_ERROR_MSG_TO_STATUS[errMsg];\n      }\n\n      return data;\n    };\n\n    _proto.send = function send(data) {\n      return this._socket.send(data);\n    };\n\n    _proto.close = function close() {\n      this.eventEmitter.clear();\n\n      this._socket.close();\n    };\n\n    _proto.onOpen = function onOpen(event) {\n      this.eventEmitter.on(this.KEY.OPEN, event);\n    };\n\n    _proto.onMessage = function onMessage(event) {\n      this.eventEmitter.on(this.KEY.MSG, event);\n    };\n\n    _proto.onError = function onError(event) {\n      this.eventEmitter.on(this.KEY.ERROR, event);\n    };\n\n    _proto.onClose = function onClose(event) {\n      this.eventEmitter.on(this.KEY.CLOSE, event);\n    };\n\n    return RCSocket;\n  }();\n\n  var RCStorage = function () {\n    function RCStorage(suffix) {\n      var _ref;\n\n      this._cache = void 0;\n      this.STORAGE_KEY = void 0;\n      var storageKey = suffix ? STORAGE_ROOT_KEY + suffix : STORAGE_ROOT_KEY;\n      var localCache = utils.Storage.get(storageKey) || {};\n      this._cache = new utils.Cache((_ref = {}, _ref[storageKey] = localCache, _ref));\n      this.STORAGE_KEY = storageKey;\n    }\n\n    var _proto2 = RCStorage.prototype;\n\n    _proto2._get = function _get() {\n      var KEY = this.STORAGE_KEY;\n      return this._cache.get(KEY) || {};\n    };\n\n    _proto2._set = function _set(cache) {\n      var KEY = this.STORAGE_KEY;\n      cache = cache || {};\n\n      this._cache.set(KEY, cache);\n\n      utils.Storage.set(KEY, cache);\n    };\n\n    _proto2.set = function set(key, value) {\n      var localValue = this._get();\n\n      localValue[key] = value;\n\n      this._set(localValue);\n    };\n\n    _proto2.remove = function remove(key) {\n      var localValue = this._get();\n\n      delete localValue[key];\n\n      this._set(localValue);\n    };\n\n    _proto2.clear = function clear() {\n      var KEY = this.STORAGE_KEY;\n      utils.Storage.remove(KEY);\n\n      this._cache.remove(KEY);\n    };\n\n    _proto2.get = function get(key) {\n      var localValue = this._get();\n\n      return localValue[key];\n    };\n\n    _proto2.getKeys = function getKeys() {\n      var localValue = this._get();\n\n      return utils.getKeys(localValue);\n    };\n\n    _proto2.getValues = function getValues() {\n      return this._get() || {};\n    };\n\n    return RCStorage;\n  }();\n\n  var formatSyncTime = function formatSyncTime(_syncTime) {\n    _syncTime = _syncTime || {};\n    _syncTime.inboxTime = _syncTime.inboxTime || 0;\n    _syncTime.sendboxTime = _syncTime.sendboxTime || 0;\n    return _syncTime;\n  };\n\n  var MessageTimeSyner = function () {\n    function MessageTimeSyner(option) {\n      this._syncTime = void 0;\n      this._storage = void 0;\n      option = option || {};\n      var _option = option,\n          startSyncTime = _option.startSyncTime;\n\n      this._initStorage(option);\n\n      if (startSyncTime) {\n        this._syncTime = formatSyncTime(startSyncTime);\n      }\n    }\n\n    var _proto3 = MessageTimeSyner.prototype;\n\n    _proto3._initStorage = function _initStorage(option) {\n      var appkey = option.appkey,\n          userId = option.userId;\n      var ROOT_KEY = utils.tplEngine(STORAGE_SYNC_TIME.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      var storage = new RCStorage(ROOT_KEY);\n      var syncTime = {\n        sendboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX),\n        inboxTime: storage.get(STORAGE_SYNC_TIME.SUB_KEY.INBOX)\n      };\n      this._storage = storage;\n      this._syncTime = formatSyncTime(syncTime);\n    };\n\n    _proto3.setInbox = function setInbox(time) {\n      var beforeTime = this._syncTime.inboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.inboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.INBOX, time);\n      }\n    };\n\n    _proto3.setSendbox = function setSendbox(time) {\n      var beforeTime = this._syncTime.sendboxTime || 0;\n\n      if (beforeTime < time) {\n        this._syncTime.sendboxTime = time;\n\n        this._storage.set(STORAGE_SYNC_TIME.SUB_KEY.SENDBOX, time);\n      }\n    };\n\n    _proto3.setByMessage = function setByMessage(msg) {\n      var messageDirection = msg.messageDirection,\n          sentTime = msg.sentTime;\n      var isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND;\n      isSelfSend ? this.setSendbox(sentTime) : this.setInbox(sentTime);\n    };\n\n    _proto3.get = function get() {\n      return formatSyncTime(this._syncTime);\n    };\n\n    return MessageTimeSyner;\n  }();\n\n  var ChatRoomMessageTimeSyner = function () {\n    function ChatRoomMessageTimeSyner() {\n      this._pullTimes = {};\n    }\n\n    var _proto4 = ChatRoomMessageTimeSyner.prototype;\n\n    _proto4.set = function set(chrmId, time) {\n      this._pullTimes[chrmId] = time;\n    };\n\n    _proto4.get = function get(chrmId) {\n      return this._pullTimes[chrmId] || 0;\n    };\n\n    _proto4.setByMessage = function setByMessage(msg) {\n      var sentTime = msg.sentTime;\n      var chrmId = msg.targetId;\n      var beforeTime = this.get(chrmId);\n\n      if (beforeTime < sentTime) {\n        this.set(chrmId, sentTime);\n      }\n    };\n\n    return ChatRoomMessageTimeSyner;\n  }();\n\n  var getUIDByToken = function getUIDByToken(token) {\n    return utils.md5(token).slice(8, 16);\n  };\n\n  var isIncludeNavi = function isIncludeNavi(token) {\n    return utils.isInclude(token, NAVI_SEPARATOR_IN_TOKEN);\n  };\n\n  var getNaviListByToken = function getNaviListByToken(token) {\n    var navDomainList = [];\n\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      var navsText = token.substring(separatorIndex + 1, token.length);\n      var domainList = navsText.split(DOMAIN_SEPARATOR_IN_NAVLIST);\n      utils.forEach(domainList, function (domain) {\n        if (!isEmpty$1(domain)) {\n          navDomainList.push(domain);\n        }\n      });\n    }\n\n    return navDomainList;\n  };\n\n  var getCMPDomainList = function getCMPDomainList(option, customOption) {\n    var server = option.server,\n        backupServer = option.backupServer;\n    server = server || '';\n    backupServer = backupServer || '';\n    var backupCMPList = backupServer.split(DOMAIN_SEPARATOR_IN_CMPLIST);\n    var cmpList = [];\n\n    if (!utils.isEmpty(server)) {\n      cmpList.push(server);\n    }\n\n    utils.forEach(backupCMPList, function (cmp) {\n      if (!utils.isEmpty(cmp)) {\n        cmpList.push(cmp);\n      }\n    });\n\n    if (!utils.isUndefined(customOption.customCMP) && !utils.isEmpty(customOption.customCMP)) {\n      cmpList = customOption.customCMP;\n    }\n\n    return cmpList;\n  };\n\n  var getValidToken = function getValidToken(token) {\n    if (isIncludeNavi(token)) {\n      var separatorIndex = utils.indexOf(token, NAVI_SEPARATOR_IN_TOKEN);\n      token = token.substring(0, separatorIndex + 1);\n    }\n\n    return token;\n  };\n\n  var getConnectType = function getConnectType(option) {\n    var connectType = option.connectType;\n    var isSpecifiedSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var isSocket = isSpecifiedSocket && utils.isSupportSocket();\n    return isSocket ? CONNECT_TYPE.WEBSOCKET : CONNECT_TYPE.COMET;\n  };\n\n  var isConnected = function isConnected(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTED);\n  };\n\n  var isConnecting = function isConnecting(status) {\n    return utils.isEqual(status, CONNECTION_STATUS.CONNECTING);\n  };\n\n  var isDisconnected = function isDisconnected(status) {\n    return !isConnected(status) && !isConnecting(status);\n  };\n\n  var getNavReqOption = function getNavReqOption(option, user) {\n    option = utils.copy(option);\n    option.token = user.token;\n    return option;\n  };\n\n  var getPingTimeout = function getPingTimeout(timeSpentConnect) {\n    var timeout = timeSpentConnect * 3;\n\n    if (timeout < IM_PING_MIN_TIMEOUT) {\n      return IM_PING_MIN_TIMEOUT;\n    }\n\n    if (timeout > IM_PING_MAX_TIMEOUT) {\n      return IM_PING_MAX_TIMEOUT;\n    }\n\n    return timeout;\n  };\n\n  var DelayTimer = {\n    _delayTime: 0,\n    setTime: function setTime(time) {\n      var currentTime = utils.getCurrentTimestamp();\n      DelayTimer._delayTime = currentTime - time;\n    },\n    getTime: function getTime() {\n      var delayTime = DelayTimer._delayTime;\n      var currentTime = utils.getCurrentTimestamp();\n      return currentTime - delayTime;\n    }\n  };\n\n  var isInValidConversationData = function isInValidConversationData(conversation) {\n    return !conversation.type || !conversation.targetId || !utils.isObject(conversation.latestMessage) || utils.isUndefined(conversation.unreadMessageCount);\n  };\n\n  var fixConversationData = function fixConversationData(conversation) {\n    conversation = conversation || {};\n    var _conversation = conversation,\n        targetId = _conversation.targetId,\n        type = _conversation.type;\n    var defaultType = CONVERSATION_TYPE.PRIVATE,\n        defaultId = '',\n        defaultMsg = {\n      messageType: MESSAGE_TYPE.TEXT,\n      sentTime: DelayTimer.getTime(),\n      content: {\n        content: ''\n      },\n      senderUserId: targetId,\n      targetId: targetId,\n      type: type\n    };\n    conversation.type = type || defaultType;\n    conversation.targetId = targetId || defaultId;\n    conversation.latestMessage = conversation.latestMessage || defaultMsg;\n    return conversation;\n  };\n\n  var sortConversationList = function sortConversationList(conversationList) {\n    if (utils.isEmpty(conversationList)) {\n      return [];\n    }\n\n    return utils.quickSort(conversationList, function (before, after) {\n      before = before || {};\n      after = after || {};\n      var beforeLatestMessage = before.latestMessage || {},\n          afterLatestMessage = after.latestMessage || {},\n          beforeLatestSentTime = beforeLatestMessage.sentTime || 0,\n          afterLatestSentTime = afterLatestMessage.sentTime || 0;\n      var flag = false;\n\n      if (before.isTop && !after.isTop) {\n        flag = false;\n      } else if (!before.isTop && after.isTop) {\n        flag = true;\n      } else {\n        flag = afterLatestSentTime <= beforeLatestSentTime;\n      }\n\n      return flag;\n    });\n  };\n\n  var splitConversationListByIsTop = function splitConversationListByIsTop(conversationList) {\n    var topConversationList = [],\n        unToppedConversationList = [];\n    utils.forEach(conversationList, function (conversation) {\n      var isTop = conversation.isTop || false;\n\n      if (isTop) {\n        topConversationList.push(conversation);\n      } else {\n        unToppedConversationList.push(conversation);\n      }\n    });\n    return {\n      topConversationList: topConversationList || [],\n      unToppedConversationList: unToppedConversationList || []\n    };\n  };\n\n  var sortConList = function sortConList(conversationList) {\n    if (utils.isEmpty(conversationList)) {\n      return [];\n    }\n\n    var splitConversationList = splitConversationListByIsTop(conversationList);\n\n    var _sortListBySentTime = function _sortListBySentTime(convers) {\n      return utils.quickSort(convers, function (before, after) {\n        before = before || {};\n        after = after || {};\n        var beforeLatestMessage = before.latestMessage || {},\n            afterLatestMessage = after.latestMessage || {},\n            beforeLatestSentTime = beforeLatestMessage.sentTime || 0,\n            afterLatestSentTime = afterLatestMessage.sentTime || 0;\n        return afterLatestSentTime <= beforeLatestSentTime;\n      });\n    };\n\n    var topConversationList = _sortListBySentTime(splitConversationList.topConversationList);\n\n    var unToppedConversationList = _sortListBySentTime(splitConversationList.unToppedConversationList);\n\n    topConversationList.push.apply(topConversationList, unToppedConversationList);\n    return topConversationList;\n  };\n\n  var isSupportStatusMessage = function isSupportStatusMessage(type) {\n    return !!CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n  };\n\n  var getConversationKey = function getConversationKey(option) {\n    var type = option.type,\n        targetId = option.targetId;\n    return type + '_' + targetId;\n  };\n\n  var getConversationByKey = function getConversationByKey(key) {\n    key = key || '';\n    var arr = key.split('_');\n\n    if (arr.length === 2) {\n      return {\n        type: arr[0],\n        targetId: arr[1]\n      };\n    } else {\n      return {\n        type: CONVERSATION_TYPE.PRIVATE,\n        targetId: ''\n      };\n    }\n  };\n\n  var getChatRoomKVOptStatus = function getChatRoomKVOptStatus(entity, action) {\n    var status = 0;\n\n    if (entity.isAutoDelete) {\n      status = status | CHATROOM_KV_STATUS_CODE.AUTO_DELETE;\n    }\n\n    if (entity.isOverwrite) {\n      status = status | CHATROOM_KV_STATUS_CODE.OVERWRITE;\n    }\n\n    if (utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE)) {\n      status = status | CHATROOM_KV_STATUS_CODE.OPERATE;\n    }\n\n    return status;\n  };\n\n  var getChatRoomKVByStatus = function getChatRoomKVByStatus(status) {\n    var isDeleteOpt = !!(status & CHATROOM_KV_STATUS_CODE.OPERATE);\n    return {\n      isAutoDelete: !!(status & CHATROOM_KV_STATUS_CODE.AUTO_DELETE),\n      isOverwrite: !!(status & CHATROOM_KV_STATUS_CODE.OVERWRITE),\n      type: isDeleteOpt ? CHATROOM_ENTRY_TYPE.DELETE : CHATROOM_ENTRY_TYPE.UPDATE\n    };\n  };\n\n  var TextCompressor = {\n    _dataType: {\n      Tail: 0x30,\n      Compressed: 0x40,\n      NormalExt: 0x50,\n      Normal: 0x60,\n      Mark: 0x70\n    },\n    _chars: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n    _scale: 62,\n    _max: 238327,\n    _indexOf: function _indexOf(map, source, fromIndex) {\n      var result = {\n        length: 0,\n        offset: -1\n      };\n\n      if (fromIndex >= source.length - 1) {\n        return result;\n      }\n\n      var c1 = source.charAt(fromIndex);\n      var c2 = source.charAt(fromIndex + 1);\n      var items = map[c1 + c2];\n\n      if (items[0] === fromIndex) {\n        return result;\n      }\n\n      var space1 = source.length - fromIndex;\n\n      for (var i = 0, len = items.length; i < len; i++) {\n        var item = items[i];\n        var space2 = fromIndex - item;\n\n        if (space2 > TextCompressor._max) {\n          continue;\n        }\n\n        var end = Math.min(space1, space2);\n\n        if (end <= result.length) {\n          break;\n        }\n\n        if (result.length > 2) {\n          if (source.charAt(item + result.length - 1) !== source.charAt(fromIndex + result.length - 1)) {\n            continue;\n          }\n        }\n\n        var m = 2;\n\n        for (var j = m; j < end; j++) {\n          if (source.charAt(item + j) === source.charAt(fromIndex + j)) {\n            m++;\n          } else {\n            break;\n          }\n        }\n\n        if (m >= result.length) {\n          result.length = m;\n          result.offset = item;\n        }\n      }\n\n      return result;\n    },\n    _numberEncode: function _numberEncode(num) {\n      var result = [],\n          remainder = 0;\n\n      do {\n        remainder = num % TextCompressor._scale;\n        result.push(TextCompressor._chars.charAt(remainder));\n        num = (num - remainder) / TextCompressor._scale;\n      } while (num > 0);\n\n      return result.join('');\n    },\n    _numberDecode: function _numberDecode(str) {\n      var num = 0,\n          index = 0;\n\n      for (var i = str.length - 1; i >= 0; i--) {\n        index = TextCompressor._chars.indexOf(str.charAt(i));\n\n        if (index === -1) {\n          throw new Error('decode number error, data is \\'' + str + '\\'');\n        }\n\n        num = num * TextCompressor._scale + index;\n      }\n\n      return num;\n    },\n    compress: function compress(data) {\n      var map = {};\n\n      for (var p = 0; p < data.length - 1; p++) {\n        var c1 = data.charAt(p);\n        var c2 = data.charAt(p + 1);\n        var c = c1 + c2;\n\n        if (!map.hasOwnProperty(c)) {\n          map[c] = [p];\n          continue;\n        }\n\n        map[c].push(p);\n      }\n\n      var compressedData = [],\n          normalBlockBuffer = [];\n\n      var encodeNormalBlock = function encodeNormalBlock() {\n        if (normalBlockBuffer.length > 0) {\n          var normalBlock = normalBlockBuffer.join('');\n          normalBlockBuffer = [];\n\n          if (normalBlock.length > 26) {\n            var normalExtBlockLength = TextCompressor._numberEncode(normalBlock.length);\n\n            var normalExtBlockHeader = String.fromCharCode(TextCompressor._dataType.NormalExt | normalExtBlockLength.length);\n            compressedData.push(normalExtBlockHeader + normalExtBlockLength);\n          } else {\n            var normalBlockHeader = String.fromCharCode(TextCompressor._dataType.Normal | normalBlock.length);\n            compressedData.push(normalBlockHeader);\n          }\n\n          compressedData.push(normalBlock);\n        }\n      };\n\n      var i = 0;\n\n      while (i < data.length) {\n        var r = TextCompressor._indexOf(map, data, i);\n\n        if (r.length < 2) {\n          normalBlockBuffer.push(data.charAt(i++));\n          continue;\n        }\n\n        if (r.length < 4) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        var offset = TextCompressor._numberEncode(i - r.offset);\n\n        var length = TextCompressor._numberEncode(r.length);\n\n        if (offset.length + length.length >= r.length) {\n          normalBlockBuffer.push(data.substr(i, r.length));\n          i += r.length;\n          continue;\n        }\n\n        encodeNormalBlock();\n        var compressedBlockHeader = String.fromCharCode(TextCompressor._dataType.Compressed | offset.length << 2 | length.length);\n        compressedData.push(compressedBlockHeader + offset + length);\n        i += r.length;\n      }\n\n      encodeNormalBlock();\n\n      var dataLengthTo62 = TextCompressor._numberEncode(data.length);\n\n      var tailBlockHeader = String.fromCharCode(TextCompressor._dataType.Tail | dataLengthTo62.length);\n      compressedData.push(tailBlockHeader + dataLengthTo62);\n      return compressedData.join('');\n    },\n    uncompress: function uncompress(data) {\n      var i = 0;\n      var result = '';\n\n      label1: do {\n        var header = data.charCodeAt(i++);\n        var headerType = header & TextCompressor._dataType.Mark;\n        var headerVal = header & 0xF;\n\n        switch (headerType) {\n          case TextCompressor._dataType.Compressed:\n            var p1 = headerVal >> 2;\n            var p2 = headerVal & 3;\n\n            if (p1 === 0 || p2 === 0) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            var offset = TextCompressor._numberDecode(data.substr(i, p1));\n\n            var len = TextCompressor._numberDecode(data.substr(i += p1, p2));\n\n            offset = result.length - offset;\n\n            if (offset + len > result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += p2;\n            result += result.substr(offset, len);\n            break;\n\n          case TextCompressor._dataType.Tail:\n            var num = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            if (num !== result.length) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            i += headerVal;\n            break label1;\n\n          case TextCompressor._dataType.NormalExt:\n            var normalNum = TextCompressor._numberDecode(data.substr(i, headerVal));\n\n            result += data.substr(i += headerVal, normalNum);\n            i += normalNum;\n            break;\n\n          case TextCompressor._dataType.Normal:\n            result += data.substr(i, headerVal);\n            i += headerVal;\n            break;\n\n          case TextCompressor._dataType.Mark:\n            if (headerVal > 10) {\n              throw new Error('Data parsing error,at ' + i);\n            }\n\n            result += data.substr(i, 16 + headerVal);\n            i += 16 + headerVal;\n            break;\n\n          default:\n            throw new Error('Data parsing error,at ' + i + ' header:' + headerType);\n        }\n      } while (i < data.length);\n\n      return result;\n    }\n  };\n\n  var isBelowIE = function isBelowIE(version) {\n    var system = env.system;\n    var flag = system.model === 'IE' && Number(system.version) < version ? true : false;\n    return flag;\n  };\n\n  var stringToCsv = function stringToCsv(str) {\n    var csvStr = str.replace(/\"/g, '\"\"');\n    var tpl = '\"{csvStr}\"';\n    return tplEngine$1(tpl, {\n      csvStr: csvStr\n    });\n  };\n\n  var getWebSessionId = function getWebSessionId() {\n    var sessionId = utils.Session.get(STORAGE_SESSION_ID_KEY);\n\n    if (utils.isEmpty(sessionId)) {\n      sessionId = utils.getUUID22().slice(0, 10);\n      utils.Session.set(STORAGE_SESSION_ID_KEY, sessionId);\n    }\n\n    return sessionId;\n  };\n\n  var getDeviceId = function getDeviceId() {\n    var deviceId = utils.Storage.get(STORAGE_DEVICE_ID_KEY);\n\n    if (utils.isEmpty(deviceId)) {\n      deviceId = utils.getUUID22();\n      utils.Storage.set(STORAGE_DEVICE_ID_KEY, deviceId);\n    }\n\n    return deviceId;\n  };\n\n  var getDeviceInfo = function getDeviceInfo() {\n    var tpl = '{brower}|{version}|{sessionId}';\n    return tplEngine$1(tpl, {\n      brower: env.system.model,\n      version: env.system.version,\n      sessionId: getWebSessionId()\n    });\n  };\n\n  var getReportLogUrl = function getReportLogUrl(params) {\n    var entireUrl = '',\n        protocol = env.protocol.http + '//';\n    var urlConf = {\n      protocol: protocol,\n      url: params.url,\n      version: SDK_VERSION,\n      appkey: params.appkey,\n      deviceId: getDeviceId(),\n      deviceInfo: getDeviceInfo(),\n      platform: PLATFORM$1,\n      userId: params.userId\n    };\n\n    switch (params.type) {\n      case REPORT_TYPE.REALTIME:\n        entireUrl = tplEngine$1(REALTIME_URL_TPL, urlConf);\n        break;\n\n      case REPORT_TYPE.FULL:\n        entireUrl = tplEngine$1(MSGNOTIF_URL_TPL, utils.extend(urlConf, {\n          logId: params.logId\n        }));\n        break;\n\n      default:\n        break;\n    }\n\n    return entireUrl;\n  };\n\n  var isLogCommandMsg = function isLogCommandMsg(msg) {\n    var content = msg.content;\n    return msg.messageType === MESSAGE_TYPE.LOG_COMMAND && msg.senderUserId === LOG_CMD_MSG_SENDER && content.platform === 'Web';\n  };\n\n  var isValidChatRoomKey = function isValidChatRoomKey(key) {\n    if (!utils.isString(key)) {\n      return;\n    }\n\n    var isValid = /^[A-Za-z0-9_=+-]+$/.test(key),\n        keyLen = key.length,\n        isLimit = keyLen <= CHATROOM_KEY_LENGTH.MAX && keyLen >= CHATROOM_KEY_LENGTH.MIN;\n    return isValid && isLimit;\n  };\n\n  var isValidChatRoomValue = function isValidChatRoomValue(value) {\n    if (!utils.isString(value)) {\n      return;\n    }\n\n    var valLen = value.length;\n    return valLen <= CHATROOM_VALUE_LENGTH.MAX && valLen >= CHATROOM_VALUE_LENGTH.MIN;\n  };\n\n  var genUploadFileName = function genUploadFileName(type, fileName) {\n    var tpl = '{type}__RC-{date}_{random}_{timestamp}{uuid}{extension}';\n    var random = Math.floor(Math.random() * 1000 % 10000);\n    var uuid = utils.getUUID();\n    var fileNameArr, extension;\n\n    if (fileName) {\n      fileNameArr = fileName.split('.');\n      extension = '.' + fileNameArr[fileNameArr.length - 1];\n    }\n\n    return tplEngine$1(tpl, {\n      type: type,\n      date: utils.formateDate('-'),\n      random: random,\n      uuid: uuid,\n      timestamp: DelayTimer.getTime(),\n      extension: extension || ''\n    });\n  };\n\n  var getUploadFileDomains = function getUploadFileDomains(navi) {\n    var uploadServer = navi.uploadServer,\n        bosAddr = navi.bosAddr;\n    return {\n      qiniu: uploadServer,\n      bos: bosAddr\n    };\n  };\n\n  var mergeConversationList = function mergeConversationList(option) {\n    option = option || {};\n    var _option2 = option,\n        conversationList = _option2.conversationList,\n        updatedConversationList = _option2.updatedConversationList;\n    var allConversationList = updatedConversationList.concat(conversationList);\n    var hashTable = {};\n    var newList = [];\n    var invalidDataIndexList = [];\n    utils.forEach(allConversationList, function (conversation) {\n      if (!utils.isObject(conversation)) {\n        return;\n      }\n\n      var key = getConversationKey(conversation),\n          hashItem = hashTable[key] || {},\n          hashIndex = utils.isUndefined(hashItem.index) ? newList.length : hashItem.index,\n          hashVal = hashItem.val || {},\n          cacheUpdatedItems = hashVal.updatedItems || {},\n          updatedItems = conversation.updatedItems || {};\n      conversation = utils.extend(conversation, hashVal);\n      utils.forEach(cacheUpdatedItems, function (item, key) {\n        conversation[key] = item.val;\n      });\n      utils.forEach(updatedItems, function (item, key) {\n        var cacheItem = cacheUpdatedItems[key] || {},\n            cacheItemUpdatedTime = cacheItem.time || 0;\n\n        if (item.time > cacheItemUpdatedTime) {\n          conversation[key] = item.val;\n        }\n      });\n      hashTable[key] = {\n        index: hashIndex,\n        val: conversation\n      };\n      newList[hashIndex] = conversation;\n      isInValidConversationData(conversation) && invalidDataIndexList.push(hashIndex);\n    });\n    utils.forEach(invalidDataIndexList, function (invalidIndex) {\n      var conversation = newList[invalidIndex];\n      newList[invalidIndex] = fixConversationData(conversation);\n    });\n    newList = sortConList(newList);\n    return newList;\n  };\n\n  var common = {\n    isConnected: isConnected,\n    isConnecting: isConnecting,\n    isDisconnected: isDisconnected,\n    getConnectType: getConnectType,\n    getTransporterUrl: getTransporterUrl,\n    isGroup: isGroup,\n    isChatRoom: isChatRoom,\n    getConversationTypeList: getConversationTypeList,\n    isValidConversationType: isValidConversationType,\n    getUIDByToken: getUIDByToken,\n    getSessionId: getSessionId,\n    getMessageOptionByStatus: getMessageOptionByStatus,\n    getPersitedAndCountedBySessionId: getPersitedAndCountedBySessionId,\n    SignalId: SignalId,\n    MessageTimeSyner: MessageTimeSyner,\n    ChatRoomMessageTimeSyner: ChatRoomMessageTimeSyner,\n    getCMPDomainList: getCMPDomainList,\n    getNaviListByToken: getNaviListByToken,\n    getValidToken: getValidToken,\n    RCSocket: RCSocket,\n    RCStorage: RCStorage,\n    getNavReqOption: getNavReqOption,\n    getPingTimeout: getPingTimeout,\n    fixConversationData: fixConversationData,\n    sortConversationList: sortConversationList,\n    DelayTimer: DelayTimer,\n    isSupportStatusMessage: isSupportStatusMessage,\n    getConversationKey: getConversationKey,\n    getConversationByKey: getConversationByKey,\n    getChatRoomKVOptStatus: getChatRoomKVOptStatus,\n    getChatRoomKVByStatus: getChatRoomKVByStatus,\n    TextCompressor: TextCompressor,\n    isBelowIE: isBelowIE,\n    getReportLogUrl: getReportLogUrl,\n    isLogCommandMsg: isLogCommandMsg,\n    getWebSessionId: getWebSessionId,\n    getDeviceId: getDeviceId,\n    stringToCsv: stringToCsv,\n    isValidChatRoomKey: isValidChatRoomKey,\n    isValidChatRoomValue: isValidChatRoomValue,\n    genUploadFileName: genUploadFileName,\n    getUploadFileDomains: getUploadFileDomains,\n    mergeConversationList: mergeConversationList,\n    sortConList: sortConList\n  };\n\n  var EventEmitter$1 = utils.EventEmitter,\n      DeferHandler$1 = utils.DeferHandler,\n      Timer$1 = utils.Timer;\n  var RCSocket$1 = common.RCSocket;\n  var TransHandlerID = {\n    CONNECT: 'connect',\n    PING: 'ping'\n  };\n\n  var Heartbeat = function () {\n    function Heartbeat(transporter, option) {\n      this._transporter = void 0;\n      this._timer = void 0;\n      option = option || {};\n      var timeout = option.timeout;\n      this._transporter = transporter;\n      this._timer = new Timer$1({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: timeout\n      });\n    }\n\n    var _proto = Heartbeat.prototype;\n\n    _proto.check = function check(timeout) {\n      var _transporter = this._transporter;\n      var _deferHandler = _transporter._deferHandler;\n      var pingReqSignal = new PingReqWriter();\n\n      _transporter.sendSignal(pingReqSignal);\n\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.PING, {\n          resolve: resolve,\n          reject: reject\n        }, {\n          timeout: timeout\n        });\n      });\n    };\n\n    _proto.start = function start(timeout, onError) {\n      var self = this;\n\n      self._timer.start(function () {\n        self.check(timeout).then(utils.noop)[\"catch\"](onError);\n      });\n    };\n\n    _proto.stop = function stop() {\n      this._timer && this._timer.stop();\n    };\n\n    return Heartbeat;\n  }();\n\n  var SocketTransporter = function () {\n    function SocketTransporter(option) {\n      this._socket = void 0;\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$1();\n      this._deferHandler = new DeferHandler$1();\n      this._heartbeat = new Heartbeat(this, {\n        timeout: IM_PING_INTERVAL_TIME\n      });\n      this._connectedTime = void 0;\n      this._option = option;\n    }\n\n    var _proto2 = SocketTransporter.prototype;\n\n    _proto2._createSocket = function _createSocket(url) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var socket = new RCSocket$1({\n        url: url\n      });\n\n      var onClose = function onClose(event) {\n        event = event || {};\n        var code = event.code || TRANSPORTER_STATUS.CLOSE_ABNORMAL;\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, code);\n\n        self.disconnect();\n      };\n\n      socket.onMessage(function (msg) {\n        var data = msg.data;\n\n        if (!utils.isArrayBuffer(data)) {\n          throw new Error('Error socket signal');\n        }\n\n        var signal = readWSBuffer(data);\n        self.handleSignal(signal);\n      });\n      socket.onError(onClose);\n      socket.onClose(onClose);\n      return socket;\n    };\n\n    _proto2._startHeartbeat = function _startHeartbeat(timeSpentConnect) {\n      var self = this;\n      var _heartbeat = self._heartbeat,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n\n      _heartbeat.check(FIRST_PING_TIMEOUT).then(utils.noop)[\"catch\"](function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_FIRST_TIMEOUT);\n\n        self.disconnect();\n      });\n\n      var pingTimeout = common.getPingTimeout(timeSpentConnect);\n\n      _heartbeat.start(pingTimeout, function () {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n        self.disconnect();\n      });\n    };\n\n    _proto2._stopHeartbeat = function _stopHeartbeat() {\n      this._heartbeat.stop();\n    };\n\n    _proto2.watchSignal = function watchSignal(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, watcher);\n    };\n\n    _proto2.watchStatus = function watchStatus(watcher) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, watcher);\n    };\n\n    _proto2.connect = function connect(user, option) {\n      var self = this;\n      var _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType,\n          _deferHandler = self._deferHandler;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        connectType: connectType,\n        token: token\n      });\n      var timeBeforeConnect = utils.getCurrentTimestamp();\n      self._socket = this._createSocket(url);\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(TransHandlerID.CONNECT, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (result) {\n        var timeAfterConnect = utils.getCurrentTimestamp();\n        var timeSpentConnect = timeAfterConnect - timeBeforeConnect;\n\n        self._startHeartbeat(timeSpentConnect);\n\n        return result;\n      });\n    };\n\n    _proto2.sendSignal = function sendSignal(writer) {\n      var binary = writer.getBufferData();\n\n      this._socket.send(binary.buffer);\n    };\n\n    _proto2.handleSignal = function handleSignal(signal) {\n      var _transporterEventEmiiter = this._transporterEventEmiiter,\n          _deferHandler = this._deferHandler;\n\n      if (signal instanceof ConnAckReader) {\n        this.handleConnAck(signal);\n      } else if (signal instanceof PingRespReader) {\n        _deferHandler.resolve(TransHandlerID.PING);\n      } else {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n      }\n\n      if (signal && utils.isValidTimestamp(signal.timestamp)) {\n        common.DelayTimer.setTime(signal.timestamp);\n      }\n    };\n\n    _proto2.handleConnAck = function handleConnAck(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          _transporterEventEmiiter = self._transporterEventEmiiter;\n      var status = signal.status;\n      var isConnected = status === SUCCESS_CODE;\n      var event = isConnected ? _deferHandler.resolve : _deferHandler.reject;\n      event.call(_deferHandler, TransHandlerID.CONNECT, signal);\n\n      if (isConnected) {\n        self._connectedTime = utils.getCurrentTimestamp();\n      }\n\n      isConnected && _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.CONNECTED);\n    };\n\n    _proto2.disconnect = function disconnect() {\n      this._stopHeartbeat();\n\n      this._socket && this._socket.close();\n    };\n\n    return SocketTransporter;\n  }();\n\n  var logEventEmitter = new utils.EventEmitter();\n  var LogEventName = 'log';\n  var LocalLogPrefix = '[Rong]';\n  var ServerOption = DEFAULT_SERVER_OPTION;\n  var Option = {\n    isDebug: false,\n    isUploadToServer: false,\n    appkey: '',\n    userId: '',\n    isNetworkUnavailable: true\n  };\n  var realTimeUploadHasStarted = false,\n      RealtimeUploadTimes = 1,\n      isRealtimeUploading = false,\n      fullLogId = '';\n\n  var isFirstDefaultUpload = function isFirstDefaultUpload(interval) {\n    return interval === 20000;\n  };\n\n  var getRealtimeUploadInterval = function getRealtimeUploadInterval(uploadTimes) {\n    var realtimeInterval = ServerOption.realtimeInterval;\n    return realtimeInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getFullUploadInterval = function getFullUploadInterval(uploadTimes) {\n    var fullInterval = ServerOption.fullInterval;\n    return fullInterval * Math.pow(2, uploadTimes - 1);\n  };\n\n  var getCSVForLog = function getCSVForLog(log) {\n    log = log || {};\n    var content = log.content || {};\n    utils.forEach(content, function (val, key) {\n      if (utils.isObject(val) || utils.isArray(val)) {\n        content[key] = utils.toJSON(val);\n      }\n    });\n    content = utils.toJSON(content) || '\"\"';\n    content = common.stringToCsv(content);\n    return utils.tplEngine(CSV_LOG_TPL, {\n      sessionId: common.getWebSessionId(),\n      time: log.time,\n      type: log.type,\n      level: log.level,\n      tag: log.tag,\n      content: content\n    });\n  };\n\n  var setServerOption = function setServerOption(serverData) {\n    var logSwitch = serverData.logSwitch,\n        logPolicy = serverData.logPolicy;\n    var isOpen = !!logSwitch;\n    if (utils.isEmpty(serverData)) return;\n    ServerOption.isOpen = isOpen;\n\n    if (!isOpen) {\n      return;\n    }\n\n    var logConf = utils.parseJSON(logPolicy || '') || {};\n    var url = logConf.url,\n        level = logConf.level,\n        itv = logConf.itv,\n        times = logConf.times;\n    utils.extend(ServerOption, {\n      url: url,\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(itv) * 1000,\n      realtimeMaxTimes: Number(times)\n    });\n  };\n\n  var setServerResponseOption = function setServerResponseOption(resText) {\n    var resConf = utils.parseJSON(resText || '');\n    var nextTime = resConf.nextTime,\n        level = resConf.level,\n        logSwitch = resConf.logSwitch;\n    if (utils.isEmpty(resConf)) return;\n    var isOpen = !!logSwitch;\n    ServerOption.isOpen = isOpen;\n    if (!isOpen) return;\n    utils.extend(ServerOption, {\n      realtimeLevel: Number(level),\n      realtimeInterval: Number(nextTime) * 1000\n    });\n  };\n\n  var getLogLevel = function getLogLevel(log) {\n    log = log || {};\n    var _Option = Option,\n        isNetworkUnavailable = _Option.isNetworkUnavailable,\n        _log = log,\n        level = _log.level,\n        isLevelToDegrad = utils.isEqual(level, LEVEL.ERROR) || utils.isEqual(level, LEVEL.WARN);\n\n    if (isNetworkUnavailable && isLevelToDegrad) {\n      log.level = LEVEL.INFO;\n    }\n\n    return log;\n  };\n\n  var LogStore = {\n    _list: [],\n    MaxSize: common.isBelowIE(9) ? STORE_SIZE.LOW : STORE_SIZE.ADVANCED,\n    add: function add(log) {\n      log = getLogLevel(log);\n\n      LogStore._list.push(log);\n\n      var currentSize = LogStore._list.length,\n          maxSize = LogStore.MaxSize;\n\n      if (currentSize > maxSize) {\n        LogStore._list.splice(0, currentSize - maxSize);\n      }\n    },\n    get: function get(option) {\n      var type = option.type,\n          uploadLevel = option.level;\n      var _list = LogStore._list;\n      var uploadList = [];\n      utils.forEach(_list, function (log, index) {\n        var logTime = log.time || 0,\n            logLevel = log.level || LEVEL.DEBUG,\n            isUploadLevel = logLevel <= uploadLevel,\n            fullUploadOption = option.fullUploadOption || {},\n            startTime = fullUploadOption.startTime || 0,\n            endTime = fullUploadOption.endTime || common.DelayTimer.getTime();\n        var isUpload = isUploadLevel;\n\n        switch (type) {\n          case REPORT_TYPE.REALTIME:\n            isUpload = isUpload && !log.isUploaded;\n            isUpload && (LogStore._list[index].isUploaded = true);\n            break;\n\n          case REPORT_TYPE.FULL:\n            isUpload = isUpload && logTime >= startTime && logTime <= endTime;\n            break;\n\n          default:\n        }\n\n        if (isUpload) {\n          uploadList.push(log);\n        }\n      });\n      return uploadList;\n    },\n    clear: function clear() {\n      LogStore._list = [];\n    }\n  };\n\n  var upload = function upload(option) {\n    var url = option.url,\n        logList = option.logList,\n        type = option.type;\n    var requestUrl = common.getReportLogUrl({\n      type: type,\n      appkey: Option.appkey || '',\n      userId: Option.userId || '',\n      url: url || ServerOption.url || DEFAULT_SERVER_OPTION.url,\n      logId: option.logId\n    });\n    var csvLog = '';\n    utils.forEach(logList, function (log) {\n      csvLog += getCSVForLog(log);\n    });\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.REALTIME) {\n      return utils.Defer.reject();\n    }\n\n    if (utils.isEmpty(csvLog) && type === REPORT_TYPE.FULL) {\n      csvLog = NO_FULL_LOG;\n    }\n\n    csvLog = common.TextCompressor.compress(csvLog);\n    return utils.request(requestUrl, {\n      method: REQUEST_METHOD.POST,\n      body: csvLog,\n      timeout: REQUEST_TIMEOUT\n    });\n  };\n\n  var uploadRealtime = function uploadRealtime() {\n    if (isRealtimeUploading) {\n      return;\n    }\n\n    var interval = getRealtimeUploadInterval(RealtimeUploadTimes);\n    var realtimeMaxTimes = ServerOption.realtimeMaxTimes,\n        realtimeLevel = ServerOption.realtimeLevel;\n\n    if (RealtimeUploadTimes < realtimeMaxTimes) {\n      RealtimeUploadTimes++;\n    }\n\n    if (isFirstDefaultUpload(interval)) {\n      RealtimeUploadTimes = 1;\n    }\n\n    utils.setTimeout(function () {\n      var logList = LogStore.get({\n        type: REPORT_TYPE.REALTIME,\n        level: realtimeLevel\n      });\n      isRealtimeUploading = true;\n      upload({\n        logList: logList,\n        type: REPORT_TYPE.REALTIME\n      }).then(function (response) {\n        isRealtimeUploading = false;\n        var responseText = response.responseText || '{}';\n        var conf = response.responseText || {};\n        setServerResponseOption(responseText);\n\n        if (ServerOption.isOpen) {\n          RealtimeUploadTimes = utils.isEmpty(conf) ? RealtimeUploadTimes : 1;\n          uploadRealtime();\n        }\n      })[\"catch\"](function () {\n        isRealtimeUploading = false;\n        uploadRealtime();\n      });\n    }, interval);\n  };\n\n  var uploadFull = function uploadFull(uploadTimes, option, connectedTime) {\n    if (!Option.isUploadToServer) {\n      return;\n    }\n\n    uploadTimes = uploadTimes || 0;\n    option = option || {};\n    var _option = option,\n        uri = _option.uri,\n        logId = _option.logId;\n    var isFirst = uploadTimes === 0;\n    var interval = isFirst ? 0 : getFullUploadInterval(uploadTimes);\n    var fullMaxTimes = ServerOption.fullMaxTimes,\n        fullLevel = ServerOption.fullLevel;\n    if (fullLogId === logId) return;\n\n    if (uploadTimes <= fullMaxTimes) {\n      uploadTimes++;\n    } else {\n      return;\n    }\n\n    fullLogId = logId;\n\n    (function (option) {\n      utils.setTimeout(function () {\n        var logList = LogStore.get({\n          type: REPORT_TYPE.FULL,\n          level: fullLevel,\n          fullUploadOption: option\n        });\n        if (logList.length === 0 && Number(option.endTime) < connectedTime) return;\n        upload({\n          logId: logId,\n          url: uri,\n          logList: logList,\n          type: REPORT_TYPE.FULL\n        }).then(function () {})[\"catch\"](function () {\n          uploadFull(uploadTimes, option, connectedTime);\n        });\n      }, interval);\n    })(option);\n  };\n\n  var writeLocalLog = function writeLocalLog(log) {\n    var time = log.time;\n    var formatedTime = utils.formatTime(time);\n    var localLog = LocalLogPrefix + \":\" + formatedTime + \": \" + utils.toJSON(log);\n    logEventEmitter.emit(LogEventName, localLog);\n\n    if (Option.isDebug) {\n      utils.consoleLog(localLog);\n    }\n  };\n\n  var Logger = {\n    _events: [],\n    LogStore: LogStore,\n    setOption: function setOption(option) {\n      Option = utils.extend(Option, option);\n    },\n    setServerOption: setServerOption,\n    watchLog: function watchLog(event) {\n      logEventEmitter.on(LogEventName, event);\n\n      Logger._events.push(event);\n    },\n    write: function write(log) {\n      log = log || {};\n      log.tag = log.tag || TAG.L_CRASH_F;\n      log.time = log.time || common.DelayTimer.getTime();\n      log.type = log.type || LOG_TYPE.IM;\n      LogStore.add(log);\n      writeLocalLog(log);\n    },\n    fatal: function fatal(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.FATAL\n      });\n    },\n    error: function error(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.ERROR\n      });\n    },\n    warn: function warn(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.WARN\n      });\n    },\n    info: function info(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.INFO\n      });\n    },\n    debug: function debug(tag, content) {\n      Logger.write({\n        tag: tag,\n        content: content,\n        level: LEVEL.DEBUG\n      });\n    },\n    startRealtimeUpload: function startRealtimeUpload() {\n      if (realTimeUploadHasStarted) return;\n      Option.isUploadToServer && uploadRealtime();\n      realTimeUploadHasStarted = true;\n    },\n    resetRealtimeUpload: function resetRealtimeUpload() {\n      RealtimeUploadTimes = 1;\n    },\n    uploadFull: uploadFull\n  };\n\n  var EventEmitter$2 = utils.EventEmitter,\n      DeferHandler$2 = utils.DeferHandler,\n      httpRequest = utils.httpRequest,\n      request$4 = utils.request,\n      Defer$1 = utils.Defer;\n\n  var CometTransporter = function () {\n    function CometTransporter(option) {\n      this._option = void 0;\n      this._transporterEventEmiiter = new EventEmitter$2();\n      this._deferHandler = new DeferHandler$2();\n      this._pid = utils.encodeURI(utils.getCurrentTimestamp() + Math.random() + '');\n      this._domain = void 0;\n      this._sessionid = void 0;\n      this._xhrCache = new utils.Cache();\n      this._pullSignalTimer = new utils.Timer({\n        timeout: IM_COMET_PULLMSG_TIMEOUT\n      });\n      this._isDisconnected = true;\n      this._option = option;\n    }\n\n    var _proto = CometTransporter.prototype;\n\n    _proto._startPullSignal = function _startPullSignal() {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid,\n          _transporterEventEmiiter = self._transporterEventEmiiter,\n          _pullSignalTimer = self._pullSignalTimer;\n      var timestamp = utils.getCurrentTimestamp();\n      var protocol = env.protocol.http;\n      var url = utils.tplEngine(COMET_PULL_URL_TPL, {\n        protocol: protocol,\n        timestamp: timestamp,\n        domain: _domain,\n        sessionId: _sessionid,\n        pid: _pid\n      });\n      var xhr = httpRequest({\n        url: url,\n        body: {\n          pid: _pid\n        },\n        timeout: IM_COMET_PULLMSG_TIMEOUT,\n        success: function success(responseText) {\n          _pullSignalTimer.stop();\n\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (isSuccess) {\n            !self._isDisconnected && self._startPullSignal();\n          } else if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        },\n        fail: function fail() {\n          _pullSignalTimer.stop();\n\n          if (!self._isDisconnected) {\n            _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.COMET_REQUEST_ERROR);\n          }\n\n          self._xhrCache.remove(url);\n        }\n      });\n\n      _pullSignalTimer.start(function () {\n        if (!self._isDisconnected) {\n          _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, TRANSPORTER_STATUS.PING_TIMEOUT);\n\n          self.disconnect();\n        }\n      });\n\n      self._xhrCache.set(url, xhr);\n    };\n\n    _proto.watchSignal = function watchSignal(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.SIGNAL, event);\n    };\n\n    _proto.watchStatus = function watchStatus(event) {\n      this._transporterEventEmiiter.on(TRANSPORT_EVENT.STATUS, function (status) {\n        event && event(status);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter,\n          _pid = self._pid,\n          _self$_option = self._option,\n          appkey = _self$_option.appkey,\n          connectType = _self$_option.connectType;\n      var token = user.token;\n      var domain = option.domain;\n      var url = common.getTransporterUrl({\n        domain: domain,\n        appkey: appkey,\n        token: token,\n        connectType: connectType\n      });\n      self._domain = domain;\n      self._isDisconnected = false;\n\n      var success = function success(_ref) {\n        var responseText = _ref.responseText;\n\n        if (!utils.isValidJSON(responseText)) {\n          return Defer$1.reject();\n        }\n\n        var response = utils.isObject(responseText) ? responseText : utils.parseJSON(responseText);\n        var isConnectSuccess = utils.isEqual(response.status, SUCCESS_CODE);\n\n        if (isConnectSuccess && utils.isObject(response) && utils.isValidTimestamp(response.timestamp)) {\n          common.DelayTimer.setTime(response.timestamp);\n        }\n\n        return isConnectSuccess ? Defer$1.resolve(response) : Defer$1.reject(response);\n      };\n\n      return request$4(url, {\n        body: {\n          pid: _pid\n        }\n      }).then(success).then(function (response) {\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.STATUS, CONNECTION_STATUS.CONNECTED);\n\n        self._sessionid = response.sessionid;\n\n        self._startPullSignal();\n\n        return response;\n      });\n    };\n\n    _proto.sendSignal = function sendSignal(writer) {\n      var self = this;\n      var _domain = self._domain,\n          _sessionid = self._sessionid,\n          _pid = self._pid;\n      var messageId = writer.messageId,\n          topic = writer.topic,\n          targetId = writer.targetId;\n      var headerCode = writer.getHeaderFlag();\n      var protocol = env.protocol.http;\n      var TPL = topic ? COMET_REQ_HAS_TOPIC_URL_TPL : COMET_REQ_NO_TOPIC_URL_TPL;\n      var url = utils.tplEngine(TPL, {\n        protocol: protocol,\n        messageId: messageId,\n        headerCode: headerCode,\n        topic: topic,\n        targetId: targetId,\n        pid: _pid,\n        sessionId: _sessionid,\n        domain: _domain\n      });\n      var currentTime = utils.getCurrentTimestamp() + '';\n      var xhr = httpRequest({\n        url: url,\n        method: REQUEST_METHOD.POST,\n        body: writer.getCometData(),\n        success: function success(responseText) {\n          var isSuccess = self.handleCometResponse(responseText);\n\n          if (!isSuccess) {\n            self.handleError(messageId);\n          }\n\n          self._xhrCache.remove(currentTime);\n        },\n        fail: function fail(error) {\n          self.handleError(messageId);\n\n          self._xhrCache.remove(currentTime);\n\n          Logger.error(TAG.L_CRASH_F, {\n            content: {\n              info: 'comet error',\n              error: error\n            }\n          });\n        }\n      });\n\n      self._xhrCache.set(currentTime, xhr);\n    };\n\n    _proto.handleCometResponse = function handleCometResponse(responseText) {\n      var self = this;\n      var _transporterEventEmiiter = self._transporterEventEmiiter;\n      var response = utils.isString(responseText) ? utils.parseJSON(responseText) : responseText;\n\n      if (!response) {\n        return false;\n      }\n\n      if (!response || !utils.isArray(response)) {\n        return true;\n      }\n\n      utils.forEach(response, function (data) {\n        var sessionid = data.sessionid;\n\n        if (sessionid) {\n          self._sessionid = sessionid;\n        }\n\n        var signal = readCometData(data);\n\n        _transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n\n        if (signal && utils.isValidTimestamp(signal.timestamp)) {\n          common.DelayTimer.setTime(signal.timestamp);\n        }\n      });\n      return true;\n    };\n\n    _proto.handleError = function handleError(messageId, status) {\n      var signal = {\n        messageId: messageId,\n        status: status || ERROR_CODE.TIMEOUT\n      };\n\n      this._transporterEventEmiiter.emit(TRANSPORT_EVENT.SIGNAL, signal);\n    };\n\n    _proto.disconnect = function disconnect() {\n      var self = this;\n      self._isDisconnected = true;\n      var _xhrCache = self._xhrCache,\n          _pullSignalTimer = self._pullSignalTimer;\n\n      var xhrKeys = _xhrCache.getKeys();\n\n      _pullSignalTimer.stop();\n\n      utils.forEach(xhrKeys, function (key) {\n        var xhr = _xhrCache.get(key);\n\n        xhr.abort();\n\n        _xhrCache.remove(key);\n      });\n    };\n\n    return CometTransporter;\n  }();\n\n  var Transporter = (function (option) {\n    var connectType = option.connectType;\n    var isSocket = connectType === CONNECT_TYPE.WEBSOCKET;\n    var Transporter = isSocket ? SocketTransporter : CometTransporter;\n    return new Transporter(option);\n  });\n\n  var PBName = {\n    UpStreamMessage: 'UpStreamMessage',\n    DownStreamMessage: 'DownStreamMessage',\n    DownStreamMessages: 'DownStreamMessages',\n    SessionsAttQryInput: 'SessionsAttQryInput',\n    SessionsAttOutput: 'SessionsAttOutput',\n    SyncRequestMsg: 'SyncRequestMsg',\n    ChrmPullMsg: 'ChrmPullMsg',\n    NotifyMsg: 'NotifyMsg',\n    HistoryMsgInput: 'HistoryMsgInput',\n    HistoryMsgOuput: 'HistoryMsgOuput',\n    RelationQryInput: 'RelationQryInput',\n    RelationsOutput: 'RelationsOutput',\n    DeleteSessionsInput: 'DeleteSessionsInput',\n    SessionInfo: 'SessionInfo',\n    DeleteSessionsOutput: 'DeleteSessionsOutput',\n    RelationsInput: 'RelationsInput',\n    DeleteMsgInput: 'DeleteMsgInput',\n    CleanHisMsgInput: 'CleanHisMsgInput',\n    SessionMsgReadInput: 'SessionMsgReadInput',\n    ChrmInput: 'ChrmInput',\n    QueryChatRoomInfoInput: 'QueryChatRoomInfoInput',\n    QueryChatRoomInfoOutput: 'QueryChatRoomInfoOutput',\n    RtcInput: 'RtcInput',\n    RtcUserListOutput: 'RtcUserListOutput',\n    SetUserStatusInput: 'SetUserStatusInput',\n    RtcSetDataInput: 'RtcSetDataInput',\n    RtcDataInput: 'RtcDataInput',\n    RtcSetOutDataInput: 'RtcSetOutDataInput',\n    MCFollowInput: 'MCFollowInput',\n    RtcTokenOutput: 'RtcTokenOutput',\n    RtcQryOutput: 'RtcQryOutput',\n    RtcQryUserOutDataInput: 'RtcQryUserOutDataInput',\n    RtcUserOutDataOutput: 'RtcUserOutDataOutput',\n    RtcQueryListInput: 'RtcQueryListInput',\n    RtcRoomInfoOutput: 'RtcRoomInfoOutput',\n    RtcValueInfo: 'RtcValueInfo',\n    RtcKeyDeleteInput: 'RtcKeyDeleteInput',\n    GetQNupTokenInput: 'GetQNupTokenInput',\n    GetQNupTokenOutput: 'GetQNupTokenOutput',\n    GetQNdownloadUrlInput: 'GetQNdownloadUrlInput',\n    GetQNdownloadUrlOutput: 'GetQNdownloadUrlOutput',\n    SetChrmKV: 'SetChrmKV',\n    ChrmKVOutput: 'ChrmKVOutput',\n    QueryChrmKV: 'QueryChrmKV',\n    ChrmNotifyMsg: 'ChrmNotifyMsg',\n    SetUserSettingInput: 'SetUserSettingInput',\n    SetUserSettingOutput: 'SetUserSettingOutput',\n    PullUserSettingInput: 'PullUserSettingInput',\n    PullUserSettingOutput: 'PullUserSettingOutput',\n    UserSettingNotification: 'UserSettingNotification',\n    SessionReq: 'SessionReq',\n    SessionStates: 'SessionStates',\n    SessionState: 'SessionState',\n    SessionStateItem: 'SessionStateItem',\n    SessionStateModifyReq: 'SessionStateModifyReq',\n    SessionStateModifyResp: 'SessionStateModifyResp'\n  };\n\n  var _SSMsg;\n  var SSMsg = (_SSMsg = {}, _SSMsg[PBName.UpStreamMessage] = ['sessionId', 'classname', 'content', 'pushText', 'userId', 'configFlag', 'appData'], _SSMsg[PBName.DownStreamMessages] = ['list', 'syncTime', 'finished'], _SSMsg[PBName.DownStreamMessage] = ['fromUserId', 'type', 'groupId', 'classname', 'content', 'dataTime', 'status', 'msgId'], _SSMsg[PBName.SessionsAttQryInput] = ['nothing'], _SSMsg[PBName.SessionsAttOutput] = ['inboxTime', 'sendboxTime', 'totalUnreadCount'], _SSMsg[PBName.SyncRequestMsg] = ['syncTime', 'ispolling', 'isweb', 'isPullSend', 'isKeeping', 'sendBoxSyncTime'], _SSMsg[PBName.ChrmPullMsg] = ['syncTime', 'count'], _SSMsg[PBName.NotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.HistoryMsgInput] = ['targetId', 'time', 'count', 'order'], _SSMsg[PBName.HistoryMsgOuput] = ['list', 'syncTime', 'hasMsg'], _SSMsg[PBName.RelationQryInput] = ['type', 'count', 'startTime', 'order'], _SSMsg[PBName.RelationsOutput] = ['info'], _SSMsg[PBName.DeleteSessionsInput] = ['sessions'], _SSMsg[PBName.SessionInfo] = ['type', 'channelId'], _SSMsg[PBName.DeleteSessionsOutput] = ['nothing'], _SSMsg[PBName.RelationsInput] = ['type', 'msg', 'count', 'offset', 'startTime', 'endTime'], _SSMsg[PBName.DeleteMsgInput] = ['type', 'conversationId', 'msgs'], _SSMsg[PBName.CleanHisMsgInput] = ['targetId', 'dataTime', 'conversationType'], _SSMsg[PBName.SessionMsgReadInput] = ['type', 'msgTime', 'channelId'], _SSMsg[PBName.ChrmInput] = ['nothing'], _SSMsg[PBName.QueryChatRoomInfoInput] = ['count', 'order'], _SSMsg[PBName.QueryChatRoomInfoOutput] = ['userTotalNums', 'userInfos'], _SSMsg[PBName.GetQNupTokenInput] = ['type'], _SSMsg[PBName.GetQNdownloadUrlInput] = ['type', 'key', 'fileName'], _SSMsg[PBName.GetQNupTokenOutput] = ['deadline', 'token'], _SSMsg[PBName.GetQNdownloadUrlOutput] = ['downloadUrl'], _SSMsg[PBName.SetChrmKV] = ['entry', 'bNotify', 'notification', 'type'], _SSMsg[PBName.ChrmKVOutput] = ['entries', 'bFullUpdate', 'syncTime'], _SSMsg[PBName.QueryChrmKV] = ['timestamp'], _SSMsg[PBName.ChrmNotifyMsg] = ['type', 'time', 'chrmId'], _SSMsg[PBName.SetUserSettingInput] = ['version', 'value'], _SSMsg[PBName.SetUserSettingOutput] = ['version', 'reserve'], _SSMsg[PBName.PullUserSettingInput] = ['version', 'reserve'], _SSMsg[PBName.PullUserSettingOutput] = ['items', 'version'], _SSMsg);\n\n  var Codec = {};\n  utils.forEach(SSMsg, function (paramList, name) {\n    Codec[name] = function () {};\n\n    Codec[name].prototype.data = {};\n\n    Codec[name].prototype.getData = function () {\n      return this.data;\n    };\n\n    utils.forEach(paramList, function (param) {\n      var setEventName = 'set' + utils.toUpperCase(param, 0, 1);\n\n      Codec[name].prototype[setEventName] = function (item) {\n        this.data[param] = item;\n      };\n    });\n\n    Codec[name].decode = function (data) {\n      var decodeResult = {};\n\n      if (utils.isString(data)) {\n        data = utils.parseJSON(data);\n      }\n\n      var _loop = function _loop(key) {\n        var getEventName = 'get' + utils.toUpperCase(key, 0, 1);\n        decodeResult[key] = data[key];\n\n        decodeResult[getEventName] = function () {\n          return data[key];\n        };\n      };\n\n      for (var key in data) {\n        _loop(key);\n      }\n\n      return decodeResult;\n    };\n  });\n\n  Codec.getModule = function (pbName) {\n    var modules = new Codec[pbName]();\n\n    modules.getArrayData = function () {\n      return modules.getData();\n    };\n\n    return modules;\n  };\n\n  function protobuf(a){var b=void 0,c=function(){function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c;}function b(a){return (a&&a.__isLong__)===!0}function e(a,b){var e,f,h;return b?(a>>>=0,(h=a>=0&&256>a)&&(f=d[a])?f:(e=g(a,0>(0|a)?-1:0,!0),h&&(d[a]=e),e)):(a|=0,(h=a>=-128&&128>a)&&(f=c[a])?f:(e=g(a,0>a?-1:0,!1),h&&(c[a]=e),e))}function f(a,b){if(isNaN(a)||!isFinite(a))return b?r:q;if(b){if(0>a)return r;if(a>=n)return w}else{if(-o>=a)return x;if(a+1>=o)return v}return 0>a?f(-a,b).neg():g(0|a%m,0|a/m,b)}function g(b,c,d){return new a(b,c,d)}function i(a,b,c){var d,e,g,j,k,l,m;if(0===a.length)throw Error(\"empty string\");if(\"NaN\"===a||\"Infinity\"===a||\"+Infinity\"===a||\"-Infinity\"===a)return q;if(\"number\"==typeof b?(c=b,b=!1):b=!!b,c=c||10,2>c||c>36)throw RangeError(\"radix\");if((d=a.indexOf(\"-\"))>0)throw Error(\"interior hyphen\");if(0===d)return i(a.substring(1),b,c).neg();for(e=f(h(c,8)),g=q,j=0;j<a.length;j+=8)k=Math.min(8,a.length-j),l=parseInt(a.substring(j,j+k),c),8>k?(m=f(h(c,k)),g=g.mul(m).add(f(l))):(g=g.mul(e),g=g.add(f(l)));return g.unsigned=b,g}function j(b){return b instanceof a?b:\"number\"==typeof b?f(b):\"string\"==typeof b?i(b):g(b.low,b.high,b.unsigned)}var c,d,h,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return Object.defineProperty(a.prototype,\"__isLong__\",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b,c={},d={},a.fromInt=e,a.fromNumber=f,a.fromBits=g,h=Math.pow,a.fromString=i,a.fromValue=j,k=65536,l=1<<24,m=k*k,n=m*m,o=n/2,p=e(l),q=e(0),a.ZERO=q,r=e(0,!0),a.UZERO=r,s=e(1),a.ONE=s,t=e(1,!0),a.UONE=t,u=e(-1),a.NEG_ONE=u,v=g(-1,2147483647,!1),a.MAX_VALUE=v,w=g(-1,-1,!0),a.MAX_UNSIGNED_VALUE=w,x=g(0,-2147483648,!1),a.MIN_VALUE=x,y=a.prototype,y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},y.toString=function(a){var b,c,d,e,g,i,j,k,l;if(a=a||10,2>a||a>36)throw RangeError(\"radix\");if(this.isZero())return \"0\";if(this.isNegative())return this.eq(x)?(b=f(a),c=this.div(b),d=c.mul(b).sub(this),c.toString(a)+d.toInt().toString(a)):\"-\"+this.neg().toString(a);for(e=f(h(a,6),this.unsigned),g=this,i=\"\";;){if(j=g.div(e),k=g.sub(j.mul(e)).toInt()>>>0,l=k.toString(a),g=j,g.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i;}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var a,b;if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return !this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1===(1&this.low)},y.isEven=function(){return 0===(1&this.low)},y.equals=function(a){return b(a)||(a=j(a)),this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low},y.eq=y.equals,y.notEquals=function(a){return !this.eq(a)},y.neq=y.notEquals,y.lessThan=function(a){return this.comp(a)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(a){return this.comp(a)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(a){return this.comp(a)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(a){return this.comp(a)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(a){if(b(a)||(a=j(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return !this.unsigned&&this.eq(x)?x:this.not().add(s)},y.neg=y.negate,y.add=function(a){var c,d,e,f,h,i,k,l,m,n,o,p;return b(a)||(a=j(a)),c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,h=a.high>>>16,i=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0,p+=f+l,o+=p>>>16,p&=65535,o+=e+k,n+=o>>>16,o&=65535,n+=d+i,m+=n>>>16,n&=65535,m+=c+h,m&=65535,g(o<<16|p,m<<16|n,this.unsigned)},y.subtract=function(a){return b(a)||(a=j(a)),this.add(a.neg())},y.sub=y.subtract,y.multiply=function(a){var c,d,e,h,i,k,l,m,n,o,r,s;return this.isZero()?q:(b(a)||(a=j(a)),a.isZero()?q:this.eq(x)?a.isOdd()?x:q:a.eq(x)?this.isOdd()?x:q:this.isNegative()?a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg():a.isNegative()?this.mul(a.neg()).neg():this.lt(p)&&a.lt(p)?f(this.toNumber()*a.toNumber(),this.unsigned):(c=this.high>>>16,d=65535&this.high,e=this.low>>>16,h=65535&this.low,i=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,o=0,r=0,s=0,s+=h*m,r+=s>>>16,s&=65535,r+=e*m,o+=r>>>16,r&=65535,r+=h*l,o+=r>>>16,r&=65535,o+=d*m,n+=o>>>16,o&=65535,o+=e*l,n+=o>>>16,o&=65535,o+=h*k,n+=o>>>16,o&=65535,n+=c*m+d*l+e*k+h*i,n&=65535,g(r<<16|s,n<<16|o,this.unsigned)))},y.mul=y.multiply,y.divide=function(a){var c,d,e,g,i,k,l,m;if(b(a)||(a=j(a)),a.isZero())throw Error(\"division by zero\");if(this.isZero())return this.unsigned?r:q;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return r;if(a.gt(this.shru(1)))return t;e=r;}else{if(this.eq(x))return a.eq(s)||a.eq(u)?x:a.eq(x)?s:(g=this.shr(1),c=g.div(a).shl(1),c.eq(q)?a.isNegative()?s:u:(d=this.sub(a.mul(c)),e=c.add(d.div(a))));if(a.eq(x))return this.unsigned?r:q;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();e=q;}for(d=this;d.gte(a);){for(c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),i=Math.ceil(Math.log(c)/Math.LN2),k=48>=i?1:h(2,i-48),l=f(c),m=l.mul(a);m.isNegative()||m.gt(d);)c-=k,l=f(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=s),e=e.add(l),d=d.sub(m);}return e},y.div=y.divide,y.modulo=function(a){return b(a)||(a=j(a)),this.sub(this.div(a).mul(a))},y.mod=y.modulo,y.not=function(){return g(~this.low,~this.high,this.unsigned)},y.and=function(a){return b(a)||(a=j(a)),g(this.low&a.low,this.high&a.high,this.unsigned)},y.or=function(a){return b(a)||(a=j(a)),g(this.low|a.low,this.high|a.high,this.unsigned)},y.xor=function(a){return b(a)||(a=j(a)),g(this.low^a.low,this.high^a.high,this.unsigned)},y.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):g(0,this.low<<a-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?g(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):g(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(a){var c,d;return b(a)&&(a=a.toInt()),a&=63,0===a?this:(c=this.high,32>a?(d=this.low,g(d>>>a|c<<32-a,c>>>a,this.unsigned)):32===a?g(c,0,this.unsigned):g(c>>>a-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},y.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var a=this.high,b=this.low;return [255&b,255&b>>>8,255&b>>>16,255&b>>>24,255&a,255&a>>>8,255&a>>>16,255&a>>>24]},y.toBytesBE=function(){var a=this.high,b=this.low;return [255&a>>>24,255&a>>>16,255&a>>>8,255&a,255&b>>>24,255&b>>>16,255&b>>>8,255&b]},a}(),d=function(a){function f(a){var b=0;return function(){return b<a.length?a.charCodeAt(b++):null}}function g(){var a=[],b=[];return function(){return 0===arguments.length?b.join(\"\")+e.apply(String,a):(a.length+arguments.length>1024&&(b.push(e.apply(String,a)),a.length=0),Array.prototype.push.apply(a,arguments),void 0)}}function h(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j;}return (n?-1:1)*g*Math.pow(2,f-d)}function i(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p;}var c,d,e,j,k,b=function(a,c,e){if(\"undefined\"==typeof a&&(a=b.DEFAULT_CAPACITY),\"undefined\"==typeof c&&(c=b.DEFAULT_ENDIAN),\"undefined\"==typeof e&&(e=b.DEFAULT_NOASSERT),!e){if(a=0|a,0>a)throw RangeError(\"Illegal capacity\");c=!!c,e=!!e;}this.buffer=0===a?d:new ArrayBuffer(a),this.view=0===a?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=a,this.littleEndian=c,this.noAssert=e;};return b.VERSION=\"5.0.1\",b.LITTLE_ENDIAN=!0,b.BIG_ENDIAN=!1,b.DEFAULT_CAPACITY=16,b.DEFAULT_ENDIAN=b.BIG_ENDIAN,b.DEFAULT_NOASSERT=!1,b.Long=a||null,c=b.prototype,c.__isByteBuffer__,Object.defineProperty(c,\"__isByteBuffer__\",{value:!0,enumerable:!1,configurable:!1}),d=new ArrayBuffer(0),e=String.fromCharCode,b.accessor=function(){return Uint8Array},b.allocate=function(a,c,d){return new b(a,c,d)},b.concat=function(a,c,d,e){var f,i,g,h,k,j;for((\"boolean\"==typeof c||\"string\"!=typeof c)&&(e=d,d=c,c=void 0),f=0,g=0,h=a.length;h>g;++g)b.isByteBuffer(a[g])||(a[g]=b.wrap(a[g],c)),i=a[g].limit-a[g].offset,i>0&&(f+=i);if(0===f)return new b(0,d,e);for(j=new b(f,d,e),g=0;h>g;)k=a[g++],i=k.limit-k.offset,0>=i||(j.view.set(k.view.subarray(k.offset,k.limit),j.offset),j.offset+=i);return j.limit=j.offset,j.offset=0,j},b.isByteBuffer=function(a){return (a&&a.__isByteBuffer__)===!0},b.type=function(){return ArrayBuffer},b.wrap=function(a,d,e,f){var g,h;if(\"string\"!=typeof d&&(f=e,e=d,d=void 0),\"string\"==typeof a)switch(\"undefined\"==typeof d&&(d=\"utf8\"),d){case\"base64\":return b.fromBase64(a,e);case\"hex\":return b.fromHex(a,e);case\"binary\":return b.fromBinary(a,e);case\"utf8\":return b.fromUTF8(a,e);case\"debug\":return b.fromDebug(a,e);default:throw Error(\"Unsupported encoding: \"+d)}if(null===a||\"object\"!=typeof a)throw TypeError(\"Illegal buffer\");if(b.isByteBuffer(a))return g=c.clone.call(a),g.markedOffset=-1,g;if(a instanceof Uint8Array)g=new b(0,e,f),a.length>0&&(g.buffer=a.buffer,g.offset=a.byteOffset,g.limit=a.byteOffset+a.byteLength,g.view=new Uint8Array(a.buffer));else if(a instanceof ArrayBuffer)g=new b(0,e,f),a.byteLength>0&&(g.buffer=a,g.offset=0,g.limit=a.byteLength,g.view=a.byteLength>0?new Uint8Array(a):null);else{if(\"[object Array]\"!==Object.prototype.toString.call(a))throw TypeError(\"Illegal buffer\");for(g=new b(a.length,e,f),g.limit=a.length,h=0;h<a.length;++h)g.view[h]=a[h];}return g},c.writeBitSet=function(a,b){var h,d,e,f,g,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(!(a instanceof Array))throw TypeError(\"Illegal BitSet: Not an array\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(d=b,e=a.length,f=e>>3,g=0,b+=this.writeVarint32(e,b);f--;)h=1&!!a[g++]|(1&!!a[g++])<<1|(1&!!a[g++])<<2|(1&!!a[g++])<<3|(1&!!a[g++])<<4|(1&!!a[g++])<<5|(1&!!a[g++])<<6|(1&!!a[g++])<<7,this.writeByte(h,b++);if(e>g){for(i=0,h=0;e>g;)h|=(1&!!a[g++])<<i++;this.writeByte(h,b++);}return c?(this.offset=b,this):b-d},c.readBitSet=function(a){var h,c,d,e,f,g,i,b=\"undefined\"==typeof a;for(b&&(a=this.offset),c=this.readVarint32(a),d=c.value,e=d>>3,f=0,g=[],a+=c.length;e--;)h=this.readByte(a++),g[f++]=!!(1&h),g[f++]=!!(2&h),g[f++]=!!(4&h),g[f++]=!!(8&h),g[f++]=!!(16&h),g[f++]=!!(32&h),g[f++]=!!(64&h),g[f++]=!!(128&h);if(d>f)for(i=0,h=this.readByte(a++);d>f;)g[f++]=!!(1&h>>i++);return b&&(this.offset=a),g},c.readBytes=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+a+\") <= \"+this.buffer.byteLength)}return d=this.slice(b,b+a),c&&(this.offset+=a),d},c.writeBytes=c.append,c.writeInt8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeByte=c.writeInt8,c.readInt8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],128===(128&c)&&(c=-(255-c+1)),b&&(this.offset+=1),c},c.readByte=c.readInt8,c.writeUint8=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=1,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=1,this.view[b]=a,c&&(this.offset+=1),this},c.writeUInt8=c.writeUint8,c.readUint8=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=this.view[a],b&&(this.offset+=1),c},c.readUInt8=c.readUint8,c.writeInt16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeShort=c.writeInt16,c.readInt16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),32768===(32768&c)&&(c=-(65535-c+1)),b&&(this.offset+=2),c},c.readShort=c.readInt16,c.writeUint16=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=2,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=2,this.littleEndian?(this.view[b+1]=(65280&a)>>>8,this.view[b]=255&a):(this.view[b]=(65280&a)>>>8,this.view[b+1]=255&a),c&&(this.offset+=2),this},c.writeUInt16=c.writeUint16,c.readUint16=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+2>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+2+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a],c|=this.view[a+1]<<8):(c=this.view[a]<<8,c|=this.view[a+1]),b&&(this.offset+=2),c},c.readUInt16=c.readUint16,c.writeInt32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeInt=c.writeInt32,c.readInt32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),c|=0,b&&(this.offset+=4),c},c.readInt=c.readInt32,c.writeUint32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,this.littleEndian?(this.view[b+3]=255&a>>>24,this.view[b+2]=255&a>>>16,this.view[b+1]=255&a>>>8,this.view[b]=255&a):(this.view[b]=255&a>>>24,this.view[b+1]=255&a>>>16,this.view[b+2]=255&a>>>8,this.view[b+3]=255&a),c&&(this.offset+=4),this},c.writeUInt32=c.writeUint32,c.readUint32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=0,this.littleEndian?(c=this.view[a+2]<<16,c|=this.view[a+1]<<8,c|=this.view[a],c+=this.view[a+3]<<24>>>0):(c=this.view[a+1]<<16,c|=this.view[a+2]<<8,c|=this.view[a+3],c+=this.view[a]<<24>>>0),b&&(this.offset+=4),c},c.readUInt32=c.readUint32,a&&(c.writeInt64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeLong=c.writeInt64,c.readInt64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!1),c&&(this.offset+=8),f},c.readLong=c.readInt64,c.writeUint64=function(b,c){var e,f,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"==typeof b)b=a.fromNumber(b);else if(\"string\"==typeof b)b=a.fromString(b);else if(!(b&&b instanceof a))throw TypeError(\"Illegal value: \"+b+\" (not an integer or Long)\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return \"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b)),c+=8,e=this.buffer.byteLength,c>e&&this.resize((e*=2)>c?e:c),c-=8,f=b.low,g=b.high,this.littleEndian?(this.view[c+3]=255&f>>>24,this.view[c+2]=255&f>>>16,this.view[c+1]=255&f>>>8,this.view[c]=255&f,c+=4,this.view[c+3]=255&g>>>24,this.view[c+2]=255&g>>>16,this.view[c+1]=255&g>>>8,this.view[c]=255&g):(this.view[c]=255&g>>>24,this.view[c+1]=255&g>>>16,this.view[c+2]=255&g>>>8,this.view[c+3]=255&g,c+=4,this.view[c]=255&f>>>24,this.view[c+1]=255&f>>>16,this.view[c+2]=255&f>>>8,this.view[c+3]=255&f),d&&(this.offset+=8),this},c.writeUInt64=c.writeUint64,c.readUint64=function(b){var d,e,f,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return d=0,e=0,this.littleEndian?(d=this.view[b+2]<<16,d|=this.view[b+1]<<8,d|=this.view[b],d+=this.view[b+3]<<24>>>0,b+=4,e=this.view[b+2]<<16,e|=this.view[b+1]<<8,e|=this.view[b],e+=this.view[b+3]<<24>>>0):(e=this.view[b+1]<<16,e|=this.view[b+2]<<8,e|=this.view[b+3],e+=this.view[b]<<24>>>0,b+=4,d=this.view[b+1]<<16,d|=this.view[b+2]<<8,d|=this.view[b+3],d+=this.view[b]<<24>>>0),f=new a(d,e,!0),c&&(this.offset+=8),f},c.readUInt64=c.readUint64),c.writeFloat32=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=4,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=4,i(this.view,a,b,this.littleEndian,23,4),c&&(this.offset+=4),this},c.writeFloat=c.writeFloat32,c.readFloat32=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,23,4),b&&(this.offset+=4),c},c.readFloat=c.readFloat32,c.writeFloat64=function(a,b){var d,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof a)throw TypeError(\"Illegal value: \"+a+\" (not a number)\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return b+=8,d=this.buffer.byteLength,b>d&&this.resize((d*=2)>b?d:b),b-=8,i(this.view,a,b,this.littleEndian,52,8),c&&(this.offset+=8),this},c.writeDouble=c.writeFloat64,c.readFloat64=function(a){var c,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+8>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+8+\") <= \"+this.buffer.byteLength)}return c=h(this.view,a,this.littleEndian,52,8),b&&(this.offset+=8),c},c.readDouble=c.readFloat64,b.MAX_VARINT32_BYTES=5,b.calculateVarint32=function(a){return a>>>=0,128>a?1:16384>a?2:1<<21>a?3:1<<28>a?4:5},b.zigZagEncode32=function(a){return ((a|=0)<<1^a>>31)>>>0},b.zigZagDecode32=function(a){return 0|a>>>1^-(1&a)},c.writeVarint32=function(a,c){var f,e,g,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}for(e=b.calculateVarint32(a),c+=e,g=this.buffer.byteLength,c>g&&this.resize((g*=2)>c?g:c),c-=e,a>>>=0;a>=128;)f=128|127&a,this.view[c++]=f,a>>>=7;return this.view[c++]=a,d?(this.offset=c,this):e},c.writeVarint32ZigZag=function(a,c){return this.writeVarint32(b.zigZagEncode32(a),c)},c.readVarint32=function(a){var e,c,d,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}c=0,d=0;do{if(!this.noAssert&&a>this.limit)throw f=Error(\"Truncated\"),f.truncated=!0,f;e=this.view[a++],5>c&&(d|=(127&e)<<7*c),++c;}while(0!==(128&e));return d|=0,b?(this.offset=a,d):{value:d,length:c}},c.readVarint32ZigZag=function(a){var c=this.readVarint32(a);return \"object\"==typeof c?c.value=b.zigZagDecode32(c.value):c=b.zigZagDecode32(c),c},a&&(b.MAX_VARINT64_BYTES=10,b.calculateVarint64=function(b){\"number\"==typeof b?b=a.fromNumber(b):\"string\"==typeof b&&(b=a.fromString(b));var c=b.toInt()>>>0,d=b.shiftRightUnsigned(28).toInt()>>>0,e=b.shiftRightUnsigned(56).toInt()>>>0;return 0==e?0==d?16384>c?128>c?1:2:1<<21>c?3:4:16384>d?128>d?5:6:1<<21>d?7:8:128>e?9:10},b.zigZagEncode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftLeft(1).xor(b.shiftRight(63)).toUnsigned()},b.zigZagDecode64=function(b){return \"number\"==typeof b?b=a.fromNumber(b,!1):\"string\"==typeof b?b=a.fromString(b,!1):b.unsigned!==!1&&(b=b.toSigned()),b.shiftRightUnsigned(1).xor(b.and(a.ONE).toSigned().negate()).toSigned()},c.writeVarint64=function(c,d){var f,g,h,i,j,e=\"undefined\"==typeof d;if(e&&(d=this.offset),!this.noAssert){if(\"number\"==typeof c)c=a.fromNumber(c);else if(\"string\"==typeof c)c=a.fromString(c);else if(!(c&&c instanceof a))throw TypeError(\"Illegal value: \"+c+\" (not an integer or Long)\");if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}switch(\"number\"==typeof c?c=a.fromNumber(c,!1):\"string\"==typeof c?c=a.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),f=b.calculateVarint64(c),g=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,i=c.shiftRightUnsigned(56).toInt()>>>0,d+=f,j=this.buffer.byteLength,d>j&&this.resize((j*=2)>d?j:d),d-=f,f){case 10:this.view[d+9]=1&i>>>7;case 9:this.view[d+8]=9!==f?128|i:127&i;case 8:this.view[d+7]=8!==f?128|h>>>21:127&h>>>21;case 7:this.view[d+6]=7!==f?128|h>>>14:127&h>>>14;case 6:this.view[d+5]=6!==f?128|h>>>7:127&h>>>7;case 5:this.view[d+4]=5!==f?128|h:127&h;case 4:this.view[d+3]=4!==f?128|g>>>21:127&g>>>21;case 3:this.view[d+2]=3!==f?128|g>>>14:127&g>>>14;case 2:this.view[d+1]=2!==f?128|g>>>7:127&g>>>7;case 1:this.view[d]=1!==f?128|g:127&g;}return e?(this.offset+=f,this):f},c.writeVarint64ZigZag=function(a,c){return this.writeVarint64(b.zigZagEncode64(a),c)},c.readVarint64=function(b){var d,e,f,g,h,i,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+1+\") <= \"+this.buffer.byteLength)}if(d=b,e=0,f=0,g=0,h=0,h=this.view[b++],e=127&h,128&h&&(h=this.view[b++],e|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],e|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<7,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<14,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],f|=(127&h)<<21,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g=127&h,(128&h||this.noAssert&&\"undefined\"==typeof h)&&(h=this.view[b++],g|=(127&h)<<7,128&h||this.noAssert&&\"undefined\"==typeof h))))))))))throw Error(\"Buffer overrun\");return i=a.fromBits(e|f<<28,f>>>4|g<<24,!1),c?(this.offset=b,i):{value:i,length:b-d}},c.readVarint64ZigZag=function(c){var d=this.readVarint64(c);return d&&d.value instanceof a?d.value=b.zigZagDecode64(d.value):d=b.zigZagDecode64(d),d}),c.writeCString=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),e=a.length,!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");for(d=0;e>d;++d)if(0===a.charCodeAt(d))throw RangeError(\"Illegal str: Contains NULL-characters\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=k.calculateUTF16asUTF8(f(a))[1],b+=e+1,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=e+1,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),this.view[b++]=0,c?(this.offset=b,this):e},c.readCString=function(a){var c,e,f,b=\"undefined\"==typeof a;if(b&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return c=a,f=-1,k.decodeUTF8toUTF16(function(){if(0===f)return null;if(a>=this.limit)throw RangeError(\"Illegal range: Truncated data, \"+a+\" < \"+this.limit);return f=this.view[a++],0===f?null:f}.bind(this),e=g(),!0),b?(this.offset=a,e()):{string:e(),length:a-c}},c.writeIString=function(a,b){var e,d,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(d=b,e=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],b+=4+e,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=4+e,this.littleEndian?(this.view[b+3]=255&e>>>24,this.view[b+2]=255&e>>>16,this.view[b+1]=255&e>>>8,this.view[b]=255&e):(this.view[b]=255&e>>>24,this.view[b+1]=255&e>>>16,this.view[b+2]=255&e>>>8,this.view[b+3]=255&e),b+=4,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),b!==d+4+e)throw RangeError(\"Illegal range: Truncated data, \"+b+\" == \"+(b+4+e));return c?(this.offset=b,this):b-d},c.readIString=function(a){var d,e,f,c=\"undefined\"==typeof a;\n  if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+4>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+4+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readUint32(a),f=this.readUTF8String(e,b.METRICS_BYTES,a+=4),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},b.METRICS_CHARS=\"c\",b.METRICS_BYTES=\"b\",c.writeUTF8String=function(a,b){var d,e,g,c=\"undefined\"==typeof b;if(c&&(b=this.offset),!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: \"+b+\" (not an integer)\");if(b>>>=0,0>b||b+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+b+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return e=b,d=k.calculateUTF16asUTF8(f(a))[1],b+=d,g=this.buffer.byteLength,b>g&&this.resize((g*=2)>b?g:b),b-=d,k.encodeUTF16toUTF8(f(a),function(a){this.view[b++]=a;}.bind(this)),c?(this.offset=b,this):b-e},c.writeString=c.writeUTF8String,b.calculateUTF8Chars=function(a){return k.calculateUTF16asUTF8(f(a))[0]},b.calculateUTF8Bytes=function(a){return k.calculateUTF16asUTF8(f(a))[1]},b.calculateString=b.calculateUTF8Bytes,c.readUTF8String=function(a,c,d){var e,i,f,h,j;if(\"number\"==typeof c&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),\"undefined\"==typeof c&&(c=b.METRICS_CHARS),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(f=0,h=d,c===b.METRICS_CHARS){if(i=g(),k.decodeUTF8(function(){return a>f&&d<this.limit?this.view[d++]:null}.bind(this),function(a){++f,k.UTF8toUTF16(a,i);}),f!==a)throw RangeError(\"Illegal range: Truncated data, \"+f+\" == \"+a);return e?(this.offset=d,i()):{string:i(),length:d-h}}if(c===b.METRICS_BYTES){if(!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+a>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+a+\") <= \"+this.buffer.byteLength)}if(j=d+a,k.decodeUTF8toUTF16(function(){return j>d?this.view[d++]:null}.bind(this),i=g(),this.noAssert),d!==j)throw RangeError(\"Illegal range: Truncated data, \"+d+\" == \"+j);return e?(this.offset=d,i()):{string:i(),length:d-h}}throw TypeError(\"Unsupported metrics: \"+c)},c.readString=c.readUTF8String,c.writeVString=function(a,c){var g,h,e,i,d=\"undefined\"==typeof c;if(d&&(c=this.offset),!this.noAssert){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal offset: \"+c+\" (not an integer)\");if(c>>>=0,0>c||c+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+c+\" (+\"+0+\") <= \"+this.buffer.byteLength)}if(e=c,g=k.calculateUTF16asUTF8(f(a),this.noAssert)[1],h=b.calculateVarint32(g),c+=h+g,i=this.buffer.byteLength,c>i&&this.resize((i*=2)>c?i:c),c-=h+g,c+=this.writeVarint32(g,c),k.encodeUTF16toUTF8(f(a),function(a){this.view[c++]=a;}.bind(this)),c!==e+g+h)throw RangeError(\"Illegal range: Truncated data, \"+c+\" == \"+(c+g+h));return d?(this.offset=c,this):c-e},c.readVString=function(a){var d,e,f,c=\"undefined\"==typeof a;if(c&&(a=this.offset),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+1>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+1+\") <= \"+this.buffer.byteLength)}return d=a,e=this.readVarint32(a),f=this.readUTF8String(e.value,b.METRICS_BYTES,a+=e.length),a+=f.length,c?(this.offset=a,f.string):{string:f.string,length:a-d}},c.append=function(a,c,d){var e,f,g;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(d+=f,g=this.buffer.byteLength,d>g&&this.resize((g*=2)>d?g:d),d-=f,this.view.set(a.view.subarray(a.offset,a.limit),d),a.offset+=f,e&&(this.offset+=f),this)},c.appendTo=function(a,b){return a.append(this,b),this},c.assert=function(a){return this.noAssert=!a,this},c.capacity=function(){return this.buffer.byteLength},c.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},c.clone=function(a){var c=new b(0,this.littleEndian,this.noAssert);return a?(c.buffer=new ArrayBuffer(this.buffer.byteLength),c.view=new Uint8Array(c.buffer)):(c.buffer=this.buffer,c.view=this.view),c.offset=this.offset,c.markedOffset=this.markedOffset,c.limit=this.limit,c},c.compact=function(a,b){var c,e,f;if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return 0===a&&b===this.buffer.byteLength?this:(c=b-a,0===c?(this.buffer=d,this.view=null,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=0,this):(e=new ArrayBuffer(c),f=new Uint8Array(e),f.set(this.view.subarray(a,b)),this.buffer=e,this.view=f,this.markedOffset>=0&&(this.markedOffset-=a),this.offset=0,this.limit=c,this))},c.copy=function(a,c){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>a||a>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(a===c)return new b(0,this.littleEndian,this.noAssert);var d=c-a,e=new b(d,this.littleEndian,this.noAssert);return e.offset=0,e.limit=d,e.markedOffset>=0&&(e.markedOffset-=a),this.copyTo(e,0,a,c),e},c.copyTo=function(a,c,d,e){var f,g,h;if(!this.noAssert&&!b.isByteBuffer(a))throw TypeError(\"Illegal target: Not a ByteBuffer\");if(c=(g=\"undefined\"==typeof c)?a.offset:0|c,d=(f=\"undefined\"==typeof d)?this.offset:0|d,e=\"undefined\"==typeof e?this.limit:0|e,0>c||c>a.buffer.byteLength)throw RangeError(\"Illegal target range: 0 <= \"+c+\" <= \"+a.buffer.byteLength);if(0>d||e>this.buffer.byteLength)throw RangeError(\"Illegal source range: 0 <= \"+d+\" <= \"+this.buffer.byteLength);return h=e-d,0===h?a:(a.ensureCapacity(c+h),a.view.set(this.view.subarray(d,e),c),f&&(this.offset+=h),g&&(a.offset+=h),this)},c.ensureCapacity=function(a){var b=this.buffer.byteLength;return a>b?this.resize((b*=2)>a?b:a):this},c.fill=function(a,b,c){var d=\"undefined\"==typeof b;if(d&&(b=this.offset),\"string\"==typeof a&&a.length>0&&(a=a.charCodeAt(0)),\"undefined\"==typeof b&&(b=this.offset),\"undefined\"==typeof c&&(c=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal value: \"+a+\" (not an integer)\");if(a|=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal begin: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal end: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}if(b>=c)return this;for(;c>b;)this.view[b++]=a;return d&&(this.offset=b),this},c.flip=function(){return this.limit=this.offset,this.offset=0,this},c.mark=function(a){if(a=\"undefined\"==typeof a?this.offset:a,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal offset: \"+a+\" (not an integer)\");if(a>>>=0,0>a||a+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+a+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return this.markedOffset=a,this},c.order=function(a){if(!this.noAssert&&\"boolean\"!=typeof a)throw TypeError(\"Illegal littleEndian: Not a boolean\");return this.littleEndian=!!a,this},c.LE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!!a:!0,this},c.BE=function(a){return this.littleEndian=\"undefined\"!=typeof a?!a:!1,this},c.prepend=function(a,c,d){var e,f,g,h,i;if((\"number\"==typeof c||\"string\"!=typeof c)&&(d=c,c=void 0),e=\"undefined\"==typeof d,e&&(d=this.offset),!this.noAssert){if(\"number\"!=typeof d||0!==d%1)throw TypeError(\"Illegal offset: \"+d+\" (not an integer)\");if(d>>>=0,0>d||d+0>this.buffer.byteLength)throw RangeError(\"Illegal offset: 0 <= \"+d+\" (+\"+0+\") <= \"+this.buffer.byteLength)}return a instanceof b||(a=b.wrap(a,c)),f=a.limit-a.offset,0>=f?this:(g=f-d,g>0?(h=new ArrayBuffer(this.buffer.byteLength+g),i=new Uint8Array(h),i.set(this.view.subarray(d,this.buffer.byteLength),f),this.buffer=h,this.view=i,this.offset+=g,this.markedOffset>=0&&(this.markedOffset+=g),this.limit+=g,d+=g):new Uint8Array(this.buffer),this.view.set(a.view.subarray(a.offset,a.limit),d-f),a.offset=a.limit,e&&(this.offset-=f),this)},c.prependTo=function(a,b){return a.prepend(this,b),this},c.printDebug=function(a){\"function\"!=typeof a&&(a=console.log.bind(console)),a(this.toString()+\"\\n-------------------------------------------------------------------\\n\"+this.toDebug(!0));},c.remaining=function(){return this.limit-this.offset},c.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},c.resize=function(a){var b,c;if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal capacity: \"+a+\" (not an integer)\");if(a|=0,0>a)throw RangeError(\"Illegal capacity: 0 <= \"+a)}return this.buffer.byteLength<a&&(b=new ArrayBuffer(a),c=new Uint8Array(b),c.set(this.view),this.buffer=b,this.view=c),this},c.reverse=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}return a===b?this:(Array.prototype.reverse.call(this.view.subarray(a,b)),this)},c.skip=function(a){if(!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal length: \"+a+\" (not an integer)\");a|=0;}var b=this.offset+a;if(!this.noAssert&&(0>b||b>this.buffer.byteLength))throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+a+\" <= \"+this.buffer.byteLength);return this.offset=b,this},c.slice=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c=this.clone();return c.offset=a,c.limit=b,c},c.toBuffer=function(a){var e,b=this.offset,c=this.limit;if(!this.noAssert){if(\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal offset: Not an integer\");if(b>>>=0,\"number\"!=typeof c||0!==c%1)throw TypeError(\"Illegal limit: Not an integer\");if(c>>>=0,0>b||b>c||c>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+b+\" <= \"+c+\" <= \"+this.buffer.byteLength)}return a||0!==b||c!==this.buffer.byteLength?b===c?d:(e=new ArrayBuffer(c-b),new Uint8Array(e).set(new Uint8Array(this.buffer).subarray(b,c),0),e):this.buffer},c.toArrayBuffer=c.toBuffer,c.toString=function(a,b,c){if(\"undefined\"==typeof a)return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";switch(\"number\"==typeof a&&(a=\"utf8\",b=a,c=b),a){case\"utf8\":return this.toUTF8(b,c);case\"base64\":return this.toBase64(b,c);case\"hex\":return this.toHex(b,c);case\"binary\":return this.toBinary(b,c);case\"debug\":return this.toDebug();case\"columns\":return this.toColumns();default:throw Error(\"Unsupported encoding: \"+a)}},j=function(){var d,e,a={},b=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],c=[];for(d=0,e=b.length;e>d;++d)c[b[d]]=d;return a.encode=function(a,c){for(var d,e;null!==(d=a());)c(b[63&d>>2]),e=(3&d)<<4,null!==(d=a())?(e|=15&d>>4,c(b[63&(e|15&d>>4)]),e=(15&d)<<2,null!==(d=a())?(c(b[63&(e|3&d>>6)]),c(b[63&d])):(c(b[63&e]),c(61))):(c(b[63&e]),c(61),c(61));},a.decode=function(a,b){function g(a){throw Error(\"Illegal character code: \"+a)}for(var d,e,f;null!==(d=a());)if(e=c[d],\"undefined\"==typeof e&&g(d),null!==(d=a())&&(f=c[d],\"undefined\"==typeof f&&g(d),b(e<<2>>>0|(48&f)>>4),null!==(d=a()))){if(e=c[d],\"undefined\"==typeof e){if(61===d)break;g(d);}if(b((15&f)<<4>>>0|(60&e)>>2),null!==(d=a())){if(f=c[d],\"undefined\"==typeof f){if(61===d)break;g(d);}b((3&e)<<6>>>0|f);}}},a.test=function(a){return /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.test(a)},a}(),c.toBase64=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a=0|a,b=0|b,0>a||b>this.capacity||a>b)throw RangeError(\"begin, end\");var c;return j.encode(function(){return b>a?this.view[a++]:null}.bind(this),c=g()),c()},b.fromBase64=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");var d=new b(3*(a.length/4),c),e=0;return j.decode(f(a),function(a){d.view[e++]=a;}),d.limit=e,d},b.btoa=function(a){return b.fromBinary(a).toBase64()},b.atob=function(a){return b.fromBase64(a).toBinary()},c.toBinary=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),a|=0,b|=0,0>a||b>this.capacity()||a>b)throw RangeError(\"begin, end\");if(a===b)return \"\";for(var c=[],d=[];b>a;)c.push(this.view[a++]),c.length>=1024&&(d.push(String.fromCharCode.apply(String,c)),c=[]);return d.join(\"\")+String.fromCharCode.apply(String,c)},b.fromBinary=function(a,c){if(\"string\"!=typeof a)throw TypeError(\"str\");for(var f,d=0,e=a.length,g=new b(e,c);e>d;){if(f=a.charCodeAt(d),f>255)throw RangeError(\"illegal char code: \"+f);g.view[d++]=f;}return g.limit=e,g},c.toDebug=function(a){for(var d,b=-1,c=this.buffer.byteLength,e=\"\",f=\"\",g=\"\";c>b;){if(-1!==b&&(d=this.view[b],e+=16>d?\"0\"+d.toString(16).toUpperCase():d.toString(16).toUpperCase(),a&&(f+=d>32&&127>d?String.fromCharCode(d):\".\")),++b,a&&b>0&&0===b%16&&b!==c){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\",e=f=\"\";}e+=b===this.offset&&b===this.limit?b===this.markedOffset?\"!\":\"|\":b===this.offset?b===this.markedOffset?\"[\":\"<\":b===this.limit?b===this.markedOffset?\"]\":\">\":b===this.markedOffset?\"'\":a||0!==b&&b!==c?\" \":\"\";}if(a&&\" \"!==e){for(;e.length<51;)e+=\" \";g+=e+f+\"\\n\";}return a?g:e},b.fromDebug=function(a,c,d){for(var i,j,e=a.length,f=new b(0|(e+1)/3,c,d),g=0,h=0,k=!1,l=!1,m=!1,n=!1,o=!1;e>g;){switch(i=a.charAt(g++)){case\"!\":if(!d){if(l||m||n){o=!0;break}l=m=n=!0;}f.offset=f.markedOffset=f.limit=h,k=!1;break;case\"|\":if(!d){if(l||n){o=!0;break}l=n=!0;}f.offset=f.limit=h,k=!1;break;case\"[\":if(!d){if(l||m){o=!0;break}l=m=!0;}f.offset=f.markedOffset=h,k=!1;break;case\"<\":if(!d){if(l){o=!0;break}l=!0;}f.offset=h,k=!1;break;case\"]\":if(!d){if(n||m){o=!0;break}n=m=!0;}f.limit=f.markedOffset=h,k=!1;break;case\">\":if(!d){if(n){o=!0;break}n=!0;}f.limit=h,k=!1;break;case\"'\":if(!d){if(m){o=!0;break}m=!0;}f.markedOffset=h,k=!1;break;case\" \":k=!1;break;default:if(!d&&k){o=!0;break}if(j=parseInt(i+a.charAt(g++),16),!d&&(isNaN(j)||0>j||j>255))throw TypeError(\"Illegal str: Not a debug encoded string\");f.view[h++]=j,k=!0;}if(o)throw TypeError(\"Illegal str: Invalid symbol at \"+g)}if(!d){if(!l||!n)throw TypeError(\"Illegal str: Missing offset or limit\");if(h<f.buffer.byteLength)throw TypeError(\"Illegal str: Not a debug encoded string (is it hex?) \"+h+\" < \"+e)}return f},c.toHex=function(a,b){if(a=\"undefined\"==typeof a?this.offset:a,b=\"undefined\"==typeof b?this.limit:b,!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}for(var d,c=new Array(b-a);b>a;)d=this.view[a++],16>d?c.push(\"0\",d.toString(16)):c.push(d.toString(16));return c.join(\"\")},b.fromHex=function(a,c,d){var g,e,f,h,i;if(!d){if(\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");if(0!==a.length%2)throw TypeError(\"Illegal str: Length not a multiple of 2\")}for(e=a.length,f=new b(0|e/2,c),h=0,i=0;e>h;h+=2){if(g=parseInt(a.substring(h,h+2),16),!d&&(!isFinite(g)||0>g||g>255))throw TypeError(\"Illegal str: Contains non-hex characters\");f.view[i++]=g;}return f.limit=i,f},k=function(){var a={};return a.MAX_CODEPOINT=1114111,a.encodeUTF8=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)128>c?b(127&c):2048>c?(b(192|31&c>>6),b(128|63&c)):65536>c?(b(224|15&c>>12),b(128|63&c>>6),b(128|63&c)):(b(240|7&c>>18),b(128|63&c>>12),b(128|63&c>>6),b(128|63&c)),c=null;},a.decodeUTF8=function(a,b){for(var c,d,e,f,g=function(a){a=a.slice(0,a.indexOf(null));var b=Error(a.toString());throw b.name=\"TruncatedError\",b.bytes=a,b};null!==(c=a());)if(0===(128&c))b(c);else if(192===(224&c))null===(d=a())&&g([c,d]),b((31&c)<<6|63&d);else if(224===(240&c))(null===(d=a())||null===(e=a()))&&g([c,d,e]),b((15&c)<<12|(63&d)<<6|63&e);else{if(240!==(248&c))throw RangeError(\"Illegal starting byte: \"+c);(null===(d=a())||null===(e=a())||null===(f=a()))&&g([c,d,e,f]),b((7&c)<<18|(63&d)<<12|(63&e)<<6|63&f);}},a.UTF16toUTF8=function(a,b){for(var c,d=null;;){if(null===(c=null!==d?d:a()))break;c>=55296&&57343>=c&&null!==(d=a())&&d>=56320&&57343>=d?(b(1024*(c-55296)+d-56320+65536),d=null):b(c);}null!==d&&b(d);},a.UTF8toUTF16=function(a,b){var c=null;for(\"number\"==typeof a&&(c=a,a=function(){return null});null!==c||null!==(c=a());)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)),c=null;},a.encodeUTF16toUTF8=function(b,c){a.UTF16toUTF8(b,function(b){a.encodeUTF8(b,c);});},a.decodeUTF8toUTF16=function(b,c){a.decodeUTF8(b,function(b){a.UTF8toUTF16(b,c);});},a.calculateCodePoint=function(a){return 128>a?1:2048>a?2:65536>a?3:4},a.calculateUTF8=function(a){for(var b,c=0;null!==(b=a());)c+=128>b?1:2048>b?2:65536>b?3:4;return c},a.calculateUTF16asUTF8=function(b){var c=0,d=0;return a.UTF16toUTF8(b,function(a){++c,d+=128>a?1:2048>a?2:65536>a?3:4;}),[c,d]},a}(),c.toUTF8=function(a,b){if(\"undefined\"==typeof a&&(a=this.offset),\"undefined\"==typeof b&&(b=this.limit),!this.noAssert){if(\"number\"!=typeof a||0!==a%1)throw TypeError(\"Illegal begin: Not an integer\");if(a>>>=0,\"number\"!=typeof b||0!==b%1)throw TypeError(\"Illegal end: Not an integer\");if(b>>>=0,0>a||a>b||b>this.buffer.byteLength)throw RangeError(\"Illegal range: 0 <= \"+a+\" <= \"+b+\" <= \"+this.buffer.byteLength)}var c;try{k.decodeUTF8toUTF16(function(){return b>a?this.view[a++]:null}.bind(this),c=g());}catch(d){if(a!==b)throw RangeError(\"Illegal range: Truncated data, \"+a+\" != \"+b)}return c()},b.fromUTF8=function(a,c,d){if(!d&&\"string\"!=typeof a)throw TypeError(\"Illegal str: Not a string\");var e=new b(k.calculateUTF16asUTF8(f(a),!0)[1],c,d),g=0;return k.encodeUTF16toUTF8(f(a),function(a){e.view[g++]=a;}),e.limit=g,e},b}(c),e=function(b,c){var f,h,i,e={};return e.ByteBuffer=b,e.c=b,f=b,e.Long=c||null,e.VERSION=\"5.0.1\",e.WIRE_TYPES={},e.WIRE_TYPES.VARINT=0,e.WIRE_TYPES.BITS64=1,e.WIRE_TYPES.LDELIM=2,e.WIRE_TYPES.STARTGROUP=3,e.WIRE_TYPES.ENDGROUP=4,e.WIRE_TYPES.BITS32=5,e.PACKABLE_WIRE_TYPES=[e.WIRE_TYPES.VARINT,e.WIRE_TYPES.BITS64,e.WIRE_TYPES.BITS32],e.TYPES={int32:{name:\"int32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:\"uint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:\"sint32\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:\"int64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},uint64:{name:\"uint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.UZERO:void 0},sint64:{name:\"sint64\",wireType:e.WIRE_TYPES.VARINT,defaultValue:e.Long?e.Long.ZERO:void 0},bool:{name:\"bool\",wireType:e.WIRE_TYPES.VARINT,defaultValue:!1},\"double\":{name:\"double\",wireType:e.WIRE_TYPES.BITS64,defaultValue:0},string:{name:\"string\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:\"\"},bytes:{name:\"bytes\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:\"fixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:\"sfixed32\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:\"fixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.UZERO:void 0},sfixed64:{name:\"sfixed64\",wireType:e.WIRE_TYPES.BITS64,defaultValue:e.Long?e.Long.ZERO:void 0},\"float\":{name:\"float\",wireType:e.WIRE_TYPES.BITS32,defaultValue:0},\"enum\":{name:\"enum\",wireType:e.WIRE_TYPES.VARINT,defaultValue:0},message:{name:\"message\",wireType:e.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:\"group\",wireType:e.WIRE_TYPES.STARTGROUP,defaultValue:null}},e.MAP_KEY_TYPES=[e.TYPES.int32,e.TYPES.sint32,e.TYPES.sfixed32,e.TYPES.uint32,e.TYPES.fixed32,e.TYPES.int64,e.TYPES.sint64,e.TYPES.sfixed64,e.TYPES.uint64,e.TYPES.fixed64,e.TYPES.bool,e.TYPES.string,e.TYPES.bytes],e.ID_MIN=1,e.ID_MAX=536870911,e.convertFieldsToCamelCase=!1,e.populateAccessors=!0,e.populateDefaults=!0,e.Util=function(){var a={};return a.IS_NODE=!(\"object\"!=typeof process||\"[object process]\"!=process+\"\"||process.browser),a.XHR=function(){var c,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Msxml3.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")}],b=null;for(c=0;c<a.length;c++){try{b=a[c]();}catch(d){continue}break}if(!b)throw Error(\"XMLHttpRequest is not supported\");return b},a.fetch=function(b,c){if(c&&\"function\"!=typeof c&&(c=null),a.IS_NODE)if(c)g.readFile(b,function(a,b){a?c(null):c(\"\"+b);});else try{return g.readFileSync(b)}catch(d){return null}else{var e=a.XHR();if(e.open(\"GET\",b,c?!0:!1),e.setRequestHeader(\"Accept\",\"text/plain\"),\"function\"==typeof e.overrideMimeType&&e.overrideMimeType(\"text/plain\"),!c)return e.send(null),200==e.status||0==e.status&&\"string\"==typeof e.responseText?e.responseText:null;if(e.onreadystatechange=function(){4==e.readyState&&(200==e.status||0==e.status&&\"string\"==typeof e.responseText?c(e.responseText):c(null));},4==e.readyState)return;e.send(null);}},a.toCamelCase=function(a){return a.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},a}(),e.Lang={DELIM:/[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\\s/,STRING:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,STRING_DQ:/(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,STRING_SQ:/(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g},e.DotProto=function(a,b){function h(a,c){var d=-1,e=1;if(\"-\"==a.charAt(0)&&(e=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))d=parseInt(a);else if(b.NUMBER_HEX.test(a))d=parseInt(a.substring(2),16);else{if(!b.NUMBER_OCT.test(a))throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);d=parseInt(a.substring(1),8);}if(d=0|e*d,!c&&0>d)throw Error(\"illegal id value: \"+(0>e?\"-\":\"\")+a);return d}function i(a){var c=1;if(\"-\"==a.charAt(0)&&(c=-1,a=a.substring(1)),b.NUMBER_DEC.test(a))return c*parseInt(a,10);if(b.NUMBER_HEX.test(a))return c*parseInt(a.substring(2),16);if(b.NUMBER_OCT.test(a))return c*parseInt(a.substring(1),8);if(\"inf\"===a)return 1/0*c;if(\"nan\"===a)return 0/0;if(b.NUMBER_FLT.test(a))return c*parseFloat(a);throw Error(\"illegal number value: \"+(0>c?\"-\":\"\")+a)}function j(a,b,c){\"undefined\"==typeof a[b]?a[b]=c:(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(c));}var f,g,c={},d=function(a){this.source=a+\"\",this.index=0,this.line=1,this.stack=[],this._stringOpen=null;},e=d.prototype;return e._readString=function(){var c,a='\"'===this._stringOpen?b.STRING_DQ:b.STRING_SQ;if(a.lastIndex=this.index-1,c=a.exec(this.source),!c)throw Error(\"unterminated string\");return this.index=a.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,c[1]},e.next=function(){var a,c,d,e,f,g;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(a=!1;b.WHITESPACE.test(d=this.source.charAt(this.index));)if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;if(\"/\"===this.source.charAt(this.index))if(++this.index,\"/\"===this.source.charAt(this.index)){for(;\"\\n\"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,a=!0;}else{if(\"*\"!==(d=this.source.charAt(this.index)))return \"/\";do{if(\"\\n\"===d&&++this.line,++this.index===this.source.length)return null;c=d,d=this.source.charAt(this.index);}while(\"*\"!==c||\"/\"!==d);++this.index,a=!0;}}while(a);if(this.index===this.source.length)return null;if(e=this.index,b.DELIM.lastIndex=0,f=b.DELIM.test(this.source.charAt(e++)),!f)for(;e<this.source.length&&!b.DELIM.test(this.source.charAt(e));)++e;return g=this.source.substring(this.index,this.index=e),('\"'===g||\"'\"===g)&&(this._stringOpen=g),g},e.peek=function(){if(0===this.stack.length){var a=this.next();if(null===a)return null;this.stack.push(a);}return this.stack[0]},e.skip=function(a){var b=this.next();if(b!==a)throw Error(\"illegal '\"+b+\"', '\"+a+\"' expected\")},e.omit=function(a){return this.peek()===a?(this.next(),!0):!1},e.toString=function(){return \"Tokenizer (\"+this.index+\"/\"+this.source.length+\" at line \"+this.line+\")\"},c.Tokenizer=d,f=function(a){this.tn=new d(a),this.proto3=!1;},g=f.prototype,g.parse=function(){var c,a={name:\"[ROOT]\",\"package\":null,messages:[],enums:[],imports:[],options:{},services:[]},d=!0;try{for(;c=this.tn.next();)switch(c){case\"package\":if(!d||null!==a[\"package\"])throw Error(\"unexpected 'package'\");if(c=this.tn.next(),!b.TYPEREF.test(c))throw Error(\"illegal package name: \"+c);this.tn.skip(\";\"),a[\"package\"]=c;break;case\"import\":if(!d)throw Error(\"unexpected 'import'\");c=this.tn.peek(),\"public\"===c&&this.tn.next(),c=this._readString(),this.tn.skip(\";\"),a.imports.push(c);break;case\"syntax\":if(!d)throw Error(\"unexpected 'syntax'\");this.tn.skip(\"=\"),\"proto3\"===(a.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(\";\");break;case\"message\":this._parseMessage(a,null),d=!1;break;case\"enum\":this._parseEnum(a),d=!1;break;case\"option\":this._parseOption(a);break;case\"service\":this._parseService(a);break;case\"extend\":this._parseExtend(a);break;default:throw Error(\"unexpected '\"+c+\"'\")}}catch(e){throw e.message=\"Parse error at line \"+this.tn.line+\": \"+e.message,e}return delete a.name,a},f.parse=function(a){return new f(a).parse()},g._readString=function(){var b,c,a=\"\";do{if(c=this.tn.next(),\"'\"!==c&&'\"'!==c)throw Error(\"illegal string delimiter: \"+c);a+=this.tn.next(),this.tn.skip(c),b=this.tn.peek();}while('\"'===b||'\"'===b);return a},g._readValue=function(a){var c=this.tn.peek();if('\"'===c||\"'\"===c)return this._readString();if(this.tn.next(),b.NUMBER.test(c))return i(c);if(b.BOOL.test(c))return \"true\"===c.toLowerCase();if(a&&b.TYPEREF.test(c))return c;throw Error(\"illegal value: \"+c)},g._parseOption=function(a,c){var f,d=this.tn.next(),e=!1;if(\"(\"===d&&(e=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal option name: \"+d);f=d,e&&(this.tn.skip(\")\"),f=\"(\"+f+\")\",d=this.tn.peek(),b.FQTYPEREF.test(d)&&(f+=d,this.tn.next())),this.tn.skip(\"=\"),this._parseOptionValue(a,f),c||this.tn.skip(\";\");},g._parseOptionValue=function(a,c){var d=this.tn.peek();if(\"{\"!==d)j(a.options,c,this._readValue(!0));else for(this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());){if(!b.NAME.test(d))throw Error(\"illegal option name: \"+c+\".\"+d);this.tn.omit(\":\")?j(a.options,c+\".\"+d,this._readValue(!0)):this._parseOptionValue(a,c+\".\"+d);}},g._parseService=function(a){var d,e,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal service name at line \"+this.tn.line+\": \"+c);for(d=c,e={name:d,rpc:{},options:{}},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(\"option\"===c)this._parseOption(e);else{if(\"rpc\"!==c)throw Error(\"illegal service token: \"+c);this._parseServiceRPC(e);}this.tn.omit(\";\"),a.services.push(e);},g._parseServiceRPC=function(a){var e,f,c=\"rpc\",d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal rpc service method name: \"+d);if(e=d,f={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.request_stream=!0,d=this.tn.next()),!b.TYPEREF.test(d))throw Error(\"illegal rpc service request type: \"+d);if(f.request=d,this.tn.skip(\")\"),d=this.tn.next(),\"returns\"!==d.toLowerCase())throw Error(\"illegal rpc service request type delimiter: \"+d);if(this.tn.skip(\"(\"),d=this.tn.next(),\"stream\"===d.toLowerCase()&&(f.response_stream=!0,d=this.tn.next()),f.response=d,this.tn.skip(\")\"),d=this.tn.peek(),\"{\"===d){for(this.tn.next();\"}\"!==(d=this.tn.next());){if(\"option\"!==d)throw Error(\"illegal rpc service token: \"+d);this._parseOption(f);}this.tn.omit(\";\");}else this.tn.skip(\";\");\"undefined\"==typeof a[c]&&(a[c]={}),a[c][e]=f;},g._parseMessage=function(a,c){var d=!!c,e=this.tn.next(),f={name:\"\",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!b.NAME.test(e))throw Error(\"illegal \"+(d?\"group\":\"message\")+\" name: \"+e);for(f.name=e,d&&(this.tn.skip(\"=\"),c.id=h(this.tn.next()),f.isGroup=!0),e=this.tn.peek(),\"[\"===e&&c&&this._parseFieldOptions(c),this.tn.skip(\"{\");\"}\"!==(e=this.tn.next());)if(b.RULE.test(e))this._parseMessageField(f,e);else if(\"oneof\"===e)this._parseMessageOneOf(f);else if(\"enum\"===e)this._parseEnum(f);else if(\"message\"===e)this._parseMessage(f);else if(\"option\"===e)this._parseOption(f);else if(\"service\"===e)this._parseService(f);else if(\"extensions\"===e)f.extensions=this._parseExtensionRanges();else if(\"reserved\"===e)this._parseIgnored();else if(\"extend\"===e)this._parseExtend(f);else{if(!b.TYPEREF.test(e))throw Error(\"illegal message token: \"+e);if(!this.proto3)throw Error(\"illegal field rule: \"+e);this._parseMessageField(f,\"optional\",e);}return this.tn.omit(\";\"),a.messages.push(f),f},g._parseIgnored=function(){for(;\";\"!==this.tn.peek();)this.tn.next();this.tn.skip(\";\");},g._parseMessageField=function(a,c,d){var e,f,g;if(!b.RULE.test(c))throw Error(\"illegal message field rule: \"+c);if(e={rule:c,type:\"\",name:\"\",options:{},id:0},\"map\"===c){if(d)throw Error(\"illegal type: \"+d);if(this.tn.skip(\"<\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field type: \"+f);if(e.keytype=f,this.tn.skip(\",\"),f=this.tn.next(),!b.TYPE.test(f)&&!b.TYPEREF.test(f))throw Error(\"illegal message field: \"+f);if(e.type=f,this.tn.skip(\">\"),f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}else if(d=\"undefined\"!=typeof d?d:this.tn.next(),\"group\"===d){if(g=this._parseMessage(a,e),!/^[A-Z]/.test(g.name))throw Error(\"illegal group name: \"+g.name);e.type=g.name,e.name=g.name.toLowerCase(),this.tn.omit(\";\");}else{if(!b.TYPE.test(d)&&!b.TYPEREF.test(d))throw Error(\"illegal message field type: \"+d);if(e.type=d,f=this.tn.next(),!b.NAME.test(f))throw Error(\"illegal message field name: \"+f);\n  e.name=f,this.tn.skip(\"=\"),e.id=h(this.tn.next()),f=this.tn.peek(),\"[\"===f&&this._parseFieldOptions(e),this.tn.skip(\";\");}return a.fields.push(e),e},g._parseMessageOneOf=function(a){var e,d,f,c=this.tn.next();if(!b.NAME.test(c))throw Error(\"illegal oneof name: \"+c);for(d=c,f=[],this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)e=this._parseMessageField(a,\"optional\",c),e.oneof=d,f.push(e.id);this.tn.omit(\";\"),a.oneofs[d]=f;},g._parseFieldOptions=function(a){this.tn.skip(\"[\");for(var b,c=!0;\"]\"!==(b=this.tn.peek());)c||this.tn.skip(\",\"),this._parseOption(a,!0),c=!1;this.tn.next();},g._parseEnum=function(a){var e,c={name:\"\",values:[],options:{}},d=this.tn.next();if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);for(c.name=d,this.tn.skip(\"{\");\"}\"!==(d=this.tn.next());)if(\"option\"===d)this._parseOption(c);else{if(!b.NAME.test(d))throw Error(\"illegal name: \"+d);this.tn.skip(\"=\"),e={name:d,id:h(this.tn.next(),!0)},d=this.tn.peek(),\"[\"===d&&this._parseFieldOptions({options:{}}),this.tn.skip(\";\"),c.values.push(e);}this.tn.omit(\";\"),a.enums.push(c);},g._parseExtensionRanges=function(){var c,d,e,b=[];do{for(d=[];;){switch(c=this.tn.next()){case\"min\":e=a.ID_MIN;break;case\"max\":e=a.ID_MAX;break;default:e=i(c);}if(d.push(e),2===d.length)break;if(\"to\"!==this.tn.peek()){d.push(e);break}this.tn.next();}b.push(d);}while(this.tn.omit(\",\"));return this.tn.skip(\";\"),b},g._parseExtend=function(a){var d,c=this.tn.next();if(!b.TYPEREF.test(c))throw Error(\"illegal extend reference: \"+c);for(d={ref:c,fields:[]},this.tn.skip(\"{\");\"}\"!==(c=this.tn.next());)if(b.RULE.test(c))this._parseMessageField(d,c);else{if(!b.TYPEREF.test(c))throw Error(\"illegal extend token: \"+c);if(!this.proto3)throw Error(\"illegal field rule: \"+c);this._parseMessageField(d,\"optional\",c);}return this.tn.omit(\";\"),a.messages.push(d),d},g.toString=function(){return \"Parser at line \"+this.tn.line},c.Parser=f,c}(e,e.Lang),e.Reflect=function(a){function k(b){if(\"string\"==typeof b&&(b=a.TYPES[b]),\"undefined\"==typeof b.defaultValue)throw Error(\"default value for type \"+b.name+\" is not supported\");return b==a.TYPES.bytes?new f(0):b.defaultValue}function l(b,c){if(b&&\"number\"==typeof b.low&&\"number\"==typeof b.high&&\"boolean\"==typeof b.unsigned&&b.low===b.low&&b.high===b.high)return new a.Long(b.low,b.high,\"undefined\"==typeof c?b.unsigned:c);if(\"string\"==typeof b)return a.Long.fromString(b,c||!1,10);if(\"number\"==typeof b)return a.Long.fromNumber(b,c||!1);throw Error(\"not convertible to Long\")}function o(b,c){var d=c.readVarint32(),e=7&d,f=d>>>3;switch(e){case a.WIRE_TYPES.VARINT:do d=c.readUint8();while(128===(128&d));break;case a.WIRE_TYPES.BITS64:c.offset+=8;break;case a.WIRE_TYPES.LDELIM:d=c.readVarint32(),c.offset+=d;break;case a.WIRE_TYPES.STARTGROUP:o(f,c);break;case a.WIRE_TYPES.ENDGROUP:if(f===b)return !1;throw Error(\"Illegal GROUPEND after unknown group: \"+f+\" (\"+b+\" expected)\");case a.WIRE_TYPES.BITS32:c.offset+=4;break;default:throw Error(\"Illegal wire type in unknown group \"+b+\": \"+e)}return !0}var g,h,i,j,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,c={},d=function(a,b,c){this.builder=a,this.parent=b,this.name=c,this.className;},e=d.prototype;return e.fqn=function(){for(var a=this.name,b=this;;){if(b=b.parent,null==b)break;a=b.name+\".\"+a;}return a},e.toString=function(a){return (a?this.className+\" \":\"\")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+\" cannot be built directly\")},c.T=d,g=function(a,b,c,e,f){d.call(this,a,b,c),this.className=\"Namespace\",this.children=[],this.options=e||{},this.syntax=f||\"proto2\";},h=g.prototype=Object.create(d.prototype),h.getChildren=function(a){var b,c,d;if(a=a||null,null==a)return this.children.slice();for(b=[],c=0,d=this.children.length;d>c;++c)this.children[c]instanceof a&&b.push(this.children[c]);return b},h.addChild=function(a){var b;if(b=this.getChild(a.name))if(b instanceof m.Field&&b.name!==b.originalName&&null===this.getChild(b.originalName))b.name=b.originalName;else{if(!(a instanceof m.Field&&a.name!==a.originalName&&null===this.getChild(a.originalName)))throw Error(\"Duplicate name in namespace \"+this.toString(!0)+\": \"+a.name);a.name=a.originalName;}this.children.push(a);},h.getChild=function(a){var c,d,b=\"number\"==typeof a?\"id\":\"name\";for(c=0,d=this.children.length;d>c;++c)if(this.children[c][b]===a)return this.children[c];return null},h.resolve=function(a,b){var g,d=\"string\"==typeof a?a.split(\".\"):a,e=this,f=0;if(\"\"===d[f]){for(;null!==e.parent;)e=e.parent;f++;}do{do{if(!(e instanceof c.Namespace)){e=null;break}if(g=e.getChild(d[f]),!(g&&g instanceof c.T&&(!b||g instanceof c.Namespace))){e=null;break}e=g,f++;}while(f<d.length);if(null!=e)break;if(null!==this.parent)return this.parent.resolve(a,b)}while(null!=e);return e},h.qn=function(a){var e,f,b=[],d=a;do b.unshift(d.name),d=d.parent;while(null!==d);for(e=1;e<=b.length;e++)if(f=b.slice(b.length-e),a===this.resolve(f,a instanceof c.Namespace))return f.join(\".\");return a.fqn()},h.build=function(){var e,c,d,a={},b=this.children;for(c=0,d=b.length;d>c;++c)e=b[c],e instanceof g&&(a[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(a,\"$options\",{value:this.buildOpt()}),a},h.buildOpt=function(){var c,d,e,f,a={},b=Object.keys(this.options);for(c=0,d=b.length;d>c;++c)e=b[c],f=this.options[b[c]],a[e]=f;return a},h.getOption=function(a){return \"undefined\"==typeof a?this.options:\"undefined\"!=typeof this.options[a]?this.options[a]:null},c.Namespace=g,i=function(b,c,d,e){if(this.type=b,this.resolvedType=c,this.isMapKey=d,this.syntax=e,d&&a.MAP_KEY_TYPES.indexOf(b)<0)throw Error(\"Invalid map key type: \"+b.name)},j=i.prototype,i.defaultFieldValue=k,j.verifyValue=function(c){var f,g,h,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this);switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),c>4294967295?0|c:c;case a.TYPES.uint32:case a.TYPES.fixed32:return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),0>c?c>>>0:c;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:if(a.Long)try{return l(c,!1)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.uint64:case a.TYPES.fixed64:if(a.Long)try{return l(c,!0)}catch(e){d(typeof c,e.message);}else d(typeof c,\"requires Long.js\");case a.TYPES.bool:return \"boolean\"!=typeof c&&d(typeof c,\"not a boolean\"),c;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return \"number\"!=typeof c&&d(typeof c,\"not a number\"),c;case a.TYPES.string:return \"string\"==typeof c||c&&c instanceof String||d(typeof c,\"not a string\"),\"\"+c;case a.TYPES.bytes:return b.isByteBuffer(c)?c:b.wrap(c);case a.TYPES[\"enum\"]:for(f=this.resolvedType.getChildren(a.Reflect.Enum.Value),h=0;h<f.length;h++){if(f[h].name==c)return f[h].id;if(f[h].id==c)return f[h].id}if(\"proto3\"===this.syntax)return (\"number\"!=typeof c||c===c&&0!==c%1)&&d(typeof c,\"not an integer\"),(c>4294967295||0>c)&&d(typeof c,\"not in range for uint32\"),c;d(c,\"not a valid enum value\");case a.TYPES.group:case a.TYPES.message:if(c&&\"object\"==typeof c||d(typeof c,\"object expected\"),c instanceof this.resolvedType.clazz)return c;if(c instanceof a.Builder.Message){g={};for(h in c)c.hasOwnProperty(h)&&(g[h]=c[h]);c=g;}return new this.resolvedType.clazz(c)}throw Error(\"[INTERNAL] Illegal value for \"+this.toString(!0)+\": \"+c+\" (undefined type \"+this.type+\")\")},j.calculateLength=function(b,c){if(null===c)return 0;var d;switch(this.type){case a.TYPES.int32:return 0>c?f.calculateVarint64(c):f.calculateVarint32(c);case a.TYPES.uint32:return f.calculateVarint32(c);case a.TYPES.sint32:return f.calculateVarint32(f.zigZagEncode32(c));case a.TYPES.fixed32:case a.TYPES.sfixed32:case a.TYPES[\"float\"]:return 4;case a.TYPES.int64:case a.TYPES.uint64:return f.calculateVarint64(c);case a.TYPES.sint64:return f.calculateVarint64(f.zigZagEncode64(c));case a.TYPES.fixed64:case a.TYPES.sfixed64:return 8;case a.TYPES.bool:return 1;case a.TYPES[\"enum\"]:return f.calculateVarint32(c);case a.TYPES[\"double\"]:return 8;case a.TYPES.string:return d=f.calculateUTF8Bytes(c),f.calculateVarint32(d)+d;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");return f.calculateVarint32(c.remaining())+c.remaining();case a.TYPES.message:return d=this.resolvedType.calculate(c),f.calculateVarint32(d)+d;case a.TYPES.group:return d=this.resolvedType.calculate(c),d+f.calculateVarint32(b<<3|a.WIRE_TYPES.ENDGROUP)}throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")},j.encodeValue=function(b,c,d){var e,g;if(null===c)return d;switch(this.type){case a.TYPES.int32:0>c?d.writeVarint64(c):d.writeVarint32(c);break;case a.TYPES.uint32:d.writeVarint32(c);break;case a.TYPES.sint32:d.writeVarint32ZigZag(c);break;case a.TYPES.fixed32:d.writeUint32(c);break;case a.TYPES.sfixed32:d.writeInt32(c);break;case a.TYPES.int64:case a.TYPES.uint64:d.writeVarint64(c);break;case a.TYPES.sint64:d.writeVarint64ZigZag(c);break;case a.TYPES.fixed64:d.writeUint64(c);break;case a.TYPES.sfixed64:d.writeInt64(c);break;case a.TYPES.bool:\"string\"==typeof c?d.writeVarint32(\"false\"===c.toLowerCase()?0:!!c):d.writeVarint32(c?1:0);break;case a.TYPES[\"enum\"]:d.writeVarint32(c);break;case a.TYPES[\"float\"]:d.writeFloat32(c);break;case a.TYPES[\"double\"]:d.writeFloat64(c);break;case a.TYPES.string:d.writeVString(c);break;case a.TYPES.bytes:if(c.remaining()<0)throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+c.remaining()+\" bytes remaining\");e=c.offset,d.writeVarint32(c.remaining()),d.append(c),c.offset=e;break;case a.TYPES.message:g=(new f).LE(),this.resolvedType.encode(c,g),d.writeVarint32(g.offset),d.append(g.flip());break;case a.TYPES.group:this.resolvedType.encode(c,d),d.writeVarint32(b<<3|a.WIRE_TYPES.ENDGROUP);break;default:throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(!0)+\": \"+c+\" (unknown type)\")}return d},j.decode=function(b,c,d){if(c!=this.type.wireType)throw Error(\"Unexpected wire type for element\");var e,f;switch(this.type){case a.TYPES.int32:return 0|b.readVarint32();case a.TYPES.uint32:return b.readVarint32()>>>0;case a.TYPES.sint32:return 0|b.readVarint32ZigZag();case a.TYPES.fixed32:return b.readUint32()>>>0;case a.TYPES.sfixed32:return 0|b.readInt32();case a.TYPES.int64:return b.readVarint64();case a.TYPES.uint64:return b.readVarint64().toUnsigned();case a.TYPES.sint64:return b.readVarint64ZigZag();case a.TYPES.fixed64:return b.readUint64();case a.TYPES.sfixed64:return b.readInt64();case a.TYPES.bool:return !!b.readVarint32();case a.TYPES[\"enum\"]:return b.readVarint32();case a.TYPES[\"float\"]:return b.readFloat();case a.TYPES[\"double\"]:return b.readDouble();case a.TYPES.string:return b.readVString();case a.TYPES.bytes:if(f=b.readVarint32(),b.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+b.remaining());return e=b.clone(),e.limit=e.offset+f,b.offset+=f,e;case a.TYPES.message:return f=b.readVarint32(),this.resolvedType.decode(b,f);case a.TYPES.group:return this.resolvedType.decode(b,-1,d)}throw Error(\"[INTERNAL] Illegal decode type\")},j.valueFromString=function(b){if(!this.isMapKey)throw Error(\"valueFromString() called on non-map-key element\");switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return this.verifyValue(parseInt(b));case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return this.verifyValue(b);case a.TYPES.bool:return \"true\"===b;case a.TYPES.string:return this.verifyValue(b);case a.TYPES.bytes:return f.fromBinary(b)}},j.valueToString=function(b){if(!this.isMapKey)throw Error(\"valueToString() called on non-map-key element\");return this.type===a.TYPES.bytes?b.toString(\"binary\"):b.toString()},c.Element=i,m=function(a,b,c,d,e,f){g.call(this,a,b,c,d,f),this.className=\"Message\",this.extensions=void 0,this.clazz=null,this.isGroup=!!e,this._fields=null,this._fieldsById=null,this._fieldsByName=null;},n=m.prototype=Object.create(g.prototype),n.build=function(c){var d,h,e,g;if(this.clazz&&!c)return this.clazz;for(d=function(a,c){function k(b,c,d,e){var g,h,i,j,l,m,n;if(null===b||\"object\"!=typeof b)return e&&e instanceof a.Reflect.Enum&&(g=a.Reflect.Enum.getName(e.object,b),null!==g)?g:b;if(f.isByteBuffer(b))return c?b.toBase64():b.toBuffer();if(a.Long.isLong(b))return d?b.toString():a.Long.fromValue(b);if(Array.isArray(b))return h=[],b.forEach(function(a,b){h[b]=k(a,c,d,e);}),h;if(h={},b instanceof a.Map){for(i=b.entries(),j=i.next();!j.done;j=i.next())h[b.keyElem.valueToString(j.value[0])]=k(j.value[1],c,d,b.valueElem.resolvedType);return h}l=b.$type,m=void 0;for(n in b)b.hasOwnProperty(n)&&(h[n]=l&&(m=l.getChild(n))?k(b[n],c,d,m.resolvedType):k(b[n],c,d));return h}var i,j,d=c.getChildren(a.Reflect.Message.Field),e=c.getChildren(a.Reflect.Message.OneOf),g=function(b){var i,j,k,l;for(a.Builder.Message.call(this),i=0,j=e.length;j>i;++i)this[e[i].name]=null;for(i=0,j=d.length;j>i;++i)k=d[i],this[k.name]=k.repeated?[]:k.map?new a.Map(k):null,!k.required&&\"proto3\"!==c.syntax||null===k.defaultValue||(this[k.name]=k.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===b||\"object\"!=typeof b||!(\"function\"!=typeof b.encode||b instanceof g)||Array.isArray(b)||b instanceof a.Map||f.isByteBuffer(b)||b instanceof ArrayBuffer||a.Long&&b instanceof a.Long)for(i=0,j=arguments.length;j>i;++i)\"undefined\"!=typeof(l=arguments[i])&&this.$set(d[i].name,l);else this.$set(b);},h=g.prototype=Object.create(a.Builder.Message.prototype);for(h.add=function(b,d,e){var f=c._fieldsByName[b];if(!e){if(!f)throw Error(this+\"#\"+b+\" is undefined\");if(!(f instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+f.toString(!0));if(!f.repeated)throw Error(this+\"#\"+b+\" is not a repeated field\");d=f.verifyValue(d,!0);}return null===this[b]&&(this[b]=[]),this[b].push(d),this},h.$add=h.add,h.set=function(b,d,e){var f,g,h;if(b&&\"object\"==typeof b){e=d;for(f in b)b.hasOwnProperty(f)&&\"undefined\"!=typeof(d=b[f])&&this.$set(f,d,e);return this}if(g=c._fieldsByName[b],e)this[b]=d;else{if(!g)throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(g instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+g.toString(!0));this[g.name]=d=g.verifyValue(d);}return g&&g.oneof&&(h=this[g.oneof.name],null!==d?(null!==h&&h!==g.name&&(this[h]=null),this[g.oneof.name]=g.name):h===b&&(this[g.oneof.name]=null)),this},h.$set=h.set,h.get=function(b,d){if(d)return this[b];var e=c._fieldsByName[b];if(!(e&&e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: undefined\");if(!(e instanceof a.Reflect.Message.Field))throw Error(this+\"#\"+b+\" is not a field: \"+e.toString(!0));return this[e.name]},h.$get=h.get,i=0;i<d.length;i++)j=d[i],j instanceof a.Reflect.Message.ExtensionField||c.builder.options.populateAccessors&&function(a){var d,e,f,b=a.originalName.replace(/(_[a-zA-Z])/g,function(a){return a.toUpperCase().replace(\"_\",\"\")});b=b.substring(0,1).toUpperCase()+b.substring(1),d=a.originalName.replace(/([A-Z])/g,function(a){return \"_\"+a}),e=function(b,c){return this[a.name]=c?b:a.verifyValue(b),this},f=function(){return this[a.name]},null===c.getChild(\"set\"+b)&&(h[\"set\"+b]=e),null===c.getChild(\"set_\"+d)&&(h[\"set_\"+d]=e),null===c.getChild(\"get\"+b)&&(h[\"get\"+b]=f),null===c.getChild(\"get_\"+d)&&(h[\"get_\"+d]=f);}(j);return h.encode=function(a,d){var e,f;\"boolean\"==typeof a&&(d=a,a=void 0),e=!1,a||(a=new b,e=!0),f=a.littleEndian;try{return c.encode(this,a.LE(),d),(e?a.flip():a).LE(f)}catch(g){throw a.LE(f),g}},g.encode=function(a,b,c){return new g(a).encode(b,c)},h.calculate=function(){return c.calculate(this)},h.encodeDelimited=function(a){var d,b=!1;return a||(a=new f,b=!0),d=(new f).LE(),c.encode(this,d).flip(),a.writeVarint32(d.remaining()),a.append(d),b?a.flip():a},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toArrayBuffer()),a}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a}},h.toHex=h.encodeHex,h.toRaw=function(a,b){return k(this,!!a,!!b,this.$type)},h.encodeJSON=function(){return JSON.stringify(k(this,!0,!0,this.$type))},g.decode=function(a,b){var d,e;\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),d=a.littleEndian;try{return e=c.decode(a.LE()),a.LE(d),e}catch(g){throw a.LE(d),g}},g.decodeDelimited=function(a,b){var d,e,g;if(\"string\"==typeof a&&(a=f.wrap(a,b?b:\"base64\")),a=f.isByteBuffer(a)?a:f.wrap(a),a.remaining()<1)return null;if(d=a.offset,e=a.readVarint32(),a.remaining()<e)return a.offset=d,null;try{return g=c.decode(a.slice(a.offset,a.offset+e).LE()),a.offset+=e,g}catch(h){throw a.offset+=e,h}},g.decode64=function(a){return g.decode(a,\"base64\")},g.decodeHex=function(a){return g.decode(a,\"hex\")},g.decodeJSON=function(a){return new g(JSON.parse(a))},h.toString=function(){return c.toString()},Object.defineProperty&&(Object.defineProperty(g,\"$options\",{value:c.buildOpt()}),Object.defineProperty(h,\"$options\",{value:g[\"$options\"]}),Object.defineProperty(g,\"$type\",{value:c}),Object.defineProperty(h,\"$type\",{value:c})),g}(a,this),this._fields=[],this._fieldsById={},this._fieldsByName={},e=0,g=this.children.length;g>e;e++)if(h=this.children[e],h instanceof t||h instanceof m||h instanceof x){if(d.hasOwnProperty(h.name))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+h.toString(!0)+\" cannot override static property '\"+h.name+\"'\");d[h.name]=h.build();}else if(h instanceof m.Field)h.build(),this._fields.push(h),this._fieldsById[h.id]=h,this._fieldsByName[h.name]=h;else if(!(h instanceof m.OneOf||h instanceof w))throw Error(\"Illegal reflect child of \"+this.toString(!0)+\": \"+this.children[e].toString(!0));return this.clazz=d},n.encode=function(a,b,c){var e,h,f,g,i,d=null;for(f=0,g=this._fields.length;g>f;++f)e=this._fields[f],h=a[e.name],e.required&&null===h?null===d&&(d=e):e.encode(c?h:e.verifyValue(h),b,a);if(null!==d)throw i=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+d),i.encoded=b,i;return b},n.calculate=function(a){for(var e,f,b=0,c=0,d=this._fields.length;d>c;++c){if(e=this._fields[c],f=a[e.name],e.required&&null===f)throw Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+e);b+=e.calculate(f,a);}return b},n.decode=function(b,c,d){var g,h,i,j,e,f,k,l,m,n,p,q;for(c=\"number\"==typeof c?c:-1,e=b.offset,f=new this.clazz;b.offset<e+c||-1===c&&b.remaining()>0;){if(g=b.readVarint32(),h=7&g,i=g>>>3,h===a.WIRE_TYPES.ENDGROUP){if(i!==d)throw Error(\"Illegal group end indicator for \"+this.toString(!0)+\": \"+i+\" (\"+(d?d+\" expected\":\"not a group\")+\")\");break}if(j=this._fieldsById[i])j.repeated&&!j.options.packed?f[j.name].push(j.decode(h,b)):j.map?(l=j.decode(h,b),f[j.name].set(l[0],l[1])):(f[j.name]=j.decode(h,b),j.oneof&&(m=f[j.oneof.name],null!==m&&m!==j.name&&(f[m]=null),f[j.oneof.name]=j.name));else switch(h){case a.WIRE_TYPES.VARINT:b.readVarint32();break;case a.WIRE_TYPES.BITS32:b.offset+=4;break;case a.WIRE_TYPES.BITS64:b.offset+=8;break;case a.WIRE_TYPES.LDELIM:k=b.readVarint32(),b.offset+=k;break;case a.WIRE_TYPES.STARTGROUP:for(;o(i,b););break;default:throw Error(\"Illegal wire type for unknown field \"+i+\" in \"+this.toString(!0)+\"#decode: \"+h)}}for(n=0,p=this._fields.length;p>n;++n)if(j=this._fields[n],null===f[j.name])if(\"proto3\"===this.syntax)f[j.name]=j.defaultValue;else{if(j.required)throw q=Error(\"Missing at least one required field for \"+this.toString(!0)+\": \"+j.name),q.decoded=f,q;a.populateDefaults&&null!==j.defaultValue&&(f[j.name]=j.defaultValue);}return f},c.Message=m,p=function(b,c,e,f,g,h,i,j,k,l){d.call(this,b,c,h),this.className=\"Message.Field\",this.required=\"required\"===e,this.repeated=\"repeated\"===e,this.map=\"map\"===e,this.keyType=f||null,this.type=g,this.resolvedType=null,this.id=i,this.options=j||{},this.defaultValue=null,this.oneof=k||null,this.syntax=l||\"proto2\",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof m.ExtensionField||(this.name=a.Util.toCamelCase(this.name));},q=p.prototype=Object.create(d.prototype),q.build=function(){this.element=new i(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new i(this.keyType,void 0,!0,this.syntax)),\"proto3\"!==this.syntax||this.repeated||this.map?\"undefined\"!=typeof this.options[\"default\"]&&(this.defaultValue=this.verifyValue(this.options[\"default\"])):this.defaultValue=i.defaultFieldValue(this.type);},q.verifyValue=function(b,c){var d,e,f;if(c=c||!1,d=function(a,b){throw Error(\"Illegal value for \"+this.toString(!0)+\" of type \"+this.type.name+\": \"+a+\" (\"+b+\")\")}.bind(this),null===b)return this.required&&d(typeof b,\"required\"),\"proto3\"===this.syntax&&this.type!==a.TYPES.message&&d(typeof b,\"proto3 field without field presence cannot be null\"),null;if(this.repeated&&!c){for(Array.isArray(b)||(b=[b]),f=[],e=0;e<b.length;e++)f.push(this.element.verifyValue(b[e]));return f}return this.map&&!c?b instanceof a.Map?b:(b instanceof Object||d(typeof b,\"expected ProtoBuf.Map or raw object for map field\"),new a.Map(this,b)):(!this.repeated&&Array.isArray(b)&&d(typeof b,\"no array expected\"),this.element.verifyValue(b))},q.hasWirePresence=function(b,c){if(\"proto3\"!==this.syntax)return null!==b;if(this.oneof&&c[this.oneof.name]===this.name)return !0;switch(this.type){case a.TYPES.int32:case a.TYPES.sint32:case a.TYPES.sfixed32:case a.TYPES.uint32:case a.TYPES.fixed32:return 0!==b;case a.TYPES.int64:case a.TYPES.sint64:case a.TYPES.sfixed64:case a.TYPES.uint64:case a.TYPES.fixed64:return 0!==b.low||0!==b.high;case a.TYPES.bool:return b;case a.TYPES[\"float\"]:case a.TYPES[\"double\"]:return 0!==b;case a.TYPES.string:return b.length>0;case a.TYPES.bytes:return b.remaining()>0;case a.TYPES[\"enum\"]:return 0!==b;case a.TYPES.message:return null!==b;default:return !0}},q.encode=function(b,c,d){var e,g,h,i,j;if(null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return c;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.ensureCapacity(c.offset+=1),g=c.offset,e=0;e<b.length;e++)this.element.encodeValue(this.id,b[e],c);h=c.offset-g,i=f.calculateVarint32(h),i>1&&(j=c.slice(g,c.offset),g+=i-1,c.offset=g,c.append(j)),c.writeVarint32(h,g-i);}else for(e=0;e<b.length;e++)c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[e],c);else this.map?b.forEach(function(b,d){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,d)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);c.writeVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),c.writeVarint32(g),c.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,d,c),c.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,b,c);},this):this.hasWirePresence(b,d)&&(c.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,c));}catch(k){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+k+\")\")}return c},q.calculate=function(b,c){var d,e,g;if(b=this.verifyValue(b),null===this.type||\"object\"!=typeof this.type)throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(!0)+\": \"+this.type);if(null===b||this.repeated&&0==b.length)return 0;d=0;try{if(this.repeated)if(this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),g=0,e=0;e<b.length;e++)g+=this.element.calculateLength(this.id,b[e]);d+=f.calculateVarint32(g),d+=g;}else for(e=0;e<b.length;e++)d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b[e]);else this.map?b.forEach(function(b,c){var g=f.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,c)+f.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,b);d+=f.calculateVarint32(this.id<<3|a.WIRE_TYPES.LDELIM),d+=f.calculateVarint32(g),d+=g;},this):this.hasWirePresence(b,c)&&(d+=f.calculateVarint32(this.id<<3|this.type.wireType),d+=this.element.calculateLength(this.id,b));}catch(h){throw Error(\"Illegal value for \"+this.toString(!0)+\": \"+b+\" (\"+h+\")\")}return d},q.decode=function(b,c,d){var e,f,h,j,k,l,m,g=!this.map&&b==this.type.wireType||!d&&this.repeated&&this.options.packed&&b==a.WIRE_TYPES.LDELIM||this.map&&b==a.WIRE_TYPES.LDELIM;if(!g)throw Error(\"Illegal wire type for field \"+this.toString(!0)+\": \"+b+\" (\"+this.type.wireType+\" expected)\");if(b==a.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&a.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!d){for(f=c.readVarint32(),f=c.offset+f,h=[];c.offset<f;)h.push(this.decode(this.type.wireType,c,!0));return h}if(this.map){if(j=i.defaultFieldValue(this.keyType),e=i.defaultFieldValue(this.type),f=c.readVarint32(),c.remaining()<f)throw Error(\"Illegal number of bytes for \"+this.toString(!0)+\": \"+f+\" required but got only \"+c.remaining());for(k=c.clone(),k.limit=k.offset+f,c.offset+=f;k.remaining()>0;)if(l=k.readVarint32(),b=7&l,m=l>>>3,1===m)j=this.keyElement.decode(k,b,m);else{if(2!==m)throw Error(\"Unexpected tag in map field key/value submessage\");e=this.element.decode(k,b,m);}return [j,e]}return this.element.decode(c,b,this.id)},c.Message.Field=p,r=function(a,b,c,d,e,f,g){p.call(this,a,b,c,null,d,e,f,g),this.extension;},r.prototype=Object.create(p.prototype),c.Message.ExtensionField=r,s=function(a,b,c){d.call(this,a,b,c),this.fields=[];},c.Message.OneOf=s,t=function(a,b,c,d,e){g.call(this,a,b,c,d,e),this.className=\"Enum\",this.object=null;},t.getName=function(a,b){var e,d,c=Object.keys(a);for(d=0;d<c.length;++d)if(a[e=c[d]]===b)return e;return null},u=t.prototype=Object.create(g.prototype),u.build=function(b){var c,d,e,f;if(this.object&&!b)return this.object;for(c=new a.Builder.Enum,d=this.getChildren(t.Value),e=0,f=d.length;f>e;++e)c[d[e][\"name\"]]=d[e][\"id\"];return Object.defineProperty&&Object.defineProperty(c,\"$options\",{value:this.buildOpt(),enumerable:!1}),this.object=c},c.Enum=t,v=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Enum.Value\",this.id=e;},v.prototype=Object.create(d.prototype),c.Enum.Value=v,w=function(a,b,c,e){d.call(this,a,b,c),this.field=e;},w.prototype=Object.create(d.prototype),c.Extension=w,x=function(a,b,c,d){g.call(this,a,b,c,d),this.className=\"Service\",this.clazz=null;},y=x.prototype=Object.create(g.prototype),y.build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(a,b){var g,c=function(b){a.Builder.Service.call(this),this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")),0);};},d=c.prototype=Object.create(a.Builder.Service.prototype),e=b.getChildren(a.Reflect.Service.RPCMethod);for(g=0;g<e.length;g++)!function(a){d[a.name]=function(c,d){try{try{c=a.resolvedRequestType.clazz.decode(f.wrap(c));}catch(e){if(!(e instanceof TypeError))throw e}if(null===c||\"object\"!=typeof c)throw Error(\"Illegal arguments\");c instanceof a.resolvedRequestType.clazz||(c=new a.resolvedRequestType.clazz(c)),this.rpcImpl(a.fqn(),c,function(c,e){if(c)return d(c),void 0;try{e=a.resolvedResponseType.clazz.decode(e);}catch(f){}return e&&e instanceof a.resolvedResponseType.clazz?(d(null,e),void 0):(d(Error(\"Illegal response type received in service method \"+b.name+\"#\"+a.name)),void 0)});}catch(e){setTimeout(d.bind(this,e),0);}},c[a.name]=function(b,d,e){new c(b)[a.name](d,e);},Object.defineProperty&&(Object.defineProperty(c[a.name],\"$options\",{value:a.buildOpt()}),Object.defineProperty(d[a.name],\"$options\",{value:c[a.name][\"$options\"]}));}(e[g]);return Object.defineProperty&&(Object.defineProperty(c,\"$options\",{value:b.buildOpt()}),Object.defineProperty(d,\"$options\",{value:c[\"$options\"]}),Object.defineProperty(c,\"$type\",{value:b}),Object.defineProperty(d,\"$type\",{value:b})),c}(a,this)},c.Service=x,z=function(a,b,c,e){d.call(this,a,b,c),this.className=\"Service.Method\",this.options=e||{};},A=z.prototype=Object.create(d.prototype),A.buildOpt=h.buildOpt,c.Service.Method=z,B=function(a,b,c,d,e,f,g,h){z.call(this,a,b,c,h),this.className=\"Service.RPCMethod\",this.requestName=d,this.responseName=e,this.requestStream=f,this.responseStream=g,this.resolvedRequestType=null,this.resolvedResponseType=null;},B.prototype=Object.create(z.prototype),c.Service.RPCMethod=B,c}(e),e.Builder=function(a,b,c){function f(a){a.messages&&a.messages.forEach(function(b){b.syntax=a.syntax,f(b);}),a.enums&&a.enums.forEach(function(b){b.syntax=a.syntax;});}var d=function(a){this.ns=new c.Namespace(this,null,\"\"),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=a||{};},e=d.prototype;return d.isMessage=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values||\"undefined\"!=typeof a.rpc?!1:!0},d.isMessageField=function(a){return \"string\"!=typeof a.rule||\"string\"!=typeof a.name||\"string\"!=typeof a.type||\"undefined\"==typeof a.id?!1:!0},d.isEnum=function(a){return \"string\"!=typeof a.name?!1:\"undefined\"!=typeof a.values&&Array.isArray(a.values)&&0!==a.values.length?!0:!1},d.isService=function(a){return \"string\"==typeof a.name&&\"object\"==typeof a.rpc&&a.rpc?!0:!1},d.isExtend=function(a){return \"string\"!=typeof a.ref?!1:!0},e.reset=function(){return this.ptr=this.ns,this},e.define=function(a){if(\"string\"!=typeof a||!b.TYPEREF.test(a))throw Error(\"illegal namespace: \"+a);return a.split(\".\").forEach(function(a){var b=this.ptr.getChild(a);null===b&&this.ptr.addChild(b=new c.Namespace(this,this.ptr,a)),this.ptr=b;},this),this},e.create=function(b){var e,f,g,h,i;if(!b)return this;if(Array.isArray(b)){if(0===b.length)return this;b=b.slice();}else b=[b];for(e=[b];e.length>0;){if(b=e.pop(),!Array.isArray(b))throw Error(\"not a valid namespace: \"+JSON.stringify(b));for(;b.length>0;){if(f=b.shift(),d.isMessage(f)){if(g=new c.Message(this,this.ptr,f.name,f.options,f.isGroup,f.syntax),h={},f.oneofs&&Object.keys(f.oneofs).forEach(function(a){g.addChild(h[a]=new c.Message.OneOf(this,g,a));},this),f.fields&&f.fields.forEach(function(a){if(null!==g.getChild(0|a.id))throw Error(\"duplicate or invalid field id in \"+g.name+\": \"+a.id);if(a.options&&\"object\"!=typeof a.options)throw Error(\"illegal field options in \"+g.name+\"#\"+a.name);var b=null;if(\"string\"==typeof a.oneof&&!(b=h[a.oneof]))throw Error(\"illegal oneof in \"+g.name+\"#\"+a.name+\": \"+a.oneof);a=new c.Message.Field(this,g,a.rule,a.keytype,a.type,a.name,a.id,a.options,b,f.syntax),b&&b.fields.push(a),g.addChild(a);},this),i=[],f.enums&&f.enums.forEach(function(a){i.push(a);}),f.messages&&f.messages.forEach(function(a){i.push(a);}),f.services&&f.services.forEach(function(a){i.push(a);}),f.extensions&&(g.extensions=\"number\"==typeof f.extensions[0]?[f.extensions]:f.extensions),this.ptr.addChild(g),i.length>0){e.push(b),b=i,i=null,this.ptr=g,g=null;continue}i=null;}else if(d.isEnum(f))g=new c.Enum(this,this.ptr,f.name,f.options,f.syntax),f.values.forEach(function(a){g.addChild(new c.Enum.Value(this,g,a.name,a.id));},this),this.ptr.addChild(g);else if(d.isService(f))g=new c.Service(this,this.ptr,f.name,f.options),Object.keys(f.rpc).forEach(function(a){var b=f.rpc[a];g.addChild(new c.Service.RPCMethod(this,g,a,b.request,b.response,!!b.request_stream,!!b.response_stream,b.options));},this),this.ptr.addChild(g);else{if(!d.isExtend(f))throw Error(\"not a valid definition: \"+JSON.stringify(f));if(g=this.ptr.resolve(f.ref,!0))f.fields.forEach(function(b){var d,e,f,h;if(null!==g.getChild(0|b.id))throw Error(\"duplicate extended field id in \"+g.name+\": \"+b.id);\n  if(g.extensions&&(d=!1,g.extensions.forEach(function(a){b.id>=a[0]&&b.id<=a[1]&&(d=!0);}),!d))throw Error(\"illegal extended field id in \"+g.name+\": \"+b.id+\" (not within valid ranges)\");e=b.name,this.options.convertFieldsToCamelCase&&(e=a.Util.toCamelCase(e)),f=new c.Message.ExtensionField(this,g,b.rule,b.type,this.ptr.fqn()+\".\"+e,b.id,b.options),h=new c.Extension(this,this.ptr,b.name,f),f.extension=h,this.ptr.addChild(h),g.addChild(f);},this);else if(!/\\.?google\\.protobuf\\./.test(f.ref))throw Error(\"extended message \"+f.ref+\" is not defined\")}f=null,g=null;}b=null,this.ptr=this.ptr.parent;}return this.resolved=!1,this.result=null,this},e[\"import\"]=function(b,c){var e,g,h,i,j,k,l,m,d=\"/\";if(\"string\"==typeof c){if(a.Util.IS_NODE,this.files[c]===!0)return this.reset();this.files[c]=!0;}else if(\"object\"==typeof c){if(e=c.root,a.Util.IS_NODE,(e.indexOf(\"\\\\\")>=0||c.file.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\"),g=e+d+c.file,this.files[g]===!0)return this.reset();this.files[g]=!0;}if(b.imports&&b.imports.length>0){for(i=!1,\"object\"==typeof c?(this.importRoot=c.root,i=!0,h=this.importRoot,c=c.file,(h.indexOf(\"\\\\\")>=0||c.indexOf(\"\\\\\")>=0)&&(d=\"\\\\\")):\"string\"==typeof c?this.importRoot?h=this.importRoot:c.indexOf(\"/\")>=0?(h=c.replace(/\\/[^\\/]*$/,\"\"),\"\"===h&&(h=\"/\")):c.indexOf(\"\\\\\")>=0?(h=c.replace(/\\\\[^\\\\]*$/,\"\"),d=\"\\\\\"):h=\".\":h=null,j=0;j<b.imports.length;j++)if(\"string\"==typeof b.imports[j]){if(!h)throw Error(\"cannot determine import root\");if(k=b.imports[j],\"google/protobuf/descriptor.proto\"===k)continue;if(k=h+d+k,this.files[k]===!0)continue;if(/\\.proto$/i.test(k)&&!a.DotProto&&(k=k.replace(/\\.proto$/,\".json\")),l=a.Util.fetch(k),null===l)throw Error(\"failed to import '\"+k+\"' in '\"+c+\"': file not found\");/\\.json$/i.test(k)?this[\"import\"](JSON.parse(l+\"\"),k):this[\"import\"](a.DotProto.Parser.parse(l),k);}else c?/\\.(\\w+)$/.test(c)?this[\"import\"](b.imports[j],c.replace(/^(.+)\\.(\\w+)$/,function(a,b,c){return b+\"_import\"+j+\".\"+c})):this[\"import\"](b.imports[j],c+\"_import\"+j):this[\"import\"](b.imports[j]);i&&(this.importRoot=null);}return b[\"package\"]&&this.define(b[\"package\"]),b.syntax&&f(b),m=this.ptr,b.options&&Object.keys(b.options).forEach(function(a){m.options[a]=b.options[a];}),b.messages&&(this.create(b.messages),this.ptr=m),b.enums&&(this.create(b.enums),this.ptr=m),b.services&&(this.create(b.services),this.ptr=m),b[\"extends\"]&&this.create(b[\"extends\"]),this.reset()},e.resolveAll=function(){var d;if(null==this.ptr||\"object\"==typeof this.ptr.type)return this;if(this.ptr instanceof c.Namespace)this.ptr.children.forEach(function(a){this.ptr=a,this.resolveAll();},this);else if(this.ptr instanceof c.Message.Field){if(b.TYPE.test(this.ptr.type))this.ptr.type=a.TYPES[this.ptr.type];else{if(!b.TYPEREF.test(this.ptr.type))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(d=(this.ptr instanceof c.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!d)throw Error(\"unresolvable type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);if(this.ptr.resolvedType=d,d instanceof c.Enum){if(this.ptr.type=a.TYPES[\"enum\"],\"proto3\"===this.ptr.syntax&&\"proto3\"!==d.syntax)throw Error(\"proto3 message cannot reference proto2 enum\")}else{if(!(d instanceof c.Message))throw Error(\"illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.type);this.ptr.type=d.isGroup?a.TYPES.group:a.TYPES.message;}}if(this.ptr.map){if(!b.TYPE.test(this.ptr.keyType))throw Error(\"illegal key type for map field in \"+this.ptr.toString(!0)+\": \"+this.ptr.keyType);this.ptr.keyType=a.TYPES[this.ptr.keyType];}}else if(this.ptr instanceof a.Reflect.Service.Method){if(!(this.ptr instanceof a.Reflect.Service.RPCMethod))throw Error(\"illegal service type in \"+this.ptr.toString(!0));if(d=this.ptr.parent.resolve(this.ptr.requestName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.requestName);if(this.ptr.resolvedRequestType=d,d=this.ptr.parent.resolve(this.ptr.responseName,!0),!(d&&d instanceof a.Reflect.Message))throw Error(\"Illegal type reference in \"+this.ptr.toString(!0)+\": \"+this.ptr.responseName);this.ptr.resolvedResponseType=d;}else if(!(this.ptr instanceof a.Reflect.Message.OneOf||this.ptr instanceof a.Reflect.Extension||this.ptr instanceof a.Reflect.Enum.Value))throw Error(\"illegal object in namespace: \"+typeof this.ptr+\": \"+this.ptr);return this.reset()},e.build=function(a){var b,c,d;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!a)return this.result;for(b=\"string\"==typeof a?a.split(\".\"):a,c=this.result,d=0;d<b.length;d++){if(!c[b[d]]){c=null;break}c=c[b[d]];}return c},e.lookup=function(a,b){return a?this.ns.resolve(a,b):this.ns},e.toString=function(){return \"Builder\"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(e,e.Lang,e.Reflect),e.Map=function(a,b){function e(a){var b=0;return {next:function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}}var c=function(a,c){var d,e,f,g;if(!a.map)throw Error(\"field is not a map\");if(this.field=a,this.keyElem=new b.Element(a.keyType,null,!0,a.syntax),this.valueElem=new b.Element(a.type,a.resolvedType,!1,a.syntax),this.map={},Object.defineProperty(this,\"size\",{get:function(){return Object.keys(this.map).length}}),c)for(d=Object.keys(c),e=0;e<d.length;e++)f=this.keyElem.valueFromString(d[e]),g=this.valueElem.verifyValue(c[d[e]]),this.map[this.keyElem.valueToString(f)]={key:f,value:g};},d=c.prototype;return d.clear=function(){this.map={};},d[\"delete\"]=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a)),c=b in this.map;return delete this.map[b],c},d.entries=function(){var d,c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push([(d=this.map[b[c]]).key,d.value]);return e(a)},d.keys=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].key);return e(a)},d.values=function(){var c,a=[],b=Object.keys(this.map);for(c=0;c<b.length;c++)a.push(this.map[b[c]].value);return e(a)},d.forEach=function(a,b){var e,d,c=Object.keys(this.map);for(d=0;d<c.length;d++)a.call(b,(e=this.map[c[d]]).value,e.key,this);},d.set=function(a,b){var c=this.keyElem.verifyValue(a),d=this.valueElem.verifyValue(b);return this.map[this.keyElem.valueToString(c)]={key:c,value:d},this},d.get=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map?this.map[b].value:void 0},d.has=function(a){var b=this.keyElem.valueToString(this.keyElem.verifyValue(a));return b in this.map},c}(e,e.Reflect),e.loadProto=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=void 0),e.loadJson(e.DotProto.Parser.parse(a),b,c)},e.protoFromString=e.loadProto,e.loadProtoFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadProto(d,c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadProto(d,c,a)},e.protoFromFile=e.loadProtoFile,e.newBuilder=function(a){return a=a||{},\"undefined\"==typeof a.convertFieldsToCamelCase&&(a.convertFieldsToCamelCase=e.convertFieldsToCamelCase),\"undefined\"==typeof a.populateAccessors&&(a.populateAccessors=e.populateAccessors),new e.Builder(a)},e.loadJson=function(a,b,c){return (\"string\"==typeof b||b&&\"string\"==typeof b.file&&\"string\"==typeof b.root)&&(c=b,b=null),b&&\"object\"==typeof b||(b=e.newBuilder()),\"string\"==typeof a&&(a=JSON.parse(a)),b[\"import\"](a,c),b.resolveAll(),b},e.loadJsonFile=function(a,b,c){if(b&&\"object\"==typeof b?(c=b,b=null):b&&\"function\"==typeof b||(b=null),b)return e.Util.fetch(\"string\"==typeof a?a:a.root+\"/\"+a.file,function(d){if(null===d)return b(Error(\"Failed to fetch file\")),void 0;try{b(null,e.loadJson(JSON.parse(d),c,a));}catch(f){b(f);}});var d=e.Util.fetch(\"object\"==typeof a?a.root+\"/\"+a.file:a);return null===d?null:e.loadJson(JSON.parse(d),c,a)},h=a,i=e.loadProto(h,void 0,\"\").build(\"Modules\").probuf}(d,c,b);return e}\n\n  var SSMsg$1 = \"\\npackage Modules;\\nmessage probuf {\\n  message \" + PBName.SetUserStatusInput + \"\\n  {\\n    optional int32 status=1;\\n  }\\n\\n  message SetUserStatusOutput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusInput\\n  {\\n    optional int32 nothing=1;\\n  }\\n\\n  message GetUserStatusOutput\\n  {\\n    optional string status=1;\\n    optional string subUserId=2;\\n  }\\n\\n  message SubUserStatusInput\\n  {\\n    repeated string userid =1;\\n  }\\n\\n  message SubUserStatusOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message VoipDynamicInput\\n  {\\n    required int32  engineType = 1;\\n    required string channelName = 2;\\n    optional string channelExtra = 3;\\n  }\\n\\n  message VoipDynamicOutput\\n  {\\n      required string dynamicKey=1;\\n  }\\n  message \" + PBName.NotifyMsg + \" {\\n    required int32 type = 1;\\n    optional int64 time = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SyncRequestMsg + \" {\\n    required int64 syncTime = 1;\\n    required bool ispolling = 2;\\n    optional bool isweb=3;\\n    optional bool isPullSend=4;\\n    optional bool isKeeping=5;\\n    optional int64 sendBoxSyncTime=6;\\n  }\\n  message \" + PBName.UpStreamMessage + \" {\\n    required int32 sessionId = 1;\\n    required string classname = 2;\\n    required bytes content = 3;\\n    optional string pushText = 4;\\n    optional string appData = 5;\\n    repeated string userId = 6;\\n    optional int64 delMsgTime = 7;\\n    optional string delMsgId = 8;\\n    optional int32 configFlag = 9;\\n  }\\n  message \" + PBName.DownStreamMessages + \" {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    optional bool finished = 3;\\n  }\\n  message \" + PBName.DownStreamMessage + \" {\\n    required string fromUserId = 1;\\n    required ChannelType type = 2;\\n    optional string groupId = 3;\\n    required string classname = 4;\\n    required bytes content = 5;\\n    required int64 dataTime = 6;\\n    required int64 status = 7;\\n    optional int64 extra = 8;\\n    optional string msgId = 9;\\n    optional int32 direction = 10;\\n  }\\n  enum ChannelType {\\n    PERSON = 1;\\n    PERSONS = 2;\\n    GROUP = 3;\\n    TEMPGROUP = 4;\\n    CUSTOMERSERVICE = 5;\\n    NOTIFY = 6;\\n    MC=7;\\n    MP=8;\\n  }\\n  message CreateDiscussionInput {\\n    optional string name = 1;\\n  }\\n  message CreateDiscussionOutput {\\n    required string id = 1;\\n  }\\n  message ChannelInvitationInput {\\n    repeated string users = 1;\\n  }\\n  message LeaveChannelInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelEvictionInput {\\n    required string user = 1;\\n  }\\n  message RenameChannelInput {\\n    required string name = 1;\\n  }\\n  message ChannelInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message ChannelInfoOutput {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n    required string channelName = 3;\\n    required string adminUserId = 4;\\n    repeated string firstTenUserIds = 5;\\n    required int32 openStatus = 6;\\n  }\\n  message ChannelInfosInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message ChannelInfosOutput {\\n    repeated ChannelInfoOutput channels = 1;\\n    required int32 total = 2;\\n  }\\n  message MemberInfo {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n    required string extension = 4;\\n  }\\n  message GroupMembersInput {\\n    required int32 page = 1;\\n    optional int32 number = 2;\\n  }\\n  message GroupMembersOutput {\\n    repeated MemberInfo members = 1;\\n    required int32 total = 2;\\n  }\\n  message GetUserInfoInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetUserInfoOutput {\\n    required string userId = 1;\\n    required string userName = 2;\\n    required string userPortrait = 3;\\n  }\\n  message GetSessionIdInput {\\n    required int32 nothing = 1;\\n  }\\n  message GetSessionIdOutput {\\n    required int32 sessionId = 1;\\n  }\\n  enum FileType {\\n    image = \" + FILE_TYPE.IMAGE + \";\\n    audio = \" + FILE_TYPE.AUDIO + \";\\n    video = \" + FILE_TYPE.VIDEO + \";\\n    file = \" + FILE_TYPE.FILE + \";\\n  }\\n  message \" + PBName.GetQNupTokenInput + \" {\\n    required FileType type = 1;\\n    optional string key = 2;\\n  }\\n  message \" + PBName.GetQNdownloadUrlInput + \" {\\n    required FileType type = 1;\\n    required string key = 2;\\n    optional string  fileName = 3;\\n  }\\n  message \" + PBName.GetQNupTokenOutput + \" {\\n    required int64 deadline = 1;\\n    required string token = 2;\\n    optional string bosToken = 3;\\n    optional string bosDate = 4;\\n    optional string path = 5;\\n  }\\n  message \" + PBName.GetQNdownloadUrlOutput + \" {\\n    required string downloadUrl = 1;\\n  }\\n  message Add2BlackListInput {\\n    required string userId = 1;\\n  }\\n  message RemoveFromBlackListInput {\\n    required string userId = 1;\\n  }\\n  message QueryBlackListInput {\\n    required int32 nothing = 1;\\n  }\\n  message QueryBlackListOutput {\\n    repeated string userIds = 1;\\n  }\\n  message BlackListStatusInput {\\n    required string userId = 1;\\n  }\\n  message BlockPushInput {\\n    required string blockeeId = 1;\\n  }\\n  message ModifyPermissionInput {\\n    required int32 openStatus = 1;\\n  }\\n  message GroupInput {\\n    repeated GroupInfo groupInfo = 1;\\n  }\\n  message GroupOutput {\\n    required int32 nothing = 1;\\n  }\\n  message GroupInfo {\\n    required string id = 1;\\n    required string name = 2;\\n  }\\n  message GroupHashInput {\\n    required string userId = 1;\\n    required string groupHashCode = 2;\\n  }\\n  message GroupHashOutput {\\n    required GroupHashType result = 1;\\n  }\\n  enum GroupHashType {\\n    group_success = 0x00;\\n    group_failure = 0x01;\\n  }\\n  message \" + PBName.ChrmInput + \" {\\n    required int32 nothing = 1;\\n  }\\n  message ChrmOutput {\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.ChrmPullMsg + \" {\\n    required int64 syncTime = 1;\\n    required int32 count = 2;\\n  }\\n  \\n  message ChrmPullMsgNew \\n  {\\n    required int32 count = 1;\\n    required int64 syncTime = 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.RelationQryInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional int32 count = 2;\\n    optional int64 startTime = 3;\\n    optional int32 order = 4;\\n  }\\n  message \" + PBName.RelationsInput + \"\\n  {\\n    required ChannelType type = 1;\\n    optional DownStreamMessage msg =2;\\n    optional int32 count = 3;\\n    optional int32 offset = 4;\\n    optional int64 startTime = 5;\\n    optional int64 endTime = 6;\\n  }\\n  message \" + PBName.RelationsOutput + \"\\n  {\\n    repeated RelationInfo info = 1;\\n  }\\n  message RelationInfo\\n  {\\n    required ChannelType type = 1;\\n    required string userId = 2;\\n    optional DownStreamMessage msg =3;\\n    optional int64 readMsgTime= 4;\\n    optional int64 unreadCount= 5;\\n  }\\n  message RelationInfoReadTime\\n  {\\n    required ChannelType type = 1;\\n    required int64 readMsgTime= 2;\\n    required string targetId = 3;\\n  }\\n  message \" + PBName.CleanHisMsgInput + \"\\n  {\\n      required string targetId = 1;\\n      required int64 dataTime = 2;\\n      optional int32 conversationType= 3;\\n  }\\n  message HistoryMessageInput\\n  {\\n    required string targetId = 1;\\n    required int64 dataTime =2;\\n    required int32 size  = 3;\\n  }\\n\\n  message HistoryMessagesOuput\\n  {\\n    repeated DownStreamMessage list = 1;\\n    required int64 syncTime = 2;\\n    required int32 hasMsg = 3;\\n  }\\n  message \" + PBName.QueryChatRoomInfoInput + \"\\n  {\\n    required int32 count= 1;\\n    optional int32 order= 2;\\n  }\\n\\n  message \" + PBName.QueryChatRoomInfoOutput + \"\\n  {\\n    optional int32 userTotalNums = 1;\\n    repeated ChrmMember userInfos = 2;\\n  }\\n  message ChrmMember\\n  {\\n    required int64 time = 1;\\n    required string id = 2;\\n  }\\n  message MPFollowInput\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MPFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message \" + PBName.MCFollowInput + \"\\n  {\\n    required string id = 1;\\n  }\\n\\n  message MCFollowOutput\\n  {\\n    required int32 nothing = 1;\\n    optional MpInfo info =2;\\n  }\\n\\n  message MpInfo  \\n  {\\n    required string mpid=1;\\n    required string name = 2;\\n    required string type = 3;\\n    required int64 time=4;\\n    optional string portraitUrl=5;\\n    optional string extra =6;\\n  }\\n\\n  message SearchMpInput\\n  {\\n    required int32 type=1;\\n    required string id=2;\\n  }\\n\\n  message SearchMpOutput\\n  {\\n    required int32 nothing=1;\\n    repeated MpInfo info = 2;\\n  }\\n\\n  message PullMpInput\\n  {\\n    required int64 time=1;\\n    required string mpid=2;\\n  }\\n\\n  message PullMpOutput\\n  {\\n    required int32 status=1;\\n    repeated MpInfo info = 2;\\n  }\\n  message \" + PBName.HistoryMsgInput + \"\\n  {\\n    optional string targetId = 1;\\n    optional int64 time = 2;\\n    optional int32 count  = 3;\\n    optional int32 order = 4;\\n  }\\n\\n  message \" + PBName.HistoryMsgOuput + \"\\n  {\\n    repeated DownStreamMessage list=1;\\n    required int64 syncTime=2;\\n    required int32 hasMsg=3;\\n  }\\n  message \" + PBName.RtcQueryListInput + \"{\\n    optional int32 order=1;\\n  }\\n\\n  message \" + PBName.RtcKeyDeleteInput + \"{\\n    repeated string key=1;\\n  }\\n\\n  message \" + PBName.RtcValueInfo + \"{\\n    required string key=1;\\n    required string value=2;\\n  }\\n\\n  message RtcUserInfo{\\n    required string userId=1;\\n    repeated \" + PBName.RtcValueInfo + \" userData=2;\\n  }\\n\\n  message \" + PBName.RtcUserListOutput + \"{\\n    repeated RtcUserInfo list=1;\\n    optional string token=2;\\n  }\\n  message RtcRoomInfoOutput{\\n    optional string roomId = 1;\\n    repeated \" + PBName.RtcValueInfo + \" roomData = 2;\\n    optional int32 userCount = 3;\\n    repeated RtcUserInfo list=4;\\n  }\\n  message \" + PBName.RtcInput + \"{\\n    required int32 roomType=1;\\n    optional int32 broadcastType=2;\\n  }\\n  message RtcQryInput{ \\n    required bool isInterior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n  }\\n  message \" + PBName.RtcQryOutput + \"{\\n    repeated \" + PBName.RtcValueInfo + \" outInfo=1;\\n  }\\n  message RtcDelDataInput{\\n    repeated string key=1;\\n    required bool isInterior=2;\\n    required targetType target=3;\\n  }\\n  message \" + PBName.RtcDataInput + \"{ \\n    required bool interior=1;\\n    required targetType target=2;\\n    repeated string key=3;\\n    optional string objectName=4;\\n    optional string content=5;\\n  }\\n  message \" + PBName.RtcSetDataInput + \"{\\n    required bool interior=1;\\n    required targetType target=2;\\n    required string key=3;\\n    required string value=4;\\n    optional string objectName=5;\\n    optional string content=6;\\n  }\\n  message RtcOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.RtcTokenOutput + \"{\\n    required string rtcToken=1;\\n  }\\n  enum targetType {\\n    ROOM =1 ;\\n    PERSON = 2;\\n  }\\n  message \" + PBName.RtcSetOutDataInput + \"{\\n    required targetType target=1;\\n    repeated \" + PBName.RtcValueInfo + \" valueInfo=2;\\n    optional string objectName=3;\\n    optional string content=4;\\n  }\\n  message \" + PBName.RtcQryUserOutDataInput + \"{\\n    repeated string userId = 1;\\n  }\\n  message \" + PBName.RtcUserOutDataOutput + \"{\\n    repeated RtcUserInfo user = 1;\\n  }\\n  message \" + PBName.SessionsAttQryInput + \"{\\n    required int32 nothing = 1;\\n  }\\n  message \" + PBName.SessionsAttOutput + \"{\\n    required int64 inboxTime = 1;\\n    required int64 sendboxTime = 2;\\n    required int64 totalUnreadCount = 3;\\n  }\\n  message \" + PBName.SessionMsgReadInput + \"\\n  {\\n    required ChannelType type = 1;\\n    required int64 msgTime = 2;\\n    required string channelId = 3;\\n  }\\n  message SessionMsgReadOutput\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteSessionsInput + \"\\n  {\\n    repeated SessionInfo sessions = 1;\\n  }\\n  message \" + PBName.SessionInfo + \"\\n  {\\n    required ChannelType type = 1;\\n    required string channelId = 2;\\n  }\\n  message \" + PBName.DeleteSessionsOutput + \"\\n  {\\n    optional int32 nothing=1; \\n  }\\n  message \" + PBName.DeleteMsgInput + \"\\n  {\\n    optional ChannelType type = 1;\\n    optional string conversationId = 2;\\n    repeated DeleteMsg msgs = 3;\\n  }\\n  message DeleteMsg\\n  {\\n    optional string msgId = 1;\\n    optional int64 msgDataTime = 2;\\n    optional int32 direct = 3;\\n  }\\n  message ChrmKVEntity {\\n    required string key = 1;\\n    required string value = 2;\\n    optional int32 status = 3;\\n    optional int64 timestamp = 4;\\n    optional string uid = 5;\\n  }\\n  message \" + PBName.SetChrmKV + \" {\\n    required ChrmKVEntity entry = 1;\\n    optional bool bNotify = 2;\\n    optional UpStreamMessage notification = 3;\\n    optional ChannelType type = 4;\\n  }\\n  message \" + PBName.ChrmKVOutput + \" {\\n    repeated ChrmKVEntity entries = 1;\\n    optional bool bFullUpdate = 2;\\n    optional int64 syncTime = 3;\\n  }\\n  message \" + PBName.QueryChrmKV + \" {\\n    required int64 timestamp = 1;\\n  }\\n  message \" + PBName.ChrmNotifyMsg + \" {\\t\\n    required int32 type= 1;\\n    optional int64 time= 2;\\n    optional string chrmId=3;\\n  }\\n  message \" + PBName.SetUserSettingInput + \" {\\n    required int64 version=1;\\n    required string value=2;\\n  }\\n  message \" + PBName.SetUserSettingOutput + \" {\\n    required int64 version=1;\\n    required bool reserve=2;\\n  }\\n  message \" + PBName.PullUserSettingInput + \" {\\n    required int64 version=1;//\\u5F53\\u524D\\u5BA2\\u6237\\u7AEF\\u7684\\u6700\\u5927\\u7248\\u672C\\u53F7\\n    optional bool reserve=2;\\n  }\\n  message \" + PBName.PullUserSettingOutput + \" {\\n    repeated UserSettingItem items = 1;\\n    required int64 version=2;\\n  }\\n  message UserSettingItem {\\n    required string targetId= 1;\\n    required ChannelType type = 2;\\n    required string key = 4;\\n    required bytes value = 5;\\n    required int64 version=6;\\n    required int32 status=7;\\n  }\\n  message \" + PBName.SessionReq + \" {\\n    required int64 time = 1;\\n  }\\n  message \" + PBName.SessionStates + \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \" + PBName.SessionState + \" {\\n    required ChannelType type = 1;\\n    required string channelId = 2;  \\n    optional int64 time = 3;\\n    repeated SessionStateItem stateItem = 4;\\n  }\\n  message \" + PBName.SessionStateItem + \" {\\n    required SessionStateType sessionStateType = 1;\\n    required string value = 2;\\n  }\\n  enum SessionStateType {\\n    IsSilent = 1;\\n    IsTop = 2;\\n  }\\n  message \" + PBName.SessionStateModifyReq + \" {\\n    required int64 version=1;\\n    repeated SessionState state= 2;\\n  }\\n  message \" + PBName.SessionStateModifyResp + \" {\\n    required int64 version=1;\\n  }\\n}\\n\";\n\n  var Codec$1 = {};\n\n  try {\n    Codec$1 = protobuf(SSMsg$1);\n  } catch (e) {\n    Codec$1 = {};\n  }\n\n  Codec$1.getModule = function (pbName) {\n    var modules = new Codec$1[pbName]();\n\n    modules.getArrayData = function () {\n      var data = modules.toArrayBuffer();\n      data = utils.ArrayBufferToArray(data);\n      return data;\n    };\n\n    return modules;\n  };\n\n  var SocketCodec = Codec$1;\n\n  var isGroup$1 = common.isGroup,\n      isChatRoom$1 = common.isChatRoom;\n\n  var Codec$2 = function () {\n    function Codec$$1(option) {\n      this.codec = SocketCodec;\n      option = option || {};\n      var type = option.connectType;\n      type && this.setCodecType(type);\n    }\n\n    var _proto = Codec$$1.prototype;\n\n    _proto.setCodecType = function setCodecType(type) {\n      this.codec = type === CONNECT_TYPE.COMET ? Codec : SocketCodec;\n    };\n\n    _proto.decodeByPBName = function decodeByPBName(data, pbName, option) {\n      var _formatEventMap;\n\n      var self = this;\n      var formatEventMap = (_formatEventMap = {}, _formatEventMap[PBName.DownStreamMessages] = self.formatSyncMessages, _formatEventMap[PBName.DownStreamMessage] = self.formatReceivedMessage, _formatEventMap[PBName.UpStreamMessage] = self.formatSentMessage, _formatEventMap[PBName.HistoryMsgOuput] = self.formatHistoryMessages, _formatEventMap[PBName.RelationsOutput] = self.formatConversationList, _formatEventMap[PBName.QueryChatRoomInfoOutput] = self.formatChatRoomInfos, _formatEventMap[PBName.RtcUserListOutput] = self.formatRTCUserList, _formatEventMap[PBName.RtcQryOutput] = self.formatRTCData, _formatEventMap[PBName.ChrmKVOutput] = self.formatChatRoomKVList, _formatEventMap[PBName.PullUserSettingOutput] = self.formatUserSetting, _formatEventMap[PBName.SessionStates] = self.formatConversationStatus, _formatEventMap);\n      var decodedData = data;\n      var formatEvent = formatEventMap[pbName];\n\n      try {\n        decodedData = self.codec[pbName].decode(data);\n\n        if (utils.isObject(decodedData)) {\n          decodedData = utils.batchInt64ToTimestamp(decodedData);\n        }\n\n        if (utils.isFunction(formatEvent)) {\n          decodedData = formatEvent.call(self, decodedData, option);\n        }\n      } catch (e) {}\n\n      return decodedData;\n    };\n\n    _proto.formatBytes = function formatBytes(content) {\n      try {\n        var _content = content,\n            offset = _content.offset,\n            buffer = _content.buffer,\n            limit = _content.limit;\n\n        if (offset) {\n          content = utils.ArrayBufferToUint8Array(buffer).subarray(offset, limit);\n          content = BinaryHelper.readUTF(content);\n        }\n\n        content = utils.parseJSON(content);\n      } catch (e) {}\n\n      return content;\n    };\n\n    _proto.formatSyncMessages = function formatSyncMessages(data, option) {\n      option = option || {};\n      var self = this,\n          onMessage = option.onMessage || utils.noop,\n          list = data.list,\n          syncTime = data.syncTime,\n          maxListIndex = list.length - 1;\n      var finished = data.finished;\n\n      if (utils.isUndefined(finished)) {\n        data.finished = finished = true;\n      }\n\n      data.syncTime = utils.int64ToTimestamp(syncTime);\n      data.list = utils.map(list, function (msgData, index) {\n        var message = self.formatReceivedMessage(msgData, option),\n            isLastInAPull = utils.isEqual(index, maxListIndex),\n            isFinished = isLastInAPull && finished;\n\n        try {\n          onMessage({\n            isLastInAPull: isLastInAPull,\n            message: message,\n            finished: isFinished\n          });\n        } catch (e) {\n          utils.consoleError(e);\n        }\n\n        return message;\n      });\n      return data;\n    };\n\n    _proto.formatReceivedMessage = function formatReceivedMessage(data, option) {\n      option = option || {};\n      var self = this;\n\n      var _option = option,\n          currentUserId = _option.currentUserId,\n          connectedTime = _option.connectedTime,\n          content = data.content,\n          fromUserId = data.fromUserId,\n          type = data.type,\n          groupId = data.groupId,\n          status = data.status,\n          dataTime = data.dataTime,\n          messageType = data.classname,\n          messageUId = data.msgId,\n          direction = data.direction || MESSAGE_DIRECTION.RECEIVE,\n          isSelfSend = utils.isEqual(direction, MESSAGE_DIRECTION.SEND),\n          _common$getMessageOpt = common.getMessageOptionByStatus(status),\n          isPersited = _common$getMessageOpt.isPersited,\n          isCounted = _common$getMessageOpt.isCounted,\n          isMentiond = _common$getMessageOpt.isMentiond,\n          targetId = isGroup$1(type) || isChatRoom$1(type) ? groupId : fromUserId,\n          senderUserId = isSelfSend ? currentUserId : fromUserId,\n          sentTime = utils.int64ToTimestamp(dataTime),\n          isOffLineMessage = sentTime < connectedTime,\n          isChatRoomMsg = common.isChatRoom(type);\n\n      var messageDirection = isSelfSend ? MESSAGE_DIRECTION.SEND : MESSAGE_DIRECTION.RECEIVE;\n\n      if (isChatRoomMsg && utils.isEqual(fromUserId, currentUserId)) {\n        messageDirection = MESSAGE_DIRECTION.SEND;\n      }\n\n      return {\n        type: type,\n        targetId: targetId,\n        senderUserId: senderUserId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        isMentiond: isMentiond,\n        sentTime: sentTime,\n        isOffLineMessage: isOffLineMessage,\n        messageDirection: messageDirection,\n        receivedTime: common.DelayTimer.getTime(),\n        content: self.formatBytes(content)\n      };\n    };\n\n    _proto.formatSentMessage = function formatSentMessage(data, option) {\n      var self = this;\n\n      var content = data.content,\n          messageType = data.classname,\n          sessionId = data.sessionId,\n          messageUId = data.msgId,\n          signal = option.signal,\n          currentUserId = option.currentUserId,\n          date = signal.date,\n          topic = signal.topic,\n          targetId = signal.targetId,\n          _common$getPersitedAn = common.getPersitedAndCountedBySessionId(sessionId),\n          isPersited = _common$getPersitedAn.isPersited,\n          isCounted = _common$getPersitedAn.isCounted,\n          type = PUBLISH_TOPIC_TO_CONVERSATION_TYPE[topic] || CONVERSATION_TYPE.PRIVATE;\n\n      return {\n        type: type,\n        targetId: targetId,\n        messageType: messageType,\n        messageUId: messageUId,\n        isPersited: isPersited,\n        isCounted: isCounted,\n        senderUserId: currentUserId,\n        content: self.formatBytes(content),\n        sentTime: utils.secondsToMilliseconds(date),\n        receivedTime: common.DelayTimer.getTime(),\n        messageDirection: MESSAGE_DIRECTION.SEND,\n        isOffLineMessage: false\n      };\n    };\n\n    _proto.formatHistoryMessages = function formatHistoryMessages(data, option) {\n      var self = this;\n      var conversation = option.conversation || {},\n          msgList = data.list,\n          hasMsg = data.hasMsg,\n          targetId = conversation.targetId,\n          syncTime = utils.int64ToTimestamp(data.syncTime);\n      var list = [];\n      utils.forEach(msgList, function (msgData) {\n        var msg = self.formatReceivedMessage(msgData, option);\n        msg.targetId = targetId;\n        list.push(msg);\n      }, {\n        isReverse: true\n      });\n      return {\n        syncTime: syncTime,\n        list: list,\n        hasMore: !!hasMsg\n      };\n    };\n\n    _proto.formatConversationList = function formatConversationList(serverData, option) {\n      var self = this;\n      var conversationList = serverData.info;\n      var afterDecode = option.afterDecode || utils.noop;\n      conversationList = utils.map(conversationList, function (serverConversation) {\n        var msg = serverConversation.msg,\n            userId = serverConversation.userId,\n            type = serverConversation.type,\n            unreadCount = serverConversation.unreadCount;\n        msg = self.formatReceivedMessage(msg, option);\n        msg.targetId = userId;\n        var conversation = {\n          targetId: userId,\n          type: type,\n          unreadMessageCount: unreadCount,\n          latestMessage: msg\n        };\n        return afterDecode(conversation) || conversation;\n      });\n      return conversationList || [];\n    };\n\n    _proto.formatChatRoomInfos = function formatChatRoomInfos(data) {\n      var userTotalNums = data.userTotalNums,\n          userInfos = data.userInfos;\n      userInfos = utils.map(userInfos, function (user) {\n        var id = user.id,\n            time = user.time;\n        time = utils.int64ToTimestamp(time);\n        return {\n          id: id,\n          time: time\n        };\n      });\n      return {\n        userCount: userTotalNums,\n        userInfos: userInfos\n      };\n    };\n\n    _proto.formatRTCUserList = function formatRTCUserList(rtcInfos) {\n      var list = rtcInfos.list,\n          token = rtcInfos.token,\n          sessionId = rtcInfos.sessionId;\n      var users = {};\n      utils.forEach(list, function (item) {\n        var userId = item.userId,\n            userData = item.userData;\n        var tmpData = {};\n        utils.forEach(userData, function (data) {\n          var key = data.key,\n              value = data.value;\n          tmpData[key] = value;\n        });\n        users[userId] = tmpData;\n      });\n      return {\n        users: users,\n        token: token,\n        sessionId: sessionId\n      };\n    };\n\n    _proto.formatRTCData = function formatRTCData(data) {\n      var list = data.outInfo;\n      var props = {};\n      utils.forEach(list, function (item) {\n        props[item.key] = item.value;\n      });\n      return props;\n    };\n\n    _proto.formatRTCRoomInfo = function formatRTCRoomInfo(data) {\n      var id = data.roomId,\n          total = data.userCount,\n          roomData = data.roomData;\n      var room = {\n        id: id,\n        total: total\n      };\n      utils.forEach(roomData, function (data) {\n        room[data.key] = data.value;\n      });\n      return room;\n    };\n\n    _proto.formatChatRoomKVList = function formatChatRoomKVList(data) {\n      var kvEntries = data.entries,\n          isFullUpdate = data.bFullUpdate,\n          syncTime = data.syncTime;\n      kvEntries = kvEntries || [];\n      kvEntries = utils.map(kvEntries, function (kv) {\n        var key = kv.key,\n            value = kv.value,\n            status = kv.status,\n            timestamp = kv.timestamp,\n            uid = kv.uid;\n\n        var _common$getChatRoomKV = common.getChatRoomKVByStatus(status),\n            isAutoDelete = _common$getChatRoomKV.isAutoDelete,\n            isOverwrite = _common$getChatRoomKV.isOverwrite,\n            type = _common$getChatRoomKV.type;\n\n        return {\n          key: key,\n          value: value,\n          isAutoDelete: isAutoDelete,\n          isOverwrite: isOverwrite,\n          type: type,\n          userId: uid,\n          timestamp: utils.int64ToTimestamp(timestamp)\n        };\n      });\n      return {\n        kvEntries: kvEntries,\n        isFullUpdate: isFullUpdate,\n        syncTime: syncTime\n      };\n    };\n\n    _proto.formatUserSetting = function formatUserSetting(data) {\n      var self = this;\n      var items = data.items,\n          version = data.version;\n      var settings = {};\n      utils.forEach(items || [], function (setting) {\n        var key = setting.key,\n            version = setting.version,\n            value = setting.value;\n        setting.version = utils.int64ToTimestamp(version);\n        setting.value = self.formatBytes(value);\n        settings[key] = setting;\n      });\n      return {\n        settings: settings,\n        version: version\n      };\n    };\n\n    _proto.formatConversationStatus = function formatConversationStatus(data) {\n      var stateList = data.state;\n      var statusList = [];\n      utils.forEach(stateList, function (session) {\n        var type = session.type,\n            targetId = session.channelId,\n            updatedTime = session.time,\n            stateItem = session.stateItem;\n        var notificationStatus = NOTIFICATION_STATUS.NOTIFY,\n            isTop = false;\n        utils.forEach(stateItem, function (_ref) {\n          var sessionStateType = _ref.sessionStateType,\n              value = _ref.value;\n\n          switch (sessionStateType) {\n            case CONVERSATION_STATUS_TYPE.DO_NOT_DISTURB:\n              notificationStatus = utils.isEqual(value, CONVERSATION_STATUS_CONFIG.ENABLED) ? NOTIFICATION_STATUS.DO_NOT_DISTURB : NOTIFICATION_STATUS.NOTIFY;\n              break;\n\n            case CONVERSATION_STATUS_TYPE.TOP:\n              isTop = utils.isEqual(value, CONVERSATION_STATUS_CONFIG.ENABLED);\n              break;\n\n            default:\n              break;\n          }\n        });\n        statusList.push({\n          type: type,\n          targetId: targetId,\n          notificationStatus: notificationStatus,\n          isTop: isTop,\n          updatedTime: utils.int64ToTimestamp(updatedTime)\n        });\n      });\n      return statusList;\n    };\n\n    _proto.encodeServerConfParams = function encodeServerConfParams() {\n      var modules = this.codec.getModule(PBName.SessionsAttQryInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.getUpMsgModule = function getUpMsgModule(conversation, option) {\n      var type = conversation.type;\n      var messageType = option.messageType,\n          isMentiond = option.isMentiond,\n          mentiondType = option.mentiondType,\n          mentiondUserIdList = option.mentiondUserIdList,\n          content = option.content,\n          pushContent = option.pushContent,\n          pushData = option.pushData,\n          directionalUserIdList = option.directionalUserIdList,\n          isFilerWhiteBlacklist = option.isFilerWhiteBlacklist,\n          isVoipPush = option.isVoipPush;\n      var isGroupType = common.isGroup(type);\n      var modules = this.codec.getModule(PBName.UpStreamMessage);\n      var sessionId = common.getSessionId(option);\n      var flag = 0;\n      modules.setSessionId(sessionId);\n\n      if (isGroupType && isMentiond && content) {\n        content.mentionedInfo = {\n          userIdList: mentiondUserIdList,\n          type: mentiondType || MENTIOND_TYPE.ALL\n        };\n      }\n\n      pushContent && modules.setPushText(pushContent);\n      pushData && modules.setAppData(pushData);\n      directionalUserIdList && modules.setUserId(directionalUserIdList);\n      flag |= isVoipPush ? 0x01 : 0;\n      flag |= isFilerWhiteBlacklist ? 0x02 : 0;\n      modules.setConfigFlag(flag);\n      modules.setClassname(messageType);\n      modules.setContent(utils.toJSON(content));\n      return modules;\n    };\n\n    _proto.encodeUpMsg = function encodeUpMsg(conversation, option) {\n      var modules = this.getUpMsgModule(conversation, option);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSyncMsg = function encodeSyncMsg(syncMsgArgs) {\n      var sendboxTime = syncMsgArgs.sendboxTime,\n          inboxTime = syncMsgArgs.inboxTime;\n      var modules = this.codec.getModule(PBName.SyncRequestMsg);\n      modules.setIspolling(false);\n      modules.setIsPullSend(true);\n      modules.setSendBoxSyncTime(sendboxTime);\n      modules.setSyncTime(inboxTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeChrmSyncMsg = function encodeChrmSyncMsg(time, count) {\n      time = time || 0;\n      count = count || 0;\n      var modules = this.codec.getModule(PBName.ChrmPullMsg);\n      modules.setCount(count);\n      modules.setSyncTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetHistoryMsg = function encodeGetHistoryMsg(conversation, option) {\n      var targetId = conversation.targetId;\n      var count = option.count,\n          order = option.order,\n          timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.HistoryMsgInput);\n      modules.setTargetId(targetId);\n      modules.setTime(timestrap);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationList = function encodeGetConversationList(option) {\n      option = option || {};\n      var _option2 = option,\n          count = _option2.count,\n          startTime = _option2.startTime;\n      var modules = this.codec.getModule(PBName.RelationQryInput);\n      modules.setType(1);\n      modules.setCount(count);\n      modules.setStartTime(startTime);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeOldConversationList = function encodeOldConversationList(option) {\n      option = option || {};\n      var _option3 = option,\n          count = _option3.count,\n          type = _option3.type;\n      var modules = this.codec.getModule(PBName.RelationsInput);\n      type = type || CONVERSATION_TYPE.PRIVATE;\n      count = count || 0;\n      modules.setType(type);\n      modules.setCount(count);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveConversationList = function encodeRemoveConversationList(conversationList) {\n      var _this = this;\n\n      var modules = this.codec.getModule(PBName.DeleteSessionsInput);\n      var sessions = [];\n      utils.forEach(conversationList, function (conversation) {\n        var type = conversation.type,\n            targetId = conversation.targetId;\n\n        var session = _this.codec.getModule(PBName.SessionInfo);\n\n        session.setType(type);\n        session.setChannelId(targetId);\n        sessions.push(session);\n      });\n      modules.setSessions(sessions);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeDeleteMessages = function encodeDeleteMessages(conversation, messages) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var modules = this.codec.getModule(PBName.DeleteMsgInput);\n      var encodeMsgs = [];\n      utils.forEach(messages, function (message) {\n        encodeMsgs.push({\n          msgId: message.messageUId,\n          msgDataTime: message.sentTime,\n          direct: message.messageDirection\n        });\n      });\n      modules.setType(type);\n      modules.setConversationId(targetId);\n      modules.setMsgs(encodeMsgs);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearMessages = function encodeClearMessages(conversation, option) {\n      var targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.CleanHisMsgInput);\n      timestrap = timestrap || utils.getCurrentTimestamp();\n      modules.setDataTime(timestrap);\n      modules.setTargetId(targetId);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeClearUnreadCount = function encodeClearUnreadCount(conversation, option) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var timestrap = option.timestrap;\n      var modules = this.codec.getModule(PBName.SessionMsgReadInput);\n      timestrap = timestrap || +new Date();\n      modules.setType(type);\n      modules.setChannelId(targetId);\n      modules.setMsgTime(timestrap);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinOrQuitChatRoom = function encodeJoinOrQuitChatRoom() {\n      var modules = this.codec.getModule(PBName.ChrmInput);\n      modules.setNothing(1);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetChatRoomInfo = function encodeGetChatRoomInfo(option) {\n      option = option || {};\n      var _option4 = option,\n          count = _option4.count,\n          order = _option4.order;\n      var modules = this.codec.getModule(PBName.QueryChatRoomInfoInput);\n      modules.setCount(count);\n      modules.setOrder(order);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeJoinRTCRoom = function encodeJoinRTCRoom(room) {\n      var mode = room.mode,\n          broadcastType = room.broadcastType;\n      var modules = this.codec.getModule(PBName.RtcInput);\n      mode = mode || 0;\n      modules.setRoomType(mode);\n      !utils.isUndefined(broadcastType) && modules.setBroadcastType(broadcastType);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeQuitRTCRoom = function encodeQuitRTCRoom() {\n      return this.codec.getModule(PBName.SetUserStatusInput).getArrayData();\n    };\n\n    _proto.encodeSetRTCData = function encodeSetRTCData(key, value, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcSetDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(key);\n      modules.setValue(value);\n      message = message || {};\n      var _message = message,\n          name = _message.name,\n          content = _message.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCData = function encodeGetRTCData(keys, isInner, apiType) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCData = function encodeRemoveRTCData(keys, isInner, apiType, message) {\n      var modules = this.codec.getModule(PBName.RtcDataInput);\n      modules.setInterior(isInner);\n      modules.setTarget(apiType);\n      modules.setKey(keys);\n      message = message || {};\n      var _message2 = message,\n          name = _message2.name,\n          content = _message2.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCOutData = function encodeSetRTCOutData(data, type, message) {\n      var modules = this.codec.getModule(PBName.RtcSetOutDataInput);\n      modules.setTarget(type);\n\n      if (!utils.isArray(data)) {\n        data = [data];\n      }\n\n      utils.forEach(data, function (item, index) {\n        item.key = item.key ? item.key.toString() : item.key;\n        item.value = item.value ? item.value.toString() : item.value;\n        data[index] = item;\n      });\n      modules.setValueInfo(data);\n      message = message || {};\n      var _message3 = message,\n          name = _message3.name,\n          content = _message3.content;\n      !utils.isUndefined(name) && modules.setObjectName(name);\n\n      if (!utils.isUndefined(content)) {\n        if (utils.isObject(content)) {\n          content = utils.toJSON(content);\n        }\n\n        modules.setContent(content);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.ecnodeGetRTCOutData = function ecnodeGetRTCOutData(userIds) {\n      var modules = this.codec.getModule(PBName.RtcQryUserOutDataInput);\n      modules.setUserId(userIds);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCState = function encodeSetRTCState(content) {\n      var modules = this.codec.getModule(PBName.MCFollowInput);\n      var report = content.report;\n      modules.setId(report);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetRTCRoomInfo = function encodeGetRTCRoomInfo() {\n      var modules = this.codec.getModule(PBName.RtcQueryListInput);\n      modules.setOrder(2);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetRTCUserInfo = function encodeSetRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcValueInfo);\n      var key = info.key,\n          value = info.value;\n      modules.setKey(key);\n      modules.setValue(value);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeRemoveRTCUserInfo = function encodeRemoveRTCUserInfo(info) {\n      var modules = this.codec.getModule(PBName.RtcKeyDeleteInput);\n      var keys = info.keys || [];\n\n      if (!utils.isArray(keys)) {\n        keys = [keys];\n      }\n\n      modules.setKey(keys);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileToken = function encodeGetFileToken(fileType, fileName) {\n      var modules = this.codec.getModule(PBName.GetQNupTokenInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetFileUrl = function encodeGetFileUrl(fileType, fileName, originName) {\n      var modules = this.codec.getModule(PBName.GetQNdownloadUrlInput);\n      modules.setType(fileType);\n      modules.setKey(fileName);\n\n      if (originName) {\n        modules.setFileName(originName);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodeModifyChatRoomKV = function encodeModifyChatRoomKV(chrm, entry, action, currentUserId) {\n      var modules = this.codec.getModule(PBName.SetChrmKV);\n      var key = entry.key,\n          value = entry.value,\n          extra = entry.notificationExtra,\n          isSendNotification = entry.isSendNotification;\n      var status = common.getChatRoomKVOptStatus(entry, action);\n      var serverEntry = {\n        key: key,\n        status: status,\n        value: value || '',\n        uid: currentUserId\n      };\n\n      if (utils.isEmpty(serverEntry.status)) {\n        delete serverEntry.status;\n      }\n\n      modules.setEntry(serverEntry);\n\n      if (isSendNotification) {\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: chrm.id\n        };\n        var msgContent = {\n          key: key,\n          value: value,\n          extra: extra,\n          type: action\n        };\n        var msgModule = this.getUpMsgModule(conversation, {\n          messageType: MESSAGE_TYPE.CHRM_KV_NOTIFY,\n          content: msgContent,\n          isPersited: false,\n          isCounted: false\n        });\n        modules.setNotification(msgModule);\n        modules.setBNotify(true);\n        modules.setType(CONVERSATION_TYPE.CHATROOM);\n      }\n\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullChatRoomKV = function encodePullChatRoomKV(time) {\n      var modules = this.codec.getModule(PBName.QueryChrmKV);\n      modules.setTimestamp(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodePullUserSetting = function encodePullUserSetting(version) {\n      var modules = this.codec.getModule(PBName.PullUserSettingInput);\n      modules.setVersion(version);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeGetConversationStatus = function encodeGetConversationStatus(time) {\n      var modules = this.codec.getModule(PBName.SessionReq);\n      modules.setTime(time);\n      return modules.getArrayData();\n    };\n\n    _proto.encodeSetConversationStatus = function encodeSetConversationStatus(statusList) {\n      var _this2 = this;\n\n      var modules = this.codec.getModule(PBName.SessionStateModifyReq),\n          currentTime = common.DelayTimer.getTime();\n      var stateModuleList = [];\n      utils.forEach(statusList, function (status) {\n        var stateModules = _this2.codec.getModule(PBName.SessionState);\n\n        var type = status.type,\n            targetId = status.targetId,\n            notificationStatus = status.notificationStatus,\n            isTop = status.isTop;\n        var stateItemModuleList = [];\n        stateModules.setType(type);\n        stateModules.setChannelId(targetId);\n        stateModules.setTime(currentTime);\n        var isNotDisturb = utils.isEqual(notificationStatus, NOTIFICATION_STATUS.DO_NOT_DISTURB);\n        var TypeToVal = {};\n\n        if (!utils.isUndefined(notificationStatus)) {\n          TypeToVal[CONVERSATION_STATUS_TYPE.DO_NOT_DISTURB] = isNotDisturb;\n        }\n\n        if (!utils.isUndefined(isTop)) {\n          TypeToVal[CONVERSATION_STATUS_TYPE.TOP] = isTop;\n        }\n\n        utils.forEach(TypeToVal, function (val, type) {\n          if (!utils.isUndefined(val)) {\n            var stateItemModules = _this2.codec.getModule(PBName.SessionStateItem);\n\n            val = val ? CONVERSATION_STATUS_CONFIG.ENABLED : CONVERSATION_STATUS_CONFIG.DISABLED;\n            stateItemModules.setSessionStateType(Number(type));\n            stateItemModules.setValue(val);\n            stateItemModuleList.push(stateItemModules);\n          }\n        });\n        stateModules.setStateItem(stateItemModuleList);\n        stateModuleList.push(stateModules);\n      });\n      modules.setVersion(currentTime);\n      modules.setState(stateModuleList);\n      return modules.getArrayData();\n    };\n\n    return Codec$$1;\n  }();\n\n  var DeferHandler$3 = utils.DeferHandler,\n      Defer$2 = utils.Defer;\n  var SignalId$1 = common.SignalId;\n\n  var ServerEngine = function () {\n    function ServerEngine(option) {\n      this._transporter = void 0;\n      this._serverEventEmitter = new utils.EventEmitter();\n      this._deferHandler = new DeferHandler$3();\n      this._serverDataCodec = void 0;\n      this._selfUserId = void 0;\n      this._connectedTime = void 0;\n      this.option = void 0;\n      var self = this;\n      var transporter = new Transporter(option);\n      transporter.watchSignal(function (signal) {\n        self._handleSignal(signal);\n      });\n      transporter.watchStatus(function (status) {\n        Logger.info(TAG.L_NETWORK_CHANGED_S, status);\n\n        self._handleStatus(status);\n      });\n      self._serverDataCodec = new Codec$2(option);\n      utils.extend(self, {\n        _transporter: transporter,\n        option: option\n      });\n    }\n\n    var _proto = ServerEngine.prototype;\n\n    _proto._handleStatus = function _handleStatus(status) {\n      if (common.isDisconnected(status)) {\n        this.disconnect();\n        var currentTime = utils.getCurrentTimestamp();\n        var isDisconnectTooFast = currentTime - this._connectedTime < MINIMUM_CONNECT_DURATION;\n        var NotSwitchStauts = [TRANSPORTER_STATUS.KICKED_OFFLINE_BY_OTHER_CLIENT];\n\n        if (isDisconnectTooFast && !utils.isInclude(NotSwitchStauts, status)) {\n          return this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, TRANSPORTER_STATUS.DISCONNECT_TOO_FAST);\n        }\n      }\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.STATUS, status);\n    };\n\n    _proto._handleSignal = function _handleSignal(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler;\n      var messageId = signal.messageId;\n\n      if (messageId && signal.getIdentifier) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.resolve(deferId, signal);\n      }\n\n      self._handleSignalAck(signal);\n\n      self._dispatchTask(signal);\n    };\n\n    _proto._handleSignalAck = function _handleSignalAck(signal) {\n      var _transporter = this._transporter;\n      var messageId = signal.messageId;\n      var isQosNeedAck = signal._header && signal._header.qos !== QOS.AT_MOST_ONCE;\n\n      if (signal instanceof PublishReader && !signal.syncMsg && isQosNeedAck) {\n        var writer = new PubAckWriter(messageId);\n\n        _transporter.sendSignal(writer);\n      }\n\n      if (signal instanceof QueryAckReader && isQosNeedAck) {\n        var _writer = new QueryConWriter(messageId);\n\n        _transporter.sendSignal(_writer);\n      }\n    };\n\n    _proto._dispatchTask = function _dispatchTask(signal) {\n      var self = this;\n\n      if (signal instanceof DisconnectReader) {\n        var status = signal.status;\n        status = SERVER_DISCONNECT_STATUS_TO_TRANSPORTER_STATUS[status] || status;\n        return self._handleStatus(status);\n      }\n\n      if (signal instanceof PublishReader) {\n        var _PUBLISH_TOPIC$NOTIFY;\n\n        var isSyncMsgSentBySelfOtherClient = signal.syncMsg,\n            topic = signal.topic;\n\n        if (isSyncMsgSentBySelfOtherClient) {\n          return self._receiveMsgFromOtherDevice(signal);\n        }\n\n        var task = (_PUBLISH_TOPIC$NOTIFY = {}, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.NOTIFY_PULL_MSG] = self._notifyPullMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.RECEIVE_MSG] = self._notifyDirectMessage, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SERVER_NOTIFY] = self._notifyForServer, _PUBLISH_TOPIC$NOTIFY[PUBLISH_TOPIC.SETTING_NOTIFY] = self._notifySettingChanged, _PUBLISH_TOPIC$NOTIFY)[topic] || utils.noop;\n        task.call(self, signal);\n      }\n    };\n\n    _proto._notifyPullMessage = function _notifyPullMessage(signal) {\n      var notifyPullConfig = this._serverDataCodec.decodeByPBName(signal.data, PBName.NotifyMsg);\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.NOTIFY_PULL, notifyPullConfig);\n    };\n\n    _proto._notifyDirectMessage = function _notifyDirectMessage(signal) {\n      var currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n\n      var msg = this._serverDataCodec.decodeByPBName(signal.data, PBName.DownStreamMessage, {\n        currentUserId: currentUserId,\n        connectedTime: connectedTime\n      });\n\n      this._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n    };\n\n    _proto._notifyForServer = function _notifyForServer(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.ChrmNotifyMsg),\n          type = notifyData.type;\n\n      Logger.info(TAG.P_NOTIFY_CHRM_KV_S, notifyData);\n\n      switch (type) {\n        case SERVER_NOTIFY_TYPE.KV_CHANGED:\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_CHANGED, notifyData);\n\n          break;\n\n        case SERVER_NOTIFY_TYPE.CONVERSATION_STATUS_CHANGED:\n          self._serverEventEmitter.emit(SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED, notifyData.time);\n\n          break;\n\n        default:\n          break;\n      }\n    };\n\n    _proto._notifySettingChanged = function _notifySettingChanged(signal) {\n      var self = this,\n          notifyData = self._serverDataCodec.decodeByPBName(signal.data, PBName.UserSettingNotification);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.USER_SETTING_CHANGED, notifyData);\n    };\n\n    _proto._sendSignal = function _sendSignal(writer, decodePBName, option) {\n      var appkey = this.option.appkey,\n          _serverDataCodec = this._serverDataCodec;\n      var _transporter = this._transporter,\n          _deferHandler = this._deferHandler,\n          currentUserId = this._selfUserId,\n          connectedTime = this._connectedTime;\n      var signalId = SignalId$1.get({\n        appkey: appkey,\n        userId: currentUserId\n      });\n\n      if (SignalId$1.isExceedLimit(signalId)) {\n        this._handleStatus(TRANSPORTER_STATUS.EXCEED_MESSAGE_ID_LIMIT);\n\n        return utils.Defer.reject(ERROR_INFO.TIMEOUT);\n      }\n\n      writer.messageId = signalId;\n      var deferId = writer.getIdentifier();\n      return utils.deferred(function (resolve, reject) {\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n\n        _transporter.sendSignal(writer);\n      }).then(function (signal) {\n        var status = signal.status,\n            data = signal.data;\n        var isSuccess = utils.isEqual(status, SUCCESS_CODE);\n        var result = isSuccess ? signal : {\n          status: SERVER_ERROR_TO_CODE[status] || status\n        };\n\n        if (isSuccess && decodePBName) {\n          signal.data = _serverDataCodec.decodeByPBName(data, decodePBName, utils.extend({\n            signal: signal,\n            currentUserId: currentUserId,\n            connectedTime: connectedTime\n          }, option));\n        }\n\n        var exec = isSuccess ? Defer$2.resolve : Defer$2.reject;\n        return exec.call(Defer$2, result);\n      });\n    };\n\n    _proto._sendSignalForData = function _sendSignalForData(writer, decodePBName, option) {\n      return this._sendSignal(writer, decodePBName, option).then(function (successSignal) {\n        var data = decodePBName ? successSignal.data : undefined;\n        return data;\n      });\n    };\n\n    _proto._receiveMsgFromOtherDevice = function _receiveMsgFromOtherDevice(signal) {\n      var self = this;\n      var _deferHandler = self._deferHandler,\n          currentUserId = self._selfUserId,\n          connectType = self.option.connectType,\n          _serverDataCodec = self._serverDataCodec;\n      var isComet = connectType === CONNECT_TYPE.COMET;\n\n      var msg = _serverDataCodec.decodeByPBName(signal.data, PBName.UpStreamMessage, {\n        currentUserId: currentUserId,\n        signal: signal\n      });\n\n      if (isComet) {\n        msg.sentTime = common.DelayTimer.getTime();\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      }\n\n      return utils.deferred(function (resolve, reject) {\n        var deferId = signal.getIdentifier();\n\n        _deferHandler.add(deferId, {\n          resolve: resolve,\n          reject: reject\n        });\n      }).then(function (ackSignal) {\n        msg.messageUId = ackSignal.messageUId;\n        msg.sentTime = ackSignal.timestamp;\n        return self._serverEventEmitter.emit(SERVER_EVENT_NAME.DIRECT_MSG, msg);\n      })[\"catch\"](function (error) {\n        Logger.error(TAG.L_CRASH_F, {\n          content: {\n            info: 'received msg from other device error',\n            error: error,\n            msg: msg\n          }\n        });\n      });\n    };\n\n    _proto.watch = function watch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.on(eventName, event);\n      });\n    };\n\n    _proto.unwatch = function unwatch(events) {\n      var self = this;\n      events = events || {};\n      utils.forEach(events, function (event, eventName) {\n        utils.isFunction(event) && self._serverEventEmitter.off(eventName, event);\n      });\n    };\n\n    _proto.connect = function connect(user, option) {\n      var self = this;\n      var _transporter = self._transporter;\n      return _transporter.connect(user, option).then(function (result) {\n        var isConnectSuccess = utils.isEqual(result.status, SUCCESS_CODE);\n        return isConnectSuccess ? Defer$2.resolve(result) : Defer$2.reject(result);\n      }).then(function (_ref) {\n        var userId = _ref.userId,\n            timestamp = _ref.timestamp;\n        self._selfUserId = userId;\n        self._connectedTime = timestamp;\n        return {\n          id: userId\n        };\n      }, function (_ref2) {\n        var status = _ref2.status;\n        var errorInfo = CONNECT_SERVER_STATUS_MAP_ERROR_INFO[status] || {\n          code: status\n        };\n        return utils.Defer.reject(errorInfo);\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      var appkey = this.option.appkey;\n      var _transporter = this._transporter,\n          _selfUserId = this._selfUserId;\n      _transporter && _transporter.disconnect();\n      SignalId$1.clear({\n        appkey: appkey,\n        userId: _selfUserId\n      });\n      return Defer$2.resolve(_selfUserId);\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      var connectedTime = this._connectedTime;\n      return connectedTime;\n    };\n\n    _proto.getServerConfig = function getServerConfig() {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeServerConfParams();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_SYNC_TIME, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.SessionsAttOutput);\n    };\n\n    _proto.pullMessageList = function pullMessageList(syncMsgArgs, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeSyncMsg(syncMsgArgs);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_MSG, data, _selfUserId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.pullChrmMessageList = function pullChrmMessageList(chatRoomId, time, count, option) {\n      time = time || 0;\n      count = count || 0;\n\n      var data = this._serverDataCodec.encodeChrmSyncMsg(time, count);\n\n      var writer = new QueryWriter(QUERY_TOPIC.PULL_CHRM_MSG, data, chatRoomId);\n      writer.setHeaderQos(QOS.AT_LEAST_ONCE);\n      return this._sendSignalForData(writer, PBName.DownStreamMessages, option);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, sendOption, topic) {\n      var self = this;\n      var currentUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec;\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var isStatusMessage = sendOption.isStatusMessage;\n      isStatusMessage = isStatusMessage && common.isSupportStatusMessage(type);\n      var publishTopic = topic || CONVERSATION_TYPE_TO_PUBLISH_TOPIC[type] || PUBLISH_TOPIC.PRIVATE;\n\n      if (isStatusMessage && utils.isUndefined(topic)) {\n        publishTopic = CONVERSATION_TYPE_TO_PUBLISH_STATUS_TOPIC[type];\n      }\n\n      var data = _serverDataCodec.encodeUpMsg(conversation, sendOption);\n\n      var signal = new PublishWriter(publishTopic, data, targetId);\n      signal.setHeaderQos(QOS.AT_LEAST_ONCE);\n\n      var msg = _serverDataCodec.decodeByPBName(data, PBName.UpStreamMessage, {\n        signal: signal,\n        currentUserId: currentUserId\n      });\n\n      if (isStatusMessage) {\n        self._sendSignal(signal)[\"catch\"](function () {});\n\n        msg.sentTime = common.DelayTimer.getTime();\n        return utils.Defer.resolve(msg);\n      }\n\n      return self._sendSignal(signal).then(function (_ref3) {\n        var messageUId = _ref3.messageUId,\n            timestamp = _ref3.timestamp;\n        msg.messageUId = messageUId;\n        msg.sentTime = timestamp;\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.MESSAGE_SEND, msg);\n\n        return msg;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var upMsgArgs = utils.extend(option || {}, message);\n      var type = conversation.type,\n          targetId = conversation.targetId;\n      var messageUId = message.messageUId,\n          sentTime = message.sentTime;\n      upMsgArgs.messageType = RECALL_MESSAGE_TYPE;\n      upMsgArgs.content = {\n        conversationType: type,\n        targetId: targetId,\n        messageUId: messageUId,\n        sentTime: sentTime\n      };\n      return this.sendMessage({\n        type: type,\n        targetId: this._selfUserId\n      }, upMsgArgs, PUBLISH_TOPIC.RECALL);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, fileName) {\n      var data = this._serverDataCodec.encodeGetFileToken(fileType, fileName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_TOKEN, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNupTokenOutput);\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName) {\n      var data = this._serverDataCodec.encodeGetFileUrl(fileType, fileName, originName);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_UPLOAD_FILE_URL, data, this._selfUserId);\n      return this._sendSignalForData(writer, PBName.GetQNdownloadUrlOutput);\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeGetConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.RelationsOutput);\n    };\n\n    _proto.removeConversationList = function removeConversationList(conversationList) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n\n      var data = _serverDataCodec.encodeRemoveConversationList(conversationList);\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_CONVERSATION_LIST, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.DeleteSessionsOutput);\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      return this.removeConversationList([conversation]);\n    };\n\n    _proto.getHistoryMessages = function getHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var type = conversation.type;\n      var historyTopic = CONVERSATION_TYPE_TO_QUERY_HISTORY_TOPIC[type] || QUERY_HISTORY_TOPIC.PRIVATE;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.deleteHistoryMessages = function deleteHistoryMessages(conversation, messages) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeDeleteMessages(conversation, messages);\n\n      var writer = new QueryWriter(QUERY_TOPIC.DELETE_MESSAGES, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.clearHistoryMessages = function clearHistoryMessages(conversation, option) {\n      var _selfUserId = this._selfUserId;\n      var type = conversation.type;\n\n      var data = this._serverDataCodec.encodeClearMessages(conversation, option);\n\n      var topic = CONVERSATION_TYPE_TO_CLEAR_MESSAGE_TOPIC[type];\n      var writer = new QueryWriter(topic, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      return this.getServerConfig().then(function (_ref4) {\n        var totalUnreadCount = _ref4.totalUnreadCount;\n        return totalUnreadCount;\n      });\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var _selfUserId = this._selfUserId;\n\n      var data = this._serverDataCodec.encodeClearUnreadCount(conversation, option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.CLEAR_UNREAD_COUNT, data, _selfUserId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var id = chrm.id;\n      var count = option.count;\n\n      var data = self._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_CHATROOM, data, id);\n\n      self._serverEventEmitter.emit(SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM, {\n        id: id\n      });\n\n      return self._sendSignalForData(writer).then(function (result) {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.JOIN_CHATROOM, {\n          id: id,\n          count: count\n        });\n\n        return result;\n      });\n    };\n\n    _proto.quitChatRoom = function quitChatRoom(chrm) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeJoinOrQuitChatRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_CHATROOM, data, id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getChatRoomInfo = function getChatRoomInfo(chrm, option) {\n      var id = chrm.id;\n\n      var data = this._serverDataCodec.encodeGetChatRoomInfo(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_CHATROOM_INFO, data, id);\n      return this._sendSignalForData(writer, PBName.QueryChatRoomInfoOutput);\n    };\n\n    _proto.getChatRoomHistoryMessages = function getChatRoomHistoryMessages(chrm, option) {\n      var _selfUserId = this._selfUserId,\n          _serverDataCodec = this._serverDataCodec;\n      var targetId = chrm.id;\n      var type = CONVERSATION_TYPE.CHATROOM;\n      var conversation = {\n        type: type,\n        targetId: targetId\n      };\n      var historyTopic = QUERY_HISTORY_TOPIC.CHATROOM;\n\n      var data = _serverDataCodec.encodeGetHistoryMsg(conversation, option);\n\n      var writer = new QueryWriter(historyTopic, data, _selfUserId);\n      return this._sendSignalForData(writer, PBName.HistoryMsgOuput, {\n        conversation: conversation\n      });\n    };\n\n    _proto.modifyChatRoomKV = function modifyChatRoomKV(chrm, entry) {\n      var self = this;\n\n      var _selfUserId = self._selfUserId,\n          _serverDataCodec = self._serverDataCodec,\n          chatRoomId = chrm.id,\n          action = entry.type || CHATROOM_ENTRY_TYPE.UPDATE,\n          data = _serverDataCodec.encodeModifyChatRoomKV(chrm, entry, action, _selfUserId),\n          topic = utils.isEqual(action, CHATROOM_ENTRY_TYPE.DELETE) ? QUERY_TOPIC.DELETE_CHATROOM_KV : QUERY_TOPIC.UPDATE_CHATROOM_KV,\n          writer = new QueryWriter(topic, data, chatRoomId);\n\n      return this._sendSignalForData(writer).then(function () {\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CHRM_KV_SET, {\n          id: chatRoomId,\n          data: {\n            kvEntries: [entry],\n            syncTime: common.DelayTimer.getTime()\n          }\n        });\n      });\n    };\n\n    _proto.pullChatRoomKV = function pullChatRoomKV(chrm, time) {\n      var _serverDataCodec = this._serverDataCodec,\n          chatRoomId = chrm.id,\n          data = _serverDataCodec.encodePullChatRoomKV(time),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_CHATROOM_KV, data, chatRoomId);\n\n      return this._sendSignalForData(writer, PBName.ChrmKVOutput);\n    };\n\n    _proto.getUserSettings = function getUserSettings(version) {\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodePullUserSetting(version),\n          writer = new QueryWriter(QUERY_TOPIC.PULL_USER_SETTING, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.PullUserSettingOutput);\n    };\n\n    _proto.getConversationStatus = function getConversationStatus(time) {\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodeGetConversationStatus(time),\n          writer = new QueryWriter(QUERY_TOPIC.GET_CONVERSATION_STATUS, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.SessionStates);\n    };\n\n    _proto.setConversationStatusList = function setConversationStatusList(statusList) {\n      var self = this;\n\n      var _serverDataCodec = this._serverDataCodec,\n          _selfUserId = this._selfUserId,\n          data = _serverDataCodec.encodeSetConversationStatus(statusList),\n          writer = new QueryWriter(QUERY_TOPIC.SET_CONVERSATION_STATUS, data, _selfUserId);\n\n      return this._sendSignalForData(writer, PBName.SessionStateModifyResp).then(function (_ref5) {\n        var version = _ref5.version;\n        statusList = utils.map(statusList, function (status) {\n          status.updatedTime = version;\n          return status;\n        });\n\n        self._serverEventEmitter.emit(SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED, statusList);\n\n        return true;\n      });\n    };\n\n    _proto.joinRTCRoom = function joinRTCRoom(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.JOIN_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.quitRTCRoom = function quitRTCRoom(room) {\n      var data = this._serverDataCodec.encodeQuitRTCRoom();\n\n      var writer = new QueryWriter(QUERY_TOPIC.QUIT_RTC_ROOM, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.RTCPing = function RTCPing(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new PublishWriter(QUERY_TOPIC.PING_RTC, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCRoomInfo = function getRTCRoomInfo(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_ROOM_INFO, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcRoomInfoOutput);\n    };\n\n    _proto.getRTCUserInfoList = function getRTCUserInfoList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_INFO_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.setRTCUserInfo = function setRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeSetRTCUserInfo(info);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.removeRTCUserInfo = function removeRTCUserInfo(room, info) {\n      var data = this._serverDataCodec.encodeRemoveRTCUserInfo(info);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_USER_INFO, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCData = function setRTCData(roomId, key, value, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeSetRTCData(key, value, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCData = function getRTCData(roomId, keys, isInner, apiType) {\n      var data = this._serverDataCodec.encodeGetRTCData(keys, isInner, apiType);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcQryOutput);\n    };\n\n    _proto.removeRTCData = function removeRTCData(roomId, keys, isInner, apiType, message) {\n      var data = this._serverDataCodec.encodeRemoveRTCData(keys, isInner, apiType, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.DEL_RTC_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.setRTCOutData = function setRTCOutData(roomId, rtcData, type, message) {\n      var data = this._serverDataCodec.encodeSetRTCOutData(rtcData, type, message);\n\n      var writer = new PublishWriter(QUERY_TOPIC.SET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCOutData = function getRTCOutData(roomId, userIds) {\n      var data = this._serverDataCodec.ecnodeGetRTCOutData(userIds);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_OUT_DATA, data, roomId);\n      return this._sendSignalForData(writer, PBName.RtcUserOutDataOutput);\n    };\n\n    _proto.getRTCToken = function getRTCToken(room) {\n      var data = this._serverDataCodec.encodeJoinRTCRoom(room);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_TOKEN, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcTokenOutput);\n    };\n\n    _proto.setRTCState = function setRTCState(room, content) {\n      var data = this._serverDataCodec.encodeSetRTCState(content);\n\n      var writer = new QueryWriter(QUERY_TOPIC.SET_RTC_STATE, data, room.id);\n      return this._sendSignalForData(writer);\n    };\n\n    _proto.getRTCUserList = function getRTCUserList(room) {\n      var data = this._serverDataCodec.encodeGetRTCRoomInfo();\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_RTC_USER_LIST, data, room.id);\n      return this._sendSignalForData(writer, PBName.RtcUserListOutput);\n    };\n\n    _proto.getOldServerConfig = function getOldServerConfig(userId) {\n      var appkey = this.option.appkey;\n      var syncTime = new common.MessageTimeSyner({\n        appkey: appkey,\n        userId: userId\n      }).get();\n      return Defer$2.resolve(syncTime);\n    };\n\n    _proto.getOldConversationList = function getOldConversationList(option, formatOpt) {\n      var self = this;\n      var _selfUserId = self._selfUserId;\n\n      var data = self._serverDataCodec.encodeOldConversationList(option);\n\n      var writer = new QueryWriter(QUERY_TOPIC.GET_OLD_CONVERSATION_LIST, data, _selfUserId);\n      return self._sendSignalForData(writer, PBName.RelationsOutput, formatOpt);\n    };\n\n    _proto.removeOldConversation = function removeOldConversation(conversation) {\n      var type = conversation.type,\n          targetId = conversation.targetId;\n\n      var data = this._serverDataCodec.encodeOldConversationList({\n        type: type\n      });\n\n      var writer = new QueryWriter(QUERY_TOPIC.REMOVE_OLD_CONVERSATION, data, targetId);\n      return this._sendSignalForData(writer);\n    };\n\n    return ServerEngine;\n  }();\n\n  var NAVIGATORS = ['nav.cn.ronghub.com', 'nav2-cn.ronghub.com'];\n  var MINI_SOCKET_DOMAIN_LIST = ['wsproxy.cn.ronghub.com', 'wsap-cn.ronghub.com'];\n  var MINI_COMET_DOMAIN_LIST = ['cometproxy-cn.ronghub.com', 'mini-cn.ronghub.com'];\n  var MINI_UPLOAD_DOMAIN_QINIU = 'https://upload.qiniup.com';\n  var MINI_UPLOAD_DOMAIN_BOS = 'https://gz.bcebos.com';\n  var NETWORK_DETECT_OPTION = {\n    url: 'https://cdn.ronghub.com/im_detecting',\n    intervalTime: 1500\n  };\n  var IM_OPTION = {\n    connectType: CONNECT_TYPE.WEBSOCKET,\n    navigators: NAVIGATORS,\n    detect: NETWORK_DETECT_OPTION,\n    isOldServer: true,\n    isDebug: false\n  };\n  var GET_MESSAGES_OPTION = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC,\n    timestrap: 0\n  };\n  var SEND_MESSAGE_OPTION = {\n    isMentiond: false,\n    isCounted: true,\n    isPersited: true\n  };\n  var GET_CHATROOM_INFO_OPTION = {\n    count: 20,\n    order: CHATROOM_ORDER.DESC\n  };\n  var CHATROOM_NOT_PULL_MSG_COUNT = -1;\n  var JOIN_CHATROOM_OPTION = {\n    count: CHATROOM_NOT_PULL_MSG_COUNT\n  };\n  var GET_CHATROOM_MESSAGES = {\n    count: 20,\n    order: MESSAGS_TIME_ORDER.DESC\n  };\n  var SEND_MESSAGE_TYPE_OPTION = {\n    'RC:TxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:VcMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:ImgTextMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:FileMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:HQVCMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:LBSMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:PSMultiImgTxtMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RCJrmf:RpOpendMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:CombineMsg': {\n      isCounted: true,\n      isPersited: true\n    },\n    'RC:InfoNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ContactNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:ProfileNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:GrpNtf': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:RcCmd': {\n      isCounted: false,\n      isPersited: true\n    },\n    'RC:CmdMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:TypSts': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:PSCmd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:SRSMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRReqMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:RRRspMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsChaR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CSCha': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEva': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsContact': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHs': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsHsR': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsSp': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsEnd': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:CsUpdate': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:ReadNtf': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:chrmKVNotiMsg': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCAccept': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCRinging': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCSummary': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCHangup': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCInvite': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMedia': {\n      isCounted: false,\n      isPersited: false\n    },\n    'RC:VCModifyMem': {\n      isCounted: false,\n      isPersited: false\n    }\n  };\n\n  var RCStorage$1 = common.RCStorage;\n\n  var LocalNaviHandler = function () {\n    function LocalNaviHandler(option) {\n      this.storage = void 0;\n      this.option = void 0;\n      var appkey = option.appkey,\n          token = option.token;\n      var UID = common.getUIDByToken(token);\n      var KEY = utils.tplEngine(STORAGE_NAVI.ROOT_KEY_TPL, {\n        appkey: appkey,\n        UID: UID\n      });\n      this.storage = new RCStorage$1(KEY);\n      this.option = option;\n    }\n\n    var _proto = LocalNaviHandler.prototype;\n\n    _proto.set = function set(resp) {\n      var connectType = this.option.connectType;\n      this.storage.set(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE, connectType);\n      this.storage.set(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED, utils.getCurrentTimestamp());\n      this.storage.set(STORAGE_NAVI.SUB_KEY.RESPONSE, resp);\n    };\n\n    _proto.clear = function clear() {\n      this.storage.clear();\n    };\n\n    _proto.getResp = function getResp() {\n      return this.storage.get(STORAGE_NAVI.SUB_KEY.RESPONSE);\n    };\n\n    _proto.isValid = function isValid() {\n      var storage = this.storage,\n          connectType = this.option.connectType;\n      var resp = this.getResp();\n\n      if (utils.isEmpty(resp)) {\n        return false;\n      }\n\n      var oldConnectType = storage.get(STORAGE_NAVI.SUB_KEY.CONNECT_TYPE);\n      var timeWhenSaved = storage.get(STORAGE_NAVI.SUB_KEY.TIME_WHEN_SAVED);\n      var isSameConnectType = utils.isEqual(oldConnectType, connectType);\n      var isNotExpired = utils.getCurrentTimestamp() - timeWhenSaved < NAVI_EXPIRED_TIME;\n      return isSameConnectType && isNotExpired;\n    };\n\n    return LocalNaviHandler;\n  }();\n\n  var getNaviUrl = function getNaviUrl(url, option) {\n    var appkey = option.appkey,\n        connectType = option.connectType,\n        token = option.token;\n    var encodeToken = utils.encodeURI(token);\n    var protocol = env.protocol.http;\n    var type = connectType === CONNECT_TYPE.COMET ? NAVI_TYPE.COMET : NAVI_TYPE.WEBSOCKET;\n    var random = utils.getCurrentTimestamp();\n    url = utils.getValidUrl(url);\n    var naviUrlOption = {\n      protocol: protocol,\n      url: url,\n      type: type,\n      appkey: appkey,\n      random: random,\n      token: encodeToken\n    };\n    return utils.tplEngine(NAVI_URL_TPL, naviUrlOption);\n  };\n\n  var parseNaviResponse = function parseNaviResponse(responseText) {\n    var startText = NAVI_CALLBACK_NAME + '(';\n    var endText = ')';\n    var startIndex = utils.indexOf(responseText, startText) + startText.length;\n    var endIndex = utils.lastIndexOf(responseText, endText);\n\n    if (startIndex === -1 || endIndex === -1) {\n      return utils.parseJSON(responseText);\n    }\n\n    var response = utils.substring(responseText, startIndex, endIndex);\n\n    if (utils.isValidJSON(response)) {\n      return utils.parseJSON(response);\n    } else {\n      return {};\n    }\n  };\n\n  var getMiniNavi = function getMiniNavi(option) {\n    var connectType = option.connectType;\n    var isComet = utils.isEqual(connectType, CONNECT_TYPE.COMET);\n    var CmpDomainList = isComet ? MINI_COMET_DOMAIN_LIST : MINI_SOCKET_DOMAIN_LIST;\n    var naviResp = {\n      backupServer: CmpDomainList.join(DOMAIN_SEPARATOR_IN_CMPLIST),\n      uploadServer: MINI_UPLOAD_DOMAIN_QINIU,\n      bosAddr: MINI_UPLOAD_DOMAIN_BOS\n    };\n    return utils.Defer.resolve(naviResp);\n  };\n\n  var NaviManager = function () {\n    function NaviManager(option) {\n      this.option = void 0;\n      this.localNaviHandler = void 0;\n      this.option = option;\n      this.localNaviHandler = new LocalNaviHandler(option);\n    }\n\n    var _proto2 = NaviManager.prototype;\n\n    _proto2.get = function get() {\n      var self = this;\n      var option = self.option,\n          localNaviHandler = self.localNaviHandler;\n      var navigators = option.navigators,\n          token = option.token;\n\n      if (env.isMini) {\n        getMiniNavi(option).then(function (miniNaviResp) {\n          localNaviHandler.set(miniNaviResp);\n          return utils.Defer.resolve(miniNaviResp);\n        });\n      }\n\n      Logger.info(TAG.L_GET_NAVI_T, {\n        navigators: navigators,\n        token: token\n      });\n      var localConfigForNavi = self.getLocalConfig();\n\n      if (localNaviHandler.isValid()) {\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'local navi',\n            localConfigForNavi: localConfigForNavi\n          }\n        });\n        return utils.Defer.resolve(localConfigForNavi);\n      }\n\n      var naviListInToken = common.getNaviListByToken(token);\n      navigators = naviListInToken.concat(navigators);\n      option.token = common.getValidToken(token);\n      var urlList = utils.map(navigators, function (url) {\n        return getNaviUrl(url, option);\n      });\n      return utils.requestByUrlList(urlList).then(function (_ref) {\n        var responseText = _ref.responseText;\n        Logger.info(TAG.L_GET_NAVI_R, {\n          content: {\n            info: 'remote navi',\n            responseText: responseText\n          }\n        });\n        var resp = parseNaviResponse(responseText);\n        var code = resp.code;\n        var isSuccess = code === NAVI_REQUEST_SUCCESS_CODE;\n\n        if (isSuccess) {\n          localNaviHandler.set(resp);\n          return resp;\n        } else if (resp && code) {\n          var error = utils.extendInShallow(NAVI_ERROR_INFO[code], {\n            msg: resp.errorMessage\n          });\n          return utils.Defer.reject(error);\n        } else {\n          return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n            error: responseText\n          }));\n        }\n      }, function (error) {\n        return utils.Defer.reject(utils.extendInShallow(ERROR_INFO.NAVI_REQUEST_ERROR, {\n          error: error\n        }));\n      });\n    };\n\n    _proto2.setLocalConfig = function setLocalConfig(config) {\n      if (utils.isObject(config)) {\n        var localConf = this.getLocalConfig() || {};\n        var newConf = utils.extend(localConf, config);\n        this.localNaviHandler.set(newConf);\n      }\n    };\n\n    _proto2.getLocalConfig = function getLocalConfig() {\n      return this.localNaviHandler.getResp();\n    };\n\n    _proto2.clear = function clear() {\n      var option = this.option;\n      var localNaviHanlder = new LocalNaviHandler(option);\n      localNaviHanlder.clear();\n    };\n\n    return NaviManager;\n  }();\n\n  var CMPManager = function () {\n    function CMPManager() {\n      this.cmpDomainList = [];\n      this.invalidDomainList = [];\n      this.option = void 0;\n    }\n\n    var _proto = CMPManager.prototype;\n\n    _proto.setDomainList = function setDomainList(cmpDomainList, option) {\n      this.cmpDomainList = cmpDomainList;\n      this.option = option || {};\n    };\n\n    _proto.getFaster = function getFaster() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList,\n          option = this.option;\n      var sniffUrlList = utils.filter(cmpDomainList, function (domain) {\n        return !utils.isInclude(invalidDomainList, domain);\n      });\n      sniffUrlList = utils.map(sniffUrlList, function (domain) {\n        var timestamp = utils.getCurrentTimestamp();\n        var url = domain + \"/ping?r=\" + timestamp;\n        return utils.getValidUrl(url, option);\n      });\n\n      if (utils.isEmpty(sniffUrlList)) {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      }\n\n      return utils.requestForFaster(sniffUrlList, {\n        timeInterval: CMP_SNIFF_INTERNAL_TIME\n      }).then(function (_ref) {\n        var url = _ref.url,\n            index = _ref.index;\n        return {\n          url: url,\n          index: index,\n          domain: utils.getDomainByUrl(url)\n        };\n      })[\"catch\"](function () {\n        return utils.Defer.reject(ERROR_INFO.CMP_REQUEST_ERROR);\n      });\n    };\n\n    _proto.addInvalid = function addInvalid(domain) {\n      this.invalidDomainList.push(domain);\n    };\n\n    _proto.clearInvalid = function clearInvalid() {\n      this.invalidDomainList.length = 0;\n    };\n\n    _proto.isAllInvalid = function isAllInvalid() {\n      var cmpDomainList = this.cmpDomainList,\n          invalidDomainList = this.invalidDomainList;\n      return utils.isEqual(cmpDomainList.length, invalidDomainList.length);\n    };\n\n    return CMPManager;\n  }();\n\n  var _STORAGE_KEY_MAP_CONV;\n  var SUB_KEY = STORAGE_CONVERSATION.SUB_KEY;\n  var STORAGE_KEY_MAP_CONVERSATION = (_STORAGE_KEY_MAP_CONV = {}, _STORAGE_KEY_MAP_CONV[SUB_KEY.UNREAD_COUNT] = {\n    keyName: 'unreadMessageCount',\n    defaultVal: 0\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.HAS_MENTIOND] = {\n    keyName: 'hasMentiond',\n    defaultVal: false\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.MENTIOND_INFO] = {\n    keyName: 'mentiondInfo',\n    defaultVal: null\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.UNREAD_LAST_TIME] = {\n    keyName: 'lastUnreadTime',\n    defaultVal: 0\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.NOTIFICATION] = {\n    keyName: 'notificationStatus',\n    defaultVal: NOTIFICATION_STATUS.NOTIFY\n  }, _STORAGE_KEY_MAP_CONV[SUB_KEY.TOP] = {\n    keyName: 'isTop',\n    defaultVal: false\n  }, _STORAGE_KEY_MAP_CONV);\n  var conversationKeyMapStorageKey = {};\n  utils.forEach(STORAGE_KEY_MAP_CONVERSATION, function (_ref, storeKey) {\n    var keyName = _ref.keyName;\n    conversationKeyMapStorageKey[keyName] = storeKey;\n  });\n  var CONVERSATION_KEY_MAP_STORAGE_KEY = conversationKeyMapStorageKey;\n\n  var ConversationStore = function () {\n    function ConversationStore(option) {\n      this._storage = void 0;\n      var StorageKey = utils.tplEngine(STORAGE_CONVERSATION.ROOT_KEY_TPL, option);\n      this._storage = new common.RCStorage(StorageKey);\n    }\n\n    var _proto = ConversationStore.prototype;\n\n    _proto.set = function set(option, conversation) {\n      conversation = conversation || {};\n      var key = common.getConversationKey(option);\n      var local = this._storage.get(key) || {};\n      utils.forEach(conversation, function (val, key) {\n        var storageKey = CONVERSATION_KEY_MAP_STORAGE_KEY[key];\n\n        if (utils.isUndefined(storageKey) || utils.isUndefined(val)) {\n          return;\n        }\n\n        var defaultVal = STORAGE_KEY_MAP_CONVERSATION[storageKey].defaultVal;\n\n        if (utils.isEqual(defaultVal, val)) {\n          delete local[storageKey];\n        } else {\n          local[storageKey] = val;\n        }\n      });\n\n      if (!local[SUB_KEY.UNREAD_COUNT]) {\n        delete local[SUB_KEY.UNREAD_LAST_TIME];\n      }\n\n      if (utils.isEmpty(local)) {\n        this._storage.remove(key);\n      } else {\n        this._storage.set(key, local);\n      }\n    };\n\n    _proto.get = function get(option) {\n      var key = common.getConversationKey(option),\n          local = this._storage.get(key) || {};\n      var conversation = {};\n      utils.forEach(STORAGE_KEY_MAP_CONVERSATION, function (val, key) {\n        var keyName = val.keyName,\n            defaultVal = val.defaultVal;\n        conversation[keyName] = local[key] || defaultVal;\n      });\n      return conversation;\n    };\n\n    _proto.getValues = function getValues(event) {\n      var setEvent = event || utils.noop;\n      var values = this._storage.getValues() || {};\n      var storeConversationList = [];\n      utils.forEach(values, function (store, key) {\n        var _common$getConversati = common.getConversationByKey(key),\n            type = _common$getConversati.type,\n            targetId = _common$getConversati.targetId;\n\n        var conversation = {};\n        utils.forEach(store, function (val, storeKey) {\n          var _ref2 = STORAGE_KEY_MAP_CONVERSATION[storeKey] || {},\n              keyName = _ref2.keyName,\n              defaultVal = _ref2.defaultVal;\n\n          conversation[keyName] = val || defaultVal;\n        });\n        conversation = utils.extend(conversation, {\n          type: type,\n          targetId: targetId\n        });\n        conversation = setEvent(conversation);\n        storeConversationList.push(conversation);\n      });\n      return storeConversationList;\n    };\n\n    return ConversationStore;\n  }();\n\n  var PullQueueManager = function () {\n    function PullQueueManager(option) {\n      this.isLoading = false;\n      this._queue = new utils.Queue();\n      this._option = void 0;\n      option = option || {};\n      this._option = option;\n    }\n\n    var _proto = PullQueueManager.prototype;\n\n    _proto._execEvent = function _execEvent() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      var self = this;\n\n      var _this$_option = this._option,\n          event = _this$_option.event,\n          thisArg = _this$_option.thisArg,\n          onBefore = this._option.onBefore || function () {\n        return args;\n      },\n          onFinished = this._option.onFinished || utils.noop,\n          onError = this._option.onError || utils.noop;\n\n      onBefore.apply(void 0, args);\n      self.isLoading = true;\n      return event.apply(thisArg, args).then(function (result) {\n        self.isLoading = false;\n        onFinished.apply(void 0, [result].concat(args));\n      })[\"catch\"](function (error) {\n        self.isLoading = false;\n        onError(error);\n      });\n    };\n\n    _proto.pull = function pull() {\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      this._queue.add({\n        event: this._execEvent,\n        args: args,\n        thisArg: this\n      });\n    };\n\n    return PullQueueManager;\n  }();\n\n  var EventName = {\n    CHANGED: 'changed'\n  };\n\n  var ConversationStatusManager = function () {\n    function ConversationStatusManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._timeStorage = void 0;\n      this._handleSetConversationStatus = void 0;\n      this._handleConversationStatusChanged = void 0;\n      var self = this,\n          userId = serverEngine._selfUserId,\n          appkey = serverEngine.option.appkey,\n          storageKey = utils.tplEngine(STORAGE_CONVERSATION_STATUS.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      }),\n          timeStorage = new common.RCStorage(storageKey),\n          firstPullTime = timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n      var pullQueue = new PullQueueManager({\n        event: self.pull,\n        thisArg: self,\n        onFinished: function onFinished(list) {\n          self._set(list);\n        }\n      });\n\n      self._handleConversationStatusChanged = function (time) {\n        pullQueue.pull(time);\n      };\n\n      self._handleSetConversationStatus = function (list) {\n        self._set(list);\n      };\n\n      self._timeStorage = timeStorage;\n      self._serverEngine = serverEngine;\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED] = self._handleConversationStatusChanged, _serverEngine$watch[SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED] = self._handleSetConversationStatus, _serverEngine$watch));\n      pullQueue.pull(firstPullTime);\n    }\n\n    var _proto = ConversationStatusManager.prototype;\n\n    _proto.watchChanged = function watchChanged(event) {\n      this._eventEmitter.on(EventName.CHANGED, event);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.CONVERSATION_STATUS_CHANGED] = this._handleConversationStatusChanged, _this$_serverEngine$u[SERVER_EVENT_NAME.CONVERSATION_STATUS_SETED] = this._handleSetConversationStatus, _this$_serverEngine$u));\n    };\n\n    _proto.pull = function pull(newPullTime) {\n      var time = this._timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n\n      if (newPullTime >= time) {\n        return this._serverEngine.getConversationStatus(time);\n      } else {\n        return utils.Defer.reject();\n      }\n    };\n\n    _proto._set = function _set(list) {\n      var self = this;\n\n      if (utils.isUndefined(list)) {\n        return;\n      }\n\n      var time = self._timeStorage.get(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME) || 0;\n      var listCount = list.length;\n      utils.forEach(list, function (statusItem, index) {\n        var updatedTime = statusItem.updatedTime || 0;\n        time = updatedTime > time ? updatedTime : time;\n\n        self._eventEmitter.emit(EventName.CHANGED, {\n          statusItem: statusItem,\n          isLastInAPull: index === listCount - 1\n        });\n      });\n\n      self._timeStorage.set(STORAGE_CONVERSATION_STATUS.SUB_KEY.TIME, time);\n    };\n\n    return ConversationStatusManager;\n  }();\n\n  var EventName$1 = {\n    CHANGED: 'conversationChanged'\n  };\n\n  var ConversationManager = function () {\n    function ConversationManager(option, serverEngine) {\n      this._selfUserId = void 0;\n      this._store = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._statusManager = void 0;\n      this._allConversationList = [];\n      this._updatedConversations = {};\n      var self = this;\n      var statusManager = new ConversationStatusManager(serverEngine);\n      statusManager.watchChanged(function (_ref) {\n        var statusItem = _ref.statusItem,\n            isLastInAPull = _ref.isLastInAPull;\n\n        self._addStatus(statusItem, isLastInAPull);\n      });\n      self._store = new ConversationStore(option);\n      self._selfUserId = option.userId;\n      self._statusManager = statusManager;\n    }\n\n    var _proto = ConversationManager.prototype;\n\n    _proto.watch = function watch(events) {\n      var conversation = events.conversation;\n\n      this._eventEmitter.on(EventName$1.CHANGED, conversation);\n    };\n\n    _proto.addMessage = function addMessage(msgArgs) {\n      var self = this;\n      var message = msgArgs.message,\n          isLastInAPull = msgArgs.isLastInAPull,\n          type = message.type,\n          isPersited = message.isPersited,\n          isSaveConversationType = utils.isInclude(TYPE_HAS_CONVERSATION, type);\n\n      if (!isSaveConversationType) {\n        return;\n      }\n\n      var hasChanged = false;\n\n      var storageConversation = self._store.get(message);\n\n      var calcEvents = [self._setUnreadCount, self._setMentiondInfo];\n      utils.forEach(calcEvents, function (event) {\n        var _event$call = event.call(self, message, storageConversation),\n            hasCalcChanged = _event$call.hasChanged,\n            conversation = _event$call.conversation;\n\n        hasChanged = hasChanged || hasCalcChanged;\n        storageConversation = conversation;\n      });\n\n      if (hasChanged) {\n        self._store.set(message, storageConversation);\n      }\n\n      if (isPersited) {\n        var conversation = self._getConversationByMessage(message);\n\n        conversation.updatedItems = {\n          latestMessage: {\n            time: message.sentTime,\n            val: message\n          }\n        };\n\n        self._setUpdatedConversation(conversation);\n      }\n\n      var isNeedNotifyUpdate = utils.isUndefined(isLastInAPull) ? true : isLastInAPull;\n\n      if (isNeedNotifyUpdate) {\n        self._notifyConversationChanged();\n      }\n    };\n\n    _proto.get = function get(option) {\n      var conversation = this._store.get(option);\n\n      var notificationStatus = conversation.notificationStatus,\n          isNotDisturb = utils.isEqual(notificationStatus, NOTIFICATION_STATUS.DO_NOT_DISTURB);\n\n      if (isNotDisturb) {\n        conversation.unreadMessageCount = 0;\n      }\n\n      return conversation;\n    };\n\n    _proto.read = function read(option) {\n      var self = this,\n          type = option.type,\n          targetId = option.targetId,\n          _store = self._store,\n          _updatedConversations = self._updatedConversations,\n          key = common.getConversationKey(option),\n          updatedConversation = _updatedConversations[key] || {};\n      var storeConversation = _store.get(option) || {},\n          _storeConversation = storeConversation,\n          unreadMessageCount = _storeConversation.unreadMessageCount,\n          hasMentiond = _storeConversation.hasMentiond;\n\n      if (unreadMessageCount || hasMentiond) {\n        var updatedTime = common.DelayTimer.getTime();\n        var updatedValues = {\n          type: type,\n          targetId: targetId,\n          unreadMessageCount: 0,\n          hasMentiond: false,\n          mentiondInfo: null,\n          updatedItems: {\n            unreadMessageCount: {\n              time: updatedTime,\n              val: 0\n            },\n            hasMentiond: {\n              time: updatedTime,\n              val: false\n            },\n            mentiondInfo: {\n              time: updatedTime,\n              val: null\n            }\n          }\n        };\n        storeConversation = utils.extendAllowNull(storeConversation, updatedValues);\n\n        _store.set(option, storeConversation);\n\n        _updatedConversations[key] = utils.extendAllowNull(updatedConversation, updatedValues);\n\n        self._notifyConversationChanged();\n      }\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var _store = this._store,\n          conversationList = _store.getValues();\n\n      var totalCount = 0;\n      utils.forEach(conversationList, function (_ref2) {\n        var unreadMessageCount = _ref2.unreadMessageCount;\n        unreadMessageCount = utils.isNumber(unreadMessageCount) ? unreadMessageCount : 0;\n        totalCount += unreadMessageCount;\n      });\n      return totalCount;\n    };\n\n    _proto.getUnreadCount = function getUnreadCount(option) {\n      var _store = this._store;\n      var storeConversation = _store.get(option) || {};\n      var unreadMessageCount = storeConversation.unreadMessageCount;\n      var count = utils.isNumber(unreadMessageCount) ? unreadMessageCount : 0;\n      return count;\n    };\n\n    _proto.close = function close() {\n      this._statusManager.close();\n    };\n\n    _proto._getConversationByMessage = function _getConversationByMessage(message) {\n      var type = message.type,\n          targetId = message.targetId,\n          storeConversation = this._store.get(message);\n\n      var conversation = utils.extend(storeConversation, {\n        type: type,\n        targetId: targetId,\n        latestMessage: message\n      });\n      return conversation;\n    };\n\n    _proto._getUpdatedConversationList = function _getUpdatedConversationList() {\n      var self = this,\n          updatedConversations = self._updatedConversations,\n          list = [];\n      utils.forEach(updatedConversations, function (conversation) {\n        var storageItems = self._store.get(conversation);\n\n        utils.forEach(storageItems, function (val, key) {\n          conversation[key] = val;\n        });\n        list.push(conversation);\n      });\n      return common.sortConversationList(list);\n    };\n\n    _proto._setUnreadCount = function _setUnreadCount(message, conversation) {\n      var content = message.content,\n          messageType = message.messageType,\n          sentTime = message.sentTime,\n          isCounted = message.isCounted,\n          messageDirection = message.messageDirection,\n          senderUserId = message.senderUserId,\n          isSelfSend = utils.isEqual(messageDirection, MESSAGE_DIRECTION.SEND) || utils.isEqual(senderUserId, this._selfUserId),\n          isRecall = utils.isEqual(messageType, RECALL_MESSAGE_TYPE),\n          hasContent = utils.isObject(content);\n      var hasChanged = false;\n      var lastUnreadTime = conversation.lastUnreadTime || 0,\n          unreadMessageCount = conversation.unreadMessageCount || 0,\n          hasBeenAdded = lastUnreadTime > sentTime;\n\n      if (hasBeenAdded || isSelfSend) {\n        return {\n          hasChanged: hasChanged,\n          conversation: conversation\n        };\n      }\n\n      if (isCounted) {\n        conversation.unreadMessageCount = unreadMessageCount + 1;\n        conversation.lastUnreadTime = sentTime;\n        hasChanged = true;\n      }\n\n      if (isRecall && hasContent) {\n        var isNotRead = lastUnreadTime >= content.sentTime;\n\n        if (isNotRead && unreadMessageCount) {\n          conversation.unreadMessageCount = unreadMessageCount - 1;\n          hasChanged = true;\n        }\n      }\n\n      return {\n        hasChanged: hasChanged,\n        conversation: conversation\n      };\n    };\n\n    _proto._setMentiondInfo = function _setMentiondInfo(message, conversation) {\n      var content = message.content,\n          messageDirection = message.messageDirection,\n          isMentiond = message.isMentiond,\n          isSelfSend = utils.isEqual(messageDirection, MESSAGE_DIRECTION.RECEIVE),\n          hasContent = utils.isObject(content);\n      var hasChanged = false;\n\n      if (isSelfSend) ; else if (isMentiond && hasContent && content.mentionedInfo) {\n        conversation.hasMentiond = true;\n        conversation.mentiondInfo = content.mentionedInfo;\n        hasChanged = true;\n      }\n\n      return {\n        hasChanged: hasChanged,\n        conversation: conversation\n      };\n    };\n\n    _proto._setUpdatedConversation = function _setUpdatedConversation(conversation) {\n      if (utils.isObject(conversation) && conversation.targetId && conversation.type) {\n        var self = this,\n            cacheKey = common.getConversationKey(conversation),\n            cacheConversation = self._updatedConversations[cacheKey];\n        self._updatedConversations[cacheKey] = utils.extendAllowNull(cacheConversation, conversation);\n      }\n    };\n\n    _proto._notifyConversationChanged = function _notifyConversationChanged() {\n      var self = this,\n          _eventEmitter = self._eventEmitter,\n          updatedConversationList = self._getUpdatedConversationList();\n\n      if (utils.isEmpty(updatedConversationList)) ; else {\n        utils.setTimeout(function () {\n          _eventEmitter.emit(EventName$1.CHANGED, {\n            updatedConversationList: updatedConversationList\n          });\n\n          self._updatedConversations = {};\n        }, 0);\n      }\n    };\n\n    _proto._addStatus = function _addStatus(conversationStatus, isLastInAPull) {\n      var type = conversationStatus.type,\n          targetId = conversationStatus.targetId,\n          updatedTime = conversationStatus.updatedTime,\n          notificationStatus = conversationStatus.notificationStatus,\n          isTop = conversationStatus.isTop,\n          option = {\n        type: type,\n        targetId: targetId\n      };\n      var updatedItems = {};\n\n      if (!utils.isUndefined(notificationStatus)) {\n        updatedItems['notificationStatus'] = {\n          time: updatedTime,\n          val: notificationStatus\n        };\n      }\n\n      if (!utils.isUndefined(isTop)) {\n        updatedItems['isTop'] = {\n          time: updatedTime,\n          val: isTop\n        };\n      }\n\n      this._setUpdatedConversation({\n        type: type,\n        targetId: targetId,\n        updatedItems: updatedItems\n      });\n\n      this._store.set(option, {\n        notificationStatus: notificationStatus,\n        isTop: isTop\n      });\n\n      if (isLastInAPull) {\n        this._notifyConversationChanged();\n      }\n    };\n\n    return ConversationManager;\n  }();\n\n  var MessageTimeSyner$1 = common.MessageTimeSyner,\n      ChatRoomMessageTimeSyner$1 = common.ChatRoomMessageTimeSyner;\n  var EVENT_NAME$1 = {\n    MESSAGE_RECEIVED: 'msg-received'\n  };\n\n  var MessagePullManager = function () {\n    function MessagePullManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._messageTimeSyner = void 0;\n      this._chatRoomMessageTimeSyner = new ChatRoomMessageTimeSyner$1();\n      this._eventEmitter = new utils.EventEmitter();\n      this._pullMessageTimer = new utils.Timer({\n        type: TIMER_TYPE.INTERVAL,\n        timeout: PULL_MSG_TIME\n      });\n      this._sentMsgCacheInPulling = {};\n      this._handleDirectMessage = void 0;\n      this._handleNotifyPull = void 0;\n      this._handleJoinChatRoom = void 0;\n      this._handleSendMessage = void 0;\n      var self = this;\n      var appkey = serverEngine.option.appkey,\n          userId = serverEngine._selfUserId;\n      var startSyncTime = option.startSyncTime;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished() {},\n        onError: function onError() {}\n      });\n\n      self._handleDirectMessage = function (message) {\n        !pullQueue.isLoading && self.notifyMessage({\n          message: message,\n          hasMore: false\n        });\n      };\n\n      self._handleNotifyPull = function (option) {\n        pullQueue.pull(option);\n      };\n\n      self._handleJoinChatRoom = function (_ref) {\n        var id = _ref.id,\n            count = _ref.count;\n\n        if (utils.isEqual(count, CHATROOM_NOT_PULL_MSG_COUNT)) {\n          self._chatRoomMessageTimeSyner.set(id, common.DelayTimer.getTime());\n        } else {\n          var type = PULL_MSG_TYPE.CHATROOM,\n              time = 0,\n              chrmId = id;\n\n          self._chatRoomMessageTimeSyner.set(id, time);\n\n          pullQueue.pull({\n            type: type,\n            time: time,\n            chrmId: chrmId,\n            count: count\n          });\n        }\n      };\n\n      self._handleSendMessage = function (message) {\n        pullQueue.isLoading ? self._setSentMsgCacheInPulling(message) : self._setPullTime(message);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.DIRECT_MSG] = self._handleDirectMessage, _serverEngine$watch[SERVER_EVENT_NAME.NOTIFY_PULL] = self._handleNotifyPull, _serverEngine$watch[SERVER_EVENT_NAME.JOIN_CHATROOM] = self._handleJoinChatRoom, _serverEngine$watch[SERVER_EVENT_NAME.MESSAGE_SEND] = self._handleSendMessage, _serverEngine$watch));\n      self._serverEngine = serverEngine;\n      self._pullQueue = pullQueue;\n      self._messageTimeSyner = new MessageTimeSyner$1({\n        appkey: appkey,\n        userId: userId,\n        startSyncTime: startSyncTime\n      });\n\n      self._pullMessageTimer.start(pullQueue.pull, {\n        thisArg: pullQueue\n      });\n\n      pullQueue.pull();\n    }\n\n    var _proto = MessagePullManager.prototype;\n\n    _proto.watchMessage = function watchMessage(event) {\n      this._eventEmitter.on(EVENT_NAME$1.MESSAGE_RECEIVED, event);\n    };\n\n    _proto.notifyMessage = function notifyMessage(messageArgs) {\n      var message = messageArgs.message;\n\n      this._setPullTime(message);\n\n      this._eventEmitter.emit(EVENT_NAME$1.MESSAGE_RECEIVED, messageArgs);\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._pullMessageTimer.stop();\n\n      this._sentMsgCacheInPulling = {};\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.DIRECT_MSG] = this._handleDirectMessage, _this$_serverEngine$u[SERVER_EVENT_NAME.NOTIFY_PULL] = this._handleNotifyPull, _this$_serverEngine$u[SERVER_EVENT_NAME.JOIN_CHATROOM] = this._handleJoinChatRoom, _this$_serverEngine$u[SERVER_EVENT_NAME.MESSAGE_SEND] = this._handleSendMessage, _this$_serverEngine$u));\n    };\n\n    _proto._pullEvent = function _pullEvent(option) {\n      option = option || {};\n\n      var self = this,\n          _serverEngine = self._serverEngine,\n          _messageTimeSyner = self._messageTimeSyner,\n          _chatRoomMessageTimeSyner = self._chatRoomMessageTimeSyner,\n          _option = option,\n          type = _option.type,\n          chrmId = _option.chrmId,\n          serverPullTime = _option.time,\n          count = _option.count,\n          isPullChrmMsg = utils.isEqual(type, PULL_MSG_TYPE.CHATROOM),\n          msgSyncTime = _messageTimeSyner.get(),\n          currentReceiveTime = isPullChrmMsg ? _chatRoomMessageTimeSyner.get(chrmId) : msgSyncTime.inboxTime,\n          syncTime = utils.copy(msgSyncTime);\n\n      if (serverPullTime && serverPullTime < currentReceiveTime) {\n        return utils.Defer.resolve();\n      }\n\n      var onMessage = function onMessage(_ref2) {\n        var message = _ref2.message,\n            finished = _ref2.finished,\n            isLastInAPull = _ref2.isLastInAPull;\n\n        self._displatchMessages({\n          message: message,\n          finished: finished,\n          isPullChrmMsg: isPullChrmMsg,\n          isLastInAPull: isLastInAPull,\n          normalSyncTime: syncTime,\n          chatRoomReceiveTime: currentReceiveTime\n        });\n      };\n\n      if (isPullChrmMsg) {\n        return _serverEngine.pullChrmMessageList(chrmId, currentReceiveTime, count, {\n          onMessage: onMessage\n        });\n      } else {\n        return _serverEngine.pullMessageList(syncTime, {\n          onMessage: onMessage\n        });\n      }\n    };\n\n    _proto._displatchMessages = function _displatchMessages(option) {\n      var self = this,\n          message = option.message,\n          finished = option.finished,\n          isPullChrmMsg = option.isPullChrmMsg,\n          isLastInAPull = option.isLastInAPull,\n          _ref3 = option.normalSyncTime || {},\n          inboxTime = _ref3.inboxTime,\n          sendboxTime = _ref3.sendboxTime,\n          sentTime = message.sentTime,\n          messageDirection = message.messageDirection,\n          messageUId = message.messageUId,\n          isSelfSend = messageDirection === MESSAGE_DIRECTION.SEND,\n          pullTime = isSelfSend ? sendboxTime : inboxTime;\n\n      if (sentTime <= pullTime && !isPullChrmMsg) {\n        return;\n      }\n\n      if (self._sentMsgCacheInPulling[messageUId]) {\n        return;\n      }\n\n      self.notifyMessage({\n        message: message,\n        hasMore: !finished,\n        isLastInAPull: isLastInAPull\n      });\n    };\n\n    _proto._setPullTime = function _setPullTime(message) {\n      var isChatRoom = message.type === CONVERSATION_TYPE.CHATROOM;\n      isChatRoom ? this._chatRoomMessageTimeSyner.setByMessage(message) : this._messageTimeSyner.setByMessage(message);\n    };\n\n    _proto._setSentMsgCacheInPulling = function _setSentMsgCacheInPulling(message) {\n      var messageUId = message.messageUId;\n\n      if (utils.isUndefined(messageUId)) {\n        return;\n      }\n\n      this._sentMsgCacheInPulling[messageUId] = message;\n    };\n\n    _proto._consumeSentMsgCacheInPulling = function _consumeSentMsgCacheInPulling() {\n      var self = this;\n      var _sentMsgCacheInPulling = self._sentMsgCacheInPulling;\n      utils.forEach(_sentMsgCacheInPulling, function (message) {\n        self._setPullTime(message);\n      });\n      self._sentMsgCacheInPulling = {};\n    };\n\n    return MessagePullManager;\n  }();\n\n  var ChatRoomKVStore = function () {\n    function ChatRoomKVStore(chrmId, currentUserId) {\n      this._chatRoomId = void 0;\n      this._kvCaches = {};\n      this._currentUserId = void 0;\n      this._chatRoomId = chrmId;\n      this._currentUserId = currentUserId;\n    }\n\n    var _proto = ChatRoomKVStore.prototype;\n\n    _proto.setEntries = function setEntries(data) {\n      data = data || {};\n      var self = this;\n      var _data = data,\n          kvList = _data.kvEntries,\n          isFullUpdate = _data.isFullUpdate;\n      kvList = kvList || [];\n      isFullUpdate = isFullUpdate || false;\n      isFullUpdate && self.clear();\n      utils.forEach(kvList, function (kv) {\n        self.setEntry(kv, {\n          isFullUpdate: isFullUpdate\n        });\n      });\n    };\n\n    _proto.setEntry = function setEntry(kv, option) {\n      option = option || {};\n      var _option = option,\n          isFullUpdate = _option.isFullUpdate,\n          key = kv.key,\n          type = kv.type,\n          isOverwrite = kv.isOverwrite,\n          userId = kv.userId,\n          latestUserId = this.getSetUserId(key),\n          isDeleteOpt = utils.isEqual(type, CHATROOM_ENTRY_TYPE.DELETE),\n          isSameAtLastSetUser = utils.isEqual(latestUserId, userId),\n          isKeyNotExist = !this.isExisted(key);\n      var event = isDeleteOpt ? this.remove : this.add;\n\n      if (isFullUpdate) {\n        event.call(this, kv);\n      } else if (isOverwrite || isSameAtLastSetUser || isKeyNotExist) {\n        event.call(this, kv);\n      }\n    };\n\n    _proto.add = function add(kv) {\n      var key = kv.key;\n      kv.isDeleted = false;\n      this._kvCaches[key] = kv;\n    };\n\n    _proto.remove = function remove(kv) {\n      var key = kv.key;\n      var cacheKV = this.get(key) || {};\n      cacheKV.isDeleted = true;\n      this._kvCaches[key] = cacheKV;\n    };\n\n    _proto.clear = function clear() {\n      this._kvCaches = {};\n    };\n\n    _proto.get = function get(key) {\n      return this._kvCaches[key];\n    };\n\n    _proto.getSetUserId = function getSetUserId(key) {\n      var cache = this.get(key) || {};\n      return cache.userId;\n    };\n\n    _proto.getValue = function getValue(key) {\n      var kv = this._kvCaches[key] || {};\n      var isDeleted = kv.isDeleted;\n      return isDeleted ? null : kv.value;\n    };\n\n    _proto.getAll = function getAll() {\n      var kvEntries = {};\n      utils.forEach(this._kvCaches, function (kv, key) {\n        if (!kv.isDeleted) {\n          kvEntries[key] = kv.value;\n        }\n      });\n      return kvEntries;\n    };\n\n    _proto.getUpdatedTime = function getUpdatedTime() {\n      var maxTime = 0;\n      utils.forEach(this._kvCaches, function (entry) {\n        var timestamp = entry.timestamp || 0;\n\n        if (maxTime < timestamp) {\n          maxTime = timestamp;\n        }\n      });\n      return maxTime;\n    };\n\n    _proto.isExisted = function isExisted(key) {\n      var cache = this.get(key) || {};\n      var value = cache.value,\n          isDeletedOnLatestOperate = cache.isDeleted;\n      return value && !isDeletedOnLatestOperate;\n    };\n\n    return ChatRoomKVStore;\n  }();\n\n  var storeCaches = {};\n\n  var get = function get(chrmId) {\n    return storeCaches[chrmId];\n  };\n\n  var set$1 = function set(chrmId, data, currentUserId) {\n    var kvStore = get(chrmId);\n\n    if (utils.isEmpty(kvStore)) {\n      kvStore = new ChatRoomKVStore(chrmId, currentUserId);\n    }\n\n    kvStore.setEntries(data);\n    storeCaches[chrmId] = kvStore;\n  };\n\n  var getValue = function getValue(chrmId, key) {\n    var kvStore = get(chrmId);\n    var value = kvStore ? kvStore.getValue(key) : null;\n    return value;\n  };\n\n  var getAll = function getAll(chrmId) {\n    var kvStore = get(chrmId);\n    var kvs = {};\n\n    if (kvStore) {\n      kvs = kvStore.getAll();\n    }\n\n    return kvs;\n  };\n\n  var clear = function clear(chrmId) {\n    var kvStore = get(chrmId) || {};\n    kvStore.clear && kvStore.clear();\n  };\n\n  var ChatRoomKVStore$1 = {\n    get: get,\n    set: set$1,\n    getValue: getValue,\n    getAll: getAll,\n    clear: clear\n  };\n\n  var PullTimeCache = {\n    _caches: {},\n    set: function set(chrmId, time) {\n      PullTimeCache._caches[chrmId] = time;\n    },\n    get: function get(chrmId) {\n      return PullTimeCache._caches[chrmId] || 0;\n    },\n    clear: function clear(chrmId) {\n      PullTimeCache._caches[chrmId] = 0;\n    }\n  };\n\n  var ChatRoomKVManager = function () {\n    function ChatRoomKVManager(serverEngine) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._pullQueue = void 0;\n      this._handleChrmKVSet = void 0;\n      this._handleChrmKVChanged = void 0;\n      this._handleBeforeJoinChrm = void 0;\n      var self = this;\n      var userId = serverEngine._selfUserId;\n      var pullQueue = new PullQueueManager({\n        event: this._pullEvent,\n        thisArg: this,\n        onFinished: function onFinished(data, option) {\n          if (!data || !option.chrmId) {\n            return;\n          }\n\n          var chrmId = option.chrmId;\n\n          if (data.isFullUpdate) {\n            self._reset(chrmId);\n          }\n\n          Logger.info(TAG.L_PULL_CHRM_KV_R, {\n            data: data,\n            option: option\n          });\n          ChatRoomKVStore$1.set(chrmId, data, userId);\n          PullTimeCache.set(chrmId, data.syncTime || 0);\n        }\n      });\n\n      self._handleChrmKVSet = function (_ref) {\n        var id = _ref.id,\n            data = _ref.data;\n        ChatRoomKVStore$1.set(id, data, userId);\n      };\n\n      self._handleChrmKVChanged = function (data) {\n        self.pull(data);\n      };\n\n      self._handleBeforeJoinChrm = function (_ref2) {\n        var id = _ref2.id;\n\n        self._reset(id);\n      };\n\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _serverEngine$watch[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _serverEngine$watch[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _serverEngine$watch));\n      this._serverEngine = serverEngine;\n      this._pullQueue = pullQueue;\n    }\n\n    var _proto = ChatRoomKVManager.prototype;\n\n    _proto._reset = function _reset(chrmId) {\n      ChatRoomKVStore$1.clear(chrmId);\n      PullTimeCache.clear(chrmId);\n    };\n\n    _proto._pullEvent = function _pullEvent(data) {\n      var time = data.time,\n          chrmId = data.chrmId,\n          currentTime = PullTimeCache.get(chrmId),\n          isUpdated = currentTime > time;\n      Logger.info(TAG.L_PULL_CHRM_KV_T, {\n        currentTime: currentTime,\n        serverTime: time,\n        isUpdated: isUpdated,\n        data: data\n      });\n\n      if (isUpdated) {\n        Logger.info(TAG.L_PULL_CHRM_KV_R, {\n          info: 'kv is updated. not pull again'\n        });\n        return utils.Defer.resolve();\n      }\n\n      return this._serverEngine.pullChatRoomKV({\n        id: chrmId\n      }, currentTime);\n    };\n\n    _proto.pull = function pull(data) {\n      this._pullQueue.pull(data);\n    };\n\n    _proto.getValue = function getValue(chrmId, key) {\n      return ChatRoomKVStore$1.getValue(chrmId, key);\n    };\n\n    _proto.getAll = function getAll(chrmId) {\n      return ChatRoomKVStore$1.getAll(chrmId);\n    };\n\n    _proto.close = function close() {\n      var _self$_serverEngine$u;\n\n      var self = this;\n\n      self._serverEngine.unwatch((_self$_serverEngine$u = {}, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_SET] = self._handleChrmKVSet, _self$_serverEngine$u[SERVER_EVENT_NAME.CHRM_KV_CHANGED] = self._handleChrmKVChanged, _self$_serverEngine$u[SERVER_EVENT_NAME.BEFORE_JOIN_CHATROOM] = self._handleBeforeJoinChrm, _self$_serverEngine$u));\n    };\n\n    return ChatRoomKVManager;\n  }();\n\n  var SettingStore = function () {\n    function SettingStore(appkey, userId) {\n      this._storage = void 0;\n      var storageKey = utils.tplEngine(STORAGE_USER_SETTING.ROOT_KEY_TPL, {\n        appkey: appkey,\n        userId: userId\n      });\n      this._storage = new common.RCStorage(storageKey);\n    }\n\n    var _proto = SettingStore.prototype;\n\n    _proto.set = function set(serverData) {\n      var self = this,\n          _storage = self._storage,\n          settings = serverData.settings,\n          oldSettingItems = _storage.get(STORAGE_USER_SETTING.SUB_KEY.SETTINGS) || {};\n      var newSettingItems = oldSettingItems,\n          isChanged = false;\n      utils.forEach(settings, function (newSetting, key) {\n        newSetting = newSetting || {};\n        var oldSetting = oldSettingItems[key] || {},\n            _newSetting = newSetting,\n            newVersion = _newSetting.version,\n            status = _newSetting.status,\n            newValue = _newSetting.value,\n            oldGlobalVersion = _storage.get(STORAGE_USER_SETTING.SUB_KEY.VERSION) || 0,\n            isNeedUpdateItem = newVersion > (oldSetting.version || 0),\n            isNeedUpdateVersion = newVersion > oldGlobalVersion;\n\n        if (!isNeedUpdateItem) {\n          return;\n        }\n\n        isChanged = true;\n\n        switch (status) {\n          case USER_SETTING_STATUS.ADD:\n          case USER_SETTING_STATUS.UPDATE:\n            newSettingItems[key] = {\n              value: newValue,\n              version: newVersion\n            };\n            break;\n\n          case USER_SETTING_STATUS.DELETE:\n            delete newSettingItems[key];\n            break;\n\n          default:\n        }\n\n        if (isNeedUpdateVersion) {\n          _storage.set(STORAGE_USER_SETTING.SUB_KEY.VERSION, newVersion);\n        }\n      });\n\n      if (!isChanged) {\n        return;\n      }\n\n      if (utils.isEmpty(newSettingItems)) {\n        _storage.remove(STORAGE_USER_SETTING.SUB_KEY.SETTINGS);\n      } else {\n        _storage.set(STORAGE_USER_SETTING.SUB_KEY.SETTINGS, newSettingItems);\n      }\n    };\n\n    _proto.getSetting = function getSetting() {\n      var settings = this._storage.get(STORAGE_USER_SETTING.SUB_KEY.SETTINGS) || {};\n      return utils.map(settings, function (set) {\n        set = set || {};\n        return set.value;\n      });\n    };\n\n    _proto.getVersion = function getVersion() {\n      return this._storage.get(STORAGE_USER_SETTING.SUB_KEY.VERSION) || 0;\n    };\n\n    return SettingStore;\n  }();\n\n  var EventNames = {\n    CHANGED: 'change'\n  };\n\n  var SettingManager = function () {\n    function SettingManager(serverEngine, option) {\n      var _serverEngine$watch;\n\n      this._serverEngine = void 0;\n      this._settingStore = void 0;\n      this._pullQueue = void 0;\n      this._eventEmitter = new utils.EventEmitter();\n      this._handleNotifySettingChanged = void 0;\n      var self = this,\n          appkey = option.appkey,\n          userId = option.userId,\n          isAutoPull = option.isAutoPull,\n          settingStore = new SettingStore(appkey, userId),\n          localVersion = settingStore.getVersion() || 0;\n      var pullQueue = new PullQueueManager({\n        event: serverEngine.getUserSettings,\n        thisArg: serverEngine,\n        onFinished: function onFinished(serverData) {\n          if (serverData && serverData.version) {\n            self._settingStore.set(serverData);\n\n            self._eventEmitter.emit(EventNames.CHANGED, self.get());\n          }\n        }\n      });\n\n      self._handleNotifySettingChanged = function (notifyData) {\n        var version = notifyData.version,\n            localVersion = self._settingStore.getVersion();\n\n        if (version >= localVersion) {\n          pullQueue.pull(localVersion);\n        }\n      };\n\n      self._settingStore = new SettingStore(appkey, userId);\n      self._pullQueue = pullQueue;\n      self._serverEngine = serverEngine;\n      serverEngine.watch((_serverEngine$watch = {}, _serverEngine$watch[SERVER_EVENT_NAME.USER_SETTING_CHANGED] = self._handleNotifySettingChanged, _serverEngine$watch));\n      isAutoPull && pullQueue.pull(localVersion);\n    }\n\n    var _proto = SettingManager.prototype;\n\n    _proto.watchSettingChanged = function watchSettingChanged(event) {\n      this._eventEmitter.on(EventNames.CHANGED, event);\n    };\n\n    _proto.get = function get() {\n      return this._settingStore.getSetting() || {};\n    };\n\n    _proto.close = function close() {\n      var _this$_serverEngine$u;\n\n      this._serverEngine.unwatch((_this$_serverEngine$u = {}, _this$_serverEngine$u[SERVER_EVENT_NAME.USER_SETTING_CHANGED] = self._handleNotifySettingChanged, _this$_serverEngine$u));\n    };\n\n    return SettingManager;\n  }();\n\n  var WebIMEngine = function () {\n    function WebIMEngine(option) {\n      this._option = void 0;\n      this._user = void 0;\n      this._naviManager = void 0;\n      this._cmpManager = new CMPManager();\n      this._conversationManager = void 0;\n      this._messageManager = void 0;\n      this._chatRoomKVManager = void 0;\n      this._userSettingManager = void 0;\n      this._serverEngine = void 0;\n      this._imEventEmitter = new utils.EventEmitter();\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      this._connectedDomain = void 0;\n      this._networkDetecter = void 0;\n      var self = this;\n      var detect = option.detect;\n      var serverEngine = new ServerEngine(option);\n      serverEngine.watch({\n        status: function status(_status) {\n          self._handleConnectionStatus(_status);\n        }\n      });\n      this._serverEngine = serverEngine;\n      this._option = option;\n      this._networkDetecter = new utils.NetworkDetecter(detect);\n      utils.forEach(ServerEngine.prototype, function (event, eventName) {\n        var server = serverEngine,\n            web = self;\n        var selfEvent = web[eventName],\n            serverEvent = server[eventName];\n\n        if (!selfEvent && serverEvent && utils.isFunction(serverEvent)) {\n          web[eventName] = function () {\n            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n              args[_key] = arguments[_key];\n            }\n\n            return serverEvent.call.apply(serverEvent, [server].concat(args));\n          };\n        }\n      });\n    }\n\n    var _proto = WebIMEngine.prototype;\n\n    _proto._notifyMessage = function _notifyMessage(event) {\n      var self = this;\n      var message = event.message;\n      var _serverEngine = self._serverEngine;\n\n      var connectedTime = _serverEngine.getConnectedTime();\n\n      if (common.isLogCommandMsg(message)) {\n        var content = message.content;\n        Logger.uploadFull(0, content, connectedTime);\n        return;\n      }\n\n      this._conversationManager.addMessage(event);\n\n      this._imEventEmitter.emit(IM_EVENT.MESSAGE, event);\n    };\n\n    _proto._handleConnectionStatus = function _handleConnectionStatus(status) {\n      var _cmpManager = this._cmpManager,\n          _naviManager = this._naviManager,\n          _connectedDomain = this._connectedDomain;\n      var isNeedUpdateCMPList = utils.isInclude(TRANSPORTER_STATUS_NEED_UPDATE_CMP, status);\n      var isNeedReconnect = utils.isInclude(TRANSPORTER_STATUS_NEED_RECONNECT, status);\n\n      if (isNeedUpdateCMPList) {\n        _cmpManager.addInvalid(_connectedDomain);\n\n        if (_cmpManager.isAllInvalid()) {\n          _naviManager.clear();\n\n          _cmpManager.clearInvalid();\n        }\n      }\n\n      if (isNeedReconnect) {\n        this.reconnect();\n      }\n\n      var connectionStatus = TRANSPORTER_STATUS_TO_CONNECTION_STATUS[status] || status;\n      this._connectionStatus = connectionStatus;\n\n      this._imEventEmitter.emit(IM_EVENT.STATUS, {\n        status: connectionStatus\n      });\n    };\n\n    _proto._handleConnectError = function _handleConnectError(errorInfo) {\n      var _user = this._user;\n      var code = errorInfo.code || errorInfo.status;\n      this.disconnect();\n\n      if (code === ERROR_INFO.CONN_REDIRECTED.code) {\n        this._naviManager.clear();\n\n        return this.connect(_user);\n      }\n\n      this._connectionStatus = CONNECTION_STATUS.DISCONNECTED;\n      return utils.Defer.reject(errorInfo);\n    };\n\n    _proto._afterConnect = function _afterConnect(connectUser, syncTime) {\n      var self = this,\n          _serverEngine = self._serverEngine,\n          appkey = self._option.appkey,\n          _imEventEmitter = self._imEventEmitter,\n          _naviManager = self._naviManager,\n          id = connectUser.id,\n          localNavi = _naviManager.getLocalConfig() || {};\n      Logger.setOption({\n        userId: id\n      });\n      self._user.id = id;\n      var conversationManager = new ConversationManager({\n        appkey: appkey,\n        userId: id\n      }, _serverEngine);\n      conversationManager.watch({\n        conversation: function conversation(_ref) {\n          var updatedConversationList = _ref.updatedConversationList;\n\n          _imEventEmitter.emit(IM_EVENT.CONVERSATION, {\n            updatedConversationList: updatedConversationList\n          });\n        }\n      });\n      self._conversationManager = conversationManager;\n      var messageManager = new MessagePullManager(_serverEngine, {\n        startSyncTime: syncTime\n      });\n      messageManager.watchMessage(function (event) {\n        self._notifyMessage(event);\n      });\n      self._messageManager = messageManager;\n      self._chatRoomKVManager = new ChatRoomKVManager(_serverEngine);\n      var isAutoPull = !!Number(localNavi.openUS);\n      var userSettingManager = new SettingManager(_serverEngine, {\n        appkey: appkey,\n        userId: id,\n        isAutoPull: isAutoPull\n      });\n      userSettingManager.watchSettingChanged(function (config) {\n        config = config || {};\n        var _config = config,\n            voipCallInfo = _config.VoipInfo;\n\n        _naviManager.setLocalConfig({\n          voipCallInfo: utils.toJSON(voipCallInfo)\n        });\n\n        self._imEventEmitter.emit(IM_EVENT.SETTING, config);\n      });\n      self._userSettingManager = userSettingManager;\n    };\n\n    _proto.watch = function watch(watchers) {\n      var statusWatcher = watchers.status,\n          messageWatcher = watchers.message,\n          conversationWatcher = watchers.conversation,\n          settingWatcher = watchers.setting;\n      statusWatcher && this._imEventEmitter.on(IM_EVENT.STATUS, statusWatcher);\n      messageWatcher && this._imEventEmitter.on(IM_EVENT.MESSAGE, messageWatcher);\n      conversationWatcher && this._imEventEmitter.on(IM_EVENT.CONVERSATION, conversationWatcher);\n      settingWatcher && this._imEventEmitter.on(IM_EVENT.SETTING, settingWatcher);\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      var _imEventEmitter = this._imEventEmitter;\n\n      if (watchers) {\n        var statusWatcher = watchers.status,\n            messageWatcher = watchers.message,\n            conversationWatcher = watchers.conversation;\n        statusWatcher && _imEventEmitter.off(IM_EVENT.STATUS, statusWatcher);\n        messageWatcher && _imEventEmitter.off(IM_EVENT.MESSAGE, messageWatcher);\n        conversationWatcher && _imEventEmitter.off(IM_EVENT.CONVERSATION, conversationWatcher);\n      } else {\n        _imEventEmitter.clear();\n      }\n    };\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._connectionStatus;\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      var user = this._user || {};\n      return user.id;\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      var _option = this._option,\n          _naviManager = this._naviManager,\n          _userSettingManager = this._userSettingManager;\n      return utils.extendInShallow(_option, {\n        navi: _naviManager.getLocalConfig(),\n        serverConfig: _userSettingManager ? _userSettingManager.get() : {}\n      });\n    };\n\n    _proto.connect = function connect(user) {\n      if (!env.isMini) {\n        Logger.startRealtimeUpload();\n      }\n\n      var self = this;\n      var _option = self._option,\n          _serverEngine = self._serverEngine,\n          _cmpManager = self._cmpManager;\n      var naviOpt = common.getNavReqOption(_option, user);\n      var naviManager = new NaviManager(naviOpt);\n      var getServerConfig = _option.isOldServer ? _serverEngine.getOldServerConfig : _serverEngine.getServerConfig;\n\n      self._handleConnectionStatus(CONNECTION_STATUS.CONNECTING);\n\n      self._user = utils.copy(user);\n      self._naviManager = naviManager;\n      var connectUser;\n      return naviManager.get().then(function (configForNavi) {\n        var cmpDomainList = common.getCMPDomainList(configForNavi, _option);\n        Logger.setServerOption(configForNavi);\n\n        _cmpManager.setDomainList(cmpDomainList);\n\n        return _cmpManager.getFaster();\n      }).then(function (_ref2) {\n        var domain = _ref2.domain;\n        self._connectedDomain = domain;\n        return _serverEngine.connect(user, {\n          domain: domain\n        });\n      }).then(function (user) {\n        connectUser = user;\n        return getServerConfig.call(_serverEngine, user.id);\n      }).then(function (serverConfig) {\n        self._afterConnect(connectUser, serverConfig);\n\n        return connectUser;\n      })[\"catch\"](function (error) {\n        return self._handleConnectError(error);\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      var self = this;\n      var _user = self._user;\n\n      if (utils.isUndefined(_user)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      return self._networkDetecter.start().then(function () {\n        return self.connect(_user);\n      });\n    };\n\n    _proto.disconnect = function disconnect(isNotify) {\n      isNotify && this._handleConnectionStatus(CONNECTION_STATUS.DISCONNECTED);\n      this._networkDetecter && this._networkDetecter.stop();\n      this._messageManager && this._messageManager.close();\n      this._chatRoomKVManager && this._chatRoomKVManager.close();\n      this._userSettingManager && this._userSettingManager.close();\n      this._conversationManager && this._conversationManager.close();\n      return this._serverEngine.disconnect();\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      this.disconnect(true);\n      return this.connect(user);\n    };\n\n    _proto.sendMessage = function sendMessage(conversation, option) {\n      var self = this;\n      return self._serverEngine.sendMessage(conversation, option).then(function (message) {\n        self._conversationManager.addMessage({\n          message: message,\n          hasMore: false\n        });\n\n        return message;\n      });\n    };\n\n    _proto.recallMessage = function recallMessage(conversation, message, option) {\n      var self = this;\n      return self._serverEngine.recallMessage(conversation, message, option).then(function (message) {\n        self._conversationManager.addMessage({\n          message: message,\n          hasMore: false\n        });\n\n        return message;\n      });\n    };\n\n    _proto.getConversationList = function getConversationList(option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine,\n          _conversationManager = this._conversationManager;\n      var func = isOldServer ? _serverEngine.getOldConversationList : _serverEngine.getConversationList;\n      return func.call(_serverEngine, option, {\n        afterDecode: function afterDecode(conversation) {\n          var localConversation = _conversationManager.get(conversation);\n\n          conversation = utils.extendAllowNull(conversation, localConversation);\n          return conversation;\n        }\n      }).then(function (list) {\n        return common.sortConList(list);\n      });\n    };\n\n    _proto.getLocalConversation = function getLocalConversation(conversation) {\n      var local = this._conversationManager.get(conversation);\n\n      return {\n        unreadMessageCount: local.unreadMessageCount || 0,\n        hasMentiond: local.hasMentiond || false,\n        mentiondInfo: local.mentiondInfo\n      };\n    };\n\n    _proto.removeConversation = function removeConversation(conversation) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n      var func = isOldServer ? _serverEngine.removeOldConversation : _serverEngine.removeConversation;\n      return func.call(_serverEngine, conversation);\n    };\n\n    _proto.getTotalUnreadCount = function getTotalUnreadCount() {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        var totalCount = this._conversationManager.getTotalUnreadCount();\n\n        return utils.Defer.resolve(totalCount);\n      } else {\n        return _serverEngine.getTotalUnreadCount();\n      }\n    };\n\n    _proto.getUnreadCount = function getUnreadCount(conversation) {\n      var isOldServer = this._option.isOldServer;\n\n      if (isOldServer) {\n        var count = this._conversationManager.getUnreadCount(conversation);\n\n        return utils.Defer.resolve(count);\n      }\n    };\n\n    _proto.clearUnreadCount = function clearUnreadCount(conversation, option) {\n      var isOldServer = this._option.isOldServer,\n          _serverEngine = this._serverEngine;\n\n      if (isOldServer) {\n        this._conversationManager.read(conversation);\n\n        return utils.Defer.resolve();\n      } else {\n        return _serverEngine.clearUnreadCount(conversation, option);\n      }\n    };\n\n    _proto.joinChatRoom = function joinChatRoom(chrm, option) {\n      var self = this;\n      var _serverEngine = self._serverEngine,\n          _naviManager = self._naviManager,\n          _chatRoomKVManager = self._chatRoomKVManager;\n      return _serverEngine.joinChatRoom(chrm, option).then(function () {\n        return _naviManager.get();\n      }).then(function (configForNavi) {\n        var isOpenKVStorageService = configForNavi.kvStorage;\n        var initialTime = 0;\n        return isOpenKVStorageService ? _chatRoomKVManager.pull({\n          time: initialTime,\n          chrmId: chrm.id\n        }) : utils.Defer.resolve();\n      });\n    };\n\n    _proto.setChatRoomKV = function setChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.UPDATE,\n        userId: self._user.id\n      });\n      entry.type = CHATROOM_ENTRY_TYPE.UPDATE;\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceSetChatRoomKV = function forceSetChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.setChatRoomKV(chrm, entry);\n    };\n\n    _proto.removeChatRoomKV = function removeChatRoomKV(chrm, entry) {\n      var self = this;\n      utils.extend(entry, {\n        type: CHATROOM_ENTRY_TYPE.DELETE,\n        userId: self._user.id\n      });\n      return self._serverEngine.modifyChatRoomKV(chrm, entry);\n    };\n\n    _proto.forceRemoveChatRoomKV = function forceRemoveChatRoomKV(chrm, entry) {\n      entry.isOverwrite = true;\n      return this.removeChatRoomKV(chrm, entry);\n    };\n\n    _proto.getChatRoomKV = function getChatRoomKV(chrm, key) {\n      var value = this._chatRoomKVManager.getValue(chrm.id, key);\n\n      if (utils.isEmpty(value)) {\n        return utils.Defer.reject(ERROR_INFO.CHATROOM_KEY_NOT_EXIST);\n      } else {\n        return utils.Defer.resolve(value);\n      }\n    };\n\n    _proto.getAllChatRoomKV = function getAllChatRoomKV(chrm) {\n      var kvs = this._chatRoomKVManager.getAll(chrm.id);\n\n      return utils.Defer.resolve(kvs);\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, originName) {\n      var self = this;\n      var fileName = common.genUploadFileName(fileType, originName);\n      var uploadDomains = common.getUploadFileDomains(self._naviManager.getLocalConfig());\n      return self._serverEngine.getFileToken(fileType, fileName).then(function (data) {\n        return utils.extendInShallow(uploadDomains, data);\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName, uploadResp) {\n      var self = this;\n      uploadResp = uploadResp || {};\n\n      if (uploadResp.isBosRes) {\n        return utils.Defer.resolve(uploadResp);\n      }\n\n      return self._serverEngine.getFileUrl(fileType, fileName, originName);\n    };\n\n    return WebIMEngine;\n  }();\n\n  var Engine = (function (imArg) {\n    return new WebIMEngine(imArg);\n  });\n\n  var execEngineByEvent = function execEngineByEvent(params, engine) {\n    var eventName = params.event,\n        args = params.args;\n    args = args || [];\n\n    var engineEvent = engine[eventName] || function () {\n      return utils.Defer.reject(ERROR_INFO.SDK_INTERNAL_ERROR);\n    };\n\n    return engineEvent.apply(engine, args);\n  };\n\n  var EngineDispatcher = function () {\n    function EngineDispatcher(option) {\n      this._engine = void 0;\n      this._engine = new Engine(option);\n    }\n\n    var _proto = EngineDispatcher.prototype;\n\n    _proto._isEventNeedConnect = function _isEventNeedConnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isNotConnected = connectionStatus !== CONNECTION_STATUS.CONNECTED,\n          isEventNeedConnected = utils.isInclude(ENGINE_EVENT_NEED_CONNECTED, eventName);\n      return isNotConnected && isEventNeedConnected;\n    };\n\n    _proto._isEventNeedDisconnect = function _isEventNeedDisconnect(eventName) {\n      var engine = this._engine,\n          connectionStatus = engine.getConnectionStatus(),\n          isConnecting = common.isConnected(connectionStatus) || common.isConnecting(connectionStatus),\n          isEventNeedDisconnected = utils.isInclude(ENGINE_EVENT_NEED_DISCONNECTED, eventName);\n      return isConnecting && isEventNeedDisconnected;\n    };\n\n    _proto._exec = function _exec(params) {\n      var event = params.event;\n      var engine = this._engine;\n\n      if (this._isEventNeedConnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.NOT_CONNECTED);\n      }\n\n      if (this._isEventNeedDisconnect(event)) {\n        return utils.Defer.reject(ERROR_INFO.RC_CONNECTION_EXIST);\n      }\n\n      var execResult = execEngineByEvent(params, engine);\n      return utils.isPromise(execResult) ? execResult[\"catch\"](function (error) {\n        var errorCode = error.status || error.code || error;\n        var msg = utils.isObject(error) ? error.msg : null;\n        var errorInfo = ERROR_CODE_TO_INFO[errorCode] || {\n          code: errorCode\n        };\n\n        if (msg) {\n          errorInfo.msg = msg;\n        }\n\n        var isValidErrorCode = utils.isNumberData(errorCode);\n\n        if (!isValidErrorCode) {\n          if (utils.isStackError(error)) {\n            error = error.stack.toString();\n          }\n\n          Logger.fatal(TAG.L_CRASH_F, {\n            content: {\n              desc: 'SDK Error',\n              error: error\n            }\n          });\n          errorInfo = utils.extendInShallow(ERROR_INFO.SDK_INTERNAL_ERROR, {\n            error: error\n          });\n        }\n\n        return utils.Defer.reject(errorInfo);\n      }) : execResult;\n    };\n\n    _proto.exec = function exec(params) {\n      var event = params.event;\n\n      var LOG_TAG = APP_ENGINE_EVENT_LOG_TAG[event],\n          isNeedLog = !utils.isEmpty(LOG_TAG),\n          _ref = LOG_TAG || {},\n          reqLogTag = _ref.req,\n          respLogTag = _ref.resp;\n\n      isNeedLog && Logger.info(reqLogTag, params);\n\n      var execResult = this._exec(params);\n\n      if (utils.isPromise(execResult)) {\n        return execResult.then(function (result) {\n          isNeedLog && Logger.info(respLogTag, result);\n          return result;\n        })[\"catch\"](function (error) {\n          isNeedLog && Logger.error(respLogTag, error);\n          return utils.Defer.reject(error);\n        });\n      } else {\n        isNeedLog && Logger.info(respLogTag, execResult);\n        return execResult;\n      }\n    };\n\n    return EngineDispatcher;\n  }();\n\n  var Type = function Type(name, validator, options) {\n    options = options || {};\n    var self = this;\n    self.validate = validator;\n    self.name = name;\n    self.errorInfo = options.errorInfo;\n\n    self.canBeNull = function () {\n      self.validate = function (data) {\n        return utils.isUndefined(data) || utils.isNull(data) || validator(data);\n      };\n\n      return self;\n    };\n  };\n\n  Type.isType = function (type) {\n    return type instanceof Type;\n  };\n\n  Type.String = new Type('String', utils.isString);\n  Type.Number = new Type('Number', utils.isNumber);\n  Type.Boolean = new Type('Boolean', utils.isBoolean);\n  Type.Function = new Type('Function', utils.isFunction);\n  Type.Object = new Type('Object', utils.isObject);\n  Type.Array = new Type('Array', utils.isArray);\n  Type.NotAllUndefined = new Type('AllUndefined', function (obj) {\n    if (utils.isObject(obj) || utils.isArray(obj)) {\n      var isNotUndefined = false;\n      utils.forEach(obj, function (val) {\n        if (!utils.isUndefined(val)) {\n          isNotUndefined = true;\n        }\n      });\n      return isNotUndefined;\n    } else {\n      return !utils.isUndefined(obj);\n    }\n  });\n  var conversationType = common.getConversationTypeList().join('、');\n  Type.ConversationType = new Type(conversationType, common.isValidConversationType, {\n    errorInfo: 'Not all settings are empty'\n  });\n  Type.ChatRoomEntryKey = new Type('ChatRoomEntryKey', common.isValidChatRoomKey, {\n    errorInfo: 'ChatRoom Key length must be 1 - 128, Only letters、numbers、+、=、-、_ are supported'\n  });\n  Type.ChatRoomEntryValue = new Type('ChatRoomEntryValue', common.isValidChatRoomValue, {\n    errorInfo: 'ChatRoom Value length must be 1 - 4096'\n  });\n\n  var Struct = function () {\n    function Struct(structure, funcName, paths) {\n      if (paths === void 0) {\n        paths = [];\n      }\n\n      if (!(this instanceof Struct)) {\n        return new Struct(structure, funcName, paths);\n      }\n\n      var self = this;\n      self.structure = structure;\n      self.paths = paths;\n      self.funcName = funcName;\n\n      if (Type.isType(structure)) {\n        self.validate = self._validateType;\n      } else if (utils.isArray(structure)) {\n        self.validate = self._validateArray;\n      } else if (utils.isObject(structure)) {\n        self.validate = self._validateObject;\n      } else {\n        self.validate = self._validateOther;\n      }\n    }\n\n    var _proto = Struct.prototype;\n\n    _proto._validateType = function _validateType(data) {\n      var structure = this.structure;\n      var isValid = structure.validate(data);\n      return isValid ? this._getSuccess() : this._getError(data);\n    };\n\n    _proto._validateArray = function _validateArray(data) {\n      var structure = this.structure;\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isArray(data)) {\n        return this._getError(data);\n      }\n\n      var typer = structure[0];\n\n      for (var filed in data) {\n        var val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateObject = function _validateObject(data) {\n      var structure = this.structure,\n          paths = this.paths;\n      data = data || {};\n\n      if (utils.isEmpty(structure)) {\n        return this._getSuccess();\n      }\n\n      if (!utils.isObject(data)) {\n        return this._getError(data);\n      }\n\n      var checkedField = [];\n\n      for (var filed in data) {\n        var typer = structure[filed],\n            val = data[filed];\n\n        var result = this._validateField(typer, filed, val);\n\n        if (result.isError) {\n          return result;\n        }\n\n        checkedField.push(filed);\n      }\n\n      for (var checkField in structure) {\n        var _typer = structure[checkField];\n        var unCheckData = data[checkField];\n\n        if (!utils.isInclude(checkedField, checkField) && !_typer.validate(unCheckData)) {\n          var errPaths = utils.copy(paths);\n          errPaths.push(checkField);\n          return this._getError(unCheckData, {\n            paths: errPaths,\n            expect: _typer.name\n          });\n        }\n      }\n\n      return this._getSuccess();\n    };\n\n    _proto._validateOther = function _validateOther(data) {\n      var self = this;\n      var structure = self.structure;\n\n      if (utils.isEqual(structure, data) || utils.isEmpty(structure)) {\n        return self._getSuccess();\n      } else {\n        return self._getError(data, {\n          current: data,\n          expect: structure\n        });\n      }\n    };\n\n    _proto._validateField = function _validateField(typer, filed, value) {\n      var paths = this.paths,\n          funcName = this.funcName;\n      var newPaths = utils.copy(paths);\n      newPaths.push(filed);\n      return new Struct(typer, funcName, newPaths).validate(value);\n    };\n\n    _proto._getError = function _getError(data, options) {\n      if (options === void 0) {\n        options = [];\n      }\n\n      var structure = this.structure,\n          paths = this.paths,\n          funcName = this.funcName;\n      options = utils.extend({\n        current: data,\n        expect: structure.name || utils.getTypeName(structure),\n        paths: paths\n      }, options);\n      paths = options.paths;\n      var _options = options,\n          current = _options.current,\n          expect = _options.expect;\n      var param = utils.isEmpty(paths) ? 'param' : paths.join('.');\n      var currentType = utils.getTypeName(current);\n      current = utils.toJSON(current) || current;\n      current = current + \"(\" + currentType + \")\";\n      var msg = utils.tplEngine(ERROR_INFO.PARAMETER_ERROR.msg, {\n        param: param,\n        expect: expect,\n        current: current\n      });\n      var info = {\n        code: ERROR_INFO.PARAMETER_ERROR.code,\n        funcName: funcName,\n        msg: msg\n      };\n      var jsonInfo = utils.toJSON(info);\n      if (utils.isEmpty(funcName)) delete info[funcName];\n\n      if (structure.errorInfo) {\n        info = structure.errorInfo;\n      }\n\n      return {\n        isError: true,\n        info: info,\n        jsonInfo: jsonInfo\n      };\n    };\n\n    _proto._getSuccess = function _getSuccess() {\n      return {\n        isError: false\n      };\n    };\n\n    return Struct;\n  }();\n\n  var validate = (function (struct, params, eventName) {\n    return Struct(struct, eventName).validate(params);\n  });\n\n  var _MESSAGE_TYPE_VALIDAT;\n  var MESSAGE_TYPE_VALIDATE = (_MESSAGE_TYPE_VALIDAT = {}, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.TEXT] = {\n    content: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.VOICE] = {\n    content: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.HQ_VOICE] = {\n    remoteUrl: Type.String,\n    duration: Type.Number\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.IMAGE] = {\n    content: Type.String,\n    imageUri: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.GIF] = {\n    gifDataSize: Type.Number,\n    width: Type.Number,\n    height: Type.Number,\n    remoteUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.RICH_CONTENT] = {\n    title: Type.String,\n    content: Type.String,\n    imageUri: Type.String,\n    url: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.LOCATION] = {\n    content: Type.String,\n    latitude: Type.Number,\n    longitude: Type.Number,\n    poi: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.FILE] = {\n    name: Type.String,\n    size: Type.Number,\n    type: Type.String,\n    fileUrl: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.SIGHT] = {\n    sightUrl: Type.String,\n    content: Type.String,\n    duration: Type.Number,\n    size: Type.Number,\n    name: Type.String\n  }, _MESSAGE_TYPE_VALIDAT[MESSAGE_TYPE.COMBINE] = {\n    remoteUrl: Type.String,\n    conversationType: Type.Number,\n    nameList: Type.Array,\n    summaryList: Type.Array\n  }, _MESSAGE_TYPE_VALIDAT);\n  var validateMsgContent = (function (objectName, option, eventName) {\n    var validateByObjectName = MESSAGE_TYPE_VALIDATE[objectName];\n\n    if (validateByObjectName) {\n      return validate(validateByObjectName, option, eventName);\n    } else {\n      return {\n        isError: false,\n        info: ''\n      };\n    }\n  });\n\n  var Conversation = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      Conversation.create = function create(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.get = function get(option) {\n        return new Conversation(option);\n      };\n\n      Conversation.merge = function merge(option) {\n        try {\n          return common.mergeConversationList(option);\n        } catch (e) {\n          utils.consoleError(e);\n        }\n      };\n\n      Conversation.remove = function remove(option) {\n        var _validate = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'Conversation.remove'),\n            isError = _validate.isError,\n            info = _validate.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [option]\n        });\n      };\n\n      Conversation.getList = function getList(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull(),\n          startTime: Type.Number.canBeNull()\n        }, option, 'Conversation.getList'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CONVERSATION_LIST,\n          args: [option]\n        });\n      };\n\n      Conversation.getTotalUnreadCount = function getTotalUnreadCount() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_TOTAL_UNREAD_COUNT\n        });\n      };\n\n      function Conversation(option) {\n        this.type = void 0;\n        this.targetId = void 0;\n\n        var _validate3 = validate({\n          type: Type.ConversationType,\n          targetId: Type.String\n        }, option, 'new Conversation'),\n            isError = _validate3.isError,\n            jsonInfo = _validate3.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = Conversation.prototype;\n\n      _proto.send = function send(option) {\n        var eventName = 'conversation.send';\n\n        var _validate4 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        option = utils.extendInShallow(SEND_MESSAGE_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [this, option]\n        });\n      };\n\n      _proto.recall = function recall(message, option) {\n        var _validate5 = validate({\n          sentTime: Type.Number,\n          messageUId: Type.String\n        }, message, 'conversation.recall'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.RECALL_MESSAGE,\n          args: [this, message, option]\n        });\n      };\n\n      _proto.read = function read(option) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_UNREAD_COUNT,\n          args: [this, option]\n        });\n      };\n\n      _proto.getUnreadCount = function getUnreadCount() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_UNREAD_COUNT,\n          args: [conversation]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate6 = validate({\n          order: Type.Number.canBeNull(),\n          count: Type.Number.canBeNull(),\n          timestrap: Type.Number.canBeNull()\n        }, option, 'conversation.getMessages'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_MESSAGES_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_HISTORY_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.deleteMessages = function deleteMessages(messages) {\n        var _validate7 = validate([{\n          sentTime: Type.Number,\n          messageUId: Type.String,\n          messageDirection: Type.Number\n        }], messages, 'conversation.deleteMessages'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DELETE_MESSAGES,\n          args: [this, messages]\n        });\n      };\n\n      _proto.clearMessages = function clearMessages(option) {\n        var _validate8 = validate({\n          timestrap: Type.Number\n        }, option, 'conversation.clearMessages'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.CLEAR_MESSAGES,\n          args: [this, option]\n        });\n      };\n\n      _proto.setStatus = function setStatus(option) {\n        var _validate9 = validate({\n          notificationStatus: Type.Number.canBeNull(),\n          isTop: Type.Boolean.canBeNull()\n        }, option, 'conversation.setStatus'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var allUndefinedValidate = validate(Type.NotAllUndefined, option);\n        isError = allUndefinedValidate.isError;\n\n        if (isError) {\n          info = allUndefinedValidate.info;\n          return utils.Defer.reject(info);\n        }\n\n        var notificationStatus = option.notificationStatus,\n            isTop = option.isTop;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_CONVERSATION_STATUS_LIST,\n          args: [[{\n            type: this.type,\n            targetId: this.targetId,\n            notificationStatus: notificationStatus,\n            isTop: isTop\n          }]]\n        });\n      };\n\n      _proto.setStatusList = function setStatusList(statusList) {\n        var _validate10 = validate([{\n          notificationStatus: Type.Number.canBeNull(),\n          isTop: Type.Boolean.canBeNull()\n        }], statusList, 'conversation.setStatusList'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var self = this;\n        statusList = utils.map(statusList, function (status) {\n          return utils.extend(status, {\n            type: self.type,\n            targetId: self.targetId\n          });\n        });\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_CONVERSATION_STATUS_LIST,\n          args: [statusList]\n        });\n      };\n\n      _proto.destory = function destory() {\n        var conversation = this;\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.REMOVE_CONVERSATION,\n          args: [conversation]\n        });\n      };\n\n      return Conversation;\n    }(), _temp;\n  });\n\n  var ChatRoom = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      ChatRoom.get = function get(option) {\n        return new ChatRoom(option);\n      };\n\n      function ChatRoom(option) {\n        this.id = void 0;\n\n        var _validate = validate({\n          id: Type.String\n        }, option, 'new ChatRoom'),\n            isError = _validate.isError,\n            jsonInfo = _validate.jsonInfo;\n\n        if (isError) {\n          utils.consoleError(jsonInfo);\n          return jsonInfo;\n        }\n\n        utils.extend(this, option);\n      }\n\n      var _proto = ChatRoom.prototype;\n\n      _proto.join = function join(option) {\n        var _validate2 = validate({\n          count: Type.Number.canBeNull()\n        }, option, 'chatRoom.join'),\n            isError = _validate2.isError,\n            info = _validate2.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(JOIN_CHATROOM_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_CHATROOM,\n          args: [this, option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_CHATROOM,\n          args: [this]\n        });\n      };\n\n      _proto.getInfo = function getInfo(option) {\n        var _validate3 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull()\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate3.isError,\n            info = _validate3.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_INFO_OPTION, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_INFO,\n          args: [this, option]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var eventName = 'chatRoom.send';\n\n        var _validate4 = validate({\n          messageType: Type.String,\n          content: Type.Object\n        }, option, eventName),\n            isError = _validate4.isError,\n            info = _validate4.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        var id = this.id;\n        var _option = option,\n            messageType = _option.messageType,\n            content = _option.content;\n\n        var _validateMsgContent = validateMsgContent(messageType, content, eventName),\n            isContentError = _validateMsgContent.isError,\n            formatInfo = _validateMsgContent.info;\n\n        if (isContentError) {\n          return utils.Defer.reject(formatInfo);\n        }\n\n        var conversation = {\n          type: CONVERSATION_TYPE.CHATROOM,\n          targetId: id\n        };\n        option = utils.extendInShallow(SEND_MESSAGE_TYPE_OPTION[messageType], option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      _proto.getMessages = function getMessages(option) {\n        var _validate5 = validate({\n          count: Type.Number.canBeNull(),\n          order: Type.Number.canBeNull(),\n          timestrap: Type.Number\n        }, option, 'chatRoom.getInfo'),\n            isError = _validate5.isError,\n            info = _validate5.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        option = utils.extendInShallow(GET_CHATROOM_MESSAGES, option);\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_CHATROOM_MSGS,\n          args: [this, option]\n        });\n      };\n\n      _proto.setEntry = function setEntry(option) {\n        var _validate6 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.setEntry'),\n            isError = _validate6.isError,\n            info = _validate6.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceSetEntry = function forceSetEntry(option) {\n        var _validate7 = validate({\n          key: Type.ChatRoomEntryKey,\n          value: Type.ChatRoomEntryValue\n        }, option, 'chatRoom.forceSetEntry'),\n            isError = _validate7.isError,\n            info = _validate7.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_SET_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.removeEntry = function removeEntry(option) {\n        var _validate8 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.removeEntry'),\n            isError = _validate8.isError,\n            info = _validate8.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.forceRemoveEntry = function forceRemoveEntry(option) {\n        var _validate9 = validate({\n          key: Type.ChatRoomEntryKey\n        }, option, 'chatRoom.forceRemoveEntry'),\n            isError = _validate9.isError,\n            info = _validate9.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.FORCE_DEL_KV,\n          args: [this, option]\n        });\n      };\n\n      _proto.getEntry = function getEntry(key) {\n        var _validate10 = validate(Type.ChatRoomEntryKey, key, 'chatRoom.getEntry'),\n            isError = _validate10.isError,\n            info = _validate10.info;\n\n        if (isError) {\n          return utils.Defer.reject(info);\n        }\n\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_KV,\n          args: [this, key]\n        });\n      };\n\n      _proto.getAllEntries = function getAllEntries() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_ALL_KV,\n          args: [this]\n        });\n      };\n\n      return ChatRoom;\n    }(), _temp;\n  });\n\n  var RTC = (function (_engineDispatcher) {\n    var _temp;\n\n    return _temp = function () {\n      RTC.get = function get(option) {\n        return new RTC(option);\n      };\n\n      function RTC(option) {\n        this.roomId = void 0;\n        this.option = void 0;\n        this.roomId = option.id;\n        this.option = option;\n      }\n\n      var _proto = RTC.prototype;\n\n      _proto.join = function join() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.JOIN_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.quit = function quit() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.QUIT_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.ping = function ping() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.PING_RTC,\n          args: [this.option]\n        });\n      };\n\n      _proto.getRoomInfo = function getRoomInfo() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_ROOM_INFO,\n          args: [this.option]\n        });\n      };\n\n      _proto.getUserInfoList = function getUserInfoList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_INFO_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setUserInfo = function setUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.removeUserInfo = function removeUserInfo(info) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_USER_INFO,\n          args: [this.option, info]\n        });\n      };\n\n      _proto.setData = function setData(key, value, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_DATA,\n          args: [this.roomId, key, value, isInner, apiType, message]\n        });\n      };\n\n      _proto.getData = function getData(keys, isInner, apiType) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType]\n        });\n      };\n\n      _proto.removeData = function removeData(keys, isInner, apiType, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.DEL_RTC_DATA,\n          args: [this.roomId, keys, isInner, apiType, message]\n        });\n      };\n\n      _proto.setUserData = function setUserData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.getUserData = function getUserData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.PERSON);\n      };\n\n      _proto.removeUserData = function removeUserData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.PERSON, message);\n      };\n\n      _proto.setRoomData = function setRoomData(key, value, isInner, message) {\n        return this.setData(key, value, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getRoomData = function getRoomData(keys, isInner) {\n        return this.getData(keys, isInner, RTC_API_TYPE.ROOM);\n      };\n\n      _proto.removeRoomData = function removeRoomData(keys, isInner, message) {\n        return this.removeData(keys, isInner, RTC_API_TYPE.ROOM, message);\n      };\n\n      _proto.getUserList = function getUserList() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_USER_LIST,\n          args: [this.option]\n        });\n      };\n\n      _proto.setOutData = function setOutData(rtcData, type, message) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_OUT_DATA,\n          args: [this.roomId, rtcData, type, message]\n        });\n      };\n\n      _proto.getOutData = function getOutData(userIds) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_OUT_DATA,\n          args: [this.roomId, userIds]\n        });\n      };\n\n      _proto.getToken = function getToken() {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.GET_RTC_TOKEN,\n          args: [this.option]\n        });\n      };\n\n      _proto.setState = function setState(content) {\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SET_RTC_STATE,\n          args: [this.option, content]\n        });\n      };\n\n      _proto.send = function send(option) {\n        var id = this.roomId;\n        var conversation = {\n          type: CONVERSATION_TYPE.RTC_ROOM,\n          targetId: id\n        };\n        return _engineDispatcher.exec({\n          event: ENGINE_EVENT.SEND_MESSAGE,\n          args: [conversation, option]\n        });\n      };\n\n      return RTC;\n    }(), _temp;\n  });\n\n  var IM = function () {\n    function IM(option) {\n      this._engineDispatcher = void 0;\n\n      var _validate = validate({\n        appkey: Type.String\n      }, option, 'RongIMLib.init'),\n          isError = _validate.isError,\n          jsonInfo = _validate.jsonInfo;\n\n      if (isError) {\n        throw Error(jsonInfo);\n      }\n\n      var engineHandler = new EngineDispatcher(option);\n      this._engineDispatcher = engineHandler;\n      var Modules = {\n        Conversation: Conversation(engineHandler),\n        ChatRoom: ChatRoom(engineHandler),\n        RTC: RTC(engineHandler)\n      };\n      utils.extend(this, Modules);\n    }\n\n    var _proto = IM.prototype;\n\n    _proto.getConnectionStatus = function getConnectionStatus() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_STATUS\n      });\n    };\n\n    _proto.getConnectionUserId = function getConnectionUserId() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTION_USER_ID\n      });\n    };\n\n    _proto.getConnectedTime = function getConnectedTime() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_CONNECTED_TIME\n      });\n    };\n\n    _proto.getAppInfo = function getAppInfo() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_APP_INFO\n      });\n    };\n\n    _proto.watch = function watch(watchers) {\n      var _validate2 = validate({\n        conversation: Type.Function.canBeNull(),\n        message: Type.Function.canBeNull(),\n        status: Type.Function.canBeNull(),\n        setting: Type.Function.canBeNull()\n      }, watchers, 'im.watch'),\n          isError = _validate2.isError,\n          jsonInfo = _validate2.jsonInfo;\n\n      if (isError) {\n        utils.consoleError(jsonInfo);\n        return jsonInfo;\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.unwatch = function unwatch(watchers) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.UN_WATCH,\n        args: [watchers]\n      });\n    };\n\n    _proto.connect = function connect(user) {\n      var _validate3 = validate({\n        token: Type.String\n      }, user, 'im.connect'),\n          isError = _validate3.isError,\n          info = _validate3.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.CONNECT,\n        args: [user]\n      });\n    };\n\n    _proto.reconnect = function reconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.RECONNECT\n      });\n    };\n\n    _proto.disconnect = function disconnect() {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.DISCONNECT,\n        args: [true]\n      });\n    };\n\n    _proto.changeUser = function changeUser(user) {\n      var _validate4 = validate({\n        token: Type.String\n      }, user, 'im.changeUser'),\n          isError = _validate4.isError,\n          info = _validate4.info;\n\n      if (isError) {\n        return utils.Defer.reject(info);\n      }\n\n      var self = this;\n      return self.disconnect().then(function () {\n        return self.connect(user);\n      });\n    };\n\n    _proto.getFileToken = function getFileToken(fileType, originName) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_TOKEN,\n        args: [fileType, originName]\n      });\n    };\n\n    _proto.getFileUrl = function getFileUrl(fileType, fileName, originName, uploadResp) {\n      return this._engineDispatcher.exec({\n        event: ENGINE_EVENT.GET_UPLOAD_URL,\n        args: [fileType, fileName, originName, uploadResp]\n      });\n    };\n\n    return IM;\n  }();\n\n  var imInstance;\n\n  var initLogger = function initLogger(option, im) {\n    var isDebug = option.isDebug,\n        appkey = option.appkey,\n        logCollectEvent = option.logger;\n    utils.isFunction(logCollectEvent) && Logger.watchLog(logCollectEvent);\n    Logger.setOption({\n      isDebug: isDebug,\n      appkey: appkey\n    });\n    Logger.info(TAG.A_INIT_O, {\n      content: option\n    });\n    im.watch({\n      status: function status(_ref) {\n        var _status = _ref.status;\n        Logger.setOption({\n          isNetworkUnavailable: utils.isEqual(_status, CONNECTION_STATUS.NETWORK_UNAVAILABLE)\n        });\n      }\n    });\n  };\n\n  var init = function init(option) {\n    option = utils.extendInShallow(IM_OPTION, option);\n    option.connectType = common.getConnectType(option);\n\n    if (!imInstance) {\n      imInstance = new IM(option);\n      initLogger(option, imInstance);\n    }\n\n    return imInstance;\n  };\n\n  var getInstance = function getInstance() {\n    return imInstance;\n  };\n\n  var index = utils.extend({\n    init: init,\n    getInstance: getInstance,\n    env: env,\n    common: common,\n    ERROR_CODE: ERROR_CODE,\n    Logger: Logger\n  }, product);\n\n  return index;\n\n})));\n"
  },
  {
    "path": "miniprogram-upload/pages/services.js",
    "content": "const RongIMLib = require('./lib/RongIMLib-3.0.4-dev.js');\n\nconst user = {\n  appkey: '8luwapkv847cl',\n  token: 'he3YikQuzZSLFeN4I19auTEWhHbheoXkUYOiZGgipDk=@aa8f.cn.rongnav.com;aa8f.cn.rongcfg.com',\n  qiniuHost: 'https://upload.qiniup1.com'\n}\n\nlet imInstance = null;\n\nlet connect = function(){\n  imInstance = RongIMLib.init(user);\n  imInstance.watch({\n    status: function ({ status }) {\n      console.log(status);\n    },\n    message: function ({ message  }) {\n      console.log(message);\n    }\n  });\n  imInstance.connect(user).then(user => {\n    console.log(user)\n  })\n}\n\nlet Status = {\n  connect: connect\n}\n\nconst uploadBos = (url, fileInfo, header) => {\n  return new Promise((resolve, reject) => {\n    const fileData = wx.getFileSystemManager().readFileSync(fileInfo.path);\n    wx.request({\n      url: url,\n      header: header,\n      method: 'POST',\n      data: fileData,\n      success: function(res) {\n        console.log(res);\n        let data = {\n          downloadUrl: url, //上传成功的 url 即为下载 url\n          isBosRes: true // 判断是否是百度返回\n        }\n        resolve(data);\n      },\n      fail: reject\n    });\n  });\n}\n\nconst uploadQiNiu = (fileInfo, token, bosHeaders, bosUrl) => {\n  const url = user.qiniuHost;\n  return new Promise((resolve, reject) => {\n    wx.uploadFile({\n      url: url,\n      filePath: fileInfo.path,\n      name: 'file',\n      formData: {\n        token: token\n      },\n      success: resolve,\n      fail: function(err){\n        console.log('upload qiniu failed', err);\n        uploadBos(bosUrl, fileInfo, bosHeaders).then(function(res) {\n          resolve(res);\n        },function(err) {\n          reject(err);\n        });\n      }\n    })\n  });\n};\n\nconst upload = (fileInfo, uploadType) => {\n  let fileType = uploadType || RongIMLib.FILE_TYPE.FILE;\n  let fileName = fileInfo.name || '';\n  return imInstance.getFileToken(fileType, fileName).then(result => {\n    let { token, bosToken, bosDate, bos, path } = result;\n    let bosHeaders = {\n      'authorization': bosToken,\n      'x-bce-date': bosDate,\n      'Content-Type': 'multipart/form-data',\n    }\n    let bosUploadUrl = bos + path;\n    return uploadQiNiu(fileInfo, token, bosHeaders, bosUploadUrl);\n  }).then(res => {\n    let qiniuHash, qiniuName;\n    if(!res.isBosRes){\n      const { data } = res;\n      const { hash, name } = JSON.parse(data);\n      qiniuHash = hash, qiniuName = name;\n    }\n    return imInstance.getFileUrl(fileType, qiniuHash, qiniuName, res);\n  })\n}\n\nconst File = {\n  upload: upload\n}\n\nmodule.exports = {\n  Status: Status,\n  File: File\n}"
  },
  {
    "path": "miniprogram-upload/project.config.json",
    "content": "{\n\t\"description\": \"项目配置文件\",\n\t\"packOptions\": {\n\t\t\"ignore\": []\n\t},\n\t\"setting\": {\n\t\t\"urlCheck\": false,\n\t\t\"es6\": true,\n\t\t\"postcss\": true,\n\t\t\"preloadBackgroundData\": false,\n\t\t\"minified\": true,\n\t\t\"newFeature\": true,\n\t\t\"autoAudits\": false,\n\t\t\"coverView\": true,\n\t\t\"showShadowRootInWxmlPanel\": true,\n\t\t\"scopeDataCheck\": false,\n\t\t\"checkInvalidKey\": true,\n\t\t\"checkSiteMap\": true,\n\t\t\"uploadWithSourceMap\": true,\n\t\t\"babelSetting\": {\n\t\t\t\"ignore\": [],\n\t\t\t\"disablePlugins\": [],\n\t\t\t\"outputPath\": \"\"\n\t\t},\n\t\t\"useCompilerModule\": false,\n\t\t\"userConfirmedUseCompilerModuleSwitch\": false\n\t},\n\t\"compileType\": \"miniprogram\",\n\t\"libVersion\": \"2.11.1\",\n\t\"appid\": \"wx97828bacbc4a24f3\",\n\t\"projectname\": \"miniprogram-3\",\n\t\"debugOptions\": {\n\t\t\"hidedInDevtools\": []\n\t},\n\t\"isGameTourist\": false,\n\t\"simulatorType\": \"wechat\",\n\t\"simulatorPluginLibVersion\": {},\n\t\"condition\": {\n\t\t\"search\": {\n\t\t\t\"current\": -1,\n\t\t\t\"list\": []\n\t\t},\n\t\t\"conversation\": {\n\t\t\t\"current\": -1,\n\t\t\t\"list\": []\n\t\t},\n\t\t\"game\": {\n\t\t\t\"currentL\": -1,\n\t\t\t\"list\": []\n\t\t},\n\t\t\"miniprogram\": {\n\t\t\t\"current\": -1,\n\t\t\t\"list\": []\n\t\t}\n\t}\n}"
  },
  {
    "path": "miniprogram-upload/sitemap.json",
    "content": "{\n  \"desc\": \"关于本文件的更多信息，请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html\",\n  \"rules\": [{\n  \"action\": \"allow\",\n  \"page\": \"*\"\n  }]\n}"
  },
  {
    "path": "miniprogram-upload/utils/util.js",
    "content": "const formatTime = date => {\n  const year = date.getFullYear()\n  const month = date.getMonth() + 1\n  const day = date.getDate()\n  const hour = date.getHours()\n  const minute = date.getMinutes()\n  const second = date.getSeconds()\n\n  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')\n}\n\nconst formatNumber = n => {\n  n = n.toString()\n  return n[1] ? n : '0' + n\n}\n\nmodule.exports = {\n  formatTime: formatTime\n}\n"
  },
  {
    "path": "nav/README.md",
    "content": "# websdk-demo-nav\n\n"
  },
  {
    "path": "nav/css/iconfont.css",
    "content": "@font-face {\n  font-family: 'iconfont';  /* project id 1235765 */\n  src: url('//at.alicdn.com/t/font_1235765_94fgwalcq17.eot');\n  src: url('//at.alicdn.com/t/font_1235765_94fgwalcq17.eot?#iefix') format('embedded-opentype'),\n  url('//at.alicdn.com/t/font_1235765_94fgwalcq17.woff2') format('woff2'),\n  url('//at.alicdn.com/t/font_1235765_94fgwalcq17.woff') format('woff'),\n  url('//at.alicdn.com/t/font_1235765_94fgwalcq17.ttf') format('truetype'),\n  url('//at.alicdn.com/t/font_1235765_94fgwalcq17.svg#iconfont') format('svg');\n}\n\n.iconfont {\n  font-family: \"iconfont\" !important;\n  font-size: 16px;\n  font-style: normal;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.icon-open-source:before {\n  content: \"\\e718\";\n}\n\n.icon-integrate:before {\n  content: \"\\ec89\";\n}\n\n.icon-solution:before{\n  content: \"\\e615\";\n}\n\n.icon-kuozhan:before {\n  content: \"\\e693\";\n}\n\n.icon-shilidaima:before {\n  content: \"\\e656\";\n}\n\n.icon-yindao:before {\n  content: \"\\e611\";\n}\n\n"
  },
  {
    "path": "nav/css/style.css",
    "content": "html, body {\n    height: 100%;\n    width: 100%;\n    margin: 0;\n    padding: 0;\n    font-family: PingFangSC-Regular, Helvetica Neue, Microsoft Yahei, 微软雅黑;\n    background-color: #F3F6F8;\n}\n\nul, li {\n    margin: 0;\n    padding: 0;\n    list-style: none;\n}\n\na {\n    text-decoration: none;\n}\n\n.rong-container {\n    height: 100%;\n    width: 100%;\n}\n\n.rong-nav-box {\n    width: 200px;\n    height: 100%;\n    background: #30333C;\n    float: left;\n    color: #fff;\n}\n\n.rong-nav-box>div {\n    width: 80%;\n    margin: 0 auto;\n}\n\n.rong-nav-title {\n    text-align: center;\n}\n\n.rong-web-title {\n    font-size: 13px;\n    border-top: 2px solid hsla(0, 0%, 100%, .04);\n    border-bottom: 2px solid hsla(0, 0%, 100%, .04);\n}\n\n.rong-web-title>p {\n    border-right: 3px solid #3a85ff;\n}\n\n.rong-navs {\n    height: 300px;\n    overflow-y: auto;\n}\n\n.rong-nav {\n    height: 33px;\n    display: flex;\n    align-items: center;\n}\n\n.rong-navs a {\n    color: #6B7386;\n    font-size: 12px;\n    padding-left: 30px;\n    box-sizing: border-box;\n    display: block;\n}\n\n.rong-navs a:hover {\n    color: #FFF;\n}\n\n.active-nav {\n    color: #FFF !important;\n    cursor: pointer;\n}\n\n.rong-nav i {\n    margin-right: 8px;\n}\n\n.rong-main {\n    height: 100%;\n    margin-left: 150px;\n    overflow-y: auto;\n    color: #4D4D4D;\n}\n\n.rong-animate {\n    animation: moveDown 0.6s ease-in-out 0.2s backwards;\n}\n\n@keyframes moveDown {\n    0% {\n        transform: translateY(-40px);\n        opacity: 0;\n    }\n    100% {\n        transform: translateY(0px);\n        opacity: 1;\n    }\n}\n\n.rong-content {\n    width: 95%;\n    background: #fff;\n    margin: 20px;\n    padding-bottom: 20px;\n    border-radius: 5px;\n    display: inline-block;\n}\n\n.rong-content-title {\n    padding: 12px 0 0 2.1%;\n    font-size: 18px;\n}\n\n.rong-content-item {\n    border-radius: 6px;\n    padding: 10px;\n    width: 20%;\n    min-width: 200px;\n    margin: 22px 0 0 2.1%;\n    float: left;\n    overflow: hidden;\n    border: 1px solid #e4ecf3;\n    box-shadow: 1px 2px 3px #f2f6f8;\n    max-height: 107px;\n}\n\n.rong-content-item:hover {\n    transform: translateY(-6px);\n    transition: all .3s ease;\n}\n\n.rong-content-logo {\n    display: flex;\n    align-items: center;\n}\n\n.rong-content-logo div {\n    width: 28px;\n    height: 28px;\n    vertical-align: middle;\n    background-size: 100%;\n    background-repeat: no-repeat;\n    background-position: center\n}\n.rong-content-desc {\n    color: gray;\n    font-size: 12px;\n    padding-top: 10px;\n    height: 35px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    display: block;\n    line-clamp: 2;\n    box-orient: vertical;\n}\n\n.text-over-ellipsis {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    margin-left: 5px;\n}\n\n.rong-content-logo {\n    height: 40px;\n    position: relative;\n    font-size: 14px;\n    font-weight: 700;\n    color: #3273dc;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    padding: 0 .1rem;\n}"
  },
  {
    "path": "nav/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Web 前端导航</title>\n    <link rel=\"icon\" type=\"image/png\" href=\"https://www.rongcloud.cn/favicon-32x32.png\" sizes=\"32x32\">\n    <link rel=\"stylesheet\" href=\"./css/iconfont.css\">\n    <link rel=\"stylesheet\" href=\"./css/style.css\">\n    <script src=\"./js/config.js\"></script>\n</head>\n<body>\n    <div class=\"rong-container\">\n        <div class=\"rong-nav-box\">\n            <div class=\"rong-nav-title\">\n                <p>RongCloud Web</p>\n            </div>\n            <div class=\"rong-category\">\n                <div class=\"rong-category-web\">\n                    <div class=\"rong-web-title\">\n                        <p>前端导航</p>\n                    </div>\n                    <div id=\"web_demo_nav\">\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class=\"rong-main rong-animate\" id=\"main_content\"></div>\n    </div>\n\n    <script src=\"./js/index.js\"></script>\n</body>\n\n</html>"
  },
  {
    "path": "nav/js/config.js",
    "content": "var RCConf = {\n  navs: {\n    id: 'web-navi',\n    name: '前端导航',\n    icon: '',\n    children: [\n      {\n        id: 'docs-nav',\n        name: '文档地址',\n        icon: 'icon-yindao',\n        children: []\n      },\n      {\n        id: 'sdk-require',\n        name: '引入示例',\n        icon: 'icon-shilidaima',\n        children: []\n      },\n      {\n        id: 'sdk-api',\n        name: '接口示例',\n        icon: 'icon-shilidaima',\n        children: []\n      },\n      {\n        id: 'extensions',\n        name: '扩展组件',\n        icon: 'icon-kuozhan',\n        children: []\n      },\n      {\n        id: 'solution',\n        name: '解决方案',\n        icon: 'icon-solution',\n        children: []\n      },\n      {\n        id: 'integrate',\n        name: '项目集成',\n        icon: 'icon-integrate',\n        children: []\n      },\n      {\n        id: 'open-source',\n        name: '开源项目',\n        icon: 'icon-open-source',\n        children: []\n      }\n    ],\n  },\n  navi_items: [\n    {\n      id: 'docs-nav',\n      name: '文档地址',\n      children: [\n        {\n          name: 'IM SDK 集成指南',\n          icon: './res/im-sdk.png',\n          linkUrl: 'https://www.rongcloud.cn/docs/web.html',\n          detail: '包含 Web IM SDK API、兼容性说明及简要集成步骤',\n        },\n        {\n          name: 'RTC SDK 集成指南',\n          icon: './res/rtc.png',\n          linkUrl: 'https://www.rongcloud.cn/docs/web_rtclib.html',\n          detail: '包含 Web RTC SDK API 说明、架构介绍，集成 RTC SDK 必读指南',\n        },\n        {\n          name: 'CallLib 集成指南',\n          icon: './res/calllib.png',\n          linkUrl: 'https://www.rongcloud.cn/docs/web_calllib.html',\n          detail: '包含音视频通话呼叫流程、API 说明，集成 CallLib 必读指南',\n        }\n      ],\n    },\n    {\n      id: 'sdk-require',\n      name: '引入示例',\n      children: [{\n        name: 'IM + Vue (Normal)',\n        icon: './res/vue.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/vue/normal.html',\n        detail: 'IM SDK 配合 Vue，以 script 标签引入 vue.js 示例',\n      },{\n        name: 'IM + Vue (RequireJS)',\n        icon: './res/vue.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/vue/require.html',\n        detail: '通过 RequireJS 加载 IM SDK、Vue 示例',\n      },{\n        name: 'IM 示例 (SeaJS)',\n        icon: './res/seajs.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/seajs.html',\n        detail: '通过 SeaJS 加载 IM SDK 示例',\n      },{\n        name: 'IM SDK 示例 (RequireJS)',\n        icon: './res/requirejs.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/require.html',\n        detail: '在浏览器中使用 RequreJS 加载 JavaScript',\n      },{\n        name: 'IM + React',\n        icon: './res/reactjs.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/react/im.html',\n        detail: '基于 ReactJS + IM SDK 的示例',\n      },{\n        name: 'IM SDK Electron Vue',\n        icon: './res/electron.png',\n        linkUrl: 'https://github.com/rongcloud/websdk-demo/tree/master/electron-vue',\n        detail: '在 Electron Vue 中使用 IM SDK 示例',\n      },{\n        name: 'Normal SDK in Electron',\n        icon: './res/electron.png',\n        linkUrl: 'https://github.com/rongcloud/websdk-demo/tree/master/electron/normal.html',\n        detail: '在 Electron 中使用 script 标签引入 SDK，并连接成功',\n      },{\n        name: 'Require SDK in Electron',\n        icon: './res/electron.png',\n        linkUrl: 'https://github.com/rongcloud/websdk-demo/tree/master/electron/requirejs-in-node.html',\n        detail: '在 Electron 中使用 RequireJS 加载 IM SDK',\n      }]\n    },\n    {\n      id: 'sdk-api',\n      name: '接口示例',\n      children: [{\n        name: 'IM SDK API',\n        icon: './res/api.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/api-test.html',\n        detail: 'IM SDK 所有暴露 API 示例'\n      },        {\n        name: '获取历史消息',\n        icon: './res/message.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/histroy-messages.html',\n        detail: '获取历史消息接口说明及示例',\n      },{\n        name: '消息监听',\n        icon: './res/js.png',\n        linkUrl: 'https://github.com/rongcloud/websdk-demo/tree/master/local-sdks',\n        detail: '包含从初始化至接收消息示例',\n      },{\n        name: '消息监听回调队列',\n        icon: './res/que.png',\n        linkUrl: 'https://rongcloud.github.io/websdk-demo/init-muti.html',\n        detail: '消息监听回调队列',\n      }]\n    },\n    // 扩展组件 Component\n    {\n      id: 'extensions',\n      name: '扩展组件',\n      children: [\n        {\n          name: '表情插件',\n          icon: './res/emoji.png',\n          linkUrl: 'https://rongcloud.github.io/websdk-demo/emoji.html',\n          detail: '支持 128 个 Emoji 表情并且支持自定义扩展',\n        },\n        {\n          name: '声音插件',\n          icon: './res/voice.png',\n          linkUrl: 'https://rongcloud.github.io/websdk-demo/voice.html',\n          detail: 'Web 端播放移动端语音消息插件（VoiceMessage）',\n        },\n        {\n          name: '上传插件',\n          icon: './res/upload.png',\n          linkUrl: 'https://github.com/rongcloud/rongcloud-web-im-upload',\n          detail: '支持上传至七牛、阿里、腾讯、融云文件服务器',\n        },\n      ]\n    },\n    {\n      id: 'solution',\n      name: '解决方案',\n      children: [{\n        name: '小程序解决方案',\n        icon: './res/mini.png',\n        linkUrl: 'https://www.rongcloud.cn/docs/mini_program.html',\n        detail: '面向各厂商小程序（微信、今日头条、支付宝 、百度）的 IM SDK',\n      },\n      {\n        name: '桌面版决方案',\n        icon: './res/desktop.png',\n        linkUrl: 'https://www.rongcloud.cn/docs/desktop/index.html',\n        detail: '基于 Electron 封装了 C++ IMLib、文件管理、截图等丰富功能模块',\n      }]\n    },\n    // 集成项目\n    {\n      id: 'integrate',\n      name: '集成项目',\n      children: [\n        {\n          name: 'Web 聊天室',\n          icon: './res/chatroom.png',\n          linkUrl: 'https://rongcloud.github.io/websdk-demo/chatroom/chatroom.html',\n          detail: '聊天室弹幕示例',\n        },\n        {\n          name: 'Web IM',\n          icon: './res/im.png',\n          linkUrl: 'https://rongcloud.github.io/websdk-demo/im/im.html',\n          detail: '无框架依赖 Web IM 示例',\n        },\n        {\n          name: 'Web IM (Angular)',\n          icon: './res/angular.png',\n          linkUrl: 'https://github.com/rongcloud/rongcloud-web-im-widget',\n          detail: '基于 Angular 的 Web IM 示例',\n        },\n        {\n          name: 'Web IM H5 (Angular)',\n          icon: './res/angular.png',\n          linkUrl: 'https://github.com/rongcloud/rongcloud-web-im-widget-h5',\n          detail: '基于 Angular 的 H5 Web IM 示例',\n        },\n        {\n          name: 'Web 客服（智齿）',\n          icon: './res/js.png',\n          linkUrl: 'https://rongcloud.github.io/websdk-demo/cs/sobot/cs.html',\n          detail: 'IM SDK 对接智齿客服，无框架依赖',\n        }\n      ]\n    },\n    {\n      id: 'open-source',\n      name: '开源项目',\n      children: [\n        {\n          name: 'SealTalk',\n          icon: './res/sealtalk.png',\n          linkUrl: 'https://github.com/sealtalk',\n          detail: '基于融云各平台 SDK 开发的即时通讯应用',\n        },{\n          name: 'Web IM SDK V2',\n          icon: './res/js.png',\n          linkUrl: 'https://github.com/rongcloud/rongcloud-web-im-sdk-v2',\n          detail: 'Web (JavaScript) IM SDK of RongCloud Version 2',\n        },\n        {\n          name: 'Web RTC SDK V3',\n          icon: './res/js.png',\n          linkUrl: 'https://github.com/rongcloud/rongcloud-web-rtc-sdk-v3',\n          detail: 'Web (JavaScript) RTC SDK of RongCloud Version 3.',\n        }\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "nav/js/index.js",
    "content": "var navDocsClass = new NavDocsClass();\n\nnavDocsClass.init();\n\n\nfunction NavDocsClass() {\n    /**\n     *  docs 默认图标\n     * @type {string}\n     */\n    this.defaultItemIconImage = 'https://www.rongcloud.cn/pc/images/mode-icon1.png';\n\n    this.webSdkUrl = 'https://cdn.ronghub.com/RongIMLib-2.3.0.js';\n\n    /**\n     * 左侧导航栏导航数据\n     */\n    this.navConfigData = RCConf.navs;\n\n    /**\n     * 内容展示 数据配置\n     */\n    this.contentConfigData = RCConf.navi_items;\n\n    this.selectedNav = '';\n\n    /**\n     * 初始化\n     */\n    this.init = function () {\n        var navigationData = this.navConfigData.children;\n        var contentData = this.contentConfigData;\n        this.renderNavigationBar(navigationData);\n        this.renderContent(contentData);\n\n        this.addElementSelectedEvent();\n    };\n\n    /**\n     * 渲染侧边栏\n     */\n    this.renderNavigationBar = function (navData) {\n        var navElement = document.getElementById('web_demo_nav');\n        var navContent = document.createElement('ul');\n        navContent.classList = 'rong-navs';\n\n        var navHtml = '';\n        if (this.isArray(navData) && navData.length) {\n            navData.forEach(function (item, index, arr) {\n                var id = item.id;\n                var name = item.name;\n                var icon = item.icon;\n\n                navHtml += '<a href=\"#' + id + '\">';\n                navHtml += '<li class=\"rong-nav\">';\n                navHtml += '<i class=\"iconfont ' + icon + '\"></i>' + name;\n                navHtml += '</li></a>'\n            });\n        }\n\n        navContent.innerHTML = navHtml;\n        navElement.appendChild(navContent);\n    };\n\n    /**\n     * 渲染右侧展示内容\n     * @param contentData\n     */\n    this.renderContent = function (contentData) {\n        var that = this;\n        var mainContentElement = document.getElementById('main_content');\n\n        var elements = [];\n        if (this.isArray(contentData) && contentData.length) {\n            contentData.forEach(function (item, index, arr) {\n                var html = '';\n                var id = item.id;\n                var name = item.name;\n                var childrenData = item.children;\n\n                html += '<div class=\"rong-content\" id=' + id + '>';\n                html += '<div class=\"rong-content-title\">' + name + '</div>';\n                html += that.getDocsItem(childrenData);\n                html += '</div>';\n                elements.push(html);\n            });\n        }\n\n        var index = 0;\n        var timer = setInterval(() => {\n            var html = elements[index];\n            if (!html) {\n                return clearInterval(timer);\n            }\n            mainContentElement.innerHTML += html;\n            index += 1;\n        }, 200);\n    };\n\n\n    /**\n     * 返回每一项html\n     * @param itemData\n     * @returns {string}\n     */\n    this.getDocsItem = function (itemData) {\n        var that = this;\n        var itemHtml = '';\n\n        if (this.isArray(itemData) && itemData.length) {\n            itemData.forEach(function (item, index, arr) {\n                var name = item.name || '';\n                var linkUrl = item.linkUrl || '';\n                var icon = item.icon || that.defaultItemIconImage;\n                var detail = item.detail || name;\n\n                itemHtml += '<a href=' + linkUrl + ' target=\"_blank\"><div class=\"rong-content-item\">';\n                itemHtml += '<div class=\"rong-content-logo rong-content-logo\">' + '<div style=\"background-image: url(' + icon + ')\"></div><span class=\"text-over-ellipsis\">' + name + '</span></div>';\n                itemHtml += '<div class=\"rong-content-desc\">' + detail + '</div>';\n                itemHtml += '</div></a>'\n            });\n        }\n\n        return itemHtml;\n    };\n\n    /**\n     * 添加选中效果\n     */\n    this.addElementSelectedEvent = function (event) {\n        var that = this;\n        var allNavElement = document.querySelectorAll('#web_demo_nav > ul > a');\n\n        if (!allNavElement.length) return;\n\n        let hash = location.hash, selectNode = null;\n        allNavElement.forEach(function (node, index) {\n            if (node.hash == hash) {\n                selectNode = node;\n            }\n            node.addEventListener('click', function (event) {\n                that.addSelect(node);\n                that.removeNotActive();\n            })\n        });\n        if (selectNode) {\n            this.addSelect(selectNode);\n        }\n    };\n\n    this.addSelect = function (node) {\n        var id = node.attributes.href.value.replace(/^#/, '');\n\n        if (this.selectedNav === id) return;\n        this.selectedNav = id;\n        node.classList.add('active-nav');\n    };\n\n    this.removeNotActive = function () {\n        var that = this;\n        var allNavElement = document.querySelectorAll('#web_demo_nav > ul > a');\n        allNavElement.forEach(function (node, index) {\n            var id = node.attributes.href.value.replace(/^#/, '');\n            if (that.selectedNav !== id) node.classList.remove('active-nav');\n        })\n    };\n\n    this.isArray = function (str) {\n        return Object.prototype.toString.call(str) === \"[object Array]\";\n    };\n}\n\n"
  },
  {
    "path": "react/im.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\" />\n<title>融云 Web SDK React 示例</title>\n\n<!-- 引入 react -->\n<script src=\"react-16.2.js\"></script>\n<script src=\"react-dom-16.2.js\"></script>\n<script src=\"babel.min.js\"></script>\n\n\n<!-- 引入 融云 SDK -->\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script src=\"../init.js\"></script>\n\n<!-- 引入 用户信息、群组数据处理模块 -->\n<script src=\"../user-group.js\"></script>\n\n<!-- UI 组件 ../im-ui-mod/ui.html -->\n<link rel=\"stylesheet\" href=\"../im-ui-mod/reset.css\">\n<link rel=\"stylesheet\" href=\"../im-ui-mod/component-ui.css\">\n</head>\n\n\n\n<link rel=\"stylesheet\" href=\"../res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/react/im.html\" class=\"get-source\">获取源码</a>\n\n\n<body>\n<h1>融云 Web SDK React 示例</h1>\n<p>提供了登录、初始化链接、会话列表、发送消息、接收显示消息功能</p>\n<p>提供了用户、消息、会话 三个组件</p>\n<p><a href=\"https://reactjs.org/docs/lists-and-keys.html\">React 文档</a></p>\n<p><a href=\"../api-test.html\">发送消息测试页面</a> 各种消息发送示例、会话示例、聊天室示例等，可以参考</p>\n\n<div class=\"mod mod-inline-block\">\n    <h2>登录用户</h2>\n    <div id=\"user\"></div> \n</div>\n\n<div class=\"mod mod-inline-block\">\n    <h2>新消息</h2>\n    <div id=\"messages\"></div>\n</div>\n\n<div class=\"mod mod-inline-block\">\n    <h2>消息发送</h2>\n    <div id=\"message-send\"></div>\n</div>\n\n<div class=\"mod mod-conversation\">\n    <h2>会话列表</h2>\n    <div id=\"conversations\"></div>\n</div>\n\n<script>\n//获取用户信息组件\nvar AppData = RongIM.AppData;\n\n//mock portrait\nfunction getRandomImage(str){\n    var images = [\n        \"https://avatars2.githubusercontent.com/u/212329?s=96&v=4\",\n        \"https://avatars0.githubusercontent.com/u/8535523?s=96&v=4\",\n        \"https://avatars3.githubusercontent.com/u/11469967?s=96&v=4\",\n        \"https://avatars2.githubusercontent.com/u/6104485?s=96&v=4\",\n        \"https://avatars3.githubusercontent.com/u/17945733?s=96&v=4\",\n        \"https://avatars1.githubusercontent.com/u/14857191?s=96&v=4\",\n        \"https://avatars2.githubusercontent.com/u/680807?s=96&v=4\"\n    ];\n\n    var n = Math.ceil(Math.random()*10000) + Math.ceil(Math.random()*5000);\n    return images[n%images.length];\n}\n\n//登录 初始化逻辑示例\nfunction login(userInfo, callbacks){\n    /*\n    userInfo = {\n        name : name,\n        password : password\n    }\n    */ \n    var appKey = \"8w7jv4qb78a9y\";\n\n    ajax(userInfo,function(data){\n        var token = data.token;\n        var appInfo = {\n            appKey : appKey,\n            token : data.token\n        };\n        init(appInfo, {\n            getInstance : function(instance){\n                callbacks.getInstance(instance);\n            },\n            getCurrentUser : function(userInfo){\n                callbacks.getCurrentUser(data)\n            },\n            receiveNewMessage : function(message){\n                callbacks.receiveNewMessage(message);\n            }\n        });\n    });\n} \n\nfunction ajax(userInfo, callback){\n    /*\n    请求应用服务器地址进行用户名+密码登录验证，验证通过后返回 token 、头像等\n\n    示例仅返回固定token，不实现具体请求过程\n    */ \n    var data = {\n        token : \"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\",\n        portrait : \"https://avatars1.githubusercontent.com/u/10265829?s=96&login-user\",\n        id : \"user9\",\n        name : \"我是user9\",\n        gender : \"men\",\n        other : \"其他业务需要的用户信息，格式也可自行设计\"\n\n    };\n    callback(data);\n} \n\n</script>\n\n<!-- 定义 消息、会话 组件 -->\n<script type=\"text/babel\">\nclass User extends React.Component {\n    componentDidMount() {\n        const id = this.props.user.id;\n        console.log(\"用户 \" + id + \" 渲染完成，即将显示\");\n    }\n\n    render() {\n        const user = this.props.user;\n        return (<div className=\"user\">\n            <img className=\"user-portrait\" src={user.portrait} />\n            <span className=\"user-name\">{user.name} (id:{user.id})</span>\n        </div>);\n    }\n}\n\nclass Message extends React.Component {\n  render() {\n    const message = this.props.message;\n    if(message.content.user){\n        return (<ul className=\"message\">\n            <li><User user={message.content.user} /></li>\n            <li className=\"message-sender\">发送者Id：{message.senderUserId}</li>\n            <li className=\"message-type\">消息类型：{message.objectName}</li>\n            <li className=\"message-uid\">消息UId：{message.messageUId}</li>\n            <li className=\"message-content\">消息正文：{message.content.content}</li>\n        </ul>);\n    }else{\n        return (<ul className=\"message\">\n            <li className=\"message-type\">消息类型：{message.objectName}</li>\n            <li className=\"message-uid\">消息UId：{message.messageUId}</li>\n            <li className=\"message-content\">消息正文：{message.content.content}</li>\n            <li className=\"message-sender\">发送者：{message.senderUserId}</li>\n        </ul>);    \n    }\n  }\n}\n\nclass Conversation extends React.Component {\n    componentDidMount() {\n        const message = this.props.conversation.latestMessage;\n        const sender = message.senderUserId;\n        const _this = this;\n        AppData.getUserInfos([sender],function(userInfos){\n            const userInfo = {\n                \"id\" : \"sender\",\n                \"name\" : \"李四\",\n                \"portrait\" : getRandomImage(sender)\n            };\n\n            //获取用户信息并传入\n            message.content.user = userInfo;\n\n            //通过 state 刷新页面显示\n            _this.setState({ refresh:true });\n        });\n    }\n\n    render() {\n        const conversation = this.props.conversation;\n        return (<ul className=\"conversation\">\n                    <li className=\"conversation-type\">会话类型： {conversation.conversationType}</li>\n                    <li className=\"conversation-type\">会话对象： {conversation.targetId}</li>\n                    <li><Message message={conversation.latestMessage} /></li>\n                </ul>);\n    }\n}\n</script>\n<!--\n -->\n<script type=\"text/babel\">\n//实际项目中可以通过登录界面获取对应值后再使用此方法\nvar userInfo = {\n    name : \"张三\",\n    password : \"***************\"\n};\n\n//登录、获取token，链接融云成功后可以进行消息收发\nlogin(userInfo, {\n    getInstance : function(instance){\n\n        (function showConversation(){\n            //获取会话列表\n            var conversationTypes = null;   //具体格式设置需要补充\n            var limit = 10;    //获取会话的数量，不传或传null为全部，暂不支持分页\n\n            instance.getConversationList({\n                onSuccess: function(list) {\n                    //文档 http://www.rongcloud.cn/docs/web.html#conversation\n\n                    const conversations = list.map((conversation, index) =>\n                        <Conversation conversation={conversation} key={index} />\n                    );\n                    \n                    ReactDOM.render(\n                        <div>{conversations}</div>,\n                        document.getElementById('conversations')\n                    );\n                },\n\n                onError: function(error) {}\n            }, conversationTypes, limit);\n        })();\n\n        (function showSendMessage(){\n            //发送消息 更多类型消息发送参考 https://github.com/rongcloud/websdk-demo/blob/master/api-test.html\n            var content = {\n                content: \"这是一条来自React demo的消息\"\n            };\n\n            var msg = new RongIMLib.TextMessage(content);\n            var conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n            var targetId = \"user8\";\n\n            instance.sendMessage(conversationType, targetId, msg, {\n                onSuccess: function (message) {\n                    const userId = message.senderUserId;\n                    AppData.getUserInfos([userId],function(userInfos){\n                        \n                        //user1 为 mock 数据，具体逻辑参考 user-group.js\n                        message.content.user =  userInfos[\"userId1\"];\n                        const _message = <Message message={message} />;\n\n                        ReactDOM.render(\n                            <div>{_message}</div>,\n                            document.getElementById('message-send')\n                        );\n                    });\n                },\n                onError: function (errorCode,message) {\n                }\n            });\n        })();\n    },\n\n    getCurrentUser : function(user){\n        const userCard = <User user={user} />\n\n        ReactDOM.render(\n          userCard,\n          document.getElementById('user')\n        );\n    },\n\n    receiveNewMessage : function(message){\n        console.log(message);\n        const messages = <Message message={message} />;\n\n        ReactDOM.render(\n            <div>{messages}</div>,\n            document.getElementById('messages')\n        );\n    }\n});\n</script>\n</body>\n</html>"
  },
  {
    "path": "react/react-16.2.js",
    "content": "/** @license React v16.2.0\n * react.development.js\n *\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.React = factory());\n}(this, (function () { 'use strict';\n\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc');  // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nvar objectAssign = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n// TODO: this is special because it gets imported during build.\n\nvar ReactVersion = '16.2.0';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol['for'];\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7;\nvar REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;\nvar REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable === 'undefined') {\n    return null;\n  }\n  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n  if (typeof maybeIterator === 'function') {\n    return maybeIterator;\n  }\n  return null;\n}\n\n/**\n * WARNING: DO NOT manually require this module.\n * This is a replacement for `invariant(...)` used by the error code system\n * and will _only_ be required by the corresponding babel pass.\n * It always throws.\n */\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar emptyObject = {};\n\n{\n  Object.freeze(emptyObject);\n}\n\nvar emptyObject_1 = emptyObject;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\n{\n  validateFormat = function validateFormat(format) {\n    if (format === undefined) {\n      throw new Error('invariant requires an error message argument');\n    }\n  };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n  validateFormat(format);\n\n  if (!condition) {\n    var error;\n    if (format === undefined) {\n      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n    } else {\n      var args = [a, b, c, d, e, f];\n      var argIndex = 0;\n      error = new Error(format.replace(/%s/g, function () {\n        return args[argIndex++];\n      }));\n      error.name = 'Invariant Violation';\n    }\n\n    error.framesToPop = 1; // we don't care about invariant's own frame\n    throw error;\n  }\n}\n\nvar invariant_1 = invariant;\n\n/**\n * Forked from fbjs/warning:\n * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js\n *\n * Only change is we use console.warn instead of console.error,\n * and do nothing when 'console' is not supported.\n * This really simplifies the code.\n * ---\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar lowPriorityWarning = function () {};\n\n{\n  var printWarning = function (format) {\n    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    var argIndex = 0;\n    var message = 'Warning: ' + format.replace(/%s/g, function () {\n      return args[argIndex++];\n    });\n    if (typeof console !== 'undefined') {\n      console.warn(message);\n    }\n    try {\n      // --- Welcome to debugging React ---\n      // This error was thrown as a convenience so that you can use this stack\n      // to find the callsite that caused this warning to fire.\n      throw new Error(message);\n    } catch (x) {}\n  };\n\n  lowPriorityWarning = function (condition, format) {\n    if (format === undefined) {\n      throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n    }\n    if (!condition) {\n      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n        args[_key2 - 2] = arguments[_key2];\n      }\n\n      printWarning.apply(undefined, [format].concat(args));\n    }\n  };\n}\n\nvar lowPriorityWarning$1 = lowPriorityWarning;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n  return function () {\n    return arg;\n  };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n  return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n  return arg;\n};\n\nvar emptyFunction_1 = emptyFunction;\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction_1;\n\n{\n  var printWarning$1 = function printWarning(format) {\n    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    var argIndex = 0;\n    var message = 'Warning: ' + format.replace(/%s/g, function () {\n      return args[argIndex++];\n    });\n    if (typeof console !== 'undefined') {\n      console.error(message);\n    }\n    try {\n      // --- Welcome to debugging React ---\n      // This error was thrown as a convenience so that you can use this stack\n      // to find the callsite that caused this warning to fire.\n      throw new Error(message);\n    } catch (x) {}\n  };\n\n  warning = function warning(condition, format) {\n    if (format === undefined) {\n      throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n    }\n\n    if (format.indexOf('Failed Composite propType: ') === 0) {\n      return; // Ignore CompositeComponent proptype check.\n    }\n\n    if (!condition) {\n      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n        args[_key2 - 2] = arguments[_key2];\n      }\n\n      printWarning$1.apply(undefined, [format].concat(args));\n    }\n  };\n}\n\nvar warning_1 = warning;\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n  {\n    var constructor = publicInstance.constructor;\n    var componentName = constructor && (constructor.displayName || constructor.name) || 'ReactClass';\n    var warningKey = componentName + '.' + callerName;\n    if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n      return;\n    }\n    warning_1(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\\n\\nPlease check the code for the %s component.', callerName, callerName, componentName);\n    didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n  }\n}\n\n/**\n * This is the abstract API for an update queue.\n */\nvar ReactNoopUpdateQueue = {\n  /**\n   * Checks whether or not this composite component is mounted.\n   * @param {ReactClass} publicInstance The instance we want to test.\n   * @return {boolean} True if mounted, false otherwise.\n   * @protected\n   * @final\n   */\n  isMounted: function (publicInstance) {\n    return false;\n  },\n\n  /**\n   * Forces an update. This should only be invoked when it is known with\n   * certainty that we are **not** in a DOM transaction.\n   *\n   * You may want to call this when you know that some deeper aspect of the\n   * component's state has changed but `setState` was not called.\n   *\n   * This will not invoke `shouldComponentUpdate`, but it will invoke\n   * `componentWillUpdate` and `componentDidUpdate`.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {?function} callback Called after component is updated.\n   * @param {?string} callerName name of the calling function in the public API.\n   * @internal\n   */\n  enqueueForceUpdate: function (publicInstance, callback, callerName) {\n    warnNoop(publicInstance, 'forceUpdate');\n  },\n\n  /**\n   * Replaces all of the state. Always use this or `setState` to mutate state.\n   * You should treat `this.state` as immutable.\n   *\n   * There is no guarantee that `this.state` will be immediately updated, so\n   * accessing `this.state` after calling this method may return the old value.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {object} completeState Next state.\n   * @param {?function} callback Called after component is updated.\n   * @param {?string} callerName name of the calling function in the public API.\n   * @internal\n   */\n  enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n    warnNoop(publicInstance, 'replaceState');\n  },\n\n  /**\n   * Sets a subset of the state. This only exists because _pendingState is\n   * internal. This provides a merging strategy that is not available to deep\n   * properties which is confusing. TODO: Expose pendingState or don't use it\n   * during the merge.\n   *\n   * @param {ReactClass} publicInstance The instance that should rerender.\n   * @param {object} partialState Next partial state to be merged with state.\n   * @param {?function} callback Called after component is updated.\n   * @param {?string} Name of the calling function in the public API.\n   * @internal\n   */\n  enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n    warnNoop(publicInstance, 'setState');\n  }\n};\n\n/**\n * Base class helpers for the updating state of a component.\n */\nfunction Component(props, context, updater) {\n  this.props = props;\n  this.context = context;\n  this.refs = emptyObject_1;\n  // We initialize the default updater but the real one gets injected by the\n  // renderer.\n  this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together.  You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n *        produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\nComponent.prototype.setState = function (partialState, callback) {\n  !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant_1(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;\n  this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\nComponent.prototype.forceUpdate = function (callback) {\n  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n{\n  var deprecatedAPIs = {\n    isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n    replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n  };\n  var defineDeprecationWarning = function (methodName, info) {\n    Object.defineProperty(Component.prototype, methodName, {\n      get: function () {\n        lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n        return undefined;\n      }\n    });\n  };\n  for (var fnName in deprecatedAPIs) {\n    if (deprecatedAPIs.hasOwnProperty(fnName)) {\n      defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n    }\n  }\n}\n\n/**\n * Base class helpers for the updating state of a component.\n */\nfunction PureComponent(props, context, updater) {\n  // Duplicated from Component.\n  this.props = props;\n  this.context = context;\n  this.refs = emptyObject_1;\n  // We initialize the default updater but the real one gets injected by the\n  // renderer.\n  this.updater = updater || ReactNoopUpdateQueue;\n}\n\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent;\n// Avoid an extra prototype jump for these methods.\nobjectAssign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\nfunction AsyncComponent(props, context, updater) {\n  // Duplicated from Component.\n  this.props = props;\n  this.context = context;\n  this.refs = emptyObject_1;\n  // We initialize the default updater but the real one gets injected by the\n  // renderer.\n  this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();\nasyncComponentPrototype.constructor = AsyncComponent;\n// Avoid an extra prototype jump for these methods.\nobjectAssign(asyncComponentPrototype, Component.prototype);\nasyncComponentPrototype.unstable_isAsyncReactComponent = true;\nasyncComponentPrototype.render = function () {\n  return this.props.children;\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n  /**\n   * @internal\n   * @type {ReactComponent}\n   */\n  current: null\n};\n\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n  key: true,\n  ref: true,\n  __self: true,\n  __source: true\n};\n\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\n\nfunction hasValidRef(config) {\n  {\n    if (hasOwnProperty$1.call(config, 'ref')) {\n      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n      if (getter && getter.isReactWarning) {\n        return false;\n      }\n    }\n  }\n  return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n  {\n    if (hasOwnProperty$1.call(config, 'key')) {\n      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n      if (getter && getter.isReactWarning) {\n        return false;\n      }\n    }\n  }\n  return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n  var warnAboutAccessingKey = function () {\n    if (!specialPropKeyWarningShown) {\n      specialPropKeyWarningShown = true;\n      warning_1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);\n    }\n  };\n  warnAboutAccessingKey.isReactWarning = true;\n  Object.defineProperty(props, 'key', {\n    get: warnAboutAccessingKey,\n    configurable: true\n  });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n  var warnAboutAccessingRef = function () {\n    if (!specialPropRefWarningShown) {\n      specialPropRefWarningShown = true;\n      warning_1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);\n    }\n  };\n  warnAboutAccessingRef.isReactWarning = true;\n  Object.defineProperty(props, 'ref', {\n    get: warnAboutAccessingRef,\n    configurable: true\n  });\n}\n\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, no instanceof check\n * will work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} key\n * @param {string|object} ref\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @param {*} owner\n * @param {*} props\n * @internal\n */\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n  var element = {\n    // This tag allow us to uniquely identify this as a React Element\n    $$typeof: REACT_ELEMENT_TYPE,\n\n    // Built-in properties that belong on the element\n    type: type,\n    key: key,\n    ref: ref,\n    props: props,\n\n    // Record the component responsible for creating this element.\n    _owner: owner\n  };\n\n  {\n    // The validation flag is currently mutative. We put it on\n    // an external backing store so that we can freeze the whole object.\n    // This can be replaced with a WeakMap once they are implemented in\n    // commonly used development environments.\n    element._store = {};\n\n    // To make comparing ReactElements easier for testing purposes, we make\n    // the validation flag non-enumerable (where possible, which should\n    // include every environment we run tests in), so the test framework\n    // ignores it.\n    Object.defineProperty(element._store, 'validated', {\n      configurable: false,\n      enumerable: false,\n      writable: true,\n      value: false\n    });\n    // self and source are DEV only properties.\n    Object.defineProperty(element, '_self', {\n      configurable: false,\n      enumerable: false,\n      writable: false,\n      value: self\n    });\n    // Two elements created in two different places should be considered\n    // equal for testing purposes and therefore we hide it from enumeration.\n    Object.defineProperty(element, '_source', {\n      configurable: false,\n      enumerable: false,\n      writable: false,\n      value: source\n    });\n    if (Object.freeze) {\n      Object.freeze(element.props);\n      Object.freeze(element);\n    }\n  }\n\n  return element;\n};\n\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\nfunction createElement(type, config, children) {\n  var propName;\n\n  // Reserved names are extracted\n  var props = {};\n\n  var key = null;\n  var ref = null;\n  var self = null;\n  var source = null;\n\n  if (config != null) {\n    if (hasValidRef(config)) {\n      ref = config.ref;\n    }\n    if (hasValidKey(config)) {\n      key = '' + config.key;\n    }\n\n    self = config.__self === undefined ? null : config.__self;\n    source = config.__source === undefined ? null : config.__source;\n    // Remaining properties are added to a new props object\n    for (propName in config) {\n      if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n        props[propName] = config[propName];\n      }\n    }\n  }\n\n  // Children can be more than one argument, and those are transferred onto\n  // the newly allocated props object.\n  var childrenLength = arguments.length - 2;\n  if (childrenLength === 1) {\n    props.children = children;\n  } else if (childrenLength > 1) {\n    var childArray = Array(childrenLength);\n    for (var i = 0; i < childrenLength; i++) {\n      childArray[i] = arguments[i + 2];\n    }\n    {\n      if (Object.freeze) {\n        Object.freeze(childArray);\n      }\n    }\n    props.children = childArray;\n  }\n\n  // Resolve default props\n  if (type && type.defaultProps) {\n    var defaultProps = type.defaultProps;\n    for (propName in defaultProps) {\n      if (props[propName] === undefined) {\n        props[propName] = defaultProps[propName];\n      }\n    }\n  }\n  {\n    if (key || ref) {\n      if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n        var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n        if (key) {\n          defineKeyPropWarningGetter(props, displayName);\n        }\n        if (ref) {\n          defineRefPropWarningGetter(props, displayName);\n        }\n      }\n    }\n  }\n  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\n\n/**\n * Return a function that produces ReactElements of a given type.\n * See https://reactjs.org/docs/react-api.html#createfactory\n */\n\n\nfunction cloneAndReplaceKey(oldElement, newKey) {\n  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n\n  return newElement;\n}\n\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\nfunction cloneElement(element, config, children) {\n  var propName;\n\n  // Original props are copied\n  var props = objectAssign({}, element.props);\n\n  // Reserved names are extracted\n  var key = element.key;\n  var ref = element.ref;\n  // Self is preserved since the owner is preserved.\n  var self = element._self;\n  // Source is preserved since cloneElement is unlikely to be targeted by a\n  // transpiler, and the original source is probably a better indicator of the\n  // true owner.\n  var source = element._source;\n\n  // Owner will be preserved, unless ref is overridden\n  var owner = element._owner;\n\n  if (config != null) {\n    if (hasValidRef(config)) {\n      // Silently steal the ref from the parent.\n      ref = config.ref;\n      owner = ReactCurrentOwner.current;\n    }\n    if (hasValidKey(config)) {\n      key = '' + config.key;\n    }\n\n    // Remaining properties override existing props\n    var defaultProps;\n    if (element.type && element.type.defaultProps) {\n      defaultProps = element.type.defaultProps;\n    }\n    for (propName in config) {\n      if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n        if (config[propName] === undefined && defaultProps !== undefined) {\n          // Resolve default props\n          props[propName] = defaultProps[propName];\n        } else {\n          props[propName] = config[propName];\n        }\n      }\n    }\n  }\n\n  // Children can be more than one argument, and those are transferred onto\n  // the newly allocated props object.\n  var childrenLength = arguments.length - 2;\n  if (childrenLength === 1) {\n    props.children = children;\n  } else if (childrenLength > 1) {\n    var childArray = Array(childrenLength);\n    for (var i = 0; i < childrenLength; i++) {\n      childArray[i] = arguments[i + 2];\n    }\n    props.children = childArray;\n  }\n\n  return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a valid component.\n * @final\n */\nfunction isValidElement(object) {\n  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar ReactDebugCurrentFrame = {};\n\n{\n  // Component that is being worked on\n  ReactDebugCurrentFrame.getCurrentStack = null;\n\n  ReactDebugCurrentFrame.getStackAddendum = function () {\n    var impl = ReactDebugCurrentFrame.getCurrentStack;\n    if (impl) {\n      return impl();\n    }\n    return null;\n  };\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\nfunction escape(key) {\n  var escapeRegex = /[=:]/g;\n  var escaperLookup = {\n    '=': '=0',\n    ':': '=2'\n  };\n  var escapedString = ('' + key).replace(escapeRegex, function (match) {\n    return escaperLookup[match];\n  });\n\n  return '$' + escapedString;\n}\n\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\nvar didWarnAboutMaps = false;\n\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction escapeUserProvidedKey(text) {\n  return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');\n}\n\nvar POOL_SIZE = 10;\nvar traverseContextPool = [];\nfunction getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {\n  if (traverseContextPool.length) {\n    var traverseContext = traverseContextPool.pop();\n    traverseContext.result = mapResult;\n    traverseContext.keyPrefix = keyPrefix;\n    traverseContext.func = mapFunction;\n    traverseContext.context = mapContext;\n    traverseContext.count = 0;\n    return traverseContext;\n  } else {\n    return {\n      result: mapResult,\n      keyPrefix: keyPrefix,\n      func: mapFunction,\n      context: mapContext,\n      count: 0\n    };\n  }\n}\n\nfunction releaseTraverseContext(traverseContext) {\n  traverseContext.result = null;\n  traverseContext.keyPrefix = null;\n  traverseContext.func = null;\n  traverseContext.context = null;\n  traverseContext.count = 0;\n  if (traverseContextPool.length < POOL_SIZE) {\n    traverseContextPool.push(traverseContext);\n  }\n}\n\n/**\n * @param {?*} children Children tree container.\n * @param {!string} nameSoFar Name of the key path so far.\n * @param {!function} callback Callback to invoke with each child found.\n * @param {?*} traverseContext Used to pass information throughout the traversal\n * process.\n * @return {!number} The number of children in this subtree.\n */\nfunction traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {\n  var type = typeof children;\n\n  if (type === 'undefined' || type === 'boolean') {\n    // All of the above are perceived as null.\n    children = null;\n  }\n\n  var invokeCallback = false;\n\n  if (children === null) {\n    invokeCallback = true;\n  } else {\n    switch (type) {\n      case 'string':\n      case 'number':\n        invokeCallback = true;\n        break;\n      case 'object':\n        switch (children.$$typeof) {\n          case REACT_ELEMENT_TYPE:\n          case REACT_CALL_TYPE:\n          case REACT_RETURN_TYPE:\n          case REACT_PORTAL_TYPE:\n            invokeCallback = true;\n        }\n    }\n  }\n\n  if (invokeCallback) {\n    callback(traverseContext, children,\n    // If it's the only child, treat the name as if it was wrapped in an array\n    // so that it's consistent if the number of children grows.\n    nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);\n    return 1;\n  }\n\n  var child;\n  var nextName;\n  var subtreeCount = 0; // Count of children found in the current subtree.\n  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n  if (Array.isArray(children)) {\n    for (var i = 0; i < children.length; i++) {\n      child = children[i];\n      nextName = nextNamePrefix + getComponentKey(child, i);\n      subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n    }\n  } else {\n    var iteratorFn = getIteratorFn(children);\n    if (typeof iteratorFn === 'function') {\n      {\n        // Warn about using Maps as children\n        if (iteratorFn === children.entries) {\n          warning_1(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum());\n          didWarnAboutMaps = true;\n        }\n      }\n\n      var iterator = iteratorFn.call(children);\n      var step;\n      var ii = 0;\n      while (!(step = iterator.next()).done) {\n        child = step.value;\n        nextName = nextNamePrefix + getComponentKey(child, ii++);\n        subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);\n      }\n    } else if (type === 'object') {\n      var addendum = '';\n      {\n        addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();\n      }\n      var childrenString = '' + children;\n      invariant_1(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);\n    }\n  }\n\n  return subtreeCount;\n}\n\n/**\n * Traverses children that are typically specified as `props.children`, but\n * might also be specified through attributes:\n *\n * - `traverseAllChildren(this.props.children, ...)`\n * - `traverseAllChildren(this.props.leftPanelChildren, ...)`\n *\n * The `traverseContext` is an optional argument that is passed through the\n * entire traversal. It can be used to store accumulations or anything else that\n * the callback might find relevant.\n *\n * @param {?*} children Children tree object.\n * @param {!function} callback To invoke upon traversing each child.\n * @param {?*} traverseContext Context for traversal.\n * @return {!number} The number of children in this subtree.\n */\nfunction traverseAllChildren(children, callback, traverseContext) {\n  if (children == null) {\n    return 0;\n  }\n\n  return traverseAllChildrenImpl(children, '', callback, traverseContext);\n}\n\n/**\n * Generate a key string that identifies a component within a set.\n *\n * @param {*} component A component that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\nfunction getComponentKey(component, index) {\n  // Do some typechecking here since we call this blindly. We want to ensure\n  // that we don't block potential future ES APIs.\n  if (typeof component === 'object' && component !== null && component.key != null) {\n    // Explicit key\n    return escape(component.key);\n  }\n  // Implicit key determined by the index in the set\n  return index.toString(36);\n}\n\nfunction forEachSingleChild(bookKeeping, child, name) {\n  var func = bookKeeping.func,\n      context = bookKeeping.context;\n\n  func.call(context, child, bookKeeping.count++);\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#react.children.foreach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n  if (children == null) {\n    return children;\n  }\n  var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);\n  traverseAllChildren(children, forEachSingleChild, traverseContext);\n  releaseTraverseContext(traverseContext);\n}\n\nfunction mapSingleChildIntoContext(bookKeeping, child, childKey) {\n  var result = bookKeeping.result,\n      keyPrefix = bookKeeping.keyPrefix,\n      func = bookKeeping.func,\n      context = bookKeeping.context;\n\n\n  var mappedChild = func.call(context, child, bookKeeping.count++);\n  if (Array.isArray(mappedChild)) {\n    mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction_1.thatReturnsArgument);\n  } else if (mappedChild != null) {\n    if (isValidElement(mappedChild)) {\n      mappedChild = cloneAndReplaceKey(mappedChild,\n      // Keep both the (mapped) and old keys if they differ, just as\n      // traverseAllChildren used to do for objects as children\n      keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);\n    }\n    result.push(mappedChild);\n  }\n}\n\nfunction mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {\n  var escapedPrefix = '';\n  if (prefix != null) {\n    escapedPrefix = escapeUserProvidedKey(prefix) + '/';\n  }\n  var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);\n  traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n  releaseTraverseContext(traverseContext);\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#react.children.map\n *\n * The provided mapFunction(child, key, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n  if (children == null) {\n    return children;\n  }\n  var result = [];\n  mapIntoWithKeyPrefixInternal(children, result, null, func, context);\n  return result;\n}\n\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#react.children.count\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\nfunction countChildren(children, context) {\n  return traverseAllChildren(children, emptyFunction_1.thatReturnsNull, null);\n}\n\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#react.children.toarray\n */\nfunction toArray(children) {\n  var result = [];\n  mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction_1.thatReturnsArgument);\n  return result;\n}\n\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#react.children.only\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\nfunction onlyChild(children) {\n  !isValidElement(children) ? invariant_1(false, 'React.Children.only expected to receive a single React element child.') : void 0;\n  return children;\n}\n\nvar describeComponentFrame = function (name, source, ownerName) {\n  return '\\n    in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');\n};\n\nfunction getComponentName(fiber) {\n  var type = fiber.type;\n\n  if (typeof type === 'string') {\n    return type;\n  }\n  if (typeof type === 'function') {\n    return type.displayName || type.name;\n  }\n  return null;\n}\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nvar ReactPropTypesSecret_1 = ReactPropTypesSecret$1;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n{\n  var invariant$2 = invariant_1;\n  var warning$2 = warning_1;\n  var ReactPropTypesSecret = ReactPropTypesSecret_1;\n  var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n  {\n    for (var typeSpecName in typeSpecs) {\n      if (typeSpecs.hasOwnProperty(typeSpecName)) {\n        var error;\n        // Prop type validation may throw. In case they do, we don't want to\n        // fail the render phase where it didn't fail before. So we log it.\n        // After these have been cleaned up, we'll let them throw.\n        try {\n          // This is intentionally an invariant that gets caught. It's the same\n          // behavior as without this statement except with a better message.\n          invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n        } catch (ex) {\n          error = ex;\n        }\n        warning$2(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n        if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n          // Only monitor this failure once because there tends to be a lot of the\n          // same error.\n          loggedTypeFailures[error.message] = true;\n\n          var stack = getStack ? getStack() : '';\n\n          warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n        }\n      }\n    }\n  }\n}\n\nvar checkPropTypes_1 = checkPropTypes;\n\n/**\n * ReactElementValidator provides a wrapper around a element factory\n * which validates the props passed to the element. This is intended to be\n * used only in DEV and could be replaced by a static type checker for languages\n * that support it.\n */\n\n{\n  var currentlyValidatingElement = null;\n\n  var propTypesMisspellWarningShown = false;\n\n  var getDisplayName = function (element) {\n    if (element == null) {\n      return '#empty';\n    } else if (typeof element === 'string' || typeof element === 'number') {\n      return '#text';\n    } else if (typeof element.type === 'string') {\n      return element.type;\n    } else if (element.type === REACT_FRAGMENT_TYPE) {\n      return 'React.Fragment';\n    } else {\n      return element.type.displayName || element.type.name || 'Unknown';\n    }\n  };\n\n  var getStackAddendum = function () {\n    var stack = '';\n    if (currentlyValidatingElement) {\n      var name = getDisplayName(currentlyValidatingElement);\n      var owner = currentlyValidatingElement._owner;\n      stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));\n    }\n    stack += ReactDebugCurrentFrame.getStackAddendum() || '';\n    return stack;\n  };\n\n  var VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);\n}\n\nfunction getDeclarationErrorAddendum() {\n  if (ReactCurrentOwner.current) {\n    var name = getComponentName(ReactCurrentOwner.current);\n    if (name) {\n      return '\\n\\nCheck the render method of `' + name + '`.';\n    }\n  }\n  return '';\n}\n\nfunction getSourceInfoErrorAddendum(elementProps) {\n  if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {\n    var source = elementProps.__source;\n    var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n    var lineNumber = source.lineNumber;\n    return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n  }\n  return '';\n}\n\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n  var info = getDeclarationErrorAddendum();\n\n  if (!info) {\n    var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n    if (parentName) {\n      info = '\\n\\nCheck the top-level render call using <' + parentName + '>.';\n    }\n  }\n  return info;\n}\n\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\nfunction validateExplicitKey(element, parentType) {\n  if (!element._store || element._store.validated || element.key != null) {\n    return;\n  }\n  element._store.validated = true;\n\n  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n  if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n    return;\n  }\n  ownerHasKeyUseWarning[currentComponentErrorInfo] = true;\n\n  // Usually the current owner is the offender, but if it accepts children as a\n  // property, it may be the creator of the child that's responsible for\n  // assigning it a key.\n  var childOwner = '';\n  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n    // Give the component that originally created this child.\n    childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';\n  }\n\n  currentlyValidatingElement = element;\n  {\n    warning_1(false, 'Each child in an array or iterator should have a unique \"key\" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum());\n  }\n  currentlyValidatingElement = null;\n}\n\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\nfunction validateChildKeys(node, parentType) {\n  if (typeof node !== 'object') {\n    return;\n  }\n  if (Array.isArray(node)) {\n    for (var i = 0; i < node.length; i++) {\n      var child = node[i];\n      if (isValidElement(child)) {\n        validateExplicitKey(child, parentType);\n      }\n    }\n  } else if (isValidElement(node)) {\n    // This element was passed in a valid location.\n    if (node._store) {\n      node._store.validated = true;\n    }\n  } else if (node) {\n    var iteratorFn = getIteratorFn(node);\n    if (typeof iteratorFn === 'function') {\n      // Entry iterators used to provide implicit keys,\n      // but now we print a separate warning for them later.\n      if (iteratorFn !== node.entries) {\n        var iterator = iteratorFn.call(node);\n        var step;\n        while (!(step = iterator.next()).done) {\n          if (isValidElement(step.value)) {\n            validateExplicitKey(step.value, parentType);\n          }\n        }\n      }\n    }\n  }\n}\n\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\nfunction validatePropTypes(element) {\n  var componentClass = element.type;\n  if (typeof componentClass !== 'function') {\n    return;\n  }\n  var name = componentClass.displayName || componentClass.name;\n  var propTypes = componentClass.propTypes;\n  if (propTypes) {\n    currentlyValidatingElement = element;\n    checkPropTypes_1(propTypes, element.props, 'prop', name, getStackAddendum);\n    currentlyValidatingElement = null;\n  } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n    propTypesMisspellWarningShown = true;\n    warning_1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');\n  }\n  if (typeof componentClass.getDefaultProps === 'function') {\n    warning_1(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n  }\n}\n\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\nfunction validateFragmentProps(fragment) {\n  currentlyValidatingElement = fragment;\n\n  var _iteratorNormalCompletion = true;\n  var _didIteratorError = false;\n  var _iteratorError = undefined;\n\n  try {\n    for (var _iterator = Object.keys(fragment.props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n      var key = _step.value;\n\n      if (!VALID_FRAGMENT_PROPS.has(key)) {\n        warning_1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());\n        break;\n      }\n    }\n  } catch (err) {\n    _didIteratorError = true;\n    _iteratorError = err;\n  } finally {\n    try {\n      if (!_iteratorNormalCompletion && _iterator['return']) {\n        _iterator['return']();\n      }\n    } finally {\n      if (_didIteratorError) {\n        throw _iteratorError;\n      }\n    }\n  }\n\n  if (fragment.ref !== null) {\n    warning_1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());\n  }\n\n  currentlyValidatingElement = null;\n}\n\nfunction createElementWithValidation(type, props, children) {\n  var validType = typeof type === 'string' || typeof type === 'function' || typeof type === 'symbol' || typeof type === 'number';\n  // We warn in this case but don't throw. We expect the element creation to\n  // succeed and there will likely be errors in render.\n  if (!validType) {\n    var info = '';\n    if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n      info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n    }\n\n    var sourceInfo = getSourceInfoErrorAddendum(props);\n    if (sourceInfo) {\n      info += sourceInfo;\n    } else {\n      info += getDeclarationErrorAddendum();\n    }\n\n    info += getStackAddendum() || '';\n\n    warning_1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);\n  }\n\n  var element = createElement.apply(this, arguments);\n\n  // The result can be nullish if a mock or a custom function is used.\n  // TODO: Drop this when these are no longer allowed as the type argument.\n  if (element == null) {\n    return element;\n  }\n\n  // Skip key warning if the type isn't valid since our key validation logic\n  // doesn't expect a non-string/function type and can throw confusing errors.\n  // We don't want exception behavior to differ between dev and prod.\n  // (Rendering will throw with a helpful message and as soon as the type is\n  // fixed, the key warnings will appear.)\n  if (validType) {\n    for (var i = 2; i < arguments.length; i++) {\n      validateChildKeys(arguments[i], type);\n    }\n  }\n\n  if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE) {\n    validateFragmentProps(element);\n  } else {\n    validatePropTypes(element);\n  }\n\n  return element;\n}\n\nfunction createFactoryWithValidation(type) {\n  var validatedFactory = createElementWithValidation.bind(null, type);\n  // Legacy hook TODO: Warn if this is accessed\n  validatedFactory.type = type;\n\n  {\n    Object.defineProperty(validatedFactory, 'type', {\n      enumerable: false,\n      get: function () {\n        lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n        Object.defineProperty(this, 'type', {\n          value: type\n        });\n        return type;\n      }\n    });\n  }\n\n  return validatedFactory;\n}\n\nfunction cloneElementWithValidation(element, props, children) {\n  var newElement = cloneElement.apply(this, arguments);\n  for (var i = 2; i < arguments.length; i++) {\n    validateChildKeys(arguments[i], newElement.type);\n  }\n  validatePropTypes(newElement);\n  return newElement;\n}\n\nvar React = {\n  Children: {\n    map: mapChildren,\n    forEach: forEachChildren,\n    count: countChildren,\n    toArray: toArray,\n    only: onlyChild\n  },\n\n  Component: Component,\n  PureComponent: PureComponent,\n  unstable_AsyncComponent: AsyncComponent,\n\n  Fragment: REACT_FRAGMENT_TYPE,\n\n  createElement: createElementWithValidation,\n  cloneElement: cloneElementWithValidation,\n  createFactory: createFactoryWithValidation,\n  isValidElement: isValidElement,\n\n  version: ReactVersion,\n\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {\n    ReactCurrentOwner: ReactCurrentOwner,\n    // Used by renderers to avoid bundling object-assign twice in UMD bundles:\n    assign: objectAssign\n  }\n};\n\n{\n  objectAssign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {\n    // These should not be included in production.\n    ReactDebugCurrentFrame: ReactDebugCurrentFrame,\n    // Shim for React DOM 16.0.0 which still destructured (but not used) this.\n    // TODO: remove in React 17.0.\n    ReactComponentTreeHook: {}\n  });\n}\n\n\n\nvar React$2 = Object.freeze({\n\tdefault: React\n});\n\nvar React$3 = ( React$2 && React ) || React$2;\n\n// TODO: decide on the top-level export form.\n// This is hacky but makes it work with both Rollup and Jest.\nvar react = React$3['default'] ? React$3['default'] : React$3;\n\nreturn react;\n\n})));\n"
  },
  {
    "path": "react/react-dom-16.2.js",
    "content": "/** @license React v16.2.0\n * react-dom.development.js\n *\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :\n\ttypeof define === 'function' && define.amd ? define(['react'], factory) :\n\t(global.ReactDOM = factory(global.React));\n}(this, (function (React) { 'use strict';\n\n/**\n * WARNING: DO NOT manually require this module.\n * This is a replacement for `invariant(...)` used by the error code system\n * and will _only_ be required by the corresponding babel pass.\n * It always throws.\n */\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\n{\n  validateFormat = function validateFormat(format) {\n    if (format === undefined) {\n      throw new Error('invariant requires an error message argument');\n    }\n  };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n  validateFormat(format);\n\n  if (!condition) {\n    var error;\n    if (format === undefined) {\n      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n    } else {\n      var args = [a, b, c, d, e, f];\n      var argIndex = 0;\n      error = new Error(format.replace(/%s/g, function () {\n        return args[argIndex++];\n      }));\n      error.name = 'Invariant Violation';\n    }\n\n    error.framesToPop = 1; // we don't care about invariant's own frame\n    throw error;\n  }\n}\n\nvar invariant_1 = invariant;\n\n!React ? invariant_1(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;\n\n// These attributes should be all lowercase to allow for\n// case insensitive checks\nvar RESERVED_PROPS = {\n  children: true,\n  dangerouslySetInnerHTML: true,\n  defaultValue: true,\n  defaultChecked: true,\n  innerHTML: true,\n  suppressContentEditableWarning: true,\n  suppressHydrationWarning: true,\n  style: true\n};\n\nfunction checkMask(value, bitmask) {\n  return (value & bitmask) === bitmask;\n}\n\nvar DOMPropertyInjection = {\n  /**\n   * Mapping from normalized, camelcased property names to a configuration that\n   * specifies how the associated DOM property should be accessed or rendered.\n   */\n  MUST_USE_PROPERTY: 0x1,\n  HAS_BOOLEAN_VALUE: 0x4,\n  HAS_NUMERIC_VALUE: 0x8,\n  HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,\n  HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,\n  HAS_STRING_BOOLEAN_VALUE: 0x40,\n\n  /**\n   * Inject some specialized knowledge about the DOM. This takes a config object\n   * with the following properties:\n   *\n   * Properties: object mapping DOM property name to one of the\n   * DOMPropertyInjection constants or null. If your attribute isn't in here,\n   * it won't get written to the DOM.\n   *\n   * DOMAttributeNames: object mapping React attribute name to the DOM\n   * attribute name. Attribute names not specified use the **lowercase**\n   * normalized name.\n   *\n   * DOMAttributeNamespaces: object mapping React attribute name to the DOM\n   * attribute namespace URL. (Attribute names not specified use no namespace.)\n   *\n   * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.\n   * Property names not specified use the normalized name.\n   *\n   * DOMMutationMethods: Properties that require special mutation methods. If\n   * `value` is undefined, the mutation method should unset the property.\n   *\n   * @param {object} domPropertyConfig the config as described above.\n   */\n  injectDOMPropertyConfig: function (domPropertyConfig) {\n    var Injection = DOMPropertyInjection;\n    var Properties = domPropertyConfig.Properties || {};\n    var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};\n    var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};\n    var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};\n\n    for (var propName in Properties) {\n      !!properties.hasOwnProperty(propName) ? invariant_1(false, \"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.\", propName) : void 0;\n\n      var lowerCased = propName.toLowerCase();\n      var propConfig = Properties[propName];\n\n      var propertyInfo = {\n        attributeName: lowerCased,\n        attributeNamespace: null,\n        propertyName: propName,\n        mutationMethod: null,\n\n        mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),\n        hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),\n        hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),\n        hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),\n        hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE),\n        hasStringBooleanValue: checkMask(propConfig, Injection.HAS_STRING_BOOLEAN_VALUE)\n      };\n      !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant_1(false, \"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s\", propName) : void 0;\n\n      if (DOMAttributeNames.hasOwnProperty(propName)) {\n        var attributeName = DOMAttributeNames[propName];\n\n        propertyInfo.attributeName = attributeName;\n      }\n\n      if (DOMAttributeNamespaces.hasOwnProperty(propName)) {\n        propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];\n      }\n\n      if (DOMMutationMethods.hasOwnProperty(propName)) {\n        propertyInfo.mutationMethod = DOMMutationMethods[propName];\n      }\n\n      // Downcase references to whitelist properties to check for membership\n      // without case-sensitivity. This allows the whitelist to pick up\n      // `allowfullscreen`, which should be written using the property configuration\n      // for `allowFullscreen`\n      properties[propName] = propertyInfo;\n    }\n  }\n};\n\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n/* eslint-enable max-len */\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n\n\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\n\n/**\n * Map from property \"standard name\" to an object with info about how to set\n * the property in the DOM. Each object contains:\n *\n * attributeName:\n *   Used when rendering markup or with `*Attribute()`.\n * attributeNamespace\n * propertyName:\n *   Used on DOM node instances. (This includes properties that mutate due to\n *   external factors.)\n * mutationMethod:\n *   If non-null, used instead of the property or `setAttribute()` after\n *   initial render.\n * mustUseProperty:\n *   Whether the property must be accessed and mutated as an object property.\n * hasBooleanValue:\n *   Whether the property should be removed when set to a falsey value.\n * hasNumericValue:\n *   Whether the property must be numeric or parse as a numeric and should be\n *   removed when set to a falsey value.\n * hasPositiveNumericValue:\n *   Whether the property must be positive numeric or parse as a positive\n *   numeric and should be removed when set to a falsey value.\n * hasOverloadedBooleanValue:\n *   Whether the property can be used as a flag as well as with a value.\n *   Removed when strictly equal to false; present without a value when\n *   strictly equal to true; present with a value otherwise.\n */\nvar properties = {};\n\n/**\n * Checks whether a property name is a writeable attribute.\n * @method\n */\nfunction shouldSetAttribute(name, value) {\n  if (isReservedProp(name)) {\n    return false;\n  }\n  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n    return false;\n  }\n  if (value === null) {\n    return true;\n  }\n  switch (typeof value) {\n    case 'boolean':\n      return shouldAttributeAcceptBooleanValue(name);\n    case 'undefined':\n    case 'number':\n    case 'string':\n    case 'object':\n      return true;\n    default:\n      // function, symbol\n      return false;\n  }\n}\n\nfunction getPropertyInfo(name) {\n  return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction shouldAttributeAcceptBooleanValue(name) {\n  if (isReservedProp(name)) {\n    return true;\n  }\n  var propertyInfo = getPropertyInfo(name);\n  if (propertyInfo) {\n    return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue;\n  }\n  var prefix = name.toLowerCase().slice(0, 5);\n  return prefix === 'data-' || prefix === 'aria-';\n}\n\n/**\n * Checks to see if a property name is within the list of properties\n * reserved for internal React operations. These properties should\n * not be set on an HTML element.\n *\n * @private\n * @param {string} name\n * @return {boolean} If the name is within reserved props\n */\nfunction isReservedProp(name) {\n  return RESERVED_PROPS.hasOwnProperty(name);\n}\n\nvar injection = DOMPropertyInjection;\n\nvar MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY;\nvar HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE;\nvar HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE;\nvar HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE;\nvar HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE;\nvar HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE;\n\nvar HTMLDOMPropertyConfig = {\n  // When adding attributes to this list, be sure to also add them to\n  // the `possibleStandardNames` module to ensure casing and incorrect\n  // name warnings.\n  Properties: {\n    allowFullScreen: HAS_BOOLEAN_VALUE,\n    // specifies target context for links with `preload` type\n    async: HAS_BOOLEAN_VALUE,\n    // Note: there is a special case that prevents it from being written to the DOM\n    // on the client side because the browsers are inconsistent. Instead we call focus().\n    autoFocus: HAS_BOOLEAN_VALUE,\n    autoPlay: HAS_BOOLEAN_VALUE,\n    capture: HAS_OVERLOADED_BOOLEAN_VALUE,\n    checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    cols: HAS_POSITIVE_NUMERIC_VALUE,\n    contentEditable: HAS_STRING_BOOLEAN_VALUE,\n    controls: HAS_BOOLEAN_VALUE,\n    'default': HAS_BOOLEAN_VALUE,\n    defer: HAS_BOOLEAN_VALUE,\n    disabled: HAS_BOOLEAN_VALUE,\n    download: HAS_OVERLOADED_BOOLEAN_VALUE,\n    draggable: HAS_STRING_BOOLEAN_VALUE,\n    formNoValidate: HAS_BOOLEAN_VALUE,\n    hidden: HAS_BOOLEAN_VALUE,\n    loop: HAS_BOOLEAN_VALUE,\n    // Caution; `option.selected` is not updated if `select.multiple` is\n    // disabled with `removeAttribute`.\n    multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    noValidate: HAS_BOOLEAN_VALUE,\n    open: HAS_BOOLEAN_VALUE,\n    playsInline: HAS_BOOLEAN_VALUE,\n    readOnly: HAS_BOOLEAN_VALUE,\n    required: HAS_BOOLEAN_VALUE,\n    reversed: HAS_BOOLEAN_VALUE,\n    rows: HAS_POSITIVE_NUMERIC_VALUE,\n    rowSpan: HAS_NUMERIC_VALUE,\n    scoped: HAS_BOOLEAN_VALUE,\n    seamless: HAS_BOOLEAN_VALUE,\n    selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    size: HAS_POSITIVE_NUMERIC_VALUE,\n    start: HAS_NUMERIC_VALUE,\n    // support for projecting regular DOM Elements via V1 named slots ( shadow dom )\n    span: HAS_POSITIVE_NUMERIC_VALUE,\n    spellCheck: HAS_STRING_BOOLEAN_VALUE,\n    // Style must be explicitly set in the attribute list. React components\n    // expect a style object\n    style: 0,\n    // Keep it in the whitelist because it is case-sensitive for SVG.\n    tabIndex: 0,\n    // itemScope is for for Microdata support.\n    // See http://schema.org/docs/gs.html\n    itemScope: HAS_BOOLEAN_VALUE,\n    // These attributes must stay in the white-list because they have\n    // different attribute names (see DOMAttributeNames below)\n    acceptCharset: 0,\n    className: 0,\n    htmlFor: 0,\n    httpEquiv: 0,\n    // Attributes with mutation methods must be specified in the whitelist\n    // Set the string boolean flag to allow the behavior\n    value: HAS_STRING_BOOLEAN_VALUE\n  },\n  DOMAttributeNames: {\n    acceptCharset: 'accept-charset',\n    className: 'class',\n    htmlFor: 'for',\n    httpEquiv: 'http-equiv'\n  },\n  DOMMutationMethods: {\n    value: function (node, value) {\n      if (value == null) {\n        return node.removeAttribute('value');\n      }\n\n      // Number inputs get special treatment due to some edge cases in\n      // Chrome. Let everything else assign the value attribute as normal.\n      // https://github.com/facebook/react/issues/7253#issuecomment-236074326\n      if (node.type !== 'number' || node.hasAttribute('value') === false) {\n        node.setAttribute('value', '' + value);\n      } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {\n        // Don't assign an attribute if validation reports bad\n        // input. Chrome will clear the value. Additionally, don't\n        // operate on inputs that have focus, otherwise Chrome might\n        // strip off trailing decimal places and cause the user's\n        // cursor position to jump to the beginning of the input.\n        //\n        // In ReactDOMInput, we have an onBlur event that will trigger\n        // this function again when focus is lost.\n        node.setAttribute('value', '' + value);\n      }\n    }\n  }\n};\n\nvar HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE;\n\n\nvar NS = {\n  xlink: 'http://www.w3.org/1999/xlink',\n  xml: 'http://www.w3.org/XML/1998/namespace'\n};\n\n/**\n * This is a list of all SVG attributes that need special casing,\n * namespacing, or boolean value assignment.\n *\n * When adding attributes to this list, be sure to also add them to\n * the `possibleStandardNames` module to ensure casing and incorrect\n * name warnings.\n *\n * SVG Attributes List:\n * https://www.w3.org/TR/SVG/attindex.html\n * SMIL Spec:\n * https://www.w3.org/TR/smil\n */\nvar ATTRS = ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space'];\n\nvar SVGDOMPropertyConfig = {\n  Properties: {\n    autoReverse: HAS_STRING_BOOLEAN_VALUE$1,\n    externalResourcesRequired: HAS_STRING_BOOLEAN_VALUE$1,\n    preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1\n  },\n  DOMAttributeNames: {\n    autoReverse: 'autoReverse',\n    externalResourcesRequired: 'externalResourcesRequired',\n    preserveAlpha: 'preserveAlpha'\n  },\n  DOMAttributeNamespaces: {\n    xlinkActuate: NS.xlink,\n    xlinkArcrole: NS.xlink,\n    xlinkHref: NS.xlink,\n    xlinkRole: NS.xlink,\n    xlinkShow: NS.xlink,\n    xlinkTitle: NS.xlink,\n    xlinkType: NS.xlink,\n    xmlBase: NS.xml,\n    xmlLang: NS.xml,\n    xmlSpace: NS.xml\n  }\n};\n\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\nvar capitalize = function (token) {\n  return token[1].toUpperCase();\n};\n\nATTRS.forEach(function (original) {\n  var reactName = original.replace(CAMELIZE, capitalize);\n\n  SVGDOMPropertyConfig.Properties[reactName] = 0;\n  SVGDOMPropertyConfig.DOMAttributeNames[reactName] = original;\n});\n\ninjection.injectDOMPropertyConfig(HTMLDOMPropertyConfig);\ninjection.injectDOMPropertyConfig(SVGDOMPropertyConfig);\n\nvar ReactErrorUtils = {\n  // Used by Fiber to simulate a try-catch.\n  _caughtError: null,\n  _hasCaughtError: false,\n\n  // Used by event system to capture/rethrow the first error.\n  _rethrowError: null,\n  _hasRethrowError: false,\n\n  injection: {\n    injectErrorUtils: function (injectedErrorUtils) {\n      !(typeof injectedErrorUtils.invokeGuardedCallback === 'function') ? invariant_1(false, 'Injected invokeGuardedCallback() must be a function.') : void 0;\n      invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;\n    }\n  },\n\n  /**\n   * Call a function while guarding against errors that happens within it.\n   * Returns an error if it throws, otherwise null.\n   *\n   * In production, this is implemented using a try-catch. The reason we don't\n   * use a try-catch directly is so that we can swap out a different\n   * implementation in DEV mode.\n   *\n   * @param {String} name of the guard to use for logging or debugging\n   * @param {Function} func The function to invoke\n   * @param {*} context The context to use when calling the function\n   * @param {...*} args Arguments for function\n   */\n  invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) {\n    invokeGuardedCallback.apply(ReactErrorUtils, arguments);\n  },\n\n  /**\n   * Same as invokeGuardedCallback, but instead of returning an error, it stores\n   * it in a global so it can be rethrown by `rethrowCaughtError` later.\n   * TODO: See if _caughtError and _rethrowError can be unified.\n   *\n   * @param {String} name of the guard to use for logging or debugging\n   * @param {Function} func The function to invoke\n   * @param {*} context The context to use when calling the function\n   * @param {...*} args Arguments for function\n   */\n  invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) {\n    ReactErrorUtils.invokeGuardedCallback.apply(this, arguments);\n    if (ReactErrorUtils.hasCaughtError()) {\n      var error = ReactErrorUtils.clearCaughtError();\n      if (!ReactErrorUtils._hasRethrowError) {\n        ReactErrorUtils._hasRethrowError = true;\n        ReactErrorUtils._rethrowError = error;\n      }\n    }\n  },\n\n  /**\n   * During execution of guarded functions we will capture the first error which\n   * we will rethrow to be handled by the top level error handler.\n   */\n  rethrowCaughtError: function () {\n    return rethrowCaughtError.apply(ReactErrorUtils, arguments);\n  },\n\n  hasCaughtError: function () {\n    return ReactErrorUtils._hasCaughtError;\n  },\n\n  clearCaughtError: function () {\n    if (ReactErrorUtils._hasCaughtError) {\n      var error = ReactErrorUtils._caughtError;\n      ReactErrorUtils._caughtError = null;\n      ReactErrorUtils._hasCaughtError = false;\n      return error;\n    } else {\n      invariant_1(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');\n    }\n  }\n};\n\nvar invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) {\n  ReactErrorUtils._hasCaughtError = false;\n  ReactErrorUtils._caughtError = null;\n  var funcArgs = Array.prototype.slice.call(arguments, 3);\n  try {\n    func.apply(context, funcArgs);\n  } catch (error) {\n    ReactErrorUtils._caughtError = error;\n    ReactErrorUtils._hasCaughtError = true;\n  }\n};\n\n{\n  // In DEV mode, we swap out invokeGuardedCallback for a special version\n  // that plays more nicely with the browser's DevTools. The idea is to preserve\n  // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n  // functions in invokeGuardedCallback, and the production version of\n  // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n  // like caught exceptions, and the DevTools won't pause unless the developer\n  // takes the extra step of enabling pause on caught exceptions. This is\n  // untintuitive, though, because even though React has caught the error, from\n  // the developer's perspective, the error is uncaught.\n  //\n  // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n  // DOM node, and call the user-provided callback from inside an event handler\n  // for that fake event. If the callback throws, the error is \"captured\" using\n  // a global event handler. But because the error happens in a different\n  // event loop context, it does not interrupt the normal program flow.\n  // Effectively, this gives us try-catch behavior without actually using\n  // try-catch. Neat!\n\n  // Check that the browser supports the APIs we need to implement our special\n  // DEV version of invokeGuardedCallback\n  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n    var fakeNode = document.createElement('react');\n\n    var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n      // Keeps track of whether the user-provided callback threw an error. We\n      // set this to true at the beginning, then set it to false right after\n      // calling the function. If the function errors, `didError` will never be\n      // set to false. This strategy works even if the browser is flaky and\n      // fails to call our global error handler, because it doesn't rely on\n      // the error event at all.\n      var didError = true;\n\n      // Create an event handler for our fake event. We will synchronously\n      // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n      // call the user-provided callback.\n      var funcArgs = Array.prototype.slice.call(arguments, 3);\n      function callCallback() {\n        // We immediately remove the callback from event listeners so that\n        // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n        // nested call would trigger the fake event handlers of any call higher\n        // in the stack.\n        fakeNode.removeEventListener(evtType, callCallback, false);\n        func.apply(context, funcArgs);\n        didError = false;\n      }\n\n      // Create a global error event handler. We use this to capture the value\n      // that was thrown. It's possible that this error handler will fire more\n      // than once; for example, if non-React code also calls `dispatchEvent`\n      // and a handler for that event throws. We should be resilient to most of\n      // those cases. Even if our error event handler fires more than once, the\n      // last error event is always used. If the callback actually does error,\n      // we know that the last error event is the correct one, because it's not\n      // possible for anything else to have happened in between our callback\n      // erroring and the code that follows the `dispatchEvent` call below. If\n      // the callback doesn't error, but the error event was fired, we know to\n      // ignore it because `didError` will be false, as described above.\n      var error = void 0;\n      // Use this to track whether the error event is ever called.\n      var didSetError = false;\n      var isCrossOriginError = false;\n\n      function onError(event) {\n        error = event.error;\n        didSetError = true;\n        if (error === null && event.colno === 0 && event.lineno === 0) {\n          isCrossOriginError = true;\n        }\n      }\n\n      // Create a fake event type.\n      var evtType = 'react-' + (name ? name : 'invokeguardedcallback');\n\n      // Attach our event handlers\n      window.addEventListener('error', onError);\n      fakeNode.addEventListener(evtType, callCallback, false);\n\n      // Synchronously dispatch our fake event. If the user-provided function\n      // errors, it will trigger our global error handler.\n      var evt = document.createEvent('Event');\n      evt.initEvent(evtType, false, false);\n      fakeNode.dispatchEvent(evt);\n\n      if (didError) {\n        if (!didSetError) {\n          // The callback errored, but the error event never fired.\n          error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n        } else if (isCrossOriginError) {\n          error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n        }\n        ReactErrorUtils._hasCaughtError = true;\n        ReactErrorUtils._caughtError = error;\n      } else {\n        ReactErrorUtils._hasCaughtError = false;\n        ReactErrorUtils._caughtError = null;\n      }\n\n      // Remove our event listeners\n      window.removeEventListener('error', onError);\n    };\n\n    invokeGuardedCallback = invokeGuardedCallbackDev;\n  }\n}\n\nvar rethrowCaughtError = function () {\n  if (ReactErrorUtils._hasRethrowError) {\n    var error = ReactErrorUtils._rethrowError;\n    ReactErrorUtils._rethrowError = null;\n    ReactErrorUtils._hasRethrowError = false;\n    throw error;\n  }\n};\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n\n/**\n * Injectable mapping from names to event plugin modules.\n */\nvar namesToPlugins = {};\n\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\nfunction recomputePluginOrdering() {\n  if (!eventPluginOrder) {\n    // Wait until an `eventPluginOrder` is injected.\n    return;\n  }\n  for (var pluginName in namesToPlugins) {\n    var pluginModule = namesToPlugins[pluginName];\n    var pluginIndex = eventPluginOrder.indexOf(pluginName);\n    !(pluginIndex > -1) ? invariant_1(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n    if (plugins[pluginIndex]) {\n      continue;\n    }\n    !pluginModule.extractEvents ? invariant_1(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n    plugins[pluginIndex] = pluginModule;\n    var publishedEvents = pluginModule.eventTypes;\n    for (var eventName in publishedEvents) {\n      !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant_1(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n    }\n  }\n}\n\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n  !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant_1(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;\n  eventNameDispatchConfigs[eventName] = dispatchConfig;\n\n  var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n  if (phasedRegistrationNames) {\n    for (var phaseName in phasedRegistrationNames) {\n      if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n        var phasedRegistrationName = phasedRegistrationNames[phaseName];\n        publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n      }\n    }\n    return true;\n  } else if (dispatchConfig.registrationName) {\n    publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n    return true;\n  }\n  return false;\n}\n\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n  !!registrationNameModules[registrationName] ? invariant_1(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;\n  registrationNameModules[registrationName] = pluginModule;\n  registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n\n  {\n    var lowerCasedName = registrationName.toLowerCase();\n    possibleRegistrationNames[lowerCasedName] = registrationName;\n\n    if (registrationName === 'onDoubleClick') {\n      possibleRegistrationNames.ondblclick = registrationName;\n    }\n  }\n}\n\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\n\n/**\n * Ordered list of injected plugins.\n */\nvar plugins = [];\n\n/**\n * Mapping from event name to dispatch config\n */\nvar eventNameDispatchConfigs = {};\n\n/**\n * Mapping from registration name to plugin module\n */\nvar registrationNameModules = {};\n\n/**\n * Mapping from registration name to event name\n */\nvar registrationNameDependencies = {};\n\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\nvar possibleRegistrationNames = {};\n// Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginOrder}\n */\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n  !!eventPluginOrder ? invariant_1(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;\n  // Clone the ordering so it cannot be dynamically mutated.\n  eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n  recomputePluginOrdering();\n}\n\n/**\n * Injects plugins to be used by `EventPluginHub`. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginsByName}\n */\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n  var isOrderingDirty = false;\n  for (var pluginName in injectedNamesToPlugins) {\n    if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n      continue;\n    }\n    var pluginModule = injectedNamesToPlugins[pluginName];\n    if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n      !!namesToPlugins[pluginName] ? invariant_1(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;\n      namesToPlugins[pluginName] = pluginModule;\n      isOrderingDirty = true;\n    }\n  }\n  if (isOrderingDirty) {\n    recomputePluginOrdering();\n  }\n}\n\nvar EventPluginRegistry = Object.freeze({\n\tplugins: plugins,\n\teventNameDispatchConfigs: eventNameDispatchConfigs,\n\tregistrationNameModules: registrationNameModules,\n\tregistrationNameDependencies: registrationNameDependencies,\n\tpossibleRegistrationNames: possibleRegistrationNames,\n\tinjectEventPluginOrder: injectEventPluginOrder,\n\tinjectEventPluginsByName: injectEventPluginsByName\n});\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n  return function () {\n    return arg;\n  };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n  return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n  return arg;\n};\n\nvar emptyFunction_1 = emptyFunction;\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction_1;\n\n{\n  var printWarning = function printWarning(format) {\n    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    var argIndex = 0;\n    var message = 'Warning: ' + format.replace(/%s/g, function () {\n      return args[argIndex++];\n    });\n    if (typeof console !== 'undefined') {\n      console.error(message);\n    }\n    try {\n      // --- Welcome to debugging React ---\n      // This error was thrown as a convenience so that you can use this stack\n      // to find the callsite that caused this warning to fire.\n      throw new Error(message);\n    } catch (x) {}\n  };\n\n  warning = function warning(condition, format) {\n    if (format === undefined) {\n      throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n    }\n\n    if (format.indexOf('Failed Composite propType: ') === 0) {\n      return; // Ignore CompositeComponent proptype check.\n    }\n\n    if (!condition) {\n      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n        args[_key2 - 2] = arguments[_key2];\n      }\n\n      printWarning.apply(undefined, [format].concat(args));\n    }\n  };\n}\n\nvar warning_1 = warning;\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\n\nvar injection$2 = {\n  injectComponentTree: function (Injected) {\n    getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode;\n    getInstanceFromNode = Injected.getInstanceFromNode;\n    getNodeFromInstance = Injected.getNodeFromInstance;\n\n    {\n      warning_1(getNodeFromInstance && getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');\n    }\n  }\n};\n\n\n\n\n\n\nvar validateEventDispatches;\n{\n  validateEventDispatches = function (event) {\n    var dispatchListeners = event._dispatchListeners;\n    var dispatchInstances = event._dispatchInstances;\n\n    var listenersIsArr = Array.isArray(dispatchListeners);\n    var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n\n    var instancesIsArr = Array.isArray(dispatchInstances);\n    var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n\n    warning_1(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.');\n  };\n}\n\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\nfunction executeDispatch(event, simulated, listener, inst) {\n  var type = event.type || 'unknown-event';\n  event.currentTarget = getNodeFromInstance(inst);\n  ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n  event.currentTarget = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\nfunction executeDispatchesInOrder(event, simulated) {\n  var dispatchListeners = event._dispatchListeners;\n  var dispatchInstances = event._dispatchInstances;\n  {\n    validateEventDispatches(event);\n  }\n  if (Array.isArray(dispatchListeners)) {\n    for (var i = 0; i < dispatchListeners.length; i++) {\n      if (event.isPropagationStopped()) {\n        break;\n      }\n      // Listeners and Instances are two parallel arrays that are always in sync.\n      executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);\n    }\n  } else if (dispatchListeners) {\n    executeDispatch(event, simulated, dispatchListeners, dispatchInstances);\n  }\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n}\n\n/**\n * @see executeDispatchesInOrderStopAtTrueImpl\n */\n\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return {*} The return value of executing the single dispatch.\n */\n\n\n/**\n * @param {SyntheticEvent} event\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\n */\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n  !(next != null) ? invariant_1(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;\n\n  if (current == null) {\n    return next;\n  }\n\n  // Both are not empty. Warning: Never call x.concat(y) when you are not\n  // certain that x is an Array (x could be a string with concat method).\n  if (Array.isArray(current)) {\n    if (Array.isArray(next)) {\n      current.push.apply(current, next);\n      return current;\n    }\n    current.push(next);\n    return current;\n  }\n\n  if (Array.isArray(next)) {\n    // A bit too dangerous to mutate `next`.\n    return [current].concat(next);\n  }\n\n  return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n  if (Array.isArray(arr)) {\n    arr.forEach(cb, scope);\n  } else if (arr) {\n    cb.call(scope, arr);\n  }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\nvar eventQueue = null;\n\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @private\n */\nvar executeDispatchesAndRelease = function (event, simulated) {\n  if (event) {\n    executeDispatchesInOrder(event, simulated);\n\n    if (!event.isPersistent()) {\n      event.constructor.release(event);\n    }\n  }\n};\nvar executeDispatchesAndReleaseSimulated = function (e) {\n  return executeDispatchesAndRelease(e, true);\n};\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n  return executeDispatchesAndRelease(e, false);\n};\n\nfunction isInteractive(tag) {\n  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n  switch (name) {\n    case 'onClick':\n    case 'onClickCapture':\n    case 'onDoubleClick':\n    case 'onDoubleClickCapture':\n    case 'onMouseDown':\n    case 'onMouseDownCapture':\n    case 'onMouseMove':\n    case 'onMouseMoveCapture':\n    case 'onMouseUp':\n    case 'onMouseUpCapture':\n      return !!(props.disabled && isInteractive(type));\n    default:\n      return false;\n  }\n}\n\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n *   `extractEvents` {function(string, DOMEventTarget, string, object): *}\n *     Required. When a top-level event is fired, this method is expected to\n *     extract synthetic events that will in turn be queued and dispatched.\n *\n *   `eventTypes` {object}\n *     Optional, plugins that fire events must publish a mapping of registration\n *     names that are used to register listeners. Values of this mapping must\n *     be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n *   `executeDispatch` {function(object, function, string)}\n *     Optional, allows plugins to override how an event gets dispatched. By\n *     default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\n\n/**\n * Methods for injecting dependencies.\n */\nvar injection$1 = {\n  /**\n   * @param {array} InjectedEventPluginOrder\n   * @public\n   */\n  injectEventPluginOrder: injectEventPluginOrder,\n\n  /**\n   * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n   */\n  injectEventPluginsByName: injectEventPluginsByName\n};\n\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\nfunction getListener(inst, registrationName) {\n  var listener;\n\n  // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n  // live here; needs to be moved to a better place soon\n  var stateNode = inst.stateNode;\n  if (!stateNode) {\n    // Work in progress (ex: onload events in incremental mode).\n    return null;\n  }\n  var props = getFiberCurrentPropsFromNode(stateNode);\n  if (!props) {\n    // Work in progress.\n    return null;\n  }\n  listener = props[registrationName];\n  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n    return null;\n  }\n  !(!listener || typeof listener === 'function') ? invariant_1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;\n  return listener;\n}\n\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\nfunction extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var events;\n  for (var i = 0; i < plugins.length; i++) {\n    // Not every plugin in the ordering may be loaded at runtime.\n    var possiblePlugin = plugins[i];\n    if (possiblePlugin) {\n      var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n      if (extractedEvents) {\n        events = accumulateInto(events, extractedEvents);\n      }\n    }\n  }\n  return events;\n}\n\n/**\n * Enqueues a synthetic event that should be dispatched when\n * `processEventQueue` is invoked.\n *\n * @param {*} events An accumulation of synthetic events.\n * @internal\n */\nfunction enqueueEvents(events) {\n  if (events) {\n    eventQueue = accumulateInto(eventQueue, events);\n  }\n}\n\n/**\n * Dispatches all synthetic events on the event queue.\n *\n * @internal\n */\nfunction processEventQueue(simulated) {\n  // Set `eventQueue` to null before processing it so that we can tell if more\n  // events get enqueued while processing.\n  var processingEventQueue = eventQueue;\n  eventQueue = null;\n\n  if (!processingEventQueue) {\n    return;\n  }\n\n  if (simulated) {\n    forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);\n  } else {\n    forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n  }\n  !!eventQueue ? invariant_1(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;\n  // This would be a good time to rethrow if any of the event handlers threw.\n  ReactErrorUtils.rethrowCaughtError();\n}\n\nvar EventPluginHub = Object.freeze({\n\tinjection: injection$1,\n\tgetListener: getListener,\n\textractEvents: extractEvents,\n\tenqueueEvents: enqueueEvents,\n\tprocessEventQueue: processEventQueue\n});\n\nvar IndeterminateComponent = 0; // Before we know whether it is functional or class\nvar FunctionalComponent = 1;\nvar ClassComponent = 2;\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\nvar HostComponent = 5;\nvar HostText = 6;\nvar CallComponent = 7;\nvar CallHandlerPhase = 8;\nvar ReturnComponent = 9;\nvar Fragment = 10;\n\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactInternalInstance$' + randomKey;\nvar internalEventHandlersKey = '__reactEventHandlers$' + randomKey;\n\nfunction precacheFiberNode$1(hostInst, node) {\n  node[internalInstanceKey] = hostInst;\n}\n\n/**\n * Given a DOM node, return the closest ReactDOMComponent or\n * ReactDOMTextComponent instance ancestor.\n */\nfunction getClosestInstanceFromNode(node) {\n  if (node[internalInstanceKey]) {\n    return node[internalInstanceKey];\n  }\n\n  // Walk up the tree until we find an ancestor whose instance we have cached.\n  var parents = [];\n  while (!node[internalInstanceKey]) {\n    parents.push(node);\n    if (node.parentNode) {\n      node = node.parentNode;\n    } else {\n      // Top of the tree. This node must not be part of a React tree (or is\n      // unmounted, potentially).\n      return null;\n    }\n  }\n\n  var closest = void 0;\n  var inst = node[internalInstanceKey];\n  if (inst.tag === HostComponent || inst.tag === HostText) {\n    // In Fiber, this will always be the deepest root.\n    return inst;\n  }\n  for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {\n    closest = inst;\n  }\n\n  return closest;\n}\n\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\nfunction getInstanceFromNode$1(node) {\n  var inst = node[internalInstanceKey];\n  if (inst) {\n    if (inst.tag === HostComponent || inst.tag === HostText) {\n      return inst;\n    } else {\n      return null;\n    }\n  }\n  return null;\n}\n\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\nfunction getNodeFromInstance$1(inst) {\n  if (inst.tag === HostComponent || inst.tag === HostText) {\n    // In Fiber this, is just the state node right now. We assume it will be\n    // a host component or host text.\n    return inst.stateNode;\n  }\n\n  // Without this first invariant, passing a non-DOM-component triggers the next\n  // invariant for a missing parent, which is super confusing.\n  invariant_1(false, 'getNodeFromInstance: Invalid argument.');\n}\n\nfunction getFiberCurrentPropsFromNode$1(node) {\n  return node[internalEventHandlersKey] || null;\n}\n\nfunction updateFiberProps$1(node, props) {\n  node[internalEventHandlersKey] = props;\n}\n\nvar ReactDOMComponentTree = Object.freeze({\n\tprecacheFiberNode: precacheFiberNode$1,\n\tgetClosestInstanceFromNode: getClosestInstanceFromNode,\n\tgetInstanceFromNode: getInstanceFromNode$1,\n\tgetNodeFromInstance: getNodeFromInstance$1,\n\tgetFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode$1,\n\tupdateFiberProps: updateFiberProps$1\n});\n\nfunction getParent(inst) {\n  do {\n    inst = inst['return'];\n    // TODO: If this is a HostRoot we might want to bail out.\n    // That is depending on if we want nested subtrees (layers) to bubble\n    // events to their parent. We could also go through parentNode on the\n    // host node but that wouldn't work for React Native and doesn't let us\n    // do the portal feature.\n  } while (inst && inst.tag !== HostComponent);\n  if (inst) {\n    return inst;\n  }\n  return null;\n}\n\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\nfunction getLowestCommonAncestor(instA, instB) {\n  var depthA = 0;\n  for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n    depthA++;\n  }\n  var depthB = 0;\n  for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n    depthB++;\n  }\n\n  // If A is deeper, crawl up.\n  while (depthA - depthB > 0) {\n    instA = getParent(instA);\n    depthA--;\n  }\n\n  // If B is deeper, crawl up.\n  while (depthB - depthA > 0) {\n    instB = getParent(instB);\n    depthB--;\n  }\n\n  // Walk in lockstep until we find a match.\n  var depth = depthA;\n  while (depth--) {\n    if (instA === instB || instA === instB.alternate) {\n      return instA;\n    }\n    instA = getParent(instA);\n    instB = getParent(instB);\n  }\n  return null;\n}\n\n/**\n * Return if A is an ancestor of B.\n */\n\n\n/**\n * Return the parent instance of the passed-in instance.\n */\nfunction getParentInstance(inst) {\n  return getParent(inst);\n}\n\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\nfunction traverseTwoPhase(inst, fn, arg) {\n  var path = [];\n  while (inst) {\n    path.push(inst);\n    inst = getParent(inst);\n  }\n  var i;\n  for (i = path.length; i-- > 0;) {\n    fn(path[i], 'captured', arg);\n  }\n  for (i = 0; i < path.length; i++) {\n    fn(path[i], 'bubbled', arg);\n  }\n}\n\n/**\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\n * should would receive a `mouseEnter` or `mouseLeave` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \"entered\" or \"left\" that element.\n */\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\n  var common = from && to ? getLowestCommonAncestor(from, to) : null;\n  var pathFrom = [];\n  while (true) {\n    if (!from) {\n      break;\n    }\n    if (from === common) {\n      break;\n    }\n    var alternate = from.alternate;\n    if (alternate !== null && alternate === common) {\n      break;\n    }\n    pathFrom.push(from);\n    from = getParent(from);\n  }\n  var pathTo = [];\n  while (true) {\n    if (!to) {\n      break;\n    }\n    if (to === common) {\n      break;\n    }\n    var _alternate = to.alternate;\n    if (_alternate !== null && _alternate === common) {\n      break;\n    }\n    pathTo.push(to);\n    to = getParent(to);\n  }\n  for (var i = 0; i < pathFrom.length; i++) {\n    fn(pathFrom[i], 'bubbled', argFrom);\n  }\n  for (var _i = pathTo.length; _i-- > 0;) {\n    fn(pathTo[_i], 'captured', argTo);\n  }\n}\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n  var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n  return getListener(inst, registrationName);\n}\n\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \"dispatch ready event objects\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n  {\n    warning_1(inst, 'Dispatching inst must not be null');\n  }\n  var listener = listenerAtPhase(inst, event, phase);\n  if (listener) {\n    event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n    event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n  }\n}\n\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory.  We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n  }\n}\n\n/**\n * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.\n */\nfunction accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    var targetInst = event._targetInst;\n    var parentInst = targetInst ? getParentInstance(targetInst) : null;\n    traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n  }\n}\n\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n  if (inst && event && event.dispatchConfig.registrationName) {\n    var registrationName = event.dispatchConfig.registrationName;\n    var listener = getListener(inst, registrationName);\n    if (listener) {\n      event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n      event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n    }\n  }\n}\n\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\nfunction accumulateDirectDispatchesSingle(event) {\n  if (event && event.dispatchConfig.registrationName) {\n    accumulateDispatches(event._targetInst, null, event);\n  }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\n\nfunction accumulateTwoPhaseDispatchesSkipTarget(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);\n}\n\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n  traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\n\nfunction accumulateDirectDispatches(events) {\n  forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n\nvar EventPropagators = Object.freeze({\n\taccumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,\n\taccumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,\n\taccumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches,\n\taccumulateDirectDispatches: accumulateDirectDispatches\n});\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\nvar ExecutionEnvironment = {\n\n  canUseDOM: canUseDOM,\n\n  canUseWorkers: typeof Worker !== 'undefined',\n\n  canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),\n\n  canUseViewport: canUseDOM && !!window.screen,\n\n  isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\n\nvar ExecutionEnvironment_1 = ExecutionEnvironment;\n\nvar contentKey = null;\n\n/**\n * Gets the key used to access text content on a DOM node.\n *\n * @return {?string} Key used to access text content.\n * @internal\n */\nfunction getTextContentAccessor() {\n  if (!contentKey && ExecutionEnvironment_1.canUseDOM) {\n    // Prefer textContent to innerText because many browsers support both but\n    // SVG <text> elements don't support innerText even when <div> does.\n    contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';\n  }\n  return contentKey;\n}\n\n/**\n * This helper object stores information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar compositionState = {\n  _root: null,\n  _startText: null,\n  _fallbackText: null\n};\n\nfunction initialize(nativeEventTarget) {\n  compositionState._root = nativeEventTarget;\n  compositionState._startText = getText();\n  return true;\n}\n\nfunction reset() {\n  compositionState._root = null;\n  compositionState._startText = null;\n  compositionState._fallbackText = null;\n}\n\nfunction getData() {\n  if (compositionState._fallbackText) {\n    return compositionState._fallbackText;\n  }\n\n  var start;\n  var startValue = compositionState._startText;\n  var startLength = startValue.length;\n  var end;\n  var endValue = getText();\n  var endLength = endValue.length;\n\n  for (start = 0; start < startLength; start++) {\n    if (startValue[start] !== endValue[start]) {\n      break;\n    }\n  }\n\n  var minEnd = startLength - start;\n  for (end = 1; end <= minEnd; end++) {\n    if (startValue[startLength - end] !== endValue[endLength - end]) {\n      break;\n    }\n  }\n\n  var sliceTail = end > 1 ? 1 - end : undefined;\n  compositionState._fallbackText = endValue.slice(start, sliceTail);\n  return compositionState._fallbackText;\n}\n\nfunction getText() {\n  if ('value' in compositionState._root) {\n    return compositionState._root.value;\n  }\n  return compositionState._root[getTextContentAccessor()];\n}\n\nvar ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar _assign = ReactInternals.assign;\n\n/* eslint valid-typeof: 0 */\n\nvar didWarnForAddedNewProperty = false;\nvar isProxySupported = typeof Proxy === 'function';\nvar EVENT_POOL_SIZE = 10;\n\nvar shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n  type: null,\n  target: null,\n  // currentTarget is set when dispatching; no use in copying it here\n  currentTarget: emptyFunction_1.thatReturnsNull,\n  eventPhase: null,\n  bubbles: null,\n  cancelable: null,\n  timeStamp: function (event) {\n    return event.timeStamp || Date.now();\n  },\n  defaultPrevented: null,\n  isTrusted: null\n};\n\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n  {\n    // these have a getter/setter for warnings\n    delete this.nativeEvent;\n    delete this.preventDefault;\n    delete this.stopPropagation;\n  }\n\n  this.dispatchConfig = dispatchConfig;\n  this._targetInst = targetInst;\n  this.nativeEvent = nativeEvent;\n\n  var Interface = this.constructor.Interface;\n  for (var propName in Interface) {\n    if (!Interface.hasOwnProperty(propName)) {\n      continue;\n    }\n    {\n      delete this[propName]; // this has a getter/setter for warnings\n    }\n    var normalize = Interface[propName];\n    if (normalize) {\n      this[propName] = normalize(nativeEvent);\n    } else {\n      if (propName === 'target') {\n        this.target = nativeEventTarget;\n      } else {\n        this[propName] = nativeEvent[propName];\n      }\n    }\n  }\n\n  var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n  if (defaultPrevented) {\n    this.isDefaultPrevented = emptyFunction_1.thatReturnsTrue;\n  } else {\n    this.isDefaultPrevented = emptyFunction_1.thatReturnsFalse;\n  }\n  this.isPropagationStopped = emptyFunction_1.thatReturnsFalse;\n  return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n  preventDefault: function () {\n    this.defaultPrevented = true;\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n\n    if (event.preventDefault) {\n      event.preventDefault();\n    } else if (typeof event.returnValue !== 'unknown') {\n      event.returnValue = false;\n    }\n    this.isDefaultPrevented = emptyFunction_1.thatReturnsTrue;\n  },\n\n  stopPropagation: function () {\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n\n    if (event.stopPropagation) {\n      event.stopPropagation();\n    } else if (typeof event.cancelBubble !== 'unknown') {\n      // The ChangeEventPlugin registers a \"propertychange\" event for\n      // IE. This event does not support bubbling or cancelling, and\n      // any references to cancelBubble throw \"Member not found\".  A\n      // typeof check of \"unknown\" circumvents this issue (and is also\n      // IE specific).\n      event.cancelBubble = true;\n    }\n\n    this.isPropagationStopped = emptyFunction_1.thatReturnsTrue;\n  },\n\n  /**\n   * We release all dispatched `SyntheticEvent`s after each event loop, adding\n   * them back into the pool. This allows a way to hold onto a reference that\n   * won't be added back into the pool.\n   */\n  persist: function () {\n    this.isPersistent = emptyFunction_1.thatReturnsTrue;\n  },\n\n  /**\n   * Checks if this event should be released back into the pool.\n   *\n   * @return {boolean} True if this should not be released, false otherwise.\n   */\n  isPersistent: emptyFunction_1.thatReturnsFalse,\n\n  /**\n   * `PooledClass` looks for `destructor` on each instance it releases.\n   */\n  destructor: function () {\n    var Interface = this.constructor.Interface;\n    for (var propName in Interface) {\n      {\n        Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n      }\n    }\n    for (var i = 0; i < shouldBeReleasedProperties.length; i++) {\n      this[shouldBeReleasedProperties[i]] = null;\n    }\n    {\n      Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n      Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction_1));\n      Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction_1));\n    }\n  }\n});\n\nSyntheticEvent.Interface = EventInterface;\n\n/**\n * Helper to reduce boilerplate when creating subclasses.\n *\n * @param {function} Class\n * @param {?object} Interface\n */\nSyntheticEvent.augmentClass = function (Class, Interface) {\n  var Super = this;\n\n  var E = function () {};\n  E.prototype = Super.prototype;\n  var prototype = new E();\n\n  _assign(prototype, Class.prototype);\n  Class.prototype = prototype;\n  Class.prototype.constructor = Class;\n\n  Class.Interface = _assign({}, Super.Interface, Interface);\n  Class.augmentClass = Super.augmentClass;\n  addEventPoolingTo(Class);\n};\n\n/** Proxying after everything set on SyntheticEvent\n * to resolve Proxy issue on some WebKit browsers\n * in which some Event properties are set to undefined (GH#10010)\n */\n{\n  if (isProxySupported) {\n    /*eslint-disable no-func-assign */\n    SyntheticEvent = new Proxy(SyntheticEvent, {\n      construct: function (target, args) {\n        return this.apply(target, Object.create(target.prototype), args);\n      },\n      apply: function (constructor, that, args) {\n        return new Proxy(constructor.apply(that, args), {\n          set: function (target, prop, value) {\n            if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {\n              warning_1(didWarnForAddedNewProperty || target.isPersistent(), \"This synthetic event is reused for performance reasons. If you're \" + \"seeing this, you're adding a new property in the synthetic event object. \" + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.');\n              didWarnForAddedNewProperty = true;\n            }\n            target[prop] = value;\n            return true;\n          }\n        });\n      }\n    });\n    /*eslint-enable no-func-assign */\n  }\n}\n\naddEventPoolingTo(SyntheticEvent);\n\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n  var isFunction = typeof getVal === 'function';\n  return {\n    configurable: true,\n    set: set,\n    get: get\n  };\n\n  function set(val) {\n    var action = isFunction ? 'setting the method' : 'setting the property';\n    warn(action, 'This is effectively a no-op');\n    return val;\n  }\n\n  function get() {\n    var action = isFunction ? 'accessing the method' : 'accessing the property';\n    var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n    warn(action, result);\n    return getVal;\n  }\n\n  function warn(action, result) {\n    var warningCondition = false;\n    warning_1(warningCondition, \"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);\n  }\n}\n\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n  var EventConstructor = this;\n  if (EventConstructor.eventPool.length) {\n    var instance = EventConstructor.eventPool.pop();\n    EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n    return instance;\n  }\n  return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\n\nfunction releasePooledEvent(event) {\n  var EventConstructor = this;\n  !(event instanceof EventConstructor) ? invariant_1(false, 'Trying to release an event instance  into a pool of a different type.') : void 0;\n  event.destructor();\n  if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n    EventConstructor.eventPool.push(event);\n  }\n}\n\nfunction addEventPoolingTo(EventConstructor) {\n  EventConstructor.eventPool = [];\n  EventConstructor.getPooled = getPooledEvent;\n  EventConstructor.release = releasePooledEvent;\n}\n\nvar SyntheticEvent$1 = SyntheticEvent;\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\nvar CompositionEventInterface = {\n  data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n *      /#events-inputevents\n */\nvar InputEventInterface = {\n  data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticInputEvent, InputEventInterface);\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\n\nvar canUseCompositionEvent = ExecutionEnvironment_1.canUseDOM && 'CompositionEvent' in window;\n\nvar documentMode = null;\nif (ExecutionEnvironment_1.canUseDOM && 'documentMode' in document) {\n  documentMode = document.documentMode;\n}\n\n// Webkit offers a very useful `textInput` event that can be used to\n// directly represent `beforeInput`. The IE `textinput` event is not as\n// useful, so we don't use it.\nvar canUseTextInputEvent = ExecutionEnvironment_1.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();\n\n// In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\u3000) are not recorded correctly.\nvar useFallbackCompositionData = ExecutionEnvironment_1.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\n\n/**\n * Opera <= 12 includes TextEvent in window, but does not fire\n * text input events. Rely on keypress instead.\n */\nfunction isPresto() {\n  var opera = window.opera;\n  return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;\n}\n\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\n\n// Events and their corresponding property names.\nvar eventTypes = {\n  beforeInput: {\n    phasedRegistrationNames: {\n      bubbled: 'onBeforeInput',\n      captured: 'onBeforeInputCapture'\n    },\n    dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']\n  },\n  compositionEnd: {\n    phasedRegistrationNames: {\n      bubbled: 'onCompositionEnd',\n      captured: 'onCompositionEndCapture'\n    },\n    dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']\n  },\n  compositionStart: {\n    phasedRegistrationNames: {\n      bubbled: 'onCompositionStart',\n      captured: 'onCompositionStartCapture'\n    },\n    dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']\n  },\n  compositionUpdate: {\n    phasedRegistrationNames: {\n      bubbled: 'onCompositionUpdate',\n      captured: 'onCompositionUpdateCapture'\n    },\n    dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']\n  }\n};\n\n// Track whether we've ever handled a keypress on the space key.\nvar hasSpaceKeypress = false;\n\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\nfunction isKeypressCommand(nativeEvent) {\n  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n  // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n  !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\nfunction getCompositionEventType(topLevelType) {\n  switch (topLevelType) {\n    case 'topCompositionStart':\n      return eventTypes.compositionStart;\n    case 'topCompositionEnd':\n      return eventTypes.compositionEnd;\n    case 'topCompositionUpdate':\n      return eventTypes.compositionUpdate;\n  }\n}\n\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\n  return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;\n}\n\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\n  switch (topLevelType) {\n    case 'topKeyUp':\n      // Command keys insert or clear IME input.\n      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n    case 'topKeyDown':\n      // Expect IME keyCode on each keydown. If we get any other\n      // code we must have exited earlier.\n      return nativeEvent.keyCode !== START_KEYCODE;\n    case 'topKeyPress':\n    case 'topMouseDown':\n    case 'topBlur':\n      // Events are not possible without cancelling IME.\n      return true;\n    default:\n      return false;\n  }\n}\n\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\nfunction getDataFromCustomEvent(nativeEvent) {\n  var detail = nativeEvent.detail;\n  if (typeof detail === 'object' && 'data' in detail) {\n    return detail.data;\n  }\n  return null;\n}\n\n// Track the current IME composition status, if any.\nvar isComposing = false;\n\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var eventType;\n  var fallbackData;\n\n  if (canUseCompositionEvent) {\n    eventType = getCompositionEventType(topLevelType);\n  } else if (!isComposing) {\n    if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n      eventType = eventTypes.compositionStart;\n    }\n  } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n    eventType = eventTypes.compositionEnd;\n  }\n\n  if (!eventType) {\n    return null;\n  }\n\n  if (useFallbackCompositionData) {\n    // The current composition is stored statically and must not be\n    // overwritten while composition continues.\n    if (!isComposing && eventType === eventTypes.compositionStart) {\n      isComposing = initialize(nativeEventTarget);\n    } else if (eventType === eventTypes.compositionEnd) {\n      if (isComposing) {\n        fallbackData = getData();\n      }\n    }\n  }\n\n  var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\n\n  if (fallbackData) {\n    // Inject data generated from fallback path into the synthetic event.\n    // This matches the property of native CompositionEventInterface.\n    event.data = fallbackData;\n  } else {\n    var customData = getDataFromCustomEvent(nativeEvent);\n    if (customData !== null) {\n      event.data = customData;\n    }\n  }\n\n  accumulateTwoPhaseDispatches(event);\n  return event;\n}\n\n/**\n * @param {TopLevelTypes} topLevelType Record from `BrowserEventConstants`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The string corresponding to this `beforeInput` event.\n */\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\n  switch (topLevelType) {\n    case 'topCompositionEnd':\n      return getDataFromCustomEvent(nativeEvent);\n    case 'topKeyPress':\n      /**\n       * If native `textInput` events are available, our goal is to make\n       * use of them. However, there is a special case: the spacebar key.\n       * In Webkit, preventing default on a spacebar `textInput` event\n       * cancels character insertion, but it *also* causes the browser\n       * to fall back to its default spacebar behavior of scrolling the\n       * page.\n       *\n       * Tracking at:\n       * https://code.google.com/p/chromium/issues/detail?id=355103\n       *\n       * To avoid this issue, use the keypress event as if no `textInput`\n       * event is available.\n       */\n      var which = nativeEvent.which;\n      if (which !== SPACEBAR_CODE) {\n        return null;\n      }\n\n      hasSpaceKeypress = true;\n      return SPACEBAR_CHAR;\n\n    case 'topTextInput':\n      // Record the characters to be added to the DOM.\n      var chars = nativeEvent.data;\n\n      // If it's a spacebar character, assume that we have already handled\n      // it at the keypress level and bail immediately. Android Chrome\n      // doesn't give us keycodes, so we need to blacklist it.\n      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n        return null;\n      }\n\n      return chars;\n\n    default:\n      // For other native event types, do nothing.\n      return null;\n  }\n}\n\n/**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\n * @param {string} topLevelType Record from `BrowserEventConstants`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The fallback string for this `beforeInput` event.\n */\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\n  // If we are currently composing (IME) and using a fallback to do so,\n  // try to extract the composed characters from the fallback object.\n  // If composition event is available, we extract a string only at\n  // compositionevent, otherwise extract it at fallback events.\n  if (isComposing) {\n    if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n      var chars = getData();\n      reset();\n      isComposing = false;\n      return chars;\n    }\n    return null;\n  }\n\n  switch (topLevelType) {\n    case 'topPaste':\n      // If a paste event occurs after a keypress, throw out the input\n      // chars. Paste events should not lead to BeforeInput events.\n      return null;\n    case 'topKeyPress':\n      /**\n       * As of v27, Firefox may fire keypress events even when no character\n       * will be inserted. A few possibilities:\n       *\n       * - `which` is `0`. Arrow keys, Esc key, etc.\n       *\n       * - `which` is the pressed key code, but no char is available.\n       *   Ex: 'AltGr + d` in Polish. There is no modified character for\n       *   this key combination and no character is inserted into the\n       *   document, but FF fires the keypress for char code `100` anyway.\n       *   No `input` event will occur.\n       *\n       * - `which` is the pressed key code, but a command combination is\n       *   being used. Ex: `Cmd+C`. No character is inserted, and no\n       *   `input` event will occur.\n       */\n      if (!isKeypressCommand(nativeEvent)) {\n        // IE fires the `keypress` event when a user types an emoji via\n        // Touch keyboard of Windows.  In such a case, the `char` property\n        // holds an emoji character like `\\uD83D\\uDE0A`.  Because its length\n        // is 2, the property `which` does not represent an emoji correctly.\n        // In such a case, we directly return the `char` property instead of\n        // using `which`.\n        if (nativeEvent.char && nativeEvent.char.length > 1) {\n          return nativeEvent.char;\n        } else if (nativeEvent.which) {\n          return String.fromCharCode(nativeEvent.which);\n        }\n      }\n      return null;\n    case 'topCompositionEnd':\n      return useFallbackCompositionData ? null : nativeEvent.data;\n    default:\n      return null;\n  }\n}\n\n/**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\nfunction extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var chars;\n\n  if (canUseTextInputEvent) {\n    chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n  } else {\n    chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n  }\n\n  // If no characters are being inserted, no BeforeInput event should\n  // be fired.\n  if (!chars) {\n    return null;\n  }\n\n  var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\n\n  event.data = chars;\n  accumulateTwoPhaseDispatches(event);\n  return event;\n}\n\n/**\n * Create an `onBeforeInput` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n */\nvar BeforeInputEventPlugin = {\n  eventTypes: eventTypes,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];\n  }\n};\n\n// Use to restore controlled state after a change event has fired.\n\nvar fiberHostComponent = null;\n\nvar ReactControlledComponentInjection = {\n  injectFiberControlledHostComponent: function (hostComponentImpl) {\n    // The fiber implementation doesn't use dynamic dispatch so we need to\n    // inject the implementation.\n    fiberHostComponent = hostComponentImpl;\n  }\n};\n\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n  // We perform this translation at the end of the event loop so that we\n  // always receive the correct fiber here\n  var internalInstance = getInstanceFromNode(target);\n  if (!internalInstance) {\n    // Unmounted\n    return;\n  }\n  !(fiberHostComponent && typeof fiberHostComponent.restoreControlledState === 'function') ? invariant_1(false, 'Fiber needs to be injected to handle a fiber target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n  var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);\n  fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props);\n}\n\nvar injection$3 = ReactControlledComponentInjection;\n\nfunction enqueueStateRestore(target) {\n  if (restoreTarget) {\n    if (restoreQueue) {\n      restoreQueue.push(target);\n    } else {\n      restoreQueue = [target];\n    }\n  } else {\n    restoreTarget = target;\n  }\n}\n\nfunction restoreStateIfNeeded() {\n  if (!restoreTarget) {\n    return;\n  }\n  var target = restoreTarget;\n  var queuedTargets = restoreQueue;\n  restoreTarget = null;\n  restoreQueue = null;\n\n  restoreStateOfTarget(target);\n  if (queuedTargets) {\n    for (var i = 0; i < queuedTargets.length; i++) {\n      restoreStateOfTarget(queuedTargets[i]);\n    }\n  }\n}\n\nvar ReactControlledComponent = Object.freeze({\n\tinjection: injection$3,\n\tenqueueStateRestore: enqueueStateRestore,\n\trestoreStateIfNeeded: restoreStateIfNeeded\n});\n\n// Used as a way to call batchedUpdates when we don't have a reference to\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n\n// Defaults\nvar fiberBatchedUpdates = function (fn, bookkeeping) {\n  return fn(bookkeeping);\n};\n\nvar isNestingBatched = false;\nfunction batchedUpdates(fn, bookkeeping) {\n  if (isNestingBatched) {\n    // If we are currently inside another batch, we need to wait until it\n    // fully completes before restoring state. Therefore, we add the target to\n    // a queue of work.\n    return fiberBatchedUpdates(fn, bookkeeping);\n  }\n  isNestingBatched = true;\n  try {\n    return fiberBatchedUpdates(fn, bookkeeping);\n  } finally {\n    // Here we wait until all updates have propagated, which is important\n    // when using controlled components within layers:\n    // https://github.com/facebook/react/issues/1698\n    // Then we restore state of any controlled component.\n    isNestingBatched = false;\n    restoreStateIfNeeded();\n  }\n}\n\nvar ReactGenericBatchingInjection = {\n  injectFiberBatchedUpdates: function (_batchedUpdates) {\n    fiberBatchedUpdates = _batchedUpdates;\n  }\n};\n\nvar injection$4 = ReactGenericBatchingInjection;\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n  color: true,\n  date: true,\n  datetime: true,\n  'datetime-local': true,\n  email: true,\n  month: true,\n  number: true,\n  password: true,\n  range: true,\n  search: true,\n  tel: true,\n  text: true,\n  time: true,\n  url: true,\n  week: true\n};\n\nfunction isTextInputElement(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n\n  if (nodeName === 'input') {\n    return !!supportedInputTypes[elem.type];\n  }\n\n  if (nodeName === 'textarea') {\n    return true;\n  }\n\n  return false;\n}\n\n/**\n * HTML nodeType values that represent the type of the node\n */\n\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\nfunction getEventTarget(nativeEvent) {\n  var target = nativeEvent.target || nativeEvent.srcElement || window;\n\n  // Normalize SVG <use> element events #4963\n  if (target.correspondingUseElement) {\n    target = target.correspondingUseElement;\n  }\n\n  // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n  // @see http://www.quirksmode.org/js/events_properties.html\n  return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n\nvar useHasFeature;\nif (ExecutionEnvironment_1.canUseDOM) {\n  useHasFeature = document.implementation && document.implementation.hasFeature &&\n  // always returns true in newer browsers as per the standard.\n  // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature\n  document.implementation.hasFeature('', '') !== true;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @param {?boolean} capture Check if the capture phase is supported.\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nfunction isEventSupported(eventNameSuffix, capture) {\n  if (!ExecutionEnvironment_1.canUseDOM || capture && !('addEventListener' in document)) {\n    return false;\n  }\n\n  var eventName = 'on' + eventNameSuffix;\n  var isSupported = eventName in document;\n\n  if (!isSupported) {\n    var element = document.createElement('div');\n    element.setAttribute(eventName, 'return;');\n    isSupported = typeof element[eventName] === 'function';\n  }\n\n  if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {\n    // This is the only way to test support for the `wheel` event in IE9+.\n    isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n  }\n\n  return isSupported;\n}\n\nfunction isCheckable(elem) {\n  var type = elem.type;\n  var nodeName = elem.nodeName;\n  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n  return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n  node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n  var value = '';\n  if (!node) {\n    return value;\n  }\n\n  if (isCheckable(node)) {\n    value = node.checked ? 'true' : 'false';\n  } else {\n    value = node.value;\n  }\n\n  return value;\n}\n\nfunction trackValueOnNode(node) {\n  var valueField = isCheckable(node) ? 'checked' : 'value';\n  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n\n  var currentValue = '' + node[valueField];\n\n  // if someone has already defined a value or Safari, then bail\n  // and don't track value will cause over reporting of changes,\n  // but it's better then a hard failure\n  // (needed for certain tests that spyOn input values and Safari)\n  if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n    return;\n  }\n\n  Object.defineProperty(node, valueField, {\n    enumerable: descriptor.enumerable,\n    configurable: true,\n    get: function () {\n      return descriptor.get.call(this);\n    },\n    set: function (value) {\n      currentValue = '' + value;\n      descriptor.set.call(this, value);\n    }\n  });\n\n  var tracker = {\n    getValue: function () {\n      return currentValue;\n    },\n    setValue: function (value) {\n      currentValue = '' + value;\n    },\n    stopTracking: function () {\n      detachTracker(node);\n      delete node[valueField];\n    }\n  };\n  return tracker;\n}\n\nfunction track(node) {\n  if (getTracker(node)) {\n    return;\n  }\n\n  // TODO: Once it's just Fiber we can move this to node._wrapperState\n  node._valueTracker = trackValueOnNode(node);\n}\n\nfunction updateValueIfChanged(node) {\n  if (!node) {\n    return false;\n  }\n\n  var tracker = getTracker(node);\n  // if there is no tracker at this point it's unlikely\n  // that trying again will succeed\n  if (!tracker) {\n    return true;\n  }\n\n  var lastValue = tracker.getValue();\n  var nextValue = getValueFromNode(node);\n  if (nextValue !== lastValue) {\n    tracker.setValue(nextValue);\n    return true;\n  }\n  return false;\n}\n\nvar eventTypes$1 = {\n  change: {\n    phasedRegistrationNames: {\n      bubbled: 'onChange',\n      captured: 'onChangeCapture'\n    },\n    dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']\n  }\n};\n\nfunction createAndAccumulateChangeEvent(inst, nativeEvent, target) {\n  var event = SyntheticEvent$1.getPooled(eventTypes$1.change, inst, nativeEvent, target);\n  event.type = 'change';\n  // Flag this event loop as needing state restore.\n  enqueueStateRestore(target);\n  accumulateTwoPhaseDispatches(event);\n  return event;\n}\n/**\n * For IE shims\n */\nvar activeElement = null;\nvar activeElementInst = null;\n\n/**\n * SECTION: handle `change` event\n */\nfunction shouldUseChangeEvent(elem) {\n  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n  var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));\n\n  // If change and propertychange bubbled, we'd just bind to it like all the\n  // other events and have it go through ReactBrowserEventEmitter. Since it\n  // doesn't, we manually listen for the events and so we have to enqueue and\n  // process the abstract event manually.\n  //\n  // Batching is necessary here in order to ensure that all event handlers run\n  // before the next rerender (including event handlers attached to ancestor\n  // elements instead of directly on the input). Without this, controlled\n  // components don't work properly in conjunction with event bubbling because\n  // the component is rerendered and the value reverted before all the event\n  // handlers can run. See https://github.com/facebook/react/issues/708.\n  batchedUpdates(runEventInBatch, event);\n}\n\nfunction runEventInBatch(event) {\n  enqueueEvents(event);\n  processEventQueue(false);\n}\n\nfunction getInstIfValueChanged(targetInst) {\n  var targetNode = getNodeFromInstance$1(targetInst);\n  if (updateValueIfChanged(targetNode)) {\n    return targetInst;\n  }\n}\n\nfunction getTargetInstForChangeEvent(topLevelType, targetInst) {\n  if (topLevelType === 'topChange') {\n    return targetInst;\n  }\n}\n\n/**\n * SECTION: handle `input` event\n */\nvar isInputEventSupported = false;\nif (ExecutionEnvironment_1.canUseDOM) {\n  // IE9 claims to support the input event but fails to trigger it when\n  // deleting text, so we ignore its input events.\n  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);\n}\n\n/**\n * (For IE <=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\nfunction startWatchingForValueChange(target, targetInst) {\n  activeElement = target;\n  activeElementInst = targetInst;\n  activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n\n/**\n * (For IE <=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\nfunction stopWatchingForValueChange() {\n  if (!activeElement) {\n    return;\n  }\n  activeElement.detachEvent('onpropertychange', handlePropertyChange);\n  activeElement = null;\n  activeElementInst = null;\n}\n\n/**\n * (For IE <=9) Handles a propertychange event, sending a `change` event if\n * the value of the active element has changed.\n */\nfunction handlePropertyChange(nativeEvent) {\n  if (nativeEvent.propertyName !== 'value') {\n    return;\n  }\n  if (getInstIfValueChanged(activeElementInst)) {\n    manualDispatchChangeEvent(nativeEvent);\n  }\n}\n\nfunction handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {\n  if (topLevelType === 'topFocus') {\n    // In IE9, propertychange fires for most input events but is buggy and\n    // doesn't fire when text is deleted, but conveniently, selectionchange\n    // appears to fire in all of the remaining cases so we catch those and\n    // forward the event if the value has changed\n    // In either case, we don't want to call the event handler if the value\n    // is changed from JS so we redefine a setter for `.value` that updates\n    // our activeElementValue variable, allowing us to ignore those changes\n    //\n    // stopWatching() should be a noop here but we call it just in case we\n    // missed a blur event somehow.\n    stopWatchingForValueChange();\n    startWatchingForValueChange(target, targetInst);\n  } else if (topLevelType === 'topBlur') {\n    stopWatchingForValueChange();\n  }\n}\n\n// For IE8 and IE9.\nfunction getTargetInstForInputEventPolyfill(topLevelType, targetInst) {\n  if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {\n    // On the selectionchange event, the target is just document which isn't\n    // helpful for us so just check activeElement instead.\n    //\n    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n    // propertychange on the first input event after setting `value` from a\n    // script and fires only keydown, keypress, keyup. Catching keyup usually\n    // gets it and catching keydown lets us fire an event for the first\n    // keystroke if user does a key repeat (it'll be a little delayed: right\n    // before the second keystroke). Other input methods (e.g., paste) seem to\n    // fire selectionchange normally.\n    return getInstIfValueChanged(activeElementInst);\n  }\n}\n\n/**\n * SECTION: handle `click` event\n */\nfunction shouldUseClickEvent(elem) {\n  // Use the `click` event to detect changes to checkbox and radio inputs.\n  // This approach works across all browsers, whereas `change` does not fire\n  // until `blur` in IE8.\n  var nodeName = elem.nodeName;\n  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\n\nfunction getTargetInstForClickEvent(topLevelType, targetInst) {\n  if (topLevelType === 'topClick') {\n    return getInstIfValueChanged(targetInst);\n  }\n}\n\nfunction getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {\n  if (topLevelType === 'topInput' || topLevelType === 'topChange') {\n    return getInstIfValueChanged(targetInst);\n  }\n}\n\nfunction handleControlledInputBlur(inst, node) {\n  // TODO: In IE, inst is occasionally null. Why?\n  if (inst == null) {\n    return;\n  }\n\n  // Fiber and ReactDOM keep wrapper state in separate places\n  var state = inst._wrapperState || node._wrapperState;\n\n  if (!state || !state.controlled || node.type !== 'number') {\n    return;\n  }\n\n  // If controlled, assign the value attribute to the current value on blur\n  var value = '' + node.value;\n  if (node.getAttribute('value') !== value) {\n    node.setAttribute('value', value);\n  }\n}\n\n/**\n * This plugin creates an `onChange` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - select\n */\nvar ChangeEventPlugin = {\n  eventTypes: eventTypes$1,\n\n  _isInputEventSupported: isInputEventSupported,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n\n    var getTargetInstFunc, handleEventFunc;\n    if (shouldUseChangeEvent(targetNode)) {\n      getTargetInstFunc = getTargetInstForChangeEvent;\n    } else if (isTextInputElement(targetNode)) {\n      if (isInputEventSupported) {\n        getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n      } else {\n        getTargetInstFunc = getTargetInstForInputEventPolyfill;\n        handleEventFunc = handleEventsForInputEventPolyfill;\n      }\n    } else if (shouldUseClickEvent(targetNode)) {\n      getTargetInstFunc = getTargetInstForClickEvent;\n    }\n\n    if (getTargetInstFunc) {\n      var inst = getTargetInstFunc(topLevelType, targetInst);\n      if (inst) {\n        var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);\n        return event;\n      }\n    }\n\n    if (handleEventFunc) {\n      handleEventFunc(topLevelType, targetNode, targetInst);\n    }\n\n    // When blurring, set the value attribute for number inputs\n    if (topLevelType === 'topBlur') {\n      handleControlledInputBlur(targetInst, targetNode);\n    }\n  }\n};\n\n/**\n * Module that is injectable into `EventPluginHub`, that specifies a\n * deterministic ordering of `EventPlugin`s. A convenient way to reason about\n * plugins, without having to package every one of them. This is better than\n * having plugins be ordered in the same order that they are injected because\n * that ordering would be influenced by the packaging order.\n * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that\n * preventing default on events is convenient in `SimpleEventPlugin` handlers.\n */\nvar DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];\n\n/**\n * @interface UIEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar UIEventInterface = {\n  view: null,\n  detail: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticUIEvent, UIEventInterface);\n\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\n\nvar modifierKeyToProp = {\n  Alt: 'altKey',\n  Control: 'ctrlKey',\n  Meta: 'metaKey',\n  Shift: 'shiftKey'\n};\n\n// IE8 does not implement getModifierState so we simply map it to the only\n// modifier keys exposed by the event itself, does not support Lock-keys.\n// Currently, all major browsers except Chrome seems to support Lock-keys.\nfunction modifierStateGetter(keyArg) {\n  var syntheticEvent = this;\n  var nativeEvent = syntheticEvent.nativeEvent;\n  if (nativeEvent.getModifierState) {\n    return nativeEvent.getModifierState(keyArg);\n  }\n  var keyProp = modifierKeyToProp[keyArg];\n  return keyProp ? !!nativeEvent[keyProp] : false;\n}\n\nfunction getEventModifierState(nativeEvent) {\n  return modifierStateGetter;\n}\n\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar MouseEventInterface = {\n  screenX: null,\n  screenY: null,\n  clientX: null,\n  clientY: null,\n  pageX: null,\n  pageY: null,\n  ctrlKey: null,\n  shiftKey: null,\n  altKey: null,\n  metaKey: null,\n  getModifierState: getEventModifierState,\n  button: null,\n  buttons: null,\n  relatedTarget: function (event) {\n    return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);\n\nvar eventTypes$2 = {\n  mouseEnter: {\n    registrationName: 'onMouseEnter',\n    dependencies: ['topMouseOut', 'topMouseOver']\n  },\n  mouseLeave: {\n    registrationName: 'onMouseLeave',\n    dependencies: ['topMouseOut', 'topMouseOver']\n  }\n};\n\nvar EnterLeaveEventPlugin = {\n  eventTypes: eventTypes$2,\n\n  /**\n   * For almost every interaction we care about, there will be both a top-level\n   * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that\n   * we do not extract duplicate events. However, moving the mouse into the\n   * browser from outside will not fire a `mouseout` event. In this case, we use\n   * the `mouseover` top-level event.\n   */\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {\n      return null;\n    }\n    if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {\n      // Must not be a mouse in or mouse out - ignoring.\n      return null;\n    }\n\n    var win;\n    if (nativeEventTarget.window === nativeEventTarget) {\n      // `nativeEventTarget` is probably a window object.\n      win = nativeEventTarget;\n    } else {\n      // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\n      var doc = nativeEventTarget.ownerDocument;\n      if (doc) {\n        win = doc.defaultView || doc.parentWindow;\n      } else {\n        win = window;\n      }\n    }\n\n    var from;\n    var to;\n    if (topLevelType === 'topMouseOut') {\n      from = targetInst;\n      var related = nativeEvent.relatedTarget || nativeEvent.toElement;\n      to = related ? getClosestInstanceFromNode(related) : null;\n    } else {\n      // Moving to a node from outside the window.\n      from = null;\n      to = targetInst;\n    }\n\n    if (from === to) {\n      // Nothing pertains to our managed components.\n      return null;\n    }\n\n    var fromNode = from == null ? win : getNodeFromInstance$1(from);\n    var toNode = to == null ? win : getNodeFromInstance$1(to);\n\n    var leave = SyntheticMouseEvent.getPooled(eventTypes$2.mouseLeave, from, nativeEvent, nativeEventTarget);\n    leave.type = 'mouseleave';\n    leave.target = fromNode;\n    leave.relatedTarget = toNode;\n\n    var enter = SyntheticMouseEvent.getPooled(eventTypes$2.mouseEnter, to, nativeEvent, nativeEventTarget);\n    enter.type = 'mouseenter';\n    enter.target = toNode;\n    enter.relatedTarget = fromNode;\n\n    accumulateEnterLeaveDispatches(leave, enter, from, to);\n\n    return [leave, enter];\n  }\n};\n\n/**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\n\n/**\n * This API should be called `delete` but we'd have to make sure to always\n * transform these to strings for IE support. When this transform is fully\n * supported we can rename it.\n */\n\n\nfunction get(key) {\n  return key._reactInternalFiber;\n}\n\nfunction has(key) {\n  return key._reactInternalFiber !== undefined;\n}\n\nfunction set(key, value) {\n  key._reactInternalFiber = value;\n}\n\nvar ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nvar ReactCurrentOwner = ReactInternals$1.ReactCurrentOwner;\nvar ReactDebugCurrentFrame = ReactInternals$1.ReactDebugCurrentFrame;\n\nfunction getComponentName(fiber) {\n  var type = fiber.type;\n\n  if (typeof type === 'string') {\n    return type;\n  }\n  if (typeof type === 'function') {\n    return type.displayName || type.name;\n  }\n  return null;\n}\n\n// Don't change these two values:\nvar NoEffect = 0; //           0b00000000\nvar PerformedWork = 1; //      0b00000001\n\n// You can change the rest (and add more).\nvar Placement = 2; //          0b00000010\nvar Update = 4; //             0b00000100\nvar PlacementAndUpdate = 6; // 0b00000110\nvar Deletion = 8; //           0b00001000\nvar ContentReset = 16; //      0b00010000\nvar Callback = 32; //          0b00100000\nvar Err = 64; //               0b01000000\nvar Ref = 128; //              0b10000000\n\nvar MOUNTING = 1;\nvar MOUNTED = 2;\nvar UNMOUNTED = 3;\n\nfunction isFiberMountedImpl(fiber) {\n  var node = fiber;\n  if (!fiber.alternate) {\n    // If there is no alternate, this might be a new tree that isn't inserted\n    // yet. If it is, then it will have a pending insertion effect on it.\n    if ((node.effectTag & Placement) !== NoEffect) {\n      return MOUNTING;\n    }\n    while (node['return']) {\n      node = node['return'];\n      if ((node.effectTag & Placement) !== NoEffect) {\n        return MOUNTING;\n      }\n    }\n  } else {\n    while (node['return']) {\n      node = node['return'];\n    }\n  }\n  if (node.tag === HostRoot) {\n    // TODO: Check if this was a nested HostRoot when used with\n    // renderContainerIntoSubtree.\n    return MOUNTED;\n  }\n  // If we didn't hit the root, that means that we're in an disconnected tree\n  // that has been unmounted.\n  return UNMOUNTED;\n}\n\nfunction isFiberMounted(fiber) {\n  return isFiberMountedImpl(fiber) === MOUNTED;\n}\n\nfunction isMounted(component) {\n  {\n    var owner = ReactCurrentOwner.current;\n    if (owner !== null && owner.tag === ClassComponent) {\n      var ownerFiber = owner;\n      var instance = ownerFiber.stateNode;\n      warning_1(instance._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber) || 'A component');\n      instance._warnedAboutRefsInRender = true;\n    }\n  }\n\n  var fiber = get(component);\n  if (!fiber) {\n    return false;\n  }\n  return isFiberMountedImpl(fiber) === MOUNTED;\n}\n\nfunction assertIsMounted(fiber) {\n  !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant_1(false, 'Unable to find node on an unmounted component.') : void 0;\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n  var alternate = fiber.alternate;\n  if (!alternate) {\n    // If there is no alternate, then we only need to check if it is mounted.\n    var state = isFiberMountedImpl(fiber);\n    !(state !== UNMOUNTED) ? invariant_1(false, 'Unable to find node on an unmounted component.') : void 0;\n    if (state === MOUNTING) {\n      return null;\n    }\n    return fiber;\n  }\n  // If we have two possible branches, we'll walk backwards up to the root\n  // to see what path the root points to. On the way we may hit one of the\n  // special cases and we'll deal with them.\n  var a = fiber;\n  var b = alternate;\n  while (true) {\n    var parentA = a['return'];\n    var parentB = parentA ? parentA.alternate : null;\n    if (!parentA || !parentB) {\n      // We're at the root.\n      break;\n    }\n\n    // If both copies of the parent fiber point to the same child, we can\n    // assume that the child is current. This happens when we bailout on low\n    // priority: the bailed out fiber's child reuses the current child.\n    if (parentA.child === parentB.child) {\n      var child = parentA.child;\n      while (child) {\n        if (child === a) {\n          // We've determined that A is the current branch.\n          assertIsMounted(parentA);\n          return fiber;\n        }\n        if (child === b) {\n          // We've determined that B is the current branch.\n          assertIsMounted(parentA);\n          return alternate;\n        }\n        child = child.sibling;\n      }\n      // We should never have an alternate for any mounting node. So the only\n      // way this could possibly happen is if this was unmounted, if at all.\n      invariant_1(false, 'Unable to find node on an unmounted component.');\n    }\n\n    if (a['return'] !== b['return']) {\n      // The return pointer of A and the return pointer of B point to different\n      // fibers. We assume that return pointers never criss-cross, so A must\n      // belong to the child set of A.return, and B must belong to the child\n      // set of B.return.\n      a = parentA;\n      b = parentB;\n    } else {\n      // The return pointers point to the same fiber. We'll have to use the\n      // default, slow path: scan the child sets of each parent alternate to see\n      // which child belongs to which set.\n      //\n      // Search parent A's child set\n      var didFindChild = false;\n      var _child = parentA.child;\n      while (_child) {\n        if (_child === a) {\n          didFindChild = true;\n          a = parentA;\n          b = parentB;\n          break;\n        }\n        if (_child === b) {\n          didFindChild = true;\n          b = parentA;\n          a = parentB;\n          break;\n        }\n        _child = _child.sibling;\n      }\n      if (!didFindChild) {\n        // Search parent B's child set\n        _child = parentB.child;\n        while (_child) {\n          if (_child === a) {\n            didFindChild = true;\n            a = parentB;\n            b = parentA;\n            break;\n          }\n          if (_child === b) {\n            didFindChild = true;\n            b = parentB;\n            a = parentA;\n            break;\n          }\n          _child = _child.sibling;\n        }\n        !didFindChild ? invariant_1(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;\n      }\n    }\n\n    !(a.alternate === b) ? invariant_1(false, 'Return fibers should always be each others\\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n  }\n  // If the root is not a host container, we're in a disconnected tree. I.e.\n  // unmounted.\n  !(a.tag === HostRoot) ? invariant_1(false, 'Unable to find node on an unmounted component.') : void 0;\n  if (a.stateNode.current === a) {\n    // We've determined that A is the current branch.\n    return fiber;\n  }\n  // Otherwise B has to be current branch.\n  return alternate;\n}\n\nfunction findCurrentHostFiber(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  }\n\n  // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText) {\n      return node;\n    } else if (node.child) {\n      node.child['return'] = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node['return'] || node['return'] === currentParent) {\n        return null;\n      }\n      node = node['return'];\n    }\n    node.sibling['return'] = node['return'];\n    node = node.sibling;\n  }\n  // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\n\nfunction findCurrentHostFiberWithNoPortals(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  }\n\n  // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText) {\n      return node;\n    } else if (node.child && node.tag !== HostPortal) {\n      node.child['return'] = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node['return'] || node['return'] === currentParent) {\n        return null;\n      }\n      node = node['return'];\n    }\n    node.sibling['return'] = node['return'];\n    node = node.sibling;\n  }\n  // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n\n\n/**\n * Upstream version of event listener. Does not take into account specific\n * nature of platform.\n */\nvar EventListener = {\n  /**\n   * Listen to DOM events during the bubble phase.\n   *\n   * @param {DOMEventTarget} target DOM element to register listener on.\n   * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.\n   * @param {function} callback Callback function.\n   * @return {object} Object with a `remove` method.\n   */\n  listen: function listen(target, eventType, callback) {\n    if (target.addEventListener) {\n      target.addEventListener(eventType, callback, false);\n      return {\n        remove: function remove() {\n          target.removeEventListener(eventType, callback, false);\n        }\n      };\n    } else if (target.attachEvent) {\n      target.attachEvent('on' + eventType, callback);\n      return {\n        remove: function remove() {\n          target.detachEvent('on' + eventType, callback);\n        }\n      };\n    }\n  },\n\n  /**\n   * Listen to DOM events during the capture phase.\n   *\n   * @param {DOMEventTarget} target DOM element to register listener on.\n   * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.\n   * @param {function} callback Callback function.\n   * @return {object} Object with a `remove` method.\n   */\n  capture: function capture(target, eventType, callback) {\n    if (target.addEventListener) {\n      target.addEventListener(eventType, callback, true);\n      return {\n        remove: function remove() {\n          target.removeEventListener(eventType, callback, true);\n        }\n      };\n    } else {\n      {\n        console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');\n      }\n      return {\n        remove: emptyFunction_1\n      };\n    }\n  },\n\n  registerDefault: function registerDefault() {}\n};\n\nvar EventListener_1 = EventListener;\n\nvar CALLBACK_BOOKKEEPING_POOL_SIZE = 10;\nvar callbackBookkeepingPool = [];\n\n/**\n * Find the deepest React component completely containing the root of the\n * passed-in instance (for use when entire React trees are nested within each\n * other). If React trees are not nested, returns null.\n */\nfunction findRootContainerNode(inst) {\n  // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n  // traversal, but caching is difficult to do correctly without using a\n  // mutation observer to listen for all DOM changes.\n  while (inst['return']) {\n    inst = inst['return'];\n  }\n  if (inst.tag !== HostRoot) {\n    // This can happen if we're in a detached tree.\n    return null;\n  }\n  return inst.stateNode.containerInfo;\n}\n\n// Used to store ancestor hierarchy in top level callback\nfunction getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {\n  if (callbackBookkeepingPool.length) {\n    var instance = callbackBookkeepingPool.pop();\n    instance.topLevelType = topLevelType;\n    instance.nativeEvent = nativeEvent;\n    instance.targetInst = targetInst;\n    return instance;\n  }\n  return {\n    topLevelType: topLevelType,\n    nativeEvent: nativeEvent,\n    targetInst: targetInst,\n    ancestors: []\n  };\n}\n\nfunction releaseTopLevelCallbackBookKeeping(instance) {\n  instance.topLevelType = null;\n  instance.nativeEvent = null;\n  instance.targetInst = null;\n  instance.ancestors.length = 0;\n  if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {\n    callbackBookkeepingPool.push(instance);\n  }\n}\n\nfunction handleTopLevelImpl(bookKeeping) {\n  var targetInst = bookKeeping.targetInst;\n\n  // Loop through the hierarchy, in case there's any nested components.\n  // It's important that we build the array of ancestors before calling any\n  // event handlers, because event handlers can modify the DOM, leading to\n  // inconsistencies with ReactMount's node cache. See #1105.\n  var ancestor = targetInst;\n  do {\n    if (!ancestor) {\n      bookKeeping.ancestors.push(ancestor);\n      break;\n    }\n    var root = findRootContainerNode(ancestor);\n    if (!root) {\n      break;\n    }\n    bookKeeping.ancestors.push(ancestor);\n    ancestor = getClosestInstanceFromNode(root);\n  } while (ancestor);\n\n  for (var i = 0; i < bookKeeping.ancestors.length; i++) {\n    targetInst = bookKeeping.ancestors[i];\n    _handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));\n  }\n}\n\n// TODO: can we stop exporting these?\nvar _enabled = true;\nvar _handleTopLevel = void 0;\n\nfunction setHandleTopLevel(handleTopLevel) {\n  _handleTopLevel = handleTopLevel;\n}\n\nfunction setEnabled(enabled) {\n  _enabled = !!enabled;\n}\n\nfunction isEnabled() {\n  return _enabled;\n}\n\n/**\n * Traps top-level events by using event bubbling.\n *\n * @param {string} topLevelType Record from `BrowserEventConstants`.\n * @param {string} handlerBaseName Event name (e.g. \"click\").\n * @param {object} element Element on which to attach listener.\n * @return {?object} An object with a remove function which will forcefully\n *                  remove the listener.\n * @internal\n */\nfunction trapBubbledEvent(topLevelType, handlerBaseName, element) {\n  if (!element) {\n    return null;\n  }\n  return EventListener_1.listen(element, handlerBaseName, dispatchEvent.bind(null, topLevelType));\n}\n\n/**\n * Traps a top-level event by using event capturing.\n *\n * @param {string} topLevelType Record from `BrowserEventConstants`.\n * @param {string} handlerBaseName Event name (e.g. \"click\").\n * @param {object} element Element on which to attach listener.\n * @return {?object} An object with a remove function which will forcefully\n *                  remove the listener.\n * @internal\n */\nfunction trapCapturedEvent(topLevelType, handlerBaseName, element) {\n  if (!element) {\n    return null;\n  }\n  return EventListener_1.capture(element, handlerBaseName, dispatchEvent.bind(null, topLevelType));\n}\n\nfunction dispatchEvent(topLevelType, nativeEvent) {\n  if (!_enabled) {\n    return;\n  }\n\n  var nativeEventTarget = getEventTarget(nativeEvent);\n  var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n  if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) {\n    // If we get an event (ex: img onload) before committing that\n    // component's mount, ignore it for now (that is, treat it as if it was an\n    // event on a non-React tree). We might also consider queueing events and\n    // dispatching them after the mount.\n    targetInst = null;\n  }\n\n  var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst);\n\n  try {\n    // Event queue being processed in the same cycle allows\n    // `preventDefault`.\n    batchedUpdates(handleTopLevelImpl, bookKeeping);\n  } finally {\n    releaseTopLevelCallbackBookKeeping(bookKeeping);\n  }\n}\n\nvar ReactDOMEventListener = Object.freeze({\n\tget _enabled () { return _enabled; },\n\tget _handleTopLevel () { return _handleTopLevel; },\n\tsetHandleTopLevel: setHandleTopLevel,\n\tsetEnabled: setEnabled,\n\tisEnabled: isEnabled,\n\ttrapBubbledEvent: trapBubbledEvent,\n\ttrapCapturedEvent: trapCapturedEvent,\n\tdispatchEvent: dispatchEvent\n});\n\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\nfunction makePrefixMap(styleProp, eventName) {\n  var prefixes = {};\n\n  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n  prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n  prefixes['Moz' + styleProp] = 'moz' + eventName;\n  prefixes['ms' + styleProp] = 'MS' + eventName;\n  prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();\n\n  return prefixes;\n}\n\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\nvar vendorPrefixes = {\n  animationend: makePrefixMap('Animation', 'AnimationEnd'),\n  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n  animationstart: makePrefixMap('Animation', 'AnimationStart'),\n  transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\nvar prefixedEventNames = {};\n\n/**\n * Element to check for prefixes on.\n */\nvar style = {};\n\n/**\n * Bootstrap if a DOM exists.\n */\nif (ExecutionEnvironment_1.canUseDOM) {\n  style = document.createElement('div').style;\n\n  // On some platforms, in particular some releases of Android 4.x,\n  // the un-prefixed \"animation\" and \"transition\" properties are defined on the\n  // style object but the events that fire will still be prefixed, so we need\n  // to check if the un-prefixed events are usable, and if not remove them from the map.\n  if (!('AnimationEvent' in window)) {\n    delete vendorPrefixes.animationend.animation;\n    delete vendorPrefixes.animationiteration.animation;\n    delete vendorPrefixes.animationstart.animation;\n  }\n\n  // Same as above\n  if (!('TransitionEvent' in window)) {\n    delete vendorPrefixes.transitionend.transition;\n  }\n}\n\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\nfunction getVendorPrefixedEventName(eventName) {\n  if (prefixedEventNames[eventName]) {\n    return prefixedEventNames[eventName];\n  } else if (!vendorPrefixes[eventName]) {\n    return eventName;\n  }\n\n  var prefixMap = vendorPrefixes[eventName];\n\n  for (var styleProp in prefixMap) {\n    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n      return prefixedEventNames[eventName] = prefixMap[styleProp];\n    }\n  }\n\n  return '';\n}\n\n/**\n * Types of raw signals from the browser caught at the top level.\n *\n * For events like 'submit' which don't consistently bubble (which we\n * trap at a lower node than `document`), binding at `document` would\n * cause duplicate events so we don't include them here.\n */\nvar topLevelTypes$1 = {\n  topAbort: 'abort',\n  topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',\n  topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',\n  topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',\n  topBlur: 'blur',\n  topCancel: 'cancel',\n  topCanPlay: 'canplay',\n  topCanPlayThrough: 'canplaythrough',\n  topChange: 'change',\n  topClick: 'click',\n  topClose: 'close',\n  topCompositionEnd: 'compositionend',\n  topCompositionStart: 'compositionstart',\n  topCompositionUpdate: 'compositionupdate',\n  topContextMenu: 'contextmenu',\n  topCopy: 'copy',\n  topCut: 'cut',\n  topDoubleClick: 'dblclick',\n  topDrag: 'drag',\n  topDragEnd: 'dragend',\n  topDragEnter: 'dragenter',\n  topDragExit: 'dragexit',\n  topDragLeave: 'dragleave',\n  topDragOver: 'dragover',\n  topDragStart: 'dragstart',\n  topDrop: 'drop',\n  topDurationChange: 'durationchange',\n  topEmptied: 'emptied',\n  topEncrypted: 'encrypted',\n  topEnded: 'ended',\n  topError: 'error',\n  topFocus: 'focus',\n  topInput: 'input',\n  topKeyDown: 'keydown',\n  topKeyPress: 'keypress',\n  topKeyUp: 'keyup',\n  topLoadedData: 'loadeddata',\n  topLoad: 'load',\n  topLoadedMetadata: 'loadedmetadata',\n  topLoadStart: 'loadstart',\n  topMouseDown: 'mousedown',\n  topMouseMove: 'mousemove',\n  topMouseOut: 'mouseout',\n  topMouseOver: 'mouseover',\n  topMouseUp: 'mouseup',\n  topPaste: 'paste',\n  topPause: 'pause',\n  topPlay: 'play',\n  topPlaying: 'playing',\n  topProgress: 'progress',\n  topRateChange: 'ratechange',\n  topScroll: 'scroll',\n  topSeeked: 'seeked',\n  topSeeking: 'seeking',\n  topSelectionChange: 'selectionchange',\n  topStalled: 'stalled',\n  topSuspend: 'suspend',\n  topTextInput: 'textInput',\n  topTimeUpdate: 'timeupdate',\n  topToggle: 'toggle',\n  topTouchCancel: 'touchcancel',\n  topTouchEnd: 'touchend',\n  topTouchMove: 'touchmove',\n  topTouchStart: 'touchstart',\n  topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',\n  topVolumeChange: 'volumechange',\n  topWaiting: 'waiting',\n  topWheel: 'wheel'\n};\n\nvar BrowserEventConstants = {\n  topLevelTypes: topLevelTypes$1\n};\n\nfunction runEventQueueInBatch(events) {\n  enqueueEvents(events);\n  processEventQueue(false);\n}\n\n/**\n * Streams a fired top-level event to `EventPluginHub` where plugins have the\n * opportunity to create `ReactEvent`s to be dispatched.\n */\nfunction handleTopLevel(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n  runEventQueueInBatch(events);\n}\n\nvar topLevelTypes = BrowserEventConstants.topLevelTypes;\n\n/**\n * Summary of `ReactBrowserEventEmitter` event handling:\n *\n *  - Top-level delegation is used to trap most native browser events. This\n *    may only occur in the main thread and is the responsibility of\n *    ReactDOMEventListener, which is injected and can therefore support\n *    pluggable event sources. This is the only work that occurs in the main\n *    thread.\n *\n *  - We normalize and de-duplicate events to account for browser quirks. This\n *    may be done in the worker thread.\n *\n *  - Forward these native events (with the associated top-level type used to\n *    trap it) to `EventPluginHub`, which in turn will ask plugins if they want\n *    to extract any synthetic events.\n *\n *  - The `EventPluginHub` will then process each event by annotating them with\n *    \"dispatches\", a sequence of listeners and IDs that care about that event.\n *\n *  - The `EventPluginHub` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * +------------+    .\n * |    DOM     |    .\n * +------------+    .\n *       |           .\n *       v           .\n * +------------+    .\n * | ReactEvent |    .\n * |  Listener  |    .\n * +------------+    .                         +-----------+\n *       |           .               +--------+|SimpleEvent|\n *       |           .               |         |Plugin     |\n * +-----|------+    .               v         +-----------+\n * |     |      |    .    +--------------+                    +------------+\n * |     +-----------.--->|EventPluginHub|                    |    Event   |\n * |            |    .    |              |     +-----------+  | Propagators|\n * | ReactEvent |    .    |              |     |TapEvent   |  |------------|\n * |  Emitter   |    .    |              |<---+|Plugin     |  |other plugin|\n * |            |    .    |              |     +-----------+  |  utilities |\n * |     +-----------.--->|              |                    +------------+\n * |     |      |    .    +--------------+\n * +-----|------+    .                ^        +-----------+\n *       |           .                |        |Enter/Leave|\n *       +           .                +-------+|Plugin     |\n * +-------------+   .                         +-----------+\n * | application |   .\n * |-------------|   .\n * |             |   .\n * |             |   .\n * +-------------+   .\n *                   .\n *    React Core     .  General Purpose Event Plugin System\n */\n\nvar alreadyListeningTo = {};\nvar reactTopListenersCounter = 0;\n\n/**\n * To ensure no conflicts with other potential React instances on the page\n */\nvar topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2);\n\nfunction getListeningForDocument(mountAt) {\n  // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`\n  // directly.\n  if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {\n    mountAt[topListenersIDKey] = reactTopListenersCounter++;\n    alreadyListeningTo[mountAt[topListenersIDKey]] = {};\n  }\n  return alreadyListeningTo[mountAt[topListenersIDKey]];\n}\n\n/**\n * We listen for bubbled touch events on the document object.\n *\n * Firefox v8.01 (and possibly others) exhibited strange behavior when\n * mounting `onmousemove` events at some node that was not the document\n * element. The symptoms were that if your mouse is not moving over something\n * contained within that mount point (for example on the background) the\n * top-level listeners for `onmousemove` won't be called. However, if you\n * register the `mousemove` on the document object, then it will of course\n * catch all `mousemove`s. This along with iOS quirks, justifies restricting\n * top-level listeners to the document object only, at least for these\n * movement types of events and possibly all events.\n *\n * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n *\n * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but\n * they bubble to document.\n *\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @param {object} contentDocumentHandle Document which owns the container\n */\nfunction listenTo(registrationName, contentDocumentHandle) {\n  var mountAt = contentDocumentHandle;\n  var isListening = getListeningForDocument(mountAt);\n  var dependencies = registrationNameDependencies[registrationName];\n\n  for (var i = 0; i < dependencies.length; i++) {\n    var dependency = dependencies[i];\n    if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {\n      if (dependency === 'topScroll') {\n        trapCapturedEvent('topScroll', 'scroll', mountAt);\n      } else if (dependency === 'topFocus' || dependency === 'topBlur') {\n        trapCapturedEvent('topFocus', 'focus', mountAt);\n        trapCapturedEvent('topBlur', 'blur', mountAt);\n\n        // to make sure blur and focus event listeners are only attached once\n        isListening.topBlur = true;\n        isListening.topFocus = true;\n      } else if (dependency === 'topCancel') {\n        if (isEventSupported('cancel', true)) {\n          trapCapturedEvent('topCancel', 'cancel', mountAt);\n        }\n        isListening.topCancel = true;\n      } else if (dependency === 'topClose') {\n        if (isEventSupported('close', true)) {\n          trapCapturedEvent('topClose', 'close', mountAt);\n        }\n        isListening.topClose = true;\n      } else if (topLevelTypes.hasOwnProperty(dependency)) {\n        trapBubbledEvent(dependency, topLevelTypes[dependency], mountAt);\n      }\n\n      isListening[dependency] = true;\n    }\n  }\n}\n\nfunction isListeningToAllDependencies(registrationName, mountAt) {\n  var isListening = getListeningForDocument(mountAt);\n  var dependencies = registrationNameDependencies[registrationName];\n  for (var i = 0; i < dependencies.length; i++) {\n    var dependency = dependencies[i];\n    if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/* eslint-disable fb-www/typeof-undefined */\n\n/**\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\n * not safe to call document.activeElement if there is nothing focused.\n *\n * The activeElement will be null only if the document or document body is not\n * yet defined.\n *\n * @param {?DOMDocument} doc Defaults to current document.\n * @return {?DOMElement}\n */\nfunction getActiveElement(doc) /*?DOMElement*/{\n  doc = doc || (typeof document !== 'undefined' ? document : undefined);\n  if (typeof doc === 'undefined') {\n    return null;\n  }\n  try {\n    return doc.activeElement || doc.body;\n  } catch (e) {\n    return doc.body;\n  }\n}\n\nvar getActiveElement_1 = getActiveElement;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n * \n */\n\n/*eslint-disable no-self-compare */\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n  // SameValue algorithm\n  if (x === y) {\n    // Steps 1-5, 7-10\n    // Steps 6.b-6.e: +0 != -0\n    // Added the nonzero y check to make Flow happy, but it is redundant\n    return x !== 0 || y !== 0 || 1 / x === 1 / y;\n  } else {\n    // Step 6.a: NaN == NaN\n    return x !== x && y !== y;\n  }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n  if (is(objA, objB)) {\n    return true;\n  }\n\n  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n    return false;\n  }\n\n  var keysA = Object.keys(objA);\n  var keysB = Object.keys(objB);\n\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n\n  // Test for A's keys different from B.\n  for (var i = 0; i < keysA.length; i++) {\n    if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nvar shallowEqual_1 = shallowEqual;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM node.\n */\nfunction isNode(object) {\n  var doc = object ? object.ownerDocument || object : document;\n  var defaultView = doc.defaultView || window;\n  return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nvar isNode_1 = isNode;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM text node.\n */\nfunction isTextNode(object) {\n  return isNode_1(object) && object.nodeType == 3;\n}\n\nvar isTextNode_1 = isTextNode;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\n\n/*eslint-disable no-bitwise */\n\n/**\n * Checks if a given DOM node contains or is another DOM node.\n */\nfunction containsNode(outerNode, innerNode) {\n  if (!outerNode || !innerNode) {\n    return false;\n  } else if (outerNode === innerNode) {\n    return true;\n  } else if (isTextNode_1(outerNode)) {\n    return false;\n  } else if (isTextNode_1(innerNode)) {\n    return containsNode(outerNode, innerNode.parentNode);\n  } else if ('contains' in outerNode) {\n    return outerNode.contains(innerNode);\n  } else if (outerNode.compareDocumentPosition) {\n    return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n  } else {\n    return false;\n  }\n}\n\nvar containsNode_1 = containsNode;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * @param {DOMElement} node input/textarea to focus\n */\n\nfunction focusNode(node) {\n  // IE8 can throw \"Can't move focus to the control because it is invisible,\n  // not enabled, or of a type that does not accept the focus.\" for all kinds of\n  // reasons that are too expensive and fragile to test.\n  try {\n    node.focus();\n  } catch (e) {}\n}\n\nvar focusNode_1 = focusNode;\n\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\nfunction getLeafNode(node) {\n  while (node && node.firstChild) {\n    node = node.firstChild;\n  }\n  return node;\n}\n\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\nfunction getSiblingNode(node) {\n  while (node) {\n    if (node.nextSibling) {\n      return node.nextSibling;\n    }\n    node = node.parentNode;\n  }\n}\n\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\nfunction getNodeForCharacterOffset(root, offset) {\n  var node = getLeafNode(root);\n  var nodeStart = 0;\n  var nodeEnd = 0;\n\n  while (node) {\n    if (node.nodeType === TEXT_NODE) {\n      nodeEnd = nodeStart + node.textContent.length;\n\n      if (nodeStart <= offset && nodeEnd >= offset) {\n        return {\n          node: node,\n          offset: offset - nodeStart\n        };\n      }\n\n      nodeStart = nodeEnd;\n    }\n\n    node = getLeafNode(getSiblingNode(node));\n  }\n}\n\n/**\n * @param {DOMElement} outerNode\n * @return {?object}\n */\nfunction getOffsets(outerNode) {\n  var selection = window.getSelection && window.getSelection();\n\n  if (!selection || selection.rangeCount === 0) {\n    return null;\n  }\n\n  var anchorNode = selection.anchorNode,\n      anchorOffset = selection.anchorOffset,\n      focusNode = selection.focusNode,\n      focusOffset = selection.focusOffset;\n\n  // In Firefox, anchorNode and focusNode can be \"anonymous divs\", e.g. the\n  // up/down buttons on an <input type=\"number\">. Anonymous divs do not seem to\n  // expose properties, triggering a \"Permission denied error\" if any of its\n  // properties are accessed. The only seemingly possible way to avoid erroring\n  // is to access a property that typically works for non-anonymous divs and\n  // catch any error that may otherwise arise. See\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n\n  try {\n    /* eslint-disable no-unused-expressions */\n    anchorNode.nodeType;\n    focusNode.nodeType;\n    /* eslint-enable no-unused-expressions */\n  } catch (e) {\n    return null;\n  }\n\n  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n\n/**\n * Returns {start, end} where `start` is the character/codepoint index of\n * (anchorNode, anchorOffset) within the textContent of `outerNode`, and\n * `end` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n */\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n  var length = 0;\n  var start = -1;\n  var end = -1;\n  var indexWithinAnchor = 0;\n  var indexWithinFocus = 0;\n  var node = outerNode;\n  var parentNode = null;\n\n  outer: while (true) {\n    var next = null;\n\n    while (true) {\n      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n        start = length + anchorOffset;\n      }\n      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n        end = length + focusOffset;\n      }\n\n      if (node.nodeType === TEXT_NODE) {\n        length += node.nodeValue.length;\n      }\n\n      if ((next = node.firstChild) === null) {\n        break;\n      }\n      // Moving from `node` to its first child `next`.\n      parentNode = node;\n      node = next;\n    }\n\n    while (true) {\n      if (node === outerNode) {\n        // If `outerNode` has children, this is always the second time visiting\n        // it. If it has no children, this is still the first loop, and the only\n        // valid selection is anchorNode and focusNode both equal to this node\n        // and both offsets 0, in which case we will have handled above.\n        break outer;\n      }\n      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n        start = length;\n      }\n      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n        end = length;\n      }\n      if ((next = node.nextSibling) !== null) {\n        break;\n      }\n      node = parentNode;\n      parentNode = node.parentNode;\n    }\n\n    // Moving from `node` to its next sibling `next`.\n    node = next;\n  }\n\n  if (start === -1 || end === -1) {\n    // This should never happen. (Would happen if the anchor/focus nodes aren't\n    // actually inside the passed-in node.)\n    return null;\n  }\n\n  return {\n    start: start,\n    end: end\n  };\n}\n\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\nfunction setOffsets(node, offsets) {\n  if (!window.getSelection) {\n    return;\n  }\n\n  var selection = window.getSelection();\n  var length = node[getTextContentAccessor()].length;\n  var start = Math.min(offsets.start, length);\n  var end = offsets.end === undefined ? start : Math.min(offsets.end, length);\n\n  // IE 11 uses modern selection, but doesn't support the extend method.\n  // Flip backward selections, so we can set with a single range.\n  if (!selection.extend && start > end) {\n    var temp = end;\n    end = start;\n    start = temp;\n  }\n\n  var startMarker = getNodeForCharacterOffset(node, start);\n  var endMarker = getNodeForCharacterOffset(node, end);\n\n  if (startMarker && endMarker) {\n    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n      return;\n    }\n    var range = document.createRange();\n    range.setStart(startMarker.node, startMarker.offset);\n    selection.removeAllRanges();\n\n    if (start > end) {\n      selection.addRange(range);\n      selection.extend(endMarker.node, endMarker.offset);\n    } else {\n      range.setEnd(endMarker.node, endMarker.offset);\n      selection.addRange(range);\n    }\n  }\n}\n\nfunction isInDocument(node) {\n  return containsNode_1(document.documentElement, node);\n}\n\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\n\nfunction hasSelectionCapabilities(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\n\nfunction getSelectionInformation() {\n  var focusedElem = getActiveElement_1();\n  return {\n    focusedElem: focusedElem,\n    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null\n  };\n}\n\n/**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\nfunction restoreSelection(priorSelectionInformation) {\n  var curFocusedElem = getActiveElement_1();\n  var priorFocusedElem = priorSelectionInformation.focusedElem;\n  var priorSelectionRange = priorSelectionInformation.selectionRange;\n  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n    if (hasSelectionCapabilities(priorFocusedElem)) {\n      setSelection(priorFocusedElem, priorSelectionRange);\n    }\n\n    // Focusing a node can change the scroll position, which is undesirable\n    var ancestors = [];\n    var ancestor = priorFocusedElem;\n    while (ancestor = ancestor.parentNode) {\n      if (ancestor.nodeType === ELEMENT_NODE) {\n        ancestors.push({\n          element: ancestor,\n          left: ancestor.scrollLeft,\n          top: ancestor.scrollTop\n        });\n      }\n    }\n\n    focusNode_1(priorFocusedElem);\n\n    for (var i = 0; i < ancestors.length; i++) {\n      var info = ancestors[i];\n      info.element.scrollLeft = info.left;\n      info.element.scrollTop = info.top;\n    }\n  }\n}\n\n/**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\nfunction getSelection$1(input) {\n  var selection = void 0;\n\n  if ('selectionStart' in input) {\n    // Modern browser with input or textarea.\n    selection = {\n      start: input.selectionStart,\n      end: input.selectionEnd\n    };\n  } else {\n    // Content editable or old IE textarea.\n    selection = getOffsets(input);\n  }\n\n  return selection || { start: 0, end: 0 };\n}\n\n/**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input     Set selection bounds of this input or textarea\n * -@offsets   Object of same form that is returned from get*\n */\nfunction setSelection(input, offsets) {\n  var start = offsets.start,\n      end = offsets.end;\n\n  if (end === undefined) {\n    end = start;\n  }\n\n  if ('selectionStart' in input) {\n    input.selectionStart = start;\n    input.selectionEnd = Math.min(end, input.value.length);\n  } else {\n    setOffsets(input, offsets);\n  }\n}\n\nvar skipSelectionChangeEvent = ExecutionEnvironment_1.canUseDOM && 'documentMode' in document && document.documentMode <= 11;\n\nvar eventTypes$3 = {\n  select: {\n    phasedRegistrationNames: {\n      bubbled: 'onSelect',\n      captured: 'onSelectCapture'\n    },\n    dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']\n  }\n};\n\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n *\n * @param {DOMElement} node\n * @return {object}\n */\nfunction getSelection(node) {\n  if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n    return {\n      start: node.selectionStart,\n      end: node.selectionEnd\n    };\n  } else if (window.getSelection) {\n    var selection = window.getSelection();\n    return {\n      anchorNode: selection.anchorNode,\n      anchorOffset: selection.anchorOffset,\n      focusNode: selection.focusNode,\n      focusOffset: selection.focusOffset\n    };\n  }\n}\n\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @return {?SyntheticEvent}\n */\nfunction constructSelectEvent(nativeEvent, nativeEventTarget) {\n  // Ensure we have the right element, and that the user is not dragging a\n  // selection (this matches native `select` event behavior). In HTML5, select\n  // fires only on input and textarea thus if there's no focused element we\n  // won't dispatch.\n  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement_1()) {\n    return null;\n  }\n\n  // Only fire when selection has actually changed.\n  var currentSelection = getSelection(activeElement$1);\n  if (!lastSelection || !shallowEqual_1(lastSelection, currentSelection)) {\n    lastSelection = currentSelection;\n\n    var syntheticEvent = SyntheticEvent$1.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);\n\n    syntheticEvent.type = 'select';\n    syntheticEvent.target = activeElement$1;\n\n    accumulateTwoPhaseDispatches(syntheticEvent);\n\n    return syntheticEvent;\n  }\n\n  return null;\n}\n\n/**\n * This plugin creates an `onSelect` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\nvar SelectEventPlugin = {\n  eventTypes: eventTypes$3,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : nativeEventTarget.nodeType === DOCUMENT_NODE ? nativeEventTarget : nativeEventTarget.ownerDocument;\n    // Track whether all listeners exists for this plugin. If none exist, we do\n    // not extract events. See #3639.\n    if (!doc || !isListeningToAllDependencies('onSelect', doc)) {\n      return null;\n    }\n\n    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n\n    switch (topLevelType) {\n      // Track the input node that has focus.\n      case 'topFocus':\n        if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n          activeElement$1 = targetNode;\n          activeElementInst$1 = targetInst;\n          lastSelection = null;\n        }\n        break;\n      case 'topBlur':\n        activeElement$1 = null;\n        activeElementInst$1 = null;\n        lastSelection = null;\n        break;\n      // Don't fire the event while the user is dragging. This matches the\n      // semantics of the native select event.\n      case 'topMouseDown':\n        mouseDown = true;\n        break;\n      case 'topContextMenu':\n      case 'topMouseUp':\n        mouseDown = false;\n        return constructSelectEvent(nativeEvent, nativeEventTarget);\n      // Chrome and IE fire non-standard event when selection is changed (and\n      // sometimes when it hasn't). IE's event fires out of order with respect\n      // to key and input events on deletion, so we discard it.\n      //\n      // Firefox doesn't support selectionchange, so check selection status\n      // after each key entry. The selection changes after keydown and before\n      // keyup, but we check on keydown as well in the case of holding down a\n      // key, when multiple keydown events are fired but only one keyup is.\n      // This is also our approach for IE handling, for the reason above.\n      case 'topSelectionChange':\n        if (skipSelectionChangeEvent) {\n          break;\n        }\n      // falls through\n      case 'topKeyDown':\n      case 'topKeyUp':\n        return constructSelectEvent(nativeEvent, nativeEventTarget);\n    }\n\n    return null;\n  }\n};\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\nvar AnimationEventInterface = {\n  animationName: null,\n  elapsedTime: null,\n  pseudoElement: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\nvar ClipboardEventInterface = {\n  clipboardData: function (event) {\n    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);\n\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar FocusEventInterface = {\n  relatedTarget: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);\n\n/**\n * `charCode` represents the actual \"character code\" and is safe to use with\n * `String.fromCharCode`. As such, only keys that correspond to printable\n * characters produce a valid `charCode`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a `charCode`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized `charCode` property.\n */\nfunction getEventCharCode(nativeEvent) {\n  var charCode;\n  var keyCode = nativeEvent.keyCode;\n\n  if ('charCode' in nativeEvent) {\n    charCode = nativeEvent.charCode;\n\n    // FF does not set `charCode` for the Enter-key, check against `keyCode`.\n    if (charCode === 0 && keyCode === 13) {\n      charCode = 13;\n    }\n  } else {\n    // IE8 does not implement `charCode`, but `keyCode` has the correct value.\n    charCode = keyCode;\n  }\n\n  // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.\n  // Must not discard the (non-)printable Enter-key.\n  if (charCode >= 32 || charCode === 13) {\n    return charCode;\n  }\n\n  return 0;\n}\n\n/**\n * Normalization of deprecated HTML5 `key` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\nvar normalizeKey = {\n  Esc: 'Escape',\n  Spacebar: ' ',\n  Left: 'ArrowLeft',\n  Up: 'ArrowUp',\n  Right: 'ArrowRight',\n  Down: 'ArrowDown',\n  Del: 'Delete',\n  Win: 'OS',\n  Menu: 'ContextMenu',\n  Apps: 'ContextMenu',\n  Scroll: 'ScrollLock',\n  MozPrintableKey: 'Unidentified'\n};\n\n/**\n * Translation from legacy `keyCode` to HTML5 `key`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\nvar translateToKey = {\n  '8': 'Backspace',\n  '9': 'Tab',\n  '12': 'Clear',\n  '13': 'Enter',\n  '16': 'Shift',\n  '17': 'Control',\n  '18': 'Alt',\n  '19': 'Pause',\n  '20': 'CapsLock',\n  '27': 'Escape',\n  '32': ' ',\n  '33': 'PageUp',\n  '34': 'PageDown',\n  '35': 'End',\n  '36': 'Home',\n  '37': 'ArrowLeft',\n  '38': 'ArrowUp',\n  '39': 'ArrowRight',\n  '40': 'ArrowDown',\n  '45': 'Insert',\n  '46': 'Delete',\n  '112': 'F1',\n  '113': 'F2',\n  '114': 'F3',\n  '115': 'F4',\n  '116': 'F5',\n  '117': 'F6',\n  '118': 'F7',\n  '119': 'F8',\n  '120': 'F9',\n  '121': 'F10',\n  '122': 'F11',\n  '123': 'F12',\n  '144': 'NumLock',\n  '145': 'ScrollLock',\n  '224': 'Meta'\n};\n\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized `key` property.\n */\nfunction getEventKey(nativeEvent) {\n  if (nativeEvent.key) {\n    // Normalize inconsistent values reported by browsers due to\n    // implementations of a working draft specification.\n\n    // FireFox implements `key` but returns `MozPrintableKey` for all\n    // printable characters (normalized to `Unidentified`), ignore it.\n    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n    if (key !== 'Unidentified') {\n      return key;\n    }\n  }\n\n  // Browser does not implement `key`, polyfill as much of it as we can.\n  if (nativeEvent.type === 'keypress') {\n    var charCode = getEventCharCode(nativeEvent);\n\n    // The enter-key is technically both printable and non-printable and can\n    // thus be captured by `keypress`, no other non-printable key should.\n    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n  }\n  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n    // While user keyboard layout determines the actual meaning of each\n    // `keyCode` value, almost all function keys have a universal value.\n    return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n  }\n  return '';\n}\n\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar KeyboardEventInterface = {\n  key: getEventKey,\n  location: null,\n  ctrlKey: null,\n  shiftKey: null,\n  altKey: null,\n  metaKey: null,\n  repeat: null,\n  locale: null,\n  getModifierState: getEventModifierState,\n  // Legacy Interface\n  charCode: function (event) {\n    // `charCode` is the result of a KeyPress event and represents the value of\n    // the actual printable character.\n\n    // KeyPress is deprecated, but its replacement is not yet final and not\n    // implemented in any major browser. Only KeyPress has charCode.\n    if (event.type === 'keypress') {\n      return getEventCharCode(event);\n    }\n    return 0;\n  },\n  keyCode: function (event) {\n    // `keyCode` is the result of a KeyDown/Up event and represents the value of\n    // physical keyboard key.\n\n    // The actual meaning of the value depends on the users' keyboard layout\n    // which cannot be detected. Assuming that it is a US keyboard layout\n    // provides a surprisingly accurate mapping for US and European users.\n    // Due to this, it is left to the user to implement at this time.\n    if (event.type === 'keydown' || event.type === 'keyup') {\n      return event.keyCode;\n    }\n    return 0;\n  },\n  which: function (event) {\n    // `which` is an alias for either `keyCode` or `charCode` depending on the\n    // type of the event.\n    if (event.type === 'keypress') {\n      return getEventCharCode(event);\n    }\n    if (event.type === 'keydown' || event.type === 'keyup') {\n      return event.keyCode;\n    }\n    return 0;\n  }\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);\n\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar DragEventInterface = {\n  dataTransfer: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticMouseEvent}\n */\nfunction SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);\n\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\nvar TouchEventInterface = {\n  touches: null,\n  targetTouches: null,\n  changedTouches: null,\n  altKey: null,\n  metaKey: null,\n  ctrlKey: null,\n  shiftKey: null,\n  getModifierState: getEventModifierState\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticUIEvent}\n */\nfunction SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\nvar TransitionEventInterface = {\n  propertyName: null,\n  elapsedTime: null,\n  pseudoElement: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);\n\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar WheelEventInterface = {\n  deltaX: function (event) {\n    return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n  },\n  deltaY: function (event) {\n    return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).\n    'wheelDelta' in event ? -event.wheelDelta : 0;\n  },\n  deltaZ: null,\n\n  // Browsers without \"deltaMode\" is reporting in raw wheel delta where one\n  // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n  deltaMode: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticMouseEvent}\n */\nfunction SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n  return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);\n\n/**\n * Turns\n * ['abort', ...]\n * into\n * eventTypes = {\n *   'abort': {\n *     phasedRegistrationNames: {\n *       bubbled: 'onAbort',\n *       captured: 'onAbortCapture',\n *     },\n *     dependencies: ['topAbort'],\n *   },\n *   ...\n * };\n * topLevelEventsToDispatchConfig = {\n *   'topAbort': { sameConfig }\n * };\n */\nvar eventTypes$4 = {};\nvar topLevelEventsToDispatchConfig = {};\n['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'toggle', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {\n  var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n  var onEvent = 'on' + capitalizedEvent;\n  var topEvent = 'top' + capitalizedEvent;\n\n  var type = {\n    phasedRegistrationNames: {\n      bubbled: onEvent,\n      captured: onEvent + 'Capture'\n    },\n    dependencies: [topEvent]\n  };\n  eventTypes$4[event] = type;\n  topLevelEventsToDispatchConfig[topEvent] = type;\n});\n\n// Only used in DEV for exhaustiveness validation.\nvar knownHTMLTopLevelTypes = ['topAbort', 'topCancel', 'topCanPlay', 'topCanPlayThrough', 'topClose', 'topDurationChange', 'topEmptied', 'topEncrypted', 'topEnded', 'topError', 'topInput', 'topInvalid', 'topLoad', 'topLoadedData', 'topLoadedMetadata', 'topLoadStart', 'topPause', 'topPlay', 'topPlaying', 'topProgress', 'topRateChange', 'topReset', 'topSeeked', 'topSeeking', 'topStalled', 'topSubmit', 'topSuspend', 'topTimeUpdate', 'topToggle', 'topVolumeChange', 'topWaiting'];\n\nvar SimpleEventPlugin = {\n  eventTypes: eventTypes$4,\n\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n    var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];\n    if (!dispatchConfig) {\n      return null;\n    }\n    var EventConstructor;\n    switch (topLevelType) {\n      case 'topKeyPress':\n        // Firefox creates a keypress event for function keys too. This removes\n        // the unwanted keypress events. Enter is however both printable and\n        // non-printable. One would expect Tab to be as well (but it isn't).\n        if (getEventCharCode(nativeEvent) === 0) {\n          return null;\n        }\n      /* falls through */\n      case 'topKeyDown':\n      case 'topKeyUp':\n        EventConstructor = SyntheticKeyboardEvent;\n        break;\n      case 'topBlur':\n      case 'topFocus':\n        EventConstructor = SyntheticFocusEvent;\n        break;\n      case 'topClick':\n        // Firefox creates a click event on right mouse clicks. This removes the\n        // unwanted click events.\n        if (nativeEvent.button === 2) {\n          return null;\n        }\n      /* falls through */\n      case 'topDoubleClick':\n      case 'topMouseDown':\n      case 'topMouseMove':\n      case 'topMouseUp':\n      // TODO: Disabled elements should not respond to mouse events\n      /* falls through */\n      case 'topMouseOut':\n      case 'topMouseOver':\n      case 'topContextMenu':\n        EventConstructor = SyntheticMouseEvent;\n        break;\n      case 'topDrag':\n      case 'topDragEnd':\n      case 'topDragEnter':\n      case 'topDragExit':\n      case 'topDragLeave':\n      case 'topDragOver':\n      case 'topDragStart':\n      case 'topDrop':\n        EventConstructor = SyntheticDragEvent;\n        break;\n      case 'topTouchCancel':\n      case 'topTouchEnd':\n      case 'topTouchMove':\n      case 'topTouchStart':\n        EventConstructor = SyntheticTouchEvent;\n        break;\n      case 'topAnimationEnd':\n      case 'topAnimationIteration':\n      case 'topAnimationStart':\n        EventConstructor = SyntheticAnimationEvent;\n        break;\n      case 'topTransitionEnd':\n        EventConstructor = SyntheticTransitionEvent;\n        break;\n      case 'topScroll':\n        EventConstructor = SyntheticUIEvent;\n        break;\n      case 'topWheel':\n        EventConstructor = SyntheticWheelEvent;\n        break;\n      case 'topCopy':\n      case 'topCut':\n      case 'topPaste':\n        EventConstructor = SyntheticClipboardEvent;\n        break;\n      default:\n        {\n          if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {\n            warning_1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);\n          }\n        }\n        // HTML Events\n        // @see http://www.w3.org/TR/html5/index.html#events-0\n        EventConstructor = SyntheticEvent$1;\n        break;\n    }\n    var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);\n    accumulateTwoPhaseDispatches(event);\n    return event;\n  }\n};\n\nsetHandleTopLevel(handleTopLevel);\n\n/**\n * Inject modules for resolving DOM hierarchy and plugin ordering.\n */\ninjection$1.injectEventPluginOrder(DOMEventPluginOrder);\ninjection$2.injectComponentTree(ReactDOMComponentTree);\n\n/**\n * Some important event plugins included by default (without having to require\n * them).\n */\ninjection$1.injectEventPluginsByName({\n  SimpleEventPlugin: SimpleEventPlugin,\n  EnterLeaveEventPlugin: EnterLeaveEventPlugin,\n  ChangeEventPlugin: ChangeEventPlugin,\n  SelectEventPlugin: SelectEventPlugin,\n  BeforeInputEventPlugin: BeforeInputEventPlugin\n});\n\nvar enableAsyncSubtreeAPI = true;\nvar enableAsyncSchedulingByDefaultInReactDOM = false;\n// Exports ReactDOM.createRoot\nvar enableCreateRoot = false;\nvar enableUserTimingAPI = true;\n\n// Mutating mode (React DOM, React ART, React Native):\nvar enableMutatingReconciler = true;\n// Experimental noop mode (currently unused):\nvar enableNoopReconciler = false;\n// Experimental persistent mode (CS):\nvar enablePersistentReconciler = false;\n\n// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:\nvar debugRenderPhaseSideEffects = false;\n\n// Only used in www builds.\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar emptyObject = {};\n\n{\n  Object.freeze(emptyObject);\n}\n\nvar emptyObject_1 = emptyObject;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nvar ReactPropTypesSecret_1 = ReactPropTypesSecret$1;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n{\n  var invariant$2 = invariant_1;\n  var warning$2 = warning_1;\n  var ReactPropTypesSecret = ReactPropTypesSecret_1;\n  var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n  {\n    for (var typeSpecName in typeSpecs) {\n      if (typeSpecs.hasOwnProperty(typeSpecName)) {\n        var error;\n        // Prop type validation may throw. In case they do, we don't want to\n        // fail the render phase where it didn't fail before. So we log it.\n        // After these have been cleaned up, we'll let them throw.\n        try {\n          // This is intentionally an invariant that gets caught. It's the same\n          // behavior as without this statement except with a better message.\n          invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n        } catch (ex) {\n          error = ex;\n        }\n        warning$2(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n        if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n          // Only monitor this failure once because there tends to be a lot of the\n          // same error.\n          loggedTypeFailures[error.message] = true;\n\n          var stack = getStack ? getStack() : '';\n\n          warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n        }\n      }\n    }\n  }\n}\n\nvar checkPropTypes_1 = checkPropTypes;\n\nvar valueStack = [];\n\n{\n  var fiberStack = [];\n}\n\nvar index = -1;\n\nfunction createCursor(defaultValue) {\n  return {\n    current: defaultValue\n  };\n}\n\n\n\nfunction pop(cursor, fiber) {\n  if (index < 0) {\n    {\n      warning_1(false, 'Unexpected pop.');\n    }\n    return;\n  }\n\n  {\n    if (fiber !== fiberStack[index]) {\n      warning_1(false, 'Unexpected Fiber popped.');\n    }\n  }\n\n  cursor.current = valueStack[index];\n\n  valueStack[index] = null;\n\n  {\n    fiberStack[index] = null;\n  }\n\n  index--;\n}\n\nfunction push(cursor, value, fiber) {\n  index++;\n\n  valueStack[index] = cursor.current;\n\n  {\n    fiberStack[index] = fiber;\n  }\n\n  cursor.current = value;\n}\n\nfunction reset$1() {\n  while (index > -1) {\n    valueStack[index] = null;\n\n    {\n      fiberStack[index] = null;\n    }\n\n    index--;\n  }\n}\n\nvar describeComponentFrame = function (name, source, ownerName) {\n  return '\\n    in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');\n};\n\nfunction describeFiber(fiber) {\n  switch (fiber.tag) {\n    case IndeterminateComponent:\n    case FunctionalComponent:\n    case ClassComponent:\n    case HostComponent:\n      var owner = fiber._debugOwner;\n      var source = fiber._debugSource;\n      var name = getComponentName(fiber);\n      var ownerName = null;\n      if (owner) {\n        ownerName = getComponentName(owner);\n      }\n      return describeComponentFrame(name, source, ownerName);\n    default:\n      return '';\n  }\n}\n\n// This function can only be called with a work-in-progress fiber and\n// only during begin or complete phase. Do not call it under any other\n// circumstances.\nfunction getStackAddendumByWorkInProgressFiber(workInProgress) {\n  var info = '';\n  var node = workInProgress;\n  do {\n    info += describeFiber(node);\n    // Otherwise this return pointer might point to the wrong tree:\n    node = node['return'];\n  } while (node);\n  return info;\n}\n\nfunction getCurrentFiberOwnerName() {\n  {\n    var fiber = ReactDebugCurrentFiber.current;\n    if (fiber === null) {\n      return null;\n    }\n    var owner = fiber._debugOwner;\n    if (owner !== null && typeof owner !== 'undefined') {\n      return getComponentName(owner);\n    }\n  }\n  return null;\n}\n\nfunction getCurrentFiberStackAddendum() {\n  {\n    var fiber = ReactDebugCurrentFiber.current;\n    if (fiber === null) {\n      return null;\n    }\n    // Safe because if current fiber exists, we are reconciling,\n    // and it is guaranteed to be the work-in-progress version.\n    return getStackAddendumByWorkInProgressFiber(fiber);\n  }\n  return null;\n}\n\nfunction resetCurrentFiber() {\n  ReactDebugCurrentFrame.getCurrentStack = null;\n  ReactDebugCurrentFiber.current = null;\n  ReactDebugCurrentFiber.phase = null;\n}\n\nfunction setCurrentFiber(fiber) {\n  ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum;\n  ReactDebugCurrentFiber.current = fiber;\n  ReactDebugCurrentFiber.phase = null;\n}\n\nfunction setCurrentPhase(phase) {\n  ReactDebugCurrentFiber.phase = phase;\n}\n\nvar ReactDebugCurrentFiber = {\n  current: null,\n  phase: null,\n  resetCurrentFiber: resetCurrentFiber,\n  setCurrentFiber: setCurrentFiber,\n  setCurrentPhase: setCurrentPhase,\n  getCurrentFiberOwnerName: getCurrentFiberOwnerName,\n  getCurrentFiberStackAddendum: getCurrentFiberStackAddendum\n};\n\n// Prefix measurements so that it's possible to filter them.\n// Longer prefixes are hard to read in DevTools.\nvar reactEmoji = '\\u269B';\nvar warningEmoji = '\\u26D4';\nvar supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';\n\n// Keep track of current fiber so that we know the path to unwind on pause.\n// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?\nvar currentFiber = null;\n// If we're in the middle of user code, which fiber and method is it?\n// Reusing `currentFiber` would be confusing for this because user code fiber\n// can change during commit phase too, but we don't need to unwind it (since\n// lifecycles in the commit phase don't resemble a tree).\nvar currentPhase = null;\nvar currentPhaseFiber = null;\n// Did lifecycle hook schedule an update? This is often a performance problem,\n// so we will keep track of it, and include it in the report.\n// Track commits caused by cascading updates.\nvar isCommitting = false;\nvar hasScheduledUpdateInCurrentCommit = false;\nvar hasScheduledUpdateInCurrentPhase = false;\nvar commitCountInCurrentWorkLoop = 0;\nvar effectCountInCurrentCommit = 0;\nvar isWaitingForCallback = false;\n// During commits, we only show a measurement once per method name\n// to avoid stretch the commit phase with measurement overhead.\nvar labelsInCurrentCommit = new Set();\n\nvar formatMarkName = function (markName) {\n  return reactEmoji + ' ' + markName;\n};\n\nvar formatLabel = function (label, warning) {\n  var prefix = warning ? warningEmoji + ' ' : reactEmoji + ' ';\n  var suffix = warning ? ' Warning: ' + warning : '';\n  return '' + prefix + label + suffix;\n};\n\nvar beginMark = function (markName) {\n  performance.mark(formatMarkName(markName));\n};\n\nvar clearMark = function (markName) {\n  performance.clearMarks(formatMarkName(markName));\n};\n\nvar endMark = function (label, markName, warning) {\n  var formattedMarkName = formatMarkName(markName);\n  var formattedLabel = formatLabel(label, warning);\n  try {\n    performance.measure(formattedLabel, formattedMarkName);\n  } catch (err) {}\n  // If previous mark was missing for some reason, this will throw.\n  // This could only happen if React crashed in an unexpected place earlier.\n  // Don't pile on with more errors.\n\n  // Clear marks immediately to avoid growing buffer.\n  performance.clearMarks(formattedMarkName);\n  performance.clearMeasures(formattedLabel);\n};\n\nvar getFiberMarkName = function (label, debugID) {\n  return label + ' (#' + debugID + ')';\n};\n\nvar getFiberLabel = function (componentName, isMounted, phase) {\n  if (phase === null) {\n    // These are composite component total time measurements.\n    return componentName + ' [' + (isMounted ? 'update' : 'mount') + ']';\n  } else {\n    // Composite component methods.\n    return componentName + '.' + phase;\n  }\n};\n\nvar beginFiberMark = function (fiber, phase) {\n  var componentName = getComponentName(fiber) || 'Unknown';\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n\n  if (isCommitting && labelsInCurrentCommit.has(label)) {\n    // During the commit phase, we don't show duplicate labels because\n    // there is a fixed overhead for every measurement, and we don't\n    // want to stretch the commit phase beyond necessary.\n    return false;\n  }\n  labelsInCurrentCommit.add(label);\n\n  var markName = getFiberMarkName(label, debugID);\n  beginMark(markName);\n  return true;\n};\n\nvar clearFiberMark = function (fiber, phase) {\n  var componentName = getComponentName(fiber) || 'Unknown';\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  var markName = getFiberMarkName(label, debugID);\n  clearMark(markName);\n};\n\nvar endFiberMark = function (fiber, phase, warning) {\n  var componentName = getComponentName(fiber) || 'Unknown';\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  var markName = getFiberMarkName(label, debugID);\n  endMark(label, markName, warning);\n};\n\nvar shouldIgnoreFiber = function (fiber) {\n  // Host components should be skipped in the timeline.\n  // We could check typeof fiber.type, but does this work with RN?\n  switch (fiber.tag) {\n    case HostRoot:\n    case HostComponent:\n    case HostText:\n    case HostPortal:\n    case ReturnComponent:\n    case Fragment:\n      return true;\n    default:\n      return false;\n  }\n};\n\nvar clearPendingPhaseMeasurement = function () {\n  if (currentPhase !== null && currentPhaseFiber !== null) {\n    clearFiberMark(currentPhaseFiber, currentPhase);\n  }\n  currentPhaseFiber = null;\n  currentPhase = null;\n  hasScheduledUpdateInCurrentPhase = false;\n};\n\nvar pauseTimers = function () {\n  // Stops all currently active measurements so that they can be resumed\n  // if we continue in a later deferred loop from the same unit of work.\n  var fiber = currentFiber;\n  while (fiber) {\n    if (fiber._debugIsCurrentlyTiming) {\n      endFiberMark(fiber, null, null);\n    }\n    fiber = fiber['return'];\n  }\n};\n\nvar resumeTimersRecursively = function (fiber) {\n  if (fiber['return'] !== null) {\n    resumeTimersRecursively(fiber['return']);\n  }\n  if (fiber._debugIsCurrentlyTiming) {\n    beginFiberMark(fiber, null);\n  }\n};\n\nvar resumeTimers = function () {\n  // Resumes all measurements that were active during the last deferred loop.\n  if (currentFiber !== null) {\n    resumeTimersRecursively(currentFiber);\n  }\n};\n\nfunction recordEffect() {\n  if (enableUserTimingAPI) {\n    effectCountInCurrentCommit++;\n  }\n}\n\nfunction recordScheduleUpdate() {\n  if (enableUserTimingAPI) {\n    if (isCommitting) {\n      hasScheduledUpdateInCurrentCommit = true;\n    }\n    if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {\n      hasScheduledUpdateInCurrentPhase = true;\n    }\n  }\n}\n\nfunction startRequestCallbackTimer() {\n  if (enableUserTimingAPI) {\n    if (supportsUserTiming && !isWaitingForCallback) {\n      isWaitingForCallback = true;\n      beginMark('(Waiting for async callback...)');\n    }\n  }\n}\n\nfunction stopRequestCallbackTimer(didExpire) {\n  if (enableUserTimingAPI) {\n    if (supportsUserTiming) {\n      isWaitingForCallback = false;\n      var warning = didExpire ? 'React was blocked by main thread' : null;\n      endMark('(Waiting for async callback...)', '(Waiting for async callback...)', warning);\n    }\n  }\n}\n\nfunction startWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // If we pause, this is the fiber to unwind from.\n    currentFiber = fiber;\n    if (!beginFiberMark(fiber, null)) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = true;\n  }\n}\n\nfunction cancelWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // Remember we shouldn't complete measurement for this fiber.\n    // Otherwise flamechart will be deep even for small updates.\n    fiber._debugIsCurrentlyTiming = false;\n    clearFiberMark(fiber, null);\n  }\n}\n\nfunction stopWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // If we pause, its parent is the fiber to unwind from.\n    currentFiber = fiber['return'];\n    if (!fiber._debugIsCurrentlyTiming) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = false;\n    endFiberMark(fiber, null, null);\n  }\n}\n\nfunction stopFailedWorkTimer(fiber) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    }\n    // If we pause, its parent is the fiber to unwind from.\n    currentFiber = fiber['return'];\n    if (!fiber._debugIsCurrentlyTiming) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = false;\n    var warning = 'An error was thrown inside this error boundary';\n    endFiberMark(fiber, null, warning);\n  }\n}\n\nfunction startPhaseTimer(fiber, phase) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    clearPendingPhaseMeasurement();\n    if (!beginFiberMark(fiber, phase)) {\n      return;\n    }\n    currentPhaseFiber = fiber;\n    currentPhase = phase;\n  }\n}\n\nfunction stopPhaseTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    if (currentPhase !== null && currentPhaseFiber !== null) {\n      var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;\n      endFiberMark(currentPhaseFiber, currentPhase, warning);\n    }\n    currentPhase = null;\n    currentPhaseFiber = null;\n  }\n}\n\nfunction startWorkLoopTimer(nextUnitOfWork) {\n  if (enableUserTimingAPI) {\n    currentFiber = nextUnitOfWork;\n    if (!supportsUserTiming) {\n      return;\n    }\n    commitCountInCurrentWorkLoop = 0;\n    // This is top level call.\n    // Any other measurements are performed within.\n    beginMark('(React Tree Reconciliation)');\n    // Resume any measurements that were in progress during the last loop.\n    resumeTimers();\n  }\n}\n\nfunction stopWorkLoopTimer(interruptedBy) {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var warning = null;\n    if (interruptedBy !== null) {\n      if (interruptedBy.tag === HostRoot) {\n        warning = 'A top-level update interrupted the previous render';\n      } else {\n        var componentName = getComponentName(interruptedBy) || 'Unknown';\n        warning = 'An update to ' + componentName + ' interrupted the previous render';\n      }\n    } else if (commitCountInCurrentWorkLoop > 1) {\n      warning = 'There were cascading updates';\n    }\n    commitCountInCurrentWorkLoop = 0;\n    // Pause any measurements until the next loop.\n    pauseTimers();\n    endMark('(React Tree Reconciliation)', '(React Tree Reconciliation)', warning);\n  }\n}\n\nfunction startCommitTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    isCommitting = true;\n    hasScheduledUpdateInCurrentCommit = false;\n    labelsInCurrentCommit.clear();\n    beginMark('(Committing Changes)');\n  }\n}\n\nfunction stopCommitTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n\n    var warning = null;\n    if (hasScheduledUpdateInCurrentCommit) {\n      warning = 'Lifecycle hook scheduled a cascading update';\n    } else if (commitCountInCurrentWorkLoop > 0) {\n      warning = 'Caused by a cascading update in earlier commit';\n    }\n    hasScheduledUpdateInCurrentCommit = false;\n    commitCountInCurrentWorkLoop++;\n    isCommitting = false;\n    labelsInCurrentCommit.clear();\n\n    endMark('(Committing Changes)', '(Committing Changes)', warning);\n  }\n}\n\nfunction startCommitHostEffectsTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark('(Committing Host Effects)');\n  }\n}\n\nfunction stopCommitHostEffectsTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark('(Committing Host Effects: ' + count + ' Total)', '(Committing Host Effects)', null);\n  }\n}\n\nfunction startCommitLifeCyclesTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark('(Calling Lifecycle Methods)');\n  }\n}\n\nfunction stopCommitLifeCyclesTimer() {\n  if (enableUserTimingAPI) {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark('(Calling Lifecycle Methods: ' + count + ' Total)', '(Calling Lifecycle Methods)', null);\n  }\n}\n\n{\n  var warnedAboutMissingGetChildContext = {};\n}\n\n// A cursor to the current merged context object on the stack.\nvar contextStackCursor = createCursor(emptyObject_1);\n// A cursor to a boolean indicating whether the context has changed.\nvar didPerformWorkStackCursor = createCursor(false);\n// Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\nvar previousContext = emptyObject_1;\n\nfunction getUnmaskedContext(workInProgress) {\n  var hasOwnContext = isContextProvider(workInProgress);\n  if (hasOwnContext) {\n    // If the fiber is a context provider itself, when we read its context\n    // we have already pushed its own child context on the stack. A context\n    // provider should not \"see\" its own child context. Therefore we read the\n    // previous (parent) context instead for a context provider.\n    return previousContext;\n  }\n  return contextStackCursor.current;\n}\n\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n  var instance = workInProgress.stateNode;\n  instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n  instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n}\n\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n  var type = workInProgress.type;\n  var contextTypes = type.contextTypes;\n  if (!contextTypes) {\n    return emptyObject_1;\n  }\n\n  // Avoid recreating masked context unless unmasked context has changed.\n  // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n  // This may trigger infinite loops if componentWillReceiveProps calls setState.\n  var instance = workInProgress.stateNode;\n  if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n    return instance.__reactInternalMemoizedMaskedChildContext;\n  }\n\n  var context = {};\n  for (var key in contextTypes) {\n    context[key] = unmaskedContext[key];\n  }\n\n  {\n    var name = getComponentName(workInProgress) || 'Unknown';\n    checkPropTypes_1(contextTypes, context, 'context', name, ReactDebugCurrentFiber.getCurrentFiberStackAddendum);\n  }\n\n  // Cache unmasked context so we can avoid recreating masked context unless necessary.\n  // Context is created before the class component is instantiated so check for instance.\n  if (instance) {\n    cacheContext(workInProgress, unmaskedContext, context);\n  }\n\n  return context;\n}\n\nfunction hasContextChanged() {\n  return didPerformWorkStackCursor.current;\n}\n\nfunction isContextConsumer(fiber) {\n  return fiber.tag === ClassComponent && fiber.type.contextTypes != null;\n}\n\nfunction isContextProvider(fiber) {\n  return fiber.tag === ClassComponent && fiber.type.childContextTypes != null;\n}\n\nfunction popContextProvider(fiber) {\n  if (!isContextProvider(fiber)) {\n    return;\n  }\n\n  pop(didPerformWorkStackCursor, fiber);\n  pop(contextStackCursor, fiber);\n}\n\nfunction popTopLevelContextObject(fiber) {\n  pop(didPerformWorkStackCursor, fiber);\n  pop(contextStackCursor, fiber);\n}\n\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n  !(contextStackCursor.cursor == null) ? invariant_1(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n  push(contextStackCursor, context, fiber);\n  push(didPerformWorkStackCursor, didChange, fiber);\n}\n\nfunction processChildContext(fiber, parentContext) {\n  var instance = fiber.stateNode;\n  var childContextTypes = fiber.type.childContextTypes;\n\n  // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n  // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n  if (typeof instance.getChildContext !== 'function') {\n    {\n      var componentName = getComponentName(fiber) || 'Unknown';\n\n      if (!warnedAboutMissingGetChildContext[componentName]) {\n        warnedAboutMissingGetChildContext[componentName] = true;\n        warning_1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);\n      }\n    }\n    return parentContext;\n  }\n\n  var childContext = void 0;\n  {\n    ReactDebugCurrentFiber.setCurrentPhase('getChildContext');\n  }\n  startPhaseTimer(fiber, 'getChildContext');\n  childContext = instance.getChildContext();\n  stopPhaseTimer();\n  {\n    ReactDebugCurrentFiber.setCurrentPhase(null);\n  }\n  for (var contextKey in childContext) {\n    !(contextKey in childContextTypes) ? invariant_1(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(fiber) || 'Unknown', contextKey) : void 0;\n  }\n  {\n    var name = getComponentName(fiber) || 'Unknown';\n    checkPropTypes_1(childContextTypes, childContext, 'child context', name,\n    // In practice, there is one case in which we won't get a stack. It's when\n    // somebody calls unstable_renderSubtreeIntoContainer() and we process\n    // context from the parent component instance. The stack will be missing\n    // because it's outside of the reconciliation, and so the pointer has not\n    // been set. This is rare and doesn't matter. We'll also remove that API.\n    ReactDebugCurrentFiber.getCurrentFiberStackAddendum);\n  }\n\n  return _assign({}, parentContext, childContext);\n}\n\nfunction pushContextProvider(workInProgress) {\n  if (!isContextProvider(workInProgress)) {\n    return false;\n  }\n\n  var instance = workInProgress.stateNode;\n  // We push the context as early as possible to ensure stack integrity.\n  // If the instance does not exist yet, we will push null at first,\n  // and replace it on the stack later when invalidating the context.\n  var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject_1;\n\n  // Remember the parent context so we can merge with it later.\n  // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n  previousContext = contextStackCursor.current;\n  push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n  push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n\n  return true;\n}\n\nfunction invalidateContextProvider(workInProgress, didChange) {\n  var instance = workInProgress.stateNode;\n  !instance ? invariant_1(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n  if (didChange) {\n    // Merge parent and own context.\n    // Skip this if we're not updating due to sCU.\n    // This avoids unnecessarily recomputing memoized values.\n    var mergedContext = processChildContext(workInProgress, previousContext);\n    instance.__reactInternalMemoizedMergedChildContext = mergedContext;\n\n    // Replace the old (or empty) context with the new one.\n    // It is important to unwind the context in the reverse order.\n    pop(didPerformWorkStackCursor, workInProgress);\n    pop(contextStackCursor, workInProgress);\n    // Now push the new context and mark that it has changed.\n    push(contextStackCursor, mergedContext, workInProgress);\n    push(didPerformWorkStackCursor, didChange, workInProgress);\n  } else {\n    pop(didPerformWorkStackCursor, workInProgress);\n    push(didPerformWorkStackCursor, didChange, workInProgress);\n  }\n}\n\nfunction resetContext() {\n  previousContext = emptyObject_1;\n  contextStackCursor.current = emptyObject_1;\n  didPerformWorkStackCursor.current = false;\n}\n\nfunction findCurrentUnmaskedContext(fiber) {\n  // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n  // makes sense elsewhere\n  !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant_1(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n  var node = fiber;\n  while (node.tag !== HostRoot) {\n    if (isContextProvider(node)) {\n      return node.stateNode.__reactInternalMemoizedMergedChildContext;\n    }\n    var parent = node['return'];\n    !parent ? invariant_1(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    node = parent;\n  }\n  return node.stateNode.context;\n}\n\nvar NoWork = 0; // TODO: Use an opaque type once ESLint et al support the syntax\n\nvar Sync = 1;\nvar Never = 2147483647; // Max int32: Math.pow(2, 31) - 1\n\nvar UNIT_SIZE = 10;\nvar MAGIC_NUMBER_OFFSET = 2;\n\n// 1 unit of expiration time represents 10ms.\nfunction msToExpirationTime(ms) {\n  // Always add an offset so that we don't clash with the magic number for NoWork.\n  return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;\n}\n\nfunction expirationTimeToMs(expirationTime) {\n  return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE;\n}\n\nfunction ceiling(num, precision) {\n  return ((num / precision | 0) + 1) * precision;\n}\n\nfunction computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {\n  return ceiling(currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);\n}\n\nvar NoContext = 0;\nvar AsyncUpdates = 1;\n\n{\n  var hasBadMapPolyfill = false;\n  try {\n    var nonExtensibleObject = Object.preventExtensions({});\n    /* eslint-disable no-new */\n    \n    /* eslint-enable no-new */\n  } catch (e) {\n    // TODO: Consider warning about bad polyfills\n    hasBadMapPolyfill = true;\n  }\n}\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\n\n{\n  var debugCounter = 1;\n}\n\nfunction FiberNode(tag, key, internalContextTag) {\n  // Instance\n  this.tag = tag;\n  this.key = key;\n  this.type = null;\n  this.stateNode = null;\n\n  // Fiber\n  this['return'] = null;\n  this.child = null;\n  this.sibling = null;\n  this.index = 0;\n\n  this.ref = null;\n\n  this.pendingProps = null;\n  this.memoizedProps = null;\n  this.updateQueue = null;\n  this.memoizedState = null;\n\n  this.internalContextTag = internalContextTag;\n\n  // Effects\n  this.effectTag = NoEffect;\n  this.nextEffect = null;\n\n  this.firstEffect = null;\n  this.lastEffect = null;\n\n  this.expirationTime = NoWork;\n\n  this.alternate = null;\n\n  {\n    this._debugID = debugCounter++;\n    this._debugSource = null;\n    this._debugOwner = null;\n    this._debugIsCurrentlyTiming = false;\n    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n      Object.preventExtensions(this);\n    }\n  }\n}\n\n// This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n//    more difficult to predict when they get optimized and they are almost\n//    never inlined properly in static compilers.\n// 2) Nobody should rely on `instanceof Fiber` for type testing. We should\n//    always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n//    to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n//    is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n//    compatible.\nvar createFiber = function (tag, key, internalContextTag) {\n  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n  return new FiberNode(tag, key, internalContextTag);\n};\n\nfunction shouldConstruct(Component) {\n  return !!(Component.prototype && Component.prototype.isReactComponent);\n}\n\n// This is used to create an alternate fiber to do work on.\nfunction createWorkInProgress(current, pendingProps, expirationTime) {\n  var workInProgress = current.alternate;\n  if (workInProgress === null) {\n    // We use a double buffering pooling technique because we know that we'll\n    // only ever need at most two versions of a tree. We pool the \"other\" unused\n    // node that we're free to reuse. This is lazily created to avoid allocating\n    // extra objects for things that are never updated. It also allow us to\n    // reclaim the extra memory if needed.\n    workInProgress = createFiber(current.tag, current.key, current.internalContextTag);\n    workInProgress.type = current.type;\n    workInProgress.stateNode = current.stateNode;\n\n    {\n      // DEV-only fields\n      workInProgress._debugID = current._debugID;\n      workInProgress._debugSource = current._debugSource;\n      workInProgress._debugOwner = current._debugOwner;\n    }\n\n    workInProgress.alternate = current;\n    current.alternate = workInProgress;\n  } else {\n    // We already have an alternate.\n    // Reset the effect tag.\n    workInProgress.effectTag = NoEffect;\n\n    // The effect list is no longer valid.\n    workInProgress.nextEffect = null;\n    workInProgress.firstEffect = null;\n    workInProgress.lastEffect = null;\n  }\n\n  workInProgress.expirationTime = expirationTime;\n  workInProgress.pendingProps = pendingProps;\n\n  workInProgress.child = current.child;\n  workInProgress.memoizedProps = current.memoizedProps;\n  workInProgress.memoizedState = current.memoizedState;\n  workInProgress.updateQueue = current.updateQueue;\n\n  // These will be overridden during the parent's reconciliation\n  workInProgress.sibling = current.sibling;\n  workInProgress.index = current.index;\n  workInProgress.ref = current.ref;\n\n  return workInProgress;\n}\n\nfunction createHostRootFiber() {\n  var fiber = createFiber(HostRoot, null, NoContext);\n  return fiber;\n}\n\nfunction createFiberFromElement(element, internalContextTag, expirationTime) {\n  var owner = null;\n  {\n    owner = element._owner;\n  }\n\n  var fiber = void 0;\n  var type = element.type,\n      key = element.key;\n\n  if (typeof type === 'function') {\n    fiber = shouldConstruct(type) ? createFiber(ClassComponent, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag);\n    fiber.type = type;\n    fiber.pendingProps = element.props;\n  } else if (typeof type === 'string') {\n    fiber = createFiber(HostComponent, key, internalContextTag);\n    fiber.type = type;\n    fiber.pendingProps = element.props;\n  } else if (typeof type === 'object' && type !== null && typeof type.tag === 'number') {\n    // Currently assumed to be a continuation and therefore is a fiber already.\n    // TODO: The yield system is currently broken for updates in some cases.\n    // The reified yield stores a fiber, but we don't know which fiber that is;\n    // the current or a workInProgress? When the continuation gets rendered here\n    // we don't know if we can reuse that fiber or if we need to clone it.\n    // There is probably a clever way to restructure this.\n    fiber = type;\n    fiber.pendingProps = element.props;\n  } else {\n    var info = '';\n    {\n      if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n        info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n      }\n      var ownerName = owner ? getComponentName(owner) : null;\n      if (ownerName) {\n        info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n      }\n    }\n    invariant_1(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info);\n  }\n\n  {\n    fiber._debugSource = element._source;\n    fiber._debugOwner = element._owner;\n  }\n\n  fiber.expirationTime = expirationTime;\n\n  return fiber;\n}\n\nfunction createFiberFromFragment(elements, internalContextTag, expirationTime, key) {\n  var fiber = createFiber(Fragment, key, internalContextTag);\n  fiber.pendingProps = elements;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromText(content, internalContextTag, expirationTime) {\n  var fiber = createFiber(HostText, null, internalContextTag);\n  fiber.pendingProps = content;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromHostInstanceForDeletion() {\n  var fiber = createFiber(HostComponent, null, NoContext);\n  fiber.type = 'DELETED';\n  return fiber;\n}\n\nfunction createFiberFromCall(call, internalContextTag, expirationTime) {\n  var fiber = createFiber(CallComponent, call.key, internalContextTag);\n  fiber.type = call.handler;\n  fiber.pendingProps = call;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromReturn(returnNode, internalContextTag, expirationTime) {\n  var fiber = createFiber(ReturnComponent, null, internalContextTag);\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\n\nfunction createFiberFromPortal(portal, internalContextTag, expirationTime) {\n  var fiber = createFiber(HostPortal, portal.key, internalContextTag);\n  fiber.pendingProps = portal.children || [];\n  fiber.expirationTime = expirationTime;\n  fiber.stateNode = {\n    containerInfo: portal.containerInfo,\n    pendingChildren: null, // Used by persistent updates\n    implementation: portal.implementation\n  };\n  return fiber;\n}\n\nfunction createFiberRoot(containerInfo, hydrate) {\n  // Cyclic construction. This cheats the type system right now because\n  // stateNode is any.\n  var uninitializedFiber = createHostRootFiber();\n  var root = {\n    current: uninitializedFiber,\n    containerInfo: containerInfo,\n    pendingChildren: null,\n    remainingExpirationTime: NoWork,\n    isReadyForCommit: false,\n    finishedWork: null,\n    context: null,\n    pendingContext: null,\n    hydrate: hydrate,\n    nextScheduledRoot: null\n  };\n  uninitializedFiber.stateNode = root;\n  return root;\n}\n\nvar onCommitFiberRoot = null;\nvar onCommitFiberUnmount = null;\nvar hasLoggedError = false;\n\nfunction catchErrors(fn) {\n  return function (arg) {\n    try {\n      return fn(arg);\n    } catch (err) {\n      if (true && !hasLoggedError) {\n        hasLoggedError = true;\n        warning_1(false, 'React DevTools encountered an error: %s', err);\n      }\n    }\n  };\n}\n\nfunction injectInternals(internals) {\n  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n    // No DevTools\n    return false;\n  }\n  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n  if (hook.isDisabled) {\n    // This isn't a real property on the hook, but it can be set to opt out\n    // of DevTools integration and associated warnings and logs.\n    // https://github.com/facebook/react/issues/3877\n    return true;\n  }\n  if (!hook.supportsFiber) {\n    {\n      warning_1(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');\n    }\n    // DevTools exists, even though it doesn't support Fiber.\n    return true;\n  }\n  try {\n    var rendererID = hook.inject(internals);\n    // We have successfully injected, so now it is safe to set up hooks.\n    onCommitFiberRoot = catchErrors(function (root) {\n      return hook.onCommitFiberRoot(rendererID, root);\n    });\n    onCommitFiberUnmount = catchErrors(function (fiber) {\n      return hook.onCommitFiberUnmount(rendererID, fiber);\n    });\n  } catch (err) {\n    // Catch all errors because it is unsafe to throw during initialization.\n    {\n      warning_1(false, 'React DevTools encountered an error: %s.', err);\n    }\n  }\n  // DevTools exists\n  return true;\n}\n\nfunction onCommitRoot(root) {\n  if (typeof onCommitFiberRoot === 'function') {\n    onCommitFiberRoot(root);\n  }\n}\n\nfunction onCommitUnmount(fiber) {\n  if (typeof onCommitFiberUnmount === 'function') {\n    onCommitFiberUnmount(fiber);\n  }\n}\n\n{\n  var didWarnUpdateInsideUpdate = false;\n}\n\n// Callbacks are not validated until invocation\n\n\n// Singly linked-list of updates. When an update is scheduled, it is added to\n// the queue of the current fiber and the work-in-progress fiber. The two queues\n// are separate but they share a persistent structure.\n//\n// During reconciliation, updates are removed from the work-in-progress fiber,\n// but they remain on the current fiber. That ensures that if a work-in-progress\n// is aborted, the aborted updates are recovered by cloning from current.\n//\n// The work-in-progress queue is always a subset of the current queue.\n//\n// When the tree is committed, the work-in-progress becomes the current.\n\n\nfunction createUpdateQueue(baseState) {\n  var queue = {\n    baseState: baseState,\n    expirationTime: NoWork,\n    first: null,\n    last: null,\n    callbackList: null,\n    hasForceUpdate: false,\n    isInitialized: false\n  };\n  {\n    queue.isProcessing = false;\n  }\n  return queue;\n}\n\nfunction insertUpdateIntoQueue(queue, update) {\n  // Append the update to the end of the list.\n  if (queue.last === null) {\n    // Queue is empty\n    queue.first = queue.last = update;\n  } else {\n    queue.last.next = update;\n    queue.last = update;\n  }\n  if (queue.expirationTime === NoWork || queue.expirationTime > update.expirationTime) {\n    queue.expirationTime = update.expirationTime;\n  }\n}\n\nfunction insertUpdateIntoFiber(fiber, update) {\n  // We'll have at least one and at most two distinct update queues.\n  var alternateFiber = fiber.alternate;\n  var queue1 = fiber.updateQueue;\n  if (queue1 === null) {\n    // TODO: We don't know what the base state will be until we begin work.\n    // It depends on which fiber is the next current. Initialize with an empty\n    // base state, then set to the memoizedState when rendering. Not super\n    // happy with this approach.\n    queue1 = fiber.updateQueue = createUpdateQueue(null);\n  }\n\n  var queue2 = void 0;\n  if (alternateFiber !== null) {\n    queue2 = alternateFiber.updateQueue;\n    if (queue2 === null) {\n      queue2 = alternateFiber.updateQueue = createUpdateQueue(null);\n    }\n  } else {\n    queue2 = null;\n  }\n  queue2 = queue2 !== queue1 ? queue2 : null;\n\n  // Warn if an update is scheduled from inside an updater function.\n  {\n    if ((queue1.isProcessing || queue2 !== null && queue2.isProcessing) && !didWarnUpdateInsideUpdate) {\n      warning_1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');\n      didWarnUpdateInsideUpdate = true;\n    }\n  }\n\n  // If there's only one queue, add the update to that queue and exit.\n  if (queue2 === null) {\n    insertUpdateIntoQueue(queue1, update);\n    return;\n  }\n\n  // If either queue is empty, we need to add to both queues.\n  if (queue1.last === null || queue2.last === null) {\n    insertUpdateIntoQueue(queue1, update);\n    insertUpdateIntoQueue(queue2, update);\n    return;\n  }\n\n  // If both lists are not empty, the last update is the same for both lists\n  // because of structural sharing. So, we should only append to one of\n  // the lists.\n  insertUpdateIntoQueue(queue1, update);\n  // But we still need to update the `last` pointer of queue2.\n  queue2.last = update;\n}\n\nfunction getUpdateExpirationTime(fiber) {\n  if (fiber.tag !== ClassComponent && fiber.tag !== HostRoot) {\n    return NoWork;\n  }\n  var updateQueue = fiber.updateQueue;\n  if (updateQueue === null) {\n    return NoWork;\n  }\n  return updateQueue.expirationTime;\n}\n\nfunction getStateFromUpdate(update, instance, prevState, props) {\n  var partialState = update.partialState;\n  if (typeof partialState === 'function') {\n    var updateFn = partialState;\n\n    // Invoke setState callback an extra time to help detect side-effects.\n    if (debugRenderPhaseSideEffects) {\n      updateFn.call(instance, prevState, props);\n    }\n\n    return updateFn.call(instance, prevState, props);\n  } else {\n    return partialState;\n  }\n}\n\nfunction processUpdateQueue(current, workInProgress, queue, instance, props, renderExpirationTime) {\n  if (current !== null && current.updateQueue === queue) {\n    // We need to create a work-in-progress queue, by cloning the current queue.\n    var currentQueue = queue;\n    queue = workInProgress.updateQueue = {\n      baseState: currentQueue.baseState,\n      expirationTime: currentQueue.expirationTime,\n      first: currentQueue.first,\n      last: currentQueue.last,\n      isInitialized: currentQueue.isInitialized,\n      // These fields are no longer valid because they were already committed.\n      // Reset them.\n      callbackList: null,\n      hasForceUpdate: false\n    };\n  }\n\n  {\n    // Set this flag so we can warn if setState is called inside the update\n    // function of another setState.\n    queue.isProcessing = true;\n  }\n\n  // Reset the remaining expiration time. If we skip over any updates, we'll\n  // increase this accordingly.\n  queue.expirationTime = NoWork;\n\n  // TODO: We don't know what the base state will be until we begin work.\n  // It depends on which fiber is the next current. Initialize with an empty\n  // base state, then set to the memoizedState when rendering. Not super\n  // happy with this approach.\n  var state = void 0;\n  if (queue.isInitialized) {\n    state = queue.baseState;\n  } else {\n    state = queue.baseState = workInProgress.memoizedState;\n    queue.isInitialized = true;\n  }\n  var dontMutatePrevState = true;\n  var update = queue.first;\n  var didSkip = false;\n  while (update !== null) {\n    var updateExpirationTime = update.expirationTime;\n    if (updateExpirationTime > renderExpirationTime) {\n      // This update does not have sufficient priority. Skip it.\n      var remainingExpirationTime = queue.expirationTime;\n      if (remainingExpirationTime === NoWork || remainingExpirationTime > updateExpirationTime) {\n        // Update the remaining expiration time.\n        queue.expirationTime = updateExpirationTime;\n      }\n      if (!didSkip) {\n        didSkip = true;\n        queue.baseState = state;\n      }\n      // Continue to the next update.\n      update = update.next;\n      continue;\n    }\n\n    // This update does have sufficient priority.\n\n    // If no previous updates were skipped, drop this update from the queue by\n    // advancing the head of the list.\n    if (!didSkip) {\n      queue.first = update.next;\n      if (queue.first === null) {\n        queue.last = null;\n      }\n    }\n\n    // Process the update\n    var _partialState = void 0;\n    if (update.isReplace) {\n      state = getStateFromUpdate(update, instance, state, props);\n      dontMutatePrevState = true;\n    } else {\n      _partialState = getStateFromUpdate(update, instance, state, props);\n      if (_partialState) {\n        if (dontMutatePrevState) {\n          // $FlowFixMe: Idk how to type this properly.\n          state = _assign({}, state, _partialState);\n        } else {\n          state = _assign(state, _partialState);\n        }\n        dontMutatePrevState = false;\n      }\n    }\n    if (update.isForced) {\n      queue.hasForceUpdate = true;\n    }\n    if (update.callback !== null) {\n      // Append to list of callbacks.\n      var _callbackList = queue.callbackList;\n      if (_callbackList === null) {\n        _callbackList = queue.callbackList = [];\n      }\n      _callbackList.push(update);\n    }\n    update = update.next;\n  }\n\n  if (queue.callbackList !== null) {\n    workInProgress.effectTag |= Callback;\n  } else if (queue.first === null && !queue.hasForceUpdate) {\n    // The queue is empty. We can reset it.\n    workInProgress.updateQueue = null;\n  }\n\n  if (!didSkip) {\n    didSkip = true;\n    queue.baseState = state;\n  }\n\n  {\n    // No longer processing.\n    queue.isProcessing = false;\n  }\n\n  return state;\n}\n\nfunction commitCallbacks(queue, context) {\n  var callbackList = queue.callbackList;\n  if (callbackList === null) {\n    return;\n  }\n  // Set the list to null to make sure they don't get called more than once.\n  queue.callbackList = null;\n  for (var i = 0; i < callbackList.length; i++) {\n    var update = callbackList[i];\n    var _callback = update.callback;\n    // This update might be processed again. Clear the callback so it's only\n    // called once.\n    update.callback = null;\n    !(typeof _callback === 'function') ? invariant_1(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback) : void 0;\n    _callback.call(context);\n  }\n}\n\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray;\n\n{\n  var didWarnAboutStateAssignmentForComponent = {};\n\n  var warnOnInvalidCallback = function (callback, callerName) {\n    warning_1(callback === null || typeof callback === 'function', '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n  };\n\n  // This is so gross but it's at least non-critical and can be removed if\n  // it causes problems. This is meant to give a nicer error message for\n  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n  // ...)) which otherwise throws a \"_processChildContext is not a function\"\n  // exception.\n  Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n    enumerable: false,\n    value: function () {\n      invariant_1(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).');\n    }\n  });\n  Object.freeze(fakeInternalInstance);\n}\n\nvar ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) {\n  // Class component state updater\n  var updater = {\n    isMounted: isMounted,\n    enqueueSetState: function (instance, partialState, callback) {\n      var fiber = get(instance);\n      callback = callback === undefined ? null : callback;\n      {\n        warnOnInvalidCallback(callback, 'setState');\n      }\n      var expirationTime = computeExpirationForFiber(fiber);\n      var update = {\n        expirationTime: expirationTime,\n        partialState: partialState,\n        callback: callback,\n        isReplace: false,\n        isForced: false,\n        nextCallback: null,\n        next: null\n      };\n      insertUpdateIntoFiber(fiber, update);\n      scheduleWork(fiber, expirationTime);\n    },\n    enqueueReplaceState: function (instance, state, callback) {\n      var fiber = get(instance);\n      callback = callback === undefined ? null : callback;\n      {\n        warnOnInvalidCallback(callback, 'replaceState');\n      }\n      var expirationTime = computeExpirationForFiber(fiber);\n      var update = {\n        expirationTime: expirationTime,\n        partialState: state,\n        callback: callback,\n        isReplace: true,\n        isForced: false,\n        nextCallback: null,\n        next: null\n      };\n      insertUpdateIntoFiber(fiber, update);\n      scheduleWork(fiber, expirationTime);\n    },\n    enqueueForceUpdate: function (instance, callback) {\n      var fiber = get(instance);\n      callback = callback === undefined ? null : callback;\n      {\n        warnOnInvalidCallback(callback, 'forceUpdate');\n      }\n      var expirationTime = computeExpirationForFiber(fiber);\n      var update = {\n        expirationTime: expirationTime,\n        partialState: null,\n        callback: callback,\n        isReplace: false,\n        isForced: true,\n        nextCallback: null,\n        next: null\n      };\n      insertUpdateIntoFiber(fiber, update);\n      scheduleWork(fiber, expirationTime);\n    }\n  };\n\n  function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) {\n    if (oldProps === null || workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate) {\n      // If the workInProgress already has an Update effect, return true\n      return true;\n    }\n\n    var instance = workInProgress.stateNode;\n    var type = workInProgress.type;\n    if (typeof instance.shouldComponentUpdate === 'function') {\n      startPhaseTimer(workInProgress, 'shouldComponentUpdate');\n      var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext);\n      stopPhaseTimer();\n\n      // Simulate an async bailout/interruption by invoking lifecycle twice.\n      if (debugRenderPhaseSideEffects) {\n        instance.shouldComponentUpdate(newProps, newState, newContext);\n      }\n\n      {\n        warning_1(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Unknown');\n      }\n\n      return shouldUpdate;\n    }\n\n    if (type.prototype && type.prototype.isPureReactComponent) {\n      return !shallowEqual_1(oldProps, newProps) || !shallowEqual_1(oldState, newState);\n    }\n\n    return true;\n  }\n\n  function checkClassInstance(workInProgress) {\n    var instance = workInProgress.stateNode;\n    var type = workInProgress.type;\n    {\n      var name = getComponentName(workInProgress);\n      var renderPresent = instance.render;\n\n      if (!renderPresent) {\n        if (type.prototype && typeof type.prototype.render === 'function') {\n          warning_1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n        } else {\n          warning_1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);\n        }\n      }\n\n      var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;\n      warning_1(noGetInitialStateOnES6, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);\n      var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;\n      warning_1(noGetDefaultPropsOnES6, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);\n      var noInstancePropTypes = !instance.propTypes;\n      warning_1(noInstancePropTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n      var noInstanceContextTypes = !instance.contextTypes;\n      warning_1(noInstanceContextTypes, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n      var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';\n      warning_1(noComponentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);\n      if (type.prototype && type.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n        warning_1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(workInProgress) || 'A pure component');\n      }\n      var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';\n      warning_1(noComponentDidUnmount, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n      var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';\n      warning_1(noComponentDidReceiveProps, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n      var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';\n      warning_1(noComponentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n      var hasMutatedProps = instance.props !== workInProgress.pendingProps;\n      warning_1(instance.props === undefined || !hasMutatedProps, '%s(...): When calling super() in `%s`, make sure to pass ' + \"up the same props that your component's constructor was passed.\", name, name);\n      var noInstanceDefaultProps = !instance.defaultProps;\n      warning_1(noInstanceDefaultProps, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);\n    }\n\n    var state = instance.state;\n    if (state && (typeof state !== 'object' || isArray(state))) {\n      warning_1(false, '%s.state: must be set to an object or null', getComponentName(workInProgress));\n    }\n    if (typeof instance.getChildContext === 'function') {\n      warning_1(typeof workInProgress.type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(workInProgress));\n    }\n  }\n\n  function resetInputPointers(workInProgress, instance) {\n    instance.props = workInProgress.memoizedProps;\n    instance.state = workInProgress.memoizedState;\n  }\n\n  function adoptClassInstance(workInProgress, instance) {\n    instance.updater = updater;\n    workInProgress.stateNode = instance;\n    // The instance needs access to the fiber so that it can schedule updates\n    set(instance, workInProgress);\n    {\n      instance._reactInternalInstance = fakeInternalInstance;\n    }\n  }\n\n  function constructClassInstance(workInProgress, props) {\n    var ctor = workInProgress.type;\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n    var needsContext = isContextConsumer(workInProgress);\n    var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject_1;\n    var instance = new ctor(props, context);\n    adoptClassInstance(workInProgress, instance);\n\n    // Cache unmasked context so we can avoid recreating masked context unless necessary.\n    // ReactFiberContext usually updates this cache but can't for newly-created instances.\n    if (needsContext) {\n      cacheContext(workInProgress, unmaskedContext, context);\n    }\n\n    return instance;\n  }\n\n  function callComponentWillMount(workInProgress, instance) {\n    startPhaseTimer(workInProgress, 'componentWillMount');\n    var oldState = instance.state;\n    instance.componentWillMount();\n    stopPhaseTimer();\n\n    // Simulate an async bailout/interruption by invoking lifecycle twice.\n    if (debugRenderPhaseSideEffects) {\n      instance.componentWillMount();\n    }\n\n    if (oldState !== instance.state) {\n      {\n        warning_1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + \"deprecated (except inside a component's \" + 'constructor). Use setState instead.', getComponentName(workInProgress));\n      }\n      updater.enqueueReplaceState(instance, instance.state, null);\n    }\n  }\n\n  function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {\n    startPhaseTimer(workInProgress, 'componentWillReceiveProps');\n    var oldState = instance.state;\n    instance.componentWillReceiveProps(newProps, newContext);\n    stopPhaseTimer();\n\n    // Simulate an async bailout/interruption by invoking lifecycle twice.\n    if (debugRenderPhaseSideEffects) {\n      instance.componentWillReceiveProps(newProps, newContext);\n    }\n\n    if (instance.state !== oldState) {\n      {\n        var componentName = getComponentName(workInProgress) || 'Component';\n        if (!didWarnAboutStateAssignmentForComponent[componentName]) {\n          warning_1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + \"this.state is deprecated (except inside a component's \" + 'constructor). Use setState instead.', componentName);\n          didWarnAboutStateAssignmentForComponent[componentName] = true;\n        }\n      }\n      updater.enqueueReplaceState(instance, instance.state, null);\n    }\n  }\n\n  // Invokes the mount life-cycles on a previously never rendered instance.\n  function mountClassInstance(workInProgress, renderExpirationTime) {\n    var current = workInProgress.alternate;\n\n    {\n      checkClassInstance(workInProgress);\n    }\n\n    var instance = workInProgress.stateNode;\n    var state = instance.state || null;\n\n    var props = workInProgress.pendingProps;\n    !props ? invariant_1(false, 'There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n\n    instance.props = props;\n    instance.state = workInProgress.memoizedState = state;\n    instance.refs = emptyObject_1;\n    instance.context = getMaskedContext(workInProgress, unmaskedContext);\n\n    if (enableAsyncSubtreeAPI && workInProgress.type != null && workInProgress.type.prototype != null && workInProgress.type.prototype.unstable_isAsyncReactComponent === true) {\n      workInProgress.internalContextTag |= AsyncUpdates;\n    }\n\n    if (typeof instance.componentWillMount === 'function') {\n      callComponentWillMount(workInProgress, instance);\n      // If we had additional state updates during this life-cycle, let's\n      // process them now.\n      var updateQueue = workInProgress.updateQueue;\n      if (updateQueue !== null) {\n        instance.state = processUpdateQueue(current, workInProgress, updateQueue, instance, props, renderExpirationTime);\n      }\n    }\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.effectTag |= Update;\n    }\n  }\n\n  // Called on a preexisting class instance. Returns false if a resumed render\n  // could be reused.\n  // function resumeMountClassInstance(\n  //   workInProgress: Fiber,\n  //   priorityLevel: PriorityLevel,\n  // ): boolean {\n  //   const instance = workInProgress.stateNode;\n  //   resetInputPointers(workInProgress, instance);\n\n  //   let newState = workInProgress.memoizedState;\n  //   let newProps = workInProgress.pendingProps;\n  //   if (!newProps) {\n  //     // If there isn't any new props, then we'll reuse the memoized props.\n  //     // This could be from already completed work.\n  //     newProps = workInProgress.memoizedProps;\n  //     invariant(\n  //       newProps != null,\n  //       'There should always be pending or memoized props. This error is ' +\n  //         'likely caused by a bug in React. Please file an issue.',\n  //     );\n  //   }\n  //   const newUnmaskedContext = getUnmaskedContext(workInProgress);\n  //   const newContext = getMaskedContext(workInProgress, newUnmaskedContext);\n\n  //   const oldContext = instance.context;\n  //   const oldProps = workInProgress.memoizedProps;\n\n  //   if (\n  //     typeof instance.componentWillReceiveProps === 'function' &&\n  //     (oldProps !== newProps || oldContext !== newContext)\n  //   ) {\n  //     callComponentWillReceiveProps(\n  //       workInProgress,\n  //       instance,\n  //       newProps,\n  //       newContext,\n  //     );\n  //   }\n\n  //   // Process the update queue before calling shouldComponentUpdate\n  //   const updateQueue = workInProgress.updateQueue;\n  //   if (updateQueue !== null) {\n  //     newState = processUpdateQueue(\n  //       workInProgress,\n  //       updateQueue,\n  //       instance,\n  //       newState,\n  //       newProps,\n  //       priorityLevel,\n  //     );\n  //   }\n\n  //   // TODO: Should we deal with a setState that happened after the last\n  //   // componentWillMount and before this componentWillMount? Probably\n  //   // unsupported anyway.\n\n  //   if (\n  //     !checkShouldComponentUpdate(\n  //       workInProgress,\n  //       workInProgress.memoizedProps,\n  //       newProps,\n  //       workInProgress.memoizedState,\n  //       newState,\n  //       newContext,\n  //     )\n  //   ) {\n  //     // Update the existing instance's state, props, and context pointers even\n  //     // though we're bailing out.\n  //     instance.props = newProps;\n  //     instance.state = newState;\n  //     instance.context = newContext;\n  //     return false;\n  //   }\n\n  //   // Update the input pointers now so that they are correct when we call\n  //   // componentWillMount\n  //   instance.props = newProps;\n  //   instance.state = newState;\n  //   instance.context = newContext;\n\n  //   if (typeof instance.componentWillMount === 'function') {\n  //     callComponentWillMount(workInProgress, instance);\n  //     // componentWillMount may have called setState. Process the update queue.\n  //     const newUpdateQueue = workInProgress.updateQueue;\n  //     if (newUpdateQueue !== null) {\n  //       newState = processUpdateQueue(\n  //         workInProgress,\n  //         newUpdateQueue,\n  //         instance,\n  //         newState,\n  //         newProps,\n  //         priorityLevel,\n  //       );\n  //     }\n  //   }\n\n  //   if (typeof instance.componentDidMount === 'function') {\n  //     workInProgress.effectTag |= Update;\n  //   }\n\n  //   instance.state = newState;\n\n  //   return true;\n  // }\n\n  // Invokes the update life-cycles and returns false if it shouldn't rerender.\n  function updateClassInstance(current, workInProgress, renderExpirationTime) {\n    var instance = workInProgress.stateNode;\n    resetInputPointers(workInProgress, instance);\n\n    var oldProps = workInProgress.memoizedProps;\n    var newProps = workInProgress.pendingProps;\n    if (!newProps) {\n      // If there aren't any new props, then we'll reuse the memoized props.\n      // This could be from already completed work.\n      newProps = oldProps;\n      !(newProps != null) ? invariant_1(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    }\n    var oldContext = instance.context;\n    var newUnmaskedContext = getUnmaskedContext(workInProgress);\n    var newContext = getMaskedContext(workInProgress, newUnmaskedContext);\n\n    // Note: During these life-cycles, instance.props/instance.state are what\n    // ever the previously attempted to render - not the \"current\". However,\n    // during componentDidUpdate we pass the \"current\" props.\n\n    if (typeof instance.componentWillReceiveProps === 'function' && (oldProps !== newProps || oldContext !== newContext)) {\n      callComponentWillReceiveProps(workInProgress, instance, newProps, newContext);\n    }\n\n    // Compute the next state using the memoized state and the update queue.\n    var oldState = workInProgress.memoizedState;\n    // TODO: Previous state can be null.\n    var newState = void 0;\n    if (workInProgress.updateQueue !== null) {\n      newState = processUpdateQueue(current, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime);\n    } else {\n      newState = oldState;\n    }\n\n    if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) {\n      // If an update was already in progress, we should schedule an Update\n      // effect even though we're bailing out, so that cWU/cDU are called.\n      if (typeof instance.componentDidUpdate === 'function') {\n        if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n          workInProgress.effectTag |= Update;\n        }\n      }\n      return false;\n    }\n\n    var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext);\n\n    if (shouldUpdate) {\n      if (typeof instance.componentWillUpdate === 'function') {\n        startPhaseTimer(workInProgress, 'componentWillUpdate');\n        instance.componentWillUpdate(newProps, newState, newContext);\n        stopPhaseTimer();\n\n        // Simulate an async bailout/interruption by invoking lifecycle twice.\n        if (debugRenderPhaseSideEffects) {\n          instance.componentWillUpdate(newProps, newState, newContext);\n        }\n      }\n      if (typeof instance.componentDidUpdate === 'function') {\n        workInProgress.effectTag |= Update;\n      }\n    } else {\n      // If an update was already in progress, we should schedule an Update\n      // effect even though we're bailing out, so that cWU/cDU are called.\n      if (typeof instance.componentDidUpdate === 'function') {\n        if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n          workInProgress.effectTag |= Update;\n        }\n      }\n\n      // If shouldComponentUpdate returned false, we should still update the\n      // memoized props/state to indicate that this work can be reused.\n      memoizeProps(workInProgress, newProps);\n      memoizeState(workInProgress, newState);\n    }\n\n    // Update the existing instance's state, props, and context pointers even\n    // if shouldComponentUpdate returns false.\n    instance.props = newProps;\n    instance.state = newState;\n    instance.context = newContext;\n\n    return shouldUpdate;\n  }\n\n  return {\n    adoptClassInstance: adoptClassInstance,\n    constructClassInstance: constructClassInstance,\n    mountClassInstance: mountClassInstance,\n    // resumeMountClassInstance,\n    updateClassInstance: updateClassInstance\n  };\n};\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol['for'];\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7;\nvar REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;\nvar REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable === 'undefined') {\n    return null;\n  }\n  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n  if (typeof maybeIterator === 'function') {\n    return maybeIterator;\n  }\n  return null;\n}\n\nvar getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\n\n{\n  var didWarnAboutMaps = false;\n  /**\n   * Warn if there's no key explicitly set on dynamic arrays of children or\n   * object keys are not valid. This allows us to keep track of children between\n   * updates.\n   */\n  var ownerHasKeyUseWarning = {};\n  var ownerHasFunctionTypeWarning = {};\n\n  var warnForMissingKey = function (child) {\n    if (child === null || typeof child !== 'object') {\n      return;\n    }\n    if (!child._store || child._store.validated || child.key != null) {\n      return;\n    }\n    !(typeof child._store === 'object') ? invariant_1(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    child._store.validated = true;\n\n    var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '\"key\" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + (getCurrentFiberStackAddendum$1() || '');\n    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n      return;\n    }\n    ownerHasKeyUseWarning[currentComponentErrorInfo] = true;\n\n    warning_1(false, 'Each child in an array or iterator should have a unique ' + '\"key\" prop. See https://fb.me/react-warning-keys for ' + 'more information.%s', getCurrentFiberStackAddendum$1());\n  };\n}\n\nvar isArray$1 = Array.isArray;\n\nfunction coerceRef(current, element) {\n  var mixedRef = element.ref;\n  if (mixedRef !== null && typeof mixedRef !== 'function') {\n    if (element._owner) {\n      var owner = element._owner;\n      var inst = void 0;\n      if (owner) {\n        var ownerFiber = owner;\n        !(ownerFiber.tag === ClassComponent) ? invariant_1(false, 'Stateless function components cannot have refs.') : void 0;\n        inst = ownerFiber.stateNode;\n      }\n      !inst ? invariant_1(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0;\n      var stringRef = '' + mixedRef;\n      // Check if previous string ref matches new string ref\n      if (current !== null && current.ref !== null && current.ref._stringRef === stringRef) {\n        return current.ref;\n      }\n      var ref = function (value) {\n        var refs = inst.refs === emptyObject_1 ? inst.refs = {} : inst.refs;\n        if (value === null) {\n          delete refs[stringRef];\n        } else {\n          refs[stringRef] = value;\n        }\n      };\n      ref._stringRef = stringRef;\n      return ref;\n    } else {\n      !(typeof mixedRef === 'string') ? invariant_1(false, 'Expected ref to be a function or a string.') : void 0;\n      !element._owner ? invariant_1(false, 'Element ref was specified as a string (%s) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).', mixedRef) : void 0;\n    }\n  }\n  return mixedRef;\n}\n\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n  if (returnFiber.type !== 'textarea') {\n    var addendum = '';\n    {\n      addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + (getCurrentFiberStackAddendum$1() || '');\n    }\n    invariant_1(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum);\n  }\n}\n\nfunction warnOnFunctionType() {\n  var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + (getCurrentFiberStackAddendum$1() || '');\n\n  if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {\n    return;\n  }\n  ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;\n\n  warning_1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.%s', getCurrentFiberStackAddendum$1() || '');\n}\n\n// This wrapper function exists because I expect to clone the code in each path\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\nfunction ChildReconciler(shouldTrackSideEffects) {\n  function deleteChild(returnFiber, childToDelete) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return;\n    }\n    // Deletions are added in reversed order so we add it to the front.\n    // At this point, the return fiber's effect list is empty except for\n    // deletions, so we can just append the deletion to the list. The remaining\n    // effects aren't added until the complete phase. Once we implement\n    // resuming, this may not be true.\n    var last = returnFiber.lastEffect;\n    if (last !== null) {\n      last.nextEffect = childToDelete;\n      returnFiber.lastEffect = childToDelete;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n    }\n    childToDelete.nextEffect = null;\n    childToDelete.effectTag = Deletion;\n  }\n\n  function deleteRemainingChildren(returnFiber, currentFirstChild) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return null;\n    }\n\n    // TODO: For the shouldClone case, this could be micro-optimized a bit by\n    // assuming that after the first child we've already added everything.\n    var childToDelete = currentFirstChild;\n    while (childToDelete !== null) {\n      deleteChild(returnFiber, childToDelete);\n      childToDelete = childToDelete.sibling;\n    }\n    return null;\n  }\n\n  function mapRemainingChildren(returnFiber, currentFirstChild) {\n    // Add the remaining children to a temporary map so that we can find them by\n    // keys quickly. Implicit (null) keys get added to this set with their index\n    var existingChildren = new Map();\n\n    var existingChild = currentFirstChild;\n    while (existingChild !== null) {\n      if (existingChild.key !== null) {\n        existingChildren.set(existingChild.key, existingChild);\n      } else {\n        existingChildren.set(existingChild.index, existingChild);\n      }\n      existingChild = existingChild.sibling;\n    }\n    return existingChildren;\n  }\n\n  function useFiber(fiber, pendingProps, expirationTime) {\n    // We currently set sibling to null and index to 0 here because it is easy\n    // to forget to do before returning it. E.g. for the single child case.\n    var clone = createWorkInProgress(fiber, pendingProps, expirationTime);\n    clone.index = 0;\n    clone.sibling = null;\n    return clone;\n  }\n\n  function placeChild(newFiber, lastPlacedIndex, newIndex) {\n    newFiber.index = newIndex;\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return lastPlacedIndex;\n    }\n    var current = newFiber.alternate;\n    if (current !== null) {\n      var oldIndex = current.index;\n      if (oldIndex < lastPlacedIndex) {\n        // This is a move.\n        newFiber.effectTag = Placement;\n        return lastPlacedIndex;\n      } else {\n        // This item can stay in place.\n        return oldIndex;\n      }\n    } else {\n      // This is an insertion.\n      newFiber.effectTag = Placement;\n      return lastPlacedIndex;\n    }\n  }\n\n  function placeSingleChild(newFiber) {\n    // This is simpler for the single child case. We only need to do a\n    // placement for inserting new children.\n    if (shouldTrackSideEffects && newFiber.alternate === null) {\n      newFiber.effectTag = Placement;\n    }\n    return newFiber;\n  }\n\n  function updateTextNode(returnFiber, current, textContent, expirationTime) {\n    if (current === null || current.tag !== HostText) {\n      // Insert\n      var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime);\n      created['return'] = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, textContent, expirationTime);\n      existing['return'] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updateElement(returnFiber, current, element, expirationTime) {\n    if (current !== null && current.type === element.type) {\n      // Move based on index\n      var existing = useFiber(current, element.props, expirationTime);\n      existing.ref = coerceRef(current, element);\n      existing['return'] = returnFiber;\n      {\n        existing._debugSource = element._source;\n        existing._debugOwner = element._owner;\n      }\n      return existing;\n    } else {\n      // Insert\n      var created = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime);\n      created.ref = coerceRef(current, element);\n      created['return'] = returnFiber;\n      return created;\n    }\n  }\n\n  function updateCall(returnFiber, current, call, expirationTime) {\n    // TODO: Should this also compare handler to determine whether to reuse?\n    if (current === null || current.tag !== CallComponent) {\n      // Insert\n      var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime);\n      created['return'] = returnFiber;\n      return created;\n    } else {\n      // Move based on index\n      var existing = useFiber(current, call, expirationTime);\n      existing['return'] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updateReturn(returnFiber, current, returnNode, expirationTime) {\n    if (current === null || current.tag !== ReturnComponent) {\n      // Insert\n      var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime);\n      created.type = returnNode.value;\n      created['return'] = returnFiber;\n      return created;\n    } else {\n      // Move based on index\n      var existing = useFiber(current, null, expirationTime);\n      existing.type = returnNode.value;\n      existing['return'] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updatePortal(returnFiber, current, portal, expirationTime) {\n    if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n      // Insert\n      var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime);\n      created['return'] = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, portal.children || [], expirationTime);\n      existing['return'] = returnFiber;\n      return existing;\n    }\n  }\n\n  function updateFragment(returnFiber, current, fragment, expirationTime, key) {\n    if (current === null || current.tag !== Fragment) {\n      // Insert\n      var created = createFiberFromFragment(fragment, returnFiber.internalContextTag, expirationTime, key);\n      created['return'] = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, fragment, expirationTime);\n      existing['return'] = returnFiber;\n      return existing;\n    }\n  }\n\n  function createChild(returnFiber, newChild, expirationTime) {\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      var created = createFiberFromText('' + newChild, returnFiber.internalContextTag, expirationTime);\n      created['return'] = returnFiber;\n      return created;\n    }\n\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            if (newChild.type === REACT_FRAGMENT_TYPE) {\n              var _created = createFiberFromFragment(newChild.props.children, returnFiber.internalContextTag, expirationTime, newChild.key);\n              _created['return'] = returnFiber;\n              return _created;\n            } else {\n              var _created2 = createFiberFromElement(newChild, returnFiber.internalContextTag, expirationTime);\n              _created2.ref = coerceRef(null, newChild);\n              _created2['return'] = returnFiber;\n              return _created2;\n            }\n          }\n\n        case REACT_CALL_TYPE:\n          {\n            var _created3 = createFiberFromCall(newChild, returnFiber.internalContextTag, expirationTime);\n            _created3['return'] = returnFiber;\n            return _created3;\n          }\n\n        case REACT_RETURN_TYPE:\n          {\n            var _created4 = createFiberFromReturn(newChild, returnFiber.internalContextTag, expirationTime);\n            _created4.type = newChild.value;\n            _created4['return'] = returnFiber;\n            return _created4;\n          }\n\n        case REACT_PORTAL_TYPE:\n          {\n            var _created5 = createFiberFromPortal(newChild, returnFiber.internalContextTag, expirationTime);\n            _created5['return'] = returnFiber;\n            return _created5;\n          }\n      }\n\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _created6 = createFiberFromFragment(newChild, returnFiber.internalContextTag, expirationTime, null);\n        _created6['return'] = returnFiber;\n        return _created6;\n      }\n\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n\n    return null;\n  }\n\n  function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n    // Update the fiber if the keys match, otherwise return null.\n\n    var key = oldFiber !== null ? oldFiber.key : null;\n\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      if (key !== null) {\n        return null;\n      }\n      return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);\n    }\n\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            if (newChild.key === key) {\n              if (newChild.type === REACT_FRAGMENT_TYPE) {\n                return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);\n              }\n              return updateElement(returnFiber, oldFiber, newChild, expirationTime);\n            } else {\n              return null;\n            }\n          }\n\n        case REACT_CALL_TYPE:\n          {\n            if (newChild.key === key) {\n              return updateCall(returnFiber, oldFiber, newChild, expirationTime);\n            } else {\n              return null;\n            }\n          }\n\n        case REACT_RETURN_TYPE:\n          {\n            // Returns don't have keys. If the previous node is implicitly keyed\n            // we can continue to replace it without aborting even if it is not a\n            // yield.\n            if (key === null) {\n              return updateReturn(returnFiber, oldFiber, newChild, expirationTime);\n            } else {\n              return null;\n            }\n          }\n\n        case REACT_PORTAL_TYPE:\n          {\n            if (newChild.key === key) {\n              return updatePortal(returnFiber, oldFiber, newChild, expirationTime);\n            } else {\n              return null;\n            }\n          }\n      }\n\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        if (key !== null) {\n          return null;\n        }\n\n        return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);\n      }\n\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n\n    return null;\n  }\n\n  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys, so we neither have to check the old nor\n      // new node for the key. If both are text nodes, they match.\n      var matchedFiber = existingChildren.get(newIdx) || null;\n      return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);\n    }\n\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            if (newChild.type === REACT_FRAGMENT_TYPE) {\n              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);\n            }\n            return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);\n          }\n\n        case REACT_CALL_TYPE:\n          {\n            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            return updateCall(returnFiber, _matchedFiber2, newChild, expirationTime);\n          }\n\n        case REACT_RETURN_TYPE:\n          {\n            // Returns don't have keys, so we neither have to check the old nor\n            // new node for the key. If both are returns, they match.\n            var _matchedFiber3 = existingChildren.get(newIdx) || null;\n            return updateReturn(returnFiber, _matchedFiber3, newChild, expirationTime);\n          }\n\n        case REACT_PORTAL_TYPE:\n          {\n            var _matchedFiber4 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            return updatePortal(returnFiber, _matchedFiber4, newChild, expirationTime);\n          }\n      }\n\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _matchedFiber5 = existingChildren.get(newIdx) || null;\n        return updateFragment(returnFiber, _matchedFiber5, newChild, expirationTime, null);\n      }\n\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n\n    return null;\n  }\n\n  /**\n   * Warns if there is a duplicate or missing key\n   */\n  function warnOnInvalidKey(child, knownKeys) {\n    {\n      if (typeof child !== 'object' || child === null) {\n        return knownKeys;\n      }\n      switch (child.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n        case REACT_CALL_TYPE:\n        case REACT_PORTAL_TYPE:\n          warnForMissingKey(child);\n          var key = child.key;\n          if (typeof key !== 'string') {\n            break;\n          }\n          if (knownKeys === null) {\n            knownKeys = new Set();\n            knownKeys.add(key);\n            break;\n          }\n          if (!knownKeys.has(key)) {\n            knownKeys.add(key);\n            break;\n          }\n          warning_1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.%s', key, getCurrentFiberStackAddendum$1());\n          break;\n        default:\n          break;\n      }\n    }\n    return knownKeys;\n  }\n\n  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {\n    // This algorithm can't optimize by searching from boths ends since we\n    // don't have backpointers on fibers. I'm trying to see how far we can get\n    // with that model. If it ends up not being worth the tradeoffs, we can\n    // add it later.\n\n    // Even with a two ended optimization, we'd want to optimize for the case\n    // where there are few changes and brute force the comparison instead of\n    // going for the Map. It'd like to explore hitting that path first in\n    // forward-only mode and only go for the Map once we notice that we need\n    // lots of look ahead. This doesn't handle reversal as well as two ended\n    // search but that's unusual. Besides, for the two ended optimization to\n    // work on Iterables, we'd need to copy the whole set.\n\n    // In this first iteration, we'll just live with hitting the bad case\n    // (adding everything to a Map) in for every insert/move.\n\n    // If you change this code, also update reconcileChildrenIterator() which\n    // uses the same algorithm.\n\n    {\n      // First, validate keys.\n      var knownKeys = null;\n      for (var i = 0; i < newChildren.length; i++) {\n        var child = newChildren[i];\n        knownKeys = warnOnInvalidKey(child, knownKeys);\n      }\n    }\n\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (oldFiber === null) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n\n    if (newIdx === newChildren.length) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; newIdx < newChildren.length; newIdx++) {\n        var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);\n        if (!_newFiber) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber;\n        } else {\n          previousNewFiber.sibling = _newFiber;\n        }\n        previousNewFiber = _newFiber;\n      }\n      return resultingFirstChild;\n    }\n\n    // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);\n\n    // Keep scanning and use the map to restore deleted items as moves.\n    for (; newIdx < newChildren.length; newIdx++) {\n      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);\n      if (_newFiber2) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber2.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren['delete'](_newFiber2.key === null ? newIdx : _newFiber2.key);\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber2;\n        } else {\n          previousNewFiber.sibling = _newFiber2;\n        }\n        previousNewFiber = _newFiber2;\n      }\n    }\n\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function (child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n\n    return resultingFirstChild;\n  }\n\n  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {\n    // This is the same implementation as reconcileChildrenArray(),\n    // but using the iterator instead.\n\n    var iteratorFn = getIteratorFn(newChildrenIterable);\n    !(typeof iteratorFn === 'function') ? invariant_1(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n    {\n      // Warn about using Maps as children\n      if (typeof newChildrenIterable.entries === 'function') {\n        var possibleMap = newChildrenIterable;\n        if (possibleMap.entries === iteratorFn) {\n          warning_1(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentFiberStackAddendum$1());\n          didWarnAboutMaps = true;\n        }\n      }\n\n      // First, validate keys.\n      // We'll get a different iterator later for the main pass.\n      var _newChildren = iteratorFn.call(newChildrenIterable);\n      if (_newChildren) {\n        var knownKeys = null;\n        var _step = _newChildren.next();\n        for (; !_step.done; _step = _newChildren.next()) {\n          var child = _step.value;\n          knownKeys = warnOnInvalidKey(child, knownKeys);\n        }\n      }\n    }\n\n    var newChildren = iteratorFn.call(newChildrenIterable);\n    !(newChildren != null) ? invariant_1(false, 'An iterable object provided no iterator.') : void 0;\n\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n\n    var step = newChildren.next();\n    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (!oldFiber) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n\n    if (step.done) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; !step.done; newIdx++, step = newChildren.next()) {\n        var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n        if (_newFiber3 === null) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber3;\n        } else {\n          previousNewFiber.sibling = _newFiber3;\n        }\n        previousNewFiber = _newFiber3;\n      }\n      return resultingFirstChild;\n    }\n\n    // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);\n\n    // Keep scanning and use the map to restore deleted items as moves.\n    for (; !step.done; newIdx++, step = newChildren.next()) {\n      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);\n      if (_newFiber4 !== null) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber4.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren['delete'](_newFiber4.key === null ? newIdx : _newFiber4.key);\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber4;\n        } else {\n          previousNewFiber.sibling = _newFiber4;\n        }\n        previousNewFiber = _newFiber4;\n      }\n    }\n\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function (child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n\n    return resultingFirstChild;\n  }\n\n  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {\n    // There's no need to check for keys on text nodes since we don't have a\n    // way to define them.\n    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n      // We already have an existing node so let's just update it and delete\n      // the rest.\n      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n      var existing = useFiber(currentFirstChild, textContent, expirationTime);\n      existing['return'] = returnFiber;\n      return existing;\n    }\n    // The existing first child is not a text node so we need to create one\n    // and delete the existing ones.\n    deleteRemainingChildren(returnFiber, currentFirstChild);\n    var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime);\n    created['return'] = returnFiber;\n    return created;\n  }\n\n  function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {\n    var key = element.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);\n          existing.ref = coerceRef(child, element);\n          existing['return'] = returnFiber;\n          {\n            existing._debugSource = element._source;\n            existing._debugOwner = element._owner;\n          }\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n\n    if (element.type === REACT_FRAGMENT_TYPE) {\n      var created = createFiberFromFragment(element.props.children, returnFiber.internalContextTag, expirationTime, element.key);\n      created['return'] = returnFiber;\n      return created;\n    } else {\n      var _created7 = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime);\n      _created7.ref = coerceRef(currentFirstChild, element);\n      _created7['return'] = returnFiber;\n      return _created7;\n    }\n  }\n\n  function reconcileSingleCall(returnFiber, currentFirstChild, call, expirationTime) {\n    var key = call.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (child.tag === CallComponent) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, call, expirationTime);\n          existing['return'] = returnFiber;\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n\n    var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime);\n    created['return'] = returnFiber;\n    return created;\n  }\n\n  function reconcileSingleReturn(returnFiber, currentFirstChild, returnNode, expirationTime) {\n    // There's no need to check for keys on yields since they're stateless.\n    var child = currentFirstChild;\n    if (child !== null) {\n      if (child.tag === ReturnComponent) {\n        deleteRemainingChildren(returnFiber, child.sibling);\n        var existing = useFiber(child, null, expirationTime);\n        existing.type = returnNode.value;\n        existing['return'] = returnFiber;\n        return existing;\n      } else {\n        deleteRemainingChildren(returnFiber, child);\n      }\n    }\n\n    var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime);\n    created.type = returnNode.value;\n    created['return'] = returnFiber;\n    return created;\n  }\n\n  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {\n    var key = portal.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, portal.children || [], expirationTime);\n          existing['return'] = returnFiber;\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n\n    var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime);\n    created['return'] = returnFiber;\n    return created;\n  }\n\n  // This API will tag the children with the side-effect of the reconciliation\n  // itself. They will be added to the side-effect list as we pass through the\n  // children and the parent.\n  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n    // This function is not recursive.\n    // If the top level item is an array, we treat it as a set of children,\n    // not as a fragment. Nested arrays on the other hand will be treated as\n    // fragment nodes. Recursion happens at the normal flow.\n\n    // Handle top level unkeyed fragments as if they were arrays.\n    // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n    // We treat the ambiguous cases above the same.\n    if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n      newChild = newChild.props.children;\n    }\n\n    // Handle object types\n    var isObject = typeof newChild === 'object' && newChild !== null;\n\n    if (isObject) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n        case REACT_CALL_TYPE:\n          return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n        case REACT_RETURN_TYPE:\n          return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n        case REACT_PORTAL_TYPE:\n          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n      }\n    }\n\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n    }\n\n    if (isArray$1(newChild)) {\n      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n    }\n\n    if (getIteratorFn(newChild)) {\n      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n    }\n\n    if (isObject) {\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n    if (typeof newChild === 'undefined') {\n      // If the new child is undefined, and the return fiber is a composite\n      // component, throw an error. If Fiber return types are disabled,\n      // we already threw above.\n      switch (returnFiber.tag) {\n        case ClassComponent:\n          {\n            {\n              var instance = returnFiber.stateNode;\n              if (instance.render._isMockFunction) {\n                // We allow auto-mocks to proceed as if they're returning null.\n                break;\n              }\n            }\n          }\n        // Intentionally fall through to the next case, which handles both\n        // functions and classes\n        // eslint-disable-next-lined no-fallthrough\n        case FunctionalComponent:\n          {\n            var Component = returnFiber.type;\n            invariant_1(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n          }\n      }\n    }\n\n    // Remaining cases are all treated as empty.\n    return deleteRemainingChildren(returnFiber, currentFirstChild);\n  }\n\n  return reconcileChildFibers;\n}\n\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\n\nfunction cloneChildFibers(current, workInProgress) {\n  !(current === null || workInProgress.child === current.child) ? invariant_1(false, 'Resuming work not yet implemented.') : void 0;\n\n  if (workInProgress.child === null) {\n    return;\n  }\n\n  var currentChild = workInProgress.child;\n  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);\n  workInProgress.child = newChild;\n\n  newChild['return'] = workInProgress;\n  while (currentChild.sibling !== null) {\n    currentChild = currentChild.sibling;\n    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);\n    newChild['return'] = workInProgress;\n  }\n  newChild.sibling = null;\n}\n\n{\n  var warnedAboutStatelessRefs = {};\n}\n\nvar ReactFiberBeginWork = function (config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber) {\n  var shouldSetTextContent = config.shouldSetTextContent,\n      useSyncScheduling = config.useSyncScheduling,\n      shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree;\n  var pushHostContext = hostContext.pushHostContext,\n      pushHostContainer = hostContext.pushHostContainer;\n  var enterHydrationState = hydrationContext.enterHydrationState,\n      resetHydrationState = hydrationContext.resetHydrationState,\n      tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance;\n\n  var _ReactFiberClassCompo = ReactFiberClassComponent(scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState),\n      adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance,\n      constructClassInstance = _ReactFiberClassCompo.constructClassInstance,\n      mountClassInstance = _ReactFiberClassCompo.mountClassInstance,\n      updateClassInstance = _ReactFiberClassCompo.updateClassInstance;\n\n  // TODO: Remove this and use reconcileChildrenAtExpirationTime directly.\n\n\n  function reconcileChildren(current, workInProgress, nextChildren) {\n    reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, workInProgress.expirationTime);\n  }\n\n  function reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime) {\n    if (current === null) {\n      // If this is a fresh new component that hasn't been rendered yet, we\n      // won't update its child set by applying minimal side-effects. Instead,\n      // we will add them all to the child before it gets rendered. That means\n      // we can optimize this reconciliation pass by not tracking side-effects.\n      workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n    } else {\n      // If the current child is the same as the work in progress, it means that\n      // we haven't yet started any work on these children. Therefore, we use\n      // the clone algorithm to create a copy of all the current children.\n\n      // If we had any progressed work already, that is invalid at this point so\n      // let's throw it out.\n      workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);\n    }\n  }\n\n  function updateFragment(current, workInProgress) {\n    var nextChildren = workInProgress.pendingProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n      if (nextChildren === null) {\n        nextChildren = workInProgress.memoizedProps;\n      }\n    } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n    reconcileChildren(current, workInProgress, nextChildren);\n    memoizeProps(workInProgress, nextChildren);\n    return workInProgress.child;\n  }\n\n  function markRef(current, workInProgress) {\n    var ref = workInProgress.ref;\n    if (ref !== null && (!current || current.ref !== ref)) {\n      // Schedule a Ref effect\n      workInProgress.effectTag |= Ref;\n    }\n  }\n\n  function updateFunctionalComponent(current, workInProgress) {\n    var fn = workInProgress.type;\n    var nextProps = workInProgress.pendingProps;\n\n    var memoizedProps = workInProgress.memoizedProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n      if (nextProps === null) {\n        nextProps = memoizedProps;\n      }\n    } else {\n      if (nextProps === null || memoizedProps === nextProps) {\n        return bailoutOnAlreadyFinishedWork(current, workInProgress);\n      }\n      // TODO: consider bringing fn.shouldComponentUpdate() back.\n      // It used to be here.\n    }\n\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n    var context = getMaskedContext(workInProgress, unmaskedContext);\n\n    var nextChildren;\n\n    {\n      ReactCurrentOwner.current = workInProgress;\n      ReactDebugCurrentFiber.setCurrentPhase('render');\n      nextChildren = fn(nextProps, context);\n      ReactDebugCurrentFiber.setCurrentPhase(null);\n    }\n    // React DevTools reads this flag.\n    workInProgress.effectTag |= PerformedWork;\n    reconcileChildren(current, workInProgress, nextChildren);\n    memoizeProps(workInProgress, nextProps);\n    return workInProgress.child;\n  }\n\n  function updateClassComponent(current, workInProgress, renderExpirationTime) {\n    // Push context providers early to prevent context stack mismatches.\n    // During mounting we don't know the child context yet as the instance doesn't exist.\n    // We will invalidate the child context in finishClassComponent() right after rendering.\n    var hasContext = pushContextProvider(workInProgress);\n\n    var shouldUpdate = void 0;\n    if (current === null) {\n      if (!workInProgress.stateNode) {\n        // In the initial pass we might need to construct the instance.\n        constructClassInstance(workInProgress, workInProgress.pendingProps);\n        mountClassInstance(workInProgress, renderExpirationTime);\n        shouldUpdate = true;\n      } else {\n        invariant_1(false, 'Resuming work not yet implemented.');\n        // In a resume, we'll already have an instance we can reuse.\n        // shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime);\n      }\n    } else {\n      shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime);\n    }\n    return finishClassComponent(current, workInProgress, shouldUpdate, hasContext);\n  }\n\n  function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) {\n    // Refs should update even if shouldComponentUpdate returns false\n    markRef(current, workInProgress);\n\n    if (!shouldUpdate) {\n      // Context providers should defer to sCU for rendering\n      if (hasContext) {\n        invalidateContextProvider(workInProgress, false);\n      }\n\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    var instance = workInProgress.stateNode;\n\n    // Rerender\n    ReactCurrentOwner.current = workInProgress;\n    var nextChildren = void 0;\n    {\n      ReactDebugCurrentFiber.setCurrentPhase('render');\n      nextChildren = instance.render();\n      if (debugRenderPhaseSideEffects) {\n        instance.render();\n      }\n      ReactDebugCurrentFiber.setCurrentPhase(null);\n    }\n    // React DevTools reads this flag.\n    workInProgress.effectTag |= PerformedWork;\n    reconcileChildren(current, workInProgress, nextChildren);\n    // Memoize props and state using the values we just used to render.\n    // TODO: Restructure so we never read values from the instance.\n    memoizeState(workInProgress, instance.state);\n    memoizeProps(workInProgress, instance.props);\n\n    // The context might have changed so we need to recalculate it.\n    if (hasContext) {\n      invalidateContextProvider(workInProgress, true);\n    }\n\n    return workInProgress.child;\n  }\n\n  function pushHostRootContext(workInProgress) {\n    var root = workInProgress.stateNode;\n    if (root.pendingContext) {\n      pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n    } else if (root.context) {\n      // Should always be set\n      pushTopLevelContextObject(workInProgress, root.context, false);\n    }\n    pushHostContainer(workInProgress, root.containerInfo);\n  }\n\n  function updateHostRoot(current, workInProgress, renderExpirationTime) {\n    pushHostRootContext(workInProgress);\n    var updateQueue = workInProgress.updateQueue;\n    if (updateQueue !== null) {\n      var prevState = workInProgress.memoizedState;\n      var state = processUpdateQueue(current, workInProgress, updateQueue, null, null, renderExpirationTime);\n      if (prevState === state) {\n        // If the state is the same as before, that's a bailout because we had\n        // no work that expires at this time.\n        resetHydrationState();\n        return bailoutOnAlreadyFinishedWork(current, workInProgress);\n      }\n      var element = state.element;\n      var root = workInProgress.stateNode;\n      if ((current === null || current.child === null) && root.hydrate && enterHydrationState(workInProgress)) {\n        // If we don't have any current children this might be the first pass.\n        // We always try to hydrate. If this isn't a hydration pass there won't\n        // be any children to hydrate which is effectively the same thing as\n        // not hydrating.\n\n        // This is a bit of a hack. We track the host root as a placement to\n        // know that we're currently in a mounting state. That way isMounted\n        // works as expected. We must reset this before committing.\n        // TODO: Delete this when we delete isMounted and findDOMNode.\n        workInProgress.effectTag |= Placement;\n\n        // Ensure that children mount into this root without tracking\n        // side-effects. This ensures that we don't store Placement effects on\n        // nodes that will be hydrated.\n        workInProgress.child = mountChildFibers(workInProgress, null, element, renderExpirationTime);\n      } else {\n        // Otherwise reset hydration state in case we aborted and resumed another\n        // root.\n        resetHydrationState();\n        reconcileChildren(current, workInProgress, element);\n      }\n      memoizeState(workInProgress, state);\n      return workInProgress.child;\n    }\n    resetHydrationState();\n    // If there is no update queue, that's a bailout because the root has no props.\n    return bailoutOnAlreadyFinishedWork(current, workInProgress);\n  }\n\n  function updateHostComponent(current, workInProgress, renderExpirationTime) {\n    pushHostContext(workInProgress);\n\n    if (current === null) {\n      tryToClaimNextHydratableInstance(workInProgress);\n    }\n\n    var type = workInProgress.type;\n    var memoizedProps = workInProgress.memoizedProps;\n    var nextProps = workInProgress.pendingProps;\n    if (nextProps === null) {\n      nextProps = memoizedProps;\n      !(nextProps !== null) ? invariant_1(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    }\n    var prevProps = current !== null ? current.memoizedProps : null;\n\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n    } else if (nextProps === null || memoizedProps === nextProps) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    var nextChildren = nextProps.children;\n    var isDirectTextChild = shouldSetTextContent(type, nextProps);\n\n    if (isDirectTextChild) {\n      // We special case a direct text child of a host node. This is a common\n      // case. We won't handle it as a reified child. We will instead handle\n      // this in the host environment that also have access to this prop. That\n      // avoids allocating another HostText fiber and traversing it.\n      nextChildren = null;\n    } else if (prevProps && shouldSetTextContent(type, prevProps)) {\n      // If we're switching from a direct text child to a normal child, or to\n      // empty, we need to schedule the text content to be reset.\n      workInProgress.effectTag |= ContentReset;\n    }\n\n    markRef(current, workInProgress);\n\n    // Check the host config to see if the children are offscreen/hidden.\n    if (renderExpirationTime !== Never && !useSyncScheduling && shouldDeprioritizeSubtree(type, nextProps)) {\n      // Down-prioritize the children.\n      workInProgress.expirationTime = Never;\n      // Bailout and come back to this fiber later.\n      return null;\n    }\n\n    reconcileChildren(current, workInProgress, nextChildren);\n    memoizeProps(workInProgress, nextProps);\n    return workInProgress.child;\n  }\n\n  function updateHostText(current, workInProgress) {\n    if (current === null) {\n      tryToClaimNextHydratableInstance(workInProgress);\n    }\n    var nextProps = workInProgress.pendingProps;\n    if (nextProps === null) {\n      nextProps = workInProgress.memoizedProps;\n    }\n    memoizeProps(workInProgress, nextProps);\n    // Nothing to do here. This is terminal. We'll do the completion step\n    // immediately after.\n    return null;\n  }\n\n  function mountIndeterminateComponent(current, workInProgress, renderExpirationTime) {\n    !(current === null) ? invariant_1(false, 'An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    var fn = workInProgress.type;\n    var props = workInProgress.pendingProps;\n    var unmaskedContext = getUnmaskedContext(workInProgress);\n    var context = getMaskedContext(workInProgress, unmaskedContext);\n\n    var value;\n\n    {\n      if (fn.prototype && typeof fn.prototype.render === 'function') {\n        var componentName = getComponentName(workInProgress);\n        warning_1(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n      }\n      ReactCurrentOwner.current = workInProgress;\n      value = fn(props, context);\n    }\n    // React DevTools reads this flag.\n    workInProgress.effectTag |= PerformedWork;\n\n    if (typeof value === 'object' && value !== null && typeof value.render === 'function') {\n      // Proceed under the assumption that this is a class instance\n      workInProgress.tag = ClassComponent;\n\n      // Push context providers early to prevent context stack mismatches.\n      // During mounting we don't know the child context yet as the instance doesn't exist.\n      // We will invalidate the child context in finishClassComponent() right after rendering.\n      var hasContext = pushContextProvider(workInProgress);\n      adoptClassInstance(workInProgress, value);\n      mountClassInstance(workInProgress, renderExpirationTime);\n      return finishClassComponent(current, workInProgress, true, hasContext);\n    } else {\n      // Proceed under the assumption that this is a functional component\n      workInProgress.tag = FunctionalComponent;\n      {\n        var Component = workInProgress.type;\n\n        if (Component) {\n          warning_1(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component');\n        }\n        if (workInProgress.ref !== null) {\n          var info = '';\n          var ownerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName();\n          if (ownerName) {\n            info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n          }\n\n          var warningKey = ownerName || workInProgress._debugID || '';\n          var debugSource = workInProgress._debugSource;\n          if (debugSource) {\n            warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n          }\n          if (!warnedAboutStatelessRefs[warningKey]) {\n            warnedAboutStatelessRefs[warningKey] = true;\n            warning_1(false, 'Stateless function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s%s', info, ReactDebugCurrentFiber.getCurrentFiberStackAddendum());\n          }\n        }\n      }\n      reconcileChildren(current, workInProgress, value);\n      memoizeProps(workInProgress, props);\n      return workInProgress.child;\n    }\n  }\n\n  function updateCallComponent(current, workInProgress, renderExpirationTime) {\n    var nextCall = workInProgress.pendingProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n      if (nextCall === null) {\n        nextCall = current && current.memoizedProps;\n        !(nextCall !== null) ? invariant_1(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n      }\n    } else if (nextCall === null || workInProgress.memoizedProps === nextCall) {\n      nextCall = workInProgress.memoizedProps;\n      // TODO: When bailing out, we might need to return the stateNode instead\n      // of the child. To check it for work.\n      // return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    var nextChildren = nextCall.children;\n\n    // The following is a fork of reconcileChildrenAtExpirationTime but using\n    // stateNode to store the child.\n    if (current === null) {\n      workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);\n    } else {\n      workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);\n    }\n\n    memoizeProps(workInProgress, nextCall);\n    // This doesn't take arbitrary time so we could synchronously just begin\n    // eagerly do the work of workInProgress.child as an optimization.\n    return workInProgress.stateNode;\n  }\n\n  function updatePortalComponent(current, workInProgress, renderExpirationTime) {\n    pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n    var nextChildren = workInProgress.pendingProps;\n    if (hasContextChanged()) {\n      // Normally we can bail out on props equality but if context has changed\n      // we don't do the bailout and we have to reuse existing props instead.\n      if (nextChildren === null) {\n        nextChildren = current && current.memoizedProps;\n        !(nextChildren != null) ? invariant_1(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n      }\n    } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress);\n    }\n\n    if (current === null) {\n      // Portals are special because we don't append the children during mount\n      // but at commit. Therefore we need to track insertions which the normal\n      // flow doesn't do during mount. This doesn't happen at the root because\n      // the root always starts with a \"current\" with a null child.\n      // TODO: Consider unifying this with how the root works.\n      workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n      memoizeProps(workInProgress, nextChildren);\n    } else {\n      reconcileChildren(current, workInProgress, nextChildren);\n      memoizeProps(workInProgress, nextChildren);\n    }\n    return workInProgress.child;\n  }\n\n  /*\n  function reuseChildrenEffects(returnFiber : Fiber, firstChild : Fiber) {\n    let child = firstChild;\n    do {\n      // Ensure that the first and last effect of the parent corresponds\n      // to the children's first and last effect.\n      if (!returnFiber.firstEffect) {\n        returnFiber.firstEffect = child.firstEffect;\n      }\n      if (child.lastEffect) {\n        if (returnFiber.lastEffect) {\n          returnFiber.lastEffect.nextEffect = child.firstEffect;\n        }\n        returnFiber.lastEffect = child.lastEffect;\n      }\n    } while (child = child.sibling);\n  }\n  */\n\n  function bailoutOnAlreadyFinishedWork(current, workInProgress) {\n    cancelWorkTimer(workInProgress);\n\n    // TODO: We should ideally be able to bail out early if the children have no\n    // more work to do. However, since we don't have a separation of this\n    // Fiber's priority and its children yet - we don't know without doing lots\n    // of the same work we do anyway. Once we have that separation we can just\n    // bail out here if the children has no more work at this priority level.\n    // if (workInProgress.priorityOfChildren <= priorityLevel) {\n    //   // If there are side-effects in these children that have not yet been\n    //   // committed we need to ensure that they get properly transferred up.\n    //   if (current && current.child !== workInProgress.child) {\n    //     reuseChildrenEffects(workInProgress, child);\n    //   }\n    //   return null;\n    // }\n\n    cloneChildFibers(current, workInProgress);\n    return workInProgress.child;\n  }\n\n  function bailoutOnLowPriority(current, workInProgress) {\n    cancelWorkTimer(workInProgress);\n\n    // TODO: Handle HostComponent tags here as well and call pushHostContext()?\n    // See PR 8590 discussion for context\n    switch (workInProgress.tag) {\n      case HostRoot:\n        pushHostRootContext(workInProgress);\n        break;\n      case ClassComponent:\n        pushContextProvider(workInProgress);\n        break;\n      case HostPortal:\n        pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n        break;\n    }\n    // TODO: What if this is currently in progress?\n    // How can that happen? How is this not being cloned?\n    return null;\n  }\n\n  // TODO: Delete memoizeProps/State and move to reconcile/bailout instead\n  function memoizeProps(workInProgress, nextProps) {\n    workInProgress.memoizedProps = nextProps;\n  }\n\n  function memoizeState(workInProgress, nextState) {\n    workInProgress.memoizedState = nextState;\n    // Don't reset the updateQueue, in case there are pending updates. Resetting\n    // is handled by processUpdateQueue.\n  }\n\n  function beginWork(current, workInProgress, renderExpirationTime) {\n    if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {\n      return bailoutOnLowPriority(current, workInProgress);\n    }\n\n    switch (workInProgress.tag) {\n      case IndeterminateComponent:\n        return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);\n      case FunctionalComponent:\n        return updateFunctionalComponent(current, workInProgress);\n      case ClassComponent:\n        return updateClassComponent(current, workInProgress, renderExpirationTime);\n      case HostRoot:\n        return updateHostRoot(current, workInProgress, renderExpirationTime);\n      case HostComponent:\n        return updateHostComponent(current, workInProgress, renderExpirationTime);\n      case HostText:\n        return updateHostText(current, workInProgress);\n      case CallHandlerPhase:\n        // This is a restart. Reset the tag to the initial phase.\n        workInProgress.tag = CallComponent;\n      // Intentionally fall through since this is now the same.\n      case CallComponent:\n        return updateCallComponent(current, workInProgress, renderExpirationTime);\n      case ReturnComponent:\n        // A return component is just a placeholder, we can just run through the\n        // next one immediately.\n        return null;\n      case HostPortal:\n        return updatePortalComponent(current, workInProgress, renderExpirationTime);\n      case Fragment:\n        return updateFragment(current, workInProgress);\n      default:\n        invariant_1(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');\n    }\n  }\n\n  function beginFailedWork(current, workInProgress, renderExpirationTime) {\n    // Push context providers here to avoid a push/pop context mismatch.\n    switch (workInProgress.tag) {\n      case ClassComponent:\n        pushContextProvider(workInProgress);\n        break;\n      case HostRoot:\n        pushHostRootContext(workInProgress);\n        break;\n      default:\n        invariant_1(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.');\n    }\n\n    // Add an error effect so we can handle the error during the commit phase\n    workInProgress.effectTag |= Err;\n\n    // This is a weird case where we do \"resume\" work — work that failed on\n    // our first attempt. Because we no longer have a notion of \"progressed\n    // deletions,\" reset the child to the current child to make sure we delete\n    // it again. TODO: Find a better way to handle this, perhaps during a more\n    // general overhaul of error handling.\n    if (current === null) {\n      workInProgress.child = null;\n    } else if (workInProgress.child !== current.child) {\n      workInProgress.child = current.child;\n    }\n\n    if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {\n      return bailoutOnLowPriority(current, workInProgress);\n    }\n\n    // If we don't bail out, we're going be recomputing our children so we need\n    // to drop our effect list.\n    workInProgress.firstEffect = null;\n    workInProgress.lastEffect = null;\n\n    // Unmount the current children as if the component rendered null\n    var nextChildren = null;\n    reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime);\n\n    if (workInProgress.tag === ClassComponent) {\n      var instance = workInProgress.stateNode;\n      workInProgress.memoizedProps = instance.props;\n      workInProgress.memoizedState = instance.state;\n    }\n\n    return workInProgress.child;\n  }\n\n  return {\n    beginWork: beginWork,\n    beginFailedWork: beginFailedWork\n  };\n};\n\nvar ReactFiberCompleteWork = function (config, hostContext, hydrationContext) {\n  var createInstance = config.createInstance,\n      createTextInstance = config.createTextInstance,\n      appendInitialChild = config.appendInitialChild,\n      finalizeInitialChildren = config.finalizeInitialChildren,\n      prepareUpdate = config.prepareUpdate,\n      mutation = config.mutation,\n      persistence = config.persistence;\n  var getRootHostContainer = hostContext.getRootHostContainer,\n      popHostContext = hostContext.popHostContext,\n      getHostContext = hostContext.getHostContext,\n      popHostContainer = hostContext.popHostContainer;\n  var prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance,\n      prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance,\n      popHydrationState = hydrationContext.popHydrationState;\n\n\n  function markUpdate(workInProgress) {\n    // Tag the fiber with an update effect. This turns a Placement into\n    // an UpdateAndPlacement.\n    workInProgress.effectTag |= Update;\n  }\n\n  function markRef(workInProgress) {\n    workInProgress.effectTag |= Ref;\n  }\n\n  function appendAllReturns(returns, workInProgress) {\n    var node = workInProgress.stateNode;\n    if (node) {\n      node['return'] = workInProgress;\n    }\n    while (node !== null) {\n      if (node.tag === HostComponent || node.tag === HostText || node.tag === HostPortal) {\n        invariant_1(false, 'A call cannot have host component children.');\n      } else if (node.tag === ReturnComponent) {\n        returns.push(node.type);\n      } else if (node.child !== null) {\n        node.child['return'] = node;\n        node = node.child;\n        continue;\n      }\n      while (node.sibling === null) {\n        if (node['return'] === null || node['return'] === workInProgress) {\n          return;\n        }\n        node = node['return'];\n      }\n      node.sibling['return'] = node['return'];\n      node = node.sibling;\n    }\n  }\n\n  function moveCallToHandlerPhase(current, workInProgress, renderExpirationTime) {\n    var call = workInProgress.memoizedProps;\n    !call ? invariant_1(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n    // First step of the call has completed. Now we need to do the second.\n    // TODO: It would be nice to have a multi stage call represented by a\n    // single component, or at least tail call optimize nested ones. Currently\n    // that requires additional fields that we don't want to add to the fiber.\n    // So this requires nested handlers.\n    // Note: This doesn't mutate the alternate node. I don't think it needs to\n    // since this stage is reset for every pass.\n    workInProgress.tag = CallHandlerPhase;\n\n    // Build up the returns.\n    // TODO: Compare this to a generator or opaque helpers like Children.\n    var returns = [];\n    appendAllReturns(returns, workInProgress);\n    var fn = call.handler;\n    var props = call.props;\n    var nextChildren = fn(props, returns);\n\n    var currentFirstChild = current !== null ? current.child : null;\n    workInProgress.child = reconcileChildFibers(workInProgress, currentFirstChild, nextChildren, renderExpirationTime);\n    return workInProgress.child;\n  }\n\n  function appendAllChildren(parent, workInProgress) {\n    // We only have the top Fiber that was created but we need recurse down its\n    // children to find all the terminal nodes.\n    var node = workInProgress.child;\n    while (node !== null) {\n      if (node.tag === HostComponent || node.tag === HostText) {\n        appendInitialChild(parent, node.stateNode);\n      } else if (node.tag === HostPortal) {\n        // If we have a portal child, then we don't want to traverse\n        // down its children. Instead, we'll get insertions from each child in\n        // the portal directly.\n      } else if (node.child !== null) {\n        node.child['return'] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === workInProgress) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node['return'] === null || node['return'] === workInProgress) {\n          return;\n        }\n        node = node['return'];\n      }\n      node.sibling['return'] = node['return'];\n      node = node.sibling;\n    }\n  }\n\n  var updateHostContainer = void 0;\n  var updateHostComponent = void 0;\n  var updateHostText = void 0;\n  if (mutation) {\n    if (enableMutatingReconciler) {\n      // Mutation mode\n      updateHostContainer = function (workInProgress) {\n        // Noop\n      };\n      updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) {\n        // TODO: Type this specific to this type of component.\n        workInProgress.updateQueue = updatePayload;\n        // If the update payload indicates that there is a change or if there\n        // is a new ref we mark this as an update. All the work is done in commitWork.\n        if (updatePayload) {\n          markUpdate(workInProgress);\n        }\n      };\n      updateHostText = function (current, workInProgress, oldText, newText) {\n        // If the text differs, mark it as an update. All the work in done in commitWork.\n        if (oldText !== newText) {\n          markUpdate(workInProgress);\n        }\n      };\n    } else {\n      invariant_1(false, 'Mutating reconciler is disabled.');\n    }\n  } else if (persistence) {\n    if (enablePersistentReconciler) {\n      // Persistent host tree mode\n      var cloneInstance = persistence.cloneInstance,\n          createContainerChildSet = persistence.createContainerChildSet,\n          appendChildToContainerChildSet = persistence.appendChildToContainerChildSet,\n          finalizeContainerChildren = persistence.finalizeContainerChildren;\n\n      // An unfortunate fork of appendAllChildren because we have two different parent types.\n\n      var appendAllChildrenToContainer = function (containerChildSet, workInProgress) {\n        // We only have the top Fiber that was created but we need recurse down its\n        // children to find all the terminal nodes.\n        var node = workInProgress.child;\n        while (node !== null) {\n          if (node.tag === HostComponent || node.tag === HostText) {\n            appendChildToContainerChildSet(containerChildSet, node.stateNode);\n          } else if (node.tag === HostPortal) {\n            // If we have a portal child, then we don't want to traverse\n            // down its children. Instead, we'll get insertions from each child in\n            // the portal directly.\n          } else if (node.child !== null) {\n            node.child['return'] = node;\n            node = node.child;\n            continue;\n          }\n          if (node === workInProgress) {\n            return;\n          }\n          while (node.sibling === null) {\n            if (node['return'] === null || node['return'] === workInProgress) {\n              return;\n            }\n            node = node['return'];\n          }\n          node.sibling['return'] = node['return'];\n          node = node.sibling;\n        }\n      };\n      updateHostContainer = function (workInProgress) {\n        var portalOrRoot = workInProgress.stateNode;\n        var childrenUnchanged = workInProgress.firstEffect === null;\n        if (childrenUnchanged) {\n          // No changes, just reuse the existing instance.\n        } else {\n          var container = portalOrRoot.containerInfo;\n          var newChildSet = createContainerChildSet(container);\n          if (finalizeContainerChildren(container, newChildSet)) {\n            markUpdate(workInProgress);\n          }\n          portalOrRoot.pendingChildren = newChildSet;\n          // If children might have changed, we have to add them all to the set.\n          appendAllChildrenToContainer(newChildSet, workInProgress);\n          // Schedule an update on the container to swap out the container.\n          markUpdate(workInProgress);\n        }\n      };\n      updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) {\n        // If there are no effects associated with this node, then none of our children had any updates.\n        // This guarantees that we can reuse all of them.\n        var childrenUnchanged = workInProgress.firstEffect === null;\n        var currentInstance = current.stateNode;\n        if (childrenUnchanged && updatePayload === null) {\n          // No changes, just reuse the existing instance.\n          // Note that this might release a previous clone.\n          workInProgress.stateNode = currentInstance;\n        } else {\n          var recyclableInstance = workInProgress.stateNode;\n          var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);\n          if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance)) {\n            markUpdate(workInProgress);\n          }\n          workInProgress.stateNode = newInstance;\n          if (childrenUnchanged) {\n            // If there are no other effects in this tree, we need to flag this node as having one.\n            // Even though we're not going to use it for anything.\n            // Otherwise parents won't know that there are new children to propagate upwards.\n            markUpdate(workInProgress);\n          } else {\n            // If children might have changed, we have to add them all to the set.\n            appendAllChildren(newInstance, workInProgress);\n          }\n        }\n      };\n      updateHostText = function (current, workInProgress, oldText, newText) {\n        if (oldText !== newText) {\n          // If the text content differs, we'll create a new text instance for it.\n          var rootContainerInstance = getRootHostContainer();\n          var currentHostContext = getHostContext();\n          workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress);\n          // We'll have to mark it as having an effect, even though we won't use the effect for anything.\n          // This lets the parents know that at least one of their children has changed.\n          markUpdate(workInProgress);\n        }\n      };\n    } else {\n      invariant_1(false, 'Persistent reconciler is disabled.');\n    }\n  } else {\n    if (enableNoopReconciler) {\n      // No host operations\n      updateHostContainer = function (workInProgress) {\n        // Noop\n      };\n      updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) {\n        // Noop\n      };\n      updateHostText = function (current, workInProgress, oldText, newText) {\n        // Noop\n      };\n    } else {\n      invariant_1(false, 'Noop reconciler is disabled.');\n    }\n  }\n\n  function completeWork(current, workInProgress, renderExpirationTime) {\n    // Get the latest props.\n    var newProps = workInProgress.pendingProps;\n    if (newProps === null) {\n      newProps = workInProgress.memoizedProps;\n    } else if (workInProgress.expirationTime !== Never || renderExpirationTime === Never) {\n      // Reset the pending props, unless this was a down-prioritization.\n      workInProgress.pendingProps = null;\n    }\n\n    switch (workInProgress.tag) {\n      case FunctionalComponent:\n        return null;\n      case ClassComponent:\n        {\n          // We are leaving this subtree, so pop context if any.\n          popContextProvider(workInProgress);\n          return null;\n        }\n      case HostRoot:\n        {\n          popHostContainer(workInProgress);\n          popTopLevelContextObject(workInProgress);\n          var fiberRoot = workInProgress.stateNode;\n          if (fiberRoot.pendingContext) {\n            fiberRoot.context = fiberRoot.pendingContext;\n            fiberRoot.pendingContext = null;\n          }\n\n          if (current === null || current.child === null) {\n            // If we hydrated, pop so that we can delete any remaining children\n            // that weren't hydrated.\n            popHydrationState(workInProgress);\n            // This resets the hacky state to fix isMounted before committing.\n            // TODO: Delete this when we delete isMounted and findDOMNode.\n            workInProgress.effectTag &= ~Placement;\n          }\n          updateHostContainer(workInProgress);\n          return null;\n        }\n      case HostComponent:\n        {\n          popHostContext(workInProgress);\n          var rootContainerInstance = getRootHostContainer();\n          var type = workInProgress.type;\n          if (current !== null && workInProgress.stateNode != null) {\n            // If we have an alternate, that means this is an update and we need to\n            // schedule a side-effect to do the updates.\n            var oldProps = current.memoizedProps;\n            // If we get updated because one of our children updated, we don't\n            // have newProps so we'll have to reuse them.\n            // TODO: Split the update API as separate for the props vs. children.\n            // Even better would be if children weren't special cased at all tho.\n            var instance = workInProgress.stateNode;\n            var currentHostContext = getHostContext();\n            var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);\n\n            updateHostComponent(current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance);\n\n            if (current.ref !== workInProgress.ref) {\n              markRef(workInProgress);\n            }\n          } else {\n            if (!newProps) {\n              !(workInProgress.stateNode !== null) ? invariant_1(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n              // This can happen when we abort work.\n              return null;\n            }\n\n            var _currentHostContext = getHostContext();\n            // TODO: Move createInstance to beginWork and keep it on a context\n            // \"stack\" as the parent. Then append children as we go in beginWork\n            // or completeWork depending on we want to add then top->down or\n            // bottom->up. Top->down is faster in IE11.\n            var wasHydrated = popHydrationState(workInProgress);\n            if (wasHydrated) {\n              // TODO: Move this and createInstance step into the beginPhase\n              // to consolidate.\n              if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, _currentHostContext)) {\n                // If changes to the hydrated node needs to be applied at the\n                // commit-phase we mark this as such.\n                markUpdate(workInProgress);\n              }\n            } else {\n              var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress);\n\n              appendAllChildren(_instance, workInProgress);\n\n              // Certain renderers require commit-time effects for initial mount.\n              // (eg DOM renderer supports auto-focus for certain elements).\n              // Make sure such renderers get scheduled for later work.\n              if (finalizeInitialChildren(_instance, type, newProps, rootContainerInstance)) {\n                markUpdate(workInProgress);\n              }\n              workInProgress.stateNode = _instance;\n            }\n\n            if (workInProgress.ref !== null) {\n              // If there is a ref on a host node we need to schedule a callback\n              markRef(workInProgress);\n            }\n          }\n          return null;\n        }\n      case HostText:\n        {\n          var newText = newProps;\n          if (current && workInProgress.stateNode != null) {\n            var oldText = current.memoizedProps;\n            // If we have an alternate, that means this is an update and we need\n            // to schedule a side-effect to do the updates.\n            updateHostText(current, workInProgress, oldText, newText);\n          } else {\n            if (typeof newText !== 'string') {\n              !(workInProgress.stateNode !== null) ? invariant_1(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n              // This can happen when we abort work.\n              return null;\n            }\n            var _rootContainerInstance = getRootHostContainer();\n            var _currentHostContext2 = getHostContext();\n            var _wasHydrated = popHydrationState(workInProgress);\n            if (_wasHydrated) {\n              if (prepareToHydrateHostTextInstance(workInProgress)) {\n                markUpdate(workInProgress);\n              }\n            } else {\n              workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress);\n            }\n          }\n          return null;\n        }\n      case CallComponent:\n        return moveCallToHandlerPhase(current, workInProgress, renderExpirationTime);\n      case CallHandlerPhase:\n        // Reset the tag to now be a first phase call.\n        workInProgress.tag = CallComponent;\n        return null;\n      case ReturnComponent:\n        // Does nothing.\n        return null;\n      case Fragment:\n        return null;\n      case HostPortal:\n        popHostContainer(workInProgress);\n        updateHostContainer(workInProgress);\n        return null;\n      // Error cases\n      case IndeterminateComponent:\n        invariant_1(false, 'An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.');\n      // eslint-disable-next-line no-fallthrough\n      default:\n        invariant_1(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');\n    }\n  }\n\n  return {\n    completeWork: completeWork\n  };\n};\n\nvar invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback;\nvar hasCaughtError$1 = ReactErrorUtils.hasCaughtError;\nvar clearCaughtError$1 = ReactErrorUtils.clearCaughtError;\n\n\nvar ReactFiberCommitWork = function (config, captureError) {\n  var getPublicInstance = config.getPublicInstance,\n      mutation = config.mutation,\n      persistence = config.persistence;\n\n\n  var callComponentWillUnmountWithTimer = function (current, instance) {\n    startPhaseTimer(current, 'componentWillUnmount');\n    instance.props = current.memoizedProps;\n    instance.state = current.memoizedState;\n    instance.componentWillUnmount();\n    stopPhaseTimer();\n  };\n\n  // Capture errors so they don't interrupt unmounting.\n  function safelyCallComponentWillUnmount(current, instance) {\n    {\n      invokeGuardedCallback$2(null, callComponentWillUnmountWithTimer, null, current, instance);\n      if (hasCaughtError$1()) {\n        var unmountError = clearCaughtError$1();\n        captureError(current, unmountError);\n      }\n    }\n  }\n\n  function safelyDetachRef(current) {\n    var ref = current.ref;\n    if (ref !== null) {\n      {\n        invokeGuardedCallback$2(null, ref, null, null);\n        if (hasCaughtError$1()) {\n          var refError = clearCaughtError$1();\n          captureError(current, refError);\n        }\n      }\n    }\n  }\n\n  function commitLifeCycles(current, finishedWork) {\n    switch (finishedWork.tag) {\n      case ClassComponent:\n        {\n          var instance = finishedWork.stateNode;\n          if (finishedWork.effectTag & Update) {\n            if (current === null) {\n              startPhaseTimer(finishedWork, 'componentDidMount');\n              instance.props = finishedWork.memoizedProps;\n              instance.state = finishedWork.memoizedState;\n              instance.componentDidMount();\n              stopPhaseTimer();\n            } else {\n              var prevProps = current.memoizedProps;\n              var prevState = current.memoizedState;\n              startPhaseTimer(finishedWork, 'componentDidUpdate');\n              instance.props = finishedWork.memoizedProps;\n              instance.state = finishedWork.memoizedState;\n              instance.componentDidUpdate(prevProps, prevState);\n              stopPhaseTimer();\n            }\n          }\n          var updateQueue = finishedWork.updateQueue;\n          if (updateQueue !== null) {\n            commitCallbacks(updateQueue, instance);\n          }\n          return;\n        }\n      case HostRoot:\n        {\n          var _updateQueue = finishedWork.updateQueue;\n          if (_updateQueue !== null) {\n            var _instance = finishedWork.child !== null ? finishedWork.child.stateNode : null;\n            commitCallbacks(_updateQueue, _instance);\n          }\n          return;\n        }\n      case HostComponent:\n        {\n          var _instance2 = finishedWork.stateNode;\n\n          // Renderers may schedule work to be done after host components are mounted\n          // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n          // These effects should only be committed when components are first mounted,\n          // aka when there is no current/alternate.\n          if (current === null && finishedWork.effectTag & Update) {\n            var type = finishedWork.type;\n            var props = finishedWork.memoizedProps;\n            commitMount(_instance2, type, props, finishedWork);\n          }\n\n          return;\n        }\n      case HostText:\n        {\n          // We have no life-cycles associated with text.\n          return;\n        }\n      case HostPortal:\n        {\n          // We have no life-cycles associated with portals.\n          return;\n        }\n      default:\n        {\n          invariant_1(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');\n        }\n    }\n  }\n\n  function commitAttachRef(finishedWork) {\n    var ref = finishedWork.ref;\n    if (ref !== null) {\n      var instance = finishedWork.stateNode;\n      switch (finishedWork.tag) {\n        case HostComponent:\n          ref(getPublicInstance(instance));\n          break;\n        default:\n          ref(instance);\n      }\n    }\n  }\n\n  function commitDetachRef(current) {\n    var currentRef = current.ref;\n    if (currentRef !== null) {\n      currentRef(null);\n    }\n  }\n\n  // User-originating errors (lifecycles and refs) should not interrupt\n  // deletion, so don't let them throw. Host-originating errors should\n  // interrupt deletion, so it's okay\n  function commitUnmount(current) {\n    if (typeof onCommitUnmount === 'function') {\n      onCommitUnmount(current);\n    }\n\n    switch (current.tag) {\n      case ClassComponent:\n        {\n          safelyDetachRef(current);\n          var instance = current.stateNode;\n          if (typeof instance.componentWillUnmount === 'function') {\n            safelyCallComponentWillUnmount(current, instance);\n          }\n          return;\n        }\n      case HostComponent:\n        {\n          safelyDetachRef(current);\n          return;\n        }\n      case CallComponent:\n        {\n          commitNestedUnmounts(current.stateNode);\n          return;\n        }\n      case HostPortal:\n        {\n          // TODO: this is recursive.\n          // We are also not using this parent because\n          // the portal will get pushed immediately.\n          if (enableMutatingReconciler && mutation) {\n            unmountHostComponents(current);\n          } else if (enablePersistentReconciler && persistence) {\n            emptyPortalContainer(current);\n          }\n          return;\n        }\n    }\n  }\n\n  function commitNestedUnmounts(root) {\n    // While we're inside a removed host node we don't want to call\n    // removeChild on the inner nodes because they're removed by the top\n    // call anyway. We also want to call componentWillUnmount on all\n    // composites before this host node is removed from the tree. Therefore\n    var node = root;\n    while (true) {\n      commitUnmount(node);\n      // Visit children because they may contain more composite or host nodes.\n      // Skip portals because commitUnmount() currently visits them recursively.\n      if (node.child !== null && (\n      // If we use mutation we drill down into portals using commitUnmount above.\n      // If we don't use mutation we drill down into portals here instead.\n      !mutation || node.tag !== HostPortal)) {\n        node.child['return'] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === root) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node['return'] === null || node['return'] === root) {\n          return;\n        }\n        node = node['return'];\n      }\n      node.sibling['return'] = node['return'];\n      node = node.sibling;\n    }\n  }\n\n  function detachFiber(current) {\n    // Cut off the return pointers to disconnect it from the tree. Ideally, we\n    // should clear the child pointer of the parent alternate to let this\n    // get GC:ed but we don't know which for sure which parent is the current\n    // one so we'll settle for GC:ing the subtree of this child. This child\n    // itself will be GC:ed when the parent updates the next time.\n    current['return'] = null;\n    current.child = null;\n    if (current.alternate) {\n      current.alternate.child = null;\n      current.alternate['return'] = null;\n    }\n  }\n\n  if (!mutation) {\n    var commitContainer = void 0;\n    if (persistence) {\n      var replaceContainerChildren = persistence.replaceContainerChildren,\n          createContainerChildSet = persistence.createContainerChildSet;\n\n      var emptyPortalContainer = function (current) {\n        var portal = current.stateNode;\n        var containerInfo = portal.containerInfo;\n\n        var emptyChildSet = createContainerChildSet(containerInfo);\n        replaceContainerChildren(containerInfo, emptyChildSet);\n      };\n      commitContainer = function (finishedWork) {\n        switch (finishedWork.tag) {\n          case ClassComponent:\n            {\n              return;\n            }\n          case HostComponent:\n            {\n              return;\n            }\n          case HostText:\n            {\n              return;\n            }\n          case HostRoot:\n          case HostPortal:\n            {\n              var portalOrRoot = finishedWork.stateNode;\n              var containerInfo = portalOrRoot.containerInfo,\n                  _pendingChildren = portalOrRoot.pendingChildren;\n\n              replaceContainerChildren(containerInfo, _pendingChildren);\n              return;\n            }\n          default:\n            {\n              invariant_1(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');\n            }\n        }\n      };\n    } else {\n      commitContainer = function (finishedWork) {\n        // Noop\n      };\n    }\n    if (enablePersistentReconciler || enableNoopReconciler) {\n      return {\n        commitResetTextContent: function (finishedWork) {},\n        commitPlacement: function (finishedWork) {},\n        commitDeletion: function (current) {\n          // Detach refs and call componentWillUnmount() on the whole subtree.\n          commitNestedUnmounts(current);\n          detachFiber(current);\n        },\n        commitWork: function (current, finishedWork) {\n          commitContainer(finishedWork);\n        },\n\n        commitLifeCycles: commitLifeCycles,\n        commitAttachRef: commitAttachRef,\n        commitDetachRef: commitDetachRef\n      };\n    } else if (persistence) {\n      invariant_1(false, 'Persistent reconciler is disabled.');\n    } else {\n      invariant_1(false, 'Noop reconciler is disabled.');\n    }\n  }\n  var commitMount = mutation.commitMount,\n      commitUpdate = mutation.commitUpdate,\n      resetTextContent = mutation.resetTextContent,\n      commitTextUpdate = mutation.commitTextUpdate,\n      appendChild = mutation.appendChild,\n      appendChildToContainer = mutation.appendChildToContainer,\n      insertBefore = mutation.insertBefore,\n      insertInContainerBefore = mutation.insertInContainerBefore,\n      removeChild = mutation.removeChild,\n      removeChildFromContainer = mutation.removeChildFromContainer;\n\n\n  function getHostParentFiber(fiber) {\n    var parent = fiber['return'];\n    while (parent !== null) {\n      if (isHostParent(parent)) {\n        return parent;\n      }\n      parent = parent['return'];\n    }\n    invariant_1(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.');\n  }\n\n  function isHostParent(fiber) {\n    return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n  }\n\n  function getHostSibling(fiber) {\n    // We're going to search forward into the tree until we find a sibling host\n    // node. Unfortunately, if multiple insertions are done in a row we have to\n    // search past them. This leads to exponential search for the next sibling.\n    var node = fiber;\n    siblings: while (true) {\n      // If we didn't find anything, let's try the next sibling.\n      while (node.sibling === null) {\n        if (node['return'] === null || isHostParent(node['return'])) {\n          // If we pop out of the root or hit the parent the fiber we are the\n          // last sibling.\n          return null;\n        }\n        node = node['return'];\n      }\n      node.sibling['return'] = node['return'];\n      node = node.sibling;\n      while (node.tag !== HostComponent && node.tag !== HostText) {\n        // If it is not host node and, we might have a host node inside it.\n        // Try to search down until we find one.\n        if (node.effectTag & Placement) {\n          // If we don't have a child, try the siblings instead.\n          continue siblings;\n        }\n        // If we don't have a child, try the siblings instead.\n        // We also skip portals because they are not part of this host tree.\n        if (node.child === null || node.tag === HostPortal) {\n          continue siblings;\n        } else {\n          node.child['return'] = node;\n          node = node.child;\n        }\n      }\n      // Check if this host node is stable or about to be placed.\n      if (!(node.effectTag & Placement)) {\n        // Found it!\n        return node.stateNode;\n      }\n    }\n  }\n\n  function commitPlacement(finishedWork) {\n    // Recursively insert all host nodes into the parent.\n    var parentFiber = getHostParentFiber(finishedWork);\n    var parent = void 0;\n    var isContainer = void 0;\n    switch (parentFiber.tag) {\n      case HostComponent:\n        parent = parentFiber.stateNode;\n        isContainer = false;\n        break;\n      case HostRoot:\n        parent = parentFiber.stateNode.containerInfo;\n        isContainer = true;\n        break;\n      case HostPortal:\n        parent = parentFiber.stateNode.containerInfo;\n        isContainer = true;\n        break;\n      default:\n        invariant_1(false, 'Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.');\n    }\n    if (parentFiber.effectTag & ContentReset) {\n      // Reset the text content of the parent before doing any insertions\n      resetTextContent(parent);\n      // Clear ContentReset from the effect tag\n      parentFiber.effectTag &= ~ContentReset;\n    }\n\n    var before = getHostSibling(finishedWork);\n    // We only have the top Fiber that was inserted but we need recurse down its\n    // children to find all the terminal nodes.\n    var node = finishedWork;\n    while (true) {\n      if (node.tag === HostComponent || node.tag === HostText) {\n        if (before) {\n          if (isContainer) {\n            insertInContainerBefore(parent, node.stateNode, before);\n          } else {\n            insertBefore(parent, node.stateNode, before);\n          }\n        } else {\n          if (isContainer) {\n            appendChildToContainer(parent, node.stateNode);\n          } else {\n            appendChild(parent, node.stateNode);\n          }\n        }\n      } else if (node.tag === HostPortal) {\n        // If the insertion itself is a portal, then we don't want to traverse\n        // down its children. Instead, we'll get insertions from each child in\n        // the portal directly.\n      } else if (node.child !== null) {\n        node.child['return'] = node;\n        node = node.child;\n        continue;\n      }\n      if (node === finishedWork) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node['return'] === null || node['return'] === finishedWork) {\n          return;\n        }\n        node = node['return'];\n      }\n      node.sibling['return'] = node['return'];\n      node = node.sibling;\n    }\n  }\n\n  function unmountHostComponents(current) {\n    // We only have the top Fiber that was inserted but we need recurse down its\n    var node = current;\n\n    // Each iteration, currentParent is populated with node's host parent if not\n    // currentParentIsValid.\n    var currentParentIsValid = false;\n    var currentParent = void 0;\n    var currentParentIsContainer = void 0;\n\n    while (true) {\n      if (!currentParentIsValid) {\n        var parent = node['return'];\n        findParent: while (true) {\n          !(parent !== null) ? invariant_1(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n          switch (parent.tag) {\n            case HostComponent:\n              currentParent = parent.stateNode;\n              currentParentIsContainer = false;\n              break findParent;\n            case HostRoot:\n              currentParent = parent.stateNode.containerInfo;\n              currentParentIsContainer = true;\n              break findParent;\n            case HostPortal:\n              currentParent = parent.stateNode.containerInfo;\n              currentParentIsContainer = true;\n              break findParent;\n          }\n          parent = parent['return'];\n        }\n        currentParentIsValid = true;\n      }\n\n      if (node.tag === HostComponent || node.tag === HostText) {\n        commitNestedUnmounts(node);\n        // After all the children have unmounted, it is now safe to remove the\n        // node from the tree.\n        if (currentParentIsContainer) {\n          removeChildFromContainer(currentParent, node.stateNode);\n        } else {\n          removeChild(currentParent, node.stateNode);\n        }\n        // Don't visit children because we already visited them.\n      } else if (node.tag === HostPortal) {\n        // When we go into a portal, it becomes the parent to remove from.\n        // We will reassign it back when we pop the portal on the way up.\n        currentParent = node.stateNode.containerInfo;\n        // Visit children because portals might contain host components.\n        if (node.child !== null) {\n          node.child['return'] = node;\n          node = node.child;\n          continue;\n        }\n      } else {\n        commitUnmount(node);\n        // Visit children because we may find more host components below.\n        if (node.child !== null) {\n          node.child['return'] = node;\n          node = node.child;\n          continue;\n        }\n      }\n      if (node === current) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node['return'] === null || node['return'] === current) {\n          return;\n        }\n        node = node['return'];\n        if (node.tag === HostPortal) {\n          // When we go out of the portal, we need to restore the parent.\n          // Since we don't keep a stack of them, we will search for it.\n          currentParentIsValid = false;\n        }\n      }\n      node.sibling['return'] = node['return'];\n      node = node.sibling;\n    }\n  }\n\n  function commitDeletion(current) {\n    // Recursively delete all host nodes from the parent.\n    // Detach refs and call componentWillUnmount() on the whole subtree.\n    unmountHostComponents(current);\n    detachFiber(current);\n  }\n\n  function commitWork(current, finishedWork) {\n    switch (finishedWork.tag) {\n      case ClassComponent:\n        {\n          return;\n        }\n      case HostComponent:\n        {\n          var instance = finishedWork.stateNode;\n          if (instance != null) {\n            // Commit the work prepared earlier.\n            var newProps = finishedWork.memoizedProps;\n            // For hydration we reuse the update path but we treat the oldProps\n            // as the newProps. The updatePayload will contain the real change in\n            // this case.\n            var oldProps = current !== null ? current.memoizedProps : newProps;\n            var type = finishedWork.type;\n            // TODO: Type the updateQueue to be specific to host components.\n            var updatePayload = finishedWork.updateQueue;\n            finishedWork.updateQueue = null;\n            if (updatePayload !== null) {\n              commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);\n            }\n          }\n          return;\n        }\n      case HostText:\n        {\n          !(finishedWork.stateNode !== null) ? invariant_1(false, 'This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n          var textInstance = finishedWork.stateNode;\n          var newText = finishedWork.memoizedProps;\n          // For hydration we reuse the update path but we treat the oldProps\n          // as the newProps. The updatePayload will contain the real change in\n          // this case.\n          var oldText = current !== null ? current.memoizedProps : newText;\n          commitTextUpdate(textInstance, oldText, newText);\n          return;\n        }\n      case HostRoot:\n        {\n          return;\n        }\n      default:\n        {\n          invariant_1(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');\n        }\n    }\n  }\n\n  function commitResetTextContent(current) {\n    resetTextContent(current.stateNode);\n  }\n\n  if (enableMutatingReconciler) {\n    return {\n      commitResetTextContent: commitResetTextContent,\n      commitPlacement: commitPlacement,\n      commitDeletion: commitDeletion,\n      commitWork: commitWork,\n      commitLifeCycles: commitLifeCycles,\n      commitAttachRef: commitAttachRef,\n      commitDetachRef: commitDetachRef\n    };\n  } else {\n    invariant_1(false, 'Mutating reconciler is disabled.');\n  }\n};\n\nvar NO_CONTEXT = {};\n\nvar ReactFiberHostContext = function (config) {\n  var getChildHostContext = config.getChildHostContext,\n      getRootHostContext = config.getRootHostContext;\n\n\n  var contextStackCursor = createCursor(NO_CONTEXT);\n  var contextFiberStackCursor = createCursor(NO_CONTEXT);\n  var rootInstanceStackCursor = createCursor(NO_CONTEXT);\n\n  function requiredContext(c) {\n    !(c !== NO_CONTEXT) ? invariant_1(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    return c;\n  }\n\n  function getRootHostContainer() {\n    var rootInstance = requiredContext(rootInstanceStackCursor.current);\n    return rootInstance;\n  }\n\n  function pushHostContainer(fiber, nextRootInstance) {\n    // Push current root instance onto the stack;\n    // This allows us to reset root when portals are popped.\n    push(rootInstanceStackCursor, nextRootInstance, fiber);\n\n    var nextRootContext = getRootHostContext(nextRootInstance);\n\n    // Track the context and the Fiber that provided it.\n    // This enables us to pop only Fibers that provide unique contexts.\n    push(contextFiberStackCursor, fiber, fiber);\n    push(contextStackCursor, nextRootContext, fiber);\n  }\n\n  function popHostContainer(fiber) {\n    pop(contextStackCursor, fiber);\n    pop(contextFiberStackCursor, fiber);\n    pop(rootInstanceStackCursor, fiber);\n  }\n\n  function getHostContext() {\n    var context = requiredContext(contextStackCursor.current);\n    return context;\n  }\n\n  function pushHostContext(fiber) {\n    var rootInstance = requiredContext(rootInstanceStackCursor.current);\n    var context = requiredContext(contextStackCursor.current);\n    var nextContext = getChildHostContext(context, fiber.type, rootInstance);\n\n    // Don't push this Fiber's context unless it's unique.\n    if (context === nextContext) {\n      return;\n    }\n\n    // Track the context and the Fiber that provided it.\n    // This enables us to pop only Fibers that provide unique contexts.\n    push(contextFiberStackCursor, fiber, fiber);\n    push(contextStackCursor, nextContext, fiber);\n  }\n\n  function popHostContext(fiber) {\n    // Do not pop unless this Fiber provided the current context.\n    // pushHostContext() only pushes Fibers that provide unique contexts.\n    if (contextFiberStackCursor.current !== fiber) {\n      return;\n    }\n\n    pop(contextStackCursor, fiber);\n    pop(contextFiberStackCursor, fiber);\n  }\n\n  function resetHostContainer() {\n    contextStackCursor.current = NO_CONTEXT;\n    rootInstanceStackCursor.current = NO_CONTEXT;\n  }\n\n  return {\n    getHostContext: getHostContext,\n    getRootHostContainer: getRootHostContainer,\n    popHostContainer: popHostContainer,\n    popHostContext: popHostContext,\n    pushHostContainer: pushHostContainer,\n    pushHostContext: pushHostContext,\n    resetHostContainer: resetHostContainer\n  };\n};\n\nvar ReactFiberHydrationContext = function (config) {\n  var shouldSetTextContent = config.shouldSetTextContent,\n      hydration = config.hydration;\n\n  // If this doesn't have hydration mode.\n\n  if (!hydration) {\n    return {\n      enterHydrationState: function () {\n        return false;\n      },\n      resetHydrationState: function () {},\n      tryToClaimNextHydratableInstance: function () {},\n      prepareToHydrateHostInstance: function () {\n        invariant_1(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');\n      },\n      prepareToHydrateHostTextInstance: function () {\n        invariant_1(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');\n      },\n      popHydrationState: function (fiber) {\n        return false;\n      }\n    };\n  }\n\n  var canHydrateInstance = hydration.canHydrateInstance,\n      canHydrateTextInstance = hydration.canHydrateTextInstance,\n      getNextHydratableSibling = hydration.getNextHydratableSibling,\n      getFirstHydratableChild = hydration.getFirstHydratableChild,\n      hydrateInstance = hydration.hydrateInstance,\n      hydrateTextInstance = hydration.hydrateTextInstance,\n      didNotMatchHydratedContainerTextInstance = hydration.didNotMatchHydratedContainerTextInstance,\n      didNotMatchHydratedTextInstance = hydration.didNotMatchHydratedTextInstance,\n      didNotHydrateContainerInstance = hydration.didNotHydrateContainerInstance,\n      didNotHydrateInstance = hydration.didNotHydrateInstance,\n      didNotFindHydratableContainerInstance = hydration.didNotFindHydratableContainerInstance,\n      didNotFindHydratableContainerTextInstance = hydration.didNotFindHydratableContainerTextInstance,\n      didNotFindHydratableInstance = hydration.didNotFindHydratableInstance,\n      didNotFindHydratableTextInstance = hydration.didNotFindHydratableTextInstance;\n\n  // The deepest Fiber on the stack involved in a hydration context.\n  // This may have been an insertion or a hydration.\n\n  var hydrationParentFiber = null;\n  var nextHydratableInstance = null;\n  var isHydrating = false;\n\n  function enterHydrationState(fiber) {\n    var parentInstance = fiber.stateNode.containerInfo;\n    nextHydratableInstance = getFirstHydratableChild(parentInstance);\n    hydrationParentFiber = fiber;\n    isHydrating = true;\n    return true;\n  }\n\n  function deleteHydratableInstance(returnFiber, instance) {\n    {\n      switch (returnFiber.tag) {\n        case HostRoot:\n          didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);\n          break;\n        case HostComponent:\n          didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);\n          break;\n      }\n    }\n\n    var childToDelete = createFiberFromHostInstanceForDeletion();\n    childToDelete.stateNode = instance;\n    childToDelete['return'] = returnFiber;\n    childToDelete.effectTag = Deletion;\n\n    // This might seem like it belongs on progressedFirstDeletion. However,\n    // these children are not part of the reconciliation list of children.\n    // Even if we abort and rereconcile the children, that will try to hydrate\n    // again and the nodes are still in the host tree so these will be\n    // recreated.\n    if (returnFiber.lastEffect !== null) {\n      returnFiber.lastEffect.nextEffect = childToDelete;\n      returnFiber.lastEffect = childToDelete;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n    }\n  }\n\n  function insertNonHydratedInstance(returnFiber, fiber) {\n    fiber.effectTag |= Placement;\n    {\n      switch (returnFiber.tag) {\n        case HostRoot:\n          {\n            var parentContainer = returnFiber.stateNode.containerInfo;\n            switch (fiber.tag) {\n              case HostComponent:\n                var type = fiber.type;\n                var props = fiber.pendingProps;\n                didNotFindHydratableContainerInstance(parentContainer, type, props);\n                break;\n              case HostText:\n                var text = fiber.pendingProps;\n                didNotFindHydratableContainerTextInstance(parentContainer, text);\n                break;\n            }\n            break;\n          }\n        case HostComponent:\n          {\n            var parentType = returnFiber.type;\n            var parentProps = returnFiber.memoizedProps;\n            var parentInstance = returnFiber.stateNode;\n            switch (fiber.tag) {\n              case HostComponent:\n                var _type = fiber.type;\n                var _props = fiber.pendingProps;\n                didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);\n                break;\n              case HostText:\n                var _text = fiber.pendingProps;\n                didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);\n                break;\n            }\n            break;\n          }\n        default:\n          return;\n      }\n    }\n  }\n\n  function tryHydrate(fiber, nextInstance) {\n    switch (fiber.tag) {\n      case HostComponent:\n        {\n          var type = fiber.type;\n          var props = fiber.pendingProps;\n          var instance = canHydrateInstance(nextInstance, type, props);\n          if (instance !== null) {\n            fiber.stateNode = instance;\n            return true;\n          }\n          return false;\n        }\n      case HostText:\n        {\n          var text = fiber.pendingProps;\n          var textInstance = canHydrateTextInstance(nextInstance, text);\n          if (textInstance !== null) {\n            fiber.stateNode = textInstance;\n            return true;\n          }\n          return false;\n        }\n      default:\n        return false;\n    }\n  }\n\n  function tryToClaimNextHydratableInstance(fiber) {\n    if (!isHydrating) {\n      return;\n    }\n    var nextInstance = nextHydratableInstance;\n    if (!nextInstance) {\n      // Nothing to hydrate. Make it an insertion.\n      insertNonHydratedInstance(hydrationParentFiber, fiber);\n      isHydrating = false;\n      hydrationParentFiber = fiber;\n      return;\n    }\n    if (!tryHydrate(fiber, nextInstance)) {\n      // If we can't hydrate this instance let's try the next one.\n      // We use this as a heuristic. It's based on intuition and not data so it\n      // might be flawed or unnecessary.\n      nextInstance = getNextHydratableSibling(nextInstance);\n      if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n        // Nothing to hydrate. Make it an insertion.\n        insertNonHydratedInstance(hydrationParentFiber, fiber);\n        isHydrating = false;\n        hydrationParentFiber = fiber;\n        return;\n      }\n      // We matched the next one, we'll now assume that the first one was\n      // superfluous and we'll delete it. Since we can't eagerly delete it\n      // we'll have to schedule a deletion. To do that, this node needs a dummy\n      // fiber associated with it.\n      deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);\n    }\n    hydrationParentFiber = fiber;\n    nextHydratableInstance = getFirstHydratableChild(nextInstance);\n  }\n\n  function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n    var instance = fiber.stateNode;\n    var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);\n    // TODO: Type this specific to this type of component.\n    fiber.updateQueue = updatePayload;\n    // If the update payload indicates that there is a change or if there\n    // is a new ref we mark this as an update.\n    if (updatePayload !== null) {\n      return true;\n    }\n    return false;\n  }\n\n  function prepareToHydrateHostTextInstance(fiber) {\n    var textInstance = fiber.stateNode;\n    var textContent = fiber.memoizedProps;\n    var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n    {\n      if (shouldUpdate) {\n        // We assume that prepareToHydrateHostTextInstance is called in a context where the\n        // hydration parent is the parent host component of this host text.\n        var returnFiber = hydrationParentFiber;\n        if (returnFiber !== null) {\n          switch (returnFiber.tag) {\n            case HostRoot:\n              {\n                var parentContainer = returnFiber.stateNode.containerInfo;\n                didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);\n                break;\n              }\n            case HostComponent:\n              {\n                var parentType = returnFiber.type;\n                var parentProps = returnFiber.memoizedProps;\n                var parentInstance = returnFiber.stateNode;\n                didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);\n                break;\n              }\n          }\n        }\n      }\n    }\n    return shouldUpdate;\n  }\n\n  function popToNextHostParent(fiber) {\n    var parent = fiber['return'];\n    while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot) {\n      parent = parent['return'];\n    }\n    hydrationParentFiber = parent;\n  }\n\n  function popHydrationState(fiber) {\n    if (fiber !== hydrationParentFiber) {\n      // We're deeper than the current hydration context, inside an inserted\n      // tree.\n      return false;\n    }\n    if (!isHydrating) {\n      // If we're not currently hydrating but we're in a hydration context, then\n      // we were an insertion and now need to pop up reenter hydration of our\n      // siblings.\n      popToNextHostParent(fiber);\n      isHydrating = true;\n      return false;\n    }\n\n    var type = fiber.type;\n\n    // If we have any remaining hydratable nodes, we need to delete them now.\n    // We only do this deeper than head and body since they tend to have random\n    // other nodes in them. We also ignore components with pure text content in\n    // side of them.\n    // TODO: Better heuristic.\n    if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {\n      var nextInstance = nextHydratableInstance;\n      while (nextInstance) {\n        deleteHydratableInstance(fiber, nextInstance);\n        nextInstance = getNextHydratableSibling(nextInstance);\n      }\n    }\n\n    popToNextHostParent(fiber);\n    nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n    return true;\n  }\n\n  function resetHydrationState() {\n    hydrationParentFiber = null;\n    nextHydratableInstance = null;\n    isHydrating = false;\n  }\n\n  return {\n    enterHydrationState: enterHydrationState,\n    resetHydrationState: resetHydrationState,\n    tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance,\n    prepareToHydrateHostInstance: prepareToHydrateHostInstance,\n    prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance,\n    popHydrationState: popHydrationState\n  };\n};\n\n// This lets us hook into Fiber to debug what it's doing.\n// See https://github.com/facebook/react/pull/8033.\n// This is not part of the public API, not even for React DevTools.\n// You may only inject a debugTool if you work on React Fiber itself.\nvar ReactFiberInstrumentation = {\n  debugTool: null\n};\n\nvar ReactFiberInstrumentation_1 = ReactFiberInstrumentation;\n\nvar defaultShowDialog = function (capturedError) {\n  return true;\n};\n\nvar showDialog = defaultShowDialog;\n\nfunction logCapturedError(capturedError) {\n  var logError = showDialog(capturedError);\n\n  // Allow injected showDialog() to prevent default console.error logging.\n  // This enables renderers like ReactNative to better manage redbox behavior.\n  if (logError === false) {\n    return;\n  }\n\n  var error = capturedError.error;\n  var suppressLogging = error && error.suppressReactErrorLogging;\n  if (suppressLogging) {\n    return;\n  }\n\n  {\n    var componentName = capturedError.componentName,\n        componentStack = capturedError.componentStack,\n        errorBoundaryName = capturedError.errorBoundaryName,\n        errorBoundaryFound = capturedError.errorBoundaryFound,\n        willRetry = capturedError.willRetry;\n\n\n    var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:';\n\n    var errorBoundaryMessage = void 0;\n    // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.\n    if (errorBoundaryFound && errorBoundaryName) {\n      if (willRetry) {\n        errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.');\n      } else {\n        errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '.\\n' + 'Recreating the tree from scratch failed so React will unmount the tree.';\n      }\n    } else {\n      errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';\n    }\n    var combinedMessage = '' + componentNameMessage + componentStack + '\\n\\n' + ('' + errorBoundaryMessage);\n\n    // In development, we provide our own message with just the component stack.\n    // We don't include the original error message and JS stack because the browser\n    // has already printed it. Even if the application swallows the error, it is still\n    // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n    console.error(combinedMessage);\n  }\n}\n\nvar invokeGuardedCallback$1 = ReactErrorUtils.invokeGuardedCallback;\nvar hasCaughtError = ReactErrorUtils.hasCaughtError;\nvar clearCaughtError = ReactErrorUtils.clearCaughtError;\n\n\n{\n  var didWarnAboutStateTransition = false;\n  var didWarnSetStateChildContext = false;\n  var didWarnStateUpdateForUnmountedComponent = {};\n\n  var warnAboutUpdateOnUnmounted = function (fiber) {\n    var componentName = getComponentName(fiber) || 'ReactClass';\n    if (didWarnStateUpdateForUnmountedComponent[componentName]) {\n      return;\n    }\n    warning_1(false, 'Can only update a mounted or mounting ' + 'component. This usually means you called setState, replaceState, ' + 'or forceUpdate on an unmounted component. This is a no-op.\\n\\nPlease ' + 'check the code for the %s component.', componentName);\n    didWarnStateUpdateForUnmountedComponent[componentName] = true;\n  };\n\n  var warnAboutInvalidUpdates = function (instance) {\n    switch (ReactDebugCurrentFiber.phase) {\n      case 'getChildContext':\n        if (didWarnSetStateChildContext) {\n          return;\n        }\n        warning_1(false, 'setState(...): Cannot call setState() inside getChildContext()');\n        didWarnSetStateChildContext = true;\n        break;\n      case 'render':\n        if (didWarnAboutStateTransition) {\n          return;\n        }\n        warning_1(false, 'Cannot update during an existing state transition (such as within ' + \"`render` or another component's constructor). Render methods should \" + 'be a pure function of props and state; constructor side-effects are ' + 'an anti-pattern, but can be moved to `componentWillMount`.');\n        didWarnAboutStateTransition = true;\n        break;\n    }\n  };\n}\n\nvar ReactFiberScheduler = function (config) {\n  var hostContext = ReactFiberHostContext(config);\n  var hydrationContext = ReactFiberHydrationContext(config);\n  var popHostContainer = hostContext.popHostContainer,\n      popHostContext = hostContext.popHostContext,\n      resetHostContainer = hostContext.resetHostContainer;\n\n  var _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber),\n      beginWork = _ReactFiberBeginWork.beginWork,\n      beginFailedWork = _ReactFiberBeginWork.beginFailedWork;\n\n  var _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext),\n      completeWork = _ReactFiberCompleteWo.completeWork;\n\n  var _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError),\n      commitResetTextContent = _ReactFiberCommitWork.commitResetTextContent,\n      commitPlacement = _ReactFiberCommitWork.commitPlacement,\n      commitDeletion = _ReactFiberCommitWork.commitDeletion,\n      commitWork = _ReactFiberCommitWork.commitWork,\n      commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles,\n      commitAttachRef = _ReactFiberCommitWork.commitAttachRef,\n      commitDetachRef = _ReactFiberCommitWork.commitDetachRef;\n\n  var now = config.now,\n      scheduleDeferredCallback = config.scheduleDeferredCallback,\n      cancelDeferredCallback = config.cancelDeferredCallback,\n      useSyncScheduling = config.useSyncScheduling,\n      prepareForCommit = config.prepareForCommit,\n      resetAfterCommit = config.resetAfterCommit;\n\n  // Represents the current time in ms.\n\n  var startTime = now();\n  var mostRecentCurrentTime = msToExpirationTime(0);\n\n  // Represents the expiration time that incoming updates should use. (If this\n  // is NoWork, use the default strategy: async updates in async mode, sync\n  // updates in sync mode.)\n  var expirationContext = NoWork;\n\n  var isWorking = false;\n\n  // The next work in progress fiber that we're currently working on.\n  var nextUnitOfWork = null;\n  var nextRoot = null;\n  // The time at which we're currently rendering work.\n  var nextRenderExpirationTime = NoWork;\n\n  // The next fiber with an effect that we're currently committing.\n  var nextEffect = null;\n\n  // Keep track of which fibers have captured an error that need to be handled.\n  // Work is removed from this collection after componentDidCatch is called.\n  var capturedErrors = null;\n  // Keep track of which fibers have failed during the current batch of work.\n  // This is a different set than capturedErrors, because it is not reset until\n  // the end of the batch. This is needed to propagate errors correctly if a\n  // subtree fails more than once.\n  var failedBoundaries = null;\n  // Error boundaries that captured an error during the current commit.\n  var commitPhaseBoundaries = null;\n  var firstUncaughtError = null;\n  var didFatal = false;\n\n  var isCommitting = false;\n  var isUnmounting = false;\n\n  // Used for performance tracking.\n  var interruptedBy = null;\n\n  function resetContextStack() {\n    // Reset the stack\n    reset$1();\n    // Reset the cursors\n    resetContext();\n    resetHostContainer();\n  }\n\n  function commitAllHostEffects() {\n    while (nextEffect !== null) {\n      {\n        ReactDebugCurrentFiber.setCurrentFiber(nextEffect);\n      }\n      recordEffect();\n\n      var effectTag = nextEffect.effectTag;\n      if (effectTag & ContentReset) {\n        commitResetTextContent(nextEffect);\n      }\n\n      if (effectTag & Ref) {\n        var current = nextEffect.alternate;\n        if (current !== null) {\n          commitDetachRef(current);\n        }\n      }\n\n      // The following switch statement is only concerned about placement,\n      // updates, and deletions. To avoid needing to add a case for every\n      // possible bitmap value, we remove the secondary effects from the\n      // effect tag and switch on that value.\n      var primaryEffectTag = effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork);\n      switch (primaryEffectTag) {\n        case Placement:\n          {\n            commitPlacement(nextEffect);\n            // Clear the \"placement\" from effect tag so that we know that this is inserted, before\n            // any life-cycles like componentDidMount gets called.\n            // TODO: findDOMNode doesn't rely on this any more but isMounted\n            // does and isMounted is deprecated anyway so we should be able\n            // to kill this.\n            nextEffect.effectTag &= ~Placement;\n            break;\n          }\n        case PlacementAndUpdate:\n          {\n            // Placement\n            commitPlacement(nextEffect);\n            // Clear the \"placement\" from effect tag so that we know that this is inserted, before\n            // any life-cycles like componentDidMount gets called.\n            nextEffect.effectTag &= ~Placement;\n\n            // Update\n            var _current = nextEffect.alternate;\n            commitWork(_current, nextEffect);\n            break;\n          }\n        case Update:\n          {\n            var _current2 = nextEffect.alternate;\n            commitWork(_current2, nextEffect);\n            break;\n          }\n        case Deletion:\n          {\n            isUnmounting = true;\n            commitDeletion(nextEffect);\n            isUnmounting = false;\n            break;\n          }\n      }\n      nextEffect = nextEffect.nextEffect;\n    }\n\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n  }\n\n  function commitAllLifeCycles() {\n    while (nextEffect !== null) {\n      var effectTag = nextEffect.effectTag;\n\n      if (effectTag & (Update | Callback)) {\n        recordEffect();\n        var current = nextEffect.alternate;\n        commitLifeCycles(current, nextEffect);\n      }\n\n      if (effectTag & Ref) {\n        recordEffect();\n        commitAttachRef(nextEffect);\n      }\n\n      if (effectTag & Err) {\n        recordEffect();\n        commitErrorHandling(nextEffect);\n      }\n\n      var next = nextEffect.nextEffect;\n      // Ensure that we clean these up so that we don't accidentally keep them.\n      // I'm not actually sure this matters because we can't reset firstEffect\n      // and lastEffect since they're on every node, not just the effectful\n      // ones. So we have to clean everything as we reuse nodes anyway.\n      nextEffect.nextEffect = null;\n      // Ensure that we reset the effectTag here so that we can rely on effect\n      // tags to reason about the current life-cycle.\n      nextEffect = next;\n    }\n  }\n\n  function commitRoot(finishedWork) {\n    // We keep track of this so that captureError can collect any boundaries\n    // that capture an error during the commit phase. The reason these aren't\n    // local to this function is because errors that occur during cWU are\n    // captured elsewhere, to prevent the unmount from being interrupted.\n    isWorking = true;\n    isCommitting = true;\n    startCommitTimer();\n\n    var root = finishedWork.stateNode;\n    !(root.current !== finishedWork) ? invariant_1(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    root.isReadyForCommit = false;\n\n    // Reset this to null before calling lifecycles\n    ReactCurrentOwner.current = null;\n\n    var firstEffect = void 0;\n    if (finishedWork.effectTag > PerformedWork) {\n      // A fiber's effect list consists only of its children, not itself. So if\n      // the root has an effect, we need to add it to the end of the list. The\n      // resulting list is the set that would belong to the root's parent, if\n      // it had one; that is, all the effects in the tree including the root.\n      if (finishedWork.lastEffect !== null) {\n        finishedWork.lastEffect.nextEffect = finishedWork;\n        firstEffect = finishedWork.firstEffect;\n      } else {\n        firstEffect = finishedWork;\n      }\n    } else {\n      // There is no effect on the root.\n      firstEffect = finishedWork.firstEffect;\n    }\n\n    prepareForCommit();\n\n    // Commit all the side-effects within a tree. We'll do this in two passes.\n    // The first pass performs all the host insertions, updates, deletions and\n    // ref unmounts.\n    nextEffect = firstEffect;\n    startCommitHostEffectsTimer();\n    while (nextEffect !== null) {\n      var didError = false;\n      var _error = void 0;\n      {\n        invokeGuardedCallback$1(null, commitAllHostEffects, null);\n        if (hasCaughtError()) {\n          didError = true;\n          _error = clearCaughtError();\n        }\n      }\n      if (didError) {\n        !(nextEffect !== null) ? invariant_1(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n        captureError(nextEffect, _error);\n        // Clean-up\n        if (nextEffect !== null) {\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    }\n    stopCommitHostEffectsTimer();\n\n    resetAfterCommit();\n\n    // The work-in-progress tree is now the current tree. This must come after\n    // the first pass of the commit phase, so that the previous tree is still\n    // current during componentWillUnmount, but before the second pass, so that\n    // the finished work is current during componentDidMount/Update.\n    root.current = finishedWork;\n\n    // In the second pass we'll perform all life-cycles and ref callbacks.\n    // Life-cycles happen as a separate pass so that all placements, updates,\n    // and deletions in the entire tree have already been invoked.\n    // This pass also triggers any renderer-specific initial effects.\n    nextEffect = firstEffect;\n    startCommitLifeCyclesTimer();\n    while (nextEffect !== null) {\n      var _didError = false;\n      var _error2 = void 0;\n      {\n        invokeGuardedCallback$1(null, commitAllLifeCycles, null);\n        if (hasCaughtError()) {\n          _didError = true;\n          _error2 = clearCaughtError();\n        }\n      }\n      if (_didError) {\n        !(nextEffect !== null) ? invariant_1(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n        captureError(nextEffect, _error2);\n        if (nextEffect !== null) {\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    }\n\n    isCommitting = false;\n    isWorking = false;\n    stopCommitLifeCyclesTimer();\n    stopCommitTimer();\n    if (typeof onCommitRoot === 'function') {\n      onCommitRoot(finishedWork.stateNode);\n    }\n    if (true && ReactFiberInstrumentation_1.debugTool) {\n      ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork);\n    }\n\n    // If we caught any errors during this commit, schedule their boundaries\n    // to update.\n    if (commitPhaseBoundaries) {\n      commitPhaseBoundaries.forEach(scheduleErrorRecovery);\n      commitPhaseBoundaries = null;\n    }\n\n    if (firstUncaughtError !== null) {\n      var _error3 = firstUncaughtError;\n      firstUncaughtError = null;\n      onUncaughtError(_error3);\n    }\n\n    var remainingTime = root.current.expirationTime;\n\n    if (remainingTime === NoWork) {\n      capturedErrors = null;\n      failedBoundaries = null;\n    }\n\n    return remainingTime;\n  }\n\n  function resetExpirationTime(workInProgress, renderTime) {\n    if (renderTime !== Never && workInProgress.expirationTime === Never) {\n      // The children of this component are hidden. Don't bubble their\n      // expiration times.\n      return;\n    }\n\n    // Check for pending updates.\n    var newExpirationTime = getUpdateExpirationTime(workInProgress);\n\n    // TODO: Calls need to visit stateNode\n\n    // Bubble up the earliest expiration time.\n    var child = workInProgress.child;\n    while (child !== null) {\n      if (child.expirationTime !== NoWork && (newExpirationTime === NoWork || newExpirationTime > child.expirationTime)) {\n        newExpirationTime = child.expirationTime;\n      }\n      child = child.sibling;\n    }\n    workInProgress.expirationTime = newExpirationTime;\n  }\n\n  function completeUnitOfWork(workInProgress) {\n    while (true) {\n      // The current, flushed, state of this fiber is the alternate.\n      // Ideally nothing should rely on this, but relying on it here\n      // means that we don't need an additional field on the work in\n      // progress.\n      var current = workInProgress.alternate;\n      {\n        ReactDebugCurrentFiber.setCurrentFiber(workInProgress);\n      }\n      var next = completeWork(current, workInProgress, nextRenderExpirationTime);\n      {\n        ReactDebugCurrentFiber.resetCurrentFiber();\n      }\n\n      var returnFiber = workInProgress['return'];\n      var siblingFiber = workInProgress.sibling;\n\n      resetExpirationTime(workInProgress, nextRenderExpirationTime);\n\n      if (next !== null) {\n        stopWorkTimer(workInProgress);\n        if (true && ReactFiberInstrumentation_1.debugTool) {\n          ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);\n        }\n        // If completing this work spawned new work, do that next. We'll come\n        // back here again.\n        return next;\n      }\n\n      if (returnFiber !== null) {\n        // Append all the effects of the subtree and this fiber onto the effect\n        // list of the parent. The completion order of the children affects the\n        // side-effect order.\n        if (returnFiber.firstEffect === null) {\n          returnFiber.firstEffect = workInProgress.firstEffect;\n        }\n        if (workInProgress.lastEffect !== null) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;\n          }\n          returnFiber.lastEffect = workInProgress.lastEffect;\n        }\n\n        // If this fiber had side-effects, we append it AFTER the children's\n        // side-effects. We can perform certain side-effects earlier if\n        // needed, by doing multiple passes over the effect list. We don't want\n        // to schedule our own side-effect on our own list because if end up\n        // reusing children we'll schedule this effect onto itself since we're\n        // at the end.\n        var effectTag = workInProgress.effectTag;\n        // Skip both NoWork and PerformedWork tags when creating the effect list.\n        // PerformedWork effect is read by React DevTools but shouldn't be committed.\n        if (effectTag > PerformedWork) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = workInProgress;\n          } else {\n            returnFiber.firstEffect = workInProgress;\n          }\n          returnFiber.lastEffect = workInProgress;\n        }\n      }\n\n      stopWorkTimer(workInProgress);\n      if (true && ReactFiberInstrumentation_1.debugTool) {\n        ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);\n      }\n\n      if (siblingFiber !== null) {\n        // If there is more work to do in this returnFiber, do that next.\n        return siblingFiber;\n      } else if (returnFiber !== null) {\n        // If there's no more work in this returnFiber. Complete the returnFiber.\n        workInProgress = returnFiber;\n        continue;\n      } else {\n        // We've reached the root.\n        var root = workInProgress.stateNode;\n        root.isReadyForCommit = true;\n        return null;\n      }\n    }\n\n    // Without this explicit null return Flow complains of invalid return type\n    // TODO Remove the above while(true) loop\n    // eslint-disable-next-line no-unreachable\n    return null;\n  }\n\n  function performUnitOfWork(workInProgress) {\n    // The current, flushed, state of this fiber is the alternate.\n    // Ideally nothing should rely on this, but relying on it here\n    // means that we don't need an additional field on the work in\n    // progress.\n    var current = workInProgress.alternate;\n\n    // See if beginning this work spawns more work.\n    startWorkTimer(workInProgress);\n    {\n      ReactDebugCurrentFiber.setCurrentFiber(workInProgress);\n    }\n\n    var next = beginWork(current, workInProgress, nextRenderExpirationTime);\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n    if (true && ReactFiberInstrumentation_1.debugTool) {\n      ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);\n    }\n\n    if (next === null) {\n      // If this doesn't spawn new work, complete the current work.\n      next = completeUnitOfWork(workInProgress);\n    }\n\n    ReactCurrentOwner.current = null;\n\n    return next;\n  }\n\n  function performFailedUnitOfWork(workInProgress) {\n    // The current, flushed, state of this fiber is the alternate.\n    // Ideally nothing should rely on this, but relying on it here\n    // means that we don't need an additional field on the work in\n    // progress.\n    var current = workInProgress.alternate;\n\n    // See if beginning this work spawns more work.\n    startWorkTimer(workInProgress);\n    {\n      ReactDebugCurrentFiber.setCurrentFiber(workInProgress);\n    }\n    var next = beginFailedWork(current, workInProgress, nextRenderExpirationTime);\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n    if (true && ReactFiberInstrumentation_1.debugTool) {\n      ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);\n    }\n\n    if (next === null) {\n      // If this doesn't spawn new work, complete the current work.\n      next = completeUnitOfWork(workInProgress);\n    }\n\n    ReactCurrentOwner.current = null;\n\n    return next;\n  }\n\n  function workLoop(expirationTime) {\n    if (capturedErrors !== null) {\n      // If there are unhandled errors, switch to the slow work loop.\n      // TODO: How to avoid this check in the fast path? Maybe the renderer\n      // could keep track of which roots have unhandled errors and call a\n      // forked version of renderRoot.\n      slowWorkLoopThatChecksForFailedWork(expirationTime);\n      return;\n    }\n    if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) {\n      return;\n    }\n\n    if (nextRenderExpirationTime <= mostRecentCurrentTime) {\n      // Flush all expired work.\n      while (nextUnitOfWork !== null) {\n        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n      }\n    } else {\n      // Flush asynchronous work until the deadline runs out of time.\n      while (nextUnitOfWork !== null && !shouldYield()) {\n        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n      }\n    }\n  }\n\n  function slowWorkLoopThatChecksForFailedWork(expirationTime) {\n    if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) {\n      return;\n    }\n\n    if (nextRenderExpirationTime <= mostRecentCurrentTime) {\n      // Flush all expired work.\n      while (nextUnitOfWork !== null) {\n        if (hasCapturedError(nextUnitOfWork)) {\n          // Use a forked version of performUnitOfWork\n          nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);\n        } else {\n          nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n        }\n      }\n    } else {\n      // Flush asynchronous work until the deadline runs out of time.\n      while (nextUnitOfWork !== null && !shouldYield()) {\n        if (hasCapturedError(nextUnitOfWork)) {\n          // Use a forked version of performUnitOfWork\n          nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork);\n        } else {\n          nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n        }\n      }\n    }\n  }\n\n  function renderRootCatchBlock(root, failedWork, boundary, expirationTime) {\n    // We're going to restart the error boundary that captured the error.\n    // Conceptually, we're unwinding the stack. We need to unwind the\n    // context stack, too.\n    unwindContexts(failedWork, boundary);\n\n    // Restart the error boundary using a forked version of\n    // performUnitOfWork that deletes the boundary's children. The entire\n    // failed subree will be unmounted. During the commit phase, a special\n    // lifecycle method is called on the error boundary, which triggers\n    // a re-render.\n    nextUnitOfWork = performFailedUnitOfWork(boundary);\n\n    // Continue working.\n    workLoop(expirationTime);\n  }\n\n  function renderRoot(root, expirationTime) {\n    !!isWorking ? invariant_1(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    isWorking = true;\n\n    // We're about to mutate the work-in-progress tree. If the root was pending\n    // commit, it no longer is: we'll need to complete it again.\n    root.isReadyForCommit = false;\n\n    // Check if we're starting from a fresh stack, or if we're resuming from\n    // previously yielded work.\n    if (root !== nextRoot || expirationTime !== nextRenderExpirationTime || nextUnitOfWork === null) {\n      // Reset the stack and start working from the root.\n      resetContextStack();\n      nextRoot = root;\n      nextRenderExpirationTime = expirationTime;\n      nextUnitOfWork = createWorkInProgress(nextRoot.current, null, expirationTime);\n    }\n\n    startWorkLoopTimer(nextUnitOfWork);\n\n    var didError = false;\n    var error = null;\n    {\n      invokeGuardedCallback$1(null, workLoop, null, expirationTime);\n      if (hasCaughtError()) {\n        didError = true;\n        error = clearCaughtError();\n      }\n    }\n\n    // An error was thrown during the render phase.\n    while (didError) {\n      if (didFatal) {\n        // This was a fatal error. Don't attempt to recover from it.\n        firstUncaughtError = error;\n        break;\n      }\n\n      var failedWork = nextUnitOfWork;\n      if (failedWork === null) {\n        // An error was thrown but there's no current unit of work. This can\n        // happen during the commit phase if there's a bug in the renderer.\n        didFatal = true;\n        continue;\n      }\n\n      // \"Capture\" the error by finding the nearest boundary. If there is no\n      // error boundary, we use the root.\n      var boundary = captureError(failedWork, error);\n      !(boundary !== null) ? invariant_1(false, 'Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n      if (didFatal) {\n        // The error we just captured was a fatal error. This happens\n        // when the error propagates to the root more than once.\n        continue;\n      }\n\n      didError = false;\n      error = null;\n      {\n        invokeGuardedCallback$1(null, renderRootCatchBlock, null, root, failedWork, boundary, expirationTime);\n        if (hasCaughtError()) {\n          didError = true;\n          error = clearCaughtError();\n          continue;\n        }\n      }\n      // We're finished working. Exit the error loop.\n      break;\n    }\n\n    var uncaughtError = firstUncaughtError;\n\n    // We're done performing work. Time to clean up.\n    stopWorkLoopTimer(interruptedBy);\n    interruptedBy = null;\n    isWorking = false;\n    didFatal = false;\n    firstUncaughtError = null;\n\n    if (uncaughtError !== null) {\n      onUncaughtError(uncaughtError);\n    }\n\n    return root.isReadyForCommit ? root.current.alternate : null;\n  }\n\n  // Returns the boundary that captured the error, or null if the error is ignored\n  function captureError(failedWork, error) {\n    // It is no longer valid because we exited the user code.\n    ReactCurrentOwner.current = null;\n    {\n      ReactDebugCurrentFiber.resetCurrentFiber();\n    }\n\n    // Search for the nearest error boundary.\n    var boundary = null;\n\n    // Passed to logCapturedError()\n    var errorBoundaryFound = false;\n    var willRetry = false;\n    var errorBoundaryName = null;\n\n    // Host containers are a special case. If the failed work itself is a host\n    // container, then it acts as its own boundary. In all other cases, we\n    // ignore the work itself and only search through the parents.\n    if (failedWork.tag === HostRoot) {\n      boundary = failedWork;\n\n      if (isFailedBoundary(failedWork)) {\n        // If this root already failed, there must have been an error when\n        // attempting to unmount it. This is a worst-case scenario and\n        // should only be possible if there's a bug in the renderer.\n        didFatal = true;\n      }\n    } else {\n      var node = failedWork['return'];\n      while (node !== null && boundary === null) {\n        if (node.tag === ClassComponent) {\n          var instance = node.stateNode;\n          if (typeof instance.componentDidCatch === 'function') {\n            errorBoundaryFound = true;\n            errorBoundaryName = getComponentName(node);\n\n            // Found an error boundary!\n            boundary = node;\n            willRetry = true;\n          }\n        } else if (node.tag === HostRoot) {\n          // Treat the root like a no-op error boundary\n          boundary = node;\n        }\n\n        if (isFailedBoundary(node)) {\n          // This boundary is already in a failed state.\n\n          // If we're currently unmounting, that means this error was\n          // thrown while unmounting a failed subtree. We should ignore\n          // the error.\n          if (isUnmounting) {\n            return null;\n          }\n\n          // If we're in the commit phase, we should check to see if\n          // this boundary already captured an error during this commit.\n          // This case exists because multiple errors can be thrown during\n          // a single commit without interruption.\n          if (commitPhaseBoundaries !== null && (commitPhaseBoundaries.has(node) || node.alternate !== null && commitPhaseBoundaries.has(node.alternate))) {\n            // If so, we should ignore this error.\n            return null;\n          }\n\n          // The error should propagate to the next boundary -— we keep looking.\n          boundary = null;\n          willRetry = false;\n        }\n\n        node = node['return'];\n      }\n    }\n\n    if (boundary !== null) {\n      // Add to the collection of failed boundaries. This lets us know that\n      // subsequent errors in this subtree should propagate to the next boundary.\n      if (failedBoundaries === null) {\n        failedBoundaries = new Set();\n      }\n      failedBoundaries.add(boundary);\n\n      // This method is unsafe outside of the begin and complete phases.\n      // We might be in the commit phase when an error is captured.\n      // The risk is that the return path from this Fiber may not be accurate.\n      // That risk is acceptable given the benefit of providing users more context.\n      var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork);\n      var _componentName = getComponentName(failedWork);\n\n      // Add to the collection of captured errors. This is stored as a global\n      // map of errors and their component stack location keyed by the boundaries\n      // that capture them. We mostly use this Map as a Set; it's a Map only to\n      // avoid adding a field to Fiber to store the error.\n      if (capturedErrors === null) {\n        capturedErrors = new Map();\n      }\n\n      var capturedError = {\n        componentName: _componentName,\n        componentStack: _componentStack,\n        error: error,\n        errorBoundary: errorBoundaryFound ? boundary.stateNode : null,\n        errorBoundaryFound: errorBoundaryFound,\n        errorBoundaryName: errorBoundaryName,\n        willRetry: willRetry\n      };\n\n      capturedErrors.set(boundary, capturedError);\n\n      try {\n        logCapturedError(capturedError);\n      } catch (e) {\n        // Prevent cycle if logCapturedError() throws.\n        // A cycle may still occur if logCapturedError renders a component that throws.\n        var suppressLogging = e && e.suppressReactErrorLogging;\n        if (!suppressLogging) {\n          console.error(e);\n        }\n      }\n\n      // If we're in the commit phase, defer scheduling an update on the\n      // boundary until after the commit is complete\n      if (isCommitting) {\n        if (commitPhaseBoundaries === null) {\n          commitPhaseBoundaries = new Set();\n        }\n        commitPhaseBoundaries.add(boundary);\n      } else {\n        // Otherwise, schedule an update now.\n        // TODO: Is this actually necessary during the render phase? Is it\n        // possible to unwind and continue rendering at the same priority,\n        // without corrupting internal state?\n        scheduleErrorRecovery(boundary);\n      }\n      return boundary;\n    } else if (firstUncaughtError === null) {\n      // If no boundary is found, we'll need to throw the error\n      firstUncaughtError = error;\n    }\n    return null;\n  }\n\n  function hasCapturedError(fiber) {\n    // TODO: capturedErrors should store the boundary instance, to avoid needing\n    // to check the alternate.\n    return capturedErrors !== null && (capturedErrors.has(fiber) || fiber.alternate !== null && capturedErrors.has(fiber.alternate));\n  }\n\n  function isFailedBoundary(fiber) {\n    // TODO: failedBoundaries should store the boundary instance, to avoid\n    // needing to check the alternate.\n    return failedBoundaries !== null && (failedBoundaries.has(fiber) || fiber.alternate !== null && failedBoundaries.has(fiber.alternate));\n  }\n\n  function commitErrorHandling(effectfulFiber) {\n    var capturedError = void 0;\n    if (capturedErrors !== null) {\n      capturedError = capturedErrors.get(effectfulFiber);\n      capturedErrors['delete'](effectfulFiber);\n      if (capturedError == null) {\n        if (effectfulFiber.alternate !== null) {\n          effectfulFiber = effectfulFiber.alternate;\n          capturedError = capturedErrors.get(effectfulFiber);\n          capturedErrors['delete'](effectfulFiber);\n        }\n      }\n    }\n\n    !(capturedError != null) ? invariant_1(false, 'No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n    switch (effectfulFiber.tag) {\n      case ClassComponent:\n        var instance = effectfulFiber.stateNode;\n\n        var info = {\n          componentStack: capturedError.componentStack\n        };\n\n        // Allow the boundary to handle the error, usually by scheduling\n        // an update to itself\n        instance.componentDidCatch(capturedError.error, info);\n        return;\n      case HostRoot:\n        if (firstUncaughtError === null) {\n          firstUncaughtError = capturedError.error;\n        }\n        return;\n      default:\n        invariant_1(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.');\n    }\n  }\n\n  function unwindContexts(from, to) {\n    var node = from;\n    while (node !== null) {\n      switch (node.tag) {\n        case ClassComponent:\n          popContextProvider(node);\n          break;\n        case HostComponent:\n          popHostContext(node);\n          break;\n        case HostRoot:\n          popHostContainer(node);\n          break;\n        case HostPortal:\n          popHostContainer(node);\n          break;\n      }\n      if (node === to || node.alternate === to) {\n        stopFailedWorkTimer(node);\n        break;\n      } else {\n        stopWorkTimer(node);\n      }\n      node = node['return'];\n    }\n  }\n\n  function computeAsyncExpiration() {\n    // Given the current clock time, returns an expiration time. We use rounding\n    // to batch like updates together.\n    // Should complete within ~1000ms. 1200ms max.\n    var currentTime = recalculateCurrentTime();\n    var expirationMs = 1000;\n    var bucketSizeMs = 200;\n    return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs);\n  }\n\n  function computeExpirationForFiber(fiber) {\n    var expirationTime = void 0;\n    if (expirationContext !== NoWork) {\n      // An explicit expiration context was set;\n      expirationTime = expirationContext;\n    } else if (isWorking) {\n      if (isCommitting) {\n        // Updates that occur during the commit phase should have sync priority\n        // by default.\n        expirationTime = Sync;\n      } else {\n        // Updates during the render phase should expire at the same time as\n        // the work that is being rendered.\n        expirationTime = nextRenderExpirationTime;\n      }\n    } else {\n      // No explicit expiration context was set, and we're not currently\n      // performing work. Calculate a new expiration time.\n      if (useSyncScheduling && !(fiber.internalContextTag & AsyncUpdates)) {\n        // This is a sync update\n        expirationTime = Sync;\n      } else {\n        // This is an async update\n        expirationTime = computeAsyncExpiration();\n      }\n    }\n    return expirationTime;\n  }\n\n  function scheduleWork(fiber, expirationTime) {\n    return scheduleWorkImpl(fiber, expirationTime, false);\n  }\n\n  function checkRootNeedsClearing(root, fiber, expirationTime) {\n    if (!isWorking && root === nextRoot && expirationTime < nextRenderExpirationTime) {\n      // Restart the root from the top.\n      if (nextUnitOfWork !== null) {\n        // This is an interruption. (Used for performance tracking.)\n        interruptedBy = fiber;\n      }\n      nextRoot = null;\n      nextUnitOfWork = null;\n      nextRenderExpirationTime = NoWork;\n    }\n  }\n\n  function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) {\n    recordScheduleUpdate();\n\n    {\n      if (!isErrorRecovery && fiber.tag === ClassComponent) {\n        var instance = fiber.stateNode;\n        warnAboutInvalidUpdates(instance);\n      }\n    }\n\n    var node = fiber;\n    while (node !== null) {\n      // Walk the parent path to the root and update each node's\n      // expiration time.\n      if (node.expirationTime === NoWork || node.expirationTime > expirationTime) {\n        node.expirationTime = expirationTime;\n      }\n      if (node.alternate !== null) {\n        if (node.alternate.expirationTime === NoWork || node.alternate.expirationTime > expirationTime) {\n          node.alternate.expirationTime = expirationTime;\n        }\n      }\n      if (node['return'] === null) {\n        if (node.tag === HostRoot) {\n          var root = node.stateNode;\n\n          checkRootNeedsClearing(root, fiber, expirationTime);\n          requestWork(root, expirationTime);\n          checkRootNeedsClearing(root, fiber, expirationTime);\n        } else {\n          {\n            if (!isErrorRecovery && fiber.tag === ClassComponent) {\n              warnAboutUpdateOnUnmounted(fiber);\n            }\n          }\n          return;\n        }\n      }\n      node = node['return'];\n    }\n  }\n\n  function scheduleErrorRecovery(fiber) {\n    scheduleWorkImpl(fiber, Sync, true);\n  }\n\n  function recalculateCurrentTime() {\n    // Subtract initial time so it fits inside 32bits\n    var ms = now() - startTime;\n    mostRecentCurrentTime = msToExpirationTime(ms);\n    return mostRecentCurrentTime;\n  }\n\n  function deferredUpdates(fn) {\n    var previousExpirationContext = expirationContext;\n    expirationContext = computeAsyncExpiration();\n    try {\n      return fn();\n    } finally {\n      expirationContext = previousExpirationContext;\n    }\n  }\n\n  function syncUpdates(fn) {\n    var previousExpirationContext = expirationContext;\n    expirationContext = Sync;\n    try {\n      return fn();\n    } finally {\n      expirationContext = previousExpirationContext;\n    }\n  }\n\n  // TODO: Everything below this is written as if it has been lifted to the\n  // renderers. I'll do this in a follow-up.\n\n  // Linked-list of roots\n  var firstScheduledRoot = null;\n  var lastScheduledRoot = null;\n\n  var callbackExpirationTime = NoWork;\n  var callbackID = -1;\n  var isRendering = false;\n  var nextFlushedRoot = null;\n  var nextFlushedExpirationTime = NoWork;\n  var deadlineDidExpire = false;\n  var hasUnhandledError = false;\n  var unhandledError = null;\n  var deadline = null;\n\n  var isBatchingUpdates = false;\n  var isUnbatchingUpdates = false;\n\n  // Use these to prevent an infinite loop of nested updates\n  var NESTED_UPDATE_LIMIT = 1000;\n  var nestedUpdateCount = 0;\n\n  var timeHeuristicForUnitOfWork = 1;\n\n  function scheduleCallbackWithExpiration(expirationTime) {\n    if (callbackExpirationTime !== NoWork) {\n      // A callback is already scheduled. Check its expiration time (timeout).\n      if (expirationTime > callbackExpirationTime) {\n        // Existing callback has sufficient timeout. Exit.\n        return;\n      } else {\n        // Existing callback has insufficient timeout. Cancel and schedule a\n        // new one.\n        cancelDeferredCallback(callbackID);\n      }\n      // The request callback timer is already running. Don't start a new one.\n    } else {\n      startRequestCallbackTimer();\n    }\n\n    // Compute a timeout for the given expiration time.\n    var currentMs = now() - startTime;\n    var expirationMs = expirationTimeToMs(expirationTime);\n    var timeout = expirationMs - currentMs;\n\n    callbackExpirationTime = expirationTime;\n    callbackID = scheduleDeferredCallback(performAsyncWork, { timeout: timeout });\n  }\n\n  // requestWork is called by the scheduler whenever a root receives an update.\n  // It's up to the renderer to call renderRoot at some point in the future.\n  function requestWork(root, expirationTime) {\n    if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n      invariant_1(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n    }\n\n    // Add the root to the schedule.\n    // Check if this root is already part of the schedule.\n    if (root.nextScheduledRoot === null) {\n      // This root is not already scheduled. Add it.\n      root.remainingExpirationTime = expirationTime;\n      if (lastScheduledRoot === null) {\n        firstScheduledRoot = lastScheduledRoot = root;\n        root.nextScheduledRoot = root;\n      } else {\n        lastScheduledRoot.nextScheduledRoot = root;\n        lastScheduledRoot = root;\n        lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n      }\n    } else {\n      // This root is already scheduled, but its priority may have increased.\n      var remainingExpirationTime = root.remainingExpirationTime;\n      if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n        // Update the priority.\n        root.remainingExpirationTime = expirationTime;\n      }\n    }\n\n    if (isRendering) {\n      // Prevent reentrancy. Remaining work will be scheduled at the end of\n      // the currently rendering batch.\n      return;\n    }\n\n    if (isBatchingUpdates) {\n      // Flush work at the end of the batch.\n      if (isUnbatchingUpdates) {\n        // ...unless we're inside unbatchedUpdates, in which case we should\n        // flush it now.\n        nextFlushedRoot = root;\n        nextFlushedExpirationTime = Sync;\n        performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n      }\n      return;\n    }\n\n    // TODO: Get rid of Sync and use current time?\n    if (expirationTime === Sync) {\n      performWork(Sync, null);\n    } else {\n      scheduleCallbackWithExpiration(expirationTime);\n    }\n  }\n\n  function findHighestPriorityRoot() {\n    var highestPriorityWork = NoWork;\n    var highestPriorityRoot = null;\n\n    if (lastScheduledRoot !== null) {\n      var previousScheduledRoot = lastScheduledRoot;\n      var root = firstScheduledRoot;\n      while (root !== null) {\n        var remainingExpirationTime = root.remainingExpirationTime;\n        if (remainingExpirationTime === NoWork) {\n          // This root no longer has work. Remove it from the scheduler.\n\n          // TODO: This check is redudant, but Flow is confused by the branch\n          // below where we set lastScheduledRoot to null, even though we break\n          // from the loop right after.\n          !(previousScheduledRoot !== null && lastScheduledRoot !== null) ? invariant_1(false, 'Should have a previous and last root. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n          if (root === root.nextScheduledRoot) {\n            // This is the only root in the list.\n            root.nextScheduledRoot = null;\n            firstScheduledRoot = lastScheduledRoot = null;\n            break;\n          } else if (root === firstScheduledRoot) {\n            // This is the first root in the list.\n            var next = root.nextScheduledRoot;\n            firstScheduledRoot = next;\n            lastScheduledRoot.nextScheduledRoot = next;\n            root.nextScheduledRoot = null;\n          } else if (root === lastScheduledRoot) {\n            // This is the last root in the list.\n            lastScheduledRoot = previousScheduledRoot;\n            lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n            root.nextScheduledRoot = null;\n            break;\n          } else {\n            previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot;\n            root.nextScheduledRoot = null;\n          }\n          root = previousScheduledRoot.nextScheduledRoot;\n        } else {\n          if (highestPriorityWork === NoWork || remainingExpirationTime < highestPriorityWork) {\n            // Update the priority, if it's higher\n            highestPriorityWork = remainingExpirationTime;\n            highestPriorityRoot = root;\n          }\n          if (root === lastScheduledRoot) {\n            break;\n          }\n          previousScheduledRoot = root;\n          root = root.nextScheduledRoot;\n        }\n      }\n    }\n\n    // If the next root is the same as the previous root, this is a nested\n    // update. To prevent an infinite loop, increment the nested update count.\n    var previousFlushedRoot = nextFlushedRoot;\n    if (previousFlushedRoot !== null && previousFlushedRoot === highestPriorityRoot) {\n      nestedUpdateCount++;\n    } else {\n      // Reset whenever we switch roots.\n      nestedUpdateCount = 0;\n    }\n    nextFlushedRoot = highestPriorityRoot;\n    nextFlushedExpirationTime = highestPriorityWork;\n  }\n\n  function performAsyncWork(dl) {\n    performWork(NoWork, dl);\n  }\n\n  function performWork(minExpirationTime, dl) {\n    deadline = dl;\n\n    // Keep working on roots until there's no more work, or until the we reach\n    // the deadline.\n    findHighestPriorityRoot();\n\n    if (enableUserTimingAPI && deadline !== null) {\n      var didExpire = nextFlushedExpirationTime < recalculateCurrentTime();\n      stopRequestCallbackTimer(didExpire);\n    }\n\n    while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) {\n      performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n      // Find the next highest priority work.\n      findHighestPriorityRoot();\n    }\n\n    // We're done flushing work. Either we ran out of time in this callback,\n    // or there's no more work left with sufficient priority.\n\n    // If we're inside a callback, set this to false since we just completed it.\n    if (deadline !== null) {\n      callbackExpirationTime = NoWork;\n      callbackID = -1;\n    }\n    // If there's work left over, schedule a new callback.\n    if (nextFlushedExpirationTime !== NoWork) {\n      scheduleCallbackWithExpiration(nextFlushedExpirationTime);\n    }\n\n    // Clean-up.\n    deadline = null;\n    deadlineDidExpire = false;\n    nestedUpdateCount = 0;\n\n    if (hasUnhandledError) {\n      var _error4 = unhandledError;\n      unhandledError = null;\n      hasUnhandledError = false;\n      throw _error4;\n    }\n  }\n\n  function performWorkOnRoot(root, expirationTime) {\n    !!isRendering ? invariant_1(false, 'performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n\n    isRendering = true;\n\n    // Check if this is async work or sync/expired work.\n    // TODO: Pass current time as argument to renderRoot, commitRoot\n    if (expirationTime <= recalculateCurrentTime()) {\n      // Flush sync work.\n      var finishedWork = root.finishedWork;\n      if (finishedWork !== null) {\n        // This root is already complete. We can commit it.\n        root.finishedWork = null;\n        root.remainingExpirationTime = commitRoot(finishedWork);\n      } else {\n        root.finishedWork = null;\n        finishedWork = renderRoot(root, expirationTime);\n        if (finishedWork !== null) {\n          // We've completed the root. Commit it.\n          root.remainingExpirationTime = commitRoot(finishedWork);\n        }\n      }\n    } else {\n      // Flush async work.\n      var _finishedWork = root.finishedWork;\n      if (_finishedWork !== null) {\n        // This root is already complete. We can commit it.\n        root.finishedWork = null;\n        root.remainingExpirationTime = commitRoot(_finishedWork);\n      } else {\n        root.finishedWork = null;\n        _finishedWork = renderRoot(root, expirationTime);\n        if (_finishedWork !== null) {\n          // We've completed the root. Check the deadline one more time\n          // before committing.\n          if (!shouldYield()) {\n            // Still time left. Commit the root.\n            root.remainingExpirationTime = commitRoot(_finishedWork);\n          } else {\n            // There's no time left. Mark this root as complete. We'll come\n            // back and commit it later.\n            root.finishedWork = _finishedWork;\n          }\n        }\n      }\n    }\n\n    isRendering = false;\n  }\n\n  // When working on async work, the reconciler asks the renderer if it should\n  // yield execution. For DOM, we implement this with requestIdleCallback.\n  function shouldYield() {\n    if (deadline === null) {\n      return false;\n    }\n    if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {\n      // Disregard deadline.didTimeout. Only expired work should be flushed\n      // during a timeout. This path is only hit for non-expired work.\n      return false;\n    }\n    deadlineDidExpire = true;\n    return true;\n  }\n\n  // TODO: Not happy about this hook. Conceptually, renderRoot should return a\n  // tuple of (isReadyForCommit, didError, error)\n  function onUncaughtError(error) {\n    !(nextFlushedRoot !== null) ? invariant_1(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n    // Unschedule this root so we don't work on it again until there's\n    // another update.\n    nextFlushedRoot.remainingExpirationTime = NoWork;\n    if (!hasUnhandledError) {\n      hasUnhandledError = true;\n      unhandledError = error;\n    }\n  }\n\n  // TODO: Batching should be implemented at the renderer level, not inside\n  // the reconciler.\n  function batchedUpdates(fn, a) {\n    var previousIsBatchingUpdates = isBatchingUpdates;\n    isBatchingUpdates = true;\n    try {\n      return fn(a);\n    } finally {\n      isBatchingUpdates = previousIsBatchingUpdates;\n      if (!isBatchingUpdates && !isRendering) {\n        performWork(Sync, null);\n      }\n    }\n  }\n\n  // TODO: Batching should be implemented at the renderer level, not inside\n  // the reconciler.\n  function unbatchedUpdates(fn) {\n    if (isBatchingUpdates && !isUnbatchingUpdates) {\n      isUnbatchingUpdates = true;\n      try {\n        return fn();\n      } finally {\n        isUnbatchingUpdates = false;\n      }\n    }\n    return fn();\n  }\n\n  // TODO: Batching should be implemented at the renderer level, not within\n  // the reconciler.\n  function flushSync(fn) {\n    var previousIsBatchingUpdates = isBatchingUpdates;\n    isBatchingUpdates = true;\n    try {\n      return syncUpdates(fn);\n    } finally {\n      isBatchingUpdates = previousIsBatchingUpdates;\n      !!isRendering ? invariant_1(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;\n      performWork(Sync, null);\n    }\n  }\n\n  return {\n    computeAsyncExpiration: computeAsyncExpiration,\n    computeExpirationForFiber: computeExpirationForFiber,\n    scheduleWork: scheduleWork,\n    batchedUpdates: batchedUpdates,\n    unbatchedUpdates: unbatchedUpdates,\n    flushSync: flushSync,\n    deferredUpdates: deferredUpdates\n  };\n};\n\n{\n  var didWarnAboutNestedUpdates = false;\n}\n\n// 0 is PROD, 1 is DEV.\n// Might add PROFILE later.\n\n\nfunction getContextForSubtree(parentComponent) {\n  if (!parentComponent) {\n    return emptyObject_1;\n  }\n\n  var fiber = get(parentComponent);\n  var parentContext = findCurrentUnmaskedContext(fiber);\n  return isContextProvider(fiber) ? processChildContext(fiber, parentContext) : parentContext;\n}\n\nvar ReactFiberReconciler$1 = function (config) {\n  var getPublicInstance = config.getPublicInstance;\n\n  var _ReactFiberScheduler = ReactFiberScheduler(config),\n      computeAsyncExpiration = _ReactFiberScheduler.computeAsyncExpiration,\n      computeExpirationForFiber = _ReactFiberScheduler.computeExpirationForFiber,\n      scheduleWork = _ReactFiberScheduler.scheduleWork,\n      batchedUpdates = _ReactFiberScheduler.batchedUpdates,\n      unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates,\n      flushSync = _ReactFiberScheduler.flushSync,\n      deferredUpdates = _ReactFiberScheduler.deferredUpdates;\n\n  function scheduleTopLevelUpdate(current, element, callback) {\n    {\n      if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {\n        didWarnAboutNestedUpdates = true;\n        warning_1(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\\n\\n' + 'Check the render method of %s.', getComponentName(ReactDebugCurrentFiber.current) || 'Unknown');\n      }\n    }\n\n    callback = callback === undefined ? null : callback;\n    {\n      warning_1(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);\n    }\n\n    var expirationTime = void 0;\n    // Check if the top-level element is an async wrapper component. If so,\n    // treat updates to the root as async. This is a bit weird but lets us\n    // avoid a separate `renderAsync` API.\n    if (enableAsyncSubtreeAPI && element != null && element.type != null && element.type.prototype != null && element.type.prototype.unstable_isAsyncReactComponent === true) {\n      expirationTime = computeAsyncExpiration();\n    } else {\n      expirationTime = computeExpirationForFiber(current);\n    }\n\n    var update = {\n      expirationTime: expirationTime,\n      partialState: { element: element },\n      callback: callback,\n      isReplace: false,\n      isForced: false,\n      nextCallback: null,\n      next: null\n    };\n    insertUpdateIntoFiber(current, update);\n    scheduleWork(current, expirationTime);\n  }\n\n  function findHostInstance(fiber) {\n    var hostFiber = findCurrentHostFiber(fiber);\n    if (hostFiber === null) {\n      return null;\n    }\n    return hostFiber.stateNode;\n  }\n\n  return {\n    createContainer: function (containerInfo, hydrate) {\n      return createFiberRoot(containerInfo, hydrate);\n    },\n    updateContainer: function (element, container, parentComponent, callback) {\n      // TODO: If this is a nested container, this won't be the root.\n      var current = container.current;\n\n      {\n        if (ReactFiberInstrumentation_1.debugTool) {\n          if (current.alternate === null) {\n            ReactFiberInstrumentation_1.debugTool.onMountContainer(container);\n          } else if (element === null) {\n            ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);\n          } else {\n            ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);\n          }\n        }\n      }\n\n      var context = getContextForSubtree(parentComponent);\n      if (container.context === null) {\n        container.context = context;\n      } else {\n        container.pendingContext = context;\n      }\n\n      scheduleTopLevelUpdate(current, element, callback);\n    },\n\n\n    batchedUpdates: batchedUpdates,\n\n    unbatchedUpdates: unbatchedUpdates,\n\n    deferredUpdates: deferredUpdates,\n\n    flushSync: flushSync,\n\n    getPublicRootInstance: function (container) {\n      var containerFiber = container.current;\n      if (!containerFiber.child) {\n        return null;\n      }\n      switch (containerFiber.child.tag) {\n        case HostComponent:\n          return getPublicInstance(containerFiber.child.stateNode);\n        default:\n          return containerFiber.child.stateNode;\n      }\n    },\n\n\n    findHostInstance: findHostInstance,\n\n    findHostInstanceWithNoPortals: function (fiber) {\n      var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n      if (hostFiber === null) {\n        return null;\n      }\n      return hostFiber.stateNode;\n    },\n    injectIntoDevTools: function (devToolsConfig) {\n      var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n\n      return injectInternals(_assign({}, devToolsConfig, {\n        findHostInstanceByFiber: function (fiber) {\n          return findHostInstance(fiber);\n        },\n        findFiberByHostInstance: function (instance) {\n          if (!findFiberByHostInstance) {\n            // Might not be implemented by the renderer.\n            return null;\n          }\n          return findFiberByHostInstance(instance);\n        }\n      }));\n    }\n  };\n};\n\nvar ReactFiberReconciler$2 = Object.freeze({\n\tdefault: ReactFiberReconciler$1\n});\n\nvar ReactFiberReconciler$3 = ( ReactFiberReconciler$2 && ReactFiberReconciler$1 ) || ReactFiberReconciler$2;\n\n// TODO: bundle Flow types with the package.\n\n\n\n// TODO: decide on the top-level export form.\n// This is hacky but makes it work with both Rollup and Jest.\nvar reactReconciler = ReactFiberReconciler$3['default'] ? ReactFiberReconciler$3['default'] : ReactFiberReconciler$3;\n\nfunction createPortal$1(children, containerInfo,\n// TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n  return {\n    // This tag allow us to uniquely identify this as a React Portal\n    $$typeof: REACT_PORTAL_TYPE,\n    key: key == null ? null : '' + key,\n    children: children,\n    containerInfo: containerInfo,\n    implementation: implementation\n  };\n}\n\n// TODO: this is special because it gets imported during build.\n\nvar ReactVersion = '16.2.0';\n\n// a requestAnimationFrame, storing the time for the start of the frame, then\n// scheduling a postMessage which gets scheduled after paint. Within the\n// postMessage handler do as much work as possible until time + frame rate.\n// By separating the idle call into a separate event tick we ensure that\n// layout, paint and other browser work is counted against the available time.\n// The frame rate is dynamically adjusted.\n\n{\n  if (ExecutionEnvironment_1.canUseDOM && typeof requestAnimationFrame !== 'function') {\n    warning_1(false, 'React depends on requestAnimationFrame. Make sure that you load a ' + 'polyfill in older browsers. http://fb.me/react-polyfills');\n  }\n}\n\nvar hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';\n\nvar now = void 0;\nif (hasNativePerformanceNow) {\n  now = function () {\n    return performance.now();\n  };\n} else {\n  now = function () {\n    return Date.now();\n  };\n}\n\n// TODO: There's no way to cancel, because Fiber doesn't atm.\nvar rIC = void 0;\nvar cIC = void 0;\n\nif (!ExecutionEnvironment_1.canUseDOM) {\n  rIC = function (frameCallback) {\n    return setTimeout(function () {\n      frameCallback({\n        timeRemaining: function () {\n          return Infinity;\n        }\n      });\n    });\n  };\n  cIC = function (timeoutID) {\n    clearTimeout(timeoutID);\n  };\n} else if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') {\n  // Polyfill requestIdleCallback and cancelIdleCallback\n\n  var scheduledRICCallback = null;\n  var isIdleScheduled = false;\n  var timeoutTime = -1;\n\n  var isAnimationFrameScheduled = false;\n\n  var frameDeadline = 0;\n  // We start out assuming that we run at 30fps but then the heuristic tracking\n  // will adjust this value to a faster fps if we get more frequent animation\n  // frames.\n  var previousFrameTime = 33;\n  var activeFrameTime = 33;\n\n  var frameDeadlineObject;\n  if (hasNativePerformanceNow) {\n    frameDeadlineObject = {\n      didTimeout: false,\n      timeRemaining: function () {\n        // We assume that if we have a performance timer that the rAF callback\n        // gets a performance timer value. Not sure if this is always true.\n        var remaining = frameDeadline - performance.now();\n        return remaining > 0 ? remaining : 0;\n      }\n    };\n  } else {\n    frameDeadlineObject = {\n      didTimeout: false,\n      timeRemaining: function () {\n        // Fallback to Date.now()\n        var remaining = frameDeadline - Date.now();\n        return remaining > 0 ? remaining : 0;\n      }\n    };\n  }\n\n  // We use the postMessage trick to defer idle work until after the repaint.\n  var messageKey = '__reactIdleCallback$' + Math.random().toString(36).slice(2);\n  var idleTick = function (event) {\n    if (event.source !== window || event.data !== messageKey) {\n      return;\n    }\n\n    isIdleScheduled = false;\n\n    var currentTime = now();\n    if (frameDeadline - currentTime <= 0) {\n      // There's no time left in this idle period. Check if the callback has\n      // a timeout and whether it's been exceeded.\n      if (timeoutTime !== -1 && timeoutTime <= currentTime) {\n        // Exceeded the timeout. Invoke the callback even though there's no\n        // time left.\n        frameDeadlineObject.didTimeout = true;\n      } else {\n        // No timeout.\n        if (!isAnimationFrameScheduled) {\n          // Schedule another animation callback so we retry later.\n          isAnimationFrameScheduled = true;\n          requestAnimationFrame(animationTick);\n        }\n        // Exit without invoking the callback.\n        return;\n      }\n    } else {\n      // There's still time left in this idle period.\n      frameDeadlineObject.didTimeout = false;\n    }\n\n    timeoutTime = -1;\n    var callback = scheduledRICCallback;\n    scheduledRICCallback = null;\n    if (callback !== null) {\n      callback(frameDeadlineObject);\n    }\n  };\n  // Assumes that we have addEventListener in this environment. Might need\n  // something better for old IE.\n  window.addEventListener('message', idleTick, false);\n\n  var animationTick = function (rafTime) {\n    isAnimationFrameScheduled = false;\n    var nextFrameTime = rafTime - frameDeadline + activeFrameTime;\n    if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {\n      if (nextFrameTime < 8) {\n        // Defensive coding. We don't support higher frame rates than 120hz.\n        // If we get lower than that, it is probably a bug.\n        nextFrameTime = 8;\n      }\n      // If one frame goes long, then the next one can be short to catch up.\n      // If two frames are short in a row, then that's an indication that we\n      // actually have a higher frame rate than what we're currently optimizing.\n      // We adjust our heuristic dynamically accordingly. For example, if we're\n      // running on 120hz display or 90hz VR display.\n      // Take the max of the two in case one of them was an anomaly due to\n      // missed frame deadlines.\n      activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime;\n    } else {\n      previousFrameTime = nextFrameTime;\n    }\n    frameDeadline = rafTime + activeFrameTime;\n    if (!isIdleScheduled) {\n      isIdleScheduled = true;\n      window.postMessage(messageKey, '*');\n    }\n  };\n\n  rIC = function (callback, options) {\n    // This assumes that we only schedule one callback at a time because that's\n    // how Fiber uses it.\n    scheduledRICCallback = callback;\n    if (options != null && typeof options.timeout === 'number') {\n      timeoutTime = now() + options.timeout;\n    }\n    if (!isAnimationFrameScheduled) {\n      // If rAF didn't already schedule one, we need to schedule a frame.\n      // TODO: If this rAF doesn't materialize because the browser throttles, we\n      // might want to still have setTimeout trigger rIC as a backup to ensure\n      // that we keep performing work.\n      isAnimationFrameScheduled = true;\n      requestAnimationFrame(animationTick);\n    }\n    return 0;\n  };\n\n  cIC = function () {\n    scheduledRICCallback = null;\n    isIdleScheduled = false;\n    timeoutTime = -1;\n  };\n} else {\n  rIC = window.requestIdleCallback;\n  cIC = window.cancelIdleCallback;\n}\n\n/**\n * Forked from fbjs/warning:\n * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js\n *\n * Only change is we use console.warn instead of console.error,\n * and do nothing when 'console' is not supported.\n * This really simplifies the code.\n * ---\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar lowPriorityWarning = function () {};\n\n{\n  var printWarning$1 = function (format) {\n    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    var argIndex = 0;\n    var message = 'Warning: ' + format.replace(/%s/g, function () {\n      return args[argIndex++];\n    });\n    if (typeof console !== 'undefined') {\n      console.warn(message);\n    }\n    try {\n      // --- Welcome to debugging React ---\n      // This error was thrown as a convenience so that you can use this stack\n      // to find the callsite that caused this warning to fire.\n      throw new Error(message);\n    } catch (x) {}\n  };\n\n  lowPriorityWarning = function (condition, format) {\n    if (format === undefined) {\n      throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n    }\n    if (!condition) {\n      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n        args[_key2 - 2] = arguments[_key2];\n      }\n\n      printWarning$1.apply(undefined, [format].concat(args));\n    }\n  };\n}\n\nvar lowPriorityWarning$1 = lowPriorityWarning;\n\n// isAttributeNameSafe() is currently duplicated in DOMMarkupOperations.\n// TODO: Find a better place for this.\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n  if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {\n    return true;\n  }\n  if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {\n    return false;\n  }\n  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n    validatedAttributeNameCache[attributeName] = true;\n    return true;\n  }\n  illegalAttributeNameCache[attributeName] = true;\n  {\n    warning_1(false, 'Invalid attribute name: `%s`', attributeName);\n  }\n  return false;\n}\n\n// shouldIgnoreValue() is currently duplicated in DOMMarkupOperations.\n// TODO: Find a better place for this.\nfunction shouldIgnoreValue(propertyInfo, value) {\n  return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;\n}\n\n/**\n * Operations for dealing with DOM properties.\n */\n\n\n\n\n\n/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected) {\n  {\n    var propertyInfo = getPropertyInfo(name);\n    if (propertyInfo) {\n      var mutationMethod = propertyInfo.mutationMethod;\n      if (mutationMethod || propertyInfo.mustUseProperty) {\n        return node[propertyInfo.propertyName];\n      } else {\n        var attributeName = propertyInfo.attributeName;\n\n        var stringValue = null;\n\n        if (propertyInfo.hasOverloadedBooleanValue) {\n          if (node.hasAttribute(attributeName)) {\n            var value = node.getAttribute(attributeName);\n            if (value === '') {\n              return true;\n            }\n            if (shouldIgnoreValue(propertyInfo, expected)) {\n              return value;\n            }\n            if (value === '' + expected) {\n              return expected;\n            }\n            return value;\n          }\n        } else if (node.hasAttribute(attributeName)) {\n          if (shouldIgnoreValue(propertyInfo, expected)) {\n            // We had an attribute but shouldn't have had one, so read it\n            // for the error message.\n            return node.getAttribute(attributeName);\n          }\n          if (propertyInfo.hasBooleanValue) {\n            // If this was a boolean, it doesn't matter what the value is\n            // the fact that we have it is the same as the expected.\n            return expected;\n          }\n          // Even if this property uses a namespace we use getAttribute\n          // because we assume its namespaced name is the same as our config.\n          // To use getAttributeNS we need the local name which we don't have\n          // in our config atm.\n          stringValue = node.getAttribute(attributeName);\n        }\n\n        if (shouldIgnoreValue(propertyInfo, expected)) {\n          return stringValue === null ? expected : stringValue;\n        } else if (stringValue === '' + expected) {\n          return expected;\n        } else {\n          return stringValue;\n        }\n      }\n    }\n  }\n}\n\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\nfunction getValueForAttribute(node, name, expected) {\n  {\n    if (!isAttributeNameSafe(name)) {\n      return;\n    }\n    if (!node.hasAttribute(name)) {\n      return expected === undefined ? undefined : null;\n    }\n    var value = node.getAttribute(name);\n    if (value === '' + expected) {\n      return expected;\n    }\n    return value;\n  }\n}\n\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\nfunction setValueForProperty(node, name, value) {\n  var propertyInfo = getPropertyInfo(name);\n\n  if (propertyInfo && shouldSetAttribute(name, value)) {\n    var mutationMethod = propertyInfo.mutationMethod;\n    if (mutationMethod) {\n      mutationMethod(node, value);\n    } else if (shouldIgnoreValue(propertyInfo, value)) {\n      deleteValueForProperty(node, name);\n      return;\n    } else if (propertyInfo.mustUseProperty) {\n      // Contrary to `setAttribute`, object properties are properly\n      // `toString`ed by IE8/9.\n      node[propertyInfo.propertyName] = value;\n    } else {\n      var attributeName = propertyInfo.attributeName;\n      var namespace = propertyInfo.attributeNamespace;\n      // `setAttribute` with objects becomes only `[object]` in IE8/9,\n      // ('' + value) makes it output the correct toString()-value.\n      if (namespace) {\n        node.setAttributeNS(namespace, attributeName, '' + value);\n      } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {\n        node.setAttribute(attributeName, '');\n      } else {\n        node.setAttribute(attributeName, '' + value);\n      }\n    }\n  } else {\n    setValueForAttribute(node, name, shouldSetAttribute(name, value) ? value : null);\n    return;\n  }\n\n  {\n    \n  }\n}\n\nfunction setValueForAttribute(node, name, value) {\n  if (!isAttributeNameSafe(name)) {\n    return;\n  }\n  if (value == null) {\n    node.removeAttribute(name);\n  } else {\n    node.setAttribute(name, '' + value);\n  }\n\n  {\n    \n  }\n}\n\n/**\n * Deletes an attributes from a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n */\nfunction deleteValueForAttribute(node, name) {\n  node.removeAttribute(name);\n}\n\n/**\n * Deletes the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n */\nfunction deleteValueForProperty(node, name) {\n  var propertyInfo = getPropertyInfo(name);\n  if (propertyInfo) {\n    var mutationMethod = propertyInfo.mutationMethod;\n    if (mutationMethod) {\n      mutationMethod(node, undefined);\n    } else if (propertyInfo.mustUseProperty) {\n      var propName = propertyInfo.propertyName;\n      if (propertyInfo.hasBooleanValue) {\n        node[propName] = false;\n      } else {\n        node[propName] = '';\n      }\n    } else {\n      node.removeAttribute(propertyInfo.attributeName);\n    }\n  } else {\n    node.removeAttribute(name);\n  }\n}\n\nvar ReactControlledValuePropTypes = {\n  checkPropTypes: null\n};\n\n{\n  var hasReadOnlyValue = {\n    button: true,\n    checkbox: true,\n    image: true,\n    hidden: true,\n    radio: true,\n    reset: true,\n    submit: true\n  };\n\n  var propTypes = {\n    value: function (props, propName, componentName) {\n      if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {\n        return null;\n      }\n      return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n    },\n    checked: function (props, propName, componentName) {\n      if (!props[propName] || props.onChange || props.readOnly || props.disabled) {\n        return null;\n      }\n      return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n    }\n  };\n\n  /**\n   * Provide a linked `value` attribute for controlled forms. You should not use\n   * this outside of the ReactDOM controlled form components.\n   */\n  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) {\n    checkPropTypes_1(propTypes, props, 'prop', tagName, getStack);\n  };\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar getCurrentFiberOwnerName$2 = ReactDebugCurrentFiber.getCurrentFiberOwnerName;\nvar getCurrentFiberStackAddendum$3 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n  var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n  return usesChecked ? props.checked != null : props.value != null;\n}\n\n/**\n * Implements an <input> host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\n\nfunction getHostProps(element, props) {\n  var node = element;\n  var value = props.value;\n  var checked = props.checked;\n\n  var hostProps = _assign({\n    // Make sure we set .type before any other properties (setting .value\n    // before .type means .value is lost in IE11 and below)\n    type: undefined,\n    // Make sure we set .step before .value (setting .value before .step\n    // means .value is rounded on mount, based upon step precision)\n    step: undefined,\n    // Make sure we set .min & .max before .value (to ensure proper order\n    // in corner cases such as min or max deriving from value, e.g. Issue #7170)\n    min: undefined,\n    max: undefined\n  }, props, {\n    defaultChecked: undefined,\n    defaultValue: undefined,\n    value: value != null ? value : node._wrapperState.initialValue,\n    checked: checked != null ? checked : node._wrapperState.initialChecked\n  });\n\n  return hostProps;\n}\n\nfunction initWrapperState(element, props) {\n  {\n    ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum$3);\n\n    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n      warning_1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerName$2() || 'A component', props.type);\n      didWarnCheckedDefaultChecked = true;\n    }\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n      warning_1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerName$2() || 'A component', props.type);\n      didWarnValueDefaultValue = true;\n    }\n  }\n\n  var defaultValue = props.defaultValue;\n  var node = element;\n  node._wrapperState = {\n    initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n    initialValue: props.value != null ? props.value : defaultValue,\n    controlled: isControlled(props)\n  };\n}\n\nfunction updateChecked(element, props) {\n  var node = element;\n  var checked = props.checked;\n  if (checked != null) {\n    setValueForProperty(node, 'checked', checked);\n  }\n}\n\nfunction updateWrapper(element, props) {\n  var node = element;\n  {\n    var controlled = isControlled(props);\n\n    if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n      warning_1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s', props.type, getCurrentFiberStackAddendum$3());\n      didWarnUncontrolledToControlled = true;\n    }\n    if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n      warning_1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s', props.type, getCurrentFiberStackAddendum$3());\n      didWarnControlledToUncontrolled = true;\n    }\n  }\n\n  updateChecked(element, props);\n\n  var value = props.value;\n  if (value != null) {\n    if (value === 0 && node.value === '') {\n      node.value = '0';\n      // Note: IE9 reports a number inputs as 'text', so check props instead.\n    } else if (props.type === 'number') {\n      // Simulate `input.valueAsNumber`. IE9 does not support it\n      var valueAsNumber = parseFloat(node.value) || 0;\n\n      if (\n      // eslint-disable-next-line\n      value != valueAsNumber ||\n      // eslint-disable-next-line\n      value == valueAsNumber && node.value != value) {\n        // Cast `value` to a string to ensure the value is set correctly. While\n        // browsers typically do this as necessary, jsdom doesn't.\n        node.value = '' + value;\n      }\n    } else if (node.value !== '' + value) {\n      // Cast `value` to a string to ensure the value is set correctly. While\n      // browsers typically do this as necessary, jsdom doesn't.\n      node.value = '' + value;\n    }\n  } else {\n    if (props.value == null && props.defaultValue != null) {\n      // In Chrome, assigning defaultValue to certain input types triggers input validation.\n      // For number inputs, the display value loses trailing decimal points. For email inputs,\n      // Chrome raises \"The specified value <x> is not a valid email address\".\n      //\n      // Here we check to see if the defaultValue has actually changed, avoiding these problems\n      // when the user is inputting text\n      //\n      // https://github.com/facebook/react/issues/7253\n      if (node.defaultValue !== '' + props.defaultValue) {\n        node.defaultValue = '' + props.defaultValue;\n      }\n    }\n    if (props.checked == null && props.defaultChecked != null) {\n      node.defaultChecked = !!props.defaultChecked;\n    }\n  }\n}\n\nfunction postMountWrapper(element, props) {\n  var node = element;\n\n  // Detach value from defaultValue. We won't do anything if we're working on\n  // submit or reset inputs as those values & defaultValues are linked. They\n  // are not resetable nodes so this operation doesn't matter and actually\n  // removes browser-default values (eg \"Submit Query\") when no value is\n  // provided.\n\n  switch (props.type) {\n    case 'submit':\n    case 'reset':\n      break;\n    case 'color':\n    case 'date':\n    case 'datetime':\n    case 'datetime-local':\n    case 'month':\n    case 'time':\n    case 'week':\n      // This fixes the no-show issue on iOS Safari and Android Chrome:\n      // https://github.com/facebook/react/issues/7233\n      node.value = '';\n      node.value = node.defaultValue;\n      break;\n    default:\n      node.value = node.value;\n      break;\n  }\n\n  // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n  // this is needed to work around a chrome bug where setting defaultChecked\n  // will sometimes influence the value of checked (even after detachment).\n  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n  // We need to temporarily unset name to avoid disrupting radio button groups.\n  var name = node.name;\n  if (name !== '') {\n    node.name = '';\n  }\n  node.defaultChecked = !node.defaultChecked;\n  node.defaultChecked = !node.defaultChecked;\n  if (name !== '') {\n    node.name = name;\n  }\n}\n\nfunction restoreControlledState$1(element, props) {\n  var node = element;\n  updateWrapper(node, props);\n  updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n  var name = props.name;\n  if (props.type === 'radio' && name != null) {\n    var queryRoot = rootNode;\n\n    while (queryRoot.parentNode) {\n      queryRoot = queryRoot.parentNode;\n    }\n\n    // If `rootNode.form` was non-null, then we could try `form.elements`,\n    // but that sometimes behaves strangely in IE8. We could also try using\n    // `form.getElementsByName`, but that will only return direct children\n    // and won't include inputs that use the HTML5 `form=` attribute. Since\n    // the input might not even be in a form. It might not even be in the\n    // document. Let's just use the local `querySelectorAll` to ensure we don't\n    // miss anything.\n    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n    for (var i = 0; i < group.length; i++) {\n      var otherNode = group[i];\n      if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n        continue;\n      }\n      // This will throw if radio buttons rendered by different copies of React\n      // and the same name are rendered into the same form (same as #1939).\n      // That's probably okay; we don't support it just as we don't support\n      // mixing React radio buttons with non-React ones.\n      var otherProps = getFiberCurrentPropsFromNode$1(otherNode);\n      !otherProps ? invariant_1(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0;\n\n      // We need update the tracked value on the named cousin since the value\n      // was changed but the input saw no event or value set\n      updateValueIfChanged(otherNode);\n\n      // If this is a controlled radio button group, forcing the input that\n      // was previously checked to update will cause it to be come re-checked\n      // as appropriate.\n      updateWrapper(otherNode, otherProps);\n    }\n  }\n}\n\nfunction flattenChildren(children) {\n  var content = '';\n\n  // Flatten children and warn if they aren't strings or numbers;\n  // invalid types are ignored.\n  // We can silently skip them because invalid DOM nesting warning\n  // catches these cases in Fiber.\n  React.Children.forEach(children, function (child) {\n    if (child == null) {\n      return;\n    }\n    if (typeof child === 'string' || typeof child === 'number') {\n      content += child;\n    }\n  });\n\n  return content;\n}\n\n/**\n * Implements an <option> host component that warns when `selected` is set.\n */\n\nfunction validateProps(element, props) {\n  // TODO (yungsters): Remove support for `selected` in <option>.\n  {\n    warning_1(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');\n  }\n}\n\nfunction postMountWrapper$1(element, props) {\n  // value=\"\" should make a value attribute (#6219)\n  if (props.value != null) {\n    element.setAttribute('value', props.value);\n  }\n}\n\nfunction getHostProps$1(element, props) {\n  var hostProps = _assign({ children: undefined }, props);\n  var content = flattenChildren(props.children);\n\n  if (content) {\n    hostProps.children = content;\n  }\n\n  return hostProps;\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar getCurrentFiberOwnerName$3 = ReactDebugCurrentFiber.getCurrentFiberOwnerName;\nvar getCurrentFiberStackAddendum$4 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\n\n{\n  var didWarnValueDefaultValue$1 = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n  var ownerName = getCurrentFiberOwnerName$3();\n  if (ownerName) {\n    return '\\n\\nCheck the render method of `' + ownerName + '`.';\n  }\n  return '';\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n\n/**\n * Validation function for `value` and `defaultValue`.\n */\nfunction checkSelectPropTypes(props) {\n  ReactControlledValuePropTypes.checkPropTypes('select', props, getCurrentFiberStackAddendum$4);\n\n  for (var i = 0; i < valuePropNames.length; i++) {\n    var propName = valuePropNames[i];\n    if (props[propName] == null) {\n      continue;\n    }\n    var isArray = Array.isArray(props[propName]);\n    if (props.multiple && !isArray) {\n      warning_1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());\n    } else if (!props.multiple && isArray) {\n      warning_1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());\n    }\n  }\n}\n\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n  var options = node.options;\n\n  if (multiple) {\n    var selectedValues = propValue;\n    var selectedValue = {};\n    for (var i = 0; i < selectedValues.length; i++) {\n      // Prefix to avoid chaos with special keys.\n      selectedValue['$' + selectedValues[i]] = true;\n    }\n    for (var _i = 0; _i < options.length; _i++) {\n      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n      if (options[_i].selected !== selected) {\n        options[_i].selected = selected;\n      }\n      if (selected && setDefaultSelected) {\n        options[_i].defaultSelected = true;\n      }\n    }\n  } else {\n    // Do not set `select.value` as exact behavior isn't consistent across all\n    // browsers for all cases.\n    var _selectedValue = '' + propValue;\n    var defaultSelected = null;\n    for (var _i2 = 0; _i2 < options.length; _i2++) {\n      if (options[_i2].value === _selectedValue) {\n        options[_i2].selected = true;\n        if (setDefaultSelected) {\n          options[_i2].defaultSelected = true;\n        }\n        return;\n      }\n      if (defaultSelected === null && !options[_i2].disabled) {\n        defaultSelected = options[_i2];\n      }\n    }\n    if (defaultSelected !== null) {\n      defaultSelected.selected = true;\n    }\n  }\n}\n\n/**\n * Implements a <select> host component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * stringable. If `multiple` is true, the prop must be an array of stringables.\n *\n * If `value` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n */\n\nfunction getHostProps$2(element, props) {\n  return _assign({}, props, {\n    value: undefined\n  });\n}\n\nfunction initWrapperState$1(element, props) {\n  var node = element;\n  {\n    checkSelectPropTypes(props);\n  }\n\n  var value = props.value;\n  node._wrapperState = {\n    initialValue: value != null ? value : props.defaultValue,\n    wasMultiple: !!props.multiple\n  };\n\n  {\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n      warning_1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');\n      didWarnValueDefaultValue$1 = true;\n    }\n  }\n}\n\nfunction postMountWrapper$2(element, props) {\n  var node = element;\n  node.multiple = !!props.multiple;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  } else if (props.defaultValue != null) {\n    updateOptions(node, !!props.multiple, props.defaultValue, true);\n  }\n}\n\nfunction postUpdateWrapper(element, props) {\n  var node = element;\n  // After the initial mount, we control selected-ness manually so don't pass\n  // this value down\n  node._wrapperState.initialValue = undefined;\n\n  var wasMultiple = node._wrapperState.wasMultiple;\n  node._wrapperState.wasMultiple = !!props.multiple;\n\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  } else if (wasMultiple !== !!props.multiple) {\n    // For simplicity, reapply `defaultValue` if `multiple` is toggled.\n    if (props.defaultValue != null) {\n      updateOptions(node, !!props.multiple, props.defaultValue, true);\n    } else {\n      // Revert the select back to its default unselected state.\n      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n    }\n  }\n}\n\nfunction restoreControlledState$2(element, props) {\n  var node = element;\n  var value = props.value;\n\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  }\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar getCurrentFiberStackAddendum$5 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\nvar didWarnValDefaultVal = false;\n\n/**\n * Implements a <textarea> host component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n */\n\nfunction getHostProps$3(element, props) {\n  var node = element;\n  !(props.dangerouslySetInnerHTML == null) ? invariant_1(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : void 0;\n\n  // Always set children to the same thing. In IE9, the selection range will\n  // get reset if `textContent` is mutated.  We could add a check in setTextContent\n  // to only set the value if/when the value differs from the node value (which would\n  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n  // solution. The value can be a boolean or object so that's why it's forced\n  // to be a string.\n  var hostProps = _assign({}, props, {\n    value: undefined,\n    defaultValue: undefined,\n    children: '' + node._wrapperState.initialValue\n  });\n\n  return hostProps;\n}\n\nfunction initWrapperState$2(element, props) {\n  var node = element;\n  {\n    ReactControlledValuePropTypes.checkPropTypes('textarea', props, getCurrentFiberStackAddendum$5);\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n      warning_1(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');\n      didWarnValDefaultVal = true;\n    }\n  }\n\n  var initialValue = props.value;\n\n  // Only bother fetching default value if we're going to use it\n  if (initialValue == null) {\n    var defaultValue = props.defaultValue;\n    // TODO (yungsters): Remove support for children content in <textarea>.\n    var children = props.children;\n    if (children != null) {\n      {\n        warning_1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');\n      }\n      !(defaultValue == null) ? invariant_1(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;\n      if (Array.isArray(children)) {\n        !(children.length <= 1) ? invariant_1(false, '<textarea> can only have at most one child.') : void 0;\n        children = children[0];\n      }\n\n      defaultValue = '' + children;\n    }\n    if (defaultValue == null) {\n      defaultValue = '';\n    }\n    initialValue = defaultValue;\n  }\n\n  node._wrapperState = {\n    initialValue: '' + initialValue\n  };\n}\n\nfunction updateWrapper$1(element, props) {\n  var node = element;\n  var value = props.value;\n  if (value != null) {\n    // Cast `value` to a string to ensure the value is set correctly. While\n    // browsers typically do this as necessary, jsdom doesn't.\n    var newValue = '' + value;\n\n    // To avoid side effects (such as losing text selection), only set value if changed\n    if (newValue !== node.value) {\n      node.value = newValue;\n    }\n    if (props.defaultValue == null) {\n      node.defaultValue = newValue;\n    }\n  }\n  if (props.defaultValue != null) {\n    node.defaultValue = props.defaultValue;\n  }\n}\n\nfunction postMountWrapper$3(element, props) {\n  var node = element;\n  // This is in postMount because we need access to the DOM node, which is not\n  // available until after the component has mounted.\n  var textContent = node.textContent;\n\n  // Only set node.value if textContent is equal to the expected\n  // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n  // will populate textContent as well.\n  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n  if (textContent === node._wrapperState.initialValue) {\n    node.value = textContent;\n  }\n}\n\nfunction restoreControlledState$3(element, props) {\n  // DOM component is still mounted; update\n  updateWrapper$1(element, props);\n}\n\nvar HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n\nvar Namespaces = {\n  html: HTML_NAMESPACE$1,\n  mathml: MATH_NAMESPACE,\n  svg: SVG_NAMESPACE\n};\n\n// Assumes there is no parent namespace.\nfunction getIntrinsicNamespace(type) {\n  switch (type) {\n    case 'svg':\n      return SVG_NAMESPACE;\n    case 'math':\n      return MATH_NAMESPACE;\n    default:\n      return HTML_NAMESPACE$1;\n  }\n}\n\nfunction getChildNamespace(parentNamespace, type) {\n  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {\n    // No (or default) parent namespace: potential entry point.\n    return getIntrinsicNamespace(type);\n  }\n  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n    // We're leaving SVG.\n    return HTML_NAMESPACE$1;\n  }\n  // By default, pass namespace below.\n  return parentNamespace;\n}\n\n/* globals MSApp */\n\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n    return function (arg0, arg1, arg2, arg3) {\n      MSApp.execUnsafeLocalFunction(function () {\n        return func(arg0, arg1, arg2, arg3);\n      });\n    };\n  } else {\n    return func;\n  }\n};\n\n// SVG temp container for IE lacking innerHTML\nvar reusableSVGContainer = void 0;\n\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n  // IE does not have innerHTML for SVG nodes, so instead we inject the\n  // new markup in a temp node and then move the child nodes across into\n  // the target node\n\n  if (node.namespaceURI === Namespaces.svg && !('innerHTML' in node)) {\n    reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n    reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';\n    var svgNode = reusableSVGContainer.firstChild;\n    while (node.firstChild) {\n      node.removeChild(node.firstChild);\n    }\n    while (svgNode.firstChild) {\n      node.appendChild(svgNode.firstChild);\n    }\n  } else {\n    node.innerHTML = html;\n  }\n});\n\n/**\n * Set the textContent property of a node, ensuring that whitespace is preserved\n * even in IE8. innerText is a poor substitute for textContent and, among many\n * issues, inserts <br> instead of the literal newline chars. innerHTML behaves\n * as it should.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\nvar setTextContent = function (node, text) {\n  if (text) {\n    var firstChild = node.firstChild;\n\n    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n      firstChild.nodeValue = text;\n      return;\n    }\n  }\n  node.textContent = text;\n};\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nvar isUnitlessNumber = {\n  animationIterationCount: true,\n  borderImageOutset: true,\n  borderImageSlice: true,\n  borderImageWidth: true,\n  boxFlex: true,\n  boxFlexGroup: true,\n  boxOrdinalGroup: true,\n  columnCount: true,\n  columns: true,\n  flex: true,\n  flexGrow: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  flexOrder: true,\n  gridRow: true,\n  gridRowEnd: true,\n  gridRowSpan: true,\n  gridRowStart: true,\n  gridColumn: true,\n  gridColumnEnd: true,\n  gridColumnSpan: true,\n  gridColumnStart: true,\n  fontWeight: true,\n  lineClamp: true,\n  lineHeight: true,\n  opacity: true,\n  order: true,\n  orphans: true,\n  tabSize: true,\n  widows: true,\n  zIndex: true,\n  zoom: true,\n\n  // SVG-related properties\n  fillOpacity: true,\n  floodOpacity: true,\n  stopOpacity: true,\n  strokeDasharray: true,\n  strokeDashoffset: true,\n  strokeMiterlimit: true,\n  strokeOpacity: true,\n  strokeWidth: true\n};\n\n/**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\nfunction prefixKey(prefix, key) {\n  return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O'];\n\n// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n  prefixes.forEach(function (prefix) {\n    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n  });\n});\n\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n  // Note that we've removed escapeTextForBrowser() calls here since the\n  // whole string will be escaped when the attribute is injected into\n  // the markup. If you provide unsafe user data here they can inject\n  // arbitrary CSS which may be problematic (I couldn't repro this):\n  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n  // This is not an XSS hole but instead a potential CSS injection issue\n  // which has lead to a greater discussion about how we're going to\n  // trust URLs moving forward. See #2115901\n\n  var isEmpty = value == null || typeof value === 'boolean' || value === '';\n  if (isEmpty) {\n    return '';\n  }\n\n  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n  }\n\n  return ('' + value).trim();\n}\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar _uppercasePattern = /([A-Z])/g;\n\n/**\n * Hyphenates a camelcased string, for example:\n *\n *   > hyphenate('backgroundColor')\n *   < \"background-color\"\n *\n * For CSS style names, use `hyphenateStyleName` instead which works properly\n * with all vendor prefixes, including `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenate(string) {\n  return string.replace(_uppercasePattern, '-$1').toLowerCase();\n}\n\nvar hyphenate_1 = hyphenate;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n\n\n\n\nvar msPattern = /^ms-/;\n\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n *   > hyphenateStyleName('backgroundColor')\n *   < \"background-color\"\n *   > hyphenateStyleName('MozTransition')\n *   < \"-moz-transition\"\n *   > hyphenateStyleName('msTransition')\n *   < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenateStyleName(string) {\n  return hyphenate_1(string).replace(msPattern, '-ms-');\n}\n\nvar hyphenateStyleName_1 = hyphenateStyleName;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar _hyphenPattern = /-(.)/g;\n\n/**\n * Camelcases a hyphenated string, for example:\n *\n *   > camelize('background-color')\n *   < \"backgroundColor\"\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelize(string) {\n  return string.replace(_hyphenPattern, function (_, character) {\n    return character.toUpperCase();\n  });\n}\n\nvar camelize_1 = camelize;\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n\n\n\n\nvar msPattern$1 = /^-ms-/;\n\n/**\n * Camelcases a hyphenated CSS property name, for example:\n *\n *   > camelizeStyleName('background-color')\n *   < \"backgroundColor\"\n *   > camelizeStyleName('-moz-transition')\n *   < \"MozTransition\"\n *   > camelizeStyleName('-ms-transition')\n *   < \"msTransition\"\n *\n * As Andi Smith suggests\n * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n * is converted to lowercase `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelizeStyleName(string) {\n  return camelize_1(string.replace(msPattern$1, 'ms-'));\n}\n\nvar camelizeStyleName_1 = camelizeStyleName;\n\nvar warnValidStyle = emptyFunction_1;\n\n{\n  // 'msTransform' is correct, but the other prefixes should be capitalized\n  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n\n  // style values shouldn't contain a semicolon\n  var badStyleValueWithSemicolonPattern = /;\\s*$/;\n\n  var warnedStyleNames = {};\n  var warnedStyleValues = {};\n  var warnedForNaNValue = false;\n  var warnedForInfinityValue = false;\n\n  var warnHyphenatedStyleName = function (name, getStack) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n\n    warnedStyleNames[name] = true;\n    warning_1(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName_1(name), getStack());\n  };\n\n  var warnBadVendoredStyleName = function (name, getStack) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n\n    warnedStyleNames[name] = true;\n    warning_1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), getStack());\n  };\n\n  var warnStyleValueWithSemicolon = function (name, value, getStack) {\n    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n      return;\n    }\n\n    warnedStyleValues[value] = true;\n    warning_1(false, \"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.%s', name, value.replace(badStyleValueWithSemicolonPattern, ''), getStack());\n  };\n\n  var warnStyleValueIsNaN = function (name, value, getStack) {\n    if (warnedForNaNValue) {\n      return;\n    }\n\n    warnedForNaNValue = true;\n    warning_1(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, getStack());\n  };\n\n  var warnStyleValueIsInfinity = function (name, value, getStack) {\n    if (warnedForInfinityValue) {\n      return;\n    }\n\n    warnedForInfinityValue = true;\n    warning_1(false, '`Infinity` is an invalid value for the `%s` css style property.%s', name, getStack());\n  };\n\n  warnValidStyle = function (name, value, getStack) {\n    if (name.indexOf('-') > -1) {\n      warnHyphenatedStyleName(name, getStack);\n    } else if (badVendoredStyleNamePattern.test(name)) {\n      warnBadVendoredStyleName(name, getStack);\n    } else if (badStyleValueWithSemicolonPattern.test(value)) {\n      warnStyleValueWithSemicolon(name, value, getStack);\n    }\n\n    if (typeof value === 'number') {\n      if (isNaN(value)) {\n        warnStyleValueIsNaN(name, value, getStack);\n      } else if (!isFinite(value)) {\n        warnStyleValueIsInfinity(name, value, getStack);\n      }\n    }\n  };\n}\n\nvar warnValidStyle$1 = warnValidStyle;\n\n/**\n * Operations for dealing with CSS properties.\n */\n\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\nfunction createDangerousStringForStyles(styles) {\n  {\n    var serialized = '';\n    var delimiter = '';\n    for (var styleName in styles) {\n      if (!styles.hasOwnProperty(styleName)) {\n        continue;\n      }\n      var styleValue = styles[styleName];\n      if (styleValue != null) {\n        var isCustomProperty = styleName.indexOf('--') === 0;\n        serialized += delimiter + hyphenateStyleName_1(styleName) + ':';\n        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n\n        delimiter = ';';\n      }\n    }\n    return serialized || null;\n  }\n}\n\n/**\n * Sets the value for multiple styles on a node.  If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\nfunction setValueForStyles(node, styles, getStack) {\n  var style = node.style;\n  for (var styleName in styles) {\n    if (!styles.hasOwnProperty(styleName)) {\n      continue;\n    }\n    var isCustomProperty = styleName.indexOf('--') === 0;\n    {\n      if (!isCustomProperty) {\n        warnValidStyle$1(styleName, styles[styleName], getStack);\n      }\n    }\n    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n    if (styleName === 'float') {\n      styleName = 'cssFloat';\n    }\n    if (isCustomProperty) {\n      style.setProperty(styleName, styleValue);\n    } else {\n      style[styleName] = styleValue;\n    }\n  }\n}\n\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\n\nvar omittedCloseTags = {\n  area: true,\n  base: true,\n  br: true,\n  col: true,\n  embed: true,\n  hr: true,\n  img: true,\n  input: true,\n  keygen: true,\n  link: true,\n  meta: true,\n  param: true,\n  source: true,\n  track: true,\n  wbr: true\n};\n\n// For HTML, certain tags cannot have children. This has the same purpose as\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = _assign({\n  menuitem: true\n}, omittedCloseTags);\n\nvar HTML$1 = '__html';\n\nfunction assertValidProps(tag, props, getStack) {\n  if (!props) {\n    return;\n  }\n  // Note the use of `==` which checks for null or undefined.\n  if (voidElementTags[tag]) {\n    !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant_1(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, getStack()) : void 0;\n  }\n  if (props.dangerouslySetInnerHTML != null) {\n    !(props.children == null) ? invariant_1(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;\n    !(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML) ? invariant_1(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;\n  }\n  {\n    warning_1(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.%s', getStack());\n  }\n  !(props.style == null || typeof props.style === 'object') ? invariant_1(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \\'em\\'}} when using JSX.%s', getStack()) : void 0;\n}\n\nfunction isCustomComponent(tagName, props) {\n  if (tagName.indexOf('-') === -1) {\n    return typeof props.is === 'string';\n  }\n  switch (tagName) {\n    // These are reserved SVG and MathML elements.\n    // We don't mind this whitelist too much because we expect it to never grow.\n    // The alternative is to track the namespace in a few places which is convoluted.\n    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n    case 'annotation-xml':\n    case 'color-profile':\n    case 'font-face':\n    case 'font-face-src':\n    case 'font-face-uri':\n    case 'font-face-format':\n    case 'font-face-name':\n    case 'missing-glyph':\n      return false;\n    default:\n      return true;\n  }\n}\n\nvar ariaProperties = {\n  'aria-current': 0, // state\n  'aria-details': 0,\n  'aria-disabled': 0, // state\n  'aria-hidden': 0, // state\n  'aria-invalid': 0, // state\n  'aria-keyshortcuts': 0,\n  'aria-label': 0,\n  'aria-roledescription': 0,\n  // Widget Attributes\n  'aria-autocomplete': 0,\n  'aria-checked': 0,\n  'aria-expanded': 0,\n  'aria-haspopup': 0,\n  'aria-level': 0,\n  'aria-modal': 0,\n  'aria-multiline': 0,\n  'aria-multiselectable': 0,\n  'aria-orientation': 0,\n  'aria-placeholder': 0,\n  'aria-pressed': 0,\n  'aria-readonly': 0,\n  'aria-required': 0,\n  'aria-selected': 0,\n  'aria-sort': 0,\n  'aria-valuemax': 0,\n  'aria-valuemin': 0,\n  'aria-valuenow': 0,\n  'aria-valuetext': 0,\n  // Live Region Attributes\n  'aria-atomic': 0,\n  'aria-busy': 0,\n  'aria-live': 0,\n  'aria-relevant': 0,\n  // Drag-and-Drop Attributes\n  'aria-dropeffect': 0,\n  'aria-grabbed': 0,\n  // Relationship Attributes\n  'aria-activedescendant': 0,\n  'aria-colcount': 0,\n  'aria-colindex': 0,\n  'aria-colspan': 0,\n  'aria-controls': 0,\n  'aria-describedby': 0,\n  'aria-errormessage': 0,\n  'aria-flowto': 0,\n  'aria-labelledby': 0,\n  'aria-owns': 0,\n  'aria-posinset': 0,\n  'aria-rowcount': 0,\n  'aria-rowindex': 0,\n  'aria-rowspan': 0,\n  'aria-setsize': 0\n};\n\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n\nfunction getStackAddendum() {\n  var stack = ReactDebugCurrentFrame.getStackAddendum();\n  return stack != null ? stack : '';\n}\n\nfunction validateProperty(tagName, name) {\n  if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {\n    return true;\n  }\n\n  if (rARIACamel.test(name)) {\n    var ariaName = 'aria-' + name.slice(4).toLowerCase();\n    var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;\n\n    // If this is an aria-* attribute, but is not listed in the known DOM\n    // DOM properties, then it is an invalid aria-* attribute.\n    if (correctName == null) {\n      warning_1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.%s', name, getStackAddendum());\n      warnedProperties[name] = true;\n      return true;\n    }\n    // aria-* attributes should be lowercase; suggest the lowercase version.\n    if (name !== correctName) {\n      warning_1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?%s', name, correctName, getStackAddendum());\n      warnedProperties[name] = true;\n      return true;\n    }\n  }\n\n  if (rARIA.test(name)) {\n    var lowerCasedName = name.toLowerCase();\n    var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;\n\n    // If this is an aria-* attribute, but is not listed in the known DOM\n    // DOM properties, then it is an invalid aria-* attribute.\n    if (standardName == null) {\n      warnedProperties[name] = true;\n      return false;\n    }\n    // aria-* attributes should be lowercase; suggest the lowercase version.\n    if (name !== standardName) {\n      warning_1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum());\n      warnedProperties[name] = true;\n      return true;\n    }\n  }\n\n  return true;\n}\n\nfunction warnInvalidARIAProps(type, props) {\n  var invalidProps = [];\n\n  for (var key in props) {\n    var isValid = validateProperty(type, key);\n    if (!isValid) {\n      invalidProps.push(key);\n    }\n  }\n\n  var unknownPropString = invalidProps.map(function (prop) {\n    return '`' + prop + '`';\n  }).join(', ');\n\n  if (invalidProps.length === 1) {\n    warning_1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());\n  } else if (invalidProps.length > 1) {\n    warning_1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());\n  }\n}\n\nfunction validateProperties(type, props) {\n  if (isCustomComponent(type, props)) {\n    return;\n  }\n  warnInvalidARIAProps(type, props);\n}\n\nvar didWarnValueNull = false;\n\nfunction getStackAddendum$1() {\n  var stack = ReactDebugCurrentFrame.getStackAddendum();\n  return stack != null ? stack : '';\n}\n\nfunction validateProperties$1(type, props) {\n  if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n    return;\n  }\n\n  if (props != null && props.value === null && !didWarnValueNull) {\n    didWarnValueNull = true;\n    if (type === 'select' && props.multiple) {\n      warning_1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.%s', type, getStackAddendum$1());\n    } else {\n      warning_1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', type, getStackAddendum$1());\n    }\n  }\n}\n\n// When adding attributes to the HTML or SVG whitelist, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar possibleStandardNames = {\n  // HTML\n  accept: 'accept',\n  acceptcharset: 'acceptCharset',\n  'accept-charset': 'acceptCharset',\n  accesskey: 'accessKey',\n  action: 'action',\n  allowfullscreen: 'allowFullScreen',\n  alt: 'alt',\n  as: 'as',\n  async: 'async',\n  autocapitalize: 'autoCapitalize',\n  autocomplete: 'autoComplete',\n  autocorrect: 'autoCorrect',\n  autofocus: 'autoFocus',\n  autoplay: 'autoPlay',\n  autosave: 'autoSave',\n  capture: 'capture',\n  cellpadding: 'cellPadding',\n  cellspacing: 'cellSpacing',\n  challenge: 'challenge',\n  charset: 'charSet',\n  checked: 'checked',\n  children: 'children',\n  cite: 'cite',\n  'class': 'className',\n  classid: 'classID',\n  classname: 'className',\n  cols: 'cols',\n  colspan: 'colSpan',\n  content: 'content',\n  contenteditable: 'contentEditable',\n  contextmenu: 'contextMenu',\n  controls: 'controls',\n  controlslist: 'controlsList',\n  coords: 'coords',\n  crossorigin: 'crossOrigin',\n  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n  data: 'data',\n  datetime: 'dateTime',\n  'default': 'default',\n  defaultchecked: 'defaultChecked',\n  defaultvalue: 'defaultValue',\n  defer: 'defer',\n  dir: 'dir',\n  disabled: 'disabled',\n  download: 'download',\n  draggable: 'draggable',\n  enctype: 'encType',\n  'for': 'htmlFor',\n  form: 'form',\n  formmethod: 'formMethod',\n  formaction: 'formAction',\n  formenctype: 'formEncType',\n  formnovalidate: 'formNoValidate',\n  formtarget: 'formTarget',\n  frameborder: 'frameBorder',\n  headers: 'headers',\n  height: 'height',\n  hidden: 'hidden',\n  high: 'high',\n  href: 'href',\n  hreflang: 'hrefLang',\n  htmlfor: 'htmlFor',\n  httpequiv: 'httpEquiv',\n  'http-equiv': 'httpEquiv',\n  icon: 'icon',\n  id: 'id',\n  innerhtml: 'innerHTML',\n  inputmode: 'inputMode',\n  integrity: 'integrity',\n  is: 'is',\n  itemid: 'itemID',\n  itemprop: 'itemProp',\n  itemref: 'itemRef',\n  itemscope: 'itemScope',\n  itemtype: 'itemType',\n  keyparams: 'keyParams',\n  keytype: 'keyType',\n  kind: 'kind',\n  label: 'label',\n  lang: 'lang',\n  list: 'list',\n  loop: 'loop',\n  low: 'low',\n  manifest: 'manifest',\n  marginwidth: 'marginWidth',\n  marginheight: 'marginHeight',\n  max: 'max',\n  maxlength: 'maxLength',\n  media: 'media',\n  mediagroup: 'mediaGroup',\n  method: 'method',\n  min: 'min',\n  minlength: 'minLength',\n  multiple: 'multiple',\n  muted: 'muted',\n  name: 'name',\n  nonce: 'nonce',\n  novalidate: 'noValidate',\n  open: 'open',\n  optimum: 'optimum',\n  pattern: 'pattern',\n  placeholder: 'placeholder',\n  playsinline: 'playsInline',\n  poster: 'poster',\n  preload: 'preload',\n  profile: 'profile',\n  radiogroup: 'radioGroup',\n  readonly: 'readOnly',\n  referrerpolicy: 'referrerPolicy',\n  rel: 'rel',\n  required: 'required',\n  reversed: 'reversed',\n  role: 'role',\n  rows: 'rows',\n  rowspan: 'rowSpan',\n  sandbox: 'sandbox',\n  scope: 'scope',\n  scoped: 'scoped',\n  scrolling: 'scrolling',\n  seamless: 'seamless',\n  selected: 'selected',\n  shape: 'shape',\n  size: 'size',\n  sizes: 'sizes',\n  span: 'span',\n  spellcheck: 'spellCheck',\n  src: 'src',\n  srcdoc: 'srcDoc',\n  srclang: 'srcLang',\n  srcset: 'srcSet',\n  start: 'start',\n  step: 'step',\n  style: 'style',\n  summary: 'summary',\n  tabindex: 'tabIndex',\n  target: 'target',\n  title: 'title',\n  type: 'type',\n  usemap: 'useMap',\n  value: 'value',\n  width: 'width',\n  wmode: 'wmode',\n  wrap: 'wrap',\n\n  // SVG\n  about: 'about',\n  accentheight: 'accentHeight',\n  'accent-height': 'accentHeight',\n  accumulate: 'accumulate',\n  additive: 'additive',\n  alignmentbaseline: 'alignmentBaseline',\n  'alignment-baseline': 'alignmentBaseline',\n  allowreorder: 'allowReorder',\n  alphabetic: 'alphabetic',\n  amplitude: 'amplitude',\n  arabicform: 'arabicForm',\n  'arabic-form': 'arabicForm',\n  ascent: 'ascent',\n  attributename: 'attributeName',\n  attributetype: 'attributeType',\n  autoreverse: 'autoReverse',\n  azimuth: 'azimuth',\n  basefrequency: 'baseFrequency',\n  baselineshift: 'baselineShift',\n  'baseline-shift': 'baselineShift',\n  baseprofile: 'baseProfile',\n  bbox: 'bbox',\n  begin: 'begin',\n  bias: 'bias',\n  by: 'by',\n  calcmode: 'calcMode',\n  capheight: 'capHeight',\n  'cap-height': 'capHeight',\n  clip: 'clip',\n  clippath: 'clipPath',\n  'clip-path': 'clipPath',\n  clippathunits: 'clipPathUnits',\n  cliprule: 'clipRule',\n  'clip-rule': 'clipRule',\n  color: 'color',\n  colorinterpolation: 'colorInterpolation',\n  'color-interpolation': 'colorInterpolation',\n  colorinterpolationfilters: 'colorInterpolationFilters',\n  'color-interpolation-filters': 'colorInterpolationFilters',\n  colorprofile: 'colorProfile',\n  'color-profile': 'colorProfile',\n  colorrendering: 'colorRendering',\n  'color-rendering': 'colorRendering',\n  contentscripttype: 'contentScriptType',\n  contentstyletype: 'contentStyleType',\n  cursor: 'cursor',\n  cx: 'cx',\n  cy: 'cy',\n  d: 'd',\n  datatype: 'datatype',\n  decelerate: 'decelerate',\n  descent: 'descent',\n  diffuseconstant: 'diffuseConstant',\n  direction: 'direction',\n  display: 'display',\n  divisor: 'divisor',\n  dominantbaseline: 'dominantBaseline',\n  'dominant-baseline': 'dominantBaseline',\n  dur: 'dur',\n  dx: 'dx',\n  dy: 'dy',\n  edgemode: 'edgeMode',\n  elevation: 'elevation',\n  enablebackground: 'enableBackground',\n  'enable-background': 'enableBackground',\n  end: 'end',\n  exponent: 'exponent',\n  externalresourcesrequired: 'externalResourcesRequired',\n  fill: 'fill',\n  fillopacity: 'fillOpacity',\n  'fill-opacity': 'fillOpacity',\n  fillrule: 'fillRule',\n  'fill-rule': 'fillRule',\n  filter: 'filter',\n  filterres: 'filterRes',\n  filterunits: 'filterUnits',\n  floodopacity: 'floodOpacity',\n  'flood-opacity': 'floodOpacity',\n  floodcolor: 'floodColor',\n  'flood-color': 'floodColor',\n  focusable: 'focusable',\n  fontfamily: 'fontFamily',\n  'font-family': 'fontFamily',\n  fontsize: 'fontSize',\n  'font-size': 'fontSize',\n  fontsizeadjust: 'fontSizeAdjust',\n  'font-size-adjust': 'fontSizeAdjust',\n  fontstretch: 'fontStretch',\n  'font-stretch': 'fontStretch',\n  fontstyle: 'fontStyle',\n  'font-style': 'fontStyle',\n  fontvariant: 'fontVariant',\n  'font-variant': 'fontVariant',\n  fontweight: 'fontWeight',\n  'font-weight': 'fontWeight',\n  format: 'format',\n  from: 'from',\n  fx: 'fx',\n  fy: 'fy',\n  g1: 'g1',\n  g2: 'g2',\n  glyphname: 'glyphName',\n  'glyph-name': 'glyphName',\n  glyphorientationhorizontal: 'glyphOrientationHorizontal',\n  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n  glyphorientationvertical: 'glyphOrientationVertical',\n  'glyph-orientation-vertical': 'glyphOrientationVertical',\n  glyphref: 'glyphRef',\n  gradienttransform: 'gradientTransform',\n  gradientunits: 'gradientUnits',\n  hanging: 'hanging',\n  horizadvx: 'horizAdvX',\n  'horiz-adv-x': 'horizAdvX',\n  horizoriginx: 'horizOriginX',\n  'horiz-origin-x': 'horizOriginX',\n  ideographic: 'ideographic',\n  imagerendering: 'imageRendering',\n  'image-rendering': 'imageRendering',\n  in2: 'in2',\n  'in': 'in',\n  inlist: 'inlist',\n  intercept: 'intercept',\n  k1: 'k1',\n  k2: 'k2',\n  k3: 'k3',\n  k4: 'k4',\n  k: 'k',\n  kernelmatrix: 'kernelMatrix',\n  kernelunitlength: 'kernelUnitLength',\n  kerning: 'kerning',\n  keypoints: 'keyPoints',\n  keysplines: 'keySplines',\n  keytimes: 'keyTimes',\n  lengthadjust: 'lengthAdjust',\n  letterspacing: 'letterSpacing',\n  'letter-spacing': 'letterSpacing',\n  lightingcolor: 'lightingColor',\n  'lighting-color': 'lightingColor',\n  limitingconeangle: 'limitingConeAngle',\n  local: 'local',\n  markerend: 'markerEnd',\n  'marker-end': 'markerEnd',\n  markerheight: 'markerHeight',\n  markermid: 'markerMid',\n  'marker-mid': 'markerMid',\n  markerstart: 'markerStart',\n  'marker-start': 'markerStart',\n  markerunits: 'markerUnits',\n  markerwidth: 'markerWidth',\n  mask: 'mask',\n  maskcontentunits: 'maskContentUnits',\n  maskunits: 'maskUnits',\n  mathematical: 'mathematical',\n  mode: 'mode',\n  numoctaves: 'numOctaves',\n  offset: 'offset',\n  opacity: 'opacity',\n  operator: 'operator',\n  order: 'order',\n  orient: 'orient',\n  orientation: 'orientation',\n  origin: 'origin',\n  overflow: 'overflow',\n  overlineposition: 'overlinePosition',\n  'overline-position': 'overlinePosition',\n  overlinethickness: 'overlineThickness',\n  'overline-thickness': 'overlineThickness',\n  paintorder: 'paintOrder',\n  'paint-order': 'paintOrder',\n  panose1: 'panose1',\n  'panose-1': 'panose1',\n  pathlength: 'pathLength',\n  patterncontentunits: 'patternContentUnits',\n  patterntransform: 'patternTransform',\n  patternunits: 'patternUnits',\n  pointerevents: 'pointerEvents',\n  'pointer-events': 'pointerEvents',\n  points: 'points',\n  pointsatx: 'pointsAtX',\n  pointsaty: 'pointsAtY',\n  pointsatz: 'pointsAtZ',\n  prefix: 'prefix',\n  preservealpha: 'preserveAlpha',\n  preserveaspectratio: 'preserveAspectRatio',\n  primitiveunits: 'primitiveUnits',\n  property: 'property',\n  r: 'r',\n  radius: 'radius',\n  refx: 'refX',\n  refy: 'refY',\n  renderingintent: 'renderingIntent',\n  'rendering-intent': 'renderingIntent',\n  repeatcount: 'repeatCount',\n  repeatdur: 'repeatDur',\n  requiredextensions: 'requiredExtensions',\n  requiredfeatures: 'requiredFeatures',\n  resource: 'resource',\n  restart: 'restart',\n  result: 'result',\n  results: 'results',\n  rotate: 'rotate',\n  rx: 'rx',\n  ry: 'ry',\n  scale: 'scale',\n  security: 'security',\n  seed: 'seed',\n  shaperendering: 'shapeRendering',\n  'shape-rendering': 'shapeRendering',\n  slope: 'slope',\n  spacing: 'spacing',\n  specularconstant: 'specularConstant',\n  specularexponent: 'specularExponent',\n  speed: 'speed',\n  spreadmethod: 'spreadMethod',\n  startoffset: 'startOffset',\n  stddeviation: 'stdDeviation',\n  stemh: 'stemh',\n  stemv: 'stemv',\n  stitchtiles: 'stitchTiles',\n  stopcolor: 'stopColor',\n  'stop-color': 'stopColor',\n  stopopacity: 'stopOpacity',\n  'stop-opacity': 'stopOpacity',\n  strikethroughposition: 'strikethroughPosition',\n  'strikethrough-position': 'strikethroughPosition',\n  strikethroughthickness: 'strikethroughThickness',\n  'strikethrough-thickness': 'strikethroughThickness',\n  string: 'string',\n  stroke: 'stroke',\n  strokedasharray: 'strokeDasharray',\n  'stroke-dasharray': 'strokeDasharray',\n  strokedashoffset: 'strokeDashoffset',\n  'stroke-dashoffset': 'strokeDashoffset',\n  strokelinecap: 'strokeLinecap',\n  'stroke-linecap': 'strokeLinecap',\n  strokelinejoin: 'strokeLinejoin',\n  'stroke-linejoin': 'strokeLinejoin',\n  strokemiterlimit: 'strokeMiterlimit',\n  'stroke-miterlimit': 'strokeMiterlimit',\n  strokewidth: 'strokeWidth',\n  'stroke-width': 'strokeWidth',\n  strokeopacity: 'strokeOpacity',\n  'stroke-opacity': 'strokeOpacity',\n  suppresscontenteditablewarning: 'suppressContentEditableWarning',\n  suppresshydrationwarning: 'suppressHydrationWarning',\n  surfacescale: 'surfaceScale',\n  systemlanguage: 'systemLanguage',\n  tablevalues: 'tableValues',\n  targetx: 'targetX',\n  targety: 'targetY',\n  textanchor: 'textAnchor',\n  'text-anchor': 'textAnchor',\n  textdecoration: 'textDecoration',\n  'text-decoration': 'textDecoration',\n  textlength: 'textLength',\n  textrendering: 'textRendering',\n  'text-rendering': 'textRendering',\n  to: 'to',\n  transform: 'transform',\n  'typeof': 'typeof',\n  u1: 'u1',\n  u2: 'u2',\n  underlineposition: 'underlinePosition',\n  'underline-position': 'underlinePosition',\n  underlinethickness: 'underlineThickness',\n  'underline-thickness': 'underlineThickness',\n  unicode: 'unicode',\n  unicodebidi: 'unicodeBidi',\n  'unicode-bidi': 'unicodeBidi',\n  unicoderange: 'unicodeRange',\n  'unicode-range': 'unicodeRange',\n  unitsperem: 'unitsPerEm',\n  'units-per-em': 'unitsPerEm',\n  unselectable: 'unselectable',\n  valphabetic: 'vAlphabetic',\n  'v-alphabetic': 'vAlphabetic',\n  values: 'values',\n  vectoreffect: 'vectorEffect',\n  'vector-effect': 'vectorEffect',\n  version: 'version',\n  vertadvy: 'vertAdvY',\n  'vert-adv-y': 'vertAdvY',\n  vertoriginx: 'vertOriginX',\n  'vert-origin-x': 'vertOriginX',\n  vertoriginy: 'vertOriginY',\n  'vert-origin-y': 'vertOriginY',\n  vhanging: 'vHanging',\n  'v-hanging': 'vHanging',\n  videographic: 'vIdeographic',\n  'v-ideographic': 'vIdeographic',\n  viewbox: 'viewBox',\n  viewtarget: 'viewTarget',\n  visibility: 'visibility',\n  vmathematical: 'vMathematical',\n  'v-mathematical': 'vMathematical',\n  vocab: 'vocab',\n  widths: 'widths',\n  wordspacing: 'wordSpacing',\n  'word-spacing': 'wordSpacing',\n  writingmode: 'writingMode',\n  'writing-mode': 'writingMode',\n  x1: 'x1',\n  x2: 'x2',\n  x: 'x',\n  xchannelselector: 'xChannelSelector',\n  xheight: 'xHeight',\n  'x-height': 'xHeight',\n  xlinkactuate: 'xlinkActuate',\n  'xlink:actuate': 'xlinkActuate',\n  xlinkarcrole: 'xlinkArcrole',\n  'xlink:arcrole': 'xlinkArcrole',\n  xlinkhref: 'xlinkHref',\n  'xlink:href': 'xlinkHref',\n  xlinkrole: 'xlinkRole',\n  'xlink:role': 'xlinkRole',\n  xlinkshow: 'xlinkShow',\n  'xlink:show': 'xlinkShow',\n  xlinktitle: 'xlinkTitle',\n  'xlink:title': 'xlinkTitle',\n  xlinktype: 'xlinkType',\n  'xlink:type': 'xlinkType',\n  xmlbase: 'xmlBase',\n  'xml:base': 'xmlBase',\n  xmllang: 'xmlLang',\n  'xml:lang': 'xmlLang',\n  xmlns: 'xmlns',\n  'xml:space': 'xmlSpace',\n  xmlnsxlink: 'xmlnsXlink',\n  'xmlns:xlink': 'xmlnsXlink',\n  xmlspace: 'xmlSpace',\n  y1: 'y1',\n  y2: 'y2',\n  y: 'y',\n  ychannelselector: 'yChannelSelector',\n  z: 'z',\n  zoomandpan: 'zoomAndPan'\n};\n\nfunction getStackAddendum$2() {\n  var stack = ReactDebugCurrentFrame.getStackAddendum();\n  return stack != null ? stack : '';\n}\n\n{\n  var warnedProperties$1 = {};\n  var hasOwnProperty$2 = Object.prototype.hasOwnProperty;\n  var EVENT_NAME_REGEX = /^on./;\n  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n  var validateProperty$1 = function (tagName, name, value, canUseEventSystem) {\n    if (hasOwnProperty$2.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n      return true;\n    }\n\n    var lowerCasedName = name.toLowerCase();\n    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n      warning_1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    // We can't rely on the event system being injected on the server.\n    if (canUseEventSystem) {\n      if (registrationNameModules.hasOwnProperty(name)) {\n        return true;\n      }\n      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n      if (registrationName != null) {\n        warning_1(false, 'Invalid event handler property `%s`. Did you mean `%s`?%s', name, registrationName, getStackAddendum$2());\n        warnedProperties$1[name] = true;\n        return true;\n      }\n      if (EVENT_NAME_REGEX.test(name)) {\n        warning_1(false, 'Unknown event handler property `%s`. It will be ignored.%s', name, getStackAddendum$2());\n        warnedProperties$1[name] = true;\n        return true;\n      }\n    } else if (EVENT_NAME_REGEX.test(name)) {\n      // If no event plugins have been injected, we are in a server environment.\n      // So we can't tell if the event name is correct for sure, but we can filter\n      // out known bad ones like `onclick`. We can't suggest a specific replacement though.\n      if (INVALID_EVENT_NAME_REGEX.test(name)) {\n        warning_1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.%s', name, getStackAddendum$2());\n      }\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    // Let the ARIA attribute hook validate ARIA attributes\n    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n      return true;\n    }\n\n    if (lowerCasedName === 'innerhtml') {\n      warning_1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    if (lowerCasedName === 'aria') {\n      warning_1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n      warning_1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.%s', typeof value, getStackAddendum$2());\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    if (typeof value === 'number' && isNaN(value)) {\n      warning_1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum$2());\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    var isReserved = isReservedProp(name);\n\n    // Known attributes should match the casing specified in the property config.\n    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n      var standardName = possibleStandardNames[lowerCasedName];\n      if (standardName !== name) {\n        warning_1(false, 'Invalid DOM property `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$2());\n        warnedProperties$1[name] = true;\n        return true;\n      }\n    } else if (!isReserved && name !== lowerCasedName) {\n      // Unknown attributes should have lowercase casing since that's how they\n      // will be cased anyway with server rendering.\n      warning_1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.%s', name, lowerCasedName, getStackAddendum$2());\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    if (typeof value === 'boolean' && !shouldAttributeAcceptBooleanValue(name)) {\n      if (value) {\n        warning_1(false, 'Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.%s', value, name, name, value, name, getStackAddendum$2());\n      } else {\n        warning_1(false, 'Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.%s', value, name, name, value, name, name, name, getStackAddendum$2());\n      }\n      warnedProperties$1[name] = true;\n      return true;\n    }\n\n    // Now that we've validated casing, do not validate\n    // data types for reserved props\n    if (isReserved) {\n      return true;\n    }\n\n    // Warn when a known attribute is a bad type\n    if (!shouldSetAttribute(name, value)) {\n      warnedProperties$1[name] = true;\n      return false;\n    }\n\n    return true;\n  };\n}\n\nvar warnUnknownProperties = function (type, props, canUseEventSystem) {\n  var unknownProps = [];\n  for (var key in props) {\n    var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);\n    if (!isValid) {\n      unknownProps.push(key);\n    }\n  }\n\n  var unknownPropString = unknownProps.map(function (prop) {\n    return '`' + prop + '`';\n  }).join(', ');\n  if (unknownProps.length === 1) {\n    warning_1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior%s', unknownPropString, type, getStackAddendum$2());\n  } else if (unknownProps.length > 1) {\n    warning_1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior%s', unknownPropString, type, getStackAddendum$2());\n  }\n};\n\nfunction validateProperties$2(type, props, canUseEventSystem) {\n  if (isCustomComponent(type, props)) {\n    return;\n  }\n  warnUnknownProperties(type, props, canUseEventSystem);\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar getCurrentFiberOwnerName$1 = ReactDebugCurrentFiber.getCurrentFiberOwnerName;\nvar getCurrentFiberStackAddendum$2 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\nvar didWarnInvalidHydration = false;\nvar didWarnShadyDOM = false;\n\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML = '__html';\n\nvar HTML_NAMESPACE = Namespaces.html;\n\n\nvar getStack = emptyFunction_1.thatReturns('');\n\n{\n  getStack = getCurrentFiberStackAddendum$2;\n\n  var warnedUnknownTags = {\n    // Chrome is the only major browser not shipping <time>. But as of July\n    // 2017 it intends to ship it due to widespread usage. We intentionally\n    // *don't* warn for <time> even if it's unrecognized by Chrome because\n    // it soon will be, and many apps have been using it anyway.\n    time: true,\n    // There are working polyfills for <dialog>. Let people use it.\n    dialog: true\n  };\n\n  var validatePropertiesInDevelopment = function (type, props) {\n    validateProperties(type, props);\n    validateProperties$1(type, props);\n    validateProperties$2(type, props, /* canUseEventSystem */true);\n  };\n\n  // HTML parsing normalizes CR and CRLF to LF.\n  // It also can turn \\u0000 into \\uFFFD inside attributes.\n  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n  // If we have a mismatch, it might be caused by that.\n  // We will still patch up in this case but not fire the warning.\n  var NORMALIZE_NEWLINES_REGEX = /\\r\\n?/g;\n  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\u0000|\\uFFFD/g;\n\n  var normalizeMarkupForTextOrAttribute = function (markup) {\n    var markupString = typeof markup === 'string' ? markup : '' + markup;\n    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n  };\n\n  var warnForTextDifference = function (serverText, clientText) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n    if (normalizedServerText === normalizedClientText) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    warning_1(false, 'Text content did not match. Server: \"%s\" Client: \"%s\"', normalizedServerText, normalizedClientText);\n  };\n\n  var warnForPropDifference = function (propName, serverValue, clientValue) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n    if (normalizedServerValue === normalizedClientValue) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    warning_1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n  };\n\n  var warnForExtraAttributes = function (attributeNames) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    var names = [];\n    attributeNames.forEach(function (name) {\n      names.push(name);\n    });\n    warning_1(false, 'Extra attributes from the server: %s', names);\n  };\n\n  var warnForInvalidEventListener = function (registrationName, listener) {\n    if (listener === false) {\n      warning_1(false, 'Expected `%s` listener to be a function, instead got `false`.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.%s', registrationName, registrationName, registrationName, getCurrentFiberStackAddendum$2());\n    } else {\n      warning_1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.%s', registrationName, typeof listener, getCurrentFiberStackAddendum$2());\n    }\n  };\n\n  // Parse the HTML and read it back to normalize the HTML string so that it\n  // can be used for comparison.\n  var normalizeHTML = function (parent, html) {\n    // We could have created a separate document here to avoid\n    // re-initializing custom elements if they exist. But this breaks\n    // how <noscript> is being handled. So we use the same document.\n    // See the discussion in https://github.com/facebook/react/pull/11157.\n    var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n    testElement.innerHTML = html;\n    return testElement.innerHTML;\n  };\n}\n\nfunction ensureListeningTo(rootContainerElement, registrationName) {\n  var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;\n  var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;\n  listenTo(registrationName, doc);\n}\n\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\n\n// There are so many media events, it makes sense to just\n// maintain a list rather than create a `trapBubbledEvent` for each\nvar mediaEvents = {\n  topAbort: 'abort',\n  topCanPlay: 'canplay',\n  topCanPlayThrough: 'canplaythrough',\n  topDurationChange: 'durationchange',\n  topEmptied: 'emptied',\n  topEncrypted: 'encrypted',\n  topEnded: 'ended',\n  topError: 'error',\n  topLoadedData: 'loadeddata',\n  topLoadedMetadata: 'loadedmetadata',\n  topLoadStart: 'loadstart',\n  topPause: 'pause',\n  topPlay: 'play',\n  topPlaying: 'playing',\n  topProgress: 'progress',\n  topRateChange: 'ratechange',\n  topSeeked: 'seeked',\n  topSeeking: 'seeking',\n  topStalled: 'stalled',\n  topSuspend: 'suspend',\n  topTimeUpdate: 'timeupdate',\n  topVolumeChange: 'volumechange',\n  topWaiting: 'waiting'\n};\n\nfunction trapClickOnNonInteractiveElement(node) {\n  // Mobile Safari does not fire properly bubble click events on\n  // non-interactive elements, which means delegated click listeners do not\n  // fire. The workaround for this bug involves attaching an empty click\n  // listener on the target node.\n  // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n  // Just set it using the onclick property so that we don't have to manage any\n  // bookkeeping for it. Not sure if we need to clear it when the listener is\n  // removed.\n  // TODO: Only do this for the relevant Safaris maybe?\n  node.onclick = emptyFunction_1;\n}\n\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n  for (var propKey in nextProps) {\n    if (!nextProps.hasOwnProperty(propKey)) {\n      continue;\n    }\n    var nextProp = nextProps[propKey];\n    if (propKey === STYLE) {\n      {\n        if (nextProp) {\n          // Freeze the next style object so that we can assume it won't be\n          // mutated. We have already warned for this in the past.\n          Object.freeze(nextProp);\n        }\n      }\n      // Relies on `updateStylesByID` not mutating `styleUpdates`.\n      setValueForStyles(domElement, nextProp, getStack);\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      var nextHtml = nextProp ? nextProp[HTML] : undefined;\n      if (nextHtml != null) {\n        setInnerHTML(domElement, nextHtml);\n      }\n    } else if (propKey === CHILDREN) {\n      if (typeof nextProp === 'string') {\n        // Avoid setting initial textContent when the text is empty. In IE11 setting\n        // textContent on a <textarea> will cause the placeholder to not\n        // show within the <textarea> until it has been focused and blurred again.\n        // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n        var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n        if (canSetTextContent) {\n          setTextContent(domElement, nextProp);\n        }\n      } else if (typeof nextProp === 'number') {\n        setTextContent(domElement, '' + nextProp);\n      }\n    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {\n      // Noop\n    } else if (propKey === AUTOFOCUS) {\n      // We polyfill it separately on the client during commit.\n      // We blacklist it here rather than in the property list because we emit it in SSR.\n    } else if (registrationNameModules.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        if (true && typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        ensureListeningTo(rootContainerElement, propKey);\n      }\n    } else if (isCustomComponentTag) {\n      setValueForAttribute(domElement, propKey, nextProp);\n    } else if (nextProp != null) {\n      // If we're updating to null or undefined, we should remove the property\n      // from the DOM node instead of inadvertently setting to a string. This\n      // brings us in line with the same behavior we have on initial render.\n      setValueForProperty(domElement, propKey, nextProp);\n    }\n  }\n}\n\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n  // TODO: Handle wasCustomComponentTag\n  for (var i = 0; i < updatePayload.length; i += 2) {\n    var propKey = updatePayload[i];\n    var propValue = updatePayload[i + 1];\n    if (propKey === STYLE) {\n      setValueForStyles(domElement, propValue, getStack);\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      setInnerHTML(domElement, propValue);\n    } else if (propKey === CHILDREN) {\n      setTextContent(domElement, propValue);\n    } else if (isCustomComponentTag) {\n      if (propValue != null) {\n        setValueForAttribute(domElement, propKey, propValue);\n      } else {\n        deleteValueForAttribute(domElement, propKey);\n      }\n    } else if (propValue != null) {\n      setValueForProperty(domElement, propKey, propValue);\n    } else {\n      // If we're updating to null or undefined, we should remove the property\n      // from the DOM node instead of inadvertently setting to a string. This\n      // brings us in line with the same behavior we have on initial render.\n      deleteValueForProperty(domElement, propKey);\n    }\n  }\n}\n\nfunction createElement$1(type, props, rootContainerElement, parentNamespace) {\n  // We create tags in the namespace of their parent container, except HTML\n  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n  var domElement;\n  var namespaceURI = parentNamespace;\n  if (namespaceURI === HTML_NAMESPACE) {\n    namespaceURI = getIntrinsicNamespace(type);\n  }\n  if (namespaceURI === HTML_NAMESPACE) {\n    {\n      var isCustomComponentTag = isCustomComponent(type, props);\n      // Should this check be gated by parent namespace? Not sure we want to\n      // allow <SVG> or <mATH>.\n      warning_1(isCustomComponentTag || type === type.toLowerCase(), '<%s /> is using uppercase HTML. Always use lowercase HTML tags ' + 'in React.', type);\n    }\n\n    if (type === 'script') {\n      // Create the script via .innerHTML so its \"parser-inserted\" flag is\n      // set to true and it does not execute\n      var div = ownerDocument.createElement('div');\n      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line\n      // This is guaranteed to yield a script element.\n      var firstChild = div.firstChild;\n      domElement = div.removeChild(firstChild);\n    } else if (typeof props.is === 'string') {\n      // $FlowIssue `createElement` should be updated for Web Components\n      domElement = ownerDocument.createElement(type, { is: props.is });\n    } else {\n      // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.\n      // See discussion in https://github.com/facebook/react/pull/6896\n      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240\n      domElement = ownerDocument.createElement(type);\n    }\n  } else {\n    domElement = ownerDocument.createElementNS(namespaceURI, type);\n  }\n\n  {\n    if (namespaceURI === HTML_NAMESPACE) {\n      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {\n        warnedUnknownTags[type] = true;\n        warning_1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n      }\n    }\n  }\n\n  return domElement;\n}\n\nfunction createTextNode$1(text, rootContainerElement) {\n  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\n\nfunction setInitialProperties$1(domElement, tag, rawProps, rootContainerElement) {\n  var isCustomComponentTag = isCustomComponent(tag, rawProps);\n  {\n    validatePropertiesInDevelopment(tag, rawProps);\n    if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {\n      warning_1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerName$1() || 'A component');\n      didWarnShadyDOM = true;\n    }\n  }\n\n  // TODO: Make sure that we check isMounted before firing any of these events.\n  var props;\n  switch (tag) {\n    case 'iframe':\n    case 'object':\n      trapBubbledEvent('topLoad', 'load', domElement);\n      props = rawProps;\n      break;\n    case 'video':\n    case 'audio':\n      // Create listener for each media event\n      for (var event in mediaEvents) {\n        if (mediaEvents.hasOwnProperty(event)) {\n          trapBubbledEvent(event, mediaEvents[event], domElement);\n        }\n      }\n      props = rawProps;\n      break;\n    case 'source':\n      trapBubbledEvent('topError', 'error', domElement);\n      props = rawProps;\n      break;\n    case 'img':\n    case 'image':\n      trapBubbledEvent('topError', 'error', domElement);\n      trapBubbledEvent('topLoad', 'load', domElement);\n      props = rawProps;\n      break;\n    case 'form':\n      trapBubbledEvent('topReset', 'reset', domElement);\n      trapBubbledEvent('topSubmit', 'submit', domElement);\n      props = rawProps;\n      break;\n    case 'details':\n      trapBubbledEvent('topToggle', 'toggle', domElement);\n      props = rawProps;\n      break;\n    case 'input':\n      initWrapperState(domElement, rawProps);\n      props = getHostProps(domElement, rawProps);\n      trapBubbledEvent('topInvalid', 'invalid', domElement);\n      // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'option':\n      validateProps(domElement, rawProps);\n      props = getHostProps$1(domElement, rawProps);\n      break;\n    case 'select':\n      initWrapperState$1(domElement, rawProps);\n      props = getHostProps$2(domElement, rawProps);\n      trapBubbledEvent('topInvalid', 'invalid', domElement);\n      // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'textarea':\n      initWrapperState$2(domElement, rawProps);\n      props = getHostProps$3(domElement, rawProps);\n      trapBubbledEvent('topInvalid', 'invalid', domElement);\n      // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    default:\n      props = rawProps;\n  }\n\n  assertValidProps(tag, props, getStack);\n\n  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n\n  switch (tag) {\n    case 'input':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper(domElement, rawProps);\n      break;\n    case 'textarea':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper$3(domElement, rawProps);\n      break;\n    case 'option':\n      postMountWrapper$1(domElement, rawProps);\n      break;\n    case 'select':\n      postMountWrapper$2(domElement, rawProps);\n      break;\n    default:\n      if (typeof props.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n}\n\n// Calculate the diff between the two objects.\nfunction diffProperties$1(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n  {\n    validatePropertiesInDevelopment(tag, nextRawProps);\n  }\n\n  var updatePayload = null;\n\n  var lastProps;\n  var nextProps;\n  switch (tag) {\n    case 'input':\n      lastProps = getHostProps(domElement, lastRawProps);\n      nextProps = getHostProps(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'option':\n      lastProps = getHostProps$1(domElement, lastRawProps);\n      nextProps = getHostProps$1(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'select':\n      lastProps = getHostProps$2(domElement, lastRawProps);\n      nextProps = getHostProps$2(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'textarea':\n      lastProps = getHostProps$3(domElement, lastRawProps);\n      nextProps = getHostProps$3(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    default:\n      lastProps = lastRawProps;\n      nextProps = nextRawProps;\n      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n\n  assertValidProps(tag, nextProps, getStack);\n\n  var propKey;\n  var styleName;\n  var styleUpdates = null;\n  for (propKey in lastProps) {\n    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n      continue;\n    }\n    if (propKey === STYLE) {\n      var lastStyle = lastProps[propKey];\n      for (styleName in lastStyle) {\n        if (lastStyle.hasOwnProperty(styleName)) {\n          if (!styleUpdates) {\n            styleUpdates = {};\n          }\n          styleUpdates[styleName] = '';\n        }\n      }\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {\n      // Noop. This is handled by the clear text mechanism.\n    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {\n      // Noop\n    } else if (propKey === AUTOFOCUS) {\n      // Noop. It doesn't work on updates anyway.\n    } else if (registrationNameModules.hasOwnProperty(propKey)) {\n      // This is a special case. If any listener updates we need to ensure\n      // that the \"current\" fiber pointer gets updated so we need a commit\n      // to update this element.\n      if (!updatePayload) {\n        updatePayload = [];\n      }\n    } else {\n      // For all other deleted properties we add it to the queue. We use\n      // the whitelist in the commit phase instead.\n      (updatePayload = updatePayload || []).push(propKey, null);\n    }\n  }\n  for (propKey in nextProps) {\n    var nextProp = nextProps[propKey];\n    var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n      continue;\n    }\n    if (propKey === STYLE) {\n      {\n        if (nextProp) {\n          // Freeze the next style object so that we can assume it won't be\n          // mutated. We have already warned for this in the past.\n          Object.freeze(nextProp);\n        }\n      }\n      if (lastProp) {\n        // Unset styles on `lastProp` but not on `nextProp`.\n        for (styleName in lastProp) {\n          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n            if (!styleUpdates) {\n              styleUpdates = {};\n            }\n            styleUpdates[styleName] = '';\n          }\n        }\n        // Update styles that changed since `lastProp`.\n        for (styleName in nextProp) {\n          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n            if (!styleUpdates) {\n              styleUpdates = {};\n            }\n            styleUpdates[styleName] = nextProp[styleName];\n          }\n        }\n      } else {\n        // Relies on `updateStylesByID` not mutating `styleUpdates`.\n        if (!styleUpdates) {\n          if (!updatePayload) {\n            updatePayload = [];\n          }\n          updatePayload.push(propKey, styleUpdates);\n        }\n        styleUpdates = nextProp;\n      }\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      var nextHtml = nextProp ? nextProp[HTML] : undefined;\n      var lastHtml = lastProp ? lastProp[HTML] : undefined;\n      if (nextHtml != null) {\n        if (lastHtml !== nextHtml) {\n          (updatePayload = updatePayload || []).push(propKey, '' + nextHtml);\n        }\n      } else {\n        // TODO: It might be too late to clear this if we have children\n        // inserted already.\n      }\n    } else if (propKey === CHILDREN) {\n      if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {\n        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n      }\n    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {\n      // Noop\n    } else if (registrationNameModules.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        // We eagerly listen to this even though we haven't committed yet.\n        if (true && typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        ensureListeningTo(rootContainerElement, propKey);\n      }\n      if (!updatePayload && lastProp !== nextProp) {\n        // This is a special case. If any listener updates we need to ensure\n        // that the \"current\" props pointer gets updated so we need a commit\n        // to update this element.\n        updatePayload = [];\n      }\n    } else {\n      // For any other property we always add it to the queue and then we\n      // filter it out using the whitelist during the commit.\n      (updatePayload = updatePayload || []).push(propKey, nextProp);\n    }\n  }\n  if (styleUpdates) {\n    (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n  }\n  return updatePayload;\n}\n\n// Apply the diff.\nfunction updateProperties$1(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n  // Update checked *before* name.\n  // In the middle of an update, it is possible to have multiple checked.\n  // When a checked radio tries to change name, browser makes another radio's checked false.\n  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n    updateChecked(domElement, nextRawProps);\n  }\n\n  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n  var isCustomComponentTag = isCustomComponent(tag, nextRawProps);\n  // Apply the diff.\n  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);\n\n  // TODO: Ensure that an update gets scheduled if any of the special props\n  // changed.\n  switch (tag) {\n    case 'input':\n      // Update the wrapper around inputs *after* updating props. This has to\n      // happen after `updateDOMProperties`. Otherwise HTML5 input validations\n      // raise warnings and prevent the new value from being assigned.\n      updateWrapper(domElement, nextRawProps);\n      break;\n    case 'textarea':\n      updateWrapper$1(domElement, nextRawProps);\n      break;\n    case 'select':\n      // <select> value update needs to occur after <option> children\n      // reconciliation\n      postUpdateWrapper(domElement, nextRawProps);\n      break;\n  }\n}\n\nfunction diffHydratedProperties$1(domElement, tag, rawProps, parentNamespace, rootContainerElement) {\n  {\n    var suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;\n    var isCustomComponentTag = isCustomComponent(tag, rawProps);\n    validatePropertiesInDevelopment(tag, rawProps);\n    if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {\n      warning_1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerName$1() || 'A component');\n      didWarnShadyDOM = true;\n    }\n  }\n\n  // TODO: Make sure that we check isMounted before firing any of these events.\n  switch (tag) {\n    case 'iframe':\n    case 'object':\n      trapBubbledEvent('topLoad', 'load', domElement);\n      break;\n    case 'video':\n    case 'audio':\n      // Create listener for each media event\n      for (var event in mediaEvents) {\n        if (mediaEvents.hasOwnProperty(event)) {\n          trapBubbledEvent(event, mediaEvents[event], domElement);\n        }\n      }\n      break;\n    case 'source':\n      trapBubbledEvent('topError', 'error', domElement);\n      break;\n    case 'img':\n    case 'image':\n      trapBubbledEvent('topError', 'error', domElement);\n      trapBubbledEvent('topLoad', 'load', domElement);\n      break;\n    case 'form':\n      trapBubbledEvent('topReset', 'reset', domElement);\n      trapBubbledEvent('topSubmit', 'submit', domElement);\n      break;\n    case 'details':\n      trapBubbledEvent('topToggle', 'toggle', domElement);\n      break;\n    case 'input':\n      initWrapperState(domElement, rawProps);\n      trapBubbledEvent('topInvalid', 'invalid', domElement);\n      // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'option':\n      validateProps(domElement, rawProps);\n      break;\n    case 'select':\n      initWrapperState$1(domElement, rawProps);\n      trapBubbledEvent('topInvalid', 'invalid', domElement);\n      // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'textarea':\n      initWrapperState$2(domElement, rawProps);\n      trapBubbledEvent('topInvalid', 'invalid', domElement);\n      // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n  }\n\n  assertValidProps(tag, rawProps, getStack);\n\n  {\n    var extraAttributeNames = new Set();\n    var attributes = domElement.attributes;\n    for (var i = 0; i < attributes.length; i++) {\n      var name = attributes[i].name.toLowerCase();\n      switch (name) {\n        // Built-in SSR attribute is whitelisted\n        case 'data-reactroot':\n          break;\n        // Controlled attributes are not validated\n        // TODO: Only ignore them on controlled tags.\n        case 'value':\n          break;\n        case 'checked':\n          break;\n        case 'selected':\n          break;\n        default:\n          // Intentionally use the original name.\n          // See discussion in https://github.com/facebook/react/pull/10676.\n          extraAttributeNames.add(attributes[i].name);\n      }\n    }\n  }\n\n  var updatePayload = null;\n  for (var propKey in rawProps) {\n    if (!rawProps.hasOwnProperty(propKey)) {\n      continue;\n    }\n    var nextProp = rawProps[propKey];\n    if (propKey === CHILDREN) {\n      // For text content children we compare against textContent. This\n      // might match additional HTML that is hidden when we read it using\n      // textContent. E.g. \"foo\" will match \"f<span>oo</span>\" but that still\n      // satisfies our requirement. Our requirement is not to produce perfect\n      // HTML and attributes. Ideally we should preserve structure but it's\n      // ok not to if the visible content is still enough to indicate what\n      // even listeners these nodes might be wired up to.\n      // TODO: Warn if there is more than a single textNode as a child.\n      // TODO: Should we use domElement.firstChild.nodeValue to compare?\n      if (typeof nextProp === 'string') {\n        if (domElement.textContent !== nextProp) {\n          if (true && !suppressHydrationWarning) {\n            warnForTextDifference(domElement.textContent, nextProp);\n          }\n          updatePayload = [CHILDREN, nextProp];\n        }\n      } else if (typeof nextProp === 'number') {\n        if (domElement.textContent !== '' + nextProp) {\n          if (true && !suppressHydrationWarning) {\n            warnForTextDifference(domElement.textContent, nextProp);\n          }\n          updatePayload = [CHILDREN, '' + nextProp];\n        }\n      }\n    } else if (registrationNameModules.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        if (true && typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        ensureListeningTo(rootContainerElement, propKey);\n      }\n    } else {\n      // Validate that the properties correspond to their expected values.\n      var serverValue;\n      var propertyInfo;\n      if (suppressHydrationWarning) {\n        // Don't bother comparing. We're ignoring all these warnings.\n      } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 ||\n      // Controlled attributes are not validated\n      // TODO: Only ignore them on controlled tags.\n      propKey === 'value' || propKey === 'checked' || propKey === 'selected') {\n        // Noop\n      } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n        var rawHtml = nextProp ? nextProp[HTML] || '' : '';\n        var serverHTML = domElement.innerHTML;\n        var expectedHTML = normalizeHTML(domElement, rawHtml);\n        if (expectedHTML !== serverHTML) {\n          warnForPropDifference(propKey, serverHTML, expectedHTML);\n        }\n      } else if (propKey === STYLE) {\n        // $FlowFixMe - Should be inferred as not undefined.\n        extraAttributeNames['delete'](propKey);\n        var expectedStyle = createDangerousStringForStyles(nextProp);\n        serverValue = domElement.getAttribute('style');\n        if (expectedStyle !== serverValue) {\n          warnForPropDifference(propKey, serverValue, expectedStyle);\n        }\n      } else if (isCustomComponentTag) {\n        // $FlowFixMe - Should be inferred as not undefined.\n        extraAttributeNames['delete'](propKey.toLowerCase());\n        serverValue = getValueForAttribute(domElement, propKey, nextProp);\n\n        if (nextProp !== serverValue) {\n          warnForPropDifference(propKey, serverValue, nextProp);\n        }\n      } else if (shouldSetAttribute(propKey, nextProp)) {\n        if (propertyInfo = getPropertyInfo(propKey)) {\n          // $FlowFixMe - Should be inferred as not undefined.\n          extraAttributeNames['delete'](propertyInfo.attributeName);\n          serverValue = getValueForProperty(domElement, propKey, nextProp);\n        } else {\n          var ownNamespace = parentNamespace;\n          if (ownNamespace === HTML_NAMESPACE) {\n            ownNamespace = getIntrinsicNamespace(tag);\n          }\n          if (ownNamespace === HTML_NAMESPACE) {\n            // $FlowFixMe - Should be inferred as not undefined.\n            extraAttributeNames['delete'](propKey.toLowerCase());\n          } else {\n            // $FlowFixMe - Should be inferred as not undefined.\n            extraAttributeNames['delete'](propKey);\n          }\n          serverValue = getValueForAttribute(domElement, propKey, nextProp);\n        }\n\n        if (nextProp !== serverValue) {\n          warnForPropDifference(propKey, serverValue, nextProp);\n        }\n      }\n    }\n  }\n\n  {\n    // $FlowFixMe - Should be inferred as not undefined.\n    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {\n      // $FlowFixMe - Should be inferred as not undefined.\n      warnForExtraAttributes(extraAttributeNames);\n    }\n  }\n\n  switch (tag) {\n    case 'input':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper(domElement, rawProps);\n      break;\n    case 'textarea':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper$3(domElement, rawProps);\n      break;\n    case 'select':\n    case 'option':\n      // For input and textarea we current always set the value property at\n      // post mount to force it to diverge from attributes. However, for\n      // option and select we don't quite do the same thing and select\n      // is not resilient to the DOM state changing so we don't do that here.\n      // TODO: Consider not doing this for input and textarea.\n      break;\n    default:\n      if (typeof rawProps.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n\n  return updatePayload;\n}\n\nfunction diffHydratedText$1(textNode, text) {\n  var isDifferent = textNode.nodeValue !== text;\n  return isDifferent;\n}\n\nfunction warnForUnmatchedText$1(textNode, text) {\n  {\n    warnForTextDifference(textNode.nodeValue, text);\n  }\n}\n\nfunction warnForDeletedHydratableElement$1(parentNode, child) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    warning_1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n  }\n}\n\nfunction warnForDeletedHydratableText$1(parentNode, child) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    warning_1(false, 'Did not expect server HTML to contain the text node \"%s\" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());\n  }\n}\n\nfunction warnForInsertedHydratedElement$1(parentNode, tag, props) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    warning_1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());\n  }\n}\n\nfunction warnForInsertedHydratedText$1(parentNode, text) {\n  {\n    if (text === '') {\n      // We expect to insert empty text nodes since they're not represented in\n      // the HTML.\n      // TODO: Remove this special case if we can just avoid inserting empty\n      // text nodes.\n      return;\n    }\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    warning_1(false, 'Expected server HTML to contain a matching text node for \"%s\" in <%s>.', text, parentNode.nodeName.toLowerCase());\n  }\n}\n\nfunction restoreControlledState(domElement, tag, props) {\n  switch (tag) {\n    case 'input':\n      restoreControlledState$1(domElement, props);\n      return;\n    case 'textarea':\n      restoreControlledState$3(domElement, props);\n      return;\n    case 'select':\n      restoreControlledState$2(domElement, props);\n      return;\n  }\n}\n\nvar ReactDOMFiberComponent = Object.freeze({\n\tcreateElement: createElement$1,\n\tcreateTextNode: createTextNode$1,\n\tsetInitialProperties: setInitialProperties$1,\n\tdiffProperties: diffProperties$1,\n\tupdateProperties: updateProperties$1,\n\tdiffHydratedProperties: diffHydratedProperties$1,\n\tdiffHydratedText: diffHydratedText$1,\n\twarnForUnmatchedText: warnForUnmatchedText$1,\n\twarnForDeletedHydratableElement: warnForDeletedHydratableElement$1,\n\twarnForDeletedHydratableText: warnForDeletedHydratableText$1,\n\twarnForInsertedHydratedElement: warnForInsertedHydratedElement$1,\n\twarnForInsertedHydratedText: warnForInsertedHydratedText$1,\n\trestoreControlledState: restoreControlledState\n});\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar getCurrentFiberStackAddendum$6 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;\n\nvar validateDOMNesting = emptyFunction_1;\n\n{\n  // This validation code was written based on the HTML5 parsing spec:\n  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n  //\n  // Note: this does not catch all invalid nesting, nor does it try to (as it's\n  // not clear what practical benefit doing so provides); instead, we warn only\n  // for cases where the parser will give a parse tree differing from what React\n  // intended. For example, <b><div></div></b> is invalid but we don't warn\n  // because it still parses correctly; we do warn for other cases like nested\n  // <p> tags where the beginning of the second element implicitly closes the\n  // first, causing a confusing mess.\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#special\n  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point\n  // TODO: Distinguish by namespace here -- for <title>, including it here\n  // errs on the side of fewer warnings\n  'foreignObject', 'desc', 'title'];\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n  var buttonScopeTags = inScopeTags.concat(['button']);\n\n  // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n\n  var emptyAncestorInfo = {\n    current: null,\n\n    formTag: null,\n    aTagInScope: null,\n    buttonTagInScope: null,\n    nobrTagInScope: null,\n    pTagInButtonScope: null,\n\n    listItemTagAutoclosing: null,\n    dlItemTagAutoclosing: null\n  };\n\n  var updatedAncestorInfo$1 = function (oldInfo, tag, instance) {\n    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n    var info = { tag: tag, instance: instance };\n\n    if (inScopeTags.indexOf(tag) !== -1) {\n      ancestorInfo.aTagInScope = null;\n      ancestorInfo.buttonTagInScope = null;\n      ancestorInfo.nobrTagInScope = null;\n    }\n    if (buttonScopeTags.indexOf(tag) !== -1) {\n      ancestorInfo.pTagInButtonScope = null;\n    }\n\n    // See rules for 'li', 'dd', 'dt' start tags in\n    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n      ancestorInfo.listItemTagAutoclosing = null;\n      ancestorInfo.dlItemTagAutoclosing = null;\n    }\n\n    ancestorInfo.current = info;\n\n    if (tag === 'form') {\n      ancestorInfo.formTag = info;\n    }\n    if (tag === 'a') {\n      ancestorInfo.aTagInScope = info;\n    }\n    if (tag === 'button') {\n      ancestorInfo.buttonTagInScope = info;\n    }\n    if (tag === 'nobr') {\n      ancestorInfo.nobrTagInScope = info;\n    }\n    if (tag === 'p') {\n      ancestorInfo.pTagInButtonScope = info;\n    }\n    if (tag === 'li') {\n      ancestorInfo.listItemTagAutoclosing = info;\n    }\n    if (tag === 'dd' || tag === 'dt') {\n      ancestorInfo.dlItemTagAutoclosing = info;\n    }\n\n    return ancestorInfo;\n  };\n\n  /**\n   * Returns whether\n   */\n  var isTagValidWithParent = function (tag, parentTag) {\n    // First, let's check if we're in an unusual parsing mode...\n    switch (parentTag) {\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect\n      case 'select':\n        return tag === 'option' || tag === 'optgroup' || tag === '#text';\n      case 'optgroup':\n        return tag === 'option' || tag === '#text';\n      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>\n      // but\n      case 'option':\n        return tag === '#text';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption\n      // No special behavior since these rules fall back to \"in body\" mode for\n      // all except special table nodes which cause bad parsing behavior anyway.\n\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr\n      case 'tr':\n        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody\n      case 'tbody':\n      case 'thead':\n      case 'tfoot':\n        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n      case 'colgroup':\n        return tag === 'col' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable\n      case 'table':\n        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead\n      case 'head':\n        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n      case 'html':\n        return tag === 'head' || tag === 'body';\n      case '#document':\n        return tag === 'html';\n    }\n\n    // Probably in the \"in body\" parsing mode, so we outlaw only tag combos\n    // where the parsing rules cause implicit opens or closes to be added.\n    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n    switch (tag) {\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n\n      case 'rp':\n      case 'rt':\n        return impliedEndTags.indexOf(parentTag) === -1;\n\n      case 'body':\n      case 'caption':\n      case 'col':\n      case 'colgroup':\n      case 'frame':\n      case 'head':\n      case 'html':\n      case 'tbody':\n      case 'td':\n      case 'tfoot':\n      case 'th':\n      case 'thead':\n      case 'tr':\n        // These tags are only valid with a few parents that have special child\n        // parsing rules -- if we're down here, then none of those matched and\n        // so we allow it only if we don't know what the parent is, as all other\n        // cases are invalid.\n        return parentTag == null;\n    }\n\n    return true;\n  };\n\n  /**\n   * Returns whether\n   */\n  var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n    switch (tag) {\n      case 'address':\n      case 'article':\n      case 'aside':\n      case 'blockquote':\n      case 'center':\n      case 'details':\n      case 'dialog':\n      case 'dir':\n      case 'div':\n      case 'dl':\n      case 'fieldset':\n      case 'figcaption':\n      case 'figure':\n      case 'footer':\n      case 'header':\n      case 'hgroup':\n      case 'main':\n      case 'menu':\n      case 'nav':\n      case 'ol':\n      case 'p':\n      case 'section':\n      case 'summary':\n      case 'ul':\n      case 'pre':\n      case 'listing':\n      case 'table':\n      case 'hr':\n      case 'xmp':\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return ancestorInfo.pTagInButtonScope;\n\n      case 'form':\n        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n\n      case 'li':\n        return ancestorInfo.listItemTagAutoclosing;\n\n      case 'dd':\n      case 'dt':\n        return ancestorInfo.dlItemTagAutoclosing;\n\n      case 'button':\n        return ancestorInfo.buttonTagInScope;\n\n      case 'a':\n        // Spec says something about storing a list of markers, but it sounds\n        // equivalent to this check.\n        return ancestorInfo.aTagInScope;\n\n      case 'nobr':\n        return ancestorInfo.nobrTagInScope;\n    }\n\n    return null;\n  };\n\n  var didWarn = {};\n\n  validateDOMNesting = function (childTag, childText, ancestorInfo) {\n    ancestorInfo = ancestorInfo || emptyAncestorInfo;\n    var parentInfo = ancestorInfo.current;\n    var parentTag = parentInfo && parentInfo.tag;\n\n    if (childText != null) {\n      warning_1(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null');\n      childTag = '#text';\n    }\n\n    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n    var invalidParentOrAncestor = invalidParent || invalidAncestor;\n    if (!invalidParentOrAncestor) {\n      return;\n    }\n\n    var ancestorTag = invalidParentOrAncestor.tag;\n    var addendum = getCurrentFiberStackAddendum$6();\n\n    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;\n    if (didWarn[warnKey]) {\n      return;\n    }\n    didWarn[warnKey] = true;\n\n    var tagDisplayName = childTag;\n    var whitespaceInfo = '';\n    if (childTag === '#text') {\n      if (/\\S/.test(childText)) {\n        tagDisplayName = 'Text nodes';\n      } else {\n        tagDisplayName = 'Whitespace text nodes';\n        whitespaceInfo = \" Make sure you don't have any extra whitespace between tags on \" + 'each line of your source code.';\n      }\n    } else {\n      tagDisplayName = '<' + childTag + '>';\n    }\n\n    if (invalidParent) {\n      var info = '';\n      if (ancestorTag === 'table' && childTag === 'tr') {\n        info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';\n      }\n      warning_1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);\n    } else {\n      warning_1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);\n    }\n  };\n\n  // TODO: turn this into a named export\n  validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo$1;\n\n  // For testing\n  validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {\n    ancestorInfo = ancestorInfo || emptyAncestorInfo;\n    var parentInfo = ancestorInfo.current;\n    var parentTag = parentInfo && parentInfo.tag;\n    return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);\n  };\n}\n\nvar validateDOMNesting$1 = validateDOMNesting;\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar createElement = createElement$1;\nvar createTextNode = createTextNode$1;\nvar setInitialProperties = setInitialProperties$1;\nvar diffProperties = diffProperties$1;\nvar updateProperties = updateProperties$1;\nvar diffHydratedProperties = diffHydratedProperties$1;\nvar diffHydratedText = diffHydratedText$1;\nvar warnForUnmatchedText = warnForUnmatchedText$1;\nvar warnForDeletedHydratableElement = warnForDeletedHydratableElement$1;\nvar warnForDeletedHydratableText = warnForDeletedHydratableText$1;\nvar warnForInsertedHydratedElement = warnForInsertedHydratedElement$1;\nvar warnForInsertedHydratedText = warnForInsertedHydratedText$1;\nvar updatedAncestorInfo = validateDOMNesting$1.updatedAncestorInfo;\nvar precacheFiberNode = precacheFiberNode$1;\nvar updateFiberProps = updateFiberProps$1;\n\n\n{\n  var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\n  if (typeof Map !== 'function' || Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n    warning_1(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. http://fb.me/react-polyfills');\n  }\n}\n\ninjection$3.injectFiberControlledHostComponent(ReactDOMFiberComponent);\n\nvar eventsEnabled = null;\nvar selectionInformation = null;\n\n/**\n * True if the supplied DOM node is a valid node element.\n *\n * @param {?DOMElement} node The candidate DOM node.\n * @return {boolean} True if the DOM is a valid DOM node.\n * @internal\n */\nfunction isValidContainer(node) {\n  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\n\nfunction getReactRootElementInContainer(container) {\n  if (!container) {\n    return null;\n  }\n\n  if (container.nodeType === DOCUMENT_NODE) {\n    return container.documentElement;\n  } else {\n    return container.firstChild;\n  }\n}\n\nfunction shouldHydrateDueToLegacyHeuristic(container) {\n  var rootElement = getReactRootElementInContainer(container);\n  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));\n}\n\nfunction shouldAutoFocusHostComponent(type, props) {\n  switch (type) {\n    case 'button':\n    case 'input':\n    case 'select':\n    case 'textarea':\n      return !!props.autoFocus;\n  }\n  return false;\n}\n\nvar DOMRenderer = reactReconciler({\n  getRootHostContext: function (rootContainerInstance) {\n    var type = void 0;\n    var namespace = void 0;\n    var nodeType = rootContainerInstance.nodeType;\n    switch (nodeType) {\n      case DOCUMENT_NODE:\n      case DOCUMENT_FRAGMENT_NODE:\n        {\n          type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n          var root = rootContainerInstance.documentElement;\n          namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n          break;\n        }\n      default:\n        {\n          var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n          var ownNamespace = container.namespaceURI || null;\n          type = container.tagName;\n          namespace = getChildNamespace(ownNamespace, type);\n          break;\n        }\n    }\n    {\n      var validatedTag = type.toLowerCase();\n      var _ancestorInfo = updatedAncestorInfo(null, validatedTag, null);\n      return { namespace: namespace, ancestorInfo: _ancestorInfo };\n    }\n    return namespace;\n  },\n  getChildHostContext: function (parentHostContext, type) {\n    {\n      var parentHostContextDev = parentHostContext;\n      var _namespace = getChildNamespace(parentHostContextDev.namespace, type);\n      var _ancestorInfo2 = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type, null);\n      return { namespace: _namespace, ancestorInfo: _ancestorInfo2 };\n    }\n    var parentNamespace = parentHostContext;\n    return getChildNamespace(parentNamespace, type);\n  },\n  getPublicInstance: function (instance) {\n    return instance;\n  },\n  prepareForCommit: function () {\n    eventsEnabled = isEnabled();\n    selectionInformation = getSelectionInformation();\n    setEnabled(false);\n  },\n  resetAfterCommit: function () {\n    restoreSelection(selectionInformation);\n    selectionInformation = null;\n    setEnabled(eventsEnabled);\n    eventsEnabled = null;\n  },\n  createInstance: function (type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n    var parentNamespace = void 0;\n    {\n      // TODO: take namespace into account when validating.\n      var hostContextDev = hostContext;\n      validateDOMNesting$1(type, null, hostContextDev.ancestorInfo);\n      if (typeof props.children === 'string' || typeof props.children === 'number') {\n        var string = '' + props.children;\n        var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type, null);\n        validateDOMNesting$1(null, string, ownAncestorInfo);\n      }\n      parentNamespace = hostContextDev.namespace;\n    }\n    var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n    precacheFiberNode(internalInstanceHandle, domElement);\n    updateFiberProps(domElement, props);\n    return domElement;\n  },\n  appendInitialChild: function (parentInstance, child) {\n    parentInstance.appendChild(child);\n  },\n  finalizeInitialChildren: function (domElement, type, props, rootContainerInstance) {\n    setInitialProperties(domElement, type, props, rootContainerInstance);\n    return shouldAutoFocusHostComponent(type, props);\n  },\n  prepareUpdate: function (domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n    {\n      var hostContextDev = hostContext;\n      if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n        var string = '' + newProps.children;\n        var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type, null);\n        validateDOMNesting$1(null, string, ownAncestorInfo);\n      }\n    }\n    return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);\n  },\n  shouldSetTextContent: function (type, props) {\n    return type === 'textarea' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && typeof props.dangerouslySetInnerHTML.__html === 'string';\n  },\n  shouldDeprioritizeSubtree: function (type, props) {\n    return !!props.hidden;\n  },\n  createTextInstance: function (text, rootContainerInstance, hostContext, internalInstanceHandle) {\n    {\n      var hostContextDev = hostContext;\n      validateDOMNesting$1(null, text, hostContextDev.ancestorInfo);\n    }\n    var textNode = createTextNode(text, rootContainerInstance);\n    precacheFiberNode(internalInstanceHandle, textNode);\n    return textNode;\n  },\n\n\n  now: now,\n\n  mutation: {\n    commitMount: function (domElement, type, newProps, internalInstanceHandle) {\n      domElement.focus();\n    },\n    commitUpdate: function (domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n      // Update the props handle so that we know which props are the ones with\n      // with current event handlers.\n      updateFiberProps(domElement, newProps);\n      // Apply the diff to the DOM node.\n      updateProperties(domElement, updatePayload, type, oldProps, newProps);\n    },\n    resetTextContent: function (domElement) {\n      domElement.textContent = '';\n    },\n    commitTextUpdate: function (textInstance, oldText, newText) {\n      textInstance.nodeValue = newText;\n    },\n    appendChild: function (parentInstance, child) {\n      parentInstance.appendChild(child);\n    },\n    appendChildToContainer: function (container, child) {\n      if (container.nodeType === COMMENT_NODE) {\n        container.parentNode.insertBefore(child, container);\n      } else {\n        container.appendChild(child);\n      }\n    },\n    insertBefore: function (parentInstance, child, beforeChild) {\n      parentInstance.insertBefore(child, beforeChild);\n    },\n    insertInContainerBefore: function (container, child, beforeChild) {\n      if (container.nodeType === COMMENT_NODE) {\n        container.parentNode.insertBefore(child, beforeChild);\n      } else {\n        container.insertBefore(child, beforeChild);\n      }\n    },\n    removeChild: function (parentInstance, child) {\n      parentInstance.removeChild(child);\n    },\n    removeChildFromContainer: function (container, child) {\n      if (container.nodeType === COMMENT_NODE) {\n        container.parentNode.removeChild(child);\n      } else {\n        container.removeChild(child);\n      }\n    }\n  },\n\n  hydration: {\n    canHydrateInstance: function (instance, type, props) {\n      if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n        return null;\n      }\n      // This has now been refined to an element node.\n      return instance;\n    },\n    canHydrateTextInstance: function (instance, text) {\n      if (text === '' || instance.nodeType !== TEXT_NODE) {\n        // Empty strings are not parsed by HTML so there won't be a correct match here.\n        return null;\n      }\n      // This has now been refined to a text node.\n      return instance;\n    },\n    getNextHydratableSibling: function (instance) {\n      var node = instance.nextSibling;\n      // Skip non-hydratable nodes.\n      while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE) {\n        node = node.nextSibling;\n      }\n      return node;\n    },\n    getFirstHydratableChild: function (parentInstance) {\n      var next = parentInstance.firstChild;\n      // Skip non-hydratable nodes.\n      while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE) {\n        next = next.nextSibling;\n      }\n      return next;\n    },\n    hydrateInstance: function (instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n      precacheFiberNode(internalInstanceHandle, instance);\n      // TODO: Possibly defer this until the commit phase where all the events\n      // get attached.\n      updateFiberProps(instance, props);\n      var parentNamespace = void 0;\n      {\n        var hostContextDev = hostContext;\n        parentNamespace = hostContextDev.namespace;\n      }\n      return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);\n    },\n    hydrateTextInstance: function (textInstance, text, internalInstanceHandle) {\n      precacheFiberNode(internalInstanceHandle, textInstance);\n      return diffHydratedText(textInstance, text);\n    },\n    didNotMatchHydratedContainerTextInstance: function (parentContainer, textInstance, text) {\n      {\n        warnForUnmatchedText(textInstance, text);\n      }\n    },\n    didNotMatchHydratedTextInstance: function (parentType, parentProps, parentInstance, textInstance, text) {\n      if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n        warnForUnmatchedText(textInstance, text);\n      }\n    },\n    didNotHydrateContainerInstance: function (parentContainer, instance) {\n      {\n        if (instance.nodeType === 1) {\n          warnForDeletedHydratableElement(parentContainer, instance);\n        } else {\n          warnForDeletedHydratableText(parentContainer, instance);\n        }\n      }\n    },\n    didNotHydrateInstance: function (parentType, parentProps, parentInstance, instance) {\n      if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n        if (instance.nodeType === 1) {\n          warnForDeletedHydratableElement(parentInstance, instance);\n        } else {\n          warnForDeletedHydratableText(parentInstance, instance);\n        }\n      }\n    },\n    didNotFindHydratableContainerInstance: function (parentContainer, type, props) {\n      {\n        warnForInsertedHydratedElement(parentContainer, type, props);\n      }\n    },\n    didNotFindHydratableContainerTextInstance: function (parentContainer, text) {\n      {\n        warnForInsertedHydratedText(parentContainer, text);\n      }\n    },\n    didNotFindHydratableInstance: function (parentType, parentProps, parentInstance, type, props) {\n      if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n        warnForInsertedHydratedElement(parentInstance, type, props);\n      }\n    },\n    didNotFindHydratableTextInstance: function (parentType, parentProps, parentInstance, text) {\n      if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {\n        warnForInsertedHydratedText(parentInstance, text);\n      }\n    }\n  },\n\n  scheduleDeferredCallback: rIC,\n  cancelDeferredCallback: cIC,\n\n  useSyncScheduling: !enableAsyncSchedulingByDefaultInReactDOM\n});\n\ninjection$4.injectFiberBatchedUpdates(DOMRenderer.batchedUpdates);\n\nvar warnedAboutHydrateAPI = false;\n\nfunction renderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n  !isValidContainer(container) ? invariant_1(false, 'Target container is not a DOM element.') : void 0;\n\n  {\n    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n      var hostInstance = DOMRenderer.findHostInstanceWithNoPortals(container._reactRootContainer.current);\n      if (hostInstance) {\n        warning_1(hostInstance.parentNode === container, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n      }\n    }\n\n    var isRootRenderedBySomeReact = !!container._reactRootContainer;\n    var rootEl = getReactRootElementInContainer(container);\n    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));\n\n    warning_1(!hasNonRootReactChild || isRootRenderedBySomeReact, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n\n    warning_1(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n  }\n\n  var root = container._reactRootContainer;\n  if (!root) {\n    var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);\n    // First clear any existing content.\n    if (!shouldHydrate) {\n      var warned = false;\n      var rootSibling = void 0;\n      while (rootSibling = container.lastChild) {\n        {\n          if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {\n            warned = true;\n            warning_1(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');\n          }\n        }\n        container.removeChild(rootSibling);\n      }\n    }\n    {\n      if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {\n        warnedAboutHydrateAPI = true;\n        lowPriorityWarning$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');\n      }\n    }\n    var newRoot = DOMRenderer.createContainer(container, shouldHydrate);\n    root = container._reactRootContainer = newRoot;\n    // Initial mount should not be batched.\n    DOMRenderer.unbatchedUpdates(function () {\n      DOMRenderer.updateContainer(children, newRoot, parentComponent, callback);\n    });\n  } else {\n    DOMRenderer.updateContainer(children, root, parentComponent, callback);\n  }\n  return DOMRenderer.getPublicRootInstance(root);\n}\n\nfunction createPortal(children, container) {\n  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n  !isValidContainer(container) ? invariant_1(false, 'Target container is not a DOM element.') : void 0;\n  // TODO: pass ReactDOM portal implementation as third argument\n  return createPortal$1(children, container, null, key);\n}\n\nfunction ReactRoot(container, hydrate) {\n  var root = DOMRenderer.createContainer(container, hydrate);\n  this._reactRootContainer = root;\n}\nReactRoot.prototype.render = function (children, callback) {\n  var root = this._reactRootContainer;\n  DOMRenderer.updateContainer(children, root, null, callback);\n};\nReactRoot.prototype.unmount = function (callback) {\n  var root = this._reactRootContainer;\n  DOMRenderer.updateContainer(null, root, null, callback);\n};\n\nvar ReactDOM = {\n  createPortal: createPortal,\n\n  findDOMNode: function (componentOrElement) {\n    {\n      var owner = ReactCurrentOwner.current;\n      if (owner !== null) {\n        var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n        warning_1(warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner) || 'A component');\n        owner.stateNode._warnedAboutRefsInRender = true;\n      }\n    }\n    if (componentOrElement == null) {\n      return null;\n    }\n    if (componentOrElement.nodeType === ELEMENT_NODE) {\n      return componentOrElement;\n    }\n\n    var inst = get(componentOrElement);\n    if (inst) {\n      return DOMRenderer.findHostInstance(inst);\n    }\n\n    if (typeof componentOrElement.render === 'function') {\n      invariant_1(false, 'Unable to find node on an unmounted component.');\n    } else {\n      invariant_1(false, 'Element appears to be neither ReactComponent nor DOMNode. Keys: %s', Object.keys(componentOrElement));\n    }\n  },\n  hydrate: function (element, container, callback) {\n    // TODO: throw or warn if we couldn't hydrate?\n    return renderSubtreeIntoContainer(null, element, container, true, callback);\n  },\n  render: function (element, container, callback) {\n    return renderSubtreeIntoContainer(null, element, container, false, callback);\n  },\n  unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) {\n    !(parentComponent != null && has(parentComponent)) ? invariant_1(false, 'parentComponent must be a valid React Component') : void 0;\n    return renderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n  },\n  unmountComponentAtNode: function (container) {\n    !isValidContainer(container) ? invariant_1(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : void 0;\n\n    if (container._reactRootContainer) {\n      {\n        var rootEl = getReactRootElementInContainer(container);\n        var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);\n        warning_1(!renderedByDifferentReact, \"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by another copy of React.');\n      }\n\n      // Unmount should not be batched.\n      DOMRenderer.unbatchedUpdates(function () {\n        renderSubtreeIntoContainer(null, null, container, false, function () {\n          container._reactRootContainer = null;\n        });\n      });\n      // If you call unmountComponentAtNode twice in quick succession, you'll\n      // get `true` twice. That's probably fine?\n      return true;\n    } else {\n      {\n        var _rootEl = getReactRootElementInContainer(container);\n        var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));\n\n        // Check if the container itself is a React root node.\n        var isContainerReactRoot = container.nodeType === 1 && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;\n\n        warning_1(!hasNonRootReactChild, \"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n      }\n\n      return false;\n    }\n  },\n\n\n  // Temporary alias since we already shipped React 16 RC with it.\n  // TODO: remove in React 17.\n  unstable_createPortal: createPortal,\n\n  unstable_batchedUpdates: batchedUpdates,\n\n  unstable_deferredUpdates: DOMRenderer.deferredUpdates,\n\n  flushSync: DOMRenderer.flushSync,\n\n  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {\n    // For TapEventPlugin which is popular in open source\n    EventPluginHub: EventPluginHub,\n    // Used by test-utils\n    EventPluginRegistry: EventPluginRegistry,\n    EventPropagators: EventPropagators,\n    ReactControlledComponent: ReactControlledComponent,\n    ReactDOMComponentTree: ReactDOMComponentTree,\n    ReactDOMEventListener: ReactDOMEventListener\n  }\n};\n\nif (enableCreateRoot) {\n  ReactDOM.createRoot = function createRoot(container, options) {\n    var hydrate = options != null && options.hydrate === true;\n    return new ReactRoot(container, hydrate);\n  };\n}\n\nvar foundDevTools = DOMRenderer.injectIntoDevTools({\n  findFiberByHostInstance: getClosestInstanceFromNode,\n  bundleType: 1,\n  version: ReactVersion,\n  rendererPackageName: 'react-dom'\n});\n\n{\n  if (!foundDevTools && ExecutionEnvironment_1.canUseDOM && window.top === window.self) {\n    // If we're in Chrome or Firefox, provide a download link if not installed.\n    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\n      var protocol = window.location.protocol;\n      // Don't warn in exotic cases like chrome-extension://.\n      if (/^(https?|file):$/.test(protocol)) {\n        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');\n      }\n    }\n  }\n}\n\n\n\nvar ReactDOM$2 = Object.freeze({\n\tdefault: ReactDOM\n});\n\nvar ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;\n\n// TODO: decide on the top-level export form.\n// This is hacky but makes it work with both Rollup and Jest.\nvar reactDom = ReactDOM$3['default'] ? ReactDOM$3['default'] : ReactDOM$3;\n\nreturn reactDom;\n\n})));\n"
  },
  {
    "path": "require.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>require</title>\n</head>\n<body>\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/require.html\" class=\"get-source\">获取源码</a>\n\n\n<h1>require demo</h1>\n<!-- <h2>请打开控制台查看运行结果</h2> -->\n\n<pre id=\"show\"></pre>\n\n\n<script>\n\"use strict\";\nvar t1 = new Date().getTime();\n\nfunction showInfo(str){\n\tvar t = document.getElementById(\"show\");\n\tvar dt = new Date().getTime() - t1 + \" ms 后: \"\n\tt.innerHTML += dt + str + \"<br>\";\n}\n\nshowInfo(\"开始加载\");\n\n\nfunction isSupport(APIName){\n\tvar d = document, w = window;\n\tvar id = \"RongCloudCloud-API-Test\" + new Date().getTime;\n\tvar iframe = d.getElementById(id);\n\tif(!iframe){\n\t\tiframe = d.createElement(\"iframe\");\n\t\tiframe.id = id;\n\t\tiframe.style.display = \"none\";\n\t\td.body.appendChild(iframe);\n\t}\n\tvar nativeAPI = iframe.contentWindow[APIName];\n\tvar API = w[APIName];\n\tif(API && nativeAPI.toString() == API.toString()){\n\t\treturn true;\n\t}\n\treturn false;\n}\t\n</script>\n\n<script src=\"lib/require.js\"></script>\n\t\n<script>\n\"use strict\";\n\nrequire.config({\n    paths: {\n    \tprotobuf: '//cdn.ronghub.com/protobuf-2.3.7.min',\n    \tRongIMLib: '//cdn.ronghub.com/RongIMLib-2.5.3'\n    }\n});\n\nvar isSupportSocket = isSupport(\"WebSocket\");\n\nif(isSupportSocket){\n\trequire(['protobuf','RongIMLib'], function(protobuf,RongIMLib) {\n\t    showInfo(\"require done\");\n\t    init(RongIMLib, protobuf);\n\t});\n}else{\n\trequire(['RongIMLib'], function(RongIMLib) {\n\t    showInfo(\"require done\");\n\n\t    // var RongIMClient = RongIMLib.RongIMClient;\n\n\t    init(RongIMLib);\n\t});\n}\n\nfunction init(RongIMLib, protobuf){\n\tvar appKey = \"8w7jv4qb78a9y\";\n\tvar token = \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\";\n\t\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\tvar config = { };\n\tif (protobuf) {\n\t\tconfig.protobuf = protobuf;\n\t}\n\t//初始化\n\tRongIMClient.init(appKey,null,{protobuf:protobuf});\n\n\tvar _instance = RongIMClient.getInstance();\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function (status) {\n\t\t\tconsole.info(status)\n\t\t    switch (status) {\n\t\t        case RongIMLib.ConnectionStatus.CONNECTED:\n\t\t            showInfo(\"链接成功\");\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.CONNECTING:\n\t\t            console.log('正在链接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.DISCONNECTED:\n\t\t            console.log('断开连接');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n\t\t            console.log('其他设备登录');\n\t\t            break;\n\t\t          case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n\t\t            console.log('域名不正确');\n\t\t            break;\n\t\t        case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n\t\t        \tconsole.log('网络不可用');\n\t\t        \tbreak;\n\t\t        }\n\t\t}\n\t});\n\t\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function (message) {\n\t\t    // 判断消息类型\n\t\t    // showTips(\"新消息，类型为：\" + message.messageType);\n            // showResult(\"新消息\",message,start);\n            console.log(message);\n\n\t\t    switch(message.messageType){\n\t\t        case RongIMClient.MessageType.TextMessage:\n\t\t        \t/*\n\t\t        \t显示消息方法： \n\t\t        \t消息里是 原生emoji\n\t\t        \tRongIMLib.RongIMEmoji.emojiToHTML(message.content.content);\n\t\t            */\n\t\t            break;\n\t\t        case RongIMClient.MessageType.VoiceMessage:\n\t\t            // 对声音进行预加载                \n\t\t            // message.content.content 格式为 AMR 格式的 base64 码\n\t\t            break;\n\t\t        case RongIMClient.MessageType.ImageMessage:\n\t\t           // message.content.content => 图片缩略图 base64。\n\t\t           // message.content.imageUri => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.DiscussionNotificationMessage:\n\t\t           // message.content.extension => 讨论组中的人员。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.LocationMessage:\n\t\t           // message.content.latiude => 纬度。\n\t\t           // message.content.longitude => 经度。\n\t\t           // message.content.content => 位置图片 base64。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.RichContentMessage:\n\t\t           // message.content.content => 文本消息内容。\n\t\t           // message.content.imageUri => 图片 base64。\n\t\t           // message.content.url => 原图 URL。\n\t\t           break;\n\t\t        case RongIMClient.MessageType.InformationNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ContactNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.ProfileNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandNotificationMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.CommandMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        case RongIMClient.MessageType.UnknownMessage:\n\t\t            // do something...\n\t\t           break;\n\t\t        default:\n\t\t            // do something...\n\t\t    }\n\t\t}\n\t});\n\t\n\t\n\t//开始链接\n\tRongIMClient.connect(token, {\n\t\tonSuccess: function(userId) {\n\t\t\tshowInfo(\"链接成功，用户id：\" + userId);\n            sendMessage();\n            getConversationList();\n\t\t},\n\t\tonTokenIncorrect: function() {\n\t\t\tshowInfo('token无效');\n\t\t},\n\t\tonError:function(errorCode){\n\t\t  var info = '';\n\t\t  switch (errorCode) {\n\t\t    case RongIMLib.ErrorCode.TIMEOUT:\n\t\t      info = '超时';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n\t\t      info = '未知错误';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.UNACCEPTABLE_PaROTOCOL_VERSION:\n\t\t      info = '不可接受的协议版本';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n\t\t      info = 'appkey不正确';\n\t\t      break;\n\t\t    case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n\t\t      info = '服务器不可用';\n\t\t      break;\n\t\t  }\n\t\t  console.log(info);\n\t\t}\n\t});\n\n\tfunction getConversationList(){\n\t\t_instance.getConversationList({\n\t\t\tonSuccess: function(list){\n\t\t\t\tshowInfo(JSON.stringify(list, null, '\\t'));\n\t\t\t},\n\t\t\tonError:function(errorCode){\n\t\t\t\t showInfo(errorCode);\n\t\t\t}\n\t\t}, null, 2);\n\t}\n\t\n\tfunction sendMessage(){\n\t\tvar msg = new RongIMLib.TextMessage({content:\"hello RongCloud!\",extra:\"附加信息\"});\n\t\tvar conversationtype = RongIMLib.ConversationType.PRIVATE;\n\t\tvar targetId = \"tester\";\n\t\t_instance.sendMessage(conversationtype, targetId, msg, {\n\t\t        onSuccess: function (message) {\n\t\t        \tconsole.log(message);\n\t\t            showInfo(JSON.stringify(message, null, '\\t'));\n\t\t        },\n\t\t        onError: function (errorCode,message) {\n\t\t            showInfo(errorCode);\n\t\t        }\n\t    });\n\t}\n}\n\n</script>\n</body>\n</html>"
  },
  {
    "path": "res/rongcloud.css",
    "content": "body{\n    font-family:arial;\n}\n.get-source {\n\ttext-decoration:none;\n\tbackground:#000;\n\tcolor:#fff;\n\tpadding:10px 30px;\n\tborder-radius:5px;\n\tposition:fixed;\n\tright:5px;\n\ttop:5px;\n\tz-index: 10;\n}\npre.code{\n\tpadding:5px;\n\tborder:1px solid #ccc;\n\tbackground:#f5f5f5;\n\tborder-radius:3px;\n\tfont-family:arial;\n\tline-height:2;\n}"
  },
  {
    "path": "res/voice-amr-base64.json",
    "content": "var voice = \"IyFBTVIKLNEafAAeef/hgmeAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALFHfqMpd0dXpGs4sUolGv+h+72yCLHUqRh/gqcyCprYMSQFNwufSOaDSLE+GiJdorixU6gMG21xXWRO2Zrl+LGhydh/hkK7nz/l/bxCZt4C4MPr+LDohOh/oAw8NkdeC6B+DjoMWqzQ6LGkH5pYgFyPTRBO3Tb6NdhvdqtFoLFokRh/Di/PPbrZBeQ3/OINiSjHkLGmG1B/hGTZdP7Di1SmlGTuCSpuGLB1YeLQJ9yYwH0fZ5VyQq3LicUEqLCyIClsrRnSoCO0QqAnLVN3xGR4kLEYRAh/mBtShlY36+xZYyGAWX900LGFcDB/oBtaJZTrzEUSldzwied1gLDtBKB/wB+sAhO/vbAXxxOUdBp3aLGOVkh/4lyF9aJJjiMcQXUdJJGtYLGA3jpc4GJnMZDHotJbeo26dxqTILGKQCh/Mi0SriHav1B6Ki5GFCdXeLGmZDB/xAetYzMtlkQV3udQQPSFsLC6L0h/pjeGkGjQ4ZnpAt4fyVXSMLGlBOh/kFb/i4OOhRAWnUp1q1XyILFEdiBfpNyQeY1BZJy/immjSW1Q+LFAOXh9QdLZOyceLcHwsfkJ4pzSgLFFBzB+h5KHWANMzqvnp2xtClOquLGGNDB7BCd2zvSK33WbFGE0KLA3gLFNBiB/j3/+LcqItNWKfhzIpwwnqLCwPCh/gPjwhGeFmqbQKo4412OUgLFAkjh+wBq0dLfNsx3j+aS7F5snoLDqhiB/pM1tNkinByMstPEQle2NaLCNYRh7AhlF+r9H6yjfK5jp885TwLEwkQB8ki3sekPmtYNny0zou9jG2LGQ3DB9I/BEvxJcemP94zHKSyyKWLCwOKB/jBiXw/GCM91VXDirx3n8wLFkVRh9gbYNN79SJ7xsbOEZ9siVeLDgRiB/wiWsSKuVJOivLdEkPPmSyLFCIzB9gA9HPORH5Nrg5uEiWg7LWLCahQB7DGGUwL3r/+6C1SznhKdyaLGkUZaQJuMNOMJy2D4vj09wPKtheLFIk9J8434a0GQf3hiY2jEQvH4Z+LENzUtMgspxA2vZ7Sd4xuo7If1M2LFvaxFusP42aKgYNL6d0bXpXmqSsLDSjsluguUmqfNOKziYarF9wVaqMLFByKLRAYf/RQweUkhSU9ZbkKqMiLC8QClugN4sI0B+UydD8tHZsoVDULGgQRSzQh0FE0Pbj0y/VriYbJsNgLDhy1B/wboSv30qIJd8LkGAiGYA0LGAkqB/NL8Se416WbHGR7RhluWPALGBbOQ7hR+QJB8S8rnPkPNKtMmLALFMqDQ7gl4YCnUN7I/Jfyz1YPw7CLDlmiB/wElYV0jp0VvqYJWaVsiukLFEqqB/wT8FZ63SwBUtA+0ZhmzpiLFIRqB/hmvuLsh7SPp52tT64UJpcLFIhiB9hEk4pi1L+yklQ3wEtD1WsLFqLiB9BA85bmmL9KxrjVn7ZInCcLC2WqB/piVHdM10pLVGlyRN3jV0uLGuVAB/gOD4IxhLo50O+jk0j6XsILCK2qB90d2H8k1KU3PlRYKQ5iTccLEgORB+wp+Y1KKNerOhhi0sfvRPILC0qiB/B5+5f6oIMDviitFhKiD78LGm1qD3JDUHNE8L190i4pR7kM8H+LGhH6B/hg1NukhtiVLIjJMW6bfzsLFawCh/g1RF2UB8OGymGzsWoyMUELGkQ5h/gC5xy8Ty+TywsU94g5w9cLEdFQB/hQKq6PiN3znDVrLNuToLELISjwFshBkH4FVF5+ynnoCILJ4cILC6fiB/gpiT+qulkplKlvCil3phULC73rpdJhypHwIF2kQDih21dLOdULAkyzB/g5nw/aWm8by0eWrtO9HlyLBnmTw7/xnpOB3SPGs5YuijBsWqYLBn8nB/PJn4cBmvKyoMs9a+JTpESLBiiiJeeBn4XkiN3KRuVG0caKg9CLBVDiB7+BntX2zm6ZDiQ27Z4Zh9eLBqiiB7/Jn4Ri+P+pDWGLmUqyWpcLBv86w5/RtYLCUyOiR3ZrZanhGOiLB066pc+x4Hmc5stelwDU0GeShD0LBqi6h/eB4YKCMHd5yygm3lZMU5CLBqiOB/+B4SqL4q0QWqvrbImIeAeLBttnQ42hyy2roqYlG1/Is+KJYEiLBs6Rw7aZny1uGpZ0UUX0YbmaqiyLCm8Lw74L666+ZR/nfIMOCVK/UbCLFPvNtMIf//jP3YE1CmVDJ/DJbxOLGBWhw5RgyS+9sVbJ1rU68JIRugeLDtQ4Jc0oZMF3USWhNLQ4ymTotQeLGXILlu6QYYDgCvQXRasUTjvTScqLExLOB7YAZ4W945zkyGhc6T7Ob0kLGipNJdIIeYbhvvHFyl6sNfuEy7kLGjjN8I/A0MT5hF4CgNd2rYdAKQeLFL2NJd/xjYTN8V2cEzXKGZgXBR6LFDjpB/vBmynL1tpxGhFL6iK1ANaLE2KN6RfJn4ElkSlMtaG5k4a3I9sLEzyEy2eBn4c14QkanFhbUSuvPZOLERWN4b1ptStPnbLexfRudzBv8PmLGmsLvE/R4YUMBTRmcPwzI9S77ogLFGdItMltttAAxYSjhtA8yTFRNawLE2YLrReR5yyMJqQjFQ9WEgy3/ESLEWsIlscJ54OGnv7HA5Qs1nCQk9mLERWLyzeB7SkOVpLrhQE8tgK1+w6LExWIrVHl4yhktxlDBrhSkB4kW+6LE3INlujD9YA9zBZ6yGz1zDVAI62LEnIIyxQwwa5yqYNswqjga+lJ2OkLElkpB7kRL4U5izX69Y094G94IaELIIBIh/hdmW04y9PuNAVMUcUDuWKLE6BNw7tthy1J9++F9YsM1Eg+YAYLJaRItMhEIyydJqoDS+zSyHpMdqaLJCtLnmA7iwpuHl7EkQQMyTly+rGLEIULrVBOP5dKMXixMJAuXcRKLv+LE4hhvEBDKb5Hk/0bsTUxusPKz86LESUh+ARxjPUTqZ1E4sunl7QUMsMLEdTrWiAgYkNClxGNNJO0YpPNaVMLEWVONMotmF7Z2PYS4wbVSODZknGLIT3nFugLo9m9gf8G6eJeiOxLsS0LESfHJdhfzpe6ebVywAyfAyGblqGLF0GRSzAfHGtXDHOrdgBh4QwmUa2LE6jTD3AF33NuIPugpSHuS26+ei0LHcNYUqhDoZbEOCjT6MQrCplKMKqLEmV6yzACfyoSmD5nqejXR+7/MmsLBpjpQ/w5jYYPp3ckC5JSbua5RGiLFBWpLUa5n4Rhm9SfoAVbD50seGgLCYVpQ7/BtYbD0ZBh/Ni2ZEL8LUMLCYVpB/+B4Smrwvuyre6fH2pEQF8LCYV4FueB4SorR3nGOaw5UsLQabYLCRW6yxWh4YM0WGKlWLYcd3dIbPSLCPIqFqwx5YymqZ3ZAmb9NZuw9hwLBKQiFuQXnYCOoyx8Olz4GRaPw0WLESRqWiPFmyDY8SYeE8BVMXpcGpeLCCfiFqtJnMY0oixPTqA1UDSaQfYLMWVSW2bRsxpJ4xol95Zps8T+WaQLG8NQcIhDrt3OdTK+bWtZV20yPKoLF2WC0qgPVi6uZrFL6U3qrSETstQLGkNR6RBXckNFyZC9LwiJowjDKnALJMNPHmBHtaZ1EywTUOBo49TYY/eLEYhQJdgYwtEeWidaP8FZc14m0MaLJENzQ7gGq6MiR2lsMEeJ6y6MK+ALE8riQ7gr9TqIlfd1xZQ9Ts3bxqGLEkXdJdgCrVGbMN+59wFhcqPrSfoLF/tQFugjMABScH3SSeJwckHXx3gLE/60w7gCrDr+IkH82lwdxD7K8iELG4Mjw7hKzZMR0FGp5Y73SFDh7fGLEwhDh/hodvc12teGn4dViKCA0ukLFsGiB/gCNYbIlbxlCKCdlGZNhYkLGLqwFuhBmWxLHDWNk9IZqNbVK52LE6A6h/g1mpdgEkLrdaZPZaWJibULEcXnB/hki40nvZshQpDLk96MmfILFMNTh/wa9ecl3YFAs7WzUxXeJMyLEeGTh/h6V6Wvxekq6SvdDK/NcZ6LC4knUqogwZhF1xoJ0L2+lkJogvELCKjOpdgXZvwTEe3A6x3s8ljZFtCLGoY/JdhrLLT97NHGSho6iJTzregLFoAtJdoUKtWBqEi3DjzJMO5cChQLFaw/Fugkx+wjo7O4paI9z2rUhK8LEyjjh/iPTmqW5lk80qdzdfTzP5oLBjnwB/iNc43su7HIJzzvxkY4W1CLBo3dlq5Zh4Q79EJT3RLPFqadQKmLBw3Qw5PRmYHkGHKbyX9tTBocFqaLDFQnB/UZn4djriLNg9Aro1MZ9GWLCg3iB9hZync0vb5Mi4pfrxFj+c+LC9mOh/gn//7sbcI2yNYzkLM1dx+LBGZiB/dBlMC0lS/zAYUPPO0Xq3sLEfsdB+hjmNYEJFztmBrDmvo744aLE4hiB+gT5N5a9+7SkgHkwwLbYN8LFEdRw7Q5glj5n2JVQUi6c5SadOkLG4qAtIGnZ42L7GSRhbKZt9IOH+ELExv0pdAmcHCec37QqnSzTjYsYUALGQkjh/gl4P2QXtk7oTwP0nbenlgLCC2dh7BVbsOkNm3kDx4z6nfwUICLFJy0pZjG8phSIKSeijYlNlm4SMKLEdB4DzIrzqQv1KZzsPveJk/q1uULGBHfh74VntqIWkJP4jdGSiLR1PcLEsdnB64pks3rlwfQ8p4+b0Z/YMILCwRzB7olxS0cCvY/jw1prdKjTLQLFtBnB+i6+vGxzwRDOAZ1xeUzDoiLEQPDB6BMvH/xQ+cJZjZi8PbrXiQLFNBnB/gb9ZRn7ajAqGOROUYj5/QLCIRzB9g9k4cGI+KpHK/K6AJT5zyLE9BnB7jDmwSz6RIkPTcdwJfBdRyLEcrsh+pCfNHjSNoxi0jg89xx49CLFCLiB7goa9Qip7ZwS4jbhGo3ASOLFMddh+jDvINtuBSlBGlLrsbwR5ELC1BiB7AR3U+srvCpRcBtAFHjyXELEdYQB7HkgyzNy8UmKh6hVvrwSYOLFVm6h9ojgMd2Tl77+dPLYTNI4V4LEWZQB6hY1Saz/ja4WkRR7PAN5QkLFVBQB9hWVSK/sisRYjTcKN0f1oALEoOzB5gOuv9iY/ZdrhA9QxdYS28LFbgRh+JNzZuTqSHQE/HruxJzVDKLCaLzB+sBiQeKQAhC5JwTl5wtt4iLFEdRh/AvwPK/mdBCvXivWQetoEuLCNBdh9qPzJd/lkEiPB3uA4RPpYMLBwInB7Bpn5yJsvdriKU1oWeaId8LCSQiB/1Jy6dW/kA0wa1tOkZHsFELCP2nHiCZyHZ5wQdLCGuPBgOPBT0LBxKnB7/hm4L3vBAXw1ecgj5GNLULCho6j3e54YImb0QcT9DSmyincnsLCpP6w56R7YHWIPvcU4KOGV9lyKKLFRP22mTh+4CYfjr8lI/adw3ED8ULDQphtMlT/vS5v7q6OgZcMNg3b0WLFRPDtMrD9ybtstOKt9ah1eZSY5QLDt8zPEBR7IRhaGlCUicXZRnhr0OLGAVDpdkj1mcZ7OioAOHtczzPArmLDmd6w7olhnk8G9/tQ+ZqVkFY4BuLCiViB/gpmNIcxPe1k1FmhZZ7Gv4LCOKzB5x5maeODf8kkgm0GU2Eqa4LDFYDh/ktmZDjlVWB5PbmPE2fis2LDRX6h/V5jZHSEskXUK1jJslcqt4LDDu6h9Txmy/EgrJe9OBrEyWJErULDYpOFueBmYDlrXhax8Z3QTOWLd8LDV85h9+hnNMzJkyWzAl1jcYaDmsLFV8iBfvhnte03gbSSTvsZhyQJk+LDsPdj1eBtYJlwrRTIUIiLyy9utMLDTcdw6kBwvHV+2lIhxAu9CodpP0LEdYnB/nTHnKb68CmFJ2tHcWM7/ELDGZiB+h5ytSOrKHbULjVJKy49NaLDC3iB/hpntZ2lZATjP/Ok3VNw+ALGnfOD1RDvtLJwio4hHzhqqOLdimLGmdOQ7/ty4FzlHDjYk6McUn3HMYLGNQRj3cZn4CgWthm75A05DcUzjGLGNQOB7vhtS3Nz/Zy0K07WL9J38OLGOdhh5+Rn4fj/GbTIFehyjMeagYLGFQOB/rRyy2rrv5WlwGSSLskj5SLGFriB/rBtYfC0V++BX3UWLF7nXsLFBLOB7h5tYcD1C98WvHljqMlosqLC946w53xtYLEUIHvdW9SYxlNzOwLDCh6j2Q5tYfSe1F7o4woqm7itYyLC71DFqlJ4P7DFGhe8aWK7Mcg9R2LDI36j3GxZNliBFWShP3C/kYejt4LDQ32loix+H7+K1KhpTtHHobMLqiLDD1iB/wx+zBs5B61IfXlql0jIgMLCpLnQ7jSvIFHwJpuRvkpPf+2XZSLDmZ5pcsINyndUBFus+IvCzKDsYMLDq2dj1ByQQ4D9byBjwO1Gz6P5yWLEStdh9kJentAPPvglQLpuFWlsasLDihHSxAW28pk4dhiOZaw06oPh+6LDokRB/wfu4i86raFS8pcvA/LDHeLCyhsh/hE3NI1tC9YP62bCbGSDkCLFA3Rh9CP/TufrTeuYL2T5jSeMh+LCePnB+gt+YMj91cgN0TN/BWNtWOLCS2iB/YWASzsj4m+DkdTdgUVQXsLCYf/JdokgGFb145UNUpxyS3HLWsLBn+dluuVkY39nCksLcQT3+epyZqLCgIiD3WptYTUrHd1HSXN0eJfB5OLBmaHD1B544ZGuH3n0qssYKFJ5jMLClYiQ6rR5yyurFu5kCi9L8YFS8yLCkdzQ70J55LAKCmsx0vTom5IUmCLCoOlnmF55NRG6MqZTGc2zQalrDCLCLunFqixnTYP7sjaXA3DcDpT0IaLEVcnFqzxkNKxro9jgIBKe305atOLCw3Qh/S5g4DEALG52smMZKaZWtsLCKI5w6zRgnd/D6UJH9yvSOJDDKILE8dqQ5wBpHdCshjpxnHQX9gqcaILFmZFB/gNV64+HOmbMhkuQT1OeOMLESIiB/hNxZSOo2NtiFO0NlG5IiuLEsdqB8gSpifY7q8RyTBlmdlkYJMLEahCh/pEdnpsQrggJUtx2QVfzY0LGiodh/xjEsa0eazxzJhWc3/aPJYLFmZDB/iriS7PY8N79h1RUibC3lKLHGZOluhZLZz+eqJEVBpuH1nNg4CLE62DFskll26/FZtGxuVh1sm7QJ6LGmZ6h/gPrYWCXOBfGgZK2F11P6eLGFBiQ7ghgynA4Hqsx2tj4TH6CJiLFq2iB/hQbG6+wagR7Xo58mTMeJsLFqhdpdh2wZQKGgXKF81R0wWJZJILFkddluh72FgV8SWjoa8U4Uxc8QyLGihiFsgCynpqjra7IsQl4E1JYD2LFoOnB/gEiCpDmpHt3oJYiAs5oUCLEdBRh/gkKYn19txby/g2rgsPRJgLFCh6h/jDokigBjMLCwykGesIoO+LC1BdFshZl5KHdC5ETCCmYxPO1q2LGlk6h/gvgNHmfDhNaloe8D06PCqLEUdRh/lkwmTljSwxrB7OLPHAg44LFWGxJdIDNYVUBlu5Cb6uUJqf0+mLEYkLYZkP2YWOYnLJCoTFPpwlFUoLEywhLVBiyHc+ylgj8lrOvwxYlgMLEcm/NMoFZyRYFFyzUhgRq3XXozWLEYlhaRCiRnMqNIg+7jxVUvxhSImLE9FhNMoKRIyqPxDsiLLHn5ywJJELC8QtLVAsISxFtoRBNfQ+pWUKUa6LEuW/Q7goYehJrPGQGW/SW3OSWHMLBYPRw6kP7FCztbdHJIb7VoQd/meLBoP6pdyxjDii5NdNwnCYJJ4QwnYLCRLRh/yxmnvt6UCsH1WnllqwOquLC8dRh/h5n4MVsvWnZRYuUSdoKpkLCwinB/pBnP25oZhkh77aV9YDas4LFAmRlspDxtp1ud7ECWuuGczYLteLCEd6h/kNiNAE+qfyL2k30XPJR0+LESvHj3FxiE5Rl86OVbN7Z0aHdwsLCwRih/hJjx+y87QVR/0rkFgR6IsLGQQGB/gLFmR4gu1eXMB3QTqkoVkLFKhDB/hEg/YrPbffHJShV9rB9duLCYOQB+hV3UWDvGeL8sAT0/jN8lGLFMrzB/gB/4Tocnsmj6s6X0eUXIyLEUd2h/hi9kzTX5uFzqBUiilU5JcLFGZDQ7gI28NLNmKEOxRS9lrDemiLFEdnJdghf4RrnERRwZiTdwomnxYLEaoQB/kUg5XVhGoI5CXnn92xcCgLGA3iB7gC66826u6GEJNNahmIqKALFKLnB/oY1Pg9gcmmC1AuicQ0p16LFCuRluoFYTAhmWQ9MUxV4VZY4w0LFSIQh7gP7Y1kBab0vCXI+rLcmjALEdBdh/BGDNK0HHG+BcHmEYXFmfeLC7uiB/hGbC484mleilteEdCO6GYLDVBzJZzD8GQQbNgk0HQ9rx0go8ELC9BQB/kAkjpvsfXOUZddux2xukOLFUddh/iWcH1FwuISgy7lFwL0GaOLC6JQB/oBAUAPg8f/TpElZWjKcX+LFpP6h/4gabYaOLPf+vEpPhIjzBYLErcHh/gHtQCDlP5xII2Z1eKHPbkLCzj4JdPxLszdfeaJcNEsqaoBi9OLEuKQYZ/Rm4ED1KAEkc/E1gXjzc8LEfkqB/6Rn4WkxVmKy1kfbzoJdisLEby4B+lpytW3LKs0CU4ZOP8lxSYLEzjRh/U54NKVw8dMClKpaY0GkeWLEzyDJd5Z4YVmmIjV92VNKIy25CMLErynQ6jR4Dir+Kqw59hsaMV93Z2LEef6w5w54If+FNMuBAUZmUeY18ILETyiB9mLyy/Gr2Z2W/tzE41desGLEnbqQ7gEKSuKn3AMQkqyl9/TE4KLEjc6h/oLhSrYaFE3ylSvEHQYQNKLE4fBFvqbr6Zph+F6PdvRUcaA0yoLCcddpZknhNch3gjywmdnPfkmEKuLEaIKB/qK6vL1/If33HJXSlr7xoyLF+PqB/gDo0UarfCZ2ANll32PZZoLC0drw7gRpApkEvDZwIOwqZKag36LGWZdB/gD7t05LPJpOo8kzsSl/SALDuZqJZpuRybsvYAkcFKe/Yb/pTCLFVrdh7BbESetyjGWUghUCaKmSy+LFBLHluRv6NAbnY6cbxLH1Ymy5OyLDquDQ5kkhijpGE8J5zY+0umMb1wLFtYQB/Aph5W529K3xjkuAQONaSeLDjgHh/NmEt/ZxE+t6nQxUdKShbiLFFBiB/gEEwZmnHrUnjRs8DZJ8sILC0dnB/pUjNBr9oWO0x7Yzi7QkFgLEcdQB+h3vJXnr0wTEpFKyiY6Ex0LFFBiB/oUuu0uldgRNXb/P3cGCOeLEcdnB/CjMnuXk9yClqGvD0ELBqGLFA3iB/gG3xAqif7THhlcP3p6th4LElBTh/gtgHlB0UhZpsW0lKAWR9oLFAR6h/giapCO7uszt9kxkRhx2lgLEqQOh7FV9zaqM13mWtKs9KToL5+LFmWDB/wC0SG3Et56CEiVUIMaoUmLFAO4B/gyGsxh/AvEDCQU5PWeuOELEwk1Jdsn6u7+vImtS6FXi4rlW7aLF16UFuglGzeMQkM1zHQzH8DNtCWLGynvHmAJSGZIoyIyes33I2RVKwCLEyhRluhJ2nY3ofgSC8gz8EfpyFmLGj1zUqiHllg0O0I3R9oEs4V9oq0LEqVqLUCGin0a0HcAek484RCGhRyLDDydw75ti49EdQR2eTDtWIqO3t6LFRWrUqxp45JuNMD3C4wwMsZHHgsLDRPdlu4J5tB4S56TW7th7AkN4eSLDmTzB9hD5DfMJXoVnAUmmAWO0wALCJPiB/BZzCKMq6Uuw0SjnDcsAToLERLzB+wLqT/oU/VU9Yw/Jo65DV6LEeLnB9lDr5LdsY6pIeDqCEX9KoyLE2ZiB7jLyy4sojUe3GRzCLLm5zmLDuP+h/kDk3h4g1xnDNSQ0VMmdBOLFOVqB+hAbnX00zzrk7yLyUwYf4GLEqInB85leE/DhdGK0Wi+EaqJM/QLFKh/h9ILzSfMx9PhUzsvLIcxEu+LDjudh+llwFMCCBSEdkBXbbs75dGLFdBOh/kB8t0CF2BtKxWzU8O3MTiLFMdiB/kvgml+vfxCLXEqu8bawVmLGgkQQ7hBK4CDtytfwmcp5b3tKyKLFFc5h/h7nyqpN4WNDyxyFFSCoKGLFChRh/hhQlqNoZGdNOduGMkYK2SLEaIdB/CEHHKvdrPVT1CQZpoTmnELC+ZdJcom1cwUQzvq6tlTy5LIcD2LGF46lqClKnzOZ8ar+gE9aj8y9C4LGGV/HmR6ksx7kAH88y2mZIH3QgMLFYQjtI1IHnweBHGlnpAUdWVh8v8LFIkjj3WYGyZOysM+HqhLUUrCU92LGCjOw7goHHunF2O9p+kvD+gS3J8LFgltUqgO3MODq/A6lRlL06IXHyULFgAYYZgIDBnQ1vmLwDjFC8WQhOWLFy0M8IghHjAr14XetNUnGPKI6c8LE3Bv0qgBOn792bg+3/9Yt3TG+waLFtmj0qhBBzNgJaUZH923IO0vc64LFihRJdhW4pTS7wslkISbSo8KYMCLDWUnQ7otOtMdshNWxxJpFq61u9ELB1rQD3CK8ZVbs32AfoCaS6O99lqLC7c4B/HppTr5VpA5vT0+dilfymKLCLg4Q6nh4YDnII9IpUk3sjfJ/GILCOZ6h/lZ4WruSKIC9D3nmS7FU46LCEdjh+4JOt4vqRXb+j7JuQRcmgyLFShdh/IDIzXtq+zcpD7lMZ7bZpILFqLnB/gUX7IhoWcDVqEyWW644DYLDmNRh/gNqSy9x/jKBQpnxPb1PbQLFOZiB7gIfZdujOQ8teGacBpV5CyLFOVnB+hVMT2V+Gj6gXdUcz1hGx8LF626lshhD24SCK6GP3RLitQJup4LF2VrB/gxOwL10EkmesE7SvFnJ3GLC/vnFusNxTgNqcf7Rv/hFdaUkuSLFqRQlugFxnD4KX45eB5kvv8FqleLHD3jh/sIwTipo00S5d7dqBEXwyULF62Rw7hv05Gjn8JhL4D2SyIRFC4LE6l6h/goxc8IIt4UeSEY3UTU6RALFGVnJdgZhCy50eEGSgZi1TOZExkLFqtqQ7gVqtCip2gdjlO+VCCAYqeLC8rQ4YhhgzmMITkugX7DT9nlpe6LFNBiJdALrNDkqXEyQD/00XVCtJILDaBQw74tnVxgTEiV4FVeHHsq8HiLE0dzDzIWoNRWENkEQzijrsmH3miLDOZKB/xLGYBD4HSBvFG15PBnamsLC9BdB/gLEJQyfuymHNvGXzp3gYMLFWTzB/wRk4MwZKxQ6KWt56uCbwOLDcdRh/ikGPhZjOWeqDGkTteu5f+LFRLRh/gjAtFx+1y+Qcn2NHwldA0LFSLqJcRBh4Gw7TA7fShjFseoOdaLFEriQ7IktMKyzfqprnbw3vCk93CLEw3nB9lFyodXvCo2GQZ9WwTmkEcLEqtRh/gwaQQjkFmVCfImss3l75KLFrBQJZonQzUjsN3iqmKaN3DtG2ULFACjh/iXwS+8SKpZvZeDpNNHwWwLGhvdNMgBfY3ftGQ4yZ/zuivrGkwLHHt9WiAhKGt/itgWkR14nXx24AULHUQmnmQ1TqTPEb9zLlA6sBaKSncLKEGMrVBJ451x6HUtovFkqySB8paLE/tO8Ipn6vinKxRJ9zMKqNaN6WQLE/vX6RAobN389phAY8UpjFSm0WMLE3InFugDp0YVkU6zSwRfT4HYOJ6LCKVRluqLyDJ+smeqzhjDFam72k+LDA3iS1bxtZF49gLlxwrhM8CR+/2LBoIiFulp7YJGwGtOQcNksXW+JpeLBpLvtIcJ+YSHmYmYN3/jylwdNc8LBbunSzQ5+SsvxwABBThpblSsmt6LBhLRpZSp+NTXiDhZhW0Kv/YYdTeLCRLnJd7Z8tQXuoLM6rftOSjeCyWLCkTnJcvB54DlrSMlfJrgn9b1xGgLCJLnJcvB54AD2RGDlafWJxJaQlQLERLOFsjZtNZZobHFA28fjMP7R5ALBJLnB9htL5pHqJN+yhKTLMKVxbELBCLzB7QhKvemaphWL0Iu8NM8Gx+LCGTnB/m3epUv+Vi6lDUxtpPF8GGLCA3nFsAQftqX2ni0T9JnYZ/BzgiLCA3nB/jJk2gVp2eenKdpKZ33kpQLET14B+pZKyvZKmCjDNGYnyFUenKLBI3nB9FxgQ/P2sOKDJNVaoQ5sIoLEKLqB/gphYxi+FKVPHHUVHTa6sILEahRh/oBPuYX/dmGXGmTNFAfAaULFKLdh7gVat9+ISwTyVOSxiVuUisLGmQ/B/ih5wcylNILyH0WpgSNH8ELFscvJdg35Hzrpu3eE54XGwmWrGKLEYY/LVBRxPVevjgFPf7iiMVPwqALJEUMlugxayargsHvK45I2OoVNe6LGhk/B/hAfa+JBb9ZDlp7G8Tqhu4LGjwYaRAAJi0u0/xKDjnjUmb5NmmLFMHd2iAweGp9eMxTsnpXUk8LwEgLHWz5tMAknYz1fUsDPe8mQpaC+AeLEiV6w7oA1nqYMhVYDm29N8UnDwcLGOZdpZkmZ4UxmBxkSDyK4kcTJY0LBdQ4YZtpiGlbb1WBYyTlj8JiNW2LFBW6w5PBtYPWcKfRB1p1LXZ/ooyLEbyDB/p54YNm6ndV1RphXvobVgKLEWsDHkNx54QGgE1OdzL10JekipsLFOsDB68J54UEn7Xv55NaF4/LekMLFLyDB+455ysI4B2TRYEeHlSiJbiLEaoAJcAj3uenjf6WTQJzowYC5S+LEZW4B9EfnNc1FXc2C8YkGGaeDMuLEaoiJdJxwMrcxTh7IdMSvHdA4/ILEHH6pdZ1hvjmZI20rra+r4sIVSILEWZ6h/tFh5MIEwo3i9grIM+dR2qLEAXQh7gzrYZmLszps6sdRednzDaLEioiB9Cg3Nv6qU8cKWdMnV1iTHOLEVBqB/gBLfTm1OobbXW1P4KJW2wLFtBiB9pBmuM66pjDkImZ0ETGeDGLE1BDB/gz/t4OmbmA0luWUWcO6JILFtB6h/wjgjqqDcN9lUVVbFqCS08LEUdQh/oFJyh+BJ/iQ1i9PyyND8sLEq2DB9AqcW+CqRTEv0rirjr1yq8LFNBnB/wPnaYF9nTUK1rqjvtJmckLFFczB9pd1CcQfgsu0FpjHqUYZKILFOViB9gQtNr0jnRlzZ6hmHQmriyLElmzB/lhgrwCV5jEYMPazNlsc+mLGiL6h/oWNsa8uWhuF04c5xLEebyLFoknJdgnTt0T9/wDk7dtISwLtHOLFqjvpdggxawxn7qDD6vYd2cRcp8LGgk0j3BBk5VsDbwAqG5czCT/SDqLE0q/B/gdyd2k4uJTHluTJClpHUmLCyhOh/gC+up6XOl2MYRxpq4/JMALEdBRh/ArzNidwR1GSsY/LXIVhegLCEdnB/B//5eN0VgTggdKtHxoyVwLEShDB+hbnMqPqaeZ62OqcZ9rAN4LG2ZRh/ga9GAx+WQRoQ+cpoX9qHOLFC2Dh/oVxaYauelDDmrR3559oDyLGkQVB/gsyNcBaWX+frtmJrHUPY0LDSujh+gl1Fsoe1tWBa009rzcG9uLCJoiHgDcf8wC1jIL3izx2gUuNJWLC/sqD2OpypQYmY8b+gCqo4JBW4+LERLdlqYZtYTAco9Rp2eL4xv2EDGLC1PdpY1J4oUWX6S9LfXzGYL/MMMLEioqFuohzSxohU4aqu1baa+QMtALDvIzJdoLuNhkZdA4KUWzOjriRcgLES2OpZod3SwQK05gClBltYyg0fELCCIiQ7EP0zI2wHntXUxdYFyZoU8LEkriJdpBL4Qg4pmRm3jx1Cbz1JeLFqLdJdgrANDqaWQyYs7WiIFnLoSLFFBDB/EAfYGtRm6hwK6kXvHPI0qLEkdwB/yqWtnbSiZbq2sxc/YjCYOLFXtqB9wvvG/yiKUg9LSznxIbDF2LFKhnB/oDczZbyqG/3bUr3neZZ6eLFsdqB70h8AdQqYohzbwXgBSJDbmLFS2dpZCH2TR91iaBvsr5x1kIjnILESLqB/oPZ4JWtt6pcVFYu0qX37OLEezDlorFYt4P5R6gQ5bTbxOVqksLFqjZLVBjIshxYT0L4mktLmOzfdkLEzKwSzBjMDnVIboKi1Q0mWelLnSLFM0tB/oQfMO348ygjrbqWW4oHFwLF+pnQ7wBDyuCujsuoLavMzZQ4ryLFupM4Zgv4zH7kpRtaEUTYGwtmVOLJFFsw7xAZ8uizLI8ivPGnkIVSzQLCxyRpdhxrGxLqEEv4eM71bkDbJcLFOWjh7kzDt7Utsueo8xHkdr1T96LEwk1FuKHtGrUl2mKO7/Jkr5ELZELF2WLB/wSf6dsrca98cI+Lg2paWALGgZ/Q7oN4TukGxTlr/2IIZjEPueLGkXLFugqpjTWZRjmZ6YG25xV7lGLFOWLB/ArXNek7kCc8k3L7rdK+ZILGntLUqgy/uoUJ8gKZAt1izvHjq+LEtBtB/gFatFTgn4/EfxFa8gMzW+LBxLiB9ijosMU5/phox7e6Hm03JwLC7yzQ6sBtRG0ZZ8PYLdxUkmENCcLFHH6lq1hbT5QWowWQzLsacbFl7+LCCIDB7kVPMi/F75a4oWTaaRNZggLC+ZiB7i2eHz8loTVm+QLnIXwaKQLCzcRh+h7jYEJ0kcuQkXStFRffFcLEiQqB9QpmS+4+9F7tgI7wIYfVooLCJW6h+jpmzUGcftrgAOCmidYZWkLEcdzB7wrr4JMEp8sIs+LmVLyFHkLCDcnB/hxL5w/yA2tTqxsbVdyxB0LEWZDB/h5gkBpSfM0eeWyEQMLM5YLCC26h/iRj9ACyuKfOdcRTINZg6ULElBQB7w5jO4h58XGksgvW+cDWZELGGVRj0A13dJfge8pdDqszMl1gq8LC6IDB9Bv6sPDTp0DA6x3YYhwtAILFsQjw6hjiYFqh4v0wVYgra2olWyLFNm5h/JhfOfF0Q65Ry1R2LQkRZ6LC0QMh/kF4Qdfzvqmh9pyO+CWRIKLEawYJZgOt3f2k8B2OxFY8MItx0WLDqwOh/jM/TXJfLat2BKQZgVdamuLE8Qmh/okgz2LFlsF+rqwwD8e6oaLFolYJdgArDz6V3zlVcgb5eRkPe4LE28JpdhDsDmcfLylRGiXNioSIG0LEcdqB/hK/YAOybICsleZnIk5N7oLDqInB/QDitShrkmxqyOF9cmWdj8LBBWiB98hKsKeyAucJWkN3ID7G/YLBPbnB9Dw1YNHzBS6Ofyx5bOoXxQLCGZzB9uBgH5+AOedJlOQ4alNxyaLCDcnB82A1Yf31rQ4lKHjyuQUKLALCEOiB9oZK5lclXferkyYzf44a4yLCBLDB+h5gYHnQsP8SvVlkFl90+OLEUdDB8kDqNNRFu2jaU5SySybWECLCyIRh9pVzHZdrVsrVu5NtgJ0U0uLEaQzB8wI1bP8ET4lPAHmYZkD6RSLFC2dh7hS1XQLiC9qJSnLpo6oI10LGmZnB9oFKtpl0Nchcc7iTaD4spkLFqLzB9oorCr4cM0SCBwz4Sc4xHELCdBRh8g2i8lj6u7E1HOJuVWOZZeLFMrDB+iM6N09GOF4Ry+q4kTLi34LDlBnB+gRujXrzinNRuVYNdwdIkkLFEdiB/BE6oiO4KkUltRxmVLWRGmLEcdRh/hXd3392fgMthHwqLwcpgkLDmZiB7iEztQC5naUwJC1Eeq5DrALDUdqB/gDCSTglvhj1JZyope6T5yLFiJ6h/hTjEhcmylDpmM+SMk0ZLiLDoOdw5BjNCO5pvJcyy7NHFRtqS6LFCuiB9okJK8OxdqlcspyIzibE5SLC1cnB/gkf7A96kqSIz+okF31GPULEZH6h/ATUYi+B20s5067n2PZPI8LFUQdw7oVkHi8IQxdIFsfLGEtqx4LFoW6h/hxqZKKRqOaCt6Ti5eIGccLFAlzB/gBJ50zKKn+cdxl16KrpJILFoAAw7hHuroXjjyIvDTpwZvv4x+LFFh6h/pQfYyIeYyERMM9lE6wLfKLEQZiFoAuzgbGuNI0w5djRn3YYM6LGgZOD2QDKFppw7svpPtkgG52daaLEmVQUqlx9jrZnIh9+TVUy8qtljWLBMrzB/x5mz4QWiPmJOCwnldc9bgLCAZgh/gh48bV7NkNBWRymW+jFeELES2iJdhp45gW6NGW5bXMTTpJutALGgZiB/gPGNBE/pf0j5S9Gq25AsELFBLRh/gGRNIVzGiyKrbhxj5w3u8LEwhnB9odpzstqeroSOoVapgH7yMLFqI6h9gnnMZwyxiUbCXTUOl4qu8LFChqB+jIbjyq1dJsvtNPCZoBde2LC1B0h/kLq4x+UyDllywYvqNMKdsLFJWdh7pFymsdhGR6Bi90a6556x8LE9mzB7AFwH2WGX8GrdNaRonOhZaLFGVRh/hftniJra0SobvU6fFumQwLF6J6h/ghI4o4Z3hh6UnKLZlMZyoLE1BrJZwBm11NyGg5FBKecthU3sKLFtBnB70Hzlbp6qE6PhWNx6oiLUsLE0rPB/hVkThNxyqUQYlGxZ5wJSCLE6UnFuhprXpb0SJDwWSss+qPHhWLFC2jh/hhm6S2NhnT5XVqN4aX502LEcrnB+gryYEd+vWTrF6Ub6igRuCLC4Rjh/k1wpFcX04eBf3R9tnMr3ELEghjh/pBkQaicAC1fnpWZrJ1h8SLFpyrB/g3H6LBos27QfWTy4AmacoLEcrrB/inIyJPnARKXL1qGVdDNaeLGmGDw6ghjYusX3TOYJ8rR0B4lPyLF5HFJcAmCsGSCln5EO4KrtNz53eLEYltB/IbgT/V39/LWknOUbeMfj+LFuWDJZYLgGyZvcfYB5GmUPzhdD2LFKLDh/hDoy3U1ziWnsI31azgDfoLC9BOh/gHxTotGfgpCcI7VZOWdOILFoOTw55Eeyp90LvFIHA0YxpoIq0LFOGtB/oTqpF1lMrV1ozDjdMHxDSLFwkVB/hJLEM1Vx77VP8R8dRIzPKLFIk1B/in++vi5jXBp2X2qb6gW8MLE4kfB/BxtlPiuolSwD+dsjfbWIoLFkmVJdoMfd2dGdRP96wDME3XcLQLGsQfB/gBqa6ExfkyvSfjaVdICNSLEiwLQ7h5iTLYtFHDM35J2UXcUPQLFkQtJZgP4S39zuZr/NM0l5bK73wLEwkMh/gbj8cfy2nKyE8jZDq3nNgLEWWfJdgRK4jHgOiqBJfyOyz0ajwLFkrnB/hFnflXo5ZpLe7Ivv94PNCLFIQgh7kTDbV/MqNcjj+n0LSQwbeLC8rQB/gAQPRfxKRR7wZKXlYgceiLFUdzB9wIRV5EBW81MFY952RxWnYLE0SRh9ghgPZtrOL1ZGlnIapDpkELFlBqB+AQhoGShQ7uy6BRiHlgt24LFEdzB8o1wu8IBPPP16E8CBu+PjwLGtBqB9iBxHr0+eh1nyPA1ix+xhgLC8dnB6A0a6fTtFEIkcAvY59ltEeLFNBDB+oOnT11AruH9iam0pe5L6mLFEdzB+hjWTHaJ9lnoVrGpVH3w2yLFGZnB7AphGy3yldV3FyGdaZ0pQILDUdOh/CD85D8TX9GSmglTNOAZ+ILFuZnB+ixssmxlcnHaGI6jCssa3qLEShqB/JI9nlm8jKaLlY4SjUMMRgLF2GHB/jhaPZElZjH1bgCmwMc8HkLFIl7rVABPmxM5XBgfHhGseatHuALE5Yspdh3aNmntcxiaZF6chpF3UuLE+pKFuglxiIawXwbBbfnpflulKCLHWpJJdpRgnzGse4nF9eckWYFq3OLEkGnJdIE4n+L54hN0NBBdgw1IcYLEVBBJZARxdVmsm2EuKSeYxN2E2ILFwRzB/BBq6qmYTQJbe2cw4cKhaSLDoZwB/ghvng5HVzrK7GhyIEU2a6LFqQRh9BQevLBsyOK+Im56mYdrpeLDqhRh/tGj4BHrSIYHPffQ/GFFwQLEaIQB7FXkCTP3aXOTHDg1g4IOn0LEaLzB/jBKygebjqGd6HizAWfch+LFtBQFsoTIML77OJNVToW5mAcaawLFKLjh6xt7MOeitcIkgdynGKY7VCLEKVnB7hXf1bX22wMK5wq7uIL3D0LFuPOh/BRhHrgSzPJlVGZ82K7408LExyQB/gX5tQlzWtsMfRxzeQWTq2LFoXOh+g2tY4AdA2VJTeUKO74BqmLEQRzB/IcpNGICyVvhk0uw80rP9ALJFBnB7BhOHSz+B7Cs0ZqpK9h2A0LCdcOh9ZQ0a+sXSLI8e2lZ5kZKZSLEmVnB/BA1NLz0JikZNs/eV5SUECLFKIQB8gBNG8FoffgdtVjodENFQSLEq2wB/iPWHiDOZRz++ZJ9pHCbOALE1cDB7AMln1lbrbiCPaLgdYajgqLFEdiB/gcgDh4gaNBJLR2wixa+FGLEasDB7gTyYZnZMrybpa44lxsXG2LFJHOh7oFwaUmNX2XdB4ykUVHx5yLFGPiDyBiRYQQvw0y6SrsNIPGpSsLFqhiB8gRrmNA4j93vhE4qa74ccsLFGZ6h+g1eN06MGqNATCIoOtN3tkLEYRqB+kNe3N66UixSaktyMnXPzsLFMrdpchYxbHEXCACvTZdEkJW86OLFsGjh/plf1VqZ4X8hDPV/onrj7YLEZgdluhtyVjMECYQmD6f0fOZ4BoLESkjh/gI0orWLffIqPGyvsQRhpMLFyhRh/iAf439inAluZpucS8mucOLBsQDB/gcxyu/pHTpinEfJiVZtACLFNpxLUAW9RElzPStILMczxGoC+ILFaLBh/hNAybNs6hEtXD2lEXU+jOLFAZ/h/BEJSbC+dvuUcUi1lLpkcsLF8HfB/gffWeK4WFk5Ys/YXDaZE4LEtmypdsFbJnLWgDvEaeki0PVHjaLG1MLJdgKmDzJUlMHdelh3eREHhkLFMrmh/AjI4KNdv+25QBePULbfRALGhyHw6gVwNHp7v5TvXLjYZD41xwLEdBRlqEAnmbvkmw+wtwliGFgx6GLGtBDB/oGnJDxZFpKSgG8l83Xh0OLFKIRh9xK74MfpjLEbBL02LCNsPYLESVDB/h/JS1BW8IJpWi8lU7KPs+LE0dQB9kLrc+t/WBpT0eQ0/zgTyULEa2zB+it1NOMS1JqxLeeNXNoytYLE0dzB/gTEiA8eG40g4e8HT2JpFWLEahiB+xCe5/mvzhiC15VKOgEb1CLGKIiB+ATiGmyu+2jgKEK7OZbrCoLEyhQB/VidFhv/47eDZaW8bR5LjeLE1c6h/BVj9j2QwZtoilNehG+ZPkLFMrQB6Dt3X9l3leEwOOXEiyN6QwLCcdiB/JkkS7KsdI8XJPNLTZdDksLEih6h/gkOtgCCJoEHSZN4/6JdoaLC9cnB7AIfMaFsJ5ClUPuaxT1sf0LFcdqB9glhxUqhxN8PiMPN2mWuGcLFOVnB9gTitL1iPpzUwCnm5cyTd2LGqhzB5hxNxYwUY8DSFJlMDbboGoLCdBdh6wHu20jvT2zuHzz1OxOtgYLFMrRh+glOdNt+kkyw5aewllaXFQLFNBiB9Rn3cWM5dpDBvRTDr4tFkkLDA3QB+g80ssfw8xEnvPMxKcVdY6LEyJdh9nTIoNV0ao5MZs6yjf+iKmLEsdqB7ENhW7a8eRFc8QeCXN1i9ILJPHzB9BTln/oZPuNGtlhZ8fNs3uLEmZqB/sWTNJKxGkxHe1h0F2ZKu0LEaWAB/heV4g16TbFk0I0Wx7sSOELFOZhh+hhIRclzsly9B7nEZfUtQoLE2VqJZBpjdympbMV63t2h81bVgULFPt6h9gtwS0MBXajpaoRSCTooryLFsGeQ70LqIkNjjJEdfLlrtbK7X4LGgYnQ7mBJCh9++NpnSXXTmSvlZeLE+MOw7gnIytjTtmRqNobVn0mnrwLFpFnQ7hTnOgzyi8NgIVubkO5iriLF9FfQ7xLDyVJy+tSSilbwypLawKLGiknQ7hhnrM13Om8wz5hM4SP+EULFykRUqwAf8LuwqC+I3FmZY817oGLE6jnD3IDMt0T4TtDyAOjE0o3Y3oLGj0nB/gKctVR5utU0IZm2TKlLm6LE3tdw7hC88ofxBgFEpI2FJf+YmeLFKInB/CLtWr/hv3ul87BvL33Ch4LEcqdh/iBqSwt3YJuFDXmMkTjWo2LFaInB/DztHqDjByt9oxUZMVAVUCLEWWdh+AV0wvvwS3cS6jpkrodMi6LCdBRh9BVa46VoC/7nvtg86C0n6GLFCLnJcBhkMD/ihmTWohFV9WMOOQLFSIdh/AtwnzhgvYAwaDx9DssgrQLC8dDB/FLBmnvJ2bm6UcuFEG3UK2LFCQRh7guA5xtrQLWGc6j2JfqixQLDo3qB/JFftAKxrmBIcqrLgi0c3ELFCQiB/s+jnRautkslBrikKtxIpULFFBRh/IshaDhiwZ5ekKk2dKKlZiLC8dQB7BD6cKznMuRDhC/FvYGbaELElBzB9hLrkqKS/M1xmpaSnl5iP8LFKIDB5BTrk4nW/iBP539AxK0oYALFARiB/xhLtxIozw2hLvRL07TrWoLEiQ1B9hC1RtDsLO6pgcr89cjwXKLE/IqB7hNyPpi87YOjcsjlaa5ch4LFFBiQ4gJwZMAmf1Aq3rvmFJcw3gLFKLDB/ApJzi1CZLy9MFzcOK83G4LEiozJZwFz5waFdy5OrMzeid1kPULFMrDB6gqVvb2oZ/mMUW1j8AH1H6LEmVqJcIpjEmKl6V1hbYbMtHNL84LFqhDB/hnozBDVt22afiaFPwSnZALElcDB9IEhCPBKq924Y8s0vYo758LFEdzB+gYvGFKW+a1oBZkwJ6T2riLFGVdh/IromTfypDEUpOZVw93ojMLGkdRh6gtznc57VSOg+k6XuMT1qKLDokdh+xxhOk57ZTLFan1D0P2SCwLC1YnB/JhkECd3pnEsarw+CDpO6YLEdBdh7w0wyItisVMk87hoOQUZcuLEQOQB4g9maePoA90/XC3EwCdBhiLC1BRh8g5y48dhEvl0gkBrezTmY+LF0SRh9AC6uLnqlab7OPlWQwX8jKLCyhzB95/jzceO4J5c/v1zM0XvnaLGokwB8gD8Ms1VX8AzsSbxHqzgJaLDWZqB+EFOH36vKndTTHxGHMRkxSLF6LiB+hxKwnamoZtmvZSYgH1BweLFahQB/gC9YAT0/hk3a+azL1pK4ULFCLOB5Qv1/fh9XYn3ah5KxcWS/gLFShnB/UVp9A9iw+vAccKMZcLeiaLEyIRh+go271FtJU4OvFk0U2dMF+LFErnB8JBT7/3qB+btHlTSLZE3eMLDuZiB+hkNN8uo5lAxju6iYLSxwyLEShQB9hG/wc/oaB+JZYxbvbnNXWLGiQqB+BnO5GO/BGFMlsfHGl/sxoLD5ynB+App5uj0lG0e3xc0ktOYPCLEqUiB9gH7Dtii2hnc8BG7Sd5bP2LEQ3DB+hg1OFfGJr5FtjdOxSo1AOLFSQOB9lV+mZn56INh1CkBceSY6ULFuZdh/olPsBYZwT/Q5Wi1L1Lgt+LFwk6h/jrU8Au7DQKuz87Hr0NH1sLEyLDQ7ZtyOGVBYJ27lVTpnE7dEwLGuWRpdAX3TzB9XmqF566n2x3wkkLGmZiB/pP3zF8jIkaq8NQWXWegMaLGSLnB/g0gYRPsEtJehi604jdThoLGiLnJZo1x7R51MUrWhw9GH57tK4LFK2zB/Ap4yq0TdV8j8ic1FR4T4QLEtj0h/lJhnZKGCiazBgm0WkITKsLC8rzB/kiNbysFIlampJYaLl0oxcLE+WdD3GpjvRab1DdriebSTtOB54LDokdh/gm4kJP9RDm8QLoXJ9NnQ6LEkdzB/ByWS+KcekGvWVGlRp1cx+LGgk6h7gH3n6SzJx9ryXlel0312iLEtcRh+lxlHmRnidYipU6nloSS18LGJyiB/geWMU6hKBhhp7cHFr93GuLFFBiD2Bge0R2lD4hvBtKruKBbQKLGsdQB/gPnNA5tD9lWgVGKD5mmjSLEeZqB/hzyyiEuKQdhYJOTlGKPDyLFSLdh8hKX6P1wBM1yKDXoyALkP8LFEdnB7whpsYLiTAtF1Ep4k0V0c6LFCVqB6qVKYVssk69jDBUcG5KRLmLCYRRh/Qqdy2r3cDzhNLOM5PpgwuLDtcnB/D1ayhZkQY+DS06bTEWUC2LFuZiQ6KC/yvQmYqV1gd+d9ZiHsKLFNc6w5iF99BEfTD+LrVQ09CLeNULC6IQB+kN1CWhprBN8zlG6GLui6eLE4Odh/AC9SirgH6cJ1rjKnAbosOLC1BiJck3mkwmuWnmBflW4RDt37QLFiWiB+gnPRnsk95F/ogzF5rR7YiLCmTiB8o4en88+KOlX0OtS5aROTeLEaIQB/AxgQDt02rJy2jR69HyVPOLDlBiB7IkfN6alE2yduBLXGJKs+iLFNBzB9EZyoukTmKhwa7bXFdPi5wLFKLnB/jRxtgVxSiIX0jr0leTydgLDsrQB/gC3Wpp3lwjSn6mCCes21OLFCLnB8pmxTOJ9P8E5VQnom4AW/qLFEdDFsAiwZ7ROPnqcdqWGhT25bILEYRdh6iH5z+nv3VKx7i1KhNPXsWLFKLzB7iA0NZUZVTnso7A8OUh9yALFHvRh/MF/ymHhZnqg/N2XQUoAX8LFKLzB+gx9tLkHEdrO0cSyhLBwjSLFK2DB/laxOJlZYBphSHnY3TEEFCLEaLzB/oi1YYwXvROeUHVcsiadLSLFK2iB/AF14uE6NqjTsFcZkEpKLgLCYkrB/AytZLlocyJra67HeqLGIiLEQRdw5g1bPFTrPZZBoNJmmUp0Q+LEiLnDyKsKbcLrajLy3MmUgd2XYcLEeWdh9gCTaynz7ZM5P8qWcR4fBsLEkdnB9Ao+tOx/27TH20lMOkp13CLDwR5h+gQ1JMpS+1lVpDBUJhXWgCLEUdqB8kQZ4dA3egW1HMVZXHXtqMLDqQdB9phktaLNNhfCKsptq8CMISLCwRqB/kBLShWqfpb331hlhYKvpGLESInB/By/FDHlE+pRCC2LmzIYfyLDSLiB+h16QGy0As5Ppe/SXxAKR4LEVcnB9xYadbf0wro5VrzCzN2QLSLDYkRh9gA30alvX0PaUFNtu004UyLEsdiB/qFyZRi9VEoUz3nTIOL4JiLFOV0h/gWHHRIW2te1zs84lHRq8KLEWZqB+hZmxsCnu2lglXUM9jXgYMLFMdiB/0jKNAEkZOp8hCim7tKmqCLFuVdh/AOQNDaPnShKWF5eEVwhx4LC/InB+kl+Gy93gvzpBE50kLhKFULDaLqB7R5btQm8eaVPYGDPKdsEQmLDWZiB/ilezysq9yQreXvK4csEQOLF+ZRh5gHsx4DhyF86gC5bF8zMZ+LDWNqB/jDcSVMr7Q7Sd/aSDGptOoLEwZRh7ALipbdhXPZvhW/xHrP4uGLFBHqSwNAenM0t69w5MkrSrML1pMLEeW5h8gq3bXHfFvdo4pWv4ONpsQLDtBiB+gUtJaOr+Aac7lXSevFL54LC0d5h/gEKPUlanlBrTixLle4WxWLFPvDB6gTbzSffT/U8eGdVx0eB4cLGi2OB+oAzNFBsN3E+ljFH2wT/GILEz36h+gGRC8+N/OtGJJq1BZg/SsLEdBqB9gNaldY0bbbSg+hRxJddS0LCy2Dh/CgeYbvkfHbDwAnJOjVmgiLEuVdw7gic5JT4Ul+UA05rE7XA7QLCw3nJdAgenj95VGL0D0useZtFvOLEa2OFuBQbcDl8Mwpi9s3LrWSCaOLCz1iB/oG4Sj2h9S+EJcs7YaEUdKLFShiB6ho2wPckRdf+zUeLqQ5GR4LEiQiB7Moe4PuykqxDSKmT6IfSacLFyuiB/IAmA7Mz9ksHHWqTSQSaq8LE2P2h/gi2YRsRxva2UYS4bscmKKLFC2QB9gtbtvDil4aJgufK4RlJ1sLE6IiB/0FnThq2L+ODQJ2U60ONRYLEcdwB/h8xNJNRhXBaA/sGtaBm6ALFNBnB/glOqtvzVQqGbEcqCMzbXULFGTnB/RoeYz7lN7DKa2MX0geIhGLE2VOw65S92kvSwtA3OjK5la2cnELGiLRh/AFyQbRmHCbFucJrJY4sl4LFFBnB/RC9pfrgSo5JY2zzchSSJALEcdiB/ohO6985LLpBiyinpIGVSmLFVBrh9AV13Pac4N9q28rSdbNuUqLFI3iB+gW+Mss+vSOycaMkLN5CiYLEVB2h/Byf4D3BEqkT12T09IxaSMLFRLDB/ly/6r1aEh7Wwp1rmumK7cLFlBdh9gGgSI0T7khZWTsnEgObPMLFFBjh8gaf56ieTPAi2m6aIMQZwELEQ3OB+kjltF/gen7cD1NCz7zbsELFom0h/iMhPBobaP6KS1vDUe3xZgLEU7Rh/gZxitVv9j3u6UpbYa7AVwLFHtnB/gC3MRf0Xn7qoXrJK8DrbKLFqLeh/oTUTzJrQnfOwJmFITU4GOLEyvnB/gVJZTH+GJp0HBx0NlrXCALEVBdB/sTz8T/Rms4lYnS8664iG0LEoRdpcyAP4ESfpA/2RZOORZTnI6LGlBRw6iGysEj1NsxBAGMuEqeJTGLE1BQB/UUlA2vw0tw+KeOsm6Kf48LGqhiB9hDPw2Mu4j7PVFntC5EoFoLEdBnB/xn9WiP3A27nHHbFCSnw7OLFIkOh/g7IeAEWsYwHhSkxp7b2s0LE1BQFslT8D5P2WgpL3Lr0WU6Fb6LFGURh/xFb60LqPzdrzdic4LbnM0LFAkHh/gqw8Ef+8+c7LTCO0d1toILEaWqB/oqQykGitbovhPdWQVKFYuLGC2Oh/gWENYIOTupw8B2XCoQDSCLCeTDFuqkLsBTN0SMMrrLM008b2YLFD3dj2ACTWtuWvV/mbkPNjGa1KELCFciB9wody72rVW9Rx/U4ZyHzEMLCShDB/xYb2KpM6LxWpJ2oEdvjWQLE0ddh/hK25VefaAcDUj2JXaUrBWLESRqB/gkhS4g17h+i6ClFm6qCnuLDojRpdBgfsH9m5Qb14Wmo9ZaJR0LEsrDB+l4ey2rZk3lA+ubLLgSSZCLEYlJD3Iof+cEq1oVZUHMj8Mo6s0LEwQ6D3C1xCdMqEoO2ldnHn0UmYQLEQlRh/gL6GlvkG+UeZcvLtvBk8aLFTKdSzYZkMM3MA0M9pd4nLqC21WLE2Mvlugwfba9DcomtJAbp4PsxQaLFPaJHkAoAX78qnRZtLPbrpu2loGLHQlRh/gjos6BoJXJqGzVjbFwOQmLHDKRlunDlVapsFX5bEXLTMnx9e+LFIs6pdgKtNnU4p7TCsZjPSCyWosLGolCw7gQHnt8Seo5pvW3KXb2NAALE6wjw7oCN3v0gHDdy1FpLJ9ylZSLFqnnB/h75HfZpiLxn2xbKLXrEoCLKHB5w7ghLlmRGV+uAVR0V0VTpUKLFIlnSzBY1oofnwUjnb8qONw7pFsLGrMHJdhTs9FHqj2BwL2s++8QU9WLFJbnFugNdS49+f7phgTNQz3VyMILGgl5pdhFt2XfezgCEJZZnlAy5s6LFKnnFuhFEf4lvTs0IhJya6LBT3gLGt/HSzBJLYoI5yk4Aj27GEfRWRELFIiiJdhD9SmKjLw9DPkdQJJ3nnULFMSnB/gGnts/5v4IgUDdhMNCVveLFCLqB/goetlagV+pmBa4vdhNKrkLFKhRh/ghPRhfjLtlGk9rDbzVvb4LEwZzB+hFplU0fDrZDjSsbzWnt3wLEVyzQ5Qwe4NqLWqLxus7l6hprDILGEdRh/gRuQZX6ShOxJli77zoRZeLIuK4B/iMPympaurZ+99dhnuEi4wLEWf5h7kYaCoLR7Ndk9pNlUeHp0uLETynQ71oe5CjkDNoGONztdsTmJ4LElQh4Z5TgNMxmihMllKxz+cHZQ0LEXkhrVfBgy9v/v0PWGhBmtcXLegLCJPhluOZmy7P4mXGvoqzNkb1i8KLCdQpQ78Zn4Szmoj86pgctlFoVA0LEd+erV95tYNNWU9xcPu8yzVtteMLIVTs+AD7yy5JqtWZtLXzBJprdgkLCVmR+AHh4H2V4xAcNVXSR7ZlRk4LCuZR2jGhynD/wu5M+nmfn1mXBNILB3F60qIZn4OmXd78X0ROd1sqawGLCgIiaVSxnyk+8JHiDjKy5CScUn+LDA3zFu45n4Zlex6v7yAOpzu0b5KLDBP6h/6R4NfiHLcWe5tlYeCUusCLClQ6h/tJ4NM2xeE5ngXUzNtw6bCLDXk6h/454NP0eRx/YSsuxKlSHmyLFHf6j1Ph5tIS5E6MJevouOYh2PsLGGfHJdhp7NDWxD39ZO+1AWrYWK+LGtSdh/od6S8cO0k5gtwa03Ta5LSLGhSDpctJ/NCDtHlH6dYy87OWAs4LFOT6h/8L5FN0VEfEAyg2McoJMWgLE0H6pdg2eHycxIjGqhEYyyw2Uk8LFIkEluho2IBTXJLwZyCM9/2DNe8LGlBEh/jFsFP52bwOAERVaSlqObALFQQ6h/iAyyrM/CbZ4blXSeE81qGLGFczFsyFtYaACOpqlKvfGPoN90CLEkdqB7wL4ScCoamybDq8wN/NEWELE6QzD3DZK9oKJ/8bNrKeBoLlrlOLGoRqQ7lBPnkQhqL/yl87KctQfBGLEaLiJdtO52zMpLIcRmlyrboVnaOLFIRzB/wgfyviZd7EJautCDcp5QQLFqLzD1DCdPdoeTcklqPWwXPezXsLGgRQJdhi9wArj4g5q+HNs2iTageLE3tiYYpMZaXG7fFN9D9ynoejW4KLGokRpdAPPSydyXFLkXpdG9an0ECLE1BnB/kA0YZF0Z91ETfKM2ai7CWLElBwD2EFxU8JSxnyKHOa2OeTNKKLHef6j3DJqSkwDZwq0vdcGfQJe6ILFudI2iW43IZylGrpl5mMLXHBc3kLDpqpNM/hmNAV5cujCwtk6zDkQq+LDoVI8Y7Lu6Ps6zQ9SyhBZkoz88GLCtPpLdNJmYc3/RTKmznWaSR7JXkLDA362hZJsyZaGpYDWunlqqxNoxiLEV/YSzhR4rlQIW4NivO/pbxVaruLKAstWiAGp2szuy7ZHPAvjI0EG/OLGnaH8IgRk6Tk76jqylDly8+Y5XgLJDMP+EILg4mHqNEe+qIMnpecj9CLHWQX+AACjIvJbCZ7adF1MJZiCBiLJlzP8KgNCzDN8QRpBbS9tKm14bELERT1aTBARl18IgUj9eBv0CtUJNSLA06QaTchj4NDz7yvdJ8yGTNF2jKLB06PUouBtYNN+cD6viN2S6nq7kWLBs66h/eR44FEUK7P4QUo3a6ICQkLB0664ZeB54Pmh7yMCmA96KONoUILBob6h+tp54fmcBlPWHNh61IfswmLCRJOQ5+B7SxNxy9edQ/RY+bByfkLCeNJpc6R+YGCwNufB8E+Cy2q7TYLEChqQ7hR+Wrsgvzvfi/OIxLErx8LCCLnB/o56T716gFEW1KZM7L4xQWLGkrQluhh+MKwaNw8Q5Z1Nr2mFX4LEaLRh/kEhYKXgKpPh4EZP3iQQjCLGkrsh/gVz5SFGKtXjx8VY/GwcweLFaLnNIgEiyxD9Xhd4eEwts0Rc6uLGkdRh/gVetLLvmiwCeFvTjoaJD+LGFB0h+gxkT3WJ2nID4M881ioSIOLGkdDB/BQe4PlYwy2TgrOJc7pCUeLGtBvh/hh650d/4lVq1RLpdfsc+SLIokRh/h616th1WMIiWkTfBPcaLeLFEdnJdglxHBZhjTZ9xhvVlvYntELGlBQB9jCUdcD2+E5cksRnGFX9SYLFtBnJdABasD1iuW4pgp78VPZVh6LC0QwNIIxgkzVZthmv154tgFPOy0LGy2dls0RbNrx+Sv3mhwzJKNLsDALFAOnB7hbel7PkOVZeeXzYIlIZweLEffqD1DRPsMEhRd1EC9PoNFdbBcLFPkI0q1Jiy7sr0v+xwgdaMUJ7h4LFNQhj3fZ44dF25AqnpG/UnGVua+LDstIluWh5tG011yJbpvbmPwJMCoLC+dpJZ9J54Rl7B2WXfCGg/oLOa2LCnfDBvgp7y9dPP1kU4th9AVV0XMLEShRh/FGAQGBrD6CuUepTr8tP1QLESIrh/oD2yweP1lFz4yclcOC0q0LFWVQh/4J0HgQHXalCl62EpAcdBWLHTjqQ4xH3sXQqXllcRtRNkVpKWgLGpqZZd7hvYJ4meJwNMESw/QA3jSLHXkZUq/p/4KEq55RBIHI/BJYcTmLF5q6h/+B/y2qVpC/Px7fF2S/msoLGhq6lsUp/4ekUQKeF9BxiyVhsP8LE+f6h/uB+ytac0qJGllrWmc8DrOLEjyqD1Up/tqa5QUz40YxZKiZfxaLEnb5h7Q56XlJO8O9gesjqFEgyaMLEESDQ5qZzhp/K0qAgZnnK8gj7kWLEQX6h/kvjyYMUvm6EPjHihyNA1ILE+ZnB+gjm6uD1FmKCYy/QJndDhSLFFcRh9ggUZTXitOGaXEaHE6VauMLGUrDB6gm8EUnbl8baDpOJ2PVvC+LFEOiB/AUCHmymWvW8GErMCSV1KULEahnJYAAY6XHo135VByJuI8A9QiLEUddh/TA1ZGh4TG3Imkl5yc+aGiLEmVnB+kC5YEDj4tyk9Kywp1DfyKLGAR6h/Bf4zGOcCCqWeAR7DMILMKLEgXvh7kZOMB5tHe2Ezx0n71M4xgLFOZdh7gFgH5VsVwmW/LTKYWhdQYLEcdRh+jDjNHNoP7MkzlhSIIqVSULDgkiB/ADii3K30g8Ojn08GnD3bcLEkdnB/hmHnxXrRqGRbhhVkgj5DyLFCh6h7En4Q7AeyjlTn49DbxEFLGLF4k5h7Ikxp6rER3sy892we7sfuOLFSZjlskiLMJGjcrE2hXwKHcNCGeLFS22h6lvxy1wfkqHBw8dVCIQb06LE4O5h+hGxPQ5MT0yNlP2xGGMy8gLDVBBB+w78d0C8GAxqjfcNs5QdMGLEYRjh/4S9HJ+ts4KDYKw3+Cgm6OLCbjOB/km+tKbgUHs4oMW29buY+yLCyp4Q7t5nsBzRH3uSU58URQUhSuLFlQAS2D54YM1jIM6GIGTMuR1nmKLC4VAB/3h4Yd1m3YrS+qTUWUWSrULC5PqFocJ5y6Mv9xe6rk8uzlDkQILCl4iQ79B5nhcrZvkiBC56OA4XBeLCdcjh+hp+ntahtfl7jXTEcLJlYMLEj/tB9mR1texhvzhBd4xsV6bsJkLHsUjYZhhPmP4IByRg3Syxp5MlAELETNDlulQL9lww0M+QNJQrCYWLAKLDFrhniiRm3JtssYd7Y1R9w2qQsILFGxAD3GBdnML+Gy4FRE3YU4UgXELDuKDlutT9MR/py07WwoUYk4pzuSLCvfO4YoBdNmuLcvbG9YeM4IUW38LDhL0h7/h4YYidEiuXCs9rDwVtaELCxW60qlJ4yba6/GCzZOvU7kJaESLCyIRlugx4YzduG4JiV8/IZVawnWLDuPsh/gx5+mtoVrDJlmPCXbnCEcLFKonB/tJ5Tkh+7elKtQS4PM9zruLC+V5pdhEsSAGY/QLRmRbpnFTzSiLDkdnB/x75zixnYwbMBX0AhE5ls6LCsOnJdpJ35gFkrXMozS0qXlk3KcLFCIRh/gBBnKd+XtIDsFsWnw6opKLGSVRh/gDthF1luifMcbg03sYdzyLGDcJJd1LdMAgrOLBf4lRnkkxpyeLFPbiB/omSS1W3lyA66HjcXVuFIGLHaI5h/gN+SiBAGe9RdRs5xqnvQ6LFiVdh9jDHyXr3vJmD2HDxW+nxZ8LFaI5h/gAeHhfKPkJksWp5yJWHzWLFSIdh/AJbSqKCmbxA+1YxYXNO0sLFKI6w7gDzohcDPD9+iBmjs25RkcLFGZnB/xI8tx/hrfUyXXljk7HjtGLE2NqB9gnIzKMiluFsZCSh+2nIxOLGCVzB4gPrM/WJL8naCpT0JC0lxcLFKhqB7qOrG882YRPMeo9RFPJPGWLFCQdB9gJDH8XbtRhCaqZzINuVhKLGShjh+hCTuf02XtUSdMKz2Qkc6GLEQOjj3AR0FB4jc88yaRNUzhsUtULGUQxB/oDJzqIY3LXhU5ll1VAQiALEyLjpdlX4ChusM/cSHGkjTxPCGSLDC2sh/Ag3SKN+H6aOeq15JjA7ygLES2iB/lI3SvsvyGgC0HT0f3sqHyLCgVwUrs5iZo87QvxMoVQ2zRTWyGLCZL6w7nh4ytaYkpD9mBmv5h+Q3QLClrOQ73h54IF+TBWNfBXIV1MdGALB3FzB/4Z54ZlMJ1eReBrUAPicY6LC0URrVbB+S4xhFeG43g0TVhHLesLEnwvtMoR7Szx9ktjAcF7kWEp3ooLE2mO+AAFtDBtP3nvWw8qNVPQx0SLJMLO0qgC3nxdcOscGwz0poX/PFCLIQ5e8IoDwky9n3WYZwrHysugpQuLFNFzB/gF8Z+0IX+kwF6nM3nKMpcLFqIDpYgPwHGbh0S1vTzltEHtopALCi2zD1A1tBJMELxohvW3xsqbEsILJCQqB5gn9V7q998EBoy6pgflLQkLC8diB+hxwzkozZ4yR9RLDP1xY1YLC4Z6h94Jl4sEr9EVPENL06BF5xOLFGZQB+gXTnFn30/mCv1jQ1GVTK0LE1BnB9AGjp+v7Fz5L3/X1Z8R6CmLEa2dh7lgb8T33UhEaTVHqDOyVdOLFKQnB/gGq6Cll2g9OhctmrA8ipkLFaLiB5hS3tZ622zU16M7x0lBImWLEy2nB+AwYrXvv6jxwLXtD3JoT3cLJKK7yzboczE6V2dPOAVWU1h4klSLE731YZgANaxD2I8jkkw9P+V6xSOLGgZd4ZoOsFutxnSo8XaFcxtTj3SLFyLdsMgVOoSftW3OgDhRvkYDu1ELE2ViB7h1NbWkt56eCDAevWKIGJ+LFIkBB9gYaIVmjs/rYQU1QJaj8SULE9BiB+gy43+4iDljQdcycfOLvH8LFMqjh/hLonxmzDazphbYybG6jYgLEiIdh+kGzn8bmuombJkozl9kIKYLEWZqB/Bg1Hz+uRqV8cWmJskS5iGLCtrwYbtw3PNe7dirDGLJjsryQCmLFC2iLRPR5n0Y4mYrdvpl68hIBwwLDT16j3eJ54EkUvXzZYvLxoo9Q1iLC87iB/+J5tPw5EElsviOIqlg1eILCoPjj3S554VgNCAZAhbNPFvCXwELCgiOh7eB54NlcA+x1r3OkbKrqLwLBv8jw7h584CiMrxdCxkR1WaMcQaLBzuYD1JZ54akdTNh84lf1/DKSe8LCkdDnkcJ54lWsORPCxJikO6WmnKLCUdrJclr8HmfyMZpgMjVaLGaN+QLBTunB/JhzpWd3gq3pDA6kIVGJgWLCChzB/lN18VSTGSED3qNz9Tu0eeLCAOQLURhkm0XoVt70JI86w+SW1OLCwRdh/pTuuTltwszJbcZKYSE/D8LFKQrB/AN13P2aeQeSH1jUeMgeSSLCwkOh/lz2MqWQI4SkFHojK8lNiOLEaQDB9gPizdvUNJRM/9sjCW5VSGLFMd6h+ijuksyrMmbBAWyG2pKNrqLCdBiB/0i9Gpi2Rm3iDILHcfnCSKLEYRzB9gC/76+LPcKVhvUyLOCikALGVBqB/AUxIFEkMr6bBJ3xYjYUdmLEahDQ5k6eZNPN+gXbahHiWq41hULE2ZiB/gfb5OU7ehTi4BOixJEyluLFihnB6gDjPUzqX6W091uRBPXk5ULFCL0h/A1eS2IGuP7kbxgn5uPbMWLFdBYB/oC1zCKCvYrWgex4HcZcW4LIQRnB+oFP7tdkNd5mhIzGQzy5VOLDSLOpVgdlNDRTWK8T3y3EPZUKpALFwOYQ7ifvsteRQAp2h/a4cn6JwALCeGzJdgcayT63GAhbHmtIVPMU02LFK2nB+gG8NMlsNXMWjXB4++SQZcLEctJ45to8MVW3QWuxPfSxOzN2LWLFAVqWmHjy5J66VG+RikQnnrkekOLGiQd2jN58tLjrv8Lvd6a5rkyn9KLFFQvpfpZ7S3bssuE5E4bEvawRm6LDrcd6Rcp7Sxd54uCHWnOZI2enReLFFQqcIpZ7Sj6wF4JD/NLscOKUpeLDtQ60p4Z7YJ0XJRVQIYbG/u7SxELFLy6j3y5+YdkA2Fd7g+pdkRsTJ4LEbyAJdw75ZFnvUmMWRWpqEZAc0eLDuY6w70p+Ya0VrGDiSaulySgxJCLESIqQ6hx8HP8oSkLY8NamkGhQBQLBGZRw5ppyJMfuRKMwsNZOMcZsP+LEahRh9gRmQYd9cv+8MxDxFudRJULDtBiB9goLods6FCjc+MmTPITjE4LCMrdh9CHGmvX8mYRt72C8SIGI6wLEqL/h+CG4Je63+uDgtlR3lOB1+2LFqIqB6wRKyegny0eQd3Ak9m0e1gLEVBgh9gkfyvzyno5ckIxnoGkv2aLEwO1JYlNwHzNsaVTsB0LN5KIbjULFy2vB/gHUMQUPD9aHxmu0ZhE4bcLE9Bdh/sC9lYr0JnrKgt1k0SRFvuLGiudlskm5Y5NkErTaH/ksMDWtvQLISozB/gtez3MO2CtUDeasl90HNeLHFBzB/hJgTpgOTKOD0u6DVyDESKLE+Vfh/hjhG7ueYl9cCN4KLSSZCeLF2ViD3Af8MkWmOQEJROzGl3UJYMLFtBwB+h7ikvZTjGPhrmqyl8BNXGLJKhdh/gETPxZqLy5plld1l0kXsSLJKtHB+gpoOXdwTNEZK9unAicPgKLEYO5rUIgONxwGZhJYzFNwfIX71aLFKhuh7gHV3V1q/pSvINRnbVTxiwLFIRGB/hS3lh05r8drbs3pHU08gwLDQOdh9hzBsZN96OMaLMuGLpX16SLFSYnFuFJ4zStkSKU+QWUvk3TFDKLDq2nB/jhn4c1vbGbImFbzsIYXu6LFKQDh/gHu4nX2HQP7dAmFlDlCdOLChKwFus5g5cwyVX1Qr8Stzt6fzwLC5PnHkPx44Jll8oeu42unlRoPa2LCpjwSzaR7YBGyXNe5yiNmhC8DIgLCpj4B/0p7SppVwpep8yp8kU2FWWLBzuiB/pZ+4IM0PHQKtrlHA5IHjKLCIkjh94LVS8Awx5citp5O4DFKEgLEmWYQ7Ih+YKqbBl3HjEMjWHV7p0LGGWHpd1D8ab4iOh8WuGONryQuZoLBpjwNMsfymT6qvET/pol25k1v4wLDTznFusB74yN3+tj8DPNyHqXUHMLDlrwYY+Z+YFonSKeROGZpaaVTXcLDQVwYZ0p/nkcsrnLHFAnYRV1lmgLCYVwD2Dx+S56uiK5iIWZdfA6R1ILCJPiFsBp84LAuFbzOHU0dVDTwgkLBCLvh7h55E0d8mT2oEt2LpR01zILEdBzB6gz8S8MZciHhvdyd4CH1wELDAPqB+Cn4Tt2/HiTJqxbRh4egq8LCOZRh9mLaI8P0uI8tLQ3G5cMhooLG1czB/hfOYBMMpL2VBBwnq6FNukLEy2dh/pR7BLH6qiGptebomxW0byLEWVQlshAdyZOEyiZYTPlHpMl5pqLEyhnB/gLqXqXs3TJWqDyk0R4wWgLEkrJh/ogfNlI/U30fbpJmzHjEGsLGqhQB/kh72vByuxEpftK9i3U9AILE9BnB7BUqG65m3/c1kHc756b9i2LFUriB9gRMIdooItKMcLhrfaBzwALE+ZnB9xzozcL+wrmmogz1bHI6X+LFFBdh5pcjtdB1wZURIJZ9wHrbu4LEVBnB9BKdYvzgLa2MgUlZzgUGhOLFNBiB/RCf6r8sbwdprDi4zkRl0oLE0diB8gtbN9e0BH22lNRTPbFA/eLDqQdh/EXjNnrtmtaiUDy0fTgX6cLFBHnB+DDx5GB0p+1DK3uNpyPqPELDoRYJcAxbo3IOA3chWA1UUNMj3MLDuULFskP/xYY63TeTxgzZKmHDLiLF8Gjluh4/HyCdpJFg2NMwobR6v+LFcdjw7gQ/0hsKoTrfASM4HgEaY8LBhowLVG8xME+0r18XFp14U3w4i4LC5PwUo7J4YkI6EK+F/7rEQDpnDELCpjwB9+R5tBwtcuaXA4sKHEx4C8LChP6h7+B+NGQJT1kxtKd6toiUtALBxo4JZ6R+YEllZS5FapuS8altEsLCxWtJc6R+ntx3zDoe5jyv9SN3DILCIRYB/wz9YUqYg60g/HSzg44Ub2LEEStJdw56RGdiRG55njWOhzaQRoLCMrjj2MR2z5yOk+OzCiWESa8rPALCuazQ7qZ7NHIX1MQx+2Or8ae5MKLBxP6pcEp7YWUPWLBHDEe8yfK092LChPnJdaJ843/qR2n9K6eVVY2H/4LCmdzJdlL9NS8WnygAdJljjvwVWSLCi36h/LB/HEgbDPSsphx3+iVRocLEWKnB/shy63p6MwKXCjCOscXb4kLEGZqB/gh5Bps0Gi4FOBuOIZleE8LFBL6h+gp2FkAft2JAe+uG0AqReKLFGZRh+gyzn1zn8xww33SUjg5LeaLEYPdpchNo2gPoJs2eVQdVsz4WE0LEeVzB/JP5pKWF5Co2DvxSLV1lw8LFChdh9hXySc9zCzPu2AUoRcdPPYLFKhQh7wh/SRKSVttFeQh4G4Mz+4LFqsDB/oX32RpW430rSHe1Oba7rsLFKhzB/gh/HC6a/MeP0jkU9zFuLKLCaInB9gC8zYLgvn2m7ccTkX4WzkLEy26h+hBhFnMgPtdDdjUDM7IwR4LGkdzB6gqVteqIUUamfvqoYgh04SLE2Zdh7Azo8WWP8XKS9GSoLuBF8ULDtBdh9jLYopL8iKsTJEnSdgY0T8LCqhiB/QO8YCk+RawnU3dfx1MIpwLGmZnB+hXE6Xt8SKosEvVIoeo6fCLC1c6h8gbZSMcHzt6E3Bp8ZFwFiqLFVBRh9AZlYbRicvqzKXtUgg3ru8LEVBjh/ig1tRW7VnUnnt+CrScGJsLFKLtB/hBpR4FzDiqy9KksewMa40LC2G/YYgEL7vkMRliUpPK4K1mMieLFgk1Q7hI2DsUgxK/I1Ukyqb0YnULEaQ/B/BCUHc/srwM7z8w0yA1CpcLChjwcIsxwtISoGkx/rF6xPt61NMLDoV6w73nFTKcEs/+TtjEaqcRpUqLDhjsJd+l6H35CIK2jbhVYyQNWo+LDhqd2iJZ+HhqQw90VgTeSePCxx0LDhqwJN6R/YOipR3aCym0HhCsx/ILDTk6yxcZ+4BEcaOJFwX1NkDt1UqLDl9Qh7w5+4TAf3trZU4NIlFImnaLDF9Qls8Z/4JmNovZnT2bO+cUcGwLDhKdhrv2AYGEPkUJTABWyzy4SlmLDhK6j2ZeAybKjYVRBxK+MTz5c72LCLuQB+wHT+kfyJXrC0DUKZAQ9eSLC3fqFuHhh5hMuRs/vDIAmEFi8A+LCNYqB9iTzQs6zqYjJaF08CjGBSGLCJLiB4jzmS/ewtsi0/pM36KCLeOLEFcqB/BV3VD20Ss1o9hMzLK5LQILEWZQB7pBMjxv1M+8XMalakQ3DfQLFSQiB5A9Pse4xo5d2+qbQ7h3OnCLFUdzB/gQf5BsU2wLF1QdiCoMJIiLEYZdh/BgetrP7Dz/3sVEkkz82OALFJLzB+gX9xi2dH8YtHlh34Fq2pSLFMSiB8oVxOckssugYbS7VQT8McULDahDB+gs1HF9ZZX15ZHRJ9rNFaELEyQqB7lgf8wkqK+PBvMcD4qFhkmLFGZRh7gRhgzRs9wmiSwyqilWnpaLFKIDB7gEwHwHPnkGCXlxaiNCklYLEyhzB7SFmyI+MPdmNHSDppIO1lmLC9Bdh+gZjGFVr7dzDkWHMg4fROULEaI6h/A73HKeo2miKHqakRto20yLFGZQB/gPm4BBn+o0STXOw+nxxymLE2WiB/oS5ZpesdT2OPQadoNgbPALDq2jh/CH38nShvjoeCm+puo8RhQLFFmiFsyslS6up4IkbPM5cK2ug7ALFAknB7jFxCU1sJ/usLB8W4JDSNQLE2ZnFsiWt4KVkabMatGsMybIQ0wLHWGGB7jxuyuYCZf00mUx6cMFSkYLGkrjh/hR+IMomW5RcxnhvgGXrHeLF1Bdh/gvF5Zt05hRg6mdrmUFxJMLCpP6h/iGGYo0RfSLMC2Smp3QCO+LC9Q4Q/5435GjB5RgDkj0zWRIaVuLC5W6h/vx4NL0NPk7ttfW9hnGHVsLDRP4B98J44PFWn8s4xTRwV6VPKmLChLqB7p55y0o24SWRYcyGIUUy2ILBq36h6pZ5tHyZBP8S7bW2TFdqF2LBZLnB6bR54PluAvWClHk0aJfv24LDB+4Jdv524SvLWK5UE6aK3OGN8QLDT16pbfh54SwcAqAR0XeaHQLV20LDlrzWiWh5tN7bcidLWKmySi2QxiLDjg6jzMF6YaG8W8hQEXaqNig798LCxjqQ5hvSsHS0QYVZUJ1Lqgo4vyLFDp6h/FPn4MqEyWDBhS8YMbkLoYLFCVqQ4InnvOolX7O2bN0yhLjdqyLEeNnQ5g3t2jvmw5FPskjlLIdl/kLEUVdh/Ar6HmvtERz/wAx1b9lPLcLCChdh/YZgT1GcyChUsZe59CirR4LEUddpchxgNkXhjirPNnFQcXomrULFA3iB/AXISHy4+4NeuRUnwwIKKwLC2V4B+lxly3l05gYFjatxLywf22LFMd6B/hocHhes5wSbaThypuXE+uLCy2qB/B4fMEqhADqJKPSNN90ib4LG1cRjXA3pnUZ6mcqcYfB3Jg70mcLCy2dh7mOIzAPnHXhUfhU2GibZCaLEahzB9kHn4r+IG8A2sp0PGAlxOILE1Bdh7wnvrwvpYzW7GEK7Sb8FIALFS26h/JHlnyMYojVLBIf7HHDR74LEyQqB9ynTnpu8fa08P8B0jodpIOLDqLzB+gB2Q5qAzlRlcPKtyFbN3ILGpHzB/ghUQRQNAJxjVkcbdEL2vGLEqQdh+olzM9TxX+LTTaH1rIPh+SLE0rzB/oBh5ykc3ccAFPlNjeJZ+ALFGWdh/klySUJimnlNOCVp2Ymtd6LEihQB/hl6kbRpFmFiWOVs7NDPW0LGokwB7BToSTtao+lFoz95DY5cwiLEaLelskctDb/vLJ8M6+eI3XfbaULFONdh/gs5zhZ4nN810uzQIOiKlCLBNrwLVNxhYU2rsy+TRHiNzzPNY8LCjnwB7vxj5SS2O4jwgiO1pDaFtsLCjnjj3Wxn4EgdAO81thm9FJNANSLBgIiB9B5tY4EndOVB2gc8WkqW7wLBRLQB/+B4ZCN4zIiyySlUje2dIkLCCIRpZjx6Rjbu1j3FjSSZwq3kPaLCF6/FqpZys8aCUExBNHdlKUasagLBMdLJdlh5JCe9l0ASxPdEMPvo1ALBnFtB9/Bj5flw5sTD4yplTBCGBuLBsyjlq854Y6+WoUuV9JjGf1RGGyLBp+nFuFx8MibtTl7U0+pa2WBlloLCky6w69p5ndu9h1lqIJ2YbbIMN6LB1Yjj3QrQlLUPBEEGyyrIBYNudALCmNnB5QfmIvpzDd6uF6gNMA6imMLCz1Jh/9FsN1SOL1N1fmTHwMQaJQLCLuqQ4xph4RI73PHbNQzLNwXG8SLCA3dh+hV19V2K6mKoGKbSpc0bh2LCJLnFuQRmTCHpuoCkH2l1FAJ6rwLBPvzB74FjN0ONr/6NB0tcbc6WggLEVcnB7BJid8hnHy3H6VKGd0E4aKLFJynB+xDiH+/vrQKPY3Nl1S5cDOLFq2dh8gg0M+7hRtHnTstw3hbKn4LCtBnB9j3Szs3xAi+aK7HIx0KYOaLE2ZDB/gxK4A3JsaLLjM68T5i9+oLFKhiB/A2k5jGx++B8dDMlPsmbKkLFqhdh/hAw6ThonVr4QO0UcITmCsLDtBzB7gn3z38Eaw2550w+k4YcJGLGgkRh+hTpSlhr+ulDOCOxNSOce2LE0dnB/gsLPxfrbPVj5Qly8rI5j0LC5HRh9Ix2naJxAtPFZhgs6ccs48LGkd6h9AP8o6yCPeSLvBmPkoaYHkLES2KB7RJgFbzj7a5TJisX3owclOLGgRzB/AkkGqQP5iBBXmTMJ3PJAeLFCIDB+ohgW2JB7t17LAe5e/TCz8LFFBnB+GA1NFzrKHiap7rJThke5qLFIkjluBxKsSeVqBNOd7OFdCVuh8LC0diB/kULoAK8WMbGfb0iyeS6weLBJjDB7iNbnWvZ5VlahpSL6xaXFKLDFQJw6Z9j4YiiL/DhD/FSe/24q0LBRPQB/4J4YQHr9ZX7alVc3LX1xiLBiI6h/5Z4YFimFQmiiFOMhjWI8SLBrcnB+6x5sDbxZt+qRaPMSWkaZwLBVQQB+jx54MH/XR2xU4Z1oFrzsmLBaViB7LR7YTEmGt5AOW0plI2UaULCucnD3+55xhvpgM9D45k7iQGvVqLGEtzJdv58tCmU0m+Yxjw6c2RY4wLGBqnQ78L5YMB1QK00F5LrZPJcuALGHkdlo9J8te+PA+G8HCcXbpjOTeLGHkZJZyh54FH/7lf44KMo0GUEwILEef6h/JD2qvsULqGZcIzqRsyfKcLEXk6w5rR4NYeWEMOihIayM1Sy/4LEmfzD2Q3mHEYTZ73l6sbYQRVdswLC2fzB5OBjS40QJ32KDomOC0cliMLESViB+4ZhtdwlfBVLi5xs21LyAuLEiVnB/lJh4RhmqO8eobllz9macWLDhX6h/ka+4l4q+HgPYrIzDu0OfALGnHQh9iljHZaVlNzjc2L0ywNWeqLD1rdw5orpTk9prBKDAWUMNeNgZOLF4XOpZgfu9R6GWRztjnswiWxYYILFOZQB9g1PyZf3P+/BdQdjmU8HaGLESIiB/gUuDqO9IjZO34vN5qzdkCLEqIdh+gMKJHbt7g6ImFW2V2XPPQLE1BnB/g8LzEd6CRjt8qFT5+dq+ELFsdRh9Zluy/7u4rRcQCZycZJsjwLFaQRh+g+t4GzsqtCvsG3M3Fw2vGLFCQiBvgWBEvY/B3hDeQzu0cVzQCLFQhzB7hFmpYELGz+OheaWptcs82LFFcRh/iglWBbolReibhTG11tFb4LFAZiB+hMLnley/b0Z1quDavw/i0LDkddB+hTKuGhXaIbcKiuk7ERr+ALFRL4B9hi0yzlld9X3ycaNMRjfOOLDqhiB/io6zB0+0Sbxie2TGLtPx4LCyQOh/BB+TIWVLqNKkTGVWVK5IgLFqhjh/gV2NaoDONtbqEjQWzxqgCLFKQjh/gi3tyOGRpvmNoXULeMXowLFr3nB/Ak1lCnoo709j/s509cGQCLBTznQ6APnYPZpivHfD6tE0YjroYLBrn4YZdJjMT/ZhvbkkocTwKUZzOLBmanB+pZn4Vpvl/hbCpFSKJ1Ko+LAo3QB9yx4m4Dw7vUdDd18bDi7tQLBjunB76R5YAzit08gaiq0fsWVuSLBgInSyQ54YBp9wly653VwPIMboULBkyDh/rx44CUzrvwRzLS2OTaZS4LBttPB/6R8m2H07JaizmxsPdUTO4LClrQj3OB5nyORfZHBeAycWZMRTwLCvIPJcuTy5lHuGL56oDc6gbgbgSLCuYjy2JdvykASUsiealAmE3FPhQLClQiFsDxnzbqoRo9WwGXUclTHBeLCK3QJZpplny/6xMHtA+JKjuijOGLC3FiB5pbh4KY5p9wwo2I+GZkgp+LCqozD1JBL69YNHyHDiOqswkkdQwLFPvqB7gd1X9egUk3r2AhgkgwIikLFUdiB/wSdy6sj2jYYOPsHKM3paKLFVTnB/hi+wR32BuOSsm2JKfo4jKLHChiJZB1yI3isJw7lV8u2JNIi+eLFS2nB/gXVpRniu2cznQ1O1OPLpmLFVBdj2DIVUkPwgb8aN8ZHPVA9qeLGoRzB8EcfYusd5M2EkkbGMNVKBcLCahdw7AVKNjL9Psr08LKnlMFAEkLFsdzJcSFd9HQYzsPDagKoI9YS8CLFGVnFuMlP4ShzUHnl6axdh+HKeCLFDgdpRgkbsrTplXo+kO1472OrxkLDsdqJdANaPDkqvVWmiUSuUdYUVGLGvIiQ6hPvHn+obExRbRA5bjc68ELDpLzB/ogbRC2YB8bCaBgmY1jFP0LHVP2lugwe4DAGOwOy5IxuzOKLmwLGiJjlqwq9YyKNrYT+HjAnfNqsYWLHCB/Fug1bYJvzfCIfS+p+YfHPkoLGqQDB/kb5mGJxGWbGWCeQMnCKnsLFNmVB/wFlSXnUj+MdcHU6ll30BsLGOZjpdgwftUmVvyes7cpxiI6aaCLDmKOB/gVCz7P/al2U/Ek2P3oRtcLBpo64YIZht+qTGWglKzDtuUAitELDBPnSzTp4lor5rU7hMJmyXAUBsuLCjnjh/h55N+5/5VlbfWcKYPwSyaLE0UPaRNrnlsArBI9qU2mxHTcbACLGkcO+AQFNZk7FCqO4qEpysknqWaLJcC6vEAGrvY4qmxVKPthckDYVGmLGijjyzAg1SpSbl21Q0IYy7XpxTmLD9B6w5gNcjuoS/5xQiUfulgYW1KLCyhqQ7gGqNDavlFsPX+bWsVwnPaLBdr4Jcp5mnwLDNE+9O8uR5mtBZeLC0dzB/lpnMeYPwHzfDkxOB3GCWILCmZOJZyRmnlLvbMeU6BN5RfNodcLCF4DFuwxn4ALTSOMXpe0TJ0J7LgLCyhiD2BDnyF61N/+Q4Oyap4Gm+kLD6IQB7gNPYYLyPVe0u2E1C7hR/iLEa2qQ7sIb3hek4zkTRjKzd1woFoLFKhdh+pQflM7hYeOZq1pYNLCJc4LFYX6h/oFPTVkZHKZW3ntargZH8KLFpyOh7iFOnZOP3eGTuSg9ly3IeiLDoXRh+jbjCmp0EeIS4lp6DX8m6uLFShnB7x9OsTdzw/mgmMxHGGIlq8LC2ZOJZh1bng/+gqRtjnU+NzxwAgLDY3iB7B4ftMEzg1d461h1uV2bIeLE1BQB/wy8YtvzTiV8HmGbTS90FmLCMddh7gUMoUvvOyqPqjTzl5GkhuLDuZqB/AIfmL6vtX2G4hLV0XWZD8LCwRdh/gkLtITgb1xeYga2IUq9GWLD6Vdh/ldxTgr1SUjTDoO1eoM6XGLFZyRh+gKWodT72vQyUrFrmiXfxULFtcqQ5gC+4ogzsMutSHTU15htcqLDlYiB/JtPz6sn7qztL6YyAYXpJaLEdBRh7FOZcfP5pyvhTCKpl2bvj8LFQRHh+wKdQWdg/YhShzVWpp4WqMLFGZnB/gSdtQXv2SrDKSxGu7wVc0LCyLiB/yweNDUpY3OrTErKbYIYg0LGlB/B/hjq4KD33iIwuPzPNeagcCLGqLBpcgm4En54BnG9qmhKy4/ZIaLFyLTh/iY6YL1z2DrgJlOVMV2Ua6LE3tvpcpAftW9lP9aeZqWdppaqkoLFChHB/hRkNNwqTwKyyWi26rad1aLBpj4HmGtwzoF0wZ+FskOq9PpI6QLDHFwD1aR54cKi0gGbHvAZwGc34MLB1tnB/Sx5yv7ysT+PFBHYyBL7yQLDHmnNI0584Uh5q6JphbXfk0+c+ILB38nD3NJ+NTDzIQFgbFkyB2Ql5KLBv8/Fm6R8tP/p0RGygEXNmZUB5aLBsyHQ8rR+HqcycNlZjf43eu2+0QLCM9iJd6R5yzC6gT7IfPkC0FvrwaLCDnTpZwrmS1rwJkedUfmN21nbxULESQRh/pZnSkhqDJV0Ec8ZZA5URYLEeZQB9hha7fH8zqwPTTvGcgNqQmLHUrDB7hv4HUJA8U/Ct5CIJgYWfWLFF4DB/hP9dxfcBtytXVmS5J4e3eLGC26h/ApjtW6Y3dVupVraPeNtAsLE1Bdh+kCdF8+Lji2g/4yXaBgBeiLDV4iB/oBPNNksHZ/A2oWRxUVxzkLFUrzB+jIe4NOGz+Ls9odm6S9T54LEi2DB/AQ0iq5fb3FhdiLigIne3ULDkrnB/hy347BgozV/o1mT0TC21cLCcdiB7QFI4vgxrvxcdvFidezFveLC62zB/kkaHhAOF0k1sQ/Lw11OXsLCzunB/iGH2Zr5sB/WhnQteEaghoLC9Bdh+0geH272KlNOpRyVkKiYpyLEQ3nB9IwLsKR611apu+2kyLbeMOLCsrgh+oYe2e/1+2zVDwamlshlViLFQOqB9glNmdkmJLCpfNb8abYVecLDihdlszi2H4ltqv2egQ0x4yIupALD6oKFuoIctS1z0lMGwFZt61K3jgLG2zflugKxYKWI142bT4NwJjpB+yLGkm2lugEeP4SZH42Ha3UM5Pl3xqLHU9iD3ANN5cAnfQm5bIsK7/GgJWLGA32lsjl2MywegpqwAz/I4LaWKOLGKLdjzKAZy9vkkX2Ug5SwNaVoiwLGSIrB7oCWNWOe3/7J4NnCNDtXcULGBL2h/ghPNQSI13kOtuKXTMTXh4LBLzRw7sxmYNhsqU4DTD6M62dDTuLCvbiYYvpt4HGxbn7t+ao41u+RgqLC9q4FueB4y5pcsAcDQfsiWMXm7SLDWf6w7fp7StMRhUloCcLOCTb5soLDlq6yyXh+YMCGTssKxKKvTEf5eWLDmfpFqcJ8t+zoh2umJQXYWWbNFsLFDjDaQMJ+TMKu/ITC6K+TcUgRVGLFLyh0qnn4SjvmP2i/A7w6mL40D2LFDy6tIUr9Hy6CYb6MZAR9UKwXNqLCHfzB6Bp2i+CPz87PoXznoWMLg8LESsQB/hhnv9DiD4xB+jcx287aaKLFsdnB/AjFL3zn1GO48NRSjPseg4LCxLDB/xKyTzlTvBn0+RZ4b6Wzt6LC7uRh+hrm42ljhUe1jzupbbzfhILFqQzB/hYfdBqLy+B4+irE0J+NNoLESVqB9hVLM22te8PfmgeOZpV2yALGFBjh/4v4Ttk/n6m0yPMMPXUk+sLFFBnYZhglzhL45EKbUCkp0NFKyuLGGZnQ7gYY2rPkIXhrqWTNwJqq6oLFMdnB9gpnH1/iSe2XJWFK0SLszgLEaIDSzEpOyhPWBBc+QAu4SUFYU0LDihnB/BYcmjzo6ujxdWAvb9IkF6LFKo4Q5xWpdNF5qyFgxo3MxgcqHuLEoPgh6gZlWer0HLNXCgtL06vLGELCNBiB/g0KYLe9hhOqQOSlnlReJULEdYdB9oMaSZcFmLyzBot8/uY5aSLEeZiB8oeL7uO6NS84B+dU4qxl2iLEaLnB/oUmZAFnFT5lFrgmGMJQ9ELDtcOh+ojV81gQVmorNL1W399KKWLJKpPB/1xFLjRiyMJH3pYrxHE5AiLF2PrSlACuEnR+BENl6xKy4IMybSLFSWvpYp7vJ2FmMFmfkMKTy/1TWCLJOVdh7rMk49K7q0diO6N1zFvYSyLGoZjw7hm+Nr0YZ92FOBKxxfsTvYLFqhdw7hPQUH6szKZWAmLX+CtawGLFOGtQ7gAw5L98q+VjlMcxsIRevGLFaWDB/olwy/L300z+H1WH3jnMxQLF+VYB/hAbNdCaLrtPmVl2UP1JtsLDuZnUqgPzXgfk/LRtepRtbWiymKLFoZDluimFjzKo0RYyLeVrz3m8tsLJGVYLHRt2fU6OycfZFw2YXDSHxmLE62jlukpkNUaG4LBlokK1F3KcWELE/IwB/gny4cWu11BzL2HcKVvV3gLE6uj0opGS4J+656FyZ1G4YyISJ4LHq2wJdgtbtBg5w9R5bzSrEZWXwILE7gnNMinpGhft9SMS3LMyaKr2kGLJKuQB/gHMz/FprrHhbjlR4ic4HmLJCuQlugH/5yCIHLscySuNF9haf2LHShOtMoS7MBcfnidtvF5jgIeBrOLE2VnD3E2tYYHxNwRtp9Rccm2B8ELE4kvh/gVlFKzqAZ7rfbIzqDY2fALGgkRyyJdlNEB/sEEe/DPW8gueKoLFiQsh+gi14fBEF4s2Wg546y2OK6LFoRdw7pPyijToRCBGkGgm2hw9RMLFkrBB/10kuC8tphQ0/bpf8lVDeSLFtBRh/plNw95tZyG/tcu0yFgbpwLE9m1B/hmVRmh/Roagobng3IIYWqLFKhdh/pBjSob5PUNABbpI0DIo4wLFKLDh/gfzM6flCLE7WSMY9a6j6ALExHRh/hv4HhVppcjSsgxbryWcCKLGiWfh/QDBYPSTja/Gmw5KpcUX9yLFoR0pdpQf9hKQySbbceYnWKZbsELDcrdpdAAeYjTlr3R1WlKfyco5d0LFSIzB/hK8S9MfPbbCbYL9CJN1l8LDAQRh/yFPyndl5M+Fr5WeleDOYkLFNBdh/hq5ZJlxsHbGN8Z8EFcHLaLFiLOh/gUPuECb+S6hx2J9JWq1fCLE0qsyzQnnZBPQxpfwsXWYfSG3yCLFIkRh/QlsHXvpVOPbUtsVmKHNKYLFsr6h/hoAIwmp4f2WFqYZ9Vgx/SLDVBdw6ql9nuVx1NL8ZBFdKo7Kx+LFCLRh/yidG15txvK8JKN2MM5SwyLFVB5h/jSfZyvAC725ANiv0eI1kyLEyhrB/wji63EK/setaD2iPnPkp2LFYRfh/wDCFPkHnQ2dSFMKk9PcLKLFOVzFuhNhmrcHyScrzR08jmVvzkLHpy1D3BDosgRwhY5FBTMTyR8Uq8LEaU5pdgtetBPMcmeLgKgZonAKHmLFokzB/oG2HyQEttrU2XFJGKLNfiLFuVOB/gCJEQRhnddjUrZDp7YSv2LDZyOh/4Qe5WCBSt5yDitVjsNyy6LF0OiFskszTociJjbj5bmHaJf1a+LCsdiQ75NPvLc+TXVyaiKUVGQcBeLBI3nFu4I3S6fxRYzGtlLPIIBkw6LChL6lspZnNDoJhrVByJlxAJYen4LCjgiB/z5nykowOPIkaHaGlbJpLyLCq2iJd8BnyCIkpulDWISrSUU21uLBvI6luUJnTrWOTQ6jOrGTpGQmdeLC6Q6luJfmSr+CxzblYWR6hqk8NsLCuZqB/lnmZ8mmY/LJBEhpa2l0wuLC6hiD3A7zDM4vE5kyyHdmx3DCVsLC6JAB7hjnJdt1xsdeGIzgNkHDDKLEVBzFshxtmReRG6XFK0qYS9DvbwLEmWOpdJtkMXLCGzy9gXDtAXY/SYLFpynJchhOZezzsiW06r0musF01gLGgknB/gN1d/J0KXBWcW4w76Yw0uLG3tDh/gTu4KQpW0iZDoRzmkxKTCLFoZDB/gg3HXrk89XVycc4KZMOZ8LGOG1Fu1jjSaq7Z1lBBxFlmQ6/7sLF3vjyzAQkCtkYipuJBOTVPk6JAwLGtmiB/g6Rznc6wb88MPr5FwZaL0LBpj6pfsh2IWIUlA+k/vpI66hbYsLCpLiB9vhtYPm3wNkhOPQ+XiLz2MLClQ6j2cB4YFmN21aXrB3GHwWAK0LDTg6h98Z54PkJO2XwWJMUeuciX4LDpWnD2eJ7YVHm+dMGuCzLbNnRaGLDgViUqx4vNIC1dzWGbQPhqm5Hs0LEVB6pdhDYHzIDPsKRgjmPzGjVwULC+LiSyCC9YFU5tm8bYZRyPqNPuGLFMdDQ5xO1tuNdWFT/F9t5sm7EmGLFFB6h9gG4Yui7l8rXkshPjKiFrMLEYZRw7pi17PdopCPQ6KejsWRcfwLFARzB/gV9dbaWbPKKHqlVufS09oLFOVDB/gPdZNlAVRgBiiuLE31dyoLFChzQ7EA0SH4O3w3rRyNIcaUeJELFlBQB/AH94elz/yGH2ASsgr5SVyLDSL6h/lyhoskJAI6Ywr3JjT1DFILC2VRh/ANmyuNnb/lEtstGUMXm24LCyh6h/hDg4zsdb6nvQddQc4dzt4LEVBnB/pZh5FZt6RtZJ8zZaYZpHmLEcHOh/Y3r4vFGEklqA8xyy3V3sCLEntjh/htPcyOBbXBGduiJXB5yMaLGmWtB/o3YysTkc6lxhK61bRKo0ELGkrtB/gkjS6J0d/L59tBE0nAlicLF2UxFuQD8jqcPniuYsSPO1DqYGaLDtBnB7BK9yePiSy7/JRDbUnbi7WLCFBnB/gIet11kRh2Os6w6TMwMWYLBpjQh/15iM7EQ99a4I+ssLrXGyiLChWiB/nxtYDUqu5mclqzMKBKSesLCmYnJR3B4YXnuGXvttYLkjSm8uCLCSpnB+1554eHowpJpVFWtYKVSiYLCpWjyzeB5tB2tetligPCNCPeJ08LDWsjh9+R+YeCgMNCatNy95dgLloLDXsjlu/b8YCkwSQmBacycdQSL8OLFGswJNrx+5OFRAvRByGwvKRHlkaLCfswQ7r78Sl7MmFLJ1ko5K1aEZ4LC6oGQ7lx24FkTQCLHM4uX5sS0yoLFFBQQ7olami5u4HazKdoyyrkh8MLCyInB/xriNa1jsU8k4pIVkxumGqLFCIRrRDdOWRpvgDAu1CM8Lmw5LoLEZLzFosLyk7cf/ILAmiT1ZvYdH4LCiIRpZCfnYGnmvR1WYihkX6gb4WLC7uOh/tjn5SYF4YJ05gyqEETdFgLB2TzB9BptT6sRLZ+gj5cNgMEffqLC5PDB+x54YchTeF0Qoux7GMGU0sLB1YRh+6x5tK3w4MV0HnBvXBEOMkLDRLzSzBp7HhANXA+LtHWUDGwTDOLCeTQB7JZ8tSToU9cTKTw9fdD9fWLChXnQ5zR43Lv2+YFj1JNYdtmK8sLC1yOh/mB5dEkD2zJqWUfo1Jn7AGLBdrRh/RNt3KLlPPc8K2XSbnmWOILCru4B/4JytFNnrR1ZzpLGMjcLLOLCDudlotLnNd/j8ShfA7a4ffY8AcLCETdB7tpmnT/bUYxHwx9YDGTzIELEQkOh9zxnn+4O4zOQa1TgdEJVuuLEaQDB7YBtN79Yb7PDyks40YCc+MLFlBnQ7ggMkl55TK7LLBInOVR396LFWNOh7wDs15kMZXtQMGIU0xphY4LFuPnJZQIzvSj/RXFBlsa745Gu8iLGmZjh/pFTH9kxI1CFOWYrT9l3GcLFOGQB/hLpDSLl1qyogoKyn6/M6QLGi2jh/xVaMITh29kgGU+TFaI6PkLFIQuh/ghL6YmUH+OPpW2JlWGcFwLGghjh7gP6oW04cwwnYKcs/ko4PWLFgRjh/RLpNfU5fiAWAP814LZYN4LEVmYB/iPFvX2DN07qi5tKSCVj8gLE2WVB/puO4NHTzLu++eLTrrqqcULEcr/D3EmwU4SOg/wzQiXNKoTMiKLEgkLJdgFH4HedHKbH40X52QV4cWLA32nNMuFlGBrs+ytbeEJ06nhMYuLCpjwB/+Bn4Km9bmsgTR0EUWzmsgLBoVnQ7/htYbH3NgxVmbVGRc0Gz0LBpjnJZ+B4H2fnJAddJ7gkbECE+CLBpjwB5qR4Ye2jV2ZlNo9ekabidsLBpjjh7PR44NGkXC2PqolbQJhy0ULBpjwQ4PB5y6OgMiyDWlv5AdGLJ4LBtrnQ4vx54OH01YfgXnZXY9LErwLBrzzB9fB54OmB4K1Aypok2maEogLDFrnQb8J54Jh6Hm0RxGt0dBNGykLBxP6h/7R54Tm4Dl2KVbkMqSPFGiLCjg6h7eR+YeGEJHdZgbhiBCOx0QLCgVzB/2B+JcWHSBZRVQr1HCcANALCrgAB/t57S7P1c6eZAV0aMVxVMwLDFrd0oLR7SpBmoH2hZ5tQCKUWSyLBbBzQ5JR7yaMdu3sfj3PHvZN1SILCXtAB7eh8n+143mWKBLVEyTtMfuLBjuDSyR9tnltW/fLAiC0uTHQWp+LCT1zB7+J5sZUF8nKzsN10PxoFEoLDGN60q3h5n6M/fvZSxabkDlEhlyLB146j3Hh4YFmtevMM1XLmENaATCLBrnnFqzx4NR32Cpywm9hjhFGGbgLCSROQ73h5NI1pjNBfBmz5USnMPaLCJLiJdlp7TculuWEnvadNBra9fwLESIqFusNvHdQv+4lDll5ulZ5VPeLEeTiaRIfntFkxVUsJLM2Wi9FjVYLEGNDJdgxscS9CoLdSS8D8Hq8EF0LEcOiB/lBnyfc5CZM8cW27HwGahaLFuTQJdhpuK1Dw9Lhx061y9jEF1CLGtcqQ7hiUYHi+h+fVJZiGLBldFcLFtyzYYgWBymKaL7T0lfRupgMWoULGpJQB/g2By+5i0vsrCvXCyUB3vALGqIqFug2B4a++0mfT086YZnjFUYLGAPRlsh2pT7Pop6CrUQlxjBp5geLGEdnB/gGsH73pX/WF43hw15E63sLFYPOJdwyScV7iijuknAxyQxMC1ALDqIzB/in323+RRtjPU32VKnM86wLFo30h/5EERWQDSO2pDlPTWiaagQLFBL6jzURgHwaQqcaP+Ec3ayRvnALFWT6h/lGMNRcOx7iaQLFsAHJSs+LFTg6h+oGcJXUgP6rVKoPcSuewSyLFCZVB/hgx95ZIVq6/HUuM97cOtGLGGVLQ7gjNGHedH2RDwxjqAEVBCoLFOW1B/kBgk/i+V4WawVorT7XEHwLDyLxQ7kK52voKmzDqZWdI3apvdILE0rjh/BI12+M9hO8yjvqrxsxhucLAxj60qsX3dCKt1nwoPXGUJE1cOeLClrRrVEh7Gz1leAKihR1OWXdYE0LBruHJZ4Z7YFm1pmbQUyqKOsqVyCLClrHJdpJ+y+21NjPlMoNNXXYL78LCrg6lunB+4DCx33iyTUvtIEVIfuLDF4iHmQ+ANYElrA9SXsqvUId93OLBt4nFuwD34Qn5WrfBKm+JDg6cP0LCo3zB/pIezeYT5SrUE2DjlmV0VqLCMdDh/hPn2tr1Ch98+ktIS5xNjQLCdcqJZBNtG266DfzTImdrpaIc1MLESoqQ7g1kYnWnwrbsgxpzWgy3lqLHUdiB/gRvRVUmucMLbb0OXEOdBgLFaoqB/gl2IWihcWbImAmwCFHqGgLGCLVJdlOMyi27HAhVOfWpOHkZlULG2W3Q7i1a6NhXUq3w6vMZuAOuaKLGQRZaREC3ihUK+xiCc87h/wnxzsLE6ZHNMhOOFQLPjS2UK6nRUXpKImLHQRO4ZgQ82k5AbDKoPGNydamhfOLFMddQ7oCaZC2bJoizoSnKwvaeCqLE4lBLUOFyFXdhQHQFh5GykoT9OQLFFcDD2AlJy9ff1MsEDGy0FMgl7KLGsdnD3EK22hZxWWkeAZR6OVis10LFqIqB7gaWoUCoWPBappaPtTwNEsLG0ddw5h9vSoEMYuslmXsHSJlGeSLDqhQQ5iGexNJpvbg4GDpYy6M1s+LFcVzB/kfGJCgRbRvrxE01bXGg4OLDtBnB/iFLnzd6ThqG2lrKU33l+ILFOTfh/gaAQw+L1npI/S59jEXU1cLDahjh/p4f4SF14QhZ6HgWzRwEHULEcddpcBjiGHfl0272jRPgeFKuBqLEqhnB+oNd5+z3d2xiU3vtbEKfz8LEgkvluijAM+rXGh6ZEldLcOr00MLEmGLUqhhNPK2xxd9CxFbiwacngwLGl/1UqwOz5IMgPLhLIhQvNPCJnoLE1mLeADX3Ihu1Mw4bTWVvQHK2QoLIRbLaRINM4N8Ns87istBo+kaK+eLAxjwcKsxktcelyv2mdhZYX6kavCLC9rwWiLRh4NguBnST4cbbakFTl+LBxjwJdeBmYCGggL+LfwR2kBJZ0KLCtrjpd+5mYYmWEMOnSW8RyaH2XsLChjwB/6Rm4NG2xEL2upRyRruG+WLChjwB+aRtYfGgLF5A8rg2fn6nkgLCgVwFufB4YSu9QU7hQpxWmN1HVKLChjwB+yx54Ek26NpCXT4u6ZeaKmLChjzB68J+YQuRIsBHrTWHierlOSLChPnBfQ5/yOBoKdchjlNlGsZIrMLCII6h+h5tSgIQ/aTrL9KfrSoKhYLCmPQB7QbnZF5jbbSX8w3sGxCzoSLDY3zB7YBEGqMVLo10mGtdW8bUG2LFg2iB6AKJJ3SlWWTNWs1zEXdbTeLC146hvsjitmkXPsUiXrTYOLzG+qLDiQiB/RRPnikr0hiNf5ultQOPeSLDb1zBvkT2tnyZO3bUILmUnzrGBWLDpLiB9A1Oyq0o3qTpwoKwupcGDsLCpyOh/gllRpiO0A5qXa3H3JD8okLFnHDB9iVfxITHEy9g1xjHKfRslaLFoQOh/1SJJmzEg41vdKGoZdzfEULFAkjlujBpNROlnLy3hbm5GSlPgSLDtY/B/iFhzN5gxRgXdr+yUz8iKaLFkrnQ7gB8CDN2sm+2tD2YEaSXh+LC0dRh7wbom2Bo2VgRcxlj1wURRoLCCVnB/lhknTHtF0XkiUOZLiUH9sLCOTnB7h5jStXlphRVTruAYfQ1RaLEaLRh7gZOnc93vJSXIslx2jJVmkLGnbQB7nfim5t36fdBDUb6SHER6SLFAkRluiBL2gv1WgxTF4uz43BxUYLFqLDB7gkMtN7CR5apfXk+ojOg9eLEeT6pZg0lQgm4o1u3AKdTE6hXWKLDuPwB9oVlTfBRgkG48UnCEfw5JaLFMr6h/ALeHicedHjESXg3LtZih4LEaIQB/BxKs7VqEB4JB77qVVq0G6LFNBiB7AXUHaOju+ONCHgnTcp4ygLC2ZnB/hy3NA9mqXQNBfrN3NNOOCLEwZdhfhRmcPvzj9EpUfMFQY9OcgLDy2nB9gn7pr57VkHraHAlPbWxdULGiLiB9pP/0v8+1ZyeeKJ+JHD8RKLC5y5h/RF1Zm7Er7rd8xBvzWdkRyLDqQiJclXmxkAtiqx2QbGjl8e2MiLESLiB/gtnz8OtxBzi1ceHqHxWDWLC9BRh7hRkJN90Qr73PAq1y2I6hCLFErRh9gQeN+X7PBc4Z6nZh5ldE0LFFB/B/otlaDhvYE/hIexoT6mMy0LBpjeNOO8xtZ2VXScQsTTML6oRDKLCrgQ8If5my7PE+x2ANRdS0bDNzKLCoVwLUeBnNO2pHtylidkwnV6ECwLCtrQj3fBmYVnYTkhjy/i6YdbLzcLCgVQyxeBmYJnfntOLHdES+LIWHgLDFrjrVexn4ECIolDsJgb3tJa6CILDFrQls+RtYTDEi9lg//orjccWnOLDQVwQ62h4YGmwQVp1lnV1MRQaOCLDFrwQ6yx4tHQ35f57T1XTlmlXqCLDBo4FsJZ7YABUNQZG4Um5HUcc3cLBznjh+8B+6OWQixfPfNpwKxCjLoLBrznFoh7VHo1u0Lt0bIxbqLdKe0LBtYnB8kR/5Nzums/ZLRlUZdkJKOLCLuDh9IZ+SpQ3GSRJkLo3HTiDqOLEWPRh9QL5Y4BnPlilz3ymEaW2LeLBkyDB8jJ5c9RVi0fE7OwHSKJhPWLCJonB7ZZtYBB9B6bjREag1n4gKsLChonB+LR4SGL9WH8OVvvFThJa6+LCOTzBe/JyyuoDML7wstMSbwQZA6LCLciB5p5ny1qpzg8iwPleiJhYGULCMdnBbh5n5c3mj8iU0Q1Ptqc334LEyIiB6oJyudu6Vhjdtop3MafuSYLDqoiB+hDWMNw+lhjbMGKwvnEFswLFA3iB+o7qMta5lErw7epy8BP7YGLGFBDB7oFg40hZPw+R96VlW/o1ZuLD6hqB/CwWsAwjITBDcmUz823w1gLEZLDQ6gP8NmXK7NDTi2voqXfYtuLDoRDB9wcxHsRXus19YGDk4XUQSKLGuV6h8gCzj/gfR/vtuQhbiEn5SALFuZiB7ogQQwc2u7cbzW6VPx9JR6LEaLDB9AauJunLKRqhKtlkZnxjLsLEUdiQ64Sf3C+kUqb/MG9Yi7FdyALFaQQB+jV+GGb9Ydoj1XkrNrtKekLEkdGB9hLBoZI0v5snUpwM9CWDsULFa26h/gQ1CpqLEtlTO4XAWy+5UoLFFBRh/ALHciBkbZk05WbeXevIWWLGkriQ5wSDEIMtqasXOwZKJAIfgKLEZLnB/htNtRv+my0xayy5JIgCHSLE1B/h9ihenqc1rZcGBZntunkAs4LFeVDB/yzjn23BsBIg1+M4AIdr1CLE9mRj3CrQS5h89u/cttPSXQewvILFvtdh/gK5n/5/zBH8sgfMpu8nbmLISBRyzQ3gtMXkEpRPlyJlcvg04kLGsm5lukJtjYlDskgNpnN4lWxm2qLJPtzJdhFoyVwF658Bw2x8k2Ql2gLEkQiUqwZaGjSnabQCgPtU416TTCLFaUqJdoa9mza/sSBYLPxVpkkklgLE8riB/oH5n/o4WIYJjjUmRzQdVyLEYZDQ7kP4ZKPA0HxPHxTGYMSulULGj36h9kFuLfQz22mOz0WLEk7ZOCLFyQdh/ihS5d16MDJnQuytjJSnOsLDsrqB/gC+44Mu/uaoMQs2FjS1syLFKJiJdhI58BGnSqVUmAhd9Vsz1sLFmZqB/gCTmU68v7cua46akX7iIILFFBdh/gJY7Vx5SRMXaC5mFOK/ReLDy26h/pNbysgY7r8vPy9QXcideELCyIOj2BrMMU0JTAX4DMro1atGH0LGQM9h/0zim70aY4yhlEeNFrM8DQLFcrnQ7iC66qj2nyhNoKqY/ebfheLGGEPFug5Ot5/uSNFD8GwzzzcWeCLGMrzJdoFiMFVNo/Zxs3UjrmuWRMLFNrnQ7gDAnorp1h+OIcs3rw77FCLERyqB/jxliSIzEoFa/WaPTY/FQILDlr4B+h5gmtfDgeyiDIZq7dMUPYLFMrQB+lFh9uV4xw7tkTC945gbaiLD2ZRh/oI1yyJxo1RiNWsUlAZmvULFKhxFuwxrMDWrphab9yqTpal0U2LFsrzB/gTq8DEZsklSssUvqTEZzELDqhQB/qBvF41tcSZL0Fps8nqKacLF9BqB9ghkkNS3f35Vo+qiSKEczELC8dDB/gSkGgHX/dLHs/pKIag6FILFUdRh/wEgITlzBIroVM9U1sz6y0LGUrnB/5nynixuRZY1pxPZh1ier6LFqQdh/hFQEsX6QDhoOIx9kX4WB8LDqhwB7okijQpbRbPf4Vlx8yUyCgLDqLdh/Ith6RxiPZiaIChqp0DKRWLFSQDQ7xJrThtbiFabS5ZbN/WLFyLCxLqB9CmytV2s/IiJlhjckWzP92LCNcdw6kp0TmPohhdCsgZ9qOEayuLDo3Rh/Bobuq/oISXitA0xPsc8teLFA3Rh+ihmSELlnL6WTL2ION0S8SLFahgh/BUFw253OLOumtZpoinIgeLD2TiB6owwFc0ukhzFtWMo+ycyt+LFI3zB/qMzpSyKTBp9OaWy+V2aVKLDo3jh7l1HFZg1RA4NJHieWVS1L2LFMdDFshyY4DDSGxRxBQ6yeOfdBQLDlBdh7l1LyxtxVNdS1IO45vzBusLFeZqFss2i2IC1do1fO1X5qRmzUOLDoPzB/hI2nQEQXPwpKl8b6U1UmkLFWZqB+oAvststs1TYA6rShZsfwmLCo36h9hA8gd2ITLdHOV0I/cbCdkLGrcqB7hcgYywjRdxovDw/IRoQbQLBruqB7CA78yKlZdq8nvrSGzpvJWLCgtnYZdpoMZ3wL/jOuQ0zTaU0/yLB0unUoMJ8tSjnXNDdgFvndNgy0SLB066yyf58tMyruyMJz3h2dKgKYULAqi9j3ZZ7YFGRRatB82WEwUOf5oLBpnxNI3h+SwoRzG8dzlb6Oh7paMLBdstD3eJ+YYl0HjieKdkXd8rCWSLBvmxB/0p+SkiETw9RLpjHL5EdKaLBqiHB/B584Omsu7nDWBRdtaOlIcLBQPHFu055tT0gSlURsNeOrnTxDgLBKi6h5wpnYd63L8Vo/OxqwvwTM6LCCoiFkg1mnaau2i9Q4Ni65+pPZ8LCaLiB+gxm21Ixltt9/w2mRkkeR4LEVBRoctHgvUl7VTNo8C8ORGQD5aLCaIiB9ghziYKuNhuoFlJTqwWV2MLFUddh9A5P4LFoqnoCuLyeORwi3cLFgkiB9EUjSLGnavqgyZrXxMvYpELDiIRh/xN0wp5krDEKEg8YsVPqeqLC8dnB/Axb7m15tCM7x9nbx9RxWKLDSLiB/ID2nHu/nxJG2+ZxaJGXJoLFWTnB/Ia9sxz4OsGJz9WycRMkdqLFWZnB/IUIYTft2YiGfny31bL5QkLC6I6h9Cx9w+ENtOnq2gbpI7oSpILGWTRh/ATCNTrwazlXFmeVJKN5WELDSIiB/AlPFb82DH69JXBf+0GmjCLGqLQB9g3lZyFoArpsfqL1LE7lSuLDIIiB6CO4y0g4ndNVoZFUJIS4G0LFFczB/pv37x2OT6ZLaHEfHxwchsLFNBdh7QK+G2X53aGCOQavtNk+3ULFqInB+kGsGs5uGKYUJllzekAZL0LEdBRj2EVlxEF8GAPwNBomdtXzQKLFIRGJYw9PaFOpYcxSWCJ1tEbypmLGqoRh9g2qxbBwUmNgQB0o6YJT38LEioiJcpBiNk247gj/Mc8OPpkVSWLGhWnJYwqt5XVsUQSp5aU08LpoJILE2KRh+j0puU/+YIqyehTPso7bdcLJJWnQ7AMpSqVkyDk6WZ9fVzL5oGLFePHj3CMbWBDijZFnM3QP6Lr4VkLGjgQB6owYG8tsMUMxSSPTaQS5E+LFyoJB/4gb7JUrBlX5ABaWslSVE2LE8dxB9lkjofGkhrz06TiUpAkZ14LF9BRh+hCcFtB9n10wjvJRrqMUg+LFKIqB/FkiSKU+zkitug38D7p8BsLECViB9injRIeldsu+ZBjFS6CFQSLDBKnQ9ZpiZq5uEl0KX7Tr/Yq0QELCpXzJZyp44J+Nn5upRrNXFB3LKiLDV86w5lp/4KmGftfXBJjDBkVHykLFN86pN+zVYHWcQf8CmKzlrjDNoSLGWfLh/XmAH+YSivUh+riSuWP3w4LJPkOQ7+2BHyNtL2xhCtp6wXEgHmLE+sNlu4+Aywv1p/d/E3QZN8dCCCLGnkL0rAlTnlWC8bKmei47DHHH+qLEms6yxBD5IESGp3lkfBomWGlbHcLE7yAB9Rzn33Jo83B44C4LOi4lq0LBCoRj0B1ksd3to94KNG0XthqRW+LEkrqB8hRskuS9S+nMKakmhz44B+LEVczQ5wF9Vh6Wf9uOhMc7GZHEOuLC1BdB+gdtJXJQqley/YPMfkcuNWLFr/5pZp7ltFqJne8+CpIeVx1EPoLDSLRh9ghny9NktoCfR61N4KS8LALExy/w5ASYNbUweIuDfhGZZ2K4KeLFVcqB/Alb5jA6P2qr+7DHP7xblALFkrRh+pboNNp45sZGODzk4IaDNGLDqLdh+gAkU0/5An0FOhbWMdpSxOLFKhnB+g+QHWNqnODUcCsLLs9CzwLEcSjh9hzgEq6o4fupj5dmoKUXugLDihnB/AIXji1p1WSrjyWBXTGYRCLFtm3pdha73ASYQpPlEAhzt88raeLEdBqB+wF6O04mK8cRc1WG0kOaGOLE6LHh+wD4H9Vv736uwuVoWJBpHQLEdBiB+gDJmtuh36iKSmy2bJCjKoLFqIqB/wGtNWKgzgU6BKfYWYps3sLFAkOB/pHaYJPnExWJNGZ8UwUVIsLG6QiB/hGrYZA2L0ctJWkKXbEGXkLEokHh+opr81jzPeSCJuWb1K8vBoLDqLdh9pLKmZp47ZmPE0wqQBGUwaLFokRh/MUlSObu6T2HxntY2Lc9kALEaQDB/gPznadKqBOonH0oVxT5hiLGErHh/gjnTAV5pYMDeK8xhwbJlQLEkdqJcgwxtVIlmwE0rlKnMH8LPMLFFBDB6BRovezfV+sDtqiveK22T6LEQkiB/llpSge6M36DTidWYvMX1cLE1BHj2MstEBn50MewO5Klko90XULFARnB+oIwXU5szDaWXPZ0Vzuk4GLE2PDB/gIOsS9cRJiXi19RqPMn6kLERPRh/iC95EZiMF0asF5DT8cctcLCl3dtM45qSRGD6xyBh9MxgQoV46LCsuiFuo57sDWoVf5Y6FP225kAEeLC2snHifh+Ya721x+WeRUdmFMm+SLCy2jj2Uh/ZGgO5/LGNqWYZCmNZKLEQZYYZlh8YnadQiEPNKRnqeXKPCLCgVwcIFdtsLOkLgwFr6O2l6BRnYLC4V4YZ+h5tDxVJX3ZEOqsTdAyRMLC4VwFs+h5tLwhUf8BU4eoQclXE4LFAVwB/8Z5nmY/+rOqdZkyzwhIRMLCYVwB/6R54AC6BFTHAt88dFHoJYLBYVjw7wp54ADl7T9PU3xMBL7m0CLCJLnJctJ5nkT++HPe/mbJxP5LogLCBLiB/wXmSpi2G2+NRg44VFiMzwLCGZjtMBpnMB187ITmZdTd4KBBdwLCxLqB/sLmTJ86mKkdo2S3wwK5XQLCcdzFOFrnQbyJqgFNH3zZL6JMLQLGihzB9gPoN5EaM41RPTSoNFFpo0LESIzB/gowdw2WlbKwc5uL59Aa+ILE2ZqB+lBiHnexW7rcJ2Irx7g1TALGmZnB+1Q3Q0trK0UeXB5sb9m9gsLFGZzB/wndwwGbc/8CrBmdi6On9qLFOZRpZhjdjwVnEw8dCPs9qga6McLFGZqB/CsvjzEl0nffiTCjLIeJCsLEWPiJcgIkCEOwpXTKBRChfAMY8YLFEdqB/AHfcje9Kv1VBeD4LP8MGkLElBzB+DL5YGSFjMbWCH+0J4XG9oLDqhDB/BH6MDdNT+a3eAKi4gYs10LEyQqB/wg18AOzj2utFLFTYroVhoLG1BiB7gnyyoonf3d0TBgy7kuXBsLGq2iB7BHwTrY/GnRxFqtdJFo7QWLCdczB/I7qHyyd7t2PXaVw/5fP4sLFoZ6h/BFtC24FiKfcdE2u3FXcUILFN46h8h49w+6eBPkrkRqlL07iZsLFCQDB+xVwmt5OCiJOUqm1jREmJOLFuZ6lOoS9ELQRGzHifyp1b6EVNELEVBiB6gdK4tWwSVtSp92XeK9krCLFFBiJYtHINVA8UqhjDta4tyCx2gLGihnB9gpmZJRkPGC2EJTNAsMLz6LFqJzB+gg8Hb6bhkmjTXhG9cGGGoLEy2gh9h41LI3gVcQul7Q6k9kM/kLFuVRh/hn6YBT5gt9h/aHi9CzphaLFqhdh9AbnYOD+GaUcET90ZRBGcILDqIzB/lbrLh0djdZtuLbhqZoLrCLCFcnB+AphINFlFXTBrCaCEj0Si2LCEdiB/TK/75WjoOiO+FVBYWlMgELBNQnB+ZZmYGZrq/vnHW5KdZDgOuLCCLtJd5hyvw14R1XW3I7Qq7jFWaLEIO1B/hZytWOjKL9pBdRodkHWAMLFKfhB/gHZR8mGeh2XTqh1rZaaUOLJKh1YZgTaABE6GHK1K6aZ1NjpvuLGlFtJdg0t61B1UpAgSTUXzI5SqWLFCLLD3CFa4ZcSDdKXhVXaCpONUaLBlQiD3KAeavUk5RMkTQpsjmaTgSLDWY6odiTiqykF431J+Qn1P/kqHCLCLciD0JrzM8y8aY6E8dg2TT/SmeLEWs6pcMvsPnWUOVIOoeS0bFBstyLCKVRw68z2MM7iPkRHgypywSEoZKLEQ3nB/kFk5GR8vhCOk0v2g3YgpyLC8dnFqn3mSg16yARjieI5cJzVCYLEkrvh+gsbF2za95Af9HHFGS6NGCLCsdnB/wBKYZ/xHF+9JPZzKhFw2aLEyQzB/gHX+F2Ab1JtjTdGH7wHPKLC1B0h+hAfrqOWdEP9ay0psYYPReLEVcOh9hBxpZeOzr6vGs5OKl2ligLC43nB8gSu59pnme8f+qLOgfaFkcLFKQdh/hgdsCX6npucdTKfNq5HycLFCL0pYAvnYS6UmWLraTzC8iwUYQLFOVnB/wLjnw9uju+HXcuRpURSCcLGmV6h7hDMh9s7+z8bcKVQrbXy48LEqJvh9wRgEkrkreMSJHncC7JdL8LERLnB/kNeNC3sSF1mC6xG56VSFaLDuZiB+ghwz3sz9j+3YIGGYqNk00LGJLqB+wRuMWO4xwhkihPuwWKs96LFuZ6odmnh9SoekoHbswLoCWJZx8LFBL6lsACnwyqHlnks8CWUKT2DnKLFFBQDyBdkwU5zrwYQq6vcAD1Y30LFCIqB+o8hlsWyMlO7W5NLEnJoJMLEyhRh+hX5nrHwKMbCwoeQBbNPusLCqVzB+gRKy0md2xP6iOY5b8YUKYLFtBdpNoZ/YnBkBFkBYCxcNOJnhyLEUdDB+QK3oW/AbmEeuHBLaxFPqMLFOZRh/hBKj0tjTL8dx3ZO848h6ALFCJiB5gNa4fYjqWWQ+JS12wEiEMLGuZ6ocgOFJW8NEi+BUmDPzG74BSLDSQdh9RkqRvNwF3aCYvY1WM1Rz2LEV4qB/lP9IRGqCKT+CxKPms3d1YLFCIwB7gH+7ZjAXx0AG6b7Hfw0pQLEyL6h+gPwMUeDmbyC+bjQ7hEJbCLA32nB/u5yIORwVG7tYhcnHqoP7MLChpnB9255tb3sUM1XrOMi4hK2PKLBpKjh7vh7YfW8nQCyyO3dqECfTkLDGOnB5+B+NeR9nR7oo9LUVdF0mmLCjznB77R+YSHtL2dhlSyMgqSlDGLBuOnB7+B+SuvkkENCFtx8YVGO9ALBzznFqHh+NQ392p7Ja+RZaPmS7ELB2OnJZcJ+4ZH2oquGKAM8nGdlYcLB3+nQ52jVShLkZL6b/i9qoYmovGLB2OnBfJbVYfH+v/dzxIsq5oe5a2LBxovhf+GAYKD+moLa/KorisQB8GLCmOnB+x2AHuPgjpUGRiLG45Det0LCrznB5LUqtez80eSyVT1+dsRdGYLCpPiB/Ur9Nyu2FX6kOhELcUPLlwLC7udyiRnNGN4PGiY3G5laQKAmNuLCxXiB+Nv75/e/K7zUY9Lth4T3TMLEUdiB/Dh4wmojlzNRMHk6VNw4veLCARBB9hpmNI88BesjSGMnaUOpgOLESQRh+gI/k8/1IBwUC/lLp3EVsKLElBRh9F5nYOhj4/1X6sfYG9oG0OLDqh6h+g7qE+U0SlY9lPSO0ZKpdALEdcRh/CAxHK9joqyA4m1WmNlXheLFgkzB/CJKMGUP+Zc8W7s0g69j/yLEUd1B+oBPm23xUt4C9e8cAQ0JK+LEexzB9hQfTp8d68zHJh1JS/YdP4LGlBQh/Qmw/DgIhau8HySG16622ELDUdfh/R193CUW28Pw8US8jtueFoLEUdzB+5QbbUuXM/OFmEnKjF4bSOLFeZiB+4t1WXawRbhtSxKrWPoaOALBg3DB9MofMKfZ1JlefWhPpbGkBgLEYXnB/6Qcnz9kchGn0rZdUhmnnCLDA3iB9gS/6gqofqLjSWslUVChN8LEwZiB8pAeX+mxi0f47JMnpuCijILDg3DB/sAcmgJGUWK0rfY7+HNF3ELFaLiB/ghdNC8vVrqeczDsJeQ9hMLC144B5gvnYbHGk8XLo6l8dqPZwoLGOTzB+wsiStMB5utLl3BCoj2MjuLFMqvUoIAodOsgq5cD6HY4FSQYH4LFBLDJdgMOD0pBPATGoiwuBr4cHELGahnB9gSXddBl2+2xLitV0UlqvoLCw3Rw5g1NsPd12j2q0EVTEZ2TwKLGiJnB7gSdN2R6TRLlTJO4FChcWKLFChnB7oXKNVl1VmVkJKIPYsR+nOLEcdjh9gC55uW4u4bX0z2GpSJcaELC9BnB/gJ0Gpl5eXJR+Gx5Dipo5ULEdBxDzAUfny8JWxymX/K0ecLKqsLBmOnLFNxg7Cl3k3uBcnYt0oEMqwLDTj6h/cJt4D0TRNQlxrcn0UfYWwLCuK2h//R7YbGZOm7PamuWYFWiF4LCio6h/R5+YM0YSxWv4ctGyEKYUoLCtrfh/65+4XSAdi8GALLXexGk1iLCju6loOp+YamXmGFQJRG/K4cIg2LDF41B+/Z+y3Nly6DnW5WYbGSnwiLCrn6h5+B+YdmcIGp3HF0XrMyUQQLDV46j1cp+YbsUfY+ykDIrF3dKcgLDlr6lqh16tNaZkg906NuQ7WKenaLFHI6h/4d6nDYDjWLLsHWialq0KILESoiFu8Lz4Ac6zgxsGDUohCkkzWLECVqQ5wxnz7uxQgG2qW5Hq7GbbQLGOZiD2ADkpEC2v5OrBnQ59r24hkLFEdzB+4dly9yJFN0Lvxh30TL4byLGRyOB/AD3H75gLRd+AgLZgD7TEILGNrqB/oJ9tL+7X3icQGlLganzneLDuVqB/gstmhstDSZca6jbY8HmHKLFI36h/g11W5eFetp1wO+czf6veALGC2dw4hDJTenjLtGY9SCnFka41SLGOGOJdwhiMWXgj63Y9FGtzUZkr+LFKhDUohDuNq9LLyi1OOpOYnH3UILDq2iB/oDPsaGpF192F0lS8/lb9wLFY3dh/gUzS4h1juX68U2TOmywBeLFOZ6lqj7OPSKL4YN7MgUS2f4TvyLDrndj3Axw6AXxM0UfmO15o0mBwgLFN44B/pRhnoZO6k6q+Wq0K9po6cLFShd4YwxkjhdmsmG6GQOnlzA5sGLGWZdh/AAgoWnjP28HQ0nn4qjzACLFKhdh/wFyAZPys77P6RikSp2QV2LGFBRh9xdr2cep4KhjloRvq6TqYyLEqLfh/whiGxSRR+5SaabqOIJHJcLEa2dh/qBoH4/1VKGWxxXRBOZWbWLDQkfj1BCVzxsaLdf21gzr2N8c66LFcriB+gRozkap/+b/tGYwPurax4LC9cdh+kAc7elxHtm/g50wXZ23x6LDqhiFqhtYYI+6LajlAmmWqlKBIGLGSJdlugT6+ohqdx5KgJwyQIeLAmLGF4qUooBTKruqJrp4r+knyUdIEqLGrgOB/oXXmrB0cUP1RPJjXj7j54LD6hDQ5g9uQHjCAfE45Bhak2MIfuLGHIqB/smLYs2wAxCscbU8Miac4cLFY3qB/gUaN5CgazjHD6lEcdODu0LDuZfh+sBZPHeNotSxOdGsv0eZEmLFaLDB/gkJ7SHT69kv2fV4M0VfpsLFS2dpcxB6JHdpPnMGbKo6GUZZyeLCOTqD1BK028spr9sdMRA2mrr7GCLBtriJdVJpYzEmA55BiZ3n4YS1I6LCgR6j3Q555RhqRb2CcDnLAK7bnKLEGUhFurB5ygUEb1j0U0lTtb0VdALDOGH6RBpbykM9JySlClS2Ii1aGuLFsmH0qgFa4LKmmqAgEj0wPIczeYLGV+LUqgCcypSwz2PrKsZzznFVq0LCARxJdgV820aR63fILFuQsPazlQLDE6Q6RbhqzpwNTskr/BkwgIMBWcLB0y6rRSx54U0cCQvwWNwmPU+HniLDAI/B/lJ+yoJleT8LzYV4AwXJHWLCmN6h/ix5yymY0ewEvzi87KSaPCLC2TiB/jp2N9iu7O8JH2V0dhqM9QLCJLnB+LTlyfJ+AQV0e1CTZ0cymsLEmW6w7FHh8OoGzYt2PqSnVNfDe0LDhWqFuAN9dIY63SU6XqW5y4iWNMLEd4nQ5gLq+G9zOM9tqIeVbNESDELD6Q6h/kKUShYNfBB/w4LgUiw5MYLC1rdh/x1s4QX6Iif6aFHYILjHiGLFCQdB/pTmWDuBs0UykeNcWqsJSgLFBLzB7oAVuVCctZLvkvSWeLIkjkLD1YiQ5ht84jS6TK3I9kwjx9DzQCLDqoDB7AYZxb9RWVUa44DOUdsfbaLDw3Rh/hLmIyVmLUMDonLqEHS7EoLFVYnB7obmTXPoF5OEZbEM3vKR1uLDsddpZpDgDjnytk0ZSNk+OTbP2WLGGMglsxnwobXtp9R4LAOy0vkrkGLC43/j3Rtd8YMrFwuNzFPRGS5W1oLGqhRh9jMcS+xnLJUUIzNMlDE7xmLFNBwB+hHbSvfHx120azgM+8BLR8LC+zUw7h+QlLlcME3pJaMMuUZf/MLGtBQB/gOZtlngjXDG6M6pMp0bbKLFCfGB/ohLZQ+YvvA8a2aH1JI4w0LE4kQD3AYjdBbmM0nOnhAe4FKHNsLC4keh+hjC5sRRJ9ALUjOORKGcroLFywrNMpBtMq9czyhNDt1U1gyAfiLFAZjtIwFPPRA1PSJrPDMWXbtNCsLHF/5rUAAa6xxbFM4mfxWtsPzETQLFiLjw7hllvC02olOIfgypMJS7soLFIkvh/4G86k33l8jKz+2ExXHV4YLEqLRh/gI+YTrzV4ztIC3ZGi8I+aLGChjh+gVbBtA4T35yzHMYZxP9caLHgZRh/jEsm5RoXNVTWqxn11mGMKLFIZRw7gheGCbq1nOHGb0TyJmk++LFShiB/wB4NQ+/HNcpybBJYozfSkLEWVnB/I0o42XkIrmDCRF992YYLsLFpydh/EX6YW7lHcMDrDouNDYWzaLFPbnB/5Af4uD1NSeQUkw10agVXYLDRHRh/gq3nhF4hPCLw/Dy9Mj9MULEVcRh/jZwa4PgOGkuCOs3JBd09SLGlBnB/gWoTYtgPCqDJrlSwFytpQLE0OnB/lBn/cdsWAtdxbIlWX9fz0LFKsvh/gPlYpnsmdeCPah6mV2RNwLFyQnJcxvtzkPpaOTuPykkHbZBgaLGnswB/g35ZV1OCrCmiibb+54hwCLFsrnD3ANctZxgqA1V1ErWW8My/ULFKhRh/gQrGpHoYl2AYVzFnheDA2LE9BRFupBTGwS4BwhXEC0abjsB6QLDI3nFuJPNTTh5KD8cjk57bXNgykLF2ZiQ7lR4GHciEov2cEqUY8amwKLC2TRpcggwTnXhNQgrUusXmEOsTSLC8rQB/gMOn8F93JWk4ZTWCUWjIKLGoXRh/pCxYWZgmgRb5zDsiaO3TALGShQB7sh5ESxyFM4BzjIfeVaEDwLCdBRh/gNnnCbx9u/yWhmj8XuNt+LEQknB/glKzyHjFojRVUrTBpLE8MLC6L0h/oRiyKqEv07LCTQ7yJbBLKLDoODB/oD4JkzNHnnKPYukWUtKfiLFWZnB/lf4S0p4yGCxsKc7j32MYSLDsdRh/AM4MmTh7fB5sZkSzEQqOQLFFcnQ6geNSCv1uEbzHnmrlmJV0SLFCLgh+idwm7L/aHJzXOu1Yp1EYQLFlBvh/AC3ynlmM57AfxjMOQL8WULFEHjh/grGCSivNdqJUI0Gd9arayLDqonB+gQ0JXd3sv12q9XUfDqkG+LDg3jh/BP8zbQ2aniNY/cpaufOtKLDpLiB/4LpZ108oUuSQN/F1klI7KLC9YnB/pqaZXVvgI6bPXKmXLhcDALFaLRh7oJOD8D+EFfHskBOEwpY4qLDsdnB/kEN45dzKnuODItK6lpCzULFmWwB/hicy0lRFD7o02LNtad9gmLCwORh/gNPYZt0uFOVSoy7GSgU5qLG1B/h9gjFsdQ9/rDigAv0NTDLG6LDAORh/hw3c1fqQzFFnASsa71jP8LFVBnB/jhwsJtheUYB8jk7VpaHmYLCxynB+gv2yN/5JfnTUHGD9OQk6ULGoORh/InyJa183omT8ENaahrT+ALFuZRh/okBRS5wZPuoaDjIL3+KrcLFC2QB9gPQZWrpLJSSO1aZ5tc0ckLFkSGB7groT7WOsVXMYZRP/hDl3gLFYZjh/hNFfZG57EqPnDsLL46l48LFYOnJdhNtNR59xC2hyI6V8ukgK2LDqWKB/g67QvNhV9ai2k0o/dxBD0LFaLnB+hB7S3xiB2zZL+e1LZrDIGLGARjj2DTcS8UiZ07k2cuT3brPpALDaInB/Ap4oW31tFmhm8UbqJlGSELGVBQJdQp/mWfhBHOC0VE/jy6XNULDg3nD3MD8NYdw3gDjiXiHbBdoP2LGUdjpZwg1SwIrJ3LZLXR+TcHNqkLFVcnB/g1em2V7egCLpJorqjBl22LCyLjlug/oHr8y5BYehqi9h8OlHALDoRwFsB7KND1P6OG4XwpPSpgSQoLDaLjw7wg9nx14lr0lKfOZLPEM8+LDuNwB9pY+ydBKuIqjRybnKRoX98LFSLwQ7xi5WgFLRp2fw1M0CS8OkkLFCLwB/ho+T85HJThPIudak8EOIgLEYRnFsgC1m6/t+2yBlznptcr5E8LEsrnB6gA/IcjsF0Yv0LjJcSrUoELDwRwQ7RhKyzZfNnZ+fyx63ePlzuLFAkRh9k50HfRvEYwBL0zylGQ5JOLFYRjh/oA0ToC3ls+Qp/BbjbfcMqLCsr/0oARenS49GnG2HMsUcQbZkkLGwOrJdgFsnA5+5CpR8yyzEnzJh0LDqhgh/xSeZEp9DyVuVkT6XCm6lILEdcnB7kkLz6n6gzVx6HGqJv3pWeLC4Rjj2FcaN3WyQc3gKMakpY7CLULDiLwB/Ao/HrLexFXsZQfJWDiX5yLDeNwQ5FNaYYbeHfrJzCMzKO41DYLFasjh7mKdaUr+PrwXWWxa3P+ZD2LFARgj2AhqGzZ6LwtWRTuivFo63U\";\nvar messageData = { \n\t\"5FNN-5MSJ-068O-EPDH\": \n\t{ \"content\": {\"content\": \"IyFBTVIKLNEafAAeef/hgmeAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALFHfqMpd0dXpGs4sUolGv+h+72yCLHUqRh/gqcyCprYMSQFNwufSOaDSLE+GiJdorixU6gMG21xXWRO2Zrl+LGhydh/hkK7nz/l/bxCZt4C4MPr+LDohOh/oAw8NkdeC6B+DjoMWqzQ6LGkH5pYgFyPTRBO3Tb6NdhvdqtFoLFokRh/Di/PPbrZBeQ3/OINiSjHkLGmG1B/hGTZdP7Di1SmlGTuCSpuGLB1YeLQJ9yYwH0fZ5VyQq3LicUEqLCyIClsrRnSoCO0QqAnLVN3xGR4kLEYRAh/mBtShlY36+xZYyGAWX900LGFcDB/oBtaJZTrzEUSldzwied1gLDtBKB/wB+sAhO/vbAXxxOUdBp3aLGOVkh/4lyF9aJJjiMcQXUdJJGtYLGA3jpc4GJnMZDHotJbeo26dxqTILGKQCh/Mi0SriHav1B6Ki5GFCdXeLGmZDB/xAetYzMtlkQV3udQQPSFsLC6L0h/pjeGkGjQ4ZnpAt4fyVXSMLGlBOh/kFb/i4OOhRAWnUp1q1XyILFEdiBfpNyQeY1BZJy/immjSW1Q+LFAOXh9QdLZOyceLcHwsfkJ4pzSgLFFBzB+h5KHWANMzqvnp2xtClOquLGGNDB7BCd2zvSK33WbFGE0KLA3gLFNBiB/j3/+LcqItNWKfhzIpwwnqLCwPCh/gPjwhGeFmqbQKo4412OUgLFAkjh+wBq0dLfNsx3j+aS7F5snoLDqhiB/pM1tNkinByMstPEQle2NaLCNYRh7AhlF+r9H6yjfK5jp885TwLEwkQB8ki3sekPmtYNny0zou9jG2LGQ3DB9I/BEvxJcemP94zHKSyyKWLCwOKB/jBiXw/GCM91VXDirx3n8wLFkVRh9gbYNN79SJ7xsbOEZ9siVeLDgRiB/wiWsSKuVJOivLdEkPPmSyLFCIzB9gA9HPORH5Nrg5uEiWg7LWLCahQB7DGGUwL3r/+6C1SznhKdyaLGkUZaQJuMNOMJy2D4vj09wPKtheLFIk9J8434a0GQf3hiY2jEQvH4Z+LENzUtMgspxA2vZ7Sd4xuo7If1M2LFvaxFusP42aKgYNL6d0bXpXmqSsLDSjsluguUmqfNOKziYarF9wVaqMLFByKLRAYf/RQweUkhSU9ZbkKqMiLC8QClugN4sI0B+UydD8tHZsoVDULGgQRSzQh0FE0Pbj0y/VriYbJsNgLDhy1B/wboSv30qIJd8LkGAiGYA0LGAkqB/NL8Se416WbHGR7RhluWPALGBbOQ7hR+QJB8S8rnPkPNKtMmLALFMqDQ7gl4YCnUN7I/Jfyz1YPw7CLDlmiB/wElYV0jp0VvqYJWaVsiukLFEqqB/wT8FZ63SwBUtA+0ZhmzpiLFIRqB/hmvuLsh7SPp52tT64UJpcLFIhiB9hEk4pi1L+yklQ3wEtD1WsLFqLiB9BA85bmmL9KxrjVn7ZInCcLC2WqB/piVHdM10pLVGlyRN3jV0uLGuVAB/gOD4IxhLo50O+jk0j6XsILCK2qB90d2H8k1KU3PlRYKQ5iTccLEgORB+wp+Y1KKNerOhhi0sfvRPILC0qiB/B5+5f6oIMDviitFhKiD78LGm1qD3JDUHNE8L190i4pR7kM8H+LGhH6B/hg1NukhtiVLIjJMW6bfzsLFawCh/g1RF2UB8OGymGzsWoyMUELGkQ5h/gC5xy8Ty+TywsU94g5w9cLEdFQB/hQKq6PiN3znDVrLNuToLELISjwFshBkH4FVF5+ynnoCILJ4cILC6fiB/gpiT+qulkplKlvCil3phULC73rpdJhypHwIF2kQDih21dLOdULAkyzB/g5nw/aWm8by0eWrtO9HlyLBnmTw7/xnpOB3SPGs5YuijBsWqYLBn8nB/PJn4cBmvKyoMs9a+JTpESLBiiiJeeBn4XkiN3KRuVG0caKg9CLBVDiB7+BntX2zm6ZDiQ27Z4Zh9eLBqiiB7/Jn4Ri+P+pDWGLmUqyWpcLBv86w5/RtYLCUyOiR3ZrZanhGOiLB066pc+x4Hmc5stelwDU0GeShD0LBqi6h/eB4YKCMHd5yygm3lZMU5CLBqiOB/+B4SqL4q0QWqvrbImIeAeLBttnQ42hyy2roqYlG1/Is+KJYEiLBs6Rw7aZny1uGpZ0UUX0YbmaqiyLCm8Lw74L666+ZR/nfIMOCVK/UbCLFPvNtMIf//jP3YE1CmVDJ/DJbxOLGBWhw5RgyS+9sVbJ1rU68JIRugeLDtQ4Jc0oZMF3USWhNLQ4ymTotQeLGXILlu6QYYDgCvQXRasUTjvTScqLExLOB7YAZ4W945zkyGhc6T7Ob0kLGipNJdIIeYbhvvHFyl6sNfuEy7kLGjjN8I/A0MT5hF4CgNd2rYdAKQeLFL2NJd/xjYTN8V2cEzXKGZgXBR6LFDjpB/vBmynL1tpxGhFL6iK1ANaLE2KN6RfJn4ElkSlMtaG5k4a3I9sLEzyEy2eBn4c14QkanFhbUSuvPZOLERWN4b1ptStPnbLexfRudzBv8PmLGmsLvE/R4YUMBTRmcPwzI9S77ogLFGdItMltttAAxYSjhtA8yTFRNawLE2YLrReR5yyMJqQjFQ9WEgy3/ESLEWsIlscJ54OGnv7HA5Qs1nCQk9mLERWLyzeB7SkOVpLrhQE8tgK1+w6LExWIrVHl4yhktxlDBrhSkB4kW+6LE3INlujD9YA9zBZ6yGz1zDVAI62LEnIIyxQwwa5yqYNswqjga+lJ2OkLElkpB7kRL4U5izX69Y094G94IaELIIBIh/hdmW04y9PuNAVMUcUDuWKLE6BNw7tthy1J9++F9YsM1Eg+YAYLJaRItMhEIyydJqoDS+zSyHpMdqaLJCtLnmA7iwpuHl7EkQQMyTly+rGLEIULrVBOP5dKMXixMJAuXcRKLv+LE4hhvEBDKb5Hk/0bsTUxusPKz86LESUh+ARxjPUTqZ1E4sunl7QUMsMLEdTrWiAgYkNClxGNNJO0YpPNaVMLEWVONMotmF7Z2PYS4wbVSODZknGLIT3nFugLo9m9gf8G6eJeiOxLsS0LESfHJdhfzpe6ebVywAyfAyGblqGLF0GRSzAfHGtXDHOrdgBh4QwmUa2LE6jTD3AF33NuIPugpSHuS26+ei0LHcNYUqhDoZbEOCjT6MQrCplKMKqLEmV6yzACfyoSmD5nqejXR+7/MmsLBpjpQ/w5jYYPp3ckC5JSbua5RGiLFBWpLUa5n4Rhm9SfoAVbD50seGgLCYVpQ7/BtYbD0ZBh/Ni2ZEL8LUMLCYVpB/+B4Smrwvuyre6fH2pEQF8LCYV4FueB4SorR3nGOaw5UsLQabYLCRW6yxWh4YM0WGKlWLYcd3dIbPSLCPIqFqwx5YymqZ3ZAmb9NZuw9hwLBKQiFuQXnYCOoyx8Olz4GRaPw0WLESRqWiPFmyDY8SYeE8BVMXpcGpeLCCfiFqtJnMY0oixPTqA1UDSaQfYLMWVSW2bRsxpJ4xol95Zps8T+WaQLG8NQcIhDrt3OdTK+bWtZV20yPKoLF2WC0qgPVi6uZrFL6U3qrSETstQLGkNR6RBXckNFyZC9LwiJowjDKnALJMNPHmBHtaZ1EywTUOBo49TYY/eLEYhQJdgYwtEeWidaP8FZc14m0MaLJENzQ7gGq6MiR2lsMEeJ6y6MK+ALE8riQ7gr9TqIlfd1xZQ9Ts3bxqGLEkXdJdgCrVGbMN+59wFhcqPrSfoLF/tQFugjMABScH3SSeJwckHXx3gLE/60w7gCrDr+IkH82lwdxD7K8iELG4Mjw7hKzZMR0FGp5Y73SFDh7fGLEwhDh/hodvc12teGn4dViKCA0ukLFsGiB/gCNYbIlbxlCKCdlGZNhYkLGLqwFuhBmWxLHDWNk9IZqNbVK52LE6A6h/g1mpdgEkLrdaZPZaWJibULEcXnB/hki40nvZshQpDLk96MmfILFMNTh/wa9ecl3YFAs7WzUxXeJMyLEeGTh/h6V6Wvxekq6SvdDK/NcZ6LC4knUqogwZhF1xoJ0L2+lkJogvELCKjOpdgXZvwTEe3A6x3s8ljZFtCLGoY/JdhrLLT97NHGSho6iJTzregLFoAtJdoUKtWBqEi3DjzJMO5cChQLFaw/Fugkx+wjo7O4paI9z2rUhK8LEyjjh/iPTmqW5lk80qdzdfTzP5oLBjnwB/iNc43su7HIJzzvxkY4W1CLBo3dlq5Zh4Q79EJT3RLPFqadQKmLBw3Qw5PRmYHkGHKbyX9tTBocFqaLDFQnB/UZn4djriLNg9Aro1MZ9GWLCg3iB9hZync0vb5Mi4pfrxFj+c+LC9mOh/gn//7sbcI2yNYzkLM1dx+LBGZiB/dBlMC0lS/zAYUPPO0Xq3sLEfsdB+hjmNYEJFztmBrDmvo744aLE4hiB+gT5N5a9+7SkgHkwwLbYN8LFEdRw7Q5glj5n2JVQUi6c5SadOkLG4qAtIGnZ42L7GSRhbKZt9IOH+ELExv0pdAmcHCec37QqnSzTjYsYUALGQkjh/gl4P2QXtk7oTwP0nbenlgLCC2dh7BVbsOkNm3kDx4z6nfwUICLFJy0pZjG8phSIKSeijYlNlm4SMKLEdB4DzIrzqQv1KZzsPveJk/q1uULGBHfh74VntqIWkJP4jdGSiLR1PcLEsdnB64pks3rlwfQ8p4+b0Z/YMILCwRzB7olxS0cCvY/jw1prdKjTLQLFtBnB+i6+vGxzwRDOAZ1xeUzDoiLEQPDB6BMvH/xQ+cJZjZi8PbrXiQLFNBnB/gb9ZRn7ajAqGOROUYj5/QLCIRzB9g9k4cGI+KpHK/K6AJT5zyLE9BnB7jDmwSz6RIkPTcdwJfBdRyLEcrsh+pCfNHjSNoxi0jg89xx49CLFCLiB7goa9Qip7ZwS4jbhGo3ASOLFMddh+jDvINtuBSlBGlLrsbwR5ELC1BiB7AR3U+srvCpRcBtAFHjyXELEdYQB7HkgyzNy8UmKh6hVvrwSYOLFVm6h9ojgMd2Tl77+dPLYTNI4V4LEWZQB6hY1Saz/ja4WkRR7PAN5QkLFVBQB9hWVSK/sisRYjTcKN0f1oALEoOzB5gOuv9iY/ZdrhA9QxdYS28LFbgRh+JNzZuTqSHQE/HruxJzVDKLCaLzB+sBiQeKQAhC5JwTl5wtt4iLFEdRh/AvwPK/mdBCvXivWQetoEuLCNBdh9qPzJd/lkEiPB3uA4RPpYMLBwInB7Bpn5yJsvdriKU1oWeaId8LCSQiB/1Jy6dW/kA0wa1tOkZHsFELCP2nHiCZyHZ5wQdLCGuPBgOPBT0LBxKnB7/hm4L3vBAXw1ecgj5GNLULCho6j3e54YImb0QcT9DSmyincnsLCpP6w56R7YHWIPvcU4KOGV9lyKKLFRP22mTh+4CYfjr8lI/adw3ED8ULDQphtMlT/vS5v7q6OgZcMNg3b0WLFRPDtMrD9ybtstOKt9ah1eZSY5QLDt8zPEBR7IRhaGlCUicXZRnhr0OLGAVDpdkj1mcZ7OioAOHtczzPArmLDmd6w7olhnk8G9/tQ+ZqVkFY4BuLCiViB/gpmNIcxPe1k1FmhZZ7Gv4LCOKzB5x5maeODf8kkgm0GU2Eqa4LDFYDh/ktmZDjlVWB5PbmPE2fis2LDRX6h/V5jZHSEskXUK1jJslcqt4LDDu6h9Txmy/EgrJe9OBrEyWJErULDYpOFueBmYDlrXhax8Z3QTOWLd8LDV85h9+hnNMzJkyWzAl1jcYaDmsLFV8iBfvhnte03gbSSTvsZhyQJk+LDsPdj1eBtYJlwrRTIUIiLyy9utMLDTcdw6kBwvHV+2lIhxAu9CodpP0LEdYnB/nTHnKb68CmFJ2tHcWM7/ELDGZiB+h5ytSOrKHbULjVJKy49NaLDC3iB/hpntZ2lZATjP/Ok3VNw+ALGnfOD1RDvtLJwio4hHzhqqOLdimLGmdOQ7/ty4FzlHDjYk6McUn3HMYLGNQRj3cZn4CgWthm75A05DcUzjGLGNQOB7vhtS3Nz/Zy0K07WL9J38OLGOdhh5+Rn4fj/GbTIFehyjMeagYLGFQOB/rRyy2rrv5WlwGSSLskj5SLGFriB/rBtYfC0V++BX3UWLF7nXsLFBLOB7h5tYcD1C98WvHljqMlosqLC946w53xtYLEUIHvdW9SYxlNzOwLDCh6j2Q5tYfSe1F7o4woqm7itYyLC71DFqlJ4P7DFGhe8aWK7Mcg9R2LDI36j3GxZNliBFWShP3C/kYejt4LDQ32loix+H7+K1KhpTtHHobMLqiLDD1iB/wx+zBs5B61IfXlql0jIgMLCpLnQ7jSvIFHwJpuRvkpPf+2XZSLDmZ5pcsINyndUBFus+IvCzKDsYMLDq2dj1ByQQ4D9byBjwO1Gz6P5yWLEStdh9kJentAPPvglQLpuFWlsasLDihHSxAW28pk4dhiOZaw06oPh+6LDokRB/wfu4i86raFS8pcvA/LDHeLCyhsh/hE3NI1tC9YP62bCbGSDkCLFA3Rh9CP/TufrTeuYL2T5jSeMh+LCePnB+gt+YMj91cgN0TN/BWNtWOLCS2iB/YWASzsj4m+DkdTdgUVQXsLCYf/JdokgGFb145UNUpxyS3HLWsLBn+dluuVkY39nCksLcQT3+epyZqLCgIiD3WptYTUrHd1HSXN0eJfB5OLBmaHD1B544ZGuH3n0qssYKFJ5jMLClYiQ6rR5yyurFu5kCi9L8YFS8yLCkdzQ70J55LAKCmsx0vTom5IUmCLCoOlnmF55NRG6MqZTGc2zQalrDCLCLunFqixnTYP7sjaXA3DcDpT0IaLEVcnFqzxkNKxro9jgIBKe305atOLCw3Qh/S5g4DEALG52smMZKaZWtsLCKI5w6zRgnd/D6UJH9yvSOJDDKILE8dqQ5wBpHdCshjpxnHQX9gqcaILFmZFB/gNV64+HOmbMhkuQT1OeOMLESIiB/hNxZSOo2NtiFO0NlG5IiuLEsdqB8gSpifY7q8RyTBlmdlkYJMLEahCh/pEdnpsQrggJUtx2QVfzY0LGiodh/xjEsa0eazxzJhWc3/aPJYLFmZDB/iriS7PY8N79h1RUibC3lKLHGZOluhZLZz+eqJEVBpuH1nNg4CLE62DFskll26/FZtGxuVh1sm7QJ6LGmZ6h/gPrYWCXOBfGgZK2F11P6eLGFBiQ7ghgynA4Hqsx2tj4TH6CJiLFq2iB/hQbG6+wagR7Xo58mTMeJsLFqhdpdh2wZQKGgXKF81R0wWJZJILFkddluh72FgV8SWjoa8U4Uxc8QyLGihiFsgCynpqjra7IsQl4E1JYD2LFoOnB/gEiCpDmpHt3oJYiAs5oUCLEdBRh/gkKYn19txby/g2rgsPRJgLFCh6h/jDokigBjMLCwykGesIoO+LC1BdFshZl5KHdC5ETCCmYxPO1q2LGlk6h/gvgNHmfDhNaloe8D06PCqLEUdRh/lkwmTljSwxrB7OLPHAg44LFWGxJdIDNYVUBlu5Cb6uUJqf0+mLEYkLYZkP2YWOYnLJCoTFPpwlFUoLEywhLVBiyHc+ylgj8lrOvwxYlgMLEcm/NMoFZyRYFFyzUhgRq3XXozWLEYlhaRCiRnMqNIg+7jxVUvxhSImLE9FhNMoKRIyqPxDsiLLHn5ywJJELC8QtLVAsISxFtoRBNfQ+pWUKUa6LEuW/Q7goYehJrPGQGW/SW3OSWHMLBYPRw6kP7FCztbdHJIb7VoQd/meLBoP6pdyxjDii5NdNwnCYJJ4QwnYLCRLRh/yxmnvt6UCsH1WnllqwOquLC8dRh/h5n4MVsvWnZRYuUSdoKpkLCwinB/pBnP25oZhkh77aV9YDas4LFAmRlspDxtp1ud7ECWuuGczYLteLCEd6h/kNiNAE+qfyL2k30XPJR0+LESvHj3FxiE5Rl86OVbN7Z0aHdwsLCwRih/hJjx+y87QVR/0rkFgR6IsLGQQGB/gLFmR4gu1eXMB3QTqkoVkLFKhDB/hEg/YrPbffHJShV9rB9duLCYOQB+hV3UWDvGeL8sAT0/jN8lGLFMrzB/gB/4Tocnsmj6s6X0eUXIyLEUd2h/hi9kzTX5uFzqBUiilU5JcLFGZDQ7gI28NLNmKEOxRS9lrDemiLFEdnJdghf4RrnERRwZiTdwomnxYLEaoQB/kUg5XVhGoI5CXnn92xcCgLGA3iB7gC66826u6GEJNNahmIqKALFKLnB/oY1Pg9gcmmC1AuicQ0p16LFCuRluoFYTAhmWQ9MUxV4VZY4w0LFSIQh7gP7Y1kBab0vCXI+rLcmjALEdBdh/BGDNK0HHG+BcHmEYXFmfeLC7uiB/hGbC484mleilteEdCO6GYLDVBzJZzD8GQQbNgk0HQ9rx0go8ELC9BQB/kAkjpvsfXOUZddux2xukOLFUddh/iWcH1FwuISgy7lFwL0GaOLC6JQB/oBAUAPg8f/TpElZWjKcX+LFpP6h/4gabYaOLPf+vEpPhIjzBYLErcHh/gHtQCDlP5xII2Z1eKHPbkLCzj4JdPxLszdfeaJcNEsqaoBi9OLEuKQYZ/Rm4ED1KAEkc/E1gXjzc8LEfkqB/6Rn4WkxVmKy1kfbzoJdisLEby4B+lpytW3LKs0CU4ZOP8lxSYLEzjRh/U54NKVw8dMClKpaY0GkeWLEzyDJd5Z4YVmmIjV92VNKIy25CMLErynQ6jR4Dir+Kqw59hsaMV93Z2LEef6w5w54If+FNMuBAUZmUeY18ILETyiB9mLyy/Gr2Z2W/tzE41desGLEnbqQ7gEKSuKn3AMQkqyl9/TE4KLEjc6h/oLhSrYaFE3ylSvEHQYQNKLE4fBFvqbr6Zph+F6PdvRUcaA0yoLCcddpZknhNch3gjywmdnPfkmEKuLEaIKB/qK6vL1/If33HJXSlr7xoyLF+PqB/gDo0UarfCZ2ANll32PZZoLC0drw7gRpApkEvDZwIOwqZKag36LGWZdB/gD7t05LPJpOo8kzsSl/SALDuZqJZpuRybsvYAkcFKe/Yb/pTCLFVrdh7BbESetyjGWUghUCaKmSy+LFBLHluRv6NAbnY6cbxLH1Ymy5OyLDquDQ5kkhijpGE8J5zY+0umMb1wLFtYQB/Aph5W529K3xjkuAQONaSeLDjgHh/NmEt/ZxE+t6nQxUdKShbiLFFBiB/gEEwZmnHrUnjRs8DZJ8sILC0dnB/pUjNBr9oWO0x7Yzi7QkFgLEcdQB+h3vJXnr0wTEpFKyiY6Ex0LFFBiB/oUuu0uldgRNXb/P3cGCOeLEcdnB/CjMnuXk9yClqGvD0ELBqGLFA3iB/gG3xAqif7THhlcP3p6th4LElBTh/gtgHlB0UhZpsW0lKAWR9oLFAR6h/giapCO7uszt9kxkRhx2lgLEqQOh7FV9zaqM13mWtKs9KToL5+LFmWDB/wC0SG3Et56CEiVUIMaoUmLFAO4B/gyGsxh/AvEDCQU5PWeuOELEwk1Jdsn6u7+vImtS6FXi4rlW7aLF16UFuglGzeMQkM1zHQzH8DNtCWLGynvHmAJSGZIoyIyes33I2RVKwCLEyhRluhJ2nY3ofgSC8gz8EfpyFmLGj1zUqiHllg0O0I3R9oEs4V9oq0LEqVqLUCGin0a0HcAek484RCGhRyLDDydw75ti49EdQR2eTDtWIqO3t6LFRWrUqxp45JuNMD3C4wwMsZHHgsLDRPdlu4J5tB4S56TW7th7AkN4eSLDmTzB9hD5DfMJXoVnAUmmAWO0wALCJPiB/BZzCKMq6Uuw0SjnDcsAToLERLzB+wLqT/oU/VU9Yw/Jo65DV6LEeLnB9lDr5LdsY6pIeDqCEX9KoyLE2ZiB7jLyy4sojUe3GRzCLLm5zmLDuP+h/kDk3h4g1xnDNSQ0VMmdBOLFOVqB+hAbnX00zzrk7yLyUwYf4GLEqInB85leE/DhdGK0Wi+EaqJM/QLFKh/h9ILzSfMx9PhUzsvLIcxEu+LDjudh+llwFMCCBSEdkBXbbs75dGLFdBOh/kB8t0CF2BtKxWzU8O3MTiLFMdiB/kvgml+vfxCLXEqu8bawVmLGgkQQ7hBK4CDtytfwmcp5b3tKyKLFFc5h/h7nyqpN4WNDyxyFFSCoKGLFChRh/hhQlqNoZGdNOduGMkYK2SLEaIdB/CEHHKvdrPVT1CQZpoTmnELC+ZdJcom1cwUQzvq6tlTy5LIcD2LGF46lqClKnzOZ8ar+gE9aj8y9C4LGGV/HmR6ksx7kAH88y2mZIH3QgMLFYQjtI1IHnweBHGlnpAUdWVh8v8LFIkjj3WYGyZOysM+HqhLUUrCU92LGCjOw7goHHunF2O9p+kvD+gS3J8LFgltUqgO3MODq/A6lRlL06IXHyULFgAYYZgIDBnQ1vmLwDjFC8WQhOWLFy0M8IghHjAr14XetNUnGPKI6c8LE3Bv0qgBOn792bg+3/9Yt3TG+waLFtmj0qhBBzNgJaUZH923IO0vc64LFihRJdhW4pTS7wslkISbSo8KYMCLDWUnQ7otOtMdshNWxxJpFq61u9ELB1rQD3CK8ZVbs32AfoCaS6O99lqLC7c4B/HppTr5VpA5vT0+dilfymKLCLg4Q6nh4YDnII9IpUk3sjfJ/GILCOZ6h/lZ4WruSKIC9D3nmS7FU46LCEdjh+4JOt4vqRXb+j7JuQRcmgyLFShdh/IDIzXtq+zcpD7lMZ7bZpILFqLnB/gUX7IhoWcDVqEyWW644DYLDmNRh/gNqSy9x/jKBQpnxPb1PbQLFOZiB7gIfZdujOQ8teGacBpV5CyLFOVnB+hVMT2V+Gj6gXdUcz1hGx8LF626lshhD24SCK6GP3RLitQJup4LF2VrB/gxOwL10EkmesE7SvFnJ3GLC/vnFusNxTgNqcf7Rv/hFdaUkuSLFqRQlugFxnD4KX45eB5kvv8FqleLHD3jh/sIwTipo00S5d7dqBEXwyULF62Rw7hv05Gjn8JhL4D2SyIRFC4LE6l6h/goxc8IIt4UeSEY3UTU6RALFGVnJdgZhCy50eEGSgZi1TOZExkLFqtqQ7gVqtCip2gdjlO+VCCAYqeLC8rQ4YhhgzmMITkugX7DT9nlpe6LFNBiJdALrNDkqXEyQD/00XVCtJILDaBQw74tnVxgTEiV4FVeHHsq8HiLE0dzDzIWoNRWENkEQzijrsmH3miLDOZKB/xLGYBD4HSBvFG15PBnamsLC9BdB/gLEJQyfuymHNvGXzp3gYMLFWTzB/wRk4MwZKxQ6KWt56uCbwOLDcdRh/ikGPhZjOWeqDGkTteu5f+LFRLRh/gjAtFx+1y+Qcn2NHwldA0LFSLqJcRBh4Gw7TA7fShjFseoOdaLFEriQ7IktMKyzfqprnbw3vCk93CLEw3nB9lFyodXvCo2GQZ9WwTmkEcLEqtRh/gwaQQjkFmVCfImss3l75KLFrBQJZonQzUjsN3iqmKaN3DtG2ULFACjh/iXwS+8SKpZvZeDpNNHwWwLGhvdNMgBfY3ftGQ4yZ/zuivrGkwLHHt9WiAhKGt/itgWkR14nXx24AULHUQmnmQ1TqTPEb9zLlA6sBaKSncLKEGMrVBJ451x6HUtovFkqySB8paLE/tO8Ipn6vinKxRJ9zMKqNaN6WQLE/vX6RAobN389phAY8UpjFSm0WMLE3InFugDp0YVkU6zSwRfT4HYOJ6LCKVRluqLyDJ+smeqzhjDFam72k+LDA3iS1bxtZF49gLlxwrhM8CR+/2LBoIiFulp7YJGwGtOQcNksXW+JpeLBpLvtIcJ+YSHmYmYN3/jylwdNc8LBbunSzQ5+SsvxwABBThpblSsmt6LBhLRpZSp+NTXiDhZhW0Kv/YYdTeLCRLnJd7Z8tQXuoLM6rftOSjeCyWLCkTnJcvB54DlrSMlfJrgn9b1xGgLCJLnJcvB54AD2RGDlafWJxJaQlQLERLOFsjZtNZZobHFA28fjMP7R5ALBJLnB9htL5pHqJN+yhKTLMKVxbELBCLzB7QhKvemaphWL0Iu8NM8Gx+LCGTnB/m3epUv+Vi6lDUxtpPF8GGLCA3nFsAQftqX2ni0T9JnYZ/BzgiLCA3nB/jJk2gVp2eenKdpKZ33kpQLET14B+pZKyvZKmCjDNGYnyFUenKLBI3nB9FxgQ/P2sOKDJNVaoQ5sIoLEKLqB/gphYxi+FKVPHHUVHTa6sILEahRh/oBPuYX/dmGXGmTNFAfAaULFKLdh7gVat9+ISwTyVOSxiVuUisLGmQ/B/ih5wcylNILyH0WpgSNH8ELFscvJdg35Hzrpu3eE54XGwmWrGKLEYY/LVBRxPVevjgFPf7iiMVPwqALJEUMlugxayargsHvK45I2OoVNe6LGhk/B/hAfa+JBb9ZDlp7G8Tqhu4LGjwYaRAAJi0u0/xKDjnjUmb5NmmLFMHd2iAweGp9eMxTsnpXUk8LwEgLHWz5tMAknYz1fUsDPe8mQpaC+AeLEiV6w7oA1nqYMhVYDm29N8UnDwcLGOZdpZkmZ4UxmBxkSDyK4kcTJY0LBdQ4YZtpiGlbb1WBYyTlj8JiNW2LFBW6w5PBtYPWcKfRB1p1LXZ/ooyLEbyDB/p54YNm6ndV1RphXvobVgKLEWsDHkNx54QGgE1OdzL10JekipsLFOsDB68J54UEn7Xv55NaF4/LekMLFLyDB+455ysI4B2TRYEeHlSiJbiLEaoAJcAj3uenjf6WTQJzowYC5S+LEZW4B9EfnNc1FXc2C8YkGGaeDMuLEaoiJdJxwMrcxTh7IdMSvHdA4/ILEHH6pdZ1hvjmZI20rra+r4sIVSILEWZ6h/tFh5MIEwo3i9grIM+dR2qLEAXQh7gzrYZmLszps6sdRednzDaLEioiB9Cg3Nv6qU8cKWdMnV1iTHOLEVBqB/gBLfTm1OobbXW1P4KJW2wLFtBiB9pBmuM66pjDkImZ0ETGeDGLE1BDB/gz/t4OmbmA0luWUWcO6JILFtB6h/wjgjqqDcN9lUVVbFqCS08LEUdQh/oFJyh+BJ/iQ1i9PyyND8sLEq2DB9AqcW+CqRTEv0rirjr1yq8LFNBnB/wPnaYF9nTUK1rqjvtJmckLFFczB9pd1CcQfgsu0FpjHqUYZKILFOViB9gQtNr0jnRlzZ6hmHQmriyLElmzB/lhgrwCV5jEYMPazNlsc+mLGiL6h/oWNsa8uWhuF04c5xLEebyLFoknJdgnTt0T9/wDk7dtISwLtHOLFqjvpdggxawxn7qDD6vYd2cRcp8LGgk0j3BBk5VsDbwAqG5czCT/SDqLE0q/B/gdyd2k4uJTHluTJClpHUmLCyhOh/gC+up6XOl2MYRxpq4/JMALEdBRh/ArzNidwR1GSsY/LXIVhegLCEdnB/B//5eN0VgTggdKtHxoyVwLEShDB+hbnMqPqaeZ62OqcZ9rAN4LG2ZRh/ga9GAx+WQRoQ+cpoX9qHOLFC2Dh/oVxaYauelDDmrR3559oDyLGkQVB/gsyNcBaWX+frtmJrHUPY0LDSujh+gl1Fsoe1tWBa009rzcG9uLCJoiHgDcf8wC1jIL3izx2gUuNJWLC/sqD2OpypQYmY8b+gCqo4JBW4+LERLdlqYZtYTAco9Rp2eL4xv2EDGLC1PdpY1J4oUWX6S9LfXzGYL/MMMLEioqFuohzSxohU4aqu1baa+QMtALDvIzJdoLuNhkZdA4KUWzOjriRcgLES2OpZod3SwQK05gClBltYyg0fELCCIiQ7EP0zI2wHntXUxdYFyZoU8LEkriJdpBL4Qg4pmRm3jx1Cbz1JeLFqLdJdgrANDqaWQyYs7WiIFnLoSLFFBDB/EAfYGtRm6hwK6kXvHPI0qLEkdwB/yqWtnbSiZbq2sxc/YjCYOLFXtqB9wvvG/yiKUg9LSznxIbDF2LFKhnB/oDczZbyqG/3bUr3neZZ6eLFsdqB70h8AdQqYohzbwXgBSJDbmLFS2dpZCH2TR91iaBvsr5x1kIjnILESLqB/oPZ4JWtt6pcVFYu0qX37OLEezDlorFYt4P5R6gQ5bTbxOVqksLFqjZLVBjIshxYT0L4mktLmOzfdkLEzKwSzBjMDnVIboKi1Q0mWelLnSLFM0tB/oQfMO348ygjrbqWW4oHFwLF+pnQ7wBDyuCujsuoLavMzZQ4ryLFupM4Zgv4zH7kpRtaEUTYGwtmVOLJFFsw7xAZ8uizLI8ivPGnkIVSzQLCxyRpdhxrGxLqEEv4eM71bkDbJcLFOWjh7kzDt7Utsueo8xHkdr1T96LEwk1FuKHtGrUl2mKO7/Jkr5ELZELF2WLB/wSf6dsrca98cI+Lg2paWALGgZ/Q7oN4TukGxTlr/2IIZjEPueLGkXLFugqpjTWZRjmZ6YG25xV7lGLFOWLB/ArXNek7kCc8k3L7rdK+ZILGntLUqgy/uoUJ8gKZAt1izvHjq+LEtBtB/gFatFTgn4/EfxFa8gMzW+LBxLiB9ijosMU5/phox7e6Hm03JwLC7yzQ6sBtRG0ZZ8PYLdxUkmENCcLFHH6lq1hbT5QWowWQzLsacbFl7+LCCIDB7kVPMi/F75a4oWTaaRNZggLC+ZiB7i2eHz8loTVm+QLnIXwaKQLCzcRh+h7jYEJ0kcuQkXStFRffFcLEiQqB9QpmS+4+9F7tgI7wIYfVooLCJW6h+jpmzUGcftrgAOCmidYZWkLEcdzB7wrr4JMEp8sIs+LmVLyFHkLCDcnB/hxL5w/yA2tTqxsbVdyxB0LEWZDB/h5gkBpSfM0eeWyEQMLM5YLCC26h/iRj9ACyuKfOdcRTINZg6ULElBQB7w5jO4h58XGksgvW+cDWZELGGVRj0A13dJfge8pdDqszMl1gq8LC6IDB9Bv6sPDTp0DA6x3YYhwtAILFsQjw6hjiYFqh4v0wVYgra2olWyLFNm5h/JhfOfF0Q65Ry1R2LQkRZ6LC0QMh/kF4Qdfzvqmh9pyO+CWRIKLEawYJZgOt3f2k8B2OxFY8MItx0WLDqwOh/jM/TXJfLat2BKQZgVdamuLE8Qmh/okgz2LFlsF+rqwwD8e6oaLFolYJdgArDz6V3zlVcgb5eRkPe4LE28JpdhDsDmcfLylRGiXNioSIG0LEcdqB/hK/YAOybICsleZnIk5N7oLDqInB/QDitShrkmxqyOF9cmWdj8LBBWiB98hKsKeyAucJWkN3ID7G/YLBPbnB9Dw1YNHzBS6Ofyx5bOoXxQLCGZzB9uBgH5+AOedJlOQ4alNxyaLCDcnB82A1Yf31rQ4lKHjyuQUKLALCEOiB9oZK5lclXferkyYzf44a4yLCBLDB+h5gYHnQsP8SvVlkFl90+OLEUdDB8kDqNNRFu2jaU5SySybWECLCyIRh9pVzHZdrVsrVu5NtgJ0U0uLEaQzB8wI1bP8ET4lPAHmYZkD6RSLFC2dh7hS1XQLiC9qJSnLpo6oI10LGmZnB9oFKtpl0Nchcc7iTaD4spkLFqLzB9oorCr4cM0SCBwz4Sc4xHELCdBRh8g2i8lj6u7E1HOJuVWOZZeLFMrDB+iM6N09GOF4Ry+q4kTLi34LDlBnB+gRujXrzinNRuVYNdwdIkkLFEdiB/BE6oiO4KkUltRxmVLWRGmLEcdRh/hXd3392fgMthHwqLwcpgkLDmZiB7iEztQC5naUwJC1Eeq5DrALDUdqB/gDCSTglvhj1JZyope6T5yLFiJ6h/hTjEhcmylDpmM+SMk0ZLiLDoOdw5BjNCO5pvJcyy7NHFRtqS6LFCuiB9okJK8OxdqlcspyIzibE5SLC1cnB/gkf7A96kqSIz+okF31GPULEZH6h/ATUYi+B20s5067n2PZPI8LFUQdw7oVkHi8IQxdIFsfLGEtqx4LFoW6h/hxqZKKRqOaCt6Ti5eIGccLFAlzB/gBJ50zKKn+cdxl16KrpJILFoAAw7hHuroXjjyIvDTpwZvv4x+LFFh6h/pQfYyIeYyERMM9lE6wLfKLEQZiFoAuzgbGuNI0w5djRn3YYM6LGgZOD2QDKFppw7svpPtkgG52daaLEmVQUqlx9jrZnIh9+TVUy8qtljWLBMrzB/x5mz4QWiPmJOCwnldc9bgLCAZgh/gh48bV7NkNBWRymW+jFeELES2iJdhp45gW6NGW5bXMTTpJutALGgZiB/gPGNBE/pf0j5S9Gq25AsELFBLRh/gGRNIVzGiyKrbhxj5w3u8LEwhnB9odpzstqeroSOoVapgH7yMLFqI6h9gnnMZwyxiUbCXTUOl4qu8LFChqB+jIbjyq1dJsvtNPCZoBde2LC1B0h/kLq4x+UyDllywYvqNMKdsLFJWdh7pFymsdhGR6Bi90a6556x8LE9mzB7AFwH2WGX8GrdNaRonOhZaLFGVRh/hftniJra0SobvU6fFumQwLF6J6h/ghI4o4Z3hh6UnKLZlMZyoLE1BrJZwBm11NyGg5FBKecthU3sKLFtBnB70Hzlbp6qE6PhWNx6oiLUsLE0rPB/hVkThNxyqUQYlGxZ5wJSCLE6UnFuhprXpb0SJDwWSss+qPHhWLFC2jh/hhm6S2NhnT5XVqN4aX502LEcrnB+gryYEd+vWTrF6Ub6igRuCLC4Rjh/k1wpFcX04eBf3R9tnMr3ELEghjh/pBkQaicAC1fnpWZrJ1h8SLFpyrB/g3H6LBos27QfWTy4AmacoLEcrrB/inIyJPnARKXL1qGVdDNaeLGmGDw6ghjYusX3TOYJ8rR0B4lPyLF5HFJcAmCsGSCln5EO4KrtNz53eLEYltB/IbgT/V39/LWknOUbeMfj+LFuWDJZYLgGyZvcfYB5GmUPzhdD2LFKLDh/hDoy3U1ziWnsI31azgDfoLC9BOh/gHxTotGfgpCcI7VZOWdOILFoOTw55Eeyp90LvFIHA0YxpoIq0LFOGtB/oTqpF1lMrV1ozDjdMHxDSLFwkVB/hJLEM1Vx77VP8R8dRIzPKLFIk1B/in++vi5jXBp2X2qb6gW8MLE4kfB/BxtlPiuolSwD+dsjfbWIoLFkmVJdoMfd2dGdRP96wDME3XcLQLGsQfB/gBqa6ExfkyvSfjaVdICNSLEiwLQ7h5iTLYtFHDM35J2UXcUPQLFkQtJZgP4S39zuZr/NM0l5bK73wLEwkMh/gbj8cfy2nKyE8jZDq3nNgLEWWfJdgRK4jHgOiqBJfyOyz0ajwLFkrnB/hFnflXo5ZpLe7Ivv94PNCLFIQgh7kTDbV/MqNcjj+n0LSQwbeLC8rQB/gAQPRfxKRR7wZKXlYgceiLFUdzB9wIRV5EBW81MFY952RxWnYLE0SRh9ghgPZtrOL1ZGlnIapDpkELFlBqB+AQhoGShQ7uy6BRiHlgt24LFEdzB8o1wu8IBPPP16E8CBu+PjwLGtBqB9iBxHr0+eh1nyPA1ix+xhgLC8dnB6A0a6fTtFEIkcAvY59ltEeLFNBDB+oOnT11AruH9iam0pe5L6mLFEdzB+hjWTHaJ9lnoVrGpVH3w2yLFGZnB7AphGy3yldV3FyGdaZ0pQILDUdOh/CD85D8TX9GSmglTNOAZ+ILFuZnB+ixssmxlcnHaGI6jCssa3qLEShqB/JI9nlm8jKaLlY4SjUMMRgLF2GHB/jhaPZElZjH1bgCmwMc8HkLFIl7rVABPmxM5XBgfHhGseatHuALE5Yspdh3aNmntcxiaZF6chpF3UuLE+pKFuglxiIawXwbBbfnpflulKCLHWpJJdpRgnzGse4nF9eckWYFq3OLEkGnJdIE4n+L54hN0NBBdgw1IcYLEVBBJZARxdVmsm2EuKSeYxN2E2ILFwRzB/BBq6qmYTQJbe2cw4cKhaSLDoZwB/ghvng5HVzrK7GhyIEU2a6LFqQRh9BQevLBsyOK+Im56mYdrpeLDqhRh/tGj4BHrSIYHPffQ/GFFwQLEaIQB7FXkCTP3aXOTHDg1g4IOn0LEaLzB/jBKygebjqGd6HizAWfch+LFtBQFsoTIML77OJNVToW5mAcaawLFKLjh6xt7MOeitcIkgdynGKY7VCLEKVnB7hXf1bX22wMK5wq7uIL3D0LFuPOh/BRhHrgSzPJlVGZ82K7408LExyQB/gX5tQlzWtsMfRxzeQWTq2LFoXOh+g2tY4AdA2VJTeUKO74BqmLEQRzB/IcpNGICyVvhk0uw80rP9ALJFBnB7BhOHSz+B7Cs0ZqpK9h2A0LCdcOh9ZQ0a+sXSLI8e2lZ5kZKZSLEmVnB/BA1NLz0JikZNs/eV5SUECLFKIQB8gBNG8FoffgdtVjodENFQSLEq2wB/iPWHiDOZRz++ZJ9pHCbOALE1cDB7AMln1lbrbiCPaLgdYajgqLFEdiB/gcgDh4gaNBJLR2wixa+FGLEasDB7gTyYZnZMrybpa44lxsXG2LFJHOh7oFwaUmNX2XdB4ykUVHx5yLFGPiDyBiRYQQvw0y6SrsNIPGpSsLFqhiB8gRrmNA4j93vhE4qa74ccsLFGZ6h+g1eN06MGqNATCIoOtN3tkLEYRqB+kNe3N66UixSaktyMnXPzsLFMrdpchYxbHEXCACvTZdEkJW86OLFsGjh/plf1VqZ4X8hDPV/onrj7YLEZgdluhtyVjMECYQmD6f0fOZ4BoLESkjh/gI0orWLffIqPGyvsQRhpMLFyhRh/iAf439inAluZpucS8mucOLBsQDB/gcxyu/pHTpinEfJiVZtACLFNpxLUAW9RElzPStILMczxGoC+ILFaLBh/hNAybNs6hEtXD2lEXU+jOLFAZ/h/BEJSbC+dvuUcUi1lLpkcsLF8HfB/gffWeK4WFk5Ys/YXDaZE4LEtmypdsFbJnLWgDvEaeki0PVHjaLG1MLJdgKmDzJUlMHdelh3eREHhkLFMrmh/AjI4KNdv+25QBePULbfRALGhyHw6gVwNHp7v5TvXLjYZD41xwLEdBRlqEAnmbvkmw+wtwliGFgx6GLGtBDB/oGnJDxZFpKSgG8l83Xh0OLFKIRh9xK74MfpjLEbBL02LCNsPYLESVDB/h/JS1BW8IJpWi8lU7KPs+LE0dQB9kLrc+t/WBpT0eQ0/zgTyULEa2zB+it1NOMS1JqxLeeNXNoytYLE0dzB/gTEiA8eG40g4e8HT2JpFWLEahiB+xCe5/mvzhiC15VKOgEb1CLGKIiB+ATiGmyu+2jgKEK7OZbrCoLEyhQB/VidFhv/47eDZaW8bR5LjeLE1c6h/BVj9j2QwZtoilNehG+ZPkLFMrQB6Dt3X9l3leEwOOXEiyN6QwLCcdiB/JkkS7KsdI8XJPNLTZdDksLEih6h/gkOtgCCJoEHSZN4/6JdoaLC9cnB7AIfMaFsJ5ClUPuaxT1sf0LFcdqB9glhxUqhxN8PiMPN2mWuGcLFOVnB9gTitL1iPpzUwCnm5cyTd2LGqhzB5hxNxYwUY8DSFJlMDbboGoLCdBdh6wHu20jvT2zuHzz1OxOtgYLFMrRh+glOdNt+kkyw5aewllaXFQLFNBiB9Rn3cWM5dpDBvRTDr4tFkkLDA3QB+g80ssfw8xEnvPMxKcVdY6LEyJdh9nTIoNV0ao5MZs6yjf+iKmLEsdqB7ENhW7a8eRFc8QeCXN1i9ILJPHzB9BTln/oZPuNGtlhZ8fNs3uLEmZqB/sWTNJKxGkxHe1h0F2ZKu0LEaWAB/heV4g16TbFk0I0Wx7sSOELFOZhh+hhIRclzsly9B7nEZfUtQoLE2VqJZBpjdympbMV63t2h81bVgULFPt6h9gtwS0MBXajpaoRSCTooryLFsGeQ70LqIkNjjJEdfLlrtbK7X4LGgYnQ7mBJCh9++NpnSXXTmSvlZeLE+MOw7gnIytjTtmRqNobVn0mnrwLFpFnQ7hTnOgzyi8NgIVubkO5iriLF9FfQ7xLDyVJy+tSSilbwypLawKLGiknQ7hhnrM13Om8wz5hM4SP+EULFykRUqwAf8LuwqC+I3FmZY817oGLE6jnD3IDMt0T4TtDyAOjE0o3Y3oLGj0nB/gKctVR5utU0IZm2TKlLm6LE3tdw7hC88ofxBgFEpI2FJf+YmeLFKInB/CLtWr/hv3ul87BvL33Ch4LEcqdh/iBqSwt3YJuFDXmMkTjWo2LFaInB/DztHqDjByt9oxUZMVAVUCLEWWdh+AV0wvvwS3cS6jpkrodMi6LCdBRh9BVa46VoC/7nvtg86C0n6GLFCLnJcBhkMD/ihmTWohFV9WMOOQLFSIdh/AtwnzhgvYAwaDx9DssgrQLC8dDB/FLBmnvJ2bm6UcuFEG3UK2LFCQRh7guA5xtrQLWGc6j2JfqixQLDo3qB/JFftAKxrmBIcqrLgi0c3ELFCQiB/s+jnRautkslBrikKtxIpULFFBRh/IshaDhiwZ5ekKk2dKKlZiLC8dQB7BD6cKznMuRDhC/FvYGbaELElBzB9hLrkqKS/M1xmpaSnl5iP8LFKIDB5BTrk4nW/iBP539AxK0oYALFARiB/xhLtxIozw2hLvRL07TrWoLEiQ1B9hC1RtDsLO6pgcr89cjwXKLE/IqB7hNyPpi87YOjcsjlaa5ch4LFFBiQ4gJwZMAmf1Aq3rvmFJcw3gLFKLDB/ApJzi1CZLy9MFzcOK83G4LEiozJZwFz5waFdy5OrMzeid1kPULFMrDB6gqVvb2oZ/mMUW1j8AH1H6LEmVqJcIpjEmKl6V1hbYbMtHNL84LFqhDB/hnozBDVt22afiaFPwSnZALElcDB9IEhCPBKq924Y8s0vYo758LFEdzB+gYvGFKW+a1oBZkwJ6T2riLFGVdh/IromTfypDEUpOZVw93ojMLGkdRh6gtznc57VSOg+k6XuMT1qKLDokdh+xxhOk57ZTLFan1D0P2SCwLC1YnB/JhkECd3pnEsarw+CDpO6YLEdBdh7w0wyItisVMk87hoOQUZcuLEQOQB4g9maePoA90/XC3EwCdBhiLC1BRh8g5y48dhEvl0gkBrezTmY+LF0SRh9AC6uLnqlab7OPlWQwX8jKLCyhzB95/jzceO4J5c/v1zM0XvnaLGokwB8gD8Ms1VX8AzsSbxHqzgJaLDWZqB+EFOH36vKndTTHxGHMRkxSLF6LiB+hxKwnamoZtmvZSYgH1BweLFahQB/gC9YAT0/hk3a+azL1pK4ULFCLOB5Qv1/fh9XYn3ah5KxcWS/gLFShnB/UVp9A9iw+vAccKMZcLeiaLEyIRh+go271FtJU4OvFk0U2dMF+LFErnB8JBT7/3qB+btHlTSLZE3eMLDuZiB+hkNN8uo5lAxju6iYLSxwyLEShQB9hG/wc/oaB+JZYxbvbnNXWLGiQqB+BnO5GO/BGFMlsfHGl/sxoLD5ynB+App5uj0lG0e3xc0ktOYPCLEqUiB9gH7Dtii2hnc8BG7Sd5bP2LEQ3DB+hg1OFfGJr5FtjdOxSo1AOLFSQOB9lV+mZn56INh1CkBceSY6ULFuZdh/olPsBYZwT/Q5Wi1L1Lgt+LFwk6h/jrU8Au7DQKuz87Hr0NH1sLEyLDQ7ZtyOGVBYJ27lVTpnE7dEwLGuWRpdAX3TzB9XmqF566n2x3wkkLGmZiB/pP3zF8jIkaq8NQWXWegMaLGSLnB/g0gYRPsEtJehi604jdThoLGiLnJZo1x7R51MUrWhw9GH57tK4LFK2zB/Ap4yq0TdV8j8ic1FR4T4QLEtj0h/lJhnZKGCiazBgm0WkITKsLC8rzB/kiNbysFIlampJYaLl0oxcLE+WdD3GpjvRab1DdriebSTtOB54LDokdh/gm4kJP9RDm8QLoXJ9NnQ6LEkdzB/ByWS+KcekGvWVGlRp1cx+LGgk6h7gH3n6SzJx9ryXlel0312iLEtcRh+lxlHmRnidYipU6nloSS18LGJyiB/geWMU6hKBhhp7cHFr93GuLFFBiD2Bge0R2lD4hvBtKruKBbQKLGsdQB/gPnNA5tD9lWgVGKD5mmjSLEeZqB/hzyyiEuKQdhYJOTlGKPDyLFSLdh8hKX6P1wBM1yKDXoyALkP8LFEdnB7whpsYLiTAtF1Ep4k0V0c6LFCVqB6qVKYVssk69jDBUcG5KRLmLCYRRh/Qqdy2r3cDzhNLOM5PpgwuLDtcnB/D1ayhZkQY+DS06bTEWUC2LFuZiQ6KC/yvQmYqV1gd+d9ZiHsKLFNc6w5iF99BEfTD+LrVQ09CLeNULC6IQB+kN1CWhprBN8zlG6GLui6eLE4Odh/AC9SirgH6cJ1rjKnAbosOLC1BiJck3mkwmuWnmBflW4RDt37QLFiWiB+gnPRnsk95F/ogzF5rR7YiLCmTiB8o4en88+KOlX0OtS5aROTeLEaIQB/AxgQDt02rJy2jR69HyVPOLDlBiB7IkfN6alE2yduBLXGJKs+iLFNBzB9EZyoukTmKhwa7bXFdPi5wLFKLnB/jRxtgVxSiIX0jr0leTydgLDsrQB/gC3Wpp3lwjSn6mCCes21OLFCLnB8pmxTOJ9P8E5VQnom4AW/qLFEdDFsAiwZ7ROPnqcdqWGhT25bILEYRdh6iH5z+nv3VKx7i1KhNPXsWLFKLzB7iA0NZUZVTnso7A8OUh9yALFHvRh/MF/ymHhZnqg/N2XQUoAX8LFKLzB+gx9tLkHEdrO0cSyhLBwjSLFK2DB/laxOJlZYBphSHnY3TEEFCLEaLzB/oi1YYwXvROeUHVcsiadLSLFK2iB/AF14uE6NqjTsFcZkEpKLgLCYkrB/AytZLlocyJra67HeqLGIiLEQRdw5g1bPFTrPZZBoNJmmUp0Q+LEiLnDyKsKbcLrajLy3MmUgd2XYcLEeWdh9gCTaynz7ZM5P8qWcR4fBsLEkdnB9Ao+tOx/27TH20lMOkp13CLDwR5h+gQ1JMpS+1lVpDBUJhXWgCLEUdqB8kQZ4dA3egW1HMVZXHXtqMLDqQdB9phktaLNNhfCKsptq8CMISLCwRqB/kBLShWqfpb331hlhYKvpGLESInB/By/FDHlE+pRCC2LmzIYfyLDSLiB+h16QGy0As5Ppe/SXxAKR4LEVcnB9xYadbf0wro5VrzCzN2QLSLDYkRh9gA30alvX0PaUFNtu004UyLEsdiB/qFyZRi9VEoUz3nTIOL4JiLFOV0h/gWHHRIW2te1zs84lHRq8KLEWZqB+hZmxsCnu2lglXUM9jXgYMLFMdiB/0jKNAEkZOp8hCim7tKmqCLFuVdh/AOQNDaPnShKWF5eEVwhx4LC/InB+kl+Gy93gvzpBE50kLhKFULDaLqB7R5btQm8eaVPYGDPKdsEQmLDWZiB/ilezysq9yQreXvK4csEQOLF+ZRh5gHsx4DhyF86gC5bF8zMZ+LDWNqB/jDcSVMr7Q7Sd/aSDGptOoLEwZRh7ALipbdhXPZvhW/xHrP4uGLFBHqSwNAenM0t69w5MkrSrML1pMLEeW5h8gq3bXHfFvdo4pWv4ONpsQLDtBiB+gUtJaOr+Aac7lXSevFL54LC0d5h/gEKPUlanlBrTixLle4WxWLFPvDB6gTbzSffT/U8eGdVx0eB4cLGi2OB+oAzNFBsN3E+ljFH2wT/GILEz36h+gGRC8+N/OtGJJq1BZg/SsLEdBqB9gNaldY0bbbSg+hRxJddS0LCy2Dh/CgeYbvkfHbDwAnJOjVmgiLEuVdw7gic5JT4Ul+UA05rE7XA7QLCw3nJdAgenj95VGL0D0useZtFvOLEa2OFuBQbcDl8Mwpi9s3LrWSCaOLCz1iB/oG4Sj2h9S+EJcs7YaEUdKLFShiB6ho2wPckRdf+zUeLqQ5GR4LEiQiB7Moe4PuykqxDSKmT6IfSacLFyuiB/IAmA7Mz9ksHHWqTSQSaq8LE2P2h/gi2YRsRxva2UYS4bscmKKLFC2QB9gtbtvDil4aJgufK4RlJ1sLE6IiB/0FnThq2L+ODQJ2U60ONRYLEcdwB/h8xNJNRhXBaA/sGtaBm6ALFNBnB/glOqtvzVQqGbEcqCMzbXULFGTnB/RoeYz7lN7DKa2MX0geIhGLE2VOw65S92kvSwtA3OjK5la2cnELGiLRh/AFyQbRmHCbFucJrJY4sl4LFFBnB/RC9pfrgSo5JY2zzchSSJALEcdiB/ohO6985LLpBiyinpIGVSmLFVBrh9AV13Pac4N9q28rSdbNuUqLFI3iB+gW+Mss+vSOycaMkLN5CiYLEVB2h/Byf4D3BEqkT12T09IxaSMLFRLDB/ly/6r1aEh7Wwp1rmumK7cLFlBdh9gGgSI0T7khZWTsnEgObPMLFFBjh8gaf56ieTPAi2m6aIMQZwELEQ3OB+kjltF/gen7cD1NCz7zbsELFom0h/iMhPBobaP6KS1vDUe3xZgLEU7Rh/gZxitVv9j3u6UpbYa7AVwLFHtnB/gC3MRf0Xn7qoXrJK8DrbKLFqLeh/oTUTzJrQnfOwJmFITU4GOLEyvnB/gVJZTH+GJp0HBx0NlrXCALEVBdB/sTz8T/Rms4lYnS8664iG0LEoRdpcyAP4ESfpA/2RZOORZTnI6LGlBRw6iGysEj1NsxBAGMuEqeJTGLE1BQB/UUlA2vw0tw+KeOsm6Kf48LGqhiB9hDPw2Mu4j7PVFntC5EoFoLEdBnB/xn9WiP3A27nHHbFCSnw7OLFIkOh/g7IeAEWsYwHhSkxp7b2s0LE1BQFslT8D5P2WgpL3Lr0WU6Fb6LFGURh/xFb60LqPzdrzdic4LbnM0LFAkHh/gqw8Ef+8+c7LTCO0d1toILEaWqB/oqQykGitbovhPdWQVKFYuLGC2Oh/gWENYIOTupw8B2XCoQDSCLCeTDFuqkLsBTN0SMMrrLM008b2YLFD3dj2ACTWtuWvV/mbkPNjGa1KELCFciB9wody72rVW9Rx/U4ZyHzEMLCShDB/xYb2KpM6LxWpJ2oEdvjWQLE0ddh/hK25VefaAcDUj2JXaUrBWLESRqB/gkhS4g17h+i6ClFm6qCnuLDojRpdBgfsH9m5Qb14Wmo9ZaJR0LEsrDB+l4ey2rZk3lA+ubLLgSSZCLEYlJD3Iof+cEq1oVZUHMj8Mo6s0LEwQ6D3C1xCdMqEoO2ldnHn0UmYQLEQlRh/gL6GlvkG+UeZcvLtvBk8aLFTKdSzYZkMM3MA0M9pd4nLqC21WLE2Mvlugwfba9DcomtJAbp4PsxQaLFPaJHkAoAX78qnRZtLPbrpu2loGLHQlRh/gjos6BoJXJqGzVjbFwOQmLHDKRlunDlVapsFX5bEXLTMnx9e+LFIs6pdgKtNnU4p7TCsZjPSCyWosLGolCw7gQHnt8Seo5pvW3KXb2NAALE6wjw7oCN3v0gHDdy1FpLJ9ylZSLFqnnB/h75HfZpiLxn2xbKLXrEoCLKHB5w7ghLlmRGV+uAVR0V0VTpUKLFIlnSzBY1oofnwUjnb8qONw7pFsLGrMHJdhTs9FHqj2BwL2s++8QU9WLFJbnFugNdS49+f7phgTNQz3VyMILGgl5pdhFt2XfezgCEJZZnlAy5s6LFKnnFuhFEf4lvTs0IhJya6LBT3gLGt/HSzBJLYoI5yk4Aj27GEfRWRELFIiiJdhD9SmKjLw9DPkdQJJ3nnULFMSnB/gGnts/5v4IgUDdhMNCVveLFCLqB/goetlagV+pmBa4vdhNKrkLFKhRh/ghPRhfjLtlGk9rDbzVvb4LEwZzB+hFplU0fDrZDjSsbzWnt3wLEVyzQ5Qwe4NqLWqLxus7l6hprDILGEdRh/gRuQZX6ShOxJli77zoRZeLIuK4B/iMPympaurZ+99dhnuEi4wLEWf5h7kYaCoLR7Ndk9pNlUeHp0uLETynQ71oe5CjkDNoGONztdsTmJ4LElQh4Z5TgNMxmihMllKxz+cHZQ0LEXkhrVfBgy9v/v0PWGhBmtcXLegLCJPhluOZmy7P4mXGvoqzNkb1i8KLCdQpQ78Zn4Szmoj86pgctlFoVA0LEd+erV95tYNNWU9xcPu8yzVtteMLIVTs+AD7yy5JqtWZtLXzBJprdgkLCVmR+AHh4H2V4xAcNVXSR7ZlRk4LCuZR2jGhynD/wu5M+nmfn1mXBNILB3F60qIZn4OmXd78X0ROd1sqawGLCgIiaVSxnyk+8JHiDjKy5CScUn+LDA3zFu45n4Zlex6v7yAOpzu0b5KLDBP6h/6R4NfiHLcWe5tlYeCUusCLClQ6h/tJ4NM2xeE5ngXUzNtw6bCLDXk6h/454NP0eRx/YSsuxKlSHmyLFHf6j1Ph5tIS5E6MJevouOYh2PsLGGfHJdhp7NDWxD39ZO+1AWrYWK+LGtSdh/od6S8cO0k5gtwa03Ta5LSLGhSDpctJ/NCDtHlH6dYy87OWAs4LFOT6h/8L5FN0VEfEAyg2McoJMWgLE0H6pdg2eHycxIjGqhEYyyw2Uk8LFIkEluho2IBTXJLwZyCM9/2DNe8LGlBEh/jFsFP52bwOAERVaSlqObALFQQ6h/iAyyrM/CbZ4blXSeE81qGLGFczFsyFtYaACOpqlKvfGPoN90CLEkdqB7wL4ScCoamybDq8wN/NEWELE6QzD3DZK9oKJ/8bNrKeBoLlrlOLGoRqQ7lBPnkQhqL/yl87KctQfBGLEaLiJdtO52zMpLIcRmlyrboVnaOLFIRzB/wgfyviZd7EJautCDcp5QQLFqLzD1DCdPdoeTcklqPWwXPezXsLGgRQJdhi9wArj4g5q+HNs2iTageLE3tiYYpMZaXG7fFN9D9ynoejW4KLGokRpdAPPSydyXFLkXpdG9an0ECLE1BnB/kA0YZF0Z91ETfKM2ai7CWLElBwD2EFxU8JSxnyKHOa2OeTNKKLHef6j3DJqSkwDZwq0vdcGfQJe6ILFudI2iW43IZylGrpl5mMLXHBc3kLDpqpNM/hmNAV5cujCwtk6zDkQq+LDoVI8Y7Lu6Ps6zQ9SyhBZkoz88GLCtPpLdNJmYc3/RTKmznWaSR7JXkLDA362hZJsyZaGpYDWunlqqxNoxiLEV/YSzhR4rlQIW4NivO/pbxVaruLKAstWiAGp2szuy7ZHPAvjI0EG/OLGnaH8IgRk6Tk76jqylDly8+Y5XgLJDMP+EILg4mHqNEe+qIMnpecj9CLHWQX+AACjIvJbCZ7adF1MJZiCBiLJlzP8KgNCzDN8QRpBbS9tKm14bELERT1aTBARl18IgUj9eBv0CtUJNSLA06QaTchj4NDz7yvdJ8yGTNF2jKLB06PUouBtYNN+cD6viN2S6nq7kWLBs66h/eR44FEUK7P4QUo3a6ICQkLB0664ZeB54Pmh7yMCmA96KONoUILBob6h+tp54fmcBlPWHNh61IfswmLCRJOQ5+B7SxNxy9edQ/RY+bByfkLCeNJpc6R+YGCwNufB8E+Cy2q7TYLEChqQ7hR+Wrsgvzvfi/OIxLErx8LCCLnB/o56T716gFEW1KZM7L4xQWLGkrQluhh+MKwaNw8Q5Z1Nr2mFX4LEaLRh/kEhYKXgKpPh4EZP3iQQjCLGkrsh/gVz5SFGKtXjx8VY/GwcweLFaLnNIgEiyxD9Xhd4eEwts0Rc6uLGkdRh/gVetLLvmiwCeFvTjoaJD+LGFB0h+gxkT3WJ2nID4M881ioSIOLGkdDB/BQe4PlYwy2TgrOJc7pCUeLGtBvh/hh650d/4lVq1RLpdfsc+SLIokRh/h616th1WMIiWkTfBPcaLeLFEdnJdglxHBZhjTZ9xhvVlvYntELGlBQB9jCUdcD2+E5cksRnGFX9SYLFtBnJdABasD1iuW4pgp78VPZVh6LC0QwNIIxgkzVZthmv154tgFPOy0LGy2dls0RbNrx+Sv3mhwzJKNLsDALFAOnB7hbel7PkOVZeeXzYIlIZweLEffqD1DRPsMEhRd1EC9PoNFdbBcLFPkI0q1Jiy7sr0v+xwgdaMUJ7h4LFNQhj3fZ44dF25AqnpG/UnGVua+LDstIluWh5tG011yJbpvbmPwJMCoLC+dpJZ9J54Rl7B2WXfCGg/oLOa2LCnfDBvgp7y9dPP1kU4th9AVV0XMLEShRh/FGAQGBrD6CuUepTr8tP1QLESIrh/oD2yweP1lFz4yclcOC0q0LFWVQh/4J0HgQHXalCl62EpAcdBWLHTjqQ4xH3sXQqXllcRtRNkVpKWgLGpqZZd7hvYJ4meJwNMESw/QA3jSLHXkZUq/p/4KEq55RBIHI/BJYcTmLF5q6h/+B/y2qVpC/Px7fF2S/msoLGhq6lsUp/4ekUQKeF9BxiyVhsP8LE+f6h/uB+ytac0qJGllrWmc8DrOLEjyqD1Up/tqa5QUz40YxZKiZfxaLEnb5h7Q56XlJO8O9gesjqFEgyaMLEESDQ5qZzhp/K0qAgZnnK8gj7kWLEQX6h/kvjyYMUvm6EPjHihyNA1ILE+ZnB+gjm6uD1FmKCYy/QJndDhSLFFcRh9ggUZTXitOGaXEaHE6VauMLGUrDB6gm8EUnbl8baDpOJ2PVvC+LFEOiB/AUCHmymWvW8GErMCSV1KULEahnJYAAY6XHo135VByJuI8A9QiLEUddh/TA1ZGh4TG3Imkl5yc+aGiLEmVnB+kC5YEDj4tyk9Kywp1DfyKLGAR6h/Bf4zGOcCCqWeAR7DMILMKLEgXvh7kZOMB5tHe2Ezx0n71M4xgLFOZdh7gFgH5VsVwmW/LTKYWhdQYLEcdRh+jDjNHNoP7MkzlhSIIqVSULDgkiB/ADii3K30g8Ojn08GnD3bcLEkdnB/hmHnxXrRqGRbhhVkgj5DyLFCh6h7En4Q7AeyjlTn49DbxEFLGLF4k5h7Ikxp6rER3sy892we7sfuOLFSZjlskiLMJGjcrE2hXwKHcNCGeLFS22h6lvxy1wfkqHBw8dVCIQb06LE4O5h+hGxPQ5MT0yNlP2xGGMy8gLDVBBB+w78d0C8GAxqjfcNs5QdMGLEYRjh/4S9HJ+ts4KDYKw3+Cgm6OLCbjOB/km+tKbgUHs4oMW29buY+yLCyp4Q7t5nsBzRH3uSU58URQUhSuLFlQAS2D54YM1jIM6GIGTMuR1nmKLC4VAB/3h4Yd1m3YrS+qTUWUWSrULC5PqFocJ5y6Mv9xe6rk8uzlDkQILCl4iQ79B5nhcrZvkiBC56OA4XBeLCdcjh+hp+ntahtfl7jXTEcLJlYMLEj/tB9mR1texhvzhBd4xsV6bsJkLHsUjYZhhPmP4IByRg3Syxp5MlAELETNDlulQL9lww0M+QNJQrCYWLAKLDFrhniiRm3JtssYd7Y1R9w2qQsILFGxAD3GBdnML+Gy4FRE3YU4UgXELDuKDlutT9MR/py07WwoUYk4pzuSLCvfO4YoBdNmuLcvbG9YeM4IUW38LDhL0h7/h4YYidEiuXCs9rDwVtaELCxW60qlJ4yba6/GCzZOvU7kJaESLCyIRlugx4YzduG4JiV8/IZVawnWLDuPsh/gx5+mtoVrDJlmPCXbnCEcLFKonB/tJ5Tkh+7elKtQS4PM9zruLC+V5pdhEsSAGY/QLRmRbpnFTzSiLDkdnB/x75zixnYwbMBX0AhE5ls6LCsOnJdpJ35gFkrXMozS0qXlk3KcLFCIRh/gBBnKd+XtIDsFsWnw6opKLGSVRh/gDthF1luifMcbg03sYdzyLGDcJJd1LdMAgrOLBf4lRnkkxpyeLFPbiB/omSS1W3lyA66HjcXVuFIGLHaI5h/gN+SiBAGe9RdRs5xqnvQ6LFiVdh9jDHyXr3vJmD2HDxW+nxZ8LFaI5h/gAeHhfKPkJksWp5yJWHzWLFSIdh/AJbSqKCmbxA+1YxYXNO0sLFKI6w7gDzohcDPD9+iBmjs25RkcLFGZnB/xI8tx/hrfUyXXljk7HjtGLE2NqB9gnIzKMiluFsZCSh+2nIxOLGCVzB4gPrM/WJL8naCpT0JC0lxcLFKhqB7qOrG882YRPMeo9RFPJPGWLFCQdB9gJDH8XbtRhCaqZzINuVhKLGShjh+hCTuf02XtUSdMKz2Qkc6GLEQOjj3AR0FB4jc88yaRNUzhsUtULGUQxB/oDJzqIY3LXhU5ll1VAQiALEyLjpdlX4ChusM/cSHGkjTxPCGSLDC2sh/Ag3SKN+H6aOeq15JjA7ygLES2iB/lI3SvsvyGgC0HT0f3sqHyLCgVwUrs5iZo87QvxMoVQ2zRTWyGLCZL6w7nh4ytaYkpD9mBmv5h+Q3QLClrOQ73h54IF+TBWNfBXIV1MdGALB3FzB/4Z54ZlMJ1eReBrUAPicY6LC0URrVbB+S4xhFeG43g0TVhHLesLEnwvtMoR7Szx9ktjAcF7kWEp3ooLE2mO+AAFtDBtP3nvWw8qNVPQx0SLJMLO0qgC3nxdcOscGwz0poX/PFCLIQ5e8IoDwky9n3WYZwrHysugpQuLFNFzB/gF8Z+0IX+kwF6nM3nKMpcLFqIDpYgPwHGbh0S1vTzltEHtopALCi2zD1A1tBJMELxohvW3xsqbEsILJCQqB5gn9V7q998EBoy6pgflLQkLC8diB+hxwzkozZ4yR9RLDP1xY1YLC4Z6h94Jl4sEr9EVPENL06BF5xOLFGZQB+gXTnFn30/mCv1jQ1GVTK0LE1BnB9AGjp+v7Fz5L3/X1Z8R6CmLEa2dh7lgb8T33UhEaTVHqDOyVdOLFKQnB/gGq6Cll2g9OhctmrA8ipkLFaLiB5hS3tZ622zU16M7x0lBImWLEy2nB+AwYrXvv6jxwLXtD3JoT3cLJKK7yzboczE6V2dPOAVWU1h4klSLE731YZgANaxD2I8jkkw9P+V6xSOLGgZd4ZoOsFutxnSo8XaFcxtTj3SLFyLdsMgVOoSftW3OgDhRvkYDu1ELE2ViB7h1NbWkt56eCDAevWKIGJ+LFIkBB9gYaIVmjs/rYQU1QJaj8SULE9BiB+gy43+4iDljQdcycfOLvH8LFMqjh/hLonxmzDazphbYybG6jYgLEiIdh+kGzn8bmuombJkozl9kIKYLEWZqB/Bg1Hz+uRqV8cWmJskS5iGLCtrwYbtw3PNe7dirDGLJjsryQCmLFC2iLRPR5n0Y4mYrdvpl68hIBwwLDT16j3eJ54EkUvXzZYvLxoo9Q1iLC87iB/+J5tPw5EElsviOIqlg1eILCoPjj3S554VgNCAZAhbNPFvCXwELCgiOh7eB54NlcA+x1r3OkbKrqLwLBv8jw7h584CiMrxdCxkR1WaMcQaLBzuYD1JZ54akdTNh84lf1/DKSe8LCkdDnkcJ54lWsORPCxJikO6WmnKLCUdrJclr8HmfyMZpgMjVaLGaN+QLBTunB/JhzpWd3gq3pDA6kIVGJgWLCChzB/lN18VSTGSED3qNz9Tu0eeLCAOQLURhkm0XoVt70JI86w+SW1OLCwRdh/pTuuTltwszJbcZKYSE/D8LFKQrB/AN13P2aeQeSH1jUeMgeSSLCwkOh/lz2MqWQI4SkFHojK8lNiOLEaQDB9gPizdvUNJRM/9sjCW5VSGLFMd6h+ijuksyrMmbBAWyG2pKNrqLCdBiB/0i9Gpi2Rm3iDILHcfnCSKLEYRzB9gC/76+LPcKVhvUyLOCikALGVBqB/AUxIFEkMr6bBJ3xYjYUdmLEahDQ5k6eZNPN+gXbahHiWq41hULE2ZiB/gfb5OU7ehTi4BOixJEyluLFihnB6gDjPUzqX6W091uRBPXk5ULFCL0h/A1eS2IGuP7kbxgn5uPbMWLFdBYB/oC1zCKCvYrWgex4HcZcW4LIQRnB+oFP7tdkNd5mhIzGQzy5VOLDSLOpVgdlNDRTWK8T3y3EPZUKpALFwOYQ7ifvsteRQAp2h/a4cn6JwALCeGzJdgcayT63GAhbHmtIVPMU02LFK2nB+gG8NMlsNXMWjXB4++SQZcLEctJ45to8MVW3QWuxPfSxOzN2LWLFAVqWmHjy5J66VG+RikQnnrkekOLGiQd2jN58tLjrv8Lvd6a5rkyn9KLFFQvpfpZ7S3bssuE5E4bEvawRm6LDrcd6Rcp7Sxd54uCHWnOZI2enReLFFQqcIpZ7Sj6wF4JD/NLscOKUpeLDtQ60p4Z7YJ0XJRVQIYbG/u7SxELFLy6j3y5+YdkA2Fd7g+pdkRsTJ4LEbyAJdw75ZFnvUmMWRWpqEZAc0eLDuY6w70p+Ya0VrGDiSaulySgxJCLESIqQ6hx8HP8oSkLY8NamkGhQBQLBGZRw5ppyJMfuRKMwsNZOMcZsP+LEahRh9gRmQYd9cv+8MxDxFudRJULDtBiB9goLods6FCjc+MmTPITjE4LCMrdh9CHGmvX8mYRt72C8SIGI6wLEqL/h+CG4Je63+uDgtlR3lOB1+2LFqIqB6wRKyegny0eQd3Ak9m0e1gLEVBgh9gkfyvzyno5ckIxnoGkv2aLEwO1JYlNwHzNsaVTsB0LN5KIbjULFy2vB/gHUMQUPD9aHxmu0ZhE4bcLE9Bdh/sC9lYr0JnrKgt1k0SRFvuLGiudlskm5Y5NkErTaH/ksMDWtvQLISozB/gtez3MO2CtUDeasl90HNeLHFBzB/hJgTpgOTKOD0u6DVyDESKLE+Vfh/hjhG7ueYl9cCN4KLSSZCeLF2ViD3Af8MkWmOQEJROzGl3UJYMLFtBwB+h7ikvZTjGPhrmqyl8BNXGLJKhdh/gETPxZqLy5plld1l0kXsSLJKtHB+gpoOXdwTNEZK9unAicPgKLEYO5rUIgONxwGZhJYzFNwfIX71aLFKhuh7gHV3V1q/pSvINRnbVTxiwLFIRGB/hS3lh05r8drbs3pHU08gwLDQOdh9hzBsZN96OMaLMuGLpX16SLFSYnFuFJ4zStkSKU+QWUvk3TFDKLDq2nB/jhn4c1vbGbImFbzsIYXu6LFKQDh/gHu4nX2HQP7dAmFlDlCdOLChKwFus5g5cwyVX1Qr8Stzt6fzwLC5PnHkPx44Jll8oeu42unlRoPa2LCpjwSzaR7YBGyXNe5yiNmhC8DIgLCpj4B/0p7SppVwpep8yp8kU2FWWLBzuiB/pZ+4IM0PHQKtrlHA5IHjKLCIkjh94LVS8Awx5citp5O4DFKEgLEmWYQ7Ih+YKqbBl3HjEMjWHV7p0LGGWHpd1D8ab4iOh8WuGONryQuZoLBpjwNMsfymT6qvET/pol25k1v4wLDTznFusB74yN3+tj8DPNyHqXUHMLDlrwYY+Z+YFonSKeROGZpaaVTXcLDQVwYZ0p/nkcsrnLHFAnYRV1lmgLCYVwD2Dx+S56uiK5iIWZdfA6R1ILCJPiFsBp84LAuFbzOHU0dVDTwgkLBCLvh7h55E0d8mT2oEt2LpR01zILEdBzB6gz8S8MZciHhvdyd4CH1wELDAPqB+Cn4Tt2/HiTJqxbRh4egq8LCOZRh9mLaI8P0uI8tLQ3G5cMhooLG1czB/hfOYBMMpL2VBBwnq6FNukLEy2dh/pR7BLH6qiGptebomxW0byLEWVQlshAdyZOEyiZYTPlHpMl5pqLEyhnB/gLqXqXs3TJWqDyk0R4wWgLEkrJh/ogfNlI/U30fbpJmzHjEGsLGqhQB/kh72vByuxEpftK9i3U9AILE9BnB7BUqG65m3/c1kHc756b9i2LFUriB9gRMIdooItKMcLhrfaBzwALE+ZnB9xzozcL+wrmmogz1bHI6X+LFFBdh5pcjtdB1wZURIJZ9wHrbu4LEVBnB9BKdYvzgLa2MgUlZzgUGhOLFNBiB/RCf6r8sbwdprDi4zkRl0oLE0diB8gtbN9e0BH22lNRTPbFA/eLDqQdh/EXjNnrtmtaiUDy0fTgX6cLFBHnB+DDx5GB0p+1DK3uNpyPqPELDoRYJcAxbo3IOA3chWA1UUNMj3MLDuULFskP/xYY63TeTxgzZKmHDLiLF8Gjluh4/HyCdpJFg2NMwobR6v+LFcdjw7gQ/0hsKoTrfASM4HgEaY8LBhowLVG8xME+0r18XFp14U3w4i4LC5PwUo7J4YkI6EK+F/7rEQDpnDELCpjwB9+R5tBwtcuaXA4sKHEx4C8LChP6h7+B+NGQJT1kxtKd6toiUtALBxo4JZ6R+YEllZS5FapuS8altEsLCxWtJc6R+ntx3zDoe5jyv9SN3DILCIRYB/wz9YUqYg60g/HSzg44Ub2LEEStJdw56RGdiRG55njWOhzaQRoLCMrjj2MR2z5yOk+OzCiWESa8rPALCuazQ7qZ7NHIX1MQx+2Or8ae5MKLBxP6pcEp7YWUPWLBHDEe8yfK092LChPnJdaJ843/qR2n9K6eVVY2H/4LCmdzJdlL9NS8WnygAdJljjvwVWSLCi36h/LB/HEgbDPSsphx3+iVRocLEWKnB/shy63p6MwKXCjCOscXb4kLEGZqB/gh5Bps0Gi4FOBuOIZleE8LFBL6h+gp2FkAft2JAe+uG0AqReKLFGZRh+gyzn1zn8xww33SUjg5LeaLEYPdpchNo2gPoJs2eVQdVsz4WE0LEeVzB/JP5pKWF5Co2DvxSLV1lw8LFChdh9hXySc9zCzPu2AUoRcdPPYLFKhQh7wh/SRKSVttFeQh4G4Mz+4LFqsDB/oX32RpW430rSHe1Oba7rsLFKhzB/gh/HC6a/MeP0jkU9zFuLKLCaInB9gC8zYLgvn2m7ccTkX4WzkLEy26h+hBhFnMgPtdDdjUDM7IwR4LGkdzB6gqVteqIUUamfvqoYgh04SLE2Zdh7Azo8WWP8XKS9GSoLuBF8ULDtBdh9jLYopL8iKsTJEnSdgY0T8LCqhiB/QO8YCk+RawnU3dfx1MIpwLGmZnB+hXE6Xt8SKosEvVIoeo6fCLC1c6h8gbZSMcHzt6E3Bp8ZFwFiqLFVBRh9AZlYbRicvqzKXtUgg3ru8LEVBjh/ig1tRW7VnUnnt+CrScGJsLFKLtB/hBpR4FzDiqy9KksewMa40LC2G/YYgEL7vkMRliUpPK4K1mMieLFgk1Q7hI2DsUgxK/I1Ukyqb0YnULEaQ/B/BCUHc/srwM7z8w0yA1CpcLChjwcIsxwtISoGkx/rF6xPt61NMLDoV6w73nFTKcEs/+TtjEaqcRpUqLDhjsJd+l6H35CIK2jbhVYyQNWo+LDhqd2iJZ+HhqQw90VgTeSePCxx0LDhqwJN6R/YOipR3aCym0HhCsx/ILDTk6yxcZ+4BEcaOJFwX1NkDt1UqLDl9Qh7w5+4TAf3trZU4NIlFImnaLDF9Qls8Z/4JmNovZnT2bO+cUcGwLDhKdhrv2AYGEPkUJTABWyzy4SlmLDhK6j2ZeAybKjYVRBxK+MTz5c72LCLuQB+wHT+kfyJXrC0DUKZAQ9eSLC3fqFuHhh5hMuRs/vDIAmEFi8A+LCNYqB9iTzQs6zqYjJaF08CjGBSGLCJLiB4jzmS/ewtsi0/pM36KCLeOLEFcqB/BV3VD20Ss1o9hMzLK5LQILEWZQB7pBMjxv1M+8XMalakQ3DfQLFSQiB5A9Pse4xo5d2+qbQ7h3OnCLFUdzB/gQf5BsU2wLF1QdiCoMJIiLEYZdh/BgetrP7Dz/3sVEkkz82OALFJLzB+gX9xi2dH8YtHlh34Fq2pSLFMSiB8oVxOckssugYbS7VQT8McULDahDB+gs1HF9ZZX15ZHRJ9rNFaELEyQqB7lgf8wkqK+PBvMcD4qFhkmLFGZRh7gRhgzRs9wmiSwyqilWnpaLFKIDB7gEwHwHPnkGCXlxaiNCklYLEyhzB7SFmyI+MPdmNHSDppIO1lmLC9Bdh+gZjGFVr7dzDkWHMg4fROULEaI6h/A73HKeo2miKHqakRto20yLFGZQB/gPm4BBn+o0STXOw+nxxymLE2WiB/oS5ZpesdT2OPQadoNgbPALDq2jh/CH38nShvjoeCm+puo8RhQLFFmiFsyslS6up4IkbPM5cK2ug7ALFAknB7jFxCU1sJ/usLB8W4JDSNQLE2ZnFsiWt4KVkabMatGsMybIQ0wLHWGGB7jxuyuYCZf00mUx6cMFSkYLGkrjh/hR+IMomW5RcxnhvgGXrHeLF1Bdh/gvF5Zt05hRg6mdrmUFxJMLCpP6h/iGGYo0RfSLMC2Smp3QCO+LC9Q4Q/5435GjB5RgDkj0zWRIaVuLC5W6h/vx4NL0NPk7ttfW9hnGHVsLDRP4B98J44PFWn8s4xTRwV6VPKmLChLqB7p55y0o24SWRYcyGIUUy2ILBq36h6pZ5tHyZBP8S7bW2TFdqF2LBZLnB6bR54PluAvWClHk0aJfv24LDB+4Jdv524SvLWK5UE6aK3OGN8QLDT16pbfh54SwcAqAR0XeaHQLV20LDlrzWiWh5tN7bcidLWKmySi2QxiLDjg6jzMF6YaG8W8hQEXaqNig798LCxjqQ5hvSsHS0QYVZUJ1Lqgo4vyLFDp6h/FPn4MqEyWDBhS8YMbkLoYLFCVqQ4InnvOolX7O2bN0yhLjdqyLEeNnQ5g3t2jvmw5FPskjlLIdl/kLEUVdh/Ar6HmvtERz/wAx1b9lPLcLCChdh/YZgT1GcyChUsZe59CirR4LEUddpchxgNkXhjirPNnFQcXomrULFA3iB/AXISHy4+4NeuRUnwwIKKwLC2V4B+lxly3l05gYFjatxLywf22LFMd6B/hocHhes5wSbaThypuXE+uLCy2qB/B4fMEqhADqJKPSNN90ib4LG1cRjXA3pnUZ6mcqcYfB3Jg70mcLCy2dh7mOIzAPnHXhUfhU2GibZCaLEahzB9kHn4r+IG8A2sp0PGAlxOILE1Bdh7wnvrwvpYzW7GEK7Sb8FIALFS26h/JHlnyMYojVLBIf7HHDR74LEyQqB9ynTnpu8fa08P8B0jodpIOLDqLzB+gB2Q5qAzlRlcPKtyFbN3ILGpHzB/ghUQRQNAJxjVkcbdEL2vGLEqQdh+olzM9TxX+LTTaH1rIPh+SLE0rzB/oBh5ykc3ccAFPlNjeJZ+ALFGWdh/klySUJimnlNOCVp2Ymtd6LEihQB/hl6kbRpFmFiWOVs7NDPW0LGokwB7BToSTtao+lFoz95DY5cwiLEaLelskctDb/vLJ8M6+eI3XfbaULFONdh/gs5zhZ4nN810uzQIOiKlCLBNrwLVNxhYU2rsy+TRHiNzzPNY8LCjnwB7vxj5SS2O4jwgiO1pDaFtsLCjnjj3Wxn4EgdAO81thm9FJNANSLBgIiB9B5tY4EndOVB2gc8WkqW7wLBRLQB/+B4ZCN4zIiyySlUje2dIkLCCIRpZjx6Rjbu1j3FjSSZwq3kPaLCF6/FqpZys8aCUExBNHdlKUasagLBMdLJdlh5JCe9l0ASxPdEMPvo1ALBnFtB9/Bj5flw5sTD4yplTBCGBuLBsyjlq854Y6+WoUuV9JjGf1RGGyLBp+nFuFx8MibtTl7U0+pa2WBlloLCky6w69p5ndu9h1lqIJ2YbbIMN6LB1Yjj3QrQlLUPBEEGyyrIBYNudALCmNnB5QfmIvpzDd6uF6gNMA6imMLCz1Jh/9FsN1SOL1N1fmTHwMQaJQLCLuqQ4xph4RI73PHbNQzLNwXG8SLCA3dh+hV19V2K6mKoGKbSpc0bh2LCJLnFuQRmTCHpuoCkH2l1FAJ6rwLBPvzB74FjN0ONr/6NB0tcbc6WggLEVcnB7BJid8hnHy3H6VKGd0E4aKLFJynB+xDiH+/vrQKPY3Nl1S5cDOLFq2dh8gg0M+7hRtHnTstw3hbKn4LCtBnB9j3Szs3xAi+aK7HIx0KYOaLE2ZDB/gxK4A3JsaLLjM68T5i9+oLFKhiB/A2k5jGx++B8dDMlPsmbKkLFqhdh/hAw6ThonVr4QO0UcITmCsLDtBzB7gn3z38Eaw2550w+k4YcJGLGgkRh+hTpSlhr+ulDOCOxNSOce2LE0dnB/gsLPxfrbPVj5Qly8rI5j0LC5HRh9Ix2naJxAtPFZhgs6ccs48LGkd6h9AP8o6yCPeSLvBmPkoaYHkLES2KB7RJgFbzj7a5TJisX3owclOLGgRzB/AkkGqQP5iBBXmTMJ3PJAeLFCIDB+ohgW2JB7t17LAe5e/TCz8LFFBnB+GA1NFzrKHiap7rJThke5qLFIkjluBxKsSeVqBNOd7OFdCVuh8LC0diB/kULoAK8WMbGfb0iyeS6weLBJjDB7iNbnWvZ5VlahpSL6xaXFKLDFQJw6Z9j4YiiL/DhD/FSe/24q0LBRPQB/4J4YQHr9ZX7alVc3LX1xiLBiI6h/5Z4YFimFQmiiFOMhjWI8SLBrcnB+6x5sDbxZt+qRaPMSWkaZwLBVQQB+jx54MH/XR2xU4Z1oFrzsmLBaViB7LR7YTEmGt5AOW0plI2UaULCucnD3+55xhvpgM9D45k7iQGvVqLGEtzJdv58tCmU0m+Yxjw6c2RY4wLGBqnQ78L5YMB1QK00F5LrZPJcuALGHkdlo9J8te+PA+G8HCcXbpjOTeLGHkZJZyh54FH/7lf44KMo0GUEwILEef6h/JD2qvsULqGZcIzqRsyfKcLEXk6w5rR4NYeWEMOihIayM1Sy/4LEmfzD2Q3mHEYTZ73l6sbYQRVdswLC2fzB5OBjS40QJ32KDomOC0cliMLESViB+4ZhtdwlfBVLi5xs21LyAuLEiVnB/lJh4RhmqO8eobllz9macWLDhX6h/ka+4l4q+HgPYrIzDu0OfALGnHQh9iljHZaVlNzjc2L0ywNWeqLD1rdw5orpTk9prBKDAWUMNeNgZOLF4XOpZgfu9R6GWRztjnswiWxYYILFOZQB9g1PyZf3P+/BdQdjmU8HaGLESIiB/gUuDqO9IjZO34vN5qzdkCLEqIdh+gMKJHbt7g6ImFW2V2XPPQLE1BnB/g8LzEd6CRjt8qFT5+dq+ELFsdRh9Zluy/7u4rRcQCZycZJsjwLFaQRh+g+t4GzsqtCvsG3M3Fw2vGLFCQiBvgWBEvY/B3hDeQzu0cVzQCLFQhzB7hFmpYELGz+OheaWptcs82LFFcRh/iglWBbolReibhTG11tFb4LFAZiB+hMLnley/b0Z1quDavw/i0LDkddB+hTKuGhXaIbcKiuk7ERr+ALFRL4B9hi0yzlld9X3ycaNMRjfOOLDqhiB/io6zB0+0Sbxie2TGLtPx4LCyQOh/BB+TIWVLqNKkTGVWVK5IgLFqhjh/gV2NaoDONtbqEjQWzxqgCLFKQjh/gi3tyOGRpvmNoXULeMXowLFr3nB/Ak1lCnoo709j/s509cGQCLBTznQ6APnYPZpivHfD6tE0YjroYLBrn4YZdJjMT/ZhvbkkocTwKUZzOLBmanB+pZn4Vpvl/hbCpFSKJ1Ko+LAo3QB9yx4m4Dw7vUdDd18bDi7tQLBjunB76R5YAzit08gaiq0fsWVuSLBgInSyQ54YBp9wly653VwPIMboULBkyDh/rx44CUzrvwRzLS2OTaZS4LBttPB/6R8m2H07JaizmxsPdUTO4LClrQj3OB5nyORfZHBeAycWZMRTwLCvIPJcuTy5lHuGL56oDc6gbgbgSLCuYjy2JdvykASUsiealAmE3FPhQLClQiFsDxnzbqoRo9WwGXUclTHBeLCK3QJZpplny/6xMHtA+JKjuijOGLC3FiB5pbh4KY5p9wwo2I+GZkgp+LCqozD1JBL69YNHyHDiOqswkkdQwLFPvqB7gd1X9egUk3r2AhgkgwIikLFUdiB/wSdy6sj2jYYOPsHKM3paKLFVTnB/hi+wR32BuOSsm2JKfo4jKLHChiJZB1yI3isJw7lV8u2JNIi+eLFS2nB/gXVpRniu2cznQ1O1OPLpmLFVBdj2DIVUkPwgb8aN8ZHPVA9qeLGoRzB8EcfYusd5M2EkkbGMNVKBcLCahdw7AVKNjL9Psr08LKnlMFAEkLFsdzJcSFd9HQYzsPDagKoI9YS8CLFGVnFuMlP4ShzUHnl6axdh+HKeCLFDgdpRgkbsrTplXo+kO1472OrxkLDsdqJdANaPDkqvVWmiUSuUdYUVGLGvIiQ6hPvHn+obExRbRA5bjc68ELDpLzB/ogbRC2YB8bCaBgmY1jFP0LHVP2lugwe4DAGOwOy5IxuzOKLmwLGiJjlqwq9YyKNrYT+HjAnfNqsYWLHCB/Fug1bYJvzfCIfS+p+YfHPkoLGqQDB/kb5mGJxGWbGWCeQMnCKnsLFNmVB/wFlSXnUj+MdcHU6ll30BsLGOZjpdgwftUmVvyes7cpxiI6aaCLDmKOB/gVCz7P/al2U/Ek2P3oRtcLBpo64YIZht+qTGWglKzDtuUAitELDBPnSzTp4lor5rU7hMJmyXAUBsuLCjnjh/h55N+5/5VlbfWcKYPwSyaLE0UPaRNrnlsArBI9qU2mxHTcbACLGkcO+AQFNZk7FCqO4qEpysknqWaLJcC6vEAGrvY4qmxVKPthckDYVGmLGijjyzAg1SpSbl21Q0IYy7XpxTmLD9B6w5gNcjuoS/5xQiUfulgYW1KLCyhqQ7gGqNDavlFsPX+bWsVwnPaLBdr4Jcp5mnwLDNE+9O8uR5mtBZeLC0dzB/lpnMeYPwHzfDkxOB3GCWILCmZOJZyRmnlLvbMeU6BN5RfNodcLCF4DFuwxn4ALTSOMXpe0TJ0J7LgLCyhiD2BDnyF61N/+Q4Oyap4Gm+kLD6IQB7gNPYYLyPVe0u2E1C7hR/iLEa2qQ7sIb3hek4zkTRjKzd1woFoLFKhdh+pQflM7hYeOZq1pYNLCJc4LFYX6h/oFPTVkZHKZW3ntargZH8KLFpyOh7iFOnZOP3eGTuSg9ly3IeiLDoXRh+jbjCmp0EeIS4lp6DX8m6uLFShnB7x9OsTdzw/mgmMxHGGIlq8LC2ZOJZh1bng/+gqRtjnU+NzxwAgLDY3iB7B4ftMEzg1d461h1uV2bIeLE1BQB/wy8YtvzTiV8HmGbTS90FmLCMddh7gUMoUvvOyqPqjTzl5GkhuLDuZqB/AIfmL6vtX2G4hLV0XWZD8LCwRdh/gkLtITgb1xeYga2IUq9GWLD6Vdh/ldxTgr1SUjTDoO1eoM6XGLFZyRh+gKWodT72vQyUrFrmiXfxULFtcqQ5gC+4ogzsMutSHTU15htcqLDlYiB/JtPz6sn7qztL6YyAYXpJaLEdBRh7FOZcfP5pyvhTCKpl2bvj8LFQRHh+wKdQWdg/YhShzVWpp4WqMLFGZnB/gSdtQXv2SrDKSxGu7wVc0LCyLiB/yweNDUpY3OrTErKbYIYg0LGlB/B/hjq4KD33iIwuPzPNeagcCLGqLBpcgm4En54BnG9qmhKy4/ZIaLFyLTh/iY6YL1z2DrgJlOVMV2Ua6LE3tvpcpAftW9lP9aeZqWdppaqkoLFChHB/hRkNNwqTwKyyWi26rad1aLBpj4HmGtwzoF0wZ+FskOq9PpI6QLDHFwD1aR54cKi0gGbHvAZwGc34MLB1tnB/Sx5yv7ysT+PFBHYyBL7yQLDHmnNI0584Uh5q6JphbXfk0+c+ILB38nD3NJ+NTDzIQFgbFkyB2Ql5KLBv8/Fm6R8tP/p0RGygEXNmZUB5aLBsyHQ8rR+HqcycNlZjf43eu2+0QLCM9iJd6R5yzC6gT7IfPkC0FvrwaLCDnTpZwrmS1rwJkedUfmN21nbxULESQRh/pZnSkhqDJV0Ec8ZZA5URYLEeZQB9hha7fH8zqwPTTvGcgNqQmLHUrDB7hv4HUJA8U/Ct5CIJgYWfWLFF4DB/hP9dxfcBtytXVmS5J4e3eLGC26h/ApjtW6Y3dVupVraPeNtAsLE1Bdh+kCdF8+Lji2g/4yXaBgBeiLDV4iB/oBPNNksHZ/A2oWRxUVxzkLFUrzB+jIe4NOGz+Ls9odm6S9T54LEi2DB/AQ0iq5fb3FhdiLigIne3ULDkrnB/hy347BgozV/o1mT0TC21cLCcdiB7QFI4vgxrvxcdvFidezFveLC62zB/kkaHhAOF0k1sQ/Lw11OXsLCzunB/iGH2Zr5sB/WhnQteEaghoLC9Bdh+0geH272KlNOpRyVkKiYpyLEQ3nB9IwLsKR611apu+2kyLbeMOLCsrgh+oYe2e/1+2zVDwamlshlViLFQOqB9glNmdkmJLCpfNb8abYVecLDihdlszi2H4ltqv2egQ0x4yIupALD6oKFuoIctS1z0lMGwFZt61K3jgLG2zflugKxYKWI142bT4NwJjpB+yLGkm2lugEeP4SZH42Ha3UM5Pl3xqLHU9iD3ANN5cAnfQm5bIsK7/GgJWLGA32lsjl2MywegpqwAz/I4LaWKOLGKLdjzKAZy9vkkX2Ug5SwNaVoiwLGSIrB7oCWNWOe3/7J4NnCNDtXcULGBL2h/ghPNQSI13kOtuKXTMTXh4LBLzRw7sxmYNhsqU4DTD6M62dDTuLCvbiYYvpt4HGxbn7t+ao41u+RgqLC9q4FueB4y5pcsAcDQfsiWMXm7SLDWf6w7fp7StMRhUloCcLOCTb5soLDlq6yyXh+YMCGTssKxKKvTEf5eWLDmfpFqcJ8t+zoh2umJQXYWWbNFsLFDjDaQMJ+TMKu/ITC6K+TcUgRVGLFLyh0qnn4SjvmP2i/A7w6mL40D2LFDy6tIUr9Hy6CYb6MZAR9UKwXNqLCHfzB6Bp2i+CPz87PoXznoWMLg8LESsQB/hhnv9DiD4xB+jcx287aaKLFsdnB/AjFL3zn1GO48NRSjPseg4LCxLDB/xKyTzlTvBn0+RZ4b6Wzt6LC7uRh+hrm42ljhUe1jzupbbzfhILFqQzB/hYfdBqLy+B4+irE0J+NNoLESVqB9hVLM22te8PfmgeOZpV2yALGFBjh/4v4Ttk/n6m0yPMMPXUk+sLFFBnYZhglzhL45EKbUCkp0NFKyuLGGZnQ7gYY2rPkIXhrqWTNwJqq6oLFMdnB9gpnH1/iSe2XJWFK0SLszgLEaIDSzEpOyhPWBBc+QAu4SUFYU0LDihnB/BYcmjzo6ujxdWAvb9IkF6LFKo4Q5xWpdNF5qyFgxo3MxgcqHuLEoPgh6gZlWer0HLNXCgtL06vLGELCNBiB/g0KYLe9hhOqQOSlnlReJULEdYdB9oMaSZcFmLyzBot8/uY5aSLEeZiB8oeL7uO6NS84B+dU4qxl2iLEaLnB/oUmZAFnFT5lFrgmGMJQ9ELDtcOh+ojV81gQVmorNL1W399KKWLJKpPB/1xFLjRiyMJH3pYrxHE5AiLF2PrSlACuEnR+BENl6xKy4IMybSLFSWvpYp7vJ2FmMFmfkMKTy/1TWCLJOVdh7rMk49K7q0diO6N1zFvYSyLGoZjw7hm+Nr0YZ92FOBKxxfsTvYLFqhdw7hPQUH6szKZWAmLX+CtawGLFOGtQ7gAw5L98q+VjlMcxsIRevGLFaWDB/olwy/L300z+H1WH3jnMxQLF+VYB/hAbNdCaLrtPmVl2UP1JtsLDuZnUqgPzXgfk/LRtepRtbWiymKLFoZDluimFjzKo0RYyLeVrz3m8tsLJGVYLHRt2fU6OycfZFw2YXDSHxmLE62jlukpkNUaG4LBlokK1F3KcWELE/IwB/gny4cWu11BzL2HcKVvV3gLE6uj0opGS4J+656FyZ1G4YyISJ4LHq2wJdgtbtBg5w9R5bzSrEZWXwILE7gnNMinpGhft9SMS3LMyaKr2kGLJKuQB/gHMz/FprrHhbjlR4ic4HmLJCuQlugH/5yCIHLscySuNF9haf2LHShOtMoS7MBcfnidtvF5jgIeBrOLE2VnD3E2tYYHxNwRtp9Rccm2B8ELE4kvh/gVlFKzqAZ7rfbIzqDY2fALGgkRyyJdlNEB/sEEe/DPW8gueKoLFiQsh+gi14fBEF4s2Wg546y2OK6LFoRdw7pPyijToRCBGkGgm2hw9RMLFkrBB/10kuC8tphQ0/bpf8lVDeSLFtBRh/plNw95tZyG/tcu0yFgbpwLE9m1B/hmVRmh/Roagobng3IIYWqLFKhdh/pBjSob5PUNABbpI0DIo4wLFKLDh/gfzM6flCLE7WSMY9a6j6ALExHRh/hv4HhVppcjSsgxbryWcCKLGiWfh/QDBYPSTja/Gmw5KpcUX9yLFoR0pdpQf9hKQySbbceYnWKZbsELDcrdpdAAeYjTlr3R1WlKfyco5d0LFSIzB/hK8S9MfPbbCbYL9CJN1l8LDAQRh/yFPyndl5M+Fr5WeleDOYkLFNBdh/hq5ZJlxsHbGN8Z8EFcHLaLFiLOh/gUPuECb+S6hx2J9JWq1fCLE0qsyzQnnZBPQxpfwsXWYfSG3yCLFIkRh/QlsHXvpVOPbUtsVmKHNKYLFsr6h/hoAIwmp4f2WFqYZ9Vgx/SLDVBdw6ql9nuVx1NL8ZBFdKo7Kx+LFCLRh/yidG15txvK8JKN2MM5SwyLFVB5h/jSfZyvAC725ANiv0eI1kyLEyhrB/wji63EK/setaD2iPnPkp2LFYRfh/wDCFPkHnQ2dSFMKk9PcLKLFOVzFuhNhmrcHyScrzR08jmVvzkLHpy1D3BDosgRwhY5FBTMTyR8Uq8LEaU5pdgtetBPMcmeLgKgZonAKHmLFokzB/oG2HyQEttrU2XFJGKLNfiLFuVOB/gCJEQRhnddjUrZDp7YSv2LDZyOh/4Qe5WCBSt5yDitVjsNyy6LF0OiFskszTociJjbj5bmHaJf1a+LCsdiQ75NPvLc+TXVyaiKUVGQcBeLBI3nFu4I3S6fxRYzGtlLPIIBkw6LChL6lspZnNDoJhrVByJlxAJYen4LCjgiB/z5nykowOPIkaHaGlbJpLyLCq2iJd8BnyCIkpulDWISrSUU21uLBvI6luUJnTrWOTQ6jOrGTpGQmdeLC6Q6luJfmSr+CxzblYWR6hqk8NsLCuZqB/lnmZ8mmY/LJBEhpa2l0wuLC6hiD3A7zDM4vE5kyyHdmx3DCVsLC6JAB7hjnJdt1xsdeGIzgNkHDDKLEVBzFshxtmReRG6XFK0qYS9DvbwLEmWOpdJtkMXLCGzy9gXDtAXY/SYLFpynJchhOZezzsiW06r0musF01gLGgknB/gN1d/J0KXBWcW4w76Yw0uLG3tDh/gTu4KQpW0iZDoRzmkxKTCLFoZDB/gg3HXrk89XVycc4KZMOZ8LGOG1Fu1jjSaq7Z1lBBxFlmQ6/7sLF3vjyzAQkCtkYipuJBOTVPk6JAwLGtmiB/g6Rznc6wb88MPr5FwZaL0LBpj6pfsh2IWIUlA+k/vpI66hbYsLCpLiB9vhtYPm3wNkhOPQ+XiLz2MLClQ6j2cB4YFmN21aXrB3GHwWAK0LDTg6h98Z54PkJO2XwWJMUeuciX4LDpWnD2eJ7YVHm+dMGuCzLbNnRaGLDgViUqx4vNIC1dzWGbQPhqm5Hs0LEVB6pdhDYHzIDPsKRgjmPzGjVwULC+LiSyCC9YFU5tm8bYZRyPqNPuGLFMdDQ5xO1tuNdWFT/F9t5sm7EmGLFFB6h9gG4Yui7l8rXkshPjKiFrMLEYZRw7pi17PdopCPQ6KejsWRcfwLFARzB/gV9dbaWbPKKHqlVufS09oLFOVDB/gPdZNlAVRgBiiuLE31dyoLFChzQ7EA0SH4O3w3rRyNIcaUeJELFlBQB/AH94elz/yGH2ASsgr5SVyLDSL6h/lyhoskJAI6Ywr3JjT1DFILC2VRh/ANmyuNnb/lEtstGUMXm24LCyh6h/hDg4zsdb6nvQddQc4dzt4LEVBnB/pZh5FZt6RtZJ8zZaYZpHmLEcHOh/Y3r4vFGEklqA8xyy3V3sCLEntjh/htPcyOBbXBGduiJXB5yMaLGmWtB/o3YysTkc6lxhK61bRKo0ELGkrtB/gkjS6J0d/L59tBE0nAlicLF2UxFuQD8jqcPniuYsSPO1DqYGaLDtBnB7BK9yePiSy7/JRDbUnbi7WLCFBnB/gIet11kRh2Os6w6TMwMWYLBpjQh/15iM7EQ99a4I+ssLrXGyiLChWiB/nxtYDUqu5mclqzMKBKSesLCmYnJR3B4YXnuGXvttYLkjSm8uCLCSpnB+1554eHowpJpVFWtYKVSiYLCpWjyzeB5tB2tetligPCNCPeJ08LDWsjh9+R+YeCgMNCatNy95dgLloLDXsjlu/b8YCkwSQmBacycdQSL8OLFGswJNrx+5OFRAvRByGwvKRHlkaLCfswQ7r78Sl7MmFLJ1ko5K1aEZ4LC6oGQ7lx24FkTQCLHM4uX5sS0yoLFFBQQ7olami5u4HazKdoyyrkh8MLCyInB/xriNa1jsU8k4pIVkxumGqLFCIRrRDdOWRpvgDAu1CM8Lmw5LoLEZLzFosLyk7cf/ILAmiT1ZvYdH4LCiIRpZCfnYGnmvR1WYihkX6gb4WLC7uOh/tjn5SYF4YJ05gyqEETdFgLB2TzB9BptT6sRLZ+gj5cNgMEffqLC5PDB+x54YchTeF0Qoux7GMGU0sLB1YRh+6x5tK3w4MV0HnBvXBEOMkLDRLzSzBp7HhANXA+LtHWUDGwTDOLCeTQB7JZ8tSToU9cTKTw9fdD9fWLChXnQ5zR43Lv2+YFj1JNYdtmK8sLC1yOh/mB5dEkD2zJqWUfo1Jn7AGLBdrRh/RNt3KLlPPc8K2XSbnmWOILCru4B/4JytFNnrR1ZzpLGMjcLLOLCDudlotLnNd/j8ShfA7a4ffY8AcLCETdB7tpmnT/bUYxHwx9YDGTzIELEQkOh9zxnn+4O4zOQa1TgdEJVuuLEaQDB7YBtN79Yb7PDyks40YCc+MLFlBnQ7ggMkl55TK7LLBInOVR396LFWNOh7wDs15kMZXtQMGIU0xphY4LFuPnJZQIzvSj/RXFBlsa745Gu8iLGmZjh/pFTH9kxI1CFOWYrT9l3GcLFOGQB/hLpDSLl1qyogoKyn6/M6QLGi2jh/xVaMITh29kgGU+TFaI6PkLFIQuh/ghL6YmUH+OPpW2JlWGcFwLGghjh7gP6oW04cwwnYKcs/ko4PWLFgRjh/RLpNfU5fiAWAP814LZYN4LEVmYB/iPFvX2DN07qi5tKSCVj8gLE2WVB/puO4NHTzLu++eLTrrqqcULEcr/D3EmwU4SOg/wzQiXNKoTMiKLEgkLJdgFH4HedHKbH40X52QV4cWLA32nNMuFlGBrs+ytbeEJ06nhMYuLCpjwB/+Bn4Km9bmsgTR0EUWzmsgLBoVnQ7/htYbH3NgxVmbVGRc0Gz0LBpjnJZ+B4H2fnJAddJ7gkbECE+CLBpjwB5qR4Ye2jV2ZlNo9ekabidsLBpjjh7PR44NGkXC2PqolbQJhy0ULBpjwQ4PB5y6OgMiyDWlv5AdGLJ4LBtrnQ4vx54OH01YfgXnZXY9LErwLBrzzB9fB54OmB4K1Aypok2maEogLDFrnQb8J54Jh6Hm0RxGt0dBNGykLBxP6h/7R54Tm4Dl2KVbkMqSPFGiLCjg6h7eR+YeGEJHdZgbhiBCOx0QLCgVzB/2B+JcWHSBZRVQr1HCcANALCrgAB/t57S7P1c6eZAV0aMVxVMwLDFrd0oLR7SpBmoH2hZ5tQCKUWSyLBbBzQ5JR7yaMdu3sfj3PHvZN1SILCXtAB7eh8n+143mWKBLVEyTtMfuLBjuDSyR9tnltW/fLAiC0uTHQWp+LCT1zB7+J5sZUF8nKzsN10PxoFEoLDGN60q3h5n6M/fvZSxabkDlEhlyLB146j3Hh4YFmtevMM1XLmENaATCLBrnnFqzx4NR32Cpywm9hjhFGGbgLCSROQ73h5NI1pjNBfBmz5USnMPaLCJLiJdlp7TculuWEnvadNBra9fwLESIqFusNvHdQv+4lDll5ulZ5VPeLEeTiaRIfntFkxVUsJLM2Wi9FjVYLEGNDJdgxscS9CoLdSS8D8Hq8EF0LEcOiB/lBnyfc5CZM8cW27HwGahaLFuTQJdhpuK1Dw9Lhx061y9jEF1CLGtcqQ7hiUYHi+h+fVJZiGLBldFcLFtyzYYgWBymKaL7T0lfRupgMWoULGpJQB/g2By+5i0vsrCvXCyUB3vALGqIqFug2B4a++0mfT086YZnjFUYLGAPRlsh2pT7Pop6CrUQlxjBp5geLGEdnB/gGsH73pX/WF43hw15E63sLFYPOJdwyScV7iijuknAxyQxMC1ALDqIzB/in323+RRtjPU32VKnM86wLFo30h/5EERWQDSO2pDlPTWiaagQLFBL6jzURgHwaQqcaP+Ec3ayRvnALFWT6h/lGMNRcOx7iaQLFsAHJSs+LFTg6h+oGcJXUgP6rVKoPcSuewSyLFCZVB/hgx95ZIVq6/HUuM97cOtGLGGVLQ7gjNGHedH2RDwxjqAEVBCoLFOW1B/kBgk/i+V4WawVorT7XEHwLDyLxQ7kK52voKmzDqZWdI3apvdILE0rjh/BI12+M9hO8yjvqrxsxhucLAxj60qsX3dCKt1nwoPXGUJE1cOeLClrRrVEh7Gz1leAKihR1OWXdYE0LBruHJZ4Z7YFm1pmbQUyqKOsqVyCLClrHJdpJ+y+21NjPlMoNNXXYL78LCrg6lunB+4DCx33iyTUvtIEVIfuLDF4iHmQ+ANYElrA9SXsqvUId93OLBt4nFuwD34Qn5WrfBKm+JDg6cP0LCo3zB/pIezeYT5SrUE2DjlmV0VqLCMdDh/hPn2tr1Ch98+ktIS5xNjQLCdcqJZBNtG266DfzTImdrpaIc1MLESoqQ7g1kYnWnwrbsgxpzWgy3lqLHUdiB/gRvRVUmucMLbb0OXEOdBgLFaoqB/gl2IWihcWbImAmwCFHqGgLGCLVJdlOMyi27HAhVOfWpOHkZlULG2W3Q7i1a6NhXUq3w6vMZuAOuaKLGQRZaREC3ihUK+xiCc87h/wnxzsLE6ZHNMhOOFQLPjS2UK6nRUXpKImLHQRO4ZgQ82k5AbDKoPGNydamhfOLFMddQ7oCaZC2bJoizoSnKwvaeCqLE4lBLUOFyFXdhQHQFh5GykoT9OQLFFcDD2AlJy9ff1MsEDGy0FMgl7KLGsdnD3EK22hZxWWkeAZR6OVis10LFqIqB7gaWoUCoWPBappaPtTwNEsLG0ddw5h9vSoEMYuslmXsHSJlGeSLDqhQQ5iGexNJpvbg4GDpYy6M1s+LFcVzB/kfGJCgRbRvrxE01bXGg4OLDtBnB/iFLnzd6ThqG2lrKU33l+ILFOTfh/gaAQw+L1npI/S59jEXU1cLDahjh/p4f4SF14QhZ6HgWzRwEHULEcddpcBjiGHfl0272jRPgeFKuBqLEqhnB+oNd5+z3d2xiU3vtbEKfz8LEgkvluijAM+rXGh6ZEldLcOr00MLEmGLUqhhNPK2xxd9CxFbiwacngwLGl/1UqwOz5IMgPLhLIhQvNPCJnoLE1mLeADX3Ihu1Mw4bTWVvQHK2QoLIRbLaRINM4N8Ns87istBo+kaK+eLAxjwcKsxktcelyv2mdhZYX6kavCLC9rwWiLRh4NguBnST4cbbakFTl+LBxjwJdeBmYCGggL+LfwR2kBJZ0KLCtrjpd+5mYYmWEMOnSW8RyaH2XsLChjwB/6Rm4NG2xEL2upRyRruG+WLChjwB+aRtYfGgLF5A8rg2fn6nkgLCgVwFufB4YSu9QU7hQpxWmN1HVKLChjwB+yx54Ek26NpCXT4u6ZeaKmLChjzB68J+YQuRIsBHrTWHierlOSLChPnBfQ5/yOBoKdchjlNlGsZIrMLCII6h+h5tSgIQ/aTrL9KfrSoKhYLCmPQB7QbnZF5jbbSX8w3sGxCzoSLDY3zB7YBEGqMVLo10mGtdW8bUG2LFg2iB6AKJJ3SlWWTNWs1zEXdbTeLC146hvsjitmkXPsUiXrTYOLzG+qLDiQiB/RRPnikr0hiNf5ultQOPeSLDb1zBvkT2tnyZO3bUILmUnzrGBWLDpLiB9A1Oyq0o3qTpwoKwupcGDsLCpyOh/gllRpiO0A5qXa3H3JD8okLFnHDB9iVfxITHEy9g1xjHKfRslaLFoQOh/1SJJmzEg41vdKGoZdzfEULFAkjlujBpNROlnLy3hbm5GSlPgSLDtY/B/iFhzN5gxRgXdr+yUz8iKaLFkrnQ7gB8CDN2sm+2tD2YEaSXh+LC0dRh7wbom2Bo2VgRcxlj1wURRoLCCVnB/lhknTHtF0XkiUOZLiUH9sLCOTnB7h5jStXlphRVTruAYfQ1RaLEaLRh7gZOnc93vJSXIslx2jJVmkLGnbQB7nfim5t36fdBDUb6SHER6SLFAkRluiBL2gv1WgxTF4uz43BxUYLFqLDB7gkMtN7CR5apfXk+ojOg9eLEeT6pZg0lQgm4o1u3AKdTE6hXWKLDuPwB9oVlTfBRgkG48UnCEfw5JaLFMr6h/ALeHicedHjESXg3LtZih4LEaIQB/BxKs7VqEB4JB77qVVq0G6LFNBiB7AXUHaOju+ONCHgnTcp4ygLC2ZnB/hy3NA9mqXQNBfrN3NNOOCLEwZdhfhRmcPvzj9EpUfMFQY9OcgLDy2nB9gn7pr57VkHraHAlPbWxdULGiLiB9pP/0v8+1ZyeeKJ+JHD8RKLC5y5h/RF1Zm7Er7rd8xBvzWdkRyLDqQiJclXmxkAtiqx2QbGjl8e2MiLESLiB/gtnz8OtxBzi1ceHqHxWDWLC9BRh7hRkJN90Qr73PAq1y2I6hCLFErRh9gQeN+X7PBc4Z6nZh5ldE0LFFB/B/otlaDhvYE/hIexoT6mMy0LBpjeNOO8xtZ2VXScQsTTML6oRDKLCrgQ8If5my7PE+x2ANRdS0bDNzKLCoVwLUeBnNO2pHtylidkwnV6ECwLCtrQj3fBmYVnYTkhjy/i6YdbLzcLCgVQyxeBmYJnfntOLHdES+LIWHgLDFrjrVexn4ECIolDsJgb3tJa6CILDFrQls+RtYTDEi9lg//orjccWnOLDQVwQ62h4YGmwQVp1lnV1MRQaOCLDFrwQ6yx4tHQ35f57T1XTlmlXqCLDBo4FsJZ7YABUNQZG4Um5HUcc3cLBznjh+8B+6OWQixfPfNpwKxCjLoLBrznFoh7VHo1u0Lt0bIxbqLdKe0LBtYnB8kR/5Nzums/ZLRlUZdkJKOLCLuDh9IZ+SpQ3GSRJkLo3HTiDqOLEWPRh9QL5Y4BnPlilz3ymEaW2LeLBkyDB8jJ5c9RVi0fE7OwHSKJhPWLCJonB7ZZtYBB9B6bjREag1n4gKsLChonB+LR4SGL9WH8OVvvFThJa6+LCOTzBe/JyyuoDML7wstMSbwQZA6LCLciB5p5ny1qpzg8iwPleiJhYGULCMdnBbh5n5c3mj8iU0Q1Ptqc334LEyIiB6oJyudu6Vhjdtop3MafuSYLDqoiB+hDWMNw+lhjbMGKwvnEFswLFA3iB+o7qMta5lErw7epy8BP7YGLGFBDB7oFg40hZPw+R96VlW/o1ZuLD6hqB/CwWsAwjITBDcmUz823w1gLEZLDQ6gP8NmXK7NDTi2voqXfYtuLDoRDB9wcxHsRXus19YGDk4XUQSKLGuV6h8gCzj/gfR/vtuQhbiEn5SALFuZiB7ogQQwc2u7cbzW6VPx9JR6LEaLDB9AauJunLKRqhKtlkZnxjLsLEUdiQ64Sf3C+kUqb/MG9Yi7FdyALFaQQB+jV+GGb9Ydoj1XkrNrtKekLEkdGB9hLBoZI0v5snUpwM9CWDsULFa26h/gQ1CpqLEtlTO4XAWy+5UoLFFBRh/ALHciBkbZk05WbeXevIWWLGkriQ5wSDEIMtqasXOwZKJAIfgKLEZLnB/htNtRv+my0xayy5JIgCHSLE1B/h9ihenqc1rZcGBZntunkAs4LFeVDB/yzjn23BsBIg1+M4AIdr1CLE9mRj3CrQS5h89u/cttPSXQewvILFvtdh/gK5n/5/zBH8sgfMpu8nbmLISBRyzQ3gtMXkEpRPlyJlcvg04kLGsm5lukJtjYlDskgNpnN4lWxm2qLJPtzJdhFoyVwF658Bw2x8k2Ql2gLEkQiUqwZaGjSnabQCgPtU416TTCLFaUqJdoa9mza/sSBYLPxVpkkklgLE8riB/oH5n/o4WIYJjjUmRzQdVyLEYZDQ7kP4ZKPA0HxPHxTGYMSulULGj36h9kFuLfQz22mOz0WLEk7ZOCLFyQdh/ihS5d16MDJnQuytjJSnOsLDsrqB/gC+44Mu/uaoMQs2FjS1syLFKJiJdhI58BGnSqVUmAhd9Vsz1sLFmZqB/gCTmU68v7cua46akX7iIILFFBdh/gJY7Vx5SRMXaC5mFOK/ReLDy26h/pNbysgY7r8vPy9QXcideELCyIOj2BrMMU0JTAX4DMro1atGH0LGQM9h/0zim70aY4yhlEeNFrM8DQLFcrnQ7iC66qj2nyhNoKqY/ebfheLGGEPFug5Ot5/uSNFD8GwzzzcWeCLGMrzJdoFiMFVNo/Zxs3UjrmuWRMLFNrnQ7gDAnorp1h+OIcs3rw77FCLERyqB/jxliSIzEoFa/WaPTY/FQILDlr4B+h5gmtfDgeyiDIZq7dMUPYLFMrQB+lFh9uV4xw7tkTC945gbaiLD2ZRh/oI1yyJxo1RiNWsUlAZmvULFKhxFuwxrMDWrphab9yqTpal0U2LFsrzB/gTq8DEZsklSssUvqTEZzELDqhQB/qBvF41tcSZL0Fps8nqKacLF9BqB9ghkkNS3f35Vo+qiSKEczELC8dDB/gSkGgHX/dLHs/pKIag6FILFUdRh/wEgITlzBIroVM9U1sz6y0LGUrnB/5nynixuRZY1pxPZh1ier6LFqQdh/hFQEsX6QDhoOIx9kX4WB8LDqhwB7okijQpbRbPf4Vlx8yUyCgLDqLdh/Ith6RxiPZiaIChqp0DKRWLFSQDQ7xJrThtbiFabS5ZbN/WLFyLCxLqB9CmytV2s/IiJlhjckWzP92LCNcdw6kp0TmPohhdCsgZ9qOEayuLDo3Rh/Bobuq/oISXitA0xPsc8teLFA3Rh+ihmSELlnL6WTL2ION0S8SLFahgh/BUFw253OLOumtZpoinIgeLD2TiB6owwFc0ukhzFtWMo+ycyt+LFI3zB/qMzpSyKTBp9OaWy+V2aVKLDo3jh7l1HFZg1RA4NJHieWVS1L2LFMdDFshyY4DDSGxRxBQ6yeOfdBQLDlBdh7l1LyxtxVNdS1IO45vzBusLFeZqFss2i2IC1do1fO1X5qRmzUOLDoPzB/hI2nQEQXPwpKl8b6U1UmkLFWZqB+oAvststs1TYA6rShZsfwmLCo36h9hA8gd2ITLdHOV0I/cbCdkLGrcqB7hcgYywjRdxovDw/IRoQbQLBruqB7CA78yKlZdq8nvrSGzpvJWLCgtnYZdpoMZ3wL/jOuQ0zTaU0/yLB0unUoMJ8tSjnXNDdgFvndNgy0SLB066yyf58tMyruyMJz3h2dKgKYULAqi9j3ZZ7YFGRRatB82WEwUOf5oLBpnxNI3h+SwoRzG8dzlb6Oh7paMLBdstD3eJ+YYl0HjieKdkXd8rCWSLBvmxB/0p+SkiETw9RLpjHL5EdKaLBqiHB/B584Omsu7nDWBRdtaOlIcLBQPHFu055tT0gSlURsNeOrnTxDgLBKi6h5wpnYd63L8Vo/OxqwvwTM6LCCoiFkg1mnaau2i9Q4Ni65+pPZ8LCaLiB+gxm21Ixltt9/w2mRkkeR4LEVBRoctHgvUl7VTNo8C8ORGQD5aLCaIiB9ghziYKuNhuoFlJTqwWV2MLFUddh9A5P4LFoqnoCuLyeORwi3cLFgkiB9EUjSLGnavqgyZrXxMvYpELDiIRh/xN0wp5krDEKEg8YsVPqeqLC8dnB/Axb7m15tCM7x9nbx9RxWKLDSLiB/ID2nHu/nxJG2+ZxaJGXJoLFWTnB/Ia9sxz4OsGJz9WycRMkdqLFWZnB/IUIYTft2YiGfny31bL5QkLC6I6h9Cx9w+ENtOnq2gbpI7oSpILGWTRh/ATCNTrwazlXFmeVJKN5WELDSIiB/AlPFb82DH69JXBf+0GmjCLGqLQB9g3lZyFoArpsfqL1LE7lSuLDIIiB6CO4y0g4ndNVoZFUJIS4G0LFFczB/pv37x2OT6ZLaHEfHxwchsLFNBdh7QK+G2X53aGCOQavtNk+3ULFqInB+kGsGs5uGKYUJllzekAZL0LEdBRj2EVlxEF8GAPwNBomdtXzQKLFIRGJYw9PaFOpYcxSWCJ1tEbypmLGqoRh9g2qxbBwUmNgQB0o6YJT38LEioiJcpBiNk247gj/Mc8OPpkVSWLGhWnJYwqt5XVsUQSp5aU08LpoJILE2KRh+j0puU/+YIqyehTPso7bdcLJJWnQ7AMpSqVkyDk6WZ9fVzL5oGLFePHj3CMbWBDijZFnM3QP6Lr4VkLGjgQB6owYG8tsMUMxSSPTaQS5E+LFyoJB/4gb7JUrBlX5ABaWslSVE2LE8dxB9lkjofGkhrz06TiUpAkZ14LF9BRh+hCcFtB9n10wjvJRrqMUg+LFKIqB/FkiSKU+zkitug38D7p8BsLECViB9injRIeldsu+ZBjFS6CFQSLDBKnQ9ZpiZq5uEl0KX7Tr/Yq0QELCpXzJZyp44J+Nn5upRrNXFB3LKiLDV86w5lp/4KmGftfXBJjDBkVHykLFN86pN+zVYHWcQf8CmKzlrjDNoSLGWfLh/XmAH+YSivUh+riSuWP3w4LJPkOQ7+2BHyNtL2xhCtp6wXEgHmLE+sNlu4+Aywv1p/d/E3QZN8dCCCLGnkL0rAlTnlWC8bKmei47DHHH+qLEms6yxBD5IESGp3lkfBomWGlbHcLE7yAB9Rzn33Jo83B44C4LOi4lq0LBCoRj0B1ksd3to94KNG0XthqRW+LEkrqB8hRskuS9S+nMKakmhz44B+LEVczQ5wF9Vh6Wf9uOhMc7GZHEOuLC1BdB+gdtJXJQqley/YPMfkcuNWLFr/5pZp7ltFqJne8+CpIeVx1EPoLDSLRh9ghny9NktoCfR61N4KS8LALExy/w5ASYNbUweIuDfhGZZ2K4KeLFVcqB/Alb5jA6P2qr+7DHP7xblALFkrRh+pboNNp45sZGODzk4IaDNGLDqLdh+gAkU0/5An0FOhbWMdpSxOLFKhnB+g+QHWNqnODUcCsLLs9CzwLEcSjh9hzgEq6o4fupj5dmoKUXugLDihnB/AIXji1p1WSrjyWBXTGYRCLFtm3pdha73ASYQpPlEAhzt88raeLEdBqB+wF6O04mK8cRc1WG0kOaGOLE6LHh+wD4H9Vv736uwuVoWJBpHQLEdBiB+gDJmtuh36iKSmy2bJCjKoLFqIqB/wGtNWKgzgU6BKfYWYps3sLFAkOB/pHaYJPnExWJNGZ8UwUVIsLG6QiB/hGrYZA2L0ctJWkKXbEGXkLEokHh+opr81jzPeSCJuWb1K8vBoLDqLdh9pLKmZp47ZmPE0wqQBGUwaLFokRh/MUlSObu6T2HxntY2Lc9kALEaQDB/gPznadKqBOonH0oVxT5hiLGErHh/gjnTAV5pYMDeK8xhwbJlQLEkdqJcgwxtVIlmwE0rlKnMH8LPMLFFBDB6BRovezfV+sDtqiveK22T6LEQkiB/llpSge6M36DTidWYvMX1cLE1BHj2MstEBn50MewO5Klko90XULFARnB+oIwXU5szDaWXPZ0Vzuk4GLE2PDB/gIOsS9cRJiXi19RqPMn6kLERPRh/iC95EZiMF0asF5DT8cctcLCl3dtM45qSRGD6xyBh9MxgQoV46LCsuiFuo57sDWoVf5Y6FP225kAEeLC2snHifh+Ya721x+WeRUdmFMm+SLCy2jj2Uh/ZGgO5/LGNqWYZCmNZKLEQZYYZlh8YnadQiEPNKRnqeXKPCLCgVwcIFdtsLOkLgwFr6O2l6BRnYLC4V4YZ+h5tDxVJX3ZEOqsTdAyRMLC4VwFs+h5tLwhUf8BU4eoQclXE4LFAVwB/8Z5nmY/+rOqdZkyzwhIRMLCYVwB/6R54AC6BFTHAt88dFHoJYLBYVjw7wp54ADl7T9PU3xMBL7m0CLCJLnJctJ5nkT++HPe/mbJxP5LogLCBLiB/wXmSpi2G2+NRg44VFiMzwLCGZjtMBpnMB187ITmZdTd4KBBdwLCxLqB/sLmTJ86mKkdo2S3wwK5XQLCcdzFOFrnQbyJqgFNH3zZL6JMLQLGihzB9gPoN5EaM41RPTSoNFFpo0LESIzB/gowdw2WlbKwc5uL59Aa+ILE2ZqB+lBiHnexW7rcJ2Irx7g1TALGmZnB+1Q3Q0trK0UeXB5sb9m9gsLFGZzB/wndwwGbc/8CrBmdi6On9qLFOZRpZhjdjwVnEw8dCPs9qga6McLFGZqB/CsvjzEl0nffiTCjLIeJCsLEWPiJcgIkCEOwpXTKBRChfAMY8YLFEdqB/AHfcje9Kv1VBeD4LP8MGkLElBzB+DL5YGSFjMbWCH+0J4XG9oLDqhDB/BH6MDdNT+a3eAKi4gYs10LEyQqB/wg18AOzj2utFLFTYroVhoLG1BiB7gnyyoonf3d0TBgy7kuXBsLGq2iB7BHwTrY/GnRxFqtdJFo7QWLCdczB/I7qHyyd7t2PXaVw/5fP4sLFoZ6h/BFtC24FiKfcdE2u3FXcUILFN46h8h49w+6eBPkrkRqlL07iZsLFCQDB+xVwmt5OCiJOUqm1jREmJOLFuZ6lOoS9ELQRGzHifyp1b6EVNELEVBiB6gdK4tWwSVtSp92XeK9krCLFFBiJYtHINVA8UqhjDta4tyCx2gLGihnB9gpmZJRkPGC2EJTNAsMLz6LFqJzB+gg8Hb6bhkmjTXhG9cGGGoLEy2gh9h41LI3gVcQul7Q6k9kM/kLFuVRh/hn6YBT5gt9h/aHi9CzphaLFqhdh9AbnYOD+GaUcET90ZRBGcILDqIzB/lbrLh0djdZtuLbhqZoLrCLCFcnB+AphINFlFXTBrCaCEj0Si2LCEdiB/TK/75WjoOiO+FVBYWlMgELBNQnB+ZZmYGZrq/vnHW5KdZDgOuLCCLtJd5hyvw14R1XW3I7Qq7jFWaLEIO1B/hZytWOjKL9pBdRodkHWAMLFKfhB/gHZR8mGeh2XTqh1rZaaUOLJKh1YZgTaABE6GHK1K6aZ1NjpvuLGlFtJdg0t61B1UpAgSTUXzI5SqWLFCLLD3CFa4ZcSDdKXhVXaCpONUaLBlQiD3KAeavUk5RMkTQpsjmaTgSLDWY6odiTiqykF431J+Qn1P/kqHCLCLciD0JrzM8y8aY6E8dg2TT/SmeLEWs6pcMvsPnWUOVIOoeS0bFBstyLCKVRw68z2MM7iPkRHgypywSEoZKLEQ3nB/kFk5GR8vhCOk0v2g3YgpyLC8dnFqn3mSg16yARjieI5cJzVCYLEkrvh+gsbF2za95Af9HHFGS6NGCLCsdnB/wBKYZ/xHF+9JPZzKhFw2aLEyQzB/gHX+F2Ab1JtjTdGH7wHPKLC1B0h+hAfrqOWdEP9ay0psYYPReLEVcOh9hBxpZeOzr6vGs5OKl2ligLC43nB8gSu59pnme8f+qLOgfaFkcLFKQdh/hgdsCX6npucdTKfNq5HycLFCL0pYAvnYS6UmWLraTzC8iwUYQLFOVnB/wLjnw9uju+HXcuRpURSCcLGmV6h7hDMh9s7+z8bcKVQrbXy48LEqJvh9wRgEkrkreMSJHncC7JdL8LERLnB/kNeNC3sSF1mC6xG56VSFaLDuZiB+ghwz3sz9j+3YIGGYqNk00LGJLqB+wRuMWO4xwhkihPuwWKs96LFuZ6odmnh9SoekoHbswLoCWJZx8LFBL6lsACnwyqHlnks8CWUKT2DnKLFFBQDyBdkwU5zrwYQq6vcAD1Y30LFCIqB+o8hlsWyMlO7W5NLEnJoJMLEyhRh+hX5nrHwKMbCwoeQBbNPusLCqVzB+gRKy0md2xP6iOY5b8YUKYLFtBdpNoZ/YnBkBFkBYCxcNOJnhyLEUdDB+QK3oW/AbmEeuHBLaxFPqMLFOZRh/hBKj0tjTL8dx3ZO848h6ALFCJiB5gNa4fYjqWWQ+JS12wEiEMLGuZ6ocgOFJW8NEi+BUmDPzG74BSLDSQdh9RkqRvNwF3aCYvY1WM1Rz2LEV4qB/lP9IRGqCKT+CxKPms3d1YLFCIwB7gH+7ZjAXx0AG6b7Hfw0pQLEyL6h+gPwMUeDmbyC+bjQ7hEJbCLA32nB/u5yIORwVG7tYhcnHqoP7MLChpnB9255tb3sUM1XrOMi4hK2PKLBpKjh7vh7YfW8nQCyyO3dqECfTkLDGOnB5+B+NeR9nR7oo9LUVdF0mmLCjznB77R+YSHtL2dhlSyMgqSlDGLBuOnB7+B+SuvkkENCFtx8YVGO9ALBzznFqHh+NQ392p7Ja+RZaPmS7ELB2OnJZcJ+4ZH2oquGKAM8nGdlYcLB3+nQ52jVShLkZL6b/i9qoYmovGLB2OnBfJbVYfH+v/dzxIsq5oe5a2LBxovhf+GAYKD+moLa/KorisQB8GLCmOnB+x2AHuPgjpUGRiLG45Det0LCrznB5LUqtez80eSyVT1+dsRdGYLCpPiB/Ur9Nyu2FX6kOhELcUPLlwLC7udyiRnNGN4PGiY3G5laQKAmNuLCxXiB+Nv75/e/K7zUY9Lth4T3TMLEUdiB/Dh4wmojlzNRMHk6VNw4veLCARBB9hpmNI88BesjSGMnaUOpgOLESQRh+gI/k8/1IBwUC/lLp3EVsKLElBRh9F5nYOhj4/1X6sfYG9oG0OLDqh6h+g7qE+U0SlY9lPSO0ZKpdALEdcRh/CAxHK9joqyA4m1WmNlXheLFgkzB/CJKMGUP+Zc8W7s0g69j/yLEUd1B+oBPm23xUt4C9e8cAQ0JK+LEexzB9hQfTp8d68zHJh1JS/YdP4LGlBQh/Qmw/DgIhau8HySG16622ELDUdfh/R193CUW28Pw8US8jtueFoLEUdzB+5QbbUuXM/OFmEnKjF4bSOLFeZiB+4t1WXawRbhtSxKrWPoaOALBg3DB9MofMKfZ1JlefWhPpbGkBgLEYXnB/6Qcnz9kchGn0rZdUhmnnCLDA3iB9gS/6gqofqLjSWslUVChN8LEwZiB8pAeX+mxi0f47JMnpuCijILDg3DB/sAcmgJGUWK0rfY7+HNF3ELFaLiB/ghdNC8vVrqeczDsJeQ9hMLC144B5gvnYbHGk8XLo6l8dqPZwoLGOTzB+wsiStMB5utLl3BCoj2MjuLFMqvUoIAodOsgq5cD6HY4FSQYH4LFBLDJdgMOD0pBPATGoiwuBr4cHELGahnB9gSXddBl2+2xLitV0UlqvoLCw3Rw5g1NsPd12j2q0EVTEZ2TwKLGiJnB7gSdN2R6TRLlTJO4FChcWKLFChnB7oXKNVl1VmVkJKIPYsR+nOLEcdjh9gC55uW4u4bX0z2GpSJcaELC9BnB/gJ0Gpl5eXJR+Gx5Dipo5ULEdBxDzAUfny8JWxymX/K0ecLKqsLBmOnLFNxg7Cl3k3uBcnYt0oEMqwLDTj6h/cJt4D0TRNQlxrcn0UfYWwLCuK2h//R7YbGZOm7PamuWYFWiF4LCio6h/R5+YM0YSxWv4ctGyEKYUoLCtrfh/65+4XSAdi8GALLXexGk1iLCju6loOp+YamXmGFQJRG/K4cIg2LDF41B+/Z+y3Nly6DnW5WYbGSnwiLCrn6h5+B+YdmcIGp3HF0XrMyUQQLDV46j1cp+YbsUfY+ykDIrF3dKcgLDlr6lqh16tNaZkg906NuQ7WKenaLFHI6h/4d6nDYDjWLLsHWialq0KILESoiFu8Lz4Ac6zgxsGDUohCkkzWLECVqQ5wxnz7uxQgG2qW5Hq7GbbQLGOZiD2ADkpEC2v5OrBnQ59r24hkLFEdzB+4dly9yJFN0Lvxh30TL4byLGRyOB/AD3H75gLRd+AgLZgD7TEILGNrqB/oJ9tL+7X3icQGlLganzneLDuVqB/gstmhstDSZca6jbY8HmHKLFI36h/g11W5eFetp1wO+czf6veALGC2dw4hDJTenjLtGY9SCnFka41SLGOGOJdwhiMWXgj63Y9FGtzUZkr+LFKhDUohDuNq9LLyi1OOpOYnH3UILDq2iB/oDPsaGpF192F0lS8/lb9wLFY3dh/gUzS4h1juX68U2TOmywBeLFOZ6lqj7OPSKL4YN7MgUS2f4TvyLDrndj3Axw6AXxM0UfmO15o0mBwgLFN44B/pRhnoZO6k6q+Wq0K9po6cLFShd4YwxkjhdmsmG6GQOnlzA5sGLGWZdh/AAgoWnjP28HQ0nn4qjzACLFKhdh/wFyAZPys77P6RikSp2QV2LGFBRh9xdr2cep4KhjloRvq6TqYyLEqLfh/whiGxSRR+5SaabqOIJHJcLEa2dh/qBoH4/1VKGWxxXRBOZWbWLDQkfj1BCVzxsaLdf21gzr2N8c66LFcriB+gRozkap/+b/tGYwPurax4LC9cdh+kAc7elxHtm/g50wXZ23x6LDqhiFqhtYYI+6LajlAmmWqlKBIGLGSJdlugT6+ohqdx5KgJwyQIeLAmLGF4qUooBTKruqJrp4r+knyUdIEqLGrgOB/oXXmrB0cUP1RPJjXj7j54LD6hDQ5g9uQHjCAfE45Bhak2MIfuLGHIqB/smLYs2wAxCscbU8Miac4cLFY3qB/gUaN5CgazjHD6lEcdODu0LDuZfh+sBZPHeNotSxOdGsv0eZEmLFaLDB/gkJ7SHT69kv2fV4M0VfpsLFS2dpcxB6JHdpPnMGbKo6GUZZyeLCOTqD1BK028spr9sdMRA2mrr7GCLBtriJdVJpYzEmA55BiZ3n4YS1I6LCgR6j3Q555RhqRb2CcDnLAK7bnKLEGUhFurB5ygUEb1j0U0lTtb0VdALDOGH6RBpbykM9JySlClS2Ii1aGuLFsmH0qgFa4LKmmqAgEj0wPIczeYLGV+LUqgCcypSwz2PrKsZzznFVq0LCARxJdgV820aR63fILFuQsPazlQLDE6Q6RbhqzpwNTskr/BkwgIMBWcLB0y6rRSx54U0cCQvwWNwmPU+HniLDAI/B/lJ+yoJleT8LzYV4AwXJHWLCmN6h/ix5yymY0ewEvzi87KSaPCLC2TiB/jp2N9iu7O8JH2V0dhqM9QLCJLnB+LTlyfJ+AQV0e1CTZ0cymsLEmW6w7FHh8OoGzYt2PqSnVNfDe0LDhWqFuAN9dIY63SU6XqW5y4iWNMLEd4nQ5gLq+G9zOM9tqIeVbNESDELD6Q6h/kKUShYNfBB/w4LgUiw5MYLC1rdh/x1s4QX6Iif6aFHYILjHiGLFCQdB/pTmWDuBs0UykeNcWqsJSgLFBLzB7oAVuVCctZLvkvSWeLIkjkLD1YiQ5ht84jS6TK3I9kwjx9DzQCLDqoDB7AYZxb9RWVUa44DOUdsfbaLDw3Rh/hLmIyVmLUMDonLqEHS7EoLFVYnB7obmTXPoF5OEZbEM3vKR1uLDsddpZpDgDjnytk0ZSNk+OTbP2WLGGMglsxnwobXtp9R4LAOy0vkrkGLC43/j3Rtd8YMrFwuNzFPRGS5W1oLGqhRh9jMcS+xnLJUUIzNMlDE7xmLFNBwB+hHbSvfHx120azgM+8BLR8LC+zUw7h+QlLlcME3pJaMMuUZf/MLGtBQB/gOZtlngjXDG6M6pMp0bbKLFCfGB/ohLZQ+YvvA8a2aH1JI4w0LE4kQD3AYjdBbmM0nOnhAe4FKHNsLC4keh+hjC5sRRJ9ALUjOORKGcroLFywrNMpBtMq9czyhNDt1U1gyAfiLFAZjtIwFPPRA1PSJrPDMWXbtNCsLHF/5rUAAa6xxbFM4mfxWtsPzETQLFiLjw7hllvC02olOIfgypMJS7soLFIkvh/4G86k33l8jKz+2ExXHV4YLEqLRh/gI+YTrzV4ztIC3ZGi8I+aLGChjh+gVbBtA4T35yzHMYZxP9caLHgZRh/jEsm5RoXNVTWqxn11mGMKLFIZRw7gheGCbq1nOHGb0TyJmk++LFShiB/wB4NQ+/HNcpybBJYozfSkLEWVnB/I0o42XkIrmDCRF992YYLsLFpydh/EX6YW7lHcMDrDouNDYWzaLFPbnB/5Af4uD1NSeQUkw10agVXYLDRHRh/gq3nhF4hPCLw/Dy9Mj9MULEVcRh/jZwa4PgOGkuCOs3JBd09SLGlBnB/gWoTYtgPCqDJrlSwFytpQLE0OnB/lBn/cdsWAtdxbIlWX9fz0LFKsvh/gPlYpnsmdeCPah6mV2RNwLFyQnJcxvtzkPpaOTuPykkHbZBgaLGnswB/g35ZV1OCrCmiibb+54hwCLFsrnD3ANctZxgqA1V1ErWW8My/ULFKhRh/gQrGpHoYl2AYVzFnheDA2LE9BRFupBTGwS4BwhXEC0abjsB6QLDI3nFuJPNTTh5KD8cjk57bXNgykLF2ZiQ7lR4GHciEov2cEqUY8amwKLC2TRpcggwTnXhNQgrUusXmEOsTSLC8rQB/gMOn8F93JWk4ZTWCUWjIKLGoXRh/pCxYWZgmgRb5zDsiaO3TALGShQB7sh5ESxyFM4BzjIfeVaEDwLCdBRh/gNnnCbx9u/yWhmj8XuNt+LEQknB/glKzyHjFojRVUrTBpLE8MLC6L0h/oRiyKqEv07LCTQ7yJbBLKLDoODB/oD4JkzNHnnKPYukWUtKfiLFWZnB/lf4S0p4yGCxsKc7j32MYSLDsdRh/AM4MmTh7fB5sZkSzEQqOQLFFcnQ6geNSCv1uEbzHnmrlmJV0SLFCLgh+idwm7L/aHJzXOu1Yp1EYQLFlBvh/AC3ynlmM57AfxjMOQL8WULFEHjh/grGCSivNdqJUI0Gd9arayLDqonB+gQ0JXd3sv12q9XUfDqkG+LDg3jh/BP8zbQ2aniNY/cpaufOtKLDpLiB/4LpZ108oUuSQN/F1klI7KLC9YnB/pqaZXVvgI6bPXKmXLhcDALFaLRh7oJOD8D+EFfHskBOEwpY4qLDsdnB/kEN45dzKnuODItK6lpCzULFmWwB/hicy0lRFD7o02LNtad9gmLCwORh/gNPYZt0uFOVSoy7GSgU5qLG1B/h9gjFsdQ9/rDigAv0NTDLG6LDAORh/hw3c1fqQzFFnASsa71jP8LFVBnB/jhwsJtheUYB8jk7VpaHmYLCxynB+gv2yN/5JfnTUHGD9OQk6ULGoORh/InyJa183omT8ENaahrT+ALFuZRh/okBRS5wZPuoaDjIL3+KrcLFC2QB9gPQZWrpLJSSO1aZ5tc0ckLFkSGB7groT7WOsVXMYZRP/hDl3gLFYZjh/hNFfZG57EqPnDsLL46l48LFYOnJdhNtNR59xC2hyI6V8ukgK2LDqWKB/g67QvNhV9ai2k0o/dxBD0LFaLnB+hB7S3xiB2zZL+e1LZrDIGLGARjj2DTcS8UiZ07k2cuT3brPpALDaInB/Ap4oW31tFmhm8UbqJlGSELGVBQJdQp/mWfhBHOC0VE/jy6XNULDg3nD3MD8NYdw3gDjiXiHbBdoP2LGUdjpZwg1SwIrJ3LZLXR+TcHNqkLFVcnB/g1em2V7egCLpJorqjBl22LCyLjlug/oHr8y5BYehqi9h8OlHALDoRwFsB7KND1P6OG4XwpPSpgSQoLDaLjw7wg9nx14lr0lKfOZLPEM8+LDuNwB9pY+ydBKuIqjRybnKRoX98LFSLwQ7xi5WgFLRp2fw1M0CS8OkkLFCLwB/ho+T85HJThPIudak8EOIgLEYRnFsgC1m6/t+2yBlznptcr5E8LEsrnB6gA/IcjsF0Yv0LjJcSrUoELDwRwQ7RhKyzZfNnZ+fyx63ePlzuLFAkRh9k50HfRvEYwBL0zylGQ5JOLFYRjh/oA0ToC3ls+Qp/BbjbfcMqLCsr/0oARenS49GnG2HMsUcQbZkkLGwOrJdgFsnA5+5CpR8yyzEnzJh0LDqhgh/xSeZEp9DyVuVkT6XCm6lILEdcnB7kkLz6n6gzVx6HGqJv3pWeLC4Rjj2FcaN3WyQc3gKMakpY7CLULDiLwB/Ao/HrLexFXsZQfJWDiX5yLDeNwQ5FNaYYbeHfrJzCMzKO41DYLFasjh7mKdaUr+PrwXWWxa3P+ZD2LFARgj2AhqGzZ6LwtWRTuivFo63U\", \"duration\":60 }},\n\t\"5FNN-5MIH-S1VP-FT2O\":\n\t{ \"content\": {\"content\": \"IyFBTVIKLNEafAAeef/hgmeAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALMWpzAAf+f/hgmYAH8AD/+ggggAALNEazAAf+f/hgmYAH8AD/+ggggAALD6uNMj8wOpLVu1gW4hdzeh/fgiuLHMNjlqB01YTTpJe9NGDEmhhMt5CLHqXRlury9xLLpjD/pX9Ks4rQp0mLHsNQHmADNTQZqfpPC5pkkLcwhoqLKCAnB/gTagG1m+/f3Pw4reCPGlKLHqj4D3Au9v4R+KR4eUXids9B/42LKK2iFuxjZYZCs5rg+GeUdvDP0FILJICnQ7wHNvO/0SGcNYA9nqe6IIcLHXt4B/oCZm+d3pG68BdrUOlZrrKLIUXQJdgy+mlnpq5xXS+qsA9lFsILGiXnUqgGmSjvxrrmW5w0Z7MIUr+LF1TQh/ggHo/+a8rVdH6Mwoo0VSwLF4cnJdhF4okz06yd7kPMN2UKwGOLE4EQD1ADzud/7X0HHaa9N0IOnzmLGkXdh/ggY6KmTJdbl8+zLaqdUbiLFqAnB/glGztD9IXOFGiJq8h7aaMLGkqDB/gp5ZIhKrTagJ41Goy5E/kLKHtQh/hAXio2ULc6sgBl242DF+4LFftRh/gBMH7w1XmPGIcjSKUZFgyLD6h6h7pxmH32IzkDHVxHyYCIMNGLHiwzFqg9Dnxwe9+MtpVzqHd3q/wLD73Oh9gZmXu+ImWGsYtmFVgiUQILGQkQDyMFjmdzwOxB55Iytbl+av8LGWzqQ7oAlthw5B0YOj7WqJHnTWELGolnB+hRmNd1xwOvPfFLZKpsQj8LAIIjjzCN1WdAKdz7y/+UKaYp+gkLBQbLYZ1I15UWJSN4WTPzrtlH7UMLAogjpf/Rh4aAaqxoNFjmbuABRZkLApejh//Jh4fiIDaVCw50WMGePKALBnPdtM+hh4Xg7FW8XczMm9sBR5SLAogDyx+BjHna1/Ye6kKpUoxaGpCLBnPtD1eBmYMBgDq/lKkRcOljDLYLAuXjpZ8JmH0aB/yd8tU57yj+rQmLBmXxQ7/Bhnp4f7tfFt1OIWbBhnULAtstB/+Bh4dj4PjKlB4arQeScvkLBlLnJZ+hh4DhwF8sjGpx2nASEbYLAtsYFseBh4fiYZHiYyvlxtiNtvCLBhnUh66RjStKxLnW3BiLwz94gcMLBnmjh7eBhn3821zrN6FbQ93Yl22LBobQNM+Zhyi9+u3kZ+vs1Ulb2v4LDHiQD33hmYMNpK+9txhpC6DA9UOLD4c4co7hn4CFPeD8WunDEI/7nFSLFqpZ6RLxntXw1Qk5+tLMYyDAVOaLF6RdPEe5nn9aSfHjoxvgiOUNq44LGlQN+EOBmyvK13gUwmK6oKmNFj6LGmsNeAWpmNfVjZbzCWQayaY/6N4LE6o26ZexmNEVTc5Y6W7qtY1jTIoLHGsAHmeBmYaA8C/+C2lNTlF6bM6LGioVaReRmSsudu3KKRPAtOYYJtoLHGsc4Z+Bm4NDXP+TG7YxmW2cRDwLHGsLyzPhn4cmFN8GMqKTNQYTiKILGlPI0q+Bnytqs3qyEhXmn1ARLdELHBWItM6Rn4Ti+P+CDIucqZbAOqKLGNPIlu+B4NeWtf4gTovsktTUahwLGFPU6R+B4YBmLnowtbQc2eD568kLDpWUtM2h7S1eLoBiAJXPjeYHHS0LDjgU6V4R+yhKZJhJiJTLHbmaXM8LDlrUw78Z/nmUdSOLQ0Um47IaIB+LC6tU4Z6p+SnkUNFFiS6UdkvsWlSLCEriLWJZ52la0IHbFvjmJiVJY5ELIACH8IpD2ySej4+zpXJCoaRPLVgLG/BtLVAEANF5z1ct/C8+YE3QedOLIcNjlugJDQrk1nGB38CYTm3ahDELHQWtWiId07HH0+KUwhSEmPMa7JgLC1QZFuARxp7UpEeqJwqDfQQz/CyLFIBwfAOo3Za+kNY3Ds4Y5EtJkRwLFJWwPEeJn4ECijSyu7KfVpjcCDyLGlPQ0u+Zn4KBaUegdFXOtAYrzaQLFPIQ6TeBnnvbL3jeqLtWNsUqNwwLFNPJnm+Bnn881+JS1cVl9foUw4iLFABQyz+Jn4LjAFewDiC10ue7ACaLFFPwSzPBnylKqppDv82lWQrTOEyLC3I4B/+Bnns7V8U9CISLWEWhXR2LCwVwQ56RntYS9JNdz4fhqvlpxO+LClr4B++BnykJayVG55BFMAVLvqYLCJo6jncJn4MASQ2tIs6T4PiknFOLBQ3jh6+xn4WECJF4ILi1cLIekaoLAkdnDXD5ntcD3HQinkzOx3Y9LSCLBIRjh9yxn4tCMKV1UsMhtvTelekLEUcxD3Bhlt5nRxtswiJ5ajGth0KLJLAvFugxjNDsnX42Op2qH7qQqGyLMQWHFuwptYqoJ4Gi1Gn+oVfvKWgLHijjnmABvk50nn7jJbsfRyBH1JiLMFujyzRU44cGhQJruyQKpoYKkyyLKkGtYZhB8GXB2mv2GLKopusdMjILCCYnNMiEY4yDu2QUeSBPJZ6+/zeLDEuj4f55gNGgBq53rZCKrmO47omLCpW4Jb+Rh4UhxCzhSEO7eCrKXZoLChPj2ieBh4EkXf0tOmBKiOXvvtYLCoVTjz+RjYRB0m8mxPRmTXEKv4YLCuYYHm+JmYQgZdQakXqa5mwoxBsLChLjh/+Rn4KCs4QNneiQy5GSysaLChLTyzehtYRH0kotBkiw7CZLpmKLCgVjyx+R4NR2jYNMFCqbkSffcLoLClQQFq+B54QHoHhTBM0p5hpvpY0LB1QQB9eB54dnpin05Kt3SDBDBlwLClQjpc+B+YUGK7xJjPknVNcc5fQLCpPTnkeB+ypLgk8rGL3KqaND/3KLC7cjlqfB+4fC3BG+VBFkmPB/SL8LCefjpYtJ+y1aYk7kDHtPYBzYQPMLC+fnQ5yx/yqLmi5rMjXxri/BhG2LCMPnFi4B/G6zvH6XVaRCRtqJhw+LCCh6h+ph5QEqLZqvWaZDCvwMjqYLCwOiB7tr8NQ8ywR9LzFNRccdLIOLCcdnB9RBenJd9J/sjHt1y11JrpiLCFYRh+pRz/tjuRxzJHylIm7SfjiLDTtwNIt9zPcm7y8x47cOcm5k4vSLCpKjh9/554eTqMVTH8u3cZZzBrgLDRKjlu/x5nhePqoDEAV3EGURkrwLCpKjtI/J54YHvFamEtJiw1rI42uLDBKrFueB54Kllcs2j1IqF0ZJZauLDBpnFsfB54blrDiFCl4Qv8leO1qLDBKj4Z6R7YFF9HG8xWvRv7JIePGLCotRFqeB+YSC6QLonFjq0jAm8y+LCpKnQ6+B+yrL2hIDGyG4mQed1ssLCX3VUMtJ/4MmwVK+EkNO1/Xlm1ALBxKnB4Sx/Yel+lWTRm5c1yJyaK8LEZprJeNLVShJkoQtZrCZzl/EhqQLCUPRhtrUrm8pkUdkhnrJLgybvO8LCOT6loQL9SSCYvMOEQAXaf75cXILCCIDB+6VsSnDHyVmZQSfdy/SUMmLCGZzBbnhn4+CXMolcYXNQJWVZhsLCCJiBzpZntT01X3aDYXuCYPmqt+LAShiB/hRsTQy0u8cTnLStKISSo+LCF42ocb5mYfKXhUCwtHFGMEGJyILCK00lu/xtZcmnMymts5h19wRqQSLCsrLSznR5ZYgeX3ylXPmZEPF+4wLCpHp8J3p4Hj/uZhL92Mb6n2wkG2LCthiaxfxyyku6sx5Canh1byaCgGLDQhzWm/pn4bnEglN61vvRWlbCW2LDiuzaV+xn4FFOEpCdkbOGv/rQzgLD1rJvEPBnn545mYoeFLLdGgO/5ALDmd64dyRy4OkufgxrqyuxaaQZNILDpqJ0q2h4NXytwbmxlNPqA/0FRaLDt8nLUWh54Yx62QgpmNDrQkG7QMLCrkjh/4R+SvuKFjRl2Y7snYGk+8LC4pjw8h5+4PeVn6g6y6PV+isDMCLC9S6pc47VSiQfjCk4kuaXKrxYgeLCfb6h5lrVS5SgDZmCtI49PBFtyOLCMS6h7pZ9tYSB8DnSzCjZx0sLMULBDVjh+tbzbSGW5eT0dKsYBacWfGLC0qxSxGdr+tEO+EJTk5s0hlPjbwLEgQLB+AJb5FYbcazUiaUTpmORySLHSIiB+lBsywoqugKgKVNZFP3KIgLFQRtQ75/ZzjPgrFxHxKmLfgZIVeLHoeHpdgI7OyQgtHTds9nFrfUvP0LJEcHyzBItNuSpmsZa7Skfd5x05ALGsc5eAAumYIXhl6W9aqu1J1lbOyLJY1H+EAiksro+4qdq7QVr+l9Rf6LHJNH+GACNGk2/0WbVbofJ3GdCS+LG9zf+EBHuvNntiEdeM3LNgBo5p6LFIsLSzADWY/S5Cdb90uZO3FqGPwLByi6+Bg5h6gUZvvW7tMWjOeyaS0LB1ztWmmxnJPX7u6u+/DJbfFx/ayLBzWj+Adpn4CGmI/GScPLR2hwLJeLBt0teAeBn4MDmOTAm0zavKqfxXyLBxejrX+RntQWtwMg9oQrY5XPMWqLBsUtaRPhn4ejkQo+N4kyu+A5uMeLBtLjpdyxny5qg4WFScGON5eiSloLBmXQFuh5ny5rjsDlwXt0xhASAfOLBVLfQ7eBtyPO1QAQeMT61vinWzkLC6ZQNMcJn5Oh4fHAwjTjoZQFfZsLEQJiB+hJ4QOgrjV4qnPq2THPDiULESIdh9DRiSyRrLP9K9hGHgXDNY4LCOSiJJ4ZgNXC++MRwMFp1pATRAaLEVYiB7A7q5RAi8fqw3BNGHnUYrELEWWnB/JN32r/v10Nm6ka6Yd5U+uLGqhdh6APjy+56lX34OFtCOS3oS6LFokRh+gQeclh5unSU0Oxw0dLoMaLGSLiB6gixGcoz4F6vNHaNoHp2pULHYPOB/pJwng17tWWBYrpbi4Ht42LHfHOB/igxtCT99/AZy9ovfLlXT0LKShOD1IQZvd5hMRtrjqQaRvYSYALGKhAB/kkhC7r6Ucg7ARc0Y58lUwLFLkh+BGdmSHDozg5zsU6Wmn7swaLHOLN+EP5tYPOgRO5KsCReEN/bNqLHTy+2mHh4YLgCWd84nBPXOhyEPKLE7yI4Z+B4Hz8B43mB9ZvDFIl4YsLHDyV1qnh4NJRtjFjJERXxDI6XuaLE72scM2J4MPUOm5eVRP1YKc+wIWLHD2VtO2J4YNJsWSgWGbrgBULoiSLGnk+tNWB4NPcZ7b5VNfD7PZLP20LGj2+w7tdt4PEIGowdkXWCV1FqnwLEjyV0sA9tnrbktpmFJQJmYEdHRqLEfI60oUp5SusL16JORGdPDzah/kLCCuwQ5A5ysLcxlbUh1RTyFETkh2LEQRRh8hhy4e5/pi0hRAovScT4Y2LGomiB8BUwmPUtYmimeYVzOwJvQkLFYQRh+oIfZABolcjWXgVchcLFHGLGhQHB8hI85JMzHgXcO8+ydDpP8SLDYlBB/JYfNjk54AiGGkOkQPFFCgLF2zOh5hq15cnOLzcf5JgHQkfO7ALGmbP4ZohJtm/6G25y8Mcmqv6cAKLHTMTj3E4eY9XXYXH/SQ06Fcqm7ILHQsUaRQhqPm2HR9OK/nCMcA30ZGLGinT0qgLjYrDkeU1LJJpV5q7dYkLByBp6RSghjZ17gtb0RmWG8UPFngLDBozR5gp548VsDLlsC24NVaXeVOLChXsy1cJ7YLXy/5QiemeG0RhkX4LCtqslu47UYVD3ZnBsV/VmQPCUxeLDWSdJdL2ASmocNgaCLjyyOm8Dw+LEpX6yzYbVytaQP30g8nhjETxMN6LC9Y6h94cqysqcp6OmuPbobmJXvILEY3nQ7geANTVwWBEBFrlE4YUE1qLFFB6pcyBytVykHpxujha9ACcJleLEkdQluIxt5Y4Qkg15UoRyNHUzTYLGKhRh/gV6QZB1WWYZeju296mSOILGwkDB9BAVGuxbg8ltTIEkfef6+iLGvtDB/AlyHJpDb1KFfaMT2LUeokLEyWHB/gllHpMk71ZLQc77seWq6gLGIQnB5Bi779R7R+kR7Lo4QEYiO+LMSkTpZlHHk3htiK+wMTtRiw5q0KLOBNjnmC5+HSk6nYbfp8SDVn2bdMLOVuj6RBi0Zu26e/0n3ZiGaFLSl4LPOwM+AJHZD/52C9tieMRkOcJjiOLPkZneDMqks573Xf8hyS41yRL0iOLPmDs+HBsIWL+uYwec/TnRvdZxdWLPGwYeEgg84M0MB/C2Gsx/vKDc+oLOArj+BAiTZbM+0Z/DP/0sgZkAt2LEbD6+EACgGLoS5q1Q4IY0Z20XM+LCiRI6VYB6G1+s5k2hOyhPWO2OoeLFDVIrWeh+4dWkpb6w+BuCQQKRfCLDqtIlu/h/y6o3qXdy6DPNkYBLPOLDqBI+A9OASgIggQzGGJMKMD5nLYLFCuItItMq4YgqM47tHyYpywNYbOLEquItOox/SRio9kRj5x2bJeC0HSLEIcLw7pJzykAUBFGJCSltacIyggLE4Zhpdpb5cTRtyCwaTnReHltDsgLJKYAB/gll4qZvd3TwhdypFkRkMKLDoZ6h6ANtH9aYXXG9XiJ4HhRSzQLFxvzQ7Agftj0dhjD4ZYaXmoGhoeLCgQDB7gF0Gw7fzFZLw3wSyq4p8uLDr0Qh4ATzy/OUkP8bfrI3ypQKveLGmz/h/hRmNBV2bPYH2f2ira3rLQLGY3OFqlF1X7R2zmWHnEr8WbqrFcLDuNRNIkGAbAiSKToxFaccDqYYCyLCo3qB9gPCJvWuXPr5aXKtzoGu/4LGChiB74PqYx8vfcFzb5RIXLElJ8LDtBDB+xLgH31WphnpZZYq7gC+U4LFARiB/BvoHn4nUBq5IxiHUcWXQALD+NzB/IHCHjIENi36E9hq3UHmrULEVmjh8gtNoPesplmIiLWVoaE0cILDxy6h8wlLGckBVjqrAdNSyms1yWLC/vzB8sMyTlYEcINn5Zn0euUYvQLGVc6h9iptSIMSNcK+1TjIhLgqzGLCQ3zB+CTFymQDGM8NCuFyw+SPzCLCoRdh+hPc4VGR6MKl2mWTdkbEb0LCahiB5wU0jY6w/4GOMpOYIcsnZMLGA2iB9RlYNverwxMehuyHcILtSkLFEriB+gnwtAo91mdBaxeaM4Q3AWLCcrqB8i3yytU72dCX4Wy0s79H9oLDqwRB/EEePX8iznNuDhJ5rLese4LJIkiB/BW8S6Yo6gnbCAfbNxYVOqLFOGqB/5IaTBm34QwqfrSV3A85rOLEaW6h7A1ksDCUc6bwmDE48Gtew6LEeWAh8RBYG+vNTjDAsLHIyPVIDiLEa26h+YhcRmKCbO9LPsyr6I+inMLFftqBxm1/xu68tWr9W9ndDrL6wALC+PRh/YVcNlxsAK5oWHuidPmaqMLD62zB6kFNxWgLDRFldLUMsJY0QQLEXHdh7AE8IAWYP8d8Ec5ToLZwW8\", \"duration\" : 6 }}\n};\n"
  },
  {
    "path": "rongrtc/README.md",
    "content": "### 调试说明\n\n#### 配置\n\n填写 mock.js 配置文件\n\n```js\nvar App = {\n  appkey: 'appkey',\n  users: [\n    {\n      token: 'token1'\n    },\n    {\n      token: 'token2'\n    }\n  ]\n};\n```\n\n#### 启动\n\n1、本地启动页面 http://localhost/xxx/api/api.html?0\n\n2、本地启动页面 http://localhost/xxx/api/api.html?1\n\n3、两个页面输入相同的房间号, 进入加入房间\n\n4、可查看双方视频流\n\n#### 注意事项\n\n1、必须为 HTTPS 站点或 localhost, 端口不限\n\n2、appkey 必须开通音视频服务"
  },
  {
    "path": "rongrtc/api/api.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>RTC 3.0 demo</title>\n\n  <style>\n    html,\n    body {\n      height: 100%;\n      margin: 0;\n      padding: 0;\n    }\n    video {\n      background: #69696938;\n      width: 48%;\n      height: 600px;\n      transform: rotateY(180deg);\n      margin: 1%;\n    }\n    .rong-container {\n      background: #333;\n      min-height: 100%;\n    }\n    .rong-container .rong-title {\n      margin: 0;\n      padding: 35px 0 10px;;\n      text-align: center;\n      color: #fff;\n      font-size: 30px;\n    }\n    .rong-container .rong-login-box {\n      width: 100%;\n      height: 50px;\n      line-height: 50px;\n      border-bottom: 1px solid #333;\n      padding: 10px;\n      text-align: center;\n    }\n    .rong-container .rong-login-box .rong-input {\n      border-radius: 2px;\n    }\n    .rong-container .rong-login-box input:nth-child(1) {\n      width: 150px;\n      height: 38px;\n      border: none;\n      padding-left: 10px;\n    }\n    .rong-container .rong-login-box input:nth-child(2),\n    .rong-container .rong-login-box input:nth-child(3) {\n      width: 150px;\n      height: 40px;\n      border-radius: 2px;\n      background: #4285F4;\n      border: none;\n      color: #fff;\n      box-shadow: 1px 1px 6px #00000069;\n    }\n    .rong-container .rong-login-box input:nth-child(2):hover,\n    .rong-container .rong-login-box input:nth-child(3):hover {\n      transition-duration: .3s;\n      transition-timing-function: ease-in-out;\n      box-shadow: 0 10px 22px #00000069;\n    }\n    .rong-container .rong-user-box {\n      width: 100%;\n      text-align: center;\n    }\n    .rong-container .rong-logs {\n      border-top: 1px solid #333;\n    }\n  </style>\n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n  <script src=\"//cdn.ronghub.com/RongRTC-3.1.0.js\"></script>\n  <script src=\"../im.js\"></script>\n  <script src=\"../utils.js\"></script>\n  <script src=\"../mock.js\"></script>\n</head>\n<body>\n  <div class=\"rong-container\">\n    <h3 class=\"rong-title\"> Web RTC 3.0 SDK MiniApp</h3>\n    <div class=\"rong-login-box\">\n      <input class=\"rong-input\" id=\"roomId\" type=\"text\" placeholder=\"房间号\" value=\"19941116\" autocomplete=\"off\" >\n      <input class=\"rong-input\" id=\"joinRoom\" type=\"button\" value=\"加入房间\" >\n      <input class=\"rong-input\" id=\"leaveRoom\" type=\"button\" value=\"离开房间\" >\n    </div>\n    <div class=\"rong-user-box\">\n    </div>\n    <div class=\"rong-logs\">\n    </div>\n  </div>\n\n  <script>\n    var getDom = function (key) {\n      return document.querySelector(key);\n    }\n    var logger = new utils.Logger({\n      el: getDom('.rong-logs')\n    })\n    function show(node) {\n      node.style.display = 'inline-block';\n    }\n    function hide(node) {\n      node.style.display = 'none';\n    }\n\n    var roomIdNode = getDom('#roomId')\n    var joinRoomNode = getDom('#joinRoom')\n    var leaveRoomNode = getDom('#leaveRoom')\n    var userBoxNode = getDom('.rong-user-box')\n    var rongRTC, rongRoom, rongStream ;\n    var StreamType ;\n    joinRoomNode.onclick = function () {\n      if(imInstance){\n        startRTCConnect();\n        return;\n      }\n      getIMToken({roomId: roomIdNode.value}).then(function(data){\n        console.log(data);\n        connect({token: data},function(){\n          startRTCConnect();\n        })\n      }).catch(function(error){\n        console.log(error);\n      })\n    }\n    leaveRoomNode.onclick = function () {\n      rongStream.unpublish({\n        id: currentUser.id,\n          stream: {\n            type: StreamType.AUDIO_AND_VIDEO,\n            tag: 'rtc'\n          }\n      }).then(result => {\n        console.log('取消推送成功');\n        rongRoom.leave().then(function () {\n          console.log('leave successfully');\n          show(roomIdNode);\n          show(joinRoomNode);\n          var videoList = document.querySelectorAll('video');\n          for(var i=0;i<=videoList.length;i++){\n            userBoxNode.removeChild(videoList[i]) \n          }\n        }, function(error){\n          console.log(error);\n          unpublish();\n        });\n      }, error => {\n        console.log(error);\n      });\n    }\n    var currentUser = {\n      id: ''\n    }\n    /* 获取 IM Token*/\n    function getIMToken(params) {\n      var index = location.search.substring(1);\n      index = Number(index);\n      // var name = 'user' + new Date().getTime();\n      return Promise.resolve(App.users[index].token);\n      // 此处可通过 App Server 获取 IM Token\n      // return new Promise(function (resolve, reject) {\n      //   utils.ajax({\n      //     url: url,\n      //     headers: {\n      //       'Content-Type': 'application/json'\n      //     },\n      //     method: 'POST',\n      //     body: JSON.stringify({\n      //       roomId: params.roomId,\n      //       userName: name,\n      //       audience: false\n      //     }),\n      //     success: function (result) {\n      //       result = JSON.parse(result);\n      //       resolve(result.data.result.imToken);\n      //     },\n      //     fail: function (error) {\n      //       reject(error);\n      //     }\n      //   });\n      // });\n    }\n    /* 开始: IM 连接相关 */\n    var imInstance = null;\n    function connect(params,callback) {\n      if (imInstance) {\n        return;\n      }\n      var appkey = App.appkey;\n      var params = {\n        appkey: appkey,\n        token: params.token\n      };\n      var callbacks = {\n        connected: function (instance, user) {\n          var userId = user.id;\n          currentUser.id = userId;\n          imInstance = instance;\n          console.log('连接成功，用户 ID: ' + userId);\n          callback();\n        },\n        disconnectd: function (status) {\n          imInstance = null;\n          console.log('连接断开');\n        },\n        error: function () {\n          imInstance = null;\n          console.log('连接异常，状态码: ' + status);\n        },\n          onTokenIncorrect: function () {\n          console.log('Token 不正确，可在融云开发者后台获取 https://developer.rongcloud.cn/');\n        }\n      };\n      initIM(params, callbacks);\n    }\n    function disconnect() {\n      if (!imInstance) {\n        return\n      }\n      imInstance.disconnect();\n    }\n    // connect()\n    /* 结束: IM 连接相关 */\n    function startRTCConnect(){\n      startRTC({roomId: roomIdNode.value},function() {\n        joinRoom(function() {\n          publish();\n        });\n      });\n    }\n    function startRTC(params,callback) {\n      rongRTC = new RongRTC({\n        RongIMLib: RongIMLib,\n        error: function (error) {\n          console.log(error);\n        },\n        logger: function (log) {\n        }\n      });\n      rongRoom = new rongRTC.Room({\n        id: params.roomId,\n        joined: function (user) {\n          console.log(user.id+'加入房间');\n        },\n        left: function (user) {\n          console.log(user,'user.id 离开房间')\n        }\n      });\n      rongStream = new rongRTC.Stream({\n        published: addUserStream,\n        unpublished: removeUserStream\n      });\n      StreamType = rongRTC.StreamType;\n      callback();\n    }\n    function joinRoom(callback) {\n      rongRoom.join({\n        id: currentUser.id\n      }).then(function (users) {\n        console.log(\"加入房间成功\");\n        callback();\n      }, function (error) {\n        console.log(error);\n      });\n    }\n    var createVideo = function (stream) {\n      var video = document.createElement('video');\n      video.srcObject = stream;\n      video.autoplay = true;\n      return video;\n    };\n    function getMedia(){\n      return new Promise(function(resolve,reject){\n        rongStream.get().then(function ({ mediaStream }) {\n          console.log(mediaStream);\n          resolve(mediaStream);\n          var user = {stream:{}};\n          user.stream.mediaStream = mediaStream;\n          appendVideo(user);\n        }, error => {\n          console.log(error);\n          reject();\n        });\n      })\n    }\n    function publish () {\n      getMedia().then(function(mediaStream){\n        rongStream.publish({\n          id: currentUser.id,\n          stream: {\n            type: StreamType.AUDIO_AND_VIDEO,\n            tag: 'rtc',\n            mediaStream: mediaStream\n          }\n        }).then(function () {\n          console.log('发布资源成功');\n          hide(roomIdNode);\n          hide(joinRoomNode);\n        }, function (error) {\n          console.log(error, '发布资源失败:');\n        })\n      })\n    }\n    function unpublish () {\n      rongStream.unpublish({\n        id: currentUser.id,\n          stream: {\n            type: StreamType.AUDIO_AND_VIDEO,\n            tag: 'rtc'\n          }\n      }).then(result => {\n        console.log('取消推送成功');\n      }, error => {\n        console.log(error);\n      });\n    }\n    function subscribe (user) {\n      return new Promise(function(resolve ,reject){\n        rongStream.subscribe(user).then(function(user){\n          resolve(user);\n        },function(error){\n          console.log(error);\n        });\n      })\n    }\n    function unsubscribe (user) {\n      return new Promise(function(resolve ,reject){\n        rongStream.unsubscribe(user).then(function(user){\n          resolve(user);\n        },function(error){\n          console.log(error);\n        });\n      })\n    }\n    function appendVideo (user) {\n      var dom = document.querySelector('.rong-user-box');\n      var videoDom = createVideo(user.stream.mediaStream);\n      dom.appendChild(videoDom);\n      if(user.id){\n        videoDom.id = user.id;\n      }\n    }\n    function removeVideo (user) {\n      var dom = document.querySelector('.rong-user-box');\n      val = '#'+user.id;\n      videoDom = getDom(val);\n      dom.removeChild(videoDom);\n    }\n    function addUserStream (user){\n      console.log('收到其他人发送的资源');\n      subscribe(user).then(function(user){\n        console.log(user,'sub');\n        appendVideo(user)\n      })\n    }\n    function removeUserStream (user) {\n      removeVideo(user);\n      unsubscribe(user).then(function(user){\n        console.log(user,'sub');\n      })\n    }\n    window.onbeforeunload = function (e) {\n      rongStream.unpublish({\n        id: currentUser.id,\n          stream: {\n            type: StreamType.AUDIO_AND_VIDEO,\n            tag: 'rtc'\n          }\n      }).then(result => {\n        console.log('取消推送成功');\n        rongRoom.leave().then(function () {\n          console.log('leave successfully');\n          show(roomIdNode);\n          show(joinRoomNode);\n          for(var i=0;i<userBoxNode.childNodes.length;i++){\n            userBoxNode.removeChild(userBoxNode.childNodes[1]) \n          }\n        }, function(error){\n          console.log(error);\n          unpublish();\n        });\n      }, error => {\n        console.log(error);\n      });\n    };\n  </script>\n</body>\n</html>"
  },
  {
    "path": "rongrtc/im.js",
    "content": "function initIM(params, callbacks) {\n    var appkey = params.appkey;\n    var token = params.token;\n    RongIMClient.init(appkey, null);\n    RongIMClient.setConnectionStatusListener({\n      onChanged: function (status) {\n        switch (status) {\n          case RongIMLib.ConnectionStatus.CONNECTING:\n            break;\n          case RongIMLib.ConnectionStatus.DISCONNECTED:\n            callbacks.disconnectd(status);\n          break;\n          case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n          case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n          case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n          callbacks.error(status);\n            break;\n        }\n      }\n    });\n    RongIMClient.setOnReceiveMessageListener({\n      onReceived: function (message) {\n        console.log(message);\n      }\n    });\n    RongIMClient.connect(token, {\n      onSuccess: function (userId) {\n        callbacks.connected(RongIMClient.getInstance(), { id: userId });\n      },\n      onTokenIncorrect: function () {\n        callbacks.onTokenIncorrect()\n      },\n      onError: function (code) {\n        callbacks.disconnectd(status);\n      }\n    });\n  }"
  },
  {
    "path": "rongrtc/mock.js",
    "content": "var App = {\n  appkey: 'appkey',\n  users: [\n    {\n      token: 'token1'\n    },\n    {\n      token: 'token2'\n    }\n  ]\n};"
  },
  {
    "path": "rongrtc/screenshare/screenshare.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n  <meta charset=\"UTF-8\">\n  <title>ScreenShare</title>\n  <style>\n    video {\n      height: 300px;\n      width: 400px;\n    }\n\n    .rong-desc {\n      width: 500px;\n      position: absolute;\n      top: 10px;\n      right: 30px;\n      border: 1px solid #CCC;\n      color: #FF0000;\n    }\n    img{\n      width: 500px;\n    }\n  </style>\n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.0.js\"></script>\n  <script src=\"//cdn.ronghub.com/RongRTC.3.0.2.js\"></script>\n  <script src=\"./screenshare.js\"></script>\n</head>\n\n<body>\n  <h1>浏览器兼容性: Chrome 57+</h1>\n  <button onclick=\"getDisplayMedia()\">getDisplayMedia</button>\n  <video autoplay muted></video>\n  <div class=\"rong-desc\">\n    <h6>1、下载 Chrome 插件，<a href=\"./screenshare-addon.zip\">【点我下载】</a> </h6>\n    <h6>2、解压 screenshare-addon.zip ，按照说明文档安装插件</h6>\n    <h6>3、点击 getDisplayMedia 开始测试</h6>\n    <h6>共享示例截图:</h6>\n    <img src=\"./result.png\" alt=\"示例\">\n  </div>\n  <script>\n    var rongRTC = new RongRTC({\n      RongIMLib: RongIMLib\n    });\n    var stream = new rongRTC.Stream();\n    function showScreen(stream) {\n      var node = document.querySelector('video');\n      var mediaStream = stream.mediaStream;\n      node.srcObject = mediaStream;\n      // 获取到 mediaStream 即可调用 stream.publish(user) 将自己的屏幕共享给其他人\n      // stream.publish(user) 可参考示例 (发布资源)：https://github.com/rongcloud/websdk-demo/rongrtc/api\n      mediaStream.oninactive = function () {\n        node.srcObject = null;\n      };\n    }\n    function getDisplayMedia() {\n      ScreenShare.get((desktopStreamId) => {\n        stream.get({\n          screen: true,\n          desktopStreamId: desktopStreamId\n        }).then((stream) => {\n          showScreen(stream);\n        }, (error) => {\n          console.log(error);\n        });\n      });\n    }\n  </script>\n</body>\n\n</html>"
  },
  {
    "path": "rongrtc/screenshare/screenshare.js",
    "content": "(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n      (global.ScreenShare = factory(global));\n})(window, function (win) {\n  'use strict';\n  var Keys = {\n    CHECK: 'rong-check-share-installed',\n    CHECK_RESPONSE: 'rong-share-installed',\n    GET: 'rong-share-get',\n    GET_RESPONSE: 'rong-share-get-response',\n    CLEAR_BOX: 'rong-share-clear-box'\n  };\n\n  var Reason = {\n    PLUGIN_NOT_INSTALLED: 'Plugin not installed'\n  };\n\n  var ShareProfile = {\n    width: 1280,\n    height: 720,\n    frameRate: 15\n  };\n\n  var checkTimeout = 1500;\n\n  var sendToPlugin = function (key) {\n    win.postMessage({\n      type: key\n    });\n  };\n\n  var addListener = function (event) {\n    win.addEventListener('message', event);\n  };\n\n  var removeListenr = function (event) {\n    win.removeEventListener('message', event);\n  };\n\n  var clearTimeoutAndListenr = function (timeout, listener) {\n    listener && removeListenr(listener);\n    timeout && clearTimeout(timeout);\n  };\n\n  var check = function (callback) {\n    var timeout, checkCallback;\n    checkCallback = function (data) {\n      var data = data.data || {};\n      var type = data.type;\n      if (type === Keys.CHECK_RESPONSE) {\n        callback && callback(null);\n        clearTimeoutAndListenr(timeout, checkCallback);\n      }\n    };\n    timeout = setTimeout(function () {\n      callback && callback(Reason.PLUGIN_NOT_INSTALLED);\n      clearTimeoutAndListenr(timeout, checkCallback);\n    }, checkTimeout);\n    addListener(checkCallback);\n    sendToPlugin(Keys.CHECK);\n  };\n\n  var get = function (callback) {\n    var getCallback = function (data) {\n      var data = data.data || {};\n      var type = data.type;\n      if (type === Keys.GET_RESPONSE) {\n        var sourceId = data.sourceId;\n        callback && callback(sourceId)\n        removeListenr(getCallback);\n      }\n    };\n    check(function (error) {\n      if (error) {\n        console.error(error);\n        return;\n      }\n      addListener(getCallback);\n      sendToPlugin(Keys.GET);\n    })\n  };\n\n  var clear = function () {\n    sendToPlugin(Keys.CLEAR_BOX);\n  };\n\n  return {\n    check,\n    get,\n    clear\n  };\n});"
  },
  {
    "path": "rongrtc/utils.js",
    "content": "var utils = (function () {\n    var utils = {\n      stringFormat: function (temp, data, regexp) {\n        if (!(Object.prototype.toString.call(data) === \"[object Array]\")) data = [data];\n        var ret = [];\n        for (var i = 0, j = data.length; i < j; i++) {\n          ret.push(replaceAction(data[i]));\n        }\n        return ret.join(\"\");\n  \n        function replaceAction(object) {\n          return temp.replace(regexp || (/\\\\?\\{([^}]+)\\}/g), function (match, name) {\n            if (match.charAt(0) == '\\\\') return match.slice(1);\n            return (object[name] != undefined) ? object[name] : '{' + name + '}';\n          });\n        }\n      },\n      isArray: function (array) {\n        return Object.prototype.toString.call(array) == '[object Array]';\n      },\n      prettyJSON: function (objs, opts) {\n        opts = opts || {};\n        var isArray = utils.isArray(objs);\n        objs = isArray ? objs : [objs];\n        var tpl = opts.tpl || '<span class={type}-font>{v}</span>';\n        for (var i = 0, len = objs.length; i < len; i++) {\n          var obj = objs[i];\n          for (var k in obj) {\n            if (obj.hasOwnProperty(k)) {\n              var v = obj[k] || 'null';\n              var type = (typeof v);\n              if (type == 'object') {\n                utils.prettyJSON(v);\n              } else {\n                obj[k] = utils.stringFormat(tpl, {\n                  type: type,\n                  v: v\n                });\n              }\n            }\n          }\n        }\n        return isArray ? objs : objs[0];\n      }\n    };\n    var noop = function () { };\n    var isObject = function (obj) {\n      return Object.prototype.toString.call(obj) === '[object Object]';\n    };\n    var isArray = function (obj) {\n      return Object.prototype.toString.call(obj) === '[object Array]';\n    };\n    var isNodeList = function (obj) {\n      return Object.prototype.toString.call(obj) === '[object NodeList]';\n    };\n    var tplEngine =  function (temp, data, regexp) {\n      var replaceAction = function (object) {\n        return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n          if (match.charAt(0) === '\\\\') return match.slice(1);\n          return (object[name] !== undefined) ? object[name] : '{' + name + '}';\n        });\n      };\n      if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n      var ret = [];\n      for (var i = 0, j = data.length; i < j; i++) {\n        ret.push(replaceAction(data[i]));\n      }\n      return ret.join('');\n    };\n    var forEach = function (obj, callback) {\n      callback = callback || noop;\n      var loopObj = function () {\n        for (var key in obj) {\n          callback(obj[key], key, obj);\n        }\n      };\n      var loopArr = function () {\n        for (var i = 0, len = obj.length; i < len; i++) {\n          callback(obj[i], i);\n        }\n      };\n      if (isObject(obj)) {\n        loopObj();\n      }\n      if (isArray(obj) || isNodeList(obj)) {\n        loopArr();\n      }\n    }\n    var ajax = function (option) {\n      var getXHR = function () {\n        var xhr = null;\n        var hasXDomain = function () {\n          return (typeof XDomainRequest != 'undefined');\n        };\n        var hasXMLRequest = function () {\n          return (typeof XMLHttpRequest != 'undefined');\n        };\n        if (hasXDomain()) {\n          xhr = new window.XDomainRequest();\n        } else if (hasXMLRequest()) {\n          xhr = new window.XMLHttpRequest();\n        } else {\n          xhr = new window.ActiveXObject('Microsoft.XMLHTTP');\n        }\n        return xhr;\n      };\n  \n      var xhr = getXHR();\n      var method = option.method || 'GET';\n      var url = option.url;\n      var queryStrings = option.queryStrings || {};\n      var tpl = '{key}={value}', strings = [];\n      forEach(queryStrings, function (value, key) {\n        var str = tplEngine(tpl, {\n          key: key,\n          value: value\n        });\n        strings.push(str);\n      });\n      var queryString = strings.join('&');\n      var urlTpl = '{url}?{queryString}';\n      url = tplEngine(urlTpl, {\n        url: url,\n        queryString: queryString\n      });\n  \n      xhr.open(method, url, true);\n  \n      var headers = option.headers || {};\n      forEach(headers, function (header, name) {\n        xhr.setRequestHeader(name, header);\n      });\n  \n      var success = option.success || noop;\n      var fail = option.fail || noop;\n      var isSuccess = function (xhr) {\n        return /^(200|202|10000)$/.test(xhr.status);\n      };\n  \n      var onLoad = function () {\n        var result = xhr.responseText;\n        if (isSuccess(xhr)) {\n          success(result);\n        } else {\n          fail(result.target.status);\n        }\n      };\n      if ('onload' in xhr) {\n        xhr.onload = onLoad;\n      }\n      else {\n        xhr.onreadystatechange = function () {\n          if (xhr.readyState == 4) {\n            onLoad();\n          }\n        };\n      }\n      xhr.onerror = function (error) {\n        fail(error.target.status);\n      };\n      xhr.send(option.body);\n    }\n    function Logger(option) {\n      option = option || {};\n      var element = option.el;\n      var tpl = '<pre>{logs}</pre>'\n      this.log = function (logs, title) {\n        logs = utils.prettyJSON(logs);\n        logs = JSON.stringify(logs, null, '  ');\n        if(title){\n          logs = title + '<br>' + logs;\n        }\n        element.innerHTML += utils.stringFormat(tpl, {\n          logs: logs\n        });\n      };\n      this.clear = function () {\n        element.innerHTML = '';\n      }\n    }\n    utils.Logger = Logger;\n    utils.ajax = ajax;\n    return utils;\n  })();"
  },
  {
    "path": "rtc/README.md",
    "content": "## 远程标注 Demo\n\n### 产品概述\n\n远程标注 Demo 是指利用音视频能力，在远程维护场景下，展示后台专家在前端现场工程师采集的音视频基础上，提供标记，写画，图片展示等能力，指导现场工程师工作的过程。\n\n### 浏览器支持范围\n\n`Chrome 57+`\n\n### 建立基于 Web 的远程专家端\n\n1、现场工程师与专家通过公有云建立会场。\n\n2、现场工程师通过 VR 眼镜或手机现场采集，远端专家通过 Web 远程专家端加入会场。\n\n3、专家可以接收现场工程师采集的音视频，并进行实时的双向音视频对话。\n\n4、专家通过共享屏幕，可以在现场采集的视频基础上进行，标记（写画），文本输入，显示图片，显示表格。\n\n5、专家侧的标注和现场采集的视频，合并后传给现场工程师显示。\n\n### Web 专家端操作步骤\n\n推荐使用 Chrome（谷歌浏览器），首次使用远程标注功能时，页面会引导你安装 RongRTC 插件，根据页面提示操作即可：\n\n![avatar](image/use-guide.png)\n\n1. 下载RongRTC 插件，解压 rong-rtc-plugin.zip.\n2.  打开 Chrome 扩展程序列表：在 Chrome 浏览器地址栏中输入“chrome://extensions” 并访问此地址。\n\n![avatar](./image/plugin-list.png)\n\n3. 将整个 rong-rtc-plugin 文件夹 拖拽至浏览器插件列表中。\n\n![avatar](./image/plugin-drag.png)\n\n4. 插件安装成功\n\n![avatar](./image/plugin-success.png)\n\n5. 进入演示模式\n\n浏览器访问 [融云官网-下载页-实时音视频-Web 模块](https://www.rongcloud.cn/downloads/rtc)，点击「远程标注在线体验」标签访问远程标注 Demo.\n\n![avatar](image/entrance.png)\n\n> 远程标注源码也可从 [融云官网-下载页-实时音视频-Web 模块](https://www.rongcloud.cn/downloads/rtc) 免费获取。\n\n6. 输入任意房间号，点击进入房间。\n\n   ![avatar](image/login-in.png)\n\n7. 点击分享屏幕，进行远程标注\n\n![avatar](./image/share.png)\n\n8. 点击图片和表格按钮可插入图片和业务表格\n\n![avatar](./image/insert.png)\n\n### 采集端操作步骤\n\n> 目前支持手机端采集，支持爱普生 Epson BT350 VR 眼镜，未来可实现其他型号定制。\n\n1. 首先从 [融云官网-下载-实时音视频](https://www.rongcloud.cn/downloads/rtc) 页面下载 SealRTC 客户端\n\n![avatar](./image/download.png)\n\n2. 安装成功后输入和专家端同一房间号，加入房间后即可和专家进行远程标注互动演示。\n\n![avatar](image/audience-show.png)"
  },
  {
    "path": "rtc/app/README.md",
    "content": "# remote-conduct\n\n"
  },
  {
    "path": "rtc/app/config.js",
    "content": "var RTCConfig = {\n    appId: 'x4vkb1qpxfrzk',\n    nav: 'https://rtc.ronghub.com/nav/websocketlist',\n    api: 'https://rtc.ronghub.com/voiptoken',\n    plugin: 'https://rtc.ronghub.com/plugin/chrome-addon.zip',\n};"
  },
  {
    "path": "rtc/app/css/common.css",
    "content": "html,body{\n  height: 100%;\n  width: 100%;\n  margin: 0;\n  overflow: hidden;\n}\nul,li{\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\ninput{\n  outline: none;\n}\n.rong-components{\n}\n.rong-component{\n  text-align: center;\n}\n.rong-box {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color: black;\n}"
  },
  {
    "path": "rtc/app/css/main.css",
    "content": ".rong-main{\n  margin: 0 auto;\n  width: 80%;\n  height: 80%;\n  margin-top: 5%;\n  position: relative;\n  display: none;\n  min-width: 1030px;\n}\n\n.rong-main-item{\n  height: 100%;\n  width: 100%;\n  position: absolute;\n  top: 0;\n}\n\n.rong-login{\n  height: 100%;\n  width: 100%;\n  background-color: #F2F2F2;\n  background-image: url('./icon/background.jpg');\n  background-size: cover;\n}\n\n.rong-login-button{\n  width: 100%;\n  height: 42px;\n  margin: 16px auto;\n  border-radius: 10px;\n  border-style: none;\n  font-size: 15px;\n  text-align: center;\n}\n\n.rong-login-main{\n  width: 360px;\n  height: 100%;\n  margin: 0 auto;\n  position: relative;\n}\n\n.rong-login-box {\n  position: absolute;\n  top: 50%;\n  width: 100%;\n  transform: translateY(-50%);\n  -webkit-transform: translateY(-50%);\n  -moz-transform: translateY(-50%);\n  -ms-transform: translateY(-50%);\n  -o-transform: translateY(-50%);\n}\n\n.rong-login-logo{\n  background-image: url(./icon/logo.png);\n  background-repeat: no-repeat;\n  display: inline-block;\n  height: 90px;\n  width: 90px;\n  background-size: cover;\n}\n\n.rong-login-main span{\n  display: inline-block;\n  text-align: center;\n  width: 100%;\n  color: #33CCFF;\n}\n\n.rong-login-title{\n  margin-top: 30px;\n}\n.rong-login-title p {\n  font-size: 30px;\n  color: white;\n  margin: 10px 0 18px 0;\n}\n\n.rong-login-roomid input{\n  color: #999; \n}\n\n.rong-login-join input{\n  background: #3A83F5;\n  color: #FFFFFF;\n  cursor: pointer;\n}\n\n.rong-footer{\n  position: absolute;\n  bottom: 0;\n  background-color: #dee0e2;\n  width: 100%;\n  height: 65px;\n}\n.rong-footer-blocks{\n  width: 600px;\n  margin: 0 auto;\n}\n.rong-footer-block{\n  display: inline-block;\n  margin-top: 25px;\n  width: 29%;\n  text-align: center;\n}\n\n.rong-install-plugins{\n  overflow: scroll;\n  height: 100%;\n  width: 100%;\n  background-color:rgb(250, 250, 250);\n  position: absolute;\n  box-shadow: 10px 10px 5px #3A83F5;\n  display: none;\n  position: absolute;\n  z-index: 10;\n  padding: 0 150px;\n  box-sizing: border-box;\n  min-width: 1078px;\n}\n.rong-install-step-title {\n    background-color: rgb(194, 215, 248);\n    padding-left: 10px;\n    padding: 5px 0 5px 10px;\n    color: rgb(92, 92, 92);\n    font-size: 13px;\n}\n\n.rong-step-button {\n  display: inline-block;\n  width: 250px;\n  height: 37px;\n  line-height: 37px;\n  background-color: rgb(66, 133, 244);\n  color: white;\n  text-align: center;\n  border-radius: 2px;\n  font-size: 15px;\n  text-decoration: none;\n  border: none;\n  cursor: pointer;\n}\n\n.rong-step-download {\n  margin: 19px 0 0 18px;\n}\n\n.rong-step-jump {\n  margin: 5px 0 0 18px;\n}\n\n.rong-step-jump:disabled {\n  background-color: rgb(194, 215, 248);\n}\n\n.rong-step-download-desc {\n    font-size: 12px;\n    color: rgb(111, 111, 111);\n    margin: 14px 45px 0 18px;\n}\n\n.rong-step-graphic {\n  width: 237px;\n  height: 102px;\n  background-size: cover;\n  margin-left: 22px;\n}\n.rong-step-open {\n  background-image: url(./icon/open.png);\n}\n\n.rong-step-drag {\n  background-image: url(./icon/drag.png);\n}\n\n.rong-step-success {\n  background-image: url(./icon/install-success.png);\n}\n\n.rong-steps{\n  width: 100%;\n}\n\n.rong-steps li {\n  float: left;\n  width: 325px;\n  height: 200px;\n}\n.rong-steps a{\n  color: #FFF;\n}\n\n.rong-step{\n  line-height: 50px;\n  padding: 10px;\n  font-size: 20px;\n}\n\n/* .rong-step-jump{\n  float: right;\n} */\n.rong-button-jump{\n  cursor: pointer;\n  color: #3A83F5;\n  height: 35px;\n  width: 120px;\n}\n\n.rong-plugin-prompt {\n  display: none;\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  background-color:rgb(0, 0, 0, 0.8);\n  z-index: 9;\n}\n\n.rong-plugin-prompt p {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 400px;\n  line-height: 75px;\n  background-color: white;\n  border-radius: 2px;\n  transform: translate(-50%, -50%);\n  -webkit-transform: translate(-50%, -50%);\n  -moz-transform: translate(-50%, -50%);\n  -ms-transform: translate(-50%, -50%);\n  -o-transform: translate(-50%, -50%);\n  text-align: center;\n}\n\n@media screen and (max-width: 1270px) {\n    .rong-steps li {\n      margin-right: 90px;\n    }\n}\n\n@media screen and (max-width: 1132px) {\n    .rong-steps li {\n      margin-right: 30px;\n    }\n}"
  },
  {
    "path": "rtc/app/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>RongRTC</title>\n  <link rel=\"icon\" href=\"./css/icon/icon.png\" type=\"image/x-icon\"/>\n  <link rel=\"stylesheet\" href=\"./css/common.css\">\n  <link rel=\"stylesheet\" href=\"./css/main.css\">\n</head>\n<body>\n  <div class=\"rong-box\">\n    <div class=\"rong-login\">\n      <div class=\"rong-plugin-prompt\">\n        <p>首次使用请先安装 RongRTC 屏幕共享插件。</p>\n      </div>\n      <div class=\"rong-install-plugins\">\n        <h1>RongRTC</h1>\n        <h2>适用 Chrome 的屏幕共享插件</h2>\n        <h4 class=\"rong-install-step-title\">安装 RongRTC 插件操作步骤</h4>\n        <ul class=\"rong-steps\">\n          <li>\n            <p>1. 首次使用安装 RongRTC 插件</p>\n            <div>\n              <a class=\"rong-step-button rong-step-download\" href=\"http://rongcloud-file.ronghub.com/bb94b141e196cca49c.zip?attname=rong-rtc-plugin.zip&e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:wJ_khuHbz3TDso6RL9FMVDQP3QA=\">下载插件</a>\n              <p class=\"rong-step-download-desc\">需要把扩展程序下载到本地，再将下载的文件夹拖拽到 chrome 浏览器扩展程序中。</p>\n            </div>\n          </li>\n          <li>\n            <p>2. 打开 Chrome \"扩展选项\"</p>\n            <div class=\"rong-step-graphic rong-step-open\"></div>\n          </li>\n          <li>\n            <p>3. 将 rong-rtc-plugin 文件夹拖拽至浏览器</p>\n            <div class=\"rong-step-graphic rong-step-drag\"></div>\n          </li>\n          <li>\n            <p>4. 插件安装成功</p>\n            <div class=\"rong-step-graphic rong-step-success\"></div>\n          </li>\n          <li>\n            <p>5. 进入演示模式</p>\n            <div>\n              <button class=\"rong-step-button rong-step-jump\">进入远程专家系统</button>\n            </div>\n          </li>\n        </ul>\n      </div>\n      <div class=\"rong-login-main\">\n        <ul class=\"rong-components rong-login-box\">\n          <li class=\"rong-component\">\n            <i class=\"rong-login-logo\"></i>\n          </li>\n          <li class=\"rong-component rong-login-title\">\n            <p>远程标注专家系统</p>\n          </li>\n          <li class=\"rong-component rong-login-roomid\">\n            <input id=\"roomId\" type=\"text\" class=\"rong-login-button rong-button-room\" placeholder=\"请输入房间号\">\n          </li>\n          <li class=\"rong-component rong-login-join\">\n            <input type=\"button\" class=\"rong-login-button rong-button-join\" value=\"进入房间\">\n          </li>\n        </ul>\n      </div>\n    </div>\n    <div class=\"rong-main\">\n      <video class=\"rong-main-item rong-video-remote\"></video>\n      <iframe class=\"rong-main-item rong-whiteboard\" frameborder=\"0\"></iframe>\n    </div>\n    <!-- <div class=\"rong-footer\">\n        <ul class=\"rong-footer-blocks\">\n          <li class=\"rong-footer-block\">\n            <a href=\"https://www.rongcloud.cn\">RongCloud</a>\n          </li>\n          <li class=\"rong-footer-block\">\n              © Copyright SealRTC\n          </li>\n          <li class=\"rong-footer-block\">\n              浏览器: <a href=\"http://www.chromeliulanqi.com\" target=\"_blank\">谷歌浏览器 57+</a>\n          </li>\n        </ul>\n      </div> -->\n  </div>\n  <script src=\"./lib/adapter.js\"></script>\n  <script src=\"./lib/RongRTCEngine.js\"></script>\n  <script src=\"./config.js\"></script>\n  <script src=\"./js/utils.js\"></script>\n  <script src=\"./js/core.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "rtc/app/js/core.js",
    "content": "(function (dependencies) {\n\n  var RongRTCEngine = dependencies.RongRTCEngine;\n  var RongRTCEngineEventHandle = dependencies.RongRTCEngineEventHandle;\n  var config = dependencies.RTCConfig;\n  // 是否支持插件\n  var isSupportRTCPlugin = false;\n  // 是否支持插件这个步骤是否已经加载完\n  var isSupportRTCLoaded = false;\n  var promptTime = 5000;\n  var utils = RongRTC.utils;\n  var store = utils.store;\n  var roomIdStoreKey = 'roomId';\n\n  var Error = {\n    ROOMID_IS_EMPTY: '房间号不能为空',\n    REQUEST_WHITEBORAD: '请求白板失败',\n    GET_TOKEN: '获取 Token 失败'\n  };\n  var LogHandler = {\n    error: function (error) {\n      alert(error);\n    }\n  };\n\n  var getDom = function (name) {\n    return document.querySelector(name);\n  };\n  var getToken = function (userId, callback) {\n    var body = 'uid={userId}&appid={appId}';\n    body = utils.tplEngine(body, {\n      userId: userId,\n      appId: config.appId\n    });\n    utils.ajax({\n      url: config.api,\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/x-www-form-urlencoded'\n      },\n      body: body,\n      success: function (result) {\n        var error = null;\n        callback(error, result);\n      },\n      fail: function (error) {\n        callback(error);\n      }\n    });\n  }\n\n  var launchFullscreen = function (node) {\n    if(node.webkitRequestFullscreen) {\n      node.webkitRequestFullScreen();\n    }\n    if(node.requestFullscreen) {\n      node.requestFullscreen();\n    }\n    if(node.mozRequestFullScreen) {\n      node.mozRequestFullScreen();\n    }\n  };\n\n  var exitFullScreen = function(node){\n    if(node.webkitExitFullscreen) {\n      node.webkitExitFullscreen();\n    }\n    if(node.exitFullscreen) {\n      node.exitFullscreen();\n    }\n    if(node.mozExitFullScreen) {\n      node.mozExitFullScreen();\n    }\n  }\n\n  var El = {\n    show: function (node) {\n      utils.copy(node.style, {\n        display: 'block'\n      });\n    },\n    hide: function (node) {\n      utils.copy(node.style, {\n        display: 'none'\n      });\n    }\n  };\n\n  var gotoInstallStep = function () {\n    var promptDom = getDom('.rong-plugin-prompt');\n    El.show(promptDom);\n    setTimeout(() => {\n      El.show(stepNode);\n    }, promptTime);\n  };\n\n  var setRTCPluginSupport = function (successCallback, faildCallback) {\n    window.addEventListener('message', function (msg) {\n      var type = msg.data.type;\n      if (type === 'testMessage') {\n        isSupportRTCPlugin = true;\n        isSupportRTCLoaded = true;\n        successCallback && successCallback();\n      }\n    });\n    setTimeout(() => {\n      isSupportRTCLoaded = true;\n      if (!isSupportRTCPlugin) {\n        gotoInstallStep();\n      }\n    }, 2000);\n    window.postMessage('test', '*');\n  };\n\n  var loginNode = getDom('.rong-login');\n  var mainNode = getDom('.rong-main');\n  var videoNode = getDom('.rong-video-remote');\n  var roomNode = getDom('.rong-button-room');\n  var joinNode = getDom('.rong-button-join');\n  var whiteboardNode = getDom('.rong-whiteboard');\n  var stepNode = getDom('.rong-install-plugins');\n  var jumpNode = getDom('.rong-step-jump');\n\n  roomNode.value = store.get(roomIdStoreKey) || '';\n\n  setRTCPluginSupport();\n\n  var startGuide = function(){\n    var roomId = roomNode.value;\n    store.set(roomIdStoreKey, roomId);\n    if (utils.isEmpty(roomId)) {\n      return LogHandler.error(Error.ROOMID_IS_EMPTY);\n    }\n    El.show(mainNode);\n    El.hide(loginNode);\n    // El.hide(footerNode);\n    launchFullscreen(document.body);\n    joinRoom(roomId);\n  };\n\n  var joinChannel = function () {\n    if (isSupportRTCLoaded) {\n      if (isSupportRTCPlugin) {\n        startGuide();\n      } else {\n        gotoInstallStep();\n      }\n    } else {\n      setTimeout(joinChannel, 200);\n    }\n  };\n  roomNode.onkeydown = function(event){\n    var isEnter = (event.keyCode == 13);\n    if(isEnter){\n      joinChannel();\n    }\n  };\n\n  joinNode.onclick = function () {\n    joinChannel();\n  };\n\n  jumpNode.onclick = function () {\n    window.location.reload();\n  };\n\n  var RTC = new RongRTCEngine(config.nav);\n  var Status = {\n    onchanged: function (error, result) {\n      var resultMap = {\n        added: function () {\n          var isLocal = result.isLocal;\n          if (isLocal) {\n            RTC.requestWhiteBoardURL();\n          }else{\n            if(!videoNode.srcObject){\n              window.otherVideoNode = videoNode;\n              videoNode.srcObject = result.data;\n              videoNode.play();\n              videoNode.userId = result.userId;\n            }\n          }\n        },\n        removed: function () {\n          if(videoNode.userId == result.userId){\n            videoNode.srcObject = null;\n          }\n        },\n        disconnect: function () {\n\n        },\n        whiteboard: function(){\n          var url = result.url;\n          url = url.replace('https://rtc.ronghub.com/ewbweb/blink-wb.html', '../whiteboard/src/blink-wb.html');\n          whiteboardNode.src = url;\n          RTC.startScreenShare();\n        },\n        onsharecomplete: function(){\n          console.log(result);\n        },\n        onsharestoped: function(){\n          window.location.reload();\n        }\n      };\n      var type = result.type;\n      resultMap[type]();\n    }\n  };\n\n  function joinRoom(roomId) {\n    var config = {\n      width: 640,\n      height: 480,\n      maxRate: 600,\n      minRate: 450,\n      frameRate: 15,\n    };\n\n    RTC.userType = 1;\n    var roomHandler = new RongRTCEngineEventHandle();\n    var errorInfo = null;\n    var participant = {\n      add: function (data) {\n\n        var stream = data.data;\n\n        var result = {\n          type: 'added',\n          data: stream,\n          talkType: data.talkType,\n          isLocal: data.isLocal\n        };\n        Status.onchanged(errorInfo, result);\n      },\n      remove: function (data) {\n        var result = {\n          type: 'removed',\n          data: data.data,\n          userId: data.userId,\n          isLocal: data.isLocal\n        };\n        Status.onchanged(errorInfo, result);\n      },\n      disconnect: function () {\n        var result = {\n          type: 'disconnect'\n        };\n        Status.onchanged(errorInfo, result);\n      },\n      onWhiteBoardURL: function(data){\n        data.type = 'whiteboard';\n        Status.onchanged(errorInfo, data);\n      },\n      onShareComplete: function(data){\n        data.type = 'onsharecomplete';\n        Status.onchanged(errorInfo, data);\n      },\n      onShareStoped: function(data){\n        data.type = 'onsharestoped';\n        Status.onchanged(errorInfo, data);\n      }\n    };\n    var eventFactory = {\n      onJoinComplete: function (data) {\n        var isViewer = (RTC.userType == 2);\n        if (isViewer) {\n          return;\n        }\n\n        var joinedItem = {\n          success: function (data) {\n            var localStream = RTC.getLocalVideoView();\n            userId = data.userId\n            participant.add({\n              userId: userId,\n              data: localStream,\n              isLocal: true,\n              talkType: data.talkType\n            });\n          },\n          error: function () {\n            callback('join error.');\n          }\n        };\n        var method = data.isJoined ? 'success' : 'error';\n        joinedItem[method](data);\n      },\n      onaddstream: function (data) {\n        setTimeout(function () {\n          var userId = data.userId;\n          var stream = data.stream;\n          stream.srcObject = stream.srcObject;\n          participant.add({\n            userId: userId,\n            data: stream,\n            talkType: data.talkType,\n            isLocal: data.isLocal\n          });\n        }, 1000);\n      },\n      onUserLeft: function (data) {\n        participant.remove({\n          data: data.userId,\n          isLocal: false,\n        });\n      },\n      onStartScreenShareComplete: function (data) {\n        participant.onShareComplete(data);\n      },\n      onStopScreenShareComplete: function(data){\n        participant.onShareStoped(data);\n      },\n      onWhiteBoardURL: function (data) {\n        var isSuccess = data.isSuccess;\n        if (isSuccess) {\n          return participant.onWhiteBoardURL(data);\n        }\n        El.error(Error.REQUEST_WHITEBORAD);\n      }\n    };\n    utils.forEach(eventFactory, function (event, eventName) {\n      roomHandler.on(eventName, event);\n    });\n\n    RTC.setRongRTCEngineEventHandle(roomHandler);\n\n    var constraints = {\n      width: config.width,\n      height: config.height,\n      frameRate: config.frameRate\n    };\n\n    RTC.setVideoParameters({\n      VIDEO_PROFILE: constraints,\n      VIDEO_MAX_RATE: config.maxRate,\n      VIDEO_MIN_RATE: config.minRate,\n      USER_TYPE: 1,\n      IS_CLOSE_VIDEO: false\n    });\n    var userId = +new Date;\n    getToken(userId, function(error, token){\n      if(error){\n        console.log(error);\n        return LogHandler.error(Error.GET_TOKEN);\n      }\n      RTC.joinChannel(roomId, userId, token, function (error) {\n        if (error.message === 'Permission denied') {\n          alert('请打开您的摄像头、麦克风权限');\n          window.location.reload();\n        }\n      });\n    });\n  }\n  window.RongWhiteboard = window.RongWhiteboard || {};\n  window.RongWhiteboard.zoom = function (percent) {\n    var videoEl = getDom('.rong-main-item');\n    utils.scaleEl(videoEl, percent);\n  };\n  window.onbeforeunload = function () {\n    // window.clearWhiteboard && window.clearWhiteboard();\n    RTC && RTC.leaveChannel && RTC.leaveChannel();\n  }\n})({\n  RTCConfig: RTCConfig,\n  RongRTCEngine: RongRTCEngine,\n  RongRTCEngineEventHandle: RongRTCEngineEventHandle\n});"
  },
  {
    "path": "rtc/app/js/utils.js",
    "content": "(function (dependencies) {\n  var utils = {\n    getScale: function (dom) {\n      var transform = dom.style.transform;\n      if (transform.indexOf('scale') === -1) {\n        return null;\n      }\n      var scale = transform.substring(6, transform.length - 1);\n      return Number(scale);\n    },\n    scaleEl: function (dom, percent) {\n      var scale = utils.getScale(dom);\n      percent = scale ? scale * percent : percent;\n      dom.style.transform = 'scale(' + percent + ')';\n    },\n    ObserverList: function () {\n      var checkIndexOutBound = function (index, bound) {\n        return index > -1 && index < bound;\n      };\n      this.observerList = [];\n      this.add = function (observer, force) {\n        force && (this.observerList.length = 0);\n        this.observerList.push(observer);\n      };\n      this.get = function (index) {\n        if (checkIndexOutBound(index, this.observerList.length)) {\n          return this.observerList[index];\n        }\n      };\n      this.count = function () {\n        return this.observerList.length;\n      };\n      this.removeAt = function (index) {\n        checkIndexOutBound(index, this.observerList.length) && this.observerList.splice(index, 1);\n      };\n      this.remove = function (observer) {\n        if (!observer) {\n          this.observerList.length = 0;\n          return;\n        }\n        observer = Object.prototype.toString.call(observer) == '[object Function]' ? [observer] : observer;\n        for (var i = 0, len = this.observerList.length; i < len; i++) {\n          if (this.observerList[i] === observer[i]) {\n            this.removeAt(i);\n            break;\n          }\n        }\n      };\n      this.notify = function (val) {\n        for (var i = 0, len = this.observerList.length; i < len; i++) {\n          this.observerList[i](val);\n        }\n      };\n      this.indexOf = function (observer, startIndex) {\n        var i = startIndex || 0,\n          len = this.observerList.length;\n        while (i < len) {\n          if (this.observerList[i] === observer) {\n            return i;\n          }\n          i++;\n        }\n        return -1;\n      };\n    },\n    Cache: function (config) {\n      config = config || {};\n      var prefix = config.prefix || 'rongrtc';\n      var genKey = function (key) {\n        return utils.tplEngine('{prefix}_{key}', {\n          prefix: prefix,\n          key: key\n        });\n      };\n      var set = function (key, value) {\n        localStorage.setItem(genKey(key), value);\n      };\n      var get = function (key) {\n        return localStorage.getItem(genKey(key));\n      };\n      var remove = function (key) {\n        localStorage.removeItem(genKey(key));\n      };\n      var update = function (key, value) {\n        localStorage.setItem(genKey(key), value);\n      };\n      return {\n        set: set,\n        get: get,\n        update: update,\n        remove: remove\n      };\n    },\n    tplEngine: function (temp, data, regexp) {\n      if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n      var ret = [];\n      for (var i = 0, j = data.length; i < j; i++) {\n        ret.push(replaceAction(data[i]));\n      }\n      return ret.join('');\n\n      function replaceAction(object) {\n        return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n          if (match.charAt(0) == '\\\\') return match.slice(1);\n          return (object[name] != undefined) ? object[name] : '{' + name + '}';\n        });\n      }\n    },\n    copy: function (target, source) {\n      for (var key in source) {\n        target[key] = source[key];\n      }\n    },\n    noop: function () { },\n    getRandom: function (range) {\n      return Math.floor(Math.random() * range);\n    },\n    getTimestamp: function (timestamp) {\n      var date = new Date();\n      if (timestamp > 0) {\n        date = new Date(timestamp);\n      }\n      return date.getTime();\n    },\n    forEach: function (obj, callback) {\n      callback = callback || utils.noop;\n      var loopObj = function () {\n        for (var key in obj) {\n          callback(obj[key], key, obj);\n        }\n      };\n      var loopArr = function () {\n        for (var i = 0, len = obj.length; i < len; i++) {\n          callback(obj[i], i);\n        }\n      };\n      if (utils.isObject(obj)) {\n        loopObj();\n      }\n      if (utils.isArray(obj)) {\n        loopArr();\n      }\n    },\n    rename: function (origin, newNames) {\n      var isObject = utils.isObject(origin);\n      if (isObject) {\n        origin = [origin];\n      }\n      origin = JSON.parse(JSON.stringify(origin));\n      var updateProperty = function (val, key, obj) {\n        delete obj[key];\n        key = newNames[key];\n        obj[key] = val;\n      };\n      utils.forEach(origin, function (item) {\n        utils.forEach(item, function (val, key, obj) {\n          var isRename = (key in newNames);\n          (isRename ? updateProperty : utils.noop)(val, key, obj);\n        });\n      });\n      return isObject ? origin[0] : origin;\n    },\n    isObject: function (obj) {\n      return (Object.prototype.toString.call(obj) == '[object Object]');\n    },\n    isArray: function (arr) {\n      return (Object.prototype.toString.call(arr) == '[object Array]');\n    },\n    isNumber: function (num) {\n      return (Object.prototype.toString.call(num) == '[object Number]');\n    },\n    isString: function (str) {\n      return (Object.prototype.toString.call(str) == '[object String]');\n    },\n    isFunction: function (arr) {\n      return (Object.prototype.toString.call(arr) == '[object Function]');\n    },\n    //暂时支持 Object\n    isEmpty: function (obj) {\n      var result = true;\n      if (utils.isObject(obj)) {\n        utils.forEach(obj, function () {\n          result = false;\n        });\n      }\n      if (utils.isString(obj)) {\n        result = (obj.length == 0);\n      }\n      return result;\n    },\n    filter: function (arrs, callback) {\n      if (utils.isObject(arrs)) {\n        arrs = [arrs];\n      }\n      var result = [];\n      utils.forEach(arrs, function (item) {\n        callback(item) && result.push(item);\n      });\n      return result;\n    },\n    /* \n      var option = {\n        url: '',\n        method: '',\n        headers: {},\n        success: function(){},\n        fail: function(){}\n      };\n    */\n    ajax: function (option) {\n      var getXHR = function () {\n        var xhr = null;\n        var hasXDomain = function () {\n          return (typeof XDomainRequest != 'undefined');\n        };\n        var hasXMLRequest = function () {\n          return (typeof XMLHttpRequest != 'undefined');\n        };\n        if (hasXDomain()) {\n          xhr = new XDomainRequest();\n        } else if (hasXMLRequest()) {\n          xhr = new XMLHttpRequest();\n        } else {\n          xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n        }\n        return xhr;\n      };\n\n      var xhr = getXHR();\n      var method = option.method || 'GET';\n      var url = option.url;\n      var queryStrings = option.queryStrings || {};\n      var tpl = '{key}={value}', strings = [];\n      utils.forEach(queryStrings, function (value, key) {\n        var str = utils.tplEngine(tpl, {\n          key: key,\n          value: value\n        });\n        strings.push(str);\n      });\n      var queryString = strings.join('&');\n      var urlTpl = '{url}?{queryString}';\n      url = utils.tplEngine(urlTpl, {\n        url: url,\n        queryString: queryString\n      });\n\n      xhr.open(method, url, true);\n\n      var headers = option.headers || {};\n      utils.forEach(headers, function (header, name) {\n        xhr.setRequestHeader(name, header);\n      });\n\n      var success = option.success || utils.noop;\n      var fail = option.fail || utils.noop;\n      var isSuccess = function (xhr) {\n        return /^(200|202|10000)$/.test(xhr.status);\n      };\n\n      var onLoad = function () {\n        var result = xhr.responseText;\n        if (isSuccess(xhr)) {\n          success(result);\n        } else {\n          fail(result);\n        }\n      };\n      if ('onload' in xhr) {\n        xhr.onload = onLoad;\n      }\n      else {\n        xhr.onreadystatechange = function () {\n          if (xhr.readyState == 4) {\n            onLoad();\n          }\n        };\n      }\n      xhr.send(option.body);\n    },\n    store: (function () {\n      var keyNS = 'rong-rtcmark-';\n\n      function get(key) {\n        /*\n        legal data: \"\" [] {} null flase true\n\n        illegal: undefined\n            1: key not set\n            2: key is cleared\n            3: key removed\n            4: wrong data format\n        */\n        key = keyNS + key;\n\n        if (!isKeyExist(key)) {\n          return;\n        }\n\n        //maybe keyNS could avoid conflict\n        var val = localStorage.getItem(key) || sessionStorage.getItem(key);\n        val = JSON.parse(val);\n\n        //val format check\n        if (val !== null && val.hasOwnProperty('type') && val.hasOwnProperty('data')) {\n          return val.data;\n        }\n\n        /*\n        how to return illegal data for im？\n        */\n        return;\n      }\n\n      //isPersistent\n      function set(key, val, isTemp) {\n        var store = localStorage;\n        if (isTemp) {\n          store = sessionStorage;\n        }\n\n        key = keyNS + key;\n        var type = (typeof val);\n        val = {\n          data: val,\n          type: type\n        };\n\n        store[key] = JSON.stringify(val);\n      }\n\n      function remove(key) {\n        key = keyNS + key;\n        localStorage.removeItem(key);\n        sessionStorage.removeItem(key);\n      }\n\n      function isKeyExist(key) {\n        //do not depend on value cause of \"\"和0\n        return localStorage.hasOwnProperty(key) || sessionStorage.hasOwnProperty(key);\n      }\n\n      function setKeyNS(NS) {\n        var isString = typeof NS === 'string';\n        if (isString && NS !== '') {\n          keyNS = NS;\n        }\n      }\n\n      return {\n        setKeyNS: setKeyNS,\n        get: get,\n        set: set,\n        remove: remove\n      };\n    })()\n  };\n\n  window.RongRTC = window.RongRTC || {};\n  window.RongRTC.utils = utils;\n})({\n  win: window\n});"
  },
  {
    "path": "rtc/app/lib/RongRTCEngine.js",
    "content": "/* \nversion: 1.0.0\n*/\n\n/** This library require adapter.js */\n\n/** ----- 参数定义 ----- */\nvar RongRTCGlobal = {\n    /** 带宽设置计数器 */\n    bandWidthCount: 0\n}\n/** ----- 参数定义 ----- */\n\n/** ----- 常量定义 ----- */\nvar RongRTCConstant = {\n    /** RongRTC SDK版本号 */\n    SDK_VERSION_NAME: '1.6.0',\n    /** logon version */\n    LOGON_VERSION: '1',\n    /** keepAlive时间间隔 */\n    KEEPALIVE_INTERVAL: 5 * 1000,\n    /** keepAlive最大连续失败次数 */\n    KEEPALIVE_FAILEDTIMES_MAX: 4,\n    /** keepAliveTimer时间间隔 */\n    KEEPALIVE_TIMER_INTERVAL: 1 * 1000,\n    /** keepAlive未收到result最大超时时间 */\n    KEEPALIVE_TIMER_TIMEOUT_MAX: 20,\n    /** keepAlive未收到result最大超时时间 */\n    KEEPALIVE_TIMER_TIMEOUT_RECONNECT: 12,\n    /** reconnect最大连续次数 */\n    RECONNECT_MAXTIMES: 10,\n    /** reconnect连续重连时间间隔 */\n    RECONNECT_TIMEOUT: 1 * 1000,\n    /** getStatsReport时间间隔 */\n    GETSTATSREPORT_INTERVAL: 1 * 1000\n}\n/** 连接类型 */\nRongRTCConstant.ConnectionType = {\n    /** P2P模式 */\n    P2P: '0',\n    /** MediaServer模式 */\n    MEDIASERVER: '1'\n}\n/** 用户模式类型 */\nRongRTCConstant.UserType = {\n    /** 普通模式 */\n    NORMAL: '1',\n    /** 观察者模式 */\n    OBSERVER: '2'\n}\n/** 与服务器的连接状态 */\nRongRTCConstant.ConnectionState = {\n    CONNECTED: 'CONNECTED',\n    DISCONNECTED: 'DISCONNECTED',\n    ROOM_ERROR: 'ROOM_ERROR'\n}\n/** websocket的连接状态 */\nRongRTCConstant.wsConnectionState = {\n    CONNECTED: 'CONNECTED',\n    DISCONNECTED: 'DISCONNECTED',\n    CONNECTING: 'CONNECTING'\n}\n/** 交换类型 */\nRongRTCConstant.ExchangeType = {\n    /** offer */\n    OFFER: '1',\n    /** answer */\n    ANSWER: '2',\n    /** candidate */\n    CANDIDATE: '3'\n}\n/** logonAndJoin status */\nRongRTCConstant.LogonAndJoinStatus = {\n    CONNECT: 0,\n    RECONNECT: 1\n}\n/** offer status */\nRongRTCConstant.OfferStatus = {\n    SENDING: 'SENDING',\n    DONE: 'DONE'\n}\n/**\n * 会控\n */\nRongRTCConstant.Meeting = {\n    RoleChange: {\n        DEMOTION: 1,\n        INVITE: 2,\n        REMOVE: 3\n    },\n    ChannelAnswer: {\n        INVITE_OBSERVER: 1,\n        OBSERVER_SPEAK: 2,\n        INVITE_OPEN_DEV: 3,\n        DEMOTIONUSER: 4,\n        INVITE_CLOSE_DEV: 5\n    }\n\n}\n/** 信令 */\nRongRTCConstant.SignalType = {\n    /** 请求信令 */\n    // LOGON : 'logon',\n    // JOIN : 'join',\n    // PING : 'ping',\n    LOGONANDJOIN: 'logonAndJoin',\n    CHANNEL_PING: 'channelPing',\n    UPDATETALKTYPE: 'updateTalkType',\n    LEAVE: 'leave',\n    EWB_CREATE: 'ewb_create',\n    EWB_QUERY: 'ewb_query',\n    /** 应答信令 */\n    LOGONANDJOIN_RESULT: 'logonAndJoin_result',\n    CHANNEL_PING_RESULT: 'channelPing_result',\n    LEAVE_RESULT: 'leave_result',\n    EWB_CREATE_RESULT: 'ewb_create_result',\n    EWB_QUERY_RESULT: 'ewb_query_result',\n    /** 通知信令 */\n    JOINED: 'joined',\n    UPDATE_TALKTYPE: 'update_talktype',\n    OFFER_REQUEST: 'offerRequest',\n    LEFT: 'left',\n    EWB_CREATE_NOTIFY: 'ewb_create_notify',\n    FLOWSUBSCRIBE: 'flowSubscribe', //本地大小流切换 通知服务器\n    /** exchange信令 */\n    EXCHANGE: 'exchange',\n    /** 白板创建信令 */\n    EWB_CREATE_NOTIFY: 'ewb_create_notify',\n    /** 会议控制*/\n    ROLECHANGE: 'rolechange',\n    ROLECHANGE_RESULT: 'rolechange_result',\n    APPLY: 'apply',\n    APPLY_RESULT: 'apply_result',\n    MANAGEACTION: 'manageaction',\n    MANAGEACTION_RESULT: 'manageaction_result',\n    CHANNELANSWER: 'channelanswer',\n    CHANNELANSWER_RESULT: 'channelanswer_result',\n    CREATENOTIFY: 'createnotify',\n    CREATENOTIFY_RESULT: 'createnotify_result',\n    EWBService: 'ewbservice',\n    SCREENSHARING: 'screensharing',\n    TURNTALKTYPE: 'turntalktype',\n    TURNTALKTYPE_RESULT: 'turntalktype_result'\n\n\n}\n/** 视频分辨率 */\nRongRTCConstant.VideoProfile_default = {\n    width: 640,\n    height: 480,\n    frameRate: 15\n}\n/** 小视频分辨率 */\nRongRTCConstant.VideoProfile_min = {\n    width: 176,\n    height: 144,\n    frameRate: 15\n}\n/** 共享屏幕分辨率 */\nRongRTCConstant.ShareProfile_default = {\n    width: 1280,\n    height: 720,\n    frameRate: 15\n}\n/** 带宽 */\nRongRTCConstant.BandWidth_default = {\n    min: 100,\n    max: 500\n}\n/** 带宽全部 */\nRongRTCConstant.BandWidth_320_240 = {\n    min: 100,\n    max: 320\n}\nRongRTCConstant.BandWidth_640_480 = {\n    min: 100,\n    max: 500\n}\nRongRTCConstant.BandWidth_1280_720 = {\n    min: 100,\n    max: 1500\n}\nRongRTCConstant.BandWidth_ScreenShare_1280_720 = {\n\tmin: 1000,\n\tmax: 1500\n}\n/** ----- 常量定义 ----- */\n\n/** ----- RongRTCEngine ----- */\n//var RongRTCEngine = (function() {\n/**\n * 构造函数\n *\n */\nvar rongRTCengine,rongRTCEngine;\nvar RongRTCEngine = function (wsNavUrl) {\n    this.init(wsNavUrl);\n    this.initShare();\n    this.rongRTCMeeting = new RongRTCMeeting();\n    rongRTCEngine = rongRTCengine = this ;\n    return this;\n}\nRongRTCEngine.prototype.initShare = function () {\n    // 绑定插件监听事件\n    this.addEventListener();\n    // 检测插件\n    setTimeout(function () {\n        window.postMessage('test', '*');\n    }, 1000)\n}\n/**\n * 初始化\n *\n */\nRongRTCEngine.prototype.init = function (wsNavUrl) {\n    /** 会议ID */\n    this.channelId = null;\n    /** 连接集合 */\n    this.peerConnections = {};\n    /** 本地视频流 */\n    this.localStream = null;\n    /** 远端视频流数组 */\n    this.remoteStreams = new Array();\n    /** 屏幕共享音频流*/\n    this.localAudioStream = null;\n    /** logonAndJoin status 登录类型，第一次登录加入房间传0，断线重连传1 */\n    this.logonAndJoinStatus = null;\n    /** offer status */\n    this.offerStatus = null;\n    /** 连接的用户集合 */\n    this.joinedUsers = new RongRTCMap();\n    /** remote cname Map */\n    this.remoteCnameMap = new RongRTCMap();\n    /** remote Sdp Map */\n    this.remoteSdpMap = new RongRTCMap();\n    /** 麦克风开关 */\n    this.microphoneEnable = true;\n    /** 本地视频开关 */\n    this.localVideoEnable = true;\n    /** 远端音频开关 */\n    this.remoteAudioEnable = true;\n    /** keepAlive连续失败次数计数器 */\n    this.keepAliveFailedTimes = 0;\n    /** keepAlive间隔 */\n    this.keepAliveInterval = null;\n    /** keepAlive未收到result计时 */\n    this.keepAliveTimerCount = 0;\n    /** keepAlive未收到result计时器 */\n    this.keepAliveTimer = null;\n    /** reconnect连续次数计数器 */\n    this.reconnectTimes = 0;\n    /** csequence */\n    this.csequence = 0;\n    /** websocket对象 */\n    this.signaling = null;\n    /** websocket消息队列 */\n    this.wsQueue = [];\n    /** websocket连接状态, true:已连接, false:未连接 */\n    this.wsConnectionState = null;\n    /** websocket是否强制关闭：true:是, false不是 */\n    this.wsForcedClose = false;\n    /** websocket是否需要重连：true:是, false不是 */\n    this.wsNeedConnect = true;\n    /** websocket地址列表 */\n    this.wsUrlList = [];\n    /** websocket地址索引 */\n    this.wsUrlIndex = 0;\n\n    // 设置websocket nav url\n    this.wsNavUrl = wsNavUrl;\n\n    /** 视频参数默认值 */\n    this.userType = RongRTCConstant.UserType.NORMAL;\n    this.isAudioOnly = false;\n    this.localVideoEnable = true;\n    this.videoProfile = RongRTCConstant.VideoProfile_default;\n    this.videoMinProfile = RongRTCConstant.VideoProfile_min;\n    this.videoMaxRate = RongRTCConstant.BandWidth_default.max;\n    this.videoMinRate = RongRTCConstant.BandWidth_default.min;\n    /** media config */\n    this.mediaConfig = {\n        video: this.videoProfile,\n        audio: true\n    }\n    /** mediaMin config */\n    this.mediaMinConfig = {\n        video: this.videoMinProfile,\n        audio: false//小流不需要视频\n    }\n    /** bandwidth */\n    this.bandWidth = {\n        min: this.videoMinRate,\n        max: this.videoMaxRate\n    };\n    /** 白板 */\n    this.ewbCreated = false;\n//\t/** sdp属性 */\n//\t// 统一设置，包含观察者模式和普通模式无摄像头情况\n//\tthis.mediaConfig.sdpConstraints = {};\n//\tthis.mediaConfig.sdpConstraints.mandatory = {};\n//\tthis.mediaConfig.sdpConstraints.mandatory.OfferToReceiveAudio = true;\n//\tthis.mediaConfig.sdpConstraints.mandatory.OfferToReceiveVideo = true;\n\n    /** 是否上报丢包率信息 */\n    this.isSendLostReport = false;\n    /** RongRTCConnectionStatsReport */\n    this.rongRTCConnectionStatsReport = null;\n    /** getStatsReport间隔 */\n    this.getStatsReportInterval = null;\n    /** 是否支持屏幕共享 */\n    this.isScreenShareSupport = false;\n};\n/**\n * reset\n *\n */\nRongRTCEngine.prototype.reset = function () {\n\n}\n/**\n * clear\n *\n */\nRongRTCEngine.prototype.clear = function () {\n    this.exitScheduleKeepAlive();\n    this.exitScheduleKeepAliveTimer();\n    this.disconnect(false);\n    this.closePeerConnection(this.selfUserId);\n}\n/** ----- 提供能力 ----- */\n/**\n * 获取RongRTC SDK版本号\n *\n * @return sdkversion\n */\nRongRTCEngine.prototype.getSDKVersion = function () {\n    return RongRTCConstant.SDK_VERSION_NAME;\n}\n/**\n * 设置RongRTCEngineEventHandle监听\n *\n */\nRongRTCEngine.prototype.setRongRTCEngineEventHandle = function (rongRTCEngineEventHandle) {\n    this.rongRTCEngineEventHandle = rongRTCEngineEventHandle;\n}\n/**\n * 设置视频参数\n *\n */\nRongRTCEngine.prototype.setVideoParameters = function (config) {\n    if (config.USER_TYPE != null && config.USER_TYPE == RongRTCConstant.UserType.OBSERVER) {\n        this.userType = RongRTCConstant.UserType.OBSERVER;\n    }\n    if (config.IS_AUDIO_ONLY != null) {\n        this.isAudioOnly = config.IS_AUDIO_ONLY;\n    }\n    if (config.IS_CLOSE_VIDEO != null) {\n        this.localVideoEnable = !config.IS_CLOSE_VIDEO;\n    }\n    if (config.VIDEO_PROFILE != null) {\n        this.videoProfile = config.VIDEO_PROFILE;\n        /** media config */\n        this.mediaConfig.video = this.videoProfile;\n    }\n    /** bandwidth */\n    if (config.VIDEO_MAX_RATE != null) {\n        this.videoMaxRate = config.VIDEO_MAX_RATE;\n        this.bandWidth.max = this.videoMaxRate;\n    } else if (config.VIDEO_PROFILE.width != null && config.VIDEO_PROFILE.height != null) {\n        var bandWidth_resulotion = RongRTCConstant[\"BandWidth_\" + config.VIDEO_PROFILE.width + \"_\" + config.VIDEO_PROFILE.height]\n        if (bandWidth_resulotion != null) {\n            this.videoMaxRate = bandWidth_resulotion.max;\n            this.bandWidth.max = this.videoMaxRate;\n        }\n    }\n    if (config.VIDEO_MIN_RATE != null) {\n        this.videoMinRate = config.VIDEO_MIN_RATE;\n        this.bandWidth.min = this.videoMinRate;\n    } else if (config.VIDEO_PROFILE.width != null && config.VIDEO_PROFILE.height != null) {\n        var bandWidth_resulotion = RongRTCConstant[\"BandWidth_\" + config.VIDEO_PROFILE.width + \"_\" + config.VIDEO_PROFILE.height]\n        if (bandWidth_resulotion != null) {\n            this.videoMinRate = bandWidth_resulotion.min;\n            this.bandWidth.min = this.videoMinRate;\n        }\n    }\n//\t/** sdp属性 */\n//\tif (this.userType == RongRTCConstant.UserType.OBSERVER) { // 观察者模式\n//\t\tif (this.mediaConfig.sdpConstraints == null) {\n//\t\t\tthis.mediaConfig.sdpConstraints = {};\n//\t\t}\n//\t\tif (this.mediaConfig.sdpConstraints.mandatory == null) {\n//\t\t\tthis.mediaConfig.sdpConstraints.mandatory = {};\n//\t\t}\n//\t\tthis.mediaConfig.sdpConstraints.mandatory.OfferToReceiveAudio = true;\n//\t\tthis.mediaConfig.sdpConstraints.mandatory.OfferToReceiveVideo = true;\n//\t}\n}\n/**\n * 列举 麦克风  摄像头\n * @return audioState ：0 没有麦克风 1 有 ；videoState 0 没有摄像头 1 有\n */\nRongRTCEngine.prototype.audioVideoState = async function () {\n    // 列举设备 audioState  videoState\n    let audioState = 0;\n    let videoState = 0;\n    let audioAuthorized = 0;\n    let videoAuthorized = 0;\n    await navigator.mediaDevices.enumerateDevices().then(function (deviceInfos) {\n        let deviceArr = deviceInfos.map(function(deviceInfo, index) {\n            return deviceInfo.kind;\n        })\n        deviceArr.forEach(function(kind) {\n            if (kind.indexOf('video') > -1)\n                videoState = 1;\n            if (kind.indexOf('audio') > -1)\n                audioState = 1;\n        })\n    });\n    if (videoState) {\n        await  navigator.mediaDevices.getUserMedia({video: true, audio: false}).then(function(data)  {\n            videoAuthorized = 1;\n        }).catch(function(error)  {\n            if (error.name == 'PermissionDeniedError')\n                videoAuthorized = 0;\n        })\n\n    }\n    if (audioState) {\n        await  navigator.mediaDevices.getUserMedia({video: false, audio: true}).then(function(data)  {\n            audioAuthorized = 1;\n        }).catch(function(error)  {\n            if (error.name == 'PermissionDeniedError')\n                audioAuthorized = 0;\n        })\n    }\n    return {\n        audioState: audioState,\n        audioAuthorized: audioAuthorized,\n        videoState: videoState,\n        videoAuthorized: videoAuthorized\n    }\n}\n/**\n * 加入会议\n *\n */\nRongRTCEngine.prototype.joinChannel = function (channelId, userId, token, callback) {\n\n    this.channelId = RongRTCConstant.ConnectionType.MEDIASERVER + channelId;\n    this.selfUserId = userId;\n    this.token = token;\n    // 创建本地视频    pc.addStream(rongRTCEngine.localStreamMin);//加入小流\n    var rongRTCEngine = this;\n    if (rongRTCEngine.userType == 2) {\n        rongRTCEngine.createSignaling();\n        rongRTCEngine.logonAndJoin(RongRTCConstant.LogonAndJoinStatus.CONNECT);\n        this.localStream = new MediaStream();\n        return\n    }\n    navigator.getUserMedia(rongRTCEngine.mediaConfig, function (stream) {\n        RongRTCLogger.info(\"navigator.getUserMedia success\");\n        rongRTCEngine.localStream = stream;\n        rongRTCengine.localStream.id = rongRTCengine.selfUserId;\n        if (!rongRTCEngine.localVideoEnable) {\n            rongRTCEngine.closeLocalVideoWithUpdateTalkType(\n                !rongRTCEngine.localVideoEnable, false);\n        }\n        // 创建websocket连接\n        rongRTCEngine.createSignaling();\n        rongRTCEngine.logonAndJoin(RongRTCConstant.LogonAndJoinStatus.CONNECT);\n    }, function (error) {\n        callback && callback(error);\n        RongRTCLogger.error(\"navigator.getUserMedia error: \", error);\n\n    });\n   /* //小流媒体\n    navigator.getUserMedia(rongRTCEngine.mediaMinConfig, function (stream) {\n        RongRTCLogger.info(\"navigator.geMinMedia success\");\n        stream.id = rongRTCEngine.selfUserId + \"_tiny\";\n        rongRTCEngine.localStreamMin = stream;\n\n    }, function (error) {\n        RongRTCLogger.error(\"navigator.getMinMedia error: \", error);\n\n    });*/\n};\n/**\n * 离开会议\n *\n */\nRongRTCEngine.prototype.leaveChannel = function () {\n    this.leave();\n}\n/**\n * 获取本地视频视图\n * @Deprecated\n *\n */\nRongRTCEngine.prototype.getLocalVideoView = function () {\n    return this.getLocalStream();\n};\n/**\n * 获取远端视频视图\n * @Deprecated\n *\n */\nRongRTCEngine.prototype.getRemoteVideoView = function (userId) {\n    return this.getRemoteStream(userId);\n};\n/**\n * 获取本地视频流\n *\n */\nRongRTCEngine.prototype.getLocalStream = function () {\n    return this.localStream;\n};\n/**\n * 获取远端视频流\n *\n */\nRongRTCEngine.prototype.getRemoteStream = function (userId) {\n    for (var i in this.remoteStreams) {\n        if (this.remoteStreams[i].id == userId) {\n            return this.remoteStreams[i]\n            break;\n        }\n    }\n    return null;\n};\n/**\n * 获取远端视频流数量\n *\n */\nRongRTCEngine.prototype.getRemoteStreamCount = function () {\n    return this.remoteStreams.length;\n};\n/**\n * 创建视频视图\n *\n */\nRongRTCEngine.prototype.createVideoView = function () {\n    var videoView = document.createElement('video');\n    // 视频自动播放\n    videoView.autoplay = true;\n    videoView.setAttribute(\"playsinline\", true); // isa\n    return videoView;\n};\n/**\n * 创建本地视频视图\n *\n */\nRongRTCEngine.prototype.createLocalVideoView = function () {\n    var localVideoView = this.createVideoView();\n    // 本地视频静音\n    localVideoView.muted = true;\n    // ID\n    localVideoView.id = this.selfUserId;\n    // 附加视频流\n    localVideoView.srcObject = this.getLocalStream();\n    return localVideoView;\n};\n/**\n * 创建远端视频视图\n *\n */\nRongRTCEngine.prototype.createRemoteVideoView = function (userId) {\n    var remoteStream = this.getRemoteStream(userId);\n    // if (remoteStream == null) {\n    // \treturn null;\n    // }\n    var remoteVideoView = this.createVideoView();\n    // ID\n    remoteVideoView.id = userId;\n    // 附加视频流\n    remoteVideoView.srcObject = remoteStream;\n    return remoteVideoView;\n};\n/**\n * 关闭/打开麦克风 true, 关闭 false, 打开\n *\n */\nRongRTCEngine.prototype.muteMicrophone = function (isMute) {\n    this.updateTalkTypeMic(isMute);\n}\n/**\n * 关闭/打开本地摄像头 true, 关闭 false, 打开\n *\n */\nRongRTCEngine.prototype.closeLocalVideo = function (isCameraClose) {\n    this.updateTalkTypeCamera(isCameraClose);\n}\n/**\n * 关闭/打开本地摄像头和发送updateTalkType信令\n *\n * @param isCameraClose\n *            true, 关闭 false, 打开\n * @param isUpdateTalkType\n *            true, 发送 false, 不发送\n */\nRongRTCEngine.prototype.closeLocalVideoWithUpdateTalkType = function (isCameraClose, isUpdateTalkType) {\n    this.localStream && this.localStream.getVideoTracks().forEach(function (track) {\n        track.enabled = !isCameraClose;\n    })\n    RongRTCLogger.info(\"Local video close=\" + isCameraClose);\n    this.localVideoEnable = !isCameraClose;\n    // 发送updateTalkType信令\n    /* if (isUpdateTalkType) {\n         this.updateTalkType();\n     }*/\n}\n/**\n * 关闭/打开声音 true, 关闭 false, 打开\n *\n */\nRongRTCEngine.prototype.closeRemoteAudio = function (isAudioClose) {\n    if (this.remoteStreams.length === 0) {\n        RongRTCLogger.info(\"No remote audio available.\");\n        return;\n    }\n    for (x = 0; x < this.remoteStreams.length; x++) {\n        var tmpRemoteStream = this.remoteStreams[x];\n        if (tmpRemoteStream && tmpRemoteStream.getAudioTracks()\n            && tmpRemoteStream.getAudioTracks().length > 0) {\n            for (y = 0; y < tmpRemoteStream.getAudioTracks().length; y++) {\n                tmpRemoteStream.getAudioTracks()[y].enabled = !isAudioClose;\n            }\n        }\n    }\n    RongRTCLogger.info(\"Remote audio close=\" + isAudioClose);\n    this.remoteAudioEnable = !isAudioClose;\n}\n/**\n * 关闭本地媒体流（视频流和音频流）\n *\n */\nRongRTCEngine.prototype.closeLocalStream = function () {\n    if (this.localStream == null || this.localStream.getTracks() == null\n        || this.localStream.getTracks().length === 0) {\n        RongRTCLogger.info(\"No local track available.\");\n    } else {\n    \tfor (i = 0; i < this.localStream.getTracks().length; i++) {\n            this.localStream.getTracks()[i].stop();\n        }\n    }\n    if (this.minStream) { // 小流\n    \tif (this.localStreamMin == null || this.localStreamMin.getTracks() == null\n\t        || this.localStreamMin.getTracks().length === 0) {\n\t        RongRTCLogger.info(\"No MinStream track available.\");\n\t    } else {\n\t    \tfor (i = 0; i < this.localStreamMin.getTracks().length; i++) {\n\t\t        this.localStreamMin.getTracks()[i].stop();\n\t\t    }\n\t    }\n    }\n}\n/**\n * 请求白板页面 HTTP URL\n *\n */\nRongRTCEngine.prototype.requestWhiteBoardURL = function () {\n    this.ewb_create();\n}\n/**\n * 查询白板\n *\n */\nRongRTCEngine.prototype.queryWhiteBoard = function () {\n    this.ewb_query();\n}\n/**\n * 设置是否上报丢包率信息\n *\n */\nRongRTCEngine.prototype.enableSendLostReport = function (enable) {\n    this.isSendLostReport = enable\n}\nRongRTCEngine.prototype.checkSupportScreen= function () {\n    // 检测浏览器是否支持\n    var supportBrowser = ['Chrome'];\n    var mb = RongRTCUtil.myBrowser();\n    if (supportBrowser.indexOf(mb) < 0) {\n        this.rongRTCEngineEventHandle.call('onStartScreenShareComplete', {\n            'isSuccess': false,\n            'code': 1 // 浏览器不支持\n        });\n        return;\n    }\n\n    var rongRTCEngine = this;\n\n    if (!rongRTCEngine.isScreenShareSupport) {\n        rongRTCEngine.rongRTCEngineEventHandle.call('onStartScreenShareComplete', {\n            'isSuccess': false,\n            'code': 2 // 未安装插件\n        });\n        return;\n    }\n}\nRongRTCEngine.prototype._startScreenShare = function (stream) {\n    this.checkSupportScreen();\n    if (stream) {\n        this.shareWithStream(stream);\n    } else {\n        // 发起屏幕共享\n        rongRTCEngine.requestScreenShare();\n\n    }\n}\n/**\n * 开启屏幕共享\n *\n */\nRongRTCEngine.prototype.startScreenShare = function (stream) {\n\n    this._startScreenShare(stream);\n\n}\n/**\n * 关闭屏幕共享\n *\n */\nRongRTCEngine.prototype.stopScreenShare = function () {\n    this.endShareScreen();\n}\n/**\n *结束屏幕共享\n */\nRongRTCEngine.prototype.endShareScreen = function () {\n    this.rongRTCMeeting.screenShare(false);\n    var rongRTCEnv = this;\n    rongRTCEnv.getLocalStreamFromRtcApi(rongRTCEnv.mediaConfig).then(function (stream) {\n        //关闭音频\n        rongRTCEnv.localAudioStream ? rongRTCEnv.localAudioStream.getTracks().forEach(function (track) {\n            track.stop();\n        }) : void 0;\n        //还原音频状态\n        stream.getAudioTracks().forEach(function (track) {\n            track.enabled = rongRTCEnv.microphoneEnable;\n        });\n        rongRTCEngine.screenSharingStatus = false;\n        RongRTCUtil.setMediaStream(rongRTCEnv.selfUserId, stream);\n        rongRTCEnv.screenOffer(stream);\n\n        // talktype[0:无视频有音频, 1:有视频有音频, 2:有视频无音频, 3:无视频无音频]\n        var talkType;\n        if (!rongRTCEnv.localVideoEnable && rongRTCEnv.microphoneEnable)\n            talkType = 0;\n        else if (rongRTCEnv.localVideoEnable && rongRTCEnv.microphoneEnable)\n            talkType =1;\n        else  if(rongRTCEnv.localVideoEnable && !rongRTCEnv.microphoneEnable)\n            talkType =2;\n        else\n            talkType=3;\n        rongRTCengine.rongRTCEngineEventHandle.call('onShareComplete', {\n            'isShared': false,\n            stream: rongRTCengine.localStream,\n            userId: rongRTCengine.selfUserId,\n            talkType:talkType\n\n        });\n\n        rongRTCEngine.rongRTCEngineEventHandle.call('onStopScreenShareComplete', {\n            'isSuccess': true,\n            'isShared': false,\n            stream: rongRTCengine.localStream,\n            userId: rongRTCengine.selfUserId\n        });\n\n    }).catch(function (error) {\n        RongRTCLogger.error(\"stopScreenShare getLocalStreamFromRtcApi error: \" + error);\n        rongRTCEngine.rongRTCEngineEventHandle.call('onStopScreenShareComplete', {\n            'isSuccess': false\n        });\n    });\n\n}\n/** ----- 提供能力 ----- */\n/** ----- websocket ----- */\n/**\n * 创建WebSocket对象\n *\n */\nRongRTCEngine.prototype.createSignaling = function () {\n    // ws正在连接\n    this.wsConnectionState = RongRTCConstant.wsConnectionState.CONNECTING;\n    if (this.wsUrlList.length > 0) { // 已取得websocket连接地址\n        this.wsUrlIndex++;\n        if (this.wsUrlIndex > this.wsUrlList.length - 1) {\n            this.wsUrlIndex = 0;\n        }\n        var url = this.wsUrlList[this.wsUrlIndex];\n        this.createSignalingWithUrl(url);\n    } else { // 还没有取得websocket连接地址\n        var rongRTCEngine = this;\n        RongRTCUtil.getWsUrlList(this.wsNavUrl, function (data) {\n            var wsUrlList = data;\n            if (wsUrlList.length < 1) {\n                throw new Error(\"websocket连接失败!\");\n            }\n            rongRTCEngine.wsUrlList = RongRTCUtil.shuffle(wsUrlList);\n            var url = rongRTCEngine.wsUrlList[0];\n            rongRTCEngine.createSignalingWithUrl(url);\n        });\n    }\n};\n/**\n * 创建WebScoket对象\n *\n */\nRongRTCEngine.prototype.createSignalingWithUrl = function (url) {\n    var rongRTCEngine = this;\n    rongRTCEngine.signaling = new WebSocket('wss://' + url + '/signaling');\n    rongRTCEngine.signaling.onopen = function () {\n        rongRTCEngine.onOpen();\n    };\n    rongRTCEngine.signaling.onmessage = function (ev) {\n        rongRTCEngine.onMessage(ev);\n    };\n    rongRTCEngine.signaling.onerror = function (ev) {\n        rongRTCEngine.onError(ev);\n    };\n    rongRTCEngine.signaling.onclose = function (ev) {\n        rongRTCEngine.onClose(ev);\n    };\n};\n/**\n * RongRTCMessage实体\n *\n * @param signal\n * @param content\n * @param parameters\n * @returns\n */\nvar RongRTCMessage = function (signal, content, parameters) {\n    this.signal = signal;\n    this.content = content;\n    this.parameters = parameters;\n};\n/**\n * 发送消息\n *\n */\nRongRTCEngine.prototype.sendMsg = function (signal, msgBody, parameters) {\n    this.csequence++;\n    parameters.csequence = this.csequence;\n    var message = JSON.stringify(new RongRTCMessage(signal, msgBody, parameters));\n    this.send(message);\n};\n/**\n * 发送消息\n *\n */\nRongRTCEngine.prototype.send = function (message) {\n    var signal = JSON.parse(message).signal;\n    if (this.wsConnectionState == RongRTCConstant.wsConnectionState.CONNECTED) { // ws连接可用\n        if (signal == RongRTCConstant.SignalType.CHANNEL_PING) { // channelPing记录debug日志\n            RongRTCLogger.debug(\"req: \" + message);\n        } else {\n            RongRTCLogger.info(\"req: \" + message);\n        }\n        this.signaling.send(message);\n    } else { // websocket不可用\n        RongRTCLogger.warn(\"websocket not connected!\");\n        if (this.wsQueue.length == 0 // 消息队列只保留一条logonAndJoin\n            && signal == RongRTCConstant.SignalType.LOGONANDJOIN) { // logonAndJoin\n            // 加入消息队列\n            this.wsQueue.push(message);\n        }\n    }\n};\n/**\n * 发送队列中的消息\n */\nRongRTCEngine.prototype.doWsQueue = function () {\n    if (this.wsQueue.length > 0) {\n        // 消息队列只有一条logonAndJoin，取出并删除\n        var message = this.wsQueue.shift();\n        this.send(message);\n    }\n};\n/**\n * onOpen\n *\n */\nRongRTCEngine.prototype.onOpen = function () {\n    RongRTCLogger.info('websocket open');\n    // ws连接可用\n    this.wsConnectionState = RongRTCConstant.wsConnectionState.CONNECTED;\n    // 重置reconnectTimes\n    this.reconnectTimes = 0;\n    // websocket可用后，发送队列中的消息\n    this.doWsQueue();\n}\n/**\n * onMessage\n *\n */\nRongRTCEngine.prototype.onMessage = function (ev) {\n    var data = JSON.parse(ev.data);\n    if (data.signal == RongRTCConstant.SignalType.CHANNEL_PING_RESULT) { // channelPing_result记录debug日志\n        RongRTCLogger.debug(\"res: \" + ev.data);\n    } else {\n        RongRTCLogger.info(\"res: \" + ev.data);\n    }\n    switch (data.signal) {\n        // 应答信令\n        case RongRTCConstant.SignalType.LOGONANDJOIN_RESULT:\n            this.logonAndJoin_result(data);\n            return;\n        case RongRTCConstant.SignalType.CHANNEL_PING_RESULT:\n            this.channelPing_result(data);\n            return;\n        case RongRTCConstant.SignalType.LEAVE_RESULT:\n            this.leave_result(data);\n            return;\n        case RongRTCConstant.SignalType.EWB_CREATE_RESULT:\n            this.ewb_create_result(data);\n            return;\n        case RongRTCConstant.SignalType.EWB_QUERY_RESULT:\n            this.ewb_query_result(data);\n            return;\n        // 通知信令\n        case RongRTCConstant.SignalType.JOINED:\n            this.joined(data);\n            return;\n        case RongRTCConstant.SignalType.LEFT:\n            this.left(data);\n            return;\n        case RongRTCConstant.SignalType.OFFER_REQUEST:\n            this.offerRequest(data);\n            return;\n        case RongRTCConstant.SignalType.UPDATE_TALKTYPE:\n            this.update_talktype(data);\n            return;\n        // exchange信令\n        case RongRTCConstant.SignalType.EXCHANGE:\n            this.exchange(data);\n            return;\n        // exchange信令\n        case RongRTCConstant.SignalType.EWB_CREATE_NOTIFY:\n            this.ewbCreateNotify(data);\n            return;\n        //会控信令 // todo\n        case RongRTCConstant.SignalType.ROLECHANGE:\n            this.rongRTCMeeting.roleChange(data);\n            return;\n        case RongRTCConstant.SignalType.APPLY:\n            this.rongRTCMeeting.applyMessage(data);\n            return;\n        case RongRTCConstant.SignalType.MANAGEACTION:\n            this.rongRTCMeeting.manageAction(data);\n            return;\n        case RongRTCConstant.SignalType.CHANNELANSWER:\n            this.rongRTCMeeting.channelAnswer(data);\n            return;\n        case RongRTCConstant.SignalType.CREATENOTIFY:\n            console.info(data)\n            return;\n        case RongRTCConstant.SignalType.SCREENSHARING:\n            console.info(data)\n            return;\n        case RongRTCConstant.SignalType.TURNTALKTYPE:\n            this.rongRTCMeeting.turntalktype(data);\n            return;\n        default:\n            RongRTCLogger.warn('Event ' + data.signal + ' do not have defined function', data.parameters);\n    }\n};\n/**\n * onClose\n *\n */\nRongRTCEngine.prototype.onClose = function (ev) {\n    var rongRTCEnv = this;\n    RongRTCLogger.warn('websocket close', ev);\n    if (ev.code == 1000 && ev.reason == 'wsForcedClose') { // 如果自定义关闭ws连接，避免二次重连\n        return;\n    }\n    // ws连接不可用\n    this.wsConnectionState = RongRTCConstant.wsConnectionState.DISCONNECTED;\n    if (this.wsNeedConnect) { // ws需要重连\n        setTimeout(function () {\n            rongRTCEnv.reconnect()\n        }, RongRTCConstant.RECONNECT_TIMEOUT)\n    }\n};\n/**\n * onError\n *\n */\nRongRTCEngine.prototype.onError = function (ev) {\n    RongRTCLogger.error('websocket error', ev);\n};\n/**\n * disconnect\n *\n */\nRongRTCEngine.prototype.disconnect = function (wsNeedConnect) {\n    RongRTCLogger.warn('websocket disconnect');\n    RongRTCLogger.warn('wsNeedConnect=' + wsNeedConnect);\n\n    this.wsForcedClose = true;\n    this.wsNeedConnect = wsNeedConnect;\n    this.wsConnectionState = RongRTCConstant.wsConnectionState.DISCONNECTED;\n    // 自定义关闭ws连接\n    this.signaling.close(1000, 'wsForcedClose');\n    // 网断后，执行close方法后不会立即触发onclose事件，所以需要手动重连\n    if (this.wsNeedConnect) { // ws需要重连\n        this.reconnect();\n    }\n};\n/**\n * reconnect\n *\n */\nRongRTCEngine.prototype.reconnect = function () {\n    if (this.wsConnectionState != RongRTCConstant.wsConnectionState.DISCONNECTED) { // ws连接可用或正在连接不重连\n        return;\n    }\n    this.reconnectTimes++;\n    RongRTCLogger.warn('reconnectTimes=' + this.reconnectTimes);\n    if (this.reconnectTimes > RongRTCConstant.RECONNECT_MAXTIMES) {\n        this.keepAliveDisconnect();\n    } else {\n        var rongRTCEngine = this;\n        if (rongRTCEngine.reconnectTimes > 1) { // 连续重连的话间隔一定时间\n            setTimeout(function () {\n                reconnectFunc(rongRTCEngine);\n            }, RongRTCConstant.RECONNECT_TIMEOUT);\n        } else {\n            reconnectFunc(rongRTCEngine);\n        }\n\n        function reconnectFunc(rongRTCEngine) {\n            if (rongRTCEngine.wsConnectionState == RongRTCConstant.wsConnectionState.DISCONNECTED) { // ws连接不可用\n                RongRTCLogger.info('websocket reconnect');\n                rongRTCEngine.createSignaling();\n                // 重新logonAndJoin\n                rongRTCEngine.logonAndJoin(RongRTCConstant.LogonAndJoinStatus.RECONNECT);\n            }\n        }\n    }\n};\n/** ----- websocket ----- */\n/** ----- keepAlive ---- */\n/**\n * keepAlive\n *\n */\nRongRTCEngine.prototype.keepAlive = function () {\n    if (this.wsConnectionState == RongRTCConstant.wsConnectionState.CONNECTED) { // ws连接可用\n        // 开始计时\n        this.startScheduleKeepAliveTimer();\n        this.channelPing();\n    } else {\n        this.keepAliveFailed();\n    }\n}\n/**\n * keepAlive失败\n *\n */\nRongRTCEngine.prototype.keepAliveFailed = function () {\n    this.keepAliveFailedTimes++;\n    RongRTCLogger.warn(\"keepAliveFailedTimes=\" + this.keepAliveFailedTimes);\n    if (this.keepAliveFailedTimes > RongRTCConstant.KEEPALIVE_FAILEDTIMES_MAX) {\n        this.keepAliveDisconnect();\n    }\n}\n/**\n * 开始keepAlive\n *\n */\nRongRTCEngine.prototype.startScheduleKeepAlive = function () {\n    this.exitScheduleKeepAlive();\n    this.exitScheduleKeepAliveTimer();\n\n    var rongRTCEngine = this;\n    rongRTCEngine.keepAlive(); // 立即执行1次\n    rongRTCEngine.keepAliveInterval = setInterval(function () {\n        rongRTCEngine.keepAlive();\n    }, RongRTCConstant.KEEPALIVE_INTERVAL);\n}\n/**\n * 停止keepAlive\n *\n */\nRongRTCEngine.prototype.exitScheduleKeepAlive = function () {\n    this.keepAliveFailedTimes = 0;\n    if (this.keepAliveInterval != null) {\n        clearInterval(this.keepAliveInterval);\n        this.keepAliveInterval = null;\n    }\n}\n/**\n * keepAlive未收到result计时器方法\n *\n */\nRongRTCEngine.prototype.keepAliveTimerFunc = function () {\n    this.keepAliveTimerCount++;\n    if (this.keepAliveTimerCount > RongRTCConstant.KEEPALIVE_TIMER_TIMEOUT_MAX / 3) {\n        RongRTCLogger.warn(\"keepAliveTimerCount=\" + this.keepAliveTimerCount);\n    } else {\n        RongRTCLogger.debug(\"keepAliveTimerCount=\" + this.keepAliveTimerCount);\n    }\n    if (this.keepAliveTimerCount > RongRTCConstant.KEEPALIVE_TIMER_TIMEOUT_MAX) {\n        this.keepAliveDisconnect();\n        return;\n    }\n    if (this.keepAliveTimerCount == RongRTCConstant.KEEPALIVE_TIMER_TIMEOUT_RECONNECT) {\n        // 断开本次连接，进行重连\n        this.disconnect(true);\n    }\n}\n/**\n * 开始keepAlive未收到result计时器\n *\n */\nRongRTCEngine.prototype.startScheduleKeepAliveTimer = function () {\n    if (this.keepAliveTimer == null) {\n        var rongRTCEngine = this;\n        // keepAlive5秒间隔，这个时候有可能已经断了5秒\n        rongRTCEngine.keepAliveTimerCount += RongRTCConstant.KEEPALIVE_INTERVAL / 1000;\n        rongRTCEngine.keepAliveTimer = setInterval(function () {\n            rongRTCEngine.keepAliveTimerFunc();\n        }, RongRTCConstant.KEEPALIVE_TIMER_INTERVAL);\n    }\n}\n/**\n * 停止keepAlive未收到result计时器\n *\n */\nRongRTCEngine.prototype.exitScheduleKeepAliveTimer = function () {\n    this.keepAliveTimerCount = 0;\n    if (this.keepAliveTimer != null) {\n        clearInterval(this.keepAliveTimer);\n        this.keepAliveTimer = null;\n    }\n}\n/**\n * 与服务器断开\n *\n */\nRongRTCEngine.prototype.keepAliveDisconnect = function () {\n    this.clear();\n    this.rongRTCEngineEventHandle.call('onConnectionStateChanged', {\n        'connectionState': RongRTCConstant.ConnectionState.DISCONNECTED\n    });\n}\n/** ----- keepAlive ---- */\n/** ----- getStatsReport ---- */\n/**\n * getStatsReport\n *\n */\nRongRTCEngine.prototype.getStatsReport = function () {\n    var pcClient = this.peerConnections[this.selfUserId];\n    if (pcClient != null) {\n        var pc = pcClient['pc'];\n        var rongRTCEngine = this;\n        pc.getStats(null, function (report) {\n            rongRTCEngine.rongRTCConnectionStatsReport.parseStatsReport(report);\n            if (rongRTCEngine.isSendLostReport) {\n                RongRTCLogger.debug(\"onNetworkSentLost=\" +\n                    rongRTCEngine.rongRTCConnectionStatsReport.packetSendLossRate);\n                // 上报丢包率信息，返回本地数据流的丢包率\n                rongRTCEngine.rongRTCEngineEventHandle.call('onNetworkSentLost', {\n                    packetSendLossRate: rongRTCEngine.rongRTCConnectionStatsReport.packetSendLossRate\n                });\n            }\n        }, function (error) {\n            RongRTCLogger.error(\"getStatsReport error: \", error);\n        });\n    }\n}\n/**\n * 开始getStatsReport\n *\n */\nRongRTCEngine.prototype.startScheduleGetStatsReport = function () {\n    this.exitScheduleGetStatsReport();\n\n    this.rongRTCConnectionStatsReport = new RongRTCConnectionStatsReport();\n    var rongRTCEngine = this;\n    rongRTCEngine.getStatsReportInterval = setInterval(function () {\n        rongRTCEngine.getStatsReport();\n    }, RongRTCConstant.GETSTATSREPORT_INTERVAL);\n}\n/**\n * 停止getStatsReport\n *\n */\nRongRTCEngine.prototype.exitScheduleGetStatsReport = function () {\n    if (this.getStatsReportInterval != null) {\n        clearInterval(this.getStatsReportInterval);\n        this.getStatsReportInterval = null;\n    }\n    this.rongRTCConnectionStatsReport = null;\n}\n/** ----- getStatsReport ---- */\n/** ----- screenShare ---- */\n/**\n * 绑定插件监听事件\n *\n */\nRongRTCEngine.prototype.addEventListener = function () {\n    if (this.isBindEvent) { // 已经绑定过事件\n        return;\n    }\n    var rongRTCEngine = this;\n    window.addEventListener(\"message\", function (msg) {\n        var messageHandler = {\n            onResponseReqSouId: function (msg) {\n                rongRTCEngine.getLocalStreamFromRtcApi({video: false, audio: true}).then(function (stream) {\n                    rongRTCEngine.localAudioStream = stream;\n                    stream.getAudioTracks().forEach(function (track) {\n                        track.enabled = rongRTCEngine.microphoneEnable;\n                    });\n                }).catch(function (error) {\n                    RongRTCLogger.error(\"onResponseReqSouId getLocalStreamFromRtcApi error: \" + error);\n                    rongRTCEngine.rongRTCEngineEventHandle.call('onStartScreenShareComplete', {\n                        'isSuccess': false\n                    });\n                });\n                rongRTCEngine.getScreenStream(msg.data.sourceId).then(function (stream) {\n                    stream.getVideoTracks()[0].onended = function () {\n                        // 关闭屏幕共享\n                        rongRTCEngine.endShareScreen();\n                    };\n                    // 进行屏幕共享\n                    rongRTCEngine.screenShare(stream);\n                }).catch(function (error) {\n                    RongRTCLogger.error(\"onResponseReqSouId getScreenStream error: \" + error);\n                    rongRTCEngine.rongRTCEngineEventHandle.call('onStartScreenShareComplete', {\n                        'isSuccess': false\n                    });\n                });\n            },\n            testMessage: function (msg) {\n                rongRTCEngine.isScreenShareSupport = true;\n            },\n            other: function (msg) {\n                RongRTCLogger.info(msg);\n            }\n        }\n        var handle = messageHandler[msg.data.type] || messageHandler.other;\n        handle(msg, rongRTCEngine);\n    }, false);\n    this.isBindEvent = true;\n}\n/**\n * 发起屏幕共享\n *\n */\nRongRTCEngine.prototype.requestScreenShare = function () {\n    window.postMessage('requestScreenSourceId', '*');\n}\n/**\n * 根据RtcApi获取本地视频\n *\n */\nRongRTCEngine.prototype.getLocalStreamFromRtcApi = function (config) {\n    return new Promise(function (resolve, reject) {\n        navigator.getUserMedia(config, resolve, reject);\n    })\n}\n/**\n * 获取本地桌面共享流\n *\n */\nRongRTCEngine.prototype.getScreenStream = function (sourceId) {\n    var constraints = {\n        mandatory: {\n            chromeMediaSource: 'desktop',\n            maxWidth: RongRTCConstant.ShareProfile_default.width,\n            maxHeight: RongRTCConstant.ShareProfile_default.height,\n            chromeMediaSourceId: sourceId\n        },\n        optional: [\n            {googTemporalLayeredScreencast: true}\n        ]\n    };\n    sourceId = null;\n    return new Promise(function (resolve, reject) {\n        navigator.getUserMedia({video: constraints}, resolve, reject);\n    })\n}\n/**\n * 进行屏幕共享\n *\n */\nRongRTCEngine.prototype.screenShare = function (stream) {\n    this.screenSharingStatus = true;\n    this.screenOffer(stream);\n    RongRTCUtil.setMediaStream(this.selfUserId, stream);\n    this.rongRTCEngineEventHandle.call('onStartScreenShareComplete', {\n        'isSuccess': true\n    });\n}\n/**\n * 屏幕共享发offer\n *\n */\nRongRTCEngine.prototype.screenOffer = function (stream) {\n    var oldStream = this.localStream;\n    this.localStream = stream;\n    var pcClient = this.peerConnections[this.selfUserId];\n    if (pcClient != null) { // 只有一人时，值为null\n        var pc = pcClient['pc'];\n        if (this.screenSharingStatus) {\n            pc.addStream(this.localAudioStream);\n            this.minStream && pc.removeStream(this.localStreamMin);\n        } else {\n            pc.removeStream(this.localAudioStream);\n            this.minStream && pc.addStream(this.localStreamMin);\n        }\n        pc.removeStream(oldStream);\n        pc.addStream(stream);\n        RongRTCLogger.info(\"createOfferforShare\");\n        this.createOffer(pc, this.selfUserId, true);\n    }\n    oldStream.getTracks().forEach(function (track) {\n        track.stop()\n    });// 关闭\n    if (!this.localVideoEnable) {\n        this.closeLocalVideoWithUpdateTalkType(\n            !this.localVideoEnable, false);\n    }\n}\n/** ----- screenShare ---- */\n/** ----- 请求信令 ----- */\n// /**\n// * 请求logon信令\n// *\n// */\n// RongRTCEngine.prototype.logon = function() {\n// this.sendMsg(RongRTCConstant.SignalType.LOGON, this.token, {\n// 'version' : RongRTCConstant.LOGON_VERSION\n// });\n// }\n// /**\n// * 请求join信令\n// *\n// */\n// RongRTCEngine.prototype.join = function() {\n// this.sendMsg(RongRTCConstant.SignalType.JOIN, null, {\n// 'key' : this.channelId,\n// 'type' : this.userType\n// });\n// }\n/**\n * 请求logonAndJoin信令\n *\n */\nRongRTCEngine.prototype.logonAndJoin = function (status) {\n    this.logonAndJoinStatus = (status == null || status == undefined ? 0 : status);\n    this.offerStatus = null;\n    this.sendMsg(RongRTCConstant.SignalType.LOGONANDJOIN, this.token, {\n        'key': this.channelId,\n        'type': this.userType,\n        'index': this.localVideoEnable ? 1 : 0,\n        'status': this.logonAndJoinStatus,\n        'version': RongRTCConstant.LOGON_VERSION\n        // , 'mediaid': this.selfUserId // 只在融云RCE环境下开启\n    });\n}\n/**\n * 请求channelPing信令\n *\n */\nRongRTCEngine.prototype.channelPing = function () {\n    this.sendMsg(RongRTCConstant.SignalType.CHANNEL_PING, null, {\n        'key': this.channelId\n    });\n}\n/**@deprecated\n * 请求updateTalkType信令\n *\n */\nRongRTCEngine.prototype.updateTalkType = function () {\n    this.sendMsg(RongRTCConstant.SignalType.UPDATETALKTYPE, null, {\n        'key': this.channelId,\n        'index': this.localVideoEnable ? 1 : 0\n    });\n}\n/**\n * 摄像头开关闭通知服务端\n */\nRongRTCEngine.prototype.updateTalkTypeCamera = function (isClosed) {\n    var isUpdateTalkType = true;\n    if (this.userType == RongRTCConstant.UserType.OBSERVER) { // 观察者模式\n        isUpdateTalkType = false;\n    }\n    this.closeLocalVideoWithUpdateTalkType(isClosed, isUpdateTalkType);\n    this.sendMsg(RongRTCConstant.SignalType.TURNTALKTYPE, null, {\n        'key': this.channelId,\n        'index': this.localVideoEnable ? 1 : 2,\n        type: 1\n    });\n}\n/**\n * m麦克风开关闭通知服务端\n */\nRongRTCEngine.prototype.updateTalkTypeMic = function (isMute) {\n    this.localStream && this.localStream.getAudioTracks().forEach(function (track) {\n        track.enabled = !isMute;\n    })\n    this.localAudioStream && this.localAudioStream.getAudioTracks().forEach(function (track) {\n        track.enabled = !isMute;\n    })\n\n    RongRTCLogger.info(\"Microphone mute=\" + isMute);\n    this.microphoneEnable = !isMute;\n    this.sendMsg(RongRTCConstant.SignalType.TURNTALKTYPE, null, {\n        'key': this.channelId,\n        'index': this.microphoneEnable ? 1 : 2,\n        type: 2\n    });\n}\n/**\n * 请求leave信令\n *\n */\nRongRTCEngine.prototype.leave = function () {\n    this.sendMsg(RongRTCConstant.SignalType.LEAVE, null, {\n        'key': this.channelId\n    });\n}\n/**\n * 请求offer信令\n *\n */\nRongRTCEngine.prototype.offer = function (desc, from) {\n    this.sendMsg(RongRTCConstant.SignalType.EXCHANGE, desc, {\n        'key': this.channelId,\n        'type': RongRTCConstant.ExchangeType.OFFER,\n        'to': from\n    });\n}\n/**\n * 请求answer信令\n *\n */\nRongRTCEngine.prototype.answer = function (desc, from) {\n    this.sendMsg(RongRTCConstant.SignalType.EXCHANGE, desc, {\n        'key': this.channelId,\n        'type': RongRTCConstant.ExchangeType.ANSWER,\n        'to': from\n    });\n}\n/**\n * 请求candidate信令\n *\n */\nRongRTCEngine.prototype.candidate = function (candidate, userId) {\n    this.sendMsg(RongRTCConstant.SignalType.EXCHANGE, candidate, {\n        'key': this.channelId,\n        'type': RongRTCConstant.ExchangeType.CANDIDATE,\n        'to': userId\n    });\n}\n/**\n * 请求白板信令\n *\n */\nRongRTCEngine.prototype.ewb_create = function () {\n    this.sendMsg(RongRTCConstant.SignalType.EWB_CREATE, null, {\n        'key': this.channelId\n    });\n}\n/**\n * 查询白板信令\n *\n */\nRongRTCEngine.prototype.ewb_query = function () {\n    this.sendMsg(RongRTCConstant.SignalType.EWB_QUERY, null, {\n        'key': this.channelId\n    });\n}\n/**\n * 本地视频切换 大小流变化通知\n * @param candidate\n * @param userId\n */\nRongRTCEngine.prototype.flowSubscribe = function (msgBody) {\n    this.sendMsg(RongRTCConstant.SignalType.FLOWSUBSCRIBE, msgBody, {\n        'key': this.channelId\n    });\n}\n// ========= 会控 begin\nRongRTCEngine.prototype.changeMicPhone = function (isOpen, needSendMessage) {\n    this.localStream.getAudioTracks().forEach(function (track) {\n        track.enabled = isOpen;\n    })\n};\nRongRTCEngine.prototype.changeVideo = function (isOpen, needSendMessage) {\n    this.localStream.getVideoTracks().forEach(function (track) {\n        track.enabled = isOpen;\n    })\n};\n/**\n * 处理channelAnswer通知信令\n *\n */\nvar channelHandler = {\n\n    1: function (data) { // 邀请观察者发言同意后收到通知\n        console.error(data)\n        rongRTCengine.rongRTCEngineEventHandle.call(\"onBecomeUser\", {\n            userId: data.parameters.from,\n            userType: 1\n        });\n    },\n    2: function (data) {// 观察者主动要求发言 todo wenti\n        console.error(data)\n        var userId = data.parameters.serverData;\n        var status = data.parameters.status;\n        if (status == 1 && userId == rongRTCengine.selfUserId) {\n            console.error(\"fffffffffffffffffffffffff\")\n            rongRTCengine.rongRTCMeeting.observerBecomeUser(userId);\n        } else {\n            rongRTCengine.rongRTCEngineEventHandle.call(\"onBecomeUser\", {\n                userId: userId\n            });\n        }\n    },\n    3: function (data) { //邀请打开设备\n        rongRTCengine.rongRTCEngineEventHandle.call(\"onUserAgreeOpen\", {\n            userId: data.parameters.from,\n            type: data.parameters.type,\n            userType: 1,\n            status: data.parameters.status\n        });\n    },\n    4: function (data) { // 将与会人降级为观察者\n        rongRTCengine.remoteStreams = rongRTCengine.remoteStreams.filter(function (stream) {\n            return stream.id != data.parameters.from;\n        })\n        rongRTCengine.rongRTCEngineEventHandle.call(\"onUserDown\", {\n            userId: data.parameters.from,\n            userType: 1\n        });\n    },\n    5: function (data) { //邀请关闭设备\n        rongRTCengine.rongRTCEngineEventHandle.call(\"onUserLeft5\", {\n            userId: data.to,\n            userType: 1\n        });\n    },\n    other: function (data) {\n        console.warn(\"no handler to handle data\", data);\n    }\n}\n\nRongRTCEngine.prototype.closeStream = function (stream) {\n    stream ? stream.getTracks().forEach(function (track) {\n        track.stop();\n    }) : console.error(\" stream is not exist\")\n}\nRongRTCEngine.prototype.getPeerConnection = function (userId) {\n    var pcClient = this.peerConnections[userId];\n    var pc = pcClient['pc'];\n    if (!pc) {\n        throw  new Error(\"userId => peerConnection is not exist\", userId);\n    }\n    return pc;\n}\nvar RongRTCMeeting = function () {\n\n}\nRongRTCMeeting.prototype.turntalktype = function (data) {\n    var type = data.parameters.type;\n    var index = data.parameters.index;\n    var userId = data.parameters.serverData;\n    var remoteStream = rongRTCengine.getRemoteStream(userId);\n    if (index == 1 && type == 1) {\n        remoteStream.getVideoTracks().forEach(function (track) {\n            track.enabled = true;\n        })\n\n    }\n    rongRTCengine.rongRTCEngineEventHandle.call(\"onTurnTalkType\", {\n        userId: data.parameters.serverData,\n        type: type,\n        open: index == 1 ? true : false\n    });\n}\nRongRTCMeeting.prototype.channelAnswer = function (data) {\n    var type = data.parameters['index'] || \"other\";\n    ;\n    var handler = channelHandler[type];\n    handler(data);\n\n};\nvar applyHandler = {\n\n    1: function (data) { //收到观察者主动要求发言\n        var requestUserId = data.parameters.from\n        rongRTCengine.rongRTCEngineEventHandle.call(\"OnReciveRequestToUser\", {\n            userId: requestUserId\n        });\n    },\n    2: function (data) { //获取主持人权限响应\n        rongRTCengine.rongRTCEngineEventHandle.call(\"OnOtherUserBecomeHost\", {\n            hostId: data.parameters.from\n        });\n    },\n    other: function (data) {\n        console.warn(\"no handler to handle data\", data);\n    }\n}\n/**\n * 处理apply通知信令\n *\n */\n\nRongRTCMeeting.prototype.applyMessage = function (data) {\n    var type = data.parameters['index'];\n    var to = data.parameters.to;\n    var handler = applyHandler[type];\n    handler(data);\n\n};\n/**\n * 处理roleChange通知信令\n *\n */\n\nRongRTCMeeting.prototype.roleChange = function (data) {\n    var type = data.parameters['index'];\n    var to = data.parameters.to;\n    if (type == RongRTCConstant.Meeting.RoleChange.DEMOTION) { // 将与会人降级为观察者\n        this.noramlUserDoHostRequestDegradeNormalUserToObserver(to, true);\n    }\n    else if (type == RongRTCConstant.Meeting.RoleChange.INVITE) { // 邀请观察者发言\n        rongRTCengine.rongRTCEngineEventHandle.call(\"onBeRequestToUser\", {\n            hostId: data.parameters.to\n        });// 说明：被邀请观察者收到邀请通知\n\n    }\n    else if (type == RongRTCConstant.Meeting.RoleChange.REMOVE) { //移除与会人员\n        if (to == rongRTCengine.selfUserId) {\n            rongRTCengine.rongRTCEngineEventHandle.call(\"onHostRemoved\", {\n                userId: to\n            });// 说明：当被操作用户被踢出房间时，被操作用户会收到此通知\n        }\n    }\n};\n/**\n 函数名：ObserverRequestBecomeNormalUser\n 参数：\n 返回值：\n 说明：观察者请求成为正常人员，只有用户为观察身份时，此接口才有效\n */\nRongRTCMeeting.prototype.observerRequestBecomeNormalUser = function () {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.APPLY, null, {\n        'key': rongRTCengine.channelId,\n        'index': 0x01\n    });\n};\n/**\n 函数名：HostDoObserverRequestBecomeNormalUser\n 参数：strUserId，请求者ID，enumEngineOperationType，主持人回复请求类型\n 返回值：\n 说明：当观察者请求发言，主持人通过该接口处理，接受，拒绝，或者忙碌\n */\nRongRTCMeeting.prototype.hostDoObserverRequestBecomeNormalUser = function (userId, isAccept) {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.CHANNELANSWER, null, {\n        'key': rongRTCengine.channelId,\n        'to': userId,\n        'index': 0x02,\n        'status': isAccept\n    });\n}\n\n/**\n * 函数名：HostRequestDegradeNormalUserToObserver\n * 参数：strUserId，被操作人员的用户ID\n * 返回值：\n * 说明：主持人请求将正常用户降级为观察者\n */\nRongRTCMeeting.prototype.hostRequestNormalUserToObserver = function (userId) {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.ROLECHANGE, null, {\n        'key': rongRTCengine.channelId,\n        'to': userId,\n        'index': 0x01\n    });\n}\n\n/**\n 函数名：NoramlUserDoHostRequestDegradeNormalUserToObserver\n 参数：strHostId，主持人的用户ID，bAccept，接受请求还是拒绝\n 返回值：\n 说明：被请求降级的用户处理主持人的降级请求 //todo 观察者模式加入\n */\nRongRTCMeeting.prototype.noramlUserDoHostRequestDegradeNormalUserToObserver = function (userId, bAccept) {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.CHANNELANSWER, null, {\n        'key': rongRTCengine.channelId,\n        'to': userId,\n        'index': 0x04,\n        'status': 0x01\n    });\n    rongRTCengine.closeStream(rongRTCengine.localStream);\n    var pc = rongRTCengine.getPeerConnection(rongRTCengine.selfUserId);\n    pc.removeStream(rongRTCengine.localStream);\n\n    rongRTCengine.createOffer(pc, rongRTCengine.selfUserId, false);\n    rongRTCengine.rongRTCEngineEventHandle.call(\"onUserDown\", {\n        userId: userId\n    });\n\n}\nvar deviceControl = {\n    1: function (isOpen) { //摄像头\n        rongRTCengine.changeVideo(isOpen);\n    },\n    2: function (isOpen) {//麦克风\n        rongRTCengine.changeMicPhone(isOpen);\n    }\n}\n/**\n 函数名：UserDoHostRequestControlUserDevice\n 参数：strHostId，主持人的用户ID，enumControlAction，操作类型，关闭或者打开，enumControlMediaType，操作的媒体类型，bAccept，是否同意打开音、视频或者音视频\n 返回值：\n 说明：用户通过该接口处理主持人打开或关闭音视频的开关进行请求或者观察者处理主持人邀请发言\n */\nRongRTCMeeting.prototype.userDoHostRequestControlUserDevice = function (hostId, isOpen, type, accept) {\n    var index = isOpen ? 0x03 : 0x05;\n    var type = type;\n    var handler = deviceControl[type];\n    handler(isOpen);\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.CHANNELANSWER, null, {\n        'key': rongRTCengine.channelId,\n        'to': hostId,\n        'index': index,\n        'type': type,\n        'status': accept\n    });\n};\n/**\n 函数名：HostRequestUpgradeObserverToNormalUser\n 参数：strUserId，被操作观察者的用户ID\n 返回值：\n 说明：主持人请求观察者升级为正常用户\n */\nRongRTCMeeting.prototype.hostUpUser = function (userId) {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.ROLECHANGE, null, {\n        'key': rongRTCengine.channelId,\n        'to': userId,\n        'index': 0x02\n    });\n};\nRongRTCMeeting.prototype.observerBecomeUser = function (userId) {\n    var rongRTCEnv=rongRTCengine;\n    rongRTCengine.getLocalStreamFromRtcApi(rongRTCengine.mediaConfig).then(function (stream) {\n        rongRTCengine.localStream = stream;\n        var peerConnection = rongRTCengine.getPeerConnection(rongRTCengine.selfUserId);\n        peerConnection.addStream(stream);\n        rongRTCengine.createOffer(peerConnection, rongRTCengine.selfUserId, false);\n        RongRTCUtil.refreshMediaStream(rongRTCengine.selfUserId);\n        rongRTCengine.rongRTCEngineEventHandle.call('onBecomeUser', {\n            userId: rongRTCengine.selfUserId,\n            stream: rongRTCengine.localStream\n        });\n\n        // talktype[0:无视频有音频, 1:有视频有音频, 2:有视频无音频, 3:无视频无音频]\n\n        var talkType;\n        if (!rongRTCEnv.localVideoEnable && rongRTCEnv.microphoneEnable)\n            talkType = 0;\n        else if (rongRTCEnv.localVideoEnable && rongRTCEnv.microphoneEnable)\n            talkType =1;\n        else  if(rongRTCEnv.localVideoEnable && !rongRTCEnv.microphoneEnable)\n            talkType =2;\n        else\n            talkType=3;;\n            rongRTCengine.localVideoEnable = true\n        rongRTCengine.microphoneEnable = true;\n        rongRTCengine.rongRTCEngineEventHandle.call('onaddstream', {\n            userId: rongRTCengine.selfUserId,\n            stream: rongRTCengine.localStream,\n            userType: RongRTCConstant.UserType.NORMAL,\n            talkType: 1,//升级后音视频默认都开\n            isLocal: false\n\n        });\n    });\n}\n/**\n 函数名：ObserverDoHostRequestUpgradeObserverToNormalUser\n 参数：strUserId，主持人的用户ID，bAccept，是否同意升级为正常用户，打开音视频\n 返回值：\n 说明：观察者处理主持人邀请发言 或者死自己主动调用加入\n */\nRongRTCMeeting.prototype.doHostRequestToUser = function (hostId, bAccept) {\n    var status = bAccept == 1 ? 0x01 : bAccept == 2 ? 0x02 : 0x02;\n\n    if (status == 0x01) {\n        this.observerBecomeUser(this.selfUserId);\n    }\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.CHANNELANSWER, null, {\n        'key': rongRTCengine.channelId,\n        'to': hostId,\n        'index': 0x01,\n        'status': status\n    });\n}\n/**\n 函数名：HostReomveUser\n 参数：strUserId，被操作人员的用户ID\n 返回值：\n 说明：主持人将用户踢出房间\n */\nRongRTCMeeting.prototype.hostRemoveUser = function (userId) {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.ROLECHANGE, null, {\n        'key': rongRTCengine.channelId,\n        'to': userId,\n        'index': 0x03\n    });\n};\n/**\n 函数名：HostReomveUser\n 参数：strUserId，被操作人员的用户ID\n 返回值：\n 说明：主持人将用户踢出房间\n */\nRongRTCMeeting.prototype.screenShare = function (isopen) {\n    var isopen = isopen == true ? 0x01 : 0x02;\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.SCREENSHARING, null, {\n        'key': rongRTCengine.channelId,\n        'index': isopen\n    });\n};\nvar manageActionHandler = {\n    1: function (data) { //收到邀请打开\n        rongRTCengine.rongRTCEngineEventHandle.call(\"OnHostRequestControlDevice\", {\n            userId: data.parameters.to,\n            content: data.parameters\n        });\n    },\n    2: function (data) { //收到邀请打开\n        rongRTCengine.rongRTCEngineEventHandle.call(\"OnHostRequestControlDevice\", {\n\n            userId: data.parameters.to,\n            content: data.parameters\n        });\n    },\n    other: function (data) {\n        console.warn(\"no handler to handle data\", data);\n    }\n}\n/**\n * 处理apply通知信令\n *\n */\n\nRongRTCMeeting.prototype.manageAction = function (data) {\n    var type = data.parameters['index'];\n    var to = data.parameters.to;\n    var handler = manageActionHandler[type];\n    handler(data);\n\n};\n/**\n * 函数名：hostRequestControlUserDevice\n * 参数：userId，被操作人员的用户ID\n * 返回值：0x01：邀请打开\n 0x02：邀请关闭\n type\n 0x01：摄像头\n 0x02：麦克风\n 0x03：摄像头+麦克风\n * 说明：主持人通过该接口对与会人员音视频的开关进行管理\n */\nRongRTCMeeting.prototype.hostRequestControlUserDevice = function (userId, type, closeOrOpen) {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.MANAGEACTION, null, {\n        'key': rongRTCengine.channelId,\n        'to': userId,\n        'index': closeOrOpen,\n        'type': type\n    });\n}\n/**\n 函数名：GetHostPower\n 参数：\n 返回值：\n 说明：获取主持人权限\n */\nRongRTCMeeting.prototype.getHostPower = function () {\n    rongRTCengine.sendMsg(RongRTCConstant.SignalType.APPLY, null, {\n        'key': rongRTCengine.channelId,\n        'index': 0x02\n    });\n}\n/**\n 函数名：GetInviteUrl\n 参数：\n 返回值：\n 说明：获取邀请链接 todo 未完成\n */\nRongRTCMeeting.prototype.GetInviteUrl = function () {\n\n};\n// ========= 会控 end\n\n//======屏幕共享 begin\n/**\n * 当前浏览器\n */\nRongRTCEngine.prototype.myBrowser = function () {\n    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串\n    var isOpera = userAgent.indexOf(\"Opera\") > -1;\n    if (isOpera) {\n        return \"Opera\"\n    }\n    ; //判断是否Opera浏览器\n    if (userAgent.indexOf(\"Firefox\") > -1) {\n        return \"FF\";\n    } //判断是否Firefox浏览器\n    if (userAgent.indexOf(\"Chrome\") > -1) {\n        return \"Chrome\";\n    }\n    if (userAgent.indexOf(\"Safari\") > -1) {\n        return \"Safari\";\n    } //判断是否Safari浏览器\n    if (userAgent.indexOf(\"compatible\") > -1 && userAgent.indexOf(\"MSIE\") > -1 && !isOpera) {\n        return \"IE\";\n    }\n    ; //判断是否IE浏览器\n\n}\n/**\n *rce electron 直接可以获取屏幕流 不安装插件\n */\nRongRTCEngine.prototype.shareWithStream = function (videoStream) { //todo bug 加入前根据麦克风状态静音\n    this.rongRTCMeeting.screenShare(true);\n    rongRTCengine.getLocalStreamFromRtcApi({video: false, audio: true}).then(function (stream) {\n        rongRTCengine.localAudioStream = stream;\n        stream.getAudioTracks().forEach(function (track) {\n            track.enabled = rongRTCengine.microphoneEnable;\n        });\n        videoStream.getVideoTracks()[0].onended = function () {\n            rongRTCengine.endShareScreen();\n        };\n       rongRTCengine.screenSharingStatus = true;\n        rongRTCengine.screenOffer(videoStream);\n    }).catch(function (err) {\n        RongRTCLogger.error(err);\n    });\n\n}\n\n\n//======= end\n/** ----- 请求信令 ----- */\n/** ----- 处理应答信令 ----- */\n/**\n * 处理join_result应答信令\n *\n */\nRongRTCEngine.prototype.logonAndJoin_result = function (data) {\n    var statusCode = data.parameters['statusCode'];\n    var isJoined = statusCode == 'OK' ? true : false;\n    if (isJoined) {\n        var content = data.content; // 返回的结果是包含自己的\n        var contentArr = content.split(\"],\");\n        var member = contentArr.length > 1 ? contentArr[1] : contentArr[0];\n        var memberArr = eval(member);\n        for (var i in memberArr) {\n            var userId = memberArr[i].userId;\n            if (!this.joinedUsers.contains(userId)) {\n                var userType = memberArr[i].type;\n                var talkType = memberArr[i].talktype;\n                var joinedUser = new Array();\n                joinedUser.push(userType);\n                joinedUser.push(talkType);\n                joinedUser.push(null);\n                this.joinedUsers.put(userId, joinedUser);\n                //if (userId != this.selfUserId) {\n                //    this.rongRTCEngineEventHandle.call('onUserJoined', { // 观\n                //        userId: userId,\n                //        userType: userType,\n                //        talkType: talkType\n                //    });\n                //}\n\n            }\n\n        }\n        // 开始keepAlive\n        this.startScheduleKeepAlive();\n        if (this.logonAndJoinStatus == RongRTCConstant.LogonAndJoinStatus.RECONNECT) { // 断线重连，主动发offer\n            var pcClient = this.peerConnections[this.selfUserId];\n            if (pcClient != null) { // 只有一人时，值为null\n                var pc = pcClient['pc'];\n                RongRTCLogger.warn(\"reLogonAndJoin createOffer\");\n                this.createOffer(pc, this.selfUserId, true);\n            }\n        }\n    }\n    var joinedUser = this.joinedUsers.get(this.selfUserId);\n    var talkType = 1;\n    if (this.logonAndJoinStatus == RongRTCConstant.LogonAndJoinStatus.CONNECT // 正常加入\n        || (this.logonAndJoinStatus == RongRTCConstant.LogonAndJoinStatus.RECONNECT && !isJoined ) // 重连加入且加入失败\n        || !this.onJoinComplete\n    ) {\n        this.rongRTCEngineEventHandle.call('onJoinComplete', {\n            'isJoined': isJoined,\n            'userId': this.selfUserId,\n            talkType:talkType\n        });\n        this.onJoinComplete = true;\n    }\n}\n/**\n * 处理channelPing_result应答信令\n *\n */\nRongRTCEngine.prototype.channelPing_result = function (data) {\n    // 收到result，停止计时\n    this.exitScheduleKeepAliveTimer();\n\n    var statusCode = data.parameters['statusCode'];\n    var isOK = statusCode == 'OK' ? true : false;\n    if (!isOK) {\n        this.keepAliveFailed();\n    } else {\n        // 重置keepAliveFailedTimes\n        this.keepAliveFailedTimes = 0;\n    }\n}\n/**\n * 处理leave_result应答信令\n *\n */\nRongRTCEngine.prototype.leave_result = function (data) {\n    var statusCode = data.parameters['statusCode'];\n    var isLeft = statusCode == 'OK' ? true : false;\n    if (isLeft) {\n        this.clear();\n    }\n    this.rongRTCEngineEventHandle.call('onLeaveComplete', {\n        'isLeft': isLeft\n    });\n}\n/**\n * 处理ewb_create_result应答信令\n *\n */\nRongRTCEngine.prototype.ewb_create_result = function (data) {\n    var statusCode = data.parameters['statusCode'];\n    var isSuccess = statusCode == 'OK' ? true : false;\n    var url = '';\n    if (isSuccess) {\n        url = data.content;\n    }\n    this.rongRTCEngineEventHandle.call('onWhiteBoardURL', {\n        'isSuccess': isSuccess,\n        'url': url // 观察者模式url返回为空\n    });\n}\n/**\n * 处理ewb_query_result应答信令\n *\n */\nRongRTCEngine.prototype.ewb_query_result = function (data) {\n    var statusCode = data.parameters['statusCode'];\n    var isSuccess = statusCode == 'OK' ? true : false;\n    var url = '';\n    if (isSuccess) {\n        url = data.content;\n        url ? this.ewbCreated = true : void 0;\n    }\n    this.rongRTCEngineEventHandle.call('onWhiteBoardQuery', {\n        'isSuccess': isSuccess,\n        'url': url // 当前会议没有白板url返回为空\n    });\n}\n/** ----- 处理应答信令 ----- */\n/** ----- 处理通知信令 ----- */\n/**\n * 处理joined通知信令\n *\n */\nRongRTCEngine.prototype.joined = function (data) {\n    var userId = data.parameters['serverData'];\n    var userType = data.parameters['type'];\n    var talkType = data.parameters['index'];\n    if (!this.joinedUsers.contains(userId)) {\n        var joinedUser = new Array();\n        joinedUser.push(userType);\n        joinedUser.push(talkType);\n        joinedUser.push(null);\n        this.joinedUsers.put(userId, joinedUser);\n    }\n    //if (userType == RongRTCConstant.UserType.OBSERVER) {\n    this.rongRTCEngineEventHandle.call('onUserJoined', { // 观察者模式\n        userId: userId,\n        userType: userType,\n        talkType: talkType\n    });\n    //}\n}\n/** @deprecated\n * 处理update_talktype通知信令\n *\n */\nRongRTCEngine.prototype.update_talktype = function (data) {\n    var userId = data.parameters['serverData'];\n    var userType = data.parameters['type'];\n    var talkType = data.parameters['index'];\n    this.rongRTCEngineEventHandle.call('onUserUpdatedTalkType', {\n        userId: userId,\n        userType: userType,\n        talkType: talkType\n    });\n};\n/**\n * 请求本地设备开关\n *\n */\nRongRTCEngine.prototype.turnTalkType = function (serverData, index, type) {\n    this.sendMsg(RongRTCConstant.SignalType.TURNTALKTYPE, null, {\n        'key': this.channelId,\n        'serverdata': serverData,\n        'index': index,\n        'type': type\n\n    });\n}\n/**\n * 处理left通知信令\n *\n */\nRongRTCEngine.prototype.left = function (data) {\n    var userId = data.parameters['serverData'];\n    var userType = data.parameters['type'];\n    this.joinedUsers.remove(userId);\n    this.remoteCnameMap.remove(userId);\n    this.remoteSdpMap.remove(userId);\n    this.remoteStreams = this.remoteStreams.filter(function (stream) {\n        return stream.id != userId;\n    })\n    if (this.joinedUsers.size() == 1) { // 当没有其它用户在会议时\n        // 重置offerStatus状态\n        this.offerStatus = null;\n        // 关闭连接\n        this.closePeerConnection(this.selfUserId);\n    }\n    this.rongRTCEngineEventHandle.call('onUserLeft', {\n        userId: userId,\n        userType: userType\n    });\n}\n/**\n * 建立连接\n *\n */\nRongRTCEngine.prototype.preparePeerConnection = function (userId) {\n    RongRTCLogger.info(\"preparePeerConnection userId=\" + userId);\n    var rongRTCEngine = this;\n    if (rongRTCEngine.peerConnections[userId] == null) {\n        var pc = new RTCPeerConnection();\n        var pcMin = new RTCPeerConnection();\n        pc.onaddstream = function (evt) {\n            window.RongOtherEvt = evt;\n            RongRTCLogger.debug(\"onaddstream\", evt);\n\n            rongRTCEngine.remoteStreams.push(evt.stream);\n            var joinedUser = rongRTCEngine.joinedUsers.get(evt.stream.id);\n            joinedUser.splice(2, 1, evt.stream);\n            var talkType = joinedUser[1];\n            console.log(\"talkType\", talkType);\n            if (talkType == 0 || talkType == 3) {\n                console.log(\"remove Video track\", talkType);\n                evt.stream.getVideoTracks().forEach(function (track) {\n                    track.enabled = false;\n                })\n            }\n            rongRTCEngine.rongRTCEngineEventHandle.call('onaddstream', { //\n                userId: evt.stream.id,\n                userType: RongRTCConstant.UserType.NORMAL,\n                talkType: talkType,\n                stream: evt.stream,\n                isLocal: false\n\n            });\n        };\n\n        pc.onremovestream = function (evt) {\n            RongRTCLogger.debug(\"onremovestream\", evt);\n        };\n\n        pc.ontrack = null;\n\n        pc.onsignalingstatechange = function (evt) {\n            RongRTCLogger.debug(\"onsignalingstatechange\", evt);\n        };\n\n        pc.oniceconnectionstatechange = function (evt) {\n            RongRTCLogger.debug(\"oniceconnectionstatechange\", evt);\n            RongRTCLogger.warn(\"pc.iceConnectionState=\" + pc.iceConnectionState);\n\n            if (pc.iceConnectionState == 'failed') {\n                if (rongRTCEngine.wsConnectionState == RongRTCConstant.wsConnectionState.CONNECTED) { // ws连接可用\n                    RongRTCLogger.warn(\"oniceconnectionstatechange createOffer\");\n                    rongRTCEngine.createOffer(pc, userId, true);\n                }\n            }\n        };\n\n        pc.onnegotiationneeded = null;\n        pc.ondatachannel = null;\n\n        pc.onicecandidate = function (evt) {\n            RongRTCLogger.debug(\"onicecandidate\", evt);\n\n            handle(pc, evt);\n\n            function handle(pc, evt) {\n                if ((pc.signalingState || pc.readyState) == 'stable'\n                    && rongRTCEngine.peerConnections[userId]['rem'] == true) {\n                    if (evt.candidate) {\n                        rongRTCEngine.candidate(JSON.stringify(evt.candidate),\n                            userId);\n                    }\n                    return;\n                }\n                setTimeout(function () {\n                    handle(pc, evt);\n                }, 2 * 1000);\n            }\n        };\n        rongRTCEngine.peerConnections[userId] = {}\n        rongRTCEngine.peerConnections[userId]['pc'] = pc;\n        rongRTCEngine.peerConnections[userId]['pcMin'] = pcMin;\n        rongRTCEngine.peerConnections[userId]['rem'] = false;\n\n        // peerConnection创建成功，开始getStatsReport\n        rongRTCEngine.startScheduleGetStatsReport();\n    }\n    return rongRTCEngine.peerConnections[userId];\n};\n/**\n * 关闭连接\n *\n */\nRongRTCEngine.prototype.closePeerConnection = function (userId) {\n    if (this.peerConnections[userId] != null) {\n        this.peerConnections[userId]['pc'].close();\n        this.peerConnections[userId] = null;\n    }\n    // 重置带宽设置计数器\n    RongRTCGlobal.bandWidthCount = 0;\n    // peerConnection关闭，停止getStatsReport\n    this.exitScheduleGetStatsReport();\n}\n/**\n * 处理OfferRequest通知信令\n *\n */\nRongRTCEngine.prototype.offerRequest = function (data) {\n    var from = data.parameters['serverData'];\n\n    var pcClient = this.preparePeerConnection(from);\n    var pc = pcClient['pc'];\n    if (this.userType == RongRTCConstant.UserType.NORMAL) {\n        pc.addStream(this.localStream);\n        rongRTCengine.screenSharingStatus && pc.addStream(this.localAudioStream);//未有人加入时开启共享\n\n    }\n    if (data.parameters.type && data.parameters.type == '2' && this.userType == RongRTCConstant.UserType.NORMAL) {\n       /* pc.addStream(rongRTCEngine.localStreamMin);\n        this.minStream = true;*/\n    }\n    RongRTCLogger.warn(\"offerRequest createOffer\");\n    this.createOffer(pc, from, false);\n};\n/**\n * 处理exchange通知信令\n *\n */\nRongRTCEngine.prototype.exchange = function (data) {\n    var type = data.parameters['type'];\n    if (type == RongRTCConstant.ExchangeType.OFFER) {\n        this.handleOffer(data);\n    } else if (type == RongRTCConstant.ExchangeType.ANSWER) {\n        this.handleAnswer(data);\n    } else if (type == RongRTCConstant.ExchangeType.CANDIDATE) {\n        this.handleCandidate(data);\n    }\n};\n/**\n * 处理白板创建通知信令\n *\n */\nRongRTCEngine.prototype.ewbCreateNotify = function (data) {\n    this.ewbCreated = true;\n};\n/**\n * handle offer\n *\n */\nRongRTCEngine.prototype.handleOffer = function (data) {\n    if (this.offerStatus == RongRTCConstant.OfferStatus.SENDING) {\n        RongRTCLogger.warn(\"handleOffer offerStatus sending\");\n        return;\n    }\n\n    var from = data.parameters['from'];\n    var desc = JSON.parse(data.content.replace(new RegExp('\\'', 'g'), '\"'));\n    // set bandwidth\n    desc.sdp = RongRTCUtil.setBandWidth(desc.sdp, this.getBandWidth());\n\n    var pcClient = this.preparePeerConnection(from);\n    var pc = pcClient['pc'];\n    if (this.userType == RongRTCConstant.UserType.NORMAL) {\n        pc.addStream(this.localStream);\n    }\n    var rongRTCEngine = this;\n    pc.setRemoteDescription(new RTCSessionDescription(desc), function () {\n        RongRTCLogger.info(\"handleOffer setRemoteDescription success\");\n        rongRTCEngine.offerStatus = RongRTCConstant.OfferStatus.DONE;\n        // set remote cname map\n        rongRTCEngine.setRemoteCnameMap(desc.sdp);\n        pcClient['rem'] = true;\n        pc.createAnswer(function (desc2) {\n            RongRTCLogger.info(\"createAnswer success\");\n            pc.setLocalDescription(desc2, function () {\n                RongRTCLogger.info(\"createAnswer setLocalDescription success\");\n                rongRTCEngine.answer(JSON.stringify(desc2), from);\n            }, function (error) {\n                RongRTCLogger.error(\"createAnswer setLocalDescription error: \", error);\n            });\n        }, function (error) {\n            RongRTCLogger.error(\"createAnswer error: \", error);\n        }, rongRTCEngine.getSdpMediaConstraints(false));\n    }, function (error) {\n        RongRTCLogger.error(\"handleOffer setRemoteDescription error: \", error);\n    });\n};\n/**\n * handle answer\n *\n */\nRongRTCEngine.prototype.handleAnswer = function (data) {\n    if (this.offerStatus == RongRTCConstant.OfferStatus.DONE) { // 已经设置过一次SDP，放弃本次设置\n        RongRTCLogger.warn(\"handleAnswer offerStatus done\");\n        return;\n    }\n\n    var from = data.parameters['from'];\n    var desc = JSON.parse(data.content.replace(new RegExp('\\'', 'g'), '\"'));\n    var pcClient = this.preparePeerConnection(from);\n    var pc;\n    // if (desc.type==\"tinyStreamAnswer\") {\n    //     desc.type = \"answer\";\n    //     pc = pcClient['pcMin'];\n    // }else {\n    pc = pcClient['pc'];\n    // }\n    // set bandwidth\n    desc.sdp = RongRTCUtil.setBandWidth(desc.sdp, this.getBandWidth());\n\n\n    var rongRTCEngine = this;\n    pc.setRemoteDescription(new RTCSessionDescription(desc), function () {\n        RongRTCLogger.info(\"handleAnswer setRemoteDescription success\");\n        rongRTCEngine.offerStatus = RongRTCConstant.OfferStatus.DONE;\n        // set remote cname map\n        rongRTCEngine.setRemoteCnameMap(desc.sdp);\n        pcClient['rem'] = true;\n    }, function (error) {\n        RongRTCLogger.error(\"handleAnswer setRemoteDescription error: \", error);\n    });\n};\n/**\n * handle candidate\n *\n */\nRongRTCEngine.prototype.handleCandidate = function (data) {\n    var from = data.parameters['from'];\n    var desc = JSON.parse(data.content.replace(new RegExp('\\'', 'g'), '\"'))\n\n    var pcClient = this.preparePeerConnection(from);\n    var pc = pcClient['pc'];\n    pc.addIceCandidate(new RTCIceCandidate(desc), function () {\n        RongRTCLogger.info(\"addIceCandidate success\");\n    }, function (error) {\n        RongRTCLogger.error(\"addIceCandidate error: \", error);\n    });\n}\n/**\n * create offer\n *\n */\nRongRTCEngine.prototype.createOffer = function (pc, userId, isIceRestart) {\n    if (this.offerStatus == RongRTCConstant.OfferStatus.SENDING) { // 已经创建过Offer，本次不创建\n        RongRTCLogger.warn(\"createOffer offerStatus sending\");\n        return;\n    }\n    RongRTCLogger.info(\"createOffer userId=\" + userId);\n    var rongRTCEngine = this;\n    pc.createOffer(function (desc) {\n        RongRTCLogger.info(\"createOffer success\");\n        // change streamId use userId\n        desc.sdp = RongRTCUtil.changeStreamId(desc.sdp,\n            rongRTCEngine.localStream.id, rongRTCEngine.selfUserId);\n        if (rongRTCEngine.minStream && !rongRTCEngine.screenSharingStatus) {\n            desc.sdp = RongRTCUtil.changeStreamId(desc.sdp,\n                rongRTCEngine.localStreamMin.id, rongRTCEngine.selfUserId + '_tiny');\n        }\n        // change streamId use userId\n        if (rongRTCEngine.screenSharingStatus  && rongRTCengine.localAudioStream) {\n            desc.sdp = RongRTCUtil.changeStreamId(desc.sdp,\n                rongRTCEngine.localAudioStream.id, rongRTCEngine.selfUserId);\n        }\n\n        // 替换video参数\n        desc.sdp = RongRTCUtil.changeVideoDesc(desc.sdp);\n        pc.setLocalDescription(desc, function () {\n            RongRTCLogger.info(\"createOffer setLocalDescription success\");\n            rongRTCEngine.offerStatus = RongRTCConstant.OfferStatus.SENDING;\n            rongRTCEngine.offer(JSON.stringify(desc), userId);\n        }, function (error) {\n            RongRTCLogger.error(\"createOffer setLocalDescription error: \", error);\n        });\n    }, function (error) {\n        RongRTCLogger.error(\"createOffer error: \", error);\n    }, rongRTCEngine.getSdpMediaConstraints(isIceRestart));\n\n\n    /*    var pcMin=rongRTCEngine.peerConnections[userId]['pcMin']\n        pcMin.addStream(rongRTCEngine.localStreamMin);\n        pcMin.createOffer(function (desc) {\n            RongRTCLogger.info(\"createOfferMin success\");\n            // change streamId use userId\n            desc.sdp = RongRTCUtil.changeStreamId(desc.sdp,\n                rongRTCEngine.localStreamMin.id, rongRTCEngine.selfUserId+\"_tiny\");\n            // 替换video参数\n            desc.sdp = RongRTCUtil.changeVideoDesc(desc.sdp);\n            pcMin.setLocalDescription(desc, function() {\n                RongRTCLogger.info(\"createpcMinOffer setLocalDescription success\");\n                rongRTCEngine.offerStatus = RongRTCConstant.OfferStatus.SENDING;\n                rongRTCEngine.offer(JSON.stringify(desc).replace(/offer/, \"tinyStreamOffer\"), userId);\n            }, function(error) {\n                RongRTCLogger.error(\"createpcMinOffer setLocalDescription error: \", error);\n            });\n\n        }, function(error) {\n            RongRTCLogger.error(\"createOfferMin  error: \", error);\n        })*/\n}\n/**\n * 设置sdp属性\n *\n */\nRongRTCEngine.prototype.getSdpMediaConstraints = function (isIceRestart) {\n//\tif (this.userType == RongRTCConstant.UserType.OBSERVER) { // 观察者模式\n//\t\tif (this.mediaConfig.sdpConstraints == null) {\n//\t\t\tthis.mediaConfig.sdpConstraints = {};\n//\t\t}\n//\t\tif (this.mediaConfig.sdpConstraints.mandatory == null) {\n//\t\t\tthis.mediaConfig.sdpConstraints.mandatory = {};\n//\t\t}\n//\t\tthis.mediaConfig.sdpConstraints.mandatory.OfferToReceiveAudio = true;\n//\t\tthis.mediaConfig.sdpConstraints.mandatory.OfferToReceiveVideo = true;\n//\t}\n\n    var sdpMediaConstraints = {};\n    sdpMediaConstraints.mandatory = {};\n    // 统一设置，包含观察者模式和普通模式无摄像头情况\n    sdpMediaConstraints.mandatory.OfferToReceiveAudio = true;\n    sdpMediaConstraints.mandatory.OfferToReceiveVideo = true;\n    // IceRestart\n    RongRTCLogger.warn(\"isIceRestart=\" + isIceRestart);\n    sdpMediaConstraints.mandatory.IceRestart = isIceRestart;\n    return sdpMediaConstraints;\n}\n/**\n * 设置remote cname map\n *\n */\nRongRTCEngine.prototype.setRemoteCnameMap = function (sdp) {\n    var userArr = this.joinedUsers.getEntrys();\n    for (var i in userArr) {\n        var userId = userArr[i].key;\n        if (userId == this.selfUserId) { // 不是远端\n            continue;\n        }\n        if (!this.remoteCnameMap.contains(userId)) {\n            var cname = RongRTCUtil.getCname(sdp, userId);\n            if (cname != null && cname != \"\") {\n                this.remoteCnameMap.put(userId, cname);\n                this.remoteSdpMap.put(userId, sdp);\n            }\n        } else {\n            var cname = this.remoteCnameMap.get(userId);\n            if (cname != null && cname != \"\"\n                && !RongRTCUtil.isHasCname(sdp, cname)) {\n                var newCname = RongRTCUtil.getCname(sdp, userId);\n                if (newCname != null && newCname != \"\") {\n                    this.remoteCnameMap.put(userId, newCname);\n                    RongRTCUtil.refreshMediaStream(userId);// 屏幕共享cname不变\n                    // userId不变，cname变化，视为客户端杀进程后重连，刷新远端视频流\n                }\n            } else if (cname != null && cname != \"\"\n                && RongRTCUtil.isHasCname(sdp, cname)) {\n                var newCname = RongRTCUtil.getCname(sdp, userId);\n                if (cname == newCname) {\n                    var oldSdp = this.remoteSdpMap.get(userId);\n                    var ts = RongRTCUtil.getSsrc(oldSdp, userId, cname);\n                    var newTs = RongRTCUtil.getSsrc(sdp, userId, cname);\n                    if (ts != newTs)\n                        RongRTCUtil.refreshMediaStream(userId)\n\n                }\n            }\n\n        }\n    }\n}\n/**\n * 获取带宽\n * \n */\nRongRTCEngine.prototype.getBandWidth = function () {\n\tif (this.screenSharingStatus) { // 正在屏幕共享\n\t\treturn RongRTCConstant.BandWidth_ScreenShare_1280_720;\n\t}\n\treturn this.bandWidth;\n}\n/** ----- 处理通知信令 ----- */\n//\n// return RongRTCEngine;\n// });\n/** ----- RongRTCEngine ----- */\n\n/** ----- RongRTCEngineEventHandle ----- */\n// var RongRTCEngineEventHandle = (function() {\n/**\n * 构造函数\n *\n */\nvar RongRTCEngineEventHandle = function (config) {\n    /** 事件集合 */\n    this.eventHandles = {};\n    return this;\n}\n/**\n * 绑定事件\n *\n */\nRongRTCEngineEventHandle.prototype.on = function (eventName, event) {\n    this.eventHandles[eventName] = event;\n};\n/**\n * 调用事件\n *\n */\nRongRTCEngineEventHandle.prototype.call = function (eventName, data) {\n    for (var eventHandle in this.eventHandles) {\n        if (eventName === eventHandle) {\n            return this.eventHandles[eventName](data);\n        }\n    }\n    RongRTCLogger.info('EventHandle ' + eventName + ' do not have defined function');\n};\n//\n// return RongRTCEngineEventHandle;\n// });\n/** ----- RongRTCEngineEventHandle ----- */\n\n/** ----- RongRTCConnectionStatsReport ----- */\nvar RongRTCConnectionStatsReport = function () {\n    this.statsReportSend = {};\n    this.statsReportRecvs = new Array();\n    this.packetSendLossRate = 0;\n}\n/**\n * parse statsReport\n *\n */\nRongRTCConnectionStatsReport.prototype.parseStatsReport = function (report) {\n    var packetsSent = this.statsReportSend.packetsSent;\n    packetsSent = (packetsSent == null || packetsSent == \"\") ? 0 : packetsSent;\n    var packetsLost = this.statsReportSend.packetsLost;\n    packetsLost = (packetsLost == null || packetsLost == \"\") ? 0 : packetsLost;\n    var packetSendLossRate = 0;\n\n    var statsReportSend = {};\n    var statsReportRecvs = new Array();\n    for (var i in report) {\n        var now = report[i];\n        if (now.type == 'ssrc' && now.mediaType == 'video') {\n            if (now.id.indexOf(\"recv\") != -1) {\n                var statsReportRecv = {};\n                statsReportRecv.googTrackId = now.googTrackId;\n                statsReportRecv.googCodecName = now.googCodecName\n                statsReportRecv.googCurrentDelayMs = now.googCurrentDelayMs;\n                statsReportRecv.googDecodeMs = now.googDecodeMs;\n                statsReportRecv.googFrameHeightReceived = now.googFrameHeightReceived;\n                statsReportRecv.googFrameRateDecoded = now.googFrameRateDecoded;\n                statsReportRecv.googFrameRateOutput = now.googFrameRateOutput;\n                statsReportRecv.googFrameRateReceived = now.googFrameRateReceived;\n                statsReportRecv.googFrameWidthReceived = now.googFrameWidthReceived;\n                statsReportRecv.packetsLost = now.packetsLost;\n                statsReportRecv.packetsReceived = now.packetsReceived;\n\n                statsReportRecvs.push(statsReportRecv);\n            } else if (now.id.indexOf(\"send\") != -1) {\n                statsReportSend.googCodecName = now.googCodecName;\n                statsReportSend.googAvgEncodeMs = now.googAvgEncodeMs;\n                statsReportSend.googFrameHeightInput = now.googFrameHeightInput;\n                statsReportSend.googFrameHeightSent = now.googFrameHeightSent;\n                statsReportSend.googFrameRateSent = now.googFrameRateSent;\n                statsReportSend.googFrameWidthInput = now.googFrameWidthInput;\n                statsReportSend.googFrameWidthSent = now.googFrameWidthSent;\n                statsReportSend.googFrameRateInput = now.googFrameRateInput;\n                statsReportSend.packetsLost = now.packetsLost;\n                statsReportSend.packetsSent = now.packetsSent;\n\n                if (statsReportSend.packetsLost != null\n                    && statsReportSend.packetsLost != \"\"\n                    && statsReportSend.packetsSent != null\n                    && statsReportSend.packetsSent != \"\"\n                    && (statsReportSend.packetsSent - packetsSent != 0)) {\n                    packetSendLossRate = (statsReportSend.packetsLost - packetsLost)\n                        * 100 / (statsReportSend.packetsSent - packetsSent);\n                }\n            }\n        }\n    }\n    // 重置\n    this.statsReportSend = null;\n    this.statsReportRecvs = null;\n    this.packetSendLossRate = 0;\n    this.statsReportSend = statsReportSend;\n    this.statsReportRecvs = statsReportRecvs;\n    RongRTCLogger.debug(\"packetSendLossRate=\" + packetSendLossRate);\n    this.packetSendLossRate = parseInt(packetSendLossRate);\n    RongRTCLogger.debug(\"this.packetSendLossRate=\" + this.packetSendLossRate);\n}\n/** ----- RongRTCConnectionStatsReport ----- */\n\n/** ----- RongRTCVideoView ----- */\nvar RongRTCVideoView = function () {\n\n}\n\n/** ----- RongRTCUtil ---- */\nvar RongRTCUtil = {\n    /**\n     * 获取websocket地址列表\n     *\n     */\n    getWsUrlList: function (wsNavUrl, callback) {\n        var wsUrlList;\n        RongRTCAjax({\n            type: \"GET\",\n            url: wsNavUrl,\n            async: true,\n            data: {\n                rand: Math.random()\n            },\n            dataType: \"JSON\",\n            success: function (data) {\n                callback(data);\n            },\n            error: function (error) {\n                RongRTCLogger.error(\"request nav error: \", error);\n                throw error;\n            }\n        });\n    },\n    /**\n     * SDP设置带宽\n     *\n     * @param sdp\n     * @param bandWidthParam\n     * @returns\n     */\n    setBandWidth: function (sdp, bandWidthParam) {\n    \tvar currentBandWidth = JSON.parse(JSON.stringify(bandWidthParam));\n    \tvar startBandWidth;\n    \tif (RongRTCGlobal.bandWidthCount == 0) {\n    \t\tstartBandWidth = (currentBandWidth.min + currentBandWidth.max) / 2;\n    \t}\n        // 给带宽设置增加计数器，使每次设置的最小码率不同，防止码率一样WebRTC将码率重置成默认最小值\n        RongRTCGlobal.bandWidthCount++;\n        if (RongRTCGlobal.bandWidthCount % 2 == 0) {\n            currentBandWidth.min = currentBandWidth.min + 1;\n        }\n\n        // set BAS\n        sdp = sdp.replace(/a=mid:video\\n/g, 'a=mid:video\\nb=AS:'\n            + currentBandWidth.max + '\\n');\n\n        // 查找最优先用的视频代码\n        var sep1 = \"\\n\";\n        var findStr1 = \"m=video\";\n\n        var sdpArr = sdp.split(sep1);\n        // 查找findStr1\n        var findIndex1 = RongRTCUtil.findLine(sdpArr, findStr1);\n        if (findIndex1 == null) {\n            return sdp;\n        }\n\n        var sep2 = \" \";\n\n        var videoDescArr1 = sdpArr[findIndex1].split(sep2);\n        // m=video 9 UDP/TLS/RTP/SAVPF\n        var firstVideoCode = videoDescArr1[3];\n        var findStr2 = \"a=rtpmap:\" + firstVideoCode;\n        // 查找findStr2\n        var findIndex2 = RongRTCUtil.findLine(sdpArr, findStr2);\n        if (findIndex2 == null) {\n            return sdp;\n        }\n\n        var appendStr = 'a=fmtp:' + firstVideoCode + ' x-google-min-bitrate=' + currentBandWidth.min\n        \t+ '; x-google-max-bitrate=' + currentBandWidth.max;\n        if (startBandWidth != null) {\n        \tappendStr += '; x-google-start-bitrate=' + startBandWidth;\n        }\n        sdpArr[findIndex2] = sdpArr[findIndex2].concat(sep1 + appendStr);\n\n        return sdpArr.join(sep1);\n    },\n    /**\n     * SDP修改stream id\n     *\n     * @param sdp\n     * @param oldId\n     * @param newId\n     * @returns\n     */\n    changeStreamId: function (sdp, oldId, newId) {\n        sdp = sdp.replace(new RegExp(oldId, 'g'), newId);\n        return sdp;\n    },\n    /**\n     * SDP修改video兼容参数\n     *\n     * @param sdp\n     * @returns\n     */\n    changeVideoDesc: function (sdp) {\n//\t\tvar videoDesc1 = \"m=video 9 RTP/AVPF 98 96 100 127 125 97 99 101\";\n//\t\tvar videoDesc2 = \"a=rtpmap:96 VP8/90000\\r\\na=rtcp-fb:96 ccm fir\\r\\na=rtcp-fb:96 nack\\r\\na=rtcp-fb:96 nack pli\\r\\na=rtcp-fb:96 goog-remb\\r\\na=rtcp-fb:96 transport-cc\\r\\na=rtpmap:98 H264/90000\\r\\na=rtcp-fb:98 ccm fir\\r\\na=rtcp-fb:98 nack\\r\\na=rtcp-fb:98 nack pli\\r\\na=rtcp-fb:98 goog-remb\\r\\na=rtcp-fb:98 transport-cc\\r\\na=fmtp:98 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\\r\\na=rtpmap:100 red/90000\\r\\na=rtpmap:127 ulpfec/90000\\r\\na=rtpmap:125 flexfec-03/90000\\r\\na=rtcp-fb:125 transport-cc\\r\\na=rtcp-fb:125 goog-remb\\r\\na=fmtp:125 repair-window=10000000\\r\\na=rtpmap:97 rtx/90000\\r\\na=fmtp:97 apt=96\\r\\na=rtpmap:99 rtx/90000\\r\\na=fmtp:99 apt=98\\r\\na=rtpmap:101 rtx/90000\\r\\na=fmtp:101 apt=100\";\n//\n//\t\tvar findStr1 = \"m=video\";\n//\t\tvar findStr2 = \"a=rtcp-rsize\";\n//\t\tvar findStr3 = \"a=ssrc-group\";\n//\n//\t\tvar sdpArr = sdp.split('\\r\\n');\n//\t\t// 查找videoDesc1\n//\t\tvar findIndex1 = RongRTCUtil.findLine(sdpArr, findStr1);\n//\t\t// 替换videoDesc1\n//\t\tsdpArr[findIndex1] = videoDesc1;\n//\t\t// 查找videoDesc2\n//\t\tvar findIndex2 = RongRTCUtil.findLine(sdpArr, findStr2);\n//\t\tvar findIndex3 = RongRTCUtil.findLine(sdpArr, findStr3);\n//\t\t// 删除中间的元素\n//\t\tsdpArr.splice(findIndex2 + 1, findIndex3 - findIndex2 - 1);\n//\t\t// 替换videoDesc2\n//\t\tsdpArr[findIndex2] = sdpArr[findIndex2].concat('\\r\\n' + videoDesc2);\n//\t\treturn sdpArr.join('\\r\\n');\n\n        var sep1 = \"\\r\\n\";\n        var findStr1 = \"m=video\";\n\n        var sdpArr = sdp.split(sep1);\n        // 查找videoDesc1\n        var findIndex1 = RongRTCUtil.findLine(sdpArr, findStr1);\n        if (findIndex1 == null) {\n            return sdp;\n        }\n\n        var h264_code = \"98\";\n        var vp8_code = \"96\";\n        var red_code = \"100\"\n        var ulpfec_code = \"127\";\n        var flexfec_code = \"125\";\n        var h264_rtx_code = \"99\";\n        var vp8_rtx_code = \"97\";\n        var red_rtx_code = \"101\"\n\n        var h264_search = \"H264/90000\";\n        var vp8_search = \"VP8/90000\";\n        var red_search = \"red/90000\";\n        var ulpfec_search = \"ulpfec/90000\";\n        var flexfec_search = \"flexfec-03/90000\";\n\n        var h264_replace = \"a=rtpmap:98 H264/90000\\r\\na=rtcp-fb:98 ccm fir\\r\\na=rtcp-fb:98 nack\\r\\na=rtcp-fb:98 nack pli\\r\\na=rtcp-fb:98 goog-remb\\r\\na=rtcp-fb:98 transport-cc\\r\\na=fmtp:98 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\\r\\na=rtpmap:99 rtx/90000\\r\\na=fmtp:99 apt=98\";\n        var vp8_replace = \"a=rtpmap:96 VP8/90000\\r\\na=rtcp-fb:96 ccm fir\\r\\na=rtcp-fb:96 nack\\r\\na=rtcp-fb:96 nack pli\\r\\na=rtcp-fb:96 goog-remb\\r\\na=rtcp-fb:96 transport-cc\\r\\na=rtpmap:97 rtx/90000\\r\\na=fmtp:97 apt=96\";\n        var red_replace = \"a=rtpmap:100 red/90000\\r\\na=rtpmap:101 rtx/90000\\r\\na=fmtp:101 apt=100\";\n        var ulpfec_replace = \"a=rtpmap:127 ulpfec/90000\";\n        var flexfec_replace = \"a=rtpmap:125 flexfec-03/90000\\r\\na=rtcp-fb:125 transport-cc\\r\\na=rtcp-fb:125 goog-remb\\r\\na=fmtp:125 repair-window=10000000\";\n\n        var sep2 = \" \";\n        var findStr2 = \"a=rtpmap\";\n        var findStr3 = \"a=ssrc-group\";\n\n        var videoDescArr1 = sdpArr[findIndex1].split(sep2);\n        // m=video 9 UDP/TLS/RTP/SAVPF\n        var videoReplace1 = videoDescArr1[0] + sep2 + videoDescArr1[1] + sep2\n            + videoDescArr1[2];\n        // 查找videoDesc2\n        var findIndex2 = RongRTCUtil.findLineInRange(sdpArr, findStr2, findIndex1 + 1, sdpArr.length - 1);\n        var findIndex3 = RongRTCUtil.findLineInRange(sdpArr, findStr3, findIndex2 + 1, sdpArr.length - 1);\n        if (findIndex3 == null) { // 观察者模式没有findStr3相关信息\n            findIndex3 = sdpArr.length - 1;\n        }\n        // 删除中间的元素\n        var removeArr = sdpArr.splice(findIndex2, findIndex3 - findIndex2);\n\n        // 查找H264\n        var h264_index = RongRTCUtil.findLine(removeArr, h264_search);\n        // 查找VP8\n        var vp8_index = RongRTCUtil.findLine(removeArr, vp8_search);\n        // 查找red\n        var red_index = RongRTCUtil.findLine(removeArr, red_search);\n        // 查找ulpfec\n        var ulpfec_index = RongRTCUtil.findLine(removeArr, ulpfec_search);\n        // 查找flexfec\n        var flexfec_index = RongRTCUtil.findLine(removeArr, flexfec_search);\n\n        var videoReplace2 = \"\";\n        if (h264_index != null) {\n            videoReplace1 += sep2 + h264_code;\n            videoReplace2 += sep1 + h264_replace;\n        }\n        if (vp8_index != null) {\n            videoReplace1 += sep2 + vp8_code;\n            videoReplace2 += sep1 + vp8_replace;\n        }\n        if (red_index != null) {\n            videoReplace1 += sep2 + red_code;\n            videoReplace2 += sep1 + red_replace;\n        }\n        if (ulpfec_index != null) {\n            videoReplace1 += sep2 + ulpfec_code;\n            videoReplace2 += sep1 + ulpfec_replace;\n        }\n        if (flexfec_index != null) {\n            videoReplace1 += sep2 + flexfec_code;\n            videoReplace2 += sep1 + flexfec_replace;\n        }\n        if (h264_index != null) {\n            videoReplace1 += sep2 + h264_rtx_code;\n        }\n        if (vp8_index != null) {\n            videoReplace1 += sep2 + vp8_rtx_code;\n        }\n        if (red_index != null) {\n            videoReplace1 += sep2 + red_rtx_code;\n        }\n\n        // 替换videoDesc1\n        sdpArr[findIndex1] = videoReplace1;\n        // 替换videoDesc2\n        sdpArr[findIndex2 - 1] = sdpArr[findIndex2 - 1].concat(videoReplace2);\n\n        return sdpArr.join(sep1);\n    },\n    /**\n     * get cname\n     *\n     * @param userId\n     */\n    getCname: function (sdp, userId) {\n        var sep1 = \"\\n\";\n        var sep2 = \" \";\n        var sdpArr = sdp.split(sep1);\n\n        // a=ssrc:702269835 msid:A9532881-B4CA-4B23-B219-9837CE93AA70 4716df1f-046f-4b96-a260-2593048d7e9e\n        var msid_search = \"msid:\" + userId;\n        var msid_index = RongRTCUtil.findLine(sdpArr, msid_search);\n        if (msid_index == null) {\n            return null;\n        }\n        var ssrc = sdpArr[msid_index].split(sep2)[0];\n\n        // a=ssrc:702269835 cname:wRow2WLrs18ZB3Dg\n        var cname_search = ssrc + \" cname:\";\n        var cname_index = RongRTCUtil.findLine(sdpArr, cname_search);\n        var cname = sdpArr[cname_index].split(\"cname:\")[1];\n        return cname;\n    },\n    /**\n     * check cname\n     *\n     * @param userId\n     */\n    isHasCname: function (sdp, cname) {\n        var sep1 = \"\\n\";\n        var sdpArr = sdp.split(sep1);\n\n        // a=ssrc:702269835 cname:wRow2WLrs18ZB3Dg\n        var cname_search = \"cname:\" + cname;\n        var cname_index = RongRTCUtil.findLine(sdpArr, cname_search);\n        return cname_index != null;\n    },\n    getSsrc: function (sdp, userId, cname) {\n        //ssrc变化则为屏幕共享\n\n        var sdpArr = sdp.split('\\n');\n        var videoLine = sdpArr.map(function (line, index) {\n            if (line.indexOf('mid:video') > -1)\n                return index;\n        }).filter(function (item) {\n            return item;\n        })\n        sdpArr = sdpArr.slice(videoLine[0])\n        var ssrc = sdpArr.filter(function (line) {\n            return line.indexOf('a=ssrc:') > -1;\n        })\n        var cnameLine = ssrc.map(function (line, index) {\n            if (line.indexOf('cname:' + cname) > -1)\n                return index;\n        }).filter(function (item) {\n            return item;\n        })\n        var ts = ssrc.slice(cnameLine[0] + 1, cnameLine[0] + 2);\n        return ts[0].split(\" \")[2];\n\n    },\n    /**\n     * 数组中查找\n     *\n     * @param arr\n     * @param substr\n     * @returns\n     */\n    findLine: function (arr, substr) {\n        for (var i = 0; i < arr.length; i++) {\n            if (arr[i].indexOf(substr) != -1) {\n                return i;\n            }\n        }\n        return null;\n    },\n    /**\n     * 数组中查找\n     *\n     * @param arr\n     * @param substr\n     * @param startIndex\n     * @param endIndex\n     * @returns\n     */\n    findLineInRange: function (arr, substr, startIndex, endIndex) {\n        var start = (startIndex == null || startIndex == '' || startIndex < 0) ? 0\n            : startIndex;\n        var end = (endIndex == null || endIndex == '' || endIndex < 0 || endIndex > arr.length - 1) ? arr.length - 1\n            : endIndex;\n        start = start > end ? end : start;\n        for (var i = start; i <= end; i++) {\n            if (arr[i].indexOf(substr) != -1) {\n                return i;\n            }\n        }\n        return null;\n    },\n    /**\n     * 随机打乱数组内排序\n     *\n     * @param input\n     * @returns\n     */\n    shuffle: function (input) {\n        for (var i = input.length - 1; i >= 0; i--) {\n            var randomIndex = Math.floor(Math.random() * (i + 1));\n            var itemAtIndex = input[randomIndex];\n            input[randomIndex] = input[i];\n            input[i] = itemAtIndex;\n        }\n        return input;\n    },\n    /**\n     * 刷新VideoView的视频流\n     *\n     * @param userId\n     */\n    refreshMediaStream: function (userId) {\n        var videoView = document.getElementById(userId);\n        if (videoView != null) {\n            var stream = userId == rongRTCengine.selfUserId ? rongRTCengine.localStream : rongRTCengine.remoteStreams.filter(function (stream) {\n                return stream.id == userId;\n            })[0];\n            videoView.srcObject = stream;\n            videoView.srcObject = videoView.srcObject\n        }\n    },\n    /**\n     * 设置VideoView的视频流为指定流\n     *\n     * @param userId\n     */\n    setMediaStream: function (userId, stream) {\n        var videoView = document.getElementById(userId);\n        if (videoView != null) {\n            videoView.srcObject = stream;\n        }\n    },\n    /**\n     * 当前浏览器\n     */\n    myBrowser: function () {\n        var userAgent = navigator.userAgent; // 取得浏览器的userAgent字符串\n        var isOpera = userAgent.indexOf(\"Opera\") > -1;\n        if (isOpera) {\n            return \"Opera\"\n        }\n        ; // 判断是否Opera浏览器\n        if (userAgent.indexOf(\"Firefox\") > -1) {\n            return \"FF\";\n        } // 判断是否Firefox浏览器\n        if (userAgent.indexOf(\"Chrome\") > -1) {\n            return \"Chrome\";\n        }\n        if (userAgent.indexOf(\"Safari\") > -1) {\n            return \"Safari\";\n        } // 判断是否Safari浏览器\n        if (userAgent.indexOf(\"compatible\") > -1 && userAgent.indexOf(\"MSIE\") > -1 && !isOpera) {\n            return \"IE\";\n        }\n        ; // 判断是否IE浏览器\n    }\n}\n\n/** ----- RongRTCAjax ----- */\nvar RongRTCAjax = function (opt) {\n    opt.type = opt.type.toUpperCase() || 'POST';\n    if (opt.type === 'POST') {\n        post(opt);\n    } else {\n        get(opt);\n    }\n\n    // 初始化数据\n    function init(opt) {\n        var optAdapter = {\n            url: '',\n            type: 'GET',\n            data: {},\n            async: true,\n            dataType: 'JSON',\n            success: function () {\n            },\n            error: function (s) {\n                // alert('status:' + s + 'error!');\n            }\n        }\n        opt.url = opt.url || optAdapter.url;\n        opt.type = opt.type.toUpperCase() || optAdapter.method;\n        opt.data = params(opt.data) || params(optAdapter.data);\n        opt.dataType = opt.dataType.toUpperCase() || optAdapter.dataType;\n        // opt.async = opt.async || optAdapter.async;\n        opt.success = opt.success || optAdapter.success;\n        opt.error = opt.error || optAdapter.error;\n        return opt;\n    }\n\n    // 创建XMLHttpRequest对象\n    function createXHR() {\n        if (window.XMLHttpRequest) { // IE7+、Firefox、Opera、Chrome、Safari\n            return new XMLHttpRequest();\n        } else if (window.ActiveXObject) { // IE6 及以下\n            var versions = ['MSXML2.XMLHttp', 'Microsoft.XMLHTTP'];\n            for (var i = 0, len = versions.length; i < len; i++) {\n                try {\n                    return new ActiveXObject(version[i]);\n                    break;\n                } catch (e) {\n                    // 跳过\n                }\n            }\n        } else {\n            throw new Error('浏览器不支持XHR对象！');\n        }\n    }\n\n    function params(data) {\n        var arr = [];\n        for (var i in data) {\n            // 特殊字符传参产生的问题可以使用encodeURIComponent()进行编码处理\n            arr.push(encodeURIComponent(i) + '=' + encodeURIComponent(data[i]));\n        }\n        return arr.join('&');\n    }\n\n    function callback(opt, xhr) {\n        if (xhr.readyState == 4 && xhr.status == 200) { // 判断http的交互是否成功，200表示成功\n            var returnValue;\n            switch (opt.dataType) {\n                case \"XML\":\n                    returnValue = xhr.responseXML;\n                    break;\n                case \"JSON\":\n                    var jsonText = xhr.responseText;\n                    if (jsonText) {\n                        returnValue = eval(\"(\" + jsonText + \")\");\n                    }\n                    break;\n                default:\n                    returnValue = xhr.responseText;\n                    break;\n            }\n            if (returnValue) {\n                opt.success(returnValue);\n            }\n        } else {\n            // alert('获取数据错误！错误代号：' + xhr.status + '，错误信息：' +\n            // xhr.statusText);\n            opt.error(xhr);\n        }\n\n    }\n\n    // post方法\n    function post(opt) {\n        var xhr = createXHR(); // 创建XHR对象\n        var opt = init(opt);\n        opt.type = 'post';\n        if (opt.async === true) { // true表示异步，false表示同步\n            // 使用异步调用的时候，需要触发readystatechange 事件\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) { // 判断对象的状态是否交互完成\n                    callback(opt, xhr); // 回调\n                }\n            };\n        }\n        // 在使用XHR对象时，必须先调用open()方法，\n        // 它接受三个参数：请求类型(get、post)、请求的URL和表示是否异步。\n        xhr.open(opt.type, opt.url, opt.async);\n        // post方式需要自己设置http的请求头，来模仿表单提交。\n        // 放在open方法之后，send方法之前。\n        xhr.setRequestHeader('Content-Type',\n            'application/x-www-form-urlencoded;charset=utf-8');\n        xhr.send(opt.data); // post方式将数据放在send()方法里\n        if (opt.async === false) { // 同步\n            callback(opt, xhr); // 回调\n        }\n    }\n\n    // get方法\n    function get(opt) {\n        var xhr = createXHR(); // 创建XHR对象\n        var opt = init(opt);\n        opt.type = 'get';\n        if (opt.async === true) { // true表示异步，false表示同步\n            // 使用异步调用的时候，需要触发readystatechange 事件\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) { // 判断对象的状态是否交互完成\n                    callback(opt, xhr); // 回调\n                }\n            };\n        }\n        // 若是GET请求，则将数据加到url后面\n        opt.url += opt.url.indexOf('?') == -1 ? '?' + opt.data : '&' + opt.data;\n        // 在使用XHR对象时，必须先调用open()方法，\n        // 它接受三个参数：请求类型(get、post)、请求的URL和表示是否异步。\n        xhr.open(opt.type, opt.url, opt.async);\n        xhr.send(null); // get方式则填null\n        if (opt.async === false) { // 同步\n            callback(opt, xhr); // 回调\n        }\n    }\n}\n\n/** ----- RongRTCMap ----- */\nvar RongRTCMap = function () {\n    this._entrys = new Array();\n\n    this.put = function (key, value) {\n        if (key == null || key == undefined) {\n            return;\n        }\n        var index = this._getIndex(key);\n        if (index == -1) {\n            var entry = new Object();\n            entry.key = key;\n            entry.value = value;\n            this._entrys[this._entrys.length] = entry;\n        } else {\n            this._entrys[index].value = value;\n        }\n    };\n    this.get = function (key) {\n        var index = this._getIndex(key);\n        return (index != -1) ? this._entrys[index].value : null;\n    };\n    this.remove = function (key) {\n        var index = this._getIndex(key);\n        if (index != -1) {\n            this._entrys.splice(index, 1);\n        }\n    };\n    this.clear = function () {\n        this._entrys.length = 0;\n    };\n    this.contains = function (key) {\n        var index = this._getIndex(key);\n        return (index != -1) ? true : false;\n    };\n    this.size = function () {\n        return this._entrys.length;\n    };\n    this.getEntrys = function () {\n        return this._entrys;\n    };\n    this._getIndex = function (key) {\n        if (key == null || key == undefined) {\n            return -1;\n        }\n        var _length = this._entrys.length;\n        for (var i = 0; i < _length; i++) {\n            var entry = this._entrys[i];\n            if (entry == null || entry == undefined) {\n                continue;\n            }\n            if (entry.key === key) {// equal\n                return i;\n            }\n        }\n        return -1;\n    };\n}\n\n/** ----- RongRTCException ----- */\nvar RongRTCException = function (code, message) {\n    this.code = code;\n    this.message = message;\n}\n\n/** ----- RongRTCLogger ----- */\nvar RongRTCLogger = {\n    /**\n     * debug\n     *\n     */\n    debug: function (message, data) {\n        console.debug(new Date() + \" DEBUG \" + message);\n        if (data != null && data != undefined) {\n            console.debug(data);\n        }\n    },\n    /**\n     * info\n     *\n     */\n    info: function (message, data) {\n        console.info(new Date() + \" INFO \" + message);\n        if (data != null && data != undefined) {\n            console.info(data);\n        }\n    },\n    /**\n     * log\n     *\n     */\n    log: function (message, data) {\n        console.log(new Date() + \" LOG \" + message);\n        if (data != null && data != undefined) {\n            console.log(data);\n        }\n    },\n    /**\n     * warn\n     *\n     */\n    warn: function (message, data) {\n        console.warn(new Date() + \" WARN \" + message);\n        if (data != null && data != undefined) {\n            console.warn(data);\n        }\n    },\n    /**\n     * error\n     *\n     */\n    error: function (message, error) {\n        console.error(new Date() + \" ERROR \" + message);\n        if (error != null && error != undefined) {\n            console.error(error);\n        }\n    }\n}"
  },
  {
    "path": "rtc/app/lib/adapter.js",
    "content": "(function (f) { if (typeof exports === \"object\" && typeof module !== \"undefined\") { module.exports = f() } else if (typeof define === \"function\" && define.amd) { define([], f) } else { var g; if (typeof window !== \"undefined\") { g = window } else if (typeof global !== \"undefined\") { g = global } else if (typeof self !== \"undefined\") { g = self } else { g = this } g.adapter = f() } })(function ()\n{\n    var define, module, exports; return (function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { var a = typeof require == \"function\" && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); var f = new Error(\"Cannot find module '\" + o + \"'\"); throw f.code = \"MODULE_NOT_FOUND\", f } var l = n[o] = { exports: {} }; t[o][0].call(l.exports, function (e) { var n = t[o][1][e]; return s(n ? n : e) }, l, l.exports, e, t, n, r) } return n[o].exports } var i = typeof require == \"function\" && require; for (var o = 0; o < r.length; o++) s(r[o]); return s })({\n        1: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n\n            'use strict';\n\n            // Shimming starts here.\n            (function ()\n            {\n                // Utils.\n                var logging = require('./utils').log;\n                var browserDetails = require('./utils').browserDetails;\n                // Export to the adapter global object visible in the browser.\n                module.exports.browserDetails = browserDetails;\n                module.exports.extractVersion = require('./utils').extractVersion;\n                module.exports.disableLog = require('./utils').disableLog;\n\n                // Comment out the line below if you want logging to occur, including logging\n                // for the switch statement below. Can also be turned on in the browser via\n                // adapter.disableLog(false), but then logging from the switch statement below\n                // will not appear.\n                require('./utils').disableLog(true);\n\n                // Browser shims.\n                var chromeShim = require('./chrome/chrome_shim') || null;\n                var edgeShim = require('./edge/edge_shim') || null;\n                var firefoxShim = require('./firefox/firefox_shim') || null;\n                var safariShim = require('./safari/safari_shim') || null;\n\n                // Shim browser if found.\n                switch (browserDetails.browser)\n                {\n                    case 'opera': // fallthrough as it uses chrome shims\n                    case 'chrome':\n                        if (!chromeShim || !chromeShim.shimPeerConnection)\n                        {\n                            logging('Chrome shim is not included in this adapter release.');\n                            return;\n                        }\n                        logging('adapter.js shimming chrome.');\n                        // Export to the adapter global object visible in the browser.\n                        module.exports.browserShim = chromeShim;\n\n                        chromeShim.shimGetUserMedia();\n                        chromeShim.shimSourceObject();\n                        chromeShim.shimPeerConnection();\n                        chromeShim.shimOnTrack();\n                        break;\n                    case 'firefox':\n                        if (!firefoxShim || !firefoxShim.shimPeerConnection)\n                        {\n                            logging('Firefox shim is not included in this adapter release.');\n                            return;\n                        }\n                        logging('adapter.js shimming firefox.');\n                        // Export to the adapter global object visible in the browser.\n                        module.exports.browserShim = firefoxShim;\n\n                        firefoxShim.shimGetUserMedia();\n                        firefoxShim.shimSourceObject();\n                        firefoxShim.shimPeerConnection();\n                        firefoxShim.shimOnTrack();\n                        break;\n                    case 'edge':\n                        if (!edgeShim || !edgeShim.shimPeerConnection)\n                        {\n                            logging('MS edge shim is not included in this adapter release.');\n                            return;\n                        }\n                        logging('adapter.js shimming edge.');\n                        // Export to the adapter global object visible in the browser.\n                        module.exports.browserShim = edgeShim;\n\n                        edgeShim.shimPeerConnection();\n                        break;\n                    case 'safari':\n                        if (!safariShim)\n                        {\n                            logging('Safari shim is not included in this adapter release.');\n                            return;\n                        }\n                        logging('adapter.js shimming safari.');\n                        // Export to the adapter global object visible in the browser.\n                        module.exports.browserShim = safariShim;\n\n                        safariShim.shimGetUserMedia();\n                        break;\n                    default:\n                        logging('Unsupported browser!');\n                }\n            })();\n\n        }, { \"./chrome/chrome_shim\": 2, \"./edge/edge_shim\": 5, \"./firefox/firefox_shim\": 6, \"./safari/safari_shim\": 8, \"./utils\": 9 }], 2: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n            var logging = require('../utils.js').log;\n            var browserDetails = require('../utils.js').browserDetails;\n\n            var chromeShim = {\n                shimOnTrack: function ()\n                {\n                    if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in\n                        window.RTCPeerConnection.prototype))\n                    {\n                        Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n                            get: function ()\n                            {\n                                return this._ontrack;\n                            },\n                            set: function (f)\n                            {\n                                var self = this;\n                                if (this._ontrack)\n                                {\n                                    this.removeEventListener('track', this._ontrack);\n                                    this.removeEventListener('addstream', this._ontrackpoly);\n                                }\n                                this.addEventListener('track', this._ontrack = f);\n                                this.addEventListener('addstream', this._ontrackpoly = function (e)\n                                {\n                                    // onaddstream does not fire when a track is added to an existing\n                                    // stream. But stream.onaddtrack is implemented so we use that.\n                                    e.stream.addEventListener('addtrack', function (te)\n                                    {\n                                        var event = new Event('track');\n                                        event.track = te.track;\n                                        event.receiver = { track: te.track };\n                                        event.streams = [e.stream];\n                                        self.dispatchEvent(event);\n                                    });\n                                    e.stream.getTracks().forEach(function (track)\n                                    {\n                                        var event = new Event('track');\n                                        event.track = track;\n                                        event.receiver = { track: track };\n                                        event.streams = [e.stream];\n                                        this.dispatchEvent(event);\n                                    }.bind(this));\n                                }.bind(this));\n                            }\n                        });\n                    }\n                },\n\n                shimSourceObject: function ()\n                {\n                    if (typeof window === 'object')\n                    {\n                        if (window.HTMLMediaElement &&\n                          !('srcObject' in window.HTMLMediaElement.prototype))\n                        {\n                            // Shim the srcObject property, once, when HTMLMediaElement is found.\n                            Object.defineProperty(window.HTMLMediaElement.prototype, 'srcObject', {\n                                get: function ()\n                                {\n                                    return this._srcObject;\n                                },\n                                set: function (stream)\n                                {\n                                    var self = this;\n                                    // Use _srcObject as a private property for this shim\n                                    this._srcObject = stream;\n                                    if (this.src)\n                                    {\n                                        URL.revokeObjectURL(this.src);\n                                    }\n\n                                    if (!stream)\n                                    {\n                                        this.src = '';\n                                        return;\n                                    }\n                                    this.src = URL.createObjectURL(stream);\n                                    // We need to recreate the blob url when a track is added or\n                                    // removed. Doing it manually since we want to avoid a recursion.\n                                    stream.addEventListener('addtrack', function ()\n                                    {\n                                        if (self.src)\n                                        {\n                                            URL.revokeObjectURL(self.src);\n                                        }\n                                        self.src = URL.createObjectURL(stream);\n                                    });\n                                    stream.addEventListener('removetrack', function ()\n                                    {\n                                        if (self.src)\n                                        {\n                                            URL.revokeObjectURL(self.src);\n                                        }\n                                        self.src = URL.createObjectURL(stream);\n                                    });\n                                }\n                            });\n                        }\n                    }\n                },\n\n                shimPeerConnection: function ()\n                {\n                    // The RTCPeerConnection object.\n                    window.RTCPeerConnection = function (pcConfig, pcConstraints)\n                    {\n                        // Translate iceTransportPolicy to iceTransports,\n                        // see https://code.google.com/p/webrtc/issues/detail?id=4869\n                        logging('PeerConnection');\n                        if (pcConfig && pcConfig.iceTransportPolicy)\n                        {\n                            pcConfig.iceTransports = pcConfig.iceTransportPolicy;\n                        }\n\n                        var pc = new webkitRTCPeerConnection(pcConfig, pcConstraints);\n                        var origGetStats = pc.getStats.bind(pc);\n                        pc.getStats = function (selector, successCallback, errorCallback)\n                        {\n                            var self = this;\n                            var args = arguments;\n\n                            // If selector is a function then we are in the old style stats so just\n                            // pass back the original getStats format to avoid breaking old users.\n                            if (arguments.length > 0 && typeof selector === 'function')\n                            {\n                                return origGetStats(selector, successCallback);\n                            }\n\n                            var fixChromeStats_ = function (response)\n                            {\n                                var standardReport = {};\n                                var reports = response.result();\n                                reports.forEach(function (report)\n                                {\n                                    var standardStats = {\n                                        id: report.id,\n                                        timestamp: report.timestamp,\n                                        type: report.type\n                                    };\n                                    report.names().forEach(function (name)\n                                    {\n                                        standardStats[name] = report.stat(name);\n                                    });\n                                    standardReport[standardStats.id] = standardStats;\n                                });\n\n                                return standardReport;\n                            };\n\n                            if (arguments.length >= 2)\n                            {\n                                var successCallbackWrapper_ = function (response)\n                                {\n                                    args[1](fixChromeStats_(response));\n                                };\n\n                                return origGetStats.apply(this, [successCallbackWrapper_,\n                                    arguments[0]]);\n                            }\n\n                            // promise-support\n                            return new Promise(function (resolve, reject)\n                            {\n                                if (args.length === 1 && typeof selector === 'object')\n                                {\n                                    origGetStats.apply(self,\n                                        [function (response)\n                                        {\n                                            resolve.apply(null, [fixChromeStats_(response)]);\n                                        }, reject]);\n                                } else\n                                {\n                                    origGetStats.apply(self, [resolve, reject]);\n                                }\n                            });\n                        };\n\n                        return pc;\n                    };\n                    window.RTCPeerConnection.prototype = webkitRTCPeerConnection.prototype;\n\n                    // wrap static methods. Currently just generateCertificate.\n                    if (webkitRTCPeerConnection.generateCertificate)\n                    {\n                        Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {\n                            get: function ()\n                            {\n                                return webkitRTCPeerConnection.generateCertificate;\n                            }\n                        });\n                    }\n\n                    // add promise support\n                    ['createOffer', 'createAnswer'].forEach(function (method)\n                    {\n                        var nativeMethod = webkitRTCPeerConnection.prototype[method];\n                        webkitRTCPeerConnection.prototype[method] = function ()\n                        {\n                            var self = this;\n                            if (arguments.length < 1 || (arguments.length === 1 &&\n                                typeof (arguments[0]) === 'object'))\n                            {\n                                var opts = arguments.length === 1 ? arguments[0] : undefined;\n                                return new Promise(function (resolve, reject)\n                                {\n                                    nativeMethod.apply(self, [resolve, reject, opts]);\n                                });\n                            }\n                            return nativeMethod.apply(this, arguments);\n                        };\n                    });\n\n                    ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n                        .forEach(function (method)\n                        {\n                            var nativeMethod = webkitRTCPeerConnection.prototype[method];\n                            webkitRTCPeerConnection.prototype[method] = function ()\n                            {\n                                var args = arguments;\n                                var self = this;\n                                args[0] = new ((method === 'addIceCandidate') ?\n                                    RTCIceCandidate : RTCSessionDescription)(args[0]);\n                                return new Promise(function (resolve, reject)\n                                {\n                                    nativeMethod.apply(self, [args[0],\n                                        function ()\n                                        {\n                                            resolve();\n                                            if (args.length >= 2)\n                                            {\n                                                args[1].apply(null, []);\n                                            }\n                                        },\n                                        function (err)\n                                        {\n                                            reject(err);\n                                            if (args.length >= 3)\n                                            {\n                                                args[2].apply(null, [err]);\n                                            }\n                                        }]\n                                      );\n                                });\n                            };\n                        });\n                },\n\n                // Attach a media stream to an element.\n                attachMediaStream: function (element, stream)\n                {\n                    logging('DEPRECATED, attachMediaStream will soon be removed.');\n                    if (browserDetails.version >= 43)\n                    {\n                        element.srcObject = stream;\n                    } else if (typeof element.src !== 'undefined')\n                    {\n                        element.src = URL.createObjectURL(stream);\n                    } else\n                    {\n                        logging('Error attaching stream to element.');\n                    }\n                },\n\n                reattachMediaStream: function (to, from)\n                {\n                    logging('DEPRECATED, reattachMediaStream will soon be removed.');\n                    if (browserDetails.version >= 43)\n                    {\n                        to.srcObject = from.srcObject;\n                    } else\n                    {\n                        to.src = from.src;\n                    }\n                }\n            };\n\n\n            // Expose public methods.\n            module.exports = {\n                shimOnTrack: chromeShim.shimOnTrack,\n                shimSourceObject: chromeShim.shimSourceObject,\n                shimPeerConnection: chromeShim.shimPeerConnection,\n                shimGetUserMedia: require('./getusermedia'),\n                attachMediaStream: chromeShim.attachMediaStream,\n                reattachMediaStream: chromeShim.reattachMediaStream\n            };\n\n        }, { \"../utils.js\": 9, \"./getusermedia\": 3 }], 3: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n            var logging = require('../utils.js').log;\n\n            // Expose public methods.\n            module.exports = function ()\n            {\n                var constraintsToChrome_ = function (c)\n                {\n                    if (typeof c !== 'object' || c.mandatory || c.optional)\n                    {\n                        return c;\n                    }\n                    var cc = {};\n                    Object.keys(c).forEach(function (key)\n                    {\n                        if (key === 'require' || key === 'advanced' || key === 'mediaSource')\n                        {\n                            return;\n                        }\n                        var r = (typeof c[key] === 'object') ? c[key] : { ideal: c[key] };\n                        if (r.exact !== undefined && typeof r.exact === 'number')\n                        {\n                            r.min = r.max = r.exact;\n                        }\n                        var oldname_ = function (prefix, name)\n                        {\n                            if (prefix)\n                            {\n                                return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n                            }\n                            return (name === 'deviceId') ? 'sourceId' : name;\n                        };\n                        if (r.ideal !== undefined)\n                        {\n                            cc.optional = cc.optional || [];\n                            var oc = {};\n                            if (typeof r.ideal === 'number')\n                            {\n                                oc[oldname_('min', key)] = r.ideal;\n                                cc.optional.push(oc);\n                                oc = {};\n                                oc[oldname_('max', key)] = r.ideal;\n                                cc.optional.push(oc);\n                            } else\n                            {\n                                oc[oldname_('', key)] = r.ideal;\n                                cc.optional.push(oc);\n                            }\n                        }\n                        if (r.exact !== undefined && typeof r.exact !== 'number')\n                        {\n                            cc.mandatory = cc.mandatory || {};\n                            cc.mandatory[oldname_('', key)] = r.exact;\n                        } else\n                        {\n                            ['min', 'max'].forEach(function (mix)\n                            {\n                                if (r[mix] !== undefined)\n                                {\n                                    cc.mandatory = cc.mandatory || {};\n                                    cc.mandatory[oldname_(mix, key)] = r[mix];\n                                }\n                            });\n                        }\n                    });\n                    if (c.advanced)\n                    {\n                        cc.optional = (cc.optional || []).concat(c.advanced);\n                    }\n                    return cc;\n                };\n\n                var getUserMedia_ = function (constraints, onSuccess, onError)\n                {\n                    constraints = JSON.parse(JSON.stringify(constraints));\n                    if (constraints.audio)\n                    {\n                        constraints.audio = constraintsToChrome_(constraints.audio);\n                    }\n                    if (constraints.video)\n                    {\n                        constraints.video = constraintsToChrome_(constraints.video);\n                    }\n                    logging('chrome: ' + JSON.stringify(constraints));\n                    return navigator.webkitGetUserMedia(constraints, onSuccess, onError);\n                };\n                navigator.getUserMedia = getUserMedia_;\n\n                // Returns the result of getUserMedia as a Promise.\n                var getUserMediaPromise_ = function (constraints)\n                {\n                    return new Promise(function (resolve, reject)\n                    {\n                        navigator.getUserMedia(constraints, resolve, reject);\n                    });\n                };\n\n                if (!navigator.mediaDevices)\n                {\n                    navigator.mediaDevices = {\n                        getUserMedia: getUserMediaPromise_,\n                        enumerateDevices: function ()\n                        {\n                            return new Promise(function (resolve)\n                            {\n                                var kinds = { audio: 'audioinput', video: 'videoinput' };\n                                return MediaStreamTrack.getSources(function (devices)\n                                {\n                                    resolve(devices.map(function (device)\n                                    {\n                                        return {\n                                            label: device.label,\n                                            kind: kinds[device.kind],\n                                            deviceId: device.id,\n                                            groupId: ''\n                                        };\n                                    }));\n                                });\n                            });\n                        }\n                    };\n                }\n\n                // A shim for getUserMedia method on the mediaDevices object.\n                // TODO(KaptenJansson) remove once implemented in Chrome stable.\n                if (!navigator.mediaDevices.getUserMedia)\n                {\n                    navigator.mediaDevices.getUserMedia = function (constraints)\n                    {\n                        return getUserMediaPromise_(constraints);\n                    };\n                } else\n                {\n                    // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia\n                    // function which returns a Promise, it does not accept spec-style\n                    // constraints.\n                    var origGetUserMedia = navigator.mediaDevices.getUserMedia.\n                        bind(navigator.mediaDevices);\n                    navigator.mediaDevices.getUserMedia = function (c)\n                    {\n                        if (c)\n                        {\n                            logging('spec:   ' + JSON.stringify(c)); // whitespace for alignment\n                            c.audio = constraintsToChrome_(c.audio);\n                            c.video = constraintsToChrome_(c.video);\n                            logging('chrome: ' + JSON.stringify(c));\n                        }\n                        return origGetUserMedia(c);\n                    }.bind(this);\n                }\n\n                // Dummy devicechange event methods.\n                // TODO(KaptenJansson) remove once implemented in Chrome stable.\n                if (typeof navigator.mediaDevices.addEventListener === 'undefined')\n                {\n                    navigator.mediaDevices.addEventListener = function ()\n                    {\n                        logging('Dummy mediaDevices.addEventListener called.');\n                    };\n                }\n                if (typeof navigator.mediaDevices.removeEventListener === 'undefined')\n                {\n                    navigator.mediaDevices.removeEventListener = function ()\n                    {\n                        logging('Dummy mediaDevices.removeEventListener called.');\n                    };\n                }\n            };\n\n        }, { \"../utils.js\": 9 }], 4: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n\n            // SDP helpers.\n            var SDPUtils = {};\n\n            // Generate an alphanumeric identifier for cname or mids.\n            // TODO: use UUIDs instead? https://gist.github.com/jed/982883\n            SDPUtils.generateIdentifier = function ()\n            {\n                return Math.random().toString(36).substr(2, 10);\n            };\n\n            // The RTCP CNAME used by all peerconnections from the same JS.\n            SDPUtils.localCName = SDPUtils.generateIdentifier();\n\n            // Splits SDP into lines, dealing with both CRLF and LF.\n            SDPUtils.splitLines = function (blob)\n            {\n                return blob.trim().split('\\n').map(function (line)\n                {\n                    return line.trim();\n                });\n            };\n            // Splits SDP into sessionpart and mediasections. Ensures CRLF.\n            SDPUtils.splitSections = function (blob)\n            {\n                var parts = blob.split('\\nm=');\n                return parts.map(function (part, index)\n                {\n                    return (index > 0 ? 'm=' + part : part).trim() + '\\r\\n';\n                });\n            };\n\n            // Returns lines that start with a certain prefix.\n            SDPUtils.matchPrefix = function (blob, prefix)\n            {\n                return SDPUtils.splitLines(blob).filter(function (line)\n                {\n                    return line.indexOf(prefix) === 0;\n                });\n            };\n\n            // Parses an ICE candidate line. Sample input:\n            // candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8\n            // rport 55996\"\n            SDPUtils.parseCandidate = function (line)\n            {\n                var parts;\n                // Parse both variants.\n                if (line.indexOf('a=candidate:') === 0)\n                {\n                    parts = line.substring(12).split(' ');\n                } else\n                {\n                    parts = line.substring(10).split(' ');\n                }\n\n                var candidate = {\n                    foundation: parts[0],\n                    component: parts[1],\n                    protocol: parts[2].toLowerCase(),\n                    priority: parseInt(parts[3], 10),\n                    ip: parts[4],\n                    port: parseInt(parts[5], 10),\n                    // skip parts[6] == 'typ'\n                    type: parts[7]\n                };\n\n                for (var i = 8; i < parts.length; i += 2)\n                {\n                    switch (parts[i])\n                    {\n                        case 'raddr':\n                            candidate.relatedAddress = parts[i + 1];\n                            break;\n                        case 'rport':\n                            candidate.relatedPort = parseInt(parts[i + 1], 10);\n                            break;\n                        case 'tcptype':\n                            candidate.tcpType = parts[i + 1];\n                            break;\n                        default: // Unknown extensions are silently ignored.\n                            break;\n                    }\n                }\n                return candidate;\n            };\n\n            // Translates a candidate object into SDP candidate attribute.\n            SDPUtils.writeCandidate = function (candidate)\n            {\n                var sdp = [];\n                sdp.push(candidate.foundation);\n                sdp.push(candidate.component);\n                sdp.push(candidate.protocol.toUpperCase());\n                sdp.push(candidate.priority);\n                sdp.push(candidate.ip);\n                sdp.push(candidate.port);\n\n                var type = candidate.type;\n                sdp.push('typ');\n                sdp.push(type);\n                if (type !== 'host' && candidate.relatedAddress &&\n                    candidate.relatedPort)\n                {\n                    sdp.push('raddr');\n                    sdp.push(candidate.relatedAddress); // was: relAddr\n                    sdp.push('rport');\n                    sdp.push(candidate.relatedPort); // was: relPort\n                }\n                if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp')\n                {\n                    sdp.push('tcptype');\n                    sdp.push(candidate.tcpType);\n                }\n                return 'candidate:' + sdp.join(' ');\n            };\n\n            // Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input:\n            // a=rtpmap:111 opus/48000/2\n            SDPUtils.parseRtpMap = function (line)\n            {\n                var parts = line.substr(9).split(' ');\n                var parsed = {\n                    payloadType: parseInt(parts.shift(), 10) // was: id\n                };\n\n                parts = parts[0].split('/');\n\n                parsed.name = parts[0];\n                parsed.clockRate = parseInt(parts[1], 10); // was: clockrate\n                // was: channels\n                parsed.numChannels = parts.length === 3 ? parseInt(parts[2], 10) : 1;\n                return parsed;\n            };\n\n            // Generate an a=rtpmap line from RTCRtpCodecCapability or\n            // RTCRtpCodecParameters.\n            SDPUtils.writeRtpMap = function (codec)\n            {\n                var pt = codec.payloadType;\n                if (codec.preferredPayloadType !== undefined)\n                {\n                    pt = codec.preferredPayloadType;\n                }\n                return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate +\n                    (codec.numChannels !== 1 ? '/' + codec.numChannels : '') + '\\r\\n';\n            };\n\n            // Parses an a=extmap line (headerextension from RFC 5285). Sample input:\n            // a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\n            SDPUtils.parseExtmap = function (line)\n            {\n                var parts = line.substr(9).split(' ');\n                return {\n                    id: parseInt(parts[0], 10),\n                    uri: parts[1]\n                };\n            };\n\n            // Generates a=extmap line from RTCRtpHeaderExtensionParameters or\n            // RTCRtpHeaderExtension.\n            SDPUtils.writeExtmap = function (headerExtension)\n            {\n                return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) +\n                     ' ' + headerExtension.uri + '\\r\\n';\n            };\n\n            // Parses an ftmp line, returns dictionary. Sample input:\n            // a=fmtp:96 vbr=on;cng=on\n            // Also deals with vbr=on; cng=on\n            SDPUtils.parseFmtp = function (line)\n            {\n                var parsed = {};\n                var kv;\n                var parts = line.substr(line.indexOf(' ') + 1).split(';');\n                for (var j = 0; j < parts.length; j++)\n                {\n                    kv = parts[j].trim().split('=');\n                    parsed[kv[0].trim()] = kv[1];\n                }\n                return parsed;\n            };\n\n            // Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters.\n            SDPUtils.writeFmtp = function (codec)\n            {\n                var line = '';\n                var pt = codec.payloadType;\n                if (codec.preferredPayloadType !== undefined)\n                {\n                    pt = codec.preferredPayloadType;\n                }\n                if (codec.parameters && Object.keys(codec.parameters).length)\n                {\n                    var params = [];\n                    Object.keys(codec.parameters).forEach(function (param)\n                    {\n                        params.push(param + '=' + codec.parameters[param]);\n                    });\n                    line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\\r\\n';\n                }\n                return line;\n            };\n\n            // Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input:\n            // a=rtcp-fb:98 nack rpsi\n            SDPUtils.parseRtcpFb = function (line)\n            {\n                var parts = line.substr(line.indexOf(' ') + 1).split(' ');\n                return {\n                    type: parts.shift(),\n                    parameter: parts.join(' ')\n                };\n            };\n            // Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters.\n            SDPUtils.writeRtcpFb = function (codec)\n            {\n                var lines = '';\n                var pt = codec.payloadType;\n                if (codec.preferredPayloadType !== undefined)\n                {\n                    pt = codec.preferredPayloadType;\n                }\n                if (codec.rtcpFeedback && codec.rtcpFeedback.length)\n                {\n                    // FIXME: special handling for trr-int?\n                    codec.rtcpFeedback.forEach(function (fb)\n                    {\n                        lines += 'a=rtcp-fb:' + pt + ' ' + fb.type + ' ' + fb.parameter +\n                            '\\r\\n';\n                    });\n                }\n                return lines;\n            };\n\n            // Parses an RFC 5576 ssrc media attribute. Sample input:\n            // a=ssrc:3735928559 cname:something\n            SDPUtils.parseSsrcMedia = function (line)\n            {\n                var sp = line.indexOf(' ');\n                var parts = {\n                    ssrc: parseInt(line.substr(7, sp - 7), 10)\n                };\n                var colon = line.indexOf(':', sp);\n                if (colon > -1)\n                {\n                    parts.attribute = line.substr(sp + 1, colon - sp - 1);\n                    parts.value = line.substr(colon + 1);\n                } else\n                {\n                    parts.attribute = line.substr(sp + 1);\n                }\n                return parts;\n            };\n\n            // Extracts DTLS parameters from SDP media section or sessionpart.\n            // FIXME: for consistency with other functions this should only\n            //   get the fingerprint line as input. See also getIceParameters.\n            SDPUtils.getDtlsParameters = function (mediaSection, sessionpart)\n            {\n                var lines = SDPUtils.splitLines(mediaSection);\n                // Search in session part, too.\n                lines = lines.concat(SDPUtils.splitLines(sessionpart));\n                var fpLine = lines.filter(function (line)\n                {\n                    return line.indexOf('a=fingerprint:') === 0;\n                })[0].substr(14);\n                // Note: a=setup line is ignored since we use the 'auto' role.\n                var dtlsParameters = {\n                    role: 'auto',\n                    fingerprints: [{\n                        algorithm: fpLine.split(' ')[0],\n                        value: fpLine.split(' ')[1]\n                    }]\n                };\n                return dtlsParameters;\n            };\n\n            // Serializes DTLS parameters to SDP.\n            SDPUtils.writeDtlsParameters = function (params, setupType)\n            {\n                var sdp = 'a=setup:' + setupType + '\\r\\n';\n                params.fingerprints.forEach(function (fp)\n                {\n                    sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\\r\\n';\n                });\n                return sdp;\n            };\n            // Parses ICE information from SDP media section or sessionpart.\n            // FIXME: for consistency with other functions this should only\n            //   get the ice-ufrag and ice-pwd lines as input.\n            SDPUtils.getIceParameters = function (mediaSection, sessionpart)\n            {\n                var lines = SDPUtils.splitLines(mediaSection);\n                // Search in session part, too.\n                lines = lines.concat(SDPUtils.splitLines(sessionpart));\n                var iceParameters = {\n                    usernameFragment: lines.filter(function (line)\n                    {\n                        return line.indexOf('a=ice-ufrag:') === 0;\n                    })[0].substr(12),\n                    password: lines.filter(function (line)\n                    {\n                        return line.indexOf('a=ice-pwd:') === 0;\n                    })[0].substr(10)\n                };\n                return iceParameters;\n            };\n\n            // Serializes ICE parameters to SDP.\n            SDPUtils.writeIceParameters = function (params)\n            {\n                return 'a=ice-ufrag:' + params.usernameFragment + '\\r\\n' +\n                    'a=ice-pwd:' + params.password + '\\r\\n';\n            };\n\n            // Parses the SDP media section and returns RTCRtpParameters.\n            SDPUtils.parseRtpParameters = function (mediaSection)\n            {\n                var description = {\n                    codecs: [],\n                    headerExtensions: [],\n                    fecMechanisms: [],\n                    rtcp: []\n                };\n                var lines = SDPUtils.splitLines(mediaSection);\n                var mline = lines[0].split(' ');\n                for (var i = 3; i < mline.length; i++)\n                { // find all codecs from mline[3..]\n                    var pt = mline[i];\n                    var rtpmapline = SDPUtils.matchPrefix(\n                        mediaSection, 'a=rtpmap:' + pt + ' ')[0];\n                    if (rtpmapline)\n                    {\n                        var codec = SDPUtils.parseRtpMap(rtpmapline);\n                        var fmtps = SDPUtils.matchPrefix(\n                            mediaSection, 'a=fmtp:' + pt + ' ');\n                        // Only the first a=fmtp:<pt> is considered.\n                        codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {};\n                        codec.rtcpFeedback = SDPUtils.matchPrefix(\n                            mediaSection, 'a=rtcp-fb:' + pt + ' ')\n                          .map(SDPUtils.parseRtcpFb);\n                        description.codecs.push(codec);\n                        // parse FEC mechanisms from rtpmap lines.\n                        switch (codec.name.toUpperCase())\n                        {\n                            case 'RED':\n                            case 'ULPFEC':\n                                description.fecMechanisms.push(codec.name.toUpperCase());\n                                break;\n                            default: // only RED and ULPFEC are recognized as FEC mechanisms.\n                                break;\n                        }\n                    }\n                }\n                SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function (line)\n                {\n                    description.headerExtensions.push(SDPUtils.parseExtmap(line));\n                });\n                // FIXME: parse rtcp.\n                return description;\n            };\n\n            // Generates parts of the SDP media section describing the capabilities /\n            // parameters.\n            SDPUtils.writeRtpDescription = function (kind, caps)\n            {\n                var sdp = '';\n\n                // Build the mline.\n                sdp += 'm=' + kind + ' ';\n                sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs.\n                sdp += ' UDP/TLS/RTP/SAVPF ';\n                sdp += caps.codecs.map(function (codec)\n                {\n                    if (codec.preferredPayloadType !== undefined)\n                    {\n                        return codec.preferredPayloadType;\n                    }\n                    return codec.payloadType;\n                }).join(' ') + '\\r\\n';\n\n                sdp += 'c=IN IP4 0.0.0.0\\r\\n';\n                sdp += 'a=rtcp:9 IN IP4 0.0.0.0\\r\\n';\n\n                // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb.\n                caps.codecs.forEach(function (codec)\n                {\n                    sdp += SDPUtils.writeRtpMap(codec);\n                    sdp += SDPUtils.writeFmtp(codec);\n                    sdp += SDPUtils.writeRtcpFb(codec);\n                });\n                // FIXME: add headerExtensions, fecMechanismş and rtcp.\n                sdp += 'a=rtcp-mux\\r\\n';\n                return sdp;\n            };\n\n            // Parses the SDP media section and returns an array of\n            // RTCRtpEncodingParameters.\n            SDPUtils.parseRtpEncodingParameters = function (mediaSection)\n            {\n                var encodingParameters = [];\n                var description = SDPUtils.parseRtpParameters(mediaSection);\n                var hasRed = description.fecMechanisms.indexOf('RED') !== -1;\n                var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;\n\n                // filter a=ssrc:... cname:, ignore PlanB-msid\n                var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')\n                .map(function (line)\n                {\n                    return SDPUtils.parseSsrcMedia(line);\n                })\n                .filter(function (parts)\n                {\n                    return parts.attribute === 'cname';\n                });\n                var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc;\n                var secondarySsrc;\n\n                var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID')\n                .map(function (line)\n                {\n                    var parts = line.split(' ');\n                    parts.shift();\n                    return parts.map(function (part)\n                    {\n                        return parseInt(part, 10);\n                    });\n                });\n                if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc)\n                {\n                    secondarySsrc = flows[0][1];\n                }\n\n                description.codecs.forEach(function (codec)\n                {\n                    if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt)\n                    {\n                        var encParam = {\n                            ssrc: primarySsrc,\n                            codecPayloadType: parseInt(codec.parameters.apt, 10),\n                            rtx: {\n                                ssrc: secondarySsrc\n                            }\n                        };\n                        encodingParameters.push(encParam);\n                        if (hasRed)\n                        {\n                            encParam = JSON.parse(JSON.stringify(encParam));\n                            encParam.fec = {\n                                ssrc: secondarySsrc,\n                                mechanism: hasUlpfec ? 'red+ulpfec' : 'red'\n                            };\n                            encodingParameters.push(encParam);\n                        }\n                    }\n                });\n                if (encodingParameters.length === 0 && primarySsrc)\n                {\n                    encodingParameters.push({\n                        ssrc: primarySsrc\n                    });\n                }\n\n                // we support both b=AS and b=TIAS but interpret AS as TIAS.\n                var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b=');\n                if (bandwidth.length)\n                {\n                    if (bandwidth[0].indexOf('b=TIAS:') === 0)\n                    {\n                        bandwidth = parseInt(bandwidth[0].substr(7), 10);\n                    } else if (bandwidth[0].indexOf('b=AS:') === 0)\n                    {\n                        bandwidth = parseInt(bandwidth[0].substr(5), 10);\n                    }\n                    encodingParameters.forEach(function (params)\n                    {\n                        params.maxBitrate = bandwidth;\n                    });\n                }\n                return encodingParameters;\n            };\n\n            SDPUtils.writeSessionBoilerplate = function ()\n            {\n                // FIXME: sess-id should be an NTP timestamp.\n                return 'v=0\\r\\n' +\n                    'o=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\\r\\n' +\n                    's=-\\r\\n' +\n                    't=0 0\\r\\n';\n            };\n\n            SDPUtils.writeMediaSection = function (transceiver, caps, type, stream)\n            {\n                var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);\n\n                // Map ICE parameters (ufrag, pwd) to SDP.\n                sdp += SDPUtils.writeIceParameters(\n                    transceiver.iceGatherer.getLocalParameters());\n\n                // Map DTLS parameters to SDP.\n                sdp += SDPUtils.writeDtlsParameters(\n                    transceiver.dtlsTransport.getLocalParameters(),\n                    type === 'offer' ? 'actpass' : 'active');\n\n                sdp += 'a=mid:' + transceiver.mid + '\\r\\n';\n\n                if (transceiver.rtpSender && transceiver.rtpReceiver)\n                {\n                    sdp += 'a=sendrecv\\r\\n';\n                } else if (transceiver.rtpSender)\n                {\n                    sdp += 'a=sendonly\\r\\n';\n                } else if (transceiver.rtpReceiver)\n                {\n                    sdp += 'a=recvonly\\r\\n';\n                } else\n                {\n                    sdp += 'a=inactive\\r\\n';\n                }\n\n                // FIXME: for RTX there might be multiple SSRCs. Not implemented in Edge yet.\n                if (transceiver.rtpSender)\n                {\n                    var msid = 'msid:' + stream.id + ' ' +\n                        transceiver.rtpSender.track.id + '\\r\\n';\n                    sdp += 'a=' + msid;\n                    sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +\n                        ' ' + msid;\n                }\n                // FIXME: this should be written by writeRtpDescription.\n                sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +\n                    ' cname:' + SDPUtils.localCName + '\\r\\n';\n                return sdp;\n            };\n\n            // Gets the direction from the mediaSection or the sessionpart.\n            SDPUtils.getDirection = function (mediaSection, sessionpart)\n            {\n                // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv.\n                var lines = SDPUtils.splitLines(mediaSection);\n                for (var i = 0; i < lines.length; i++)\n                {\n                    switch (lines[i])\n                    {\n                        case 'a=sendrecv':\n                        case 'a=sendonly':\n                        case 'a=recvonly':\n                        case 'a=inactive':\n                            return lines[i].substr(2);\n                        default:\n                            // FIXME: What should happen here?\n                    }\n                }\n                if (sessionpart)\n                {\n                    return SDPUtils.getDirection(sessionpart);\n                }\n                return 'sendrecv';\n            };\n\n            // Expose public methods.\n            module.exports = SDPUtils;\n\n        }, {}], 5: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n\n            var SDPUtils = require('./edge_sdp');\n            var logging = require('../utils').log;\n\n            var edgeShim = {\n                shimPeerConnection: function ()\n                {\n                    if (window.RTCIceGatherer)\n                    {\n                        // ORTC defines an RTCIceCandidate object but no constructor.\n                        // Not implemented in Edge.\n                        if (!window.RTCIceCandidate)\n                        {\n                            window.RTCIceCandidate = function (args)\n                            {\n                                return args;\n                            };\n                        }\n                        // ORTC does not have a session description object but\n                        // other browsers (i.e. Chrome) that will support both PC and ORTC\n                        // in the future might have this defined already.\n                        if (!window.RTCSessionDescription)\n                        {\n                            window.RTCSessionDescription = function (args)\n                            {\n                                return args;\n                            };\n                        }\n                    }\n\n                    window.RTCPeerConnection = function (config)\n                    {\n                        var self = this;\n\n                        var _eventTarget = document.createDocumentFragment();\n                        ['addEventListener', 'removeEventListener', 'dispatchEvent']\n                            .forEach(function (method)\n                            {\n                                self[method] = _eventTarget[method].bind(_eventTarget);\n                            });\n\n                        this.onicecandidate = null;\n                        this.onaddstream = null;\n                        this.ontrack = null;\n                        this.onremovestream = null;\n                        this.onsignalingstatechange = null;\n                        this.oniceconnectionstatechange = null;\n                        this.onnegotiationneeded = null;\n                        this.ondatachannel = null;\n\n                        this.localStreams = [];\n                        this.remoteStreams = [];\n                        this.getLocalStreams = function ()\n                        {\n                            return self.localStreams;\n                        };\n                        this.getRemoteStreams = function ()\n                        {\n                            return self.remoteStreams;\n                        };\n\n                        this.localDescription = new RTCSessionDescription({\n                            type: '',\n                            sdp: ''\n                        });\n                        this.remoteDescription = new RTCSessionDescription({\n                            type: '',\n                            sdp: ''\n                        });\n                        this.signalingState = 'stable';\n                        this.iceConnectionState = 'new';\n                        this.iceGatheringState = 'new';\n\n                        this.iceOptions = {\n                            gatherPolicy: 'all',\n                            iceServers: []\n                        };\n                        if (config && config.iceTransportPolicy)\n                        {\n                            switch (config.iceTransportPolicy)\n                            {\n                                case 'all':\n                                case 'relay':\n                                    this.iceOptions.gatherPolicy = config.iceTransportPolicy;\n                                    break;\n                                case 'none':\n                                    // FIXME: remove once implementation and spec have added this.\n                                    throw new TypeError('iceTransportPolicy \"none\" not supported');\n                                default:\n                                    // don't set iceTransportPolicy.\n                                    break;\n                            }\n                        }\n                        if (config && config.iceServers)\n                        {\n                            // Edge does not like\n                            // 1) stun:\n                            // 2) turn: that does not have all of turn:host:port?transport=udp\n                            this.iceOptions.iceServers = config.iceServers.filter(function (server)\n                            {\n                                if (server && server.urls)\n                                {\n                                    server.urls = server.urls.filter(function (url)\n                                    {\n                                        return url.indexOf('turn:') === 0 &&\n                                            url.indexOf('transport=udp') !== -1;\n                                    })[0];\n                                    return !!server.urls;\n                                }\n                                return false;\n                            });\n                        }\n\n                        // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ...\n                        // everything that is needed to describe a SDP m-line.\n                        this.transceivers = [];\n\n                        // since the iceGatherer is currently created in createOffer but we\n                        // must not emit candidates until after setLocalDescription we buffer\n                        // them in this array.\n                        this._localIceCandidatesBuffer = [];\n                    };\n\n                    window.RTCPeerConnection.prototype._emitBufferedCandidates = function ()\n                    {\n                        var self = this;\n                        var sections = SDPUtils.splitSections(self.localDescription.sdp);\n                        // FIXME: need to apply ice candidates in a way which is async but\n                        // in-order\n                        this._localIceCandidatesBuffer.forEach(function (event)\n                        {\n                            var end = !event.candidate || Object.keys(event.candidate).length === 0;\n                            if (end)\n                            {\n                                for (var j = 1; j < sections.length; j++)\n                                {\n                                    if (sections[j].indexOf('\\r\\na=end-of-candidates\\r\\n') === -1)\n                                    {\n                                        sections[j] += 'a=end-of-candidates\\r\\n';\n                                    }\n                                }\n                            } else if (event.candidate.candidate.indexOf('typ endOfCandidates')\n                                === -1)\n                            {\n                                sections[event.candidate.sdpMLineIndex + 1] +=\n                                    'a=' + event.candidate.candidate + '\\r\\n';\n                            }\n                            self.localDescription.sdp = sections.join('');\n                            self.dispatchEvent(event);\n                            if (self.onicecandidate !== null)\n                            {\n                                self.onicecandidate(event);\n                            }\n                            if (!event.candidate && self.iceGatheringState !== 'complete')\n                            {\n                                var complete = self.transceivers.every(function (transceiver)\n                                {\n                                    return transceiver.iceGatherer &&\n                                        transceiver.iceGatherer.state === 'completed';\n                                });\n                                if (complete)\n                                {\n                                    self.iceGatheringState = 'complete';\n                                }\n                            }\n                        });\n                        this._localIceCandidatesBuffer = [];\n                    };\n\n                    window.RTCPeerConnection.prototype.addStream = function (stream)\n                    {\n                        // Clone is necessary for local demos mostly, attaching directly\n                        // to two different senders does not work (build 10547).\n                        this.localStreams.push(stream.clone());\n                        this._maybeFireNegotiationNeeded();\n                    };\n\n                    window.RTCPeerConnection.prototype.removeStream = function (stream)\n                    {\n                        var idx = this.localStreams.indexOf(stream);\n                        if (idx > -1)\n                        {\n                            this.localStreams.splice(idx, 1);\n                            this._maybeFireNegotiationNeeded();\n                        }\n                    };\n\n                    // Determines the intersection of local and remote capabilities.\n                    window.RTCPeerConnection.prototype._getCommonCapabilities =\n                        function (localCapabilities, remoteCapabilities)\n                        {\n                            var commonCapabilities = {\n                                codecs: [],\n                                headerExtensions: [],\n                                fecMechanisms: []\n                            };\n                            localCapabilities.codecs.forEach(function (lCodec)\n                            {\n                                for (var i = 0; i < remoteCapabilities.codecs.length; i++)\n                                {\n                                    var rCodec = remoteCapabilities.codecs[i];\n                                    if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() &&\n                                        lCodec.clockRate === rCodec.clockRate &&\n                                        lCodec.numChannels === rCodec.numChannels)\n                                    {\n                                        // push rCodec so we reply with offerer payload type\n                                        commonCapabilities.codecs.push(rCodec);\n\n                                        // FIXME: also need to determine intersection between\n                                        // .rtcpFeedback and .parameters\n                                        break;\n                                    }\n                                }\n                            });\n\n                            localCapabilities.headerExtensions\n                                .forEach(function (lHeaderExtension)\n                                {\n                                    for (var i = 0; i < remoteCapabilities.headerExtensions.length;\n                                         i++)\n                                    {\n                                        var rHeaderExtension = remoteCapabilities.headerExtensions[i];\n                                        if (lHeaderExtension.uri === rHeaderExtension.uri)\n                                        {\n                                            commonCapabilities.headerExtensions.push(rHeaderExtension);\n                                            break;\n                                        }\n                                    }\n                                });\n\n                            // FIXME: fecMechanisms\n                            return commonCapabilities;\n                        };\n\n                    // Create ICE gatherer, ICE transport and DTLS transport.\n                    window.RTCPeerConnection.prototype._createIceAndDtlsTransports =\n                        function (mid, sdpMLineIndex)\n                        {\n                            var self = this;\n                            var iceGatherer = new RTCIceGatherer(self.iceOptions);\n                            var iceTransport = new RTCIceTransport(iceGatherer);\n                            iceGatherer.onlocalcandidate = function (evt)\n                            {\n                                var event = new Event('icecandidate');\n                                event.candidate = { sdpMid: mid, sdpMLineIndex: sdpMLineIndex };\n\n                                var cand = evt.candidate;\n                                var end = !cand || Object.keys(cand).length === 0;\n                                // Edge emits an empty object for RTCIceCandidateComplete‥\n                                if (end)\n                                {\n                                    // polyfill since RTCIceGatherer.state is not implemented in\n                                    // Edge 10547 yet.\n                                    if (iceGatherer.state === undefined)\n                                    {\n                                        iceGatherer.state = 'completed';\n                                    }\n\n                                    // Emit a candidate with type endOfCandidates to make the samples\n                                    // work. Edge requires addIceCandidate with this empty candidate\n                                    // to start checking. The real solution is to signal\n                                    // end-of-candidates to the other side when getting the null\n                                    // candidate but some apps (like the samples) don't do that.\n                                    event.candidate.candidate =\n                                        'candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates';\n                                } else\n                                {\n                                    // RTCIceCandidate doesn't have a component, needs to be added\n                                    cand.component = iceTransport.component === 'RTCP' ? 2 : 1;\n                                    event.candidate.candidate = SDPUtils.writeCandidate(cand);\n                                }\n\n                                var complete = self.transceivers.every(function (transceiver)\n                                {\n                                    return transceiver.iceGatherer &&\n                                        transceiver.iceGatherer.state === 'completed';\n                                });\n\n                                // Emit candidate if localDescription is set.\n                                // Also emits null candidate when all gatherers are complete.\n                                switch (self.iceGatheringState)\n                                {\n                                    case 'new':\n                                        self._localIceCandidatesBuffer.push(event);\n                                        if (end && complete)\n                                        {\n                                            self._localIceCandidatesBuffer.push(\n                                                new Event('icecandidate'));\n                                        }\n                                        break;\n                                    case 'gathering':\n                                        self._emitBufferedCandidates();\n                                        self.dispatchEvent(event);\n                                        if (self.onicecandidate !== null)\n                                        {\n                                            self.onicecandidate(event);\n                                        }\n                                        if (complete)\n                                        {\n                                            self.dispatchEvent(new Event('icecandidate'));\n                                            if (self.onicecandidate !== null)\n                                            {\n                                                self.onicecandidate(new Event('icecandidate'));\n                                            }\n                                            self.iceGatheringState = 'complete';\n                                        }\n                                        break;\n                                    case 'complete':\n                                        // should not happen... currently!\n                                        break;\n                                    default: // no-op.\n                                        break;\n                                }\n                            };\n                            iceTransport.onicestatechange = function ()\n                            {\n                                self._updateConnectionState();\n                            };\n\n                            var dtlsTransport = new RTCDtlsTransport(iceTransport);\n                            dtlsTransport.ondtlsstatechange = function ()\n                            {\n                                self._updateConnectionState();\n                            };\n                            dtlsTransport.onerror = function ()\n                            {\n                                // onerror does not set state to failed by itself.\n                                dtlsTransport.state = 'failed';\n                                self._updateConnectionState();\n                            };\n\n                            return {\n                                iceGatherer: iceGatherer,\n                                iceTransport: iceTransport,\n                                dtlsTransport: dtlsTransport\n                            };\n                        };\n\n                    // Start the RTP Sender and Receiver for a transceiver.\n                    window.RTCPeerConnection.prototype._transceive = function (transceiver,\n                        send, recv)\n                    {\n                        var params = this._getCommonCapabilities(transceiver.localCapabilities,\n                            transceiver.remoteCapabilities);\n                        if (send && transceiver.rtpSender)\n                        {\n                            params.encodings = transceiver.sendEncodingParameters;\n                            params.rtcp = {\n                                cname: SDPUtils.localCName\n                            };\n                            if (transceiver.recvEncodingParameters.length)\n                            {\n                                params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc;\n                            }\n                            transceiver.rtpSender.send(params);\n                        }\n                        if (recv && transceiver.rtpReceiver)\n                        {\n                            params.encodings = transceiver.recvEncodingParameters;\n                            params.rtcp = {\n                                cname: transceiver.cname\n                            };\n                            if (transceiver.sendEncodingParameters.length)\n                            {\n                                params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc;\n                            }\n                            transceiver.rtpReceiver.receive(params);\n                        }\n                    };\n\n                    window.RTCPeerConnection.prototype.setLocalDescription =\n                        function (description)\n                        {\n                            var self = this;\n                            var sections;\n                            var sessionpart;\n                            if (description.type === 'offer')\n                            {\n                                // FIXME: What was the purpose of this empty if statement?\n                                // if (!this._pendingOffer) {\n                                // } else {\n                                if (this._pendingOffer)\n                                {\n                                    // VERY limited support for SDP munging. Limited to:\n                                    // * changing the order of codecs\n                                    sections = SDPUtils.splitSections(description.sdp);\n                                    sessionpart = sections.shift();\n                                    sections.forEach(function (mediaSection, sdpMLineIndex)\n                                    {\n                                        var caps = SDPUtils.parseRtpParameters(mediaSection);\n                                        self._pendingOffer[sdpMLineIndex].localCapabilities = caps;\n                                    });\n                                    this.transceivers = this._pendingOffer;\n                                    delete this._pendingOffer;\n                                }\n                            } else if (description.type === 'answer')\n                            {\n                                sections = SDPUtils.splitSections(self.remoteDescription.sdp);\n                                sessionpart = sections.shift();\n                                sections.forEach(function (mediaSection, sdpMLineIndex)\n                                {\n                                    var transceiver = self.transceivers[sdpMLineIndex];\n                                    var iceGatherer = transceiver.iceGatherer;\n                                    var iceTransport = transceiver.iceTransport;\n                                    var dtlsTransport = transceiver.dtlsTransport;\n                                    var localCapabilities = transceiver.localCapabilities;\n                                    var remoteCapabilities = transceiver.remoteCapabilities;\n                                    var rejected = mediaSection.split('\\n', 1)[0]\n                                        .split(' ', 2)[1] === '0';\n\n                                    if (!rejected)\n                                    {\n                                        var remoteIceParameters = SDPUtils.getIceParameters(\n                                            mediaSection, sessionpart);\n                                        iceTransport.start(iceGatherer, remoteIceParameters,\n                                            'controlled');\n\n                                        var remoteDtlsParameters = SDPUtils.getDtlsParameters(\n                                            mediaSection, sessionpart);\n                                        dtlsTransport.start(remoteDtlsParameters);\n\n                                        // Calculate intersection of capabilities.\n                                        var params = self._getCommonCapabilities(localCapabilities,\n                                            remoteCapabilities);\n\n                                        // Start the RTCRtpSender. The RTCRtpReceiver for this\n                                        // transceiver has already been started in setRemoteDescription.\n                                        self._transceive(transceiver,\n                                            params.codecs.length > 0,\n                                            false);\n                                    }\n                                });\n                            }\n\n                            this.localDescription = {\n                                type: description.type,\n                                sdp: description.sdp\n                            };\n                            switch (description.type)\n                            {\n                                case 'offer':\n                                    this._updateSignalingState('have-local-offer');\n                                    break;\n                                case 'answer':\n                                    this._updateSignalingState('stable');\n                                    break;\n                                default:\n                                    throw new TypeError('unsupported type \"' + description.type +\n                                        '\"');\n                            }\n\n                            // If a success callback was provided, emit ICE candidates after it\n                            // has been executed. Otherwise, emit callback after the Promise is\n                            // resolved.\n                            var hasCallback = arguments.length > 1 &&\n                              typeof arguments[1] === 'function';\n                            if (hasCallback)\n                            {\n                                var cb = arguments[1];\n                                window.setTimeout(function ()\n                                {\n                                    cb();\n                                    if (self.iceGatheringState === 'new')\n                                    {\n                                        self.iceGatheringState = 'gathering';\n                                    }\n                                    self._emitBufferedCandidates();\n                                }, 0);\n                            }\n                            var p = Promise.resolve();\n                            p.then(function ()\n                            {\n                                if (!hasCallback)\n                                {\n                                    if (self.iceGatheringState === 'new')\n                                    {\n                                        self.iceGatheringState = 'gathering';\n                                    }\n                                    // Usually candidates will be emitted earlier.\n                                    window.setTimeout(self._emitBufferedCandidates.bind(self), 500);\n                                }\n                            });\n                            return p;\n                        };\n\n                    window.RTCPeerConnection.prototype.setRemoteDescription =\n                        function (description)\n                        {\n                            var self = this;\n                            var stream = new MediaStream();\n                            var receiverList = [];\n                            var sections = SDPUtils.splitSections(description.sdp);\n                            var sessionpart = sections.shift();\n                            sections.forEach(function (mediaSection, sdpMLineIndex)\n                            {\n                                var lines = SDPUtils.splitLines(mediaSection);\n                                var mline = lines[0].substr(2).split(' ');\n                                var kind = mline[0];\n                                var rejected = mline[1] === '0';\n                                var direction = SDPUtils.getDirection(mediaSection, sessionpart);\n\n                                var transceiver;\n                                var iceGatherer;\n                                var iceTransport;\n                                var dtlsTransport;\n                                var rtpSender;\n                                var rtpReceiver;\n                                var sendEncodingParameters;\n                                var recvEncodingParameters;\n                                var localCapabilities;\n\n                                var track;\n                                // FIXME: ensure the mediaSection has rtcp-mux set.\n                                var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection);\n                                var remoteIceParameters;\n                                var remoteDtlsParameters;\n                                if (!rejected)\n                                {\n                                    remoteIceParameters = SDPUtils.getIceParameters(mediaSection,\n                                        sessionpart);\n                                    remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection,\n                                        sessionpart);\n                                }\n                                recvEncodingParameters =\n                                    SDPUtils.parseRtpEncodingParameters(mediaSection);\n\n                                var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:');\n                                if (mid.length)\n                                {\n                                    mid = mid[0].substr(6);\n                                } else\n                                {\n                                    mid = SDPUtils.generateIdentifier();\n                                }\n\n                                var cname;\n                                // Gets the first SSRC. Note that with RTX there might be multiple\n                                // SSRCs.\n                                var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')\n                                    .map(function (line)\n                                    {\n                                        return SDPUtils.parseSsrcMedia(line);\n                                    })\n                                    .filter(function (obj)\n                                    {\n                                        return obj.attribute === 'cname';\n                                    })[0];\n                                if (remoteSsrc)\n                                {\n                                    cname = remoteSsrc.value;\n                                }\n\n                                var isComplete = SDPUtils.matchPrefix(mediaSection,\n                                    'a=end-of-candidates').length > 0;\n                                var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:')\n                                    .map(function (cand)\n                                    {\n                                        return SDPUtils.parseCandidate(cand);\n                                    })\n                                    .filter(function (cand)\n                                    {\n                                        return cand.component === '1';\n                                    });\n                                if (description.type === 'offer' && !rejected)\n                                {\n                                    var transports = self._createIceAndDtlsTransports(mid,\n                                        sdpMLineIndex);\n                                    if (isComplete)\n                                    {\n                                        transports.iceTransport.setRemoteCandidates(cands);\n                                    }\n\n                                    localCapabilities = RTCRtpReceiver.getCapabilities(kind);\n                                    sendEncodingParameters = [{\n                                        ssrc: (2 * sdpMLineIndex + 2) * 1001\n                                    }];\n\n                                    rtpReceiver = new RTCRtpReceiver(transports.dtlsTransport, kind);\n\n                                    track = rtpReceiver.track;\n                                    receiverList.push([track, rtpReceiver]);\n                                    // FIXME: not correct when there are multiple streams but that is\n                                    // not currently supported in this shim.\n                                    stream.addTrack(track);\n\n                                    // FIXME: look at direction.\n                                    if (self.localStreams.length > 0 &&\n                                        self.localStreams[0].getTracks().length >= sdpMLineIndex)\n                                    {\n                                        // FIXME: actually more complicated, needs to match types etc\n                                        var localtrack = self.localStreams[0]\n                                            .getTracks()[sdpMLineIndex];\n                                        rtpSender = new RTCRtpSender(localtrack,\n                                            transports.dtlsTransport);\n                                    }\n\n                                    self.transceivers[sdpMLineIndex] = {\n                                        iceGatherer: transports.iceGatherer,\n                                        iceTransport: transports.iceTransport,\n                                        dtlsTransport: transports.dtlsTransport,\n                                        localCapabilities: localCapabilities,\n                                        remoteCapabilities: remoteCapabilities,\n                                        rtpSender: rtpSender,\n                                        rtpReceiver: rtpReceiver,\n                                        kind: kind,\n                                        mid: mid,\n                                        cname: cname,\n                                        sendEncodingParameters: sendEncodingParameters,\n                                        recvEncodingParameters: recvEncodingParameters\n                                    };\n                                    // Start the RTCRtpReceiver now. The RTPSender is started in\n                                    // setLocalDescription.\n                                    self._transceive(self.transceivers[sdpMLineIndex],\n                                        false,\n                                        direction === 'sendrecv' || direction === 'sendonly');\n                                } else if (description.type === 'answer' && !rejected)\n                                {\n                                    transceiver = self.transceivers[sdpMLineIndex];\n                                    iceGatherer = transceiver.iceGatherer;\n                                    iceTransport = transceiver.iceTransport;\n                                    dtlsTransport = transceiver.dtlsTransport;\n                                    rtpSender = transceiver.rtpSender;\n                                    rtpReceiver = transceiver.rtpReceiver;\n                                    sendEncodingParameters = transceiver.sendEncodingParameters;\n                                    localCapabilities = transceiver.localCapabilities;\n\n                                    self.transceivers[sdpMLineIndex].recvEncodingParameters =\n                                        recvEncodingParameters;\n                                    self.transceivers[sdpMLineIndex].remoteCapabilities =\n                                        remoteCapabilities;\n                                    self.transceivers[sdpMLineIndex].cname = cname;\n\n                                    if (isComplete)\n                                    {\n                                        iceTransport.setRemoteCandidates(cands);\n                                    }\n                                    iceTransport.start(iceGatherer, remoteIceParameters,\n                                        'controlling');\n                                    dtlsTransport.start(remoteDtlsParameters);\n\n                                    self._transceive(transceiver,\n                                        direction === 'sendrecv' || direction === 'recvonly',\n                                        direction === 'sendrecv' || direction === 'sendonly');\n\n                                    if (rtpReceiver &&\n                                        (direction === 'sendrecv' || direction === 'sendonly'))\n                                    {\n                                        track = rtpReceiver.track;\n                                        receiverList.push([track, rtpReceiver]);\n                                        stream.addTrack(track);\n                                    } else\n                                    {\n                                        // FIXME: actually the receiver should be created later.\n                                        delete transceiver.rtpReceiver;\n                                    }\n                                }\n                            });\n\n                            this.remoteDescription = {\n                                type: description.type,\n                                sdp: description.sdp\n                            };\n                            switch (description.type)\n                            {\n                                case 'offer':\n                                    this._updateSignalingState('have-remote-offer');\n                                    break;\n                                case 'answer':\n                                    this._updateSignalingState('stable');\n                                    break;\n                                default:\n                                    throw new TypeError('unsupported type \"' + description.type +\n                                        '\"');\n                            }\n                            if (stream.getTracks().length)\n                            {\n                                self.remoteStreams.push(stream);\n                                window.setTimeout(function ()\n                                {\n                                    var event = new Event('addstream');\n                                    event.stream = stream;\n                                    self.dispatchEvent(event);\n                                    if (self.onaddstream !== null)\n                                    {\n                                        window.setTimeout(function ()\n                                        {\n                                            self.onaddstream(event);\n                                        }, 0);\n                                    }\n\n                                    receiverList.forEach(function (item)\n                                    {\n                                        var track = item[0];\n                                        var receiver = item[1];\n                                        var trackEvent = new Event('track');\n                                        trackEvent.track = track;\n                                        trackEvent.receiver = receiver;\n                                        trackEvent.streams = [stream];\n                                        self.dispatchEvent(event);\n                                        if (self.ontrack !== null)\n                                        {\n                                            window.setTimeout(function ()\n                                            {\n                                                self.ontrack(trackEvent);\n                                            }, 0);\n                                        }\n                                    });\n                                }, 0);\n                            }\n                            if (arguments.length > 1 && typeof arguments[1] === 'function')\n                            {\n                                window.setTimeout(arguments[1], 0);\n                            }\n                            return Promise.resolve();\n                        };\n\n                    window.RTCPeerConnection.prototype.close = function ()\n                    {\n                        this.transceivers.forEach(function (transceiver)\n                        {\n                            /* not yet\n                            if (transceiver.iceGatherer) {\n                              transceiver.iceGatherer.close();\n                            }\n                            */\n                            if (transceiver.iceTransport)\n                            {\n                                transceiver.iceTransport.stop();\n                            }\n                            if (transceiver.dtlsTransport)\n                            {\n                                transceiver.dtlsTransport.stop();\n                            }\n                            if (transceiver.rtpSender)\n                            {\n                                transceiver.rtpSender.stop();\n                            }\n                            if (transceiver.rtpReceiver)\n                            {\n                                transceiver.rtpReceiver.stop();\n                            }\n                        });\n                        // FIXME: clean up tracks, local streams, remote streams, etc\n                        this._updateSignalingState('closed');\n                    };\n\n                    // Update the signaling state.\n                    window.RTCPeerConnection.prototype._updateSignalingState =\n                        function (newState)\n                        {\n                            this.signalingState = newState;\n                            var event = new Event('signalingstatechange');\n                            this.dispatchEvent(event);\n                            if (this.onsignalingstatechange !== null)\n                            {\n                                this.onsignalingstatechange(event);\n                            }\n                        };\n\n                    // Determine whether to fire the negotiationneeded event.\n                    window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded =\n                        function ()\n                        {\n                            // Fire away (for now).\n                            var event = new Event('negotiationneeded');\n                            this.dispatchEvent(event);\n                            if (this.onnegotiationneeded !== null)\n                            {\n                                this.onnegotiationneeded(event);\n                            }\n                        };\n\n                    // Update the connection state.\n                    window.RTCPeerConnection.prototype._updateConnectionState = function ()\n                    {\n                        var self = this;\n                        var newState;\n                        var states = {\n                            'new': 0,\n                            closed: 0,\n                            connecting: 0,\n                            checking: 0,\n                            connected: 0,\n                            completed: 0,\n                            failed: 0\n                        };\n                        this.transceivers.forEach(function (transceiver)\n                        {\n                            states[transceiver.iceTransport.state]++;\n                            states[transceiver.dtlsTransport.state]++;\n                        });\n                        // ICETransport.completed and connected are the same for this purpose.\n                        states.connected += states.completed;\n\n                        newState = 'new';\n                        if (states.failed > 0)\n                        {\n                            newState = 'failed';\n                        } else if (states.connecting > 0 || states.checking > 0)\n                        {\n                            newState = 'connecting';\n                        } else if (states.disconnected > 0)\n                        {\n                            newState = 'disconnected';\n                        } else if (states.new > 0)\n                        {\n                            newState = 'new';\n                        } else if (states.connected > 0 || states.completed > 0)\n                        {\n                            newState = 'connected';\n                        }\n\n                        if (newState !== self.iceConnectionState)\n                        {\n                            self.iceConnectionState = newState;\n                            var event = new Event('iceconnectionstatechange');\n                            this.dispatchEvent(event);\n                            if (this.oniceconnectionstatechange !== null)\n                            {\n                                this.oniceconnectionstatechange(event);\n                            }\n                        }\n                    };\n\n                    window.RTCPeerConnection.prototype.createOffer = function ()\n                    {\n                        var self = this;\n                        if (this._pendingOffer)\n                        {\n                            throw new Error('createOffer called while there is a pending offer.');\n                        }\n                        var offerOptions;\n                        if (arguments.length === 1 && typeof arguments[0] !== 'function')\n                        {\n                            offerOptions = arguments[0];\n                        } else if (arguments.length === 3)\n                        {\n                            offerOptions = arguments[2];\n                        }\n\n                        var tracks = [];\n                        var numAudioTracks = 0;\n                        var numVideoTracks = 0;\n                        // Default to sendrecv.\n                        if (this.localStreams.length)\n                        {\n                            numAudioTracks = this.localStreams[0].getAudioTracks().length;\n                            numVideoTracks = this.localStreams[0].getVideoTracks().length;\n                        }\n                        // Determine number of audio and video tracks we need to send/recv.\n                        if (offerOptions)\n                        {\n                            // Reject Chrome legacy constraints.\n                            if (offerOptions.mandatory || offerOptions.optional)\n                            {\n                                throw new TypeError(\n                                    'Legacy mandatory/optional constraints not supported.');\n                            }\n                            if (offerOptions.offerToReceiveAudio !== undefined)\n                            {\n                                numAudioTracks = offerOptions.offerToReceiveAudio;\n                            }\n                            if (offerOptions.offerToReceiveVideo !== undefined)\n                            {\n                                numVideoTracks = offerOptions.offerToReceiveVideo;\n                            }\n                        }\n                        if (this.localStreams.length)\n                        {\n                            // Push local streams.\n                            this.localStreams[0].getTracks().forEach(function (track)\n                            {\n                                tracks.push({\n                                    kind: track.kind,\n                                    track: track,\n                                    wantReceive: track.kind === 'audio' ?\n                                        numAudioTracks > 0 : numVideoTracks > 0\n                                });\n                                if (track.kind === 'audio')\n                                {\n                                    numAudioTracks--;\n                                } else if (track.kind === 'video')\n                                {\n                                    numVideoTracks--;\n                                }\n                            });\n                        }\n                        // Create M-lines for recvonly streams.\n                        while (numAudioTracks > 0 || numVideoTracks > 0)\n                        {\n                            if (numAudioTracks > 0)\n                            {\n                                tracks.push({\n                                    kind: 'audio',\n                                    wantReceive: true\n                                });\n                                numAudioTracks--;\n                            }\n                            if (numVideoTracks > 0)\n                            {\n                                tracks.push({\n                                    kind: 'video',\n                                    wantReceive: true\n                                });\n                                numVideoTracks--;\n                            }\n                        }\n\n                        var sdp = SDPUtils.writeSessionBoilerplate();\n                        var transceivers = [];\n                        tracks.forEach(function (mline, sdpMLineIndex)\n                        {\n                            // For each track, create an ice gatherer, ice transport,\n                            // dtls transport, potentially rtpsender and rtpreceiver.\n                            var track = mline.track;\n                            var kind = mline.kind;\n                            var mid = SDPUtils.generateIdentifier();\n\n                            var transports = self._createIceAndDtlsTransports(mid, sdpMLineIndex);\n\n                            var localCapabilities = RTCRtpSender.getCapabilities(kind);\n                            var rtpSender;\n                            var rtpReceiver;\n\n                            // generate an ssrc now, to be used later in rtpSender.send\n                            var sendEncodingParameters = [{\n                                ssrc: (2 * sdpMLineIndex + 1) * 1001\n                            }];\n                            if (track)\n                            {\n                                rtpSender = new RTCRtpSender(track, transports.dtlsTransport);\n                            }\n\n                            if (mline.wantReceive)\n                            {\n                                rtpReceiver = new RTCRtpReceiver(transports.dtlsTransport, kind);\n                            }\n\n                            transceivers[sdpMLineIndex] = {\n                                iceGatherer: transports.iceGatherer,\n                                iceTransport: transports.iceTransport,\n                                dtlsTransport: transports.dtlsTransport,\n                                localCapabilities: localCapabilities,\n                                remoteCapabilities: null,\n                                rtpSender: rtpSender,\n                                rtpReceiver: rtpReceiver,\n                                kind: kind,\n                                mid: mid,\n                                sendEncodingParameters: sendEncodingParameters,\n                                recvEncodingParameters: null\n                            };\n                            var transceiver = transceivers[sdpMLineIndex];\n                            sdp += SDPUtils.writeMediaSection(transceiver,\n                                transceiver.localCapabilities, 'offer', self.localStreams[0]);\n                        });\n\n                        this._pendingOffer = transceivers;\n                        var desc = new RTCSessionDescription({\n                            type: 'offer',\n                            sdp: sdp\n                        });\n                        if (arguments.length && typeof arguments[0] === 'function')\n                        {\n                            window.setTimeout(arguments[0], 0, desc);\n                        }\n                        return Promise.resolve(desc);\n                    };\n\n                    window.RTCPeerConnection.prototype.createAnswer = function ()\n                    {\n                        var self = this;\n\n                        var sdp = SDPUtils.writeSessionBoilerplate();\n                        this.transceivers.forEach(function (transceiver)\n                        {\n                            // Calculate intersection of capabilities.\n                            var commonCapabilities = self._getCommonCapabilities(\n                                transceiver.localCapabilities,\n                                transceiver.remoteCapabilities);\n\n                            sdp += SDPUtils.writeMediaSection(transceiver, commonCapabilities,\n                                'answer', self.localStreams[0]);\n                        });\n\n                        var desc = new RTCSessionDescription({\n                            type: 'answer',\n                            sdp: sdp\n                        });\n                        if (arguments.length && typeof arguments[0] === 'function')\n                        {\n                            window.setTimeout(arguments[0], 0, desc);\n                        }\n                        return Promise.resolve(desc);\n                    };\n\n                    window.RTCPeerConnection.prototype.addIceCandidate = function (candidate)\n                    {\n                        var mLineIndex = candidate.sdpMLineIndex;\n                        if (candidate.sdpMid)\n                        {\n                            for (var i = 0; i < this.transceivers.length; i++)\n                            {\n                                if (this.transceivers[i].mid === candidate.sdpMid)\n                                {\n                                    mLineIndex = i;\n                                    break;\n                                }\n                            }\n                        }\n                        var transceiver = this.transceivers[mLineIndex];\n                        if (transceiver)\n                        {\n                            var cand = Object.keys(candidate.candidate).length > 0 ?\n                                SDPUtils.parseCandidate(candidate.candidate) : {};\n                            // Ignore Chrome's invalid candidates since Edge does not like them.\n                            if (cand.protocol === 'tcp' && cand.port === 0)\n                            {\n                                return;\n                            }\n                            // Ignore RTCP candidates, we assume RTCP-MUX.\n                            if (cand.component !== '1')\n                            {\n                                return;\n                            }\n                            // A dirty hack to make samples work.\n                            if (cand.type === 'endOfCandidates')\n                            {\n                                cand = {};\n                            }\n                            transceiver.iceTransport.addRemoteCandidate(cand);\n\n                            // update the remoteDescription.\n                            var sections = SDPUtils.splitSections(this.remoteDescription.sdp);\n                            sections[mLineIndex + 1] += (cand.type ? candidate.candidate.trim()\n                                : 'a=end-of-candidates') + '\\r\\n';\n                            this.remoteDescription.sdp = sections.join('');\n                        }\n                        if (arguments.length > 1 && typeof arguments[1] === 'function')\n                        {\n                            window.setTimeout(arguments[1], 0);\n                        }\n                        return Promise.resolve();\n                    };\n\n                    window.RTCPeerConnection.prototype.getStats = function ()\n                    {\n                        var promises = [];\n                        this.transceivers.forEach(function (transceiver)\n                        {\n                            ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport',\n                                'dtlsTransport'].forEach(function (method)\n                                {\n                                    if (transceiver[method])\n                                    {\n                                        promises.push(transceiver[method].getStats());\n                                    }\n                                });\n                        });\n                        var cb = arguments.length > 1 && typeof arguments[1] === 'function' &&\n                            arguments[1];\n                        return new Promise(function (resolve)\n                        {\n                            var results = {};\n                            Promise.all(promises).then(function (res)\n                            {\n                                res.forEach(function (result)\n                                {\n                                    Object.keys(result).forEach(function (id)\n                                    {\n                                        results[id] = result[id];\n                                    });\n                                });\n                                if (cb)\n                                {\n                                    window.setTimeout(cb, 0, results);\n                                }\n                                resolve(results);\n                            });\n                        });\n                    };\n                },\n\n                // Attach a media stream to an element.\n                attachMediaStream: function (element, stream)\n                {\n                    logging('DEPRECATED, attachMediaStream will soon be removed.');\n                    element.srcObject = stream;\n                },\n\n                reattachMediaStream: function (to, from)\n                {\n                    logging('DEPRECATED, reattachMediaStream will soon be removed.');\n                    to.srcObject = from.srcObject;\n                }\n            };\n\n            // Expose public methods.\n            module.exports = {\n                shimPeerConnection: edgeShim.shimPeerConnection,\n                attachMediaStream: edgeShim.attachMediaStream,\n                reattachMediaStream: edgeShim.reattachMediaStream\n            };\n\n        }, { \"../utils\": 9, \"./edge_sdp\": 4 }], 6: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n\n            var logging = require('../utils').log;\n            var browserDetails = require('../utils').browserDetails;\n\n            var firefoxShim = {\n                shimOnTrack: function ()\n                {\n                    if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in\n                        window.RTCPeerConnection.prototype))\n                    {\n                        Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n                            get: function ()\n                            {\n                                return this._ontrack;\n                            },\n                            set: function (f)\n                            {\n                                if (this._ontrack)\n                                {\n                                    this.removeEventListener('track', this._ontrack);\n                                    this.removeEventListener('addstream', this._ontrackpoly);\n                                }\n                                this.addEventListener('track', this._ontrack = f);\n                                this.addEventListener('addstream', this._ontrackpoly = function (e)\n                                {\n                                    e.stream.getTracks().forEach(function (track)\n                                    {\n                                        var event = new Event('track');\n                                        event.track = track;\n                                        event.receiver = { track: track };\n                                        event.streams = [e.stream];\n                                        this.dispatchEvent(event);\n                                    }.bind(this));\n                                }.bind(this));\n                            }\n                        });\n                    }\n                },\n\n                shimSourceObject: function ()\n                {\n                    // Firefox has supported mozSrcObject since FF22, unprefixed in 42.\n                    if (typeof window === 'object')\n                    {\n                        if (window.HTMLMediaElement &&\n                          !('srcObject' in window.HTMLMediaElement.prototype))\n                        {\n                            // Shim the srcObject property, once, when HTMLMediaElement is found.\n                            Object.defineProperty(window.HTMLMediaElement.prototype, 'srcObject', {\n                                get: function ()\n                                {\n                                    return this.mozSrcObject;\n                                },\n                                set: function (stream)\n                                {\n                                    this.mozSrcObject = stream;\n                                }\n                            });\n                        }\n                    }\n                },\n\n                shimPeerConnection: function ()\n                {\n                    // The RTCPeerConnection object.\n                    if (!window.RTCPeerConnection)\n                    {\n                        window.RTCPeerConnection = function (pcConfig, pcConstraints)\n                        {\n                            if (browserDetails.version < 38)\n                            {\n                                // .urls is not supported in FF < 38.\n                                // create RTCIceServers with a single url.\n                                if (pcConfig && pcConfig.iceServers)\n                                {\n                                    var newIceServers = [];\n                                    for (var i = 0; i < pcConfig.iceServers.length; i++)\n                                    {\n                                        var server = pcConfig.iceServers[i];\n                                        if (server.hasOwnProperty('urls'))\n                                        {\n                                            for (var j = 0; j < server.urls.length; j++)\n                                            {\n                                                var newServer = {\n                                                    url: server.urls[j]\n                                                };\n                                                if (server.urls[j].indexOf('turn') === 0)\n                                                {\n                                                    newServer.username = server.username;\n                                                    newServer.credential = server.credential;\n                                                }\n                                                newIceServers.push(newServer);\n                                            }\n                                        } else\n                                        {\n                                            newIceServers.push(pcConfig.iceServers[i]);\n                                        }\n                                    }\n                                    pcConfig.iceServers = newIceServers;\n                                }\n                            }\n                            return new mozRTCPeerConnection(pcConfig, pcConstraints);\n                        };\n                        window.RTCPeerConnection.prototype = mozRTCPeerConnection.prototype;\n\n                        // wrap static methods. Currently just generateCertificate.\n                        if (mozRTCPeerConnection.generateCertificate)\n                        {\n                            Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {\n                                get: function ()\n                                {\n                                    return mozRTCPeerConnection.generateCertificate;\n                                }\n                            });\n                        }\n\n                        window.RTCSessionDescription = mozRTCSessionDescription;\n                        window.RTCIceCandidate = mozRTCIceCandidate;\n                    }\n\n                    // shim away need for obsolete RTCIceCandidate/RTCSessionDescription.\n                    ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n                        .forEach(function (method)\n                        {\n                            var nativeMethod = RTCPeerConnection.prototype[method];\n                            RTCPeerConnection.prototype[method] = function ()\n                            {\n                                arguments[0] = new ((method === 'addIceCandidate') ?\n                                    RTCIceCandidate : RTCSessionDescription)(arguments[0]);\n                                return nativeMethod.apply(this, arguments);\n                            };\n                        });\n                },\n\n                shimGetUserMedia: function ()\n                {\n                    // getUserMedia constraints shim.\n                    var getUserMedia_ = function (constraints, onSuccess, onError)\n                    {\n                        var constraintsToFF37_ = function (c)\n                        {\n                            if (typeof c !== 'object' || c.require)\n                            {\n                                return c;\n                            }\n                            var require = [];\n                            Object.keys(c).forEach(function (key)\n                            {\n                                if (key === 'require' || key === 'advanced' ||\n                                    key === 'mediaSource')\n                                {\n                                    return;\n                                }\n                                var r = c[key] = (typeof c[key] === 'object') ?\n                                    c[key] : { ideal: c[key] };\n                                if (r.min !== undefined ||\n                                    r.max !== undefined || r.exact !== undefined)\n                                {\n                                    require.push(key);\n                                }\n                                if (r.exact !== undefined)\n                                {\n                                    if (typeof r.exact === 'number')\n                                    {\n                                        r.min = r.max = r.exact;\n                                    } else\n                                    {\n                                        c[key] = r.exact;\n                                    }\n                                    delete r.exact;\n                                }\n                                if (r.ideal !== undefined)\n                                {\n                                    c.advanced = c.advanced || [];\n                                    var oc = {};\n                                    if (typeof r.ideal === 'number')\n                                    {\n                                        oc[key] = { min: r.ideal, max: r.ideal };\n                                    } else\n                                    {\n                                        oc[key] = r.ideal;\n                                    }\n                                    c.advanced.push(oc);\n                                    delete r.ideal;\n                                    if (!Object.keys(r).length)\n                                    {\n                                        delete c[key];\n                                    }\n                                }\n                            });\n                            if (require.length)\n                            {\n                                c.require = require;\n                            }\n                            return c;\n                        };\n                        constraints = JSON.parse(JSON.stringify(constraints));\n                        if (browserDetails.version < 38)\n                        {\n                            logging('spec: ' + JSON.stringify(constraints));\n                            if (constraints.audio)\n                            {\n                                constraints.audio = constraintsToFF37_(constraints.audio);\n                            }\n                            if (constraints.video)\n                            {\n                                constraints.video = constraintsToFF37_(constraints.video);\n                            }\n                            logging('ff37: ' + JSON.stringify(constraints));\n                        }\n                        return navigator.mozGetUserMedia(constraints, onSuccess, onError);\n                    };\n\n                    navigator.getUserMedia = getUserMedia_;\n\n                    // Returns the result of getUserMedia as a Promise.\n                    var getUserMediaPromise_ = function (constraints)\n                    {\n                        return new Promise(function (resolve, reject)\n                        {\n                            navigator.getUserMedia(constraints, resolve, reject);\n                        });\n                    };\n\n                    // Shim for mediaDevices on older versions.\n                    if (!navigator.mediaDevices)\n                    {\n                        navigator.mediaDevices = {\n                            getUserMedia: getUserMediaPromise_,\n                            addEventListener: function () { },\n                            removeEventListener: function () { }\n                        };\n                    }\n                    navigator.mediaDevices.enumerateDevices =\n                        navigator.mediaDevices.enumerateDevices || function ()\n                        {\n                            return new Promise(function (resolve)\n                            {\n                                var infos = [\n                                  { kind: 'audioinput', deviceId: 'default', label: '', groupId: '' },\n                                  { kind: 'videoinput', deviceId: 'default', label: '', groupId: '' }\n                                ];\n                                resolve(infos);\n                            });\n                        };\n\n                    if (browserDetails.version < 41)\n                    {\n                        // Work around http://bugzil.la/1169665\n                        var orgEnumerateDevices =\n                            navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);\n                        navigator.mediaDevices.enumerateDevices = function ()\n                        {\n                            return orgEnumerateDevices().then(undefined, function (e)\n                            {\n                                if (e.name === 'NotFoundError')\n                                {\n                                    return [];\n                                }\n                                throw e;\n                            });\n                        };\n                    }\n                },\n\n                // Attach a media stream to an element.\n                attachMediaStream: function (element, stream)\n                {\n                    logging('DEPRECATED, attachMediaStream will soon be removed.');\n                    element.srcObject = stream;\n                },\n\n                reattachMediaStream: function (to, from)\n                {\n                    logging('DEPRECATED, reattachMediaStream will soon be removed.');\n                    to.srcObject = from.srcObject;\n                }\n            };\n\n            // Expose public methods.\n            module.exports = {\n                shimOnTrack: firefoxShim.shimOnTrack,\n                shimSourceObject: firefoxShim.shimSourceObject,\n                shimPeerConnection: firefoxShim.shimPeerConnection,\n                shimGetUserMedia: require('./getusermedia'),\n                attachMediaStream: firefoxShim.attachMediaStream,\n                reattachMediaStream: firefoxShim.reattachMediaStream\n            };\n\n        }, { \"../utils\": 9, \"./getusermedia\": 7 }], 7: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n\n            var logging = require('../utils').log;\n            var browserDetails = require('../utils').browserDetails;\n\n            // Expose public methods.\n            module.exports = function ()\n            {\n                // getUserMedia constraints shim.\n                var getUserMedia_ = function (constraints, onSuccess, onError)\n                {\n                    var constraintsToFF37_ = function (c)\n                    {\n                        if (typeof c !== 'object' || c.require)\n                        {\n                            return c;\n                        }\n                        var require = [];\n                        Object.keys(c).forEach(function (key)\n                        {\n                            if (key === 'require' || key === 'advanced' || key === 'mediaSource')\n                            {\n                                return;\n                            }\n                            var r = c[key] = (typeof c[key] === 'object') ?\n                                c[key] : { ideal: c[key] };\n                            if (r.min !== undefined ||\n                                r.max !== undefined || r.exact !== undefined)\n                            {\n                                require.push(key);\n                            }\n                            if (r.exact !== undefined)\n                            {\n                                if (typeof r.exact === 'number')\n                                {\n                                    r.min = r.max = r.exact;\n                                } else\n                                {\n                                    c[key] = r.exact;\n                                }\n                                delete r.exact;\n                            }\n                            if (r.ideal !== undefined)\n                            {\n                                c.advanced = c.advanced || [];\n                                var oc = {};\n                                if (typeof r.ideal === 'number')\n                                {\n                                    oc[key] = { min: r.ideal, max: r.ideal };\n                                } else\n                                {\n                                    oc[key] = r.ideal;\n                                }\n                                c.advanced.push(oc);\n                                delete r.ideal;\n                                if (!Object.keys(r).length)\n                                {\n                                    delete c[key];\n                                }\n                            }\n                        });\n                        if (require.length)\n                        {\n                            c.require = require;\n                        }\n                        return c;\n                    };\n                    constraints = JSON.parse(JSON.stringify(constraints));\n                    if (browserDetails.version < 38)\n                    {\n                        logging('spec: ' + JSON.stringify(constraints));\n                        if (constraints.audio)\n                        {\n                            constraints.audio = constraintsToFF37_(constraints.audio);\n                        }\n                        if (constraints.video)\n                        {\n                            constraints.video = constraintsToFF37_(constraints.video);\n                        }\n                        logging('ff37: ' + JSON.stringify(constraints));\n                    }\n                    return navigator.mozGetUserMedia(constraints, onSuccess, onError);\n                };\n\n                navigator.getUserMedia = getUserMedia_;\n\n                // Returns the result of getUserMedia as a Promise.\n                var getUserMediaPromise_ = function (constraints)\n                {\n                    return new Promise(function (resolve, reject)\n                    {\n                        navigator.getUserMedia(constraints, resolve, reject);\n                    });\n                };\n\n                // Shim for mediaDevices on older versions.\n                if (!navigator.mediaDevices)\n                {\n                    navigator.mediaDevices = {\n                        getUserMedia: getUserMediaPromise_,\n                        addEventListener: function () { },\n                        removeEventListener: function () { }\n                    };\n                }\n                navigator.mediaDevices.enumerateDevices =\n                    navigator.mediaDevices.enumerateDevices || function ()\n                    {\n                        return new Promise(function (resolve)\n                        {\n                            var infos = [\n                              { kind: 'audioinput', deviceId: 'default', label: '', groupId: '' },\n                              { kind: 'videoinput', deviceId: 'default', label: '', groupId: '' }\n                            ];\n                            resolve(infos);\n                        });\n                    };\n\n                if (browserDetails.version < 41)\n                {\n                    // Work around http://bugzil.la/1169665\n                    var orgEnumerateDevices =\n                        navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);\n                    navigator.mediaDevices.enumerateDevices = function ()\n                    {\n                        return orgEnumerateDevices().then(undefined, function (e)\n                        {\n                            if (e.name === 'NotFoundError')\n                            {\n                                return [];\n                            }\n                            throw e;\n                        });\n                    };\n                }\n            };\n\n        }, { \"../utils\": 9 }], 8: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            'use strict';\n            var safariShim = {\n                // TODO: DrAlex, should be here, double check against LayoutTests\n                // shimOnTrack: function() { },\n\n                // TODO: DrAlex\n                // attachMediaStream: function(element, stream) { },\n                // reattachMediaStream: function(to, from) { },\n\n                // TODO: once the back-end for the mac port is done, add.\n                // TODO: check for webkitGTK+\n                // shimPeerConnection: function() { },\n\n                shimGetUserMedia: function ()\n                {\n                    navigator.getUserMedia = navigator.webkitGetUserMedia;\n                }\n            };\n\n            // Expose public methods.\n            module.exports = {\n                shimGetUserMedia: safariShim.shimGetUserMedia\n                // TODO\n                // shimOnTrack: safariShim.shimOnTrack,\n                // shimPeerConnection: safariShim.shimPeerConnection,\n                // attachMediaStream: safariShim.attachMediaStream,\n                // reattachMediaStream: safariShim.reattachMediaStream\n            };\n\n        }, {}], 9: [function (require, module, exports)\n        {\n            /*\n             *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n             *\n             *  Use of this source code is governed by a BSD-style license\n             *  that can be found in the LICENSE file in the root of the source\n             *  tree.\n             */\n            /* eslint-env node */\n            'use strict';\n\n            var logDisabled_ = false;\n\n            // Utility methods.\n            var utils = {\n                disableLog: function (bool)\n                {\n                    if (typeof bool !== 'boolean')\n                    {\n                        return new Error('Argument type: ' + typeof bool +\n                            '. Please use a boolean.');\n                    }\n                    logDisabled_ = bool;\n                    return (bool) ? 'adapter.js logging disabled' :\n                        'adapter.js logging enabled';\n                },\n\n                log: function ()\n                {\n                    if (typeof window === 'object')\n                    {\n                        if (logDisabled_)\n                        {\n                            return;\n                        }\n                        if (typeof console !== 'undefined' && typeof console.log === 'function')\n                        {\n                            console.log.apply(console, arguments);\n                        }\n                    }\n                },\n\n                /**\n                 * Extract browser version out of the provided user agent string.\n                 *\n                 * @param {!string} uastring userAgent string.\n                 * @param {!string} expr Regular expression used as match criteria.\n                 * @param {!number} pos position in the version string to be returned.\n                 * @return {!number} browser version.\n                 */\n                extractVersion: function (uastring, expr, pos)\n                {\n                    var match = uastring.match(expr);\n                    return match && match.length >= pos && parseInt(match[pos], 10);\n                },\n\n                /**\n                 * Browser detector.\n                 *\n                 * @return {object} result containing browser, version and minVersion\n                 *     properties.\n                 */\n                detectBrowser: function ()\n                {\n                    // Returned result object.\n                    var result = {};\n                    result.browser = null;\n                    result.version = null;\n                    result.minVersion = null;\n\n                    // Fail early if it's not a browser\n                    if (typeof window === 'undefined' || !window.navigator)\n                    {\n                        result.browser = 'Not a browser.';\n                        return result;\n                    }\n\n                    // Firefox.\n                    if (navigator.mozGetUserMedia)\n                    {\n                        result.browser = 'firefox';\n                        result.version = this.extractVersion(navigator.userAgent,\n                            /Firefox\\/([0-9]+)\\./, 1);\n                        result.minVersion = 31;\n\n                        // all webkit-based browsers\n                    } else if (navigator.webkitGetUserMedia)\n                    {\n                        // Chrome, Chromium, Webview, Opera, all use the chrome shim for now\n                        if (window.webkitRTCPeerConnection)\n                        {\n                            result.browser = 'chrome';\n                            result.version = this.extractVersion(navigator.userAgent,\n                              /Chrom(e|ium)\\/([0-9]+)\\./, 2);\n                            result.minVersion = 38;\n\n                            // Safari or unknown webkit-based\n                            // for the time being Safari has support for MediaStreams but not webRTC\n                        } else\n                        {\n                            // Safari UA substrings of interest for reference:\n                            // - webkit version:           AppleWebKit/602.1.25 (also used in Op,Cr)\n                            // - safari UI version:        Version/9.0.3 (unique to Safari)\n                            // - safari UI webkit version: Safari/601.4.4 (also used in Op,Cr)\n                            //\n                            // if the webkit version and safari UI webkit versions are equals,\n                            // ... this is a stable version.\n                            //\n                            // only the internal webkit version is important today to know if\n                            // media streams are supported\n                            //\n                            if (navigator.userAgent.match(/Version\\/(\\d+).(\\d+)/))\n                            {\n                                result.browser = 'safari';\n                                result.version = this.extractVersion(navigator.userAgent,\n                                  /AppleWebKit\\/([0-9]+)\\./, 1);\n                                result.minVersion = 602;\n\n                                // unknown webkit-based browser\n                            } else\n                            {\n                                result.browser = 'Unsupported webkit-based browser ' +\n                                    'with GUM support but no WebRTC support.';\n                                return result;\n                            }\n                        }\n\n                        // Edge.\n                    } else if (navigator.mediaDevices &&\n                        navigator.userAgent.match(/Edge\\/(\\d+).(\\d+)$/))\n                    {\n                        result.browser = 'edge';\n                        result.version = this.extractVersion(navigator.userAgent,\n                            /Edge\\/(\\d+).(\\d+)$/, 2);\n                        result.minVersion = 10547;\n\n                        // Default fallthrough: not supported.\n                    } else\n                    {\n                        result.browser = 'Not a supported browser.';\n                        return result;\n                    }\n\n                    // Warn if version is less than minVersion.\n                    if (result.version < result.minVersion)\n                    {\n                        utils.log('Browser: ' + result.browser + ' Version: ' + result.version +\n                            ' < minimum supported version: ' + result.minVersion +\n                            '\\n some things might not work!');\n                    }\n\n                    return result;\n                }\n            };\n\n            // Export.\n            module.exports = {\n                log: utils.log,\n                disableLog: utils.disableLog,\n                browserDetails: utils.detectBrowser(),\n                extractVersion: utils.extractVersion\n            };\n\n        }, {}]\n    }, {}, [1])(1)\n});"
  },
  {
    "path": "rtc/whiteboard/src/blink-wb.html",
    "content": "<!DOCTYPE html>\r\n<html>\r\n\r\n<head>\r\n\t<title>whiteboard</title>\r\n\r\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"requiresActiveX=true;IE=edge;chrome=1\">\r\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf8\" />\r\n\t<meta http-equiv=\"Cache-Control\" content=\"public\" />\r\n\t<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\r\n\t<meta name=\"viewport\" id=\"viewport\" content=\"user-scalable=no\" />\r\n\r\n\t<link rel=\"stylesheet\" href=\"css/enyo.css\">\r\n\t<link rel=\"stylesheet\" href=\"css/app.css\">\r\n\t<link rel=\"stylesheet\" href=\"css/main.css\">\r\n\t<link rel=\"stylesheet\" href=\"css/uploadfile.css\">\r\n\t<link rel=\"stylesheet\" href=\"css/jquery-confirm.min.css\">\r\n\t<link rel=\"stylesheet\" href=\"css/sweetalert.css\">\r\n\t<link rel=\"stylesheet\" href=\"css/style.css\">\r\n\r\n\t<script type=\"text/javascript\" src=\"js/jquery-1.12.0.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/jquery-confirm.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/jquery.form.min.js\"></script>\r\n\t<!-- <script type=\"text/javascript\" src=\"js/jquery.uploadfile.min.js\"></script> -->\r\n\t<script type=\"text/javascript\" src=\"js/jquery.noty.packaged.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/canvg.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/d3.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/draggabilly.pkgd.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/jsxcompressor.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/Queue.src.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/raphael-min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/raphael.export.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/raphael.inline_text_editing.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/rgbcolor.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/scale.raphael.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/StackBlur.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/sweetalert.min.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/hammer.min.js\"></script>\r\n\r\n\t<script type=\"text/javascript\" src=\"js/lib/enyo.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/lib/enyo-ilib.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/lib/layout.js\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/lib/onyx.js\"></script>\r\n\r\n\t<script type=\"text/javascript\" src=\"config.js?v=20180507\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/common.js?v=20180507\"></script>\r\n\t<script type=\"text/javascript\">\r\n\t\tvar ewb_server_path = global_config.server_path;\r\n\t\tvar ewb_file_server_path = global_config.file_server_path;\r\n\t\tvar ewb_load_interval = global_config.load_interval;\r\n\t\tvar ewb_width = global_config.width;\r\n\t\tvar ewb_height = global_config.height;\r\n\r\n\t\tvar ewb_roomKey = getParameterByName('roomKey');\r\n\t\tvar ewb_token = getParameterByName('token');\r\n\t\tvar ewb_clientType = getParameterByName('type');\r\n\t\tvar ewb_role = getParameterByName('role');\r\n\t\tvar ewb_userId = getParameterByName('userId');\r\n\t\tif (ewb_userId == null || ewb_userId == '') {\r\n\t\t\tewb_userId = guid();\r\n\t\t}\r\n\t</script>\r\n\r\n\t<script type=\"text/javascript\" src=\"js/ewb/WhiteBoardApi.js?v=20180507\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/ewb/App.js?v=20180507\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/ewb/Svg.js?v=20180507\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/ewb/Connection.js?v=20180507\"></script>\r\n\t<script type=\"text/javascript\" src=\"js/blink/blinkEwb.js?v=20180507\"></script>\r\n\r\n\t<script type=\"text/javascript\">\r\n\t\t$(document).ready(function () {\r\n\t\t\t/* Call WhiteBoardApi */\r\n\t\t\tvar api = new WhiteBoardApi();\r\n\t\t\tapi.canvasWidth = ewb_width;\r\n\t\t\tapi.canvasHeight = ewb_height;\r\n\t\t\tapi.canvasNode = document.querySelector('.rong-whiteborad');\r\n\t\t\tvar params = {\r\n\t\t\t\trole: ewb_role\r\n\t\t\t};\r\n\t\t\tapi.join(params);\r\n\r\n\t\t\t// 根据底部工具栏宽度调整间距\r\n\t\t\tif (!api.app.isMobile() && !api.app.isGuest()) {\r\n\t\t\t\tresizeBottomToolBar();\r\n\t\t\t}\r\n\t\t\t// 监听窗口大小变化\r\n\t\t\t$(window).resize(function () {\r\n\t\t\t\twaitForFinalEvent(function () {\r\n\t\t\t\t\tconsole.debug(\"window resize\");\r\n\t\t\t\t\t// 根据底部工具栏宽度调整间距\r\n\t\t\t\t\tif (!api.app.isMobile() && !api.app.isGuest()) {\r\n\t\t\t\t\t\tresizeBottomToolBar();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// 设置缩放率\r\n\t\t\t\t\tapi.app.whiteboard.setZoomRatioCustom();\r\n\t\t\t\t\t// 调整面板\r\n\t\t\t\t\tapi.app.whiteboard.zoomReduction();\r\n\t\t\t\t}, 500, \"some unique string\");\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * 根据底部工具栏宽度调整间距\r\n\t\t *\r\n\t\t */\r\n\t\tfunction resizeBottomToolBar() {\r\n\t\t\t// 原始大小\r\n\t\t\tvar marginLeft = \"6px\";\r\n\t\t\tvar marginRight = \"6px\";\r\n\t\t\tvar parent_paddingLeft = \"8px\";\r\n\t\t\tvar parent_paddingRight = \"8px\";\r\n\t\t\tvar button_padding = \"18px\";\r\n\t\t\tvar bottomToolBarClient = $(\"#app_bottomToolbar_client\");\r\n\t\t\tvar bottomToolBar = bottomToolBarClient.parent();\r\n\t\t\tvar bottomToolBarClient_width = bottomToolBarClient.width();\r\n\t\t\tif (bottomToolBarClient_width < 650) {\r\n\t\t\t\tif ($(\"#app_middleFittableRows\").height() == 393) {\r\n\t\t\t\t\t$(\"#app_middleFittableRows\").css({ \"height\": 394 })\r\n\t\t\t\t}\r\n\t\t\t\tmarginLeft = \"-1px\";\r\n\t\t\t\tmarginRight = \"-1px\";\r\n\t\t\t\tparent_paddingLeft = \"1px\";\r\n\t\t\t\tparent_paddingRight = \"1px\";\r\n\t\t\t\tbutton_padding = \"16px\";\r\n\t\t\t\tbottomToolBarClient.css({\r\n\t\t\t\t\t\"minWidth\": 578\r\n\t\t\t\t})\r\n\t\t\t} else if (bottomToolBarClient_width < 700) {\r\n\t\t\t\tmarginLeft = \"0px\";\r\n\t\t\t\tmarginRight = \"0px\";\r\n\t\t\t\tparent_paddingLeft = \"2px\";\r\n\t\t\t\tparent_paddingRight = \"2px\";\r\n\t\t\t\tbutton_padding = \"17px\";\r\n\t\t\t} else if (bottomToolBarClient_width < 750) {\r\n\t\t\t\tmarginLeft = \"1px\";\r\n\t\t\t\tmarginRight = \"1px\";\r\n\t\t\t\tparent_paddingLeft = \"3px\";\r\n\t\t\t\tparent_paddingRight = \"3px\";\r\n\t\t\t} else if (bottomToolBarClient_width < 800) {\r\n\t\t\t\tmarginLeft = \"2px\";\r\n\t\t\t\tmarginRight = \"2px\";\r\n\t\t\t\tparent_paddingLeft = \"4px\";\r\n\t\t\t\tparent_paddingRight = \"4px\";\r\n\t\t\t} else if (bottomToolBarClient_width < 850) {\r\n\t\t\t\tmarginLeft = \"3px\";\r\n\t\t\t\tmarginRight = \"3px\";\r\n\t\t\t\tparent_paddingLeft = \"5px\";\r\n\t\t\t\tparent_paddingRight = \"5px\";\r\n\t\t\t} else if (bottomToolBarClient_width < 900) {\r\n\t\t\t\tmarginLeft = \"4px\";\r\n\t\t\t\tmarginRight = \"4px\";\r\n\t\t\t\tparent_paddingLeft = \"6px\";\r\n\t\t\t\tparent_paddingRight = \"6px\";\r\n\t\t\t}\r\n\t\t\tbottomToolBarClient.children().css(\"margin-left\", marginLeft);\r\n\t\t\tbottomToolBarClient.children().css(\"margin-right\", marginRight);\r\n\t\t\tbottomToolBar.css(\"padding-left\", parent_paddingLeft);\r\n\t\t\tbottomToolBar.css(\"padding-right\", parent_paddingRight);\r\n\t\t\t$(\"#app_bottomToolbar_client button\").css({ \"padding-left\": button_padding, \"padding-right\": button_padding })\r\n\t\t}\r\n\t</script>\r\n</head>\r\n\r\n<body class=\"enyo-unselectable\">\r\n\t<div class=\"rong-whiteborad\"></div>\r\n\t<div class=\"rong-table\">\r\n\t\t<table class=\"rong-users\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t<thead>\r\n\t\t\t\t<th>姓名</th>\r\n\t\t\t\t<th>城市</th>\r\n\t\t\t\t<th>手机号</th>\r\n\t\t\t</thead>\r\n\t\t\t<tbody>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>孙悟空</td>\r\n\t\t\t\t\t<td>花果山</td>\r\n\t\t\t\t\t<td>13269772112</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>猪八戒</td>\r\n\t\t\t\t\t<td>高老庄</td>\r\n\t\t\t\t\t<td>15810352456</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>唐僧</td>\r\n\t\t\t\t\t<td>东土大唐</td>\r\n\t\t\t\t\t<td>18902139872</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td>嫦娥</td>\r\n\t\t\t\t\t<td>广寒宫</td>\r\n\t\t\t\t\t<td>18876279078</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t</div>\r\n\t<div class=\"rong-image\"></div>\r\n\t<div class=\"rong-butons\">\r\n\t\t<input class=\"rong-button rong-button-table\" type=\"button\" value=\"表格\">\r\n\t\t<input class=\"rong-button rong-button-clear\" type=\"button\" value=\"清空\">\r\n\t\t<span class=\"rong-button rong-button-upload\">\r\n\t\t\t<span>图片</span>\r\n\t\t\t<input type=\"file\" id=\"uploadFile\" accept=\"image/*\">\r\n\t\t</span>\r\n\t</div>\r\n</body>\r\n<script src=\"./js/core.js\"></script>\r\n\r\n</html>"
  },
  {
    "path": "rtc/whiteboard/src/config.js",
    "content": "var global_config = {\r\n\tserver_path : 'https://rtc.ronghub.com',\r\n\tfile_server_path : 'https://rtc.ronghub.com',\r\n\tload_interval : 1 * 1000,\r\n\twidth : 1280,\r\n\theight : 960\r\n}\r\n"
  },
  {
    "path": "rtc/whiteboard/src/css/app.css",
    "content": "\n/* ../lib/layout/contextual/source/ContextualLayout.css */\n\n/* ContextualLayout.css - popup positioning and border radius adjustments */\n/*for popups above activator*/\n.vertical.above {\n  top: auto;\n  margin-top: -10px;\n  bottom: 100%;\n  margin-bottom: 10px;\n}\n/*for popups below activator*/\n.vertical.below {\n  margin-top: 10px;\n}\n/*for popups on the left of the activator*/\n.right.horizontal {\n  margin-left: -11px;\n}\n/*for popups on the right of the activator*/\n.left.horizontal {\n  margin-left: 10px;\n}\n/*corners*/\n/*vertical top corners*/\n/*for popups on the left of the activator*/\n.vertical.right.corner {\n  margin-left: 0px;\n}\n/*for popups on the right of the activator*/\n.vertical.left.corner {\n  margin-left: 0px;\n}\n.vertical.below.left.corner {\n  border-top-right-radius: 0px;\n}\n.vertical.below.right.corner {\n  border-top-left-radius: 0px;\n}\n/*vertical bottom corners*/\n.left.above.corner {\n  border-bottom-right-radius: 0px;\n}\n.right.above.corner {\n  border-bottom-left-radius: 0px;\n}\n/*horizontal bottom corners*/\n.left.low.corner {\n  border-bottom-left-radius: 0px;\n}\n.right.low.corner {\n  border-bottom-right-radius: 0px;\n}\n/*horizontal top corners*/\n.left.high.corner {\n  border-top-left-radius: 0px;\n}\n.right.high.corner {\n  border-top-right-radius: 0px;\n}\n\n\n/* ../lib/layout/fittable/source/FittableLayout.css */\n\n.enyo-fittable-rows-layout {\n  position: relative;\n}\n.enyo-fittable-rows-layout > * {\n  box-sizing: border-box;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  /* float when not stretched */\n  float: left;\n  clear: both;\n}\n/* non-floating when stretched */\n.enyo-fittable-rows-layout.enyo-stretch > * {\n  float: none;\n  clear: none;\n}\n/* setting to enforce margin collapsing */\n/* NOTE: rows cannot have margin left/right */\n.enyo-fittable-rows-layout.enyo-stretch.enyo-margin-expand > * {\n  float: left;\n  clear: both;\n  width: 100%;\n  /* note: harsh resets */\n  margin-left: 0 !important;\n  margin-right: 0 !important;\n}\n.enyo-fittable-columns-layout {\n  position: relative;\n  text-align: left;\n  white-space: nowrap;\n}\n.enyo-locale-right-to-left .enyo-fittable-columns-layout {\n  text-align: right;\n}\n.enyo-fittable-columns-layout.enyo-center,\n.enyo-locale-right-to-left .enyo-fittable-columns-layout.enyo-center {\n  text-align: center;\n}\n.enyo-fittable-columns-layout > * {\n  box-sizing: border-box;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  vertical-align: top;\n  display: inline-block;\n  white-space: normal;\n}\n.enyo-fittable-columns-layout > table {\n  display: inline-table;\n}\n.enyo-fittable-columns-layout.enyo-tool-decorator > * {\n  vertical-align: middle;\n}\n/* repair clobbered white-space setting for pre, code */\n.enyo-fittable-columns-layout > pre,\n.enyo-fittable-columns-layout > code {\n  white-space: pre;\n}\n.enyo-fittable-columns-layout > .enyo-fittable-columns-layout,\n.enyo-fittable-columns-layout > .onyx-toolbar-inline {\n  white-space: nowrap;\n}\n/* NOTE: columns cannot have margin top/bottom */\n.enyo-fittable-columns-layout.enyo-stretch > * {\n  height: 100%;\n  /* note: harsh resets */\n  margin-top: 0 !important;\n  margin-bottom: 0 !important;\n}\n.enyo-locale-right-to-left .enyo-fittable-columns-layout {\n  direction: rtl;\n  text-align: right;\n}\n.enyo-locale-right-to-left .enyo-fittable-columns-layout.force-left-to-right {\n  direction: ltr;\n  text-align: left;\n}\n.enyo-flex-container {\n  display: -webkit-box;\n  display: -moz-box;\n  display: -ms-flexbox;\n  display: -webkit-flex;\n  display: flex;\n}\n.enyo-flex-container.enyo-center {\n  justify-content: center;\n}\n.enyo-flex-container.columns {\n  -webkit-flex-direction: row;\n  -ms-flex-direction: row;\n  flex-direction: row;\n}\n.enyo-flex-container.rows {\n  -webkit-flex-direction: column;\n  -ms-flex-direction: column;\n  flex-direction: column;\n}\n.enyo-flex-item {\n  -webkit-box-flex: 0;\n  -moz-box-flex: 0;\n  -webkit-flex: 0 0 auto;\n  -ms-flex: 0 0 auto;\n  flex: 0 0 auto;\n}\n.enyo-flex-item.flex {\n  -webkit-box-flex: 1;\n  -moz-box-flex: 1;\n  -webkit-flex: 1 1 auto;\n  -ms-flex: 1 1 auto;\n  flex: 1 1 auto;\n}\n.enyo-flex-container.nostretch > .enyo-flex-item {\n  -webkit-align-self: flex-start;\n  -ms-flex-item-align: flex-start;\n  align-self: flex-start;\n}\n\n\n/* ../lib/layout/list/source/List.css */\n\n.enyo-list {\n  position: relative;\n}\n.enyo-list-port {\n  overflow: hidden;\n  position: relative;\n}\n.enyo-list-holdingarea {\n  position: absolute;\n  left: 0;\n  right: 0;\n}\n.enyo-list-port.horizontal {\n  white-space: nowrap;\n  width: 1000000px;\n  height: 1000000px;\n}\n.enyo-list-port.vertical {\n  height: 1000000px;\n}\n.enyo-list-page {\n  position: absolute;\n  left: 0;\n}\n.enyo-locale-right-to-left .enyo-list-page {\n  left: auto;\n  right: 0;\n}\n.enyo-list-page.vertical {\n  left: 0;\n  right: 0;\n}\n.enyo-list-holdingarea {\n  top: -10000px;\n}\n.enyo-pinned-list-placeholder {\n  border: 1px solid red;\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 1000;\n  background: transparent;\n  overflow: hidden;\n}\n.enyo-pinned-list-placeholder button {\n  width: 100px;\n  height: 100%;\n  position: absolute;\n  top: 0;\n  right: 0;\n}\n.enyo-list-reorder-container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 1000;\n  background: transparent;\n  overflow: hidden;\n}\n.enyo-animatedTopAndLeft {\n  -webkit-transition: top 0.1s linear, left 0.1s linear;\n  -moz-transition: top 0.1s linear, left 0.1s linear;\n  -o-transition: top 0.1s linear, left 0.1s linear;\n  transition: top 0.1s linear, left 0.1s linear;\n}\n\n\n/* ../lib/layout/list/source/PulldownList.css */\n\n.enyo-list-pulldown {\n  position: absolute;\n  bottom: 100%;\n  left: 0;\n  right: 0;\n}\n.enyo-puller {\n  position: relative;\n  height: 50px;\n  font-size: 22px;\n  color: #444;\n  padding: 20px 0 0px 34px;\n}\n.enyo-puller-text {\n  position: absolute;\n  left: 80px;\n  top: 22px;\n}\n.enyo-puller-arrow {\n  position: relative;\n  background: #444;\n  width: 7px;\n  height: 28px;\n  transition: transform 0.3s;\n  -webkit-transition: -webkit-transform 0.3s;\n  -moz-transition: -moz-transform 0.3s;\n  -o-transition: -o-transform 0.3s;\n  -ms-transition: -ms-transform 0.3s;\n}\n.enyo-puller-arrow:after {\n  content: \" \";\n  height: 0;\n  width: 0;\n  position: absolute;\n  border: 10px solid transparent;\n  border-bottom-color: #444;\n  bottom: 100%;\n  left: 50%;\n  margin-left: -10px;\n}\n.enyo-puller-arrow-up {\n  transform: rotate(0deg);\n  -webkit-transform: rotate(0deg);\n  -moz-transform: rotate(0deg);\n  -o-transform: rotate(0deg);\n  -ms-transform: rotate(0deg);\n}\n.enyo-puller-arrow-down {\n  transform: rotate(180deg);\n  -webkit-transform: rotate(180deg);\n  -moz-transform: rotate(180deg);\n  -o-transform: rotate(180deg);\n  -ms-transform: rotate(180deg);\n}\n\n\n/* ../lib/layout/list/source/GridListImageItem.css */\n\n/*\n\tPut anything you reference with \"url()\" in ../assets/\n\tThis way, you can minify your application, and just remove the \"source\" folder for production\n*/\n.enyo-gridlist-imageitem {\n  width: 100%;\n  height: 100%;\n  color: #fff;\n}\n.enyo-gridlist-imageitem img {\n  display: block;\n  width: 100%;\n}\n.enyo-gridlist-imageitem > .caption,\n.enyo-gridlist-imageitem > .sub-caption {\n  font-size: 10pt;\n  z-index: 10;\n  padding-top: 10px;\n  width: 100%;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  overflow: hidden;\n  color: #fff;\n}\n.enyo-gridlist-imageitem.centered > .caption,\n.enyo-gridlist-imageitem.centered > .sub-caption {\n  text-align: center;\n}\n.enyo-gridlist-imageitem.disabled {\n  opacity: 0.4;\n  filter: alpha(opacity=40);\n}\n.enyo-gridlist-imageitem.sized-image.use-caption.use-subcaption {\n  padding-bottom: 50px;\n}\n.enyo-gridlist-imageitem.sized-image.use-caption,\n.enyo-gridlist-imageitem.sized-image.use-subcaption {\n  padding-bottom: 25px;\n}\n.enyo-gridlist-imageitem.sized-image > .image {\n  width: 100%;\n  height: 100%;\n}\n.enyo-gridlist-imageitem.sized-image.use-caption.use-subcaption > .caption {\n  position: absolute;\n  bottom: 22px;\n}\n.enyo-gridlist-imageitem.sized-image > .caption {\n  position: absolute;\n  bottom: 0;\n}\n.enyo-gridlist-imageitem.sized-image > .sub-caption {\n  position: absolute;\n  bottom: 0;\n}\n\n\n/* ../lib/layout/panels/source/arrangers/Arranger.css */\n\n.enyo-arranger {\n  position: relative;\n  overflow: hidden;\n}\n.enyo-arranger.enyo-fit {\n  position: absolute;\n}\n.enyo-arranger > * {\n  position: absolute;\n  left: 0;\n  top: 0;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n}\n.enyo-arranger-fit > * {\n  /* override any width/height set on panels */\n  width: 100% !important;\n  height: 100% !important;\n  min-width: 0 !important;\n  min-height: 0 !important;\n}\n\n\n/* ../lib/layout/panels/source/Panels.css */\n\n@media all and (max-width: 800px) {\n  .enyo-panels-fit-narrow > * {\n    min-width: 100%;\n    max-width: 100%;\n  }\n}\n.enyo-panels-force-narrow > * {\n  min-width: 100%;\n  max-width: 100%;\n}\n\n\n/* ../lib/layout/tree/source/Node.css */\n\n.enyo-node {\n  cursor: default;\n  padding: 4px;\n}\n.enyo-node img {\n  vertical-align: middle;\n  padding-right: 6px;\n}\n.enyo-node-box {\n  overflow: hidden;\n}\n.enyo-node-client {\n  position: relative;\n}\n.enyo-animate .enyo-node-box,\n.enyo-animate .enyo-node-client {\n  -ms-transition-property: height, top;\n  -ms-transition-duration: 0.2s, 0.2s;\n  -moz-transition-property: height, top;\n  -moz-transition-duration: 0.2s, 0.2s;\n  -o-transition-property: height, top;\n  -o-transition-duration: 0.2s, 0.2s;\n  -webkit-transition-property: height, top;\n  -webkit-transition-duration: 0.2s, 0.2s;\n  transition-property: height, top;\n  transition-duration: 0.2s, 0.2s;\n}\n\n\n/* ../lib/layout/imageview/source/ImageViewPin.css */\n\n.pinDebug {\n  background: yellow;\n  border: 1px solid yellow;\n}\n\n\n/* ../lib/onyx/css/onyx.less */\n\n/* Onyx default parameters defined here */\n/* Paths */\n/* application importing Onyx Less files will have to override this  */\n/* variable. Otherwise, Onyx image load will fail with a 404 error  */\n/* Fonts */\n/* ---------------------------------------*/\n/* Text Colors */\n/* ---------------------------------------*/\n/* Background Colors */\n/* ---------------------------------------*/\n/* Border Radius */\n/* ---------------------------------------*/\n/* Padding */\n/* ---------------------------------------*/\n/* Icon Sizes */\n/* ---------------------------------------*/\n/* Disabled Opacity */\n/* ---------------------------------------*/\n/* Gradient Overlays */\n/* ---------------------------------------*/\n/* Images */\n/* ---------------------------------------*/\n/* Onyx rules defined here */\n/* onyx-classes.less - combined CSS (less) files for all released Onyx controls\n   into single onyx.less file to avoid IE bug that allows\n   a maximum of 31 style sheets to be loaded before silently failing */\n.onyx {\n  color: #333333;\n  font-family: 'Helvetica Neue', 'Nimbus Sans L', Arial, sans-serif;\n  font-size: 20px;\n  cursor: default;\n  background-color: #eaeaea;\n  /* remove automatic tap highlight color */\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n/* prevent IE from inheriting line-height for these elements */\n.onyx-button,\n.onyx label,\n.onyx input {\n  line-height: normal;\n}\n.onyx-selected {\n  background-color: #c4e3fe;\n}\n/* LESS pre-calculations */\n/* Individual Widget CSS */\n/* Icon.css */\n.onyx-icon,\n.onyx-icon-toggle {\n  width: 32px;\n  height: 32px;\n  background-repeat: no-repeat;\n  display: inline-block;\n  vertical-align: middle;\n}\n.onyx-icon.onyx-icon-button.active,\n.onyx-icon.onyx-icon-button.pressed,\n.onyx-icon-toggle.active {\n  background-position: 0 -32px;\n}\n.onyx-icon.disabled {\n  opacity: 0.4;\n  filter: alpha(opacity=40);\n}\n/* Button.css */\n.onyx-button {\n  outline: 0;\n  /**/\n  color: #292929;\n  font-size: 16px;\n  text-align: center;\n  white-space: nowrap;\n  /**/\n  margin: 0;\n  padding: 6px 18px;\n  overflow: hidden;\n  /**/\n  border-radius: 3px;\n  /* for IE8 */\n  border: 1px solid #707070;\n  border: 1px solid rgba(15, 15, 15, 0.2);\n  /*\n\t\tThe border and the gradient interact in a strange way that\n\t\tcauses the bottom-border (top if the gradient is aligned top)\n\t\tto be lighter than other borders.\n\t\tWe can fix it by using the darker bottom border below, but\n\t\tthen there are a few rogue pixels that end up very dark.\n\t*/\n  /* border-bottom: 1px solid rgba(15, 15, 15, 0.5); */\n  box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.2);\n  /**/\n  background: #e1e1e1 url('../js/lib/onyx/images/gradient.png') repeat-x bottom;\n  background-size: contain;\n  /**/\n  text-overflow: ellipsis;\n  /* the following cause arcane problems on IE */\n  /*\n\tmin-width: 14px;\n\tmin-height: 20px;\n\t*/\n}\n/*\n\tIE8 can't handle these selectors in tandem:\n\t.onyx-button.active, .onyx-button:active:not([disabled]) {\n\n\tthe effect is as if .onyx-button.active doesn't exist\n*/\n.onyx-button.active,\n.onyx-button.pressed {\n  background-image: url('../js/lib/onyx/images/gradient-invert.png');\n  background-position: top;\n  border-top: 1px solid rgba(15, 15, 15, 0.6);\n  box-shadow: inset 0px 1px 0px rgba(0, 0, 0, 0.1);\n}\n.onyx-button[disabled] {\n  opacity: 0.4;\n  filter: alpha(opacity=40);\n}\n.onyx-button > img {\n  padding: 0px 3px;\n}\n/* Remove the focused inner-border style in Firefox (Windows) */\n.onyx-button::-moz-focus-inner {\n  border: 0;\n}\n/* Checkbox.css */\n.onyx-checkbox {\n  cursor: pointer;\n  height: 32px;\n  width: 32px;\n  background: url('../js/lib/onyx/images/checkbox.png') no-repeat;\n  /* reset for ? */\n  margin: 0px;\n  /* these entries cause toggle-button and checkbox to line up properly*/\n  display: inline-block;\n  vertical-align: middle;\n}\n.onyx-checkbox[checked] {\n  background-position: 0px -32px;\n}\n.onyx-checkbox[disabled] {\n  opacity: 0.4;\n}\n/* Grabber.css */\n.onyx-grabber {\n  background: url('../js/lib/onyx/images/grabbutton.png') no-repeat center;\n  width: 23px;\n  height: 27px;\n}\n/* Popup.css */\n.onyx-popup {\n  font-size: 16px;\n  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);\n  border: 1px solid rgba(0, 0, 0, 0.2);\n  border-radius: 8px;\n  padding: 6px;\n  color: #ffffff;\n  background: #4c4c4c url('../js/lib/onyx/images/gradient.png') repeat-x 0 bottom;\n}\n.onyx-popup-decorator {\n  position: relative;\n}\n/* Groupbox.css */\n.onyx-groupbox > * {\n  display: block;\n  /*box-shadow: inset 0px 1px 1px rgba(255,255,255,0.5);*/\n  border-color: #aaaaaa;\n  border-style: solid;\n  border-width: 0 1px 1px 1px;\n  /*padding: 10px;*/\n  /* reset styles that make 'item' look bad if they happen to be there */\n  border-radius: 0;\n  margin: 0;\n  font-size: 16px;\n}\n/* needed for MathJax support */\n.onyx-groupbox > script {\n  display: none;\n}\n.onyx-groupbox > *:first-child {\n  border-top-color: #aaaaaa;\n  border-width: 1px;\n  border-radius: 4px 4px 0 0;\n}\n.onyx-groupbox > *:last-child {\n  border-radius: 0 0 4px 4px;\n}\n.onyx-groupbox > *:first-child:last-child {\n  border-radius: 4px;\n}\n.onyx-groupbox-header {\n  padding: 2px 10px;\n  /**/\n  color: #ffffff;\n  font-size: 14px;\n  font-weight: bold;\n  text-transform: uppercase;\n  /**/\n  background-color: #4c4c4c;\n  border: none;\n  background: #4c4c4c url('../js/lib/onyx/images/gradient.png') repeat-x 0 10px;\n}\n.onyx-groupbox .onyx-input-decorator {\n  display: block;\n}\n.onyx-groupbox > .onyx-input-decorator {\n  border-color: #aaaaaa;\n  border-width: 0 1px 1px 1px;\n  border-radius: 0;\n}\n.onyx-groupbox > .onyx-input-decorator:first-child {\n  border-width: 1px;\n  border-radius: 4px 4px 0 0;\n}\n.onyx-groupbox > .onyx-input-decorator:last-child {\n  border-radius: 0 0 4px 4px;\n}\n.onyx-groupbox > .onyx-input-decorator:first-child:last-child {\n  border-radius: 4px;\n}\n/* Input.css */\n.onyx-input-decorator {\n  padding: 6px 8px 10px 8px;\n  border-radius: 3px;\n  border: 1px solid;\n  border-color: rgba(0, 0, 0, 0.1);\n  margin: 0;\n}\n.onyx-input-decorator.onyx-focused {\n  box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.3);\n  border-color: rgba(0, 0, 0, 0.3);\n  background-color: #ffffff;\n}\n.onyx-input-decorator.onyx-disabled {\n  /* FIXME: needed to color a disabled input placeholder. */\n  /*-webkit-text-fill-color: #888;*/\n  opacity: 0.4;\n  filter: alpha(opacity=40);\n}\n.onyx-input-decorator > input {\n  /* reset */\n  margin: 0;\n  padding: 0;\n  border: none;\n  outline: none;\n  cursor: pointer;\n  background-color: transparent;\n  background-image: none;\n  font-size: 16px;\n  box-shadow: none;\n  /* FIXME: hack for styling reset on Android */\n  /* -webkit-appearance: caret;*/\n}\n.onyx-input-decorator.onyx-focused > input {\n  cursor: text;\n}\n.onyx-input-decorator.onyx-disabled > input {\n  cursor: default;\n}\n/* Menu.css */\n.onyx-menu,\n.onyx.onyx-menu {\n  min-width: 160px;\n  top: 100%;\n  left: 0;\n  margin-top: 2px;\n  padding: 3px 0;\n  border-radius: 3px;\n}\n.onyx-menu.onyx-menu-up {\n  top: auto;\n  bottom: 100%;\n  margin-top: 0;\n  margin-bottom: 2px;\n}\n.onyx-toolbar .onyx-menu {\n  margin-top: 11px;\n  border-radius: 0 0 3px 3px;\n}\n.onyx-toolbar .onyx-menu.onyx-menu-up {\n  margin-top: 0;\n  margin-bottom: 10px;\n  border-radius: 3px 3px 0 0;\n}\n.onyx-menu-item {\n  display: block;\n  padding: 10px;\n}\n.onyx-menu-item:hover {\n  background: #284152;\n}\n.onyx-menu-divider,\n.onyx-menu-divider:hover {\n  margin: 6px 0;\n  padding: 0;\n  border-bottom: 1px solid #aaa;\n}\n.onyx-menu-label {\n  cursor: default;\n  -webkit-user-select: none;\n  -moz-user-select: -moz-none;\n  user-select: none;\n  opacity: 0.4;\n  filter: alpha(opacity=40);\n}\n.onyx-menu-label:hover {\n  background: none;\n}\n/* customize a toolbar to support menus */\n.onyx-menu-toolbar,\n.onyx-toolbar.onyx-menu-toolbar {\n  position: relative;\n  z-index: 10;\n  overflow: visible;\n}\n/* Submenu.css */\n.onyx-submenu {\n  background: rgba(0, 0, 0, 0.25) url('../js/lib/onyx/images/gradient-invert.png') repeat-x 0 top;\n}\n/* Picker.css */\n.onyx-picker-decorator .onyx-button {\n  padding: 10px 18px;\n}\n.onyx-picker {\n  top: 0;\n  margin-top: -3px;\n  min-width: 0;\n  width: 100%;\n  box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  color: black;\n  background: #e1e1e1;\n}\n.onyx-picker.onyx-menu-up {\n  top: auto;\n  bottom: 0;\n  margin-top: 3px;\n  margin-bottom: -3px;\n}\n.onyx-picker .onyx-menu-item {\n  text-align: center;\n}\n.onyx-picker .onyx-menu-item:hover {\n  background-color: transparent;\n}\n.onyx-picker .onyx-menu-item.selected,\n.onyx-picker .onyx-menu-item.active,\n.onyx-picker .onyx-menu-item:active:hover {\n  border-top: 1px solid rgba(0, 0, 0, 0.1);\n  background-color: #cde7fe;\n  box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.2);\n}\n.onyx-picker .onyx-menu-item {\n  border-top: 1px solid rgba(255, 255, 255, 0.5);\n  border-bottom: 1px solid rgba(0, 0, 0, 0.2);\n}\n.onyx-picker:not(.onyx-flyweight-picker) .onyx-menu-item:first-child,\n.onyx-flyweight-picker :first-child > .onyx-menu-item {\n  border-top: none;\n}\n.onyx-picker:not(.onyx-flyweight-picker) .onyx-menu-item:last-child,\n.onyx-flyweight-picker :last-child > .onyx-menu-item {\n  border-bottom: none;\n}\n/* TextArea.css */\n.onyx-input-decorator > textarea {\n  /* reset */\n  margin: 0;\n  padding: 0;\n  border: none;\n  outline: none;\n  cursor: pointer;\n  background-color: transparent;\n  background-image: none;\n  font-size: 16px;\n  box-shadow: none;\n  /* Remove scrollbars and resize handle */\n  resize: none;\n  overflow: auto;\n  /* FIXME: hack for styling reset on Android */\n  /* -webkit-appearance: caret;*/\n}\n.onyx-input-decorator.onyx-focused > textarea {\n  cursor: text;\n}\n.onyx-input-decorator.onyx-disabled > textarea {\n  cursor: default;\n}\n.onyx-textarea {\n  /* need >=50px for scrollbar to be usable on mac */\n  min-height: 50px;\n}\n/* RichText.css */\n.onyx-input-decorator > .onyx-richtext {\n  /* reset */\n  margin: 0;\n  padding: 0;\n  border: none;\n  outline: none;\n  cursor: pointer;\n  background-color: transparent;\n  background-image: none;\n  font-size: 16px;\n  min-height: 20px;\n  min-width: 100px;\n  box-shadow: none;\n  /* FIXME: hack for styling reset on Android */\n  /* -webkit-appearance: caret;*/\n}\n.onyx-input-decorator.onyx-focused > .onyx-richtext {\n  cursor: text;\n}\n.onyx-input-decorator.onyx-disabled > .onyx-richtext {\n  cursor: default;\n}\n/* RadioButton.css */\n.onyx-radiobutton {\n  padding: 8px 12px;\n  margin: 0;\n  outline: 0;\n  /**/\n  font-size: 16px;\n  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n  text-align: center;\n  /**/\n  background: #e7e7e7 url('../js/lib/onyx/images/gradient.png') repeat-x bottom;\n  /* IE8 */\n  border: 1px solid #333333;\n  border: 1px solid rgba(15, 15, 15, 0.2);\n  /* turn off right-border in a way IE8 ignores, because IE8 does not support :last-child */\n  border-right-color: rgba(0, 0, 0, 0);\n  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.2);\n}\n.onyx-radiobutton:first-child {\n  border-radius: 3px 0 0 3px;\n}\n.onyx-radiobutton:last-child {\n  border-radius: 0px 3px 3px 0px;\n  /* IE8 */\n  border-right: 1px solid #333333;\n  border-right: 1px solid rgba(15, 15, 15, 0.2);\n}\n.onyx-radiobutton.active {\n  color: #ffffff;\n  background: #0091f2 url('../js/lib/onyx/images/gradient-invert.png') repeat-x top;\n  border-top: 1px solid rgba(15, 15, 15, 0.6);\n  box-shadow: inset 1px 2px 2px rgba(0, 0, 0, 0.2);\n}\n/* TabButton.css */\n.onyx-radiobutton.onyx-tabbutton {\n  padding: 8px 34px;\n  font-size: 20px;\n  border-radius: 0px;\n}\n/* TabBar.css */\n.onyx-tab-bar {\n  width: 100%;\n  z-index: 10;\n  background-color: #cacaca;\n  padding-top: 1px;\n}\n.onyx-tab-bar-scroller {\n  padding-top: 2px;\n}\n.onyx-tab-bar-scroller > .enyo-thumb {\n  border: 0px;\n}\n.onyx-tab-wrapper {\n  padding: 3px 0px 3px 0px;\n}\n.onyx-tab-line {\n  position: relative;\n  margin-top: -0.1em;\n  border-top: 1px solid #646464;\n  z-index: 2;\n}\n.onyx-tab-rug {\n  position: relative;\n  padding: 0.3em;\n  background-color: #cacaca;\n  z-index: 4;\n}\n/* TabBarItem.css */\n.onyx-tab-item {\n  display: inline;\n  position: relative;\n  border: 1px solid #646464;\n  margin: 0px 2px 0px 2px;\n  border-top-right-radius: 5px;\n  border-top-left-radius: 5px;\n  background-color: #b1b1b1;\n  z-index: 1;\n  padding-top: 0.2em;\n  padding-bottom: 0.7em ;\n  vertical-align: baseline;\n}\n.onyx-tab-item.active {\n  border-bottom: 1px solid #cacaca;\n  background-color: #cacaca;\n  z-index: 3;\n  padding-top: 0.3em;\n}\n.onyx-tab-item:hover {\n  background-color: #cacaca;\n}\n.onyx-tab-item button {\n  overflow: hidden;\n  margin: 3px;\n  border: 1px solid transparent;\n  background-color: transparent ;\n}\n.onyx-tab-item-dissolve {\n  display: inline-block;\n  height: 90%;\n  width: 2em;\n  top: 2px;\n  right: 19px;\n  position: absolute;\n  background: linear-gradient(to right, #b1b1b1 0%, rgba(177, 177, 177, 0) 100%);\n  /* W3C */\n  background: -moz-linear-gradient(right, #b1b1b1 0%, rgba(177, 177, 177, 0) 100%);\n  /* FF3.6+ */\n  background: -webkit-linear-gradient(left, rgba(177, 177, 177, 0), #b1b1b1);\n  /* Chrome10+,Safari5.1+ */\n  background: -webkit-gradient(linear, right top, left top, color-stop(0%, #b1b1b1), color-stop(100%, rgba(177, 177, 177, 0)));\n  /* Chrome,Safari4+ */\n  background: -o-linear-gradient(left, #b1b1b1 0%, rgba(177, 177, 177, 0) 100%);\n  /* Opera 11.10+ */\n  background: -ms-linear-gradient(left, rgba(177, 177, 177, 0) 0%, #b1b1b1 100%);\n  /* IE10+ */\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00b1b1b1, endColorstr=#ffb1b1b1, GradientType=1);\n  /* IE6-9 */\n}\n.onyx-tab-item-dissolve.active {\n  background: linear-gradient(to right, #cacaca 0%, rgba(202, 202, 202, 0) 100%);\n  /* W3C */\n  background: -moz-linear-gradient(right, #cacaca 0%, rgba(202, 202, 202, 0) 100%);\n  /* FF3.6+ */\n  background: -webkit-linear-gradient(left, rgba(202, 202, 202, 0), #cacaca);\n  /* Chrome10+,Safari5.1+ */\n  background: -webkit-gradient(linear, right top, left top, color-stop(0%, #cacaca), color-stop(100%, rgba(202, 202, 202, 0)));\n  /* Chrome,Safari4+ */\n  background: -o-linear-gradient(left, #cacaca 0%, rgba(202, 202, 202, 0) 100%);\n  /* Opera 11.10+ */\n  background: -ms-linear-gradient(left, rgba(202, 202, 202, 0) 0%, #cacaca 100%);\n  /* IE10+ */\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00cacaca, endColorstr=#ffcacaca, GradientType=1);\n  /* IE6-9 */\n}\n.onyx-tab-item-hovered {\n  background: linear-gradient(to right, #cacaca 0%, rgba(202, 202, 202, 0) 100%);\n  /* W3C */\n  background: -moz-linear-gradient(right, #cacaca 0%, rgba(202, 202, 202, 0) 100%);\n  /* FF3.6+ */\n  background: -webkit-linear-gradient(left, rgba(202, 202, 202, 0), #cacaca);\n  /* Chrome10+,Safari5.1+ */\n  background: -webkit-gradient(linear, right top, left top, color-stop(0%, #cacaca), color-stop(100%, rgba(202, 202, 202, 0)));\n  /* Chrome,Safari4+ */\n  background: -o-linear-gradient(left, #cacaca 0%, rgba(202, 202, 202, 0) 100%);\n  /* Opera 11.10+ */\n  background: -ms-linear-gradient(left, rgba(202, 202, 202, 0) 0%, #cacaca 100%);\n  /* IE10+ */\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00cacaca, endColorstr=#ffcacaca, GradientType=1);\n  /* IE6-9 */\n}\n.onyx-tab-item-close {\n  display: inline-block;\n  margin-right: 3px;\n  width: 16px;\n  height: 16px;\n  vertical-align: middle;\n  background-repeat: no-repeat;\n  background-image: url('../js/lib/onyx/images/close-inactive.png');\n}\n.onyx-tab-item-close:hover {\n  background-image: url('../js/lib/onyx/images/close-active.png');\n}\n/* ToggleButton.css */\n.onyx-toggle-button {\n  display: inline-block;\n  height: 32px;\n  line-height: 32px;\n  min-width: 64px;\n  vertical-align: middle;\n  text-align: center;\n  /* */\n  border-radius: 3px;\n  box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.4);\n  background: #8bba3d url('../js/lib/onyx/images/gradient-invert.png') repeat-x bottom;\n  background-size: auto 100%;\n  /* label */\n  color: #ffffff;\n  font-size: 14px;\n  font-weight: bold;\n  text-transform: uppercase;\n}\n.onyx-toggle-button.off {\n  background-color: #b1b1b1 !important;\n}\n.onyx-toggle-button-knob {\n  display: inline-block;\n  width: 30px;\n  height: 30px;\n  margin: 1px;\n  border-radius: 3px;\n  background: #f6f6f6 url('../js/lib/onyx/images/gradient.png') repeat-x;\n  background-size: auto 100%;\n}\n.onyx-toggle-button .onyx-toggle-button-knob {\n  box-shadow: -1px 0px 4px rgba(0, 0, 0, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.4);\n  float: right;\n}\n.onyx-toggle-button.off .onyx-toggle-button-knob {\n  box-shadow: 1px 0px 4px rgba(0, 0, 0, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.4);\n  float: left;\n}\n.onyx-toggle-button.disabled,\n.onyx-icon-button.disabled {\n  opacity: 0.4;\n  filter: alpha(opacity=40);\n}\n.onyx-toggle-content {\n  min-width: 32px;\n  padding: 0 6px;\n}\n.onyx-toggle-content.empty {\n  padding: 0;\n}\n.onyx-toggle-content.off {\n  float: right;\n}\n.onyx-toggle-content.on {\n  float: left;\n}\n/* Toolbar.css */\n.onyx-toolbar {\n  /*\n\t\tline-height is unreliable for centering, instead\n\t\tuse vertical-align: middle to align\n\t\telements along a common centerline and use\n\t\tpadding to fill out the space.\n\t*/\n  padding: 9px 8px 10px 8px;\n  /**/\n  border: 1px solid #3A3A3A;\n  background: #4c4c4c url('../js/lib/onyx/images/gradient.png') repeat-x 0 bottom;\n  background-size: contain;\n  color: #ffffff;\n  /**/\n  white-space: nowrap;\n  overflow-y: visible;\n  font-size: 20px;\n}\n.onyx-toolbar-inline > *,\n.enyo-fittable-columns-layout.onyx-toolbar-inline > * {\n  display: inline-block;\n  vertical-align: middle;\n  margin: 4px 6px 5px;\n  box-sizing: border-box;\n}\n/* needed for MathJax support */\n.onyx-toolbar-inline > script,\n.enyo-fittable-columns-layout.onyx-toolbar-inline > script {\n  display: none;\n}\n.onyx-toolbar .onyx-icon-button {\n  margin: 3px 2px 1px;\n}\n.onyx-toolbar .onyx-button {\n  color: #f2f2f2;\n  background-color: #555656;\n  border-color: rgba(15, 15, 15, 0.5);\n  margin-top: 0;\n  margin-bottom: 0;\n  height: 36px;\n}\n.onyx-toolbar .onyx-input-decorator {\n  margin: 1px 3px;\n  box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.1);\n  background-color: rgba(0, 0, 0, 0.1);\n  padding: 0px 6px 5px 6px;\n}\n.onyx-toolbar .onyx-input-decorator.onyx-focused {\n  box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.3);\n  background-color: #ffffff;\n}\n.onyx-toolbar .onyx-input-decorator .onyx-input {\n  color: #e5e5e5;\n  font-size: 14px;\n}\n.onyx-toolbar .onyx-input-decorator .onyx-input:focus {\n  color: #000000;\n}\n.onyx-toolbar .onyx-input-decorator .onyx-input:focus::-webkit-input-placeholder {\n  color: #dddddd;\n}\n/* Tooltip.css */\n.onyx-tooltip {\n  z-index: 20;\n  left: 0;\n  padding: 4px 6px;\n  margin-top: 4px;\n  margin-left: -6px;\n  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);\n  border: 1px solid rgba(0, 0, 0, 0.2);\n  color: #ffffff;\n  background: #216593 url('../js/lib/onyx/images/gradient.png') repeat-x 0 bottom;\n  border-radius: 3px;\n  white-space: nowrap;\n}\n/*move the tooltip over to the right when displaying the right arrow so it aligns better with the decorator*/\n.onyx-tooltip.right-arrow {\n  left: 30px;\n}\n/*prep the left & right arrows using before & after - left arrow uses before & right arrow uses after*/\n.onyx-tooltip::before {\n  content: '';\n  border-left: 6px solid transparent;\n  border-right: 6px solid transparent;\n  position: absolute;\n  top: -6px;\n  left: 16px;\n}\n.onyx-tooltip::after {\n  content: '';\n  border-left: 6px solid transparent;\n  border-right: 6px solid transparent;\n  position: absolute;\n  top: -6px;\n  margin-left: -12px;\n}\n/*The following 3 rules handle the left & right arrows when the tooltip is displayed below the activator*/\n.onyx-tooltip.below {\n  top: 100%;\n}\n.onyx-tooltip.below.right-arrow::after {\n  border-bottom: 6px solid #1D587F;\n  top: -6px;\n}\n.onyx-tooltip.below.left-arrow::before {\n  border-bottom: 6px solid #1D587F;\n  top: -6px;\n}\n/*The following 3 rules handle the left & right arrows when the tooltip is displayed above the activator*/\n.onyx-tooltip.above {\n  top: -100%;\n}\n.onyx-tooltip.above.right-arrow::after {\n  content: '';\n  border-top: 6px solid #1D587F;\n  top: 100%;\n}\n.onyx-tooltip.above.left-arrow::before {\n  content: '';\n  border-top: 6px solid #1D587F;\n  top: 100%;\n}\n/* ProgressBar.css */\n.onyx-progress-bar {\n  margin: 8px;\n  height: 8px;\n  border: 1px solid rgba(15, 15, 15, 0.2);\n  border-radius: 3px;\n  background: #b8b8b8 url('../js/lib/onyx/images/gradient-invert.png') repeat-x;\n  background-size: auto 100%;\n}\n.onyx-progress-bar-bar {\n  height: 100%;\n  border-radius: 3px;\n  background: #58abef url('../js/lib/onyx/images/gradient.png') repeat-x;\n  background-size: auto 100%;\n}\n.onyx-progress-bar-bar.striped {\n  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));\n  background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-size: 40px 40px;\n}\n.onyx-progress-bar-bar.striped.animated {\n  -webkit-animation: progress-bar-stripes 2s linear infinite;\n  -moz-animation: progress-bar-stripes 2s linear infinite;\n  -o-animation: progress-bar-stripes 2s linear infinite;\n  animation: progress-bar-stripes 2s linear infinite;\n}\n@-webkit-keyframes progress-bar-stripes {\n  from {\n    background-position: 0 0;\n  }\n  to {\n    background-position: 40px 0;\n  }\n}\n@-moz-keyframes progress-bar-stripes {\n  from {\n    background-position: 0 0;\n  }\n  to {\n    background-position: 40px 0;\n  }\n}\n@-o-keyframes progress-bar-stripes {\n  from {\n    background-position: 0 0;\n  }\n  to {\n    background-position: 40px 0;\n  }\n}\n@keyframes progress-bar-stripes {\n  from {\n    background-position: 0 0;\n  }\n  to {\n    background-position: 40px 0;\n  }\n}\n/* ProgressButton.css */\n.onyx-progress-button {\n  position: relative;\n  height: 36px;\n  line-height: 36px;\n  color: #f1f1f1;\n  font-size: 16px;\n  text-overflow: ellipsis;\n}\n.onyx-progress-button-bar {\n  height: 36px;\n}\n.onyx-progress-button-icon {\n  display: inline-block;\n  position: absolute;\n  top: 2px;\n  right: 0;\n}\n.onyx-progress-button-client {\n  display: inline-block;\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 36px;\n  margin-left: 8px;\n}\n.onyx-progress-button-client > * {\n  display: inline-block;\n}\n/* needed for MathJax support */\n.onyx-progress-button-client > script {\n  display: none;\n}\n/* Slider.css */\n.onyx-slider {\n  position: relative;\n  margin: 8px 20px;\n}\n.onyx-slider-taparea {\n  position: absolute;\n  top: -11px;\n  height: 28px;\n  width: 100%;\n}\n.onyx-slider-knob {\n  position: relative;\n  height: 40px;\n  width: 40px;\n  background: url('../js/lib/onyx/images/slider-handle.png') left top no-repeat;\n  margin: -23px -20px;\n}\n.onyx-slider-knob.active,\n.onyx-slider-knob.pressed {\n  background-position: 0 -40px;\n}\n/* RangeSlider.css */\n.onyx-range-slider-knob {\n  top: -17px;\n}\n.onyx-range-slider-label {\n  position: relative;\n  top: -18px;\n  text-align: center;\n  white-space: nowrap;\n}\n/* Item.css */\n.onyx-item {\n  padding: 14px;\n}\n.onyx-highlight,\n.onyx-highlight.onyx-swipeable-item-content {\n  background-color: #dedfdf;\n}\n.enyo-selected,\n.enyo-selected.onyx-swipeable-item-content {\n  background-color: #c4e3fe;\n}\n.onyx-item.onyx-swipeable-item {\n  overflow: hidden;\n  padding: 0;\n}\n.onyx-swipeable-item-content {\n  background-color: #eaeaea;\n  box-sizing: border-box;\n  padding: 18px 6px;\n  min-height: 40px;\n}\n/* Spinner.css */\n.onyx-spinner {\n  width: 59px;\n  height: 58px;\n  display: inline-block;\n  background: url('../js/lib/onyx/images/spinner-dark.gif') no-repeat 0 0;\n}\n.onyx-spinner.onyx-light {\n  background: url('../../js/lib/onyx/images/spinner-light1.gif') no-repeat 0 0;\n}\n/* MoreToolbar.css */\n.onyx-more-toolbar {\n  overflow: visible;\n  position: relative;\n  z-index: 10;\n}\n.onyx-more-toolbar.active {\n  z-index: 11;\n}\n.onyx-more-menu {\n  left: auto;\n  right: 0px;\n  min-width: 0;\n}\n.onyx-more-toolbar .onyx-more-menu > * {\n  float: right;\n  clear: both;\n  margin: 5px;\n  margin-top: 5px;\n  margin-bottom: 5px;\n}\n.onyx-more-button {\n  background-image: url('../js/lib/onyx/images/more.png');\n  width: 32px;\n  height: 32px;\n}\n/* DatePicker.css */\n.onyx-datepicker-month {\n  min-width: 75px;\n}\n.onyx-datepicker-day {\n  min-width: 60px;\n}\n.onyx-datepicker-year {\n  min-width: 70px;\n}\n/* TimePicker.css */\n.onyx-timepicker-hour {\n  min-width: 60px;\n}\n.onyx-timepicker-minute {\n  min-width: 60px;\n}\n.onyx-timepicker-ampm {\n  min-width: 60px;\n}\n/* ButtonColors.css */\n.onyx-button.onyx-blue {\n  background-color: #35A8EE;\n  color: #F2F2F2;\n}\n.onyx-button.onyx-affirmative {\n  background-color: #91BA07;\n  color: #F2F2F2;\n}\n.onyx-button.onyx-negative {\n  background-color: #C51616;\n  color: #F2F2F2;\n}\n.onyx-button.onyx-dark {\n  background-color: #555656;\n  color: #F2F2F2;\n}\n.onyx-button.onyx-light {\n  background-color: #cacaca;\n  color: #2F2F2F;\n}\n/* ContextualPopup.css */\n.onyx-contextual-popup-title {\n  font-weight: bold;\n  padding: 24px 32px 0px;\n}\n.onyx-contextual-popup-scroller {\n  padding: 24px 32px;\n}\n.onyx-contextual-popup-action-buttons {\n  display: inline-block;\n  width: 100%;\n  text-align: center;\n}\n.onyx-contextual-popup-action-button {\n  margin-left: 5px;\n  margin-right: 5px;\n}\n.onyx-contextual-popup,\n.onyx.onyx-contextual-popup {\n  font-size: 16px;\n  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);\n  border: 1px solid rgba(0, 0, 0, 0.2);\n  border-radius: 8px;\n  padding: 6px;\n  color: #ffffff;\n  background: #4c4c4c;\n}\n/*setup the nub*/\n.onyx-contextual-popup::after {\n  content: '';\n  position: absolute;\n  top: -10px;\n  border-left: 10px solid transparent;\n  border-right: 10px solid transparent;\n  border-top: 10px solid transparent;\n  border-bottom: 10px solid transparent;\n}\n/*for popups above activator*/\n.onyx-contextual-popup.vertical.above {\n  top: auto;\n  margin-top: -10px;\n  bottom: 100%;\n  margin-bottom: 10px;\n}\n/*for popups below activator*/\n.onyx-contextual-popup.vertical.below {\n  margin-top: 10px;\n}\n/*for popups on the left of the activator*/\n.onyx-contextual-popup.right.horizontal {\n  margin-left: -11px;\n}\n/*for popups on the right of the activator*/\n.onyx-contextual-popup.left.horizontal {\n  margin-left: 10px;\n}\n/*nub positioning*/\n/*horizontally centered nub*/\n.onyx-contextual-popup.vertical::after {\n  position: absolute;\n  left: 45%;\n  border-bottom: 10px solid #4c4c4c;\n  border-top: none;\n  border-left: 10px solid transparent;\n  border-right: 10px solid transparent;\n}\n/*nub near horizontal left*/\n.onyx-contextual-popup.vertical.right::after {\n  left: 0%;\n  margin-left: 20px;\n}\n/*nub near horizontal right*/\n.onyx-contextual-popup.vertical.left::after {\n  left: 100%;\n  margin-left: -55px;\n}\n/*downward facing nub*/\n.onyx-contextual-popup.vertical.above::after {\n  top: 100%;\n  border-top: 10px solid #4c4c4c;\n  border-bottom: none;\n  border-left: 10px solid transparent;\n  border-right: 10px solid transparent;\n}\n.onyx-contextual-popup.vertical.below.right::after {\n  top: 0%;\n  margin-top: -10px;\n  border-bottom: 10px solid #4c4c4c;\n  border-left: 10px solid transparent;\n}\n.onyx-contextual-popup.vertical.below.left::after {\n  top: 0%;\n  margin-top: -10px;\n  border-right: 10px solid transparent;\n}\n/*nub positioning for left/right popups*/\n/*vertically centered nub for popups on left of activator*/\n.onyx-contextual-popup.right::after {\n  left: 100%;\n  top: 47%;\n  margin-right: 20px;\n  border-left: 10px solid #4C4C4C;\n}\n/*nub near vertical top for popups on left of activator*/\n.onyx-contextual-popup.right.high::after {\n  top: 35px;\n  border-left: 10px solid #4C4C4C;\n}\n/*nub near vertical bottom for popups on left of activator*/\n.onyx-contextual-popup.right.low::after {\n  top: 100%;\n  margin-top: -55px;\n  border-left: 10px solid #4C4C4C;\n}\n/*vertically centered nub for popups on right of activator*/\n.onyx-contextual-popup.left::after {\n  left: 0%;\n  margin-left: -20px;\n  top: 45%;\n  border-right: 10px solid #4C4C4C;\n}\n/*nub near vertical top for popups on right of activator*/\n.onyx-contextual-popup.left.high::after {\n  top: 35px;\n  border-right: 10px solid #4C4C4C;\n}\n/*nub near vertical bottom for popups on right of activator*/\n.onyx-contextual-popup.left.low::after {\n  top: 100%;\n  margin-top: -55px;\n  border-right: 10px solid #4C4C4C;\n}\n/*corners*/\n/*vertical top corners*/\n/*for popups on the left of the activator*/\n.onyx-contextual-popup.vertical.right.corner {\n  margin-left: 0px;\n}\n/*for popups on the right of the activator*/\n.onyx-contextual-popup.vertical.left.corner {\n  margin-left: 0px;\n}\n.onyx-contextual-popup.vertical.below.left.corner {\n  border-top-right-radius: 0px;\n}\n.onyx-contextual-popup.vertical.below.right.corner {\n  border-top-left-radius: 0px;\n}\n.onyx-contextual-popup.vertical.below.left.corner::after {\n  top: 0%;\n  left: 100%;\n  margin-top: -10px;\n  margin-left: -19px;\n  border-right: 10px solid #4c4c4c;\n  border-top: 10px solid transparent;\n}\n.onyx-contextual-popup.vertical.below.right.corner::after {\n  top: 0%;\n  left: 0%;\n  margin-left: -1px;\n  border-left: 10px solid #4c4c4c;\n  border-top: 10px solid transparent;\n}\n/*vertical bottom corners*/\n.onyx-contextual-popup.left.above.corner {\n  border-bottom-right-radius: 0px;\n}\n.onyx-contextual-popup.right.above.corner {\n  border-bottom-left-radius: 0px;\n}\n.onyx-contextual-popup.vertical.left.above.corner::after {\n  top: 100%;\n  margin-left: -19px;\n  border-right: 10px solid #4C4C4C;\n  border-bottom: 10px solid transparent;\n  border-top: none;\n}\n.onyx-contextual-popup.vertical.right.above.corner::after {\n  top: 100%;\n  left: 0%;\n  margin-left: -1px;\n  border-left: 10px solid #4c4c4c;\n  border-bottom: 10px solid transparent;\n  border-top: none;\n}\n/*horizontal bottom corners*/\n.onyx-contextual-popup.left.low.corner {\n  border-bottom-left-radius: 0px;\n}\n.onyx-contextual-popup.right.low.corner {\n  border-bottom-right-radius: 0px;\n}\n.onyx-contextual-popup.left.low.corner::after {\n  top: 100%;\n  left: 0%;\n  margin-top: -19px;\n  margin-left: -12px;\n  border-bottom: 10px solid #4c4c4c;\n  border-right: 10px solid #4c4c4c;\n}\n.onyx-contextual-popup.right.low.corner::after {\n  top: 100%;\n  left: 100%;\n  margin-top: -19px;\n  border-bottom: 10px solid#4c4c4c;\n  border-left: none;\n}\n/*horizontal top corners*/\n.onyx-contextual-popup.left.high.corner {\n  border-top-left-radius: 0px;\n}\n.onyx-contextual-popup.right.high.corner {\n  border-top-right-radius: 0px;\n}\n.onyx-contextual-popup.left.high.corner::after {\n  top: 0%;\n  left: 0%;\n  margin-top: -1px;\n  margin-left: -12px;\n  border-top: 10px solid #4C4C4C;\n  border-bottom: none;\n}\n.onyx-contextual-popup.right.high.corner::after {\n  top: 0%;\n  left: 100%;\n  margin-top: -1px;\n  margin-left: -9px;\n  border-top: 10px solid #4C4C4C;\n  border-bottom: none;\n}\n/* some default colors */\n.onyx-dark {\n  background-color: #555656;\n}\n.onyx-light {\n  background-color: #cacaca;\n}\n.onyx-green {\n  background-color: #91BA07;\n}\n.onyx-red {\n  background-color: #C51616;\n}\n.onyx-blue {\n  background-color: #35A8EE;\n}\n\n"
  },
  {
    "path": "rtc/whiteboard/src/css/enyo.css",
    "content": "\n/* ../source/dom/dom.css */\n\n/* things we always want */\nbody {\n  font-family: 'Helvetica Neue', 'Nimbus Sans L', Arial, sans-serif;\n}\n/* allow hw-accelerated scrolling on platforms that support it */\nbody.webkitOverflowScrolling {\n  -webkit-overflow-scrolling: touch;\n}\n/* for apps */\n.enyo-document-fit {\n  margin: 0;\n  height: 100%;\n  /* note: giving html overflow: auto is odd and was only ever done to avoid duplication\n\t\thowever, android 4.04 sometimes does not hide nodes when their display is set to none\n\t\tif document is overflow auto.\n\t*/\n  position: relative;\n}\n.enyo-body-fit {\n  margin: 0;\n  height: 100%;\n  /* helps prevent ios page scroll */\n  overflow: auto;\n  position: relative;\n}\n.enyo-no-touch-action {\n  -ms-touch-action: none;\n}\n.enyo-untouchable {\n  pointer-events: none;\n}\n.enyo-untouchable > * {\n  pointer-events: auto;\n}\n/* reset */\nbutton {\n  font-size: inherit;\n  font-family: inherit;\n}\nbutton::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\n/* user selection */\n.enyo-unselectable {\n  cursor: default;\n  -ms-user-select: none;\n  -webkit-user-select: none;\n  -moz-user-select: -moz-none;\n  user-select: none;\n}\n.enyo-selectable {\n  cursor: auto;\n  -ms-user-select: element;\n  -webkit-user-select: text;\n  -moz-user-select: text;\n  user-select: text;\n}\n.enyo-selectable::selection,\n.enyo-selectable ::selection {\n  background: #3297FD;\n  color: #FFF;\n}\n/* layout */\nbody .enyo-fit {\n  position: absolute;\n  left: 0;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  border: none;\n}\n.enyo-clip {\n  overflow: hidden;\n}\n.enyo-border-box {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n}\n/* compositing */\n.enyo-composite {\n  -webkit-transform: translateZ(0);\n  -moz-transform: translateZ(0);\n  -ms-transform: translateZ(0);\n  -o-transform: translateZ(0);\n  transform: translateZ(0);\n}\n/* Fullscreen CSS */\n:-webkit-full-screen {\n  width: 100% !important;\n  height: 100% !important;\n}\n:-moz-full-screen {\n  width: 100% !important;\n  height: 100% !important;\n}\n:-ms-full-screen {\n  width: 100% !important;\n  height: 100% !important;\n}\n:-o-full-screen {\n  width: 100% !important;\n  height: 100% !important;\n}\n:full-screen {\n  width: 100% !important;\n  height: 100% !important;\n}\n/* Fallback Fullscreen CSS */\nbody .enyo-fullscreen {\n  position: absolute !important;\n  left: 0 !important;\n  top: 0 !important;\n  right: 0 !important;\n  bottom: 0 !important;\n  width: 100% !important;\n  height: 100% !important;\n  box-sizing: border-box !important;\n}\n\n\n/* ../source/touch/Thumb.css */\n\n.enyo-thumb {\n  position: absolute;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  border-radius: 4px;\n  background: #333;\n  border: 1px solid #666;\n  opacity: 0.75;\n  z-index: 1;\n}\n.enyo-vthumb {\n  top: 0;\n  right: 2px;\n  width: 4px;\n}\n.enyo-hthumb {\n  left: 0;\n  bottom: 2px;\n  height: 4px;\n}\n\n\n/* ../source/touch/Scroller.css */\n\n.enyo-scroller {\n  position: relative;\n}\n.enyo-fit.enyo-scroller {\n  position: absolute;\n}\n.enyo-touch-scroller {\n  overflow: hidden;\n}\n.enyo-touch-strategy-container {\n  overflow: hidden;\n}\n.enyo-scrollee-fit {\n  height: 100%;\n}\n.enyo-flex-item.flex .enyo-scrollee-fit {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n}\n\n\n/* ../source/ui/ui.css */\n\n.enyo-inline,\n.enyo-tool-decorator {\n  display: inline-block;\n}\n.enyo-children-inline > *,\n.enyo-tool-decorator > * {\n  display: inline-block;\n}\n.enyo-children-middle > *,\n.enyo-tool-decorator > * {\n  vertical-align: middle;\n}\n.enyo-positioned {\n  position: relative;\n}\n.enyo-fill {\n  position: relative;\n  width: 100%;\n  height: 100%;\n}\n.enyo-popup {\n  position: absolute;\n  z-index: 10;\n}\n.enyo-image.sized {\n  display: inline-block;\n  background-position: center;\n  background-repeat: no-repeat;\n}\n.enyo-image.contain {\n  background-size: contain;\n}\n.enyo-image.cover {\n  background-size: cover;\n}\n.enyo-sprite-animation {\n  overflow: hidden;\n}\n.enyo-sprite-animation .enyo-sprite-animation-image {\n  background-size: initial;\n  -webkit-animation-play-state: running;\n  animation-play-state: running;\n}\n.enyo-sprite-animation.paused .enyo-sprite-animation-image {\n  -webkit-animation-play-state: paused;\n  animation-play-state: paused;\n}\n.enyo-scrim {\n  z-index: 1;\n  /*\n\t\tnote: by using pointer-events we allow tapping on scrim\n\t\twhile it is fading out; however, this requires any showing classes\n\t\tto set pointer events to auto or scrim will not function as expected.\n\t*/\n  pointer-events: none;\n}\n.enyo-scrim.enyo-scrim-translucent {\n  pointer-events: auto;\n  background-color: #000000;\n  opacity: 0.65;\n  filter: alpha(opacity=65);\n}\n.enyo-scrim.enyo-scrim-transparent {\n  pointer-events: auto;\n  background: transparent;\n}\n.enyo-richtext {\n  overflow: hidden;\n  word-wrap: break-word;\n}\n.enyo-light-panels {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n}\n.enyo-light-panels > * {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  box-sizing: border-box;\n}\n.enyo-light-panels.horizontal.forwards > * {\n  left: 100%;\n}\n.enyo-light-panels.horizontal.backwards > * {\n  left: -100%;\n}\n.enyo-light-panels.vertical.forwards > * {\n  top: 100%;\n}\n.enyo-light-panels.vertical.backwards > * {\n  top: -100%;\n}\n\n\n/* ../source/ui/data/data.less */\n\n.enyo-data-list {\n  overflow: hidden;\n  position: relative;\n  height: 100%;\n  width: 100%;\n  -moz-box-sizing: border-box;\n  -webkit-box-sizing: border-box;\n  box-sizing: border-box;\n}\n.enyo-data-list .active {\n  position: relative;\n  overflow: hidden;\n}\n.enyo-data-list .buffer {\n  height: 100%;\n  overflow: hidden;\n}\n.enyo-data-list .page {\n  position: absolute;\n  visibility: hidden;\n  width: 100%;\n}\n.enyo-data-list.transitions .page {\n  opacity: 0;\n  filter: alpha(opacity=0);\n  -webkit-transition: opacity 300ms ease-out;\n  -moz-transition: opacity 300ms ease-out;\n  -ms-transition: opacity 300ms ease-out;\n  -o-transition: opacity 300ms ease-out;\n  transition: opacity 300ms ease-out;\n}\n.enyo-data-list.rendered .page {\n  visibility: visible;\n}\n.enyo-data-list.rendered.transitions .page {\n  opacity: 1;\n  filter: alpha(opacity=100);\n}\n.enyo-data-list.debug .page1 {\n  background: #99CCFF;\n}\n.enyo-data-list.debug .page2 {\n  background: #CC99FF;\n}\n.enyo-data-list.horizontal .active {\n  white-space: nowrap;\n}\n.enyo-data-list.horizontal .page > * {\n  display: inline-block !important;\n}\n.enyo-data-list.horizontal .page {\n  width: auto;\n}\n.enyo-data-grid-list .item {\n  display: block;\n  position: absolute !important;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n}\n.enyo-data-grid-list.transitions.reset.rendered .item {\n  -webkit-transition: top 300ms ease-out, left 300ms ease-out, width 300ms ease-out, height 300ms ease-out;\n  -moz-transition: top 300ms ease-out, left 300ms ease-out, width 300ms ease-out, height 300ms ease-out;\n  -ms-transition: top 300ms ease-out, left 300ms ease-out, width 300ms ease-out, height 300ms ease-out;\n  -o-transition: top 300ms ease-out, left 300ms ease-out, width 300ms ease-out, height 300ms ease-out;\n  transition: top 300ms ease-out, left 300ms ease-out, width 300ms ease-out, height 300ms ease-out;\n}\n\n"
  },
  {
    "path": "rtc/whiteboard/src/css/main.css",
    "content": "body,\nhtml {\n    height: 100%;\n}\n\n.onyx-button {\n    border-color: transparent !important;\n    box-shadow: none !important;\n}\n\n.line {\n    fill: none;\n}\n\n.onyx-menu {\n    padding: 0 !important;\n}\n\n.onyx-button:hover {\n    /*background-color: rgba(255,255,255,0.3) !important;*/\n    /*border: 1px solid rgba(179,179,179,0.5) !important;*/\n}\n\n.ajax-file-upload-container {\n    /*display: none;*/\n    position: relative;\n}\n\n.ajax-file-upload-filename {\n    word-wrap: break-word;\n    overflow-x: auto;\n}\n\n.ajax-file-upload-progress {\n    display: block !important;\n}\n\n.onyx-toolbar,\n.onyx-toolbar-inline {\n    white-space: normal !important;\n}\n\n.jconfirm-box {\n    width: 320px;\n    margin: 0 auto;\n}\n\ntextarea:focus {\n    outline: none;\n}\n\n.text-entity {\n    width: 200px;\n    height: 100px;\n    border: 0 none;\n    font-size: 16px;\n    resize: none;\n    background: none;\n    user-select: none;\n    outline: 0;\n    font-family: \"Helvetica\";\n}\n\n#textareaFrame rect {\n    width: 6px;\n    height: 6px;\n    fill: #0096fd;\n    fill-opacity: 1;\n    stroke: #fff;\n    stroke-opacity: 1;\n    shape-rendering: crispEdges;\n    stroke-linecap: square;\n    stroke-linejoin: miter;\n    stroke-miterlimit: 10;\n    float: left;\n    background-color: #0096fd;\n}"
  },
  {
    "path": "rtc/whiteboard/src/css/style.css",
    "content": "html{\n  overflow: hidden;\n}\n.rong-image{\n  left: 30%;\n  height:300px;\n  width: 300px;\n  position: absolute;\n  background-repeat: no-repeat;\n  background-size: contain;\n  opacity: 0.9;\n  display: none;\n}\n\n.rong-butons{\n  position: absolute;\n  height: 60px;\n  width: 150px;\n  bottom: 0;\n  left: 210px;\n  z-index: 99;\n}\n\n.rong-button{\n  background: none;\n  outline: none;\n  color: #898989;\n  border: 1px solid #898989;\n  font-size: 14px;\n  cursor: pointer;\n  padding: 3px;\n  top: 6px;\n  width: 42px;\n  height: 32px;\n}\n.rong-button:hover{\n  color: #FFF;\n  border-color: #FFF;\n}\n\n.rong-button-clear{\n  position: relative;\n  left: 54px;\n}\n\n.rong-button-table{\n  position: relative;\n  top: 6px;\n}\n\n.rong-button-upload {\n  position: relative;\n  display: inline-block;\n  overflow: hidden;\n  left: -43px;\n  top: 17px;\n  text-align: center;\n  height: 24px;\n  width: 36px;\n}\n\n.rong-button-upload span{\n  margin-top: 2px;\n  display: inline-block;\n}\n\n.rong-button-upload input{\n  position: absolute;\n  cursor: pointer;\n  right: 0px;\n  top: 0px;\n  opacity: 0;\n  border: #262626;\n}\n\n.rong-table{\n  position: absolute;\n  left: 40%;\n  bottom: 100px;\n  display: none;\n  height: 180px;\n}\n.rong-table td, .rong-table td {\n  border: 1px solid #687f8d;\n}\n\n/* Table Head */\n.rong-users thead th {\n  background-color: #78D1F0;\n  color: #262626;\n  border-bottom-width: 0;\n}\n\n/* Column Style */\n.rong-users td {\n  color: rgb(180, 180, 180);\n}\n/* Heading and Column Style */\n.rong-users tr, .rong-users th {\n  border-width: 1px;\n  border-style: solid;\n  border-color: rgb(81, 130, 187);\n}\n\n/* Padding and font style */\n.rong-users td, .rong-users th {\n  padding: 5px 10px;\n  font-size: 12px;\n  font-family: Verdana;\n  font-weight: bold;\n}\n.rong-whiteborad{\n  overflow: hidden;\n}"
  },
  {
    "path": "rtc/whiteboard/src/css/sweetalert.css",
    "content": "body.stop-scrolling {\n  height: 100%;\n  overflow: hidden; }\n\n.sweet-overlay {\n  background-color: black;\n  /* IE8 */\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)\";\n  /* IE8 */\n  background-color: rgba(0, 0, 0, 0.4);\n  position: fixed;\n  left: 0;\n  right: 0;\n  top: 0;\n  bottom: 0;\n  display: none;\n  z-index: 10000; }\n\n.sweet-alert {\n  background-color: white;\n  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n  width: 478px;\n  padding: 17px;\n  border-radius: 5px;\n  text-align: center;\n  position: fixed;\n  left: 50%;\n  top: 50%;\n  margin-left: -256px;\n  margin-top: -200px;\n  overflow: hidden;\n  display: none;\n  z-index: 99999; }\n  @media all and (max-width: 540px) {\n    .sweet-alert {\n      width: auto;\n      margin-left: 0;\n      margin-right: 0;\n      left: 15px;\n      right: 15px; } }\n  .sweet-alert h2 {\n    color: #575757;\n    font-size: 30px;\n    text-align: center;\n    font-weight: 600;\n    text-transform: none;\n    position: relative;\n    margin: 25px 0;\n    padding: 0;\n    line-height: 40px;\n    display: block; }\n  .sweet-alert p {\n    color: #797979;\n    font-size: 16px;\n    text-align: center;\n    font-weight: 300;\n    position: relative;\n    text-align: inherit;\n    float: none;\n    margin: 0;\n    padding: 0;\n    line-height: normal; }\n  .sweet-alert fieldset {\n    border: none;\n    position: relative; }\n  .sweet-alert .sa-error-container {\n    background-color: #f1f1f1;\n    margin-left: -17px;\n    margin-right: -17px;\n    overflow: hidden;\n    padding: 0 10px;\n    max-height: 0;\n    webkit-transition: padding 0.15s, max-height 0.15s;\n    transition: padding 0.15s, max-height 0.15s; }\n    .sweet-alert .sa-error-container.show {\n      padding: 10px 0;\n      max-height: 100px;\n      webkit-transition: padding 0.2s, max-height 0.2s;\n      transition: padding 0.25s, max-height 0.25s; }\n    .sweet-alert .sa-error-container .icon {\n      display: inline-block;\n      width: 24px;\n      height: 24px;\n      border-radius: 50%;\n      background-color: #ea7d7d;\n      color: white;\n      line-height: 24px;\n      text-align: center;\n      margin-right: 3px; }\n    .sweet-alert .sa-error-container p {\n      display: inline-block; }\n  .sweet-alert .sa-input-error {\n    position: absolute;\n    top: 29px;\n    right: 26px;\n    width: 20px;\n    height: 20px;\n    opacity: 0;\n    -webkit-transform: scale(0.5);\n    transform: scale(0.5);\n    -webkit-transform-origin: 50% 50%;\n    transform-origin: 50% 50%;\n    -webkit-transition: all 0.1s;\n    transition: all 0.1s; }\n    .sweet-alert .sa-input-error::before, .sweet-alert .sa-input-error::after {\n      content: \"\";\n      width: 20px;\n      height: 6px;\n      background-color: #f06e57;\n      border-radius: 3px;\n      position: absolute;\n      top: 50%;\n      margin-top: -4px;\n      left: 50%;\n      margin-left: -9px; }\n    .sweet-alert .sa-input-error::before {\n      -webkit-transform: rotate(-45deg);\n      transform: rotate(-45deg); }\n    .sweet-alert .sa-input-error::after {\n      -webkit-transform: rotate(45deg);\n      transform: rotate(45deg); }\n    .sweet-alert .sa-input-error.show {\n      opacity: 1;\n      -webkit-transform: scale(1);\n      transform: scale(1); }\n  .sweet-alert input {\n    width: 100%;\n    box-sizing: border-box;\n    border-radius: 3px;\n    border: 1px solid #d7d7d7;\n    height: 43px;\n    margin-top: 10px;\n    margin-bottom: 17px;\n    font-size: 18px;\n    box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.06);\n    padding: 0 12px;\n    display: none;\n    -webkit-transition: all 0.3s;\n    transition: all 0.3s; }\n    .sweet-alert input:focus {\n      outline: none;\n      box-shadow: 0px 0px 3px #c4e6f5;\n      border: 1px solid #b4dbed; }\n      .sweet-alert input:focus::-moz-placeholder {\n        transition: opacity 0.3s 0.03s ease;\n        opacity: 0.5; }\n      .sweet-alert input:focus:-ms-input-placeholder {\n        transition: opacity 0.3s 0.03s ease;\n        opacity: 0.5; }\n      .sweet-alert input:focus::-webkit-input-placeholder {\n        transition: opacity 0.3s 0.03s ease;\n        opacity: 0.5; }\n    .sweet-alert input::-moz-placeholder {\n      color: #bdbdbd; }\n    .sweet-alert input::-ms-clear {\n      display: none; }\n    .sweet-alert input:-ms-input-placeholder {\n      color: #bdbdbd; }\n    .sweet-alert input::-webkit-input-placeholder {\n      color: #bdbdbd; }\n  .sweet-alert.show-input input {\n    display: block; }\n  .sweet-alert .sa-confirm-button-container {\n    display: inline-block;\n    position: relative; }\n  .sweet-alert .la-ball-fall {\n    position: absolute;\n    left: 50%;\n    top: 50%;\n    margin-left: -27px;\n    margin-top: 4px;\n    opacity: 0;\n    visibility: hidden; }\n  .sweet-alert button {\n    background-color: #8CD4F5;\n    color: white;\n    border: none;\n    box-shadow: none;\n    font-size: 17px;\n    font-weight: 500;\n    -webkit-border-radius: 4px;\n    border-radius: 5px;\n    padding: 10px 32px;\n    margin: 26px 5px 0 5px;\n    cursor: pointer; }\n    .sweet-alert button:focus {\n      outline: none;\n      box-shadow: 0 0 2px rgba(128, 179, 235, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.05); }\n    .sweet-alert button:hover {\n      background-color: #7ecff4; }\n    .sweet-alert button:active {\n      background-color: #5dc2f1; }\n    .sweet-alert button.cancel {\n      background-color: #C1C1C1; }\n      .sweet-alert button.cancel:hover {\n        background-color: #b9b9b9; }\n      .sweet-alert button.cancel:active {\n        background-color: #a8a8a8; }\n      .sweet-alert button.cancel:focus {\n        box-shadow: rgba(197, 205, 211, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.0470588) 0px 0px 0px 1px inset !important; }\n    .sweet-alert button[disabled] {\n      opacity: .6;\n      cursor: default; }\n    .sweet-alert button.confirm[disabled] {\n      color: transparent; }\n      .sweet-alert button.confirm[disabled] ~ .la-ball-fall {\n        opacity: 1;\n        visibility: visible;\n        transition-delay: 0s; }\n    .sweet-alert button::-moz-focus-inner {\n      border: 0; }\n  .sweet-alert[data-has-cancel-button=false] button {\n    box-shadow: none !important; }\n  .sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] {\n    padding-bottom: 40px; }\n  .sweet-alert .sa-icon {\n    width: 80px;\n    height: 80px;\n    border: 4px solid gray;\n    -webkit-border-radius: 40px;\n    border-radius: 40px;\n    border-radius: 50%;\n    margin: 20px auto;\n    padding: 0;\n    position: relative;\n    box-sizing: content-box; }\n    .sweet-alert .sa-icon.sa-error {\n      border-color: #F27474; }\n      .sweet-alert .sa-icon.sa-error .sa-x-mark {\n        position: relative;\n        display: block; }\n      .sweet-alert .sa-icon.sa-error .sa-line {\n        position: absolute;\n        height: 5px;\n        width: 47px;\n        background-color: #F27474;\n        display: block;\n        top: 37px;\n        border-radius: 2px; }\n        .sweet-alert .sa-icon.sa-error .sa-line.sa-left {\n          -webkit-transform: rotate(45deg);\n          transform: rotate(45deg);\n          left: 17px; }\n        .sweet-alert .sa-icon.sa-error .sa-line.sa-right {\n          -webkit-transform: rotate(-45deg);\n          transform: rotate(-45deg);\n          right: 16px; }\n    .sweet-alert .sa-icon.sa-warning {\n      border-color: #F8BB86; }\n      .sweet-alert .sa-icon.sa-warning .sa-body {\n        position: absolute;\n        width: 5px;\n        height: 47px;\n        left: 50%;\n        top: 10px;\n        -webkit-border-radius: 2px;\n        border-radius: 2px;\n        margin-left: -2px;\n        background-color: #F8BB86; }\n      .sweet-alert .sa-icon.sa-warning .sa-dot {\n        position: absolute;\n        width: 7px;\n        height: 7px;\n        -webkit-border-radius: 50%;\n        border-radius: 50%;\n        margin-left: -3px;\n        left: 50%;\n        bottom: 10px;\n        background-color: #F8BB86; }\n    .sweet-alert .sa-icon.sa-info {\n      border-color: #C9DAE1; }\n      .sweet-alert .sa-icon.sa-info::before {\n        content: \"\";\n        position: absolute;\n        width: 5px;\n        height: 29px;\n        left: 50%;\n        bottom: 17px;\n        border-radius: 2px;\n        margin-left: -2px;\n        background-color: #C9DAE1; }\n      .sweet-alert .sa-icon.sa-info::after {\n        content: \"\";\n        position: absolute;\n        width: 7px;\n        height: 7px;\n        border-radius: 50%;\n        margin-left: -3px;\n        top: 19px;\n        background-color: #C9DAE1;\n        left: 50%; }\n    .sweet-alert .sa-icon.sa-success {\n      border-color: #A5DC86; }\n      .sweet-alert .sa-icon.sa-success::before, .sweet-alert .sa-icon.sa-success::after {\n        content: '';\n        -webkit-border-radius: 40px;\n        border-radius: 40px;\n        border-radius: 50%;\n        position: absolute;\n        width: 60px;\n        height: 120px;\n        background: white;\n        -webkit-transform: rotate(45deg);\n        transform: rotate(45deg); }\n      .sweet-alert .sa-icon.sa-success::before {\n        -webkit-border-radius: 120px 0 0 120px;\n        border-radius: 120px 0 0 120px;\n        top: -7px;\n        left: -33px;\n        -webkit-transform: rotate(-45deg);\n        transform: rotate(-45deg);\n        -webkit-transform-origin: 60px 60px;\n        transform-origin: 60px 60px; }\n      .sweet-alert .sa-icon.sa-success::after {\n        -webkit-border-radius: 0 120px 120px 0;\n        border-radius: 0 120px 120px 0;\n        top: -11px;\n        left: 30px;\n        -webkit-transform: rotate(-45deg);\n        transform: rotate(-45deg);\n        -webkit-transform-origin: 0px 60px;\n        transform-origin: 0px 60px; }\n      .sweet-alert .sa-icon.sa-success .sa-placeholder {\n        width: 80px;\n        height: 80px;\n        border: 4px solid rgba(165, 220, 134, 0.2);\n        -webkit-border-radius: 40px;\n        border-radius: 40px;\n        border-radius: 50%;\n        box-sizing: content-box;\n        position: absolute;\n        left: -4px;\n        top: -4px;\n        z-index: 2; }\n      .sweet-alert .sa-icon.sa-success .sa-fix {\n        width: 5px;\n        height: 90px;\n        background-color: white;\n        position: absolute;\n        left: 28px;\n        top: 8px;\n        z-index: 1;\n        -webkit-transform: rotate(-45deg);\n        transform: rotate(-45deg); }\n      .sweet-alert .sa-icon.sa-success .sa-line {\n        height: 5px;\n        background-color: #A5DC86;\n        display: block;\n        border-radius: 2px;\n        position: absolute;\n        z-index: 2; }\n        .sweet-alert .sa-icon.sa-success .sa-line.sa-tip {\n          width: 25px;\n          left: 14px;\n          top: 46px;\n          -webkit-transform: rotate(45deg);\n          transform: rotate(45deg); }\n        .sweet-alert .sa-icon.sa-success .sa-line.sa-long {\n          width: 47px;\n          right: 8px;\n          top: 38px;\n          -webkit-transform: rotate(-45deg);\n          transform: rotate(-45deg); }\n    .sweet-alert .sa-icon.sa-custom {\n      background-size: contain;\n      border-radius: 0;\n      border: none;\n      background-position: center center;\n      background-repeat: no-repeat; }\n\n/*\n * Animations\n */\n@-webkit-keyframes showSweetAlert {\n  0% {\n    transform: scale(0.7);\n    -webkit-transform: scale(0.7); }\n  45% {\n    transform: scale(1.05);\n    -webkit-transform: scale(1.05); }\n  80% {\n    transform: scale(0.95);\n    -webkit-transform: scale(0.95); }\n  100% {\n    transform: scale(1);\n    -webkit-transform: scale(1); } }\n\n@keyframes showSweetAlert {\n  0% {\n    transform: scale(0.7);\n    -webkit-transform: scale(0.7); }\n  45% {\n    transform: scale(1.05);\n    -webkit-transform: scale(1.05); }\n  80% {\n    transform: scale(0.95);\n    -webkit-transform: scale(0.95); }\n  100% {\n    transform: scale(1);\n    -webkit-transform: scale(1); } }\n\n@-webkit-keyframes hideSweetAlert {\n  0% {\n    transform: scale(1);\n    -webkit-transform: scale(1); }\n  100% {\n    transform: scale(0.5);\n    -webkit-transform: scale(0.5); } }\n\n@keyframes hideSweetAlert {\n  0% {\n    transform: scale(1);\n    -webkit-transform: scale(1); }\n  100% {\n    transform: scale(0.5);\n    -webkit-transform: scale(0.5); } }\n\n@-webkit-keyframes slideFromTop {\n  0% {\n    top: 0%; }\n  100% {\n    top: 50%; } }\n\n@keyframes slideFromTop {\n  0% {\n    top: 0%; }\n  100% {\n    top: 50%; } }\n\n@-webkit-keyframes slideToTop {\n  0% {\n    top: 50%; }\n  100% {\n    top: 0%; } }\n\n@keyframes slideToTop {\n  0% {\n    top: 50%; }\n  100% {\n    top: 0%; } }\n\n@-webkit-keyframes slideFromBottom {\n  0% {\n    top: 70%; }\n  100% {\n    top: 50%; } }\n\n@keyframes slideFromBottom {\n  0% {\n    top: 70%; }\n  100% {\n    top: 50%; } }\n\n@-webkit-keyframes slideToBottom {\n  0% {\n    top: 50%; }\n  100% {\n    top: 70%; } }\n\n@keyframes slideToBottom {\n  0% {\n    top: 50%; }\n  100% {\n    top: 70%; } }\n\n.showSweetAlert[data-animation=pop] {\n  -webkit-animation: showSweetAlert 0.3s;\n  animation: showSweetAlert 0.3s; }\n\n.showSweetAlert[data-animation=none] {\n  -webkit-animation: none;\n  animation: none; }\n\n.showSweetAlert[data-animation=slide-from-top] {\n  -webkit-animation: slideFromTop 0.3s;\n  animation: slideFromTop 0.3s; }\n\n.showSweetAlert[data-animation=slide-from-bottom] {\n  -webkit-animation: slideFromBottom 0.3s;\n  animation: slideFromBottom 0.3s; }\n\n.hideSweetAlert[data-animation=pop] {\n  -webkit-animation: hideSweetAlert 0.2s;\n  animation: hideSweetAlert 0.2s; }\n\n.hideSweetAlert[data-animation=none] {\n  -webkit-animation: none;\n  animation: none; }\n\n.hideSweetAlert[data-animation=slide-from-top] {\n  -webkit-animation: slideToTop 0.4s;\n  animation: slideToTop 0.4s; }\n\n.hideSweetAlert[data-animation=slide-from-bottom] {\n  -webkit-animation: slideToBottom 0.3s;\n  animation: slideToBottom 0.3s; }\n\n@-webkit-keyframes animateSuccessTip {\n  0% {\n    width: 0;\n    left: 1px;\n    top: 19px; }\n  54% {\n    width: 0;\n    left: 1px;\n    top: 19px; }\n  70% {\n    width: 50px;\n    left: -8px;\n    top: 37px; }\n  84% {\n    width: 17px;\n    left: 21px;\n    top: 48px; }\n  100% {\n    width: 25px;\n    left: 14px;\n    top: 45px; } }\n\n@keyframes animateSuccessTip {\n  0% {\n    width: 0;\n    left: 1px;\n    top: 19px; }\n  54% {\n    width: 0;\n    left: 1px;\n    top: 19px; }\n  70% {\n    width: 50px;\n    left: -8px;\n    top: 37px; }\n  84% {\n    width: 17px;\n    left: 21px;\n    top: 48px; }\n  100% {\n    width: 25px;\n    left: 14px;\n    top: 45px; } }\n\n@-webkit-keyframes animateSuccessLong {\n  0% {\n    width: 0;\n    right: 46px;\n    top: 54px; }\n  65% {\n    width: 0;\n    right: 46px;\n    top: 54px; }\n  84% {\n    width: 55px;\n    right: 0px;\n    top: 35px; }\n  100% {\n    width: 47px;\n    right: 8px;\n    top: 38px; } }\n\n@keyframes animateSuccessLong {\n  0% {\n    width: 0;\n    right: 46px;\n    top: 54px; }\n  65% {\n    width: 0;\n    right: 46px;\n    top: 54px; }\n  84% {\n    width: 55px;\n    right: 0px;\n    top: 35px; }\n  100% {\n    width: 47px;\n    right: 8px;\n    top: 38px; } }\n\n@-webkit-keyframes rotatePlaceholder {\n  0% {\n    transform: rotate(-45deg);\n    -webkit-transform: rotate(-45deg); }\n  5% {\n    transform: rotate(-45deg);\n    -webkit-transform: rotate(-45deg); }\n  12% {\n    transform: rotate(-405deg);\n    -webkit-transform: rotate(-405deg); }\n  100% {\n    transform: rotate(-405deg);\n    -webkit-transform: rotate(-405deg); } }\n\n@keyframes rotatePlaceholder {\n  0% {\n    transform: rotate(-45deg);\n    -webkit-transform: rotate(-45deg); }\n  5% {\n    transform: rotate(-45deg);\n    -webkit-transform: rotate(-45deg); }\n  12% {\n    transform: rotate(-405deg);\n    -webkit-transform: rotate(-405deg); }\n  100% {\n    transform: rotate(-405deg);\n    -webkit-transform: rotate(-405deg); } }\n\n.animateSuccessTip {\n  -webkit-animation: animateSuccessTip 0.75s;\n  animation: animateSuccessTip 0.75s; }\n\n.animateSuccessLong {\n  -webkit-animation: animateSuccessLong 0.75s;\n  animation: animateSuccessLong 0.75s; }\n\n.sa-icon.sa-success.animate::after {\n  -webkit-animation: rotatePlaceholder 4.25s ease-in;\n  animation: rotatePlaceholder 4.25s ease-in; }\n\n@-webkit-keyframes animateErrorIcon {\n  0% {\n    transform: rotateX(100deg);\n    -webkit-transform: rotateX(100deg);\n    opacity: 0; }\n  100% {\n    transform: rotateX(0deg);\n    -webkit-transform: rotateX(0deg);\n    opacity: 1; } }\n\n@keyframes animateErrorIcon {\n  0% {\n    transform: rotateX(100deg);\n    -webkit-transform: rotateX(100deg);\n    opacity: 0; }\n  100% {\n    transform: rotateX(0deg);\n    -webkit-transform: rotateX(0deg);\n    opacity: 1; } }\n\n.animateErrorIcon {\n  -webkit-animation: animateErrorIcon 0.5s;\n  animation: animateErrorIcon 0.5s; }\n\n@-webkit-keyframes animateXMark {\n  0% {\n    transform: scale(0.4);\n    -webkit-transform: scale(0.4);\n    margin-top: 26px;\n    opacity: 0; }\n  50% {\n    transform: scale(0.4);\n    -webkit-transform: scale(0.4);\n    margin-top: 26px;\n    opacity: 0; }\n  80% {\n    transform: scale(1.15);\n    -webkit-transform: scale(1.15);\n    margin-top: -6px; }\n  100% {\n    transform: scale(1);\n    -webkit-transform: scale(1);\n    margin-top: 0;\n    opacity: 1; } }\n\n@keyframes animateXMark {\n  0% {\n    transform: scale(0.4);\n    -webkit-transform: scale(0.4);\n    margin-top: 26px;\n    opacity: 0; }\n  50% {\n    transform: scale(0.4);\n    -webkit-transform: scale(0.4);\n    margin-top: 26px;\n    opacity: 0; }\n  80% {\n    transform: scale(1.15);\n    -webkit-transform: scale(1.15);\n    margin-top: -6px; }\n  100% {\n    transform: scale(1);\n    -webkit-transform: scale(1);\n    margin-top: 0;\n    opacity: 1; } }\n\n.animateXMark {\n  -webkit-animation: animateXMark 0.5s;\n  animation: animateXMark 0.5s; }\n\n@-webkit-keyframes pulseWarning {\n  0% {\n    border-color: #F8D486; }\n  100% {\n    border-color: #F8BB86; } }\n\n@keyframes pulseWarning {\n  0% {\n    border-color: #F8D486; }\n  100% {\n    border-color: #F8BB86; } }\n\n.pulseWarning {\n  -webkit-animation: pulseWarning 0.75s infinite alternate;\n  animation: pulseWarning 0.75s infinite alternate; }\n\n@-webkit-keyframes pulseWarningIns {\n  0% {\n    background-color: #F8D486; }\n  100% {\n    background-color: #F8BB86; } }\n\n@keyframes pulseWarningIns {\n  0% {\n    background-color: #F8D486; }\n  100% {\n    background-color: #F8BB86; } }\n\n.pulseWarningIns {\n  -webkit-animation: pulseWarningIns 0.75s infinite alternate;\n  animation: pulseWarningIns 0.75s infinite alternate; }\n\n@-webkit-keyframes rotate-loading {\n  0% {\n    transform: rotate(0deg); }\n  100% {\n    transform: rotate(360deg); } }\n\n@keyframes rotate-loading {\n  0% {\n    transform: rotate(0deg); }\n  100% {\n    transform: rotate(360deg); } }\n\n/* Internet Explorer 9 has some special quirks that are fixed here */\n/* The icons are not animated. */\n/* This file is automatically merged into sweet-alert.min.js through Gulp */\n/* Error icon */\n.sweet-alert .sa-icon.sa-error .sa-line.sa-left {\n  -ms-transform: rotate(45deg) \\9; }\n\n.sweet-alert .sa-icon.sa-error .sa-line.sa-right {\n  -ms-transform: rotate(-45deg) \\9; }\n\n/* Success icon */\n.sweet-alert .sa-icon.sa-success {\n  border-color: transparent\\9; }\n\n.sweet-alert .sa-icon.sa-success .sa-line.sa-tip {\n  -ms-transform: rotate(45deg) \\9; }\n\n.sweet-alert .sa-icon.sa-success .sa-line.sa-long {\n  -ms-transform: rotate(-45deg) \\9; }\n\n/*!\n * Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/)\n * Copyright 2015 Daniel Cardoso <@DanielCardoso>\n * Licensed under MIT\n */\n.la-ball-fall,\n.la-ball-fall > div {\n  position: relative;\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box; }\n\n.la-ball-fall {\n  display: block;\n  font-size: 0;\n  color: #fff; }\n\n.la-ball-fall.la-dark {\n  color: #333; }\n\n.la-ball-fall > div {\n  display: inline-block;\n  float: none;\n  background-color: currentColor;\n  border: 0 solid currentColor; }\n\n.la-ball-fall {\n  width: 54px;\n  height: 18px; }\n\n.la-ball-fall > div {\n  width: 10px;\n  height: 10px;\n  margin: 4px;\n  border-radius: 100%;\n  opacity: 0;\n  -webkit-animation: ball-fall 1s ease-in-out infinite;\n  -moz-animation: ball-fall 1s ease-in-out infinite;\n  -o-animation: ball-fall 1s ease-in-out infinite;\n  animation: ball-fall 1s ease-in-out infinite; }\n\n.la-ball-fall > div:nth-child(1) {\n  -webkit-animation-delay: -200ms;\n  -moz-animation-delay: -200ms;\n  -o-animation-delay: -200ms;\n  animation-delay: -200ms; }\n\n.la-ball-fall > div:nth-child(2) {\n  -webkit-animation-delay: -100ms;\n  -moz-animation-delay: -100ms;\n  -o-animation-delay: -100ms;\n  animation-delay: -100ms; }\n\n.la-ball-fall > div:nth-child(3) {\n  -webkit-animation-delay: 0ms;\n  -moz-animation-delay: 0ms;\n  -o-animation-delay: 0ms;\n  animation-delay: 0ms; }\n\n.la-ball-fall.la-sm {\n  width: 26px;\n  height: 8px; }\n\n.la-ball-fall.la-sm > div {\n  width: 4px;\n  height: 4px;\n  margin: 2px; }\n\n.la-ball-fall.la-2x {\n  width: 108px;\n  height: 36px; }\n\n.la-ball-fall.la-2x > div {\n  width: 20px;\n  height: 20px;\n  margin: 8px; }\n\n.la-ball-fall.la-3x {\n  width: 162px;\n  height: 54px; }\n\n.la-ball-fall.la-3x > div {\n  width: 30px;\n  height: 30px;\n  margin: 12px; }\n\n/*\n * Animation\n */\n@-webkit-keyframes ball-fall {\n  0% {\n    opacity: 0;\n    -webkit-transform: translateY(-145%);\n    transform: translateY(-145%); }\n  10% {\n    opacity: .5; }\n  20% {\n    opacity: 1;\n    -webkit-transform: translateY(0);\n    transform: translateY(0); }\n  80% {\n    opacity: 1;\n    -webkit-transform: translateY(0);\n    transform: translateY(0); }\n  90% {\n    opacity: .5; }\n  100% {\n    opacity: 0;\n    -webkit-transform: translateY(145%);\n    transform: translateY(145%); } }\n\n@-moz-keyframes ball-fall {\n  0% {\n    opacity: 0;\n    -moz-transform: translateY(-145%);\n    transform: translateY(-145%); }\n  10% {\n    opacity: .5; }\n  20% {\n    opacity: 1;\n    -moz-transform: translateY(0);\n    transform: translateY(0); }\n  80% {\n    opacity: 1;\n    -moz-transform: translateY(0);\n    transform: translateY(0); }\n  90% {\n    opacity: .5; }\n  100% {\n    opacity: 0;\n    -moz-transform: translateY(145%);\n    transform: translateY(145%); } }\n\n@-o-keyframes ball-fall {\n  0% {\n    opacity: 0;\n    -o-transform: translateY(-145%);\n    transform: translateY(-145%); }\n  10% {\n    opacity: .5; }\n  20% {\n    opacity: 1;\n    -o-transform: translateY(0);\n    transform: translateY(0); }\n  80% {\n    opacity: 1;\n    -o-transform: translateY(0);\n    transform: translateY(0); }\n  90% {\n    opacity: .5; }\n  100% {\n    opacity: 0;\n    -o-transform: translateY(145%);\n    transform: translateY(145%); } }\n\n@keyframes ball-fall {\n  0% {\n    opacity: 0;\n    -webkit-transform: translateY(-145%);\n    -moz-transform: translateY(-145%);\n    -o-transform: translateY(-145%);\n    transform: translateY(-145%); }\n  10% {\n    opacity: .5; }\n  20% {\n    opacity: 1;\n    -webkit-transform: translateY(0);\n    -moz-transform: translateY(0);\n    -o-transform: translateY(0);\n    transform: translateY(0); }\n  80% {\n    opacity: 1;\n    -webkit-transform: translateY(0);\n    -moz-transform: translateY(0);\n    -o-transform: translateY(0);\n    transform: translateY(0); }\n  90% {\n    opacity: .5; }\n  100% {\n    opacity: 0;\n    -webkit-transform: translateY(145%);\n    -moz-transform: translateY(145%);\n    -o-transform: translateY(145%);\n    transform: translateY(145%); } }\n"
  },
  {
    "path": "rtc/whiteboard/src/css/upload.css",
    "content": "body {\n    font-family: Verdana, Arial, sans-serif;\n    font-size: 90%;\n}\nh1, h2, h3, h4 {\n    margin-top: 0px;\n}\ndiv.row {\n    margin-bottom: 10px;\n}\n*:focus {\n    outline: none;\n}\n.floatLeft {\n    float: left;\n}\n.floatRight {\n    float: right;\n}\n.clear {\n    clear: both;\n}\n\nform {\n    padding: 20px;\n    border: 1px solid #cccccc;\n    border-radius: 10px;\n    -moz-border-radius: 10px;\n    -webkit-box-shadow: 0 0 10px #ccc;\n    -moz-box-shadow: 0 0 10px #ccc;\n    box-shadow: 0 0 10px #ccc;\n    width: 400px;\n    margin: 20px auto;\n    background-image: -moz-linear-gradient(top, #ffffff,#f2f2f2);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#f2f2f2));\n}\n\ninput {\n    border: 1px solid #ccc;\n    font-size: 13pt;\n    padding: 5px 10px 5px 10px;\n    border-radius: 10px;\n    -moz-border-radius: 10px;\n    -webkit-transition: all 0.5s ease-in-out;\n    -moz-transition: all 0.5s ease-in-out;\n    transition: all 0.5s ease-in-out;\n}\n\ninput[type=button] {\n    background-image: -moz-linear-gradient(top, #ffffff, #dfdfdf);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#dfdfdf));\n}\n\ninput:focus {\n    -webkit-box-shadow: 0 0 10px #ccc;\n    -moz-box-shadow: 0 0 10px #ccc;\n    box-shadow: 0 0 5px #ccc;\n    -webkit-transform: scale(1.05);\n    -moz-transform: scale(1.05);\n    transform: scale(1.05);\n}\n\n#fileToUpload {\n    width: 378px;\n}\n\n#progressIndicator {\n    font-size: 10pt;\n}\n\n#fileInfo {\n    font-size: 10pt;\n    font-style: italic;\n    color: #aaa;\n    margin-top: 10px;\n}\n\n#progressBar {\n    height: 14px;\n    border: 1px solid #cccccc;\n    display: none;\n    border-radius: 10px;\n    -moz-border-radius: 10px;\n    background-image: -moz-linear-gradient(top, #66cc00, #4b9500);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(#66cc00), to(#4b9500));\n}\n\n#uploadResponse {\n    margin-top: 10px;\n    padding: 20px;\n    overflow: hidden;\n    display: none;\n    border-radius: 10px;\n    -moz-border-radius: 10px;\n    border: 1px solid #ccc;\n    box-shadow: 0 0 5px #ccc;\n    background-image: -moz-linear-gradient(top, #ff9900, #c77801);\n    background-image: -webkit-gradient(linear, left top, left bottom, from(#ff9900), to(#c77801));\n}       "
  },
  {
    "path": "rtc/whiteboard/src/css/uploadfile.css",
    "content": ".ajax-file-upload-statusbar {\nborder: 1px solid #0ba1b5;\nmargin-top: 10px;\nwidth: 420px;\nmargin-right: 10px;\nmargin: 5px;\n-moz-border-radius: 4px;\n-webkit-border-radius: 4px;\nborder-radius: 4px;\npadding: 5px 5px 5px 15px\n}\n\n.ajax-file-upload-filename {\nwidth: 300px;\nheight: auto;\nmargin: 0 5px 5px 0px;\n\n}\n.ajax-file-upload-filesize {\nwidth: 50px;\nheight: auto;\nmargin: 0 5px 5px 0px;\ndisplay: inline-block;\nvertical-align:middle;\n}\n.ajax-file-upload-progress {\nmargin: 5px 10px 5px 0px;\nposition: relative;\nwidth: 250px;\nborder: 1px solid #ddd;\npadding: 1px;\nborder-radius: 3px;\ndisplay: inline-block;\ncolor:#FFFFFF;\n\n}\n.ajax-file-upload-bar {\nbackground-color: #0ba1b5;\nwidth: 0;\nheight: 20px;\nborder-radius: 3px;\ncolor:#FFFFFF;\n\n}\n.ajax-file-upload-percent {\nposition: absolute;\ndisplay: inline-block;\ntop: 3px;\nleft: 48%\n}\n.ajax-file-upload-red {\n-moz-box-shadow: inset 0 39px 0 -24px #e67a73;\n-webkit-box-shadow: inset 0 39px 0 -24px #e67a73;\nbox-shadow: inset 0 39px 0 -24px #e67a73;\nbackground-color: #e4685d;\n-moz-border-radius: 4px;\n-webkit-border-radius: 4px;\nborder-radius: 4px;\ndisplay: inline-block;\ncolor: #fff;\nfont-family: arial;\nfont-size: 13px;\nfont-weight: normal;\npadding: 4px 15px;\ntext-decoration: none;\ntext-shadow: 0 1px 0 #b23e35;\ncursor: pointer;\nvertical-align: middle;\nmargin-right:5px;\n}\n.ajax-file-upload-green {\nbackground-color: #77b55a;\n-moz-border-radius: 4px;\n-webkit-border-radius: 4px;\nborder-radius: 4px;\nmargin: 0;\npadding: 0;\ndisplay: inline-block;\ncolor: #fff;\nfont-family: arial;\nfont-size: 13px;\nfont-weight: normal;\npadding: 4px 15px;\ntext-decoration: none;\ncursor: pointer;\ntext-shadow: 0 1px 0 #5b8a3c;\nvertical-align: middle;\nmargin-right:5px;\n}\n.ajax-file-upload {\n\tfont-family: Arial, Helvetica, sans-serif;\n\tfont-size: 16px;\n   font-weight: bold;\n\tpadding: 15px 20px;\n\tcursor:pointer;\t\n\tline-height:20px;\n\theight:25px;\n\tmargin:0 10px 10px 0;\n  display: inline-block;\n  background: #fff;\n  border: 1px solid #e8e8e8;\n  color: #888;\n  text-decoration: none;\n  border-radius: 3px;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  -moz-box-shadow: 0 2px 0 0 #e8e8e8;\n  -webkit-box-shadow: 0 2px 0 0 #e8e8e8;\n  box-shadow: 0 2px 0 0 #e8e8e8; \n  padding: 6px 10px 4px 10px; \n  color: #fff;\n  background: #2f8ab9;\n  border: none;\n  -moz-box-shadow: 0 2px 0 0 #13648d;\n  -webkit-box-shadow: 0 2px 0 0 #13648d;\n  box-shadow: 0 2px 0 0 #13648d; \n  vertical-align: middle;  \n  }\n  \n.ajax-file-upload:hover {\n      background: #3396c9;\n      -moz-box-shadow: 0 2px 0 0 #15719f;\n      -webkit-box-shadow: 0 2px 0 0 #15719f;\n      box-shadow: 0 2px 0 0 #15719f;\n}\n\n.ajax-upload-dragdrop\n{\n\n\tborder:2px dotted #A5A5C7;\n\twidth:420px;\n\tcolor: #DADCE3;\n\ttext-align:left;\n\tvertical-align:middle;\n\tpadding:10px 10px 0px 10px;\n}\n\n.state-hover\n{\n\t\tborder:2px solid #A5A5C7;\n}\n.ajax-file-upload-container\n{\n\tmargin:20px 0px 20px 0px;\n}"
  },
  {
    "path": "rtc/whiteboard/src/js/Queue.src.js",
    "content": "/*\n\nQueue.js\n\nA function to represent a queue\n\nCreated by Stephen Morley - http://code.stephenmorley.org/ - and released under\nthe terms of the CC0 1.0 Universal legal code:\n\nhttp://creativecommons.org/publicdomain/zero/1.0/legalcode\n\n*/\n\n/* Creates a new queue. A queue is a first-in-first-out (FIFO) data structure -\n * items are added to the end of the queue and removed from the front.\n */\nfunction Queue(){\n\n  // initialise the queue and offset\n  var queue  = [];\n  var offset = 0;\n\n  // Returns the length of the queue.\n  this.getLength = function(){\n    return (queue.length - offset);\n  }\n\n  // Returns true if the queue is empty, and false otherwise.\n  this.isEmpty = function(){\n    return (queue.length == 0);\n  }\n\n  /* Enqueues the specified item. The parameter is:\n   *\n   * item - the item to enqueue\n   */\n  this.enqueue = function(item){\n    queue.push(item);\n  }\n\n  /* Dequeues an item and returns it. If the queue is empty, the value\n   * 'undefined' is returned.\n   */\n  this.dequeue = function(){\n\n    // if the queue is empty, return immediately\n    if (queue.length == 0) return undefined;\n\n    // store the item at the front of the queue\n    var item = queue[offset];\n\n    // increment the offset and remove the free space if necessary\n    if (++ offset * 2 >= queue.length){\n      queue  = queue.slice(offset);\n      offset = 0;\n    }\n\n    // return the dequeued item\n    return item;\n\n  }\n\n  /* Returns the item at the front of the queue (without dequeuing it). If the\n   * queue is empty then undefined is returned.\n   */\n  this.peek = function(){\n    return (queue.length > 0 ? queue[offset] : undefined);\n  }\n\n}\n"
  },
  {
    "path": "rtc/whiteboard/src/js/blink/blinkEwb.js",
    "content": "/**\r\n * 构造函数\r\n * \r\n */\r\nvar BlinkEwb = function(connection) {\r\n\tthis.connection = connection; // 上层对象\r\n\tthis.serverPath = ewb_server_path;\r\n\tthis.fileServerPath = ewb_file_server_path;\r\n\tthis.loadInterval = ewb_load_interval;\r\n\tthis.roomKey = ewb_roomKey;\r\n\tthis.token = ewb_token;\r\n\tthis.userId = ewb_userId;\r\n\tthis.pages = null;\r\n\tthis.pageIds = null;\r\n\tthis.pageFiles = null;\r\n\tthis.page = null;\r\n\tthis.printId = 0;\r\n\tthis.laserPrintId = 0;\r\n\tthis.init();\r\n\treturn this;\r\n}\r\n/**\r\n * 初始化\r\n * \r\n */\r\nBlinkEwb.prototype.init = function() {\r\n\tvar blinkEwb = this;\r\n\tthis.gotoEntryPage();\r\n}\r\n/**\r\n * 发送到后台\r\n * \r\n */\r\nBlinkEwb.prototype.send = function(message) {\r\n\tvar messageObj = JSON.parse(message);\r\n\tvar evt = messageObj.event;\r\n\tif (evt == \"init\") { // 初始化\r\n\t\tif (messageObj.data.page != null && messageObj.data.page != '') {\r\n\t\t\tvar pageIndex = messageObj.data.page - 1;\r\n\t\t\tthis.gotoPage(pageIndex);\r\n\t\t}\r\n\t} else if (evt == \"laser-draw\") { // 激光笔\r\n\t\t// var laserPrint = \"[\" + JSON.stringify(messageObj.data) + \"]\";\r\n\t\tvar laserPrint = JSON.stringify(messageObj.data);\r\n\t\tthis.createLaserPrint(laserPrint);\r\n\t} else if (evt == \"laser-remove\") { // 删除激光笔\r\n\t\tthis.cleanPageLaserPrints();\r\n\t} else if (evt == \"draw-click\") { // 笔画\r\n\t\tvar print = JSON.stringify(messageObj.data.singlePath);\r\n\t\t// this.createPrint(print);\r\n\t\tvar thumbnail = messageObj.data.thumbnail;\r\n\t\tthis.createPrint(print, thumbnail);\r\n\t} else if (evt == \"get-image\") { // 背景图片\r\n\t\tthis.renderImage();\r\n\t} else if (evt == \"new-page\") { // 新页面\r\n\t\tthis.createPage();\r\n\t} else if (evt == \"clear\") { // 清除笔画\r\n\t\tthis.cleanPagePrints();\r\n\t} else if (evt == \"delete-page\") { // 删除页面\r\n\t\tthis.deletePage();\r\n\t}\r\n}\r\n/**\r\n * 跳转到入口页\r\n * \r\n */\r\nBlinkEwb.prototype.gotoEntryPage = function() {\r\n\tthis.remoteClear(false);\r\n\t// 停止刷新\r\n\tthis.exitLoadPage();\r\n\tthis.getEntryPage();\r\n}\r\n/**\r\n * 跳转页\r\n * \r\n */\r\nBlinkEwb.prototype.gotoPage = function(pageIndex) {\r\n\tif (pageIndex < 0 || pageIndex > this.pageIds.length - 1) {\r\n\t\tthis.pageNotFound();\r\n\t} else {\r\n\t\t// 停止刷新\r\n\t\tthis.exitLoadPage();\r\n\t\tthis.getPage(this.pageIds[pageIndex]);\r\n\t}\r\n}\r\n/**\r\n * page已经被删除\r\n * \r\n */\r\nBlinkEwb.prototype.pageNotFound = function() {\r\n\t// 停止刷新\r\n\tthis.exitLoadPage();\r\n\tvar blinkEwb = this;\r\n\t$\r\n\t\t\t.alert({\r\n\t\t\t\ttitle : $L(\"Confirm\"),\r\n\t\t\t\tcontent : $L(\"This page has been deleted, click OK to go to last page\"),\r\n\t\t\t\tconfirm : function() {\r\n\t\t\t\t\t// 跳转到入口页\r\n\t\t\t\t\tblinkEwb.gotoEntryPage();\r\n\t\t\t\t}\r\n\t\t\t});\r\n}\r\n/**\r\n * 渲染背景图片\r\n * \r\n */\r\nBlinkEwb.prototype.renderImage = function() {\r\n\tvar bgUrl = this.page.fileUrl;\r\n\tif (bgUrl != null && bgUrl != '') {\r\n\t\t// var image = JSON.parse('{\"height\":100,\"width\":100,\"room\":\"'\r\n\t\t// + this.roomKey + '\",\"page_id\":' + this.page.pageId + ',\"url\":\"'\r\n\t\t// + bgUrl + '\",\"urls\":[]}');\r\n\t\tvar image = {\r\n\t\t\t\"height\" : 100,\r\n\t\t\t\"width\" : 100,\r\n\t\t\t\"room\" : this.roomKey,\r\n\t\t\t\"page_id\" : this.page.pageId,\r\n\t\t\t\"url\" : bgUrl,\r\n\t\t\t\"urls\" : new Array()\r\n\t\t}\r\n\t\tthis.remoteImage(image);\r\n\t}\r\n}\r\n/**\r\n * 获取pageIndex\r\n * \r\n */\r\nBlinkEwb.prototype.getPageIndex = function() {\r\n\tfor (var i = 0; i < this.pageIds.length; i++) {\r\n\t\tif (this.page.pageId == this.pageIds[i]) {\r\n\t\t\treturn i + 1;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n/**\r\n * 上传\r\n * \r\n */\r\nBlinkEwb.prototype.upload = function() {\r\n\tvar blinkEwb = this;\r\n\t$(\"#uploadFileForm\").remove();\r\n\t$(document.body)\r\n\t\t\t.append(\r\n\t\t\t\t\t\"<form enctype=\\\"multipart/form-data\\\" method=\\\"post\\\" id=\\\"uploadFileForm\\\" name=\\\"uploadFileForm\\\">\"\r\n\t\t\t\t\t\t\t+ \"<input style=\\\"opacity: 0\\\" type=\\\"file\\\" id=\\\"file\\\" name=\\\"file\\\" runat=\\\"server\\\"/>\"\r\n\t\t\t\t\t\t\t+ \"<input type=\\\"hidden\\\" name=\\\"roomKey\\\" id=\\\"roomKey\\\" value=\\\"\"\r\n\t\t\t\t\t\t\t+ this.roomKey + \"\\\" />\" + \"</form>\");\r\n\t$(\"#file\").change(\r\n\t\t\tfunction() {\r\n\t\t\t\tif (this.value == '') {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tswal({\r\n\t\t\t\t\ttitle : \"\",\r\n\t\t\t\t\ttext : $L(\"File uploading, please wait\"),\r\n\t\t\t\t\ttype : \"\",\r\n\t\t\t\t\timageUrl : \"images/loading.gif\",\r\n\t\t\t\t\timageSize : \"32x32\",\r\n\t\t\t\t\tshowConfirmButton : false,\r\n\t\t\t\t\tallowEscapeKey : false\r\n\t\t\t\t});\r\n\t\t\t\tvar options = {\r\n\t\t\t\t\turl : blinkEwb.fileServerPath + \"/ewbfile/upload\",\r\n\t\t\t\t\tclearForm : true,\r\n\t\t\t\t\trestForm : true,\r\n\t\t\t\t\tasync : true,\r\n\t\t\t\t\tcache : false,\r\n\t\t\t\t\tbeforeSend : function(xhr, obj) {\r\n\t\t\t\t\t\t// 请求头加token\r\n\t\t\t\t\t\txhr.setRequestHeader(\"Authorization\", \"Bearer \"\r\n\t\t\t\t\t\t\t\t+ blinkEwb.token);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess : function(data) {\r\n\t\t\t\t\t\t$(\"#uploadFileForm\").remove();\r\n\t\t\t\t\t\tif (data.code == 200) {\r\n\t\t\t\t\t\t\tblinkEwb.uploadFile(data.data);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tswal.close();\r\n\t\t\t\t\t\t\t$.alert($L(\"File upload error, please try again\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror : function(err) {\r\n\t\t\t\t\t\t$(\"#uploadFileForm\").remove();\r\n\t\t\t\t\t\tswal.close();\r\n\t\t\t\t\t\t$.alert($L(\"File upload error, please try again\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t$(\"#uploadFileForm\").ajaxSubmit(options);\r\n\t\t\t}).click();\r\n}\r\n\r\n/** ----- loadPageInfo ---- */\r\n/**\r\n * loadPageInfo\r\n * \r\n */\r\nBlinkEwb.prototype.loadPageInfo = function(isLoadAll) {\r\n\tif (this.page != null) {\r\n\t\t// this.getRoomPages();\r\n\t\t// this.getPrints();\r\n\t\t// this.getLaserPrint();\r\n\t\tthis.loadData(isLoadAll);\r\n\t}\r\n}\r\n/**\r\n * 开始loadPageInfo\r\n * \r\n */\r\nBlinkEwb.prototype.startLoadPage = function() {\r\n\tthis.exitLoadPage();\r\n\r\n\tthis.loadPageInfo(true); // 立即执行一次, 第一次全加载\r\n\tvar blinkEwb = this;\r\n\tthis.loadPageInterval = setInterval(function() {\r\n\t\tblinkEwb.loadPageInfo();\r\n\t}, this.loadInterval);\r\n}\r\n/**\r\n * 停止loadPageInfo\r\n * \r\n */\r\nBlinkEwb.prototype.exitLoadPage = function() {\r\n\tif (this.loadPageInterval != null) {\r\n\t\tclearInterval(this.loadPageInterval);\r\n\t\tthis.loadPageInterval = null;\r\n\t}\r\n}\r\n/** ----- loadPageInfo ---- */\r\n/** ----- 调用上层的方法 ---- */\r\n/**\r\n * 调用上层remoteImage\r\n * \r\n */\r\nBlinkEwb.prototype.remoteImage = function(image) {\r\n\tthis.connection.remoteImage(this.connection, image);\r\n}\r\n/**\r\n * 调用上层remoteDraw\r\n * \r\n */\r\nBlinkEwb.prototype.remoteDraw = function(input) {\r\n\tthis.connection.remoteDraw(this.connection, input);\r\n}\r\n/**\r\n * 调用上层remoteDrawMany\r\n * \r\n */\r\nBlinkEwb.prototype.remoteDrawMany = function(input) {\r\n\tthis.connection.remoteDrawMany(this.connection, input);\r\n}\r\n/**\r\n * 调用上层remoteLaserRemove\r\n * \r\n */\r\nBlinkEwb.prototype.remoteLaserRemove = function() {\r\n\tthis.connection.remoteLaserRemove(this.connection, null);\r\n}\r\n/**\r\n * 调用上层remoteLaserDraw\r\n * \r\n */\r\nBlinkEwb.prototype.remoteLaserDraw = function(input) {\r\n\tthis.connection.remoteLaserDraw(this.connection, input);\r\n}\r\n/**\r\n * 调用上层clear\r\n * \r\n */\r\nBlinkEwb.prototype.remoteClear = function(reloadImage) {\r\n\tthis.connection.remoteClear(this.connection, reloadImage);\r\n}\r\n/**\r\n * 调用上层的上层setCurrentPage\r\n * \r\n */\r\nBlinkEwb.prototype.setCurrentPage = function() {\r\n\tvar pageIndex = this.getPageIndex();\r\n\tif (pageIndex != null) {\r\n\t\tthis.connection.whiteboard.setCurrentPage(pageIndex);\r\n\t}\r\n}\r\n/**\r\n * 调用上层的上层setTotalPages\r\n * \r\n */\r\nBlinkEwb.prototype.setTotalPages = function() {\r\n\tthis.connection.whiteboard.setTotalPages(this.pageIds);\r\n}\r\n/**\r\n * 调用上层的上层setPageFiles\r\n * \r\n */\r\nBlinkEwb.prototype.setPageFiles = function() {\r\n\tthis.connection.whiteboard.setPageFiles(this.pageFiles);\r\n}\r\n/** ----- 调用上层的方法 ---- */\r\n/** ----- 与server交互 ---- */\r\n/**\r\n * 获取room的入口page信息\r\n * \r\n */\r\nBlinkEwb.prototype.getEntryPage = function() {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"GET\",\r\n\t\turl : this.serverPath + \"/ewb/page/entry\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 200) {\r\n\t\t\t\tblinkEwb.handlePage(data.data);\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 处理page\r\n * \r\n */\r\nBlinkEwb.prototype.handlePage = function(page) {\r\n\tthis.page = page;\r\n\tthis.printId = 0;\r\n\tthis.laserPrintId = 0;\r\n\t// 渲染图片\r\n\tthis.renderImage();\r\n\t// 开始刷新\r\n\tthis.startLoadPage();\r\n}\r\n/**\r\n * 获取room的page集合\r\n * \r\n */\r\nBlinkEwb.prototype.getRoomPages = function() {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"GET\",\r\n\t\turl : this.serverPath + \"/ewb/page/datas\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 200) {\r\n\t\t\t\tblinkEwb.handlePages(data.data);\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 加载数据\r\n * \r\n */\r\nBlinkEwb.prototype.loadData = function(isLoadAll) {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"GET\",\r\n\t\turl : this.serverPath + \"/ewb/page/load\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t\tprintId : this.printId,\r\n\t\t\tlaserPrintId : this.laserPrintId,\r\n\t\t\tuserId : this.userId\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\t\t\t\tif (data.data.page.pageId != blinkEwb.page.pageId) { // 页面已切换\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t/** pages */\r\n\t\t\t\tblinkEwb.handlePages(data.data.pages);\r\n\t\t\t\t/** prints */\r\n\t\t\t\tblinkEwb.handlePrints(data.data.prints, !isLoadAll);\r\n\t\t\t\t/** laserPrint */\r\n\t\t\t\tblinkEwb.handleLaserPrint(data.data.laserPrint);\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 处理pages\r\n * \r\n */\r\nBlinkEwb.prototype.handlePages = function(pages) {\r\n\tthis.pages = pages;\r\n\tvar pageIds = new Array();\r\n\tvar pageFiles = new Array;\r\n\tfor (var i = 0; i < pages.length; i++) {\r\n\t\tvar page = pages[i];\r\n\t\tpageIds.push(page.pageId);\r\n\t\tpageFiles.push({\r\n\t\t\tfileUrl : (page.fileUrl == null ? \"\" : page.fileUrl),\r\n\t\t\tthumbnail : (page.thumbnail == null ? \"\" : page.thumbnail)\r\n\t\t});\r\n\t}\r\n\tthis.handlePageIds(pageIds);\r\n\tthis.handlePageFiles(pageFiles);\r\n}\r\n/**\r\n * 处理pageIds\r\n * \r\n */\r\nBlinkEwb.prototype.handlePageIds = function(pageIds) {\r\n\tthis.pageIds = pageIds;\r\n\t// 设置pageIndex\r\n\tthis.setCurrentPage();\r\n\t// 设置totalPages\r\n\tthis.setTotalPages();\r\n}\r\n/**\r\n * 处理pageFiles\r\n * \r\n */\r\nBlinkEwb.prototype.handlePageFiles = function(pageFiles) {\r\n\tthis.pageFiles = pageFiles;\r\n\t// 设置pageFiles\r\n\tthis.setPageFiles();\r\n}\r\n/**\r\n * 处理prints\r\n * \r\n */\r\nBlinkEwb.prototype.handlePrints = function(prints, isFilterOwn) {\r\n\tif (prints == null) { // if (data.msg == \"CLEAN\") { // 清空\r\n\t\tif (this.printId != 0) {\r\n\t\t\tthis.remoteClear(true);\r\n\t\t}\r\n\t\tthis.printId = 0;\r\n\t\t// this.laserPrintId = 0;\r\n\t} else if (prints.length > 0) {\r\n\t\tvar printId = 0;\r\n\t\t// var printPaths = \"\";\r\n\t\tvar printPathArr = new Array();\r\n\t\tfor (var i = 0; i < prints.length; i++) {\r\n\t\t\tvar print = prints[i];\r\n\t\t\tprintId = print.printId;\r\n\t\t\tif (isFilterOwn && this.userId == print.userId) { // 过滤自己画的\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t// var printData = JSON.stringify(print.data);\r\n\t\t\t// printPaths += printData.substring(2, printData.length -\r\n\t\t\t// 2).replace(\r\n\t\t\t// /\\\\\\\"/g, \"\\\"\")\r\n\t\t\t// + \",\";\r\n\t\t\tvar printDataArr = JSON.parse(print.data);\r\n\t\t\tprintPathArr = printPathArr.concat(printDataArr);\r\n\t\t}\r\n\t\tif (printId != 0) {\r\n\t\t\tthis.printId = printId;\r\n\t\t}\r\n\t\t// printPaths = printPaths.substring(0, printPaths.length - 1);\r\n\t\t// var input = JSON.parse('{\"room\":\"' + this.roomKey + '\",\"page_id\":'\r\n\t\t// + this.page.pageId + ',\"singlePath\":[' + printPaths + ']}');\r\n\t\tvar input = {\r\n\t\t\t\"room\" : this.roomKey,\r\n\t\t\t\"page_id\" : this.page.pageId,\r\n\t\t\t\"singlePath\" : printPathArr\r\n\t\t}\r\n\t\tthis.remoteDraw(input);\r\n\t\t// var input = JSON.parse('{\"room\":\"' + this.roomKey + '\",\"pages\":['\r\n\t\t// + this.pageIds + '],\"page_id\":' + this.page.pageId\r\n\t\t// + ',\"datas\":[' + printPaths + ']}');\r\n\t\t// this.remoteDrawMany(input);\r\n\t}\r\n}\r\n/**\r\n * 处理laserPrint\r\n * \r\n */\r\nBlinkEwb.prototype.handleLaserPrint = function(laserPrint) {\r\n\tif (laserPrint != null && laserPrint != '') {\r\n\t\t// var laserPrintDatas = \"\";\r\n\t\t// var laserPrintData = JSON.stringify(laserPrint.data);\r\n\t\t// laserPrintDatas += laserPrintData.substring(2,\r\n\t\t// laserPrintData.length - 2).replace(/\\\\\\\"/g, \"\\\"\");\r\n\t\t// var input = JSON.parse(laserPrintDatas);\r\n\t\t// if (input.x == null) {\r\n\t\t// if (this.laserPrintId != 0) {\r\n\t\t// this.remoteLaserRemove();\r\n\t\t// }\r\n\t\t// this.laserPrintId = 0;\r\n\t\t// } else {\r\n\t\t// this.laserPrintId = laserPrint.printId;\r\n\t\t// this.remoteLaserDraw(input);\r\n\t\t// }\r\n\t\tif (laserPrint.printId != this.laserPrintId) {\r\n\t\t\tvar input = JSON.parse(laserPrint.data);\r\n\t\t\tthis.remoteLaserDraw(input);\r\n\t\t\tthis.laserPrintId = laserPrint.printId;\r\n\t\t}\r\n\t} else {\r\n\t\tif (this.laserPrintId != 0) {\r\n\t\t\tthis.remoteLaserRemove();\r\n\t\t}\r\n\t\tthis.laserPrintId = 0;\r\n\t}\r\n}\r\n/**\r\n * 获取page信息\r\n * \r\n */\r\nBlinkEwb.prototype.getPage = function(pageId) {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"GET\",\r\n\t\turl : this.serverPath + \"/ewb/page/data\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : pageId\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\t\t\t\tblinkEwb.handlePage(data.data);\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 创建page\r\n * \r\n */\r\nBlinkEwb.prototype.createPage = function() {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/page/create\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 200) {\r\n\t\t\t\tblinkEwb.page = data.data;\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 上传图片\r\n * \r\n */\r\nBlinkEwb.prototype.uploadFile = function(file) {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/page/file\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tfile : file\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tswal.close();\r\n\t\t\tif (data.code == 200) {\r\n\t\t\t\t$.alert($L(\"File uploaded\"));\r\n\t\t\t\t// 跳转到入口页\r\n\t\t\t\tblinkEwb.gotoEntryPage();\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tswal.close();\r\n\t\t\t$.alert($L(\"File upload error, please try again\"));\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 上传图片\r\n * \r\n */\r\nBlinkEwb.prototype.uploadThumbnail = function(thumbnail) {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/page/thumbnail\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t\tthumbnail : thumbnail\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tconsole.debug(data.msg);\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 清理page的print\r\n * \r\n */\r\nBlinkEwb.prototype.cleanPagePrints = function() {\r\n\t// 停止刷新\r\n\tthis.exitLoadPage();\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/page/clean\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\t\t\t\tblinkEwb.printId = 0;\r\n\t\t\t\tblinkEwb.laserPrintId = 0;\r\n\t\t\t\tblinkEwb.remoteClear(true);\r\n\t\t\t\t// 继续刷新\r\n\t\t\t\tblinkEwb.startLoadPage();\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 删除page\r\n * \r\n */\r\nBlinkEwb.prototype.deletePage = function() {\r\n\t// 停止刷新\r\n\tthis.exitLoadPage();\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/page/delete\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 200 || data.code == 404) {\r\n\t\t\t\t// 跳转到入口页\r\n\t\t\t\tblinkEwb.gotoEntryPage();\r\n\t\t\t} else {\r\n\t\t\t\t// 继续刷新\r\n\t\t\t\tblinkEwb.startLoadPage();\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 查询print\r\n * \r\n */\r\nBlinkEwb.prototype.getPrints = function() {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"GET\",\r\n\t\turl : this.serverPath + \"/ewb/print/datas\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t\tprintId : this.printId,\r\n\t\t\tuserId : this.userId\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\t\t\t\tblinkEwb.handlePrints(data.data);\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 创建print\r\n * \r\n */\r\nBlinkEwb.prototype.createPrint = function(print, thumbnail) {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/print/create\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t\tuserId : this.userId,\r\n\t\t\tdata : print,\r\n\t\t\tthumbnail : thumbnail\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\t\t\t\t// 不再将创建的printId赋值\r\n\t\t\t\t// blinkEwb.printId = data.data.printId;\r\n\t\t\t\t// // 上传缩略图\r\n\t\t\t\t// if (thumbnail != null && thumbnail != \"\") {\r\n\t\t\t\t// blinkEwb.uploadThumbnail(thumbnail);\r\n\t\t\t\t// }\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 查询laserPrint\r\n * \r\n */\r\nBlinkEwb.prototype.getLaserPrint = function() {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"GET\",\r\n\t\turl : this.serverPath + \"/ewb/laserPrint/data\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t\tlaserPrintId : this.laserPrintId\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 200) {\r\n\t\t\t\tblinkEwb.handleLaserPrint(data.data);\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 创建laserPrint\r\n * \r\n */\r\nBlinkEwb.prototype.createLaserPrint = function(laserPrint) {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/laserPrint/create\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t\tdata : laserPrint\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/**\r\n * 清除laserPrint\r\n * \r\n */\r\nBlinkEwb.prototype.cleanPageLaserPrints = function() {\r\n\tvar blinkEwb = this;\r\n\tBlinkAjax({\r\n\t\ttype : \"POST\",\r\n\t\turl : this.serverPath + \"/ewb/laserPrint/clean\",\r\n\t\tasync : true,\r\n\t\tcache : false,\r\n\t\tdata : {\r\n\t\t\troomKey : this.roomKey,\r\n\t\t\tpageId : this.page.pageId,\r\n\t\t},\r\n\t\tdataType : \"json\",\r\n\t\tsuccess : function(data) {\r\n\t\t\tif (data.code == 404) {\r\n\t\t\t\tblinkEwb.pageNotFound();\r\n\t\t\t} else if (data.code == 200) {\r\n\t\t\t\tblinkEwb.laserPrintId = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$.alert(data.msg);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(err) {\r\n\t\t\tconsole.error(new Date());\r\n\t\t\tconsole.error(err);\r\n\t\t}\r\n\t}, this);\r\n}\r\n/** ----- 与server交互 ---- */\r\n/**\r\n * token失效\r\n * \r\n */\r\nBlinkEwb.prototype.tokenInvalid = function() {\r\n\t// 停止刷新\r\n\tthis.exitLoadPage();\r\n\t$.alert($L(\"Invalid token, please check\"));\r\n}\r\n/** ----- BlinkAjax ----- */\r\nvar BlinkAjax = function(opt, blinkEwb) {\r\n\tvar _ajax = $.ajax;\r\n\t// 备份opt中error和success方法\r\n\tvar fn = {\r\n\t\terror : function(XMLHttpRequest, textStatus, errorThrown) {\r\n\t\t},\r\n\t\tsuccess : function(data, textStatus) {\r\n\t\t},\r\n\t\tcomplete : function(XMLHttpRequest, textStatus) {\r\n\t\t},\r\n\t\tbeforeSend : function(XMLHttpRequest) {\r\n\t\t}\r\n\t};\r\n\tif (opt.error) {\r\n\t\tfn.error = opt.error;\r\n\t}\r\n\tif (opt.success) {\r\n\t\tfn.success = opt.success;\r\n\t}\r\n\tif (opt.beforeSend) {\r\n\t\tfn.beforeSend = opt.beforeSend;\r\n\t}\r\n\tif (opt.complete) {\r\n\t\tfn.complete = opt.complete;\r\n\t}\r\n\t// //扩展增强处理\r\n\tvar _opt = $.extend(opt, {\r\n\t\terror : function(xhr, textStatus, errorThrown) {\r\n\t\t\tif (xhr.status == 401) {\r\n\t\t\t\t// token失效提示\r\n\t\t\t\tblinkEwb.tokenInvalid();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// closeLoadingTip();\r\n\t\t\t// 错误方法增强处理\r\n\t\t\tfn.error(xhr, textStatus, errorThrown);\r\n\t\t},\r\n\t\tsuccess : function(data, textStatus) {\r\n\t\t\tif (data.code == 401) {\r\n\t\t\t\t// token失效提示\r\n\t\t\t\tblinkEwb.tokenInvalid();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// closeLoadingTip();\r\n\t\t\t// 成功回调方法增强处理\r\n\t\t\tfn.success(data, textStatus);\r\n\t\t},\r\n\t\tbeforeSend : function(xhr, obj) {\r\n\t\t\t// 请求头加token\r\n\t\t\txhr.setRequestHeader(\"Authorization\", \"Bearer \" + blinkEwb.token);\r\n\t\t\t// 提交前回调方法\r\n\t\t\tfn.beforeSend(xhr, obj);\r\n\t\t},\r\n\t\tcomplete : function(xhr, ts) {\r\n\t\t\t// 请求完成后回调函数 (请求成功或失败之后均调用)。\r\n\t\t\tfn.complete(xhr, ts);\r\n\t\t}\r\n\t});\r\n\treturn _ajax(_opt);\r\n}\r\n"
  },
  {
    "path": "rtc/whiteboard/src/js/common.js",
    "content": "/**\r\n * 从url中取参数\r\n * \r\n * @param name\r\n * @param url\r\n * @returns\r\n */\r\nfunction getParameterByName(name, url) {\r\n\tif (!url)\r\n\t\turl = window.location.href;\r\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\r\n\r\n\tvar regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\", \"i\"), results = regex\r\n\t\t\t.exec(url);\r\n\r\n\tif (!results)\r\n\t\treturn null;\r\n\tif (!results[2])\r\n\t\treturn '';\r\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\r\n}\r\n\r\n/**\r\n * guid\r\n * \r\n * @returns\r\n */\r\nfunction guid() {\r\n\tfunction s4() {\r\n\t\treturn Math.floor((1 + Math.random()) * 0x10000).toString(16)\r\n\t\t\t\t.substring(1);\r\n\t}\r\n\treturn s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4()\r\n\t\t\t+ s4() + s4();\r\n}\r\n\r\n/**\r\n * 延迟执行\r\n * \r\n */\r\nvar waitForFinalEvent = (function() {\r\n\tvar timers = {};\r\n\treturn function(callback, ms, uniqueId) {\r\n\t\tif (!uniqueId) {\r\n\t\t\tuniqueId = \"Don't call this twice without a uniqueId\";\r\n\t\t}\r\n\t\tif (timers[uniqueId]) {\r\n\t\t\tclearTimeout(timers[uniqueId]);\r\n\t\t}\r\n\t\ttimers[uniqueId] = setTimeout(callback, ms);\r\n\t};\r\n})();"
  },
  {
    "path": "rtc/whiteboard/src/js/core.js",
    "content": "var RongUtils = {\n  ObserverList: function () {\n    var checkIndexOutBound = function (index, bound) {\n      return index > -1 && index < bound;\n    };\n    this.observerList = [];\n    this.add = function (observer, force) {\n      force && (this.observerList.length = 0);\n      this.observerList.push(observer);\n    };\n    this.get = function (index) {\n      if (checkIndexOutBound(index, this.observerList.length)) {\n        return this.observerList[index];\n      }\n    };\n    this.count = function () {\n      return this.observerList.length;\n    };\n    this.removeAt = function (index) {\n      checkIndexOutBound(index, this.observerList.length) && this.observerList.splice(index, 1);\n    };\n    this.remove = function (observer) {\n      if (!observer) {\n        this.observerList.length = 0;\n        return;\n      }\n      observer = Object.prototype.toString.call(observer) == '[object Function]' ? [observer] : observer;\n      for (var i = 0, len = this.observerList.length; i < len; i++) {\n        if (this.observerList[i] === observer[i]) {\n          this.removeAt(i);\n          break;\n        }\n      }\n    };\n    this.notify = function (val) {\n      for (var i = 0, len = this.observerList.length; i < len; i++) {\n        this.observerList[i](val);\n      }\n    };\n    this.indexOf = function (observer, startIndex) {\n      var i = startIndex || 0,\n        len = this.observerList.length;\n      while (i < len) {\n        if (this.observerList[i] === observer) {\n          return i;\n        }\n        i++;\n      }\n      return -1;\n    };\n  },\n  Cache: function () {\n    var cache = {};\n    var set = function (key, value) {\n      cache[key] = value;\n    };\n    var get = function (key) {\n      return cache[key];\n    };\n    var remove = function (key) {\n      delete cache[key];\n    };\n    var update = function (key, value) {\n      set(key, value);\n    };\n    return {\n      set: set,\n      get: get,\n      update: update,\n      remove: remove\n    };\n  },\n  tplEngine: function (temp, data, regexp) {\n    if (!(Object.prototype.toString.call(data) === '[object Array]')) data = [data];\n    var ret = [];\n    for (var i = 0, j = data.length; i < j; i++) {\n      ret.push(replaceAction(data[i]));\n    }\n    return ret.join('');\n\n    function replaceAction(object) {\n      return temp.replace(regexp || (/{([^}]+)}/g), function (match, name) {\n        if (match.charAt(0) == '\\\\') return match.slice(1);\n        return (object[name] != undefined) ? object[name] : '{' + name + '}';\n      });\n    }\n  },\n  copy: function (target, source) {\n    for (var key in source) {\n      target[key] = source[key];\n    }\n  },\n  noop: function () { },\n  getRandom: function (range) {\n    return Math.floor(Math.random() * range);\n  },\n  getTimestamp: function (timestamp) {\n    var date = new Date();\n    if (timestamp > 0) {\n      date = new Date(timestamp);\n    }\n    return date.getTime();\n  },\n  forEach: function (obj, callback) {\n    callback = callback || utils.noop;\n    var loopObj = function () {\n      for (var key in obj) {\n        callback(obj[key], key, obj);\n      }\n    };\n    var loopArr = function () {\n      for (var i = 0, len = obj.length; i < len; i++) {\n        callback(obj[i], i);\n      }\n    };\n    if (utils.isObject(obj)) {\n      loopObj();\n    }\n    if (utils.isArray(obj)) {\n      loopArr();\n    }\n  },\n  rename: function (origin, newNames) {\n    var isObject = utils.isObject(origin);\n    if (isObject) {\n      origin = [origin];\n    }\n    origin = JSON.parse(JSON.stringify(origin));\n    var updateProperty = function (val, key, obj) {\n      delete obj[key];\n      key = newNames[key];\n      obj[key] = val;\n    };\n    utils.forEach(origin, function (item) {\n      utils.forEach(item, function (val, key, obj) {\n        var isRename = (key in newNames);\n        (isRename ? updateProperty : utils.noop)(val, key, obj);\n      });\n    });\n    return isObject ? origin[0] : origin;\n  },\n  isObject: function (obj) {\n    return (Object.prototype.toString.call(obj) == '[object Object]');\n  },\n  isArray: function (arr) {\n    return (Object.prototype.toString.call(arr) == '[object Array]');\n  },\n  isNumber: function (num) {\n    return (Object.prototype.toString.call(num) == '[object Number]');\n  },\n  isFunction: function (arr) {\n    return (Object.prototype.toString.call(arr) == '[object Function]');\n  },\n  //暂时支持 Object\n  isEmpty: function (obj) {\n    var result = true;\n    if (utils.isObject(obj)) {\n      utils.forEach(obj, function () {\n        result = false;\n      });\n    }\n    return result;\n  },\n  filter: function (arrs, callback) {\n    if (utils.isObject(arrs)) {\n      arrs = [arrs];\n    }\n    var result = [];\n    utils.forEach(arrs, function (item) {\n      callback(item) && result.push(item);\n    });\n    return result;\n  },\n  /* \n    var option = {\n      url: '',\n      method: '',\n      headers: {},\n      success: function(){},\n      fail: function(){}\n    };\n  */\n  ajax: function (option) {\n    var getXHR = function () {\n      var xhr = null;\n      var hasXDomain = function () {\n        return (typeof XDomainRequest != 'undefined');\n      };\n      var hasXMLRequest = function () {\n        return (typeof XMLHttpRequest != 'undefined');\n      };\n      if (hasXDomain()) {\n        xhr = new XDomainRequest();\n      } else if (hasXMLRequest()) {\n        xhr = new XMLHttpRequest();\n      } else {\n        xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n      }\n      return xhr;\n    };\n\n    var xhr = getXHR();\n    var method = option.method || 'GET';\n    var url = option.url;\n    var queryStrings = option.queryStrings || {};\n    var tpl = '{key}={value}', strings = [];\n    utils.forEach(queryStrings, function (value, key) {\n      var str = utils.tplEngine(tpl, {\n        key: key,\n        value: value\n      });\n      strings.push(str);\n    });\n    var queryString = strings.join('&');\n    var urlTpl = '{url}?{queryString}';\n    url = utils.tplEngine(urlTpl, {\n      url: url,\n      queryString: queryString\n    });\n\n    xhr.open(method, url, true);\n\n    var headers = option.headers || {};\n    utils.forEach(headers, function (header, name) {\n      xhr.setRequestHeader(name, header);\n    });\n\n    var success = option.success || utils.noop;\n    var fail = option.fail || utils.noop;\n    var isSuccess = function (result) {\n      return /^(200|202|10000)$/.test(result.code);\n    };\n\n    var onLoad = function () {\n      var result = xhr.responseText;\n      if (result != '') {\n        result = JSON.parse(xhr.responseText);\n      }\n      if (isSuccess(result)) {\n        success(result);\n      } else {\n        fail(result);\n      }\n    };\n    if ('onload' in xhr) {\n      xhr.onload = onLoad;\n    }\n    else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState == 4) {\n          onLoad();\n        }\n      };\n    }\n    xhr.send(JSON.stringify(option.body));\n  }\n};\nvar imageNode = document.querySelector(\".rong-image\");\nvar tableNode = document.querySelector(\".rong-table\");\nvar initDrag = function(node){\n  node.onmousedown = function (e) {\n    node.style.cursor = 'move';\n    var clientX = e.clientX, clientY = e.clientY;\n    var left = node.offsetLeft, top = node.offsetTop;\n    RongUtils.copy(node, {\n      startX: clientX - left,\n      startY: clientY - top\n    });\n    \n    var getStartPos = function(){\n      return {\n        x: node.startX,\n        y: node.startY\n      };\n    };\n    var getClientPos = function(e){\n      return {\n        x: e.clientX,\n        y: e.clientY\n      };\n    };\n  \n    var getBody = function(){\n      var body = document.body;\n      var space = 200;\n      return {\n        width: body.clientWidth - space,\n        height: body.clientHeight - space\n      }\n    };\n    var getPos = function(e){\n      var tpl = '{pos}px';\n      var startPos = getStartPos();\n      var startX = startPos.x;\n      var startY = startPos.y;\n  \n      var clientPos = getClientPos(e);\n      var clientX = clientPos.x;\n      var clientY = clientPos.y;\n  \n      var body = getBody();\n      var height = body.height;\n      var width = body.width;\n  \n      var left = clientX - startX;\n      left = (left < 0) ? 0 : left;\n      left = (left > width) ? width : left;\n  \n      var top = clientY - startY;\n      top = (top < 0) ? 0 : top;\n      top = (top > height) ? height : top;\n  \n      left = RongUtils.tplEngine(tpl, {\n        pos: left\n      });\n      top = RongUtils.tplEngine(tpl, {\n        pos: top\n      });\n  \n      return {\n        left: left,\n        top: top\n      };\n    };\n    node.onmousemove = function (e) {\n      var pos = getPos(e);\n      RongUtils.copy(node.style, pos);\n    };\n    node.onmouseup = function () {\n      node.onmousemove = null;\n      node.onmouseup = null;\n    };\n  }\n};\ninitDrag(imageNode);\ninitDrag(tableNode);\n\nvar getImageInfo = function(file, callback){\n  var url = URL.createObjectURL(file);\n  var image = new Image();\n  image.src = url;\n  image.onload = function(){\n    callback(image);\n  };\n};\nvar uploadNode = document.querySelector('#uploadFile');\nuploadNode.onchange = function(){\n  var file = this.files[0];\n  getImageInfo(file, function(image){\n    var url = URL.createObjectURL(file);\n    RongUtils.copy(imageNode.style, {\n      display: 'block',\n      backgroundImage: 'url(' + url + ')'\n    });\n  });\n};\n\nvar tbuttonNode = document.querySelector('.rong-button-table');\ntbuttonNode.onclick = function(){\n  tableNode.style.display = 'block'\n};\n\nvar clearNode = document.querySelector('.rong-button-clear');\nclearNode.onclick = function(){\n  uploadNode.value = '';\n  imageNode.style.backgroundImage = '';\n  tableNode.style.display = 'none';\n  imageNode.style.display = 'none';\n};\n"
  },
  {
    "path": "rtc/whiteboard/src/js/ewb/App.js",
    "content": "enyo.kind({\n    name: \"App\",\n    kind: \"FittableRows\",\n    fit: true,\n    style: \"border: 1px solid black\",\n\n    published: {\n        whiteboard: '',\n        curves: {\n            color: 'red',\n            width: '3px',\n        },\n        eraser: {\n            on: false,\n            color: 'white',\n            width: '9px',\n            previousDrawingItem: 'pen',\n        },\n        laser: {\n            on: false,\n            previousDrawingItem: 'pen'\n        },\n        pen: {\n            on: true,\n            previousDrawingItem: ''\n        },\n        highlighter: {\n            on: false,\n            previousDrawingItem: 'pen'\n        },\n        selecting: {\n            on: false,\n            previousDrawingItem: 'pen'\n        },\n        textEditing: {\n            on: false,\n            previousDrawingItem: 'pen'\n        },\n        uid: 'test',\n        vid: '',\n        room: 'one',\n        canvasWidth: 800,\n        canvasHeight: 600,\n        appIpAddress: \"\",\n        appPort: \"\",\n        role: 'host',\n        pagePreviewNum: 0,\n        perviewPagesNum: 6,\n        pagePreviewContainer: [],\n        parentContainer: \"\",\n        redis: '',\n        ticket: '',\n        expiredMinute: 240,\n    },\n\n    components: [{\n        kind: \"onyx.Toolbar\",\n        fit: false,\n        style: \"display:none; margin: auto; background: #009eeb;border:1px solid #119eeb;\",\n        name: \"topBar\",\n        components: [{\n            kind: \"onyx.Grabber\"\n        }, {\n            content: \"\",\n            style: \"text-transform: uppercase;letter-spacing:0.1em;\"\n        }, {\n            content: $L(\"Page\"),\n            name: \"channelId\",\n            style: \"text-transform: uppercase;letter-spacing:0.1em;font-size: 0.8em;font-weight:normal;\"\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right;display:none;\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"logoutButton\",\n                ontap: \"logout\",\n                onmouseover: \"logoutButtonMouseOver\",\n                onmouseout: \"logoutButtonMouseOut\",\n                style: \"background:url(images/btn_quit_gray.png) top left no-repeat transparent;cursor:pointer;\"\n            }, {\n                kind: 'onyx.Tooltip',\n                classes: 'above',\n                content: $L(\"Logout\")\n            }]\n        }],\n        rendered: function () {\n            this.inherited(arguments);\n            this.applyStyle(\"height\", 60 + \"px\");\n        }\n    }, {\n        kind: \"FittableRows\",\n        name: \"middleFittableRows\",\n        fit: true,\n        style: \"text-align: center; z-index: 0;\",\n        components: [{\n            kind: \"Scroller\",\n            classes: \"enyo-fit\",\n            style: \"overflow-x: hidden !important; overflow-y: hidden !important\",\n            components: [{\n                style: \"display:inline-block;height:40px;width:40px;padding:5px;background:url(images/btn_left.png) center center no-repeat #808080;position:absolute;left:1%;top:50%;cursor:pointer;z-index:10;border-radius:5px;cursor:pointer;position:fixed;\",\n                ontap: \"gotoPreviousPage\",\n                onmouseover: \"gotoPreviousPageMouseOver\",\n                onmouseout: \"gotoPreviousPageMouseOut\",\n                name: \"gotoPreviousPage\",\n            }, {\n                style: \"margin:0 auto auto; display:inline-block;\",\n                ontap: \"appclicked\",\n                ondragstart: \"touchstart\",\n                ondragover: \"touchmove\",\n                ondragfinish: \"touchend\",\n                name: \"canvasContainer\",\n                rendered: function () {\n                    this.inherited(arguments);\n\n                    if (window.self != window.top) {\n                        this.applyStyle(\"margin-top\", \"0\");\n                    }\n\n                    this.applyStyle(\"width\", this.owner.canvasWidth + \"px\");\n                    this.applyStyle(\"height\", this.owner.canvasHeight + \"px\");\n                    //                    this.applyStyle(\"box-shadow\", \"0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1)\")\n                    this.applyStyle(\"cursor\", \"auto\");\n                    this.applyStyle(\"cursor\", \"url(images/mouse.png) 4 4, auto\");\n\n                    if (window.location.protocol == 'https:') {\n                        var websocketAddress = 'wss://' + this.owner.appIpAddress + ':' + this.owner.appPort + '/realtime/';\n                    } else {\n                        var websocketAddress = 'ws://' + this.owner.appIpAddress + ':' + this.owner.appPort + '/realtime/';\n                    }\n                    var websocketAddress = 'wss://' + this.owner.appIpAddress + ':' + this.owner.appPort + '/realtime/';\n                    if (this.hasNode()) {\n                        var _this = this;\n                        this.owner.$.loadingPopup.show();\n                        this.owner.whiteboard = new WhiteboardSvg(\n                            this.node.getAttribute(\"id\"),\n                            this.owner,\n                            1,\n                            websocketAddress,\n                            this.owner.role,\n                            function (numPages, currentPage) {\n                                // update button status after being initialized.\n                                _this.owner.updatePageInfo();\n                                _this.owner.$.loadingPopup.hide();\n                                var template = $L.rb.getString(\"Page {n}\");\n                                var str = template.format({ n: _this.owner.whiteboard.getCurrentPage() });\n                                _this.owner.$.channelId.content = str;\n                                // render the change on the fly.\n                                _this.owner.$.channelId.render();\n                            }\n                        );\n                        window.parent.clearWhiteboard = function () {\n                            _this.owner.whiteboard.clear(true);\n                        };\n                    }\n                },\n            }, {\n                style: \"display:inline-block;height:40px;width:40px;padding:5px;background:url(images/btn_right.png) center center no-repeat #808080;position:absolute;right:1%;top:50%;cursor:pointer;z-index:10;border-radius:5px;cursor:pointer;position:fixed;\",\n                ontap: \"gotoNextPage\",\n                onmouseover: \"gotoNextPageMouseOver\",\n                onmouseout: \"gotoNextPageMouseOut\",\n                name: \"gotoNextPage\",\n            },],\n        }],\n    }, {\n        kind: \"onyx.MoreToolbar\",\n        name: \"bottomToolbar\",\n        style: \"background:#262626;height:61px;border:0 none;\",\n        components: [{\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float:left;margin-top: 6px;\",\n            name: \"uploadAndNewPageBtn\",\n            components: [{\n                kind: \"onyx.MenuDecorator\",\n                components: [{\n                    name: \"optionsMenu\",\n                    ontap: \"showOptionsMenu\",\n                    onmouseover: \"optionsPickerMouseOver\",\n                    onmouseout: \"optionsPickerMouseOut\",\n                    style: \"margin-top: 8px;background:url(images/wb.svg) 0 0 no-repeat transparent;cursor:pointer;\"\n                }, {\n                    kind: \"onyx.Menu\",\n                    components: [{\n                        name: \"upload\",\n                        ontap: \"uploadFileNew\",\n                        style: \"background:url(images/btn_computer.png) no-repeat 12px center #FFF;cursor:pointer;color: #000;border-bottom:1px solid #000;\",\n                        allowHtml: true,\n                        content: \"<p style='padding-left: 36px;'>\" + $L(\"Upload\") + \"</p>\"\n                    }, {\n                        name: \"newPage\",\n                        ontap: \"selectNewPage\",\n                        style: \"background:url(images/btn_newpage.png) no-repeat 12px center #FFF;cursor:pointer;color:#000;\",\n                        allowHtml: true,\n                        content: \"<p style='padding-left: 36px;'>\" + $L(\"New Page\") + \"</p>\"\n                    }],\n                }],\n            }, {\n                kind: 'onyx.Tooltip',\n                content: $L('Attach a file or create a new page.'),\n                classes: 'above',\n                style: \"margin-top: 20px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float:left;margin:6px 0 20px\",\n            components: [{\n                name: \"previewPages\",\n                kind: \"onyx.Button\",\n                ontap: \"selectPreviewPages\",\n                onmouseover: \"previewMouseOver\",\n                onmouseout: \"previewMouseOut\",\n                popup: \"previewPagesPopup\",\n                style: \"margin-top: 8px;background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -40px;cursor:pointer;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Preview Pages\"),\n                classes: \"above\",\n                style: \"margin-top: -10px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float:left;margin:8px 0 20px\",\n            components: [{\n                kind: \"onyx.Button\",\n                ontap: \"zoomInPane\",\n                name: \"zoomInButton\",\n                onmouseover: \"zoomInMouseOver\",\n                onmouseout: \"zoomInMouseOut\",\n                style: \"margin-top: 6px;background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -120px;cursor:pointer;\"\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Zoom In\"),\n                classes: \"above\",\n                style: \"margin-top: -10px;\"\n            }],\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float:left;margin:6px 0 20px\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"zoomOutButton\",\n                style: \"margin-top: 8px;background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -80px;cursor:pointer;\",\n                ontap: \"zoomOutPane\",\n                onmouseover: \"zoomOutMouseOver\",\n                onmouseout: \"zoomOutMouseOut\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Zoom Out\"),\n                classes: \"above\",\n                style: \"margin-top: -10px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right;\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"deletePage\",\n                ontap: \"deletePage\",\n                onmouseover: \"deleteButtonMouseOver\",\n                onmouseout: \"deleteButtonMouseOut\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -599px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Delete Page\"),\n                classes: \"above\",\n                style: \"margin-top: 15px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"clear\",\n                onmouseover: \"clearButtonMouseOver\",\n                onmouseout: \"clearButtonMouseOut\",\n                ontap: \"selectClear\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -559px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Clear Page\"),\n                classes: \"above\"\n            }],\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right\",\n            components: [{\n                name: \"eraser\",\n                kind: \"onyx.Button\",\n                ontap: \"selectEraser\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -519px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n                onmouseover: \"eraserMouseOver\",\n                onmouseout: \"eraserMouseOut\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Eraser\"),\n                classes: \"above\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float:right;\",\n            components: [{\n                kind: \"onyx.Button\",\n                ontap: \"undoPath\",\n                name: \"undoButton\",\n                onmouseover: \"undoButtonMouseOver\",\n                onmouseout: \"undoButtonMouseOut\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -479px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Undo\"),\n                classes: \"above\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right\",\n            components: [{\n                kind: \"onyx.Button\",\n                ontap: \"redoPath\",\n                name: \"redoButton\",\n                onmouseover: \"redoButtonMouseOver\",\n                onmouseout: \"redoButtonMouseOut\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -439px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Redo\"),\n                classes: \"above\"\n            }],\n        },\n        //{\n        //kind: \"onyx.Button\",\n        //classes: \"fa fa-crop\",\n        //ontap: \"cropContent\",\n        //style: \"float:right\",\n        //},\n        {\n            name: \"previewPagesPopup\",\n            kind: \"onyx.Popup\",\n            centered: false,\n            modal: false,\n            floating: true,\n            style: \"height:135px; padding:0 0 10px 0;background-color: rgba(0,0,0,0.5);bottom:61px;left:0;right:0;border-radius:0;\",\n            components: [{\n                name: \"selectPrevious\",\n                style: \"display:inline-block;float:left\",\n                content: \"<div style='width:40px;height:145px;background-image:url(images/btn_left.png);background-position:center center;background-repeat:no-repeat;margin:0;background-color:rgba(0,0,0,0.8);cursor:pointer;margin-left:-1px;'></div>\",\n                allowHtml: true,\n                ontap: \"selectPrevious\",\n            }, {\n                name: \"selectNext\",\n                style: \"display:inline-block;float:right;\",\n                content: \"<div style='width:40px;height:145px;background-image:url(images/btn_right.png);background-repeat:no-repeat;background-position:center center;margin:0;background-color:rgba(0,0,0,0.8);cursor:pointer;'></div>\",\n                allowHtml: true,\n                ontap: \"selectNext\",\n            }],\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right\",\n            components: [{\n                kind: \"onyx.Button\",\n                ontap: \"doSelect\",\n                name: \"selectButton\",\n                onmouseover: \"selectButtonMouseOver\",\n                onmouseout: \"selectButtonMouseOut\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -399px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Select\"),\n                classes: \"above\"\n            }],\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right;\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"laserPen\",\n                onmouseover: \"laserPenMouseOver\",\n                onmouseout: \"laserPenMouseOut\",\n                ontap: \"selectLaserPen\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -359px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Laser\"),\n                classes: \"above\",\n                style: \"margin-top: 15px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right;\",\n            components: [{\n                kind: \"onyx.PickerDecorator\",\n                components: [{\n                    name: \"penPicker\",\n                    kind: \"onyx.Button\",\n                    onmouseover: \"penPickerMouseOver\",\n                    onmouseout: \"penPickerMouseOut\",\n                    style: \"width:36px;background:url(images/wb.svg);background-repeat:no-repeat;background-position:0 -319px; background-color:transparent;height:30px;padding:0;cursor:pointer;margin:5px 0 20px;\",\n                }, {\n                    kind: \"onyx.Picker\",\n                    maxHeight: \"400px\",\n                    components: [{\n                        name: \"rectangle\",\n                        ontap: \"drawRectangle\",\n                        style: \"padding: 15px;background-image: url(images/icon_rectangle.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\"\n                    }, {\n                        name: \"square\",\n                        ontap: \"drawSquare\",\n                        style: \"padding: 15px;background-image: url(images/icon_square.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\"\n                    }, {\n                        name: \"circle\",\n                        ontap: \"drawCircle\",\n                        style: \"padding: 15px;background-image: url(images/icon_circle.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\"\n                    }, {\n                        name: \"triangle\",\n                        ontap: \"drawTriangle\",\n                        style: \"padding: 15px;background-image: url(images/icon_triangle.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\",\n                    }, {\n                        name: \"line\",\n                        ontap: \"drawLine\",\n                        style: \"padding: 15px;background-image: url(images/icon_line.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\",\n                    }, {\n                        name: \"arrow\",\n                        ontap: \"drawArrow\",\n                        style: \"padding: 15px;background-image: url(images/icon_arrow.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\",\n                    }, {\n                        name: \"ellipse\",\n                        ontap: \"drawEllipse\",\n                        style: \"padding: 15px;background-image: url(images/icon_oval.png);background-repeat:no-repeat;background-position: center center;cursor:pointer;\",\n                    }],\n                }],\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Shapes\"),\n                classes: \"above\",\n                style: \"margin-top: 10px;\"\n            }]\n        },\n        //{\n        //kind: \"onyx.TooltipDecorator\",\n        //style: \"float: right\",\n        //components: [{\n        //kind: \"onyx.Button\",\n        //ontap: \"addImage\",\n        //style: \"float:right;background-image:url(images/btn_img.png);background-repeat:no-repeat;background-color:transparent;\",\n        //}, {\n        //kind: \"onyx.Tooltip\",\n        //content: \"Add Image\",\n        //classes: \"above\"\n        //}]\n        //},\n        {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right;\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"addTextButton\",\n                onmouseover: \"addTextButtonMouseOver\",\n                onmouseout: \"addTextButtonMouseOut\",\n                ontap: \"addText\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -279px;cursor:pointer;margin:5px 0 20px;\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Add Text\"),\n                classes: \"above\",\n                style: \"margin-top: 15px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float:right;\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"highlighter\",\n                onmouseover: \"highlighterMouseOver\",\n                onmouseout: \"highlighterMouseOut\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:0 -239px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n                ontap: \"selectHighlighter\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Highlighter\"),\n                classes: \"above\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right\",\n            components: [{\n                kind: \"onyx.Button\",\n                name: \"pencilButton\",\n                onmouseover: \"pencilMouseOver\",\n                onmouseout: \"pencilMouseOut\",\n                style: \"background:url(images/wb.svg);background-repeat:no-repeat;background-color:transparent;background-position:-80px -199px;height:25px;cursor:pointer;margin:5px 0 20px;\",\n                ontap: \"selectPen\",\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Pen\"),\n                classes: \"above\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right;\",\n            components: [{\n                kind: \"onyx.PickerDecorator\",\n                style: \"width:50px;\",\n                components: [{\n                    name: \"lineWidthPicker\",\n                    kind: \"onyx.Button\",\n                    style: \"width: 40px;background:url(images/wb.svg);background-repeat:no-repeat;background-position:0 -159px;background-color:transparent;height:25px;cursor:pointer;margin:11px 10px 20px\",\n                }, {\n                    kind: \"onyx.Picker\",\n                    maxHeight: \"400px\",\n                    components: [{\n                        name: \"icon_line_1\",\n                        style: \"background-image:url(images/icon_line_1.png);background-repeat:no-repeat;background-position:center center;height:15px;cursor:pointer;\",\n                        ontap: \"setLineWidth1\"\n                    }, {\n                        name: \"icon_line_2\",\n                        style: \"background-image:url(images/icon_line_2.png);background-repeat:no-repeat;background-position:center center;height:15px;cursor:pointer;\",\n                        ontap: \"setLineWidth2\"\n                    }, {\n                        name: \"icon_line_3\",\n                        style: \"background-image:url(images/icon_line_3.png);background-repeat:no-repeat;background-position:center center;height:15px;cursor:pointer;\",\n                        ontap: \"setLineWidth3\"\n                    }, {\n                        name: \"icon_line_6\",\n                        style: \"background-image:url(images/icon_line_6.png);background-repeat:no-repeat;background-position:center center;height:15px;cursor:pointer;\",\n                        ontap: \"setLineWidth6\"\n                    }, {\n                        name: \"icon_line_8\",\n                        style: \"background-image:url(images/icon_line_8.png);background-repeat:no-repeat;background-position:center center;height:15px;cursor:pointer;\",\n                        ontap: \"setLineWidth8\"\n                    }, {\n                        name: \"icon_line_10\",\n                        style: \"background-image:url(images/icon_line_10.png);background-repeat:no-repeat;background-position:center center;height:15px;cursor:pointer;\",\n                        ontap: \"setLineWidth10\"\n                    }]\n                }]\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Line Width\"),\n                classes: \"above\",\n                style: \"margin-top: 15px;\"\n            }]\n        }, {\n            kind: \"onyx.TooltipDecorator\",\n            style: \"float: right\",\n            components: [{\n                kind: \"onyx.PickerDecorator\",\n                style: \"border:1px solid #FFF;margin:5px 0 20px;\",\n                name: \"colorPickerWrapper\",\n                components: [{\n                    name: \"colorPicker\",\n                    kind: \"onyx.Button\",\n                    style: \"background-color: red;height:30px;cursor:pointer;\",\n                }, {\n                    kind: \"onyx.Picker\",\n                    name: \"colorItemSelectedHolder\",\n                    onChange: \"colorItemSelected\",\n                    maxHeight: \"400px\",\n                    components: [{\n                        name: \"red\",\n                        style: \"background-color: red;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"orange\",\n                        style: \"background-color: orange;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"yellow\",\n                        style: \"background-color: yellow;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"blue\",\n                        style: \"background-color: blue;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"cyan\",\n                        style: \"background-color: cyan;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"green\",\n                        style: \"background-color: green;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"black\",\n                        style: \"background-color: black;height:6px;width:30px;cursor:pointer;\",\n                    }, {\n                        name: \"purple\",\n                        style: \"background-color: purple;height:6px;width:30px;cursor:pointer;\",\n                    }]\n                },],\n            }, {\n                kind: \"onyx.Tooltip\",\n                content: $L(\"Color\"),\n                classes: \"above\",\n                style: \"margin-top: 15px;\"\n            }]\n        }, {\n            name: \"loadingPopup\",\n            kind: \"onyx.Popup\",\n            centered: true,\n            autoDismiss: false,\n            modal: true,\n            floating: true,\n            components: [{\n                kind: \"onyx.Spinner\"\n            },],\n        }\n        ],\n    }],\n    rendered: function () {\n        this.inherited(arguments);\n        /*if (this.isMobile() || this.isGuest()) {\n            this.$.bottomToolbar.hide();\n            this.$.uploadAndNewPageBtn.hide();\n            this.$.gotoPreviousPage.hide();\n            this.$.gotoNextPage.hide();\n            this.$.middleFittableRows.parent.resize();\n        }*/\n        this.$.gotoPreviousPage.hide();\n        this.$.gotoNextPage.hide();\n        if (this.isMobile() || this.isGuest()) {\n            this.$.uploadAndNewPageBtn.hide();\n            //        \tthis.$.previewPages.hide();\n            //        \tthis.$.zoomInButton.hide();\n            //        \tthis.$.zoomOutButton.hide();\n            this.$.colorPickerWrapper.hide();\n            this.$.lineWidthPicker.hide();\n            this.$.pencilButton.hide();\n            this.$.highlighter.hide();\n            this.$.addTextButton.hide();\n            this.$.penPicker.hide();\n            this.$.laserPen.hide();\n            this.$.selectButton.hide();\n            this.$.redoButton.hide();\n            this.$.undoButton.hide();\n            this.$.eraser.hide();\n            this.$.clear.hide();\n            this.$.deletePage.hide();\n            this.closePen();\n            this.$.middleFittableRows.parent.resize();\n\n            //        \tthis.$.bottomToolbar.hide();\n            //        \tthis.$.gotoPreviousPage.hide();\n            //        \tthis.$.gotoNextPage.hide();\n            //\t\t\tthis.closePen();\n            //\t\t\tthis.$.middleFittableRows.parent.resize();\n        }\n        if (this.isMobile()) { // 绑定手势\n            var _this = this;\n            var svg = document.getElementsByTagName('svg')[0];\n            var hamSvg = new Hammer(svg);\n            // pinch\n            hamSvg.get('pinch').set({\n                enable: true\n            });\n            hamSvg.on(\"pinchend\", function (e) {\n                // 缩放\n                if (e.additionalEvent == 'pinchin') {\n                    _this.zoomOutPane();\n                } else if (e.additionalEvent == 'pinchout') {\n                    _this.zoomInPane();\n                }\n            });\n            // swipe\n            hamSvg.get('swipe').set({\n                direction: Hammer.DIRECTION_ALL\n            });\n            hamSvg.on('swipeleft', function (e) {\n                if (_this.whiteboard.zoomRatio > _this.whiteboard.zoomRatioCustom) {\n                    return;\n                }\n                // 隐藏预览窗口\n                _this.$.previewPagesPopup.hide();\n                // 向后翻页\n                _this.gotoNextPage();\n            });\n            hamSvg.on('swiperight', function (e) {\n                if (_this.whiteboard.zoomRatio > _this.whiteboard.zoomRatioCustom) {\n                    return;\n                }\n                // 隐藏预览窗口\n                _this.$.previewPagesPopup.hide();\n                // 向前翻页\n                _this.gotoPreviousPage();\n            });\n\t\t\t/*hamSvg.on('swipedown', function(e) {\n\t\t\t\tif (_this.whiteboard.zoomRatio > _this.whiteboard.zoomRatioCustom) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// 预览窗口\n\t\t\t\t// $(\"#app_previewPages\").click();\n\t\t\t\t_this.triggerClick($(\"#app_previewPages\")[0]);\n\t\t\t});*/\n        }\n    },\n\n    zoomInPane: function (inSender, inEvent) {\n        this.closeEraser();\n        this.whiteboard.zoomIn();\n    },\n\n    zoomOutPane: function (inSender, inEvent) {\n        this.closeEraser();\n        this.whiteboard.zoomOut();\n    },\n\n    undoPath: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        //this.whiteboard.undo();\n        this.whiteboard.undoWithDrawing();\n    },\n\n    redoPath: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        //this.whiteboard.redo();\n        this.whiteboard.redoWithDrawing();\n    },\n\n    cropContent: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.whiteboard.cropContent();\n    },\n\n    /*uploadFileNew: function(inSender, inEvent) {\n        // cleanup the divs left over\n        $(\".ajax-file-upload-container\").remove();\n\n        var x = $('#file-upload-root');\n        if (!x || x.length === 0) {\n            $(document.body).append(\"<span id='file-upload-root' style='z-index:-1000;position:relative;'></span>\");\n        }\n//      var u = 'https://' + this.appIpAddress + ':' + this.appPort + '/upload';\n        var u = ewb_file_server_path + \"/ewb/upload\";\n        var self = this;\n        console.log(this.vid);\n        $(\"#file-upload-root\").uploadFile({\n            url: u,\n            multiple: false,\n            dragDrop: false,\n            maxFileCount: 1,\n//          fileName: \"myfile\",\n            fileName: \"file\",\n            showFileCounter: false,\n            formData: {\n  \t\t\t\troomKey: ewb_roomKey\n//\t\t\t\troom: this.whiteboard.room,\n//              vid: this.vid,\n//              uid: this.whiteboard.uid\n            },\n            onSuccess: function(files, data, xhr, pd) {\n                setTimeout(function() {\n                    $(\".ajax-file-upload-container\").empty();\n                }, 3000);\n\n//                if (data == 'succ') {\n//                    noty({\n//                        text: $L(\"File uploaded\"),\n//                        type: \"success\",\n//                        theme: \"relax\",\n//                        timeout: 6000\n//                    });\n//                } else {\n//                    noty({\n//                        text: $L(\"File upload error, please try again\"),\n//                        type: \"error\",\n//                        theme: \"relax\"\n//                    });\n//                }\n                if (data.code == 200) {\n\t\t\t\t\tself.whiteboard.connection.blinkEwb.uploadFile(data.data);\n\t\t\t\t} else {\n\t\t\t\t\tnoty({\n                      text: $L(\"File upload error, please try again\"),\n                      type: \"error\",\n                      theme: \"relax\"\n                  });\n\t\t\t\t}\n            },\n            afterUploadAll: function(obj) {\n                noty({\n                    text: $L(\"File uploaded\"),\n                    type: \"success\",\n                    theme: \"relax\",\n                    timeout: 6000\n                });\n            },\n            onError: function(files, status, errMsg, pd) {\n                noty({\n                    text: $L(\"File upload error, please try again\"),\n                    type: \"error\",\n                    theme: \"relax\"\n                });\n                console.log(\"Upload error with msg: \" + errMsg + \", status: \" + status);\n\n                $(\".ajax-file-upload-container\").empty();\n            },\n            onCancel: function(files, pd) {\n                noty({\n                    text: $L(\"File upload has been cancelled\"),\n                    type: \"success\",\n                    theme: \"relax\",\n                    timeout: 6000\n                });\n            }\n        });\n        setTimeout(function() {\n            $(\"input[id^='ajax-upload-id']\").trigger(\"click\");\n        }, 1000);\n    },*/\n    uploadFileNew: function () {\n        this.whiteboard.connection.blinkEwb.upload();\n    },\n    showOptionsMenu: function () {\n        var _this = this;\n        _this.$.previewPagesPopup.hide()\n    },\n    drawRectangle: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawRectangle();\n        this.highlightPenPicker();\n    },\n\n    drawSquare: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawSquare();\n        this.highlightPenPicker();\n    },\n\n    drawLine: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawLine();\n        this.highlightPenPicker();\n    },\n\n    drawTriangle: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawTriangle();\n        this.highlightPenPicker();\n    },\n\n    drawArrow: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawArrow();\n        this.highlightPenPicker();\n    },\n\n    drawEllipse: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawEllipse();\n        this.highlightPenPicker();\n    },\n\n    drawCircle: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.closePen();\n        this.hideLaser();\n        this.whiteboard.drawCircle();\n        this.highlightPenPicker();\n    },\n\n    appclicked: function (inSender, inEvent) {\n        if (this.isGuest()) {\n            return;\n        }\n        var canvasBounds = this.$.canvasContainer.getBounds();\n        var x = inEvent.pageX - canvasBounds.left;\n        var y = inEvent.pageY - canvasBounds.top;\n\n        this.whiteboard.appclicked({\n            x: x,\n            y: y,\n            laserOn: this.laser.on,\n            event: inEvent,\n            canvas: canvasBounds\n        });\n\n        // Enable eraser if there is at least one elements been selected.\n        if (this.whiteboard.hasSelectElement()) {\n            this.highlightEraser();\n        }\n\n        //this.cancelEditingText();\n    },\n\n    touchstart: function (inSender, inEvent) {\n        document.ondragstart = function () {\n            return false;\n        }\n        if (this.isGuest()) {\n            return;\n        }\n\n        var scrollTop = this.$.scroller.scrollTop;\n        var scrollLeft = this.$.scroller.scrollLeft;\n        var canvasBounds = this.$.canvasContainer.getBounds();\n        this.curves.oldx = inEvent.pageX - canvasBounds.left + scrollLeft;\n        this.curves.oldy = inEvent.pageY - canvasBounds.top + scrollTop;\n        this.whiteboard.startPath(this.curves.oldx, this.curves.oldy, this.curves.color, this.curves.width, true);\n    },\n\n    touchmove: function (inSender, inEvent) {\n        if (this.isGuest()) {\n            return;\n        }\n        if (this.curves.oldx != -1 && this.curves.oldy != -1) {\n            var scrollTop = this.$.scroller.scrollTop;\n            var scrollLeft = this.$.scroller.scrollLeft;\n            var canvasBounds = this.$.canvasContainer.getBounds();\n            x = inEvent.pageX - canvasBounds.left + scrollLeft;\n            y = inEvent.pageY - canvasBounds.top + scrollTop;\n            this.whiteboard.continuePath(this.curves.oldx, this.curves.oldy, x, y, this.curves.color, this.curves.width, undefined, true);\n            this.curves.oldx = x;\n            this.curves.oldy = y;\n        }\n    },\n\n    touchend: function (inSender, inEvent) {\n\n        if (this.isGuest()) {\n            return;\n        }\n        if (this.curves.oldx != -1 && this.curves.oldy != -1) {\n            var scrollTop = this.$.scroller.scrollTop;\n            var scrollLeft = this.$.scroller.scrollLeft;\n            var canvasBounds = this.$.canvasContainer.getBounds();\n            x = inEvent.pageX - canvasBounds.left + scrollLeft;\n            y = inEvent.pageY - canvasBounds.top + scrollTop;\n            this.whiteboard.endPath(this.curves.oldx, this.curves.oldy, x, y, this.curves.color, this.curves.width, undefined, true);\n            this.curves.oldx = -1;\n            this.curves.oldy = -1;\n        }\n    },\n\n    _isWhiteColor: function (color) {\n        if (!color) {\n            return false;\n        }\n        return color.match(/^(?:white|#fff(?:fff)?|rgba?\\(\\s*255\\s*,\\s*255\\s*,\\s*255\\s*(?:,\\s*1\\s*)?\\))$/i);\n    },\n\n    closeEraser: function () {\n        if (!this.eraser.on) return;\n\n        this.eraser.on = false;\n        this.$.eraser.applyStyle(\"background-position\", \"-80px -360px\");\n    },\n\n    selectEraser: function (inSender, inEvent) {\n        this.whiteboard.removeSelected(true);\n        this.cancelEditingText();\n    },\n\n    selectLaserPen: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.cancelEditingText();\n        this.laser.on ? this.hideLaser() : this.showLaser();\n    },\n\n    showLaser: function () {\n        this.laser.on = true;\n        this.laser.previousDrawingItem = this.whiteboard.getDrawingItem();\n        this.whiteboard.setDrawingItem(\"\");\n        this.whiteboard.drawLaser();\n        this.$.laserPen.applyStyle(\"background-position\", \"-80px -360px\");\n    },\n\n    hideLaser: function () {\n        this.laser.on = false;\n        this.whiteboard.setDrawingItem(this.laser.previousDrawingItem);\n        this.whiteboard.removeLaser();\n        this.$.laserPen.applyStyle(\"background-position\", \"0 -360px\");\n    },\n\n    openHighlighter: function () {\n        if (this.highlighter.on) {\n            return;\n        }\n        this.highlighter.on = true;\n        this.$.highlighter.applyStyle(\"background-position\", \"-80px -239px\");\n        this.whiteboard.selectHighlighter();\n    },\n\n    closeHighlighter: function () {\n        if (!this.highlighter.on) {\n            return;\n        }\n\n        this.highlighter.on = false;\n        this.whiteboard.setDrawingItem(this.highlighter.previousDrawingItem);\n        this.$.highlighter.applyStyle(\"background-position\", \"0px -239px\");\n    },\n\n    selectHighlighter: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closePen();\n        this.cancelEditingText();\n        this.dimPenPicker();\n        //this.highlighter.on ? this.closeHighlighter() : this.openHighlighter();\n        this.hideLaser();\n        this.openHighlighter();\n    },\n\n    openPen: function () {\n        if (this.pen.on) return;\n\n        this.pen.on = true;\n        this.$.pencilButton.applyStyle(\"background-position\", \"-80px -199px\");\n        this.pen.previousDrawingItem = this.whiteboard.getDrawingItem();\n        this.whiteboard.selectPen();\n    },\n\n    closePen: function () {\n        if (!this.pen.on) return;\n\n        this.pen.on = false;\n        this.$.pencilButton.applyStyle(\"background-position\", \"0px -199px\");\n        this.whiteboard.setDrawingItem(this.pen.previousDrawingItem);\n    },\n\n    selectPen: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.closeHighlighter();\n        this.cancelEditingText();\n        this.dimPenPicker();\n        this.hideLaser();\n        //this.pen.on ? this.closePen() : this.openPen();\n        this.openPen();\n    },\n\n    addText: function (inSender, inEvent) {\n        this.textEditing.previousDrawingItem = this.whiteboard.getDrawingItem();\n        this.closeEraser();\n        this.cancelSelect();\n        this.closePen();\n        this.closeHighlighter();\n        this.dimPenPicker();\n        this.hideLaser();\n\n        //this.textEditing.on ? this.cancelEditingText() : this.startEditingText();\n        this.startEditingText();\n    },\n\n    startEditingText: function () {\n        if (!this.textEditing) return;\n\n        this.textEditing.on = true;\n        this.$.addTextButton.applyStyle(\"background-position\", \"-80px -279px\");\n        //this.textEditing.previousDrawingItem = this.whiteboard.getDrawingItem();\n        this.whiteboard.addText();\n    },\n\n    cancelEditingText: function () {\n        if (!this.textEditing.on) return;\n\n        this.textEditing.on = false;\n        this.$.addTextButton.applyStyle(\"background-position\", \"0 -279px\");\n        this.whiteboard.stopAddingText(this.textEditing.previousDrawingItem);\n        //this.restoreSelectedButtonState(this.textEditing.previousDrawingItem);\n    },\n\n    restoreSelectedButtonState: function (drawingItem) {\n        switch (drawingItem) {\n            case 'pen':\n                this.selectPen();\n                break;\n            case 'highlighter':\n                this.selectHighlighter();\n                break;\n            case 'circle':\n                this.drawCircle();\n                break;\n            case 'triangle':\n                this.drawTriangle();\n                break;\n            case 'rectangle':\n                this.drawRectangle();\n                break;\n            case 'ellipse':\n                this.drawEllipse();\n                break;\n            case 'arrow':\n                this.drawArrow();\n                break;\n            case 'line':\n                this.drawLine();\n                break;\n            case 'square':\n                this.drawSquare();\n                break;\n        }\n    },\n\n    setLineWidth1: function (inSender, inEvent) {\n        this.setLineWidthN(1);\n    },\n\n    setLineWidth2: function (inSender, inEvent) {\n        this.setLineWidthN(2);\n    },\n\n    setLineWidth3: function (inSender, inEvent) {\n        this.setLineWidthN(3);\n    },\n\n    setLineWidth6: function (inSender, inEvent) {\n        this.setLineWidthN(6);\n    },\n\n    setLineWidth8: function (inSender, inEvent) {\n        this.setLineWidthN(8);\n    },\n\n    setLineWidth10: function (inSender, inEvent) {\n        this.setLineWidthN(10);\n    },\n\n    setLineWidthN: function (width) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.curves.width = String(width) + 'px';\n        this.$.lineWidthPicker.applyStyle(\"background\", \"url(images/icon_line_\" + width + \"_white.png),url(images/icon_more.png)\");\n        this.$.lineWidthPicker.applyStyle(\"background-repeat\", \"no-repeat no-repeat\");\n        this.$.lineWidthPicker.applyStyle(\"background-position\", \"left center, right center\");\n        this.$.lineWidthPicker.applyStyle(\"background-color\", \"transparent\");\n        this.$.lineWidthPicker.applyStyle(\"background-size\", \"25px,10px\");\n        this.$.lineWidthPicker.applyStyle(\"margin\", \"5px 0 20px\");\n    },\n\n    optionSelected: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        var name = inEvent.originator.name;\n        switch (name) {\n            case \"clear\":\n                this.selectClear(inSender, inEvent);\n                break;\n            case \"createJoinRoom\":\n                this.selectCreateJoinRoom(inSender, inEvent);\n                break;\n            case \"getVideo\":\n                this.selectGetVideo(inSender, inEvent);\n                break;\n            case \"exportToSvg\":\n                this.selectExportToSvg(inSender, inEvent);\n                break;\n        }\n    },\n\n    colorItemSelected: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        var color = inEvent.selected.name;\n        this.$.colorPicker.applyStyle(\"background-color\", color);\n        this.curves.color = color;\n    },\n\n    clearButtonMouseOver: function (inSender, inEvent) {\n        this.$.clear.applyStyle(\"background-position\", \"-80px -559px\");\n    },\n\n    clearButtonMouseOut: function (inSender, inEvent) {\n        this.$.clear.applyStyle(\"background-position\", \"0 -559px\");\n    },\n\n    highlightEraser: function () {\n        this.$.eraser.applyStyle(\"background-position\", \"-80px -519px\");\n    },\n\n    eraserMouseOver: function (inSender, inEvent) {\n        this.highlightEraser();\n    },\n\n    eraserMouseOut: function (inSender, inEvent) {\n        if (!this.eraser.on) {\n            this.$.eraser.applyStyle(\"background-position\", \"0 -519px\");\n        }\n    },\n    deletePage: function (inSender, inEvent) {\n        var totalPagesNum = this.whiteboard.getNumPages(),\n            self = this;\n        if (totalPagesNum <= 1) {\n            $.alert($L(\"The last page cannot be deleted.\"));\n            return;\n        }\n        var yes = $.confirm({\n            title: $L(\"Confirm\"),\n            content: $L(\"Do you want to delete this page?\"),\n            confirm: function () {\n                self.whiteboard.deletePage();\n            },\n            cancel: function () {\n                // do nothing.\n            }\n        });\n    },\n    deleteButtonMouseOver: function (inSender, inEvent) {\n        this.$.deletePage.applyStyle(\"background-position\", \"-80px -599px\");\n    },\n\n    deleteButtonMouseOut: function (inSender, inEvent) {\n        this.$.deletePage.applyStyle(\"background-position\", \"0 -599px\");\n    },\n\n    undoButtonMouseOver: function (inSender, inEvent) {\n        this.$.undoButton.applyStyle(\"background-position\", \"-80px -479px\");\n    },\n\n    undoButtonMouseOut: function (inSender, inEvent) {\n        this.$.undoButton.applyStyle(\"background-position\", \"0 -479px\");\n    },\n\n    redoButtonMouseOver: function (inSender, inEvent) {\n        this.$.redoButton.applyStyle(\"background-position\", \"-80px -439px\")\n    },\n\n    redoButtonMouseOut: function (inSender, inEvent) {\n        this.$.redoButton.applyStyle(\"background-position\", \"0 -439px\");\n    },\n\n    selectButtonMouseOver: function (inSender, inEvent) {\n        this.$.selectButton.applyStyle(\"background-position\", \"-80px -399px\");\n    },\n\n    selectButtonMouseOut: function (inSender, inEvent) {\n        if (!this.selecting.on) {\n            this.$.selectButton.applyStyle(\"background-position\", \"0 -399px\");\n        }\n    },\n\n    laserPenMouseOver: function (inSender, inEvent) {\n        this.$.laserPen.applyStyle(\"background-position\", \"-80px -360px\");\n    },\n\n    laserPenMouseOut: function (inSender, inEvent) {\n        if (!this.laser.on) {\n            this.$.laserPen.applyStyle(\"background-position\", \"0 -360px\");\n        }\n    },\n\n    highlightPenPicker: function () {\n        this.$.penPicker.applyStyle(\"background\", \"url(images/wb.svg)\");\n        this.$.penPicker.applyStyle(\"background-repeat\", \"no-repeat\");\n        this.$.penPicker.applyStyle(\"background-position\", \"-80px -319px\");\n        this.$.penPicker.applyStyle(\"background-color\", \"transparent\");\n        //        this.$.penPicker.applyStyle(\"background-size\", \"25px,10px\");\n    },\n\n    penPickerMouseOver: function (inSender, inEvent) {\n        this.highlightPenPicker()\n    },\n\n    dimPenPicker: function () {\n        this.$.penPicker.applyStyle(\"background\", \"url(images/wb.svg)\");\n        this.$.penPicker.applyStyle(\"background-repeat\", \"no-repeat\");\n        this.$.penPicker.applyStyle(\"background-position\", \"0 -319px\");\n        this.$.penPicker.applyStyle(\"background-color\", \"transparent\");\n        //        this.$.penPicker.applyStyle(\"background-size\", \"25px,10px\");\n    },\n\n    penPickerMouseOut: function (inSender, inEvent) {\n        var allShapes = ['circle', 'triangle', 'rectangle', 'ellipse', 'arrow', 'line', 'square'];\n        if (allShapes.indexOf(this.whiteboard.getDrawingItem()) >= 0) {\n            // keep it highlighted if current drawing item is one of the shapes.\n            return;\n        }\n        this.dimPenPicker();\n    },\n\n    addTextButtonMouseOver: function (inSender, inEvent) {\n        this.$.addTextButton.applyStyle(\"background-position\", \"-80px -279px\");\n    },\n\n    addTextButtonMouseOut: function (inSender, inEvent) {\n        if (!this.textEditing.on) {\n            this.$.addTextButton.applyStyle(\"background-position\", \"0 -279px\");\n        }\n    },\n\n    highlighterMouseOver: function (inSender, inEvent) {\n        this.$.highlighter.applyStyle(\"background-position\", \"-80px -239px\");\n    },\n\n    highlighterMouseOut: function (inSender, inEvent) {\n        if (!this.highlighter.on) {\n            this.$.highlighter.applyStyle(\"background-position\", \"0 -239px\");\n        }\n    },\n\n    pencilMouseOver: function (inSender, inEvent) {\n        this.$.pencilButton.applyStyle(\"background-position\", \"-80px -199px\");\n    },\n\n    pencilMouseOut: function (inSender, inEvent) {\n        if (!this.pen.on) {\n            this.$.pencilButton.applyStyle(\"background-position\", \"0 -199px\");\n        }\n    },\n\n    logoutButtonMouseOver: function (inSender, inEvent) {\n        this.$.logoutButton.applyStyle(\"background-image\", \"url(images/btn_quit.png)\");\n    },\n\n    logoutButtonMouseOut: function (inSender, inEvent) {\n        this.$.logoutButton.applyStyle(\"background-image\", \"url(images/btn_quit_gray.png)\");\n    },\n\n    optionsPickerMouseOver: function (inSender, inEvent) {\n        this.$.optionsMenu.applyStyle(\"background-position\", \"-80px 0\");\n    },\n\n    optionsPickerMouseOut: function (inSender, inEvent) {\n        this.$.optionsMenu.applyStyle(\"background-position\", \"0 0\");\n    },\n\n    zoomOutMouseOver: function (inSender, inEvent) {\n        this.$.zoomOutButton.applyStyle(\"background-position\", \"-80px -80px\");\n    },\n\n    zoomOutMouseOut: function (inSender, inEvent) {\n        this.$.zoomOutButton.applyStyle(\"background-position\", \"0 -80px\");\n    },\n\n    zoomInMouseOver: function (inSender, inEvent) {\n        this.$.zoomInButton.applyStyle(\"background-position\", \"-80px -120px\");\n    },\n\n    zoomInMouseOut: function (inSender, inEvent) {\n        this.$.zoomInButton.applyStyle(\"background-position\", \"0 -120px\");\n    },\n\n    previewMouseOver: function (inSender, inEvent) {\n        this.$.previewPages.applyStyle(\"background-position\", \"-80px -40px\");\n    },\n\n    previewMouseOut: function (inSender, inEvent) {\n        this.$.previewPages.applyStyle(\"background-position\", \"0 -40px\");\n    },\n    selectPreviewPages: function (inSender, inEvent, flag) {\n        var totalPages = this.whiteboard.getNumPages(),\n            index;\n        // Minus left and right arrows\n        for (index = 0; index < this.pagePreviewContainer.length; index += 1) {\n            this.pagePreviewContainer[index].destroy();\n        }\n        this.pagePreviewContainer = [];\n\n        var appWidth = $('#app').width() - 80,\n            itemNum = Math.floor(appWidth / 148);\n        this.perviewPagesNum = itemNum;\n\n        if (!flag) {\n            this.pagePreviewNum = (Math.ceil(this.whiteboard.getCurrentPage() / itemNum) - 1) * itemNum;\n        }\n\n        for (index = 0; index < Math.min(itemNum, totalPages - this.pagePreviewNum); index += 1) {\n            var page = this.pagePreviewNum + index + 1;\n            var port = Number(this.appPort) + 10000;\n            //var url = \"http://\" + this.appIpAddress + \":\" + port + \"/files/\" + this.vid + \"_\" + this.room + \"/\" + this.whiteboard.getPageIdByPage(page) + \"_thumbnail.png?version=\" + $.now();\n            var pageFile = this.whiteboard.getPageFileByPage(page);\n            var url = \"\";\n            if (pageFile.fileUrl != null && pageFile.fileUrl != \"\") {\n                url = pageFile.fileUrl;\n            } else if (pageFile.thumbnail != null\n                && pageFile.thumbnail != \"\") {\n                url = pageFile.thumbnail;\n            }\n            var comp = this.createComponent({\n                container: this.$.previewPagesPopup,\n                style: \"border:4px solid white; display:inline-block;float:left;width:120px;height:116px;;margin:10px;color:#000;background:url(\" + url + \") center center no-repeat #FFF;background-size:contain;cursor:pointer;\",\n                content: \"<div style='text-align:center;height: 100%;font-size:3em;'> \" + page + \" </div>\",\n                allowHtml: true,\n                ontap: \"gotoPage\",\n                // page index starts with 1\n                index: index + 1,\n                pageNum: page,\n            });\n            if (this.whiteboard.getCurrentPage() === page) {\n                comp.applyStyle(\"border\", \"4px solid rgb(17, 158, 235)\");\n            }\n            this.pagePreviewContainer.push(comp);\n        }\n        if (this.isMobile()) {\n            if (this.hamPpp != null) { // render前移除手势，因为render后再生成手势会造成手势堆叠\n                this.hamPpp.destroy();\n                this.hamPpp = null;\n            }\n        }\n        this.$.previewPagesPopup.render();\n        // }\n        var p = this.$[inEvent.originator.popup];\n        if (p) {\n            p.show();\n        }\n        if (this.isMobile()) {\n            // 绑定手势\n            var _this = this;\n            var ppp = $(\"#app_previewPagesPopup\")[0];\n            this.hamPpp = new Hammer(ppp);\n            // swipe\n            this.hamPpp.on(\"swipeleft\", function (e) {\n                // 向后翻页\n                // $(\"#app_selectNext\").click();\n                _this.triggerClick($(\"#app_selectNext\")[0]);\n            });\n            this.hamPpp.on(\"swiperight\", function (e) {\n                // 向前翻页\n                // $(\"#app_selectPrevious\").click();\n                _this.triggerClick($(\"#app_selectPrevious\")[0]);\n            });\n        }\n    },\n\n    selectClear: function (inSender, inEvent) {\n        var self = this;\n        self.cancelSelect();\n        var yes = $.confirm({\n            title: $L(\"Confirm\"),\n            content: $L(\"Do you want to clear this page?\"),\n            confirm: function () {\n                self.whiteboard.clear(true);\n            },\n            cancel: function () {\n                // do nothing.\n            }\n        });\n    },\n\n    selectCreateJoinRoom: function (inSender, inEvent) {\n        var p = this.$[inEvent.originator.popup];\n        if (p) {\n            p.show();\n        }\n    },\n\n    selectGetVideo: function (inSender, inEvent) {\n        this.whiteboard.makeVideo();\n    },\n\n    selectExportToSvg: function (inSender, inEvent) {\n        var svg = document.getElementsByTagName('svg')[0];\n        var svg_xml = (new XMLSerializer).serializeToString(svg);\n        window.open(\"data:image/svg+xml;base64,\" + btoa(svg_xml), \"Export\");\n    },\n\n    selectNext: function (inSender, inEvent) {\n        if (this.pagePreviewNum + this.perviewPagesNum >= this.whiteboard.getNumPages()) {\n            return;\n        }\n        this.closeEraser();\n        this.cancelSelect();\n        this.pagePreviewNum = this.pagePreviewNum + this.perviewPagesNum;\n        this.selectPreviewPages(inSender, inEvent, 1);\n    },\n\n    gotoNextPageMouseOver: function (inSender, inEvent) {\n        this.$.gotoNextPage.applyStyle(\"background\", \"url(images/btn_right_gray.png) center center no-repeat\");\n        this.$.gotoNextPage.applyStyle(\"background-color\", \"#FFF\");\n    },\n\n    gotoNextPageMouseOut: function (inSender, inEvent) {\n        this.$.gotoNextPage.applyStyle(\"background\", \"url(images/btn_right.png) center center no-repeat\");\n        this.$.gotoNextPage.applyStyle(\"background-color\", \"#808080\");\n    },\n\n    gotoPreviousPageMouseOver: function (inSender, inEvent) {\n        this.$.gotoPreviousPage.applyStyle(\"background\", \"url(images/btn_left_gray.png) center center no-repeat\");\n        this.$.gotoPreviousPage.applyStyle(\"background-color\", \"#FFF\");\n    },\n\n    gotoPreviousPageMouseOut: function (inSender, inEvent) {\n        this.$.gotoPreviousPage.applyStyle(\"background\", \"url(images/btn_left.png) center center no-repeat\");\n        this.$.gotoPreviousPage.applyStyle(\"background-color\", \"#808080\");\n    },\n\n    gotoNextPage: function (inSender, inEvent) {\n        this.$.loadingPopup.show();\n        var result = this.whiteboard.nextPage();\n        this.updatePageInfo();\n        if (!result) this.$.loadingPopup.hide();\n    },\n\n    gotoPreviousPage: function (inSender, inEvent) {\n        this.$.loadingPopup.show();\n        var result = this.whiteboard.prevPage();\n        this.updatePageInfo();\n        if (!result) this.$.loadingPopup.hide();\n    },\n\n    selectPrevious: function (inSender, inEvent) {\n        if (this.pagePreviewNum == 0) {\n            return;\n        }\n        this.cancelSelect();\n        this.closeEraser();\n        this.pagePreviewNum = this.pagePreviewNum - this.perviewPagesNum;\n        this.selectPreviewPages(inSender, inEvent, 1);\n    },\n\n    selectCreateJoinRoomPopupCancel: function (inSender, inEvent) {\n        this.$.createJoinRoomPopup.hide();\n    },\n\n    selectCreateJoinRoomPopupOk: function (inSender, inEvent) {\n        var value = this.$.roomName.getValue();\n        if (value) {\n            this.whiteboard.joinRoom(value);\n        }\n        this.$.createJoinRoomPopup.hide();\n    },\n\n    inIframe: function () {\n        try {\n            return window.self !== window.top;\n        } catch (e) {\n            return true;\n        }\n    },\n\n    logout: function () {\n        if (this.inIframe()) {\n            // Remove DOM elements inside parent container\n            $(window.document).find(\"body\").empty();\n        } else {\n            // We are not in a iframe\n            window.location = \"./logout.html\";\n        }\n    },\n\n    selectNewPage: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.whiteboard.newPage();\n        this.updatePageInfo();\n    },\n\n    updatePreviewPageBorder: function () {\n        var subComponents = this.$.previewPagesPopup.children,\n            index, length, pageNum;\n\n        // page child including right arrow and left arrow\n        subComponents = subComponents.slice(2, subComponents.length);\n\n        for (index = 0, length = subComponents.length; index < length; index += 1) {\n            pageNum = subComponents[index].pageNum;\n            if (pageNum === this.whiteboard.getCurrentPage()) {\n                subComponents[index].applyStyle(\"border\", \"4px solid rgb(17, 158, 235)\");\n            } else {\n                subComponents[index].applyStyle(\"border\", \"4px solid white\");\n            }\n        }\n    },\n\n    updatePageInfo: function () {\n        // restore button status\n        //      this.closeEraser();\n        //      this.cancelSelect();\n\n        // update previous and next button style\n        var totalPagesNum = this.whiteboard.getNumPages(),\n            currentPage = this.whiteboard.getCurrentPage();\n\n        if (currentPage > totalPagesNum) {\n            // current page cannot larger than number of total pages\n            currentPage = totalPagesNum;\n        }\n\n        if (currentPage === 1) {\n            this.$.gotoPreviousPage.applyStyle(\"cursor\", \"default\");\n            this.$.gotoPreviousPage.applyStyle(\"opacity\", \"0.3\");\n        } else {\n            this.$.gotoPreviousPage.applyStyle(\"cursor\", \"pointer\");\n            this.$.gotoPreviousPage.applyStyle(\"opacity\", \"1\");\n        }\n\n        if (currentPage === totalPagesNum) {\n            this.$.gotoNextPage.applyStyle(\"cursor\", \"default\");\n            this.$.gotoNextPage.applyStyle(\"opacity\", \"0.3\");\n        } else {\n            this.$.gotoNextPage.applyStyle(\"cursor\", \"pointer\");\n            this.$.gotoNextPage.applyStyle(\"opacity\", \"1\");\n        }\n\n        if (currentPage > 1 && currentPage < totalPagesNum) {\n            this.$.gotoPreviousPage.applyStyle(\"cursor\", \"pointer\");\n            this.$.gotoPreviousPage.applyStyle(\"opacity\", \"1\");\n\n            this.$.gotoNextPage.applyStyle(\"cursor\", \"pointer\");\n            this.$.gotoNextPage.applyStyle(\"opacity\", \"1\");\n        }\n\n    },\n\n    gotoPage: function (inSender, inEvent) {\n        this.closeEraser();\n        this.cancelSelect();\n        this.$.loadingPopup.show();\n        var result = this.whiteboard.gotoPage(this.pagePreviewNum + inSender.index);\n        if (!result) this.$.loadingPopup.hide();\n        this.updatePageInfo();\n        this.updatePreviewPageBorder();\n    },\n\n    doSelect: function (inSender, inEvent) {\n        this.hideLaser();\n        console.log(\"doSelect\");\n        this.closeEraser();\n        this.closePen();\n        this.closeHighlighter();\n        this.dimPenPicker();\n        this.cancelEditingText();\n        //this.selecting.on ? this.cancelSelect() : this.openSelect();\n        this.openSelect();\n    },\n\n    openSelect: function () {\n        if (this.selecting.on) return;\n        this.selecting.on = true;\n        this.$.selectButton.applyStyle(\"background-position\", \"-80px -399px\");\n        this.whiteboard.doSelect();\n    },\n\n    cancelSelect: function () {\n        //if (!this.selecting.on) return;\n\n        this.selecting.on = false;\n        this.$.selectButton.applyStyle(\"background-position\", \"0 -399px\");\n        this.whiteboard.cancelSelect();\n        this.whiteboard.stopDoingSelect();\n    },\n\n    isGuest: function () {\n        return this.role === 'guest';\n    },\n\n    isMobile: function () {\n        if (ewb_clientType == 'android' || ewb_clientType == 'ios') {\n            return true;\n        }\n        if (ewb_clientType == 'web' || ewb_clientType == 'pc' || ewb_clientType == 'mac') {\n            return false;\n        }\n        var isMobile = false; //initiate as false\n        // device detection\n        if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|G750-T01|g750-t01|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(navigator.userAgent.substr(0, 4)))\n            isMobile = true;\n        return isMobile;\n    },\n\n    triggerClick: function (element) { // 解决IOS模拟click事件无效\n        //\t\tif (element.click) {\n        //\t\t\telement.click();\n        //\t\t} else if (document.createEvent) {\n        var eventObj = document.createEvent('MouseEvents');\n        eventObj.initEvent('click', true, true);\n        element.dispatchEvent(eventObj);\n        //\t\t}\n    }\n});"
  },
  {
    "path": "rtc/whiteboard/src/js/ewb/Connection.js",
    "content": "enyo.kind({\n    name: 'Connection',\n    kind: null,\n\n    socket: 'undefined',\n    whiteboard: 'undefined',\n    singlePath: [],\n    currentPathLength: 0,\n    uid: 'uid',\n    room: 'undefined',\n    page: 1,\n    preloadFlag: 0,\n    constructor: function(address, whiteboard, room, uid) {\n        this.whiteboard = whiteboard;\n        //console.log(\"Connecting to address \" + address);\n        //this.socket = new WebSocket(address);\n//        this.socket = this.createSocket(address);\n\t\tthis.blinkEwb = new BlinkEwb(this);\n        this.room = room;\n        this.uid = uid;\n        this.page = 1;\n        this.touchMove = undefined;\n        this.attempts = 1;\n\n        this.messageQueue = new Queue();\n        this.setupNotificationStyle();\n        _this = this;\n    },\n    preload: function(list) {\n        if (list < 2) {\n            return;\n        }\n        for (var i = 0, len = list.length; i < len; i++) {\n            if (!list[i]) {\n                continue;\n            }\n            var img = document.createElement('img');\n            // img.src = list[i].replace('http', 'https');\n            img.src = list[i];\n        }\n    },\n    setupNotificationStyle: function() {\n        $.noty.defaults = {\n            layout: 'top',\n            theme: 'relax',\n            type: 'warning',\n            text: '', // can be html or string\n            dismissQueue: true, // If you want to use queue feature set this true\n            template: '<div class=\"noty_message\"><span class=\"noty_text\"></span><div class=\"noty_close\"></div></div>',\n            animation: {\n                open: { height: 'toggle' }, // or Animate.css class names like: 'animated bounceInLeft'\n                close: { height: 'toggle' }, // or Animate.css class names like: 'animated bounceOutLeft'\n                easing: 'swing',\n                speed: 500 // opening & closing animation speed\n            },\n            timeout: false, // delay for closing event. Set false for sticky notifications\n            force: false, // adds notification to the beginning of queue when set to true\n            modal: false,\n            maxVisible: 5, // you can set max visible notification for dismissQueue true option,\n            killer: false, // for close all notifications before show\n            closeWith: ['click'], // ['click', 'button', 'hover', 'backdrop'] // backdrop click will close all notifications\n            callback: {\n                onShow: function() {},\n                afterShow: function() {},\n                onClose: function() {},\n                afterClose: function() {},\n                onCloseClick: function() {},\n            },\n            buttons: false // an array of buttons\n        };\n    },\n\n    showWarningMessage: function(params) {\n        if (this.warningMessage && !this.warningMessage.closed) {\n            this.warningMessage.setText(params.text);\n        } else {\n            this.warningMessage = noty(params);\n        }\n    },\n\n    clearWarningMessage: function() {\n        if (this.warningMessage) {\n            this.warningMessage.close();\n        }\n    },\n\n    createSocket: function(address) {\n        var generateInterval = function(k) {\n            var maxInterval = (Math.pow(2, k)) * 1000;\n\n            if (maxInterval > 30 * 1000) {\n                maxInterval = 30 * 1000; // If the generated interval is more than 30 seconds, truncate it down to 30 seconds.\n            }\n\n            // generate the interval to a random number between 0 and the maxInterval determined from above\n            return Math.random() * maxInterval;\n        };\n\n        var connection = new WebSocket(address);\n\n        connection.onopen = function() {\n            // reset attempts of retry\n            this.attempts = 1;\n            console.log(\"WebSocket connection established @\" + Date.now());\n            _this.clearWarningMessage();\n\n            console.log(\"Send rest messages in queue...\");\n            _this.sendMessageInQueue();\n        };\n\n        connection.onmessage = function(evt) {\n            var message = JSON.parse(JXG.decompress(evt.data)),\n                fromUid = message['fromUid'],\n                evnt = message['event'],\n                data = message['data'];\n            ts = message['ts'];\n\n            if (evnt != 'ack') {\n                console.info(evnt + ' : ' + 'receive msg from server. uid:' + fromUid + ' event:' + evnt + ' elapse:' + (Date.now() - ts) + 'ms data:' + JSON.stringify(data));\n            }\n\n            switch (evnt) {\n                case 'ready':\n                    //_this.init(_this.uid, _this.room, _this.page);\n                    _this.join();\n                    break;\n                case 'join':\n                    _this.init(_this.uid, _this.room, _this.page);\n                    break;\n                case 'draw':\n                    if (_this.uid == fromUid) {\n                        console.log(\"ignore message 'draw' from mine. uid \" + fromUid);\n                        break;\n                    }\n                    _this.remoteDraw(_this, data);\n                    break;\n                case 'draw-many':\n                    if (_this.uid == fromUid) {\n                        console.log(\"ignore message 'draw-many' from mine. uid \" + fromUid);\n                        break;\n                    }\n                    _this.remoteDrawMany(_this, data);\n                    break;\n                case 'clear':\n                    _this.remoteClear(_this, data);\n                    break;\n                case 'image':\n                    _this.remoteImage(_this, data);\n                    break;\n                case 'delete-page':\n                    _this.remoteDelPage(_this, data);\n                    break;\n                case 'pages':\n                    _this.remotePages(_this, data);\n                    break;\n                case 'laser-move':\n                    if (_this.uid === fromUid) {\n                        console.log(\"ignore message 'laser-move' from mine. uid \" + fromUid);\n                        break;\n                    }\n                    _this.remoteLaserMove(_this, data);\n                    break;\n                case 'laser-draw':\n                    if (_this.uid === fromUid) {\n                        console.log(\"ignore message 'laser-draw' from mine. uid \" + fromUid);\n                        break;\n                    }\n                    _this.remoteLaserDraw(_this, data);\n                    break;\n                case 'laser-remove':\n                    if (_this.uid === fromUid) {\n                        console.log(\"ignore message 'laser-remove' from mine. uid \" + fromUid);\n                        break;\n                    }\n                    _this.remoteLaserRemove(_this, data);\n                    break;\n                case 'change-page':\n                    if (_this.uid === fromUid) {\n                        console.log(\"ignore message 'change-page' from mine. uid \" + fromUid);\n                        break;\n                    }\n\n                    if (data['page_id'] === _this.whiteboard.getCurrentPageId()) {\n                        break;\n                    }\n\n                    _this.whiteboard.setTotalPages(data['page_list']);\n                    _this.changePage(data['page_id']);\n                    break;\n            }\n        };\n\n        var reconnectWebSocket = function() {\n            var time = 5000;\n            console.log(\"Re-connecting after: \" + time + \" miliseconds...\");\n            _this.showWarningMessage({ text: $L(\"Network connection is lost, reconnect in about\") + \" \" + Math.round(time / 1000) + ' ' + $L(\"seconds\") });\n\n            if (_this.attempts <= 5) {\n                setTimeout(function() {\n                    // We've tried to reconnect so increment the attempts by 1\n                    _this.attempts += 1;\n                    // Connection has closed so try to reconnect.\n                    _this.socket = _this.createSocket(address);\n                }, time);\n            } else {\n                _this.showWarningMessage({ text: $L(\"Connection is lost\") });\n            }\n        };\n\n        connection.onerror = function(err) {\n            console.error(err);\n            console.log(\"WebSocket connection error @ \" + Date.now());\n\n            //reconnectWebSocket();\n        };\n\n        connection.onclose = function(event) {\n            console.log(event);\n            console.log(\"Connection was closed @ \" + Date.now());\n            reconnectWebSocket();\n        };\n        return connection;\n    },\n\n    enqueueMessage: function(evt, data) {\n        var message;\n        data = data || {};\n        data[\"room\"] = this.whiteboard.room;\n        data[\"page_id\"] = this.whiteboard.getCurrentPageId();\n        data[\"msg_id\"] = JXG.Util.genUUID();\n        message = JSON.stringify({\n            \"uid\": this.uid,\n            \"event\": evt,\n            \"data\": data\n        });\n\n        this.messageQueue.enqueue(message);\n    },\n\n    sendMessageInQueue: function() {\n        var messageBeenSent,\n            message,\n            retryCount = 0;\n\n        while (!this.messageQueue.isEmpty()) {\n            messageBeenSent = true;\n            try {\n                message = this.messageQueue.dequeue();\n                if (message) {\n                    console.log('sending message:', message);\n//                    this.socket.send(message);\n                    this.blinkEwb.send(message);\n                }\n            } catch (err) {\n                console.error(\"Error, message not been sent, error message is: \", err);\n                messageBeenSent = false;\n            }\n\n            if (!messageBeenSent) {\n                this.messageQueue.enqueue(message);\n                retryCount += 1;\n                if (retryCount > 1000) {\n                    // break out of loop without retrying anymore, leave message in the queue, and resend it next time.\n                    break;\n                }\n            }\n        }\n    },\n\n    checkIfOnline: function() {\n        return navigator.onLine;\n    },\n\n    sendMessage: function(evt, data) {\n        var message;\n        this.enqueueMessage(evt, data);\n        if (this.checkIfOnline()) {\n            this.sendMessageInQueue();\n        } else {\n            message = JSON.stringify({\n                \"uid\": this.uid,\n                \"event\": \"ping\",\n                \"data\": {}\n            });\n            this.socket.send(message);\n            this.showWarningMessage({ text: $L(\"Connection is lost\") });\n        }\n    },\n\n    join: function() {\n        console.log(\"Sending join for room \", this.whiteboard);\n\n        this.sendMessage(\"join\", {\n            \"room\": this.whiteboard.room,\n            \"vid\": this.whiteboard.parent_.vid,\n            \"redis\": this.whiteboard.parent_.redis,\n            \"role\": this.whiteboard.userRole,\n            \"ticket\": this.whiteboard.parent_.ticket,\n            \"width\": this.whiteboard.canvasWidth,\n            \"height\": this.whiteboard.canvasHeight,\n            \"expiredMinutes\": this.whiteboard.parent_.expiredMinute,\n        });\n    },\n\n\n    init: function(uid, room, currentPage, broadcast) {\n        console.log(\"Sending init for room \" + room + \" and page \" + currentPage);\n        this.whiteboard.clear(false, false);\n        if (broadcast === undefined) {\n            broadcast = true;\n        }\n        this.sendMessage(\"init\", {\n            \"room\": room,\n            \"vid\": this.whiteboard.parent_.vid,\n            \"page\": currentPage,\n            \"broadcast\": broadcast\n        });\n    },\n\n    changePage: function(pageId) {\n        var page = this.whiteboard.getPageById(pageId);\n        this.whiteboard.gotoPage(page, false);\n    },\n\n    /**\n     * Get data from server to initialize this whiteboard\n     * @param {Object} uid\n     * @param {Object} room\n     * @param {Object} page\n     */\n    joinRoom: function(room, page) {\n        this.room = room;\n        this.singlePath = [];\n        this.currentPathLength = 0;\n        this.whiteboard.clear(false, false);\n        console.log(\"Sending init for room \" + room + ' ' + page);\n        this.sendMessage(\"init\", {\n            \"room\": this.room,\n            \"vid\": this.whiteboard.parent_.vid,\n        });\n    },\n\n    /**\n     * Send a single path (segment) to the server\n     * @param {x, y, type, lineColor, lineWidth} a point on the path\n     */\n    sendPath: function(data) {\n        if (data.type == 'touchend') {\n            this.touchMove.path.push([data.x, data.y]);\n            this.touchMove.guid = data.guid;\n            this.singlePath.push(this.touchMove);\n            this.currentPathLength++;\n            this.touchMove = undefined;\n        } else if (data.type == 'touchstart') {\n            this.touchMove = data;\n            this.touchMove.type = 'touchmovement';\n            this.touchMove.path = [];\n            this.touchMove.path.push([data.oldx, data.oldy]);\n        } else if (data.type == 'touchmove') {\n            this.touchMove.path.push([data.x, data.y]);\n        } else {\n            this.singlePath.push(data);\n            this.currentPathLength++;\n        }\n\n        // Send path every two points or when user removes finger\n        if (this.currentPathLength > 2 ||\n            data.type === \"touchend\" ||\n            data.type === 'undo' ||\n            data.type === 'redo' ||\n            data.type === 'addtext' ||\n            data.type === 'edittext' ||\n            data.type === 'rm'\n        ) {\n\t\t\tvar currentPageFile = this.whiteboard.getCurrentPageFile();\n\t\t\tvar thumbnail = \"\";\n\t\t\tif (currentPageFile.fileUrl == null\n\t\t\t\t\t|| currentPageFile.fileUrl == \"\") { // 无背景图片时生成缩略图\n\t\t\t\tthumbnail = this.whiteboard.convertSvgContent();\n\t\t\t}\n\t\t\tthis.sendMessage(\"draw-click\", {\n\t\t\t\t\"singlePath\" : this.singlePath,\n\t\t\t\t\"thumbnail\" : thumbnail\n\t\t\t});\n            this.singlePath = [];\n            this.currentPathLength = 0;\n            console.log(\"undoStack:\", this.whiteboard.undoStack);\n            console.log(\"redoStack:\", this.whiteboard.redoStack);\n        }\n    },\n\n    /**\n     * Clear all other canvases (in the same room on the same page)\n     */\n    sendClear: function() {\n        this.singlePath = [];\n        this.currentPathLength = 0;\n        this.sendMessage(\"clear\", {});\n    },\n\n    sendLaserEvent: function(eventName, data) {\n        //data = data || {};\n        //data[\"room\"] =  this.whiteboard.room;\n        //data[\"page_id\"] =  this.whiteboard.getCurrentPageId();\n        //message = JSON.stringify({\n        //\"uid\": this.uid,\n        //\"event\": eventName,\n        //\"data\": data\n        //});\n        //this.socket.send(message);\n        this.sendMessage(eventName, data);\n    },\n\n    deletePage: function() {\n        this.sendMessage(\"delete-page\", {});\n    },\n\n    getImage: function() {\n        //console.log(\"Getting image for page \" + this.page);\n        this.sendMessage(\"get-image\", {\n            \"room\": this.room,\n            \"page\": this.page\n        });\n    },\n\n    /**\n     * Make video remotely\n     */\n    makeVideo: function() {\n        this.sendMessage(\"video\", {});\n    },\n\n    /*\n     * Create a new page\n     */\n    newPage: function() {\n        this.whiteboard.clear(false, false);\n        this.sendMessage(\"new-page\", {});\n    },\n\n    /***\n     * All remote functions below\n     */\n\n    drawEx: function(self, data) {\n        var i;\n        if (data == null) return;\n        if (data.drawingItem) {\n            self.whiteboard.drawingRemoteItem = data.drawingItem;\n        }\n        if (data.type == 'touchstart') self.whiteboard.startPath(data.oldx, data.oldy, data.lineColor, data.lineWidth, false);\n        // else if (data.type == 'touchmove') self.whiteboard.continuePath(data.oldx, data.oldy, data.x, data.y, data.lineColor, data.lineWidth, false);\n        else if (data.type == 'touchmove') {\n            if (data.path) {\n                for (i in data.path) {\n                    if (data.path.hasOwnProperty(i)) {\n                        self.whiteboard.continuePath(data.oldx, data.oldy, data.path[i][0], data.path[i][1], data.lineColor, data.lineWidth, data.guid, false);\n                    }\n                }\n            } else {\n                self.whiteboard.continuePath(data.oldx, data.oldy, data.x, data.y, data.lineColor, data.lineWidth, data.guid, false);\n            }\n        } else if (data.type == 'touchmovement') {\n            if (data.path) {\n                for (i in data.path) {\n                    if (data.path.hasOwnProperty(i)) {\n                        if (i == 0) {\n                            self.whiteboard.startPath(data.path[i][0], data.path[i][1], data.lineColor, data.lineWidth, false);\n                        } else if (i == data.path.length - 1) {\n                            self.whiteboard.endPath(data.oldx, data.oldy, data.path[i][0], data.path[i][1], data.lineColor, data.lineWidth, data.guid, false);\n                        } else {\n                            self.whiteboard.continuePath(data.oldx, data.oldy, data.path[i][0], data.path[i][1], data.lineColor, data.lineWidth, data.guid, false);\n                        }\n                    }\n                }\n            } else {\n                self.whiteboard.continuePath(data.oldx, data.oldy, data.x, data.y, data.lineColor, data.lineWidth, data.guid, false);\n            }\n        } else if (data.type == 'touchend') {\n            self.whiteboard.endPath(data.oldx, data.oldy, data.x, data.y, data.lineColor, data.lineWidth, data.guid, false);\n        } else if (data.type == 'undo') {\n            self.whiteboard.executeUndo2(false, data.guid);\n        } else if (data.type == 'redo') {\n            self.whiteboard.executeRedo2(false, data.guid);\n        } else if (data.type == 'addtext') {\n            self.whiteboard.drawText(data);\n        } else if (data.type == 'edittext') {\n            self.whiteboard.drawText(data);\n            //self.whiteboard.executeEditText(data.oldx, data.oldy, data.value);\n        } else if (data.type == 'rm') {\n            //self.whiteboard.executeRemove(data.oldx, data.oldy);\n            self.whiteboard.removeSelected(false, data.guid, data.op_guid);\n        } else { console.log(\"not supported operation: \" + data.type); }\n    },\n    /**\n     * Draw from realtime data incoming from server\n     * Called when server sends @event 'draw'\n     * @param {Object} self\n     * @param {singlePath: [points...]} input\n     */\n    remoteDraw: function(self, input) {\n        var sPath = input.singlePath;\n        var data = {};\n        // point on path\n        for (var i = 0; i < sPath.length; i++) {\n            data = sPath[i];\n            data.remote = true;\n            self.drawEx(self, data)\n        }\n    },\n\n    /**\n     * Draw from stored data incoming from server\n     * Called when server sends @event 'draw-many'\n     * @param {Object} self\n     * @param {datas:[points...]} data\n     */\n    remoteDrawMany: function(self, data) {\n        console.log(data);\n        self.whiteboard.setTotalPages(data.pages);\n\n        var pageId = self.whiteboard.getPageById(data[\"page_id\"]);\n        self.whiteboard.setCurrentPage(pageId);\n        ds = data.datas;\n        for (d in ds) {\n            console.log(d, ds[d]['guid'], ds[d]);\n            console.log(\"undoStack before:\", this.whiteboard.undoStack.length, this.whiteboard.undoStack);\n            console.log(\"redoStack before:\", this.whiteboard.redoStack.length, this.whiteboard.redoStack);\n            self.drawEx(self, ds[d]);\n            console.log(\"undoStack after:\", this.whiteboard.undoStack.length, this.whiteboard.undoStack);\n            console.log(\"redoStack after:\", this.whiteboard.redoStack.length, this.whiteboard.redoStack);\n        }\n    },\n\n    /**\n     * Clear from server\n     * Called when server sends @event 'clear'\n     * @param {Object} self\n     * @param {Object} data\n     */\n    remoteClear: function(self, reloadImage) {\n        self.whiteboard.clear(false, reloadImage);\n    },\n    remoteImage: function(self, data) {\n        this.preload(data.urls);\n        if (data.url != \"\") {\n            var img = document.createElement('img');\n//            data.url = data.url && data.url.replace('http', 'https');\n            img.src = data.url;\n            console.log(\"Image url is \" + data.url);\n            self.whiteboard.loadImage(data.url, data.width, data.height);\n        }\n    },\n    remoteDelPage: function(self, data) {\n        console.log(\"receive cmd 'del-page' from server. data \" + data);\n        var page_id = data['page_id'];\n        var cur_id = self.whiteboard.getCurrentPageId();\n        var cur_page = self.whiteboard.getCurrentPage();\n        var npages = data['pages'];\n        // TODO update total pages in UI\n        self.whiteboard.setTotalPages(npages);\n        if (page_id == cur_id) {\n            if (cur_page >= self.whiteboard.getNumPages()) {\n                self.whiteboard.prevPage()\n            } else {\n                self.whiteboard.gotoPage(cur_page);\n            }\n        } else {\n            self.whiteboard.gotoPage(self.whiteboard.getPageById(cur_id));\n        }\n    },\n\n    remotePages: function(self, data) {\n        console.log(\"receive cmd 'pages' from server. data \" + data);\n        this.preload(data.urls);\n        var npages = data['pages'];\n        // TODO update total pages in UI\n        self.whiteboard.setTotalPages(npages);\n    },\n\n    remoteLaserMove: function(self, data) {\n        self.whiteboard.removeLaser();\n        self.whiteboard.drawLaser(data.x, data.y, true)\n    },\n\n    remoteLaserDraw: function(self, data) {\n        self.whiteboard.drawLaser(data.x, data.y, true)\n    },\n\n    remoteLaserRemove: function(self, data) {\n        self.whiteboard.removeLaser(false);\n    }\n\n});"
  },
  {
    "path": "rtc/whiteboard/src/js/ewb/Svg.js",
    "content": "/**\n * This contains all the local functions to interact with the whiteboard. It also contains\n * interfaces to the Connection class.\n */\nwindow.RongSvgUtils = {\n    getScale: function (dom) {\n        var transform = dom.style.transform;\n        if (transform.indexOf('scale') === -1) {\n            return null;\n        }\n        var scale = transform.substring(6, transform.length - 1);\n        return Number(scale);\n    },\n    scaleEl: function (dom, percent, isRestore) {\n        var scale = window.RongSvgUtils.getScale(dom);\n        percent = scale ? scale * percent : percent;\n        percent = isRestore ? '1' : percent;\n        dom.style.transform = 'scale(' + percent + ')';\n    },\n    scaleTable: function (percent, isRestore) {\n        var dom = document.querySelector('.rong-table');\n        window.RongSvgUtils.scaleEl(dom, percent, isRestore);\n    },\n    scaleImage: function (percent, isRestore) {\n        var dom = document.querySelector('.rong-image');\n        window.RongSvgUtils.scaleEl(dom, percent, isRestore);\n    },\n    scaleAll: function (percent, isRestore) {\n        window.RongSvgUtils.scaleTable(percent, isRestore);\n        window.RongSvgUtils.scaleImage(percent, isRestore);\n    }\n};\nwindow.onresize = function () {\n    window.RongSvgUtils.scaleAll(0, true);\n};\nenyo.kind({\n    name: 'WhiteboardSvg',\n    kind: null,\n\n    cvs: 'undefined',\n    currentPage: 1,\n    totalPages: -1,\n    uid: \"\",\n    room: \"\",\n    //redis:\"\",\n    //ticket:\"\",\n    connection: 'undefined',\n    callback: 'undefined',\n\n    getNumPages: function() {\n        return this.totalPages;\n    },\n\n    getCurrentPage: function() {\n        return this.currentPage;\n    },\n\n    setCurrentPage: function(pageId) {\n        this.currentPage = pageId;\n        // update page info\n        this.callback(this.totalPages, this.currentPage);\n    },\n\n    getPageById: function(pageid) {\n        var index, length;\n        for (index = 0, length = this.page_list.length; index < length; index += 1) {\n            if (this.page_list[index] === pageid) {\n                return index + 1;\n            }\n        }\n        // default return page no. 1.\n        return 1;\n    },\n    getCurrentPageId: function() {\n        return this.page_list[this.currentPage - 1];\n    },\n    getPageIdByPage: function(page) {\n        return this.page_list[page - 1];\n    },\n    setPageFiles: function(pageFiles) {\n    \tthis.page_file_list = pageFiles;\n    },\n    getPageFileByPage: function(page) {\n        return this.page_file_list[page - 1];\n    },\n    getCurrentPageFile: function() {\n        return this.page_file_list[this.currentPage - 1];\n    },\n\n    /**\n     * @class WhiteboardSvg\n     * @param parent: Class canvasContainer\n     * @param callback: called once the page is rendered\n     */\n    constructor: function(name, parent, page, websocketAddress, userRole, callback) {\n        this.parent_ = parent;\n        this.uid = parent.uid;\n        //this.vid             = parent.vid;\n        this.room = parent.room;\n        this.cvs = new ScaleRaphael(name, parent.canvasWidth, parent.canvasHeight);\n        this.d3SVG = d3.select(this.cvs.canvas);\n        this.connection = new Connection(websocketAddress, this, this.room, this.uid);\n        this.callback = callback;\n        this.zoomRatio = 1;\n        this.page_list = [];\n        this.drawingItem = 'pen';\n        this.drawingRemoteItem = '';\n        this.element = null;\n        this.drawStartX = 0;\n        this.drawStartY = 0;\n        this.undoStack = [];\n        this.redoStack = [];\n        this.textEdits = {};\n        this.textEditing = false;\n        this.penPoints = [];\n        this.penCbkCount = 0;\n        this.penFunction = d3.svg.line().interpolate('cardinal');\n        this.penPathID = 10000;\n        this.currentSelected = null;\n        this.laserPen = null;\n        this.userRole = userRole;\n        this.canvasHeight = parent.canvasHeight;\n        this.canvasWidth = parent.canvasWidth;\n        this.topMargin = 0;\n        this.page_file_list = [];\n        \n        // 设置缩放率\n        this.setZoomRatioCustom();\n        // 调整面板\n        this.zoomReduction();\n    },\n\n    /**\n     * 获取画板上边距\n     * \n     */\n    getCanvasMarginTop: function() {\n    \tvar canvasMarginTop = (this.canvasContainerHeight - this.canvasHeight * this.zoomRatio) / 2;\n    \treturn canvasMarginTop < 0 ? 0 : canvasMarginTop;\n\t},\n    \n    /**\n\t * 设置缩放率\n\t * \n\t */\n    setZoomRatioCustom: function() {\n    \t// 设置画板容器宽度\n    \tthis.canvasContainerWidth = $('html,body').width();\n    \t// 设置画板容器高度\n    \tthis.canvasContainerHeight = $('html,body').height() - ($(\"#app_bottomToolbar\").outerHeight() + 5);\n    \t\n    \tvar widthRatio = this.canvasContainerWidth / this.canvasWidth;\n    \tvar heightRatio = this.canvasContainerHeight / this.canvasHeight;\n    \tthis.zoomRatioCustom = widthRatio < heightRatio ? widthRatio : heightRatio;\n    \tthis.zoomRatioPre = this.zoomRatio;\n    \tthis.zoomRatio = 1;\n    \tthis.zoomRatio = this.zoomRatio * this.zoomRatioCustom;\n    \tthis.zoomRatioMax = this.zoomRatio * 2;\n        this.zoomRatioMin = this.zoomRatio * 1;\n        this.zoomRatioChange = 0.5 * this.zoomRatioCustom;\n    },\n\n    /**\n     * Join specified room\n     * @param {Object} room\n     */\n    joinRoom: function(room) {\n        this.room = room;\n        this.connection.joinRoom(room);\n    },\n\n    /**\n     * Getter for cvs\n     */\n    getCanvas: function() {\n        return this.cvs;\n    },\n\n    getDrawingItem: function() {\n        return this.drawingItem;\n    },\n\n    setDrawingItem: function(drawingItem) {\n        this.drawingItem = drawingItem;\n    },\n\n    // start, move, and up are the drag functions\n    //start: function() {\n    //// storing original coordinates\n    //this.ox = this.attr(\"x\");\n    //this.oy = this.attr(\"y\");\n    //this.attr({\n    //opacity: 1\n    //});\n    //if (this.attr(\"y\") < 60 && this.attr(\"x\") < 60) this.attr({\n    //fill: \"#000\"\n    //});\n    //},\n\n    //move: function(dx, dy) {\n    //// move will be called with dx and dy\n    //if (this.attr(\"y\") > 200 || this.attr(\"x\") > 300) this.attr({\n    //x: this.ox + dx,\n    //y: this.oy + dy\n    //});\n    //else {\n    //nowX = Math.min(300, this.ox + dx);\n    //nowY = Math.min(200, this.oy + dy);\n    //nowX = Math.max(0, nowX);\n    //nowY = Math.max(0, nowY);\n    //this.attr({\n    //x: nowX,\n    //y: nowY\n    //});\n    //if (this.attr(\"fill\") != \"#000\") this.attr({\n    //fill: \"#000\"\n    //});\n    //}\n    //},\n\n    //up: function() {\n    //// restoring state\n    //this.attr({\n    //opacity: .5\n    //});\n    //if (this.attr(\"y\") < 60 && this.attr(\"x\") < 60) this.attr({\n    //fill: \"#AEAEAE\"\n    //});\n    //},\n    zoomUnConvert: function(x) {\n        x = x * this.zoomRatio;\n        return x\n    },\n\n    zoomConvert: function(x) {\n        x = x / this.zoomRatio;\n        // x += x*(1-this.zoomRatio)/2;\n        // y += y*(1-this.zoomRatio);\n        return x\n    },\n    /**\n     * Called when user starts a path\n     * @param {Object} x\n     * @param {Object} y\n     * @param {Object} send\n     */\n    startPath: function(x, y, lc, lw, send) {\n        // calculate x and y after being zoomed.\n        // x += x * (1 - this.zoomRatio);\n        // y += y * (1 - this.zoomRatio);\n        // fix bug draw on jpeg file in Firefox\n        console.log(\"start path\", x, y);\n        document.ondragstart = function() {\n            return false;\n        }\n\n        if (send) {\n            x = this.zoomConvert(x);\n            y = this.zoomConvert(y);\n            var drawingItem = this.drawingItem;\n        } else {\n            var drawingItem = this.drawingRemoteItem;\n        }\n\n        this.drawStartX = x;\n        this.drawStartY = y;\n\n        switch (drawingItem) {\n            case 'pen':\n                if (send) {\n                    this.penPathID = this.guid();\n                }\n                this.drawPath2(x, y, lc, lw, 1);\n                break;\n            case 'highlighter':\n                if (send) {\n                    this.penPathID = this.guid();\n                }\n                this.drawPath2(x, y, lc, lw, 0.5);\n                break;\n            case 'arrow':\n            case 'line':\n            case 'triangle':\n                if (!this.element) {\n                    this.element = this.cvs.path(\"M\" + x + \" \" + y);\n                }\n                break;\n            case 'circle':\n                if (!this.element) {\n                    this.element = this.cvs.circle(x, y, 0);\n\n                    //this.element.drag(this.move, this.start, this.up);\n                    this.element.attr({\n                        \"stroke\": lc,\n                        \"stroke-width\": lw\n                    });\n                }\n                break;\n            case 'square':\n            case 'rectangle':\n                if (!this.element) {\n                    this.element = this.cvs.rect(x, y, 0, 0);\n                    //this.element.drag(this.move, this.start, this.up);\n                    this.element.attr({\n                        \"stroke\": lc,\n                        \"stroke-width\": lw\n                    });\n                }\n                break;\n            case 'ellipse':\n                if (!this.element) {\n                    this.element = this.cvs.ellipse(x, y, 0, 0);\n                    //this.element.drag(this.move, this.start, this.up);\n                    this.element.attr({\n                        \"stroke\": lc,\n                        \"stroke-width\": lw\n                    });\n                }\n                break;\n            default:\n                console.log(\"startPath: unknown item. ignore\");\n                return;\n        }\n        if (send) {\n            this.connection.sendPath({\n                oldx: x,\n                oldy: y,\n                type: 'touchstart',\n                lineColor: lc,\n                lineWidth: lw,\n                drawingItem: drawingItem\n            });\n        }\n    },\n\n    /**\n     * Called when user continues path (without lifting finger)\n     */\n    continuePath: function(oldx, oldy, x, y, lc, lw, guidRemote, send) {\n        // x += x * (1 - this.zoomRatio);\n        // y += y * (1 - this.zoomRatio);\n        if (send) {\n            x = this.zoomConvert(x);\n            y = this.zoomConvert(y);\n            var drawingItem = this.drawingItem;\n        } else {\n            var drawingItem = this.drawingRemoteItem;\n        }\n        console.log(\"continuePath\", x, y);\n        var reallyNeedToSend = false;\n        switch (drawingItem) {\n            case 'pen':\n                if (!send) { // it's from server\n                    this.drawPath2(x, y, lc, lw, 1, guidRemote);\n                    break;\n                }\n                // it's local drawing\n                this.penCbkCount++;\n                if (this.penCbkCount % 8 == 0) {\n                    this.drawPath2(x, y, lc, lw, 1);\n                    reallyNeedToSend = true;\n                    break;\n                }\n                break;\n\n            case \"highlighter\":\n                if (!send) { // it's from server\n                    this.drawPath2(x, y, lc, lw, 0.5, guidRemote);\n                    break;\n                }\n                // it's local drawing\n                this.penCbkCount++;\n                if (this.penCbkCount % 8 == 0) {\n                    this.drawPath2(x, y, lc, lw, 0.5);\n                    reallyNeedToSend = true;\n                    break;\n                }\n                break;\n\n            case 'arrow':\n                if (this.element) {\n                    var path = \"M\" + this.drawStartX + \" \" + this.drawStartY + \"L\" + x + \" \" + y;\n                    this.element.attr({\n                        \"path\": path,\n                        \"stroke\": lc,\n                        \"stroke-width\": lw,\n                        \"arrow-end\": \"open-medium-medium\"\n                    });\n                }\n                break;\n\n            case \"line\":\n                if (this.element) {\n                    var path = \"M\" + this.drawStartX + \" \" + this.drawStartY + \"L\" + x + \" \" + y;\n                    this.element.attr({\n                        \"path\": path,\n                        \"stroke\": lc,\n                        \"stroke-width\": lw,\n                    });\n                }\n                break;\n\n            case 'triangle':\n                if (this.element) {\n                    var otherX = x - this.drawStartX;\n                    var path = \"M\" + this.drawStartX + \" \" + this.drawStartY + \"L\" + x + \" \" + y + \"L\" + String(this.drawStartX - otherX) + \" \" + y + \"Z\";\n                    this.element.attr({\n                        \"path\": path,\n                        \"stroke\": lc,\n                        \"stroke-width\": lw,\n                    });\n                }\n                break;\n            case 'circle':\n                if (this.element) {\n                    var width = x - this.drawStartX,\n                        height = y - this.drawStartY,\n                        radius = Math.max(Math.abs(width), Math.abs(height));\n\n                    this.element.attr({\n                        \"r\": radius\n                    });\n                }\n                break;\n            case 'square':\n                if (this.element) {\n                    var width = x - this.drawStartX,\n                        height = y - this.drawStartY,\n                        old_x = this.element.attr(\"x\"),\n                        old_y = this.element.attr(\"y\");\n                    length = Math.max(Math.abs(width), Math.abs(height));\n\n                    this.element.attr({\n                        \"x\": width > 0 ? old_x : x,\n                        \"y\": height > 0 ? old_y : y,\n                        \"width\": length,\n                        \"height\": length\n                    });\n                }\n                break;\n            case 'rectangle':\n                if (this.element) {\n                    var width = x - this.drawStartX,\n                        height = y - this.drawStartY,\n                        old_x = this.element.attr(\"x\"),\n                        old_y = this.element.attr(\"y\");\n                    this.element.attr({\n                        \"x\": width > 0 ? old_x : x,\n                        \"y\": height > 0 ? old_y : y,\n                        \"width\": Math.abs(width),\n                        \"height\": Math.abs(height)\n                    });\n                }\n                break;\n            case 'ellipse':\n                if (this.element) {\n                    var width = x - this.drawStartX,\n                        height = y - this.drawStartY;\n                    old_x = this.element.attr(\"x\"),\n                        old_y = this.element.attr(\"y\");\n\n                    this.element.attr({\n                        \"x\": width > 0 ? old_x : x,\n                        \"y\": height > 0 ? old_y : y,\n                        \"rx\": Math.abs(width),\n                        \"ry\": Math.abs(height)\n                    });\n                }\n                break;\n            default:\n                //console.log(\"continuePath: unknown item. ignore\");\n                return;\n        }\n\n        if (reallyNeedToSend) {\n            this.connection.sendPath({\n                x: x,\n                y: y,\n                type: 'touchmove',\n                lineColor: lc,\n                lineWidth: lw,\n                drawingItem: drawingItem\n            });\n        }\n    },\n\n    /**\n     * Called when user lifts finger\n     */\n    endPath: function(oldx, oldy, x, y, lc, lw, guidRemote, send) {\n        var guid,\n            pathID = this.currentPathID();\n        // x += x * (1 - this.zoomRatio);\n        // y += y * (1 - this.zoomRatio);\n        console.log(\"endPath\", x, y, oldx, oldy);\n        if (send) {\n            x = this.zoomConvert(x);\n            y = this.zoomConvert(y);\n            var drawingItem = this.drawingItem;\n        } else {\n            var drawingItem = this.drawingRemoteItem;\n        }\n        console.log(\"endPath\", x, y);\n        switch (drawingItem) {\n            case 'pen':\n                guid = guidRemote || pathID;\n\n                if (send) {\n                    this.drawPath2(x, y, lc, lw, 1);\n                } else {\n                    this.drawPath2(x, y, lc, lw, 1, guidRemote);\n                }\n                this.undoStack.push({\n                    type: 'path-line',\n                    pathID: pathID,\n                    datum: this.penPoints,\n                    lineColor: lc,\n                    lineWidth: lw,\n                    guid: guid\n                });\n                this.penPoints = [];\n                this.penCbkCount = 0;\n                break;\n            case 'highlighter':\n                guid = guidRemote || pathID;\n\n                if (send) {\n                    this.drawPath2(x, y, lc, lw, 0.5);\n                } else {\n                    this.drawPath2(x, y, lc, lw, 0.5, guidRemote);\n                }\n                this.undoStack.push({\n                    type: 'path-line',\n                    pathID: pathID,\n                    datum: this.penPoints,\n                    lineColor: lc,\n                    lineWidth: lw,\n                    guid: guid\n                });\n                this.penPoints = [];\n                this.penCbkCount = 0;\n                break;\n            case 'arrow':\n            case 'triangle':\n            case 'line':\n            case 'circle':\n            case 'square':\n            case 'ellipse':\n            case 'rectangle':\n                guid = guidRemote || this.guid();\n                if (send) { // continuePath中如果是send的话，还会zoomConvert\n                \tthis.continuePath(oldx, oldy, this.zoomUnConvert(x), this.zoomUnConvert(y), lc, lw, guidRemote, send);\n                } else {\n                \tthis.continuePath(oldx, oldy, x, y, lc, lw, guidRemote, send);\n                }\n                if (this.element) {\n                    this.element.node.id = guid;\n                    var BBox = this.element.getBBox();\n                    if (BBox.width == 0 && BBox.height == 0) {\n                        this.element.remove();\n                    }\n                }\n                break;\n            default:\n                console.log(\"endPath: unknown item. ignore\", this.drawingItem);\n                return;\n        }\n\n        if (this.element) {\n            var clone = $.extend({}, this.element);\n            clone.guid = guid;\n            this.undoStack.push(clone);\n        }\n\n        if (send) {\n            this.connection.sendPath({\n                x: x,\n                y: y,\n                type: 'touchend',\n                lineColor: lc,\n                lineWidth: lw,\n                drawingItem: drawingItem,\n                guid: guid\n            });\n        }\n        this.element = null;\n    },\n\n    guid: function() {\n        function s4() {\n            return Math.floor((1 + Math.random()) * 0x10000)\n                .toString(16)\n                .substring(1);\n        }\n        return 'path-' + s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n    },\n\n    currentPathID: function() {\n        return this.penPathID;\n    },\n\n    drawPath2: function(x, y, lc, lw, opacity, guidRemote) {\n        var pathOpacity = opacity || 1;\n\n        this.penPoints.push([x, y]);\n        if (this.penPoints.length == 1) {\n            return;\n        } else if (this.penPoints.length == 2) {\n            this.d3SVG.append(\"path\")\n                .datum(this.penPoints)\n                .attr(\"id\", (guidRemote || this.currentPathID()))\n                .attr(\"stroke\", lc)\n                .attr(\"stroke-width\", lw)\n                .attr(\"fill\", \"none\")\n                .attr(\"opacity\", pathOpacity)\n                .attr(\"d\", this.penFunction);\n        } else {\n            this.d3SVG.select('#' + (guidRemote || this.currentPathID())).\n            attr(\"d\", this.penFunction);\n        }\n    },\n\n    /**\n     * Clear canvas\n     * @param {Object} send\n     */\n    clear: function(send, reloadImage) {\n        $('.js_textContainer').remove();\n        this.laserPen = null;\n        reloadImage = typeof reloadImage == 'undefined' ? true : reloadImage;\n        this.cvs.clear();\n        if (reloadImage) this.connection.getImage();\n        if (send) this.connection.sendClear();\n        this.undoStack = [];\n        this.redoStack = [];\n    },\n\n    getMeta: function(url, cbk) {\n        var img = new Image();\n        var _this = this;\n        img.onload = function() {\n            cbk(_this, img.width, img.height);\n        };\n        img.src = url;\n        img.style.backgroundImage = 'url(' + url + ')';\n        //img.src = url(bgdesert.jpg) repeat-y;\n    },\n\n    /**\n     * Load an image onto the canvas\n     * @param {Object} url\n     */\n    loadImage: function(url, width, height) {\n        this.getMeta(url, function(_this, w, h) {\n            var W = _this.parent_.canvasWidth;\n            var H = _this.parent_.canvasHeight;\n\n            var x = 0;\n            var y = 0;\n            var ratioW = W / w;\n            var ratioH = H / h;\n            var ratio = Math.min(ratioW, ratioH);\n            w = w * ratio;\n            h = h * ratio;\n\n            if (w <= W && h <= H) {\n                // @TODO, resize the canvas;\n                x = (W - w) / 2;\n                y = (H - h) / 2;\n            } else {\n                if (ratioW < ratioH) {\n                    y = (H - h) / 2;\n                } else {\n                    x = (W - w) / 2;\n                }\n            }\n            if (y >= 30) { y = y - 30; }\n            var img = _this.cvs.image(url, x, y, w, h);\n            _this.changeCanvasSize(x, y, W, H, 30);\n            img.toBack();\n            //_this.cvs.image(url, 0, 0, _this.parent_.canvasWidth, _this.parent_.canvasHeight);\n        });\n    },\n\n    changeCanvasSize: function(x, y, width, height, extraY) {\n        var marginTop;\n        extraY = 0;\n        this.parent_.$.canvasContainer.applyStyle(\"width\", String(width * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"height\", String(height * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"margin-top\", String(this.getCanvasMarginTop()) + \"px\");\n        // Since thiere is 60px header bar.\n//        if (extraY) {\n//            marginTop = y / 2 + extraY;\n//            this.parent_.$.canvasContainer.applyStyle(\"margin-top\", String(marginTop) + \"px\");\n//        } else {\n//            marginTop = y / 2;\n//            this.parent_.$.canvasContainer.applyStyle(\"margin-top\", String(marginTop) + \"px\");\n//        }\n        this.canvasHeight = height;\n        this.canvasWidth = width;\n        this.topMargin = marginTop;\n    },\n\n    getImage: function() {\n        images = document.getElementsByTagName(\"image\");\n        // TODO More specific targetting of image\n        if (images.length != 0) {\n            for (var i = 0; i < images.length; i++) {\n                images[i].parentNode.removeChild(images[i]);\n            }\n        }\n        this.connection.getImage(this.currentPage);\n    },\n\n    /**\n     * Go to the next page\n     */\n    nextPage: function() {\n        if (this.currentPage + 1 > this.totalPages) {\n            // Blank canvas\n            return false;\n        } else {\n            $('.js_textContainer').remove();\n            this.laserPen = null;\n            this.zoomReduction();\n            this.changeCanvasSize(0, 0, this.parent_.canvasWidth, this.parent_.canvasHeight);\n            this.currentPage += 1;\n            this.connection.init(this.uid, this.room, this.currentPage);\n            return true;\n        }\n    },\n\n    /**\n     * Go to the previous page\n     */\n    prevPage: function() {\n        if (this.currentPage - 1 <= 0) {\n            // do nothing\n            return false;\n        } else {\n            $('.js_textContainer').remove();\n            this.laserPen = null;\n            this.zoomReduction();\n            this.changeCanvasSize(0, 0, this.parent_.canvasWidth, this.parent_.canvasHeight);\n            this.currentPage -= 1;\n            this.connection.init(this.uid, this.room, this.currentPage);\n            return true;\n        }\n    },\n\n    gotoPage: function(pageNum, broadcast) {\n        $('.js_textContainer').remove();\n        this.laserPen = null;\n        this.changeCanvasSize(0, 0, this.parent_.canvasWidth, this.parent_.canvasHeight);\n        this.currentPage = pageNum;\n        this.connection.init(this.uid, this.room, pageNum, broadcast);\n        this.callback(this.totalPages, this.currentPage);\n    },\n\n    newPage: function() {\n        $('.js_textContainer').remove();\n        this.laserPen = null;\n        this.currentPage = this.totalPages + 1;\n        this.totalPages += 1;\n        this.connection.newPage(this.uid, this.room, this.currentPage);\n    },\n\n    getColor: function() {\n        return this.color;\n    },\n\n    setTotalPages: function(pages) {\n        this.totalPages = pages.length;\n        this.page_list = pages;\n        this.callback(this.totalPages, this.currentPage);\n    },\n\n    /**\n     * Ask server to make video of current whiteboard\n     */\n    makeVideo: function() {\n        this.connection.makeVideo();\n    },\n\n    selectPen: function() {\n        this.drawingItem = 'pen';\n    },\n\n    selectHighlighter: function() {\n        this.drawingItem = 'highlighter';\n    },\n\n    selectEraser: function() {\n    this.drawingItem = 'eraser';\n    },\n\n    removeLaser: function(send) {\n        if (this.laserPen) {\n            $(this.laserPen.node).hide()\n            this.laserPen = null;\n            if (send) {\n            \tthis.connection.sendLaserEvent('laser-remove');\n            }\n        }\n    },\n\n    drawLaser: function(x, y, isRemote) {\n        var self = this;\n        var canvasBounds = this.parent_.$.canvasContainer.getBounds();\n        if (!x && !y) {\n            x = canvasBounds.width / 2 + canvasBounds.left;\n            y = canvasBounds.height / 2;\n        }\n\n        if (!isRemote) {\n            y = y + $('#app_scroller').scrollTop();\n        }\n\n        if (!this.laserPen) {\n            this.laserPen = this.cvs.circle(x, y, 8);\n            this.laserPen.attr({\n                stroke: \"red\",\n                fill: \"red\",\n                opacity: \"0.8\"\n            });\n        }\n        this.laserPen.attr({\n            cx: x,\n            cy: y\n        });\n\n        if (!isRemote && !this.isGuest()) {\n            // create remote laser\n            self.connection.sendLaserEvent('laser-draw', {\n                x: x,\n                y: y\n            });\n        }\n    },\n\n    drawRectangle: function() {\n        this.drawingItem = 'rectangle';\n    },\n\n    drawSquare: function() {\n        this.drawingItem = 'square';\n    },\n\n    drawArrow: function() {\n        this.drawingItem = 'arrow';\n    },\n\n    drawTriangle: function() {\n        this.drawingItem = 'triangle';\n    },\n\n    drawLine: function() {\n        this.drawingItem = 'line';\n    },\n\n    drawEllipse: function() {\n        this.drawingItem = 'ellipse';\n    },\n\n    drawCircle: function() {\n        this.drawingItem = 'circle';\n    },\n\n    disableTextEditing: function() {\n        var self = this;\n        this.cvs.forEach(function(node) {\n            if (node.type === 'text') {\n                // disable text editing after being zoomed\n                // since zooming would lead to several issues\n                // that hard to resolve.\n                node.unclick();\n            }\n        });\n    },\n    justifyText: function() {\n        var b = this.zoomRatio;\n\n        for (var i = 0, len = $('.js_textContainer').length; i < len; i++) {\n            var $text = $($('.js_textContainer')[i]);\n\n            $text.css({\n                left: $text.data('position-x') * b,\n                top: $text.data('position-y') * b,\n                width: $text.width() * b / this.zoomRatioPre,\n                height: $text.height() * b / this.zoomRatioPre\n            });\n        }\n\n        var textareaFrame = $('#textareaFrame');\n        textareaFrame.css({\n            left: textareaFrame.data('position-x') * b,\n            top: textareaFrame.data('position-y') * b\n        });\n\n        var outerLine = $('#selectedOuterLine');\n        if (outerLine[0]) {\n            outerLine.css({\n                left: outerLine.data('position-x') * b,\n                top: outerLine.data('position-y') * b\n            });\n        }\n\n    },\n    zoomIn: function() {\n        if (this.zoomRatio >= this.zoomRatioMax) {\n            return;\n        }\n        this.zoomRatioPre = this.zoomRatio;\n        this.zoomRatio += this.zoomRatioChange;\n        if (this.zoomRatio > this.zoomRatioMax) {\n        \tthis.zoomRatio = this.zoomRatioMax;\n        }\n        \n        var containerId = this.parent_.$.canvasContainer.id;\n        var oldWidth = document.getElementById(containerId).offsetWidth;\n\n        this.cvs.scaleAll(this.zoomRatio);\n        // Adjust convas size accordingly\n        this.parent_.$.canvasContainer.applyStyle(\"width\", String(this.canvasWidth * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"height\", String(this.canvasHeight * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"margin-top\", String(this.getCanvasMarginTop()) + \"px\");\n\n        var newWidth = document.getElementById(containerId).offsetWidth;\n        var percent = newWidth / oldWidth;\n        var RongWhiteboard = window.RongWhiteboard || window.parent.RongWhiteboard;\n        if (RongWhiteboard && RongWhiteboard.zoom) {\n            window.RongSvgUtils.scaleAll(percent);\n            RongWhiteboard.zoom(percent);\n        }\n        // window.on\n        // if (this.laserPen) {\n        //     this.removeLaser(true);\n        //     this.drawLaser();\n        // }\n        this.justifyText();\n        this.disableTextEditing();\n    },\n    zoomOut: function() {\n        if (this.zoomRatio <= this.zoomRatioMin) {\n            return;\n        }\n        this.zoomRatioPre = this.zoomRatio;\n        this.zoomRatio -= this.zoomRatioChange;\n        if (this.zoomRatio < this.zoomRatioMin) {\n        \tthis.zoomRatio = this.zoomRatioMin;\n        }\n\n        var containerId = this.parent_.$.canvasContainer.id;\n        var oldWidth = document.getElementById(containerId).offsetWidth;\n        this.cvs.scaleAll(this.zoomRatio);\n\n        // Adjust convas size accordingly\n        this.parent_.$.canvasContainer.applyStyle(\"width\", String(this.canvasWidth * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"height\", String(this.canvasHeight * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"margin-top\", String(this.getCanvasMarginTop()) + \"px\");\n        // redrew the laser pen, or there will be offset while been dragging around,\n        // since it will be calculated by old canvas bounds.\n        // if (this.laserPen) {\n        //     this.removeLaser(true);\n        //     this.drawLaser();\n        // }\n\n        var newWidth = document.getElementById(containerId).offsetWidth;\n        var percent = newWidth / oldWidth;\n        var RongWhiteboard = window.RongWhiteboard || window.parent.RongWhiteboard;\n        if (RongWhiteboard && RongWhiteboard.zoom) {\n            window.RongSvgUtils.scaleAll(percent);\n            RongWhiteboard.zoom(percent);\n        }\n        this.justifyText();\n        this.disableTextEditing();\n    },\n    zoomReduction: function() {\n        this.zoomRatio = 1;\n        this.zoomRatio = this.zoomRatio * this.zoomRatioCustom;\n        this.cvs.scaleAll(this.zoomRatio);\n        // Adjust convas size accordingly\n        this.parent_.$.canvasContainer.applyStyle(\"width\", String(this.canvasWidth * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"height\", String(this.canvasHeight * this.zoomRatio) + \"px\");\n        this.parent_.$.canvasContainer.applyStyle(\"margin-top\", String(this.getCanvasMarginTop()) + \"px\");\n\n        this.justifyText();\n        this.disableTextEditing();\n    },\n\n    undoWithDrawing: function() {\n        this.executeUndo2(true);\n    },\n\n    redoWithDrawing: function() {\n        this.executeRedo2(true);\n    },\n\n    executeUndo2: function(send, guid) {\n        //var element = this.undoStack.pop(),\n        var element, guid, clone;\n\n        if (!guid && this.undoStack.length > 0) {\n            //remote\n            guid = this.undoStack[this.undoStack.length - 1].guid;\n        }\n        console.log(this.undoStack);\n        for (var i = this.undoStack.length - 1; i >= 0; i -= 1) {\n            if (this.undoStack[i].guid == guid) {\n                element = this.undoStack[i];\n                this.undoStack.splice(i, 1);\n                break;\n            };\n        }\n        console.log(this.undoStack);\n        console.log(\"executeUndo2\", guid, element);\n        if (element) {\n            if (element.type === 'rm') {\n                console.log(\"draw\", element.path);\n                if (element.path.type == 'text') {\n                    //text\n                    this.drawTextEx(element.path);\n                } else if (element.path.type == 'path-line') {\n                    //line\n                    this.d3SVG.append(\"path\")\n                        .datum(element.path.datum)\n                        .attr(\"id\", element.path.guid)\n                        .attr(\"stroke\", element.path.lineColor)\n                        .attr(\"stroke-width\", element.path.lineWidth)\n                        .attr(\"fill\", \"none\")\n                        .attr(\"d\", this.penFunction);\n                } else {\n                    //shape\n                    var clone = element.path.clone();\n                    clone.guid = element.path.guid;\n                    clone.node.id = element.path.guid;\n                    console.log(\"undo2 clone\", clone);\n                }\n                this.redoStack.push(element);\n            } else {\n                console.log(\"rm \", element);\n                $(\"#\" + guid).remove();\n                this.redoStack.push(element);\n            }\n            //if (element.type === 'path-line') {\n            //guid = element.pathID;\n            //$(\"#\" + guid).remove();\n            //this.redoStack.push(element);\n            //} else if (element.type === 'rm-shape') {\n            //guid = guid || element.shape.node.id;\n            //clone = element.shape.clone();\n            //clone.node.id = guid;\n            //this.redoStack.push({\n            //type: 'rm-shape',\n            //shape: clone\n            //});\n            //} else if (element.type === 'rm-path') {\n            //guid = guid || element.path.pathID;\n            //this.d3SVG.append(\"path\")\n            //.datum(element.path.datum)\n            //.attr(\"id\", element.path.pathID)\n            //.attr(\"stroke\", element.path.lineColor)\n            //.attr(\"stroke-width\", element.path.lineWidth)\n            //.attr(\"fill\", \"none\")\n            //.attr(\"d\", this.penFunction);\n            //this.redoStack.push(element);\n            //} else {\n            //guid = guid || element.node.id;\n            //$(\"#\" + guid).remove();\n            //this.redoStack.push(element);\n            //}\n            if (send && guid && element) {\n                this.connection.sendPath({\n                    type: 'undo',\n                    guid: guid\n                })\n            }\n        }\n    },\n\n    executeRedo2: function(send, guid) {\n        //var element = this.redoStack.pop(),\n        var element, guid, clone;\n        if (!guid && this.redoStack.length > 0) {\n            //remote\n            guid = this.redoStack[this.redoStack.length - 1].guid;\n        }\n        for (var i = this.redoStack.length - 1; i >= 0; i -= 1) {\n            if (this.redoStack[i].guid == guid) {\n                element = this.redoStack[i];\n                this.redoStack.splice(i, 1);\n                break;\n            };\n        }\n        console.log(\"executeRedo2\", element);\n        if (element) {\n            if (element.type === 'rm') {\n                console.log(\"rm\", element)\n                $(\"#\" + element.op_guid).remove();\n                this.undoStack.push(element);\n            } else {\n                console.log(\"draw\", element)\n                if (element.type == 'text') {\n                    //text\n                    this.drawTextEx(element);\n                } else if (element.type == 'path-line') {\n                    //line\n                    this.d3SVG.append(\"path\")\n                        .datum(element.datum)\n                        .attr(\"id\", guid)\n                        .attr(\"stroke\", element.lineColor)\n                        .attr(\"stroke-width\", element.lineWidth)\n                        .attr(\"fill\", \"none\")\n                        .attr(\"d\", this.penFunction);\n                } else {\n                    //shape\n                    var clone = element.clone();\n                    clone.guid = element.guid;\n                    clone.node.id = element.guid;\n                    console.log(\"redo2 clone\", clone);\n                }\n                this.undoStack.push(element);\n            }\n            //if (element.type === 'path-line') {\n            //guid = guid || element.pathID;\n            //this.d3SVG.append(\"path\")\n            //.datum(element.datum)\n            //.attr(\"id\", element.pathID)\n            //.attr(\"stroke\", element.lineColor)\n            //.attr(\"stroke-width\", element.lineWidth)\n            //.attr(\"fill\", \"none\")\n            //.attr(\"d\", this.penFunction);\n            //this.undoStack.push(element);\n            //} else if (element.type === 'rm-shape') {\n            //guid = guid || element.shape.node.id;\n            //$(\"#\" + guid).remove();\n            //this.undoStack.push({\n            //shape: element.shape,\n            //type: 'rm-shape'\n            //});\n            //} else if (element.type === 'rm-path') {\n            //guid = guid || element.path.pathID;\n            //$(\"#\" + guid).remove();\n            //this.undoStack.push({\n            //path: element.path,\n            //type: 'rm-path'\n            //});\n            //} else if (element.type === 'text') {\n            ////guid = guid || element.node.id;\n            //// var x = element.attr(\"x\");\n            //// var y = element.attr(\"y\");\n            //// var text = element.attr(\"text\");\n            //// this.executeAddText(x, y, text);\n            //this.drawText(element);\n            //} else {\n            //guid = guid || element.node.id;\n            //clone = $.extend({},element);\n            //clone.node.id = guid;\n            //this.undoStack.push(clone);\n            //}\n\n            if (send && guid && element) {\n                this.connection.sendPath({\n                    type: 'redo',\n                    guid: guid\n                });\n            }\n        }\n    },\n\n    undo: function() {\n        this.executeUndo();\n        this.connection.sendPath({ type: 'undo' })\n    },\n\n    executeUndo: function() {\n        console.log('executeUndo @' + Date());\n        var toUndo = this.undoStack.pop();\n        if (toUndo) {\n            if (toUndo.type === 'path-line') {\n                var p = document.getElementById(toUndo.pathID);\n                if (p) {\n                    p.parentElement.removeChild(p);\n                    this.redoStack.push(toUndo);\n                } else {\n                    console.log(\"fail to find the path by id + \" + toUndo.pathID + \" to execute undo\");\n                }\n            } else if (toUndo.type === 'rm-shape') {\n                var cloneShape = toUndo.shape.clone(); // clone to re-draw the shape\n                this.redoStack.push({ // push the {type: 'rm-shape', shape: clone} to redoStack\n                    type: 'rm-shape',\n                    shape: cloneShape\n                });\n            } else if (toUndo.type === 'rm-path') { // draw the path back\n                var pathObj = $(toUndo.path.outerHTML);\n                this.d3SVG.append(\"path\")\n                    .attr(\"id\", pathObj.attr('id'))\n                    .attr(\"stroke\", pathObj.attr('stroke'))\n                    .attr(\"stroke-width\", pathObj.attr('stroke-width'))\n                    .attr(\"fill\", \"none\")\n                    .attr(\"d\", pathObj.attr('d'));\n                this.redoStack.push(toUndo);\n            } else {\n                var clone = $.extend(true, {}, toUndo);\n                this.redoStack.push(clone);\n                toUndo.remove();\n            }\n        }\n    },\n\n    redo: function() {\n        this.executeRedo();\n        this.connection.sendPath({ type: 'redo' });\n    },\n\n    executeRedo: function() {\n        console.log('executeRedo @' + Date());\n        var toRedo = this.redoStack.pop();\n        if (toRedo) {\n            if (toRedo.type === 'path-line') {\n                this.d3SVG.append(\"path\")\n                    .datum(toRedo.datum)\n                    .attr(\"id\", toRedo.penPathID)\n                    .attr(\"stroke\", toRedo.lineColor)\n                    .attr(\"stroke-width\", toRedo.lineWidth)\n                    .attr(\"fill\", \"none\")\n                    .attr(\"d\", this.penFunction);\n                this.undoStack.push(toRedo);\n            } else if (toRedo.type === 'rm-shape') {\n                var clone = $.extend({}, toRedo.shape);\n                this.undoStack.push({\n                    type: 'rm-shape',\n                    shape: clone\n                });\n                toRedo.shape.remove();\n            } else if (toRedo.type === 'rm-path') { // redo to remove the path\n                var p = document.getElementById(toRedo.path.id);\n                if (p) {\n                    var clone = $.extend({}, toRedo.path);\n                    this.undoStack.push({ type: 'rm-path', path: clone });\n                    p.parentElement.removeChild(p);\n                }\n            } else {\n                var clone = toRedo.clone();\n                this.undoStack.push(clone);\n            }\n        }\n    },\n\n    onTextClicked: function(t) {\n        // Guest user should not allowed to edit text on whiteboard.\n        if (this.isGuest()) return;\n\n        var textBBox = t.getBBox();\n        this.selectElementAndDrawOutline(textBBox.x, textBBox.y);\n        var input = t.inlineTextEditing.startEditing(); // Retrieve created <input type=text> field\n        var _this = this;\n        var prevDrawingItem = this.drawingItem;\n        // stop drawing while we're editing text\n        this.drawingItem = '';\n        input.addEventListener(\"blur\", function(e) {\n            // Stop inline editing after blur on the text field\n            t.inlineTextEditing.stopEditing();\n            _this.connection.sendPath({\n                type: 'edittext',\n                oldx: t.attrs.x,\n                oldy: t.attrs.y,\n                value: t.inlineTextEditing.input.value,\n                guid: t.node.id\n            });\n            // restore previous drawing item.\n            _this.drawingItem = prevDrawingItem;\n            //_this.cancelSelect();\n        });\n    },\n\n    findAndRemoveFromStack: function(stack, guid) {\n        var clone;\n\n        for (index = 0, length = stack.length; index < length; index += 1) {\n            var obj = stack[index];\n            if (!obj || !obj.type) {\n                // remove invalid obj in undo/redo stack\n                stack.splice(index, 1);\n                continue;\n            }\n            if (obj.guid === guid) {\n                clone = $.extend({}, obj);\n                // Remove the element from stack\n                //stack.splice(index, 1);\n                stack.push({\n                    path: clone,\n                    type: 'rm'\n                });\n            }\n\n            //if (obj.type === 'path-line') {\n            //if (obj.pathID === guid) {\n            //clone = $.extend({}, obj);\n            //// Remove the element from stack\n            //stack.splice(index, 1);\n            //stack.push({\n            //path: clone,\n            //type: 'rm-path'\n            //});\n            //}\n            //} else if (obj.type === 'rm-shape') {\n            //if (obj.shape.node.id === guid) {\n            //clone = $.extend({}, obj.shape);\n            //stack.splice(index, 1);\n            //stack.push({\n            //shape: clone,\n            //type: 'rm-shape'\n            //});\n            //}\n            //} else if (obj.type === 'rm-path') {\n            //if (obj.path.pathID === guid) {\n            //clone = $.extend({}, obj.path);\n            //stack.splice(index, 1);\n            //stack.push({\n            //path: clone,\n            //type: 'rm-path'\n            //})\n            //}\n            //}else if(obj.type === 'text') {\n            //stack.splice(index, 1);\n            //stack.push($.extend({}, obj));\n            //}else{\n            //if (obj.node.id === guid) {\n            //clone = $.extend({}, obj);\n            //stack.splice(index, 1);\n            //stack.push({\n            //shape: clone,\n            //type: 'rm-shape'\n            //});\n            //}\n            //}\n        }\n        return clone;\n    },\n\n    removeSelectedEx: function(rm_guid, op_guid) {\n        for (var index = this.undoStack.length - 1; index >= 0; index -= 1) {\n            //console.log(index , guid, this.undoStack[index]);\n            if (this.undoStack[index].guid === op_guid) {\n                this.undoStack.push({\n                    type: 'rm',\n                    guid: rm_guid,\n                    op_guid: op_guid,\n                    path: this.undoStack[index]\n                });\n                break;\n            }\n        }\n\n        var outerLine = $('#selectedOuterLine');\n\n        if (outerLine.is(\":visible\")) {\n            outerLine.hide();\n        }\n\n        $('#textareaFrame').hide();\n\n        $(\"#\" + op_guid).remove();\n        this.cancelSelect();\n    },\n    /*\n     * @guid if guid is not null, then the operation is from remote user\n     * */\n    removeSelected: function(send, guid, op_guid) {\n        var element,\n            elementId,\n            //id,\n            guid, op_guid;\n\n        if (guid) {\n            //elementId = guid;\n        } else {\n            // currentSelected is a local variable, it only initialzed by user selection\n            // if the remove operation is initialized by remove user, then it always be null.\n            if (!this.currentSelected) {\n                return;\n            }\n            element = this.currentSelected.element;\n            if (this.currentSelected.path) {\n                // user select a path object\n                elementId = element.id;\n            } else {\n                // user select a shape object\n                elementId = element.node.id;\n            }\n            //guid = elementId;\n            guid = this.guid();\n            op_guid = elementId;\n        }\n\n        this.removeSelectedEx(guid, op_guid);\n        //this.findAndRemoveFromStack(this.undoStack, guid);\n        //this.findAndRemoveFromStack(this.redoStack, guid);\n        if (send) {\n            this.connection.sendPath({\n                type: 'rm',\n                guid: guid,\n                op_guid: op_guid\n            });\n        }\n    },\n\n    executeRemove: function(x, y) {\n        var pageX = x + this.parent_.$.canvasContainer.getBounds().left;\n        var pageY = y + this.parent_.$.canvasContainer.getBounds().top;\n\n        var svgElem = this.cvs.getElementByPoint(pageX, pageY);\n        if (svgElem) {\n            var clone = $.extend({}, svgElem);\n            this.undoStack.push({\n                type: 'rm-shape',\n                shape: clone\n            });\n            svgElem.remove();\n            this.cancelSelect();\n            return true;\n        }\n\n        var domElem = document.elementFromPoint(pageX, pageY);\n        if (domElem && (domElem.id.indexOf('path-') > -1)) {\n            var clone = $.extend({}, domElem);\n            this.undoStack.push({\n                type: 'rm-path',\n                path: clone\n            });\n            domElem.remove();\n            this.cancelSelect();\n            return true;\n        }\n\n        return false;\n    },\n\n    doSelect: function() {\n        this.drawingItem = '';\n        this.doingSelect = true;\n    },\n\n    hasSelectElement: function() {\n        return !!this.currentSelected;\n    },\n\n    cancelSelect: function() {\n        if (this.currentSelected) {\n            var outerRect = this.currentSelected.outerRect,\n                index, length;\n            var element = $('#selectedOuterLine');\n            if (element[0]) {\n                element.hide();\n            }\n            if (!outerRect) return;\n\n            for (index = 0, length = outerRect.length; index < length; index += 1) {\n                outerRect[index].remove();\n            }\n        }\n        this.currentSelected = null;\n    },\n\n    stopDoingSelect: function() {\n        this.doingSelect = false;\n    },\n\n    selectSvgElementByPoint: function(x, y) {\n        var indexX, indexY, element;\n\n        for (indexX = x - 10; indexX < x + 10; indexX += 1) {\n            for (indexY = y - 10; indexY < y + 10; indexY += 1) {\n                element = this.cvs.getElementByPoint(indexX, indexY);\n                if (element) {\n                    if (element.type === 'image') {\n                        // background image should not be selected.\n                        // ignore it\n                        continue;\n                    }\n                    return element;\n                }\n            }\n        }\n        return undefined;\n    },\n\n    selectDomElementByPoint: function(x, y) {\n        var indexX, indexY, element;\n\n        for (indexX = x - 10; indexX < x + 10; indexX += 1) {\n            for (indexY = y - 10; indexY < y + 10; indexY += 1) {\n\n                element = document.elementFromPoint(indexX, indexY);\n                if (element && (element.id.indexOf('path-') > -1)) {\n                    return element;\n                }\n            }\n        }\n        return undefined;\n    },\n\n    appclicked: function(data) {\n\n        x = this.zoomConvert(data.x);\n        y = this.zoomConvert(data.y);\n\n        // if (this.laserPen) {\n        //     this.removeLaser(true);\n        //     this.drawLaser(x, y);\n        // }\n\n        if (data.laserOn) {\n            //this.removeLaser(true);\n            this.drawLaser(x, y);\n        } else if (this.addingText) {\n\n            // modify the Add text bug temporary add\n            /*--------------------------------------------------------*/\n            this.drawTextareaFrame(data);\n\n            return;\n\n            /*--------------------------------------------------------*/\n\n            // if(this.hasSelectElement()){\n            //     var element = this.currentSelected.element;\n            //     if (element.type === 'text') {\n            //         var bbox = element.getBBox();\n            //         // Adding 72px since the y axis of outline around text has 72px offset\n            //         if (x > bbox.x &&\n            //             x < bbox.x + bbox.width &&\n            //             y > bbox.y &&\n            //             y < bbox.y + bbox.height + 72) {\n            //             return;\n            //         }\n            //     }\n            // }\n\n            // this.executeAddText(x, y);\n            // this.connection.sendPath({\n            //     oldx: x,\n            //     oldy: y,\n            //     type: 'addtext',\n            //     guid: String(x) + '-' + String(y)\n            // });\n        } else if (this.doingSelect) {\n            this.selectElementAndDrawOutline(data);\n        }\n    },\n    selectElementAndDrawOutline: function(data) {\n\n        var target = data.event.target,\n            parentEle = $(target).parent(),\n            x = Number(parentEle.attr('x')),\n            y = Number(parentEle.attr('y')),\n            guid = parentEle.attr('id');\n\n        $('#selectedOuterLine').remove();\n\n        if (target.className === 'text-entity') {\n            this.cancelSelect();\n            var frame = this.drawOuterLine('selectedOuterLine');\n\n            frame.css({\n                    left: parentEle.offset().left + $('#app_scroller').scrollLeft() - data.canvas.left,\n                    top: parentEle.offset().top + $('#app_scroller').scrollTop() - data.canvas.top,\n                    zIndex: 1\n                })\n                .data({\n                    'position-x': parentEle.data('position-x'),\n                    'position-y': parentEle.data('position-y')\n                })\n                .show();\n\n            this.currentSelected = {\n                path: false,\n                element: {\n                    guid: guid,\n                    x: x,\n                    y: y,\n                    node: {\n                        id: guid\n                    }\n                }\n            };\n        }\n\n        var pageX = data.x + this.parent_.$.canvasContainer.getBounds().left;\n        var pageY = data.y + this.parent_.$.canvasContainer.getBounds().top;\n\n        var svgElem = this.selectSvgElementByPoint(pageX, pageY);\n        if (svgElem) {\n            // Do not glow laser pen\n            if (svgElem !== this.laserPen && !this.isOutline(svgElem)) {\n                if (svgElem.type === 'text') {\n                    if (this.hasSelectElement()) {\n                        var element = this.currentSelected.element;\n                        // if current selected element is the same with the one we're click on\n                        var bbox = element.getBBox();\n                        // Adding 72px since the y axis of outline around text has 72px offset\n                        if (bbox && x > bbox.x &&\n                            x < bbox.x + bbox.width &&\n                            y > bbox.y &&\n                            y < bbox.y + bbox.height + 72) {\n                            return;\n                        }\n                    }\n                }\n                // cancel previous selection\n                this.cancelSelect();\n\n                var result;\n                if (svgElem.type === 'text') {\n                    result = this.drawOuterLineOnSelected(svgElem, 6, 6, 72, 72);\n                } else {\n                    result = this.drawOuterLineOnSelected(svgElem);\n                }\n                this.currentSelected = {\n                    path: false,\n                    element: svgElem,\n                    outerRect: result\n                };\n            }\n        }\n\n        var domElem = this.selectDomElementByPoint(pageX, pageY);\n        if (domElem) {\n            // cancel previous selection\n            this.cancelSelect();\n\n            var result = this.drawOuterLineOnSelected(domElem);\n            this.currentSelected = {\n                path: true,\n                element: domElem,\n                outerRect: result\n            };\n        }\n    },\n\n    isOutline: function(svgElement) {\n        if (!svgElement) return false;\n        if (svgElement.data(\"isOutline\")) {\n            return true;\n        }\n        return false;\n    },\n\n    drawOuterLineOnSelected: function(svgElem, xOffset, yOffset, widthOffset, heightOffset) {\n        var xOffset = xOffset || 2;\n        var yOffset = yOffset || 2;\n        var widthOffset = widthOffset || 4;\n        var heightOffset = heightOffset || 4;\n\n        var result = [];\n        var bbBox = svgElem.getBBox();\n        if (!bbBox) {\n            return;\n        }\n        var outerRect = this.cvs.rect(\n            bbBox.x - xOffset,\n            bbBox.y - yOffset,\n            bbBox.width + widthOffset,\n            bbBox.height + heightOffset);\n\n        outerRect.attr({\n            \"stroke-dasharray\": [\"--\"],\n            \"stroke\": \"rgb(0, 158, 235)\",\n            \"stroke-width\": 1\n        });\n        outerRect.data(\"isOutline\", true);\n        result.push(outerRect);\n\n        var cornerRectAttr = {\n            \"stroke\": \"rgb(0, 158, 235)\",\n            \"stroke-width\": 1,\n            \"fill\": \"rgb(0, 158, 235)\"\n        };\n\n        var cornerRect1 = this.cvs.rect(bbBox.x - 8, bbBox.y - 8, 8, 8)\n        cornerRect1.attr(cornerRectAttr);\n        cornerRect1.data(\"isOutline\", true);\n        result.push(cornerRect1);\n\n        var cornerRect2;\n        if (svgElem.type === 'text') {\n            cornerRect2 = this.cvs.rect(bbBox.x - 4 + bbBox.width + 64, bbBox.y - 8, 8, 8);\n        } else {\n            cornerRect2 = this.cvs.rect(bbBox.x - 2 + bbBox.width, bbBox.y - 8, 8, 8);\n        }\n        cornerRect2.attr(cornerRectAttr);\n        cornerRect2.data(\"isOutline\", true);\n        result.push(cornerRect2);\n\n        var cornerRect3;\n        if (svgElem.type === 'text') {\n            cornerRect3 = this.cvs.rect(bbBox.x - 8, bbBox.y + bbBox.height + 60, 8, 8);\n        } else {\n            cornerRect3 = this.cvs.rect(bbBox.x - 8, bbBox.y + bbBox.height, 8, 8);\n        }\n\n        cornerRect3.attr(cornerRectAttr);\n        cornerRect3.data(\"isOutline\", true);\n        result.push(cornerRect3);\n\n        var cornerRect4;\n        if (svgElem.type === 'text') {\n            cornerRect4 = this.cvs.rect(bbBox.x - 5 + bbBox.width + 64, bbBox.y - 5 + bbBox.height + 66, 8, 8);\n        } else {\n            cornerRect4 = this.cvs.rect(bbBox.x - 5 + bbBox.width, bbBox.y - 5 + bbBox.height, 8, 8);\n        }\n        cornerRect4.attr(cornerRectAttr);\n        cornerRect4.data(\"isOutline\", true);\n        result.push(cornerRect4);\n\n        var cornerRect5;\n        if (svgElem.type === 'text') {\n            cornerRect5 = this.cvs.rect(bbBox.x - 5 + bbBox.width / 2 + 32, bbBox.y - 5 + bbBox.height + 66, 8, 8);\n        } else {\n            cornerRect5 = this.cvs.rect(bbBox.x - 5 + bbBox.width / 2, bbBox.y - 3 + bbBox.height, 8, 8);\n        }\n        cornerRect5.attr(cornerRectAttr);\n        cornerRect5.data(\"isOutline\", true);\n        result.push(cornerRect5);\n\n        var cornerRect6;\n        if (svgElem.type === 'text') {\n            cornerRect6 = this.cvs.rect(bbBox.x - 5 + bbBox.width / 2 + 32, bbBox.y - 10, 8, 8);\n        } else {\n            cornerRect6 = this.cvs.rect(bbBox.x - 5 + bbBox.width / 2, bbBox.y - 5, 8, 8);\n        }\n        cornerRect6.attr(cornerRectAttr);\n        cornerRect6.data(\"isOutline\", true);\n        result.push(cornerRect6);\n\n        var cornerRect7;\n        if (svgElem.type === 'text') {\n            cornerRect7 = this.cvs.rect(bbBox.x - 10, bbBox.y + bbBox.height / 2 + 27, 8, 8);\n        } else {\n            cornerRect7 = this.cvs.rect(bbBox.x - 7, bbBox.y - 5 + bbBox.height / 2, 8, 8);\n        }\n        cornerRect7.attr(cornerRectAttr);\n        cornerRect7.data(\"isOutline\", true);\n        result.push(cornerRect7);\n\n        var cornerRect8;\n        if (svgElem.type === 'text') {\n            cornerRect8 = this.cvs.rect(bbBox.x + bbBox.width + 60, bbBox.y + bbBox.height / 2 + 27, 8, 8);\n        } else {\n            cornerRect8 = this.cvs.rect(bbBox.x - 3 + bbBox.width, bbBox.y - 5 + bbBox.height / 2, 8, 8);\n        }\n        cornerRect8.attr(cornerRectAttr);\n        cornerRect8.data(\"isOutline\", true);\n        result.push(cornerRect8);\n\n        return result;\n    },\n    createElementNS: function(a) {\n        var b = document.createElementNS(\"http://www.w3.org/1999/xhtml\", \"div\");\n        b.innerHTML = '<svg xmlns=\"http://www.w3.org/2000/svg\">' + a + \"</svg>\";\n        for (var c = document.createDocumentFragment(); b.firstChild.firstChild;) {\n            c.appendChild(b.firstChild.firstChild);\n        }\n        return c;\n    },\n    drawTextEx: function(data) {\n\n        var updateEle = $(\"#\" + data.guid),\n            _this = this\n\n        var x = data.oldx,\n            y = data.oldy;\n\n        if (data.frame) {\n            var left = data.frame.position().left || x,\n                top = data.frame.position().top || y;\n        } else {\n            var left = x,\n                top = y;\n            left = this.zoomUnConvert(left);\n            top = this.zoomUnConvert(top);\n        }\n\n        if (updateEle.get(0)) {\n            updateEle.attr({\n                x: x,\n                y: y\n            }).show();\n            updateEle.find('textarea').val(data.value);\n        } else {\n        \t// 原始宽高\n        \tvar width = 200;\n        \tvar height = 100;\n        \twidth = width * this.zoomRatio;\n        \theight = height * this.zoomRatio;\n            $('#svggroup').append('<div id=\"' + data.guid + '\" data-position-x=\"' + x + '\" data-position-y=\"' + y + '\" class=\"js_textContainer\" style=\"z-index:2; width:' + width + 'px; height:' + height + 'px;position:absolute; left:' + left + 'px; top:' + top + 'px;\"><textarea style=\"background:transparent; color:red; font-size:24px; font-weight:bold; width:100%; height:100%;overflow:auto;\" onselect=\"return false;\" unselectable=\"on\" class=\"text-entity\" readonly=\"true\" resizeable=false>' + data.value + '</textarea></div>');\n        }\n    },\n    updateUndoStack: function(data) {\n        var undoStack = this.undoStack;\n        for (var i = undoStack.length - 1; i >= 0; i--) {\n            if (data.guid == undoStack[i].guid) {\n                $.extend(undoStack[i], data);\n                undoStack[i].type = 'text';\n            }\n        }\n        this.drawTextEx(data);\n    },\n    drawText: function(data) {\n\n        // if the operation type is to edit the text, update the undo stack\n        if (data.type === 'edittext' && !data.remote) {\n            this.updateUndoStack(data);\n            return;\n        }\n\n        this.undoStack.push({\n            node: {\n                id: data.guid\n            },\n            guid: data.guid,\n            type: 'text',\n            oldx: data.oldx,\n            oldy: data.oldy,\n            value: data.value\n        });\n        this.drawTextEx(data);\n\n    },\n    drawOuterLine: function(id) {\n        var id = id || 'textareaFrame';\n\n        // 原始宽高\n        var width = 200;\n        var height = 100;\n        width = width * this.zoomRatio;\n        height = height * this.zoomRatio;\n\n        var outLineHtml = '<div id=\"' + id + '\" class=\"js_textContainer\" style=\"position:absolute; border:1px dashed #0096fd; width:' + width + 'px; height:' + height + 'px; z-index:10;\">',\n            styleStringBase = 'width:6px; height:6px; float:left; background-color:#0096fd;',\n            styleString = styleStringBase + '';\n\n\n        var dotHtml = '<div class=\"line\" style=\"width:100%; margin-top:-3px\">\\\n            <i style=\"' + styleString + ' margin-left:-3px;\"></i>\\\n            <i style=\"' + styleString + ' margin-left:' + (width / 2 - 2) + 'px;\"></i>\\\n            <i style=\"' + styleString + ' float:right; margin-right:-4px;\"></i>\\\n        </div><div class=\"line\" style=\"width:100%; margin-top:' + (height / 2 - 2) + 'px\">\\\n            <i style=\"' + styleString + ' margin-left:-3px;\"></i>\\\n            <i style=\"' + styleString + ' float:right; margin-right:-4px;\"></i>\\\n        </div><div class=\"line\" style=\"width:100%; margin-top:' + height + 'px\">\\\n            <i style=\"' + styleString + ' margin-left:-4px;\"></i>\\\n            <i style=\"' + styleString + ' margin-left:' + (width / 2 - 2) + 'px;\"></i>\\\n            <i style=\"' + styleString + ' float:right; margin-right:-4px;\"></i>\\\n        </div>';\n\n        outLineHtml += dotHtml;\n\n        if (id === 'textareaFrame') {\n            textareaHtml = '<textarea id=\"_textarea\" style=\"background:transparent; color:red; z-index:2; width:' + (width - 10) + 'px; height:' + (height - 10) + 'px; margin:' + (-1 * height) + 'px 0 0 3px; float:left; overflow:auto; border:0 none; z-index:11; font-size:24px; font-weight:bold; resize:none;\"></textarea>';\n\n            outLineHtml += textareaHtml + '</div>';\n        }\n\n        $('#svggroup').append(outLineHtml);\n\n        return $('#' + id);\n    },\n    drawTextareaFrame: function(data) {\n\n        var frame = $('#textareaFrame'),\n            target = $(data.event.target);\n\n        if (!frame[0]) {\n            frame = this.drawOuterLine();\n            // var $draggable = frame.draggabilly({\n            //     // contain to parent element\n            //     containment: true\n            // });\n        }\n\n        data.frame = frame;\n\n        this.executeAddText2(data);\n\n    },\n    showText: function(data) {\n        var x = this.zoomUnConvert(data.x),\n        \ty = this.zoomUnConvert(data.y);\n\n        var left = data.x,\n            top = data.y;\n\n        data.frame.css({\n                top: top + data.scrollTop,\n                left: left + data.scrollLeft\n            })\n            .data({\n                'position-x': x,\n                'position-y': y\n            })\n            .show();\n\n        data.textarea.focus();\n    },\n    executeAddText2: function(data) {\n        var textarea = $('#_textarea'),\n            target = data.event.target,\n            frame = data.frame,\n            position = frame.position(),\n            val = textarea.val(),\n            box = $('#app_scroller'),\n            scrollTop = box.scrollTop()\n        scrollLeft = box.scrollLeft();\n\n        data.scrollTop = scrollTop;\n        data.scrollLeft = scrollLeft;\n\n        // edit the original text\n        if (!this.textEditing && target.className === 'text-entity') {\n            data.textarea = textarea;\n            this.textEdit(data);\n        } else {\n            // save the add text info\n            var notTextareaEditing = this.textEditing && target.id !== '_textarea';\n\n            if (notTextareaEditing && $.trim(val) != '') {\n\n                var guid = textarea.data('guid'),\n                    operationType = guid ? 'edittext' : 'addtext';\n\n                guid = guid || this.guid();\n\n                var x = frame.data('position-x'),\n                    y = frame.data('position-y');\n                x = this.zoomConvert(x);\n                y = this.zoomConvert(y);\n                x = this.zoomConvert(x);\n                y = this.zoomConvert(y);\n\n                var sendData = {\n                    oldx: x,\n                    oldy: y,\n                    guid: guid,\n                    type: operationType,\n                    value: val\n                };\n\n                this.connection.sendPath(sendData);\n\n                this.drawText($.extend(data, sendData));\n\n                frame.hide();\n\n                textarea.val('').data('guid', '');\n            } else {\n                if (notTextareaEditing && $.trim(val) == '' && frame.is(':visible')) {\n                    frame.hide();\n                } else if (this.textEditing && target.id === '_textarea') {\n                    return;\n                } else if (!data.cancelSelect) {\n                    // add textarea\n                    data.textarea = textarea;\n                    this.showText(data);\n                }\n            }\n        }\n        this.textEditing = !this.textEditing;\n\n    },\n    textEdit: function(data) {\n        var target = data.event.target,\n            parentEle = $(target).parent(),\n            textarea = parentEle.find('textarea'),\n            guid = parentEle.attr('id');\n\n        data.frame.css({\n                top: parentEle.position().top,\n                left: parentEle.position().left\n            })\n            .show()\n            .data({\n                'position-x': parentEle.data('position-x'),\n                'position-y': parentEle.data('position-y')\n            });\n\n        parentEle.remove();\n\n        data.textarea.val(target.value).focus().data('guid', guid);\n    },\n    executeAddText: function(x, y, text) {\n        // Top banner is 60px height\n\n        var yPosition = y;\n        text = text || $L(\"Adding text here\");\n        var text = this.cvs.text(x, yPosition, text)\n            .attr({\n                'text-anchor': 'start',\n                'font-size': '16px',\n            });\n\n        var id = x.toString() + '-' + yPosition.toString();\n        text.node.id = id;\n\n        this.selectElementAndDrawOutline(x, y);\n        // Initialize text editing for the text element\n        this.cvs.inlineTextEditing(text);\n        text.click(this.onTextClicked.bind(this, text));\n        //$(text).trigger(\"click\");\n        //text.click();\n\n        this.textEdits[id] = text;\n\n        var clone = $.extend({}, text);\n        this.undoStack.push(clone);\n    },\n\n    executeEditText: function(x, y, value) {\n        x = this.zoomConvert(x);\n        y = this.zoomConvert(y);\n        var id = x.toString() + '-' + y.toString();\n        if (id in this.textEdits) {\n            var t = this.textEdits[id];\n            t.inlineTextEditing.autoEditing(value);\n        }\n    },\n\n    addText: function() {\n        this.drawingItem = '';\n        this.addingText = true;\n    },\n\n    stopAddingText: function(drawingItem) {\n        this.appclicked({\n            addingText: true,\n            event: {\n                target: $('svg')[0]\n            },\n            cancelSelect: true\n        });\n        this.addingText = false;\n    },\n    deletePage: function() {\n        $('#js_textContainer').remove();\n        this.connection.deletePage();\n    },\n    cropContent: function() {\n        var content = this.cvs.toSVG();\n        var a = $(\"<a id='download-img'>\")\n            .attr(\"download\", \"img.png\")\n            .appendTo(\"body\");\n        var canvas_tag = $(\"<canvas id='my-canvas' style='display:none;'></canvas>\")\n            .appendTo(\"body\");\n\n        canvg(document.getElementById(\"my-canvas\"), content);\n        setTimeout(function() {\n            var dataURL = document.getElementById('my-canvas').toDataURL(\"image/png\");\n            $('#download-img').attr('href', dataURL);\n            a[0].click();\n            a.remove();\n            canvas_tag.remove();\n        }, 500);\n    },\n    /**\n     * 转换svg内容\n     * \n     */\n    convertSvgContent: function() {\n    \ttry {\n    \t\tvar content = $(\"#svggroup svg\").prop(\"outerHTML\");\n            if (content == null || content == \"\") { // 没有outerHTML属性\n            \t//// 用XMLSerializer做转化\n            \t// content = new XMLSerializer().serializeToString($(\"#svggroup svg\")[0]);\n            \t\n            \t// 新建div，将SVG元素复制后append进div，然后再取div的innerHTML\n            \tvar tmp = document.createElement(\"div\");\n            \ttmp.style.display = \"none\";\n            \ttmp.appendChild($(\"#svggroup svg\")[0].cloneNode(true));\n            \tcontent = tmp.innerHTML;\n            \ttmp = null;\n            \t\n            \t// 删除转化后生成的无用字段\n            \tcontent = content.replace('xmlns=\"http://www.w3.org/2000/svg\" xmlns:NS1=\"\" NS1:', '');\n    \t\t}\n            var canvas_tag = $(\"<canvas id='my-canvas' style='display:none;'></canvas>\")\n            canvg(canvas_tag[0], content);\n            var dataURL = canvas_tag[0].toDataURL(\"image/png\");\n            canvas_tag.remove();\n            return dataURL;\n    \t} catch (e) {\n    \t\tconsole.error(\"convertSvgContent error:\", e);\n    \t\treturn \"\";\n    \t}\n    },\n    isGuest: function() {\n        return this.parent_.isGuest();\n    }\n});"
  },
  {
    "path": "rtc/whiteboard/src/js/ewb/WhiteBoardApi.js",
    "content": "/*\n * WhiteBoardApi.js - Javascript API for White Borad\n *\n */\nfunction WhiteBoardApi() {\n    this.canvasHeight = -1;\n    this.canvasWidth = -1;\n    this.canvasNode = null;\n    this.cname = '';\n    this.uid = '';\n    this.vid = '';\n    this.role = ''\n    this.redis = '';\n    this.ticket = '';\n    this.expired = 1440;\n\n    this.defaultCanvasHeight = function() {\n        return this.canvasNode ? $(this.canvasNode).height() : 600;\n    }\n    this.defaultCanvasWidth = function() {\n        return this.canvasNode ? $(this.canvasNode).width() : 800;\n    }\n\n    this.join = function(params) {\n        var key = params.key,\n            cname = params.cname,\n            uinfo = params.uinfo,\n            role = params.role,\n            mode = params.mode,\n            expired = params.expired,\n            onJoin = params.onJoin;\n\n        this.cname = cname;\n        this.role = role || 'host';\n        if (expired !== undefined && expired !== null) {\n            this.expired = expired;\n        }\n        this.render();\n    }\n\n    this.render = function() {\n        if (!this.canvasNode) {\n            return;\n        }\n        this.app = new App();\n        this.app.setCanvasHeight(this.canvasHeight == -1 ? this.defaultCanvasHeight() : this.canvasHeight);\n        this.app.setCanvasWidth(this.canvasWidth == -1 ? this.defaultCanvasWidth() : this.canvasWidth);\n        this.app.setRoom(this.cname);\n        this.app.setUid(this.uid);\n        this.app.setVid(this.vid);\n        this.app.setRole(this.role);\n        this.app.setRedis(this.redis);\n        this.app.setTicket(this.ticket);\n        //this.app.setExpiredMinutes(this.expired);\n        this.app.expiredMinutes = this.expired;\n        this.app.renderInto(this.canvasNode);\n    }\n}"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/enyo-ilib/ilib/locale/ilibmanifest.json",
    "content": "{\"files\":[\"aa/DJ/unitfmt.json\",\"aa/ER/unitfmt.json\",\"aa/ET/unitfmt.json\",\"aa/dateformats.json\",\"aa/localeinfo.json\",\"aa/sysres.json\",\"aa/unitfmt.json\",\"ab/localeinfo.json\",\"abq/localeinfo.json\",\"ace/localeinfo.json\",\"ach/localeinfo.json\",\"ada/localeinfo.json\",\"address.json\",\"ady/localeinfo.json\",\"ae/localeinfo.json\",\"af/NA/localeinfo.json\",\"af/NA/unitfmt.json\",\"af/ZA/unitfmt.json\",\"af/ctrynames.json\",\"af/dateformats.json\",\"af/localeinfo.json\",\"af/plurals.json\",\"af/sysres.json\",\"af/unitfmt.json\",\"afa/localeinfo.json\",\"afh/localeinfo.json\",\"agq/CM/unitfmt.json\",\"agq/ctrynames.json\",\"agq/dateformats.json\",\"agq/localeinfo.json\",\"agq/sysres.json\",\"agq/unitfmt.json\",\"aii/localeinfo.json\",\"ain/localeinfo.json\",\"ak/GH/unitfmt.json\",\"ak/ctrynames.json\",\"ak/dateformats.json\",\"ak/localeinfo.json\",\"ak/plurals.json\",\"ak/sysres.json\",\"ak/unitfmt.json\",\"akk/localeinfo.json\",\"ale/localeinfo.json\",\"alg/localeinfo.json\",\"alt/localeinfo.json\",\"am/ET/unitfmt.json\",\"am/ctrynames.json\",\"am/dateformats.json\",\"am/localeinfo.json\",\"am/plurals.json\",\"am/sysres.json\",\"am/unitfmt.json\",\"amo/localeinfo.json\",\"an/localeinfo.json\",\"ang/localeinfo.json\",\"anp/localeinfo.json\",\"apa/localeinfo.json\",\"ar/001/unitfmt.json\",\"ar/AE/unitfmt.json\",\"ar/BH/unitfmt.json\",\"ar/DJ/unitfmt.json\",\"ar/DZ/dateformats.json\",\"ar/DZ/localeinfo.json\",\"ar/DZ/sysres.json\",\"ar/DZ/unitfmt.json\",\"ar/EG/unitfmt.json\",\"ar/EH/localeinfo.json\",\"ar/EH/unitfmt.json\",\"ar/ER/unitfmt.json\",\"ar/IL/unitfmt.json\",\"ar/IQ/sysres.json\",\"ar/IQ/unitfmt.json\",\"ar/JO/sysres.json\",\"ar/JO/unitfmt.json\",\"ar/KM/unitfmt.json\",\"ar/KW/unitfmt.json\",\"ar/LB/sysres.json\",\"ar/LB/unitfmt.json\",\"ar/LY/unitfmt.json\",\"ar/MA/dateformats.json\",\"ar/MA/localeinfo.json\",\"ar/MA/sysres.json\",\"ar/MA/unitfmt.json\",\"ar/MR/unitfmt.json\",\"ar/OM/unitfmt.json\",\"ar/PS/unitfmt.json\",\"ar/QA/unitfmt.json\",\"ar/SA/unitfmt.json\",\"ar/SD/unitfmt.json\",\"ar/SO/unitfmt.json\",\"ar/SS/unitfmt.json\",\"ar/SY/sysres.json\",\"ar/SY/unitfmt.json\",\"ar/TD/unitfmt.json\",\"ar/TN/dateformats.json\",\"ar/TN/localeinfo.json\",\"ar/TN/sysres.json\",\"ar/TN/unitfmt.json\",\"ar/YE/unitfmt.json\",\"ar/ctrynames.json\",\"ar/dateformats.json\",\"ar/localeinfo.json\",\"ar/name.json\",\"ar/plurals.json\",\"ar/sysres.json\",\"ar/unitfmt.json\",\"arc/localeinfo.json\",\"arn/localeinfo.json\",\"arp/localeinfo.json\",\"art/localeinfo.json\",\"arw/localeinfo.json\",\"as/IN/unitfmt.json\",\"as/ctrynames.json\",\"as/dateformats.json\",\"as/localeinfo.json\",\"as/sysres.json\",\"as/unitfmt.json\",\"asa/TZ/unitfmt.json\",\"asa/ctrynames.json\",\"asa/dateformats.json\",\"asa/localeinfo.json\",\"asa/plurals.json\",\"asa/sysres.json\",\"asa/unitfmt.json\",\"ast/ES/unitfmt.json\",\"ast/dateformats.json\",\"ast/localeinfo.json\",\"ast/plurals.json\",\"ast/sysres.json\",\"ast/unitfmt.json\",\"astro.json\",\"ath/localeinfo.json\",\"aus/localeinfo.json\",\"av/localeinfo.json\",\"awa/localeinfo.json\",\"ay/localeinfo.json\",\"az/Cyrl/AZ/ctrynames.json\",\"az/Cyrl/AZ/sysres.json\",\"az/Cyrl/unitfmt.json\",\"az/Cyrl-AZ/unitfmt.json\",\"az/Latn/unitfmt.json\",\"az/Latn-AZ/unitfmt.json\",\"az/ctrynames.json\",\"az/dateformats.json\",\"az/localeinfo.json\",\"az/sysres.json\",\"az/unitfmt.json\",\"ba/localeinfo.json\",\"bad/localeinfo.json\",\"bai/localeinfo.json\",\"bal/localeinfo.json\",\"ban/localeinfo.json\",\"bas/CM/unitfmt.json\",\"bas/ctrynames.json\",\"bas/dateformats.json\",\"bas/localeinfo.json\",\"bas/sysres.json\",\"bas/unitfmt.json\",\"bat/localeinfo.json\",\"bax/localeinfo.json\",\"bbc/localeinfo.json\",\"bbj/localeinfo.json\",\"be/BY/unitfmt.json\",\"be/ctrynames.json\",\"be/dateformats.json\",\"be/localeinfo.json\",\"be/plurals.json\",\"be/sysres.json\",\"be/unitfmt.json\",\"bej/localeinfo.json\",\"bem/ZM/unitfmt.json\",\"bem/dateformats.json\",\"bem/localeinfo.json\",\"bem/plurals.json\",\"bem/sysres.json\",\"bem/unitfmt.json\",\"ber/localeinfo.json\",\"bez/TZ/unitfmt.json\",\"bez/ctrynames.json\",\"bez/dateformats.json\",\"bez/localeinfo.json\",\"bez/plurals.json\",\"bez/sysres.json\",\"bez/unitfmt.json\",\"bfd/localeinfo.json\",\"bfq/localeinfo.json\",\"bft/localeinfo.json\",\"bfy/localeinfo.json\",\"bg/BG/unitfmt.json\",\"bg/ctrynames.json\",\"bg/dateformats.json\",\"bg/localeinfo.json\",\"bg/name.json\",\"bg/plurals.json\",\"bg/sysres.json\",\"bg/unitfmt.json\",\"bh/localeinfo.json\",\"bh/plurals.json\",\"bhb/localeinfo.json\",\"bho/localeinfo.json\",\"bi/localeinfo.json\",\"bik/localeinfo.json\",\"bin/localeinfo.json\",\"bjj/localeinfo.json\",\"bkm/localeinfo.json\",\"bku/localeinfo.json\",\"bla/localeinfo.json\",\"blt/localeinfo.json\",\"bm/Latn/unitfmt.json\",\"bm/Latn-ML/unitfmt.json\",\"bm/ctrynames.json\",\"bm/dateformats.json\",\"bm/localeinfo.json\",\"bm/sysres.json\",\"bm/unitfmt.json\",\"bn/BD/unitfmt.json\",\"bn/IN/unitfmt.json\",\"bn/ctrynames.json\",\"bn/dateformats.json\",\"bn/localeinfo.json\",\"bn/name.json\",\"bn/plurals.json\",\"bn/sysres.json\",\"bn/unitfmt.json\",\"bnt/localeinfo.json\",\"bo/CN/unitfmt.json\",\"bo/IN/unitfmt.json\",\"bo/ctrynames.json\",\"bo/dateformats.json\",\"bo/localeinfo.json\",\"bo/sysres.json\",\"bo/unitfmt.json\",\"bqv/localeinfo.json\",\"br/FR/unitfmt.json\",\"br/ctrynames.json\",\"br/dateformats.json\",\"br/localeinfo.json\",\"br/plurals.json\",\"br/sysres.json\",\"br/unitfmt.json\",\"bra/localeinfo.json\",\"brx/IN/unitfmt.json\",\"brx/ctrynames.json\",\"brx/dateformats.json\",\"brx/localeinfo.json\",\"brx/plurals.json\",\"brx/sysres.json\",\"brx/unitfmt.json\",\"bs/Cyrl/BA/ctrynames.json\",\"bs/Cyrl/BA/dateformats.json\",\"bs/Cyrl/BA/localeinfo.json\",\"bs/Cyrl/BA/sysres.json\",\"bs/Cyrl/unitfmt.json\",\"bs/Cyrl-BA/unitfmt.json\",\"bs/Latn/unitfmt.json\",\"bs/Latn-BA/unitfmt.json\",\"bs/ctrynames.json\",\"bs/dateformats.json\",\"bs/localeinfo.json\",\"bs/name.json\",\"bs/plurals.json\",\"bs/sysres.json\",\"bs/unitfmt.json\",\"bss/localeinfo.json\",\"btk/localeinfo.json\",\"btv/localeinfo.json\",\"bua/localeinfo.json\",\"buc/localeinfo.json\",\"bug/localeinfo.json\",\"bum/localeinfo.json\",\"bxr/localeinfo.json\",\"bya/localeinfo.json\",\"byn/dateformats.json\",\"byn/localeinfo.json\",\"byn/sysres.json\",\"byv/localeinfo.json\",\"ca/AD/unitfmt.json\",\"ca/ES/unitfmt.json\",\"ca/ES-VALENCIA/unitfmt.json\",\"ca/FR/unitfmt.json\",\"ca/IT/unitfmt.json\",\"ca/ctrynames.json\",\"ca/dateformats.json\",\"ca/localeinfo.json\",\"ca/plurals.json\",\"ca/sysres.json\",\"ca/unitfmt.json\",\"cad/localeinfo.json\",\"cai/localeinfo.json\",\"car/localeinfo.json\",\"cau/localeinfo.json\",\"cay/localeinfo.json\",\"cch/localeinfo.json\",\"ccp/localeinfo.json\",\"ce/localeinfo.json\",\"ceb/localeinfo.json\",\"cel/localeinfo.json\",\"cgg/UG/unitfmt.json\",\"cgg/ctrynames.json\",\"cgg/dateformats.json\",\"cgg/localeinfo.json\",\"cgg/plurals.json\",\"cgg/sysres.json\",\"cgg/unitfmt.json\",\"ch/localeinfo.json\",\"chb/localeinfo.json\",\"chg/localeinfo.json\",\"chk/localeinfo.json\",\"chm/localeinfo.json\",\"chn/localeinfo.json\",\"cho/localeinfo.json\",\"chp/localeinfo.json\",\"chr/US/unitfmt.json\",\"chr/ctrynames.json\",\"chr/dateformats.json\",\"chr/localeinfo.json\",\"chr/plurals.json\",\"chr/sysres.json\",\"chr/unitfmt.json\",\"chy/localeinfo.json\",\"cja/localeinfo.json\",\"cjm/localeinfo.json\",\"cjs/localeinfo.json\",\"ckb/localeinfo.json\",\"ckb/plurals.json\",\"ckt/localeinfo.json\",\"cmc/localeinfo.json\",\"co/localeinfo.json\",\"collation.json\",\"cop/localeinfo.json\",\"countries.json\",\"cpe/localeinfo.json\",\"cpf/localeinfo.json\",\"cpp/localeinfo.json\",\"cr/localeinfo.json\",\"crh/localeinfo.json\",\"crk/localeinfo.json\",\"crp/localeinfo.json\",\"cs/CZ/unitfmt.json\",\"cs/ctrynames.json\",\"cs/dateformats.json\",\"cs/localeinfo.json\",\"cs/name.json\",\"cs/plurals.json\",\"cs/sysres.json\",\"cs/unitfmt.json\",\"csb/localeinfo.json\",\"ctype.json\",\"ctype_c.json\",\"ctype_l.json\",\"ctype_m.json\",\"ctype_n.json\",\"ctype_p.json\",\"ctype_s.json\",\"ctype_z.json\",\"cu/localeinfo.json\",\"currency.json\",\"cus/localeinfo.json\",\"cv/localeinfo.json\",\"cwd/localeinfo.json\",\"cy/GB/unitfmt.json\",\"cy/ctrynames.json\",\"cy/dateformats.json\",\"cy/localeinfo.json\",\"cy/plurals.json\",\"cy/sysres.json\",\"cy/unitfmt.json\",\"da/DK/unitfmt.json\",\"da/GL/unitfmt.json\",\"da/ctrynames.json\",\"da/dateformats.json\",\"da/localeinfo.json\",\"da/name.json\",\"da/plurals.json\",\"da/sysres.json\",\"da/unitfmt.json\",\"dak/localeinfo.json\",\"dar/localeinfo.json\",\"dateformats.json\",\"dav/KE/unitfmt.json\",\"dav/ctrynames.json\",\"dav/dateformats.json\",\"dav/localeinfo.json\",\"dav/sysres.json\",\"dav/unitfmt.json\",\"day/localeinfo.json\",\"de/AT/localeinfo.json\",\"de/AT/sysres.json\",\"de/AT/unitfmt.json\",\"de/BE/unitfmt.json\",\"de/CH/ctrynames.json\",\"de/CH/localeinfo.json\",\"de/CH/unitfmt.json\",\"de/DE/unitfmt.json\",\"de/LI/localeinfo.json\",\"de/LI/unitfmt.json\",\"de/LU/unitfmt.json\",\"de/collation.json\",\"de/ctrynames.json\",\"de/dateformats.json\",\"de/localeinfo.json\",\"de/name.json\",\"de/phoneres.json\",\"de/plurals.json\",\"de/sysres.json\",\"de/unitfmt.json\",\"del/localeinfo.json\",\"den/localeinfo.json\",\"dgr/localeinfo.json\",\"din/localeinfo.json\",\"dje/NE/unitfmt.json\",\"dje/ctrynames.json\",\"dje/dateformats.json\",\"dje/localeinfo.json\",\"dje/sysres.json\",\"dje/unitfmt.json\",\"dng/localeinfo.json\",\"doi/localeinfo.json\",\"dra/localeinfo.json\",\"dsb/DE/unitfmt.json\",\"dsb/localeinfo.json\",\"dsb/unitfmt.json\",\"dua/CM/unitfmt.json\",\"dua/dateformats.json\",\"dua/localeinfo.json\",\"dua/sysres.json\",\"dua/unitfmt.json\",\"dum/localeinfo.json\",\"dv/localeinfo.json\",\"dv/plurals.json\",\"dyo/SN/unitfmt.json\",\"dyo/ctrynames.json\",\"dyo/dateformats.json\",\"dyo/localeinfo.json\",\"dyo/sysres.json\",\"dyo/unitfmt.json\",\"dyu/localeinfo.json\",\"dz/BT/unitfmt.json\",\"dz/ctrynames.json\",\"dz/dateformats.json\",\"dz/localeinfo.json\",\"dz/sysres.json\",\"dz/unitfmt.json\",\"dzg/localeinfo.json\",\"ebu/KE/unitfmt.json\",\"ebu/ctrynames.json\",\"ebu/dateformats.json\",\"ebu/localeinfo.json\",\"ebu/sysres.json\",\"ebu/unitfmt.json\",\"ee/GH/unitfmt.json\",\"ee/TG/unitfmt.json\",\"ee/ctrynames.json\",\"ee/dateformats.json\",\"ee/localeinfo.json\",\"ee/plurals.json\",\"ee/sysres.json\",\"ee/unitfmt.json\",\"efi/localeinfo.json\",\"egy/localeinfo.json\",\"eka/localeinfo.json\",\"eky/localeinfo.json\",\"el/CY/localeinfo.json\",\"el/CY/unitfmt.json\",\"el/GR/unitfmt.json\",\"el/ctrynames.json\",\"el/dateformats.json\",\"el/localeinfo.json\",\"el/name.json\",\"el/plurals.json\",\"el/sysres.json\",\"el/unitfmt.json\",\"elx/localeinfo.json\",\"emk/localeinfo.json\",\"en/001/unitfmt.json\",\"en/150/unitfmt.json\",\"en/AG/unitfmt.json\",\"en/AI/unitfmt.json\",\"en/AS/unitfmt.json\",\"en/AU/unitfmt.json\",\"en/BB/unitfmt.json\",\"en/BE/localeinfo.json\",\"en/BE/unitfmt.json\",\"en/BM/unitfmt.json\",\"en/BS/unitfmt.json\",\"en/BW/unitfmt.json\",\"en/BZ/unitfmt.json\",\"en/CA/dateformats.json\",\"en/CA/unitfmt.json\",\"en/CC/unitfmt.json\",\"en/CK/unitfmt.json\",\"en/CM/unitfmt.json\",\"en/CX/unitfmt.json\",\"en/DG/unitfmt.json\",\"en/DM/unitfmt.json\",\"en/Dsrt/US/ctrynames.json\",\"en/Dsrt/US/localeinfo.json\",\"en/ER/unitfmt.json\",\"en/FJ/unitfmt.json\",\"en/FK/unitfmt.json\",\"en/FM/unitfmt.json\",\"en/GB/localeinfo.json\",\"en/GB/unitfmt.json\",\"en/GD/unitfmt.json\",\"en/GG/localeinfo.json\",\"en/GG/unitfmt.json\",\"en/GH/unitfmt.json\",\"en/GI/localeinfo.json\",\"en/GI/unitfmt.json\",\"en/GM/unitfmt.json\",\"en/GU/unitfmt.json\",\"en/GY/unitfmt.json\",\"en/HK/unitfmt.json\",\"en/IE/localeinfo.json\",\"en/IE/sysres.json\",\"en/IE/unitfmt.json\",\"en/IM/localeinfo.json\",\"en/IM/unitfmt.json\",\"en/IN/localeinfo.json\",\"en/IN/unitfmt.json\",\"en/IO/unitfmt.json\",\"en/JE/localeinfo.json\",\"en/JE/unitfmt.json\",\"en/JM/unitfmt.json\",\"en/KE/unitfmt.json\",\"en/KI/unitfmt.json\",\"en/KN/unitfmt.json\",\"en/KY/unitfmt.json\",\"en/LC/unitfmt.json\",\"en/LR/unitfmt.json\",\"en/LS/unitfmt.json\",\"en/MG/unitfmt.json\",\"en/MH/unitfmt.json\",\"en/MO/unitfmt.json\",\"en/MP/unitfmt.json\",\"en/MS/unitfmt.json\",\"en/MT/localeinfo.json\",\"en/MT/unitfmt.json\",\"en/MU/unitfmt.json\",\"en/MW/unitfmt.json\",\"en/MY/unitfmt.json\",\"en/NA/unitfmt.json\",\"en/NF/unitfmt.json\",\"en/NG/unitfmt.json\",\"en/NR/unitfmt.json\",\"en/NU/unitfmt.json\",\"en/NZ/unitfmt.json\",\"en/PG/unitfmt.json\",\"en/PH/unitfmt.json\",\"en/PK/unitfmt.json\",\"en/PN/unitfmt.json\",\"en/PR/unitfmt.json\",\"en/PW/unitfmt.json\",\"en/RW/unitfmt.json\",\"en/SB/unitfmt.json\",\"en/SC/unitfmt.json\",\"en/SD/unitfmt.json\",\"en/SG/unitfmt.json\",\"en/SH/unitfmt.json\",\"en/SL/unitfmt.json\",\"en/SS/unitfmt.json\",\"en/SX/unitfmt.json\",\"en/SZ/unitfmt.json\",\"en/TC/unitfmt.json\",\"en/TK/unitfmt.json\",\"en/TO/unitfmt.json\",\"en/TT/unitfmt.json\",\"en/TV/unitfmt.json\",\"en/TZ/unitfmt.json\",\"en/UG/unitfmt.json\",\"en/UM/unitfmt.json\",\"en/US/dateformats.json\",\"en/US/sysres.json\",\"en/US/unitfmt.json\",\"en/US-POSIX/unitfmt.json\",\"en/VC/unitfmt.json\",\"en/VG/unitfmt.json\",\"en/VI/unitfmt.json\",\"en/VU/unitfmt.json\",\"en/WS/unitfmt.json\",\"en/ZA/dateformats.json\",\"en/ZA/localeinfo.json\",\"en/ZA/unitfmt.json\",\"en/ZM/unitfmt.json\",\"en/ZW/unitfmt.json\",\"en/ctrynames.json\",\"en/localeinfo.json\",\"en/name.json\",\"en/plurals.json\",\"en/unitfmt.json\",\"enm/localeinfo.json\",\"eo/001/unitfmt.json\",\"eo/ctrynames.json\",\"eo/dateformats.json\",\"eo/localeinfo.json\",\"eo/plurals.json\",\"eo/sysres.json\",\"eo/unitfmt.json\",\"es/419/unitfmt.json\",\"es/AR/dateformats.json\",\"es/AR/localeinfo.json\",\"es/AR/unitfmt.json\",\"es/BO/localeinfo.json\",\"es/BO/unitfmt.json\",\"es/CL/ctrynames.json\",\"es/CL/localeinfo.json\",\"es/CL/unitfmt.json\",\"es/CO/localeinfo.json\",\"es/CO/unitfmt.json\",\"es/CR/localeinfo.json\",\"es/CR/unitfmt.json\",\"es/CU/localeinfo.json\",\"es/CU/unitfmt.json\",\"es/DO/localeinfo.json\",\"es/DO/unitfmt.json\",\"es/EA/sysres.json\",\"es/EA/unitfmt.json\",\"es/EC/localeinfo.json\",\"es/EC/unitfmt.json\",\"es/ES/ctrynames.json\",\"es/ES/sysres.json\",\"es/ES/unitfmt.json\",\"es/GQ/localeinfo.json\",\"es/GQ/sysres.json\",\"es/GQ/unitfmt.json\",\"es/GT/localeinfo.json\",\"es/GT/unitfmt.json\",\"es/HN/localeinfo.json\",\"es/HN/unitfmt.json\",\"es/IC/sysres.json\",\"es/IC/unitfmt.json\",\"es/MX/localeinfo.json\",\"es/MX/unitfmt.json\",\"es/NI/localeinfo.json\",\"es/NI/unitfmt.json\",\"es/PA/localeinfo.json\",\"es/PA/unitfmt.json\",\"es/PE/localeinfo.json\",\"es/PE/unitfmt.json\",\"es/PH/dateformats.json\",\"es/PH/sysres.json\",\"es/PH/unitfmt.json\",\"es/PR/localeinfo.json\",\"es/PR/unitfmt.json\",\"es/PY/localeinfo.json\",\"es/PY/unitfmt.json\",\"es/SV/localeinfo.json\",\"es/SV/unitfmt.json\",\"es/US/dateformats.json\",\"es/US/localeinfo.json\",\"es/US/unitfmt.json\",\"es/UY/localeinfo.json\",\"es/UY/unitfmt.json\",\"es/VE/localeinfo.json\",\"es/VE/unitfmt.json\",\"es/collation.json\",\"es/ctrynames.json\",\"es/dateformats.json\",\"es/localeinfo.json\",\"es/name.json\",\"es/phoneres.json\",\"es/plurals.json\",\"es/sysres.json\",\"es/unitfmt.json\",\"et/EE/unitfmt.json\",\"et/collation.json\",\"et/ctrynames.json\",\"et/dateformats.json\",\"et/localeinfo.json\",\"et/name.json\",\"et/plurals.json\",\"et/sysres.json\",\"et/unitfmt.json\",\"ett/localeinfo.json\",\"eu/ES/pseudomap.json\",\"eu/ES/unitfmt.json\",\"eu/ctrynames.json\",\"eu/dateformats.json\",\"eu/localeinfo.json\",\"eu/plurals.json\",\"eu/sysres.json\",\"eu/unitfmt.json\",\"evn/localeinfo.json\",\"ewo/CM/unitfmt.json\",\"ewo/ctrynames.json\",\"ewo/dateformats.json\",\"ewo/localeinfo.json\",\"ewo/sysres.json\",\"ewo/unitfmt.json\",\"fa/AF/ctrynames.json\",\"fa/AF/sysres.json\",\"fa/AF/unitfmt.json\",\"fa/IR/unitfmt.json\",\"fa/ctrynames.json\",\"fa/dateformats.json\",\"fa/localeinfo.json\",\"fa/name.json\",\"fa/sysres.json\",\"fa/unitfmt.json\",\"fan/localeinfo.json\",\"fat/localeinfo.json\",\"ff/CM/unitfmt.json\",\"ff/GN/unitfmt.json\",\"ff/MR/unitfmt.json\",\"ff/SN/unitfmt.json\",\"ff/ctrynames.json\",\"ff/dateformats.json\",\"ff/localeinfo.json\",\"ff/plurals.json\",\"ff/sysres.json\",\"ff/unitfmt.json\",\"fi/FI/unitfmt.json\",\"fi/ctrynames.json\",\"fi/dateformats.json\",\"fi/localeinfo.json\",\"fi/name.json\",\"fi/plurals.json\",\"fi/sysres.json\",\"fi/unitfmt.json\",\"fil/PH/unitfmt.json\",\"fil/ctrynames.json\",\"fil/dateformats.json\",\"fil/localeinfo.json\",\"fil/plurals.json\",\"fil/sysres.json\",\"fil/unitfmt.json\",\"fiu/localeinfo.json\",\"fj/localeinfo.json\",\"fo/FO/unitfmt.json\",\"fo/ctrynames.json\",\"fo/dateformats.json\",\"fo/localeinfo.json\",\"fo/plurals.json\",\"fo/sysres.json\",\"fo/unitfmt.json\",\"fon/localeinfo.json\",\"fr/BE/localeinfo.json\",\"fr/BE/unitfmt.json\",\"fr/BF/unitfmt.json\",\"fr/BI/unitfmt.json\",\"fr/BJ/unitfmt.json\",\"fr/BL/unitfmt.json\",\"fr/CA/ctrynames.json\",\"fr/CA/localeinfo.json\",\"fr/CA/phoneres.json\",\"fr/CA/unitfmt.json\",\"fr/CD/unitfmt.json\",\"fr/CF/unitfmt.json\",\"fr/CG/unitfmt.json\",\"fr/CH/localeinfo.json\",\"fr/CH/unitfmt.json\",\"fr/CI/unitfmt.json\",\"fr/CM/unitfmt.json\",\"fr/DJ/unitfmt.json\",\"fr/DZ/unitfmt.json\",\"fr/FR/unitfmt.json\",\"fr/GA/unitfmt.json\",\"fr/GF/unitfmt.json\",\"fr/GN/unitfmt.json\",\"fr/GP/unitfmt.json\",\"fr/GQ/unitfmt.json\",\"fr/HT/unitfmt.json\",\"fr/KM/unitfmt.json\",\"fr/LU/localeinfo.json\",\"fr/LU/unitfmt.json\",\"fr/MA/unitfmt.json\",\"fr/MC/unitfmt.json\",\"fr/MF/unitfmt.json\",\"fr/MG/unitfmt.json\",\"fr/ML/unitfmt.json\",\"fr/MQ/unitfmt.json\",\"fr/MR/unitfmt.json\",\"fr/MU/unitfmt.json\",\"fr/NC/unitfmt.json\",\"fr/NE/unitfmt.json\",\"fr/PF/unitfmt.json\",\"fr/PM/unitfmt.json\",\"fr/RE/unitfmt.json\",\"fr/RW/unitfmt.json\",\"fr/SC/unitfmt.json\",\"fr/SN/unitfmt.json\",\"fr/SY/unitfmt.json\",\"fr/TD/unitfmt.json\",\"fr/TG/unitfmt.json\",\"fr/TN/unitfmt.json\",\"fr/VU/unitfmt.json\",\"fr/WF/unitfmt.json\",\"fr/YT/unitfmt.json\",\"fr/ctrynames.json\",\"fr/dateformats.json\",\"fr/localeinfo.json\",\"fr/name.json\",\"fr/phoneres.json\",\"fr/plurals.json\",\"fr/sysres.json\",\"fr/unitfmt.json\",\"frm/localeinfo.json\",\"fro/localeinfo.json\",\"frr/localeinfo.json\",\"frs/localeinfo.json\",\"fur/IT/unitfmt.json\",\"fur/dateformats.json\",\"fur/localeinfo.json\",\"fur/plurals.json\",\"fur/sysres.json\",\"fur/unitfmt.json\",\"fy/NL/unitfmt.json\",\"fy/localeinfo.json\",\"fy/plurals.json\",\"fy/unitfmt.json\",\"ga/IE/unitfmt.json\",\"ga/ctrynames.json\",\"ga/dateformats.json\",\"ga/localeinfo.json\",\"ga/name.json\",\"ga/plurals.json\",\"ga/sysres.json\",\"ga/unitfmt.json\",\"gaa/localeinfo.json\",\"gag/localeinfo.json\",\"gay/localeinfo.json\",\"gba/localeinfo.json\",\"gbm/localeinfo.json\",\"gcr/localeinfo.json\",\"gd/GB/unitfmt.json\",\"gd/dateformats.json\",\"gd/localeinfo.json\",\"gd/plurals.json\",\"gd/sysres.json\",\"gd/unitfmt.json\",\"gem/localeinfo.json\",\"gez/localeinfo.json\",\"gil/localeinfo.json\",\"gl/ES/unitfmt.json\",\"gl/ctrynames.json\",\"gl/dateformats.json\",\"gl/localeinfo.json\",\"gl/plurals.json\",\"gl/sysres.json\",\"gl/unitfmt.json\",\"gld/localeinfo.json\",\"gmh/localeinfo.json\",\"gn/localeinfo.json\",\"goh/localeinfo.json\",\"gon/localeinfo.json\",\"gor/localeinfo.json\",\"got/localeinfo.json\",\"grb/localeinfo.json\",\"grc/localeinfo.json\",\"grt/localeinfo.json\",\"gsw/CH/unitfmt.json\",\"gsw/FR/unitfmt.json\",\"gsw/LI/unitfmt.json\",\"gsw/ctrynames.json\",\"gsw/dateformats.json\",\"gsw/localeinfo.json\",\"gsw/plurals.json\",\"gsw/sysres.json\",\"gsw/unitfmt.json\",\"gu/IN/unitfmt.json\",\"gu/ctrynames.json\",\"gu/dateformats.json\",\"gu/localeinfo.json\",\"gu/name.json\",\"gu/plurals.json\",\"gu/sysres.json\",\"gu/unitfmt.json\",\"guz/KE/unitfmt.json\",\"guz/ctrynames.json\",\"guz/dateformats.json\",\"guz/localeinfo.json\",\"guz/sysres.json\",\"guz/unitfmt.json\",\"gv/IM/unitfmt.json\",\"gv/dateformats.json\",\"gv/localeinfo.json\",\"gv/plurals.json\",\"gv/sysres.json\",\"gv/unitfmt.json\",\"gwi/localeinfo.json\",\"ha/Latn/unitfmt.json\",\"ha/Latn-GH/unitfmt.json\",\"ha/Latn-NE/unitfmt.json\",\"ha/Latn-NG/unitfmt.json\",\"ha/ctrynames.json\",\"ha/dateformats.json\",\"ha/localeinfo.json\",\"ha/plurals.json\",\"ha/sysres.json\",\"ha/unitfmt.json\",\"hai/localeinfo.json\",\"haw/US/unitfmt.json\",\"haw/ctrynames.json\",\"haw/dateformats.json\",\"haw/localeinfo.json\",\"haw/plurals.json\",\"haw/sysres.json\",\"haw/unitfmt.json\",\"he/IL/unitfmt.json\",\"he/ctrynames.json\",\"he/dateformats.json\",\"he/localeinfo.json\",\"he/name.json\",\"he/plurals.json\",\"he/sysres.json\",\"he/unitfmt.json\",\"hi/IN/unitfmt.json\",\"hi/ctrynames.json\",\"hi/dateformats.json\",\"hi/localeinfo.json\",\"hi/name.json\",\"hi/plurals.json\",\"hi/sysres.json\",\"hi/unitfmt.json\",\"hil/localeinfo.json\",\"him/localeinfo.json\",\"hit/localeinfo.json\",\"hmn/localeinfo.json\",\"hne/localeinfo.json\",\"hnn/localeinfo.json\",\"ho/localeinfo.json\",\"hoc/localeinfo.json\",\"hoj/localeinfo.json\",\"hop/localeinfo.json\",\"hr/BA/unitfmt.json\",\"hr/HR/unitfmt.json\",\"hr/ctrynames.json\",\"hr/dateformats.json\",\"hr/localeinfo.json\",\"hr/name.json\",\"hr/plurals.json\",\"hr/sysres.json\",\"hr/unitfmt.json\",\"hsb/DE/unitfmt.json\",\"hsb/localeinfo.json\",\"hsb/unitfmt.json\",\"ht/localeinfo.json\",\"hu/HU/unitfmt.json\",\"hu/ctrynames.json\",\"hu/dateformats.json\",\"hu/localeinfo.json\",\"hu/name.json\",\"hu/sysres.json\",\"hu/unitfmt.json\",\"hup/localeinfo.json\",\"hy/AM/unitfmt.json\",\"hy/ctrynames.json\",\"hy/dateformats.json\",\"hy/localeinfo.json\",\"hy/sysres.json\",\"hy/unitfmt.json\",\"hz/localeinfo.json\",\"ia/FR/unitfmt.json\",\"ia/dateformats.json\",\"ia/localeinfo.json\",\"ia/sysres.json\",\"ia/unitfmt.json\",\"iba/localeinfo.json\",\"ibb/localeinfo.json\",\"id/ID/unitfmt.json\",\"id/ctrynames.json\",\"id/dateformats.json\",\"id/localeinfo.json\",\"id/name.json\",\"id/sysres.json\",\"id/unitfmt.json\",\"idd.json\",\"iddarea.json\",\"ie/localeinfo.json\",\"ig/NG/unitfmt.json\",\"ig/ctrynames.json\",\"ig/dateformats.json\",\"ig/localeinfo.json\",\"ig/sysres.json\",\"ig/unitfmt.json\",\"ii/CN/unitfmt.json\",\"ii/ctrynames.json\",\"ii/dateformats.json\",\"ii/localeinfo.json\",\"ii/sysres.json\",\"ii/unitfmt.json\",\"ijo/localeinfo.json\",\"ik/localeinfo.json\",\"ilo/localeinfo.json\",\"in/localeinfo.json\",\"inc/localeinfo.json\",\"ine/localeinfo.json\",\"inh/localeinfo.json\",\"io/localeinfo.json\",\"ira/localeinfo.json\",\"iro/localeinfo.json\",\"is/IS/unitfmt.json\",\"is/ctrynames.json\",\"is/dateformats.json\",\"is/localeinfo.json\",\"is/plurals.json\",\"is/sysres.json\",\"is/unitfmt.json\",\"it/CH/localeinfo.json\",\"it/CH/unitfmt.json\",\"it/IT/unitfmt.json\",\"it/SM/unitfmt.json\",\"it/ctrynames.json\",\"it/dateformats.json\",\"it/localeinfo.json\",\"it/name.json\",\"it/phoneres.json\",\"it/plurals.json\",\"it/sysres.json\",\"it/unitfmt.json\",\"iu/localeinfo.json\",\"iu/plurals.json\",\"iw/localeinfo.json\",\"ja/JP/unitfmt.json\",\"ja/ctrynames.json\",\"ja/dateformats.json\",\"ja/localeinfo.json\",\"ja/name.json\",\"ja/sysres.json\",\"ja/unitfmt.json\",\"jbo/localeinfo.json\",\"jgo/CM/unitfmt.json\",\"jgo/ctrynames.json\",\"jgo/dateformats.json\",\"jgo/localeinfo.json\",\"jgo/plurals.json\",\"jgo/sysres.json\",\"jgo/unitfmt.json\",\"ji/localeinfo.json\",\"jmc/TZ/unitfmt.json\",\"jmc/ctrynames.json\",\"jmc/dateformats.json\",\"jmc/localeinfo.json\",\"jmc/plurals.json\",\"jmc/sysres.json\",\"jmc/unitfmt.json\",\"jpr/localeinfo.json\",\"jrb/localeinfo.json\",\"jv/localeinfo.json\",\"jw/localeinfo.json\",\"ka/GE/unitfmt.json\",\"ka/ctrynames.json\",\"ka/dateformats.json\",\"ka/localeinfo.json\",\"ka/sysres.json\",\"ka/unitfmt.json\",\"kaa/localeinfo.json\",\"kab/DZ/unitfmt.json\",\"kab/ctrynames.json\",\"kab/dateformats.json\",\"kab/localeinfo.json\",\"kab/plurals.json\",\"kab/sysres.json\",\"kab/unitfmt.json\",\"kac/localeinfo.json\",\"kaj/localeinfo.json\",\"kaj/plurals.json\",\"kam/KE/unitfmt.json\",\"kam/ctrynames.json\",\"kam/dateformats.json\",\"kam/localeinfo.json\",\"kam/sysres.json\",\"kam/unitfmt.json\",\"kar/localeinfo.json\",\"kaw/localeinfo.json\",\"kbd/localeinfo.json\",\"kbl/localeinfo.json\",\"kca/localeinfo.json\",\"kcg/localeinfo.json\",\"kcg/plurals.json\",\"kde/TZ/unitfmt.json\",\"kde/ctrynames.json\",\"kde/dateformats.json\",\"kde/localeinfo.json\",\"kde/sysres.json\",\"kde/unitfmt.json\",\"kdt/localeinfo.json\",\"kea/CV/unitfmt.json\",\"kea/ctrynames.json\",\"kea/dateformats.json\",\"kea/localeinfo.json\",\"kea/sysres.json\",\"kea/unitfmt.json\",\"ken/localeinfo.json\",\"kfo/localeinfo.json\",\"kfr/localeinfo.json\",\"kg/localeinfo.json\",\"kha/localeinfo.json\",\"khb/localeinfo.json\",\"khi/localeinfo.json\",\"kho/localeinfo.json\",\"khq/ML/unitfmt.json\",\"khq/ctrynames.json\",\"khq/dateformats.json\",\"khq/localeinfo.json\",\"khq/sysres.json\",\"khq/unitfmt.json\",\"kht/localeinfo.json\",\"ki/KE/unitfmt.json\",\"ki/ctrynames.json\",\"ki/dateformats.json\",\"ki/localeinfo.json\",\"ki/sysres.json\",\"ki/unitfmt.json\",\"kj/localeinfo.json\",\"kjh/localeinfo.json\",\"kk/Cyrl/unitfmt.json\",\"kk/Cyrl-KZ/unitfmt.json\",\"kk/ctrynames.json\",\"kk/dateformats.json\",\"kk/localeinfo.json\",\"kk/name.json\",\"kk/plurals.json\",\"kk/sysres.json\",\"kk/unitfmt.json\",\"kkj/CM/unitfmt.json\",\"kkj/dateformats.json\",\"kkj/localeinfo.json\",\"kkj/plurals.json\",\"kkj/sysres.json\",\"kkj/unitfmt.json\",\"kl/GL/unitfmt.json\",\"kl/dateformats.json\",\"kl/localeinfo.json\",\"kl/plurals.json\",\"kl/sysres.json\",\"kl/unitfmt.json\",\"kln/KE/unitfmt.json\",\"kln/ctrynames.json\",\"kln/dateformats.json\",\"kln/localeinfo.json\",\"kln/sysres.json\",\"kln/unitfmt.json\",\"km/KH/unitfmt.json\",\"km/ctrynames.json\",\"km/dateformats.json\",\"km/localeinfo.json\",\"km/sysres.json\",\"km/unitfmt.json\",\"kmb/localeinfo.json\",\"kmr/localeinfo.json\",\"kn/IN/unitfmt.json\",\"kn/ctrynames.json\",\"kn/dateformats.json\",\"kn/localeinfo.json\",\"kn/name.json\",\"kn/sysres.json\",\"kn/unitfmt.json\",\"ko/KP/unitfmt.json\",\"ko/KR/unitfmt.json\",\"ko/ctrynames.json\",\"ko/dateformats.json\",\"ko/localeinfo.json\",\"ko/name.json\",\"ko/phoneres.json\",\"ko/sysres.json\",\"ko/unitfmt.json\",\"koi/localeinfo.json\",\"kok/IN/unitfmt.json\",\"kok/dateformats.json\",\"kok/localeinfo.json\",\"kok/sysres.json\",\"kok/unitfmt.json\",\"kos/localeinfo.json\",\"kpe/localeinfo.json\",\"kpv/localeinfo.json\",\"kpy/localeinfo.json\",\"kr/localeinfo.json\",\"krc/localeinfo.json\",\"kri/localeinfo.json\",\"krl/localeinfo.json\",\"kro/localeinfo.json\",\"kru/localeinfo.json\",\"ks/Arab/unitfmt.json\",\"ks/Arab-IN/unitfmt.json\",\"ks/ctrynames.json\",\"ks/dateformats.json\",\"ks/localeinfo.json\",\"ks/plurals.json\",\"ks/sysres.json\",\"ks/unitfmt.json\",\"ksb/TZ/unitfmt.json\",\"ksb/ctrynames.json\",\"ksb/dateformats.json\",\"ksb/localeinfo.json\",\"ksb/plurals.json\",\"ksb/sysres.json\",\"ksb/unitfmt.json\",\"ksf/CM/unitfmt.json\",\"ksf/ctrynames.json\",\"ksf/dateformats.json\",\"ksf/localeinfo.json\",\"ksf/sysres.json\",\"ksf/unitfmt.json\",\"ksh/DE/unitfmt.json\",\"ksh/dateformats.json\",\"ksh/localeinfo.json\",\"ksh/plurals.json\",\"ksh/sysres.json\",\"ksh/unitfmt.json\",\"ku/Latn/sysres.json\",\"ku/ctrynames.json\",\"ku/dateformats.json\",\"ku/localeinfo.json\",\"ku/name.json\",\"ku/plurals.json\",\"ku/sysres.json\",\"kum/localeinfo.json\",\"kut/localeinfo.json\",\"kv/localeinfo.json\",\"kw/GB/unitfmt.json\",\"kw/dateformats.json\",\"kw/localeinfo.json\",\"kw/plurals.json\",\"kw/sysres.json\",\"kw/unitfmt.json\",\"ky/Cyrl/unitfmt.json\",\"ky/Cyrl-KG/unitfmt.json\",\"ky/dateformats.json\",\"ky/localeinfo.json\",\"ky/plurals.json\",\"ky/sysres.json\",\"ky/unitfmt.json\",\"kyu/localeinfo.json\",\"la/localeinfo.json\",\"lab/localeinfo.json\",\"lad/localeinfo.json\",\"lag/TZ/unitfmt.json\",\"lag/ctrynames.json\",\"lag/dateformats.json\",\"lag/localeinfo.json\",\"lag/plurals.json\",\"lag/sysres.json\",\"lag/unitfmt.json\",\"lah/localeinfo.json\",\"lam/localeinfo.json\",\"lb/LU/unitfmt.json\",\"lb/localeinfo.json\",\"lb/plurals.json\",\"lb/unitfmt.json\",\"lbe/localeinfo.json\",\"lcp/localeinfo.json\",\"lep/localeinfo.json\",\"lez/localeinfo.json\",\"lg/UG/unitfmt.json\",\"lg/ctrynames.json\",\"lg/dateformats.json\",\"lg/localeinfo.json\",\"lg/plurals.json\",\"lg/sysres.json\",\"lg/unitfmt.json\",\"li/localeinfo.json\",\"lif/localeinfo.json\",\"likelylocales.json\",\"lis/localeinfo.json\",\"lki/localeinfo.json\",\"lkt/US/unitfmt.json\",\"lkt/unitfmt.json\",\"lmn/localeinfo.json\",\"ln/AO/unitfmt.json\",\"ln/CD/unitfmt.json\",\"ln/CF/unitfmt.json\",\"ln/CG/unitfmt.json\",\"ln/ctrynames.json\",\"ln/dateformats.json\",\"ln/localeinfo.json\",\"ln/plurals.json\",\"ln/sysres.json\",\"ln/unitfmt.json\",\"lo/LA/unitfmt.json\",\"lo/ctrynames.json\",\"lo/dateformats.json\",\"lo/localeinfo.json\",\"lo/sysres.json\",\"lo/unitfmt.json\",\"localeinfo.json\",\"lol/localeinfo.json\",\"loz/localeinfo.json\",\"lt/LT/unitfmt.json\",\"lt/collation.json\",\"lt/ctrynames.json\",\"lt/dateformats.json\",\"lt/localeinfo.json\",\"lt/name.json\",\"lt/plurals.json\",\"lt/sysres.json\",\"lt/unitfmt.json\",\"lu/CD/unitfmt.json\",\"lu/ctrynames.json\",\"lu/dateformats.json\",\"lu/localeinfo.json\",\"lu/sysres.json\",\"lu/unitfmt.json\",\"lua/localeinfo.json\",\"lui/localeinfo.json\",\"lun/localeinfo.json\",\"luo/KE/unitfmt.json\",\"luo/ctrynames.json\",\"luo/dateformats.json\",\"luo/localeinfo.json\",\"luo/sysres.json\",\"luo/unitfmt.json\",\"lus/localeinfo.json\",\"lut/localeinfo.json\",\"luy/KE/unitfmt.json\",\"luy/ctrynames.json\",\"luy/dateformats.json\",\"luy/localeinfo.json\",\"luy/sysres.json\",\"luy/unitfmt.json\",\"lv/LV/unitfmt.json\",\"lv/collation.json\",\"lv/ctrynames.json\",\"lv/dateformats.json\",\"lv/localeinfo.json\",\"lv/name.json\",\"lv/plurals.json\",\"lv/sysres.json\",\"lv/unitfmt.json\",\"lwl/localeinfo.json\",\"mad/localeinfo.json\",\"maf/localeinfo.json\",\"mag/localeinfo.json\",\"mai/localeinfo.json\",\"mak/localeinfo.json\",\"man/localeinfo.json\",\"map/localeinfo.json\",\"mas/KE/unitfmt.json\",\"mas/TZ/unitfmt.json\",\"mas/ctrynames.json\",\"mas/dateformats.json\",\"mas/localeinfo.json\",\"mas/plurals.json\",\"mas/sysres.json\",\"mas/unitfmt.json\",\"mde/localeinfo.json\",\"mdf/localeinfo.json\",\"mdh/localeinfo.json\",\"mdr/localeinfo.json\",\"men/localeinfo.json\",\"mer/KE/unitfmt.json\",\"mer/ctrynames.json\",\"mer/dateformats.json\",\"mer/localeinfo.json\",\"mer/sysres.json\",\"mer/unitfmt.json\",\"mfe/MU/unitfmt.json\",\"mfe/ctrynames.json\",\"mfe/dateformats.json\",\"mfe/localeinfo.json\",\"mfe/sysres.json\",\"mfe/unitfmt.json\",\"mg/MG/unitfmt.json\",\"mg/ctrynames.json\",\"mg/dateformats.json\",\"mg/localeinfo.json\",\"mg/plurals.json\",\"mg/sysres.json\",\"mg/unitfmt.json\",\"mga/localeinfo.json\",\"mgh/MZ/unitfmt.json\",\"mgh/ctrynames.json\",\"mgh/dateformats.json\",\"mgh/localeinfo.json\",\"mgh/sysres.json\",\"mgh/unitfmt.json\",\"mgo/CM/unitfmt.json\",\"mgo/ctrynames.json\",\"mgo/dateformats.json\",\"mgo/localeinfo.json\",\"mgo/plurals.json\",\"mgo/sysres.json\",\"mgo/unitfmt.json\",\"mh/localeinfo.json\",\"mi/localeinfo.json\",\"mic/localeinfo.json\",\"min/localeinfo.json\",\"mis/localeinfo.json\",\"mk/MK/unitfmt.json\",\"mk/ctrynames.json\",\"mk/dateformats.json\",\"mk/localeinfo.json\",\"mk/name.json\",\"mk/plurals.json\",\"mk/sysres.json\",\"mk/unitfmt.json\",\"mkh/localeinfo.json\",\"ml/IN/unitfmt.json\",\"ml/ctrynames.json\",\"ml/dateformats.json\",\"ml/localeinfo.json\",\"ml/name.json\",\"ml/plurals.json\",\"ml/sysres.json\",\"ml/unitfmt.json\",\"mn/Cyrl/unitfmt.json\",\"mn/Cyrl-MN/unitfmt.json\",\"mn/ctrynames.json\",\"mn/dateformats.json\",\"mn/localeinfo.json\",\"mn/name.json\",\"mn/plurals.json\",\"mn/sysres.json\",\"mn/unitfmt.json\",\"mnc/localeinfo.json\",\"mnc.json\",\"mni/localeinfo.json\",\"mno/localeinfo.json\",\"mns/localeinfo.json\",\"mnw/localeinfo.json\",\"mo/localeinfo.json\",\"mo/plurals.json\",\"moh/localeinfo.json\",\"mos/localeinfo.json\",\"mr/IN/unitfmt.json\",\"mr/ctrynames.json\",\"mr/dateformats.json\",\"mr/localeinfo.json\",\"mr/name.json\",\"mr/plurals.json\",\"mr/sysres.json\",\"mr/unitfmt.json\",\"ms/BN/dateformats.json\",\"ms/BN/localeinfo.json\",\"ms/Latn/unitfmt.json\",\"ms/Latn-BN/unitfmt.json\",\"ms/Latn-MY/unitfmt.json\",\"ms/Latn-SG/unitfmt.json\",\"ms/ctrynames.json\",\"ms/dateformats.json\",\"ms/localeinfo.json\",\"ms/name.json\",\"ms/sysres.json\",\"ms/unitfmt.json\",\"mt/MT/unitfmt.json\",\"mt/ctrynames.json\",\"mt/dateformats.json\",\"mt/localeinfo.json\",\"mt/plurals.json\",\"mt/sysres.json\",\"mt/unitfmt.json\",\"mua/CM/unitfmt.json\",\"mua/ctrynames.json\",\"mua/dateformats.json\",\"mua/localeinfo.json\",\"mua/sysres.json\",\"mua/unitfmt.json\",\"mul/localeinfo.json\",\"mun/localeinfo.json\",\"mus/localeinfo.json\",\"mwl/localeinfo.json\",\"mwr/localeinfo.json\",\"my/MM/unitfmt.json\",\"my/ctrynames.json\",\"my/dateformats.json\",\"my/localeinfo.json\",\"my/sysres.json\",\"my/unitfmt.json\",\"mye/localeinfo.json\",\"myn/localeinfo.json\",\"myv/localeinfo.json\",\"myz/localeinfo.json\",\"na/localeinfo.json\",\"nah/localeinfo.json\",\"nah/plurals.json\",\"nai/localeinfo.json\",\"name.json\",\"nap/localeinfo.json\",\"naq/NA/unitfmt.json\",\"naq/ctrynames.json\",\"naq/dateformats.json\",\"naq/localeinfo.json\",\"naq/plurals.json\",\"naq/sysres.json\",\"naq/unitfmt.json\",\"nativecountries.json\",\"nb/NO/unitfmt.json\",\"nb/SJ/unitfmt.json\",\"nb/ctrynames.json\",\"nb/dateformats.json\",\"nb/localeinfo.json\",\"nb/name.json\",\"nb/plurals.json\",\"nb/sysres.json\",\"nb/unitfmt.json\",\"nbf/localeinfo.json\",\"nd/ZW/unitfmt.json\",\"nd/ctrynames.json\",\"nd/dateformats.json\",\"nd/localeinfo.json\",\"nd/plurals.json\",\"nd/sysres.json\",\"nd/unitfmt.json\",\"nds/localeinfo.json\",\"ne/IN/sysres.json\",\"ne/IN/unitfmt.json\",\"ne/NP/unitfmt.json\",\"ne/ctrynames.json\",\"ne/dateformats.json\",\"ne/localeinfo.json\",\"ne/plurals.json\",\"ne/sysres.json\",\"ne/unitfmt.json\",\"new/localeinfo.json\",\"nfd/Arab.json\",\"nfd/Bali.json\",\"nfd/Beng.json\",\"nfd/Cakm.json\",\"nfd/Cyrl.json\",\"nfd/Deva.json\",\"nfd/Grek.json\",\"nfd/Guru.json\",\"nfd/Hani.json\",\"nfd/Hebr.json\",\"nfd/Hira.json\",\"nfd/Kana.json\",\"nfd/Knda.json\",\"nfd/Kthi.json\",\"nfd/Latn.json\",\"nfd/Mlym.json\",\"nfd/Mymr.json\",\"nfd/Orya.json\",\"nfd/Sinh.json\",\"nfd/Taml.json\",\"nfd/Telu.json\",\"nfd/Tibt.json\",\"nfd/Zinh.json\",\"nfd/Zyyy.json\",\"nfd/all.json\",\"nfkd/Arab.json\",\"nfkd/Armn.json\",\"nfkd/Cyrl.json\",\"nfkd/Geok.json\",\"nfkd/Grek.json\",\"nfkd/Hang.json\",\"nfkd/Hani.json\",\"nfkd/Hebr.json\",\"nfkd/Hira.json\",\"nfkd/Kana.json\",\"nfkd/Laoo.json\",\"nfkd/Latn.json\",\"nfkd/Tfng.json\",\"nfkd/Thai.json\",\"nfkd/Tibt.json\",\"nfkd/Zyyy.json\",\"nfkd/all.json\",\"ng/localeinfo.json\",\"nia/localeinfo.json\",\"nic/localeinfo.json\",\"niu/localeinfo.json\",\"nl/AW/unitfmt.json\",\"nl/BE/localeinfo.json\",\"nl/BE/unitfmt.json\",\"nl/BQ/unitfmt.json\",\"nl/CW/unitfmt.json\",\"nl/NL/unitfmt.json\",\"nl/SR/unitfmt.json\",\"nl/SX/unitfmt.json\",\"nl/ctrynames.json\",\"nl/dateformats.json\",\"nl/localeinfo.json\",\"nl/name.json\",\"nl/phoneres.json\",\"nl/plurals.json\",\"nl/sysres.json\",\"nl/unitfmt.json\",\"nmg/CM/unitfmt.json\",\"nmg/ctrynames.json\",\"nmg/dateformats.json\",\"nmg/localeinfo.json\",\"nmg/sysres.json\",\"nmg/unitfmt.json\",\"nn/NO/unitfmt.json\",\"nn/ctrynames.json\",\"nn/dateformats.json\",\"nn/localeinfo.json\",\"nn/plurals.json\",\"nn/sysres.json\",\"nn/unitfmt.json\",\"nnh/CM/unitfmt.json\",\"nnh/dateformats.json\",\"nnh/localeinfo.json\",\"nnh/plurals.json\",\"nnh/sysres.json\",\"nnh/unitfmt.json\",\"no/dateformats.json\",\"no/localeinfo.json\",\"no/plurals.json\",\"no/sysres.json\",\"nod/localeinfo.json\",\"nog/localeinfo.json\",\"non/localeinfo.json\",\"norm.json\",\"nqo/localeinfo.json\",\"nr/ZA/unitfmt.json\",\"nr/dateformats.json\",\"nr/localeinfo.json\",\"nr/plurals.json\",\"nr/sysres.json\",\"nr/unitfmt.json\",\"nso/ZA/unitfmt.json\",\"nso/dateformats.json\",\"nso/localeinfo.json\",\"nso/plurals.json\",\"nso/sysres.json\",\"nso/unitfmt.json\",\"nub/localeinfo.json\",\"numplan.json\",\"nus/SD/unitfmt.json\",\"nus/ctrynames.json\",\"nus/dateformats.json\",\"nus/localeinfo.json\",\"nus/sysres.json\",\"nus/unitfmt.json\",\"nv/localeinfo.json\",\"nwc/localeinfo.json\",\"ny/localeinfo.json\",\"ny/plurals.json\",\"nym/localeinfo.json\",\"nyn/UG/unitfmt.json\",\"nyn/ctrynames.json\",\"nyn/dateformats.json\",\"nyn/localeinfo.json\",\"nyn/plurals.json\",\"nyn/sysres.json\",\"nyn/unitfmt.json\",\"nyo/localeinfo.json\",\"nzi/localeinfo.json\",\"oc/localeinfo.json\",\"oj/localeinfo.json\",\"om/ET/unitfmt.json\",\"om/KE/unitfmt.json\",\"om/ctrynames.json\",\"om/dateformats.json\",\"om/localeinfo.json\",\"om/plurals.json\",\"om/sysres.json\",\"om/unitfmt.json\",\"or/IN/unitfmt.json\",\"or/ctrynames.json\",\"or/dateformats.json\",\"or/localeinfo.json\",\"or/plurals.json\",\"or/sysres.json\",\"or/unitfmt.json\",\"os/GE/unitfmt.json\",\"os/RU/unitfmt.json\",\"os/dateformats.json\",\"os/localeinfo.json\",\"os/plurals.json\",\"os/sysres.json\",\"os/unitfmt.json\",\"osa/localeinfo.json\",\"osc/localeinfo.json\",\"ota/localeinfo.json\",\"otk/localeinfo.json\",\"oto/localeinfo.json\",\"pa/Arab/PK/ctrynames.json\",\"pa/Arab/PK/localeinfo.json\",\"pa/Arab/PK/sysres.json\",\"pa/Arab/unitfmt.json\",\"pa/Arab-PK/unitfmt.json\",\"pa/Guru/unitfmt.json\",\"pa/Guru-IN/unitfmt.json\",\"pa/ctrynames.json\",\"pa/dateformats.json\",\"pa/localeinfo.json\",\"pa/name.json\",\"pa/plurals.json\",\"pa/sysres.json\",\"pa/unitfmt.json\",\"paa/localeinfo.json\",\"pag/localeinfo.json\",\"pal/localeinfo.json\",\"pam/localeinfo.json\",\"pap/localeinfo.json\",\"pap/plurals.json\",\"pau/localeinfo.json\",\"peo/localeinfo.json\",\"phi/localeinfo.json\",\"phn/localeinfo.json\",\"phonefmt.json\",\"phoneloc.json\",\"pi/localeinfo.json\",\"pl/PL/unitfmt.json\",\"pl/ctrynames.json\",\"pl/dateformats.json\",\"pl/localeinfo.json\",\"pl/name.json\",\"pl/plurals.json\",\"pl/sysres.json\",\"pl/unitfmt.json\",\"pon/localeinfo.json\",\"pra/localeinfo.json\",\"prd/localeinfo.json\",\"prg/localeinfo.json\",\"pro/localeinfo.json\",\"ps/AF/pseudomap.json\",\"ps/AF/unitfmt.json\",\"ps/ctrynames.json\",\"ps/dateformats.json\",\"ps/localeinfo.json\",\"ps/plurals.json\",\"ps/sysres.json\",\"ps/unitfmt.json\",\"pseudomap.json\",\"pt/AO/ctrynames.json\",\"pt/AO/localeinfo.json\",\"pt/AO/unitfmt.json\",\"pt/BR/sysres.json\",\"pt/BR/unitfmt.json\",\"pt/CV/ctrynames.json\",\"pt/CV/localeinfo.json\",\"pt/CV/unitfmt.json\",\"pt/GW/ctrynames.json\",\"pt/GW/localeinfo.json\",\"pt/GW/unitfmt.json\",\"pt/MO/ctrynames.json\",\"pt/MO/localeinfo.json\",\"pt/MO/unitfmt.json\",\"pt/MZ/ctrynames.json\",\"pt/MZ/localeinfo.json\",\"pt/MZ/unitfmt.json\",\"pt/PT/ctrynames.json\",\"pt/PT/localeinfo.json\",\"pt/PT/unitfmt.json\",\"pt/ST/ctrynames.json\",\"pt/ST/localeinfo.json\",\"pt/ST/unitfmt.json\",\"pt/TL/ctrynames.json\",\"pt/TL/localeinfo.json\",\"pt/TL/unitfmt.json\",\"pt/ctrynames.json\",\"pt/dateformats.json\",\"pt/localeinfo.json\",\"pt/name.json\",\"pt/plurals.json\",\"pt/sysres.json\",\"pt/unitfmt.json\",\"qu/BO/unitfmt.json\",\"qu/EC/unitfmt.json\",\"qu/PE/unitfmt.json\",\"qu/localeinfo.json\",\"qu/unitfmt.json\",\"raj/localeinfo.json\",\"rangeToScript.json\",\"rap/localeinfo.json\",\"rar/localeinfo.json\",\"rcf/localeinfo.json\",\"rej/localeinfo.json\",\"ril/localeinfo.json\",\"rm/CH/unitfmt.json\",\"rm/ctrynames.json\",\"rm/dateformats.json\",\"rm/localeinfo.json\",\"rm/plurals.json\",\"rm/sysres.json\",\"rm/unitfmt.json\",\"rn/BI/unitfmt.json\",\"rn/ctrynames.json\",\"rn/dateformats.json\",\"rn/localeinfo.json\",\"rn/sysres.json\",\"rn/unitfmt.json\",\"ro/MD/unitfmt.json\",\"ro/RO/unitfmt.json\",\"ro/ctrynames.json\",\"ro/dateformats.json\",\"ro/localeinfo.json\",\"ro/name.json\",\"ro/plurals.json\",\"ro/sysres.json\",\"ro/unitfmt.json\",\"roa/localeinfo.json\",\"rof/TZ/unitfmt.json\",\"rof/ctrynames.json\",\"rof/dateformats.json\",\"rof/localeinfo.json\",\"rof/plurals.json\",\"rof/sysres.json\",\"rof/unitfmt.json\",\"rom/localeinfo.json\",\"root/unitfmt.json\",\"ru/BY/unitfmt.json\",\"ru/KG/unitfmt.json\",\"ru/KZ/unitfmt.json\",\"ru/MD/unitfmt.json\",\"ru/RU/unitfmt.json\",\"ru/UA/unitfmt.json\",\"ru/ctrynames.json\",\"ru/dateformats.json\",\"ru/localeinfo.json\",\"ru/name.json\",\"ru/plurals.json\",\"ru/sysres.json\",\"ru/unitfmt.json\",\"rup/localeinfo.json\",\"rw/RW/unitfmt.json\",\"rw/ctrynames.json\",\"rw/dateformats.json\",\"rw/localeinfo.json\",\"rw/sysres.json\",\"rw/unitfmt.json\",\"rwk/TZ/unitfmt.json\",\"rwk/ctrynames.json\",\"rwk/dateformats.json\",\"rwk/localeinfo.json\",\"rwk/plurals.json\",\"rwk/sysres.json\",\"rwk/unitfmt.json\",\"sa/localeinfo.json\",\"sad/localeinfo.json\",\"sah/RU/unitfmt.json\",\"sah/dateformats.json\",\"sah/localeinfo.json\",\"sah/sysres.json\",\"sah/unitfmt.json\",\"sai/localeinfo.json\",\"sal/localeinfo.json\",\"sam/localeinfo.json\",\"saq/KE/unitfmt.json\",\"saq/ctrynames.json\",\"saq/dateformats.json\",\"saq/localeinfo.json\",\"saq/plurals.json\",\"saq/sysres.json\",\"saq/unitfmt.json\",\"sas/localeinfo.json\",\"sat/localeinfo.json\",\"saz/localeinfo.json\",\"sba/localeinfo.json\",\"sbp/TZ/unitfmt.json\",\"sbp/ctrynames.json\",\"sbp/dateformats.json\",\"sbp/localeinfo.json\",\"sbp/sysres.json\",\"sbp/unitfmt.json\",\"sc/localeinfo.json\",\"scn/localeinfo.json\",\"sco/localeinfo.json\",\"scriptToRange.json\",\"scripts.json\",\"sd/localeinfo.json\",\"sdh/localeinfo.json\",\"se/FI/unitfmt.json\",\"se/NO/unitfmt.json\",\"se/SE/unitfmt.json\",\"se/dateformats.json\",\"se/localeinfo.json\",\"se/plurals.json\",\"se/sysres.json\",\"se/unitfmt.json\",\"see/localeinfo.json\",\"seh/MZ/unitfmt.json\",\"seh/ctrynames.json\",\"seh/dateformats.json\",\"seh/localeinfo.json\",\"seh/plurals.json\",\"seh/sysres.json\",\"seh/unitfmt.json\",\"sel/localeinfo.json\",\"sem/localeinfo.json\",\"ses/ML/unitfmt.json\",\"ses/ctrynames.json\",\"ses/dateformats.json\",\"ses/localeinfo.json\",\"ses/sysres.json\",\"ses/unitfmt.json\",\"sg/CF/unitfmt.json\",\"sg/ctrynames.json\",\"sg/dateformats.json\",\"sg/localeinfo.json\",\"sg/sysres.json\",\"sg/unitfmt.json\",\"sga/localeinfo.json\",\"sgn/localeinfo.json\",\"sh/localeinfo.json\",\"sh/plurals.json\",\"shi/Latn/MA/ctrynames.json\",\"shi/Latn/MA/sysres.json\",\"shi/Latn/unitfmt.json\",\"shi/Latn-MA/unitfmt.json\",\"shi/Tfng/unitfmt.json\",\"shi/Tfng-MA/unitfmt.json\",\"shi/ctrynames.json\",\"shi/dateformats.json\",\"shi/localeinfo.json\",\"shi/plurals.json\",\"shi/sysres.json\",\"shi/unitfmt.json\",\"shn/localeinfo.json\",\"shu/localeinfo.json\",\"si/LK/unitfmt.json\",\"si/ctrynames.json\",\"si/dateformats.json\",\"si/localeinfo.json\",\"si/sysres.json\",\"si/unitfmt.json\",\"sid/localeinfo.json\",\"sio/localeinfo.json\",\"sit/localeinfo.json\",\"sk/SK/unitfmt.json\",\"sk/ctrynames.json\",\"sk/dateformats.json\",\"sk/localeinfo.json\",\"sk/name.json\",\"sk/plurals.json\",\"sk/sysres.json\",\"sk/unitfmt.json\",\"sl/SI/unitfmt.json\",\"sl/ctrynames.json\",\"sl/dateformats.json\",\"sl/localeinfo.json\",\"sl/name.json\",\"sl/plurals.json\",\"sl/sysres.json\",\"sl/unitfmt.json\",\"sla/localeinfo.json\",\"sm/localeinfo.json\",\"sma/localeinfo.json\",\"sma/plurals.json\",\"smi/localeinfo.json\",\"smi/plurals.json\",\"smj/localeinfo.json\",\"smj/plurals.json\",\"smn/FI/unitfmt.json\",\"smn/localeinfo.json\",\"smn/plurals.json\",\"smn/unitfmt.json\",\"sms/localeinfo.json\",\"sms/plurals.json\",\"sn/ZW/unitfmt.json\",\"sn/ctrynames.json\",\"sn/dateformats.json\",\"sn/localeinfo.json\",\"sn/plurals.json\",\"sn/sysres.json\",\"sn/unitfmt.json\",\"snk/localeinfo.json\",\"so/DJ/unitfmt.json\",\"so/ET/unitfmt.json\",\"so/KE/unitfmt.json\",\"so/SO/unitfmt.json\",\"so/ctrynames.json\",\"so/dateformats.json\",\"so/localeinfo.json\",\"so/plurals.json\",\"so/sysres.json\",\"so/unitfmt.json\",\"sog/localeinfo.json\",\"son/localeinfo.json\",\"sq/AL/unitfmt.json\",\"sq/MK/unitfmt.json\",\"sq/XK/unitfmt.json\",\"sq/ctrynames.json\",\"sq/dateformats.json\",\"sq/localeinfo.json\",\"sq/name.json\",\"sq/plurals.json\",\"sq/sysres.json\",\"sq/unitfmt.json\",\"sr/Cyrl/BA/sysres.json\",\"sr/Cyrl/unitfmt.json\",\"sr/Cyrl-BA/unitfmt.json\",\"sr/Cyrl-ME/unitfmt.json\",\"sr/Cyrl-RS/unitfmt.json\",\"sr/Cyrl-XK/unitfmt.json\",\"sr/Latn/BA/ctrynames.json\",\"sr/Latn/BA/dateformats.json\",\"sr/Latn/BA/localeinfo.json\",\"sr/Latn/BA/sysres.json\",\"sr/Latn/ME/ctrynames.json\",\"sr/Latn/ME/dateformats.json\",\"sr/Latn/ME/localeinfo.json\",\"sr/Latn/ME/sysres.json\",\"sr/Latn/RS/ctrynames.json\",\"sr/Latn/RS/dateformats.json\",\"sr/Latn/RS/localeinfo.json\",\"sr/Latn/RS/sysres.json\",\"sr/Latn/unitfmt.json\",\"sr/Latn-BA/unitfmt.json\",\"sr/Latn-ME/unitfmt.json\",\"sr/Latn-RS/unitfmt.json\",\"sr/Latn-XK/unitfmt.json\",\"sr/ctrynames.json\",\"sr/dateformats.json\",\"sr/localeinfo.json\",\"sr/name.json\",\"sr/plurals.json\",\"sr/sysres.json\",\"sr/unitfmt.json\",\"srn/localeinfo.json\",\"srr/localeinfo.json\",\"ss/SZ/unitfmt.json\",\"ss/ZA/unitfmt.json\",\"ss/dateformats.json\",\"ss/localeinfo.json\",\"ss/plurals.json\",\"ss/sysres.json\",\"ss/unitfmt.json\",\"ssa/localeinfo.json\",\"ssy/ER/unitfmt.json\",\"ssy/dateformats.json\",\"ssy/localeinfo.json\",\"ssy/plurals.json\",\"ssy/sysres.json\",\"ssy/unitfmt.json\",\"st/dateformats.json\",\"st/localeinfo.json\",\"st/plurals.json\",\"st/sysres.json\",\"su/localeinfo.json\",\"suk/localeinfo.json\",\"sus/localeinfo.json\",\"sux/localeinfo.json\",\"sv/AX/unitfmt.json\",\"sv/FI/ctrynames.json\",\"sv/FI/unitfmt.json\",\"sv/SE/unitfmt.json\",\"sv/ctrynames.json\",\"sv/dateformats.json\",\"sv/localeinfo.json\",\"sv/name.json\",\"sv/plurals.json\",\"sv/sysres.json\",\"sv/unitfmt.json\",\"sw/KE/unitfmt.json\",\"sw/TZ/unitfmt.json\",\"sw/UG/unitfmt.json\",\"sw/ctrynames.json\",\"sw/dateformats.json\",\"sw/localeinfo.json\",\"sw/plurals.json\",\"sw/sysres.json\",\"sw/unitfmt.json\",\"swb/localeinfo.json\",\"swc/CD/unitfmt.json\",\"swc/ctrynames.json\",\"swc/dateformats.json\",\"swc/localeinfo.json\",\"swc/sysres.json\",\"swc/unitfmt.json\",\"syc/localeinfo.json\",\"syl/localeinfo.json\",\"syr/localeinfo.json\",\"syr/plurals.json\",\"sysres.json\",\"ta/IN/unitfmt.json\",\"ta/LK/unitfmt.json\",\"ta/MY/unitfmt.json\",\"ta/SG/unitfmt.json\",\"ta/ctrynames.json\",\"ta/dateformats.json\",\"ta/localeinfo.json\",\"ta/name.json\",\"ta/plurals.json\",\"ta/sysres.json\",\"ta/unitfmt.json\",\"tab/localeinfo.json\",\"tai/localeinfo.json\",\"tbw/localeinfo.json\",\"tcy/localeinfo.json\",\"tdd/localeinfo.json\",\"te/IN/unitfmt.json\",\"te/ctrynames.json\",\"te/dateformats.json\",\"te/localeinfo.json\",\"te/name.json\",\"te/plurals.json\",\"te/sysres.json\",\"te/unitfmt.json\",\"tem/localeinfo.json\",\"teo/KE/unitfmt.json\",\"teo/UG/unitfmt.json\",\"teo/ctrynames.json\",\"teo/dateformats.json\",\"teo/localeinfo.json\",\"teo/plurals.json\",\"teo/sysres.json\",\"teo/unitfmt.json\",\"ter/localeinfo.json\",\"tet/localeinfo.json\",\"tg/ctrynames.json\",\"tg/dateformats.json\",\"tg/localeinfo.json\",\"tg/sysres.json\",\"th/TH/unitfmt.json\",\"th/ctrynames.json\",\"th/dateformats.json\",\"th/localeinfo.json\",\"th/name.json\",\"th/sysres.json\",\"th/unitfmt.json\",\"ti/ER/localeinfo.json\",\"ti/ER/sysres.json\",\"ti/ER/unitfmt.json\",\"ti/ET/unitfmt.json\",\"ti/dateformats.json\",\"ti/localeinfo.json\",\"ti/plurals.json\",\"ti/sysres.json\",\"ti/unitfmt.json\",\"tig/dateformats.json\",\"tig/localeinfo.json\",\"tig/plurals.json\",\"tig/sysres.json\",\"tiv/localeinfo.json\",\"tk/localeinfo.json\",\"tk/plurals.json\",\"tkl/localeinfo.json\",\"tl/localeinfo.json\",\"tl/plurals.json\",\"tlh/localeinfo.json\",\"tli/localeinfo.json\",\"tmh/localeinfo.json\",\"tn/BW/unitfmt.json\",\"tn/ZA/unitfmt.json\",\"tn/dateformats.json\",\"tn/localeinfo.json\",\"tn/plurals.json\",\"tn/sysres.json\",\"tn/unitfmt.json\",\"to/TO/unitfmt.json\",\"to/ctrynames.json\",\"to/dateformats.json\",\"to/localeinfo.json\",\"to/sysres.json\",\"to/unitfmt.json\",\"tog/localeinfo.json\",\"tpi/localeinfo.json\",\"tr/CY/unitfmt.json\",\"tr/TR/unitfmt.json\",\"tr/ctrynames.json\",\"tr/dateformats.json\",\"tr/localeinfo.json\",\"tr/name.json\",\"tr/sysres.json\",\"tr/unitfmt.json\",\"tru/localeinfo.json\",\"trv/localeinfo.json\",\"ts/ZA/unitfmt.json\",\"ts/dateformats.json\",\"ts/localeinfo.json\",\"ts/plurals.json\",\"ts/sysres.json\",\"ts/unitfmt.json\",\"tsg/localeinfo.json\",\"tsi/localeinfo.json\",\"tt/localeinfo.json\",\"tts/localeinfo.json\",\"ttt/localeinfo.json\",\"tum/localeinfo.json\",\"tup/localeinfo.json\",\"tut/localeinfo.json\",\"tvl/localeinfo.json\",\"tw/localeinfo.json\",\"twq/NE/unitfmt.json\",\"twq/ctrynames.json\",\"twq/dateformats.json\",\"twq/localeinfo.json\",\"twq/sysres.json\",\"twq/unitfmt.json\",\"ty/localeinfo.json\",\"tyv/localeinfo.json\",\"tzm/Latn/unitfmt.json\",\"tzm/Latn-MA/unitfmt.json\",\"tzm/ctrynames.json\",\"tzm/dateformats.json\",\"tzm/localeinfo.json\",\"tzm/plurals.json\",\"tzm/sysres.json\",\"tzm/unitfmt.json\",\"ude/localeinfo.json\",\"udm/localeinfo.json\",\"ug/Arab/unitfmt.json\",\"ug/Arab-CN/unitfmt.json\",\"ug/localeinfo.json\",\"ug/unitfmt.json\",\"uga/localeinfo.json\",\"uk/UA/unitfmt.json\",\"uk/ctrynames.json\",\"uk/dateformats.json\",\"uk/localeinfo.json\",\"uk/name.json\",\"uk/plurals.json\",\"uk/sysres.json\",\"uk/unitfmt.json\",\"uli/localeinfo.json\",\"umb/localeinfo.json\",\"und/AC/localeinfo.json\",\"und/AD/localeinfo.json\",\"und/AD/numplan.json\",\"und/AE/address.json\",\"und/AE/localeinfo.json\",\"und/AE/numplan.json\",\"und/AF/address.json\",\"und/AF/localeinfo.json\",\"und/AF/numplan.json\",\"und/AG/localeinfo.json\",\"und/AI/localeinfo.json\",\"und/AL/address.json\",\"und/AL/localeinfo.json\",\"und/AL/numplan.json\",\"und/AM/address.json\",\"und/AM/localeinfo.json\",\"und/AM/numplan.json\",\"und/AN/localeinfo.json\",\"und/AN/numplan.json\",\"und/AO/address.json\",\"und/AO/localeinfo.json\",\"und/AO/numplan.json\",\"und/AQ/localeinfo.json\",\"und/AR/address.json\",\"und/AR/localeinfo.json\",\"und/AR/numplan.json\",\"und/AS/localeinfo.json\",\"und/AT/address.json\",\"und/AT/localeinfo.json\",\"und/AT/numplan.json\",\"und/AU/address.json\",\"und/AU/area.json\",\"und/AU/extarea.json\",\"und/AU/extstates.json\",\"und/AU/localeinfo.json\",\"und/AU/numplan.json\",\"und/AU/phonefmt.json\",\"und/AU/states.json\",\"und/AW/localeinfo.json\",\"und/AW/numplan.json\",\"und/AX/localeinfo.json\",\"und/AZ/address.json\",\"und/AZ/localeinfo.json\",\"und/AZ/numplan.json\",\"und/BA/address.json\",\"und/BA/localeinfo.json\",\"und/BA/numplan.json\",\"und/BB/localeinfo.json\",\"und/BD/localeinfo.json\",\"und/BD/numplan.json\",\"und/BE/address.json\",\"und/BE/area.json\",\"und/BE/localeinfo.json\",\"und/BE/numplan.json\",\"und/BE/phonefmt.json\",\"und/BE/states.json\",\"und/BF/address.json\",\"und/BF/localeinfo.json\",\"und/BF/numplan.json\",\"und/BG/address.json\",\"und/BG/localeinfo.json\",\"und/BG/numplan.json\",\"und/BH/address.json\",\"und/BH/localeinfo.json\",\"und/BH/numplan.json\",\"und/BI/localeinfo.json\",\"und/BI/numplan.json\",\"und/BJ/address.json\",\"und/BJ/localeinfo.json\",\"und/BJ/numplan.json\",\"und/BL/localeinfo.json\",\"und/BM/localeinfo.json\",\"und/BN/localeinfo.json\",\"und/BN/numplan.json\",\"und/BO/address.json\",\"und/BO/localeinfo.json\",\"und/BO/numplan.json\",\"und/BQ/localeinfo.json\",\"und/BR/address.json\",\"und/BR/area.json\",\"und/BR/localeinfo.json\",\"und/BR/numplan.json\",\"und/BR/phonefmt.json\",\"und/BR/states.json\",\"und/BS/localeinfo.json\",\"und/BT/localeinfo.json\",\"und/BT/numplan.json\",\"und/BV/localeinfo.json\",\"und/BW/localeinfo.json\",\"und/BW/numplan.json\",\"und/BY/address.json\",\"und/BY/localeinfo.json\",\"und/BY/numplan.json\",\"und/BZ/localeinfo.json\",\"und/BZ/numplan.json\",\"und/CA/address.json\",\"und/CA/localeinfo.json\",\"und/CC/localeinfo.json\",\"und/CD/address.json\",\"und/CD/localeinfo.json\",\"und/CD/numplan.json\",\"und/CF/address.json\",\"und/CF/localeinfo.json\",\"und/CF/numplan.json\",\"und/CG/address.json\",\"und/CG/localeinfo.json\",\"und/CG/numplan.json\",\"und/CH/address.json\",\"und/CH/localeinfo.json\",\"und/CH/numplan.json\",\"und/CI/address.json\",\"und/CI/localeinfo.json\",\"und/CI/numplan.json\",\"und/CK/localeinfo.json\",\"und/CK/numplan.json\",\"und/CL/address.json\",\"und/CL/localeinfo.json\",\"und/CL/numplan.json\",\"und/CM/address.json\",\"und/CM/localeinfo.json\",\"und/CM/numplan.json\",\"und/CN/address.json\",\"und/CN/area.json\",\"und/CN/localeinfo.json\",\"und/CN/numplan.json\",\"und/CN/phonefmt.json\",\"und/CN/states.json\",\"und/CO/address.json\",\"und/CO/localeinfo.json\",\"und/CO/numplan.json\",\"und/CP/localeinfo.json\",\"und/CR/address.json\",\"und/CR/localeinfo.json\",\"und/CR/numplan.json\",\"und/CU/localeinfo.json\",\"und/CU/numplan.json\",\"und/CV/address.json\",\"und/CV/localeinfo.json\",\"und/CV/numplan.json\",\"und/CW/localeinfo.json\",\"und/CX/localeinfo.json\",\"und/CY/address.json\",\"und/CY/localeinfo.json\",\"und/CY/numplan.json\",\"und/CZ/address.json\",\"und/CZ/localeinfo.json\",\"und/CZ/numplan.json\",\"und/DE/address.json\",\"und/DE/area.json\",\"und/DE/localeinfo.json\",\"und/DE/numplan.json\",\"und/DE/phonefmt.json\",\"und/DE/states.json\",\"und/DG/localeinfo.json\",\"und/DJ/address.json\",\"und/DJ/localeinfo.json\",\"und/DJ/numplan.json\",\"und/DK/address.json\",\"und/DK/localeinfo.json\",\"und/DK/numplan.json\",\"und/DM/localeinfo.json\",\"und/DO/address.json\",\"und/DO/localeinfo.json\",\"und/DZ/address.json\",\"und/DZ/localeinfo.json\",\"und/DZ/numplan.json\",\"und/EA/localeinfo.json\",\"und/EC/address.json\",\"und/EC/localeinfo.json\",\"und/EC/numplan.json\",\"und/EE/address.json\",\"und/EE/localeinfo.json\",\"und/EE/numplan.json\",\"und/EG/address.json\",\"und/EG/localeinfo.json\",\"und/EG/numplan.json\",\"und/EH/localeinfo.json\",\"und/ER/localeinfo.json\",\"und/ER/numplan.json\",\"und/ES/address.json\",\"und/ES/area.json\",\"und/ES/localeinfo.json\",\"und/ES/numplan.json\",\"und/ES/phonefmt.json\",\"und/ES/states.json\",\"und/ET/address.json\",\"und/ET/localeinfo.json\",\"und/ET/numplan.json\",\"und/EU/localeinfo.json\",\"und/FI/address.json\",\"und/FI/localeinfo.json\",\"und/FI/numplan.json\",\"und/FJ/localeinfo.json\",\"und/FJ/numplan.json\",\"und/FK/localeinfo.json\",\"und/FK/numplan.json\",\"und/FM/localeinfo.json\",\"und/FM/numplan.json\",\"und/FO/localeinfo.json\",\"und/FO/numplan.json\",\"und/FR/address.json\",\"und/FR/area.json\",\"und/FR/extarea.json\",\"und/FR/extstates.json\",\"und/FR/localeinfo.json\",\"und/FR/numplan.json\",\"und/FR/phonefmt.json\",\"und/FR/states.json\",\"und/GA/address.json\",\"und/GA/localeinfo.json\",\"und/GA/numplan.json\",\"und/GB/address.json\",\"und/GB/area.json\",\"und/GB/localeinfo.json\",\"und/GB/numplan.json\",\"und/GB/phonefmt.json\",\"und/GB/states.json\",\"und/GD/localeinfo.json\",\"und/GE/address.json\",\"und/GE/localeinfo.json\",\"und/GE/numplan.json\",\"und/GF/localeinfo.json\",\"und/GF/numplan.json\",\"und/GG/localeinfo.json\",\"und/GH/address.json\",\"und/GH/localeinfo.json\",\"und/GH/numplan.json\",\"und/GI/localeinfo.json\",\"und/GI/numplan.json\",\"und/GL/localeinfo.json\",\"und/GL/numplan.json\",\"und/GM/address.json\",\"und/GM/localeinfo.json\",\"und/GM/numplan.json\",\"und/GN/address.json\",\"und/GN/localeinfo.json\",\"und/GN/numplan.json\",\"und/GP/localeinfo.json\",\"und/GP/numplan.json\",\"und/GQ/address.json\",\"und/GQ/localeinfo.json\",\"und/GQ/numplan.json\",\"und/GR/address.json\",\"und/GR/localeinfo.json\",\"und/GR/numplan.json\",\"und/GS/localeinfo.json\",\"und/GT/address.json\",\"und/GT/localeinfo.json\",\"und/GT/numplan.json\",\"und/GU/localeinfo.json\",\"und/GW/localeinfo.json\",\"und/GW/numplan.json\",\"und/GY/localeinfo.json\",\"und/GY/numplan.json\",\"und/HK/address.json\",\"und/HK/localeinfo.json\",\"und/HK/numplan.json\",\"und/HK/phonefmt.json\",\"und/HK/states.json\",\"und/HM/localeinfo.json\",\"und/HN/address.json\",\"und/HN/localeinfo.json\",\"und/HN/numplan.json\",\"und/HR/address.json\",\"und/HR/localeinfo.json\",\"und/HR/numplan.json\",\"und/HT/localeinfo.json\",\"und/HT/numplan.json\",\"und/HU/address.json\",\"und/HU/localeinfo.json\",\"und/HU/numplan.json\",\"und/IC/localeinfo.json\",\"und/ID/address.json\",\"und/ID/localeinfo.json\",\"und/ID/numplan.json\",\"und/IE/address.json\",\"und/IE/area.json\",\"und/IE/localeinfo.json\",\"und/IE/numplan.json\",\"und/IE/phonefmt.json\",\"und/IE/states.json\",\"und/IL/address.json\",\"und/IL/localeinfo.json\",\"und/IL/numplan.json\",\"und/IM/localeinfo.json\",\"und/IN/address.json\",\"und/IN/area.json\",\"und/IN/localeinfo.json\",\"und/IN/numplan.json\",\"und/IN/phonefmt.json\",\"und/IN/states.json\",\"und/IO/localeinfo.json\",\"und/IQ/address.json\",\"und/IQ/localeinfo.json\",\"und/IQ/numplan.json\",\"und/IR/address.json\",\"und/IR/localeinfo.json\",\"und/IR/numplan.json\",\"und/IS/address.json\",\"und/IS/localeinfo.json\",\"und/IS/numplan.json\",\"und/IT/address.json\",\"und/IT/area.json\",\"und/IT/localeinfo.json\",\"und/IT/numplan.json\",\"und/IT/phonefmt.json\",\"und/IT/states.json\",\"und/JE/localeinfo.json\",\"und/JM/localeinfo.json\",\"und/JO/address.json\",\"und/JO/localeinfo.json\",\"und/JO/numplan.json\",\"und/JP/address.json\",\"und/JP/area.json\",\"und/JP/extarea.json\",\"und/JP/extstates.json\",\"und/JP/localeinfo.json\",\"und/JP/numplan.json\",\"und/JP/phonefmt.json\",\"und/JP/states.json\",\"und/KE/address.json\",\"und/KE/localeinfo.json\",\"und/KE/numplan.json\",\"und/KG/address.json\",\"und/KG/localeinfo.json\",\"und/KG/numplan.json\",\"und/KH/localeinfo.json\",\"und/KH/numplan.json\",\"und/KI/localeinfo.json\",\"und/KI/numplan.json\",\"und/KM/localeinfo.json\",\"und/KM/numplan.json\",\"und/KN/localeinfo.json\",\"und/KP/localeinfo.json\",\"und/KP/numplan.json\",\"und/KR/address.json\",\"und/KR/area.json\",\"und/KR/localeinfo.json\",\"und/KR/numplan.json\",\"und/KR/phonefmt.json\",\"und/KR/states.json\",\"und/KW/address.json\",\"und/KW/localeinfo.json\",\"und/KW/numplan.json\",\"und/KY/localeinfo.json\",\"und/KZ/address.json\",\"und/KZ/localeinfo.json\",\"und/KZ/numplan.json\",\"und/LA/localeinfo.json\",\"und/LA/numplan.json\",\"und/LB/address.json\",\"und/LB/localeinfo.json\",\"und/LB/numplan.json\",\"und/LC/localeinfo.json\",\"und/LI/localeinfo.json\",\"und/LI/numplan.json\",\"und/LK/address.json\",\"und/LK/localeinfo.json\",\"und/LK/numplan.json\",\"und/LR/address.json\",\"und/LR/localeinfo.json\",\"und/LR/numplan.json\",\"und/LS/localeinfo.json\",\"und/LS/numplan.json\",\"und/LT/address.json\",\"und/LT/localeinfo.json\",\"und/LT/numplan.json\",\"und/LU/address.json\",\"und/LU/localeinfo.json\",\"und/LU/numplan.json\",\"und/LU/phonefmt.json\",\"und/LU/states.json\",\"und/LV/address.json\",\"und/LV/localeinfo.json\",\"und/LV/numplan.json\",\"und/LY/address.json\",\"und/LY/localeinfo.json\",\"und/LY/numplan.json\",\"und/MA/address.json\",\"und/MA/localeinfo.json\",\"und/MA/numplan.json\",\"und/MC/localeinfo.json\",\"und/MC/numplan.json\",\"und/MD/localeinfo.json\",\"und/MD/numplan.json\",\"und/ME/address.json\",\"und/ME/localeinfo.json\",\"und/ME/numplan.json\",\"und/MF/localeinfo.json\",\"und/MG/localeinfo.json\",\"und/MG/numplan.json\",\"und/MH/localeinfo.json\",\"und/MH/numplan.json\",\"und/MK/address.json\",\"und/MK/localeinfo.json\",\"und/MK/numplan.json\",\"und/ML/address.json\",\"und/ML/localeinfo.json\",\"und/ML/numplan.json\",\"und/MM/address.json\",\"und/MM/localeinfo.json\",\"und/MM/numplan.json\",\"und/MN/address.json\",\"und/MN/localeinfo.json\",\"und/MN/numplan.json\",\"und/MO/localeinfo.json\",\"und/MO/numplan.json\",\"und/MP/localeinfo.json\",\"und/MQ/localeinfo.json\",\"und/MQ/numplan.json\",\"und/MR/address.json\",\"und/MR/localeinfo.json\",\"und/MR/numplan.json\",\"und/MS/localeinfo.json\",\"und/MT/localeinfo.json\",\"und/MT/numplan.json\",\"und/MU/localeinfo.json\",\"und/MU/numplan.json\",\"und/MV/localeinfo.json\",\"und/MV/numplan.json\",\"und/MW/address.json\",\"und/MW/localeinfo.json\",\"und/MW/numplan.json\",\"und/MX/address.json\",\"und/MX/area.json\",\"und/MX/localeinfo.json\",\"und/MX/numplan.json\",\"und/MX/phonefmt.json\",\"und/MX/states.json\",\"und/MY/address.json\",\"und/MY/localeinfo.json\",\"und/MY/numplan.json\",\"und/MZ/localeinfo.json\",\"und/MZ/numplan.json\",\"und/NA/localeinfo.json\",\"und/NA/numplan.json\",\"und/NC/localeinfo.json\",\"und/NC/numplan.json\",\"und/NE/localeinfo.json\",\"und/NE/numplan.json\",\"und/NF/localeinfo.json\",\"und/NF/numplan.json\",\"und/NG/address.json\",\"und/NG/localeinfo.json\",\"und/NG/numplan.json\",\"und/NI/address.json\",\"und/NI/localeinfo.json\",\"und/NI/numplan.json\",\"und/NL/address.json\",\"und/NL/area.json\",\"und/NL/localeinfo.json\",\"und/NL/numplan.json\",\"und/NL/phonefmt.json\",\"und/NL/states.json\",\"und/NO/address.json\",\"und/NO/localeinfo.json\",\"und/NO/numplan.json\",\"und/NP/localeinfo.json\",\"und/NP/numplan.json\",\"und/NR/localeinfo.json\",\"und/NR/numplan.json\",\"und/NU/localeinfo.json\",\"und/NU/numplan.json\",\"und/NZ/address.json\",\"und/NZ/area.json\",\"und/NZ/extarea.json\",\"und/NZ/extstates.json\",\"und/NZ/localeinfo.json\",\"und/NZ/numplan.json\",\"und/NZ/phonefmt.json\",\"und/NZ/states.json\",\"und/OM/address.json\",\"und/OM/localeinfo.json\",\"und/OM/numplan.json\",\"und/PA/address.json\",\"und/PA/localeinfo.json\",\"und/PA/numplan.json\",\"und/PE/address.json\",\"und/PE/localeinfo.json\",\"und/PE/numplan.json\",\"und/PF/localeinfo.json\",\"und/PF/numplan.json\",\"und/PG/localeinfo.json\",\"und/PG/numplan.json\",\"und/PH/address.json\",\"und/PH/localeinfo.json\",\"und/PH/numplan.json\",\"und/PK/address.json\",\"und/PK/localeinfo.json\",\"und/PK/numplan.json\",\"und/PL/address.json\",\"und/PL/localeinfo.json\",\"und/PL/numplan.json\",\"und/PM/localeinfo.json\",\"und/PM/numplan.json\",\"und/PN/localeinfo.json\",\"und/PR/address.json\",\"und/PR/localeinfo.json\",\"und/PS/localeinfo.json\",\"und/PT/address.json\",\"und/PT/localeinfo.json\",\"und/PT/numplan.json\",\"und/PW/localeinfo.json\",\"und/PW/numplan.json\",\"und/PY/address.json\",\"und/PY/localeinfo.json\",\"und/PY/numplan.json\",\"und/QA/address.json\",\"und/QA/localeinfo.json\",\"und/QA/numplan.json\",\"und/QO/localeinfo.json\",\"und/RE/localeinfo.json\",\"und/RE/numplan.json\",\"und/RO/address.json\",\"und/RO/localeinfo.json\",\"und/RO/numplan.json\",\"und/RS/address.json\",\"und/RS/localeinfo.json\",\"und/RS/numplan.json\",\"und/RU/address.json\",\"und/RU/area.json\",\"und/RU/localeinfo.json\",\"und/RU/numplan.json\",\"und/RU/phonefmt.json\",\"und/RU/states.json\",\"und/RW/address.json\",\"und/RW/localeinfo.json\",\"und/RW/numplan.json\",\"und/SA/address.json\",\"und/SA/localeinfo.json\",\"und/SA/numplan.json\",\"und/SB/localeinfo.json\",\"und/SB/numplan.json\",\"und/SC/localeinfo.json\",\"und/SC/numplan.json\",\"und/SD/address.json\",\"und/SD/localeinfo.json\",\"und/SD/numplan.json\",\"und/SE/address.json\",\"und/SE/localeinfo.json\",\"und/SE/numplan.json\",\"und/SG/address.json\",\"und/SG/localeinfo.json\",\"und/SG/numplan.json\",\"und/SG/phonefmt.json\",\"und/SG/states.json\",\"und/SH/localeinfo.json\",\"und/SH/numplan.json\",\"und/SI/address.json\",\"und/SI/localeinfo.json\",\"und/SI/numplan.json\",\"und/SJ/localeinfo.json\",\"und/SK/address.json\",\"und/SK/localeinfo.json\",\"und/SK/numplan.json\",\"und/SL/address.json\",\"und/SL/localeinfo.json\",\"und/SL/numplan.json\",\"und/SM/localeinfo.json\",\"und/SM/numplan.json\",\"und/SN/address.json\",\"und/SN/localeinfo.json\",\"und/SN/numplan.json\",\"und/SO/localeinfo.json\",\"und/SO/numplan.json\",\"und/SR/localeinfo.json\",\"und/SR/numplan.json\",\"und/SS/localeinfo.json\",\"und/ST/localeinfo.json\",\"und/ST/numplan.json\",\"und/SV/address.json\",\"und/SV/localeinfo.json\",\"und/SV/numplan.json\",\"und/SX/localeinfo.json\",\"und/SY/address.json\",\"und/SY/localeinfo.json\",\"und/SY/numplan.json\",\"und/SZ/localeinfo.json\",\"und/SZ/numplan.json\",\"und/TA/localeinfo.json\",\"und/TC/localeinfo.json\",\"und/TD/localeinfo.json\",\"und/TD/numplan.json\",\"und/TF/localeinfo.json\",\"und/TG/address.json\",\"und/TG/localeinfo.json\",\"und/TG/numplan.json\",\"und/TH/address.json\",\"und/TH/localeinfo.json\",\"und/TH/numplan.json\",\"und/TJ/localeinfo.json\",\"und/TJ/numplan.json\",\"und/TK/localeinfo.json\",\"und/TK/numplan.json\",\"und/TL/localeinfo.json\",\"und/TL/numplan.json\",\"und/TM/localeinfo.json\",\"und/TM/numplan.json\",\"und/TN/address.json\",\"und/TN/localeinfo.json\",\"und/TN/numplan.json\",\"und/TO/localeinfo.json\",\"und/TO/numplan.json\",\"und/TR/address.json\",\"und/TR/localeinfo.json\",\"und/TR/numplan.json\",\"und/TT/localeinfo.json\",\"und/TV/localeinfo.json\",\"und/TV/numplan.json\",\"und/TW/address.json\",\"und/TW/area.json\",\"und/TW/extarea.json\",\"und/TW/extstates.json\",\"und/TW/localeinfo.json\",\"und/TW/numplan.json\",\"und/TW/phonefmt.json\",\"und/TW/states.json\",\"und/TZ/address.json\",\"und/TZ/localeinfo.json\",\"und/TZ/numplan.json\",\"und/UA/address.json\",\"und/UA/localeinfo.json\",\"und/UA/numplan.json\",\"und/UG/address.json\",\"und/UG/localeinfo.json\",\"und/UG/numplan.json\",\"und/UM/localeinfo.json\",\"und/US/address.json\",\"und/US/area.json\",\"und/US/localeinfo.json\",\"und/US/numplan.json\",\"und/US/phonefmt.json\",\"und/US/states.json\",\"und/UY/address.json\",\"und/UY/localeinfo.json\",\"und/UY/numplan.json\",\"und/UZ/address.json\",\"und/UZ/localeinfo.json\",\"und/UZ/numplan.json\",\"und/VA/localeinfo.json\",\"und/VA/numplan.json\",\"und/VC/localeinfo.json\",\"und/VE/address.json\",\"und/VE/localeinfo.json\",\"und/VE/numplan.json\",\"und/VG/localeinfo.json\",\"und/VI/localeinfo.json\",\"und/VN/address.json\",\"und/VN/localeinfo.json\",\"und/VN/numplan.json\",\"und/VU/localeinfo.json\",\"und/VU/numplan.json\",\"und/WF/localeinfo.json\",\"und/WF/numplan.json\",\"und/WS/localeinfo.json\",\"und/WS/numplan.json\",\"und/XX/address.json\",\"und/XX/localeinfo.json\",\"und/XX/states.json\",\"und/YE/address.json\",\"und/YE/localeinfo.json\",\"und/YE/numplan.json\",\"und/YT/localeinfo.json\",\"und/YT/numplan.json\",\"und/ZA/address.json\",\"und/ZA/localeinfo.json\",\"und/ZA/numplan.json\",\"und/ZM/address.json\",\"und/ZM/localeinfo.json\",\"und/ZM/numplan.json\",\"und/ZW/localeinfo.json\",\"und/ZW/numplan.json\",\"und/ZZ/localeinfo.json\",\"und/localeinfo.json\",\"unitfmt.json\",\"unr/localeinfo.json\",\"unx/localeinfo.json\",\"ur/IN/localeinfo.json\",\"ur/IN/unitfmt.json\",\"ur/PK/unitfmt.json\",\"ur/ctrynames.json\",\"ur/dateformats.json\",\"ur/localeinfo.json\",\"ur/name.json\",\"ur/plurals.json\",\"ur/sysres.json\",\"ur/unitfmt.json\",\"uz/Arab/AF/ctrynames.json\",\"uz/Arab/AF/localeinfo.json\",\"uz/Arab/AF/sysres.json\",\"uz/Arab/unitfmt.json\",\"uz/Arab-AF/unitfmt.json\",\"uz/Cyrl/name.json\",\"uz/Cyrl/unitfmt.json\",\"uz/Cyrl-UZ/unitfmt.json\",\"uz/Latn/UZ/ctrynames.json\",\"uz/Latn/UZ/sysres.json\",\"uz/Latn/name.json\",\"uz/Latn/unitfmt.json\",\"uz/Latn-UZ/unitfmt.json\",\"uz/dateformats.json\",\"uz/localeinfo.json\",\"uz/sysres.json\",\"uz/unitfmt.json\",\"vai/Latn/LR/ctrynames.json\",\"vai/Latn/LR/dateformats.json\",\"vai/Latn/LR/sysres.json\",\"vai/Latn/unitfmt.json\",\"vai/Latn-LR/unitfmt.json\",\"vai/Vaii/unitfmt.json\",\"vai/Vaii-LR/unitfmt.json\",\"vai/ctrynames.json\",\"vai/dateformats.json\",\"vai/localeinfo.json\",\"vai/sysres.json\",\"vai/unitfmt.json\",\"ve/ZA/unitfmt.json\",\"ve/dateformats.json\",\"ve/localeinfo.json\",\"ve/plurals.json\",\"ve/sysres.json\",\"ve/unitfmt.json\",\"vi/VN/unitfmt.json\",\"vi/ctrynames.json\",\"vi/dateformats.json\",\"vi/localeinfo.json\",\"vi/name.json\",\"vi/sysres.json\",\"vi/unitfmt.json\",\"vo/001/unitfmt.json\",\"vo/dateformats.json\",\"vo/localeinfo.json\",\"vo/plurals.json\",\"vo/sysres.json\",\"vo/unitfmt.json\",\"vot/localeinfo.json\",\"vun/TZ/unitfmt.json\",\"vun/ctrynames.json\",\"vun/dateformats.json\",\"vun/localeinfo.json\",\"vun/plurals.json\",\"vun/sysres.json\",\"vun/unitfmt.json\",\"wa/localeinfo.json\",\"wa/plurals.json\",\"wae/CH/unitfmt.json\",\"wae/dateformats.json\",\"wae/localeinfo.json\",\"wae/plurals.json\",\"wae/sysres.json\",\"wae/unitfmt.json\",\"wak/localeinfo.json\",\"wal/dateformats.json\",\"wal/localeinfo.json\",\"wal/sysres.json\",\"war/localeinfo.json\",\"was/localeinfo.json\",\"wen/localeinfo.json\",\"wo/localeinfo.json\",\"xal/localeinfo.json\",\"xcr/localeinfo.json\",\"xh/dateformats.json\",\"xh/localeinfo.json\",\"xh/plurals.json\",\"xh/sysres.json\",\"xlc/localeinfo.json\",\"xld/localeinfo.json\",\"xog/UG/unitfmt.json\",\"xog/ctrynames.json\",\"xog/dateformats.json\",\"xog/localeinfo.json\",\"xog/plurals.json\",\"xog/sysres.json\",\"xog/unitfmt.json\",\"xpr/localeinfo.json\",\"xsa/localeinfo.json\",\"xsr/localeinfo.json\",\"xum/localeinfo.json\",\"yao/localeinfo.json\",\"yap/localeinfo.json\",\"yav/CM/unitfmt.json\",\"yav/ctrynames.json\",\"yav/dateformats.json\",\"yav/localeinfo.json\",\"yav/sysres.json\",\"yav/unitfmt.json\",\"ybb/localeinfo.json\",\"yi/001/unitfmt.json\",\"yi/localeinfo.json\",\"yi/unitfmt.json\",\"yo/BJ/unitfmt.json\",\"yo/NG/unitfmt.json\",\"yo/ctrynames.json\",\"yo/dateformats.json\",\"yo/localeinfo.json\",\"yo/sysres.json\",\"yo/unitfmt.json\",\"ypk/localeinfo.json\",\"yrk/localeinfo.json\",\"yue/localeinfo.json\",\"za/localeinfo.json\",\"zap/localeinfo.json\",\"zbl/localeinfo.json\",\"zen/localeinfo.json\",\"zgh/MA/unitfmt.json\",\"zgh/unitfmt.json\",\"zh/HK/ctrynames.json\",\"zh/HK/dateformats.json\",\"zh/HK/sysres.json\",\"zh/Hans/HK/dateformats.json\",\"zh/Hans/MO/dateformats.json\",\"zh/Hans/unitfmt.json\",\"zh/Hans-CN/unitfmt.json\",\"zh/Hans-HK/unitfmt.json\",\"zh/Hans-MO/unitfmt.json\",\"zh/Hans-SG/unitfmt.json\",\"zh/Hant/HK/dateformats.json\",\"zh/Hant/HK/localeinfo.json\",\"zh/Hant/MO/dateformats.json\",\"zh/Hant/MO/localeinfo.json\",\"zh/Hant/TW/dateformats.json\",\"zh/Hant/TW/localeinfo.json\",\"zh/Hant/US/dateformats.json\",\"zh/Hant/ctrynames.json\",\"zh/Hant/name.json\",\"zh/Hant/phoneres.json\",\"zh/Hant/sysres.json\",\"zh/Hant/unitfmt.json\",\"zh/Hant-HK/unitfmt.json\",\"zh/Hant-MO/unitfmt.json\",\"zh/Hant-TW/unitfmt.json\",\"zh/MO/dateformats.json\",\"zh/MO/sysres.json\",\"zh/MY/ctrynames.json\",\"zh/MY/sysres.json\",\"zh/TW/ctrynames.json\",\"zh/TW/dateformats.json\",\"zh/TW/sysres.json\",\"zh/US/dateformats.json\",\"zh/US/sysres.json\",\"zh/ctrynames.json\",\"zh/dateformats.json\",\"zh/localeinfo.json\",\"zh/name.json\",\"zh/phoneres.json\",\"zh/sysres.json\",\"zh/unitfmt.json\",\"znd/localeinfo.json\",\"zoneinfo/Africa/Abidjan.json\",\"zoneinfo/Africa/Accra.json\",\"zoneinfo/Africa/Addis_Ababa.json\",\"zoneinfo/Africa/Algiers.json\",\"zoneinfo/Africa/Asmara.json\",\"zoneinfo/Africa/Bamako.json\",\"zoneinfo/Africa/Bangui.json\",\"zoneinfo/Africa/Banjul.json\",\"zoneinfo/Africa/Bissau.json\",\"zoneinfo/Africa/Blantyre.json\",\"zoneinfo/Africa/Brazzaville.json\",\"zoneinfo/Africa/Bujumbura.json\",\"zoneinfo/Africa/Cairo.json\",\"zoneinfo/Africa/Casablanca.json\",\"zoneinfo/Africa/Ceuta.json\",\"zoneinfo/Africa/Conakry.json\",\"zoneinfo/Africa/Dakar.json\",\"zoneinfo/Africa/Dar_es_Salaam.json\",\"zoneinfo/Africa/Djibouti.json\",\"zoneinfo/Africa/Douala.json\",\"zoneinfo/Africa/El_Aaiun.json\",\"zoneinfo/Africa/Freetown.json\",\"zoneinfo/Africa/Gaborone.json\",\"zoneinfo/Africa/Harare.json\",\"zoneinfo/Africa/Johannesburg.json\",\"zoneinfo/Africa/Juba.json\",\"zoneinfo/Africa/Kampala.json\",\"zoneinfo/Africa/Khartoum.json\",\"zoneinfo/Africa/Kigali.json\",\"zoneinfo/Africa/Kinshasa.json\",\"zoneinfo/Africa/Lagos.json\",\"zoneinfo/Africa/Libreville.json\",\"zoneinfo/Africa/Lome.json\",\"zoneinfo/Africa/Luanda.json\",\"zoneinfo/Africa/Lubumbashi.json\",\"zoneinfo/Africa/Lusaka.json\",\"zoneinfo/Africa/Malabo.json\",\"zoneinfo/Africa/Maputo.json\",\"zoneinfo/Africa/Maseru.json\",\"zoneinfo/Africa/Mbabane.json\",\"zoneinfo/Africa/Mogadishu.json\",\"zoneinfo/Africa/Monrovia.json\",\"zoneinfo/Africa/Nairobi.json\",\"zoneinfo/Africa/Ndjamena.json\",\"zoneinfo/Africa/Niamey.json\",\"zoneinfo/Africa/Nouakchott.json\",\"zoneinfo/Africa/Ouagadougou.json\",\"zoneinfo/Africa/Porto-Novo.json\",\"zoneinfo/Africa/Sao_Tome.json\",\"zoneinfo/Africa/Timbuktu.json\",\"zoneinfo/Africa/Tripoli.json\",\"zoneinfo/Africa/Tunis.json\",\"zoneinfo/Africa/Windhoek.json\",\"zoneinfo/America/Adak.json\",\"zoneinfo/America/Anchorage.json\",\"zoneinfo/America/Anguilla.json\",\"zoneinfo/America/Antigua.json\",\"zoneinfo/America/Araguaina.json\",\"zoneinfo/America/Argentina.json\",\"zoneinfo/America/Aruba.json\",\"zoneinfo/America/Asuncion.json\",\"zoneinfo/America/Atikokan.json\",\"zoneinfo/America/Bahia.json\",\"zoneinfo/America/Bahia_Banderas.json\",\"zoneinfo/America/Barbados.json\",\"zoneinfo/America/Belem.json\",\"zoneinfo/America/Belize.json\",\"zoneinfo/America/Blanc-Sablon.json\",\"zoneinfo/America/Boa_Vista.json\",\"zoneinfo/America/Bogota.json\",\"zoneinfo/America/Boise.json\",\"zoneinfo/America/Buenos_Aires.json\",\"zoneinfo/America/Cambridge_Bay.json\",\"zoneinfo/America/Campo_Grande.json\",\"zoneinfo/America/Cancun.json\",\"zoneinfo/America/Caracas.json\",\"zoneinfo/America/Catamarca.json\",\"zoneinfo/America/Cayenne.json\",\"zoneinfo/America/Cayman.json\",\"zoneinfo/America/Chicago.json\",\"zoneinfo/America/Chihuahua.json\",\"zoneinfo/America/Coral_Harbour.json\",\"zoneinfo/America/Cordoba.json\",\"zoneinfo/America/Costa_Rica.json\",\"zoneinfo/America/Creston.json\",\"zoneinfo/America/Cuiaba.json\",\"zoneinfo/America/Curacao.json\",\"zoneinfo/America/Danmarkshavn.json\",\"zoneinfo/America/Dawson.json\",\"zoneinfo/America/Dawson_Creek.json\",\"zoneinfo/America/Denver.json\",\"zoneinfo/America/Detroit.json\",\"zoneinfo/America/Dominica.json\",\"zoneinfo/America/Edmonton.json\",\"zoneinfo/America/Eirunepe.json\",\"zoneinfo/America/El_Salvador.json\",\"zoneinfo/America/Ensenada.json\",\"zoneinfo/America/Fort_Wayne.json\",\"zoneinfo/America/Fortaleza.json\",\"zoneinfo/America/Glace_Bay.json\",\"zoneinfo/America/Godthab.json\",\"zoneinfo/America/Goose_Bay.json\",\"zoneinfo/America/Grand_Turk.json\",\"zoneinfo/America/Grenada.json\",\"zoneinfo/America/Guadeloupe.json\",\"zoneinfo/America/Guatemala.json\",\"zoneinfo/America/Guayaquil.json\",\"zoneinfo/America/Guyana.json\",\"zoneinfo/America/Halifax.json\",\"zoneinfo/America/Havana.json\",\"zoneinfo/America/Hermosillo.json\",\"zoneinfo/America/Indiana.json\",\"zoneinfo/America/Indianapolis.json\",\"zoneinfo/America/Inuvik.json\",\"zoneinfo/America/Iqaluit.json\",\"zoneinfo/America/Jamaica.json\",\"zoneinfo/America/Jujuy.json\",\"zoneinfo/America/Juneau.json\",\"zoneinfo/America/Kentucky.json\",\"zoneinfo/America/Knox_IN.json\",\"zoneinfo/America/Kralendijk.json\",\"zoneinfo/America/La_Paz.json\",\"zoneinfo/America/Lima.json\",\"zoneinfo/America/Los_Angeles.json\",\"zoneinfo/America/Louisville.json\",\"zoneinfo/America/Lower_Princes.json\",\"zoneinfo/America/Maceio.json\",\"zoneinfo/America/Managua.json\",\"zoneinfo/America/Manaus.json\",\"zoneinfo/America/Marigot.json\",\"zoneinfo/America/Martinique.json\",\"zoneinfo/America/Matamoros.json\",\"zoneinfo/America/Mazatlan.json\",\"zoneinfo/America/Mendoza.json\",\"zoneinfo/America/Menominee.json\",\"zoneinfo/America/Merida.json\",\"zoneinfo/America/Metlakatla.json\",\"zoneinfo/America/Mexico_City.json\",\"zoneinfo/America/Miquelon.json\",\"zoneinfo/America/Moncton.json\",\"zoneinfo/America/Monterrey.json\",\"zoneinfo/America/Montevideo.json\",\"zoneinfo/America/Montreal.json\",\"zoneinfo/America/Montserrat.json\",\"zoneinfo/America/Nassau.json\",\"zoneinfo/America/New_York.json\",\"zoneinfo/America/Nipigon.json\",\"zoneinfo/America/Nome.json\",\"zoneinfo/America/Noronha.json\",\"zoneinfo/America/North_Dakota.json\",\"zoneinfo/America/Ojinaga.json\",\"zoneinfo/America/Panama.json\",\"zoneinfo/America/Pangnirtung.json\",\"zoneinfo/America/Paramaribo.json\",\"zoneinfo/America/Phoenix.json\",\"zoneinfo/America/Port-au-Prince.json\",\"zoneinfo/America/Port_of_Spain.json\",\"zoneinfo/America/Porto_Acre.json\",\"zoneinfo/America/Porto_Velho.json\",\"zoneinfo/America/Puerto_Rico.json\",\"zoneinfo/America/Rainy_River.json\",\"zoneinfo/America/Rankin_Inlet.json\",\"zoneinfo/America/Recife.json\",\"zoneinfo/America/Regina.json\",\"zoneinfo/America/Resolute.json\",\"zoneinfo/America/Rio_Branco.json\",\"zoneinfo/America/Rosario.json\",\"zoneinfo/America/Santa_Isabel.json\",\"zoneinfo/America/Santarem.json\",\"zoneinfo/America/Santiago.json\",\"zoneinfo/America/Santo_Domingo.json\",\"zoneinfo/America/Sao_Paulo.json\",\"zoneinfo/America/Scoresbysund.json\",\"zoneinfo/America/Sitka.json\",\"zoneinfo/America/St_Barthelemy.json\",\"zoneinfo/America/St_Johns.json\",\"zoneinfo/America/St_Kitts.json\",\"zoneinfo/America/St_Lucia.json\",\"zoneinfo/America/St_Thomas.json\",\"zoneinfo/America/St_Vincent.json\",\"zoneinfo/America/Swift_Current.json\",\"zoneinfo/America/Tegucigalpa.json\",\"zoneinfo/America/Thule.json\",\"zoneinfo/America/Thunder_Bay.json\",\"zoneinfo/America/Tijuana.json\",\"zoneinfo/America/Toronto.json\",\"zoneinfo/America/Tortola.json\",\"zoneinfo/America/Vancouver.json\",\"zoneinfo/America/Virgin.json\",\"zoneinfo/America/Whitehorse.json\",\"zoneinfo/America/Winnipeg.json\",\"zoneinfo/America/Yakutat.json\",\"zoneinfo/America/Yellowknife.json\",\"zoneinfo/Antarctica/Casey.json\",\"zoneinfo/Antarctica/Davis.json\",\"zoneinfo/Antarctica/DumontDUrville.json\",\"zoneinfo/Antarctica/Macquarie.json\",\"zoneinfo/Antarctica/Mawson.json\",\"zoneinfo/Antarctica/McMurdo.json\",\"zoneinfo/Antarctica/Palmer.json\",\"zoneinfo/Antarctica/Rothera.json\",\"zoneinfo/Antarctica/South_Pole.json\",\"zoneinfo/Antarctica/Syowa.json\",\"zoneinfo/Antarctica/Troll.json\",\"zoneinfo/Antarctica/Vostok.json\",\"zoneinfo/Arctic/Longyearbyen.json\",\"zoneinfo/Asia/Aden.json\",\"zoneinfo/Asia/Almaty.json\",\"zoneinfo/Asia/Amman.json\",\"zoneinfo/Asia/Anadyr.json\",\"zoneinfo/Asia/Aqtau.json\",\"zoneinfo/Asia/Aqtobe.json\",\"zoneinfo/Asia/Ashgabat.json\",\"zoneinfo/Asia/Baghdad.json\",\"zoneinfo/Asia/Bahrain.json\",\"zoneinfo/Asia/Baku.json\",\"zoneinfo/Asia/Bangkok.json\",\"zoneinfo/Asia/Beirut.json\",\"zoneinfo/Asia/Bishkek.json\",\"zoneinfo/Asia/Brunei.json\",\"zoneinfo/Asia/Chita.json\",\"zoneinfo/Asia/Choibalsan.json\",\"zoneinfo/Asia/Chongqing.json\",\"zoneinfo/Asia/Chungking.json\",\"zoneinfo/Asia/Colombo.json\",\"zoneinfo/Asia/Damascus.json\",\"zoneinfo/Asia/Dhaka.json\",\"zoneinfo/Asia/Dili.json\",\"zoneinfo/Asia/Dubai.json\",\"zoneinfo/Asia/Dushanbe.json\",\"zoneinfo/Asia/Gaza.json\",\"zoneinfo/Asia/Hanoi.json\",\"zoneinfo/Asia/Harbin.json\",\"zoneinfo/Asia/Hebron.json\",\"zoneinfo/Asia/Ho_Chi_Minh.json\",\"zoneinfo/Asia/Hong_Kong.json\",\"zoneinfo/Asia/Hovd.json\",\"zoneinfo/Asia/Irkutsk.json\",\"zoneinfo/Asia/Istanbul.json\",\"zoneinfo/Asia/Jakarta.json\",\"zoneinfo/Asia/Jayapura.json\",\"zoneinfo/Asia/Jerusalem.json\",\"zoneinfo/Asia/Kabul.json\",\"zoneinfo/Asia/Kamchatka.json\",\"zoneinfo/Asia/Karachi.json\",\"zoneinfo/Asia/Kashgar.json\",\"zoneinfo/Asia/Kathmandu.json\",\"zoneinfo/Asia/Khandyga.json\",\"zoneinfo/Asia/Kolkata.json\",\"zoneinfo/Asia/Krasnoyarsk.json\",\"zoneinfo/Asia/Kuala_Lumpur.json\",\"zoneinfo/Asia/Kuching.json\",\"zoneinfo/Asia/Kuwait.json\",\"zoneinfo/Asia/Macau.json\",\"zoneinfo/Asia/Magadan.json\",\"zoneinfo/Asia/Makassar.json\",\"zoneinfo/Asia/Manila.json\",\"zoneinfo/Asia/Muscat.json\",\"zoneinfo/Asia/Nicosia.json\",\"zoneinfo/Asia/Novokuznetsk.json\",\"zoneinfo/Asia/Novosibirsk.json\",\"zoneinfo/Asia/Omsk.json\",\"zoneinfo/Asia/Oral.json\",\"zoneinfo/Asia/Phnom_Penh.json\",\"zoneinfo/Asia/Pontianak.json\",\"zoneinfo/Asia/Pyongyang.json\",\"zoneinfo/Asia/Qatar.json\",\"zoneinfo/Asia/Qyzylorda.json\",\"zoneinfo/Asia/Rangoon.json\",\"zoneinfo/Asia/Riyadh.json\",\"zoneinfo/Asia/Saigon.json\",\"zoneinfo/Asia/Sakhalin.json\",\"zoneinfo/Asia/Samarkand.json\",\"zoneinfo/Asia/Seoul.json\",\"zoneinfo/Asia/Shanghai.json\",\"zoneinfo/Asia/Singapore.json\",\"zoneinfo/Asia/Srednekolymsk.json\",\"zoneinfo/Asia/Taipei.json\",\"zoneinfo/Asia/Tashkent.json\",\"zoneinfo/Asia/Tbilisi.json\",\"zoneinfo/Asia/Tehran.json\",\"zoneinfo/Asia/Tel_Aviv.json\",\"zoneinfo/Asia/Thimphu.json\",\"zoneinfo/Asia/Tokyo.json\",\"zoneinfo/Asia/Ulaanbaatar.json\",\"zoneinfo/Asia/Ulan_Bator.json\",\"zoneinfo/Asia/Urumqi.json\",\"zoneinfo/Asia/Ust-Nera.json\",\"zoneinfo/Asia/Vientiane.json\",\"zoneinfo/Asia/Vladivostok.json\",\"zoneinfo/Asia/Yakutsk.json\",\"zoneinfo/Asia/Yekaterinburg.json\",\"zoneinfo/Asia/Yerevan.json\",\"zoneinfo/Atlantic/Azores.json\",\"zoneinfo/Atlantic/Bermuda.json\",\"zoneinfo/Atlantic/Canary.json\",\"zoneinfo/Atlantic/Cape_Verde.json\",\"zoneinfo/Atlantic/Faroe.json\",\"zoneinfo/Atlantic/Jan_Mayen.json\",\"zoneinfo/Atlantic/Madeira.json\",\"zoneinfo/Atlantic/Reykjavik.json\",\"zoneinfo/Atlantic/South_Georgia.json\",\"zoneinfo/Atlantic/St_Helena.json\",\"zoneinfo/Atlantic/Stanley.json\",\"zoneinfo/Australia/Adelaide.json\",\"zoneinfo/Australia/Brisbane.json\",\"zoneinfo/Australia/Broken_Hill.json\",\"zoneinfo/Australia/Currie.json\",\"zoneinfo/Australia/Darwin.json\",\"zoneinfo/Australia/Eucla.json\",\"zoneinfo/Australia/Hobart.json\",\"zoneinfo/Australia/Lindeman.json\",\"zoneinfo/Australia/Lord_Howe.json\",\"zoneinfo/Australia/Melbourne.json\",\"zoneinfo/Australia/Perth.json\",\"zoneinfo/Australia/Sydney.json\",\"zoneinfo/Brazil/Acre.json\",\"zoneinfo/Brazil/East.json\",\"zoneinfo/CET.json\",\"zoneinfo/CST6CDT.json\",\"zoneinfo/Canada/Central.json\",\"zoneinfo/Canada/Mountain.json\",\"zoneinfo/Canada/Newfoundland.json\",\"zoneinfo/Canada/Pacific.json\",\"zoneinfo/Canada/Yukon.json\",\"zoneinfo/Chile/Continental.json\",\"zoneinfo/EET.json\",\"zoneinfo/EST.json\",\"zoneinfo/EST5EDT.json\",\"zoneinfo/Etc/GMT+1.json\",\"zoneinfo/Etc/GMT+10.json\",\"zoneinfo/Etc/GMT+11.json\",\"zoneinfo/Etc/GMT+12.json\",\"zoneinfo/Etc/GMT+2.json\",\"zoneinfo/Etc/GMT+3.json\",\"zoneinfo/Etc/GMT+4.json\",\"zoneinfo/Etc/GMT+5.json\",\"zoneinfo/Etc/GMT+6.json\",\"zoneinfo/Etc/GMT+7.json\",\"zoneinfo/Etc/GMT+8.json\",\"zoneinfo/Etc/GMT+9.json\",\"zoneinfo/Etc/GMT-1.json\",\"zoneinfo/Etc/GMT-10.json\",\"zoneinfo/Etc/GMT-11.json\",\"zoneinfo/Etc/GMT-12.json\",\"zoneinfo/Etc/GMT-13.json\",\"zoneinfo/Etc/GMT-14.json\",\"zoneinfo/Etc/GMT-2.json\",\"zoneinfo/Etc/GMT-3.json\",\"zoneinfo/Etc/GMT-4.json\",\"zoneinfo/Etc/GMT-5.json\",\"zoneinfo/Etc/GMT-6.json\",\"zoneinfo/Etc/GMT-7.json\",\"zoneinfo/Etc/GMT-8.json\",\"zoneinfo/Etc/GMT-9.json\",\"zoneinfo/Etc/GMT.json\",\"zoneinfo/Etc/UCT.json\",\"zoneinfo/Etc/UTC.json\",\"zoneinfo/Europe/Amsterdam.json\",\"zoneinfo/Europe/Andorra.json\",\"zoneinfo/Europe/Athens.json\",\"zoneinfo/Europe/Belfast.json\",\"zoneinfo/Europe/Belgrade.json\",\"zoneinfo/Europe/Berlin.json\",\"zoneinfo/Europe/Bratislava.json\",\"zoneinfo/Europe/Brussels.json\",\"zoneinfo/Europe/Bucharest.json\",\"zoneinfo/Europe/Budapest.json\",\"zoneinfo/Europe/Chisinau.json\",\"zoneinfo/Europe/Copenhagen.json\",\"zoneinfo/Europe/Dublin.json\",\"zoneinfo/Europe/Gibraltar.json\",\"zoneinfo/Europe/Guernsey.json\",\"zoneinfo/Europe/Helsinki.json\",\"zoneinfo/Europe/Isle_of_Man.json\",\"zoneinfo/Europe/Istanbul.json\",\"zoneinfo/Europe/Jersey.json\",\"zoneinfo/Europe/Kaliningrad.json\",\"zoneinfo/Europe/Kiev.json\",\"zoneinfo/Europe/Lisbon.json\",\"zoneinfo/Europe/Ljubljana.json\",\"zoneinfo/Europe/London.json\",\"zoneinfo/Europe/Luxembourg.json\",\"zoneinfo/Europe/Madrid.json\",\"zoneinfo/Europe/Malta.json\",\"zoneinfo/Europe/Mariehamn.json\",\"zoneinfo/Europe/Minsk.json\",\"zoneinfo/Europe/Monaco.json\",\"zoneinfo/Europe/Moscow.json\",\"zoneinfo/Europe/Nicosia.json\",\"zoneinfo/Europe/Oslo.json\",\"zoneinfo/Europe/Paris.json\",\"zoneinfo/Europe/Podgorica.json\",\"zoneinfo/Europe/Prague.json\",\"zoneinfo/Europe/Riga.json\",\"zoneinfo/Europe/Rome.json\",\"zoneinfo/Europe/Samara.json\",\"zoneinfo/Europe/San_Marino.json\",\"zoneinfo/Europe/Sarajevo.json\",\"zoneinfo/Europe/Simferopol.json\",\"zoneinfo/Europe/Skopje.json\",\"zoneinfo/Europe/Sofia.json\",\"zoneinfo/Europe/Stockholm.json\",\"zoneinfo/Europe/Tallinn.json\",\"zoneinfo/Europe/Tirane.json\",\"zoneinfo/Europe/Tiraspol.json\",\"zoneinfo/Europe/Uzhgorod.json\",\"zoneinfo/Europe/Vaduz.json\",\"zoneinfo/Europe/Vatican.json\",\"zoneinfo/Europe/Vienna.json\",\"zoneinfo/Europe/Vilnius.json\",\"zoneinfo/Europe/Volgograd.json\",\"zoneinfo/Europe/Warsaw.json\",\"zoneinfo/Europe/Zagreb.json\",\"zoneinfo/Europe/Zaporozhye.json\",\"zoneinfo/Europe/Zurich.json\",\"zoneinfo/Factory.json\",\"zoneinfo/HST.json\",\"zoneinfo/Iceland.json\",\"zoneinfo/Indian/Antananarivo.json\",\"zoneinfo/Indian/Chagos.json\",\"zoneinfo/Indian/Christmas.json\",\"zoneinfo/Indian/Cocos.json\",\"zoneinfo/Indian/Comoro.json\",\"zoneinfo/Indian/Kerguelen.json\",\"zoneinfo/Indian/Mahe.json\",\"zoneinfo/Indian/Maldives.json\",\"zoneinfo/Indian/Mauritius.json\",\"zoneinfo/Indian/Mayotte.json\",\"zoneinfo/Indian/Reunion.json\",\"zoneinfo/MET.json\",\"zoneinfo/MST.json\",\"zoneinfo/MST7MDT.json\",\"zoneinfo/Mexico/BajaSur.json\",\"zoneinfo/Mexico/General.json\",\"zoneinfo/PST8PDT.json\",\"zoneinfo/Pacific/Apia.json\",\"zoneinfo/Pacific/Auckland.json\",\"zoneinfo/Pacific/Bougainville.json\",\"zoneinfo/Pacific/Chatham.json\",\"zoneinfo/Pacific/Chuuk.json\",\"zoneinfo/Pacific/Easter.json\",\"zoneinfo/Pacific/Efate.json\",\"zoneinfo/Pacific/Enderbury.json\",\"zoneinfo/Pacific/Fakaofo.json\",\"zoneinfo/Pacific/Fiji.json\",\"zoneinfo/Pacific/Funafuti.json\",\"zoneinfo/Pacific/Galapagos.json\",\"zoneinfo/Pacific/Gambier.json\",\"zoneinfo/Pacific/Guadalcanal.json\",\"zoneinfo/Pacific/Guam.json\",\"zoneinfo/Pacific/Honolulu.json\",\"zoneinfo/Pacific/Johnston.json\",\"zoneinfo/Pacific/Kiritimati.json\",\"zoneinfo/Pacific/Kosrae.json\",\"zoneinfo/Pacific/Kwajalein.json\",\"zoneinfo/Pacific/Majuro.json\",\"zoneinfo/Pacific/Marquesas.json\",\"zoneinfo/Pacific/Midway.json\",\"zoneinfo/Pacific/Nauru.json\",\"zoneinfo/Pacific/Niue.json\",\"zoneinfo/Pacific/Norfolk.json\",\"zoneinfo/Pacific/Noumea.json\",\"zoneinfo/Pacific/Pago_Pago.json\",\"zoneinfo/Pacific/Palau.json\",\"zoneinfo/Pacific/Pitcairn.json\",\"zoneinfo/Pacific/Pohnpei.json\",\"zoneinfo/Pacific/Port_Moresby.json\",\"zoneinfo/Pacific/Rarotonga.json\",\"zoneinfo/Pacific/Saipan.json\",\"zoneinfo/Pacific/Tahiti.json\",\"zoneinfo/Pacific/Tarawa.json\",\"zoneinfo/Pacific/Tongatapu.json\",\"zoneinfo/Pacific/Wake.json\",\"zoneinfo/Pacific/Wallis.json\",\"zoneinfo/US/Alaska.json\",\"zoneinfo/US/East-Indiana.json\",\"zoneinfo/US/Eastern.json\",\"zoneinfo/US/Hawaii.json\",\"zoneinfo/US/Indiana-Starke.json\",\"zoneinfo/US/Pacific.json\",\"zoneinfo/WET.json\",\"zoneinfo/zonetab.json\",\"zu/ZA/unitfmt.json\",\"zu/ctrynames.json\",\"zu/dateformats.json\",\"zu/localeinfo.json\",\"zu/plurals.json\",\"zu/sysres.json\",\"zu/unitfmt.json\",\"zun/localeinfo.json\",\"zxx/Cyrl/pseudomap.json\",\"zxx/Hans/pseudomap.json\",\"zxx/Hebr/pseudomap.json\",\"zxx/dateformats.json\",\"zxx/localeinfo.json\",\"zxx/name.json\",\"zza/localeinfo.json\"]}\n"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/enyo-ilib/ilib/locale/scripts.json",
    "content": "{\"Afak\":{\"nb\":439,\"nm\":\"Afaka\",\"lid\":\"Afaka\"},\"Aghb\":{\"nb\":239,\"nm\":\"Caucasian Albanian\",\"lid\":\"Caucasian_Albanian\"},\"Arab\":{\"nb\":160,\"nm\":\"Arabic\",\"lid\":\"Arabic\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Armi\":{\"nb\":124,\"nm\":\"Imperial Aramaic\",\"lid\":\"Imperial_Aramaic\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Armn\":{\"nb\":230,\"nm\":\"Armenian\",\"lid\":\"Armenian\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Avst\":{\"nb\":134,\"nm\":\"Avestan\",\"lid\":\"Avestan\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Bali\":{\"nb\":360,\"nm\":\"Balinese\",\"lid\":\"Balinese\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Bamu\":{\"nb\":435,\"nm\":\"Bamum\",\"lid\":\"Bamum\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Bass\":{\"nb\":259,\"nm\":\"Bassa Vah\",\"lid\":\"Bassa_Vah\"},\"Batk\":{\"nb\":365,\"nm\":\"Batak\",\"lid\":\"Batak\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Beng\":{\"nb\":325,\"nm\":\"Bengali\",\"lid\":\"Bengali\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Blis\":{\"nb\":550,\"nm\":\"Blissymbols\",\"lid\":\"Blissymbols\"},\"Bopo\":{\"nb\":285,\"nm\":\"Bopomofo\",\"lid\":\"Bopomofo\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Brah\":{\"nb\":300,\"nm\":\"Brahmi\",\"lid\":\"Brahmi\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Brai\":{\"nb\":570,\"nm\":\"Braille\",\"lid\":\"Braille\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Bugi\":{\"nb\":367,\"nm\":\"Buginese\",\"lid\":\"Buginese\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Buhd\":{\"nb\":372,\"nm\":\"Buhid\",\"lid\":\"Buhid\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Cakm\":{\"nb\":349,\"nm\":\"Chakma\",\"lid\":\"Chakma\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Cans\":{\"nb\":440,\"nm\":\"Unified Canadian Aboriginal Syllabics\",\"lid\":\"Canadian_Aboriginal\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Cari\":{\"nb\":201,\"nm\":\"Carian\",\"lid\":\"Carian\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Cham\":{\"nb\":358,\"nm\":\"Cham\",\"lid\":\"Cham\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Cher\":{\"nb\":445,\"nm\":\"Cherokee\",\"lid\":\"Cherokee\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Cirt\":{\"nb\":291,\"nm\":\"Cirth\",\"lid\":\"Cirth\"},\"Copt\":{\"nb\":204,\"nm\":\"Coptic\",\"lid\":\"Coptic\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Cprt\":{\"nb\":403,\"nm\":\"Cypriot\",\"lid\":\"Cypriot\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Cyrl\":{\"nb\":220,\"nm\":\"Cyrillic\",\"lid\":\"Cyrillic\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Cyrs\":{\"nb\":221,\"nm\":\"Cyrillic (Old Church Slavonic variant)\",\"lid\":\"Cyrillic_(Old_Church_Slavonic_variant)\"},\"Deva\":{\"nb\":315,\"nm\":\"Devanagari (Nagari)\",\"lid\":\"Devanagari\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Dsrt\":{\"nb\":250,\"nm\":\"Deseret (Mormon)\",\"lid\":\"Deseret\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Dupl\":{\"nb\":755,\"nm\":\"Duployan shorthand, Duployan stenography\",\"lid\":\"Duployan_shorthand,_Duployan_stenography\"},\"Egyd\":{\"nb\":70,\"nm\":\"Egyptian demotic\",\"lid\":\"Egyptian_demotic\"},\"Egyh\":{\"nb\":60,\"nm\":\"Egyptian hieratic\",\"lid\":\"Egyptian_hieratic\"},\"Egyp\":{\"nb\":50,\"nm\":\"Egyptian hieroglyphs\",\"lid\":\"Egyptian_Hieroglyphs\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Elba\":{\"nb\":226,\"nm\":\"Elbasan\",\"lid\":\"Elbasan\"},\"Ethi\":{\"nb\":430,\"nm\":\"Ethiopic (Geʻez)\",\"lid\":\"Ethiopic\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Geor\":{\"nb\":240,\"nm\":\"Georgian (Mkhedruli)\",\"lid\":\"Georgian\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Geok\":{\"nb\":241,\"nm\":\"Khutsuri (Asomtavruli and Nuskhuri)\",\"lid\":\"Georgian\"},\"Glag\":{\"nb\":225,\"nm\":\"Glagolitic\",\"lid\":\"Glagolitic\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Goth\":{\"nb\":206,\"nm\":\"Gothic\",\"lid\":\"Gothic\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Gran\":{\"nb\":343,\"nm\":\"Grantha\",\"lid\":\"Grantha\"},\"Grek\":{\"nb\":200,\"nm\":\"Greek\",\"lid\":\"Greek\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Gujr\":{\"nb\":320,\"nm\":\"Gujarati\",\"lid\":\"Gujarati\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Guru\":{\"nb\":310,\"nm\":\"Gurmukhi\",\"lid\":\"Gurmukhi\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Hang\":{\"nb\":286,\"nm\":\"Hangul (Hangŭl, Hangeul)\",\"lid\":\"Hangul\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Hani\":{\"nb\":500,\"nm\":\"Han (Hanzi, Kanji, Hanja)\",\"lid\":\"Han\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Hano\":{\"nb\":371,\"nm\":\"Hanunoo (Hanunóo)\",\"lid\":\"Hanunoo\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Hans\":{\"nb\":501,\"nm\":\"Han (Simplified variant)\",\"lid\":\"Han_(Simplified_variant)\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Hant\":{\"nb\":502,\"nm\":\"Han (Traditional variant)\",\"lid\":\"Han_(Traditional_variant)\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Hebr\":{\"nb\":125,\"nm\":\"Hebrew\",\"lid\":\"Hebrew\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Hira\":{\"nb\":410,\"nm\":\"Hiragana\",\"lid\":\"Hiragana\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Hluw\":{\"nb\":80,\"nm\":\"Anatolian Hieroglyphs (Luwian Hieroglyphs, Hittite Hieroglyphs)\",\"lid\":\"Anatolian_Hieroglyphs_(Luwian_Hieroglyphs,_Hittite_Hieroglyphs)\"},\"Hmng\":{\"nb\":450,\"nm\":\"Pahawh Hmong\",\"lid\":\"Pahawh_Hmong\"},\"Hrkt\":{\"nb\":412,\"nm\":\"Japanese syllabaries (alias for Hiragana + Katakana)\",\"lid\":\"Katakana_Or_Hiragana\"},\"Hung\":{\"nb\":176,\"nm\":\"Old Hungarian (Hungarian Runic)\",\"lid\":\"Old_Hungarian_(Hungarian_Runic)\"},\"Inds\":{\"nb\":610,\"nm\":\"Indus (Harappan)\",\"lid\":\"Indus_(Harappan)\"},\"Ital\":{\"nb\":210,\"nm\":\"Old Italic (Etruscan, Oscan, etc.)\",\"lid\":\"Old_Italic\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Java\":{\"nb\":361,\"nm\":\"Javanese\",\"lid\":\"Javanese\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Jpan\":{\"nb\":413,\"nm\":\"Japanese (alias for Han + Hiragana + Katakana)\",\"lid\":\"Japanese_(alias_for_Han_+_Hiragana_+_Katakana)\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Jurc\":{\"nb\":510,\"nm\":\"Jurchen\",\"lid\":\"Jurchen\"},\"Kali\":{\"nb\":357,\"nm\":\"Kayah Li\",\"lid\":\"Kayah_Li\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Kana\":{\"nb\":411,\"nm\":\"Katakana\",\"lid\":\"Katakana\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Khar\":{\"nb\":305,\"nm\":\"Kharoshthi\",\"lid\":\"Kharoshthi\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Khmr\":{\"nb\":355,\"nm\":\"Khmer\",\"lid\":\"Khmer\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Khoj\":{\"nb\":322,\"nm\":\"Khojki\",\"lid\":\"Khojki\"},\"Knda\":{\"nb\":345,\"nm\":\"Kannada\",\"lid\":\"Kannada\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Kore\":{\"nb\":287,\"nm\":\"Korean (alias for Hangul + Han)\",\"lid\":\"Korean_(alias_for_Hangul_+_Han)\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Kpel\":{\"nb\":436,\"nm\":\"Kpelle\",\"lid\":\"Kpelle\"},\"Kthi\":{\"nb\":317,\"nm\":\"Kaithi\",\"lid\":\"Kaithi\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Lana\":{\"nb\":351,\"nm\":\"Tai Tham (Lanna)\",\"lid\":\"Tai_Tham\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Laoo\":{\"nb\":356,\"nm\":\"Lao\",\"lid\":\"Lao\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Latf\":{\"nb\":217,\"nm\":\"Latin (Fraktur variant)\",\"lid\":\"Latin_(Fraktur_variant)\"},\"Latg\":{\"nb\":216,\"nm\":\"Latin (Gaelic variant)\",\"lid\":\"Latin_(Gaelic_variant)\"},\"Latn\":{\"nb\":215,\"nm\":\"Latin\",\"lid\":\"Latin\",\"rtl\":false,\"ime\":false,\"casing\":true},\"Lepc\":{\"nb\":335,\"nm\":\"Lepcha (Róng)\",\"lid\":\"Lepcha\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Limb\":{\"nb\":336,\"nm\":\"Limbu\",\"lid\":\"Limbu\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Lina\":{\"nb\":400,\"nm\":\"Linear A\",\"lid\":\"Linear_A\"},\"Linb\":{\"nb\":401,\"nm\":\"Linear B\",\"lid\":\"Linear_B\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Lisu\":{\"nb\":399,\"nm\":\"Lisu (Fraser)\",\"lid\":\"Lisu\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Loma\":{\"nb\":437,\"nm\":\"Loma\",\"lid\":\"Loma\"},\"Lyci\":{\"nb\":202,\"nm\":\"Lycian\",\"lid\":\"Lycian\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Lydi\":{\"nb\":116,\"nm\":\"Lydian\",\"lid\":\"Lydian\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Mahj\":{\"nb\":314,\"nm\":\"Mahajani\",\"lid\":\"Mahajani\"},\"Mand\":{\"nb\":140,\"nm\":\"Mandaic, Mandaean\",\"lid\":\"Mandaic\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Mani\":{\"nb\":139,\"nm\":\"Manichaean\",\"lid\":\"Manichaean\"},\"Maya\":{\"nb\":90,\"nm\":\"Mayan hieroglyphs\",\"lid\":\"Mayan_hieroglyphs\"},\"Mend\":{\"nb\":438,\"nm\":\"Mende\",\"lid\":\"Mende\"},\"Merc\":{\"nb\":101,\"nm\":\"Meroitic Cursive\",\"lid\":\"Meroitic_Cursive\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Mero\":{\"nb\":100,\"nm\":\"Meroitic Hieroglyphs\",\"lid\":\"Meroitic_Hieroglyphs\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Mlym\":{\"nb\":347,\"nm\":\"Malayalam\",\"lid\":\"Malayalam\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Moon\":{\"nb\":218,\"nm\":\"Moon (Moon code, Moon script, Moon type)\",\"lid\":\"Moon_(Moon_code,_Moon_script,_Moon_type)\"},\"Mong\":{\"nb\":145,\"nm\":\"Mongolian\",\"lid\":\"Mongolian\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Mroo\":{\"nb\":199,\"nm\":\"Mro, Mru\",\"lid\":\"Mro,_Mru\"},\"Mtei\":{\"nb\":337,\"nm\":\"Meitei Mayek (Meithei, Meetei)\",\"lid\":\"Meetei_Mayek\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Mymr\":{\"nb\":350,\"nm\":\"Myanmar (Burmese)\",\"lid\":\"Myanmar\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Narb\":{\"nb\":106,\"nm\":\"Old North Arabian (Ancient North Arabian)\",\"lid\":\"Old_North_Arabian_(Ancient_North_Arabian)\"},\"Nbat\":{\"nb\":159,\"nm\":\"Nabataean\",\"lid\":\"Nabataean\"},\"Nkgb\":{\"nb\":420,\"nm\":\"Nakhi Geba ('Na-'Khi ²Ggŏ-¹baw, Naxi Geba)\",\"lid\":\"Nakhi_Geba_('Na-'Khi_²Ggŏ-¹baw,_Naxi_Geba)\"},\"Nkoo\":{\"nb\":165,\"nm\":\"N’Ko\",\"lid\":\"Nko\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Nshu\":{\"nb\":499,\"nm\":\"Nüshu\",\"lid\":\"Nüshu\"},\"Ogam\":{\"nb\":212,\"nm\":\"Ogham\",\"lid\":\"Ogham\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Olck\":{\"nb\":261,\"nm\":\"Ol Chiki (Ol Cemet’, Ol, Santali)\",\"lid\":\"Ol_Chiki\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Orkh\":{\"nb\":175,\"nm\":\"Old Turkic, Orkhon Runic\",\"lid\":\"Old_Turkic\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Orya\":{\"nb\":327,\"nm\":\"Oriya\",\"lid\":\"Oriya\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Osma\":{\"nb\":260,\"nm\":\"Osmanya\",\"lid\":\"Osmanya\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Palm\":{\"nb\":126,\"nm\":\"Palmyrene\",\"lid\":\"Palmyrene\"},\"Perm\":{\"nb\":227,\"nm\":\"Old Permic\",\"lid\":\"Old_Permic\"},\"Phag\":{\"nb\":331,\"nm\":\"Phags-pa\",\"lid\":\"Phags_Pa\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Phli\":{\"nb\":131,\"nm\":\"Inscriptional Pahlavi\",\"lid\":\"Inscriptional_Pahlavi\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Phlp\":{\"nb\":132,\"nm\":\"Psalter Pahlavi\",\"lid\":\"Psalter_Pahlavi\"},\"Phlv\":{\"nb\":133,\"nm\":\"Book Pahlavi\",\"lid\":\"Book_Pahlavi\"},\"Phnx\":{\"nb\":115,\"nm\":\"Phoenician\",\"lid\":\"Phoenician\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Plrd\":{\"nb\":282,\"nm\":\"Miao (Pollard)\",\"lid\":\"Miao\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Prti\":{\"nb\":130,\"nm\":\"Inscriptional Parthian\",\"lid\":\"Inscriptional_Parthian\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Qaaa\":{\"nb\":900,\"nm\":\"Reserved for private use (start)\",\"lid\":\"Reserved_for_private_use_(start)\"},\"Qabx\":{\"nb\":949,\"nm\":\"Reserved for private use (end)\",\"lid\":\"Reserved_for_private_use_(end)\"},\"Rjng\":{\"nb\":363,\"nm\":\"Rejang (Redjang, Kaganga)\",\"lid\":\"Rejang\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Roro\":{\"nb\":620,\"nm\":\"Rongorongo\",\"lid\":\"Rongorongo\"},\"Runr\":{\"nb\":211,\"nm\":\"Runic\",\"lid\":\"Runic\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Samr\":{\"nb\":123,\"nm\":\"Samaritan\",\"lid\":\"Samaritan\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Sara\":{\"nb\":292,\"nm\":\"Sarati\",\"lid\":\"Sarati\"},\"Sarb\":{\"nb\":105,\"nm\":\"Old South Arabian\",\"lid\":\"Old_South_Arabian\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Saur\":{\"nb\":344,\"nm\":\"Saurashtra\",\"lid\":\"Saurashtra\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Sgnw\":{\"nb\":95,\"nm\":\"SignWriting\",\"lid\":\"SignWriting\"},\"Shaw\":{\"nb\":281,\"nm\":\"Shavian (Shaw)\",\"lid\":\"Shavian\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Shrd\":{\"nb\":319,\"nm\":\"Sharada, Śāradā\",\"lid\":\"Sharada\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Sind\":{\"nb\":318,\"nm\":\"Khudawadi, Sindhi\",\"lid\":\"Khudawadi,_Sindhi\"},\"Sinh\":{\"nb\":348,\"nm\":\"Sinhala\",\"lid\":\"Sinhala\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Sora\":{\"nb\":398,\"nm\":\"Sora Sompeng\",\"lid\":\"Sora_Sompeng\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Sund\":{\"nb\":362,\"nm\":\"Sundanese\",\"lid\":\"Sundanese\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Sylo\":{\"nb\":316,\"nm\":\"Syloti Nagri\",\"lid\":\"Syloti_Nagri\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Syrc\":{\"nb\":135,\"nm\":\"Syriac\",\"lid\":\"Syriac\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Syre\":{\"nb\":138,\"nm\":\"Syriac (Estrangelo variant)\",\"lid\":\"Syriac_(Estrangelo_variant)\"},\"Syrj\":{\"nb\":137,\"nm\":\"Syriac (Western variant)\",\"lid\":\"Syriac_(Western_variant)\"},\"Syrn\":{\"nb\":136,\"nm\":\"Syriac (Eastern variant)\",\"lid\":\"Syriac_(Eastern_variant)\"},\"Tagb\":{\"nb\":373,\"nm\":\"Tagbanwa\",\"lid\":\"Tagbanwa\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Takr\":{\"nb\":321,\"nm\":\"Takri, Ṭākrī, Ṭāṅkrī\",\"lid\":\"Takri\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Tale\":{\"nb\":353,\"nm\":\"Tai Le\",\"lid\":\"Tai_Le\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Talu\":{\"nb\":354,\"nm\":\"New Tai Lue\",\"lid\":\"New_Tai_Lue\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Taml\":{\"nb\":346,\"nm\":\"Tamil\",\"lid\":\"Tamil\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Tang\":{\"nb\":520,\"nm\":\"Tangut\",\"lid\":\"Tangut\"},\"Tavt\":{\"nb\":359,\"nm\":\"Tai Viet\",\"lid\":\"Tai_Viet\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Telu\":{\"nb\":340,\"nm\":\"Telugu\",\"lid\":\"Telugu\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Teng\":{\"nb\":290,\"nm\":\"Tengwar\",\"lid\":\"Tengwar\"},\"Tfng\":{\"nb\":120,\"nm\":\"Tifinagh (Berber)\",\"lid\":\"Tifinagh\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Tglg\":{\"nb\":370,\"nm\":\"Tagalog (Baybayin, Alibata)\",\"lid\":\"Tagalog\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Thaa\":{\"nb\":170,\"nm\":\"Thaana\",\"lid\":\"Thaana\",\"rtl\":true,\"ime\":false,\"casing\":false},\"Thai\":{\"nb\":352,\"nm\":\"Thai\",\"lid\":\"Thai\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Tibt\":{\"nb\":330,\"nm\":\"Tibetan\",\"lid\":\"Tibetan\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Tirh\":{\"nb\":326,\"nm\":\"Tirhuta\",\"lid\":\"Tirhuta\"},\"Ugar\":{\"nb\":40,\"nm\":\"Ugaritic\",\"lid\":\"Ugaritic\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Vaii\":{\"nb\":470,\"nm\":\"Vai\",\"lid\":\"Vai\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Visp\":{\"nb\":280,\"nm\":\"Visible Speech\",\"lid\":\"Visible_Speech\"},\"Wara\":{\"nb\":262,\"nm\":\"Warang Citi (Varang Kshiti)\",\"lid\":\"Warang_Citi_(Varang_Kshiti)\"},\"Wole\":{\"nb\":480,\"nm\":\"Woleai\",\"lid\":\"Woleai\"},\"Xpeo\":{\"nb\":30,\"nm\":\"Old Persian\",\"lid\":\"Old_Persian\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Xsux\":{\"nb\":20,\"nm\":\"Cuneiform, Sumero-Akkadian\",\"lid\":\"Cuneiform\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Yiii\":{\"nb\":460,\"nm\":\"Yi\",\"lid\":\"Yi\",\"rtl\":false,\"ime\":true,\"casing\":false},\"Zinh\":{\"nb\":994,\"nm\":\"Code for inherited script\",\"lid\":\"Inherited\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Zmth\":{\"nb\":995,\"nm\":\"Mathematical notation\",\"lid\":\"Mathematical_notation\"},\"Zsym\":{\"nb\":996,\"nm\":\"Symbols\",\"lid\":\"Symbols\"},\"Zxxx\":{\"nb\":997,\"nm\":\"Code for unwritten documents\",\"lid\":\"Code_for_unwritten_documents\"},\"Zyyy\":{\"nb\":998,\"nm\":\"Code for undetermined script\",\"lid\":\"Common\",\"rtl\":false,\"ime\":false,\"casing\":false},\"Zzzz\":{\"nb\":999,\"nm\":\"Code for uncoded script\",\"lid\":\"Unknown\",\"rtl\":false,\"ime\":false,\"casing\":false}}"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/enyo-ilib/ilib/locale/und/CN/localeinfo.json",
    "content": "{\"currency\":\"CNY\",\"firstDayOfWeek\":0,\"region.name\":\"China\",\"timezone\":\"Asia/Shanghai\",\"locale\":\"CN\"}"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/enyo-ilib.js",
    "content": "// ../lib/enyo-ilib/version.js\r\nenyo && enyo.version && (enyo.version[\"enyo-ilib\"] = \"2.6.0-pre.4.dev\");\r\n\r\n// ../lib/enyo-ilib/ilib/js/ilib-dyn-standard.js\r\nvar ilib = ilib || {};\r\nilib.getVersion = function() {\r\n    return \"10.0\"\r\n},\r\nilib.data = {\r\n    norm: {\r\n        nfc: {},\r\n        nfd: {},\r\n        nfkd: {},\r\n        ccc: {}\r\n    },\r\n    zoneinfo: {\r\n        \"Etc/UTC\": {\r\n            o: \"0:0\",\r\n            f: \"UTC\"\r\n        },\r\n        local: {\r\n            f: \"local\"\r\n        }\r\n    },\r\n    ctype: null,\r\n    ctype_c: null,\r\n    ctype_l: null,\r\n    ctype_m: null,\r\n    ctype_p: null,\r\n    ctype_z: null,\r\n    scriptToRange: null,\r\n    dateformats: null\r\n},\r\n\"undefined\" != typeof window && (window.ilib = ilib),\r\n\"undefined\" != typeof exports && (exports.ilib = ilib),\r\nilib.pseudoLocales = [\"zxx-XX\"],\r\nilib.setAsPseudoLocale = function(t) {\r\n    t && ilib.pseudoLocales.push(t)\r\n},\r\nilib.clearPseudoLocales = function() {\r\n    ilib.pseudoLocales = [\"zxx-XX\"]\r\n},\r\nilib._getPlatform = function() {\r\n    return ilib._platform || (ilib._platform = \"undefined\" != typeof environment ? \"rhino\": \"undefined\" != typeof process || \"undefined\" != typeof require ? \"nodejs\": \"undefined\" != typeof window ? \"undefined\" != typeof PalmSystem ? \"webos\": \"browser\": \"unknown\"),\r\n    ilib._platform\r\n},\r\nilib._isGlobal = function(t) {\r\n    switch (ilib._getPlatform()) {\r\n    case \"rhino\":\r\n        var e = function() {\r\n            return \"object\" == typeof global ? global: this\r\n        } ();\r\n        return void 0 !== typeof e[t];\r\n    case \"nodejs\":\r\n        var i = \"undefined\" != typeof global ? global: this;\r\n        return i && void 0 !== typeof i[t];\r\n    default:\r\n        return void 0 !== typeof window[t]\r\n    }\r\n},\r\nilib.setLocale = function(t) {\r\n    \"string\" != typeof t && t || (ilib.locale = t)\r\n},\r\nilib.getLocale = function() {\r\n    if (\"string\" != typeof ilib.locale) {\r\n        if (\"undefined\" != typeof navigator && navigator.language !== void 0) {\r\n            if (ilib.locale = navigator.language, !ilib.locale) {\r\n                var t = navigator.browserLanguage !== void 0 ? navigator.browserLanguage: navigator.userLanguage !== void 0 ? navigator.userLanguage: navigator.systemLanguage !== void 0 ? navigator.systemLanguage: void 0;\r\n                t !== void 0 && t && (ilib.locale = t.substring(0, 3) + t.substring(3, 5).toUpperCase())\r\n            }\r\n        } else if (\"undefined\" != typeof PalmSystem && PalmSystem.locales !== void 0) PalmSystem.locales.UI !== void 0 && PalmSystem.locales.UI.length > 0 && (ilib.locale = PalmSystem.locales.UI);\r\n        else if (\"undefined\" != typeof environment && environment.user !== void 0)\"string\" == typeof environment.user.language && environment.user.language.length > 0 && (ilib.locale = environment.user.language, \"string\" == typeof environment.user.country && environment.user.country.length > 0 && (ilib.locale += \"-\" + environment.user.country));\r\n        else if (\"undefined\" != typeof process && process.env !== void 0) {\r\n            var t = process.env.LANG || process.env.LC_ALL;\r\n            t && \"undefined\" !== t && (ilib.locale = t.substring(0, 2).toLowerCase() + \"-\" + t.substring(3, 5).toUpperCase())\r\n        }\r\n        ilib.locale = \"string\" == typeof ilib.locale ? ilib.locale: \"en-US\"\r\n    }\r\n    return ilib.locale\r\n},\r\nilib.setTimeZone = function(t) {\r\n    ilib.tz = t || ilib.tz\r\n},\r\nilib.getTimeZone = function() {\r\n    return ilib.tz === void 0 && (\"undefined\" != typeof navigator && navigator.timezone !== void 0 ? navigator.timezone.length > 0 && (ilib.tz = navigator.timezone) : \"undefined\" != typeof PalmSystem && PalmSystem.timezone !== void 0 ? PalmSystem.timezone.length > 0 && (ilib.tz = PalmSystem.timezone) : \"undefined\" != typeof environment && environment.user !== void 0 ? environment.user.timezone !== void 0 && environment.user.timezone.length > 0 && (ilib.tz = environment.user.timezone) : \"undefined\" != typeof process && process.env !== void 0 && process.env.TZ && \"undefined\" !== process.env.TZ && (ilib.tz = process.env.TZ), ilib.tz = ilib.tz || \"local\"),\r\n    ilib.tz\r\n},\r\nilib.Loader = function() {},\r\nilib.Loader.prototype.loadFiles = function() {},\r\nilib.Loader.prototype.listAvailableFiles = function() {},\r\nilib.Loader.prototype.isAvailable = function() {},\r\nilib.setLoaderCallback = function(t) {\r\n    return \"object\" == typeof t && t instanceof ilib.Loader || \"function\" == typeof t || t === void 0 ? (ilib._load = t, !0) : !1\r\n},\r\nilib.Locale = function(t, e, i, n) {\r\n    if (e === void 0) {\r\n        var o = t || ilib.getLocale();\r\n        if (\"string\" == typeof o) {\r\n            for (var s = o.split(\"-\"), a = 0; s.length > a; a++) ilib.Locale._isLanguageCode(s[a]) ? this.language = s[a] : ilib.Locale._isRegionCode(s[a]) ? this.region = s[a] : ilib.Locale._isScriptCode(s[a]) ? this.script = s[a] : this.variant = s[a];\r\n            this.language = this.language || void 0,\r\n            this.region = this.region || void 0,\r\n            this.script = this.script || void 0,\r\n            this.variant = this.variant || void 0\r\n        } else \"object\" == typeof o && (this.language = o.language || void 0, this.region = o.region || void 0, this.script = o.script || void 0, this.variant = o.variant || void 0)\r\n    } else t ? (t = t.trim(), this.language = t.length > 0 ? t.toLowerCase() : void 0) : this.language = void 0,\r\n    e ? (e = e.trim(), this.region = e.length > 0 ? e.toUpperCase() : void 0) : this.region = void 0,\r\n    i ? (i = i.trim(), this.variant = i.length > 0 ? i: void 0) : this.variant = void 0,\r\n    n ? (n = n.trim(), this.script = n.length > 0 ? n: void 0) : this.script = void 0;\r\n    this._genSpec()\r\n},\r\nilib.Locale.a2toa3regmap = {\r\n    AF: \"AFG\",\r\n    AX: \"ALA\",\r\n    AL: \"ALB\",\r\n    DZ: \"DZA\",\r\n    AS: \"ASM\",\r\n    AD: \"AND\",\r\n    AO: \"AGO\",\r\n    AI: \"AIA\",\r\n    AQ: \"ATA\",\r\n    AG: \"ATG\",\r\n    AR: \"ARG\",\r\n    AM: \"ARM\",\r\n    AW: \"ABW\",\r\n    AU: \"AUS\",\r\n    AT: \"AUT\",\r\n    AZ: \"AZE\",\r\n    BS: \"BHS\",\r\n    BH: \"BHR\",\r\n    BD: \"BGD\",\r\n    BB: \"BRB\",\r\n    BY: \"BLR\",\r\n    BE: \"BEL\",\r\n    BZ: \"BLZ\",\r\n    BJ: \"BEN\",\r\n    BM: \"BMU\",\r\n    BT: \"BTN\",\r\n    BO: \"BOL\",\r\n    BQ: \"BES\",\r\n    BA: \"BIH\",\r\n    BW: \"BWA\",\r\n    BV: \"BVT\",\r\n    BR: \"BRA\",\r\n    IO: \"IOT\",\r\n    BN: \"BRN\",\r\n    BG: \"BGR\",\r\n    BF: \"BFA\",\r\n    BI: \"BDI\",\r\n    KH: \"KHM\",\r\n    CM: \"CMR\",\r\n    CA: \"CAN\",\r\n    CV: \"CPV\",\r\n    KY: \"CYM\",\r\n    CF: \"CAF\",\r\n    TD: \"TCD\",\r\n    CL: \"CHL\",\r\n    CN: \"CHN\",\r\n    CX: \"CXR\",\r\n    CC: \"CCK\",\r\n    CO: \"COL\",\r\n    KM: \"COM\",\r\n    CG: \"COG\",\r\n    CD: \"COD\",\r\n    CK: \"COK\",\r\n    CR: \"CRI\",\r\n    CI: \"CIV\",\r\n    HR: \"HRV\",\r\n    CU: \"CUB\",\r\n    CW: \"CUW\",\r\n    CY: \"CYP\",\r\n    CZ: \"CZE\",\r\n    DK: \"DNK\",\r\n    DJ: \"DJI\",\r\n    DM: \"DMA\",\r\n    DO: \"DOM\",\r\n    EC: \"ECU\",\r\n    EG: \"EGY\",\r\n    SV: \"SLV\",\r\n    GQ: \"GNQ\",\r\n    ER: \"ERI\",\r\n    EE: \"EST\",\r\n    ET: \"ETH\",\r\n    FK: \"FLK\",\r\n    FO: \"FRO\",\r\n    FJ: \"FJI\",\r\n    FI: \"FIN\",\r\n    FR: \"FRA\",\r\n    GF: \"GUF\",\r\n    PF: \"PYF\",\r\n    TF: \"ATF\",\r\n    GA: \"GAB\",\r\n    GM: \"GMB\",\r\n    GE: \"GEO\",\r\n    DE: \"DEU\",\r\n    GH: \"GHA\",\r\n    GI: \"GIB\",\r\n    GR: \"GRC\",\r\n    GL: \"GRL\",\r\n    GD: \"GRD\",\r\n    GP: \"GLP\",\r\n    GU: \"GUM\",\r\n    GT: \"GTM\",\r\n    GG: \"GGY\",\r\n    GN: \"GIN\",\r\n    GW: \"GNB\",\r\n    GY: \"GUY\",\r\n    HT: \"HTI\",\r\n    HM: \"HMD\",\r\n    VA: \"VAT\",\r\n    HN: \"HND\",\r\n    HK: \"HKG\",\r\n    HU: \"HUN\",\r\n    IS: \"ISL\",\r\n    IN: \"IND\",\r\n    ID: \"IDN\",\r\n    IR: \"IRN\",\r\n    IQ: \"IRQ\",\r\n    IE: \"IRL\",\r\n    IM: \"IMN\",\r\n    IL: \"ISR\",\r\n    IT: \"ITA\",\r\n    JM: \"JAM\",\r\n    JP: \"JPN\",\r\n    JE: \"JEY\",\r\n    JO: \"JOR\",\r\n    KZ: \"KAZ\",\r\n    KE: \"KEN\",\r\n    KI: \"KIR\",\r\n    KP: \"PRK\",\r\n    KR: \"KOR\",\r\n    KW: \"KWT\",\r\n    KG: \"KGZ\",\r\n    LA: \"LAO\",\r\n    LV: \"LVA\",\r\n    LB: \"LBN\",\r\n    LS: \"LSO\",\r\n    LR: \"LBR\",\r\n    LY: \"LBY\",\r\n    LI: \"LIE\",\r\n    LT: \"LTU\",\r\n    LU: \"LUX\",\r\n    MO: \"MAC\",\r\n    MK: \"MKD\",\r\n    MG: \"MDG\",\r\n    MW: \"MWI\",\r\n    MY: \"MYS\",\r\n    MV: \"MDV\",\r\n    ML: \"MLI\",\r\n    MT: \"MLT\",\r\n    MH: \"MHL\",\r\n    MQ: \"MTQ\",\r\n    MR: \"MRT\",\r\n    MU: \"MUS\",\r\n    YT: \"MYT\",\r\n    MX: \"MEX\",\r\n    FM: \"FSM\",\r\n    MD: \"MDA\",\r\n    MC: \"MCO\",\r\n    MN: \"MNG\",\r\n    ME: \"MNE\",\r\n    MS: \"MSR\",\r\n    MA: \"MAR\",\r\n    MZ: \"MOZ\",\r\n    MM: \"MMR\",\r\n    NA: \"NAM\",\r\n    NR: \"NRU\",\r\n    NP: \"NPL\",\r\n    NL: \"NLD\",\r\n    NC: \"NCL\",\r\n    NZ: \"NZL\",\r\n    NI: \"NIC\",\r\n    NE: \"NER\",\r\n    NG: \"NGA\",\r\n    NU: \"NIU\",\r\n    NF: \"NFK\",\r\n    MP: \"MNP\",\r\n    NO: \"NOR\",\r\n    OM: \"OMN\",\r\n    PK: \"PAK\",\r\n    PW: \"PLW\",\r\n    PS: \"PSE\",\r\n    PA: \"PAN\",\r\n    PG: \"PNG\",\r\n    PY: \"PRY\",\r\n    PE: \"PER\",\r\n    PH: \"PHL\",\r\n    PN: \"PCN\",\r\n    PL: \"POL\",\r\n    PT: \"PRT\",\r\n    PR: \"PRI\",\r\n    QA: \"QAT\",\r\n    RE: \"REU\",\r\n    RO: \"ROU\",\r\n    RU: \"RUS\",\r\n    RW: \"RWA\",\r\n    BL: \"BLM\",\r\n    SH: \"SHN\",\r\n    KN: \"KNA\",\r\n    LC: \"LCA\",\r\n    MF: \"MAF\",\r\n    PM: \"SPM\",\r\n    VC: \"VCT\",\r\n    WS: \"WSM\",\r\n    SM: \"SMR\",\r\n    ST: \"STP\",\r\n    SA: \"SAU\",\r\n    SN: \"SEN\",\r\n    RS: \"SRB\",\r\n    SC: \"SYC\",\r\n    SL: \"SLE\",\r\n    SG: \"SGP\",\r\n    SX: \"SXM\",\r\n    SK: \"SVK\",\r\n    SI: \"SVN\",\r\n    SB: \"SLB\",\r\n    SO: \"SOM\",\r\n    ZA: \"ZAF\",\r\n    GS: \"SGS\",\r\n    SS: \"SSD\",\r\n    ES: \"ESP\",\r\n    LK: \"LKA\",\r\n    SD: \"SDN\",\r\n    SR: \"SUR\",\r\n    SJ: \"SJM\",\r\n    SZ: \"SWZ\",\r\n    SE: \"SWE\",\r\n    CH: \"CHE\",\r\n    SY: \"SYR\",\r\n    TW: \"TWN\",\r\n    TJ: \"TJK\",\r\n    TZ: \"TZA\",\r\n    TH: \"THA\",\r\n    TL: \"TLS\",\r\n    TG: \"TGO\",\r\n    TK: \"TKL\",\r\n    TO: \"TON\",\r\n    TT: \"TTO\",\r\n    TN: \"TUN\",\r\n    TR: \"TUR\",\r\n    TM: \"TKM\",\r\n    TC: \"TCA\",\r\n    TV: \"TUV\",\r\n    UG: \"UGA\",\r\n    UA: \"UKR\",\r\n    AE: \"ARE\",\r\n    GB: \"GBR\",\r\n    US: \"USA\",\r\n    UM: \"UMI\",\r\n    UY: \"URY\",\r\n    UZ: \"UZB\",\r\n    VU: \"VUT\",\r\n    VE: \"VEN\",\r\n    VN: \"VNM\",\r\n    VG: \"VGB\",\r\n    VI: \"VIR\",\r\n    WF: \"WLF\",\r\n    EH: \"ESH\",\r\n    YE: \"YEM\",\r\n    ZM: \"ZMB\",\r\n    ZW: \"ZWE\"\r\n},\r\nilib.Locale.a1toa3langmap = {\r\n    ab: \"abk\",\r\n    aa: \"aar\",\r\n    af: \"afr\",\r\n    ak: \"aka\",\r\n    sq: \"sqi\",\r\n    am: \"amh\",\r\n    ar: \"ara\",\r\n    an: \"arg\",\r\n    hy: \"hye\",\r\n    as: \"asm\",\r\n    av: \"ava\",\r\n    ae: \"ave\",\r\n    ay: \"aym\",\r\n    az: \"aze\",\r\n    bm: \"bam\",\r\n    ba: \"bak\",\r\n    eu: \"eus\",\r\n    be: \"bel\",\r\n    bn: \"ben\",\r\n    bh: \"bih\",\r\n    bi: \"bis\",\r\n    bs: \"bos\",\r\n    br: \"bre\",\r\n    bg: \"bul\",\r\n    my: \"mya\",\r\n    ca: \"cat\",\r\n    ch: \"cha\",\r\n    ce: \"che\",\r\n    ny: \"nya\",\r\n    zh: \"zho\",\r\n    cv: \"chv\",\r\n    kw: \"cor\",\r\n    co: \"cos\",\r\n    cr: \"cre\",\r\n    hr: \"hrv\",\r\n    cs: \"ces\",\r\n    da: \"dan\",\r\n    dv: \"div\",\r\n    nl: \"nld\",\r\n    dz: \"dzo\",\r\n    en: \"eng\",\r\n    eo: \"epo\",\r\n    et: \"est\",\r\n    ee: \"ewe\",\r\n    fo: \"fao\",\r\n    fj: \"fij\",\r\n    fi: \"fin\",\r\n    fr: \"fra\",\r\n    ff: \"ful\",\r\n    gl: \"glg\",\r\n    ka: \"kat\",\r\n    de: \"deu\",\r\n    el: \"ell\",\r\n    gn: \"grn\",\r\n    gu: \"guj\",\r\n    ht: \"hat\",\r\n    ha: \"hau\",\r\n    he: \"heb\",\r\n    hz: \"her\",\r\n    hi: \"hin\",\r\n    ho: \"hmo\",\r\n    hu: \"hun\",\r\n    ia: \"ina\",\r\n    id: \"ind\",\r\n    ie: \"ile\",\r\n    ga: \"gle\",\r\n    ig: \"ibo\",\r\n    ik: \"ipk\",\r\n    io: \"ido\",\r\n    is: \"isl\",\r\n    it: \"ita\",\r\n    iu: \"iku\",\r\n    ja: \"jpn\",\r\n    jv: \"jav\",\r\n    kl: \"kal\",\r\n    kn: \"kan\",\r\n    kr: \"kau\",\r\n    ks: \"kas\",\r\n    kk: \"kaz\",\r\n    km: \"khm\",\r\n    ki: \"kik\",\r\n    rw: \"kin\",\r\n    ky: \"kir\",\r\n    kv: \"kom\",\r\n    kg: \"kon\",\r\n    ko: \"kor\",\r\n    ku: \"kur\",\r\n    kj: \"kua\",\r\n    la: \"lat\",\r\n    lb: \"ltz\",\r\n    lg: \"lug\",\r\n    li: \"lim\",\r\n    ln: \"lin\",\r\n    lo: \"lao\",\r\n    lt: \"lit\",\r\n    lu: \"lub\",\r\n    lv: \"lav\",\r\n    gv: \"glv\",\r\n    mk: \"mkd\",\r\n    mg: \"mlg\",\r\n    ms: \"msa\",\r\n    ml: \"mal\",\r\n    mt: \"mlt\",\r\n    mi: \"mri\",\r\n    mr: \"mar\",\r\n    mh: \"mah\",\r\n    mn: \"mon\",\r\n    na: \"nau\",\r\n    nv: \"nav\",\r\n    nb: \"nob\",\r\n    nd: \"nde\",\r\n    ne: \"nep\",\r\n    ng: \"ndo\",\r\n    nn: \"nno\",\r\n    no: \"nor\",\r\n    ii: \"iii\",\r\n    nr: \"nbl\",\r\n    oc: \"oci\",\r\n    oj: \"oji\",\r\n    cu: \"chu\",\r\n    om: \"orm\",\r\n    or: \"ori\",\r\n    os: \"oss\",\r\n    pa: \"pan\",\r\n    pi: \"pli\",\r\n    fa: \"fas\",\r\n    pl: \"pol\",\r\n    ps: \"pus\",\r\n    pt: \"por\",\r\n    qu: \"que\",\r\n    rm: \"roh\",\r\n    rn: \"run\",\r\n    ro: \"ron\",\r\n    ru: \"rus\",\r\n    sa: \"san\",\r\n    sc: \"srd\",\r\n    sd: \"snd\",\r\n    se: \"sme\",\r\n    sm: \"smo\",\r\n    sg: \"sag\",\r\n    sr: \"srp\",\r\n    gd: \"gla\",\r\n    sn: \"sna\",\r\n    si: \"sin\",\r\n    sk: \"slk\",\r\n    sl: \"slv\",\r\n    so: \"som\",\r\n    st: \"sot\",\r\n    az: \"azb\",\r\n    es: \"spa\",\r\n    su: \"sun\",\r\n    sw: \"swa\",\r\n    ss: \"ssw\",\r\n    sv: \"swe\",\r\n    ta: \"tam\",\r\n    te: \"tel\",\r\n    tg: \"tgk\",\r\n    th: \"tha\",\r\n    ti: \"tir\",\r\n    bo: \"bod\",\r\n    tk: \"tuk\",\r\n    tl: \"tgl\",\r\n    tn: \"tsn\",\r\n    to: \"ton\",\r\n    tr: \"tur\",\r\n    ts: \"tso\",\r\n    tt: \"tat\",\r\n    tw: \"twi\",\r\n    ty: \"tah\",\r\n    ug: \"uig\",\r\n    uk: \"ukr\",\r\n    ur: \"urd\",\r\n    uz: \"uzb\",\r\n    ve: \"ven\",\r\n    vi: \"vie\",\r\n    vo: \"vol\",\r\n    wa: \"wln\",\r\n    cy: \"cym\",\r\n    wo: \"wol\",\r\n    fy: \"fry\",\r\n    xh: \"xho\",\r\n    yi: \"yid\",\r\n    yo: \"yor\",\r\n    za: \"zha\",\r\n    zu: \"zul\"\r\n},\r\nilib.Locale._notLower = function(t) {\r\n    var e = t.charCodeAt(0);\r\n    return 97 > e || e > 122\r\n},\r\nilib.Locale._notUpper = function(t) {\r\n    var e = t.charCodeAt(0);\r\n    return 65 > e || e > 90\r\n},\r\nilib.Locale._notDigit = function(t) {\r\n    var e = t.charCodeAt(0);\r\n    return 48 > e || e > 57\r\n},\r\nilib.Locale._isLanguageCode = function(t) {\r\n    if (t === void 0 || 2 > t.length || t.length > 3) return ! 1;\r\n    for (var e = 0; t.length > e; e++) if (ilib.Locale._notLower(t.charAt(e))) return ! 1;\r\n    return ! 0\r\n},\r\nilib.Locale._isRegionCode = function(t) {\r\n    if (t === void 0 || 2 > t.length || t.length > 3) return ! 1;\r\n    if (2 === t.length) {\r\n        for (var e = 0; t.length > e; e++) if (ilib.Locale._notUpper(t.charAt(e))) return ! 1\r\n    } else for (var e = 0; t.length > e; e++) if (ilib.Locale._notDigit(t.charAt(e))) return ! 1;\r\n    return ! 0\r\n},\r\nilib.Locale._isScriptCode = function(t) {\r\n    if (t === void 0 || 4 !== t.length || ilib.Locale._notUpper(t.charAt(0))) return ! 1;\r\n    for (var e = 1; 4 > e; e++) if (ilib.Locale._notLower(t.charAt(e))) return ! 1;\r\n    return ! 0\r\n},\r\nilib.Locale.regionAlpha2ToAlpha3 = function(t) {\r\n    return ilib.Locale.a2toa3regmap[t] || t\r\n},\r\nilib.Locale.languageAlpha1ToAlpha3 = function(t) {\r\n    return ilib.Locale.a1toa3langmap[t] || t\r\n},\r\nilib.Locale.prototype = {\r\n    _genSpec: function() {\r\n        this.spec = this.language || \"\",\r\n        this.script && (this.spec.length > 0 && (this.spec += \"-\"), this.spec += this.script),\r\n        this.region && (this.spec.length > 0 && (this.spec += \"-\"), this.spec += this.region),\r\n        this.variant && (this.spec.length > 0 && (this.spec += \"-\"), this.spec += this.variant)\r\n    },\r\n    getLanguage: function() {\r\n        return this.language\r\n    },\r\n    getLanguageAlpha3: function() {\r\n        return ilib.Locale.languageAlpha1ToAlpha3(this.language)\r\n    },\r\n    getRegion: function() {\r\n        return this.region\r\n    },\r\n    getRegionAlpha3: function() {\r\n        return ilib.Locale.regionAlpha2ToAlpha3(this.region)\r\n    },\r\n    getScript: function() {\r\n        return this.script\r\n    },\r\n    getVariant: function() {\r\n        return this.variant\r\n    },\r\n    getSpec: function() {\r\n        return this.spec\r\n    },\r\n    toString: function() {\r\n        return this.getSpec()\r\n    },\r\n    equals: function(t) {\r\n        return this.language === t.language && this.region === t.region && this.script === t.script && this.variant === t.variant\r\n    },\r\n    isPseudo: function() {\r\n        var t = this.language + \"-\" + this.region;\r\n        return ilib.pseudoLocales.indexOf(t) > -1\r\n    }\r\n},\r\nilib.Locale.locales = [],\r\nilib.Locale.getAvailableLocales = function() {\r\n    return ilib.Locale.locales\r\n},\r\nilib.LocaleInfo = function(t, e) {\r\n    var i = !0,\r\n    n = void 0;\r\n    switch (this.info = ilib.LocaleInfo.defaultInfo, typeof t) {\r\n    case \"string\":\r\n        this.locale = new ilib.Locale(t);\r\n        break;\r\n    default:\r\n    case \"undefined\":\r\n        this.locale = new ilib.Locale;\r\n        break;\r\n    case \"object\":\r\n        this.locale = t\r\n    }\r\n    e && (e.sync !== void 0 && (i = 1 == e.sync), e.loadParams !== void 0 && (n = e.loadParams)),\r\n    ilib.LocaleInfo.cache || (ilib.LocaleInfo.cache = {}),\r\n    ilib.loadData({\r\n        object: ilib.LocaleInfo,\r\n        locale: this.locale,\r\n        name: \"localeinfo.json\",\r\n        sync: i,\r\n        loadParams: n,\r\n        callback: ilib.bind(this,\r\n        function(t) {\r\n            if (!t) {\r\n                t = ilib.LocaleInfo.defaultInfo;\r\n                var i = this.locale.getSpec().replace(/-/g, \"_\");\r\n                ilib.LocaleInfo.cache[i] = t\r\n            }\r\n            this.info = t,\r\n            e && \"function\" == typeof e.onLoad && e.onLoad(this)\r\n        })\r\n    })\r\n},\r\nilib.LocaleInfo.defaultInfo = ilib.data.localeinfo,\r\nilib.LocaleInfo.defaultInfo = ilib.LocaleInfo.defaultInfo || {\r\n    scripts: [\"Latn\"],\r\n    timezone: \"Etc/UTC\",\r\n    units: \"metric\",\r\n    calendar: \"gregorian\",\r\n    clock: \"24\",\r\n    currency: \"USD\",\r\n    firstDayOfWeek: 1,\r\n    numfmt: {\r\n        currencyFormats: {\r\n            common: \"{s}{n}\",\r\n            commonNegative: \"{s}-{n}\",\r\n            iso: \"{s}{n}\",\r\n            isoNegative: \"{s}-{n}\"\r\n        },\r\n        script: \"Latn\",\r\n        decimalChar: \",\",\r\n        groupChar: \".\",\r\n        prigroupSize: 3,\r\n        secgroupSize: 0,\r\n        pctFmt: \"{n}%\",\r\n        negativepctFmt: \"-{n}%\",\r\n        pctChar: \"%\",\r\n        roundingMode: \"halfdown\",\r\n        exponential: \"e\",\r\n        digits: \"\"\r\n    }\r\n},\r\nilib.LocaleInfo.prototype = {\r\n    getLanguageName: function() {\r\n        return this.info[\"language.name\"]\r\n    },\r\n    getRegionName: function() {\r\n        return this.info[\"region.name\"]\r\n    },\r\n    getClock: function() {\r\n        return this.info.clock\r\n    },\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    getUnits: function() {\r\n        return this.info.units\r\n    },\r\n    getUnitFormat: function() {\r\n        return this.info.unitfmt\r\n    },\r\n    getCalendar: function() {\r\n        return this.info.calendar\r\n    },\r\n    getFirstDayOfWeek: function() {\r\n        return this.info.firstDayOfWeek\r\n    },\r\n    getTimeZone: function() {\r\n        return this.info.timezone\r\n    },\r\n    getDecimalSeparator: function() {\r\n        return this.info.numfmt.decimalChar\r\n    },\r\n    getNativeDecimalSeparator: function() {\r\n        return this.info.native_numfmt && this.info.native_numfmt.decimalChar || this.info.numfmt.decimalChar\r\n    },\r\n    getGroupingSeparator: function() {\r\n        return this.info.numfmt.groupChar\r\n    },\r\n    getNativeGroupingSeparator: function() {\r\n        return this.info.native_numfmt && this.info.native_numfmt.groupChar || this.info.numfmt.groupChar\r\n    },\r\n    getPrimaryGroupingDigits: function() {\r\n        return this.info.numfmt.prigroupSize !== void 0 && this.info.numfmt.prigroupSize || 0\r\n    },\r\n    getSecondaryGroupingDigits: function() {\r\n        return this.info.numfmt.secgroupSize || 0\r\n    },\r\n    getPercentageFormat: function() {\r\n        return this.info.numfmt.pctFmt\r\n    },\r\n    getNegativePercentageFormat: function() {\r\n        return this.info.numfmt.negativepctFmt\r\n    },\r\n    getPercentageSymbol: function() {\r\n        return this.info.numfmt.pctChar || \"%\"\r\n    },\r\n    getExponential: function() {\r\n        return this.info.numfmt.exponential\r\n    },\r\n    getNativeExponential: function() {\r\n        return this.info.native_numfmt && this.info.native_numfmt.exponential || this.info.numfmt.exponential\r\n    },\r\n    getNativePercentageSymbol: function() {\r\n        return this.info.native_numfmt && this.info.native_numfmt.pctChar || this.info.numfmt.pctChar || \"%\"\r\n    },\r\n    getNegativeNumberFormat: function() {\r\n        return this.info.numfmt.negativenumFmt\r\n    },\r\n    getCurrencyFormats: function() {\r\n        return this.info.numfmt.currencyFormats\r\n    },\r\n    getCurrency: function() {\r\n        return this.info.currency\r\n    },\r\n    getDigitsStyle: function() {\r\n        return this.info.numfmt.useNative ? \"native\": this.info.native_numfmt !== void 0 ? \"optional\": \"western\"\r\n    },\r\n    getDigits: function() {\r\n        return this.info.numfmt.digits\r\n    },\r\n    getNativeDigits: function() {\r\n        return this.info.numfmt.useNative && this.info.numfmt.digits || this.info.native_numfmt && this.info.native_numfmt.digits\r\n    },\r\n    getRoundingMode: function() {\r\n        return this.info.numfmt.roundingMode\r\n    },\r\n    getDefaultScript: function() {\r\n        return this.info.scripts ? this.info.scripts[0] : \"Latn\"\r\n    },\r\n    getScript: function() {\r\n        return this.locale.getScript() || this.getDefaultScript()\r\n    },\r\n    getAllScripts: function() {\r\n        return this.info.scripts || [\"Latn\"]\r\n    }\r\n},\r\nilib.Date = function(t) {\r\n    return t && void 0 !== t.noinstance ? void 0 : ilib.Date.newInstance(t)\r\n},\r\nilib.Date.newInstance = function(t) {\r\n    var e, i = t && t.locale,\r\n    n = t && (t.type || t.calendar);\r\n    if (i || (i = new ilib.Locale), !n) {\r\n        var o = new ilib.LocaleInfo(i);\r\n        n = o.getCalendar()\r\n    }\r\n    return e = ilib.Date._constructors[n],\r\n    e && new e(t)\r\n},\r\nilib.Date._dateToIlib = function(t, e) {\r\n    return t === void 0 || null === t ? t: t instanceof ilib.Date ? t: t instanceof Date ? ilib.Date.newInstance({\r\n        unixtime: t.getTime(),\r\n        timezone: e\r\n    }) : t instanceof ilib.JulianDay ? ilib.Date.newInstance({\r\n        jd: t,\r\n        timezone: e\r\n    }) : \"number\" == typeof t ? ilib.Date.newInstance({\r\n        unixtime: t,\r\n        timezone: e\r\n    }) : \"object\" == typeof t ? ilib.Date.newInstance(t) : (\"string\" == typeof t && (t = new Date(t)), ilib.Date.newInstance({\r\n        unixtime: t.getTime(),\r\n        timezone: e\r\n    }))\r\n},\r\nilib.Date._constructors = {},\r\nilib.Date.prototype = {\r\n    getType: function() {\r\n        return \"ilib.Date\"\r\n    },\r\n    getTime: function() {\r\n        return this.rd.getTime()\r\n    },\r\n    getTimeExtended: function() {\r\n        return this.rd.getTimeExtended()\r\n    },\r\n    setTime: function(t) {\r\n        this.rd = this.newRd({\r\n            unixtime: t,\r\n            cal: this.cal\r\n        }),\r\n        this._calcDateComponents()\r\n    },\r\n    getDays: function() {\r\n        return this.day\r\n    },\r\n    getMonths: function() {\r\n        return this.month\r\n    },\r\n    getYears: function() {\r\n        return this.year\r\n    },\r\n    getHours: function() {\r\n        return this.hour\r\n    },\r\n    getMinutes: function() {\r\n        return this.minute\r\n    },\r\n    getSeconds: function() {\r\n        return this.second\r\n    },\r\n    getMilliseconds: function() {\r\n        return this.millisecond\r\n    },\r\n    setDays: function(t) {\r\n        this.day = parseInt(t, 10) || 1,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    setMonths: function(t) {\r\n        this.month = parseInt(t, 10) || 1,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    setYears: function(t) {\r\n        this.year = parseInt(t, 10) || 0,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    setHours: function(t) {\r\n        this.hour = parseInt(t, 10) || 0,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    setMinutes: function(t) {\r\n        this.minute = parseInt(t, 10) || 0,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    setSeconds: function(t) {\r\n        this.second = parseInt(t, 10) || 0,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    setMilliseconds: function(t) {\r\n        this.millisecond = parseInt(t, 10) || 0,\r\n        this.rd._setDateComponents(this)\r\n    },\r\n    before: function(t) {\r\n        return this.cal.newDateInstance({\r\n            rd: this.rd.before(t, this.offset),\r\n            timezone: this.timezone\r\n        })\r\n    },\r\n    after: function(t) {\r\n        return this.cal.newDateInstance({\r\n            rd: this.rd.after(t, this.offset),\r\n            timezone: this.timezone\r\n        })\r\n    },\r\n    onOrBefore: function(t) {\r\n        return this.cal.newDateInstance({\r\n            rd: this.rd.onOrBefore(t, this.offset),\r\n            timezone: this.timezone\r\n        })\r\n    },\r\n    onOrAfter: function(t) {\r\n        return this.cal.newDateInstance({\r\n            rd: this.rd.onOrAfter(t, this.offset),\r\n            timezone: this.timezone\r\n        })\r\n    },\r\n    getJSDate: function() {\r\n        var t = this.rd.getTimeExtended();\r\n        return isNaN(t) ? void 0 : new Date(t)\r\n    },\r\n    getRataDie: function() {\r\n        return this.rd.getRataDie()\r\n    },\r\n    setRd: function(t) {\r\n        this.rd = this.newRd({\r\n            rd: t,\r\n            cal: this.cal\r\n        }),\r\n        this._calcDateComponents()\r\n    },\r\n    getJulianDay: function() {\r\n        return this.rd.getJulianDay()\r\n    },\r\n    setJulianDay: function(t) {\r\n        this.rd = this.newRd({\r\n            julianday: \"object\" == typeof t ? t.getDate() : t,\r\n            cal: this.cal\r\n        }),\r\n        this._calcDateComponents()\r\n    },\r\n    getTimeZone: function() {\r\n        return this.timezone || \"local\"\r\n    },\r\n    setTimeZone: function(t) {\r\n        t && \"\" !== t ? \"string\" == typeof t && (this.timezone = t, this.tz = void 0, this._calcDateComponents()) : (this.timezone = void 0, this.tz = void 0)\r\n    },\r\n    firstSunday: function(t) {\r\n        var e = this.newRd({\r\n            year: t,\r\n            month: 1,\r\n            day: 1,\r\n            hour: 0,\r\n            minute: 0,\r\n            second: 0,\r\n            millisecond: 0,\r\n            cal: this.cal\r\n        }),\r\n        i = this.newRd({\r\n            rd: e.onOrAfter(4),\r\n            cal: this.cal\r\n        });\r\n        return i.before(0)\r\n    },\r\n    getWeekOfYear: function() {\r\n        var t, e = Math.floor(this.rd.getRataDie()),\r\n        i = this._calcYear(e + this.offset),\r\n        n = this.firstSunday(i);\r\n        return n > e ? n = this.firstSunday(i - 1) : (t = this.firstSunday(i + 1), e >= t && (n = t)),\r\n        Math.floor((e - n) / 7) + 1\r\n    },\r\n    getWeekOfMonth: function(t) {\r\n        var e = new ilib.LocaleInfo(t),\r\n        i = this.newRd({\r\n            year: this._calcYear(this.rd.getRataDie() + this.offset),\r\n            month: this.getMonths(),\r\n            day: 1,\r\n            hour: 0,\r\n            minute: 0,\r\n            second: 0,\r\n            millisecond: 0,\r\n            cal: this.cal\r\n        }),\r\n        n = i.onOrAfter(e.getFirstDayOfWeek());\r\n        return n - i.getRataDie() > 3 && (n -= 7),\r\n        Math.floor((this.rd.getRataDie() - n) / 7) + 1\r\n    }\r\n},\r\nilib.bind = function(t, e) {\r\n    function i(t, e) {\r\n        for (var i = [], n = e || 0, o = t.length; o > n; n++) i.push(t[n]);\r\n        return i\r\n    }\r\n    if (!t || !e) return void 0;\r\n    if (\"function\" == typeof e) {\r\n        var n, o = i(arguments, 2);\r\n        return n = \"function\" == typeof e.bind ? e.bind.apply(e, [t].concat(o)) : function() {\r\n            var n = i(arguments);\r\n            return e.apply(t, o.concat(n))\r\n        }\r\n    }\r\n    return void 0\r\n},\r\nilib.merge = function(t, e, i, n, o) {\r\n    var s = void 0,\r\n    a = {};\r\n    for (s in t) s && t[s] !== void 0 && (a[s] = t[s]);\r\n    for (s in e) s && e[s] !== void 0 && (t[s] instanceof Array && e[s] instanceof Array ? \"boolean\" == typeof i && i ? a[s] = e[s] : (a[s] = [], a[s] = a[s].concat(t[s]), a[s] = a[s].concat(e[s])) : \"object\" == typeof t[s] && \"object\" == typeof e[s] ? a[s] = ilib.merge(t[s], e[s], i) : (n && o && a[s] == e[s] && console.log(\"Property \" + s + \" in \" + n + \" is being overridden by the same value in \" + o), a[s] = e[s]));\r\n    return a\r\n},\r\nilib.mergeLocData = function(t, e, i, n) {\r\n    var o, s = void 0,\r\n    a = e || new ilib.Locale,\r\n    r = !1,\r\n    h = t;\r\n    return s = ilib.data[t] || {},\r\n    o = s,\r\n    a.getLanguage() && (h = t + \"_\" + a.getLanguage(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])),\r\n    a.getRegion() && (h = t + \"_\" + a.getRegion(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])),\r\n    a.getLanguage() && (h = t + \"_\" + a.getLanguage(), a.getScript() && (h = t + \"_\" + a.getLanguage() + \"_\" + a.getScript(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])), a.getRegion() && (h = t + \"_\" + a.getLanguage() + \"_\" + a.getRegion(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h]))),\r\n    a.getRegion() && a.getVariant() && (h = t + \"_\" + a.getLanguage() + \"_\" + a.getVariant(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])),\r\n    a.getLanguage() && a.getScript() && a.getRegion() && (h = t + \"_\" + a.getLanguage() + \"_\" + a.getScript() + \"_\" + a.getRegion(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])),\r\n    a.getLanguage() && a.getRegion() && a.getVariant() && (h = t + \"_\" + a.getLanguage() + \"_\" + a.getRegion() + \"_\" + a.getVariant(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])),\r\n    a.getLanguage() && a.getScript() && a.getRegion() && a.getVariant() && (h = t + \"_\" + a.getLanguage() + \"_\" + a.getScript() + \"_\" + a.getRegion() + \"_\" + a.getVariant(), ilib.data[h] && (r = !0, s = ilib.merge(s, ilib.data[h], i), o = ilib.data[h])),\r\n    r ? n ? o: s: void 0\r\n},\r\nilib.getLocFiles = function(t, e) {\r\n    var i = \"\",\r\n    n = [],\r\n    o = e || \"resources.json\",\r\n    s = t || new ilib.Locale,\r\n    a = s.getLanguage(),\r\n    r = s.getRegion(),\r\n    h = s.getScript(),\r\n    l = s.getVariant();\r\n    return n.push(o),\r\n    a && (i = a + \"/\", n.push(i + o)),\r\n    r && (i = \"und/\" + r + \"/\", n.push(i + o)),\r\n    a && (h && (i = a + \"/\" + h + \"/\", n.push(i + o)), r && (i = a + \"/\" + r + \"/\", n.push(i + o))),\r\n    r && l && (i = \"und/\" + r + \"/\" + l + \"/\", n.push(i + o)),\r\n    a && h && r && (i = a + \"/\" + h + \"/\" + r + \"/\", n.push(i + o)),\r\n    a && r && l && (i = a + \"/\" + r + \"/\" + l + \"/\", n.push(i + o)),\r\n    a && h && r && l && (i = a + \"/\" + h + \"/\" + r + \"/\" + l + \"/\", n.push(i + o)),\r\n    n\r\n},\r\nilib.isEmpty = function(t) {\r\n    var e = void 0;\r\n    if (!t) return ! 0;\r\n    for (e in t) if (e && t[e] !== void 0) return ! 1;\r\n    return ! 0\r\n},\r\nilib.hashCode = function(t) {\r\n    function e(t, e) {\r\n        return t *= 65543,\r\n        t += e,\r\n        t %= 2147483647\r\n    }\r\n    function i(t) {\r\n        for (var i = 0,\r\n        n = 0; t.length > n; n++) i = e(i, t.charCodeAt(n));\r\n        return i\r\n    }\r\n    var n = 0;\r\n    switch (typeof t) {\r\n    case \"undefined\":\r\n        n = 0;\r\n        break;\r\n    case \"string\":\r\n        n = i(t);\r\n        break;\r\n    case \"function\":\r\n    case \"number\":\r\n    case \"xml\":\r\n        n = i(t + \"\");\r\n        break;\r\n    case \"boolean\":\r\n        n = t ? 1 : 0;\r\n        break;\r\n    case \"object\":\r\n        var o = [];\r\n        for (var s in t) t.hasOwnProperty(s) && o.push(s);\r\n        o.sort();\r\n        for (var a = 0; o.length > a; a++) n = e(n, i(o[a])),\r\n        n = e(n, ilib.hashCode(t[o[a]]))\r\n    }\r\n    return n\r\n},\r\nilib._callLoadData = function(t, e, i, n) {\r\n    return \"function\" == typeof ilib._load ? ilib._load(t, e, i, n) : \"object\" == typeof ilib._load && ilib._load instanceof ilib.Loader ? ilib._load.loadFiles(t, e, i, n) : void 0\r\n},\r\nilib.loadData = function(t) {\r\n    var e, i = \"resources.json\",\r\n    n = void 0,\r\n    o = new ilib.Locale(ilib.getLocale()),\r\n    s = !1,\r\n    a = void 0,\r\n    r = {},\r\n    h = void 0,\r\n    l = !1,\r\n    c = !1;\r\n    if (t && \"function\" == typeof t.callback) {\r\n        if (t.name && (i = t.name), t.object && (n = t.object), t.locale && (o = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.type && (a = t.type), t.loadParams && (r = t.loadParams), t.sync && (s = t.sync), t.nonlocale && (l = !!t.nonlocale), \"boolean\" == typeof t.replace && (c = t.replace), h = t.callback, n && !n.cache && (n.cache = {}), !a) {\r\n            var d = i.lastIndexOf(\".\");\r\n            a = -1 !== d ? i.substring(d + 1) : \"text\"\r\n        }\r\n        var u = (!l && o.getSpec().replace(/-/g, \"_\") || \"root\") + \",\" + i + \",\" + (ilib.hashCode(r) + \"\");\r\n        if (n && n.cache[u] !== void 0) h(n.cache[u]);\r\n        else {\r\n            var g, f = r && r.returnOne;\r\n            if (\"json\" === a && (e = i.substring(0, i.lastIndexOf(\".\")), l ? (e = e.replace(/\\//g, \".\").replace(/[\\\\\\+\\-]/g, \"_\"), g = ilib.data[e]) : g = ilib.mergeLocData(e, o, c, f), g)) return n && (n.cache[u] = g),\r\n            h(g),\r\n            void 0;\r\n            if (ilib._load !== void 0) {\r\n                var p = l ? [i || \"resources.json\"] : ilib.getLocFiles(o, i);\r\n                \"json\" !== a && (r.returnOne = !0),\r\n                ilib._callLoadData(p, s, r, ilib.bind(this,\r\n                function(t) {\r\n                    if (\"json\" === a) {\r\n                        g = ilib.data[e] || {};\r\n                        for (var i = 0; t.length > i; i++) t[i] !== void 0 && (g = r.returnOne ? t[i] : ilib.merge(g, t[i], c));\r\n                        n && (n.cache[u] = g),\r\n                        h(g)\r\n                    } else {\r\n                        for (var i = t.length - 1; i > -1 && !t[i];) i--;\r\n                        i > -1 ? (n && (n.cache[u] = t[i]), h(t[i])) : h(void 0)\r\n                    }\r\n                }))\r\n            } else \"json\" === a && (g = ilib.data[e]),\r\n            n && g && (n.cache[u] = g),\r\n            h(g)\r\n        }\r\n    }\r\n},\r\nilib.signum = function(t) {\r\n    var e = t;\r\n    if (\"string\" == typeof t) e = parseInt(t, 10);\r\n    else if (\"number\" != typeof t) return 1;\r\n    return 0 > e ? -1 : 1\r\n},\r\nilib._roundFnc = {\r\n    floor: function(t) {\r\n        return Math.floor(t)\r\n    },\r\n    ceiling: function(t) {\r\n        return Math.ceil(t)\r\n    },\r\n    down: function(t) {\r\n        return 0 > t ? Math.ceil(t) : Math.floor(t)\r\n    },\r\n    up: function(t) {\r\n        return 0 > t ? Math.floor(t) : Math.ceil(t)\r\n    },\r\n    halfup: function(t) {\r\n        return 0 > t ? Math.ceil(t - .5) : Math.floor(t + .5)\r\n    },\r\n    halfdown: function(t) {\r\n        return 0 > t ? Math.floor(t + .5) : Math.ceil(t - .5)\r\n    },\r\n    halfeven: function(t) {\r\n        return 0 === Math.floor(t) % 2 ? Math.ceil(t - .5) : Math.floor(t + .5)\r\n    },\r\n    halfodd: function(t) {\r\n        return 0 !== Math.floor(t) % 2 ? Math.ceil(t - .5) : Math.floor(t + .5)\r\n    }\r\n},\r\nilib.mod = function(t, e) {\r\n    if (0 == e) return 0;\r\n    var i = t % e;\r\n    return 0 > i ? i + e: i\r\n},\r\nilib.amod = function(t, e) {\r\n    if (0 == e) return 0;\r\n    var i = t % e;\r\n    return 0 >= i ? i + e: i\r\n},\r\nilib.String = function(t) {\r\n    this.str = \"object\" == typeof t ? t instanceof ilib.String ? t.str: \"\" + t: \"string\" == typeof t ? new String(t) : \"\",\r\n    this.length = this.str.length,\r\n    this.cpLength = -1,\r\n    this.localeSpec = ilib.getLocale()\r\n},\r\nilib.String._isSurrogate = function(t) {\r\n    var e = t.charCodeAt(0);\r\n    return e >= 56320 && 57343 >= e || e >= 55296 && 56319 >= e\r\n},\r\nilib.String.fromCodePoint = function(t) {\r\n    if (65536 > t) return String.fromCharCode(t);\r\n    var e = Math.floor(t / 65536) - 1,\r\n    i = 65535 & t;\r\n    return String.fromCharCode(55296 | (15 & e) << 6 | (64512 & i) >> 10) + String.fromCharCode(56320 | 1023 & i)\r\n},\r\nilib.String.toCodePoint = function(t, e) {\r\n    if (!t || 0 === t.length) return - 1;\r\n    var i = -1,\r\n    n = t.charCodeAt(e);\r\n    if (n >= 55296 && 56319 >= n) {\r\n        if (t.length > e + 1) {\r\n            var o = t.charCodeAt(e + 1);\r\n            o >= 56320 && 57343 >= o && (i = ((960 & n) >> 6) + 1 << 16 | ((63 & n) << 10 | 1023 & o))\r\n        }\r\n    } else i = n;\r\n    return i\r\n},\r\nilib.String.loadPlurals = function(t, e, i, n) {\r\n    var o;\r\n    o = e ? \"string\" == typeof e ? new ilib.Locale(e) : e: new ilib.Locale(ilib.getLocale());\r\n    var s = o.getLanguage();\r\n    ilib.data[\"plurals_\" + s] ? n && \"function\" == typeof n && n(ilib.data[\"plurals_\" + s]) : ilib.loadData({\r\n        name: \"plurals.json\",\r\n        object: ilib.String,\r\n        locale: o,\r\n        sync: t,\r\n        loadParams: i,\r\n        callback: ilib.bind(this,\r\n        function(t) {\r\n            t || (ilib.String.cache[s] = {}),\r\n            ilib.data[\"plurals_\" + s] = t || {},\r\n            n && \"function\" == typeof n && n(ilib.data[\"plurals_\" + s])\r\n        })\r\n    })\r\n},\r\nilib.String._fncs = {\r\n    firstProp: function(t) {\r\n        for (var e in t) if (e && t[e]) return e;\r\n        return void 0\r\n    },\r\n    getValue: function(t, e) {\r\n        if (\"object\" == typeof t) {\r\n            var i = ilib.String._fncs.firstProp(t);\r\n            return ilib.String._fncs[i](t[i], e)\r\n        }\r\n        return \"string\" == typeof t ? e: t\r\n    },\r\n    matchRangeContinuous: function(t, e) {\r\n        for (var i in e) if (i !== void 0 && e[i] !== void 0) {\r\n            var n = e[i];\r\n            if (\"number\" == typeof n) {\r\n                if (t === e[i]) return ! 0\r\n            } else if (\"[object Array]\" === Object.prototype.toString.call(n) && t >= n[0] && n[1] >= t) return ! 0\r\n        }\r\n        return ! 1\r\n    },\r\n    matchRange: function(t, e) {\r\n        return Math.floor(t) !== t ? !1 : ilib.String._fncs.matchRangeContinuous(t, e)\r\n    },\r\n    is: function(t, e) {\r\n        var i = ilib.String._fncs.getValue(t[0], e),\r\n        n = ilib.String._fncs.getValue(t[1], e);\r\n        return i == n\r\n    },\r\n    isnot: function(t, e) {\r\n        return ilib.String._fncs.getValue(t[0], e) != ilib.String._fncs.getValue(t[1], e)\r\n    },\r\n    inrange: function(t, e) {\r\n        return ilib.String._fncs.matchRange(ilib.String._fncs.getValue(t[0], e), t[1])\r\n    },\r\n    notin: function(t, e) {\r\n        return ! ilib.String._fncs.matchRange(ilib.String._fncs.getValue(t[0], e), t[1])\r\n    },\r\n    within: function(t, e) {\r\n        return ilib.String._fncs.matchRangeContinuous(ilib.String._fncs.getValue(t[0], e), t[1])\r\n    },\r\n    mod: function(t, e) {\r\n        return ilib.mod(ilib.String._fncs.getValue(t[0], e), ilib.String._fncs.getValue(t[1], e))\r\n    },\r\n    n: function(t, e) {\r\n        return e\r\n    },\r\n    or: function(t, e) {\r\n        return ilib.String._fncs.getValue(t[0], e) || ilib.String._fncs.getValue(t[1], e)\r\n    },\r\n    and: function(t, e) {\r\n        return ilib.String._fncs.getValue(t[0], e) && ilib.String._fncs.getValue(t[1], e)\r\n    }\r\n},\r\nilib.String.prototype = {\r\n    _length: function() {\r\n        return this.str.length\r\n    },\r\n    format: function(t) {\r\n        var e = this.str;\r\n        if (t) {\r\n            var i;\r\n            for (var n in t) t[n] !== void 0 && (i = RegExp(\"{\" + n + \"}\", \"g\"), e = e.replace(i, t[n]))\r\n        }\r\n        return \"\" + e\r\n    },\r\n    formatChoice: function(t, e) {\r\n        var i, n, o, s, a = this.str.split(\"|\"),\r\n        r = typeof t,\r\n        h = [],\r\n        l = [],\r\n        c = void 0,\r\n        d = \"\";\r\n        if (0 === this.str.length) return \"\";\r\n        for (i = 0; a.length > i; i++) if (n = a[i].split(\"#\"), n.length > 2) h[i] = n[0],\r\n        n = n.shift(),\r\n        l[i] = n.join(\"#\");\r\n        else {\r\n            if (2 !== n.length) throw \"syntax error in choice format pattern: \" + a[i];\r\n            h[i] = n[0],\r\n            l[i] = n[1]\r\n        }\r\n        for (i = 0; h.length > i; i++) if (0 === h[i].length) d = new ilib.String(l[i]);\r\n        else switch (r) {\r\n        case \"number\":\r\n            if (s = parseInt(t, 10), \"<=\" === h[i].substring(0, 2)) o = parseFloat(h[i].substring(2)),\r\n            o >= s && (c = new ilib.String(l[i]), i = h.length);\r\n            else if (\">=\" === h[i].substring(0, 2)) o = parseFloat(h[i].substring(2)),\r\n            s >= o && (c = new ilib.String(l[i]), i = h.length);\r\n            else if (\"<\" === h[i].charAt(0)) o = parseFloat(h[i].substring(1)),\r\n            o > s && (c = new ilib.String(l[i]), i = h.length);\r\n            else if (\">\" === h[i].charAt(0)) o = parseFloat(h[i].substring(1)),\r\n            s > o && (c = new ilib.String(l[i]), i = h.length);\r\n            else switch (this.locale = this.locale || new ilib.Locale(this.localeSpec), h[i]) {\r\n            case \"zero\":\r\n            case \"one\":\r\n            case \"two\":\r\n            case \"few\":\r\n            case \"many\":\r\n                var u = ilib.data[\"plurals_\" + this.locale.getLanguage()];\r\n                if (u) {\r\n                    var g = u[h[i]];\r\n                    ilib.String._fncs.getValue(g, s) && (c = new ilib.String(l[i]), i = h.length)\r\n                }\r\n                break;\r\n            default:\r\n                var f = h[i].indexOf(\"-\");\r\n                if ( - 1 !== f) {\r\n                    var p = h[i].substring(0, f),\r\n                    m = h[i].substring(f + 1);\r\n                    s >= parseInt(p, 10) && parseInt(m, 10) >= s && (c = new ilib.String(l[i]), i = h.length)\r\n                } else s === parseInt(h[i], 10) && (c = new ilib.String(l[i]), i = h.length)\r\n            }\r\n            break;\r\n        case \"boolean\":\r\n            \"true\" === h[i] && t === !0 ? (c = new ilib.String(l[i]), i = h.length) : \"false\" === h[i] && t === !1 && (c = new ilib.String(l[i]), i = h.length);\r\n            break;\r\n        case \"string\":\r\n            var b = RegExp(h[i], \"i\");\r\n            b.test(t) && (c = new ilib.String(l[i]), i = h.length);\r\n            break;\r\n        case \"object\":\r\n            throw \"syntax error: fmtChoice parameter for the argument index cannot be an object\"\r\n        }\r\n        return c || (c = d || new ilib.String(\"\")),\r\n        c = c.format(e),\r\n        \"\" + c\r\n    },\r\n    toString: function() {\r\n        return \"\" + this.str\r\n    },\r\n    valueOf: function() {\r\n        return this.str.valueOf()\r\n    },\r\n    charAt: function(t) {\r\n        return new ilib.String(this.str.charAt(t))\r\n    },\r\n    charCodeAt: function(t) {\r\n        return this.str.charCodeAt(t)\r\n    },\r\n    concat: function(t) {\r\n        return new ilib.String(this.str.concat(t))\r\n    },\r\n    indexOf: function(t, e) {\r\n        return this.str.indexOf(t, e)\r\n    },\r\n    lastIndexOf: function(t, e) {\r\n        return this.str.lastIndexOf(t, e)\r\n    },\r\n    match: function(t) {\r\n        return this.str.match(t)\r\n    },\r\n    replace: function(t, e) {\r\n        return new ilib.String(this.str.replace(t, e))\r\n    },\r\n    search: function(t) {\r\n        return this.str.search(t)\r\n    },\r\n    slice: function(t, e) {\r\n        return new ilib.String(this.str.slice(t, e))\r\n    },\r\n    split: function(t, e) {\r\n        return this.str.split(t, e)\r\n    },\r\n    substr: function(t, e) {\r\n        return new ilib.String(this.str.substr(t, e))\r\n    },\r\n    substring: function(t, e) {\r\n        return this.str.substring(t, e)\r\n    },\r\n    toLowerCase: function() {\r\n        return this.str.toLowerCase()\r\n    },\r\n    toUpperCase: function() {\r\n        return this.str.toUpperCase()\r\n    },\r\n    _toCodePoint: function(t) {\r\n        return ilib.String.toCodePoint(this.str, t)\r\n    },\r\n    forEach: function(t) {\r\n        if (\"function\" == typeof t) for (var e = this.charIterator(); e.hasNext();) t(e.next())\r\n    },\r\n    forEachCodePoint: function(t) {\r\n        if (\"function\" == typeof t) for (var e = this.iterator(); e.hasNext();) t(e.next())\r\n    },\r\n    iterator: function() {\r\n        function t(t) {\r\n            this.index = 0,\r\n            this.hasNext = function() {\r\n                return this.index < t.str.length\r\n            },\r\n            this.next = function() {\r\n                if (this.index < t.str.length) {\r\n                    var e = t._toCodePoint(this.index);\r\n                    this.index += e > 65535 ? 2 : 1\r\n                } else e = -1;\r\n                return e\r\n            }\r\n        }\r\n        return new t(this)\r\n    },\r\n    charIterator: function() {\r\n        function t(t) {\r\n            this.index = 0,\r\n            this.hasNext = function() {\r\n                return this.index < t.str.length\r\n            },\r\n            this.next = function() {\r\n                var e;\r\n                return this.index < t.str.length && (e = t.str.charAt(this.index), ilib.String._isSurrogate(e) && this.index + 1 < t.str.length && ilib.String._isSurrogate(t.str.charAt(this.index + 1)) && (this.index++, e += t.str.charAt(this.index)), this.index++),\r\n                e\r\n            }\r\n        }\r\n        return new t(this)\r\n    },\r\n    codePointAt: function(t) {\r\n        if (0 > t) return - 1;\r\n        var e, i, n = this.iterator();\r\n        for (e = t; e >= 0 && n.hasNext(); e--) i = n.next();\r\n        return 0 > e ? i: -1\r\n    },\r\n    setLocale: function(t, e, i, n) {\r\n        \"object\" == typeof t ? this.locale = t: (this.localeSpec = t, this.locale = new ilib.Locale(t)),\r\n        ilib.String.loadPlurals(e !== void 0 ? e: !0, this.locale, i, n)\r\n    },\r\n    getLocale: function() {\r\n        return (this.locale ? this.locale.getSpec() : this.localeSpec) || ilib.getLocale()\r\n    },\r\n    codePointLength: function() {\r\n        if ( - 1 === this.cpLength) {\r\n            var t = this.iterator();\r\n            for (this.cpLength = 0; t.hasNext();) this.cpLength++,\r\n            t.next()\r\n        }\r\n        return this.cpLength\r\n    }\r\n},\r\nilib.Cal = function() {},\r\nilib.Cal.newInstance = function(t) {\r\n    var e, i = t && t.locale,\r\n    n = t && t.type;\r\n    if (i || (i = new ilib.Locale), !n) {\r\n        var o = new ilib.LocaleInfo(i);\r\n        n = o.getCalendar()\r\n    }\r\n    return e = ilib.Cal._constructors[n],\r\n    e && new e(t)\r\n},\r\nilib.Cal._constructors = {},\r\nilib.Cal.getCalendars = function() {\r\n    var t, e = [];\r\n    for (t in ilib.Cal._constructors) t && ilib.Cal._constructors[t] && e.push(t);\r\n    return e\r\n},\r\nilib.Cal.prototype = {\r\n    getType: function() {\r\n        throw \"Cannot call methods of abstract class ilib.Cal\"\r\n    },\r\n    getNumMonths: function() {\r\n        throw \"Cannot call methods of abstract class ilib.Cal\"\r\n    },\r\n    getMonLength: function() {\r\n        throw \"Cannot call methods of abstract class ilib.Cal\"\r\n    },\r\n    isLeapYear: function() {\r\n        throw \"Cannot call methods of abstract class ilib.Cal\"\r\n    }\r\n},\r\nilib.JulianDay = function(t) {\r\n    this.jd = t,\r\n    this.days = Math.floor(this.jd),\r\n    this.frac = t - this.days\r\n},\r\nilib.JulianDay.prototype = {\r\n    getDays: function() {\r\n        return this.days\r\n    },\r\n    setDays: function(t) {\r\n        this.days = Math.floor(t),\r\n        this.jd = this.days + this.frac\r\n    },\r\n    getDayFraction: function() {\r\n        return this.frac\r\n    },\r\n    setDayFraction: function(t) {\r\n        var e = Math.floor(t);\r\n        this.frac = t - e,\r\n        this.jd = this.days + this.frac\r\n    },\r\n    getDate: function() {\r\n        return this.jd\r\n    },\r\n    setDate: function(t) {\r\n        this.jd = t\r\n    },\r\n    addDate: function(t) {\r\n        \"number\" == typeof t && (this.jd += t, this.days = Math.floor(this.jd), this.frac = this.jd - this.days)\r\n    }\r\n},\r\nilib.Cal.Gregorian = function() {\r\n    this.type = \"gregorian\"\r\n},\r\nilib.Cal.Gregorian.monthLengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\r\nilib.Cal.Gregorian.prototype.getNumMonths = function() {\r\n    return 12\r\n},\r\nilib.Cal.Gregorian.prototype.getMonLength = function(t, e) {\r\n    return 2 === t && this.isLeapYear(e) ? 29 : ilib.Cal.Gregorian.monthLengths[t - 1]\r\n},\r\nilib.Cal.Gregorian.prototype.isLeapYear = function(t) {\r\n    var e = \"number\" == typeof t ? t: t.getYears(),\r\n    i = ilib.mod(e, 400);\r\n    return 0 === ilib.mod(e, 4) && 100 !== i && 200 !== i && 300 !== i\r\n},\r\nilib.Cal.Gregorian.prototype.getType = function() {\r\n    return this.type\r\n},\r\nilib.Cal.Gregorian.prototype.newDateInstance = function(t) {\r\n    return new ilib.Date.GregDate(t)\r\n},\r\nilib.Cal._constructors.gregorian = ilib.Cal.Gregorian,\r\nilib.Date.RataDie = function(t) {\r\n    if (t) if (t.date !== void 0) {\r\n        var e = t.date;\r\n        e instanceof Date || (e = new Date(e)),\r\n        this._setTime(e.getTime())\r\n    } else t.unixtime !== void 0 ? this._setTime(parseInt(t.unixtime, 10)) : t.julianday !== void 0 ? this._setJulianDay(parseFloat(t.julianday)) : t.year || t.month || t.day || t.hour || t.minute || t.second || t.millisecond || t.parts || t.cycle ? this._setDateComponents(t) : t.rd !== void 0 && (this.rd = \"object\" == typeof t.rd && t.rd instanceof ilib.Date.RataDie ? t.rd.rd: t.rd);\r\n    if (this.rd === void 0) {\r\n        var i = new Date;\r\n        this._setTime(i.getTime())\r\n    }\r\n},\r\nilib.Date.RataDie.gregorianEpoch = 1721424.5,\r\nilib.Date.RataDie.prototype = {\r\n    epoch: ilib.Date.RataDie.gregorianEpoch,\r\n    _setTime: function(t) {\r\n        this._setJulianDay(2440587.5 + t / 864e5)\r\n    },\r\n    _setJulianDay: function(t) {\r\n        var e = \"number\" == typeof t ? new ilib.JulianDay(t) : t;\r\n        this.rd = ilib._roundFnc.halfup(864e5 * (e.getDate() - this.epoch)) / 864e5\r\n    },\r\n    _onOrBefore: function(t, e) {\r\n        return t - ilib.mod(Math.floor(t) - e - 2, 7)\r\n    },\r\n    onOrBefore: function(t, e) {\r\n        return e = e || 0,\r\n        this._onOrBefore(this.rd + e, t) - e\r\n    },\r\n    onOrAfter: function(t, e) {\r\n        return e = e || 0,\r\n        this._onOrBefore(this.rd + 6 + e, t) - e\r\n    },\r\n    before: function(t, e) {\r\n        return e = e || 0,\r\n        this._onOrBefore(this.rd - 1 + e, t) - e\r\n    },\r\n    after: function(t, e) {\r\n        return e = e || 0,\r\n        this._onOrBefore(this.rd + 7 + e, t) - e\r\n    },\r\n    getTime: function() {\r\n        var t = this.getJulianDay();\r\n        return 2440587.5 > t || t > 2465442.634803241 ? -1 : Math.round(864e5 * (t - 2440587.5))\r\n    },\r\n    getTimeExtended: function() {\r\n        var t = this.getJulianDay();\r\n        return - 97559412.5 > t || t > 102440587.5 ? 0 / 0 : Math.round(864e5 * (t - 2440587.5))\r\n    },\r\n    getJulianDay: function() {\r\n        return this.rd + this.epoch\r\n    },\r\n    getRataDie: function() {\r\n        return this.rd\r\n    }\r\n},\r\nilib.Date.GregRataDie = function(t) {\r\n    this.cal = t && t.cal || new ilib.Cal.Gregorian,\r\n    this.rd = void 0,\r\n    ilib.Date.RataDie.call(this, t)\r\n},\r\nilib.Date.GregRataDie.prototype = new ilib.Date.RataDie,\r\nilib.Date.GregRataDie.prototype.parent = ilib.Date.RataDie,\r\nilib.Date.GregRataDie.prototype.constructor = ilib.Date.GregRataDie,\r\nilib.Date.GregRataDie.cumMonthLengths = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365],\r\nilib.Date.GregRataDie.cumMonthLengthsLeap = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366],\r\nilib.Date.GregRataDie.prototype._setDateComponents = function(t) {\r\n    var e = parseInt(t.year, 10) || 0,\r\n    i = parseInt(t.month, 10) || 1,\r\n    n = parseInt(t.day, 10) || 1,\r\n    o = parseInt(t.hour, 10) || 0,\r\n    s = parseInt(t.minute, 10) || 0,\r\n    a = parseInt(t.second, 10) || 0,\r\n    r = parseInt(t.millisecond, 10) || 0,\r\n    h = 365 * (e - 1) + Math.floor((e - 1) / 4) - Math.floor((e - 1) / 100) + Math.floor((e - 1) / 400),\r\n    l = (i > 1 ? ilib.Date.GregRataDie.cumMonthLengths[i - 1] : 0) + n + (ilib.Cal.Gregorian.prototype.isLeapYear.call(this.cal, e) && i > 2 ? 1 : 0),\r\n    c = (36e5 * o + 6e4 * s + 1e3 * a + r) / 864e5;\r\n    this.rd = h + l + c\r\n},\r\nilib.Date.GregRataDie.prototype._onOrBefore = function(t, e) {\r\n    return t - ilib.mod(Math.floor(t) - e, 7)\r\n},\r\nilib.TimeZone = function(t) {\r\n    if (this.sync = !0, this.locale = new ilib.Locale, this.isLocal = !1, t) {\r\n        if (t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.id) {\r\n            var e = \"\" + t.id;\r\n            if (\"local\" === e) {\r\n                this.isLocal = !0;\r\n                var i = new Date,\r\n                n = new Date(i.getFullYear(), 0, 1),\r\n                o = new Date(i.getFullYear(), 5, 1);\r\n                this.offsetJan1 = -n.getTimezoneOffset(),\r\n                this.offsetJun1 = -o.getTimezoneOffset(),\r\n                this.offset = Math.min(this.offsetJan1, this.offsetJun1)\r\n            }\r\n            this.id = e\r\n        } else t.offset && (this.offset = \"string\" == typeof t.offset ? parseInt(t.offset, 10) : t.offset, this.id = this.getDisplayName(void 0, void 0));\r\n        t.sync !== void 0 && (this.sync = !!t.sync),\r\n        this.loadParams = t.loadParams,\r\n        this.onLoad = t.onLoad\r\n    }\r\n    this.id ? this._loadtzdata() : new ilib.LocaleInfo(this.locale, {\r\n        sync: this.sync,\r\n        onLoad: ilib.bind(this,\r\n        function(t) {\r\n            this.id = t.getTimeZone() || \"Etc/UTC\",\r\n            this._loadtzdata()\r\n        })\r\n    })\r\n},\r\nilib.TimeZone.prototype._loadtzdata = function() {\r\n    ilib.data.zoneinfo[this.id] || void 0 !== this.offset ? this._initZone() : ilib.loadData({\r\n        object: ilib.TimeZone,\r\n        nonlocale: !0,\r\n        name: \"zoneinfo/\" + this.id + \".json\",\r\n        sync: this.sync,\r\n        loadParams: this.loadParams,\r\n        callback: ilib.bind(this,\r\n        function(t) {\r\n            t && !ilib.isEmpty(t) && (ilib.data.zoneinfo[this.id] = t),\r\n            this._initZone()\r\n        })\r\n    })\r\n},\r\nilib.TimeZone.prototype._initZone = function() {\r\n    if (this.zone = ilib.data.zoneinfo[this.id], this.zone || void 0 !== this.offset || (this.id = \"Etc/UTC\", this.zone = ilib.data.zoneinfo[this.id]), this._calcDSTSavings(), this.offset === void 0 && this.zone.o) {\r\n        var t = this._offsetStringToObj(this.zone.o);\r\n        this.offset = (60 * Math.abs(t.h || 0) + (t.m || 0)) * ilib.signum(t.h || 0)\r\n    }\r\n    this.onLoad && \"function\" == typeof this.onLoad && this.onLoad(this)\r\n},\r\nilib.data.timezone = {},\r\nilib.TimeZone.getAvailableIds = function(t) {\r\n    var e, i = [];\r\n    if (!ilib.data.timezone.list) if (ilib.data.timezone.list = [], ilib._load instanceof ilib.Loader) {\r\n        var n = ilib._load.listAvailableFiles();\r\n        for (var o in n) {\r\n            var s = n[o];\r\n            \"object\" == typeof s && s instanceof Array && s.forEach(function(t) {\r\n                t && t.match(/^zoneinfo/) && ilib.data.timezone.list.push(t.replace(/^zoneinfo\\//, \"\").replace(/\\.json$/, \"\"))\r\n            })\r\n        }\r\n    } else for (e in ilib.data.zoneinfo) ilib.data.zoneinfo[e] && ilib.data.timezone.list.push(e);\r\n    if (t) ilib.data.zoneinfo.zonetab || ilib.loadData({\r\n        object: ilib.TimeZone,\r\n        nonlocale: !0,\r\n        name: \"zoneinfo/zonetab.json\",\r\n        sync: !0,\r\n        callback: ilib.bind(this,\r\n        function(t) {\r\n            t && (ilib.data.zoneinfo.zonetab = t)\r\n        })\r\n    }),\r\n    i = ilib.data.zoneinfo.zonetab[t];\r\n    else {\r\n        i.push(\"local\");\r\n        for (e in ilib.data.timezone.list) ilib.data.timezone.list[e] && i.push(ilib.data.timezone.list[e])\r\n    }\r\n    return i\r\n},\r\nilib.TimeZone.prototype.getId = function() {\r\n    return \"\" + this.id\r\n},\r\nilib.TimeZone.prototype.getDisplayName = function(t, e) {\r\n    switch (e = this.isLocal || this.zone === void 0 ? \"rfc822\": e || \"standard\") {\r\n    default:\r\n    case \"standard\":\r\n        if (this.zone.f && \"zzz\" !== this.zone.f) {\r\n            if ( - 1 !== this.zone.f.indexOf(\"{c}\")) {\r\n                var i = \"\";\r\n                i = this.inDaylightTime(t) ? this.zone.s && this.zone.s.c: this.zone.e && this.zone.e.c;\r\n                var n = new ilib.String(this.zone.f);\r\n                return n.format({\r\n                    c: i || \"\"\r\n                })\r\n            }\r\n            return this.zone.f\r\n        }\r\n        var n = \"GMT\" + this.zone.o;\r\n        return this.inDaylightTime(t) && (n += \"+\" + this.zone.s.v),\r\n        n;\r\n    case \"rfc822\":\r\n        var o = this.getOffset(t),\r\n        s = \"UTC\",\r\n        a = o.h || 0,\r\n        r = o.m || 0;\r\n        return 0 !== a && (s += a > 0 ? \"+\": \"-\", 10 > Math.abs(a) && (s += \"0\"), s += 0 > a ? -a: a, 10 > r && (s += \"0\"), s += r),\r\n        s;\r\n    case \"long\":\r\n        if (this.zone.n) {\r\n            if ( - 1 !== this.zone.n.indexOf(\"{c}\")) {\r\n                var h = this.inDaylightTime(t) ? \"Daylight\": \"Standard\",\r\n                n = new ilib.String(this.zone.n);\r\n                return n.format({\r\n                    c: h || \"\"\r\n                })\r\n            }\r\n            return this.zone.n\r\n        }\r\n        var n = \"GMT\" + this.zone.o;\r\n        return this.inDaylightTime(t) && (n += \"+\" + this.zone.s.v),\r\n        n\r\n    }\r\n},\r\nilib.TimeZone.prototype._offsetStringToObj = function(t) {\r\n    var e, i = \"string\" == typeof t ? t.split(\":\") : [],\r\n    n = {\r\n        h: 0\r\n    };\r\n    return i.length > 0 && (n.h = parseInt(i[0], 10), i.length > 1 && (e = parseInt(i[1], 10), e && (n.m = e), i.length > 2 && (e = parseInt(i[2], 10), e && (n.s = e)))),\r\n    n\r\n},\r\nilib.TimeZone.prototype.getOffset = function(t) {\r\n    if (!t) return this.getRawOffset();\r\n    var e = this.getOffsetMillis(t) / 6e4,\r\n    i = ilib._roundFnc.down(e / 60),\r\n    n = Math.abs(e) - 60 * Math.abs(i),\r\n    o = {\r\n        h: i\r\n    };\r\n    return 0 != n && (o.m = n),\r\n    o\r\n},\r\nilib.TimeZone.prototype.getOffsetMillis = function(t) {\r\n    var e;\r\n    if (this.isLocal && t.dst === void 0) {\r\n        var i = t ? new Date(t.getTime()) : new Date;\r\n        return 6e4 * -i.getTimezoneOffset()\r\n    }\r\n    return e = this.offset,\r\n    t && this.inDaylightTime(t) && (e += this.dstSavings),\r\n    6e4 * e\r\n},\r\nilib.TimeZone.prototype._getOffsetMillisWallTime = function(t) {\r\n    var e;\r\n    return e = this.offset,\r\n    t && this.inDaylightTime(t, !0) && (e += this.dstSavings),\r\n    6e4 * e\r\n},\r\nilib.TimeZone.prototype.getOffsetStr = function(t) {\r\n    var e, i = this.getOffset(t);\r\n    return e = i.h,\r\n    i.m !== void 0 ? (e += \":\" + i.m, i.s !== void 0 && (e += \":\" + i.s)) : e += \":0\",\r\n    e\r\n},\r\nilib.TimeZone.prototype.getRawOffset = function() {\r\n    var t = ilib._roundFnc.down(this.offset / 60),\r\n    e = Math.abs(this.offset) - 60 * Math.abs(t),\r\n    i = {\r\n        h: t\r\n    };\r\n    return 0 != e && (i.m = e),\r\n    i\r\n},\r\nilib.TimeZone.prototype.getRawOffsetMillis = function() {\r\n    return 6e4 * this.offset\r\n},\r\nilib.TimeZone.prototype.getRawOffsetStr = function() {\r\n    var t = this.getRawOffset();\r\n    return t.h + \":\" + (t.m || \"0\")\r\n},\r\nilib.TimeZone.prototype.getDSTSavings = function() {\r\n    if (this.isLocal) {\r\n        var t = Math.abs(this.offsetJan1 - this.offsetJun1),\r\n        e = ilib._roundFnc.down(t / 60),\r\n        i = t - 60 * e;\r\n        return {\r\n            h: e,\r\n            m: i\r\n        }\r\n    }\r\n    return this.zone && this.zone.s ? this._offsetStringToObj(this.zone.s.v) : {\r\n        h: 0\r\n    }\r\n},\r\nilib.TimeZone.prototype.getDSTSavingsStr = function() {\r\n    if (this.isLocal) {\r\n        var t = this.getDSTSavings();\r\n        return t.h + \":\" + t.m\r\n    }\r\n    return this.offset !== void 0 && this.zone && this.zone.s ? this.zone.s.v: \"0:0\"\r\n},\r\nilib.TimeZone.prototype._calcRuleStart = function(t, e) {\r\n    var i, n, o, s, a, r = \"=\",\r\n    h = 0,\r\n    l = 0,\r\n    c = 0,\r\n    d = 0;\r\n    t.j !== void 0 ? n = new ilib.Date.GregRataDie({\r\n        julianday: t.j\r\n    }) : (\"l\" == t.r.charAt(0) || \"f\" == t.r.charAt(0) ? (o = ilib.Cal.newInstance({\r\n        type: \"gregorian\"\r\n    }), r = t.r.charAt(0), h = parseInt(t.r.substring(1), 10), i = \"l\" === r ? o.getMonLength(t.m, e) : 1) : (a = t.r.indexOf(\"<\"), -1 == a && (a = t.r.indexOf(\">\")), -1 != a ? (r = t.r.charAt(a), h = parseInt(t.r.substring(0, a), 10), i = parseInt(t.r.substring(a + 1), 10)) : i = parseInt(t.r, 10)), t.t && (s = t.t.split(\":\"), l = parseInt(s[0], 10), s.length > 1 && (c = parseInt(s[1], 10), s.length > 2 && (d = parseInt(s[2], 10)))), n = new ilib.Date.GregRataDie({\r\n        year: e,\r\n        month: t.m,\r\n        day: i,\r\n        hour: l,\r\n        minute: c,\r\n        second: d\r\n    }));\r\n    var u = n.getRataDie();\r\n    switch (r) {\r\n    case \"l\":\r\n    case \"<\":\r\n        u = n.onOrBefore(h);\r\n        break;\r\n    case \"f\":\r\n    case \">\":\r\n        u = n.onOrAfter(h)\r\n    }\r\n    return u\r\n},\r\nilib.TimeZone.prototype._calcDSTSavings = function() {\r\n    var t = this.getDSTSavings();\r\n    this.dstSavings = (60 * Math.abs(t.h || 0) + (t.m || 0)) * ilib.signum(t.h || 0)\r\n},\r\nilib.TimeZone.prototype._getDSTStartRule = function() {\r\n    return this.zone.s\r\n},\r\nilib.TimeZone.prototype._getDSTEndRule = function() {\r\n    return this.zone.e\r\n},\r\nilib.TimeZone.prototype.inDaylightTime = function(t, e) {\r\n    var i, n, o;\r\n    if (this.isLocal) {\r\n        var s = 0;\r\n        void 0 === t.dst || t.dst || (s = 6e4 * this.dstSavings);\r\n        var a = new Date(t ? t.getTimeExtended() + s: void 0),\r\n        r = Math.max(this.offsetJan1, this.offsetJun1);\r\n        return - a.getTimezoneOffset() === r\r\n    }\r\n    if (t ? t instanceof ilib.Date.GregDate || (t = new ilib.Date.GregDate({\r\n        julianday: t.getJulianDay(),\r\n        timezone: t.getTimeZone()\r\n    })) : t = new ilib.Date.GregDate, !this.useDaylightTime(t.year)) return ! 1;\r\n    i = t.rd.getRataDie();\r\n    var h = this._getDSTStartRule(t.year),\r\n    l = this._getDSTEndRule(t.year);\r\n    return n = this._calcRuleStart(h, t.year),\r\n    o = this._calcRuleStart(l, t.year),\r\n    e ? n += this.dstSavings / 1440 : (n -= this.offset / 1440, o -= (this.offset + this.dstSavings) / 1440),\r\n    o > i && this.dstSavings / 1440 >= o - i && \"boolean\" == typeof t.dst ? t.dst: o > n ? i >= n && o > i ? !0 : !1 : i >= n || o > i ? !0 : !1\r\n},\r\nilib.TimeZone.prototype.useDaylightTime = function() {\r\n    return this.isLocal && this.offsetJan1 !== this.offsetJun1 || this.zone !== void 0 && this.zone.s !== void 0 && this.zone.e !== void 0\r\n},\r\nilib.TimeZone.prototype.getCountry = function() {\r\n    return this.zone.c\r\n},\r\nilib.ResBundle = function(t) {\r\n    var e, i;\r\n    this.locale = new ilib.Locale,\r\n    this.baseName = \"strings\",\r\n    this.type = \"text\",\r\n    this.loadParams = {},\r\n    this.missing = \"source\",\r\n    this.sync = !0,\r\n    t && (t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.name && (this.baseName = t.name), t.type && (this.type = t.type), this.lengthen = t.lengthen || !1, t.sync !== void 0 && (this.sync = 1 == t.sync), t.loadParams !== void 0 && (this.loadParams = t.loadParams), t.missing !== void 0 && (\"pseudo\" === t.missing || \"empty\" === t.missing) && (this.missing = t.missing)),\r\n    this.map = {},\r\n    ilib.ResBundle[this.baseName] || (ilib.ResBundle[this.baseName] = {}),\r\n    e = this.locale.isPseudo() ? new ilib.Locale(\"en-US\") : this.locale,\r\n    ilib.loadData({\r\n        object: ilib.ResBundle[this.baseName],\r\n        locale: e,\r\n        name: this.baseName + \".json\",\r\n        sync: this.sync,\r\n        loadParams: this.loadParams,\r\n        callback: ilib.bind(this,\r\n        function(n) {\r\n            n || (n = ilib.data[this.baseName] || {},\r\n            i = e.getSpec().replace(/-/g, \"_\"), ilib.ResBundle[this.baseName].cache[i] = n),\r\n            this.map = n,\r\n            this.locale.isPseudo() ? (ilib.ResBundle.pseudomap || (ilib.ResBundle.pseudomap = {}), this._loadPseudo(this.locale, t.onLoad)) : \"pseudo\" === this.missing ? (ilib.ResBundle.pseudomap || (ilib.ResBundle.pseudomap = {}), new ilib.LocaleInfo(this.locale, {\r\n                sync: this.sync,\r\n                loadParams: this.loadParams,\r\n                onLoad: ilib.bind(this,\r\n                function(e) {\r\n                    var i = new ilib.Locale(\"zxx\", \"XX\", void 0, e.getDefaultScript());\r\n                    this._loadPseudo(i, t.onLoad)\r\n                })\r\n            })) : t && \"function\" == typeof t.onLoad && t.onLoad(this)\r\n        })\r\n    })\r\n},\r\nilib.ResBundle.defaultPseudo = ilib.data.pseudomap || {\r\n    a: \"\\u00e0\",\r\n    e: \"\\u00eb\",\r\n    i: \"\\u00ed\",\r\n    o: \"\\u00f5\",\r\n    u: \"\\u00fc\",\r\n    y: \"\\u00ff\",\r\n    A: \"\\u00c3\",\r\n    E: \"\\u00cb\",\r\n    I: \"\\u00cf\",\r\n    O: \"\\u00d8\",\r\n    U: \"\\u00da\",\r\n    Y: \"\\u0176\"\r\n},\r\nilib.ResBundle.prototype = {\r\n    _loadPseudo: function(t, e) {\r\n        ilib.loadData({\r\n            object: ilib.ResBundle.pseudomap,\r\n            locale: t,\r\n            name: \"pseudomap.json\",\r\n            sync: this.sync,\r\n            loadParams: this.loadParams,\r\n            callback: ilib.bind(this,\r\n            function(i) {\r\n                if (!i || ilib.isEmpty(i)) {\r\n                    i = ilib.ResBundle.defaultPseudo;\r\n                    var n = t.getSpec().replace(/-/g, \"_\");\r\n                    ilib.ResBundle.pseudomap.cache[n] = i\r\n                }\r\n                this.pseudomap = i,\r\n                \"function\" == typeof e && e(this)\r\n            })\r\n        })\r\n    },\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    getName: function() {\r\n        return this.baseName\r\n    },\r\n    getType: function() {\r\n        return this.type\r\n    },\r\n    pseudo: function(t) {\r\n        if (!t) return void 0;\r\n        var e, i = \"\";\r\n        for (e = 0; t.length > e; e++) if (\"raw\" !== this.type) {\r\n            if (\"html\" === this.type || \"xml\" === this.type) if (\"<\" === t.charAt(e)) {\r\n                for (i += t.charAt(e++); t.length > e && \">\" !== t.charAt(e);) i += t.charAt(e++);\r\n                t.length > e && (i += t.charAt(e++))\r\n            } else if (\"&\" === t.charAt(e)) {\r\n                for (i += t.charAt(e++); t.length > e && \";\" !== t.charAt(e) && \" \" !== t.charAt(e);) i += t.charAt(e++);\r\n                t.length > e && (i += t.charAt(e++))\r\n            }\r\n            if (t.length > e) if (\"{\" === t.charAt(e)) {\r\n                for (i += t.charAt(e++); t.length > e && \"}\" !== t.charAt(e);) i += t.charAt(e++);\r\n                t.length > e && (i += t.charAt(e))\r\n            } else i += this.pseudomap[t.charAt(e)] || t.charAt(e)\r\n        } else i += this.pseudomap[t.charAt(e)] || t.charAt(e);\r\n        if (this.lengthen) {\r\n            var n;\r\n            for (n = 20 >= i.length ? Math.round(i.length / 2) : i.length > 20 && 40 >= i.length ? Math.round(i.length / 3) : Math.round(i.length / 5), e = n - 1; e >= 0; e--) i += e % 10\r\n        }\r\n        return (\"Hans\" === this.locale.getScript() || \"Hant\" === this.locale.getScript() || \"Hani\" === this.locale.getScript() || \"Hrkt\" === this.locale.getScript() || \"Jpan\" === this.locale.getScript() || \"Hira\" === this.locale.getScript() || \"Kana\" === this.locale.getScript()) && (i = i.replace(/ /g, \"\")),\r\n        i\r\n    },\r\n    escapeXml: function(t) {\r\n        return t = t.replace(/&/g, \"&amp;\"),\r\n        t = t.replace(/</g, \"&lt;\"),\r\n        t = t.replace(/>/g, \"&gt;\")\r\n    },\r\n    unescapeXml: function(t) {\r\n        return t = t.replace(/&amp;/g, \"&\"),\r\n        t = t.replace(/&lt;/g, \"<\"),\r\n        t = t.replace(/&gt;/g, \">\")\r\n    },\r\n    makeKey: function(t) {\r\n        var e = t.replace(/\\s+/gm, \" \");\r\n        return \"xml\" === this.type || \"html\" === this.type ? this.unescapeXml(e) : e\r\n    },\r\n    getString: function(t, e, i) {\r\n        if (!t && !e) return new ilib.String(\"\");\r\n        var n;\r\n        if (this.locale.isPseudo()) {\r\n            var o = t ? t: this.map[e];\r\n            n = this.pseudo(o || e)\r\n        } else {\r\n            var s = e || this.makeKey(t);\r\n            n = this.map[s] !== void 0 ? this.map[s] : \"pseudo\" === this.missing ? this.pseudo(t || e) : \"empty\" === this.missing ? \"\": t\r\n        }\r\n        if (i && \"none\" !== i && (\"default\" == i && (i = this.type), \"xml\" === i || \"html\" === i ? n = this.escapeXml(n) : (\"js\" == i || \"attribute\" === i) && (n = n.replace(/'/g, \"\\\\'\").replace(/\"/g, '\\\\\"'))), void 0 === n) return void 0;\r\n        var a = new ilib.String(n);\r\n        return a.setLocale(this.locale.getSpec(), !0, this.loadParams),\r\n        a\r\n    },\r\n    containsKey: function(t, e) {\r\n        if (t === void 0 && e === void 0) return ! 1;\r\n        var i = e || this.makeKey(t);\r\n        return this.map[i] !== void 0\r\n    },\r\n    getResObj: function() {\r\n        return this.map\r\n    }\r\n},\r\nilib.shallowCopy = function(t, e) {\r\n    var i = void 0;\r\n    if (t && e) for (i in t) void 0 !== i && t[i] !== void 0 && (e[i] = t[i])\r\n},\r\nilib.deepCopy = function(t, e) {\r\n    var i;\r\n    for (i in t) i && (\"object\" == typeof t[i] ? (e[i] = {},\r\n    ilib.deepCopy(t[i], e[i])) : e[i] = t[i]);\r\n    return e\r\n},\r\nilib.mapString = function(t, e) {\r\n    var i = \"\";\r\n    if (e && t) for (var n = 0; t.length > n; n++) {\r\n        var o = t.charAt(n);\r\n        i += e[o] || o\r\n    } else i = t;\r\n    return i\r\n},\r\nilib.indexOf = function(t, e) {\r\n    if (!t || !e) return - 1;\r\n    if (\"function\" == typeof t.indexOf) return t.indexOf(e);\r\n    for (var i = 0; t.length > i; i++) if (t[i] === e) return i;\r\n    return - 1\r\n},\r\nilib.toHexString = function(t, e) {\r\n    var i, n = \"\",\r\n    o = e && 9 > e ? e: 4;\r\n    if (!t) return \"\";\r\n    for (i = 0; t.length > i; i++) {\r\n        var s = t.charCodeAt(i).toString(16);\r\n        n += \"00000000\".substring(0, o - s.length) + s\r\n    }\r\n    return n.toUpperCase()\r\n},\r\nilib.DateFmt = function(t) {\r\n    var e, i, n, o = !0,\r\n    s = void 0;\r\n    if (this.locale = new ilib.Locale, this.type = \"date\", this.length = \"s\", this.dateComponents = \"dmy\", this.timeComponents = \"ahm\", this.meridiems = \"default\", t) {\r\n        if (t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.type && (\"date\" === t.type || \"time\" === t.type || \"datetime\" === t.type) && (this.type = t.type), t.calendar && (this.calName = t.calendar), t.length && (\"short\" === t.length || \"medium\" === t.length || \"long\" === t.length || \"full\" === t.length) && (this.length = t.length.charAt(0)), t.date) {\r\n            for (e = t.date.split(\"\"), e.sort(function(t, e) {\r\n                return e > t ? -1 : t > e ? 1 : 0\r\n            }), n = !1, i = 0; e.length > i; i++) if (\"d\" !== e[i] && \"m\" !== e[i] && \"y\" !== e[i] && \"w\" !== e[i] && \"n\" !== e[i]) {\r\n                n = !0;\r\n                break\r\n            }\r\n            n || (this.dateComponents = e.join(\"\"))\r\n        }\r\n        if (t.time) {\r\n            for (e = t.time.split(\"\"), e.sort(function(t, e) {\r\n                return e > t ? -1 : t > e ? 1 : 0\r\n            }), this.badTime = !1, i = 0; e.length > i; i++) if (\"h\" !== e[i] && \"m\" !== e[i] && \"s\" !== e[i] && \"a\" !== e[i] && \"z\" !== e[i]) {\r\n                this.badTime = !0;\r\n                break\r\n            }\r\n            this.badTime || (this.timeComponents = e.join(\"\"))\r\n        } ! t.clock || \"12\" !== t.clock && \"24\" !== t.clock || (this.clock = t.clock),\r\n        t.template && (this.type = \"\", this.length = \"\", this.dateComponents = \"\", this.timeComponents = \"\", this.template = t.template),\r\n        t.timezone ? this.tz = t.timezone instanceof ilib.TimeZone ? t.timezone: new ilib.TimeZone({\r\n            locale: this.locale,\r\n            id: t.timezone\r\n        }) : t.locale && (this.tz = new ilib.TimeZone({\r\n            locale: this.locale\r\n        })),\r\n        \"boolean\" == typeof t.useNative && (this.useNative = t.useNative),\r\n        t.meridiems !== void 0 && \"chinese\" === t.meridiems && (this.meridiems = t.meridiems),\r\n        t.sync !== void 0 && (o = t.sync === !0),\r\n        s = t.loadParams\r\n    }\r\n    ilib.DateFmt.cache || (ilib.DateFmt.cache = {}),\r\n    new ilib.LocaleInfo(this.locale, {\r\n        sync: o,\r\n        loadParams: s,\r\n        onLoad: ilib.bind(this,\r\n        function(e) {\r\n            this.locinfo = e,\r\n            this.calName = this.calName || this.locinfo.getCalendar() || \"gregorian\",\r\n            this.cal = ilib.Cal.newInstance({\r\n                type: this.calName\r\n            }),\r\n            this.cal || (this.cal = new ilib.Cal.Gregorian),\r\n            new ilib.ResBundle({\r\n                locale: this.locale,\r\n                name: \"sysres\",\r\n                sync: o,\r\n                loadParams: s,\r\n                onLoad: ilib.bind(this,\r\n                function(e) {\r\n                    this.sysres = e,\r\n                    this.template ? (this._massageTemplate(), t && \"function\" == typeof t.onLoad && t.onLoad(this)) : ilib.loadData({\r\n                        object: ilib.DateFmt,\r\n                        locale: this.locale,\r\n                        name: \"dateformats.json\",\r\n                        sync: o,\r\n                        loadParams: s,\r\n                        callback: ilib.bind(this,\r\n                        function(e) {\r\n                            if (!e) {\r\n                                e = ilib.data.dateformats || ilib.DateFmt.defaultFmt;\r\n                                var i = this.locale.getSpec().replace(/-/g, \"_\");\r\n                                ilib.DateFmt.cache[i] = e\r\n                            }\r\n                            this.clock === void 0 && (this.clock = this.locinfo.getClock()),\r\n                            this._initTemplate(e),\r\n                            this._massageTemplate(),\r\n                            t && \"function\" == typeof t.onLoad && t.onLoad(this)\r\n                        })\r\n                    })\r\n                })\r\n            })\r\n        })\r\n    })\r\n},\r\nilib.DateFmt.lenmap = {\r\n    s: \"short\",\r\n    m: \"medium\",\r\n    l: \"long\",\r\n    f: \"full\"\r\n},\r\nilib.DateFmt.zeros = \"0000\",\r\nilib.DateFmt.defaultFmt = {\r\n    gregorian: {\r\n        order: \"{date} {time}\",\r\n        date: {\r\n            dmwy: \"EEE d/MM/yyyy\",\r\n            dmy: \"d/MM/yyyy\",\r\n            dmw: \"EEE d/MM\",\r\n            dm: \"d/MM\",\r\n            my: \"MM/yyyy\",\r\n            dw: \"EEE d\",\r\n            d: \"dd\",\r\n            m: \"MM\",\r\n            y: \"yyyy\",\r\n            n: \"NN\",\r\n            w: \"EEE\"\r\n        },\r\n        time: {\r\n            12 : \"h:mm:ssa\",\r\n            24 : \"H:mm:ss\"\r\n        },\r\n        range: {\r\n            c00: \"{st} - {et}, {sd}/{sm}/{sy}\",\r\n            c01: \"{sd}/{sm} {st} - {ed}/{em} {et}, {sy}\",\r\n            c02: \"{sd}/{sm} {st} - {ed}/{em} {et}, {sy}\",\r\n            c03: \"{sd}/{sm}/{sy} {st} - {ed}/{em}/{ey} {et}\",\r\n            c10: \"{sd}-{ed}/{sm}/{sy}\",\r\n            c11: \"{sd}/{sm} - {ed}/{em} {sy}\",\r\n            c12: \"{sd}/{sm}/{sy} - {ed}/{em}/{ey}\",\r\n            c20: \"{sm}/{sy} - {em}/{ey}\",\r\n            c30: \"{sy} - {ey}\"\r\n        }\r\n    },\r\n    islamic: \"gregorian\",\r\n    hebrew: \"gregorian\",\r\n    julian: \"gregorian\",\r\n    buddhist: \"gregorian\",\r\n    persian: \"gregorian\",\r\n    \"persian-algo\": \"gregorian\",\r\n    han: \"gregorian\"\r\n},\r\nilib.DateFmt.monthNameLenMap = {\r\n    \"short\": \"N\",\r\n    medium: \"NN\",\r\n    \"long\": \"MMM\",\r\n    full: \"MMMM\"\r\n},\r\nilib.DateFmt.weekDayLenMap = {\r\n    \"short\": \"E\",\r\n    medium: \"EE\",\r\n    \"long\": \"EEE\",\r\n    full: \"EEEE\"\r\n},\r\nilib.DateFmt.prototype = {\r\n    _initTemplate: function(t) {\r\n        if (!t[this.calName]) throw \"No formats available for calendar \" + this.calName + \" in locale \" + (\"\" + this.locale);\r\n        switch (this.formats = t[this.calName], \"string\" == typeof this.formats && (this.formats = t[this.formats]), this.template = \"\", this.type) {\r\n        case \"datetime\":\r\n            this.template = this.formats && this._getLengthFormat(this.formats.order, this.length) || \"{date} {time}\",\r\n            this.template = this.template.replace(\"{date}\", this._getFormat(this.formats.date, this.dateComponents, this.length) || \"\"),\r\n            this.template = this.template.replace(\"{time}\", this._getFormat(this.formats.time[this.clock], this.timeComponents, this.length) || \"\");\r\n            break;\r\n        case \"date\":\r\n            this.template = this._getFormat(this.formats.date, this.dateComponents, this.length);\r\n            break;\r\n        case \"time\":\r\n            this.template = this._getFormat(this.formats.time[this.clock], this.timeComponents, this.length)\r\n        }\r\n    },\r\n    _massageTemplate: function() {\r\n        var t;\r\n        if (this.clock && this.template) {\r\n            var e = \"\";\r\n            switch (this.clock) {\r\n            case \"24\":\r\n                for (t = 0; this.template.length > t; t++) if (\"'\" == this.template.charAt(t)) {\r\n                    for (e += this.template.charAt(t++); this.template.length > t && \"'\" !== this.template.charAt(t);) e += this.template.charAt(t++);\r\n                    this.template.length > t && (e += this.template.charAt(t))\r\n                } else e += \"K\" == this.template.charAt(t) ? \"k\": \"h\" == this.template.charAt(t) ? \"H\": this.template.charAt(t);\r\n                this.template = e;\r\n                break;\r\n            case \"12\":\r\n                for (t = 0; this.template.length > t; t++) if (\"'\" == this.template.charAt(t)) {\r\n                    for (e += this.template.charAt(t++); this.template.length > t && \"'\" !== this.template.charAt(t);) e += this.template.charAt(t++);\r\n                    this.template.length > t && (e += this.template.charAt(t))\r\n                } else e += \"k\" == this.template.charAt(t) ? \"K\": \"H\" == this.template.charAt(t) ? \"h\": this.template.charAt(t);\r\n                this.template = e\r\n            }\r\n        }\r\n        this.templateArr = this._tokenize(this.template);\r\n        var i;\r\n        \"boolean\" == typeof this.useNative ? this.useNative && (i = this.locinfo.getNativeDigits(), i && (this.digits = i)) : \"native\" === this.locinfo.getDigitsStyle() && (i = this.locinfo.getNativeDigits(), i && (this.useNative = !0, this.digits = i))\r\n    },\r\n    _tokenize: function(t) {\r\n        var e, i, n, o = 0,\r\n        s = [];\r\n        if (t) for (; t.length > o;) {\r\n            if (i = t.charAt(o), e = o, \"'\" === i) {\r\n                for (o++; t.length > o && \"'\" !== t.charAt(o);) o++;\r\n                t.length > o && o++\r\n            } else if (i >= \"a\" && \"z\" >= i || i >= \"A\" && \"Z\" >= i) for (n = t.charAt(o); t.length > o && i === n;) i = t.charAt(++o);\r\n            else for (; t.length > o && \"'\" !== i && (\"a\" > i || i > \"z\") && (\"A\" > i || i > \"Z\");) i = t.charAt(++o);\r\n            s.push(t.substring(e, o))\r\n        }\r\n        return s\r\n    },\r\n    _getFormat: function(t, e, i) {\r\n        return e !== void 0 && t[e] ? this._getLengthFormat(t[e], i) : void 0\r\n    },\r\n    _getLengthFormat: function(t, e) {\r\n        return \"string\" == typeof t ? t: t[e] ? t[e] : void 0\r\n    },\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    getTemplate: function() {\r\n        return this.template\r\n    },\r\n    getType: function() {\r\n        return this.type\r\n    },\r\n    getCalendar: function() {\r\n        return this.cal.getType()\r\n    },\r\n    getLength: function() {\r\n        return ilib.DateFmt.lenmap[this.length] || \"\"\r\n    },\r\n    getDateComponents: function() {\r\n        return this.dateComponents || \"\"\r\n    },\r\n    getTimeComponents: function() {\r\n        return this.timeComponents || \"\"\r\n    },\r\n    getTimeZone: function() {\r\n        return this.tz || (this.tz = new ilib.TimeZone({\r\n            id: ilib.getTimeZone()\r\n        })),\r\n        this.tz\r\n    },\r\n    getClock: function() {\r\n        return this.clock || this.locinfo.getClock()\r\n    },\r\n    _getTemplate: function(t, e) {\r\n        return \"gregorian\" !== e ? t + \"-\" + e: t\r\n    },\r\n    getMonthsOfYear: function(t) {\r\n        var e, i, n = t && t.length || this.getLength(),\r\n        o = ilib.DateFmt.monthNameLenMap[n],\r\n        s = [void 0];\r\n        t && (t.date && (e = ilib.Date._dateToIlib(t.date)), t.year && (e = ilib.Date.newInstance({\r\n            year: t.year,\r\n            month: 1,\r\n            day: 1,\r\n            type: this.cal.getType()\r\n        }))),\r\n        e || (e = this.cal.newDateInstance()),\r\n        i = this.cal.getNumMonths(e.getYears());\r\n        for (var a = 1; i >= a; a++) s[a] = \"\" + this.sysres.getString(this._getTemplate(o + a, this.cal.getType()));\r\n        return s\r\n    },\r\n    getDaysOfWeek: function(t) {\r\n        for (var e = t && t.length || this.getLength(), i = ilib.DateFmt.weekDayLenMap[e], n = [], o = 0; 7 > o; o++) n[o] = \"\" + this.sysres.getString(this._getTemplate(i + o, this.cal.getType()));\r\n        return n\r\n    },\r\n    toString: function() {\r\n        return this.getTemplate()\r\n    },\r\n    _pad: function(t, e) {\r\n        \"string\" != typeof t && (t = \"\" + t);\r\n        var i = 0;\r\n        return \"-\" === t.charAt(0) && i++,\r\n        t.length >= e + i ? t: t.substring(0, i) + ilib.DateFmt.zeros.substring(0, e - t.length + i) + t.substring(i)\r\n    },\r\n    _formatTemplate: function(t, e) {\r\n        var i, n, o, s, a = \"\";\r\n        for (i = 0; e.length > i; i++) switch (e[i]) {\r\n        case \"d\":\r\n            a += t.day || 1;\r\n            break;\r\n        case \"dd\":\r\n            a += this._pad(t.day || \"1\", 2);\r\n            break;\r\n        case \"yy\":\r\n            o = \"\" + (t.year || 0) % 100,\r\n            a += this._pad(o, 2);\r\n            break;\r\n        case \"yyyy\":\r\n            a += this._pad(t.year || \"0\", 4);\r\n            break;\r\n        case \"M\":\r\n            a += t.month || 1;\r\n            break;\r\n        case \"MM\":\r\n            a += this._pad(t.month || \"1\", 2);\r\n            break;\r\n        case \"h\":\r\n            o = (t.hour || 0) % 12,\r\n            0 == o && (o = \"12\"),\r\n            a += o;\r\n            break;\r\n        case \"hh\":\r\n            o = (t.hour || 0) % 12,\r\n            0 == o && (o = \"12\"),\r\n            a += this._pad(o, 2);\r\n            break;\r\n        case \"K\":\r\n            o = (t.hour || 0) % 12,\r\n            a += o;\r\n            break;\r\n        case \"KK\":\r\n            o = (t.hour || 0) % 12,\r\n            a += this._pad(o, 2);\r\n            break;\r\n        case \"H\":\r\n            a += t.hour || \"0\";\r\n            break;\r\n        case \"HH\":\r\n            a += this._pad(t.hour || \"0\", 2);\r\n            break;\r\n        case \"k\":\r\n            a += 0 == t.hour ? \"24\": t.hour;\r\n            break;\r\n        case \"kk\":\r\n            o = 0 == t.hour ? \"24\": t.hour,\r\n            a += this._pad(o, 2);\r\n            break;\r\n        case \"m\":\r\n            a += t.minute || \"0\";\r\n            break;\r\n        case \"mm\":\r\n            a += this._pad(t.minute || \"0\", 2);\r\n            break;\r\n        case \"s\":\r\n            a += t.minute || \"0\";\r\n            break;\r\n        case \"ss\":\r\n            a += this._pad(t.second || \"0\", 2);\r\n            break;\r\n        case \"S\":\r\n            a += t.millisecond || \"0\";\r\n            break;\r\n        case \"SSS\":\r\n            a += this._pad(t.millisecond || \"0\", 3);\r\n            break;\r\n        case \"N\":\r\n        case \"NN\":\r\n        case \"MMM\":\r\n        case \"MMMM\":\r\n            n = e[i] + (t.month || 1),\r\n            a += this.sysres.getString(void 0, n + \"-\" + this.calName) || this.sysres.getString(void 0, n);\r\n            break;\r\n        case \"E\":\r\n        case \"EE\":\r\n        case \"EEE\":\r\n        case \"EEEE\":\r\n            n = e[i] + t.getDayOfWeek(),\r\n            a += this.sysres.getString(void 0, n + \"-\" + this.calName) || this.sysres.getString(void 0, n);\r\n            break;\r\n        case \"a\":\r\n            n = \"chinese\" === this.meridiems ? 6 > t.hour ? \"azh0\": 9 > t.hour ? \"azh1\": 12 > t.hour ? \"azh2\": 13 > t.hour ? \"azh3\": 18 > t.hour ? \"azh4\": 21 > t.hour ? \"azh5\": \"azh6\": 12 > t.hour ? \"a0\": \"a1\",\r\n            a += this.sysres.getString(void 0, n + \"-\" + this.calName) || this.sysres.getString(void 0, n);\r\n            break;\r\n        case \"w\":\r\n            a += t.getWeekOfYear();\r\n            break;\r\n        case \"ww\":\r\n            a += this._pad(t.getWeekOfYear(), 2);\r\n            break;\r\n        case \"D\":\r\n            a += t.getDayOfYear();\r\n            break;\r\n        case \"DD\":\r\n            a += this._pad(t.getDayOfYear(), 2);\r\n            break;\r\n        case \"DDD\":\r\n            a += this._pad(t.getDayOfYear(), 3);\r\n            break;\r\n        case \"W\":\r\n            a += t.getWeekOfMonth(this.locale);\r\n            break;\r\n        case \"G\":\r\n            n = \"G\" + t.getEra(),\r\n            a += this.sysres.getString(void 0, n + \"-\" + this.calName) || this.sysres.getString(void 0, n);\r\n            break;\r\n        case \"O\":\r\n            o = this.sysres.getString(\"1#1st|2#2nd|3#3rd|21#21st|22#22nd|23#23rd|31#31st|#{num}th\", \"ordinalChoice\"),\r\n            a += o.formatChoice(t.day, {\r\n                num: t.day\r\n            });\r\n            break;\r\n        case \"z\":\r\n            s = this.getTimeZone(),\r\n            a += s.getDisplayName(t, \"standard\");\r\n            break;\r\n        case \"Z\":\r\n            s = this.getTimeZone(),\r\n            a += s.getDisplayName(t, \"rfc822\");\r\n            break;\r\n        default:\r\n            a += e[i].replace(/'/g, \"\")\r\n        }\r\n        return this.digits && (a = ilib.mapString(a, this.digits)),\r\n        a\r\n    },\r\n    format: function(t) {\r\n        var e = this.tz && this.tz.getId() || \"local\",\r\n        i = ilib.Date._dateToIlib(t, e);\r\n        if (! (i.getCalendar && i instanceof ilib.Date)) throw \"Wrong date type passed to ilib.DateFmt.format()\";\r\n        var n = i.timezone || \"local\";\r\n        if (n !== e || i.getCalendar() !== this.calName) {\r\n            var o = ilib.Date.newInstance({\r\n                type: this.calName,\r\n                timezone: e,\r\n                julianday: i.getJulianDay()\r\n            });\r\n            i = o\r\n        }\r\n        return this._formatTemplate(i, this.templateArr)\r\n    },\r\n    formatRelative: function(t, e) {\r\n        t = ilib.Date._dateToIlib(t),\r\n        e = ilib.Date._dateToIlib(e);\r\n        var i, n, o, s, a, r;\r\n        if (\"object\" != typeof t || !t.getCalendar || t.getCalendar() !== this.calName || \"object\" != typeof e || !e.getCalendar || e.getCalendar() !== this.calName) throw \"Wrong calendar type\";\r\n        if (i = t.getRataDie(), n = e.getRataDie(), i > n ? (a = i - n, o = this.sysres.getString(\"{duration} ago\")) : (a = n - i, o = this.sysres.getString(\"in {duration}\")), 694444e-9 > a) switch (r = Math.round(86400 * a), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}s\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 se|#{num} sec\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 sec|#{num} sec\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 second|#{num} seconds\")\r\n        } else if (.041666667 > a) switch (r = Math.round(1440 * a), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}m\", \"durationShortMinutes\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 mi|#{num} min\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 min|#{num} min\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 minute|#{num} minutes\")\r\n        } else if (1 > a) switch (r = Math.round(24 * a), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}h\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 hr|#{num} hrs\", \"durationMediumHours\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 hr|#{num} hrs\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 hour|#{num} hours\")\r\n        } else if (14 > a) switch (r = Math.round(a), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}d\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 dy|#{num} dys\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 day|#{num} days\", \"durationLongDays\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 day|#{num} days\")\r\n        } else if (84 > a) switch (r = Math.round(a / 7), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}w\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 wk|#{num} wks\", \"durationMediumWeeks\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 wk|#{num} wks\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 week|#{num} weeks\")\r\n        } else if (730 > a) switch (r = Math.round(a / 30.4), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}m\", \"durationShortMonths\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 mo|#{num} mos\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 mon|#{num} mons\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 month|#{num} months\")\r\n        } else switch (r = Math.round(a / 365), this.length) {\r\n        case \"s\":\r\n            s = this.sysres.getString(\"#{num}y\");\r\n            break;\r\n        case \"m\":\r\n            s = this.sysres.getString(\"1#1 yr|#{num} yrs\", \"durationMediumYears\");\r\n            break;\r\n        case \"l\":\r\n            s = this.sysres.getString(\"1#1 yr|#{num} yrs\");\r\n            break;\r\n        default:\r\n        case \"f\":\r\n            s = this.sysres.getString(\"1#1 year|#{num} years\")\r\n        }\r\n        return o.format({\r\n            duration: s.formatChoice(r, {\r\n                num: r\r\n            })\r\n        })\r\n    }\r\n},\r\nilib.DateRngFmt = function(t) {\r\n    var e = !0,\r\n    i = void 0;\r\n    this.locale = new ilib.Locale,\r\n    this.length = \"s\",\r\n    t && (t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.calendar && (this.calName = t.calendar), t.length && (\"short\" === t.length || \"medium\" === t.length || \"long\" === t.length || \"full\" === t.length) && (this.length = t.length.charAt(0)), t.sync !== void 0 && (e = 1 == t.sync), i = t.loadParams);\r\n    var n = {};\r\n    ilib.shallowCopy(t, n),\r\n    n.sync = e,\r\n    n.loadParams = i,\r\n    n.onLoad = ilib.bind(this,\r\n    function(e) {\r\n        this.dateFmt = e,\r\n        e && (this.locinfo = this.dateFmt.locinfo, this.calName = this.calName || this.locinfo.getCalendar() || \"gregorian\", this.cal = ilib.Cal.newInstance({\r\n            type: this.calName\r\n        }), this.cal || (this.cal = new ilib.Cal.Gregorian), this.timeTemplate = this.dateFmt._getFormat(this.dateFmt.formats.time[this.dateFmt.clock], this.dateFmt.timeComponents, this.length) || \"hh:mm\", this.timeTemplateArr = this.dateFmt._tokenize(this.timeTemplate), t && \"function\" == typeof t.onLoad && t.onLoad(this))\r\n    }),\r\n    new ilib.DateFmt(n)\r\n},\r\nilib.DateRngFmt.prototype = {\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    getCalendar: function() {\r\n        return this.dateFmt.getCalendar()\r\n    },\r\n    getLength: function() {\r\n        return ilib.DateFmt.lenmap[this.length] || \"\"\r\n    },\r\n    getTimeZone: function() {\r\n        return this.dateFmt.getTimeZone()\r\n    },\r\n    getClock: function() {\r\n        return this.dateFmt.getClock()\r\n    },\r\n    format: function(t, e) {\r\n        var i, n, o, s, a, r = \"\";\r\n        if (\"object\" != typeof t || !t.getCalendar || t.getCalendar() !== this.calName || \"object\" != typeof e || !e.getCalendar || e.getCalendar() !== this.calName) throw \"Wrong calendar type\";\r\n        return i = t.getRataDie(),\r\n        n = e.getRataDie(),\r\n        r = 3 > n - i ? t.year === e.year ? t.month === e.month ? t.day === e.day ? new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c00\", this.length)) : new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c01\", this.length)) : new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c02\", this.length)) : new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c03\", this.length)) : 730 > n - i ? t.year === e.year ? t.month === e.month ? new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c10\", this.length)) : new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c11\", this.length)) : new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c12\", this.length)) : 3650 > n - i ? new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c20\", this.length)) : new ilib.String(this.dateFmt._getFormat(this.dateFmt.formats.range, \"c30\", this.length)),\r\n        o = this.dateFmt._tokenize(this.dateFmt._getFormat(this.dateFmt.formats.date, \"y\", this.length) || \"yyyy\"),\r\n        s = this.dateFmt._tokenize(this.dateFmt._getFormat(this.dateFmt.formats.date, \"m\", this.length) || \"MM\"),\r\n        a = this.dateFmt._tokenize(this.dateFmt._getFormat(this.dateFmt.formats.date, \"d\", this.length) || \"dd\"),\r\n        r.format({\r\n            sy: this.dateFmt._formatTemplate(t, o),\r\n            sm: this.dateFmt._formatTemplate(t, s),\r\n            sd: this.dateFmt._formatTemplate(t, a),\r\n            st: this.dateFmt._formatTemplate(t, this.timeTemplateArr),\r\n            ey: this.dateFmt._formatTemplate(e, o),\r\n            em: this.dateFmt._formatTemplate(e, s),\r\n            ed: this.dateFmt._formatTemplate(e, a),\r\n            et: this.dateFmt._formatTemplate(e, this.timeTemplateArr)\r\n        })\r\n    }\r\n},\r\nilib.bsearch = function(t, e, i) {\r\n    if (e === void 0 || !e || t === void 0) return - 1;\r\n    for (var n, o = e.length - 1,\r\n    s = 0,\r\n    a = 0,\r\n    r = i || ilib.bsearch.numbers; o >= s;) if (a = Math.floor((o + s) / 2), n = r(e[a], t), n > 0) o = a - 1;\r\n    else {\r\n        if (! (0 > n)) return a;\r\n        s = a + 1\r\n    }\r\n    return s\r\n},\r\nilib.bsearch.numbers = function(t, e) {\r\n    return t - e\r\n},\r\nilib.bisectionSearch = function(t, e, i, n, o) {\r\n    if (\"number\" != typeof t || \"number\" != typeof e || \"number\" != typeof i || \"function\" != typeof o) return 0 / 0;\r\n    var s, a = 0,\r\n    r = n > 0 ? n: 1e-13;\r\n    do a = (i + e) / 2,\r\n    s = o(a),\r\n    s > t ? i = a: t > s && (e = a);\r\n    while (i - e > r);\r\n    return a\r\n},\r\nilib.Date.GregDate = function(t) {\r\n    if (this.cal = new ilib.Cal.Gregorian, this.timezone = \"local\", t) {\r\n        if (t.locale) {\r\n            this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale;\r\n            var e = new ilib.LocaleInfo(this.locale);\r\n            this.timezone = e.getTimeZone()\r\n        }\r\n        if (t.timezone && (this.timezone = \"\" + t.timezone), t.year || t.month || t.day || t.hour || t.minute || t.second || t.millisecond) {\r\n            if (this.year = parseInt(t.year, 10) || 0, this.month = parseInt(t.month, 10) || 1, this.day = parseInt(t.day, 10) || 1, this.hour = parseInt(t.hour, 10) || 0, this.minute = parseInt(t.minute, 10) || 0, this.second = parseInt(t.second, 10) || 0, this.millisecond = parseInt(t.millisecond, 10) || 0, \"boolean\" == typeof t.dst && (this.dst = t.dst), this.rd = this.newRd(t), this.offset = 0, \"local\" === this.timezone && t.dst === void 0) {\r\n                var i = new Date(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond);\r\n                this.offset = -i.getTimezoneOffset() / 1440\r\n            } else this.tz || (this.tz = new ilib.TimeZone({\r\n                id: this.timezone\r\n            })),\r\n            this.offset = this.tz._getOffsetMillisWallTime(this) / 864e5;\r\n            0 !== this.offset && (this.rd = this.newRd({\r\n                rd: this.rd.getRataDie() - this.offset\r\n            }))\r\n        }\r\n    }\r\n    this.rd || (this.rd = this.newRd(t), this._calcDateComponents())\r\n},\r\nilib.Date.GregDate.prototype = new ilib.Date({\r\n    noinstance: !0\r\n}),\r\nilib.Date.GregDate.prototype.parent = ilib.Date,\r\nilib.Date.GregDate.prototype.constructor = ilib.Date.GregDate,\r\nilib.Date.GregDate.prototype.newRd = function(t) {\r\n    return new ilib.Date.GregRataDie(t)\r\n},\r\nilib.Date.GregDate._calcYear = function(t) {\r\n    var e, i, n, o, s, a, r, h;\r\n    return o = Math.floor((t - 1) / 146097),\r\n    e = ilib.mod(t - 1, 146097),\r\n    s = Math.floor(e / 36524),\r\n    i = ilib.mod(e, 36524),\r\n    a = Math.floor(i / 1461),\r\n    n = ilib.mod(i, 1461),\r\n    r = Math.floor(n / 365),\r\n    h = 400 * o + 100 * s + 4 * a + r,\r\n    4 !== s && 4 !== r && h++,\r\n    h\r\n},\r\nilib.Date.GregDate.prototype._calcYear = function(t) {\r\n    return ilib.Date.GregDate._calcYear(t)\r\n},\r\nilib.Date.GregDate.prototype._calcDateComponents = function() {\r\n    if (\"local\" === this.timezone && this.rd.getRataDie() >= 719163 && 744018.134803241 >= this.rd.getRataDie()) {\r\n        var t = new Date(this.rd.getTime());\r\n        this.year = t.getFullYear(),\r\n        this.month = t.getMonth() + 1,\r\n        this.day = t.getDate(),\r\n        this.hour = t.getHours(),\r\n        this.minute = t.getMinutes(),\r\n        this.second = t.getSeconds(),\r\n        this.millisecond = t.getMilliseconds(),\r\n        this.offset = -t.getTimezoneOffset() / 1440\r\n    } else {\r\n        this.offset === void 0 && (this.year = this._calcYear(this.rd.getRataDie()), this.tz || (this.tz = new ilib.TimeZone({\r\n            id: this.timezone\r\n        })), this.offset = this.tz.getOffsetMillis(this) / 864e5);\r\n        var e = this.rd.getRataDie();\r\n        0 !== this.offset && (e += this.offset),\r\n        this.year = this._calcYear(e);\r\n        var i = this.newRd({\r\n            year: this.year,\r\n            month: 1,\r\n            day: 1,\r\n            cal: this.cal\r\n        }),\r\n        n = e - i.getRataDie() + 1,\r\n        o = ilib.Cal.Gregorian.prototype.isLeapYear.call(this.cal, this.year) ? ilib.Date.GregRataDie.cumMonthLengthsLeap: ilib.Date.GregRataDie.cumMonthLengths;\r\n        this.month = ilib.bsearch(Math.floor(n), o),\r\n        n -= o[this.month - 1],\r\n        this.day = Math.floor(n),\r\n        n -= this.day,\r\n        n = Math.round(864e5 * n),\r\n        this.hour = Math.floor(n / 36e5),\r\n        n -= 36e5 * this.hour,\r\n        this.minute = Math.floor(n / 6e4),\r\n        n -= 6e4 * this.minute,\r\n        this.second = Math.floor(n / 1e3),\r\n        n -= 1e3 * this.second,\r\n        this.millisecond = Math.floor(n)\r\n    }\r\n},\r\nilib.Date.GregDate.prototype.getDayOfWeek = function() {\r\n    var t = Math.floor(this.rd.getRataDie() + (this.offset || 0));\r\n    return ilib.mod(t, 7)\r\n},\r\nilib.Date.GregDate.prototype.getDayOfYear = function() {\r\n    var t = this.cal.isLeapYear(this.year) ? ilib.Date.GregRataDie.cumMonthLengthsLeap: ilib.Date.GregRataDie.cumMonthLengths;\r\n    return t[this.month - 1] + this.day\r\n},\r\nilib.Date.GregDate.prototype.getEra = function() {\r\n    return 1 > this.year ? -1 : 1\r\n},\r\nilib.Date.GregDate.prototype.getCalendar = function() {\r\n    return \"gregorian\"\r\n},\r\nilib.Date._constructors.gregorian = ilib.Date.GregDate,\r\nilib.Cal.ThaiSolar = function() {\r\n    this.type = \"thaisolar\"\r\n},\r\nilib.Cal.ThaiSolar.prototype = new ilib.Cal.Gregorian,\r\nilib.Cal.ThaiSolar.prototype.parent = ilib.Cal.Gregorian,\r\nilib.Cal.ThaiSolar.prototype.constructor = ilib.Cal.ThaiSolar,\r\nilib.Cal.ThaiSolar.prototype.isLeapYear = function(t) {\r\n    var e = \"number\" == typeof t ? t: t.getYears();\r\n    e -= 543;\r\n    var i = ilib.mod(e, 400);\r\n    return 0 === ilib.mod(e, 4) && 100 !== i && 200 !== i && 300 !== i\r\n},\r\nilib.Cal.ThaiSolar.prototype.newDateInstance = function(t) {\r\n    return new ilib.Date.ThaiSolarDate(t)\r\n},\r\nilib.Cal._constructors.thaisolar = ilib.Cal.ThaiSolar,\r\nilib.Date.ThaiSolarDate = function(t) {\r\n    var e = t;\r\n    t && (e = {},\r\n    ilib.shallowCopy(t, e), e.year !== void 0 && (e.year -= 543), e.rd !== void 0 && (e.rd -= 198327)),\r\n    this.rd = void 0,\r\n    this.offset = void 0,\r\n    ilib.Date.GregDate.call(this, e),\r\n    this.cal = new ilib.Cal.ThaiSolar,\r\n    t && t.year !== void 0 && (this.year = parseInt(t.year, 10))\r\n},\r\nilib.Date.ThaiSolarDate.prototype = new ilib.Date.GregDate,\r\nilib.Date.ThaiSolarDate.prototype.parent = ilib.Date.GregDate.prototype,\r\nilib.Date.ThaiSolarDate.prototype.constructor = ilib.Date.ThaiSolarDate,\r\nilib.Date.ThaiSolarDate.epoch = 1523097.5,\r\nilib.Date.ThaiSolarDate.prototype._calcDateComponents = function() {\r\n    this.parent._calcDateComponents.call(this),\r\n    this.year += 543\r\n},\r\nilib.Date.ThaiSolarDate.prototype.getRataDie = function() {\r\n    return this.rd.getRataDie() + 198327\r\n},\r\nilib.Date.ThaiSolarDate.prototype.before = function(t) {\r\n    return this.cal.newDateInstance({\r\n        rd: this.rd.before(t, this.offset) + 198327,\r\n        timezone: this.timezone\r\n    })\r\n},\r\nilib.Date.ThaiSolarDate.prototype.after = function(t) {\r\n    return this.cal.newDateInstance({\r\n        rd: this.rd.after(t, this.offset) + 198327,\r\n        timezone: this.timezone\r\n    })\r\n},\r\nilib.Date.ThaiSolarDate.prototype.onOrBefore = function(t) {\r\n    return this.cal.newDateInstance({\r\n        rd: this.rd.onOrBefore(t, this.offset) + 198327,\r\n        timezone: this.timezone\r\n    })\r\n},\r\nilib.Date.ThaiSolarDate.prototype.onOrAfter = function(t) {\r\n    return this.cal.newDateInstance({\r\n        rd: this.rd.onOrAfter(t, this.offset) + 198327,\r\n        timezone: this.timezone\r\n    })\r\n},\r\nilib.Date.ThaiSolarDate.prototype.getCalendar = function() {\r\n    return \"thaisolar\"\r\n},\r\nilib.Date._constructors.thaisolar = ilib.Date.ThaiSolarDate,\r\nilib.Date.initAstro = function(t, e, i) {\r\n    ilib.data.astro ? i && \"function\" == typeof i && i(ilib.data.astro) : ilib.loadData({\r\n        name: \"astro.json\",\r\n        locale: \"-\",\r\n        nonLocale: !0,\r\n        sync: t,\r\n        loadParams: e,\r\n        callback: ilib.bind(this,\r\n        function(t) {\r\n            ilib.data.astro = t,\r\n            i && \"function\" == typeof i && i(t)\r\n        })\r\n    })\r\n},\r\nilib.Date._dtr = function(t) {\r\n    return t * Math.PI / 180\r\n},\r\nilib.Date._rtd = function(t) {\r\n    return 180 * t / Math.PI\r\n},\r\nilib.Date._dcos = function(t) {\r\n    return Math.cos(ilib.Date._dtr(t))\r\n},\r\nilib.Date._dsin = function(t) {\r\n    return Math.sin(ilib.Date._dtr(t))\r\n},\r\nilib.Date._dtan = function(t) {\r\n    return Math.tan(ilib.Date._dtr(t))\r\n},\r\nilib.Date._fixangle = function(t) {\r\n    return t - 360 * Math.floor(t / 360)\r\n},\r\nilib.Date._fixangr = function(t) {\r\n    return t - 2 * Math.PI * Math.floor(t / (2 * Math.PI))\r\n},\r\nilib.Date._equinox = function(t, e) {\r\n    var i, n, o, s, a, r, h, l, c, d;\r\n    for (1e3 > t ? (r = ilib.data.astro._JDE0tab1000, d = t / 1e3) : (r = ilib.data.astro._JDE0tab2000, d = (t - 2e3) / 1e3), s = r[e][0] + r[e][1] * d + r[e][2] * d * d + r[e][3] * d * d * d + r[e][4] * d * d * d * d, l = (s - 2451545) / 36525, c = 35999.373 * l - 2.47, i = 1 + .0334 * ilib.Date._dcos(c) + 7e-4 * ilib.Date._dcos(2 * c), h = 0, o = 0, n = 0; 24 > n; n++) h += ilib.data.astro._EquinoxpTerms[o] * ilib.Date._dcos(ilib.data.astro._EquinoxpTerms[o + 1] + ilib.data.astro._EquinoxpTerms[o + 2] * l),\r\n    o += 3;\r\n    return a = s + 1e-5 * h / i\r\n},\r\nilib.Date._deltat = function(t) {\r\n    var e, i, n, o;\r\n    return t >= 1620 && 2014 >= t ? (n = Math.floor(t - 1620), i = t - 1620 - n, e = ilib.data.astro._deltaTtab[n] + (ilib.data.astro._deltaTtab[n + 1] - ilib.data.astro._deltaTtab[n]) * i) : (o = (t - 2e3) / 100, 948 > t ? e = 2177 + 497 * o + 44.1 * o * o: (e = 102 + 102 * o + 25.3 * o * o, t > 2e3 && 2100 > t && (e += .37 * (t - 2100)))),\r\n    e\r\n},\r\nilib.Date._obliqeq = function(t) {\r\n    var e, i, n, o;\r\n    if (n = i = (t - 2451545) / 3652500, e = 23.43929111111111, 1 > Math.abs(i)) for (o = 0; 10 > o; o++) e += ilib.data.astro._oterms[o] / 3600 * n,\r\n    n *= i;\r\n    return e\r\n},\r\nilib.Date._sunpos = function(t) {\r\n    var e, i, n, o, s, a, r = {};\r\n    return e = (t - 2451545) / 36525,\r\n    i = e * e,\r\n    n = e * i,\r\n    r.meanLongitude = ilib.Date._fixangle(280.46646 + 36000.76983 * e + 3032e-7 * i),\r\n    r.meanAnomaly = ilib.Date._fixangle(357.52911 + 35999.05029 * e - 1537e-7 * i - 4.8e-7 * n),\r\n    r.eccentricity = .016708634 - 42037e-9 * e - 1.267e-7 * i,\r\n    r.equationOfCenter = (1.914602 - .004817 * e - 14e-6 * i) * ilib.Date._dsin(r.meanAnomaly) + (.019993 - 101e-6 * e) * ilib.Date._dsin(2 * r.meanAnomaly) + 289e-6 * ilib.Date._dsin(3 * r.meanAnomaly),\r\n    r.sunLongitude = r.meanLongitude + r.equationOfCenter,\r\n    o = 125.04 - 1934.136 * e,\r\n    r.apparentLong = r.sunLongitude + -.00569 + -.00478 * ilib.Date._dsin(o),\r\n    a = ilib.Date._obliqeq(t),\r\n    s = a + .00256 * ilib.Date._dcos(o),\r\n    r.inclination = ilib.Date._fixangle(23.4392911 - .013004167 * e - 1.6389e-7 * i + 5.036e-7 * n),\r\n    r.apparentRightAscension = ilib.Date._fixangle(ilib.Date._rtd(Math.atan2(ilib.Date._dcos(s) * ilib.Date._dsin(r.apparentLong), ilib.Date._dcos(r.apparentLong)))),\r\n    r\r\n},\r\nilib.Date._nutation = function(t) {\r\n    var e, i, n, o, s, a, r = (t - 2451545) / 36525,\r\n    h = [],\r\n    l = 0,\r\n    c = 0,\r\n    d = {};\r\n    for (o = r * (n = r * r), h[0] = ilib.Date._dtr(297.850363 + 445267.11148 * r - .0019142 * n + o / 189474), h[1] = ilib.Date._dtr(357.52772 + 35999.05034 * r - 1603e-7 * n - o / 3e5), h[2] = ilib.Date._dtr(134.96298 + 477198.867398 * r + .0086972 * n + o / 56250), h[3] = ilib.Date._dtr(93.27191 + 483202.017538 * r - .0036825 * n + o / 327270), h[4] = ilib.Date._dtr(125.04452 - 1934.136261 * r + .0020708 * n + o / 45e4), e = 0; 5 > e; e++) h[e] = ilib.Date._fixangr(h[e]);\r\n    for (s = r / 10, e = 0; 63 > e; e++) {\r\n        for (a = 0, i = 0; 5 > i; i++) 0 != ilib.data.astro._nutArgMult[5 * e + i] && (a += ilib.data.astro._nutArgMult[5 * e + i] * h[i]);\r\n        l += (ilib.data.astro._nutArgCoeff[4 * e + 0] + ilib.data.astro._nutArgCoeff[4 * e + 1] * s) * Math.sin(a),\r\n        c += (ilib.data.astro._nutArgCoeff[4 * e + 2] + ilib.data.astro._nutArgCoeff[4 * e + 3] * s) * Math.cos(a)\r\n    }\r\n    return d.deltaPsi = l / 36e6,\r\n    d.deltaEpsilon = c / 36e6,\r\n    d\r\n},\r\nilib.Date._equationOfTime = function(t) {\r\n    var e, i, n, o, s, a, r;\r\n    a = (t - 2451545) / 365250,\r\n    s = 280.4664567 + 360007.6982779 * a + .03032028 * a * a + a * a * a / 49931 + -(a * a * a * a / 15300) + -(a * a * a * a * a / 2e6),\r\n    s = ilib.Date._fixangle(s),\r\n    r = ilib.Date._sunpos(t),\r\n    e = r.apparentRightAscension;\r\n    var h = ilib.Date._nutation(t);\r\n    return i = h.deltaPsi,\r\n    o = ilib.Date._obliqeq(t) + h.deltaEpsilon,\r\n    n = s - .0057183 - e + i * ilib.Date._dcos(o),\r\n    n > 180 && (n -= 360),\r\n    n = 4 * n,\r\n    n /= 1440\r\n},\r\nilib.Date._poly = function(t, e) {\r\n    for (var i = e[0], n = t, o = 1; e.length > o; o++) i += e[o] * n,\r\n    n *= t;\r\n    return i\r\n},\r\nilib.Date._universalFromLocal = function(t, e) {\r\n    return t - e / 1440\r\n},\r\nilib.Date._localFromUniversal = function(t, e) {\r\n    return t + e / 1440\r\n},\r\nilib.Date._aberration = function(t) {\r\n    return 974e-7 * ilib.Date._dcos(177.63 + 35999.01847999999 * t) - .005575\r\n},\r\nilib.Date._nutation2 = function(t) {\r\n    var e = ilib.Date._poly(t, ilib.data.astro._nutCoeffA),\r\n    i = ilib.Date._poly(t, ilib.data.astro._nutCoeffB);\r\n    return - .004778 * ilib.Date._dsin(e) - 3667e-7 * ilib.Date._dsin(i)\r\n},\r\nilib.Date._ephemerisCorrection = function(t) {\r\n    var e = ilib.Date.GregDate._calcYear(t - 1721424.5);\r\n    if (e >= 1988 && 2019 >= e) return (e - 1933) / 86400;\r\n    if (e >= 1800 && 1987 >= e) {\r\n        var i = new ilib.Date.GregRataDie({\r\n            year: e,\r\n            month: 7,\r\n            day: 1,\r\n            hour: 0,\r\n            minute: 0,\r\n            second: 0\r\n        }),\r\n        n = (i.getRataDie() - 693596) / 36525;\r\n        return ilib.Date._poly(n, e >= 1900 ? ilib.data.astro._coeff19th: ilib.data.astro._coeff18th)\r\n    }\r\n    if (e >= 1620 && 1799 >= e) return e -= 1600,\r\n    (196.58333 - 4.0675 * e + .0219167 * e * e) / 86400;\r\n    var o = new ilib.Date.GregRataDie({\r\n        year: e,\r\n        month: 1,\r\n        day: 1,\r\n        hour: 0,\r\n        minute: 0,\r\n        second: 0\r\n    }),\r\n    s = .5 + (o.getRataDie() - 660724);\r\n    return (s * s / 41048480 - 15) / 86400\r\n},\r\nilib.Date._ephemerisFromUniversal = function(t) {\r\n    return t + ilib.Date._ephemerisCorrection(t)\r\n},\r\nilib.Date._universalFromEphemeris = function(t) {\r\n    return t - ilib.Date._ephemerisCorrection(t)\r\n},\r\nilib.Date._julianCenturies = function(t) {\r\n    return (ilib.Date._ephemerisFromUniversal(t) - 2451545) / 36525\r\n},\r\nilib.Date._solarLongitude = function(t) {\r\n    for (var e = ilib.Date._julianCenturies(t), i = 0, n = ilib.data.astro._solarLongCoeff.length, o = 0; n > o; o++) i += ilib.data.astro._solarLongCoeff[o] * ilib.Date._dsin(ilib.data.astro._solarLongAddends[o] + ilib.data.astro._solarLongMultipliers[o] * e);\r\n    return i *= 5729577951308232e-21,\r\n    i += 282.7771834 + 36000.76953744 * e,\r\n    i += ilib.Date._aberration(e) + ilib.Date._nutation2(e),\r\n    ilib.Date._fixangle(i)\r\n},\r\nilib.Date._lunarLongitude = function(t) {\r\n    for (var e = ilib.Date._julianCenturies(t), i = ilib.Date._fixangle(ilib.Date._poly(e, ilib.data.astro._meanMoonCoeff)), n = ilib.Date._fixangle(ilib.Date._poly(e, ilib.data.astro._elongationCoeff)), o = ilib.Date._fixangle(ilib.Date._poly(e, ilib.data.astro._solarAnomalyCoeff)), s = ilib.Date._fixangle(ilib.Date._poly(e, ilib.data.astro._lunarAnomalyCoeff)), a = ilib.Date._fixangle(ilib.Date._poly(e, ilib.data.astro._moonFromNodeCoeff)), r = ilib.Date._poly(e, ilib.data.astro._eCoeff), h = 0, l = 0; ilib.data.astro._lunarElongationLongCoeff.length > l; l++) {\r\n        var c = ilib.data.astro._solarAnomalyLongCoeff[l];\r\n        h += ilib.data.astro._sineCoeff[l] * Math.pow(r, Math.abs(c)) * ilib.Date._dsin(ilib.data.astro._lunarElongationLongCoeff[l] * n + c * o + ilib.data.astro._lunarAnomalyLongCoeff[l] * s + ilib.data.astro._moonFromNodeLongCoeff[l] * a)\r\n    }\r\n    var d = h / 1e6,\r\n    u = .003958 * ilib.Date._dsin(119.75 + 131.849 * e),\r\n    g = 318e-6 * ilib.Date._dsin(53.09 + 479264.29 * e),\r\n    f = .001962 * ilib.Date._dsin(i - a);\r\n    return ilib.Date._fixangle(i + d + u + g + f + ilib.Date._nutation2(e))\r\n},\r\nilib.Date._newMoonTime = function(t) {\r\n    for (var e = t - 24724,\r\n    i = e / 1236.85,\r\n    n = ilib.Date._poly(i, ilib.data.astro._nmApproxCoeff), o = ilib.Date._poly(i, ilib.data.astro._nmCapECoeff), s = ilib.Date._poly(i, ilib.data.astro._nmSolarAnomalyCoeff), a = ilib.Date._poly(i, ilib.data.astro._nmLunarAnomalyCoeff), r = ilib.Date._poly(i, ilib.data.astro._nmMoonArgumentCoeff), h = ilib.Date._poly(i, ilib.data.astro._nmCapOmegaCoeff), l = -17e-5 * ilib.Date._dsin(h), c = 0; ilib.data.astro._nmSineCoeff.length > c; c++) l += ilib.data.astro._nmSineCoeff[c] * Math.pow(o, ilib.data.astro._nmEFactor[c]) * ilib.Date._dsin(ilib.data.astro._nmSolarCoeff[c] * s + ilib.data.astro._nmLunarCoeff[c] * a + ilib.data.astro._nmMoonCoeff[c] * r);\r\n    for (var d = 0,\r\n    c = 0; ilib.data.astro._nmAddConst.length > c; c++) d += ilib.data.astro._nmAddFactor[c] * ilib.Date._dsin(ilib.data.astro._nmAddConst[c] + ilib.data.astro._nmAddCoeff[c] * e);\r\n    var u = 325e-6 * ilib.Date._dsin(ilib.Date._poly(i, ilib.data.astro._nmExtra));\r\n    return ilib.Date._universalFromEphemeris(n + l + u + d + ilib.Date.RataDie.gregorianEpoch)\r\n},\r\nilib.Date._lunarSolarAngle = function(t) {\r\n    var e = ilib.Date._lunarLongitude(t),\r\n    i = ilib.Date._solarLongitude(t);\r\n    return ilib.Date._fixangle(e - i)\r\n},\r\nilib.Date._newMoonBefore = function(t) {\r\n    var e, i, n = ilib.Date._lunarSolarAngle(t),\r\n    o = Math.round((t - 11.450086114414322 - ilib.Date.RataDie.gregorianEpoch) / 29.530588853 - n / 360) - 1;\r\n    for (e = i = ilib.Date._newMoonTime(o); t > e;) o++,\r\n    i = e,\r\n    e = ilib.Date._newMoonTime(o);\r\n    return i\r\n},\r\nilib.Date._newMoonAtOrAfter = function(t) {\r\n    for (var e, i = ilib.Date._lunarSolarAngle(t), n = Math.round((t - 11.450086114414322 - ilib.Date.RataDie.gregorianEpoch) / 29.530588853 - i / 360); t > (e = ilib.Date._newMoonTime(n));) n++;\r\n    return e\r\n},\r\nilib.Date._nextSolarLongitude = function(t, e) {\r\n    var i = 365.242189 / 360,\r\n    n = t + i * ilib.Date._fixangle(e - ilib.Date._solarLongitude(t)),\r\n    o = Math.max(t, n - 5),\r\n    s = n + 5;\r\n    return ilib.bisectionSearch(0, o, s, 1e-6,\r\n    function(t) {\r\n        return 180 - ilib.Date._fixangle(ilib.Date._solarLongitude(t) - e)\r\n    })\r\n},\r\nilib.Date._floorToJD = function(t) {\r\n    return Math.floor(t - .5) + .5\r\n},\r\nilib.Date._ceilToJD = function(t) {\r\n    return Math.ceil(t + .5) - .5\r\n},\r\nilib.Date.PersAstroRataDie = function(t) {\r\n    this.rd = void 0,\r\n    ilib.Date.initAstro(t && \"boolean\" == typeof t.sync ? t.sync: !0, t && t.loadParams, ilib.bind(this,\r\n    function() {\r\n        ilib.Date.RataDie.call(this, t),\r\n        t && \"function\" == typeof t.callback && t.callback(this)\r\n    }))\r\n},\r\nilib.Date.PersAstroRataDie.prototype = new ilib.Date.RataDie,\r\nilib.Date.PersAstroRataDie.prototype.parent = ilib.Date.RataDie,\r\nilib.Date.PersAstroRataDie.prototype.constructor = ilib.Date.PersAstroRataDie,\r\nilib.Date.PersAstroRataDie.prototype.epoch = 1948319.5,\r\nilib.Date.PersAstroRataDie.prototype._tehranEquinox = function(t) {\r\n    var e, i, n, o, s, a;\r\n    return e = ilib.Date._equinox(t, 0),\r\n    i = e - ilib.Date._deltat(t) / 86400,\r\n    a = 360 * ilib.Date._equationOfTime(e),\r\n    a = (a - 20 * Math.floor(a / 20)) / 360,\r\n    n = i + a,\r\n    s = 52.5 / 360,\r\n    o = n + s\r\n},\r\nilib.Date.PersAstroRataDie.prototype._getYear = function(t) {\r\n    var e, i = new ilib.Date.GregDate({\r\n        julianday: t\r\n    }),\r\n    n = i.getYears() - 2,\r\n    o = {};\r\n    for (o.equinox = this._tehranEquinox(n); o.equinox > t;) n--,\r\n    o.equinox = this._tehranEquinox(n);\r\n    for (e = o.equinox - 1; ! (t >= Math.floor(o.equinox) + .5 && Math.floor(e) + .5 > t);) o.equinox = e,\r\n    n++,\r\n    e = this._tehranEquinox(n);\r\n    return o.year = Math.round((o.equinox - this.epoch - 1) / 365.24219878) + 1,\r\n    o\r\n},\r\nilib.Date.PersAstroRataDie.prototype._setDateComponents = function(t) {\r\n    var e, i, n;\r\n    for (i = this.epoch + 1 + 365.24219878 * (t.year - 2), e = {\r\n        year: t.year - 1,\r\n        equinox: 0\r\n    }; e.year < t.year;) e = this._getYear(i),\r\n    i = e.equinox + 367.24219878;\r\n    n = Math.floor(e.equinox) + (7 >= t.month ? 31 * (t.month - 1) : 30 * (t.month - 1) + 6) + (t.day - 1 + .5),\r\n    n += (36e5 * t.hour + 6e4 * t.minute + 1e3 * t.second + t.millisecond) / 864e5,\r\n    this.rd = n - this.epoch\r\n},\r\nilib.Date.PersAstroRataDie.prototype._onOrBefore = function(t, e) {\r\n    return t - ilib.mod(Math.floor(t) - e - 3, 7)\r\n},\r\nilib.Cal.Persian = function() {\r\n    this.type = \"persian\"\r\n},\r\nilib.Cal.Persian.monthLengths = [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29],\r\nilib.Cal.Persian.prototype.getNumMonths = function() {\r\n    return 12\r\n},\r\nilib.Cal.Persian.prototype.getMonLength = function(t, e) {\r\n    return 12 === t && this.isLeapYear(e) ? 30 : ilib.Cal.Persian.monthLengths[t - 1]\r\n},\r\nilib.Cal.Persian.prototype.isLeapYear = function(t) {\r\n    var e = new ilib.Date.PersAstroRataDie({\r\n        cal: this,\r\n        year: t + 1,\r\n        month: 1,\r\n        day: 1,\r\n        hour: 0,\r\n        minute: 0,\r\n        second: 0,\r\n        millisecond: 0\r\n    }),\r\n    i = new ilib.Date.PersAstroRataDie({\r\n        cal: this,\r\n        year: t,\r\n        month: 1,\r\n        day: 1,\r\n        hour: 0,\r\n        minute: 0,\r\n        second: 0,\r\n        millisecond: 0\r\n    });\r\n    return e.getRataDie() - i.getRataDie() > 365\r\n},\r\nilib.Cal.Persian.prototype.getType = function() {\r\n    return this.type\r\n},\r\nilib.Cal.Persian.prototype.newDateInstance = function(t) {\r\n    return new ilib.Date.PersDate(t)\r\n},\r\nilib.Cal._constructors.persian = ilib.Cal.Persian,\r\nilib.Date.PersDate = function(t) {\r\n    if (this.cal = new ilib.Cal.Persian, this.timezone = \"local\", t) {\r\n        if (t.locale) {\r\n            this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale;\r\n            var e = new ilib.LocaleInfo(this.locale);\r\n            this.timezone = e.getTimeZone()\r\n        }\r\n        t.timezone && (this.timezone = t.timezone)\r\n    }\r\n    ilib.Date.initAstro(t && \"boolean\" == typeof t.sync ? t.sync: !0, t && t.loadParams, ilib.bind(this,\r\n    function() {\r\n        t && (t.year || t.month || t.day || t.hour || t.minute || t.second || t.millisecond) && (this.year = parseInt(t.year, 10) || 0, this.month = parseInt(t.month, 10) || 1, this.day = parseInt(t.day, 10) || 1, this.hour = parseInt(t.hour, 10) || 0, this.minute = parseInt(t.minute, 10) || 0, this.second = parseInt(t.second, 10) || 0, this.millisecond = parseInt(t.millisecond, 10) || 0, this.dayOfYear = parseInt(t.dayOfYear, 10), \"boolean\" == typeof t.dst && (this.dst = t.dst), this.rd = this.newRd(this), this.tz || (this.tz = new ilib.TimeZone({\r\n            id: this.timezone\r\n        })), this.offset = this.tz._getOffsetMillisWallTime(this) / 864e5, 0 !== this.offset && (this.rd = this.newRd({\r\n            rd: this.rd.getRataDie() - this.offset\r\n        }))),\r\n        this.rd || (this.rd = this.newRd(t), this._calcDateComponents()),\r\n        t && \"function\" == typeof t.onLoad && t.onLoad(this)\r\n    }))\r\n},\r\nilib.Date.PersDate.prototype = new ilib.Date({\r\n    noinstance: !0\r\n}),\r\nilib.Date.PersDate.prototype.parent = ilib.Date,\r\nilib.Date.PersDate.prototype.constructor = ilib.Date.PersDate,\r\nilib.Date.PersDate.cumMonthLengths = [0, 31, 62, 93, 124, 155, 186, 216, 246, 276, 306, 336, 366],\r\nilib.Date.PersDate.prototype.newRd = function(t) {\r\n    return new ilib.Date.PersAstroRataDie(t)\r\n},\r\nilib.Date.PersDate.prototype._calcYear = function(t) {\r\n    var e = t + this.rd.epoch;\r\n    return this.rd._getYear(e).year\r\n},\r\nilib.Date.PersDate.prototype._calcDateComponents = function() {\r\n    var t, e = this.rd.getRataDie();\r\n    this.year = this._calcYear(e),\r\n    this.offset === void 0 && (this.tz || (this.tz = new ilib.TimeZone({\r\n        id: this.timezone\r\n    })), this.offset = this.tz.getOffsetMillis(this) / 864e5),\r\n    0 !== this.offset && (e += this.offset, this.year = this._calcYear(e));\r\n    var i = this.newRd({\r\n        year: this.year,\r\n        month: 1,\r\n        day: 1,\r\n        hour: 0,\r\n        minute: 0,\r\n        second: 0,\r\n        millisecond: 0\r\n    });\r\n    t = e - i.getRataDie() + 1,\r\n    this.dayOfYear = t,\r\n    this.month = ilib.bsearch(Math.floor(t), ilib.Date.PersDate.cumMonthLengths),\r\n    t -= ilib.Date.PersDate.cumMonthLengths[this.month - 1],\r\n    this.day = Math.floor(t),\r\n    t -= this.day,\r\n    t = Math.round(864e5 * t),\r\n    this.hour = Math.floor(t / 36e5),\r\n    t -= 36e5 * this.hour,\r\n    this.minute = Math.floor(t / 6e4),\r\n    t -= 6e4 * this.minute,\r\n    this.second = Math.floor(t / 1e3),\r\n    t -= 1e3 * this.second,\r\n    this.millisecond = t\r\n},\r\nilib.Date.PersDate.prototype.getDayOfWeek = function() {\r\n    var t = Math.floor(this.getRataDie());\r\n    return ilib.mod(t - 3, 7)\r\n},\r\nilib.Date.PersDate.prototype.getDayOfYear = function() {\r\n    return ilib.Date.PersDate.cumMonthLengths[this.month - 1] + this.day\r\n},\r\nilib.Date.PersDate.prototype.getEra = function() {\r\n    return 1 > this.year ? -1 : 1\r\n},\r\nilib.Date.PersDate.prototype.getCalendar = function() {\r\n    return \"persian\"\r\n},\r\nilib.Date._constructors.persian = ilib.Date.PersDate,\r\nilib.CType = {\r\n    _inRange: function(t, e, i) {\r\n        var n;\r\n        if (0 > t || !e || !i) return ! 1;\r\n        if (n = i[e], !n) return ! 1;\r\n        var o = function(t, e) {\r\n            return 1 === t.length ? t[0] - e: t[0] > e ? t[0] - e: e > t[1] ? t[1] - e: 0\r\n        },\r\n        s = ilib.bsearch(t, n, o);\r\n        return n.length > s && 0 === o(n[s], t)\r\n    },\r\n    withinRange: function(t, e) {\r\n        if (!e) return ! 1;\r\n        var i;\r\n        switch (typeof t) {\r\n        case \"number\":\r\n            i = t;\r\n            break;\r\n        case \"string\":\r\n            i = ilib.String.toCodePoint(t, 0);\r\n            break;\r\n        case \"undefined\":\r\n            return ! 1;\r\n        default:\r\n            i = t._toCodePoint(0)\r\n        }\r\n        return ilib.CType._inRange(i, e.toLowerCase(), ilib.data.ctype)\r\n    },\r\n    _init: function(t, e, i) {\r\n        ilib.CType._load(\"ctype\", t, e, i)\r\n    },\r\n    _load: function(t, e, i, n) {\r\n        if (ilib.data[t]) n && \"function\" == typeof n && n(ilib.data[t]);\r\n        else {\r\n            var o = t ? t + \".json\": \"ctype.json\";\r\n            ilib.loadData({\r\n                name: o,\r\n                locale: \"-\",\r\n                nonlocale: !0,\r\n                sync: e,\r\n                loadParams: i,\r\n                callback: ilib.bind(this,\r\n                function(e) {\r\n                    ilib.data[t] = e,\r\n                    n && \"function\" == typeof n && n(ilib.data[t])\r\n                })\r\n            })\r\n        }\r\n    }\r\n},\r\nilib.CType.isDigit = function(t) {\r\n    var e;\r\n    switch (typeof t) {\r\n    case \"number\":\r\n        e = t;\r\n        break;\r\n    case \"string\":\r\n        e = ilib.String.toCodePoint(t, 0);\r\n        break;\r\n    case \"undefined\":\r\n        return ! 1;\r\n    default:\r\n        e = t._toCodePoint(0)\r\n    }\r\n    return ilib.CType._inRange(e, \"digit\", ilib.data.ctype)\r\n},\r\nilib.CType.isDigit._init = function(t, e, i) {\r\n    ilib.CType._init(t, e, i)\r\n},\r\nilib.CType.isSpace = function(t) {\r\n    var e;\r\n    switch (typeof t) {\r\n    case \"number\":\r\n        e = t;\r\n        break;\r\n    case \"string\":\r\n        e = ilib.String.toCodePoint(t, 0);\r\n        break;\r\n    case \"undefined\":\r\n        return ! 1;\r\n    default:\r\n        e = t._toCodePoint(0)\r\n    }\r\n    return ilib.CType._inRange(e, \"space\", ilib.data.ctype) || ilib.CType._inRange(e, \"Zs\", ilib.data.ctype_z) || ilib.CType._inRange(e, \"Zl\", ilib.data.ctype_z) || ilib.CType._inRange(e, \"Zp\", ilib.data.ctype_z)\r\n},\r\nilib.CType.isSpace._init = function(t, e, i) {\r\n    ilib.CType._load(\"ctype_z\", t, e,\r\n    function() {\r\n        ilib.CType._init(t, e, i)\r\n    })\r\n},\r\nilib.Number = function(t, e) {\r\n    var i, n, o, s = \"\",\r\n    a = !0;\r\n    if (this.locale = new ilib.Locale, this.type = \"number\", e) {\r\n        if (e.locale && (this.locale = \"string\" == typeof e.locale ? new ilib.Locale(e.locale) : e.locale), e.type) switch (e.type) {\r\n        case \"number\":\r\n        case \"currency\":\r\n        case \"percentage\":\r\n            this.type = e.type;\r\n            break;\r\n        default:\r\n        }\r\n        e.sync !== void 0 && (a = 1 == e.sync),\r\n        n = e.loadParams,\r\n        o = e.onLoad\r\n    }\r\n    ilib.CType.isDigit._init(a, n, ilib.bind(this,\r\n    function() {\r\n        ilib.CType.isSpace._init(a, n, ilib.bind(this,\r\n        function() {\r\n            new ilib.LocaleInfo(this.locale, {\r\n                sync: a,\r\n                onLoad: ilib.bind(this,\r\n                function(n) {\r\n                    switch (this.decimal = n.getDecimalSeparator(), typeof t) {\r\n                    case \"string\":\r\n                        var o = !0;\r\n                        for (this.str = t || \"0\", i = 0, i = 0; this.str.length > i; i++) o && \"-\" === this.str.charAt(i) ? (o = !1, s += this.str.charAt(i)) : ilib.CType.isDigit(this.str.charAt(i)) ? (s += this.str.charAt(i), o = !1) : this.str.charAt(i) === this.decimal && (s += \".\", o = !1);\r\n                        this.value = parseFloat(s);\r\n                        break;\r\n                    case \"number\":\r\n                        this.str = \"\" + t,\r\n                        this.value = t;\r\n                        break;\r\n                    case \"object\":\r\n                        this.value = t.valueOf(),\r\n                        this.str = \"\" + this.value;\r\n                        break;\r\n                    case \"undefined\":\r\n                        this.value = 0,\r\n                        this.str = \"0\"\r\n                    }\r\n                    switch (this.type) {\r\n                    default:\r\n                        break;\r\n                    case \"percentage\":\r\n                        -1 !== this.str.indexOf(n.getPercentageSymbol()) && (this.value /= 100);\r\n                        break;\r\n                    case \"currency\":\r\n                        for (s = \"\", i = 0; this.str.length > i && !ilib.CType.isDigit(this.str.charAt(i)) && !ilib.CType.isSpace(this.str.charAt(i));) s += this.str.charAt(i++);\r\n                        if (0 === s.length) {\r\n                            for (; this.str.length > i && ilib.CType.isDigit(this.str.charAt(i)) || ilib.CType.isSpace(this.str.charAt(i)) || \".\" === this.str.charAt(i) || \",\" === this.str.charAt(i);) i++;\r\n                            for (; this.str.length > i && !ilib.CType.isDigit(this.str.charAt(i)) && !ilib.CType.isSpace(this.str.charAt(i));) s += this.str.charAt(i++)\r\n                        }\r\n                        return new ilib.Currency({\r\n                            locale: this.locale,\r\n                            sign: s,\r\n                            sync: a,\r\n                            onLoad: ilib.bind(this,\r\n                            function(t) {\r\n                                this.currency = t,\r\n                                e && \"function\" == typeof e.onLoad && e.onLoad(this)\r\n                            })\r\n                        }),\r\n                        void 0\r\n                    }\r\n                    e && \"function\" == typeof e.onLoad && e.onLoad(this)\r\n                })\r\n            })\r\n        }))\r\n    }))\r\n},\r\nilib.Number.prototype = {\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    toString: function() {\r\n        return this.str\r\n    },\r\n    getCurrency: function() {\r\n        return this.currency\r\n    },\r\n    valueOf: function() {\r\n        return this.value\r\n    }\r\n},\r\nilib.Currency = function(t) {\r\n    this.sync = !0,\r\n    t && (t.code && (this.code = t.code), t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.sign && (this.sign = t.sign), t.sync !== void 0 && (this.sync = t.sync), t.loadParams && (this.loadParams = t.loadParams)),\r\n    this.locale = this.locale || new ilib.Locale,\r\n    ilib.data.currency === void 0 ? ilib.loadData({\r\n        name: \"currency.json\",\r\n        object: ilib.Currency,\r\n        locale: \"-\",\r\n        sync: this.sync,\r\n        loadParams: this.loadParams,\r\n        callback: ilib.bind(this,\r\n        function(e) {\r\n            ilib.data.currency = e,\r\n            this._loadLocinfo(t && t.onLoad)\r\n        })\r\n    }) : this._loadLocinfo(t && t.onLoad)\r\n},\r\nilib.Currency.getAvailableCurrencies = function() {\r\n    var t, e = [],\r\n    i = new ilib.ResBundle({\r\n        name: \"currency\"\r\n    }).getResObj();\r\n    for (t in i) t && i[t] && e.push(t);\r\n    return e\r\n},\r\nilib.Currency.prototype = {\r\n    _loadLocinfo: function(t) {\r\n        new ilib.LocaleInfo(this.locale, {\r\n            onLoad: ilib.bind(this,\r\n            function(e) {\r\n                var i;\r\n                if (this.locinfo = e, this.code) {\r\n                    if (i = ilib.data.currency[this.code], !i) throw \"currency \" + this.code + \" is unknown\"\r\n                } else if (this.sign) if (i = ilib.data.currency[this.sign], i !== void 0) this.code = this.sign;\r\n                else if (this.code = this.locinfo.getCurrency(), i = ilib.data.currency[this.code], i.sign !== this.sign) for (var n in ilib.data.currency) if (n && ilib.data.currency[n] && (i = ilib.data.currency[n], i.sign === this.sign)) {\r\n                    this.code = n;\r\n                    break\r\n                }\r\n                i && this.code || (this.code = this.locinfo.getCurrency(), i = ilib.data.currency[this.code]),\r\n                this.name = i.name,\r\n                this.fractionDigits = i.decimals,\r\n                this.sign = i.sign,\r\n                \"function\" == typeof t && t(this)\r\n            })\r\n        })\r\n    },\r\n    getCode: function() {\r\n        return this.code\r\n    },\r\n    getFractionDigits: function() {\r\n        return this.fractionDigits\r\n    },\r\n    getSign: function() {\r\n        return this.sign\r\n    },\r\n    getName: function() {\r\n        return this.name\r\n    },\r\n    getLocale: function() {\r\n        return this.locale\r\n    }\r\n},\r\nilib.NumFmt = function(t) {\r\n    var e = !0;\r\n    this.locale = new ilib.Locale,\r\n    this.type = \"number\";\r\n    var i = void 0;\r\n    t && (t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.type && (\"number\" === t.type || \"currency\" === t.type || \"percentage\" === t.type) && (this.type = t.type), t.currency && (this.currency = t.currency), \"number\" == typeof t.maxFractionDigits && (this.maxFractionDigits = this._toPrimitive(t.maxFractionDigits)), \"number\" == typeof t.minFractionDigits && (this.minFractionDigits = this._toPrimitive(t.minFractionDigits)), t.style && (this.style = t.style), \"boolean\" == typeof t.useNative && (this.useNative = t.useNative), this.roundingMode = t.roundingMode, t.sync !== void 0 && (e = 1 == t.sync), i = t.loadParams),\r\n    this.localeInfo = void 0,\r\n    new ilib.LocaleInfo(this.locale, {\r\n        sync: e,\r\n        loadParams: i,\r\n        onLoad: ilib.bind(this,\r\n        function(n) {\r\n            if (this.localeInfo = n, \"number\" === this.type) this.templateNegative = new ilib.String(this.localeInfo.getNegativeNumberFormat() || \"-{n}\");\r\n            else {\r\n                if (\"currency\" === this.type) {\r\n                    var o;\r\n                    if (!this.currency || \"string\" != typeof this.currency) throw \"A currency property is required in the options to the number formatter constructor when the type property is set to currency.\";\r\n                    return new ilib.Currency({\r\n                        locale: this.locale,\r\n                        code: this.currency,\r\n                        sync: e,\r\n                        loadParams: i,\r\n                        onLoad: ilib.bind(this,\r\n                        function(e) {\r\n                            this.currencyInfo = e,\r\n                            \"common\" !== this.style && \"iso\" !== this.style && (this.style = \"common\"),\r\n                            \"number\" != typeof this.maxFractionDigits && \"number\" != typeof this.minFractionDigits && (this.minFractionDigits = this.maxFractionDigits = this.currencyInfo.getFractionDigits()),\r\n                            o = this.localeInfo.getCurrencyFormats(),\r\n                            this.template = new ilib.String(o[this.style] || o.common),\r\n                            this.templateNegative = new ilib.String(o[this.style + \"Negative\"] || o.commonNegative),\r\n                            this.sign = \"iso\" === this.style ? this.currencyInfo.getCode() : this.currencyInfo.getSign(),\r\n                            this.roundingMode || (this.roundingMode = this.currencyInfo && this.currencyInfo.roundingMode),\r\n                            this._init(),\r\n                            t && \"function\" == typeof t.onLoad && t.onLoad(this)\r\n                        })\r\n                    }),\r\n                    void 0\r\n                }\r\n                \"percentage\" === this.type && (this.template = new ilib.String(this.localeInfo.getPercentageFormat() || \"{n}%\"), this.templateNegative = new ilib.String(this.localeInfo.getNegativePercentageFormat() || this.localeInfo.getNegativeNumberFormat() + \"%\"))\r\n            }\r\n            this._init(),\r\n            t && \"function\" == typeof t.onLoad && t.onLoad(this)\r\n        })\r\n    })\r\n},\r\nilib.NumFmt.getAvailableLocales = function() {\r\n    return void 0\r\n},\r\nilib.NumFmt.zeros = \"0000000000000000000000000000000000000000000000000000000000000000000000\",\r\nilib.NumFmt.prototype = {\r\n    getUseNative: function() {\r\n        return \"boolean\" == typeof this.useNative ? this.useNative: \"native\" === this.localeInfo.getDigitsStyle()\r\n    },\r\n    _init: function() {\r\n        if (this.maxFractionDigits < this.minFractionDigits && (this.minFractionDigits = this.maxFractionDigits), this.roundingMode || (this.roundingMode = this.localeInfo.getRoundingMode()), this.roundingMode || (this.roundingMode = \"halfdown\"), this.round = ilib._roundFnc[this.roundingMode], this.round || (this.roundingMode = \"halfdown\", this.round = ilib._roundFnc[this.roundingMode]), \"nogrouping\" === this.style ? this.prigroupSize = this.secgroupSize = 0 : (this.prigroupSize = this.localeInfo.getPrimaryGroupingDigits(), this.secgroupSize = this.localeInfo.getSecondaryGroupingDigits(), this.groupingSeparator = this.getUseNative() ? this.localeInfo.getNativeGroupingSeparator() : this.localeInfo.getGroupingSeparator()), this.decimalSeparator = this.getUseNative() ? this.localeInfo.getNativeDecimalSeparator() : this.localeInfo.getDecimalSeparator(), this.getUseNative()) {\r\n            var t = this.localeInfo.getNativeDigits() || this.localeInfo.getDigits();\r\n            t && (this.digits = t.split(\"\"))\r\n        }\r\n        this.exponentSymbol = this.localeInfo.getExponential() || \"e\"\r\n    },\r\n    _pad: function(t, e, i) {\r\n        return t.length >= e ? t: i ? ilib.NumFmt.zeros.substring(0, e - t.length) + t: t + ilib.NumFmt.zeros.substring(0, e - t.length)\r\n    },\r\n    _toPrimitive: function(t) {\r\n        var e = 0;\r\n        switch (typeof t) {\r\n        case \"number\":\r\n            e = t;\r\n            break;\r\n        case \"string\":\r\n            e = parseFloat(t);\r\n            break;\r\n        case \"object\":\r\n            e = t.valueOf()\r\n        }\r\n        return e\r\n    },\r\n    _formatScientific: function(t) {\r\n        var e, i = new Number(t);\r\n        if (this.maxFractionDigits !== void 0) {\r\n            var n, o, s = i.toExponential(),\r\n            a = s.split(\"e\"),\r\n            r = a[0];\r\n            n = a[1],\r\n            o = Math.pow(10, this.maxFractionDigits),\r\n            r = this.round(r * o) / o,\r\n            e = \"\" + r + this.exponentSymbol + n\r\n        } else e = i.toExponential(this.minFractionDigits),\r\n        \"e\" !== this.exponentSymbol && (e = e.replace(/e/, this.exponentSymbol));\r\n        return e\r\n    },\r\n    _formatStandard: function(t) {\r\n        var e, i;\r\n        if (this.maxFractionDigits !== void 0 && this.maxFractionDigits > -1) {\r\n            var n = Math.pow(10, this.maxFractionDigits);\r\n            t = this.round(t * n) / n\r\n        }\r\n        t = Math.abs(t);\r\n        var o, s, a = (\"\" + t).split(\".\"),\r\n        r = a[0],\r\n        h = a[1];\r\n        if (r = \"\" + r, this.minFractionDigits > 0 && (h = this._pad(h || \"\", this.minFractionDigits, !1)), this.secgroupSize > 0) {\r\n            if (r.length > this.prigroupSize) {\r\n                var l = this.prigroupSize,\r\n                c = r.length,\r\n                d = c - l;\r\n                r = r.slice(0, d) + this.groupingSeparator + r.slice(d);\r\n                var u = r.substring(0, r.indexOf(this.groupingSeparator));\r\n                for (i = u.length; i > this.secgroupSize;) {\r\n                    var g = this.secgroupSize,\r\n                    f = u.length,\r\n                    p = f - g;\r\n                    r = r.slice(0, p) + this.groupingSeparator + r.slice(p),\r\n                    u = r.substring(0, r.indexOf(this.groupingSeparator)),\r\n                    i = u.length\r\n                }\r\n            }\r\n            s = r\r\n        } else if (0 !== this.prigroupSize) {\r\n            for (o = ilib.mod(r.length - 1, this.prigroupSize), s = \"\", e = 0; r.length - 1 > e; e++) s += r.charAt(e),\r\n            0 === o && (s += this.groupingSeparator),\r\n            o = ilib.mod(o - 1, this.prigroupSize);\r\n            s += r.charAt(r.length - 1)\r\n        } else s = r;\r\n        return h && (this.maxFractionDigits === void 0 || this.maxFractionDigits > 0) && (s += this.decimalSeparator, s += h),\r\n        this.digits && (s = ilib.mapString(s, this.digits)),\r\n        s\r\n    },\r\n    format: function(t) {\r\n        var e, i;\r\n        if (t === void 0) return \"\";\r\n        if (i = this._toPrimitive(t), \"number\" === this.type) e = \"scientific\" === this.style ? this._formatScientific(i) : this._formatStandard(i),\r\n        0 > t && (e = this.templateNegative.format({\r\n            n: e\r\n        }));\r\n        else {\r\n            e = this._formatStandard(i);\r\n            var n = 0 > i ? this.templateNegative: this.template;\r\n            e = n.format({\r\n                n: e,\r\n                s: this.sign\r\n            })\r\n        }\r\n        return e\r\n    },\r\n    getType: function() {\r\n        return this.type\r\n    },\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    isGroupingUsed: function() {\r\n        return \"undefined\" !== this.groupingSeparator && this.groupingSeparator.length > 0\r\n    },\r\n    getMaxFractionDigits: function() {\r\n        return this.maxFractionDigits !== void 0 ? this.maxFractionDigits: -1\r\n    },\r\n    getMinFractionDigits: function() {\r\n        return this.minFractionDigits !== void 0 ? this.minFractionDigits: -1\r\n    },\r\n    getCurrency: function() {\r\n        return this.currencyInfo && this.currencyInfo.getCode()\r\n    },\r\n    getRoundingMode: function() {\r\n        return this.roundingMode\r\n    },\r\n    getStyle: function() {\r\n        return this.style\r\n    }\r\n},\r\nilib.DurFmt = function(t) {\r\n    var e = !0,\r\n    i = void 0;\r\n    this.locale = new ilib.Locale,\r\n    this.length = \"short\",\r\n    this.style = \"text\",\r\n    t && (t.locale && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), t.length && (\"short\" === t.length || \"medium\" === t.length || \"long\" === t.length || \"full\" === t.length) && (this.length = t.length), t.style && (\"text\" === t.style || \"clock\" === t.style) && (this.style = t.style), t.sync !== void 0 && (e = 1 == t.sync), \"boolean\" == typeof t.useNative && (this.useNative = t.useNative), i = t.loadParams),\r\n    new ilib.ResBundle({\r\n        locale: this.locale,\r\n        name: \"sysres\",\r\n        sync: e,\r\n        loadParams: i,\r\n        onLoad: ilib.bind(this,\r\n        function(n) {\r\n            switch (this.length) {\r\n            case \"short\":\r\n                this.components = {\r\n                    year: n.getString(\"#{num}y\"),\r\n                    month: n.getString(\"#{num}m\", \"durationShortMonths\"),\r\n                    week: n.getString(\"#{num}w\"),\r\n                    day: n.getString(\"#{num}d\"),\r\n                    hour: n.getString(\"#{num}h\"),\r\n                    minute: n.getString(\"#{num}m\", \"durationShortMinutes\"),\r\n                    second: n.getString(\"#{num}s\"),\r\n                    millisecond: n.getString(\"#{num}m\", \"durationShortMillis\"),\r\n                    separator: n.getString(\" \", \"separatorShort\"),\r\n                    finalSeparator: \"\"\r\n                };\r\n                break;\r\n            case \"medium\":\r\n                this.components = {\r\n                    year: n.getString(\"1#1 yr|#{num} yrs\", \"durationMediumYears\"),\r\n                    month: n.getString(\"1#1 mo|#{num} mos\"),\r\n                    week: n.getString(\"1#1 wk|#{num} wks\", \"durationMediumWeeks\"),\r\n                    day: n.getString(\"1#1 dy|#{num} dys\"),\r\n                    hour: n.getString(\"1#1 hr|#{num} hrs\", \"durationMediumHours\"),\r\n                    minute: n.getString(\"1#1 mi|#{num} min\"),\r\n                    second: n.getString(\"1#1 se|#{num} sec\"),\r\n                    millisecond: n.getString(\"#{num} ms\"),\r\n                    separator: n.getString(\" \", \"separatorMedium\"),\r\n                    finalSeparator: \"\"\r\n                };\r\n                break;\r\n            case \"long\":\r\n                this.components = {\r\n                    year: n.getString(\"1#1 yr|#{num} yrs\"),\r\n                    month: n.getString(\"1#1 mon|#{num} mons\"),\r\n                    week: n.getString(\"1#1 wk|#{num} wks\"),\r\n                    day: n.getString(\"1#1 day|#{num} days\", \"durationLongDays\"),\r\n                    hour: n.getString(\"1#1 hr|#{num} hrs\"),\r\n                    minute: n.getString(\"1#1 min|#{num} min\"),\r\n                    second: n.getString(\"1#1 sec|#{num} sec\"),\r\n                    millisecond: n.getString(\"#{num} ms\"),\r\n                    separator: n.getString(\", \", \"separatorLong\"),\r\n                    finalSeparator: \"\"\r\n                };\r\n                break;\r\n            case \"full\":\r\n                this.components = {\r\n                    year: n.getString(\"1#1 year|#{num} years\"),\r\n                    month: n.getString(\"1#1 month|#{num} months\"),\r\n                    week: n.getString(\"1#1 week|#{num} weeks\"),\r\n                    day: n.getString(\"1#1 day|#{num} days\"),\r\n                    hour: n.getString(\"1#1 hour|#{num} hours\"),\r\n                    minute: n.getString(\"1#1 minute|#{num} minutes\"),\r\n                    second: n.getString(\"1#1 second|#{num} seconds\"),\r\n                    millisecond: n.getString(\"1#1 millisecond|#{num} milliseconds\"),\r\n                    separator: n.getString(\", \", \"separatorFull\"),\r\n                    finalSeparator: n.getString(\" and \", \"finalSeparatorFull\")\r\n                }\r\n            }\r\n            return \"clock\" === this.style ? (new ilib.DateFmt({\r\n                locale: this.locale,\r\n                type: \"time\",\r\n                time: \"ms\",\r\n                sync: e,\r\n                loadParams: i,\r\n                useNative: this.useNative,\r\n                onLoad: ilib.bind(this,\r\n                function(n) {\r\n                    this.timeFmtMS = n,\r\n                    new ilib.DateFmt({\r\n                        locale: this.locale,\r\n                        type: \"time\",\r\n                        time: \"hm\",\r\n                        sync: e,\r\n                        loadParams: i,\r\n                        useNative: this.useNative,\r\n                        onLoad: ilib.bind(this,\r\n                        function(n) {\r\n                            this.timeFmtHM = n,\r\n                            new ilib.DateFmt({\r\n                                locale: this.locale,\r\n                                type: \"time\",\r\n                                time: \"hms\",\r\n                                sync: e,\r\n                                loadParams: i,\r\n                                useNative: this.useNative,\r\n                                onLoad: ilib.bind(this,\r\n                                function(e) {\r\n                                    this.timeFmtHMS = e,\r\n                                    this.timeFmtHM.template = this.timeFmtHM.template.replace(/hh?/, \"H\"),\r\n                                    this.timeFmtHM.templateArr = this.timeFmtHM._tokenize(this.timeFmtHM.template),\r\n                                    this.timeFmtHMS.template = this.timeFmtHMS.template.replace(/hh?/, \"H\"),\r\n                                    this.timeFmtHMS.templateArr = this.timeFmtHMS._tokenize(this.timeFmtHMS.template),\r\n                                    this._init(this.timeFmtHM.locinfo, t && t.onLoad)\r\n                                })\r\n                            })\r\n                        })\r\n                    })\r\n                })\r\n            }), void 0) : (new ilib.LocaleInfo(this.locale, {\r\n                sync: e,\r\n                loadParams: i,\r\n                onLoad: ilib.bind(this,\r\n                function(e) {\r\n                    this._init(e, t && t.onLoad)\r\n                })\r\n            }), void 0)\r\n        })\r\n    })\r\n},\r\nilib.DurFmt.complist = {\r\n    text: [\"year\", \"month\", \"week\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\r\n    clock: [\"year\", \"month\", \"week\", \"day\"]\r\n},\r\nilib.DurFmt.prototype._mapDigits = function(t) {\r\n    return this.useNative && this.digits ? ilib.mapString(\"\" + t, this.digits) : t\r\n},\r\nilib.DurFmt.prototype._init = function(t, e) {\r\n    var i;\r\n    \"boolean\" == typeof this.useNative ? this.useNative && (i = t.getNativeDigits(), i && (this.digits = i)) : \"native\" === t.getDigitsStyle() && (i = t.getNativeDigits(), i && (this.useNative = !0, this.digits = i)),\r\n    \"function\" == typeof e && e(this)\r\n},\r\nilib.DurFmt.prototype.format = function(t) {\r\n    var e, i, n, o = !0,\r\n    s = \"\";\r\n    for (i = ilib.DurFmt.complist[this.style], e = i.length - 1; e >= 0; e--) t[i[e]] !== void 0 && 0 != t[i[e]] && (s.length > 0 && (s = (\"full\" === this.length && o ? this.components.finalSeparator: this.components.separator) + s, o = !1), s = this.components[i[e]].formatChoice(t[i[e]], {\r\n        num: this._mapDigits(t[i[e]])\r\n    }) + s);\r\n    return \"clock\" === this.style && (n = t.hour !== void 0 ? t.second !== void 0 ? this.timeFmtHMS: this.timeFmtHM: this.timeFmtMS, s.length > 0 && (s += this.components.separator), s += n._formatTemplate(t, n.templateArr)),\r\n    new ilib.String(s)\r\n},\r\nilib.DurFmt.prototype.getLocale = function() {\r\n    return this.locale\r\n},\r\nilib.DurFmt.prototype.getLength = function() {\r\n    return this.length\r\n},\r\nilib.DurFmt.prototype.getStyle = function() {\r\n    return this.style\r\n},\r\nilib.ScriptInfo = function(t, e) {\r\n    var i = !0,\r\n    n = void 0;\r\n    this.script = t,\r\n    e && (e.sync !== void 0 && (i = 1 == e.sync), e.loadParams !== void 0 && (n = e.loadParams)),\r\n    ilib.ScriptInfo.cache || (ilib.ScriptInfo.cache = {}),\r\n    ilib.data.scripts ? this.info = ilib.data.scripts[t] : ilib.loadData({\r\n        object: ilib.ScriptInfo,\r\n        locale: \"-\",\r\n        name: \"scripts.json\",\r\n        sync: i,\r\n        loadParams: n,\r\n        callback: ilib.bind(this,\r\n        function(i) {\r\n            if (!i) {\r\n                i = {\r\n                    Latn: {\r\n                        nb: 215,\r\n                        nm: \"Latin\",\r\n                        lid: \"Latin\",\r\n                        rtl: !1,\r\n                        ime: !1,\r\n                        casing: !0\r\n                    }\r\n                };\r\n                var n = this.locale.getSpec().replace(/-/g, \"_\");\r\n                ilib.ScriptInfo.cache[n] = i\r\n            }\r\n            ilib.data.scripts = i,\r\n            this.info = t && ilib.data.scripts[t],\r\n            e && \"function\" == typeof e.onLoad && e.onLoad(this)\r\n        })\r\n    })\r\n},\r\nilib.ScriptInfo.getAllScripts = function() {\r\n    var t = [],\r\n    e = void 0,\r\n    i = ilib.data.scripts;\r\n    for (e in i) e && i[e] && t.push(e);\r\n    return t\r\n},\r\nilib.ScriptInfo.prototype = {\r\n    getCode: function() {\r\n        return this.info && this.script\r\n    },\r\n    getCodeNumber: function() {\r\n        return this.info && this.info.nb || 0\r\n    },\r\n    getName: function() {\r\n        return this.info && this.info.nm\r\n    },\r\n    getLongCode: function() {\r\n        return this.info && this.info.lid\r\n    },\r\n    getScriptDirection: function() {\r\n        return this.info && this.info.rtl !== void 0 && this.info.rtl ? \"rtl\": \"ltr\"\r\n    },\r\n    getNeedsIME: function() {\r\n        return this.info && this.info.ime ? !0 : !1\r\n    },\r\n    getCasing: function() {\r\n        return this.info && this.info.casing ? !0 : !1\r\n    }\r\n},\r\nilib.CaseMapper = function(t) {\r\n    switch (this.up = !0, this.locale = new ilib.Locale, t && (t.locale !== void 0 && (this.locale = \"string\" == typeof t.locale ? new ilib.Locale(t.locale) : t.locale), this.up = !t.direction || \"toupper\" === t.direction), this.locale.getLanguage()) {\r\n    case \"az\":\r\n    case \"tr\":\r\n    case \"crh\":\r\n    case \"kk\":\r\n    case \"krc\":\r\n    case \"tt\":\r\n        this.mapData = this.up ? {\r\n            i: \"\\u0130\",\r\n            \"\\u0131\": \"I\"\r\n        }: {\r\n            \"\\u0130\": \"i\",\r\n            I: \"\\u0131\"\r\n        },\r\n        this.mapper = this._charMapper;\r\n        break;\r\n    case \"de\":\r\n        this.up && (this.mapper = this._charMapper, this.mapData = {\r\n            \"\\u00df\": \"SS\"\r\n        });\r\n        break;\r\n    case \"fr\":\r\n        this.up && \"CA\" !== this.locale.getRegion() && (this.mapData = {\r\n            \"\\u00e0\": \"A\",\r\n            \"\\u00e1\": \"A\",\r\n            \"\\u00e2\": \"A\",\r\n            \"\\u00e3\": \"A\",\r\n            \"\\u00e4\": \"A\",\r\n            \"\\u00e7\": \"C\",\r\n            \"\\u00e8\": \"E\",\r\n            \"\\u00e9\": \"E\",\r\n            \"\\u00ea\": \"E\",\r\n            \"\\u00eb\": \"E\",\r\n            \"\\u00ec\": \"I\",\r\n            \"\\u00ed\": \"I\",\r\n            \"\\u00ee\": \"I\",\r\n            \"\\u00ef\": \"I\",\r\n            \"\\u00f1\": \"N\",\r\n            \"\\u00f2\": \"O\",\r\n            \"\\u00f3\": \"O\",\r\n            \"\\u00f4\": \"O\",\r\n            \"\\u00f6\": \"O\",\r\n            \"\\u00f9\": \"U\",\r\n            \"\\u00fa\": \"U\",\r\n            \"\\u00fb\": \"U\",\r\n            \"\\u00fc\": \"U\"\r\n        },\r\n        this.mapper = this._charMapper);\r\n        break;\r\n    case \"el\":\r\n        this.mapData = this.up ? {\r\n            \"\\u0390\": \"\\u0399\",\r\n            \"\\u03ac\": \"\\u0391\",\r\n            \"\\u03ad\": \"\\u0395\",\r\n            \"\\u03ae\": \"\\u0397\",\r\n            \"\\u03af\": \"\\u0399\",\r\n            \"\\u03b0\": \"\\u03a5\",\r\n            \"\\u03ca\": \"\\u0399\",\r\n            \"\\u03cb\": \"\\u03a5\",\r\n            \"\\u03cc\": \"\\u039f\",\r\n            \"\\u03cd\": \"\\u03a5\",\r\n            \"\\u03ce\": \"\\u03a9\"\r\n        }: {},\r\n        this.mapper = this._charMapper;\r\n        break;\r\n    case \"abq\":\r\n    case \"ady\":\r\n    case \"av\":\r\n    case \"ce\":\r\n    case \"dar\":\r\n    case \"inh\":\r\n    case \"kbd\":\r\n    case \"lbe\":\r\n    case \"lez\":\r\n    case \"tab\":\r\n    case \"ru\":\r\n        this.up || (this.mapData = {\r\n            \"\\u04c0\": \"\\u04c0\"\r\n        },\r\n        this.mapper = this._charMapper)\r\n    }\r\n    this.mapper || (this.mapper = function(t) {\r\n        return this.up ? t.toUpperCase() : t.toLowerCase()\r\n    })\r\n},\r\nilib.CaseMapper.prototype = {\r\n    _charMapper: function(t) {\r\n        var e;\r\n        if (!t) return t;\r\n        e = \"string\" == typeof t ? new ilib.String(t) : \"\" + t;\r\n        for (var i, n = \"\",\r\n        o = e.charIterator(); o.hasNext();) if (i = o.next(), this.up || \"\\u03a3\" !== i) n += this.mapData[i] ? this.mapData[i] : this.up ? i.toUpperCase() : i.toLowerCase();\r\n        else if (o.hasNext()) {\r\n            i = o.next();\r\n            var s = i.charCodeAt(0);\r\n            n += 904 > s && 902 !== s || s > 974 ? \"\\u03c2\": \"\\u03c3\",\r\n            n += i.toLowerCase()\r\n        } else n += \"\\u03c2\";\r\n        return n\r\n    },\r\n    getLocale: function() {\r\n        return this.locale\r\n    },\r\n    map: function(t) {\r\n        return this.mapper(t)\r\n    }\r\n};\r\n\r\n// ../lib/enyo-ilib/packedbuffer.js\r\nvar PackedBuffer = function(t) {\r\n    this.buffer = t,\r\n    this.index = 0\r\n};\r\nPackedBuffer.prototype.getLongs = function(t) {\r\n    var e = void 0;\r\n    if (this.buffer && this.index < this.buffer.length) {\r\n        e = [];\r\n        for (var i = 0; t > i && this.index + 3 < this.buffer.length; i++) {\r\n            var n = this.buffer[this.index] << 24 | this.buffer[this.index + 1] << 16 | this.buffer[this.index + 2] << 8 | this.buffer[this.index + 3];\r\n            e.push(n),\r\n            this.index += 4\r\n        }\r\n    }\r\n    return e\r\n},\r\nPackedBuffer.prototype.getLong = function() {\r\n    var t = this.getLongs(1);\r\n    return t && t.length > 0 ? t[0] : void 0\r\n},\r\nPackedBuffer.prototype.getBytes = function(t) {\r\n    var e = void 0;\r\n    if (this.buffer && this.index < this.buffer.length) {\r\n        e = [];\r\n        for (var i = 0; t > i && this.index < this.buffer.length; i++) {\r\n            var n = this.buffer[this.index++];\r\n            128 & n && (n -= 256),\r\n            e.push(n)\r\n        }\r\n    }\r\n    return e\r\n},\r\nPackedBuffer.prototype.getByte = function() {\r\n    var t = this.getBytes(1);\r\n    return t && t.length > 0 ? t[0] : void 0\r\n},\r\nPackedBuffer.prototype.getUnsignedBytes = function(t) {\r\n    var e = void 0;\r\n    if (this.buffer && this.index < this.buffer.length) {\r\n        e = [];\r\n        for (var i = 0; t > i && this.index < this.buffer.length; i++) e.push(this.buffer[this.index++])\r\n    }\r\n    return e\r\n},\r\nPackedBuffer.prototype.getString = function(t) {\r\n    for (var e = this.getUnsignedBytes(t), i = \"\", n = 0; e.length > n; n++) i += String.fromCharCode(e[n]);\r\n    return i\r\n},\r\nPackedBuffer.prototype.skip = function(t) {\r\n    this.index += t\r\n},\r\n\"undefined\" != typeof exports && (exports.PackedBuffer = PackedBuffer);\r\n\r\n// ../lib/enyo-ilib/zoneinfo.js\r\nvar _platform = \"unknown\"; (function() {\r\n    \"undefined\" != typeof enyo ? _platform = \"enyo\": \"undefined\" != typeof environment ? _platform = \"rhino\": \"undefined\" != typeof process || \"undefined\" != typeof require ? _platform = \"nodejs\": \"undefined\" != typeof window && (_platform = \"undefined\" != typeof PalmSystem ? \"webos\": \"browser\")\r\n})();\r\nvar PackedBuffer = PackedBuffer || (\"nodejs\" === _platform ? require(\"./packedbuffer.js\").PackedBuffer: void 0),\r\nZoneInfoFile = function(t) {\r\n    var e = this;\r\n    switch (_platform) {\r\n    case \"nodejs\":\r\n        var i = require(\"fs\"),\r\n        n = new Buffer(i.readFileSync(t)),\r\n        o = new Uint8Array(n);\r\n        this._parseInfo(o);\r\n        break;\r\n    default:\r\n        var s = new XMLHttpRequest;\r\n        s.open(\"GET\", \"file:\" + t, !1),\r\n        s.responseType = \"arraybuffer\",\r\n        s.onload = function() {\r\n            var t = new Uint8Array(s.response);\r\n            e._parseInfo(t)\r\n        },\r\n        s.onerror = function() {\r\n            throw \"Cannot load file \" + t\r\n        },\r\n        s.send()\r\n    }\r\n};\r\nZoneInfoFile.prototype._parseInfo = function(t) {\r\n    var e = new PackedBuffer(t);\r\n    if (\"TZif\" != e.getString(4)) throw \"file format not recognized\";\r\n    e.skip(16);\r\n    var i = e.getLong(),\r\n    n = e.getLong(),\r\n    o = e.getLong(),\r\n    s = e.getLong(),\r\n    a = e.getLong(),\r\n    r = e.getLong();\r\n    this.transitionTimes = s ? e.getLongs(s) : [],\r\n    this.transitionTimes = this.transitionTimes.map(function(t) {\r\n        return 1e3 * t\r\n    }),\r\n    this.ruleIndex = s ? e.getUnsignedBytes(s) : [],\r\n    this.zoneInfo = [];\r\n    for (var h = 0; a > h; h++) this.zoneInfo.push({\r\n        offset: Math.floor(e.getLong() / 60),\r\n        isdst: !!e.getByte(),\r\n        abbreviationIndex: e.getByte()\r\n    });\r\n    for (var l = e.getString(r), h = 0; a > h; h++) {\r\n        var c = l.substring(this.zoneInfo[h].abbreviationIndex);\r\n        this.zoneInfo[h].abbreviation = c.substring(0, c.indexOf(\"\\0\"))\r\n    }\r\n    o && e.skip(2 * o),\r\n    n && e.skip(n),\r\n    i && e.skip(i);\r\n    var d = this;\r\n    this.ruleIndex = this.ruleIndex.map(function(t) {\r\n        return {\r\n            offset: d.zoneInfo[t].offset,\r\n            isdst: d.zoneInfo[t].isdst,\r\n            abbreviation: d.zoneInfo[t].abbreviation\r\n        }\r\n    });\r\n    for (var h = 0; s > h; h++) h > 0 && this.ruleIndex[h].isdst && (this.ruleIndex[h].savings = this.ruleIndex[h].offset - this.ruleIndex[h - 1].offset);\r\n    if (this.transitionTimes.length) {\r\n        for (var u = s - 1; u > -1; u--) {\r\n            var g = this.ruleIndex[u];\r\n            if (this.standardTime || g.isdst ? !this.daylightTime && g.isdst && (this.daylightTime = g) : this.standardTime = g, this.daylightTime && this.standardTime) break\r\n        }\r\n        this.daylightTime && !this.standardTime && (this.standardTime = this.daylightTime);\r\n        for (var f = this.zoneInfo.length - 1; f > 0; f--) if (!this.zoneInfo[f].isdst) {\r\n            this.defaultTime = this.zoneInfo[f];\r\n            break\r\n        }\r\n    } else this.standardTime = this.zoneInfo[0];\r\n    this.defaultTime || (this.defaultTime = this.zoneInfo[this.zoneInfo.length - 1])\r\n},\r\nZoneInfoFile.prototype.bsearch = function(t, e) {\r\n    if (e === void 0 || !e || t === void 0 || e[0] > t) return - 1;\r\n    if (t > e[e.length - 1]) return e.length - 1;\r\n    for (var i, n = e.length - 1,\r\n    o = 0,\r\n    s = 0; n >= o;) if (s = Math.floor((n + o) / 2), i = e[s] - t, i > 0) n = s - 1;\r\n    else {\r\n        if (! (0 > i)) return s;\r\n        o = s + 1\r\n    }\r\n    return n\r\n},\r\nZoneInfoFile.prototype.usesDST = function(t) {\r\n    var e = t.getTime(),\r\n    i = e + 31536e6,\r\n    n = this.bsearch(e, this.transitionTimes);\r\n    if ( - 1 !== n) for (; this.transitionTimes.length > n && i > this.transitionTimes[n];) if (this.ruleIndex[n++].isdst) return ! 0;\r\n    return ! 1\r\n},\r\nZoneInfoFile.prototype.getRawOffset = function(t) {\r\n    var e = t.getTime(),\r\n    i = e + 31536e6,\r\n    n = this.bsearch(e, this.transitionTimes),\r\n    o = this.defaultTime.offset;\r\n    if (n > -1) {\r\n        for (; this.transitionTimes.length > n && this.ruleIndex[n].isdst && i > this.transitionTimes[n + 1];) n++;\r\n        this.transitionTimes.length > n && !this.ruleIndex[n].isdst && (o = this.ruleIndex[n].offset)\r\n    }\r\n    return o\r\n},\r\nZoneInfoFile.prototype.getDSTSavings = function(t) {\r\n    var e = t.getTime(),\r\n    i = e + 31536e6,\r\n    n = this.bsearch(e, this.transitionTimes),\r\n    o = 0;\r\n    if (n > -1) {\r\n        for (; this.transitionTimes.length > n && !this.ruleIndex[n].isdst && i > this.transitionTimes[n + 1];) n++;\r\n        this.transitionTimes.length > n && this.ruleIndex[n].isdst && (o = this.ruleIndex[n].savings)\r\n    }\r\n    return o\r\n},\r\nZoneInfoFile.prototype.getDSTStartDate = function(t) {\r\n    var e = t.getFullYear(),\r\n    i = new Date(e, 0, 1).getTime(),\r\n    n = new Date(e + 1, 0, 1).getTime(),\r\n    o = this.bsearch(i, this.transitionTimes),\r\n    s = -1;\r\n    if (o > -1) {\r\n        for (i > this.transitionTimes[o] && o++; this.transitionTimes.length > o && !this.ruleIndex[o].isdst && n > this.transitionTimes[o + 1];) o++;\r\n        this.transitionTimes.length > o && this.ruleIndex[o].isdst && (s = this.transitionTimes[o])\r\n    }\r\n    return s\r\n},\r\nZoneInfoFile.prototype.getDSTEndDate = function(t) {\r\n    var e = t.getFullYear(),\r\n    i = new Date(e, 0, 1).getTime(),\r\n    n = new Date(e + 1, 0, 1).getTime(),\r\n    o = this.bsearch(i, this.transitionTimes),\r\n    s = -1;\r\n    if (o > -1) {\r\n        for (i > this.transitionTimes[o] && o++; this.transitionTimes.length > o && this.ruleIndex[o].isdst && n > this.transitionTimes[o + 1];) o++;\r\n        this.transitionTimes.length > o && !this.ruleIndex[o].isdst && (s = this.transitionTimes[o])\r\n    }\r\n    return s\r\n},\r\nZoneInfoFile.prototype.getAbbreviation = function(t) {\r\n    var e, i = t.getTime(),\r\n    n = i + 31536e6;\r\n    if (this.transitionTimes.length > 0) {\r\n        var o = this.bsearch(i, this.transitionTimes);\r\n        if (e = this.ruleIndex[o].abbreviation, o > -1) {\r\n            for (; this.transitionTimes.length > o && this.ruleIndex[o].isdst && n > this.transitionTimes[o + 1];) o++;\r\n            this.transitionTimes.length > o && !this.ruleIndex[o].isdst && (e = this.ruleIndex[o].abbreviation)\r\n        }\r\n    } else e = this.standardTime.abbreviation;\r\n    return e\r\n},\r\nZoneInfoFile.prototype.getDSTAbbreviation = function(t) {\r\n    var e, i = t.getTime(),\r\n    n = i + 31536e6;\r\n    if (this.transitionTimes.length > 0) {\r\n        var o = this.bsearch(i, this.transitionTimes);\r\n        if (e = this.ruleIndex[o].abbreviation, o > -1) {\r\n            for (; this.transitionTimes.length > o && !this.ruleIndex[o].isdst && n > this.transitionTimes[o + 1];) o++;\r\n            this.transitionTimes.length > o && this.ruleIndex[o].isdst && (e = this.ruleIndex[o].abbreviation)\r\n        }\r\n    } else e = this.standardTime.abbreviation;\r\n    return e\r\n},\r\nZoneInfoFile.prototype.getIlibZoneInfo = function(t) {\r\n    function e(t) {\r\n        var e = Math.floor(t / 60),\r\n        i = t - 60 * e;\r\n        return e + \":\" + i\r\n    }\r\n    function i(t) {\r\n        return 2440587.5 + t / 864e5\r\n    }\r\n    var n = {\r\n        o: e(this.getRawOffset(t))\r\n    };\r\n    return this.usesDST(t) ? (n.f = \"{c}\", n.e = {\r\n        c: this.getAbbreviation(t),\r\n        j: i(this.getDSTEndDate(t))\r\n    },\r\n    n.s = {\r\n        c: this.getDSTAbbreviation(t),\r\n        j: i(this.getDSTStartDate(t)),\r\n        v: e(this.getDSTSavings(t))\r\n    }) : n.f = this.getAbbreviation(t),\r\n    n\r\n},\r\n\"nodejs\" === _platform && \"undefined\" != typeof exports && (exports.ZoneInfoFile = ZoneInfoFile);\r\n\r\n// ../lib/enyo-ilib/glue.js\r\n(function() {\r\n    var t = function() {\r\n        this.base = enyo.path.rewrite(\"$lib/enyo-ilib/ilib/\"),\r\n        \"webos\" === enyo.platform.platformName && (this.webos = !0)\r\n    };\r\n    t.prototype = new ilib.Loader,\r\n    t.prototype.constructor = t,\r\n    t.prototype._createZoneFile = function(t) {\r\n        var e = t.substring(t.indexOf(\"zoneinfo\"));\r\n        e = e.substring(0, e.length - 5);\r\n        try {\r\n            var i = new ZoneInfoFile(\"/usr/share/\" + e);\r\n            return i.getIlibZoneInfo(new Date)\r\n        } catch(n) {\r\n            return void 0\r\n        }\r\n    },\r\n    t.prototype._pathjoin = function(t, e) {\r\n        return t && t.length ? e && e.length ? t + (\"/\" !== t.charAt(t.length - 1) ? \"/\": \"\") + e: t: e\r\n    },\r\n    t.prototype._loadFilesAsync = function(t, e, i, n, o) {\r\n        var s = \"resources\";\r\n        if (n && n.root !== void 0 && (s = n.root), e.length > 0) {\r\n            var a = e.shift(),\r\n            r = void 0;\r\n            if (this.webos && -1 !== a.indexOf(\"zoneinfo\")) i.push(this._createZoneFile(a));\r\n            else {\r\n                this.isAvailable(s, a) ? r = this._pathjoin(s, a) : this.isAvailable(this.base + \"locale\", a) && (r = this._pathjoin(this._pathjoin(this.base, \"locale\"), a));\r\n                var h = function(s, a) {\r\n                    i.push(s.failed || \"object\" != typeof a ? void 0 : a),\r\n                    e.length > 0 ? this._loadFilesAsync(t, e, i, n, o) : o.call(t, i)\r\n                };\r\n                if (r) {\r\n                    var l = new enyo.Ajax({\r\n                        url: r,\r\n                        cacheBust: !1\r\n                    });\r\n                    l.response(this, h),\r\n                    l.error(this, h),\r\n                    l.go()\r\n                } else h({},\r\n                void 0)\r\n            }\r\n        }\r\n    },\r\n    t.prototype.loadFiles = function(t, e, i, n) {\r\n        if (e) {\r\n            var o = [],\r\n            s = \"resources\",\r\n            a = this._pathjoin(this.base, \"locale\");\r\n            return i && i.root !== void 0 && (s = i.root),\r\n            enyo.forEach(t,\r\n            function(t) {\r\n                if (this.webos && -1 !== t.indexOf(\"zoneinfo\")) o.push(this._createZoneFile(t));\r\n                else {\r\n                    var e = !1,\r\n                    i = function(t, i) {\r\n                        t.failed || \"object\" != typeof i || (o.push(i), e = !0)\r\n                    };\r\n                    if (this.isAvailable(s, t)) {\r\n                        var n = new enyo.Ajax({\r\n                            url: this._pathjoin(s, t),\r\n                            sync: !0,\r\n                            cacheBust: !1\r\n                        });\r\n                        n.response(this, i),\r\n                        n.error(this, i),\r\n                        n.go()\r\n                    }\r\n                    if (!e && this.isAvailable(a, t)) {\r\n                        var n = new enyo.Ajax({\r\n                            url: this._pathjoin(a, t),\r\n                            sync: !0,\r\n                            cacheBust: !1\r\n                        });\r\n                        n.response(this, i),\r\n                        n.error(this, i),\r\n                        n.go()\r\n                    }\r\n                    e || o.push(void 0)\r\n                }\r\n            },\r\n            this),\r\n            \"function\" == typeof n && n.call(this, o),\r\n            o\r\n        }\r\n        var r = [];\r\n        this._loadFilesAsync(this, t, r, i, n)\r\n    },\r\n    t.prototype._loadManifest = function(t, e) {\r\n        this.manifest || (this.manifest = {});\r\n        var i = this._pathjoin(t, e),\r\n        n = this._pathjoin(i, \"ilibmanifest.json\"),\r\n        o = new enyo.Ajax({\r\n            url: n,\r\n            sync: !0,\r\n            cacheBust: !1,\r\n            handleAs: \"json\"\r\n        }),\r\n        s = function(t, e) {\r\n            this.manifest[i] = t.failed || \"object\" != typeof e ? \"*\": e.files\r\n        };\r\n        o.response(this, s),\r\n        o.error(this, s),\r\n        o.go()\r\n    },\r\n    t.prototype._loadStandardManifests = function() {\r\n        this.manifest || (this._loadManifest(this.base, \"locale\"), this._loadManifest(\"\", \"resources\"))\r\n    },\r\n    t.prototype.listAvailableFiles = function() {\r\n        return this._loadStandardManifests(),\r\n        this.manifest\r\n    },\r\n    t.prototype.isAvailable = function(t, e) {\r\n        return this._loadStandardManifests(),\r\n        this.manifest[t] || this._loadManifest(t, \"\"),\r\n        \"*\" === this.manifest[t] || -1 !== ilib.indexOf(this.manifest[t], e) ? !0 : !1\r\n    },\r\n    ilib.setLoaderCallback(new t),\r\n    window.UILocale !== void 0 && ilib.setLocale(window.UILocale),\r\n    enyo.isNonLatinLocale = function(t) {\r\n        var e = new ilib.LocaleInfo(t),\r\n        i = e.getLocale(),\r\n        n = [\"bs\", \"cs\", \"ha\", \"hr\", \"hu\", \"lv\", \"lt\", \"pl\", \"ro\", \"sr\", \"sl\", \"tr\", \"vi\"],\r\n        o = [\"ko\"];\r\n        return (\"Latn\" !== e.getScript() || -1 !== enyo.indexOf(i.getLanguage(), n)) && 0 > enyo.indexOf(i.getLanguage(), o)\r\n    },\r\n    enyo.updateI18NClasses = function() {\r\n        var t = new ilib.LocaleInfo,\r\n        e = t.getLocale(),\r\n        i = \"enyo-locale-\";\r\n        document && document.body && document.body.className && document.body.className && (document.body.className = document.body.className.replace(RegExp(\"(^|\\\\s)\" + i + \"[^\\\\s]*\", \"g\"), \"\")),\r\n        enyo.isNonLatinLocale(e) && enyo.dom.addBodyClass(i + \"non-latin\");\r\n        var n = t.getScript();\r\n        \"Latn\" !== n && \"Cyrl\" !== n && \"Grek\" !== n && enyo.dom.addBodyClass(i + \"non-italic\");\r\n        var o = new ilib.ScriptInfo(n);\r\n        \"rtl\" === o.getScriptDirection() ? (enyo.dom.addBodyClass(i + \"right-to-left\"), enyo.Control && (enyo.Control.prototype.rtl = !0)) : enyo.Control && (enyo.Control.prototype.rtl = !1),\r\n        e.getLanguage() && (enyo.dom.addBodyClass(i + e.getLanguage()), e.getScript() ? (enyo.dom.addBodyClass(i + e.getLanguage() + \"-\" + e.getScript()), e.getRegion() && enyo.dom.addBodyClass(i + e.getLanguage() + \"-\" + e.getScript() + \"-\" + e.getRegion())) : e.getRegion() && enyo.dom.addBodyClass(i + e.getLanguage() + \"-\" + e.getRegion())),\r\n        e.getScript() && enyo.dom.addBodyClass(i + e.getScript()),\r\n        e.getRegion() && enyo.dom.addBodyClass(i + e.getRegion()),\r\n        enyo.setCaseMappers()\r\n    }\r\n})(),\r\n$L = function(t) {\r\n    var e;\r\n    if ($L.rb || $L.setLocale(), \"string\" == typeof t) {\r\n        if (!$L.rb) return t;\r\n        e = $L.rb.getString(t)\r\n    } else if (\"object\" == typeof t) if (t.key !== void 0 && t.value !== void 0) {\r\n        if (!$L.rb) return t.value;\r\n        e = $L.rb.getString(t.value, t.key)\r\n    } else e = \"\";\r\n    else e = t;\r\n    return \"\" + e\r\n},\r\n$L.setLocale = function(t) {\r\n    var e = new ilib.Locale(t);\r\n    $L.rb && t === $L.rb.getLocale().getSpec() || ($L.rb = new ilib.ResBundle({\r\n        locale: e,\r\n        type: \"html\",\r\n        name: \"strings\",\r\n        sync: !0,\r\n        lengthen: !0\r\n    }))\r\n},\r\nenyo.setCaseMappers = function() {\r\n    enyo.toLowerCase.mapper = new ilib.CaseMapper({\r\n        direction: \"tolower\"\r\n    }),\r\n    enyo.toUpperCase.mapper = new ilib.CaseMapper({\r\n        direction: \"toupper\"\r\n    })\r\n},\r\nenyo.toLowerCase = function(t) {\r\n    return null != t ? enyo.toLowerCase.mapper.map(\"\" + t) : t\r\n},\r\nenyo.toUpperCase = function(t) {\r\n    return null != t ? enyo.toUpperCase.mapper.map(\"\" + t) : t\r\n},\r\nfunction(t) {\r\n    enyo.updateLocale = function(e) {\r\n        ilib._load && (ilib._load.manifest = void 0),\r\n        ilib.setLocale(e || navigator.language),\r\n        $L.setLocale(e || navigator.language),\r\n        enyo.updateI18NClasses(),\r\n        t()\r\n    }\r\n} (enyo.updateLocale),\r\nenyo.updateLocale(null, !0);"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/enyo.js",
    "content": "\n// ../source/boot/enyo.js\n(function(){var e=\"enyo.js\";enyo=window.enyo||{options:{}},enyo.locateScript=function(e){for(var t,o,n=document.getElementsByTagName(\"script\"),a=n.length-1,r=e.length;a>=0&&(t=n[a]);a--)if(!t.located&&(o=t.getAttribute(\"src\")||\"\",o.slice(-r)==e))return t.located=!0,{path:o.slice(0,Math.max(0,o.lastIndexOf(\"/\"))),node:t}},enyo.args=enyo.args||{};var t=enyo.locateScript(e);if(t){enyo.args.root=(enyo.args.root||t.path).replace(\"/source\",\"\");for(var o,n=0,a=t.node.attributes.length;a>n&&(o=t.node.attributes.item(n));n++)enyo.args[o.nodeName]=o.value}})();\n\n// ../source/boot/version.js\nenyo.version={enyo:\"2.6.0-pre.4.dev\"};\n\n// ../source/boot/ready.js\n(function(e,t){var n,a,o,r,i,c=t.document,d=[],s=\"complete\"===c.readyState,y=!1;e.ready=function(e,t){d.push([e,t]),s&&!y&&(setTimeout(i,0),y=!0)},n=function(t,n){t.call(n||e.global)},a=function(e){(s=\"interactive\"===c.readyState)&&\"DOMContentLoaded\"!==e.type&&\"readystatechange\"!==e.type&&(o(e.type,a),i()),(s=\"complete\"===c.readyState||\"loaded\"===c.readyState)&&(o(e.type,a),i())},r=function(e,t){var n=c.addEventListener?\"addEventListener\":\"attachEvent\",a=\"attachEvent\"===n?\"on\":\"\";c[n](a+e,t,!1)},o=function(e,t){var n=c.addEventListener?\"removeEventListener\":\"detachEvent\",a=\"detachEvent\"===n?\"on\":\"\";c[n](a+e,t,!1)},i=function(){if(s&&d.length)for(;d.length;)n.apply(t,d.shift());y=!1},r(\"DOMContentLoaded\",a),r(\"readystatechange\",a)})(enyo,this);\n\n// ../source/boot/rendered.js\n(function(e){function t(e){n.forEach(function(t){t.method.call(t.context,e)})}var n=[],o=[];e.roots=o,e.rendered=function(t,o){n.push({method:t,context:o||e.global})},e.addToRoots=function(e){var n,a;-1===o.indexOf(e)&&(o.push(e),n=e.rendered,a=e.destroy,e.rendered=function(){n.apply(this,arguments),t(this)},e.destroy=function(){var e=o.indexOf(this);e>-1&&o.splice(e,1),a.apply(this,arguments)})}})(enyo,this);\n\n// ../loader.js\n(function(){enyo=window.enyo||{options:{}},enyo.pathResolverFactory=function(){this.paths={},this.pathNames=[]},enyo.pathResolverFactory.prototype={addPath:function(e,t){return this.paths[e]=t,this.pathNames.push(e),this.pathNames.sort(function(e,t){return t.length-e.length}),t},addPaths:function(e){if(e)for(var t in e)this.addPath(t,e[t])},includeTrailingSlash:function(e){return e&&\"/\"!==e.slice(-1)?e+\"/\":e},rewrite:function(e){var t,a=this.includeTrailingSlash,i=this.paths,n=function(e,n){return t=!0,a(i[n])||\"\"},o=e;do{t=!1;for(var s=0;this.pathNames.length>s;s++){var r=RegExp(\"\\\\$(\"+this.pathNames[s]+\")(\\\\/)?\",\"g\");o=o.replace(r,n)}}while(t);return o}},enyo.path=new enyo.pathResolverFactory,enyo.loaderFactory=function(e,t){this.machine=e,this.packages=[],this.modules=[],this.sheets=[],this.designs=[],this.stack=[],this.pathResolver=t||enyo.path,this.packageName=\"\",this.packageFolder=\"\",this.finishCallbacks={}},enyo.loaderFactory.prototype={verbose:!1,loadScript:function(e,t,a){this.machine.script(e,t,a)},loadSheet:function(e){this.machine.sheet(e)},loadPackage:function(e){this.machine.script(e)},report:function(){},load:function(){this.more({index:0,depends:arguments||[]})},more:function(e){if(!e||!this.continueBlock(e)){var t=this.stack.pop();t?(enyo.runtimeLoading&&e.failed&&(t.failed=t.failed||[],t.failed.push.apply(t.failed,e.failed)),this.verbose&&window.console.groupEnd(\"* finish package (\"+(t.packageName||\"anon\")+\")\"),this.packageFolder=t.folder,this.packageName=\"\",this.more(t)):this.finish(e)}},finish:function(e){this.packageFolder=\"\",this.verbose&&window.console.log(\"-------------- fini\");for(var t in this.finishCallbacks)if(this.finishCallbacks[t]){var a=this.finishCallbacks[t];this.finishCallbacks[t]=null,a(e)}},continueBlock:function(e){for(;e.index<e.depends.length;){var t=e.depends[e.index++];if(t)if(\"string\"==typeof t){if(this.require(t,e))return!0}else this.pathResolver.addPaths(t)}},require:function(e,t){var a=this.pathResolver.rewrite(e),i=this.getPathPrefix(e);if(a=i+a,\".css\"==a.slice(-4).toLowerCase()||\".less\"==a.slice(-5).toLowerCase())this.verbose&&window.console.log(\"+ stylesheet: [\"+i+\"][\"+e+\"]\"),this.requireStylesheet(a);else{if(\".js\"==a.slice(-3).toLowerCase()&&\"package.js\"!=a.slice(-10).toLowerCase())return this.verbose&&window.console.log(\"+ module: [\"+i+\"][\"+e+\"]\"),this.requireScript(e,a,t);if(\".design\"!=a.slice(-7).toLowerCase())return this.requirePackage(a,t),!0;this.verbose&&window.console.log(\"+ design metadata: [\"+i+\"][\"+e+\"]\"),this.requireDesign(a)}},getPathPrefix:function(e){var t=e.slice(0,1);return\"/\"==t||\"\\\\\"==t||\"$\"==t||/^https?:/i.test(e)?\"\":this.packageFolder},requireStylesheet:function(e){this.sheets.push(e),this.loadSheet(e)},requireScript:function(e,t,a){if(this.modules.push({packageName:this.packageName,rawPath:e,path:t}),enyo.runtimeLoading){var i=this,n=function(){i.more(a)},o=function(){a.failed=a.failed||[],a.failed.push(t),i.more(a)};this.loadScript(t,n,o)}else this.loadScript(t);return enyo.runtimeLoading},requireDesign:function(e){this.designs.push({packageName:this.packageName,path:e})},decodePackagePath:function(e){var t=\"\",a=\"package.js\";/^\\/\\//.test(e)&&(e=document.location.protocol+e);var i=e.replace(/\\\\/g,\"/\").replace(/\\/\\//g,\"/\").replace(/:\\//,\"://\").split(\"/\");if(i.length){var n=i.pop()||i.pop()||\"\";n.slice(-a.length)!==a?i.push(n):a=n,t=i.join(\"/\"),t=t?t+\"/\":\"\",a=t+a}return{folder:t,manifest:a}},aliasPackage:function(e){var t=this.decodePackagePath(e);this.manifest=t.manifest},requirePackage:function(e,t){t.folder=this.packageFolder;var a=this.decodePackagePath(e);this.manifest=a.manifest,this.packageFolder=a.folder,t.packageName=this.packageName,this.stack.push(t),this.report(\"loading package\",this.packageName),this.verbose&&window.console.group(\"* start package [\"+this.packageName+\"]\"),this.loadPackage(this.manifest)}}})();\n\n// ../source/boot/boot.js\n(function(e){e.machine={sheet:function(t){var a=\"text/css\",i=\"stylesheet\",n=\".css\"==t.slice(-4),s=!n||\".less\"==t.slice(-5);window.less&&(s||n)?(a=\"text/less\",i=\"stylesheet/less\"):s&&(t=t.slice(0,t.length-4)+\"css\");var o;e.runtimeLoading||s||window.less&&n?(o=document.createElement(\"link\"),o.href=t,o.media=\"screen\",o.rel=i,o.type=a,document.getElementsByTagName(\"head\")[0].appendChild(o)):document.write('<link href=\"'+t+'\" media=\"screen\" rel=\"'+i+'\" type=\"'+a+'\" />'),window.less&&(s||n)&&(window.less.sheets.push(o),e.loader.finishCallbacks.lessRefresh||(e.loader.finishCallbacks.lessRefresh=function(){window.less.refresh(!0)}))},script:function(t,a,i){if(e.runtimeLoading){var n=document.createElement(\"script\");n.src=t,n.onload=a,n.onerror=i,n.charset=\"utf-8\",document.getElementsByTagName(\"head\")[0].appendChild(n)}else document.write('<script src=\"'+t+'\"'+' charset=\"utf-8\" '+(a?' onload=\"'+a+'\"':\"\")+(i?' onerror=\"'+i+'\"':\"\")+\"></scri\"+\"pt>\")},inject:function(e){document.write('<script type=\"text/javascript\">'+e+\"</scri\"+\"pt>\")}},e.loader=new e.loaderFactory(e.machine),e.depends=function(){var t=e.loader;if(!t.packageFolder){var a=e.locateScript(\"package.js\");a&&a.path&&(t.aliasPackage(a.path),t.packageFolder=a.path+\"/\")}t.load.apply(t,arguments)},function(){function e(i){if(i&&i(),a.length){var n=a.shift(),s=n[0],o=t.isArray(s)?s:[s],r=n[1];t.loader.finishCallbacks.runtimeLoader=function(t){e(function(){r&&r(t)})},t.loader.packageFolder=\"./\",t.depends.apply(this,o)}else t.runtimeLoading=!1,t.loader.packageFolder=\"\"}var t=window.enyo,a=[],i=!1;t.ready(function(){i=!0}),t.load=function(n){if(i)a.push(arguments),t.runtimeLoading||(t.runtimeLoading=!0,e());else if(t.isArray(n))for(var s=0;n.length>s;++s)t.loader.require(n[s]);else t.loader.require(n)}}(),e.path.addPaths({enyo:e.args.root,lib:\"$enyo/../lib\"})})(enyo,this);\n\n// ../source/kernel/log.js\n(function(e){e.logging={level:99,levels:{log:20,warn:10,error:0},shouldLog:function(e){var t=parseInt(this.levels[e],0);return this.level>=t},validateArgs:function(t){for(var a,i=0,n=t.length;(a=t[i])||n>i;i++)try{\"object\"==typeof a&&(t[i]=e.json.stringify(a))}catch(o){t[i]=\"Error: \"+o.message}},_log:function(t,a){var i=window.console;if(void 0!==i){var n=e.isArray(a)?a:e.cloneArray(a);e.platform.androidFirefox&&e.logging.validateArgs(n),e.dumbConsole&&(n=[n.join(\" \")]);var o=i[t];o&&o.apply?o.apply(i,n):i.log.apply?i.log.apply(i,n):i.log(n.join(\" \"))}},log:function(e,t){var a=window.console;a!==void 0&&this.shouldLog(e)&&this._log(e,t)}},e.setLogLevel=function(t){var a=parseInt(t,0);isFinite(a)&&(e.logging.level=a)},e.log=function(){e.logging.log(\"log\",arguments)},e.warn=function(){e.logging.log(\"warn\",arguments)},e.error=function(){e.logging.log(\"error\",arguments)}})(enyo,this);\n\n// ../source/kernel/lang.js\n(function(e,t){Function.prototype.bind||(Function.prototype.bind=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=this,o=function(){};if(\"function\"!=typeof this)throw new TypeError(\"Function.prototype.bind called on non-callable object.\");return t=function(){var t=n.concat(Array.prototype.slice.call(arguments)),i=this instanceof o&&e?this:e;return r.apply(i,t)},o.prototype=this.prototype,t.prototype=new o,t}),e.global=t,e.nop=function(){},e.nob={},e.nar=[],e.instance=function(){},e.setPrototype||(e.setPrototype=function(e,t){e.prototype=t}),e.delegate=function(t){return e.setPrototype(e.instance,t),new e.instance},e.exists=function(e){return void 0!==e};var n=0;e.uid=function(e){return(e?e:\"\")+n++ +\"\"},e.uuid=function(){var e,t=Math.random().toString(16).substr(2,8)+\"-\"+(e=Math.random().toString(16).substr(2,8)).substr(0,4)+\"-\"+e.substr(4,4)+(e=Math.random().toString(16).substr(2,8)).substr(0,4)+\"-\"+e.substr(4,4)+Math.random().toString(16).substr(2,8);return t},e.irand=function(e){return Math.floor(Math.random()*e)};var r=Object.prototype.toString;e.isString=function(e){return\"[object String]\"===r.call(e)},e.isFunction=function(e){return\"[object Function]\"===r.call(e)},e.isArray=Array.isArray||function(e){return\"[object Array]\"===r.call(e)},e.isObject=Object.isObject||function(e){return null!=e&&\"[object Object]\"===r.call(e)},e.isTrue=function(e){return!(\"false\"===e||e===!1||0===e||null===e||void 0===e)},e.isNumeric=function(t){return!e.isArray(t)&&t-parseFloat(t)+1>=0},e.bind=function(t,n){if(n||(n=t,t=null),t=t||e.global,\"string\"==typeof n){if(!t[n])throw'enyo.bind: scope[\"'+n+'\"] is null (scope=\"'+t+'\")';n=t[n]}if(\"function\"==typeof n){var r=e.cloneArray(arguments,2);return n.bind?n.bind.apply(n,[t].concat(r)):function(){var o=e.cloneArray(arguments);return n.apply(t,r.concat(o))}}throw'enyo.bind: scope[\"'+n+'\"] is not a function (scope=\"'+t+'\")'},e.bindSafely=function(t,n){if(\"string\"==typeof n){if(!t[n])throw'enyo.bindSafely: scope[\"'+n+'\"] is null (this=\"'+this+'\")';n=t[n]}if(\"function\"==typeof n){var r=e.cloneArray(arguments,2);return function(){if(!t.destroyed){var o=e.cloneArray(arguments);return n.apply(t,r.concat(o))}}}throw'enyo.bindSafely: scope[\"'+n+'\"] is not a function (this=\"'+this+'\")'},e.asyncMethod=function(t,n){return n?setTimeout(e.bind.apply(e,arguments),1):setTimeout(t,1)},e.call=function(e,t,n){var r=e||this;if(t){var o=r[t]||t;if(o&&o.apply)return o.apply(r,n||[])}},e.now=Date.now||function(){return(new Date).getTime()},e.perfNow=function(){var t=window.performance||{};return t.now=t.now||t.mozNow||t.msNow||t.oNow||t.webkitNow||e.now,function(){return t.now()}}();var o=e.getPath=function(t){if(!t&&null!==t&&void 0!==t)return t;var n,r,i,a,s=this===e?e.global:this;if(\".\"==t[0]&&(t=t.replace(/^\\.+/,\"\")),t){n=t.split(\".\"),r=n.shift();do a=s,s=s._getters&&(i=s._getters[r])&&!i.generated?s[i]():s.get&&s!==this&&s.get!==o?s.get(r):s[r];while(s&&(r=n.shift()));return s}};e.getPath.fast=function(t){var n,r,o=this;return r=o._getters&&(n=o._getters[t])?o[n]():o[t],\"function\"==typeof r&&e.checkConstructor(r)||r};var i=e.setPath=function(t,n,r){if(!t||!t&&null!==t&&void 0!==t)return this;var a,s,c,l,u,f,h,p=this===e?e.global:this,d={create:!0,silent:!1,force:!1},g=p;if(\"object\"==typeof r?r=e.mixin({},[d,r]):(l=r,r=d),r.force&&(l=!0),f=r.silent,u=r.create,h=r.comparator,\".\"==t[0]&&(t=t.replace(/^\\.+/,\"\")),!t)return p;a=t.split(\".\"),s=a.shift();do if(a.length){if(p!==g&&p.set&&p.set!==i)return a.unshift(s),p.set(a.join(\".\"),n,r),g;p=p!==g&&p.get?(p.get!==o?p.get(s):p[s])||u&&(p[s]={}):p[s]||u&&(p[s]={})}else c=p.get&&p.get!==o?p.get(s):p[s];while(p&&a.length&&(s=a.shift()));return p?p!==g&&p.set&&p.set!==i?(p.set(s,n,r),g):(p[s]=n,p.notify&&!f&&(l||c!==n||h&&h(c,n))&&p.notify(s,c,n,r),g):g};e.setPath.fast=function(e,t){var n,r,o=this;return o._computed&&void 0!==o._computed[e]?o:(n=o._getters&&(r=o._getters[e])?o[r]():o[e],o[e]=t,n!==t&&o.notifyObservers(e,n,t),o)},e.toUpperCase=function(e){return null!=e?(\"\"+e).toUpperCase():e},e.toLowerCase=function(e){return null!=e?(\"\"+e).toLowerCase():e},e.cap=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)},e.uncap=function(e){return e.slice(0,1).toLowerCase()+e.slice(1)},e.format=function(e){var t,n=/\\%./g,r=0,o=e,i=arguments;return t=function(){return i[++r]},o.replace(n,t)},String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\\s+|\\s+$/g,\"\")},e.trim=function(e){return\"string\"==typeof e&&e.trim()||e},Object.create=Object.create||function(){var e=function(){};return function(t){if(!t||null===t||\"object\"!=typeof t)throw\"Object.create: Invalid parameter\";return e.prototype=t,new e}}(),Object.keys=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);if(!{toString:null}.propertyIsEnumerable(\"toString\"))for(var o,i=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],a=0;o=i[a];a++)n.call(e,o)&&t.push(o);return t},e.keys=Object.keys,e.only=function(e,t,n){var r,o,i,a={};for(i=0,o=e.length>>>0;o>i;++i)r=e[i],(!n||void 0!==t[r]&&null!==t[r])&&(a[r]=t[r]);return a},e.remap=function(t,n,r){var o,i=r?e.clone(n):{};for(o in t)o in n&&(i[t[o]]=n.get?n.get(o):n[o]);return i},e.indexBy=function(t,n,r){var o,i,a={},s=0;if(!(e.exists(n)&&n instanceof Array))return a;if(!e.exists(t)||\"string\"!=typeof t)return a;var c=e.clone(n);for(r=e.exists(r)&&\"function\"==typeof r?r:void 0,i=n.length;i>s;++s)o=n[s],e.exists(o)&&e.exists(o[t])&&(r?r(t,o,a,c):a[o[t]]=o);return a},e.clone=function(t,n){if(t){if(t instanceof Array)return t.slice();if(t instanceof Object)return n?Object.create(t):e.mixin({},t)}return t};var a={},s={exists:!1,ignore:!1,filter:null},c=e.mixin=function(){var e,t=arguments[0],n=arguments[1],r=arguments[2];if(t?t instanceof Array&&(r=n,n=t,t={}):t={},r&&r!==!0||(r=s),n instanceof Array)for(var o,i=0;o=n[i];++i)c(t,o,r);else for(var l in n)e=n[l],a[l]!==e&&(r.exists&&!e||r.ignore&&t[l]||(r.filter?!r.filter(l,e,n,t,r):0)||(t[l]=e));return t};e.values=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t},Array.prototype.indexOf=Array.prototype.indexOf||function(e,t){var n=this.length>>>0;for(t=+t||0,1/0===Math.abs(t)&&(t=0),0>t&&(t+=n),0>t&&(t=0);n>t;++t)if(this[t]===e)return t;return-1},Array.prototype.lastIndexOf=Array.prototype.lastIndexOf||function(e,t){var n=Object(this),r=n.length>>>0;if(0===r)return-1;for(void 0!==t?(t=Number(t),Math.abs(t)>r&&(t=r),(1/0===t||t===-1/0)&&(t=r),0>t&&(t+=r)):t=r;t>-1;--t)if(n[t]===e)return t;return-1},Array.prototype.findIndex=Array.prototype.findIndex||function(e,t){for(var n=0,r=this.length>>>0;r>n;++n)if(e.call(t,this[n],n,this))return n;return-1},Array.prototype.find=Array.prototype.find||function(e,t){for(var n=0,r=this.length>>>0;r>n;++n)if(e.call(t,this[n],n,this))return this[n]},Array.prototype.forEach=Array.prototype.forEach||function(e,t){for(var n=0,r=this.length>>>0;r>n;++n)e.call(t,this[n],this)},Array.prototype.map=Array.prototype.map||function(e,t){for(var n=[],r=0,o=this.length>>>0;o>r;++r)n.push(e.call(t,this[r],r,this));return n},Array.prototype.filter=Array.prototype.filter||function(e,t){for(var n=[],r=0,o=this.length>>>0;o>r;++r)e.call(t,this[r],r,this)&&n.push(this[r]);return n},e.indexOf=function(e,t,n){return e instanceof Array?e.indexOf(t,n):t.indexOf(e,n)},e.lastIndexOf=function(e,t,n){return e instanceof Array?e.lastIndexOf(t,n):t.lastIndexOf(e,n)},e.findIndex=function(e,t,n){return e.findIndex(t,n)},e.find=function(e,t,n){return e.find(t,n)},e.where=e.find,e.forEach=function(e,t,n){return e.forEach(t,n)},e.map=function(e,t,n){return e.map(t,n)},e.filter=function(e,t,n){return e.filter(t,n)},e.pluck=function(e,t){if(!(e instanceof Array)){var n=e;e=t,t=n}for(var r=[],o=0,i=e.length>>>0;i>o;++o)r.push(e[o]?e[o][t]:void 0);return r},e.merge=function(){for(var e=[],t=Array.prototype.concat.apply([],arguments),n=0,r=t.length>>>0;r>n;++n)~e.indexOf(t[n])||e.push(t[n]);return e},e.cloneArray=function(e,t,n){for(var r=n||[],o=t||0,i=e.length;i>o;o++)r.push(e[o]);return r},e.toArray=e.cloneArray,e.remove=function(e,t){if(!(e instanceof Array)){var n=e;e=t,t=n}var r=e.indexOf(t);return r>-1&&e.splice(r,1),e};var l=/[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFE\\u0590-\\u05FF\\uFB1D-\\uFB4F]/;e.isRtl=function(e){return l.test(e)}})(enyo,this);\n\n// ../source/kernel/job.js\n(function(t){t.job=function(e,n,r){t.job.stop(e),t.job._jobs[e]=setTimeout(function(){t.job.stop(e),n()},r)},t.job.stop=function(e){t.job._jobs[e]&&(clearTimeout(t.job._jobs[e]),delete t.job._jobs[e])},t.job.throttle=function(e,n,r){t.job._jobs[e]||(n(),t.job._jobs[e]=setTimeout(function(){t.job.stop(e)},r))},t.job._jobs={}})(enyo,this);\n\n// ../source/kernel/Oop.js\n(function(t){t.concatenated=[],t.kind=function(e){var n=e.name||\"\";if(t.options.noDefer||!n||e.noDefer)return t.kind.finish(e);var r=function(){var e;if(r._FinalCtor)e=r._FinalCtor;else{if(!(this instanceof r))throw'enyo.kind: constructor called directly, not using \"new\"';e=r._finishKindCreation()}var n=t.delegate(e.prototype),i=e.apply(n,arguments);return i?i:n};return r._finishKindCreation=function(){r._finishKindCreation=void 0,t.setPath(n,void 0);var i=t.kind.finish(e);return r._FinalCtor=i,e=null,i},e.statics&&t.mixin(r,e.statics),r.extend=t.kind.statics.extend,r._deferred=!0,n&&!t.getPath(n)||t.kind.allowOverride?t.setPath(n,r):n&&t.error(\"enyo.kind: \"+n+\" is already in use by another \"+\"kind, all kind definitions must have unique names.\"),r},t.kind.finish=function(e){t._kindCtors={};var n=e.name||\"\";delete e.name;var r=\"kind\"in e,i=e.kind;delete e.kind;var o=t.constructorForKind(i),a=o&&o.prototype||null;if(r&&void 0===i||void 0===o){var s=void 0===i?\"undefined kind\":\"unknown kind (\"+i+\")\";throw\"enyo.kind: Attempt to subclass an \"+s+\". Check dependencies for [\"+(n||\"<unnamed>\")+\"].\"}var c=t.kind.makeCtor();return e.hasOwnProperty(\"constructor\")&&(e._constructor=e.constructor,delete e.constructor),t.setPrototype(c,a?t.delegate(a):{}),t.concatHandler(c,e),t.mixin(c.prototype,e),c.prototype.kindName=n?n:o&&o.prototype?o.prototype.kindName:\"\",c.prototype.base=o,c.prototype.ctor=c,t.forEach(t.kind.features,function(t){t(c,e)}),n&&!t.getPath(n)||t.kind.allowOverride?t.setPath(n,c):n&&t.error(\"enyo.kind: \"+n+\" is already in use by another \"+\"kind, all kind definitions must have unique names.\"),c},t.singleton=function(e,n){var r=e.name;delete e.name;var i,o=t.kind(e);return t.setPath.call(n||t.global,r,i=new o),i},t.kind.makeCtor=function(){var t=function(){if(!(this instanceof t))throw'enyo.kind: constructor called directly, not using \"new\"';var e;return this._constructor&&(e=this._constructor.apply(this,arguments)),this.constructed&&this.constructed.apply(this,arguments),e?e:void 0};return t},t.kind.defaultNamespace=\"enyo\",t.kind.features=[],t.kind.extendMethods=function(e,n,r){var i=e.prototype||e,o=i.base;!i.inherited&&o&&(i.inherited=t.kind.inherited),n.hasOwnProperty(\"constructor\")&&(n._constructor=n.constructor,delete n.constructor);for(var a in n){var s=n[a];t.isInherited(s)&&(s=i[a]=r?s.fn(i[a]||t.nop):s.fn(o?o.prototype[a]||t.nop:t.nop)),t.isFunction(s)&&(r?(i[a]=s,s.displayName=a+\"()\"):(s._inherited=o?o.prototype[a]:null,s.displayName=i.kindName+\".\"+a+\"()\"))}},t.kind.features.push(t.kind.extendMethods),t.kind.inherited=function(e,n){var r=e.callee,i=r._inherited;if(\"function\"==typeof i){var o=e;if(n){o=[];for(var a=0,s=n.length;s>a;++a)o[a]=n[a];for(s=e.length;s>a;++a)o[a]=e[a]}return i.apply(this,o)}t.warn(\"enyo.kind.inherited: unable to find requested super-method from -> \"+e.callee.displayName+\" in \"+this.kindName)},function(t){var e=function(t){this.fn=t};t.inherit=function(t){return new e(t)},t.isInherited=function(t){return t&&t instanceof e}}(t),t.kind.features.push(function(e,n){e.subclass||(e.subclass=t.kind.statics.subclass),e.extend||(e.extend=t.kind.statics.extend),n.statics&&(t.mixin(e,n.statics),delete e.prototype.statics),n.protectedStatics&&(t.mixin(e,n.protectedStatics),delete e.prototype.protectedStatics);for(var r=e.prototype.base;r;)r.subclass(e,n),r=r.prototype.base}),t.kind.statics={subclass:function(){},extend:function(e,n){var r,i,o=this,a=t.isArray(e)?e:[e];i=function(e,n){return!(\"function\"==typeof n||t.isInherited(n))&&-1===t.concatenated.indexOf(e)},!n&&o._deferred&&(o=t.checkConstructor(o)),r=n||o.prototype;for(var s,c=0;s=a[c];++c)t.concatHandler(r,s,!0),t.kind.extendMethods(r,s,!0),t.mixin(r,s,{filter:i});return n||o}},t.concatHandler=function(t,e,n){for(var r=t.prototype||t,i=r.ctor;i;)i.concat&&i.concat(t,e,n),i=i.prototype.base},t.checkConstructor=function(e){if(t.isFunction(e)){if(e._FinalCtor)return e._FinalCtor;if(e._finishKindCreation)return e._finishKindCreation()}return e},t._kindCtors={},t.constructorForKind=function(e){if(null===e)return e;if(void 0===e)return t.defaultCtor;if(t.isFunction(e))return t.checkConstructor(e);var n=t._kindCtors[e];if(n)return n;if(n=t.Theme[e]||t[e]||t.getPath(\"enyo.\"+e)||window[e]||t.getPath(e),n&&n._finishKindCreation&&(n=n._finishKindCreation()),!t.isFunction(n))throw\"[\"+e+\"] is not the name of a valid kind.\";return t._kindCtors[e]=n,n},t.Theme={},t.registerTheme=function(e){t.mixin(t.Theme,e)}})(enyo,this);\n\n// ../source/kernel/dev.js\n(function(t){\"use strict\";t.bench=t.perfNow;var e={},n={},r=\"- - - - - - - - - - - - - - - - -\\nBENCHMARK REPORT (%.): %.\\nTOTAL TIME (ms): %.\\nAVERAGE TIME (ms): %.\\nMINIMUM TIME (ms): %.\\nMAXIMUM TIME (ms): %.\\nNUMBER OF ENTRIES: %.\\n- - - - - - - - - - - - - - - - -\\n\",i=function(e){var n=0,r=1/0,i=-1/0,o=e.length,a={total:null,average:null,number:o,min:null,max:null};return t.forEach(e,function(t){n+=t,r=Math.min(t,r),i=Math.max(t,i)}),a.total=n,a.min=r,a.max=i,a.average=Math.abs(n/(o||1)),a};t.dev={enabled:!0,bench:function(e){if(!0!==this.enabled)return!1;var n=e||{name:t.uid(\"bench\")};return new t.dev.Benchmark(n)},report:function(o){var a=n[o]||e[o];if(!a)return!1;if(a.report&&\"function\"==typeof a.report)return a.report();var s=i(a);t.log(t.format(r,\"averages\",o,s.total,s.average,s.min,s.max,s.number))},clear:function(t){var r=e[t]?e:n[t]?n:null;return r?(r.complete&&r.complete(),r[t]instanceof Array?r[t]=[]:delete r[t],!0):!1}},t.kind({name:\"enyo.dev.Benchmark\",kind:null,noDefer:!0,logging:!0,autoStart:!0,average:!0,_started:!1,_averaging:!1,_begin:null,_end:null,_time:null,start:function(){return!0===this._started?!1:(this._log(\"starting benchmark\"),this._begin=t.bench(),this._started=!0,!0)},stop:function(){return this._started?(this._end=t.bench(),this._time=this._end-this._begin,this._log(\"benchmark complete: \"+this._time),!0===this._averaging&&n[this.name].push(this._time),this._started=!1,!0):!1},constructor:function(r){t.mixin(this,r),e[this.name]=this,!0!==this.average||n[this.name]||(n[this.name]=[]),n[this.name]&&!1!==this.average&&(this._averaging=!0),!0===this.autoStart&&this.start()},_log:function(e){return this.logging?(t.log(\"bench (\"+this.name+\"): \"+e),void 0):!1}})})(enyo,this);\n\n// ../source/kernel/LinkedList.js\n(function(t){var e=t.kind,n=t.mixin,r=t.constructorForKind;e({name:\"enyo.LinkedListNode\",kind:null,noDefer:!0,prev:null,next:null,copy:function(){var t=new this.ctor;return t.prev=this.prev,t.next=this.next,t},constructor:function(t){t&&n(this,t)},destroy:function(){this.prev=null,this.next&&this.next.destroy(),this.next=null}}),e({name:\"enyo.LinkedList\",kind:null,noDefer:!0,nodeKind:t.LinkedListNode,head:null,tail:null,length:0,clear:function(){this.head&&this.head.destroy(),this.head=null,this.tail=null,this.length=0},slice:function(t,e){var n,r=t||this.head,i=new this.ctor;if(e=e||this.tail,r&&r!==e)do n=r.copy(),i.appendNode(n);while((r=r.next)&&r!==e);return i},destroy:function(){this.clear(),this.destroyed=!0},createNode:function(t){return new this.nodeKind(t)},deleteNode:function(t){return this.removeNode(t),t.destroy(),this},removeNode:function(t){var e=t.prev,n=t.next;return e&&(e.next=n),n&&(n.prev=e),this.length--,t.next=t.prev=null,this},appendNode:function(t,e){return e=e||this.tail,e?(e.next&&(t.next=e.next),e.next=t,t.prev=e,e===this.tail&&(this.tail=t),this.length++):(this.head=this.tail=t,t.prev=t.next=null,this.length=1),this},find:function(t,e,n){var r=n||this.head;if(r)do if(t.call(e||this,r,this))return r;while(r=r.next);return!1},forward:function(t,e,n){var r=n||this.head;if(r)do if(t.call(e||this,r,this))break;while(r=r.next);return r},backward:function(t,e,n){var r=n||this.tail;if(r)do if(t.call(e||this,r,this))break;while(r=r.prev);return r},constructor:function(){this.nodeType=r(this.nodeType)}})})(enyo,this);\n\n// ../source/kernel/ObserverChain.js\n(function(t){function e(t,e){return t&&\"object\"==typeof t?t.get?t.get(e):t[e]:void 0}var n=t.kind,i=t.LinkedList,r=t.LinkedListNode,o=n({name:\"enyo.ObserverChainNode\",kind:r,noDefer:!0,constructor:t.inherit(function(t){return function(){t.apply(this,arguments),this.connect()}}),destroy:t.inherit(function(t){return function(){this.disconnect(),t.apply(this,arguments),this.observer=null,this.list=null,this.object=null}}),connect:function(){var t=this.object,e=this._changed,n=this.property;t&&(t.observe&&t.observe(n,e,this,{noChain:!0,priority:!0}),this.connected=!0,this.list.connected++)},disconnect:function(){var t=this.object,e=this._changed,n=this.property,i=this.connected;t&&t.unobserve&&t.unobserve(n,e,this),this.connected=null,i&&this.list.connected--},setObject:function(t){var n,i,r=this.object,o=this.property;r!==t&&(this.disconnect(),this.object=t,this.connect(),this.list.tail===this&&(n=e(r,o),i=e(t,o),n!==i&&this.list.observed(this,n,i)))},_changed:function(t,e){this.list.observed(this,t,e)}});n({name:\"enyo.ObserverChain\",kind:i,nodeKind:o,noDefer:!0,connected:0,constructor:function(t,e){this.object=e,this.path=t,this.parts=t.split(\".\"),this.createChain()},destroy:t.inherit(function(t){return function(){t.apply(this,arguments),this.object=null,this.parts=null,this.path=null}}),rebuild:function(t){this.rebuilding||(this.rebuilding=!0,this.forward(function(t){if(t!==this.head){var n=t.prev.object,i=t.prev.property;t.setObject(e(n,i))}},this,t),this.rebuilding=!1)},isConnected:function(){return!(this.connected!==this.length||!this.length)},buildPath:function(t){var e=\"\";return this.backward(function(t){e=t.property+(e?\".\"+e:e)},this,t),e},createChain:function(){for(var t,n,i=this.parts,r=this.object,o=!1,s=0;n=i[s];++s)\"$\"==n?o=!0:(o&&(n=\"$.\"+n),t=this.createNode({property:n,object:r,list:this}),this.appendNode(t),r=e(r,n),o=!1)},observed:function(t,e,n){this.object.stopNotifications(),t===this.tail&&this.object.notify(this.buildPath(t),e,n),t!==this.tail&&e!==n&&this.rebuild(t),this.object.startNotifications()}})})(enyo,this);\n\n// ../source/kernel/Binding.js\n(function(t){function e(e){var n=e.ready;if(!n){var i,r=e.from||\"\",o=e.to||\"\",s=e.source,a=e.target,c=e.owner,u=!e.oneWay;if(\"string\"!=typeof r&&(r=\"\"),\"string\"!=typeof o&&(o=\"\"),!s)if(\"^\"==r[0]){var h=r.split(\".\");r=h.pop(),s=t.getPath.call(t.global,h.join(\".\").slice(1))}else s=c;if(!a)if(\"^\"==o[0]){var l=o.split(\".\");o=l.pop(),a=t.getPath.call(t.global,l.join(\".\").slice(1))}else a=c;e._target=a,e._source=s,e._from=\".\"==r[0]?r.slice(1):r,e._to=\".\"==o[0]?o.slice(1):o,u||(i=e._to.split(\".\"),i.length>2&&(i.pop(),e._toTarget=i.join(\".\"))),n=!!(s&&\"object\"==typeof s&&a&&\"object\"==typeof a&&r&&o)}return e.ready=n}var n=t.kind,i=t.bindings=[],r=1,o=2;n({name:\"enyo.Binding\",kind:null,noDefer:!0,oneWay:!0,connected:!1,owner:null,autoConnect:!0,autoSync:!0,source:null,target:null,from:null,dirty:r,to:null,transform:null,isConnected:function(){var t,e,n=this._from,i=this.oneWay?this._toTarget||this._to:this._to,r=this._source,o=this._target;return n&&i&&r&&o?((!this.oneWay||this._toTarget)&&(t=o.getChains()[i]),e=r.getChains()[n],this.connected&&(e?e.isConnected():!0)&&(t?t.isConnected():!0)):!1},stop:function(){this._stop=!0},isReady:function(){return this.ready||e(this)},reset:function(){return this.disconnect(),this.ready=null,this._source=this._target=this._to=this._from=this._toTarget=null,this},rebuild:function(){return this.reset().connect()},connect:function(){return this.isConnected()||this.isReady()&&(this._source.observe(this._from,this._sourceChanged,this,{priority:!0}),this.oneWay?this._toTarget&&this._target.observe(this._toTarget,this._toTargetChanged,this,{priority:!0}):this._target.observe(this._to,this._targetChanged,this),this.connected=!0,this.isConnected()&&this.autoSync&&this.sync(!0)),this},disconnect:function(){return this.isConnected()&&(this._source.unobserve(this._from,this._sourceChanged,this),this.oneWay?this._toTarget&&this._target.unobserve(this._toTarget,this._toTargetChanged,this):this._target.unobserve(this._to,this._targetChanged,this),this.connected=!1),this},sync:function(t){var e,n=this._source,i=this._target,s=this._from,a=this._to,c=this.getTransform();if(this.isReady()&&this.isConnected()){switch(this.dirty||t&&r){case o:e=i.get(a),c&&(e=c.call(this.owner||this,e,o,this)),this._stop||n.set(s,e,{create:!1});break;case r:e=n.get(s),c&&(e=c.call(this.owner||this,e,r,this)),this._stop||i.set(a,e,{create:!1})}this.dirty=null,this._stop=null}return this},destroy:function(){var t,e=this.owner;return this.disconnect(),this.owner=null,this.source=this._source=null,this.target=this._target=null,this.ready=null,this.destroyed=!0,t=i.indexOf(this),t>-1&&i.splice(t,1),e&&!e.destroyed&&e.removeBinding(this),this},getTransform:function(){return this._didInitTransform?this.transform:function(e){e._didInitTransform=!0;var n=e.transform,i=e.owner,r=i&&i.bindingTransformOwner;return n?(\"string\"==typeof n&&(n=r&&r[n]?r[n]:i&&i[n]?i[n]:t.getPath(n)),e.transform=\"function\"==typeof n?n:null):void 0}(this)},constructor:function(e){i.push(this),e&&t.mixin(this,e),this.euid||(this.euid=t.uid(\"b\")),this.autoConnect&&this.connect()},_sourceChanged:function(){return this.dirty=this.dirty==o?null:r,this.dirty==r&&this.sync()},_targetChanged:function(){return this.dirty=this.dirty==r?null:o,this.dirty==o&&this.sync()},_toTargetChanged:function(){this.dirty=r,this.reset().connect()}}),t.Binding.find=function(t){return i.find(function(e){return e.euid==t})},t.Binding.DIRTY_FROM=r,t.Binding.DIRTY_TO=o,t.defaultBindingKind=t.Binding})(enyo,this);\n\n// ../source/kernel/mixins/MixinSupport.js\n(function(t){function e(e,n){var i=e._mixins=e._mixins?e._mixins.slice():[],s=o(n)?n:n.name,u=c(s,i);0>u&&(s==n&&(n=h(s)),!n&&t.error(\"Could not find the mixin \"+s),s&&i.push(s),n=a(n),n.hasOwnProperty(\"constructor\")&&(n._constructor=n.constructor,delete n.constructor),delete n.name,r(n,e),n.name=s)}function n(t,n){if(n.mixins){var r=t.prototype||t,o=n.mixins;r._mixins&&(r._mixins=r._mixins.slice()),i(o,function(t){e(r,t)})}}var i=t.forEach,r=t.kind.statics.extend,o=t.isString,s=t.isArray,a=t.clone,c=t.indexOf,u=t.inherit,h=t.getPath;t.concatenated.push(\"mixins\"),t.kind.features.push(n);var l=t.kind.statics.extend;r=t.kind.statics.extend=function(t,o){return s(t)?i(t,function(t){r.call(this,t,o)},this):(\"string\"==typeof t?e(o||this.prototype,t):(t.mixins&&n(o||this,t),t.name?e(o||this.prototype,t):l.apply(this,arguments)),void 0)},t.MixinSupport={name:\"MixinSupport\",extend:function(t){t&&e(this,t)},importProps:u(function(t){return function(e){e&&e.mixins&&n(this,e),t.apply(this,arguments)}})}})(enyo,this);\n\n// ../source/kernel/mixins/ObserverSupport.js\n(function(t){function e(t,e,n,i){var r,o,s=this.getObservers(),a=this.getChains(),u=t.split(\".\"),h=i&&i.priority;return o=i&&i.noChain||a[t]||2>u.length||2===u.length&&\"$\"==t[0],s[t]&&!s.hasOwnProperty(t)&&(s[t]=s[t].slice()),r=s[t]||(s[t]=[]),r[h?\"unshift\":\"push\"]({method:e,ctx:n||this}),o||(this.getChains()[t]=new c(t,this)),this}function n(t,e,n,i){var r,o,s=t.getObservers(e),a=t.getChains();return s&&s.length&&(r=s.findIndex(function(t){return t.method===n&&(i?t.ctx===i:!0)}),r>-1&&s.splice(r,1)),(o=a[e])&&!s.length&&o.destroy(),t}function i(t,e,n,i,o){if(t.isObserving()){var s=t.getObservers(e);if(s&&s.length)for(var a,c=0;a=s[c];++c)\"string\"==typeof a.method?t[a.method](n,i,e,o):a.method.call(a.ctx||t,n,i,e,o)}else r(t,e,n,i,o);return t}function r(t,e,n,i,r){if(t._notificationQueueEnabled){var o=t._notificationQueue||(t._notificationQueue={}),s=o[e]||(o[e]={});s.was=n,s.is=i,s.opts=r}}function o(t){var e,n,i=t._notificationQueue;if(i){t._notificationQueue=null;for(e in i)n=i[e],t.notify(e,n.was,n.is,n.opts)}}var s,a={},c=t.ObserverChain;t.concatenated.push(\"observers\"),s=t.ObserverSupport={name:\"ObserverSupport\",_observing:!0,_observeCount:0,_notificationQueue:null,_notificationQueueEnabled:!0,isObserving:function(){return this._observing},getObservers:function(e){var n,i,r=this.euid||(this.euid=t.uid(\"o\"));return i=a[r]||(a[r]=this._observers?Object.create(this._observers):{}),e?(n=i[e],i[\"*\"]&&(n=n?n.concat(i[\"*\"]):i[\"*\"].slice()),n):i},getChains:function(){return this._observerChains||(this._observerChains={})},addObserver:function(){return e.apply(this,arguments)},observe:function(){return e.apply(this,arguments)},removeObserver:function(t,e){return n(this,t,e)},unobserve:function(t,e,i){return n(this,t,e,i)},removeAllObservers:function(t){var e=this.euid,n=e&&a[e];return n&&(t?n[t]=null:a[e]=null),this},notifyObservers:function(t,e,n,r){return i(this,t,e,n,r)},notify:function(t,e,n,r){return i(this,t,e,n,r)},stopNotifications:function(t){return this._observing=!1,this._observeCount++,t&&this.disableNotificationQueue(),this},startNotifications:function(t){return this._observeCount&&this._observeCount--,0===this._observeCount&&(this._observing=!0),t&&this.enableNotificationQueue(),this.isObserving()&&o(this),this},enableNotificationQueue:function(){return this._notificationQueueEnabled=!0,this},disableNotificationQueue:function(){return this._notificationQueueEnabled=!1,this._notificationQueue=null,this},constructor:t.inherit(function(t){return function(){var e,n,i,r,o;if(this._observerChains){e=this._observerChains,this._observerChains={};for(i in e)for(r=e[i],o=0;n=r[o];++o)this.observe(i,n.method)}t.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){var e,n,i=this._observerChains;if(t.apply(this,arguments),i){for(e in i)n=i[e],n.destroy();this._observerChains=null}}})};var u=t.concatHandler;t.concatHandler=function(t,e,n){if(u.call(this,t,e,n),e!==s){var i=t.prototype||t,r=i._observers?Object.create(i._observers):null,o=e.observers,a=i._observerChains&&Object.create(i._observerChains);if(!r){if(!i.kindName)return;r={}}!o||o instanceof Array?o&&(o=o.slice()):function(){var t,n,i=[];for(n in e.observers)t=e.observers[n],i.push({method:n,path:t});o=i}();for(var c in e)\"Changed\"==c.slice(-7)&&(o||(o=[]),o.push({method:c,path:c.slice(0,-7)}));var h=function(t,e){var n;t.indexOf(\".\")>-1?(a||(a={}),n=a[t]||(a[t]=[]),n.push({method:e})):(r[t]&&!r.hasOwnProperty(t)&&(r[t]=r[t].slice()),n=r[t]||(r[t]=[]),n.find(function(t){return t.method==e})||n.push({method:e}))};o&&o.forEach(function(t){t.path&&t.path instanceof Array?t.path.forEach(function(e){h(e,t.method)}):h(t.path,t.method)}),i._observers=r,i._observerChains=a}}})(enyo);\n\n// ../source/kernel/mixins/ComputedSupport.js\n(function(t){function e(t,e){var n=t._getComputedCache(e),i=t._isComputedCached(e);return(n.dirty||void 0===n.dirty)&&(i&&(n.dirty=!1),n.previous=n.value,n.value=t[e]()),n.value}function n(t,e){var n=t._computedQueue||(t._computedQueue=[]),i=t._computedDependencies[e];if(i)for(var r,o=0;r=i[o];++o)n.length&&-1!=n.indexOf(r)||n.push(r)}function i(t){var n=t._computedQueue;if(t._computedQueue=null,n&&t.isObserving())for(var i,r=0;i=n[r];++r)t.notify(i,t._getComputedCache(i).value,e(t,i))}var r,o=t.kind.statics.extend;t.concatenated.push(\"computed\"),r=t.ComputedSupport={name:\"ComputedSupport\",_computedRecursion:0,isComputed:function(t){return this._computed&&(this._computed[t]===!0||this._computed[t]===!1)},isComputedDependency:function(t){return!!(this._computedDependencies?this._computedDependencies[t]:!1)},get:t.inherit(function(t){return function(n){return this.isComputed(n)?e(this,n):t.apply(this,arguments)}}),set:t.inherit(function(t){return function(e){return this.isComputed(e)?this:t.apply(this,arguments)}}),notifyObservers:function(){return this.notify.apply(this,arguments)},notify:t.inherit(function(t){return function(e){return this.isComputedDependency(e)&&n(this,e),this._computedRecursion++,t.apply(this,arguments),this._computedRecursion--,this._computedQueue&&0===this._computedRecursion&&i(this),this}}),_isComputedCached:function(t){return this._computed[t]},_getComputedCache:function(t){var e=this._computedCache||(this._computedCache={});return e[t]||(e[t]={})}};var s=t.concatHandler;t.concatHandler=function(e,n,i){if(s.call(this,e,n,i),n.computed){var a=e.prototype||e,c=a._computed?Object.create(a._computed):{},u=a._computedDependencies?Object.create(a._computedDependencies):{};o(r,a),n.computed&&n.computed instanceof Array||function(){var e,i,r,o=[];for(i in n.computed)e=n.computed[i],r=e&&e.find(function(n){return\"object\"==typeof n?t.remove(e,n)||!0:!1}),o.push({method:i,path:e,cached:r?r.cached:null});n.computed=o}();for(var h,l=function(t,e){var n;u[t]&&!u.hasOwnProperty(t)&&(u[t]=u[t].slice()),n=u[t]||(u[t]=[]),n.push(e)},f=0;h=n.computed[f];++f)c[h.method]=!!h.cached,h.path&&h.path instanceof Array?h.path.forEach(function(t){l(t,h.method)}):h.path&&l(h.path,h.method);a._computed=c,a._computedDependencies=u}}})(enyo,this);\n\n// ../source/kernel/mixins/BindingSupport.js\n(function(t){var e=t.inherit,n=t.toArray,i=t.isString,r=t.mixin,o=t.defaultBindingKind,s=t.constructorForKind;t.concatenated.push(\"bindings\"),t.BindingSupport={name:\"BindingSupport\",_bindingSupportInitialized:!1,binding:function(){var t,e,a=n(arguments),c=r(a),u=this.bindings||(this.bindings=[]);return c.owner=c.owner||this,t=c.kind=c.kind||this.defaultBindingKind||o,this._bindingSupportInitialized?(i(t)&&(t=c.kind=s(t)),e=new t(c),u.push(e),e):(u.push(c),this)},clearBindings:function(t){var e=t||this.bindings&&this.bindings.slice();return e.forEach(function(t){t.destroy()}),this},removeBinding:function(e){return t.remove(e,this.bindings),e.owner===this&&(e.owner=null),this},constructed:e(function(t){return function(){var e=this.bindings;this._bindingSupportInitialized=!0,e&&(this.bindings=[])&&e.forEach(function(t){this.binding(t)},this),t.apply(this,arguments)}}),destroy:e(function(t){return function(){t.apply(this,arguments),this.bindings&&this.bindings.length&&this.clearBindings(),this.bindings=null}})},t.ComponentBindingSupport={name:\"ComponentBindingSupport\",adjustComponentProps:e(function(t){return function(e){t.apply(this,arguments),e.bindingTransformOwner||(e.bindingTransformOwner=this.getInstanceOwner())}})};var a=t.concatHandler,c={ignore:!0};t.concatHandler=function(t,e,n){var i=t.prototype||t,s=e&&(e.defaultBindingKind||o),u=e&&e.bindingDefaults;a.call(this,t,e,n),e.bindings&&(e.bindings.forEach(function(t){u&&r(t,u,c),t.kind||(t.kind=s)}),i.bindings=i.bindings?i.bindings.concat(e.bindings):e.bindings,delete e.bindings)}})(enyo,this);\n\n// ../source/kernel/mixins/ApplicationSupport.js\n(function(t){t.ApplicationSupport={name:\"ApplicationSupport\",adjustComponentProps:t.inherit(function(e){return function(n){n.app=n.app||this.app||this instanceof t.Application&&this,e.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){this.app=null,t.apply(this,arguments)}})}})(enyo,this);\n\n// ../source/kernel/mixins/MultipleDispatchSupport.js\n(function(t){t.MultipleDispatchSupport={name:\"MultipleDispatchSupport\",addDispatchTarget:function(e){var n=this._dispatchTargets;e&&!~t.indexOf(e,n)&&n.push(e)},removeDispatchTarget:function(e){var n,i=this._dispatchTargets;n=t.indexOf(e,i),n>-1&&i.splice(n,1)},bubbleUp:t.inherit(function(t){return function(e,n,i){this._dispatchDefaultPath&&t.apply(this,arguments);for(var r,o=this._dispatchTargets,s=0;r=o[s];++s)r&&!r.destroyed&&r.dispatchBubble(e,n,i)}}),ownerChanged:t.inherit(function(t){return function(){t.apply(this,arguments);var e=this.owner;this._dispatchDefaultPath=!!e}}),constructor:t.inherit(function(t){return function(){return this._dispatchTargets=[],t.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){this._dispatchTargets=null,t.apply(this,arguments)}}),_dispatchDefaultPath:!1}})(enyo,this);\n\n// ../source/kernel/mixins/EventEmitter.js\n(function(t){function e(t,e,n,i){return t.listeners().push({event:e,method:n,ctx:i||t}),t}function n(t,e,n,i){var r,o=t.listeners();return o.length&&(r=o.findIndex(function(t){return t.event==e&&t.method===n&&(i?t.ctx===i:!0)}),r>=0&&o.splice(r,1)),t}function i(t,e){var n=e.length,i=e[0],o=t.listeners(i);if(o.length){n>1?(e=r(e),e.unshift(t)):e=[t,i];for(var s,a=0;s=o[a];++a)s.method.apply(s.ctx,e);return!0}return!1}var r=t.toArray,o=t.uid,s={};t.EventEmitter={name:\"EventEmitter\",_silenced:!1,_silenceCount:0,silence:function(){return this._silenced=!0,this._silenceCount++,this},unsilence:function(t){return t?(this._silenceCount=0,this._silenced=!1):(this._silenceCount&&this._silenceCount--,0===this._silenceCount&&(this._silenced=!1)),this},isSilenced:function(){return this._silenced},addListener:function(t,n,i){return e(this,t,n,i)},on:function(t,n,i){return e(this,t,n,i)},removeListener:function(t,e,i){return n(this,t,e,i)},off:function(t,e,i){return n(this,t,e,i)},removeAllListeners:function(t){var e=this.euid,n=e&&s[e];return n&&(s[e]=t?n.filter(function(e){return e.event!=t}):null),this},listeners:function(t){var e=this.euid||(this.euid=o(\"e\")),n=s[e]||(s[e]=[]);return t?n.filter(function(e){return e.event==t||\"*\"==e.event}):n},triggerEvent:function(){return this._silenced?!1:i(this,arguments)},emit:function(){return this._silenced?!1:i(this,arguments)}},t.RegisteredEventSupport=t.EventEmitter})(enyo);\n\n// ../source/kernel/mixins/ProxyObject.js\n(function(t){t.ProxyObject={name:\"ProxyObject\",proxyObjectKey:\"data\",get:function(e){var n=this.proxyObjectKey,i=this[n];return i?i.get?i.get.apply(i,arguments):t.getPath.call(i,e):void 0},set:function(e,n,i){var r,o,s=this.proxyObjectKey,a=this[s];return o=\"object\"==typeof i?i.force:i,a&&(r=this.get(e),a.set?a.set.apply(a,arguments):t.setPath.apply(a,arguments),this.notify&&(o||r!==n||i&&i.compare&&i.compare(r,n))&&this.notify(e,r,n)),this}}})(enyo,this);\n\n// ../source/kernel/Object.js\n(function(t){function e(e,n){if(r.shouldLog(e))try{throw Error()}catch(i){r._log(e,[n.callee.caller.displayName+\": \"].concat(t.cloneArray(n))),t.log(i.stack)}}function n(e,n,i){var r,o=t.cap(e),s=\"get\"+o,a=\"set\"+o,c=i._getters||(i._getters={}),u=i._setters||(i._setters={});i[e]=n,(r=i[s])&&\"function\"==typeof r?r&&\"function\"==typeof r&&!r.generated&&(c[e]=s):(r=i[s]=function(){return t.getPath.fast.call(this,e)},r.generated=!0),(r=i[a])&&\"function\"==typeof r?r&&\"function\"==typeof r&&!r.generated&&(u[e]=a):(r=i[a]=function(n){return t.setPath.fast.call(this,e,n)},r.generated=!0)}var i=t.kind,r=t.logging,o=t.MixinSupport,s=t.ObserverSupport,a=t.BindingSupport;i({name:\"enyo.Object\",kind:null,noDefer:!0,destroyed:!1,mixins:[o,s,a],constructor:function(e){t._objectCount++,this.importProps(e)},importProps:function(e){var n;if(e)if(t.concatHandler(this,e,!0),e.kindName)for(n in e)-1===t.concatenated.indexOf(n)&&e.hasOwnProperty(n)&&(this[n]=e[n]);else for(n in e)-1===t.concatenated.indexOf(n)&&(this[n]=e[n]);return this},destroyObject:function(t){return this[t]&&this[t].destroy&&this[t].destroy(),this[t]=null,this},log:function(){var e=arguments.callee.caller,n=((e?e.displayName:\"\")||\"(instance method)\")+\":\";r.log(\"log\",[n].concat(t.cloneArray(arguments)))},warn:function(){e(\"warn\",arguments)},error:function(){e(\"error\",arguments)},get:t.getPath,set:t.setPath,bindSafely:function(){var e=Array.prototype.concat.apply([this],arguments);return t.bindSafely.apply(t,e)},destroy:function(){return this.set(\"destroyed\",!0)}}),t._objectCount=0,t.Object.concat=function(t,e){var i,r,o=e.published;if(o){i=t.prototype||t;for(r in o)e[r]&&\"function\"==typeof e[r]||n(r,o[r],i)}}})(enyo,this);\n\n// ../source/kernel/Component.js\n(function(t){function e(t){var e,n=r[t];return n||(e=t.lastIndexOf(\".\"),n=e>=0?t.slice(e+1):t,n=n.charAt(0).toLowerCase()+n.slice(1),r[t]=n),n}var n=t.kind,i=0,r={},o=t.Object,s=t.ApplicationSupport,a=t.ComponentBindingSupport,c=n({name:\"enyo.Component\",kind:o,noDefer:!0,cachedBubble:!0,cachePoint:!1,published:{name:\"\",id:\"\",owner:null,componentOverrides:null},defaultKind:\"Component\",handlers:{},mixins:[s,a],toString:function(){return this.id+\" [\"+this.kindName+\"]\"},constructor:t.inherit(function(t){return function(){this._componentNameMap={},this.$={},this.cachedBubbleTarget={},t.apply(this,arguments)}}),constructed:t.inherit(function(t){return function(e){this.create(e),t.apply(this,arguments)}}),create:function(){this.stopNotifications(),this.ownerChanged(),this.initComponents(),this.startNotifications()},initComponents:function(){this.createChrome(this.kindComponents),this.createClientComponents(this.components)},createChrome:function(t){this.createComponents(t,{isChrome:!0})},createClientComponents:function(t){this.createComponents(t,{owner:this.getInstanceOwner()})},getInstanceOwner:function(){return!this.owner||this.owner.notInstanceOwner?this:this.owner},destroy:t.inherit(function(t){return function(){return this.destroyComponents(),this.setOwner(null),t.apply(this,arguments),this.stopAllJobs(),this}}),destroyComponents:function(){var t,e,n=this.getComponents();for(e=0;n.length>e;++e)t=n[e],t.destroyed||t.destroy();return this},makeId:function(){var t=\"_\",e=this.owner&&this.owner.getId(),n=this.name||\"@@\"+ ++i;return(e?e+t:\"\")+n},ownerChanged:function(t){t&&t.removeComponent&&t.removeComponent(this),this.owner&&this.owner.addComponent&&this.owner.addComponent(this),this.id||(this.id=this.makeId())},nameComponent:function(t){var n,i=e(t.kindName),r=this._componentNameMap[i]||0;do n=i+(++r>1?r+\"\":\"\");while(this.$[n]);return this._componentNameMap[i]=Number(r),t.name=n},addComponent:function(t){var e=t.get(\"name\");return e||(e=this.nameComponent(t)),this.$[e]&&this.warn(\"Duplicate component name \"+e+\" in owner \"+this.id+\" violates \"+\"unique-name-under-owner rule, replacing existing component in the hash and \"+\"continuing, but this is an error condition and should be fixed.\"),this.$[e]=t,this.notify(\"$.\"+e,null,t),t.publish&&(this[e]=t,this.notify(e,null,t)),this},removeComponent:function(t){var e=t.get(\"name\");return delete this.$[e],t.publish&&delete this[e],this},getComponents:function(){return t.values(this.$)},adjustComponentProps:function(e){this.defaultProps&&t.mixin(e,this.defaultProps,{ignore:!0}),e.kind=e.kind||e.isa||this.defaultKind,e.owner=e.owner||this},_createComponent:function(e,n){var i=n?t.mixin({},[n,e]):t.clone(e);return this.adjustComponentProps(i),c.create(i)},createComponent:function(t,e){return this._createComponent(t,e)},createComponents:function(t,e){var n,i,r=[];if(t)for(i=0;t.length>i;++i)n=t[i],r.push(this._createComponent(n,e));return r},getBubbleTarget:function(t,e){return e.delegate?this.owner:this.bubbleTarget||this.cachedBubble&&this.cachedBubbleTarget[t]||this.owner},bubble:function(t,e,n){return this._silenced?!1:(e=e||{},e.lastHandledComponent=null,e.bubbling=!0,null==e.originator&&(e.originator=n||this),this.dispatchBubble(t,e,n||this))},bubbleUp:function(t,e){var n;return!this._silenced&&(e=e||{},e.bubbling=!0,n=this.getBubbleTarget(t,e))?n.dispatchBubble(t,e,e.delegate||this):!1},dispatchEvent:function(e,n,i){var r,o;if(!this._silenced){if(r=(n||(n={})).delegate,this.decorateEvent!==c.prototype.decorateEvent&&this.decorateEvent(e,n,i),r&&r.owner===this)return this[e]&&\"function\"==typeof this[e]?this.dispatch(e,n,i):!1;if(!r){var s=this.handlers&&this.handlers[e],a=this[e]&&t.isString(this[e]),u=this.cachePoint||s||a||\"master\"===this.id;if(n.bubbling&&(n.lastHandledComponent&&u&&(n.lastHandledComponent.cachedBubbleTarget[e]=this,n.lastHandledComponent=null),n.lastHandledComponent||\"master\"===this.id||(n.lastHandledComponent=this)),s&&this.dispatch(s,n,i))return!0;if(a)return n.delegate=this,o=this.bubbleUp(this[e],n,i),delete n.delegate,o}}return!1},dispatchBubble:function(t,e,n){return this._silenced?!1:this.dispatchEvent(t,e,n)?!0:this.bubbleUp(t,e,n)},decorateEvent:function(){},stopAllJobs:function(){var t;if(this.__jobs)for(t in this.__jobs)this.stopJob(t)},dispatch:function(t,e,n){var i;return!this._silenced&&(i=t&&this[t],i&&\"function\"==typeof i)?i.call(this,n||this,e):!1},triggerHandler:function(){return this.dispatchEvent.apply(this,arguments)},waterfall:function(t,e,n){if(!this._silenced){if(e=e||{},e.bubbling=!1,this.dispatchEvent(t,e,n))return!0;this.waterfallDown(t,e,n||this)}return this},waterfallDown:function(t,e,n){var i;if(e=e||{},e.bubbling=!1,!this._silenced)for(i in this.$)this.$[i].waterfall(t,e,n||this);return this},_silenced:!1,_silenceCount:0,silence:function(){return this._silenced=!0,this._silenceCount+=1,this},isSilenced:function(){return this._silenced},unsilence:function(){return 0!==this._silenceCount&&--this._silenceCount,0===this._silenceCount&&(this._silenced=!1),!this._silenced},startJob:function(e,n,i,r){var o=this.__jobs=this.__jobs||{};return r=r||5,\"string\"==typeof n&&(n=this[n]),this.stopJob(e),o[e]=setTimeout(this.bindSafely(function(){t.jobs.add(this.bindSafely(n),r,e)}),i),this},stopJob:function(e){var n=this.__jobs=this.__jobs||{};n[e]&&(clearTimeout(n[e]),delete n[e]),t.jobs.remove(e)},throttleJob:function(t,e,n){var i=this.__jobs=this.__jobs||{};return i[t]||(\"string\"==typeof e&&(e=this[e]),e.call(this),i[t]=setTimeout(this.bindSafely(function(){this.stopJob(t)}),n)),this}});t.defaultCtor=c,t.create=c.create=function(e){var n,i;if(!e.kind&&e.hasOwnProperty(\"kind\"))throw Error(\"enyo.create: Attempt to create a null kind. Check dependencies for [\"+e.name+\"]\");return n=e.kind||e.isa||t.defaultCtor,i=t.constructorForKind(n),i||(t.error(\"No constructor found for kind \"+n),i=c),new i(e)},c.subclass=function(t,e){var n=t.prototype;e.components?(n.kindComponents=e.components,delete n.components):e.componentOverrides&&(n.kindComponents=c.overrideComponents(n.kindComponents,e.componentOverrides,n.defaultKind))},c.concat=function(e,n){var i,r=e.prototype||e;n.handlers&&(i=r.handlers?t.clone(r.handlers):{},r.handlers=t.mixin(i,n.handlers),delete n.handlers),n.events&&c.publishEvents(r,n)},c.overrideComponents=function(e,n,i){var r=function(e,n){return!(t.isFunction(n)||t.isInherited(n))};e=t.clone(e);for(var o=0;e.length>o;o++){var s=t.clone(e[o]),a=n[s.name],c=t.constructorForKind(s.kind||i);if(a){t.concatHandler(s,a);for(var u=s.kind&&(\"string\"==typeof s.kind&&t.getPath(s.kind)||\"function\"==typeof s.kind&&s.kind)||t.defaultCtor;u;)u.concat&&u.concat(s,a,!0),u=u.prototype.base;t.mixin(s,a,{filter:r})}s.components&&(s.components=t.Component.overrideComponents(s.components,n,c.prototype.defaultKind)),e[o]=s}return e},c.publishEvents=function(t,e){var n,i,r=e.events;if(r){i=t.prototype||t;for(n in r)c.addEvent(n,r[n],i)}},c.addEvent=function(e,n,i){var r,o;t.isString(n)?(\"on\"!=e.slice(0,2)&&(t.warn('enyo.Component.addEvent: event names must start with \"on\". '+i.kindName+\" \"+'event \"'+e+'\" was auto-corrected to \"on'+e+'\".'),e=\"on\"+e),r=n,o=\"do\"+t.cap(e.slice(2))):(r=n.value,o=n.caller),i[e]=r,i[o]||(i[o]=function(n,i){var r=i||n;r||(r={});var o=r.delegate;r.delegate=void 0,t.exists(r.type)||(r.type=e),this.bubble(e,r),o&&(r.delegate=o)})}})(enyo,this);\n\n// ../source/kernel/UiComponent.js\n(function(t){t.kind({name:\"enyo.UiComponent\",kind:\"enyo.Component\",published:{container:null,parent:null,controlParentName:\"client\",layoutKind:\"\"},handlers:{onresize:\"handleResize\"},addBefore:void 0,protectedStatics:{_resizeFlags:{showingOnly:!0}},create:t.inherit(function(t){return function(){this.controls=this.controls||[],this.children=this.children||[],this.containerChanged(),t.apply(this,arguments),this.layoutKindChanged()}}),destroy:t.inherit(function(t){return function(){this.destroyClientControls(),this.setContainer(null),t.apply(this,arguments)}}),importProps:t.inherit(function(n){return function(){n.apply(this,arguments),this.owner||(this.owner=t.master)}}),createComponents:t.inherit(function(t){return function(){var n=t.apply(this,arguments);return this.discoverControlParent(),n}}),discoverControlParent:function(){this.controlParent=this.$[this.controlParentName]||this.controlParent},adjustComponentProps:t.inherit(function(t){return function(n){n.container=n.container||this,t.apply(this,arguments)}}),containerChanged:function(t){t&&t.removeControl(this),this.container&&this.container.addControl(this,this.addBefore)},parentChanged:function(t){t&&t!=this.parent&&t.removeChild(this)},isDescendantOf:function(t){for(var n=this;n&&n!=t;)n=n.parent;return t&&n==t},getControls:function(){return this.controls},getClientControls:function(){for(var t,n=[],e=0,i=this.controls;t=i[e];e++)t.isChrome||n.push(t);return n},destroyClientControls:function(){for(var t,n=this.getClientControls(),e=0;t=n[e];e++)t.destroy()},addControl:function(t,n){if(void 0!==n){var e=null===n?0:this.indexOfControl(n);this.controls.splice(e,0,t)}else this.controls.push(t);this.addChild(t,n)},removeControl:function(n){return n.setParent(null),t.remove(n,this.controls)},indexOfControl:function(n){return t.indexOf(n,this.controls)},indexOfClientControl:function(n){return t.indexOf(n,this.getClientControls())},indexInContainer:function(){return this.container.indexOfControl(this)},clientIndexInContainer:function(){return this.container.indexOfClientControl(this)},controlAtIndex:function(t){return this.controls[t]},getNextControl:function(){var t,n,e,i=this.getParent().children;for(e=i.length-1;e>=0;e--){if(t=i[e],t===this)return n?n:null;t.generated&&(n=t)}return null},addChild:function(t,n){if(this.controlParent)this.controlParent.addChild(t,n);else if(t.setParent(this),void 0!==n){var e=null===n?0:this.indexOfChild(n);this.children.splice(e,0,t)}else this.children.push(t)},removeChild:function(n){return t.remove(n,this.children)},indexOfChild:function(n){return t.indexOf(n,this.children)},layoutKindChanged:function(){this.layout&&this.layout.destroy(),this.layout=t.createFromKind(this.layoutKind,this),this.generated&&this.render()},flow:function(){this.layout&&this.layout.flow()},reflow:function(){this.layout&&this.layout.reflow()},resize:function(){this.waterfall(\"onresize\",t.UiComponent._resizeFlags),this.waterfall(\"onpostresize\",t.UiComponent._resizeFlags)},handleResize:function(){this.reflow()},waterfallDown:function(n,e,i){e=e||{};for(var r in this.$)this.$[r]instanceof t.UiComponent||this.$[r].waterfall(n,e,i);for(var o,s=0,a=this.children;o=a[s];s++)!o.showing&&e&&e.showingOnly||o.waterfall(n,e,i)},getBubbleTarget:function(t,n){return n.delegate?this.owner:this.bubbleTarget||this.cachedBubble&&this.cachedBubbleTarget[t]||this.parent||this.owner}}),t.createFromKind=function(n,e){var i=n&&t.constructorForKind(n);return i?new i(e):void 0},t.master=new t.Component({name:\"master\",notInstanceOwner:!0,eventFlags:{showingOnly:!0},getId:function(){return\"\"},isDescendantOf:t.nop,bubble:function(n,e){\"onresize\"==n?(t.master.waterfallDown(\"onresize\",this.eventFlags),t.master.waterfallDown(\"onpostresize\",this.eventFlags),t.dom.updateScaleFactor()):t.Signals.send(n,e)}})})(enyo,this);\n\n// ../source/kernel/Layout.js\n(function(t){t.kind({name:\"enyo.Layout\",kind:null,layoutClass:\"\",constructor:function(t){this.container=t,t&&t.addClass(this.layoutClass)},destroy:function(){this.container&&this.container.removeClass(this.layoutClass)},flow:function(){},reflow:function(){}})})(enyo,this);\n\n// ../source/kernel/Signals.js\n(function(t){t.kind({name:\"enyo.Signals\",kind:\"enyo.Component\",noDefer:!0,create:t.inherit(function(n){return function(){n.apply(this,arguments),t.Signals.addListener(this)}}),destroy:t.inherit(function(n){return function(){t.Signals.removeListener(this),n.apply(this,arguments)}}),notify:function(t,n){this.dispatchEvent(t,n)},protectedStatics:{listeners:[],addListener:function(t){this.listeners.push(t)},removeListener:function(n){t.remove(n,this.listeners)}},statics:{send:function(n,e){t.forEach(this.listeners,function(t){t.notify(n,e)})}}})})(enyo,this);\n\n// ../source/kernel/MultipleDispatchComponent.js\n(function(t){t.kind({name:\"enyo.MultipleDispatchComponent\",kind:\"enyo.Component\",mixins:[t.MultipleDispatchSupport]})})(enyo,this);\n\n// ../source/kernel/Controller.js\n(function(t){t.kind({name:\"enyo.Controller\",kind:\"enyo.MultipleDispatchComponent\",global:!1,data:null,constructor:t.inherit(function(n){return function(){n.apply(this,arguments),this.global&&t.setPath(this.name,this)}}),_isController:!0})})(enyo,this);\n\n// ../source/kernel/Router.js\n(function(t){var n=[],e=function(t){for(var e=n,i=e.length,r=0;i>r;++r)e[r]._hashChanged(t)},i=/\\:[a-zA-Z0-9]*/g,r=function(t){return\"#\"===t[0]?t.slice(1):t};t.ready(function(){t.dispatcher.listen(window,\"hashchange\",e)}),t.kind({name:\"enyo.Router\",listening:!0,internalOnly:!1,defaultPathOnStart:!1,defaultRoute:null,triggerOnStart:!0,useHistory:!1,routes:null,kind:\"enyo.Controller\",_staticRoutes:null,_dynamicRoutes:null,_current:\"\",_history:null,computed:[{method:\"location\",path:\"_current\",config:{cached:!0}},{method:\"defaultPath\"}],location:function(n){return n?(n=r(n),this.internalOnly?this.set(\"_current\",n):t.asyncMethod(this,\"trigger\",{location:n,change:!0}),void 0):r(this.get(\"_current\"))},defaultPath:function(){return this.defaultRoute?this.defaultRoute.path:\"\"},trigger:function(t){t?\"string\"==typeof t&&(t={location:t}):t={location:this.get(\"_current\")};var n=t.location,i=t.global,r=t.change,o=this.get(\"location\");r?o!==n?window.location.hash=n:this._hashChanged(n):i?e(n):this._hashChanged(n)},handle:function(t){this._handleStatic(t)||this._handleDynamic(t)||this._handleDefault(t)},back:function(){this.useHistory&&this._history.length>=2&&(this._history.shift(),this.set(\"location\",this._history.shift()))},addHistory:function(t,n){if(this.useHistory)switch(typeof n){case\"undefined\":this._history.unshift(t);break;case\"number\":n>=0&&this._history.length>n&&this._history.splice(n,0,t);break;case\"boolean\":this._history.push(t)}return this},clearHistory:function(){return this._history=[],this},addRoute:function(t){var n,e=this._staticRoutes,r=this._dynamicRoutes;return!0===t[\"default\"]?this.defaultRoute=t:i.test(t.path)?(i.lastIndex=0,n=RegExp(t.path.replace(i,\"([a-zA-Z0-9-.]*)\")),t.regex=n,r.push(t)):e[t.path]=t,this},constructor:t.inherit(function(t){return function(){this._staticRoutes={},this._dynamicRoutes=[],this.routes=this.routes||[],this._history=this._history||[],t.apply(this,arguments)}}),create:t.inherit(function(e){return function(){e.apply(this,arguments),this._setupRoutes(),this.set(\"_current\",r(window.location.hash)),n.push(this),this.triggerOnStart&&(this.defaultPathOnStart?t.asyncMethod(this,\"trigger\",{change:!0,location:this.get(\"defaultPath\")}):t.asyncMethod(this,\"trigger\"))}}),destroy:t.inherit(function(e){return function(){var i=t.indexOf(this,n);~i||n.splice(i,1),e.apply(this,arguments)}}),_hashChanged:function(n){var e=function(n){return t.isString(n)||(n=n.newUrl||window.location.hash),r(n)}(n);this.listening&&(this.set(\"_current\",e),this.handle(e))},_execHandler:function(n,e,i,r){var o=e,s=\"string\"==typeof n?t.getPath.call(this,n):n;return\"string\"==typeof e&&(\"function\"==typeof this[e]?(o=this[e],s=s||this):\"function\"==typeof this.owner[e]?(o=this.owner[e],s=s||this.owner):\"function\"==typeof s[e]&&(o=s[e]),\"function\"==typeof o&&(r.handler=o,r.context=s)),o&&\"function\"==typeof o?(o.apply(s,i),!0):!1},_handleStatic:function(t){var n,e,i,r=this._staticRoutes;return(n=r[t])?(e=n.handler,i=n.context,this._execHandler(i,e,[t],n)):!1},_handleDynamic:function(t){for(var n,e,i,r,o,s=this._dynamicRoutes,a=0,c=s.length;c>a;++a)if(e=s[a],n=e.regex,o=n.exec(t))return o=o.slice(1),i=e.handler,r=e.context,this._execHandler(r,i,o,e);return!1},_handleDefault:function(t){var n=this.defaultRoute||{},e=n.context,i=n.handler;return this._execHandler(e,i,[t],n)},_setupRoutes:function(){for(var t,n=this.routes,e=0,i=n.length;i>e;++e)t=n[e],t&&this.addRoute(t)},_currentChanged:function(){this.useHistory&&this._history.unshift(this.get(\"location\"))}})})(enyo,this);\n\n// ../source/kernel/ViewController.js\n(function(t){t.kind({name:\"enyo.ViewController\",kind:\"enyo.Controller\",view:null,viewKind:null,renderTarget:\"document.body\",resetView:!1,render:function(n){var e=this.view,i=n||this.renderTarget;if(e){if(e.hasNode()&&e.generated)return;this.container?e.render():e.renderInto(t.dom.byId(i)||t.getPath(i))}},renderInto:function(t){this.render(this.renderTarget=t)},viewChanged:function(n){if(!n||(n.set(\"bubbleTarget\",null),n.owner!==this||n.destroyed||n.destroy(),!n.destroyed||this.resetView)){var e=this.view;if(\"string\"==typeof e&&(e=t.getPath(e)),\"function\"==typeof e&&(this.viewKind=e,e=null),\"string\"==typeof this.viewKind&&(this.viewKind=t.getPath(this.viewKind)),!e&&this.viewKind||e&&\"object\"==typeof e&&!(e instanceof t.UiComponent)){var i=\"object\"==typeof e&&null!==e&&!e.destroyed&&e||{kind:this.viewKind},r=this;i.kind=i.kind||this.viewKind||t.defaultCtor,e=this.createComponent(i,{owner:this,container:this.container||null,bubbleTarget:this}),e.extend({destroy:t.inherit(function(t){return function(){t.apply(this,arguments),this.bubbleTarget===r&&this.bubbleTarget.set(\"view\",null)}})})}else e&&e instanceof t.UiComponent&&(this.viewKind||(this.viewKind=e.ctor),e.set(\"bubbleTarget\",this));this.view=e}},create:t.inherit(function(t){return function(){t.apply(this,arguments),this.viewChanged()}}),destroy:t.inherit(function(t){return function(){this.view=null,this.viewKind=null,t.apply(this,arguments)}}),notInstanceOwner:!0})})(enyo,this);\n\n// ../source/kernel/Application.js\n(function(t){var n=t.kind,e=t.ViewController;t.applications={},n({name:\"enyo.Application\",kind:e,autoStart:!0,renderOnStart:!0,defaultKind:\"enyo.Controller\",viewReady:!1,start:function(){return this.renderOnStart&&this.render(),this},render:t.inherit(function(t){return function(){t.apply(this,arguments),this.view&&this.view.generated&&this.set(\"viewReady\",!0)}}),constructor:t.inherit(function(n){return function(e){e&&\"string\"==typeof e.name&&(t.setPath(e.name,this),this.id=e&&e.name),n.apply(this,arguments),this.controllers=this.$,t.applications[this.id||this.makeId()]=this}}),create:t.inherit(function(t){return function(){t.apply(this,arguments),this.autoStart&&this.start()}}),adjustComponentProps:t.inherit(function(t){return function(n){n.app=this,t.apply(this,arguments)}}),destroy:t.inherit(function(n){return function(){delete t.applications[this.id],n.apply(this,arguments)}}),owner:t.master})})(enyo,this);\n\n// ../source/kernel/jobs.js\n(function(t){t.singleton({name:\"enyo.jobs\",published:{priorityLevel:0},_jobs:[[],[],[],[],[],[],[],[],[],[]],_priorities:{},_namedJobs:{},_magicWords:{low:3,normal:5,high:7},add:function(n,e,i){e=e||5,e=t.isString(e)?this._magicWords[e]:e,i&&(this.remove(i),this._namedJobs[i]=e),e>=this.priorityLevel?n():this._jobs[e-1].push({fkt:n,name:i})},remove:function(t){var n=this._jobs[this._namedJobs[t]-1];if(n)for(var e=n.length-1;e>=0;e--)if(n[e].name===t)return n.splice(e,1)},registerPriority:function(t,n){this._priorities[n]=t,this.setPriorityLevel(Math.max(t,this.priorityLevel))},unregisterPriority:function(t){var n=0;delete this._priorities[t];for(var e in this._priorities)n=Math.max(n,this._priorities[e]);this.setPriorityLevel(n)},priorityLevelChanged:function(t){t>this.priorityLevel&&this._doJob()},_doJob:function(){for(var n,e=9;e>=this.priorityLevel;e--)if(this._jobs[e].length){n=this._jobs[e].shift();break}n&&(n.fkt(),delete this._namedJobs[n.name],setTimeout(t.bind(this,\"_doJob\"),10))}})})(enyo,this);\n\n// ../source/ext/macroize.js\n(function(t){t.macroize=function(n,e,i){var r,o,s=n,a=i||t.macroize.pattern,u=function(n,i){return r=t.getPath.call(e,i),void 0===r||null===r?\"{$\"+i+\"}\":(o=!0,r)},c=0;do if(o=!1,s=s.replace(a,u),++c>=20)throw\"enyo.macroize: recursion too deep\";while(o);return s},t.quickReplace=function(n,e,i){i=i||t.macroize.pattern;var r=function(t){var n=e[t];return n||t};return n.replace(i,r)},t.quickMacroize=function(n,e,i){var r,o=n,s=i||t.macroize.pattern,a=function(n,i){return r=i in e?e[i]:t.getPath.call(e,i),void 0===r||null===r?\"{$\"+i+\"}\":r};return o=o.replace(s,a)},t.macroize.pattern=/\\{\\$([^{}]*)\\}/g})(enyo,this);\n\n// ../source/ext/hooks.js\n(function(t,n){n.$L=function(t){return t},t.updateLocale=function(){t.Signals.send(\"onlocalechange\")},document.addEventListener&&document.addEventListener(\"localechange\",function(){t.updateLocale()},!1)})(enyo,this);\n\n// ../source/ext/InputBinding.js\n(function(t){var n=t.Binding;t.kind({name:\"enyo.InputBinding\",kind:n,placeholderDirection:\"source\",oneWay:!1,transform:function(t,n,e){if(t)return t;var i=\"_\"+e.placeholderDirection,r=e[i]&&e[i].placeholder||\"\";return r}})})(enyo,this);\n\n// ../source/ext/BooleanBinding.js\n(function(t){var n=t.Binding;t.kind({name:\"enyo.BooleanBinding\",kind:n,transform:function(t){return!!t}}),t.kind({name:\"enyo.EmptyBinding\",kind:n,transform:function(t){return\"\"!==t&&null!=t}})})(enyo,this);\n\n// ../source/ext/BooleanOnlyBinding.js\n(function(t){var n=t.Binding;t.kind({name:\"enyo.BooleanOnlyBinding\",kind:n,transform:function(t,n,e){return\"boolean\"==typeof t?t:e.stop()}})})(enyo,this);\n\n// ../source/ext/StringBinding.js\n(function(t){var n=t.Binding;t.kind({name:\"enyo.StringBinding\",kind:n,transform:function(t){return\"string\"==typeof t?t:\"\"}})})(enyo,this);\n\n// ../source/ext/InvertBooleanBinding.js\n(function(t){var n=t.Binding;t.kind({name:\"enyo.InvertBooleanBinding\",kind:n,transform:function(t){return!t}})})(enyo,this);\n\n// ../source/ajax/Async.js\n(function(t){t.kind({name:\"enyo.Async\",kind:\"enyo.Object\",published:{timeout:0},failed:!1,context:null,constructor:t.inherit(function(t){return function(){t.apply(this,arguments),this.responders=[],this.errorHandlers=[],this.progressHandlers=[]}}),destroy:t.inherit(function(t){return function(){this.timeoutJob&&this.clearTimeout(),t.apply(this,arguments)}}),accumulate:function(n,e,i){var r;i&&\"function\"==typeof i&&(r=e,e=i,i=r),i&&(e=\"string\"==typeof i?t.bind(e,i):e.bind(i)),n.push(e)},response:function(t,n){return this.accumulate(this.responders,t,n),this},error:function(t,n){return this.accumulate(this.errorHandlers,t,n),this},progress:function(t,n){return this.accumulate(this.progressHandlers,t,n),this},route:function(t,n){var e=this.bindSafely(\"respond\");t.response(function(t,n){e(n)});var i=this.bindSafely(\"fail\");t.error(function(t,n){i(n)}),t.go(n)},handle:function(n,e){var i=e.shift();if(i)if(i instanceof t.Async)this.route(i,n);else{var r=t.call(this.context||this,i,[this,n]);r=void 0!==r?r:n,(this.failed?this.fail:this.respond).call(this,r)}},startTimer:function(){this.startTime=t.perfNow(),this.timeout&&(this.timeoutJob=setTimeout(this.bindSafely(\"timeoutComplete\"),this.timeout))},endTimer:function(){this.timeoutJob&&(this.endTime=t.perfNow(),clearTimeout(this.timeoutJob),this.timeoutJob=null,this.latency=this.endTime-this.startTime)},timeoutComplete:function(){this.timedout=!0,this.fail(\"timeout\")},respond:function(t){this.failed=!1,this.endTimer(),this.handle(t,this.responders)},fail:function(t){return this.failed=!0,this.endTimer(),this.handle(t,this.errorHandlers),this},recover:function(){return this.failed=!1,this},sendProgress:function(n,e,i,r){var o=t.mixin({},r);o.type=\"progress\",o.current=n,o.min=e,o.max=i;for(var s=0;this.progressHandlers.length>s;s++)t.call(this.context||this,this.progressHandlers[s],[this,o])},go:function(n){return this.sendProgress(0,0,1),t.asyncMethod(this,function(){this.sendProgress(1,0,1),this.respond(n)}),this}})})(enyo,this);\n\n// ../source/ajax/json.js\n(function(t){t.json={stringify:function(t,n,e){return JSON.stringify(t,n,e)},parse:function(t,n){return t?JSON.parse(t,n):null}}})(enyo,this);\n\n// ../source/ajax/cookie.js\n(function(t){t.getCookie=function(t){var n=document.cookie.match(RegExp(\"(?:^|; )\"+t+\"=([^;]*)\"));return n?decodeURIComponent(n[1]):void 0},t.setCookie=function(t,n,e){var i=t+\"=\"+encodeURIComponent(n),r=e||{},o=r.expires;if(\"number\"==typeof o){var s=new Date;s.setTime(s.getTime()+1e3*60*60*24*o),o=s}o&&o.toUTCString&&(r.expires=o.toUTCString());var a,u;for(a in r)i+=\"; \"+a,u=r[a],u!==!0&&(i+=\"=\"+u);document.cookie=i}})(enyo,this);\n\n// ../source/ajax/xhr.js\n(function(t){t.xhr={request:function(n){var e=this.getXMLHttpRequest(n),i=this.simplifyFileURL(t.path.rewrite(n.url)),r=n.method||\"GET\",o=!n.sync;if(n.username?e.open(r,i,o,n.username,n.password):e.open(r,i,o),t.mixin(e,n.xhrFields),n.callback&&this.makeReadyStateHandler(e,n.callback),n.headers=n.headers||{},\"GET\"!==r&&t.platform.ios&&6==t.platform.ios&&null!==n.headers[\"cache-control\"]&&(n.headers[\"cache-control\"]=n.headers[\"cache-control\"]||\"no-cache\"),e.setRequestHeader)for(var s in n.headers)n.headers[s]&&e.setRequestHeader(s,n.headers[s]);return\"function\"==typeof e.overrideMimeType&&n.mimeType&&e.overrideMimeType(n.mimeType),e.send(n.body||null),!o&&n.callback&&e.onreadystatechange(e),e},cancel:function(t){t.onload&&(t.onload=null),t.onreadystatechange&&(t.onreadystatechange=null),t.abort&&t.abort()},makeReadyStateHandler:function(t,n){window.XDomainRequest&&t instanceof window.XDomainRequest?t.onload=function(){var e;\"arraybuffer\"===t.responseType?e=t.response:\"string\"==typeof t.responseText&&(e=t.responseText),n.apply(null,[e,t]),t=null}:t.onreadystatechange=function(){if(t&&4==t.readyState){var e;\"arraybuffer\"===t.responseType?e=t.response:\"string\"==typeof t.responseText&&(e=t.responseText),n.apply(null,[e,t]),t=null}}},inOrigin:function(t){var n=document.createElement(\"a\"),e=!1;return n.href=t,(\":\"===n.protocol||n.protocol===window.location.protocol&&n.hostname===window.location.hostname&&n.port===(window.location.port||(\"https:\"===window.location.protocol?\"443\":\"80\")))&&(e=!0),e},simplifyFileURL:function(n){var e=document.createElement(\"a\");if(e.href=n,\"file:\"===e.protocol||\":\"===e.protocol&&\"file:\"===window.location.protocol){var i=4>t.platform.webos?\"\":e.host;return e.protocol+\"//\"+i+e.pathname}return\":\"===e.protocol&&\"x-wmapp0:\"===window.location.protocol?window.location.protocol+\"//\"+window.location.pathname.split(\"/\")[0]+\"/\"+e.host+e.pathname:n},getXMLHttpRequest:function(n){try{if(10>t.platform.ie&&window.XDomainRequest&&!n.headers&&!this.inOrigin(n.url)&&!/^file:\\/\\//.test(window.location.href))return new window.XDomainRequest}catch(e){}try{if(t.platform.firefoxOS){var i=!1,r={};if(n.mozSystem&&(r.mozSystem=!0,i=!0),n.mozAnon&&(r.mozAnon=!0,i=!0),i)return new XMLHttpRequest(r)}return new XMLHttpRequest}catch(e){}return null}}})(enyo,this);\n\n// ../source/ajax/formdata.js\n(function(t,n){function e(){this.fake=!0,this._fields=[],this.boundary=\"--------------------------\";for(var t=0;24>t;t++)this.boundary+=Math.floor(10*Math.random()).toString(16)}function i(n,e){if(this.name=e.name,this.type=e.type||\"application/octet-stream\",!t.isArray(n))throw Error(\"enyo.Blob only handles Arrays of Strings\");if(n.length>0&&\"string\"!=typeof n[0])throw Error(\"enyo.Blob only handles Arrays of Strings\");this._bufs=n}if(n.FormData)try{new n.FormData,new n.Blob,t.FormData=n.FormData,t.Blob=n.Blob}catch(r){}t.FormData&&t.Blob||(e.prototype.getContentType=function(){return\"multipart/form-data; boundary=\"+this.boundary},e.prototype.append=function(t,n,e){this._fields.push([t,n,e])},e.prototype.toString=function(){var n=this.boundary,e=\"\";return t.forEach(this._fields,function(t){if(e+=\"--\"+n+\"\\r\\n\",t[2]||t[1].name){var i=t[1],r=t[2]||i.name;e+='Content-Disposition: form-data; name=\"'+t[0]+'\"; filename=\"'+r+'\"\\r\\n',e+=\"Content-Type: \"+i.type+\"\\r\\n\\r\\n\",e+=i.getAsBinary()+\"\\r\\n\"}else e+='Content-Disposition: form-data; name=\"'+t[0]+'\";\\r\\n\\r\\n',e+=t[1]+\"\\r\\n\"}),e+=\"--\"+n+\"--\"},t.FormData=e,i.prototype.getAsBinary=function(){var t=\"\",n=t.concat.apply(t,this._bufs);return n},t.Blob=i)})(enyo,this);\n\n// ../source/ajax/AjaxProperties.js\n(function(t){t.AjaxProperties={cacheBust:!0,url:\"\",method:\"GET\",handleAs:\"json\",contentType:\"application/x-www-form-urlencoded\",sync:!1,headers:null,postBody:\"\",username:\"\",password:\"\",xhrFields:null,mimeType:null}})(enyo,this);\n\n// ../source/ajax/Ajax.js\n(function(t){t.kind({name:\"enyo.Ajax\",kind:\"enyo.Async\",published:t.AjaxProperties,constructor:t.inherit(function(n){return function(e){t.mixin(this,e),n.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){this.xhr=null,t.apply(this,arguments)}}),xhrResponse:null,go:function(t){return this.failed=!1,this.startTimer(),this.request(t),this},request:function(n){var e=this.url.split(\"?\"),i=e.shift()||\"\",r=e.length?e.join(\"?\").split(\"&\"):[],o=null;t.isString(n)?o=n:n&&(o=t.Ajax.objectToQuery(n)),o&&(r.push(o),o=null),this.cacheBust&&r.push(Math.random());var s,a=r.length?[i,r.join(\"&\")].join(\"?\"):i,u={};\"GET\"!=this.method&&(s=this.postBody,\"POST\"===this.method&&s instanceof t.FormData?s.fake&&(u[\"Content-Type\"]=s.getContentType(),s=\"\"+s):(u[\"Content-Type\"]=this.contentType,s instanceof Object&&(s=null!==this.contentType.match(/^application\\/json(;.*)?$/)?JSON.stringify(s):\"application/x-www-form-urlencoded\"===this.contentType?t.Ajax.objectToQuery(s):\"\"+s))),t.mixin(u,this.headers),0===t.keys(u).length&&(u=void 0);try{this.xhr=t.xhr.request({url:a,method:this.method,callback:this.bindSafely(\"receive\"),body:s,headers:u,sync:this.sync,username:this.username,password:this.password,xhrFields:t.mixin({onprogress:this.bindSafely(this.updateProgress)},this.xhrFields),mimeType:this.mimeType})}catch(c){this.fail(c)}},receive:function(n,e){if(!this.failed&&!this.destroyed){var i;i=\"arraybuffer\"===e.responseType?e.response:\"string\"==typeof e.responseText?e.responseText:e.responseBody,this.xhrResponse={status:e.status,headers:t.Ajax.parseResponseHeaders(e),body:i},this.isFailure(e)?this.fail(e.status):this.respond(this.xhrToResponse(e))}},fail:t.inherit(function(n){return function(){this.xhr&&(t.xhr.cancel(this.xhr),this.xhr=null),n.apply(this,arguments)}}),xhrToResponse:function(t){return t?this[(this.handleAs||\"text\")+\"Handler\"](t):void 0},isFailure:function(t){try{if(\"arraybuffer\"===t.responseType){if(0===t.status&&!t.response)return!0}else{var n=\"\";if(\"string\"==typeof t.responseText&&(n=t.responseText),0===t.status&&\"\"===n)return!0}return 0!==t.status&&(200>t.status||t.status>=300)}catch(e){return!0}},xmlHandler:function(t){return t.responseXML},textHandler:function(t){return t.responseText},jsonHandler:function(n){var e=n.responseText;try{return e&&t.json.parse(e)}catch(i){return t.warn(\"Ajax request set to handleAs JSON but data was not in JSON format\"),e}},binaryHandler:function(t){return t.response},updateProgress:function(t){if(t){var n={};for(var e in t)\"input\"!==e&&(n[e]=t[e]);this.sendProgress(t.loaded,0,t.total,n)}},statics:{objectToQuery:function(n){var e=encodeURIComponent,i=[],r={};for(var o in n){var s=n[o];if(s!=r[o]){var a=e(o)+\"=\";if(t.isArray(s))for(var u=0;s.length>u;u++)i.push(a+e(s[u]));else i.push(a+e(s))}}return i.join(\"&\")}},protectedStatics:{parseResponseHeaders:function(t){var n={},e=[];t.getAllResponseHeaders&&(e=t.getAllResponseHeaders().split(/\\r?\\n/));for(var i=0;e.length>i;i++){var r=e[i],o=r.indexOf(\": \");if(o>0){var s=r.substring(0,o).toLowerCase(),a=r.substring(o+2);n[s]=a}}return n}}})})(enyo,this);\n\n// ../source/ajax/Jsonp.js\n(function(t){t.kind({name:\"enyo.JsonpRequest\",kind:\"enyo.Async\",published:{url:\"\",charset:null,callbackName:\"callback\",cacheBust:!0,overrideCallback:null},protectedStatics:{nextCallbackID:0},addScriptElement:function(){var t=document.createElement(\"script\");t.src=this.src,t.async=\"async\",this.charset&&(t.charset=this.charset),t.onerror=this.bindSafely(function(){this.fail(400)});var n=document.getElementsByTagName(\"script\")[0];n.parentNode.insertBefore(t,n),this.scriptTag=t},removeScriptElement:function(){var t=this.scriptTag;this.scriptTag=null,t.onerror=null,t.parentNode&&t.parentNode.removeChild(t)},constructor:t.inherit(function(n){return function(e){t.mixin(this,e),n.apply(this,arguments)}}),go:function(t){return this.startTimer(),this.jsonp(t),this},jsonp:function(n){var e=this.overrideCallback||\"enyo_jsonp_callback_\"+t.JsonpRequest.nextCallbackID++;this.src=this.buildUrl(n,e),this.addScriptElement(),window[e]=this.bindSafely(this.respond);var i=this.bindSafely(function(){this.removeScriptElement(),window[e]=null});this.response(i),this.error(i)},buildUrl:function(t,n){var e=this.url.split(\"?\"),i=e.shift()||\"\",r=e.length?e.join(\"?\").split(\"&\"):[],o=this.bodyArgsFromParams(t,n);return r.push(o),this.cacheBust&&r.push(Math.random()),[i,r.join(\"&\")].join(\"?\")},bodyArgsFromParams:function(n,e){return t.isString(n)?n.replace(\"=?\",\"=\"+e):(n=n?t.clone(n,!0):{},this.callbackName&&(n[this.callbackName]=e),t.Ajax.objectToQuery(n))}})})(enyo,this);\n\n// ../source/ajax/WebService.js\n(function(t){t.kind({name:\"enyo._AjaxComponent\",kind:\"enyo.Component\",published:t.AjaxProperties}),t.kind({name:\"enyo.WebService\",kind:\"enyo._AjaxComponent\",published:{jsonp:!1,callbackName:\"callback\",charset:null,timeout:0},events:{onResponse:\"\",onError:\"\",onProgress:\"\"},send:function(t,n){return this.jsonp?this.sendJsonp(t,n):this.sendAjax(t,n)},sendJsonp:function(n,e){var i=new t.JsonpRequest;for(var r in{url:1,callbackName:1,charset:1,timeout:1})i[r]=this[r];return t.mixin(i,e),this.sendAsync(i,n)},sendAjax:function(n,e){var i=new t.Ajax(e);for(var r in t.AjaxProperties)i[r]=this[r];return i.timeout=this.timeout,t.mixin(i,e),this.sendAsync(i,n)},sendAsync:function(t,n){return t.go(n).response(this,\"response\").error(this,\"error\").progress(this,\"progress\")},response:function(t,n){this.doResponse({ajax:t,data:n})},error:function(t,n){this.doError({ajax:t,data:n})},progress:function(t,n){this.doProgress(n)}})})(enyo,this);\n\n// ../source/data/States.js\n(function(t){t.States={NEW:1,DIRTY:2,CLEAN:4,DESTROYED:8,FETCHING:16,COMMITTING:32,DESTROYING:64,ERROR_COMMITTING:128,ERROR_FETCHING:256,ERROR_DESTROYING:512,ERROR_UNKNOWN:1024,BUSY:112,ERROR:1920,READY:-2041},t.StateSupport={name:\"StateSupport\",status:null,clearError:function(){this.status=this.status&~t.States.ERROR},isError:function(n){return!!((isNaN(n)?this.status:n)&t.States.ERROR)},isBusy:function(n){return!!((isNaN(n)?this.status:n)&t.States.BUSY)},isReady:function(n){return!!((isNaN(n)?this.status:n)&t.States.READY)}}})(enyo,this);\n\n// ../source/data/Source.js\n(function(t){var n=t.kind,e=t.sources={},i=n({name:\"enyo.Source\",kind:null,noDefer:!0,constructor:function(t){t&&this.importProps(t),this.name||(this.name=this.kindName.replace(/^(.*)\\./,\"\")),e[this.name]=this},fetch:function(){},commit:function(){},destroy:function(){arguments.length||(t.sources[this.name]=null,this.name=null)},find:function(){},importProps:function(n){n&&t.mixin(this,n)},get:t.getPath,set:t.setPath});i.create=function(n){var e=n&&n.kind||this;return\"string\"==typeof e&&(e=t.constructorForKind(e)),new e(n)},i.concat=function(t,n){n&&(n.noDefer=!0),t.create=i.create},i.execute=function(n,e,r){var o,s=r.source||e.source,a=t.clone(r,!0),u=s;if(s)if(s===!0)for(u in t.sources)s=t.sources[u],s[n]&&(a.success=r.success.bind(null,u),a.error=r.error.bind(null,u),s[n](e,a));else s instanceof Array?s.forEach(function(i){var o=\"string\"==typeof i?t.sources[i]:i;o&&o[n]&&(a.success=r.success.bind(null,o.name),a.error=r.error.bind(null,o.name),o[n](e,a))}):s instanceof i&&s[n]?(a.success=r.success.bind(null,s.name),a.error=r.error.bind(null,s.name),s[n](e,a)):(s=t.sources[u])&&s[n]?(a.success=r.success.bind(null,u),a.error=r.error.bind(null,u),s[n](e,a)):(o=\"enyo.Source.execute(): requested source(s) could not be found for \"+e.kindName+\".\"+n+\"()\",t.warn(o),r.error(u?\"string\"==typeof u?u:u.name:\"UNKNOWN\",o));else o=\"enyo.Source.execute(): no source(s) provided for \"+e.kindName+\".\"+n+\"()\",t.warn(o),r.error(u?\"string\"==typeof u?u:u.name:\"UNKNOWN\",o)}})(enyo);\n\n// ../source/data/ModelList.js\n(function(t){function n(t){Array.call(this),this.table={},t&&this.add(t,0)}n.prototype=Object.create(Array.prototype),t.ModelList=n,t.ModelList.prototype.add=function(t,n){var e,i,r,o=this.table,s=[],a=0;for(!t||t instanceof Array||(t=[t]);e=t[a];++a)i=e.euid,o[i]||(r=e.get(e.primaryKey),null!=r&&(o[r]&&o[r]!==e?e.headless=!0:o[r]=e),o[i]=e,s.push(e));return s.length&&(n=isNaN(n)?0:Math.min(Math.max(0,n),this.length),s.unshift(0),s.unshift(n),this.splice.apply(this,s)),s.length>0&&(s=s.slice(2)),s.at=n,s},t.ModelList.prototype.remove=function(t){var n,e,i,r,o=this.table,s=[],a=1/0,u=-1,c=[];for(!t||t instanceof Array||(t=[t]),r=t.length-1;n=t[r];--r)o[n.euid]=null,i=n.get(n.primaryKey),null!=i&&(o[i]=null),e=t===this?r:this.indexOf(n),e>-1&&(a>e&&(a=e),e>u&&(u=e),this.splice(e,1),s.push(n),c.push(e));return s.low=a,s.high=u,s.indices=c,s},t.ModelList.prototype.has=function(t){return void 0===t||null===t?!1:\"string\"==typeof t||\"number\"==typeof t?!!this.table[t]:this.indexOf(t)>-1},t.ModelList.prototype.resolve=function(t){return\"string\"==typeof t||\"number\"==typeof t?this.table[t]:t},t.ModelList.prototype.copy=function(){return new n(this)}})(enyo);\n\n// ../source/data/Store.js\n(function(t){var n=t.kind,e=t.ModelList,i=t.EventEmitter,r=t.Object,o=t.kind({kind:r,mixins:[i]}),s=n({kind:o,find:function(n,e,i){var r=n.prototype.kindName,o=this.models[r],s={all:!0,context:this};return 1==arguments.length||\"function\"!=typeof e?o?o.slice():[]:(i=i?t.mixin({},[s,i]):s,o?i.all?o.filter(e,i.context):o.find(e,i.context):i.all?[]:void 0)},findLocal:function(){return this.find.apply(this,arguments)},add:function(t,n){var e,i,r=t&&(t instanceof Array?t[0].ctor:t.ctor),o=r&&r.prototype.kindName,s=o&&this.models[o];if(s&&(e=s.add(t),e.length&&(!n||!n.silent)))for(i=0;e.length>i;++i)this.emit(r,\"add\",{model:e[i]});return this},remove:function(t,n){var e,i,r=t&&(t instanceof Array?t[0].ctor:t.ctor),o=r&&r.prototype.kindName,s=o&&this.models[o];if(s&&(e=s.remove(t),e.length&&(!n||!n.silent)))for(i=0;e.length>i;++i)this.emit(r,\"remove\",{model:e[i]});return this},has:function(t,n){var e;return n||(n=t,t=n.ctor),e=this.models[t.prototype.kindName],e?e.has(n):!1},resolve:function(t,n){var e=this.models[t&&t.prototype.kindName];return e?e.resolve(n):void 0},constructor:t.inherit(function(t){return function(){t.apply(this,arguments),this._scopeListeners=[],this.models={\"enyo.Model\":new e}}}),scopeListeners:function(t,n){return t?this._scopeListeners.filter(function(e){return e.scope===t?n?e.event==n:!0:!1}):this._scopeListeners},on:t.inherit(function(t){return function(n,e,i,r){return\"function\"==typeof n?(this.scopeListeners().push({scope:n,event:e,method:i,ctx:r||this}),this):t.apply(this,arguments)}}),off:t.inherit(function(){return function(t,n,e){var i,r;return\"function\"==typeof t?(i=this.scopeListeners(t),i.length&&(r=i.findIndex(function(t){return t.event==n&&t.method===e}),r>=0&&i.splice(r,1)),this):void 0}}),emit:t.inherit(function(n){return function(e,i){var r,o;return\"function\"==typeof e?(r=this.scopeListeners(e,i),r.length?(o=t.toArray(arguments).slice(1),o.unshift(this),r.forEach(function(t){t.method.apply(t.ctx,o)}),!0):!1):n.apply(this,arguments)}})});t.store=new s})(enyo,this);\n\n// ../source/data/Model.js\n(function(t){var e=t.kind,n=t.ObserverSupport,i=t.ComputedSupport,r=t.BindingSupport,o=t.EventEmitter,s=t.StateSupport,a=t.ModelList,u=t.Source,c=t.States,h=e({kind:null,mixins:[n,i,r,o,s]}),l=e({name:\"enyo.Model\",kind:h,noDefer:!0,url:\"\",getUrl:null,attributes:null,source:null,includeKeys:null,options:{silent:!1,commit:!1,parse:!1,fetch:!1},status:c.NEW|c.CLEAN,primaryKey:\"id\",parse:function(t){return t},raw:function(){var e=this.includeKeys,n=this.attributes,i=e||Object.keys(n),r=e?t.only(e,n):t.clone(n);return i.forEach(function(t){var e=this.get(t);r[t]=\"function\"==typeof e?e.call(this):e&&e.raw?e.raw():e},this),r},toJSON:function(){return this.raw()},restore:function(t){return t?this.set(t,this.previous[t],{force:!0}):this.set(this.previous),this},commit:function(e){var n,i,r=this;return this.status&(c.ERROR|c.BUSY)?this.errored(this.status,e):(n=e?t.clone(e,!0):{},i=n.source||this.source,i&&(i instanceof Array||i===!0)&&(this._waiting=i.length?i.slice():Object.keys(t.sources)),n.success=function(t,n){r.committed(e,n,t)},n.error=function(t,n){r.errored(\"COMMITTING\",e,n,t)},this.status=this.status|c.COMMITTING,u.execute(\"commit\",this,n)),this},fetch:function(e){var n,i,r=this;return this.status&(c.ERROR|c.BUSY)?this.errored(this.status,e):(n=e?t.clone(e,!0):{},i=n.source||this.source,i&&(i instanceof Array||i===!0)&&(this._waiting=i.length?i.slice():Object.keys(t.sources)),n.success=function(t,n){r.fetched(e,n,t)},n.error=function(t,n){r.errored(\"FETCHING\",e,n,t)},this.status=this.status|c.FETCHING,u.execute(\"fetch\",this,n)),this},destroy:function(e){var n,i=e?t.mixin({},[this.options,e]):this.options,r=this;return i.commit||i.source?(this.status&(c.ERROR|c.BUSY)?this.status&c.ERROR&&this.errored(this.status,e):(i=e?t.clone(e,!0):{},i.success=function(t,o){r._waiting&&(n=r._waiting.findIndex(function(e){return(e instanceof u?e.name:e)==t}),n>-1&&r._waiting.splice(n,1),r._waiting.length||(r._waiting=null)),r._waiting||(i.commit=i.source=null,r.destroy(i)),e&&e.success&&e.success(this,e,o,t)},i.error=function(t,o){r._waiting&&(n=r._waiting.findIndex(function(e){return(e instanceof u?e.name:e)==t}),n>-1&&r._waiting.splice(n,1),r._waiting.length||(r._waiting=null)),r._waiting?this.errored(\"DESTROYING\",e,o,t):(i.commit=i.source=null,r.destroy(i))},this.status=this.status|c.DESTROYING,u.execute(\"destroy\",this,i)),this):(this.destroyed=!0,this.status=c.DESTROYED,this.unsilence(!0).emit(\"destroy\"),this.removeAllListeners(),this.removeAllObservers(),e&&e.batching||this.store.remove(this),void 0)},get:function(t){return this.isComputed(t)?this._getComputed(t):this.attributes[t]},set:function(e,n,i){if(!this.destroyed){var r,o,s,a,u,h,l,d,f=this.attributes,p=this.options;\"object\"==typeof e?(o=e,i=i||n):(o={},o[e]=n),i===!0&&(s=!0,i={}),i=i?t.mixin({},[p,i]):p,a=i.silent,s=s||i.force,l=i.commit,d=i.fetched;for(u in o)h=o[u],(h!==f[u]||s)&&(r=this.changed||(this.changed={}),this.previous[u]=f[u],r[u]=f[u]=h);r&&(d||(this.status=(this.status|c.DIRTY)&~c.CLEAN),a||this.emit(\"change\",r,this),l&&!d&&this.commit(i),this.changed=null)}return this},_getComputed:i.get.fn(function(){return void 0}),constructor:function(e,n,i){n&&n.options&&(this.options=t.mixin({},[this.options,n.options]),delete n.options),i=i?t.mixin({},[this.options,i]):this.options,n&&t.mixin(this,n);var r,o=i.noAdd,s=i.commit,a=i.parse,u=this.options.fetch;r=this.defaults&&\"function\"==typeof this.defaults?this.defaults(e,i):null,this.euid=this.euid||t.uid(\"m\"),e=e?a?this.parse(e):e:null,this.attributes=this.attributes?r?t.mixin({},[r,this.attributes]):t.clone(this.attributes,!0):r?t.clone(r,!0):{},e&&t.mixin(this.attributes,e),this.previous=t.clone(this.attributes),this.store=this.store||t.store,o||this.store.add(this,i),s&&this.commit(),u&&this.fetch()},emit:t.inherit(function(t){return function(e,n){if(\"change\"==e&&n&&this.isObserving())for(var i in n)this.notify(i,this.previous[i],n[i]);return t.apply(this,arguments)}}),triggerEvent:function(){return this.emit.apply(this,arguments)},fetched:function(e,n,i){var r,o=this.options;this._waiting&&(r=this._waiting.findIndex(function(t){return(t instanceof u?t.name:t)==i}),r>-1&&this._waiting.splice(r,1),this._waiting.length||(this._waiting=null)),e=e?t.mixin({},[o,e]):o,e.fetched=!0,e.parse&&(n=this.parse(n)),n&&this.set(n,e),this._waiting||(this.status=this.status&~(c.FETCHING|c.NEW)),e.success&&e.success(this,e,n,i)},committed:function(e,n,i){var r;this._waiting&&(r=this._waiting.findIndex(function(t){return(t instanceof u?t.name:t)==i}),r>-1&&this._waiting.splice(r,1),this._waiting.length||(this._waiting=null)),this._waiting||(this.previous=t.clone(this.attributes),this.status=(this.status|c.CLEAN)&~(c.COMMITTING|c.DIRTY)),e&&e.success&&e.success(this,e,n,i)},errored:function(t,e,n,i){var r,o;r=\"string\"==typeof t?c[\"ERROR_\"+t]:t,(isNaN(r)||r&~c.ERROR)&&(r=c.ERROR_UNKNOWN),this.status=(this.status|r)&~c.BUSY,this._waiting&&(o=this._waiting.findIndex(function(t){return(t instanceof u?t.name:t)==i}),o>-1&&this._waiting.splice(o,1),this._waiting.length||(this._waiting=null)),e&&e.error&&e.error(this,t,e,n,i)}});l.concat=function(e,n){var i=e.prototype||e;n.options&&(i.options=t.mixin({},[i.options,n.options]),delete n.options)},t.kind.features.push(function(e){e.prototype instanceof l&&!t.store.models[e.prototype.kindName]&&(t.store.models[e.prototype.kindName]=new a)})})(enyo);\n\n// ../source/data/Collection.js\n(function(t){var e=t.kind,n=t.Component,i=t.EventEmitter,r=t.Model,s=t.ModelList,o=t.StateSupport,a=t.Source,u=t.States,h=t.kind({kind:n,mixins:[i,o]}),c=e({name:\"enyo.Collection\",kind:h,noDefer:!0,url:\"\",getUrl:null,model:r,models:null,status:u.READY,options:{merge:!0,silent:!1,purge:!1,parse:!1,create:!0,find:!0,sort:!1,commit:!1,destroy:!1,complete:!1,fetch:!1,modelEvents:!0},parse:function(t){return t},add:function(e,n){var i,s,o,a,u,h,c,l=this.models,d=this.length,f=this.model,p=this.options,m=f.prototype.primaryKey,g=d,y=0;!isNaN(n)&&(g=n),arguments.length>2&&(n=arguments[2]),n=n?t.mixin({},[p,n]):p;var v=n.merge,b=n.purge,_=n.silent,w=n.parse,C=n.find,x=n.sort,k=n.commit,O=n.create!==!1,E=n.modelOptions,S=n.index;g=isNaN(S)?g:Math.max(0,Math.min(d,S)),x&&!(\"function\"==typeof x)&&(x=this.comparator),w&&(e=this.parse(e)),!(e instanceof Array)&&(e=[e]);for(var T=0,R=e.length;R>T;++T)a=e[T],u=null,(a||!isNaN(a))&&(a instanceof r||(u=a),\"string\"==typeof u||\"number\"==typeof u?(c=u,u={},u[m]=c):c=u?u[m]:a,C&&(h=l.has(c)),h?(h=l.resolve(c),v&&(u||(u=a.attributes),h.set(u,n)),b&&(s||(s={length:0}),s[h.euid]=a,s.length++)):u&&C&&(h=this.store.resolve(f,c))?(u||(u=a.attributes),w&&(u=h.parse(u)),i||(i=[]),i.push(h),this.prepareModel(h,n),v&&h.set(u,n)):u?O&&(a=this.prepareModel(u||a,E),i||(i=[]),i.push(a),b&&(s||(s={length:0}),s[a.euid]=a,s.length++)):(i||(i=[]),i.push(a),this.prepareModel(a)));if(b&&s&&s.length){for(o||(o=[]),s||(s={}),T=0;d>T;++T)s[(a=l[T]).euid]||(o.push(a),g>T&&y++);o.length&&this.remove(o,n),g-=y}return i&&(l.add(i,g),x&&this.sort(x,{silent:!0}),this.store.add(i)),this.length=l.length,_||(d!=this.length&&this.notify(\"length\",d,this.length),i&&this.emit(\"add\",{models:i,collection:this,index:g})),k&&i&&this.commit(n),i||[]},remove:function(e,n){var i,r,s=this.models,o=s.length,a=this.options;n=n?t.mixin({},[a,n]):a;var u=n.silent,h=n.destroy,c=n.complete,l=n.commit;if(!(e instanceof Array)&&(e=[e]),i=s.remove(e),i.length){n.batching=!0;for(var d=0,f=i.length;f>d;++d)r=i[d],a.modelEvents&&r.off(\"*\",this._modelEvent,this),h&&r.destroy(n);(c||h)&&this.store.remove(i)}return this.length=s.length,u||(o!=this.length&&this.notify(\"length\",o,this.length),i.length&&this.emit(\"remove\",{models:i,collection:this})),l&&i.length&&this.commit(),i},at:function(t){return this.models[t]},raw:function(){return this.models.map(function(t){return t.raw()})},has:function(t){return this.models.has(t)},forEach:function(t,e){return this.models.slice().forEach(t,e||this)},filter:function(t,e){return this.models.slice().filter(t,e||this)},find:function(t,e){return this.models.slice().find(t,e||this)},map:function(t,e){return this.models.slice().map(t,e||this)},indexOf:function(t,e){return this.models.indexOf(t,e)},empty:function(t,e){var n,i,s=this.length;return!t||t instanceof Array||t instanceof r||(e=t,t=null),e=e||{},n=e.silent,e.silent=!0,i=this.remove(this.models,e),t&&this.add(t,e),n||(s!=this.length&&this.notify(\"length\",s,this.length),this.emit(\"reset\",{models:this.models.copy(),collection:this})),i},toJSON:function(){return this.raw()},sort:function(e,n){if(e||this.comparator){var i,r={silent:!1};n=n?t.mixin({},[r,n]):r,i=n.silent,this.models.sort(e||this.comparator),!i&&this.emit(\"sort\",{comparator:e||this.comparator,models:this.models.copy(),collection:this})}return this},commit:function(e){var n,i,r=this;return this.status&(u.ERROR|u.BUSY)?this.status&u.ERROR&&this.errored(this.status,e):(n=e?t.clone(e,!0):{},i=n.source||this.source,i&&(i instanceof Array||i===!0)&&(this._waiting=i.length?i.slice():Object.keys(t.sources)),n.success=function(t,n){r.committed(e,n,t)},n.error=function(t,n){r.errored(\"COMMITTING\",e,n,t)},this.set(\"status\",(this.status|u.COMMITTING)&~u.READY),a.execute(\"commit\",this,n)),this},fetch:function(e){var n,i,r=this;return this.status&(u.ERROR|u.BUSY)?this.status&u.ERROR&&this.errored(this.status,e):(n=e?t.clone(e,!0):{},i=n.source||this.source,i&&(i instanceof Array||i===!0)&&(this._waiting=i.length?i.slice():Object.keys(t.sources)),n.success=function(t,n){r.fetched(e,n,t)},n.error=function(t,n){r.errored(\"FETCHING\",e,n,t)},this.set(\"status\",(this.status|u.FETCHING)&~u.READY),a.execute(\"fetch\",this,n)),this},destroy:t.inherit(function(e){return function(n){var i,r=n?t.mixin({},[this.options,n]):this.options,s=this;return r.commit||r.source?(this.status&(u.ERROR|u.BUSY)?this.status&u.ERROR&&this.errored(this.status,n):(r=n?t.clone(n,!0):{},r.success=function(t,e){s._waiting&&(i=s._waiting.findIndex(function(e){return(e instanceof a?e.name:e)==t}),i>-1&&s._waiting.splice(i,1),s._waiting.length||(s._waiting=null)),s._waiting||(r.commit=r.source=null,s.destroy(r)),n&&n.success&&n.success(this,n,e,t)},r.error=function(t,e){s._waiting&&(i=s._waiting.findIndex(function(e){return(e instanceof a?e.name:e)==t}),i>-1&&s._waiting.splice(i,1),s._waiting.length||(s._waiting=null)),s._waiting?this.errored(\"DESTROYING\",n,e,t):(r.commit=r.source=null,s.destroy(r))},this.set(\"status\",(this.status|u.DESTROYING)&~u.READY),a.execute(\"destroy\",this,r)),this):(this.length&&r.destroy&&this.empty(r),this.set(\"status\",u.DESTROYED),e.apply(this,arguments),void 0)}}),comparator:null,prepareModel:function(t,e){var n,i=this.model,r=this.options;return t instanceof i&&(n=t),n||(e=e||{},e.noAdd=!0,n=new i(t,null,e)),r.modelEvents&&n.on(\"*\",this._modelEvent,this),n},committed:function(t,e,n){var i;this._waiting&&(i=this._waiting.findIndex(function(t){return(t instanceof a?t.name:t)==n}),i>-1&&this._waiting.splice(i,1),this._waiting.length||(this._waiting=null)),t&&t.success&&t.success(this,t,e,n),this._waiting||this.set(\"status\",(this.status|u.READY)&~u.COMMITTING)},fetched:function(t,e,n){var i;this._waiting&&(i=this._waiting.findIndex(function(t){return(t instanceof a?t.name:t)==n}),i>-1&&this._waiting.splice(i,1),this._waiting.length||(this._waiting=null)),e&&(e=this.add(e,t)),t&&t.success&&t.success(this,t,e,n),this._waiting||this.set(\"status\",(this.status|u.READY)&~u.FETCHING)},errored:function(t,e,n,i){var r;r=\"string\"==typeof t?u[\"ERROR_\"+t]:t,!isNaN(r)&&r&u.ERROR||(r=u.ERROR_UNKNOWN),this.set(\"status\",(this.status|r)&~u.READY),e&&e.error&&e.error(this,t,e,n,i)},clearError:function(){return this.set(\"status\",u.READY)},_modelEvent:function(t,e){switch(e){case\"change\":this.emit(\"change\",{model:t});break;case\"destroy\":this.remove(t)}},modelsChanged:function(){var t=this.models.copy(),e=t.length;e!=this.length&&this.set(\"length\",e),this.emit(\"reset\",{models:t,collection:this})},constructor:t.inherit(function(e){return function(n,i,r){i=!n||n instanceof Array?i:n,i===n&&(n=null),!this.models&&this.set(\"models\",new s),i&&i.records&&(n=n?n.concat(i.records):i.records.slice(),delete i.records),i&&i.models&&(n=n?n.concat(i.models):i.models.slice(),delete i.models),i&&i.options&&(this.options=t.mixin({},[this.options,i.options]),delete i.options),r=r?t.mixin({},[this.options,r]):this.options,r.fetch&&(this.options.fetch=r.fetch),this.length=this.models.length,this.euid=t.uid(\"c\"),e.call(this,i),\"string\"==typeof this.model&&(this.model=t.constructorForKind(this.model)),this.store=this.store||t.store,n&&n.length&&this.add(n,r)}}),constructed:t.inherit(function(t){return function(){t.apply(this,arguments),this.options.fetch&&this.fetch()}})});c.concat=function(e,n){var i=e.prototype||e;n.options&&(i.options=t.mixin({},[i.options,n.options]),delete n.options)}})(enyo,this);\n\n// ../source/data/RelationalModel.js\n(function(t){var e=t.kind,n=t.Model,i=t.Collection,r=e({kind:i,model:\"enyo.RelationalModel\"}),s={type:\"toOne\",key:null,create:!1,parse:!1,model:\"enyo.RelationalModel\",fetch:!1,inverseKey:null,inverseType:null,isOwner:!1,includeInJSON:!0},o=e({kind:null,options:{},constructor:function(e,n){t.mixin(this,[s,this.options,n]),this.instance=e,this.model=t.constructorForKind(this.model),this.includeInJSON=null!=n.includeInJSON||this.isOwner?this.includeInJSON:this.model.prototype.primaryKey||\"id\",this.init()},getRelated:function(){return this.related},setRelated:function(e){var n,i,r=this.instance,s=this.model,o=this.related,a=this.key;return e&&t.store.off(s,\"add\",this._changed,this),this.related=e,r._changing||(n=r.changed||(r.changed={}),i=r.previous||(r.previous={}),n[a]=e,i[a]=o,o!==e&&r.emit(\"change\",n)),this},destroy:function(){var t=this.isOwner,e=this.create,n=this.related;(t||e)&&n&&n.destroy&&!n.destroyed&&n.destroy(),this.destroyed=!0,this.instance=null,this.related=null}});o.concat=function(e,n){var i=e.prototype;n.options&&(i.options=t.mixin({},[i.options,n.options]),delete n.options)},e({name:\"enyo.toMany\",kind:o,noDefer:!0,options:{create:!0,collection:r,collectionOptions:{}},init:function(){var e=this.collection,n=this.model,r=this.collectionOptions?t.clone(this.collectionOptions):{},s=this.instance,o=this.key,a=null!=this.related?this.related:s.attributes[o];\"string\"==typeof e&&(e=t.constructorForKind(e)),\"string\"==typeof n&&(n=t.constructorForKind(n)),n.prototype instanceof i&&(e=n,n=e.prototype.model),n?r.model=r.model||n:n=e.prototype.model,this.collection=e instanceof i?e.ctor:e,this.model=n,e instanceof i?t.mixin(e,r):e=new e(r),this.parse=this.parse||n.prototype.options.parse,this.create?null!=a&&(this.parse&&(a=e.parse(a)),e.add(a)):this.fetch&&this.fetchRelated(),s.attributes[o]=this,this.related=e,e.on(\"*\",this._changed,this),this.inverseKey&&t.store.on(n,\"add\",this._changed,this)},fetchRelated:function(){},setRelated:function(t){var e=this.related;e.add(t,{purge:!0})},findRelated:function(){var e,n=this.model,i=this.related,r=this.inverseKey;r&&(e=t.store.findLocal(n,this.checkRelation,{context:this}),e.length&&i.add(e,{merge:!1}))},checkRelation:function(e){var n=this.model,i=this.instance,r=this.key,s=this.inverseKey,o=s&&e.get(s),a=e.getRelation(s),h=i.get(i.primaryKey),c=this.isOwner;return null==o||o!==i&&o!=h?!1:(!a&&s&&(a=new t.toOne(e,{key:s,inverseKey:r,parse:!1,create:!1,isOwner:!c,model:n,related:i}),e.relations.push(a)),a.related!==i&&a.setRelated(i),!0)},raw:function(){var e,n=this.includeInJSON;return n===!0?e=this.related.raw():\"string\"==typeof n?e=this.related.map(function(t){return t.get(n)}):n instanceof Array?e=this.related.map(function(e){return t.only(n,e.raw())}):\"function\"==typeof n&&(e=n.call(this.instance,this.key,this)),e},_changed:function(e,n,i){var r,s=this.instance,o=this.key,a=this.related,h=this.isOwner;if(e===t.store)\"add\"==n&&this.checkRelation(i.model)&&this.related.add(i.model,{merge:!1});else if(e===a&&h){if(s._changing)return;s.isDirty=!0,r=s.changed||(s.changed={}),s.previous||(s.previous={}),r[o]=a,s.emit(\"change\",r,s)}},destroy:t.inherit(function(t){return function(){t.apply(this,arguments)}})}),t.toMany.concat=function(e,n){var i=e.prototype;n.collectionOptions&&(i.collectionOptions=t.mixin({},[i.collectionOptions,n.collectionOptions]),delete n.collectionOptions)},e({name:\"enyo.manyToMany\",kind:t.toMany,noDefer:!0,options:{inverseType:\"enyo.manyToMany\"},checkRelation:function(e){var n=this.model,i=this.instance,r=this.key,s=this.inverseKey,o=s&&e.get(s),a=e.getRelation(s),h=this.isOwner;return o&&o.has(i)?(a||e.relations.push(a=new t.manyToMany(e,{key:s,inverseKey:r,parse:!1,create:!1,isOwner:!h,model:n,related:i})),!0):!1},_changed:t.inherit(function(t){return function(e,n,i){var r,s,o=this.related,a=this.instance,h=this.inverseKey,c=this.isOwner;if(e===o){if(\"change\"==n);else if(\"add\"==n)for(s=0;r=i.models[s];++s)r.get(h).add(a,{merge:!1});else if(\"remove\"==n)for(s=0;r=i.models[s];++s)r.destroyed||r.get(h).remove(a);(\"add\"==n||\"remove\"==n)&&(this.isOwner=!0,t.apply(this,arguments),this.isOwner=c)}else t.apply(this,arguments)}})}),e({name:\"enyo.toOne\",kind:o,noDefer:!0,options:{inverseType:\"enyo.toOne\",modelOptions:null},init:function(){var e,i,r=this.model,s=this.inverseType,o=this.instance,a=this.key,h=null==this.related?o.attributes[a]:this.related,c=this.modelOptions;\"string\"==typeof r&&(r=t.constructorForKind(r)),\"string\"==typeof s&&(s=t.constructorForKind(s)),(h||0===h)&&(this.related=h),o.attributes[a]=this,this.inverseType=s,null!=h&&(h instanceof n||(\"object\"==typeof h?e=h[r.prototype.primaryKey]:(\"string\"==typeof h||\"number\"==typeof h)&&(e=h),null!=e&&(i=t.store.resolve(r,e)),i&&(h=this.related=i))),null!=h&&h instanceof n||this.create&&(null!=h&&\"object\"!=typeof h&&(e=h,h={},h[r.prototype.primaryKey]=e),this.parse&&(c||(c={}),c.parse=!0),i=r=new r(h,null,c),this.related=r),i||t.store.on(r,\"add\",this._changed,this),o.on(\"change\",this._changed,this)},setRelated:t.inherit(function(t){return function(e){var i;if(e&&e instanceof n)return t.apply(this,arguments);if(null!=e)if(i=e,e=this.getRelated(),this.create&&e)e.set(e.primaryKey,i);else if(this.related=e,e=this.findRelated(),e&&e instanceof n)return t.call(this,e)}}),fetchRelated:function(){},findRelated:function(){var e,n,i=this.related,r=this.isOwner;if(e=i&&i instanceof this.model?i:t.store.findLocal(this.model,this.checkRelation,{all:!1,context:this})){if(t.store.off(this.model,\"add\",this._changed,this),this.related=e,this.inverseKey)switch(n=e.getRelation(this.inverseKey),n||(n=new this.inverseType(e,{key:this.inverseKey,inverseKey:this.key,parse:!1,create:!1,model:this.instance.ctor,related:this.instance}),e.relations.push(n)),n.kindName){case\"enyo.toOne\":n.related!==this.instance&&n.setRelated(this.instance);break;case\"enyo.toMany\":n.related.add(this.instance,{merge:!1})}r&&e.on(\"change\",this._changed,this)}return e},checkRelation:function(t){var e=this.related,n=this.instance,i=n.get(n.primaryKey),r=this.inverseKey,s=t.get(t.primaryKey);return e&&(t.euid==e||s==e||s==e[n.primaryKey])||null!=i&&t.get(r)==i},raw:function(){var e=this.includeInJSON,n=\"\";return this.related&&(e===!0?n=this.related.raw():\"string\"==typeof e?n=this.related.get(e):e instanceof Array?n=t.only(e,this.related.raw()):\"function\"==typeof e&&(n=e.call(this.instance,this.key,this))),n},_changed:function(t,e,n){var i,r=this.key,s=this.instance,o=this.isOwner;if(t===this.instance)\"change\"==e&&r in n&&this.findRelated();else if(t===this.related&&\"change\"==e&&o){if(s._changing)return;s.isDirty=!0,i=s.changed||(s.changed={}),s.previous||(s.previous={}),i[r]=this.related,s.emit(\"change\",i,s)}}});var a=e({name:\"enyo.RelationalModel\",kind:n,noDefer:!0,relations:null,getRelation:function(t){return this.relations.find(function(e){return e instanceof o&&e.key==t})},isRelation:function(t){return this.getRelation(t)},get:t.inherit(function(t){return function(e){var n,i,r=e||(e=\"\");return e.indexOf(\".\")>=0&&(i=e.split(\".\"),r=i.shift()),n=this.isRelation(r),n?i?n.getRelated().get(i.join(\".\")):n.getRelated():t.apply(this,arguments)}}),set:function(t,e,n){if(!this.destroyed){var i,r,s,a,h,c,u,l,d=this.attributes,f=this.previous;\"object\"==typeof t?(r=t,n||(n=e)):(r={},r[t]=e),n===!0&&(s=!0,n={}),n||(n={}),a=n.silent,s=s||n.force,this._changing=!0;for(h in r)c=r[h],h.indexOf(\".\")>0&&(l=h.split(\".\"),h=l.shift()),u=d[h],u&&u instanceof o?(l?u.getRelated().set(l.join(\".\"),c,n):u.setRelated(c,n),u.isOwner&&(i||(i=this.changed={}),i[h]=u.getRelated())):(c!==u||s)&&(f||(f=this.previous={}),i||(i=this.changed={}),f[h]=u,i[h]=d[h]=c);(i||s)&&(this.isDirty=!0,a||this.emit(\"change\",i,this))}this._changing=null},raw:function(){var e=this.includeKeys,n=this.attributes,i=e||Object.keys(n),r=e?t.only(e,n):t.clone(n);return i.forEach(function(t){var e=this.isRelation(t),n=e?e.getRelated():this.get(t);if(e){var i=e.includeInJSON;i?r[t]=e.raw():delete r[t]}else\"function\"==typeof n?n.call(this):r[t]=n&&n.raw?n.raw():n},this),r},constructor:t.inherit(function(t){return function(e,n,i){i=i||{},i.noAdd=!0,t.call(this,e,n,i),this.initRelations(),this.store.add(this,i,i.syncStore)}}),destroy:t.inherit(function(t){return function(){for(var e,n=this.relations,i=0;e=n[i];++i)e.destroy();t.apply(this,arguments),this.relations=null}}),initRelations:function(){var t,e=this.relations?this.relations.slice():[],n=0;if(this.relations=e,e.length){for(;t=e[n];++n)e[n]=new t.type(this,t);for(n=0;t=e[n];++n)t.findRelated()}}});a.concat=function(e,n){var i=e.prototype||e,r=i.relations&&i.relations.slice();n.relations&&(r=r&&r.concat(n.relations)||n.relations),n.relations&&n.relations.forEach(function(e){var n=e.type;n!==t.toMany&&n!==t.toOne&&n!==t.manyToMany&&(e.type=\"string\"==typeof n?t.constructorForKind(t[n]||n):t.toOne)}),delete n.relations,i.relations=r}})(enyo,this);\n\n// ../source/data/ModelController.js\n(function(t){var e=t.kind,n=t.ProxyObject,i=t.Component,s=t.ComputedSupport,r=t.EventEmitter,o=t.Object,a=e({kind:i,mixins:[s,r,n]});e({name:\"enyo.ModelController\",kind:a,model:null,proxyObjectKey:\"model\",get:t.inherit(function(t){return function(e){return this.hasOwnProperty(e)||this.isComputed(e)?this._getComputed(e):t.apply(this,arguments)}}),set:t.inherit(function(e){return function(n){return\"string\"==typeof n&&this.hasOwnProperty(n)?this.isComputed(n)?this:t.setPath.apply(this,arguments):e.apply(this,arguments)}}),_getComputed:s.get.fn(o.prototype.get),modelChanged:function(t,e){t&&t.off(\"*\",this._modelEvent,this),e&&e.on(\"*\",this._modelEvent,this);var n=this.modelObservedProperties();for(var i in n)(!t&&e||t&&!e||t&&e&&t.attributes[i]!==e.attributes[i])&&this.notify(i,t&&t.get(i),e&&e.get(i));this.emit(\"model\",{was:t,is:e})},_modelEvent:function(t,e,n){switch(this.emit(e,n,t),e){case\"change\":if(n)for(var i in n)this.notify(i,t.previous[i],n[i]);break;case\"destroy\":this.set(\"model\",null)}},modelObservedProperties:function(){return this._observedProps||(this._observedProps={})},observe:t.inherit(function(t){return function(e){var n,i=e;return e.indexOf(\".\")>-1&&(n=e.split(\".\"),i=n.shift()),this.hasOwnProperty(i)||this.isComputed(i)||(this.modelObservedProperties()[e]=null),t.apply(this,arguments)}}),addObserver:function(){return this.observe.apply(this,arguments)},constructor:t.inherit(function(e){return function(n){this.model=null,n&&t.mixin(this,n),e.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){t.apply(this,arguments),this.model&&this.model.off(\"*\",this._modelEvent,this)}})})})(enyo,this);\n\n// ../source/data/Filter.js\n(function(t){function e(){return!0}var n=t.kind,i=t.Collection,s=n({name:\"enyo.Filter\",kind:i,noDefer:!0,method:null,collection:null,filters:null,defaultProps:{kind:\"enyo.Filter\"},adjustComponentProps:t.inherit(function(n){return function(i){if(i.publish!==!1&&(i.publish=!0),n.apply(this,arguments),\"string\"==typeof i.kind&&(i.kind=t.constructorForKind(i.kind)),i.kind&&i.kind.prototype instanceof s){if(!i.name)throw\"enyo.Filter.adjustComponentProps: Child filters must have a name\";i.method||(i.method=i.name),\"string\"==typeof i.method&&(i.method=this[i.method]),\"function\"!=typeof i.method&&(i.method=i.kind.prototype.method||e)}}}),addComponent:t.inherit(function(t){return function(e){return e instanceof s&&this.filters.push(e),t.apply(this,arguments)}}),reset:t.nop,constructor:t.inherit(function(t){return function(){this.filters=[],this._internal=new i({options:{modelEvents:!1}}),this._internal.on(\"*\",this._internalEvent,this),t.apply(this,arguments)}}),constructed:t.inherit(function(t){return function(){var e,n;t.apply(this,arguments),this.isChildFilter=(n=this.owner)&&n instanceof s,this.isChildFilter&&(this.collection=n._internal,this.collection.on(\"*\",this._ownerEvent,this)),e=this.collection,e&&this.collectionChanged(null,e)}}),destroy:t.inherit(function(t){return function(){var e=this.collection;e&&(this.isChildFilter&&e===this.owner._internal?e.off(\"*\",this._ownerEvent,this):e.off(\"*\",this._collectionEvent,this),e.unobserve(\"destroyed\",this._collectionDestroyed,this)),t.apply(this,arguments),this._internal.destroy(),this._internal=null}}),collectionChanged:function(t,e){var n=this._internal;t&&(t.off(\"*\",this._collectionEvent,this),t.unobserve(\"destroyed\",this._collectionDestroyed,this)),!e||t&&this.isChildFilter&&t===this.owner._internal?n.length&&n.empty():(this.isChildFilter&&e===this.owner._internal||e.on(\"*\",this._collectionEvent,this),e.observe(\"destroyed\",this._collectionDestroyed,this),n.set(\"models\",e.models.copy()))},_collectionEvent:function(t,e,n){var i=n.models,s=this._internal;switch(e){case\"add\":s.add(i,{merge:!1});break;case\"reset\":case\"sort\":s.empty(i);break;case\"remove\":s.remove(i);break;case\"change\":s.emit(e,n)}},_collectionDestroyed:function(){this.set(\"collection\",null)},_internalEvent:t.nop,_ownerEvent:t.nop,add:t.nop,remove:t.nop,fetch:t.nop,sort:t.nop,commit:t.nop,at:t.inherit(function(t){return function(){return this.models?t.apply(this.models.at?this.models:this,arguments):void 0}}),raw:t.nop,toJSON:t.nop,has:t.inherit(function(t){return function(){return this.models?t.apply(this,arguments):!1}}),forEach:t.inherit(function(t){return function(){return this.models?t.apply(this,arguments):void 0}}),filter:t.inherit(function(t){return function(){return this.models?t.apply(this,arguments):[]}}),find:t.inherit(function(t){return function(){return this.models?t.apply(this,arguments):void 0}}),map:t.inherit(function(t){return function(){return this.models?t.apply(this,arguments):[]}}),indexOf:t.inherit(function(t){return function(){return this.models?t.apply(this,arguments):-1}}),empty:t.nop})})(enyo,this);\n\n// ../source/data/BucketFilter.js\n(function(t){var e=t.kind,n=t.Filter;e({name:\"enyo.BucketFilter\",kind:n,noDefer:!0,activeFilter:\"*\",defaultFilter:null,reset:function(t){return this.set(\"activeFilter\",this.defaultFilter||\"*\",t)},defaultProps:{kind:\"enyo.BucketFilter\"},adjustComponentProps:t.inherit(function(t){return function(e){t.apply(this,arguments),e.isDefault&&(this.defaultFilter=e.name)}}),constructed:t.inherit(function(t){return function(){t.apply(this,arguments),this.reset({force:!0})}}),_ownerEvent:function(t,e,n){var i,s=n.models,r=this.owner,o=this._internal;switch(e){case\"add\":i=s.filter(this.method,r),o.add(i,{merge:!1});break;case\"reset\":i=s.filter(this.method,r),o.empty(i);break;case\"remove\":o.remove(s);break;case\"change\":i=this.method.call(r,n.model),i?o.add(n.model,{merge:!1}):o.has(n.model)&&o.remove(n.model)}},_internalEvent:function(t,e,n){this.models===t.models?(t.models.length!=this.length&&this.set(\"length\",t.models.length),this.emit(e,n)):this.isChildFilter||\"reset\"!==e||this.set(\"models\",this._internal.models)},activeFilterChanged:function(){var t,e=this.activeFilter||\"*\";t=this[e]||null,this.set(\"activeFilterCollection\",t)},activeFilterCollectionChanged:function(t,e){var n=this._internal;t&&t.off(\"*\",this._activeFilterCollectionEvent,this),e?(e.on(\"*\",this._activeFilterCollectionEvent,this),this.set(\"models\",e.models)):this.set(\"models\",n.models)},_activeFilterCollectionEvent:function(t,e,n){t.models.length!=this.length&&this.set(\"length\",t.models.length),this.emit(e,n)}})})(enyo,this);\n\n// ../source/data/ProgressiveFilter.js\n(function(t){var e=t.kind,n=t.Filter,i=t.ModelList;e({name:\"enyo.ProgressiveFilter\",kind:n,defaultProps:{kind:\"enyo.ProgressiveFilter\"},filtered:!1,reset:function(){return this.collection&&this._internal.set(\"models\",this.collection.models.copy()),this.set(\"filtered\",!1),this},filter:t.inherit(function(t){return function(){return arguments.length>0?t.apply(this,arguments):this._filter()}}),collectionChanged:t.inherit(function(t){return function(){t.apply(this,arguments),this.set(\"filtered\",!1)}}),constructor:t.inherit(function(t){return function(){t.apply(this,arguments),this.models=this._internal}}),_filter:function(){var t,e=this._internal,n=e.length;return n&&(t=e.models.filter(this.method,this),t.length!=n&&(e.set(\"models\",new i(t.length?t:null)),this.set(\"filtered\",!0))),t||[]},_internalEvent:function(t,e,n){this.models===t&&(t.models.length!=this.length&&this.set(\"length\",t.models.length),this.emit(e,n))},_ownerEvent:function(t,e,n){this._collectionEvent(t,e,n)},_collectionEvent:function(t,e,n){var i=n.models,s=this._internal,r=this.get(\"filtered\");switch(e){case\"add\":r&&s.silence().stopNotifications(!0),s.add(i,{merge:!1,index:n.index}),r&&(s.unsilence().startNotifications(!0),this.filter(),this.length!==s.length&&this.set(\"length\",s.length));break;case\"reset\":case\"sort\":r&&s.silence().stopNotifications(!0),s.empty(i),r&&(s.unsilence().startNotifications(!0),this.filter(),this.length!==s.length&&this.set(\"length\",s.length));break;case\"remove\":s.remove(i);break;case\"change\":if(r&&!s.has(n.model))break;s.emit(e,n)}}})})(enyo,this);\n\n// ../source/data/sources/localStorage.js\n(function(t,e){var n=e.localStorage;if(n){var i=t.kind,s=t.json,r=t.uuid,o=t.Source,a=t.Collection,h=t.Model,c={UNIQUE_URL:\"A Collection must have a unique url property when using localStorage\",UNIQUE_PRIMARY_KEY:\"A Model must have a unqiue primaryKey to be able to fetch it from localStorage\"};i({name:\"enyo.LocalStorageSource\",kind:o,noDefer:!0,prefix:\"enyo-app\",storage:function(){return this._storage||(this._storage=function(t){var e=n.getItem(t.prefix);return\"string\"==typeof e&&(e=e.split(\",\")),e&&(e=t.unpack(e)),e||{uuids:[],collections:{},models:{}}}(this))},fetch:function(t,e){var n,i,s=this.storage();if(t instanceof a){if(!(n=t.url))throw Error(c.UNIQUE_URL);i=s.collections[n],i&&(i=i.map(function(t){return s.models[t]}))}else if(t instanceof h){if(!(n=t.attributes[t.primaryKey]))throw Error(c.UNIQUE_PRIMARY_KEY);i=s.models[n]}e.success(i)},commit:function(t,e){var n,i=this.storage();if(t instanceof a){if(!(n=t.url))throw Error(c.UNIQUE_URL);i.collections[n]=t.map(function(t){return t.attributes[t.primaryKey]||(t.attributes[t.primaryKey]=r())})}else t instanceof h&&((n=t.attributes[t.primaryKey])||(n=t.attributes[t.primaryKey]=r()),i.models[n]=t.raw());-1===i.uuids.indexOf(n)&&i.uuids.push(n),this.save(n),e.success()},destroy:function(t,e){var n,i,s=this.storage();if(t instanceof a){if(!(n=t.url))throw Error(c.UNIQUE_URL);delete s.collections[n]}else if(t instanceof h){if(!(n=t.attributes[t.primaryKey]))throw Error(c.UNIQUE_PRIMARY_KEY);delete s.models[n]}i=s.uuids.indexOf(n),i>-1&&s.uuids.splice(i,1),this.save(n),e.success()},find:function(){},save:function(t){var e=this.storage(),i=this.prefix,r=function(t){var r=i+\"-\"+t,o=e.models[t],a=e.collections[t];o||a?n.setItem(r,s.stringify({model:!!o,collection:!!a,data:o||a})):n.removeItem(r)};t?r(t):[\"collections\",\"models\"].forEach(function(t){Object.keys(e[t]).forEach(r)}),n.setItem(i,e.uuids.join(\",\"))},unpack:function(t){var e=this.prefix,i={},r={},o={uuids:t,models:r,collections:i};return t.forEach(function(t){var o=e+\"-\"+t,a=n.getItem(o);a&&\"string\"==typeof a&&(a=s.parse(a),a.collection?i[t]=a.data:a.model&&(r[t]=a.data))}),o}})}})(enyo,this);\n\n// ../source/data/sources/xhr.js\n(function(t){function e(){return location.origin}function n(){var t=e(),n=location.pathname.split(\"/\"),i=n[n.length-1];return i&&/\\.[a-zA-Z0-9]+$/.test(i)&&(n=n.slice(0,-1)),t+=n.length?\"/\"+n.join(\"/\"):\"\"}function i(t){return t.replace(/([^:]\\/)(\\/+)/g,\"$1\")}var s=t.kind,r=t.Source,o=s({name:\"enyo.XHRSource\",kind:r,noDefer:!0,requestKind:null,urlRoot:\"\",defaultOptions:{cacheBust:!1,contentType:\"application/json\"},buildUrl:function(t,s){var r=s&&s.url||(t.getUrl?t.getUrl():t.url);return/^(.*):\\/\\//.test(r)||(r=\"/\"==r[0]?e()+r:(t.urlRoot||this.urlRoot||n())+\"/\"+r),i(r)},go:function(e){var n,i,s,r=this.requestKind,o=this.defaultOptions;e.params?i=o.params?t.mixin({},[o.params,e.params]):e.params:o.params&&(i=o.params),s=t.only(this.allowed,t.mixin({},[o,e]),!0),n=new r(s),n.response(function(t,n){e.success&&e.success(n,t)}),n.error(function(t,n){e&&e.error&&e.error(n,t)}),n.go(i)},find:function(t,e){e.url=this.buildUrl(t,e),e.method=e.method||\"POST\",e.postBody=e.attributes,this.go(e)},importProps:t.inherit(function(t){return function(e){e.defaultOptions&&o.concat(this,e),t.call(this,e)}})});o.concat=function(e,n){if(n.defaultOptions){var i=e.prototype||e;i.defaultOptions=t.mixin({},[i.defaultOptions,n.defaultOptions]),delete n.defaultOptions}}})(enyo,this);\n\n// ../source/data/sources/Ajax.js\n(function(t){var e=t.kind,n=t.checkConstructor,i=t.XHRSource,s=n(t.Ajax),r=t.AjaxProperties;e({name:\"enyo.AjaxSource\",kind:i,requestKind:s,noDefer:!0,allowed:Object.keys(r),fetch:function(t,e){e.method=\"GET\",e.url=this.buildUrl(t,e),this.go(e)},commit:function(t,e){e.method=t.isNew?\"POST\":\"PUT\",e.url=this.buildUrl(t,e),e.postBody=e.postBody||t.toJSON(),this.go(e)},destroy:function(t,e){e.method=\"DELETE\",e.url=this.buildUrl(t,e),this.go(e)}})})(enyo);\n\n// ../source/data/sources/Jsonp.js\n(function(t){var e=t.kind,n=t.checkConstructor,i=t.XHRSource,s=n(t.JsonpRequest);e({name:\"enyo.JsonpSource\",kind:i,requestKind:s,noDefer:!0,allowed:Object.keys(s.prototype.published),fetch:function(t,e){e.cacheBust=!1,e.method=\"GET\",e.url=this.buildUrl(t,e),this.go(e)},commit:function(t,e){e.cacheBust=!1,e.method=t.isNew?\"POST\":\"PUT\",e.url=this.buildUrl(t,e),e.postBody=e.postBody||t.toJSON(),this.go(e)},destroy:function(t,e){e.cacheBust=!1,e.method=\"DELETE\",e.url=this.buildUrl(t,e),this.go(e)}})})(enyo);\n\n// ../source/dom/dom.js\n(function(t){t.requiresWindow=function(t){t()},t.dom={byId:function(t,e){return\"string\"==typeof t?(e||document).getElementById(t):t},escape:function(t){return null!==t?(t+\"\").replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"):\"\"},getBounds:function(t){return t?{left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}:null},_ie8GetComputedStyle:function(t){var e=/(\\-([a-z]){1})/g;return\"float\"===t?t=\"styleFloat\":e.test(t)&&(t=t.replace(e,function(){return arguments[2].toUpperCase()})),void 0!==this[t]?this[t]:null},getComputedStyle:function(e){if(9>t.platform.ie&&e&&e.currentStyle){var n=t.clone(e.currentStyle);return n.getPropertyValue=this._ie8GetComputedStyle,n.setProperty=function(){return e.currentStyle.setExpression.apply(e.currentStyle,arguments)},n.removeProperty=function(){return e.currentStyle.removeAttribute.apply(e.currentStyle,arguments)},n}return window.getComputedStyle&&e&&window.getComputedStyle(e,null)},getComputedStyleValue:function(e,n,i){var o=i||this.getComputedStyle(e),s=t.platform.ie;if(o=o?o.getPropertyValue(n):null,s){var r={thin:(s>8?2:1)+\"px\",medium:(s>8?4:3)+\"px\",thick:(s>8?6:5)+\"px\",none:\"0\"};if(r[o]!==void 0&&(o=r[o]),\"auto\"==o)switch(n){case\"width\":o=e.offsetWidth;break;case\"height\":o=e.offsetHeight}}return o},getFirstElementByTagName:function(t){var e=document.getElementsByTagName(t);return e&&e[0]},applyBodyFit:function(){var e=this.getFirstElementByTagName(\"html\");e&&this.addClass(e,\"enyo-document-fit\"),t.dom.addBodyClass(\"enyo-body-fit\"),t.bodyIsFitting=!0},getWindowWidth:function(){return window.innerWidth?window.innerWidth:document.body&&document.body.offsetWidth?document.body.offsetWidth:\"CSS1Compat\"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?document.documentElement.offsetWidth:320},getWindowHeight:function(){return window.innerHeight?window.innerHeight:document.body&&document.body.offsetHeight?document.body.offsetHeight:\"CSS1Compat\"==document.compatMode&&document.documentElement&&document.documentElement.offsetHeight?document.documentElement.offsetHeight:480},_bodyScaleFactorY:1,_bodyScaleFactorX:1,updateScaleFactor:function(){var t=this.getBounds(document.body);this._bodyScaleFactorY=t.height/this.getWindowHeight(),this._bodyScaleFactorX=t.width/this.getWindowWidth()},compareDocumentPosition:function(t,e){return t.compareDocumentPosition?t.compareDocumentPosition(e):t.contains?(t!=e&&t.contains(e)&&16)+(t!=e&&e.contains(t)&&8)+(t.sourceIndex>=0&&e.sourceIndex>=0?(t.sourceIndex<e.sourceIndex&&4)+(t.sourceIndex>e.sourceIndex&&2):1)+0:0},_ieCssToPixelValue:function(t,e){var n=e,i=t.style,o=i.left,s=t.runtimeStyle&&t.runtimeStyle.left;return s&&(t.runtimeStyle.left=t.currentStyle.left),i.left=n,n=i.pixelLeft,i.left=o,s&&(i.runtimeStyle.left=s),n},_pxMatch:/px/i,getComputedBoxValue:function(e,n,i,o){var s=o||this.getComputedStyle(e);if(s&&(!t.platform.ie||t.platform.ie>=9)){var r=s.getPropertyValue(n+\"-\"+i);return\"auto\"===r?0:parseInt(r,10)}if(e&&e.currentStyle){var a=e.currentStyle[n+t.cap(i)];return a.match(this._pxMatch)||(a=this._ieCssToPixelValue(e,a)),parseInt(a,0)}return 0},calcBoxExtents:function(t,e){var n=this.getComputedStyle(t);return{top:this.getComputedBoxValue(t,e,\"top\",n),right:this.getComputedBoxValue(t,e,\"right\",n),bottom:this.getComputedBoxValue(t,e,\"bottom\",n),left:this.getComputedBoxValue(t,e,\"left\",n)}},calcPaddingExtents:function(t){return this.calcBoxExtents(t,\"padding\")},calcMarginExtents:function(t){return this.calcBoxExtents(t,\"margin\")},calcNodePosition:function(e,n){var i=0,o=0,s=e,r=s.offsetWidth,a=s.offsetHeight,c=t.dom.getStyleTransformProp(),h=/translateX\\((-?\\d+)px\\)/i,u=/translateY\\((-?\\d+)px\\)/i,l=0,d=0,f=0,p=0,m=0,y=0;if(n?(f=n.offsetHeight,p=n.offsetWidth):(f=document.body.parentNode.offsetHeight>this.getWindowHeight()?this.getWindowHeight()-document.body.parentNode.scrollTop:document.body.parentNode.offsetHeight,p=document.body.parentNode.offsetWidth>this.getWindowWidth()?this.getWindowWidth()-document.body.parentNode.scrollLeft:document.body.parentNode.offsetWidth),s.offsetParent)do n&&8&this.compareDocumentPosition(n,s.offsetParent)&&(m=n.offsetLeft,y=n.offsetTop),o+=s.offsetLeft-(s.offsetParent?s.offsetParent.scrollLeft:0)-m,c&&h.test(s.style[c])&&(o+=parseInt(s.style[c].replace(h,\"$1\"),10)),i+=s.offsetTop-(s.offsetParent?s.offsetParent.scrollTop:0)-y,c&&u.test(s.style[c])&&(i+=parseInt(s.style[c].replace(u,\"$1\"),10)),s!==e&&(s.currentStyle?(l=parseInt(s.currentStyle.borderLeftWidth,10),d=parseInt(s.currentStyle.borderTopWidth,10)):window.getComputedStyle?(l=parseInt(window.getComputedStyle(s,\"\").getPropertyValue(\"border-left-width\"),10),d=parseInt(window.getComputedStyle(s,\"\").getPropertyValue(\"border-top-width\"),10)):(l=parseInt(s.style.borderLeftWidth,10),d=parseInt(s.style.borderTopWidth,10)),l&&(o+=l),d&&(i+=d));while((s=s.offsetParent)&&(!n||16&this.compareDocumentPosition(n,s)));return{top:i,left:o,bottom:f-i-a,right:p-o-r,height:a,width:r}},setInnerHtml:function(t,e){t.innerHTML=e},hasClass:function(t,e){return t&&t.className?(\" \"+t.className+\" \").indexOf(\" \"+e+\" \")>=0:void 0},addClass:function(t,e){if(t&&!this.hasClass(t,e)){var n=t.className;t.className=n+(n?\" \":\"\")+e}},removeClass:function(t,e){if(t&&this.hasClass(t,e)){var n=t.className;t.className=(\" \"+n+\" \").replace(\" \"+e+\" \",\" \").slice(1,-1)}},addBodyClass:function(e){t.exists(t.roots)&&0!==t.roots.length?t.dom.addClass(document.body,e):t.dom._bodyClasses?t.dom._bodyClasses.push(e):t.dom._bodyClasses=[e]},getAbsoluteBounds:function(e){return t.clone(e.getBoundingClientRect())},flushBodyClasses:function(){if(t.dom._bodyClasses){for(var e,n=0;e=t.dom._bodyClasses[n];++n)t.dom.addClass(document.body,e);t.dom._bodyClasses=null}},_bodyClasses:null,unit:function(t,e){return e&&this.unitToPixelFactors[e]&&(\"string\"==typeof t&&\"px\"==t.substr(-2)&&(t=parseInt(t.substr(0,t.length-2),10)),\"number\"==typeof t)?t/this.unitToPixelFactors[e]+\"\"+e:void 0},unitToPixelFactors:{rem:12,\"in\":96}},window.MSApp!==void 0&&(t.dom.setInnerHtml=function(t,e){window.MSApp.execUnsafeLocalFunction(function(){t.innerHTML=e})}),document.head&&document.head.classList&&(t.dom.hasClass=function(t,e){return t?t.classList.contains(e):void 0},t.dom.addClass=function(t,e){return t?t.classList.add(e):void 0},t.dom.removeClass=function(t,e){return t?t.classList.remove(e):void 0})})(enyo,this);\n\n// ../source/dom/resolution.js\n(function(t,e){var n,i,o,s=\"standard\",r=[{name:\"standard\",pxPerRem:16,width:e.innerWidth,height:e.innerHeight,aspectRatioName:\"standard\"}],a=function(t){return t=t||i,t==i&&o?o:r.filter(function(e){return t==e.name})[0]};t.ri={defineScreenTypes:function(e){r=e;for(var n=0;r.length>n;n++)r[n].base&&(s=r[n].name);t.ri.init()},getScreenType:function(t){t=t||{height:e.innerHeight,width:e.innerWidth};var n,i=r,o=i[i.length-1].name;for(n=i.length-1;n>=0;n--)t.width<=i[n].width&&(o=i[n].name);return o},updateScreenBodyClasses:function(e){if(e=e||i){t.dom.addBodyClass(\"enyo-res-\"+e.toLowerCase());var n=a(e);return n.aspectRatioName&&t.dom.addBodyClass(\"enyo-aspect-ratio-\"+n.aspectRatioName.toLowerCase()),e}},getRiRatio:function(t){if(t=t||i){var e=this.getUnitToPixelFactors(t)/this.getUnitToPixelFactors(s);return t==i&&(n=e),e}return 1},getUnitToPixelFactors:function(t){return t=t||i,t?a(t).pxPerRem:1},getAspectRatio:function(t){var e=a(t);return e.width&&e.height?e.width/e.height:1},getAspectRatioName:function(t){var e=a(t);return e.aspectRatioName||\"standard\"},scale:function(t){return(n||this.getRiRatio())*t},selectSrc:function(t){if(\"string\"!=typeof t&&t){var e,n,o=t.fhd||t.uhd||t.hd,s=r;for(e=s.length-1;e>=0;e--)n=s[e].name,i==n&&t[n]&&(o=t[n]);t=o}return t},init:function(){i=this.getScreenType(),o=a(),this.updateScreenBodyClasses(),t.dom.unitToPixelFactors.rem=this.getUnitToPixelFactors(),n=this.getRiRatio()}}})(enyo,this);\n\n// ../source/dom/transform.js\n(function(t){var e=[\"transform\",\"-webkit-transform\",\"-moz-transform\",\"-ms-transform\",\"-o-transform\"],n=[\"transform\",\"webkitTransform\",\"MozTransform\",\"msTransform\",\"OTransform\"];t.dom.calcCanAccelerate=function(){if(2>=t.platform.android)return!1;for(var e,n=[\"perspective\",\"WebkitPerspective\",\"MozPerspective\",\"msPerspective\",\"OPerspective\"],i=0;e=n[i];i++)if(document.body.style[e]!==void 0)return!0;return!1},t.dom.getCssTransformProp=function(){if(this._cssTransformProp)return this._cssTransformProp;var i=t.indexOf(this.getStyleTransformProp(),n);return this._cssTransformProp=e[i],this._cssTransformProp},t.dom.getStyleTransformProp=function(){if(this._styleTransformProp||!document.body)return this._styleTransformProp;for(var t,e=0;t=n[e];e++)if(document.body.style[t]!==void 0)return this._styleTransformProp=t,this._styleTransformProp},t.dom.domTransformsToCss=function(t){var e,n,i=\"\";for(e in t)n=t[e],null!==n&&void 0!==n&&\"\"!==n&&(i+=e+\"(\"+n+\") \");return i},t.dom.transformsToDom=function(t){var e,n=this.domTransformsToCss(t.domTransforms);e=t.hasNode()?this.getStyleTransformProp():this.getCssTransformProp(),e&&t.applyStyle(e,n)},t.dom.canTransform=function(){return Boolean(this.getStyleTransformProp())},t.dom.canAccelerate=function(){return void 0!==this.accelerando?this.accelerando:document.body&&(this.accelerando=this.calcCanAccelerate())},t.dom.transform=function(e,n){var i=e.domTransforms=e.domTransforms||{};t.mixin(i,n),this.transformsToDom(e)},t.dom.transformValue=function(t,e,n){var i=t.domTransforms=t.domTransforms||{};i[e]=n,this.transformsToDom(t)},t.dom.accelerate=function(t,e){var n=\"auto\"==e?this.canAccelerate():e;this.transformValue(t,\"translateZ\",n?0:null)}})(enyo,this);\n\n// ../source/dom/delegates/HTMLStringDelegate.js\n(function(t){var e={img:1,hr:1,br:1,area:1,base:1,basefont:1,input:1,link:1,meta:1,command:1,embed:1,keygen:1,wbr:1,param:1,source:1,track:1,col:1};t.HTMLStringDelegate={invalidate:function(t,e){switch(e){case\"content\":this.renderContent(t);break;default:t.tagsValid=!1}},render:function(t){if(t.parent){if(t.parent.beforeChildRender(t),!t.parent.generated)return;if(null===t.tag)return t.parent.render()}t.hasNode()||this.renderNode(t),t.hasNode()&&(this.renderDom(t),t.generated&&t.rendered())},renderInto:function(t,e){e.innerHTML=this.generateHtml(t),t.generated&&t.rendered()},renderNode:function(t){this.teardownRender(t),t.node=document.createElement(t.tag),t.addNodeToParent(),t.set(\"generated\",!0)},renderDom:function(t){this.renderAttributes(t),this.renderStyles(t),this.renderContent(t)},renderStyles:function(t){var e=t.style;t.hasNode()&&(t.node.style.cssText=e,t.cssText=e=t.node.style.cssText,t.set(\"style\",e))},renderAttributes:function(t){var e,n,i=t.attributes,r=t.hasNode();if(r)for(e in i)n=i[e],null===n||n===!1||\"\"===n?r.removeAttribute(e):r.setAttribute(e,n)},renderContent:function(t){t.generated&&this.teardownChildren(t),t.hasNode()&&(t.node.innerHTML=this.generateInnerHtml(t))},generateHtml:function(t){var e,n;return t.canGenerate===!1?\"\":(e=this.generateInnerHtml(t),n=this.generateOuterHtml(t,e),t.set(\"generated\",!0),n)},generateOuterHtml:function(t,e){return t.tag?(t.tagsValid||this.prepareTags(t),t._openTag+e+t._closeTag):e},generateInnerHtml:function(e){var n,i=e.allowHtml;return e.flow(),e.children.length?this.generateChildHtml(e):(n=e.get(\"content\"),i?n:t.dom.escape(n))},generateChildHtml:function(t){for(var e,n,i=\"\",r=0;e=t.children[r];++r)n=e.renderDelegate||this,i+=n.generateHtml(e);return i},prepareTags:function(t){var n=\"\";n+=\"<\"+t.tag+(t.style?' style=\"'+t.style+'\"':\"\"),n+=this.attributesToHtml(t.attributes),e[t.tag]?(t._openTag=n+\"/>\",t._closeTag=\"\"):(t._openTag=n+\">\",t._closeTag=\"</\"+t.tag+\">\"),t.tagsValid=!0},attributesToHtml:function(t){var e,n,i=\"\";for(e in t)n=t[e],null!=n&&n!==!1&&\"\"!==n&&(i+=\" \"+e+'=\"'+this.escapeAttribute(n)+'\"');return i},escapeAttribute:function(t){return\"string\"!=typeof t?t:(t+\"\").replace(/&/g,\"&amp;\").replace(/\\\"/g,\"&quot;\")},teardownRender:function(t,e){t.generated&&this.teardownChildren(t,e),t.node=null,t.set(\"generated\",!1)},teardownChildren:function(t,e){for(var n,i=0;n=t.children[i];++i)n.teardownRender(e)}}})(enyo,this);\n\n// ../source/dom/Control.js\n(function(t){function e(t){var e=i(),n=t._retainedNode;n&&e.appendChild(n),t._retainedNode=null}function n(t){var e=i();t&&e.removeChild(t)}function i(){var t=s;return t||(t=s=document.createElement(\"div\"),t.id=\"node_purgatory\",t.style.display=\"none\",document.body.appendChild(t)),t}var s,r=t.kind,o=t.UiComponent,a=t.HTMLStringDelegate,h=r({name:\"enyo.Control\",kind:o,noDefer:!0,defaultKind:\"enyo.Control\",tag:\"div\",attributes:null,fit:null,allowHtml:!1,style:\"\",kindStyle:\"\",classes:\"\",kindClasses:\"\",controlClasses:\"\",content:\"\",doubleTapEnabled:\"inherit\",doubleTapInterval:300,renderOnShow:!1,handlers:{ontap:\"tap\",onShowingChanged:\"showingChangedHandler\"},strictlyInternalEvents:{onenter:1,onleave:1},isInternalEvent:function(e){var n=t.dispatcher.findDispatchTarget(e.relatedTarget);return n&&n.isDescendantOf(this)},getBounds:function(){var e=this.hasNode(),n=e&&t.dom.getBounds(e);return n||{left:void 0,top:void 0,width:void 0,height:void 0}},setBounds:function(t,e){var n,i,s=\"\",r=[\"width\",\"height\",\"left\",\"top\",\"right\",\"bottom\"],o=0;for(e=e||\"px\";i=r[o];++o)n=t[i],(n||0===n)&&(s+=i+\":\"+n+(\"string\"==typeof n?\"\":e)+\";\");this.set(\"style\",this.style+s)},getAbsoluteBounds:function(){var e=this.hasNode(),n=e&&t.dom.getAbsoluteBounds(e);return n||{left:void 0,top:void 0,width:void 0,height:void 0,bottom:void 0,right:void 0}},show:function(){this.set(\"showing\",!0)},hide:function(){this.set(\"showing\",!1)},focus:function(){this.hasNode()&&this.node.focus()},blur:function(){this.hasNode()&&this.node.blur()},hasFocus:function(){return this.hasNode()?document.activeElement===this.node:void 0},hasNode:function(){return this.generated&&(this.node||this.findNodeById())},getAttribute:function(t){var e;return this.attributes.hasOwnProperty(t)?this.attributes[t]:(e=this.hasNode(),this.attributes[t]=e?e.getAttribute(t):null)},setAttribute:function(t,e){var n=this.attributes,i=this.hasNode(),s=this.renderDelegate||h.renderDelegate;return t&&(n[t]=e,i?null==e||e===!1||\"\"===e?i.removeAttribute(t):i.setAttribute(t,e):s.invalidate(this,\"attributes\")),this},getNodeProperty:function(t,e){return this.hasNode()?this.node[t]:e},setNodeProperty:function(t,e){return this.hasNode()&&(this.node[t]=e),this},addContent:function(t){return this.set(\"content\",this.get(\"content\")+t)},hasClass:function(t){return t&&(\" \"+this.classes+\" \").indexOf(\" \"+t+\" \")>-1},addClass:function(t){var e=this.classes||\"\";return this.hasClass(t)||this.set(\"classes\",e+(e?\" \"+t:t)),this},removeClass:function(t){var e=this.classes;return t&&this.set(\"classes\",(\" \"+e+\" \").replace(\" \"+t+\" \",\" \").trim()),this},addRemoveClass:function(t,e){return t?this[e?\"addClass\":\"removeClass\"](t):this},classesChanged:function(){var t=this.classes,e=this.hasNode(),n=this.attributes,i=this.renderDelegate||h.renderDelegate;e&&(t||this.kindClasses?e.setAttribute(\"class\",t||this.kindClasses):e.removeAttribute(\"class\"),this.classes=t=e.getAttribute(\"class\")),n[\"class\"]=t,i.invalidate(this,\"attributes\")},applyStyle:function(e,n){var i=this.hasNode(),s=this.style,r=this.renderDelegate||h.renderDelegate;return i&&(35>t.platform.firefox||t.platform.firefoxOS||t.platform.androidFirefox)&&(e=e.replace(/-([a-z])/gi,function(t,e){return e.toUpperCase()})),null!==n&&\"\"!==n&&void 0!==n?i?(i.style[e]=n,this.style=this.cssText=i.style.cssText,r.invalidate(this,\"style\")):this.set(\"style\",s+(\" \"+e+\":\"+n+\";\")):i?(i.style[e]=\"\",this.style=this.cssText=i.style.cssText,r.invalidate(this,\"style\")):(s=s.replace(RegExp(\"\\\\s*\"+e+\"\\\\s*:\\\\s*[a-zA-Z0-9\\\\ ()_\\\\-'\\\"%,]*(?:url\\\\(.*\\\\)\\\\s*[a-zA-Z0-9\\\\ ()_\\\\-'\\\"%,]*)?\\\\s*(?:;|;?$)\",\"gi\"),\"\"),this.set(\"style\",s)),this},addStyles:function(t){var e,n=\"\";if(\"object\"==typeof t)for(e in t)n+=e+\":\"+t[e]+\";\";else n=t||\"\";this.set(\"style\",this.style+n)},styleChanged:function(){var t=this.renderDelegate||h.renderDelegate;this.cssText!==this.style&&(this.hasNode()&&(this.node.style.cssText=this.kindStyle+(this.style||\"\"),this.cssText=this.style=this.node.style.cssText),t.invalidate(this,\"style\"))},getComputedStyleValue:function(e,n){return this.hasNode()?t.dom.getComputedStyleValue(this.node,e):n},findNodeById:function(){return this.id&&(this.node=t.dom.byId(this.id))},idChanged:function(t){t&&h.unregisterDomEvents(t),this.id&&(h.registerDomEvents(this.id,this),this.setAttribute(\"id\",this.id))},contentChanged:function(){var t=this.renderDelegate||h.renderDelegate;t.invalidate(this,\"content\")},beforeChildRender:function(){this.generated&&this.flow()},showingChanged:function(t){var e;!t&&this.showing?(this.applyStyle(\"display\",this._display||\"\"),this.generated||this.canGenerate||!this.renderOnShow||(e=this.getNextControl(),e&&!this.addBefore&&(this.addBefore=e),this.set(\"canGenerate\",!0),this.render()),this.sendShowingChangedEvent(t)):t&&!this.showing&&(this.sendShowingChangedEvent(t),this._display=this.hasNode()?this.node.style.display:\"\",this.applyStyle(\"display\",\"none\"))},renderOnShowChanged:function(){this.showing=!!this.showing&&!this.renderOnShow,this.canGenerate=this.canGenerate&&!this.renderOnShow},sendShowingChangedEvent:function(t){var e=t===!0||t===!1,n=this.parent;e&&(n?n.getAbsoluteShowing(!0):!0)&&this.waterfall(\"onShowingChanged\",{originator:this,showing:this.showing})},getAbsoluteShowing:function(e){var n=e?null:this.getBounds(),i=this.parent;return!this.generated||this.destroyed||!this.showing||n&&0===n.height&&0===n.width?!1:!i||!i.getAbsoluteShowing||this.parentNode&&this.parentNode===t.floatingLayer.hasNode()?!0:i.getAbsoluteShowing(e)},showingChangedHandler:function(t){return t===this?!1:!this.showing},fitChanged:function(){this.parent.reflow()},isFullscreen:function(){return this.hasNode()&&this.node===t.fullscreen.getFullscreenElement()},requestFullscreen:function(){return this.hasNode()?t.fullscreen.requestFullscreen(this)?!0:!1:!1},cancelFullscreen:function(){return this.isFullscreen()?(t.fullscreen.cancelFullscreen(),!0):!1},canGenerate:!0,showing:!0,renderDelegate:null,generated:!1,render:function(){var t=this.renderDelegate||h.renderDelegate;return t.render(this),this},renderInto:function(e,n){var i=this.renderDelegate||h.renderDelegate,s=this.fit===!1;return e=t.dom.byId(e),i.teardownRender(this),e!=document.body||s?this.fit&&this.addClass(\"enyo-fit enyo-clip\"):this.setupBodyFitting(),this.addClass(\"enyo-no-touch-action\"),this.setupOverflowScrolling(),t.dom.flushBodyClasses(),n||t.addToRoots(this),i.renderInto(this,e),t.dom.updateScaleFactor(),this},rendered:function(){var t,e=0;for(this.reflow();t=this.children[e];++e)t.generated&&t.rendered()},retainNode:function(t){var e=this,i=this._retainedNode=t||this.hasNode();return function(){e&&e._retainedNode==i?e._retainedNode=null:n(i)}},teardownRender:function(t){var n=this.renderDelegate||h.renderDelegate;this._retainedNode&&e(this),n.teardownRender(this,t),this.renderOnShow&&!t&&(this.set(\"showing\",!1),this.set(\"canGenerate\",!1))},teardownChildren:function(){var t=this.renderDelegate||h.renderDelegate;t.teardownChildren(this)},addNodeToParent:function(){var t;this.node&&(t=this.getParentNode(),t&&(void 0!==this.addBefore?this.insertNodeInParent(t,this.addBefore&&this.addBefore.hasNode()):this.appendNodeToParent(t)))},appendNodeToParent:function(t){t.appendChild(this.node)},insertNodeInParent:function(t,e){t.insertBefore(this.node,e||t.firstChild)},removeNodeFromDom:function(){this.hasNode()&&this.node.parentNode&&this.node.parentNode.removeChild(this.node)},getParentNode:function(){return this.parentNode||this.parent&&(this.parent.hasNode()||this.parent.getParentNode())},constructor:t.inherit(function(e){return function(n){var i=n&&n.attributes;return this.attributes=this.attributes?t.clone(this.attributes):{},i&&(t.mixin(this.attributes,i),delete n.attributes),e.apply(this,arguments)}}),create:t.inherit(function(t){return function(){var e;this.style=this.kindStyle+this.style,this.renderOnShowChanged(),t.apply(this,arguments),this.showing||(this.style+=\" display: none;\"),e=this.kindClasses,e&&this.classes?e+=\" \"+this.classes:this.classes&&(e=this.classes),this.classes=this.attributes[\"class\"]=e?e.trim():e,this.idChanged(),this.contentChanged()}}),destroy:t.inherit(function(e){return function(){this.removeNodeFromDom(),t.$[this.id]=null,e.apply(this,arguments)}}),dispatchEvent:t.inherit(function(t){return function(e,n){return this.strictlyInternalEvents[e]&&this.isInternalEvent(n)?!0:t.apply(this,arguments)}}),addChild:t.inherit(function(t){return function(e){e.addClass(this.controlClasses),t.apply(this,arguments)}}),removeChild:t.inherit(function(t){return function(e){t.apply(this,arguments),e.removeClass(this.controlClasses)}}),set:t.inherit(function(t){return function(e,n,i){return\"showing\"==e?t.call(this,e,!!n,i):t.apply(this,arguments)}}),isContainer:!1,rtl:!1,setupBodyFitting:function(){t.dom.applyBodyFit(),this.addClass(\"enyo-fit enyo-clip\")},setupOverflowScrolling:function(){t.platform.android||t.platform.androidChrome||t.platform.blackberry||t.dom.addBodyClass(\"webkitOverflowScrolling\")},detectTextDirectionality:function(e){var n=arguments.length?e:this.content;n||0===n?(this.rtl=t.isRtl(n),this.applyStyle(\"direction\",this.rtl?\"rtl\":\"ltr\")):this.applyStyle(\"direction\",null)},getTag:function(){return this.tag},setTag:function(t){var e=this.tag;return t&&\"string\"==typeof t&&(this.tag=t,e!==t&&this.notify(\"tag\",e,t)),this},getAttributes:function(){return this.attributes},setAttributes:function(t){var e=this.attributes;return\"object\"==typeof t&&(this.attributes=t,t!==e&&this.notify(\"attributes\",e,t)),this},getClasses:function(){return this.classes},setClasses:function(t){var e=this.classes;return this.classes=t,e!=t&&this.notify(\"classes\",e,t),this},getStyle:function(){return this.style},setStyle:function(t){var e=this.style;return this.style=t,e!=t&&this.notify(\"style\",e,t),this},getContent:function(){return this.content},setContent:function(t){var e=this.content;return this.content=t,e!=t&&this.notify(\"content\",e,t),this},getShowing:function(){return this.showing},setShowing:function(t){var e=this.showing;return this.showing=!!t,e!=t&&this.notify(\"showing\",e,t),this},getAllowHtml:function(){return this.allowHtml},setAllowHtml:function(t){var e=this.allowHtml;return this.allowHtml=!!t,e!==t&&this.notify(\"allowHtml\",e,t),this},getCanGenerate:function(){return this.canGenerate},setCanGenerate:function(t){var e=this.canGenerate;return this.canGenerate=!!t,e!==t&&this.notify(\"canGenerate\",e,t),this},getFit:function(){return this.fit},setFit:function(t){var e=this.fit;return this.fit=!!t,e!==t&&this.notify(\"fit\",e,t),this},getIsContainer:function(){return this.isContainer},setIsContainer:function(t){var e=this.isContainer;return this.isContainer=!!t,e!==t&&this.notify(\"isContainer\",e,t),this}});t.defaultCtor=h,h.renderDelegate=a,h.registerDomEvents=function(e,n){t.$[e]=n},h.unregisterDomEvents=function(e){t.$[e]=null},h.normalizeCssStyleString=function(t){return t?(\";\"+t).replace(/([^;])\\s*$/,\"$1;\").replace(/\\s*;\\s*([\\w-]+)\\s*:\\s*/g,\"; $1: \").substr(2).trim():\"\"},h.concat=function(e,n,i){var s,r,o=e.prototype||e;n.classes&&(i?(r=(o.classes?o.classes+\" \":\"\")+n.classes,o.classes=r):(r=(o.kindClasses||\"\")+(o.classes?\" \"+o.classes:\"\"),o.kindClasses=r,o.classes=n.classes),delete n.classes),n.style&&(i?(r=(o.style?o.style+\";\":\"\")+(n.style+\";\"),o.style=h.normalizeCssStyleString(r)):(r=o.kindStyle?o.kindStyle:\"\",r+=o.style?\";\"+o.style:\"\",r+=n.style,o.kindStyle=h.normalizeCssStyleString(r)),delete n.style),n.attributes&&(s=o.attributes,o.attributes=s?t.mixin({},[s,n.attributes]):n.attributes,delete n.attributes)}})(enyo,this);\n\n// ../source/dom/platform.js\n(function(t){t.platform={touch:Boolean(\"ontouchstart\"in window||window.navigator.msMaxTouchPoints),gesture:Boolean(\"ongesturestart\"in window||window.navigator.msMaxTouchPoints)};for(var e,n,i,s=navigator.userAgent,r=t.platform,o=[{platform:\"androidChrome\",regex:/Android .* Chrome\\/(\\d+)[.\\d]+/},{platform:\"android\",regex:/Android (\\d+)/},{platform:\"android\",regex:/Silk\\/1./,forceVersion:2,extra:{silk:1}},{platform:\"android\",regex:/Silk\\/2./,forceVersion:4,extra:{silk:2}},{platform:\"android\",regex:/Silk\\/3./,forceVersion:4,extra:{silk:3}},{platform:\"windowsPhone\",regex:/Windows Phone (?:OS )?(\\d+)[.\\d]+/},{platform:\"ie\",regex:/MSIE (\\d+)/},{platform:\"ie\",regex:/Trident\\/.*; rv:(\\d+)/},{platform:\"ios\",regex:/iP(?:hone|ad;(?: U;)? CPU) OS (\\d+)/},{platform:\"webos\",regex:/(?:web|hpw)OS\\/(\\d+)/},{platform:\"webos\",regex:/WebAppManager|Isis|webOS\\./,forceVersion:4},{platform:\"webos\",regex:/LuneOS/,forceVersion:4,extra:{luneos:1}},{platform:\"safari\",regex:/Version\\/(\\d+)[.\\d]+\\s+Safari/},{platform:\"chrome\",regex:/Chrome\\/(\\d+)[.\\d]+/},{platform:\"androidFirefox\",regex:/Android;.*Firefox\\/(\\d+)/},{platform:\"firefoxOS\",regex:/Mobile;.*Firefox\\/(\\d+)/},{platform:\"firefox\",regex:/Firefox\\/(\\d+)/},{platform:\"blackberry\",regex:/PlayBook/i,forceVersion:2},{platform:\"blackberry\",regex:/BB1\\d;.*Version\\/(\\d+\\.\\d+)/},{platform:\"tizen\",regex:/Tizen (\\d+)/}],a=0;e=o[a];a++)if(n=e.regex.exec(s)){i=e.forceVersion?e.forceVersion:Number(n[1]),r[e.platform]=i,e.extra&&t.mixin(r,e.extra),r.platformName=e.platform;break}t.dumbConsole=Boolean(r.android||r.ios||r.webos)})(enyo,this);\n\n// ../source/dom/animation.js\n(function(t){for(var e,n,i,s=Math.round(1e3/60),r=[\"webkit\",\"moz\",\"ms\",\"o\",\"\"],o=\"requestAnimationFrame\",a=\"cancel\"+t.cap(o),h=function(t){return window.setTimeout(t,s)},c=function(t){return window.clearTimeout(t)},u=0,l=r.length;((e=r[u])||l>u)&&!(t.platform.ios>=6);u++)if(n=e?e+t.cap(a):a,i=e?e+t.cap(o):o,window[n]){c=window[n],h=window[i],\"webkit\"==e&&c(h(t.nop));break}t.requestAnimationFrame=function(t,e){return h(t,e)},t.cancelRequestAnimationFrame=function(t){return c(t)},t.easing={cubicIn:function(t){return Math.pow(t,3)},cubicOut:function(t){return Math.pow(t-1,3)+1},expoOut:function(t){return 1==t?1:-1*Math.pow(2,-10*t)+1},quadInOut:function(t){return t=2*t,1>t?Math.pow(t,2)/2:-1*(--t*(t-2)-1)/2},linear:function(t){return t}},t.easedLerp=function(e,n,i,s){var r=(t.perfNow()-e)/n;return s?r>=1?0:1-i(1-r):r>=1?1:i(r)},t.easedComplexLerp=function(e,n,i,s,r,o,a){var h=(t.perfNow()-e)/n;return s?i(1-h,r,o,a,n):i(h,r,o,a,n)}})(enyo,this);\n\n// ../source/dom/cordova.js\nenyo.ready(function(){(window.cordova||window.PhoneGap)&&document.addEventListener(\"deviceready\",function(t){for(var e,n=[\"pause\",\"resume\",\"online\",\"offline\",\"backbutton\",\"batterycritical\",\"batterylow\",\"batterystatus\",\"menubutton\",\"searchbutton\",\"startcallbutton\",\"endcallbutton\",\"volumedownbutton\",\"volumeupbutton\"],i=0;e=n[i];i++)document.addEventListener(e,enyo.bind(enyo.Signals,\"send\",\"on\"+e),!1);enyo.Signals.send(\"ondeviceready\",t)},!1)});\n\n// ../source/dom/page_visibility.js\n(function(t){t.ready(function(){function e(e){e=e||window.event,t.hidden=e.type in s?s[e.type]:document[n],t.visibilityState=e.type in s?s[e.type]?\"hidden\":\"visible\":document[i],t.Signals.send(\"onvisibilitychange\",t.mixin(e,{hidden:t.hidden}))}var n=\"hidden\",i=\"visibilityState\",s={};s.blur=s.focusout=s.pagehide=!0,s.focus=s.focusin=s.pageshow=!1,n in document?document.addEventListener(\"visibilitychange\",e):(n=\"mozHidden\")in document?(document.addEventListener(\"mozvisibilitychange\",e),i=\"mozVisibilityState\"):(n=\"webkitHidden\")in document?(document.addEventListener(\"webkitvisibilitychange\",e),i=\"webkitVisibilityState\"):(n=\"msHidden\")in document?(document.addEventListener(\"msvisibilitychange\",e),i=\"msVisibilityState\"):\"onfocusin\"in document?document.onfocusin=document.onfocusout=e:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=e,t.hidden=document[n]!==void 0?document[n]:!1,t.visibilityState=document[i]!==void 0?document[i]:\"visible\"})})(enyo,this);\n\n// ../source/dom/dispatcher.js\n(function(t){t.$={},t.dispatcher={events:[\"mousedown\",\"mouseup\",\"mouseover\",\"mouseout\",\"mousemove\",\"mousewheel\",\"click\",\"dblclick\",\"change\",\"keydown\",\"keyup\",\"keypress\",\"input\",\"paste\",\"copy\",\"cut\",\"webkitTransitionEnd\",\"transitionend\",\"webkitAnimationEnd\",\"animationend\",\"webkitAnimationStart\",\"animationstart\",\"webkitAnimationIteration\",\"animationiteration\"],windowEvents:[\"resize\",\"load\",\"unload\",\"message\",\"hashchange\",\"popstate\",\"focus\",\"blur\"],features:[],connect:function(){var e,n,i=t.dispatcher;for(e=0;n=i.events[e];e++)i.listen(document,n);for(e=0;n=i.windowEvents[e];e++)\"unload\"===n&&\"object\"==typeof window.chrome&&window.chrome.app||i.listen(window,n)},listen:function(e,n,i){var s=t.dispatch;this.listen=e.addEventListener?function(t,e,n){t.addEventListener(e,n||s,!1)}:function(e,n,i){e.attachEvent(\"on\"+n,function(e){return e.target=e.srcElement,e.preventDefault||(e.preventDefault=t.iePreventDefault),(i||s)(e)})},this.listen(e,n,i)},stopListening:function(e,n,i){var s=t.dispatch;this.stopListening=e.addEventListener?function(t,e,n){t.removeEventListener(e,n||s,!1)}:function(t,e,n){t.detachEvent(\"on\"+e,n||s)},this.stopListening(e,n,i)},dispatch:function(t){var e=this.findDispatchTarget(t.target)||this.findDefaultTarget();t.dispatchTarget=e;for(var n,i=0;n=this.features[i];i++)if(n.call(this,t)===!0)return;return e&&!t.preventDispatch?this.dispatchBubble(t,e):void 0},findDispatchTarget:function(e){var n,i=e;try{for(;i;){if(n=t.$[i.id]){n.eventNode=i;break}i=i.parentNode}}catch(s){t.log(s,i)}return n},findDefaultTarget:function(){return t.master},dispatchBubble:function(t,e){var n=t.type;return n=t.customEvent?n:\"on\"+n,e.bubble(n,t,e)}},t.iePreventDefault=function(){try{this.returnValue=!1}catch(t){}},t.dispatch=function(e){return t.dispatcher.dispatch(e)},t.bubble=function(e){var n=e||window.event;n&&(n.target||(n.target=n.srcElement),t.dispatch(n))},t.bubbler=\"enyo.bubble(arguments[0])\",function(){var e=function(){t.bubble(arguments[0])};t.makeBubble=function(){var n=Array.prototype.slice.call(arguments,0),i=n.shift();\"object\"==typeof i&&\"function\"==typeof i.hasNode&&t.forEach(n,function(n){this.hasNode()&&t.dispatcher.listen(this.node,n,e)},i)},t.unmakeBubble=function(){var n=Array.prototype.slice.call(arguments,0),i=n.shift();\"object\"==typeof i&&\"function\"==typeof i.hasNode&&t.forEach(n,function(n){this.hasNode()&&t.dispatcher.stopListening(this.node,n,e)},i)}}(),t.requiresWindow(t.dispatcher.connect),t.dispatcher.features.push(function(e){if(\"click\"===e.type&&0===e.clientX&&0===e.clientY&&!e.detail){var n=t.clone(e);n.type=\"tap\",n.preventDefault=t.nop,t.dispatch(n)}});var e={};t.dispatcher.features.push(function(t){(\"mousemove\"==t.type||\"tap\"==t.type||\"click\"==t.type||\"touchmove\"==t.type)&&(e.clientX=t.clientX,e.clientY=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY)}),t.getPosition=function(){var n=t.clone(e);if(9>t.platform.ie){var i=document.documentElement||document.body.parentNode||document.body;n.pageX=n.clientX+i.scrollLeft,n.pageY=n.clientY+i.scrollTop}return n}})(enyo,this);\n\n// ../source/dom/preview.js\n(function(t){var e=\"previewDomEvent\",n={feature:function(t){n.dispatch(t,t.dispatchTarget)},dispatch:function(t,n){var i,s,r=this.buildLineage(n);for(i=0;s=r[i];i++)if(s[e]&&s[e](t)===!0)return t.preventDispatch=!0,void 0},buildLineage:function(t){for(var e=[],n=t;n;)e.unshift(n),n=n.parent;return e}};t.dispatcher.features.push(n.feature)})(enyo,this);\n\n// ../source/dom/modal.js\n(function(t){t.dispatcher.features.push(function(t){if(this.captureTarget){var e=t.dispatchTarget,n=(t.customEvent?\"\":\"on\")+t.type,i=this.captureEvents[n],s=this.captureHandlerScope||this.captureTarget,r=i&&s[i],o=r&&!(e&&e.isDescendantOf&&e.isDescendantOf(this.captureTarget));if(o){var a=t.captureTarget=this.captureTarget;t.preventDispatch=r&&r.apply(s,[a,t])&&!this.autoForwardEvents[t.type]}}}),t.mixin(t.dispatcher,{autoForwardEvents:{leave:1,resize:1},captures:[],capture:function(t,e,n){var i={target:t,events:e,scope:n};this.captures.push(i),this.setCaptureInfo(i)},release:function(t){for(var e=this.captures.length-1;e>=0;e--)if(this.captures[e].target===t){this.captures.splice(e,1),this.setCaptureInfo(this.captures[this.captures.length-1]);break}},setCaptureInfo:function(t){this.captureTarget=t&&t.target,this.captureEvents=t&&t.events,this.captureHandlerScope=t&&t.scope}})})(enyo,this);\n\n// ../source/dom/gesture.js\n(function(t){t.gesture={eventProps:[\"target\",\"relatedTarget\",\"clientX\",\"clientY\",\"pageX\",\"pageY\",\"screenX\",\"screenY\",\"altKey\",\"ctrlKey\",\"metaKey\",\"shiftKey\",\"detail\",\"identifier\",\"dispatchTarget\",\"which\",\"srcEvent\"],makeEvent:function(e,n){var i={};i.type=e;for(var s,r=0;s=this.eventProps[r];r++)i[s]=n[s];if(i.srcEvent=i.srcEvent||n,i.preventDefault=this.preventDefault,i.disablePrevention=this.disablePrevention,(1!==t.dom._bodyScaleFactorX||1!==t.dom._bodyScaleFactorY)&&(\"move\"==i.type||\"up\"==i.type||\"down\"==i.type||\"enter\"==i.type||\"leave\"==i.type)&&(i.clientX*=t.dom._bodyScaleFactorX,i.clientY*=t.dom._bodyScaleFactorY),10>t.platform.ie){8==t.platform.ie&&i.target&&(i.pageX=i.clientX+i.target.scrollLeft,i.pageY=i.clientY+i.target.scrollTop);var o=window.event&&window.event.button;o&&(i.which=1&o?1:2&o?2:4&o?3:0)}else(t.platform.webos||window.PalmSystem)&&0===i.which&&(i.which=1);return i},down:function(e){var n=this.makeEvent(\"down\",e);this.drag.prepareHold(n),n.preventTap=function(){n._tapPrevented=!0},t.dispatch(n),this.downEvent=n,this.drag.beginHold(n)},move:function(e){var n=this.makeEvent(\"move\",e);n.dx=n.dy=n.horizontal=n.vertical=0,n.which&&this.downEvent&&(n.dx=e.clientX-this.downEvent.clientX,n.dy=e.clientY-this.downEvent.clientY,n.horizontal=Math.abs(n.dx)>Math.abs(n.dy),n.vertical=!n.horizontal),t.dispatch(n)},up:function(e){var n=this.makeEvent(\"up\",e);if(n._tapPrevented=this.downEvent&&this.downEvent._tapPrevented&&this.downEvent.which==n.which,n.preventTap=function(){n._tapPrevented=!0},t.dispatch(n),!n._tapPrevented&&this.downEvent&&1==this.downEvent.which){var i=this.findCommonAncestor(this.downEvent.target,e.target);i&&(this.supportsDoubleTap(i)?this.doubleTap(n,i):this.sendTap(n,i))}this.downEvent&&this.downEvent.which==n.which&&(this.downEvent=null)},over:function(e){var n=this.makeEvent(\"enter\",e);t.dispatch(n)},out:function(e){var n=this.makeEvent(\"leave\",e);t.dispatch(n)},sendTap:function(e,n){var i=this.makeEvent(\"tap\",e);i.target=n,t.dispatch(i)},tapData:{id:null,timer:null,start:0},doubleTapEnabled:!1,supportsDoubleTap:function(e){var n=t.dispatcher.findDispatchTarget(e);return n?this.doubleTapEnabled?!!n.doubleTapEnabled:n.doubleTapEnabled===!0:!1},doubleTap:function(e,n){var i=t.dispatcher.findDispatchTarget(n);if(this.tapData.id!==i.id)this.resetTapData(!0),this.tapData.id=i.id,this.tapData.event=e,this.tapData.target=n,this.tapData.timer=setTimeout(t.bind(this,\"resetTapData\",!0),i.doubleTapInterval),this.tapData.start=t.perfNow();else{var s=this.makeEvent(\"doubletap\",e);s.target=n,s.tapInterval=t.perfNow()-this.tapData.start,this.resetTapData(!1),t.dispatch(s)}},resetTapData:function(t){var e=this.tapData;t&&e.id&&this.sendTap(e.event,e.target),clearTimeout(e.timer),e.id=e.start=e.event=e.target=e.timer=null},findCommonAncestor:function(t,e){for(var n=e;n;){if(this.isTargetDescendantOf(t,n))return n;n=n.parentNode}},isTargetDescendantOf:function(t,e){for(var n=t;n;){if(n==e)return!0;n=n.parentNode}}},t.gesture.preventDefault=function(){this.srcEvent&&this.srcEvent.preventDefault()},t.gesture.disablePrevention=function(){this.preventDefault=t.nop,this.srcEvent&&(this.srcEvent.preventDefault=t.nop)},t.dispatcher.features.push(function(e){return t.gesture.events[e.type]?t.gesture.events[e.type](e):void 0}),t.gesture.events={mousedown:function(e){t.gesture.down(e)},mouseup:function(e){t.gesture.up(e)},mousemove:function(e){t.gesture.move(e)},mouseover:function(e){t.gesture.over(e)},mouseout:function(e){t.gesture.out(e)}},t.requiresWindow(function(){document.addEventListener&&document.addEventListener(\"DOMMouseScroll\",function(e){var n=t.clone(e);n.preventDefault=function(){e.preventDefault()},n.type=\"mousewheel\";var i=n.VERTICAL_AXIS==n.axis?\"wheelDeltaY\":\"wheelDeltaX\";n[i]=-40*n.detail,t.dispatch(n)},!1)})})(enyo,this);\n\n// ../source/dom/drag.js\n(function(t){t.dispatcher.features.push(function(e){return t.gesture.drag[e.type]?t.gesture.drag[e.type](e):void 0}),t.gesture.drag={holdPulseDefaultConfig:{frequency:200,events:[{name:\"hold\",time:200}],resume:!1,moveTolerance:16,endHold:\"onMove\"},configureHoldPulse:function(t){this.holdPulseDefaultConfig=t},holdPulseConfig:{},trackCount:5,minFlick:.1,minTrack:8,down:function(t){this.stopDragging(t),this.target=t.target,this.startTracking(t)},move:function(t){if(this.tracking){if(this.track(t),!t.which)return this.stopDragging(t),this.endHold(),this.tracking=!1,void 0;this.dragEvent?this.sendDrag(t):\"onMove\"===this.holdPulseConfig.endHold&&(this.dy*this.dy+this.dx*this.dx>=this.holdPulseConfig.moveTolerance?this.holdJob&&(this.holdPulseConfig.resume?this.suspendHold():(this.endHold(),this.sendDragStart(t))):this.holdPulseConfig.resume&&!this.holdJob&&this.resumeHold())}},up:function(t){this.endTracking(t),this.stopDragging(t),this.endHold(),this.target=null},enter:function(t){this.holdPulseConfig.resume&&\"onLeave\"===this.holdPulseConfig.endHold&&this.target&&t.target===this.target&&this.resumeHold()},leave:function(t){this.dragEvent?this.sendDragOut(t):\"onLeave\"===this.holdPulseConfig.endHold&&(this.holdPulseConfig.resume?this.suspendHold():(this.endHold(),this.sendDragStart(t)))},stopDragging:function(t){if(this.dragEvent){this.sendDrop(t);var e=this.sendDragFinish(t);return this.dragEvent=null,e}},makeDragEvent:function(e,n,i,s){var r=Math.abs(this.dx),o=Math.abs(this.dy),a=r>o,h=.414>(a?o/r:r/o),c={};return c.type=e,c.dx=this.dx,c.dy=this.dy,c.ddx=this.dx-this.lastDx,c.ddy=this.dy-this.lastDy,c.xDirection=this.xDirection,c.yDirection=this.yDirection,c.pageX=i.pageX,c.pageY=i.pageY,c.clientX=i.clientX,c.clientY=i.clientY,c.horizontal=a,c.vertical=!a,c.lockable=h,c.target=n,c.dragInfo=s,c.ctrlKey=i.ctrlKey,c.altKey=i.altKey,c.metaKey=i.metaKey,c.shiftKey=i.shiftKey,c.srcEvent=i.srcEvent,8==t.platform.ie&&c.target&&(c.pageX=c.clientX+c.target.scrollLeft,c.pageY=c.clientY+c.target.scrollTop),c.preventDefault=t.gesture.preventDefault,c.disablePrevention=t.gesture.disablePrevention,c},sendDragStart:function(e){this.dragEvent=this.makeDragEvent(\"dragstart\",this.target,e),t.dispatch(this.dragEvent)},sendDrag:function(e){var n=this.makeDragEvent(\"dragover\",e.target,e,this.dragEvent.dragInfo);t.dispatch(n),n.type=\"drag\",n.target=this.dragEvent.target,t.dispatch(n)},sendDragFinish:function(e){var n=this.makeDragEvent(\"dragfinish\",this.dragEvent.target,e,this.dragEvent.dragInfo);n.preventTap=function(){e.preventTap&&e.preventTap()},t.dispatch(n)},sendDragOut:function(e){var n=this.makeDragEvent(\"dragout\",e.target,e,this.dragEvent.dragInfo);t.dispatch(n)},sendDrop:function(e){var n=this.makeDragEvent(\"drop\",e.target,e,this.dragEvent.dragInfo);n.preventTap=function(){e.preventTap&&e.preventTap()},t.dispatch(n)},startTracking:function(t){this.tracking=!0,this.px0=t.clientX,this.py0=t.clientY,this.flickInfo={},this.flickInfo.startEvent=t,this.flickInfo.moves=[],this.track(t)},track:function(e){this.lastDx=this.dx,this.lastDy=this.dy,this.dx=e.clientX-this.px0,this.dy=e.clientY-this.py0,this.xDirection=this.calcDirection(this.dx-this.lastDx,0),this.yDirection=this.calcDirection(this.dy-this.lastDy,0);var n=this.flickInfo;n.moves.push({x:e.clientX,y:e.clientY,t:t.perfNow()}),n.moves.length>this.trackCount&&n.moves.shift()},endTracking:function(){this.tracking=!1;var e=this.flickInfo,n=e&&e.moves;if(n&&n.length>1){for(var i,s=n[n.length-1],r=t.perfNow(),o=n.length-2,a=0,h=0,c=0,u=0,l=0,d=0,f=0;i=n[o];o--)a=r-i.t,h=(s.x-i.x)/a,c=(s.y-i.y)/a,d=d||(0>h?-1:h>0?1:0),f=f||(0>c?-1:c>0?1:0),(h*d>u*d||c*f>l*f)&&(u=h,l=c);var p=Math.sqrt(u*u+l*l);p>this.minFlick&&this.sendFlick(e.startEvent,u,l,p)}this.flickInfo=null},calcDirection:function(t,e){return t>0?1:0>t?-1:e},normalizeHoldPulseConfig:function(e){var n=t.clone(e);return n.frequency=n.delay,n.events=[{name:\"hold\",time:n.delay}],n},_configureHoldPulse:function(e){var n=void 0===e.delay?e:this.normalizeHoldPulseConfig(e);t.mixin(this.holdPulseConfig,n)},prepareHold:function(e){this.holdPulseConfig=t.clone(this.holdPulseDefaultConfig,!0),e.configureHoldPulse=this._configureHoldPulse.bind(this)},beginHold:function(e){var n;this.endHold(),this.holdStart=t.perfNow(),this._holdJobFunction=t.bind(this,\"handleHoldPulse\"),n=this._holdJobEvent=t.clone(e),n.srcEvent=t.clone(e.srcEvent),this._pulsing=!1,this._unsent=t.clone(this.holdPulseConfig.events),this._unsent.sort(this.sortEvents),this._next=this._unsent.shift(),this._next&&(this.holdJob=setInterval(this._holdJobFunction,this.holdPulseConfig.frequency))},resumeHold:function(){this.handleHoldPulse(),this.holdJob=setInterval(this._holdJobFunction,this.holdPulseConfig.frequency)},sortEvents:function(t,e){return t.time<e.time?-1:t.time>e.time?1:0},endHold:function(){var t=this._holdJobEvent;this.suspendHold(),t&&this._pulsing&&this.sendRelease(t),this._pulsing=!1,this._unsent=null,this._holdJobFunction=null,this._holdJobEvent=null,this._next=null},suspendHold:function(){clearInterval(this.holdJob),this.holdJob=null},handleHoldPulse:function(){var e,n=t.perfNow()-this.holdStart,i=this._holdJobEvent;this.maybeSendHold(i,n),this._pulsing&&(e=t.gesture.makeEvent(\"holdpulse\",i),e.holdTime=n,t.dispatch(e))},maybeSendHold:function(e,n){for(var i=this._next;i&&n>=i.time;){var s=t.gesture.makeEvent(i.name,e);this._pulsing=!0,t.dispatch(s),i=this._next=this._unsent.shift()}},sendRelease:function(e){var n=t.gesture.makeEvent(\"release\",e);t.dispatch(n)},sendFlick:function(e,n,i,s){var r=t.gesture.makeEvent(\"flick\",e);r.xVelocity=n,r.yVelocity=i,r.velocity=s,t.dispatch(r)}}})(enyo,this);\n\n// ../source/dom/transition.js\n(function(t){t.dom.transition=t.platform.ios||t.platform.android||t.platform.chrome||t.platform.androidChrome||t.platform.safari?\"-webkit-transition\":t.platform.firefox||t.platform.firefoxOS||t.platform.androidFirefox?\"-moz-transition\":\"transition\"})(enyo,this);\n\n// ../source/dom/keymap.js\n(function(t){t.dispatcher.features.push(function(t){if(\"keydown\"===t.type||\"keyup\"===t.type||\"keypress\"===t.type){t.keySymbol=this.keyMap[t.keyCode];var e=this.findDefaultTarget();t.dispatchTarget!==e&&this.dispatchBubble(t,e)}}),t.mixin(t.dispatcher,{keyMap:{},registerKeyMap:function(e){t.mixin(this.keyMap,e)}})})(enyo,this);\n\n// ../source/touch/touch.js\n(function(t){t.requiresWindow(function(){var e=t.gesture,n=e.events;e.events.touchstart=function(t){e.events=i,e.events.touchstart(t)};var i={_touchCount:0,touchstart:function(t){this._touchCount+=t.changedTouches.length,this.excludedTarget=null;var n=this.makeEvent(t);this.currentIdentifier=n.identifier,e.down(n),n=this.makeEvent(t),this.overEvent=n,e.over(n)},touchmove:function(n){t.job.stop(\"resetGestureEvents\");var i=e.drag.dragEvent;this.excludedTarget=i&&i.dragInfo&&i.dragInfo.node;var s=this.makeEvent(n);this.currentIdentifier===s.identifier&&(e.move(s),t.bodyIsFitting&&n.preventDefault(),this.overEvent&&this.overEvent.target!=s.target&&(this.overEvent.relatedTarget=s.target,s.relatedTarget=this.overEvent.target,e.out(this.overEvent),e.over(s)),this.overEvent=s)},touchend:function(t){e.up(this.makeEvent(t)),e.out(this.overEvent),this._touchCount-=t.changedTouches.length},mouseup:function(){0===this._touchCount&&(this.sawMousedown=!1,e.events=n)},makeEvent:function(e){var n=t.clone(e.changedTouches[0]);return n.srcEvent=e,n.target=this.findTarget(n),n.which=1,n},calcNodeOffset:function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect();return{left:e.left,top:e.top,width:e.width,height:e.height}}},findTarget:function(t){return document.elementFromPoint(t.clientX,t.clientY)},findTargetTraverse:function(t,e,n){var i=t||document.body,s=this.calcNodeOffset(i);if(s&&i!=this.excludedTarget){var r=e-s.left,o=n-s.top;if(r>0&&o>0&&s.width>=r&&s.height>=o){for(var a,h,c=i.childNodes,u=c.length-1;h=c[u];u--)if(a=this.findTargetTraverse(h,e,n))return a;return i}}},connect:function(){t.forEach([\"touchstart\",\"touchmove\",\"touchend\",\"gesturestart\",\"gesturechange\",\"gestureend\"],function(e){9>t.platform.ie?document[\"on\"+e]=t.dispatch:document.addEventListener(e,t.dispatch,!1)}),18>=t.platform.androidChrome||2===t.platform.silk?this.findTarget=function(t){return document.elementFromPoint(t.screenX,t.screenY)}:document.elementFromPoint||(this.findTarget=function(t){return this.findTargetTraverse(null,t.clientX,t.clientY)})}};i.connect()})})(enyo,this);\n\n// ../source/touch/msevents.js\n(function(t){var e;if(window.navigator.pointerEnabled?e=[\"pointerdown\",\"pointerup\",\"pointermove\",\"pointerover\",\"pointerout\",\"pointercancel\"]:window.navigator.msPointerEnabled&&(e=[\"MSPointerDown\",\"MSPointerUp\",\"MSPointerMove\",\"MSPointerOver\",\"MSPointerOut\",\"MSPointerCancel\"]),e){var n=function(e){var n=t.clone(e);return n.srcEvent=e,n.which=e.buttons||1,n},i=t.gesture;t.gesture.events={};var r={pointerdown:function(t){var e=n(t);i.down(e)},pointerup:function(t){var e=n(t);i.up(e)},pointermove:function(t){var e=n(t);i.move(e)},pointercancel:function(t){var e=n(t);i.up(e)},pointerover:function(t){var e=n(t);i.over(e)},pointerout:function(t){var e=n(t);i.out(e)}};!window.navigator.pointerEnabled&&window.navigator.msPointerEnabled&&(r.MSPointerDown=r.pointerdown,r.MSPointerUp=r.pointerup,r.MSPointerMove=r.pointermove,r.MSPointerCancel=r.pointercancel,r.MSPointerOver=r.pointerover,r.MSPointerOut=r.pointerout),t.forEach(e,function(e){t.dispatcher.listen(document,e)}),t.dispatcher.features.push(function(t){r[t.type]&&t.isPrimary&&r[t.type](t)})}})(enyo,this);\n\n// ../source/touch/gesture.js\n(function(t){!t.platform.gesture&&t.platform.touch&&t.dispatcher.features.push(function(t){e[t.type]&&n[t.type](t)});var e={touchstart:!0,touchmove:!0,touchend:!0},n={orderedTouches:[],gesture:null,touchstart:function(e){var n,i=e.changedTouches,r=i.length;for(n=0;r>n;n++){var s=i[n].identifier;0>t.indexOf(s,this.orderedTouches)&&this.orderedTouches.push(s)}if(e.touches.length>=2&&!this.gesture){var o=this.gesturePositions(e);this.gesture=this.gestureVector(o),this.gesture.angle=this.gestureAngle(o),this.gesture.scale=1,this.gesture.rotation=0;var a=this.makeGesture(\"gesturestart\",e,{vector:this.gesture,scale:1,rotation:0});t.dispatch(a)}},touchend:function(e){var n,i=e.changedTouches,r=i.length;for(n=0;r>n;n++)t.remove(i[n].identifier,this.orderedTouches);if(1>=e.touches.length&&this.gesture){var s=e.touches[0]||e.changedTouches[e.changedTouches.length-1];t.dispatch(this.makeGesture(\"gestureend\",e,{vector:{xcenter:s.pageX,ycenter:s.pageY},scale:this.gesture.scale,rotation:this.gesture.rotation})),this.gesture=null}},touchmove:function(e){if(this.gesture){var n=this.makeGesture(\"gesturechange\",e);this.gesture.scale=n.scale,this.gesture.rotation=n.rotation,t.dispatch(n)}},findIdentifiedTouch:function(t,e){for(var n,i=0;n=t[i];i++)if(n.identifier===e)return n},gesturePositions:function(t){var e=this.findIdentifiedTouch(t.touches,this.orderedTouches[0]),n=this.findIdentifiedTouch(t.touches,this.orderedTouches[this.orderedTouches.length-1]),i=e.pageX,r=n.pageX,s=e.pageY,o=n.pageY,a=r-i,h=o-s,u=Math.sqrt(a*a+h*h);return{x:a,y:h,h:u,fx:i,lx:r,fy:s,ly:o}},gestureAngle:function(t){var e=t,n=Math.asin(e.y/e.h)*(180/Math.PI);return 0>e.x&&(n=180-n),e.x>0&&0>e.y&&(n+=360),n},gestureVector:function(t){var e=t;return{magnitude:e.h,xcenter:Math.abs(Math.round(e.fx+e.x/2)),ycenter:Math.abs(Math.round(e.fy+e.y/2))}},makeGesture:function(e,n,i){var r,s,o;if(i)r=i.vector,s=i.scale,o=i.rotation;else{var a=this.gesturePositions(n);r=this.gestureVector(a),s=r.magnitude/this.gesture.magnitude,o=(360+this.gestureAngle(a)-this.gesture.angle)%360}var h=t.clone(n);return t.mixin(h,{type:e,scale:s,pageX:r.xcenter,pageY:r.ycenter,rotation:o})}}})(enyo,this);\n\n// ../source/touch/ScrollMath.js\n(function(t){t.kind({name:\"enyo.ScrollMath\",kind:\"enyo.Component\",published:{vertical:!0,horizontal:!0},events:{onScrollStart:\"\",onScroll:\"\",onScrollStop:\"\",onStabilize:\"\"},kSpringDamping:.93,kDragDamping:.5,kFrictionDamping:.97,kSnapFriction:.9,kFlickScalar:15,kMaxFlick:t.platform.android>2?2:1e9,kFrictionEpsilon:t.platform.webos>=4?.1:.01,topBoundary:0,rightBoundary:0,bottomBoundary:0,leftBoundary:0,interval:20,fixedTime:!0,x0:0,x:0,y0:0,y:0,destroy:t.inherit(function(t){return function(){this.stop(),t.apply(this,arguments)}}),verlet:function(){var t=this.x;this.x+=t-this.x0,this.x0=t;var e=this.y;this.y+=e-this.y0,this.y0=e},damping:function(t,e,n,i){var s=.5,r=t-e;return s>Math.abs(r)?e:t*i>e*i?n*r+e:t},boundaryDamping:function(t,e,n,i){return this.damping(this.damping(t,e,i,1),n,i,-1)},constrain:function(){var t=this.boundaryDamping(this.y,this.topBoundary,this.bottomBoundary,this.kSpringDamping);t!=this.y&&(this.y0=t-(this.y-this.y0)*this.kSnapFriction,this.y=t);var e=this.boundaryDamping(this.x,this.leftBoundary,this.rightBoundary,this.kSpringDamping);e!=this.x&&(this.x0=e-(this.x-this.x0)*this.kSnapFriction,this.x=e)},friction:function(t,e,n){var i=this[t]-this[e],s=Math.abs(i)>this.kFrictionEpsilon?n:0;this[t]=this[e]+s*i},frame:10,simulate:function(t){for(;t>=this.frame;)t-=this.frame,this.dragging||this.constrain(),this.verlet(),this.friction(\"y\",\"y0\",this.kFrictionDamping),this.friction(\"x\",\"x0\",this.kFrictionDamping);return t},animate:function(){this.stop();var e,n,i=t.perfNow(),s=0,r=this.bindSafely(function(){var o=t.perfNow();this.job=t.requestAnimationFrame(r);var a=o-i;i=o,this.dragging&&(this.y0=this.y=this.uy,this.x0=this.x=this.ux,this.endX=this.endY=null),s+=Math.max(16,a),this.isInOverScroll()?(this.endX=null,this.endY=null):this.fixedTime&&(s=this.interval),s=this.simulate(s),n!=this.y||e!=this.x?this.scroll():this.dragging||(null!=this.endX&&(this.x=this.x0=this.endX),null!=this.endY&&(this.y=this.y0=this.endY),this.stop(),this.scroll(),this.doScrollStop(),this.endX=null,this.endY=null),n=this.y,e=this.x});this.job=t.requestAnimationFrame(r)},start:function(){this.job||(this.doScrollStart(),this.animate())},stop:function(e){var n=this.job;n&&(this.job=t.cancelRequestAnimationFrame(n)),e&&(this.doScrollStop(),this.endX=void 0,this.endY=void 0)},stabilize:function(t){var e=!t||void 0===t.fire||t.fire,n=Math.min(this.topBoundary,Math.max(this.bottomBoundary,this.y)),i=Math.min(this.leftBoundary,Math.max(this.rightBoundary,this.x));(n!=this.y||i!=this.x)&&(this.y=this.y0=n,this.x=this.x0=i,e&&this.doStabilize())},startDrag:function(t){this.dragging=!0,this.my=t.pageY,this.py=this.uy=this.y,this.mx=t.pageX,this.px=this.ux=this.x},drag:function(t){var e,n,i,s;return this.dragging?(i=this.canScrollY(),s=this.canScrollX(),e=i?t.pageY-this.my:0,this.uy=e+this.py,this.uy=this.boundaryDamping(this.uy,this.topBoundary,this.bottomBoundary,this.kDragDamping),n=s?t.pageX-this.mx:0,this.ux=n+this.px,this.ux=this.boundaryDamping(this.ux,this.leftBoundary,this.rightBoundary,this.kDragDamping),this.start(),!0):void 0},dragDrop:function(){if(this.dragging&&!window.PalmSystem){var t=.5;this.y=this.uy,this.y0=this.y-(this.y-this.y0)*t,this.x=this.ux,this.x0=this.x-(this.x-this.x0)*t}this.dragFinish()},dragFinish:function(){this.dragging=!1},flick:function(t){var e;this.canScrollY()&&(e=t.yVelocity>0?Math.min(this.kMaxFlick,t.yVelocity):Math.max(-this.kMaxFlick,t.yVelocity),this.y=this.y0+e*this.kFlickScalar),this.canScrollX()&&(e=t.xVelocity>0?Math.min(this.kMaxFlick,t.xVelocity):Math.max(-this.kMaxFlick,t.xVelocity),this.x=this.x0+e*this.kFlickScalar),this.start()},mousewheel:function(t){var e=this.vertical?t.wheelDeltaY||(t.wheelDeltaX?0:t.wheelDelta):0,n=this.horizontal?t.wheelDeltaX:0,i=!1;return(e>0&&this.y<this.topBoundary||0>e&&this.y>this.bottomBoundary)&&(this.y=this.y0=this.y0+e,i=!0),(n>0&&this.x<this.leftBoundary||0>n&&this.x>this.rightBoundary)&&(this.x=this.x0=this.x0+n,i=!0),this.stop(!i),i?(this.start(),!0):void 0},newMousewheel:function(t){var e=void 0===t.wheelDeltaY?t.wheelDelta:t.wheelDeltaY,n=e,i=t.wheelDeltaX,s=this.canScrollY(),r=this.canScrollX(),o=!1,a=2,h=this.isScrolling(),u=this.isInOverScroll(),c=h&&null!==this.endY?this.endY:this.y,l=h&&null!==this.endX?this.endX:this.x,d=c,f=l;return u?!0:(n&&!i&&r&&!s&&(i=n,n=0),n&&s&&(d=-(c+n*a),o=!0),i&&r&&(f=-(l+i*a),o=!0),o?(this.scrollTo(f,d,{allowOverScroll:!0}),!0):void 0)},scroll:function(){this.doScroll()},scrollTo:function(t,e,n){var i=!n||\"instant\"!==n.behavior,s=n&&n.allowOverScroll,r=Math.abs(Math.min(0,this.rightBoundary)),o=Math.abs(Math.min(0,this.bottomBoundary));i&&s||(t=Math.max(0,Math.min(t,r)),e=Math.max(0,Math.min(e,o))),(-t!=this.x||-e!=this.y)&&(i?(null!==e&&(this.endY=-e,this.y=this.y0-(e+this.y0)*(1-this.kFrictionDamping)),null!==t&&(this.endX=-t,this.x=this.x0-(t+this.x0)*(1-this.kFrictionDamping)),this.start()):(this.doScrollStart(),this.setScrollX(-t),this.setScrollY(-e),this.doScroll(),this.doScrollStop()))},setScrollX:function(t){this.x=this.x0=t},setScrollY:function(t){this.y=this.y0=t},setScrollPosition:function(t){this.setScrollY(t)},isScrolling:function(){return Boolean(this.job)},canScrollX:function(){return this.horizontal&&0>this.rightBoundary},canScrollY:function(){return this.vertical&&0>this.bottomBoundary},isInOverScroll:function(){return this.job&&(this.x>this.leftBoundary||this.x<this.rightBoundary||this.y>this.topBoundary||this.y<this.bottomBoundary)}})})(enyo,this);\n\n// ../source/touch/ScrollStrategy.js\n(function(t){t.kind({name:\"enyo.ScrollStrategy\",tag:null,published:{vertical:\"default\",horizontal:\"default\",scrollLeft:0,scrollTop:0,maxHeight:null,useMouseWheel:!0},events:{onScrollStart:\"\",onScrollStop:\"\"},handlers:{ondragstart:\"dragstart\",ondragfinish:\"dragfinish\",ondown:\"down\",onmove:\"move\",onmousewheel:\"mousewheel\",onscroll:\"domScroll\"},create:t.inherit(function(t){return function(){t.apply(this,arguments),this.horizontalChanged(),this.verticalChanged(),this.maxHeightChanged()}}),rendered:t.inherit(function(e){return function(){e.apply(this,arguments),t.makeBubble(this.container,\"scroll\"),this.scrollNode=this.calcScrollNode()}}),teardownRender:t.inherit(function(t){return function(){t.apply(this,arguments),this.scrollNode=null}}),calcScrollNode:function(){return this.container.hasNode()},horizontalChanged:function(){this.container.applyStyle(\"overflow-x\",\"default\"==this.horizontal?\"auto\":this.horizontal)},verticalChanged:function(){this.container.applyStyle(\"overflow-y\",\"default\"==this.vertical?\"auto\":this.vertical)},maxHeightChanged:function(){this.container.applyStyle(\"max-height\",this.maxHeight)},scrollTo:function(t,e){this.scrollNode&&(this.setScrollLeft(t),this.setScrollTop(e))},scrollToNode:function(t,e){if(this.scrollNode){for(var n=this.getScrollBounds(),i=t,s={height:i.offsetHeight,width:i.offsetWidth,top:0,left:0};i&&i.parentNode&&i.id!=this.scrollNode.id;)s.top+=i.offsetTop,s.left+=i.offsetLeft,i=i.parentNode;this.setScrollTop(Math.min(n.maxTop,e===!1?s.top-n.clientHeight+s.height:s.top)),this.setScrollLeft(Math.min(n.maxLeft,e===!1?s.left-n.clientWidth+s.width:s.left))}},scrollIntoView:function(t,e){t.hasNode()&&t.node.scrollIntoView(e)},isInView:function(t){var e=this.getScrollBounds(),n=t.offsetTop,i=t.offsetHeight,s=t.offsetLeft,o=t.offsetWidth;return n>=e.top&&e.top+e.clientHeight>=n+i&&s>=e.left&&e.left+e.clientWidth>=s+o},setScrollTop:function(t){this.scrollTop=t,this.scrollNode&&(this.scrollNode.scrollTop=this.scrollTop)},setScrollLeft:function(t){this.scrollLeft=t,this.scrollNode&&(this.scrollNode.scrollLeft=this.scrollLeft)},getScrollLeft:function(){return this.scrollNode?this.scrollNode.scrollLeft:this.scrollLeft},getScrollTop:function(){return this.scrollNode?this.scrollNode.scrollTop:this.scrollTop},_getScrollBounds:function(){var t=this.getScrollSize(),e=this.container.hasNode(),n={left:this.getScrollLeft(),top:this.getScrollTop(),clientHeight:e?e.clientHeight:0,clientWidth:e?e.clientWidth:0,height:t.height,width:t.width};return n.maxLeft=Math.max(0,n.width-n.clientWidth),n.maxTop=Math.max(0,n.height-n.clientHeight),n},getScrollSize:function(){var t=this.scrollNode;return{width:t?t.scrollWidth:0,height:t?t.scrollHeight:0}},getScrollBounds:function(){return this._getScrollBounds()},calcStartInfo:function(){var t=this.getScrollBounds(),e=this.getScrollTop(),n=this.getScrollLeft();this.canVertical=t.maxTop>0&&\"hidden\"!=this.vertical,this.canHorizontal=t.maxLeft>0&&\"hidden\"!=this.horizontal,this.startEdges={top:0===e,bottom:e===t.maxTop,left:0===n,right:n===t.maxLeft}},shouldDrag:function(t){var e=t.vertical;return e&&this.canVertical||!e&&this.canHorizontal},dragstart:function(t,e){return this.dragging=this.shouldDrag(e),this.dragging?this.preventDragPropagation:void 0},dragfinish:function(t,e){this.dragging&&(this.dragging=!1,e.preventTap())},down:function(t,e){this.isScrolling()&&e.preventTap(),this.calcStartInfo()},move:function(t,e){e.which&&(this.canVertical&&e.vertical||this.canHorizontal&&e.horizontal)&&e.disablePrevention()},mousewheel:function(t,e){this.useMouseWheel||e.preventDefault()},domScroll:function(){this._scrolling||this.doScrollStart(),this._scrolling=!0,this.startJob(\"stopScrolling\",function(){this._scrolling=!1,this.doScrollStop()},100)},isScrolling:function(){return this._scrolling}})})(enyo,this);\n\n// ../source/touch/Thumb.js\n(function(t){t.kind({name:\"enyo.ScrollThumb\",axis:\"v\",minSize:4,cornerSize:6,classes:\"enyo-thumb\",create:t.inherit(function(e){return function(){e.apply(this,arguments);var n=\"v\"==this.axis;this.dimension=n?\"height\":\"width\",this.offset=n?\"top\":\"left\",this.translation=n?\"translateY\":\"translateX\",this.positionMethod=n?\"getScrollTop\":\"getScrollLeft\",this.sizeDimension=n?\"clientHeight\":\"clientWidth\",this.addClass(\"enyo-\"+this.axis+\"thumb\"),this.transform=t.dom.canTransform(),t.dom.canAccelerate()&&t.dom.transformValue(this,\"translateZ\",0)}}),sync:function(t){this.scrollBounds=t._getScrollBounds(),this.update(t)},update:function(e){if(this.showing){var n=this.dimension,i=this.offset,s=this.scrollBounds[this.sizeDimension],o=this.scrollBounds[n],r=0,a=0,h=0;if(s>=o)return this.hide(),void 0;e.isOverscrolling()&&(h=e.getOverScrollBounds()[\"over\"+i],r=Math.abs(h),a=Math.max(h,0));var c=e[this.positionMethod]()-h,u=s-this.cornerSize,l=Math.floor(s*s/o-r);l=Math.max(this.minSize,l);var d=Math.floor(u*c/o+a);d=Math.max(0,Math.min(u-this.minSize,d)),this.needed=s>l,this.needed&&this.hasNode()?(this._pos!==d&&(this._pos=d,this.transform?t.dom.transformValue(this,this.translation,d+\"px\"):\"v\"==this.axis?this.setBounds({top:d+\"px\"}):this.setBounds({left:d+\"px\"})),this._size!==l&&(this._size=l,this.applyStyle(n,l+\"px\"))):this.hide()}},setShowing:function(t){if(!(t&&t!=this.showing&&this.scrollBounds[this.sizeDimension]>=this.scrollBounds[this.dimension])&&(this.hasNode()&&this.cancelDelayHide(),t!=this.showing)){var e=this.showing;this.showing=t,this.showingChanged(e)}},delayHide:function(t){this.showing&&this.startJob(\"hide\",this.hide,t||0)},cancelDelayHide:function(){this.stopJob(\"hide\")}})})(enyo,this);\n\n// ../source/touch/TouchScrollStrategy.js\n(function(t){t.kind({name:\"enyo.TouchScrollStrategy\",kind:\"enyo.ScrollStrategy\",overscroll:!0,preventDragPropagation:!0,published:{vertical:\"default\",horizontal:\"default\",thumb:!0,scrim:!1,dragDuringGesture:!0,interval:20,fixedTime:!0,frame:10,preventDefault:!0},events:{onShouldDrag:\"\"},handlers:{onflick:\"flick\",onShouldDrag:\"shouldDrag\",ondrag:\"drag\"},tools:[{kind:\"ScrollMath\",onScrollStart:\"scrollMathStart\",onScroll:\"scrollMathScroll\",onScrollStop:\"scrollMathStop\",onStabilize:\"scrollMathStabilize\"},{name:\"vthumb\",kind:\"ScrollThumb\",axis:\"v\",showing:!1},{name:\"hthumb\",kind:\"ScrollThumb\",axis:\"h\",showing:!1}],scrimTools:[{name:\"scrim\",classes:\"enyo-fit\",style:\"z-index: 1;\",showing:!1}],components:[{name:\"client\",classes:\"enyo-touch-scroller\"}],listReordering:!1,create:t.inherit(function(e){return function(){e.apply(this,arguments),this.transform=t.dom.canTransform(),this.transform||this.overscroll&&this.$.client.applyStyle(\"position\",\"relative\"),this.accel=t.dom.canAccelerate();var n=\"enyo-touch-strategy-container\";t.platform.ios&&this.accel&&(n+=\" enyo-composite\"),this.scrimChanged(),this.intervalChanged(),this.fixedTimeChanged(),this.frameChanged(),this.container.addClass(n),this.translation=this.accel?\"translate3d\":\"translate\"}}),initComponents:t.inherit(function(t){return function(){this.createChrome(this.tools),t.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){this.container.removeClass(\"enyo-touch-strategy-container\"),t.apply(this,arguments)}}),rendered:t.inherit(function(e){return function(){e.apply(this,arguments),t.makeBubble(this.$.client,\"scroll\"),this.calcBoundaries(),this.syncScrollMath(),this.thumb&&this.alertThumbs()}}),scrimChanged:function(){this.scrim&&!this.$.scrim&&this.makeScrim(),!this.scrim&&this.$.scrim&&this.$.scrim.destroy()},makeScrim:function(){var t=this.controlParent;this.controlParent=null,this.createChrome(this.scrimTools),this.controlParent=t;var e=this.container.hasNode();e&&(this.$.scrim.parentNode=e,this.$.scrim.render())},isScrolling:function(){var t=this.$.scrollMath;return t?t.isScrolling():this.scrolling},isOverscrolling:function(){var t=this.$.scrollMath||this;return this.overscroll?Boolean(t.isInOverScroll()):!1},domScroll:function(){this.isScrolling()||(this.calcBoundaries(),this.syncScrollMath(),this.thumb&&this.alertThumbs())},horizontalChanged:function(){this.$.scrollMath.horizontal=\"hidden\"!=this.horizontal},verticalChanged:function(){this.$.scrollMath.vertical=\"hidden\"!=this.vertical},maxHeightChanged:function(){this.$.client.applyStyle(\"max-height\",this.maxHeight),this.$.client.addRemoveClass(\"enyo-scrollee-fit\",!this.maxHeight)},thumbChanged:function(){this.hideThumbs()},intervalChanged:function(){this.$.scrollMath&&(this.$.scrollMath.interval=this.interval)},fixedTimeChanged:function(){this.$.scrollMath&&(this.$.scrollMath.fixedTime=this.fixedTime)},frameChanged:function(){this.$.scrollMath&&(this.$.scrollMath.frame=this.frame)},stop:function(t){this.isScrolling()&&this.$.scrollMath.stop(t)},stabilize:function(){this.$.scrollMath&&this.$.scrollMath.stabilize()},scrollTo:function(t,e){this.stop(!0),this.$.scrollMath.scrollTo(t,e||0===e?e:null)},scrollIntoView:t.inherit(function(t){return function(){this.stop(!0),t.apply(this,arguments)}}),setScrollLeft:t.inherit(function(t){return function(){this.stop(!0),t.apply(this,arguments)}}),setScrollTop:t.inherit(function(t){return function(){this.stop(!0),t.apply(this,arguments)}}),getScrollLeft:t.inherit(function(t){return function(){return this.isScrolling()?this.scrollLeft:t.apply(this,arguments)}}),getScrollTop:t.inherit(function(t){return function(){return this.isScrolling()?this.scrollTop:t.apply(this,arguments)}}),calcScrollNode:function(){return this.$.client.hasNode()},calcAutoScrolling:function(){var t=\"auto\"==this.vertical,e=\"auto\"==this.horizontal||\"default\"==this.horizontal;if((t||e)&&this.scrollNode){var n=this.getScrollBounds();t&&(this.$.scrollMath.vertical=n.height>n.clientHeight),e&&(this.$.scrollMath.horizontal=n.width>n.clientWidth)}},shouldDrag:function(t,e){this.calcAutoScrolling();var n=e.vertical,i=this.$.scrollMath.horizontal&&!n,s=this.$.scrollMath.vertical&&n,o=0>e.dy,r=0>e.dx,a=!o&&this.startEdges.top||o&&this.startEdges.bottom,h=!r&&this.startEdges.left||r&&this.startEdges.right;return e.boundaryDragger||!i&&!s||(e.boundaryDragger=this),!a&&s||!h&&i?(e.dragger=this,!0):void 0},flick:function(t,e){var n=Math.abs(e.xVelocity)>Math.abs(e.yVelocity)?this.$.scrollMath.horizontal:this.$.scrollMath.vertical;return n&&this.dragging?(this.$.scrollMath.flick(e),this.preventDragPropagation):void 0},down:t.inherit(function(t){return function(){this.isOverscrolling()||t.apply(this,arguments)}}),move:function(){},dragstart:function(t,e){return!this.dragDuringGesture&&e.srcEvent.touches&&e.srcEvent.touches.length>1?!0:(this.doShouldDrag(e),this.dragging=e.dragger==this||!e.dragger&&e.boundaryDragger==this,this.dragging&&(this.preventDefault&&e.preventDefault(),this.syncScrollMath(),this.$.scrollMath.startDrag(e),this.preventDragPropagation)?!0:void 0)},drag:function(t,e){return this.listReordering?!1:(this.dragging&&(this.preventDefault&&e.preventDefault(),this.$.scrollMath.drag(e),this.scrim&&this.$.scrim.show()),void 0)},dragfinish:function(t,e){this.dragging&&(e.preventTap(),this.$.scrollMath.dragFinish(),this.dragging=!1,this.scrim&&this.$.scrim.hide())},mousewheel:function(t,e){return!this.dragging&&this.useMouseWheel&&(this.calcBoundaries(),this.syncScrollMath(),this.stabilize(),this.$.scrollMath.mousewheel(e))?(e.preventDefault(),!0):void 0},scrollMathStart:function(){this.scrollNode&&!this.isScrolling()&&(this.scrolling=!0,this.isOverscrolling()||this.calcBoundaries())},scrollMathScroll:function(t){this.overscroll?this.effectScroll(-t.x,-t.y):this.effectScroll(-Math.min(t.leftBoundary,Math.max(t.rightBoundary,t.x)),-Math.min(t.topBoundary,Math.max(t.bottomBoundary,t.y))),this.thumb&&(this.showThumbs(),this.delayHideThumbs(100))},scrollMathStop:function(){this.scrolling=!1,this.effectScrollStop(),this.thumb&&this.delayHideThumbs(100)},scrollMathStabilize:function(t){return this.effectScroll(-t.x,-t.y),this.thumb&&(this.showThumbs(),this.delayHideThumbs(100)),!0},calcBoundaries:function(){var t=this.$.scrollMath||this,e=this._getScrollBounds();t.bottomBoundary=e.clientHeight-e.height,t.rightBoundary=e.clientWidth-e.width},syncScrollMath:function(){var t=this.$.scrollMath;t&&(t.setScrollX(-this.getScrollLeft()),t.setScrollY(-this.getScrollTop()))},effectScroll:function(t,e){this.scrollNode&&(this.scrollLeft=this.scrollNode.scrollLeft=t,this.scrollTop=this.scrollNode.scrollTop=e,this.effectOverscroll(null!==t?Math.round(t):t,null!==e?Math.round(e):e))},effectScrollStop:function(){this.effectOverscroll(null,null)},effectOverscroll:function(e,n){var i=this.scrollNode,s=\"0\",o=\"0\",r=this.accel?\",0\":\"\";null!==n&&Math.abs(n-i.scrollTop)>1&&(o=i.scrollTop-n),null!==e&&Math.abs(e-i.scrollLeft)>1&&(s=i.scrollLeft-e),this.transform?t.dom.transformValue(this.$.client,this.translation,s+\"px, \"+o+\"px\"+r):this.$.client.setBounds({left:s+\"px\",top:o+\"px\"})},getOverScrollBounds:function(){var t=this.$.scrollMath||this;return{overleft:Math.min(t.leftBoundary-t.x,0)||Math.max(t.rightBoundary-t.x,0),overtop:Math.min(t.topBoundary-t.y,0)||Math.max(t.bottomBoundary-t.y,0)}},_getScrollBounds:t.inherit(function(e){return function(){var n=e.apply(this,arguments);return t.mixin(n,this.getOverScrollBounds()),n}}),getScrollBounds:t.inherit(function(t){return function(){return this.stop(!0),t.apply(this,arguments)}}),remeasure:function(){this.calcBoundaries(),this.thumb&&this.syncThumbs(),this.stabilize()},alertThumbs:function(){this.showThumbs(),this.delayHideThumbs(500)},syncThumbs:function(){this.$.vthumb.sync(this),this.$.hthumb.sync(this)},updateThumbs:function(){this.$.vthumb.update(this),this.$.hthumb.update(this)},showThumbs:function(){\"hidden\"!=this.horizontal&&this.$.hthumb.show(),\"hidden\"!=this.vertical&&this.$.vthumb.show(),this.syncThumbs()},hideThumbs:function(){this.$.vthumb.hide(),this.$.hthumb.hide()},delayHideThumbs:function(t){this.$.vthumb.delayHide(t),this.$.hthumb.delayHide(t)}})})(enyo,this);\n\n// ../source/touch/TranslateScrollStrategy.js\n(function(t){t.kind({name:\"enyo.TranslateScrollStrategy\",kind:\"enyo.TouchScrollStrategy\",translateOptimized:!1,components:[{name:\"clientContainer\",classes:\"enyo-touch-scroller\",components:[{name:\"client\"}]}],rendered:t.inherit(function(e){return function(){e.apply(this,arguments),t.makeBubble(this.$.clientContainer,\"scroll\"),this.translateOptimized&&this.setStartPosition()}}),setStartPosition:function(){this.startX=this.getScrollLeft(),this.startY=this.getScrollTop()},getScrollSize:function(){var t=this.$.client.hasNode();return{width:t?t.scrollWidth:0,height:t?t.scrollHeight:0}},create:t.inherit(function(e){return function(){e.apply(this,arguments),t.dom.transformValue(this.$.client,this.translation,\"0,0,0\")}}),calcScrollNode:function(){return this.$.clientContainer.hasNode()},maxHeightChanged:function(){this.$.client.applyStyle(\"min-height\",this.maxHeight?null:\"100%\"),this.$.client.applyStyle(\"max-height\",this.maxHeight),this.$.clientContainer.addRemoveClass(\"enyo-scrollee-fit\",!this.maxHeight)},shouldDrag:t.inherit(function(t){return function(){return this.stop(),this.calcStartInfo(),t.apply(this,arguments)}}),syncScrollMath:t.inherit(function(t){return function(){this._translated||t.apply(this,arguments)}}),setScrollLeft:t.inherit(function(t){return function(e){var n,i;this.translateOptimized?(i=this.scrollLeft,n=this.$.scrollMath,this.stop(!0),n.setScrollX(-e),n.stabilize(),i!=-n.x&&(n.doScroll(),this.delayHideThumbs(100))):t.apply(this,arguments)}}),setScrollTop:t.inherit(function(t){return function(e){var n,i;this.translateOptimized?(i=this.scrollTop,n=this.$.scrollMath,this.stop(!0),n.setScrollY(-e),n.stabilize(),i!=-n.y&&(n.doScroll(),this.delayHideThumbs(100))):t.apply(this,arguments)}}),getScrollLeft:t.inherit(function(t){return function(){return this._translated?this.scrollLeft:t.apply(this,arguments)}}),getScrollTop:t.inherit(function(t){return function(){return this._translated?this.scrollTop:t.apply(this,arguments)}}),calcBoundaries:t.inherit(function(t){return function(){t.apply(this,arguments),this.translateOptimized&&!this.isScrolling()&&this.stabilize()}}),handleResize:function(){this.translateOptimized&&this.stabilize()},scrollMathStart:t.inherit(function(t){return function(){t.apply(this,arguments),this._translated||this.setStartPosition()}}),scrollMathScroll:function(t){this.overscroll?(this.scrollLeft=-t.x,this.scrollTop=-t.y):(this.scrollLeft=-Math.min(t.leftBoundary,Math.max(t.rightBoundary,t.x)),this.scrollTop=-Math.min(t.topBoundary,Math.max(t.bottomBoundary,t.y))),this.effectScroll(this.scrollLeft,this.scrollTop),this.thumb&&this.showThumbs()},scrollMathStabilize:t.inherit(function(t){return function(e){return this._translated?(this.scrollLeft=-e.x,this.scrollTop=-e.y,this.effectScroll(-e.x,-e.y),!0):t.apply(this,arguments)}}),effectScroll:t.inherit(function(e){return function(n,i){var s;this.translateOptimized||this.isScrolling()?(n=this.startX-n,i=this.startY-i,s=n+\"px, \"+i+\"px\"+(this.accel?\",0\":\"\"),t.dom.transformValue(this.$.client,this.translation,s),this._translated=!0):e.apply(this,arguments)}}),effectScrollStop:function(){if(!this.translateOptimized){var e=\"0,0\"+(this.accel?\",0\":\"\"),n=this.$.scrollMath,i=this._getScrollBounds(),s=Boolean(i.maxTop+n.bottomBoundary||i.maxLeft+n.rightBoundary);t.dom.transformValue(this.$.client,this.translation,s?null:e),this.setScrollLeft(this.scrollLeft),this.setScrollTop(this.scrollTop),s&&t.dom.transformValue(this.$.client,this.translation,e),this._translated=!1}},twiddle:function(){this.translateOptimized&&this.scrollNode&&(this.scrollNode.scrollTop=1,this.scrollNode.scrollTop=0)}})})(enyo,this);\n\n// ../source/touch/TransitionScrollStrategy.js\n(function(t){t.kind({name:\"enyo.TransitionScrollStrategy\",kind:\"enyo.TouchScrollStrategy\",components:[{name:\"clientContainer\",classes:\"enyo-touch-scroller\",components:[{name:\"client\"}]}],events:{onScrollStart:\"\",onScroll:\"\",onScrollStop:\"\"},handlers:{ondown:\"down\",ondragfinish:\"dragfinish\",onwebkitTransitionEnd:\"transitionComplete\"},tools:[{name:\"vthumb\",kind:\"ScrollThumb\",axis:\"v\",showing:!0},{name:\"hthumb\",kind:\"ScrollThumb\",axis:\"h\",showing:!1}],kFlickScalar:600,topBoundary:0,rightBoundary:0,bottomBoundary:0,leftBoundary:0,scrolling:!1,listener:null,boundaryX:0,boundaryY:0,stopTimeout:null,stopTimeoutMS:80,scrollInterval:null,scrollIntervalMS:50,transitions:{none:\"\",scroll:\"3.8s cubic-bezier(.19,1,.28,1.0) 0s\",bounce:\"0.5s cubic-bezier(0.06,.5,.5,.94) 0s\"},setScrollLeft:function(t){var e=this.scrollLeft;this.stop(),this.scrollLeft=t,(this.isInLeftOverScroll()||this.isInRightOverScroll())&&(this.scrollLeft=e),this.effectScroll()},setScrollTop:function(t){var e=this.scrollTop;this.stop(),this.scrollTop=t,(this.isInTopOverScroll()||this.isInBottomOverScroll())&&(this.scrollTop=e),this.effectScroll()},setScrollX:function(t){this.scrollLeft=-1*t},setScrollY:function(t){this.scrollTop=-1*t},getScrollLeft:function(){return this.scrollLeft},getScrollTop:function(){return this.scrollTop},create:t.inherit(function(e){return function(){e.apply(this,arguments),t.dom.transformValue(this.$.client,this.translation,\"0,0,0\")}}),destroy:t.inherit(function(t){return function(){this.clearCSSTransitionInterval(),t.apply(this,arguments)}}),getScrollSize:function(){var t=this.$.client.hasNode();return{width:t?t.scrollWidth:0,height:t?t.scrollHeight:0}},horizontalChanged:function(){\"hidden\"==this.horizontal&&(this.scrollHorizontal=!1)},verticalChanged:function(){\"hidden\"==this.vertical&&(this.scrollVertical=!1)},intervalChanged:function(){this.interval!=t.TransitionScrollStrategy.prototype.interval&&this.warn(\"'interval' not implemented in TransitionScrollStrategy\")},calcScrollNode:function(){return this.$.clientContainer.hasNode()},calcBoundaries:function(){var t=this._getScrollBounds();this.bottomBoundary=t.clientHeight-t.height,this.rightBoundary=t.clientWidth-t.width},maxHeightChanged:function(){this.$.client.applyStyle(\"min-height\",this.maxHeight?null:\"100%\"),this.$.client.applyStyle(\"max-height\",this.maxHeight),this.$.clientContainer.addRemoveClass(\"enyo-scrollee-fit\",!this.maxHeight)},calcAutoScrolling:function(){var t=this.getScrollBounds();this.vertical&&(this.scrollVertical=t.height>t.clientHeight),this.horizontal&&(this.scrollHorizontal=t.width>t.clientWidth)},isInOverScroll:function(){return this.isInTopOverScroll()||this.isInBottomOverScroll()||this.isInLeftOverScroll()||this.isInRightOverScroll()},isInLeftOverScroll:function(){return this.getScrollLeft()<this.leftBoundary},isInRightOverScroll:function(){return 0>=this.getScrollLeft?!1:-1*this.getScrollLeft()<this.rightBoundary},isInTopOverScroll:function(){return this.getScrollTop()<this.topBoundary},isInBottomOverScroll:function(){return 0>=this.getScrollTop()?!1:-1*this.getScrollTop()<this.bottomBoundary},calcStartInfo:function(){var t=this.getScrollBounds(),e=this.getScrollTop(),n=this.getScrollLeft();this.startEdges={top:0===e,bottom:e===t.maxTop,left:0===n,right:n===t.maxLeft}},mousewheel:function(t,e){if(!this.dragging&&this.useMouseWheel){this.calcBoundaries(),this.syncScrollMath(),this.stabilize();var n=this.vertical?e.wheelDeltaY||e.wheelDelta:0,i=parseFloat(this.getScrollTop())+-1*parseFloat(n);return i=this.bottomBoundary>-1*i?-1*this.bottomBoundary:this.topBoundary>i?this.topBoundary:i,this.setScrollTop(i),this.doScroll(),e.preventDefault(),!0}},scroll:function(){this.thumb&&this.updateThumbs(),this.calcBoundaries(),this.doScroll()},start:function(){this.startScrolling(),this.doScrollStart()},stop:function(){this.isScrolling()&&this.stopScrolling(),this.thumb&&this.delayHideThumbs(100),this.doScrollStop()},updateX:function(){var e=window.getComputedStyle(this.$.client.node,null).getPropertyValue(t.dom.getCssTransformProp()).split(\"(\")[1];return e=void 0===e?0:e.split(\")\")[0].split(\",\")[4],-1*parseFloat(e)===this.scrollLeft?!1:(this.scrollLeft=-1*parseFloat(e),!0)},updateY:function(){var e=window.getComputedStyle(this.$.client.node,null).getPropertyValue(t.dom.getCssTransformProp()).split(\"(\")[1];return e=void 0===e?0:e.split(\")\")[0].split(\",\")[5],-1*parseFloat(e)===this.scrollTop?!1:(this.scrollTop=-1*parseFloat(e),!0)},effectScroll:function(){var e=-1*this.scrollLeft+\"px, \"+-1*this.scrollTop+\"px\"+(this.accel?\", 0\":\"\");t.dom.transformValue(this.$.client,this.translation,e)},down:function(){var t=this;return this.isScrolling()&&!this.isOverscrolling()?(this.stopTimeout=setTimeout(function(){t.stop()},this.stopTimeoutMS),!0):void 0},dragstart:function(t,e){return this.stopTimeout&&clearTimeout(this.stopTimeout),!this.dragDuringGesture&&e.srcEvent.touches&&e.srcEvent.touches.length>1?!0:(this.shouldDrag(e),this.dragging=e.dragger==this||!e.dragger&&e.boundaryDragger==this,this.dragging&&(this.isScrolling()&&this.stopScrolling(),this.thumb&&this.showThumbs(),e.preventDefault(),this.prevY=e.pageY,this.prevX=e.pageX,this.preventDragPropagation)?!0:void 0)},shouldDrag:function(t){return this.calcStartInfo(),this.calcBoundaries(),this.calcAutoScrolling(),this.scrollHorizontal?this.scrollVertical?this.shouldDragVertical(t)||this.shouldDragHorizontal(t):this.shouldDragHorizontal(t):this.shouldDragVertical(t)},shouldDragVertical:function(t){var e=this.canDragVertical(t),n=this.oobVertical(t);return!t.boundaryDragger&&e&&(t.boundaryDragger=this),!n&&e?(t.dragger=this,!0):void 0},shouldDragHorizontal:function(t){var e=this.canDragHorizontal(t),n=this.oobHorizontal(t);return!t.boundaryDragger&&e&&(t.boundaryDragger=this),!n&&e?(t.dragger=this,!0):void 0},canDragVertical:function(t){return this.scrollVertical&&t.vertical},canDragHorizontal:function(t){return this.scrollHorizontal&&!t.vertical},oobVertical:function(t){var e=0>t.dy;return!e&&this.startEdges.top||e&&this.startEdges.bottom},oobHorizontal:function(t){var e=0>t.dx;return!e&&this.startEdges.left||e&&this.startEdges.right},drag:function(t,e){return this.listReordering?!1:(this.dragging&&(e.preventDefault(),this.scrollLeft=this.scrollHorizontal?this.calculateDragDistance(parseInt(this.getScrollLeft(),10),-1*(e.pageX-this.prevX),this.leftBoundary,this.rightBoundary):this.getScrollLeft(),this.scrollTop=this.scrollVertical?this.calculateDragDistance(this.getScrollTop(),-1*(e.pageY-this.prevY),this.topBoundary,this.bottomBoundary):this.getScrollTop(),this.effectScroll(),this.scroll(),this.prevY=e.pageY,this.prevX=e.pageX,this.resetBoundaryX(),this.resetBoundaryY()),void 0)},calculateDragDistance:function(t,e,n,i){var s=t+e;return this.overscrollDragDamping(t,s,e,n,i)},overscrollDragDamping:function(t,e,n,i,s){return(i>e||s>-1*e)&&(n/=2,e=t+n),e},resetBoundaryX:function(){this.boundaryX=0},resetBoundaryY:function(){this.boundaryY=0},dragfinish:function(t,e){this.dragging&&(e.preventTap(),this.dragging=!1,this.isScrolling()||this.correctOverflow(),this.scrim&&this.$.scrim.hide())},correctOverflow:function(){if(this.isInOverScroll()){var t=this.scrollHorizontal?this.correctOverflowX():!1,e=this.scrollVertical?this.correctOverflowY():!1;t!==!1&&e!==!1?(this.scrollLeft=t!==!1?t:this.getScrollLeft(),this.scrollTop=e!==!1?e:this.getScrollTop(),this.startOverflowScrolling()):t!==!1?(this.scrollLeft=t,this.scrollTop=this.targetScrollTop||this.scrollTop,this.targetScrollLeft=this.getScrollLeft(),this.vertical?this.startScrolling():this.startOverflowScrolling()):e!==!1&&(this.scrollTop=e,this.scrollLeft=this.targetScrollLeft||this.scrollLeft,this.targetScrollTop=this.getScrollTop(),this.scrollHorizontal?this.startScrolling():this.startOverflowScrolling())}},correctOverflowX:function(){if(this.isInLeftOverScroll()){if(this.beyondBoundary(this.getScrollLeft(),this.leftBoundary,this.boundaryX))return this.leftBoundary}else if(this.isInRightOverScroll()&&this.beyondBoundary(this.getScrollLeft(),this.rightBoundary,this.boundaryX))return-1*this.rightBoundary;return!1},correctOverflowY:function(){if(this.isInTopOverScroll()){if(this.beyondBoundary(this.getScrollTop(),this.topBoundary,this.boundaryY))return this.topBoundary}else if(this.isInBottomOverScroll()&&this.beyondBoundary(this.getScrollTop(),this.bottomBoundary,this.boundaryY))return-1*this.bottomBoundary;return!1},beyondBoundary:function(t,e,n){return Math.abs(Math.abs(e)-Math.abs(t))>Math.abs(n)},flick:function(t,e){return this.dragging&&this.flickOnEnabledAxis(e)?(this.scrollLeft=this.scrollHorizontal?this.calculateFlickDistance(this.scrollLeft,-1*e.xVelocity):this.getScrollLeft(),this.scrollTop=this.scrollVertical?this.calculateFlickDistance(this.scrollTop,-1*e.yVelocity):this.getScrollTop(),this.targetScrollLeft=this.scrollLeft,this.targetScrollTop=this.scrollTop,this.boundaryX=null,this.boundaryY=null,this.isInLeftOverScroll()?this.boundaryX=this.figureBoundary(this.getScrollLeft()):this.isInRightOverScroll()&&(this.boundaryX=this.figureBoundary(-1*this.bottomBoundary-this.getScrollLeft())),this.isInTopOverScroll()?this.boundaryY=this.figureBoundary(this.getScrollTop()):this.isInBottomOverScroll()&&(this.boundaryY=this.figureBoundary(-1*this.bottomBoundary-this.getScrollTop())),this.startScrolling(),this.preventDragPropagation):void 0},flickOnEnabledAxis:function(t){return Math.abs(t.xVelocity)>Math.abs(t.yVelocity)?this.scrollHorizontal:this.scrollVertical},calculateFlickDistance:function(t,e){return t+e*this.kFlickScalar},startScrolling:function(){this.applyTransition(\"scroll\"),this.effectScroll(),this.setCSSTransitionInterval(),this.scrolling=!0},startOverflowScrolling:function(){this.applyTransition(\"bounce\"),this.effectScroll(),this.setOverflowTransitionInterval(),this.scrolling=!0},applyTransition:function(t){this.$.client.applyStyle(\"-webkit-transition\",this.transitions[t])},stopScrolling:function(){this.resetCSSTranslationVals(),this.clearCSSTransitionInterval(),this.scrolling=!1},setCSSTransitionInterval:function(){this.clearCSSTransitionInterval(),this.scrollInterval=setInterval(this.bindSafely(function(){this.updateScrollPosition(),this.correctOverflow()}),this.scrollIntervalMS)},setOverflowTransitionInterval:function(){this.clearCSSTransitionInterval(),this.scrollInterval=setInterval(this.bindSafely(function(){this.updateScrollPosition()}),this.scrollIntervalMS)},updateScrollPosition:function(){var t=this.updateY(),e=this.updateX();this.scroll(),t||e||this.stop()},clearCSSTransitionInterval:function(){this.scrollInterval&&(clearInterval(this.scrollInterval),this.scrollInterval=null)},resetCSSTranslationVals:function(){var e=t.dom.getCssTransformProp(),n=window.getComputedStyle(this.$.client.node,null).getPropertyValue(e).split(\"(\")[1].split(\")\")[0].split(\",\");this.applyTransition(\"none\"),this.scrollLeft=-1*n[4],this.scrollTop=-1*n[5],this.effectScroll()},figureBoundary:function(t){var e=Math.abs(t),n=e-e/Math.pow(e,.02);return n=0>t?-1*n:n},transitionComplete:function(t,e){if(e.originator===this.$.client){var n=!1;this.isInTopOverScroll()?(n=!0,this.scrollTop=this.topBoundary):this.isInBottomOverScroll()&&(n=!0,this.scrollTop=-1*this.bottomBoundary),this.isInLeftOverScroll()?(n=!0,this.scrollLeft=this.leftBoundary):this.isInRightOverScroll()&&(n=!0,this.scrollLeft=-1*this.rightBoundary),n?this.startOverflowScrolling():this.stop()}},scrollTo:function(t,e){this.setScrollTop(e),this.setScrollLeft(t),this.start()},getOverScrollBounds:function(){return{overleft:Math.min(this.leftBoundary+this.scrollLeft,0)||Math.max(this.rightBoundary+this.scrollLeft,0),overtop:Math.min(this.topBoundary+this.scrollTop,0)||Math.max(this.bottomBoundary+this.scrollTop,0)}}})})(enyo,this);\n\n// ../source/touch/Scroller.js\n(function(t){t.kind({name:\"enyo.Scroller\",published:{horizontal:\"default\",vertical:\"default\",scrollTop:0,scrollLeft:0,maxHeight:null,touch:!1,strategyKind:\"ScrollStrategy\",thumb:!0,useMouseWheel:!0},events:{onScrollStart:\"\",onScroll:\"\",onScrollStop:\"\"},touchOverscroll:!0,preventDragPropagation:!0,preventScrollPropagation:!0,noDefer:!0,handlers:{onscroll:\"domScroll\",onScrollStart:\"scrollStart\",onScroll:\"scroll\",onScrollStop:\"scrollStop\"},classes:\"enyo-scroller\",statics:{osInfo:[{os:\"android\",version:3},{os:\"androidChrome\",version:18},{os:\"androidFirefox\",version:16},{os:\"firefoxOS\",version:16},{os:\"ios\",version:5},{os:\"webos\",version:1e9},{os:\"blackberry\",version:1e9},{os:\"tizen\",version:2}],hasTouchScrolling:function(){for(var e,n=0;e=this.osInfo[n];n++)if(t.platform[e.os])return!0;return(t.platform.ie>=10||t.platform.windowsPhone>=8)&&t.platform.touch?!0:void 0},hasNativeScrolling:function(){for(var e,n=0;e=this.osInfo[n];n++)if(t.platform[e.os]<e.version)return!1;return!0},getTouchStrategy:function(){return t.platform.androidChrome>=27||t.platform.android>=3||8===t.platform.windowsPhone||t.platform.webos>=4?\"TranslateScrollStrategy\":\"TouchScrollStrategy\"}},controlParentName:\"strategy\",create:t.inherit(function(t){return function(){t.apply(this,arguments),this.horizontalChanged(),this.verticalChanged(),this.useMouseWheelChanged()}}),importProps:t.inherit(function(e){return function(n){e.apply(this,arguments),n&&void 0===n.strategyKind&&(t.Scroller.touchScrolling||this.touch)&&(this.strategyKind=t.Scroller.getTouchStrategy())}}),initComponents:t.inherit(function(t){return function(){this.strategyKindChanged(),t.apply(this,arguments)}}),rendered:t.inherit(function(t){return function(){t.apply(this,arguments),this.syncStrategy()}}),syncStrategy:function(){this.$.strategy.setScrollLeft(this.scrollLeft),this.$.strategy.setScrollTop(this.scrollTop)},strategyKindChanged:function(){this.$.strategy&&(this.$.strategy.destroy(),this.controlParent=null),this.createStrategy(),this.hasNode()&&this.render()},createStrategy:function(){this.createComponents([{name:\"strategy\",maxHeight:this.maxHeight,kind:this.strategyKind,thumb:this.thumb,preventDragPropagation:this.preventDragPropagation,overscroll:this.touchOverscroll,isChrome:!0}])},getStrategy:function(){return this.$.strategy},maxHeightChanged:function(){this.$.strategy.setMaxHeight(this.maxHeight)},showingChanged:t.inherit(function(t){return function(){t.apply(this,arguments),this.showing&&this.syncStrategy()}}),showingChangedHandler:t.inherit(function(){return function(t,e){this.showing&&e.showing&&this.syncStrategy()}}),thumbChanged:function(){this.$.strategy.setThumb(this.thumb)},horizontalChanged:function(){this.$.strategy.setHorizontal(this.horizontal)},verticalChanged:function(){this.$.strategy.setVertical(this.vertical)},setScrollLeft:function(t){this.$.strategy.setScrollLeft(t)},setScrollTop:function(t){this.$.strategy.setScrollTop(t)},getScrollLeft:function(){return this.scrollLeft=this.$.strategy.getScrollLeft(),this.scrollLeft},getScrollTop:function(){return this.scrollTop=this.$.strategy.getScrollTop(),this.scrollTop},getScrollBounds:function(){var t=this.$.strategy.getScrollBounds();return(-1!==t.xDir&&0!==t.xDir&&1!==t.xDir||-1!==t.yDir&&0!==t.yDir&&1!==t.yDir)&&this.decorateBounds(t),this.scrollTop=t.top,this.scrollLeft=t.left,t},remeasure:function(){var t=this.$.strategy;t.remeasure&&t.remeasure()},scrollIntoView:function(t,e){this.$.strategy.scrollIntoView(t,e)},scrollTo:function(t,e){this.$.strategy.scrollTo(t,e)},scrollToControl:function(t,e){this.scrollToNode(t.hasNode(),e)},scrollToNode:function(t,e){this.$.strategy.scrollToNode(t,e)},stop:function(){\"function\"==typeof this.$.strategy.stop&&this.$.strategy.stop(!0)},decorateScrollEvent:function(t){var e=t.scrollBounds=t.scrollBounds||this.$.strategy._getScrollBounds();(-1!==e.xDir&&0!==e.xDir&&1!==e.xDir||-1!==e.yDir&&0!==e.yDir&&1!==e.yDir)&&this.decorateBounds(e),this.scrollTop=e.top,this.scrollLeft=e.left},decorateBounds:function(t){var e=this.scrollLeft-t.left,n=this.scrollTop-t.top;t.xDir=0>e?1:e>0?-1:0,t.yDir=0>n?1:n>0?-1:0,this.scrollLeft=t.left,this.scrollTop=t.top},domScroll:function(t,e){return this.$.strategy.domScroll&&e.originator==this&&this.$.strategy.domScroll(t,e),this.decorateScrollEvent(e),this.doScroll(e),!0},shouldStopScrollEvent:function(t){return this.preventScrollPropagation&&t.originator.owner!=this.$.strategy},scrollStart:function(t,e){return this.shouldStopScrollEvent(e)?!0:(this.decorateScrollEvent(e),!1)},scroll:function(t,e){var n;return n=e.dispatchTarget?this.preventScrollPropagation&&!(e.originator==this||e.originator.owner==this.$.strategy):this.shouldStopScrollEvent(e),n?!0:(this.decorateScrollEvent(e),!1)},scrollStop:function(t,e){return this.shouldStopScrollEvent(e)?!0:(this.decorateScrollEvent(e),!1)},scrollToTop:function(){this.setScrollTop(0)},scrollToBottom:function(){this.setScrollTop(this.getScrollBounds().maxTop)},scrollToRight:function(){this.setScrollLeft(this.getScrollBounds().maxLeft)},scrollToLeft:function(){this.setScrollLeft(0)},stabilize:function(){var t=this.getStrategy();t.stabilize&&t.stabilize()},useMouseWheelChanged:function(){this.$.strategy.setUseMouseWheel(this.useMouseWheel)},resize:t.inherit(function(t){return function(){this.getAbsoluteShowing(!0)&&t.apply(this,arguments)}})}),t.Scroller.hasTouchScrolling()&&(t.Scroller.prototype.strategyKind=t.Scroller.getTouchStrategy())})(enyo,this);\n\n// ../source/ui/Anchor.js\n(function(t){t.kind({name:\"enyo.Anchor\",kind:\"enyo.Control\",tag:\"a\",published:{href:\"\",title:\"\"},create:t.inherit(function(t){return function(){t.apply(this,arguments),this.hrefChanged(),this.titleChanged()}}),hrefChanged:function(){this.setAttribute(\"href\",this.href)},titleChanged:function(){this.setAttribute(\"title\",this.title)}})})(enyo,this);\n\n// ../source/ui/Style.js\n(function(t){t.kind({name:\"enyo.Style\",tag:\"style\",classes:\"moon-style\",attributes:{type:\"text/css\"},allowHtml:!0,contentChanged:function(){this.content=\"<!--\\n\"+this.content+\"\\n-->\",this.inherited(arguments)}})})(enyo,this);\n\n// ../source/ui/Animator.js\n(function(t){t.kind({name:\"enyo.Animator\",kind:\"enyo.Component\",published:{duration:350,startValue:0,endValue:1,node:null,easingFunction:t.easing.cubicOut},events:{onStep:\"\",onEnd:\"\",onStop:\"\"},constructed:t.inherit(function(t){return function(){t.apply(this,arguments),this._next=this.bindSafely(\"next\")}}),destroy:t.inherit(function(t){return function(){this.stop(),t.apply(this,arguments)}}),play:function(e){return this.stop(),this.reversed=!1,e&&t.mixin(this,e),this.t0=this.t1=t.perfNow(),this.value=this.startValue,t.jobs.registerPriority(5,this.id),this.job=!0,this.next(),this},stop:function(){return this.isAnimating()?(this.cancel(),this.fire(\"onStop\"),this):void 0},complete:function(){return this.isAnimating()&&(this.t0=-this.duration-1,this.next()),this},reverse:function(){if(this.isAnimating()){this.reversed=!this.reversed;var e=this.t1=t.perfNow(),n=e-this.t0;this.t0=e+n-this.duration;var i=this.startValue;return this.startValue=this.endValue,this.endValue=i,this}},isAnimating:function(){return Boolean(this.job)},requestNext:function(){this.job=t.requestAnimationFrame(this._next,this.node)},cancel:function(){t.cancelRequestAnimationFrame(this.job),this.node=null,this.job=null,t.jobs.unregisterPriority(this.id)},shouldEnd:function(){return this.dt>=this.duration},next:function(){this.t1=t.perfNow(),this.dt=this.t1-this.t0;var e,n=this.easingFunction.length;1===n?(e=this.fraction=t.easedLerp(this.t0,this.duration,this.easingFunction,this.reversed),this.value=this.startValue+e*(this.endValue-this.startValue)):this.value=t.easedComplexLerp(this.t0,this.duration,this.easingFunction,this.reversed,this.dt,this.startValue,this.endValue-this.startValue),e>=1&&1===n||this.shouldEnd()?(this.value=this.endValue,this.fraction=1,this.fire(\"onStep\"),this.cancel(),t.asyncMethod(this.bindSafely(function(){this.fire(\"onEnd\")}))):(this.fire(\"onStep\"),this.requestNext())},fire:function(e){var n=this[e];t.isString(n)?this.bubble(e):n&&n.call(this.context||window,this)}})})(enyo,this);\n\n// ../source/ui/BaseLayout.js\n(function(t){t.kind({name:\"enyo.BaseLayout\",kind:\"enyo.Layout\",layoutClass:\"enyo-positioned\",reflow:function(){t.forEach(this.container.children,function(t){null!==t.fit&&t.addRemoveClass(\"enyo-fit\",t.fit)},this)}})})(enyo,this);\n\n// ../source/ui/Image.js\n(function(t){t.kind({name:\"enyo.Image\",kind:\"enyo.Control\",noEvents:!1,published:{src:\"\",alt:\"\",sizing:\"\",position:\"center\"},tag:\"img\",classes:\"enyo-image\",attributes:{draggable:\"false\"},create:t.inherit(function(t){return function(){this.noEvents&&(delete this.attributes.onload,delete this.attributes.onerror),t.apply(this,arguments),this.altChanged(),this.sizingChanged(),this.srcChanged(),this.positionChanged()}}),srcChanged:function(){var e=t.ri.selectSrc(this.src);this.sizing?this.applyStyle(\"background-image\",e?\"url(\"+t.path.rewrite(e)+\")\":\"none\"):e?this.setAttribute(\"src\",t.path.rewrite(e)):this.setAttribute(\"src\",\"\")},altChanged:function(){this.setAttribute(\"alt\",this.alt)},sizingChanged:function(t){this.tag=this.sizing?\"div\":\"img\",this.addRemoveClass(\"sized\",!!this.sizing),t&&this.removeClass(t),this.sizing&&this.addClass(this.sizing),this.generated&&(this.srcChanged(),this.render())},positionChanged:function(){this.sizing&&this.applyStyle(\"background-position\",this.position)},rendered:t.inherit(function(e){return function(){e.apply(this,arguments),t.makeBubble(this,\"load\",\"error\")}}),statics:{placeholder:\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBzdHlsZT0ic3Ryb2tlOiAjNDQ0OyBzdHJva2Utd2lkdGg6IDE7IGZpbGw6ICNhYWE7IiAvPjxsaW5lIHgxPSIwIiB5MT0iMCIgeDI9IjEwMCUiIHkyPSIxMDAlIiBzdHlsZT0ic3Ryb2tlOiAjNDQ0OyBzdHJva2Utd2lkdGg6IDE7IiAvPjxsaW5lIHgxPSIxMDAlIiB5MT0iMCIgeDI9IjAiIHkyPSIxMDAlIiBzdHlsZT0ic3Ryb2tlOiAjNDQ0OyBzdHJva2Utd2lkdGg6IDE7IiAvPjwvc3ZnPg==\"}})})(enyo,this);\n\n// ../source/ui/StylesheetSupport.js\n(function(t){t.StylesheetSupport={_stylesheet_tag:null,_stylesheet_id_suffix:\"_stylesheet\",published:{stylesheetContent:\"\"},create:t.inherit(function(t){return function(){this._stylesheet_tag=this.owner.createComponent({kind:\"enyo.Style\"},{owner:this}),this.stylesheetContent&&this.stylesheetContentChanged(),t.apply(this,arguments),this._stylesheet_tag.set(\"id\",this._stylesheet_getId())}}),stylesheetContentChanged:t.inherit(function(t){return function(){t.apply(this,arguments),this._stylesheet_tag.set(\"content\",this.stylesheetContent)}}),addStylesheetContent:t.inherit(function(t){return function(e){t.apply(this,arguments);var n=this.get(\"stylesheetContent\");this.set(\"stylesheetContent\",(n?n+\"\\n\":\"\")+e)}}),_stylesheet_getId:function(){return this.getId()+this._stylesheet_id_suffix}}})(enyo,this);\n\n// ../source/ui/SpriteAnimation.js\n(function(t,e){t.kind({name:\"enyo.SpriteAnimation\",kind:\"enyo.Control\",classes:\"enyo-sprite-animation\",rtl:!1,published:{src:\"\",duration:5e3,width:100,height:100,rows:1,columns:2,iterationCount:null,cellOrientation:\"horizontal\",offsetTop:0,offsetLeft:0,paused:!1,stopAtEnd:!0,useCssAnimation:!0},events:{onSpriteAnimationEnds:\"\"},handlers:{onwebkitAnimationEnd:\"doSpriteAnimationEnds\"},_frameIndex:0,_loopCount:0,components:[{kind:\"enyo.Image\",name:\"spriteImage\",classes:\"enyo-sprite-animation-image\",mixins:[\"enyo.StylesheetSupport\"],sizing:\"cover\"}],bindings:[{from:\".src\",to:\".$.spriteImage.src\"}],computed:{animationName:[\"id\"],totalWidth:[\"offsetLeft\",\"width\",\"columns\"],totalHeight:[\"offsetTop\",\"height\",\"rows\"],steps:[\"cellOrientation\",\"columns\",\"rows\"],frameCount:[\"columns\",\"rows\"],frameLength:[\"duration\",\"frameCount\"]},observers:{setSize:[\"width\",\"height\",\"totalWidth\",\"totalHeight\"],setOffset:[\"offsetTop\",\"offsetLeft\"],_applyAnimation:[\"iterationCount\",\"cellOrientation\",\"columns\",\"rows\",\"id\"],updateKeyframes:[\"cellOrientation\",\"width\",\"height\",\"totalWidth\",\"totalHeight\",\"columns\",\"rows\",\"offsetTop\",\"offsetLeft\"]},create:t.inherit(function(t){return function(){t.apply(this,arguments),this.applyStyle(\"direction\",\"ltr\"),this.setOffset(),this.setSize(),this.pausedChanged(),this.stopAtEndChanged(),this.updateKeyframes(),this._applyAnimation()}}),durationChanged:function(){this.$.spriteImage.applyStyle(\"-webkit-animation-duration\",this.get(\"duration\")/1e3+\"s\"),this.$.spriteImage.applyStyle(\"animation-duration\",this.get(\"duration\")/1e3+\"s\"),this._forceAnimationReset()},setSize:function(){this.applyStyle(\"width\",this.get(\"width\")+\"px\"),this.applyStyle(\"height\",this.get(\"height\")+\"px\"),this.$.spriteImage.applyStyle(\"width\",this.get(\"totalWidth\")+\"px\"),this.$.spriteImage.applyStyle(\"height\",this.get(\"totalHeight\")+\"px\")},setOffset:function(){this.$.spriteImage.applyStyle(\"background-position\",-1*this.get(\"offsetLeft\")+\"px \"+-1*this.get(\"offsetTop\")+\"px\")},updateKeyframes:function(){this.useCssAnimation?this.$.spriteImage.set(\"stylesheetContent\",this._generateKeyframes()):this._generatePositionList(),this._forceAnimationReset()},animationName:function(){return this.get(\"id\")+\"_keyframes\"},totalWidth:function(){return this.get(\"offsetLeft\")+this.get(\"width\")*this.get(\"columns\")},totalHeight:function(){return this.get(\"offsetTop\")+this.get(\"height\")*this.get(\"rows\")},steps:function(){return\"horizontal\"==this.get(\"cellOrientation\")?this.get(\"columns\"):this.get(\"rows\")},frameCount:function(){return this.rows*this.columns},frameLength:function(){return Math.floor(this.get(\"duration\")/this.get(\"frameCount\"))},start:function(){this.useCssAnimation?(this.$.spriteImage.applyStyle(\"-webkit-animation-name\",this.get(\"animationName\")),this.$.spriteImage.applyStyle(\"animation-name\",this.get(\"animationName\"))):this._intervalHandle=e.setInterval(this.bindSafely(this._nextFrame,this),this.get(\"frameLength\")),this.set(\"paused\",!1)},stop:function(){this.$.spriteImage.applyStyle(\"-webkit-animation-name\",null),this.$.spriteImage.applyStyle(\"animation-name\",null),e.clearInterval(this._intervalHandle),this._loopCount=0},stopAtEndChanged:function(){this.$.spriteImage.applyStyle(\"-webkit-animation-fill-mode\",this.get(\"stopAtEnd\")?\"forwards\":null),this.$.spriteImage.applyStyle(\"animation-fill-mode\",this.get(\"stopAtEnd\")?\"forwards\":null)},pausedChanged:function(){this.addRemoveClass(\"paused\",this.get(\"paused\")),this.get(\"useCssAnimation\")||(this.get(\"paused\")?this.stop():this.start())},pause:function(){this.set(\"paused\",!0)},_nextFrame:function(){var t=2*this._frameIndex,e=-1*this._positionList[t]+this.offsetLeft,n=-1*this._positionList[t+1]+this.offsetTop,i=parseInt(this.get(\"iterationCount\"),10)||null;this.$.spriteImage.applyStyle(\"-webkit-transform\",\"translate3d(\"+e+\"px, \"+n+\"px, 0)\"),this.$.spriteImage.applyStyle(\"transform\",\"translate3d(\"+e+\"px, \"+n+\"px, 0)\"),t+1>=this._positionList.length-1?(this._frameIndex=0,this._loopCount++,null!=i&&this._loopCount>=i&&(this.stop(),this.doSpriteAnimationEnds(),this.get(\"stopAtEnd\")||(this._frameIndex++,this._nextFrame()))):this._frameIndex++},_forceAnimationReset:function(){this.stop(),this.startJob(\"forceAnimationReset\",function(){this.start()},100)},_applyAnimation:function(){var t=this.get(\"steps\"),e=this.get(\"iterationCount\");e=e&&0!==e?e:\"infinite\",this.$.spriteImage.applyStyle(\"-webkit-animation-timing-function\",\"steps(\"+t+\", start)\"),this.$.spriteImage.applyStyle(\"animation-timing-function\",\"steps(\"+t+\", start)\"),this.$.spriteImage.applyStyle(\"-webkit-animation-iteration-count\",e),this.$.spriteImage.applyStyle(\"animation-iteration-count\",e),this.durationChanged()},_generateKeyframes:function(){var t,e=this.get(\"width\"),n=this.get(\"height\"),i=this.get(\"rows\"),s=this.get(\"columns\"),o=\"horizontal\"==this.get(\"cellOrientation\")?!0:!1,r=\"\",a=o?i:s;for(r+=\"@-webkit-keyframes \"+this.get(\"animationName\")+\" {\\n\",t=0;a>t;t++)r+=this._generateKeyframe(t/a?t/a+1e-6:0,o?e:-e*t,o?-n*t:n),r+=this._generateKeyframe((t+1)/a,o?-e*s+e:-e*t,o?-n*t:-n*i+n);return r+=\"}\\n\"},_generateKeyframe:function(t,e,n){return Math.ceil(1e6*t)/1e4+\"%\t{ -webkit-transform: translate3d(\"+e+\"px, \"+n+\"px, 0);\ttransform: translate3d(\"+e+\"px, \"+n+\"px, 0); }\\n\"},_generatePositionList:function(){var t,e,n=this.get(\"width\"),i=this.get(\"height\"),s=this.get(\"rows\"),o=this.get(\"columns\"),r=\"horizontal\"==this.get(\"cellOrientation\")?!0:!1,a=r?s:o,h=r?o:s;for(this._positionList=[],t=0;a>t;t++)for(e=0;h>e;e++)this._positionList.push(n*(r?e:t),i*(r?t:e));return this._positionList}})})(enyo,this);\n\n// ../source/ui/Input.js\n(function(t){t.kind({name:\"enyo.Input\",kind:\"enyo.Control\",published:{value:\"\",placeholder:\"\",type:\"\",disabled:!1,selectOnFocus:!1},events:{onDisabledChange:\"\"},defaultFocus:!1,tag:\"input\",classes:\"enyo-input\",handlers:{onfocus:\"focused\",oninput:\"input\",onclear:\"clear\",ondragstart:\"dragstart\"},create:t.inherit(function(e){return function(){t.platform.ie&&(this.handlers.onkeyup=\"iekeyup\"),t.platform.windowsPhone&&(this.handlers.onkeydown=\"iekeydown\"),e.apply(this,arguments),this.placeholderChanged(),this.type&&this.typeChanged()}}),rendered:t.inherit(function(e){return function(){e.apply(this,arguments),t.makeBubble(this,\"focus\",\"blur\"),8==t.platform.ie&&this.setAttribute(\"onchange\",t.bubbler),this.disabledChanged(),this.defaultFocus&&this.focus()}}),typeChanged:function(){this.setAttribute(\"type\",this.type)},placeholderChanged:function(){this.setAttribute(\"placeholder\",this.placeholder),this.valueChanged()},disabledChanged:function(){this.setAttribute(\"disabled\",this.disabled),this.bubble(\"onDisabledChange\")},valueChanged:function(){var t=this.hasNode(),e=this.attributes;t?(t.value!==this.value&&(t.value=this.value),e.value=this.value):this.setAttribute(\"value\",this.value),this.detectTextDirectionality(this.value||0===this.value?this.value:this.get(\"placeholder\"))},iekeyup:function(e,n){var i=t.platform.ie,s=n.keyCode;(8>=i||9==i&&(8==s||46==s))&&this.bubble(\"oninput\",n)},iekeydown:function(e,n){var i=t.platform.windowsPhone,s=n.keyCode,o=n.dispatchTarget;8>=i&&13==s&&\"input\"==this.tag&&o.hasNode()&&o.node.blur()},clear:function(){this.setValue(\"\")},dragstart:function(){return this.hasFocus()},focused:function(){this.selectOnFocus&&t.asyncMethod(this,\"selectContents\")},selectContents:function(){var t=this.hasNode();if(t&&t.setSelectionRange)t.setSelectionRange(0,t.value.length);else if(t&&t.createTextRange){var e=t.createTextRange();e.expand(\"textedit\"),e.select()}},input:function(){var t=this.getNodeProperty(\"value\");this.setValue(t)}})})(enyo,this);\n\n// ../source/ui/RichText.js\n(function(t){t.kind({name:\"enyo.RichText\",kind:\"enyo.Input\",classes:\"enyo-richtext enyo-selectable\",published:{allowHtml:!0,disabled:!1,value:\"\"},defaultFocus:!1,protectedStatics:{osInfo:[{os:\"android\",version:3},{os:\"ios\",version:5}],hasContentEditable:function(){for(var e,n=0;e=t.RichText.osInfo[n];n++)if(t.platform[e.os]<e.version)return!1;return!0}},attributes:{contenteditable:!0},handlers:{onfocus:\"focusHandler\",onblur:\"blurHandler\",onkeyup:\"updateValue\",oncut:\"updateValueAsync\",onpaste:\"updateValueAsync\",oninput:null},create:t.inherit(function(e){return function(){this.setTag(t.RichText.hasContentEditable()?\"div\":\"textarea\"),e.apply(this,arguments),this.disabledChanged()}}),focusHandler:function(){this._value=this.get(\"value\")},blurHandler:function(){this._value!==this.get(\"value\")&&this.bubble(\"onchange\")},valueChanged:function(){var t=this.get(\"value\");this.hasFocus()&&t!==this.node.innerHTML?(this.selectAll(),this.insertAtCursor(t)):this.hasFocus()||this.set(\"content\",t),this.detectTextDirectionality(this.value||0===this.value?this.value:\"\")},disabledChanged:function(){\"div\"===this.tag?this.setAttribute(\"contenteditable\",this.disabled?null:\"true\"):this.setAttribute(\"disabled\",this.disabled),this.bubble(\"onDisabledChange\")},updateValue:function(){var t=this.node.innerHTML;this.set(\"value\",t)},updateValueAsync:function(){t.asyncMethod(this.bindSafely(\"updateValue\"))},hasFocus:function(){return this.hasNode()?document.activeElement===this.node:void 0},getSelection:function(){return this.hasFocus()?window.getSelection():void 0},removeSelection:function(t){var e=this.getSelection();e&&e[t?\"collapseToStart\":\"collapseToEnd\"]()},modifySelection:function(t,e,n){var i=this.getSelection();i&&i.modify(t||\"move\",e,n)},moveCursor:function(t,e){this.modifySelection(\"move\",t,e)},moveCursorToEnd:function(){this.moveCursor(\"forward\",\"documentboundary\")},moveCursorToStart:function(){this.moveCursor(\"backward\",\"documentboundary\")},selectAll:function(){this.hasFocus()&&document.execCommand(\"selectAll\")},insertAtCursor:function(e){if(this.hasFocus()){var n=this.allowHtml?e:t.Control.escapeHtml(e).replace(/\\n/g,\"<br/>\");document.execCommand(\"insertHTML\",!1,n)}}})})(enyo,this);\n\n// ../source/ui/TextArea.js\n(function(t){t.kind({name:\"enyo.TextArea\",kind:\"enyo.Input\",tag:\"textarea\",classes:\"enyo-textarea\",rendered:t.inherit(function(t){return function(){t.apply(this,arguments),this.valueChanged()}})})})(enyo,this);\n\n// ../source/ui/Select.js\n(function(t){t.kind({name:\"enyo.Select\",kind:\"enyo.Control\",published:{selected:0,value:null,size:0,multiple:!1,disabled:!1},handlers:{onchange:\"change\"},tag:\"select\",defaultKind:\"enyo.Option\",rendered:t.inherit(function(e){return function(){e.apply(this,arguments),8==t.platform.ie&&this.setAttribute(\"onchange\",t.bubbler),this.selectedChanged(),this.valueChanged(),this.sizeChanged(),this.multipleChanged(),this.disabledChanged()}}),getSelected:function(){return Number(this.getNodeProperty(\"selectedIndex\",this.selected))},selectedChanged:function(){this.setNodeProperty(\"selectedIndex\",this.selected),this.set(\"value\",this.getNodeProperty(\"value\",this.value))},valueChanged:function(){this.setNodeProperty(\"value\",this.value),this.set(\"selected\",this.getSelected())},sizeChanged:function(){this.setNodeProperty(\"size\",this.size)},multipleChanged:function(){this.setNodeProperty(\"multiple\",this.multiple)},disabledChanged:function(){this.setNodeProperty(\"disabled\",this.disabled)},change:function(){this.set(\"selected\",this.getSelected())},render:t.inherit(function(e){return function(){t.platform.ie?this.parent.render():e.apply(this,arguments)}})}),t.kind({name:\"enyo.Option\",kind:\"enyo.Control\",published:{value:\"\",selected:!1},tag:\"option\",create:t.inherit(function(t){return function(){t.apply(this,arguments),this.valueChanged(),this.selectedChanged()}}),valueChanged:function(){this.setAttribute(\"value\",this.value)},selectedChanged:function(){this.setAttribute(\"selected\",this.selected)}}),t.kind({name:\"enyo.OptionGroup\",kind:\"enyo.Control\",published:{label:\"\"},tag:\"optgroup\",defaultKind:\"enyo.Option\",create:t.inherit(function(t){return function(){t.apply(this,arguments),this.labelChanged()}}),labelChanged:function(){this.setAttribute(\"label\",this.label)}})})(enyo,this);\n\n// ../source/ui/Group.js\n(function(t){t.kind({name:\"enyo.Group\",kind:\"enyo.Control\",published:{highlander:!0,allowHighlanderDeactivate:!1,active:null,groupName:\"\"},events:{onActiveChanged:\"\"},handlers:{onActivate:\"activate\"},activate:function(t,e){(!this.groupName&&!e.originator.groupName||e.originator.groupName==this.groupName)&&this.highlander&&(void 0!==e.allowHighlanderDeactivate&&e.allowHighlanderDeactivate!==this.allowHighlanderDeactivate&&this.setAllowHighlanderDeactivate(e.allowHighlanderDeactivate),e.originator.active?this.setActive(e.originator):e.originator==this.active&&(this.allowHighlanderDeactivate?this.setActive(null):this.active.setActive(!0)))},activeChanged:function(t){t&&!t.destroyed&&(t.setActive(!1),t.removeClass(\"active\")),this.active&&this.active.addClass(\"active\"),this.doActiveChanged({active:this.active})}})})(enyo,this);\n\n// ../source/ui/GroupItem.js\n(function(t){t.kind({name:\"enyo.GroupItem\",kind:\"enyo.Control\",published:{active:!1},rendered:t.inherit(function(t){return function(){t.apply(this,arguments),this.activeChanged()}}),activeChanged:function(){this.bubble(\"onActivate\")}})})(enyo,this);\n\n// ../source/ui/ToolDecorator.js\n(function(t){t.kind({name:\"enyo.ToolDecorator\",kind:\"enyo.GroupItem\",classes:\"enyo-tool-decorator\"})})(enyo,this);\n\n// ../source/ui/Button.js\n(function(t){t.kind({name:\"enyo.Button\",kind:\"enyo.ToolDecorator\",tag:\"button\",attributes:{type:\"button\"},published:{disabled:!1},create:t.inherit(function(t){return function(){t.apply(this,arguments),this.disabledChanged()}}),disabledChanged:function(){this.setAttribute(\"disabled\",this.disabled)},tap:function(){return this.disabled?!0:(this.setActive(!0),void 0)}})})(enyo,this);\n\n// ../source/ui/Checkbox.js\n(function(t){t.kind({name:\"enyo.Checkbox\",kind:\"enyo.Input\",classes:\"enyo-checkbox\",events:{onActivate:\"\"},published:{checked:!1,active:!1,type:\"checkbox\"},kindClasses:\"\",handlers:{onchange:\"change\",onclick:\"click\"},rendered:t.inherit(function(t){return function(){t.apply(this,arguments),this.active&&this.activeChanged(),this.checkedChanged()}}),checkedChanged:function(){this.setNodeProperty(\"checked\",this.checked),this.setAttribute(\"checked\",this.checked?\"checked\":\"\"),this.setActive(this.checked)},activeChanged:function(){this.active=t.isTrue(this.active),this.setChecked(this.active),this.bubble(\"onActivate\")},setValue:function(e){this.setChecked(t.isTrue(e))},getValue:function(){return this.getChecked()},valueChanged:function(){},change:function(){var e=t.isTrue(this.getNodeProperty(\"checked\"));this.setActive(e)},click:function(e,n){8>=t.platform.ie&&this.bubble(\"onchange\",n)}})})(enyo,this);\n\n// ../source/ui/Repeater.js\n(function(t){t.kind({name:\"enyo.Repeater\",kind:\"enyo.Control\",published:{count:0},events:{onSetupItem:\"\"},create:t.inherit(function(t){return function(){t.apply(this,arguments),this.countChanged()}}),initComponents:t.inherit(function(t){return function(){this.itemComponents=this.components||this.kindComponents,this.components=this.kindComponents=null,t.apply(this,arguments)}}),countChanged:function(){this.build()},itemAtIndex:function(t){return this.controlAtIndex(t)},build:function(){this.destroyClientControls();for(var t,e=0;this.count>e;e++)t=this.createComponent({kind:\"enyo.OwnerProxy\",index:e}),t.createComponents(this.itemComponents),this.doSetupItem({index:e,item:t});this.render()},renderRow:function(t){var e=this.itemAtIndex(t);this.doSetupItem({index:t,item:e})},setCount:function(t){this.set(\"count\",t,{force:!0})}}),t.kind({name:\"enyo.OwnerProxy\",kind:\"enyo.Control\",tag:null,decorateEvent:t.inherit(function(e){return function(n,i){i&&(t.exists(i.index)?(i.indices=i.indices||[i.index],i.indices.push(this.index)):i.index=this.index,i.delegate&&i.delegate.owner===this&&(i.delegate=this.owner)),e.apply(this,arguments)}})})})(enyo,this);\n\n// ../source/ui/DragAvatar.js\n(function(t){t.kind({name:\"enyo._DragAvatar\",style:\"position: absolute; z-index: 10; pointer-events: none; cursor: move;\",showing:!1,showingChanged:t.inherit(function(t){return function(){t.apply(this,arguments),document.body.style.cursor=this.showing?\"move\":null}})}),t.kind({name:\"enyo.DragAvatar\",kind:\"enyo.Component\",published:{showing:!1,offsetX:20,offsetY:30},initComponents:t.inherit(function(t){return function(){this.avatarComponents=this.components,this.components=null,t.apply(this,arguments)}}),requireAvatar:function(){this.avatar||(this.avatar=this.createComponent({kind:t._DragAvatar,parentNode:document.body,showing:!1,components:this.avatarComponents}).render())},showingChanged:function(){this.avatar.setShowing(this.showing),document.body.style.cursor=this.showing?\"move\":null},drag:function(t){this.requireAvatar(),this.avatar.setBounds({top:t.pageY-this.offsetY,left:t.pageX+this.offsetX}),this.show()},show:function(){this.setShowing(!0)},hide:function(){this.setShowing(!1)}})})(enyo,this);\n\n// ../source/ui/FloatingLayer.js\n(function(t){t.kind({name:\"enyo.FloatingLayer\",kind:\"enyo.Control\",classes:\"enyo-fit enyo-clip enyo-untouchable\",create:t.inherit(function(e){return function(){e.apply(this,arguments),this.setParent(null),11>t.platform.ie&&this.removeClass(\"enyo-fit\")}}),hasNode:t.inherit(function(t){return function(){return t.apply(this,arguments),this.node&&!this.node.parentNode&&this.teardownRender(),this.node}}),render:t.inherit(function(t){return function(){return this.parentNode=document.body,t.apply(this,arguments)}}),generateInnerHtml:function(){return\"\"},beforeChildRender:function(){this.hasNode()||this.render()},teardownChildren:function(){}}),t.floatingLayer=new t.FloatingLayer})(enyo,this);\n\n// ../source/ui/Popup.js\n(function(t){t.kind({name:\"enyo.Popup\",kind:\"enyo.Control\",noDefer:!0,classes:\"enyo-popup enyo-no-touch-action\",published:{modal:!1,autoDismiss:!0,floating:!1,centered:!1,showTransitions:!1,allowDefault:!1,scrimWhenModal:!0,scrim:!1,scrimClassName:\"\",defaultZ:120},protectedStatics:{count:0,highestZ:120},showing:!1,handlers:{onkeydown:\"keydown\",ondragstart:\"dragstart\",onfocus:\"focus\",onblur:\"blur\",onRequestShow:\"requestShow\",onRequestHide:\"requestHide\"},captureEvents:!0,eventsToCapture:{ondown:\"capturedDown\",ontap:\"capturedTap\"},events:{onShow:\"\",onHide:\"\"},tools:[{kind:\"Signals\",onKeydown:\"keydown\"}],create:t.inherit(function(t){return function(){var e=this.showing;this.showing=!1,t.apply(this,arguments),this.canGenerate=!this.floating,this.generated=e}}),render:t.inherit(function(e){return function(){this.floating&&(t.floatingLayer.hasNode()||t.floatingLayer.render(),this.parentNode=t.floatingLayer.hasNode()),e.apply(this,arguments)}}),teardownRender:t.inherit(function(t){return function(){var e=this.hasNode();this.floating&&e&&this.node.remove(),t.apply(this,arguments)}}),destroy:t.inherit(function(t){return function(){this.release(),t.apply(this,arguments)}}),reflow:t.inherit(function(t){return function(){this.updatePosition(),t.apply(this,arguments)}}),calcViewportSize:function(){if(window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var t=document.documentElement;return{width:t.offsetWidth,height:t.offsetHeight}},updatePosition:function(){var t=this.calcViewportSize(),e=this.getBounds();if(this.targetPosition){var n=this.targetPosition;\"number\"==typeof n.left?n.left+e.width>t.width?(n.right=n.left-e.width>=0?t.width-n.left:0,n.left=null):n.right=null:\"number\"==typeof n.right&&(n.right+e.width>t.width?(n.left=n.right-e.width>=0?t.width-n.right:0,n.right=null):n.left=null),\"number\"==typeof n.top?n.top+e.height>t.height?(n.bottom=n.top-e.height>=0?t.height-n.top:0,n.top=null):n.bottom=null:\"number\"==typeof n.bottom&&(n.bottom+e.height>t.height?(n.top=n.bottom-e.height>=0?t.height-n.bottom:0,n.bottom=null):n.top=null),this.addStyles(\"left: \"+(null!==n.left?n.left+\"px\":\"initial\")+\"; right: \"+(null!==n.right?n.right+\"px\":\"initial\")+\"; top: \"+(null!==n.top?n.top+\"px\":\"initial\")+\"; bottom: \"+(null!==n.bottom?n.bottom+\"px\":\"initial\")+\";\")}else if(this.centered){var i=this.floating?t:this.getInstanceOwner().getBounds();this.addStyles(\"top: \"+Math.max((i.height-e.height)/2,0)+\"px; left: \"+Math.max((i.width-e.width)/2,0)+\"px;\")}},rendered:t.inherit(function(t){return function(){!this.generated||this.showing||this.hasNode()?t.apply(this,arguments):(this.generated=!1,this.showing=!0,this.showingChanged())}}),showingChanged:t.inherit(function(e){return function(){this.floating&&this.showing&&!this.hasNode()&&this.render(),(this.centered||this.targetPosition)&&(this.showTransitions||this.applyStyle(\"visibility\",\"hidden\"),this.addStyles(\"top: 0px; left: 0px; right: initial; bottom: initial;\")),e.apply(this,arguments),this.showing?(this.resize(),t.Popup.count++,this.applyZIndex(),this.captureEvents&&this.capture()):(t.Popup.count>0&&t.Popup.count--,this.captureEvents&&this.release()),this.showHideScrim(this.showing),(this.centered||this.targetPosition&&!this.showTransitions)&&this.applyStyle(\"visibility\",null),this.hasNode()&&this[this.showing?\"doShow\":\"doHide\"]()}}),capture:function(){t.dispatcher.capture(this,this.eventsToCapture)},release:function(){t.dispatcher.release(this)},capturedDown:function(t,e){return this.downEvent=e,this.modal&&!this.allowDefault&&e.preventDefault(),this.modal},capturedTap:function(t,e){return this.autoDismiss&&!e.dispatchTarget.isDescendantOf(this)&&this.downEvent&&!this.downEvent.dispatchTarget.isDescendantOf(this)&&(this.downEvent=null,this.hide()),this.modal},dragstart:function(t,e){var n=e.dispatchTarget===this||e.dispatchTarget.isDescendantOf(this);return t.autoDismiss&&!n&&t.setShowing(!1),!0},keydown:function(t,e){this.showing&&this.autoDismiss&&27==e.keyCode&&this.hide()},blur:function(t,e){e.dispatchTarget.isDescendantOf(this)&&(this.lastFocus=e.originator)},focus:function(t,e){var n=e.dispatchTarget;if(this.modal&&!n.isDescendantOf(this)){n.hasNode()&&n.node.blur();var i=this.lastFocus&&this.lastFocus.hasNode()||this.hasNode();i&&i.focus()}},requestShow:function(){return this.show(),!0},requestHide:function(){return this.hide(),!0},showAtEvent:function(t,e){var n={left:t.centerX||t.clientX||t.pageX,top:t.centerY||t.clientY||t.pageY};e&&(n.left+=e.left||0,n.top+=e.top||0),this.showAtPosition(n)},showAtPosition:function(t){this.targetPosition=t,this.show()},showHideScrim:function(e){if(this.floating&&(this.scrim||this.modal&&this.scrimWhenModal)){var n=this.getScrim();if(e){var i=this.getScrimZIndex();this._scrimZ=i,n.showAtZIndex(i)}else n.hideAtZIndex(this._scrimZ);t.call(n,\"addRemoveClass\",[this.scrimClassName,n.showing])}},getScrimZIndex:function(){return t.Popup.highestZ>=this._zIndex?this._zIndex-1:t.Popup.highestZ},getScrim:function(){return this.modal&&this.scrimWhenModal&&!this.scrim?t.scrimTransparent.make():t.scrim.make()},applyZIndex:function(){this._zIndex=2*t.Popup.count+this.findZIndex()+1,this._zIndex<=t.Popup.highestZ&&(this._zIndex=t.Popup.highestZ+1),this._zIndex>t.Popup.highestZ&&(t.Popup.highestZ=this._zIndex),this.applyStyle(\"z-index\",this._zIndex)},findZIndex:function(){var e=this.defaultZ;return this._zIndex?e=this._zIndex:this.hasNode()&&(e=Number(t.dom.getComputedStyleValue(this.node,\"z-index\"))||e),this.defaultZ>e&&(e=this.defaultZ),this._zIndex=e,this._zIndex}}),t.Popup.concat=function(e,n){var i=e.prototype||e,s=i.eventsToCapture;i.eventsToCapture=s?t.mixin({},[s,n.eventsToCapture]):n.eventsToCapture,delete n.eventsToCapture}})(enyo,this);\n\n// ../source/ui/Selection.js\n(function(t){t.kind({name:\"enyo.Selection\",kind:\"enyo.Component\",published:{multi:!1},events:{onSelect:\"\",onDeselect:\"\",onChange:\"\"},create:t.inherit(function(t){return function(){this.clear(),t.apply(this,arguments)}}),multiChanged:function(){this.multi||this.clear(),this.doChange()},highlander:function(){this.multi||this.deselect(this.lastSelected)},clear:function(){this.selected={}},isSelected:function(t){return this.selected[t]},setByKey:function(t,e,n){if(e)this.selected[t]=n||!0,this.lastSelected=t,this.doSelect({key:t,data:this.selected[t]});else{var i=this.isSelected(t);delete this.selected[t],this.doDeselect({key:t,data:i})}this.doChange()},deselect:function(t){this.isSelected(t)&&this.setByKey(t,!1)},select:function(t,e){this.multi?this.setByKey(t,!this.isSelected(t),e):this.isSelected(t)||(this.highlander(),this.setByKey(t,!0,e))},toggle:function(t,e){this.multi||this.lastSelected==t||this.deselect(this.lastSelected),this.setByKey(t,!this.isSelected(t),e)},getSelected:function(){return this.selected},remove:function(t){var e={};for(var n in this.selected)t>n?e[n]=this.selected[n]:n>t&&(e[n-1]=this.selected[n]);this.selected=e}})})(enyo,this);\n\n// ../source/ui/Drawer.js\n(function(t){t.kind({name:\"enyo.Drawer\",kind:\"enyo.Control\",published:{open:!0,orient:\"v\",animated:!0,resizeContainer:!0},events:{onDrawerAnimationStep:\"\",onDrawerAnimationEnd:\"\"},style:\"overflow: hidden; position: relative;\",tools:[{kind:\"Animator\",onStep:\"animatorStep\",onEnd:\"animatorEnd\"},{name:\"client\",style:\"position: relative;\",classes:\"enyo-border-box\"}],create:t.inherit(function(t){return function(){t.apply(this,arguments),this.animatedChanged(),this.openChanged()}}),initComponents:t.inherit(function(t){return function(){this.createChrome(this.tools),t.apply(this,arguments)}}),animatedChanged:function(){!this.animated&&this.hasNode()&&this.$.animator.isAnimating()&&(this.$.animator.stop(),this.animatorEnd())},openChanged:function(){if(this.$.client.show(),this.hasNode())if(this.$.animator.isAnimating())this.$.animator.reverse();else{var t=\"v\"==this.orient,e=t?\"height\":\"width\",n=t?\"top\":\"left\";this.applyStyle(e,null);var i=this.hasNode()[t?\"scrollHeight\":\"scrollWidth\"];this.animated?this.$.animator.play({startValue:this.open?0:i,endValue:this.open?i:0,dimension:e,position:n}):this.animatorEnd()}else this.$.client.setShowing(this.open)},animatorStep:function(t){if(this.hasNode()){var e=t.dimension;this.applyStyle(e,t.value+\"px\")}var n=this.$.client.hasNode();if(n){var i=t.position,s=this.open?t.endValue:t.startValue;this.$.client.applyStyle(i,t.value-s+\"px\")}return this.container&&this.resizeContainer&&this.container.resize(),this.doDrawerAnimationStep(),!0},animatorEnd:function(){if(this.open){var t=\"v\"==this.orient,e=t?\"height\":\"width\",n=t?\"top\":\"left\",i=this.$.client.hasNode();i&&this.$.client.applyStyle(n,null),this.node&&this.applyStyle(e,null)}else this.$.client.hide();return this.container&&this.resizeContainer&&this.container.resize(),this.doDrawerAnimationEnd(),!0}})})(enyo,this);\n\n// ../source/ui/Table.js\n(function(t){t.kind({name:\"enyo.Table\",kind:\"enyo.Control\",tag:\"table\",attributes:{cellpadding:\"0\",cellspacing:\"0\"},defaultKind:\"enyo.TableRow\"}),t.kind({name:\"enyo.TableRow\",kind:\"enyo.Control\",tag:\"tr\",defaultKind:\"enyo.TableCell\"}),t.kind({name:\"enyo.TableCell\",kind:\"enyo.Control\",tag:\"td\"})})(enyo,this);\n\n// ../source/ui/fullscreen.js\n(function(t){t.fullscreen={fullscreenControl:null,fullscreenElement:null,requestor:null,elementAccessor:\"fullscreenElement\"in document?\"fullscreenElement\":\"mozFullScreenElement\"in document?\"mozFullScreenElement\":\"webkitFullscreenElement\"in document?\"webkitFullscreenElement\":null,requestAccessor:\"requestFullscreen\"in document.documentElement?\"requestFullscreen\":\"mozRequestFullScreen\"in document.documentElement?\"mozRequestFullScreen\":\"webkitRequestFullscreen\"in document.documentElement?\"webkitRequestFullscreen\":null,cancelAccessor:\"cancelFullScreen\"in document?\"cancelFullScreen\":\"mozCancelFullScreen\"in document?\"mozCancelFullScreen\":\"webkitCancelFullScreen\"in document?\"webkitCancelFullScreen\":null,nativeSupport:function(){return null!==this.elementAccessor&&null!==this.requestAccessor&&null!==this.cancelAccessor},getFullscreenElement:function(){return this.nativeSupport()?document[this.elementAccessor]:this.fullscreenElement},getFullscreenControl:function(){return this.fullscreenControl},requestFullscreen:function(t){return this.getFullscreenControl()||!t.hasNode()?!1:(this.requestor=t,this.nativeSupport()?t.hasNode()[this.requestAccessor]():this.fallbackRequestFullscreen(),!0)},cancelFullscreen:function(){this.nativeSupport()?document[this.cancelAccessor]():this.fallbackCancelFullscreen()},setFullscreenElement:function(t){this.fullscreenElement=t},setFullscreenControl:function(t){this.fullscreenControl=t},fallbackRequestFullscreen:function(){var e=this.requestor;e&&(e.prevAddBefore=e.parent.controlAtIndex(e.indexInContainer()+1),t.floatingLayer.hasNode()||t.floatingLayer.render(),e.addClass(\"enyo-fullscreen\"),e.appendNodeToParent(t.floatingLayer.hasNode()),e.resize(),this.setFullscreenControl(e),this.setFullscreenElement(e.hasNode()))},fallbackCancelFullscreen:function(){var t,e,n=this.fullscreenControl;n&&(t=n.prevAddBefore?n.prevAddBefore.hasNode():null,e=n.parent.hasNode(),n.prevAddBefore=null,n.removeClass(\"enyo-fullscreen\"),t?n.insertNodeInParent(e,t):n.appendNodeToParent(e),n.resize(),this.setFullscreenControl(null),this.setFullscreenElement(null))},detectFullscreenChangeEvent:function(){this.setFullscreenControl(this.requestor),this.requestor=null,t.Signals.send(\"onFullscreenChange\")}},t.ready(function(){document.addEventListener&&(document.addEventListener(\"webkitfullscreenchange\",t.bind(t.fullscreen,\"detectFullscreenChangeEvent\"),!1),document.addEventListener(\"mozfullscreenchange\",t.bind(t.fullscreen,\"detectFullscreenChangeEvent\"),!1),document.addEventListener(\"fullscreenchange\",t.bind(t.fullscreen,\"detectFullscreenChangeEvent\"),!1))}),t.fullscreen.nativeSupport()||t.dispatcher.features.push(function(e){\"keydown\"===e.type&&27===e.keyCode&&t.fullscreen.cancelFullscreen()})})(enyo,this);\n\n// ../source/ui/Media.js\n(function(t){t.kind({name:\"enyo.Media\",kind:\"enyo.Control\",published:{src:\"\",autoplay:!1,defaultPlaybackRate:1,jumpSec:30,playbackRate:1,playbackRateHash:{fastForward:[\"2\",\"4\",\"8\",\"16\"],rewind:[\"-2\",\"-4\",\"-8\",\"-16\"],slowForward:[\"1/4\",\"1/2\",\"1\"],slowRewind:[\"-1/2\",\"-1\"]},preload:\"none\",loop:!1,muted:!1,showControls:!1,volume:1},events:{onAbort:\"\",onCanPlay:\"\",onCanPlayThrough:\"\",onDurationChange:\"\",onEmptied:\"\",onEnded:\"\",onError:\"\",onLoadedData:\"\",onLoadedMetaData:\"\",onLoadStart:\"\",onPause:\"\",onPlay:\"\",onPlaying:\"\",onProgress:\"\",onRateChange:\"\",onSeeked:\"\",onSeeking:\"\",onStalled:\"\",onTimeUpdate:\"\",onVolumeChange:\"\",onWaiting:\"\",onFastforward:\"\",onSlowforward:\"\",onRewind:\"\",onSlowrewind:\"\",onJumpForward:\"\",onJumpBackward:\"\",onStart:\"\"},handlers:{onabort:\"_abort\",oncanplay:\"_canPlay\",oncanplaythrough:\"_canPlayThrough\",ondurationchange:\"_durationChange\",onemptied:\"_emptied\",onended:\"_ended\",onerror:\"_error\",onloadeddata:\"_loadedData\",onloadedmetadata:\"_loadedMetaData\",onloadstart:\"_loadStart\",onpause:\"_pause\",onplay:\"_play\",onplaying:\"_playing\",onprogress:\"_progress\",onratechange:\"_rateChange\",onseeked:\"_seeked\",onseeking:\"_seeking\",onstalled:\"_stalled\",ontimeupdate:\"_timeUpdate\",onvolumechange:\"_volumeChange\",onwaiting:\"_waiting\"},_playbackRateArray:null,_speedIndex:0,create:t.inherit(function(t){return function(){t.apply(this,arguments),this.autoplayChanged(),this.loopChanged(),this.preloadChanged(),this.showControlsChanged(),this.srcChanged()}}),rendered:t.inherit(function(e){return function(){e.apply(this,arguments),t.makeBubble(this,\"abort\"),t.makeBubble(this,\"canplay\"),t.makeBubble(this,\"canplaythrough\"),t.makeBubble(this,\"durationchange\"),t.makeBubble(this,\"emptied\"),t.makeBubble(this,\"ended\"),t.makeBubble(this,\"error\"),t.makeBubble(this,\"loadeddata\"),t.makeBubble(this,\"loadedmetadata\"),t.makeBubble(this,\"loadstart\"),t.makeBubble(this,\"pause\"),t.makeBubble(this,\"play\"),t.makeBubble(this,\"playing\"),t.makeBubble(this,\"progress\"),t.makeBubble(this,\"ratechange\"),t.makeBubble(this,\"seeked\"),t.makeBubble(this,\"seeking\"),t.makeBubble(this,\"stalled\"),t.makeBubble(this,\"timeupdate\"),t.makeBubble(this,\"volumechange\"),t.makeBubble(this,\"waiting\"),this.defaultPlaybackRateChanged(),this.mutedChanged(),this.playbackRateChanged(),this.volumeChanged()}}),srcChanged:function(){var e=t.path.rewrite(this.src);this.setAttribute(\"src\",e),this.hasNode()&&this.node.load()},autoplayChanged:function(){this.setAttribute(\"autoplay\",this.autoplay?\"autoplay\":null)},loopChanged:function(){this.setAttribute(\"loop\",this.loop?\"loop\":null)},mutedChanged:function(){this.setAttribute(\"muted\",this.muted?\"muted\":null)},preloadChanged:function(){this.setAttribute(\"preload\",this.preload)},defaultPlaybackRateChanged:function(){this.hasNode()&&(this.node.defaultPlaybackRate=this.defaultPlaybackRate)},selectPlaybackRateArray:function(t){this._playbackRateArray=this.playbackRateHash[t]},selectPlaybackRate:function(t){return this._playbackRateArray[t]},clampPlaybackRate:function(t){return this._playbackRateArray?t%this._playbackRateArray.length:void 0},playbackRateChanged:function(){this.hasNode()&&(this.node.playbackRate=this.playbackRate)},showControlsChanged:function(){this.setAttribute(\"controls\",this.showControls?\"controls\":null)},volumeChanged:function(){this.hasNode()&&(this.node.volume=this.volume)},_abort:function(){this.doEnded()},_canPlay:function(){this.doCanPlay()},_canPlayThrough:function(){this.doCanPlayThrough()},_durationChange:function(){this.doDurationChange()},_emptied:function(){this.doEmptied()},_ended:function(){this.doEnded()},_error:function(){this.doError()},_loadedData:function(){this.doLoadedData()},_loadedMetaData:function(){this.doLoadedMetaData()},_loadStart:function(){this.doLoadStart()},_pause:function(){this.doPause()},_play:function(){this.doPlay()},_playing:function(){this.doPlaying()},_progress:function(){this.doProgress()},createEventData:function(){var t=this.hasNode();return t?(0===t.currentTime&&this.doStart(),{srcElement:t,duration:t.duration,currentTime:t.currentTime,playbackRate:this.getPlaybackRate()}):{}},calcNumberValueOfPlaybackRate:function(t){var e=(t+\"\").split(\"/\");return e.length>1?parseInt(e[0],10)/parseInt(e[1],10):parseInt(t,10)},_rateChange:function(e,n){var i,s,o=this.hasNode();o&&(i=this.createEventData(),t.mixin(n,t.clone(i,!0)),i.originalEvent=t.clone(n,!0),s=this.calcNumberValueOfPlaybackRate(i.playbackRate),s>0&&1>s?this.doSlowforward(i):s>1?this.doFastforward(i):0>s&&s>=-1?this.doSlowrewind(i):-1>s?this.doRewind(i):1==s&&this.doPlay(i))},_stalled:function(){this.doStalled()},_seeked:function(){this.doSeeked()},_seeking:function(){this.doSeeking()},_timeUpdate:function(e,n){var i=this.hasNode();i&&(n=t.mixin(n,this.createEventData()))},_volumeChange:function(){this.doVolumeChange()},_waiting:function(){this.doWaiting()},play:function(){this.hasNode()&&(this.setPlaybackRate(1),this._prevCommand=\"play\",this.node.play())},pause:function(){this.hasNode()&&(this.setPlaybackRate(1),this._prevCommand=\"pause\",this.node.pause())},seekTo:function(t){this.hasNode()&&(this.node.currentTime=t)},getBuffered:function(){return this.hasNode()?this.node.buffered:0},getCurrentTime:function(){return this.hasNode()?this.node.currentTime:0},getDuration:function(){return this.hasNode()?this.node.duration:0},getPaused:function(){return this.hasNode()?this.node.paused:void 0},getPlayed:function(){return this.hasNode()?this.node.played:void 0},getReadyState:function(){return this.hasNode()?this.node.readyState:void 0},getSeekable:function(){return this.hasNode()?this.node.seekable:void 0},setCurrentTime:function(t){\"number\"==typeof t&&this.hasNode()&&(this.node.currentTime=t)},beginRewind:function(){this.node.pause(),this.startRewindJob()},_rewind:function(){var e=t.perfNow(),n=e-this.rewindBeginTime,i=this.calcNumberValueOfPlaybackRate(this.playbackRate),s=Math.abs(n*i)/1e3,o=this.getCurrentTime()-s;this.setCurrentTime(o),this.startRewindJob()},startRewindJob:function(){this.rewindBeginTime=t.perfNow(),t.job(this.id+\"rewind\",this.bindSafely(\"_rewind\"),100)},stopRewindJob:function(){t.job.stop(this.id+\"rewind\")},getSeeking:function(){return this.hasNode()?this.node.seeking:void 0},isPaused:function(){return this.hasNode()?this.hasNode().paused:!0},fastForward:function(){var t=this.hasNode();if(t){switch(this._prevCommand){case\"slowForward\":this._speedIndex==this._playbackRateArray.length-1?(this.selectPlaybackRateArray(\"fastForward\"),this._speedIndex=0,this._prevCommand=\"fastForward\"):(this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"slowForward\");break;case\"pause\":this.selectPlaybackRateArray(\"slowForward\"),this._speedIndex=0,this.isPaused()&&t.play(),this._prevCommand=\"slowForward\";break;case\"rewind\":var e=this.calcNumberValueOfPlaybackRate(this.playbackRate);0>e?(this.selectPlaybackRateArray(\"slowForward\"),this._prevCommand=\"slowForward\"):(this.selectPlaybackRateArray(\"fastForward\"),this._prevCommand=\"fastForward\"),this._speedIndex=0;break;case\"fastForward\":this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"fastForward\";break;default:this.selectPlaybackRateArray(\"fastForward\"),this._speedIndex=0,this._prevCommand=\"fastForward\"}this.setPlaybackRate(this.selectPlaybackRate(this._speedIndex))}},rewind:function(){var t=this.hasNode();if(t){switch(this._prevCommand){case\"slowRewind\":this._speedIndex==this._playbackRateArray.length-1?(this.selectPlaybackRateArray(\"rewind\"),this._speedIndex=0,this._prevCommand=\"rewind\"):(this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"slowRewind\");break;case\"pause\":this.selectPlaybackRateArray(\"slowRewind\"),this._speedIndex=0,this.isPaused()&&this.node.duration>this.node.currentTime&&t.play(),this._prevCommand=\"slowRewind\";break;case\"rewind\":this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"rewind\";break;default:this.selectPlaybackRateArray(\"rewind\"),this._speedIndex=0,this._prevCommand=\"rewind\"}this.setPlaybackRate(this.selectPlaybackRate(this._speedIndex))}},setPlaybackRate:function(e){var n,i=this.hasNode();i&&(this.stopRewindJob(),this.playbackRate=e+=\"\",n=this.calcNumberValueOfPlaybackRate(e),i.playbackRate=n,t.platform.webos||window.PalmSystem||0>n&&this.beginRewind())},jumpBackward:function(){var e=this.hasNode();e&&(this.setPlaybackRate(1),e.currentTime-=this.jumpSec,this._prevCommand=\"jumpBackward\",this.doJumpBackward(t.mixin(this.createEventData(),{jumpSize:this.jumpSec})))},jumpForward:function(){var e=this.hasNode();e&&(this.setPlaybackRate(1),e.currentTime+=this.jumpSec,this._prevCommand=\"jumpForward\",this.doJumpForward(t.mixin(this.createEventData(),{jumpSize:this.jumpSec})))},jumpToStart:function(){var t=this.hasNode();t&&(this.setPlaybackRate(1),t.pause(),t.currentTime=0,this._prevCommand=\"jumpToStart\")},jumpToEnd:function(){var t=this.hasNode();t&&(this.setPlaybackRate(1),t.pause(),t.currentTime=this.node.duration,this._prevCommand=\"jumpToEnd\")}})})(enyo,this);\n\n// ../source/ui/MediaSource.js\nenyo.kind({name:\"enyo.MediaSource\",kind:\"Control\",tag:\"source\",src:\"\",type:\"\",events:{onChangeSource:\"\"},create:enyo.inherit(function(t){return function(){t.apply(this,arguments),this.syncAttribute(\"src\"),this.syncAttribute(\"type\")}}),srcChanged:function(){this.setAttribute(\"src\",enyo.path.rewrite(this.src)),this.doChangeSource()},typeChanged:function(){this.setAttribute(\"type\",this.type),this.doChangeSource()},syncAttribute:function(t){var e=this.getAttribute(t);!this[t]&&e?this[t]=e:this.setAttribute(t,this[t])}});\n\n// ../source/ui/Audio.js\n(function(t){t.kind({name:\"enyo.Audio\",kind:\"enyo.Media\",tag:\"audio\",published:{preload:\"auto\"}})})(enyo,this);\n\n// ../source/ui/Video.js\n(function(t){t.kind({name:\"enyo.Video\",kind:t.Control,published:{src:\"\",sourceComponents:null,poster:\"\",showControls:!1,preload:\"metadata\",autoplay:!1,loop:!1,fitToWindow:!1,aspectRatio:null,jumpSec:30,playbackRate:1,playbackRateHash:{fastForward:[\"2\",\"4\",\"8\",\"16\"],rewind:[\"-2\",\"-4\",\"-8\",\"-16\"],slowForward:[\"1/4\",\"1/2\",\"1\"],slowRewind:[\"-1/2\",\"-1\"]}},events:{onFastforward:\"\",onSlowforward:\"\",onRewind:\"\",onSlowrewind:\"\",onJumpForward:\"\",onJumpBackward:\"\",onPlay:\"\",onStart:\"\"},handlers:{onloadedmetadata:\"metadataLoaded\",ontimeupdate:\"timeupdate\",onratechange:\"ratechange\",onplay:\"_play\",onChangeSource:\"load\"},observers:{updateSource:[\"src\",\"sourceComponents\"]},tag:\"video\",defaultKind:\"enyo.MediaSource\",_playbackRateArray:null,_speedIndex:0,create:t.inherit(function(t){return function(){t.apply(this,arguments),this.posterChanged(),this.showControlsChanged(),this.preloadChanged(),this.autoplayChanged(),this.loopChanged(),(this.src||this.sourceComponents)&&this.updateSource()}}),rendered:t.inherit(function(t){return function(){t.apply(this,arguments),this.hookupVideoEvents()}}),updateSource:function(t,e,n){var i=this.get(\"src\"),s=this.get(\"sourceComponents\");\"src\"===n||!n&&i?(this.sourceComponents=null,s=[{src:i}]):(\"sourceComponents\"===n||!n&&s)&&(i=this.src=\"\",this.getAttribute(\"src\")&&this.setAttribute(\"src\",\"\")),this.destroyClientControls(),s&&(this.createComponents(s),this.hasNode()&&this.render()),this.load()},posterChanged:function(){if(this.poster){var e=t.path.rewrite(this.poster);this.setAttribute(\"poster\",e)}else this.setAttribute(\"poster\",null)},showControlsChanged:function(){this.setAttribute(\"controls\",this.showControls?\"controls\":null)},preloadChanged:function(){this.setAttribute(\"preload\",this.preload?this.preload:null)},autoplayChanged:function(){this.setAttribute(\"autoplay\",this.autoplay?\"autoplay\":null),this._prevCommand=this.autoplay?\"play\":\"pause\"},loopChanged:function(){this.setAttribute(\"loop\",this.loop?\"loop\":null)},fitToWindowChanged:function(){!this.hasNode()},load:function(){this.hasNode()&&this.hasNode().load()},unload:function(){this.src=\"\",this.sourceComponents=null,this.setAttribute(\"src\",\"\"),this.destroyClientControls(),this.load()},play:function(){this.hasNode()&&(this._speedIndex=0,this.setPlaybackRate(1),this.node.play(),this._prevCommand=\"play\")},pause:function(){this.hasNode()&&(this._speedIndex=0,this.setPlaybackRate(1),this.node.pause(),this._prevCommand=\"pause\")},fastForward:function(){var t=this.hasNode();if(t){switch(this._prevCommand){case\"slowForward\":this._speedIndex==this._playbackRateArray.length-1?(this.selectPlaybackRateArray(\"fastForward\"),this._speedIndex=0,this._prevCommand=\"fastForward\"):(this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"slowForward\");break;case\"pause\":this.selectPlaybackRateArray(\"slowForward\"),this._speedIndex=0,this.isPaused()&&t.play(),this._prevCommand=\"slowForward\";break;case\"rewind\":var e=this.calcNumberValueOfPlaybackRate(this.playbackRate);0>e?(this.selectPlaybackRateArray(\"slowForward\"),this._prevCommand=\"slowForward\"):(this.selectPlaybackRateArray(\"fastForward\"),this._prevCommand=\"fastForward\"),this._speedIndex=0;break;case\"fastForward\":this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"fastForward\";break;default:this.selectPlaybackRateArray(\"fastForward\"),this._speedIndex=0,this._prevCommand=\"fastForward\"}this.setPlaybackRate(this.selectPlaybackRate(this._speedIndex))}},rewind:function(){var t=this.hasNode();if(t){switch(this._prevCommand){case\"slowRewind\":this._speedIndex==this._playbackRateArray.length-1?(this.selectPlaybackRateArray(\"rewind\"),this._speedIndex=0,this._prevCommand=\"rewind\"):(this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"slowRewind\");break;case\"pause\":this.selectPlaybackRateArray(\"slowRewind\"),this._speedIndex=0,this.isPaused()&&this.node.duration>this.node.currentTime&&t.play(),this._prevCommand=\"slowRewind\";break;case\"rewind\":this._speedIndex=this.clampPlaybackRate(this._speedIndex+1),this._prevCommand=\"rewind\";break;default:this.selectPlaybackRateArray(\"rewind\"),this._speedIndex=0,this._prevCommand=\"rewind\"}this.setPlaybackRate(this.selectPlaybackRate(this._speedIndex))}},jumpBackward:function(){var e=this.hasNode();e&&(this.setPlaybackRate(1),e.currentTime-=this.jumpSec,this._prevCommand=\"jumpBackward\",this.doJumpBackward(t.mixin(this.createEventData(),{jumpSize:this.jumpSec})))},jumpForward:function(){var e=this.hasNode();e&&(this.setPlaybackRate(1),e.currentTime+=parseInt(this.jumpSec,10),this._prevCommand=\"jumpForward\",this.doJumpForward(t.mixin(this.createEventData(),{jumpSize:this.jumpSec})))},jumpToStart:function(){var t=this.hasNode();t&&(this.setPlaybackRate(1),t.pause(),t.currentTime=0,this._prevCommand=\"jumpToStart\")},jumpToEnd:function(){var t=this.hasNode();t&&(this.setPlaybackRate(1),t.pause(),t.currentTime=this.node.duration,this._prevCommand=\"jumpToEnd\")},selectPlaybackRateArray:function(t){this._playbackRateArray=this.playbackRateHash[t]},clampPlaybackRate:function(t){return this._playbackRateArray?t%this._playbackRateArray.length:void 0},selectPlaybackRate:function(t){return this._playbackRateArray[t]},setPlaybackRate:function(e){var n,i=this.hasNode();i&&(this.stopRewindJob(),this.playbackRate=e+=\"\",n=this.calcNumberValueOfPlaybackRate(e),i.playbackRate=n,t.platform.webos||window.PalmSystem||0>n&&this.beginRewind())},isPaused:function(){return this.hasNode()?this.hasNode().paused:!0},getCurrentTime:function(){return this.hasNode()?this.hasNode().currentTime:0},getBufferedTimeRange:function(){return this.hasNode()?this.hasNode().buffered:0},setCurrentTime:function(t){\"number\"==typeof t&&this.hasNode()&&(this.node.currentTime=t)},getDuration:function(){return this.hasNode()?this.hasNode().duration:0},getReadyState:function(){return this.hasNode()?this.hasNode().readyState:-1},getSeeking:function(){return this.hasNode()?this.hasNode().seeking:-1},beginRewind:function(){this.node.pause(),this.startRewindJob()},_rewind:function(){var e=t.perfNow(),n=e-this.rewindBeginTime,i=this.calcNumberValueOfPlaybackRate(this.playbackRate),s=Math.abs(n*i)/1e3,o=this.getCurrentTime()-s;this.setCurrentTime(o),this.startRewindJob()},startRewindJob:function(){this.rewindBeginTime=t.perfNow(),t.job(this.id+\"rewind\",this.bindSafely(\"_rewind\"),100)},stopRewindJob:function(){t.job.stop(this.id+\"rewind\")},calcNumberValueOfPlaybackRate:function(t){var e=(t+\"\").split(\"/\");return e.length>1?parseInt(e[0],10)/parseInt(e[1],10):parseInt(t,10)},metadataLoaded:function(e,n){var i=this.hasNode();this.setAspectRatio(\"none\"),i&&i.videoWidth&&i.videoHeight&&(this.setAspectRatio(i.videoWidth/i.videoHeight+\":1\"),n=t.mixin(n,this.createEventData()))},timeupdate:function(e,n){var i=this.hasNode();i&&(n=t.mixin(n,this.createEventData()))},ratechange:function(e,n){var i,s,o=this.hasNode();o&&(i=this.createEventData(),t.mixin(n,t.clone(i,!0)),i.originalEvent=t.clone(n,!0),s=this.calcNumberValueOfPlaybackRate(i.playbackRate),s>0&&1>s?this.doSlowforward(i):s>1?this.doFastforward(i):0>s&&s>=-1?this.doSlowrewind(i):-1>s?this.doRewind(i):1==s&&this.doPlay(i))},createEventData:function(){var t=this.hasNode();return t?(0===t.currentTime&&this.doStart(),{srcElement:t,duration:t.duration,currentTime:t.currentTime,playbackRate:this.getPlaybackRate()}):{}},_play:function(e,n){var i=this.hasNode();i&&(n=t.mixin(n,this.createEventData()),this.doPlay(n))},hookupVideoEvents:function(){t.makeBubble(this,\"loadstart\",\"emptied\",\"canplaythrough\",\"ended\",\"ratechange\",\"progress\",\"stalled\",\"playing\",\"durationchange\",\"volumechange\",\"suspend\",\"loadedmetadata\",\"waiting\",\"timeupdate\",\"abort\",\"loadeddata\",\"seeking\",\"play\",\"error\",\"canplay\",\"seeked\",\"pause\")}})})(enyo,this);\n\n// ../source/ui/Scrim.js\n(function(t){t.kind({name:\"enyo.Scrim\",showing:!1,classes:\"enyo-scrim enyo-fit\",floating:!1,create:function(){this.inherited(arguments),this.zStack=[],this.floating&&this.setParent(t.floatingLayer)},showingChanged:function(){this.floating&&this.showing&&!this.hasNode()&&this.render(),this.inherited(arguments)},addZIndex:function(e){0>t.indexOf(e,this.zStack)&&this.zStack.push(e)},removeZIndex:function(e){t.remove(e,this.zStack)},showAtZIndex:function(t){this.addZIndex(t),void 0!==t&&this.setZIndex(t),this.show()},hideAtZIndex:function(t){if(this.removeZIndex(t),this.zStack.length){var e=this.zStack[this.zStack.length-1];this.setZIndex(e)}else this.hide()},setZIndex:function(t){this.zIndex=t,this.applyStyle(\"z-index\",t)},make:function(){return this}}),t.kind({name:\"enyo.scrimSingleton\",kind:null,constructor:function(e,n){this.instanceName=e,t.setPath(this.instanceName,this),this.props=n||{}},make:function(){var e=new t.Scrim(this.props);return t.setPath(this.instanceName,e),e},showAtZIndex:function(t){var e=this.make();e.showAtZIndex(t)},hideAtZIndex:t.nop,show:function(){var t=this.make();t.show()}}),new t.scrimSingleton(\"enyo.scrim\",{floating:!0,classes:\"enyo-scrim-translucent\"}),new t.scrimSingleton(\"enyo.scrimTransparent\",{floating:!0,classes:\"enyo-scrim-transparent\"})})(enyo,this);\n\n// ../source/ui/data/RepeaterChildSupport.js\n(function(t){t.RepeaterChildSupport={name:\"RepeaterChildSupport\",selected:!1,cachePoint:!0,selectedChanged:t.inherit(function(t){return function(){if(this.repeater.selection){this.addRemoveClass(this.selectedClass||\"selected\",this.selected);var e=this.repeater.collection.indexOf(this.model);this.selected&&!this.repeater.isSelected(this.model)?this.repeater.select(e):!this.selected&&this.repeater.isSelected(this.model)&&this.repeater.deselect(e)}t.apply(this,arguments)}}),decorateEvent:t.inherit(function(t){return function(e,n){n.model=this.model,n.child=this,n.index=this.repeater.collection.indexOf(this.model),t.apply(this,arguments)}}),_selectionHandler:function(){this.repeater.selection&&!this.get(\"disabled\")&&(\"group\"==this.repeater.selectionType&&this.selected||this.set(\"selected\",!this.selected))},createClientComponents:t.inherit(function(){return function(t){this.createComponents(t,{owner:this})}}),dispatchEvent:t.inherit(function(e){return function(n,i,s){var o;return i.originator!==this&&i.delegate&&i.delegate.owner===this&&\"function\"!=typeof this[n]&&(o=this.getInstanceOwner(),o&&o!==this&&\"function\"==typeof o[n])?o.dispatch(n,i,s):(i._fromRepeaterChild||~t.indexOf(n,this.repeater.selectionEvents)&&(this._selectionHandler(),i._fromRepeaterChild=!0),e.apply(this,arguments))}}),constructed:t.inherit(function(t){return function(){t.apply(this,arguments);var e=this.repeater,n=e.selectionProperty;if(n){var i=this.binding({from:\"model.\"+n,to:\"selected\",oneWay:!1});this._selectionBindingId=i.euid}}}),destroy:t.inherit(function(e){return function(){if(this._selectionBindingId){var n=t.Binding.find(this._selectionBindingId);n&&n.destroy()}e.apply(this,arguments)}}),_selectionBindingId:null}})(enyo,this);\n\n// ../source/ui/data/DataRepeater.js\n(function(t){t.kind({name:\"enyo.DataRepeater\",kind:\"enyo.Control\",selection:!0,selectionType:\"single\",multipleSelection:!1,groupSelection:!1,selectionClass:\"selection-enabled\",multipleSelectionClass:\"multiple-selection-enabled\",selectionProperty:\"\",selectionEvents:\"ontap\",childBindingDefaults:null,initComponents:function(){this.initContainer();var e=this.kindComponents||this.components||[],n=this.getInstanceOwner(),i=this.defaultProps?t.clone(this.defaultProps,!0):this.defaultProps={};i.bindingTransformOwner=this,i.bindingDefaults=this.childBindingDefaults,e&&(e.length>1?i.components=e:t.mixin(i,e[0]),i.repeater=this,i.owner=n,i.mixins=i.mixins?i.mixins.concat(this.childMixins):this.childMixins),this.defaultProps=i},constructor:t.inherit(function(e){return function(){this._selection=[];var n=this.selectionEvents;this.selectionEvents=\"string\"==typeof n?n.split(\" \"):n;var i=this._handlers=t.clone(this._handlers);for(var s in i)i[s]=this.bindSafely(i[s]);e.apply(this,arguments)}}),create:t.inherit(function(t){return function(){t.apply(this,arguments),this.collectionChanged(),this.selectionType=this.multipleSelection?this.groupSelection?\"group\":\"multi\":this.selectionType,this.selectionTypeChanged()}}),groupSelectionChanged:function(){this.set(\"selectionType\",this.groupSelection?\"group\":\"single\")},multipleSelectionChanged:function(){this.set(\"selectionType\",this.multipleSelection?\"multi\":\"single\")},selectionTypeChanged:function(t){this.groupSelection=\"group\"==this.selectionType,this.multipleSelection=\"multi\"==this.selectionType,\"multi\"==t&&this._selection.length>1&&this.deselectAll(),this.selectionChanged()},selectionChanged:function(){this.addRemoveClass(this.selectionClass,this.selection),this.addRemoveClass(this.multipleSelectionClass,\"multi\"==this.selectionType&&this.selection)},reset:function(){var t=this.get(\"data\");this.destroyClientControls();for(var e,n=0;e=t.at(n);++n)this.add(e,n);this.hasReset=!0},refresh:function(t){if(!this.hasReset)return this.reset();var e=this.bindSafely(function(){for(var t,e,n=this.get(\"data\"),i=this.getClientControls(),s=0;e=n.at(s);++s)t=i[s],t?t.set(\"model\",e):this.add(e,s);this.prune()});t===!0?e():this.startJob(\"refreshing\",e,16)},rendered:t.inherit(function(t){return function(){t.apply(this,arguments),this.collection&&this.collection.length&&this.reset(),this.hasRendered=!0}}),add:function(t,e){var n=this.createComponent({model:t,index:e});this.generated&&!this.batching&&n.render()},remove:function(t){var e,n=this.getClientControls();e=n[t],e&&e.destroy()},prune:function(){var t,e=this.getClientControls(),n=this.collection?this.collection.length:0;if(e.length>n){t=e.slice(n);for(var i,s=0;i=t[s];++s)i.destroy()}},initContainer:function(){var t=this.get(\"containerOptions\"),e=t.name||(t.name=this.containerName);this.createChrome([t]),this.discoverControlParent(),e!=this.containerName&&(this.$[this.containerName]=this.$[e])},handlers:{onSelected:\"childSelected\",onDeselected:\"childDeselected\"},_handlers:{add:\"modelsAdded\",remove:\"modelsRemoved\",reset:\"refresh\",sort:\"refresh\",filter:\"refresh\"},componentsChanged:function(){this.initComponents(),this.reset()},collectionChanged:function(e){var n=this.collection;\"string\"==typeof n&&(n=this.collection=t.getPath(n)),n&&this.initCollection(n,e)},initCollection:function(t,e){var n;if(t&&t.addListener)for(n in this._handlers)t.addListener(n,this._handlers[n]);if(e&&e.removeListener)for(n in this._handlers)e.removeListener(n,this._handlers[n])},modelsAdded:function(t){t===this.collection&&this.refresh()},modelsRemoved:function(t,e,n){t===this.collection&&(this.deselectRemovedModels(n.models),this.refresh())},deselectRemovedModels:function(t){var e,n,i,s=this._selection,o=s&&s.length,r=t.length-1;if(o){for(e=s.slice();(n=t[r])&&s.length;--r)i=s.indexOf(n),i>-1&&s.splice(i,1);o!=s.length&&this.selection&&(\"multi\"==this.selectionType?this.notify(\"selected\",e,s):this.notify(\"selected\",e[0],s[0]||null))}},batchingChanged:function(t,e){this.generated&&!1===e&&(this.$[this.containerName].render(),this.refresh(!0))},getChildForIndex:function(t){return this.childForIndex(t)},childForIndex:function(t){return this.$.container.children[t]},data:function(){return this.collection},_select:function(e,n,i){if(this.selection){var s=this.getChildForIndex(e),o=this._selection,r=t.indexOf(n,o);if(i){if(-1==r){if(\"multi\"!=this.selectionType)for(;o.length;)r=this.collection.indexOf(o.pop()),this.deselect(r);o.push(n)}}else r>=0&&o.splice(r,1);s&&s.set(\"selected\",i),this.selectionProperty&&n&&(o=this.selectionProperty)&&n.set(o,i),this.notifyObservers(\"selected\")}},select:function(t){this._select(t,this.collection.at(t),!0)},deselect:function(t){this._select(t,this.collection.at(t),!1)},isSelected:function(e){return!!~t.indexOf(e,this._selection)},selectAll:function(){if(\"multi\"==this.selectionType){this.stopNotifications();var t=this._selection,e=this.collection?this.collection.length:0;t.length=0;for(var n=0;e>n;++n)this.select(n);this.startNotifications()}},deselectAll:function(){if(this.selection){this.stopNotifications();for(var t,e,n=this._selection;n.length;)t=n.pop(),e=this.collection.indexOf(t),this.deselect(e);this.startNotifications()}},selected:function(){return(\"multi\"==this.selectionType?this._selection:this._selection[0])||null},dataChanged:function(){this.collection&&this.hasRendered&&this.reset()},computed:[{method:\"selected\"},{method:\"data\",path:[\"controller\",\"collection\"]}],noDefer:!0,childMixins:[t.RepeaterChildSupport],controlParentName:\"container\",containerName:\"container\",containerOptions:{name:\"container\",classes:\"enyo-fill enyo-data-repeater-container\"},batching:!1,_selection:null}),t.DataRepeater.concat=function(e,n){var i=e.prototype||e;n.childMixins&&(i.childMixins=i.childMixins?t.merge(i.childMixins,n.childMixins):n.childMixins.slice(),delete n.childMixins)}})(enyo,this);\n\n// ../source/ui/data/DataList.js\n(function(t){t.kind({name:\"enyo.DataList\",kind:t.DataRepeater,scrollerOptions:null,orientation:\"vertical\",pageSizeMultiplier:null,fixedChildSize:null,allowTransitions:!0,renderDelay:250,visibleThreshold:.6,_absoluteShowingPriority:[\"reset\",\"refresh\",\"finish rendering\",\"scrollToIndex\",\"didResize\",\"select\"],reset:function(){this.get(\"absoluteShowing\")?this.generated&&this.$.scroller.generated&&this.delegate.reset(this):this._addToShowingQueue(\"reset\",this.reset)},refresh:function(){this.get(\"absoluteShowing\")?this.hasRendered&&this.delegate.refresh(this):this._addToShowingQueue(\"refresh\",this.refresh)},scrollToIndex:function(t){var e=this.collection?this.collection.length:0;t>=0&&e>t&&(this.get(\"absoluteShowing\")?this.delegate.scrollToIndex(this,t):this._addToShowingQueue(\"scrollToIndex\",function(){this.delegate.scrollToIndex(this,t)}))},getVisibleControlRange:function(){return this.delegate.getVisibleControlRange(this)},constructor:t.inherit(function(t){return function(){t.apply(this,arguments),this.metrics={},this.metrics.pages={},null===this.pageSizeMultiplier||isNaN(this.pageSizeMultiplier)||(this.pageSizeMultiplier=Math.max(1.2,this.pageSizeMultiplier))}}),create:t.inherit(function(t){return function(){this.allowTransitionsChanged(),this.delegate=this.ctor.delegates[this.orientation]||this.base.delegates.vertical,this.delegate.initList&&this.delegate.initList(this),t.apply(this,arguments),this.pages=[this.$.page1,this.$.page2]}}),render:t.inherit(function(t){return function(){this.$.scroller.canGenerate=!1,this.$.scroller.teardownRender(),t.apply(this,arguments)}}),rendered:function(){this.absoluteShowing=this.getAbsoluteShowing(!0);var t=function(){this.get(\"absoluteShowing\")?(this.$.scroller.canGenerate=!0,this.$.scroller.render(),this.delegate.rendered(this),this.hasRendered=!0,this.addClass(\"rendered\"),this.didRender&&this.didRender()):this._addToShowingQueue(\"finish rendering\",t)};null===this.renderDelay?t.call(this):this.startJob(\"finish rendering\",t,this.renderDelay)},_absoluteShowingChanged:function(){if(this.get(\"absoluteShowing\")&&this._showingQueueMethods){var t,e=this._showingQueueMethods;this._showingQueueMethods=null;for(var n=0;this._absoluteShowingPriority.length>n;n++)t=e[this._absoluteShowingPriority[n]],t&&t.call(this)}},_addToShowingQueue:function(t,e){var n=this._showingQueueMethods||(this._showingQueueMethods={});n[t]=e},remove:function(){},_select:t.inherit(function(t){return function(e,n,i){this.$.scroller.canGenerate?this.get(\"absoluteShowing\")?t.apply(this,arguments):this._addToShowingQueue(\"select\",function(){t.apply(this,[e,n,i])}):t.apply(this,arguments)}}),modelsAdded:function(t,e,n){t===this.collection&&this.$.scroller.canGenerate&&(this.get(\"absoluteShowing\")?this.delegate.modelsAdded(this,n):this._addToShowingQueue(\"refresh\",this.refresh))},modelsRemoved:function(t,e,n){t===this.collection&&this.$.scroller.canGenerate&&(this.deselectRemovedModels(n.models),this.get(\"absoluteShowing\")?this.delegate.modelsRemoved(this,n):this._addToShowingQueue(\"refresh\",this.refresh))},destroy:t.inherit(function(t){return function(){this.delegate&&this.delegate.destroyList&&this.delegate.destroyList(this),this._showingQueue=null,this._showingQueueMethods=null,t.apply(this,arguments)}}),initContainer:t.inherit(function(e){return function(){var n=t.clone(this.get(\"containerOptions\")),i=this.get(\"scrollerOptions\");i&&t.mixin(n,i,{exists:!0}),this.set(\"containerOptions\",n),e.apply(this,arguments)}}),didScroll:function(t,e){return this.hasRendered&&this.collection&&this.collection.length>0&&((this.heightNeedsUpdate||this.widthNeedsUpdate)&&(this.heightNeedsUpdate=this.widthNeedsUpdate=!1,this.refresh()),this.delegate.didScroll(this,e)),!0},didResize:function(t,e){this.get(\"absoluteShowing\")?this.hasRendered&&this.collection&&((this.heightNeedsUpdate||this.widthNeedsUpdate)&&(this.heightNeedsUpdate=this.widthNeedsUpdate=!1,this.refresh()),this.delegate.didResize(this,e)):this._addToShowingQueue(\"didResize\",this.didResize)},showingChangedHandler:t.inherit(function(t){return function(){return this.set(\"absoluteShowing\",this.getAbsoluteShowing(!0)),t.apply(this,arguments)}}),childForIndex:function(t){return this.generated?this.delegate.childForIndex(this,t):void 0},allowTransitionsChanged:function(){this.addRemoveClass(\"transitions\",this.allowTransitions)},containerOptions:{name:\"scroller\",kind:\"enyo.Scroller\",components:[{name:\"active\",classes:\"active\",components:[{name:\"page1\",classes:\"page page1\"},{name:\"page2\",classes:\"page page2\"},{name:\"buffer\",classes:\"buffer\"}]}],canGenerate:!1,classes:\"enyo-fit enyo-data-list-scroller\"},noDefer:!0,classes:\"enyo-data-list\",controlParentName:\"\",containerName:\"scroller\",handlers:{onScroll:\"didScroll\",onresize:\"didResize\"},observers:[{method:\"_absoluteShowingChanged\",path:\"absoluteShowing\"}],mixins:[t.RegisteredEventSupport],statics:{delegates:{}},pages:null}),t.DataList.subclass=function(e){e.delegates=t.clone(e.prototype.base.delegates||this.delegates)}})(enyo,this);\n\n// ../source/ui/data/VerticalDelegate.js\n(function(t){t.DataList.delegates.vertical={pageSizeMultiplier:2,initList:function(e){e.posProp=\"top\",e.upperProp=\"top\",e.lowerProp=\"bottom\",e.psizeProp=\"height\",e.ssizeProp=\"width\";var i=e.scrollerOptions=e.scrollerOptions?t.clone(e.scrollerOptions):{};i.vertical=\"scroll\"==i.vertical?\"scroll\":\"auto\",i.horizontal=i.horizontal||\"hidden\",null===e.controlsPerPage||isNaN(e.controlsPerPage)||(e._staticControlsPerPage=!0)},generate:function(t){for(var e,i=0;e=t.pages[i];++i)this.generatePage(t,e,e.index);this.adjustPagePositions(t),this.adjustBuffer(t)},reset:function(t){t.$.page1.index=0,t.$.page2.index=1,this.generate(t),t.hasReset=!0,this.scrollTo(t,0,0)},pagesByPosition:function(t){var e=t.metrics.pages,i=t.pagePositions||(t.pagePositions={}),n=t.upperProp,s=t.$.page1.index||0,o=t.$.page2.index||0===t.$.page2.index?t.$.page2.index:1;return i.firstPage=e[s]&&e[o]&&e[o][n]<e[s][n]?t.$.page2:t.$.page1,i.lastPage=i.firstPage===t.$.page1?t.$.page2:t.$.page1,i},refresh:function(t){return t.hasReset?(this.assignPageIndices(t),this.generate(t),void 0):this.reset(t)},rendered:function(e){e.$.scroller.addScrollListener&&(e.usingScrollListener=!0,e.$.scroller.addScrollListener(t.bindSafely(this,\"scrollHandler\",e))),this.updateBounds(e),this.calcScrollOffset(e),e.collection&&e.collection.length&&this.reset(e)},generatePage:function(e,i,n){0>n&&t.warn(\"Invalid page index: \"+n),i.index=n;var s,o=e.collection,r=e.metrics,a=this.controlsPerPage(e);i.start=a*n,i.end=Math.min(o.length-1,i.start+a-1),e.controlParent=i;for(var h=i.start;i.end>=h&&o.length>h;++h)s=i.children[h-i.start]||e.createComponent({}),s.teardownRender(),s.stopNotifications(),s.set(\"model\",o.at(h)),s.set(\"index\",h),this.checkSelected(e,s),s.set(\"selected\",e.isSelected(s.model)),s.startNotifications(),s.canGenerate=!0;for(h-=i.start;i.children.length>h;++h)s=i.children[h],s.teardownRender(),s.canGenerate=!1;i.render(),r=r.pages[n]||(r.pages[n]={}),r.height=this.pageHeight(e,i),r.width=this.pageWidth(e,i),this.childSize(e)},checkSelected:function(t,e){var i=t.selectionProperty;i&&e.model.get(i)&&!t.isSelected(e.model)&&t.select(e.index)},childSize:function(t){if(!t.fixedChildSize){var e,i,n=t.$.page1.index,s=t.psizeProp,o=t.$.page1.node||t.$.page1.hasNode();n>=0&&o&&(i=t.metrics.pages[n],e=i?i[s]:0,t.childSize=Math.floor(e/(o.children.length||1)))}return t.fixedChildSize||t.childSize||(t.childSize=100)},calculateControlsPerPage:function(t){var e=this[t.psizeProp],i=t.pageSizeMultiplier||this.pageSizeMultiplier,n=this.childSize(t);return Math.ceil(e.call(this,t)*i/n+1)},controlsPerPage:function(e,i){if(e._staticControlsPerPage)return e.controlsPerPage;var n=e._updatedControlsPerPage,s=e._updatedBounds,o=e.controlsPerPage;return(i||!n||s>n)&&(o=e.controlsPerPage=this.calculateControlsPerPage(e),e._updatedControlsPerPage=t.perfNow()),o},pageForIndex:function(t,e){var i=t.controlsPerPage||this.controlsPerPage(t);return Math.floor(e/(i||1))},scrollToControl:function(t,e){t.$.scroller.scrollToControl(e)},scrollTo:function(t,e,i){t.$.scroller.scrollTo(e,i)},scrollToIndex:function(t,e){var i=this.childForIndex(t,e),n=this.pageForIndex(t,e);0>n||n>this.pageCount(t)||(t.$.scroller.stop(),i?this.scrollToControl(t,i):(this.resetToPosition(t,this.pagePosition(t,n)),t.startJob(\"vertical_delegate_scrollToIndex\",function(){t.scrollToIndex(e)})))},pageHeight:function(t,e){var i=e.node.offsetHeight,n=t.metrics.pages[e.index],s=t.collection?t.collection.length:0;return 0===i&&s&&e.node.children.length&&(t.heightNeedsUpdate=!0,i=n?n.height:0),i},pageWidth:function(t,e){var i=e.node.offsetWidth,n=t.metrics.pages[e.index],s=t.collection?t.collection.length:0;return 0===i&&s&&e.node.children.length&&(t.widthNeedsUpdate=!0,i=n?n.width:0),i},modelsAdded:function(t,e){if(!t.hasReset)return this.reset(t);var i=this.controlsPerPage(t),n=Math.max(t.$.page1.start,t.$.page2.start)+i;if(n>=e.index)this.refresh(t);else{var s,o=this.pageForIndex(t,e.index),r=t.metrics.pages[o],a=t.psizeProp,h=this.pageCount(t);h>o&&(s=this.defaultPageSize(t),s>r[a]&&(r[a]=s)),this.adjustBuffer(t),this.adjustPagePositions(t)}},childForIndex:function(t,e){var i=this.pageForIndex(t,e),n=t.$.page1,s=t.$.page2;if(i=i==n.index&&n||i==s.index&&s)for(var o,r=0;o=i.children[r];++r)if(o.index==e)return o},modelsRemoved:function(t,e){if(!t.hasReset)return this.reset(t);var i=t.$.page1,n=t.$.page2,s=Math.max(i.end,n.end);s>=e.models.low&&this.refresh(t)},adjustBuffer:function(t){var e,i=this.pageCount(t),n=this.defaultPageSize(t),s=0,o=t.psizeProp,r=t.ssizeProp,a=t.$.buffer.node||t.$.buffer.hasNode();if(a){if(0!==i)for(var h=0;i>h;++h)e=t.metrics.pages[h],s+=e&&e[o]||n;t.bufferSize=s,a.style[o]=s+\"px\",a.style[r]=this[r](t)+\"px\",t.$.scroller.remeasure()}},adjustPagePositions:function(t){for(var e,i=0;e=t.pages[i];++i){var n=e.index,s=this.pagePosition(t,e.index),o=t.metrics.pages[n]||(t.metrics.pages[n]={}),r=t.posProp,a=t.upperProp,h=t.lowerProp,l=t.psizeProp;e.node.style[r]=s+\"px\",e[a]=o[a]=s,e[h]=o[h]=o[l]+s}this.setScrollThreshold(t)},pagePosition:function(t,e){for(var i,n=t.metrics.pages,s=this.defaultPageSize(t),o=0,r=t.psizeProp;e>0;)i=n[--e],o+=i&&i[r]?i[r]:s;return o},defaultPageSize:function(t){var e=t.controlsPerPage||this.controlsPerPage(t);return e*(t.fixedChildSize||t.childSize||100)},pageCount:function(t){var e=t.controlsPerPage||this.controlsPerPage(t),i=t.collection?t.collection.length:0;return Math.ceil(i/(e||1))},getScrollPosition:function(t){return t.$.scroller.getScrollTop()},setScrollPosition:function(t,e){t.$.scroller.setScrollTop(e)},scrollHandler:function(t,e){var i=this.pageCount(t)-1,n=this.pagesByPosition(t);1!==e.xDir&&1!==e.yDir||n.lastPage.index===i?-1!==e.xDir&&-1!==e.yDir||0===n.firstPage.index||(this.generatePage(t,n.lastPage,n.firstPage.index-1),this.adjustPagePositions(t),this.adjustBuffer(t),t.triggerEvent(\"paging\",{start:n.firstPage.start,end:n.lastPage.end,action:\"scroll\"})):(this.generatePage(t,n.firstPage,n.lastPage.index+1),this.adjustPagePositions(t),this.adjustBuffer(t),t.triggerEvent(\"paging\",{start:n.firstPage.start,end:n.lastPage.end,action:\"scroll\"}))},setScrollThreshold:function(t){var e=t.scrollThreshold||(t.scrollThreshold={}),i=t.metrics.pages,n=this.pagesByPosition(t),s=n.firstPage.index,o=n.lastPage.index,r=this.pageCount(t)-1,a=t.lowerProp,h=t.upperProp,l=\"top\"==h?this.height:this.width;e[h]=0===s?void 0:i[s][h]+this.childSize(t),e[a]=o>=r?void 0:i[o][a]-l.call(this,t)-this.childSize(t),t.usingScrollListener&&t.$.scroller.setScrollThreshold(e)},assignPageIndices:function(t,e){var i,n,s,o=this.pageCount(t),r=Math.max(0,o-1),a=this.getScrollPosition(t);e===void 0&&(e=a),e=Math.max(0,Math.min(e,t.bufferSize)),i=Math.floor(e/this.defaultPageSize(t)),i=Math.min(i,r),s=e>a?-1:1,n=0===i?1:i===r?i-1:i+s,t.$.page1.index=i,t.$.page2.index=n},resetToPosition:function(t,e){this.assignPageIndices(t,e),this.generate(t),t.triggerEvent(\"paging\",{start:t.$.page1.start,end:t.$.page2.end,action:\"reset\"})},didScroll:function(t,e){if(!t.usingScrollListener){var i=t.scrollThreshold,n=e.scrollBounds,s=this.defaultPageSize(t),o=t.lowerProp,r=t.upperProp,a=n[r],h=i[r],l=i[o];1===n.xDir||1===n.yDir?isNaN(l)||a>=l&&(a>=l+s?this.resetToPosition(t,a):this.scrollHandler(t,n)):(-1===n.yDir||-1===n.xDir)&&!isNaN(h)&&h>=a&&h>=a&&(h-s>=a?this.resetToPosition(t,a):this.scrollHandler(t,n))}},didResize:function(t){var e=t.controlsPerPage;t._updateBounds=!0,this.updateBounds(t),this.controlsPerPage(t),e!==t.controlsPerPage&&(t.metrics.pages={}),this.resetToPosition(t)},height:function(t){return t._updateBounds&&this.updateBounds(t),t.boundsCache.height},width:function(t){return t._updateBounds&&this.updateBounds(t),t.boundsCache.width},updateBounds:function(e){e.boundsCache=e.getBounds(),e._updatedBounds=t.perfNow(),e._updateBounds=!1},getVisibleControlRange:function(t){for(var e,i,n,s,o={start:-1,end:-1},r=t.posProp,a=t.psizeProp,h=this[a](t),l=this.getScrollPosition(t),c=t.pages.slice(0).sort(function(t,e){return t.start-e.start}),u=0,d=t.collection?t.collection.length-1:0,f=t.controlsPerPage;i=c[u++];)if(n=i.getBounds(),n.right=t.bufferSize-n.left-n.width,e=l-t.scrollPositionOffset,l>=n[r]&&n[r]+n[a]>l){s=f/n[a],o.start=Math.min(d,Math.max(0,Math.round((e-n[r])*s)+i.start)),o.end=Math.min(d,Math.round(h*s)+o.start);break}return o.start=this.adjustIndex(t,o.start,i,n,e,!0),o.end=Math.max(o.start,this.adjustIndex(t,o.end,i,n,e+h,!1)),o},calcScrollOffset:function(e){var i,n=e.pages[0].parent.hasNode(),s=e.$.scroller.hasNode(),o=e.posProp;n&&s?(i=t.dom.calcNodePosition(n,s),e.scrollPositionOffset=i[o]):e.scrollPositionOffset=0},adjustIndex:function(t,e,i,n,s,o){for(var r,a,h,l,c,u,d=o?-1:1,f=t.posProp,p=t.psizeProp,g=t.collection?t.collection.length-1:0;;){if(a=t.getChildForIndex(e),!a){e=r;break}if(a.parent!=i&&(i=a.parent,n=i.getBounds()),h=a.getBounds(),h.right=n.width-h.left-h.width,l=h[f]+n[f]+(o?0:h[p]),c=l-s,u=c-d*h[p]*(1-t.visibleThreshold),o&&c>0||!o&&0>c){if(r===e+d)break;r=e,e+=d}else{if(o&&u>=0||!o&&0>=u)break;if(r===e-d){e=r;break}r=e,e-=d}if(0>e){e=0;break}if(e>g){e=g;break}}return e}}})(enyo,this);\n\n// ../source/ui/data/HorizontalDelegate.js\n(function(t){var e=t.clone(t.DataList.delegates.vertical);t.kind.extendMethods(e,{initList:t.inherit(function(e){return function(i){e.apply(this,arguments),i.addClass(\"horizontal\"),i.posProp=i.rtl?\"right\":\"left\",i.upperProp=\"left\",i.lowerProp=\"right\",i.psizeProp=\"width\",i.ssizeProp=\"height\";var n=i.scrollerOptions=i.scrollerOptions?t.clone(i.scrollerOptions):{};n.vertical=\"hidden\",n.horizontal=\"scroll\"==n.horizontal?\"scroll\":\"auto\"}}),destroyList:function(t){t&&t.removeClass(\"horizontal\")},getScrollPosition:function(t){return t.$.scroller.getScrollLeft()},setScrollPosition:function(t,e){t.$.scroller.setScrollLeft(e)},adjustBuffer:t.inherit(function(t){return function(e){t.apply(this,arguments);var i=e.$.active.node||e.$.active.hasNode(),n=e.bufferSize;i&&(i.style.width=n+\"px\")}})},!0),t.DataList.delegates.horizontal=e})(enyo,this);\n\n// ../source/ui/data/DataGridList.js\n(function(t){t.kind({name:\"enyo.DataGridList\",kind:t.DataList,spacing:10,minWidth:100,minHeight:100,constructor:t.inherit(function(t){return function(){var e=this.orientation;this.orientation=\"vertical\"==e?\"verticalGrid\":\"horizontal\"==e?\"horizontalGrid\":e;var i=this.spacing;return this.spacing=0===i%2?i:Math.max(i-1,0),t.apply(this,arguments)}}),initComponents:t.inherit(function(t){return function(){t.apply(this,arguments);var e=this.defaultProps,i=\" item\";e.classes=(e.classes||\"\")+i}}),showingChanged:t.inherit(function(t){return function(){t.apply(this,arguments);var e=this.collection?this.collection.length:0;this.$.scroller.generated&&e&&this.showing&&this.didResize()}}),noDefer:!0,classes:\"enyo-data-grid-list\"})})(enyo,this);\n\n// ../source/ui/data/DataTable.js\n(function(t){t.kind({name:\"enyo.DataTable\",kind:\"enyo.DataRepeater\",defaultKind:\"enyo.TableRow\",style:\"display: table;\",containerOptions:{kind:\"enyo.Table\",name:\"container\",style:\"width: 100%;\"}})})(enyo,this);\n\n// ../source/ui/data/VerticalGridDelegate.js\n(function(t){var e=t.clone(t.DataGridList.delegates.vertical);t.kind.extendMethods(e,{rendered:function(t){this.updateMetrics(t),this.calcScrollOffset(t),t.collection&&t.collection.length&&this.reset(t)},reset:t.inherit(function(t){return function(e){t.apply(this,arguments),e.hasReset&&!e.hasClass(\"reset\")&&(e.canAddResetClass=!0)}}),pageHeight:function(t,e){var i,n=e.node||e.hasNode(),s=n.children.length,o=t.metrics.pages[e.index];return i=(Math.floor(s/t.columns)+(s%t.columns?1:0))*(t.tileHeight+t.spacing),n.style.height=i+\"px\",o.height=i,i},generatePage:t.inherit(function(t){return function(e,i){t.apply(this,arguments),this.layout(e,i)}}),pageWidth:function(t,e){var i=this.width(t),n=e.node||e.hasNode(),s=t.metrics.pages[e.index];return n.style.width=i+\"px\",s.width=i,i},defaultPageSize:function(t){return Math.ceil(this.controlsPerPage(t)/t.columns)*(t.tileHeight+t.spacing)},updateMetrics:function(t){this.updateBounds(t),this.calculateMetrics(t)},calculateMetrics:function(t,e){var i=void 0===e?this.width(t):e,n=t.spacing,s=t.minWidth,o=t.minHeight;t.columns=Math.max(Math.floor((i-n)/(s+n)),1),t.tileWidth=(i-n*(t.columns+1))/t.columns,t.tileHeight=o*(t.tileWidth/s),this.controlsPerPage(t,!0),this.updateIndexBound(t)},updateIndexBound:function(t){t.collection&&(void 0===t.boundsCache&&this.updateMetrics(t),t.indexBoundFirstRow=t.columns,t.indexBoundLastRow=(Math.ceil(t.collection.length/t.columns)-1)*t.columns-1)},modelsAdded:t.inherit(function(t){return function(e){this.calculateMetrics(e),t.apply(this,arguments)}}),modelsRemoved:t.inherit(function(t){return function(e){this.calculateMetrics(e),t.apply(this,arguments)}}),calculateControlsPerPage:t.inherit(function(t){return function(e){return t.apply(this,arguments)*e.columns}}),childSize:function(t){return t.childSize=t.tileHeight+t.spacing},layout:function(t,e){t.canAddResetClass&&(t.addClass(\"reset\"),delete t.canAddResetClass);var i,n=t.columns,s=t.spacing,o=t.tileWidth,r=t.tileHeight,a=0,h=e,l=h.children;if(l.length)for(var c,u=0;c=l[u];++u)i=u%n,c.addStyles(\"top: \"+Math.round(s+a*(r+s))+\"px; \"+(t.rtl?\"right: \":\"left: \")+Math.round(s+i*(o+s))+\"px; \"+\"width: \"+Math.round(o)+\"px; \"+\"height: \"+Math.round(r)+\"px;\"),0===(u+1)%n&&++a},adjustBuffer:function(t){var e,i=this.pageCount(t),n=this.defaultPageSize(t),s=0,o=t.psizeProp,r=t.ssizeProp,a=t.$.buffer.node||t.$.buffer.hasNode();if(a){for(var h=0;i>h;++h)e=t.metrics.pages[h],s+=e&&e[o]||n;s+=t.spacing,t.bufferSize=s,a.style[o]=s+\"px\",a.style[r]=this[r](t)+\"px\",t.$.scroller.remeasure()}},didResize:function(t){var e=t.boundsCache;t._updateBounds=!0,this.updateMetrics(t),(e.left!==t.boundsCache.left||e.top!==t.boundsCache.top||e.width!==t.boundsCache.width||e.height!==t.boundsCache.height)&&this.refresh(t)},adjustIndex:t.inherit(function(t){return function(e,i,n,s,o,r){var a=t.apply(this,arguments),h=a%e.columns;return a-h+(r?0:e.columns-1)}})},!0),t.DataGridList.delegates.verticalGrid=e})(enyo,this);\n"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/layout.js",
    "content": "// ../lib/layout/version.js\r\nenyo && enyo.version && (enyo.version.layout = \"2.6.0-pre.4.dev\");\r\n\r\n// ../lib/layout/contextual/source/ContextualLayout.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.ContextualLayout\",\r\n        kind: \"Layout\",\r\n        adjustPosition: function() {\r\n            if (this.container.showing && this.container.hasNode()) {\r\n                this.resetPositioning();\r\n                var t = this.getViewWidth(),\r\n                i = this.getViewHeight(),\r\n                o = this.container.vertFlushMargin,\r\n                s = i - this.container.vertFlushMargin,\r\n                e = this.container.horizFlushMargin,\r\n                n = t - this.container.horizFlushMargin;\r\n                if (o > this.offset.top + this.offset.height || this.offset.top > s) {\r\n                    if (this.applyVerticalFlushPositioning(e, n)) return;\r\n                    if (this.applyHorizontalFlushPositioning(e, n)) return;\r\n                    if (this.applyVerticalPositioning()) return\r\n                } else if ((e > this.offset.left + this.offset.width || this.offset.left > n) && this.applyHorizontalPositioning()) return;\r\n                var h = this.getBoundingRect(this.container.node);\r\n                if (h.width > this.container.widePopup) {\r\n                    if (this.applyVerticalPositioning()) return\r\n                } else if (h.height > this.container.longPopup && this.applyHorizontalPositioning()) return;\r\n                if (this.applyVerticalPositioning()) return;\r\n                if (this.applyHorizontalPositioning()) return\r\n            }\r\n        },\r\n        initVerticalPositioning: function() {\r\n            this.resetPositioning(),\r\n            this.container.addClass(\"vertical\");\r\n            var t = this.getBoundingRect(this.container.node),\r\n            i = this.getViewHeight();\r\n            return this.container.floating ? i / 2 > this.offset.top ? (this.applyPosition({\r\n                top: this.offset.top + this.offset.height,\r\n                bottom: \"auto\"\r\n            }), this.container.addClass(\"below\")) : (this.applyPosition({\r\n                top: this.offset.top - t.height,\r\n                bottom: \"auto\"\r\n            }), this.container.addClass(\"above\")) : t.top + t.height > i && i - t.bottom < t.top - t.height ? this.container.addClass(\"above\") : this.container.addClass(\"below\"),\r\n            t = this.getBoundingRect(this.container.node),\r\n            t.top + t.height > i || 0 > t.top ? !1 : !0\r\n        },\r\n        applyVerticalPositioning: function() {\r\n            if (!this.initVerticalPositioning()) return ! 1;\r\n            var t = this.getBoundingRect(this.container.node),\r\n            i = this.getViewWidth();\r\n            if (this.container.floating) {\r\n                var o = this.offset.left + this.offset.width / 2 - t.width / 2;\r\n                o + t.width > i ? (this.applyPosition({\r\n                    left: this.offset.left + this.offset.width - t.width\r\n                }), this.container.addClass(\"left\")) : 0 > o ? (this.applyPosition({\r\n                    left: this.offset.left\r\n                }), this.container.addClass(\"right\")) : this.applyPosition({\r\n                    left: o\r\n                })\r\n            } else {\r\n                var s = this.offset.left + this.offset.width / 2 - t.left - t.width / 2;\r\n                t.right + s > i ? (this.applyPosition({\r\n                    left: this.offset.left + this.offset.width - t.right\r\n                }), this.container.addRemoveClass(\"left\", !0)) : 0 > t.left + s ? this.container.addRemoveClass(\"right\", !0) : this.applyPosition({\r\n                    left: s\r\n                })\r\n            }\r\n            return ! 0\r\n        },\r\n        applyVerticalFlushPositioning: function(t, i) {\r\n            if (!this.initVerticalPositioning()) return ! 1;\r\n            var o = this.getBoundingRect(this.container.node),\r\n            s = this.getViewWidth();\r\n            return t > this.offset.left + this.offset.width / 2 ? (this.offset.left + this.offset.width / 2 < this.container.horizBuffer ? this.applyPosition({\r\n                left: this.container.horizBuffer + (this.container.floating ? 0 : -o.left)\r\n            }) : this.applyPosition({\r\n                left: this.offset.width / 2 + (this.container.floating ? this.offset.left: 0)\r\n            }), this.container.addClass(\"right\"), this.container.addClass(\"corner\"), !0) : this.offset.left + this.offset.width / 2 > i ? (this.offset.left + this.offset.width / 2 > s - this.container.horizBuffer ? this.applyPosition({\r\n                left: s - this.container.horizBuffer - o.right\r\n            }) : this.applyPosition({\r\n                left: this.offset.left + this.offset.width / 2 - o.right\r\n            }), this.container.addClass(\"left\"), this.container.addClass(\"corner\"), !0) : !1\r\n        },\r\n        initHorizontalPositioning: function() {\r\n            this.resetPositioning();\r\n            var t = this.getBoundingRect(this.container.node),\r\n            i = this.getViewWidth();\r\n            return this.container.floating ? i / 2 > this.offset.left + this.offset.width ? (this.applyPosition({\r\n                left: this.offset.left + this.offset.width\r\n            }), this.container.addRemoveClass(\"left\", !0)) : (this.applyPosition({\r\n                left: this.offset.left - t.width\r\n            }), this.container.addRemoveClass(\"right\", !0)) : this.offset.left - t.width > 0 ? (this.applyPosition({\r\n                left: this.offset.left - t.left - t.width\r\n            }), this.container.addRemoveClass(\"right\", !0)) : (this.applyPosition({\r\n                left: this.offset.width\r\n            }), this.container.addRemoveClass(\"left\", !0)),\r\n            this.container.addRemoveClass(\"horizontal\", !0),\r\n            t = this.getBoundingRect(this.container.node),\r\n            0 > t.left || t.left + t.width > i ? !1 : !0\r\n        },\r\n        applyHorizontalPositioning: function() {\r\n            if (!this.initHorizontalPositioning()) return ! 1;\r\n            var t = this.getBoundingRect(this.container.node),\r\n            i = this.getViewHeight(),\r\n            o = this.offset.top + this.offset.height / 2;\r\n            return this.container.floating ? o >= i / 2 - .05 * i && i / 2 + .05 * i >= o ? this.applyPosition({\r\n                top: this.offset.top + this.offset.height / 2 - t.height / 2,\r\n                bottom: \"auto\"\r\n            }) : i / 2 > this.offset.top + this.offset.height ? (this.applyPosition({\r\n                top: this.offset.top,\r\n                bottom: \"auto\"\r\n            }), this.container.addRemoveClass(\"high\", !0)) : (this.applyPosition({\r\n                top: this.offset.top - t.height + 2 * this.offset.height,\r\n                bottom: \"auto\"\r\n            }), this.container.addRemoveClass(\"low\", !0)) : o >= i / 2 - .05 * i && i / 2 + .05 * i >= o ? this.applyPosition({\r\n                top: (this.offset.height - t.height) / 2\r\n            }) : i / 2 > this.offset.top + this.offset.height ? (this.applyPosition({\r\n                top: -this.offset.height\r\n            }), this.container.addRemoveClass(\"high\", !0)) : (this.applyPosition({\r\n                top: t.top - t.height - this.offset.top + this.offset.height\r\n            }), this.container.addRemoveClass(\"low\", !0)),\r\n            !0\r\n        },\r\n        applyHorizontalFlushPositioning: function(t, i) {\r\n            if (!this.initHorizontalPositioning()) return ! 1;\r\n            var o = this.getBoundingRect(this.container.node),\r\n            s = this.getViewHeight();\r\n            return this.container.floating ? s / 2 > this.offset.top ? (this.applyPosition({\r\n                top: this.offset.top + this.offset.height / 2\r\n            }), this.container.addRemoveClass(\"high\", !0)) : (this.applyPosition({\r\n                top: this.offset.top + this.offset.height / 2 - o.height\r\n            }), this.container.addRemoveClass(\"low\", !0)) : o.top + o.height > s && s - o.bottom < o.top - o.height ? (this.applyPosition({\r\n                top: o.top - o.height - this.offset.top - this.offset.height / 2\r\n            }), this.container.addRemoveClass(\"low\", !0)) : (this.applyPosition({\r\n                top: this.offset.height / 2\r\n            }), this.container.addRemoveClass(\"high\", !0)),\r\n            t > this.offset.left + this.offset.width ? (this.container.addClass(\"left\"), this.container.addClass(\"corner\"), !0) : this.offset.left > i ? (this.container.addClass(\"right\"), this.container.addClass(\"corner\"), !0) : !1\r\n        },\r\n        getBoundingRect: function(t) {\r\n            var i = t.getBoundingClientRect();\r\n            return i.width && i.height ? i: {\r\n                left: i.left,\r\n                right: i.right,\r\n                top: i.top,\r\n                bottom: i.bottom,\r\n                width: i.right - i.left,\r\n                height: i.bottom - i.top\r\n            }\r\n        },\r\n        getViewHeight: function() {\r\n            return void 0 === window.innerHeight ? document.documentElement.clientHeight: window.innerHeight\r\n        },\r\n        getViewWidth: function() {\r\n            return void 0 === window.innerWidth ? document.documentElement.clientWidth: window.innerWidth\r\n        },\r\n        applyPosition: function(t) {\r\n            var i = \"\";\r\n            for (var o in t) i += o + \":\" + t[o] + (isNaN(t[o]) ? \"; \": \"px; \");\r\n            this.container.addStyles(i)\r\n        },\r\n        resetPositioning: function() {\r\n            this.container.removeClass(\"right\"),\r\n            this.container.removeClass(\"left\"),\r\n            this.container.removeClass(\"high\"),\r\n            this.container.removeClass(\"low\"),\r\n            this.container.removeClass(\"corner\"),\r\n            this.container.removeClass(\"below\"),\r\n            this.container.removeClass(\"above\"),\r\n            this.container.removeClass(\"vertical\"),\r\n            this.container.removeClass(\"horizontal\"),\r\n            this.applyPosition({\r\n                left: \"auto\"\r\n            }),\r\n            this.applyPosition({\r\n                top: \"auto\"\r\n            })\r\n        },\r\n        reflow: function() {\r\n            this.offset = this.container.activatorOffset,\r\n            this.adjustPosition()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/fittable/source/FittableLayout.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.FittableLayout\",\r\n        kind: \"Layout\",\r\n        noDefer: !0,\r\n        constructor: t.inherit(function(i) {\r\n            return function() {\r\n                i.apply(this, arguments),\r\n                this.container.addRemoveClass(\"force-left-to-right\", t.Control.prototype.rtl && !this.container.get(\"rtl\")),\r\n                this.useFlex = t.FittableLayout.flexAvailable && this.container.useFlex === !0,\r\n                this.useFlex ? this.container.addClass(this.flexLayoutClass) : this.container.addClass(this.fitLayoutClass)\r\n            }\r\n        }),\r\n        calcFitIndex: function() {\r\n            var t, i, e = this.container.children;\r\n            for (i = 0; e.length > i; i++) if (t = e[i], t.fit && t.showing) return i\r\n        },\r\n        getFitControl: function() {\r\n            var t = this.container.children,\r\n            i = t[this.fitIndex];\r\n            return i && i.fit && i.showing || (this.fitIndex = this.calcFitIndex(), i = t[this.fitIndex]),\r\n            i\r\n        },\r\n        shouldReverse: function() {\r\n            return this.container.rtl && \"h\" === this.orient\r\n        },\r\n        destroy: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.container && this.container.removeClass(this.useFlex ? this.flexLayoutClass: this.fitLayoutClass)\r\n            }\r\n        }),\r\n        getFirstChild: function() {\r\n            var t = this.getShowingChildren();\r\n            return this.shouldReverse() ? t[t.length - 1] : t[0]\r\n        },\r\n        getLastChild: function() {\r\n            var t = this.getShowingChildren();\r\n            return this.shouldReverse() ? t[0] : t[t.length - 1]\r\n        },\r\n        getShowingChildren: function() {\r\n            for (var t = [], i = 0, e = this.container.children, o = e.length; o > i; i++) e[i].showing && t.push(e[i]);\r\n            return t\r\n        },\r\n        _reflow: function(i, e, o, s) {\r\n            this.container.addRemoveClass(\"enyo-stretch\", !this.container.noStretch);\r\n            var n, h, a, r, l, f = this.getFitControl(),\r\n            d = this.container.hasNode(),\r\n            c = 0,\r\n            g = 0,\r\n            u = 0;\r\n            if (f && d) {\r\n                if (n = t.dom.calcPaddingExtents(d), h = f.getBounds(), c = d[e] - (n[o] + n[s]), this.shouldReverse()) {\r\n                    r = this.getFirstChild(),\r\n                    u = c - (h[o] + h[i]);\r\n                    var p = t.dom.getComputedBoxValue(r.hasNode(), \"margin\", o) || 0;\r\n                    if (r == f) g = p;\r\n                    else {\r\n                        var y = r.getBounds(),\r\n                        v = y[o];\r\n                        g = h[o] + p - v\r\n                    }\r\n                } else {\r\n                    a = this.getLastChild(),\r\n                    g = h[o] - (n[o] || 0);\r\n                    var C = t.dom.getComputedBoxValue(a.hasNode(), \"margin\", s) || 0;\r\n                    if (a == f) u = C;\r\n                    else {\r\n                        var w = a.getBounds(),\r\n                        m = h[o] + h[i],\r\n                        P = w[o] + w[i] + C;\r\n                        u = P - m\r\n                    }\r\n                }\r\n                l = c - (g + u),\r\n                f.applyStyle(i, l + \"px\")\r\n            }\r\n        },\r\n        flow: function() {\r\n            if (this.useFlex) {\r\n                var t, i, e = this.container.children;\r\n                for (this.container.addClass(this.flexLayoutClass), this.container.addRemoveClass(\"nostretch\", this.container.noStretch), t = 0; e.length > t; t++) i = e[t],\r\n                i.addClass(\"enyo-flex-item\"),\r\n                i.addRemoveClass(\"flex\", i.fit)\r\n            }\r\n        },\r\n        reflow: function() {\r\n            this.useFlex || (\"h\" == this.orient ? this._reflow(\"width\", \"clientWidth\", \"left\", \"right\") : this._reflow(\"height\", \"clientHeight\", \"top\", \"bottom\"))\r\n        },\r\n        statics: {\r\n            flexAvailable: !1\r\n        }\r\n    }),\r\n    t.kind({\r\n        name: \"enyo.FittableColumnsLayout\",\r\n        kind: \"FittableLayout\",\r\n        orient: \"h\",\r\n        fitLayoutClass: \"enyo-fittable-columns-layout\",\r\n        flexLayoutClass: \"enyo-flex-container columns\"\r\n    }),\r\n    t.kind({\r\n        name: \"enyo.FittableRowsLayout\",\r\n        kind: \"FittableLayout\",\r\n        fitLayoutClass: \"enyo-fittable-rows-layout\",\r\n        orient: \"v\",\r\n        flexLayoutClass: \"enyo-flex-container rows\"\r\n    }),\r\n    function() {\r\n        var i = document.createElement(\"div\");\r\n        t.FittableLayout.flexAvailable = void 0 !== i.style.flexBasis || void 0 !== i.style.webkitFlexBasis || void 0 !== i.style.mozFlexBasis || void 0 !== i.style.msFlexBasis\r\n    } ()\r\n})(enyo, this);\r\n\r\n// ../lib/layout/fittable/source/FittableRows.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.FittableRows\",\r\n        layoutKind: \"FittableRowsLayout\",\r\n        noStretch: !1\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/fittable/source/FittableColumns.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.FittableColumns\",\r\n        layoutKind: \"FittableColumnsLayout\",\r\n        noStretch: !1\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/fittable/source/FittableHeaderLayout.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.FittableHeaderLayout\",\r\n        kind: \"FittableColumnsLayout\",\r\n        applyFitSize: t.inherit(function(t) {\r\n            return function(i, e, o, s) {\r\n                var n = o - s,\r\n                h = this.getFitControl();\r\n                0 > n ? (h.applyStyle(\"padding-left\", Math.abs(n) + \"px\"), h.applyStyle(\"padding-right\", null)) : n > 0 ? (h.applyStyle(\"padding-left\", null), h.applyStyle(\"padding-right\", Math.abs(n) + \"px\")) : (h.applyStyle(\"padding-left\", null), h.applyStyle(\"padding-right\", null)),\r\n                t.apply(this, arguments)\r\n            }\r\n        })\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/list/source/FlyweightRepeater.js\r\n(function(t) {\r\n    var i = t.HTMLStringDelegate,\r\n    e = Object.create(i);\r\n    e.generateInnerHtml = function(t) {\r\n        var e = \"\";\r\n        t.index = null;\r\n        for (var n = 0,\r\n        o = 0; t.count > n; n++) o = t.rowOffset + (this.bottomUp ? t.count - n - 1 : n),\r\n        t.setupItem(o),\r\n        t.$.client.setAttribute(\"data-enyo-index\", o),\r\n        \"h\" == t.orient && t.$.client.setStyle(\"display:inline-block;\"),\r\n        e += i.generateChildHtml(t),\r\n        t.$.client.teardownRender();\r\n        return e\r\n    },\r\n    t.kind({\r\n        name: \"enyo.FlyweightRepeater\",\r\n        kind: \"enyo.Control\",\r\n        published: {\r\n            count: 0,\r\n            noSelect: !1,\r\n            multiSelect: !1,\r\n            toggleSelected: !1,\r\n            clientClasses: \"\",\r\n            clientStyle: \"\",\r\n            rowOffset: 0,\r\n            orient: \"v\"\r\n        },\r\n        events: {\r\n            onSetupItem: \"\",\r\n            onRenderRow: \"\"\r\n        },\r\n        cachePoint: !0,\r\n        bottomUp: !1,\r\n        renderDelegate: e,\r\n        components: [{\r\n            kind: \"Selection\",\r\n            onSelect: \"selectDeselect\",\r\n            onDeselect: \"selectDeselect\"\r\n        },\r\n        {\r\n            name: \"client\"\r\n        }],\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.noSelectChanged(),\r\n                this.multiSelectChanged(),\r\n                this.clientClassesChanged(),\r\n                this.clientStyleChanged()\r\n            }\r\n        }),\r\n        noSelectChanged: function() {\r\n            this.noSelect && this.$.selection.clear()\r\n        },\r\n        multiSelectChanged: function() {\r\n            this.$.selection.setMulti(this.multiSelect)\r\n        },\r\n        clientClassesChanged: function() {\r\n            this.$.client.setClasses(this.clientClasses)\r\n        },\r\n        clientStyleChanged: function() {\r\n            this.$.client.setStyle(this.clientStyle)\r\n        },\r\n        setupItem: function(t) {\r\n            this.doSetupItem({\r\n                index: t,\r\n                selected: this.isSelected(t)\r\n            })\r\n        },\r\n        generateChildHtml: function() {\r\n            return this.renderDelegate.generateInnerHtml(this)\r\n        },\r\n        previewDomEvent: function(t) {\r\n            var i = this.index = this.rowForEvent(t);\r\n            t.rowIndex = t.index = i,\r\n            t.flyweight = this\r\n        },\r\n        decorateEvent: t.inherit(function(t) {\r\n            return function(i, e) {\r\n                var n = e && null != e.index ? e.index: this.index;\r\n                e && null != n && (e.index = n, e.flyweight = this),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        tap: function(t, i) {\r\n            this.noSelect || -1 === i.index || (this.toggleSelected ? this.$.selection.toggle(i.index) : this.$.selection.select(i.index))\r\n        },\r\n        selectDeselect: function(t, i) {\r\n            this.renderRow(i.key)\r\n        },\r\n        getSelection: function() {\r\n            return this.$.selection\r\n        },\r\n        isSelected: function(t) {\r\n            return this.getSelection().isSelected(t)\r\n        },\r\n        renderRow: function(i) {\r\n            if (! (this.rowOffset > i || i >= this.count + this.rowOffset)) {\r\n                this.setupItem(i);\r\n                var e = this.fetchRowNode(i);\r\n                if (e) {\r\n                    var n = t.HTMLStringDelegate;\r\n                    t.dom.setInnerHtml(e, n.generateChildHtml(this.$.client)),\r\n                    this.$.client.teardownChildren(),\r\n                    this.doRenderRow({\r\n                        rowIndex: i\r\n                    })\r\n                }\r\n            }\r\n        },\r\n        fetchRowNode: function(t) {\r\n            return this.hasNode() ? this.node.querySelector('[data-enyo-index=\"' + t + '\"]') : void 0\r\n        },\r\n        rowForEvent: function(t) {\r\n            if (!this.hasNode()) return - 1;\r\n            for (var i = t.target; i && i !== this.node;) {\r\n                var e = i.getAttribute && i.getAttribute(\"data-enyo-index\");\r\n                if (null !== e) return Number(e);\r\n                i = i.parentNode\r\n            }\r\n            return - 1\r\n        },\r\n        prepareRow: function(i) {\r\n            if (! (this.rowOffset > i || i >= this.count + this.rowOffset)) {\r\n                this.setupItem(i);\r\n                var e = this.fetchRowNode(i);\r\n                t.FlyweightRepeater.claimNode(this.$.client, e)\r\n            }\r\n        },\r\n        lockRow: function() {\r\n            this.$.client.teardownChildren()\r\n        },\r\n        performOnRow: function(i, e, n) {\r\n            this.rowOffset > i || i >= this.count + this.rowOffset || e && (this.prepareRow(i), t.call(n || null, e), this.lockRow())\r\n        },\r\n        statics: {\r\n            claimNode: function(t, i) {\r\n                var e;\r\n                i && (e = i.id !== t.id ? i.querySelector(\"#\" + t.id) : i),\r\n                t.generated = Boolean(e || !t.tag),\r\n                t.node = e,\r\n                t.node && t.rendered();\r\n                for (var n, o = 0,\r\n                s = t.children; n = s[o]; o++) this.claimNode(n, i)\r\n            }\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/list/source/List.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.List\",\r\n        kind: \"Scroller\",\r\n        classes: \"enyo-list\",\r\n        published: {\r\n            count: 0,\r\n            rowsPerPage: 50,\r\n            orient: \"v\",\r\n            bottomUp: !1,\r\n            noSelect: !1,\r\n            multiSelect: !1,\r\n            toggleSelected: !1,\r\n            fixedSize: !1,\r\n            reorderable: !1,\r\n            centerReorderContainer: !0,\r\n            reorderComponents: [],\r\n            pinnedReorderComponents: [],\r\n            swipeableComponents: [],\r\n            enableSwipe: !1,\r\n            persistSwipeableItem: !1\r\n        },\r\n        events: {\r\n            onSetupItem: \"\",\r\n            onSetupReorderComponents: \"\",\r\n            onSetupPinnedReorderComponents: \"\",\r\n            onReorder: \"\",\r\n            onSetupSwipeItem: \"\",\r\n            onSwipeDrag: \"\",\r\n            onSwipe: \"\",\r\n            onSwipeComplete: \"\"\r\n        },\r\n        handlers: {\r\n            onAnimateFinish: \"animateFinish\",\r\n            onRenderRow: \"rowRendered\",\r\n            ondragstart: \"dragstart\",\r\n            ondrag: \"drag\",\r\n            ondragfinish: \"dragfinish\",\r\n            onup: \"up\",\r\n            onholdpulse: \"holdpulse\",\r\n            onflick: \"flick\"\r\n        },\r\n        rowSize: 0,\r\n        listTools: [{\r\n            name: \"port\",\r\n            classes: \"enyo-list-port enyo-border-box\",\r\n            components: [{\r\n                name: \"generator\",\r\n                kind: \"FlyweightRepeater\",\r\n                canGenerate: !1,\r\n                components: [{\r\n                    tag: null,\r\n                    name: \"client\"\r\n                }]\r\n            },\r\n            {\r\n                name: \"holdingarea\",\r\n                allowHtml: !0,\r\n                classes: \"enyo-list-holdingarea\"\r\n            },\r\n            {\r\n                name: \"page0\",\r\n                allowHtml: !0,\r\n                classes: \"enyo-list-page\"\r\n            },\r\n            {\r\n                name: \"page1\",\r\n                allowHtml: !0,\r\n                classes: \"enyo-list-page\"\r\n            },\r\n            {\r\n                name: \"placeholder\",\r\n                classes: \"enyo-list-placeholder\"\r\n            },\r\n            {\r\n                name: \"swipeableComponents\",\r\n                style: \"position:absolute; display:block; top:-1000px; left:0;\"\r\n            }]\r\n        }],\r\n        reorderHoldTimeMS: 600,\r\n        draggingRowIndex: -1,\r\n        initHoldCounter: 3,\r\n        holdCounter: 3,\r\n        holding: !1,\r\n        placeholderRowIndex: -1,\r\n        dragToScrollThreshold: .1,\r\n        scrollDistance: 0,\r\n        prevScrollTop: 0,\r\n        autoScrollTimeoutMS: 20,\r\n        autoScrollTimeout: null,\r\n        autoscrollPageY: 0,\r\n        pinnedReorderMode: !1,\r\n        initialPinPosition: -1,\r\n        itemMoved: !1,\r\n        currentPageNumber: -1,\r\n        completeReorderTimeout: null,\r\n        swipeIndex: null,\r\n        swipeDirection: null,\r\n        persistentItemVisible: !1,\r\n        persistentItemOrigin: null,\r\n        swipeComplete: !1,\r\n        completeSwipeTimeout: null,\r\n        completeSwipeDelayMS: 500,\r\n        normalSwipeSpeedMS: 200,\r\n        fastSwipeSpeedMS: 100,\r\n        percentageDraggedThreshold: .2,\r\n        importProps: t.inherit(function(t) {\r\n            return function(e) {\r\n                e && e.reorderable && (this.touch = !0),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                this.pageSizes = [],\r\n                this.orientV = \"v\" == this.orient,\r\n                this.vertical = this.orientV ? \"default\": \"hidden\",\r\n                t.apply(this, arguments),\r\n                this.$.generator.orient = this.orient,\r\n                this.getStrategy().translateOptimized = !0,\r\n                this.$.port.addRemoveClass(\"horizontal\", !this.orientV),\r\n                this.$.port.addRemoveClass(\"vertical\", this.orientV),\r\n                this.$.page0.addRemoveClass(\"vertical\", this.orientV),\r\n                this.$.page1.addRemoveClass(\"vertical\", this.orientV),\r\n                this.bottomUpChanged(),\r\n                this.noSelectChanged(),\r\n                this.multiSelectChanged(),\r\n                this.toggleSelectedChanged(),\r\n                this.$.generator.setRowOffset(0),\r\n                this.$.generator.setCount(this.count)\r\n            }\r\n        }),\r\n        initComponents: t.inherit(function(t) {\r\n            return function() {\r\n                this.createReorderTools(),\r\n                t.apply(this, arguments),\r\n                this.createSwipeableComponents()\r\n            }\r\n        }),\r\n        createReorderTools: function() {\r\n            this.createComponent({\r\n                name: \"reorderContainer\",\r\n                classes: \"enyo-list-reorder-container\",\r\n                ondown: \"sendToStrategy\",\r\n                ondrag: \"sendToStrategy\",\r\n                ondragstart: \"sendToStrategy\",\r\n                ondragfinish: \"sendToStrategy\",\r\n                onflick: \"sendToStrategy\"\r\n            })\r\n        },\r\n        createStrategy: t.inherit(function(t) {\r\n            return function() {\r\n                this.controlParentName = \"strategy\",\r\n                t.apply(this, arguments),\r\n                this.createChrome(this.listTools),\r\n                this.controlParentName = \"client\",\r\n                this.discoverControlParent()\r\n            }\r\n        }),\r\n        createSwipeableComponents: function() {\r\n            for (var t = 0; this.swipeableComponents.length > t; t++) this.$.swipeableComponents.createComponent(this.swipeableComponents[t], {\r\n                owner: this.owner\r\n            })\r\n        },\r\n        rendered: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.$.generator.node = this.$.port.hasNode(),\r\n                this.$.generator.generated = !0,\r\n                this.reset()\r\n            }\r\n        }),\r\n        handleResize: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.refresh()\r\n            }\r\n        }),\r\n        bottomUpChanged: function() {\r\n            this.$.generator.bottomUp = this.bottomUp,\r\n            this.$.page0.applyStyle(this.pageBound, null),\r\n            this.$.page1.applyStyle(this.pageBound, null),\r\n            this.pageBound = this.orientV ? this.bottomUp ? \"bottom\": \"top\": this.rtl ? this.bottomUp ? \"left\": \"right\": this.bottomUp ? \"right\": \"left\",\r\n            !this.orientV && this.bottomUp && (this.$.page0.applyStyle(\"left\", \"auto\"), this.$.page1.applyStyle(\"left\", \"auto\")),\r\n            this.hasNode() && this.reset()\r\n        },\r\n        noSelectChanged: function() {\r\n            this.$.generator.setNoSelect(this.noSelect)\r\n        },\r\n        multiSelectChanged: function() {\r\n            this.$.generator.setMultiSelect(this.multiSelect)\r\n        },\r\n        toggleSelectedChanged: function() {\r\n            this.$.generator.setToggleSelected(this.toggleSelected)\r\n        },\r\n        countChanged: function() {\r\n            this.hasNode() && this.updateMetrics()\r\n        },\r\n        sendToStrategy: function(t, e) {\r\n            this.$.strategy.dispatchEvent(\"on\" + e.type, e, t)\r\n        },\r\n        updateMetrics: function() {\r\n            this.defaultPageSize = this.rowsPerPage * (this.rowSize || 100),\r\n            this.pageCount = Math.ceil(this.count / this.rowsPerPage),\r\n            this.portSize = 0;\r\n            for (var t = 0; this.pageCount > t; t++) this.portSize += this.getPageSize(t);\r\n            this.adjustPortSize()\r\n        },\r\n        holdpulse: function(t, e) {\r\n            return this.getReorderable() && !this.isReordering() ? e.holdTime >= this.reorderHoldTimeMS && this.shouldStartReordering(t, e) ? (this.startReordering(e), !1) : void 0 : void 0\r\n        },\r\n        dragstart: function(t, e) {\r\n            return this.isReordering() ? !0 : this.isSwipeable() ? this.swipeDragStart(t, e) : void 0\r\n        },\r\n        drag: function(t, e) {\r\n            return this.shouldDoReorderDrag(e) ? (e.preventDefault(), this.reorderDrag(e), !0) : this.isSwipeable() ? (e.preventDefault(), this.swipeDrag(t, e), !0) : void 0\r\n        },\r\n        dragfinish: function(t, e) {\r\n            this.isReordering() ? this.finishReordering(t, e) : this.isSwipeable() && this.swipeDragFinish(t, e)\r\n        },\r\n        up: function(t, e) {\r\n            this.isReordering() && this.finishReordering(t, e)\r\n        },\r\n        generatePage: function(t, e) {\r\n            this.page = t;\r\n            var i = this.rowsPerPage * this.page;\r\n            this.$.generator.setRowOffset(i);\r\n            var o = Math.min(this.count - i, this.rowsPerPage);\r\n            this.$.generator.setCount(o);\r\n            var n = this.$.generator.generateChildHtml();\r\n            e.setContent(n),\r\n            this.getReorderable() && this.draggingRowIndex > -1 && this.hideReorderingRow();\r\n            var s = e.getBounds(),\r\n            r = this.orientV ? s.height: s.width;\r\n            if (!this.rowSize && r > 0 && (this.rowSize = Math.floor(r / o), this.updateMetrics()), !this.fixedSize) {\r\n                var h = this.getPageSize(t);\r\n                h != r && r > 0 && (this.pageSizes[t] = r, this.portSize += r - h)\r\n            }\r\n        },\r\n        pageForRow: function(t) {\r\n            return Math.floor(t / this.rowsPerPage)\r\n        },\r\n        update: function(t) {\r\n            var e = !1,\r\n            i = this.positionToPageInfo(t),\r\n            o = i.pos + this.scrollerSize / 2,\r\n            n = Math.floor(o / Math.max(i.size, this.scrollerSize) + .5) + i.no,\r\n            s = 0 === n % 2 ? n: n - 1;\r\n            this.p0 != s && this.isPageInRange(s) && (this.removedInitialPage = this.removedInitialPage || this.draggingRowPage == this.p0, this.generatePage(s, this.$.page0), this.positionPage(s, this.$.page0), this.p0 = s, e = !0, this.p0RowBounds = this.getPageRowSizes(this.$.page0)),\r\n            s = 0 === n % 2 ? Math.max(1, n - 1) : n,\r\n            this.p1 != s && this.isPageInRange(s) && (this.removedInitialPage = this.removedInitialPage || this.draggingRowPage == this.p1, this.generatePage(s, this.$.page1), this.positionPage(s, this.$.page1), this.p1 = s, e = !0, this.p1RowBounds = this.getPageRowSizes(this.$.page1)),\r\n            e && (this.$.generator.setRowOffset(0), this.$.generator.setCount(this.count), this.fixedSize || (this.adjustBottomPage(), this.adjustPortSize()))\r\n        },\r\n        getPageRowSizes: function(e) {\r\n            for (var i, o, n = {},\r\n            s = e.hasNode().querySelectorAll(\"div[data-enyo-index]\"), r = 0; s.length > r; r++) i = s[r].getAttribute(\"data-enyo-index\"),\r\n            null !== i && (o = t.dom.getBounds(s[r]), n[parseInt(i, 10)] = {\r\n                height: o.height,\r\n                width: o.width\r\n            });\r\n            return n\r\n        },\r\n        updateRowBounds: function(t) {\r\n            this.p0RowBounds[t] ? this.updateRowBoundsAtIndex(t, this.p0RowBounds, this.$.page0) : this.p1RowBounds[t] && this.updateRowBoundsAtIndex(t, this.p1RowBounds, this.$.page1)\r\n        },\r\n        updateRowBoundsAtIndex: function(e, i, o) {\r\n            var n = o.hasNode().querySelector('div[data-enyo-index=\"' + e + '\"]'),\r\n            s = t.dom.getBounds(n);\r\n            i[e].height = s.height,\r\n            i[e].width = s.width\r\n        },\r\n        updateForPosition: function(t) {\r\n            this.update(this.calcPos(t))\r\n        },\r\n        calcPos: function(t) {\r\n            return this.bottomUp ? this.portSize - this.scrollerSize - t: t\r\n        },\r\n        adjustBottomPage: function() {\r\n            var t = this.p0 >= this.p1 ? this.$.page0: this.$.page1;\r\n            this.positionPage(t.pageNo, t)\r\n        },\r\n        adjustPortSize: function() {\r\n            this.scrollerSize = this.orientV ? this.getBounds().height: this.getBounds().width;\r\n            var t = Math.max(this.scrollerSize, this.portSize);\r\n            this.$.port.applyStyle(this.orientV ? \"height\": \"width\", t + \"px\"),\r\n            this.orientV || this.$.port.applyStyle(\"height\", this.getBounds().height + \"px\")\r\n        },\r\n        positionPage: function(t, e) {\r\n            e.pageNo = t;\r\n            var i = this.pageToPosition(t);\r\n            e.applyStyle(this.pageBound, i + \"px\")\r\n        },\r\n        pageToPosition: function(t) {\r\n            for (var e = 0; t > 0;) t--,\r\n            e += this.getPageSize(t);\r\n            return e\r\n        },\r\n        positionToPageInfo: function(t) {\r\n            for (var e = -1,\r\n            i = this.calcPos(t), o = this.defaultPageSize; i >= 0;) e++,\r\n            o = this.getPageSize(e),\r\n            i -= o;\r\n            return e = Math.max(e, 0),\r\n            {\r\n                no: e,\r\n                size: o,\r\n                pos: i + o,\r\n                startRow: e * this.rowsPerPage,\r\n                endRow: Math.min((e + 1) * this.rowsPerPage - 1, this.count - 1)\r\n            }\r\n        },\r\n        isPageInRange: function(t) {\r\n            return t == Math.max(0, Math.min(this.pageCount - 1, t))\r\n        },\r\n        getPageSize: function(t) {\r\n            var e = this.pageSizes[t];\r\n            if (!e) {\r\n                var i = this.rowsPerPage * t,\r\n                o = Math.min(this.count - i, this.rowsPerPage);\r\n                e = this.defaultPageSize * (o / this.rowsPerPage)\r\n            }\r\n            return Math.max(1, e)\r\n        },\r\n        invalidatePages: function() {\r\n            this.p0 = this.p1 = null,\r\n            this.p0RowBounds = {},\r\n            this.p1RowBounds = {},\r\n            this.$.page0.setContent(\"\"),\r\n            this.$.page1.setContent(\"\")\r\n        },\r\n        invalidateMetrics: function() {\r\n            this.pageSizes = [],\r\n            this.rowSize = 0,\r\n            this.updateMetrics()\r\n        },\r\n        scroll: t.inherit(function(t) {\r\n            return function(e, i) {\r\n                var o = t.apply(this, arguments),\r\n                n = this.orientV ? this.getScrollTop() : this.getScrollLeft();\r\n                return this.lastPos === n ? o: (this.lastPos = n, this.update(n), this.pinnedReorderMode && this.reorderScroll(e, i), o)\r\n            }\r\n        }),\r\n        setScrollTop: t.inherit(function(t) {\r\n            return function(e) {\r\n                this.update(e),\r\n                t.apply(this, arguments),\r\n                this.twiddle()\r\n            }\r\n        }),\r\n        getScrollPosition: function() {\r\n            return this.calcPos(this[this.orientV ? \"getScrollTop\": \"getScrollLeft\"]())\r\n        },\r\n        setScrollPosition: function(t) {\r\n            this[this.orientV ? \"setScrollTop\": \"setScrollLeft\"](this.calcPos(t))\r\n        },\r\n        scrollToBottom: t.inherit(function(t) {\r\n            return function() {\r\n                this.update(this.getScrollBounds().maxTop),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        scrollToRow: function(t) {\r\n            var e = this.pageForRow(t),\r\n            i = this.pageToPosition(e);\r\n            if (this.updateForPosition(i), i = this.pageToPosition(e), this.setScrollPosition(i), e == this.p0 || e == this.p1) {\r\n                var o = this.$.generator.fetchRowNode(t);\r\n                if (o) {\r\n                    var n = this.orientV ? o.offsetTop: o.offsetLeft;\r\n                    this.bottomUp && (n = this.getPageSize(e) - (this.orientV ? o.offsetHeight: o.offsetWidth) - n);\r\n                    var s = this.getScrollPosition() + n;\r\n                    this.setScrollPosition(s)\r\n                }\r\n            }\r\n        },\r\n        scrollToStart: function() {\r\n            this[this.bottomUp ? this.orientV ? \"scrollToBottom\": \"scrollToRight\": \"scrollToTop\"]()\r\n        },\r\n        scrollToEnd: function() {\r\n            this[this.bottomUp ? this.orientV ? \"scrollToTop\": \"scrollToLeft\": this.orientV ? \"scrollToBottom\": \"scrollToRight\"]()\r\n        },\r\n        refresh: function() {\r\n            this.invalidatePages(),\r\n            this.update(this[this.orientV ? \"getScrollTop\": \"getScrollLeft\"]()),\r\n            this.stabilize(),\r\n            4 === t.platform.android && this.twiddle()\r\n        },\r\n        reset: function() {\r\n            this.getSelection().clear(),\r\n            this.invalidateMetrics(),\r\n            this.invalidatePages(),\r\n            this.stabilize(),\r\n            this.scrollToStart()\r\n        },\r\n        getSelection: function() {\r\n            return this.$.generator.getSelection()\r\n        },\r\n        select: function(t, e) {\r\n            return this.getSelection().select(t, e)\r\n        },\r\n        deselect: function(t) {\r\n            return this.getSelection().deselect(t)\r\n        },\r\n        isSelected: function(t) {\r\n            return this.$.generator.isSelected(t)\r\n        },\r\n        renderRow: function(t) {\r\n            this.$.generator.renderRow(t)\r\n        },\r\n        rowRendered: function(t, e) {\r\n            this.updateRowBounds(e.rowIndex)\r\n        },\r\n        prepareRow: function(t) {\r\n            this.$.generator.prepareRow(t)\r\n        },\r\n        lockRow: function() {\r\n            this.$.generator.lockRow()\r\n        },\r\n        performOnRow: function(t, e, i) {\r\n            this.$.generator.performOnRow(t, e, i)\r\n        },\r\n        animateFinish: function() {\r\n            return this.twiddle(),\r\n            !0\r\n        },\r\n        twiddle: function() {\r\n            var e = this.getStrategy();\r\n            t.call(e, \"twiddle\")\r\n        },\r\n        pageForPageNumber: function(t, e) {\r\n            return 0 === t % 2 ? e && t !== this.p0 ? null: this.$.page0: e && t !== this.p1 ? null: this.$.page1\r\n        },\r\n        shouldStartReordering: function(t, e) {\r\n            return ! this.getReorderable() || null == e.rowIndex || 0 > e.rowIndex || this.pinnedReorderMode || null == e.index || 0 > e.index ? !1 : !0\r\n        },\r\n        startReordering: function(t) {\r\n            this.$.strategy.listReordering = !0,\r\n            this.buildReorderContainer(),\r\n            this.doSetupReorderComponents({\r\n                index: t.index\r\n            }),\r\n            this.styleReorderContainer(t),\r\n            this.draggingRowIndex = this.placeholderRowIndex = t.rowIndex,\r\n            this.draggingRowPage = this.pageForRow(this.draggingRowIndex),\r\n            this.removeDraggingRowNode = t.dispatchTarget.retainNode(t.target),\r\n            this.removedInitialPage = !1,\r\n            this.itemMoved = !1,\r\n            this.initialPageNumber = this.currentPageNumber = this.pageForRow(t.rowIndex),\r\n            this.prevScrollTop = this.getScrollTop(),\r\n            this.replaceNodeWithPlaceholder(t.rowIndex)\r\n        },\r\n        buildReorderContainer: function() {\r\n            this.$.reorderContainer.destroyClientControls();\r\n            for (var t = 0; this.reorderComponents.length > t; t++) this.$.reorderContainer.createComponent(this.reorderComponents[t], {\r\n                owner: this.owner\r\n            });\r\n            this.$.reorderContainer.render()\r\n        },\r\n        styleReorderContainer: function(t) {\r\n            this.setItemPosition(this.$.reorderContainer, t.rowIndex),\r\n            this.setItemBounds(this.$.reorderContainer, t.rowIndex),\r\n            this.$.reorderContainer.setShowing(!0),\r\n            this.centerReorderContainer && this.centerReorderContainerOnPointer(t)\r\n        },\r\n        appendNodeToReorderContainer: function(t) {\r\n            this.$.reorderContainer.createComponent({\r\n                allowHtml: !0,\r\n                content: t.innerHTML\r\n            }).render()\r\n        },\r\n        centerReorderContainerOnPointer: function(e) {\r\n            var i = t.dom.calcNodePosition(this.hasNode()),\r\n            o = this.$.reorderContainer.getBounds(),\r\n            n = e.pageX - i.left - parseInt(o.width, 10) / 2,\r\n            s = e.pageY - i.top + this.getScrollTop() - parseInt(o.height, 10) / 2;\r\n            \"ScrollStrategy\" != this.getStrategyKind() && (n -= this.getScrollLeft(), s -= this.getScrollTop()),\r\n            this.positionReorderContainer(n, s)\r\n        },\r\n        positionReorderContainer: function(t, e) {\r\n            this.$.reorderContainer.addClass(\"enyo-animatedTopAndLeft\"),\r\n            this.$.reorderContainer.addStyles(\"left:\" + t + \"px;top:\" + e + \"px;\"),\r\n            this.setPositionReorderContainerTimeout()\r\n        },\r\n        setPositionReorderContainerTimeout: function() {\r\n            this.clearPositionReorderContainerTimeout(),\r\n            this.positionReorderContainerTimeout = setTimeout(this.bindSafely(function() {\r\n                this.$.reorderContainer.removeClass(\"enyo-animatedTopAndLeft\"),\r\n                this.clearPositionReorderContainerTimeout()\r\n            }), 100)\r\n        },\r\n        clearPositionReorderContainerTimeout: function() {\r\n            this.positionReorderContainerTimeout && (clearTimeout(this.positionReorderContainerTimeout), this.positionReorderContainerTimeout = null)\r\n        },\r\n        shouldDoReorderDrag: function() {\r\n            return ! this.getReorderable() || 0 > this.draggingRowIndex || this.pinnedReorderMode ? !1 : !0\r\n        },\r\n        reorderDrag: function(t) {\r\n            this.positionReorderNode(t),\r\n            this.checkForAutoScroll(t),\r\n            this.updatePlaceholderPosition(t.pageY)\r\n        },\r\n        updatePlaceholderPosition: function(t) {\r\n            var e = this.getRowIndexFromCoordinate(t); - 1 !== e && (e >= this.placeholderRowIndex ? this.movePlaceholderToIndex(Math.min(this.count, e + 1)) : this.movePlaceholderToIndex(e))\r\n        },\r\n        positionReorderNode: function(t) {\r\n            var e = this.$.reorderContainer.getBounds(),\r\n            i = e.left + t.ddx,\r\n            o = e.top + t.ddy;\r\n            o = \"ScrollStrategy\" == this.getStrategyKind() ? o + (this.getScrollTop() - this.prevScrollTop) : o,\r\n            this.$.reorderContainer.addStyles(\"top: \" + o + \"px ; left: \" + i + \"px\"),\r\n            this.prevScrollTop = this.getScrollTop()\r\n        },\r\n        checkForAutoScroll: function(e) {\r\n            var i, o = t.dom.calcNodePosition(this.hasNode()),\r\n            n = this.getBounds();\r\n            this.autoscrollPageY = e.pageY,\r\n            e.pageY - o.top < n.height * this.dragToScrollThreshold ? (i = 100 * (1 - (e.pageY - o.top) / (n.height * this.dragToScrollThreshold)), this.scrollDistance = -1 * i) : e.pageY - o.top > n.height * (1 - this.dragToScrollThreshold) ? (i = 100 * ((e.pageY - o.top - n.height * (1 - this.dragToScrollThreshold)) / (n.height - n.height * (1 - this.dragToScrollThreshold))), this.scrollDistance = 1 * i) : this.scrollDistance = 0,\r\n            0 === this.scrollDistance ? this.stopAutoScrolling() : this.autoScrollTimeout || this.startAutoScrolling()\r\n        },\r\n        stopAutoScrolling: function() {\r\n            this.autoScrollTimeout && (clearTimeout(this.autoScrollTimeout), this.autoScrollTimeout = null)\r\n        },\r\n        startAutoScrolling: function() {\r\n            this.autoScrollTimeout = setInterval(this.bindSafely(this.autoScroll), this.autoScrollTimeoutMS)\r\n        },\r\n        autoScroll: function() {\r\n            0 === this.scrollDistance ? this.stopAutoScrolling() : this.autoScrollTimeout || this.startAutoScrolling(),\r\n            this.setScrollPosition(this.getScrollPosition() + this.scrollDistance),\r\n            this.positionReorderNode({\r\n                ddx: 0,\r\n                ddy: 0\r\n            }),\r\n            this.updatePlaceholderPosition(this.autoscrollPageY)\r\n        },\r\n        movePlaceholderToIndex: function(t) {\r\n            var e, i;\r\n            if (! (0 > t)) {\r\n                t >= this.count ? (e = null, i = this.pageForPageNumber(this.pageForRow(this.count - 1)).hasNode()) : (e = this.$.generator.fetchRowNode(t), i = e.parentNode);\r\n                var o = this.pageForRow(t);\r\n                o >= this.pageCount && (o = this.currentPageNumber),\r\n                i.insertBefore(this.placeholderNode, e),\r\n                this.currentPageNumber !== o && (this.updatePageSize(this.currentPageNumber), this.updatePageSize(o), this.updatePagePositions(o)),\r\n                this.placeholderRowIndex = t,\r\n                this.currentPageNumber = o,\r\n                this.itemMoved = !0\r\n            }\r\n        },\r\n        finishReordering: function(t, e) {\r\n            return ! this.isReordering() || this.pinnedReorderMode || this.completeReorderTimeout ? void 0 : (this.stopAutoScrolling(), this.$.strategy.listReordering = !1, this.moveReorderedContainerToDroppedPosition(e), this.completeReorderTimeout = setTimeout(this.bindSafely(this.completeFinishReordering, e), 100), e.preventDefault(), !0)\r\n        },\r\n        moveReorderedContainerToDroppedPosition: function() {\r\n            var t = this.getRelativeOffset(this.placeholderNode, this.hasNode()),\r\n            e = \"ScrollStrategy\" == this.getStrategyKind() ? t.top: t.top - this.getScrollTop(),\r\n            i = t.left - this.getScrollLeft();\r\n            this.positionReorderContainer(i, e)\r\n        },\r\n        completeFinishReordering: function(t) {\r\n            return this.completeReorderTimeout = null,\r\n            this.placeholderRowIndex > this.draggingRowIndex && (this.placeholderRowIndex = Math.max(0, this.placeholderRowIndex - 1)),\r\n            this.draggingRowIndex != this.placeholderRowIndex || !this.pinnedReorderComponents.length || this.pinnedReorderMode || this.itemMoved ? (this.removeDraggingRowNode(), this.removePlaceholderNode(), this.emptyAndHideReorderContainer(), this.pinnedReorderMode = !1, this.reorderRows(t), this.draggingRowIndex = this.placeholderRowIndex = -1, this.refresh(), void 0) : (this.beginPinnedReorder(t), void 0)\r\n        },\r\n        beginPinnedReorder: function(e) {\r\n            this.buildPinnedReorderContainer(),\r\n            this.doSetupPinnedReorderComponents(t.mixin(e, {\r\n                index: this.draggingRowIndex\r\n            })),\r\n            this.pinnedReorderMode = !0,\r\n            this.initialPinPosition = e.pageY\r\n        },\r\n        emptyAndHideReorderContainer: function() {\r\n            this.$.reorderContainer.destroyComponents(),\r\n            this.$.reorderContainer.setShowing(!1)\r\n        },\r\n        buildPinnedReorderContainer: function() {\r\n            this.$.reorderContainer.destroyClientControls();\r\n            for (var t = 0; this.pinnedReorderComponents.length > t; t++) this.$.reorderContainer.createComponent(this.pinnedReorderComponents[t], {\r\n                owner: this.owner\r\n            });\r\n            this.$.reorderContainer.render()\r\n        },\r\n        reorderRows: function(t) {\r\n            this.doReorder(this.makeReorderEvent(t)),\r\n            this.positionReorderedNode(),\r\n            this.updateListIndices()\r\n        },\r\n        makeReorderEvent: function(t) {\r\n            return t.reorderFrom = this.draggingRowIndex,\r\n            t.reorderTo = this.placeholderRowIndex,\r\n            t\r\n        },\r\n        positionReorderedNode: function() {\r\n            if (!this.removedInitialPage) {\r\n                var t = this.$.generator.fetchRowNode(this.placeholderRowIndex);\r\n                if (t && (t.parentNode.insertBefore(this.hiddenNode, t), this.showNode(this.hiddenNode)), this.hiddenNode = null, this.currentPageNumber != this.initialPageNumber) {\r\n                    var e, i, o = this.pageForPageNumber(this.currentPageNumber),\r\n                    n = this.pageForPageNumber(this.currentPageNumber + 1);\r\n                    this.initialPageNumber < this.currentPageNumber ? (e = o.hasNode().firstChild, n.hasNode().appendChild(e)) : (e = o.hasNode().lastChild, i = n.hasNode().firstChild, n.hasNode().insertBefore(e, i)),\r\n                    this.correctPageSizes(),\r\n                    this.updatePagePositions(this.initialPageNumber)\r\n                }\r\n            }\r\n        },\r\n        updateListIndices: function() {\r\n            if (this.shouldDoRefresh()) return this.refresh(),\r\n            this.correctPageSizes(),\r\n            void 0;\r\n            var t, e, i, o, n = Math.min(this.draggingRowIndex, this.placeholderRowIndex),\r\n            s = Math.max(this.draggingRowIndex, this.placeholderRowIndex),\r\n            r = this.draggingRowIndex - this.placeholderRowIndex > 0 ? 1 : -1;\r\n            if (1 === r) {\r\n                for (t = this.$.generator.fetchRowNode(this.draggingRowIndex), t && t.setAttribute(\"data-enyo-index\", \"reordered\"), e = s - 1, i = s; e >= n; e--) t = this.$.generator.fetchRowNode(e),\r\n                t && (o = parseInt(t.getAttribute(\"data-enyo-index\"), 10), i = o + 1, t.setAttribute(\"data-enyo-index\", i));\r\n                t = this.hasNode().querySelector('[data-enyo-index=\"reordered\"]'),\r\n                t.setAttribute(\"data-enyo-index\", this.placeholderRowIndex)\r\n            } else for (t = this.$.generator.fetchRowNode(this.draggingRowIndex), t && t.setAttribute(\"data-enyo-index\", this.placeholderRowIndex), e = n + 1, i = n; s >= e; e++) t = this.$.generator.fetchRowNode(e),\r\n            t && (o = parseInt(t.getAttribute(\"data-enyo-index\"), 10), i = o - 1, t.setAttribute(\"data-enyo-index\", i))\r\n        },\r\n        shouldDoRefresh: function() {\r\n            return Math.abs(this.initialPageNumber - this.currentPageNumber) > 1\r\n        },\r\n        getNodeStyle: function(e) {\r\n            var i = this.$.generator.fetchRowNode(e);\r\n            if (i) {\r\n                var o = this.getRelativeOffset(i, this.hasNode()),\r\n                n = t.dom.getBounds(i);\r\n                return {\r\n                    h: n.height,\r\n                    w: n.width,\r\n                    left: o.left,\r\n                    top: o.top\r\n                }\r\n            }\r\n        },\r\n        getRelativeOffset: function(t, e) {\r\n            var i = {\r\n                top: 0,\r\n                left: 0\r\n            };\r\n            if (t !== e && t.parentNode) do i.top += t.offsetTop || 0,\r\n            i.left += t.offsetLeft || 0,\r\n            t = t.offsetParent;\r\n            while (t && t !== e);\r\n            return i\r\n        },\r\n        replaceNodeWithPlaceholder: function(e) {\r\n            var i = this.$.generator.fetchRowNode(e);\r\n            if (!i) return t.log(\"No node - \" + e),\r\n            void 0;\r\n            this.placeholderNode = this.createPlaceholderNode(i),\r\n            this.hiddenNode = this.hideNode(i);\r\n            var o = this.pageForPageNumber(this.currentPageNumber);\r\n            o.hasNode().insertBefore(this.placeholderNode, this.hiddenNode)\r\n        },\r\n        createPlaceholderNode: function(e) {\r\n            var i = this.$.placeholder.hasNode().cloneNode(!0),\r\n            o = t.dom.getBounds(e);\r\n            return i.style.height = o.height + \"px\",\r\n            i.style.width = o.width + \"px\",\r\n            i\r\n        },\r\n        removePlaceholderNode: function() {\r\n            this.removeNode(this.placeholderNode),\r\n            this.placeholderNode = null\r\n        },\r\n        removeNode: function(t) {\r\n            t && t.parentNode && t.parentNode.removeChild(t)\r\n        },\r\n        updatePageSize: function(t) {\r\n            if (! (0 > t)) {\r\n                var e = this.pageForPageNumber(t, !0);\r\n                if (e) {\r\n                    var i = this.pageSizes[t],\r\n                    o = Math.max(1, e.getBounds().height);\r\n                    this.pageSizes[t] = o,\r\n                    this.portSize += o - i\r\n                }\r\n            }\r\n        },\r\n        updatePagePositions: function(t) {\r\n            this.positionPage(this.currentPageNumber, this.pageForPageNumber(this.currentPageNumber)),\r\n            this.positionPage(t, this.pageForPageNumber(t))\r\n        },\r\n        correctPageSizes: function() {\r\n            var t = this.initialPageNumber % 2;\r\n            this.updatePageSize(this.currentPageNumber, this.$[\"page\" + this.currentPage]),\r\n            t != this.currentPageNumber && this.updatePageSize(this.initialPageNumber, this.$[\"page\" + t])\r\n        },\r\n        hideNode: function(t) {\r\n            return t.style.display = \"none\",\r\n            t\r\n        },\r\n        showNode: function(t) {\r\n            return t.style.display = \"block\",\r\n            t\r\n        },\r\n        dropPinnedRow: function(t) {\r\n            this.moveReorderedContainerToDroppedPosition(t),\r\n            this.completeReorderTimeout = setTimeout(this.bindSafely(this.completeFinishReordering, t), 100)\r\n        },\r\n        cancelPinnedMode: function(t) {\r\n            this.placeholderRowIndex = this.draggingRowIndex,\r\n            this.dropPinnedRow(t)\r\n        },\r\n        getRowIndexFromCoordinate: function(e) {\r\n            var i = this.getScrollTop() + e - t.dom.calcNodePosition(this.hasNode()).top;\r\n            if (0 > i) return - 1;\r\n            var o = this.positionToPageInfo(i),\r\n            n = o.no == this.p0 ? this.p0RowBounds: this.p1RowBounds;\r\n            if (!n) return this.count;\r\n            for (var s = o.pos,\r\n            r = this.placeholderNode ? t.dom.getBounds(this.placeholderNode).height: 0, h = 0, a = o.startRow; o.endRow >= a; ++a) {\r\n                if (a === this.placeholderRowIndex && (h += r, h >= s)) return - 1;\r\n                if (a !== this.draggingRowIndex && (h += n[a].height, h >= s)) return a\r\n            }\r\n            return a\r\n        },\r\n        getIndexPosition: function(e) {\r\n            return t.dom.calcNodePosition(this.$.generator.fetchRowNode(e))\r\n        },\r\n        setItemPosition: function(t, e) {\r\n            var i = this.getNodeStyle(e),\r\n            o = \"ScrollStrategy\" == this.getStrategyKind() ? i.top: i.top - this.getScrollTop(),\r\n            n = \"top:\" + o + \"px; left:\" + i.left + \"px;\";\r\n            t.addStyles(n)\r\n        },\r\n        setItemBounds: function(t, e) {\r\n            var i = this.getNodeStyle(e),\r\n            o = \"width:\" + i.w + \"px; height:\" + i.h + \"px;\";\r\n            t.addStyles(o)\r\n        },\r\n        reorderScroll: function() {\r\n            \"ScrollStrategy\" == this.getStrategyKind() && this.$.reorderContainer.addStyles(\"top:\" + (this.initialPinPosition + this.getScrollTop() - this.rowSize) + \"px;\"),\r\n            this.updatePlaceholderPosition(this.initialPinPosition)\r\n        },\r\n        hideReorderingRow: function() {\r\n            var t = this.hasNode().querySelector('[data-enyo-index=\"' + this.draggingRowIndex + '\"]');\r\n            t && (this.hiddenNode = this.hideNode(t))\r\n        },\r\n        isReordering: function() {\r\n            return this.draggingRowIndex > -1\r\n        },\r\n        isSwiping: function() {\r\n            return null != this.swipeIndex && !this.swipeComplete && null != this.swipeDirection\r\n        },\r\n        swipeDragStart: function(t, e) {\r\n            return null == e.index || e.vertical ? !0 : (this.completeSwipeTimeout && this.completeSwipe(e), this.swipeComplete = !1, this.swipeIndex != e.index && (this.clearSwipeables(), this.swipeIndex = e.index), this.swipeDirection = e.xDirection, this.persistentItemVisible || this.startSwipe(e), this.draggedXDistance = 0, this.draggedYDistance = 0, !0)\r\n        },\r\n        swipeDrag: function(t, e) {\r\n            return this.persistentItemVisible ? (this.dragPersistentItem(e), this.preventDragPropagation) : this.isSwiping() ? (this.dragSwipeableComponents(this.calcNewDragPosition(e.ddx)), this.draggedXDistance = e.dx, this.draggedYDistance = e.dy, e.xDirection != this.lastSwipeDirection && e.xDirection && (this.lastSwipeDirection = e.xDirection), !0) : !1\r\n        },\r\n        swipeDragFinish: function(t, e) {\r\n            if (this.persistentItemVisible) this.dragFinishPersistentItem(e);\r\n            else {\r\n                if (!this.isSwiping()) return ! 1;\r\n                var i = this.calcPercentageDragged(this.draggedXDistance);\r\n                i > this.percentageDraggedThreshold && this.lastSwipeDirection === this.swipeDirection ? this.swipe(this.fastSwipeSpeedMS) : this.backOutSwipe(e)\r\n            }\r\n            return this.preventDragPropagation\r\n        },\r\n        isSwipeable: function() {\r\n            return this.enableSwipe && 0 !== this.$.swipeableComponents.controls.length && !this.isReordering() && !this.pinnedReorderMode\r\n        },\r\n        positionSwipeableContainer: function(e, i) {\r\n            var o = this.$.generator.fetchRowNode(e);\r\n            if (o) {\r\n                var n = this.getRelativeOffset(o, this.hasNode()),\r\n                s = t.dom.getBounds(o),\r\n                r = 1 == i ? -1 * s.width: s.width;\r\n                this.$.swipeableComponents.addStyles(\"top: \" + n.top + \"px; left: \" + r + \"px; height: \" + s.height + \"px; width: \" + s.width + \"px;\")\r\n            }\r\n        },\r\n        calcNewDragPosition: function(t) {\r\n            var e = this.$.swipeableComponents.getBounds(),\r\n            i = e.left,\r\n            o = this.$.swipeableComponents.getBounds(),\r\n            n = 1 == this.swipeDirection ? 0 : -1 * o.width,\r\n            s = 1 == this.swipeDirection ? i + t > n ? n: i + t: n > i + t ? n: i + t;\r\n            return s\r\n        },\r\n        dragSwipeableComponents: function(t) {\r\n            this.$.swipeableComponents.applyStyle(\"left\", t + \"px\")\r\n        },\r\n        startSwipe: function(t) {\r\n            t.index = this.swipeIndex,\r\n            this.positionSwipeableContainer(this.swipeIndex, t.xDirection),\r\n            this.$.swipeableComponents.setShowing(!0),\r\n            this.setPersistentItemOrigin(t.xDirection),\r\n            this.doSetupSwipeItem(t)\r\n        },\r\n        dragPersistentItem: function(t) {\r\n            var e = 0,\r\n            i = \"right\" == this.persistentItemOrigin ? Math.max(e, e + t.dx) : Math.min(e, e + t.dx);\r\n            this.$.swipeableComponents.applyStyle(\"left\", i + \"px\")\r\n        },\r\n        dragFinishPersistentItem: function(t) {\r\n            var e = this.calcPercentageDragged(t.dx) > .2,\r\n            i = t.dx > 0 ? \"right\": 0 > t.dx ? \"left\": null;\r\n            this.persistentItemOrigin == i ? e ? this.slideAwayItem() : this.bounceItem(t) : this.bounceItem(t)\r\n        },\r\n        setPersistentItemOrigin: function(t) {\r\n            this.persistentItemOrigin = 1 == t ? \"left\": \"right\"\r\n        },\r\n        calcPercentageDragged: function(t) {\r\n            return Math.abs(t / this.$.swipeableComponents.getBounds().width)\r\n        },\r\n        swipe: function(t) {\r\n            this.swipeComplete = !0,\r\n            this.animateSwipe(0, t)\r\n        },\r\n        backOutSwipe: function() {\r\n            var t = this.$.swipeableComponents.getBounds(),\r\n            e = 1 == this.swipeDirection ? -1 * t.width: t.width;\r\n            this.animateSwipe(e, this.fastSwipeSpeedMS),\r\n            this.swipeDirection = null\r\n        },\r\n        bounceItem: function() {\r\n            var t = this.$.swipeableComponents.getBounds();\r\n            t.left != t.width && this.animateSwipe(0, this.normalSwipeSpeedMS)\r\n        },\r\n        slideAwayItem: function() {\r\n            var t = this.$.swipeableComponents,\r\n            e = t.getBounds().width,\r\n            i = \"left\" == this.persistentItemOrigin ? -1 * e: e;\r\n            this.animateSwipe(i, this.normalSwipeSpeedMS),\r\n            this.persistentItemVisible = !1,\r\n            this.setPersistSwipeableItem(!1)\r\n        },\r\n        clearSwipeables: function() {\r\n            this.$.swipeableComponents.setShowing(!1),\r\n            this.persistentItemVisible = !1,\r\n            this.setPersistSwipeableItem(!1)\r\n        },\r\n        completeSwipe: function() {\r\n            this.completeSwipeTimeout && (clearTimeout(this.completeSwipeTimeout), this.completeSwipeTimeout = null),\r\n            this.getPersistSwipeableItem() ? this.swipeComplete && (this.persistentItemVisible = !0) : (this.$.swipeableComponents.setShowing(!1), this.swipeComplete && this.doSwipeComplete({\r\n                index: this.swipeIndex,\r\n                xDirection: this.swipeDirection\r\n            })),\r\n            this.swipeIndex = null,\r\n            this.swipeDirection = null\r\n        },\r\n        animateSwipe: function(e, i) {\r\n            var o = t.now(),\r\n            n = this.$.swipeableComponents,\r\n            s = parseInt(n.getBounds().left, 10),\r\n            r = e - s;\r\n            this.stopAnimateSwipe();\r\n            var h = this.bindSafely(function() {\r\n                var e = t.now() - o,\r\n                a = e / i,\r\n                l = s + r * Math.min(a, 1);\r\n                n.applyStyle(\"left\", l + \"px\"),\r\n                this.job = t.requestAnimationFrame(h),\r\n                e / i >= 1 && (this.stopAnimateSwipe(), this.completeSwipeTimeout = setTimeout(this.bindSafely(function() {\r\n                    this.completeSwipe()\r\n                }), this.completeSwipeDelayMS))\r\n            });\r\n            this.job = t.requestAnimationFrame(h)\r\n        },\r\n        stopAnimateSwipe: function() {\r\n            this.job && (this.job = t.cancelRequestAnimationFrame(this.job))\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/list/source/PulldownList.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.PulldownList\",\r\n        kind: \"List\",\r\n        touch: !0,\r\n        pully: null,\r\n        pulldownTools: [{\r\n            name: \"pulldown\",\r\n            classes: \"enyo-list-pulldown\",\r\n            components: [{\r\n                name: \"puller\",\r\n                kind: \"Puller\"\r\n            }]\r\n        }],\r\n        events: {\r\n            onPullStart: \"\",\r\n            onPullCancel: \"\",\r\n            onPull: \"\",\r\n            onPullRelease: \"\",\r\n            onPullComplete: \"\"\r\n        },\r\n        handlers: {\r\n            onScrollStart: \"scrollStartHandler\",\r\n            onScrollStop: \"scrollStopHandler\",\r\n            ondragfinish: \"dragfinish\"\r\n        },\r\n        pullingMessage: \"Pull down to refresh...\",\r\n        pulledMessage: \"Release to refresh...\",\r\n        loadingMessage: \"Loading...\",\r\n        pullingIconClass: \"enyo-puller-arrow enyo-puller-arrow-down\",\r\n        pulledIconClass: \"enyo-puller-arrow enyo-puller-arrow-up\",\r\n        loadingIconClass: \"\",\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                var e = {\r\n                    kind: \"Puller\",\r\n                    showing: !1,\r\n                    text: this.loadingMessage,\r\n                    iconClass: this.loadingIconClass,\r\n                    onCreate: \"setPully\"\r\n                };\r\n                this.listTools.splice(0, 0, e),\r\n                t.apply(this, arguments),\r\n                this.setPulling()\r\n            }\r\n        }),\r\n        initComponents: t.inherit(function(e) {\r\n            return function() {\r\n                this.createChrome(this.pulldownTools),\r\n                this.accel = t.dom.canAccelerate(),\r\n                this.translation = this.accel ? \"translate3d\": \"translate\",\r\n                this.strategyKind = this.resetStrategyKind(),\r\n                e.apply(this, arguments)\r\n            }\r\n        }),\r\n        resetStrategyKind: function() {\r\n            return t.platform.android >= 3 ? \"TranslateScrollStrategy\": \"TouchScrollStrategy\"\r\n        },\r\n        setPully: function(t, e) {\r\n            this.pully = e.originator\r\n        },\r\n        scrollStartHandler: function() {\r\n            this.firedPullStart = !1,\r\n            this.firedPull = !1,\r\n            this.firedPullCancel = !1\r\n        },\r\n        scroll: t.inherit(function(e) {\r\n            return function() {\r\n                var i = e.apply(this, arguments);\r\n                this.completingPull && this.pully.setShowing(!1);\r\n                var o = this.getStrategy().$.scrollMath || this.getStrategy(),\r\n                n = -1 * this.getScrollTop();\r\n                return o.isInOverScroll() && n > 0 && (t.dom.transformValue(this.$.pulldown, this.translation, \"0,\" + n + \"px\" + (this.accel ? \",0\": \"\")), this.firedPullStart || (this.firedPullStart = !0, this.pullStart(), this.pullHeight = this.$.pulldown.getBounds().height), n > this.pullHeight && !this.firedPull && (this.firedPull = !0, this.firedPullCancel = !1, this.pull()), this.firedPull && !this.firedPullCancel && this.pullHeight > n && (this.firedPullCancel = !0, this.firedPull = !1, this.pullCancel())),\r\n                i\r\n            }\r\n        }),\r\n        scrollStopHandler: function() {\r\n            this.completingPull && (this.completingPull = !1, this.doPullComplete())\r\n        },\r\n        dragfinish: function() {\r\n            if (this.firedPull) {\r\n                var t = this.getStrategy().$.scrollMath || this.getStrategy();\r\n                t.setScrollY( - 1 * this.getScrollTop() - this.pullHeight),\r\n                this.pullRelease()\r\n            }\r\n        },\r\n        completePull: function() {\r\n            this.completingPull = !0;\r\n            var t = this.getStrategy().$.scrollMath || this.getStrategy();\r\n            t.setScrollY(this.pullHeight),\r\n            t.start()\r\n        },\r\n        pullStart: function() {\r\n            this.setPulling(),\r\n            this.pully.setShowing(!1),\r\n            this.$.puller.setShowing(!0),\r\n            this.doPullStart()\r\n        },\r\n        pull: function() {\r\n            this.setPulled(),\r\n            this.doPull()\r\n        },\r\n        pullCancel: function() {\r\n            this.setPulling(),\r\n            this.doPullCancel()\r\n        },\r\n        pullRelease: function() {\r\n            this.$.puller.setShowing(!1),\r\n            this.pully.setShowing(!0),\r\n            this.doPullRelease()\r\n        },\r\n        setPulling: function() {\r\n            this.$.puller.setText(this.pullingMessage),\r\n            this.$.puller.setIconClass(this.pullingIconClass)\r\n        },\r\n        setPulled: function() {\r\n            this.$.puller.setText(this.pulledMessage),\r\n            this.$.puller.setIconClass(this.pulledIconClass)\r\n        }\r\n    }),\r\n    t.kind({\r\n        name: \"enyo.Puller\",\r\n        kind: \"enyo.Control\",\r\n        classes: \"enyo-puller\",\r\n        published: {\r\n            text: \"\",\r\n            iconClass: \"\"\r\n        },\r\n        events: {\r\n            onCreate: \"\"\r\n        },\r\n        components: [{\r\n            name: \"icon\"\r\n        },\r\n        {\r\n            name: \"text\",\r\n            tag: \"span\",\r\n            classes: \"enyo-puller-text\"\r\n        }],\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.doCreate(),\r\n                this.textChanged(),\r\n                this.iconClassChanged()\r\n            }\r\n        }),\r\n        textChanged: function() {\r\n            this.$.text.setContent(this.text)\r\n        },\r\n        iconClassChanged: function() {\r\n            this.$.icon.setClasses(this.iconClass)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/list/source/AroundList.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.AroundList\",\r\n        kind: \"enyo.List\",\r\n        listTools: [{\r\n            name: \"port\",\r\n            classes: \"enyo-list-port enyo-border-box\",\r\n            components: [{\r\n                name: \"aboveClient\"\r\n            },\r\n            {\r\n                name: \"generator\",\r\n                kind: \"FlyweightRepeater\",\r\n                canGenerate: !1,\r\n                components: [{\r\n                    tag: null,\r\n                    name: \"client\"\r\n                }]\r\n            },\r\n            {\r\n                name: \"holdingarea\",\r\n                allowHtml: !0,\r\n                classes: \"enyo-list-holdingarea\"\r\n            },\r\n            {\r\n                name: \"page0\",\r\n                allowHtml: !0,\r\n                classes: \"enyo-list-page\"\r\n            },\r\n            {\r\n                name: \"page1\",\r\n                allowHtml: !0,\r\n                classes: \"enyo-list-page\"\r\n            },\r\n            {\r\n                name: \"belowClient\"\r\n            },\r\n            {\r\n                name: \"placeholder\"\r\n            },\r\n            {\r\n                name: \"swipeableComponents\",\r\n                style: \"position:absolute; display:block; top:-1000px; left:0px;\"\r\n            }]\r\n        }],\r\n        aboveComponents: null,\r\n        belowComponents: null,\r\n        initComponents: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.aboveComponents && this.$.aboveClient.createComponents(this.aboveComponents, {\r\n                    owner: this.owner\r\n                }),\r\n                this.belowComponents && this.$.belowClient.createComponents(this.belowComponents, {\r\n                    owner: this.owner\r\n                })\r\n            }\r\n        }),\r\n        updateMetrics: function() {\r\n            this.defaultPageSize = this.rowsPerPage * (this.rowSize || 100),\r\n            this.pageCount = Math.ceil(this.count / this.rowsPerPage),\r\n            this.aboveHeight = this.$.aboveClient.getBounds().height,\r\n            this.belowHeight = this.$.belowClient.getBounds().height,\r\n            this.portSize = this.aboveHeight + this.belowHeight;\r\n            for (var t = 0; this.pageCount > t; t++) this.portSize += this.getPageSize(t);\r\n            this.adjustPortSize()\r\n        },\r\n        positionPage: function(t, e) {\r\n            e.pageNo = t;\r\n            var i = this.pageToPosition(t),\r\n            o = this.bottomUp ? this.belowHeight: this.aboveHeight;\r\n            i += o,\r\n            e.applyStyle(this.pageBound, i + \"px\")\r\n        },\r\n        scrollToContentStart: function() {\r\n            var t = this.bottomUp ? this.belowHeight: this.aboveHeight;\r\n            this.setScrollPosition(t)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/list/source/GridListImageItem.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.GridListImageItem\",\r\n        classes: \"enyo-gridlist-imageitem\",\r\n        components: [{\r\n            name: \"image\",\r\n            kind: \"enyo.Image\",\r\n            classes: \"image\"\r\n        },\r\n        {\r\n            name: \"caption\",\r\n            classes: \"caption\"\r\n        },\r\n        {\r\n            name: \"subCaption\",\r\n            classes: \"sub-caption\"\r\n        }],\r\n        published: {\r\n            source: \"\",\r\n            caption: \"\",\r\n            subCaption: \"\",\r\n            selected: !1,\r\n            centered: !0,\r\n            imageSizing: \"\",\r\n            useCaption: !0,\r\n            useSubCaption: !0\r\n        },\r\n        bindings: [{\r\n            from: \".source\",\r\n            to: \".$.image.src\"\r\n        },\r\n        {\r\n            from: \".caption\",\r\n            to: \".$.caption.content\"\r\n        },\r\n        {\r\n            from: \".caption\",\r\n            to: \".$.caption.showing\",\r\n            kind: \"enyo.EmptyBinding\"\r\n        },\r\n        {\r\n            from: \".subCaption\",\r\n            to: \".$.subCaption.content\"\r\n        },\r\n        {\r\n            from: \".subCaption\",\r\n            to: \".$.subCaption.showing\",\r\n            kind: \"enyo.EmptyBinding\"\r\n        }],\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.selectedChanged(),\r\n                this.imageSizingChanged(),\r\n                this.centeredChanged()\r\n            }\r\n        }),\r\n        selectedChanged: function() {\r\n            this.addRemoveClass(\"selected\", this.selected)\r\n        },\r\n        disabledChanged: function() {\r\n            this.addRemoveClass(\"disabled\", this.disabled)\r\n        },\r\n        imageSizingChanged: function() {\r\n            this.$.image.setSizing(this.imageSizing),\r\n            this.addRemoveClass(\"sized-image\", !!this.imageSizing),\r\n            this.imageSizing && (this.useCaptionChanged(), this.useSubCaptionChanged())\r\n        },\r\n        useCaptionChanged: function() {\r\n            this.addRemoveClass(\"use-caption\", this.useCaption)\r\n        },\r\n        useSubCaptionChanged: function() {\r\n            this.addRemoveClass(\"use-subcaption\", this.useSubCaption)\r\n        },\r\n        centeredChanged: function() {\r\n            this.addRemoveClass(\"centered\", this.centered)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/slideable/source/Slideable.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.Slideable\",\r\n        kind: \"Control\",\r\n        published: {\r\n            axis: \"h\",\r\n            value: 0,\r\n            unit: \"px\",\r\n            min: 0,\r\n            max: 0,\r\n            accelerated: \"auto\",\r\n            overMoving: !0,\r\n            draggable: !0\r\n        },\r\n        events: {\r\n            onAnimateFinish: \"\",\r\n            onChange: \"\"\r\n        },\r\n        preventDragPropagation: !1,\r\n        tools: [{\r\n            kind: \"Animator\",\r\n            onStep: \"animatorStep\",\r\n            onEnd: \"animatorComplete\"\r\n        }],\r\n        handlers: {\r\n            ondragstart: \"dragstart\",\r\n            ondrag: \"drag\",\r\n            ondragfinish: \"dragfinish\"\r\n        },\r\n        kDragScalar: 1,\r\n        dragEventProp: \"dx\",\r\n        unitModifier: !1,\r\n        canTransform: !1,\r\n        dragMoveProp: \"dx\",\r\n        shouldDragProp: \"horizontal\",\r\n        transform: \"translateX\",\r\n        dimension: \"width\",\r\n        boundary: \"left\",\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.acceleratedChanged(),\r\n                this.transformChanged(),\r\n                this.axisChanged(),\r\n                this.valueChanged(),\r\n                this.addClass(\"enyo-slideable\")\r\n            }\r\n        }),\r\n        initComponents: t.inherit(function(t) {\r\n            return function() {\r\n                this.createComponents(this.tools),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        rendered: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.canModifyUnit(),\r\n                this.updateDragScalar()\r\n            }\r\n        }),\r\n        handleResize: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.updateDragScalar()\r\n            }\r\n        }),\r\n        canModifyUnit: function() {\r\n            if (!this.canTransform) {\r\n                var t = this.getInitialStyleValue(this.hasNode(), this.boundary);\r\n                t.match(/px/i) && \"%\" === this.unit && (this.unitModifier = this.getBounds()[this.dimension])\r\n            }\r\n        },\r\n        getInitialStyleValue: function(e, i) {\r\n            var o = t.dom.getComputedStyle(e);\r\n            return o ? o.getPropertyValue(i) : e && e.currentStyle ? e.currentStyle[i] : \"0\"\r\n        },\r\n        updateBounds: function(t, e) {\r\n            var i = {};\r\n            i[this.boundary] = t,\r\n            this.setBounds(i, this.unit),\r\n            this.setInlineStyles(t, e)\r\n        },\r\n        updateDragScalar: function() {\r\n            if (\"%\" == this.unit) {\r\n                var t = this.getBounds()[this.dimension];\r\n                this.kDragScalar = t ? 100 / t: 1,\r\n                this.canTransform || this.updateBounds(this.value, 100)\r\n            }\r\n        },\r\n        transformChanged: function() {\r\n            this.canTransform = t.dom.canTransform()\r\n        },\r\n        acceleratedChanged: function() { (!t.platform.android || 2 >= t.platform.android) && t.dom.accelerate(this, this.accelerated)\r\n        },\r\n        axisChanged: function() {\r\n            var t = \"h\" == this.axis;\r\n            this.dragMoveProp = t ? \"dx\": \"dy\",\r\n            this.shouldDragProp = t ? \"horizontal\": \"vertical\",\r\n            this.transform = t ? \"translateX\": \"translateY\",\r\n            this.dimension = t ? \"width\": \"height\",\r\n            this.boundary = t ? \"left\": \"top\"\r\n        },\r\n        setInlineStyles: function(t, e) {\r\n            var i = {};\r\n            this.unitModifier ? (i[this.boundary] = this.percentToPixels(t, this.unitModifier), i[this.dimension] = this.unitModifier, this.setBounds(i)) : (e ? i[this.dimension] = e: i[this.boundary] = t, this.setBounds(i, this.unit))\r\n        },\r\n        valueChanged: function(e) {\r\n            var i = this.value;\r\n            this.isOob(i) && !this.isAnimating() && (this.value = this.overMoving ? this.dampValue(i) : this.clampValue(i)),\r\n            t.platform.android > 2 && (this.value ? (0 === e || void 0 === e) && t.dom.accelerate(this, this.accelerated) : t.dom.accelerate(this, !1)),\r\n            this.canTransform ? t.dom.transformValue(this, this.transform, this.value + this.unit) : this.setInlineStyles(this.value, !1),\r\n            this.doChange()\r\n        },\r\n        getAnimator: function() {\r\n            return this.$.animator\r\n        },\r\n        isAtMin: function() {\r\n            return this.value <= this.calcMin()\r\n        },\r\n        isAtMax: function() {\r\n            return this.value >= this.calcMax()\r\n        },\r\n        calcMin: function() {\r\n            return this.min\r\n        },\r\n        calcMax: function() {\r\n            return this.max\r\n        },\r\n        clampValue: function(t) {\r\n            var e = this.calcMin(),\r\n            i = this.calcMax();\r\n            return Math.max(e, Math.min(t, i))\r\n        },\r\n        dampValue: function(t) {\r\n            return this.dampBound(this.dampBound(t, this.min, 1), this.max, -1)\r\n        },\r\n        dampBound: function(t, e, i) {\r\n            var o = t;\r\n            return e * i > o * i && (o = e + (o - e) / 4),\r\n            o\r\n        },\r\n        percentToPixels: function(t, e) {\r\n            return Math.floor(e / 100 * t)\r\n        },\r\n        pixelsToPercent: function(t) {\r\n            var e = this.unitModifier ? this.getBounds()[this.dimension] : this.container.getBounds()[this.dimension];\r\n            return 100 * (t / e)\r\n        },\r\n        shouldDrag: function(t) {\r\n            return this.draggable && t[this.shouldDragProp]\r\n        },\r\n        isOob: function(t) {\r\n            return t > this.calcMax() || this.calcMin() > t\r\n        },\r\n        dragstart: function(t, e) {\r\n            return this.shouldDrag(e) ? (e.preventDefault(), this.$.animator.stop(), e.dragInfo = {},\r\n            this.dragging = !0, this.drag0 = this.value, this.dragd0 = 0, this.preventDragPropagation) : void 0\r\n        },\r\n        drag: function(t, e) {\r\n            if (this.dragging) {\r\n                e.preventDefault();\r\n                var i = this.canTransform ? e[this.dragMoveProp] * this.kDragScalar: this.pixelsToPercent(e[this.dragMoveProp]),\r\n                o = this.drag0 + i,\r\n                n = i - this.dragd0;\r\n                return this.dragd0 = i,\r\n                n && (e.dragInfo.minimizing = 0 > n),\r\n                this.setValue(o),\r\n                this.preventDragPropagation\r\n            }\r\n        },\r\n        dragfinish: function(t, e) {\r\n            return this.dragging ? (this.dragging = !1, this.completeDrag(e), e.preventTap(), this.preventDragPropagation) : void 0\r\n        },\r\n        completeDrag: function(t) {\r\n            this.value !== this.calcMax() && this.value != this.calcMin() && this.animateToMinMax(t.dragInfo.minimizing)\r\n        },\r\n        isAnimating: function() {\r\n            return this.$.animator.isAnimating()\r\n        },\r\n        play: function(t, e) {\r\n            this.$.animator.play({\r\n                startValue: t,\r\n                endValue: e,\r\n                node: this.hasNode()\r\n            })\r\n        },\r\n        animateTo: function(t) {\r\n            this.play(this.value, t)\r\n        },\r\n        animateToMin: function() {\r\n            this.animateTo(this.calcMin())\r\n        },\r\n        animateToMax: function() {\r\n            this.animateTo(this.calcMax())\r\n        },\r\n        animateToMinMax: function(t) {\r\n            t ? this.animateToMin() : this.animateToMax()\r\n        },\r\n        animatorStep: function(t) {\r\n            return this.setValue(t.value),\r\n            !0\r\n        },\r\n        animatorComplete: function(t) {\r\n            return this.doAnimateFinish(t),\r\n            !0\r\n        },\r\n        toggleMinMax: function() {\r\n            this.animateToMinMax(!this.isAtMin())\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/Arranger.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.Arranger\",\r\n        kind: \"Layout\",\r\n        layoutClass: \"enyo-arranger\",\r\n        accelerated: \"auto\",\r\n        dragProp: \"ddx\",\r\n        dragDirectionProp: \"xDirection\",\r\n        canDragProp: \"horizontal\",\r\n        incrementalPoints: !1,\r\n        destroy: t.inherit(function(t) {\r\n            return function() {\r\n                for (var e, i = this.container.getPanels(), n = 0; e = i[n]; n++) e._arranger = null;\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        arrange: function() {},\r\n        size: function() {},\r\n        start: function() {\r\n            var t = this.container.fromIndex,\r\n            e = this.container.toIndex,\r\n            i = this.container.transitionPoints = [t];\r\n            if (this.incrementalPoints) for (var n = Math.abs(e - t) - 2, o = t; n >= 0;) o += t > e ? -1 : 1,\r\n            i.push(o),\r\n            n--;\r\n            i.push(this.container.toIndex)\r\n        },\r\n        finish: function() {},\r\n        calcArrangementDifference: function() {},\r\n        canDragEvent: function(t) {\r\n            return t[this.canDragProp]\r\n        },\r\n        calcDragDirection: function(t) {\r\n            return t[this.dragDirectionProp]\r\n        },\r\n        calcDrag: function(t) {\r\n            return t[this.dragProp]\r\n        },\r\n        drag: function(t, e, i, n, o) {\r\n            var s = this.measureArrangementDelta( - t, e, i, n, o);\r\n            return s\r\n        },\r\n        measureArrangementDelta: function(t, e, i, n, o) {\r\n            var s = this.calcArrangementDifference(e, i, n, o),\r\n            r = s ? t / Math.abs(s) : 0;\r\n            return r *= this.container.fromIndex > this.container.toIndex ? -1 : 1\r\n        },\r\n        _arrange: function(t) {\r\n            this.containerBounds || this.reflow();\r\n            var e = this.getOrderedControls(t);\r\n            this.arrange(e, t)\r\n        },\r\n        arrangeControl: function(e, i) {\r\n            e._arranger = t.mixin(e._arranger || {},\r\n            i)\r\n        },\r\n        flow: function() {\r\n            this.c$ = [].concat(this.container.getPanels()),\r\n            this.controlsIndex = 0;\r\n            for (var e, i = 0,\r\n            n = this.container.getPanels(); e = n[i]; i++) if (t.dom.accelerate(e, !e.preventAccelerate && this.accelerated), t.platform.safari) for (var o, s = e.children,\r\n            r = 0; o = s[r]; r++) t.dom.accelerate(o, this.accelerated)\r\n        },\r\n        reflow: function() {\r\n            var t = this.container.hasNode();\r\n            this.containerBounds = t ? {\r\n                width: t.clientWidth,\r\n                height: t.clientHeight\r\n            }: {},\r\n            this.size()\r\n        },\r\n        flowArrangement: function() {\r\n            var t = this.container.arrangement;\r\n            if (t) for (var e, i = 0,\r\n            n = this.container.getPanels(); (e = n[i]) && t[i]; i++) this.flowControl(e, t[i])\r\n        },\r\n        flowControl: function(e, i) {\r\n            t.Arranger.positionControl(e, i);\r\n            var n = i.opacity;\r\n            null != n && t.Arranger.opacifyControl(e, n)\r\n        },\r\n        getOrderedControls: function(t) {\r\n            for (var e = Math.floor(t), i = e - this.controlsIndex, n = i > 0, o = this.c$ || [], s = 0; Math.abs(i) > s; s++) n ? o.push(o.shift()) : o.unshift(o.pop());\r\n            return this.controlsIndex = e,\r\n            o\r\n        },\r\n        statics: {\r\n            positionControl: function(e, i, n) {\r\n                if (n = n || \"px\", !this.updating) if (!t.dom.canTransform() || e.preventTransform || t.platform.android || 10 === t.platform.ie) t.dom.canTransform() && e.preventTransform && t.dom.transform(e, {\r\n                    translateX: null,\r\n                    translateY: null\r\n                }),\r\n                e.setBounds(i, n);\r\n                else {\r\n                    var o = i.left,\r\n                    s = i.top;\r\n                    o = t.isString(o) ? o: o && o + n,\r\n                    s = t.isString(s) ? s: s && s + n,\r\n                    t.dom.transform(e, {\r\n                        translateX: o || null,\r\n                        translateY: s || null\r\n                    })\r\n                }\r\n            },\r\n            opacifyControl: function(e, i) {\r\n                var n = i;\r\n                n = n > .99 ? 1 : .01 > n ? 0 : n,\r\n                9 > t.platform.ie ? e.applyStyle(\"filter\", \"progid:DXImageTransform.Microsoft.Alpha(Opacity=\" + 100 * n + \")\") : e.applyStyle(\"opacity\", n)\r\n            }\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/CardArranger.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.CardArranger\",\r\n        kind: \"Arranger\",\r\n        layoutClass: \"enyo-arranger enyo-arranger-fit\",\r\n        calcArrangementDifference: function() {\r\n            return this.containerBounds.width\r\n        },\r\n        arrange: function(t) {\r\n            for (var e, i, n = 0; e = t[n]; n++) i = 0 === n ? 1 : 0,\r\n            this.arrangeControl(e, {\r\n                opacity: i\r\n            })\r\n        },\r\n        start: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments);\r\n                for (var e, i = this.container.getPanels(), n = 0; e = i[n]; n++) {\r\n                    var o = e.showing;\r\n                    e.setShowing(n == this.container.fromIndex || n == this.container.toIndex),\r\n                    e.showing && !o && e.resize()\r\n                }\r\n            }\r\n        }),\r\n        finish: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments);\r\n                for (var e, i = this.container.getPanels(), n = 0; e = i[n]; n++) e.setShowing(n == this.container.toIndex)\r\n            }\r\n        }),\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) t.Arranger.opacifyControl(i, 1),\r\n                i.showing || i.setShowing(!0);\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/CardSlideInArranger.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.CardSlideInArranger\",\r\n        kind: \"CardArranger\",\r\n        start: function() {\r\n            for (var t, e = this.container.getPanels(), i = 0; t = e[i]; i++) {\r\n                var n = t.showing;\r\n                t.setShowing(i == this.container.fromIndex || i == this.container.toIndex),\r\n                t.showing && !n && t.resize()\r\n            }\r\n            var o = this.container.fromIndex;\r\n            i = this.container.toIndex,\r\n            this.container.transitionPoints = [i + \".\" + o + \".s\", i + \".\" + o + \".f\"]\r\n        },\r\n        finish: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments);\r\n                for (var e, i = this.container.getPanels(), n = 0; e = i[n]; n++) e.setShowing(n == this.container.toIndex)\r\n            }\r\n        }),\r\n        arrange: function(t, e) {\r\n            for (var i, n, o = e.split(\".\"), s = o[0], r = o[1], a = \"s\" == o[2], h = this.containerBounds.width, l = 0, d = this.container.getPanels(); i = d[l]; l++) n = h,\r\n            r == l && (n = a ? 0 : -h),\r\n            s == l && (n = a ? h: 0),\r\n            r == l && r == s && (n = 0),\r\n            this.arrangeControl(i, {\r\n                left: n\r\n            })\r\n        },\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) t.Arranger.positionControl(i, {\r\n                    left: null\r\n                });\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/CarouselArranger.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.CarouselArranger\",\r\n        kind: \"Arranger\",\r\n        size: function() {\r\n            var e, i, n, o, s, r = this.container.getPanels(),\r\n            a = this.containerPadding = this.container.hasNode() ? t.dom.calcPaddingExtents(this.container.node) : {},\r\n            h = this.containerBounds;\r\n            h.height -= a.top + a.bottom,\r\n            h.width -= a.left + a.right;\r\n            var l;\r\n            for (e = 0, n = 0; s = r[e]; e++) o = t.dom.calcMarginExtents(s.hasNode()),\r\n            s.width = s.getBounds().width,\r\n            s.marginWidth = o.right + o.left,\r\n            n += (s.fit ? 0 : s.width) + s.marginWidth,\r\n            s.fit && (l = s);\r\n            if (l) {\r\n                var d = h.width - n;\r\n                l.width = d >= 0 ? d: l.width\r\n            }\r\n            for (e = 0, i = a.left; s = r[e]; e++) s.setBounds({\r\n                top: a.top,\r\n                bottom: a.bottom,\r\n                width: s.fit ? s.width: null\r\n            })\r\n        },\r\n        arrange: function(t, e) {\r\n            this.container.wrap ? this.arrangeWrap(t, e) : this.arrangeNoWrap(t, e)\r\n        },\r\n        arrangeNoWrap: function(t, e) {\r\n            var i, n, o, s, r = this.container.getPanels(),\r\n            a = this.container.clamp(e),\r\n            h = this.containerBounds.width;\r\n            for (i = a, o = 0; (s = r[i]) && (o += s.width + s.marginWidth, !(o > h)); i++);\r\n            var l = h - o,\r\n            d = 0;\r\n            if (l > 0) for (i = a - 1, n = 0; s = r[i]; i--) if (n += s.width + s.marginWidth, 0 >= l - n) {\r\n                d = l - n,\r\n                a = i;\r\n                break\r\n            }\r\n            var c, u;\r\n            for (i = 0, u = this.containerPadding.left + d; s = r[i]; i++) c = s.width + s.marginWidth,\r\n            a > i ? this.arrangeControl(s, {\r\n                left: -c\r\n            }) : (this.arrangeControl(s, {\r\n                left: Math.floor(u)\r\n            }), u += c)\r\n        },\r\n        arrangeWrap: function(t) {\r\n            for (var e, i = 0,\r\n            n = this.containerPadding.left; e = t[i]; i++) this.arrangeControl(e, {\r\n                left: n\r\n            }),\r\n            n += e.width + e.marginWidth\r\n        },\r\n        calcArrangementDifference: function(t, e, i, n) {\r\n            var o = Math.abs(t % this.c$.length);\r\n            return e[o].left - n[o].left\r\n        },\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) t.Arranger.positionControl(i, {\r\n                    left: null,\r\n                    top: null\r\n                }),\r\n                i.applyStyle(\"top\", null),\r\n                i.applyStyle(\"bottom\", null),\r\n                i.applyStyle(\"left\", null),\r\n                i.applyStyle(\"width\", null);\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/CollapsingArranger.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.CollapsingArranger\",\r\n        kind: \"CarouselArranger\",\r\n        peekWidth: 0,\r\n        size: t.inherit(function(t) {\r\n            return function() {\r\n                this.clearLastSize(),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        clearLastSize: function() {\r\n            for (var t, e = 0,\r\n            i = this.container.getPanels(); t = i[e]; e++) t._fit && e != i.length - 1 && (t.applyStyle(\"width\", null), t._fit = null)\r\n        },\r\n        constructor: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.peekWidth = null != this.container.peekWidth ? this.container.peekWidth: this.peekWidth\r\n            }\r\n        }),\r\n        arrange: function(t, e) {\r\n            for (var i, n = this.container.getPanels(), o = 0, s = this.containerPadding.left, r = 0; i = n[o]; o++) i.getShowing() ? (this.arrangeControl(i, {\r\n                left: s + r * this.peekWidth\r\n            }), o >= e && (s += i.width + i.marginWidth - this.peekWidth), r++) : (this.arrangeControl(i, {\r\n                left: s\r\n            }), o >= e && (s += i.width + i.marginWidth)),\r\n            o == n.length - 1 && 0 > e && this.arrangeControl(i, {\r\n                left: s - e\r\n            })\r\n        },\r\n        calcArrangementDifference: function(t, e, i, n) {\r\n            var o = this.container.getPanels().length - 1;\r\n            return Math.abs(n[o].left - e[o].left)\r\n        },\r\n        flowControl: t.inherit(function(t) {\r\n            return function(e, i) {\r\n                if (t.apply(this, arguments), this.container.realtimeFit) {\r\n                    var n = this.container.getPanels(),\r\n                    o = n.length - 1,\r\n                    s = n[o];\r\n                    e == s && this.fitControl(e, i.left)\r\n                }\r\n            }\r\n        }),\r\n        finish: t.inherit(function(t) {\r\n            return function() {\r\n                if (t.apply(this, arguments), !this.container.realtimeFit && this.containerBounds) {\r\n                    var e = this.container.getPanels(),\r\n                    i = this.container.arrangement,\r\n                    n = e.length - 1,\r\n                    o = e[n];\r\n                    this.fitControl(o, i[n].left)\r\n                }\r\n            }\r\n        }),\r\n        fitControl: function(t, e) {\r\n            t._fit = !0,\r\n            t.applyStyle(\"width\", this.containerBounds.width - e + \"px\"),\r\n            t.resize()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/DockRightArranger.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.DockRightArranger\",\r\n        kind: \"Arranger\",\r\n        basePanel: !1,\r\n        overlap: 0,\r\n        layoutWidth: 0,\r\n        constructor: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.overlap = null != this.container.overlap ? this.container.overlap: this.overlap,\r\n                this.layoutWidth = null != this.container.layoutWidth ? this.container.layoutWidth: this.layoutWidth\r\n            }\r\n        }),\r\n        size: function() {\r\n            var e, i, n, o = this.container.getPanels(),\r\n            s = this.containerPadding = this.container.hasNode() ? t.dom.calcPaddingExtents(this.container.node) : {},\r\n            r = this.containerBounds;\r\n            r.width -= s.left + s.right;\r\n            var a, h = r.width,\r\n            l = o.length;\r\n            for (this.container.transitionPositions = {},\r\n            e = 0; n = o[e]; e++) n.width = 0 === e && this.container.basePanel ? h: n.getBounds().width;\r\n            for (e = 0; n = o[e]; e++) {\r\n                0 === e && this.container.basePanel && n.setBounds({\r\n                    width: h\r\n                }),\r\n                n.setBounds({\r\n                    top: s.top,\r\n                    bottom: s.bottom\r\n                });\r\n                for (var d = 0; n = o[d]; d++) {\r\n                    var c;\r\n                    if (0 === e && this.container.basePanel) c = 0;\r\n                    else if (e > d) c = h;\r\n                    else {\r\n                        if (e !== d) break;\r\n                        a = h > this.layoutWidth ? this.overlap: 0,\r\n                        c = h - o[e].width + a\r\n                    }\r\n                    this.container.transitionPositions[e + \".\" + d] = c\r\n                }\r\n                if (l > d) for (var u = !1,\r\n                g = e + 1; l > g; g++) {\r\n                    if (a = 0, u) a = 0;\r\n                    else if (o[e].width + o[g].width - this.overlap > h) a = 0,\r\n                    u = !0;\r\n                    else {\r\n                        for (a = o[e].width - this.overlap, i = e; g > i; i++) {\r\n                            var p = a + o[i + 1].width - this.overlap;\r\n                            if (! (h > p)) {\r\n                                a = h;\r\n                                break\r\n                            }\r\n                            a = p\r\n                        }\r\n                        a = h - a\r\n                    }\r\n                    this.container.transitionPositions[e + \".\" + g] = a\r\n                }\r\n            }\r\n        },\r\n        arrange: function(t, e) {\r\n            var i, n, o = this.container.getPanels(),\r\n            s = this.container.clamp(e);\r\n            for (i = 0; n = o[i]; i++) {\r\n                var r = this.container.transitionPositions[i + \".\" + s];\r\n                this.arrangeControl(n, {\r\n                    left: r\r\n                })\r\n            }\r\n        },\r\n        calcArrangementDifference: function(t, e, i) {\r\n            var n = this.container.getPanels(),\r\n            o = i > t ? n[i].width: n[t].width;\r\n            return o\r\n        },\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) t.Arranger.positionControl(i, {\r\n                    left: null,\r\n                    top: null\r\n                }),\r\n                i.applyStyle(\"top\", null),\r\n                i.applyStyle(\"bottom\", null),\r\n                i.applyStyle(\"left\", null),\r\n                i.applyStyle(\"width\", null);\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/arrangers/OtherArrangers.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.LeftRightArranger\",\r\n        kind: \"Arranger\",\r\n        margin: 40,\r\n        axisSize: \"width\",\r\n        offAxisSize: \"height\",\r\n        axisPosition: \"left\",\r\n        constructor: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.margin = null != this.container.margin ? this.container.margin: this.margin\r\n            }\r\n        }),\r\n        size: function() {\r\n            for (var t, e, i = this.container.getPanels(), n = this.containerBounds[this.axisSize], o = n - this.margin - this.margin, s = 0; e = i[s]; s++) t = {},\r\n            t[this.axisSize] = o,\r\n            t[this.offAxisSize] = \"100%\",\r\n            e.setBounds(t)\r\n        },\r\n        start: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments);\r\n                for (var e, i = this.container.fromIndex,\r\n                n = this.container.toIndex,\r\n                o = this.getOrderedControls(n), s = Math.floor(o.length / 2), r = 0; e = o[r]; r++) i > n ? r == o.length - s ? e.applyStyle(\"z-index\", 0) : e.applyStyle(\"z-index\", 1) : r == o.length - 1 - s ? e.applyStyle(\"z-index\", 0) : e.applyStyle(\"z-index\", 1)\r\n            }\r\n        }),\r\n        arrange: function(t, e) {\r\n            var i, n, o;\r\n            if (1 == this.container.getPanels().length) return o = {},\r\n            o[this.axisPosition] = this.margin,\r\n            this.arrangeControl(this.container.getPanels()[0], o),\r\n            void 0;\r\n            var s = Math.floor(this.container.getPanels().length / 2),\r\n            r = this.getOrderedControls(Math.floor(e) - s),\r\n            a = this.containerBounds[this.axisSize] - this.margin - this.margin,\r\n            h = this.margin - a * s;\r\n            for (i = 0; n = r[i]; i++) o = {},\r\n            o[this.axisPosition] = h,\r\n            this.arrangeControl(n, o),\r\n            h += a\r\n        },\r\n        calcArrangementDifference: function(t, e, i, n) {\r\n            if (1 == this.container.getPanels().length) return 0;\r\n            var o = Math.abs(t % this.c$.length);\r\n            return e[o][this.axisPosition] - n[o][this.axisPosition]\r\n        },\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) t.Arranger.positionControl(i, {\r\n                    left: null,\r\n                    top: null\r\n                }),\r\n                t.Arranger.opacifyControl(i, 1),\r\n                i.applyStyle(\"left\", null),\r\n                i.applyStyle(\"top\", null),\r\n                i.applyStyle(\"height\", null),\r\n                i.applyStyle(\"width\", null);\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    }),\r\n    t.kind({\r\n        name: \"enyo.TopBottomArranger\",\r\n        kind: \"LeftRightArranger\",\r\n        dragProp: \"ddy\",\r\n        dragDirectionProp: \"yDirection\",\r\n        canDragProp: \"vertical\",\r\n        axisSize: \"height\",\r\n        offAxisSize: \"width\",\r\n        axisPosition: \"top\"\r\n    }),\r\n    t.kind({\r\n        name: \"enyo.SpiralArranger\",\r\n        kind: \"Arranger\",\r\n        incrementalPoints: !0,\r\n        inc: 20,\r\n        size: function() {\r\n            for (var t, e = this.container.getPanels(), i = this.containerBounds, n = this.controlWidth = i.width / 3, o = this.controlHeight = i.height / 3, s = 0; t = e[s]; s++) t.setBounds({\r\n                width: n,\r\n                height: o\r\n            })\r\n        },\r\n        arrange: function(t) {\r\n            for (var e, i = this.inc,\r\n            n = 0,\r\n            o = t.length; e = t[n]; n++) {\r\n                var s = Math.cos(2 * (n / o) * Math.PI) * n * i + this.controlWidth,\r\n                r = Math.sin(2 * (n / o) * Math.PI) * n * i + this.controlHeight;\r\n                this.arrangeControl(e, {\r\n                    left: s,\r\n                    top: r\r\n                })\r\n            }\r\n        },\r\n        start: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments);\r\n                for (var e, i = this.getOrderedControls(this.container.toIndex), n = 0; e = i[n]; n++) e.applyStyle(\"z-index\", i.length - n)\r\n            }\r\n        }),\r\n        calcArrangementDifference: function() {\r\n            return this.controlWidth\r\n        },\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) i.applyStyle(\"z-index\", null),\r\n                t.Arranger.positionControl(i, {\r\n                    left: null,\r\n                    top: null\r\n                }),\r\n                i.applyStyle(\"left\", null),\r\n                i.applyStyle(\"top\", null),\r\n                i.applyStyle(\"height\", null),\r\n                i.applyStyle(\"width\", null);\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    }),\r\n    t.kind({\r\n        name: \"enyo.GridArranger\",\r\n        kind: \"Arranger\",\r\n        incrementalPoints: !0,\r\n        colWidth: 100,\r\n        colHeight: 100,\r\n        size: function() {\r\n            for (var t, e = this.container.getPanels(), i = this.colWidth, n = this.colHeight, o = 0; t = e[o]; o++) t.setBounds({\r\n                width: i,\r\n                height: n\r\n            })\r\n        },\r\n        arrange: function(t) {\r\n            for (var e, i = this.colWidth,\r\n            n = this.colHeight,\r\n            o = Math.max(1, Math.floor(this.containerBounds.width / i)), s = 0, r = 0; t.length > r; s++) for (var a = 0; o > a && (e = t[r]); a++, r++) this.arrangeControl(e, {\r\n                left: i * a,\r\n                top: n * s\r\n            })\r\n        },\r\n        flowControl: t.inherit(function(e) {\r\n            return function(i, n) {\r\n                e.apply(this, arguments),\r\n                t.Arranger.opacifyControl(i, 0 !== n.top % this.colHeight ? .25 : 1)\r\n            }\r\n        }),\r\n        calcArrangementDifference: function() {\r\n            return this.colWidth\r\n        },\r\n        destroy: t.inherit(function(e) {\r\n            return function() {\r\n                for (var i, n = this.container.getPanels(), o = 0; i = n[o]; o++) t.Arranger.positionControl(i, {\r\n                    left: null,\r\n                    top: null\r\n                }),\r\n                i.applyStyle(\"left\", null),\r\n                i.applyStyle(\"top\", null),\r\n                i.applyStyle(\"height\", null),\r\n                i.applyStyle(\"width\", null);\r\n                e.apply(this, arguments)\r\n            }\r\n        })\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/panels/source/Panels.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.Panels\",\r\n        classes: \"enyo-panels\",\r\n        published: {\r\n            index: 0,\r\n            draggable: !0,\r\n            animate: !0,\r\n            wrap: !1,\r\n            arrangerKind: \"CardArranger\",\r\n            narrowFit: !0\r\n        },\r\n        events: {\r\n            onTransitionStart: \"\",\r\n            onTransitionFinish: \"\"\r\n        },\r\n        handlers: {\r\n            ondragstart: \"dragstart\",\r\n            ondrag: \"drag\",\r\n            ondragfinish: \"dragfinish\",\r\n            onscroll: \"domScroll\"\r\n        },\r\n        tools: [{\r\n            kind: \"Animator\",\r\n            onStep: \"step\",\r\n            onEnd: \"animationEnded\"\r\n        }],\r\n        fraction: 0,\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                this.transitionPoints = [],\r\n                t.apply(this, arguments),\r\n                this.arrangerKindChanged(),\r\n                this.narrowFitChanged(),\r\n                this.indexChanged()\r\n            }\r\n        }),\r\n        rendered: t.inherit(function(e) {\r\n            return function() {\r\n                e.apply(this, arguments),\r\n                t.makeBubble(this, \"scroll\")\r\n            }\r\n        }),\r\n        domScroll: function() {\r\n            this.hasNode() && this.node.scrollLeft > 0 && (this.node.scrollLeft = 0)\r\n        },\r\n        initComponents: t.inherit(function(t) {\r\n            return function() {\r\n                this.createChrome(this.tools),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        arrangerKindChanged: function() {\r\n            this.setLayoutKind(this.arrangerKind)\r\n        },\r\n        narrowFitChanged: function() {\r\n            this.addRemoveClass(t.Panels.getNarrowClass(), this.narrowFit)\r\n        },\r\n        destroy: t.inherit(function(t) {\r\n            return function() {\r\n                this.destroying = !0,\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        removeControl: t.inherit(function(e) {\r\n            return function(i) {\r\n                if (this.destroying) return e.apply(this, arguments);\r\n                var n = -1,\r\n                o = t.indexOf(i, this.controls);\r\n                o === this.index && (n = Math.max(o - 1, 0)),\r\n                e.apply(this, arguments),\r\n                -1 !== n && this.controls.length > 0 && (this.setIndex(n), this.flow(), this.reflow())\r\n            }\r\n        }),\r\n        isPanel: function() {\r\n            return ! 0\r\n        },\r\n        flow: t.inherit(function(t) {\r\n            return function() {\r\n                this.arrangements = [],\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        reflow: t.inherit(function(t) {\r\n            return function() {\r\n                this.arrangements = [],\r\n                t.apply(this, arguments),\r\n                this.refresh()\r\n            }\r\n        }),\r\n        getPanels: function() {\r\n            var t = this.controlParent || this;\r\n            return t.children\r\n        },\r\n        getActive: function() {\r\n            var t = this.getPanels(),\r\n            e = this.index % t.length;\r\n            return 0 > e && (e += t.length),\r\n            t[e]\r\n        },\r\n        getAnimator: function() {\r\n            return this.$.animator\r\n        },\r\n        setIndex: function(t) {\r\n            var e = this.get(\"index\"),\r\n            i = this.clamp(t);\r\n            this.index = i,\r\n            this.notifyObservers(\"index\", e, i)\r\n        },\r\n        setIndexDirect: function(t) {\r\n            this.animate ? (this.animate = !1, this.setIndex(t), this.animate = !0) : this.setIndex(t)\r\n        },\r\n        selectPanelByName: function(t) {\r\n            if (t) for (var e = 0,\r\n            i = this.getPanels(), n = i.length; n > e; ++e) if (t === i[e].name) return this.setIndex(e),\r\n            e\r\n        },\r\n        previous: function() {\r\n            var t = this.index - 1;\r\n            this.wrap && 0 > t && (t = this.getPanels().length - 1),\r\n            this.setIndex(t)\r\n        },\r\n        next: function() {\r\n            var t = this.index + 1;\r\n            this.wrap && t >= this.getPanels().length && (t = 0),\r\n            this.setIndex(t)\r\n        },\r\n        clamp: function(t) {\r\n            var e = this.getPanels().length;\r\n            return this.wrap ? (t %= e, 0 > t ? t + e: t) : Math.max(0, Math.min(t, e - 1))\r\n        },\r\n        indexChanged: function(t) {\r\n            this.lastIndex = t,\r\n            !this.dragging && this.$.animator && this.hasNode() && (this.shouldAnimate() ? this.$.animator.isAnimating() ? (this.transitionOnComplete = !0, this.$.animator.complete()) : this.animateTransition() : this.directTransition())\r\n        },\r\n        shouldAnimate: function() {\r\n            return this.animate\r\n        },\r\n        step: function(t) {\r\n            return this.fraction = t.value,\r\n            this.stepTransition(),\r\n            !0\r\n        },\r\n        animationEnded: function() {\r\n            this.completed()\r\n        },\r\n        completed: function() {\r\n            return this.finishTransition(),\r\n            this.transitionOnComplete && (this.transitionOnComplete = !1, this.animateTransition()),\r\n            !0\r\n        },\r\n        dragstart: function(t, e) {\r\n            return this.draggable && this.layout && this.layout.canDragEvent(e) ? (e.preventDefault(), this.dragstartTransition(e), this.dragging = !0, this.$.animator.stop(), !0) : void 0\r\n        },\r\n        drag: function(t, e) {\r\n            this.dragging && (e.preventDefault(), this.dragTransition(e))\r\n        },\r\n        dragfinish: function(t, e) {\r\n            this.dragging && (this.dragging = !1, e.preventTap(), this.dragfinishTransition(e))\r\n        },\r\n        dragstartTransition: function(t) {\r\n            if (this.$.animator.isAnimating()) this.verifyDragTransition(t);\r\n            else {\r\n                var e = this.fromIndex = this.index;\r\n                this.toIndex = e - (this.layout ? this.layout.calcDragDirection(t) : 0)\r\n            }\r\n            this.fromIndex = this.clamp(this.fromIndex),\r\n            this.toIndex = this.clamp(this.toIndex),\r\n            this.fireTransitionStart(),\r\n            this.layout && this.layout.start()\r\n        },\r\n        dragTransition: function(t) {\r\n            var e = this.layout ? this.layout.calcDrag(t) : 0,\r\n            i = this.transitionPoints,\r\n            n = i[0],\r\n            o = i[i.length - 1],\r\n            s = this.fetchArrangement(n),\r\n            r = this.fetchArrangement(o),\r\n            a = this.layout ? this.layout.drag(e, n, s, o, r) : 0,\r\n            h = e && !a;\r\n            this.fraction += a;\r\n            var l = this.fraction; (l > 1 || 0 > l || h) && ((l > 0 || h) && this.dragfinishTransition(t), this.dragstartTransition(t), this.fraction = 0),\r\n            this.stepTransition()\r\n        },\r\n        dragfinishTransition: function(t) {\r\n            this.verifyDragTransition(t),\r\n            this.setIndex(this.toIndex),\r\n            this.dragging && this.fireTransitionFinish()\r\n        },\r\n        verifyDragTransition: function(t) {\r\n            var e = this.layout ? this.layout.calcDragDirection(t) : 0,\r\n            i = Math.min(this.fromIndex, this.toIndex),\r\n            n = Math.max(this.fromIndex, this.toIndex);\r\n            if (e > 0) {\r\n                var o = i;\r\n                i = n,\r\n                n = o\r\n            }\r\n            i != this.fromIndex && (this.fraction = 1 - this.fraction),\r\n            this.fromIndex = i,\r\n            this.toIndex = n\r\n        },\r\n        refresh: function() {\r\n            this.$.animator && this.$.animator.isAnimating() && this.$.animator.stop(),\r\n            this.setupTransition(),\r\n            this.fraction = 1,\r\n            this.stepTransition(),\r\n            this.transitioning = !1,\r\n            this.completeTransition()\r\n        },\r\n        directTransition: function() {\r\n            this.startTransition(),\r\n            this.fraction = 1,\r\n            this.stepTransition(),\r\n            this.finishTransition()\r\n        },\r\n        animateTransition: function() {\r\n            this.startTransition(),\r\n            this.$.animator.play({\r\n                startValue: this.fraction\r\n            })\r\n        },\r\n        startTransition: function() {\r\n            this.transitioning || (this.transitioning = !0, this.setupTransition(), this.fireTransitionStart())\r\n        },\r\n        setupTransition: function() {\r\n            this.fromIndex = null != this.fromIndex ? this.fromIndex: this.lastIndex || 0,\r\n            this.toIndex = null != this.toIndex ? this.toIndex: this.index,\r\n            this.layout && this.layout.start()\r\n        },\r\n        finishTransition: function() {\r\n            this.transitioning = !1,\r\n            this.completeTransition(!0)\r\n        },\r\n        completeTransition: function(t) {\r\n            this.layout && this.layout.finish(),\r\n            t ? this.fireTransitionFinish(!0) : this.clearTransitionData()\r\n        },\r\n        clearTransitionData: function() {\r\n            this.transitionPoints = [],\r\n            this.fraction = 0,\r\n            this.fromIndex = this.toIndex = null\r\n        },\r\n        fireTransitionStart: function() {\r\n            var e = this.startTransitionInfo; ! this.hasNode() || e && e.fromIndex == this.fromIndex && e.toIndex == this.toIndex || (this.startTransitionInfo = {\r\n                fromIndex: this.fromIndex,\r\n                toIndex: this.toIndex\r\n            },\r\n            this.doTransitionStart(t.clone(this.startTransitionInfo)))\r\n        },\r\n        fireTransitionFinish: function(e) {\r\n            var i = this.finishTransitionInfo,\r\n            n = i ? i.fromIndex: null,\r\n            o = i ? i.toIndex: null; ! this.hasNode() || i && n == this.fromIndex && o == this.toIndex ? e && this.clearTransitionData() : (this.finishTransitionInfo = this.transitionOnComplete ? {\r\n                fromIndex: o,\r\n                toIndex: this.lastIndex\r\n            }: {\r\n                fromIndex: this.lastIndex,\r\n                toIndex: this.index\r\n            },\r\n            e && this.clearTransitionData(), this.doTransitionFinish(t.clone(this.finishTransitionInfo)))\r\n        },\r\n        stepTransition: function() {\r\n            if (this.hasNode()) {\r\n                var e = this.transitionPoints,\r\n                i = (this.fraction || 0) * (e.length - 1),\r\n                n = Math.floor(i);\r\n                i -= n;\r\n                var o = e[n],\r\n                s = e[n + 1],\r\n                r = this.fetchArrangement(o),\r\n                a = this.fetchArrangement(s);\r\n                this.arrangement = r && a ? t.Panels.lerp(r, a, i) : r || a,\r\n                this.arrangement && this.layout && this.layout.flowArrangement()\r\n            }\r\n        },\r\n        fetchArrangement: function(t) {\r\n            return null != t && !this.arrangements[t] && this.layout && (this.layout._arrange(t), this.arrangements[t] = this.readArrangement(this.getPanels())),\r\n            this.arrangements[t]\r\n        },\r\n        readArrangement: function(e) {\r\n            for (var i, n = [], o = 0, s = e; i = s[o]; o++) n.push(t.clone(i._arranger));\r\n            return n\r\n        },\r\n        statics: {\r\n            isScreenNarrow: function() {\r\n                return t.Panels.isNarrowDevice() ? !0 : 800 >= t.dom.getWindowWidth()\r\n            },\r\n            getNarrowClass: function() {\r\n                return t.Panels.isNarrowDevice() ? \"enyo-panels-force-narrow\": \"enyo-panels-fit-narrow\"\r\n            },\r\n            lerp: function(e, i, n) {\r\n                for (var o, s = [], r = 0, a = t.keys(e); o = a[r]; r++) s.push(this.lerpObject(e[o], i[o], n));\r\n                return s\r\n            },\r\n            lerpObject: function(e, i, n) {\r\n                var o, s, r = t.clone(e);\r\n                if (i) for (var a in e) o = e[a],\r\n                s = i[a],\r\n                o != s && (r[a] = o - (o - s) * n);\r\n                return r\r\n            },\r\n            isNarrowDevice: function() {\r\n                var e = navigator.userAgent;\r\n                switch (t.platform.platformName) {\r\n                case \"ios\":\r\n                    return /iP(?:hone|od;(?: U;)? CPU) OS (\\d+)/.test(e);\r\n                case \"android\":\r\n                    return /Mobile/.test(e) && t.platform.android > 2;\r\n                case \"androidChrome\":\r\n                    return /Mobile/.test(e)\r\n                }\r\n                return ! 1\r\n            }\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/tree/source/Node.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.Node\",\r\n        published: {\r\n            expandable: !1,\r\n            expanded: !1,\r\n            icon: \"\",\r\n            onlyIconExpands: !1,\r\n            selected: !1\r\n        },\r\n        style: \"padding: 0 0 0 16px;\",\r\n        content: \"Node\",\r\n        defaultKind: \"Node\",\r\n        classes: \"enyo-node\",\r\n        components: [{\r\n            name: \"icon\",\r\n            kind: \"Image\",\r\n            showing: !1\r\n        },\r\n        {\r\n            kind: \"Control\",\r\n            name: \"caption\",\r\n            Xtag: \"span\",\r\n            style: \"display: inline-block; padding: 4px;\",\r\n            allowHtml: !0\r\n        },\r\n        {\r\n            kind: \"Control\",\r\n            name: \"extra\",\r\n            tag: \"span\",\r\n            allowHtml: !0\r\n        }],\r\n        childClient: [{\r\n            kind: \"Control\",\r\n            name: \"box\",\r\n            classes: \"enyo-node-box\",\r\n            Xstyle: \"border: 1px solid orange;\",\r\n            components: [{\r\n                kind: \"Control\",\r\n                name: \"client\",\r\n                classes: \"enyo-node-client\",\r\n                Xstyle: \"border: 1px solid lightblue;\"\r\n            }]\r\n        }],\r\n        handlers: {\r\n            ondblclick: \"dblclick\"\r\n        },\r\n        events: {\r\n            onNodeTap: \"nodeTap\",\r\n            onNodeDblClick: \"nodeDblClick\",\r\n            onExpand: \"nodeExpand\",\r\n            onDestroyed: \"nodeDestroyed\"\r\n        },\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.selectedChanged(),\r\n                this.iconChanged()\r\n            }\r\n        }),\r\n        destroy: t.inherit(function(t) {\r\n            return function() {\r\n                this.doDestroyed(),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        initComponents: t.inherit(function(t) {\r\n            return function() {\r\n                this.expandable && (this.kindComponents = this.kindComponents.concat(this.childClient)),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        contentChanged: function() {\r\n            this.$.caption.setContent(this.content)\r\n        },\r\n        iconChanged: function() {\r\n            this.$.icon.setSrc(this.icon),\r\n            this.$.icon.setShowing(Boolean(this.icon))\r\n        },\r\n        selectedChanged: function() {\r\n            this.addRemoveClass(\"enyo-selected\", this.selected)\r\n        },\r\n        rendered: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.expandable && !this.expanded && this.quickCollapse()\r\n            }\r\n        }),\r\n        addNodes: function(t) {\r\n            this.destroyClientControls();\r\n            for (var e, i = 0; e = t[i]; i++) this.createComponent(e);\r\n            this.$.client.render()\r\n        },\r\n        addTextNodes: function(t) {\r\n            this.destroyClientControls();\r\n            for (var e, i = 0; e = t[i]; i++) this.createComponent({\r\n                content: e\r\n            });\r\n            this.$.client.render()\r\n        },\r\n        tap: function(t, e) {\r\n            return this.onlyIconExpands ? e.target == this.$.icon.hasNode() ? this.toggleExpanded() : this.doNodeTap() : (this.toggleExpanded(), this.doNodeTap()),\r\n            !0\r\n        },\r\n        dblclick: function() {\r\n            return this.doNodeDblClick(),\r\n            !0\r\n        },\r\n        toggleExpanded: function() {\r\n            this.setExpanded(!this.expanded)\r\n        },\r\n        quickCollapse: function() {\r\n            this.removeClass(\"enyo-animate\"),\r\n            this.$.box.applyStyle(\"height\", \"0\");\r\n            var t = this.$.client.getBounds().height;\r\n            this.$.client.setBounds({\r\n                top: -t\r\n            })\r\n        },\r\n        _expand: function() {\r\n            this.addClass(\"enyo-animate\");\r\n            var t = this.$.client.getBounds().height;\r\n            this.$.box.setBounds({\r\n                height: t\r\n            }),\r\n            this.$.client.setBounds({\r\n                top: 0\r\n            }),\r\n            setTimeout(this.bindSafely(function() {\r\n                this.expanded && (this.removeClass(\"enyo-animate\"), this.$.box.applyStyle(\"height\", \"auto\"))\r\n            }), 225)\r\n        },\r\n        _collapse: function() {\r\n            this.removeClass(\"enyo-animate\");\r\n            var t = this.$.client.getBounds().height;\r\n            this.$.box.setBounds({\r\n                height: t\r\n            }),\r\n            setTimeout(this.bindSafely(function() {\r\n                this.addClass(\"enyo-animate\"),\r\n                this.$.box.applyStyle(\"height\", \"0\"),\r\n                this.$.client.setBounds({\r\n                    top: -t\r\n                })\r\n            }), 25)\r\n        },\r\n        expandedChanged: function() {\r\n            if (this.expandable) {\r\n                var t = {\r\n                    expanded: this.expanded\r\n                };\r\n                this.doExpand(t),\r\n                t.wait || this.effectExpanded()\r\n            } else this.expanded = !1\r\n        },\r\n        effectExpanded: function() {\r\n            this.$.client && (this.expanded ? this._expand() : this._collapse())\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/imageview/source/PanZoomView.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.PanZoomView\",\r\n        kind: \"enyo.Scroller\",\r\n        touchOverscroll: !1,\r\n        thumb: !1,\r\n        animate: !0,\r\n        verticalDragPropagation: !0,\r\n        horizontalDragPropagation: !0,\r\n        published: {\r\n            scale: \"auto\",\r\n            disableZoom: !1,\r\n            contentWidth: null,\r\n            contentHeight: null\r\n        },\r\n        events: {\r\n            onZoom: \"\"\r\n        },\r\n        touch: !0,\r\n        preventDragPropagation: !1,\r\n        handlers: {\r\n            ondragstart: \"dragPropagation\",\r\n            onSetDimensions: \"setDimensions\"\r\n        },\r\n        components: [{\r\n            name: \"animator\",\r\n            kind: \"Animator\",\r\n            onStep: \"zoomAnimationStep\",\r\n            onEnd: \"zoomAnimationEnd\"\r\n        },\r\n        {\r\n            name: \"viewport\",\r\n            style: \"overflow:hidden;min-height:100%;min-width:100%;\",\r\n            classes: \"enyo-fit\",\r\n            ongesturechange: \"gestureTransform\",\r\n            ongestureend: \"saveState\",\r\n            ontap: \"singleTap\",\r\n            ondblclick: \"doubleClick\",\r\n            onmousewheel: \"mousewheel\",\r\n            components: [{\r\n                name: \"content\"\r\n            }]\r\n        }],\r\n        create: t.inherit(function(e) {\r\n            return function() {\r\n                this.scaleKeyword = this.scale;\r\n                var i = this.components;\r\n                if (this.components = [], e.apply(this, arguments), this.$.content.applyStyle(\"width\", this.contentWidth + \"px\"), this.$.content.applyStyle(\"height\", this.contentHeight + \"px\"), this.unscaledComponents) {\r\n                    var n = this.hasOwnProperty(\"unscaledComponents\") ? this.getInstanceOwner() : this;\r\n                    this.createComponents(this.unscaledComponents, {\r\n                        owner: n\r\n                    })\r\n                }\r\n                this.controlParentName = \"content\",\r\n                this.discoverControlParent(),\r\n                this.createComponents(i),\r\n                this.canTransform = t.dom.canTransform(),\r\n                this.canTransform || this.$.content.applyStyle(\"position\", \"relative\"),\r\n                this.canAccelerate = t.dom.canAccelerate(),\r\n                this.getStrategy().setDragDuringGesture(!1)\r\n            }\r\n        }),\r\n        rendered: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.getOriginalScale()\r\n            }\r\n        }),\r\n        dragPropagation: function(t, e) {\r\n            var i = this.getStrategy().getScrollBounds(),\r\n            n = 0 === i.top && e.dy > 0 || i.top >= i.maxTop - 2 && 0 > e.dy,\r\n            o = 0 === i.left && e.dx > 0 || i.left >= i.maxLeft - 2 && 0 > e.dx;\r\n            return ! (n && this.verticalDragPropagation || o && this.horizontalDragPropagation)\r\n        },\r\n        mousewheel: function(t, e) {\r\n            e.pageX |= e.clientX + e.target.scrollLeft,\r\n            e.pageY |= e.clientY + e.target.scrollTop;\r\n            var i = (this.maxScale - this.minScale) / 10,\r\n            n = this.scale;\r\n            return e.wheelDelta > 0 || 0 > e.detail ? this.scale = this.limitScale(this.scale + i) : (0 > e.wheelDelta || e.detail > 0) && (this.scale = this.limitScale(this.scale - i)),\r\n            this.eventPt = this.calcEventLocation(e),\r\n            this.transform(this.scale),\r\n            n != this.scale && this.doZoom({\r\n                scale: this.scale\r\n            }),\r\n            this.ratioX = this.ratioY = null,\r\n            e.preventDefault(),\r\n            !0\r\n        },\r\n        handleResize: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.scaleChanged()\r\n            }\r\n        }),\r\n        setDimensions: function(t, e) {\r\n            return this.$.content.applyStyle(\"width\", e.width + \"px\"),\r\n            this.$.content.applyStyle(\"height\", e.height + \"px\"),\r\n            this.originalWidth = e.width,\r\n            this.originalHeight = e.height,\r\n            this.scale = this.scaleKeyword,\r\n            this.scaleChanged(),\r\n            !0\r\n        },\r\n        getOriginalScale: function() {\r\n            this.$.content.hasNode() && (this.originalWidth = this.$.content.node.clientWidth, this.originalHeight = this.$.content.node.clientHeight, this.scale = this.scaleKeyword, this.scaleChanged())\r\n        },\r\n        scaleChanged: function() {\r\n            var t = this.hasNode();\r\n            if (t) {\r\n                this.containerWidth = t.clientWidth,\r\n                this.containerHeight = t.clientHeight;\r\n                var e = this.containerWidth / this.originalWidth,\r\n                i = this.containerHeight / this.originalHeight;\r\n                this.minScale = Math.min(e, i),\r\n                this.maxScale = 1 > 3 * this.minScale ? 1 : 3 * this.minScale,\r\n                \"auto\" == this.scale ? this.scale = this.minScale: \"width\" == this.scale ? this.scale = e: \"height\" == this.scale ? this.scale = i: \"fit\" == this.scale ? (this.fitAlignment = \"center\", this.scale = Math.max(e, i)) : (this.maxScale = Math.max(this.maxScale, this.scale), this.scale = this.limitScale(this.scale))\r\n            }\r\n            this.eventPt = this.calcEventLocation(),\r\n            this.transform(this.scale),\r\n            this.getStrategy().$.scrollMath && this.getStrategy().$.scrollMath.start(),\r\n            this.align()\r\n        },\r\n        align: function() {\r\n            if (this.fitAlignment && \"center\" === this.fitAlignment) {\r\n                var t = this.getScrollBounds();\r\n                this.setScrollLeft(t.maxLeft / 2),\r\n                this.setScrollTop(t.maxTop / 2)\r\n            }\r\n        },\r\n        gestureTransform: function(t, e) {\r\n            this.eventPt = this.calcEventLocation(e),\r\n            this.transform(this.limitScale(this.scale * e.scale))\r\n        },\r\n        calcEventLocation: function(t) {\r\n            var e = {\r\n                x: 0,\r\n                y: 0\r\n            };\r\n            if (t && this.hasNode()) {\r\n                var i = this.node.getBoundingClientRect();\r\n                e.x = Math.round(t.pageX - i.left - this.bounds.x),\r\n                e.x = Math.max(0, Math.min(this.bounds.width, e.x)),\r\n                e.y = Math.round(t.pageY - i.top - this.bounds.y),\r\n                e.y = Math.max(0, Math.min(this.bounds.height, e.y))\r\n            }\r\n            return e\r\n        },\r\n        transform: function(e) {\r\n            this.tapped = !1;\r\n            var i = this.bounds || this.innerBounds(e);\r\n            this.bounds = this.innerBounds(e),\r\n            this.scale > this.minScale ? this.$.viewport.applyStyle(\"cursor\", \"move\") : this.$.viewport.applyStyle(\"cursor\", null),\r\n            this.$.viewport.setBounds({\r\n                width: this.bounds.width + \"px\",\r\n                height: this.bounds.height + \"px\"\r\n            }),\r\n            this.ratioX = this.ratioX || (this.eventPt.x + this.getScrollLeft()) / i.width,\r\n            this.ratioY = this.ratioY || (this.eventPt.y + this.getScrollTop()) / i.height;\r\n            var n, o;\r\n            if (this.$.animator.ratioLock ? (n = this.$.animator.ratioLock.x * this.bounds.width - this.containerWidth / 2, o = this.$.animator.ratioLock.y * this.bounds.height - this.containerHeight / 2) : (n = this.ratioX * this.bounds.width - this.eventPt.x, o = this.ratioY * this.bounds.height - this.eventPt.y), n = Math.max(0, Math.min(this.bounds.width - this.containerWidth, n)), o = Math.max(0, Math.min(this.bounds.height - this.containerHeight, o)), this.canTransform) {\r\n                var s = {\r\n                    scale: e\r\n                };\r\n                s = this.canAccelerate ? t.mixin({\r\n                    translate3d: Math.round(this.bounds.left) + \"px, \" + Math.round(this.bounds.top) + \"px, 0px\"\r\n                },\r\n                s) : t.mixin({\r\n                    translate: this.bounds.left + \"px, \" + this.bounds.top + \"px\"\r\n                },\r\n                s),\r\n                t.dom.transform(this.$.content, s)\r\n            } else if (t.platform.ie) {\r\n                var r = '\"progid:DXImageTransform.Microsoft.Matrix(M11=' + e + \", M12=0, M21=0, M22=\" + e + \", SizingMethod='auto expand')\\\"\";\r\n                this.$.content.applyStyle(\"-ms-filter\", r),\r\n                this.$.content.setBounds({\r\n                    width: this.bounds.width * e + \"px\",\r\n                    height: this.bounds.height * e + \"px\",\r\n                    left: this.bounds.left + \"px\",\r\n                    top: this.bounds.top + \"px\"\r\n                }),\r\n                this.$.content.applyStyle(\"width\", e * this.bounds.width),\r\n                this.$.content.applyStyle(\"height\", e * this.bounds.height)\r\n            }\r\n            this.setScrollLeft(n),\r\n            this.setScrollTop(o),\r\n            this.positionClientControls(e)\r\n        },\r\n        limitScale: function(t) {\r\n            return this.disableZoom ? t = this.scale: t > this.maxScale ? t = this.maxScale: this.minScale > t && (t = this.minScale),\r\n            t\r\n        },\r\n        innerBounds: function(t) {\r\n            var e = this.originalWidth * t,\r\n            i = this.originalHeight * t,\r\n            n = {\r\n                x: 0,\r\n                y: 0,\r\n                transX: 0,\r\n                transY: 0\r\n            };\r\n            return this.containerWidth > e && (n.x += (this.containerWidth - e) / 2),\r\n            this.containerHeight > i && (n.y += (this.containerHeight - i) / 2),\r\n            this.canTransform && (n.transX -= (this.originalWidth - e) / 2, n.transY -= (this.originalHeight - i) / 2),\r\n            {\r\n                left: n.x + n.transX,\r\n                top: n.y + n.transY,\r\n                width: e,\r\n                height: i,\r\n                x: n.x,\r\n                y: n.y\r\n            }\r\n        },\r\n        saveState: function(t, e) {\r\n            var i = this.scale;\r\n            this.scale *= e.scale,\r\n            this.scale = this.limitScale(this.scale),\r\n            i != this.scale && this.doZoom({\r\n                scale: this.scale\r\n            }),\r\n            this.ratioX = this.ratioY = null\r\n        },\r\n        doubleClick: function(e, i) {\r\n            8 == t.platform.ie && (this.tapped = !0, i.pageX = i.clientX + i.target.scrollLeft, i.pageY = i.clientY + i.target.scrollTop, this.singleTap(e, i), i.preventDefault())\r\n        },\r\n        singleTap: function(t, e) {\r\n            setTimeout(this.bindSafely(function() {\r\n                this.tapped = !1\r\n            }), 300),\r\n            this.tapped ? (this.tapped = !1, this.smartZoom(t, e)) : this.tapped = !0\r\n        },\r\n        smartZoom: function(t, e) {\r\n            var i = this.hasNode(),\r\n            n = this.$.content.hasNode();\r\n            if (i && n && this.hasNode() && !this.disableZoom) {\r\n                var o = this.scale;\r\n                if (this.scale = this.scale != this.minScale ? this.minScale: this.maxScale, this.eventPt = this.calcEventLocation(e), this.animate) {\r\n                    var s = {\r\n                        x: (this.eventPt.x + this.getScrollLeft()) / this.bounds.width,\r\n                        y: (this.eventPt.y + this.getScrollTop()) / this.bounds.height\r\n                    };\r\n                    this.$.animator.play({\r\n                        duration: 350,\r\n                        ratioLock: s,\r\n                        baseScale: o,\r\n                        deltaScale: this.scale - o\r\n                    })\r\n                } else this.transform(this.scale),\r\n                this.doZoom({\r\n                    scale: this.scale\r\n                })\r\n            }\r\n        },\r\n        zoomAnimationStep: function() {\r\n            var t = this.$.animator.baseScale + this.$.animator.deltaScale * this.$.animator.value;\r\n            return this.transform(t),\r\n            !0\r\n        },\r\n        zoomAnimationEnd: function() {\r\n            return this.stabilize(),\r\n            this.doZoom({\r\n                scale: this.scale\r\n            }),\r\n            this.$.animator.ratioLock = void 0,\r\n            !0\r\n        },\r\n        positionClientControls: function(t) {\r\n            this.waterfallDown(\"onPositionPin\", {\r\n                scale: t,\r\n                bounds: this.bounds\r\n            })\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/imageview/source/ImageViewPin.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.ImageViewPin\",\r\n        kind: \"enyo.Control\",\r\n        published: {\r\n            highlightAnchorPoint: !1,\r\n            anchor: {\r\n                top: 0,\r\n                left: 0\r\n            },\r\n            position: {\r\n                top: 0,\r\n                left: 0\r\n            }\r\n        },\r\n        style: \"position:absolute;z-index:1000;width:0px;height:0px;\",\r\n        handlers: {\r\n            onPositionPin: \"reAnchor\"\r\n        },\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.styleClientControls(),\r\n                this.positionClientControls(),\r\n                this.highlightAnchorPointChanged(),\r\n                this.anchorChanged()\r\n            }\r\n        }),\r\n        styleClientControls: function() {\r\n            for (var t = this.getClientControls(), e = 0; t.length > e; e++) t[e].applyStyle(\"position\", \"absolute\")\r\n        },\r\n        positionClientControls: function() {\r\n            for (var t = this.getClientControls(), e = 0; t.length > e; e++) for (var i in this.position) t[e].applyStyle(i, this.position[i] + \"px\")\r\n        },\r\n        highlightAnchorPointChanged: function() {\r\n            this.addRemoveClass(\"pinDebug\", this.highlightAnchorPoint)\r\n        },\r\n        anchorChanged: function() {\r\n            var t = null,\r\n            e = null;\r\n            for (e in this.anchor) t = (\"\" + this.anchor[e]).match(/^(\\d+(?:\\.\\d+)?)(.*)$/),\r\n            t && (this.anchor[e + \"Coords\"] = {\r\n                value: t[1],\r\n                units: t[2] || \"px\"\r\n            })\r\n        },\r\n        reAnchor: function(t, e) {\r\n            var i = e.scale,\r\n            n = e.bounds,\r\n            o = this.anchor.right ? \"px\" == this.anchor.rightCoords.units ? n.width + n.x - this.anchor.rightCoords.value * i: n.width * (100 - this.anchor.rightCoords.value) / 100 + n.x: \"px\" == this.anchor.leftCoords.units ? this.anchor.leftCoords.value * i + n.x: n.width * this.anchor.leftCoords.value / 100 + n.x,\r\n            s = this.anchor.bottom ? \"px\" == this.anchor.bottomCoords.units ? n.height + n.y - this.anchor.bottomCoords.value * i: n.height * (100 - this.anchor.bottomCoords.value) / 100 + n.y: \"px\" == this.anchor.topCoords.units ? this.anchor.topCoords.value * i + n.y: n.height * this.anchor.topCoords.value / 100 + n.y;\r\n            this.applyStyle(\"left\", o + \"px\"),\r\n            this.applyStyle(\"top\", s + \"px\")\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/imageview/source/ImageView.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.ImageView\",\r\n        kind: \"enyo.PanZoomView\",\r\n        subKindComponents: [{\r\n            kind: \"Image\",\r\n            ondown: \"down\",\r\n            style: \"vertical-align: text-top;\"\r\n        }],\r\n        create: t.inherit(function(e) {\r\n            return function() {\r\n                this.unscaledComponents = this.components,\r\n                this.components = [],\r\n                this.kindComponents[1].components[0].components = this.subKindComponents,\r\n                e.apply(this, arguments),\r\n                this.$.content.applyStyle(\"display\", \"inline-block\"),\r\n                this.bufferImage = new Image,\r\n                this.bufferImage.onload = t.bind(this, \"imageLoaded\"),\r\n                this.bufferImage.onerror = t.bind(this, \"imageError\"),\r\n                this.srcChanged(),\r\n                this.getStrategy().$.scrollMath && this.getStrategy().$.scrollMath.start()\r\n            }\r\n        }),\r\n        destroy: t.inherit(function(t) {\r\n            return function() {\r\n                this.bufferImage && (this.bufferImage.onerror = void 0, this.bufferImage.onerror = void 0, delete this.bufferImage),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        down: function(t, e) {\r\n            e.preventDefault()\r\n        },\r\n        srcChanged: function() {\r\n            this.src && this.src.length > 0 && this.bufferImage && this.src != this.bufferImage.src && (this.bufferImage.src = this.src)\r\n        },\r\n        imageLoaded: function() {\r\n            if (this.scale = this.scaleKeyword, this.originalWidth = this.contentWidth = this.bufferImage.width, this.originalHeight = this.contentHeight = this.bufferImage.height, this.scaleChanged(), this.$.image.setSrc(this.bufferImage.src), t.platform.safari) {\r\n                var e = this.$.image.hasNode(),\r\n                i = this.bufferImage.src;\r\n                e && setTimeout(function() {\r\n                    e.src = i\r\n                },\r\n                100)\r\n            }\r\n            t.dom.transformValue(this.getStrategy().$.client, \"translate3d\", \"0px, 0px, 0\"),\r\n            this.positionClientControls(this.scale),\r\n            this.align()\r\n        },\r\n        imageError: function(e) {\r\n            t.error(\"Error loading image: \" + this.src),\r\n            this.bubble(\"onerror\", e)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/layout/imageview/source/ImageCarousel.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"enyo.ImageCarousel\",\r\n        kind: \"enyo.Panels\",\r\n        arrangerKind: \"enyo.CarouselArranger\",\r\n        defaultScale: \"auto\",\r\n        disableZoom: !1,\r\n        lowMemory: !1,\r\n        published: {\r\n            images: []\r\n        },\r\n        handlers: {\r\n            onTransitionStart: \"transitionStart\",\r\n            onTransitionFinish: \"transitionFinish\"\r\n        },\r\n        create: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.imageCount = this.images.length,\r\n                this.images.length > 0 && (this.initContainers(), this.loadNearby())\r\n            }\r\n        }),\r\n        initContainers: function() {\r\n            for (var t = 0; this.images.length > t; t++) this.$[\"container\" + t] || (this.createComponent({\r\n                name: \"container\" + t,\r\n                style: \"height:100%; width:100%;\"\r\n            }), this.$[\"container\" + t].render());\r\n            for (t = this.images.length; this.imageCount > t; t++) this.$[\"image\" + t] && this.$[\"image\" + t].destroy(),\r\n            this.$[\"container\" + t].destroy();\r\n            this.imageCount = this.images.length\r\n        },\r\n        loadNearby: function() {\r\n            var t = this.getBufferRange();\r\n            for (var e in t) this.loadImageView(t[e])\r\n        },\r\n        getBufferRange: function() {\r\n            var t = [];\r\n            if (this.layout.containerBounds) {\r\n                var e, i, n, o, s = 1,\r\n                r = this.layout.containerBounds;\r\n                for (i = this.index - 1, n = 0, o = r.width * s; i >= 0 && o >= n;) e = this.$[\"container\" + i],\r\n                n += e.width + e.marginWidth,\r\n                t.unshift(i),\r\n                i--;\r\n                for (i = this.index, n = 0, o = r.width * (s + 1); this.images.length > i && o >= n;) e = this.$[\"container\" + i],\r\n                n += e.width + e.marginWidth,\r\n                t.push(i),\r\n                i++\r\n            }\r\n            return t\r\n        },\r\n        reflow: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.loadNearby()\r\n            }\r\n        }),\r\n        loadImageView: function(t) {\r\n            return this.wrap && (t = (t % this.images.length + this.images.length) % this.images.length),\r\n            t >= 0 && this.images.length - 1 >= t && (this.$[\"image\" + t] ? this.$[\"image\" + t].src != this.images[t] && (this.$[\"image\" + t].setSrc(this.images[t]), this.$[\"image\" + t].setScale(this.defaultScale), this.$[\"image\" + t].setDisableZoom(this.disableZoom)) : (this.$[\"container\" + t].createComponent({\r\n                name: \"image\" + t,\r\n                kind: \"ImageView\",\r\n                scale: this.defaultScale,\r\n                disableZoom: this.disableZoom,\r\n                src: this.images[t],\r\n                verticalDragPropagation: !1,\r\n                style: \"height:100%; width:100%;\"\r\n            },\r\n            {\r\n                owner: this\r\n            }), this.$[\"image\" + t].render())),\r\n            this.$[\"image\" + t]\r\n        },\r\n        setImages: function(t) {\r\n            this.set(\"images\", t)\r\n        },\r\n        imagesChanged: function() {\r\n            this.initContainers(),\r\n            this.loadNearby()\r\n        },\r\n        indexChanged: t.inherit(function(t) {\r\n            return function() {\r\n                this.loadNearby(),\r\n                this.lowMemory && this.cleanupMemory(),\r\n                t.apply(this, arguments)\r\n            }\r\n        }),\r\n        transitionStart: function(t, e) {\r\n            return e.fromIndex == e.toIndex ? !0 : void 0\r\n        },\r\n        transitionFinish: function() {\r\n            this.loadNearby(),\r\n            this.lowMemory && this.cleanupMemory()\r\n        },\r\n        getActiveImage: function() {\r\n            return this.getImageByIndex(this.index)\r\n        },\r\n        getImageByIndex: function(t) {\r\n            return this.$[\"image\" + t] || this.loadImageView(t)\r\n        },\r\n        cleanupMemory: function() {\r\n            for (var e = this.getBufferRange(), i = 0; this.images.length > i; i++) - 1 === t.indexOf(i, e) && this.$[\"image\" + i] && this.$[\"image\" + i].destroy()\r\n        }\r\n    })\r\n})(enyo, this);"
  },
  {
    "path": "rtc/whiteboard/src/js/lib/onyx.js",
    "content": "// ../lib/onyx/version.js\r\n(function(t) {\r\n    t && t.version && (t.version.onyx = \"2.6.0-pre.4.dev\")\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Icon.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Icon\",\r\n        classes: \"onyx-icon\",\r\n        published: {\r\n            src: \"\",\r\n            disabled: !1\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.src && this.srcChanged(),\r\n            this.disabledChanged()\r\n        },\r\n        disabledChanged: function() {\r\n            this.addRemoveClass(\"disabled\", this.disabled)\r\n        },\r\n        srcChanged: function() {\r\n            this.applyStyle(\"background-image\", \"url(\" + t.path.rewrite(this.src) + \")\")\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Button.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Button\",\r\n        kind: \"enyo.Button\",\r\n        classes: \"onyx-button enyo-unselectable\",\r\n        handlers: {\r\n            ondown: \"down\",\r\n            onenter: \"enter\",\r\n            ondragfinish: \"dragfinish\",\r\n            onleave: \"leave\",\r\n            onup: \"up\"\r\n        },\r\n        down: function() {\r\n            return this.disabled ? !0 : (this.addClass(\"pressed\"), this._isPressed = !0, void 0)\r\n        },\r\n        enter: function() {\r\n            return this.disabled ? !0 : (this._isPressed && this.addClass(\"pressed\"), void 0)\r\n        },\r\n        dragfinish: function() {\r\n            return this.disabled ? !0 : (this.removeClass(\"pressed\"), this._isPressed = !1, void 0)\r\n        },\r\n        leave: function() {\r\n            return this.disabled ? !0 : (this.removeClass(\"pressed\"), void 0)\r\n        },\r\n        up: function() {\r\n            return this.disabled ? !0 : (this.removeClass(\"pressed\"), this._isPressed = !1, void 0)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/IconButton.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.IconButton\",\r\n        kind: \"onyx.Icon\",\r\n        published: {\r\n            active: !1\r\n        },\r\n        classes: \"onyx-icon-button\",\r\n        handlers: {\r\n            ondown: \"down\",\r\n            onenter: \"enter\",\r\n            ondragfinish: \"dragfinish\",\r\n            onleave: \"leave\",\r\n            onup: \"up\"\r\n        },\r\n        rendered: function() {\r\n            this.inherited(arguments),\r\n            this.activeChanged()\r\n        },\r\n        tap: function() {\r\n            return this.disabled ? !0 : (this.setActive(!0), void 0)\r\n        },\r\n        down: function() {\r\n            return this.disabled ? !0 : (this.addClass(\"pressed\"), this._isPressed = !0, void 0)\r\n        },\r\n        enter: function() {\r\n            return this.disabled ? !0 : (this._isPressed && this.addClass(\"pressed\"), void 0)\r\n        },\r\n        dragfinish: function() {\r\n            return this.disabled ? !0 : (this.removeClass(\"pressed\"), this._isPressed = !1, void 0)\r\n        },\r\n        leave: function() {\r\n            return this.disabled ? !0 : (this.removeClass(\"pressed\"), void 0)\r\n        },\r\n        up: function() {\r\n            return this.disabled ? !0 : (this.removeClass(\"pressed\"), this._isPressed = !1, void 0)\r\n        },\r\n        activeChanged: function() {\r\n            this.bubble(\"onActivate\")\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Checkbox.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Checkbox\",\r\n        classes: \"onyx-checkbox\",\r\n        kind: \"enyo.Checkbox\",\r\n        tag: \"div\",\r\n        handlers: {\r\n            onclick: \"\"\r\n        },\r\n        tap: function() {\r\n            return this.disabled || (this.setChecked(!this.getChecked()), this.bubble(\"onchange\")),\r\n            !this.disabled\r\n        },\r\n        dragstart: t.nop\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Drawer.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Drawer\",\r\n        kind: \"enyo.Drawer\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Grabber.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Grabber\",\r\n        classes: \"onyx-grabber\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Groupbox.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Groupbox\",\r\n        classes: \"onyx-groupbox\"\r\n    }),\r\n    t.kind({\r\n        name: \"onyx.GroupboxHeader\",\r\n        classes: \"onyx-groupbox-header\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Input.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Input\",\r\n        kind: \"enyo.Input\",\r\n        classes: \"onyx-input\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Popup.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Popup\",\r\n        kind: \"enyo.Popup\",\r\n        classes: \"onyx-popup\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/TextArea.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.TextArea\",\r\n        kind: \"enyo.TextArea\",\r\n        classes: \"onyx-textarea\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/RichText.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.RichText\",\r\n        kind: \"enyo.RichText\",\r\n        classes: \"onyx-richtext\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/InputDecorator.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.InputDecorator\",\r\n        kind: \"enyo.ToolDecorator\",\r\n        tag: \"label\",\r\n        classes: \"onyx-input-decorator\",\r\n        published: {\r\n            alwaysLooksFocused: !1\r\n        },\r\n        handlers: {\r\n            onDisabledChange: \"disabledChange\",\r\n            onfocus: \"receiveFocus\",\r\n            onblur: \"receiveBlur\"\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.updateFocus(!1)\r\n        },\r\n        alwaysLooksFocusedChanged: function() {\r\n            this.updateFocus(this.focus)\r\n        },\r\n        updateFocus: function(t) {\r\n            this.focused = t,\r\n            this.addRemoveClass(\"onyx-focused\", this.alwaysLooksFocused || this.focused)\r\n        },\r\n        receiveFocus: function() {\r\n            this.updateFocus(!0)\r\n        },\r\n        receiveBlur: function() {\r\n            this.updateFocus(!1)\r\n        },\r\n        disabledChange: function(t, e) {\r\n            this.addRemoveClass(\"onyx-disabled\", e.originator.disabled)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Tooltip.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Tooltip\",\r\n        kind: \"onyx.Popup\",\r\n        classes: \"onyx-tooltip below left-arrow\",\r\n        autoDismiss: !1,\r\n        showDelay: 500,\r\n        defaultLeft: -6,\r\n        handlers: {\r\n            onRequestShowTooltip: \"requestShow\",\r\n            onRequestHideTooltip: \"requestHide\"\r\n        },\r\n        requestShow: function() {\r\n            return this.showJob = setTimeout(this.bindSafely(\"show\"), this.showDelay),\r\n            !0\r\n        },\r\n        cancelShow: function() {\r\n            clearTimeout(this.showJob)\r\n        },\r\n        requestHide: function() {\r\n            return this.cancelShow(),\r\n            this.inherited(arguments)\r\n        },\r\n        showingChanged: function() {\r\n            this.cancelShow(),\r\n            this.adjustPosition(!0),\r\n            this.inherited(arguments)\r\n        },\r\n        applyPosition: function(t) {\r\n            var e = \"\";\r\n            for (var i in t) e += i + \":\" + t[i] + (isNaN(t[i]) ? \"; \": \"px; \");\r\n            this.addStyles(e)\r\n        },\r\n        adjustPosition: function() {\r\n            if (this.showing && this.hasNode()) {\r\n                var t = this.node.getBoundingClientRect();\r\n                t.top + t.height > window.innerHeight ? (this.addRemoveClass(\"below\", !1), this.addRemoveClass(\"above\", !0)) : (this.addRemoveClass(\"above\", !1), this.addRemoveClass(\"below\", !0)),\r\n                t.left + t.width > window.innerWidth && (this.applyPosition({\r\n                    \"margin-left\": -t.width,\r\n                    bottom: \"auto\"\r\n                }), this.addRemoveClass(\"left-arrow\", !1), this.addRemoveClass(\"right-arrow\", !0))\r\n            }\r\n        },\r\n        handleResize: function() {\r\n            this.applyPosition({\r\n                \"margin-left\": this.defaultLeft,\r\n                bottom: \"auto\"\r\n            }),\r\n            this.addRemoveClass(\"left-arrow\", !0),\r\n            this.addRemoveClass(\"right-arrow\", !1),\r\n            this.adjustPosition(!0),\r\n            this.inherited(arguments)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/TooltipDecorator.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.TooltipDecorator\",\r\n        kind: \"enyo.Control\",\r\n        defaultKind: \"onyx.Button\",\r\n        classes: \"onyx-popup-decorator\",\r\n        handlers: {\r\n            onenter: \"enter\",\r\n            onleave: \"leave\"\r\n        },\r\n        enter: function() {\r\n            this.requestShowTooltip()\r\n        },\r\n        leave: function() {\r\n            this.requestHideTooltip()\r\n        },\r\n        tap: function() {\r\n            this.requestHideTooltip()\r\n        },\r\n        requestShowTooltip: function() {\r\n            this.waterfallDown(\"onRequestShowTooltip\")\r\n        },\r\n        requestHideTooltip: function() {\r\n            this.waterfallDown(\"onRequestHideTooltip\")\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/MenuDecorator.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.MenuDecorator\",\r\n        kind: \"onyx.TooltipDecorator\",\r\n        defaultKind: \"onyx.Button\",\r\n        classes: \"onyx-popup-decorator enyo-unselectable\",\r\n        handlers: {\r\n            onActivate: \"activated\",\r\n            onHide: \"menuHidden\"\r\n        },\r\n        activated: function(t, e) {\r\n            this.requestHideTooltip(),\r\n            e.originator.active && (this.menuActive = !0, this.activator = e.originator, this.activator.addClass(\"active\"), this.requestShowMenu())\r\n        },\r\n        requestShowMenu: function() {\r\n            this.waterfallDown(\"onRequestShowMenu\", {\r\n                activator: this.activator\r\n            })\r\n        },\r\n        requestHideMenu: function() {\r\n            this.waterfallDown(\"onRequestHideMenu\")\r\n        },\r\n        menuHidden: function() {\r\n            this.menuActive = !1,\r\n            this.activator && (this.activator.setActive(!1), this.activator.removeClass(\"active\"))\r\n        },\r\n        enter: function() {\r\n            this.menuActive || this.inherited(arguments)\r\n        },\r\n        leave: function() {\r\n            this.menuActive || this.inherited(arguments)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Menu.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Menu\",\r\n        kind: \"onyx.Popup\",\r\n        modal: !0,\r\n        defaultKind: \"onyx.MenuItem\",\r\n        classes: \"onyx-menu\",\r\n        published: {\r\n            maxHeight: 200,\r\n            scrolling: !0,\r\n            scrollStrategyKind: \"TouchScrollStrategy\"\r\n        },\r\n        handlers: {\r\n            onActivate: \"itemActivated\",\r\n            onRequestShowMenu: \"requestMenuShow\",\r\n            onRequestHideMenu: \"requestHide\"\r\n        },\r\n        childComponents: [{\r\n            name: \"client\",\r\n            kind: \"enyo.Scroller\"\r\n        }],\r\n        showOnTop: !1,\r\n        scrollerName: \"client\",\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.maxHeightChanged()\r\n        },\r\n        initComponents: function() {\r\n            this.scrolling && this.createComponents(this.childComponents, {\r\n                isChrome: !0,\r\n                strategyKind: this.scrollStrategyKind\r\n            }),\r\n            this.inherited(arguments)\r\n        },\r\n        getScroller: function() {\r\n            return this.$[this.scrollerName]\r\n        },\r\n        maxHeightChanged: function() {\r\n            this.scrolling && this.getScroller().setMaxHeight(this.maxHeight + \"px\")\r\n        },\r\n        itemActivated: function(t, e) {\r\n            return e.originator.setActive(!1),\r\n            !0\r\n        },\r\n        showingChanged: function() {\r\n            this.inherited(arguments),\r\n            this.scrolling && this.getScroller().setShowing(this.showing),\r\n            this.adjustPosition(!0)\r\n        },\r\n        requestMenuShow: function(t, e) {\r\n            if (this.floating) {\r\n                var i = e.activator.hasNode();\r\n                if (i) {\r\n                    var n = this.activatorOffset = this.getPageOffset(i);\r\n                    this.applyPosition({\r\n                        top: n.top + (this.showOnTop ? 0 : n.height),\r\n                        left: n.left,\r\n                        width: n.width\r\n                    })\r\n                }\r\n            }\r\n            return this.show(),\r\n            !0\r\n        },\r\n        applyPosition: function(t) {\r\n            var e = \"\";\r\n            for (var i in t) e += i + \":\" + t[i] + (isNaN(t[i]) ? \"; \": \"px; \");\r\n            this.addStyles(e)\r\n        },\r\n        getPageOffset: function(t) {\r\n            var e = t.getBoundingClientRect(),\r\n            i = void 0 === window.pageYOffset ? document.documentElement.scrollTop: window.pageYOffset,\r\n            n = void 0 === window.pageXOffset ? document.documentElement.scrollLeft: window.pageXOffset,\r\n            o = void 0 === e.height ? e.bottom - e.top: e.height,\r\n            s = void 0 === e.width ? e.right - e.left: e.width;\r\n            return {\r\n                top: e.top + i,\r\n                left: e.left + n,\r\n                height: o,\r\n                width: s\r\n            }\r\n        },\r\n        adjustPosition: function() {\r\n            if (this.showing && this.hasNode()) {\r\n                this.scrolling && !this.showOnTop && this.getScroller().setMaxHeight(this.maxHeight + \"px\"),\r\n                this.removeClass(\"onyx-menu-up\"),\r\n                this.floating || this.applyPosition({\r\n                    left: \"auto\"\r\n                });\r\n                var t = this.node.getBoundingClientRect(),\r\n                e = void 0 === t.height ? t.bottom - t.top: t.height,\r\n                i = void 0 === window.innerHeight ? document.documentElement.clientHeight: window.innerHeight,\r\n                n = void 0 === window.innerWidth ? document.documentElement.clientWidth: window.innerWidth;\r\n                if (this.menuUp = t.top + e > i && i - t.bottom < t.top - e, this.addRemoveClass(\"onyx-menu-up\", this.menuUp), this.floating) {\r\n                    var o = this.activatorOffset;\r\n                    this.menuUp ? this.applyPosition({\r\n                        top: o.top - e + (this.showOnTop ? o.height: 0),\r\n                        bottom: \"auto\"\r\n                    }) : t.top < o.top && i > o.top + (this.showOnTop ? 0 : o.height) + e && this.applyPosition({\r\n                        top: o.top + (this.showOnTop ? 0 : o.height),\r\n                        bottom: \"auto\"\r\n                    })\r\n                }\r\n                if (t.right > n && (this.floating ? this.applyPosition({\r\n                    left: n - t.width\r\n                }) : this.applyPosition({\r\n                    left: -(t.right - n)\r\n                })), 0 > t.left && (this.floating ? this.applyPosition({\r\n                    left: 0,\r\n                    right: \"auto\"\r\n                }) : \"auto\" == this.getComputedStyleValue(\"right\") ? this.applyPosition({\r\n                    left: -t.left\r\n                }) : this.applyPosition({\r\n                    right: t.left\r\n                })), this.scrolling && !this.showOnTop) {\r\n                    t = this.node.getBoundingClientRect();\r\n                    var s;\r\n                    s = this.menuUp ? this.maxHeight < t.bottom ? this.maxHeight: t.bottom: i > t.top + this.maxHeight ? this.maxHeight: i - t.top,\r\n                    this.getScroller().setMaxHeight(s + \"px\")\r\n                }\r\n            }\r\n        },\r\n        handleResize: function() {\r\n            this.inherited(arguments),\r\n            this.adjustPosition()\r\n        },\r\n        requestHide: function() {\r\n            this.setShowing(!1)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/MenuItem.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.MenuItem\",\r\n        kind: \"enyo.Button\",\r\n        events: {\r\n            onSelect: \"\",\r\n            onItemContentChange: \"\"\r\n        },\r\n        classes: \"onyx-menu-item\",\r\n        tag: \"div\",\r\n        create: function() {\r\n            this.silence(),\r\n            this.inherited(arguments),\r\n            this.unsilence(),\r\n            this.active && this.bubble(\"onActivate\")\r\n        },\r\n        tap: function() {\r\n            this.inherited(arguments),\r\n            this.bubble(\"onRequestHideMenu\"),\r\n            this.doSelect({\r\n                selected: this,\r\n                content: this.content\r\n            })\r\n        },\r\n        contentChanged: function() {\r\n            this.inherited(arguments),\r\n            this.doItemContentChange({\r\n                content: this.content\r\n            })\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Submenu.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Submenu\",\r\n        defaultKind: \"onyx.MenuItem\",\r\n        initComponents: function() {\r\n            this.createChrome([{\r\n                name: \"label\",\r\n                kind: \"enyo.Control\",\r\n                classes: \"onyx-menu-item\",\r\n                content: this.content || this.name,\r\n                isChrome: !0,\r\n                ontap: \"toggleOpen\"\r\n            },\r\n            {\r\n                kind: \"onyx.Drawer\",\r\n                name: \"client\",\r\n                classes: \"client onyx-submenu\",\r\n                isChrome: !0,\r\n                open: !1\r\n            }]),\r\n            this.inherited(arguments)\r\n        },\r\n        toggleOpen: function() {\r\n            this.setOpen(!this.getOpen())\r\n        },\r\n        setOpen: function(t) {\r\n            this.$.client.setOpen(t)\r\n        },\r\n        getOpen: function() {\r\n            return this.$.client.getOpen()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/PickerDecorator.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.PickerDecorator\",\r\n        kind: \"onyx.MenuDecorator\",\r\n        classes: \"onyx-picker-decorator\",\r\n        defaultKind: \"onyx.PickerButton\",\r\n        handlers: {\r\n            onChange: \"change\"\r\n        },\r\n        change: function(t, e) {\r\n            this.waterfallDown(\"onChange\", e)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/PickerButton.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.PickerButton\",\r\n        kind: \"onyx.Button\",\r\n        handlers: {\r\n            onChange: \"change\"\r\n        },\r\n        change: function(t, e) {\r\n            void 0 !== e.content && this.setContent(e.content)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Picker.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Picker\",\r\n        kind: \"onyx.Menu\",\r\n        classes: \"onyx-picker enyo-unselectable\",\r\n        published: {\r\n            selected: null\r\n        },\r\n        events: {\r\n            onChange: \"\"\r\n        },\r\n        handlers: {\r\n            onItemContentChange: \"itemContentChange\"\r\n        },\r\n        floating: !0,\r\n        showOnTop: !0,\r\n        initComponents: function() {\r\n            this.setScrolling(!0),\r\n            this.inherited(arguments)\r\n        },\r\n        showingChanged: function() {\r\n            this.getScroller().setShowing(this.showing),\r\n            this.inherited(arguments),\r\n            this.showing && this.selected && this.scrollToSelected()\r\n        },\r\n        scrollToSelected: function() {\r\n            this.getScroller().scrollToControl(this.selected, !this.menuUp)\r\n        },\r\n        itemActivated: function(t, e) {\r\n            return this.processActivatedItem(e.originator),\r\n            this.inherited(arguments)\r\n        },\r\n        processActivatedItem: function(t) {\r\n            t.active && this.setSelected(t)\r\n        },\r\n        selectedChanged: function(t) {\r\n            t && t.removeClass(\"selected\"),\r\n            this.selected && (this.selected.addClass(\"selected\"), this.doChange({\r\n                selected: this.selected,\r\n                content: this.selected.content\r\n            }))\r\n        },\r\n        itemContentChange: function(t, e) {\r\n            e.originator == this.selected && this.doChange({\r\n                selected: this.selected,\r\n                content: this.selected.content\r\n            })\r\n        },\r\n        handleResize: function() {\r\n            this.inherited(arguments),\r\n            this.adjustPosition()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/FlyweightPicker.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.FlyweightPicker\",\r\n        kind: \"onyx.Picker\",\r\n        classes: \"onyx-flyweight-picker\",\r\n        published: {\r\n            count: 0\r\n        },\r\n        events: {\r\n            onSetupItem: \"\",\r\n            onSelect: \"\"\r\n        },\r\n        handlers: {\r\n            onSelect: \"itemSelect\"\r\n        },\r\n        components: [{\r\n            name: \"scroller\",\r\n            kind: \"enyo.Scroller\",\r\n            strategyKind: \"TouchScrollStrategy\",\r\n            components: [{\r\n                name: \"flyweight\",\r\n                kind: \"FlyweightRepeater\",\r\n                noSelect: !0,\r\n                ontap: \"itemTap\"\r\n            }]\r\n        }],\r\n        scrollerName: \"scroller\",\r\n        initComponents: function() {\r\n            this.controlParentName = \"flyweight\",\r\n            this.inherited(arguments),\r\n            this.$.flyweight.$.client.children[0].setActive(!0)\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.countChanged()\r\n        },\r\n        rendered: function() {\r\n            this.inherited(arguments),\r\n            this.selectedChanged()\r\n        },\r\n        scrollToSelected: function() {\r\n            var t = this.$.flyweight.fetchRowNode(this.selected);\r\n            this.getScroller().scrollToNode(t, !this.menuUp)\r\n        },\r\n        countChanged: function() {\r\n            this.$.flyweight.count = this.count\r\n        },\r\n        processActivatedItem: function(t) {\r\n            this.item = t\r\n        },\r\n        selectedChanged: function(t) {\r\n            if (this.item) {\r\n                null != t && (this.item.removeClass(\"selected\"), this.$.flyweight.renderRow(t));\r\n                var e;\r\n                null != this.selected && (this.item.addClass(\"selected\"), this.$.flyweight.renderRow(this.selected), this.item.removeClass(\"selected\"), e = this.$.flyweight.fetchRowNode(this.selected)),\r\n                this.doChange({\r\n                    selected: this.selected,\r\n                    content: e && e.textContent || this.item.content\r\n                })\r\n            }\r\n        },\r\n        itemTap: function(t, e) {\r\n            this.setSelected(e.rowIndex),\r\n            this.doSelect({\r\n                selected: this.item,\r\n                content: this.item.content\r\n            })\r\n        },\r\n        itemSelect: function(t, e) {\r\n            return e.originator != this ? !0 : void 0\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/DatePicker.js\r\n(function(t, e) {\r\n    t.kind({\r\n        name: \"onyx.DatePicker\",\r\n        classes: \"onyx-toolbar-inline\",\r\n        published: {\r\n            disabled: !1,\r\n            locale: \"en-US\",\r\n            dayHidden: !1,\r\n            monthHidden: !1,\r\n            yearHidden: !1,\r\n            minYear: 1900,\r\n            maxYear: 2099,\r\n            value: null\r\n        },\r\n        events: {\r\n            onSelect: \"\"\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            e.ilib && (this.locale = e.ilib.getLocale()),\r\n            this.initDefaults()\r\n        },\r\n        initDefaults: function() {\r\n            var t;\r\n            e.ilib ? (t = [], this._tf = new e.ilib.DateFmt({\r\n                locale: this.locale,\r\n                timezone: \"local\"\r\n            }), t = this._tf.getMonthsOfYear({\r\n                length: \"long\"\r\n            })) : t = [void 0, \"JAN\", \"FEB\", \"MAR\", \"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"],\r\n            this.setupPickers(this._tf ? this._tf.getTemplate() : \"mdy\"),\r\n            this.dayHiddenChanged(),\r\n            this.monthHiddenChanged(),\r\n            this.yearHiddenChanged();\r\n            for (var i, n = this.value = this.value || new Date,\r\n            o = 0; i = t[o + 1]; o++) this.$.monthPicker.createComponent({\r\n                content: i,\r\n                value: o,\r\n                active: o == n.getMonth()\r\n            });\r\n            var s = n.getFullYear();\r\n            for (this.$.yearPicker.setSelected(s - this.minYear), o = 1; this.monthLength(n.getYear(), n.getMonth()) >= o; o++) this.$.dayPicker.createComponent({\r\n                content: o,\r\n                value: o,\r\n                active: o == n.getDate()\r\n            })\r\n        },\r\n        monthLength: function(t, e) {\r\n            return 32 - new Date(t, e, 32).getDate()\r\n        },\r\n        setupYear: function(t, e) {\r\n            return this.$.year.setContent(this.minYear + e.index),\r\n            !0\r\n        },\r\n        setupPickers: function(t) {\r\n            var e, i, n, o = t.split(\"\"),\r\n            s = !1,\r\n            r = !1,\r\n            a = !1;\r\n            for (i = 0, n = o.length; n > i; i++) switch (e = o[i], e.toLowerCase()) {\r\n            case \"d\":\r\n                a || (this.createDay(), a = !0);\r\n                break;\r\n            case \"m\":\r\n                r || (this.createMonth(), r = !0);\r\n                break;\r\n            case \"y\":\r\n                s || (this.createYear(), s = !0);\r\n                break;\r\n            default:\r\n            }\r\n        },\r\n        createYear: function() {\r\n            var t = this.maxYear - this.minYear;\r\n            this.createComponent({\r\n                kind: \"onyx.PickerDecorator\",\r\n                onSelect: \"updateYear\",\r\n                components: [{\r\n                    classes: \"onyx-datepicker-year\",\r\n                    name: \"yearPickerButton\",\r\n                    disabled: this.disabled\r\n                },\r\n                {\r\n                    name: \"yearPicker\",\r\n                    kind: \"onyx.FlyweightPicker\",\r\n                    count: ++t,\r\n                    onSetupItem: \"setupYear\",\r\n                    components: [{\r\n                        name: \"year\"\r\n                    }]\r\n                }]\r\n            })\r\n        },\r\n        createMonth: function() {\r\n            this.createComponent({\r\n                kind: \"onyx.PickerDecorator\",\r\n                onSelect: \"updateMonth\",\r\n                components: [{\r\n                    classes: \"onyx-datepicker-month\",\r\n                    name: \"monthPickerButton\",\r\n                    disabled: this.disabled\r\n                },\r\n                {\r\n                    name: \"monthPicker\",\r\n                    kind: \"onyx.Picker\"\r\n                }]\r\n            })\r\n        },\r\n        createDay: function() {\r\n            this.createComponent({\r\n                kind: \"onyx.PickerDecorator\",\r\n                onSelect: \"updateDay\",\r\n                components: [{\r\n                    classes: \"onyx-datepicker-day\",\r\n                    name: \"dayPickerButton\",\r\n                    disabled: this.disabled\r\n                },\r\n                {\r\n                    name: \"dayPicker\",\r\n                    kind: \"onyx.Picker\"\r\n                }]\r\n            })\r\n        },\r\n        localeChanged: function() {\r\n            this.refresh()\r\n        },\r\n        dayHiddenChanged: function() {\r\n            this.$.dayPicker.getParent().setShowing(this.dayHidden ? !1 : !0)\r\n        },\r\n        monthHiddenChanged: function() {\r\n            this.$.monthPicker.getParent().setShowing(this.monthHidden ? !1 : !0)\r\n        },\r\n        yearHiddenChanged: function() {\r\n            this.$.yearPicker.getParent().setShowing(this.yearHidden ? !1 : !0)\r\n        },\r\n        minYearChanged: function() {\r\n            this.refresh()\r\n        },\r\n        maxYearChanged: function() {\r\n            this.refresh()\r\n        },\r\n        valueChanged: function() {\r\n            this.refresh()\r\n        },\r\n        disabledChanged: function() {\r\n            this.$.yearPickerButton.setDisabled(this.disabled),\r\n            this.$.monthPickerButton.setDisabled(this.disabled),\r\n            this.$.dayPickerButton.setDisabled(this.disabled)\r\n        },\r\n        updateDay: function(t, e) {\r\n            var i = this.calcDate(this.value.getFullYear(), this.value.getMonth(), e.selected.value);\r\n            return this.doSelect({\r\n                name: this.name,\r\n                value: i\r\n            }),\r\n            this.setValue(i),\r\n            !0\r\n        },\r\n        updateMonth: function(t, e) {\r\n            var i = this.calcDate(this.value.getFullYear(), e.selected.value, this.value.getDate());\r\n            return this.doSelect({\r\n                name: this.name,\r\n                value: i\r\n            }),\r\n            this.setValue(i),\r\n            !0\r\n        },\r\n        updateYear: function(t, e) {\r\n            if ( - 1 != e.originator.selected) {\r\n                var i = this.calcDate(this.minYear + e.originator.selected, this.value.getMonth(), this.value.getDate());\r\n                this.doSelect({\r\n                    name: this.name,\r\n                    value: i\r\n                }),\r\n                this.setValue(i)\r\n            }\r\n            return ! 0\r\n        },\r\n        calcDate: function(t, e, i) {\r\n            return new Date(t, e, i, this.value.getHours(), this.value.getMinutes(), this.value.getSeconds(), this.value.getMilliseconds())\r\n        },\r\n        refresh: function() {\r\n            this.destroyClientControls(),\r\n            this.initDefaults(),\r\n            this.render()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/TimePicker.js\r\n(function(t, e) {\r\n    t.kind({\r\n        name: \"onyx.TimePicker\",\r\n        classes: \"onyx-toolbar-inline\",\r\n        published: {\r\n            disabled: !1,\r\n            locale: \"en-US\",\r\n            is24HrMode: null,\r\n            value: null\r\n        },\r\n        events: {\r\n            onSelect: \"\"\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            e.ilib && (this.locale = e.ilib.getLocale()),\r\n            this.initDefaults()\r\n        },\r\n        initDefaults: function() {\r\n            if (this._strAm = \"AM\", this._strPm = \"PM\", e.ilib) {\r\n                this._tf = new e.ilib.DateFmt({\r\n                    locale: this.locale\r\n                });\r\n                var t = new e.ilib.DateFmt({\r\n                    locale: this.locale,\r\n                    type: \"time\",\r\n                    template: \"a\"\r\n                }),\r\n                i = e.ilib.Date.newInstance({\r\n                    locale: this.locale,\r\n                    hour: 1\r\n                });\r\n                this._strAm = t.format(i),\r\n                i.hour = 13,\r\n                this._strPm = t.format(i),\r\n                null == this.is24HrMode && (this.is24HrMode = \"24\" == this._tf.getClock())\r\n            } else null == this.is24HrMode && (this.is24HrMode = !1);\r\n            this.setupPickers(this._tf ? this._tf.getTimeComponents() : \"hma\");\r\n            var n, o = this.value = this.value || new Date;\r\n            if (this.is24HrMode) for (n = 0; 24 > n; n++) this.$.hourPicker.createComponent({\r\n                content: n,\r\n                value: n,\r\n                active: n == o.getHours()\r\n            });\r\n            else {\r\n                var s = o.getHours();\r\n                for (s = 0 === s ? 12 : s, n = 1; 12 >= n; n++) this.$.hourPicker.createComponent({\r\n                    content: n,\r\n                    value: n,\r\n                    active: n == (s > 12 ? s % 12 : s)\r\n                })\r\n            }\r\n            for (n = 0; 59 >= n; n++) this.$.minutePicker.createComponent({\r\n                content: 10 > n ? \"0\" + n: n,\r\n                value: n,\r\n                active: n == o.getMinutes()\r\n            });\r\n            o.getHours() >= 12 ? this.$.ampmPicker.createComponents([{\r\n                content: this._strAm\r\n            },\r\n            {\r\n                content: this._strPm,\r\n                active: !0\r\n            }]) : this.$.ampmPicker.createComponents([{\r\n                content: this._strAm,\r\n                active: !0\r\n            },\r\n            {\r\n                content: this._strPm\r\n            }]),\r\n            this.$.ampmPicker.getParent().setShowing(!this.is24HrMode)\r\n        },\r\n        setupPickers: function(t) { - 1 !== t.indexOf(\"h\") && this.createHour(),\r\n            -1 !== t.indexOf(\"m\") && this.createMinute(),\r\n            -1 !== t.indexOf(\"a\") && this.createAmPm()\r\n        },\r\n        createHour: function() {\r\n            this.createComponent({\r\n                kind: \"onyx.PickerDecorator\",\r\n                onSelect: \"updateHour\",\r\n                components: [{\r\n                    classes: \"onyx-timepicker-hour\",\r\n                    name: \"hourPickerButton\",\r\n                    disabled: this.disabled\r\n                },\r\n                {\r\n                    name: \"hourPicker\",\r\n                    kind: \"onyx.Picker\"\r\n                }]\r\n            })\r\n        },\r\n        createMinute: function() {\r\n            this.createComponent({\r\n                kind: \"onyx.PickerDecorator\",\r\n                onSelect: \"updateMinute\",\r\n                components: [{\r\n                    classes: \"onyx-timepicker-minute\",\r\n                    name: \"minutePickerButton\",\r\n                    disabled: this.disabled\r\n                },\r\n                {\r\n                    name: \"minutePicker\",\r\n                    kind: \"onyx.Picker\"\r\n                }]\r\n            })\r\n        },\r\n        createAmPm: function() {\r\n            this.createComponent({\r\n                kind: \"onyx.PickerDecorator\",\r\n                onSelect: \"updateAmPm\",\r\n                components: [{\r\n                    classes: \"onyx-timepicker-ampm\",\r\n                    name: \"ampmPickerButton\",\r\n                    disabled: this.disabled\r\n                },\r\n                {\r\n                    name: \"ampmPicker\",\r\n                    kind: \"onyx.Picker\"\r\n                }]\r\n            })\r\n        },\r\n        disabledChanged: function() {\r\n            this.$.hourPickerButton.setDisabled(this.disabled),\r\n            this.$.minutePickerButton.setDisabled(this.disabled),\r\n            this.$.ampmPickerButton.setDisabled(this.disabled)\r\n        },\r\n        localeChanged: function() {\r\n            this.is24HrMode = null,\r\n            this.refresh()\r\n        },\r\n        is24HrModeChanged: function() {\r\n            this.refresh()\r\n        },\r\n        valueChanged: function() {\r\n            this.refresh()\r\n        },\r\n        updateHour: function(t, e) {\r\n            var i = e.selected.value;\r\n            if (!this.is24HrMode) {\r\n                var n = this.$.ampmPicker.getParent().controlAtIndex(0).content;\r\n                i = i + (12 == i ? -12 : 0) + (this.isAm(n) ? 0 : 12)\r\n            }\r\n            return this.setValue(this.calcTime(i, this.value.getMinutes())),\r\n            this.doSelect({\r\n                name: this.name,\r\n                value: this.value\r\n            }),\r\n            !0\r\n        },\r\n        updateMinute: function(t, e) {\r\n            return this.setValue(this.calcTime(this.value.getHours(), e.selected.value)),\r\n            this.doSelect({\r\n                name: this.name,\r\n                value: this.value\r\n            }),\r\n            !0\r\n        },\r\n        updateAmPm: function(t, e) {\r\n            var i = this.value.getHours();\r\n            return this.is24HrMode || (i += i > 11 ? this.isAm(e.content) ? -12 : 0 : this.isAm(e.content) ? 0 : 12),\r\n            this.setValue(this.calcTime(i, this.value.getMinutes())),\r\n            this.doSelect({\r\n                name: this.name,\r\n                value: this.value\r\n            }),\r\n            !0\r\n        },\r\n        calcTime: function(t, e) {\r\n            return new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), t, e, this.value.getSeconds(), this.value.getMilliseconds())\r\n        },\r\n        isAm: function(t) {\r\n            return t == this._strAm ? !0 : !1\r\n        },\r\n        refresh: function() {\r\n            this.destroyClientControls(),\r\n            this.initDefaults(),\r\n            this.render()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/RadioButton.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.RadioButton\",\r\n        kind: \"enyo.Button\",\r\n        classes: \"onyx-radiobutton\"\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/RadioGroup.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.RadioGroup\",\r\n        kind: \"enyo.Group\",\r\n        defaultKind: \"onyx.RadioButton\",\r\n        highlander: !0\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/ToggleButton.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.ToggleButton\",\r\n        classes: \"onyx-toggle-button\",\r\n        published: {\r\n            active: !1,\r\n            value: !1,\r\n            onContent: \"On\",\r\n            offContent: \"Off\",\r\n            disabled: !1\r\n        },\r\n        events: {\r\n            onChange: \"\"\r\n        },\r\n        handlers: {\r\n            ondragstart: \"dragstart\",\r\n            ondrag: \"drag\",\r\n            ondragfinish: \"dragfinish\"\r\n        },\r\n        components: [{\r\n            name: \"contentOn\",\r\n            classes: \"onyx-toggle-content on\"\r\n        },\r\n        {\r\n            name: \"contentOff\",\r\n            classes: \"onyx-toggle-content off\"\r\n        },\r\n        {\r\n            classes: \"onyx-toggle-button-knob\"\r\n        }],\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.value = Boolean(this.value || this.active),\r\n            this.onContentChanged(),\r\n            this.offContentChanged(),\r\n            this.disabledChanged()\r\n        },\r\n        rendered: function() {\r\n            this.inherited(arguments),\r\n            this.updateVisualState()\r\n        },\r\n        updateVisualState: function() {\r\n            this.addRemoveClass(\"off\", !this.value),\r\n            this.$.contentOn.setShowing(this.value),\r\n            this.$.contentOff.setShowing(!this.value),\r\n            this.setActive(this.value)\r\n        },\r\n        valueChanged: function() {\r\n            this.updateVisualState(),\r\n            this.doChange({\r\n                value: this.value\r\n            })\r\n        },\r\n        activeChanged: function() {\r\n            this.setValue(this.active),\r\n            this.bubble(\"onActivate\")\r\n        },\r\n        onContentChanged: function() {\r\n            this.$.contentOn.setContent(this.onContent || \"\"),\r\n            this.$.contentOn.addRemoveClass(\"empty\", !this.onContent)\r\n        },\r\n        offContentChanged: function() {\r\n            this.$.contentOff.setContent(this.offContent || \"\"),\r\n            this.$.contentOff.addRemoveClass(\"empty\", !this.onContent)\r\n        },\r\n        disabledChanged: function() {\r\n            this.addRemoveClass(\"disabled\", this.disabled)\r\n        },\r\n        updateValue: function(t) {\r\n            this.disabled || this.setValue(t)\r\n        },\r\n        tap: function() {\r\n            this.updateValue(!this.value)\r\n        },\r\n        dragstart: function(t, e) {\r\n            return e.horizontal ? (e.preventDefault(), this.dragging = !0, this.dragged = !1, !0) : void 0\r\n        },\r\n        drag: function(t, e) {\r\n            if (this.dragging) {\r\n                var i = e.dx;\r\n                return Math.abs(i) > 10 && (this.updateValue(i > 0), this.dragged = !0),\r\n                !0\r\n            }\r\n        },\r\n        dragfinish: function(t, e) {\r\n            this.dragging = !1,\r\n            this.dragged && e.preventTap()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/ToggleIconButton.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.ToggleIconButton\",\r\n        kind: \"onyx.Icon\",\r\n        published: {\r\n            active: !1,\r\n            value: !1\r\n        },\r\n        events: {\r\n            onChange: \"\"\r\n        },\r\n        classes: \"onyx-icon-button onyx-icon-toggle\",\r\n        activeChanged: function() {\r\n            this.addRemoveClass(\"active\", this.value),\r\n            this.bubble(\"onActivate\")\r\n        },\r\n        updateValue: function(t) {\r\n            this.disabled || (this.setValue(t), this.doChange({\r\n                value: this.value\r\n            }))\r\n        },\r\n        tap: function() {\r\n            this.updateValue(!this.value)\r\n        },\r\n        valueChanged: function() {\r\n            this.setActive(this.value)\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.value = Boolean(this.value || this.active)\r\n        },\r\n        rendered: function() {\r\n            this.inherited(arguments),\r\n            this.valueChanged(),\r\n            this.removeClass(\"onyx-icon\")\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Toolbar.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Toolbar\",\r\n        classes: \"onyx onyx-toolbar onyx-toolbar-inline\",\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.hasClass(\"onyx-menu-toolbar\") && t.platform.android >= 4 && this.applyStyle(\"position\", \"static\")\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/ProgressBar.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.ProgressBar\",\r\n        classes: \"onyx-progress-bar\",\r\n        published: {\r\n            progress: 0,\r\n            min: 0,\r\n            max: 100,\r\n            barClasses: \"\",\r\n            showStripes: !0,\r\n            animateStripes: !0,\r\n            increment: 0\r\n        },\r\n        events: {\r\n            onAnimateProgressFinish: \"\"\r\n        },\r\n        components: [{\r\n            name: \"progressAnimator\",\r\n            kind: \"enyo.Animator\",\r\n            onStep: \"progressAnimatorStep\",\r\n            onEnd: \"progressAnimatorComplete\"\r\n        },\r\n        {\r\n            name: \"bar\",\r\n            classes: \"onyx-progress-bar-bar\"\r\n        }],\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.progressChanged(),\r\n            this.barClassesChanged(),\r\n            this.showStripesChanged(),\r\n            this.animateStripesChanged()\r\n        },\r\n        barClassesChanged: function(t) {\r\n            this.$.bar.removeClass(t),\r\n            this.$.bar.addClass(this.barClasses)\r\n        },\r\n        showStripesChanged: function() {\r\n            this.$.bar.addRemoveClass(\"striped\", this.showStripes)\r\n        },\r\n        animateStripesChanged: function() {\r\n            this.$.bar.addRemoveClass(\"animated\", this.animateStripes)\r\n        },\r\n        progressChanged: function() {\r\n            this.progress = this.clampValue(this.min, this.max, this.progress);\r\n            var t = this.calcPercent(this.progress);\r\n            this.updateBarPosition(t)\r\n        },\r\n        calcIncrement: function(t) {\r\n            return Math.round(t / this.increment) * this.increment\r\n        },\r\n        clampValue: function(t, e, i) {\r\n            return Math.max(t, Math.min(i, e))\r\n        },\r\n        calcRatio: function(t) {\r\n            return (t - this.min) / (this.max - this.min)\r\n        },\r\n        calcPercent: function(t) {\r\n            return 100 * this.calcRatio(t)\r\n        },\r\n        updateBarPosition: function(t) {\r\n            this.$.bar.applyStyle(\"width\", t + \"%\")\r\n        },\r\n        animateProgressTo: function(t) {\r\n            this.$.progressAnimator.play({\r\n                startValue: this.progress,\r\n                endValue: t,\r\n                node: this.hasNode()\r\n            })\r\n        },\r\n        progressAnimatorStep: function(t) {\r\n            return this.setProgress(t.value),\r\n            !0\r\n        },\r\n        progressAnimatorComplete: function(t) {\r\n            return this.doAnimateProgressFinish(t),\r\n            !0\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/ProgressButton.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.ProgressButton\",\r\n        kind: \"onyx.ProgressBar\",\r\n        classes: \"onyx-progress-button\",\r\n        events: {\r\n            onCancel: \"\"\r\n        },\r\n        components: [{\r\n            name: \"progressAnimator\",\r\n            kind: \"enyo.Animator\",\r\n            onStep: \"progressAnimatorStep\",\r\n            onEnd: \"progressAnimatorComplete\"\r\n        },\r\n        {\r\n            name: \"bar\",\r\n            classes: \"onyx-progress-bar-bar onyx-progress-button-bar\"\r\n        },\r\n        {\r\n            name: \"client\",\r\n            classes: \"onyx-progress-button-client\"\r\n        },\r\n        {\r\n            kind: \"onyx.Icon\",\r\n            src: \"$lib/onyx/images/progress-button-cancel.png\",\r\n            classes: \"onyx-progress-button-icon\",\r\n            ontap: \"cancelTap\"\r\n        }],\r\n        cancelTap: function() {\r\n            this.doCancel()\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Slider.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Slider\",\r\n        kind: \"onyx.ProgressBar\",\r\n        classes: \"onyx-slider\",\r\n        published: {\r\n            value: 0,\r\n            lockBar: !0,\r\n            tappable: !0\r\n        },\r\n        events: {\r\n            onChange: \"\",\r\n            onChanging: \"\",\r\n            onAnimateFinish: \"\"\r\n        },\r\n        showStripes: !1,\r\n        handlers: {\r\n            ondragstart: \"dragstart\",\r\n            ondrag: \"drag\",\r\n            ondragfinish: \"dragfinish\"\r\n        },\r\n        moreComponents: [{\r\n            kind: \"Animator\",\r\n            onStep: \"animatorStep\",\r\n            onEnd: \"animatorComplete\"\r\n        },\r\n        {\r\n            classes: \"onyx-slider-taparea\"\r\n        },\r\n        {\r\n            name: \"knob\",\r\n            classes: \"onyx-slider-knob\"\r\n        }],\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.moreComponents[2].ondown = \"knobDown\",\r\n            this.moreComponents[2].onup = \"knobUp\",\r\n            this.createComponents(this.moreComponents),\r\n            this.valueChanged()\r\n        },\r\n        valueChanged: function() {\r\n            this.value = this.clampValue(this.min, this.max, this.value),\r\n            this.$.animator.isAnimating() || this.updateBar(this.value)\r\n        },\r\n        updateBar: function(t) {\r\n            var e = this.calcPercent(t);\r\n            this.updateKnobPosition(e),\r\n            this.lockBar && this.setProgress(t)\r\n        },\r\n        updateKnobPosition: function(t) {\r\n            this.$.knob.applyStyle(\"left\", t + \"%\")\r\n        },\r\n        calcKnobPosition: function(t) {\r\n            var e = t.clientX - this.hasNode().getBoundingClientRect().left;\r\n            return e / this.getBounds().width * (this.max - this.min) + this.min\r\n        },\r\n        dragstart: function(t, e) {\r\n            return e.horizontal ? (e.preventDefault(), this.dragging = !0, t.addClass(\"pressed\"), !0) : void 0\r\n        },\r\n        drag: function(t, e) {\r\n            if (this.dragging) {\r\n                var i = this.calcKnobPosition(e);\r\n                return i = this.increment ? this.calcIncrement(i) : i,\r\n                this.setValue(this.clampValue(this.min, this.max, i)),\r\n                this.doChanging({\r\n                    value: this.value\r\n                }),\r\n                !0\r\n            }\r\n        },\r\n        dragfinish: function(t, e) {\r\n            return this.dragging = !1,\r\n            e.preventTap(),\r\n            this.doChange({\r\n                value: this.value\r\n            }),\r\n            t.removeClass(\"pressed\"),\r\n            !0\r\n        },\r\n        tap: function(t, e) {\r\n            if (this.tappable) {\r\n                var i = this.calcKnobPosition(e);\r\n                return i = this.increment ? this.calcIncrement(i) : i,\r\n                this.tapped = !0,\r\n                this.animateTo(i),\r\n                !0\r\n            }\r\n        },\r\n        knobDown: function() {\r\n            this.$.knob.addClass(\"pressed\")\r\n        },\r\n        knobUp: function() {\r\n            this.$.knob.removeClass(\"pressed\")\r\n        },\r\n        animateTo: function(t) {\r\n            this.$.animator.play({\r\n                startValue: this.value,\r\n                endValue: t,\r\n                node: this.hasNode()\r\n            }),\r\n            this.setValue(t)\r\n        },\r\n        animatorStep: function(t) {\r\n            return this.updateBar(t.value),\r\n            !0\r\n        },\r\n        animatorComplete: function(t) {\r\n            return this.tapped && (this.tapped = !1, this.doChange({\r\n                value: this.value\r\n            })),\r\n            this.doAnimateFinish(t),\r\n            !0\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/RangeSlider.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.RangeSlider\",\r\n        kind: \"onyx.ProgressBar\",\r\n        classes: \"onyx-slider\",\r\n        published: {\r\n            rangeMin: 0,\r\n            rangeMax: 100,\r\n            rangeStart: 0,\r\n            rangeEnd: 100,\r\n            beginValue: 0,\r\n            endValue: 0\r\n        },\r\n        events: {\r\n            onChange: \"\",\r\n            onChanging: \"\"\r\n        },\r\n        showStripes: !1,\r\n        showLabels: !1,\r\n        handlers: {\r\n            ondragstart: \"dragstart\",\r\n            ondrag: \"drag\",\r\n            ondragfinish: \"dragfinish\",\r\n            ondown: \"down\"\r\n        },\r\n        moreComponents: [{\r\n            name: \"startKnob\",\r\n            classes: \"onyx-slider-knob\"\r\n        },\r\n        {\r\n            name: \"endKnob\",\r\n            classes: \"onyx-slider-knob onyx-range-slider-knob\"\r\n        }],\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.createComponents(this.moreComponents),\r\n            this.initControls()\r\n        },\r\n        rendered: function() {\r\n            this.inherited(arguments);\r\n            var t = this.calcPercent(this.beginValue);\r\n            this.updateBarPosition(t)\r\n        },\r\n        initControls: function() {\r\n            this.$.bar.applyStyle(\"position\", \"relative\"),\r\n            this.refreshRangeSlider(),\r\n            this.showLabels && (this.$.startKnob.createComponent({\r\n                name: \"startLabel\",\r\n                kind: \"onyx.RangeSliderKnobLabel\"\r\n            }), this.$.endKnob.createComponent({\r\n                name: \"endLabel\",\r\n                kind: \"onyx.RangeSliderKnobLabel\"\r\n            })),\r\n            this.$.startKnob.ondown = \"knobDown\",\r\n            this.$.startKnob.onup = \"knobUp\",\r\n            this.$.endKnob.ondown = \"knobDown\",\r\n            this.$.endKnob.onup = \"knobUp\"\r\n        },\r\n        refreshRangeSlider: function() {\r\n            this.beginValue = this.calcKnobPercent(this.rangeStart),\r\n            this.endValue = this.calcKnobPercent(this.rangeEnd),\r\n            this.beginValueChanged(),\r\n            this.endValueChanged()\r\n        },\r\n        calcKnobRatio: function(t) {\r\n            return (t - this.rangeMin) / (this.rangeMax - this.rangeMin)\r\n        },\r\n        calcKnobPercent: function(t) {\r\n            return 100 * this.calcKnobRatio(t)\r\n        },\r\n        beginValueChanged: function(t) {\r\n            if (void 0 === t) {\r\n                var e = this.calcPercent(this.beginValue);\r\n                this.updateKnobPosition(e, this.$.startKnob)\r\n            }\r\n        },\r\n        endValueChanged: function(t) {\r\n            if (void 0 === t) {\r\n                var e = this.calcPercent(this.endValue);\r\n                this.updateKnobPosition(e, this.$.endKnob)\r\n            }\r\n        },\r\n        calcKnobPosition: function(t) {\r\n            var e = t.clientX - this.hasNode().getBoundingClientRect().left;\r\n            return e / this.getBounds().width * (this.max - this.min) + this.min\r\n        },\r\n        updateKnobPosition: function(t, e) {\r\n            e.applyStyle(\"left\", t + \"%\"),\r\n            this.updateBarPosition()\r\n        },\r\n        updateBarPosition: function() {\r\n            if (void 0 !== this.$.startKnob && void 0 !== this.$.endKnob) {\r\n                var t = this.calcKnobPercent(this.rangeStart),\r\n                e = this.calcKnobPercent(this.rangeEnd) - t;\r\n                this.$.bar.applyStyle(\"left\", t + \"%\"),\r\n                this.$.bar.applyStyle(\"width\", e + \"%\")\r\n            }\r\n        },\r\n        calcRangeRatio: function(t) {\r\n            return t / 100 * (this.rangeMax - this.rangeMin) + this.rangeMin - this.increment / 2\r\n        },\r\n        swapZIndex: function(t) {\r\n            \"startKnob\" === t ? (this.$.startKnob.applyStyle(\"z-index\", 1), this.$.endKnob.applyStyle(\"z-index\", 0)) : \"endKnob\" === t && (this.$.startKnob.applyStyle(\"z-index\", 0), this.$.endKnob.applyStyle(\"z-index\", 1))\r\n        },\r\n        down: function(t) {\r\n            this.swapZIndex(t.name)\r\n        },\r\n        dragstart: function(t, e) {\r\n            return e.horizontal ? (e.preventDefault(), this.dragging = !0, t.addClass(\"pressed\"), !0) : void 0\r\n        },\r\n        drag: function(t, e) {\r\n            if (this.dragging) {\r\n                var i, n, o, s = this.calcKnobPosition(e);\r\n                if (\"startKnob\" === t.name && s >= 0) {\r\n                    if (! (this.endValue >= s && -1 === e.xDirection || this.endValue >= s)) return this.drag(this.$.endKnob, e);\r\n                    this.setBeginValue(s),\r\n                    i = this.calcRangeRatio(this.beginValue),\r\n                    n = this.increment ? this.calcIncrement(i + .5 * this.increment) : i,\r\n                    o = this.calcKnobPercent(n),\r\n                    this.updateKnobPosition(o, this.$.startKnob),\r\n                    this.setRangeStart(n),\r\n                    this.doChanging({\r\n                        value: n\r\n                    })\r\n                } else if (\"endKnob\" === t.name && 100 >= s) {\r\n                    if (! (s >= this.beginValue && 1 === e.xDirection || s >= this.beginValue)) return this.drag(this.$.startKnob, e);\r\n                    this.setEndValue(s),\r\n                    i = this.calcRangeRatio(this.endValue),\r\n                    n = this.increment ? this.calcIncrement(i + .5 * this.increment) : i,\r\n                    o = this.calcKnobPercent(n),\r\n                    this.updateKnobPosition(o, this.$.endKnob),\r\n                    this.setRangeEnd(n),\r\n                    this.doChanging({\r\n                        value: n\r\n                    })\r\n                }\r\n                return ! 0\r\n            }\r\n        },\r\n        dragfinish: function(t, e) {\r\n            this.dragging = !1,\r\n            e.preventTap();\r\n            var i;\r\n            return \"startKnob\" === t.name ? (i = this.calcRangeRatio(this.beginValue), this.doChange({\r\n                value: i,\r\n                startChanged: !0\r\n            })) : \"endKnob\" === t.name && (i = this.calcRangeRatio(this.endValue), this.doChange({\r\n                value: i,\r\n                startChanged: !1\r\n            })),\r\n            t.removeClass(\"pressed\"),\r\n            !0\r\n        },\r\n        knobDown: function(t) {\r\n            t.addClass(\"pressed\")\r\n        },\r\n        knobUp: function(t) {\r\n            t.removeClass(\"pressed\")\r\n        },\r\n        rangeMinChanged: function() {\r\n            this.refreshRangeSlider()\r\n        },\r\n        rangeMaxChanged: function() {\r\n            this.refreshRangeSlider()\r\n        },\r\n        rangeStartChanged: function() {\r\n            this.refreshRangeSlider()\r\n        },\r\n        rangeEndChanged: function() {\r\n            this.refreshRangeSlider()\r\n        },\r\n        setStartLabel: function(t) {\r\n            this.$.startKnob.waterfallDown(\"onSetLabel\", t)\r\n        },\r\n        setEndLabel: function(t) {\r\n            this.$.endKnob.waterfallDown(\"onSetLabel\", t)\r\n        }\r\n    }),\r\n    t.kind({\r\n        name: \"onyx.RangeSliderKnobLabel\",\r\n        classes: \"onyx-range-slider-label\",\r\n        handlers: {\r\n            onSetLabel: \"setLabel\"\r\n        },\r\n        setLabel: function(t, e) {\r\n            this.setContent(e)\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Item.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Item\",\r\n        classes: \"onyx-item\",\r\n        published: {\r\n            tapHighlight: !0\r\n        },\r\n        handlers: {\r\n            onhold: \"hold\",\r\n            onrelease: \"release\"\r\n        },\r\n        hold: function(t, e) {\r\n            this.tapHighlight && onyx.Item.addRemoveFlyweightClass(this.controlParent || this, \"onyx-highlight\", !0, e)\r\n        },\r\n        release: function(t, e) {\r\n            this.tapHighlight && onyx.Item.addRemoveFlyweightClass(this.controlParent || this, \"onyx-highlight\", !1, e)\r\n        },\r\n        statics: {\r\n            addRemoveFlyweightClass: function(t, e, i, n, o) {\r\n                var s = n.flyweight;\r\n                s && (o = void 0 !== o ? o: n.index, s.performOnRow(o,\r\n                function() {\r\n                    t.addRemoveClass(e, i)\r\n                }))\r\n            }\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/Spinner.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.Spinner\",\r\n        classes: \"onyx-spinner\",\r\n        stop: function() {\r\n            this.setShowing(!1)\r\n        },\r\n        start: function() {\r\n            this.setShowing(!0)\r\n        },\r\n        toggle: function() {\r\n            this.setShowing(!this.getShowing())\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/MoreToolbar.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.MoreToolbar\",\r\n        classes: \"onyx-toolbar onyx-more-toolbar\",\r\n        menuClass: \"\",\r\n        movedClass: \"\",\r\n        layoutKind: \"FittableColumnsLayout\",\r\n        noStretch: !0,\r\n        handlers: {\r\n            onHide: \"reflow\"\r\n        },\r\n        published: {\r\n            clientLayoutKind: \"FittableColumnsLayout\"\r\n        },\r\n        tools: [{\r\n            name: \"client\",\r\n            noStretch: !0,\r\n            fit: !0,\r\n            classes: \"onyx-toolbar-inline\"\r\n        },\r\n        {\r\n            name: \"nard\",\r\n            kind: \"onyx.MenuDecorator\",\r\n            showing: !1,\r\n            onActivate: \"activated\",\r\n            components: [{\r\n                kind: \"onyx.IconButton\",\r\n                classes: \"onyx-more-button\"\r\n            },\r\n            {\r\n                name: \"menu\",\r\n                kind: \"onyx.Menu\",\r\n                scrolling: !1,\r\n                classes: \"onyx-more-menu\"\r\n            }]\r\n        }],\r\n        initComponents: function() {\r\n            this.menuClass && this.menuClass.length > 0 && !this.$.menu.hasClass(this.menuClass) && this.$.menu.addClass(this.menuClass),\r\n            this.createChrome(this.tools),\r\n            this.inherited(arguments),\r\n            this.$.client.setLayoutKind(this.clientLayoutKind)\r\n        },\r\n        clientLayoutKindChanged: function() {\r\n            this.$.client.setLayoutKind(this.clientLayoutKind)\r\n        },\r\n        reflow: function() {\r\n            this.inherited(arguments),\r\n            this.isContentOverflowing() ? (this.$.nard.show(), this.popItem() && this.reflow()) : this.tryPushItem() ? this.reflow() : this.$.menu.children.length || (this.$.nard.hide(), this.$.menu.hide())\r\n        },\r\n        activated: function(t, e) {\r\n            this.addRemoveClass(\"active\", e.originator.active)\r\n        },\r\n        popItem: function() {\r\n            var t = this.findCollapsibleItem();\r\n            if (t) {\r\n                this.movedClass && this.movedClass.length > 0 && !t.hasClass(this.movedClass) && t.addClass(this.movedClass),\r\n                this.$.menu.addChild(t, null);\r\n                var e = this.$.menu.hasNode();\r\n                return e && t.hasNode() && t.insertNodeInParent(e),\r\n                !0\r\n            }\r\n        },\r\n        pushItem: function() {\r\n            var t = this.$.menu.children,\r\n            e = t[0];\r\n            if (e) {\r\n                this.movedClass && this.movedClass.length > 0 && e.hasClass(this.movedClass) && e.removeClass(this.movedClass),\r\n                this.$.client.addChild(e);\r\n                var i = this.$.client.hasNode();\r\n                if (i && e.hasNode()) {\r\n                    for (var n, o, s = 0; this.$.client.children.length > s; s++) {\r\n                        var a = this.$.client.children[s];\r\n                        if (void 0 !== a.toolbarIndex && a.toolbarIndex != s) {\r\n                            n = a,\r\n                            o = s;\r\n                            break\r\n                        }\r\n                    }\r\n                    if (n && n.hasNode()) {\r\n                        e.insertNodeInParent(i, n.node);\r\n                        var r = this.$.client.children.pop();\r\n                        this.$.client.children.splice(o, 0, r)\r\n                    } else e.appendNodeToParent(i)\r\n                }\r\n                return ! 0\r\n            }\r\n        },\r\n        tryPushItem: function() {\r\n            if (this.pushItem()) {\r\n                if (!this.isContentOverflowing()) return ! 0;\r\n                this.popItem()\r\n            }\r\n        },\r\n        isContentOverflowing: function() {\r\n            if (this.$.client.hasNode()) {\r\n                var t = this.$.client.children,\r\n                e = t.length && t[t.length - 1].hasNode();\r\n                if (e) return this.$.client.reflow(),\r\n                e.offsetLeft + e.offsetWidth > this.$.client.node.clientWidth\r\n            }\r\n        },\r\n        findCollapsibleItem: function() {\r\n            for (var t, e = this.$.client.children,\r\n            i = e.length - 1; t = e[i]; i--) {\r\n                if (!t.unmoveable) return t;\r\n                void 0 === t.toolbarIndex && (t.toolbarIndex = i)\r\n            }\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/IntegerPicker.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.IntegerPicker\",\r\n        kind: \"onyx.Picker\",\r\n        published: {\r\n            value: 0,\r\n            min: 0,\r\n            max: 9\r\n        },\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.rangeChanged()\r\n        },\r\n        minChanged: function() {\r\n            this.destroyClientControls(),\r\n            this.rangeChanged(),\r\n            this.render()\r\n        },\r\n        maxChanged: function() {\r\n            this.destroyClientControls(),\r\n            this.rangeChanged(),\r\n            this.render()\r\n        },\r\n        rangeChanged: function() {\r\n            for (var t = this.min; this.max >= t; t++) this.createComponent({\r\n                content: t,\r\n                active: t === this.value ? !0 : !1\r\n            })\r\n        },\r\n        valueChanged: function() {\r\n            var t = this.getClientControls(),\r\n            e = t.length;\r\n            this.value = Math.min(this.max, Math.max(this.value, this.min));\r\n            for (var i = 0; e > i; i++) if (this.value === parseInt(t[i].content, 10)) {\r\n                this.setSelected(t[i]);\r\n                break\r\n            }\r\n        },\r\n        selectedChanged: function(t) {\r\n            t && t.removeClass(\"selected\"),\r\n            this.selected && (this.selected.addClass(\"selected\"), this.doChange({\r\n                selected: this.selected,\r\n                content: this.selected.content\r\n            })),\r\n            this.setValue(parseInt(this.selected.content, 10))\r\n        }\r\n    })\r\n})(enyo, this);\r\n\r\n// ../lib/onyx/source/ContextualPopup.js\r\n(function(t) {\r\n    t.kind({\r\n        name: \"onyx.ContextualPopup\",\r\n        kind: \"enyo.Popup\",\r\n        modal: !0,\r\n        autoDismiss: !0,\r\n        floating: !1,\r\n        classes: \"onyx-contextual-popup enyo-unselectable\",\r\n        published: {\r\n            maxHeight: 100,\r\n            scrolling: !0,\r\n            title: void 0,\r\n            actionButtons: []\r\n        },\r\n        statics: {\r\n            subclass: function(t, e) {\r\n                var i = t.prototype;\r\n                e.actionButtons && (i.kindActionButtons = e.actionButtons, delete i.actionButtons)\r\n            }\r\n        },\r\n        vertFlushMargin: 60,\r\n        horizFlushMargin: 50,\r\n        widePopup: 200,\r\n        longPopup: 200,\r\n        horizBuffer: 16,\r\n        events: {\r\n            onTap: \"\"\r\n        },\r\n        handlers: {\r\n            onActivate: \"childControlActivated\",\r\n            onRequestShowMenu: \"requestShow\",\r\n            onRequestHideMenu: \"requestHide\"\r\n        },\r\n        components: [{\r\n            name: \"title\",\r\n            classes: \"onyx-contextual-popup-title\"\r\n        },\r\n        {\r\n            classes: \"onyx-contextual-popup-scroller\",\r\n            components: [{\r\n                name: \"client\",\r\n                kind: \"enyo.Scroller\",\r\n                vertical: \"auto\",\r\n                classes: \"enyo-unselectable\",\r\n                thumb: !1,\r\n                strategyKind: \"TouchScrollStrategy\"\r\n            }]\r\n        },\r\n        {\r\n            name: \"actionButtons\",\r\n            classes: \"onyx-contextual-popup-action-buttons\"\r\n        }],\r\n        scrollerName: \"client\",\r\n        create: function() {\r\n            this.inherited(arguments),\r\n            this.maxHeightChanged(),\r\n            this.titleChanged(),\r\n            this.actionButtonsChanged()\r\n        },\r\n        getScroller: function() {\r\n            return this.$[this.scrollerName]\r\n        },\r\n        titleChanged: function() {\r\n            this.$.title.setContent(this.title)\r\n        },\r\n        actionButtonsChanged: function() {\r\n            this.actionButtons ? t.forEach(this.actionButtons,\r\n            function(t) {\r\n                t.kind = \"onyx.Button\",\r\n                t.classes = t.classes + \" onyx-contextual-popup-action-button\",\r\n                t.popup = this,\r\n                t.actionButton = !0,\r\n                this.$.actionButtons.createComponent(t, {\r\n                    owner: this.getInstanceOwner()\r\n                })\r\n            },\r\n            this) : this.kindActionButtons && t.forEach(this.kindActionButtons,\r\n            function(t) {\r\n                t.kind = \"onyx.Button\",\r\n                t.classes = t.classes + \" onyx-contextual-popup-action-button\",\r\n                t.popup = this,\r\n                t.actionButton = !0,\r\n                this.$.actionButtons.createComponent(t, {\r\n                    owner: this\r\n                })\r\n            },\r\n            this),\r\n            this.hasNode() && this.$.actionButtons.render()\r\n        },\r\n        maxHeightChanged: function() {\r\n            this.scrolling && this.getScroller().setMaxHeight(this.maxHeight + \"px\")\r\n        },\r\n        showingChanged: t.inherit(function(t) {\r\n            return function() {\r\n                t.apply(this, arguments),\r\n                this.scrolling && this.getScroller().setShowing(this.showing),\r\n                this.showing || (this.activator = this.activatorOffset = null),\r\n                this.adjustPosition()\r\n            }\r\n        }),\r\n        childControlActivated: function() {\r\n            return ! 0\r\n        },\r\n        requestShow: function(t, e) {\r\n            return this.activator = e.activator.hasNode(),\r\n            this.show(),\r\n            !0\r\n        },\r\n        requestHide: function() {\r\n            this.setShowing(!1)\r\n        },\r\n        applyPosition: function(t) {\r\n            var e = \"\";\r\n            for (var i in t) e += i + \":\" + t[i] + (isNaN(t[i]) ? \"; \": \"px; \");\r\n            this.addStyles(e)\r\n        },\r\n        getPageOffset: function(t) {\r\n            var e = this.getBoundingRect(t),\r\n            i = void 0 === window.pageYOffset ? document.documentElement.scrollTop: window.pageYOffset,\r\n            n = void 0 === window.pageXOffset ? document.documentElement.scrollLeft: window.pageXOffset,\r\n            o = void 0 === e.height ? e.bottom - e.top: e.height,\r\n            s = void 0 === e.width ? e.right - e.left: e.width;\r\n            return {\r\n                top: e.top + i,\r\n                left: e.left + n,\r\n                height: o,\r\n                width: s\r\n            }\r\n        },\r\n        adjustPosition: function() {\r\n            if (this.showing && this.hasNode() && this.activator) {\r\n                this.resetPositioning(),\r\n                this.activatorOffset = this.getPageOffset(this.activator);\r\n                var t = this.getViewWidth(),\r\n                e = this.getViewHeight(),\r\n                i = this.vertFlushMargin,\r\n                n = e - this.vertFlushMargin,\r\n                o = this.horizFlushMargin,\r\n                s = t - this.horizFlushMargin;\r\n                if (i > this.activatorOffset.top + this.activatorOffset.height || this.activatorOffset.top > n) {\r\n                    if (this.applyVerticalFlushPositioning(o, s)) return;\r\n                    if (this.applyHorizontalFlushPositioning(o, s)) return;\r\n                    if (this.applyVerticalPositioning()) return\r\n                } else if ((o > this.activatorOffset.left + this.activatorOffset.width || this.activatorOffset.left > s) && this.applyHorizontalPositioning()) return;\r\n                var a = this.getBoundingRect(this.node);\r\n                if (a.width > this.widePopup) {\r\n                    if (this.applyVerticalPositioning()) return\r\n                } else if (a.height > this.longPopup && this.applyHorizontalPositioning()) return;\r\n                if (this.applyVerticalPositioning()) return;\r\n                if (this.applyHorizontalPositioning()) return\r\n            }\r\n        },\r\n        initVerticalPositioning: function() {\r\n            this.resetPositioning(),\r\n            this.addClass(\"vertical\");\r\n            var t = this.getBoundingRect(this.node),\r\n            e = this.getViewHeight();\r\n            return this.floating ? e / 2 > this.activatorOffset.top ? (this.applyPosition({\r\n                top: this.activatorOffset.top + this.activatorOffset.height,\r\n                bottom: \"auto\"\r\n            }), this.addClass(\"below\")) : (this.applyPosition({\r\n                top: this.activatorOffset.top - t.height,\r\n                bottom: \"auto\"\r\n            }), this.addClass(\"above\")) : t.top + t.height > e && e - t.bottom < t.top - t.height ? this.addClass(\"above\") : this.addClass(\"below\"),\r\n            t = this.getBoundingRect(this.node),\r\n            t.top + t.height > e || 0 > t.top ? !1 : !0\r\n        },\r\n        applyVerticalPositioning: function() {\r\n            if (!this.initVerticalPositioning()) return ! 1;\r\n            var t = this.getBoundingRect(this.node),\r\n            e = this.getViewWidth();\r\n            if (this.floating) {\r\n                var i = this.activatorOffset.left + this.activatorOffset.width / 2 - t.width / 2;\r\n                i + t.width > e ? (this.applyPosition({\r\n                    left: this.activatorOffset.left + this.activatorOffset.width - t.width\r\n                }), this.addClass(\"left\")) : 0 > i ? (this.applyPosition({\r\n                    left: this.activatorOffset.left\r\n                }), this.addClass(\"right\")) : this.applyPosition({\r\n                    left: i\r\n                })\r\n            } else {\r\n                var n = this.activatorOffset.left + this.activatorOffset.width / 2 - t.left - t.width / 2;\r\n                t.right + n > e ? (this.applyPosition({\r\n                    left: this.activatorOffset.left + this.activatorOffset.width - t.right\r\n                }), this.addRemoveClass(\"left\", !0)) : 0 > t.left + n ? this.addRemoveClass(\"right\", !0) : this.applyPosition({\r\n                    left: n\r\n                })\r\n            }\r\n            return ! 0\r\n        },\r\n        applyVerticalFlushPositioning: function(t, e) {\r\n            if (!this.initVerticalPositioning()) return ! 1;\r\n            var i = this.getBoundingRect(this.node),\r\n            n = this.getViewWidth();\r\n            return t > this.activatorOffset.left + this.activatorOffset.width / 2 ? (this.activatorOffset.left + this.activatorOffset.width / 2 < this.horizBuffer ? this.applyPosition({\r\n                left: this.horizBuffer + (this.floating ? 0 : -i.left)\r\n            }) : this.applyPosition({\r\n                left: this.activatorOffset.width / 2 + (this.floating ? this.activatorOffset.left: 0)\r\n            }), this.addClass(\"right\"), this.addClass(\"corner\"), !0) : this.activatorOffset.left + this.activatorOffset.width / 2 > e ? (this.activatorOffset.left + this.activatorOffset.width / 2 > n - this.horizBuffer ? this.applyPosition({\r\n                left: n - this.horizBuffer - i.right\r\n            }) : this.applyPosition({\r\n                left: this.activatorOffset.left + this.activatorOffset.width / 2 - i.right\r\n            }), this.addClass(\"left\"), this.addClass(\"corner\"), !0) : !1\r\n        },\r\n        initHorizontalPositioning: function() {\r\n            this.resetPositioning();\r\n            var t = this.getBoundingRect(this.node),\r\n            e = this.getViewWidth();\r\n            return this.floating ? e / 2 > this.activatorOffset.left + this.activatorOffset.width ? (this.applyPosition({\r\n                left: this.activatorOffset.left + this.activatorOffset.width\r\n            }), this.addRemoveClass(\"left\", !0)) : (this.applyPosition({\r\n                left: this.activatorOffset.left - t.width\r\n            }), this.addRemoveClass(\"right\", !0)) : this.activatorOffset.left - t.width > 0 ? (this.applyPosition({\r\n                left: this.activatorOffset.left - t.left - t.width\r\n            }), this.addRemoveClass(\"right\", !0)) : (this.applyPosition({\r\n                left: this.activatorOffset.width\r\n            }), this.addRemoveClass(\"left\", !0)),\r\n            this.addRemoveClass(\"horizontal\", !0),\r\n            t = this.getBoundingRect(this.node),\r\n            0 > t.left || t.left + t.width > e ? !1 : !0\r\n        },\r\n        applyHorizontalPositioning: function() {\r\n            if (!this.initHorizontalPositioning()) return ! 1;\r\n            var t = this.getBoundingRect(this.node),\r\n            e = this.getViewHeight(),\r\n            i = this.activatorOffset.top + this.activatorOffset.height / 2;\r\n            return this.floating ? i >= e / 2 - .05 * e && e / 2 + .05 * e >= i ? this.applyPosition({\r\n                top: this.activatorOffset.top + this.activatorOffset.height / 2 - t.height / 2,\r\n                bottom: \"auto\"\r\n            }) : e / 2 > this.activatorOffset.top + this.activatorOffset.height ? (this.applyPosition({\r\n                top: this.activatorOffset.top - this.activatorOffset.height,\r\n                bottom: \"auto\"\r\n            }), this.addRemoveClass(\"high\", !0)) : (this.applyPosition({\r\n                top: this.activatorOffset.top - t.height + 2 * this.activatorOffset.height,\r\n                bottom: \"auto\"\r\n            }), this.addRemoveClass(\"low\", !0)) : i >= e / 2 - .05 * e && e / 2 + .05 * e >= i ? this.applyPosition({\r\n                top: (this.activatorOffset.height - t.height) / 2\r\n            }) : e / 2 > this.activatorOffset.top + this.activatorOffset.height ? (this.applyPosition({\r\n                top: -this.activatorOffset.height\r\n            }), this.addRemoveClass(\"high\", !0)) : (this.applyPosition({\r\n                top: t.top - t.height - this.activatorOffset.top + this.activatorOffset.height\r\n            }), this.addRemoveClass(\"low\", !0)),\r\n            !0\r\n        },\r\n        applyHorizontalFlushPositioning: function(t, e) {\r\n            if (!this.initHorizontalPositioning()) return ! 1;\r\n            var i = this.getBoundingRect(this.node),\r\n            n = this.getViewHeight();\r\n            return this.floating ? n / 2 > this.activatorOffset.top ? (this.applyPosition({\r\n                top: this.activatorOffset.top + this.activatorOffset.height / 2\r\n            }), this.addRemoveClass(\"high\", !0)) : (this.applyPosition({\r\n                top: this.activatorOffset.top + this.activatorOffset.height / 2 - i.height\r\n            }), this.addRemoveClass(\"low\", !0)) : i.top + i.height > n && n - i.bottom < i.top - i.height ? (this.applyPosition({\r\n                top: i.top - i.height - this.activatorOffset.top - this.activatorOffset.height / 2\r\n            }), this.addRemoveClass(\"low\", !0)) : (this.applyPosition({\r\n                top: this.activatorOffset.height / 2\r\n            }), this.addRemoveClass(\"high\", !0)),\r\n            t > this.activatorOffset.left + this.activatorOffset.width ? (this.addClass(\"left\"), this.addClass(\"corner\"), !0) : this.activatorOffset.left > e ? (this.addClass(\"right\"), this.addClass(\"corner\"), !0) : !1\r\n        },\r\n        getBoundingRect: function(t) {\r\n            var e = t.getBoundingClientRect();\r\n            return e.width && e.height ? e: {\r\n                left: e.left,\r\n                right: e.right,\r\n                top: e.top,\r\n                bottom: e.bottom,\r\n                width: e.right - e.left,\r\n                height: e.bottom - e.top\r\n            }\r\n        },\r\n        getViewHeight: function() {\r\n            return void 0 === window.innerHeight ? document.documentElement.clientHeight: window.innerHeight\r\n        },\r\n        getViewWidth: function() {\r\n            return void 0 === window.innerWidth ? document.documentElement.clientWidth: window.innerWidth\r\n        },\r\n        resetPositioning: function() {\r\n            this.removeClass(\"right\"),\r\n            this.removeClass(\"left\"),\r\n            this.removeClass(\"high\"),\r\n            this.removeClass(\"low\"),\r\n            this.removeClass(\"corner\"),\r\n            this.removeClass(\"below\"),\r\n            this.removeClass(\"above\"),\r\n            this.removeClass(\"vertical\"),\r\n            this.removeClass(\"horizontal\"),\r\n            this.applyPosition({\r\n                left: \"auto\"\r\n            }),\r\n            this.applyPosition({\r\n                top: \"auto\"\r\n            })\r\n        },\r\n        handleResize: function() {\r\n            this.inherited(arguments),\r\n            this.adjustPosition()\r\n        }\r\n    })\r\n})(enyo, this);"
  },
  {
    "path": "rtc/whiteboard/src/js/raphael-min.js",
    "content": "// ┌────────────────────────────────────────────────────────────────────┐ \\\\\n// │ Raphaël 2.1.4 - JavaScript Vector Library                          │ \\\\\n// ├────────────────────────────────────────────────────────────────────┤ \\\\\n// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com)    │ \\\\\n// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com)              │ \\\\\n// ├────────────────────────────────────────────────────────────────────┤ \\\\\n// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\\\\n// └────────────────────────────────────────────────────────────────────┘ \\\\\n!function(a){var b,c,d=\"0.4.2\",e=\"hasOwnProperty\",f=/[\\.\\/]/,g=\"*\",h=function(){},i=function(a,b){return a-b},j={n:{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)\"zIndex\"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],\"zIndex\"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),\"function\"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={n:{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp(\"(?:\\\\.|\\\\/|^)\"+a+\"(?:\\\\.|\\\\/|$)\").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return void(k._events=j={n:{}});var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;m<p.length;m+=h.length-2){if(h=[m,1],c=p[m].n,o[i]!=g)c[o[i]]&&h.push(c[o[i]]);else for(d in c)c[e](d)&&h.push(c[d]);p.splice.apply(p,h)}for(i=0,l=p.length;l>i;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return\"You are running Eve \"+d},\"undefined\"!=typeof module&&module.exports?module.exports=k:\"undefined\"!=typeof define?define(\"eve\",[],function(){return k}):a.eve=k}(window||this),function(a,b){\"function\"==typeof define&&define.amd?define([\"eve\"],function(c){return b(a,c)}):b(a,a.eve||\"function\"==typeof require&&require(\"eve\"))}(this,function(a,b){function c(a){if(c.is(a,\"function\"))return u?a():b.on(\"raphael.DOMload\",a);if(c.is(a,V))return c._engine.create[D](c,a.splice(0,3+c.is(a[0],T))).add(a);var d=Array.prototype.slice.call(arguments,0);if(c.is(d[d.length-1],\"function\")){var e=d.pop();return u?e.call(c._engine.create[D](c,d)):b.on(\"raphael.DOMload\",function(){e.call(c._engine.create[D](c,d))})}return c._engine.create[D](c,arguments)}function d(a){if(\"function\"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=d(a[c]));return b}function e(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function f(a,b,c){function d(){var f=Array.prototype.slice.call(arguments,0),g=f.join(\"␀\"),h=d.cache=d.cache||{},i=d.count=d.count||[];return h[z](g)?(e(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a[D](b,f),c?c(h[g]):h[g])}return d}function g(){return this.hex}function h(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push([\"C\",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function i(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function j(a,b,c,d,e,f,g,h,j){null==j&&(j=1),j=j>1?1:0>j?0:j;for(var k=j/2,l=12,m=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;l>p;p++){var q=k*m[p]+k,r=i(q,a,c,e,g),s=i(q,b,d,f,h),t=r*r+s*s;o+=n[p]*N.sqrt(t)}return k*o}function k(a,b,c,d,e,f,g,h,i){if(!(0>i||j(a,b,c,d,e,f,g,h)<i)){var k,l=1,m=l/2,n=l-m,o=.01;for(k=j(a,b,c,d,e,f,g,h,n);Q(k-i)>o;)m/=2,n+=(i>k?1:-1)*m,k=j(a,b,c,d,e,f,g,h,n);return n}}function l(a,b,c,d,e,f,g,h){if(!(O(a,c)<P(e,g)||P(a,c)>O(e,g)||O(b,d)<P(f,h)||P(b,d)>O(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+P(a,c).toFixed(2)||n>+O(a,c).toFixed(2)||n<+P(e,g).toFixed(2)||n>+O(e,g).toFixed(2)||o<+P(b,d).toFixed(2)||o>+O(b,d).toFixed(2)||o<+P(f,h).toFixed(2)||o>+O(f,h).toFixed(2)))return{x:l,y:m}}}}function m(a,b,d){var e=c.bezierBBox(a),f=c.bezierBBox(b);if(!c.isBBoxIntersect(e,f))return d?0:[];for(var g=j.apply(0,a),h=j.apply(0,b),i=O(~~(g/5),1),k=O(~~(h/5),1),m=[],n=[],o={},p=d?0:[],q=0;i+1>q;q++){var r=c.findDotsAtSegment.apply(c,a.concat(q/i));m.push({x:r.x,y:r.y,t:q/i})}for(q=0;k+1>q;q++)r=c.findDotsAtSegment.apply(c,b.concat(q/k)),n.push({x:r.x,y:r.y,t:q/k});for(q=0;i>q;q++)for(var s=0;k>s;s++){var t=m[q],u=m[q+1],v=n[s],w=n[s+1],x=Q(u.x-t.x)<.001?\"y\":\"x\",y=Q(w.x-v.x)<.001?\"y\":\"x\",z=l(t.x,t.y,u.x,u.y,v.x,v.y,w.x,w.y);if(z){if(o[z.x.toFixed(4)]==z.y.toFixed(4))continue;o[z.x.toFixed(4)]=z.y.toFixed(4);var A=t.t+Q((z[x]-t[x])/(u[x]-t[x]))*(u.t-t.t),B=v.t+Q((z[y]-v[y])/(w[y]-v[y]))*(w.t-v.t);A>=0&&1.001>=A&&B>=0&&1.001>=B&&(d?p++:p.push({x:z.x,y:z.y,t1:P(A,1),t2:P(B,1)}))}}return p}function n(a,b,d){a=c._path2curve(a),b=c._path2curve(b);for(var e,f,g,h,i,j,k,l,n,o,p=d?0:[],q=0,r=a.length;r>q;q++){var s=a[q];if(\"M\"==s[0])e=i=s[1],f=j=s[2];else{\"C\"==s[0]?(n=[e,f].concat(s.slice(1)),e=n[6],f=n[7]):(n=[e,f,e,f,i,j,i,j],e=i,f=j);for(var t=0,u=b.length;u>t;t++){var v=b[t];if(\"M\"==v[0])g=k=v[1],h=l=v[2];else{\"C\"==v[0]?(o=[g,h].concat(v.slice(1)),g=o[6],h=o[7]):(o=[g,h,g,h,k,l,k,l],g=k,h=l);var w=m(n,o,d);if(d)p+=w;else{for(var x=0,y=w.length;y>x;x++)w[x].segment1=q,w[x].segment2=t,w[x].bez1=n,w[x].bez2=o;p=p.concat(w)}}}}}return p}function o(a,b,c,d,e,f){null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function p(){return this.x+H+this.y+H+this.width+\" × \"+this.height}function q(a,b,c,d,e,f){function g(a){return((l*a+k)*a+j)*a}function h(a,b){var c=i(a,b);return((o*c+n)*c+m)*c}function i(a,b){var c,d,e,f,h,i;for(e=a,i=0;8>i;i++){if(f=g(e)-a,Q(f)<b)return e;if(h=(3*l*e+2*k)*e+j,Q(h)<1e-6)break;e-=f/h}if(c=0,d=1,e=a,c>e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),Q(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}var j=3*b,k=3*(d-b)-j,l=1-j-k,m=3*c,n=3*(e-c)-m,o=1-m-n;return h(a,1/(200*f))}function r(a,b){var c=[],d={};if(this.ms=b,this.times=1,a){for(var e in a)a[z](e)&&(d[_(e)]=a[e],c.push(_(e)));c.sort(lb)}this.anim=d,this.top=c[c.length-1],this.percents=c}function s(a,d,e,f,g,h){e=_(e);var i,j,k,l,m,n,p=a.ms,r={},s={},t={};if(f)for(v=0,x=ic.length;x>v;v++){var u=ic[v];if(u.el.id==d.id&&u.anim==a){u.percent!=e?(ic.splice(v,1),k=1):j=u,d.attr(u.totalOrigin);break}}else f=+s;for(var v=0,x=a.percents.length;x>v;v++){if(a.percents[v]==e||a.percents[v]>f*a.top){e=a.percents[v],m=a.percents[v-1]||0,p=p/a.top*(e-m),l=a.percents[v+1],i=a.anim[e];break}f&&d.attr(a.anim[a.percents[v]])}if(i){if(j)j.initstatus=f,j.start=new Date-j.ms*f;else{for(var y in i)if(i[z](y)&&(db[z](y)||d.paper.customAttributes[z](y)))switch(r[y]=d.attr(y),null==r[y]&&(r[y]=cb[y]),s[y]=i[y],db[y]){case T:t[y]=(s[y]-r[y])/p;break;case\"colour\":r[y]=c.getRGB(r[y]);var A=c.getRGB(s[y]);t[y]={r:(A.r-r[y].r)/p,g:(A.g-r[y].g)/p,b:(A.b-r[y].b)/p};break;case\"path\":var B=Kb(r[y],s[y]),C=B[1];for(r[y]=B[0],t[y]=[],v=0,x=r[y].length;x>v;v++){t[y][v]=[0];for(var D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(C[v][D]-r[y][v][D])/p}break;case\"transform\":var G=d._,H=Pb(G[y],s[y]);if(H)for(r[y]=H.from,s[y]=H.to,t[y]=[],t[y].real=!0,v=0,x=r[y].length;x>v;v++)for(t[y][v]=[r[y][v][0]],D=1,F=r[y][v].length;F>D;D++)t[y][v][D]=(s[y][v][D]-r[y][v][D])/p;else{var K=d.matrix||new o,L={_:{transform:G.transform},getBBox:function(){return d.getBBox(1)}};r[y]=[K.a,K.b,K.c,K.d,K.e,K.f],Nb(L,s[y]),s[y]=L._.transform,t[y]=[(L.matrix.a-K.a)/p,(L.matrix.b-K.b)/p,(L.matrix.c-K.c)/p,(L.matrix.d-K.d)/p,(L.matrix.e-K.e)/p,(L.matrix.f-K.f)/p]}break;case\"csv\":var M=I(i[y])[J](w),N=I(r[y])[J](w);if(\"clip-rect\"==y)for(r[y]=N,t[y]=[],v=N.length;v--;)t[y][v]=(M[v]-r[y][v])/p;s[y]=M;break;default:for(M=[][E](i[y]),N=[][E](r[y]),t[y]=[],v=d.paper.customAttributes[y].length;v--;)t[y][v]=((M[v]||0)-(N[v]||0))/p}var O=i.easing,P=c.easing_formulas[O];if(!P)if(P=I(O).match(Z),P&&5==P.length){var Q=P;P=function(a){return q(a,+Q[1],+Q[2],+Q[3],+Q[4],p)}}else P=nb;if(n=i.start||a.start||+new Date,u={anim:a,percent:e,timestamp:n,start:n+(a.del||0),status:0,initstatus:f||0,stop:!1,ms:p,easing:P,from:r,diff:t,to:s,el:d,callback:i.callback,prev:m,next:l,repeat:h||a.times,origin:d.attr(),totalOrigin:g},ic.push(u),f&&!j&&!k&&(u.stop=!0,u.start=new Date-p*f,1==ic.length))return kc();k&&(u.start=new Date-u.ms*f),1==ic.length&&jc(kc)}b(\"raphael.anim.start.\"+d.id,d,a)}}function t(a){for(var b=0;b<ic.length;b++)ic[b].el.paper==a&&ic.splice(b--,1)}c.version=\"2.1.2\",c.eve=b;var u,v,w=/[, ]+/,x={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},y=/\\{(\\d+)\\}/g,z=\"hasOwnProperty\",A={doc:document,win:a},B={was:Object.prototype[z].call(A.win,\"Raphael\"),is:A.win.Raphael},C=function(){this.ca=this.customAttributes={}},D=\"apply\",E=\"concat\",F=\"ontouchstart\"in A.win||A.win.DocumentTouch&&A.doc instanceof DocumentTouch,G=\"\",H=\" \",I=String,J=\"split\",K=\"click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel\"[J](H),L={mousedown:\"touchstart\",mousemove:\"touchmove\",mouseup:\"touchend\"},M=I.prototype.toLowerCase,N=Math,O=N.max,P=N.min,Q=N.abs,R=N.pow,S=N.PI,T=\"number\",U=\"string\",V=\"array\",W=Object.prototype.toString,X=(c._ISURL=/^url\\(['\"]?(.+?)['\"]?\\)$/i,/^\\s*((#[a-f\\d]{6})|(#[a-f\\d]{3})|rgba?\\(\\s*([\\d\\.]+%?\\s*,\\s*[\\d\\.]+%?\\s*,\\s*[\\d\\.]+%?(?:\\s*,\\s*[\\d\\.]+%?)?)\\s*\\)|hsba?\\(\\s*([\\d\\.]+(?:deg|\\xb0|%)?\\s*,\\s*[\\d\\.]+%?\\s*,\\s*[\\d\\.]+(?:%?\\s*,\\s*[\\d\\.]+)?)%?\\s*\\)|hsla?\\(\\s*([\\d\\.]+(?:deg|\\xb0|%)?\\s*,\\s*[\\d\\.]+%?\\s*,\\s*[\\d\\.]+(?:%?\\s*,\\s*[\\d\\.]+)?)%?\\s*\\))\\s*$/i),Y={NaN:1,Infinity:1,\"-Infinity\":1},Z=/^(?:cubic-)?bezier\\(([^,]+),([^,]+),([^,]+),([^\\)]+)\\)/,$=N.round,_=parseFloat,ab=parseInt,bb=I.prototype.toUpperCase,cb=c._availableAttrs={\"arrow-end\":\"none\",\"arrow-start\":\"none\",blur:0,\"clip-rect\":\"0 0 1e9 1e9\",cursor:\"default\",cx:0,cy:0,fill:\"#fff\",\"fill-opacity\":1,font:'10px \"Arial\"',\"font-family\":'\"Arial\"',\"font-size\":\"10\",\"font-style\":\"normal\",\"font-weight\":400,gradient:0,height:0,href:\"http://raphaeljs.com/\",\"letter-spacing\":0,opacity:1,path:\"M0,0\",r:0,rx:0,ry:0,src:\"\",stroke:\"#000\",\"stroke-dasharray\":\"\",\"stroke-linecap\":\"butt\",\"stroke-linejoin\":\"butt\",\"stroke-miterlimit\":0,\"stroke-opacity\":1,\"stroke-width\":1,target:\"_blank\",\"text-anchor\":\"middle\",title:\"Raphael\",transform:\"\",width:0,x:0,y:0},db=c._availableAnimAttrs={blur:T,\"clip-rect\":\"csv\",cx:T,cy:T,fill:\"colour\",\"fill-opacity\":T,\"font-size\":T,height:T,opacity:T,path:\"path\",r:T,rx:T,ry:T,stroke:\"colour\",\"stroke-opacity\":T,\"stroke-width\":T,transform:\"transform\",width:T,x:T,y:T},eb=/[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*,[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*/,fb={hs:1,rg:1},gb=/,?([achlmqrstvxz]),?/gi,hb=/([achlmrqstvz])[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*,?[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*)+)/gi,ib=/([rstm])[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*,?[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*)+)/gi,jb=/(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*,?[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*/gi,kb=(c._radial_gradient=/^r(?:\\(([^,]+?)[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*,[\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029]*([^\\)]+?)\\))?/,{}),lb=function(a,b){return _(a)-_(b)},mb=function(){},nb=function(a){return a},ob=c._rectPath=function(a,b,c,d,e){return e?[[\"M\",a+e,b],[\"l\",c-2*e,0],[\"a\",e,e,0,0,1,e,e],[\"l\",0,d-2*e],[\"a\",e,e,0,0,1,-e,e],[\"l\",2*e-c,0],[\"a\",e,e,0,0,1,-e,-e],[\"l\",0,2*e-d],[\"a\",e,e,0,0,1,e,-e],[\"z\"]]:[[\"M\",a,b],[\"l\",c,0],[\"l\",0,d],[\"l\",-c,0],[\"z\"]]},pb=function(a,b,c,d){return null==d&&(d=c),[[\"M\",a,b],[\"m\",0,-d],[\"a\",c,d,0,1,1,0,2*d],[\"a\",c,d,0,1,1,0,-2*d],[\"z\"]]},qb=c._getPath={path:function(a){return a.attr(\"path\")},circle:function(a){var b=a.attrs;return pb(b.cx,b.cy,b.r)},ellipse:function(a){var b=a.attrs;return pb(b.cx,b.cy,b.rx,b.ry)},rect:function(a){var b=a.attrs;return ob(b.x,b.y,b.width,b.height,b.r)},image:function(a){var b=a.attrs;return ob(b.x,b.y,b.width,b.height)},text:function(a){var b=a._getBBox();return ob(b.x,b.y,b.width,b.height)},set:function(a){var b=a._getBBox();return ob(b.x,b.y,b.width,b.height)}},rb=c.mapPath=function(a,b){if(!b)return a;var c,d,e,f,g,h,i;for(a=Kb(a),e=0,g=a.length;g>e;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a};if(c._g=A,c.type=A.win.SVGAngle||A.doc.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\",\"1.1\")?\"SVG\":\"VML\",\"VML\"==c.type){var sb,tb=A.doc.createElement(\"div\");if(tb.innerHTML='<v:shape adj=\"1\"/>',sb=tb.firstChild,sb.style.behavior=\"url(#default#VML)\",!sb||\"object\"!=typeof sb.adj)return c.type=G;tb=null}c.svg=!(c.vml=\"VML\"==c.type),c._Paper=C,c.fn=v=C.prototype=c.prototype,c._id=0,c._oid=0,c.is=function(a,b){return b=M.call(b),\"finite\"==b?!Y[z](+a):\"array\"==b?a instanceof Array:\"null\"==b&&null===a||b==typeof a&&null!==a||\"object\"==b&&a===Object(a)||\"array\"==b&&Array.isArray&&Array.isArray(a)||W.call(a).slice(8,-1).toLowerCase()==b},c.angle=function(a,b,d,e,f,g){if(null==f){var h=a-d,i=b-e;return h||i?(180+180*N.atan2(-i,-h)/S+360)%360:0}return c.angle(a,b,f,g)-c.angle(d,e,f,g)},c.rad=function(a){return a%360*S/180},c.deg=function(a){return Math.round(180*a/S%360*1e3)/1e3},c.snapTo=function(a,b,d){if(d=c.is(d,\"finite\")?d:10,c.is(a,V)){for(var e=a.length;e--;)if(Q(a[e]-b)<=d)return a[e]}else{a=+a;var f=b%a;if(d>f)return b-f;if(f>a-d)return b-f+a}return b};c.createUUID=function(a,b){return function(){return\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=16*N.random()|0,c=\"x\"==a?b:3&b|8;return c.toString(16)});c.setWindow=function(a){b(\"raphael.setWindow\",c,A.win,a),A.win=a,A.doc=A.win.document,c._engine.initWin&&c._engine.initWin(A.win)};var ub=function(a){if(c.vml){var b,d=/^\\s+|\\s+$/g;try{var e=new ActiveXObject(\"htmlfile\");e.write(\"<body>\"),e.close(),b=e.body}catch(g){b=createPopup().document.body}var h=b.createTextRange();ub=f(function(a){try{b.style.color=I(a).replace(d,G);var c=h.queryCommandValue(\"ForeColor\");return c=(255&c)<<16|65280&c|(16711680&c)>>>16,\"#\"+(\"000000\"+c.toString(16)).slice(-6)}catch(e){return\"none\"}})}else{var i=A.doc.createElement(\"i\");i.title=\"Raphaël Colour Picker\",i.style.display=\"none\",A.doc.body.appendChild(i),ub=f(function(a){return i.style.color=a,A.doc.defaultView.getComputedStyle(i,G).getPropertyValue(\"color\")})}return ub(a)},vb=function(){return\"hsb(\"+[this.h,this.s,this.b]+\")\"},wb=function(){return\"hsl(\"+[this.h,this.s,this.l]+\")\"},xb=function(){return this.hex},yb=function(a,b,d){if(null==b&&c.is(a,\"object\")&&\"r\"in a&&\"g\"in a&&\"b\"in a&&(d=a.b,b=a.g,a=a.r),null==b&&c.is(a,U)){var e=c.getRGB(a);a=e.r,b=e.g,d=e.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},zb=function(a,b,d,e){a*=255,b*=255,d*=255;var f={r:a,g:b,b:d,hex:c.rgb(a,b,d),toString:xb};return c.is(e,\"finite\")&&(f.opacity=e),f};c.color=function(a){var b;return c.is(a,\"object\")&&\"h\"in a&&\"s\"in a&&\"b\"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):c.is(a,\"object\")&&\"h\"in a&&\"s\"in a&&\"l\"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):(c.is(a,\"string\")&&(a=c.getRGB(a)),c.is(a,\"object\")&&\"r\"in a&&\"g\"in a&&\"b\"in a?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:\"none\"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1)),a.toString=xb,a},c.hsb2rgb=function(a,b,c,d){this.is(a,\"object\")&&\"h\"in a&&\"s\"in a&&\"b\"in a&&(c=a.b,b=a.s,d=a.o,a=a.h),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Q(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.hsl2rgb=function(a,b,c,d){this.is(a,\"object\")&&\"h\"in a&&\"s\"in a&&\"l\"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var e,f,g,h,i;return a=a%360/60,i=2*b*(.5>c?c:1-c),h=i*(1-Q(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],zb(e,f,g,d)},c.rgb2hsb=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=O(a,b,c),g=f-P(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:vb}},c.rgb2hsl=function(a,b,c){c=yb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=O(a,b,c),h=P(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:wb}},c._path2string=function(){return this.join(\",\").replace(gb,\"$1\")};c._preload=function(a,b){var c=A.doc.createElement(\"img\");c.style.cssText=\"position:absolute;left:-9999em;top:-9999em\",c.onload=function(){b.call(this),this.onload=null,A.doc.body.removeChild(this)},c.onerror=function(){A.doc.body.removeChild(this)},A.doc.body.appendChild(c),c.src=a};c.getRGB=f(function(a){if(!a||(a=I(a)).indexOf(\"-\")+1)return{r:-1,g:-1,b:-1,hex:\"none\",error:1,toString:g};if(\"none\"==a)return{r:-1,g:-1,b:-1,hex:\"none\",toString:g};!(fb[z](a.toLowerCase().substring(0,2))||\"#\"==a.charAt())&&(a=ub(a));var b,d,e,f,h,i,j=a.match(X);return j?(j[2]&&(e=ab(j[2].substring(5),16),d=ab(j[2].substring(3,5),16),b=ab(j[2].substring(1,3),16)),j[3]&&(e=ab((h=j[3].charAt(3))+h,16),d=ab((h=j[3].charAt(2))+h,16),b=ab((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4][J](eb),b=_(i[0]),\"%\"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),\"%\"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),\"%\"==i[2].slice(-1)&&(e*=2.55),\"rgba\"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&\"%\"==i[3].slice(-1)&&(f/=100)),j[5]?(i=j[5][J](eb),b=_(i[0]),\"%\"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),\"%\"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),\"%\"==i[2].slice(-1)&&(e*=2.55),(\"deg\"==i[0].slice(-3)||\"°\"==i[0].slice(-1))&&(b/=360),\"hsba\"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&\"%\"==i[3].slice(-1)&&(f/=100),c.hsb2rgb(b,d,e,f)):j[6]?(i=j[6][J](eb),b=_(i[0]),\"%\"==i[0].slice(-1)&&(b*=2.55),d=_(i[1]),\"%\"==i[1].slice(-1)&&(d*=2.55),e=_(i[2]),\"%\"==i[2].slice(-1)&&(e*=2.55),(\"deg\"==i[0].slice(-3)||\"°\"==i[0].slice(-1))&&(b/=360),\"hsla\"==j[1].toLowerCase().slice(0,4)&&(f=_(i[3])),i[3]&&\"%\"==i[3].slice(-1)&&(f/=100),c.hsl2rgb(b,d,e,f)):(j={r:b,g:d,b:e,toString:g},j.hex=\"#\"+(16777216|e|d<<8|b<<16).toString(16).slice(1),c.is(f,\"finite\")&&(j.opacity=f),j)):{r:-1,g:-1,b:-1,hex:\"none\",error:1,toString:g}},c),c.hsb=f(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=f(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=f(function(a,b,c){return\"#\"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),c.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})),c.hex},c.getColor.reset=function(){delete this.start},c.parsePathString=function(a){if(!a)return null;var b=Ab(a);if(b.arr)return Cb(b.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];return c.is(a,V)&&c.is(a[0],V)&&(e=Cb(a)),e.length||I(a).replace(hb,function(a,b,c){var f=[],g=b.toLowerCase();if(c.replace(jb,function(a,b){b&&f.push(+b)}),\"m\"==g&&f.length>2&&(e.push([b][E](f.splice(0,2))),g=\"l\",b=\"m\"==b?\"l\":\"L\"),\"r\"==g)e.push([b][E](f));else for(;f.length>=d[g]&&(e.push([b][E](f.splice(0,d[g]))),d[g]););}),e.toString=c._path2string,b.arr=Cb(e),e},c.parseTransformString=f(function(a){if(!a)return null;var b=[];return c.is(a,V)&&c.is(a[0],V)&&(b=Cb(a)),b.length||I(a).replace(ib,function(a,c,d){{var e=[];M.call(c)}d.replace(jb,function(a,b){b&&e.push(+b)}),b.push([c][E](e))}),b.toString=c._path2string,b});var Ab=function(a){var b=Ab.ps=Ab.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[z](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]};c.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=R(j,3),l=R(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*N.atan2(q-s,r-t)/S;return(q>s||t>r)&&(y+=180),{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}},c.bezierBBox=function(a,b,d,e,f,g,h,i){c.is(a,\"array\")||(a=[a,b,d,e,f,g,h,i]);var j=Jb.apply(null,a);return{x:j.min.x,y:j.min.y,x2:j.max.x,y2:j.max.y,width:j.max.x-j.min.x,height:j.max.y-j.min.y}},c.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},c.isBBoxIntersect=function(a,b){var d=c.isPointInsideBBox;return d(b,a.x,a.y)||d(b,a.x2,a.y)||d(b,a.x,a.y2)||d(b,a.x2,a.y2)||d(a,b.x,b.y)||d(a,b.x2,b.y)||d(a,b.x,b.y2)||d(a,b.x2,b.y2)||(a.x<b.x2&&a.x>b.x||b.x<a.x2&&b.x>a.x)&&(a.y<b.y2&&a.y>b.y||b.y<a.y2&&b.y>a.y)},c.pathIntersection=function(a,b){return n(a,b)},c.pathIntersectionNumber=function(a,b){return n(a,b,1)},c.isPointInsidePath=function(a,b,d){var e=c.pathBBox(a);return c.isPointInsideBBox(e,b,d)&&n(a,[[\"M\",b,d],[\"H\",e.x2+10]],1)%2==1},c._removedFactory=function(a){return function(){b(\"raphael.log\",null,\"Raphaël: you are calling to method “\"+a+\"” of removed object\",a)}};var Bb=c.pathBBox=function(a){var b=Ab(a);if(b.bbox)return d(b.bbox);if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=Kb(a);for(var c,e=0,f=0,g=[],h=[],i=0,j=a.length;j>i;i++)if(c=a[i],\"M\"==c[0])e=c[1],f=c[2],g.push(e),h.push(f);else{var k=Jb(e,f,c[1],c[2],c[3],c[4],c[5],c[6]);g=g[E](k.min.x,k.max.x),h=h[E](k.min.y,k.max.y),e=c[5],f=c[6]}var l=P[D](0,g),m=P[D](0,h),n=O[D](0,g),o=O[D](0,h),p=n-l,q=o-m,r={x:l,y:m,x2:n,y2:o,width:p,height:q,cx:l+p/2,cy:m+q/2};return b.bbox=d(r),r},Cb=function(a){var b=d(a);return b.toString=c._path2string,b},Db=c._pathToRelative=function(a){var b=Ab(a);if(b.rel)return Cb(b.rel);c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a));var d=[],e=0,f=0,g=0,h=0,i=0;\"M\"==a[0][0]&&(e=a[0][1],f=a[0][2],g=e,h=f,i++,d.push([\"M\",e,f]));for(var j=i,k=a.length;k>j;j++){var l=d[j]=[],m=a[j];if(m[0]!=M.call(m[0]))switch(l[0]=M.call(m[0]),l[0]){case\"a\":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case\"v\":l[1]=+(m[1]-f).toFixed(3);break;case\"m\":g=m[1],h=m[2];default:for(var n=1,o=m.length;o>n;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}else{l=d[j]=[],\"m\"==m[0]&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;q>p;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case\"z\":e=g,f=h;break;case\"h\":e+=+d[j][r-1];break;case\"v\":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}return d.toString=c._path2string,b.rel=Cb(d),d},Eb=c._pathToAbsolute=function(a){var b=Ab(a);if(b.abs)return Cb(b.abs);if(c.is(a,V)&&c.is(a&&a[0],V)||(a=c.parsePathString(a)),!a||!a.length)return[[\"M\",0,0]];var d=[],e=0,f=0,g=0,i=0,j=0;\"M\"==a[0][0]&&(e=+a[0][1],f=+a[0][2],g=e,i=f,j++,d[0]=[\"M\",e,f]);for(var k,l,m=3==a.length&&\"M\"==a[0][0]&&\"R\"==a[1][0].toUpperCase()&&\"Z\"==a[2][0].toUpperCase(),n=j,o=a.length;o>n;n++){if(d.push(k=[]),l=a[n],l[0]!=bb.call(l[0]))switch(k[0]=bb.call(l[0]),k[0]){case\"A\":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+f);break;case\"V\":k[1]=+l[1]+f;break;case\"H\":k[1]=+l[1]+e;break;case\"R\":for(var p=[e,f][E](l.slice(1)),q=2,r=p.length;r>q;q++)p[q]=+p[q]+e,p[++q]=+p[q]+f;d.pop(),d=d[E](h(p,m));break;case\"M\":g=+l[1]+e,i=+l[2]+f;default:for(q=1,r=l.length;r>q;q++)k[q]=+l[q]+(q%2?e:f)}else if(\"R\"==l[0])p=[e,f][E](l.slice(1)),d.pop(),d=d[E](h(p,m)),k=[\"R\"][E](l.slice(-2));else for(var s=0,t=l.length;t>s;s++)k[s]=l[s];switch(k[0]){case\"Z\":e=g,f=i;break;case\"H\":e=k[1];break;case\"V\":f=k[1];break;case\"M\":g=k[k.length-2],i=k[k.length-1];default:e=k[k.length-2],f=k[k.length-1]}}return d.toString=c._path2string,b.abs=Cb(d),d},Fb=function(a,b,c,d){return[a,b,c,d,c,d]},Gb=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},Hb=function(a,b,c,d,e,g,h,i,j,k){var l,m=120*S/180,n=S/180*(+e||0),o=[],p=f(function(a,b,c){var d=a*N.cos(c)-b*N.sin(c),e=a*N.sin(c)+b*N.cos(c);return{x:d,y:e}});if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(a,b,-n),a=l.x,b=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(N.cos(S/180*e),N.sin(S/180*e),(a-i)/2),r=(b-j)/2,s=q*q/(c*c)+r*r/(d*d);s>1&&(s=N.sqrt(s),c=s*c,d=s*d);var t=c*c,u=d*d,v=(g==h?-1:1)*N.sqrt(Q((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*c*r/d+(a+i)/2,x=v*-d*q/c+(b+j)/2,y=N.asin(((b-x)/d).toFixed(9)),z=N.asin(((j-x)/d).toFixed(9));y=w>a?S-y:y,z=w>i?S-z:z,0>y&&(y=2*S+y),0>z&&(z=2*S+z),h&&y>z&&(y-=2*S),!h&&z>y&&(z-=2*S)}var A=z-y;if(Q(A)>m){var B=z,C=i,D=j;z=y+m*(h&&z>y?1:-1),i=w+c*N.cos(z),j=x+d*N.sin(z),o=Hb(i,j,c,d,e,0,h,C,D,[z,B,w,x])}A=z-y;var F=N.cos(y),G=N.sin(y),H=N.cos(z),I=N.sin(z),K=N.tan(A/4),L=4/3*c*K,M=4/3*d*K,O=[a,b],P=[a+L*G,b-M*F],R=[i+L*I,j-M*H],T=[i,j];if(P[0]=2*O[0]-P[0],P[1]=2*O[1]-P[1],k)return[P,R,T][E](o);o=[P,R,T][E](o).join()[J](\",\");for(var U=[],V=0,W=o.length;W>V;V++)U[V]=V%2?p(o[V-1],o[V],n).y:p(o[V],o[V+1],n).x;return U},Ib=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:R(j,3)*a+3*R(j,2)*i*c+3*j*i*i*e+R(i,3)*g,y:R(j,3)*b+3*R(j,2)*i*d+3*j*i*i*f+R(i,3)*h}},Jb=f(function(a,b,c,d,e,f,g,h){var i,j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g];return Q(m)>\"1e12\"&&(m=.5),Q(n)>\"1e12\"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+N.sqrt(k*k-4*j*l))/2/j,n=(-k-N.sqrt(k*k-4*j*l))/2/j,Q(m)>\"1e12\"&&(m=.5),Q(n)>\"1e12\"&&(n=.5),m>0&&1>m&&(i=Ib(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=Ib(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),{min:{x:P[D](0,p),y:P[D](0,o)},max:{x:O[D](0,p),y:O[D](0,o)}}}),Kb=c._path2curve=f(function(a,b){var c=!b&&Ab(a);if(!b&&c.curve)return Cb(c.curve);for(var d=Eb(a),e=b&&Eb(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=(function(a,b,c){var d,e,f={T:1,Q:1};if(!a)return[\"C\",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in f)&&(b.qx=b.qy=null),a[0]){case\"M\":b.X=a[1],b.Y=a[2];break;case\"A\":a=[\"C\"][E](Hb[D](0,[b.x,b.y][E](a.slice(1))));break;case\"S\":\"C\"==c||\"S\"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=[\"C\",d,e][E](a.slice(1));break;case\"T\":\"Q\"==c||\"T\"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=[\"C\"][E](Gb(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case\"Q\":b.qx=a[1],b.qy=a[2],a=[\"C\"][E](Gb(b.x,b.y,a[1],a[2],a[3],a[4]));break;case\"L\":a=[\"C\"][E](Fb(b.x,b.y,a[1],a[2]));break;case\"H\":a=[\"C\"][E](Fb(b.x,b.y,a[1],b.y));break;case\"V\":a=[\"C\"][E](Fb(b.x,b.y,b.x,a[1]));break;case\"Z\":a=[\"C\"][E](Fb(b.x,b.y,b.X,b.Y))}return a}),i=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)k[b]=\"A\",e&&(l[b]=\"A\"),a.splice(b++,0,[\"C\"][E](c.splice(0,6)));a.splice(b,1),p=O(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&\"M\"==a[g][0]&&\"M\"!=b[g][0]&&(b.splice(g,0,[\"M\",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],p=O(d.length,e&&e.length||0))},k=[],l=[],m=\"\",n=\"\",o=0,p=O(d.length,e&&e.length||0);p>o;o++){d[o]&&(m=d[o][0]),\"C\"!=m&&(k[o]=m,o&&(n=k[o-1])),d[o]=h(d[o],f,n),\"A\"!=k[o]&&\"C\"==m&&(k[o]=\"C\"),i(d,o),e&&(e[o]&&(m=e[o][0]),\"C\"!=m&&(l[o]=m,o&&(n=l[o-1])),e[o]=h(e[o],g,n),\"A\"!=l[o]&&\"C\"==m&&(l[o]=\"C\"),i(e,o)),j(d,e,f,g,o),j(e,d,g,f,o);var q=d[o],r=e&&e[o],s=q.length,t=e&&r.length;f.x=q[s-2],f.y=q[s-1],f.bx=_(q[s-4])||f.x,f.by=_(q[s-3])||f.y,g.bx=e&&(_(r[t-4])||g.x),g.by=e&&(_(r[t-3])||g.y),g.x=e&&r[t-2],g.y=e&&r[t-1]}return e||(c.curve=Cb(d)),e?[d,e]:d},null,Cb),Lb=(c._parseDots=f(function(a){for(var b=[],d=0,e=a.length;e>d;d++){var f={},g=a[d].match(/^([^:]*):?([\\d\\.]*)/);if(f.color=c.getRGB(g[1]),f.color.error)return null;f.color=f.color.hex,g[2]&&(f.offset=g[2]+\"%\"),b.push(f)}for(d=1,e=b.length-1;e>d;d++)if(!b[d].offset){for(var h=_(b[d-1].offset||0),i=0,j=d+1;e>j;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=e),i=_(i);for(var k=(i-h)/(j-d+1);j>d;d++)h+=k,b[d].offset=h+\"%\"}return b}),c._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)}),Mb=(c._tofront=function(a,b){b.top!==a&&(Lb(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a)},c._toback=function(a,b){b.bottom!==a&&(Lb(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a)},c._insertafter=function(a,b,c){Lb(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},c._insertbefore=function(a,b,c){Lb(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},c.toMatrix=function(a,b){var c=Bb(a),d={_:{transform:G},getBBox:function(){return c}};return Nb(d,b),d.matrix}),Nb=(c.transformPath=function(a,b){return rb(a,Mb(a,b))},c._extractTransform=function(a,b){if(null==b)return a._.transform;b=I(b).replace(/\\.{3}|\\u2026/g,a._.transform||G);var d=c.parseTransformString(b),e=0,f=0,g=0,h=1,i=1,j=a._,k=new o;if(j.transform=d||[],d)for(var l=0,m=d.length;m>l;l++){var n,p,q,r,s,t=d[l],u=t.length,v=I(t[0]).toLowerCase(),w=t[0]!=v,x=w?k.invert():0;\"t\"==v&&3==u?w?(n=x.x(0,0),p=x.y(0,0),q=x.x(t[1],t[2]),r=x.y(t[1],t[2]),k.translate(q-n,r-p)):k.translate(t[1],t[2]):\"r\"==v?2==u?(s=s||a.getBBox(1),k.rotate(t[1],s.x+s.width/2,s.y+s.height/2),e+=t[1]):4==u&&(w?(q=x.x(t[2],t[3]),r=x.y(t[2],t[3]),k.rotate(t[1],q,r)):k.rotate(t[1],t[2],t[3]),e+=t[1]):\"s\"==v?2==u||3==u?(s=s||a.getBBox(1),k.scale(t[1],t[u-1],s.x+s.width/2,s.y+s.height/2),h*=t[1],i*=t[u-1]):5==u&&(w?(q=x.x(t[3],t[4]),r=x.y(t[3],t[4]),k.scale(t[1],t[2],q,r)):k.scale(t[1],t[2],t[3],t[4]),h*=t[1],i*=t[2]):\"m\"==v&&7==u&&k.add(t[1],t[2],t[3],t[4],t[5],t[6]),j.dirtyT=1,a.matrix=k}a.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,1==h&&1==i&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1}),Ob=function(a){var b=a[0];switch(b.toLowerCase()){case\"t\":return[b,0,0];case\"m\":return[b,1,0,0,1,0,0];case\"r\":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case\"s\":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}},Pb=c._equaliseTransform=function(a,b){b=I(b).replace(/\\.{3}|\\u2026/g,a),a=c.parseTransformString(a)||[],b=c.parseTransformString(b)||[];\nfor(var d,e,f,g,h=O(a.length,b.length),i=[],j=[],k=0;h>k;k++){if(f=a[k]||Ob(b[k]),g=b[k]||Ob(f),f[0]!=g[0]||\"r\"==f[0].toLowerCase()&&(f[2]!=g[2]||f[3]!=g[3])||\"s\"==f[0].toLowerCase()&&(f[3]!=g[3]||f[4]!=g[4]))return;for(i[k]=[],j[k]=[],d=0,e=O(f.length,g.length);e>d;d++)d in f&&(i[k][d]=f[d]),d in g&&(j[k][d]=g[d])}return{from:i,to:j}};c._getContainer=function(a,b,d,e){var f;return f=null!=e||c.is(a,\"object\")?a:A.doc.getElementById(a),null!=f?f.tagName?null==b?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:b,height:d}:{container:1,x:a,y:b,width:d,height:e}:void 0},c.pathToRelative=Db,c._engine={},c.path2curve=Kb,c.matrix=function(a,b,c,d,e,f){return new o(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=N.sqrt(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof o&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new o(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+N.cos(a).toFixed(9),f=+N.sin(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[I.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?\"matrix(\"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+\")\":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toFilter=function(){return\"progid:DXImageTransform.Microsoft.Matrix(M11=\"+this.get(0)+\", M12=\"+this.get(2)+\", M21=\"+this.get(1)+\", M22=\"+this.get(3)+\", Dx=\"+this.get(4)+\", Dy=\"+this.get(5)+\", sizingmethod='auto expand')\"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=N.sqrt(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=N.sqrt(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(N.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(N.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[J]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?\"t\"+[b.dx,b.dy]:G)+(1!=b.scalex||1!=b.scaley?\"s\"+[b.scalex,b.scaley,0,0]:G)+(b.rotate?\"r\"+[b.rotate,0,0]:G)):\"m\"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(o.prototype);var Qb=navigator.userAgent.match(/Version\\/(.*?)\\s/)||navigator.userAgent.match(/Chrome\\/(\\d+)/);v.safari=\"Apple Computer, Inc.\"==navigator.vendor&&(Qb&&Qb[1]<4||\"iP\"==navigator.platform.slice(0,2))||\"Google Inc.\"==navigator.vendor&&Qb&&Qb[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:\"none\"});setTimeout(function(){a.remove()})}:mb;for(var Rb=function(){this.returnValue=!1},Sb=function(){return this.originalEvent.preventDefault()},Tb=function(){this.cancelBubble=!0},Ub=function(){return this.originalEvent.stopPropagation()},Vb=function(a){var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,c=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;return{x:a.clientX+c,y:a.clientY+b}},Wb=function(){return A.doc.addEventListener?function(a,b,c,d){var e=function(a){var b=Vb(a);return c.call(d,a,b.x,b.y)};if(a.addEventListener(b,e,!1),F&&L[b]){var f=function(b){for(var e=Vb(b),f=b,g=0,h=b.targetTouches&&b.targetTouches.length;h>g;g++)if(b.targetTouches[g].target==a){b=b.targetTouches[g],b.originalEvent=f,b.preventDefault=Sb,b.stopPropagation=Ub;break}return c.call(d,b,e.x,e.y)};a.addEventListener(L[b],f,!1)}return function(){return a.removeEventListener(b,e,!1),F&&L[b]&&a.removeEventListener(L[b],f,!1),!0}}:A.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||A.win.event;var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,e=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||Rb,a.stopPropagation=a.stopPropagation||Tb,c.call(d,a,f,g)};a.attachEvent(\"on\"+b,e);var f=function(){return a.detachEvent(\"on\"+b,e),!0};return f}:void 0}(),Xb=[],Yb=function(a){for(var c,d=a.clientX,e=a.clientY,f=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,g=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,h=Xb.length;h--;){if(c=Xb[h],F&&a.touches){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==c.el._drag.id){d=i.clientX,e=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var k,l=c.el.node,m=l.nextSibling,n=l.parentNode,o=l.style.display;A.win.opera&&n.removeChild(l),l.style.display=\"none\",k=c.el.paper.getElementByPoint(d,e),l.style.display=o,A.win.opera&&(m?n.insertBefore(l,m):n.appendChild(l)),k&&b(\"raphael.drag.over.\"+c.el.id,c.el,k),d+=g,e+=f,b(\"raphael.drag.move.\"+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},Zb=function(a){c.unmousemove(Yb).unmouseup(Zb);for(var d,e=Xb.length;e--;)d=Xb[e],d.el._drag={},b(\"raphael.drag.end.\"+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,a);Xb=[]},$b=c.el={},_b=K.length;_b--;)!function(a){c[a]=$b[a]=function(b,d){return c.is(b,\"function\")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:Wb(this.shape||this.node||A.doc,a,b,d||this)})),this},c[\"un\"+a]=$b[\"un\"+a]=function(b){for(var d=this.events||[],e=d.length;e--;)d[e].name!=a||!c.is(b,\"undefined\")&&d[e].f!=b||(d[e].unbind(),d.splice(e,1),!d.length&&delete this.events);return this}}(K[_b]);$b.data=function(a,d){var e=kb[this.id]=kb[this.id]||{};if(0==arguments.length)return e;if(1==arguments.length){if(c.is(a,\"object\")){for(var f in a)a[z](f)&&this.data(f,a[f]);return this}return b(\"raphael.data.get.\"+this.id,this,e[a],a),e[a]}return e[a]=d,b(\"raphael.data.set.\"+this.id,this,d,a),this},$b.removeData=function(a){return null==a?kb[this.id]={}:kb[this.id]&&delete kb[this.id][a],this},$b.getData=function(){return d(kb[this.id]||{})},$b.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},$b.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var ac=[];$b.drag=function(a,d,e,f,g,h){function i(i){(i.originalEvent||i).preventDefault();var j=i.clientX,k=i.clientY,l=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,m=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;if(this._drag.id=i.identifier,F&&i.touches)for(var n,o=i.touches.length;o--;)if(n=i.touches[o],this._drag.id=n.identifier,n.identifier==this._drag.id){j=n.clientX,k=n.clientY;break}this._drag.x=j+m,this._drag.y=k+l,!Xb.length&&c.mousemove(Yb).mouseup(Zb),Xb.push({el:this,move_scope:f,start_scope:g,end_scope:h}),d&&b.on(\"raphael.drag.start.\"+this.id,d),a&&b.on(\"raphael.drag.move.\"+this.id,a),e&&b.on(\"raphael.drag.end.\"+this.id,e),b(\"raphael.drag.start.\"+this.id,g||f||this,i.clientX+m,i.clientY+l,i)}return this._drag={},ac.push({el:this,start:i}),this.mousedown(i),this},$b.onDragOver=function(a){a?b.on(\"raphael.drag.over.\"+this.id,a):b.unbind(\"raphael.drag.over.\"+this.id)},$b.undrag=function(){for(var a=ac.length;a--;)ac[a].el==this&&(this.unmousedown(ac[a].start),ac.splice(a,1),b.unbind(\"raphael.drag.*.\"+this.id));!ac.length&&c.unmousemove(Yb).unmouseup(Zb),Xb=[]},v.circle=function(a,b,d){var e=c._engine.circle(this,a||0,b||0,d||0);return this.__set__&&this.__set__.push(e),e},v.rect=function(a,b,d,e,f){var g=c._engine.rect(this,a||0,b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.ellipse=function(a,b,d,e){var f=c._engine.ellipse(this,a||0,b||0,d||0,e||0);return this.__set__&&this.__set__.push(f),f},v.path=function(a){a&&!c.is(a,U)&&!c.is(a[0],V)&&(a+=G);var b=c._engine.path(c.format[D](c,arguments),this);return this.__set__&&this.__set__.push(b),b},v.image=function(a,b,d,e,f){var g=c._engine.image(this,a||\"about:blank\",b||0,d||0,e||0,f||0);return this.__set__&&this.__set__.push(g),g},v.text=function(a,b,d){var e=c._engine.text(this,a||0,b||0,I(d));return this.__set__&&this.__set__.push(e),e},v.set=function(a){!c.is(a,\"array\")&&(a=Array.prototype.splice.call(arguments,0,arguments.length));var b=new mc(a);return this.__set__&&this.__set__.push(b),b.paper=this,b.type=\"set\",b},v.setStart=function(a){this.__set__=a||this.set()},v.setFinish=function(){var a=this.__set__;return delete this.__set__,a},v.getSize=function(){var a=this.canvas.parentNode;return{width:a.offsetWidth,height:a.offsetHeight}},v.setSize=function(a,b){return c._engine.setSize.call(this,a,b)},v.setViewBox=function(a,b,d,e,f){return c._engine.setViewBox.call(this,a,b,d,e,f)},v.top=v.bottom=null,v.raphael=c;var bc=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(A.win.pageYOffset||e.scrollTop||d.scrollTop)-f,i=b.left+(A.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:h,x:i}};v.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=A.doc.elementFromPoint(a,b);if(A.win.opera&&\"svg\"==e.tagName){var f=bc(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var h=d.getIntersectionList(g,null);h.length&&(e=h[h.length-1])}if(!e)return null;for(;e.parentNode&&e!=d.parentNode&&!e.raphael;)e=e.parentNode;return e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null},v.getElementsByBBox=function(a){var b=this.set();return this.forEach(function(d){c.isBBoxIntersect(d.getBBox(),a)&&b.push(d)}),b},v.getById=function(a){for(var b=this.bottom;b;){if(b.id==a)return b;b=b.next}return null},v.forEach=function(a,b){for(var c=this.bottom;c;){if(a.call(b,c)===!1)return this;c=c.next}return this},v.getElementsByPoint=function(a,b){var c=this.set();return this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)}),c},$b.isPointInside=function(a,b){var d=this.realPath=qb[this.type](this);return this.attr(\"transform\")&&this.attr(\"transform\").length&&(d=c.transformPath(d,this.attr(\"transform\"))),c.isPointInsidePath(d,a,b)},$b.getBBox=function(a){if(this.removed)return{};var b=this._;return a?((b.dirty||!b.bboxwt)&&(this.realPath=qb[this.type](this),b.bboxwt=Bb(this.realPath),b.bboxwt.toString=p,b.dirty=0),b.bboxwt):((b.dirty||b.dirtyT||!b.bbox)&&((b.dirty||!this.realPath)&&(b.bboxwt=0,this.realPath=qb[this.type](this)),b.bbox=Bb(rb(this.realPath,this.matrix)),b.bbox.toString=p,b.dirty=b.dirtyT=0),b.bbox)},$b.clone=function(){if(this.removed)return null;var a=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(a),a},$b.glow=function(a){if(\"text\"==this.type)return null;a=a||{};var b={width:(a.width||10)+(+this.attr(\"stroke-width\")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||\"#000\"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||qb[this.type](this);f=this.matrix?rb(f,this.matrix):f;for(var g=1;c+1>g;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:\"none\",\"stroke-linejoin\":\"round\",\"stroke-linecap\":\"round\",\"stroke-width\":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var cc=function(a,b,d,e,f,g,h,i,l){return null==l?j(a,b,d,e,f,g,h,i):c.findDotsAtSegment(a,b,d,e,f,g,h,i,k(a,b,d,e,f,g,h,i,l))},dc=function(a,b){return function(d,e,f){d=Kb(d);for(var g,h,i,j,k,l=\"\",m={},n=0,o=0,p=d.length;p>o;o++){if(i=d[o],\"M\"==i[0])g=+i[1],h=+i[2];else{if(j=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6]),n+j>e){if(b&&!m.start){if(k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=[\"C\"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=[\"M\"+k.x,k.y+\"C\"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return k=cc(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{x:k.x,y:k.y,alpha:k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:b?m:c.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},ec=dc(1),fc=dc(),gc=dc(0,1);c.getTotalLength=ec,c.getPointAtLength=fc,c.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return gc(a,b).end;var d=gc(a,c,1);return b?gc(d,b).end:d},$b.getTotalLength=function(){var a=this.getPath();if(a)return this.node.getTotalLength?this.node.getTotalLength():ec(a)},$b.getPointAtLength=function(a){var b=this.getPath();if(b)return fc(b,a)},$b.getPath=function(){var a,b=c._getPath[this.type];if(\"text\"!=this.type&&\"set\"!=this.type)return b&&(a=b(this)),a},$b.getSubpath=function(a,b){var d=this.getPath();if(d)return c.getSubpath(d,a,b)};var hc=c.easing_formulas={linear:function(a){return a},\"<\":function(a){return R(a,1.7)},\">\":function(a){return R(a,.48)},\"<>\":function(a){var b=.48-a/1.04,c=N.sqrt(.1734+b*b),d=c-b,e=R(Q(d),1/3)*(0>d?-1:1),f=-c-b,g=R(Q(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){return a==!!a?a:R(2,-10*a)*N.sin(2*(a-.075)*S/.3)+1},bounce:function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};hc.easeIn=hc[\"ease-in\"]=hc[\"<\"],hc.easeOut=hc[\"ease-out\"]=hc[\">\"],hc.easeInOut=hc[\"ease-in-out\"]=hc[\"<>\"],hc[\"back-in\"]=hc.backIn,hc[\"back-out\"]=hc.backOut;var ic=[],jc=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},kc=function(){for(var a=+new Date,d=0;d<ic.length;d++){var e=ic[d];if(!e.el.removed&&!e.paused){var f,g,h=a-e.start,i=e.ms,j=e.easing,k=e.from,l=e.diff,m=e.to,n=(e.t,e.el),o={},p={};if(e.initstatus?(h=(e.initstatus*e.anim.top-e.prev)/(e.percent-e.prev)*i,e.status=e.initstatus,delete e.initstatus,e.stop&&ic.splice(d--,1)):e.status=(e.prev+(e.percent-e.prev)*(h/i))/e.anim.top,!(0>h))if(i>h){var q=j(h/i);for(var r in k)if(k[z](r)){switch(db[r]){case T:f=+k[r]+q*i*l[r];break;case\"colour\":f=\"rgb(\"+[lc($(k[r].r+q*i*l[r].r)),lc($(k[r].g+q*i*l[r].g)),lc($(k[r].b+q*i*l[r].b))].join(\",\")+\")\";break;case\"path\":f=[];for(var t=0,u=k[r].length;u>t;t++){f[t]=[k[r][t][0]];for(var v=1,w=k[r][t].length;w>v;v++)f[t][v]=+k[r][t][v]+q*i*l[r][t][v];f[t]=f[t].join(H)}f=f.join(H);break;case\"transform\":if(l[r].real)for(f=[],t=0,u=k[r].length;u>t;t++)for(f[t]=[k[r][t][0]],v=1,w=k[r][t].length;w>v;v++)f[t][v]=k[r][t][v]+q*i*l[r][t][v];else{var x=function(a){return+k[r][a]+q*i*l[r][a]};f=[[\"m\",x(0),x(1),x(2),x(3),x(4),x(5)]]}break;case\"csv\":if(\"clip-rect\"==r)for(f=[],t=4;t--;)f[t]=+k[r][t]+q*i*l[r][t];break;default:var y=[][E](k[r]);for(f=[],t=n.paper.customAttributes[r].length;t--;)f[t]=+y[t]+q*i*l[r][t]}o[r]=f}n.attr(o),function(a,c,d){setTimeout(function(){b(\"raphael.anim.frame.\"+a,c,d)})}(n.id,n,e.anim)}else{if(function(a,d,e){setTimeout(function(){b(\"raphael.anim.frame.\"+d.id,d,e),b(\"raphael.anim.finish.\"+d.id,d,e),c.is(a,\"function\")&&a.call(d)})}(e.callback,n,e.anim),n.attr(m),ic.splice(d--,1),e.repeat>1&&!e.next){for(g in m)m[z](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),s(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&s(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}c.svg&&n&&n.paper&&n.paper.safari(),ic.length&&jc(kc)},lc=function(a){return a>255?255:0>a?0:a};$b.animateWith=function(a,b,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof r?d:c.animation(d,e,f,g);s(i,h,i.percents[0],null,h.attr());for(var j=0,k=ic.length;k>j;j++)if(ic[j].anim==b&&ic[j].el==a){ic[k-1].start=ic[j].start;break}return h},$b.onAnimation=function(a){return a?b.on(\"raphael.anim.frame.\"+this.id,a):b.unbind(\"raphael.anim.frame.\"+this.id),this},r.prototype.delay=function(a){var b=new r(this.anim,this.ms);return b.times=this.times,b.del=+a||0,b},r.prototype.repeat=function(a){var b=new r(this.anim,this.ms);return b.del=this.del,b.times=N.floor(O(a,0))||1,b},c.animation=function(a,b,d,e){if(a instanceof r)return a;(c.is(d,\"function\")||!d)&&(e=e||d||null,d=null),a=Object(a),b=+b||0;var f,g,h={};for(g in a)a[z](g)&&_(g)!=g&&_(g)+\"%\"!=g&&(f=!0,h[g]=a[g]);if(f)return d&&(h.easing=d),e&&(h.callback=e),new r({100:h},b);if(e){var i=0;for(var j in a){var k=ab(j);a[z](j)&&k>i&&(i=k)}i+=\"%\",!a[i].callback&&(a[i].callback=e)}return new r(a,b)},$b.animate=function(a,b,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof r?a:c.animation(a,b,d,e);return s(g,f,g.percents[0],null,f.attr()),f},$b.setTime=function(a,b){return a&&null!=b&&this.status(a,P(b,a.ms)/a.ms),this},$b.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return s(a,this,-1,P(b,1)),this;for(c=ic.length;c>f;f++)if(d=ic[f],d.el.id==this.id&&(!a||d.anim==a)){if(a)return d.status;e.push({anim:d.anim,status:d.status})}return a?0:e},$b.pause=function(a){for(var c=0;c<ic.length;c++)ic[c].el.id!=this.id||a&&ic[c].anim!=a||b(\"raphael.anim.pause.\"+this.id,this,ic[c].anim)!==!1&&(ic[c].paused=!0);return this},$b.resume=function(a){for(var c=0;c<ic.length;c++)if(ic[c].el.id==this.id&&(!a||ic[c].anim==a)){var d=ic[c];b(\"raphael.anim.resume.\"+this.id,this,d.anim)!==!1&&(delete d.paused,this.status(d.anim,d.status))}return this},$b.stop=function(a){for(var c=0;c<ic.length;c++)ic[c].el.id!=this.id||a&&ic[c].anim!=a||b(\"raphael.anim.stop.\"+this.id,this,ic[c].anim)!==!1&&ic.splice(c--,1);return this},b.on(\"raphael.remove\",t),b.on(\"raphael.clear\",t),$b.toString=function(){return\"Raphaël’s object\"};var mc=function(a){if(this.items=[],this.length=0,this.type=\"set\",a)for(var b=0,c=a.length;c>b;b++)!a[b]||a[b].constructor!=$b.constructor&&a[b].constructor!=mc||(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},nc=mc.prototype;nc.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],!a||a.constructor!=$b.constructor&&a.constructor!=mc||(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},nc.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},nc.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var oc in $b)$b[z](oc)&&(nc[oc]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][D](c,b)})}}(oc));return nc.attr=function(a,b){if(a&&c.is(a,V)&&c.is(a[0],\"object\"))for(var d=0,e=a.length;e>d;d++)this.items[d].attr(a[d]);else for(var f=0,g=this.items.length;g>f;f++)this.items[f].attr(a,b);return this},nc.clear=function(){for(;this.length;)this.pop()},nc.splice=function(a,b){a=0>a?O(this.length+a,0):a,b=O(0,P(this.length-a,b));var c,d=[],e=[],f=[];for(c=2;c<arguments.length;c++)f.push(arguments[c]);for(c=0;b>c;c++)e.push(this[a+c]);for(;c<this.length-a;c++)d.push(this[a+c]);var g=f.length;for(c=0;c<g+d.length;c++)this.items[a+c]=this[a+c]=g>c?f[c]:d[c-g];for(c=this.items.length=this.length-=b-g;this[c];)delete this[c++];return new mc(e)},nc.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0},nc.animate=function(a,b,d,e){(c.is(d,\"function\")||!d)&&(e=d||null);var f,g,h=this.items.length,i=h,j=this;if(!h)return this;e&&(g=function(){!--h&&e.call(j)}),d=c.is(d,U)?d:g;var k=c.animation(a,b,d,g);for(f=this.items[--i].animate(k);i--;)this.items[i]&&!this.items[i].removed&&this.items[i].animateWith(f,k,k),this.items[i]&&!this.items[i].removed||h--;return this},nc.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},nc.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=P[D](0,a),b=P[D](0,b),c=O[D](0,c),d=O[D](0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},nc.clone=function(a){a=this.paper.set();for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},nc.toString=function(){return\"Raphaël‘s set\"},nc.glow=function(a){var b=this.paper.set();return this.forEach(function(c){var d=c.glow(a);null!=d&&d.forEach(function(a){b.push(a)})}),b},nc.isPointInside=function(a,b){var c=!1;return this.forEach(function(d){return d.isPointInside(a,b)?(c=!0,!1):void 0}),c},c.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face[\"font-family\"];for(var d in a.face)a.face[z](d)&&(b.face[d]=a.face[d]);if(this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b],!a.svg){b.face[\"units-per-em\"]=ab(a.face[\"units-per-em\"],10);for(var e in a.glyphs)if(a.glyphs[z](e)){var f=a.glyphs[e];if(b.glyphs[e]={w:f.w,k:{},d:f.d&&\"M\"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:\"L\",c:\"C\",x:\"z\",t:\"m\",r:\"l\",v:\"c\"}[a]||\"M\"})+\"z\"},f.k)for(var g in f.k)f[z](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},v.getFont=function(a,b,d,e){if(e=e||\"normal\",d=d||\"normal\",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400,c.fonts){var f=c.fonts[a];if(!f){var g=new RegExp(\"(^|\\\\s)\"+a.replace(/[^\\w\\d\\s+!~.:_-]/g,G)+\"(\\\\s|$)\",\"i\");for(var h in c.fonts)if(c.fonts[z](h)&&g.test(h)){f=c.fonts[h];break}}var i;if(f)for(var j=0,k=f.length;k>j&&(i=f[j],i.face[\"font-weight\"]!=b||i.face[\"font-style\"]!=d&&i.face[\"font-style\"]||i.face[\"font-stretch\"]!=e);j++);return i}},v.print=function(a,b,d,e,f,g,h,i){g=g||\"middle\",h=O(P(h||0,1),-1),i=O(P(i||1,3),1);var j,k=I(d)[J](G),l=0,m=0,n=G;if(c.is(e,\"string\")&&(e=this.getFont(e)),e){j=(f||16)/e.face[\"units-per-em\"];for(var o=e.face.bbox[J](w),p=+o[0],q=o[3]-o[1],r=0,s=+o[1]+(\"baseline\"==g?q+ +e.face.descent:q/2),t=0,u=k.length;u>t;t++){if(\"\\n\"==k[t])l=0,x=0,m=0,r+=q*i;else{var v=m&&e.glyphs[k[t-1]]||{},x=e.glyphs[k[t]];l+=m?(v.w||e.w)+(v.k&&v.k[k[t]]||0)+e.w*h:0,m=1}x&&x.d&&(n+=c.transformPath(x.d,[\"t\",l*j,r*j,\"s\",j,j,p,s,\"t\",(a-p)/j,(b-s)/j]))}}return this.path(n).attr({fill:\"#000\",stroke:\"none\"})},v.add=function(a){if(c.is(a,\"array\"))for(var b,d=this.set(),e=0,f=a.length;f>e;e++)b=a[e]||{},x[z](b.type)&&d.push(this[b.type]().attr(b));return d},c.format=function(a,b){var d=c.is(b,V)?[0][E](b):arguments;return a&&c.is(a,U)&&d.length-1&&(a=a.replace(y,function(a,b){return null==d[++b]?G:d[b]})),a||G},c.fullfill=function(){var a=/\\{([^\\}]+)\\}/g,b=/(?:(?:^|\\.)(.+?)(?=\\[|\\.|$|\\()|\\[('|\")(.+?)\\2\\])(\\(\\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),\"function\"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+\"\"};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),c.ninja=function(){return B.was?A.win.Raphael=B.is:delete Raphael,c},c.st=nc,b.on(\"raphael.DOMload\",function(){u=!0}),function(a,b,d){function e(){/in/.test(a.readyState)?setTimeout(e,9):c.eve(\"raphael.DOMload\")}null==a.readyState&&a.addEventListener&&(a.addEventListener(b,d=function(){a.removeEventListener(b,d,!1),a.readyState=\"complete\"},!1),a.readyState=\"loading\"),e()}(document,\"DOMContentLoaded\"),function(){if(c.svg){var a=\"hasOwnProperty\",b=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=/[, ]+/,k=c.eve,l=\"\",m=\" \",n=\"http://www.w3.org/1999/xlink\",o={block:\"M5,0 0,2.5 5,5z\",classic:\"M5,0 0,2.5 5,5 3.5,3 3.5,2z\",diamond:\"M2.5,0 5,2.5 2.5,5 0,2.5z\",open:\"M6,1 1,3.5 6,6\",oval:\"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z\"},p={};c.toString=function(){return\"Your browser supports SVG.\\nYou are running Raphaël \"+this.version};var q=function(d,e){if(e){\"string\"==typeof d&&(d=q(d));for(var f in e)e[a](f)&&(\"xlink:\"==f.substring(0,6)?d.setAttributeNS(n,f.substring(6),b(e[f])):d.setAttribute(f,b(e[f])))}else d=c._g.doc.createElementNS(\"http://www.w3.org/2000/svg\",d),d.style&&(d.style.webkitTapHighlightColor=\"rgba(0,0,0,0)\");return d},r=function(a,e){var j=\"linear\",k=a.id+e,m=.5,n=.5,o=a.node,p=a.paper,r=o.style,s=c._g.doc.getElementById(k);if(!s){if(e=b(e).replace(c._radial_gradient,function(a,b,c){if(j=\"radial\",b&&c){m=d(b),n=d(c);var e=2*(n>.5)-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&.5!=n&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\\s*\\-\\s*/),\"linear\"==j){var t=e.shift();if(t=-d(t),isNaN(t))return null;var u=[0,0,f.cos(c.rad(t)),f.sin(c.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=c._parseDots(e);if(!w)return null;if(k=k.replace(/[\\(\\)\\s,\\xb0#]/g,\"_\"),a.gradient&&k!=a.gradient.id&&(p.defs.removeChild(a.gradient),delete a.gradient),!a.gradient){s=q(j+\"Gradient\",{id:k}),a.gradient=s,q(s,\"radial\"==j?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:a.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;y>x;x++)s.appendChild(q(\"stop\",{offset:w[x].offset?w[x].offset:x?\"100%\":\"0%\",\"stop-color\":w[x].color||\"#fff\"}))}}return q(o,{fill:\"url('\"+document.location+\"#\"+k+\"')\",opacity:1,\"fill-opacity\":1}),r.fill=l,r.opacity=1,r.fillOpacity=1,1},s=function(a){var b=a.getBBox(1);q(a.pattern,{patternTransform:a.matrix.invert()+\" translate(\"+b.x+\",\"+b.y+\")\"})},t=function(d,e,f){if(\"path\"==d.type){for(var g,h,i,j,k,m=b(e).toLowerCase().split(\"-\"),n=d.paper,r=f?\"end\":\"start\",s=d.node,t=d.attrs,u=t[\"stroke-width\"],v=m.length,w=\"classic\",x=3,y=3,z=5;v--;)switch(m[v]){case\"block\":case\"classic\":case\"oval\":case\"diamond\":case\"open\":case\"none\":w=m[v];break;case\"wide\":y=5;break;case\"narrow\":y=2;break;case\"long\":x=5;break;case\"short\":x=2}if(\"open\"==w?(x+=2,y+=2,z+=2,i=1,j=f?4:1,k={fill:\"none\",stroke:t.stroke}):(j=i=x/2,k={fill:t.stroke,stroke:\"none\"}),d._.arrows?f?(d._.arrows.endPath&&p[d._.arrows.endPath]--,d._.arrows.endMarker&&p[d._.arrows.endMarker]--):(d._.arrows.startPath&&p[d._.arrows.startPath]--,d._.arrows.startMarker&&p[d._.arrows.startMarker]--):d._.arrows={},\"none\"!=w){var A=\"raphael-marker-\"+w,B=\"raphael-marker-\"+r+w+x+y+\"-obj\"+d.id;c._g.doc.getElementById(A)?p[A]++:(n.defs.appendChild(q(q(\"path\"),{\"stroke-linecap\":\"round\",d:o[w],id:A})),p[A]=1);var C,D=c._g.doc.getElementById(B);D?(p[B]++,C=D.getElementsByTagName(\"use\")[0]):(D=q(q(\"marker\"),{id:B,markerHeight:y,markerWidth:x,orient:\"auto\",refX:j,refY:y/2}),C=q(q(\"use\"),{\"xlink:href\":\"#\"+A,transform:(f?\"rotate(180 \"+x/2+\" \"+y/2+\") \":l)+\"scale(\"+x/z+\",\"+y/z+\")\",\"stroke-width\":(1/((x/z+y/z)/2)).toFixed(4)}),D.appendChild(C),n.defs.appendChild(D),p[B]=1),q(C,k);var E=i*(\"diamond\"!=w&&\"oval\"!=w);f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-E*u):(g=E*u,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),k={},k[\"marker-\"+r]=\"url(#\"+B+\")\",(h||g)&&(k.d=c.getSubpath(t.path,g,h)),q(s,k),d._.arrows[r+\"Path\"]=A,d._.arrows[r+\"Marker\"]=B,d._.arrows[r+\"dx\"]=E,d._.arrows[r+\"Type\"]=w,d._.arrows[r+\"String\"]=e}else f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(t.path)-g):(g=0,h=c.getTotalLength(t.path)-(d._.arrows.enddx*u||0)),d._.arrows[r+\"Path\"]&&q(s,{d:c.getSubpath(t.path,g,h)}),delete d._.arrows[r+\"Path\"],delete d._.arrows[r+\"Marker\"],delete d._.arrows[r+\"dx\"],delete d._.arrows[r+\"Type\"],delete d._.arrows[r+\"String\"];for(k in p)if(p[a](k)&&!p[k]){var F=c._g.doc.getElementById(k);F&&F.parentNode.removeChild(F)}}},u={\"\":[0],none:[0],\"-\":[3,1],\".\":[1,1],\"-.\":[3,1,1,1],\"-..\":[3,1,1,1,1,1],\". \":[1,3],\"- \":[4,3],\"--\":[8,3],\"- .\":[4,3,1,3],\"--.\":[8,3,1,3],\"--..\":[8,3,1,3,1,3]},v=function(a,c,d){if(c=u[b(c).toLowerCase()]){for(var e=a.attrs[\"stroke-width\"]||\"1\",f={round:e,square:e,butt:0}[a.attrs[\"stroke-linecap\"]||d[\"stroke-linecap\"]]||0,g=[],h=c.length;h--;)g[h]=c[h]*e+(h%2?1:-1)*f;q(a.node,{\"stroke-dasharray\":g.join(\",\")})}},w=function(d,f){var i=d.node,k=d.attrs,m=i.style.visibility;i.style.visibility=\"hidden\";for(var o in f)if(f[a](o)){if(!c._availableAttrs[a](o))continue;var p=f[o];switch(k[o]=p,o){case\"blur\":d.blur(p);break;case\"title\":var u=i.getElementsByTagName(\"title\");if(u.length&&(u=u[0]))u.firstChild.nodeValue=p;else{u=q(\"title\");var w=c._g.doc.createTextNode(p);u.appendChild(w),i.appendChild(u)}break;case\"href\":case\"target\":var x=i.parentNode;if(\"a\"!=x.tagName.toLowerCase()){var z=q(\"a\");x.insertBefore(z,i),z.appendChild(i),x=z}\"target\"==o?x.setAttributeNS(n,\"show\",\"blank\"==p?\"new\":p):x.setAttributeNS(n,o,p);break;case\"cursor\":i.style.cursor=p;break;case\"transform\":d.transform(p);break;case\"arrow-start\":t(d,p);break;case\"arrow-end\":t(d,p,1);break;case\"clip-rect\":var A=b(p).split(j);if(4==A.length){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var B=q(\"clipPath\"),C=q(\"rect\");B.id=c.createUUID(),q(C,{x:A[0],y:A[1],width:A[2],height:A[3]}),B.appendChild(C),d.paper.defs.appendChild(B),q(i,{\"clip-path\":\"url(#\"+B.id+\")\"}),d.clip=C}if(!p){var D=i.getAttribute(\"clip-path\");if(D){var E=c._g.doc.getElementById(D.replace(/(^url\\(#|\\)$)/g,l));E&&E.parentNode.removeChild(E),q(i,{\"clip-path\":l}),delete d.clip}}break;case\"path\":\"path\"==d.type&&(q(i,{d:p?k.path=c._pathToAbsolute(p):\"M0,0\"}),d._.dirty=1,d._.arrows&&(\"startString\"in d._.arrows&&t(d,d._.arrows.startString),\"endString\"in d._.arrows&&t(d,d._.arrows.endString,1)));break;case\"width\":if(i.setAttribute(o,p),d._.dirty=1,!k.fx)break;o=\"x\",p=k.x;case\"x\":k.fx&&(p=-k.x-(k.width||0));case\"rx\":if(\"rx\"==o&&\"rect\"==d.type)break;case\"cx\":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case\"height\":if(i.setAttribute(o,p),d._.dirty=1,!k.fy)break;o=\"y\",p=k.y;case\"y\":k.fy&&(p=-k.y-(k.height||0));case\"ry\":if(\"ry\"==o&&\"rect\"==d.type)break;case\"cy\":i.setAttribute(o,p),d.pattern&&s(d),d._.dirty=1;break;case\"r\":\"rect\"==d.type?q(i,{rx:p,ry:p}):i.setAttribute(o,p),d._.dirty=1;break;case\"src\":\"image\"==d.type&&i.setAttributeNS(n,\"href\",p);break;case\"stroke-width\":(1!=d._.sx||1!=d._.sy)&&(p/=g(h(d._.sx),h(d._.sy))||1),i.setAttribute(o,p),k[\"stroke-dasharray\"]&&v(d,k[\"stroke-dasharray\"],f),d._.arrows&&(\"startString\"in d._.arrows&&t(d,d._.arrows.startString),\"endString\"in d._.arrows&&t(d,d._.arrows.endString,1));break;case\"stroke-dasharray\":v(d,p,f);break;case\"fill\":var F=b(p).match(c._ISURL);if(F){B=q(\"pattern\");var G=q(\"image\");B.id=c.createUUID(),q(B,{x:0,y:0,patternUnits:\"userSpaceOnUse\",height:1,width:1}),q(G,{x:0,y:0,\"xlink:href\":F[1]}),B.appendChild(G),function(a){c._preload(F[1],function(){var b=this.offsetWidth,c=this.offsetHeight;q(a,{width:b,height:c}),q(G,{width:b,height:c}),d.paper.safari()})}(B),d.paper.defs.appendChild(B),q(i,{fill:\"url(#\"+B.id+\")\"}),d.pattern=B,d.pattern&&s(d);break}var H=c.getRGB(p);if(H.error){if((\"circle\"==d.type||\"ellipse\"==d.type||\"r\"!=b(p).charAt())&&r(d,p)){if(\"opacity\"in k||\"fill-opacity\"in k){var I=c._g.doc.getElementById(i.getAttribute(\"fill\").replace(/^url\\(#|\\)$/g,l));if(I){var J=I.getElementsByTagName(\"stop\");q(J[J.length-1],{\"stop-opacity\":(\"opacity\"in k?k.opacity:1)*(\"fill-opacity\"in k?k[\"fill-opacity\"]:1)})}}k.gradient=p,k.fill=\"none\";break}}else delete f.gradient,delete k.gradient,!c.is(k.opacity,\"undefined\")&&c.is(f.opacity,\"undefined\")&&q(i,{opacity:k.opacity}),!c.is(k[\"fill-opacity\"],\"undefined\")&&c.is(f[\"fill-opacity\"],\"undefined\")&&q(i,{\"fill-opacity\":k[\"fill-opacity\"]});H[a](\"opacity\")&&q(i,{\"fill-opacity\":H.opacity>1?H.opacity/100:H.opacity});case\"stroke\":H=c.getRGB(p),i.setAttribute(o,H.hex),\"stroke\"==o&&H[a](\"opacity\")&&q(i,{\"stroke-opacity\":H.opacity>1?H.opacity/100:H.opacity}),\"stroke\"==o&&d._.arrows&&(\"startString\"in d._.arrows&&t(d,d._.arrows.startString),\"endString\"in d._.arrows&&t(d,d._.arrows.endString,1));break;case\"gradient\":(\"circle\"==d.type||\"ellipse\"==d.type||\"r\"!=b(p).charAt())&&r(d,p);break;\ncase\"opacity\":k.gradient&&!k[a](\"stroke-opacity\")&&q(i,{\"stroke-opacity\":p>1?p/100:p});case\"fill-opacity\":if(k.gradient){I=c._g.doc.getElementById(i.getAttribute(\"fill\").replace(/^url\\(#|\\)$/g,l)),I&&(J=I.getElementsByTagName(\"stop\"),q(J[J.length-1],{\"stop-opacity\":p}));break}default:\"font-size\"==o&&(p=e(p,10)+\"px\");var K=o.replace(/(\\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[K]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if(\"text\"==d.type&&(f[a](\"text\")||f[a](\"font\")||f[a](\"font-size\")||f[a](\"x\")||f[a](\"y\"))){var g=d.attrs,h=d.node,i=h.firstChild?e(c._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue(\"font-size\"),10):10;if(f[a](\"text\")){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var j,k=b(f.text).split(\"\\n\"),m=[],n=0,o=k.length;o>n;n++)j=q(\"tspan\"),n&&q(j,{dy:i*x,x:g.x}),j.appendChild(c._g.doc.createTextNode(k[n])),h.appendChild(j),m[n]=j}else for(m=h.getElementsByTagName(\"tspan\"),n=0,o=m.length;o>n;n++)n?q(m[n],{dy:i*x,x:g.x}):q(m[0],{dy:0});q(h,{x:g.x,y:g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&c.is(r,\"finite\")&&q(m[0],{dy:r})}},z=function(a){return a.parentNode&&\"a\"===a.parentNode.tagName.toLowerCase()?a.parentNode:a},A=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.matrix=c.matrix(),this.realPath=null,this.paper=b,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},B=c.el;A.prototype=B,B.constructor=A,c._engine.path=function(a,b){var c=q(\"path\");b.canvas&&b.canvas.appendChild(c);var d=new A(c,b);return d.type=\"path\",w(d,{fill:\"none\",stroke:\"#000\",path:a}),d},B.rotate=function(a,c,e){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this.transform(this._.transform.concat([[\"r\",a,c,e]])),this},B.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([[\"s\",a,c,e,f]])),this},B.translate=function(a,c){return this.removed?this:(a=b(a).split(j),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this.transform(this._.transform.concat([[\"t\",a,c]])),this)},B.transform=function(b){var d=this._;if(null==b)return d.transform;if(c._extractTransform(this,b),this.clip&&q(this.clip,{transform:this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{transform:this.matrix}),1!=d.sx||1!=d.sy){var e=this.attrs[a](\"stroke-width\")?this.attrs[\"stroke-width\"]:1;this.attr({\"stroke-width\":e})}return this},B.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display=\"none\"),this},B.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=\"\"),this},B.remove=function(){var a=z(this.node);if(!this.removed&&a.parentNode){var b=this.paper;b.__set__&&b.__set__.exclude(this),k.unbind(\"raphael.*.*.\"+this.id),this.gradient&&b.defs.removeChild(this.gradient),c._tear(this,b),a.parentNode.removeChild(a),this.removeData();for(var d in this)this[d]=\"function\"==typeof this[d]?c._removedFactory(d):null;this.removed=!0}},B._getBBox=function(){if(\"none\"==this.node.style.display){this.show();var a=!0}var b,c=!1;this.paper.canvas.parentElement?b=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(b=this.paper.canvas.parentNode.style),b&&\"none\"==b.display&&(c=!0,b.display=\"\");var d={};try{d=this.node.getBBox()}catch(e){d={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{d=d||{},c&&(b.display=\"none\")}return a&&this.hide(),d},B.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&\"none\"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,\"string\")){if(\"fill\"==b&&\"none\"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if(\"transform\"==b)return this._.transform;for(var g=b.split(j),h={},i=0,l=g.length;l>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],\"function\")?this.paper.customAttributes[b].def:c._availableAttrs[b];return l-1?h:h[g[0]]}if(null==d&&c.is(b,\"array\")){for(h={},i=0,l=b.length;l>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var m={};m[b]=d}else null!=b&&c.is(b,\"object\")&&(m=b);for(var n in m)k(\"raphael.attr.\"+n+\".\"+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[a](n)&&m[a](n)&&c.is(this.paper.customAttributes[n],\"function\")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[a](p)&&(m[p]=o[p])}return w(this,m),this},B.toFront=function(){if(this.removed)return this;var a=z(this.node);a.parentNode.appendChild(a);var b=this.paper;return b.top!=this&&c._tofront(this,b),this},B.toBack=function(){if(this.removed)return this;var a=z(this.node),b=a.parentNode;b.insertBefore(a,b.firstChild),c._toback(this,this.paper);this.paper;return this},B.insertAfter=function(a){if(this.removed||!a)return this;var b=z(this.node),d=z(a.node||a[a.length-1].node);return d.nextSibling?d.parentNode.insertBefore(b,d.nextSibling):d.parentNode.appendChild(b),c._insertafter(this,a,this.paper),this},B.insertBefore=function(a){if(this.removed||!a)return this;var b=z(this.node),d=z(a.node||a[0].node);return d.parentNode.insertBefore(b,d),c._insertbefore(this,a,this.paper),this},B.blur=function(a){var b=this;if(0!==+a){var d=q(\"filter\"),e=q(\"feGaussianBlur\");b.attrs.blur=a,d.id=c.createUUID(),q(e,{stdDeviation:+a||1.5}),d.appendChild(e),b.paper.defs.appendChild(d),b._blur=d,q(b.node,{filter:\"url(#\"+d.id+\")\"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute(\"filter\");return b},c._engine.circle=function(a,b,c,d){var e=q(\"circle\");a.canvas&&a.canvas.appendChild(e);var f=new A(e,a);return f.attrs={cx:b,cy:c,r:d,fill:\"none\",stroke:\"#000\"},f.type=\"circle\",q(e,f.attrs),f},c._engine.rect=function(a,b,c,d,e,f){var g=q(\"rect\");a.canvas&&a.canvas.appendChild(g);var h=new A(g,a);return h.attrs={x:b,y:c,width:d,height:e,rx:f||0,ry:f||0,fill:\"none\",stroke:\"#000\"},h.type=\"rect\",q(g,h.attrs),h},c._engine.ellipse=function(a,b,c,d,e){var f=q(\"ellipse\");a.canvas&&a.canvas.appendChild(f);var g=new A(f,a);return g.attrs={cx:b,cy:c,rx:d,ry:e,fill:\"none\",stroke:\"#000\"},g.type=\"ellipse\",q(f,g.attrs),g},c._engine.image=function(a,b,c,d,e,f){var g=q(\"image\");q(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:\"none\"}),g.setAttributeNS(n,\"href\",b),a.canvas&&a.canvas.appendChild(g);var h=new A(g,a);return h.attrs={x:c,y:d,width:e,height:f,src:b},h.type=\"image\",h},c._engine.text=function(a,b,d,e){var f=q(\"text\");a.canvas&&a.canvas.appendChild(f);var g=new A(f,a);return g.attrs={x:b,y:d,\"text-anchor\":\"middle\",text:e,\"font-family\":c._availableAttrs[\"font-family\"],\"font-size\":c._availableAttrs[\"font-size\"],stroke:\"none\",fill:\"#000\"},g.type=\"text\",w(g,g.attrs),g},c._engine.setSize=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute(\"width\",this.width),this.canvas.setAttribute(\"height\",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a&&a.container,d=a.x,e=a.y,f=a.width,g=a.height;if(!b)throw new Error(\"SVG container not found.\");var h,i=q(\"svg\"),j=\"overflow:hidden;\";return d=d||0,e=e||0,f=f||512,g=g||342,q(i,{height:g,version:1.1,width:f,xmlns:\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\"}),1==b?(i.style.cssText=j+\"position:absolute;left:\"+d+\"px;top:\"+e+\"px\",c._g.doc.body.appendChild(i),h=1):(i.style.cssText=j+\"position:relative\",b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i)),b=new c._Paper,b.width=f,b.height=g,b.canvas=i,b.clear(),b._left=b._top=0,h&&(b.renderfix=function(){}),b.renderfix(),b},c._engine.setViewBox=function(a,b,c,d,e){k(\"raphael.setViewBox\",this,this._viewBox,[a,b,c,d,e]);var f,h,i=this.getSize(),j=g(c/i.width,d/i.height),l=this.top,n=e?\"xMidYMid meet\":\"xMinYMin\";for(null==a?(this._vbSize&&(j=1),delete this._vbSize,f=\"0 0 \"+this.width+m+this.height):(this._vbSize=j,f=a+m+b+m+c+m+d),q(this.canvas,{viewBox:f,preserveAspectRatio:n});j&&l;)h=\"stroke-width\"in l.attrs?l.attrs[\"stroke-width\"]:1,l.attr({\"stroke-width\":h}),l._.dirty=1,l._.dirtyT=1,l=l.prev;return this._viewBox=[a,b,c,d,!!e],this},c.prototype.renderfix=function(){var a,b=this.canvas,c=b.style;try{a=b.getScreenCTM()||b.createSVGMatrix()}catch(d){a=b.createSVGMatrix()}var e=-a.e%1,f=-a.f%1;(e||f)&&(e&&(this._left=(this._left+e)%1,c.left=this._left+\"px\"),f&&(this._top=(this._top+f)%1,c.top=this._top+\"px\"))},c.prototype.clear=function(){c.eve(\"raphael.clear\",this);for(var a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=q(\"desc\")).appendChild(c._g.doc.createTextNode(\"Created with Raphaël \"+c.version)),a.appendChild(this.desc),a.appendChild(this.defs=q(\"defs\"))},c.prototype.remove=function(){k(\"raphael.remove\",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=\"function\"==typeof this[a]?c._removedFactory(a):null};var C=c.st;for(var D in B)B[a](D)&&!C[a](D)&&(C[D]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(D))}}(),function(){if(c.vml){var a=\"hasOwnProperty\",b=String,d=parseFloat,e=Math,f=e.round,g=e.max,h=e.min,i=e.abs,j=\"fill\",k=/[, ]+/,l=c.eve,m=\" progid:DXImageTransform.Microsoft\",n=\" \",o=\"\",p={M:\"m\",L:\"l\",C:\"c\",Z:\"x\",m:\"t\",l:\"r\",c:\"v\",z:\"x\"},q=/([clmz]),?([^clmz]*)/gi,r=/ progid:\\S+Blur\\([^\\)]+\\)/g,s=/-?[^,\\s-]+/g,t=\"position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)\",u=21600,v={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(a){var d=/[ahqstv]/gi,e=c._pathToAbsolute;if(b(a).match(d)&&(e=c._path2curve),d=/[clmz]/g,e==c._pathToAbsolute&&!b(a).match(d)){var g=b(a).replace(q,function(a,b,c){var d=[],e=\"m\"==b.toLowerCase(),g=p[b];return c.replace(s,function(a){e&&2==d.length&&(g+=d+p[\"m\"==b?\"l\":\"L\"],d=[]),d.push(f(a*u))}),g+d});return g}var h,i,j=e(a);g=[];for(var k=0,l=j.length;l>k;k++){h=j[k],i=j[k][0].toLowerCase(),\"z\"==i&&(i=\"x\");for(var m=1,r=h.length;r>m;m++)i+=f(h[m]*u)+(m!=r-1?\",\":o);g.push(i)}return g.join(n)},y=function(a,b,d){var e=c.matrix();return e.rotate(-a,.5,.5),{dx:e.x(b,d),dy:e.y(b,d)}},z=function(a,b,c,d,e,f){var g=a._,h=a.matrix,k=g.fillpos,l=a.node,m=l.style,o=1,p=\"\",q=u/b,r=u/c;if(m.visibility=\"hidden\",b&&c){if(l.coordsize=i(q)+n+i(r),m.rotation=f*(0>b*c?-1:1),f){var s=y(f,d,e);d=s.dx,e=s.dy}if(0>b&&(p+=\"x\"),0>c&&(p+=\" y\")&&(o=-1),m.flip=p,l.coordorigin=d*-q+n+e*-r,k||g.fillsize){var t=l.getElementsByTagName(j);t=t&&t[0],l.removeChild(t),k&&(s=y(f,h.x(k[0],k[1]),h.y(k[0],k[1])),t.position=s.dx*o+n+s.dy*o),g.fillsize&&(t.size=g.fillsize[0]*i(b)+n+g.fillsize[1]*i(c)),l.appendChild(t)}m.visibility=\"visible\"}};c.toString=function(){return\"Your browser doesn’t support SVG. Falling down to VML.\\nYou are running Raphaël \"+this.version};var A=function(a,c,d){for(var e=b(c).toLowerCase().split(\"-\"),f=d?\"end\":\"start\",g=e.length,h=\"classic\",i=\"medium\",j=\"medium\";g--;)switch(e[g]){case\"block\":case\"classic\":case\"oval\":case\"diamond\":case\"open\":case\"none\":h=e[g];break;case\"wide\":case\"narrow\":j=e[g];break;case\"long\":case\"short\":i=e[g]}var k=a.node.getElementsByTagName(\"stroke\")[0];k[f+\"arrow\"]=h,k[f+\"arrowlength\"]=i,k[f+\"arrowwidth\"]=j},B=function(e,i){e.attrs=e.attrs||{};var l=e.node,m=e.attrs,p=l.style,q=v[e.type]&&(i.x!=m.x||i.y!=m.y||i.width!=m.width||i.height!=m.height||i.cx!=m.cx||i.cy!=m.cy||i.rx!=m.rx||i.ry!=m.ry||i.r!=m.r),r=w[e.type]&&(m.cx!=i.cx||m.cy!=i.cy||m.r!=i.r||m.rx!=i.rx||m.ry!=i.ry),s=e;for(var t in i)i[a](t)&&(m[t]=i[t]);if(q&&(m.path=c._getPath[e.type](e),e._.dirty=1),i.href&&(l.href=i.href),i.title&&(l.title=i.title),i.target&&(l.target=i.target),i.cursor&&(p.cursor=i.cursor),\"blur\"in i&&e.blur(i.blur),(i.path&&\"path\"==e.type||q)&&(l.path=x(~b(m.path).toLowerCase().indexOf(\"r\")?c._pathToAbsolute(m.path):m.path),e._.dirty=1,\"image\"==e.type&&(e._.fillpos=[m.x,m.y],e._.fillsize=[m.width,m.height],z(e,1,1,0,0,0))),\"transform\"in i&&e.transform(i.transform),r){var y=+m.cx,B=+m.cy,D=+m.rx||+m.r||0,E=+m.ry||+m.r||0;l.path=c.format(\"ar{0},{1},{2},{3},{4},{1},{4},{1}x\",f((y-D)*u),f((B-E)*u),f((y+D)*u),f((B+E)*u),f(y*u)),e._.dirty=1}if(\"clip-rect\"in i){var G=b(i[\"clip-rect\"]).split(k);if(4==G.length){G[2]=+G[2]+ +G[0],G[3]=+G[3]+ +G[1];var H=l.clipRect||c._g.doc.createElement(\"div\"),I=H.style;I.clip=c.format(\"rect({1}px {2}px {3}px {0}px)\",G),l.clipRect||(I.position=\"absolute\",I.top=0,I.left=0,I.width=e.paper.width+\"px\",I.height=e.paper.height+\"px\",l.parentNode.insertBefore(H,l),H.appendChild(l),l.clipRect=H)}i[\"clip-rect\"]||l.clipRect&&(l.clipRect.style.clip=\"auto\")}if(e.textpath){var J=e.textpath.style;i.font&&(J.font=i.font),i[\"font-family\"]&&(J.fontFamily='\"'+i[\"font-family\"].split(\",\")[0].replace(/^['\"]+|['\"]+$/g,o)+'\"'),i[\"font-size\"]&&(J.fontSize=i[\"font-size\"]),i[\"font-weight\"]&&(J.fontWeight=i[\"font-weight\"]),i[\"font-style\"]&&(J.fontStyle=i[\"font-style\"])}if(\"arrow-start\"in i&&A(s,i[\"arrow-start\"]),\"arrow-end\"in i&&A(s,i[\"arrow-end\"],1),null!=i.opacity||null!=i[\"stroke-width\"]||null!=i.fill||null!=i.src||null!=i.stroke||null!=i[\"stroke-width\"]||null!=i[\"stroke-opacity\"]||null!=i[\"fill-opacity\"]||null!=i[\"stroke-dasharray\"]||null!=i[\"stroke-miterlimit\"]||null!=i[\"stroke-linejoin\"]||null!=i[\"stroke-linecap\"]){var K=l.getElementsByTagName(j),L=!1;if(K=K&&K[0],!K&&(L=K=F(j)),\"image\"==e.type&&i.src&&(K.src=i.src),i.fill&&(K.on=!0),(null==K.on||\"none\"==i.fill||null===i.fill)&&(K.on=!1),K.on&&i.fill){var M=b(i.fill).match(c._ISURL);if(M){K.parentNode==l&&l.removeChild(K),K.rotate=!0,K.src=M[1],K.type=\"tile\";var N=e.getBBox(1);K.position=N.x+n+N.y,e._.fillpos=[N.x,N.y],c._preload(M[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else K.color=c.getRGB(i.fill).hex,K.src=o,K.type=\"solid\",c.getRGB(i.fill).error&&(s.type in{circle:1,ellipse:1}||\"r\"!=b(i.fill).charAt())&&C(s,i.fill,K)&&(m.fill=\"none\",m.gradient=i.fill,K.rotate=!1)}if(\"fill-opacity\"in i||\"opacity\"in i){var O=((+m[\"fill-opacity\"]+1||2)-1)*((+m.opacity+1||2)-1)*((+c.getRGB(i.fill).o+1||2)-1);O=h(g(O,0),1),K.opacity=O,K.src&&(K.color=\"none\")}l.appendChild(K);var P=l.getElementsByTagName(\"stroke\")&&l.getElementsByTagName(\"stroke\")[0],Q=!1;!P&&(Q=P=F(\"stroke\")),(i.stroke&&\"none\"!=i.stroke||i[\"stroke-width\"]||null!=i[\"stroke-opacity\"]||i[\"stroke-dasharray\"]||i[\"stroke-miterlimit\"]||i[\"stroke-linejoin\"]||i[\"stroke-linecap\"])&&(P.on=!0),(\"none\"==i.stroke||null===i.stroke||null==P.on||0==i.stroke||0==i[\"stroke-width\"])&&(P.on=!1);var R=c.getRGB(i.stroke);P.on&&i.stroke&&(P.color=R.hex),O=((+m[\"stroke-opacity\"]+1||2)-1)*((+m.opacity+1||2)-1)*((+R.o+1||2)-1);var S=.75*(d(i[\"stroke-width\"])||1);if(O=h(g(O,0),1),null==i[\"stroke-width\"]&&(S=m[\"stroke-width\"]),i[\"stroke-width\"]&&(P.weight=S),S&&1>S&&(O*=S)&&(P.weight=1),P.opacity=O,i[\"stroke-linejoin\"]&&(P.joinstyle=i[\"stroke-linejoin\"]||\"miter\"),P.miterlimit=i[\"stroke-miterlimit\"]||8,i[\"stroke-linecap\"]&&(P.endcap=\"butt\"==i[\"stroke-linecap\"]?\"flat\":\"square\"==i[\"stroke-linecap\"]?\"square\":\"round\"),\"stroke-dasharray\"in i){var T={\"-\":\"shortdash\",\".\":\"shortdot\",\"-.\":\"shortdashdot\",\"-..\":\"shortdashdotdot\",\". \":\"dot\",\"- \":\"dash\",\"--\":\"longdash\",\"- .\":\"dashdot\",\"--.\":\"longdashdot\",\"--..\":\"longdashdotdot\"};P.dashstyle=T[a](i[\"stroke-dasharray\"])?T[i[\"stroke-dasharray\"]]:o}Q&&l.appendChild(P)}if(\"text\"==s.type){s.paper.canvas.style.display=o;var U=s.paper.span,V=100,W=m.font&&m.font.match(/\\d+(?:\\.\\d*)?(?=px)/);p=U.style,m.font&&(p.font=m.font),m[\"font-family\"]&&(p.fontFamily=m[\"font-family\"]),m[\"font-weight\"]&&(p.fontWeight=m[\"font-weight\"]),m[\"font-style\"]&&(p.fontStyle=m[\"font-style\"]),W=d(m[\"font-size\"]||W&&W[0])||10,p.fontSize=W*V+\"px\",s.textpath.string&&(U.innerHTML=b(s.textpath.string).replace(/</g,\"&#60;\").replace(/&/g,\"&#38;\").replace(/\\n/g,\"<br>\"));var X=U.getBoundingClientRect();s.W=m.w=(X.right-X.left)/V,s.H=m.h=(X.bottom-X.top)/V,s.X=m.x,s.Y=m.y+s.H/2,(\"x\"in i||\"y\"in i)&&(s.path.v=c.format(\"m{0},{1}l{2},{1}\",f(m.x*u),f(m.y*u),f(m.x*u)+1));for(var Y=[\"x\",\"y\",\"text\",\"font\",\"font-family\",\"font-weight\",\"font-style\",\"font-size\"],Z=0,$=Y.length;$>Z;Z++)if(Y[Z]in i){s._.dirty=1;break}switch(m[\"text-anchor\"]){case\"start\":s.textpath.style[\"v-text-align\"]=\"left\",s.bbx=s.W/2;break;case\"end\":s.textpath.style[\"v-text-align\"]=\"right\",s.bbx=-s.W/2;break;default:s.textpath.style[\"v-text-align\"]=\"center\",s.bbx=0}s.textpath.style[\"v-text-kern\"]=!0}},C=function(a,f,g){a.attrs=a.attrs||{};var h=(a.attrs,Math.pow),i=\"linear\",j=\".5 .5\";if(a.attrs.gradient=f,f=b(f).replace(c._radial_gradient,function(a,b,c){return i=\"radial\",b&&c&&(b=d(b),c=d(c),h(b-.5,2)+h(c-.5,2)>.25&&(c=e.sqrt(.25-h(b-.5,2))*(2*(c>.5)-1)+.5),j=b+n+c),o}),f=f.split(/\\s*\\-\\s*/),\"linear\"==i){var k=f.shift();if(k=-d(k),isNaN(k))return null}var l=c._parseDots(f);if(!l)return null;if(a=a.shape||a.node,l.length){a.removeChild(g),g.on=!0,g.method=\"none\",g.color=l[0].color,g.color2=l[l.length-1].color;for(var m=[],p=0,q=l.length;q>p;p++)l[p].offset&&m.push(l[p].offset+n+l[p].color);g.colors=m.length?m.join():\"0% \"+g.color,\"radial\"==i?(g.type=\"gradientTitle\",g.focus=\"100%\",g.focussize=\"0 0\",g.focusposition=j,g.angle=0):(g.type=\"gradient\",g.angle=(270-k)%360),a.appendChild(g)}return 1},D=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=b,this.matrix=c.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},E=c.el;D.prototype=E,E.constructor=D,E.transform=function(a){if(null==a)return this._.transform;var d,e=this.paper._viewBoxShift,f=e?\"s\"+[e.scale,e.scale]+\"-1-1t\"+[e.dx,e.dy]:o;e&&(d=a=b(a).replace(/\\.{3}|\\u2026/g,this._.transform||o)),c._extractTransform(this,f+a);var g,h=this.matrix.clone(),i=this.skew,j=this.node,k=~b(this.attrs.fill).indexOf(\"-\"),l=!b(this.attrs.fill).indexOf(\"url(\");if(h.translate(1,1),l||k||\"image\"==this.type)if(i.matrix=\"1 0 0 1\",i.offset=\"0 0\",g=h.split(),k&&g.noRotation||!g.isSimple){j.style.filter=h.toFilter();var m=this.getBBox(),p=this.getBBox(1),q=m.x-p.x,r=m.y-p.y;j.coordorigin=q*-u+n+r*-u,z(this,1,1,q,r,0)}else j.style.filter=o,z(this,g.scalex,g.scaley,g.dx,g.dy,g.rotate);else j.style.filter=o,i.matrix=b(h),i.offset=h.offset();return null!==d&&(this._.transform=d,c._extractTransform(this,d)),this},E.rotate=function(a,c,e){if(this.removed)return this;if(null!=a){if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([[\"r\",a,c,e]])),this}},E.translate=function(a,c){return this.removed?this:(a=b(a).split(k),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=c),this.transform(this._.transform.concat([[\"t\",a,c]])),this)},E.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([[\"s\",a,c,e,f]])),this._.dirtyT=1,this},E.hide=function(){return!this.removed&&(this.node.style.display=\"none\"),this},E.show=function(){return!this.removed&&(this.node.style.display=o),this},E.auxGetBBox=c.el.getBBox,E.getBBox=function(){var a=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var b={},c=1/this.paper._viewBoxShift.scale;return b.x=a.x-this.paper._viewBoxShift.dx,b.x*=c,b.y=a.y-this.paper._viewBoxShift.dy,b.y*=c,b.width=a.width*c,b.height=a.height*c,b.x2=b.x+b.width,b.y2=b.y+b.height,b}return a},E._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},E.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),c.eve.unbind(\"raphael.*.*.\"+this.id),c._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)this[a]=\"function\"==typeof this[a]?c._removedFactory(a):null;this.removed=!0}},E.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&\"none\"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,\"string\")){if(b==j&&\"none\"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var g=b.split(k),h={},i=0,m=g.length;m>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],\"function\")?this.paper.customAttributes[b].def:c._availableAttrs[b];return m-1?h:h[g[0]]}if(this.attrs&&null==d&&c.is(b,\"array\")){for(h={},i=0,m=b.length;m>i;i++)h[b[i]]=this.attr(b[i]);return h}var n;null!=d&&(n={},n[b]=d),null==d&&c.is(b,\"object\")&&(n=b);for(var o in n)l(\"raphael.attr.\"+o+\".\"+this.id,this,n[o]);if(n){for(o in this.paper.customAttributes)if(this.paper.customAttributes[a](o)&&n[a](o)&&c.is(this.paper.customAttributes[o],\"function\")){var p=this.paper.customAttributes[o].apply(this,[].concat(n[o]));this.attrs[o]=n[o];for(var q in p)p[a](q)&&(n[q]=p[q])}n.text&&\"text\"==this.type&&(this.textpath.string=n.text),B(this,n)}return this},E.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&c._tofront(this,this.paper),this},E.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),c._toback(this,this.paper)),this)},E.insertAfter=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[a.length-1]),a.node.nextSibling?a.node.parentNode.insertBefore(this.node,a.node.nextSibling):a.node.parentNode.appendChild(this.node),c._insertafter(this,a,this.paper),this)},E.insertBefore=function(a){return this.removed?this:(a.constructor==c.st.constructor&&(a=a[0]),a.node.parentNode.insertBefore(this.node,a.node),c._insertbefore(this,a,this.paper),this)},E.blur=function(a){var b=this.node.runtimeStyle,d=b.filter;return d=d.replace(r,o),0!==+a?(this.attrs.blur=a,b.filter=d+n+m+\".Blur(pixelradius=\"+(+a||1.5)+\")\",b.margin=c.format(\"-{0}px 0 0 -{0}px\",f(+a||1.5))):(b.filter=d,b.margin=0,delete this.attrs.blur),this},c._engine.path=function(a,b){var c=F(\"shape\");c.style.cssText=t,c.coordsize=u+n+u,c.coordorigin=b.coordorigin;var d=new D(c,b),e={fill:\"none\",stroke:\"#000\"};a&&(e.path=a),d.type=\"path\",d.path=[],d.Path=o,B(d,e),b.canvas.appendChild(c);var f=F(\"skew\");return f.on=!0,c.appendChild(f),d.skew=f,d.transform(o),d},c._engine.rect=function(a,b,d,e,f,g){var h=c._rectPath(b,d,e,f,g),i=a.path(h),j=i.attrs;return i.X=j.x=b,i.Y=j.y=d,i.W=j.width=e,i.H=j.height=f,j.r=g,j.path=h,i.type=\"rect\",i},c._engine.ellipse=function(a,b,c,d,e){{var f=a.path();f.attrs}return f.X=b-d,f.Y=c-e,f.W=2*d,f.H=2*e,f.type=\"ellipse\",B(f,{cx:b,cy:c,rx:d,ry:e}),f},c._engine.circle=function(a,b,c,d){{var e=a.path();e.attrs}return e.X=b-d,e.Y=c-d,e.W=e.H=2*d,e.type=\"circle\",B(e,{cx:b,cy:c,r:d}),e},c._engine.image=function(a,b,d,e,f,g){var h=c._rectPath(d,e,f,g),i=a.path(h).attr({stroke:\"none\"}),k=i.attrs,l=i.node,m=l.getElementsByTagName(j)[0];return k.src=b,i.X=k.x=d,i.Y=k.y=e,i.W=k.width=f,i.H=k.height=g,k.path=h,i.type=\"image\",m.parentNode==l&&l.removeChild(m),m.rotate=!0,m.src=b,m.type=\"tile\",i._.fillpos=[d,e],i._.fillsize=[f,g],l.appendChild(m),z(i,1,1,0,0,0),i},c._engine.text=function(a,d,e,g){var h=F(\"shape\"),i=F(\"path\"),j=F(\"textpath\");d=d||0,e=e||0,g=g||\"\",i.v=c.format(\"m{0},{1}l{2},{1}\",f(d*u),f(e*u),f(d*u)+1),i.textpathok=!0,j.string=b(g),j.on=!0,h.style.cssText=t,h.coordsize=u+n+u,h.coordorigin=\"0 0\";var k=new D(h,a),l={fill:\"#000\",stroke:\"none\",font:c._availableAttrs.font,text:g};k.shape=h,k.path=i,k.textpath=j,k.type=\"text\",k.attrs.text=b(g),k.attrs.x=d,k.attrs.y=e,k.attrs.w=1,k.attrs.h=1,B(k,l),h.appendChild(j),h.appendChild(i),a.canvas.appendChild(h);var m=F(\"skew\");return m.on=!0,h.appendChild(m),k.skew=m,k.transform(o),k},c._engine.setSize=function(a,b){var d=this.canvas.style;return this.width=a,this.height=b,a==+a&&(a+=\"px\"),b==+b&&(b+=\"px\"),d.width=a,d.height=b,d.clip=\"rect(0 \"+a+\" \"+b+\" 0)\",this._viewBox&&c._engine.setViewBox.apply(this,this._viewBox),this},c._engine.setViewBox=function(a,b,d,e,f){c.eve(\"raphael.setViewBox\",this,this._viewBox,[a,b,d,e,f]);var g,h,i=this.getSize(),j=i.width,k=i.height;return f&&(g=k/e,h=j/d,j>d*g&&(a-=(j-d*g)/2/g),k>e*h&&(b-=(k-e*h)/2/h)),this._viewBox=[a,b,d,e,!!f],this._viewBoxShift={dx:-a,dy:-b,scale:i},this.forEach(function(a){a.transform(\"...\")}),this};var F;c._engine.initWin=function(a){var b=a.document;b.styleSheets.length<31?b.createStyleSheet().addRule(\".rvml\",\"behavior:url(#default#VML)\"):b.styleSheets[0].addRule(\".rvml\",\"behavior:url(#default#VML)\");try{!b.namespaces.rvml&&b.namespaces.add(\"rvml\",\"urn:schemas-microsoft-com:vml\"),F=function(a){return b.createElement(\"<rvml:\"+a+' class=\"rvml\">')}}catch(c){F=function(a){return b.createElement(\"<\"+a+' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"rvml\">')}}},c._engine.initWin(c._g.win),c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a.container,d=a.height,e=a.width,f=a.x,g=a.y;if(!b)throw new Error(\"VML container not found.\");var h=new c._Paper,i=h.canvas=c._g.doc.createElement(\"div\"),j=i.style;return f=f||0,g=g||0,e=e||512,d=d||342,h.width=e,h.height=d,e==+e&&(e+=\"px\"),d==+d&&(d+=\"px\"),h.coordsize=1e3*u+n+1e3*u,h.coordorigin=\"0 0\",h.span=c._g.doc.createElement(\"span\"),h.span.style.cssText=\"position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;\",i.appendChild(h.span),j.cssText=c.format(\"top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden\",e,d),1==b?(c._g.doc.body.appendChild(i),j.left=f+\"px\",j.top=g+\"px\",j.position=\"absolute\"):b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i),h.renderfix=function(){},h},c.prototype.clear=function(){c.eve(\"raphael.clear\",this),this.canvas.innerHTML=o,this.span=c._g.doc.createElement(\"span\"),this.span.style.cssText=\"position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;\",this.canvas.appendChild(this.span),this.bottom=this.top=null},c.prototype.remove=function(){c.eve(\"raphael.remove\",this),this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=\"function\"==typeof this[a]?c._removedFactory(a):null;return!0};var G=c.st;for(var H in E)E[a](H)&&!G[a](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}(),B.was?A.win.Raphael=c:Raphael=c,\"object\"==typeof exports&&(module.exports=c),c});"
  },
  {
    "path": "rtc/whiteboard/src/js/raphael.inline_text_editing.js",
    "content": "/*\n * Inline text editing tool for Raphaël 2.0 & compatible with Raphaël Free transform.\n * Source: https://github.com/marmelab/Raphael.InlineTextEditing\n * Licensed under the MIT license\n */\n(function (root, factory) {\n    if (typeof define === \"function\" && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([\"raphael\"], function(Raphael) {\n            // Use global variables if the locals are undefined.\n            return factory(Raphael || root.Raphael);\n        });\n    } else {\n        // RequireJS isn't being used. Assume Raphael is loaded in <script> tag\n        factory(Raphael);\n    }\n}(this, function(Raphael) {\n\n    Raphael.fn.inlineTextEditing = function(subject, options, callback) {\n\n        // Store instance of the Raphael paper\n        var paper = this;\n\n        subject.inlineTextEditing = {\n            paper : paper,\n            input: null,\n\n            /**\n             * Start text editing by hiding the current element and adding a text field at the same position\n             * @return jQuery input element\n             */\n            startEditing: function(){\n                // Store Raphael container above the svg\n                var container      = this.paper.canvas.parentNode;\n                var translateX\t    = 0;\n                var translateY\t    = 0;\n                var transformOrder  = {};\n\n                // Retrieve element transformation\n                var rotation        = subject._.deg;\n                var scaleX          = subject._.sx;\n                var scaleY          = subject._.sy;\n                var matrix          = subject.node.getAttribute('transform');\n\n                // Check if the element has translations & retrieve transformations order\n                for(var i = 0, length = subject._.transform.length; i < length; i++){\n                    var matrixComponents = subject._.transform[i];\n                    var transform = matrixComponents[0].toLowerCase();\n                    transformOrder[transform] = transform;\n\n                    if(transform == 't'){\n                        translateX += matrixComponents[1];\n                        translateY += matrixComponents[2];\n                    }\n                }\n\n\n                // Check if there is implicit matrix\n                for(var i = 0, length = subject._.transform.length; i < length; i++){\n                    if(subject._.transform[i][0].toLowerCase() == 'm'){\n                        var matrixComponents = subject._.transform[i].slice(1);\n\n                        // Perform transformation from matrix elements\n                        rotation  += -1 * Math.asin(matrixComponents[2]) * 180 / Math.PI;\n                        scaleX    *= matrixComponents[0] / Math.cos(rotation*Math.PI/180);\n                        scaleY    *= matrixComponents[3] / Math.cos(rotation*Math.PI/180);\n\n                        transformOrder = {r: 'r', s:'s'};\n                    }\n                }\n\n                // Remove transformation on the current element to retrieve original dimension\n                subject.node.removeAttribute('transform');\n\n                var originalBbox  = subject._getBBox();\n                var width         = originalBbox.width + 20;\n                var height        = originalBbox.height + 20;\n                var x             = container.offsetLeft + subject.attrs.x + translateX;\n                var y             = container.offsetTop + subject.attrs.y - height / 2 + translateY;\n                var sTransform    = '';\n                var sOrigin       = 'center center';\n                var oTransform    = {\n                    //\tt : 'translate('+(translateX)+'px, '+(translateY)+'px)',\n                    r : 'rotate('+rotation+'deg)',\n                    s : 'scale('+scaleX+', '+scaleY+')'\n                };\n\n                // Build transform CSS property in the same order than the element\n                for(var transform in transformOrder){\n                    if(oTransform[transform] != undefined){\n                        sTransform += oTransform[transform] + ' ';\n                    }\n                }\n\n                // Re-apply stored transformation to the element and hide it\n                if (matrix) {\n                    subject.node.setAttribute(\"transform\", matrix);\n                }\n                subject.hide();\n\n                // Prepare input styles\n                var oStyles = {\n                    position: 'absolute',\n                    background: 'none',\n                    padding: \"9px\",\n                    left: x+'px',\n                    top: y+'px',\n                    width: width+'px',\n                    height: height+'px',\n                    color: subject.attrs.fill,\n                    resize: 'none',\n                    border: 'none',\n                    overflow: 'auto',\n                    \"min-width\": \"200px\",\n                    \"min-height\": \"100px\",\n\n                    '-moz-transform-origin': sOrigin,\n                    '-ms-transform-origin': sOrigin,\n                    '-o-transform-origin': sOrigin,\n                    '-webkit-transform-origin': sOrigin,\n                    'transform-origin': sOrigin,\n\n                    '-moz-transform' : sTransform,\n                    '-ms-transform' : sTransform,\n                    '-o-transform' : sTransform,\n                    '-webkit-transform' : sTransform,\n                    'transform' : sTransform\n                };\n\n                // Retrieve font styles\n                var aFontAttributes = ['font', 'font-family', 'font-size', 'font-style', 'font-weight', 'font-variant'/*, 'line-height'*/];\n\n                for(var i = 0, length = aFontAttributes.length; i < length; i++){\n                    var attribute = aFontAttributes[i];\n\n                    if(subject.attrs[attribute] != undefined){\n                        oStyles[attribute] = subject.attrs[attribute];\n                    }\n\n                    if(subject.node.style[attribute] != undefined){\n                        oStyles[attribute] = subject.node.style[attribute];\n                    }\n                }\n\n                var sStyles = '';\n                for(var z in oStyles){\n                    sStyles += z + ':' + oStyles[z] + ';';\n                }\n\n                // Create an input element with theses styles\n                this.input = document.createElement(\"textarea\");\n                this.input.value = subject.attrs.text ? subject.attrs.text.replace(/\\'/g,\"\\\\\\'\") : '';\n                this.input.setAttribute(\"style\", sStyles);\n                this.input.setAttribute(\"placeholder\", \"Adding text here\");\n\n                this.input.addEventListener('keyup', this._handleKeyDown.bind(this));\n\n                // Add the input in the container and apply focus on it\n                container.appendChild(this.input);\n                this.input.focus();\n\n                return this.input;\n            },\n\n            autoEditing: function(value) {\n                this.startEditing();\n                this.input.value = value;\n                this._handleKeyDown(null);\n                this.stopEditing();\n            },\n\n            /**\n             * Apply text modification and remove associated input\n             */\n            stopEditing: function(){\n\n                // Set the new the value\n                subject.attr(\"text\", this.input.value);\n\n                // Show the text element\n                subject.show();\n\n                // Remove text input\n                this.input.parentNode.removeChild(this.input);\n            },\n\n            _handleKeyDown: function(e) {\n                var text              = this.input.value;\n                // we only allow user enter less than 250 characters.\n                if (text.length >= 100) {\n                    text = text.substring(0, 100);\n                    this.input.value = text;\n                    return;\n                }\n                var tmp               = document.createElement(\"span\");\n                tmp.setAttribute('style', this.input.style.cssText);\n                tmp.style.height      = null;\n                tmp.style.width       = null;\n                tmp.style.visibility  = 'hidden';\n                tmp.innerHTML         = text.split('\\n').join('<br />');\n\n                this.input.parentNode.appendChild(tmp);\n\n                this.input.style.width = tmp.offsetWidth + 20 + \"px\";\n                this.input.style.height = tmp.offsetHeight + 20 + \"px\";\n\n                tmp.parentNode.removeChild(tmp);\n            }\n        };\n\n        return subject.inlineTextEditing;\n    }\n\n}));\n"
  },
  {
    "path": "rtc/whiteboard/src/resources/localeinfo.json",
    "content": "{\r\n\t\"clock\": \"12\",\r\n\t\"language.name\": \"English\",\r\n\t\"numfmt\": {\r\n\t\t\"decimalChar\": \".\",\r\n\t\t\"groupChar\": \",\",\r\n\t\t\"currencyFormats\": {\r\n\t\t\t\"commonNegative\": \"({s}{n})\"\r\n\t\t}\r\n\t},\r\n\t\"scripts\": [\r\n\t\t\"Latn\",\r\n\t\t\"Dsrt\",\r\n\t\t\"Shaw\"\r\n\t],\r\n\t\"locale\": \"en\"\r\n}\r\n"
  },
  {
    "path": "rtc/whiteboard/src/resources/strings.json",
    "content": "{\r\n\t\"App\": \"应用\",\r\n\t\"Page {n}\": \"第{n}页\",\r\n\t\"Logout\": \"注销\",\r\n\t\"Upload\": \"上传\",\r\n\t\"New Page\": \"新页面\",\r\n\t\"Attach a file or create a new page.\": \"上传文件或者创建新页面\",\r\n\t\"Preview Pages\": \"预览页面\",\r\n\t\"Zoom In\": \"放大\",\r\n\t\"Zoom Out\": \"缩小\",\r\n\t\"Delete Page\": \"删除页面\",\r\n\t\"Clear Page\": \"清除页面\",\r\n\t\"Eraser\": \"橡皮擦\",\r\n\t\"Undo\": \"撤销\",\r\n\t\"Redo\": \"重做\",\r\n\t\"Select\": \"选择\",\r\n\t\"Laser\": \"激光笔\",\r\n\t\"Shapes\": \"形状\",\r\n\t\"Add Text\": \"添加文字\",\r\n\t\"Highlighter\": \"高亮\",\r\n\t\"Pen\": \"画笔\",\r\n\t\"Line Width\": \"线条宽度\",\r\n\t\"Color\": \"颜色\",\r\n\t\"The last page cannot be deleted.\": \"不能删除最后一页。\",\r\n\t\"Do you want to delete this page?\": \"确定要删除这一页吗？\",\r\n\t\"Warning Tips\": \"警告提示！\",\r\n\t\"above IE10 tips\": \"使用白板功能,需要安装IE10及10以上浏览器，推荐使用Chrome浏览器\",\r\n\t\"Confirm\": \"确认\",\r\n\t\"OK\": \"确定\",\r\n\t\"Cancel\": \"取消\",\r\n\t\"Do you want to clear this page?\": \"确定要清空本页所有内容吗？\",\r\n\t\"Adding text here\": \"新增文字\",\r\n\t\"Network connection is lost, reconnect in about\": \"网络连接失败，重新连接\",\r\n\t\"seconds\": \"秒.\",\r\n\t\"Connection is lost\": \"连接失败.\",\r\n\t\"File uploaded\": \"文件上传成功.\",\r\n\t\"File upload error, please try again\": \"文件上传出现错误，请重试.\",\r\n\t\"File upload has been cancelled\": \"文件上传已被取消.\",\r\n\t\"File uploading, please wait\": \"文件正在上传，请稍候\",\r\n\t\"This page has been deleted, click OK to go to last page\": \"该页已经被删除，点击确定后跳转到最后一页.\",\r\n\t\"Invalid token, please check\": \"token失效，请检查.\"\r\n}\r\n"
  },
  {
    "path": "sdk-unitest/emoji/emoji.js",
    "content": ";(function (global, factory) {\n    'use strict';\n    if (typeof exports === 'object' && typeof module !== undefined) {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        window.RongIMLib = window.RongIMLib || {};\n        window.RongIMLib.RongIMEmoji = factory();\n    }\n})(window, function() {\n    /* 所有emoji转化为span组成的数组 */\n    var emojiHtmls = []; \n    /* 所有emoji的名称，语言为init中设置的语言 */\n    var emojiSymbols = [];\n    /* 所有emoji的具体信息，包括tag, en, zh, name, html */\n    var emojiDetails = [];\n\n    var emojiFactory = {\n        \"u1F600\": { \"en\": \"grinning_face\", \"zh\": \"笑嘻嘻\", \"tag\": \"\\uD83D\\uDE00\", \"position\": \"0px 0px\" },\n        \"u1F601\": { \"en\": \"grinning_with_smiling\", \"zh\": \"露齿而笑\", \"tag\": \"\\uD83D\\uDE01\", \"position\": \"-25px 0px\" },\n        \"u1F602\": { \"en\": \"laughing_tears\", \"zh\": \"喜极而泣\", \"tag\": \"\\uD83D\\uDE02\", \"position\": \"-50px 0px\" },\n        \"u1F603\": { \"en\": \"smiley_face\", \"zh\": \"笑脸\", \"tag\": \"\\uD83D\\uDE03\", \"position\": \"-75px 0px\" },\n        \"u1F605\": { \"en\": \"happy_sweat\", \"zh\": \"尴尬\", \"tag\": \"\\uD83D\\uDE05\", \"position\": \"-100px 0px\" },\n        \"u1F606\": { \"en\": \"big_grin\", \"zh\": \"大笑\", \"tag\": \"\\uD83D\\uDE06\", \"position\": \"-125px 0px\" },\n        \"u1F607\": { \"en\": \"halo\", \"zh\": \"天使光环\", \"tag\": \"\\uD83D\\uDE07\", \"position\": \"-150px 0px\" },\n        \"u1F608\": { \"en\": \"purple_devil\", \"zh\": \"小恶魔\", \"tag\": \"\\uD83D\\uDE08\", \"position\": \"-175px 0px\" },\n        \"u1F609\": { \"en\": \"winking_face\", \"zh\": \"眨眼\", \"tag\": \"\\uD83D\\uDE09\", \"position\": \"-200px 0px\" },\n        \"u1F611\": { \"en\": \"expressionless_face\", \"zh\": \"面无表情\", \"tag\": \"\\uD83D\\uDE11\", \"position\": \"-225px 0px\" },\n        \"u1F612\": { \"en\": \"dissatisfied\", \"zh\": \"不满\", \"tag\": \"\\uD83D\\uDE12\", \"position\": \"-250px 0px\" },\n        \"u1F613\": { \"en\": \"sweat\", \"zh\": \"汗\", \"tag\": \"\\uD83D\\uDE13\", \"position\": \"-275px 0px\" },\n        \"u1F614\": { \"en\": \"pensive\", \"zh\": \"沉思\", \"tag\": \"\\uD83D\\uDE14\", \"position\": \"-300px 0px\" },\n        \"u1F615\": { \"en\": \"confused\", \"zh\": \"困惑\", \"tag\": \"\\uD83D\\uDE15\", \"position\": \"-325px 0px\" },\n        \"u1F616\": { \"en\": \"confounded_face\", \"zh\": \"蒙羞\", \"tag\": \"\\uD83D\\uDE16\", \"position\": \"-350px 0px\" },\n        \"u1F618\": { \"en\": \"blowing_kiss\", \"zh\": \"飞吻\", \"tag\": \"\\uD83D\\uDE18\", \"position\": \"-375px 0px\" },\n        \"u1F621\": { \"en\": \"angry_face\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDE21\", \"position\": \"-400px 0px\" },\n        \"u1F622\": { \"en\": \"crying\", \"zh\": \"伤心\", \"tag\": \"\\uD83D\\uDE22\", \"position\": \"-2075px 0px\" },\n        \"u1F623\": { \"en\": \"helpless_face\", \"zh\": \"无助\", \"tag\": \"\\uD83D\\uDE23\", \"position\": \"-450px 0px\" },\n        \"u1F624\": { \"en\": \"mad_face\", \"zh\": \"生气\", \"tag\": \"\\uD83D\\uDE24\", \"position\": \"-475px 0px\" },\n        \"u1F628\": { \"en\": \"fearful_face\", \"zh\": \"可怕\", \"tag\": \"\\uD83D\\uDE28\", \"position\": \"-500px 0px\" },\n        \"u1F629\": { \"en\": \"weary_face\", \"zh\": \"疲惫\", \"tag\": \"\\uD83D\\uDE29\", \"position\": \"-525px 0px\" },\n        \"u1F630\": { \"en\": \"cold_sweat\", \"zh\": \"冷汗\", \"tag\": \"\\uD83D\\uDE30\", \"position\": \"-550px 0px\" },\n        \"u1F631\": { \"en\": \"scream\", \"zh\": \"尖叫\", \"tag\": \"\\uD83D\\uDE31\", \"position\": \"-575px 0px\" },\n        \"u1F632\": { \"en\": \"shocked_face\", \"zh\": \"震惊\", \"tag\": \"\\uD83D\\uDE32\", \"position\": \"-600px 0px\" },\n        \"u1F633\": { \"en\": \"flushed_face\", \"zh\": \"脸红\", \"tag\": \"\\uD83D\\uDE33\", \"position\": \"-625px 0px\" },\n        \"u1F634\": { \"en\": \"sleeping\", \"zh\": \"睡眠\", \"tag\": \"\\uD83D\\uDE34\", \"position\": \"-650px 0px\" },\n        \"u1F635\": { \"en\": \"dizzy_face\", \"zh\": \"头晕眼花\", \"tag\": \"\\uD83D\\uDE35\", \"position\": \"-675px 0px\" },\n        \"u1F636\": { \"en\": \"mouthless\", \"zh\": \"无口\", \"tag\": \"\\uD83D\\uDE36\", \"position\": \"-700px 0px\" },\n        \"u1F637\": { \"en\": \"mask_face\", \"zh\": \"口罩\", \"tag\": \"\\uD83D\\uDE37\", \"position\": \"-725px 0px\" },\n        \"u1F3A4\": { \"en\": \"microphone\", \"zh\": \"麦克风\", \"tag\": \"\\uD83C\\uDFA4\", \"position\": \"-750px 0px\" },\n        \"u1F3B2\": { \"en\": \"game_die\", \"zh\": \"骰子\", \"tag\": \"\\uD83C\\uDFB2\", \"position\": \"-775px 0px\" },\n        \"u1F3B5\": { \"en\": \"musical_note\", \"zh\": \"音乐\", \"tag\": \"\\uD83C\\uDFB5\", \"position\": \"-800px 0px\" },\n        \"u1F3C0\": { \"en\": \"basketball\", \"zh\": \"篮球\", \"tag\": \"\\uD83C\\uDFC0\", \"position\": \"-825px 0px\" },\n        \"u1F3C2\": { \"en\": \"snowboarder\", \"zh\": \"单板滑雪\", \"tag\": \"\\uD83C\\uDFC2\", \"position\": \"-850px 0px\" },\n        \"u1F3E1\": { \"en\": \"house_with_garden\", \"zh\": \"房子\", \"tag\": \"\\uD83C\\uDFE1\", \"position\": \"-875px 0px\" },\n        \"u1F004\": { \"en\": \"mahjong_red_dragon\", \"zh\": \"麻将\", \"tag\": \"\\uD83C\\uDC04\", \"position\": \"-900px 0px\" },\n        \"u1F4A1\": { \"en\": \"light_bulb\", \"zh\": \"灯泡\", \"tag\": \"\\uD83D\\uDCA1\", \"position\": \"-925px 0px\" },\n        \"u1F4A2\": { \"en\": \"anger\", \"zh\": \"愤怒\", \"tag\": \"\\uD83D\\uDCA2\", \"position\": \"-950px 0px\" },\n        \"u1F4A3\": { \"en\": \"bomb\", \"zh\": \"炸弹\", \"tag\": \"\\uD83D\\uDCA3\", \"position\": \"-975px 0px\" },\n        \"u1F4A4\": { \"en\": \"zzz\", \"zh\": \"ZZZ\", \"tag\": \"\\uD83D\\uDCA4\", \"position\": \"-1000px 0px\" },\n        \"u1F4A9\": { \"en\": \"pile_of_poo\", \"zh\": \"便便\", \"tag\": \"\\uD83D\\uDCA9\", \"position\": \"-1025px 0px\" },\n        \"u1F4AA\": { \"en\": \"flexed_biceps\", \"zh\": \"肌肉\", \"tag\": \"\\uD83D\\uDCAA\", \"position\": \"-1050px 0px\" },\n        \"u1F4B0\": { \"en\": \"money_bag\", \"zh\": \"钱袋\", \"tag\": \"\\uD83D\\uDCB0\", \"position\": \"-1075px 0px\" },\n        \"u1F4DA\": { \"en\": \"books\", \"zh\": \"书籍\", \"tag\": \"\\uD83D\\uDCDA\", \"position\": \"-1100px 0px\" },\n        \"u1F4DE\": { \"en\": \"telephone_receiver\", \"zh\": \"电话听筒\", \"tag\": \"\\uD83D\\uDCDE\", \"position\": \"-1125px 0px\" },\n        \"u1F4E2\": { \"en\": \"loudspeaker\", \"zh\": \"扩音器\", \"tag\": \"\\uD83D\\uDCE2\", \"position\": \"-1150px 0px\" },\n        \"u1F6AB\": { \"en\": \"prohibited\", \"zh\": \"禁止\", \"tag\": \"\\uD83D\\uDEAB\", \"position\": \"-1175px 0px\" },\n        \"u1F6BF\": { \"en\": \"shower\", \"zh\": \"淋浴\", \"tag\": \"\\uD83D\\uDEBF\", \"position\": \"-1200px 0px\" },\n        \"u1F30F\": { \"en\": \"globe\", \"zh\": \"地球\", \"tag\": \"\\uD83C\\uDF0F\", \"position\": \"-1225px 0px\" },\n        \"u1F33B\": { \"en\": \"sunflower\", \"zh\": \"向日葵\", \"tag\": \"\\uD83C\\uDF3B\", \"position\": \"-1250px 0px\" },\n        \"u1F35A\": { \"en\": \"cooked_rice\", \"zh\": \"米饭\", \"tag\": \"\\uD83C\\uDF5A\", \"position\": \"-1275px 0px\" },\n        \"u1F36B\": { \"en\": \"chocolate_bar\", \"zh\": \"巧克力\", \"tag\": \"\\uD83C\\uDF6B\", \"position\": \"-1300px 0px\" },\n        \"u1F37B\": { \"en\": \"cheers\", \"zh\": \"干杯\", \"tag\": \"\\uD83C\\uDF7B\", \"position\": \"-1325px 0px\" },\n        \"u270A\": { \"en\": \"oncoming_fist\", \"zh\": \"拳头\", \"tag\": \"\\u270A\", \"position\": \"-1350px 0px\" },\n        \"u1F44C\": { \"en\": \"ok_hand\", \"zh\": \"没问题\", \"tag\": \"\\uD83D\\uDC4C\", \"position\": \"-1375px 0px\" },\n        \"u1F44D\": { \"en\": \"thumbs_up\", \"zh\": \"赞\", \"tag\": \"\\uD83D\\uDC4D\", \"position\": \"-1400px 0px\" },\n        \"u1F44E\": { \"en\": \"thumbs_down\", \"zh\": \"喝倒彩\", \"tag\": \"\\uD83D\\uDC4E\", \"position\": \"-1425px 0px\" },\n        \"u1F44F\": { \"en\": \"clapping_hands\", \"zh\": \"鼓掌\", \"tag\": \"\\uD83D\\uDC4F\", \"position\": \"-1450px 0px\" },\n        \"u1F46A\": { \"en\": \"family\", \"zh\": \"家庭\", \"tag\": \"\\uD83D\\uDC6A\", \"position\": \"-1475px 0px\" },\n        \"u1F46B\": { \"en\": \"couple\", \"zh\": \"情侣\", \"tag\": \"\\uD83D\\uDC6B\", \"position\": \"-1500px 0px\" },\n        \"u1F62C\": { \"en\": \"grimacing_face\", \"zh\": \"扮鬼脸\", \"tag\": \"\\uD83D\\uDE2C\", \"position\": \"-2050px 0px\" },\n        \"u1F47B\": { \"en\": \"ghost\", \"zh\": \"鬼\", \"tag\": \"\\uD83D\\uDC7B\", \"position\": \"-1525px 0px\" },\n        \"u1F47C\": { \"en\": \"baby_angel\", \"zh\": \"宝贝天使\", \"tag\": \"\\uD83D\\uDC7C\", \"position\": \"-1550px 0px\" },\n        \"u1F47D\": { \"en\": \"alien\", \"zh\": \"外星人\", \"tag\": \"\\uD83D\\uDC7D\", \"position\": \"-1575px 0px\" },\n        \"u1F47F\": { \"en\": \"devil\", \"zh\": \"恶魔\", \"tag\": \"\\uD83D\\uDC7F\", \"position\": \"-1600px 0px\" },\n        \"u1F48A\": { \"en\": \"capsule\", \"zh\": \"药\", \"tag\": \"\\uD83D\\uDC8A\", \"position\": \"-1625px 0px\" },\n        \"u1F48B\": { \"en\": \"kiss\", \"zh\": \"吻\", \"tag\": \"\\uD83D\\uDC8B\", \"position\": \"-1650px 0px\" },\n        \"u1F48D\": { \"en\": \"ring\", \"zh\": \"戒指\", \"tag\": \"\\uD83D\\uDC8D\", \"position\": \"-1675px 0px\" },\n        \"u1F52B\": { \"en\": \"pistol\", \"zh\": \"手枪\", \"tag\": \"\\uD83D\\uDD2B\", \"position\": \"-1700px 0px\" },\n        \"u1F60A\": { \"en\": \"lovely\", \"zh\": \"可爱\", \"tag\": \"\\uD83D\\uDE0A\", \"position\": \"-1725px 0px\" },\n        \"u1F60B\": { \"en\": \"hungry\", \"zh\": \"馋\", \"tag\": \"\\uD83D\\uDE0B\", \"position\": \"-1750px 0px\" },\n        \"u1F60C\": { \"en\": \"pleased\", \"zh\": \"满意\", \"tag\": \"\\uD83D\\uDE0C\", \"position\": \"-1775px 0px\" },\n        \"u1F60D\": { \"en\": \"heart_eyes\", \"zh\": \"色迷迷\", \"tag\": \"\\uD83D\\uDE0D\", \"position\": \"-1800px 0px\" },\n        \"u1F60E\": { \"en\": \"sunglasses\", \"zh\": \"墨镜\", \"tag\": \"\\uD83D\\uDE0E\", \"position\": \"-1825px 0px\" },\n        \"u1F60F\": { \"en\": \"smirking_face\", \"zh\": \"傻笑\", \"tag\": \"\\uD83D\\uDE0F\", \"position\": \"-1850px 0px\" },\n        \"u1F61A\": { \"en\": \"kiss_face\", \"zh\": \"么么哒\", \"tag\": \"\\uD83D\\uDE1A\", \"position\": \"-1875px 0px\" },\n        \"u1F61C\": { \"en\": \"crazy_face\", \"zh\": \"调皮\", \"tag\": \"\\uD83D\\uDE1C\", \"position\": \"-1900px 0px\" },\n        \"u1F61D\": { \"en\": \"tongue_out\", \"zh\": \"吐舌头\", \"tag\": \"\\uD83D\\uDE1D\", \"position\": \"-1925px 0px\" },\n        \"u1F61E\": { \"en\": \"disappointed_face\", \"zh\": \"失望\", \"tag\": \"\\uD83D\\uDE1E\", \"position\": \"-1950px 0px\" },\n        \"u1F61F\": { \"en\": \"worried_face\", \"zh\": \"苦瓜脸\", \"tag\": \"\\uD83D\\uDE1F\", \"position\": \"-1975px 0px\" },\n        \"u1F62A\": { \"en\": \"sleepy_face\", \"zh\": \"困\", \"tag\": \"\\uD83D\\uDE2A\", \"position\": \"-2000px 0px\" },\n        \"u1F62B\": { \"en\": \"tired_face\", \"zh\": \"抓狂\", \"tag\": \"\\uD83D\\uDE2B\", \"position\": \"-2025px 0px\" },\n        \"u1F62D\": { \"en\": \"sobbing\", \"zh\": \"哭泣\", \"tag\": \"\\uD83D\\uDE2D\", \"position\": \"-425px 0px\" },\n        \"u1F62F\": { \"en\": \"surprised_face\", \"zh\": \"惊呆\", \"tag\": \"\\uD83D\\uDE2F\", \"position\": \"-2100px 0px\" },\n        \"u1F64A\": { \"en\": \"no_speaking\", \"zh\": \"闭嘴\", \"tag\": \"\\uD83D\\uDE4A\", \"position\": \"-2125px 0px\" },\n        \"u1F64F\": { \"en\": \"folded_hands\", \"zh\": \"祈祷\", \"tag\": \"\\uD83D\\uDE4F\", \"position\": \"-2150px 0px\" },\n        \"u1F319\": { \"en\": \"crescent_moon\", \"zh\": \"弯月\", \"tag\": \"\\uD83C\\uDF19\", \"position\": \"-2175px 0px\" },\n        \"u1F332\": { \"en\": \"pine_tree\", \"zh\": \"松树\", \"tag\": \"\\uD83C\\uDF32\", \"position\": \"-2200px 0px\" },\n        \"u1F339\": { \"en\": \"rose\", \"zh\": \"玫瑰\", \"tag\": \"\\uD83C\\uDF39\", \"position\": \"-2225px 0px\" },\n        \"u1F349\": { \"en\": \"watermelon\", \"zh\": \"西瓜\", \"tag\": \"\\uD83C\\uDF49\", \"position\": \"-2250px 0px\" },\n        \"u1F356\": { \"en\": \"barbecue\", \"zh\": \"BBQ\", \"tag\": \"\\uD83C\\uDF56\", \"position\": \"-2275px 0px\" },\n        \"u1F366\": { \"en\": \"ice_cream\", \"zh\": \"冰淇淋\", \"tag\": \"\\uD83C\\uDF66\", \"position\": \"-2300px 0px\" },\n        \"u1F377\": { \"en\": \"wine_glass\", \"zh\": \"红酒\", \"tag\": \"\\uD83C\\uDF77\", \"position\": \"-2325px 0px\" },\n        \"u1F381\": { \"en\": \"wrapped_gift\", \"zh\": \"礼物\", \"tag\": \"\\uD83C\\uDF81\", \"position\": \"-2350px 0px\" },\n        \"u1F382\": { \"en\": \"birthday_cake\", \"zh\": \"生日蛋糕\", \"tag\": \"\\uD83C\\uDF82\", \"position\": \"-2375px 0px\" },\n        \"u1F384\": { \"en\": \"christmas_tree\", \"zh\": \"圣诞树\", \"tag\": \"\\uD83C\\uDF84\", \"position\": \"-2400px 0px\" },\n        \"u1F389\": { \"en\": \"party_popper\", \"zh\": \"聚会礼花\", \"tag\": \"\\uD83C\\uDF89\", \"position\": \"-2425px 0px\" },\n        \"u1F393\": { \"en\": \"graduation_cap\", \"zh\": \"毕业帽\", \"tag\": \"\\uD83C\\uDF93\", \"position\": \"-2450px 0px\" },\n        \"u1F434\": { \"en\": \"horse\", \"zh\": \"马\", \"tag\": \"\\uD83D\\uDC34\", \"position\": \"-2475px 0px\" },\n        \"u1F436\": { \"en\": \"dog\", \"zh\": \"狗\", \"tag\": \"\\uD83D\\uDC36\", \"position\": \"-2500px 0px\" },\n        \"u1F437\": { \"en\": \"pig\", \"zh\": \"猪\", \"tag\": \"\\uD83D\\uDC37\", \"position\": \"-2525px 0px\" },\n        \"u1F451\": { \"en\": \"crown\", \"zh\": \"王冠\", \"tag\": \"\\uD83D\\uDC51\", \"position\": \"-2550px 0px\" },\n        \"u1F484\": { \"en\": \"lipstick\", \"zh\": \"口红\", \"tag\": \"\\uD83D\\uDC84\", \"position\": \"-2575px 0px\" },\n        \"u1F494\": { \"en\": \"broken_heart\", \"zh\": \"心碎\", \"tag\": \"\\uD83D\\uDC94\", \"position\": \"-2600px 0px\" },\n        \"u1F525\": { \"en\": \"fire\", \"zh\": \"火\", \"tag\": \"\\uD83D\\uDD25\", \"position\": \"-2625px 0px\" },\n        \"u1F556\": { \"en\": \"clock\", \"zh\": \"表\", \"tag\": \"\\uD83D\\uDD56\", \"position\": \"-2650px 0px\" },\n        \"u1F648\": { \"en\": \"see_no_monkey\", \"zh\": \"不看\", \"tag\": \"\\uD83D\\uDE48\", \"position\": \"-2675px 0px\" },\n        \"u1F649\": { \"en\": \"hear_no_monkey\", \"zh\": \"不听\", \"tag\": \"\\uD83D\\uDE49\", \"position\": \"-2700px 0px\" },\n        \"u1F680\": { \"en\": \"rocket\", \"zh\": \"火箭\", \"tag\": \"\\uD83D\\uDE80\", \"position\": \"-2725px 0px\" },\n        \"u2B50\": { \"en\": \"star\", \"zh\": \"星星\", \"tag\": \"\\u2B50\", \"position\": \"-2750px 0px\" },\n        \"u23F0\": { \"en\": \"alarm_clock\", \"zh\": \"闹钟\", \"tag\": \"\\u23F0\", \"position\": \"-2775px 0px\" },\n        \"u23F3\": { \"en\": \"hourglass\", \"zh\": \"沙漏\", \"tag\": \"\\u23F3\", \"position\": \"-2800px 0px\" },\n        \"u26A1\": { \"en\": \"lightning_bolt\", \"zh\": \"闪电\", \"tag\": \"\\u26A1\", \"position\": \"-2825px 0px\" },\n        \"u26BD\": { \"en\": \"soccer_ball\", \"zh\": \"足球\", \"tag\": \"\\u26BD\", \"position\": \"-2850px 0px\" },\n        \"u26C4\": { \"en\": \"snowman\", \"zh\": \"雪人\", \"tag\": \"\\u26C4\", \"position\": \"-2875px 0px\" },\n        \"u26C5\": { \"en\": \"cloudy\", \"zh\": \"多云\", \"tag\": \"\\u26C5\", \"position\": \"-2900px 0px\" },\n        \"u261D\": { \"en\": \"pointing_up\", \"zh\": \"第一\", \"tag\": \"\\u261D\", \"position\": \"-2925px 0px\" },\n        \"u263A\": { \"en\": \"smiling\", \"zh\": \"微笑\", \"tag\": \"\\u263A\", \"position\": \"-2950px 0px\" },\n        \"u1F44A\": { \"en\": \"raised_fist\", \"zh\": \"举拳\", \"tag\": \"\\uD83D\\uDC4A\", \"position\": \"-2975px 0px\" },\n        \"u270B\": { \"en\": \"raised_hand\", \"zh\": \"举手\", \"tag\": \"\\u270B\", \"position\": \"-3000px 0px\" },\n        \"u270C\": { \"en\": \"victory_hand\", \"zh\": \"耶\", \"tag\": \"\\u270C\", \"position\": \"-3025px 0px\" },\n        \"u270F\": { \"en\": \"pencil\", \"zh\": \"铅笔\", \"tag\": \"\\u270F\", \"position\": \"-3050px 0px\" },\n        \"u2600\": { \"en\": \"sunny\", \"zh\": \"晴朗\", \"tag\": \"\\u2600\", \"position\": \"-3075px 0px\" },\n        \"u2601\": { \"en\": \"cloud\", \"zh\": \"云彩\", \"tag\": \"\\u2601\", \"position\": \"-3100px 0px\" },\n        \"u2614\": { \"en\": \"umbrella\", \"zh\": \"雨伞\", \"tag\": \"\\u2614\", \"position\": \"-3125px 0px\" },\n        \"u2615\": { \"en\": \"coffee\", \"zh\": \"咖啡\", \"tag\": \"\\u2615\", \"position\": \"-3150px 0px\" },\n        \"u2744\": { \"en\": \"snowflake\", \"zh\": \"雪花\", \"tag\": \"\\u2744\", \"position\": \"-3175px 0px\" }\n    };\n\n    // config\n    var configs = {\n        url: \"//cdn.ronghub.com/css-sprite_bg-2.1.10.png\",\n        size: 24,\n        lang: \"zh\",\n        reg: /[\\uf000-\\uf700]/g\n    };\n\n    var supportLanguage = [ \"en\" ,\"zh\" ];\n\n    /* 用于 emoji 正则匹配 */\n    var regExpTag;\n\n    /* 判断是否支持emoji的渲染 */\n    var isSupportEmoji = (function() {\n        var node = document.createElement(\"canvas\");\n        if (!node.getContext || !node.getContext(\"2d\") || typeof node.getContext(\"2d\").fillText !== \"function\") {\n            return false;\n        }\n        var ctx = node.getContext(\"2d\");\n        ctx.textBaseline = \"top\";\n        ctx.font = \"32px Arial\";\n        ctx.fillText('\\ud83d\\ude03', 0, 0);\n        return ctx.getImageData(16, 16, 1, 1).data[0] !== 0;\n    })();\n\n    /**\n     * 初始化\n     * @param  {object} emoji  可选，包含dataSource和url。 dataSource包含扩展的表情信息, key为标识表情的unicode码\n     * @param  {object} config 可选，包括size, lang, url, regExp 四个可选属性。分别表示html大小，输出语言，图片背景图，匹配unicode码的正则表达式\n     */\n    var init = function(newEmojis, opt) {\n        addBaseCss();\n\n        configs = extend(configs, opt);\n\n        var newEmojiFactory = getNewEmojiFactory(newEmojis, configs);\n        emojiFactory = extend(emojiFactory, newEmojiFactory);\n\n        setupEmojiRegExp(emojiFactory);\n    };\n\n    var extend = function() {\n        if (arguments.length === 0) {\n            return;\n        }\n        var obj = arguments[0];\n        for (var i = 1, len = arguments.length; i < len; i++) {\n            var other = arguments[i];\n            for (var item in other) {\n                obj[item] = other[item];\n            }\n        }\n        return obj;\n    }\n\n    var addBaseCss = function() {\n        var baseCss = \".rong-emoji-content { display: inline-block; overflow: hidden; font-size: 20px !important; text-align: center; vertical-align: middle; overflow: hidden; }\"\n        var head = document.getElementsByTagName(\"head\")[0];\n        var style = document.createElement(\"style\");\n        style.type = \"text/css\";\n        style.innerHTML = baseCss;\n        head.appendChild(style);\n    }\n\n    var getNewEmojiFactory = function(newEmojis, opt) {\n        var newEmojiFactory = {};\n        if (newEmojis) {\n            var _emojiFactory = newEmojis.dataSource;\n            var _url = newEmojis.url || opt.url;\n            for (var key in _emojiFactory) {\n                _emojiFactory[key][\"background\"] = _url;\n                newEmojiFactory[key] = _emojiFactory[key];\n            }\n        }\n        return newEmojiFactory;\n    }\n\n    var setupEmojiRegExp = function(emojiFac ,tagReg) {\n        emojiSymbols.length = 0;\n        emojiHtmls.length = 0;\n\n        var tags = [];\n        var lang = configs.lang;\n        for (var key in emojiFac) {\n            var emoji = emojiFac[key];\n            tags.push(escape(emoji.tag));\n            setupEmojiDetail(emoji);\n        }\n        tags = tags.join(\"|\");\n        var regExp = new RegExp(\"%\", \"g\");\n        tags = tags.replace(regExp, function (x) { return \"\\\\\"; });\n        regExpTag = new RegExp(\"(\" + tags + \")\", \"g\");\n    };\n\n    function setupEmojiDetail(emoji) {\n        var lang = configs.lang;\n        var span = createSpan(emoji);\n        emojiSymbols.push(emoji[lang]);\n        emojiHtmls.push(getDom(span));\n        emojiDetails.push({\n            name: \"[\" + emoji[lang] + \"]\",\n            tag: emoji.tag,\n            zh: emoji.zh,\n            en: emoji.en,\n            html: span\n        });\n    }\n\n    function getDom(html) {\n        var div = document.createElement('div');\n        div.innerHTML = html;\n        return div.childNodes[0];\n    }\n\n    var computeBgPosition = function(position, sizePx) {\n        var sizePx = sizePx || configs.size;\n        var scale = sizePx / 24;\n        var position = position.split(' ');\n        var x = position[0], y = position[1];\n        x = x.split(\"px\")[0];\n        y = y.split(\"px\")[0];\n        return parseInt(x) * scale + \"px \" + parseInt(y) * scale + \"px\";\n    }\n\n    var getEmojiHtml = function(object) {\n        var style = \"width: {{size}}px; height: {{size}}px; line-height: {{size}}px; background-image: url({{background}}); background-position: {{position}}; background-size: auto {{size}}px;\";\n        var spanTpl = \"<span class='rong-emoji-content' name='[{{name}}]' style='\" + style + \"''></span>\"\n        var ret = spanTpl.replace(/\\\\?\\{\\{([^}]+)\\}\\}/g, function(match, name) {\n            return object[name];\n        })\n        return ret;\n    };\n\n    var createSpan = function(emojiDetail, sizePx) {\n        var emojiObj = {\n            size: sizePx || configs.size,\n            position: computeBgPosition(emojiDetail.position, sizePx),\n            background: emojiDetail.background || configs.url,\n            name: emojiDetail[configs.lang],\n            tag: emojiDetail.tag\n        };\n        return getEmojiHtml(emojiObj);\n    };\n\n    var calculateUTF = function (nativeEmoji) {\n        if (61440 < nativeEmoji.charCodeAt(0)) {\n            var emojiUnicodeKey = escape(nativeEmoji).replace(\"%u\", \"u1\");\n            var emoji = emojiFactory[emojiUnicodeKey];\n            if (emoji){\n                return emoji.tag;\n            }\n        }\n        return nativeEmoji;\n    };\n\n    var getEmojiBySymbol = function(symbol) {\n        var temp = symbol.slice(1, symbol.length - 1);\n        for (var i = 0; i < emojiDetails.length; i++) {\n            var lang = configs.lang;\n            var emoji = emojiDetails[i];\n            if(emoji[lang] === temp) {\n                return emoji.tag;\n            }\n        }\n        return \"[\" + symbol + \"]\";\n    };\n\n\n    /**\n     * 将字符串中的unicode码转化为可以显示的原生emoji字符\n     * @param  {string} emoji 必填，需要转化的字符串\n     * @param  {regExp} reg      可选，标识unicode码的匹配范围。默认为init时设置的regExp，如果不设置，默认为/[\\uf000-\\uf700]/g\n     * @return {string}          转化后的字符串\n     */\n    var emojiDecode = function(emojis, reg) {\n        reg = reg || configs.reg;\n        return emojis.replace(reg, function(emoji) {\n            return calculateUTF(emoji) || emoji;\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为 对应的文字标识\n     * @param  {string} emojis 必填，需要转化的字符串\n     * @param  {regExp} reg      可选，匹配的正则表达式\n     * @return {string}          转化后的字符串\n     */\n    var emojiToSymbol = function(emojis, reg) {\n        emojis = emojiDecode(emojis, reg);\n        var emojiSymbol = {};\n        emojiSymbol = emojis.replace(regExpTag, function(emojiTag) {\n            var lang = configs.lang;\n            for (var emojiKey in emojiFactory) {\n                if (emojiFactory[emojiKey].tag == emojiTag) {\n                    return \"[\" + emojiFactory[emojiKey][lang] + \"]\";\n                }\n            }\n        });\n        return emojiSymbol;\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为原生emoji\n     * @param  {string} symbols 必填\n     * @return {string}           \n     */\n    var symbolToEmoji = function(symbols) {\n        return symbols.replace(/\\[([^\\[\\]]+?)\\]/g, function(symbol) {\n            return getEmojiBySymbol(symbol);\n        });\n    };\n\n    /**\n     * 将字符串中的原生emoji字符转化为html标签\n     * @param  {string} emojiStr 必填，包含原生emoji字符的字符串\n     * @param  {int} sizePx      可选，html标签的大小\n     * @param  {string} reg      可选，正则表达式\n     * @return {span标签}         转化后，包含emoji背景的span标签\n     */\n    var emojiToHTML = function(emojis, sizePx, reg) {\n        emojis = emojiDecode(emojis, reg);\n        return emojis.replace(regExpTag, function(emojiTag) {\n            var span;\n            for (var key in emojiFactory) {\n                if (emojiFactory[key].tag == emojiTag) {\n                    span = createSpan(emojiFactory[key], sizePx);\n                    break;\n                }\n            }\n            return span;\n        });\n    };\n\n    /**\n     * 将字符串中的 对应文字标识 转化为html标签\n     * @param  {string} symbol 必填，包含symbol的字符串\n     * @param  {int} sizePx    可选，html标签的大小\n     * @param  {string} reg    可选，正则表达式\n     * @return {span标签}       转化后，包含emoji背景的span标签\n     */\n    var symbolToHTML = function(symbol, sizePx, reg) {\n        var emoji = symbolToEmoji(symbol);\n        return emojiToHTML(emoji, sizePx, reg);\n    };\n\n    /**\n     * 获取所有emoji的详情\n     * @return {array} 包含多个object，每个object包括tag, en, zh, name, html\n     */\n    var getAllEmoji = function() {\n        return emojiDetails;\n    };\n\n\n\n    return {\n        init: init,\n        supportLanguage: supportLanguage,\n        emojis: emojiHtmls,\n        names: emojiSymbols,\n        getAllEmoji: getAllEmoji,\n        emojiToSymbol: emojiToSymbol,\n        symbolToEmoji: symbolToEmoji,\n        emojiToHTML: emojiToHTML,\n        symbolToHTML: symbolToHTML,\n        messageDecode: emojiDecode,\n        isSupportEmoji: isSupportEmoji\n    }\n});"
  },
  {
    "path": "sdk-unitest/emoji/run.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Emoji SDK UnitTest</title>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../jasmine/1.2.0/jasmine.css\">\n<script type=\"text/javascript\" src=\"../jasmine/1.2.0/jasmine.js\" id=\"jasmine\"></script>\n<script type=\"text/javascript\" src=\"../jasmine/1.2.0/jasmine-html.js\"></script>\n<script type=\"text/javascript\" src=\"../libs/underscore.js\"></script>\n<script type=\"text/javascript\" src=\"../libs/ua.js\"></script>\n\n<script type=\"text/javascript\" src=\"emoji.js\"></script>\n\n\n<!--test files-->\n<script type=\"text/javascript\" src=\"testcase.js\"></script>\n\n<script type=\"text/javascript\">\n(function() {\n    var htmlReporter = new jasmine.HtmlReporter();\n\n    var jasmineEnv = jasmine.getEnv();\n        jasmineEnv.updateInterval = 1000;\n        jasmineEnv.addReporter(htmlReporter);\n\n        jasmineEnv.specFilter = function(spec) {\n            return htmlReporter.specFilter(spec);\n        };\n\n    window.onload = function(){\n        jasmineEnv.execute();\n    }\n\n})();\n</script>\n\n</head>\n<body>\n\n</body>\n</html>\n"
  },
  {
    "path": "sdk-unitest/emoji/testcase.js",
    "content": "describe(\"RongEmoji\", function() {\n    var functions = [\n        'init','getAllEmoji','emojiToSymbol',\n        'symbolToEmoji','emojiToHTML','symbolToHTML',\n        'messageDecode'\n    ];\n\n    var objects = ['supportLanguage','emojis','names'];\n    \n    var booleans = ['isSupportEmoji'];\n\n    var RongIMEmoji = window.RongIMLib.RongIMEmoji;\n\n    var _space = ' \\t \\t \\t \\t';\n\n    for(var i=0;i<functions.length;i++){\n        let name = functions[i];\n        let type = typeof RongIMEmoji[name];\n        it( \"RongIMEmoji.\" + name + _space + \" should be object\", function() {\n            expect(type).toEqual(\"function\");\n        });\n    }\n\n    for(var i=0;i<objects.length;i++){\n        let name = objects[i];\n        let type = typeof RongIMEmoji[name];\n        it( \"RongIMEmoji.\" + name + _space + \" should be object\", function() {\n            expect(type).toEqual(\"object\");\n        });\n    }\n\n    for(var i=0;i<booleans.length;i++){\n        let name = booleans[i];\n        let type = typeof RongIMEmoji[name];\n        it( \"RongIMEmoji.\" + name + _space + \" should be object\", function() {\n            expect(type).toEqual(\"boolean\");\n        });\n    }\n\n    var _system = window.env.system;\n    var _broswer = window.env.broswer;\n    if(_system.isMac && _broswer.isChrome){\n        it( \"RongIMEmoji.isSupportEmoji\" + name + _space + \" should be true\", function() {\n            expect(RongIMEmoji.isSupportEmoji).toEqual(true);\n        });\n    }\n});"
  },
  {
    "path": "sdk-unitest/im/RongIMLib-2.2.7.js",
    "content": "/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n(function(global, factory) {\n    if (typeof exports === 'object' && typeof module !== 'undefined') {\n        module.exports = factory();\n    } else if (typeof define === 'function' && define.amd) {\n        define(factory);\n    } else {\n        var tempIMLib = factory();\n        var tempClient = tempIMLib.RongIMClient;\n        var isExists = (!!global.RongIMLib);\n        if (isExists) {\n            var currentClient = RongIMLib.RongIMClient || {};\n            for(var key in currentClient){\n                tempClient[key] = currentClient[key];\n            }\n        }\n        global.RongIMLib = tempIMLib;\n        global.RongIMClient = tempClient;\n    }\n})(this, function(){\n\nvar Polling = {\n        DeleteMsgInput:function(){\n         var a = {};\n         this.setType = function(b){\n           a.type = b;\n         };\n         this.setConversationId = function(b){\n           a.conversationId = b;\n         };\n         this.setMsgs = function(b){\n           a.msgs = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        DeleteMsg:function(){\n          var a = {};\n          this.setMsgId = function(b){\n            a.msgId = b;\n          };\n          this.setMsgDataTime = function(b){\n            a.msgDataTime = b;\n          };\n          this.setDirect = function(b){\n            a.direct = b;\n          };\n          this.toArrayBuffer = function () {\n              return a;\n          }\n        },\n        DeleteMsgOutput:function(){\n         var a = {};\n         this.setNothing = function(b){\n           a.nothing = b;\n         };\n         this.toArrayBuffer = function () {\n             return a;\n         }\n        },\n        SearchMpInput:function(){\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        SearchMpOutput:function(){\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        MpInfo:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setName = function(b){\n                a.name = b;\n            };\n            this.setType = function(b){\n                a.type = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setPortraitUri = function(b){\n                a.portraitUrl = b;\n            };\n            this.setExtra = function(b){\n                a.extra = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            }\n        },\n        PullMpInput:function(){\n            var a = {};\n            this.setMpid = function(b){\n                a.mpid = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        PullMpOutput:function(){\n            var a = {};\n            this.setStatus = function(b){\n                a.status = b;\n            }\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowInput:function(){\n            var a = {};\n            this.setId = function(b){\n                a.id = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        MPFollowOutput:function(){\n            var a = {};\n            this.setNothing = function(b){\n                a.nothing = b;\n            };\n            this.setInfo = function(b){\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        NotifyMsg: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setTime = function (b) {\n                a.time = b;\n            };\n            this.setChrmId = function(b){\n                a.chrmId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        SyncRequestMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b || 0;\n            };\n            this.setIspolling = function (b) {\n                a.ispolling = !!b;\n            };\n            this.setIsweb = function (b) {\n                a.isweb = !!b;\n            };\n            this.setIsPullSend = function (b) {\n                a.isPullSend = !!b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        UpStreamMessage: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b) a.content = b;\n            };\n            this.setPushText = function (b) {\n                a.pushText = b\n            };\n            this.setUserId = function(b){\n                a.userId = b;\n            };\n            this.setAppData = function(b){\n                a.appData = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessages: function () {\n            var a = {};\n            this.setList = function (b) {\n                a.list = b\n            };\n            this.setSyncTime = function (b) {\n                a.syncTime = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        DownStreamMessage: function () {\n            var a = {};\n            this.setFromUserId = function (b) {\n                a.fromUserId = b\n            };\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setGroupId = function (b) {\n                a.groupId = b\n            };\n            this.setClassname = function (b) {\n                a.classname = b\n            };\n            this.setContent = function (b) {\n                if (b)\n                    a.content = b\n            };\n            this.setDataTime = function (b) {\n                a.dataTime = b;\n            };\n            this.setStatus = function (b) {\n                a.status = b;\n            };\n            this.setMsgId = function (b) {\n                a.msgId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        CreateDiscussionInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        CreateDiscussionOutput: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInvitationInput: function () {\n            var a = {};\n            this.setUsers = function (b) {\n                a.users = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        LeaveChannelInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoInput:function(){\n            var a = {};\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.setOrder = function (b) {\n                a.order = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        QueryChatroomInfoOutput:function(){\n            var a = {};\n            this.setUserTotalNums = function (b) {\n                a.userTotalNums = b;\n            };\n            this.setUserInfos = function (b) {\n                a.userInfos = b;\n            };\n            this.toArrayBuffer = function () {\n                return a;\n            };\n        },\n        ChannelEvictionInput: function () {\n            var a = {};\n            this.setUser = function (b) {\n                a.user = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RenameChannelInput: function () {\n            var a = {};\n            this.setName = function (b) {\n                a.name = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfoOutput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b\n            };\n            this.setChannelId = function (b) {\n                a.channelId = b\n            };\n            this.setChannelName = function (b) {\n                a.channelName = b\n            };\n            this.setAdminUserId = function (b) {\n                a.adminUserId = b\n            };\n            this.setFirstTenUserIds = function (b) {\n                a.firstTenUserIds = b\n            };\n            this.setOpenStatus = function (b) {\n                a.openStatus = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ChannelInfosInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChannelInfosOutput: function () {\n            var a = {};\n            this.setChannels = function (b) {\n                a.channels = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        MemberInfo: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.setExtension = function (b) {\n                a.extension = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersInput: function () {\n            var a = {};\n            this.setPage = function (b) {\n                a.page = b\n            };\n            this.setNumber = function (b) {\n                a.number = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupMembersOutput: function () {\n            var a = {};\n            this.setMembers = function (b) {\n                a.members = b\n            };\n            this.setTotal = function (b) {\n                a.total = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetUserInfoOutput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b\n            };\n            this.setUserName = function (b) {\n                a.userName = b\n            };\n            this.setUserPortrait = function (b) {\n                a.userPortrait = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetSessionIdOutput: function () {\n            var a = {};\n            this.setSessionId = function (b) {\n                a.sessionId = b\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GetQNupTokenInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            }\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNupTokenOutput: function () {\n            var a = {};\n            this.setDeadline = function (b) {\n                a.deadline = b\n            };\n            this.setToken = function (b) {\n                a.token = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setKey = function (b) {\n                a.key = b;\n            };\n            this.setFileName = function(b){\n                a.fileName = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        GetQNdownloadUrlOutput: function () {\n            var a = {};\n            this.setDownloadUrl = function (b) {\n                a.downloadUrl = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        Add2BlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RemoveFromBlackListInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        QueryBlackListOutput: function () {\n            var a = {};\n            this.setUserIds = function (b) {\n                a.userIds = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlackListStatusInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        BlockPushInput: function () {\n            var a = {};\n            this.setBlockeeId = function (b) {\n                a.blockeeId = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        ModifyPermissionInput: function () {\n            var a = {};\n            this.setOpenStatus = function (b) {\n                a.openStatus = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInput: function () {\n            var a = {};\n            this.setGroupInfo = function (b) {\n                for (var i = 0, arr = []; i < b.length; i++) {\n                    arr.push({id: b[i].getContent().id, name: b[i].getContent().name})\n                }\n                a.groupInfo = arr;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupInfo: function () {\n            var a = {};\n            this.setId = function (b) {\n                a.id = b;\n            };\n            this.setName = function (b) {\n                a.name = b;\n            };\n            this.getContent = function () {\n                return a;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashInput: function () {\n            var a = {};\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setGroupHashCode = function (b) {\n                a.groupHashCode = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        GroupHashOutput: function () {\n            var a = {};\n            this.setResult = function (b) {\n                a.result = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmInput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmOutput: function () {\n            var a = {};\n            this.setNothing = function (b) {\n                a.nothing = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        ChrmPullMsg: function () {\n            var a = {};\n            this.setSyncTime = function (b) {\n                a.syncTime = b\n            };\n            this.setCount = function (b) {\n                a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsInput: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.setCount = function(b){\n              a.count = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            };\n        },\n        RelationsOutput: function () {\n            var a = {};\n            this.setInfo = function (b) {\n                a.info = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        RelationInfo: function () {\n            var a = {};\n            this.setType = function (b) {\n                a.type = b;\n            };\n            this.setUserId = function (b) {\n                a.userId = b;\n            };\n            this.setMsg = function(b){\n                a.msg = b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessageInput: function () {\n            var a={};\n            this.setTargetId=function(b){\n                a.targetId=b;\n            };\n            this.setDataTime=function(b){\n                a.dataTime=b;\n            };\n            this.setSize=function(b){\n                a.size=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMessagesOuput: function () {\n            var a={};\n            this.setList=function(b){\n                a.list=b;\n            };\n            this.setSyncTime=function(b){\n                a.syncTime=b;\n            };\n            this.setHasMsg=function(b){\n                a.hasMsg=b;\n            };\n            this.toArrayBuffer = function () {\n                return a\n            }\n        },\n        HistoryMsgInput: function(){\n            var a = {};\n            this.setTargetId = function(b){\n                a.targetId = b;\n            };\n            this.setTime = function(b){\n                a.time = b;\n            };\n            this.setCount = function(b){\n                a.count = b;\n            };\n            this.setOrder = function(b){\n                a.order = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        },\n        HistoryMsgOuput: function(){\n            var a = {};\n            this.setList = function(b){\n                a.list = b;\n            };\n            this.setSyncTime = function(b){\n                a.syncTime = b;\n            };\n            this.setHasMsg = function(b){\n                a.hasMsg = b;\n            };\n            this.toArrayBuffer = function(){\n                return a;\n            };\n        }\n    };\n    for (var f in Polling) {\n        Polling[f].decode = function (b) {\n            var back = {}, val = JSON.parse(b) || eval(\"(\" + b + \")\");\n            for (var i in val) {\n                back[i]=val[i];\n                back[\"get\"+ i.charAt(0).toUpperCase()+i.slice(1)]=function(){\n                    return val[i];\n                }\n            }\n            return back;\n        }\n    }\n\n/*\n * JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\n/*jslint bitwise: true */\n/*global unescape, define, module */\n\n(function ($) {\n    'use strict';\n\n    /*\n    * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n    * to work around bugs in some JS interpreters.\n    */\n    function safe_add(x, y) {\n        var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n            msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n        return (msw << 16) | (lsw & 0xFFFF);\n    }\n\n    /*\n    * Bitwise rotate a 32-bit number to the left.\n    */\n    function bit_rol(num, cnt) {\n        return (num << cnt) | (num >>> (32 - cnt));\n    }\n\n    /*\n    * These functions implement the four basic operations the algorithm uses.\n    */\n    function md5_cmn(q, a, b, x, s, t) {\n        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);\n    }\n    function md5_ff(a, b, c, d, x, s, t) {\n        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n    }\n    function md5_gg(a, b, c, d, x, s, t) {\n        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n    }\n    function md5_hh(a, b, c, d, x, s, t) {\n        return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n    }\n    function md5_ii(a, b, c, d, x, s, t) {\n        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n    }\n\n    /*\n    * Calculate the MD5 of an array of little-endian words, and a bit length.\n    */\n    function binl_md5(x, len) {\n        /* append padding */\n        x[len >> 5] |= 0x80 << (len % 32);\n        x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n        var i, olda, oldb, oldc, oldd,\n            a =  1732584193,\n            b = -271733879,\n            c = -1732584194,\n            d =  271733878;\n\n        for (i = 0; i < x.length; i += 16) {\n            olda = a;\n            oldb = b;\n            oldc = c;\n            oldd = d;\n\n            a = md5_ff(a, b, c, d, x[i],       7, -680876936);\n            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);\n            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);\n            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);\n            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);\n            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);\n            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);\n            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);\n            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);\n            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);\n            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);\n            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);\n            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);\n            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);\n            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);\n            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);\n\n            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);\n            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);\n            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);\n            b = md5_gg(b, c, d, a, x[i],      20, -373897302);\n            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);\n            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);\n            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);\n            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);\n            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);\n            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);\n            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);\n            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);\n            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);\n            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);\n            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);\n            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);\n\n            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);\n            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);\n            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);\n            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);\n            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);\n            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);\n            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);\n            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);\n            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);\n            d = md5_hh(d, a, b, c, x[i],      11, -358537222);\n            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);\n            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);\n            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);\n            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);\n            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);\n            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);\n\n            a = md5_ii(a, b, c, d, x[i],       6, -198630844);\n            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);\n            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);\n            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);\n            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);\n            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);\n            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);\n            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);\n            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);\n            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);\n            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);\n            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);\n            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);\n            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);\n            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);\n            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);\n\n            a = safe_add(a, olda);\n            b = safe_add(b, oldb);\n            c = safe_add(c, oldc);\n            d = safe_add(d, oldd);\n        }\n        return [a, b, c, d];\n    }\n\n    /*\n    * Convert an array of little-endian words to a string\n    */\n    function binl2rstr(input) {\n        var i,\n            output = '';\n        for (i = 0; i < input.length * 32; i += 8) {\n            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\n        }\n        return output;\n    }\n\n    /*\n    * Convert a raw string to an array of little-endian words\n    * Characters >255 have their high-byte silently ignored.\n    */\n    function rstr2binl(input) {\n        var i,\n            output = [];\n        output[(input.length >> 2) - 1] = undefined;\n        for (i = 0; i < output.length; i += 1) {\n            output[i] = 0;\n        }\n        for (i = 0; i < input.length * 8; i += 8) {\n            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\n        }\n        return output;\n    }\n\n    /*\n    * Calculate the MD5 of a raw string\n    */\n    function rstr_md5(s) {\n        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));\n    }\n\n    /*\n    * Calculate the HMAC-MD5, of a key and some data (raw strings)\n    */\n    function rstr_hmac_md5(key, data) {\n        var i,\n            bkey = rstr2binl(key),\n            ipad = [],\n            opad = [],\n            hash;\n        ipad[15] = opad[15] = undefined;\n        if (bkey.length > 16) {\n            bkey = binl_md5(bkey, key.length * 8);\n        }\n        for (i = 0; i < 16; i += 1) {\n            ipad[i] = bkey[i] ^ 0x36363636;\n            opad[i] = bkey[i] ^ 0x5C5C5C5C;\n        }\n        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);\n        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));\n    }\n\n    /*\n    * Convert a raw string to a hex string\n    */\n    function rstr2hex(input) {\n        var hex_tab = '0123456789abcdef',\n            output = '',\n            x,\n            i;\n        for (i = 0; i < input.length; i += 1) {\n            x = input.charCodeAt(i);\n            output += hex_tab.charAt((x >>> 4) & 0x0F) +\n                hex_tab.charAt(x & 0x0F);\n        }\n        return output;\n    }\n\n    /*\n    * Encode a string as utf-8\n    */\n    function str2rstr_utf8(input) {\n        return unescape(encodeURIComponent(input));\n    }\n\n    /*\n    * Take string arguments and return either raw or hex encoded strings\n    */\n    function raw_md5(s) {\n        return rstr_md5(str2rstr_utf8(s));\n    }\n    function hex_md5(s) {\n        return rstr2hex(raw_md5(s));\n    }\n    function raw_hmac_md5(k, d) {\n        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));\n    }\n    function hex_hmac_md5(k, d) {\n        return rstr2hex(raw_hmac_md5(k, d));\n    }\n\n    function md5(string, key, raw) {\n        if (!key) {\n            if (!raw) {\n                return hex_md5(string);\n            }\n            return raw_md5(string);\n        }\n        if (!raw) {\n            return hex_hmac_md5(key, string);\n        }\n        return raw_hmac_md5(key, string);\n    }\n    $.md5 = md5;\n    if (typeof define === 'function' && define.amd) {\n        define('md5',function () {\n            return md5;\n        });\n    } else if (typeof module === 'object' && module.exports) {\n        module.exports = md5;\n    } else {\n        $.md5 = md5;\n    }\n}(this));\n\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (MentionedType) {\n        MentionedType[MentionedType[\"ALL\"] = 1] = \"ALL\";\n        MentionedType[MentionedType[\"PART\"] = 2] = \"PART\";\n    })(RongIMLib.MentionedType || (RongIMLib.MentionedType = {}));\n    var MentionedType = RongIMLib.MentionedType;\n    (function (MethodType) {\n        MethodType[MethodType[\"CUSTOMER_SERVICE\"] = 1] = \"CUSTOMER_SERVICE\";\n        MethodType[MethodType[\"RECALL\"] = 2] = \"RECALL\";\n    })(RongIMLib.MethodType || (RongIMLib.MethodType = {}));\n    var MethodType = RongIMLib.MethodType;\n    (function (BlacklistStatus) {\n        /**\n         * 在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"IN_BLACK_LIST\"] = 0] = \"IN_BLACK_LIST\";\n        /**\n         * 不在黑名单中。\n         */\n        BlacklistStatus[BlacklistStatus[\"NOT_IN_BLACK_LIST\"] = 1] = \"NOT_IN_BLACK_LIST\";\n    })(RongIMLib.BlacklistStatus || (RongIMLib.BlacklistStatus = {}));\n    var BlacklistStatus = RongIMLib.BlacklistStatus;\n    (function (ConnectionChannel) {\n        ConnectionChannel[ConnectionChannel[\"XHR_POLLING\"] = 0] = \"XHR_POLLING\";\n        ConnectionChannel[ConnectionChannel[\"WEBSOCKET\"] = 1] = \"WEBSOCKET\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTP\"] = 0] = \"HTTP\";\n        //外部调用\n        ConnectionChannel[ConnectionChannel[\"HTTPS\"] = 1] = \"HTTPS\";\n    })(RongIMLib.ConnectionChannel || (RongIMLib.ConnectionChannel = {}));\n    var ConnectionChannel = RongIMLib.ConnectionChannel;\n    (function (CustomerType) {\n        CustomerType[CustomerType[\"ONLY_ROBOT\"] = 1] = \"ONLY_ROBOT\";\n        CustomerType[CustomerType[\"ONLY_HUMAN\"] = 2] = \"ONLY_HUMAN\";\n        CustomerType[CustomerType[\"ROBOT_FIRST\"] = 3] = \"ROBOT_FIRST\";\n        CustomerType[CustomerType[\"HUMAN_FIRST\"] = 4] = \"HUMAN_FIRST\";\n    })(RongIMLib.CustomerType || (RongIMLib.CustomerType = {}));\n    var CustomerType = RongIMLib.CustomerType;\n    (function (GetChatRoomType) {\n        GetChatRoomType[GetChatRoomType[\"NONE\"] = 0] = \"NONE\";\n        GetChatRoomType[GetChatRoomType[\"SQQUENCE\"] = 1] = \"SQQUENCE\";\n        GetChatRoomType[GetChatRoomType[\"REVERSE\"] = 2] = \"REVERSE\";\n    })(RongIMLib.GetChatRoomType || (RongIMLib.GetChatRoomType = {}));\n    var GetChatRoomType = RongIMLib.GetChatRoomType;\n    (function (ConnectionStatus) {\n        /**\n         * 连接成功。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTED\"] = 0] = \"CONNECTED\";\n        /**\n         * 连接中。\n         */\n        ConnectionStatus[ConnectionStatus[\"CONNECTING\"] = 1] = \"CONNECTING\";\n        /**\n         * 断开连接。\n         */\n        ConnectionStatus[ConnectionStatus[\"DISCONNECTED\"] = 2] = \"DISCONNECTED\";\n        /**\n         * 用户账户在其他设备登录，本机会被踢掉线。\n         */\n        ConnectionStatus[ConnectionStatus[\"KICKED_OFFLINE_BY_OTHER_CLIENT\"] = 6] = \"KICKED_OFFLINE_BY_OTHER_CLIENT\";\n        /**\n         * 网络不可用。\n         */\n        ConnectionStatus[ConnectionStatus[\"NETWORK_UNAVAILABLE\"] = 3] = \"NETWORK_UNAVAILABLE\";\n        /**\n         * 域名错误\n         */\n        ConnectionStatus[ConnectionStatus[\"DOMAIN_INCORRECT\"] = 12] = \"DOMAIN_INCORRECT\";\n        /**\n        *  连接关闭。\n        */\n        ConnectionStatus[ConnectionStatus[\"CONNECTION_CLOSED\"] = 4] = \"CONNECTION_CLOSED\";\n    })(RongIMLib.ConnectionStatus || (RongIMLib.ConnectionStatus = {}));\n    var ConnectionStatus = RongIMLib.ConnectionStatus;\n    (function (ConversationNotificationStatus) {\n        /**\n         * 免打扰状态，关闭对应会话的通知提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"DO_NOT_DISTURB\"] = 0] = \"DO_NOT_DISTURB\";\n        /**\n         * 提醒。\n         */\n        ConversationNotificationStatus[ConversationNotificationStatus[\"NOTIFY\"] = 1] = \"NOTIFY\";\n    })(RongIMLib.ConversationNotificationStatus || (RongIMLib.ConversationNotificationStatus = {}));\n    var ConversationNotificationStatus = RongIMLib.ConversationNotificationStatus;\n    (function (ConversationType) {\n        ConversationType[ConversationType[\"NONE\"] = 0] = \"NONE\";\n        ConversationType[ConversationType[\"PRIVATE\"] = 1] = \"PRIVATE\";\n        ConversationType[ConversationType[\"DISCUSSION\"] = 2] = \"DISCUSSION\";\n        ConversationType[ConversationType[\"GROUP\"] = 3] = \"GROUP\";\n        ConversationType[ConversationType[\"CHATROOM\"] = 4] = \"CHATROOM\";\n        ConversationType[ConversationType[\"CUSTOMER_SERVICE\"] = 5] = \"CUSTOMER_SERVICE\";\n        ConversationType[ConversationType[\"SYSTEM\"] = 6] = \"SYSTEM\";\n        //默认关注 MC\n        ConversationType[ConversationType[\"APP_PUBLIC_SERVICE\"] = 7] = \"APP_PUBLIC_SERVICE\";\n        //手工关注 MP\n        ConversationType[ConversationType[\"PUBLIC_SERVICE\"] = 8] = \"PUBLIC_SERVICE\";\n    })(RongIMLib.ConversationType || (RongIMLib.ConversationType = {}));\n    var ConversationType = RongIMLib.ConversationType;\n    (function (DiscussionInviteStatus) {\n        /**\n         * 开放邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"OPENED\"] = 0] = \"OPENED\";\n        /**\n         * 关闭邀请。\n         */\n        DiscussionInviteStatus[DiscussionInviteStatus[\"CLOSED\"] = 1] = \"CLOSED\";\n    })(RongIMLib.DiscussionInviteStatus || (RongIMLib.DiscussionInviteStatus = {}));\n    var DiscussionInviteStatus = RongIMLib.DiscussionInviteStatus;\n    (function (ErrorCode) {\n        /**\n         * 发送频率过快\n         */\n        ErrorCode[ErrorCode[\"SEND_FREQUENCY_TOO_FAST\"] = 20604] = \"SEND_FREQUENCY_TOO_FAST\";\n        ErrorCode[ErrorCode[\"RC_MSG_UNAUTHORIZED\"] = 20406] = \"RC_MSG_UNAUTHORIZED\";\n        /**\n         * 群组 Id 无效\n         */\n        ErrorCode[ErrorCode[\"RC_DISCUSSION_GROUP_ID_INVALID\"] = 20407] = \"RC_DISCUSSION_GROUP_ID_INVALID\";\n        /**\n         * 群组被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_GROUP\"] = 22408] = \"FORBIDDEN_IN_GROUP\";\n        /**\n         * 不在讨论组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_DISCUSSION\"] = 21406] = \"NOT_IN_DISCUSSION\";\n        /**\n         * 不在群组。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_GROUP\"] = 22406] = \"NOT_IN_GROUP\";\n        /**\n         * 不在聊天室。\n         */\n        ErrorCode[ErrorCode[\"NOT_IN_CHATROOM\"] = 23406] = \"NOT_IN_CHATROOM\";\n        /**\n         *聊天室被禁言\n         */\n        ErrorCode[ErrorCode[\"FORBIDDEN_IN_CHATROOM\"] = 23408] = \"FORBIDDEN_IN_CHATROOM\";\n        /**\n         * 聊天室中成员被踢出\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_USER_KICKED\"] = 23409] = \"RC_CHATROOM_USER_KICKED\";\n        /**\n         * 聊天室不存在\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_NOT_EXIST\"] = 23410] = \"RC_CHATROOM_NOT_EXIST\";\n        /**\n         * 聊天室成员已满\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_IS_FULL\"] = 23411] = \"RC_CHATROOM_IS_FULL\";\n        /**\n         * 获取聊天室信息参数无效\n         */\n        ErrorCode[ErrorCode[\"RC_CHATROOM_PATAMETER_INVALID\"] = 23412] = \"RC_CHATROOM_PATAMETER_INVALID\";\n        /**\n         * 聊天室异常\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_GET_HISTORYMSG_ERROR\"] = 23413] = \"CHATROOM_GET_HISTORYMSG_ERROR\";\n        /**\n         * 没有打开聊天室消息存储\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\"] = 23414] = \"CHATROOM_NOT_OPEN_HISTORYMSG_STORE\";\n        ErrorCode[ErrorCode[\"TIMEOUT\"] = -1] = \"TIMEOUT\";\n        /**\n         * 未知原因失败。\n         */\n        ErrorCode[ErrorCode[\"UNKNOWN\"] = -2] = \"UNKNOWN\";\n        /**\n         * 加入讨论失败\n         */\n        ErrorCode[ErrorCode[\"JOIN_IN_DISCUSSION\"] = 21407] = \"JOIN_IN_DISCUSSION\";\n        /**\n         * 创建讨论组失败\n         */\n        ErrorCode[ErrorCode[\"CREATE_DISCUSSION\"] = 21408] = \"CREATE_DISCUSSION\";\n        /**\n         * 设置讨论组邀请状态失败\n         */\n        ErrorCode[ErrorCode[\"INVITE_DICUSSION\"] = 21409] = \"INVITE_DICUSSION\";\n        /**\n         *获取用户失败\n         */\n        ErrorCode[ErrorCode[\"GET_USERINFO_ERROR\"] = 23407] = \"GET_USERINFO_ERROR\";\n        /**\n         * 在黑名单中。\n         */\n        ErrorCode[ErrorCode[\"REJECTED_BY_BLACKLIST\"] = 405] = \"REJECTED_BY_BLACKLIST\";\n        /**\n         * 通信过程中，当前 Socket 不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_CHANNEL_INVALID\"] = 30001] = \"RC_NET_CHANNEL_INVALID\";\n        /**\n         * Socket 连接不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_NET_UNAVAILABLE\"] = 30002] = \"RC_NET_UNAVAILABLE\";\n        /**\n         * 通信超时。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_RESP_TIMEOUT\"] = 30003] = \"RC_MSG_RESP_TIMEOUT\";\n        /**\n         * 导航操作时，Http 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_SEND_FAIL\"] = 30004] = \"RC_HTTP_SEND_FAIL\";\n        /**\n         * HTTP 请求失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_REQ_TIMEOUT\"] = 30005] = \"RC_HTTP_REQ_TIMEOUT\";\n        /**\n         * HTTP 接收失败。\n         */\n        ErrorCode[ErrorCode[\"RC_HTTP_RECV_FAIL\"] = 30006] = \"RC_HTTP_RECV_FAIL\";\n        /**\n         * 导航操作的 HTTP 请求，返回不是200。\n         */\n        ErrorCode[ErrorCode[\"RC_NAVI_RESOURCE_ERROR\"] = 30007] = \"RC_NAVI_RESOURCE_ERROR\";\n        /**\n         * 导航数据解析后，其中不存在有效数据。\n         */\n        ErrorCode[ErrorCode[\"RC_NODE_NOT_FOUND\"] = 30008] = \"RC_NODE_NOT_FOUND\";\n        /**\n         * 导航数据解析后，其中不存在有效 IP 地址。\n         */\n        ErrorCode[ErrorCode[\"RC_DOMAIN_NOT_RESOLVE\"] = 30009] = \"RC_DOMAIN_NOT_RESOLVE\";\n        /**\n         * 创建 Socket 失败。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_NOT_CREATED\"] = 30010] = \"RC_SOCKET_NOT_CREATED\";\n        /**\n         * Socket 被断开。\n         */\n        ErrorCode[ErrorCode[\"RC_SOCKET_DISCONNECTED\"] = 30011] = \"RC_SOCKET_DISCONNECTED\";\n        /**\n         * PING 操作失败。\n         */\n        ErrorCode[ErrorCode[\"RC_PING_SEND_FAIL\"] = 30012] = \"RC_PING_SEND_FAIL\";\n        /**\n         * PING 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_PONG_RECV_FAIL\"] = 30013] = \"RC_PONG_RECV_FAIL\";\n        /**\n         * 消息发送失败。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_SEND_FAIL\"] = 30014] = \"RC_MSG_SEND_FAIL\";\n        /**\n         * 做 connect 连接时，收到的 ACK 超时。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ACK_TIMEOUT\"] = 31000] = \"RC_CONN_ACK_TIMEOUT\";\n        /**\n         * 参数错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PROTO_VERSION_ERROR\"] = 31001] = \"RC_CONN_PROTO_VERSION_ERROR\";\n        /**\n         * 参数错误，App Id 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_ID_REJECT\"] = 31002] = \"RC_CONN_ID_REJECT\";\n        /**\n         * 服务器不可用。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_SERVER_UNAVAILABLE\"] = 31003] = \"RC_CONN_SERVER_UNAVAILABLE\";\n        /**\n         * Token 错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_OR_PASSWD_ERROR\"] = 31004] = \"RC_CONN_USER_OR_PASSWD_ERROR\";\n        /**\n         * App Id 与 Token 不匹配。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_NOT_AUTHRORIZED\"] = 31005] = \"RC_CONN_NOT_AUTHRORIZED\";\n        /**\n         * 重定向，地址错误。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_REDIRECTED\"] = 31006] = \"RC_CONN_REDIRECTED\";\n        /**\n         * NAME 与后台注册信息不一致。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_PACKAGE_NAME_INVALID\"] = 31007] = \"RC_CONN_PACKAGE_NAME_INVALID\";\n        /**\n         * APP 被屏蔽、删除或不存在。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_APP_BLOCKED_OR_DELETED\"] = 31008] = \"RC_CONN_APP_BLOCKED_OR_DELETED\";\n        /**\n         * 用户被屏蔽。\n         */\n        ErrorCode[ErrorCode[\"RC_CONN_USER_BLOCKED\"] = 31009] = \"RC_CONN_USER_BLOCKED\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_KICK\"] = 31010] = \"RC_DISCONN_KICK\";\n        /**\n         * Disconnect，由服务器返回，比如用户互踢。\n         */\n        ErrorCode[ErrorCode[\"RC_DISCONN_EXCEPTION\"] = 31011] = \"RC_DISCONN_EXCEPTION\";\n        /**\n         * 协议层内部错误。query，上传下载过程中数据错误。\n         */\n        ErrorCode[ErrorCode[\"RC_QUERY_ACK_NO_DATA\"] = 32001] = \"RC_QUERY_ACK_NO_DATA\";\n        /**\n         * 协议层内部错误。\n         */\n        ErrorCode[ErrorCode[\"RC_MSG_DATA_INCOMPLETE\"] = 32002] = \"RC_MSG_DATA_INCOMPLETE\";\n        /**\n         * 未调用 init 初始化函数。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CLIENT_NOT_INIT\"] = 33001] = \"BIZ_ERROR_CLIENT_NOT_INIT\";\n        /**\n         * 数据库初始化失败。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_DATABASE_ERROR\"] = 33002] = \"BIZ_ERROR_DATABASE_ERROR\";\n        /**\n         * 传入参数无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_INVALID_PARAMETER\"] = 33003] = \"BIZ_ERROR_INVALID_PARAMETER\";\n        /**\n         * 通道无效。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_NO_CHANNEL\"] = 33004] = \"BIZ_ERROR_NO_CHANNEL\";\n        /**\n         * 重新连接成功。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_RECONNECT_SUCCESS\"] = 33005] = \"BIZ_ERROR_RECONNECT_SUCCESS\";\n        /**\n         * 连接中，再调用 connect 被拒绝。\n         */\n        ErrorCode[ErrorCode[\"BIZ_ERROR_CONNECTING\"] = 33006] = \"BIZ_ERROR_CONNECTING\";\n        /**\n         * 消息漫游服务未开通\n         */\n        ErrorCode[ErrorCode[\"MSG_ROAMING_SERVICE_UNAVAILABLE\"] = 33007] = \"MSG_ROAMING_SERVICE_UNAVAILABLE\";\n        ErrorCode[ErrorCode[\"MSG_INSERT_ERROR\"] = 33008] = \"MSG_INSERT_ERROR\";\n        ErrorCode[ErrorCode[\"MSG_DEL_ERROR\"] = 33009] = \"MSG_DEL_ERROR\";\n        /**\n         * 删除会话失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_REMOVE_ERROR\"] = 34001] = \"CONVER_REMOVE_ERROR\";\n        /**\n         *拉取历史消息\n         */\n        ErrorCode[ErrorCode[\"CONVER_GETLIST_ERROR\"] = 34002] = \"CONVER_GETLIST_ERROR\";\n        /**\n         * 会话指定异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_SETOP_ERROR\"] = 34003] = \"CONVER_SETOP_ERROR\";\n        /**\n         * 获取会话未读消息总数失败\n         */\n        ErrorCode[ErrorCode[\"CONVER_TOTAL_UNREAD_ERROR\"] = 34004] = \"CONVER_TOTAL_UNREAD_ERROR\";\n        /**\n         * 获取指定会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_TYPE_UNREAD_ERROR\"] = 34005] = \"CONVER_TYPE_UNREAD_ERROR\";\n        /**\n         * 获取指定用户ID&会话类型未读消息数异常\n         */\n        ErrorCode[ErrorCode[\"CONVER_ID_TYPE_UNREAD_ERROR\"] = 34006] = \"CONVER_ID_TYPE_UNREAD_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_CLEAR_ERROR\"] = 34007] = \"CONVER_CLEAR_ERROR\";\n        ErrorCode[ErrorCode[\"CONVER_GET_ERROR\"] = 34008] = \"CONVER_GET_ERROR\";\n        //群组异常信息\n        /**\n         *\n         */\n        ErrorCode[ErrorCode[\"GROUP_SYNC_ERROR\"] = 35001] = \"GROUP_SYNC_ERROR\";\n        /**\n         * 匹配群信息系异常\n         */\n        ErrorCode[ErrorCode[\"GROUP_MATCH_ERROR\"] = 35002] = \"GROUP_MATCH_ERROR\";\n        //聊天室异常\n        /**\n         * 加入聊天室Id为空\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_ID_ISNULL\"] = 36001] = \"CHATROOM_ID_ISNULL\";\n        /**\n         * 加入聊天室失败\n         */\n        ErrorCode[ErrorCode[\"CHARTOOM_JOIN_ERROR\"] = 36002] = \"CHARTOOM_JOIN_ERROR\";\n        /**\n         * 拉取聊天室历史消息失败\n         */\n        ErrorCode[ErrorCode[\"CHATROOM_HISMESSAGE_ERROR\"] = 36003] = \"CHATROOM_HISMESSAGE_ERROR\";\n        //黑名单异常\n        /**\n         * 加入黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_ADD_ERROR\"] = 37001] = \"BLACK_ADD_ERROR\";\n        /**\n         * 获得指定人员再黑名单中的状态异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_GETSTATUS_ERROR\"] = 37002] = \"BLACK_GETSTATUS_ERROR\";\n        /**\n         * 移除黑名单异常\n         */\n        ErrorCode[ErrorCode[\"BLACK_REMOVE_ERROR\"] = 37003] = \"BLACK_REMOVE_ERROR\";\n        /**\n         * 获取草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_GET_ERROR\"] = 38001] = \"DRAF_GET_ERROR\";\n        /**\n         * 保存草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_SAVE_ERROR\"] = 38002] = \"DRAF_SAVE_ERROR\";\n        /**\n         * 删除草稿失败\n         */\n        ErrorCode[ErrorCode[\"DRAF_REMOVE_ERROR\"] = 38003] = \"DRAF_REMOVE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"SUBSCRIBE_ERROR\"] = 39001] = \"SUBSCRIBE_ERROR\";\n        /**\n         * 关注公众号失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_FILETYPE_ERROR\"] = 41001] = \"QNTKN_FILETYPE_ERROR\";\n        /**\n         * 获取七牛token失败\n         */\n        ErrorCode[ErrorCode[\"QNTKN_GET_ERROR\"] = 41002] = \"QNTKN_GET_ERROR\";\n        /**\n         * cookie被禁用\n         */\n        ErrorCode[ErrorCode[\"COOKIE_ENABLE\"] = 51001] = \"COOKIE_ENABLE\";\n        ErrorCode[ErrorCode[\"GET_MESSAGE_BY_ID_ERROR\"] = 61001] = \"GET_MESSAGE_BY_ID_ERROR\";\n        // 没有注册DeviveId 也就是用户没有登陆\n        ErrorCode[ErrorCode[\"HAVNODEVICEID\"] = 24001] = \"HAVNODEVICEID\";\n        // 已经存在\n        ErrorCode[ErrorCode[\"DEVICEIDISHAVE\"] = 24002] = \"DEVICEIDISHAVE\";\n        // 成功\n        ErrorCode[ErrorCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n        // 没有对应的用户或token\n        ErrorCode[ErrorCode[\"FEILD\"] = 24009] = \"FEILD\";\n        // voip为空\n        ErrorCode[ErrorCode[\"VOIPISNULL\"] = 24013] = \"VOIPISNULL\";\n        // 不支持的Voip引擎\n        ErrorCode[ErrorCode[\"NOENGINETYPE\"] = 24010] = \"NOENGINETYPE\";\n        // channleName 是空\n        ErrorCode[ErrorCode[\"NULLCHANNELNAME\"] = 24011] = \"NULLCHANNELNAME\";\n        // 生成Voipkey失败\n        ErrorCode[ErrorCode[\"VOIPDYANMICERROR\"] = 24012] = \"VOIPDYANMICERROR\";\n        // 没有配置voip\n        ErrorCode[ErrorCode[\"NOVOIP\"] = 24014] = \"NOVOIP\";\n        // 服务器内部错误\n        ErrorCode[ErrorCode[\"INTERNALERRROR\"] = 24015] = \"INTERNALERRROR\";\n        //VOIP close\n        ErrorCode[ErrorCode[\"VOIPCLOSE\"] = 24016] = \"VOIPCLOSE\";\n        ErrorCode[ErrorCode[\"CLOSE_BEFORE_OPEN\"] = 51001] = \"CLOSE_BEFORE_OPEN\";\n        ErrorCode[ErrorCode[\"ALREADY_IN_USE\"] = 51002] = \"ALREADY_IN_USE\";\n        ErrorCode[ErrorCode[\"INVALID_CHANNEL_NAME\"] = 51003] = \"INVALID_CHANNEL_NAME\";\n        ErrorCode[ErrorCode[\"VIDEO_CONTAINER_IS_NULL\"] = 51004] = \"VIDEO_CONTAINER_IS_NULL\";\n        /**\n        * 删除消息数组长度为 0 .\n        */\n        ErrorCode[ErrorCode[\"DELETE_MESSAGE_ID_IS_NULL\"] = 61001] = \"DELETE_MESSAGE_ID_IS_NULL\";\n        /*!\n        己方取消已发出的通话请求\n        */\n        ErrorCode[ErrorCode[\"CANCEL\"] = 1] = \"CANCEL\";\n        /*!\n         己方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REJECT\"] = 2] = \"REJECT\";\n        /*!\n         己方挂断\n         */\n        ErrorCode[ErrorCode[\"HANGUP\"] = 3] = \"HANGUP\";\n        /*!\n         己方忙碌\n         */\n        ErrorCode[ErrorCode[\"BUSYLINE\"] = 4] = \"BUSYLINE\";\n        /*!\n         己方未接听\n         */\n        ErrorCode[ErrorCode[\"NO_RESPONSE\"] = 5] = \"NO_RESPONSE\";\n        /*!\n         己方不支持当前引擎\n         */\n        ErrorCode[ErrorCode[\"ENGINE_UN_SUPPORTED\"] = 6] = \"ENGINE_UN_SUPPORTED\";\n        /*!\n         己方网络出错\n         */\n        ErrorCode[ErrorCode[\"NETWORK_ERROR\"] = 7] = \"NETWORK_ERROR\";\n        /*!\n         对方取消已发出的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_CANCEL\"] = 11] = \"REMOTE_CANCEL\";\n        /*!\n         对方拒绝收到的通话请求\n         */\n        ErrorCode[ErrorCode[\"REMOTE_REJECT\"] = 12] = \"REMOTE_REJECT\";\n        /*!\n         通话过程对方挂断\n         */\n        ErrorCode[ErrorCode[\"REMOTE_HANGUP\"] = 13] = \"REMOTE_HANGUP\";\n        /*!\n         对方忙碌\n         */\n        ErrorCode[ErrorCode[\"REMOTE_BUSYLINE\"] = 14] = \"REMOTE_BUSYLINE\";\n        /*!\n         对方未接听\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NO_RESPONSE\"] = 15] = \"REMOTE_NO_RESPONSE\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_ENGINE_UN_SUPPORTED\"] = 16] = \"REMOTE_ENGINE_UN_SUPPORTED\";\n        /*!\n         对方网络错误\n         */\n        ErrorCode[ErrorCode[\"REMOTE_NETWORK_ERROR\"] = 17] = \"REMOTE_NETWORK_ERROR\";\n        /*!\n         VoIP 不可用\n         */\n        ErrorCode[ErrorCode[\"VOIP_NOT_AVALIABLE\"] = 18] = \"VOIP_NOT_AVALIABLE\";\n    })(RongIMLib.ErrorCode || (RongIMLib.ErrorCode = {}));\n    var ErrorCode = RongIMLib.ErrorCode;\n    (function (VoIPMediaType) {\n        VoIPMediaType[VoIPMediaType[\"MEDIA_AUDIO\"] = 1] = \"MEDIA_AUDIO\";\n        VoIPMediaType[VoIPMediaType[\"MEDIA_VEDIO\"] = 2] = \"MEDIA_VEDIO\";\n    })(RongIMLib.VoIPMediaType || (RongIMLib.VoIPMediaType = {}));\n    var VoIPMediaType = RongIMLib.VoIPMediaType;\n    (function (MediaType) {\n        /**\n         * 图片。\n         */\n        MediaType[MediaType[\"IMAGE\"] = 1] = \"IMAGE\";\n        /**\n         * 声音。\n         */\n        MediaType[MediaType[\"AUDIO\"] = 2] = \"AUDIO\";\n        /**\n         * 视频。\n         */\n        MediaType[MediaType[\"VIDEO\"] = 3] = \"VIDEO\";\n        /**\n         * 通用文件。\n         */\n        MediaType[MediaType[\"FILE\"] = 100] = \"FILE\";\n    })(RongIMLib.MediaType || (RongIMLib.MediaType = {}));\n    var MediaType = RongIMLib.MediaType;\n    (function (MessageDirection) {\n        /**\n         * 发送消息。\n         */\n        MessageDirection[MessageDirection[\"SEND\"] = 1] = \"SEND\";\n        /**\n         * 接收消息。\n         */\n        MessageDirection[MessageDirection[\"RECEIVE\"] = 2] = \"RECEIVE\";\n    })(RongIMLib.MessageDirection || (RongIMLib.MessageDirection = {}));\n    var MessageDirection = RongIMLib.MessageDirection;\n    (function (FileType) {\n        FileType[FileType[\"IMAGE\"] = 1] = \"IMAGE\";\n        FileType[FileType[\"AUDIO\"] = 2] = \"AUDIO\";\n        FileType[FileType[\"VIDEO\"] = 3] = \"VIDEO\";\n        FileType[FileType[\"FILE\"] = 4] = \"FILE\";\n    })(RongIMLib.FileType || (RongIMLib.FileType = {}));\n    var FileType = RongIMLib.FileType;\n    (function (RealTimeLocationErrorCode) {\n        /**\n         * 未初始化 RealTimeLocation 实例\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NOT_INIT\"] = -1] = \"RC_REAL_TIME_LOCATION_NOT_INIT\";\n        /**\n         * 执行成功。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_SUCCESS\"] = 0] = \"RC_REAL_TIME_LOCATION_SUCCESS\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * GPS 未打开。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_GPS_DISABLED\"] = 1] = \"RC_REAL_TIME_LOCATION_GPS_DISABLED\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 当前会话不支持位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\"] = 2] = \"RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT\";\n        /**\n         * 获取 RealTimeLocation 实例时返回\n         * 对方已发起位置共享。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_IS_ON_GOING\"] = 3] = \"RC_REAL_TIME_LOCATION_IS_ON_GOING\";\n        /**\n         * Join 时返回\n         * 当前位置共享已超过最大支持人数。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\"] = 4] = \"RC_REAL_TIME_LOCATION_EXCEED_MAX_PARTICIPANT\";\n        /**\n         * Join 时返回\n         * 加入位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_JOIN_FAILURE\"] = 5] = \"RC_REAL_TIME_LOCATION_JOIN_FAILURE\";\n        /**\n         * Start 时返回\n         * 发起位置共享失败。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_START_FAILURE\"] = 6] = \"RC_REAL_TIME_LOCATION_START_FAILURE\";\n        /**\n         * 网络不可用。\n         */\n        RealTimeLocationErrorCode[RealTimeLocationErrorCode[\"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\"] = 7] = \"RC_REAL_TIME_LOCATION_NETWORK_UNAVAILABLE\";\n    })(RongIMLib.RealTimeLocationErrorCode || (RongIMLib.RealTimeLocationErrorCode = {}));\n    var RealTimeLocationErrorCode = RongIMLib.RealTimeLocationErrorCode;\n    (function (RealTimeLocationStatus) {\n        /**\n         * 空闲状态 （默认状态）\n         * 对方或者自己都未发起位置共享业务，或者位置共享业务已结束。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_IDLE\"] = 0] = \"RC_REAL_TIME_LOCATION_STATUS_IDLE\";\n        /**\n         * 呼入状态 （待加入）\n         * 1. 对方发起了位置共享业务，此状态下，自己只能选择加入。\n         * 2. 自己从已连接的位置共享中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_INCOMING\"] = 1] = \"RC_REAL_TIME_LOCATION_STATUS_INCOMING\";\n        /**\n         * 呼出状态 =（自己创建）\n         * 1. 自己发起位置共享业务，对方只能选择加入。\n         * 2. 对方从已连接的位置共享业务中退出。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\"] = 2] = \"RC_REAL_TIME_LOCATION_STATUS_OUTGOING\";\n        /**\n         * 连接状态 （自己加入）\n         * 对方加入了自己发起的位置共享，或者自己加入了对方发起的位置共享。\n         */\n        RealTimeLocationStatus[RealTimeLocationStatus[\"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\"] = 3] = \"RC_REAL_TIME_LOCATION_STATUS_CONNECTED\";\n    })(RongIMLib.RealTimeLocationStatus || (RongIMLib.RealTimeLocationStatus = {}));\n    var RealTimeLocationStatus = RongIMLib.RealTimeLocationStatus;\n    (function (ReceivedStatus) {\n        ReceivedStatus[ReceivedStatus[\"READ\"] = 1] = \"READ\";\n        ReceivedStatus[ReceivedStatus[\"LISTENED\"] = 2] = \"LISTENED\";\n        ReceivedStatus[ReceivedStatus[\"DOWNLOADED\"] = 4] = \"DOWNLOADED\";\n        ReceivedStatus[ReceivedStatus[\"RETRIEVED\"] = 8] = \"RETRIEVED\";\n        ReceivedStatus[ReceivedStatus[\"UNREAD\"] = 0] = \"UNREAD\";\n    })(RongIMLib.ReceivedStatus || (RongIMLib.ReceivedStatus = {}));\n    var ReceivedStatus = RongIMLib.ReceivedStatus;\n    (function (SearchType) {\n        /**\n         * 精确。\n         */\n        SearchType[SearchType[\"EXACT\"] = 0] = \"EXACT\";\n        /**\n         * 模糊。\n         */\n        SearchType[SearchType[\"FUZZY\"] = 1] = \"FUZZY\";\n    })(RongIMLib.SearchType || (RongIMLib.SearchType = {}));\n    var SearchType = RongIMLib.SearchType;\n    (function (SentStatus) {\n        /**\n         * 发送中。\n         */\n        SentStatus[SentStatus[\"SENDING\"] = 10] = \"SENDING\";\n        /**\n         * 发送失败。\n         */\n        SentStatus[SentStatus[\"FAILED\"] = 20] = \"FAILED\";\n        /**\n         * 已发送。\n         */\n        SentStatus[SentStatus[\"SENT\"] = 30] = \"SENT\";\n        /**\n         * 对方已接收。\n         */\n        SentStatus[SentStatus[\"RECEIVED\"] = 40] = \"RECEIVED\";\n        /**\n         * 对方已读。\n         */\n        SentStatus[SentStatus[\"READ\"] = 50] = \"READ\";\n        /**\n         * 对方已销毁。\n         */\n        SentStatus[SentStatus[\"DESTROYED\"] = 60] = \"DESTROYED\";\n    })(RongIMLib.SentStatus || (RongIMLib.SentStatus = {}));\n    var SentStatus = RongIMLib.SentStatus;\n    (function (ConnectionState) {\n        ConnectionState[ConnectionState[\"ACCEPTED\"] = 0] = \"ACCEPTED\";\n        ConnectionState[ConnectionState[\"UNACCEPTABLE_PROTOCOL_VERSION\"] = 1] = \"UNACCEPTABLE_PROTOCOL_VERSION\";\n        ConnectionState[ConnectionState[\"IDENTIFIER_REJECTED\"] = 2] = \"IDENTIFIER_REJECTED\";\n        ConnectionState[ConnectionState[\"SERVER_UNAVAILABLE\"] = 3] = \"SERVER_UNAVAILABLE\";\n        /**\n         * token无效\n         */\n        ConnectionState[ConnectionState[\"TOKEN_INCORRECT\"] = 4] = \"TOKEN_INCORRECT\";\n        ConnectionState[ConnectionState[\"NOT_AUTHORIZED\"] = 5] = \"NOT_AUTHORIZED\";\n        ConnectionState[ConnectionState[\"REDIRECT\"] = 6] = \"REDIRECT\";\n        ConnectionState[ConnectionState[\"PACKAGE_ERROR\"] = 7] = \"PACKAGE_ERROR\";\n        ConnectionState[ConnectionState[\"APP_BLOCK_OR_DELETE\"] = 8] = \"APP_BLOCK_OR_DELETE\";\n        ConnectionState[ConnectionState[\"BLOCK\"] = 9] = \"BLOCK\";\n        ConnectionState[ConnectionState[\"TOKEN_EXPIRE\"] = 10] = \"TOKEN_EXPIRE\";\n        ConnectionState[ConnectionState[\"DEVICE_ERROR\"] = 11] = \"DEVICE_ERROR\";\n    })(RongIMLib.ConnectionState || (RongIMLib.ConnectionState = {}));\n    var ConnectionState = RongIMLib.ConnectionState;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var RongIMClient = (function () {\n        function RongIMClient() {\n        }\n        RongIMClient.getInstance = function () {\n            if (!RongIMClient._instance) {\n                throw new Error(\"RongIMClient is not initialized. Call .init() method first.\");\n            }\n            return RongIMClient._instance;\n        };\n        /**\n         * 初始化 SDK，在整个应用全局只需要调用一次。\n         * @param appKey    开发者后台申请的 AppKey，用来标识应用。\n         * @param dataAccessProvider 必须是DataAccessProvider的实例\n         */\n        RongIMClient.init = function (appKey, dataAccessProvider, options, callback) {\n            if (!RongIMClient._instance) {\n                RongIMClient._instance = new RongIMClient();\n            }\n            options = options || {};\n            var protocol = \"//\", wsScheme = 'ws://';\n            var protocols = 'http:,https:';\n            if (protocols.indexOf(location.protocol) == -1) {\n                protocol = 'http://';\n            }\n            if (location.protocol == 'https:') {\n                wsScheme = 'wss://';\n            }\n            var isPolling = false;\n            if (typeof WebSocket != 'function') {\n                isPolling = true;\n            }\n            var supportUserData = function () {\n                var element = document.documentElement;\n                return element.addBehavior;\n            };\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                RongIMClient._storageProvider = new RongIMLib.LocalStorageProvider();\n            }\n            else if (supportUserData()) {\n                RongIMClient._storageProvider = new RongIMLib.UserDataProvider();\n            }\n            else {\n                RongIMClient._storageProvider = new RongIMLib.MemeoryProvider();\n            }\n            var pathTmpl = '{0}{1}';\n            var _serverPath = {\n                navi: 'nav.cn.ronghub.com',\n                api: 'api.cn.ronghub.com'\n            };\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                _serverPath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.forEach(_serverPath, function (path, key) {\n                var hasProto = (key in options);\n                var config = {\n                    path: options[key],\n                    tmpl: pathTmpl,\n                    protocol: protocol,\n                    sub: true\n                };\n                path = hasProto ? RongIMLib.RongUtil.formatProtoclPath(config) : path;\n                options[key] = path;\n            });\n            var _sourcePath = {\n                protobuf: 'cdn.ronghub.com/protobuf-2.2.7.min.js'\n            };\n            RongIMLib.RongUtil.forEach(_sourcePath, function (path, key) {\n                _sourcePath[key] = RongIMLib.RongUtil.stringFormat(pathTmpl, [protocol, path]);\n            });\n            RongIMLib.RongUtil.extends(_sourcePath, options);\n            var _defaultOpts = {\n                isPolling: isPolling,\n                wsScheme: wsScheme,\n                protocol: protocol,\n                openMp: true\n            };\n            RongIMLib.RongUtil.extends(_defaultOpts, options);\n            if (RongIMLib.RongUtil.isFunction(options.protobuf)) {\n                RongIMClient.Protobuf = options.protobuf;\n            }\n            var pather = new RongIMLib.FeaturePatcher();\n            pather.patchAll();\n            var tempStore = {\n                token: \"\",\n                callback: null,\n                lastReadTime: new RongIMLib.LimitableMap(),\n                conversationList: [],\n                appKey: appKey,\n                publicServiceMap: new RongIMLib.PublicServiceMap(),\n                providerType: 1,\n                deltaTime: 0,\n                filterMessages: [],\n                isSyncRemoteConverList: true,\n                otherDevice: false,\n                custStore: {},\n                converStore: { latestMessage: {} },\n                connectAckTime: 0,\n                voipStategy: 0,\n                isFirstPingMsg: true,\n                depend: options,\n                listenerList: RongIMClient._memoryStore.listenerList,\n                notification: {}\n            };\n            RongIMClient._memoryStore = tempStore;\n            if (dataAccessProvider && Object.prototype.toString.call(dataAccessProvider) == \"[object Object]\") {\n                RongIMClient._dataAccessProvider = dataAccessProvider;\n            }\n            else {\n                RongIMClient._dataAccessProvider = new RongIMLib.ServerDataProvider();\n            }\n            RongIMClient._dataAccessProvider.init(appKey, callback);\n            // 兼容 c++ 设置导航，Web 端不生效\n            RongIMClient._dataAccessProvider.setServerInfo({ navi: options.navi + '/navi.xml' });\n            RongIMClient.MessageParams = {\n                TextMessage: { objectName: \"RC:TxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ImageMessage: { objectName: \"RC:ImgMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                DiscussionNotificationMessage: { objectName: \"RC:DizNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                VoiceMessage: { objectName: \"RC:VcMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                RichContentMessage: { objectName: \"RC:ImgTextMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                FileMessage: { objectName: \"RC:FileMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                HandshakeMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                UnknownMessage: { objectName: \"\", msgTag: new RongIMLib.MessageTag(true, true) },\n                LocationMessage: { objectName: \"RC:LBSMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                InformationNotificationMessage: { objectName: \"RC:InfoNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ContactNotificationMessage: { objectName: \"RC:ContactNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                ProfileNotificationMessage: { objectName: \"RC:ProfileNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                CommandNotificationMessage: { objectName: \"RC:CmdNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceRichContentMessage: { objectName: \"RC:PSImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                PublicServiceMultiRichContentMessage: { objectName: \"RC:PSMultiImgTxtMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfReadPacketMessage: { objectName: \"RCJrmf:RpMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                JrmfReadPacketOpenedMessage: { objectName: \"RCJrmf:RpOpendMsg\", msgTag: new RongIMLib.MessageTag(true, true) },\n                GroupNotificationMessage: { objectName: \"RC:GrpNtf\", msgTag: new RongIMLib.MessageTag(true, true) },\n                CommandMessage: { objectName: \"RC:CmdMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TypingStatusMessage: { objectName: \"RC:TypSts\", msgTag: new RongIMLib.MessageTag(false, false) },\n                PublicServiceCommandMessage: { objectName: \"RC:PSCmd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RecallCommandMessage: { objectName: \"RC:RcCmd\", msgTag: new RongIMLib.MessageTag(false, true) },\n                SyncReadStatusMessage: { objectName: \"RC:SRSMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptRequestMessage: { objectName: \"RC:RRReqMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptResponseMessage: { objectName: \"RC:RRRspMsg\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeResponseMessage: { objectName: \"RC:CsChaR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ChangeModeMessage: { objectName: \"RC:CSCha\", msgTag: new RongIMLib.MessageTag(false, false) },\n                EvaluateMessage: { objectName: \"RC:CsEva\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerContact: { objectName: \"RC:CsContact\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeMessage: { objectName: \"RC:CsHs\", msgTag: new RongIMLib.MessageTag(false, false) },\n                HandShakeResponseMessage: { objectName: \"RC:CsHsR\", msgTag: new RongIMLib.MessageTag(false, false) },\n                SuspendMessage: { objectName: \"RC:CsSp\", msgTag: new RongIMLib.MessageTag(false, false) },\n                TerminateMessage: { objectName: \"RC:CsEnd\", msgTag: new RongIMLib.MessageTag(false, false) },\n                CustomerStatusUpdateMessage: { objectName: \"RC:CsUpdate\", msgTag: new RongIMLib.MessageTag(false, false) },\n                ReadReceiptMessage: { objectName: \"RC:ReadNtf\", msgTag: new RongIMLib.MessageTag(false, false) },\n                RCEUpdateStatusMessage: { objectName: \"RCE:UpdateStatus\", msgTag: new RongIMLib.MessageTag(false, false) }\n            };\n            RongIMClient.MessageParams[\"AcceptMessage\"] = { objectName: \"RC:VCAccept\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"RingingMessage\"] = { objectName: \"RC:VCRinging\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"SummaryMessage\"] = { objectName: \"RC:VCSummary\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"HungupMessage\"] = { objectName: \"RC:VCHangup\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"InviteMessage\"] = { objectName: \"RC:VCInvite\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MediaModifyMessage\"] = { objectName: \"RC:VCModifyMedia\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageParams[\"MemberModifyMessage\"] = { objectName: \"RC:VCModifyMem\", msgTag: new RongIMLib.MessageTag(false, false) };\n            RongIMClient.MessageType = {\n                TextMessage: \"TextMessage\",\n                ImageMessage: \"ImageMessage\",\n                DiscussionNotificationMessage: \"DiscussionNotificationMessage\",\n                VoiceMessage: \"VoiceMessage\",\n                RichContentMessage: \"RichContentMessage\",\n                HandshakeMessage: \"HandshakeMessage\",\n                UnknownMessage: \"UnknownMessage\",\n                LocationMessage: \"LocationMessage\",\n                InformationNotificationMessage: \"InformationNotificationMessage\",\n                ContactNotificationMessage: \"ContactNotificationMessage\",\n                ProfileNotificationMessage: \"ProfileNotificationMessage\",\n                CommandNotificationMessage: \"CommandNotificationMessage\",\n                CommandMessage: \"CommandMessage\",\n                TypingStatusMessage: \"TypingStatusMessage\",\n                ChangeModeResponseMessage: \"ChangeModeResponseMessage\",\n                ChangeModeMessage: \"ChangeModeMessage\",\n                EvaluateMessage: \"EvaluateMessage\",\n                HandShakeMessage: \"HandShakeMessage\",\n                HandShakeResponseMessage: \"HandShakeResponseMessage\",\n                SuspendMessage: \"SuspendMessage\",\n                TerminateMessage: \"TerminateMessage\",\n                CustomerContact: \"CustomerContact\",\n                CustomerStatusUpdateMessage: \"CustomerStatusUpdateMessage\",\n                SyncReadStatusMessage: \"SyncReadStatusMessage\",\n                ReadReceiptRequestMessage: \"ReadReceiptRequestMessage\",\n                ReadReceiptResponseMessage: \"ReadReceiptResponseMessage\",\n                FileMessage: 'FileMessage',\n                AcceptMessage: \"AcceptMessage\",\n                RingingMessage: \"RingingMessage\",\n                SummaryMessage: \"SummaryMessage\",\n                HungupMessage: \"HungupMessage\",\n                InviteMessage: \"InviteMessage\",\n                MediaModifyMessage: \"MediaModifyMessage\",\n                MemberModifyMessage: \"MemberModifyMessage\",\n                JrmfReadPacketMessage: \"JrmfReadPacketMessage\",\n                JrmfReadPacketOpenedMessage: \"JrmfReadPacketOpenedMessage\",\n                RCEUpdateStatusMessage: \"RCEUpdateStatusMessage\",\n                GroupNotificationMessage: \"GroupNotificationMessage\",\n                PublicServiceRichContentMessage: \"PublicServiceRichContentMessage\",\n                PublicServiceMultiRichContentMessage: \"PublicServiceMultiRichContentMessage\",\n                PublicServiceCommandMessage: \"PublicServiceCommandMessage\",\n                RecallCommandMessage: \"RecallCommandMessage\",\n                ReadReceiptMessage: \"ReadReceiptMessage\"\n            };\n        };\n        /**\n            var config = {\n                appkey: appkey,\n                token: token,\n                dataAccessProvider:dataAccessProvider,\n                opts: opts\n            };\n            callback(_instance, userId);\n        */\n        RongIMClient.initApp = function (config, callback) {\n            RongIMClient.init(config.appkey, config.dataAccessProvider, config.opts, function () {\n                var instance = RongIMClient._instance;\n                //备用\n                var error = null;\n                callback(error, instance);\n            });\n        };\n        /**\n         * 连接服务器，在整个应用全局只需要调用一次，断线后 SDK 会自动重连。\n         *\n         * @param token     从服务端获取的用户身份令牌（Token）。\n         * @param callback  连接回调，返回连接的成功或者失败状态。\n         */\n        RongIMClient.connect = function (token, callback, userId) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\", \"string|null|object|global|undefined\"], \"connect\", true, arguments);\n            RongIMClient._dataAccessProvider.connect(token, callback, userId);\n        };\n        RongIMClient.reconnect = function (callback, config) {\n            RongIMClient._dataAccessProvider.reconnect(callback, config);\n        };\n        /**\n         * 注册消息类型，用于注册用户自定义的消息。\n         * 内建的消息类型已经注册过，不需要再次注册。\n         * 自定义消息声明需放在执行顺序最高的位置（在RongIMClient.init(appkey)之后即可）\n         * @param objectName  消息内置名称\n         */\n        RongIMClient.registerMessageType = function (messageType, objectName, messageTag, messageContent) {\n            RongIMClient._dataAccessProvider.registerMessageType(messageType, objectName, messageTag, messageContent);\n            RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            RongIMClient.MessageType[messageType] = messageType;\n            RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n        };\n        /**\n         * 设置连接状态变化的监听器。\n         *\n         * @param listener  连接状态变化的监听器。\n         */\n        RongIMClient.setConnectionStatusListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setConnectionStatusListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 设置接收消息的监听器。\n         *\n         * @param listener  接收消息的监听器。\n         */\n        RongIMClient.setOnReceiveMessageListener = function (listener) {\n            if (RongIMClient._dataAccessProvider) {\n                RongIMClient._dataAccessProvider.setOnReceiveMessageListener(listener);\n            }\n            else {\n                RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        /**\n         * 清理所有连接相关的变量\n         */\n        RongIMClient.prototype.logout = function () {\n            RongIMClient._dataAccessProvider.logout();\n        };\n        /**\n         * 断开连接。\n         */\n        RongIMClient.prototype.disconnect = function () {\n            RongIMClient._dataAccessProvider.disconnect();\n        };\n        RongIMClient.prototype.startCustomService = function (custId, callback, groupId) {\n            if (!custId || !callback)\n                return;\n            var msg;\n            if (typeof groupId == 'undefined') {\n                msg = new RongIMLib.HandShakeMessage();\n            }\n            else {\n                msg = new RongIMLib.HandShakeMessage({ groupid: groupId });\n            }\n            var me = this;\n            RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"] = true;\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    if (data.isBlack) {\n                        callback.onError();\n                        me.stopCustomeService(custId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                    else {\n                        callback.onSuccess();\n                    }\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        RongIMClient.prototype.stopCustomeService = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.SuspendMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, {\n                onSuccess: function () {\n                    // delete RongIMClient._memoryStore.custStore[custId];\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function () {\n                    setTimeout(function () {\n                        callback.onError();\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.switchToHumanMode = function (custId, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.ChangeModeMessage({ sid: session.sid, uid: session.uid, pid: session.pid });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateRebotCustomService = function (custId, isRobotResolved, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, isRobotResolved: isRobotResolved, sugest: sugest, type: 0 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.evaluateHumanCustomService = function (custId, humanValue, sugest, callback) {\n            if (!custId || !callback)\n                return;\n            var session = RongIMClient._memoryStore.custStore[custId];\n            if (!session)\n                return;\n            var msg = new RongIMLib.EvaluateMessage({ sid: session.sid, uid: session.uid, pid: session.pid, humanValue: humanValue, sugest: sugest, type: 1 });\n            this.sendCustMessage(custId, msg, callback);\n        };\n        RongIMClient.prototype.sendCustMessage = function (custId, msg, callback) {\n            RongIMClient.getInstance().sendMessage(RongIMLib.ConversationType.CUSTOMER_SERVICE, custId, msg, {\n                onSuccess: function (data) {\n                    callback.onSuccess();\n                },\n                onError: function () {\n                    callback.onError();\n                },\n                onBefore: function () { }\n            });\n        };\n        /**\n         * 获取当前连接的状态。\n         */\n        RongIMClient.prototype.getCurrentConnectionStatus = function () {\n            return RongIMClient._dataAccessProvider.getCurrentConnectionStatus();\n        };\n        /**\n         * 获取当前使用的连接通道。\n         */\n        RongIMClient.prototype.getConnectionChannel = function () {\n            if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.XHR_POLLING) {\n                return RongIMLib.ConnectionChannel.XHR_POLLING;\n            }\n            else if (RongIMLib.Transportations._TransportType == RongIMLib.Socket.WEBSOCKET) {\n                return RongIMLib.ConnectionChannel.WEBSOCKET;\n            }\n        };\n        /**\n         * 获取当前使用的本地储存提供者。 TODO\n         */\n        RongIMClient.prototype.getStorageProvider = function () {\n            if (RongIMClient._memoryStore.providerType == 1) {\n                return \"ServerDataProvider\";\n            }\n            else {\n                return \"OtherDataProvider\";\n            }\n        };\n        /**\n         * 过滤聊天室消息（拉取最近聊天消息）\n         * @param {string[]} msgFilterNames\n         */\n        RongIMClient.prototype.setFilterMessages = function (msgFilterNames) {\n            if (Object.prototype.toString.call(msgFilterNames) == \"[object Array]\") {\n                RongIMClient._memoryStore.filterMessages = msgFilterNames;\n            }\n        };\n        RongIMClient.prototype.getAgoraDynamicKey = function (engineType, channelName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"getAgoraDynamicKey\", false, arguments);\n            var modules = new RongIMClient.Protobuf.VoipDynamicInput();\n            modules.setEngineType(engineType);\n            modules.setChannelName(channelName);\n            RongIMClient.bridge.queryMsg(32, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, callback, \"VoipDynamicOutput\");\n        };\n        /**\n         * 获取当前连接用户的 UserId。\n         */\n        RongIMClient.prototype.getCurrentUserId = function () {\n            return RongIMLib.Bridge._client.userId;\n        };\n        /**\n         * 获取服务器时间与本地时间的差值，单位为毫秒。\n         * 计算公式：差值 = 本地时间毫秒数 - 服务器时间毫秒数\n         * @param callback  获取的回调，返回差值。\n         */\n        RongIMClient.prototype.getDeltaTime = function () {\n            return RongIMClient._dataAccessProvider.getDelaTime();\n        };\n        // #region Message\n        RongIMClient.prototype.getMessage = function (messageId, callback) {\n            RongIMClient._dataAccessProvider.getMessage(messageId, callback);\n        };\n        RongIMClient.prototype.deleteLocalMessages = function (conversationType, targetId, messageIds, callback) {\n            RongIMClient._dataAccessProvider.removeLocalMessage(conversationType, targetId, messageIds, callback);\n        };\n        RongIMClient.prototype.updateMessage = function (message, callback) {\n            RongIMClient._dataAccessProvider.updateMessage(message, callback);\n        };\n        RongIMClient.prototype.clearMessages = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearMessages(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**TODO 清楚本地存储的未读消息，目前清空内存中的未读消息\n         * [clearMessagesUnreadStatus 清空指定会话未读消息]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [用户id]\n         * @param  {ResultCallback<boolean>} callback         [返回值，参数回调]\n         */\n        RongIMClient.prototype.clearMessagesUnreadStatus = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.updateMessages(conversationType, targetId, \"readStatus\", null, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.deleteRemoteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"object\"], \"deleteRemoteMessages\", false, arguments);\n            if (delMsgs.length == 0) {\n                callback.onError(RongIMLib.ErrorCode.DELETE_MESSAGE_ID_IS_NULL);\n                return;\n            }\n            else if (delMsgs.length > 100) {\n                delMsgs.length = 100;\n            }\n            // 后续增加，去掉注释即可\n            callback.onSuccess(true);\n            // var modules = new RongIMClient.Protobuf.DeleteMsgInput();\n            // modules.setType(conversationType);\n            // modules.setConversationId(targetId);\n            // modules.setMsgs(delMsgs);\n            // RongIMClient.bridge.queryMsg(33, MessageUtil.ArrayForm(modules.toArrayBuffer()), Bridge._client.userId, {\n            //     onSuccess: function(info: any) {\n            //         callback.onSuccess(true);\n            //     },\n            //     onError: function(err: any) {\n            //         callback.onError(err);\n            //     }\n            // }, \"DeleteMsgOutput\");\n        };\n        /**\n         * [deleteMessages 删除消息记录。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {number[]}                messageIds       [description]\n         * @param  {ResultCallback<boolean>} callback         [description]\n         */\n        RongIMClient.prototype.deleteMessages = function (conversationType, targetId, delMsgs, callback) {\n            RongIMClient._dataAccessProvider.removeMessage(conversationType, targetId, delMsgs, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.sendLocalMessage = function (message, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"object\"], \"sendLocalMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.updateMessage(message);\n            this.sendMessage(message.conversationType, message.targetId, message.content, callback);\n        };\n        /**\n         * [sendMessage 发送消息。]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {MessageContent}          messageContent   [消息类型]\n         * @param  {SendMessageCallback}     sendCallback     []\n         * @param  {ResultCallback<Message>} resultCallback   [返回值，函数回调]\n         * @param  {string}                  pushContent      []\n         * @param  {string}                  pushData         []\n         */\n        RongIMClient.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\", \"object\", \"undefined|object|null|global|boolean\", \"undefined|object|null|global|string\", \"undefined|object|null|global|string\", \"undefined|object|null|global|number\", \"undefined|object|null|global\"], \"sendMessage\", false, arguments);\n            RongIMClient._dataAccessProvider.sendMessage(conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params);\n        };\n        RongIMClient.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            RongIMClient._dataAccessProvider.sendReceiptResponse(conversationType, targetId, sendCallback);\n        };\n        RongIMClient.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            RongIMClient._dataAccessProvider.sendTypingStatusMessage(conversationType, targetId, messageName, sendCallback);\n        };\n        /**\n         * [sendStatusMessage description]\n         * @param  {MessageContent}          messageContent [description]\n         * @param  {SendMessageCallback}     sendCallback   [description]\n         * @param  {ResultCallback<Message>} resultCallback [description]\n         */\n        RongIMClient.prototype.sendStatusMessage = function (messageContent, sendCallback, resultCallback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [sendTextMessage 发送TextMessage快捷方式]\n         * @param  {string}                  content        [消息内容]\n         * @param  {ResultCallback<Message>} resultCallback [返回值，参数回调]\n         */\n        RongIMClient.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendTextMessage(conversationType, targetId, content, sendMessageCallback);\n        };\n        RongIMClient.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            RongIMClient._dataAccessProvider.sendRecallMessage(content, sendMessageCallback);\n        };\n        /**\n         * [insertMessage 向本地插入一条消息，不发送到服务器。]\n         * @param  {ConversationType}        conversationType [description]\n         * @param  {string}                  targetId         [description]\n         * @param  {string}                  senderUserId     [description]\n         * @param  {MessageContent}          content          [description]\n         * @param  {ResultCallback<Message>} callback         [description]\n         */\n        RongIMClient.prototype.insertMessage = function (conversationType, targetId, senderUserId, content, callback) {\n            RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, content, callback);\n        };\n        /**\n         * [getHistoryMessages 拉取历史消息记录。]\n         * @param  {ConversationType}          conversationType [会话类型]\n         * @param  {string}                    targetId         [用户Id]\n         * @param  {number|null}               pullMessageTime  [拉取历史消息起始位置(格式为毫秒数)，可以为null]\n         * @param  {number}                    count            [历史消息数量]\n         * @param  {ResultCallback<Message[]>} callback         [回调函数]\n         * @param  {string}                    objectName       [objectName]\n         */\n        RongIMClient.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\", \"undefined|object|null|global|string\", \"boolean|null|global|object\"], \"getHistoryMessages\", false, arguments);\n            if (count > 20) {\n                throw new Error(\"HistroyMessage count must be less than or equal to 20!\");\n            }\n            if (conversationType.valueOf() < 0) {\n                throw new Error(\"ConversationType must be greater than -1\");\n            }\n            RongIMClient._dataAccessProvider.getHistoryMessages(conversationType, targetId, timestamp, count, callback, objectname, direction);\n        };\n        RongIMClient.prototype.setMessageContent = function (messageId, content, objectName) {\n            RongIMClient._dataAccessProvider.setMessageContent(messageId, content, objectName);\n        };\n        ;\n        /**\n         * [getRemoteHistoryMessages 拉取某个时间戳之前的消息]\n         * @param  {ConversationType}          conversationType [description]\n         * @param  {string}                    targetId         [description]\n         * @param  {Date}                      dateTime         [description]\n         * @param  {number}                    count            [description]\n         * @param  {ResultCallback<Message[]>} callback         [description]\n         */\n        RongIMClient.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"number|null|global|object\", \"number\", \"object\"], \"getRemoteHistoryMessages\", false, arguments);\n            if (count > 20) {\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            if (conversationType.valueOf() < 0) {\n                callback.onError(RongIMLib.ErrorCode.RC_CONN_PROTO_VERSION_ERROR);\n                return;\n            }\n            RongIMClient._dataAccessProvider.getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback);\n        };\n        /**\n         * [hasRemoteUnreadMessages 是否有未接收的消息，jsonp方法]\n         * @param  {string}          appkey   [appkey]\n         * @param  {string}          token    [token]\n         * @param  {ConnectCallback} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            RongIMClient._dataAccessProvider.hasRemoteUnreadMessages(token, callback);\n        };\n        RongIMClient.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.getTotalUnreadCount({\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, conversationTypes);\n        };\n        /**\n         * [getConversationUnreadCount 指定多种会话类型获取未读消息数]\n         * @param  {ResultCallback<number>} callback             [返回值，参数回调。]\n         * @param  {ConversationType[]}     ...conversationTypes [会话类型。]\n         */\n        RongIMClient.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            RongIMClient._dataAccessProvider.getConversationUnreadCount(conversationTypes, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getUnreadCount 指定用户、会话类型的未读消息总数。]\n         * @param  {ConversationType} conversationType [会话类型]\n         * @param  {string}           targetId         [用户Id]\n         */\n        RongIMClient.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.getUnreadCount(conversationType, targetId, {\n                onSuccess: function (count) {\n                    setTimeout(function () {\n                        callback.onSuccess(count);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCountByTimestamp(conversationType, targetId, timestamp, callback);\n        };\n        /**\n         * 清楚会话未读消息数\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         * @param  {ResultCallback<boolean>} callback         返回值，函数回调\n         */\n        RongIMClient.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMClient._dataAccessProvider.clearUnreadCount(conversationType, targetId, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.clearLocalStorage = function (callback) {\n            RongIMClient._storageProvider.clearItem();\n            callback();\n        };\n        RongIMClient.prototype.setMessageExtra = function (messageId, value, callback) {\n            RongIMClient._dataAccessProvider.setMessageExtra(messageId, value, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageReceivedStatus = function (messageUId, receivedStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageReceivedStatus(messageUId, receivedStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        RongIMClient.prototype.setMessageStatus = function (conersationType, targetId, timestamp, status, callback) {\n            RongIMClient._dataAccessProvider.setMessageStatus(conersationType, targetId, timestamp, status, callback);\n        };\n        RongIMClient.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            RongIMClient._dataAccessProvider.setMessageSentStatus(messageId, sentStatus, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Message\n        // #region TextMessage Draft\n        /**\n         * clearTextMessageDraft 清除指定会话和消息类型的草稿。\n         * @param  {ConversationType}        conversationType 会话类型\n         * @param  {string}                  targetId         目标Id\n         */\n        RongIMClient.prototype.clearTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"clearTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            delete RongIMClient._memoryStore[key];\n            return true;\n        };\n        /**\n         * [getTextMessageDraft 获取指定消息和会话的草稿。]\n         * @param  {ConversationType}       conversationType [会话类型]\n         * @param  {string}                 targetId         [目标Id]\n         */\n        RongIMClient.prototype.getTextMessageDraft = function (conversationType, targetId) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getTextMessageDraft\", false, arguments);\n            if (targetId == \"\" || conversationType < 0) {\n                throw new Error(\"params error : \" + RongIMLib.ErrorCode.DRAF_GET_ERROR);\n            }\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            return RongIMClient._memoryStore[key];\n        };\n        /**\n         * [saveTextMessageDraft description]\n         * @param  {ConversationType}        conversationType [会话类型]\n         * @param  {string}                  targetId         [目标Id]\n         * @param  {string}                  value            [草稿值]\n         */\n        RongIMClient.prototype.saveTextMessageDraft = function (conversationType, targetId, value) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\", \"object\"], \"saveTextMessageDraft\", false, arguments);\n            var key = \"darf_\" + conversationType + \"_\" + targetId;\n            RongIMClient._memoryStore[key] = value;\n            return true;\n        };\n        // #endregion TextMessage Draft\n        // #region Conversation\n        RongIMClient.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            RongIMClient._dataAccessProvider.searchConversationByContent(keyword, callback, conversationTypes);\n        };\n        RongIMClient.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            RongIMClient._dataAccessProvider.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, callback);\n        };\n        RongIMClient.prototype.clearConversations = function (callback) {\n            var conversationTypes = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                conversationTypes[_i - 1] = arguments[_i];\n            }\n            if (conversationTypes.length == 0) {\n                conversationTypes = [RongIMLib.ConversationType.CHATROOM,\n                    RongIMLib.ConversationType.CUSTOMER_SERVICE,\n                    RongIMLib.ConversationType.DISCUSSION,\n                    RongIMLib.ConversationType.GROUP,\n                    RongIMLib.ConversationType.PRIVATE,\n                    RongIMLib.ConversationType.SYSTEM,\n                    RongIMLib.ConversationType.PUBLIC_SERVICE,\n                    RongIMLib.ConversationType.APP_PUBLIC_SERVICE];\n            }\n            RongIMClient._dataAccessProvider.clearConversations(conversationTypes, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        /**\n         * [getConversation 获取指定会话，此方法需在getConversationList之后执行]\n         * @param  {ConversationType}             conversationType [会话类型]\n         * @param  {string}                       targetId         [目标Id]\n         * @param  {ResultCallback<Conversation>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    setTimeout(function () {\n                        callback.onSuccess(conver);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        /**\n         * [pottingConversation 组装会话列表]\n         * @param {any} tempConver [临时会话]\n         * conver_conversationType_targetId_no.\n         * msg_conversationType_targetId_no.\n         */\n        RongIMClient.prototype.pottingConversation = function (tempConver) {\n            var self = this, isUseReplace = false;\n            RongIMClient._dataAccessProvider.getConversation(tempConver.type, tempConver.userId, {\n                onSuccess: function (conver) {\n                    if (!conver) {\n                        conver = new RongIMLib.Conversation();\n                    }\n                    else {\n                        isUseReplace = true;\n                    }\n                    conver.conversationType = tempConver.type;\n                    conver.targetId = tempConver.userId;\n                    conver.latestMessage = RongIMLib.MessageUtil.messageParser(tempConver.msg);\n                    conver.latestMessageId = conver.latestMessage.messageId;\n                    conver.objectName = conver.latestMessage.objectName;\n                    conver.receivedStatus = conver.latestMessage.receivedStatus;\n                    conver.receivedTime = conver.latestMessage.receiveTime;\n                    conver.sentStatus = conver.latestMessage.sentStatus;\n                    conver.sentTime = conver.latestMessage.sentTime;\n                    var mentioneds = RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conver.conversationType + '_' + conver.targetId);\n                    if (mentioneds) {\n                        var info = JSON.parse(mentioneds);\n                        conver.mentionedMsg = info[tempConver.type + \"_\" + tempConver.userId];\n                    }\n                    if (!isUseReplace) {\n                        if (RongIMLib.RongUtil.supportLocalStorage()) {\n                            var count = RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + tempConver.type + tempConver.userId);\n                            conver.unreadMessageCount = Number(count);\n                        }\n                        else {\n                            conver.unreadMessageCount = 0;\n                        }\n                    }\n                    // if (conver.conversationType == ConversationType.PRIVATE) {\n                    //     self.getUserInfo(tempConver.userId, <ResultCallback<UserInfo>>{\n                    //         onSuccess: function(info: UserInfo) {\n                    //             conver.conversationTitle = info.name;\n                    //             conver.senderUserName = info.name;\n                    //             conver.senderUserId = info.userId;\n                    //             conver.senderPortraitUri = info.portraitUri;\n                    //         },\n                    //         onError: function(error: ErrorCode) { }\n                    //     });\n                    // } else\n                    if (conver.conversationType == RongIMLib.ConversationType.DISCUSSION) {\n                        self.getDiscussion(tempConver.userId, {\n                            onSuccess: function (info) {\n                                conver.conversationTitle = info.name;\n                            },\n                            onError: function (error) { }\n                        });\n                    }\n                    RongIMClient._dataAccessProvider.addConversation(conver, { onSuccess: function (data) { } });\n                },\n                onError: function (error) { }\n            });\n        };\n        RongIMClient.prototype.sortConversationList = function (conversationList) {\n            var convers = [];\n            for (var i = 0, len = conversationList.length; i < len; i++) {\n                if (!conversationList[i]) {\n                    continue;\n                }\n                if (conversationList[i].isTop) {\n                    convers.push(conversationList[i]);\n                    conversationList.splice(i, 1);\n                    continue;\n                }\n                for (var j = 0; j < len - i - 1; j++) {\n                    if (conversationList[j].sentTime < conversationList[j + 1].sentTime) {\n                        var swap = conversationList[j];\n                        conversationList[j] = conversationList[j + 1];\n                        conversationList[j + 1] = swap;\n                    }\n                }\n            }\n            return RongIMClient._memoryStore.conversationList = convers.concat(conversationList);\n        };\n        RongIMClient.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|undefined|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getConversationList\", false, arguments);\n            var me = this;\n            RongIMClient._dataAccessProvider.getConversationList({\n                onSuccess: function (data) {\n                    if (conversationTypes || RongIMClient._dataAccessProvider) {\n                        setTimeout(function () {\n                            callback.onSuccess(data);\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onSuccess(RongIMClient._memoryStore.conversationList);\n                        });\n                    }\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            RongIMLib.CheckParam.getInstance().check([\"object\", \"null|array|object|global\", \"number|undefined|null|object|global\", \"boolean|undefined|null|object|global\"], \"getRemoteConversationList\", false, arguments);\n            RongIMClient._dataAccessProvider.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        RongIMClient.prototype.updateConversation = function (conversation) {\n            return RongIMClient._dataAccessProvider.updateConversation(conversation);\n        };\n        /**\n         * [createConversation 创建会话。]\n         * @param  {number}  conversationType [会话类型]\n         * @param  {string}  targetId         [目标Id]\n         * @param  {string}  converTitle      [会话标题]\n         * @param  {boolean} islocal          [是否同步到服务器，ture：同步，false:不同步]\n         */\n        RongIMClient.prototype.createConversation = function (conversationType, targetId, converTitle) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"string\"], \"createConversation\", false, arguments);\n            var conver = new RongIMLib.Conversation();\n            conver.targetId = targetId;\n            conver.conversationType = conversationType;\n            conver.conversationTitle = converTitle;\n            conver.latestMessage = {};\n            conver.unreadMessageCount = 0;\n            return conver;\n        };\n        //TODO 删除本地和服务器、删除本地和服务器分开\n        RongIMClient.prototype.removeConversation = function (conversationType, targetId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"removeConversation\", false, arguments);\n            RongIMClient._dataAccessProvider.removeConversation(conversationType, targetId, callback);\n        };\n        RongIMClient.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\"], \"setConversationHidden\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        RongIMClient.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"boolean\", \"object\"], \"setConversationToTop\", false, arguments);\n            RongIMClient._dataAccessProvider.setConversationToTop(conversationType, targetId, isTop, {\n                onSuccess: function (bool) {\n                    setTimeout(function () {\n                        callback.onSuccess(bool);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            });\n        };\n        // #endregion Conversation\n        // #region Notifications\n        /**\n         * [getConversationNotificationStatus 获取指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.getConversationNotificationStatus = function (conversationType, targetId, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId\n            };\n            RongIMClient._dataAccessProvider.getConversationNotificationStatus(params, callback);\n        };\n        /**\n         * [setConversationNotificationStatus 设置指定用户和会话类型免提醒。]\n         * @param  {ConversationType}                               conversationType [会话类型]\n         * @param  {string}                                         targetId         [目标Id]\n         * @param  {ResultCallback<ConversationNotificationStatus>} callback         [返回值，函数回调]\n         */\n        RongIMClient.prototype.setConversationNotificationStatus = function (conversationType, targetId, notificationStatus, callback) {\n            var params = {\n                conversationType: conversationType,\n                targetId: targetId,\n                status: status\n            };\n            RongIMClient._dataAccessProvider.setConversationNotificationStatus(params, callback);\n        };\n        /**\n         * [getNotificationQuietHours 获取免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [removeNotificationQuietHours 移除免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeNotificationQuietHours = function (callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        /**\n         * [setNotificationQuietHours 设置免提醒消息时间。]\n         * @param  {GetNotificationQuietHoursCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.setNotificationQuietHours = function (startTime, spanMinutes, callback) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Notifications\n        // #region Discussion\n        /**\n         * [addMemberToDiscussion   加入讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string[]}          userIdList   [讨论中成员]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"addMemberToDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.addMemberToDiscussion(discussionId, userIdList, callback);\n        };\n        /**\n         * [createDiscussion 创建讨论组]\n         * @param  {string}                   name       [讨论组名称]\n         * @param  {string[]}                 userIdList [讨论组成员]\n         * @param  {CreateDiscussionCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.createDiscussion = function (name, userIdList, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"array\", \"object\"], \"createDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.createDiscussion(name, userIdList, callback);\n        };\n        /**\n         * [getDiscussion 获取讨论组信息]\n         * @param  {string}                     discussionId [讨论组Id]\n         * @param  {ResultCallback<Discussion>} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.getDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"getDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.getDiscussion(discussionId, callback);\n        };\n        /**\n         * [quitDiscussion 退出讨论组]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitDiscussion = function (discussionId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"object\"], \"quitDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.quitDiscussion(discussionId, callback);\n        };\n        /**\n         * [removeMemberFromDiscussion 将指定成员移除讨论租]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            userId       [被移除的用户Id]\n         * @param  {OperationCallback} callback     [返回值，参数回调]\n         */\n        RongIMClient.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"removeMemberFromDiscussion\", false, arguments);\n            RongIMClient._dataAccessProvider.removeMemberFromDiscussion(discussionId, userId, callback);\n        };\n        /**\n         * [setDiscussionInviteStatus 设置讨论组邀请状态]\n         * @param  {string}                 discussionId [讨论组Id]\n         * @param  {DiscussionInviteStatus} status       [邀请状态]\n         * @param  {OperationCallback}      callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"number\", \"object\"], \"setDiscussionInviteStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionInviteStatus(discussionId, status, callback);\n        };\n        /**\n         * [setDiscussionName 设置讨论组名称]\n         * @param  {string}            discussionId [讨论组Id]\n         * @param  {string}            name         [讨论组名称]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.setDiscussionName = function (discussionId, name, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string\", \"string\", \"object\"], \"setDiscussionName\", false, arguments);\n            RongIMClient._dataAccessProvider.setDiscussionName(discussionId, name, callback);\n        };\n        // #endregion Discussion\n        // #region ChatRoom\n        /**\n         * [加入聊天室。]\n         * @param  {string}            chatroomId   [聊天室Id]\n         * @param  {number}            messageCount [拉取消息数量，-1为不拉去消息]\n         * @param  {OperationCallback} callback     [返回值，函数回调]\n         */\n        RongIMClient.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"object\"], \"joinChatRoom\", false, arguments);\n            if (chatroomId == \"\") {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.CHATROOM_ID_ISNULL);\n                });\n                return;\n            }\n            RongIMClient._dataAccessProvider.joinChatRoom(chatroomId, messageCount, callback);\n        };\n        RongIMClient.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\"], \"setChatroomHisMessageTimestamp\", false, arguments);\n            RongIMClient._dataAccessProvider.setChatroomHisMessageTimestamp(chatRoomId, timestamp);\n        };\n        RongIMClient.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomHistoryMessages\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomHistoryMessages(chatRoomId, count, order, callback);\n        };\n        RongIMClient.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"number\", \"number\", \"object\"], \"getChatRoomInfo\", false, arguments);\n            RongIMClient._dataAccessProvider.getChatRoomInfo(chatRoomId, count, order, callback);\n        };\n        /**\n         * [退出聊天室]\n         * @param  {string}            chatroomId [聊天室Id]\n         * @param  {OperationCallback} callback   [返回值，函数回调]\n         */\n        RongIMClient.prototype.quitChatRoom = function (chatroomId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"quitChatRoom\", false, arguments);\n            RongIMClient._dataAccessProvider.quitChatRoom(chatroomId, callback);\n        };\n        // #endregion ChatRoom\n        // #region Public Service\n        RongIMClient.prototype.getRemotePublicServiceList = function (callback, pullMessageTime) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var modules = new RongIMClient.Protobuf.PullMpInput(), self = this;\n                if (!pullMessageTime) {\n                    modules.setTime(0);\n                }\n                else {\n                    modules.setTime(pullMessageTime);\n                }\n                modules.setMpid(\"\");\n                RongIMClient.bridge.queryMsg(28, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function (data) {\n                        //TODO 找出最大时间\n                        // self.lastReadTime.set(conversationType + targetId, MessageUtil.int64ToTimestamp(data.syncTime));\n                        RongIMClient._memoryStore.publicServiceMap.publicServiceList.length = 0;\n                        RongIMClient._memoryStore.publicServiceMap.publicServiceList = data;\n                        callback.onSuccess(data);\n                    },\n                    onError: function () { }\n                }, \"PullMpOutput\");\n            }\n        };\n        /**\n         * [getPublicServiceList ]获取本地的公共账号列表\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback [返回值，参数回调]\n         */\n        RongIMClient.prototype.getPublicServiceList = function (callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"object\"], \"getPublicServiceList\", false, arguments);\n                this.getRemotePublicServiceList(callback);\n            }\n        };\n        /**\n         * [getPublicServiceProfile ]   获取某公共服务信息。\n         * @param  {PublicServiceType}                    publicServiceType [公众服务类型。]\n         * @param  {string}                               publicServiceId   [公共服务 Id。]\n         * @param  {ResultCallback<PublicServiceProfile>} callback          [公共账号信息回调。]\n         */\n        RongIMClient.prototype.getPublicServiceProfile = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"getPublicServiceProfile\", false, arguments);\n                var profile = RongIMClient._memoryStore.publicServiceMap.get(publicServiceType, publicServiceId);\n                callback.onSuccess(profile);\n            }\n        };\n        /**\n         * [pottingPublicSearchType ] 公众好查询类型\n         * @param  {number} bussinessType [ 0-all 1-mp 2-mc]\n         * @param  {number} searchType    [0-exact 1-fuzzy]\n         */\n        RongIMClient.prototype.pottingPublicSearchType = function (bussinessType, searchType) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                var bits = 0;\n                if (bussinessType == 0) {\n                    bits |= 3;\n                    if (searchType == 0) {\n                        bits |= 12;\n                    }\n                    else {\n                        bits |= 48;\n                    }\n                }\n                else if (bussinessType == 1) {\n                    bits |= 1;\n                    if (searchType == 0) {\n                        bits |= 8;\n                    }\n                    else {\n                        bits |= 32;\n                    }\n                }\n                else {\n                    bits |= 2;\n                    if (bussinessType == 0) {\n                        bits |= 4;\n                    }\n                    else {\n                        bits |= 16;\n                    }\n                }\n                return bits;\n            }\n        };\n        /**\n         * [searchPublicService ]按公众服务类型搜索公众服务。\n         * @param  {SearchType}                             searchType [搜索类型枚举。]\n         * @param  {string}                                 keywords   [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback   [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicService = function (searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"object\"], \"searchPublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(0, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, callback, \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [searchPublicServiceByType ]按公众服务类型搜索公众服务。\n         * @param  {PublicServiceType}                      publicServiceType [公众服务类型。]\n         * @param  {SearchType}                             searchType        [搜索类型枚举。]\n         * @param  {string}                                 keywords          [搜索关键字。]\n         * @param  {ResultCallback<PublicServiceProfile[]>} callback          [搜索结果回调。]\n         */\n        RongIMClient.prototype.searchPublicServiceByType = function (publicServiceType, searchType, keywords, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"number\", \"string\", \"object\"], \"searchPublicServiceByType\", false, arguments);\n                var type = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? 2 : 1;\n                var modules = new RongIMClient.Protobuf.SearchMpInput();\n                modules.setType(this.pottingPublicSearchType(type, searchType));\n                modules.setId(keywords);\n                RongIMClient.bridge.queryMsg(29, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, callback, \"SearchMpOutput\");\n            }\n        };\n        /**\n         * [subscribePublicService ] 订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [订阅公众号回调。]\n         */\n        RongIMClient.prototype.subscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"subscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcFollow\" : \"mpFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        me.getRemotePublicServiceList({\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        /**\n         * [unsubscribePublicService ] 取消订阅公众号。\n         * @param  {PublicServiceType} publicServiceType [公众服务类型。]\n         * @param  {string}            publicServiceId   [公共服务 Id。]\n         * @param  {OperationCallback} callback          [取消订阅公众号回调。]\n         */\n        RongIMClient.prototype.unsubscribePublicService = function (publicServiceType, publicServiceId, callback) {\n            if (RongIMClient._memoryStore.depend.openMp) {\n                RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"object\"], \"unsubscribePublicService\", false, arguments);\n                var modules = new RongIMClient.Protobuf.MPFollowInput(), me = this, follow = publicServiceType == RongIMLib.ConversationType.APP_PUBLIC_SERVICE ? \"mcUnFollow\" : \"mpUnFollow\";\n                modules.setId(publicServiceId);\n                RongIMClient.bridge.queryMsg(follow, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                    onSuccess: function () {\n                        RongIMClient._memoryStore.publicServiceMap.remove(publicServiceType, publicServiceId);\n                        callback.onSuccess();\n                    },\n                    onError: function (code) {\n                        callback.onError(code);\n                    }\n                }, \"MPFollowOutput\");\n            }\n        };\n        // #endregion Public Service\n        // #region Blacklist\n        /**\n         * [加入黑名单]\n         * @param  {string}            userId   [将被加入黑名单的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.addToBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"addToBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.addToBlacklist(userId, callback);\n        };\n        /**\n         * [获取黑名单列表]\n         * @param  {GetBlacklistCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.getBlacklist = function (callback) {\n            RongIMLib.CheckParam.getInstance().check([\"object\"], \"getBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklist(callback);\n        };\n        /**\n         * [得到指定人员再黑名单中的状态]\n         * @param  {string}                          userId   [description]\n         * @param  {ResultCallback<BlacklistStatus>} callback [返回值，函数回调]\n         */\n        //TODO 如果人员不在黑名单中，获取状态会出现异常\n        RongIMClient.prototype.getBlacklistStatus = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"getBlacklistStatus\", false, arguments);\n            RongIMClient._dataAccessProvider.getBlacklistStatus(userId, callback);\n        };\n        /**\n         * [将指定用户移除黑名单]\n         * @param  {string}            userId   [将被移除的用户Id]\n         * @param  {OperationCallback} callback [返回值，函数回调]\n         */\n        RongIMClient.prototype.removeFromBlacklist = function (userId, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"string|number\", \"object\"], \"removeFromBlacklist\", false, arguments);\n            RongIMClient._dataAccessProvider.removeFromBlacklist(userId, callback);\n        };\n        RongIMClient.prototype.getFileToken = function (fileType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"object\"], \"getQnTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileToken(fileType, callback);\n        };\n        RongIMClient.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"string|global|object|null\", \"object\"], \"getQnTkn\", false, arguments);\n            RongIMClient._dataAccessProvider.getFileUrl(fileType, fileName, oriName, callback);\n        };\n        ;\n        // #endregion Blacklist\n        // #region Real-time Location Service\n        RongIMClient.prototype.addRealTimeLocationListener = function (conversationType, targetId, listener) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationCurrentState = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.getRealTimeLocationParticipants = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.joinRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.quitRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.startRealTimeLocation = function (conversationType, targetId) {\n            throw new Error(\"Not implemented yet\");\n        };\n        RongIMClient.prototype.updateRealTimeLocationStatus = function (conversationType, targetId, latitude, longitude) {\n            throw new Error(\"Not implemented yet\");\n        };\n        // #endregion Real-time Location Service\n        // # startVoIP\n        RongIMClient.prototype.startCall = function (converType, targetId, userIds, mediaType, extra, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string|number\", \"array\", \"number\", \"string\", \"object\"], \"startCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.startCall(converType, targetId, userIds, mediaType, extra, callback);\n            }\n            else {\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.joinCall = function (mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check(['number', 'object'], \"joinCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.joinCall(mediaType, callback);\n            }\n            else {\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        RongIMClient.prototype.hungupCall = function (converType, targetId, reason) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\"], \"hungupCall\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.hungupCall(converType, targetId, reason);\n            }\n        };\n        RongIMClient.prototype.changeMediaType = function (converType, targetId, mediaType, callback) {\n            RongIMLib.CheckParam.getInstance().check([\"number\", \"string\", \"number\", \"object\"], \"changeMediaType\", false, arguments);\n            if (RongIMClient._memoryStore.voipStategy) {\n                RongIMClient._voipProvider.changeMediaType(converType, targetId, mediaType, callback);\n            }\n            else {\n                callback.onError(RongIMLib.ErrorCode.VOIP_NOT_AVALIABLE);\n            }\n        };\n        // # endVoIP\n        RongIMClient.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return RongIMClient._dataAccessProvider.getUnreadMentionedMessages(conversationType, targetId);\n        };\n        RongIMClient.prototype.clearListeners = function () {\n            RongIMClient._dataAccessProvider.clearListeners();\n        };\n        // UserStatus start\n        RongIMClient.prototype.getUserStatus = function (userId, callback) {\n            RongIMClient._dataAccessProvider.getUserStatus(userId, callback);\n        };\n        RongIMClient.prototype.setUserStatus = function (status, callback) {\n            RongIMClient._dataAccessProvider.setUserStatus(status, callback);\n        };\n        RongIMClient.prototype.subscribeUserStatus = function (userIds, callback) {\n            RongIMClient._dataAccessProvider.subscribeUserStatus(userIds, callback);\n        };\n        RongIMClient.prototype.setOnReceiveStatusListener = function (callback) {\n            RongIMClient._dataAccessProvider.setOnReceiveStatusListener(callback);\n        };\n        RongIMClient.MessageType = {};\n        RongIMClient.RegisterMessage = {};\n        RongIMClient._memoryStore = { listenerList: [] };\n        RongIMClient.isNotPullMsg = false;\n        return RongIMClient;\n    })();\n    RongIMLib.RongIMClient = RongIMClient;\n})(RongIMLib || (RongIMLib = {}));\n//用于连接通道\nvar RongIMLib;\n(function (RongIMLib) {\n    (function (Qos) {\n        Qos[Qos[\"AT_MOST_ONCE\"] = 0] = \"AT_MOST_ONCE\";\n        Qos[Qos[\"AT_LEAST_ONCE\"] = 1] = \"AT_LEAST_ONCE\";\n        Qos[Qos[\"EXACTLY_ONCE\"] = 2] = \"EXACTLY_ONCE\";\n        Qos[Qos[\"DEFAULT\"] = 3] = \"DEFAULT\";\n    })(RongIMLib.Qos || (RongIMLib.Qos = {}));\n    var Qos = RongIMLib.Qos;\n    (function (Type) {\n        Type[Type[\"CONNECT\"] = 1] = \"CONNECT\";\n        Type[Type[\"CONNACK\"] = 2] = \"CONNACK\";\n        Type[Type[\"PUBLISH\"] = 3] = \"PUBLISH\";\n        Type[Type[\"PUBACK\"] = 4] = \"PUBACK\";\n        Type[Type[\"QUERY\"] = 5] = \"QUERY\";\n        Type[Type[\"QUERYACK\"] = 6] = \"QUERYACK\";\n        Type[Type[\"QUERYCON\"] = 7] = \"QUERYCON\";\n        Type[Type[\"SUBSCRIBE\"] = 8] = \"SUBSCRIBE\";\n        Type[Type[\"SUBACK\"] = 9] = \"SUBACK\";\n        Type[Type[\"UNSUBSCRIBE\"] = 10] = \"UNSUBSCRIBE\";\n        Type[Type[\"UNSUBACK\"] = 11] = \"UNSUBACK\";\n        Type[Type[\"PINGREQ\"] = 12] = \"PINGREQ\";\n        Type[Type[\"PINGRESP\"] = 13] = \"PINGRESP\";\n        Type[Type[\"DISCONNECT\"] = 14] = \"DISCONNECT\";\n    })(RongIMLib.Type || (RongIMLib.Type = {}));\n    var Type = RongIMLib.Type;\n    var _topic = [\"invtDiz\", \"crDiz\", \"qnUrl\", \"userInf\", \"dizInf\", \"userInf\", \"joinGrp\", \"quitDiz\", \"exitGrp\", \"evctDiz\",\n        [\"\", \"ppMsgP\", \"pdMsgP\", \"pgMsgP\", \"chatMsg\", \"pcMsgP\", \"\", \"pmcMsgN\", \"pmpMsgN\"], \"pdOpen\", \"rename\", \"uGcmpr\", \"qnTkn\", \"destroyChrm\",\n        \"createChrm\", \"exitChrm\", \"queryChrm\", \"joinChrm\", \"pGrps\", \"addBlack\", \"rmBlack\", \"getBlack\", \"blackStat\", \"addRelation\", \"qryRelation\", \"delRelation\", \"pullMp\", \"schMp\", \"qnTkn\", \"qnUrl\", \"qryVoipK\", \"delMsg\", \"qryCHMsg\"];\n    var Channel = (function () {\n        function Channel(address, cb, self) {\n            this.connectionStatus = -1;\n            this.delOnChangedCount = 0;\n            this.url = address.host + \"/websocket?appId=\" + self.appId + \"&token=\" + encodeURIComponent(self.token) + \"&sdkVer=\" + self.sdkVer + \"&apiVer=\" + self.apiVer;\n            this.self = self;\n            this.socket = Socket.getInstance().createServer();\n            this.socket.connect(this.url, cb);\n            //注册状态改变观察者\n            if (typeof Channel._ConnectionStatusListener == \"object\" && \"onChanged\" in Channel._ConnectionStatusListener) {\n                var me = this;\n                me.socket.on(\"StatusChanged\", function (code) {\n                    me.connectionStatus = code;\n                    if (code === RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE) {\n                        var temp = RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\");\n                        var naviServer = RongIMLib.RongIMClient._storageProvider.getItem(temp);\n                        var naviPort = naviServer.split(\",\")[0].split(\":\")[1];\n                        naviPort && naviPort.length < 4 || RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", \"\");\n                        // TODO  判断拆分 naviServer 后的数组长度。\n                        if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && naviPort && naviPort.length < 4) {\n                            Bridge._client.handler.connectCallback.pauseTimer();\n                            var temp = RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\");\n                            var server = RongIMLib.RongIMClient._storageProvider.getItem(\"RongBackupServer\");\n                            if (server) {\n                                var arrs = server.split(\",\");\n                                if (arrs.length < 2) {\n                                    throw new Error(\"navi server is empty,postion:StatusChanged\");\n                                }\n                                RongIMLib.RongIMClient._storageProvider.setItem(temp, RongIMLib.RongIMClient._storageProvider.getItem(\"RongBackupServer\"));\n                                var url = RongIMLib.Bridge._client.channel.socket.currentURL;\n                                Bridge._client.channel.socket.currentURL = arrs[0] + url.substring(url.indexOf(\"/\"), url.length);\n                                if (Bridge._client.channel && Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                                    RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                                }\n                            }\n                        }\n                    }\n                    if (code === RongIMLib.ConnectionStatus.DISCONNECTED && !RongIMLib.RongIMClient._memoryStore.otherDevice) {\n                        Channel._ConnectionStatusListener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        self.clearHeartbeat();\n                        return;\n                    }\n                    else if (code === RongIMLib.ConnectionStatus.DISCONNECTED && RongIMLib.RongIMClient._memoryStore.otherDevice) {\n                        return;\n                    }\n                    Channel._ConnectionStatusListener.onChanged(code);\n                    if (RongIMLib.RongIMClient._memoryStore.otherDevice) {\n                        if (me.delOnChangedCount > 5) {\n                            delete Channel._ConnectionStatusListener[\"onChanged\"];\n                        }\n                        me.delOnChangedCount++;\n                    }\n                });\n            }\n            else {\n                throw new Error(\"setConnectStatusListener:Parameter format is incorrect\");\n            }\n            //注册message观察者\n            this.socket.on(\"message\", self.handler.handleMessage);\n            //注册断开连接观察者\n            this.socket.on(\"disconnect\", function (status) {\n                self.channel.socket.fire(\"StatusChanged\", status ? status : 2);\n            });\n        }\n        Channel.prototype.writeAndFlush = function (val) {\n            this.socket.send(val);\n        };\n        Channel.prototype.reconnect = function (callback) {\n            RongIMLib.MessageIdHandler.clearMessageId();\n            this.socket = this.socket.reconnect();\n            if (callback) {\n                this.self.reconnectObj = callback;\n            }\n        };\n        Channel.prototype.disconnect = function (status) {\n            this.socket.disconnect(status);\n        };\n        return Channel;\n    })();\n    RongIMLib.Channel = Channel;\n    var Socket = (function () {\n        function Socket() {\n            this.socket = null;\n            this._events = {};\n        }\n        Socket.getInstance = function () {\n            return new Socket();\n        };\n        Socket.prototype.connect = function (url, cb) {\n            if (this.socket) {\n                if (url) {\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"rongSDK\", this.checkTransport());\n                    this.on(\"connect\", cb || new Function);\n                }\n                if (url) {\n                    this.currentURL = url;\n                }\n                this.socket.createTransport(url);\n            }\n            return this;\n        };\n        Socket.prototype.createServer = function () {\n            var transport = this.getTransport(this.checkTransport());\n            if (transport === null) {\n                throw new Error(\"the channel was not supported\");\n            }\n            return transport;\n        };\n        Socket.prototype.getTransport = function (transportType) {\n            if (transportType == Socket.XHR_POLLING) {\n                this.socket = new RongIMLib.PollingTransportation(this);\n            }\n            else if (transportType == Socket.WEBSOCKET) {\n                this.socket = new RongIMLib.SocketTransportation(this);\n            }\n            return this;\n        };\n        Socket.prototype.send = function (data) {\n            if (this.socket) {\n                if (this.checkTransport() == Socket.WEBSOCKET) {\n                    this.socket.send(data);\n                }\n                else {\n                    this.socket.send(this._encode(data));\n                }\n            }\n        };\n        Socket.prototype.onMessage = function (data) {\n            this.fire(\"message\", data);\n        };\n        Socket.prototype.disconnect = function (status) {\n            if (RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT === status) {\n                RongIMLib.RongIMClient._memoryStore.otherDevice = true;\n            }\n            this.socket.disconnect(status);\n            this.fire(\"disconnect\", status);\n            return this;\n        };\n        Socket.prototype.reconnect = function () {\n            if (this.currentURL && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\")) {\n                return this.connect(this.currentURL, null);\n            }\n            else {\n                throw new Error(\"reconnect:no have URL\");\n            }\n        };\n        /**\n         * [checkTransport 返回通道类型]\n         */\n        Socket.prototype.checkTransport = function () {\n            if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = Socket.XHR_POLLING;\n            }\n            return RongIMLib.Transportations._TransportType;\n        };\n        Socket.prototype.fire = function (x, args) {\n            if (x in this._events) {\n                for (var i = 0, ii = this._events[x].length; i < ii; i++) {\n                    this._events[x][i](args);\n                }\n            }\n            return this;\n        };\n        Socket.prototype.on = function (x, func) {\n            if (!(typeof func == \"function\" && x)) {\n                return this;\n            }\n            if (x in this._events) {\n                RongIMLib.MessageUtil.indexOf(this._events, func) == -1 && this._events[x].push(func);\n            }\n            else {\n                this._events[x] = [func];\n            }\n            return this;\n        };\n        Socket.prototype.removeEvent = function (x, fn) {\n            if (x in this._events) {\n                for (var a = 0, l = this._events[x].length; a < l; a++) {\n                    if (this._events[x][a] == fn) {\n                        this._events[x].splice(a, 1);\n                    }\n                }\n            }\n            return this;\n        };\n        Socket.prototype._encode = function (x) {\n            var str = \"?messageid=\" + x.getMessageId() + \"&header=\" + x.getHeaderFlag() + \"&sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            if (!/(PubAckMessage|QueryConMessage)/.test(x._name)) {\n                str += \"&topic=\" + x.getTopic() + \"&targetid=\" + (x.getTargetId() || \"\");\n            }\n            return {\n                url: str,\n                data: \"getData\" in x ? x.getData() : \"\"\n            };\n        };\n        //消息通道常量，所有和通道相关判断均用 XHR_POLLING WEBSOCKET两属性\n        Socket.XHR_POLLING = \"xhr-polling\";\n        Socket.WEBSOCKET = \"websocket\";\n        return Socket;\n    })();\n    RongIMLib.Socket = Socket;\n    //连接端消息累\n    var Client = (function () {\n        function Client(token, appId) {\n            this.timeoutMillis = 100000;\n            this.timeout_ = 0;\n            this.sdkVer = \"2.2.7\";\n            this.apiVer = Math.floor(Math.random() * 1e6);\n            this.channel = null;\n            this.handler = null;\n            this.userId = \"\";\n            this.reconnectObj = {};\n            this.heartbeat = 0;\n            this.pullMsgHearbeat = 0;\n            this.chatroomId = \"\";\n            this.SyncTimeQueue = [];\n            this.cacheMessageIds = [];\n            this.token = token;\n            this.appId = appId;\n            this.SyncTimeQueue.state = \"complete\";\n        }\n        Client.prototype.resumeTimer = function () {\n            if (!this.timeout_) {\n                this.timeout_ = setTimeout(function () {\n                    if (!this.timeout_) {\n                        return;\n                    }\n                    try {\n                        this.channel.disconnect();\n                    }\n                    catch (e) {\n                        throw new Error(e);\n                    }\n                    clearTimeout(this.timeout_);\n                    this.timeout_ = 0;\n                    this.channel.reconnect();\n                    this.channel.socket.fire(\"StatusChanged\", 5);\n                }, this.timeoutMillis);\n            }\n        };\n        Client.prototype.pauseTimer = function () {\n            if (this.timeout_) {\n                clearTimeout(this.timeout_);\n                this.timeout_ = 0;\n            }\n        };\n        Client.prototype.connect = function (_callback) {\n            if (RongIMLib.Navigation.Endpoint.host) {\n                if (RongIMLib.Transportations._TransportType == Socket.WEBSOCKET) {\n                    if (!window.WebSocket) {\n                        _callback.onError(RongIMLib.ConnectionState.UNACCEPTABLE_PROTOCOL_VERSION);\n                        return;\n                    }\n                }\n                //实例消息处理类\n                this.handler = new MessageHandler(this);\n                //设置连接回调\n                this.handler.setConnectCallback(_callback);\n                //实例通道类型\n                var me = this;\n                this.channel = new Channel(RongIMLib.Navigation.Endpoint, function () {\n                    RongIMLib.Transportations._TransportType == Socket.WEBSOCKET && me.keepLive();\n                }, this);\n                //触发状态改变观察者\n                this.channel.socket.fire(\"StatusChanged\", 1);\n            }\n            else {\n                //没有返回地址就手动抛出错误\n                _callback.onError(RongIMLib.ConnectionState.NOT_AUTHORIZED);\n            }\n        };\n        Client.prototype.checkSocket = function (callback) {\n            var me = this;\n            me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            var checkTimeout = setInterval(function () {\n                if (!RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                    callback.onSuccess();\n                    clearInterval(checkTimeout);\n                }\n                else {\n                    if (count > 15) {\n                        clearInterval(checkTimeout);\n                        callback.onError();\n                    }\n                }\n                count++;\n            }, 200), count = 0;\n        };\n        Client.prototype.keepLive = function () {\n            if (this.heartbeat > 0) {\n                clearInterval(this.heartbeat);\n            }\n            var me = this;\n            me.heartbeat = setInterval(function () {\n                me.resumeTimer();\n                me.channel.writeAndFlush(new RongIMLib.PingReqMessage());\n            }, 30000);\n            if (me.pullMsgHearbeat > 0) {\n                clearInterval(me.pullMsgHearbeat);\n            }\n            me.pullMsgHearbeat = setInterval(function () {\n                me.syncTime(true, undefined, undefined, false);\n            }, 180000);\n        };\n        Client.prototype.clearHeartbeat = function () {\n            clearInterval(this.heartbeat);\n            this.heartbeat = 0;\n            this.pauseTimer();\n            clearInterval(this.pullMsgHearbeat);\n            this.pullMsgHearbeat = 0;\n        };\n        Client.prototype.publishMessage = function (_topic, _data, _targetId, _callback, _msg) {\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.PublishMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            if (_callback) {\n                msg.setQos(Qos.AT_LEAST_ONCE);\n                this.handler.putCallback(new RongIMLib.PublishCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), _msg);\n            }\n            else {\n                msg.setQos(Qos.AT_MOST_ONCE);\n            }\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.queryMessage = function (_topic, _data, _targetId, _qos, _callback, pbtype) {\n            if (_topic == \"userInf\") {\n                if (Client.userInfoMapping[_targetId]) {\n                    _callback.onSuccess(Client.userInfoMapping[_targetId]);\n                    return;\n                }\n            }\n            var msgId = RongIMLib.MessageIdHandler.messageIdPlus(this.channel.reconnect);\n            if (!msgId) {\n                return;\n            }\n            var msg = new RongIMLib.QueryMessage(_topic, _data, _targetId);\n            msg.setMessageId(msgId);\n            msg.setQos(_qos);\n            this.handler.putCallback(new RongIMLib.QueryCallback(_callback.onSuccess, _callback.onError), msg.getMessageId(), pbtype);\n            this.channel.writeAndFlush(msg);\n        };\n        Client.prototype.invoke = function (isPullMsg, chrmId, offlineMsg) {\n            var time, modules, str, me = this, target, temp = this.SyncTimeQueue.shift();\n            if (temp == undefined) {\n                return;\n            }\n            this.SyncTimeQueue.state = \"pending\";\n            if (temp.type != 2) {\n                //普通消息\n                time = RongIMLib.RongIMClient._storageProvider.getItem(this.userId) || '0';\n                modules = new RongIMLib.RongIMClient.Protobuf.SyncRequestMsg();\n                modules.setIspolling(false);\n                str = \"pullMsg\";\n                target = this.userId;\n            }\n            else {\n                //聊天室消息\n                target = chrmId || me.chatroomId;\n                time = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(target + Bridge._client.userId + \"CST\") || 0;\n                modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                modules.setCount(0);\n                str = \"chrmPull\";\n                if (!target) {\n                    throw new Error(\"syncTime:Received messages of chatroom but was not init\");\n                }\n            }\n            //判断服务器给的时间是否消息本地存储的时间，小于的话不执行拉取操作，进行一下步队列操作\n            if (temp.pulltime <= time) {\n                this.SyncTimeQueue.state = \"complete\";\n                this.invoke(isPullMsg, target);\n                return;\n            }\n            if (isPullMsg && 'setIsPullSend' in modules) {\n                modules.setIsPullSend(true);\n            }\n            modules.setSyncTime(time);\n            //发送queryMessage请求\n            this.queryMessage(str, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), target, Qos.AT_LEAST_ONCE, {\n                onSuccess: function (collection) {\n                    var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime), symbol = target;\n                    //把返回时间戳存入本地，普通消息key为userid，聊天室消息key为userid＋'CST'；value都为服务器返回的时间戳\n                    if (str == \"chrmPull\") {\n                        symbol += Bridge._client.userId + \"CST\";\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set(symbol, sync);\n                    }\n                    else {\n                        var storage = RongIMLib.RongIMClient._storageProvider;\n                        if (sync > storage.getItem(symbol)) {\n                            storage.setItem(symbol, sync);\n                        }\n                    }\n                    //防止因离线消息造成会话列表不为空而无法从服务器拉取会话列表。\n                    //offlineMsg && (RongIMClient._memoryStore.isSyncRemoteConverList = true);\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                    //把拉取到的消息逐条传给消息监听器\n                    var list = collection.list;\n                    for (var i = 0, len = list.length, count = len; i < len; i++) {\n                        if (!(list[i].msgId in me.cacheMessageIds)) {\n                            Bridge._client.handler.onReceived(list[i], undefined, offlineMsg, --count);\n                            var arrLen = me.cacheMessageIds.unshift(list[i].msgId);\n                            if (arrLen > 20)\n                                me.cacheMessageIds.length = 20;\n                        }\n                    }\n                },\n                onError: function (error) {\n                    me.SyncTimeQueue.state = \"complete\";\n                    me.invoke(isPullMsg, target);\n                }\n            }, \"DownStreamMessages\");\n        };\n        Client.prototype.syncTime = function (_type, pullTime, chrmId, offlineMsg) {\n            this.SyncTimeQueue.push({ type: _type, pulltime: pullTime });\n            //如果队列中只有一个成员并且状态已经完成就执行invoke方法\n            if (this.SyncTimeQueue.length == 1 && this.SyncTimeQueue.state == \"complete\") {\n                this.invoke(!_type, chrmId, offlineMsg);\n            }\n        };\n        Client.prototype.__init = function (f) {\n            this.channel = new Channel(RongIMLib.Navigation.Endpoint, f, this);\n        };\n        Client.userInfoMapping = {};\n        return Client;\n    })();\n    RongIMLib.Client = Client;\n    //连接类，实现imclient与connect_client的连接\n    var Bridge = (function () {\n        function Bridge() {\n        }\n        Bridge.getInstance = function () {\n            return new Bridge();\n        };\n        //连接服务器\n        Bridge.prototype.connect = function (appKey, token, callback) {\n            if (!RongIMLib.RongIMClient.Protobuf) {\n                return;\n            }\n            Bridge._client = new RongIMLib.Navigation().connect(appKey, token, callback);\n            return Bridge._client;\n        };\n        Bridge.prototype.setListener = function (_changer) {\n            if (typeof _changer == \"object\") {\n                if (typeof _changer.onChanged == \"function\") {\n                    Channel._ConnectionStatusListener = _changer;\n                }\n                else if (typeof _changer.onReceived == \"function\") {\n                    Channel._ReceiveMessageListener = _changer;\n                }\n            }\n        };\n        Bridge.prototype.reconnect = function (callabck) {\n            Bridge._client.channel.reconnect(callabck);\n        };\n        Bridge.prototype.disconnect = function () {\n            Bridge._client.clearHeartbeat();\n            Bridge._client.channel.disconnect(2);\n        };\n        //执行queryMessage请求\n        Bridge.prototype.queryMsg = function (topic, content, targetId, callback, pbname) {\n            if (typeof topic != \"string\") {\n                topic = _topic[topic];\n            }\n            Bridge._client.queryMessage(topic, content, targetId, Qos.AT_MOST_ONCE, callback, pbname);\n        };\n        //发送消息 执行publishMessage 请求\n        Bridge.prototype.pubMsg = function (topic, content, targetId, callback, msg, methodType) {\n            if (typeof methodType == 'number') {\n                if (methodType == RongIMLib.MethodType.CUSTOMER_SERVICE) {\n                    Bridge._client.publishMessage(\"pcuMsgP\", content, targetId, callback, msg);\n                }\n                else if (methodType == RongIMLib.MethodType.RECALL) {\n                    Bridge._client.publishMessage(\"recallMsg\", content, targetId, callback, msg);\n                }\n            }\n            else {\n                Bridge._client.publishMessage(_topic[10][topic], content, targetId, callback, msg);\n            }\n        };\n        return Bridge;\n    })();\n    RongIMLib.Bridge = Bridge;\n    var MessageHandler = (function () {\n        function MessageHandler(client) {\n            this.map = {};\n            this.connectCallback = null;\n            if (!Channel._ReceiveMessageListener) {\n                throw new Error(\"please set onReceiveMessageListener\");\n            }\n            this._onReceived = Channel._ReceiveMessageListener.onReceived;\n            this._client = client;\n            this.syncMsgMap = new Object;\n        }\n        //把对象推入回调对象队列中，并启动定时器\n        MessageHandler.prototype.putCallback = function (callbackObj, _publishMessageId, _msg) {\n            var item = {\n                Callback: callbackObj,\n                Message: _msg\n            };\n            item.Callback.resumeTimer();\n            this.map[_publishMessageId] = item;\n        };\n        //设置连接回调对象，启动定时器\n        MessageHandler.prototype.setConnectCallback = function (_connectCallback) {\n            if (_connectCallback) {\n                this.connectCallback = new RongIMLib.ConnectAck(_connectCallback.onSuccess, _connectCallback.onError, this._client);\n                this.connectCallback.resumeTimer();\n            }\n        };\n        MessageHandler.prototype.onReceived = function (msg, pubAckItem, offlineMsg, leftCount) {\n            //实体对象\n            var entity, \n            //解析完成的消息对象\n            message, \n            //会话对象\n            con;\n            if (msg._name != \"PublishMessage\") {\n                entity = msg;\n                RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime));\n            }\n            else {\n                if (msg.getTopic() == \"s_ntf\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.NotifyMsg.decode(msg.getData());\n                    this._client.syncTime(entity.type, RongIMLib.MessageUtil.int64ToTimestamp(entity.time), entity.chrmId);\n                    return;\n                }\n                else if (msg.getTopic() == \"s_msg\") {\n                    entity = RongIMLib.RongIMClient.Protobuf.DownStreamMessage.decode(msg.getData());\n                    var timestamp = RongIMLib.MessageUtil.int64ToTimestamp(entity.dataTime);\n                    RongIMLib.RongIMClient._storageProvider.setItem(this._client.userId, timestamp);\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.get(this._client.userId, timestamp);\n                }\n                else {\n                    if (Bridge._client.sdkVer && Bridge._client.sdkVer == \"1.0.0\") {\n                        return;\n                    }\n                    entity = RongIMLib.RongIMClient.Protobuf.UpStreamMessage.decode(msg.getData());\n                    var tmpTopic = msg.getTopic();\n                    var tmpType = tmpTopic.substr(0, 2);\n                    if (tmpType == \"pp\") {\n                        entity.type = 1;\n                    }\n                    else if (tmpType == \"pd\") {\n                        entity.type = 2;\n                    }\n                    else if (tmpType == \"pg\") {\n                        entity.type = 3;\n                    }\n                    else if (tmpType == \"ch\") {\n                        entity.type = 4;\n                    }\n                    else if (tmpType == \"pc\") {\n                        entity.type = 5;\n                    }\n                    //复用字段，targetId 以此为准\n                    entity.groupId = msg.getTargetId();\n                    entity.fromUserId = this._client.userId;\n                    entity.dataTime = Date.parse(new Date().toString());\n                }\n                if (!entity) {\n                    return;\n                }\n            }\n            //解析实体对象为消息对象。\n            message = RongIMLib.MessageUtil.messageParser(entity, this._onReceived, offlineMsg);\n            if (pubAckItem) {\n                message.messageUId = pubAckItem.getMessageUId();\n                message.sentTime = pubAckItem.getTimestamp();\n            }\n            if (message === null) {\n                return;\n            }\n            // 设置会话时间戳并且判断是否传递 message  发送消息未处理会话时间戳\n            // key：'converST_' + 当前用户 + conversationType + targetId\n            // RongIMClient._storageProvider.setItem('converST_' + Bridge._client.userId + message.conversationType + message.targetId, message.sentTime);\n            var stKey = 'converST_' + Bridge._client.userId + message.conversationType + message.targetId;\n            var stValue = RongIMLib.RongIMClient._memoryStore.lastReadTime.get(stKey);\n            if (stValue) {\n                if (message.sentTime > stValue) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(stKey, message.sentTime);\n                }\n                else {\n                    return;\n                }\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.lastReadTime.set(stKey, message.sentTime);\n            }\n            if (RongIMLib.RongIMClient.MessageParams[message.messageType].msgTag.getMessageTag() > 0) {\n                RongIMLib.RongIMClient._dataAccessProvider.getConversation(message.conversationType, message.targetId, {\n                    onSuccess: function (con) {\n                        if (!con) {\n                            con = RongIMLib.RongIMClient.getInstance().createConversation(message.conversationType, message.targetId, \"\");\n                        }\n                        if (message.messageDirection == RongIMLib.MessageDirection.RECEIVE && (entity.status & 64) == 64) {\n                            var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId);\n                            var key = message.conversationType + '_' + message.targetId, info = {};\n                            if (message.content && message.content.mentionedInfo) {\n                                info[key] = { uid: message.messageUId, time: message.sentTime, mentionedInfo: message.content.mentionedInfo };\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + Bridge._client.userId + '_' + message.conversationType + '_' + message.targetId, JSON.stringify(info));\n                                mentioneds = JSON.stringify(info);\n                            }\n                            if (mentioneds) {\n                                var info = JSON.parse(mentioneds);\n                                con.mentionedMsg = info[key];\n                            }\n                        }\n                        if (con.conversationType != 0 && message.senderUserId != Bridge._client.userId && message.receivedStatus != RongIMLib.ReceivedStatus.RETRIEVED && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && message.messageType != RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                            con.unreadMessageCount = con.unreadMessageCount + 1;\n                            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                                var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + Bridge._client.userId + con.conversationType + con.targetId); // 与本地存储会话合并\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"cu\" + Bridge._client.userId + con.conversationType + message.targetId, Number(count) + 1);\n                            }\n                        }\n                        con.receivedTime = new Date().getTime();\n                        con.receivedStatus = message.receivedStatus;\n                        con.senderUserId = message.sendUserId;\n                        con.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                        con.latestMessageId = message.messageId;\n                        con.latestMessage = message;\n                        con.sentTime = message.sentTime;\n                        RongIMLib.RongIMClient._dataAccessProvider.addConversation(con, { onSuccess: function (data) { }, onError: function () { } });\n                    },\n                    onError: function (error) { }\n                });\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && (message.messageType == \"ChangeModeResponseMessage\" || message.messageType == \"SuspendMessage\" || message.messageType == \"HandShakeResponseMessage\" ||\n                message.messageType == \"TerminateMessage\" || message.messageType == \"CustomerStatusUpdateMessage\" || message.messageType == \"TextMessage\" || message.messageType == \"InformationNotificationMessage\")) {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[\"isInit\"]) {\n                    return;\n                }\n            }\n            if (message.conversationType == RongIMLib.ConversationType.CUSTOMER_SERVICE && message.messageType != \"HandShakeResponseMessage\") {\n                if (!RongIMLib.RongIMClient._memoryStore.custStore[message.targetId]) {\n                    return;\n                }\n                if (message.messageType == \"TerminateMessage\") {\n                    if (RongIMLib.RongIMClient._memoryStore.custStore[message.targetId].sid != message.content.sid) {\n                        return;\n                    }\n                }\n            }\n            if (message.messageType === RongIMLib.RongIMClient.MessageType[\"HandShakeResponseMessage\"]) {\n                var session = message.content.data;\n                RongIMLib.RongIMClient._memoryStore.custStore[message.targetId] = session;\n                if (session.serviceType == RongIMLib.CustomerType.ONLY_HUMAN || session.serviceType == RongIMLib.CustomerType.HUMAN_FIRST) {\n                    if (session.notAutoCha == \"1\") {\n                        RongIMLib.RongIMClient.getInstance().switchToHumanMode(message.targetId, {\n                            onSuccess: function () { },\n                            onError: function () { }\n                        });\n                    }\n                }\n            }\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate();\n            //new Date(date).getTime() - message.sentTime < 1 逻辑判断 超过 1 天未收的 ReadReceiptRequestMessage 离线消息自动忽略。\n            var dealtime = new Date(date).getTime() - message.sentTime < 0;\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime && message.messageDirection == RongIMLib.MessageDirection.SEND) {\n                var sentkey = Bridge._client.userId + message.content.messageUId + \"SENT\";\n                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: message.sentTime, userIds: {} }));\n            }\n            else if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"] && dealtime) {\n                var reckey = Bridge._client.userId + message.conversationType + message.targetId + 'RECEIVED', recData = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(reckey));\n                if (recData) {\n                    if (message.senderUserId in recData) {\n                        if (recData[message.senderUserId].uIds && recData[message.senderUserId].uIds && recData[message.senderUserId].uIds.indexOf(message.content.messageUId) == -1) {\n                            // 如果是前一天的 MessaageUId 把数组清空。\n                            new Date(date).getTime() - recData[message.senderUserId].dealtime < 0 || (recData[message.senderUserId].uIds.length = 0);\n                            recData[message.senderUserId].uIds.push(message.content.messageUId);\n                            recData[message.senderUserId].dealtime = message.sentTime;\n                            recData[message.senderUserId].isResponse = false;\n                            RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                        }\n                        else {\n                            return;\n                        }\n                    }\n                    else {\n                        var objSon = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                        recData[message.senderUserId] = objSon;\n                        RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(recData));\n                    }\n                }\n                else {\n                    var obj = {};\n                    obj[message.senderUserId] = { uIds: [message.content.messageUId], dealtime: message.sentTime, isResponse: false };\n                    RongIMLib.RongIMClient._storageProvider.setItem(reckey, JSON.stringify(obj));\n                }\n            }\n            if (RongIMLib.RongUtil.supportLocalStorage() && message.messageType === RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"] && dealtime) {\n                var receiptResponseMsg = message.content, uIds = receiptResponseMsg.receiptMessageDic[Bridge._client.userId], sentkey = \"\", sentObj;\n                message.receiptResponse || (message.receiptResponse = {});\n                if (uIds) {\n                    var cbuIds = [];\n                    for (var i = 0, len = uIds.length; i < len; i++) {\n                        sentkey = Bridge._client.userId + uIds[i] + \"SENT\";\n                        sentObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(sentkey));\n                        if (sentObj && !(message.senderUserId in sentObj.userIds)) {\n                            if (new Date(date).getTime() - sentObj.dealtime > 0) {\n                                RongIMLib.RongIMClient._storageProvider.removeItem(sentkey);\n                            }\n                            else {\n                                cbuIds.push(uIds[i]);\n                                sentObj.count += 1;\n                                sentObj.userIds[message.senderUserId] = message.sentTime;\n                                message.receiptResponse[uIds[i]] = sentObj.count;\n                                RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify(sentObj));\n                            }\n                        }\n                    }\n                    receiptResponseMsg.receiptMessageDic[Bridge._client.userId] = cbuIds;\n                    message.content = receiptResponseMsg;\n                }\n            }\n            var that = this;\n            if (RongIMLib.RongIMClient._voipProvider && ['AcceptMessage', 'RingingMessage', 'HungupMessage', 'InviteMessage', 'MediaModifyMessage', 'MemberModifyMessage'].indexOf(message.messageType) > -1) {\n                RongIMLib.RongIMClient._voipProvider.onReceived(message);\n            }\n            else {\n                var lcount = leftCount || 0;\n                RongIMLib.RongIMClient._dataAccessProvider.addMessage(message.conversationType, message.targetId, message, {\n                    onSuccess: function (ret) {\n                        that._onReceived(ret, lcount);\n                    },\n                    onError: function (error) {\n                        that._onReceived(message, lcount);\n                    }\n                });\n            }\n        };\n        MessageHandler.prototype.handleMessage = function (msg) {\n            if (!msg) {\n                return;\n            }\n            switch (msg._name) {\n                case \"ConnAckMessage\":\n                    Bridge._client.handler.connectCallback.process(msg.getStatus(), msg.getUserId(), msg.getTimestamp());\n                    break;\n                case \"PublishMessage\":\n                    if (!msg.getSyncMsg() && msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.PubAckMessage(msg.getMessageId()));\n                    }\n                    // TODO && ->\n                    if (msg.getSyncMsg() && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                        Bridge._client.handler.syncMsgMap[msg.getMessageId()] = msg;\n                    }\n                    else {\n                        //如果是PublishMessage就把该对象给onReceived方法执行处理\n                        Bridge._client.handler.onReceived(msg);\n                    }\n                    break;\n                case \"QueryAckMessage\":\n                    if (msg.getQos() != 0) {\n                        Bridge._client.channel.writeAndFlush(new RongIMLib.QueryConMessage(msg.getMessageId()));\n                    }\n                    var temp = Bridge._client.handler.map[msg.getMessageId()];\n                    if (temp) {\n                        //执行回调操作\n                        temp.Callback.process(msg.getStatus(), msg.getData(), msg.getDate(), temp.Message);\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    break;\n                case \"PubAckMessage\":\n                    var item = Bridge._client.handler.map[msg.getMessageId()];\n                    if (item) {\n                        item.Callback.process(msg.getStatus() || 0, msg.getMessageUId(), msg.getTimestamp(), item.Message, msg.getMessageId());\n                        delete Bridge._client.handler.map[msg.getMessageId()];\n                    }\n                    else {\n                        Bridge._client.handler.onReceived(Bridge._client.handler.syncMsgMap[msg.messageId], msg);\n                        delete Bridge._client.handler.syncMsgMap[msg.getMessageId()];\n                    }\n                    break;\n                case \"PingRespMessage\":\n                    if (RongIMLib.RongIMClient._memoryStore.isFirstPingMsg) {\n                        RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                    }\n                    else {\n                        Bridge._client.pauseTimer();\n                    }\n                    break;\n                case \"DisconnectMessage\":\n                    Bridge._client.channel.disconnect(msg.getStatus());\n                    break;\n                default:\n            }\n        };\n        return MessageHandler;\n    })();\n    RongIMLib.MessageHandler = MessageHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar __extends = (this && this.__extends) || function (d, b) {\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n    function __() { this.constructor = d; }\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/// <reference path=\"../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageCallback = (function () {\n        function MessageCallback(error) {\n            this.timeout = null;\n            this.onError = null;\n            if (error && typeof error == \"number\") {\n                this.timeoutMillis = error;\n            }\n            else {\n                this.timeoutMillis = 30000;\n                this.onError = error;\n            }\n        }\n        MessageCallback.prototype.resumeTimer = function () {\n            var me = this;\n            if (this.timeoutMillis > 0 && !this.timeout) {\n                this.timeout = setTimeout(function () {\n                    me.readTimeOut(true);\n                }, this.timeoutMillis);\n            }\n        };\n        MessageCallback.prototype.pauseTimer = function () {\n            if (this.timeout) {\n                clearTimeout(this.timeout);\n                this.timeout = null;\n            }\n        };\n        MessageCallback.prototype.readTimeOut = function (isTimeout) {\n            if (isTimeout && this.onError) {\n                this.onError(RongIMLib.ErrorCode.TIMEOUT);\n            }\n            else {\n                this.pauseTimer();\n            }\n        };\n        return MessageCallback;\n    })();\n    RongIMLib.MessageCallback = MessageCallback;\n    var CallbackMapping = (function () {\n        function CallbackMapping() {\n            this.publicServiceList = [];\n        }\n        CallbackMapping.getInstance = function () {\n            return new CallbackMapping();\n        };\n        CallbackMapping.prototype.pottingProfile = function (item) {\n            var temp;\n            this.profile = new RongIMLib.PublicServiceProfile();\n            temp = JSON.parse(item.extra);\n            this.profile.isGlobal = temp.isGlobal;\n            this.profile.introduction = temp.introduction;\n            this.profile.menu = temp.menu;\n            this.profile.hasFollowed = temp.follow;\n            this.profile.publicServiceId = item.mpid;\n            this.profile.name = item.name;\n            this.profile.portraitUri = item.portraitUrl;\n            this.profile.conversationType = item.type == \"mc\" ? RongIMLib.ConversationType.APP_PUBLIC_SERVICE : RongIMLib.ConversationType.PUBLIC_SERVICE;\n            this.publicServiceList.push(this.profile);\n        };\n        CallbackMapping.prototype.mapping = function (entity, tag) {\n            switch (tag) {\n                case \"GetUserInfoOutput\":\n                    var userInfo = new RongIMLib.UserInfo(entity.userId, entity.userName, entity.userPortrait);\n                    return userInfo;\n                case \"GetQNupTokenOutput\":\n                    return {\n                        deadline: RongIMLib.MessageUtil.int64ToTimestamp(entity.deadline),\n                        token: entity.token\n                    };\n                case \"GetQNdownloadUrlOutput\":\n                    return {\n                        downloadUrl: entity.downloadUrl\n                    };\n                case \"CreateDiscussionOutput\":\n                    return entity.id;\n                case \"ChannelInfoOutput\":\n                    var disInfo = new RongIMLib.Discussion();\n                    disInfo.creatorId = entity.adminUserId;\n                    disInfo.id = entity.channelId;\n                    disInfo.memberIdList = entity.firstTenUserIds;\n                    disInfo.name = entity.channelName;\n                    disInfo.isOpen = entity.openStatus;\n                    return disInfo;\n                case \"GroupHashOutput\":\n                    return entity.result;\n                case \"QueryBlackListOutput\":\n                    return entity.userIds;\n                case \"SearchMpOutput\":\n                case \"PullMpOutput\":\n                    if (entity.info) {\n                        var self = this;\n                        Array.forEach(entity.info, function (item) {\n                            setTimeout(self.pottingProfile(item), 100);\n                        });\n                    }\n                    return this.publicServiceList;\n                default:\n                    return entity;\n            }\n        };\n        return CallbackMapping;\n    })();\n    RongIMLib.CallbackMapping = CallbackMapping;\n    var PublishCallback = (function (_super) {\n        __extends(PublishCallback, _super);\n        function PublishCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        PublishCallback.prototype.process = function (_status, messageUId, timestamp, _msg, messageId) {\n            this.readTimeOut();\n            if (_status == 0) {\n                if (_msg) {\n                    _msg.setSentStatus = _status;\n                }\n                RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Bridge._client.userId, timestamp);\n                RongIMLib.RongIMClient._memoryStore.lastReadTime.get(RongIMLib.Bridge._client.userId, timestamp);\n                this._cb({ messageUId: messageUId, timestamp: timestamp, messageId: messageId });\n            }\n            else {\n                this._timeout(_status);\n            }\n        };\n        PublishCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return PublishCallback;\n    })(MessageCallback);\n    RongIMLib.PublishCallback = PublishCallback;\n    var QueryCallback = (function (_super) {\n        __extends(QueryCallback, _super);\n        function QueryCallback(_cb, _timeout) {\n            _super.call(this, _timeout);\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        QueryCallback.prototype.process = function (status, data, serverTime, pbtype) {\n            this.readTimeOut();\n            if (pbtype && data && status == 0) {\n                try {\n                    data = CallbackMapping.getInstance().mapping(RongIMLib.RongIMClient.Protobuf[pbtype].decode(data), pbtype);\n                }\n                catch (e) {\n                    this._timeout(RongIMLib.ErrorCode.UNKNOWN);\n                    return;\n                }\n                if (\"GetUserInfoOutput\" == pbtype) {\n                    //pb类型为GetUserInfoOutput的话就把data放入userinfo缓存队列\n                    RongIMLib.Client.userInfoMapping[data.userId] = data;\n                }\n                this._cb(data);\n            }\n            else {\n                status > 0 ? this._timeout(status) : this._cb(status);\n            }\n        };\n        QueryCallback.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return QueryCallback;\n    })(MessageCallback);\n    RongIMLib.QueryCallback = QueryCallback;\n    var ConnectAck = (function (_super) {\n        __extends(ConnectAck, _super);\n        function ConnectAck(_cb, _timeout, client) {\n            _super.call(this, _timeout);\n            this._client = client;\n            this._cb = _cb;\n            this._timeout = _timeout;\n        }\n        ConnectAck.prototype.process = function (status, userId, timestamp) {\n            this.readTimeOut();\n            if (status == 0) {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPrivate) {\n                    var date = new Date();\n                    var qryOpt, dateStr = date.getFullYear() + \"\" + (date.getMonth() + 1) + \"\" + date.getDate();\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        qryOpt = RongIMLib.RongIMClient._storageProvider.getItem(\"RongQryOpt\" + dateStr);\n                    }\n                    else {\n                        qryOpt = RongIMLib.RongIMClient._storageProvider.getItem(\"RongQryOpt\" + dateStr);\n                    }\n                    if (!qryOpt) {\n                        var modules = new RongIMLib.RongIMClient.Protobuf.GetUserInfoInput();\n                        modules.setNothing(0);\n                        RongIMLib.RongIMClient.bridge.queryMsg(\"qryCfg\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                            onSuccess: function (data) {\n                                if (!data)\n                                    return;\n                                var naviArrs = RongIMLib.RongIMClient._memoryStore.depend.navi.split('//');\n                                new RongIMLib.RongAjax({\n                                    url: \"https://stats.cn.ronghub.com/active.json\",\n                                    appKey: RongIMLib.RongIMClient._memoryStore.appKey,\n                                    deviceId: Math.floor(Math.random() * 10000),\n                                    timestamp: new Date().getTime(),\n                                    deviceInfo: \"\",\n                                    type: 1,\n                                    privateInfo: {\n                                        code: encodeURIComponent(data.name),\n                                        ip: RongIMLib.RongIMClient._storageProvider._host,\n                                        customId: data.id,\n                                        nip: naviArrs.length > 1 ? naviArrs[1] : \"\"\n                                    }\n                                }).send(function () {\n                                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                                        qryOpt = RongIMLib.RongIMClient._storageProvider.setItem(\"RongQryOpt\" + dateStr, dateStr);\n                                    }\n                                    else {\n                                        qryOpt = RongIMLib.RongIMClient._storageProvider.setItem(\"RongQryOpt\" + dateStr, dateStr);\n                                    }\n                                });\n                            },\n                            onError: function () { }\n                        }, \"GroupInfo\");\n                    }\n                }\n                var naviStr = RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\"));\n                var naviKey = RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\");\n                var arr = decodeURIComponent(naviStr).split(\",\");\n                if (!arr[1]) {\n                    naviStr = encodeURIComponent(naviStr) + userId;\n                    RongIMLib.RongIMClient._storageProvider.setItem(naviKey, naviStr);\n                }\n                this._client.userId = userId;\n                var self = this, temp = RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\");\n                var naviServer = RongIMLib.RongIMClient._storageProvider.getItem(temp);\n                // TODO  判断拆分 naviServer 后的数组长度。\n                var naviPort = naviServer.split(\",\")[0].split(\":\")[1];\n                if (!RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._memoryStore.isFirstPingMsg && naviPort.length < 4) {\n                    RongIMLib.Bridge._client.checkSocket({\n                        onSuccess: function () {\n                            if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                                self._client.syncTime(undefined, undefined, undefined, true);\n                            }\n                        },\n                        onError: function () {\n                            RongIMLib.RongIMClient._memoryStore.isFirstPingMsg = false;\n                            RongIMLib.RongIMClient.getInstance().disconnect();\n                            var temp = RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\");\n                            var server = RongIMLib.RongIMClient._storageProvider.getItem(\"RongBackupServer\");\n                            var arrs = server.split(\",\");\n                            if (arrs.length < 2) {\n                                throw new Error(\"navi server is empty\");\n                            }\n                            RongIMLib.RongIMClient._storageProvider.setItem(temp, RongIMLib.RongIMClient._storageProvider.getItem(\"RongBackupServer\"));\n                            var url = RongIMLib.Bridge._client.channel.socket.currentURL;\n                            RongIMLib.Bridge._client.channel.socket.currentURL = arrs[0] + url.substring(url.indexOf(\"/\"), url.length);\n                            RongIMLib.RongIMClient.connect(RongIMLib.RongIMClient._memoryStore.token, RongIMLib.RongIMClient._memoryStore.callback);\n                        }\n                    });\n                }\n                else {\n                    if (!RongIMLib.RongIMClient.isNotPullMsg) {\n                        self._client.syncTime(undefined, undefined, undefined, true);\n                    }\n                }\n                if (this._client.reconnectObj.onSuccess) {\n                    this._client.reconnectObj.onSuccess(userId);\n                    delete this._client.reconnectObj.onSuccess;\n                }\n                else {\n                    var me = this;\n                    setTimeout(function () { me._cb(userId); }, 500);\n                }\n                RongIMLib.Bridge._client.channel.socket.fire(\"StatusChanged\", 0);\n                RongIMLib.RongIMClient._memoryStore.connectAckTime = timestamp;\n                if (!(new Date().getTime() - timestamp)) {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = 0;\n                }\n                else {\n                    RongIMLib.RongIMClient._memoryStore.deltaTime = new Date().getTime() - timestamp;\n                }\n            }\n            else if (status == 6) {\n                //重定向 连错 CMP\n                var x = {};\n                var me = this;\n                new RongIMLib.Navigation().getServerEndpoint(this._client.token, this._client.appId, function () {\n                    me._client.clearHeartbeat();\n                    new RongIMLib.Client(me._client.token, me._client.appId).__init.call(x, function () {\n                        RongIMLib.Transportations._TransportType == \"websocket\" && me._client.keepLive();\n                    });\n                    me._client.channel.socket.fire(\"StatusChanged\", 2);\n                }, me._timeout, false);\n            }\n            else {\n                RongIMLib.Bridge._client.channel.socket.socket._status = status;\n                if (this._client.reconnectObj.onError) {\n                    this._client.reconnectObj.onError(status);\n                    delete this._client.reconnectObj.onError;\n                }\n                else {\n                    this._timeout(status);\n                }\n            }\n        };\n        ConnectAck.prototype.readTimeOut = function (x) {\n            MessageCallback.prototype.readTimeOut.call(this, x);\n        };\n        return ConnectAck;\n    })(MessageCallback);\n    RongIMLib.ConnectAck = ConnectAck;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var Navigation = (function () {\n        function Navigation() {\n            window.getServerEndpoint = function (x) {\n                //把导航返回的server字段赋值给CookieHelper._host，因为flash widget需要使用 decodeURIComponent\n                RongIMLib.RongIMClient._storageProvider._host = Navigation.Endpoint.host = x[\"server\"];\n                RongIMLib.RongIMClient._storageProvider.setItem(\"RongBackupServer\", x[\"backupServer\"] + \",\" + (x.userId || \"\"));\n                //设置当前用户 Id 只有 comet 使用。\n                Navigation.Endpoint.userId = x[\"userId\"];\n                if (x[\"voipCallInfo\"]) {\n                    var callInfo = JSON.parse(x[\"voipCallInfo\"]);\n                    RongIMLib.RongIMClient._memoryStore.voipStategy = callInfo.strategy;\n                    RongIMLib.RongIMClient._storageProvider.setItem(\"voipStrategy\", callInfo.strategy);\n                }\n                //替换本地存储的导航信息 \n                // var temp = RongIMClient._storageProvider.getItemKey(\"navi\");\n                // temp !== null && RongIMClient._storageProvider.removeItem(temp);\n                // 注：以上两行代码废弃，试用后删除。\n                var md5Token = md5(RongIMLib.Bridge._client.token).slice(8, 16), openMp = x['openMp'] == 0 ? 0 : 1;\n                RongIMLib.RongIMClient._storageProvider.setItem(\"navi\" + md5Token, x[\"server\"] + \",\" + (x.userId || \"\"));\n                RongIMLib.RongIMClient._storageProvider.setItem('openMp' + md5Token, openMp);\n                if (!openMp) {\n                    RongIMLib.RongIMClient._memoryStore.depend.openMp = false;\n                }\n            };\n        }\n        Navigation.prototype.connect = function (appId, token, callback) {\n            var oldAppId = RongIMLib.RongIMClient._storageProvider.getItem(\"appId\");\n            //如果appid和本地存储的不一样，清空所有本地存储数据\n            if (oldAppId && oldAppId != appId) {\n                RongIMLib.RongIMClient._storageProvider.clearItem();\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            if (!oldAppId) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"appId\", appId);\n            }\n            var client = new RongIMLib.Client(token, appId);\n            var me = this;\n            this.getServerEndpoint(token, appId, function () {\n                client.connect(callback);\n            }, callback.onError, true);\n            return client;\n        };\n        Navigation.prototype.getServerEndpoint = function (_token, _appId, _onsuccess, _onerror, unignore) {\n            if (unignore) {\n                //根据token生成MD5截取8-16下标的数据与本地存储的导航信息进行比对\n                //如果信息和上次的通道类型都一样，不执行navi请求，用本地存储的导航信息连接服务器\n                var naviStr = md5(_token).slice(8, 16), _old = RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.RongIMClient._storageProvider.getItemKey(\"navi\")), _new = RongIMLib.RongIMClient._storageProvider.getItem(\"navi\" + naviStr);\n                if (_old == _new && _new !== null && RongIMLib.RongIMClient._storageProvider.getItem(\"rongSDK\") == RongIMLib.Transportations._TransportType) {\n                    var obj = decodeURIComponent(_old).split(\",\");\n                    setTimeout(function () {\n                        RongIMLib.RongIMClient._storageProvider._host = Navigation.Endpoint.host = obj[0];\n                        RongIMLib.RongIMClient._memoryStore.voipStategy = RongIMLib.RongIMClient._storageProvider.getItem(\"voipStrategy\");\n                        if (!RongIMLib.RongIMClient._storageProvider.getItem('openMp' + naviStr)) {\n                            RongIMLib.RongIMClient._memoryStore.depend.openMp = false;\n                        }\n                        Navigation.Endpoint.userId = obj[1];\n                        _onsuccess();\n                    }, 500);\n                    return;\n                }\n            }\n            //导航信息，切换Url对象的key进行线上线下测试操作\n            var xss = document.createElement(\"script\");\n            //进行jsonp请求\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.navi + (RongIMLib.RongIMClient._memoryStore.depend.isPolling ? \"/cometnavi.js\" : \"/navi.js\") + \"?appId=\" + _appId + \"&token=\" + encodeURIComponent(_token) + \"&\" + \"callBack=getServerEndpoint&t=\" + (new Date).getTime();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                _onerror(RongIMLib.ConnectionState.TOKEN_INCORRECT);\n            };\n            if (\"onload\" in xss) {\n                xss.onload = _onsuccess;\n            }\n            else {\n                xss.onreadystatechange = function () {\n                    xss.readyState == \"loaded\" && _onsuccess();\n                };\n            }\n        };\n        Navigation.Endpoint = new Object;\n        return Navigation;\n    })();\n    RongIMLib.Navigation = Navigation;\n})(RongIMLib || (RongIMLib = {}));\n// TODO: 统一变量、方法等命名规范\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 消息基类\n     */\n    var BaseMessage = (function () {\n        function BaseMessage(arg) {\n            this._name = \"BaseMessage\";\n            this.lengthSize = 0;\n            if (arg instanceof RongIMLib.Header) {\n                this._header = arg;\n            }\n            else {\n                this._header = new RongIMLib.Header(arg, false, RongIMLib.Qos.AT_MOST_ONCE, false);\n            }\n        }\n        BaseMessage.prototype.read = function (In, length) {\n            this.readMessage(In, length);\n        };\n        BaseMessage.prototype.write = function (Out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            var out = binaryHelper.convertStream(Out);\n            this._headerCode = this.getHeaderFlag();\n            out.write(this._headerCode);\n            this.writeMessage(out);\n            return out;\n        };\n        BaseMessage.prototype.getHeaderFlag = function () {\n            return this._header.encode();\n        };\n        BaseMessage.prototype.getLengthSize = function () {\n            return this.lengthSize;\n        };\n        BaseMessage.prototype.toBytes = function () {\n            return this.write([]).getBytesArray();\n        };\n        BaseMessage.prototype.isRetained = function () {\n            return this._header.retain;\n        };\n        BaseMessage.prototype.setRetained = function (retain) {\n            this._header.retain = retain;\n        };\n        BaseMessage.prototype.setQos = function (qos) {\n            this._header.qos = Object.prototype.toString.call(qos) == \"[object Object]\" ? qos : RongIMLib.Qos[qos];\n        };\n        BaseMessage.prototype.setDup = function (dup) {\n            this._header.dup = dup;\n        };\n        BaseMessage.prototype.isDup = function () {\n            return this._header.dup;\n        };\n        BaseMessage.prototype.getType = function () {\n            return this._header.type;\n        };\n        BaseMessage.prototype.getQos = function () {\n            return this._header.qos;\n        };\n        BaseMessage.prototype.messageLength = function () {\n            return 0;\n        };\n        BaseMessage.prototype.writeMessage = function (out) { };\n        BaseMessage.prototype.readMessage = function (In, length) { };\n        BaseMessage.prototype.init = function (args) {\n            var valName, nana, me = this;\n            for (nana in args) {\n                if (!args.hasOwnProperty(nana)) {\n                    continue;\n                }\n                valName = nana.replace(/^\\w/, function (x) {\n                    var tt = x.charCodeAt(0);\n                    return \"set\" + (tt >= 0x61 ? String.fromCharCode(tt & ~32) : x);\n                });\n                if (valName in me) {\n                    if (nana == \"status\") {\n                        me[valName](disconnectStatus[args[nana]] ? disconnectStatus[args[nana]] : args[nana]);\n                    }\n                    else {\n                        me[valName](args[nana]);\n                    }\n                }\n            }\n        };\n        return BaseMessage;\n    })();\n    RongIMLib.BaseMessage = BaseMessage;\n    /**\n     *连接消息类型\n     */\n    var ConnectMessage = (function (_super) {\n        __extends(ConnectMessage, _super);\n        function ConnectMessage(header) {\n            _super.call(this, arguments.length == 0 || arguments.length == 3 ? RongIMLib.Type.CONNECT : arguments[0]);\n            this._name = \"ConnectMessage\";\n            this.CONNECT_HEADER_SIZE = 12;\n            this.protocolId = \"RCloud\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.protocolVersion = 3;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                case 3:\n                    if (!arguments[0] || arguments[0].length > 64) {\n                        throw new Error(\"ConnectMessage:Client Id cannot be null and must be at most 64 characters long: \" + arguments[0]);\n                    }\n                    this.clientId = arguments[0];\n                    this.cleanSession = arguments[1];\n                    this.keepAlive = arguments[2];\n                    break;\n            }\n        }\n        ConnectMessage.prototype.messageLength = function () {\n            var payloadSize = this.binaryHelper.toMQttString(this.clientId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.willTopic).length;\n            payloadSize += this.binaryHelper.toMQttString(this.will).length;\n            payloadSize += this.binaryHelper.toMQttString(this.appId).length;\n            payloadSize += this.binaryHelper.toMQttString(this.token).length;\n            return payloadSize + this.CONNECT_HEADER_SIZE;\n        };\n        ConnectMessage.prototype.readMessage = function (stream) {\n            this.protocolId = stream.readUTF();\n            this.protocolVersion = stream.readByte();\n            var cFlags = stream.readByte();\n            this.hasAppId = (cFlags & 128) > 0;\n            this.hasToken = (cFlags & 64) > 0;\n            this.retainWill = (cFlags & 32) > 0;\n            this.willQos = cFlags >> 3 & 3;\n            this.hasWill = (cFlags & 4) > 0;\n            this.cleanSession = (cFlags & 32) > 0;\n            this.keepAlive = stream.read() * 256 + stream.read();\n            this.clientId = stream.readUTF();\n            if (this.hasWill) {\n                this.willTopic = stream.readUTF();\n                this.will = stream.readUTF();\n            }\n            if (this.hasAppId) {\n                try {\n                    this.appId = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            if (this.hasToken) {\n                try {\n                    this.token = stream.readUTF();\n                }\n                catch (ex) {\n                    throw new Error(ex);\n                }\n            }\n            return stream;\n        };\n        ConnectMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.writeUTF(this.protocolId);\n            stream.write(this.protocolVersion);\n            var flags = this.cleanSession ? 2 : 0;\n            flags |= this.hasWill ? 4 : 0;\n            flags |= this.willQos ? this.willQos >> 3 : 0;\n            flags |= this.retainWill ? 32 : 0;\n            flags |= this.hasToken ? 64 : 0;\n            flags |= this.hasAppId ? 128 : 0;\n            stream.write(flags);\n            stream.writeChar(this.keepAlive);\n            stream.writeUTF(this.clientId);\n            if (this.hasWill) {\n                stream.writeUTF(this.willTopic);\n                stream.writeUTF(this.will);\n            }\n            if (this.hasAppId) {\n                stream.writeUTF(this.appId);\n            }\n            if (this.hasToken) {\n                stream.writeUTF(this.token);\n            }\n            return stream;\n        };\n        return ConnectMessage;\n    })(BaseMessage);\n    RongIMLib.ConnectMessage = ConnectMessage;\n    /**\n     *连接应答类型\n     */\n    var ConnAckMessage = (function (_super) {\n        __extends(ConnAckMessage, _super);\n        function ConnAckMessage(header) {\n            _super.call(this, arguments.length == 0 ? RongIMLib.Type.CONNACK : arguments.length == 1 ? arguments[0] instanceof RongIMLib.Header ? arguments[0] : RongIMLib.Type.CONNACK : null);\n            this._name = \"ConnAckMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            var me = this;\n            switch (arguments.length) {\n                case 0:\n                case 1:\n                    if (!(arguments[0] instanceof RongIMLib.Header)) {\n                        if (arguments[0] in RongIMLib.ConnectionState) {\n                            if (arguments[0] == null) {\n                                throw new Error(\"ConnAckMessage:The status of ConnAskMessage can't be null\");\n                            }\n                            me.setStatus(arguments[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        ;\n        ConnAckMessage.prototype.messageLength = function () {\n            var length = this.MESSAGE_LENGTH;\n            if (this.userId) {\n                length += this.binaryHelper.toMQttString(this.userId).length;\n            }\n            return length;\n        };\n        ;\n        ConnAckMessage.prototype.readMessage = function (_in, msglength) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 12) {\n                this.setStatus(result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n            if (msglength > this.MESSAGE_LENGTH) {\n                this.setUserId(_in.readUTF());\n                var sessionId = _in.readUTF();\n                var timestamp = _in.readLong();\n                this.setTimestamp(timestamp);\n            }\n        };\n        ;\n        ConnAckMessage.prototype.writeMessage = function (out) {\n            var stream = this.binaryHelper.convertStream(out);\n            stream.write(128);\n            switch (+status) {\n                case 0:\n                case 1:\n                case 2:\n                case 5:\n                case 6:\n                    stream.write(+status);\n                    break;\n                case 3:\n                case 4:\n                    stream.write(3);\n                    break;\n                default:\n                    throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n            if (this.userId) {\n                stream.writeUTF(this.userId);\n            }\n            return stream;\n        };\n        ;\n        ConnAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        ConnAckMessage.prototype.setUserId = function (_userId) {\n            this.userId = _userId;\n        };\n        ;\n        ConnAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        ConnAckMessage.prototype.getUserId = function () {\n            return this.userId;\n        };\n        ;\n        ConnAckMessage.prototype.setTimestamp = function (x) {\n            this.timestrap = x;\n        };\n        ;\n        ConnAckMessage.prototype.getTimestamp = function () {\n            return this.timestrap;\n        };\n        return ConnAckMessage;\n    })(BaseMessage);\n    RongIMLib.ConnAckMessage = ConnAckMessage;\n    /**\n     *断开消息类型\n     */\n    var DisconnectMessage = (function (_super) {\n        __extends(DisconnectMessage, _super);\n        function DisconnectMessage(header) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : RongIMLib.Type.DISCONNECT);\n            this._name = \"DisconnectMessage\";\n            this.MESSAGE_LENGTH = 2;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            if (!(header instanceof RongIMLib.Header)) {\n                if (header in RongIMLib.ConnectionStatus) {\n                    this.status = header;\n                }\n            }\n        }\n        DisconnectMessage.prototype.messageLength = function () {\n            return this.MESSAGE_LENGTH;\n        };\n        DisconnectMessage.prototype.readMessage = function (_in) {\n            _in.read();\n            var result = +_in.read();\n            if (result >= 0 && result <= 5) {\n                this.setStatus(disconnectStatus[result] ? disconnectStatus[result] : result);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + result);\n            }\n        };\n        DisconnectMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.write(0);\n            if (+status >= 1 && +status <= 3) {\n                out.write((+status) - 1);\n            }\n            else {\n                throw new Error(\"Unsupported CONNACK code:\" + status);\n            }\n        };\n        DisconnectMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        ;\n        DisconnectMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        ;\n        return DisconnectMessage;\n    })(BaseMessage);\n    RongIMLib.DisconnectMessage = DisconnectMessage;\n    /**\n     *请求消息信令\n     */\n    var PingReqMessage = (function (_super) {\n        __extends(PingReqMessage, _super);\n        function PingReqMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGREQ);\n            this._name = \"PingReqMessage\";\n        }\n        return PingReqMessage;\n    })(BaseMessage);\n    RongIMLib.PingReqMessage = PingReqMessage;\n    /**\n     *响应消息信令\n     */\n    var PingRespMessage = (function (_super) {\n        __extends(PingRespMessage, _super);\n        function PingRespMessage(header) {\n            _super.call(this, (header && header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PINGRESP);\n            this._name = \"PingRespMessage\";\n        }\n        return PingRespMessage;\n    })(BaseMessage);\n    RongIMLib.PingRespMessage = PingRespMessage;\n    /**\n     *封装MesssageId\n     */\n    var RetryableMessage = (function (_super) {\n        __extends(RetryableMessage, _super);\n        function RetryableMessage(argu) {\n            _super.call(this, argu);\n            this._name = \"RetryableMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        RetryableMessage.prototype.messageLength = function () {\n            return 2;\n        };\n        RetryableMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out), Id = this.getMessageId(), lsb = Id & 255, msb = (Id & 65280) >> 8;\n            out.write(msb);\n            out.write(lsb);\n            return out;\n        };\n        RetryableMessage.prototype.readMessage = function (_in, msgLength) {\n            var msgId = _in.read() * 256 + _in.read();\n            this.setMessageId(parseInt(msgId, 10));\n        };\n        RetryableMessage.prototype.setMessageId = function (_messageId) {\n            this.messageId = _messageId;\n        };\n        RetryableMessage.prototype.getMessageId = function () {\n            return this.messageId;\n        };\n        return RetryableMessage;\n    })(BaseMessage);\n    RongIMLib.RetryableMessage = RetryableMessage;\n    /**\n     *发送消息应答（双向）\n     *qos为1必须给出应答（所有消息类型一样）\n     */\n    var PubAckMessage = (function (_super) {\n        __extends(PubAckMessage, _super);\n        function PubAckMessage(header) {\n            _super.call(this, (header instanceof RongIMLib.Header) ? header : RongIMLib.Type.PUBACK);\n            this.msgLen = 2;\n            this.date = 0;\n            this.millisecond = 0;\n            this.timestamp = 0;\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"PubAckMessage\";\n            if (!(header instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, header);\n            }\n        }\n        PubAckMessage.prototype.messageLength = function () {\n            return this.msgLen;\n        };\n        PubAckMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n        };\n        PubAckMessage.prototype.readMessage = function (_in, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, _in);\n            this.date = _in.readInt();\n            this.status = _in.read() * 256 + _in.read();\n            this.millisecond = _in.read() * 256 + _in.read();\n            this.timestamp = this.date * 1000 + this.millisecond;\n            this.messageUId = _in.readUTF();\n        };\n        PubAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        PubAckMessage.prototype.setTimestamp = function (timestamp) {\n            this.timestamp = timestamp;\n        };\n        PubAckMessage.prototype.setMessageUId = function (messageUId) {\n            this.messageUId = messageUId;\n        };\n        PubAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        PubAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        PubAckMessage.prototype.getTimestamp = function () {\n            return this.timestamp;\n        };\n        PubAckMessage.prototype.getMessageUId = function () {\n            return this.messageUId;\n        };\n        return PubAckMessage;\n    })(RetryableMessage);\n    RongIMLib.PubAckMessage = PubAckMessage;\n    /**\n     *发布消息\n     */\n    var PublishMessage = (function (_super) {\n        __extends(PublishMessage, _super);\n        function PublishMessage(header, two, three) {\n            _super.call(this, (arguments.length == 1 && header instanceof RongIMLib.Header) ? header : arguments.length == 3 ? RongIMLib.Type.PUBLISH : 0);\n            this._name = \"PublishMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this.syncMsg = false;\n            if (arguments.length == 3) {\n                this.topic = header;\n                this.targetId = three;\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n            }\n        }\n        PublishMessage.prototype.messageLength = function () {\n            var length = 10;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += this.data.length;\n            return length;\n        };\n        PublishMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.apply(this, arguments);\n            out.write(this.data);\n        };\n        ;\n        PublishMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 6;\n            this.date = _in.readInt();\n            this.topic = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            RetryableMessage.prototype.readMessage.apply(this, arguments);\n            this.data = new Array(msgLength - pos);\n            this.data = _in.read(this.data);\n        };\n        ;\n        PublishMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        PublishMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        PublishMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        PublishMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        PublishMessage.prototype.setSyncMsg = function (x) {\n            this.syncMsg = x;\n        };\n        //是否是其他端同步过来的消息\n        PublishMessage.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        PublishMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        PublishMessage.prototype.getData = function () {\n            return this.data;\n        };\n        PublishMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        PublishMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        return PublishMessage;\n    })(RetryableMessage);\n    RongIMLib.PublishMessage = PublishMessage;\n    /**\n     *请求查询\n     */\n    var QueryMessage = (function (_super) {\n        __extends(QueryMessage, _super);\n        function QueryMessage(header, two, three) {\n            _super.call(this, header instanceof RongIMLib.Header ? header : arguments.length == 3 ? RongIMLib.Type.QUERY : null);\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n            this._name = \"QueryMessage\";\n            if (arguments.length == 3) {\n                this.data = typeof two == \"string\" ? this.binaryHelper.toMQttString(two) : two;\n                this.topic = header;\n                this.targetId = three;\n            }\n        }\n        QueryMessage.prototype.messageLength = function () {\n            var length = 0;\n            length += this.binaryHelper.toMQttString(this.topic).length;\n            length += this.binaryHelper.toMQttString(this.targetId).length;\n            length += 2;\n            length += this.data.length;\n            return length;\n        };\n        QueryMessage.prototype.writeMessage = function (Out) {\n            var out = this.binaryHelper.convertStream(Out);\n            out.writeUTF(this.topic);\n            out.writeUTF(this.targetId);\n            RetryableMessage.prototype.writeMessage.call(this, out);\n            out.write(this.data);\n        };\n        QueryMessage.prototype.readMessage = function (_in, msgLength) {\n            var pos = 0;\n            this.topic = _in.readUTF();\n            this.targetId = _in.readUTF();\n            pos += this.binaryHelper.toMQttString(this.topic).length;\n            pos += this.binaryHelper.toMQttString(this.targetId).length;\n            this.readMessage.apply(this, arguments);\n            pos += 2;\n            this.data = new Array(msgLength - pos);\n            _in.read(this.data);\n        };\n        QueryMessage.prototype.setTopic = function (x) {\n            this.topic = x;\n        };\n        QueryMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        QueryMessage.prototype.setTargetId = function (x) {\n            this.targetId = x;\n        };\n        QueryMessage.prototype.getTopic = function () {\n            return this.topic;\n        };\n        QueryMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryMessage.prototype.getTargetId = function () {\n            return this.targetId;\n        };\n        return QueryMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryMessage = QueryMessage;\n    /**\n     *请求查询确认\n     */\n    var QueryConMessage = (function (_super) {\n        __extends(QueryConMessage, _super);\n        function QueryConMessage(messageId) {\n            _super.call(this, (messageId instanceof RongIMLib.Header) ? messageId : RongIMLib.Type.QUERYCON);\n            this._name = \"QueryConMessage\";\n            if (!(messageId instanceof RongIMLib.Header)) {\n                _super.prototype.setMessageId.call(this, messageId);\n            }\n        }\n        return QueryConMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryConMessage = QueryConMessage;\n    /**\n     *请求查询应答\n     */\n    var QueryAckMessage = (function (_super) {\n        __extends(QueryAckMessage, _super);\n        function QueryAckMessage(header) {\n            _super.call(this, header);\n            this._name = \"QueryAckMessage\";\n            this.binaryHelper = new RongIMLib.BinaryHelper();\n        }\n        QueryAckMessage.prototype.readMessage = function (In, msgLength) {\n            RetryableMessage.prototype.readMessage.call(this, In);\n            this.date = In.readInt();\n            this.setStatus(In.read() * 256 + In.read());\n            if (msgLength > 0) {\n                this.data = new Array(msgLength - 8);\n                this.data = In.read(this.data);\n            }\n        };\n        QueryAckMessage.prototype.getData = function () {\n            return this.data;\n        };\n        QueryAckMessage.prototype.getStatus = function () {\n            return this.status;\n        };\n        QueryAckMessage.prototype.getDate = function () {\n            return this.date;\n        };\n        QueryAckMessage.prototype.setDate = function (x) {\n            this.date = x;\n        };\n        QueryAckMessage.prototype.setStatus = function (x) {\n            this.status = x;\n        };\n        QueryAckMessage.prototype.setData = function (x) {\n            this.data = x;\n        };\n        return QueryAckMessage;\n    })(RetryableMessage);\n    RongIMLib.QueryAckMessage = QueryAckMessage;\n})(RongIMLib || (RongIMLib = {}));\n/// <reference path=\"../../dts/helper.d.ts\"/>\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 把消息对象写入流中\n     * 发送消息时用到\n     */\n    var MessageOutputStream = (function () {\n        function MessageOutputStream(_out) {\n            var binaryHelper = new RongIMLib.BinaryHelper();\n            this.out = binaryHelper.convertStream(_out);\n        }\n        MessageOutputStream.prototype.writeMessage = function (msg) {\n            if (msg instanceof RongIMLib.BaseMessage) {\n                msg.write(this.out);\n            }\n        };\n        return MessageOutputStream;\n    })();\n    RongIMLib.MessageOutputStream = MessageOutputStream;\n    /**\n     * 流转换为消息对象\n     * 服务器返回消息时用到\n     */\n    var MessageInputStream = (function () {\n        function MessageInputStream(In, isPolling) {\n            if (!isPolling) {\n                var _in = new RongIMLib.BinaryHelper().convertStream(In);\n                this.flags = _in.readByte();\n                this._in = _in;\n            }\n            else {\n                this.flags = In[\"headerCode\"];\n            }\n            this.header = new RongIMLib.Header(this.flags);\n            this.isPolling = isPolling;\n            this.In = In;\n        }\n        MessageInputStream.prototype.readMessage = function () {\n            switch (this.header.getType()) {\n                case 1:\n                    this.msg = new RongIMLib.ConnectMessage(this.header);\n                    break;\n                case 2:\n                    this.msg = new RongIMLib.ConnAckMessage(this.header);\n                    break;\n                case 3:\n                    this.msg = new RongIMLib.PublishMessage(this.header);\n                    this.msg.setSyncMsg(this.header.getSyncMsg());\n                    break;\n                case 4:\n                    this.msg = new RongIMLib.PubAckMessage(this.header);\n                    break;\n                case 5:\n                    this.msg = new RongIMLib.QueryMessage(this.header);\n                    break;\n                case 6:\n                    this.msg = new RongIMLib.QueryAckMessage(this.header);\n                    break;\n                case 7:\n                    this.msg = new RongIMLib.QueryConMessage(this.header);\n                    break;\n                case 9:\n                case 11:\n                case 13:\n                    this.msg = new RongIMLib.PingRespMessage(this.header);\n                    break;\n                case 8:\n                case 10:\n                case 12:\n                    this.msg = new RongIMLib.PingReqMessage(this.header);\n                    break;\n                case 14:\n                    this.msg = new RongIMLib.DisconnectMessage(this.header);\n                    break;\n                default:\n                    throw new Error(\"No support for deserializing \" + this.header.getType() + \" messages\");\n            }\n            if (this.isPolling) {\n                this.msg.init(this.In);\n            }\n            else {\n                this.msg.read(this._in, this.In.length - 1);\n            }\n            return this.msg;\n        };\n        return MessageInputStream;\n    })();\n    RongIMLib.MessageInputStream = MessageInputStream;\n    var Header = (function () {\n        function Header(_type, _retain, _qos, _dup) {\n            this.retain = false;\n            this.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n            this.dup = false;\n            this.syncMsg = false;\n            if (_type && +_type == _type && arguments.length == 1) {\n                this.retain = (_type & 1) > 0;\n                this.qos = (_type & 6) >> 1;\n                this.dup = (_type & 8) > 0;\n                this.type = (_type >> 4) & 15;\n                this.syncMsg = (_type & 8) == 8;\n            }\n            else {\n                this.type = _type;\n                this.retain = _retain;\n                this.qos = _qos;\n                this.dup = _dup;\n            }\n        }\n        Header.prototype.getSyncMsg = function () {\n            return this.syncMsg;\n        };\n        Header.prototype.getType = function () {\n            return this.type;\n        };\n        Header.prototype.encode = function () {\n            var me = this;\n            switch (this.qos) {\n                case RongIMLib.Qos[0]:\n                    me.qos = RongIMLib.Qos.AT_MOST_ONCE;\n                    break;\n                case RongIMLib.Qos[1]:\n                    me.qos = RongIMLib.Qos.AT_LEAST_ONCE;\n                    break;\n                case RongIMLib.Qos[2]:\n                    me.qos = RongIMLib.Qos.EXACTLY_ONCE;\n                    break;\n                case RongIMLib.Qos[3]:\n                    me.qos = RongIMLib.Qos.DEFAULT;\n                    break;\n            }\n            var _byte = (this.type << 4);\n            _byte |= this.retain ? 1 : 0;\n            _byte |= this.qos << 1;\n            _byte |= this.dup ? 8 : 0;\n            return _byte;\n        };\n        Header.prototype.toString = function () {\n            return \"Header [type=\" + this.type + \",retain=\" + this.retain + \",qos=\" + this.qos + \",dup=\" + this.dup + \"]\";\n        };\n        return Header;\n    })();\n    RongIMLib.Header = Header;\n    /**\n     * 二进制帮助对象\n     */\n    var BinaryHelper = (function () {\n        function BinaryHelper() {\n        }\n        BinaryHelper.prototype.writeUTF = function (str, isGetBytes) {\n            var back = [], byteSize = 0;\n            for (var i = 0, len = str.length; i < len; i++) {\n                var code = str.charCodeAt(i);\n                if (code >= 0 && code <= 127) {\n                    byteSize += 1;\n                    back.push(code);\n                }\n                else if (code >= 128 && code <= 2047) {\n                    byteSize += 2;\n                    back.push((192 | (31 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n                else if (code >= 2048 && code <= 65535) {\n                    byteSize += 3;\n                    back.push((224 | (15 & (code >> 12))));\n                    back.push((128 | (63 & (code >> 6))));\n                    back.push((128 | (63 & code)));\n                }\n            }\n            for (var i = 0, len = back.length; i < len; i++) {\n                if (back[i] > 255) {\n                    back[i] &= 255;\n                }\n            }\n            if (isGetBytes) {\n                return back;\n            }\n            if (byteSize <= 255) {\n                return [0, byteSize].concat(back);\n            }\n            else {\n                return [byteSize >> 8, byteSize & 255].concat(back);\n            }\n        };\n        BinaryHelper.prototype.readUTF = function (arr) {\n            if (Object.prototype.toString.call(arr) == \"[object String]\") {\n                return arr;\n            }\n            var UTF = \"\", _arr = arr;\n            for (var i = 0, len = _arr.length; i < len; i++) {\n                if (_arr[i] < 0) {\n                    _arr[i] += 256;\n                }\n                ;\n                var one = _arr[i].toString(2), v = one.match(/^1+?(?=0)/);\n                if (v && one.length == 8) {\n                    var bytesLength = v[0].length, \n                    // store = _arr[i].toString(2).slice(7 - bytesLength);\n                    store = '';\n                    for (var st = 0; st < bytesLength; st++) {\n                        store += _arr[st + i].toString(2).slice(2);\n                    }\n                    UTF += String.fromCharCode(parseInt(store, 2));\n                    i += bytesLength - 1;\n                }\n                else {\n                    UTF += String.fromCharCode(_arr[i]);\n                }\n            }\n            return UTF;\n        };\n        /**\n         * [convertStream 将参数x转化为RongIMStream对象]\n         * @param  {any}    x [参数]\n         */\n        BinaryHelper.prototype.convertStream = function (x) {\n            if (x instanceof RongIMStream) {\n                return x;\n            }\n            else {\n                return new RongIMStream(x);\n            }\n        };\n        BinaryHelper.prototype.toMQttString = function (str) {\n            return this.writeUTF(str);\n        };\n        return BinaryHelper;\n    })();\n    RongIMLib.BinaryHelper = BinaryHelper;\n    var RongIMStream = (function () {\n        function RongIMStream(arr) {\n            //当前流执行的起始位置\n            this.position = 0;\n            //当前流写入的多少字节\n            this.writen = 0;\n            this.poolLen = 0;\n            this.binaryHelper = new BinaryHelper();\n            this.pool = arr;\n            this.poolLen = arr.length;\n        }\n        RongIMStream.prototype.check = function () {\n            return this.position >= this.pool.length;\n        };\n        RongIMStream.prototype.readInt = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 4; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t.toString(16);\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readLong = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                var t = this.pool[this.position++].toString(16);\n                if (t.length == 1) {\n                    t = \"0\" + t;\n                }\n                end += t;\n            }\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readTimestamp = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var end = \"\";\n            for (var i = 0; i < 8; i++) {\n                end += this.pool[this.position++].toString(16);\n            }\n            end = end.substring(2, 8);\n            return parseInt(end, 16);\n        };\n        RongIMStream.prototype.readUTF = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var big = (this.readByte() << 8) | this.readByte();\n            return this.binaryHelper.readUTF(this.pool.subarray(this.position, this.position += big));\n        };\n        RongIMStream.prototype.readByte = function () {\n            if (this.check()) {\n                return -1;\n            }\n            var val = this.pool[this.position++];\n            if (val > 255) {\n                val &= 255;\n            }\n            return val;\n        };\n        RongIMStream.prototype.read = function (bytesArray) {\n            if (bytesArray) {\n                return this.pool.subarray(this.position, this.poolLen);\n            }\n            else {\n                return this.readByte();\n            }\n        };\n        RongIMStream.prototype.write = function (_byte) {\n            var b = _byte;\n            if (Object.prototype.toString.call(b).toLowerCase() == \"[object array]\") {\n                [].push.apply(this.pool, b);\n            }\n            else {\n                if (+b == b) {\n                    if (b > 255) {\n                        b &= 255;\n                    }\n                    this.pool.push(b);\n                    this.writen++;\n                }\n            }\n            return b;\n        };\n        RongIMStream.prototype.writeChar = function (v) {\n            if (+v != v) {\n                throw new Error(\"writeChar:arguments type is error\");\n            }\n            this.write(v >> 8 & 255);\n            this.write(v & 255);\n            this.writen += 2;\n        };\n        RongIMStream.prototype.writeUTF = function (str) {\n            var val = this.binaryHelper.writeUTF(str);\n            [].push.apply(this.pool, val);\n            this.writen += val.length;\n        };\n        RongIMStream.prototype.toComplements = function () {\n            var _tPool = this.pool;\n            for (var i = 0; i < this.poolLen; i++) {\n                if (_tPool[i] > 128) {\n                    _tPool[i] -= 256;\n                }\n            }\n            return _tPool;\n        };\n        RongIMStream.prototype.getBytesArray = function (isCom) {\n            if (isCom) {\n                return this.toComplements();\n            }\n            return this.pool;\n        };\n        return RongIMStream;\n    })();\n    RongIMLib.RongIMStream = RongIMStream;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var SocketTransportation = (function () {\n        /**\n         * [constructor]\n         * @param  {string} url [连接地址：包含token、version]\n         */\n        function SocketTransportation(_socket) {\n            //连接状态 true:已连接 false:未连接\n            this.connected = false;\n            //是否关闭： true:已关闭 false：未关闭\n            this.isClose = false;\n            //存放消息队列的临时变量\n            this.queue = [];\n            this.empty = new Function;\n            this._socket = _socket;\n            return this;\n        }\n        /**\n         * [createTransport 创建WebScoket对象]\n         */\n        SocketTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"URL can't be empty\");\n            }\n            ;\n            this.url = url;\n            this.socket = new WebSocket(RongIMLib.RongIMClient._memoryStore.depend.wsScheme + url);\n            this.socket.binaryType = \"arraybuffer\";\n            this.addEvent();\n            return this.socket;\n        };\n        /**\n         * [send 传送消息流]\n         * @param  {ArrayBuffer} data [二进制消息流]\n         */\n        SocketTransportation.prototype.send = function (data) {\n            if (!this.connected && !this.isClose) {\n                //当通道不可用时，加入消息队列\n                this.queue.push(data);\n                return;\n            }\n            if (this.isClose) {\n                this._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.CONNECTION_CLOSED);\n                return;\n            }\n            var stream = new RongIMLib.RongIMStream([]), msg = new RongIMLib.MessageOutputStream(stream);\n            msg.writeMessage(data);\n            var val = stream.getBytesArray(true);\n            var binary = new Int8Array(val);\n            this.socket.send(binary.buffer);\n            return this;\n        };\n        /**\n         * [onData 通道返回数据时调用的方法，用来想上层传递服务器返回的二进制消息流]\n         * @param  {ArrayBuffer}    data [二进制消息流]\n         */\n        SocketTransportation.prototype.onData = function (data) {\n            if (RongIMLib.MessageUtil.isArray(data)) {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(data).readMessage());\n            }\n            else {\n                this._socket.onMessage(new RongIMLib.MessageInputStream(RongIMLib.MessageUtil.ArrayFormInput(data)).readMessage());\n            }\n            return \"\";\n        };\n        /**\n         * [onClose 通道关闭时触发的方法]\n         */\n        SocketTransportation.prototype.onClose = function (ev) {\n            var me = this;\n            me.isClose = true;\n            me.socket = this.empty;\n            RongIMLib.Bridge._client.clearHeartbeat();\n            if (ev.code == 1006 && !this._status) {\n                me._socket.fire(\"StatusChanged\", RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE);\n            }\n            else {\n                me._status = 0;\n            }\n        };\n        /**\n         * [onError 通道报错时触发的方法]\n         * @param {any} error [抛出异常]\n         */\n        SocketTransportation.prototype.onError = function (error) {\n            throw new Error(error);\n        };\n        /**\n         * [addEvent 为通道绑定事件]\n         */\n        SocketTransportation.prototype.addEvent = function () {\n            var self = this;\n            self.socket.onopen = function () {\n                self.connected = true;\n                self.isClose = false;\n                //通道可以用后，调用发送队列方法，把所有等得发送的消息发出\n                self.doQueue();\n                self._socket.fire(\"connect\");\n            };\n            self.socket.onmessage = function (ev) {\n                //判断数据是不是字符串，如果是字符串那么就是flash传过来的。\n                if (typeof ev.data == \"string\") {\n                    self.onData(ev.data.split(\",\"));\n                }\n                else {\n                    self.onData(ev.data);\n                }\n            };\n            self.socket.onerror = function (ev) {\n                self.onError(ev);\n            };\n            self.socket.onclose = function (ev) {\n                self.onClose(ev);\n            };\n        };\n        /**\n         * [doQueue 消息队列，把队列中消息发出]\n         */\n        SocketTransportation.prototype.doQueue = function () {\n            var self = this;\n            for (var i = 0, len = self.queue.length; i < len; i++) {\n                self.send(self.queue[i]);\n            }\n        };\n        /**\n         * [disconnect 断开连接]\n         */\n        SocketTransportation.prototype.disconnect = function (status) {\n            var me = this;\n            if (me.socket.readyState) {\n                me.isClose = true;\n                if (status) {\n                    me._status = status;\n                }\n                this.socket.close();\n            }\n        };\n        /**\n         * [reconnect 重新连接]\n         */\n        SocketTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        return SocketTransportation;\n    })();\n    RongIMLib.SocketTransportation = SocketTransportation;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PollingTransportation = (function () {\n        function PollingTransportation(socket) {\n            this.empty = new Function;\n            this.connected = false;\n            this.pid = +new Date + Math.random() + \"\";\n            this.queue = [];\n            this.socket = socket;\n            return this;\n        }\n        PollingTransportation.prototype.createTransport = function (url, method) {\n            if (!url) {\n                throw new Error(\"Url is empty,Please check it!\");\n            }\n            ;\n            this.url = url;\n            var sid = RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId), me = this;\n            if (sid) {\n                setTimeout(function () {\n                    me.onSuccess(\"{\\\"status\\\":0,\\\"userId\\\":\\\"\" + RongIMLib.Navigation.Endpoint.userId + \"\\\",\\\"headerCode\\\":32,\\\"messageId\\\":0,\\\"sessionid\\\":\\\"\" + sid + \"\\\"}\");\n                    me.connected = true;\n                }, 500);\n                return this;\n            }\n            this.getRequest(url, true);\n            return this;\n        };\n        PollingTransportation.prototype.requestFactory = function (url, method, multipart) {\n            var reqest = this.XmlHttpRequest();\n            if (multipart) {\n                reqest.multipart = true;\n            }\n            reqest.timeout = 60000;\n            reqest.open(method || \"GET\", RongIMLib.RongIMClient._memoryStore.depend.protocol + url);\n            if (method == \"POST\" && \"setRequestHeader\" in reqest) {\n                reqest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n            }\n            return reqest;\n        };\n        PollingTransportation.prototype.getRequest = function (url, isconnect) {\n            var me = this;\n            me.xhr = this.requestFactory(url + \"&pid=\" + encodeURIComponent(me.pid), \"GET\");\n            if (\"onload\" in me.xhr) {\n                me.xhr.onload = function () {\n                    me.xhr.onload = me.empty;\n                    if (this.responseText == \"lost params\") {\n                        me.onError();\n                    }\n                    else {\n                        me.onSuccess(this.responseText, isconnect);\n                    }\n                };\n                me.xhr.onerror = function () {\n                    me.disconnect();\n                };\n            }\n            else {\n                me.xhr.onreadystatechange = function () {\n                    if (me.xhr.readyState == 4) {\n                        me.xhr.onreadystatechange = me.empty;\n                        if (/^(200|202)$/.test(me.xhr.status)) {\n                            me.onSuccess(me.xhr.responseText, isconnect);\n                        }\n                        else if (/^(400|403)$/.test(me.xhr.status)) {\n                            me.onError();\n                        }\n                        else {\n                            me.disconnect();\n                        }\n                    }\n                };\n            }\n            me.xhr.send();\n        };\n        /**\n         * [send 发送消息，Method:POST]\n         * queue 为消息队列，待通道可用发送所有等待消息\n         * @param  {string} data [需要传入comet格式数据，此处只负责通讯通道，数据转换在外层处理]\n         */\n        PollingTransportation.prototype.send = function (data) {\n            var me = this;\n            var _send = me.sendxhr = this.requestFactory(RongIMLib.Navigation.Endpoint.host + \"/websocket\" + data.url + \"&pid=\" + encodeURIComponent(me.pid), \"POST\");\n            if (\"onload\" in _send) {\n                _send.onload = function () {\n                    _send.onload = me.empty;\n                    me.onData(_send.responseText);\n                };\n                _send.onerror = function () {\n                    _send.onerror = me.empty;\n                };\n            }\n            else {\n                _send.onreadystatechange = function () {\n                    if (_send.readyState == 4) {\n                        this.onreadystatechange = this.empty;\n                        if (/^(202|200)$/.test(_send.status)) {\n                            me.onData(_send.responseText);\n                        }\n                    }\n                };\n            }\n            _send.send(JSON.stringify(data.data));\n        };\n        PollingTransportation.prototype.onData = function (data, header) {\n            if (!data || data == \"lost params\") {\n                return;\n            }\n            var self = this, val = JSON.parse(data);\n            if (val.userId) {\n                RongIMLib.Navigation.Endpoint.userId = val.userId;\n            }\n            if (header) {\n                RongIMLib.RongIMClient._storageProvider.setItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId, header);\n            }\n            if (!RongIMLib.MessageUtil.isArray(val)) {\n                val = [val];\n            }\n            Array.forEach(val, function (m) {\n                self.socket.fire(\"message\", new RongIMLib.MessageInputStream(m, true).readMessage());\n            });\n            return \"\";\n        };\n        PollingTransportation.prototype.XmlHttpRequest = function () {\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest(), self = this;\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                return new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                return new XDomainRequest();\n            }\n            else {\n                return new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        };\n        PollingTransportation.prototype.onClose = function () {\n            if (this.xhr) {\n                if (this.xhr.onload) {\n                    this.xhr.onreadystatechange = this.xhr.onload = this.empty;\n                }\n                else {\n                    this.xhr.onreadystatechange = this.empty;\n                }\n                this.xhr.abort();\n                this.xhr = null;\n            }\n            if (this.sendxhr) {\n                if (this.sendxhr.onload) {\n                    this.sendxhr.onreadystatechange = this.sendxhr.onload = this.empty;\n                }\n                else {\n                    this.sendxhr.onreadystatechange = this.empty;\n                }\n                this.sendxhr.abort();\n                this.sendxhr = null;\n            }\n        };\n        PollingTransportation.prototype.disconnect = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n        };\n        PollingTransportation.prototype.reconnect = function () {\n            this.disconnect();\n            this.createTransport(this.url);\n        };\n        PollingTransportation.prototype.onSuccess = function (responseText, isconnect) {\n            var txt = responseText.match(/\"sessionid\":\"\\S+?(?=\")/);\n            this.onData(responseText, txt ? txt[0].slice(13) : 0);\n            if (/\"headerCode\":-32,/.test(responseText)) {\n                RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n                RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n                return;\n            }\n            this.getRequest(RongIMLib.Navigation.Endpoint.host + \"/pullmsg.js?sessionid=\" + RongIMLib.RongIMClient._storageProvider.getItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId) + \"&timestrap=\" + encodeURIComponent(new Date().getTime() + Math.random() + \"\"));\n            this.connected = true;\n            isconnect && this.socket.fire(\"connect\");\n        };\n        PollingTransportation.prototype.onError = function () {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"sId\" + RongIMLib.Navigation.Endpoint.userId);\n            RongIMLib.RongIMClient._storageProvider.removeItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\");\n            this.onClose();\n            this.connected = false;\n            this.socket.fire(\"disconnect\");\n        };\n        return PollingTransportation;\n    })();\n    RongIMLib.PollingTransportation = PollingTransportation;\n})(RongIMLib || (RongIMLib = {}));\n//objectname映射\nvar typeMapping = {\n    \"RC:TxtMsg\": \"TextMessage\",\n    \"RC:ImgMsg\": \"ImageMessage\",\n    \"RC:VcMsg\": \"VoiceMessage\",\n    \"RC:ImgTextMsg\": \"RichContentMessage\",\n    \"RC:FileMsg\": \"FileMessage\",\n    \"RC:LBSMsg\": \"LocationMessage\",\n    \"RC:InfoNtf\": \"InformationNotificationMessage\",\n    \"RC:ContactNtf\": \"ContactNotificationMessage\",\n    \"RC:ProfileNtf\": \"ProfileNotificationMessage\",\n    \"RC:CmdNtf\": \"CommandNotificationMessage\",\n    \"RC:DizNtf\": \"DiscussionNotificationMessage\",\n    \"RC:CmdMsg\": \"CommandMessage\",\n    \"RC:TypSts\": \"TypingStatusMessage\",\n    \"RC:CsChaR\": \"ChangeModeResponseMessage\",\n    \"RC:CsHsR\": \"HandShakeResponseMessage\",\n    \"RC:CsEnd\": \"TerminateMessage\",\n    \"RC:CsSp\": \"SuspendMessage\",\n    \"RC:CsUpdate\": \"CustomerStatusUpdateMessage\",\n    \"RC:ReadNtf\": \"ReadReceiptMessage\",\n    \"RC:VCAccept\": \"AcceptMessage\",\n    \"RC:VCRinging\": \"RingingMessage\",\n    \"RC:VCSummary\": \"SummaryMessage\",\n    \"RC:VCHangup\": \"HungupMessage\",\n    \"RC:VCInvite\": \"InviteMessage\",\n    \"RC:VCModifyMedia\": \"MediaModifyMessage\",\n    \"RC:VCModifyMem\": \"MemberModifyMessage\",\n    \"RC:CsContact\": \"CustomerContact\",\n    \"RC:PSImgTxtMsg\": \"PublicServiceRichContentMessage\",\n    \"RC:PSMultiImgTxtMsg\": \"PublicServiceMultiRichContentMessage\",\n    \"RC:GrpNtf\": \"GroupNotificationMessage\",\n    \"RC:PSCmd\": \"PublicServiceCommandMessage\",\n    \"RC:RcCmd\": \"RecallCommandMessage\",\n    \"RC:SRSMsg\": \"SyncReadStatusMessage\",\n    \"RC:RRReqMsg\": \"ReadReceiptRequestMessage\",\n    \"RC:RRRspMsg\": \"ReadReceiptResponseMessage\",\n    \"RCJrmf:RpMsg\": \"JrmfReadPacketMessage\",\n    \"RCJrmf:RpOpendMsg\": \"JrmfReadPacketOpenedMessage\",\n    \"RCE:UpdateStatus\": \"RCEUpdateStatusMessage\"\n}, \n//自定义消息类型\nregisterMessageTypeMapping = {}, HistoryMsgType = {\n    4: \"qryCMsg\",\n    2: \"qryDMsg\",\n    3: \"qryGMsg\",\n    1: \"qryPMsg\",\n    6: \"qrySMsg\",\n    7: \"qryPMsg\",\n    8: \"qryPMsg\",\n    5: \"qryCMsg\"\n}, disconnectStatus = { 1: 6 };\nvar RongIMLib;\n(function (RongIMLib) {\n    /**\n     * 通道标识类\n     */\n    var Transportations = (function () {\n        function Transportations() {\n        }\n        Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n        return Transportations;\n    })();\n    RongIMLib.Transportations = Transportations;\n    var MessageUtil = (function () {\n        function MessageUtil() {\n        }\n        /**\n         *4680000 为localstorage最小容量5200000字节的90%，超过90%将删除之前过早的存储\n         */\n        MessageUtil.checkStorageSize = function () {\n            return JSON.stringify(localStorage).length < 4680000;\n        };\n        MessageUtil.getFirstKey = function (obj) {\n            var str = \"\";\n            for (var key in obj) {\n                str = key;\n                break;\n            }\n            return str;\n        };\n        MessageUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        MessageUtil.ArrayForm = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Int8Array(typearray);\n                return [].slice.call(arr);\n            }\n            return typearray;\n        };\n        MessageUtil.ArrayFormInput = function (typearray) {\n            if (Object.prototype.toString.call(typearray) == \"[object ArrayBuffer]\") {\n                var arr = new Uint8Array(typearray);\n                return arr;\n            }\n            return typearray;\n        };\n        MessageUtil.indexOf = function (arr, item, from) {\n            for (var l = arr.length, i = (from < 0) ? Math.max(0, +from) : from || 0; i < l; i++) {\n                if (arr[i] == item) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n        MessageUtil.isArray = function (obj) {\n            return Object.prototype.toString.call(obj) == \"[object Array]\";\n        };\n        //遍历，只能遍历数组\n        MessageUtil.forEach = function (arr, func) {\n            if ([].forEach) {\n                return function (arr, func) {\n                    [].forEach.call(arr, func);\n                };\n            }\n            else {\n                return function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        MessageUtil.remove = function (array, func) {\n            for (var i = 0, len = array.length; i < len; i++) {\n                if (func(array[i])) {\n                    return array.splice(i, 1)[0];\n                }\n            }\n            return null;\n        };\n        MessageUtil.int64ToTimestamp = function (obj, isDate) {\n            if (obj.low === undefined) {\n                return obj;\n            }\n            var low = obj.low;\n            if (low < 0) {\n                low += 0xffffffff + 1;\n            }\n            low = low.toString(16);\n            var timestamp = parseInt(obj.high.toString(16) + \"00000000\".replace(new RegExp(\"0{\" + low.length + \"}$\"), low), 16);\n            if (isDate) {\n                return new Date(timestamp);\n            }\n            return timestamp;\n        };\n        //消息转换方法\n        MessageUtil.messageParser = function (entity, onReceived, offlineMsg) {\n            var message = new RongIMLib.Message(), content = entity.content, de, objectName = entity.classname, val, isUseDef = false;\n            try {\n                if (RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayForm(content.buffer).slice(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n                else {\n                    val = new RongIMLib.BinaryHelper().readUTF(content.offset ? MessageUtil.ArrayFormInput(content.buffer).subarray(content.offset, content.limit) : content);\n                    de = JSON.parse(val);\n                }\n            }\n            catch (ex) {\n                de = val;\n                isUseDef = true;\n            }\n            //映射为具体消息对象\n            if (objectName in typeMapping) {\n                var str = \"new RongIMLib.\" + typeMapping[objectName] + \"(de)\";\n                message.content = eval(str);\n                message.messageType = typeMapping[objectName];\n            }\n            else if (objectName in registerMessageTypeMapping) {\n                var str = \"new RongIMLib.RongIMClient.RegisterMessage.\" + registerMessageTypeMapping[objectName] + \"(de)\";\n                if (isUseDef) {\n                    message.content = eval(str).decode(de);\n                }\n                else {\n                    message.content = eval(str);\n                }\n                message.messageType = registerMessageTypeMapping[objectName];\n            }\n            else {\n                message.content = new RongIMLib.UnknownMessage({ content: de, objectName: objectName });\n                message.messageType = \"UnknownMessage\";\n            }\n            //根据实体对象设置message对象]\n            var dateTime = MessageUtil.int64ToTimestamp(entity.dataTime);\n            if (dateTime > 0) {\n                message.sentTime = dateTime;\n            }\n            else {\n                message.sentTime = +new Date;\n            }\n            message.senderUserId = entity.fromUserId;\n            message.conversationType = entity.type;\n            if (entity.fromUserId == RongIMLib.Bridge._client.userId) {\n                message.targetId = entity.groupId;\n            }\n            else {\n                message.targetId = (/^[234]$/.test(entity.type || entity.getType()) ? entity.groupId : message.senderUserId);\n            }\n            if (entity.direction == 1) {\n                message.messageDirection = RongIMLib.MessageDirection.SEND;\n                message.senderUserId = RongIMLib.Bridge._client.userId;\n            }\n            else {\n                if (message.senderUserId == RongIMLib.Bridge._client.userId) {\n                    message.messageDirection = RongIMLib.MessageDirection.SEND;\n                }\n                else {\n                    message.messageDirection = RongIMLib.MessageDirection.RECEIVE;\n                }\n            }\n            message.messageUId = entity.msgId;\n            message.receivedTime = new Date().getTime();\n            message.messageId = (message.conversationType + \"_\" + ~~(Math.random() * 0xffffff));\n            message.objectName = objectName;\n            message.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            if ((entity.status & 2) == 2) {\n                message.receivedStatus = RongIMLib.ReceivedStatus.RETRIEVED;\n            }\n            message.offLineMessage = offlineMsg ? true : false;\n            if (!offlineMsg) {\n                if (RongIMLib.RongIMClient._memoryStore.connectAckTime > message.sentTime) {\n                    message.offLineMessage = true;\n                }\n            }\n            return message;\n        };\n        //适配SSL\n        // static schemeArrs: Array<any> = [[\"http\", \"ws\"], [\"https\", \"wss\"]];\n        MessageUtil.sign = { converNum: 1, msgNum: 1, isMsgStart: true, isConvStart: true };\n        return MessageUtil;\n    })();\n    RongIMLib.MessageUtil = MessageUtil;\n    /**\n     * 工具类\n     */\n    var MessageIdHandler = (function () {\n        function MessageIdHandler() {\n        }\n        MessageIdHandler.init = function () {\n            this.messageId = +(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\") || RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", 0) || 0);\n        };\n        MessageIdHandler.messageIdPlus = function (method) {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            if (this.messageId >= 65535) {\n                method();\n                return false;\n            }\n            this.messageId++;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n            return this.messageId;\n        };\n        MessageIdHandler.clearMessageId = function () {\n            this.messageId = 0;\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && RongIMLib.RongIMClient._storageProvider.setItem(RongIMLib.Navigation.Endpoint.userId + \"msgId\", this.messageId);\n        };\n        MessageIdHandler.getMessageId = function () {\n            RongIMLib.RongIMClient._memoryStore.depend.isPolling && this.init();\n            return this.messageId;\n        };\n        MessageIdHandler.messageId = 0;\n        return MessageIdHandler;\n    })();\n    RongIMLib.MessageIdHandler = MessageIdHandler;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MessageContent = (function () {\n        function MessageContent(data) {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        }\n        MessageContent.obtain = function () {\n            throw new Error(\"This method is abstract, you must implement this method in inherited class.\");\n        };\n        return MessageContent;\n    })();\n    RongIMLib.MessageContent = MessageContent;\n    var NotificationMessage = (function (_super) {\n        __extends(NotificationMessage, _super);\n        function NotificationMessage() {\n            _super.apply(this, arguments);\n        }\n        return NotificationMessage;\n    })(MessageContent);\n    RongIMLib.NotificationMessage = NotificationMessage;\n    var StatusMessage = (function (_super) {\n        __extends(StatusMessage, _super);\n        function StatusMessage() {\n            _super.apply(this, arguments);\n        }\n        return StatusMessage;\n    })(MessageContent);\n    RongIMLib.StatusMessage = StatusMessage;\n    var ModelUtil = (function () {\n        function ModelUtil() {\n        }\n        ModelUtil.modelClone = function (object) {\n            var obj = {};\n            for (var item in object) {\n                if (item != \"messageName\" && \"encode\" != item) {\n                    obj[item] = object[item];\n                }\n            }\n            return obj;\n        };\n        ModelUtil.modleCreate = function (fields, msgType) {\n            if (fields.length < 1) {\n                throw new Error(\"Array is empty  -> registerMessageType.modleCreate\");\n            }\n            var Object = function (message) {\n                var me = this;\n                for (var index in fields) {\n                    if (message[fields[index]]) {\n                        me[fields[index]] = message[fields[index]];\n                    }\n                }\n                Object.prototype.messageName = msgType;\n                Object.prototype.encode = function () {\n                    return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n                };\n            };\n            return Object;\n        };\n        return ModelUtil;\n    })();\n    RongIMLib.ModelUtil = ModelUtil;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var CustomerStatusMessage = (function () {\n        function CustomerStatusMessage(message) {\n            this.messageName = \"CustomerStatusMessage\";\n            this.status = message.status;\n        }\n        CustomerStatusMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusMessage;\n    })();\n    RongIMLib.CustomerStatusMessage = CustomerStatusMessage;\n    /**\n     * 客服转换响应消息的类型名\n     */\n    var ChangeModeResponseMessage = (function () {\n        function ChangeModeResponseMessage(message) {\n            this.messageName = \"ChangeModeResponseMessage\";\n            this.code = message.code;\n            this.data = message.data;\n            this.msg = message.msg;\n        }\n        ChangeModeResponseMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeResponseMessage;\n    })();\n    RongIMLib.ChangeModeResponseMessage = ChangeModeResponseMessage;\n    /**\n     * 客服转换消息的类型名\n     * 此消息不计入未读消息数\n     */\n    var ChangeModeMessage = (function () {\n        function ChangeModeMessage(message) {\n            this.messageName = \"ChangeModeMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        ChangeModeMessage.obtain = function () {\n            return null;\n        };\n        ChangeModeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ChangeModeMessage;\n    })();\n    RongIMLib.ChangeModeMessage = ChangeModeMessage;\n    var CustomerStatusUpdateMessage = (function () {\n        function CustomerStatusUpdateMessage(message) {\n            this.messageName = \"CustomerStatusUpdateMessage\";\n            this.serviceStatus = message.serviceStatus;\n            this.sid = message.sid;\n        }\n        CustomerStatusUpdateMessage.obtain = function () {\n            return null;\n        };\n        CustomerStatusUpdateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerStatusUpdateMessage;\n    })();\n    RongIMLib.CustomerStatusUpdateMessage = CustomerStatusUpdateMessage;\n    var HandShakeMessage = (function () {\n        function HandShakeMessage(message) {\n            this.messageName = \"HandShakeMessage\";\n            message && (this.groupid = message.groupid);\n        }\n        HandShakeMessage.obtain = function () {\n            return null;\n        };\n        HandShakeMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeMessage;\n    })();\n    RongIMLib.HandShakeMessage = HandShakeMessage;\n    var CustomerContact = (function () {\n        function CustomerContact(message) {\n            this.messageName = \"CustomerContact\";\n            this.page = message.page;\n            this.nickName = message.nickName;\n            this.routingInfo = message.routingInfo;\n            this.info = message.info;\n            this.requestInfo = message.requestInfo;\n        }\n        CustomerContact.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CustomerContact;\n    })();\n    RongIMLib.CustomerContact = CustomerContact;\n    var EvaluateMessage = (function () {\n        function EvaluateMessage(message) {\n            this.messageName = \"EvaluateMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n            this.source = message.source;\n            this.suggest = message.suggest;\n            this.isresolve = message.isresolve;\n            this.type = message.type;\n        }\n        EvaluateMessage.obtain = function () {\n            return null;\n        };\n        EvaluateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return EvaluateMessage;\n    })();\n    RongIMLib.EvaluateMessage = EvaluateMessage;\n    /**\n     * 客服握手响应消息的类型名\n     */\n    var HandShakeResponseMessage = (function () {\n        function HandShakeResponseMessage(message) {\n            this.messageName = \"HandShakeResponseMessage\";\n            this.msg = message.msg;\n            this.status = message.status;\n            this.data = message.data;\n        }\n        HandShakeResponseMessage.obtain = function () {\n            return null;\n        };\n        HandShakeResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HandShakeResponseMessage;\n    })();\n    RongIMLib.HandShakeResponseMessage = HandShakeResponseMessage;\n    var SuspendMessage = (function () {\n        function SuspendMessage(message) {\n            this.messageName = \"SuspendMessage\";\n            this.uid = message.uid;\n            this.sid = message.sid;\n            this.pid = message.pid;\n        }\n        SuspendMessage.obtain = function () {\n            return null;\n        };\n        SuspendMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SuspendMessage;\n    })();\n    RongIMLib.SuspendMessage = SuspendMessage;\n    var TerminateMessage = (function () {\n        function TerminateMessage(message) {\n            this.messageName = \"TerminateMessage\";\n            this.code = message.code;\n            this.msg = message.msg;\n            this.sid = message.sid;\n        }\n        TerminateMessage.obtain = function () {\n            return null;\n        };\n        TerminateMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TerminateMessage;\n    })();\n    RongIMLib.TerminateMessage = TerminateMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var IsTypingStatusMessage = (function () {\n        function IsTypingStatusMessage(data) {\n            this.messageName = \"IsTypingStatusMessage\";\n            var msg = data;\n        }\n        IsTypingStatusMessage.prototype.encode = function () {\n            return undefined;\n        };\n        IsTypingStatusMessage.prototype.getMessage = function () {\n            return null;\n        };\n        return IsTypingStatusMessage;\n    })();\n    RongIMLib.IsTypingStatusMessage = IsTypingStatusMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var InformationNotificationMessage = (function () {\n        function InformationNotificationMessage(message) {\n            this.messageName = \"InformationNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> InformationNotificationMessage.\");\n            }\n            this.message = message.message;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        InformationNotificationMessage.obtain = function (message) {\n            return new InformationNotificationMessage({ message: message, extra: \"\" });\n        };\n        InformationNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InformationNotificationMessage;\n    })();\n    RongIMLib.InformationNotificationMessage = InformationNotificationMessage;\n    var CommandMessage = (function () {\n        function CommandMessage(message) {\n            this.messageName = \"CommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> CommandMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n        }\n        CommandMessage.obtain = function (data) {\n            return new CommandMessage({ data: data, extra: \"\" });\n        };\n        CommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandMessage;\n    })();\n    RongIMLib.CommandMessage = CommandMessage;\n    var ContactNotificationMessage = (function () {\n        function ContactNotificationMessage(message) {\n            this.messageName = \"ContactNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ContactNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            this.targetUserId = message.targetUserId;\n            this.message = message.message;\n            this.extra = message.extra;\n            this.sourceUserId = message.sourceUserId;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ContactNotificationMessage.obtain = function (operation, sourceUserId, targetUserId, message) {\n            return new InformationNotificationMessage({ operation: operation, sourceUserId: sourceUserId, targetUserId: targetUserId, message: message });\n        };\n        ContactNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        ContactNotificationMessage.CONTACT_OPERATION_ACCEPT_RESPONSE = \"ContactOperationAcceptResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REJECT_RESPONSE = \"ContactOperationRejectResponse\";\n        ContactNotificationMessage.CONTACT_OPERATION_REQUEST = \"ContactOperationRequest\";\n        return ContactNotificationMessage;\n    })();\n    RongIMLib.ContactNotificationMessage = ContactNotificationMessage;\n    var ProfileNotificationMessage = (function () {\n        function ProfileNotificationMessage(message) {\n            this.messageName = \"ProfileNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            this.operation = message.operation;\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        ProfileNotificationMessage.obtain = function (operation, data) {\n            return new ProfileNotificationMessage({ operation: operation, data: data });\n        };\n        ProfileNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ProfileNotificationMessage;\n    })();\n    RongIMLib.ProfileNotificationMessage = ProfileNotificationMessage;\n    var CommandNotificationMessage = (function () {\n        function CommandNotificationMessage(message) {\n            this.messageName = \"CommandNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ProfileNotificationMessage.\");\n            }\n            try {\n                if (Object.prototype.toString.call(message.data) == \"[object String]\") {\n                    this.data = JSON.parse(message.data);\n                }\n                else {\n                    this.data = message.data;\n                }\n            }\n            catch (e) {\n                this.data = message.data;\n            }\n            this.name = message.name;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        CommandNotificationMessage.obtain = function (name, data) {\n            return new CommandNotificationMessage({ name: name, data: data, extra: \"\" });\n        };\n        CommandNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return CommandNotificationMessage;\n    })();\n    RongIMLib.CommandNotificationMessage = CommandNotificationMessage;\n    var DiscussionNotificationMessage = (function () {\n        function DiscussionNotificationMessage(message) {\n            this.messageName = \"DiscussionNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> DiscussionNotificationMessage.\");\n            }\n            this.extra = message.extra;\n            this.extension = message.extension;\n            this.type = message.type;\n            this.isHasReceived = message.isHasReceived;\n            this.operation = message.operation;\n            this.user = message.user;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        DiscussionNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return DiscussionNotificationMessage;\n    })();\n    RongIMLib.DiscussionNotificationMessage = DiscussionNotificationMessage;\n    var GroupNotificationMessage = (function () {\n        function GroupNotificationMessage(msg) {\n            this.messageName = \"GroupNotificationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> GroupNotificationMessage.\");\n            }\n            msg.operatorUserId && (this.operatorUserId = msg.operatorUserId);\n            msg.operation && (this.operation = msg.operation);\n            msg.data && (this.data = msg.data);\n            msg.message && (this.message = msg.message);\n            msg.extra && (this.extra = msg.extra);\n        }\n        GroupNotificationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return GroupNotificationMessage;\n    })();\n    RongIMLib.GroupNotificationMessage = GroupNotificationMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var TextMessage = (function () {\n        function TextMessage(message) {\n            this.messageName = \"TextMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TextMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        TextMessage.obtain = function (text) {\n            return new TextMessage({ extra: \"\", content: text });\n        };\n        TextMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TextMessage;\n    })();\n    RongIMLib.TextMessage = TextMessage;\n    var TypingStatusMessage = (function () {\n        function TypingStatusMessage(message) {\n            this.messageName = \"TypingStatusMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> TypingStatusMessage.\");\n            }\n            this.typingContentType = message.typingContentType;\n            this.data = message.data;\n        }\n        TypingStatusMessage.obtain = function (typingContentType, data) {\n            return new TypingStatusMessage({ typingContentType: typingContentType, data: data });\n        };\n        TypingStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return TypingStatusMessage;\n    })();\n    RongIMLib.TypingStatusMessage = TypingStatusMessage;\n    var ReadReceiptMessage = (function () {\n        function ReadReceiptMessage(message) {\n            this.messageName = \"ReadReceiptMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ReadReceiptMessage.\");\n            }\n            this.lastMessageSendTime = message.lastMessageSendTime;\n            this.messageUId = message.messageUId;\n            this.type = message.type;\n        }\n        ReadReceiptMessage.obtain = function (messageUId, lastMessageSendTime, type) {\n            return new ReadReceiptMessage({ messageUId: messageUId, lastMessageSendTime: lastMessageSendTime, type: type });\n        };\n        ReadReceiptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptMessage;\n    })();\n    RongIMLib.ReadReceiptMessage = ReadReceiptMessage;\n    var VoiceMessage = (function () {\n        function VoiceMessage(message) {\n            this.messageName = \"VoiceMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> VoiceMessage.\");\n            }\n            this.content = message.content;\n            this.duration = message.duration;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        VoiceMessage.obtain = function (base64Content, duration) {\n            return new VoiceMessage({ content: base64Content, duration: duration, extra: \"\" });\n        };\n        VoiceMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return VoiceMessage;\n    })();\n    RongIMLib.VoiceMessage = VoiceMessage;\n    var RecallCommandMessage = (function () {\n        function RecallCommandMessage(message) {\n            this.messageName = \"RecallCommandMessage\";\n            this.messageUId = message.messageUId;\n            this.conversationType = message.conversationType;\n            this.targetId = message.targetId;\n            this.sentTime = message.sentTime;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        RecallCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RecallCommandMessage;\n    })();\n    RongIMLib.RecallCommandMessage = RecallCommandMessage;\n    var ImageMessage = (function () {\n        function ImageMessage(message) {\n            this.messageName = \"ImageMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> ImageMessage.\");\n            }\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        ImageMessage.obtain = function (content, imageUri) {\n            return new ImageMessage({ content: content, imageUri: imageUri, extra: \"\" });\n        };\n        ImageMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ImageMessage;\n    })();\n    RongIMLib.ImageMessage = ImageMessage;\n    var LocationMessage = (function () {\n        function LocationMessage(message) {\n            this.messageName = \"LocationMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> LocationMessage.\");\n            }\n            this.latitude = message.latitude;\n            this.longitude = message.longitude;\n            this.poi = message.poi;\n            this.content = message.content;\n            this.extra = message.extra;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        LocationMessage.obtain = function (latitude, longitude, poi, content) {\n            return new LocationMessage({ latitude: latitude, longitude: longitude, poi: poi, content: content, extra: \"\" });\n        };\n        LocationMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return LocationMessage;\n    })();\n    RongIMLib.LocationMessage = LocationMessage;\n    var RichContentMessage = (function () {\n        function RichContentMessage(message) {\n            this.messageName = \"RichContentMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> RichContentMessage.\");\n            }\n            this.title = message.title;\n            this.content = message.content;\n            this.imageUri = message.imageUri;\n            this.extra = message.extra;\n            this.url = message.url;\n            if (message.user) {\n                this.user = message.user;\n            }\n        }\n        RichContentMessage.obtain = function (title, content, imageUri, url) {\n            return new RichContentMessage({ title: title, content: content, imageUri: imageUri, url: url, extra: \"\" });\n        };\n        RichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RichContentMessage;\n    })();\n    RongIMLib.RichContentMessage = RichContentMessage;\n    var JrmfReadPacketMessage = (function () {\n        function JrmfReadPacketMessage(message) {\n            this.messageName = 'JrmfReadPacketMessage';\n            message && (this.message = message);\n        }\n        JrmfReadPacketMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfReadPacketMessage;\n    })();\n    RongIMLib.JrmfReadPacketMessage = JrmfReadPacketMessage;\n    var JrmfReadPacketOpenedMessage = (function () {\n        function JrmfReadPacketOpenedMessage(message) {\n            this.messageName = 'JrmfReadPacketOpenedMessage';\n            message && (this.message = message);\n        }\n        JrmfReadPacketOpenedMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return JrmfReadPacketOpenedMessage;\n    })();\n    RongIMLib.JrmfReadPacketOpenedMessage = JrmfReadPacketOpenedMessage;\n    var UnknownMessage = (function () {\n        function UnknownMessage(message) {\n            this.messageName = \"UnknownMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> UnknownMessage.\");\n            }\n            this.message = message;\n        }\n        UnknownMessage.prototype.encode = function () {\n            return \"\";\n        };\n        return UnknownMessage;\n    })();\n    RongIMLib.UnknownMessage = UnknownMessage;\n    var PublicServiceCommandMessage = (function () {\n        function PublicServiceCommandMessage(message) {\n            this.messageName = \"PublicServiceCommandMessage\";\n            if (arguments.length == 0) {\n                throw new Error(\"Can not instantiate with empty parameters, use obtain method instead -> PublicServiceCommandMessage.\");\n            }\n            this.content = message.content;\n            this.extra = message.extra;\n            this.menuItem = message.menuItem;\n            if (message.user) {\n                this.user = message.user;\n            }\n            if (message.mentionedInfo) {\n                this.mentionedInfo = message.mentionedInfo;\n            }\n        }\n        PublicServiceCommandMessage.obtain = function (item) {\n            return new PublicServiceCommandMessage({ content: \"\", command: \"\", menuItem: item, extra: \"\" });\n        };\n        PublicServiceCommandMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceCommandMessage;\n    })();\n    RongIMLib.PublicServiceCommandMessage = PublicServiceCommandMessage;\n    var PublicServiceMultiRichContentMessage = (function () {\n        function PublicServiceMultiRichContentMessage(messages) {\n            this.messageName = \"PublicServiceMultiRichContentMessage\";\n            this.richContentMessages = messages;\n        }\n        PublicServiceMultiRichContentMessage.prototype.encode = function () {\n            return null;\n        };\n        return PublicServiceMultiRichContentMessage;\n    })();\n    RongIMLib.PublicServiceMultiRichContentMessage = PublicServiceMultiRichContentMessage;\n    var SyncReadStatusMessage = (function () {\n        function SyncReadStatusMessage(message) {\n            this.messageName = \"SyncReadStatusMessage\";\n            message.lastMessageSendTime && (this.lastMessageSendTime = message.lastMessageSendTime);\n        }\n        SyncReadStatusMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SyncReadStatusMessage;\n    })();\n    RongIMLib.SyncReadStatusMessage = SyncReadStatusMessage;\n    var ReadReceiptRequestMessage = (function () {\n        function ReadReceiptRequestMessage(message) {\n            this.messageName = \"ReadReceiptRequestMessage\";\n            message.messageUId && (this.messageUId = message.messageUId);\n        }\n        ReadReceiptRequestMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptRequestMessage;\n    })();\n    RongIMLib.ReadReceiptRequestMessage = ReadReceiptRequestMessage;\n    var ReadReceiptResponseMessage = (function () {\n        function ReadReceiptResponseMessage(message) {\n            this.messageName = \"ReadReceiptResponseMessage\";\n            message.receiptMessageDic && (this.receiptMessageDic = message.receiptMessageDic);\n        }\n        ReadReceiptResponseMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return ReadReceiptResponseMessage;\n    })();\n    RongIMLib.ReadReceiptResponseMessage = ReadReceiptResponseMessage;\n    var PublicServiceRichContentMessage = (function () {\n        function PublicServiceRichContentMessage(message) {\n            this.messageName = \"PublicServiceRichContentMessage\";\n            this.richContentMessage = message;\n        }\n        PublicServiceRichContentMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return PublicServiceRichContentMessage;\n    })();\n    RongIMLib.PublicServiceRichContentMessage = PublicServiceRichContentMessage;\n    var FileMessage = (function () {\n        function FileMessage(message) {\n            this.messageName = \"FileMessage\";\n            message.name && (this.name = message.name);\n            message.size && (this.size = message.size);\n            message.type && (this.type = message.type);\n            message.fileUrl && (this.fileUrl = message.fileUrl);\n            message.extra && (this.extra = message.extra);\n            message.user && (this.user = message.user);\n        }\n        FileMessage.obtain = function (msg) {\n            return new FileMessage({ name: msg.name, size: msg.size, type: msg.type, fileUrl: msg.fileUrl });\n        };\n        FileMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return FileMessage;\n    })();\n    RongIMLib.FileMessage = FileMessage;\n    var AcceptMessage = (function () {\n        function AcceptMessage(message) {\n            this.messageName = \"AcceptMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        AcceptMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return AcceptMessage;\n    })();\n    RongIMLib.AcceptMessage = AcceptMessage;\n    var RingingMessage = (function () {\n        function RingingMessage(message) {\n            this.messageName = \"RingingMessage\";\n            this.callId = message.callId;\n        }\n        RingingMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return RingingMessage;\n    })();\n    RongIMLib.RingingMessage = RingingMessage;\n    var SummaryMessage = (function () {\n        function SummaryMessage(message) {\n            this.messageName = \"SummaryMessage\";\n            this.caller = message.caller;\n            this.inviter = message.inviter;\n            this.mediaType = message.mediaType;\n            this.memberIdList = message.memberIdList;\n            this.startTime = message.startTime;\n            this.connectedTime = message.connectedTime;\n            this.duration = message.duration;\n            this.status = message.status;\n        }\n        SummaryMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return SummaryMessage;\n    })();\n    RongIMLib.SummaryMessage = SummaryMessage;\n    var HungupMessage = (function () {\n        function HungupMessage(message) {\n            this.messageName = \"HungupMessage\";\n            this.callId = message.callId;\n            this.reason = message.reason;\n        }\n        HungupMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return HungupMessage;\n    })();\n    RongIMLib.HungupMessage = HungupMessage;\n    var InviteMessage = (function () {\n        function InviteMessage(message) {\n            this.messageName = \"InviteMessage\";\n            this.callId = message.callId;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n        }\n        InviteMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return InviteMessage;\n    })();\n    RongIMLib.InviteMessage = InviteMessage;\n    var MediaModifyMessage = (function () {\n        function MediaModifyMessage(message) {\n            this.messageName = \"MediaModifyMessage\";\n            this.callId = message.callId;\n            this.mediaType = message.mediaType;\n        }\n        MediaModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MediaModifyMessage;\n    })();\n    RongIMLib.MediaModifyMessage = MediaModifyMessage;\n    var MemberModifyMessage = (function () {\n        function MemberModifyMessage(message) {\n            this.messageName = \"MemberModifyMessage\";\n            this.modifyMemType = message.modifyMemType;\n            this.callId = message.callId;\n            this.caller = message.caller;\n            this.engineType = message.engineType;\n            this.channelInfo = message.channelInfo;\n            this.mediaType = message.mediaType;\n            this.extra = message.extra;\n            this.inviteUserIds = message.inviteUserIds;\n            this.existedMemberStatusList = message.existedMemberStatusList;\n        }\n        MemberModifyMessage.prototype.encode = function () {\n            return JSON.stringify(RongIMLib.ModelUtil.modelClone(this));\n        };\n        return MemberModifyMessage;\n    })();\n    RongIMLib.MemberModifyMessage = MemberModifyMessage;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ChannelInfo = (function () {\n        function ChannelInfo(Id, Key) {\n            this.Id = Id;\n            this.Key = Key;\n        }\n        return ChannelInfo;\n    })();\n    RongIMLib.ChannelInfo = ChannelInfo;\n    var UserStatus = (function () {\n        function UserStatus(platform, online, status) {\n            this.platform = platform;\n            this.online = online;\n            this.status = status;\n        }\n        return UserStatus;\n    })();\n    RongIMLib.UserStatus = UserStatus;\n    var MentionedInfo = (function () {\n        function MentionedInfo(type, userIdList, mentionedContent) {\n        }\n        return MentionedInfo;\n    })();\n    RongIMLib.MentionedInfo = MentionedInfo;\n    var DeleteMessage = (function () {\n        function DeleteMessage(msgId, msgDataTime, direct) {\n            this.msgId = msgId;\n            this.msgDataTime = msgDataTime;\n            this.direct = direct;\n        }\n        return DeleteMessage;\n    })();\n    RongIMLib.DeleteMessage = DeleteMessage;\n    var CustomServiceConfig = (function () {\n        function CustomServiceConfig(isBlack, companyName, companyUrl) {\n        }\n        return CustomServiceConfig;\n    })();\n    RongIMLib.CustomServiceConfig = CustomServiceConfig;\n    var CustomServiceSession = (function () {\n        function CustomServiceSession(uid, cid, pid, isQuited, type, adminHelloWord, adminOfflineWord) {\n        }\n        return CustomServiceSession;\n    })();\n    RongIMLib.CustomServiceSession = CustomServiceSession;\n    var Conversation = (function () {\n        function Conversation(conversationTitle, conversationType, draft, isTop, latestMessage, latestMessageId, notificationStatus, objectName, receivedStatus, receivedTime, senderUserId, senderUserName, sentStatus, sentTime, targetId, unreadMessageCount, senderPortraitUri, isHidden, mentionedMsg, hasUnreadMention) {\n            this.conversationTitle = conversationTitle;\n            this.conversationType = conversationType;\n            this.draft = draft;\n            this.isTop = isTop;\n            this.latestMessage = latestMessage;\n            this.latestMessageId = latestMessageId;\n            this.notificationStatus = notificationStatus;\n            this.objectName = objectName;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.senderUserName = senderUserName;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.unreadMessageCount = unreadMessageCount;\n            this.senderPortraitUri = senderPortraitUri;\n            this.isHidden = isHidden;\n            this.mentionedMsg = mentionedMsg;\n            this.hasUnreadMention = hasUnreadMention;\n        }\n        Conversation.prototype.setTop = function () {\n            RongIMLib.RongIMClient._dataAccessProvider.addConversation(this, { onSuccess: function (data) { } });\n        };\n        return Conversation;\n    })();\n    RongIMLib.Conversation = Conversation;\n    var Discussion = (function () {\n        function Discussion(creatorId, id, memberIdList, name, isOpen) {\n            this.creatorId = creatorId;\n            this.id = id;\n            this.memberIdList = memberIdList;\n            this.name = name;\n            this.isOpen = isOpen;\n        }\n        return Discussion;\n    })();\n    RongIMLib.Discussion = Discussion;\n    var Group = (function () {\n        function Group(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return Group;\n    })();\n    RongIMLib.Group = Group;\n    var Message = (function () {\n        function Message(content, conversationType, extra, objectName, messageDirection, messageId, receivedStatus, receivedTime, senderUserId, sentStatus, sentTime, targetId, messageType, messageUId, isLocalMessage, offLineMessage, receiptResponse) {\n            this.content = content;\n            this.conversationType = conversationType;\n            this.extra = extra;\n            this.objectName = objectName;\n            this.messageDirection = messageDirection;\n            this.messageId = messageId;\n            this.receivedStatus = receivedStatus;\n            this.receivedTime = receivedTime;\n            this.senderUserId = senderUserId;\n            this.sentStatus = sentStatus;\n            this.sentTime = sentTime;\n            this.targetId = targetId;\n            this.messageType = messageType;\n            this.messageUId = messageUId;\n            this.isLocalMessage = isLocalMessage;\n            this.offLineMessage = offLineMessage;\n            this.receiptResponse = receiptResponse;\n        }\n        return Message;\n    })();\n    RongIMLib.Message = Message;\n    var MessageTag = (function () {\n        function MessageTag(isCounted, isPersited) {\n            this.isCounted = isCounted;\n            this.isPersited = isPersited;\n        }\n        MessageTag.prototype.getMessageTag = function () {\n            if (this.isCounted && this.isPersited) {\n                return 3;\n            }\n            else if (this.isCounted) {\n                return 2;\n            }\n            else if (this.isPersited) {\n                return 1;\n            }\n            else if (!this.isCounted && !this.isPersited) {\n                return 0;\n            }\n        };\n        return MessageTag;\n    })();\n    RongIMLib.MessageTag = MessageTag;\n    var PublicServiceMenuItem = (function () {\n        function PublicServiceMenuItem(id, name, type, sunMenuItems, url) {\n            this.id = id;\n            this.name = name;\n            this.type = type;\n            this.sunMenuItems = sunMenuItems;\n            this.url = url;\n        }\n        return PublicServiceMenuItem;\n    })();\n    RongIMLib.PublicServiceMenuItem = PublicServiceMenuItem;\n    // TODO: TBD\n    var PublicServiceProfile = (function () {\n        function PublicServiceProfile(conversationType, introduction, menu, name, portraitUri, publicServiceId, hasFollowed, isGlobal) {\n            this.conversationType = conversationType;\n            this.introduction = introduction;\n            this.menu = menu;\n            this.name = name;\n            this.portraitUri = portraitUri;\n            this.publicServiceId = publicServiceId;\n            this.hasFollowed = hasFollowed;\n            this.isGlobal = isGlobal;\n        }\n        return PublicServiceProfile;\n    })();\n    RongIMLib.PublicServiceProfile = PublicServiceProfile;\n    var UserInfo = (function () {\n        function UserInfo(id, name, portraitUri) {\n            this.id = id;\n            this.name = name;\n            this.portraitUri = portraitUri;\n        }\n        return UserInfo;\n    })();\n    RongIMLib.UserInfo = UserInfo;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var ServerDataProvider = (function () {\n        function ServerDataProvider() {\n        }\n        ServerDataProvider.prototype.init = function (appKey, callback) {\n            new RongIMLib.FeatureDectector(callback);\n        };\n        ServerDataProvider.prototype.connect = function (token, callback) {\n            RongIMLib.RongIMClient.bridge = RongIMLib.Bridge.getInstance();\n            RongIMLib.RongIMClient._memoryStore.token = token;\n            RongIMLib.RongIMClient._memoryStore.callback = callback;\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus == RongIMLib.ConnectionStatus.CONNECTING) {\n                return;\n            }\n            //循环设置监听事件，追加之后清空存放事件数据\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.listenerList.length; i < len; i++) {\n                RongIMLib.RongIMClient.bridge[\"setListener\"](RongIMLib.RongIMClient._memoryStore.listenerList[i]);\n            }\n            RongIMLib.RongIMClient._memoryStore.listenerList.length = 0;\n            RongIMLib.RongIMClient.bridge.connect(RongIMLib.RongIMClient._memoryStore.appKey, token, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (e) {\n                    if (e == RongIMLib.ConnectionState.TOKEN_INCORRECT || !e) {\n                        setTimeout(function () {\n                            callback.onTokenIncorrect();\n                        });\n                    }\n                    else {\n                        setTimeout(function () {\n                            callback.onError(e);\n                        });\n                    }\n                }\n            });\n        };\n        /*\n            config.auto: 默认 false, true 启用自动重连，启用则为必选参数\n            config.rate: 重试频率 [100, 1000, 3000, 6000, 10000, 18000] 单位为毫秒，可选\n            config.url: 网络嗅探地址 [http(s)://]cdn.ronghub.com/RongIMLib-2.2.6.min.js 可选\n        */\n        ServerDataProvider.prototype.reconnect = function (callback, config) {\n            var store = RongIMLib.RongIMClient._memoryStore;\n            var token = store.token;\n            if (!token) {\n                throw new Error('reconnect: token is empty.');\n            }\n            if (RongIMLib.Bridge._client && RongIMLib.Bridge._client.channel && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTED && RongIMLib.Bridge._client.channel.connectionStatus != RongIMLib.ConnectionStatus.CONNECTING) {\n                config = config || {};\n                var key = config.auto ? 'auto' : 'custom';\n                var handler = {\n                    auto: function () {\n                        var repeatConnect = function (options) {\n                            var step = options.step();\n                            var done = 'done';\n                            var url = options.url;\n                            var ping = function () {\n                                RongIMLib.RongUtil.request({\n                                    url: url,\n                                    success: function () {\n                                        options.done();\n                                    },\n                                    error: function () {\n                                        repeat();\n                                    }\n                                });\n                            };\n                            var repeat = function () {\n                                var next = step();\n                                if (next == 'done') {\n                                    var error = RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE;\n                                    options.done(error);\n                                    return;\n                                }\n                                setTimeout(ping, next);\n                            };\n                            repeat();\n                        };\n                        var protocol = RongIMLib.RongIMClient._memoryStore.depend.protocol;\n                        var url = config.url || 'cdn.ronghub.com/RongIMLib-2.2.6.min.js';\n                        var pathConfig = {\n                            protocol: protocol,\n                            path: url\n                        };\n                        url = RongIMLib.RongUtil.formatProtoclPath(pathConfig);\n                        var rate = config.rate || [100, 1000, 3000, 6000, 10000, 18000];\n                        //结束标识\n                        rate.push('done');\n                        var opts = {\n                            url: url,\n                            step: function () {\n                                var index = 0;\n                                return function () {\n                                    var time = rate[index];\n                                    index++;\n                                    return time;\n                                };\n                            },\n                            done: function (error) {\n                                if (error) {\n                                    callback.onError(error);\n                                    return;\n                                }\n                                RongIMLib.RongIMClient.connect(token, callback);\n                            }\n                        };\n                        repeatConnect(opts);\n                    },\n                    custom: function () {\n                        RongIMLib.RongIMClient.connect(token, callback);\n                    }\n                };\n                handler[key]();\n            }\n        };\n        ServerDataProvider.prototype.logout = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n            RongIMLib.RongIMClient.bridge = null;\n        };\n        ServerDataProvider.prototype.disconnect = function () {\n            RongIMLib.RongIMClient.bridge.disconnect();\n        };\n        ServerDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) {\n            var rspkey = RongIMLib.Bridge._client.userId + conversationType + targetId + 'RECEIVED', me = this;\n            if (RongIMLib.RongUtil.supportLocalStorage()) {\n                var valObj = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(rspkey));\n                if (valObj) {\n                    var vals = [];\n                    for (var key in valObj) {\n                        var tmp = {};\n                        tmp[key] = valObj[key].uIds;\n                        valObj[key].isResponse || vals.push(tmp);\n                    }\n                    if (vals.length == 0) {\n                        sendCallback.onSuccess();\n                        return;\n                    }\n                    var interval = setInterval(function () {\n                        if (vals.length == 1) {\n                            clearInterval(interval);\n                        }\n                        var obj = vals.splice(0, 1)[0];\n                        var rspMsg = new RongIMLib.ReadReceiptResponseMessage({ receiptMessageDic: obj });\n                        me.sendMessage(conversationType, targetId, rspMsg, {\n                            onSuccess: function (msg) {\n                                var senderUserId = RongIMLib.MessageUtil.getFirstKey(obj);\n                                valObj[senderUserId].isResponse = true;\n                                RongIMLib.RongIMClient._storageProvider.setItem(rspkey, JSON.stringify(valObj));\n                                sendCallback.onSuccess(msg);\n                            },\n                            onError: function (error, msg) {\n                                sendCallback.onError(error, msg);\n                            }\n                        });\n                    }, 200);\n                }\n                else {\n                    sendCallback.onSuccess();\n                }\n            }\n            else {\n                sendCallback.onSuccess();\n            }\n        };\n        ServerDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        ServerDataProvider.prototype.sendRecallMessage = function (content, sendMessageCallback) {\n            var msg = new RongIMLib.RecallCommandMessage({ conversationType: content.conversationType, targetId: content.targetId, sentTime: content.sentTime, messageUId: content.messageUId, extra: content.extra, user: content.user });\n            this.sendMessage(content.conversationType, content.senderUserId, msg, sendMessageCallback, false, null, null, 2);\n        };\n        ServerDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        ServerDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            if (count <= 1) {\n                throw new Error(\"the count must be greater than 1.\");\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMessageInput(), self = this;\n            modules.setTargetId(targetId);\n            if (timestamp === 0 || timestamp > 0) {\n                modules.setDataTime(timestamp);\n            }\n            else {\n                modules.setDataTime(RongIMLib.RongIMClient._memoryStore.lastReadTime.get(conversationType + targetId));\n            }\n            modules.setSize(count);\n            RongIMLib.RongIMClient.bridge.queryMsg(HistoryMsgType[conversationType], RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), targetId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set(conversationType + targetId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse(), tempMsg = null, tempDir;\n                    var read = RongIMLib.SentStatus.READ;\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempDir = JSON.parse(RongIMLib.RongIMClient._storageProvider.getItem(RongIMLib.Bridge._client.userId + tempMsg.messageUId + \"SENT\"));\n                            if (tempDir) {\n                                tempMsg.receiptResponse || (tempMsg.receiptResponse = {});\n                                tempMsg.receiptResponse[tempMsg.messageUId] = tempDir.count;\n                            }\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    else {\n                        for (var i = 0, len = list.length; i < len; i++) {\n                            var tempMsg = RongIMLib.MessageUtil.messageParser(list[i]);\n                            tempMsg.sentStatus = read;\n                            list[i] = tempMsg;\n                        }\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"HistoryMessagesOuput\");\n        };\n        ServerDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            var xss = null;\n            window.RCCallback = function (x) {\n                setTimeout(function () { callback.onSuccess(!!+x.status); });\n                xss.parentNode.removeChild(xss);\n            };\n            xss = document.createElement(\"script\");\n            xss.src = RongIMLib.RongIMClient._memoryStore.depend.api + \"/message/exist.js?appKey=\" + encodeURIComponent(RongIMLib.RongIMClient._memoryStore.appKey) + \"&token=\" + encodeURIComponent(token) + \"&callBack=RCCallback&_=\" + Date.now();\n            document.body.appendChild(xss);\n            xss.onerror = function () {\n                setTimeout(function () { callback.onError(RongIMLib.ErrorCode.UNKNOWN); });\n                xss.parentNode.removeChild(xss);\n            };\n        };\n        ServerDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RelationsInput(), self = this;\n            modules.setType(1);\n            if (typeof count == 'undefined') {\n                modules.setCount(0);\n            }\n            else {\n                modules.setCount(count);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(26, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (list) {\n                    if (list.info) {\n                        list.info = list.info.reverse();\n                        for (var i = 0, len = list.info.length; i < len; i++) {\n                            RongIMLib.RongIMClient.getInstance().pottingConversation(list.info[i]);\n                        }\n                    }\n                    if (conversationTypes) {\n                        var convers = [];\n                        Array.forEach(conversationTypes, function (converType) {\n                            Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                                if (item.conversationType == converType) {\n                                    convers.push(item);\n                                }\n                            });\n                        });\n                        callback.onSuccess(convers);\n                    }\n                    else {\n                        callback.onSuccess(RongIMLib.RongIMClient._memoryStore.conversationList);\n                    }\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            }, \"RelationsOutput\");\n        };\n        ServerDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInvitationInput();\n            modules.setUsers(userIdList);\n            RongIMLib.RongIMClient.bridge.queryMsg(0, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        ServerDataProvider.prototype.createDiscussion = function (name, userIdList, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.CreateDiscussionInput(), self = this;\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(1, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (discussId) {\n                    if (userIdList.length > 0) {\n                        self.addMemberToDiscussion(discussId, userIdList, {\n                            onSuccess: function () { },\n                            onError: function (error) {\n                                setTimeout(function () {\n                                    callback.onError(error);\n                                });\n                            }\n                        });\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(discussId);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"CreateDiscussionOutput\");\n        };\n        ServerDataProvider.prototype.getDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelInfoInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(4, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errorCode) {\n                    setTimeout(function () {\n                        callback.onError(errorCode);\n                    });\n                }\n            }, \"ChannelInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitDiscussion = function (discussionId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.LeaveChannelInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(7, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, callback);\n        };\n        ServerDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ChannelEvictionInput();\n            modules.setUser(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(9, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, callback);\n        };\n        ServerDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.ModifyPermissionInput();\n            modules.setOpenStatus(status.valueOf());\n            RongIMLib.RongIMClient.bridge.queryMsg(11, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function (x) {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RenameChannelInput();\n            modules.setName(name);\n            RongIMLib.RongIMClient.bridge.queryMsg(12, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), discussionId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            });\n        };\n        ServerDataProvider.prototype.joinChatRoom = function (chatroomId, messageCount, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.Bridge._client.chatroomId = chatroomId;\n            RongIMLib.RongIMClient.bridge.queryMsg(19, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    callback.onSuccess();\n                    var modules = new RongIMLib.RongIMClient.Protobuf.ChrmPullMsg();\n                    messageCount == 0 && (messageCount = -1);\n                    modules.setCount(messageCount);\n                    modules.setSyncTime(0);\n                    RongIMLib.Bridge._client.queryMessage(\"chrmPull\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatroomId, 1, {\n                        onSuccess: function (collection) {\n                            var sync = RongIMLib.MessageUtil.int64ToTimestamp(collection.syncTime);\n                            RongIMLib.RongIMClient._memoryStore.lastReadTime.set(chatroomId + RongIMLib.Bridge._client.userId + \"CST\", sync);\n                            var list = collection.list;\n                            if (RongIMLib.RongIMClient._memoryStore.filterMessages.length > 0) {\n                                for (var i = 0, mlen = list.length; i < mlen; i++) {\n                                    for (var j = 0, flen = RongIMLib.RongIMClient._memoryStore.filterMessages.length; j < flen; j++) {\n                                        if (RongIMLib.RongIMClient.MessageParams[RongIMLib.RongIMClient._memoryStore.filterMessages[j]].objectName != list[i].classname) {\n                                            RongIMLib.Bridge._client.handler.onReceived(list[i]);\n                                        }\n                                    }\n                                }\n                            }\n                            else {\n                                for (var i = 0, len = list.length; i < len; i++) {\n                                    RongIMLib.Bridge._client.handler.onReceived(list[i]);\n                                }\n                            }\n                        },\n                        onError: function (x) {\n                            setTimeout(function () {\n                                callback.onError(RongIMLib.ErrorCode.CHATROOM_HISMESSAGE_ERROR);\n                            });\n                        }\n                    }, \"DownStreamMessages\");\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryChatroomInfoInput();\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(\"queryChrmI\", RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), chatRoomId, {\n                onSuccess: function (ret) {\n                    var userInfos = ret.userInfos;\n                    userInfos.forEach(function (item) {\n                        item.time = RongIMLib.MessageUtil.int64ToTimestamp(item.time);\n                    });\n                    setTimeout(function () {\n                        callback.onSuccess(ret);\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            }, \"QueryChatroomInfoOutput\");\n        };\n        ServerDataProvider.prototype.quitChatRoom = function (chatroomId, callback) {\n            var e = new RongIMLib.RongIMClient.Protobuf.ChrmInput();\n            e.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(17, RongIMLib.MessageUtil.ArrayForm(e.toArrayBuffer()), chatroomId, {\n                onSuccess: function () {\n                    setTimeout(function () {\n                        callback.onSuccess();\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            }, \"ChrmOutput\");\n        };\n        ServerDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n            RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, timestamp);\n        };\n        ServerDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.HistoryMsgInput();\n            modules.setTargetId(chatRoomId);\n            var timestamp = RongIMLib.RongIMClient._memoryStore.lastReadTime.get('chrhis_' + chatRoomId) || 0;\n            modules.setTime(timestamp);\n            modules.setCount(count);\n            modules.setOrder(order);\n            RongIMLib.RongIMClient.bridge.queryMsg(34, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    RongIMLib.RongIMClient._memoryStore.lastReadTime.set('chrhis_' + chatRoomId, RongIMLib.MessageUtil.int64ToTimestamp(data.syncTime));\n                    var list = data.list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        list[i] = RongIMLib.MessageUtil.messageParser(list[i]);\n                    }\n                    setTimeout(function () {\n                        callback.onSuccess(list, !!data.hasMsg);\n                    });\n                },\n                onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            }, \"HistoryMsgOuput\");\n        };\n        ServerDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.Add2BlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(21, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    callback.onSuccess();\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getBlacklist = function (callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.QueryBlackListInput();\n            modules.setNothing(1);\n            RongIMLib.RongIMClient.bridge.queryMsg(23, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, callback, \"QueryBlackListOutput\");\n        };\n        ServerDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlackListStatusInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(24, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    setTimeout(function () {\n                        callback.onSuccess(RongIMLib.BlacklistStatus[status]);\n                    });\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            var modules = new RongIMLib.RongIMClient.Protobuf.RemoveFromBlackListInput();\n            modules.setUserId(userId);\n            RongIMLib.RongIMClient.bridge.queryMsg(22, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function () {\n                    callback.onSuccess();\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getFileToken = function (fileType, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNupTokenInput();\n            modules.setType(fileType);\n            RongIMLib.RongIMClient.bridge.queryMsg(30, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            }, \"GetQNupTokenOutput\");\n        };\n        ServerDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            if (!(/(1|2|3|4)/.test(fileType.toString()))) {\n                setTimeout(function () {\n                    callback.onError(RongIMLib.ErrorCode.QNTKN_FILETYPE_ERROR);\n                });\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.GetQNdownloadUrlInput();\n            modules.setType(fileType);\n            modules.setKey(fileName);\n            if (oriName) {\n                modules.setFileName(oriName);\n            }\n            RongIMLib.RongIMClient.bridge.queryMsg(31, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), RongIMLib.Bridge._client.userId, {\n                onSuccess: function (data) {\n                    setTimeout(function () {\n                        callback.onSuccess(data);\n                    });\n                },\n                onError: function (errcode) {\n                    callback.onError(errcode);\n                }\n            }, \"GetQNdownloadUrlOutput\");\n        };\n        /*\n            methodType 1 : 多客服(客服后台使用);   2 : 消息撤回\n            params.userIds : 定向消息接收者\n        */\n        ServerDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            if (!RongIMLib.Bridge._client.channel) {\n                sendCallback.onError(RongIMLib.ErrorCode.RC_NET_UNAVAILABLE, null);\n                return;\n            }\n            if (!RongIMLib.Bridge._client.channel.socket.socket.connected) {\n                sendCallback.onError(RongIMLib.ErrorCode.TIMEOUT, null);\n                throw new Error(\"connect is timeout! postion:sendMessage\");\n            }\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            var modules = new RongIMLib.RongIMClient.Protobuf.UpStreamMessage();\n            if (mentiondMsg && isGroup) {\n                modules.setSessionId(7);\n            }\n            else {\n                modules.setSessionId(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag());\n            }\n            pushText && modules.setPushText(pushText);\n            appData && modules.setAppData(appData);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    modules.setUserId(ids);\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                modules.setUserId(RongIMLib.Bridge._client.userId);\n            }\n            params = params || {};\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                modules.setUserId(userIds);\n            }\n            modules.setClassname(RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName);\n            modules.setContent(messageContent.encode());\n            var content = modules.toArrayBuffer();\n            if (Object.prototype.toString.call(content) == \"[object ArrayBuffer]\") {\n                content = [].slice.call(new Int8Array(content));\n            }\n            var c = null, me = this, msg = new RongIMLib.Message();\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    c = conver;\n                    if (RongIMLib.RongIMClient.MessageParams[messageContent.messageName].msgTag.getMessageTag() == 3) {\n                        if (!c) {\n                            c = RongIMLib.RongIMClient.getInstance().createConversation(conversationType, targetId, \"\");\n                        }\n                        c.sentTime = new Date().getTime();\n                        c.sentStatus = RongIMLib.SentStatus.SENDING;\n                        c.senderUserName = \"\";\n                        c.senderUserId = RongIMLib.Bridge._client.userId;\n                        c.notificationStatus = RongIMLib.ConversationNotificationStatus.DO_NOT_DISTURB;\n                        c.latestMessage = msg;\n                        c.unreadMessageCount = 0;\n                        RongIMLib.RongIMClient._dataAccessProvider.addConversation(c, { onSuccess: function (data) { } });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.converStore = c;\n                }\n            });\n            msg.content = messageContent;\n            msg.conversationType = conversationType;\n            msg.senderUserId = RongIMLib.Bridge._client.userId;\n            msg.objectName = RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName;\n            msg.targetId = targetId;\n            msg.sentTime = new Date().getTime();\n            msg.messageDirection = RongIMLib.MessageDirection.SEND;\n            msg.sentStatus = RongIMLib.SentStatus.SENT;\n            msg.messageType = messageContent.messageName;\n            RongIMLib.RongIMClient.bridge.pubMsg(conversationType.valueOf(), content, targetId, {\n                onSuccess: function (data) {\n                    if (data && data.timestamp) {\n                        RongIMLib.RongIMClient._memoryStore.lastReadTime.set('converST_' + RongIMLib.Bridge._client.userId + conversationType + targetId, data.timestamp);\n                    }\n                    if ((conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP) && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptRequestMessage\"]) {\n                        var reqMsg = msg.content;\n                        var sentkey = RongIMLib.Bridge._client.userId + reqMsg.messageUId + \"SENT\";\n                        RongIMLib.RongIMClient._storageProvider.setItem(sentkey, JSON.stringify({ count: 0, dealtime: data.timestamp, userIds: {} }));\n                    }\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        var cacheConversation = RongIMLib.RongIMClient._memoryStore.converStore;\n                        cacheConversation.sentStatus = msg.sentStatus;\n                        cacheConversation.latestMessage = msg;\n                        me.updateConversation(cacheConversation);\n                        RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                            onSuccess: function (ret) {\n                                msg = ret;\n                                msg.messageUId = data.messageUId;\n                                msg.sentTime = data.timestamp;\n                                msg.sentStatus = RongIMLib.SentStatus.SENT;\n                                msg.messageId = data.messageId;\n                                RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                            },\n                            onError: function () { }\n                        });\n                    }\n                    setTimeout(function () {\n                        cacheConversation && me.updateConversation(cacheConversation);\n                        msg.sentTime = data.timestamp;\n                        sendCallback.onSuccess(msg);\n                    });\n                },\n                onError: function (errorCode) {\n                    msg.sentStatus = RongIMLib.SentStatus.FAILED;\n                    if (RongIMLib.RongIMClient.MessageParams[msg.messageType].msgTag.getMessageTag() == 3) {\n                        RongIMLib.RongIMClient._memoryStore.converStore.latestMessage = msg;\n                    }\n                    RongIMLib.RongIMClient._dataAccessProvider.addMessage(conversationType, targetId, msg, {\n                        onSuccess: function (ret) {\n                            msg.messageId = ret.messageId;\n                            RongIMLib.RongIMClient._dataAccessProvider.updateMessage(msg);\n                        },\n                        onError: function () { }\n                    });\n                    setTimeout(function () {\n                        sendCallback.onError(errorCode, msg);\n                    });\n                }\n            }, null, methodType);\n            sendCallback.onBefore && sendCallback.onBefore(RongIMLib.MessageIdHandler.messageId);\n            msg.messageId = RongIMLib.MessageIdHandler.messageId + \"\";\n        };\n        ServerDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            if (RongIMLib.RongIMClient.bridge) {\n                RongIMLib.RongIMClient.bridge.setListener(listener);\n            }\n            else {\n                RongIMLib.RongIMClient._memoryStore.listenerList.push(listener);\n            }\n        };\n        ServerDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent) {\n            if (!messageType) {\n                throw new Error(\"messageType can't be empty,postion -> registerMessageType\");\n            }\n            if (!objectName) {\n                throw new Error(\"objectName can't be empty,postion -> registerMessageType\");\n            }\n            if (Object.prototype.toString.call(messageContent) == \"[object Array]\") {\n                var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n                RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            }\n            else if (Object.prototype.toString.call(messageContent) == \"[object Function]\" || Object.prototype.toString.call(messageContent) == \"[object Object]\") {\n                if (!messageContent.encode) {\n                    throw new Error(\"encode method has not realized or messageName is undefined-> registerMessageType\");\n                }\n                if (!messageContent.decode) {\n                    throw new Error(\"decode method has not realized -> registerMessageType\");\n                }\n            }\n            else {\n                throw new Error(\"The index of 3 parameter was wrong type  must be object or function or array-> registerMessageType\");\n            }\n            registerMessageTypeMapping[objectName] = messageType;\n        };\n        ServerDataProvider.prototype.addConversation = function (conversation, callback) {\n            var isAdd = true;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType === conversation.conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId === conversation.targetId) {\n                    RongIMLib.RongIMClient._memoryStore.conversationList.unshift(RongIMLib.RongIMClient._memoryStore.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                RongIMLib.RongIMClient._memoryStore.conversationList.unshift(conversation);\n            }\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateConversation = function (conversation) {\n            var conver;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                var item = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                if (conversation.conversationType === item.conversationType && conversation.targetId === item.targetId) {\n                    conversation.conversationTitle && (item.conversationTitle = conversation.conversationTitle);\n                    conversation.senderUserName && (item.senderUserName = conversation.senderUserName);\n                    conversation.senderPortraitUri && (item.senderPortraitUri = conversation.senderPortraitUri);\n                    conversation.latestMessage && (item.latestMessage = conversation.latestMessage);\n                    conversation.sentStatus && (item.sentStatus = conversation.sentStatus);\n                    break;\n                }\n            }\n            return conver;\n        };\n        ServerDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            var mod = new RongIMLib.RongIMClient.Protobuf.RelationsInput();\n            mod.setType(conversationType);\n            RongIMLib.RongIMClient.bridge.queryMsg(27, RongIMLib.MessageUtil.ArrayForm(mod.toArrayBuffer()), targetId, {\n                onSuccess: function () {\n                    var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                    var len = conversations.length;\n                    for (var i = 0; i < len; i++) {\n                        if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                            conversations.splice(i, 1);\n                            break;\n                        }\n                    }\n                    callback.onSuccess(true);\n                }, onError: function (error) {\n                    setTimeout(function () {\n                        callback.onError(error);\n                    });\n                }\n            });\n        };\n        ServerDataProvider.prototype.getMessage = function (messageId, callback) {\n            callback.onSuccess(new RongIMLib.Message());\n        };\n        ServerDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.removeMessage = function (conversationType, targetId, messageIds, callback) {\n            RongIMLib.RongIMClient.getInstance().deleteRemoteMessages(conversationType, targetId, messageIds, callback);\n        };\n        ServerDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessage = function (message, callback) {\n            if (callback) {\n                callback.onSuccess(message);\n            }\n        };\n        ServerDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) {\n            var me = this;\n            if (key == \"readStatus\") {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList.length > 0) {\n                    me.getConversationList({\n                        onSuccess: function (list) {\n                            Array.forEach(list, function (conver) {\n                                if (conver.conversationType == conversationType && conver.targetId == targetId) {\n                                    conver.unreadMessageCount = 0;\n                                }\n                            });\n                        },\n                        onError: function (errorCode) {\n                            callback.onError(errorCode);\n                        }\n                    }, null);\n                }\n            }\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            var conver = null;\n            for (var i = 0, len = RongIMLib.RongIMClient._memoryStore.conversationList.length; i < len; i++) {\n                if (RongIMLib.RongIMClient._memoryStore.conversationList[i].conversationType == conversationType && RongIMLib.RongIMClient._memoryStore.conversationList[i].targetId == targetId) {\n                    conver = RongIMLib.RongIMClient._memoryStore.conversationList[i];\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n                        if (conver.unreadMessageCount == 0) {\n                            conver.unreadMessageCount = Number(count);\n                        }\n                    }\n                }\n            }\n            callback.onSuccess(conver);\n        };\n        ServerDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isHidden) {\n            var isSync = RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList;\n            var list = RongIMLib.RongIMClient._memoryStore.conversationList;\n            if (!isSync) {\n                callback.onSuccess(list);\n                return;\n            }\n            RongIMLib.RongIMClient.getInstance().getRemoteConversationList({\n                onSuccess: function (list) {\n                    if (RongIMLib.RongUtil.supportLocalStorage()) {\n                        Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (item) {\n                            var count = RongIMLib.RongIMClient._storageProvider.getItem(\"cu\" + RongIMLib.Bridge._client.userId + item.conversationType + item.targetId);\n                            if (item.unreadMessageCount == 0) {\n                                item.unreadMessageCount = Number(count);\n                            }\n                        });\n                    }\n                    RongIMLib.RongIMClient._memoryStore.isSyncRemoteConverList = false;\n                    callback.onSuccess(list);\n                },\n                onError: function (errorcode) {\n                    callback.onError(errorcode);\n                }\n            }, conversationTypes, count, isHidden);\n        };\n        ServerDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            Array.forEach(conversationTypes, function (conversationType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conversationType == conver.conversationType) {\n                        RongIMLib.RongIMClient.getInstance().removeConversation(conver.conversationType, conver.targetId, { onSuccess: function () { }, onError: function () { } });\n                    }\n                });\n            });\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.setMessageContent = function (messageId, content, objectname) {\n        };\n        ;\n        ServerDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            RongIMLib.RongIMClient.getInstance().getRemoteHistoryMessages(conversationType, targetId, timestamp, count, callback);\n        };\n        ServerDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            var count = 0;\n            if (conversationTypes) {\n                for (var i = 0, len = conversationTypes.length; i < len; i++) {\n                    Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                        if (conver.conversationType == conversationTypes[i]) {\n                            count += conver.unreadMessageCount;\n                        }\n                    });\n                }\n            }\n            else {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    count += conver.unreadMessageCount;\n                });\n            }\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            var count = 0;\n            Array.forEach(conversationTypes, function (converType) {\n                Array.forEach(RongIMLib.RongIMClient._memoryStore.conversationList, function (conver) {\n                    if (conver.conversationType == converType) {\n                        count += conver.unreadMessageCount;\n                    }\n                });\n            });\n            callback.onSuccess(count);\n        };\n        ServerDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    callback.onSuccess(conver ? conver.unreadMessageCount : 0);\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            RongIMLib.RongIMClient._storageProvider.removeItem(\"cu\" + RongIMLib.Bridge._client.userId + conversationType + targetId);\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    if (conver) {\n                        conver.unreadMessageCount = 0;\n                        conver.mentionedMsg = null;\n                        var mentioneds = RongIMLib.RongIMClient._storageProvider.getItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                        if (mentioneds) {\n                            var info = JSON.parse(mentioneds);\n                            delete info[conversationType + \"_\" + targetId];\n                            if (!RongIMLib.MessageUtil.isEmpty(info)) {\n                                RongIMLib.RongIMClient._storageProvider.setItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId, JSON.stringify(info));\n                            }\n                            else {\n                                RongIMLib.RongIMClient._storageProvider.removeItem(\"mentioneds_\" + RongIMLib.Bridge._client.userId + '_' + conversationType + '_' + targetId);\n                            }\n                        }\n                    }\n                    callback.onSuccess(true);\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            var me = this;\n            this.getConversation(conversationType, targetId, {\n                onSuccess: function (conver) {\n                    conver.isTop = isTop;\n                    me.addConversation(conver, callback);\n                    callback.onSuccess(true);\n                },\n                onError: function (error) {\n                    callback.onError(error);\n                }\n            });\n        };\n        ServerDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var targetId = params.targetId;\n            var conversationType = params.conversationType;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var getKey = function () {\n                return conversationType + '_' + targetId;\n            };\n            var key = getKey();\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            var topics = {\n                1: 'qryPPush',\n                3: 'qryDPush'\n            };\n            var topic = topics[conversationType];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            var success = function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            };\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    success(status);\n                }, onError: function (e) {\n                    if (e == 1) {\n                        success(e);\n                    }\n                    else {\n                        callback.onError(e);\n                    }\n                }\n            });\n        };\n        ServerDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var getKey = function () {\n                return conversationType + '_' + status;\n            };\n            var topics = {\n                '1_1': 'blkPPush',\n                '3_1': 'blkDPush',\n                '1_0': 'unblkPPush',\n                '3_0': 'unblkDPush'\n            };\n            var key = getKey();\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            notification[key] = status;\n            var topic = topics[key];\n            if (!topic) {\n                var error = 8001;\n                callback.onError(error);\n                return;\n            }\n            var modules = new RongIMLib.RongIMClient.Protobuf.BlockPushInput();\n            modules.setBlockeeId(targetId);\n            var userId = RongIMLib.Bridge._client.userId;\n            RongIMLib.RongIMClient.bridge.queryMsg(topic, RongIMLib.MessageUtil.ArrayForm(modules.toArrayBuffer()), userId, {\n                onSuccess: function (status) {\n                    callback.onSuccess(status);\n                }, onError: function (e) {\n                    callback.onError(e);\n                }\n            });\n        };\n        ServerDataProvider.prototype.clearListeners = function () {\n        };\n        ServerDataProvider.prototype.setServerInfo = function (info) {\n        };\n        ServerDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            return null;\n        };\n        ServerDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n        };\n        ServerDataProvider.prototype.setMessageExtra = function (messageId, value, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.getAllConversations = function (callback) {\n            callback.onSuccess([]);\n        };\n        ServerDataProvider.prototype.getConversationByContent = function (keywords, callback) {\n            callback.onSuccess([]);\n        };\n        ServerDataProvider.prototype.getMessagesFromConversation = function (conversationType, targetId, keywords, callback) {\n            callback.onSuccess([]);\n        };\n        ServerDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            callback.onSuccess([]);\n        };\n        ServerDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            callback.onSuccess([]);\n        };\n        ServerDataProvider.prototype.getDelaTime = function () {\n            return RongIMLib.RongIMClient._memoryStore.deltaTime;\n        };\n        ServerDataProvider.prototype.getUserStatus = function (userId, callback) {\n            callback.onSuccess(new RongIMLib.UserStatus());\n        };\n        ServerDataProvider.prototype.setUserStatus = function (userId, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            callback.onSuccess(true);\n        };\n        ServerDataProvider.prototype.setOnReceiveStatusListener = function (callback) {\n            callback();\n        };\n        ServerDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return RongIMLib.Bridge._client.channel.connectionStatus;\n        };\n        return ServerDataProvider;\n    })();\n    RongIMLib.ServerDataProvider = ServerDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var VCDataProvider = (function () {\n        function VCDataProvider(addon) {\n            this.userId = \"\";\n            this.useConsole = false;\n            this.addon = addon;\n        }\n        VCDataProvider.prototype.init = function (appKey) {\n            this.useConsole && console.log(\"init\");\n            this.addon.initWithAppkey(appKey);\n            // 0 不存不计数  1 只存不计数 3 存且计数\n            this.addon.registerMessageType(\"RC:VcMsg\", 3);\n            this.addon.registerMessageType(\"RC:ImgTextMsg\", 3);\n            this.addon.registerMessageType(\"RC:FileMsg\", 3);\n            this.addon.registerMessageType(\"RC:LBSMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RC:PSMultiImgTxtMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpMsg\", 3);\n            this.addon.registerMessageType(\"RCJrmf:RpOpendMsg\", 1);\n            this.addon.registerMessageType(\"RC:GrpNtf\", 1);\n            this.addon.registerMessageType(\"RC:DizNtf\", 0);\n            this.addon.registerMessageType(\"RC:InfoNtf\", 0);\n            this.addon.registerMessageType(\"RC:ContactNtf\", 0);\n            this.addon.registerMessageType(\"RC:ProfileNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdNtf\", 0);\n            this.addon.registerMessageType(\"RC:CmdMsg\", 0);\n            this.addon.registerMessageType(\"RC:TypSts\", 0);\n            this.addon.registerMessageType(\"RC:CsChaR\", 0);\n            this.addon.registerMessageType(\"RC:CsHsR\", 0);\n            this.addon.registerMessageType(\"RC:CsEnd\", 0);\n            this.addon.registerMessageType(\"RC:CsSp\", 0);\n            this.addon.registerMessageType(\"RC:CsUpdate\", 0);\n            this.addon.registerMessageType(\"RC:CsContact\", 0);\n            this.addon.registerMessageType(\"RC:ReadNtf\", 0);\n            this.addon.registerMessageType(\"RC:VCAccept\", 0);\n            this.addon.registerMessageType(\"RC:VCRinging\", 0);\n            this.addon.registerMessageType(\"RC:VCSummary\", 0);\n            this.addon.registerMessageType(\"RC:VCHangup\", 0);\n            this.addon.registerMessageType(\"RC:VCInvite\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMedia\", 0);\n            this.addon.registerMessageType(\"RC:VCModifyMem\", 0);\n            this.addon.registerMessageType(\"RC:PSCmd\", 0);\n            this.addon.registerMessageType(\"RC:RcCmd\", 0);\n            this.addon.registerMessageType(\"RC:SRSMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRReqMsg\", 0);\n            this.addon.registerMessageType(\"RC:RRRspMsg\", 0);\n        };\n        VCDataProvider.prototype.connect = function (token, callback, userId) {\n            this.useConsole && console.log(\"connect\");\n            this.userId = userId;\n            this.connectCallback = callback;\n            this.addon.connectWithToken(token, userId);\n        };\n        VCDataProvider.prototype.setServerInfo = function (info) {\n            'setServerInfo' in this.addon && this.addon.setServerInfo(info.navi);\n        };\n        VCDataProvider.prototype.logout = function () {\n            this.useConsole && console.log(\"logout\");\n            this.disconnect();\n        };\n        VCDataProvider.prototype.disconnect = function () {\n            this.useConsole && console.log(\"disconnect\");\n            this.addon.disconnect(true);\n        };\n        VCDataProvider.prototype.clearListeners = function () {\n            this.addon.setOnReceiveStatusListener();\n            this.addon.setConnectionStatusListener();\n            this.addon.setOnReceiveMessageListener();\n        };\n        VCDataProvider.prototype.setConnectionStatusListener = function (listener) {\n            var me = this;\n            /**\n            ConnectionStatus_TokenIncorrect = 31004,\n            ConnectionStatus_Connected = 0,\n            ConnectionStatus_KickedOff = 6, // 其他设备登录\n            ConnectionStatus_Connecting = 10,// 连接中\n            ConnectionStatus_SignUp = 12, // 未登录\n            ConnectionStatus_NetworkUnavailable = 1, // 连接断开\n            ConnectionStatus_ServerInvalid = 8, // 断开\n            ConnectionStatus_ValidateFailure = 9,//断开\n            ConnectionStatus_Unconnected = 11,//断开\n            ConnectionStatus_DisconnExecption = 31011 //断开\n            RC_NAVI_MALLOC_ERROR   = 30000,//断开\n            RC_NAVI_NET_UNAVAILABLE= 30002,//断开\n            RC_NAVI_SEND_FAIL      = 30004,//断开\n            RC_NAVI_REQ_TIMEOUT    = 30005,//断开\n            RC_NAVI_RECV_FAIL      = 30006,//断开\n            RC_NAVI_RESOURCE_ERROR = 30007,//断开\n            RC_NAVI_NODE_NOT_FOUND = 30008,//断开\n            RC_NAVI_DNS_ERROR      = 30009,//断开\n            */\n            me.connectListener = listener;\n            this.useConsole && console.log(\"setConnectionStatusListener\");\n            me.addon && me.addon.setConnectionStatusListener(function (result) {\n                switch (result) {\n                    case 10:\n                        listener.onChanged(RongIMLib.ConnectionStatus.CONNECTING);\n                        break;\n                    case 31004:\n                        me.connectCallback.onTokenIncorrect();\n                        break;\n                    case 1:\n                    case 8:\n                    case 9:\n                    case 11:\n                    case 12:\n                    case 31011:\n                    case 30000:\n                    case 30002:\n                    case 30004:\n                    case 30005:\n                    case 30006:\n                    case 30007:\n                    case 30008:\n                    case 30009:\n                        listener.onChanged(RongIMLib.ConnectionStatus.DISCONNECTED);\n                        break;\n                    case 0:\n                    case 33005:\n                        me.connectCallback.onSuccess(me.userId);\n                        listener.onChanged(RongIMLib.ConnectionStatus.CONNECTED);\n                        break;\n                    case 6:\n                        listener.onChanged(RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT);\n                        break;\n                }\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveMessageListener = function (listener) {\n            var me = this, localCount = 0;\n            me.messageListener = listener;\n            this.useConsole && console.log(\"setOnReceiveMessageListener\");\n            me.addon && me.addon.setOnReceiveMessageListener(function (result, leftCount) {\n                var message = me.buildMessage(result);\n                if ((leftCount == 0 && localCount == 1) || leftCount > 0) {\n                    message.offLineMessage = true;\n                }\n                else {\n                    message.offLineMessage = false;\n                }\n                localCount = leftCount;\n                listener.onReceived(message, leftCount);\n            });\n        };\n        VCDataProvider.prototype.sendTypingStatusMessage = function (conversationType, targetId, messageName, sendCallback) {\n            var me = this;\n            this.useConsole && console.log(\"sendTypingStatusMessage\");\n            if (messageName in RongIMLib.RongIMClient.MessageParams) {\n                me.sendMessage(conversationType, targetId, RongIMLib.TypingStatusMessage.obtain(RongIMLib.RongIMClient.MessageParams[messageName].objectName, \"\"), {\n                    onSuccess: function () {\n                        setTimeout(function () {\n                            sendCallback.onSuccess();\n                        });\n                    },\n                    onError: function (errorCode) {\n                        setTimeout(function () {\n                            sendCallback.onError(errorCode, null);\n                        });\n                    },\n                    onBefore: function () { }\n                });\n            }\n        };\n        VCDataProvider.prototype.setMessageStatus = function (conversationType, targetId, timestamp, status, callback) {\n            this.addon.updateMessageReceiptStatus(conversationType, targetId, timestamp);\n            callback.onSuccess(true);\n        };\n        VCDataProvider.prototype.sendTextMessage = function (conversationType, targetId, content, sendMessageCallback) {\n            var msgContent = RongIMLib.TextMessage.obtain(content);\n            this.useConsole && console.log(\"sendTextMessage\");\n            this.sendMessage(conversationType, targetId, msgContent, sendMessageCallback);\n        };\n        VCDataProvider.prototype.getRemoteHistoryMessages = function (conversationType, targetId, timestamp, count, callback) {\n            try {\n                var me = this;\n                me.useConsole && console.log(\"getRemoteHistoryMessages\");\n                me.addon.getRemoteHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, function (ret, hasMore) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        var message = me.buildMessage(list[i].obj);\n                        message.sentStatus = RongIMLib.SentStatus.READ;\n                        msgs[i] = message;\n                    }\n                    callback.onSuccess(msgs, hasMore ? true : false);\n                }, function (errorCode) {\n                    callback.onError(errorCode);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getRemoteConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            try {\n                this.useConsole && console.log(\"getRemoteConversationList\");\n                var converTypes = conversationTypes || [1, 2, 3, 4, 5, 6, 7, 8];\n                var result = this.addon.getConversationList(converTypes);\n                var list = JSON.parse(result).list, convers = [], me = this, index = 0;\n                list.reverse();\n                isGetHiddenConvers = typeof isGetHiddenConvers === 'boolean' ? isGetHiddenConvers : false;\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var tmpObj = list[i].obj, obj = JSON.parse(tmpObj);\n                    if (obj.isHidden == 1 && isGetHiddenConvers) {\n                        continue;\n                    }\n                    convers[index] = me.buildConversation(tmpObj);\n                    index++;\n                }\n                convers.reverse();\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.removeConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"removeConversation\");\n                this.addon.removeConversation(conversationType, targetId);\n                var conversations = RongIMLib.RongIMClient._memoryStore.conversationList;\n                var len = conversations.length;\n                for (var i = 0; i < len; i++) {\n                    if (conversations[i].conversationType == conversationType && targetId == conversations[i].targetId) {\n                        conversations.splice(i, 1);\n                        break;\n                    }\n                }\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.joinChatRoom = function (chatRoomId, messageCount, callback) {\n            this.useConsole && console.log(\"joinChatRoom\");\n            this.addon.joinChatRoom(chatRoomId, messageCount, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.quitChatRoom = function (chatRoomId, callback) {\n            this.useConsole && console.log(\"quitChatRoom\");\n            this.addon.quitChatRoom(chatRoomId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.addToBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"addToBlacklist\");\n            this.addon.addToBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklist = function (callback) {\n            this.useConsole && console.log(\"getBlacklist\");\n            this.addon.getBlacklist(function (blacklistors) {\n                callback.onSuccess(blacklistors);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getBlacklistStatus = function (userId, callback) {\n            this.useConsole && console.log(\"getBlacklistStatus\");\n            this.addon.getBlacklistStatus(userId, function (result) {\n                callback.onSuccess(result);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.removeFromBlacklist = function (userId, callback) {\n            this.useConsole && console.log(\"removeFromBlacklist\");\n            this.addon.removeFromBlacklist(userId, function () {\n                callback.onSuccess();\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.sendMessage = function (conversationType, targetId, messageContent, sendCallback, mentiondMsg, pushText, appData, methodType, params) {\n            var me = this, users = [];\n            me.useConsole && console.log(\"sendMessage\");\n            params = params || {};\n            var isGroup = (conversationType == RongIMLib.ConversationType.DISCUSSION || conversationType == RongIMLib.ConversationType.GROUP);\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"ReadReceiptResponseMessage\"]) {\n                users = [];\n                var rspMsg = messageContent;\n                if (rspMsg.receiptMessageDic) {\n                    var ids = [];\n                    for (var key in rspMsg.receiptMessageDic) {\n                        ids.push(key);\n                    }\n                    users = ids;\n                }\n            }\n            if (isGroup && messageContent.messageName == RongIMLib.RongIMClient.MessageType[\"SyncReadStatusMessage\"]) {\n                users = [];\n                users.push(me.userId);\n            }\n            var userIds = params.userIds;\n            if (isGroup && userIds) {\n                users = userIds;\n            }\n            var msg = me.addon.sendMessage(conversationType, targetId, RongIMLib.RongIMClient.MessageParams[messageContent.messageName].objectName, messageContent.encode(), pushText || \"\", appData || \"\", function (progress) {\n            }, function (message) {\n                sendCallback.onSuccess(me.buildMessage(message));\n            }, function (message, code) {\n                sendCallback.onError(code, me.buildMessage(message));\n            }, users);\n            var tempMessage = JSON.parse(msg);\n            sendCallback.onBefore && sendCallback.onBefore(tempMessage.messageId);\n            RongIMLib.MessageIdHandler.messageId = tempMessage.messageId;\n        };\n        VCDataProvider.prototype.registerMessageType = function (messageType, objectName, messageTag, messageContent) {\n            this.useConsole && console.log(\"registerMessageType\");\n            this.addon.registerMessageType(objectName, messageTag.getMessageTag());\n            var regMsg = RongIMLib.ModelUtil.modleCreate(messageContent, messageType);\n            RongIMLib.RongIMClient.RegisterMessage[messageType] = regMsg;\n            RongIMLib.RongIMClient.RegisterMessage[messageType].messageName = messageType;\n            registerMessageTypeMapping[objectName] = messageType;\n            RongIMLib.RongIMClient.MessageType[messageType] = messageType;\n            RongIMLib.RongIMClient.MessageParams[messageType] = { objectName: objectName, msgTag: messageTag };\n            typeMapping[objectName] = messageType;\n        };\n        VCDataProvider.prototype.addMessage = function (conversationType, targetId, message, callback) {\n            this.useConsole && console.log(\"addMessage\");\n            var direction = message.direction;\n            var msg = this.addon.insertMessage(conversationType, targetId, message.senderUserId, message.objectName, JSON.stringify(message.content), function () {\n                callback.onSuccess(me.buildMessage(msg));\n            }, function () {\n                callback.onError(RongIMLib.ErrorCode.MSG_INSERT_ERROR);\n            }, direction), me = this;\n        };\n        VCDataProvider.prototype.removeMessage = function (conversationType, targetId, delMsgs, callback) {\n        };\n        VCDataProvider.prototype.removeLocalMessage = function (conversationType, targetId, timestamps, callback) {\n            try {\n                this.useConsole && console.log(\"removeLocalMessage\");\n                this.addon.deleteMessages(timestamps);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getMessage = function (messageId, callback) {\n            try {\n                this.useConsole && console.log(\"getMessage\");\n                var msg = this.buildMessage(this.addon.getMessage(messageId));\n                callback.onSuccess(msg);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearMessages = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearMessages\");\n                this.addon.clearMessages(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversation = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getConversation\");\n                var ret = this.addon.getConversation(conversationType, targetId);\n                callback.onSuccess(this.buildConversation(ret));\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationList = function (callback, conversationTypes, count, isGetHiddenConvers) {\n            this.useConsole && console.log(\"getConversationList\");\n            this.getRemoteConversationList(callback, conversationTypes, count, isGetHiddenConvers);\n        };\n        VCDataProvider.prototype.clearConversations = function (conversationTypes, callback) {\n            try {\n                this.useConsole && console.log(\"clearConversations\");\n                this.addon.clearConversations();\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageContent = function (messageId, content, objectName) {\n            this.addon.setMessageContent(messageId, content, objectName);\n        };\n        VCDataProvider.prototype.getHistoryMessages = function (conversationType, targetId, timestamp, count, callback, objectname, direction) {\n            this.useConsole && console.log(\"getHistoryMessages\");\n            if (count <= 0) {\n                callback.onError(RongIMLib.ErrorCode.TIMEOUT);\n                return;\n            }\n            objectname = objectname || '';\n            try {\n                var ret = this.addon.getHistoryMessages(conversationType, targetId, timestamp ? timestamp : 0, count, objectname, direction);\n                var list = ret ? JSON.parse(ret).list : [], msgs = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    var message = me.buildMessage(list[i].obj);\n                    message.sentStatus = RongIMLib.SentStatus.READ;\n                    msgs[i] = message;\n                }\n                callback.onSuccess(msgs, len == count);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getTotalUnreadCount = function (callback, conversationTypes) {\n            try {\n                var result;\n                this.useConsole && console.log(\"getTotalUnreadCount\");\n                if (conversationTypes) {\n                    result = this.addon.getTotalUnreadCount(conversationTypes);\n                }\n                else {\n                    result = this.addon.getTotalUnreadCount();\n                }\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getConversationUnreadCount = function (conversationTypes, callback) {\n            this.useConsole && console.log(\"getConversationUnreadCount\");\n            this.getTotalUnreadCount(callback, conversationTypes);\n        };\n        VCDataProvider.prototype.getUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"getUnreadCount\");\n                var result = this.addon.getUnreadCount(conversationType, targetId);\n                callback.onSuccess(result);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCount = function (conversationType, targetId, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCount\");\n                var result = this.addon.clearUnreadCount(conversationType, targetId);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.clearUnreadCountByTimestamp = function (conversationType, targetId, timestamp, callback) {\n            try {\n                this.useConsole && console.log(\"clearUnreadCountByTimestamp\");\n                var result = this.addon.clearUnreadCountByTimestamp(conversationType, targetId, timestamp);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationToTop = function (conversationType, targetId, isTop, callback) {\n            try {\n                this.useConsole && console.log(\"setConversationToTop\");\n                this.addon.setConversationToTop(conversationType, targetId, isTop);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setConversationHidden = function (conversationType, targetId, isHidden) {\n            this.addon.setConversationHidden(conversationType, targetId, isHidden);\n        };\n        VCDataProvider.prototype.setMessageReceivedStatus = function (messageId, receivedStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageReceivedStatus\");\n                this.addon.setMessageReceivedStatus(messageId, receivedStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.setMessageSentStatus = function (messageId, sentStatus, callback) {\n            try {\n                this.useConsole && console.log(\"setMessageSentStatus\");\n                this.addon.setMessageSentStatus(messageId, sentStatus);\n                callback.onSuccess(true);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getFileToken = function (fileType, callback) {\n            this.useConsole && console.log(\"getFileToken\");\n            this.addon.getUploadToken(fileType, function (token) {\n                callback.onSuccess({ token: token });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.getFileUrl = function (fileType, fileName, oriName, callback) {\n            this.useConsole && console.log(\"getFileUrl\");\n            this.addon.getDownloadUrl(fileType, fileName, oriName, function (url) {\n                callback.onSuccess({ downloadUrl: url });\n            }, function (errorCode) {\n                callback.onError(errorCode);\n            });\n        };\n        VCDataProvider.prototype.searchConversationByContent = function (keyword, callback, conversationTypes) {\n            var converTypes = [];\n            if (typeof conversationTypes == 'undefined') {\n                converTypes = [1, 2, 3, 4, 5, 6, 7];\n            }\n            else {\n                converTypes = conversationTypes;\n            }\n            try {\n                this.useConsole && console.log(\"searchConversationByContent\");\n                var result = this.addon.searchConversationByContent(converTypes, keyword);\n                var list = JSON.parse(result).list, convers = [], me = this;\n                list.reverse();\n                for (var i = 0, len = list.length; i < len; i++) {\n                    convers[i] = me.buildConversation(list[i].obj);\n                }\n                callback.onSuccess(convers);\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.searchMessageByContent = function (conversationType, targetId, keyword, timestamp, count, total, callback) {\n            var me = this;\n            try {\n                this.useConsole && console.log(\"searchMessageByContent\");\n                this.addon.searchMessageByContent(conversationType, targetId, keyword, timestamp, count, total, function (ret, matched) {\n                    var list = ret ? JSON.parse(ret).list : [], msgs = [];\n                    list.reverse();\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        msgs[i] = me.buildMessage(list[i].obj);\n                    }\n                    callback.onSuccess(msgs, matched);\n                });\n            }\n            catch (e) {\n                callback.onError(e);\n            }\n        };\n        VCDataProvider.prototype.getChatRoomInfo = function (chatRoomId, count, order, callback) {\n            this.useConsole && console.log(\"getChatRoomInfo\");\n            this.addon.getChatroomInfo(chatRoomId, count, order, function (ret, count) {\n                var list = ret ? JSON.parse(ret).list : [], chatRoomInfo = { userInfos: [], userTotalNums: count };\n                if (list.length > 0) {\n                    for (var i = 0, len = list.length; i < len; i++) {\n                        chatRoomInfo.userInfos.push(JSON.parse(list[i].obj));\n                    }\n                }\n                callback.onSuccess(chatRoomInfo);\n            }, function (errcode) {\n                callback.onError(errcode);\n            });\n        };\n        VCDataProvider.prototype.setChatroomHisMessageTimestamp = function (chatRoomId, timestamp) {\n        };\n        VCDataProvider.prototype.getChatRoomHistoryMessages = function (chatRoomId, count, order, callback) {\n        };\n        VCDataProvider.prototype.getDelaTime = function () {\n            return this.addon.getDeltaTime();\n        };\n        VCDataProvider.prototype.getUserStatus = function (userId, callback) {\n            var me = this;\n            this.addon.getUserStatus(userId, function (status) {\n                callback.onSuccess(me.buildUserStatus(status));\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setUserStatus = function (userId, callback) {\n            this.addon.setUserStatus(userId, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.subscribeUserStatus = function (userIds, callback) {\n            this.addon.subscribeUserStatus(userIds, function () {\n                callback.onSuccess(true);\n            }, function (code) {\n                callback.onError(code);\n            });\n        };\n        VCDataProvider.prototype.setOnReceiveStatusListener = function (callback) {\n            var me = this;\n            this.addon.setOnReceiveStatusListener(function (userId, status) {\n                callback(userId, me.buildUserStatus(status));\n            });\n        };\n        VCDataProvider.prototype.getUnreadMentionedMessages = function (conversationType, targetId) {\n            var me = this;\n            var mentions = JSON.parse(me.addon.getUnreadMentionedMessages(conversationType, targetId)).list;\n            for (var i = 0, len = mentions.length; i < len; i++) {\n                var temp = JSON.parse(mentions[i].obj);\n                temp.content = JSON.parse(temp.content);\n                mentions[i] = temp;\n            }\n            return mentions;\n        };\n        VCDataProvider.prototype.hasRemoteUnreadMessages = function (token, callback) {\n            callback.onSuccess(false);\n        };\n        VCDataProvider.prototype.sendRecallMessage = function (conent, sendMessageCallback) {\n            // new RecallCommandMessage({conversationType : conent.conversationType, targetId : conent.targetId, sentTime:content.sentTime, messageUId : conent.messageUId, extra : conent.extra, user : conent.user});\n        };\n        VCDataProvider.prototype.updateMessage = function (message, callback) { };\n        VCDataProvider.prototype.updateMessages = function (conversationType, targetId, key, value, callback) { };\n        VCDataProvider.prototype.reconnect = function (callback) { };\n        VCDataProvider.prototype.sendReceiptResponse = function (conversationType, targetId, sendCallback) { };\n        VCDataProvider.prototype.setMessageExtra = function (messageId, value, callback) { };\n        VCDataProvider.prototype.addMemberToDiscussion = function (discussionId, userIdList, callback) { };\n        VCDataProvider.prototype.createDiscussion = function (name, userIdList, callback) { };\n        VCDataProvider.prototype.getDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.quitDiscussion = function (discussionId, callback) { };\n        VCDataProvider.prototype.removeMemberFromDiscussion = function (discussionId, userId, callback) { };\n        VCDataProvider.prototype.setDiscussionInviteStatus = function (discussionId, status, callback) { };\n        VCDataProvider.prototype.setDiscussionName = function (discussionId, name, callback) { };\n        VCDataProvider.prototype.joinGroup = function (groupId, groupName, callback) { };\n        VCDataProvider.prototype.quitGroup = function (groupId, callback) { };\n        VCDataProvider.prototype.syncGroup = function (groups, callback) { };\n        VCDataProvider.prototype.addConversation = function (conversation, callback) { };\n        VCDataProvider.prototype.updateConversation = function (conversation) {\n            return null;\n        };\n        VCDataProvider.prototype.getConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            var status = notification[key];\n            if (typeof status == 'number') {\n                callback.onSuccess(status);\n                return;\n            }\n            this.addon.getConversationNotificationStatus(conversationType, targetId, function (status) {\n                notification[key] = status;\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.setConversationNotificationStatus = function (params, callback) {\n            var conversationType = params.conversationType;\n            var targetId = params.targetId;\n            var status = params.status;\n            var notification = RongIMLib.RongIMClient._memoryStore.notification;\n            var key = conversationType + '_' + targetId;\n            notification[key] = status;\n            var notify = !!status;\n            this.addon.setConversationNotificationStatus(conversationType, targetId, notify, function () {\n                callback.onSuccess(status);\n            }, function (error) {\n                callback.onError(error);\n            });\n        };\n        VCDataProvider.prototype.getCurrentConnectionStatus = function () {\n            return this.addon.getConnectionStatus();\n        };\n        VCDataProvider.prototype.buildUserStatus = function (result) {\n            var userStatus = new RongIMLib.UserStatus();\n            var obj = JSON.parse(result);\n            if (obj.us && obj.us[0]) {\n                userStatus.platform = obj.us[0].p;\n                userStatus.online = !!obj.us[0].o;\n                userStatus.status = obj.us[0].s;\n            }\n            return userStatus;\n        };\n        VCDataProvider.prototype.buildMessage = function (result) {\n            var message = new RongIMLib.Message(), ret = JSON.parse(result);\n            message.conversationType = ret.conversationType;\n            message.targetId = ret.targetId;\n            message.messageDirection = ret.direction;\n            message.senderUserId = ret.senderUserId;\n            if (ret.direction == RongIMLib.MessageDirection.RECEIVE) {\n                message.receivedStatus = ret.status;\n            }\n            else if (ret.direction == RongIMLib.MessageDirection.SEND) {\n                message.sentStatus = ret.status;\n            }\n            message.sentTime = ret.sentTime;\n            message.objectName = ret.objectName;\n            var content = ret.content ? JSON.parse(ret.content) : ret.content;\n            var messageType = typeMapping[ret.objectName] || registerMessageTypeMapping[ret.objectName];\n            if (content) {\n                content.messageName = messageType;\n            }\n            message.content = content;\n            message.messageId = ret.messageId;\n            message.messageUId = ret.messageUid;\n            message.messageType = messageType;\n            return message;\n        };\n        VCDataProvider.prototype.buildConversation = function (val) {\n            var conver = new RongIMLib.Conversation(), c = JSON.parse(val), lastestMsg = c.lastestMsg ? this.buildMessage(c.lastestMsg) : {};\n            conver.conversationTitle = c.title;\n            conver.conversationType = c.conversationType;\n            conver.draft = c.draft;\n            conver.isTop = c.isTop;\n            conver.isHidden = c.isHidden;\n            lastestMsg.conversationType = c.conversationType;\n            lastestMsg.targetId = c.targetId;\n            conver.latestMessage = lastestMsg;\n            conver.latestMessageId = lastestMsg.messageId;\n            conver.latestMessage.messageType = typeMapping[lastestMsg.objectName] || registerMessageTypeMapping[lastestMsg.objectName];\n            conver.objectName = lastestMsg.objectName;\n            conver.receivedStatus = RongIMLib.ReceivedStatus.READ;\n            conver.sentTime = lastestMsg.sentTime;\n            conver.senderUserId = lastestMsg.senderUserId;\n            conver.sentStatus = lastestMsg.status;\n            conver.targetId = c.targetId;\n            conver.unreadMessageCount = c.unreadCount;\n            conver.hasUnreadMention = c.m_hasUnreadMention;\n            var mentions = this.getUnreadMentionedMessages(c.conversationType, c.targetId);\n            if (mentions.length > 0) {\n                // 取最后一条 @ 消息,原因：和 web 互相兼容\n                var mention = mentions.pop();\n                conver.mentionedMsg = { uid: mention.messageUid, time: mention.sentTime, mentionedInfo: mention.content.mentionedInfo, sendUserId: mention.senderUserId };\n            }\n            return conver;\n        };\n        return VCDataProvider;\n    })();\n    RongIMLib.VCDataProvider = VCDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var MemeoryProvider = (function () {\n        function MemeoryProvider() {\n            this._memeoryStore = {};\n            this.prefix = \"rong_\";\n        }\n        MemeoryProvider.prototype.setItem = function (composedKey, object) {\n            this._memeoryStore[composedKey] = decodeURIComponent(object);\n        };\n        MemeoryProvider.prototype.getItem = function (composedKey) {\n            return this._memeoryStore[composedKey];\n        };\n        MemeoryProvider.prototype.removeItem = function (composedKey) {\n            if (this.getItem(composedKey)) {\n                delete this._memeoryStore[composedKey];\n            }\n        };\n        MemeoryProvider.prototype.getItemKey = function (regStr) {\n            var me = this, item = null, reg = new RegExp(regStr + \"\\\\w+\");\n            for (var key in me._memeoryStore) {\n                var arr = key.match(reg);\n                if (arr) {\n                    item = key;\n                }\n            }\n            return item;\n        };\n        MemeoryProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in me._memeoryStore) {\n                delete me._memeoryStore[key];\n            }\n        };\n        //单位：字节\n        MemeoryProvider.prototype.onOutOfQuota = function () {\n            return 4 * 1024;\n        };\n        return MemeoryProvider;\n    })();\n    RongIMLib.MemeoryProvider = MemeoryProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var LocalStorageProvider = (function () {\n        // static _instance: LocalStorageProvider = new LocalStorageProvider();\n        function LocalStorageProvider() {\n            this.prefix = 'rong_';\n            this._host = \"\";\n            var d = new Date(), m = d.getMonth() + 1, date = d.getFullYear() + '/' + (m.toString().length == 1 ? '0' + m : m) + '/' + d.getDate(), nowDate = new Date(date).getTime();\n            for (var key in localStorage) {\n                if (key.lastIndexOf('RECEIVED') > -1) {\n                    var recObj = JSON.parse(localStorage.getItem(key));\n                    for (var key_1 in recObj) {\n                        nowDate - recObj[key_1].dealtime > 0 && (delete recObj[key_1]);\n                    }\n                    if (RongIMLib.RongUtil.isEmpty(recObj)) {\n                        localStorage.removeItem(key);\n                    }\n                    else {\n                        localStorage.setItem(key, JSON.stringify(recObj));\n                    }\n                }\n                if (key.lastIndexOf('SENT') > -1) {\n                    var sentObj = JSON.parse(localStorage.getItem(key));\n                    nowDate - sentObj.dealtime > 0 && (localStorage.removeItem(key));\n                }\n            }\n        }\n        LocalStorageProvider.prototype.setItem = function (composedKey, object) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.setItem(composedKey, object);\n            }\n        };\n        LocalStorageProvider.prototype.getItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                return localStorage.getItem(composedKey ? composedKey : \"\");\n            }\n            return \"\";\n        };\n        LocalStorageProvider.prototype.getItemKey = function (composedStr) {\n            var item = \"\";\n            var _key = this.prefix + composedStr;\n            for (var key in localStorage) {\n                if (key.indexOf(_key) == 0) {\n                    item = key;\n                    break;\n                }\n            }\n            return item;\n        };\n        LocalStorageProvider.prototype.removeItem = function (composedKey) {\n            if (composedKey) {\n                composedKey.indexOf(this.prefix) == -1 && (composedKey = this.prefix + composedKey);\n                localStorage.removeItem(composedKey.toString());\n            }\n        };\n        LocalStorageProvider.prototype.clearItem = function () {\n            var me = this;\n            for (var key in localStorage) {\n                if (key.indexOf(me.prefix) > -1) {\n                    me.removeItem(key);\n                }\n            }\n        };\n        //单位：字节\n        LocalStorageProvider.prototype.onOutOfQuota = function () {\n            return JSON.stringify(localStorage).length;\n        };\n        return LocalStorageProvider;\n    })();\n    RongIMLib.LocalStorageProvider = LocalStorageProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var UserDataProvider = (function () {\n        function UserDataProvider() {\n            this.opersistName = 'RongIMLib';\n            this.keyManager = 'RongUserDataKeyManager';\n            this._host = \"\";\n            this.prefix = \"rong_\";\n            this.oPersist = document.createElement(\"div\");\n            this.oPersist.style.display = \"none\";\n            this.oPersist.style.behavior = \"url('#default#userData')\";\n            document.body.appendChild(this.oPersist);\n            this.oPersist.load(this.opersistName);\n        }\n        UserDataProvider.prototype.setItem = function (key, value) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.setAttribute(key, value);\n            var keyNames = this.getItem(this.keyManager);\n            keyNames ? keyNames.indexOf(key) == -1 && (keyNames += ',' + key) : (keyNames = key);\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNames);\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            return key ? this.oPersist.getAttribute(key) : key;\n        };\n        UserDataProvider.prototype.removeItem = function (key) {\n            key && key.indexOf(this.prefix) == -1 && (key = this.prefix + key);\n            this.oPersist.removeAttribute(key);\n            this.oPersist.save(this.opersistName);\n            var keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [];\n            for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                if (keyNameArray[i] == key) {\n                    keyNameArray.splice(i, 1);\n                }\n            }\n            this.oPersist.setAttribute(this.prefix + this.keyManager, keyNameArray.join(','));\n            this.oPersist.save(this.opersistName);\n        };\n        UserDataProvider.prototype.getItemKey = function (composedStr) {\n            var item = null, keyNames = this.getItem(this.keyManager), keyNameArray = keyNames && keyNames.split(',') || [], me = this;\n            var _key = this.prefix + composedStr;\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    if (keyNameArray[i] && keyNameArray[i].indexOf(_key) == 0) {\n                        item = keyNameArray[i];\n                        break;\n                    }\n                }\n            }\n            return item;\n        };\n        UserDataProvider.prototype.clearItem = function () {\n            var keyNames = this.getItem(this.keyManager), keyNameArray = [], me = this;\n            keyNames && (keyNameArray = keyNames.split(','));\n            if (keyNameArray.length) {\n                for (var i = 0, len = keyNameArray.length; i < len; i++) {\n                    keyNameArray[i] && me.removeItem(keyNameArray[i]);\n                }\n                me.removeItem(me.keyManager);\n            }\n        };\n        UserDataProvider.prototype.onOutOfQuota = function () {\n            return 10 * 1024 * 1024;\n        };\n        return UserDataProvider;\n    })();\n    RongIMLib.UserDataProvider = UserDataProvider;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeatureDectector = (function () {\n        function FeatureDectector(callback) {\n            this.script = document.createElement(\"script\");\n            this.head = document.getElementsByTagName(\"head\")[0];\n            if (\"WebSocket\" in window && \"ArrayBuffer\" in window && WebSocket.prototype.CLOSED === 3 && !RongIMLib.RongIMClient._memoryStore.depend.isPolling) {\n                RongIMLib.Transportations._TransportType = RongIMLib.Socket.WEBSOCKET;\n                if (!RongIMLib.RongIMClient.Protobuf) {\n                    var url = RongIMLib.RongIMClient._memoryStore.depend.protobuf;\n                    var script = this.script;\n                    script.src = url;\n                    this.head.appendChild(script);\n                    script.onload = script.onreadystatechange = function () {\n                        var isLoaded = (!this.readState || this.readyState == 'loaded' || this.readyState == 'complete');\n                        if (isLoaded) {\n                            // 防止 IE6、7 下偶发触发两次 loaded\n                            script.onload = script.onreadystatechange = null;\n                            if (callback) {\n                                callback();\n                            }\n                            if (!callback) {\n                                var token = RongIMLib.RongIMClient._memoryStore.token;\n                                var connectCallback = RongIMLib.RongIMClient._memoryStore.callback;\n                                token && RongIMLib.RongIMClient.connect(token, connectCallback);\n                            }\n                        }\n                    };\n                }\n            }\n            else {\n                RongIMLib.Transportations._TransportType = \"xhr-polling\";\n                RongIMLib.RongIMClient.Protobuf = Polling;\n            }\n        }\n        return FeatureDectector;\n    })();\n    RongIMLib.FeatureDectector = FeatureDectector;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var FeaturePatcher = (function () {\n        function FeaturePatcher() {\n        }\n        FeaturePatcher.prototype.patchAll = function () {\n            this.patchJSON();\n            this.patchForEach();\n        };\n        FeaturePatcher.prototype.patchForEach = function () {\n            if (!Array.forEach) {\n                Array.forEach = function (arr, func) {\n                    for (var i = 0; i < arr.length; i++) {\n                        func.call(arr, arr[i], i, arr);\n                    }\n                };\n            }\n        };\n        FeaturePatcher.prototype.patchJSON = function () {\n            if (!window[\"JSON\"]) {\n                window[\"JSON\"] = (function () {\n                    function JSON() {\n                    }\n                    JSON.parse = function (sJSON) {\n                        return eval('(' + sJSON + ')');\n                    };\n                    JSON.stringify = function (value) {\n                        return this.str(\"\", { \"\": value });\n                    };\n                    JSON.str = function (key, holder) {\n                        var i, k, v, length, mind = \"\", partial, value = holder[key], me = this;\n                        if (value && typeof value === \"object\" && typeof value.toJSON === \"function\") {\n                            value = value.toJSON(key);\n                        }\n                        switch (typeof value) {\n                            case \"string\":\n                                return me.quote(value);\n                            case \"number\":\n                                return isFinite(value) ? String(value) : \"null\";\n                            case \"boolean\":\n                            case \"null\":\n                                return String(value);\n                            case \"object\":\n                                if (!value) {\n                                    return \"null\";\n                                }\n                                partial = [];\n                                if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n                                    length = value.length;\n                                    for (i = 0; i < length; i += 1) {\n                                        partial[i] = me.str(i, value) || \"null\";\n                                    }\n                                    v = partial.length === 0 ? \"[]\" : \"[\" + partial.join(\",\") + \"]\";\n                                    return v;\n                                }\n                                for (k in value) {\n                                    if (Object.prototype.hasOwnProperty.call(value, k)) {\n                                        v = me.str(k, value);\n                                        if (v) {\n                                            partial.push(me.quote(k) + \":\" + v);\n                                        }\n                                    }\n                                }\n                                v = partial.length === 0 ? \"{}\" : \"{\" + partial.join(\",\") + \"}\";\n                                return v;\n                        }\n                    };\n                    JSON.quote = function (string) {\n                        var me = this;\n                        me.rx_escapable.lastIndex = 0;\n                        return me.rx_escapable.test(string) ? '\"' + string.replace(me.rx_escapable, function (a) {\n                            var c = me.meta[a];\n                            return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n                        }) + '\"' : '\"' + string + '\"';\n                    };\n                    JSON.rx_escapable = new RegExp('[\\\\\\\"\\\\\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', \"g\");\n                    JSON.meta = {\n                        \"\\b\": \"\\\\b\",\n                        \"   \": \"\\\\t\",\n                        \"\\n\": \"\\\\n\",\n                        \"\\f\": \"\\\\f\",\n                        \"\\r\": \"\\\\r\",\n                        '\"': '\\\\\"',\n                        \"''\": \"\\\\''\",\n                        \"\\\\\": \"\\\\\\\\\"\n                    };\n                    return JSON;\n                })();\n            }\n        };\n        return FeaturePatcher;\n    })();\n    RongIMLib.FeaturePatcher = FeaturePatcher;\n})(RongIMLib || (RongIMLib = {}));\nvar RongIMLib;\n(function (RongIMLib) {\n    var PublicServiceMap = (function () {\n        function PublicServiceMap() {\n            this.publicServiceList = [];\n        }\n        PublicServiceMap.prototype.get = function (publicServiceType, publicServiceId) {\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (this.publicServiceList[i].conversationType == publicServiceType && publicServiceId == this.publicServiceList[i].publicServiceId) {\n                    return this.publicServiceList[i];\n                }\n            }\n        };\n        PublicServiceMap.prototype.add = function (publicServiceProfile) {\n            var isAdd = true, me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.unshift(this.publicServiceList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.publicServiceList.unshift(publicServiceProfile);\n            }\n        };\n        PublicServiceMap.prototype.replace = function (publicServiceProfile) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == publicServiceProfile.conversationType && publicServiceProfile.publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    me.publicServiceList.splice(i, 1, publicServiceProfile);\n                    break;\n                }\n            }\n        };\n        PublicServiceMap.prototype.remove = function (conversationType, publicServiceId) {\n            var me = this;\n            for (var i = 0, len = this.publicServiceList.length; i < len; i++) {\n                if (me.publicServiceList[i].conversationType == conversationType && publicServiceId == me.publicServiceList[i].publicServiceId) {\n                    this.publicServiceList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return PublicServiceMap;\n    })();\n    RongIMLib.PublicServiceMap = PublicServiceMap;\n    /**\n     * 会话工具类。\n     */\n    var ConversationMap = (function () {\n        function ConversationMap() {\n            this.conversationList = [];\n        }\n        ConversationMap.prototype.get = function (conversavtionType, targetId) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType == conversavtionType && this.conversationList[i].targetId == targetId) {\n                    return this.conversationList[i];\n                }\n            }\n            return null;\n        };\n        ConversationMap.prototype.add = function (conversation) {\n            var isAdd = true;\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.unshift(this.conversationList.splice(i, 1)[0]);\n                    isAdd = false;\n                    break;\n                }\n            }\n            if (isAdd) {\n                this.conversationList.unshift(conversation);\n            }\n        };\n        /**\n         * [replace 替换会话]\n         * 会话数组存在的情况下调用add方法会是当前会话被替换且返回到第一个位置，导致用户本地一些设置失效，所以提供replace方法\n         */\n        ConversationMap.prototype.replace = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1, conversation);\n                    break;\n                }\n            }\n        };\n        ConversationMap.prototype.remove = function (conversation) {\n            for (var i = 0, len = this.conversationList.length; i < len; i++) {\n                if (this.conversationList[i].conversationType === conversation.conversationType && this.conversationList[i].targetId === conversation.targetId) {\n                    this.conversationList.splice(i, 1);\n                    break;\n                }\n            }\n        };\n        return ConversationMap;\n    })();\n    RongIMLib.ConversationMap = ConversationMap;\n    var CheckParam = (function () {\n        function CheckParam() {\n        }\n        CheckParam.getInstance = function () {\n            if (!CheckParam._instance) {\n                CheckParam._instance = new CheckParam();\n            }\n            return CheckParam._instance;\n        };\n        CheckParam.prototype.check = function (f, position, d, c) {\n            if (RongIMLib.RongIMClient._dataAccessProvider || d) {\n                for (var g = 0, e = c.length; g < e; g++) {\n                    if (!new RegExp(this.getType(c[g])).test(f[g])) {\n                        throw new Error(\"The index of \" + g + \" parameter was wrong type \" + this.getType(c[g]) + \" [\" + f[g] + \"] -> position:\" + position);\n                    }\n                }\n            }\n            else {\n                throw new Error(\"The parameter is incorrect or was not yet instantiated RongIMClient -> position:\" + position);\n            }\n        };\n        CheckParam.prototype.getType = function (str) {\n            var temp = Object.prototype.toString.call(str).toLowerCase();\n            return temp.slice(8, temp.length - 1);\n        };\n        CheckParam.prototype.checkCookieDisable = function () {\n            document.cookie = \"checkCookie=1\";\n            var arr = document.cookie.match(new RegExp(\"(^| )checkCookie=([^;]*)(;|$)\")), isDisable = false;\n            if (!arr) {\n                isDisable = true;\n            }\n            document.cookie = \"checkCookie=1;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n            return isDisable;\n        };\n        return CheckParam;\n    })();\n    RongIMLib.CheckParam = CheckParam;\n    var LimitableMap = (function () {\n        function LimitableMap(limit) {\n            this.map = {};\n            this.keys = [];\n            this.limit = limit || 10;\n        }\n        LimitableMap.prototype.set = function (key, value) {\n            if (this.map.hasOwnProperty(key)) {\n                if (this.keys.length === this.limit) {\n                    var firstKey = this.keys.shift();\n                    delete this.map[firstKey];\n                }\n                this.keys.push(key);\n            }\n            this.map[key] = value;\n        };\n        LimitableMap.prototype.get = function (key) {\n            return this.map[key] || 0;\n        };\n        LimitableMap.prototype.remove = function (key) {\n            delete this.map[key];\n        };\n        return LimitableMap;\n    })();\n    RongIMLib.LimitableMap = LimitableMap;\n    var RongAjax = (function () {\n        function RongAjax(options) {\n            var me = this;\n            me.xmlhttp = null;\n            me.options = options;\n            var hasCORS = typeof XMLHttpRequest !== \"undefined\" && \"withCredentials\" in new XMLHttpRequest();\n            if (\"undefined\" != typeof XMLHttpRequest && hasCORS) {\n                me.xmlhttp = new XMLHttpRequest();\n            }\n            else if (\"undefined\" != typeof XDomainRequest) {\n                me.xmlhttp = new XDomainRequest();\n            }\n            else {\n                me.xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n            }\n        }\n        RongAjax.prototype.send = function (callback) {\n            var me = this;\n            me.options.url || (me.options.url = \"http://upload.qiniu.com/putb64/-1\");\n            me.xmlhttp.onreadystatechange = function () {\n                if (me.xmlhttp.readyState == 4) {\n                    if (me.options.type) {\n                        callback();\n                    }\n                    else {\n                        callback(JSON.parse(me.xmlhttp.responseText.replace(/'/g, '\"')));\n                    }\n                }\n            };\n            me.xmlhttp.open(\"POST\", me.options.url, true);\n            me.xmlhttp.withCredentials = false;\n            if (\"setRequestHeader\" in me.xmlhttp) {\n                if (me.options.type) {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded; charset=utf-8\");\n                }\n                else {\n                    me.xmlhttp.setRequestHeader(\"Content-type\", \"application/octet-stream\");\n                    me.xmlhttp.setRequestHeader('Authorization', \"UpToken \" + me.options.token);\n                }\n            }\n            me.xmlhttp.send(me.options.type ? \"appKey=\" + me.options.appKey + \"&deviceId=\" + me.options.deviceId + \"&timestamp=\" + me.options.timestamp + \"&deviceInfo=\" + me.options.deviceInfo + \"&privateInfo=\" + JSON.stringify(me.options.privateInfo) : me.options.base64);\n        };\n        return RongAjax;\n    })();\n    RongIMLib.RongAjax = RongAjax;\n    var RongUtil = (function () {\n        function RongUtil() {\n        }\n        RongUtil.noop = function () { };\n        RongUtil.isEmpty = function (obj) {\n            var empty = true;\n            for (var key in obj) {\n                empty = false;\n                break;\n            }\n            return empty;\n        };\n        RongUtil.isObject = function (obj) {\n            return Object.prototype.toString.call(obj) == '[object Object]';\n        };\n        RongUtil.isArray = function (array) {\n            return Object.prototype.toString.call(array) == '[object Array]';\n        };\n        RongUtil.isFunction = function (fun) {\n            return Object.prototype.toString.call(fun) == '[object Function]';\n        };\n        ;\n        RongUtil.stringFormat = function (tmpl, vals) {\n            for (var i = 0, len = vals.length; i < len; i++) {\n                var val = vals[i], reg = new RegExp(\"\\\\{\" + (i) + \"\\\\}\", \"g\");\n                tmpl = tmpl.replace(reg, val);\n            }\n            return tmpl;\n        };\n        RongUtil.forEach = function (obj, callback) {\n            callback = callback || RongUtil.noop;\n            var loopObj = function () {\n                for (var key in obj) {\n                    callback(obj[key], key);\n                }\n            };\n            var loopArr = function () {\n                for (var i = 0, len = obj.length; i < len; i++) {\n                    callback(obj[i], i);\n                }\n            };\n            if (RongUtil.isObject(obj)) {\n                loopObj();\n            }\n            if (RongUtil.isArray(obj)) {\n                loopArr();\n            }\n        };\n        RongUtil.extends = function (source, target, callback, force) {\n            RongUtil.forEach(source, function (val, key) {\n                var hasProto = (key in target);\n                if (force && hasProto) {\n                    target[key] = val;\n                }\n                if (!hasProto) {\n                    target[key] = val;\n                }\n            });\n            return target;\n        };\n        RongUtil.createXHR = function () {\n            var item = {\n                XMLHttpRequest: function () {\n                    return new XMLHttpRequest();\n                },\n                XDomainRequest: function () {\n                    return new XDomainRequest();\n                },\n                ActiveXObject: function () {\n                    return new ActiveXObject('Microsoft.XMLHTTP');\n                }\n            };\n            var isXHR = (typeof XMLHttpRequest == 'function');\n            var isXDR = (typeof XDomainRequest == 'function');\n            var key = isXHR ? 'XMLHttpRequest' : isXDR ? 'XDomainRequest' : 'ActiveXObject';\n            return item[key]();\n        };\n        RongUtil.request = function (opts) {\n            var url = opts.url;\n            var success = opts.success;\n            var error = opts.error;\n            var method = opts.method || 'GET';\n            var xhr = RongUtil.createXHR();\n            xhr.onreadystatechange = function () {\n                if (xhr.readyState == 4) {\n                    if (xhr.status == 200) {\n                        success();\n                    }\n                    else {\n                        error();\n                    }\n                }\n            };\n            xhr.open(method, url, true);\n            xhr.send(null);\n        };\n        RongUtil.formatProtoclPath = function (config) {\n            var path = config.path;\n            var protocol = config.protocol;\n            var tmpl = config.tmpl || '{0}{1}';\n            var sub = config.sub;\n            var flag = '://';\n            var index = path.indexOf(flag);\n            var hasProtocol = (index > -1);\n            if (hasProtocol) {\n                index += flag.length;\n                path = path.substring(index);\n            }\n            if (sub) {\n                index = path.indexOf('/');\n                var hasPath = (index > -1);\n                if (hasPath) {\n                    path = path.substr(0, index);\n                }\n            }\n            return RongUtil.stringFormat(tmpl, [protocol, path]);\n        };\n        ;\n        RongUtil.supportLocalStorage = function () {\n            var support = false;\n            if (typeof localStorage == 'object') {\n                try {\n                    var key = 'RC_TMP_KEY', value = 'RC_TMP_VAL';\n                    localStorage.setItem(key, value);\n                    var localVal = localStorage.getItem(key);\n                    if (localVal == value) {\n                        support = true;\n                    }\n                }\n                catch (err) {\n                    console.log('localStorage is disabled.');\n                }\n            }\n            return support;\n        };\n        return RongUtil;\n    })();\n    RongIMLib.RongUtil = RongUtil;\n})(RongIMLib || (RongIMLib = {}));\n\n/*\n    说明: 请勿修改 header.js 和 footer.js\n    用途: 自动拼接暴露方式\n    命令: grunt release 中 concat\n*/\n    return RongIMLib;\n});"
  },
  {
    "path": "sdk-unitest/im/run.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Web SDK UnitTest</title>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../jasmine/1.2.0/jasmine.css\">\n<script type=\"text/javascript\" src=\"../jasmine/1.2.0/jasmine.js\" id=\"jasmine\"></script>\n<script type=\"text/javascript\" src=\"../jasmine/1.2.0/jasmine-html.js\"></script>\n<script type=\"text/javascript\" src=\"../libs/underscore.js\"></script>\n\n\n<!-- lib -->\n<script>\nvar AppConfig = {\n    appKey : \"8w7jv4qb78a9y\",\n    token : \"4FGCL0oQ/E72nU4ivbui8uHR/ySxKaD1cAX2biXsYR6RsLYO9xAA4ooa+q3n42JnVTQyMAdFUiDsjFRDYZaQeg==\",\n    targetIds : \"user9,user8\"\n};\n</script>\n<script type=\"text/javascript\" src=\"//cdn.ronghub.com/RongIMLib-2.5.0.js\"></script>\n\n\n<!--test files-->\n<script type=\"text/javascript\" src=\"testcase/1-staticCheck.js\"></script>\n<script type=\"text/javascript\" src=\"testcase/2-connect.js\"></script>\n<script type=\"text/javascript\" src=\"testcase/3-sendMessage.js?22\"></script>\n\n\n<script type=\"text/javascript\">\n(function() {\n    var htmlReporter = new jasmine.HtmlReporter();\n\n    var jasmineEnv = jasmine.getEnv();\n        jasmineEnv.updateInterval = 1000;\n        jasmineEnv.addReporter(htmlReporter);\n\n        jasmineEnv.specFilter = function(spec) {\n            return htmlReporter.specFilter(spec);\n        };\n\n    window.onload = function(){\n        jasmineEnv.execute();\n    }\n\n})();\n</script>\n\n</head>\n<body>\n\n</body>\n</html>\n"
  },
  {
    "path": "sdk-unitest/im/testcase/1-staticCheck.js",
    "content": "describe(\"RongIMLib\", function() {\n\tvar apiList = [\"MentionedType\",\"MethodType\",\"BlacklistStatus\",\"ConnectionChannel\",\"CustomerType\",\"GetChatRoomType\",\"ConnectionStatus\",\"ConversationNotificationStatus\",\"ConversationType\",\"DiscussionInviteStatus\",\"ErrorCode\",\"VoIPMediaType\",\"MediaType\",\"MessageDirection\",\"FileType\",\"RealTimeLocationErrorCode\",\"RealTimeLocationStatus\",\"ReceivedStatus\",\"SearchType\",\"SentStatus\",\"ConnectionState\",\"RongIMClient\",\"Qos\",\"Type\",\"Channel\",\"Socket\",\"Client\",\"Bridge\",\"MessageHandler\",\"MessageCallback\",\"CallbackMapping\",\"PublishCallback\",\"QueryCallback\",\"ConnectAck\",\"Navigation\",\"BaseMessage\",\"ConnectMessage\",\"ConnAckMessage\",\"DisconnectMessage\",\"PingReqMessage\",\"PingRespMessage\",\"RetryableMessage\",\"PubAckMessage\",\"PublishMessage\",\"QueryMessage\",\"QueryConMessage\",\"QueryAckMessage\",\"MessageOutputStream\",\"MessageInputStream\",\"Header\",\"BinaryHelper\",\"RongIMStream\",\"SocketTransportation\",\"PollingTransportation\",\"Transportations\",\"MessageUtil\",\"MessageIdHandler\",\"MessageContent\",\"NotificationMessage\",\"StatusMessage\",\"ModelUtil\",\"CustomerStatusMessage\",\"ChangeModeResponseMessage\",\"ChangeModeMessage\",\"CustomerStatusUpdateMessage\",\"HandShakeMessage\",\"CustomerContact\",\"EvaluateMessage\",\"HandShakeResponseMessage\",\"SuspendMessage\",\"TerminateMessage\",\"IsTypingStatusMessage\",\"InformationNotificationMessage\",\"CommandMessage\",\"ContactNotificationMessage\",\"ProfileNotificationMessage\",\"CommandNotificationMessage\",\"DiscussionNotificationMessage\",\"GroupNotificationMessage\",\"TextMessage\",\"TypingStatusMessage\",\"ReadReceiptMessage\",\"VoiceMessage\",\"RecallCommandMessage\",\"ImageMessage\",\"LocationMessage\",\"RichContentMessage\",\"JrmfRedPacketMessage\",\"JrmfRedPacketOpenedMessage\",\"UnknownMessage\",\"PublicServiceCommandMessage\",\"PublicServiceMultiRichContentMessage\",\"SyncReadStatusMessage\",\"ReadReceiptRequestMessage\",\"ReadReceiptResponseMessage\",\"PublicServiceRichContentMessage\",\"FileMessage\",\"AcceptMessage\",\"RingingMessage\",\"SummaryMessage\",\"HungupMessage\",\"InviteMessage\",\"MediaModifyMessage\",\"MemberModifyMessage\",\"ChannelInfo\",\"UserStatus\",\"MentionedInfo\",\"DeleteMessage\",\"CustomServiceConfig\",\"CustomServiceSession\",\"Conversation\",\"Discussion\",\"Group\",\"Message\",\"MessageTag\",\"PublicServiceMenuItem\",\"PublicServiceProfile\",\"UserInfo\",\"ServerDataProvider\",\"VCDataProvider\",\"MemeoryProvider\",\"LocalStorageProvider\",\"UserDataProvider\",\"FeatureDectector\",\"FeaturePatcher\",\"PublicServiceMap\",\"ConversationMap\",\"CheckParam\",\"LimitableMap\",\"RongAjax\",\"RongUtil\"];\n\n\tvar objects = [\"Qos\",\"Type\",\"MentionedType\",\"MethodType\",\"BlacklistStatus\",\"ConnectionChannel\",\"CustomerType\",\"GetChatRoomType\",\"ConnectionStatus\",\"ConversationNotificationStatus\",\"ConversationType\",\"DiscussionInviteStatus\",\"ErrorCode\",\"VoIPMediaType\",\"MediaType\",\"MessageDirection\",\"FileType\",\"RealTimeLocationErrorCode\",\"RealTimeLocationStatus\",\"ReceivedStatus\",\"SearchType\",\"SentStatus\",\"ConnectionState\"];\n\n\tvar RongIMLib = window.RongIMLib;\n\n\tvar _space = ' \\t \\t \\t \\t';\n\n\tfor(var i=0;i<apiList.length;i++){\n\t\tlet name = apiList[i];\n\t\tlet type = typeof RongIMLib[name];\n\t\tif( _.lastIndexOf(objects,name ) > -1){\n\t\t\tit( \"RongIMLib.\" + name + _space + \" should be object\", function() {\n\t\t        expect(type).toEqual(\"object\");\n\t\t    });\n\t\t}else{\n\t\t\tit( \"RongIMLib.\" + name + _space + \" should be function\", function() {\n\t\t        expect(type).toEqual(\"function\");\n\t\t    });\n\t\t}\t\n\t}\n});"
  },
  {
    "path": "sdk-unitest/im/testcase/2-connect.js",
    "content": "describe(\"init connect\", function() {\n  var RongIMLib = window.RongIMLib;\n\n  var config = window.AppConfig;\n\n  var appKey = config.appKey;\n  var token = config.token;\n  var userId = \"user10\";\n\n  var value = \"\";\n\n  it(\"user10 connect\", function() {\n    runs(function() {\n\t     RongIMLib.RongIMClient.init(appKey);\n\n        var instance = RongIMClient.getInstance();\n\n        // 连接状态监听器\n        RongIMClient.setConnectionStatusListener({\n          onChanged: function (status) {\n            console.log(status);\n              switch (status) {\n                  case RongIMLib.ConnectionStatus.CONNECTED:\n                      break;\n                  }\n          }\n        });\n\n        RongIMClient.setOnReceiveMessageListener({\n          // 接收到的消息\n          onReceived: function (message) {\n              // 判断消息类型\n              // console.log(\"新消息: \" + message.targetId);\n              console.log(message);\n          }\n        });\n\n        //开始链接\n        RongIMClient.connect(token, {\n          onSuccess: function(userId) {\n            value = userId;\n          },\n          onTokenIncorrect: function() {\n          },\n          onError:function(errorCode){\n          }\n        });\n    });\n\n    waitsFor(function() {\n    \treturn value;\n    });\n\n    runs(function() {\n    \texpect(value).toEqual(\"user10\");\n    });\n\n  });\n});"
  },
  {
    "path": "sdk-unitest/im/testcase/3-sendMessage.js",
    "content": "describe(\"Message -> \", function() {\n    var RongIMLib = window.RongIMLib;\n\n    var config = window.AppConfig;\n\n    //current user\n    var appKey = config.appKey;\n    var token = config.token;\n    var userId = \"user10\";\n\n    //TextMessage\n    var textMessage = null;\n    it(\"Send text message\", function() {\n        runs(function() {\n            var instance = RongIMClient.getInstance();\n            var content = {\n              content: [\n                \"阿拉伯语：الشرق الأوسط \",\n                \"希伯来语：המזרח התיכון\",\n                \"emoji: 😊 \",\n                \"希腊字母： π，α，β, \",\n                \"数字单位部分字符 如：× \",\n                \"拉丁文所有字符 如：Ο Ρ σ Ï Æ \",\n                \"拼音所有字符 如： ě ì ň \",\n                \"英文音标部分字符 如 ： ə ʃ \",\n                \"俄文部分字符 如 ：ш ; ⊇ â Œ Š ™ \"\n              ].join(\",\"),\n              user : {\n                \"userId\" : \"this-is-a-test-id\", //不支持中文及特殊字符\n                \"name\" : \"张三\",\n                \"portraitUri\" : \"http://rongcloud.cn/images/newVersion/log_wx.png\"\n              },\n              extra: \"{\\\"key\\\":\\\"value\\\", \\\"key2\\\" : 12, \\\"key3\\\":true}\"\n            };\n\n            var msg = new RongIMLib.TextMessage(content);\n\n        \tvar conversationType = RongIMLib.ConversationType.PRIVATE; // 私聊\n        \tvar targetId = \"user9\";\n\n            instance.sendMessage(conversationType, targetId, msg, {\n                onSuccess: function (_message) {\n                \ttextMessage = _message;\n                },\n                onError: function (errorCode,message) {\n\n                }\n            });\n        });\n\n        waitsFor(function() {\n            return textMessage;\n        });\n\n        runs(function() {\n    \t\texpect(typeof textMessage).toEqual(\"object\");\n    \t\texpect(textMessage.conversationType).toEqual(1);\n    \t\texpect(textMessage.objectName).toEqual(\"RC:TxtMsg\");\n    \t\texpect(textMessage.targetId).toEqual(\"user9\");\n    \t\texpect(textMessage.senderUserId).toEqual(\"user10\");\n        });\n    });\n\n    it(\"Recall mine message\", function() {\n        var recallMessage = null;\n\n        runs(function() {\n            var instance = RongIMClient.getInstance();\n            \n            instance.sendRecallMessage(textMessage, {\n                onSuccess: function (message) {\n                    recallMessage = {\n                        message : message,\n                        result : true\n                    };\n                },\n                onError: function (errorCode,message) {\n                    recallMessage = {\n                        message : message,\n                        errorCode : errorCode,\n                        result : false\n                    }\n                }\n            });\n        });\n\n        waitsFor(function() {\n            return recallMessage;\n        });\n\n        runs(function() {\n            expect(recallMessage.result).toEqual(true);\n        });\n    });\n\n    it(\"Recall mine histroy message\", function() {\n        var recallMessage = null;\n\n        var textMessage = {\n            \"content\": {\n                \"messageName\": \"TextMessage\",\n                \"content\": \"阿拉伯语\",\n                \"extra\": \"{\\\"key\\\":\\\"value\\\", \\\"key2\\\" : 12, \\\"key3\\\":true}\",\n                \"user\": {\n                    \"userId\": \"this-is-a-test-id\",\n                    \"name\": \"张三\",\n                    \"portraitUri\": \"http://rongcloud.cn/images/newVersion/log_wx.png\"\n                }\n            },\n            \"conversationType\": 1,\n            \"objectName\": \"RC:TxtMsg\",\n            \"messageDirection\": 1,\n            \"messageId\": \"1_10450369\",\n            \"receivedStatus\": 1,\n            \"receivedTime\": 1506055578362,\n            \"senderUserId\": \"user10\",\n            \"sentStatus\": 50,\n            \"sentTime\": 1506054257398,\n            \"targetId\": \"\",\n            \"messageType\": \"TextMessage\",\n            \"messageUId\": \"5FAF-L1QU-O43A-D3EE\",\n            \"offLineMessage\": true\n        };\n        \n        runs(function() {\n            var instance = RongIMClient.getInstance();\n            \n            instance.sendRecallMessage(textMessage, {\n                onSuccess: function (message) {\n                    recallMessage = {\n                        message : message,\n                        result : true\n                    };\n                },\n                onError: function (errorCode,message) {\n                    console.log(errorCode)\n                    recallMessage = {\n                        message : message,\n                        errorCode : errorCode,\n                        result : false\n                    }\n                }\n            });\n        });\n\n        waitsFor(function() {\n            return recallMessage;\n        });\n\n        runs(function() {\n            expect(recallMessage.result).toEqual(true);\n        });\n    });  \n\n    it(\"Recall other`s message\", function() {\n        var recallMessage = null;\n\n        var textMessage = {\n            \"content\": {\n                \"messageName\": \"TextMessage\",\n                \"content\": \"文字内容 content\",\n                \"extra\": {\n                    \"name\": \"name\",\n                    \"age\": 12\n                }\n            },\n            \"conversationType\": 1,\n            \"objectName\": \"RC:TxtMsg\",\n            \"messageDirection\": 2,\n            \"messageId\": \"1_10209496\",\n            \"receivedStatus\": 1,\n            \"receivedTime\": 1506055578362,\n            \"senderUserId\": \"user9\",\n            \"sentStatus\": 50,\n            \"sentTime\": 1506054987049,\n            \"targetId\": \"user9\",\n            \"messageType\": \"TextMessage\",\n            \"messageUId\": \"5FAF-NQT5-4772-MAPA\",\n            \"offLineMessage\": true\n        };\n        \n        runs(function() {\n            var instance = RongIMClient.getInstance();\n            \n            instance.sendRecallMessage(textMessage, {\n                onSuccess: function (message) {\n                    recallMessage = {\n                        message : message,\n                        result : true\n                    };\n                },\n                onError: function (errorCode,message) {\n                    recallMessage = {\n                        message : message,\n                        errorCode : errorCode,\n                        result : false\n                    }\n                }\n            });\n        });\n\n        waitsFor(function() {\n            return recallMessage;\n        });\n\n        runs(function() {\n            expect(recallMessage.result).toEqual(false);\n        });\n    });       \n});"
  },
  {
    "path": "sdk-unitest/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Web SDK UnitTest</title>\n<style>\nbody{\n    line-height:2;\n}\nh1{\n    font-size:250%;\n}\nh2{\n    font-size:150%;\n}\n</style>\n</head>\n<body>\n\n<h1>Web SDK 单元测试</h1>\n<ol>\n    <li>IM  <a href=\"./im/run.html\">开始测试</a></li>\n    <li>Emoji   <a href=\"./emoji/run.html\">开始测试</a></li>\n</ol>\n\n<hr>\n\n<h2>目录说明</h2>\n<ol>\n    <li>\n        项目 im/ 、emoji/ 等，每个项目包含 <br> \n        主 sdk 文件 <br> \n        单元测试代码 testcase/ <br> \n        启动页面 run.html\n    </li>\n    <li>单元测试框架代码 jasmine/</li>\n    <li>工具类 libs/underscore.js</li>\n</ol>\n\n<hr>\n\n<h2>参考</h2>\n<ol>\n    <li> jasmine <a href=\"https://jasmine.github.io/api/2.8/global.html#expect\">https://jasmine.github.io/api/2.8/global.html#expect</a> </li>\n    <li> underscorejs <a href=\"http://underscorejs.org/#indexOf\">http://underscorejs.org/#indexOf</a></li>\n</ol>\n</body>\n</html>\n"
  },
  {
    "path": "sdk-unitest/jasmine/1.2.0/jasmine-html.js",
    "content": "jasmine.HtmlReporterHelpers = {};\n\njasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {\n  var el = document.createElement(type);\n\n  for (var i = 2; i < arguments.length; i++) {\n    var child = arguments[i];\n\n    if (typeof child === 'string') {\n      el.appendChild(document.createTextNode(child));\n    } else {\n      if (child) {\n        el.appendChild(child);\n      }\n    }\n  }\n\n  for (var attr in attrs) {\n    if (attr == \"className\") {\n      el[attr] = attrs[attr];\n    } else {\n      el.setAttribute(attr, attrs[attr]);\n    }\n  }\n\n  return el;\n};\n\njasmine.HtmlReporterHelpers.getSpecStatus = function(child) {\n  var results = child.results();\n  var status = results.passed() ? 'passed' : 'failed';\n  if (results.skipped) {\n    status = 'skipped';\n  }\n\n  return status;\n};\n\njasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {\n  var parentDiv = this.dom.summary;\n  var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';\n  var parent = child[parentSuite];\n\n  if (parent) {\n    if (typeof this.views.suites[parent.id] == 'undefined') {\n      this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);\n    }\n    parentDiv = this.views.suites[parent.id].element;\n  }\n\n  parentDiv.appendChild(childElement);\n};\n\n\njasmine.HtmlReporterHelpers.addHelpers = function(ctor) {\n  for(var fn in jasmine.HtmlReporterHelpers) {\n    ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];\n  }\n};\n\njasmine.HtmlReporter = function(_doc) {\n  var self = this;\n  var doc = _doc || window.document;\n\n  var reporterView;\n\n  var dom = {};\n\n  // Jasmine Reporter Public Interface\n  self.logRunningSpecs = false;\n\n  self.reportRunnerStarting = function(runner) {\n    var specs = runner.specs() || [];\n\n    if (specs.length == 0) {\n      return;\n    }\n\n    createReporterDom(runner.env.versionString());\n    doc.body.appendChild(dom.reporter);\n\n    reporterView = new jasmine.HtmlReporter.ReporterView(dom);\n    reporterView.addSpecs(specs, self.specFilter);\n  };\n\n  self.reportRunnerResults = function(runner) {\n    reporterView && reporterView.complete();\n  };\n\n  self.reportSuiteResults = function(suite) {\n    reporterView.suiteComplete(suite);\n  };\n\n  self.reportSpecStarting = function(spec) {\n    if (self.logRunningSpecs) {\n      self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');\n    }\n  };\n\n  self.reportSpecResults = function(spec) {\n    reporterView.specComplete(spec);\n  };\n\n  self.log = function() {\n    var console = jasmine.getGlobal().console;\n    if (console && console.log) {\n      if (console.log.apply) {\n        console.log.apply(console, arguments);\n      } else {\n        console.log(arguments); // ie fix: console.log.apply doesn't exist on ie\n      }\n    }\n  };\n\n  self.specFilter = function(spec) {\n    if (!focusedSpecName()) {\n      return true;\n    }\n\n    return spec.getFullName().indexOf(focusedSpecName()) === 0;\n  };\n\n  return self;\n\n  function focusedSpecName() {\n    var specName;\n\n    (function memoizeFocusedSpec() {\n      if (specName) {\n        return;\n      }\n\n      var paramMap = [];\n      var params = doc.location.search.substring(1).split('&');\n\n      for (var i = 0; i < params.length; i++) {\n        var p = params[i].split('=');\n        paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);\n      }\n\n      specName = paramMap.spec;\n    })();\n\n    return specName;\n  }\n\n  function createReporterDom(version) {\n    dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },\n      dom.banner = self.createDom('div', { className: 'banner' },\n        self.createDom('span', { className: 'title' }, \"Jasmine \"),\n        self.createDom('span', { className: 'version' }, version)),\n\n      dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),\n      dom.alert = self.createDom('div', {className: 'alert'}),\n      dom.results = self.createDom('div', {className: 'results'},\n        dom.summary = self.createDom('div', { className: 'summary' }),\n        dom.details = self.createDom('div', { id: 'details' }))\n    );\n  }\n};\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {\n  this.startedAt = new Date();\n  this.runningSpecCount = 0;\n  this.completeSpecCount = 0;\n  this.passedCount = 0;\n  this.failedCount = 0;\n  this.skippedCount = 0;\n\n  this.createResultsMenu = function() {\n    this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},\n      this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: \"#\"}, '0 specs'),\n      ' | ',\n      this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: \"#\"}, '0 failing'));\n\n    this.summaryMenuItem.onclick = function() {\n      dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');\n    };\n\n    this.detailsMenuItem.onclick = function() {\n      showDetails();\n    };\n  };\n\n  this.addSpecs = function(specs, specFilter) {\n    this.totalSpecCount = specs.length;\n\n    this.views = {\n      specs: {},\n      suites: {}\n    };\n\n    for (var i = 0; i < specs.length; i++) {\n      var spec = specs[i];\n      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);\n      if (specFilter(spec)) {\n        this.runningSpecCount++;\n      }\n    }\n  };\n\n  this.specComplete = function(spec) {\n    this.completeSpecCount++;\n\n    if (isUndefined(this.views.specs[spec.id])) {\n      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);\n    }\n\n    var specView = this.views.specs[spec.id];\n\n    switch (specView.status()) {\n      case 'passed':\n        this.passedCount++;\n        break;\n\n      case 'failed':\n        this.failedCount++;\n        break;\n\n      case 'skipped':\n        this.skippedCount++;\n        break;\n    }\n\n    specView.refresh();\n    this.refresh();\n  };\n\n  this.suiteComplete = function(suite) {\n    var suiteView = this.views.suites[suite.id];\n    if (isUndefined(suiteView)) {\n      return;\n    }\n    suiteView.refresh();\n  };\n\n  this.refresh = function() {\n\n    if (isUndefined(this.resultsMenu)) {\n      this.createResultsMenu();\n    }\n\n    // currently running UI\n    if (isUndefined(this.runningAlert)) {\n      this.runningAlert = this.createDom('a', {href: \"?\", className: \"runningAlert bar\"});\n      dom.alert.appendChild(this.runningAlert);\n    }\n    this.runningAlert.innerHTML = \"Running \" + this.completeSpecCount + \" of \" + specPluralizedFor(this.totalSpecCount);\n\n    // skipped specs UI\n    if (isUndefined(this.skippedAlert)) {\n      this.skippedAlert = this.createDom('a', {href: \"?\", className: \"skippedAlert bar\"});\n    }\n\n    this.skippedAlert.innerHTML = \"Skipping \" + this.skippedCount + \" of \" + specPluralizedFor(this.totalSpecCount) + \" - run all\";\n\n    if (this.skippedCount === 1 && isDefined(dom.alert)) {\n      dom.alert.appendChild(this.skippedAlert);\n    }\n\n    // passing specs UI\n    if (isUndefined(this.passedAlert)) {\n      this.passedAlert = this.createDom('span', {href: \"?\", className: \"passingAlert bar\"});\n    }\n    this.passedAlert.innerHTML = \"Passing \" + specPluralizedFor(this.passedCount);\n\n    // failing specs UI\n    if (isUndefined(this.failedAlert)) {\n      this.failedAlert = this.createDom('span', {href: \"?\", className: \"failingAlert bar\"});\n    }\n    this.failedAlert.innerHTML = \"Failing \" + specPluralizedFor(this.failedCount);\n\n    if (this.failedCount === 1 && isDefined(dom.alert)) {\n      dom.alert.appendChild(this.failedAlert);\n      dom.alert.appendChild(this.resultsMenu);\n    }\n\n    // summary info\n    this.summaryMenuItem.innerHTML = \"\" + specPluralizedFor(this.runningSpecCount);\n    this.detailsMenuItem.innerHTML = \"\" + this.failedCount + \" failing\";\n  };\n\n  this.complete = function() {\n    dom.alert.removeChild(this.runningAlert);\n\n    this.skippedAlert.innerHTML = \"Ran \" + this.runningSpecCount + \" of \" + specPluralizedFor(this.totalSpecCount) + \" - run all\";\n\n    if (this.failedCount === 0) {\n      dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, \"Passing \" + specPluralizedFor(this.passedCount)));\n    } else {\n      showDetails();\n    }\n\n    dom.banner.appendChild(this.createDom('span', {className: 'duration'}, \"finished in \" + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + \"s\"));\n  };\n\n  return this;\n\n  function showDetails() {\n    if (dom.reporter.className.search(/showDetails/) === -1) {\n      dom.reporter.className += \" showDetails\";\n    }\n  }\n\n  function isUndefined(obj) {\n    return typeof obj === 'undefined';\n  }\n\n  function isDefined(obj) {\n    return !isUndefined(obj);\n  }\n\n  function specPluralizedFor(count) {\n    var str = count + \" spec\";\n    if (count > 1) {\n      str += \"s\"\n    }\n    return str;\n  }\n\n};\n\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);\n\n\njasmine.HtmlReporter.SpecView = function(spec, dom, views) {\n  this.spec = spec;\n  this.dom = dom;\n  this.views = views;\n\n  this.symbol = this.createDom('li', { className: 'pending' });\n  this.dom.symbolSummary.appendChild(this.symbol);\n\n  this.summary = this.createDom('div', { className: 'specSummary' },\n      this.createDom('a', {\n        className: 'description',\n        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),\n        title: this.spec.getFullName()\n      }, this.spec.description)\n  );\n\n  this.detail = this.createDom('div', { className: 'specDetail' },\n      this.createDom('a', {\n        className: 'description',\n        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),\n        title: this.spec.getFullName()\n      }, this.spec.getFullName())\n  );\n};\n\njasmine.HtmlReporter.SpecView.prototype.status = function() {\n  return this.getSpecStatus(this.spec);\n};\n\njasmine.HtmlReporter.SpecView.prototype.refresh = function() {\n  this.symbol.className = this.status();\n\n  switch (this.status()) {\n    case 'skipped':\n      break;\n\n    case 'passed':\n      this.appendSummaryToSuiteDiv();\n      break;\n\n    case 'failed':\n      this.appendSummaryToSuiteDiv();\n      this.appendFailureDetail();\n      break;\n  }\n};\n\njasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {\n  this.summary.className += ' ' + this.status();\n  this.appendToSummary(this.spec, this.summary);\n};\n\njasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {\n  this.detail.className += ' ' + this.status();\n\n  var resultItems = this.spec.results().getItems();\n  var messagesDiv = this.createDom('div', { className: 'messages' });\n\n  for (var i = 0; i < resultItems.length; i++) {\n    var result = resultItems[i];\n\n    if (result.type == 'log') {\n      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));\n    } else if (result.type == 'expect' && result.passed && !result.passed()) {\n      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));\n\n      if (result.trace.stack) {\n        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));\n      }\n    }\n  }\n\n  if (messagesDiv.childNodes.length > 0) {\n    this.detail.appendChild(messagesDiv);\n    this.dom.details.appendChild(this.detail);\n  }\n};\n\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {\n  this.suite = suite;\n  this.dom = dom;\n  this.views = views;\n\n  this.element = this.createDom('div', { className: 'suite' },\n      this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)\n  );\n\n  this.appendToSummary(this.suite, this.element);\n};\n\njasmine.HtmlReporter.SuiteView.prototype.status = function() {\n  return this.getSpecStatus(this.suite);\n};\n\njasmine.HtmlReporter.SuiteView.prototype.refresh = function() {\n  this.element.className += \" \" + this.status();\n};\n\njasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);\n\n/* @deprecated Use jasmine.HtmlReporter instead\n */\njasmine.TrivialReporter = function(doc) {\n  this.document = doc || document;\n  this.suiteDivs = {};\n  this.logRunningSpecs = false;\n};\n\njasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {\n  var el = document.createElement(type);\n\n  for (var i = 2; i < arguments.length; i++) {\n    var child = arguments[i];\n\n    if (typeof child === 'string') {\n      el.appendChild(document.createTextNode(child));\n    } else {\n      if (child) { el.appendChild(child); }\n    }\n  }\n\n  for (var attr in attrs) {\n    if (attr == \"className\") {\n      el[attr] = attrs[attr];\n    } else {\n      el.setAttribute(attr, attrs[attr]);\n    }\n  }\n\n  return el;\n};\n\njasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {\n  var showPassed, showSkipped;\n\n  this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },\n      this.createDom('div', { className: 'banner' },\n        this.createDom('div', { className: 'logo' },\n            this.createDom('span', { className: 'title' }, \"Jasmine\"),\n            this.createDom('span', { className: 'version' }, runner.env.versionString())),\n        this.createDom('div', { className: 'options' },\n            \"Show \",\n            showPassed = this.createDom('input', { id: \"__jasmine_TrivialReporter_showPassed__\", type: 'checkbox' }),\n            this.createDom('label', { \"for\": \"__jasmine_TrivialReporter_showPassed__\" }, \" passed \"),\n            showSkipped = this.createDom('input', { id: \"__jasmine_TrivialReporter_showSkipped__\", type: 'checkbox' }),\n            this.createDom('label', { \"for\": \"__jasmine_TrivialReporter_showSkipped__\" }, \" skipped\")\n            )\n          ),\n\n      this.runnerDiv = this.createDom('div', { className: 'runner running' },\n          this.createDom('a', { className: 'run_spec', href: '?' }, \"run all\"),\n          this.runnerMessageSpan = this.createDom('span', {}, \"Running...\"),\n          this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, \"\"))\n      );\n\n  this.document.body.appendChild(this.outerDiv);\n\n  var suites = runner.suites();\n  for (var i = 0; i < suites.length; i++) {\n    var suite = suites[i];\n    var suiteDiv = this.createDom('div', { className: 'suite' },\n        this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, \"run\"),\n        this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));\n    this.suiteDivs[suite.id] = suiteDiv;\n    var parentDiv = this.outerDiv;\n    if (suite.parentSuite) {\n      parentDiv = this.suiteDivs[suite.parentSuite.id];\n    }\n    parentDiv.appendChild(suiteDiv);\n  }\n\n  this.startedAt = new Date();\n\n  var self = this;\n  showPassed.onclick = function(evt) {\n    if (showPassed.checked) {\n      self.outerDiv.className += ' show-passed';\n    } else {\n      self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');\n    }\n  };\n\n  showSkipped.onclick = function(evt) {\n    if (showSkipped.checked) {\n      self.outerDiv.className += ' show-skipped';\n    } else {\n      self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');\n    }\n  };\n};\n\njasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {\n  var results = runner.results();\n  var className = (results.failedCount > 0) ? \"runner failed\" : \"runner passed\";\n  this.runnerDiv.setAttribute(\"class\", className);\n  //do it twice for IE\n  this.runnerDiv.setAttribute(\"className\", className);\n  var specs = runner.specs();\n  var specCount = 0;\n  for (var i = 0; i < specs.length; i++) {\n    if (this.specFilter(specs[i])) {\n      specCount++;\n    }\n  }\n  var message = \"\" + specCount + \" spec\" + (specCount == 1 ? \"\" : \"s\" ) + \", \" + results.failedCount + \" failure\" + ((results.failedCount == 1) ? \"\" : \"s\");\n  message += \" in \" + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + \"s\";\n  this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);\n\n  this.finishedAtSpan.appendChild(document.createTextNode(\"Finished at \" + new Date().toString()));\n};\n\njasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {\n  var results = suite.results();\n  var status = results.passed() ? 'passed' : 'failed';\n  if (results.totalCount === 0) { // todo: change this to check results.skipped\n    status = 'skipped';\n  }\n  this.suiteDivs[suite.id].className += \" \" + status;\n};\n\njasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {\n  if (this.logRunningSpecs) {\n    this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');\n  }\n};\n\njasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {\n  var results = spec.results();\n  var status = results.passed() ? 'passed' : 'failed';\n  if (results.skipped) {\n    status = 'skipped';\n  }\n  var specDiv = this.createDom('div', { className: 'spec '  + status },\n      this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, \"run\"),\n      this.createDom('a', {\n        className: 'description',\n        href: '?spec=' + encodeURIComponent(spec.getFullName()),\n        title: spec.getFullName()\n      }, spec.description));\n\n\n  var resultItems = results.getItems();\n  var messagesDiv = this.createDom('div', { className: 'messages' });\n  for (var i = 0; i < resultItems.length; i++) {\n    var result = resultItems[i];\n\n    if (result.type == 'log') {\n      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));\n    } else if (result.type == 'expect' && result.passed && !result.passed()) {\n      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));\n\n      if (result.trace.stack) {\n        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));\n      }\n    }\n  }\n\n  if (messagesDiv.childNodes.length > 0) {\n    specDiv.appendChild(messagesDiv);\n  }\n\n  this.suiteDivs[spec.suite.id].appendChild(specDiv);\n};\n\njasmine.TrivialReporter.prototype.log = function() {\n  var console = jasmine.getGlobal().console;\n  if (console && console.log) {\n    if (console.log.apply) {\n      console.log.apply(console, arguments);\n    } else {\n      console.log(arguments); // ie fix: console.log.apply doesn't exist on ie\n    }\n  }\n};\n\njasmine.TrivialReporter.prototype.getLocation = function() {\n  return this.document.location;\n};\n\njasmine.TrivialReporter.prototype.specFilter = function(spec) {\n  var paramMap = {};\n  var params = this.getLocation().search.substring(1).split('&');\n  for (var i = 0; i < params.length; i++) {\n    var p = params[i].split('=');\n    paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);\n  }\n\n  if (!paramMap.spec) {\n    return true;\n  }\n  return spec.getFullName().indexOf(paramMap.spec) === 0;\n};\n"
  },
  {
    "path": "sdk-unitest/jasmine/1.2.0/jasmine.css",
    "content": "body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }\n\n#HTMLReporter { font-size: 11px; font-family: Monaco, \"Lucida Console\", monospace; line-height: 14px; color: #333333; }\n#HTMLReporter a { text-decoration: none; }\n#HTMLReporter a:hover { text-decoration: underline; }\n#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }\n#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }\n#HTMLReporter #jasmine_content { position: fixed; right: 100%; }\n#HTMLReporter .version { color: #aaaaaa; }\n#HTMLReporter .banner { margin-top: 14px; }\n#HTMLReporter .duration { color: #aaaaaa; float: right; }\n#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }\n#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }\n#HTMLReporter .symbolSummary li.passed { font-size: 14px; }\n#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: \"\\02022\"; }\n#HTMLReporter .symbolSummary li.failed { line-height: 9px; }\n#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: \"x\"; font-weight: bold; margin-left: -1px; }\n#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }\n#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: \"\\02022\"; }\n#HTMLReporter .symbolSummary li.pending { line-height: 11px; }\n#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: \"-\"; }\n#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }\n#HTMLReporter .runningAlert { background-color: #666666; }\n#HTMLReporter .skippedAlert { background-color: #aaaaaa; }\n#HTMLReporter .skippedAlert:first-child { background-color: #333333; }\n#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }\n#HTMLReporter .passingAlert { background-color: #a6b779; }\n#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }\n#HTMLReporter .failingAlert { background-color: #cf867e; }\n#HTMLReporter .failingAlert:first-child { background-color: #b03911; }\n#HTMLReporter .results { margin-top: 14px; }\n#HTMLReporter #details { display: none; }\n#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }\n#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }\n#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }\n#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }\n#HTMLReporter.showDetails .summary { display: none; }\n#HTMLReporter.showDetails #details { display: block; }\n#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }\n#HTMLReporter .summary { margin-top: 14px; }\n#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }\n#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; white-space:pre;}\n#HTMLReporter .summary .specSummary.failed a { color: #b03911; }\n#HTMLReporter .description + .suite { margin-top: 0; }\n#HTMLReporter .suite { margin-top: 14px; }\n#HTMLReporter .suite a { color: #333333; }\n#HTMLReporter #details .specDetail { margin-bottom: 28px; }\n#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }\n#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }\n#HTMLReporter .resultMessage span.result { display: block; }\n#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }\n\n#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: \"Helvetica Neue Light\", \"Lucida Grande\", \"Calibri\", \"Arial\", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }\n#TrivialReporter a:visited, #TrivialReporter a { color: #303; }\n#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }\n#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }\n#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }\n#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }\n#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }\n#TrivialReporter .runner.running { background-color: yellow; }\n#TrivialReporter .options { text-align: right; font-size: .8em; }\n#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }\n#TrivialReporter .suite .suite { margin: 5px; }\n#TrivialReporter .suite.passed { background-color: #dfd; }\n#TrivialReporter .suite.failed { background-color: #fdd; }\n#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }\n#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }\n#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }\n#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }\n#TrivialReporter .spec.skipped { background-color: #bbb; }\n#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }\n#TrivialReporter .passed { background-color: #cfc; display: none; }\n#TrivialReporter .failed { background-color: #fbb; }\n#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }\n#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }\n#TrivialReporter .resultMessage .mismatch { color: black; }\n#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }\n#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }\n#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }\n#TrivialReporter #jasmine_content { position: fixed; right: 100%; }\n#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }\n"
  },
  {
    "path": "sdk-unitest/jasmine/1.2.0/jasmine.js",
    "content": "var isCommonJS = typeof window == \"undefined\";\n\n/**\n * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.\n *\n * @namespace\n */\nvar jasmine = {};\nif (isCommonJS) exports.jasmine = jasmine;\n/**\n * @private\n */\njasmine.unimplementedMethod_ = function() {\n  throw new Error(\"unimplemented method\");\n};\n\n/**\n * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just\n * a plain old variable and may be redefined by somebody else.\n *\n * @private\n */\njasmine.undefined = jasmine.___undefined___;\n\n/**\n * Show diagnostic messages in the console if set to true\n *\n */\njasmine.VERBOSE = false;\n\n/**\n * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.\n *\n */\njasmine.DEFAULT_UPDATE_INTERVAL = 250;\n\n/**\n * Default timeout interval in milliseconds for waitsFor() blocks.\n */\njasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;\n\njasmine.getGlobal = function() {\n  function getGlobal() {\n    return this;\n  }\n\n  return getGlobal();\n};\n\n/**\n * Allows for bound functions to be compared.  Internal use only.\n *\n * @ignore\n * @private\n * @param base {Object} bound 'this' for the function\n * @param name {Function} function to find\n */\njasmine.bindOriginal_ = function(base, name) {\n  var original = base[name];\n  if (original.apply) {\n    return function() {\n      return original.apply(base, arguments);\n    };\n  } else {\n    // IE support\n    return jasmine.getGlobal()[name];\n  }\n};\n\njasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');\njasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');\njasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');\njasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');\n\njasmine.MessageResult = function(values) {\n  this.type = 'log';\n  this.values = values;\n  this.trace = new Error(); // todo: test better\n};\n\njasmine.MessageResult.prototype.toString = function() {\n  var text = \"\";\n  for (var i = 0; i < this.values.length; i++) {\n    if (i > 0) text += \" \";\n    if (jasmine.isString_(this.values[i])) {\n      text += this.values[i];\n    } else {\n      text += jasmine.pp(this.values[i]);\n    }\n  }\n  return text;\n};\n\njasmine.ExpectationResult = function(params) {\n  this.type = 'expect';\n  this.matcherName = params.matcherName;\n  this.passed_ = params.passed;\n  this.expected = params.expected;\n  this.actual = params.actual;\n  this.message = this.passed_ ? 'Passed.' : params.message;\n\n  var trace = (params.trace || new Error(this.message));\n  this.trace = this.passed_ ? '' : trace;\n};\n\njasmine.ExpectationResult.prototype.toString = function () {\n  return this.message;\n};\n\njasmine.ExpectationResult.prototype.passed = function () {\n  return this.passed_;\n};\n\n/**\n * Getter for the Jasmine environment. Ensures one gets created\n */\njasmine.getEnv = function() {\n  var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();\n  return env;\n};\n\n/**\n * @ignore\n * @private\n * @param value\n * @returns {Boolean}\n */\njasmine.isArray_ = function(value) {\n  return jasmine.isA_(\"Array\", value);\n};\n\n/**\n * @ignore\n * @private\n * @param value\n * @returns {Boolean}\n */\njasmine.isString_ = function(value) {\n  return jasmine.isA_(\"String\", value);\n};\n\n/**\n * @ignore\n * @private\n * @param value\n * @returns {Boolean}\n */\njasmine.isNumber_ = function(value) {\n  return jasmine.isA_(\"Number\", value);\n};\n\n/**\n * @ignore\n * @private\n * @param {String} typeName\n * @param value\n * @returns {Boolean}\n */\njasmine.isA_ = function(typeName, value) {\n  return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';\n};\n\n/**\n * Pretty printer for expecations.  Takes any object and turns it into a human-readable string.\n *\n * @param value {Object} an object to be outputted\n * @returns {String}\n */\njasmine.pp = function(value) {\n  var stringPrettyPrinter = new jasmine.StringPrettyPrinter();\n  stringPrettyPrinter.format(value);\n  return stringPrettyPrinter.string;\n};\n\n/**\n * Returns true if the object is a DOM Node.\n *\n * @param {Object} obj object to check\n * @returns {Boolean}\n */\njasmine.isDomNode = function(obj) {\n  return obj.nodeType > 0;\n};\n\n/**\n * Returns a matchable 'generic' object of the class type.  For use in expecations of type when values don't matter.\n *\n * @example\n * // don't care about which function is passed in, as long as it's a function\n * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));\n *\n * @param {Class} clazz\n * @returns matchable object of the type clazz\n */\njasmine.any = function(clazz) {\n  return new jasmine.Matchers.Any(clazz);\n};\n\n/**\n * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the\n * attributes on the object.\n *\n * @example\n * // don't care about any other attributes than foo.\n * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: \"bar\"});\n *\n * @param sample {Object} sample\n * @returns matchable object for the sample\n */\njasmine.objectContaining = function (sample) {\n    return new jasmine.Matchers.ObjectContaining(sample);\n};\n\n/**\n * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.\n *\n * Spies should be created in test setup, before expectations.  They can then be checked, using the standard Jasmine\n * expectation syntax. Spies can be checked if they were called or not and what the calling params were.\n *\n * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).\n *\n * Spies are torn down at the end of every spec.\n *\n * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.\n *\n * @example\n * // a stub\n * var myStub = jasmine.createSpy('myStub');  // can be used anywhere\n *\n * // spy example\n * var foo = {\n *   not: function(bool) { return !bool; }\n * }\n *\n * // actual foo.not will not be called, execution stops\n * spyOn(foo, 'not');\n\n // foo.not spied upon, execution will continue to implementation\n * spyOn(foo, 'not').andCallThrough();\n *\n * // fake example\n * var foo = {\n *   not: function(bool) { return !bool; }\n * }\n *\n * // foo.not(val) will return val\n * spyOn(foo, 'not').andCallFake(function(value) {return value;});\n *\n * // mock example\n * foo.not(7 == 7);\n * expect(foo.not).toHaveBeenCalled();\n * expect(foo.not).toHaveBeenCalledWith(true);\n *\n * @constructor\n * @see spyOn, jasmine.createSpy, jasmine.createSpyObj\n * @param {String} name\n */\njasmine.Spy = function(name) {\n  /**\n   * The name of the spy, if provided.\n   */\n  this.identity = name || 'unknown';\n  /**\n   *  Is this Object a spy?\n   */\n  this.isSpy = true;\n  /**\n   * The actual function this spy stubs.\n   */\n  this.plan = function() {\n  };\n  /**\n   * Tracking of the most recent call to the spy.\n   * @example\n   * var mySpy = jasmine.createSpy('foo');\n   * mySpy(1, 2);\n   * mySpy.mostRecentCall.args = [1, 2];\n   */\n  this.mostRecentCall = {};\n\n  /**\n   * Holds arguments for each call to the spy, indexed by call count\n   * @example\n   * var mySpy = jasmine.createSpy('foo');\n   * mySpy(1, 2);\n   * mySpy(7, 8);\n   * mySpy.mostRecentCall.args = [7, 8];\n   * mySpy.argsForCall[0] = [1, 2];\n   * mySpy.argsForCall[1] = [7, 8];\n   */\n  this.argsForCall = [];\n  this.calls = [];\n};\n\n/**\n * Tells a spy to call through to the actual implemenatation.\n *\n * @example\n * var foo = {\n *   bar: function() { // do some stuff }\n * }\n *\n * // defining a spy on an existing property: foo.bar\n * spyOn(foo, 'bar').andCallThrough();\n */\njasmine.Spy.prototype.andCallThrough = function() {\n  this.plan = this.originalValue;\n  return this;\n};\n\n/**\n * For setting the return value of a spy.\n *\n * @example\n * // defining a spy from scratch: foo() returns 'baz'\n * var foo = jasmine.createSpy('spy on foo').andReturn('baz');\n *\n * // defining a spy on an existing property: foo.bar() returns 'baz'\n * spyOn(foo, 'bar').andReturn('baz');\n *\n * @param {Object} value\n */\njasmine.Spy.prototype.andReturn = function(value) {\n  this.plan = function() {\n    return value;\n  };\n  return this;\n};\n\n/**\n * For throwing an exception when a spy is called.\n *\n * @example\n * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'\n * var foo = jasmine.createSpy('spy on foo').andThrow('baz');\n *\n * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'\n * spyOn(foo, 'bar').andThrow('baz');\n *\n * @param {String} exceptionMsg\n */\njasmine.Spy.prototype.andThrow = function(exceptionMsg) {\n  this.plan = function() {\n    throw exceptionMsg;\n  };\n  return this;\n};\n\n/**\n * Calls an alternate implementation when a spy is called.\n *\n * @example\n * var baz = function() {\n *   // do some stuff, return something\n * }\n * // defining a spy from scratch: foo() calls the function baz\n * var foo = jasmine.createSpy('spy on foo').andCall(baz);\n *\n * // defining a spy on an existing property: foo.bar() calls an anonymnous function\n * spyOn(foo, 'bar').andCall(function() { return 'baz';} );\n *\n * @param {Function} fakeFunc\n */\njasmine.Spy.prototype.andCallFake = function(fakeFunc) {\n  this.plan = fakeFunc;\n  return this;\n};\n\n/**\n * Resets all of a spy's the tracking variables so that it can be used again.\n *\n * @example\n * spyOn(foo, 'bar');\n *\n * foo.bar();\n *\n * expect(foo.bar.callCount).toEqual(1);\n *\n * foo.bar.reset();\n *\n * expect(foo.bar.callCount).toEqual(0);\n */\njasmine.Spy.prototype.reset = function() {\n  this.wasCalled = false;\n  this.callCount = 0;\n  this.argsForCall = [];\n  this.calls = [];\n  this.mostRecentCall = {};\n};\n\njasmine.createSpy = function(name) {\n\n  var spyObj = function() {\n    spyObj.wasCalled = true;\n    spyObj.callCount++;\n    var args = jasmine.util.argsToArray(arguments);\n    spyObj.mostRecentCall.object = this;\n    spyObj.mostRecentCall.args = args;\n    spyObj.argsForCall.push(args);\n    spyObj.calls.push({object: this, args: args});\n    return spyObj.plan.apply(this, arguments);\n  };\n\n  var spy = new jasmine.Spy(name);\n\n  for (var prop in spy) {\n    spyObj[prop] = spy[prop];\n  }\n\n  spyObj.reset();\n\n  return spyObj;\n};\n\n/**\n * Determines whether an object is a spy.\n *\n * @param {jasmine.Spy|Object} putativeSpy\n * @returns {Boolean}\n */\njasmine.isSpy = function(putativeSpy) {\n  return putativeSpy && putativeSpy.isSpy;\n};\n\n/**\n * Creates a more complicated spy: an Object that has every property a function that is a spy.  Used for stubbing something\n * large in one call.\n *\n * @param {String} baseName name of spy class\n * @param {Array} methodNames array of names of methods to make spies\n */\njasmine.createSpyObj = function(baseName, methodNames) {\n  if (!jasmine.isArray_(methodNames) || methodNames.length === 0) {\n    throw new Error('createSpyObj requires a non-empty array of method names to create spies for');\n  }\n  var obj = {};\n  for (var i = 0; i < methodNames.length; i++) {\n    obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);\n  }\n  return obj;\n};\n\n/**\n * All parameters are pretty-printed and concatenated together, then written to the current spec's output.\n *\n * Be careful not to leave calls to <code>jasmine.log</code> in production code.\n */\njasmine.log = function() {\n  var spec = jasmine.getEnv().currentSpec;\n  spec.log.apply(spec, arguments);\n};\n\n/**\n * Function that installs a spy on an existing object's method name.  Used within a Spec to create a spy.\n *\n * @example\n * // spy example\n * var foo = {\n *   not: function(bool) { return !bool; }\n * }\n * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops\n *\n * @see jasmine.createSpy\n * @param obj\n * @param methodName\n * @returns a Jasmine spy that can be chained with all spy methods\n */\nvar spyOn = function(obj, methodName) {\n  return jasmine.getEnv().currentSpec.spyOn(obj, methodName);\n};\nif (isCommonJS) exports.spyOn = spyOn;\n\n/**\n * Creates a Jasmine spec that will be added to the current suite.\n *\n * // TODO: pending tests\n *\n * @example\n * it('should be true', function() {\n *   expect(true).toEqual(true);\n * });\n *\n * @param {String} desc description of this specification\n * @param {Function} func defines the preconditions and expectations of the spec\n */\nvar it = function(desc, func) {\n  return jasmine.getEnv().it(desc, func);\n};\nif (isCommonJS) exports.it = it;\n\n/**\n * Creates a <em>disabled</em> Jasmine spec.\n *\n * A convenience method that allows existing specs to be disabled temporarily during development.\n *\n * @param {String} desc description of this specification\n * @param {Function} func defines the preconditions and expectations of the spec\n */\nvar xit = function(desc, func) {\n  return jasmine.getEnv().xit(desc, func);\n};\nif (isCommonJS) exports.xit = xit;\n\n/**\n * Starts a chain for a Jasmine expectation.\n *\n * It is passed an Object that is the actual value and should chain to one of the many\n * jasmine.Matchers functions.\n *\n * @param {Object} actual Actual value to test against and expected value\n */\nvar expect = function(actual) {\n  return jasmine.getEnv().currentSpec.expect(actual);\n};\nif (isCommonJS) exports.expect = expect;\n\n/**\n * Defines part of a jasmine spec.  Used in cominbination with waits or waitsFor in asynchrnous specs.\n *\n * @param {Function} func Function that defines part of a jasmine spec.\n */\nvar runs = function(func) {\n  jasmine.getEnv().currentSpec.runs(func);\n};\nif (isCommonJS) exports.runs = runs;\n\n/**\n * Waits a fixed time period before moving to the next block.\n *\n * @deprecated Use waitsFor() instead\n * @param {Number} timeout milliseconds to wait\n */\nvar waits = function(timeout) {\n  jasmine.getEnv().currentSpec.waits(timeout);\n};\nif (isCommonJS) exports.waits = waits;\n\n/**\n * Waits for the latchFunction to return true before proceeding to the next block.\n *\n * @param {Function} latchFunction\n * @param {String} optional_timeoutMessage\n * @param {Number} optional_timeout\n */\nvar waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {\n  jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);\n};\nif (isCommonJS) exports.waitsFor = waitsFor;\n\n/**\n * A function that is called before each spec in a suite.\n *\n * Used for spec setup, including validating assumptions.\n *\n * @param {Function} beforeEachFunction\n */\nvar beforeEach = function(beforeEachFunction) {\n  jasmine.getEnv().beforeEach(beforeEachFunction);\n};\nif (isCommonJS) exports.beforeEach = beforeEach;\n\n/**\n * A function that is called after each spec in a suite.\n *\n * Used for restoring any state that is hijacked during spec execution.\n *\n * @param {Function} afterEachFunction\n */\nvar afterEach = function(afterEachFunction) {\n  jasmine.getEnv().afterEach(afterEachFunction);\n};\nif (isCommonJS) exports.afterEach = afterEach;\n\n/**\n * Defines a suite of specifications.\n *\n * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared\n * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization\n * of setup in some tests.\n *\n * @example\n * // TODO: a simple suite\n *\n * // TODO: a simple suite with a nested describe block\n *\n * @param {String} description A string, usually the class under test.\n * @param {Function} specDefinitions function that defines several specs.\n */\nvar describe = function(description, specDefinitions) {\n  return jasmine.getEnv().describe(description, specDefinitions);\n};\nif (isCommonJS) exports.describe = describe;\n\n/**\n * Disables a suite of specifications.  Used to disable some suites in a file, or files, temporarily during development.\n *\n * @param {String} description A string, usually the class under test.\n * @param {Function} specDefinitions function that defines several specs.\n */\nvar xdescribe = function(description, specDefinitions) {\n  return jasmine.getEnv().xdescribe(description, specDefinitions);\n};\nif (isCommonJS) exports.xdescribe = xdescribe;\n\n\n// Provide the XMLHttpRequest class for IE 5.x-6.x:\njasmine.XmlHttpRequest = (typeof XMLHttpRequest == \"undefined\") ? function() {\n  function tryIt(f) {\n    try {\n      return f();\n    } catch(e) {\n    }\n    return null;\n  }\n\n  var xhr = tryIt(function() {\n    return new ActiveXObject(\"Msxml2.XMLHTTP.6.0\");\n  }) ||\n    tryIt(function() {\n      return new ActiveXObject(\"Msxml2.XMLHTTP.3.0\");\n    }) ||\n    tryIt(function() {\n      return new ActiveXObject(\"Msxml2.XMLHTTP\");\n    }) ||\n    tryIt(function() {\n      return new ActiveXObject(\"Microsoft.XMLHTTP\");\n    });\n\n  if (!xhr) throw new Error(\"This browser does not support XMLHttpRequest.\");\n\n  return xhr;\n} : XMLHttpRequest;\n/**\n * @namespace\n */\njasmine.util = {};\n\n/**\n * Declare that a child class inherit it's prototype from the parent class.\n *\n * @private\n * @param {Function} childClass\n * @param {Function} parentClass\n */\njasmine.util.inherit = function(childClass, parentClass) {\n  /**\n   * @private\n   */\n  var subclass = function() {\n  };\n  subclass.prototype = parentClass.prototype;\n  childClass.prototype = new subclass();\n};\n\njasmine.util.formatException = function(e) {\n  var lineNumber;\n  if (e.line) {\n    lineNumber = e.line;\n  }\n  else if (e.lineNumber) {\n    lineNumber = e.lineNumber;\n  }\n\n  var file;\n\n  if (e.sourceURL) {\n    file = e.sourceURL;\n  }\n  else if (e.fileName) {\n    file = e.fileName;\n  }\n\n  var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();\n\n  if (file && lineNumber) {\n    message += ' in ' + file + ' (line ' + lineNumber + ')';\n  }\n\n  return message;\n};\n\njasmine.util.htmlEscape = function(str) {\n  if (!str) return str;\n  return str.replace(/&/g, '&amp;')\n    .replace(/</g, '&lt;')\n    .replace(/>/g, '&gt;');\n};\n\njasmine.util.argsToArray = function(args) {\n  var arrayOfArgs = [];\n  for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);\n  return arrayOfArgs;\n};\n\njasmine.util.extend = function(destination, source) {\n  for (var property in source) destination[property] = source[property];\n  return destination;\n};\n\n/**\n * Environment for Jasmine\n *\n * @constructor\n */\njasmine.Env = function() {\n  this.currentSpec = null;\n  this.currentSuite = null;\n  this.currentRunner_ = new jasmine.Runner(this);\n\n  this.reporter = new jasmine.MultiReporter();\n\n  this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;\n  this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;\n  this.lastUpdate = 0;\n  this.specFilter = function() {\n    return true;\n  };\n\n  this.nextSpecId_ = 0;\n  this.nextSuiteId_ = 0;\n  this.equalityTesters_ = [];\n\n  // wrap matchers\n  this.matchersClass = function() {\n    jasmine.Matchers.apply(this, arguments);\n  };\n  jasmine.util.inherit(this.matchersClass, jasmine.Matchers);\n\n  jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);\n};\n\n\njasmine.Env.prototype.setTimeout = jasmine.setTimeout;\njasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;\njasmine.Env.prototype.setInterval = jasmine.setInterval;\njasmine.Env.prototype.clearInterval = jasmine.clearInterval;\n\n/**\n * @returns an object containing jasmine version build info, if set.\n */\njasmine.Env.prototype.version = function () {\n  if (jasmine.version_) {\n    return jasmine.version_;\n  } else {\n    throw new Error('Version not set');\n  }\n};\n\n/**\n * @returns string containing jasmine version build info, if set.\n */\njasmine.Env.prototype.versionString = function() {\n  if (!jasmine.version_) {\n    return \"version unknown\";\n  }\n\n  var version = this.version();\n  var versionString = version.major + \".\" + version.minor + \".\" + version.build;\n  if (version.release_candidate) {\n    versionString += \".rc\" + version.release_candidate;\n  }\n  versionString += \" revision \" + version.revision;\n  return versionString;\n};\n\n/**\n * @returns a sequential integer starting at 0\n */\njasmine.Env.prototype.nextSpecId = function () {\n  return this.nextSpecId_++;\n};\n\n/**\n * @returns a sequential integer starting at 0\n */\njasmine.Env.prototype.nextSuiteId = function () {\n  return this.nextSuiteId_++;\n};\n\n/**\n * Register a reporter to receive status updates from Jasmine.\n * @param {jasmine.Reporter} reporter An object which will receive status updates.\n */\njasmine.Env.prototype.addReporter = function(reporter) {\n  this.reporter.addReporter(reporter);\n};\n\njasmine.Env.prototype.execute = function() {\n  this.currentRunner_.execute();\n};\n\njasmine.Env.prototype.describe = function(description, specDefinitions) {\n  var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);\n\n  var parentSuite = this.currentSuite;\n  if (parentSuite) {\n    parentSuite.add(suite);\n  } else {\n    this.currentRunner_.add(suite);\n  }\n\n  this.currentSuite = suite;\n\n  var declarationError = null;\n  try {\n    specDefinitions.call(suite);\n  } catch(e) {\n    declarationError = e;\n  }\n\n  if (declarationError) {\n    this.it(\"encountered a declaration exception\", function() {\n      throw declarationError;\n    });\n  }\n\n  this.currentSuite = parentSuite;\n\n  return suite;\n};\n\njasmine.Env.prototype.beforeEach = function(beforeEachFunction) {\n  if (this.currentSuite) {\n    this.currentSuite.beforeEach(beforeEachFunction);\n  } else {\n    this.currentRunner_.beforeEach(beforeEachFunction);\n  }\n};\n\njasmine.Env.prototype.currentRunner = function () {\n  return this.currentRunner_;\n};\n\njasmine.Env.prototype.afterEach = function(afterEachFunction) {\n  if (this.currentSuite) {\n    this.currentSuite.afterEach(afterEachFunction);\n  } else {\n    this.currentRunner_.afterEach(afterEachFunction);\n  }\n\n};\n\njasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {\n  return {\n    execute: function() {\n    }\n  };\n};\n\njasmine.Env.prototype.it = function(description, func) {\n  var spec = new jasmine.Spec(this, this.currentSuite, description);\n  this.currentSuite.add(spec);\n  this.currentSpec = spec;\n\n  if (func) {\n    spec.runs(func);\n  }\n\n  return spec;\n};\n\njasmine.Env.prototype.xit = function(desc, func) {\n  return {\n    id: this.nextSpecId(),\n    runs: function() {\n    }\n  };\n};\n\njasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {\n  if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {\n    return true;\n  }\n\n  a.__Jasmine_been_here_before__ = b;\n  b.__Jasmine_been_here_before__ = a;\n\n  var hasKey = function(obj, keyName) {\n    return obj !== null && obj[keyName] !== jasmine.undefined;\n  };\n\n  for (var property in b) {\n    if (!hasKey(a, property) && hasKey(b, property)) {\n      mismatchKeys.push(\"expected has key '\" + property + \"', but missing from actual.\");\n    }\n  }\n  for (property in a) {\n    if (!hasKey(b, property) && hasKey(a, property)) {\n      mismatchKeys.push(\"expected missing key '\" + property + \"', but present in actual.\");\n    }\n  }\n  for (property in b) {\n    if (property == '__Jasmine_been_here_before__') continue;\n    if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {\n      mismatchValues.push(\"'\" + property + \"' was '\" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + \"' in expected, but was '\" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + \"' in actual.\");\n    }\n  }\n\n  if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {\n    mismatchValues.push(\"arrays were not the same length\");\n  }\n\n  delete a.__Jasmine_been_here_before__;\n  delete b.__Jasmine_been_here_before__;\n  return (mismatchKeys.length === 0 && mismatchValues.length === 0);\n};\n\njasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {\n  mismatchKeys = mismatchKeys || [];\n  mismatchValues = mismatchValues || [];\n\n  for (var i = 0; i < this.equalityTesters_.length; i++) {\n    var equalityTester = this.equalityTesters_[i];\n    var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);\n    if (result !== jasmine.undefined) return result;\n  }\n\n  if (a === b) return true;\n\n  if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {\n    return (a == jasmine.undefined && b == jasmine.undefined);\n  }\n\n  if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {\n    return a === b;\n  }\n\n  if (a instanceof Date && b instanceof Date) {\n    return a.getTime() == b.getTime();\n  }\n\n  if (a.jasmineMatches) {\n    return a.jasmineMatches(b);\n  }\n\n  if (b.jasmineMatches) {\n    return b.jasmineMatches(a);\n  }\n\n  if (a instanceof jasmine.Matchers.ObjectContaining) {\n    return a.matches(b);\n  }\n\n  if (b instanceof jasmine.Matchers.ObjectContaining) {\n    return b.matches(a);\n  }\n\n  if (jasmine.isString_(a) && jasmine.isString_(b)) {\n    return (a == b);\n  }\n\n  if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {\n    return (a == b);\n  }\n\n  if (typeof a === \"object\" && typeof b === \"object\") {\n    return this.compareObjects_(a, b, mismatchKeys, mismatchValues);\n  }\n\n  //Straight check\n  return (a === b);\n};\n\njasmine.Env.prototype.contains_ = function(haystack, needle) {\n  if (jasmine.isArray_(haystack)) {\n    for (var i = 0; i < haystack.length; i++) {\n      if (this.equals_(haystack[i], needle)) return true;\n    }\n    return false;\n  }\n  return haystack.indexOf(needle) >= 0;\n};\n\njasmine.Env.prototype.addEqualityTester = function(equalityTester) {\n  this.equalityTesters_.push(equalityTester);\n};\n/** No-op base class for Jasmine reporters.\n *\n * @constructor\n */\njasmine.Reporter = function() {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.Reporter.prototype.reportRunnerStarting = function(runner) {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.Reporter.prototype.reportRunnerResults = function(runner) {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.Reporter.prototype.reportSuiteResults = function(suite) {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.Reporter.prototype.reportSpecStarting = function(spec) {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.Reporter.prototype.reportSpecResults = function(spec) {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.Reporter.prototype.log = function(str) {\n};\n\n/**\n * Blocks are functions with executable code that make up a spec.\n *\n * @constructor\n * @param {jasmine.Env} env\n * @param {Function} func\n * @param {jasmine.Spec} spec\n */\njasmine.Block = function(env, func, spec) {\n  this.env = env;\n  this.func = func;\n  this.spec = spec;\n};\n\njasmine.Block.prototype.execute = function(onComplete) {  \n  try {\n    this.func.apply(this.spec);\n  } catch (e) {\n    this.spec.fail(e);\n  }\n  onComplete();\n};\n/** JavaScript API reporter.\n *\n * @constructor\n */\njasmine.JsApiReporter = function() {\n  this.started = false;\n  this.finished = false;\n  this.suites_ = [];\n  this.results_ = {};\n};\n\njasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {\n  this.started = true;\n  var suites = runner.topLevelSuites();\n  for (var i = 0; i < suites.length; i++) {\n    var suite = suites[i];\n    this.suites_.push(this.summarize_(suite));\n  }\n};\n\njasmine.JsApiReporter.prototype.suites = function() {\n  return this.suites_;\n};\n\njasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {\n  var isSuite = suiteOrSpec instanceof jasmine.Suite;\n  var summary = {\n    id: suiteOrSpec.id,\n    name: suiteOrSpec.description,\n    type: isSuite ? 'suite' : 'spec',\n    children: []\n  };\n  \n  if (isSuite) {\n    var children = suiteOrSpec.children();\n    for (var i = 0; i < children.length; i++) {\n      summary.children.push(this.summarize_(children[i]));\n    }\n  }\n  return summary;\n};\n\njasmine.JsApiReporter.prototype.results = function() {\n  return this.results_;\n};\n\njasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {\n  return this.results_[specId];\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {\n  this.finished = true;\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {\n  this.results_[spec.id] = {\n    messages: spec.results().getItems(),\n    result: spec.results().failedCount > 0 ? \"failed\" : \"passed\"\n  };\n};\n\n//noinspection JSUnusedLocalSymbols\njasmine.JsApiReporter.prototype.log = function(str) {\n};\n\njasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){\n  var results = {};\n  for (var i = 0; i < specIds.length; i++) {\n    var specId = specIds[i];\n    results[specId] = this.summarizeResult_(this.results_[specId]);\n  }\n  return results;\n};\n\njasmine.JsApiReporter.prototype.summarizeResult_ = function(result){\n  var summaryMessages = [];\n  var messagesLength = result.messages.length;\n  for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {\n    var resultMessage = result.messages[messageIndex];\n    summaryMessages.push({\n      text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,\n      passed: resultMessage.passed ? resultMessage.passed() : true,\n      type: resultMessage.type,\n      message: resultMessage.message,\n      trace: {\n        stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined\n      }\n    });\n  }\n\n  return {\n    result : result.result,\n    messages : summaryMessages\n  };\n};\n\n/**\n * @constructor\n * @param {jasmine.Env} env\n * @param actual\n * @param {jasmine.Spec} spec\n */\njasmine.Matchers = function(env, actual, spec, opt_isNot) {\n  this.env = env;\n  this.actual = actual;\n  this.spec = spec;\n  this.isNot = opt_isNot || false;\n  this.reportWasCalled_ = false;\n};\n\n// todo: @deprecated as of Jasmine 0.11, remove soon [xw]\njasmine.Matchers.pp = function(str) {\n  throw new Error(\"jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!\");\n};\n\n// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]\njasmine.Matchers.prototype.report = function(result, failing_message, details) {\n  throw new Error(\"As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs\");\n};\n\njasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {\n  for (var methodName in prototype) {\n    if (methodName == 'report') continue;\n    var orig = prototype[methodName];\n    matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);\n  }\n};\n\njasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {\n  return function() {\n    var matcherArgs = jasmine.util.argsToArray(arguments);\n    var result = matcherFunction.apply(this, arguments);\n\n    if (this.isNot) {\n      result = !result;\n    }\n\n    if (this.reportWasCalled_) return result;\n\n    var message;\n    if (!result) {\n      if (this.message) {\n        message = this.message.apply(this, arguments);\n        if (jasmine.isArray_(message)) {\n          message = message[this.isNot ? 1 : 0];\n        }\n      } else {\n        var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });\n        message = \"Expected \" + jasmine.pp(this.actual) + (this.isNot ? \" not \" : \" \") + englishyPredicate;\n        if (matcherArgs.length > 0) {\n          for (var i = 0; i < matcherArgs.length; i++) {\n            if (i > 0) message += \",\";\n            message += \" \" + jasmine.pp(matcherArgs[i]);\n          }\n        }\n        message += \".\";\n      }\n    }\n    var expectationResult = new jasmine.ExpectationResult({\n      matcherName: matcherName,\n      passed: result,\n      expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],\n      actual: this.actual,\n      message: message\n    });\n    this.spec.addMatcherResult(expectationResult);\n    return jasmine.undefined;\n  };\n};\n\n\n\n\n/**\n * toBe: compares the actual to the expected using ===\n * @param expected\n */\njasmine.Matchers.prototype.toBe = function(expected) {\n  return this.actual === expected;\n};\n\n/**\n * toNotBe: compares the actual to the expected using !==\n * @param expected\n * @deprecated as of 1.0. Use not.toBe() instead.\n */\njasmine.Matchers.prototype.toNotBe = function(expected) {\n  return this.actual !== expected;\n};\n\n/**\n * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.\n *\n * @param expected\n */\njasmine.Matchers.prototype.toEqual = function(expected) {\n  return this.env.equals_(this.actual, expected);\n};\n\n/**\n * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual\n * @param expected\n * @deprecated as of 1.0. Use not.toEqual() instead.\n */\njasmine.Matchers.prototype.toNotEqual = function(expected) {\n  return !this.env.equals_(this.actual, expected);\n};\n\n/**\n * Matcher that compares the actual to the expected using a regular expression.  Constructs a RegExp, so takes\n * a pattern or a String.\n *\n * @param expected\n */\njasmine.Matchers.prototype.toMatch = function(expected) {\n  return new RegExp(expected).test(this.actual);\n};\n\n/**\n * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch\n * @param expected\n * @deprecated as of 1.0. Use not.toMatch() instead.\n */\njasmine.Matchers.prototype.toNotMatch = function(expected) {\n  return !(new RegExp(expected).test(this.actual));\n};\n\n/**\n * Matcher that compares the actual to jasmine.undefined.\n */\njasmine.Matchers.prototype.toBeDefined = function() {\n  return (this.actual !== jasmine.undefined);\n};\n\n/**\n * Matcher that compares the actual to jasmine.undefined.\n */\njasmine.Matchers.prototype.toBeUndefined = function() {\n  return (this.actual === jasmine.undefined);\n};\n\n/**\n * Matcher that compares the actual to null.\n */\njasmine.Matchers.prototype.toBeNull = function() {\n  return (this.actual === null);\n};\n\n/**\n * Matcher that boolean not-nots the actual.\n */\njasmine.Matchers.prototype.toBeTruthy = function() {\n  return !!this.actual;\n};\n\n\n/**\n * Matcher that boolean nots the actual.\n */\njasmine.Matchers.prototype.toBeFalsy = function() {\n  return !this.actual;\n};\n\n\n/**\n * Matcher that checks to see if the actual, a Jasmine spy, was called.\n */\njasmine.Matchers.prototype.toHaveBeenCalled = function() {\n  if (arguments.length > 0) {\n    throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');\n  }\n\n  if (!jasmine.isSpy(this.actual)) {\n    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');\n  }\n\n  this.message = function() {\n    return [\n      \"Expected spy \" + this.actual.identity + \" to have been called.\",\n      \"Expected spy \" + this.actual.identity + \" not to have been called.\"\n    ];\n  };\n\n  return this.actual.wasCalled;\n};\n\n/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */\njasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;\n\n/**\n * Matcher that checks to see if the actual, a Jasmine spy, was not called.\n *\n * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead\n */\njasmine.Matchers.prototype.wasNotCalled = function() {\n  if (arguments.length > 0) {\n    throw new Error('wasNotCalled does not take arguments');\n  }\n\n  if (!jasmine.isSpy(this.actual)) {\n    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');\n  }\n\n  this.message = function() {\n    return [\n      \"Expected spy \" + this.actual.identity + \" to not have been called.\",\n      \"Expected spy \" + this.actual.identity + \" to have been called.\"\n    ];\n  };\n\n  return !this.actual.wasCalled;\n};\n\n/**\n * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.\n *\n * @example\n *\n */\njasmine.Matchers.prototype.toHaveBeenCalledWith = function() {\n  var expectedArgs = jasmine.util.argsToArray(arguments);\n  if (!jasmine.isSpy(this.actual)) {\n    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');\n  }\n  this.message = function() {\n    if (this.actual.callCount === 0) {\n      // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]\n      return [\n        \"Expected spy \" + this.actual.identity + \" to have been called with \" + jasmine.pp(expectedArgs) + \" but it was never called.\",\n        \"Expected spy \" + this.actual.identity + \" not to have been called with \" + jasmine.pp(expectedArgs) + \" but it was.\"\n      ];\n    } else {\n      return [\n        \"Expected spy \" + this.actual.identity + \" to have been called with \" + jasmine.pp(expectedArgs) + \" but was called with \" + jasmine.pp(this.actual.argsForCall),\n        \"Expected spy \" + this.actual.identity + \" not to have been called with \" + jasmine.pp(expectedArgs) + \" but was called with \" + jasmine.pp(this.actual.argsForCall)\n      ];\n    }\n  };\n\n  return this.env.contains_(this.actual.argsForCall, expectedArgs);\n};\n\n/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */\njasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;\n\n/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */\njasmine.Matchers.prototype.wasNotCalledWith = function() {\n  var expectedArgs = jasmine.util.argsToArray(arguments);\n  if (!jasmine.isSpy(this.actual)) {\n    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');\n  }\n\n  this.message = function() {\n    return [\n      \"Expected spy not to have been called with \" + jasmine.pp(expectedArgs) + \" but it was\",\n      \"Expected spy to have been called with \" + jasmine.pp(expectedArgs) + \" but it was\"\n    ];\n  };\n\n  return !this.env.contains_(this.actual.argsForCall, expectedArgs);\n};\n\n/**\n * Matcher that checks that the expected item is an element in the actual Array.\n *\n * @param {Object} expected\n */\njasmine.Matchers.prototype.toContain = function(expected) {\n  return this.env.contains_(this.actual, expected);\n};\n\n/**\n * Matcher that checks that the expected item is NOT an element in the actual Array.\n *\n * @param {Object} expected\n * @deprecated as of 1.0. Use not.toContain() instead.\n */\njasmine.Matchers.prototype.toNotContain = function(expected) {\n  return !this.env.contains_(this.actual, expected);\n};\n\njasmine.Matchers.prototype.toBeLessThan = function(expected) {\n  return this.actual < expected;\n};\n\njasmine.Matchers.prototype.toBeGreaterThan = function(expected) {\n  return this.actual > expected;\n};\n\n/**\n * Matcher that checks that the expected item is equal to the actual item\n * up to a given level of decimal precision (default 2).\n *\n * @param {Number} expected\n * @param {Number} precision\n */\njasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {\n  if (!(precision === 0)) {\n    precision = precision || 2;\n  }\n  var multiplier = Math.pow(10, precision);\n  var actual = Math.round(this.actual * multiplier);\n  expected = Math.round(expected * multiplier);\n  return expected == actual;\n};\n\n/**\n * Matcher that checks that the expected exception was thrown by the actual.\n *\n * @param {String} expected\n */\njasmine.Matchers.prototype.toThrow = function(expected) {\n  var result = false;\n  var exception;\n  if (typeof this.actual != 'function') {\n    throw new Error('Actual is not a function');\n  }\n  try {\n    this.actual();\n  } catch (e) {\n    exception = e;\n  }\n  if (exception) {\n    result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));\n  }\n\n  var not = this.isNot ? \"not \" : \"\";\n\n  this.message = function() {\n    if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {\n      return [\"Expected function \" + not + \"to throw\", expected ? expected.message || expected : \"an exception\", \", but it threw\", exception.message || exception].join(' ');\n    } else {\n      return \"Expected function to throw an exception.\";\n    }\n  };\n\n  return result;\n};\n\njasmine.Matchers.Any = function(expectedClass) {\n  this.expectedClass = expectedClass;\n};\n\njasmine.Matchers.Any.prototype.jasmineMatches = function(other) {\n  if (this.expectedClass == String) {\n    return typeof other == 'string' || other instanceof String;\n  }\n\n  if (this.expectedClass == Number) {\n    return typeof other == 'number' || other instanceof Number;\n  }\n\n  if (this.expectedClass == Function) {\n    return typeof other == 'function' || other instanceof Function;\n  }\n\n  if (this.expectedClass == Object) {\n    return typeof other == 'object';\n  }\n\n  return other instanceof this.expectedClass;\n};\n\njasmine.Matchers.Any.prototype.jasmineToString = function() {\n  return '<jasmine.any(' + this.expectedClass + ')>';\n};\n\njasmine.Matchers.ObjectContaining = function (sample) {\n  this.sample = sample;\n};\n\njasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {\n  mismatchKeys = mismatchKeys || [];\n  mismatchValues = mismatchValues || [];\n\n  var env = jasmine.getEnv();\n\n  var hasKey = function(obj, keyName) {\n    return obj != null && obj[keyName] !== jasmine.undefined;\n  };\n\n  for (var property in this.sample) {\n    if (!hasKey(other, property) && hasKey(this.sample, property)) {\n      mismatchKeys.push(\"expected has key '\" + property + \"', but missing from actual.\");\n    }\n    else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {\n      mismatchValues.push(\"'\" + property + \"' was '\" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + \"' in expected, but was '\" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + \"' in actual.\");\n    }\n  }\n\n  return (mismatchKeys.length === 0 && mismatchValues.length === 0);\n};\n\njasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {\n  return \"<jasmine.objectContaining(\" + jasmine.pp(this.sample) + \")>\";\n};\n// Mock setTimeout, clearTimeout\n// Contributed by Pivotal Computer Systems, www.pivotalsf.com\n\njasmine.FakeTimer = function() {\n  this.reset();\n\n  var self = this;\n  self.setTimeout = function(funcToCall, millis) {\n    self.timeoutsMade++;\n    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);\n    return self.timeoutsMade;\n  };\n\n  self.setInterval = function(funcToCall, millis) {\n    self.timeoutsMade++;\n    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);\n    return self.timeoutsMade;\n  };\n\n  self.clearTimeout = function(timeoutKey) {\n    self.scheduledFunctions[timeoutKey] = jasmine.undefined;\n  };\n\n  self.clearInterval = function(timeoutKey) {\n    self.scheduledFunctions[timeoutKey] = jasmine.undefined;\n  };\n\n};\n\njasmine.FakeTimer.prototype.reset = function() {\n  this.timeoutsMade = 0;\n  this.scheduledFunctions = {};\n  this.nowMillis = 0;\n};\n\njasmine.FakeTimer.prototype.tick = function(millis) {\n  var oldMillis = this.nowMillis;\n  var newMillis = oldMillis + millis;\n  this.runFunctionsWithinRange(oldMillis, newMillis);\n  this.nowMillis = newMillis;\n};\n\njasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {\n  var scheduledFunc;\n  var funcsToRun = [];\n  for (var timeoutKey in this.scheduledFunctions) {\n    scheduledFunc = this.scheduledFunctions[timeoutKey];\n    if (scheduledFunc != jasmine.undefined &&\n        scheduledFunc.runAtMillis >= oldMillis &&\n        scheduledFunc.runAtMillis <= nowMillis) {\n      funcsToRun.push(scheduledFunc);\n      this.scheduledFunctions[timeoutKey] = jasmine.undefined;\n    }\n  }\n\n  if (funcsToRun.length > 0) {\n    funcsToRun.sort(function(a, b) {\n      return a.runAtMillis - b.runAtMillis;\n    });\n    for (var i = 0; i < funcsToRun.length; ++i) {\n      try {\n        var funcToRun = funcsToRun[i];\n        this.nowMillis = funcToRun.runAtMillis;\n        funcToRun.funcToCall();\n        if (funcToRun.recurring) {\n          this.scheduleFunction(funcToRun.timeoutKey,\n              funcToRun.funcToCall,\n              funcToRun.millis,\n              true);\n        }\n      } catch(e) {\n      }\n    }\n    this.runFunctionsWithinRange(oldMillis, nowMillis);\n  }\n};\n\njasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {\n  this.scheduledFunctions[timeoutKey] = {\n    runAtMillis: this.nowMillis + millis,\n    funcToCall: funcToCall,\n    recurring: recurring,\n    timeoutKey: timeoutKey,\n    millis: millis\n  };\n};\n\n/**\n * @namespace\n */\njasmine.Clock = {\n  defaultFakeTimer: new jasmine.FakeTimer(),\n\n  reset: function() {\n    jasmine.Clock.assertInstalled();\n    jasmine.Clock.defaultFakeTimer.reset();\n  },\n\n  tick: function(millis) {\n    jasmine.Clock.assertInstalled();\n    jasmine.Clock.defaultFakeTimer.tick(millis);\n  },\n\n  runFunctionsWithinRange: function(oldMillis, nowMillis) {\n    jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);\n  },\n\n  scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {\n    jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);\n  },\n\n  useMock: function() {\n    if (!jasmine.Clock.isInstalled()) {\n      var spec = jasmine.getEnv().currentSpec;\n      spec.after(jasmine.Clock.uninstallMock);\n\n      jasmine.Clock.installMock();\n    }\n  },\n\n  installMock: function() {\n    jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;\n  },\n\n  uninstallMock: function() {\n    jasmine.Clock.assertInstalled();\n    jasmine.Clock.installed = jasmine.Clock.real;\n  },\n\n  real: {\n    setTimeout: jasmine.getGlobal().setTimeout,\n    clearTimeout: jasmine.getGlobal().clearTimeout,\n    setInterval: jasmine.getGlobal().setInterval,\n    clearInterval: jasmine.getGlobal().clearInterval\n  },\n\n  assertInstalled: function() {\n    if (!jasmine.Clock.isInstalled()) {\n      throw new Error(\"Mock clock is not installed, use jasmine.Clock.useMock()\");\n    }\n  },\n\n  isInstalled: function() {\n    return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;\n  },\n\n  installed: null\n};\njasmine.Clock.installed = jasmine.Clock.real;\n\n//else for IE support\njasmine.getGlobal().setTimeout = function(funcToCall, millis) {\n  if (jasmine.Clock.installed.setTimeout.apply) {\n    return jasmine.Clock.installed.setTimeout.apply(this, arguments);\n  } else {\n    return jasmine.Clock.installed.setTimeout(funcToCall, millis);\n  }\n};\n\njasmine.getGlobal().setInterval = function(funcToCall, millis) {\n  if (jasmine.Clock.installed.setInterval.apply) {\n    return jasmine.Clock.installed.setInterval.apply(this, arguments);\n  } else {\n    return jasmine.Clock.installed.setInterval(funcToCall, millis);\n  }\n};\n\njasmine.getGlobal().clearTimeout = function(timeoutKey) {\n  if (jasmine.Clock.installed.clearTimeout.apply) {\n    return jasmine.Clock.installed.clearTimeout.apply(this, arguments);\n  } else {\n    return jasmine.Clock.installed.clearTimeout(timeoutKey);\n  }\n};\n\njasmine.getGlobal().clearInterval = function(timeoutKey) {\n  if (jasmine.Clock.installed.clearTimeout.apply) {\n    return jasmine.Clock.installed.clearInterval.apply(this, arguments);\n  } else {\n    return jasmine.Clock.installed.clearInterval(timeoutKey);\n  }\n};\n\n/**\n * @constructor\n */\njasmine.MultiReporter = function() {\n  this.subReporters_ = [];\n};\njasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);\n\njasmine.MultiReporter.prototype.addReporter = function(reporter) {\n  this.subReporters_.push(reporter);\n};\n\n(function() {\n  var functionNames = [\n    \"reportRunnerStarting\",\n    \"reportRunnerResults\",\n    \"reportSuiteResults\",\n    \"reportSpecStarting\",\n    \"reportSpecResults\",\n    \"log\"\n  ];\n  for (var i = 0; i < functionNames.length; i++) {\n    var functionName = functionNames[i];\n    jasmine.MultiReporter.prototype[functionName] = (function(functionName) {\n      return function() {\n        for (var j = 0; j < this.subReporters_.length; j++) {\n          var subReporter = this.subReporters_[j];\n          if (subReporter[functionName]) {\n            subReporter[functionName].apply(subReporter, arguments);\n          }\n        }\n      };\n    })(functionName);\n  }\n})();\n/**\n * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults\n *\n * @constructor\n */\njasmine.NestedResults = function() {\n  /**\n   * The total count of results\n   */\n  this.totalCount = 0;\n  /**\n   * Number of passed results\n   */\n  this.passedCount = 0;\n  /**\n   * Number of failed results\n   */\n  this.failedCount = 0;\n  /**\n   * Was this suite/spec skipped?\n   */\n  this.skipped = false;\n  /**\n   * @ignore\n   */\n  this.items_ = [];\n};\n\n/**\n * Roll up the result counts.\n *\n * @param result\n */\njasmine.NestedResults.prototype.rollupCounts = function(result) {\n  this.totalCount += result.totalCount;\n  this.passedCount += result.passedCount;\n  this.failedCount += result.failedCount;\n};\n\n/**\n * Adds a log message.\n * @param values Array of message parts which will be concatenated later.\n */\njasmine.NestedResults.prototype.log = function(values) {\n  this.items_.push(new jasmine.MessageResult(values));\n};\n\n/**\n * Getter for the results: message & results.\n */\njasmine.NestedResults.prototype.getItems = function() {\n  return this.items_;\n};\n\n/**\n * Adds a result, tracking counts (total, passed, & failed)\n * @param {jasmine.ExpectationResult|jasmine.NestedResults} result\n */\njasmine.NestedResults.prototype.addResult = function(result) {\n  if (result.type != 'log') {\n    if (result.items_) {\n      this.rollupCounts(result);\n    } else {\n      this.totalCount++;\n      if (result.passed()) {\n        this.passedCount++;\n      } else {\n        this.failedCount++;\n      }\n    }\n  }\n  this.items_.push(result);\n};\n\n/**\n * @returns {Boolean} True if <b>everything</b> below passed\n */\njasmine.NestedResults.prototype.passed = function() {\n  return this.passedCount === this.totalCount;\n};\n/**\n * Base class for pretty printing for expectation results.\n */\njasmine.PrettyPrinter = function() {\n  this.ppNestLevel_ = 0;\n};\n\n/**\n * Formats a value in a nice, human-readable string.\n *\n * @param value\n */\njasmine.PrettyPrinter.prototype.format = function(value) {\n  if (this.ppNestLevel_ > 40) {\n    throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');\n  }\n\n  this.ppNestLevel_++;\n  try {\n    if (value === jasmine.undefined) {\n      this.emitScalar('undefined');\n    } else if (value === null) {\n      this.emitScalar('null');\n    } else if (value === jasmine.getGlobal()) {\n      this.emitScalar('<global>');\n    } else if (value.jasmineToString) {\n      this.emitScalar(value.jasmineToString());\n    } else if (typeof value === 'string') {\n      this.emitString(value);\n    } else if (jasmine.isSpy(value)) {\n      this.emitScalar(\"spy on \" + value.identity);\n    } else if (value instanceof RegExp) {\n      this.emitScalar(value.toString());\n    } else if (typeof value === 'function') {\n      this.emitScalar('Function');\n    } else if (typeof value.nodeType === 'number') {\n      this.emitScalar('HTMLNode');\n    } else if (value instanceof Date) {\n      this.emitScalar('Date(' + value + ')');\n    } else if (value.__Jasmine_been_here_before__) {\n      this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');\n    } else if (jasmine.isArray_(value) || typeof value == 'object') {\n      value.__Jasmine_been_here_before__ = true;\n      if (jasmine.isArray_(value)) {\n        this.emitArray(value);\n      } else {\n        this.emitObject(value);\n      }\n      delete value.__Jasmine_been_here_before__;\n    } else {\n      this.emitScalar(value.toString());\n    }\n  } finally {\n    this.ppNestLevel_--;\n  }\n};\n\njasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {\n  for (var property in obj) {\n    if (property == '__Jasmine_been_here_before__') continue;\n    fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && \n                                         obj.__lookupGetter__(property) !== null) : false);\n  }\n};\n\njasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;\njasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;\njasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;\njasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;\n\njasmine.StringPrettyPrinter = function() {\n  jasmine.PrettyPrinter.call(this);\n\n  this.string = '';\n};\njasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);\n\njasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {\n  this.append(value);\n};\n\njasmine.StringPrettyPrinter.prototype.emitString = function(value) {\n  this.append(\"'\" + value + \"'\");\n};\n\njasmine.StringPrettyPrinter.prototype.emitArray = function(array) {\n  this.append('[ ');\n  for (var i = 0; i < array.length; i++) {\n    if (i > 0) {\n      this.append(', ');\n    }\n    this.format(array[i]);\n  }\n  this.append(' ]');\n};\n\njasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {\n  var self = this;\n  this.append('{ ');\n  var first = true;\n\n  this.iterateObject(obj, function(property, isGetter) {\n    if (first) {\n      first = false;\n    } else {\n      self.append(', ');\n    }\n\n    self.append(property);\n    self.append(' : ');\n    if (isGetter) {\n      self.append('<getter>');\n    } else {\n      self.format(obj[property]);\n    }\n  });\n\n  this.append(' }');\n};\n\njasmine.StringPrettyPrinter.prototype.append = function(value) {\n  this.string += value;\n};\njasmine.Queue = function(env) {\n  this.env = env;\n  this.blocks = [];\n  this.running = false;\n  this.index = 0;\n  this.offset = 0;\n  this.abort = false;\n};\n\njasmine.Queue.prototype.addBefore = function(block) {\n  this.blocks.unshift(block);\n};\n\njasmine.Queue.prototype.add = function(block) {\n  this.blocks.push(block);\n};\n\njasmine.Queue.prototype.insertNext = function(block) {\n  this.blocks.splice((this.index + this.offset + 1), 0, block);\n  this.offset++;\n};\n\njasmine.Queue.prototype.start = function(onComplete) {\n  this.running = true;\n  this.onComplete = onComplete;\n  this.next_();\n};\n\njasmine.Queue.prototype.isRunning = function() {\n  return this.running;\n};\n\njasmine.Queue.LOOP_DONT_RECURSE = true;\n\njasmine.Queue.prototype.next_ = function() {\n  var self = this;\n  var goAgain = true;\n\n  while (goAgain) {\n    goAgain = false;\n    \n    if (self.index < self.blocks.length && !this.abort) {\n      var calledSynchronously = true;\n      var completedSynchronously = false;\n\n      var onComplete = function () {\n        if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {\n          completedSynchronously = true;\n          return;\n        }\n\n        if (self.blocks[self.index].abort) {\n          self.abort = true;\n        }\n\n        self.offset = 0;\n        self.index++;\n\n        var now = new Date().getTime();\n        if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {\n          self.env.lastUpdate = now;\n          self.env.setTimeout(function() {\n            self.next_();\n          }, 0);\n        } else {\n          if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {\n            goAgain = true;\n          } else {\n            self.next_();\n          }\n        }\n      };\n      self.blocks[self.index].execute(onComplete);\n\n      calledSynchronously = false;\n      if (completedSynchronously) {\n        onComplete();\n      }\n      \n    } else {\n      self.running = false;\n      if (self.onComplete) {\n        self.onComplete();\n      }\n    }\n  }\n};\n\njasmine.Queue.prototype.results = function() {\n  var results = new jasmine.NestedResults();\n  for (var i = 0; i < this.blocks.length; i++) {\n    if (this.blocks[i].results) {\n      results.addResult(this.blocks[i].results());\n    }\n  }\n  return results;\n};\n\n\n/**\n * Runner\n *\n * @constructor\n * @param {jasmine.Env} env\n */\njasmine.Runner = function(env) {\n  var self = this;\n  self.env = env;\n  self.queue = new jasmine.Queue(env);\n  self.before_ = [];\n  self.after_ = [];\n  self.suites_ = [];\n};\n\njasmine.Runner.prototype.execute = function() {\n  var self = this;\n  if (self.env.reporter.reportRunnerStarting) {\n    self.env.reporter.reportRunnerStarting(this);\n  }\n  self.queue.start(function () {\n    self.finishCallback();\n  });\n};\n\njasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {\n  beforeEachFunction.typeName = 'beforeEach';\n  this.before_.splice(0,0,beforeEachFunction);\n};\n\njasmine.Runner.prototype.afterEach = function(afterEachFunction) {\n  afterEachFunction.typeName = 'afterEach';\n  this.after_.splice(0,0,afterEachFunction);\n};\n\n\njasmine.Runner.prototype.finishCallback = function() {\n  this.env.reporter.reportRunnerResults(this);\n};\n\njasmine.Runner.prototype.addSuite = function(suite) {\n  this.suites_.push(suite);\n};\n\njasmine.Runner.prototype.add = function(block) {\n  if (block instanceof jasmine.Suite) {\n    this.addSuite(block);\n  }\n  this.queue.add(block);\n};\n\njasmine.Runner.prototype.specs = function () {\n  var suites = this.suites();\n  var specs = [];\n  for (var i = 0; i < suites.length; i++) {\n    specs = specs.concat(suites[i].specs());\n  }\n  return specs;\n};\n\njasmine.Runner.prototype.suites = function() {\n  return this.suites_;\n};\n\njasmine.Runner.prototype.topLevelSuites = function() {\n  var topLevelSuites = [];\n  for (var i = 0; i < this.suites_.length; i++) {\n    if (!this.suites_[i].parentSuite) {\n      topLevelSuites.push(this.suites_[i]);\n    }\n  }\n  return topLevelSuites;\n};\n\njasmine.Runner.prototype.results = function() {\n  return this.queue.results();\n};\n/**\n * Internal representation of a Jasmine specification, or test.\n *\n * @constructor\n * @param {jasmine.Env} env\n * @param {jasmine.Suite} suite\n * @param {String} description\n */\njasmine.Spec = function(env, suite, description) {\n  if (!env) {\n    throw new Error('jasmine.Env() required');\n  }\n  if (!suite) {\n    throw new Error('jasmine.Suite() required');\n  }\n  var spec = this;\n  spec.id = env.nextSpecId ? env.nextSpecId() : null;\n  spec.env = env;\n  spec.suite = suite;\n  spec.description = description;\n  spec.queue = new jasmine.Queue(env);\n\n  spec.afterCallbacks = [];\n  spec.spies_ = [];\n\n  spec.results_ = new jasmine.NestedResults();\n  spec.results_.description = description;\n  spec.matchersClass = null;\n};\n\njasmine.Spec.prototype.getFullName = function() {\n  return this.suite.getFullName() + ' ' + this.description + '.';\n};\n\n\njasmine.Spec.prototype.results = function() {\n  return this.results_;\n};\n\n/**\n * All parameters are pretty-printed and concatenated together, then written to the spec's output.\n *\n * Be careful not to leave calls to <code>jasmine.log</code> in production code.\n */\njasmine.Spec.prototype.log = function() {\n  return this.results_.log(arguments);\n};\n\njasmine.Spec.prototype.runs = function (func) {\n  var block = new jasmine.Block(this.env, func, this);\n  this.addToQueue(block);\n  return this;\n};\n\njasmine.Spec.prototype.addToQueue = function (block) {\n  if (this.queue.isRunning()) {\n    this.queue.insertNext(block);\n  } else {\n    this.queue.add(block);\n  }\n};\n\n/**\n * @param {jasmine.ExpectationResult} result\n */\njasmine.Spec.prototype.addMatcherResult = function(result) {\n  this.results_.addResult(result);\n};\n\njasmine.Spec.prototype.expect = function(actual) {\n  var positive = new (this.getMatchersClass_())(this.env, actual, this);\n  positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);\n  return positive;\n};\n\n/**\n * Waits a fixed time period before moving to the next block.\n *\n * @deprecated Use waitsFor() instead\n * @param {Number} timeout milliseconds to wait\n */\njasmine.Spec.prototype.waits = function(timeout) {\n  var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);\n  this.addToQueue(waitsFunc);\n  return this;\n};\n\n/**\n * Waits for the latchFunction to return true before proceeding to the next block.\n *\n * @param {Function} latchFunction\n * @param {String} optional_timeoutMessage\n * @param {Number} optional_timeout\n */\njasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {\n  var latchFunction_ = null;\n  var optional_timeoutMessage_ = null;\n  var optional_timeout_ = null;\n\n  for (var i = 0; i < arguments.length; i++) {\n    var arg = arguments[i];\n    switch (typeof arg) {\n      case 'function':\n        latchFunction_ = arg;\n        break;\n      case 'string':\n        optional_timeoutMessage_ = arg;\n        break;\n      case 'number':\n        optional_timeout_ = arg;\n        break;\n    }\n  }\n\n  var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);\n  this.addToQueue(waitsForFunc);\n  return this;\n};\n\njasmine.Spec.prototype.fail = function (e) {\n  var expectationResult = new jasmine.ExpectationResult({\n    passed: false,\n    message: e ? jasmine.util.formatException(e) : 'Exception',\n    trace: { stack: e.stack }\n  });\n  this.results_.addResult(expectationResult);\n};\n\njasmine.Spec.prototype.getMatchersClass_ = function() {\n  return this.matchersClass || this.env.matchersClass;\n};\n\njasmine.Spec.prototype.addMatchers = function(matchersPrototype) {\n  var parent = this.getMatchersClass_();\n  var newMatchersClass = function() {\n    parent.apply(this, arguments);\n  };\n  jasmine.util.inherit(newMatchersClass, parent);\n  jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);\n  this.matchersClass = newMatchersClass;\n};\n\njasmine.Spec.prototype.finishCallback = function() {\n  this.env.reporter.reportSpecResults(this);\n};\n\njasmine.Spec.prototype.finish = function(onComplete) {\n  this.removeAllSpies();\n  this.finishCallback();\n  if (onComplete) {\n    onComplete();\n  }\n};\n\njasmine.Spec.prototype.after = function(doAfter) {\n  if (this.queue.isRunning()) {\n    this.queue.add(new jasmine.Block(this.env, doAfter, this));\n  } else {\n    this.afterCallbacks.unshift(doAfter);\n  }\n};\n\njasmine.Spec.prototype.execute = function(onComplete) {\n  var spec = this;\n  if (!spec.env.specFilter(spec)) {\n    spec.results_.skipped = true;\n    spec.finish(onComplete);\n    return;\n  }\n\n  this.env.reporter.reportSpecStarting(this);\n\n  spec.env.currentSpec = spec;\n\n  spec.addBeforesAndAftersToQueue();\n\n  spec.queue.start(function () {\n    spec.finish(onComplete);\n  });\n};\n\njasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {\n  var runner = this.env.currentRunner();\n  var i;\n\n  for (var suite = this.suite; suite; suite = suite.parentSuite) {\n    for (i = 0; i < suite.before_.length; i++) {\n      this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));\n    }\n  }\n  for (i = 0; i < runner.before_.length; i++) {\n    this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));\n  }\n  for (i = 0; i < this.afterCallbacks.length; i++) {\n    this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));\n  }\n  for (suite = this.suite; suite; suite = suite.parentSuite) {\n    for (i = 0; i < suite.after_.length; i++) {\n      this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));\n    }\n  }\n  for (i = 0; i < runner.after_.length; i++) {\n    this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));\n  }\n};\n\njasmine.Spec.prototype.explodes = function() {\n  throw 'explodes function should not have been called';\n};\n\njasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {\n  if (obj == jasmine.undefined) {\n    throw \"spyOn could not find an object to spy upon for \" + methodName + \"()\";\n  }\n\n  if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {\n    throw methodName + '() method does not exist';\n  }\n\n  if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {\n    throw new Error(methodName + ' has already been spied upon');\n  }\n\n  var spyObj = jasmine.createSpy(methodName);\n\n  this.spies_.push(spyObj);\n  spyObj.baseObj = obj;\n  spyObj.methodName = methodName;\n  spyObj.originalValue = obj[methodName];\n\n  obj[methodName] = spyObj;\n\n  return spyObj;\n};\n\njasmine.Spec.prototype.removeAllSpies = function() {\n  for (var i = 0; i < this.spies_.length; i++) {\n    var spy = this.spies_[i];\n    spy.baseObj[spy.methodName] = spy.originalValue;\n  }\n  this.spies_ = [];\n};\n\n/**\n * Internal representation of a Jasmine suite.\n *\n * @constructor\n * @param {jasmine.Env} env\n * @param {String} description\n * @param {Function} specDefinitions\n * @param {jasmine.Suite} parentSuite\n */\njasmine.Suite = function(env, description, specDefinitions, parentSuite) {\n  var self = this;\n  self.id = env.nextSuiteId ? env.nextSuiteId() : null;\n  self.description = description;\n  self.queue = new jasmine.Queue(env);\n  self.parentSuite = parentSuite;\n  self.env = env;\n  self.before_ = [];\n  self.after_ = [];\n  self.children_ = [];\n  self.suites_ = [];\n  self.specs_ = [];\n};\n\njasmine.Suite.prototype.getFullName = function() {\n  var fullName = this.description;\n  for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {\n    fullName = parentSuite.description + ' ' + fullName;\n  }\n  return fullName;\n};\n\njasmine.Suite.prototype.finish = function(onComplete) {\n  this.env.reporter.reportSuiteResults(this);\n  this.finished = true;\n  if (typeof(onComplete) == 'function') {\n    onComplete();\n  }\n};\n\njasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {\n  beforeEachFunction.typeName = 'beforeEach';\n  this.before_.unshift(beforeEachFunction);\n};\n\njasmine.Suite.prototype.afterEach = function(afterEachFunction) {\n  afterEachFunction.typeName = 'afterEach';\n  this.after_.unshift(afterEachFunction);\n};\n\njasmine.Suite.prototype.results = function() {\n  return this.queue.results();\n};\n\njasmine.Suite.prototype.add = function(suiteOrSpec) {\n  this.children_.push(suiteOrSpec);\n  if (suiteOrSpec instanceof jasmine.Suite) {\n    this.suites_.push(suiteOrSpec);\n    this.env.currentRunner().addSuite(suiteOrSpec);\n  } else {\n    this.specs_.push(suiteOrSpec);\n  }\n  this.queue.add(suiteOrSpec);\n};\n\njasmine.Suite.prototype.specs = function() {\n  return this.specs_;\n};\n\njasmine.Suite.prototype.suites = function() {\n  return this.suites_;\n};\n\njasmine.Suite.prototype.children = function() {\n  return this.children_;\n};\n\njasmine.Suite.prototype.execute = function(onComplete) {\n  var self = this;\n  this.queue.start(function () {\n    self.finish(onComplete);\n  });\n};\njasmine.WaitsBlock = function(env, timeout, spec) {\n  this.timeout = timeout;\n  jasmine.Block.call(this, env, null, spec);\n};\n\njasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);\n\njasmine.WaitsBlock.prototype.execute = function (onComplete) {\n  if (jasmine.VERBOSE) {\n    this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');\n  }\n  this.env.setTimeout(function () {\n    onComplete();\n  }, this.timeout);\n};\n/**\n * A block which waits for some condition to become true, with timeout.\n *\n * @constructor\n * @extends jasmine.Block\n * @param {jasmine.Env} env The Jasmine environment.\n * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.\n * @param {Function} latchFunction A function which returns true when the desired condition has been met.\n * @param {String} message The message to display if the desired condition hasn't been met within the given time period.\n * @param {jasmine.Spec} spec The Jasmine spec.\n */\njasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {\n  this.timeout = timeout || env.defaultTimeoutInterval;\n  this.latchFunction = latchFunction;\n  this.message = message;\n  this.totalTimeSpentWaitingForLatch = 0;\n  jasmine.Block.call(this, env, null, spec);\n};\njasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);\n\njasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;\n\njasmine.WaitsForBlock.prototype.execute = function(onComplete) {\n  if (jasmine.VERBOSE) {\n    this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));\n  }\n  var latchFunctionResult;\n  try {\n    latchFunctionResult = this.latchFunction.apply(this.spec);\n  } catch (e) {\n    this.spec.fail(e);\n    onComplete();\n    return;\n  }\n\n  if (latchFunctionResult) {\n    onComplete();\n  } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {\n    var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');\n    this.spec.fail({\n      name: 'timeout',\n      message: message\n    });\n\n    this.abort = true;\n    onComplete();\n  } else {\n    this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;\n    var self = this;\n    this.env.setTimeout(function() {\n      self.execute(onComplete);\n    }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);\n  }\n};\n\njasmine.version_= {\n  \"major\": 1,\n  \"minor\": 2,\n  \"build\": 0,\n  \"revision\": 1337005947\n};\n"
  },
  {
    "path": "sdk-unitest/jasmine/guide.js",
    "content": "/*\r\n断言 https://github.com/pivotal/jasmine/wiki/Matchers\t\t\r\nexpect(x).toEqual(y); \t\t\t\t\t\tcompares objects or primitives x and y and passes if they are equivalent\r\nexpect(x).toBe(y); \t\t\t\t\t\t\tcompares objects or primitives x and y and passes if they are the same object\r\nexpect(x).toMatch(pattern); \t\t\t\tcompares x to string or regular expression pattern and passes if they match\r\nexpect(x).toBeDefined(); \t\t\t\t\tpasses if x is not undefined\r\nexpect(x).toBeUndefined(); \t\t\t\t\tpasses if x is undefined\r\nexpect(x).toBeNull(); \t\t\t\t\t\tpasses if x is null\r\nexpect(x).toBeTruthy(); \t\t\t\t\tpasses if x evaluates to true\r\nexpect(x).toBeFalsy(); \t\t\t\t\t\tpasses if x evaluates to false\r\nexpect(x).toContain(y); \t\t\t\t\tpasses if array or string x contains y\r\nexpect(x).toBeLessThan(y); \t\t\t\t\tpasses if x is less than y\r\nexpect(x).toBeGreaterThan(y); \t\t\t\tpasses if x is greater than y\r\nexpect(function(){fn();}).toThrow(e); \t\tpasses if function fn throws exception e when executed\r\n\r\nexpect(x).not.toEqual(y); \t\t\t\t\tcompares objects or primitives x and y and passes if they are not equivalent\r\n*/\r\n\r\ndescribe(\"$\", function() { \r\n\tvar scripts;\r\n\tvar lis;\r\n\tvar node;\r\n\r\n\tbeforeEach(function() {\r\n\t\tscripts = getObj(\"script\");\r\n\t\tlis = getObj(\".a\");\r\n\t\tnode = getObj(\"#jasmine\");\r\n\t});\r\n\r\n\tdescribe(\"get nodes by id\", function() {\r\n\t    it(\"node type should be text/javascript\", function() {\r\n\t        expect(node.type).toEqual(\"text/javascript\");\r\n\t    });\r\n\t});\r\n});\t"
  },
  {
    "path": "sdk-unitest/libs/ua.js",
    "content": "(function(){\n    var u = navigator.userAgent, app = navigator.appVersion;\n    var system = {\n        // android终端或者uc浏览器\n        isAndroid: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,\n        // 是否为iPhone或者QQHD浏览器\n        isIphone: u.indexOf('iPhone') > -1 ,\n        // 是否iPad\n        isIpad: u.indexOf('iPad') > -1 ,\n        // 是否为windows\n        isWindows: u.indexOf('Windows NT') > -1 ,\n        // 是否为mac\n        isMac: u.indexOf('Mac')\n    };\n\n    var broswer = {\n        isIE : /ie/i.test(navigator.userAgent.toLowerCase()),\n        isFirefox : /firefox/i.test(navigator.userAgent.toLowerCase()),\n        isChrome : /chrome/i.test(navigator.userAgent.toLowerCase()),\n        isOpera : /opera/i.test(navigator.userAgent.toLowerCase()),\n        isSafari : /safari/i.test(navigator.userAgent.toLowerCase()),\n        isWeixin : /micromessenger/i.test(navigator.userAgent.toLowerCase())\n    };\n\n    window.env = {\n        system : system,\n        broswer : broswer\n    }\n})();"
  },
  {
    "path": "sdk-unitest/libs/underscore.js",
    "content": "//     Underscore.js 1.8.3\n//     http://underscorejs.org\n//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n//     Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n  // Baseline setup\n  // --------------\n\n  // Establish the root object, `window` in the browser, or `exports` on the server.\n  var root = this;\n\n  // Save the previous value of the `_` variable.\n  var previousUnderscore = root._;\n\n  // Save bytes in the minified (but not gzipped) version:\n  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n  // Create quick reference variables for speed access to core prototypes.\n  var\n    push             = ArrayProto.push,\n    slice            = ArrayProto.slice,\n    toString         = ObjProto.toString,\n    hasOwnProperty   = ObjProto.hasOwnProperty;\n\n  // All **ECMAScript 5** native function implementations that we hope to use\n  // are declared here.\n  var\n    nativeIsArray      = Array.isArray,\n    nativeKeys         = Object.keys,\n    nativeBind         = FuncProto.bind,\n    nativeCreate       = Object.create;\n\n  // Naked function reference for surrogate-prototype-swapping.\n  var Ctor = function(){};\n\n  // Create a safe reference to the Underscore object for use below.\n  var _ = function(obj) {\n    if (obj instanceof _) return obj;\n    if (!(this instanceof _)) return new _(obj);\n    this._wrapped = obj;\n  };\n\n  // Export the Underscore object for **Node.js**, with\n  // backwards-compatibility for the old `require()` API. If we're in\n  // the browser, add `_` as a global object.\n  if (typeof exports !== 'undefined') {\n    if (typeof module !== 'undefined' && module.exports) {\n      exports = module.exports = _;\n    }\n    exports._ = _;\n  } else {\n    root._ = _;\n  }\n\n  // Current version.\n  _.VERSION = '1.8.3';\n\n  // Internal function that returns an efficient (for current engines) version\n  // of the passed-in callback, to be repeatedly applied in other Underscore\n  // functions.\n  var optimizeCb = function(func, context, argCount) {\n    if (context === void 0) return func;\n    switch (argCount == null ? 3 : argCount) {\n      case 1: return function(value) {\n        return func.call(context, value);\n      };\n      case 2: return function(value, other) {\n        return func.call(context, value, other);\n      };\n      case 3: return function(value, index, collection) {\n        return func.call(context, value, index, collection);\n      };\n      case 4: return function(accumulator, value, index, collection) {\n        return func.call(context, accumulator, value, index, collection);\n      };\n    }\n    return function() {\n      return func.apply(context, arguments);\n    };\n  };\n\n  // A mostly-internal function to generate callbacks that can be applied\n  // to each element in a collection, returning the desired result — either\n  // identity, an arbitrary callback, a property matcher, or a property accessor.\n  var cb = function(value, context, argCount) {\n    if (value == null) return _.identity;\n    if (_.isFunction(value)) return optimizeCb(value, context, argCount);\n    if (_.isObject(value)) return _.matcher(value);\n    return _.property(value);\n  };\n  _.iteratee = function(value, context) {\n    return cb(value, context, Infinity);\n  };\n\n  // An internal function for creating assigner functions.\n  var createAssigner = function(keysFunc, undefinedOnly) {\n    return function(obj) {\n      var length = arguments.length;\n      if (length < 2 || obj == null) return obj;\n      for (var index = 1; index < length; index++) {\n        var source = arguments[index],\n            keys = keysFunc(source),\n            l = keys.length;\n        for (var i = 0; i < l; i++) {\n          var key = keys[i];\n          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];\n        }\n      }\n      return obj;\n    };\n  };\n\n  // An internal function for creating a new object that inherits from another.\n  var baseCreate = function(prototype) {\n    if (!_.isObject(prototype)) return {};\n    if (nativeCreate) return nativeCreate(prototype);\n    Ctor.prototype = prototype;\n    var result = new Ctor;\n    Ctor.prototype = null;\n    return result;\n  };\n\n  var property = function(key) {\n    return function(obj) {\n      return obj == null ? void 0 : obj[key];\n    };\n  };\n\n  // Helper for collection methods to determine whether a collection\n  // should be iterated as an array or as an object\n  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n  var getLength = property('length');\n  var isArrayLike = function(collection) {\n    var length = getLength(collection);\n    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n  };\n\n  // Collection Functions\n  // --------------------\n\n  // The cornerstone, an `each` implementation, aka `forEach`.\n  // Handles raw objects in addition to array-likes. Treats all\n  // sparse array-likes as if they were dense.\n  _.each = _.forEach = function(obj, iteratee, context) {\n    iteratee = optimizeCb(iteratee, context);\n    var i, length;\n    if (isArrayLike(obj)) {\n      for (i = 0, length = obj.length; i < length; i++) {\n        iteratee(obj[i], i, obj);\n      }\n    } else {\n      var keys = _.keys(obj);\n      for (i = 0, length = keys.length; i < length; i++) {\n        iteratee(obj[keys[i]], keys[i], obj);\n      }\n    }\n    return obj;\n  };\n\n  // Return the results of applying the iteratee to each element.\n  _.map = _.collect = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    var keys = !isArrayLike(obj) && _.keys(obj),\n        length = (keys || obj).length,\n        results = Array(length);\n    for (var index = 0; index < length; index++) {\n      var currentKey = keys ? keys[index] : index;\n      results[index] = iteratee(obj[currentKey], currentKey, obj);\n    }\n    return results;\n  };\n\n  // Create a reducing function iterating left or right.\n  function createReduce(dir) {\n    // Optimized iterator function as using arguments.length\n    // in the main function will deoptimize the, see #1991.\n    function iterator(obj, iteratee, memo, keys, index, length) {\n      for (; index >= 0 && index < length; index += dir) {\n        var currentKey = keys ? keys[index] : index;\n        memo = iteratee(memo, obj[currentKey], currentKey, obj);\n      }\n      return memo;\n    }\n\n    return function(obj, iteratee, memo, context) {\n      iteratee = optimizeCb(iteratee, context, 4);\n      var keys = !isArrayLike(obj) && _.keys(obj),\n          length = (keys || obj).length,\n          index = dir > 0 ? 0 : length - 1;\n      // Determine the initial value if none is provided.\n      if (arguments.length < 3) {\n        memo = obj[keys ? keys[index] : index];\n        index += dir;\n      }\n      return iterator(obj, iteratee, memo, keys, index, length);\n    };\n  }\n\n  // **Reduce** builds up a single result from a list of values, aka `inject`,\n  // or `foldl`.\n  _.reduce = _.foldl = _.inject = createReduce(1);\n\n  // The right-associative version of reduce, also known as `foldr`.\n  _.reduceRight = _.foldr = createReduce(-1);\n\n  // Return the first value which passes a truth test. Aliased as `detect`.\n  _.find = _.detect = function(obj, predicate, context) {\n    var key;\n    if (isArrayLike(obj)) {\n      key = _.findIndex(obj, predicate, context);\n    } else {\n      key = _.findKey(obj, predicate, context);\n    }\n    if (key !== void 0 && key !== -1) return obj[key];\n  };\n\n  // Return all the elements that pass a truth test.\n  // Aliased as `select`.\n  _.filter = _.select = function(obj, predicate, context) {\n    var results = [];\n    predicate = cb(predicate, context);\n    _.each(obj, function(value, index, list) {\n      if (predicate(value, index, list)) results.push(value);\n    });\n    return results;\n  };\n\n  // Return all the elements for which a truth test fails.\n  _.reject = function(obj, predicate, context) {\n    return _.filter(obj, _.negate(cb(predicate)), context);\n  };\n\n  // Determine whether all of the elements match a truth test.\n  // Aliased as `all`.\n  _.every = _.all = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = !isArrayLike(obj) && _.keys(obj),\n        length = (keys || obj).length;\n    for (var index = 0; index < length; index++) {\n      var currentKey = keys ? keys[index] : index;\n      if (!predicate(obj[currentKey], currentKey, obj)) return false;\n    }\n    return true;\n  };\n\n  // Determine if at least one element in the object matches a truth test.\n  // Aliased as `any`.\n  _.some = _.any = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = !isArrayLike(obj) && _.keys(obj),\n        length = (keys || obj).length;\n    for (var index = 0; index < length; index++) {\n      var currentKey = keys ? keys[index] : index;\n      if (predicate(obj[currentKey], currentKey, obj)) return true;\n    }\n    return false;\n  };\n\n  // Determine if the array or object contains a given item (using `===`).\n  // Aliased as `includes` and `include`.\n  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {\n    if (!isArrayLike(obj)) obj = _.values(obj);\n    if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n    return _.indexOf(obj, item, fromIndex) >= 0;\n  };\n\n  // Invoke a method (with arguments) on every item in a collection.\n  _.invoke = function(obj, method) {\n    var args = slice.call(arguments, 2);\n    var isFunc = _.isFunction(method);\n    return _.map(obj, function(value) {\n      var func = isFunc ? method : value[method];\n      return func == null ? func : func.apply(value, args);\n    });\n  };\n\n  // Convenience version of a common use case of `map`: fetching a property.\n  _.pluck = function(obj, key) {\n    return _.map(obj, _.property(key));\n  };\n\n  // Convenience version of a common use case of `filter`: selecting only objects\n  // containing specific `key:value` pairs.\n  _.where = function(obj, attrs) {\n    return _.filter(obj, _.matcher(attrs));\n  };\n\n  // Convenience version of a common use case of `find`: getting the first object\n  // containing specific `key:value` pairs.\n  _.findWhere = function(obj, attrs) {\n    return _.find(obj, _.matcher(attrs));\n  };\n\n  // Return the maximum element (or element-based computation).\n  _.max = function(obj, iteratee, context) {\n    var result = -Infinity, lastComputed = -Infinity,\n        value, computed;\n    if (iteratee == null && obj != null) {\n      obj = isArrayLike(obj) ? obj : _.values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value > result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index, list) {\n        computed = iteratee(value, index, list);\n        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n          result = value;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  };\n\n  // Return the minimum element (or element-based computation).\n  _.min = function(obj, iteratee, context) {\n    var result = Infinity, lastComputed = Infinity,\n        value, computed;\n    if (iteratee == null && obj != null) {\n      obj = isArrayLike(obj) ? obj : _.values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value < result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index, list) {\n        computed = iteratee(value, index, list);\n        if (computed < lastComputed || computed === Infinity && result === Infinity) {\n          result = value;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  };\n\n  // Shuffle a collection, using the modern version of the\n  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n  _.shuffle = function(obj) {\n    var set = isArrayLike(obj) ? obj : _.values(obj);\n    var length = set.length;\n    var shuffled = Array(length);\n    for (var index = 0, rand; index < length; index++) {\n      rand = _.random(0, index);\n      if (rand !== index) shuffled[index] = shuffled[rand];\n      shuffled[rand] = set[index];\n    }\n    return shuffled;\n  };\n\n  // Sample **n** random values from a collection.\n  // If **n** is not specified, returns a single random element.\n  // The internal `guard` argument allows it to work with `map`.\n  _.sample = function(obj, n, guard) {\n    if (n == null || guard) {\n      if (!isArrayLike(obj)) obj = _.values(obj);\n      return obj[_.random(obj.length - 1)];\n    }\n    return _.shuffle(obj).slice(0, Math.max(0, n));\n  };\n\n  // Sort the object's values by a criterion produced by an iteratee.\n  _.sortBy = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    return _.pluck(_.map(obj, function(value, index, list) {\n      return {\n        value: value,\n        index: index,\n        criteria: iteratee(value, index, list)\n      };\n    }).sort(function(left, right) {\n      var a = left.criteria;\n      var b = right.criteria;\n      if (a !== b) {\n        if (a > b || a === void 0) return 1;\n        if (a < b || b === void 0) return -1;\n      }\n      return left.index - right.index;\n    }), 'value');\n  };\n\n  // An internal function used for aggregate \"group by\" operations.\n  var group = function(behavior) {\n    return function(obj, iteratee, context) {\n      var result = {};\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index) {\n        var key = iteratee(value, index, obj);\n        behavior(result, value, key);\n      });\n      return result;\n    };\n  };\n\n  // Groups the object's values by a criterion. Pass either a string attribute\n  // to group by, or a function that returns the criterion.\n  _.groupBy = group(function(result, value, key) {\n    if (_.has(result, key)) result[key].push(value); else result[key] = [value];\n  });\n\n  // Indexes the object's values by a criterion, similar to `groupBy`, but for\n  // when you know that your index values will be unique.\n  _.indexBy = group(function(result, value, key) {\n    result[key] = value;\n  });\n\n  // Counts instances of an object that group by a certain criterion. Pass\n  // either a string attribute to count by, or a function that returns the\n  // criterion.\n  _.countBy = group(function(result, value, key) {\n    if (_.has(result, key)) result[key]++; else result[key] = 1;\n  });\n\n  // Safely create a real, live array from anything iterable.\n  _.toArray = function(obj) {\n    if (!obj) return [];\n    if (_.isArray(obj)) return slice.call(obj);\n    if (isArrayLike(obj)) return _.map(obj, _.identity);\n    return _.values(obj);\n  };\n\n  // Return the number of elements in an object.\n  _.size = function(obj) {\n    if (obj == null) return 0;\n    return isArrayLike(obj) ? obj.length : _.keys(obj).length;\n  };\n\n  // Split a collection into two arrays: one whose elements all satisfy the given\n  // predicate, and one whose elements all do not satisfy the predicate.\n  _.partition = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var pass = [], fail = [];\n    _.each(obj, function(value, key, obj) {\n      (predicate(value, key, obj) ? pass : fail).push(value);\n    });\n    return [pass, fail];\n  };\n\n  // Array Functions\n  // ---------------\n\n  // Get the first element of an array. Passing **n** will return the first N\n  // values in the array. Aliased as `head` and `take`. The **guard** check\n  // allows it to work with `_.map`.\n  _.first = _.head = _.take = function(array, n, guard) {\n    if (array == null) return void 0;\n    if (n == null || guard) return array[0];\n    return _.initial(array, array.length - n);\n  };\n\n  // Returns everything but the last entry of the array. Especially useful on\n  // the arguments object. Passing **n** will return all the values in\n  // the array, excluding the last N.\n  _.initial = function(array, n, guard) {\n    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n  };\n\n  // Get the last element of an array. Passing **n** will return the last N\n  // values in the array.\n  _.last = function(array, n, guard) {\n    if (array == null) return void 0;\n    if (n == null || guard) return array[array.length - 1];\n    return _.rest(array, Math.max(0, array.length - n));\n  };\n\n  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n  // Especially useful on the arguments object. Passing an **n** will return\n  // the rest N values in the array.\n  _.rest = _.tail = _.drop = function(array, n, guard) {\n    return slice.call(array, n == null || guard ? 1 : n);\n  };\n\n  // Trim out all falsy values from an array.\n  _.compact = function(array) {\n    return _.filter(array, _.identity);\n  };\n\n  // Internal implementation of a recursive `flatten` function.\n  var flatten = function(input, shallow, strict, startIndex) {\n    var output = [], idx = 0;\n    for (var i = startIndex || 0, length = getLength(input); i < length; i++) {\n      var value = input[i];\n      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n        //flatten current level of array or arguments object\n        if (!shallow) value = flatten(value, shallow, strict);\n        var j = 0, len = value.length;\n        output.length += len;\n        while (j < len) {\n          output[idx++] = value[j++];\n        }\n      } else if (!strict) {\n        output[idx++] = value;\n      }\n    }\n    return output;\n  };\n\n  // Flatten out an array, either recursively (by default), or just one level.\n  _.flatten = function(array, shallow) {\n    return flatten(array, shallow, false);\n  };\n\n  // Return a version of the array that does not contain the specified value(s).\n  _.without = function(array) {\n    return _.difference(array, slice.call(arguments, 1));\n  };\n\n  // Produce a duplicate-free version of the array. If the array has already\n  // been sorted, you have the option of using a faster algorithm.\n  // Aliased as `unique`.\n  _.uniq = _.unique = function(array, isSorted, iteratee, context) {\n    if (!_.isBoolean(isSorted)) {\n      context = iteratee;\n      iteratee = isSorted;\n      isSorted = false;\n    }\n    if (iteratee != null) iteratee = cb(iteratee, context);\n    var result = [];\n    var seen = [];\n    for (var i = 0, length = getLength(array); i < length; i++) {\n      var value = array[i],\n          computed = iteratee ? iteratee(value, i, array) : value;\n      if (isSorted) {\n        if (!i || seen !== computed) result.push(value);\n        seen = computed;\n      } else if (iteratee) {\n        if (!_.contains(seen, computed)) {\n          seen.push(computed);\n          result.push(value);\n        }\n      } else if (!_.contains(result, value)) {\n        result.push(value);\n      }\n    }\n    return result;\n  };\n\n  // Produce an array that contains the union: each distinct element from all of\n  // the passed-in arrays.\n  _.union = function() {\n    return _.uniq(flatten(arguments, true, true));\n  };\n\n  // Produce an array that contains every item shared between all the\n  // passed-in arrays.\n  _.intersection = function(array) {\n    var result = [];\n    var argsLength = arguments.length;\n    for (var i = 0, length = getLength(array); i < length; i++) {\n      var item = array[i];\n      if (_.contains(result, item)) continue;\n      for (var j = 1; j < argsLength; j++) {\n        if (!_.contains(arguments[j], item)) break;\n      }\n      if (j === argsLength) result.push(item);\n    }\n    return result;\n  };\n\n  // Take the difference between one array and a number of other arrays.\n  // Only the elements present in just the first array will remain.\n  _.difference = function(array) {\n    var rest = flatten(arguments, true, true, 1);\n    return _.filter(array, function(value){\n      return !_.contains(rest, value);\n    });\n  };\n\n  // Zip together multiple lists into a single array -- elements that share\n  // an index go together.\n  _.zip = function() {\n    return _.unzip(arguments);\n  };\n\n  // Complement of _.zip. Unzip accepts an array of arrays and groups\n  // each array's elements on shared indices\n  _.unzip = function(array) {\n    var length = array && _.max(array, getLength).length || 0;\n    var result = Array(length);\n\n    for (var index = 0; index < length; index++) {\n      result[index] = _.pluck(array, index);\n    }\n    return result;\n  };\n\n  // Converts lists into objects. Pass either a single array of `[key, value]`\n  // pairs, or two parallel arrays of the same length -- one of keys, and one of\n  // the corresponding values.\n  _.object = function(list, values) {\n    var result = {};\n    for (var i = 0, length = getLength(list); i < length; i++) {\n      if (values) {\n        result[list[i]] = values[i];\n      } else {\n        result[list[i][0]] = list[i][1];\n      }\n    }\n    return result;\n  };\n\n  // Generator function to create the findIndex and findLastIndex functions\n  function createPredicateIndexFinder(dir) {\n    return function(array, predicate, context) {\n      predicate = cb(predicate, context);\n      var length = getLength(array);\n      var index = dir > 0 ? 0 : length - 1;\n      for (; index >= 0 && index < length; index += dir) {\n        if (predicate(array[index], index, array)) return index;\n      }\n      return -1;\n    };\n  }\n\n  // Returns the first index on an array-like that passes a predicate test\n  _.findIndex = createPredicateIndexFinder(1);\n  _.findLastIndex = createPredicateIndexFinder(-1);\n\n  // Use a comparator function to figure out the smallest index at which\n  // an object should be inserted so as to maintain order. Uses binary search.\n  _.sortedIndex = function(array, obj, iteratee, context) {\n    iteratee = cb(iteratee, context, 1);\n    var value = iteratee(obj);\n    var low = 0, high = getLength(array);\n    while (low < high) {\n      var mid = Math.floor((low + high) / 2);\n      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n    }\n    return low;\n  };\n\n  // Generator function to create the indexOf and lastIndexOf functions\n  function createIndexFinder(dir, predicateFind, sortedIndex) {\n    return function(array, item, idx) {\n      var i = 0, length = getLength(array);\n      if (typeof idx == 'number') {\n        if (dir > 0) {\n            i = idx >= 0 ? idx : Math.max(idx + length, i);\n        } else {\n            length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n        }\n      } else if (sortedIndex && idx && length) {\n        idx = sortedIndex(array, item);\n        return array[idx] === item ? idx : -1;\n      }\n      if (item !== item) {\n        idx = predicateFind(slice.call(array, i, length), _.isNaN);\n        return idx >= 0 ? idx + i : -1;\n      }\n      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n        if (array[idx] === item) return idx;\n      }\n      return -1;\n    };\n  }\n\n  // Return the position of the first occurrence of an item in an array,\n  // or -1 if the item is not included in the array.\n  // If the array is large and already in sort order, pass `true`\n  // for **isSorted** to use binary search.\n  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n  // Generate an integer Array containing an arithmetic progression. A port of\n  // the native Python `range()` function. See\n  // [the Python documentation](http://docs.python.org/library/functions.html#range).\n  _.range = function(start, stop, step) {\n    if (stop == null) {\n      stop = start || 0;\n      start = 0;\n    }\n    step = step || 1;\n\n    var length = Math.max(Math.ceil((stop - start) / step), 0);\n    var range = Array(length);\n\n    for (var idx = 0; idx < length; idx++, start += step) {\n      range[idx] = start;\n    }\n\n    return range;\n  };\n\n  // Function (ahem) Functions\n  // ------------------\n\n  // Determines whether to execute a function as a constructor\n  // or a normal function with the provided arguments\n  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\n    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n    var self = baseCreate(sourceFunc.prototype);\n    var result = sourceFunc.apply(self, args);\n    if (_.isObject(result)) return result;\n    return self;\n  };\n\n  // Create a function bound to a given object (assigning `this`, and arguments,\n  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n  // available.\n  _.bind = function(func, context) {\n    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n    var args = slice.call(arguments, 2);\n    var bound = function() {\n      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));\n    };\n    return bound;\n  };\n\n  // Partially apply a function by creating a version that has had some of its\n  // arguments pre-filled, without changing its dynamic `this` context. _ acts\n  // as a placeholder, allowing any combination of arguments to be pre-filled.\n  _.partial = function(func) {\n    var boundArgs = slice.call(arguments, 1);\n    var bound = function() {\n      var position = 0, length = boundArgs.length;\n      var args = Array(length);\n      for (var i = 0; i < length; i++) {\n        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];\n      }\n      while (position < arguments.length) args.push(arguments[position++]);\n      return executeBound(func, bound, this, this, args);\n    };\n    return bound;\n  };\n\n  // Bind a number of an object's methods to that object. Remaining arguments\n  // are the method names to be bound. Useful for ensuring that all callbacks\n  // defined on an object belong to it.\n  _.bindAll = function(obj) {\n    var i, length = arguments.length, key;\n    if (length <= 1) throw new Error('bindAll must be passed function names');\n    for (i = 1; i < length; i++) {\n      key = arguments[i];\n      obj[key] = _.bind(obj[key], obj);\n    }\n    return obj;\n  };\n\n  // Memoize an expensive function by storing its results.\n  _.memoize = function(func, hasher) {\n    var memoize = function(key) {\n      var cache = memoize.cache;\n      var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\n      return cache[address];\n    };\n    memoize.cache = {};\n    return memoize;\n  };\n\n  // Delays a function for the given number of milliseconds, and then calls\n  // it with the arguments supplied.\n  _.delay = function(func, wait) {\n    var args = slice.call(arguments, 2);\n    return setTimeout(function(){\n      return func.apply(null, args);\n    }, wait);\n  };\n\n  // Defers a function, scheduling it to run after the current call stack has\n  // cleared.\n  _.defer = _.partial(_.delay, _, 1);\n\n  // Returns a function, that, when invoked, will only be triggered at most once\n  // during a given window of time. Normally, the throttled function will run\n  // as much as it can, without ever going more than once per `wait` duration;\n  // but if you'd like to disable the execution on the leading edge, pass\n  // `{leading: false}`. To disable execution on the trailing edge, ditto.\n  _.throttle = function(func, wait, options) {\n    var context, args, result;\n    var timeout = null;\n    var previous = 0;\n    if (!options) options = {};\n    var later = function() {\n      previous = options.leading === false ? 0 : _.now();\n      timeout = null;\n      result = func.apply(context, args);\n      if (!timeout) context = args = null;\n    };\n    return function() {\n      var now = _.now();\n      if (!previous && options.leading === false) previous = now;\n      var remaining = wait - (now - previous);\n      context = this;\n      args = arguments;\n      if (remaining <= 0 || remaining > wait) {\n        if (timeout) {\n          clearTimeout(timeout);\n          timeout = null;\n        }\n        previous = now;\n        result = func.apply(context, args);\n        if (!timeout) context = args = null;\n      } else if (!timeout && options.trailing !== false) {\n        timeout = setTimeout(later, remaining);\n      }\n      return result;\n    };\n  };\n\n  // Returns a function, that, as long as it continues to be invoked, will not\n  // be triggered. The function will be called after it stops being called for\n  // N milliseconds. If `immediate` is passed, trigger the function on the\n  // leading edge, instead of the trailing.\n  _.debounce = function(func, wait, immediate) {\n    var timeout, args, context, timestamp, result;\n\n    var later = function() {\n      var last = _.now() - timestamp;\n\n      if (last < wait && last >= 0) {\n        timeout = setTimeout(later, wait - last);\n      } else {\n        timeout = null;\n        if (!immediate) {\n          result = func.apply(context, args);\n          if (!timeout) context = args = null;\n        }\n      }\n    };\n\n    return function() {\n      context = this;\n      args = arguments;\n      timestamp = _.now();\n      var callNow = immediate && !timeout;\n      if (!timeout) timeout = setTimeout(later, wait);\n      if (callNow) {\n        result = func.apply(context, args);\n        context = args = null;\n      }\n\n      return result;\n    };\n  };\n\n  // Returns the first function passed as an argument to the second,\n  // allowing you to adjust arguments, run code before and after, and\n  // conditionally execute the original function.\n  _.wrap = function(func, wrapper) {\n    return _.partial(wrapper, func);\n  };\n\n  // Returns a negated version of the passed-in predicate.\n  _.negate = function(predicate) {\n    return function() {\n      return !predicate.apply(this, arguments);\n    };\n  };\n\n  // Returns a function that is the composition of a list of functions, each\n  // consuming the return value of the function that follows.\n  _.compose = function() {\n    var args = arguments;\n    var start = args.length - 1;\n    return function() {\n      var i = start;\n      var result = args[start].apply(this, arguments);\n      while (i--) result = args[i].call(this, result);\n      return result;\n    };\n  };\n\n  // Returns a function that will only be executed on and after the Nth call.\n  _.after = function(times, func) {\n    return function() {\n      if (--times < 1) {\n        return func.apply(this, arguments);\n      }\n    };\n  };\n\n  // Returns a function that will only be executed up to (but not including) the Nth call.\n  _.before = function(times, func) {\n    var memo;\n    return function() {\n      if (--times > 0) {\n        memo = func.apply(this, arguments);\n      }\n      if (times <= 1) func = null;\n      return memo;\n    };\n  };\n\n  // Returns a function that will be executed at most one time, no matter how\n  // often you call it. Useful for lazy initialization.\n  _.once = _.partial(_.before, 2);\n\n  // Object Functions\n  // ----------------\n\n  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\n  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n  function collectNonEnumProps(obj, keys) {\n    var nonEnumIdx = nonEnumerableProps.length;\n    var constructor = obj.constructor;\n    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;\n\n    // Constructor is a special case.\n    var prop = 'constructor';\n    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n    while (nonEnumIdx--) {\n      prop = nonEnumerableProps[nonEnumIdx];\n      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n        keys.push(prop);\n      }\n    }\n  }\n\n  // Retrieve the names of an object's own properties.\n  // Delegates to **ECMAScript 5**'s native `Object.keys`\n  _.keys = function(obj) {\n    if (!_.isObject(obj)) return [];\n    if (nativeKeys) return nativeKeys(obj);\n    var keys = [];\n    for (var key in obj) if (_.has(obj, key)) keys.push(key);\n    // Ahem, IE < 9.\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\n    return keys;\n  };\n\n  // Retrieve all the property names of an object.\n  _.allKeys = function(obj) {\n    if (!_.isObject(obj)) return [];\n    var keys = [];\n    for (var key in obj) keys.push(key);\n    // Ahem, IE < 9.\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\n    return keys;\n  };\n\n  // Retrieve the values of an object's properties.\n  _.values = function(obj) {\n    var keys = _.keys(obj);\n    var length = keys.length;\n    var values = Array(length);\n    for (var i = 0; i < length; i++) {\n      values[i] = obj[keys[i]];\n    }\n    return values;\n  };\n\n  // Returns the results of applying the iteratee to each element of the object\n  // In contrast to _.map it returns an object\n  _.mapObject = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    var keys =  _.keys(obj),\n          length = keys.length,\n          results = {},\n          currentKey;\n      for (var index = 0; index < length; index++) {\n        currentKey = keys[index];\n        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n      }\n      return results;\n  };\n\n  // Convert an object into a list of `[key, value]` pairs.\n  _.pairs = function(obj) {\n    var keys = _.keys(obj);\n    var length = keys.length;\n    var pairs = Array(length);\n    for (var i = 0; i < length; i++) {\n      pairs[i] = [keys[i], obj[keys[i]]];\n    }\n    return pairs;\n  };\n\n  // Invert the keys and values of an object. The values must be serializable.\n  _.invert = function(obj) {\n    var result = {};\n    var keys = _.keys(obj);\n    for (var i = 0, length = keys.length; i < length; i++) {\n      result[obj[keys[i]]] = keys[i];\n    }\n    return result;\n  };\n\n  // Return a sorted list of the function names available on the object.\n  // Aliased as `methods`\n  _.functions = _.methods = function(obj) {\n    var names = [];\n    for (var key in obj) {\n      if (_.isFunction(obj[key])) names.push(key);\n    }\n    return names.sort();\n  };\n\n  // Extend a given object with all the properties in passed-in object(s).\n  _.extend = createAssigner(_.allKeys);\n\n  // Assigns a given object with all the own properties in the passed-in object(s)\n  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n  _.extendOwn = _.assign = createAssigner(_.keys);\n\n  // Returns the first key on an object that passes a predicate test\n  _.findKey = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = _.keys(obj), key;\n    for (var i = 0, length = keys.length; i < length; i++) {\n      key = keys[i];\n      if (predicate(obj[key], key, obj)) return key;\n    }\n  };\n\n  // Return a copy of the object only containing the whitelisted properties.\n  _.pick = function(object, oiteratee, context) {\n    var result = {}, obj = object, iteratee, keys;\n    if (obj == null) return result;\n    if (_.isFunction(oiteratee)) {\n      keys = _.allKeys(obj);\n      iteratee = optimizeCb(oiteratee, context);\n    } else {\n      keys = flatten(arguments, false, false, 1);\n      iteratee = function(value, key, obj) { return key in obj; };\n      obj = Object(obj);\n    }\n    for (var i = 0, length = keys.length; i < length; i++) {\n      var key = keys[i];\n      var value = obj[key];\n      if (iteratee(value, key, obj)) result[key] = value;\n    }\n    return result;\n  };\n\n   // Return a copy of the object without the blacklisted properties.\n  _.omit = function(obj, iteratee, context) {\n    if (_.isFunction(iteratee)) {\n      iteratee = _.negate(iteratee);\n    } else {\n      var keys = _.map(flatten(arguments, false, false, 1), String);\n      iteratee = function(value, key) {\n        return !_.contains(keys, key);\n      };\n    }\n    return _.pick(obj, iteratee, context);\n  };\n\n  // Fill in a given object with default properties.\n  _.defaults = createAssigner(_.allKeys, true);\n\n  // Creates an object that inherits from the given prototype object.\n  // If additional properties are provided then they will be added to the\n  // created object.\n  _.create = function(prototype, props) {\n    var result = baseCreate(prototype);\n    if (props) _.extendOwn(result, props);\n    return result;\n  };\n\n  // Create a (shallow-cloned) duplicate of an object.\n  _.clone = function(obj) {\n    if (!_.isObject(obj)) return obj;\n    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n  };\n\n  // Invokes interceptor with the obj, and then returns obj.\n  // The primary purpose of this method is to \"tap into\" a method chain, in\n  // order to perform operations on intermediate results within the chain.\n  _.tap = function(obj, interceptor) {\n    interceptor(obj);\n    return obj;\n  };\n\n  // Returns whether an object has a given set of `key:value` pairs.\n  _.isMatch = function(object, attrs) {\n    var keys = _.keys(attrs), length = keys.length;\n    if (object == null) return !length;\n    var obj = Object(object);\n    for (var i = 0; i < length; i++) {\n      var key = keys[i];\n      if (attrs[key] !== obj[key] || !(key in obj)) return false;\n    }\n    return true;\n  };\n\n\n  // Internal recursive comparison function for `isEqual`.\n  var eq = function(a, b, aStack, bStack) {\n    // Identical objects are equal. `0 === -0`, but they aren't identical.\n    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n    if (a === b) return a !== 0 || 1 / a === 1 / b;\n    // A strict comparison is necessary because `null == undefined`.\n    if (a == null || b == null) return a === b;\n    // Unwrap any wrapped objects.\n    if (a instanceof _) a = a._wrapped;\n    if (b instanceof _) b = b._wrapped;\n    // Compare `[[Class]]` names.\n    var className = toString.call(a);\n    if (className !== toString.call(b)) return false;\n    switch (className) {\n      // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n      case '[object RegExp]':\n      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n      case '[object String]':\n        // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n        // equivalent to `new String(\"5\")`.\n        return '' + a === '' + b;\n      case '[object Number]':\n        // `NaN`s are equivalent, but non-reflexive.\n        // Object(NaN) is equivalent to NaN\n        if (+a !== +a) return +b !== +b;\n        // An `egal` comparison is performed for other numeric values.\n        return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n      case '[object Date]':\n      case '[object Boolean]':\n        // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n        // millisecond representations. Note that invalid dates with millisecond representations\n        // of `NaN` are not equivalent.\n        return +a === +b;\n    }\n\n    var areArrays = className === '[object Array]';\n    if (!areArrays) {\n      if (typeof a != 'object' || typeof b != 'object') return false;\n\n      // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n      // from different frames are.\n      var aCtor = a.constructor, bCtor = b.constructor;\n      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&\n                               _.isFunction(bCtor) && bCtor instanceof bCtor)\n                          && ('constructor' in a && 'constructor' in b)) {\n        return false;\n      }\n    }\n    // Assume equality for cyclic structures. The algorithm for detecting cyclic\n    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n    // Initializing stack of traversed objects.\n    // It's done here since we only need them for objects and arrays comparison.\n    aStack = aStack || [];\n    bStack = bStack || [];\n    var length = aStack.length;\n    while (length--) {\n      // Linear search. Performance is inversely proportional to the number of\n      // unique nested structures.\n      if (aStack[length] === a) return bStack[length] === b;\n    }\n\n    // Add the first object to the stack of traversed objects.\n    aStack.push(a);\n    bStack.push(b);\n\n    // Recursively compare objects and arrays.\n    if (areArrays) {\n      // Compare array lengths to determine if a deep comparison is necessary.\n      length = a.length;\n      if (length !== b.length) return false;\n      // Deep compare the contents, ignoring non-numeric properties.\n      while (length--) {\n        if (!eq(a[length], b[length], aStack, bStack)) return false;\n      }\n    } else {\n      // Deep compare objects.\n      var keys = _.keys(a), key;\n      length = keys.length;\n      // Ensure that both objects contain the same number of properties before comparing deep equality.\n      if (_.keys(b).length !== length) return false;\n      while (length--) {\n        // Deep compare each member\n        key = keys[length];\n        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n      }\n    }\n    // Remove the first object from the stack of traversed objects.\n    aStack.pop();\n    bStack.pop();\n    return true;\n  };\n\n  // Perform a deep comparison to check if two objects are equal.\n  _.isEqual = function(a, b) {\n    return eq(a, b);\n  };\n\n  // Is a given array, string, or object empty?\n  // An \"empty\" object has no enumerable own-properties.\n  _.isEmpty = function(obj) {\n    if (obj == null) return true;\n    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n    return _.keys(obj).length === 0;\n  };\n\n  // Is a given value a DOM element?\n  _.isElement = function(obj) {\n    return !!(obj && obj.nodeType === 1);\n  };\n\n  // Is a given value an array?\n  // Delegates to ECMA5's native Array.isArray\n  _.isArray = nativeIsArray || function(obj) {\n    return toString.call(obj) === '[object Array]';\n  };\n\n  // Is a given variable an object?\n  _.isObject = function(obj) {\n    var type = typeof obj;\n    return type === 'function' || type === 'object' && !!obj;\n  };\n\n  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\n  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {\n    _['is' + name] = function(obj) {\n      return toString.call(obj) === '[object ' + name + ']';\n    };\n  });\n\n  // Define a fallback version of the method in browsers (ahem, IE < 9), where\n  // there isn't any inspectable \"Arguments\" type.\n  if (!_.isArguments(arguments)) {\n    _.isArguments = function(obj) {\n      return _.has(obj, 'callee');\n    };\n  }\n\n  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n  // IE 11 (#1621), and in Safari 8 (#1929).\n  if (typeof /./ != 'function' && typeof Int8Array != 'object') {\n    _.isFunction = function(obj) {\n      return typeof obj == 'function' || false;\n    };\n  }\n\n  // Is a given object a finite number?\n  _.isFinite = function(obj) {\n    return isFinite(obj) && !isNaN(parseFloat(obj));\n  };\n\n  // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n  _.isNaN = function(obj) {\n    return _.isNumber(obj) && obj !== +obj;\n  };\n\n  // Is a given value a boolean?\n  _.isBoolean = function(obj) {\n    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n  };\n\n  // Is a given value equal to null?\n  _.isNull = function(obj) {\n    return obj === null;\n  };\n\n  // Is a given variable undefined?\n  _.isUndefined = function(obj) {\n    return obj === void 0;\n  };\n\n  // Shortcut function for checking if an object has a given property directly\n  // on itself (in other words, not on a prototype).\n  _.has = function(obj, key) {\n    return obj != null && hasOwnProperty.call(obj, key);\n  };\n\n  // Utility Functions\n  // -----------------\n\n  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n  // previous owner. Returns a reference to the Underscore object.\n  _.noConflict = function() {\n    root._ = previousUnderscore;\n    return this;\n  };\n\n  // Keep the identity function around for default iteratees.\n  _.identity = function(value) {\n    return value;\n  };\n\n  // Predicate-generating functions. Often useful outside of Underscore.\n  _.constant = function(value) {\n    return function() {\n      return value;\n    };\n  };\n\n  _.noop = function(){};\n\n  _.property = property;\n\n  // Generates a function for a given object that returns a given property.\n  _.propertyOf = function(obj) {\n    return obj == null ? function(){} : function(key) {\n      return obj[key];\n    };\n  };\n\n  // Returns a predicate for checking whether an object has a given set of\n  // `key:value` pairs.\n  _.matcher = _.matches = function(attrs) {\n    attrs = _.extendOwn({}, attrs);\n    return function(obj) {\n      return _.isMatch(obj, attrs);\n    };\n  };\n\n  // Run a function **n** times.\n  _.times = function(n, iteratee, context) {\n    var accum = Array(Math.max(0, n));\n    iteratee = optimizeCb(iteratee, context, 1);\n    for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n    return accum;\n  };\n\n  // Return a random integer between min and max (inclusive).\n  _.random = function(min, max) {\n    if (max == null) {\n      max = min;\n      min = 0;\n    }\n    return min + Math.floor(Math.random() * (max - min + 1));\n  };\n\n  // A (possibly faster) way to get the current timestamp as an integer.\n  _.now = Date.now || function() {\n    return new Date().getTime();\n  };\n\n   // List of HTML entities for escaping.\n  var escapeMap = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#x27;',\n    '`': '&#x60;'\n  };\n  var unescapeMap = _.invert(escapeMap);\n\n  // Functions for escaping and unescaping strings to/from HTML interpolation.\n  var createEscaper = function(map) {\n    var escaper = function(match) {\n      return map[match];\n    };\n    // Regexes for identifying a key that needs to be escaped\n    var source = '(?:' + _.keys(map).join('|') + ')';\n    var testRegexp = RegExp(source);\n    var replaceRegexp = RegExp(source, 'g');\n    return function(string) {\n      string = string == null ? '' : '' + string;\n      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n    };\n  };\n  _.escape = createEscaper(escapeMap);\n  _.unescape = createEscaper(unescapeMap);\n\n  // If the value of the named `property` is a function then invoke it with the\n  // `object` as context; otherwise, return it.\n  _.result = function(object, property, fallback) {\n    var value = object == null ? void 0 : object[property];\n    if (value === void 0) {\n      value = fallback;\n    }\n    return _.isFunction(value) ? value.call(object) : value;\n  };\n\n  // Generate a unique integer id (unique within the entire client session).\n  // Useful for temporary DOM ids.\n  var idCounter = 0;\n  _.uniqueId = function(prefix) {\n    var id = ++idCounter + '';\n    return prefix ? prefix + id : id;\n  };\n\n  // By default, Underscore uses ERB-style template delimiters, change the\n  // following template settings to use alternative delimiters.\n  _.templateSettings = {\n    evaluate    : /<%([\\s\\S]+?)%>/g,\n    interpolate : /<%=([\\s\\S]+?)%>/g,\n    escape      : /<%-([\\s\\S]+?)%>/g\n  };\n\n  // When customizing `templateSettings`, if you don't want to define an\n  // interpolation, evaluation or escaping regex, we need one that is\n  // guaranteed not to match.\n  var noMatch = /(.)^/;\n\n  // Certain characters need to be escaped so that they can be put into a\n  // string literal.\n  var escapes = {\n    \"'\":      \"'\",\n    '\\\\':     '\\\\',\n    '\\r':     'r',\n    '\\n':     'n',\n    '\\u2028': 'u2028',\n    '\\u2029': 'u2029'\n  };\n\n  var escaper = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n  var escapeChar = function(match) {\n    return '\\\\' + escapes[match];\n  };\n\n  // JavaScript micro-templating, similar to John Resig's implementation.\n  // Underscore templating handles arbitrary delimiters, preserves whitespace,\n  // and correctly escapes quotes within interpolated code.\n  // NB: `oldSettings` only exists for backwards compatibility.\n  _.template = function(text, settings, oldSettings) {\n    if (!settings && oldSettings) settings = oldSettings;\n    settings = _.defaults({}, settings, _.templateSettings);\n\n    // Combine delimiters into one regular expression via alternation.\n    var matcher = RegExp([\n      (settings.escape || noMatch).source,\n      (settings.interpolate || noMatch).source,\n      (settings.evaluate || noMatch).source\n    ].join('|') + '|$', 'g');\n\n    // Compile the template source, escaping string literals appropriately.\n    var index = 0;\n    var source = \"__p+='\";\n    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n      source += text.slice(index, offset).replace(escaper, escapeChar);\n      index = offset + match.length;\n\n      if (escape) {\n        source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n      } else if (interpolate) {\n        source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n      } else if (evaluate) {\n        source += \"';\\n\" + evaluate + \"\\n__p+='\";\n      }\n\n      // Adobe VMs need the match returned to produce the correct offest.\n      return match;\n    });\n    source += \"';\\n\";\n\n    // If a variable is not specified, place data values in local scope.\n    if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n    source = \"var __t,__p='',__j=Array.prototype.join,\" +\n      \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n      source + 'return __p;\\n';\n\n    try {\n      var render = new Function(settings.variable || 'obj', '_', source);\n    } catch (e) {\n      e.source = source;\n      throw e;\n    }\n\n    var template = function(data) {\n      return render.call(this, data, _);\n    };\n\n    // Provide the compiled source as a convenience for precompilation.\n    var argument = settings.variable || 'obj';\n    template.source = 'function(' + argument + '){\\n' + source + '}';\n\n    return template;\n  };\n\n  // Add a \"chain\" function. Start chaining a wrapped Underscore object.\n  _.chain = function(obj) {\n    var instance = _(obj);\n    instance._chain = true;\n    return instance;\n  };\n\n  // OOP\n  // ---------------\n  // If Underscore is called as a function, it returns a wrapped object that\n  // can be used OO-style. This wrapper holds altered versions of all the\n  // underscore functions. Wrapped objects may be chained.\n\n  // Helper function to continue chaining intermediate results.\n  var result = function(instance, obj) {\n    return instance._chain ? _(obj).chain() : obj;\n  };\n\n  // Add your own custom functions to the Underscore object.\n  _.mixin = function(obj) {\n    _.each(_.functions(obj), function(name) {\n      var func = _[name] = obj[name];\n      _.prototype[name] = function() {\n        var args = [this._wrapped];\n        push.apply(args, arguments);\n        return result(this, func.apply(_, args));\n      };\n    });\n  };\n\n  // Add all of the Underscore functions to the wrapper object.\n  _.mixin(_);\n\n  // Add all mutator Array functions to the wrapper.\n  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n    var method = ArrayProto[name];\n    _.prototype[name] = function() {\n      var obj = this._wrapped;\n      method.apply(obj, arguments);\n      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n      return result(this, obj);\n    };\n  });\n\n  // Add all accessor Array functions to the wrapper.\n  _.each(['concat', 'join', 'slice'], function(name) {\n    var method = ArrayProto[name];\n    _.prototype[name] = function() {\n      return result(this, method.apply(this._wrapped, arguments));\n    };\n  });\n\n  // Extracts the result from a wrapped and chained object.\n  _.prototype.value = function() {\n    return this._wrapped;\n  };\n\n  // Provide unwrapping proxy for some methods used in engine operations\n  // such as arithmetic and JSON stringification.\n  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n  _.prototype.toString = function() {\n    return '' + this._wrapped;\n  };\n\n  // AMD registration happens at the end for compatibility with AMD loaders\n  // that may not enforce next-turn semantics on modules. Even though general\n  // practice for AMD registration is to be anonymous, underscore registers\n  // as a named module because, like jQuery, it is a base library that is\n  // popular enough to be bundled in a third party lib, but not be part of\n  // an AMD load request. Those cases could generate an error when an\n  // anonymous define() is called outside of a loader request.\n  if (typeof define === 'function' && define.amd) {\n    define('underscore', [], function() {\n      return _;\n    });\n  }\n}.call(this));\n"
  },
  {
    "path": "seajs.html",
    "content": "<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>RongCloud Web SDK with Sea.js</title>\n</head>\n<body>\n\n\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/seajs/im.html\" class=\"get-source\">获取源码</a>\n\n<h1>seajs demo</h1>\n<p>seajs文档：https://seajs.github.io/seajs/docs/#docs</p>\n<pre id=\"show\"></pre>\n\n\n<script>\n\"use strict\";\nvar t1 = new Date().getTime();\n\nfunction showInfo(str){\n  var t = document.getElementById(\"show\");\n  var dt = new Date().getTime() - t1 + \" ms 后: \"\n  t.innerHTML += dt + str + \"<br>\";\n}\n\nshowInfo(\"开始加载\");\n\n\nfunction isSupport(APIName){\n  var d = document, w = window;\n  var id = \"RongCloudCloud-API-Test\" + new Date().getTime;\n  var iframe = d.getElementById(id);\n  if(!iframe){\n    iframe = d.createElement(\"iframe\");\n    iframe.id = id;\n    iframe.style.display = \"none\";\n    d.body.appendChild(iframe);\n  }\n  var nativeAPI = iframe.contentWindow[APIName];\n  var API = w[APIName];\n  if(API && nativeAPI.toString() == API.toString()){\n    return true;\n  }\n  return false;\n} \n</script>\n\n<script src=\"lib/seajs-2.1.1.js\"></script>\n  \n<script>\n\"use strict\";\n\n/*\nSet configuration\nhttps://github.com/seajs/seajs/issues/266\n*/\nseajs.config({\n  base : \"./\",\n  alias: {\n      protobuf: 'local-sdks/sdk/protobuf-2.3.7.min.js',\n      RongIMLib: 'local-sdks/sdk/RongIMLib-2.5.3.js'\n  }\n});\n\nvar isSupportSocket = isSupport(\"WebSocket\");\nif(isSupportSocket){\n  seajs.use(['protobuf','RongIMLib'], function(protobuf, RongIMLib) {\n      showInfo(\"require done\");\n      init(RongIMLib, protobuf);\n  });\n}else{\n  seajs.use(['RongIMLib'], function(RongIMLib) {\n      showInfo(\"require done\");\n\n      // var RongIMClient = RongIMLib.RongIMClient;\n\n      init(RongIMLib);\n  });\n}\n\nfunction init(RongIMLib, protobuf){\n  var appKey = \"8w7jv4qb78a9y\";\n  var token = \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\";\n  \n  var RongIMClient = RongIMLib.RongIMClient;\n\n  var RongIMClient = RongIMLib.RongIMClient;\n  var config = { };\n  if (protobuf) {\n    config.protobuf = protobuf;\n  }\n  //初始化\n  RongIMClient.init(appKey,null,{protobuf:protobuf});\n\n  var _instance = RongIMClient.getInstance();\n  // 连接状态监听器\n  RongIMClient.setConnectionStatusListener({\n    onChanged: function (status) {\n      console.info(status)\n        switch (status) {\n            case RongIMLib.ConnectionStatus.CONNECTED:\n                showInfo(\"链接成功\");\n                break;\n            case RongIMLib.ConnectionStatus.CONNECTING:\n                console.log('正在链接');\n                break;\n            case RongIMLib.ConnectionStatus.DISCONNECTED:\n                console.log('断开连接');\n                break;\n            case RongIMLib.ConnectionStatus.KICKED_OFFLINE_BY_OTHER_CLIENT:\n                console.log('其他设备登录');\n                break;\n              case RongIMLib.ConnectionStatus.DOMAIN_INCORRECT:\n                console.log('域名不正确');\n                break;\n            case RongIMLib.ConnectionStatus.NETWORK_UNAVAILABLE:\n              console.log('网络不可用');\n              break;\n            }\n    }\n  });\n  \n  RongIMClient.setOnReceiveMessageListener({\n    // 接收到的消息\n    onReceived: function (message) {\n        // 判断消息类型\n        // showTips(\"新消息，类型为：\" + message.messageType);\n            // showResult(\"新消息\",message,start);\n            console.log(message);\n\n        switch(message.messageType){\n            case RongIMClient.MessageType.TextMessage:\n              /*\n              显示消息方法： \n              消息里是 原生emoji\n              RongIMLib.RongIMEmoji.emojiToHTML(message.content.content);\n                */\n                break;\n            case RongIMClient.MessageType.VoiceMessage:\n                // 对声音进行预加载                \n                // message.content.content 格式为 AMR 格式的 base64 码\n                break;\n            case RongIMClient.MessageType.ImageMessage:\n               // message.content.content => 图片缩略图 base64。\n               // message.content.imageUri => 原图 URL。\n               break;\n            case RongIMClient.MessageType.DiscussionNotificationMessage:\n               // message.content.extension => 讨论组中的人员。\n               break;\n            case RongIMClient.MessageType.LocationMessage:\n               // message.content.latiude => 纬度。\n               // message.content.longitude => 经度。\n               // message.content.content => 位置图片 base64。\n               break;\n            case RongIMClient.MessageType.RichContentMessage:\n               // message.content.content => 文本消息内容。\n               // message.content.imageUri => 图片 base64。\n               // message.content.url => 原图 URL。\n               break;\n            case RongIMClient.MessageType.InformationNotificationMessage:\n                // do something...\n               break;\n            case RongIMClient.MessageType.ContactNotificationMessage:\n                // do something...\n               break;\n            case RongIMClient.MessageType.ProfileNotificationMessage:\n                // do something...\n               break;\n            case RongIMClient.MessageType.CommandNotificationMessage:\n                // do something...\n               break;\n            case RongIMClient.MessageType.CommandMessage:\n                // do something...\n               break;\n            case RongIMClient.MessageType.UnknownMessage:\n                // do something...\n               break;\n            default:\n                // do something...\n        }\n    }\n  });\n  \n  \n  //开始链接\n  RongIMClient.connect(token, {\n    onSuccess: function(userId) {\n      showInfo(\"链接成功，用户id：\" + userId);\n            sendMessage();\n            getConversationList();\n    },\n    onTokenIncorrect: function() {\n      showInfo('token无效');\n    },\n    onError:function(errorCode){\n      var info = '';\n      switch (errorCode) {\n        case RongIMLib.ErrorCode.TIMEOUT:\n          info = '超时';\n          break;\n        case RongIMLib.ErrorCode.UNKNOWN_ERROR:\n          info = '未知错误';\n          break;\n        case RongIMLib.ErrorCode.UNACCEPTABLE_PaROTOCOL_VERSION:\n          info = '不可接受的协议版本';\n          break;\n        case RongIMLib.ErrorCode.IDENTIFIER_REJECTED:\n          info = 'appkey不正确';\n          break;\n        case RongIMLib.ErrorCode.SERVER_UNAVAILABLE:\n          info = '服务器不可用';\n          break;\n      }\n      console.log(info);\n    }\n  });\n\n  function getConversationList(){\n    _instance.getConversationList({\n      onSuccess: function(list){\n        showInfo(JSON.stringify(list, null, '\\t'));\n      },\n      onError:function(errorCode){\n         showInfo(errorCode);\n      }\n    }, null, 2);\n  }\n  \n  function sendMessage(){\n    var msg = new RongIMLib.TextMessage({content:\"hello RongCloud!\",extra:\"附加信息\"});\n    var conversationtype = RongIMLib.ConversationType.PRIVATE;\n    var targetId = \"tester\";\n    _instance.sendMessage(conversationtype, targetId, msg, {\n            onSuccess: function (message) {\n              console.log(message);\n                showInfo(JSON.stringify(message, null, '\\t'));\n            },\n            onError: function (errorCode,message) {\n                showInfo(errorCode);\n            }\n      });\n  }\n}\n</script>\n</body>\n</html>"
  },
  {
    "path": "sticker/README.md",
    "content": "### 动态表情\n\n>基本概念\n\n`表情包`: 表情包下包含一组表情，可同时存在多个表情包\n\n`表情`: 具体的动态表情，表情一定归属于一个表情包\n\n**兼容性**: IE6+、Chrome、FireFox、Safari、iOS Safari、Android4.0+ 的浏览器\n\n### 引入\n\n```js\n// Noraml\n<script src=\"http[s]://cdn.ronghub.com/rong-sticker-1.0.0[.min].js\"></script>\n\n// RequieJS\nrequire.config({\n  paths: {\n    RongSticker: 'http[s]://cdn.ronghub.com/rong-sticker-1.0.0[.min]'\n  }\n});\n\nrequire(['RongSticker'], function(RongSticker) {\n  // 用法请参考: https://github.com/rongcloud/websdk-demo/sticker/sticker.html\n});\n```\n\n### 示例\n\n`动态表情`: https://github.com/rongcloud/websdk-demo/sticker/sticker.html\n\n`IM 收发表情`: https://github.com/rongcloud/websdk-demo/sticker/message.html\n\n### 接口\n\n#### 初始化\n\n**API**: `RongSticker.init(config);`\n\n**config 说明**:\n\n| 属性名   | 类型    | 必传 |说明           | 版本   |\n| :-----    | :-----  | :----- |:-------------- | :----- |\n| appkey      | String | 是 | 应用的唯一标识，创建应用请移步 [开发者后台](https://developer.rongcloud.cn/) | 1.0.0 |\n| url  | String | 否| 表情包获取服务地址 | 1.0.0 |\n| extensions  | Array | 否|扩展消息包 | 1.0.0 |\n\n**示例**:\n\n```js\nvar config = {\n  appkey: 'appkey'\n};\nvar rongSticker = RongSticker.init(config);\n```\n\n**扩展包示例**:\n\n```js\nvar extensions = [{\n  // 表情包 Id\n  id: \"c60plBGwk2686yv4vmv4H9\", \n  name: \"嗨宝宝\",  \n  desc: \"融云自制表情嗨宝宝\", \n  icon: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/icon_c60plBGwk2686yv4vmv4H9.png\", \n  poster: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/cover_c60plBGwk2686yv4vmv4H9.png\", \n  order: 1, \n  author: \"rongcloud\", \n  copyright: \"rongcloud\",\n  // 表情列表\n  stickers: [{\n    id: \"c60plBGwk2686yv4vmv4H9\", \n    name: \"嗨宝宝\",  \n    desc: \"融云自制表情嗨宝宝\", \n    icon: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/icon_c60plBGwk2686yv4vmv4H9.png\", \n    poster: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/cover_c60plBGwk2686yv4vmv4H9.png\", \n    order: 1, \n    author: \"rongcloud\", \n    copyright: \"rongcloud\"\n  }]\n}];\n\nvar config = {\n  appkey: 'appkey',\n  extensions: extensions\n};\nvar rongSticker = RongSticker.init(config);\n```\n\n\n#### 获取表情包列表\n\n**API**: `Package.getList(callback);`\n\n**参数说明**:\n\n| 属性名   | 类型     | 必传 |说明           | 版本   |\n| :-----   | :-----   | :--- |:-------------- | :----- |\n| callback| Function| 是 | 回调函数，用来接收数据| 1.0.0 |\n\n**示例**:\n\n```js\nvar config = {\n  appkey: 'appkey'\n};\nvar rongSticker = RongSticker.init(config);\nvar Package = rongSticker.Package;\nPackage.getList(function(result, error){\n  // result.packages => 表情包列表\n  // error => 错误信息，正常返回时 error 为 null\n});\n```\n\n**packages 结构**:\n\n```js\n[\n  {\n    id: \"c60plBGwk2686yv4vmv4H9\", \n    name: \"嗨宝宝\",  \n    desc: \"融云自制表情嗨宝宝\", \n    icon: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/icon_c60plBGwk2686yv4vmv4H9.png\", \n    poster: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/cover_c60plBGwk2686yv4vmv4H9.png\", \n    order: 1, \n    author: \"rongcloud\", \n    copyright: \"rongcloud\"\n  }\n]\n```\n\n#### 获取表情列表\n\n**API**: `Sticker.getList(package, callback);`\n\n**package**:\n\n| 属性名   | 类型     | 必传 | 说明           | 版本   |\n| :-----   | :-----   | :----| :-------------- | :----- |\n| id      | String  | 是 |表情包 Id | 1.0.0 |\n\n**callback**:\n\n| 属性名   | 类型     | 必传 |说明           | 版本   |\n| :-----   | :-----   | :--- | :-------------- | :----- |\n| callback| Function| 是 | 回调函数，用来接收数据| 1.0.0 |\n\n**示例**:\n\n```js\nvar config = {\n  appkey: 'appkey'\n};\nvar rongSticker = RongSticker.init(config);\nvar Sticker = rongSticker.Sticker;\n\nvar package = {\n  id: 'c60plBGwk2686yv4vmv4H9'\n};\nSticker.getList(function(result, error){\n  // result.stickers => 表情列表\n  // error => 错误信息，正常返回时 error 为 null\n});\n```\n\n**stickers 结构**:\n\n```js\n[\n  {\n    packageId: \"c60plBGwk2686yv4vmv4H9\"\n    stickerId: \"d1PN1xTZ47p9nfMNWfGpyH\", \n    desc: \"木问题\", \n    url: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/image_d1PN1xTZ47p9nfMNWfGpyH.gif\", \n    thumbUrl: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/thumb_d1PN1xTZ47p9nfMNWfGpyH.png\", \n    height: 240, \n    width: 240, \n    order: 1\n  }\n]\n```\n#### 获取表情\n\n**API**: `Sticker.get(stciker, callback);`\n\n**stciker**:\n\n| 属性名     | 类型     |  必传 | 说明           | 版本   |\n| :-----     | :-----   | :----- | :-------------- | :----- |\n| packageId | String  | 是 | 表情包 Id | 1.0.0 |\n| stickerId | String  | 是 | 表情 Id | 1.0.0 |\n\n**callback**:\n\n| 属性名   | 类型     | 必传 |说明           | 版本   |\n| :-----   | :-----   | :--- | :-------------- | :----- |\n| callback| Function| 是 | 回调函数，用来接收数据| 1.0.0 |\n\n**示例**:\n\n```js\nvar config = {\n  appkey: 'appkey'\n};\nvar rongSticker = RongSticker.init(config);\nvar Sticker = rongSticker.Sticker;\n\nvar sticker = {\n  packageId: 'c60plBGwk2686yv4vmv4H9',\n  stickerId: 'd1PN1xTZ47p9nfMNWfGpyH'\n};\nSticker.get(function(sticker, error){\n  // sticker => 表情\n  // error => 错误信息，正常返回时 error 为 null\n});\n```\n\n**sticker 结构**:\n\n```js\n{\n  packageId: \"c60plBGwk2686yv4vmv4H9\"\n  stickerId: \"d1PN1xTZ47p9nfMNWfGpyH\", \n  desc: \"木问题\", \n  url: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/image_d1PN1xTZ47p9nfMNWfGpyH.gif\", \n  thumbUrl: \"http://sticker.ronghub.com/c60plBGwk2686yv4vmv4H9/thumb_d1PN1xTZ47p9nfMNWfGpyH.png\", \n  height: 240, \n  width: 240, \n  order: 1\n}\n```\n"
  },
  {
    "path": "sticker/extend-stickers/extend-sticker.js",
    "content": "var extendPackages = [{\n  id: 'Kdlak121b2jkdalkn',\n  icon: './extend-stickers/person/icon.png',\n  name: '人',\n  order: 11,\n  poster: '',\n  stickers: [{\n    packageId: 'Kdlak121b2jkdalkn',\n    stickerId: '1',\n    thumbUrl: './extend-stickers/person/1.gif',\n    url: './extend-stickers/person/1.gif',\n    desc: '摇摆',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Kdlak121b2jkdalkn',\n    stickerId: '2',\n    thumbUrl: './extend-stickers/person/2.png',\n    url: './extend-stickers/person/2.png',\n    desc: '喵星人',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Kdlak121b2jkdalkn',\n    stickerId: '3',\n    thumbUrl: './extend-stickers/person/3.png',\n    url: './extend-stickers/person/3.png',\n    desc: '爱上他',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Kdlak121b2jkdalkn',\n    stickerId: '4',\n    thumbUrl: './extend-stickers/person/4.png',\n    url: './extend-stickers/person/4.png',\n    desc: '打不过我',\n    height: 100,\n    width: 100\n  }]\n},{\n  id: 'Fkl12686yv4vmv4H9',\n  icon: './extend-stickers/mixed/icon.png',\n  name: '混合',\n  order: 10,\n  poster: '',\n  stickers: [{\n    packageId: 'Fkl12686yv4vmv4H9',\n    stickerId: '1',\n    thumbUrl: './extend-stickers/mixed/1.png',\n    url: './extend-stickers/mixed/1.png',\n    desc: '你丑',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Fkl12686yv4vmv4H9',\n    stickerId: '2',\n    thumbUrl: './extend-stickers/mixed/2.png',\n    url: './extend-stickers/mixed/2.png',\n    desc: '撩你',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Fkl12686yv4vmv4H9',\n    stickerId: '3',\n    thumbUrl: './extend-stickers/mixed/3.png',\n    url: './extend-stickers/mixed/3.png',\n    desc: '喵星人',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Fkl12686yv4vmv4H9',\n    stickerId: '4',\n    thumbUrl: './extend-stickers/mixed/4.png',\n    url: './extend-stickers/mixed/4.png',\n    desc: '卖了你',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Fkl12686yv4vmv4H9',\n    stickerId: '5',\n    thumbUrl: './extend-stickers/mixed/5.gif',\n    url: './extend-stickers/mixed/5.gif',\n    desc: '厉害',\n    height: 100,\n    width: 100\n  },{\n    packageId: 'Fkl12686yv4vmv4H9',\n    stickerId: '6',\n    thumbUrl: './extend-stickers/mixed/6.gif',\n    url: './extend-stickers/mixed/6.gif',\n    desc: '摇摆',\n    height: 100,\n    width: 100\n  }]\n}];"
  },
  {
    "path": "sticker/init.js",
    "content": "function init(params, callbacks) {\n\tvar appkey = params.appkey;\n\tvar token = params.token;\n\tvar navi = params.navi || \"\";\n\tvar userId = params.userId;\n\tvar protobuf = params.protobuf || null;\n\n\tvar RongIMClient = RongIMLib.RongIMClient;\n\n\tvar config = {\n\t\tshowError: true , \n\t\tisPolling: false\n\t};\n\n\t//私有云切换navi导航\n\tif (navi !== \"\") {\n\t\tconfig.navi = navi;\n\t}\n\n\t//私有云切换api\n\tvar api = params.api || \"\";\n\tif (api !== \"\") {\n\t\tconfig.api = api;\n\t}\n\n\t//support protobuf url + function\n\tif (protobuf != null) {\n\t\tconfig.protobuf = protobuf;\n\t};\n\n\tvar imClient = params.imClient;\n\tvar dataProvider = null;\n\tif (imClient) {\n\t\tdataProvider = new RongIMLib.VCDataProvider(imClient);\n\t}\n\n\tvar sdkInfo = RongIMClient.init(appkey, dataProvider, config) || {};\n\n\t//if (RongMessageTypes.chatroom) {\n\t\t//RongIMClient.getInstance().setMessageTypes(RongMessageTypes.chatroom);\n\t//}\n\nvar messageName = \"StickerMessage\"; // 消息名称。\nvar objectName = \"RC:StkMsg\";\nvar messageTag = new RongIMLib.MessageTag(true, true);\nvar prototypes = [\"packageId\", \"stickerId\", \"digest\", \"height\", \"width\"];\nRongIMClient.registerMessageType(messageName,objectName, messageTag, prototypes);\n\n\tvar instance = RongIMClient.getInstance();\n\n\t// 连接状态监听器\n\tRongIMClient.setConnectionStatusListener({\n\t\tonChanged: function(status) {\n\t\t\tconsole.log('status', status);\n\t\t\tswitch (status) {\n\t\t\t\tcase RongIMLib.ConnectionStatus.CONNECTED:\n\t\t\t\t\tcallbacks.connected && callbacks.connected(instance);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\tcase 4:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\t\tcallbacks.disconnectd && callbacks.disconnectd();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t});\n\n\t/*\n\t文档：http://www.rongcloud.cn/docs/web.html#3、设置消息监听器\n\n\t注意事项：\n\t\t1：为了看到接收效果，需要另外一个用户向本用户发消息\n\t\t2：判断会话唯一性 ：conversationType + targetId\n\t\t3：显示消息在页面前，需要判断是否属于当前会话，避免消息错乱。\n\t\t4：消息体属性说明可参考：http://rongcloud.cn/docs/api/js/index.html\n\t*/\n\tRongIMClient.setOnReceiveMessageListener({\n\t\t// 接收到的消息\n\t\tonReceived: function(message) {\n\t\t\tcallbacks.received && callbacks.received(message);\n\t\t}\n\t});\n\n\n\tvar connect = function(config) {\n\t\tconfig = config || {};\n\t\t//开始链接\n\t\tRongIMClient.connect(token, {\n\t\t\tonSuccess: function(userId) {\n\t\t\t\tconsole.log(\"链接成功，用户id：\" + userId);\n\t\t\t},\n\t\t\tonTokenIncorrect: function() {\n\t\t\t\tconsole.log('token无效');\n\t\t\t},\n\t\t\tonError: function(errorCode) {\n\t\t\t\tconsole.log(errorCode);\n\t\t\t}\n\t\t});\n\t};\n\n\tvar connectMap = {\n\t\tdesktop: function() {\n\t\t\tvar config = {\n\t\t\t\tappkey: appkey,\n\t\t\t\tuserId: 'GVJccf6KwCHLYmWaRAfTeX',\n\t\t\t\ttoken: token,\n\t\t\t\tversion: sdkInfo.ver,\n\t\t\t\turl: \"https://\" + navi + \"/navi.json\"\n\t\t\t};\n\t\t\tRongDesktop.Navi.get(config, function(error, result){\n\t\t\t\tconnect(result);\n\t\t\t});\n\t\t},\n\t\tweb: function() {\n\t\t\tconnect();\n\t\t}\n\t};\n\tvar type = imClient ? 'desktop' : 'web';\n\tconnectMap[type]();\n}"
  },
  {
    "path": "sticker/message.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Sticker</title>\n  <style>\n    ul,li{\n      margin: 0;\n      list-style: none;\n      padding: 0;\n    }\n    li{\n      display: inline-block;\n    }\n    .rong-container{\n      margin: 5% auto;\n      height: 480px;\n      width: 1000px;\n    }\n    .rong-editor{\n      height: 480px;\n      width: 50%;\n      background-color: #bc8f8f;\n      float: left;\n      position: relative;\n    }\n    .rong-stickers{\n      padding: 20px;\n    }\n    .rong-sticker{\n      margin: 3px 11px;\n    }\n    .rong-sticker img{\n      width: 90px;\n    }\n    .rong-sticker:hover{\n      background-color: #F5F5DC;\n      cursor: pointer;\n      border-radius: 10px;\n    }\n    .rong-packages{\n      position: absolute;\n      bottom: 0;\n      padding: 0;\n      width: 100%;\n      box-sizing: border-box;\n      border-top: 1px solid #F0FFFF;\n    }\n    .rong-package{\n      height: 30px;\n      width: 30px;\n      height: 30px;\n      width: 30px;\n      margin: 12px 0 0 7px;\n      padding-left: 6px;\n      background-size: contain;\n      background-repeat: no-repeat;\n      background-position: center;\n      border: 1px solid #FFF;\n      border-radius: 5px;\n    }\n    .rong-package:hover{\n      cursor: pointer;\n      background-color: #F0FFFF;\n    }\n    .rong-show{\n      height: 480px;\n      width: 50%;\n      background-color:#b0e0e6;\n      float: right;\n    }\n    .rong-message-list{\n      height: 390px;\n      overflow-y: auto;\n    }\n    .rong-message{\n      min-height: 25px;\n      background-color: #FFF;\n      border-radius: 4px;\n      padding: 2px 5px;\n      max-width: 80%;\n      margin-top: 10px;\n      display: table;\n    }\n    .rong-message-editor{\n      border-top: 1px solid #F0FFFF;\n      height: 49px;\n      position: relative;\n    }\n    .rong-message-input{\n      outline: none;\n      resize: none;\n      border: none;\n      margin: 8px 5px;\n      width: 83%;\n    }\n    .rong-buttons{\n      width: 1000px;\n      margin: 20px auto;\n    }\n    .rong-buttons input[type=text]{\n      background-color: red;\n      border: none;\n      background: none;\n      border-bottom: 1px solid #b0e0e6;\n      outline: none;\n      width: 90%;\n      line-height: 42px;\n    }\n    .rong-buttons [type=button], .rong-button{\n      background: none;\n      outline: none;\n      border: none;\n      border-radius: 5px;\n      background: lightblue;\n    }\n    .rong-buttons [type=button]:hover, .rong-button:hover{\n      cursor: pointer;\n      background-color: #F0F8FF;\n    }\n    .rong-buttons [type=button]{\n      height: 40px;\n      margin: 20px 20px 0 0;\n    }\n    .rong-buttons span{\n      text-align: right;\n      width: 90px;\n      display: inline-block;\n      font-size: 12px;\n    }\n    .rong-buttons [value=connect]{\n      margin-left: 95px;\n    }\n    .rong-button-send{\n      height: 30px;\n      width: 60px;\n      position: absolute;\n      right: 10px;\n      top: 11px;\n    }\n    .rong-token{\n      width: 401px;\n    }\n    .rong-message-list img{\n      width: 100px;\n    }\n    .rong-warn{\n      color: #FF0000;\n    }\n  </style>\n</head>\n<body>\n  <script src=\"//cdn.ronghub.com/rong-sticker-1.0.0.js\"></script>\n  <script src=\"//cdn.ronghub.com/RongIMLib-2.5.1.js\"></script>\n  <script src=\"./init.js\"></script>\n  <div class=\"rong-container\" style=\"display: none;\">\n    <div class=\"rong-editor\">\n      <ul class=\"rong-stickers rong-editor-stickers\"></ul>\n      <ul class=\"rong-packages\"></ul>\n    </div>\n    <div class=\"rong-show\">\n      <div class=\"rong-stickers rong-message-list\">\n      </div>\n\n      <div class=\"rong-message-editor\">\n          <textarea class=\"rong-message-input\"></textarea>\n          <input class=\"rong-button rong-button-send\" type=\"button\" value=\"发送\"  onclick=\"sendCommand('send')\">\n      </div>\n    </div>\n    <div class=\"rong-warn\">\n      Demo 兼容性：\n      <span>Desktop：IE9+、Chrome、FireFox、Safari 移动端：Android4.4+、iOS、微信浏览器</span>\n    </div>\n  </div>\n\n  <div class=\"rong-buttons\" >\n      <span>Appkey:</span> <input type=\"text\" value=\"8luwapkvucoil\" placeholder=\"appkey\" id=\"appkey\"><br/>\n      <span>导航:</span> <input type=\"text\" value=\"nav.cn.ronghub.com\" placeholder=\"nav\" id=\"nav\"><br/>\n      <span>Token: </span> <input type=\"text\" value=\"nMBnd1tfhRXXC4k0LA/tgbrkPG6U/xPk3zvPIWf9le00WpXoGCi74G0J3j8FrBLZvooqg3jC7Xf3k2fSwL5MX7qw5Xap7yf5\" placeholder=\"token\" id=\"token\" class=\"rong-token\"><br/>\n      <span>会话类型: </span> <input type=\"text\" id=\"conversationType\" placeholder=\"conversationType\" value=\"1\"><br/>\n      <span>targetId: </span> <input type=\"text\" id=\"targetId\" placeholder=\"targetId\" value=\"sLakct3QJ\"><br/>\n      <input type=\"button\" value=\"connect\" onclick=\"connect()\">\n  </div>\n\n  <script>\n      var config = {\n        appkey: 'appkey'\n      };\n      var rongSticker = RongSticker.init(config);\n      var Sticker = rongSticker.Sticker;\n      var Package = rongSticker.Package;\n      var utils = rongSticker.utils;\n      \n      var getDom = function(name){\n        return document.getElementsByClassName(name)[0] || document.getElementById(name);\n      };\n      \n      var conversation = {\n        get: function(){\n          return {\n            conversationType: getDom('conversationType').value,\n            targetId: getDom('targetId').value\n          };\n        }\n      };\n      var packagesNode = getDom('rong-packages');\n      var tpl = '<li class=\"rong-package\" packageid={packageId} style=\"background-image: url({url})\"></li>';\n      Package.getList(function(result){\n        var packages = result.packages;\n        utils.forEach(packages, function(package){\n          packagesNode.innerHTML += utils.tplEngine(tpl, {\n            packageId: package.id,\n            url: package.icon\n          });\n        });\n        \n        packagesNode.onclick = function(event){\n          var target = event.target;\n          var pacakgeId = target.getAttribute('packageid');\n          if(pacakgeId){\n            getStickers(pacakgeId);\n          }\n        };\n      });\n      \n      var stickersNode = getDom('rong-editor-stickers');\n      var showNode = getDom('rong-message-list');\n      function getStickers(pacakgeId){ \n        stickersNode.innerHTML = '';\n\n        var package = {\n          id: pacakgeId\n        };\n   \n        var tpl = [\n          '<li class=\"rong-sticker\" >',\n            '<img src=\"{url}\" alt=\"{desc}\" sheight={height} swidth={width} packageid={packageId} stickerid={stickerId}>',\n          '</li>'\n        ].join('');\n        Sticker.getList(package, function(result, error){\n          var stickers = result.stickers;\n          utils.forEach(stickers, function(sticker){\n            stickersNode.innerHTML += utils.tplEngine(tpl, sticker);\n          });\n        });\n\n        stickersNode.onclick = function(event){\n          var target = event.target;\n          var packageId = target.getAttribute('packageid');\n          var stickerId = target.getAttribute('stickerid');\n          var height = +target.getAttribute('sheight');\n          var width = +target.getAttribute('swidth');\n\n          var digest = target.getAttribute('alt');\n          if(packageId){\n            var params = {\n              packageId: packageId,\n              stickerId: stickerId,\n              digest: digest,\n              height: height,\n              width: width\n            };\n            sendCommand('sendSticker', params);\n          }\n        };\n      }\n\n      var messagesNode = getDom('rong-message-list');\n      var log = {\n        clear: function(){\n          messagesNode.innerHTML = '';\n        },\n        show: function(message){\n          \n          var messageTpl = '<div class=\"rong-message\">{content}</div>'\n\n          if(typeof message == 'string'){\n            return messagesNode.innerHTML += utils.tplEngine(messageTpl, {\n              content: message\n            });\n          }\n\n          var messageMap = {\n            TextMessage: function(){\n              return messagesNode.innerHTML += utils.tplEngine(messageTpl, {\n                content: message.content.content\n              });\n            },\n            StickerMessage: function(){\n              var tpl = '<img src=\"{url}\">';\n              var content = message.content;\n              Sticker.get(content, function(sticker){\n                var html = utils.tplEngine(tpl, sticker);\n                messagesNode.innerHTML += utils.tplEngine(messageTpl, {\n                  content: html\n                });\n              });\n            }\n          };\n\n          var defHandler = function(){\n            messagesNode.innerHTML += utils.tplEngine(messageTpl, {\n                  content: JSON.stringify(message)\n                });\n          };\n          var messageType = message.messageType;\n          var format = messageMap[messageType] || defHandler;\n          format();\n          \n        }\n      };\n\n      function clearResult(){\n        log.clear();\n      }\n      \n      var mainNode = getDom('rong-container');\n      var buttonsNode = getDom('rong-buttons');\n\n      function connect(){\n        var appkey = getDom('appkey').value;\n        var token = getDom('token').value;\n        var navi = getDom('nav').value;\n        \n\n        var params = {\n          appkey: appkey,\n          token: token,\n          navi: navi\n        };\n        var callbacks = {\n          connected: function(_Rong){\n            Rong = _Rong;\n            buttonsNode.style.display = 'none';\n            mainNode.style.display = 'block';\n          },\n          disconnectd: function(){\n            Rong = null;\n          },\n          received: function(message){\n            log.show(message);\n          }\n        };\n        init(params, callbacks);\n      }\n      \n      var contentNode = getDom('rong-message-input');\n      var handler = {\n        send: function(){\n          var value = contentNode.value;\n          if(value == ''){\n            return;\n          }\n          contentNode.value = '';\n          var date = new Date();\n          var content = value;\n          var msg = new RongIMLib.TextMessage({content: content});\n          var info = conversation.get();\n          Rong.sendMessage(+info.conversationType, info.targetId, msg, {\n            onSuccess: function(message) {\n              log.show(message);\n              },\n              onError: function(error, message) {\n                log.show(message);\n              }\n          });\n        },\n        sendSticker: function(content){\n          var msg = new RongIMClient.RegisterMessage.StickerMessage(content);\n          var info = conversation.get();\n          Rong.sendMessage(+info.conversationType, info.targetId, msg, {\n            onSuccess: function(message) {\n              log.show(message);\n              },\n              onError: function(error, message) {\n                log.show(message);\n              }\n          });\n        },\n        getHistory: function(){\n          var params = conversation.get();\n          Rong.getHistoryMessages(+params.conversationType, params.targetId, null, 10, {\n            onSuccess: function(list) {\n              if(list.length == 0){\n                return log.show('无历史消息记录');\n              }\n              for (var i = 0, len=list.length; i < len; i++) {\n                log.show(list[i]);\n              }\n\n              },\n              onError: function(error) {\n                log.show(error);\n              }\n          });\n        }\n      };\n      function sendCommand(type, content){\n        if (typeof Rong == 'undefined') {\n          alert('请先连接.');\n          return;\n        }\n        return handler[type](content);\n      }\n    </script>\n\n\n</body>\n</html>"
  },
  {
    "path": "sticker/require.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Sticker</title>\n</head>\n<body>\n  <script src=\"../lib/require.js\"></script>\n  <div id=\"log\"></div>\n  <script>\n\n    var logNode = document.getElementById('log');\n    var showLogs = function(log){\n      if(typeof log != 'string'){\n        log = JSON.stringify(log, null, '  ')\n      }\n      logNode.innerHTML += '<pre>' + log + '</pre>'\n    };\n    require.config({\n        paths: {\n          RongSticker: 'https://cdn.ronghub.com/rong-sticker-1.0.0'\n        }\n    });\n\n    require(['RongSticker'], function(RongSticker) {\n      var config = {\n        appkey: 'appkey'\n      };\n      var rongSticker = RongSticker.init(config);\n      showLogs('初始化成功...');\n      var Package = rongSticker.Package;\n      Package.getList(function(result, error){\n        var packages = result.packages;\n        if(!error){\n          showLogs('获取表情包成功:');\n          showLogs(packages);\n          return;\n        }\n        showLogs('获取表情包失败:');\n        showLogs(error);\n      });\n    });\n  </script>\n</body>\n</html>"
  },
  {
    "path": "sticker/sticker.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Sticker</title>\n  <style>\n    html,body{\n      background-color: #f0f8ff;\n    }\n    ul,li{\n      margin: 0;\n      list-style: none;\n    }\n    li{\n      display: inline-block;\n    }\n    .rong-container{\n      margin: 5% auto;\n      height: 480px;\n      width: 1000px;\n    }\n    .rong-editor{\n      height: 480px;\n      width: 50%;\n      background-color: #bc8f8f;\n      float: left;\n      position: relative;\n    }\n    .rong-show{\n      height: 480px;\n      width: 50%;\n      background-color:#b0e0e6;\n      float: right;\n      position: relative;\n    }\n    .rong-show-stickers{\n      height: 395px;\n      overflow-y: auto;\n    }\n    .rong-buttons{\n      position: absolute;\n      bottom: 5px;\n      right: 10px;\n    }\n    .rong-button{\n      height: 30px;\n      width: 60px;\n      background: none;\n      outline: none;\n      border: none;\n      border-radius: 5px;\n    }\n    .rong-button:hover{\n      cursor: pointer;\n      background-color: #F0F8FF;\n    }\n    .rong-stickers{\n      padding: 20px;\n    }\n    .rong-sticker{\n      margin: 3px 11px;\n    }\n    .rong-sticker img{\n      width: 90px;\n    }\n    .rong-sticker:hover{\n      background-color: #F5F5DC;\n      cursor: pointer;\n      border-radius: 10px;\n    }\n    .rong-packages{\n      position: absolute;\n      bottom: 0;\n      padding: 0;\n      width: 100%;\n      box-sizing: border-box;\n      border-top: 1px solid #F0FFFF;\n    }\n    .rong-package{\n      height: 30px;\n      width: 30px;\n      height: 30px;\n      width: 30px;\n      margin: 12px 0 0 7px;\n      padding-left: 6px;\n      background-size: contain;\n      background-repeat: no-repeat;\n      background-position: center;\n      border: 1px solid #FFF;\n      border-radius: 5px;\n    }\n    .rong-package:hover{\n      cursor: pointer;\n      background-color: #F0FFFF;\n    }\n    .rong-warn{\n      color: #FF0000;\n    }\n  </style>\n</head>\n<body>\n  <script src=\"//cdn.ronghub.com/rong-sticker-1.0.0.js\"></script>\n  <script src=\"./extend-stickers/extend-sticker.js\"></script>\n  <div class=\"rong-container\">\n    <div class=\"rong-editor\">\n      <ul class=\"rong-stickers rong-editor-stickers\" id=\"rong-editor-stickers\"></ul>\n      <ul class=\"rong-packages\" id=\"rong-packages\"></ul>\n    </div>\n    <div class=\"rong-show\">\n      <ul class=\"rong-stickers rong-show-stickers\" id=\"rong-show-stickers\"></ul>\n      <div class=\"rong-buttons\">\n        <input class=\"rong-button rong-button-clear\" id=\"rong-button-clear\" type=\"button\" value=\"清空\">\n      </div>\n    </div>\n    <div class=\"rong-warn\">\n      Demo 兼容性：\n      <span>Desktop：IE9+、Chrome、FireFox、Safari 移动端：Android4.4+、iOS、微信浏览器</span>\n    </div>\n  </div>\n  <script>\n      var config = {\n        appkey: 'appkey',\n        // extendPackages 来源 extend-stickers 目录下 extend-sticker.js\n        extensions: extendPackages\n      };\n      var rongSticker = RongSticker.init(config);\n      var Sticker = rongSticker.Sticker;\n      var Package = rongSticker.Package;\n      var utils = rongSticker.utils;\n      \n      var getDom = function(id){\n        return document.getElementById(id);\n      };\n\n      var packagesNode = getDom('rong-packages');\n      var tpl = '<li class=\"rong-package\" packageid={packageId} style=\"background-image: url({url})\"></li>';\n      Package.getList(function(result){\n        var packages = result.packages;\n        utils.forEach(packages, function(package){\n          packagesNode.innerHTML += utils.tplEngine(tpl, {\n            packageId: package.id,\n            url: package.icon\n          });\n        });\n        \n        packagesNode.onclick = function(_event){\n          var target = _event.target;\n          var pacakgeId = target.getAttribute('packageid');\n          if(pacakgeId){\n            getStickers(pacakgeId);\n          }\n        };\n      });\n      \n      var stickersNode = getDom('rong-editor-stickers');\n      var showNode = getDom('rong-show-stickers');\n      function getStickers(pacakgeId){ \n        stickersNode.innerHTML = '';\n\n        var package = {\n          id: pacakgeId\n        };\n   \n        var tpl = [\n          '<li class=\"rong-sticker\" >',\n            '<img src=\"{url}\" alt=\"{desc}\" packageid={packageId} stickerid={stickerId}>',\n          '</li>'\n        ].join('');\n        Sticker.getList(package, function(result, error){\n          var stickers = result.stickers;\n          utils.forEach(stickers, function(sticker){\n            stickersNode.innerHTML += utils.tplEngine(tpl, sticker);\n          });\n        });\n\n        stickersNode.onclick = function(event){\n          var target = event.target;\n          var packageId = target.getAttribute('packageid');\n          var stickerId = target.getAttribute('stickerid');\n\n          if(packageId){\n            var params = {\n              packageId: packageId,\n              stickerId: stickerId\n            };\n            Sticker.get(params, function(sticker, error){\n              showNode.innerHTML += utils.tplEngine(tpl, sticker);\n            });\n          }\n        };\n      }\n\n      var clearNode = getDom('rong-button-clear');\n      clearNode.onclick = function(){\n        showNode.innerHTML = '';\n      };\n    </script>\n</body>\n</html>"
  },
  {
    "path": "switch-users.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>用户切换</title>\n</head>\n<body>\n\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/switch-users.html\" class=\"get-source\">获取源码</a>\n<style>\npre{\n\tvertical-align:top;\n\tdisplay:inline-block;\n\twidth:45%;\n\tborder-top:1px dotted #ccc;\n\tpadding:5px 0 0 10px;\n\tline-height:1.5;\n\tcolor:#333;\n\tbackground:#f5f5f5;\n\tmargin-left:1em;\n\tfont-size:12px;\n\tfont-family:verdana;\n}\t\n</style>\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script src=\"./init.js\"></script>\n<script>\nfunction startSwitch(){\n\tvar appKey = \"8w7jv4qb78a9y\";\n\tvar token1 = \"ZThhLI1Xa1BX5EMREAdArWSH6ouuI8NT/fNmMkzF+4IOKIoFvbsi6JnH8QmnSltLkCcsK8vOgKl3IZgfbxFiWg==\";\n\tvar token2 = \"4FGCL0oQ/E72nU4ivbui8uHR/ySxKaD1cAX2biXsYR6RsLYO9xAA4ooa+q3n42JnVTQyMAdFUiDsjFRDYZaQeg==\";\n\n\tvar params = {\n\t\tappKey : appKey,\n\t\ttoken : token1\n\t};\n\n\t//登录第一个用户\n\tinit(params,{\n\t\tgetInstance : function(instance1){\n\t\t\tinstance1.getConversationList({\n\t\t\t\tonSuccess: function(list) {\n\t\t\t\t\tdocument.getElementById(\"user1\").innerHTML = JSON.stringify(list,null,\"\\t\");\n\n\t\t\t\t\tinstance1.logout();\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tinitUser2();\n\t\t\t\t\t},0);\n\t\t\t\t},\n\t\t\t\tonError: function(error) {}\n\t\t    }, null, 10);\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\tuserId = userInfo.userId;\n\t\t\talert(\"链接成功；user1 id=\" + userInfo.userId);\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t}\n\t});\n\n\tfunction initUser2(){\n\t\tparams.token = token2;\n\t\tinit(params,{\n\t\t\tgetInstance : function(instance2){\n\t\t\t\tinstance2.getConversationList({\n\t\t\t\t\tonSuccess: function(list2) {\n\t\t\t\t\t\tdocument.getElementById(\"user2\").innerHTML = JSON.stringify(list2,null,\"\\t\");\n\t\t\t\t\t},\n\t\t\t\t\tonError: function(error) {}\n\t\t\t    }, null, 10);\n\t\t\t},\n\t\t\tgetCurrentUser : function(userInfo){\n\t\t\t\tuserId = userInfo.userId;\n\t\t\t\talert(\"链接成功；user2 id=\" + userInfo.userId);\n\t\t\t},\n\t\t\treceiveNewMessage : function(message){\n\t\t\t}\n\t\t});\n\t}\n}\n</script>\n\n<p></p>\n\n<div class=\"show\" id=\"show1\">\n\t<h3>用户切换</h3>\n\n\t<button onclick=\"startSwitch()\">开始切换</button>\n\t\n\t<div id=\"result\">\n\t\t<pre id=\"user1\"></pre>\n\t\t<pre id=\"user2\"></pre>\n\t</div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "unreadcount/unreadcount.js",
    "content": "(function (win) {\n  let utils = {\n    isNumber: (num) => {\n      return Object.prototype.toString.call(num) === '[object Number]';\n    }\n  };\n  let Cache = {\n    set: (key, value) => {\n      localStorage.setItem(key, value);\n    },\n    get: (key) => {\n      return localStorage.getItem(key);\n    },\n    remove: (key) => {\n      localStorage.removeItem(key);\n    }\n  };\n  let getUId = (conversationType, targetId) => {\n    return ['rongunread', conversationType, targetId].join('_');\n  };\n  let getTimes = (conversationType, targetId) => {\n    let uid = getUId(conversationType, targetId);\n    let times = Cache.get(uid) || \"[]\";\n    return JSON.parse(times);\n  };\n  let add = (conversationType, targetId, message) => {\n    let uid = getUId(conversationType, targetId);\n    let times = getTimes(conversationType, targetId);\n    let { sentTime } = message;\n    if (utils.isNumber(sentTime)) {\n      times.push(sentTime);\n      Cache.set(uid, JSON.stringify(times));\n    }\n  }\n  let get = (conversationType, targetId) => {\n    let times = getTimes(conversationType, targetId);\n    return times.length;\n  }\n  let remove = (conversationType, targetId, message) => {\n    let uid = getUId(conversationType, targetId);\n    let times = getTimes(conversationType, targetId);\n    let { sentTime } = message;\n    if (utils.isNumber(sentTime)) {\n      times = times.filter((time) => { return time > sentTime });\n      if (times.length == 0) {\n        Cache.remove(uid);\n      } else {\n        Cache.set(uid, JSON.stringify(times));\n      }\n    }\n  }\n\n  win.UnreadTools = {\n    add,\n    get,\n    remove\n  };\n})(window);\n\n/* \n示例：\n\n// 设置\nlet conversationType = 1;\nlet targetId = 'test01'\nlet message = {\n  sentTime: 839381023\n}\nUnreadTools.set(conversationType, targetId, message);\n\n// 获取\nlet unreadCount = UnreadTools.get(conversationType, targetId);\n\n// 移除\nUnreadTools.remove(conversationType, targetId);\n*/"
  },
  {
    "path": "user-group.js",
    "content": "/*\nCMD规范: https://github.com/seajs/seajs/issues/242\nAMD规范: https://github.com/amdjs/amdjs-api/wiki/AMD\n\nrequirejs: http://requirejs.org/docs/whyamd.html\n*/\n\n/*\n集成用户和群组数据的代码参考\n主要为了演示思路，具体有些实现还需要自行处理\n\n功能：\n1：根据 userId 获取用户信息 （用户的 id、name、portrait）\n2：根据 groupId 获取群组信息（群组的 id、name、portrait、memberIds）\n*/\n\n//namespace 请使用时具体定义\n;(function (global, factory, namespace) {\n    if(typeof exports === 'object' && typeof module !== 'undefined'){\n    \tmodule.exports = factory();\n    }else if(typeof define === 'function' && define.amd){\n    \tdefine(factory);\n    }else{\n    \tglobal.RongIM = global.RongIM || {};\n    \tglobal.RongIM.AppData = factory();\n    }\n})(window, function(){\n\t\"use strict\";\n\n\tvar APIs = {};\n\tvar domain = \"http(s)://yourdomain\";\n\n\tAPIs.userInfo = \"/user/{ids}\";\n\n\tvar userInfos = [\n\t\t{\n\t\t\"id\" : \"userId1\",\n\t\t\"name\" : \"张三\",\n\t\t\"portrait\" : \"http://rongcloud.cn/images/newVersion/log_wx.png?1\"\n\t\t},\n\t\t{\n\t\t\"id\" : \"userId2\",\n\t\t\"name\" : \"李四\",\n\t\t\"portrait\" : \"http://rongcloud.cn/images/newVersion/log_wx.png?2\"\n\t\t},\n\t\t{\n\t\t\"id\" : \"userIdN\",\n\t\t\"name\" : \"路人甲乙丙丁\",\n\t\t\"portrait\" : \"http://rongcloud.cn/images/newVersion/log_wx.png?3\"\n\t\t}\n\t];\n\t/*\n\t获取用户信息接口，建议支持批量获取，如不支持，只能通过循环请求处理，后面会有示例\n\t上行：ids = [\"userId1\",\"userId2\",………………,\"userIdN\"].join(\",\");\n\t返回：userInfos\n\t*/\n\n\tAPIs.groupInfo = \"/group/{ids}\";\n\n\tvar groupInfos = [\n\t\t{\n\t\t\"id\" : \"groupId1\",\n\t\t\"name\" : \"产品研发群\",\n\t\t\"portrait\" : \"http://rongcloud.cn/images/newVersion/log_wx.png\",\n\t\t\"memberIds\" : [\"userId1\",\"userId2\"]\n\t\t},\n\t\t{\n\t\t\"id\" : \"groupIdN\",\n\t\t\"name\" : \"项目管理群\",\n\t\t\"portrait\" : \"http://rongcloud.cn/images/newVersion/log_wx.png\",\n\t\t\"memberIds\" : [\"userId1\",\"userIdN\"]\n\t\t}\n\t];\n\t/*\n\t获取群组信息接口，建议支持批量获取，如不支持，只能通过循环请求处理，后面会有示例\n\t上行：ids = [\"groupId1\",………………,\"groupIdN\"].join(\",\");\n\t返回 groupInfos\n\t*/\n\n\n\t//请求方法，只给出成功返回的情况，异常请自行处理\n\tvar request = function(url, pramas, callback){\n\t\t/*\n\t\t请自行实现请求，或者传入 jQuery 等 lib 的 request 方法\n\t\t请注意处理可能存在的跨域问题\n\t\t*/\n\n\t\t//返回mock数据，实际工程中请基于应用服务器实现\n\t\tif(url.indexOf(\"/group/\") > -1){\n\t\t\tcallback(groupInfos);\n\t\t}else{\n\t\t\tcallback(userInfos);\t\t\t\n\t\t}\n\t}\n\n\t//创建本地缓存对象，缓存用户数据，目前放在内存，具体使用时可以根据需要处理为 localStorage 或 cookie 等\n\twindow.userInfoCache = window.userInfoCache || {};\n\n\t//获取用户信息方法的实现\n\tvar getUserInfos = function(ids, callback){\n\t\t//考虑到具体的应用场景，设计为 object，也可以根据业务特点设计成 array 等其他的数据格式\n\t\tvar userInfos = {};\n\n\t\tvar remoteUserIds = [];\n\t\tfor(var i = 0, len = ids.length; i<len; i++){\n\t\t\tvar userId = ids[i];\n\t\t\tif(userInfoCache[userId]){\n\t\t\t\t//如果本地命中，直接放入结果等待一起返回\n\t\t\t\tuserInfos[userId] = userInfoCache[userId];\n\n\t\t\t\t//如果需要立即返回，这种方法会不断执行回调，逐个返回，如下面，此处以及request里的返回均可如此处理\n\t\t\t\t// callback({userid:userInfoCache[userId]});\n\t\t\t}else{\n\t\t\t\t//如果本地没有命中，过滤出 id，下一步从服务器请求\n\t\t\t\tremoteUserIds.push(userId);\n\t\t\t}\n\t\t}\n\n\t\tvar url = domain + APIs[userInfo];\n\n\t\t//支持批量请求，返回用户数据\n\t\trequest(url, remoteUserIds, function(remoteUserInfos){\n\t\t\tfor(var i = 0, len = remoteUserInfos.length; i<len; i++){\n\t\t\t\tvar userInfo = remoteUserInfos[i];\n\n\t\t\t\t//根据返回值做对应处理\n\t\t\t\tvar userId = userInfo[\"id\"];\n\n\t\t\t\t//放入本地缓存\n\t\t\t\tuserInfoCache[userId] = userInfo;\n\n\t\t\t\t//放入查询结果\n\t\t\t\tuserInfos[userId] = userInfo;\n\n\t\t\t\tcallback(userInfos);\n\t\t\t}\n\t\t});\n\n\t\t//不支持批量请求，逐个返回用户数据\n\t\tvar backNumbers = 0;\n\t\tfor(var i = 0, len = remoteUserIds.length; i<len; i++){\n\t\t\tvar remoteUserId = remoteUserIds[i];\n\t\t\trequest(url, remoteUserId, function(remoteUserInfo){\n\t\t\t\tvar userId = remoteUserInfo[\"id\"];\n\n\t\t\t\t//放入本地缓存\n\t\t\t\tuserInfoCache[userId] = remoteUserInfo;\n\n\t\t\t\t//放入查询结果\n\t\t\t\tuserInfos[userId] = remoteUserInfo;\n\n\t\t\t\t//计数 +1\n\t\t\t\tbackNumbers += 1;\n\n\t\t\t\t//根据 backNumbers 与 remoteUserIds 的长度判断是否全部请求完毕\n\t\t\t\tif(backNumbers == len){\n\t\t\t\t\tcallback(userInfos);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\n\t//创建本地缓存对象，缓存用户数据，目前放在内存，具体使用时可以根据需要处理为 localStorage 或 cookie 等\n\twindow.groupInfoCache = window.groupInfoCache || {};\n\n\t//获取群组信息实现，本方法不返回群组成员信息\n\tvar getGroupInfos = function(ids, callback){\n\t\tvar groupInfos = {};\n\t\tvar remoteGroupIds = [];\n\t\tfor(var i = 0, len = ids.length; i<len; i++){\n\t\t\tvar groupId = ids[i];\n\t\t\tif(groupInfoCache[\"groupId\"]){\n\t\t\t\t//如果本地命中，直接返回\n\t\t\t\tgroupInfos[groupId] = groupInfoCache[groupId];\n\t\t\t}else{\n\t\t\t\t//如果本地没有命中，过滤出 id，下一步从服务器请求\n\t\t\t\tremoteGroupIds.push(groupId);\n\t\t\t}\n\t\t}\n\n\t\tvar url = domain + APIs[groupInfo];\n\n\t\t//支持批量请求，返回群组数据\n\t\trequest(url, remoteGroupIds, function(remoteGroupInfos){\n\t\t\tfor(var i = 0, len = remoteGroupInfos.length; i<len; i++){\n\t\t\t\tvar groupInfo = remoteGroupInfos[i];\n\t\t\t\tvar groupId = groupInfo[\"id\"];\n\n\t\t\t\t//放入本地缓存\n\t\t\t\tgroupInfoCache[groupId] = groupInfo;\n\n\t\t\t\t//放入查询结果\n\t\t\t\tgroupInfos[groupId] = groupInfo;\n\n\t\t\t\tcallback(groupInfos);\n\t\t\t}\n\t\t});\n\n\t\t//不支持批量的处理方式与 userInfo 一致，请参考\n\t}\n\n\t//获取群组信息及成员信息，因为应用场景，此方法设计为逐个群组获取\n\tvar getGroupInfosWithMemberInfo = function(id, callback){\n\t\tgetGroupInfo(id, function(groupInfo){\n\t\t\tvar ids = groupInfo.memberIds;\n\t\t\tgetUserInfo(ids, function(userInfos){\n\t\t\t\tgroupInfo.members = userInfos;\n\t\t\t\tcallback(groupInfo);\n\t\t\t})\n\t\t});\n\t}\n\n\t//返回需要对外暴露的方法\n    return {\n    \tgetUserInfos : getUserInfos,\n    \tgetGroupInfos : getGroupInfos,\n    \tgetGroupInfosWithMemberInfo : getGroupInfosWithMemberInfo\n    }\n});\n\n"
  },
  {
    "path": "video/flowplayer/flowplayer-3.2.13.js",
    "content": "/*!\n * flowplayer.js The Flowplayer API\n *\n * Copyright 2009-2011 Flowplayer Oy\n *\n * This file is part of Flowplayer.\n *\n * Flowplayer is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Flowplayer is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.\n *\n */\n!function() {\n\n/*\n\tFEATURES\n\t--------\n\t- $f() and flowplayer() functions\n\t- handling multiple instances\n\t- Flowplayer programming API\n\t- Flowplayer event model\n\t- player loading / unloading\n\t- jQuery support\n*/\n\n\n/*jslint glovar: true, browser: true */\n/*global flowplayer, $f */\n\n// {{{ private utility methods\n\n\tfunction log(args) {\n\t\tconsole.log(\"$f.fireEvent\", [].slice.call(args));\n\t}\n\n\n\t// thanks: http://keithdevens.com/weblog/archive/2007/Jun/07/javascript.clone\n\tfunction clone(obj) {\n\t\tif (!obj || typeof obj != 'object') { return obj; }\n\t\tvar temp = new obj.constructor();\n\t\tfor (var key in obj) {\n\t\t\tif (obj.hasOwnProperty(key)) {\n\t\t\t\ttemp[key] = clone(obj[key]);\n\t\t\t}\n\t\t}\n\t\treturn temp;\n\t}\n\n\t// stripped from jQuery, thanks John Resig\n\tfunction each(obj, fn) {\n\t\tif (!obj) { return; }\n\n\t\tvar name, i = 0, length = obj.length;\n\n\t\t// object\n\t\tif (length === undefined) {\n\t\t\tfor (name in obj) {\n\t\t\t\tif (fn.call(obj[name], name, obj[name]) === false) { break; }\n\t\t\t}\n\n\t\t// array\n\t\t} else {\n\t\t\tfor (var value = obj[0];\n\t\t\t\ti < length && fn.call( value, i, value ) !== false; value = obj[++i]) {\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t}\n\n\n\t// convenience\n\tfunction el(id) {\n\t\treturn document.getElementById(id);\n\t}\n\n\n\t// used extensively. a very simple implementation.\n\tfunction extend(to, from, skipFuncs) {\n\t\tif (typeof from != 'object') { return to; }\n\n\t\tif (to && from) {\n\t\t\teach(from, function(name, value) {\n\t\t\t\tif (!skipFuncs || typeof value != 'function') {\n\t\t\t\t\tto[name] = value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn to;\n\t}\n\n\t// var arr = select(\"elem.className\");\n\tfunction select(query) {\n\t\tvar index = query.indexOf(\".\");\n\t\tif (index != -1) {\n\t\t\tvar tag = query.slice(0, index) || \"*\";\n\t\t\tvar klass = query.slice(index + 1, query.length);\n\t\t\tvar els = [];\n\t\t\teach(document.getElementsByTagName(tag), function() {\n\t\t\t\tif (this.className && this.className.indexOf(klass) != -1) {\n\t\t\t\t\tels.push(this);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn els;\n\t\t}\n\t}\n\n\t// fix event inconsistencies across browsers\n\tfunction stopEvent(e) {\n\t\te = e || window.event;\n\n\t\tif (e.preventDefault) {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\n\t\t} else {\n\t\t\te.returnValue = false;\n\t\t\te.cancelBubble = true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// push an event listener into existing array of listeners\n\tfunction bind(to, evt, fn) {\n\t\tto[evt] = to[evt] || [];\n\t\tto[evt].push(fn);\n\t}\n\n\t// escape & and = in config written into flashvars (issue #21)\n\tfunction queryescape(url) {\n\t\treturn url.replace(/&amp;/g, '%26').replace(/&/g, '%26').replace(/=/g, '%3D');\n\t}\n\n\t// generates an unique id\n   function makeId() {\n      return \"_\" + (\"\" + Math.random()).slice(2, 10);\n   }\n\n//}}}\n\n\n// {{{ Clip\n\n\tvar Clip = function(json, index, player) {\n\n\t\t// private variables\n\t\tvar self = this,\n\t\t\t cuepoints = {},\n\t\t\t listeners = {};\n\n\t\tself.index = index;\n\n\t\t// instance variables\n\t\tif (typeof json == 'string') {\n\t\t\tjson = {url:json};\n\t\t}\n\n\t\textend(this, json, true);\n\n\t\t// event handling\n\t\teach((\"Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop\").split(\",\"),\n\t\t\tfunction() {\n\n\t\t\tvar evt = \"on\" + this;\n\n\t\t\t// before event\n\t\t\tif (evt.indexOf(\"*\") != -1) {\n\t\t\t\tevt = evt.slice(0, evt.length -1);\n\t\t\t\tvar before = \"onBefore\" + evt.slice(2);\n\n\t\t\t\tself[before] = function(fn) {\n\t\t\t\t\tbind(listeners, before, fn);\n\t\t\t\t\treturn self;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tself[evt] = function(fn) {\n\t\t\t\tbind(listeners, evt, fn);\n\t\t\t\treturn self;\n\t\t\t};\n\n\n\t\t\t// set common clip event listeners to player level\n\t\t\tif (index == -1) {\n\t\t\t\tif (self[before]) {\n\t\t\t\t\tplayer[before] = self[before];\n\t\t\t\t}\n\t\t\t\tif (self[evt])  {\n\t\t\t\t\tplayer[evt] = self[evt];\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\n\t\textend(this, {\n\n\t\t\tonCuepoint: function(points, fn) {\n\n\t\t\t\t// embedded cuepoints\n\t\t\t\tif (arguments.length == 1) {\n\t\t\t\t\tcuepoints.embedded = [null, points];\n\t\t\t\t\treturn self;\n\t\t\t\t}\n\n\t\t\t\tif (typeof points == 'number') {\n\t\t\t\t\tpoints = [points];\n\t\t\t\t}\n\n\t\t\t\tvar fnId = makeId();\n\t\t\t\tcuepoints[fnId] = [points, fn];\n\n\t\t\t\tif (player.isLoaded()) {\n\t\t\t\t\tplayer._api().fp_addCuepoints(points, index, fnId);\n\t\t\t\t}\n\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\tupdate: function(json) {\n\t\t\t\textend(self, json);\n\n\t\t\t\tif (player.isLoaded()) {\n\t\t\t\t\tplayer._api().fp_updateClip(json, index);\n\t\t\t\t}\n\t\t\t\tvar conf = player.getConfig();\n\t\t\t\tvar clip = (index == -1) ? conf.clip : conf.playlist[index];\n\t\t\t\textend(clip, json, true);\n\t\t\t},\n\n\n\t\t\t// internal event for performing clip tasks. should be made private someday\n\t\t\t_fireEvent: function(evt, arg1, arg2, target) {\n\t\t\t\tif (evt == 'onLoad') {\n\t\t\t\t\teach(cuepoints, function(key, val) {\n\t\t\t\t\t\tif (val[0]) {\n\t\t\t\t\t\t\tplayer._api().fp_addCuepoints(val[0], index, key);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// target clip we are working against\n\t\t\t\ttarget = target || self;\n\n\t\t\t\tif (evt == 'onCuepoint') {\n\t\t\t\t\tvar fn = cuepoints[arg1];\n\t\t\t\t\tif (fn) {\n\t\t\t\t\t\treturn fn[1].call(player, target, arg2);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// 1. clip properties, 2-3. metadata, 4. updates, 5. resumes from nested clip\n                //#148 add onMetaDataChange event to extend clip properties, this was needed to prevent regular updates during stream switching.\n\t\t\t\tif (arg1 && \"onBeforeBegin,onMetaData,onMetaDataChange,onStart,onUpdate,onResume\".indexOf(evt) != -1) {\n\t\t\t\t\t// update clip properties\n\t\t\t\t\textend(target, arg1);\n\n\t\t\t\t\tif (arg1.metaData) {\n\t\t\t\t\t\tif (!target.duration) {\n\t\t\t\t\t\t\ttarget.duration = arg1.metaData.duration;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttarget.fullDuration = arg1.metaData.duration;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tvar ret = true;\n\t\t\t\teach(listeners[evt], function() {\n\t\t\t\t\tret = this.call(player, target, arg1, arg2);\n\t\t\t\t});\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t});\n\n\n\t\t// get cuepoints from config\n\t\tif (json.onCuepoint) {\n\t\t\tvar arg = json.onCuepoint;\n\t\t\tself.onCuepoint.apply(self, typeof arg == 'function' ? [arg] : arg);\n\t\t\tdelete json.onCuepoint;\n\t\t}\n\n\t\t// get other events\n\t\teach(json, function(key, val) {\n\n\t\t\tif (typeof val == 'function') {\n\t\t\t\tbind(listeners, key, val);\n\t\t\t\tdelete json[key];\n\t\t\t}\n\n\t\t});\n\n\n\t\t// setup common clip event callbacks for Player object too (shortcuts)\n\t\tif (index == -1) {\n\t\t\tplayer.onCuepoint = this.onCuepoint;\n\t\t}\n\n\t};\n\n//}}}\n\n\n// {{{ Plugin\n\n\tvar Plugin = function(name, json, player, fn) {\n\n\t\tvar self = this,\n\t\t\t listeners = {},\n\t\t\t hasMethods = false;\n\n\t\tif (fn) {\n\t\t\textend(listeners, fn);\n\t\t}\n\n\t\t// custom callback functions in configuration\n\t\teach(json, function(key, val) {\n\t\t\tif (typeof val == 'function') {\n\t\t\t\tlisteners[key] = val;\n\t\t\t\tdelete json[key];\n\t\t\t}\n\t\t});\n\n\t\t// core plugin methods\n\t\textend(this, {\n\n\t\t\t// speed and fn are optional\n\t\t\tanimate: function(props, speed, fn) {\n\t\t\t\tif (!props) {\n\t\t\t\t\treturn self;\n\t\t\t\t}\n\n\t\t\t\tif (typeof speed == 'function') {\n\t\t\t\t\tfn = speed;\n\t\t\t\t\tspeed = 500;\n\t\t\t\t}\n\n\t\t\t\tif (typeof props == 'string') {\n\t\t\t\t\tvar key = props;\n\t\t\t\t\tprops = {};\n\t\t\t\t\tprops[key] = speed;\n\t\t\t\t\tspeed = 500;\n\t\t\t\t}\n\n\t\t\t\tif (fn) {\n\t\t\t\t\tvar fnId = makeId();\n\t\t\t\t\tlisteners[fnId] = fn;\n\t\t\t\t}\n\n\t\t\t\tif (speed === undefined) { speed = 500; }\n\t\t\t\tjson = player._api().fp_animate(name, props, speed, fnId);\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\tcss: function(props, val) {\n\t\t\t\tif (val !== undefined) {\n\t\t\t\t\tvar css = {};\n\t\t\t\t\tcss[props] = val;\n\t\t\t\t\tprops = css;\n\t\t\t\t}\n\t\t\t\tjson = player._api().fp_css(name, props);\n\t\t\t\textend(self, json);\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\tshow: function() {\n\t\t\t\tthis.display = 'block';\n\t\t\t\tplayer._api().fp_showPlugin(name);\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\thide: function() {\n\t\t\t\tthis.display = 'none';\n\t\t\t\tplayer._api().fp_hidePlugin(name);\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\t// toggle between visible / hidden state\n\t\t\ttoggle: function() {\n\t\t\t\tthis.display = player._api().fp_togglePlugin(name);\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\tfadeTo: function(o, speed, fn) {\n\n\t\t\t\tif (typeof speed == 'function') {\n\t\t\t\t\tfn = speed;\n\t\t\t\t\tspeed = 500;\n\t\t\t\t}\n\n\t\t\t\tif (fn) {\n\t\t\t\t\tvar fnId = makeId();\n\t\t\t\t\tlisteners[fnId] = fn;\n\t\t\t\t}\n\t\t\t\tthis.display = player._api().fp_fadeTo(name, o, speed, fnId);\n\t\t\t\tthis.opacity = o;\n\t\t\t\treturn self;\n\t\t\t},\n\n\t\t\tfadeIn: function(speed, fn) {\n\t\t\t\treturn self.fadeTo(1, speed, fn);\n\t\t\t},\n\n\t\t\tfadeOut: function(speed, fn) {\n\t\t\t\treturn self.fadeTo(0, speed, fn);\n\t\t\t},\n\n\t\t\tgetName: function() {\n\t\t\t\treturn name;\n\t\t\t},\n\n\t\t\tgetPlayer: function() {\n\t\t\t\treturn player;\n\t\t\t},\n\n\t\t\t// internal method. should be made private some day\n         _fireEvent: function(evt, arg, arg2) {\n\n            // update plugins properties & methods\n            if (evt == 'onUpdate') {\n               var json = player._api().fp_getPlugin(name);\n\t\t\t\t\tif (!json) { return;\t}\n\n               extend(self, json);\n               delete self.methods;\n\n               if (!hasMethods) {\n                  each(json.methods, function() {\n                     var method = \"\" + this;\n\n                     self[method] = function() {\n                        var a = [].slice.call(arguments);\n                        var ret = player._api().fp_invoke(name, method, a);\n                        return ret === 'undefined' || ret === undefined ? self : ret;\n                     };\n                  });\n                  hasMethods = true;\n               }\n            }\n\n            // plugin callbacks\n            var fn = listeners[evt];\n\n\t\t\tif (fn) {\n\t\t\t\tvar ret = fn.apply(self, arg);\n\n\t\t\t\t// \"one-shot\" callback\n\t\t\t\tif (evt.slice(0, 1) == \"_\") {\n\t\t\t\t\tdelete listeners[evt];\n\t\t\t\t}\n\n\t\t\t\treturn ret;\n            }\n\n            return self;\n         }\n\n\t\t});\n\n\t};\n\n\n//}}}\n\n\nfunction Player(wrapper, params, conf) {\n\n\t// private variables (+ arguments)\n\tvar self = this,\n\t\tapi = null,\n\t\tisUnloading = false,\n\t\thtml,\n\t\tcommonClip,\n\t\tplaylist = [],\n\t\tplugins = {},\n\t\tlisteners = {},\n\t\tplayerId,\n\t\tapiId,\n\n\t\t// n'th player on the page\n\t\tplayerIndex,\n\n\t\t// active clip's index number\n\t\tactiveIndex,\n\n\t\tswfHeight,\n\t\twrapperHeight;\n\n\n// {{{ public methods\n\n\textend(self, {\n\n\t\tid: function() {\n\t\t\treturn playerId;\n\t\t},\n\n\t\tisLoaded: function() {\n\t\t\treturn (api !== null && api.fp_play !== undefined && !isUnloading);\n\t\t},\n\n\t\tgetParent: function() {\n\t\t\treturn wrapper;\n\t\t},\n\n\t\thide: function(all) {\n\t\t\tif (all) { wrapper.style.height = \"0px\"; }\n\t\t\tif (self.isLoaded()) { api.style.height = \"0px\"; }\n\t\t\treturn self;\n\t\t},\n\n\t\tshow: function() {\n\t\t\twrapper.style.height = wrapperHeight + \"px\";\n\t\t\tif (self.isLoaded()) { api.style.height = swfHeight + \"px\"; }\n\t\t\treturn self;\n\t\t},\n\n\t\tisHidden: function() {\n\t\t\treturn self.isLoaded() && parseInt(api.style.height, 10) === 0;\n\t\t},\n\n\t\tload: function(fn) {\n\t\t\tif (!self.isLoaded() && self._fireEvent(\"onBeforeLoad\") !== false) {\n\t\t\t\tvar onPlayersUnloaded = function() {\n\t\t\t\t\t// do not use splash as alternate content for flashembed\n\t\t\t\t\tif (html && !flashembed.isSupported(params.version)) {\n\t\t\t\t\t\twrapper.innerHTML = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// onLoad listener given as argument\n\t\t\t\t\tif (fn) {\n\t\t\t\t\t\tfn.cached = true;\n\t\t\t\t\t\tbind(listeners, \"onLoad\", fn);\n\t\t\t\t\t}\n\n\t\t\t\t\t// install Flash object inside given container\n\t\t\t\t\tflashembed(wrapper, params, {config: conf});\n\t\t\t\t};\n\n\n\t\t\t\t// unload all instances\n\t\t\t\tvar unloadedPlayersNb = 0;\n\t\t\t\teach(players, function()  {\n\t\t\t\t\tthis.unload(function(wasUnloaded) {\n\t\t\t\t\t\tif ( ++unloadedPlayersNb == players.length ) {\n\t\t\t\t\t\t\tonPlayersUnloaded();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn self;\n\t\t},\n\n\t\tunload: function(fn) {\n\n\t\t\t// unload only if in splash state\n\t\t\tif (html.replace(/\\s/g,'') !== '') {\n\n\t\t\t\tif (self._fireEvent(\"onBeforeUnload\") === false) {\n\t\t\t\t\tif ( fn ) { fn(false); }\n\t\t\t\t\treturn self;\n\t\t\t\t}\n\n\t\t\t\tisUnloading = true;\n\t\t\t\t// try closing\n\t\t\t\ttry {\n\t\t\t\t\tif (api) {\n\t\t\t\t\t\t// issue511\n\t\t\t\t\t\tif (api.fp_isFullscreen()) {\n\t\t\t\t\t\t\tapi.fp_toggleFullscreen();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tapi.fp_close();\n\n\t\t\t\t\t\t// fire unload only when API is present\n\t\t\t\t\t\tself._fireEvent(\"onUnload\");\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {}\n\n\t\t\t\tvar clean = function() {\n\t\t\t\t\tapi = null;\n\t\t\t\t\twrapper.innerHTML = html;\n\t\t\t\t\tisUnloading = false;\n\n\t\t\t\t\tif ( fn ) { fn(true); }\n\t\t\t\t};\n\n\t\t\t\tif (/WebKit/i.test(navigator.userAgent) && ! /Chrome/i.test(navigator.userAgent)) {\n\t\t\t\t\t\tsetTimeout(clean, 0);\n\t\t\t\t} else {\n\t\t\t\t\tclean();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( fn ) { fn(false); }\n\n\t\t\treturn self;\n\n\t\t},\n\n\t\tgetClip: function(index) {\n\t\t\tif (index === undefined) {\n\t\t\t\tindex = activeIndex;\n\t\t\t}\n\t\t\treturn playlist[index];\n\t\t},\n\n\n\t\tgetCommonClip: function() {\n\t\t\treturn commonClip;\n\t\t},\n\n\t\tgetPlaylist: function() {\n\t\t\treturn playlist;\n\t\t},\n\n      getPlugin: function(name) {\n         var plugin = plugins[name];\n\n\t\t\t// create plugin if nessessary\n         if (!plugin && self.isLoaded()) {\n\t\t\t\tvar json = self._api().fp_getPlugin(name);\n\t\t\t\tif (json) {\n\t\t\t\t\tplugin = new Plugin(name, json, self);\n\t\t\t\t\tplugins[name] = plugin;\n\t\t\t\t}\n         }\n         return plugin;\n      },\n\n\t\tgetScreen: function() {\n\t\t\treturn self.getPlugin(\"screen\");\n\t\t},\n\n\t\tgetControls: function() {\n\t\t\treturn self.getPlugin(\"controls\")._fireEvent(\"onUpdate\");\n\t\t},\n\n\t\t// 3.2\n\t\tgetLogo: function() {\n\t\t\ttry {\n\t\t\t\treturn self.getPlugin(\"logo\")._fireEvent(\"onUpdate\");\n\t\t\t} catch (ignored) {}\n\t\t},\n\n\t\t// 3.2\n\t\tgetPlay: function() {\n\t\t\treturn self.getPlugin(\"play\")._fireEvent(\"onUpdate\");\n\t\t},\n\n\n\t\tgetConfig: function(copy) {\n\t\t\treturn copy ? clone(conf) : conf;\n\t\t},\n\n\t\tgetFlashParams: function() {\n\t\t\treturn params;\n\t\t},\n\n\t\tloadPlugin: function(name, url, props, fn) {\n\n\t\t\t// properties not supplied\n\t\t\tif (typeof props == 'function') {\n\t\t\t\tfn = props;\n\t\t\t\tprops = {};\n\t\t\t}\n\n\t\t\t// if fn not given, make a fake id so that plugin's onUpdate get's fired\n\t\t\tvar fnId = fn ? makeId() : \"_\";\n\t\t\tself._api().fp_loadPlugin(name, url, props, fnId);\n\n\t\t\t// create new plugin\n\t\t\tvar arg = {};\n\t\t\targ[fnId] = fn;\n\t\t\tvar p = new Plugin(name, null, self, arg);\n\t\t\tplugins[name] = p;\n\t\t\treturn p;\n\t\t},\n\n\n\t\tgetState: function() {\n\t\t\treturn self.isLoaded() ? api.fp_getState() : -1;\n\t\t},\n\n\t\t// \"lazy\" play\n\t\tplay: function(clip, instream) {\n\n\t\t\tvar p = function() {\n\t\t\t\tif (clip !== undefined) {\n\t\t\t\t\tself._api().fp_play(clip, instream);\n\t\t\t\t} else {\n\t\t\t\t\tself._api().fp_play();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (self.isLoaded()) {\n\t\t\t\tp();\n\t\t\t} else if ( isUnloading ) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself.play(clip, instream);\n\t\t\t\t}, 50);\n\n\t\t\t} else {\n\t\t\t\tself.load(function() {\n\t\t\t\t\tp();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn self;\n\t\t},\n\n\t\tgetVersion: function() {\n\t\t\tvar js = \"flowplayer.js @VERSION\";\n\t\t\tif (self.isLoaded()) {\n\t\t\t\tvar ver = api.fp_getVersion();\n\t\t\t\tver.push(js);\n\t\t\t\treturn ver;\n\t\t\t}\n\t\t\treturn js;\n\t\t},\n\n\t\t_api: function() {\n\t\t\tif (!self.isLoaded()) {\n\t\t\t\tthrow \"Flowplayer \" +self.id()+ \" not loaded when calling an API method\";\n\t\t\t}\n\t\t\treturn api;\n\t\t},\n\n\t\tsetClip: function(clip) {\n\t\t\teach(clip, function(key, val) {\n\t\t\t\tif (typeof val == 'function') {\n\t\t\t\t\tbind(listeners, key, val);\n\t\t\t\t\tdelete clip[key];\n\t\t\t\t} else if (key == 'onCuepoint'){\n\t\t\t\t\t$f(wrapper).getCommonClip().onCuepoint(clip[key][0], clip[key][1]);\n\t\t\t\t}\n\t\t\t});\n\t\t\tself.setPlaylist([clip]);\n\t\t\treturn self;\n\t\t},\n\n\t\tgetIndex: function() {\n\t\t\treturn playerIndex;\n\t\t},\n\n        bufferAnimate: function(enable) {\n            api.fp_bufferAnimate(enable === undefined || enable);\n            return self;\n        },\n\n\t\t_swfHeight: function() {\n\t\t\treturn api.clientHeight;\n\t\t}\n\n\t});\n\n\n\t// event handlers\n\teach((\"Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut\").split(\",\"),\n\t\tfunction() {\n\t\t\tvar name = \"on\" + this;\n\n\t\t\t// before event\n\t\t\tif (name.indexOf(\"*\") != -1) {\n\t\t\t\tname = name.slice(0, name.length -1);\n\t\t\t\tvar name2 = \"onBefore\" + name.slice(2);\n\t\t\t\tself[name2] = function(fn) {\n\t\t\t\t\tbind(listeners, name2, fn);\n\t\t\t\t\treturn self;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// normal event\n\t\t\tself[name] = function(fn) {\n\t\t\t\tbind(listeners, name, fn);\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\t);\n\n\n\t// core API methods\n\teach((\"pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled\").split(\",\"),\n\t\tfunction() {\n\t\t\tvar name = this;\n\n\t\t\tself[name] = function(a1, a2) {\n\t\t\t\tif (!self.isLoaded()) { return self; }\n\t\t\t\tvar ret = null;\n\n\t\t\t\t// two arguments\n\t\t\t\tif (a1 !== undefined && a2 !== undefined) {\n\t\t\t\t\tret = api[\"fp_\" + name](a1, a2);\n\n\t\t\t\t} else {\n\t\t\t\t\tret = (a1 === undefined) ? api[\"fp_\" + name]() : api[\"fp_\" + name](a1);\n\n\t\t\t\t}\n\n\t\t\t\treturn ret === 'undefined' || ret === undefined ? self : ret;\n\t\t\t};\n\t\t}\n\t);\n\n//}}}\n\n\n// {{{ public method: _fireEvent\n\n\tself._fireEvent = function(a) {\n\n\t\tif (typeof a == 'string') { a = [a]; }\n\n\t\tvar evt = a[0], arg0 = a[1], arg1 = a[2], arg2 = a[3], i = 0;\n\t\tif (conf.debug) { log(a); }\n\n\t\t// internal onLoad\n\t\tif (!self.isLoaded() && evt == 'onLoad' && arg0 == 'player') {\n\n\t\t\tapi = api || el(apiId);\n\t\t\tswfHeight = self._swfHeight();\n\n\t\t\teach(playlist, function() {\n\t\t\t\tthis._fireEvent(\"onLoad\");\n\t\t\t});\n\n\t\t\teach(plugins, function(name, p) {\n\t\t\t\tp._fireEvent(\"onUpdate\");\n\t\t\t});\n\n\t\t\tcommonClip._fireEvent(\"onLoad\");\n\t\t}\n\n\t\t// other onLoad events are skipped\n\t\tif (evt == 'onLoad' && arg0 != 'player') { return; }\n\n\n\t\t// \"normalize\" error handling\n\t\tif (evt == 'onError') {\n\t\t\tif (typeof arg0 == 'string' || (typeof arg0 == 'number' && typeof arg1 == 'number'))  {\n\t\t\t\targ0 = arg1;\n\t\t\t\targ1 = arg2;\n\t\t\t}\n\t\t}\n\n\n      if (evt == 'onContextMenu') {\n         each(conf.contextMenu[arg0], function(key, fn)  {\n            fn.call(self);\n         });\n         return;\n      }\n\n\t\tif (evt == 'onPluginEvent' || evt == 'onBeforePluginEvent') {\n\t\t\tvar name = arg0.name || arg0;\n\t\t\tvar p = plugins[name];\n\n\t\t\tif (p) {\n\t\t\t\tp._fireEvent(\"onUpdate\", arg0);\n\t\t\t\treturn p._fireEvent(arg1, a.slice(3));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// replace whole playlist\n\t\tif (evt == 'onPlaylistReplace') {\n\t\t\tplaylist = [];\n\t\t\tvar index = 0;\n\t\t\teach(arg0, function() {\n\t\t\t\tplaylist.push(new Clip(this, index++, self));\n\t\t\t});\n\t\t}\n\n\t\t// insert new clip to the playlist. arg0 = clip, arg1 = index\n\t\tif (evt == 'onClipAdd') {\n\n\t\t\t// instream clip additions are ignored at this point\n\t\t\tif (arg0.isInStream) { return; }\n\n\t\t\t// add new clip into playlist\n\t\t\targ0 = new Clip(arg0, arg1, self);\n\t\t\tplaylist.splice(arg1, 0, arg0);\n\n\t\t\t// increment index variable for the rest of the clips on playlist\n\t\t\tfor (i = arg1 + 1; i < playlist.length; i++) {\n\t\t\t\tplaylist[i].index++;\n\t\t\t}\n\t\t}\n\n\n\t\tvar ret = true;\n\n\t\t// clip event\n\t\tif (typeof arg0 == 'number' && arg0 < playlist.length) {\n\n\t\t\tactiveIndex = arg0;\n\t\t\tvar clip = playlist[arg0];\n\n\t\t\tif (clip) {\n\t\t\t\tret = clip._fireEvent(evt, arg1, arg2);\n\t\t\t}\n\n\t\t\tif (!clip || ret !== false) {\n\t\t\t\t// clip argument is given for common clip, because it behaves as the target\n\t\t\t\tret = commonClip._fireEvent(evt, arg1, arg2, clip);\n\t\t\t}\n\t\t}\n\n\n\t\t// trigger player event\n\t\teach(listeners[evt], function() {\n\t\t\tret = this.call(self, arg0, arg1);\n\n\t\t\t// remove cached entry\n\t\t\tif (this.cached) {\n\t\t\t\tlisteners[evt].splice(i, 1);\n\t\t\t}\n\n\t\t\t// break loop\n\t\t\tif (ret === false) { return false;\t }\n\t\t\ti++;\n\n\t\t});\n\n\t\treturn ret;\n\t};\n\n//}}}\n\n\n// {{{ init\n\n   function init() {\n\t\t// replace previous installation\n\t\tif ($f(wrapper)) {\n\t\t\t$f(wrapper).getParent().innerHTML = \"\";\n\t\t\tplayerIndex = $f(wrapper).getIndex();\n\t\t\tplayers[playerIndex] = self;\n\n\t\t// register this player into global array of instances\n\t\t} else {\n\t\t\tplayers.push(self);\n\t\t\tplayerIndex = players.length -1;\n\t\t}\n\n\t\twrapperHeight = parseInt(wrapper.style.height, 10) || wrapper.clientHeight;\n\n\t\t// playerId\n\t\tplayerId = wrapper.id || \"fp\" + makeId();\n\t\tapiId = params.id || playerId + \"_api\";\n\t\tparams.id = apiId;\n        html = wrapper.innerHTML;\n\n\n\t\t// plain url is given as config\n\t\tif (typeof conf == 'string') {\n\t\t\tconf = {clip:{url:conf}};\n\t\t}\n\n\t\tconf.playerId = playerId;\n\n\t\t// common clip is always there\n\t\tconf.clip = conf.clip || {};\n\n\n\t\t// wrapper href as common clip's url\n\t\tif (wrapper.getAttribute(\"href\", 2) && !conf.clip.url) {\n\t\t\tconf.clip.url = wrapper.getAttribute(\"href\", 2);\n\t\t}\n\n\t\tif (conf.clip.url) {\n\t\t\tconf.clip.url = queryescape(conf.clip.url);\n\t\t}\n\n\t\tcommonClip = new Clip(conf.clip, -1, self);\n\n\t\t// playlist\n\t\tconf.playlist = conf.playlist || [conf.clip];\n\n\t\tvar index = 0;\n\n\t\teach(conf.playlist, function() {\n\n\t\t\tvar clip = this;\n\n\t\t\t/* sometimes clip is given as array. this is not accepted. */\n\t\t\tif (typeof clip == 'object' && clip.length) {\n\t\t\t\tclip = {url: \"\" + clip};\n\t\t\t}\n\n\t\t\tif (clip.url) {\n\t\t\t\tclip.url = queryescape(clip.url);\n\t\t\t}\n\n\t\t\t// populate common clip properties to each clip\n\t\t\teach(conf.clip, function(key, val) {\n\t\t\t\tif (val !== undefined && clip[key] === undefined && typeof val != 'function') {\n\t\t\t\t\tclip[key] = val;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// modify playlist in configuration\n\t\t\tconf.playlist[index] = clip;\n\n\t\t\t// populate playlist array\n\t\t\tclip = new Clip(clip, index, self);\n\t\t\tplaylist.push(clip);\n\t\t\tindex++;\n\t\t});\n\n\t\t// event listeners\n\t\teach(conf, function(key, val) {\n\t\t\tif (typeof val == 'function') {\n\n\t\t\t\t// common clip event\n\t\t\t\tif (commonClip[key]) {\n\t\t\t\t\tcommonClip[key](val);\n\n\t\t\t\t// player event\n\t\t\t\t} else {\n\t\t\t\t\tbind(listeners, key, val);\n\t\t\t\t}\n\n\t\t\t\t// no need to supply for the Flash component\n\t\t\t\tdelete conf[key];\n\t\t\t}\n\t\t});\n\n\n\t\t// plugins\n\t\teach(conf.plugins, function(name, val) {\n\t\t\tif (val) {\n\t\t\t\tplugins[name] = new Plugin(name, val, self);\n\t\t\t}\n\t\t});\n\n\n\t\t// setup controlbar plugin if not explicitly defined\n\t\tif (!conf.plugins || conf.plugins.controls === undefined) {\n\t\t\tplugins.controls = new Plugin(\"controls\", null, self);\n\t\t}\n\n\t\t// setup canvas as plugin\n\t\tplugins.canvas = new Plugin(\"canvas\", null, self);\n\n\t\thtml = wrapper.innerHTML;\n\n\t\t// click function\n\t\tfunction doClick(e) {\n\n\t\t\t// ipad/iPhone --> follow the link if plugin not installed\n\t\t\tif (/iPad|iPhone|iPod/i.test(navigator.userAgent) && !/.flv$/i.test(playlist[0].url) && ! checkForIpadSupport() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (!self.isLoaded() && self._fireEvent(\"onBeforeClick\") !== false) {\n\t\t\t\tself.load();\n\t\t\t}\n\t\t\treturn stopEvent(e);\n\t\t}\n\n        function checkForIpadSupport() {\n             return self.hasiPadSupport && self.hasiPadSupport();\n        }\n\n\t\tfunction installPlayer() {\n\t\t\t// defer loading upon click\n\t\t\tif (html.replace(/\\s/g, '') !== '') {\n\n\t\t\t\tif (wrapper.addEventListener) {\n\t\t\t\t\twrapper.addEventListener(\"click\", doClick, false);\n\n\t\t\t\t} else if (wrapper.attachEvent) {\n\t\t\t\t\twrapper.attachEvent(\"onclick\", doClick);\n\t\t\t\t}\n\n\t\t\t// player is loaded upon page load\n\t\t\t} else {\n\n\t\t\t\t// prevent default action from wrapper. (fixes safari problems)\n                //#195 check if we have ipad support and not block click events\n\t\t\t\tif (wrapper.addEventListener && !checkForIpadSupport()) {\n\t\t\t\t\twrapper.addEventListener(\"click\", stopEvent, false);\n\t\t\t\t}\n\t\t\t\t// load player\n\t\t\t\tself.load();\n\t\t\t}\n\t\t}\n\n\t\t// now that the player is initialized, wait for the plugin chain to finish\n\t\t// before actually changing the dom\n\t\tsetTimeout(installPlayer, 0);\n\t}\n\n\t// possibly defer initialization until DOM get's loaded\n\tif (typeof wrapper == 'string') {\n\t\tvar node = el(wrapper);\n\t\tif (!node) { throw \"Flowplayer cannot access element: \" + wrapper; }\n\t\twrapper = node;\n\t\tinit();\n\n\t// we have a DOM element so page is already loaded\n\t} else {\n\t\tinit();\n\t}\n\n\n//}}}\n\n\n}\n\n\n// {{{ flowplayer() & statics\n\n// container for player instances\nvar players = [];\n\n\n// this object is returned when multiple player's are requested\nfunction Iterator(arr) {\n\n\tthis.length = arr.length;\n\n\tthis.each = function(fn)  {\n\t\teach(arr, fn);\n\t};\n\n\tthis.size = function() {\n\t\treturn arr.length;\n\t};\n\n\tvar self = this;\n\tfor(name in Player.prototype) {\n\t  self[name] = function() {\n \t    var args = arguments;\n\t    self.each(function() {\n    \t  this[name].apply(this, args);\n\t    });\n\t  };\n  \t}\n}\n\n// these two variables are the only global variables\nwindow.flowplayer = window.$f = function() {\n\tvar instance = null;\n\tvar arg = arguments[0];\n\n\t// $f()\n\tif (!arguments.length) {\n\t\teach(players, function() {\n\t\t\tif (this.isLoaded())  {\n\t\t\t\tinstance = this;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\n\t\treturn instance || players[0];\n\t}\n\n\tif (arguments.length == 1) {\n\n\t\t// $f(index);\n\t\tif (typeof arg == 'number') {\n\t\t\treturn players[arg];\n\n\n\t\t// $f(wrapper || 'containerId' || '*');\n\t\t} else {\n\n\t\t\t// $f(\"*\");\n\t\t\tif (arg == '*') {\n\t\t\t\treturn new Iterator(players);\n\t\t\t}\n\n\t\t\t// $f(wrapper || 'containerId');\n\t\t\teach(players, function() {\n\t\t\t\tif (this.id() == arg.id || this.id() == arg || this.getParent() == arg)  {\n\t\t\t\t\tinstance = this;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn instance;\n\t\t}\n\t}\n\n\t// instance builder\n\tif (arguments.length > 1) {\n\n\t\t// flashembed parameters\n\t\tvar params = arguments[1],\n\t\t\t conf = (arguments.length == 3) ? arguments[2] : {};\n\n\n\t\tif (typeof params == 'string') {\n\t\t\tparams = {src: params};\n\t\t}\n\n\t\tparams = extend({\n\t\t\tbgcolor: \"#000000\",\n\t\t\tversion: [10, 1],\n\t\t\texpressInstall: \"http://releases.flowplayer.org/swf/expressinstall.swf\",\n\t\t\tcachebusting: false\n\n\t\t}, params);\n\n\t\tif (typeof arg == 'string') {\n\n\t\t\t// select arg by classname\n\t\t\tif (arg.indexOf(\".\") != -1) {\n\t\t\t\tvar instances = [];\n\n\t\t\t\teach(select(arg), function() {\n\t\t\t\t\tinstances.push(new Player(this, clone(params), clone(conf)));\n\t\t\t\t});\n\n\t\t\t\treturn new Iterator(instances);\n\n\t\t\t// select node by id\n\t\t\t} else {\n\t\t\t\tvar node = el(arg);\n\t\t\t\treturn new Player(node !== null ? node : clone(arg), clone(params), clone(conf));\n\t\t\t}\n\n\n\t\t// arg is a DOM element\n\t\t} else if (arg) {\n\t\t\treturn new Player(arg, clone(params), clone(conf));\n\t\t}\n\n\t}\n\n\treturn null;\n};\n\nextend(window.$f, {\n\n\t// called by Flash External Interface\n\tfireEvent: function() {\n\t\tvar a = [].slice.call(arguments);\n\t\tvar p = $f(a[0]);\n\t\treturn p ? p._fireEvent(a.slice(1)) : null;\n\t},\n\n\n\t// create plugins by modifying Player's prototype\n\taddPlugin: function(name, fn) {\n\t\tPlayer.prototype[name] = fn;\n\t\treturn $f;\n\t},\n\n\t// utility methods for plugin developers\n\teach: each,\n\n\textend: extend\n});\n\n\n//}}}\n\n\n//{{{ jQuery support\n\nif (typeof jQuery == 'function') {\n\n\tjQuery.fn.flowplayer = function(params, conf) {\n\n\t\t// select instances\n\t\tif (!arguments.length || typeof arguments[0] == 'number') {\n\t\t\tvar arr = [];\n\t\t\tthis.each(function()  {\n\t\t\t\tvar p = $f(this);\n\t\t\t\tif (p) {\n\t\t\t\t\tarr.push(p);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn arguments.length ? arr[arguments[0]] : new Iterator(arr);\n\t\t}\n\n\t\t// create flowplayer instances\n\t\treturn this.each(function() {\n\t\t\t$f(this, clone(params), conf ? clone(conf) : {});\n\t\t});\n\n\t};\n\n}\n\n//}}}\n\n\n}();\n/**\n * Flashembed - New wave Flash embedding\n *\n * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.\n */\n!function() {\n\n\tvar IE = document.all,\n\t\t URL = 'http://get.adobe.com/flashplayer',\n\t\t JQUERY = typeof jQuery == 'function',\n\t\t RE = /(\\d+)[^\\d]+(\\d+)[^\\d]*(\\d*)/,\n\t\t GLOBAL_OPTS = {\n\t\t\t// very common opts\n\t\t\twidth: '100%',\n\t\t\theight: '100%',\n\t\t\tid: \"_\" + (\"\" + Math.random()).slice(9),\n\n\t\t\t// flashembed defaults\n\t\t\tallowfullscreen: true,\n\t\t\tallowscriptaccess: 'always',\n\t\t\tquality: 'high',\n\n\t\t\t// flashembed specific options\n\t\t\tversion: [3, 0],\n\t\t\tonFail: null,\n\t\t\texpressInstall: null,\n\t\t\tw3c: false,\n\t\t\tcachebusting: false\n\t};\n\n\t// version 9 bugfix: (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)\n\tif (window.attachEvent) {\n\t\twindow.attachEvent(\"onbeforeunload\", function() {\n\t\t\t__flash_unloadHandler = function() {};\n\t\t\t__flash_savedUnloadHandler = function() {};\n\t\t});\n\t}\n\n\t// simple extend\n\tfunction extend(to, from) {\n\t\tif (from) {\n\t\t\tfor (var key in from) {\n\t\t\t\tif (from.hasOwnProperty(key)) {\n\t\t\t\t\tto[key] = from[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn to;\n\t}\n\n\t// used by asString method\n\tfunction map(arr, func) {\n\t\tvar newArr = [];\n\t\tfor (var i in arr) {\n\t\t\tif (arr.hasOwnProperty(i)) {\n\t\t\t\tnewArr[i] = func(arr[i]);\n\t\t\t}\n\t\t}\n\t\treturn newArr;\n\t}\n\n\twindow.flashembed = function(root, opts, conf) {\n\n\t\t// root must be found / loaded\n\t\tif (typeof root == 'string') {\n\t\t\troot = document.getElementById(root.replace(\"#\", \"\"));\n\t\t}\n\n\t\t// not found\n\t\tif (!root) { return; }\n\n\t\tif (typeof opts == 'string') {\n\t\t\topts = {src: opts};\n\t\t}\n\n\t\treturn new Flash(root, extend(extend({}, GLOBAL_OPTS), opts), conf);\n\t};\n\n\t// flashembed \"static\" API\n\tvar f = extend(window.flashembed, {\n\n\t\tconf: GLOBAL_OPTS,\n\n\t\tgetVersion: function()  {\n\t\t\tvar fo, ver, plugin;\n\n\t\t\ttry {\n\t\t\t\tplugin = navigator.plugins[\"Shockwave Flash\"];\n\t\t\t\t// Safari 6 reports version even when disabled\n\t\t\t\t// but [0, 0] should be returned (#167)\n\t\t\t\tif (plugin[0].enabledPlugin != null)\n\t\t\t\t\tver = plugin.description.slice(16);\n\t\t\t} catch(e) {\n\n\t\t\t\ttry  {\n\t\t\t\t\tfo = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.7\");\n\t\t\t\t\tver = fo && fo.GetVariable(\"$version\");\n\n\t\t\t\t} catch(err) {\n                try  {\n                    fo = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash.6\");\n                    ver = fo && fo.GetVariable(\"$version\");\n                } catch(err2) { }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tver = RE.exec(ver);\n            return ver ? [1 * ver[1], 1 * ver[(ver[1] * 1 > 9 ? 2 : 3)] * 1] : [0, 0];\n        },\n\n\t\tasString: function(obj) {\n\n\t\t\tif (obj === null || obj === undefined) { return null; }\n\t\t\tvar type = typeof obj;\n\t\t\tif (type == 'object' && obj.push) { type = 'array'; }\n\n\t\t\tswitch (type){\n\n\t\t\t\tcase 'string':\n\t\t\t\t\tobj = obj.replace(new RegExp('([\"\\\\\\\\])', 'g'), '\\\\$1');\n\n\t\t\t\t\t// flash does not handle %- characters well. transforms \"50%\" to \"50pct\" (a dirty hack, I admit)\n\t\t\t\t\tobj = obj.replace(/^\\s?(\\d+\\.?\\d*)%/, \"$1pct\")\n\n\t\t\t\t\treturn '\"' +obj+ '\"';\n\n\t\t\t\tcase 'array':\n\t\t\t\t\treturn '['+ map(obj, function(el) {\n\t\t\t\t\t\treturn f.asString(el);\n\t\t\t\t\t}).join(',') +']';\n\n\t\t\t\tcase 'function':\n\t\t\t\t\treturn '\"function()\"';\n\n\t\t\t\tcase 'object':\n\t\t\t\t\tvar str = [];\n\t\t\t\t\tfor (var prop in obj) {\n\t\t\t\t\t\tif (obj.hasOwnProperty(prop)) {\n\t\t\t\t\t\t\tstr.push('\"'+prop+'\":'+ f.asString(obj[prop]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn '{'+str.join(',')+'}';\n\t\t\t}\n\n\t\t\t// replace ' --> \"  and remove spaces\n\t\t\treturn String(obj).replace(/\\s/g, \" \").replace(/\\'/g, \"\\\"\");\n\t\t},\n\n\t\tgetHTML: function(opts, conf) {\n\n\t\t\topts = extend({}, opts);\n\n\t\t\t/******* OBJECT tag and it's attributes *******/\n\t\t\tvar html = '<object width=\"' + opts.width +\n\t\t\t\t'\" height=\"' + opts.height +\n\t\t\t\t'\" id=\"' + opts.id +\n\t\t\t\t'\" name=\"' + opts.id + '\"';\n\n\t\t\tif (opts.cachebusting) {\n\t\t\t\topts.src += ((opts.src.indexOf(\"?\") != -1 ? \"&\" : \"?\") + Math.random());\n\t\t\t}\n\n\t\t\tif (opts.w3c || !IE) {\n\t\t\t\thtml += ' data=\"' +opts.src+ '\" type=\"application/x-shockwave-flash\"';\n\t\t\t} else {\n\t\t\t\thtml += ' classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"';\n\t\t\t}\n\n\t\t\thtml += '>';\n\n\t\t\t/******* nested PARAM tags *******/\n\t\t\tif (opts.w3c || IE) {\n\t\t\t\thtml += '<param name=\"movie\" value=\"' +opts.src+ '\" />';\n\t\t\t}\n\n\t\t\t// not allowed params\n\t\t\topts.width = opts.height = opts.id = opts.w3c = opts.src = null;\n\t\t\topts.onFail = opts.version = opts.expressInstall = null;\n\n\t\t\tfor (var key in opts) {\n\t\t\t\tif (opts[key]) {\n\t\t\t\t\thtml += '<param name=\"'+ key +'\" value=\"'+ opts[key] +'\" />';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/******* FLASHVARS *******/\n\t\t\tvar vars = \"\";\n\n\t\t\tif (conf) {\n\t\t\t\tfor (var k in conf) {\n\t\t\t\t\tif (conf[k]) {\n\t\t\t\t\t\tvar val = conf[k];\n\t\t\t\t\t\tvars += k +'='+ (/function|object/.test(typeof val) ? f.asString(val) : val) + '&';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvars = vars.slice(0, -1);\n\t\t\t\thtml += '<param name=\"flashvars\" value=\\'' + vars + '\\' />';\n\t\t\t}\n\n\t\t\thtml += \"</object>\";\n\n\t\t\treturn html;\n\t\t},\n\n\t\tisSupported: function(ver) {\n\t\t\treturn VERSION[0] > ver[0] || VERSION[0] == ver[0] && VERSION[1] >= ver[1];\n\t\t}\n\n\t});\n\n\tvar VERSION = f.getVersion();\n\n\tfunction Flash(root, opts, conf) {\n\n\t\t// version is ok\n\t\tif (f.isSupported(opts.version)) {\n\t\t\troot.innerHTML = f.getHTML(opts, conf);\n\n\t\t// express install\n\t\t} else if (opts.expressInstall && f.isSupported([6, 65])) {\n\t\t\troot.innerHTML = f.getHTML(extend(opts, {src: opts.expressInstall}), {\n\t\t\t\t//xss fix #357\n\t\t\t\tMMredirectURL: encodeURIComponent(location.href),\n\t\t\t\tMMplayerType: 'PlugIn',\n\t\t\t\tMMdoctitle: document.title\n\t\t\t});\n\n\t\t} else {\n\n\t\t\t// fail #2.1 custom content inside container\n\t\t\tif (!root.innerHTML.replace(/\\s/g, '')) {\n\t\t\t\troot.innerHTML =\n\t\t\t\t\t\"<h2>Flash version \" + opts.version + \" or greater is required</h2>\" +\n\t\t\t\t\t\"<h3>\" +\n\t\t\t\t\t\t(VERSION[0] > 0 ? \"Your version is \" + VERSION : \"You have no flash plugin installed\") +\n\t\t\t\t\t\"</h3>\" +\n\n\t\t\t\t\t(root.tagName == 'A' ? \"<p>Click here to download latest version</p>\" :\n\t\t\t\t\t\t\"<p>Download latest version from <a href='\" + URL + \"'>here</a></p>\");\n\n                //#526. allow click through event for flash installation message when using div containers.\n\t\t\t\tif (root.tagName == 'A' || root.tagName == \"DIV\") {\n\t\t\t\t\troot.onclick = function() {\n\t\t\t\t\t\tlocation.href = URL;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// onFail\n\t\t\tif (opts.onFail) {\n\t\t\t\tvar ret = opts.onFail.call(this);\n\t\t\t\tif (typeof ret == 'string') { root.innerHTML = ret; }\n\t\t\t}\n\t\t}\n\n\t\t// http://flowplayer.org/forum/8/18186#post-18593\n\t\tif (IE) {\n\t\t\twindow[opts.id] = document.getElementById(opts.id);\n\t\t}\n\n\t\t// API methods for callback\n\t\textend(this, {\n\n\t\t\tgetRoot: function() {\n\t\t\t\treturn root;\n\t\t\t},\n\n\t\t\tgetOptions: function() {\n\t\t\t\treturn opts;\n\t\t\t},\n\n\n\t\t\tgetConf: function() {\n\t\t\t\treturn conf;\n\t\t\t},\n\n\t\t\tgetApi: function() {\n\t\t\t\treturn root.firstChild;\n\t\t\t}\n\n\t\t});\n\t}\n\n\t// setup jquery support\n\tif (JQUERY) {\n\n\t\t// tools version number\n\t\tjQuery.tools = jQuery.tools || {version: '@VERSION'};\n\n\t\tjQuery.tools.flashembed = {\n\t\t\tconf: GLOBAL_OPTS\n\t\t};\n\n\t\tjQuery.fn.flashembed = function(opts, conf) {\n\t\t\treturn this.each(function() {\n\t\t\t\t$(this).data(\"flashembed\", flashembed(this, opts, conf));\n\t\t\t});\n\t\t};\n\t}\n\n}();\n"
  },
  {
    "path": "video/player.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>video player</title>\n</head>\n<body>\n<link rel=\"stylesheet\" href=\"../res/rongcloud.css\">\n<a href=\"https://github.com/rongcloud/websdk-demo/tree/master/video\" class=\"get-source\">获取源码</a>\n\n<!-- \nhttps://github.com/flowplayer/flash\nhttp://flash.flowplayer.org/documentation/configuration/\n-->\n\n<style>\n.slight{\n\tdisplay:inline-block;\n\toverflow:hidden;\n\tborder:10px solid #ccc;\n\tfont-size:0;\n\tposition:relative;\n}\n.slight img{\n\tposition:absolute;\n\tleft:0;\n\ttop:0;\n}\t\n.slight img,\n.slight a,\n.slight video{\n\tdisplay:inline-block;\n\twidth:100%;\n\theight:100%;\n\tcursor: pointer;\n}\n</style>\n<script src=\"../lib/vue-2.1.4.js\"></script>\n<script src=\"./flowplayer/flowplayer-3.2.13.js?new\"></script>\n<script>\nfunction slight(){\n\tflowplayer(\".slight-flash-player\", \"./flowplayer/flowplayer-3.2.18.swf\",{\n\t\tclip:  {\n\t        autoPlay: false,\n\t        autoBuffering: true\n\t    },\n\t    plugins : {\n\t    \tcontrols : {\n\t    \t\topacity : 0,\n\t    \t\tbackgroundColor: 'transparent'\n\t    \t}\n\t    }\n\t});\n}\nfunction isSupportVideo(){\n\treturn window[\"HTMLVideoElement\"];\t\n}\n</script>\t\n\n<div class=\"slight\" v-bind:style=\"styleObject\">\n\t<!-- <img :src=\"content.image\" alt=\"\" @click=\"hide\"> -->\n\t<video v-if=\"isSupportVideo\" @click=\"play\" class=\"slight-video-player\" :src=\"content.file\"></video>\n\t<a v-else=\"isSupportVideo\" class=\"slight-flash-player\" :href=\"content.file\"></a> \n</div>\n\n\n<script>\nvar content = {\n\t\"file\" : \"../res/heal-the-world.mp4\",\n\t\"image\" : \"../res/heal-the-world.jpg\",\n\t\"width\" : 400,\n\t\"height\" : 300,\n\t\"name\" : \"Heal the world!\"\n};\n\nvar slightIns = new Vue({\n\tel : \".slight\",\n\tdata : {\n\t\tisSupportVideo : isSupportVideo(),\n\t\tcontent : content,\n\t\tstyleObject : {\n\t\t\twidth : content.width + \"px\",\n\t\t\theight : content.height + \"px\"\n\t\t}\n\t},\n\tmethods : {\n\t\thide : function(event){\n\t\t\tvar _image = event.target;\n\t\t\t\t_image.style.display = \"none\";\n\t\t\t\talert(_image)\n\t\t},\n\t\tplay : function(event){\n\t\t\tvar _video = event.target;\n\t\t\tif(_video.paused){\n\t\t\t\t_video.play();\n\t\t\t}else{\n\t\t\t\t_video.pause();\n\t\t\t}\n\t\t}\n\t}\n}); \n\nslight();\n</script>\t\n\n</body>\n</html>"
  },
  {
    "path": "voice-autoplay.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>voice</title>\n</head>\n<body>\n\n<h1>voice autoplay</h1>\n\n<script src=\"./lib/Libamr-2.2.5.min.js\"></script>\n<script type=\"text/javascript\" src=\"./lib/RongIMVoice-2.2.6.js\"></script>\n\n<!-- 引入base64编码的 amr 音频数据 -->\n<script src=\"./res/voice-amr-base64.json\"></script>\n<script>\nvar RongIMVoice = RongIMLib.RongIMVoice;\n\tRongIMVoice.init();\n\nfunction play(voice){\n\tif(voice){\n\t\tvar duration = voice.length/1024;    // 音频持续大概时间(秒)\n\t\tRongIMVoice.preLoaded(voice, function(){\n\t\t    RongIMVoice.play(voice,duration);\n\t\t});\n\t}else{\n\t\tconsole.error('请传入 amr 格式的 base64 音频文件');\n\t}\n}\n\nvar voiceData = voice;    //from voice-amr-base64.json\n\nplay(voiceData);\n</script>\n</body>\n</html>"
  },
  {
    "path": "voice.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>voice</title>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE9\" />\n</head>\n<body>\n<link rel=\"stylesheet\" href=\"./res/rongcloud.css\">\n\n<script type=\"text/javascript\" src=\"./lib/jquery-3.1.1.js\"></script>\n\n<!-- IE9下 swfobject 报错问题解决 -->\n<!--[if !IE]><!--> \n<script src=\"./lib/Libamr-2.2.5.min.js\"></script>\n<!--<![endif]-->\n<script type=\"text/javascript\" src=\"./lib/RongIMVoice-2.2.6.js\"></script>\n\n<!-- 引入base64编码的 amr 音频数据 -->\n<script src=\"./res/voice-amr-base64.json\"></script>\n\n<a href=\"https://github.com/rongcloud/websdk-demo/blob/master/voice.html\" class=\"get-source\">获取源码</a>\n\n<h1>声音库</h1>\n<h2><a href=\"http://www.rongcloud.cn/docs/web.html#声音库\">http://www.rongcloud.cn/docs/web.html#声音库</a></h2>\n<div>支持范围：\n\t<p>（1）IE9+、Windows Edge、Chrome、Firefox、Safari 等主流桌面版浏览器</p>\n\t<p>（2）iOS Safari、iOS 微信浏览器 </p>\n\t<p>（3）Android 4.4+ 默认浏览器、Android 微信浏览器</p>\n</div>\n\n<button class=\"voiceInfo\" messageUId=\"5FNN-5MIH-S1VP-FT2O\">播放测试语音1 base64 </button>\n<button class=\"voiceInfo\" messageUId=\"5FNN-5MSJ-068O-EPDH\">播放测试语音2 base64</button>\n\n<script>\n/*\n\t初始化声音库\n*/\nvar RongIMVoice = RongIMLib.RongIMVoice;\n\tRongIMVoice.init();\n\n/*\n\t* play() 播放音频消息\n\t* 参数 voice 为 amr 格式的 base64\n\t* 示例: voice = \"IyFBTVIKLNEafAAeef/hgmeAH8AD...\";\n*/\n\nfunction play(voice){\n\tif(voice){\n\t\tvar duration = voice.length/1024;    // 音频持续大概时间(秒)\n\t\tRongIMVoice.preLoaded(voice, function(){\n\t\t    RongIMVoice.play(voice,duration);\n\t\t});\n\t}else{\n\t\tconsole.error('请传入 amr 格式的 base64 音频文件');\n\t}\n}\n\n/*\n    * messageData 为音频示例数据，在 voice-amr-base64.json 中\n    * 通过监听 button 的点击事件获取 消息的唯一标示 messageUId\n    * 根据 messageUId 获取到 音频消息的 base64 数据，然后执行 play() 方法\n*/\n\n$(\".voiceInfo\").on(\"click\",function(){\n\tvar messageUId = $(this).attr('messageUId');\n\tvar voiceData = messageData[messageUId].content.content;    //获取 base64 音频文件\n\tplay(voiceData);\n});\n\n\n</script>\n</body>\n</html>"
  },
  {
    "path": "vue/im/config.js",
    "content": "var RongIM = {\n  config: {\n    appKey : \"8w7jv4qb78a9y\",\n    token : \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\"\n  },\n  components: {}\n};"
  },
  {
    "path": "vue/im/conversation-list.js",
    "content": "'use strict';\n(function(RongIM) {\n  var components = RongIM.components;\n  var Conversation = RongIM.Conversation;\n  var im = RongIM.im;\n\n  var conversationList = {\n    name: 'conversation-list',\n    template: `\n      <div class=\"rong-conversation-box\">\n          <div class=\"rong-conversation-list\">\n              <div class=\"rong-conversation\" v-for=\"conversation in conversationList\" @click=\"show(conversation)\">\n                  <div class=\"rong-conversation-user\">\n                      <div class=\"rong-conversation-avatar rong-avatar\" :style=\"{'background-image': 'url(' + conversation._target.portrait + ')'}\"></div>\n                  </div>\n                  <div class=\"rong-conversation-title\">{{conversation._target.name}}</div>\n                  <div class=\"rong-conversation-message\">\n                      <span class=\"rong-conversation-sendername\">{{conversation._sender.name}}:</span>\n                      <em class=\"rong-conversation-content\">{{conversation.latestMessage._content}}</em>\n                  </div>\n                  <div class=\"rong-conversation-senttime\">{{conversation._sentTime}}</div>\n              </div>\n          </div>\n      </div>\n        `,\n    data: function() {\n      return {\n        conversationList: []\n      };\n    },\n    mounted: function(){\n      mounted(this);\n    },\n    created: function() {\n      getConversationList(this);\n    },\n    methods: {\n      show: function(conversation){\n        var conversationType = conversation.conversationType;\n        var targetId = conversation.targetId;\n\n        this.$router.push({\n            name: 'conversation',\n            params: {\n              conversationType: conversationType,\n              targetId: targetId\n          }\n        });\n      }\n    }\n  };\n\n  function mounted(ctx){\n    var Conversation = RongIM.Conversation;\n    Conversation.watch(function(){\n      getConversationList(ctx);\n    });\n  }\n  function getConversationList(ctx) {\n    var Conversation = RongIM.Conversation;\n    Conversation.get(function(error, conversationList) {\n      if (error) {\n        console.error('Conversation.get Error: %s', error);\n        return;\n      }\n      ctx.conversationList = conversationList;\n    });\n  }\n\n  components.conversationList = conversationList;\n})(RongIM, {\n  Vue: Vue\n});"
  },
  {
    "path": "vue/im/css/common.css",
    "content": "html,body{\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 12px;\n\theight: 100%;\n\twidth: 100%;\n\toverflow: hidden;\n}\n\na{\n\ttext-decoration: none;\n\tcolor: #333;\n}\n\na:hover{\n\tcolor: #53779E;\n\ttransition: all 0.3s;\n}\n\n.rong-input{\n\toutline: none;\n\tborder: none;\n}\n\n.rong-avatar{\n\theight: 40px;\n\twidth: 40px;\n\tbackground-size: cover;\n\tbackground-repeat: no-repeat;\n  border-radius: 20px;\n  border: 1px solid #FFF;\n}\n\n.rong-selected{\n\tbackground-color: #E0E8F2;\n}\n\n.rong-clearfix{\n\tclear: both;\n}"
  },
  {
    "path": "vue/im/css/main.css",
    "content": ".rong-im{\n\tposition: relative;\n    width: 100%;\n    height: 100%;\n    min-width: 1200px;\n    background-size: 100%;\n    background-position: center;\n}\n\n.rong-conversation-box{\n\theight: 100%;\n\twidth: 300px;\n\tmin-width: 300px;\n\tfloat: left;\n\tposition: relative;\n}\n\n.rong-conversation-list{\n    height: 100%;\n    overflow-y: auto;\n    background: #f9f9fa;\n    opacity: 0.9;\n}\n\n.rong-conversation{\n\twidth: 100%;\n    height: 60px;\n    position: relative;\n    box-sizing: border-box;\n    padding-top: 10px;\n    padding-left: 5px;\n    padding-right: 5px;\n    cursor: pointer;\n}\n\n.rong-conversation:hover{\n\tbackground-color: #e0e8f2;\n\ttransition: all 0.5s;\n}\n\n.rong-conversation-user{\n\tfloat: left;\n}\n\n.rong-conversation-avatar{\n\tmargin-right: 10px;\n}\n\n.rong-conversation-title{\n\tfont-size: 13px;\n}\n\n.rong-conversation-message{\n\tfloat: left;\n\tcolor: #999;\n  width: 75%;\n  margin-top: 6px;\n}\n\n.rong-conversation-sendername{\n  float: left;\n}\n\n.rong-conversation-content{\n  display: inline-block;\n  text-overflow: ellipsis;\n  overflow: hidden;\n  white-space: nowrap;\n  width: 80%;\n}\n\n.rong-conversation-senttime{\n  position: absolute;\n  right: 2px;\n  top: -1px;\n}\n\n.rong-main{\n\theight: 100%;\n\tmargin-left: 300px;\n\tposition: relative;\n}\n\n.rong-message-list{\n\twidth: 100%;\n\tposition: absolute;\n\ttop: 10px;\n\tbottom: 60px;\n\toverflow-y: auto;\n}\n\n.rong-message{\n\tmin-height: 40px;\n\tmargin-top: 10px;\n}\n\n.rong-message-receiver{\n}\n\n.rong-message-receiver-avatar{\n\tfloat: left;\n\tmargin-left: 10px;\n}\n\n.rong-message-content{\n    max-width: 600px;\n    min-height: 40px;\n    min-width: 80px;\n    word-wrap: break-word;\n    display: inline-block;\n    padding: 4px 5px 14px 7px;\n    box-sizing: border-box;\n    position: relative;\n    opacity: 0.9;\n    border-radius: 12px;\n    margin-bottom: 10px;\n}\n\n.rong-message-senttime{\n\tdisplay: inline-block;\n\tposition: relative;\n\tcolor: #333;\n}\n\n.rong-message-receiver .rong-message-senttime{\n  top: 20px;\n  left: -37px\n}\n\n.rong-message-receiver .rong-message-content{\n    margin-left: 18px;\n    border: 1px solid #999;\n}\n\n.rong-message-receiver .rong-message-content:before,.rong-message-content:after{\n\tcontent: \"\";\n  border-bottom: 12px solid;\n  border-left: 4px solid;\n  border-right: 11px solid;\n  display: block;\n  position: absolute;\n}\n\n.rong-message-receiver .rong-message-content:before{\n  border-color: transparent #999 transparent transparent;\n  left: -15px;\n  top: 12px;\n}\n\n.rong-message-receiver .rong-message-content:after{\n  border-color: transparent #FFF transparent transparent;\n  top: 13px;\n  left: -12px;\n}\n\n.rong-message-sender-avatar{\n\tfloat: right;\n\tmargin-right: 10px;\n}\n\n.rong-message-sender .rong-message-content{\n\tfloat: right;\n\tmargin-right: 14px;\n\tbackground-color: #cae7fd;\n}\n\n.rong-message-sender{\n    display: inline-block;\n    position: relative;\n    width: 100%;\n}\n\n.rong-message-sender .rong-message-senttime{\n    position: absolute;\n    bottom: 6px;\n    right: 75px;\n}\n\n\n.rong-message-sender .rong-message-content:after{\n  border-top: 0;\n  border-bottom: 18px solid;\n  border-left: 11px solid;\n  border-right: 12px solid;\n\tright: -20px;\n  top: 11px;\n  border-color: transparent transparent transparent #cae7fd;\n}\n\n.rong-edior-box{\n  border-top: 1px solid #ececed;\n\theight: 60px;\n  position: absolute;\n  width: 100%;\n  bottom: 0;\n}\n\n.rong-editor-input{\n\theight: 60px;\n}\n\n.rong-editor-input-content{\n\tbox-sizing: border-box;\n\tpadding: 10px;\n  width: 100%;\n  height: 60px;\n\tmax-height: 60px;\n\tresize: none;\n  line-height: 40px;\n}"
  },
  {
    "path": "vue/im/im.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<title>Rong-IM-Vue</title>\n\t<link rel=\"icon\" type=\"image/png\" href=\"css/images/logo.png\">\n\t<link rel=\"stylesheet\" href=\"css/common.css\">\n\t<link rel=\"stylesheet\" href=\"css/main.css\">\n\n\t<script src=\"js/service.js\"></script>\n\t<script src=\"//cdn.ronghub.com/RongIMLib-2.5.1.js\"></script>\n\n\t<script src=\"lib/vue-2.1.4.js\"></script>\n\t<script src=\"lib/vue-router-2.1.1.js\"></script>\n\t\n\t<script src=\"config.js\"></script>\n\t\n\t<script src=\"conversation-list.js\"></script>\n\t<script src=\"message-list.js\"></script>\n\n\t<script src=\"routes.js\"></script>\n\n\t<script src=\"im.js\"></script>\n\n</head>\n<body>\n\t<div class=\"rong-im\" id=\"rong-im\">\n\t\t<!-- 会话列表 -->\n\t\t<router-view name=\"list\"></router-view>\n\t\t<!-- 会话窗口消息列表 -->\n\t\t<router-view name=\"chat\"></router-view>\n\t</div>\n</body>\n</html>"
  },
  {
    "path": "vue/im/im.js",
    "content": "(function(RongIM, dependencies) {\n  \n  var RongIMLib = dependencies.RongIMLib;\n  var RongService = dependencies.RongService;\n\n  var init = function() {\n\n    var routes = RongIM.routes;\n\n    var router = new VueRouter({\n        linkActiveClass: routes.linkActiveClass,\n        routes: routes.maps\n    });\n\n    var im = new Vue({\n      el: \"#rong-im\",\n      router: router\n    });\n\n    RongIM.im = im;\n  };\n\n  var config = RongIM.config;\n  var modules = {\n    RongIMLib: RongIMLib\n  };\n  RongService.init(config, function(services, currentUser) {\n    console.log('CurrentUser %o', currentUser);\n    \n    var Conversation = services.Conversation;\n    var Message = services.Message;\n\n    RongIM.Conversation = Conversation;\n    RongIM.Message = Message;\n    \n    init();\n\n  }, modules);\n\n})(RongIM, {\n  VueRouter: VueRouter,\n  RongService: RongService,\n  RongIMLib: RongIMLib\n});"
  },
  {
    "path": "vue/im/js/service.js",
    "content": "\"use strict\";\n(function(global, factory) {\n  if (typeof exports === 'object' && typeof module !== 'undefined') {\n    module.exports = factory();\n  } else if (typeof define === 'function' && define.amd) {\n    define(factory);\n  } else {\n    global.RongService = factory();\n  }\n})(window, function() {\n\n  var IMLib = null,\n    IMClient = null,\n    imInstance = null;\n\n  var utils = {\n    isFunction: function(func) {\n      return (typeof func == 'function');\n    },\n    isArray: function(arrs) {\n      return (Object.prototype.toString.call(arrs) == '[object Array]');\n    },\n    noop: function() {},\n    forEach: function(arrs, callback) {\n      for (var i = 0, len = arrs.length; i < len; i++) {\n        var item = arrs[i];\n        callback(item, i);\n      }\n    },\n    copy: function(target, source) {\n      for (var key in source) {\n        target[key] = source[key];\n      }\n    }\n  };\n\n  var Logger = {\n    warn: console.warn,\n    log: console.log\n  };\n\n  var Emitter = (function() {\n    var events = {};\n    var fire = function(name, args) {\n      if (name in events) {\n        for (var i = 0, len = events[name].length; i < len; i++) {\n          events[name][i](args);\n        }\n      }\n    };\n\n    var on = function(name, event) {\n      var isFunc = utils.isFunction(event);\n      if (!isFunc) {\n        return;\n      }\n      events[name] = events[name] || [];\n      events[name].push(event);\n    };\n\n    return {\n      fire: fire,\n      on: on\n    };\n  })();\n\n  function Watcher() {\n    var checkIndexOutBound = function(index, bound) {\n      return index > -1 && index < bound;\n    };\n\n    this.watcherList = [];\n\n    this.add = function(observer, force) {\n      if (force) {\n        this.watcherList.length = 0;\n      }\n      this.watcherList.push(observer);\n    };\n\n    this.get = function(index) {\n      if (checkIndexOutBound(index, this.watcherList.length)) {\n        return this.watcherList[index];\n      }\n    };\n\n    this.count = function() {\n      return this.watcherList.length;\n    };\n\n    this.removeAt = function(index) {\n      checkIndexOutBound(index, this.watcherList.length) && this.watcherList.splice(index, 1);\n    };\n\n    this.remove = function(observer) {\n      if (!observer) {\n        this.watcherList.length = 0;\n        return;\n      }\n      var isFunction = (Object.prototype.toString.call(observer) === '[object Function]');\n      var watcherList = isFunction ? [observer] : observer;\n      for (var i = 0, len = this.watcherList.length; i < len; i++) {\n        for (var j = 0; j < watcherList.length; j++) {\n          if (this.watcherList[i] === watcherList[j]) {\n            this.removeAt(i);\n            break;\n          }\n        }\n      }\n    };\n\n    this.notify = function(val) {\n      for (var i = 0, len = this.watcherList.length; i < len; i++) {\n        this.watcherList[i](val);\n      }\n    };\n\n    this.indexOf = function(observer, startIndex) {\n      var i = startIndex || 0,\n        len = this.watcherList.length;\n      while (i < len) {\n        if (this.watcherList[i] === observer) {\n          return i;\n        }\n        i++;\n      }\n      return -1;\n    };\n  }\n\n  var User = {\n    _Cache: {}\n  };\n\n  /*\n    此处只为演示，实际应用需请求应用服务器获取用户信息\n  */\n  User.get = function(user) {\n    var id = user.id;\n\n    //保证不刷新页面情况下，同一个 userId 的信息是一致的\n    user = User._Cache[id];\n    if (user) {\n      return user;\n    }\n\n    var nameList = \"梦琪忆柳之桃慕青问兰尔岚元香初夏沛菡傲珊曼文乐菱痴珊恨玉惜文香寒新柔语蓉海安夜蓉涵柏水桃醉蓝春儿语琴从彤傲晴语兰又菱碧彤元霜怜梦紫寒妙彤曼易南莲紫翠雨寒易烟如萱若南寻真晓亦向珊慕灵以蕊寻雁映易雪柳孤岚笑霜海云\";\n    var nameLen = nameList.length;\n\n    var xingList = \"赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张于\";\n    var xingLen = xingList.length;\n\n    var portraits = [\n      'https://rongcloud-image.cn.ronghub.com/fa33294a358e7f2abf.gif?e=2147483647&token=CddrKW5AbOMQaDRwc3ReDNvo3-sL_SO1fSUBKV3H:z2QkbpEqUEMrOPrJtV3tBP4gQYo=',\n      'http://7xogjk.com1.z0.glb.clouddn.com/01fac54313ad977d6e.gif',\n      'https://rongcloud-image.cn.ronghub.com/2fcdba4205860a63fb.gif?e=2147483647&token=livk5rb3__JZjCtEiMxXpQ8QscLxbNLehwhHySnX:m7S0ADf1E-d2bIG3E0vuiZJSH_w=',\n      'http://oqekw07cj.bkt.clouddn.com/9da99c4255a24baba1.gif',\n      'http://2f.zol-img.com.cn/product/172_100x75/267/cepP02EKJTV6.gif',\n      'https://fsprodrcx.cn.ronghub.com/lVMs15VSLeR47CzXlVMs15VbxLGVULo2/timg.gif',\n      'https://fsprodrcx.cn.ronghub.com/FmUv4RZmLtL72i_hFmUv4RYqrWMWbCI7/timg+%284%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/vJiff7ybnkxRJ59_vJiff7zADyO8gW0a/timg+%285%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/5FJuo-RTb5AJ7W6j5FJuo-Rf_-_kU162/timg+%283%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/Jx-MkScejaLKoIyRJx-MkScT89YnHp6U/timg+%282%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/pQjyn6UJ86xIt_KfpQjyn6UGM_6lDaO-/timg+%281%29.gif',\n      'https://fsprodrcx.cn.ronghub.com/1T1xVdU_cGY4gnFV1T1xVdUFyRPVM_4N/test.gif',\n      'https://fsprodrcx.cn.ronghub.com/yn2CV8p8g2QnwoJXyn2CV8ppkNXKdrNS/1512691986120.gif',\n      'https://fsprodrcx.cn.ronghub.com/B0qmIAdLpxPq9aYgB0qmIAdV5acHSrhp/timg.jpeg'\n    ];\n\n    var portraitLen = portraits.length;\n\n    var getIndex = (max) => {\n      return Math.floor(Math.random() * max) || 1;\n    };\n\n    var getName = (len) => {\n      var names = [];\n      for (var i = 0; i < len; i++) {\n        var index = getIndex(nameLen);\n        names.push(nameList[index]);\n      }\n      return names.join('');\n    };\n\n    var getXing = (index) => {\n      return xingList.split('')[index];\n    };\n\n    var getPortrait = (index) => {\n      return portraits[index];\n    };\n\n    var nameIndex = getIndex(3);\n    var xingIndex = getIndex(xingLen);\n    var name = getXing(xingIndex) + getName(nameIndex);\n\n    var portraitIndex = getIndex(portraitLen);\n\n    var portrait = getPortrait(portraitIndex);\n\n    user = {\n      name: name,\n      portrait: portrait\n    };\n    User._Cache[id] = user;\n    return user;\n  };\n\n  var formatSentTime = function(time) {\n    var date = new Date(time);\n    var hours = date.getHours();\n    var minutes = date.getMinutes();\n    return hours + ':' + minutes;\n  }\n\n  var getMessageContent = function(message) {\n    var content = '[暂未解析此类型消息]';\n    var messageMap = {\n      TextMessage: message.content.content,\n      FileMessage: '[文件]',\n      ImageMessage: '[图片]'\n    };\n    var messageType = message.messageType;\n    return messageMap[messageType] || content;\n  };\n\n  var formartMessage = function(message) {\n    var sender = User.get({\n      id: message.senderUserId\n    });\n    var sentTime = message.sentTime;\n    sentTime = formatSentTime(sentTime);\n\n    var direction = (message.messageDirection == 1) ? 'sender' : 'receiver';\n\n    var content = getMessageContent(message);\n\n    utils.copy(message, {\n      _sender: sender,\n      _sentTime: sentTime,\n      _direction: direction,\n      _content: content\n    });\n  }\n\n  var conversationWatcher = new Watcher();\n\n  var Conversation = {};\n\n  Conversation.get = function(callback) {\n    callback = callback || utils.noop;\n    // 过滤会话类型，null 为不过滤，获取全部会话类型, conversationTypes = null | [1, 3]\n    var conversationTypes = null;\n    imInstance.getConversationList({\n      onSuccess: function(conversationList) {\n        var error = null;\n\n        // 示例暂时只演示单聊\n        conversationList = conversationList.filter(function(conversation) {\n          var isPrivate = (conversation.conversationType == IMLib.ConversationType.PRIVATE);\n          return isPrivate;\n        });\n\n        utils.forEach(conversationList, function(conversation) {\n          var target = User.get({\n            id: conversation.targetId\n          });\n\n          var sentTime = conversation.sentTime;\n          sentTime = formatSentTime(sentTime);\n\n          var message = conversation.latestMessage;\n          var content = getMessageContent(message);\n          var sender = User.get({\n            id: message.senderUserId\n          });\n\n          utils.copy(message, {\n            _content: content\n          });\n          utils.copy(conversation, {\n            _target: target,\n            _sentTime: sentTime,\n            _sender: sender\n          });\n        });\n\n        callback(error, conversationList);\n      },\n      onError: function(error) {\n        Logger.log('Conversation.get Error: %s', error);\n        callback(error);\n      }\n    }, conversationTypes);\n  };\n\n  Conversation.watch = function(watcher) {\n    conversationWatcher.add(watcher);\n  };\n\n  Emitter.on('onconversation', function(conversation) {\n    Conversation.get(function(conversationList) {\n      conversationWatcher.notify(conversationList);\n    });\n  });\n\n  var Message = {};\n  var messageWatcher = new Watcher();\n\n  Message.get = function(conversation, callback) {\n    var type = conversation.type;\n    var targetId = conversation.targetId;\n    var count = 20;\n    // 获取历史消息起始时间，0 表示从最近的一条消息开始向前获取 20 条, 详细说明：http://www.rongcloud.cn/docs/web_api_demo.html#message_history\n    var timestrap = 0;\n    imInstance.getHistoryMessages(type, targetId, timestrap, count, {\n      onSuccess: function(messageList) {\n        var error = null;\n\n        utils.forEach(messageList, function(message) {\n            formartMessage(message);\n        });\n\n        callback(error, messageList);\n      },\n      onError: function(error) {\n        Logger.log('Message.get Error: %s', error);\n        callback(error);\n      }\n    });\n  };\n\n  Message.sendTxt = function(message, callback) {\n    callback = callback || utils.noop;\n\n    var content = message.content;\n    var sender = message.sender;\n    var msg = new IMLib.TextMessage({\n      content: content,\n      user: sender\n    });\n\n    var conversationtype = message.type\n    var targetId = message.targetId;\n    imInstance.sendMessage(conversationtype, targetId, msg, {\n      onSuccess: function(message) {\n        var error = null;\n        formartMessage(message);\n        callback(error, message);\n\n        Emitter.fire('onconversation');\n      },\n      onError: function(error) {\n        Logger.log('Message.sendTxt Error: %s', error);\n        callback(error);\n      }\n    });\n  };\n\n  Message.watch = function(watcher) {\n    messageWatcher.add(watcher);\n  };\n\n  Emitter.on('onmessage', function(message) {\n    messageWatcher.notify(message);\n  });\n\n  var setListener = function() {\n    IMClient.setConnectionStatusListener({\n      onChanged: function(status) {\n        //Status 说明可参考 http://www.rongcloud.cn/docs/web_api_demo.html#init_listener\n        Logger.warn('WebSDK Status Changed: %d', status);\n      }\n    });\n\n    IMClient.setOnReceiveMessageListener({\n      onReceived: function(message) {\n        formartMessage(message);\n        Emitter.fire('onmessage', message);\n        Emitter.fire('onconversation');\n      }\n    });\n  };\n\n  var services = {\n    Conversation: Conversation,\n    Message: Message\n  };\n\n  var connect = function(token, callback) {\n    callback = callback || utils.noop;\n    IMClient.connect(token, {\n      onSuccess: function(id) {\n        var currentUser = {\n          id: id\n        };\n        callback(services, currentUser);\n      },\n      onTokenIncorrect: function() {\n        Logger.log('token 无效, 请参考: http://support.rongcloud.cn/kb/NDQ1');\n      },\n      onError: function(code) {\n        Logger.log(code);\n      }\n    });\n  };\n\n  /*\n    var options = {\n      appKey: '',\n      sdk: {\n        navi: '',\n        protobuf: ''\n      }\n    };\n    \n    var callback = function(services, currentUser){\n     \n    };\n\n    var modules = {\n      RongIMLib: RongIMLib,\n      protobuf: protobuf\n    };\n  */\n  var init = function(options, callback, modules) {\n    IMLib = modules.RongIMLib;\n    IMClient = IMLib.RongIMClient;\n\n    var appKey = options.appKey;\n    var sdk = options.sdk;\n    IMClient.init(appKey, null, sdk);\n    imInstance = IMClient.getInstance();\n\n    setListener();\n\n    var token = options.token;\n    connect(token, callback);\n\n  };\n\n  return {\n    init: init\n  };\n\n});"
  },
  {
    "path": "vue/im/lib/vue-2.1.4.js",
    "content": "/*!\n * Vue.js v2.1.4\n * (c) 2014-2016 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.Vue = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction _toString (val) {\n  return val == null\n    ? ''\n    : typeof val === 'object'\n      ? JSON.stringify(val, null, 2)\n      : String(val)\n}\n\n/**\n * Convert a input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n  var n = parseFloat(val, 10);\n  return (n || n === 0) ? n : val\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n  str,\n  expectsLowerCase\n) {\n  var map = Object.create(null);\n  var list = str.split(',');\n  for (var i = 0; i < list.length; i++) {\n    map[list[i]] = true;\n  }\n  return expectsLowerCase\n    ? function (val) { return map[val.toLowerCase()]; }\n    : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Remove an item from an array\n */\nfunction remove$1 (arr, item) {\n  if (arr.length) {\n    var index = arr.indexOf(item);\n    if (index > -1) {\n      return arr.splice(index, 1)\n    }\n  }\n}\n\n/**\n * Check whether the object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n  return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Check if value is primitive\n */\nfunction isPrimitive (value) {\n  return typeof value === 'string' || typeof value === 'number'\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n  var cache = Object.create(null);\n  return function cachedFn (str) {\n    var hit = cache[str];\n    return hit || (cache[str] = fn(str))\n  }\n}\n\n/**\n * Camelize a hyphen-delmited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n  return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /([^-])([A-Z])/g;\nvar hyphenate = cached(function (str) {\n  return str\n    .replace(hyphenateRE, '$1-$2')\n    .replace(hyphenateRE, '$1-$2')\n    .toLowerCase()\n});\n\n/**\n * Simple bind, faster than native\n */\nfunction bind$1 (fn, ctx) {\n  function boundFn (a) {\n    var l = arguments.length;\n    return l\n      ? l > 1\n        ? fn.apply(ctx, arguments)\n        : fn.call(ctx, a)\n      : fn.call(ctx)\n  }\n  // record original fn length\n  boundFn._length = fn.length;\n  return boundFn\n}\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n  start = start || 0;\n  var i = list.length - start;\n  var ret = new Array(i);\n  while (i--) {\n    ret[i] = list[i + start];\n  }\n  return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n  for (var key in _from) {\n    to[key] = _from[key];\n  }\n  return to\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n  return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n  return toString.call(obj) === OBJECT_STRING\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n  var res = {};\n  for (var i = 0; i < arr.length; i++) {\n    if (arr[i]) {\n      extend(res, arr[i]);\n    }\n  }\n  return res\n}\n\n/**\n * Perform no operation.\n */\nfunction noop () {}\n\n/**\n * Always return false.\n */\nvar no = function () { return false; };\n\n/**\n * Generate a static keys string from compiler modules.\n */\nfunction genStaticKeys (modules) {\n  return modules.reduce(function (keys, m) {\n    return keys.concat(m.staticKeys || [])\n  }, []).join(',')\n}\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n  /* eslint-disable eqeqeq */\n  return a == b || (\n    isObject(a) && isObject(b)\n      ? JSON.stringify(a) === JSON.stringify(b)\n      : false\n  )\n  /* eslint-enable eqeqeq */\n}\n\nfunction looseIndexOf (arr, val) {\n  for (var i = 0; i < arr.length; i++) {\n    if (looseEqual(arr[i], val)) { return i }\n  }\n  return -1\n}\n\n/*  */\n\nvar config = {\n  /**\n   * Option merge strategies (used in core/util/options)\n   */\n  optionMergeStrategies: Object.create(null),\n\n  /**\n   * Whether to suppress warnings.\n   */\n  silent: false,\n\n  /**\n   * Whether to enable devtools\n   */\n  devtools: \"development\" !== 'production',\n\n  /**\n   * Error handler for watcher errors\n   */\n  errorHandler: null,\n\n  /**\n   * Ignore certain custom elements\n   */\n  ignoredElements: null,\n\n  /**\n   * Custom user key aliases for v-on\n   */\n  keyCodes: Object.create(null),\n\n  /**\n   * Check if a tag is reserved so that it cannot be registered as a\n   * component. This is platform-dependent and may be overwritten.\n   */\n  isReservedTag: no,\n\n  /**\n   * Check if a tag is an unknown element.\n   * Platform-dependent.\n   */\n  isUnknownElement: no,\n\n  /**\n   * Get the namespace of an element\n   */\n  getTagNamespace: noop,\n\n  /**\n   * Check if an attribute must be bound using property, e.g. value\n   * Platform-dependent.\n   */\n  mustUseProp: no,\n\n  /**\n   * List of asset types that a component can own.\n   */\n  _assetTypes: [\n    'component',\n    'directive',\n    'filter'\n  ],\n\n  /**\n   * List of lifecycle hooks.\n   */\n  _lifecycleHooks: [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated'\n  ],\n\n  /**\n   * Max circular updates allowed in a scheduler flush cycle.\n   */\n  _maxUpdateCount: 100\n};\n\n/*  */\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n  var c = (str + '').charCodeAt(0);\n  return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n  Object.defineProperty(obj, key, {\n    value: val,\n    enumerable: !!enumerable,\n    writable: true,\n    configurable: true\n  });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = /[^\\w.$]/;\nfunction parsePath (path) {\n  if (bailRE.test(path)) {\n    return\n  } else {\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n}\n\n/*  */\n/* globals MutationObserver */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = UA && UA.indexOf('android') > 0;\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n  if (_isServer === undefined) {\n    /* istanbul ignore if */\n    if (!inBrowser && typeof global !== 'undefined') {\n      // detect presence of vue-server-renderer and avoid\n      // Webpack shimming the process\n      _isServer = global['process'].env.VUE_ENV === 'server';\n    } else {\n      _isServer = false;\n    }\n  }\n  return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n  return /native code/.test(Ctor.toString())\n}\n\n/**\n * Defer a task to execute it asynchronously.\n */\nvar nextTick = (function () {\n  var callbacks = [];\n  var pending = false;\n  var timerFunc;\n\n  function nextTickHandler () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // the nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore if */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    var logError = function (err) { console.error(err); };\n    timerFunc = function () {\n      p.then(nextTickHandler).catch(logError);\n      // in problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n  } else if (typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS IE11, iOS7, Android 4.4\n    var counter = 1;\n    var observer = new MutationObserver(nextTickHandler);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n  } else {\n    // fallback to setTimeout\n    /* istanbul ignore next */\n    timerFunc = function () {\n      setTimeout(nextTickHandler, 0);\n    };\n  }\n\n  return function queueNextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) { cb.call(ctx); }\n      if (_resolve) { _resolve(ctx); }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n})();\n\nvar _Set;\n/* istanbul ignore if */\nif (typeof Set !== 'undefined' && isNative(Set)) {\n  // use native Set when available.\n  _Set = Set;\n} else {\n  // a non-standard Set polyfill that only works with primitive keys.\n  _Set = (function () {\n    function Set () {\n      this.set = Object.create(null);\n    }\n    Set.prototype.has = function has (key) {\n      return this.set[key] !== undefined\n    };\n    Set.prototype.add = function add (key) {\n      this.set[key] = 1;\n    };\n    Set.prototype.clear = function clear () {\n      this.set = Object.create(null);\n    };\n\n    return Set;\n  }());\n}\n\nvar warn = noop;\nvar formatComponentName;\n\n{\n  var hasConsole = typeof console !== 'undefined';\n\n  warn = function (msg, vm) {\n    if (hasConsole && (!config.silent)) {\n      console.error(\"[Vue warn]: \" + msg + \" \" + (\n        vm ? formatLocation(formatComponentName(vm)) : ''\n      ));\n    }\n  };\n\n  formatComponentName = function (vm) {\n    if (vm.$root === vm) {\n      return 'root instance'\n    }\n    var name = vm._isVue\n      ? vm.$options.name || vm.$options._componentTag\n      : vm.name;\n    return (\n      (name ? (\"component <\" + name + \">\") : \"anonymous component\") +\n      (vm._isVue && vm.$options.__file ? (\" at \" + (vm.$options.__file)) : '')\n    )\n  };\n\n  var formatLocation = function (str) {\n    if (str === 'anonymous component') {\n      str += \" - use the \\\"name\\\" option for better debugging messages.\";\n    }\n    return (\"\\n(found in \" + str + \")\")\n  };\n}\n\n/*  */\n\n\nvar uid$1 = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n  this.id = uid$1++;\n  this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n  this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n  remove$1(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n  if (Dep.target) {\n    Dep.target.addDep(this);\n  }\n};\n\nDep.prototype.notify = function notify () {\n  // stablize the subscriber list first\n  var subs = this.subs.slice();\n  for (var i = 0, l = subs.length; i < l; i++) {\n    subs[i].update();\n  }\n};\n\n// the current target watcher being evaluated.\n// this is globally unique because there could be only one\n// watcher being evaluated at any time.\nDep.target = null;\nvar targetStack = [];\n\nfunction pushTarget (_target) {\n  if (Dep.target) { targetStack.push(Dep.target); }\n  Dep.target = _target;\n}\n\nfunction popTarget () {\n  Dep.target = targetStack.pop();\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);[\n  'push',\n  'pop',\n  'shift',\n  'unshift',\n  'splice',\n  'sort',\n  'reverse'\n]\n.forEach(function (method) {\n  // cache original method\n  var original = arrayProto[method];\n  def(arrayMethods, method, function mutator () {\n    var arguments$1 = arguments;\n\n    // avoid leaking arguments:\n    // http://jsperf.com/closure-with-arguments\n    var i = arguments.length;\n    var args = new Array(i);\n    while (i--) {\n      args[i] = arguments$1[i];\n    }\n    var result = original.apply(this, args);\n    var ob = this.__ob__;\n    var inserted;\n    switch (method) {\n      case 'push':\n        inserted = args;\n        break\n      case 'unshift':\n        inserted = args;\n        break\n      case 'splice':\n        inserted = args.slice(2);\n        break\n    }\n    if (inserted) { ob.observeArray(inserted); }\n    // notify change\n    ob.dep.notify();\n    return result\n  });\n});\n\n/*  */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * By default, when a reactive property is set, the new value is\n * also converted to become reactive. However when passing down props,\n * we don't want to force conversion because the value may be a nested value\n * under a frozen data structure. Converting it would defeat the optimization.\n */\nvar observerState = {\n  shouldConvert: true,\n  isSettingProps: false\n};\n\n/**\n * Observer class that are attached to each observed\n * object. Once attached, the observer converts target\n * object's property keys into getter/setters that\n * collect dependencies and dispatches updates.\n */\nvar Observer = function Observer (value) {\n  this.value = value;\n  this.dep = new Dep();\n  this.vmCount = 0;\n  def(value, '__ob__', this);\n  if (Array.isArray(value)) {\n    var augment = hasProto\n      ? protoAugment\n      : copyAugment;\n    augment(value, arrayMethods, arrayKeys);\n    this.observeArray(value);\n  } else {\n    this.walk(value);\n  }\n};\n\n/**\n * Walk through each property and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n  var keys = Object.keys(obj);\n  for (var i = 0; i < keys.length; i++) {\n    defineReactive$$1(obj, keys[i], obj[keys[i]]);\n  }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n  for (var i = 0, l = items.length; i < l; i++) {\n    observe(items[i]);\n  }\n};\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src) {\n  /* eslint-disable no-proto */\n  target.__proto__ = src;\n  /* eslint-enable no-proto */\n}\n\n/**\n * Augment an target Object or Array by defining\n * hidden properties.\n *\n * istanbul ignore next\n */\nfunction copyAugment (target, src, keys) {\n  for (var i = 0, l = keys.length; i < l; i++) {\n    var key = keys[i];\n    def(target, key, src[key]);\n  }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value) {\n  if (!isObject(value)) {\n    return\n  }\n  var ob;\n  if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n    ob = value.__ob__;\n  } else if (\n    observerState.shouldConvert &&\n    !isServerRendering() &&\n    (Array.isArray(value) || isPlainObject(value)) &&\n    Object.isExtensible(value) &&\n    !value._isVue\n  ) {\n    ob = new Observer(value);\n  }\n  return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive$$1 (\n  obj,\n  key,\n  val,\n  customSetter\n) {\n  var dep = new Dep();\n\n  var property = Object.getOwnPropertyDescriptor(obj, key);\n  if (property && property.configurable === false) {\n    return\n  }\n\n  // cater for pre-defined getter/setters\n  var getter = property && property.get;\n  var setter = property && property.set;\n\n  var childOb = observe(val);\n  Object.defineProperty(obj, key, {\n    enumerable: true,\n    configurable: true,\n    get: function reactiveGetter () {\n      var value = getter ? getter.call(obj) : val;\n      if (Dep.target) {\n        dep.depend();\n        if (childOb) {\n          childOb.dep.depend();\n        }\n        if (Array.isArray(value)) {\n          dependArray(value);\n        }\n      }\n      return value\n    },\n    set: function reactiveSetter (newVal) {\n      var value = getter ? getter.call(obj) : val;\n      /* eslint-disable no-self-compare */\n      if (newVal === value || (newVal !== newVal && value !== value)) {\n        return\n      }\n      /* eslint-enable no-self-compare */\n      if (\"development\" !== 'production' && customSetter) {\n        customSetter();\n      }\n      if (setter) {\n        setter.call(obj, newVal);\n      } else {\n        val = newVal;\n      }\n      childOb = observe(newVal);\n      dep.notify();\n    }\n  });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set$1 (obj, key, val) {\n  if (Array.isArray(obj)) {\n    obj.length = Math.max(obj.length, key);\n    obj.splice(key, 1, val);\n    return val\n  }\n  if (hasOwn(obj, key)) {\n    obj[key] = val;\n    return\n  }\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid adding reactive properties to a Vue instance or its root $data ' +\n      'at runtime - declare it upfront in the data option.'\n    );\n    return\n  }\n  if (!ob) {\n    obj[key] = val;\n    return\n  }\n  defineReactive$$1(ob.value, key, val);\n  ob.dep.notify();\n  return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (obj, key) {\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid deleting properties on a Vue instance or its root $data ' +\n      '- just set it to null.'\n    );\n    return\n  }\n  if (!hasOwn(obj, key)) {\n    return\n  }\n  delete obj[key];\n  if (!ob) {\n    return\n  }\n  ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n  for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n    e = value[i];\n    e && e.__ob__ && e.__ob__.dep.depend();\n    if (Array.isArray(e)) {\n      dependArray(e);\n    }\n  }\n}\n\n/*  */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\n{\n  strats.el = strats.propsData = function (parent, child, vm, key) {\n    if (!vm) {\n      warn(\n        \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n        'creation with the `new` keyword.'\n      );\n    }\n    return defaultStrat(parent, child)\n  };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n  if (!from) { return to }\n  var key, toVal, fromVal;\n  var keys = Object.keys(from);\n  for (var i = 0; i < keys.length; i++) {\n    key = keys[i];\n    toVal = to[key];\n    fromVal = from[key];\n    if (!hasOwn(to, key)) {\n      set$1(to, key, fromVal);\n    } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {\n      mergeData(toVal, fromVal);\n    }\n  }\n  return to\n}\n\n/**\n * Data\n */\nstrats.data = function (\n  parentVal,\n  childVal,\n  vm\n) {\n  if (!vm) {\n    // in a Vue.extend merge, both should be functions\n    if (!childVal) {\n      return parentVal\n    }\n    if (typeof childVal !== 'function') {\n      \"development\" !== 'production' && warn(\n        'The \"data\" option should be a function ' +\n        'that returns a per-instance value in component ' +\n        'definitions.',\n        vm\n      );\n      return parentVal\n    }\n    if (!parentVal) {\n      return childVal\n    }\n    // when parentVal & childVal are both present,\n    // we need to return a function that returns the\n    // merged result of both functions... no need to\n    // check if parentVal is a function here because\n    // it has to be a function to pass previous merges.\n    return function mergedDataFn () {\n      return mergeData(\n        childVal.call(this),\n        parentVal.call(this)\n      )\n    }\n  } else if (parentVal || childVal) {\n    return function mergedInstanceDataFn () {\n      // instance merge\n      var instanceData = typeof childVal === 'function'\n        ? childVal.call(vm)\n        : childVal;\n      var defaultData = typeof parentVal === 'function'\n        ? parentVal.call(vm)\n        : undefined;\n      if (instanceData) {\n        return mergeData(instanceData, defaultData)\n      } else {\n        return defaultData\n      }\n    }\n  }\n};\n\n/**\n * Hooks and param attributes are merged as arrays.\n */\nfunction mergeHook (\n  parentVal,\n  childVal\n) {\n  return childVal\n    ? parentVal\n      ? parentVal.concat(childVal)\n      : Array.isArray(childVal)\n        ? childVal\n        : [childVal]\n    : parentVal\n}\n\nconfig._lifecycleHooks.forEach(function (hook) {\n  strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (parentVal, childVal) {\n  var res = Object.create(parentVal || null);\n  return childVal\n    ? extend(res, childVal)\n    : res\n}\n\nconfig._assetTypes.forEach(function (type) {\n  strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (parentVal, childVal) {\n  /* istanbul ignore if */\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = {};\n  extend(ret, parentVal);\n  for (var key in childVal) {\n    var parent = ret[key];\n    var child = childVal[key];\n    if (parent && !Array.isArray(parent)) {\n      parent = [parent];\n    }\n    ret[key] = parent\n      ? parent.concat(child)\n      : [child];\n  }\n  return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.computed = function (parentVal, childVal) {\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = Object.create(null);\n  extend(ret, parentVal);\n  extend(ret, childVal);\n  return ret\n};\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n  return childVal === undefined\n    ? parentVal\n    : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n  for (var key in options.components) {\n    var lower = key.toLowerCase();\n    if (isBuiltInTag(lower) || config.isReservedTag(lower)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + key\n      );\n    }\n  }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options) {\n  var props = options.props;\n  if (!props) { return }\n  var res = {};\n  var i, val, name;\n  if (Array.isArray(props)) {\n    i = props.length;\n    while (i--) {\n      val = props[i];\n      if (typeof val === 'string') {\n        name = camelize(val);\n        res[name] = { type: null };\n      } else {\n        warn('props must be strings when using array syntax.');\n      }\n    }\n  } else if (isPlainObject(props)) {\n    for (var key in props) {\n      val = props[key];\n      name = camelize(key);\n      res[name] = isPlainObject(val)\n        ? val\n        : { type: val };\n    }\n  }\n  options.props = res;\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n  var dirs = options.directives;\n  if (dirs) {\n    for (var key in dirs) {\n      var def = dirs[key];\n      if (typeof def === 'function') {\n        dirs[key] = { bind: def, update: def };\n      }\n    }\n  }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n  parent,\n  child,\n  vm\n) {\n  {\n    checkComponents(child);\n  }\n  normalizeProps(child);\n  normalizeDirectives(child);\n  var extendsFrom = child.extends;\n  if (extendsFrom) {\n    parent = typeof extendsFrom === 'function'\n      ? mergeOptions(parent, extendsFrom.options, vm)\n      : mergeOptions(parent, extendsFrom, vm);\n  }\n  if (child.mixins) {\n    for (var i = 0, l = child.mixins.length; i < l; i++) {\n      var mixin = child.mixins[i];\n      if (mixin.prototype instanceof Vue$3) {\n        mixin = mixin.options;\n      }\n      parent = mergeOptions(parent, mixin, vm);\n    }\n  }\n  var options = {};\n  var key;\n  for (key in parent) {\n    mergeField(key);\n  }\n  for (key in child) {\n    if (!hasOwn(parent, key)) {\n      mergeField(key);\n    }\n  }\n  function mergeField (key) {\n    var strat = strats[key] || defaultStrat;\n    options[key] = strat(parent[key], child[key], vm, key);\n  }\n  return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n  options,\n  type,\n  id,\n  warnMissing\n) {\n  /* istanbul ignore if */\n  if (typeof id !== 'string') {\n    return\n  }\n  var assets = options[type];\n  var res = assets[id] ||\n    // camelCase ID\n    assets[camelize(id)] ||\n    // Pascal Case ID\n    assets[capitalize(camelize(id))];\n  if (\"development\" !== 'production' && warnMissing && !res) {\n    warn(\n      'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n      options\n    );\n  }\n  return res\n}\n\n/*  */\n\nfunction validateProp (\n  key,\n  propOptions,\n  propsData,\n  vm\n) {\n  var prop = propOptions[key];\n  var absent = !hasOwn(propsData, key);\n  var value = propsData[key];\n  // handle boolean props\n  if (isBooleanType(prop.type)) {\n    if (absent && !hasOwn(prop, 'default')) {\n      value = false;\n    } else if (value === '' || value === hyphenate(key)) {\n      value = true;\n    }\n  }\n  // check default value\n  if (value === undefined) {\n    value = getPropDefaultValue(vm, prop, key);\n    // since the default value is a fresh copy,\n    // make sure to observe it.\n    var prevShouldConvert = observerState.shouldConvert;\n    observerState.shouldConvert = true;\n    observe(value);\n    observerState.shouldConvert = prevShouldConvert;\n  }\n  {\n    assertProp(prop, key, value, vm, absent);\n  }\n  return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n  // no default, return undefined\n  if (!hasOwn(prop, 'default')) {\n    return undefined\n  }\n  var def = prop.default;\n  // warn against non-factory defaults for Object & Array\n  if (isObject(def)) {\n    \"development\" !== 'production' && warn(\n      'Invalid default value for prop \"' + key + '\": ' +\n      'Props with type Object/Array must use a factory function ' +\n      'to return the default value.',\n      vm\n    );\n  }\n  // the raw prop value was also undefined from previous render,\n  // return previous default value to avoid unnecessary watcher trigger\n  if (vm && vm.$options.propsData &&\n    vm.$options.propsData[key] === undefined &&\n    vm[key] !== undefined) {\n    return vm[key]\n  }\n  // call factory function for non-Function types\n  return typeof def === 'function' && prop.type !== Function\n    ? def.call(vm)\n    : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n  prop,\n  name,\n  value,\n  vm,\n  absent\n) {\n  if (prop.required && absent) {\n    warn(\n      'Missing required prop: \"' + name + '\"',\n      vm\n    );\n    return\n  }\n  if (value == null && !prop.required) {\n    return\n  }\n  var type = prop.type;\n  var valid = !type || type === true;\n  var expectedTypes = [];\n  if (type) {\n    if (!Array.isArray(type)) {\n      type = [type];\n    }\n    for (var i = 0; i < type.length && !valid; i++) {\n      var assertedType = assertType(value, type[i]);\n      expectedTypes.push(assertedType.expectedType);\n      valid = assertedType.valid;\n    }\n  }\n  if (!valid) {\n    warn(\n      'Invalid prop: type check failed for prop \"' + name + '\".' +\n      ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n      ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n      vm\n    );\n    return\n  }\n  var validator = prop.validator;\n  if (validator) {\n    if (!validator(value)) {\n      warn(\n        'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n        vm\n      );\n    }\n  }\n}\n\n/**\n * Assert the type of a value\n */\nfunction assertType (value, type) {\n  var valid;\n  var expectedType = getType(type);\n  if (expectedType === 'String') {\n    valid = typeof value === (expectedType = 'string');\n  } else if (expectedType === 'Number') {\n    valid = typeof value === (expectedType = 'number');\n  } else if (expectedType === 'Boolean') {\n    valid = typeof value === (expectedType = 'boolean');\n  } else if (expectedType === 'Function') {\n    valid = typeof value === (expectedType = 'function');\n  } else if (expectedType === 'Object') {\n    valid = isPlainObject(value);\n  } else if (expectedType === 'Array') {\n    valid = Array.isArray(value);\n  } else {\n    valid = value instanceof type;\n  }\n  return {\n    valid: valid,\n    expectedType: expectedType\n  }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n  var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n  return match && match[1]\n}\n\nfunction isBooleanType (fn) {\n  if (!Array.isArray(fn)) {\n    return getType(fn) === 'Boolean'\n  }\n  for (var i = 0, len = fn.length; i < len; i++) {\n    if (getType(fn[i]) === 'Boolean') {\n      return true\n    }\n  }\n  /* istanbul ignore next */\n  return false\n}\n\n\n\nvar util = Object.freeze({\n  defineReactive: defineReactive$$1,\n  _toString: _toString,\n  toNumber: toNumber,\n  makeMap: makeMap,\n  isBuiltInTag: isBuiltInTag,\n  remove: remove$1,\n  hasOwn: hasOwn,\n  isPrimitive: isPrimitive,\n  cached: cached,\n  camelize: camelize,\n  capitalize: capitalize,\n  hyphenate: hyphenate,\n  bind: bind$1,\n  toArray: toArray,\n  extend: extend,\n  isObject: isObject,\n  isPlainObject: isPlainObject,\n  toObject: toObject,\n  noop: noop,\n  no: no,\n  genStaticKeys: genStaticKeys,\n  looseEqual: looseEqual,\n  looseIndexOf: looseIndexOf,\n  isReserved: isReserved,\n  def: def,\n  parsePath: parsePath,\n  hasProto: hasProto,\n  inBrowser: inBrowser,\n  UA: UA,\n  isIE: isIE,\n  isIE9: isIE9,\n  isEdge: isEdge,\n  isAndroid: isAndroid,\n  isIOS: isIOS,\n  isServerRendering: isServerRendering,\n  devtools: devtools,\n  nextTick: nextTick,\n  get _Set () { return _Set; },\n  mergeOptions: mergeOptions,\n  resolveAsset: resolveAsset,\n  get warn () { return warn; },\n  get formatComponentName () { return formatComponentName; },\n  validateProp: validateProp\n});\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\n{\n  var allowedGlobals = makeMap(\n    'Infinity,undefined,NaN,isFinite,isNaN,' +\n    'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n    'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n    'require' // for Webpack/Browserify\n  );\n\n  var warnNonPresent = function (target, key) {\n    warn(\n      \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n      \"referenced during render. Make sure to declare reactive data \" +\n      \"properties in the data option.\",\n      target\n    );\n  };\n\n  var hasProxy =\n    typeof Proxy !== 'undefined' &&\n    Proxy.toString().match(/native code/);\n\n  if (hasProxy) {\n    var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');\n    config.keyCodes = new Proxy(config.keyCodes, {\n      set: function set (target, key, value) {\n        if (isBuiltInModifier(key)) {\n          warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n          return false\n        } else {\n          target[key] = value;\n          return true\n        }\n      }\n    });\n  }\n\n  var hasHandler = {\n    has: function has (target, key) {\n      var has = key in target;\n      var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';\n      if (!has && !isAllowed) {\n        warnNonPresent(target, key);\n      }\n      return has || !isAllowed\n    }\n  };\n\n  var getHandler = {\n    get: function get (target, key) {\n      if (typeof key === 'string' && !(key in target)) {\n        warnNonPresent(target, key);\n      }\n      return target[key]\n    }\n  };\n\n  initProxy = function initProxy (vm) {\n    if (hasProxy) {\n      // determine which proxy handler to use\n      var options = vm.$options;\n      var handlers = options.render && options.render._withStripped\n        ? getHandler\n        : hasHandler;\n      vm._renderProxy = new Proxy(vm, handlers);\n    } else {\n      vm._renderProxy = vm;\n    }\n  };\n}\n\n/*  */\n\n\nvar queue = [];\nvar has$1 = {};\nvar circular = {};\nvar waiting = false;\nvar flushing = false;\nvar index = 0;\n\n/**\n * Reset the scheduler's state.\n */\nfunction resetSchedulerState () {\n  queue.length = 0;\n  has$1 = {};\n  {\n    circular = {};\n  }\n  waiting = flushing = false;\n}\n\n/**\n * Flush both queues and run the watchers.\n */\nfunction flushSchedulerQueue () {\n  flushing = true;\n\n  // Sort queue before flush.\n  // This ensures that:\n  // 1. Components are updated from parent to child. (because parent is always\n  //    created before the child)\n  // 2. A component's user watchers are run before its render watcher (because\n  //    user watchers are created before the render watcher)\n  // 3. If a component is destroyed during a parent component's watcher run,\n  //    its watchers can be skipped.\n  queue.sort(function (a, b) { return a.id - b.id; });\n\n  // do not cache length because more watchers might be pushed\n  // as we run existing watchers\n  for (index = 0; index < queue.length; index++) {\n    var watcher = queue[index];\n    var id = watcher.id;\n    has$1[id] = null;\n    watcher.run();\n    // in dev build, check and stop circular updates.\n    if (\"development\" !== 'production' && has$1[id] != null) {\n      circular[id] = (circular[id] || 0) + 1;\n      if (circular[id] > config._maxUpdateCount) {\n        warn(\n          'You may have an infinite update loop ' + (\n            watcher.user\n              ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n              : \"in a component render function.\"\n          ),\n          watcher.vm\n        );\n        break\n      }\n    }\n  }\n\n  // devtool hook\n  /* istanbul ignore if */\n  if (devtools && config.devtools) {\n    devtools.emit('flush');\n  }\n\n  resetSchedulerState();\n}\n\n/**\n * Push a watcher into the watcher queue.\n * Jobs with duplicate IDs will be skipped unless it's\n * pushed when the queue is being flushed.\n */\nfunction queueWatcher (watcher) {\n  var id = watcher.id;\n  if (has$1[id] == null) {\n    has$1[id] = true;\n    if (!flushing) {\n      queue.push(watcher);\n    } else {\n      // if already flushing, splice the watcher based on its id\n      // if already past its id, it will be run next immediately.\n      var i = queue.length - 1;\n      while (i >= 0 && queue[i].id > watcher.id) {\n        i--;\n      }\n      queue.splice(Math.max(i, index) + 1, 0, watcher);\n    }\n    // queue the flush\n    if (!waiting) {\n      waiting = true;\n      nextTick(flushSchedulerQueue);\n    }\n  }\n}\n\n/*  */\n\nvar uid$2 = 0;\n\n/**\n * A watcher parses an expression, collects dependencies,\n * and fires callback when the expression value changes.\n * This is used for both the $watch() api and directives.\n */\nvar Watcher = function Watcher (\n  vm,\n  expOrFn,\n  cb,\n  options\n) {\n  if ( options === void 0 ) options = {};\n\n  this.vm = vm;\n  vm._watchers.push(this);\n  // options\n  this.deep = !!options.deep;\n  this.user = !!options.user;\n  this.lazy = !!options.lazy;\n  this.sync = !!options.sync;\n  this.expression = expOrFn.toString();\n  this.cb = cb;\n  this.id = ++uid$2; // uid for batching\n  this.active = true;\n  this.dirty = this.lazy; // for lazy watchers\n  this.deps = [];\n  this.newDeps = [];\n  this.depIds = new _Set();\n  this.newDepIds = new _Set();\n  // parse expression for getter\n  if (typeof expOrFn === 'function') {\n    this.getter = expOrFn;\n  } else {\n    this.getter = parsePath(expOrFn);\n    if (!this.getter) {\n      this.getter = function () {};\n      \"development\" !== 'production' && warn(\n        \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n        'Watcher only accepts simple dot-delimited paths. ' +\n        'For full control, use a function instead.',\n        vm\n      );\n    }\n  }\n  this.value = this.lazy\n    ? undefined\n    : this.get();\n};\n\n/**\n * Evaluate the getter, and re-collect dependencies.\n */\nWatcher.prototype.get = function get () {\n  pushTarget(this);\n  var value = this.getter.call(this.vm, this.vm);\n  // \"touch\" every property so they are all tracked as\n  // dependencies for deep watching\n  if (this.deep) {\n    traverse(value);\n  }\n  popTarget();\n  this.cleanupDeps();\n  return value\n};\n\n/**\n * Add a dependency to this directive.\n */\nWatcher.prototype.addDep = function addDep (dep) {\n  var id = dep.id;\n  if (!this.newDepIds.has(id)) {\n    this.newDepIds.add(id);\n    this.newDeps.push(dep);\n    if (!this.depIds.has(id)) {\n      dep.addSub(this);\n    }\n  }\n};\n\n/**\n * Clean up for dependency collection.\n */\nWatcher.prototype.cleanupDeps = function cleanupDeps () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    var dep = this$1.deps[i];\n    if (!this$1.newDepIds.has(dep.id)) {\n      dep.removeSub(this$1);\n    }\n  }\n  var tmp = this.depIds;\n  this.depIds = this.newDepIds;\n  this.newDepIds = tmp;\n  this.newDepIds.clear();\n  tmp = this.deps;\n  this.deps = this.newDeps;\n  this.newDeps = tmp;\n  this.newDeps.length = 0;\n};\n\n/**\n * Subscriber interface.\n * Will be called when a dependency changes.\n */\nWatcher.prototype.update = function update () {\n  /* istanbul ignore else */\n  if (this.lazy) {\n    this.dirty = true;\n  } else if (this.sync) {\n    this.run();\n  } else {\n    queueWatcher(this);\n  }\n};\n\n/**\n * Scheduler job interface.\n * Will be called by the scheduler.\n */\nWatcher.prototype.run = function run () {\n  if (this.active) {\n    var value = this.get();\n      if (\n        value !== this.value ||\n      // Deep watchers and watchers on Object/Arrays should fire even\n      // when the value is the same, because the value may\n      // have mutated.\n      isObject(value) ||\n      this.deep\n    ) {\n      // set new value\n      var oldValue = this.value;\n      this.value = value;\n      if (this.user) {\n        try {\n          this.cb.call(this.vm, value, oldValue);\n        } catch (e) {\n          /* istanbul ignore else */\n          if (config.errorHandler) {\n            config.errorHandler.call(null, e, this.vm);\n          } else {\n            \"development\" !== 'production' && warn(\n              (\"Error in watcher \\\"\" + (this.expression) + \"\\\"\"),\n              this.vm\n            );\n            throw e\n          }\n        }\n      } else {\n        this.cb.call(this.vm, value, oldValue);\n      }\n    }\n  }\n};\n\n/**\n * Evaluate the value of the watcher.\n * This only gets called for lazy watchers.\n */\nWatcher.prototype.evaluate = function evaluate () {\n  this.value = this.get();\n  this.dirty = false;\n};\n\n/**\n * Depend on all deps collected by this watcher.\n */\nWatcher.prototype.depend = function depend () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    this$1.deps[i].depend();\n  }\n};\n\n/**\n * Remove self from all dependencies' subscriber list.\n */\nWatcher.prototype.teardown = function teardown () {\n    var this$1 = this;\n\n  if (this.active) {\n    // remove self from vm's watcher list\n    // this is a somewhat expensive operation so we skip it\n    // if the vm is being destroyed or is performing a v-for\n    // re-render (the watcher list is then filtered by v-for).\n    if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {\n      remove$1(this.vm._watchers, this);\n    }\n    var i = this.deps.length;\n    while (i--) {\n      this$1.deps[i].removeSub(this$1);\n    }\n    this.active = false;\n  }\n};\n\n/**\n * Recursively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n */\nvar seenObjects = new _Set();\nfunction traverse (val) {\n  seenObjects.clear();\n  _traverse(val, seenObjects);\n}\n\nfunction _traverse (val, seen) {\n  var i, keys;\n  var isA = Array.isArray(val);\n  if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {\n    return\n  }\n  if (val.__ob__) {\n    var depId = val.__ob__.dep.id;\n    if (seen.has(depId)) {\n      return\n    }\n    seen.add(depId);\n  }\n  if (isA) {\n    i = val.length;\n    while (i--) { _traverse(val[i], seen); }\n  } else {\n    keys = Object.keys(val);\n    i = keys.length;\n    while (i--) { _traverse(val[keys[i]], seen); }\n  }\n}\n\n/*  */\n\nfunction initState (vm) {\n  vm._watchers = [];\n  initProps(vm);\n  initMethods(vm);\n  initData(vm);\n  initComputed(vm);\n  initWatch(vm);\n}\n\nvar isReservedProp = { key: 1, ref: 1, slot: 1 };\n\nfunction initProps (vm) {\n  var props = vm.$options.props;\n  if (props) {\n    var propsData = vm.$options.propsData || {};\n    var keys = vm.$options._propKeys = Object.keys(props);\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    observerState.shouldConvert = isRoot;\n    var loop = function ( i ) {\n      var key = keys[i];\n      /* istanbul ignore else */\n      {\n        if (isReservedProp[key]) {\n          warn(\n            (\"\\\"\" + key + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {\n          if (vm.$parent && !observerState.isSettingProps) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n    };\n\n    for (var i = 0; i < keys.length; i++) loop( i );\n    observerState.shouldConvert = true;\n  }\n}\n\nfunction initData (vm) {\n  var data = vm.$options.data;\n  data = vm._data = typeof data === 'function'\n    ? data.call(vm)\n    : data || {};\n  if (!isPlainObject(data)) {\n    data = {};\n    \"development\" !== 'production' && warn(\n      'data functions should return an object.',\n      vm\n    );\n  }\n  // proxy data on instance\n  var keys = Object.keys(data);\n  var props = vm.$options.props;\n  var i = keys.length;\n  while (i--) {\n    if (props && hasOwn(props, keys[i])) {\n      \"development\" !== 'production' && warn(\n        \"The data property \\\"\" + (keys[i]) + \"\\\" is already declared as a prop. \" +\n        \"Use prop default value instead.\",\n        vm\n      );\n    } else {\n      proxy(vm, keys[i]);\n    }\n  }\n  // observe data\n  observe(data);\n  data.__ob__ && data.__ob__.vmCount++;\n}\n\nvar computedSharedDefinition = {\n  enumerable: true,\n  configurable: true,\n  get: noop,\n  set: noop\n};\n\nfunction initComputed (vm) {\n  var computed = vm.$options.computed;\n  if (computed) {\n    for (var key in computed) {\n      var userDef = computed[key];\n      if (typeof userDef === 'function') {\n        computedSharedDefinition.get = makeComputedGetter(userDef, vm);\n        computedSharedDefinition.set = noop;\n      } else {\n        computedSharedDefinition.get = userDef.get\n          ? userDef.cache !== false\n            ? makeComputedGetter(userDef.get, vm)\n            : bind$1(userDef.get, vm)\n          : noop;\n        computedSharedDefinition.set = userDef.set\n          ? bind$1(userDef.set, vm)\n          : noop;\n      }\n      Object.defineProperty(vm, key, computedSharedDefinition);\n    }\n  }\n}\n\nfunction makeComputedGetter (getter, owner) {\n  var watcher = new Watcher(owner, getter, noop, {\n    lazy: true\n  });\n  return function computedGetter () {\n    if (watcher.dirty) {\n      watcher.evaluate();\n    }\n    if (Dep.target) {\n      watcher.depend();\n    }\n    return watcher.value\n  }\n}\n\nfunction initMethods (vm) {\n  var methods = vm.$options.methods;\n  if (methods) {\n    for (var key in methods) {\n      vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);\n      if (\"development\" !== 'production' && methods[key] == null) {\n        warn(\n          \"method \\\"\" + key + \"\\\" has an undefined value in the component definition. \" +\n          \"Did you reference the function correctly?\",\n          vm\n        );\n      }\n    }\n  }\n}\n\nfunction initWatch (vm) {\n  var watch = vm.$options.watch;\n  if (watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n}\n\nfunction createWatcher (vm, key, handler) {\n  var options;\n  if (isPlainObject(handler)) {\n    options = handler;\n    handler = handler.handler;\n  }\n  if (typeof handler === 'string') {\n    handler = vm[handler];\n  }\n  vm.$watch(key, handler, options);\n}\n\nfunction stateMixin (Vue) {\n  // flow somehow has problems with directly declared definition object\n  // when using Object.defineProperty, so we have to procedurally build up\n  // the object here.\n  var dataDef = {};\n  dataDef.get = function () {\n    return this._data\n  };\n  {\n    dataDef.set = function (newData) {\n      warn(\n        'Avoid replacing instance root $data. ' +\n        'Use nested data properties instead.',\n        this\n      );\n    };\n  }\n  Object.defineProperty(Vue.prototype, '$data', dataDef);\n\n  Vue.prototype.$set = set$1;\n  Vue.prototype.$delete = del;\n\n  Vue.prototype.$watch = function (\n    expOrFn,\n    cb,\n    options\n  ) {\n    var vm = this;\n    options = options || {};\n    options.user = true;\n    var watcher = new Watcher(vm, expOrFn, cb, options);\n    if (options.immediate) {\n      cb.call(vm, watcher.value);\n    }\n    return function unwatchFn () {\n      watcher.teardown();\n    }\n  };\n}\n\nfunction proxy (vm, key) {\n  if (!isReserved(key)) {\n    Object.defineProperty(vm, key, {\n      configurable: true,\n      enumerable: true,\n      get: function proxyGetter () {\n        return vm._data[key]\n      },\n      set: function proxySetter (val) {\n        vm._data[key] = val;\n      }\n    });\n  }\n}\n\n/*  */\n\nvar VNode = function VNode (\n  tag,\n  data,\n  children,\n  text,\n  elm,\n  ns,\n  context,\n  componentOptions\n) {\n  this.tag = tag;\n  this.data = data;\n  this.children = children;\n  this.text = text;\n  this.elm = elm;\n  this.ns = ns;\n  this.context = context;\n  this.functionalContext = undefined;\n  this.key = data && data.key;\n  this.componentOptions = componentOptions;\n  this.child = undefined;\n  this.parent = undefined;\n  this.raw = false;\n  this.isStatic = false;\n  this.isRootInsert = true;\n  this.isComment = false;\n  this.isCloned = false;\n  this.isOnce = false;\n};\n\nvar emptyVNode = function () {\n  var node = new VNode();\n  node.text = '';\n  node.isComment = true;\n  return node\n};\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n  var cloned = new VNode(\n    vnode.tag,\n    vnode.data,\n    vnode.children,\n    vnode.text,\n    vnode.elm,\n    vnode.ns,\n    vnode.context,\n    vnode.componentOptions\n  );\n  cloned.isStatic = vnode.isStatic;\n  cloned.key = vnode.key;\n  cloned.isCloned = true;\n  return cloned\n}\n\nfunction cloneVNodes (vnodes) {\n  var res = new Array(vnodes.length);\n  for (var i = 0; i < vnodes.length; i++) {\n    res[i] = cloneVNode(vnodes[i]);\n  }\n  return res\n}\n\n/*  */\n\nfunction mergeVNodeHook (def, hookKey, hook, key) {\n  key = key + hookKey;\n  var injectedHash = def.__injected || (def.__injected = {});\n  if (!injectedHash[key]) {\n    injectedHash[key] = true;\n    var oldHook = def[hookKey];\n    if (oldHook) {\n      def[hookKey] = function () {\n        oldHook.apply(this, arguments);\n        hook.apply(this, arguments);\n      };\n    } else {\n      def[hookKey] = hook;\n    }\n  }\n}\n\n/*  */\n\nfunction updateListeners (\n  on,\n  oldOn,\n  add,\n  remove$$1,\n  vm\n) {\n  var name, cur, old, fn, event, capture, once;\n  for (name in on) {\n    cur = on[name];\n    old = oldOn[name];\n    if (!cur) {\n      \"development\" !== 'production' && warn(\n        \"Invalid handler for event \\\"\" + name + \"\\\": got \" + String(cur),\n        vm\n      );\n    } else if (!old) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      if (Array.isArray(cur)) {\n        add(event, (cur.invoker = arrInvoker(cur)), once, capture);\n      } else {\n        if (!cur.invoker) {\n          fn = cur;\n          cur = on[name] = {};\n          cur.fn = fn;\n          cur.invoker = fnInvoker(cur);\n        }\n        add(event, cur.invoker, once, capture);\n      }\n    } else if (cur !== old) {\n      if (Array.isArray(old)) {\n        old.length = cur.length;\n        for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }\n        on[name] = old;\n      } else {\n        old.fn = cur;\n        on[name] = old;\n      }\n    }\n  }\n  for (name in oldOn) {\n    if (!on[name]) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      remove$$1(event, oldOn[name].invoker, capture);\n    }\n  }\n}\n\nfunction arrInvoker (arr) {\n  return function (ev) {\n    var arguments$1 = arguments;\n\n    var single = arguments.length === 1;\n    for (var i = 0; i < arr.length; i++) {\n      single ? arr[i](ev) : arr[i].apply(null, arguments$1);\n    }\n  }\n}\n\nfunction fnInvoker (o) {\n  return function (ev) {\n    var single = arguments.length === 1;\n    single ? o.fn(ev) : o.fn.apply(null, arguments);\n  }\n}\n\n/*  */\n\nfunction normalizeChildren (\n  children,\n  ns,\n  nestedIndex\n) {\n  if (isPrimitive(children)) {\n    return [createTextVNode(children)]\n  }\n  if (Array.isArray(children)) {\n    var res = [];\n    for (var i = 0, l = children.length; i < l; i++) {\n      var c = children[i];\n      var last = res[res.length - 1];\n      //  nested\n      if (Array.isArray(c)) {\n        res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + \"_\" + i)));\n      } else if (isPrimitive(c)) {\n        if (last && last.text) {\n          last.text += String(c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else if (c instanceof VNode) {\n        if (c.text && last && last.text) {\n          if (!last.isCloned) {\n            last.text += c.text;\n          }\n        } else {\n          // inherit parent namespace\n          if (ns) {\n            applyNS(c, ns);\n          }\n          // default key for nested array children (likely generated by v-for)\n          if (c.tag && c.key == null && nestedIndex != null) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n}\n\nfunction createTextVNode (val) {\n  return new VNode(undefined, undefined, undefined, String(val))\n}\n\nfunction applyNS (vnode, ns) {\n  if (vnode.tag && !vnode.ns) {\n    vnode.ns = ns;\n    if (vnode.children) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        applyNS(vnode.children[i], ns);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction getFirstComponentChild (children) {\n  return children && children.filter(function (c) { return c && c.componentOptions; })[0]\n}\n\n/*  */\n\nvar activeInstance = null;\n\nfunction initLifecycle (vm) {\n  var options = vm.$options;\n\n  // locate first non-abstract parent\n  var parent = options.parent;\n  if (parent && !options.abstract) {\n    while (parent.$options.abstract && parent.$parent) {\n      parent = parent.$parent;\n    }\n    parent.$children.push(vm);\n  }\n\n  vm.$parent = parent;\n  vm.$root = parent ? parent.$root : vm;\n\n  vm.$children = [];\n  vm.$refs = {};\n\n  vm._watcher = null;\n  vm._inactive = false;\n  vm._isMounted = false;\n  vm._isDestroyed = false;\n  vm._isBeingDestroyed = false;\n}\n\nfunction lifecycleMixin (Vue) {\n  Vue.prototype._mount = function (\n    el,\n    hydrating\n  ) {\n    var vm = this;\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = emptyVNode;\n      {\n        /* istanbul ignore if */\n        if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'option is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n    vm._watcher = new Watcher(vm, function () {\n      vm._update(vm._render(), hydrating);\n    }, noop);\n    hydrating = false;\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  };\n\n  Vue.prototype._update = function (vnode, hydrating) {\n    var vm = this;\n    if (vm._isMounted) {\n      callHook(vm, 'beforeUpdate');\n    }\n    var prevEl = vm.$el;\n    var prevVnode = vm._vnode;\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    vm._vnode = vnode;\n    // Vue.prototype.__patch__ is injected in entry points\n    // based on the rendering backend used.\n    if (!prevVnode) {\n      // initial render\n      vm.$el = vm.__patch__(\n        vm.$el, vnode, hydrating, false /* removeOnly */,\n        vm.$options._parentElm,\n        vm.$options._refElm\n      );\n    } else {\n      // updates\n      vm.$el = vm.__patch__(prevVnode, vnode);\n    }\n    activeInstance = prevActiveInstance;\n    // update __vue__ reference\n    if (prevEl) {\n      prevEl.__vue__ = null;\n    }\n    if (vm.$el) {\n      vm.$el.__vue__ = vm;\n    }\n    // if parent is an HOC, update its $el as well\n    if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n      vm.$parent.$el = vm.$el;\n    }\n    if (vm._isMounted) {\n      callHook(vm, 'updated');\n    }\n  };\n\n  Vue.prototype._updateFromParent = function (\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    var vm = this;\n    var hasChildren = !!(vm.$options._renderChildren || renderChildren);\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n    // update props\n    if (propsData && vm.$options.props) {\n      observerState.shouldConvert = false;\n      {\n        observerState.isSettingProps = true;\n      }\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        vm[key] = validateProp(key, vm.$options.props, propsData, vm);\n      }\n      observerState.shouldConvert = true;\n      {\n        observerState.isSettingProps = false;\n      }\n      vm.$options.propsData = propsData;\n    }\n    // update listeners\n    if (listeners) {\n      var oldListeners = vm.$options._parentListeners;\n      vm.$options._parentListeners = listeners;\n      vm._updateListeners(listeners, oldListeners);\n    }\n    // resolve slots + force update if has children\n    if (hasChildren) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n  };\n\n  Vue.prototype.$forceUpdate = function () {\n    var vm = this;\n    if (vm._watcher) {\n      vm._watcher.update();\n    }\n  };\n\n  Vue.prototype.$destroy = function () {\n    var vm = this;\n    if (vm._isBeingDestroyed) {\n      return\n    }\n    callHook(vm, 'beforeDestroy');\n    vm._isBeingDestroyed = true;\n    // remove self from parent\n    var parent = vm.$parent;\n    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n      remove$1(parent.$children, vm);\n    }\n    // teardown watchers\n    if (vm._watcher) {\n      vm._watcher.teardown();\n    }\n    var i = vm._watchers.length;\n    while (i--) {\n      vm._watchers[i].teardown();\n    }\n    // remove reference from data ob\n    // frozen object may not have observer.\n    if (vm._data.__ob__) {\n      vm._data.__ob__.vmCount--;\n    }\n    // call the last hook...\n    vm._isDestroyed = true;\n    callHook(vm, 'destroyed');\n    // turn off all instance listeners.\n    vm.$off();\n    // remove __vue__ reference\n    if (vm.$el) {\n      vm.$el.__vue__ = null;\n    }\n    // invoke destroy hooks on current rendered tree\n    vm.__patch__(vm._vnode, null);\n  };\n}\n\nfunction callHook (vm, hook) {\n  var handlers = vm.$options[hook];\n  if (handlers) {\n    for (var i = 0, j = handlers.length; i < j; i++) {\n      handlers[i].call(vm);\n    }\n  }\n  vm.$emit('hook:' + hook);\n}\n\n/*  */\n\nvar hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };\nvar hooksToMerge = Object.keys(hooks);\n\nfunction createComponent (\n  Ctor,\n  data,\n  context,\n  children,\n  tag\n) {\n  if (!Ctor) {\n    return\n  }\n\n  var baseCtor = context.$options._base;\n  if (isObject(Ctor)) {\n    Ctor = baseCtor.extend(Ctor);\n  }\n\n  if (typeof Ctor !== 'function') {\n    {\n      warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n    }\n    return\n  }\n\n  // async component\n  if (!Ctor.cid) {\n    if (Ctor.resolved) {\n      Ctor = Ctor.resolved;\n    } else {\n      Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {\n        // it's ok to queue this on every render because\n        // $forceUpdate is buffered by the scheduler.\n        context.$forceUpdate();\n      });\n      if (!Ctor) {\n        // return nothing if this is indeed an async component\n        // wait for the callback to trigger parent update.\n        return\n      }\n    }\n  }\n\n  // resolve constructor options in case global mixins are applied after\n  // component constructor creation\n  resolveConstructorOptions(Ctor);\n\n  data = data || {};\n\n  // extract props\n  var propsData = extractProps(data, Ctor);\n\n  // functional component\n  if (Ctor.options.functional) {\n    return createFunctionalComponent(Ctor, propsData, data, context, children)\n  }\n\n  // extract listeners, since these needs to be treated as\n  // child component listeners instead of DOM listeners\n  var listeners = data.on;\n  // replace with listeners with .native modifier\n  data.on = data.nativeOn;\n\n  if (Ctor.options.abstract) {\n    // abstract components do not keep anything\n    // other than props & listeners\n    data = {};\n  }\n\n  // merge component management hooks onto the placeholder node\n  mergeHooks(data);\n\n  // return a placeholder vnode\n  var name = Ctor.options.name || tag;\n  var vnode = new VNode(\n    (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n    data, undefined, undefined, undefined, undefined, context,\n    { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }\n  );\n  return vnode\n}\n\nfunction createFunctionalComponent (\n  Ctor,\n  propsData,\n  data,\n  context,\n  children\n) {\n  var props = {};\n  var propOptions = Ctor.options.props;\n  if (propOptions) {\n    for (var key in propOptions) {\n      props[key] = validateProp(key, propOptions, propsData);\n    }\n  }\n  var vnode = Ctor.options.render.call(\n    null,\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    bind$1(createElement, { _self: Object.create(context) }),\n    {\n      props: props,\n      data: data,\n      parent: context,\n      children: normalizeChildren(children),\n      slots: function () { return resolveSlots(children, context); }\n    }\n  );\n  if (vnode instanceof VNode) {\n    vnode.functionalContext = context;\n    if (data.slot) {\n      (vnode.data || (vnode.data = {})).slot = data.slot;\n    }\n  }\n  return vnode\n}\n\nfunction createComponentInstanceForVnode (\n  vnode, // we know it's MountedComponentVNode but flow doesn't\n  parent, // activeInstance in lifecycle state\n  parentElm,\n  refElm\n) {\n  var vnodeComponentOptions = vnode.componentOptions;\n  var options = {\n    _isComponent: true,\n    parent: parent,\n    propsData: vnodeComponentOptions.propsData,\n    _componentTag: vnodeComponentOptions.tag,\n    _parentVnode: vnode,\n    _parentListeners: vnodeComponentOptions.listeners,\n    _renderChildren: vnodeComponentOptions.children,\n    _parentElm: parentElm || null,\n    _refElm: refElm || null\n  };\n  // check inline-template render functions\n  var inlineTemplate = vnode.data.inlineTemplate;\n  if (inlineTemplate) {\n    options.render = inlineTemplate.render;\n    options.staticRenderFns = inlineTemplate.staticRenderFns;\n  }\n  return new vnodeComponentOptions.Ctor(options)\n}\n\nfunction init (\n  vnode,\n  hydrating,\n  parentElm,\n  refElm\n) {\n  if (!vnode.child || vnode.child._isDestroyed) {\n    var child = vnode.child = createComponentInstanceForVnode(\n      vnode,\n      activeInstance,\n      parentElm,\n      refElm\n    );\n    child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n  } else if (vnode.data.keepAlive) {\n    // kept-alive components, treat as a patch\n    var mountedNode = vnode; // work around flow\n    prepatch(mountedNode, mountedNode);\n  }\n}\n\nfunction prepatch (\n  oldVnode,\n  vnode\n) {\n  var options = vnode.componentOptions;\n  var child = vnode.child = oldVnode.child;\n  child._updateFromParent(\n    options.propsData, // updated props\n    options.listeners, // updated listeners\n    vnode, // new parent vnode\n    options.children // new children\n  );\n}\n\nfunction insert (vnode) {\n  if (!vnode.child._isMounted) {\n    vnode.child._isMounted = true;\n    callHook(vnode.child, 'mounted');\n  }\n  if (vnode.data.keepAlive) {\n    vnode.child._inactive = false;\n    callHook(vnode.child, 'activated');\n  }\n}\n\nfunction destroy$1 (vnode) {\n  if (!vnode.child._isDestroyed) {\n    if (!vnode.data.keepAlive) {\n      vnode.child.$destroy();\n    } else {\n      vnode.child._inactive = true;\n      callHook(vnode.child, 'deactivated');\n    }\n  }\n}\n\nfunction resolveAsyncComponent (\n  factory,\n  baseCtor,\n  cb\n) {\n  if (factory.requested) {\n    // pool callbacks\n    factory.pendingCallbacks.push(cb);\n  } else {\n    factory.requested = true;\n    var cbs = factory.pendingCallbacks = [cb];\n    var sync = true;\n\n    var resolve = function (res) {\n      if (isObject(res)) {\n        res = baseCtor.extend(res);\n      }\n      // cache resolved\n      factory.resolved = res;\n      // invoke callbacks only if this is not a synchronous resolve\n      // (async resolves are shimmed as synchronous during SSR)\n      if (!sync) {\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          cbs[i](res);\n        }\n      }\n    };\n\n    var reject = function (reason) {\n      \"development\" !== 'production' && warn(\n        \"Failed to resolve async component: \" + (String(factory)) +\n        (reason ? (\"\\nReason: \" + reason) : '')\n      );\n    };\n\n    var res = factory(resolve, reject);\n\n    // handle promise\n    if (res && typeof res.then === 'function' && !factory.resolved) {\n      res.then(resolve, reject);\n    }\n\n    sync = false;\n    // return in case resolved synchronously\n    return factory.resolved\n  }\n}\n\nfunction extractProps (data, Ctor) {\n  // we are only extracting raw values here.\n  // validation and default values are handled in the child\n  // component itself.\n  var propOptions = Ctor.options.props;\n  if (!propOptions) {\n    return\n  }\n  var res = {};\n  var attrs = data.attrs;\n  var props = data.props;\n  var domProps = data.domProps;\n  if (attrs || props || domProps) {\n    for (var key in propOptions) {\n      var altKey = hyphenate(key);\n      checkProp(res, props, key, altKey, true) ||\n      checkProp(res, attrs, key, altKey) ||\n      checkProp(res, domProps, key, altKey);\n    }\n  }\n  return res\n}\n\nfunction checkProp (\n  res,\n  hash,\n  key,\n  altKey,\n  preserve\n) {\n  if (hash) {\n    if (hasOwn(hash, key)) {\n      res[key] = hash[key];\n      if (!preserve) {\n        delete hash[key];\n      }\n      return true\n    } else if (hasOwn(hash, altKey)) {\n      res[key] = hash[altKey];\n      if (!preserve) {\n        delete hash[altKey];\n      }\n      return true\n    }\n  }\n  return false\n}\n\nfunction mergeHooks (data) {\n  if (!data.hook) {\n    data.hook = {};\n  }\n  for (var i = 0; i < hooksToMerge.length; i++) {\n    var key = hooksToMerge[i];\n    var fromParent = data.hook[key];\n    var ours = hooks[key];\n    data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;\n  }\n}\n\nfunction mergeHook$1 (one, two) {\n  return function (a, b, c, d) {\n    one(a, b, c, d);\n    two(a, b, c, d);\n  }\n}\n\n/*  */\n\n// wrapper function for providing a more flexible interface\n// without getting yelled at by flow\nfunction createElement (\n  tag,\n  data,\n  children\n) {\n  if (data && (Array.isArray(data) || typeof data !== 'object')) {\n    children = data;\n    data = undefined;\n  }\n  // make sure to use real instance instead of proxy as context\n  return _createElement(this._self, tag, data, children)\n}\n\nfunction _createElement (\n  context,\n  tag,\n  data,\n  children\n) {\n  if (data && data.__ob__) {\n    \"development\" !== 'production' && warn(\n      \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n      'Always create fresh vnode data objects in each render!',\n      context\n    );\n    return\n  }\n  if (!tag) {\n    // in case of component :is set to falsy value\n    return emptyVNode()\n  }\n  // support single function children as default scoped slot\n  if (Array.isArray(children) &&\n      typeof children[0] === 'function') {\n    data = data || {};\n    data.scopedSlots = { default: children[0] };\n    children.length = 0;\n  }\n  if (typeof tag === 'string') {\n    var Ctor;\n    var ns = config.getTagNamespace(tag);\n    if (config.isReservedTag(tag)) {\n      // platform built-in elements\n      return new VNode(\n        tag, data, normalizeChildren(children, ns),\n        undefined, undefined, ns, context\n      )\n    } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {\n      // component\n      return createComponent(Ctor, data, context, children, tag)\n    } else {\n      // unknown or unlisted namespaced elements\n      // check at runtime because it may get assigned a namespace when its\n      // parent normalizes children\n      var childNs = tag === 'foreignObject' ? 'xhtml' : ns;\n      return new VNode(\n        tag, data, normalizeChildren(children, childNs),\n        undefined, undefined, ns, context\n      )\n    }\n  } else {\n    // direct component options / constructor\n    return createComponent(tag, data, context, children)\n  }\n}\n\n/*  */\n\nfunction initRender (vm) {\n  vm.$vnode = null; // the placeholder node in parent tree\n  vm._vnode = null; // the root of the child tree\n  vm._staticTrees = null;\n  var parentVnode = vm.$options._parentVnode;\n  var renderContext = parentVnode && parentVnode.context;\n  vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);\n  vm.$scopedSlots = {};\n  // bind the public createElement fn to this instance\n  // so that we get proper render context inside it.\n  vm.$createElement = bind$1(createElement, vm);\n  if (vm.$options.el) {\n    vm.$mount(vm.$options.el);\n  }\n}\n\nfunction renderMixin (Vue) {\n  Vue.prototype.$nextTick = function (fn) {\n    return nextTick(fn, this)\n  };\n\n  Vue.prototype._render = function () {\n    var vm = this;\n    var ref = vm.$options;\n    var render = ref.render;\n    var staticRenderFns = ref.staticRenderFns;\n    var _parentVnode = ref._parentVnode;\n\n    if (vm._isMounted) {\n      // clone slot nodes on re-renders\n      for (var key in vm.$slots) {\n        vm.$slots[key] = cloneVNodes(vm.$slots[key]);\n      }\n    }\n\n    if (_parentVnode && _parentVnode.data.scopedSlots) {\n      vm.$scopedSlots = _parentVnode.data.scopedSlots;\n    }\n\n    if (staticRenderFns && !vm._staticTrees) {\n      vm._staticTrees = [];\n    }\n    // set parent vnode. this allows render functions to have access\n    // to the data on the placeholder node.\n    vm.$vnode = _parentVnode;\n    // render self\n    var vnode;\n    try {\n      vnode = render.call(vm._renderProxy, vm.$createElement);\n    } catch (e) {\n      /* istanbul ignore else */\n      if (config.errorHandler) {\n        config.errorHandler.call(null, e, vm);\n      } else {\n        {\n          warn((\"Error when rendering \" + (formatComponentName(vm)) + \":\"));\n        }\n        throw e\n      }\n      // return previous vnode to prevent render error causing blank component\n      vnode = vm._vnode;\n    }\n    // return empty vnode in case the render function errored out\n    if (!(vnode instanceof VNode)) {\n      if (\"development\" !== 'production' && Array.isArray(vnode)) {\n        warn(\n          'Multiple root nodes returned from render function. Render function ' +\n          'should return a single root node.',\n          vm\n        );\n      }\n      vnode = emptyVNode();\n    }\n    // set parent\n    vnode.parent = _parentVnode;\n    return vnode\n  };\n\n  // shorthands used in render functions\n  Vue.prototype._h = createElement;\n  // toString for mustaches\n  Vue.prototype._s = _toString;\n  // number conversion\n  Vue.prototype._n = toNumber;\n  // empty vnode\n  Vue.prototype._e = emptyVNode;\n  // loose equal\n  Vue.prototype._q = looseEqual;\n  // loose indexOf\n  Vue.prototype._i = looseIndexOf;\n\n  // render static tree by index\n  Vue.prototype._m = function renderStatic (\n    index,\n    isInFor\n  ) {\n    var tree = this._staticTrees[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree by doing a shallow clone.\n    if (tree && !isInFor) {\n      return Array.isArray(tree)\n        ? cloneVNodes(tree)\n        : cloneVNode(tree)\n    }\n    // otherwise, render a fresh tree.\n    tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  };\n\n  // mark node as static (v-once)\n  Vue.prototype._o = function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  };\n\n  function markStatic (tree, key, isOnce) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  // filter resolution helper\n  var identity = function (_) { return _; };\n  Vue.prototype._f = function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  };\n\n  // render v-for\n  Vue.prototype._l = function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val)) {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      keys = Object.keys(val);\n      ret = new Array(keys.length);\n      for (i = 0, l = keys.length; i < l; i++) {\n        key = keys[i];\n        ret[i] = render(val[key], key, i);\n      }\n    }\n    return ret\n  };\n\n  // renderSlot\n  Vue.prototype._t = function (\n    name,\n    fallback,\n    props\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    if (scopedSlotFn) { // scoped slot\n      return scopedSlotFn(props || {}) || fallback\n    } else {\n      var slotNodes = this.$slots[name];\n      // warn duplicate slot usage\n      if (slotNodes && \"development\" !== 'production') {\n        slotNodes._rendered && warn(\n          \"Duplicate presence of slot \\\"\" + name + \"\\\" found in the same render tree \" +\n          \"- this will likely cause render errors.\",\n          this\n        );\n        slotNodes._rendered = true;\n      }\n      return slotNodes || fallback\n    }\n  };\n\n  // apply v-bind object\n  Vue.prototype._b = function bindProps (\n    data,\n    tag,\n    value,\n    asProp\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        \"development\" !== 'production' && warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        for (var key in value) {\n          if (key === 'class' || key === 'style') {\n            data[key] = value[key];\n          } else {\n            var hash = asProp || config.mustUseProp(tag, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n            hash[key] = value[key];\n          }\n        }\n      }\n    }\n    return data\n  };\n\n  // check v-on keyCodes\n  Vue.prototype._k = function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInAlias\n  ) {\n    var keyCodes = config.keyCodes[key] || builtInAlias;\n    if (Array.isArray(keyCodes)) {\n      return keyCodes.indexOf(eventKeyCode) === -1\n    } else {\n      return keyCodes !== eventKeyCode\n    }\n  };\n}\n\nfunction resolveSlots (\n  renderChildren,\n  context\n) {\n  var slots = {};\n  if (!renderChildren) {\n    return slots\n  }\n  var children = normalizeChildren(renderChildren) || [];\n  var defaultSlot = [];\n  var name, child;\n  for (var i = 0, l = children.length; i < l; i++) {\n    child = children[i];\n    // named slots should only be respected if the vnode was rendered in the\n    // same context.\n    if ((child.context === context || child.functionalContext === context) &&\n        child.data && (name = child.data.slot)) {\n      var slot = (slots[name] || (slots[name] = []));\n      if (child.tag === 'template') {\n        slot.push.apply(slot, child.children);\n      } else {\n        slot.push(child);\n      }\n    } else {\n      defaultSlot.push(child);\n    }\n  }\n  // ignore single whitespace\n  if (defaultSlot.length && !(\n    defaultSlot.length === 1 &&\n    (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)\n  )) {\n    slots.default = defaultSlot;\n  }\n  return slots\n}\n\n/*  */\n\nfunction initEvents (vm) {\n  vm._events = Object.create(null);\n  // init parent attached events\n  var listeners = vm.$options._parentListeners;\n  var add = function (event, fn, once) {\n    once ? vm.$once(event, fn) : vm.$on(event, fn);\n  };\n  var remove$$1 = bind$1(vm.$off, vm);\n  vm._updateListeners = function (listeners, oldListeners) {\n    updateListeners(listeners, oldListeners || {}, add, remove$$1, vm);\n  };\n  if (listeners) {\n    vm._updateListeners(listeners);\n  }\n}\n\nfunction eventsMixin (Vue) {\n  Vue.prototype.$on = function (event, fn) {\n    var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);\n    return vm\n  };\n\n  Vue.prototype.$once = function (event, fn) {\n    var vm = this;\n    function on () {\n      vm.$off(event, on);\n      fn.apply(vm, arguments);\n    }\n    on.fn = fn;\n    vm.$on(event, on);\n    return vm\n  };\n\n  Vue.prototype.$off = function (event, fn) {\n    var vm = this;\n    // all\n    if (!arguments.length) {\n      vm._events = Object.create(null);\n      return vm\n    }\n    // specific event\n    var cbs = vm._events[event];\n    if (!cbs) {\n      return vm\n    }\n    if (arguments.length === 1) {\n      vm._events[event] = null;\n      return vm\n    }\n    // specific handler\n    var cb;\n    var i = cbs.length;\n    while (i--) {\n      cb = cbs[i];\n      if (cb === fn || cb.fn === fn) {\n        cbs.splice(i, 1);\n        break\n      }\n    }\n    return vm\n  };\n\n  Vue.prototype.$emit = function (event) {\n    var vm = this;\n    var cbs = vm._events[event];\n    if (cbs) {\n      cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n      var args = toArray(arguments, 1);\n      for (var i = 0, l = cbs.length; i < l; i++) {\n        cbs[i].apply(vm, args);\n      }\n    }\n    return vm\n  };\n}\n\n/*  */\n\nvar uid = 0;\n\nfunction initMixin (Vue) {\n  Vue.prototype._init = function (options) {\n    var vm = this;\n    // a uid\n    vm._uid = uid++;\n    // a flag to avoid this being observed\n    vm._isVue = true;\n    // merge options\n    if (options && options._isComponent) {\n      // optimize internal component instantiation\n      // since dynamic options merging is pretty slow, and none of the\n      // internal component options needs special treatment.\n      initInternalComponent(vm, options);\n    } else {\n      vm.$options = mergeOptions(\n        resolveConstructorOptions(vm.constructor),\n        options || {},\n        vm\n      );\n    }\n    /* istanbul ignore else */\n    {\n      initProxy(vm);\n    }\n    // expose real self\n    vm._self = vm;\n    initLifecycle(vm);\n    initEvents(vm);\n    callHook(vm, 'beforeCreate');\n    initState(vm);\n    callHook(vm, 'created');\n    initRender(vm);\n  };\n}\n\nfunction initInternalComponent (vm, options) {\n  var opts = vm.$options = Object.create(vm.constructor.options);\n  // doing this because it's faster than dynamic enumeration.\n  opts.parent = options.parent;\n  opts.propsData = options.propsData;\n  opts._parentVnode = options._parentVnode;\n  opts._parentListeners = options._parentListeners;\n  opts._renderChildren = options._renderChildren;\n  opts._componentTag = options._componentTag;\n  opts._parentElm = options._parentElm;\n  opts._refElm = options._refElm;\n  if (options.render) {\n    opts.render = options.render;\n    opts.staticRenderFns = options.staticRenderFns;\n  }\n}\n\nfunction resolveConstructorOptions (Ctor) {\n  var options = Ctor.options;\n  if (Ctor.super) {\n    var superOptions = Ctor.super.options;\n    var cachedSuperOptions = Ctor.superOptions;\n    var extendOptions = Ctor.extendOptions;\n    if (superOptions !== cachedSuperOptions) {\n      // super option changed\n      Ctor.superOptions = superOptions;\n      extendOptions.render = options.render;\n      extendOptions.staticRenderFns = options.staticRenderFns;\n      extendOptions._scopeId = options._scopeId;\n      options = Ctor.options = mergeOptions(superOptions, extendOptions);\n      if (options.name) {\n        options.components[options.name] = Ctor;\n      }\n    }\n  }\n  return options\n}\n\nfunction Vue$3 (options) {\n  if (\"development\" !== 'production' &&\n    !(this instanceof Vue$3)) {\n    warn('Vue is a constructor and should be called with the `new` keyword');\n  }\n  this._init(options);\n}\n\ninitMixin(Vue$3);\nstateMixin(Vue$3);\neventsMixin(Vue$3);\nlifecycleMixin(Vue$3);\nrenderMixin(Vue$3);\n\n/*  */\n\nfunction initUse (Vue) {\n  Vue.use = function (plugin) {\n    /* istanbul ignore if */\n    if (plugin.installed) {\n      return\n    }\n    // additional parameters\n    var args = toArray(arguments, 1);\n    args.unshift(this);\n    if (typeof plugin.install === 'function') {\n      plugin.install.apply(plugin, args);\n    } else {\n      plugin.apply(null, args);\n    }\n    plugin.installed = true;\n    return this\n  };\n}\n\n/*  */\n\nfunction initMixin$1 (Vue) {\n  Vue.mixin = function (mixin) {\n    this.options = mergeOptions(this.options, mixin);\n  };\n}\n\n/*  */\n\nfunction initExtend (Vue) {\n  /**\n   * Each instance constructor, including Vue, has a unique\n   * cid. This enables us to create wrapped \"child\n   * constructors\" for prototypal inheritance and cache them.\n   */\n  Vue.cid = 0;\n  var cid = 1;\n\n  /**\n   * Class inheritance\n   */\n  Vue.extend = function (extendOptions) {\n    extendOptions = extendOptions || {};\n    var Super = this;\n    var SuperId = Super.cid;\n    var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n    if (cachedCtors[SuperId]) {\n      return cachedCtors[SuperId]\n    }\n    var name = extendOptions.name || Super.options.name;\n    {\n      if (!/^[a-zA-Z][\\w-]*$/.test(name)) {\n        warn(\n          'Invalid component name: \"' + name + '\". Component names ' +\n          'can only contain alphanumeric characaters and the hyphen.'\n        );\n      }\n    }\n    var Sub = function VueComponent (options) {\n      this._init(options);\n    };\n    Sub.prototype = Object.create(Super.prototype);\n    Sub.prototype.constructor = Sub;\n    Sub.cid = cid++;\n    Sub.options = mergeOptions(\n      Super.options,\n      extendOptions\n    );\n    Sub['super'] = Super;\n    // allow further extension/mixin/plugin usage\n    Sub.extend = Super.extend;\n    Sub.mixin = Super.mixin;\n    Sub.use = Super.use;\n    // create asset registers, so extended classes\n    // can have their private assets too.\n    config._assetTypes.forEach(function (type) {\n      Sub[type] = Super[type];\n    });\n    // enable recursive self-lookup\n    if (name) {\n      Sub.options.components[name] = Sub;\n    }\n    // keep a reference to the super options at extension time.\n    // later at instantiation we can check if Super's options have\n    // been updated.\n    Sub.superOptions = Super.options;\n    Sub.extendOptions = extendOptions;\n    // cache constructor\n    cachedCtors[SuperId] = Sub;\n    return Sub\n  };\n}\n\n/*  */\n\nfunction initAssetRegisters (Vue) {\n  /**\n   * Create asset registration methods.\n   */\n  config._assetTypes.forEach(function (type) {\n    Vue[type] = function (\n      id,\n      definition\n    ) {\n      if (!definition) {\n        return this.options[type + 's'][id]\n      } else {\n        /* istanbul ignore if */\n        {\n          if (type === 'component' && config.isReservedTag(id)) {\n            warn(\n              'Do not use built-in or reserved HTML elements as component ' +\n              'id: ' + id\n            );\n          }\n        }\n        if (type === 'component' && isPlainObject(definition)) {\n          definition.name = definition.name || id;\n          definition = this.options._base.extend(definition);\n        }\n        if (type === 'directive' && typeof definition === 'function') {\n          definition = { bind: definition, update: definition };\n        }\n        this.options[type + 's'][id] = definition;\n        return definition\n      }\n    };\n  });\n}\n\n/*  */\n\nvar patternTypes = [String, RegExp];\n\nfunction matches (pattern, name) {\n  if (typeof pattern === 'string') {\n    return pattern.split(',').indexOf(name) > -1\n  } else {\n    return pattern.test(name)\n  }\n}\n\nvar KeepAlive = {\n  name: 'keep-alive',\n  abstract: true,\n  props: {\n    include: patternTypes,\n    exclude: patternTypes\n  },\n  created: function created () {\n    this.cache = Object.create(null);\n  },\n  render: function render () {\n    var vnode = getFirstComponentChild(this.$slots.default);\n    if (vnode && vnode.componentOptions) {\n      var opts = vnode.componentOptions;\n      // check pattern\n      var name = opts.Ctor.options.name || opts.tag;\n      if (name && (\n        (this.include && !matches(this.include, name)) ||\n        (this.exclude && matches(this.exclude, name))\n      )) {\n        return vnode\n      }\n      var key = vnode.key == null\n        // same constructor may get registered as different local components\n        // so cid alone is not enough (#3269)\n        ? opts.Ctor.cid + (opts.tag ? (\"::\" + (opts.tag)) : '')\n        : vnode.key;\n      if (this.cache[key]) {\n        vnode.child = this.cache[key].child;\n      } else {\n        this.cache[key] = vnode;\n      }\n      vnode.data.keepAlive = true;\n    }\n    return vnode\n  },\n  destroyed: function destroyed () {\n    var this$1 = this;\n\n    for (var key in this.cache) {\n      var vnode = this$1.cache[key];\n      callHook(vnode.child, 'deactivated');\n      vnode.child.$destroy();\n    }\n  }\n};\n\nvar builtInComponents = {\n  KeepAlive: KeepAlive\n};\n\n/*  */\n\nfunction initGlobalAPI (Vue) {\n  // config\n  var configDef = {};\n  configDef.get = function () { return config; };\n  {\n    configDef.set = function () {\n      warn(\n        'Do not replace the Vue.config object, set individual fields instead.'\n      );\n    };\n  }\n  Object.defineProperty(Vue, 'config', configDef);\n  Vue.util = util;\n  Vue.set = set$1;\n  Vue.delete = del;\n  Vue.nextTick = nextTick;\n\n  Vue.options = Object.create(null);\n  config._assetTypes.forEach(function (type) {\n    Vue.options[type + 's'] = Object.create(null);\n  });\n\n  // this is used to identify the \"base\" constructor to extend all plain-object\n  // components with in Weex's multi-instance scenarios.\n  Vue.options._base = Vue;\n\n  extend(Vue.options.components, builtInComponents);\n\n  initUse(Vue);\n  initMixin$1(Vue);\n  initExtend(Vue);\n  initAssetRegisters(Vue);\n}\n\ninitGlobalAPI(Vue$3);\n\nObject.defineProperty(Vue$3.prototype, '$isServer', {\n  get: isServerRendering\n});\n\nVue$3.version = '2.1.4';\n\n/*  */\n\n// attributes that should be using props for binding\nvar mustUseProp = function (tag, attr) {\n  return (\n    (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||\n    (attr === 'selected' && tag === 'option') ||\n    (attr === 'checked' && tag === 'input') ||\n    (attr === 'muted' && tag === 'video')\n  )\n};\n\nvar isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\nvar isBooleanAttr = makeMap(\n  'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n  'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n  'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n  'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n  'required,reversed,scoped,seamless,selected,sortable,translate,' +\n  'truespeed,typemustmatch,visible'\n);\n\nvar xlinkNS = 'http://www.w3.org/1999/xlink';\n\nvar isXlink = function (name) {\n  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n};\n\nvar getXlinkProp = function (name) {\n  return isXlink(name) ? name.slice(6, name.length) : ''\n};\n\nvar isFalsyAttrValue = function (val) {\n  return val == null || val === false\n};\n\n/*  */\n\nfunction genClassForVnode (vnode) {\n  var data = vnode.data;\n  var parentNode = vnode;\n  var childNode = vnode;\n  while (childNode.child) {\n    childNode = childNode.child._vnode;\n    if (childNode.data) {\n      data = mergeClassData(childNode.data, data);\n    }\n  }\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data) {\n      data = mergeClassData(data, parentNode.data);\n    }\n  }\n  return genClassFromData(data)\n}\n\nfunction mergeClassData (child, parent) {\n  return {\n    staticClass: concat(child.staticClass, parent.staticClass),\n    class: child.class\n      ? [child.class, parent.class]\n      : parent.class\n  }\n}\n\nfunction genClassFromData (data) {\n  var dynamicClass = data.class;\n  var staticClass = data.staticClass;\n  if (staticClass || dynamicClass) {\n    return concat(staticClass, stringifyClass(dynamicClass))\n  }\n  /* istanbul ignore next */\n  return ''\n}\n\nfunction concat (a, b) {\n  return a ? b ? (a + ' ' + b) : a : (b || '')\n}\n\nfunction stringifyClass (value) {\n  var res = '';\n  if (!value) {\n    return res\n  }\n  if (typeof value === 'string') {\n    return value\n  }\n  if (Array.isArray(value)) {\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (value[i]) {\n        if ((stringified = stringifyClass(value[i]))) {\n          res += stringified + ' ';\n        }\n      }\n    }\n    return res.slice(0, -1)\n  }\n  if (isObject(value)) {\n    for (var key in value) {\n      if (value[key]) { res += key + ' '; }\n    }\n    return res.slice(0, -1)\n  }\n  /* istanbul ignore next */\n  return res\n}\n\n/*  */\n\nvar namespaceMap = {\n  svg: 'http://www.w3.org/2000/svg',\n  math: 'http://www.w3.org/1998/Math/MathML',\n  xhtml: 'http://www.w3.org/1999/xhtml'\n};\n\nvar isHTMLTag = makeMap(\n  'html,body,base,head,link,meta,style,title,' +\n  'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n  'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +\n  'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n  's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n  'embed,object,param,source,canvas,script,noscript,del,ins,' +\n  'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n  'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n  'output,progress,select,textarea,' +\n  'details,dialog,menu,menuitem,summary,' +\n  'content,element,shadow,template'\n);\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nvar isSVG = makeMap(\n  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +\n  'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n  'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n  true\n);\n\nvar isPreTag = function (tag) { return tag === 'pre'; };\n\nvar isReservedTag = function (tag) {\n  return isHTMLTag(tag) || isSVG(tag)\n};\n\nfunction getTagNamespace (tag) {\n  if (isSVG(tag)) {\n    return 'svg'\n  }\n  // basic support for MathML\n  // note it doesn't support other MathML elements being component roots\n  if (tag === 'math') {\n    return 'math'\n  }\n}\n\nvar unknownElementCache = Object.create(null);\nfunction isUnknownElement (tag) {\n  /* istanbul ignore if */\n  if (!inBrowser) {\n    return true\n  }\n  if (isReservedTag(tag)) {\n    return false\n  }\n  tag = tag.toLowerCase();\n  /* istanbul ignore if */\n  if (unknownElementCache[tag] != null) {\n    return unknownElementCache[tag]\n  }\n  var el = document.createElement(tag);\n  if (tag.indexOf('-') > -1) {\n    // http://stackoverflow.com/a/28210364/1070244\n    return (unknownElementCache[tag] = (\n      el.constructor === window.HTMLUnknownElement ||\n      el.constructor === window.HTMLElement\n    ))\n  } else {\n    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n  }\n}\n\n/*  */\n\n/**\n * Query an element selector if it's not an element already.\n */\nfunction query (el) {\n  if (typeof el === 'string') {\n    var selector = el;\n    el = document.querySelector(el);\n    if (!el) {\n      \"development\" !== 'production' && warn(\n        'Cannot find element: ' + selector\n      );\n      return document.createElement('div')\n    }\n  }\n  return el\n}\n\n/*  */\n\nfunction createElement$1 (tagName, vnode) {\n  var elm = document.createElement(tagName);\n  if (tagName !== 'select') {\n    return elm\n  }\n  if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {\n    elm.setAttribute('multiple', 'multiple');\n  }\n  return elm\n}\n\nfunction createElementNS (namespace, tagName) {\n  return document.createElementNS(namespaceMap[namespace], tagName)\n}\n\nfunction createTextNode (text) {\n  return document.createTextNode(text)\n}\n\nfunction createComment (text) {\n  return document.createComment(text)\n}\n\nfunction insertBefore (parentNode, newNode, referenceNode) {\n  parentNode.insertBefore(newNode, referenceNode);\n}\n\nfunction removeChild (node, child) {\n  node.removeChild(child);\n}\n\nfunction appendChild (node, child) {\n  node.appendChild(child);\n}\n\nfunction parentNode (node) {\n  return node.parentNode\n}\n\nfunction nextSibling (node) {\n  return node.nextSibling\n}\n\nfunction tagName (node) {\n  return node.tagName\n}\n\nfunction setTextContent (node, text) {\n  node.textContent = text;\n}\n\nfunction childNodes (node) {\n  return node.childNodes\n}\n\nfunction setAttribute (node, key, val) {\n  node.setAttribute(key, val);\n}\n\n\nvar nodeOps = Object.freeze({\n  createElement: createElement$1,\n  createElementNS: createElementNS,\n  createTextNode: createTextNode,\n  createComment: createComment,\n  insertBefore: insertBefore,\n  removeChild: removeChild,\n  appendChild: appendChild,\n  parentNode: parentNode,\n  nextSibling: nextSibling,\n  tagName: tagName,\n  setTextContent: setTextContent,\n  childNodes: childNodes,\n  setAttribute: setAttribute\n});\n\n/*  */\n\nvar ref = {\n  create: function create (_, vnode) {\n    registerRef(vnode);\n  },\n  update: function update (oldVnode, vnode) {\n    if (oldVnode.data.ref !== vnode.data.ref) {\n      registerRef(oldVnode, true);\n      registerRef(vnode);\n    }\n  },\n  destroy: function destroy (vnode) {\n    registerRef(vnode, true);\n  }\n};\n\nfunction registerRef (vnode, isRemoval) {\n  var key = vnode.data.ref;\n  if (!key) { return }\n\n  var vm = vnode.context;\n  var ref = vnode.child || vnode.elm;\n  var refs = vm.$refs;\n  if (isRemoval) {\n    if (Array.isArray(refs[key])) {\n      remove$1(refs[key], ref);\n    } else if (refs[key] === ref) {\n      refs[key] = undefined;\n    }\n  } else {\n    if (vnode.data.refInFor) {\n      if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {\n        refs[key].push(ref);\n      } else {\n        refs[key] = [ref];\n      }\n    } else {\n      refs[key] = ref;\n    }\n  }\n}\n\n/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n *\n * modified by Evan You (@yyx990803)\n *\n\n/*\n * Not type-checking this because this file is perf-critical and the cost\n * of making flow understand it is not worth it.\n */\n\nvar emptyNode = new VNode('', {}, []);\n\nvar hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];\n\nfunction isUndef (s) {\n  return s == null\n}\n\nfunction isDef (s) {\n  return s != null\n}\n\nfunction sameVnode (vnode1, vnode2) {\n  return (\n    vnode1.key === vnode2.key &&\n    vnode1.tag === vnode2.tag &&\n    vnode1.isComment === vnode2.isComment &&\n    !vnode1.data === !vnode2.data\n  )\n}\n\nfunction createKeyToOldIdx (children, beginIdx, endIdx) {\n  var i, key;\n  var map = {};\n  for (i = beginIdx; i <= endIdx; ++i) {\n    key = children[i].key;\n    if (isDef(key)) { map[key] = i; }\n  }\n  return map\n}\n\nfunction createPatchFunction (backend) {\n  var i, j;\n  var cbs = {};\n\n  var modules = backend.modules;\n  var nodeOps = backend.nodeOps;\n\n  for (i = 0; i < hooks$1.length; ++i) {\n    cbs[hooks$1[i]] = [];\n    for (j = 0; j < modules.length; ++j) {\n      if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }\n    }\n  }\n\n  function emptyNodeAt (elm) {\n    return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n  }\n\n  function createRmCb (childElm, listeners) {\n    function remove$$1 () {\n      if (--remove$$1.listeners === 0) {\n        removeElement(childElm);\n      }\n    }\n    remove$$1.listeners = listeners;\n    return remove$$1\n  }\n\n  function removeElement (el) {\n    var parent = nodeOps.parentNode(el);\n    // element may have already been removed due to v-html\n    if (parent) {\n      nodeOps.removeChild(parent, el);\n    }\n  }\n\n  var inPre = 0;\n  function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {\n    vnode.isRootInsert = !nested; // for transition enter check\n    if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n      return\n    }\n\n    var data = vnode.data;\n    var children = vnode.children;\n    var tag = vnode.tag;\n    if (isDef(tag)) {\n      {\n        if (data && data.pre) {\n          inPre++;\n        }\n        if (\n          !inPre &&\n          !vnode.ns &&\n          !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&\n          config.isUnknownElement(tag)\n        ) {\n          warn(\n            'Unknown custom element: <' + tag + '> - did you ' +\n            'register the component correctly? For recursive components, ' +\n            'make sure to provide the \"name\" option.',\n            vnode.context\n          );\n        }\n      }\n      vnode.elm = vnode.ns\n        ? nodeOps.createElementNS(vnode.ns, tag)\n        : nodeOps.createElement(tag, vnode);\n      setScope(vnode);\n\n      /* istanbul ignore if */\n      {\n        createChildren(vnode, children, insertedVnodeQueue);\n        if (isDef(data)) {\n          invokeCreateHooks(vnode, insertedVnodeQueue);\n        }\n        insert(parentElm, vnode.elm, refElm);\n      }\n\n      if (\"development\" !== 'production' && data && data.pre) {\n        inPre--;\n      }\n    } else if (vnode.isComment) {\n      vnode.elm = nodeOps.createComment(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    } else {\n      vnode.elm = nodeOps.createTextNode(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    }\n  }\n\n  function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i = vnode.data;\n    if (isDef(i)) {\n      var isReactivated = isDef(vnode.child) && i.keepAlive;\n      if (isDef(i = i.hook) && isDef(i = i.init)) {\n        i(vnode, false /* hydrating */, parentElm, refElm);\n      }\n      // after calling the init hook, if the vnode is a child component\n      // it should've created a child instance and mounted it. the child\n      // component also has set the placeholder vnode's elm.\n      // in that case we can just return the element and be done.\n      if (isDef(vnode.child)) {\n        initComponent(vnode, insertedVnodeQueue);\n        if (isReactivated) {\n          reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n        }\n        return true\n      }\n    }\n  }\n\n  function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i;\n    // hack for #4339: a reactivated component with inner transition\n    // does not trigger because the inner node's created hooks are not called\n    // again. It's not ideal to involve module-specific logic in here but\n    // there doesn't seem to be a better way to do it.\n    var innerNode = vnode;\n    while (innerNode.child) {\n      innerNode = innerNode.child._vnode;\n      if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n        for (i = 0; i < cbs.activate.length; ++i) {\n          cbs.activate[i](emptyNode, innerNode);\n        }\n        insertedVnodeQueue.push(innerNode);\n        break\n      }\n    }\n    // unlike a newly created component,\n    // a reactivated keep-alive component doesn't insert itself\n    insert(parentElm, vnode.elm, refElm);\n  }\n\n  function insert (parent, elm, ref) {\n    if (parent) {\n      nodeOps.insertBefore(parent, elm, ref);\n    }\n  }\n\n  function createChildren (vnode, children, insertedVnodeQueue) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; ++i) {\n        createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);\n      }\n    } else if (isPrimitive(vnode.text)) {\n      nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));\n    }\n  }\n\n  function isPatchable (vnode) {\n    while (vnode.child) {\n      vnode = vnode.child._vnode;\n    }\n    return isDef(vnode.tag)\n  }\n\n  function invokeCreateHooks (vnode, insertedVnodeQueue) {\n    for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n      cbs.create[i$1](emptyNode, vnode);\n    }\n    i = vnode.data.hook; // Reuse variable\n    if (isDef(i)) {\n      if (i.create) { i.create(emptyNode, vnode); }\n      if (i.insert) { insertedVnodeQueue.push(vnode); }\n    }\n  }\n\n  function initComponent (vnode, insertedVnodeQueue) {\n    if (vnode.data.pendingInsert) {\n      insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n    }\n    vnode.elm = vnode.child.$el;\n    if (isPatchable(vnode)) {\n      invokeCreateHooks(vnode, insertedVnodeQueue);\n      setScope(vnode);\n    } else {\n      // empty component root.\n      // skip all element-related modules except for ref (#3455)\n      registerRef(vnode);\n      // make sure to invoke the insert hook\n      insertedVnodeQueue.push(vnode);\n    }\n  }\n\n  // set scope id attribute for scoped CSS.\n  // this is implemented as a special case to avoid the overhead\n  // of going through the normal attribute patching process.\n  function setScope (vnode) {\n    var i;\n    if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n    if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n  }\n\n  function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);\n    }\n  }\n\n  function invokeDestroyHook (vnode) {\n    var i, j;\n    var data = vnode.data;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n      for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n    }\n    if (isDef(i = vnode.children)) {\n      for (j = 0; j < vnode.children.length; ++j) {\n        invokeDestroyHook(vnode.children[j]);\n      }\n    }\n  }\n\n  function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      var ch = vnodes[startIdx];\n      if (isDef(ch)) {\n        if (isDef(ch.tag)) {\n          removeAndInvokeRemoveHook(ch);\n          invokeDestroyHook(ch);\n        } else { // Text node\n          nodeOps.removeChild(parentElm, ch.elm);\n        }\n      }\n    }\n  }\n\n  function removeAndInvokeRemoveHook (vnode, rm) {\n    if (rm || isDef(vnode.data)) {\n      var listeners = cbs.remove.length + 1;\n      if (!rm) {\n        // directly removing\n        rm = createRmCb(vnode.elm, listeners);\n      } else {\n        // we have a recursively passed down rm callback\n        // increase the listeners count\n        rm.listeners += listeners;\n      }\n      // recursively invoke hooks on child component root node\n      if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {\n        removeAndInvokeRemoveHook(i, rm);\n      }\n      for (i = 0; i < cbs.remove.length; ++i) {\n        cbs.remove[i](vnode, rm);\n      }\n      if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n        i(vnode, rm);\n      } else {\n        rm();\n      }\n    } else {\n      removeElement(vnode.elm);\n    }\n  }\n\n  function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n    var oldStartIdx = 0;\n    var newStartIdx = 0;\n    var oldEndIdx = oldCh.length - 1;\n    var oldStartVnode = oldCh[0];\n    var oldEndVnode = oldCh[oldEndIdx];\n    var newEndIdx = newCh.length - 1;\n    var newStartVnode = newCh[0];\n    var newEndVnode = newCh[newEndIdx];\n    var oldKeyToIdx, idxInOld, elmToMove, refElm;\n\n    // removeOnly is a special flag used only by <transition-group>\n    // to ensure removed elements stay in correct relative positions\n    // during leaving transitions\n    var canMove = !removeOnly;\n\n    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n      if (isUndef(oldStartVnode)) {\n        oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n      } else if (isUndef(oldEndVnode)) {\n        oldEndVnode = oldCh[--oldEndIdx];\n      } else if (sameVnode(oldStartVnode, newStartVnode)) {\n        patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);\n        oldStartVnode = oldCh[++oldStartIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else if (sameVnode(oldEndVnode, newEndVnode)) {\n        patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n        patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n        oldStartVnode = oldCh[++oldStartIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n        patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else {\n        if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n        idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;\n        if (isUndef(idxInOld)) { // New element\n          createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          elmToMove = oldCh[idxInOld];\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !elmToMove) {\n            warn(\n              'It seems there are duplicate keys that is causing an update error. ' +\n              'Make sure each v-for item has a unique key.'\n            );\n          }\n          if (elmToMove.tag !== newStartVnode.tag) {\n            // same key but different element. treat as new element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          } else {\n            patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);\n            oldCh[idxInOld] = undefined;\n            canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          }\n        }\n      }\n    }\n    if (oldStartIdx > oldEndIdx) {\n      refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n      addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n    } else if (newStartIdx > newEndIdx) {\n      removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n    }\n  }\n\n  function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {\n    if (oldVnode === vnode) {\n      return\n    }\n    // reuse element for static trees.\n    // note we only do this if the vnode is cloned -\n    // if the new node is not cloned it means the render functions have been\n    // reset by the hot-reload-api and we need to do a proper re-render.\n    if (vnode.isStatic &&\n        oldVnode.isStatic &&\n        vnode.key === oldVnode.key &&\n        (vnode.isCloned || vnode.isOnce)) {\n      vnode.elm = oldVnode.elm;\n      vnode.child = oldVnode.child;\n      return\n    }\n    var i;\n    var data = vnode.data;\n    var hasData = isDef(data);\n    if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n      i(oldVnode, vnode);\n    }\n    var elm = vnode.elm = oldVnode.elm;\n    var oldCh = oldVnode.children;\n    var ch = vnode.children;\n    if (hasData && isPatchable(vnode)) {\n      for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n      if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n    }\n    if (isUndef(vnode.text)) {\n      if (isDef(oldCh) && isDef(ch)) {\n        if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n      } else if (isDef(ch)) {\n        if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n        addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n      } else if (isDef(oldCh)) {\n        removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n      } else if (isDef(oldVnode.text)) {\n        nodeOps.setTextContent(elm, '');\n      }\n    } else if (oldVnode.text !== vnode.text) {\n      nodeOps.setTextContent(elm, vnode.text);\n    }\n    if (hasData) {\n      if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n    }\n  }\n\n  function invokeInsertHook (vnode, queue, initial) {\n    // delay insert hooks for component root nodes, invoke them after the\n    // element is really inserted\n    if (initial && vnode.parent) {\n      vnode.parent.data.pendingInsert = queue;\n    } else {\n      for (var i = 0; i < queue.length; ++i) {\n        queue[i].data.hook.insert(queue[i]);\n      }\n    }\n  }\n\n  var bailed = false;\n  function hydrate (elm, vnode, insertedVnodeQueue) {\n    {\n      if (!assertNodeMatch(elm, vnode)) {\n        return false\n      }\n    }\n    vnode.elm = elm;\n    var tag = vnode.tag;\n    var data = vnode.data;\n    var children = vnode.children;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n      if (isDef(i = vnode.child)) {\n        // child component. it should have hydrated its own tree.\n        initComponent(vnode, insertedVnodeQueue);\n        return true\n      }\n    }\n    if (isDef(tag)) {\n      if (isDef(children)) {\n        var childNodes = nodeOps.childNodes(elm);\n        // empty element, allow client to pick up and populate children\n        if (!childNodes.length) {\n          createChildren(vnode, children, insertedVnodeQueue);\n        } else {\n          var childrenMatch = true;\n          if (childNodes.length !== children.length) {\n            childrenMatch = false;\n          } else {\n            for (var i$1 = 0; i$1 < children.length; i$1++) {\n              if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {\n                childrenMatch = false;\n                break\n              }\n            }\n          }\n          if (!childrenMatch) {\n            if (\"development\" !== 'production' &&\n                typeof console !== 'undefined' &&\n                !bailed) {\n              bailed = true;\n              console.warn('Parent: ', elm);\n              console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);\n            }\n            return false\n          }\n        }\n      }\n      if (isDef(data)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n      }\n    }\n    return true\n  }\n\n  function assertNodeMatch (node, vnode) {\n    if (vnode.tag) {\n      return (\n        vnode.tag.indexOf('vue-component') === 0 ||\n        vnode.tag.toLowerCase() === nodeOps.tagName(node).toLowerCase()\n      )\n    } else {\n      return _toString(vnode.text) === node.data\n    }\n  }\n\n  return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {\n    if (!vnode) {\n      if (oldVnode) { invokeDestroyHook(oldVnode); }\n      return\n    }\n\n    var elm, parent;\n    var isInitialPatch = false;\n    var insertedVnodeQueue = [];\n\n    if (!oldVnode) {\n      // empty mount (likely as component), create new root element\n      isInitialPatch = true;\n      createElm(vnode, insertedVnodeQueue, parentElm, refElm);\n    } else {\n      var isRealElement = isDef(oldVnode.nodeType);\n      if (!isRealElement && sameVnode(oldVnode, vnode)) {\n        // patch existing root node\n        patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);\n      } else {\n        if (isRealElement) {\n          // mounting to a real element\n          // check if this is server-rendered content and if we can perform\n          // a successful hydration.\n          if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {\n            oldVnode.removeAttribute('server-rendered');\n            hydrating = true;\n          }\n          if (hydrating) {\n            if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n              invokeInsertHook(vnode, insertedVnodeQueue, true);\n              return oldVnode\n            } else {\n              warn(\n                'The client-side rendered virtual DOM tree is not matching ' +\n                'server-rendered content. This is likely caused by incorrect ' +\n                'HTML markup, for example nesting block-level elements inside ' +\n                '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                'full client-side render.'\n              );\n            }\n          }\n          // either not server-rendered, or hydration failed.\n          // create an empty node and replace it\n          oldVnode = emptyNodeAt(oldVnode);\n        }\n\n        // replacing existing element\n        elm = oldVnode.elm;\n        parent = nodeOps.parentNode(elm);\n        createElm(vnode, insertedVnodeQueue, parent, nodeOps.nextSibling(elm));\n\n        if (vnode.parent) {\n          // component root element replaced.\n          // update parent placeholder node element, recursively\n          var ancestor = vnode.parent;\n          while (ancestor) {\n            ancestor.elm = vnode.elm;\n            ancestor = ancestor.parent;\n          }\n          if (isPatchable(vnode)) {\n            for (var i = 0; i < cbs.create.length; ++i) {\n              cbs.create[i](emptyNode, vnode.parent);\n            }\n          }\n        }\n\n        if (parent !== null) {\n          removeVnodes(parent, [oldVnode], 0, 0);\n        } else if (isDef(oldVnode.tag)) {\n          invokeDestroyHook(oldVnode);\n        }\n      }\n    }\n\n    invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n    return vnode.elm\n  }\n}\n\n/*  */\n\nvar directives = {\n  create: updateDirectives,\n  update: updateDirectives,\n  destroy: function unbindDirectives (vnode) {\n    updateDirectives(vnode, emptyNode);\n  }\n};\n\nfunction updateDirectives (\n  oldVnode,\n  vnode\n) {\n  if (!oldVnode.data.directives && !vnode.data.directives) {\n    return\n  }\n  var isCreate = oldVnode === emptyNode;\n  var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n  var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n  var dirsWithInsert = [];\n  var dirsWithPostpatch = [];\n\n  var key, oldDir, dir;\n  for (key in newDirs) {\n    oldDir = oldDirs[key];\n    dir = newDirs[key];\n    if (!oldDir) {\n      // new directive, bind\n      callHook$1(dir, 'bind', vnode, oldVnode);\n      if (dir.def && dir.def.inserted) {\n        dirsWithInsert.push(dir);\n      }\n    } else {\n      // existing directive, update\n      dir.oldValue = oldDir.value;\n      callHook$1(dir, 'update', vnode, oldVnode);\n      if (dir.def && dir.def.componentUpdated) {\n        dirsWithPostpatch.push(dir);\n      }\n    }\n  }\n\n  if (dirsWithInsert.length) {\n    var callInsert = function () {\n      dirsWithInsert.forEach(function (dir) {\n        callHook$1(dir, 'inserted', vnode, oldVnode);\n      });\n    };\n    if (isCreate) {\n      mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');\n    } else {\n      callInsert();\n    }\n  }\n\n  if (dirsWithPostpatch.length) {\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {\n      dirsWithPostpatch.forEach(function (dir) {\n        callHook$1(dir, 'componentUpdated', vnode, oldVnode);\n      });\n    }, 'dir-postpatch');\n  }\n\n  if (!isCreate) {\n    for (key in oldDirs) {\n      if (!newDirs[key]) {\n        // no longer present, unbind\n        callHook$1(oldDirs[key], 'unbind', oldVnode);\n      }\n    }\n  }\n}\n\nvar emptyModifiers = Object.create(null);\n\nfunction normalizeDirectives$1 (\n  dirs,\n  vm\n) {\n  var res = Object.create(null);\n  if (!dirs) {\n    return res\n  }\n  var i, dir;\n  for (i = 0; i < dirs.length; i++) {\n    dir = dirs[i];\n    if (!dir.modifiers) {\n      dir.modifiers = emptyModifiers;\n    }\n    res[getRawDirName(dir)] = dir;\n    dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n  }\n  return res\n}\n\nfunction getRawDirName (dir) {\n  return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n}\n\nfunction callHook$1 (dir, hook, vnode, oldVnode) {\n  var fn = dir.def && dir.def[hook];\n  if (fn) {\n    fn(vnode.elm, dir, vnode, oldVnode);\n  }\n}\n\nvar baseModules = [\n  ref,\n  directives\n];\n\n/*  */\n\nfunction updateAttrs (oldVnode, vnode) {\n  if (!oldVnode.data.attrs && !vnode.data.attrs) {\n    return\n  }\n  var key, cur, old;\n  var elm = vnode.elm;\n  var oldAttrs = oldVnode.data.attrs || {};\n  var attrs = vnode.data.attrs || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (attrs.__ob__) {\n    attrs = vnode.data.attrs = extend({}, attrs);\n  }\n\n  for (key in attrs) {\n    cur = attrs[key];\n    old = oldAttrs[key];\n    if (old !== cur) {\n      setAttr(elm, key, cur);\n    }\n  }\n  for (key in oldAttrs) {\n    if (attrs[key] == null) {\n      if (isXlink(key)) {\n        elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else if (!isEnumeratedAttr(key)) {\n        elm.removeAttribute(key);\n      }\n    }\n  }\n}\n\nfunction setAttr (el, key, value) {\n  if (isBooleanAttr(key)) {\n    // set attribute for blank value\n    // e.g. <option disabled>Select one</option>\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, key);\n    }\n  } else if (isEnumeratedAttr(key)) {\n    el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');\n  } else if (isXlink(key)) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n    } else {\n      el.setAttributeNS(xlinkNS, key, value);\n    }\n  } else {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, value);\n    }\n  }\n}\n\nvar attrs = {\n  create: updateAttrs,\n  update: updateAttrs\n};\n\n/*  */\n\nfunction updateClass (oldVnode, vnode) {\n  var el = vnode.elm;\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n  if (!data.staticClass && !data.class &&\n      (!oldData || (!oldData.staticClass && !oldData.class))) {\n    return\n  }\n\n  var cls = genClassForVnode(vnode);\n\n  // handle transition classes\n  var transitionClass = el._transitionClasses;\n  if (transitionClass) {\n    cls = concat(cls, stringifyClass(transitionClass));\n  }\n\n  // set the class\n  if (cls !== el._prevClass) {\n    el.setAttribute('class', cls);\n    el._prevClass = cls;\n  }\n}\n\nvar klass = {\n  create: updateClass,\n  update: updateClass\n};\n\n// skip type checking this file because we need to attach private properties\n// to elements\n\nfunction updateDOMListeners (oldVnode, vnode) {\n  if (!oldVnode.data.on && !vnode.data.on) {\n    return\n  }\n  var on = vnode.data.on || {};\n  var oldOn = oldVnode.data.on || {};\n  var add = vnode.elm._v_add || (\n    vnode.elm._v_add = function (event, handler, once, capture) {\n      if (once) {\n        var oldHandler = handler;\n        handler = function (ev) {\n          remove(event, handler, capture);\n          arguments.length === 1\n            ? oldHandler(ev)\n            : oldHandler.apply(null, arguments);\n        };\n      }\n      vnode.elm.addEventListener(event, handler, capture);\n    }\n  );\n  var remove = vnode.elm._v_remove || (\n    vnode.elm._v_remove = function (event, handler, capture) {\n      vnode.elm.removeEventListener(event, handler, capture);\n    }\n  );\n  updateListeners(on, oldOn, add, remove, vnode.context);\n}\n\nvar events = {\n  create: updateDOMListeners,\n  update: updateDOMListeners\n};\n\n/*  */\n\nfunction updateDOMProps (oldVnode, vnode) {\n  if (!oldVnode.data.domProps && !vnode.data.domProps) {\n    return\n  }\n  var key, cur;\n  var elm = vnode.elm;\n  var oldProps = oldVnode.data.domProps || {};\n  var props = vnode.data.domProps || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (props.__ob__) {\n    props = vnode.data.domProps = extend({}, props);\n  }\n\n  for (key in oldProps) {\n    if (props[key] == null) {\n      elm[key] = '';\n    }\n  }\n  for (key in props) {\n    cur = props[key];\n    // ignore children if the node has textContent or innerHTML,\n    // as these will throw away existing DOM nodes and cause removal errors\n    // on subsequent patches (#3360)\n    if (key === 'textContent' || key === 'innerHTML') {\n      if (vnode.children) { vnode.children.length = 0; }\n      if (cur === oldProps[key]) { continue }\n    }\n    if (key === 'value') {\n      // store value as _value as well since\n      // non-string values will be stringified\n      elm._value = cur;\n      // avoid resetting cursor position when value is the same\n      var strCur = cur == null ? '' : String(cur);\n      if (elm.value !== strCur && !elm.composing) {\n        elm.value = strCur;\n      }\n    } else {\n      elm[key] = cur;\n    }\n  }\n}\n\nvar domProps = {\n  create: updateDOMProps,\n  update: updateDOMProps\n};\n\n/*  */\n\nvar parseStyleText = cached(function (cssText) {\n  var res = {};\n  var listDelimiter = /;(?![^(]*\\))/g;\n  var propertyDelimiter = /:(.+)/;\n  cssText.split(listDelimiter).forEach(function (item) {\n    if (item) {\n      var tmp = item.split(propertyDelimiter);\n      tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n    }\n  });\n  return res\n});\n\n// merge static and dynamic style data on the same vnode\nfunction normalizeStyleData (data) {\n  var style = normalizeStyleBinding(data.style);\n  // static style is pre-processed into an object during compilation\n  // and is always a fresh object, so it's safe to merge into it\n  return data.staticStyle\n    ? extend(data.staticStyle, style)\n    : style\n}\n\n// normalize possible array / string values into Object\nfunction normalizeStyleBinding (bindingStyle) {\n  if (Array.isArray(bindingStyle)) {\n    return toObject(bindingStyle)\n  }\n  if (typeof bindingStyle === 'string') {\n    return parseStyleText(bindingStyle)\n  }\n  return bindingStyle\n}\n\n/**\n * parent component style should be after child's\n * so that parent component's style could override it\n */\nfunction getStyle (vnode, checkChild) {\n  var res = {};\n  var styleData;\n\n  if (checkChild) {\n    var childNode = vnode;\n    while (childNode.child) {\n      childNode = childNode.child._vnode;\n      if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n        extend(res, styleData);\n      }\n    }\n  }\n\n  if ((styleData = normalizeStyleData(vnode.data))) {\n    extend(res, styleData);\n  }\n\n  var parentNode = vnode;\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n      extend(res, styleData);\n    }\n  }\n  return res\n}\n\n/*  */\n\nvar cssVarRE = /^--/;\nvar importantRE = /\\s*!important$/;\nvar setProp = function (el, name, val) {\n  /* istanbul ignore if */\n  if (cssVarRE.test(name)) {\n    el.style.setProperty(name, val);\n  } else if (importantRE.test(val)) {\n    el.style.setProperty(name, val.replace(importantRE, ''), 'important');\n  } else {\n    el.style[normalize(name)] = val;\n  }\n};\n\nvar prefixes = ['Webkit', 'Moz', 'ms'];\n\nvar testEl;\nvar normalize = cached(function (prop) {\n  testEl = testEl || document.createElement('div');\n  prop = camelize(prop);\n  if (prop !== 'filter' && (prop in testEl.style)) {\n    return prop\n  }\n  var upper = prop.charAt(0).toUpperCase() + prop.slice(1);\n  for (var i = 0; i < prefixes.length; i++) {\n    var prefixed = prefixes[i] + upper;\n    if (prefixed in testEl.style) {\n      return prefixed\n    }\n  }\n});\n\nfunction updateStyle (oldVnode, vnode) {\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n\n  if (!data.staticStyle && !data.style &&\n      !oldData.staticStyle && !oldData.style) {\n    return\n  }\n\n  var cur, name;\n  var el = vnode.elm;\n  var oldStaticStyle = oldVnode.data.staticStyle;\n  var oldStyleBinding = oldVnode.data.style || {};\n\n  // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n  var oldStyle = oldStaticStyle || oldStyleBinding;\n\n  var style = normalizeStyleBinding(vnode.data.style) || {};\n\n  vnode.data.style = style.__ob__ ? extend({}, style) : style;\n\n  var newStyle = getStyle(vnode, true);\n\n  for (name in oldStyle) {\n    if (newStyle[name] == null) {\n      setProp(el, name, '');\n    }\n  }\n  for (name in newStyle) {\n    cur = newStyle[name];\n    if (cur !== oldStyle[name]) {\n      // ie9 setting to null has no effect, must use empty string\n      setProp(el, name, cur == null ? '' : cur);\n    }\n  }\n}\n\nvar style = {\n  create: updateStyle,\n  update: updateStyle\n};\n\n/*  */\n\n/**\n * Add class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction addClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n    } else {\n      el.classList.add(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    if (cur.indexOf(' ' + cls + ' ') < 0) {\n      el.setAttribute('class', (cur + cls).trim());\n    }\n  }\n}\n\n/**\n * Remove class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction removeClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.remove(c); });\n    } else {\n      el.classList.remove(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    var tar = ' ' + cls + ' ';\n    while (cur.indexOf(tar) >= 0) {\n      cur = cur.replace(tar, ' ');\n    }\n    el.setAttribute('class', cur.trim());\n  }\n}\n\n/*  */\n\nvar hasTransition = inBrowser && !isIE9;\nvar TRANSITION = 'transition';\nvar ANIMATION = 'animation';\n\n// Transition property/event sniffing\nvar transitionProp = 'transition';\nvar transitionEndEvent = 'transitionend';\nvar animationProp = 'animation';\nvar animationEndEvent = 'animationend';\nif (hasTransition) {\n  /* istanbul ignore if */\n  if (window.ontransitionend === undefined &&\n    window.onwebkittransitionend !== undefined) {\n    transitionProp = 'WebkitTransition';\n    transitionEndEvent = 'webkitTransitionEnd';\n  }\n  if (window.onanimationend === undefined &&\n    window.onwebkitanimationend !== undefined) {\n    animationProp = 'WebkitAnimation';\n    animationEndEvent = 'webkitAnimationEnd';\n  }\n}\n\nvar raf = (inBrowser && window.requestAnimationFrame) || setTimeout;\nfunction nextFrame (fn) {\n  raf(function () {\n    raf(fn);\n  });\n}\n\nfunction addTransitionClass (el, cls) {\n  (el._transitionClasses || (el._transitionClasses = [])).push(cls);\n  addClass(el, cls);\n}\n\nfunction removeTransitionClass (el, cls) {\n  if (el._transitionClasses) {\n    remove$1(el._transitionClasses, cls);\n  }\n  removeClass(el, cls);\n}\n\nfunction whenTransitionEnds (\n  el,\n  expectedType,\n  cb\n) {\n  var ref = getTransitionInfo(el, expectedType);\n  var type = ref.type;\n  var timeout = ref.timeout;\n  var propCount = ref.propCount;\n  if (!type) { return cb() }\n  var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n  var ended = 0;\n  var end = function () {\n    el.removeEventListener(event, onEnd);\n    cb();\n  };\n  var onEnd = function (e) {\n    if (e.target === el) {\n      if (++ended >= propCount) {\n        end();\n      }\n    }\n  };\n  setTimeout(function () {\n    if (ended < propCount) {\n      end();\n    }\n  }, timeout + 1);\n  el.addEventListener(event, onEnd);\n}\n\nvar transformRE = /\\b(transform|all)(,|$)/;\n\nfunction getTransitionInfo (el, expectedType) {\n  var styles = window.getComputedStyle(el);\n  var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');\n  var transitionDurations = styles[transitionProp + 'Duration'].split(', ');\n  var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);\n  var animationDelays = styles[animationProp + 'Delay'].split(', ');\n  var animationDurations = styles[animationProp + 'Duration'].split(', ');\n  var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n  var type;\n  var timeout = 0;\n  var propCount = 0;\n  /* istanbul ignore if */\n  if (expectedType === TRANSITION) {\n    if (transitionTimeout > 0) {\n      type = TRANSITION;\n      timeout = transitionTimeout;\n      propCount = transitionDurations.length;\n    }\n  } else if (expectedType === ANIMATION) {\n    if (animationTimeout > 0) {\n      type = ANIMATION;\n      timeout = animationTimeout;\n      propCount = animationDurations.length;\n    }\n  } else {\n    timeout = Math.max(transitionTimeout, animationTimeout);\n    type = timeout > 0\n      ? transitionTimeout > animationTimeout\n        ? TRANSITION\n        : ANIMATION\n      : null;\n    propCount = type\n      ? type === TRANSITION\n        ? transitionDurations.length\n        : animationDurations.length\n      : 0;\n  }\n  var hasTransform =\n    type === TRANSITION &&\n    transformRE.test(styles[transitionProp + 'Property']);\n  return {\n    type: type,\n    timeout: timeout,\n    propCount: propCount,\n    hasTransform: hasTransform\n  }\n}\n\nfunction getTimeout (delays, durations) {\n  /* istanbul ignore next */\n  while (delays.length < durations.length) {\n    delays = delays.concat(delays);\n  }\n\n  return Math.max.apply(null, durations.map(function (d, i) {\n    return toMs(d) + toMs(delays[i])\n  }))\n}\n\nfunction toMs (s) {\n  return Number(s.slice(0, -1)) * 1000\n}\n\n/*  */\n\nfunction enter (vnode) {\n  var el = vnode.elm;\n\n  // call leave callback now\n  if (el._leaveCb) {\n    el._leaveCb.cancelled = true;\n    el._leaveCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return\n  }\n\n  /* istanbul ignore if */\n  if (el._enterCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var enterClass = data.enterClass;\n  var enterActiveClass = data.enterActiveClass;\n  var appearClass = data.appearClass;\n  var appearActiveClass = data.appearActiveClass;\n  var beforeEnter = data.beforeEnter;\n  var enter = data.enter;\n  var afterEnter = data.afterEnter;\n  var enterCancelled = data.enterCancelled;\n  var beforeAppear = data.beforeAppear;\n  var appear = data.appear;\n  var afterAppear = data.afterAppear;\n  var appearCancelled = data.appearCancelled;\n\n  // activeInstance will always be the <transition> component managing this\n  // transition. One edge case to check is when the <transition> is placed\n  // as the root node of a child component. In that case we need to check\n  // <transition>'s parent for appear check.\n  var context = activeInstance;\n  var transitionNode = activeInstance.$vnode;\n  while (transitionNode && transitionNode.parent) {\n    transitionNode = transitionNode.parent;\n    context = transitionNode.context;\n  }\n\n  var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  var startClass = isAppear ? appearClass : enterClass;\n  var activeClass = isAppear ? appearActiveClass : enterActiveClass;\n  var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;\n  var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;\n  var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;\n  var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    enterHook &&\n    // enterHook may be a bound method which exposes\n    // the length of original fn as _length\n    (enterHook._length || enterHook.length) > 1;\n\n  var cb = el._enterCb = once(function () {\n    if (expectsCSS) {\n      removeTransitionClass(el, activeClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass);\n      }\n      enterCancelledHook && enterCancelledHook(el);\n    } else {\n      afterEnterHook && afterEnterHook(el);\n    }\n    el._enterCb = null;\n  });\n\n  if (!vnode.data.show) {\n    // remove pending leave element on enter by injecting an insert hook\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {\n      var parent = el.parentNode;\n      var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n      if (pendingNode &&\n          pendingNode.context === vnode.context &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb) {\n        pendingNode.elm._leaveCb();\n      }\n      enterHook && enterHook(el, cb);\n    }, 'transition-insert');\n  }\n\n  // start enter transition\n  beforeEnterHook && beforeEnterHook(el);\n  if (expectsCSS) {\n    addTransitionClass(el, startClass);\n    addTransitionClass(el, activeClass);\n    nextFrame(function () {\n      removeTransitionClass(el, startClass);\n      if (!cb.cancelled && !userWantsControl) {\n        whenTransitionEnds(el, type, cb);\n      }\n    });\n  }\n\n  if (vnode.data.show) {\n    enterHook && enterHook(el, cb);\n  }\n\n  if (!expectsCSS && !userWantsControl) {\n    cb();\n  }\n}\n\nfunction leave (vnode, rm) {\n  var el = vnode.elm;\n\n  // call enter callback now\n  if (el._enterCb) {\n    el._enterCb.cancelled = true;\n    el._enterCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return rm()\n  }\n\n  /* istanbul ignore if */\n  if (el._leaveCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var leaveClass = data.leaveClass;\n  var leaveActiveClass = data.leaveActiveClass;\n  var beforeLeave = data.beforeLeave;\n  var leave = data.leave;\n  var afterLeave = data.afterLeave;\n  var leaveCancelled = data.leaveCancelled;\n  var delayLeave = data.delayLeave;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    leave &&\n    // leave hook may be a bound method which exposes\n    // the length of original fn as _length\n    (leave._length || leave.length) > 1;\n\n  var cb = el._leaveCb = once(function () {\n    if (el.parentNode && el.parentNode._pending) {\n      el.parentNode._pending[vnode.key] = null;\n    }\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveActiveClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass);\n      }\n      leaveCancelled && leaveCancelled(el);\n    } else {\n      rm();\n      afterLeave && afterLeave(el);\n    }\n    el._leaveCb = null;\n  });\n\n  if (delayLeave) {\n    delayLeave(performLeave);\n  } else {\n    performLeave();\n  }\n\n  function performLeave () {\n    // the delayed leave may have already been cancelled\n    if (cb.cancelled) {\n      return\n    }\n    // record leaving element\n    if (!vnode.data.show) {\n      (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;\n    }\n    beforeLeave && beforeLeave(el);\n    if (expectsCSS) {\n      addTransitionClass(el, leaveClass);\n      addTransitionClass(el, leaveActiveClass);\n      nextFrame(function () {\n        removeTransitionClass(el, leaveClass);\n        if (!cb.cancelled && !userWantsControl) {\n          whenTransitionEnds(el, type, cb);\n        }\n      });\n    }\n    leave && leave(el, cb);\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n}\n\nfunction resolveTransition (def$$1) {\n  if (!def$$1) {\n    return\n  }\n  /* istanbul ignore else */\n  if (typeof def$$1 === 'object') {\n    var res = {};\n    if (def$$1.css !== false) {\n      extend(res, autoCssTransition(def$$1.name || 'v'));\n    }\n    extend(res, def$$1);\n    return res\n  } else if (typeof def$$1 === 'string') {\n    return autoCssTransition(def$$1)\n  }\n}\n\nvar autoCssTransition = cached(function (name) {\n  return {\n    enterClass: (name + \"-enter\"),\n    leaveClass: (name + \"-leave\"),\n    appearClass: (name + \"-enter\"),\n    enterActiveClass: (name + \"-enter-active\"),\n    leaveActiveClass: (name + \"-leave-active\"),\n    appearActiveClass: (name + \"-enter-active\")\n  }\n});\n\nfunction once (fn) {\n  var called = false;\n  return function () {\n    if (!called) {\n      called = true;\n      fn();\n    }\n  }\n}\n\nfunction _enter (_, vnode) {\n  if (!vnode.data.show) {\n    enter(vnode);\n  }\n}\n\nvar transition = inBrowser ? {\n  create: _enter,\n  activate: _enter,\n  remove: function remove (vnode, rm) {\n    /* istanbul ignore else */\n    if (!vnode.data.show) {\n      leave(vnode, rm);\n    } else {\n      rm();\n    }\n  }\n} : {};\n\nvar platformModules = [\n  attrs,\n  klass,\n  events,\n  domProps,\n  style,\n  transition\n];\n\n/*  */\n\n// the directive module should be applied last, after all\n// built-in modules have been applied.\nvar modules = platformModules.concat(baseModules);\n\nvar patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n/**\n * Not type checking this file because flow doesn't like attaching\n * properties to Elements.\n */\n\nvar modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;\n\n/* istanbul ignore if */\nif (isIE9) {\n  // http://www.matts411.com/post/internet-explorer-9-oninput/\n  document.addEventListener('selectionchange', function () {\n    var el = document.activeElement;\n    if (el && el.vmodel) {\n      trigger(el, 'input');\n    }\n  });\n}\n\nvar model = {\n  inserted: function inserted (el, binding, vnode) {\n    {\n      if (!modelableTagRE.test(vnode.tag)) {\n        warn(\n          \"v-model is not supported on element type: <\" + (vnode.tag) + \">. \" +\n          'If you are working with contenteditable, it\\'s recommended to ' +\n          'wrap a library dedicated for that purpose inside a custom component.',\n          vnode.context\n        );\n      }\n    }\n    if (vnode.tag === 'select') {\n      var cb = function () {\n        setSelected(el, binding, vnode.context);\n      };\n      cb();\n      /* istanbul ignore if */\n      if (isIE || isEdge) {\n        setTimeout(cb, 0);\n      }\n    } else if (\n      (vnode.tag === 'textarea' || el.type === 'text') &&\n      !binding.modifiers.lazy\n    ) {\n      if (!isAndroid) {\n        el.addEventListener('compositionstart', onCompositionStart);\n        el.addEventListener('compositionend', onCompositionEnd);\n      }\n      /* istanbul ignore if */\n      if (isIE9) {\n        el.vmodel = true;\n      }\n    }\n  },\n  componentUpdated: function componentUpdated (el, binding, vnode) {\n    if (vnode.tag === 'select') {\n      setSelected(el, binding, vnode.context);\n      // in case the options rendered by v-for have changed,\n      // it's possible that the value is out-of-sync with the rendered options.\n      // detect such cases and filter out values that no longer has a matching\n      // option in the DOM.\n      var needReset = el.multiple\n        ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })\n        : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);\n      if (needReset) {\n        trigger(el, 'change');\n      }\n    }\n  }\n};\n\nfunction setSelected (el, binding, vm) {\n  var value = binding.value;\n  var isMultiple = el.multiple;\n  if (isMultiple && !Array.isArray(value)) {\n    \"development\" !== 'production' && warn(\n      \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n      \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n      vm\n    );\n    return\n  }\n  var selected, option;\n  for (var i = 0, l = el.options.length; i < l; i++) {\n    option = el.options[i];\n    if (isMultiple) {\n      selected = looseIndexOf(value, getValue(option)) > -1;\n      if (option.selected !== selected) {\n        option.selected = selected;\n      }\n    } else {\n      if (looseEqual(getValue(option), value)) {\n        if (el.selectedIndex !== i) {\n          el.selectedIndex = i;\n        }\n        return\n      }\n    }\n  }\n  if (!isMultiple) {\n    el.selectedIndex = -1;\n  }\n}\n\nfunction hasNoMatchingOption (value, options) {\n  for (var i = 0, l = options.length; i < l; i++) {\n    if (looseEqual(getValue(options[i]), value)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction getValue (option) {\n  return '_value' in option\n    ? option._value\n    : option.value\n}\n\nfunction onCompositionStart (e) {\n  e.target.composing = true;\n}\n\nfunction onCompositionEnd (e) {\n  e.target.composing = false;\n  trigger(e.target, 'input');\n}\n\nfunction trigger (el, type) {\n  var e = document.createEvent('HTMLEvents');\n  e.initEvent(type, true, true);\n  el.dispatchEvent(e);\n}\n\n/*  */\n\n// recursively search for possible transition defined inside the component root\nfunction locateNode (vnode) {\n  return vnode.child && (!vnode.data || !vnode.data.transition)\n    ? locateNode(vnode.child._vnode)\n    : vnode\n}\n\nvar show = {\n  bind: function bind (el, ref, vnode) {\n    var value = ref.value;\n\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (value && transition && !isIE9) {\n      enter(vnode);\n    }\n    var originalDisplay = el.style.display === 'none' ? '' : el.style.display;\n    el.style.display = value ? originalDisplay : 'none';\n    el.__vOriginalDisplay = originalDisplay;\n  },\n  update: function update (el, ref, vnode) {\n    var value = ref.value;\n    var oldValue = ref.oldValue;\n\n    /* istanbul ignore if */\n    if (value === oldValue) { return }\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (transition && !isIE9) {\n      if (value) {\n        enter(vnode);\n        el.style.display = el.__vOriginalDisplay;\n      } else {\n        leave(vnode, function () {\n          el.style.display = 'none';\n        });\n      }\n    } else {\n      el.style.display = value ? el.__vOriginalDisplay : 'none';\n    }\n  }\n};\n\nvar platformDirectives = {\n  model: model,\n  show: show\n};\n\n/*  */\n\n// Provides transition support for a single element/component.\n// supports transition mode (out-in / in-out)\n\nvar transitionProps = {\n  name: String,\n  appear: Boolean,\n  css: Boolean,\n  mode: String,\n  type: String,\n  enterClass: String,\n  leaveClass: String,\n  enterActiveClass: String,\n  leaveActiveClass: String,\n  appearClass: String,\n  appearActiveClass: String\n};\n\n// in case the child is also an abstract component, e.g. <keep-alive>\n// we want to recursively retrieve the real component to be rendered\nfunction getRealChild (vnode) {\n  var compOptions = vnode && vnode.componentOptions;\n  if (compOptions && compOptions.Ctor.options.abstract) {\n    return getRealChild(getFirstComponentChild(compOptions.children))\n  } else {\n    return vnode\n  }\n}\n\nfunction extractTransitionData (comp) {\n  var data = {};\n  var options = comp.$options;\n  // props\n  for (var key in options.propsData) {\n    data[key] = comp[key];\n  }\n  // events.\n  // extract listeners and pass them directly to the transition methods\n  var listeners = options._parentListeners;\n  for (var key$1 in listeners) {\n    data[camelize(key$1)] = listeners[key$1].fn;\n  }\n  return data\n}\n\nfunction placeholder (h, rawChild) {\n  return /\\d-keep-alive$/.test(rawChild.tag)\n    ? h('keep-alive')\n    : null\n}\n\nfunction hasParentTransition (vnode) {\n  while ((vnode = vnode.parent)) {\n    if (vnode.data.transition) {\n      return true\n    }\n  }\n}\n\nvar Transition = {\n  name: 'transition',\n  props: transitionProps,\n  abstract: true,\n  render: function render (h) {\n    var this$1 = this;\n\n    var children = this.$slots.default;\n    if (!children) {\n      return\n    }\n\n    // filter out text nodes (possible whitespaces)\n    children = children.filter(function (c) { return c.tag; });\n    /* istanbul ignore if */\n    if (!children.length) {\n      return\n    }\n\n    // warn multiple elements\n    if (\"development\" !== 'production' && children.length > 1) {\n      warn(\n        '<transition> can only be used on a single element. Use ' +\n        '<transition-group> for lists.',\n        this.$parent\n      );\n    }\n\n    var mode = this.mode;\n\n    // warn invalid mode\n    if (\"development\" !== 'production' &&\n        mode && mode !== 'in-out' && mode !== 'out-in') {\n      warn(\n        'invalid <transition> mode: ' + mode,\n        this.$parent\n      );\n    }\n\n    var rawChild = children[0];\n\n    // if this is a component root node and the component's\n    // parent container node also has transition, skip.\n    if (hasParentTransition(this.$vnode)) {\n      return rawChild\n    }\n\n    // apply transition data to child\n    // use getRealChild() to ignore abstract components e.g. keep-alive\n    var child = getRealChild(rawChild);\n    /* istanbul ignore if */\n    if (!child) {\n      return rawChild\n    }\n\n    if (this._leaving) {\n      return placeholder(h, rawChild)\n    }\n\n    var key = child.key = child.key == null || child.isStatic\n      ? (\"__v\" + (child.tag + this._uid) + \"__\")\n      : child.key;\n    var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n    var oldRawChild = this._vnode;\n    var oldChild = getRealChild(oldRawChild);\n\n    // mark v-show\n    // so that the transition module can hand over the control to the directive\n    if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {\n      child.data.show = true;\n    }\n\n    if (oldChild && oldChild.data && oldChild.key !== key) {\n      // replace old child transition data with fresh one\n      // important for dynamic transitions!\n      var oldData = oldChild.data.transition = extend({}, data);\n\n      // handle transition mode\n      if (mode === 'out-in') {\n        // return placeholder node and queue update when leave finishes\n        this._leaving = true;\n        mergeVNodeHook(oldData, 'afterLeave', function () {\n          this$1._leaving = false;\n          this$1.$forceUpdate();\n        }, key);\n        return placeholder(h, rawChild)\n      } else if (mode === 'in-out') {\n        var delayedLeave;\n        var performLeave = function () { delayedLeave(); };\n        mergeVNodeHook(data, 'afterEnter', performLeave, key);\n        mergeVNodeHook(data, 'enterCancelled', performLeave, key);\n        mergeVNodeHook(oldData, 'delayLeave', function (leave) {\n          delayedLeave = leave;\n        }, key);\n      }\n    }\n\n    return rawChild\n  }\n};\n\n/*  */\n\n// Provides transition support for list items.\n// supports move transitions using the FLIP technique.\n\n// Because the vdom's children update algorithm is \"unstable\" - i.e.\n// it doesn't guarantee the relative positioning of removed elements,\n// we force transition-group to update its children into two passes:\n// in the first pass, we remove all nodes that need to be removed,\n// triggering their leaving transition; in the second pass, we insert/move\n// into the final disired state. This way in the second pass removed\n// nodes will remain where they should be.\n\nvar props = extend({\n  tag: String,\n  moveClass: String\n}, transitionProps);\n\ndelete props.mode;\n\nvar TransitionGroup = {\n  props: props,\n\n  render: function render (h) {\n    var tag = this.tag || this.$vnode.data.tag || 'span';\n    var map = Object.create(null);\n    var prevChildren = this.prevChildren = this.children;\n    var rawChildren = this.$slots.default || [];\n    var children = this.children = [];\n    var transitionData = extractTransitionData(this);\n\n    for (var i = 0; i < rawChildren.length; i++) {\n      var c = rawChildren[i];\n      if (c.tag) {\n        if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n          children.push(c);\n          map[c.key] = c\n          ;(c.data || (c.data = {})).transition = transitionData;\n        } else {\n          var opts = c.componentOptions;\n          var name = opts\n            ? (opts.Ctor.options.name || opts.tag)\n            : c.tag;\n          warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n        }\n      }\n    }\n\n    if (prevChildren) {\n      var kept = [];\n      var removed = [];\n      for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n        var c$1 = prevChildren[i$1];\n        c$1.data.transition = transitionData;\n        c$1.data.pos = c$1.elm.getBoundingClientRect();\n        if (map[c$1.key]) {\n          kept.push(c$1);\n        } else {\n          removed.push(c$1);\n        }\n      }\n      this.kept = h(tag, null, kept);\n      this.removed = removed;\n    }\n\n    return h(tag, null, children)\n  },\n\n  beforeUpdate: function beforeUpdate () {\n    // force removing pass\n    this.__patch__(\n      this._vnode,\n      this.kept,\n      false, // hydrating\n      true // removeOnly (!important, avoids unnecessary moves)\n    );\n    this._vnode = this.kept;\n  },\n\n  updated: function updated () {\n    var children = this.prevChildren;\n    var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n    if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n      return\n    }\n\n    // we divide the work into three loops to avoid mixing DOM reads and writes\n    // in each iteration - which helps prevent layout thrashing.\n    children.forEach(callPendingCbs);\n    children.forEach(recordPosition);\n    children.forEach(applyTranslation);\n\n    // force reflow to put everything in position\n    var f = document.body.offsetHeight; // eslint-disable-line\n\n    children.forEach(function (c) {\n      if (c.data.moved) {\n        var el = c.elm;\n        var s = el.style;\n        addTransitionClass(el, moveClass);\n        s.transform = s.WebkitTransform = s.transitionDuration = '';\n        el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n          if (!e || /transform$/.test(e.propertyName)) {\n            el.removeEventListener(transitionEndEvent, cb);\n            el._moveCb = null;\n            removeTransitionClass(el, moveClass);\n          }\n        });\n      }\n    });\n  },\n\n  methods: {\n    hasMove: function hasMove (el, moveClass) {\n      /* istanbul ignore if */\n      if (!hasTransition) {\n        return false\n      }\n      if (this._hasMove != null) {\n        return this._hasMove\n      }\n      addTransitionClass(el, moveClass);\n      var info = getTransitionInfo(el);\n      removeTransitionClass(el, moveClass);\n      return (this._hasMove = info.hasTransform)\n    }\n  }\n};\n\nfunction callPendingCbs (c) {\n  /* istanbul ignore if */\n  if (c.elm._moveCb) {\n    c.elm._moveCb();\n  }\n  /* istanbul ignore if */\n  if (c.elm._enterCb) {\n    c.elm._enterCb();\n  }\n}\n\nfunction recordPosition (c) {\n  c.data.newPos = c.elm.getBoundingClientRect();\n}\n\nfunction applyTranslation (c) {\n  var oldPos = c.data.pos;\n  var newPos = c.data.newPos;\n  var dx = oldPos.left - newPos.left;\n  var dy = oldPos.top - newPos.top;\n  if (dx || dy) {\n    c.data.moved = true;\n    var s = c.elm.style;\n    s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n    s.transitionDuration = '0s';\n  }\n}\n\nvar platformComponents = {\n  Transition: Transition,\n  TransitionGroup: TransitionGroup\n};\n\n/*  */\n\n// install platform specific utils\nVue$3.config.isUnknownElement = isUnknownElement;\nVue$3.config.isReservedTag = isReservedTag;\nVue$3.config.getTagNamespace = getTagNamespace;\nVue$3.config.mustUseProp = mustUseProp;\n\n// install platform runtime directives & components\nextend(Vue$3.options.directives, platformDirectives);\nextend(Vue$3.options.components, platformComponents);\n\n// install platform patch function\nVue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;\n\n// wrap mount\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && inBrowser ? query(el) : undefined;\n  return this._mount(el, hydrating)\n};\n\n// devtools global hook\n/* istanbul ignore next */\nsetTimeout(function () {\n  if (config.devtools) {\n    if (devtools) {\n      devtools.emit('init', Vue$3);\n    } else if (\n      \"development\" !== 'production' &&\n      inBrowser && /Chrome\\/\\d+/.test(window.navigator.userAgent)\n    ) {\n      console.log(\n        'Download the Vue Devtools for a better development experience:\\n' +\n        'https://github.com/vuejs/vue-devtools'\n      );\n    }\n  }\n}, 0);\n\n/*  */\n\n// check whether current browser encodes a char inside attribute values\nfunction shouldDecode (content, encoded) {\n  var div = document.createElement('div');\n  div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n  return div.innerHTML.indexOf(encoded) > 0\n}\n\n// #3663\n// IE encodes newlines inside attribute values while other browsers don't\nvar shouldDecodeNewlines = inBrowser ? shouldDecode('\\n', '&#10;') : false;\n\n/*  */\n\nvar decoder;\n\nfunction decode (html) {\n  decoder = decoder || document.createElement('div');\n  decoder.innerHTML = html;\n  return decoder.textContent\n}\n\n/*  */\n\nvar isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n  'link,meta,param,source,track,wbr',\n  true\n);\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nvar canBeLeftOpenTag = makeMap(\n  'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',\n  true\n);\n\n// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\nvar isNonPhrasingTag = makeMap(\n  'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n  'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n  'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n  'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n  'title,tr,track',\n  true\n);\n\n/**\n * Not type-checking this file because it's mostly vendor code.\n */\n\n/*!\n * HTML Parser By John Resig (ejohn.org)\n * Modified by Juriy \"kangax\" Zaytsev\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n */\n\n// Regular Expressions for parsing tags and attributes\nvar singleAttrIdentifier = /([^\\s\"'<>/=]+)/;\nvar singleAttrAssign = /(?:=)/;\nvar singleAttrValues = [\n  // attr value double quotes\n  /\"([^\"]*)\"+/.source,\n  // attr value, single quotes\n  /'([^']*)'+/.source,\n  // attr value, no quotes\n  /([^\\s\"'=<>`]+)/.source\n];\nvar attribute = new RegExp(\n  '^\\\\s*' + singleAttrIdentifier.source +\n  '(?:\\\\s*(' + singleAttrAssign.source + ')' +\n  '\\\\s*(?:' + singleAttrValues.join('|') + '))?'\n);\n\n// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName\n// but for Vue templates we can enforce a simple charset\nvar ncname = '[a-zA-Z_][\\\\w\\\\-\\\\.]*';\nvar qnameCapture = '((?:' + ncname + '\\\\:)?' + ncname + ')';\nvar startTagOpen = new RegExp('^<' + qnameCapture);\nvar startTagClose = /^\\s*(\\/?)>/;\nvar endTag = new RegExp('^<\\\\/' + qnameCapture + '[^>]*>');\nvar doctype = /^<!DOCTYPE [^>]+>/i;\nvar comment = /^<!--/;\nvar conditionalComment = /^<!\\[/;\n\nvar IS_REGEX_CAPTURING_BROKEN = false;\n'x'.replace(/x(.)?/g, function (m, g) {\n  IS_REGEX_CAPTURING_BROKEN = g === '';\n});\n\n// Special Elements (can contain anything)\nvar isScriptOrStyle = makeMap('script,style', true);\nvar hasLang = function (attr) { return attr.name === 'lang' && attr.value !== 'html'; };\nvar isSpecialTag = function (tag, isSFC, stack) {\n  if (isScriptOrStyle(tag)) {\n    return true\n  }\n  if (isSFC && stack.length === 1) {\n    // top-level template that has no pre-processor\n    if (tag === 'template' && !stack[0].attrs.some(hasLang)) {\n      return false\n    } else {\n      return true\n    }\n  }\n  return false\n};\n\nvar reCache = {};\n\nvar ltRE = /&lt;/g;\nvar gtRE = /&gt;/g;\nvar nlRE = /&#10;/g;\nvar ampRE = /&amp;/g;\nvar quoteRE = /&quot;/g;\n\nfunction decodeAttr (value, shouldDecodeNewlines) {\n  if (shouldDecodeNewlines) {\n    value = value.replace(nlRE, '\\n');\n  }\n  return value\n    .replace(ltRE, '<')\n    .replace(gtRE, '>')\n    .replace(ampRE, '&')\n    .replace(quoteRE, '\"')\n}\n\nfunction parseHTML (html, options) {\n  var stack = [];\n  var expectHTML = options.expectHTML;\n  var isUnaryTag$$1 = options.isUnaryTag || no;\n  var index = 0;\n  var last, lastTag;\n  while (html) {\n    last = html;\n    // Make sure we're not in a script or style element\n    if (!lastTag || !isSpecialTag(lastTag, options.sfc, stack)) {\n      var textEnd = html.indexOf('<');\n      if (textEnd === 0) {\n        // Comment:\n        if (comment.test(html)) {\n          var commentEnd = html.indexOf('-->');\n\n          if (commentEnd >= 0) {\n            advance(commentEnd + 3);\n            continue\n          }\n        }\n\n        // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n        if (conditionalComment.test(html)) {\n          var conditionalEnd = html.indexOf(']>');\n\n          if (conditionalEnd >= 0) {\n            advance(conditionalEnd + 2);\n            continue\n          }\n        }\n\n        // Doctype:\n        var doctypeMatch = html.match(doctype);\n        if (doctypeMatch) {\n          advance(doctypeMatch[0].length);\n          continue\n        }\n\n        // End tag:\n        var endTagMatch = html.match(endTag);\n        if (endTagMatch) {\n          var curIndex = index;\n          advance(endTagMatch[0].length);\n          parseEndTag(endTagMatch[0], endTagMatch[1], curIndex, index);\n          continue\n        }\n\n        // Start tag:\n        var startTagMatch = parseStartTag();\n        if (startTagMatch) {\n          handleStartTag(startTagMatch);\n          continue\n        }\n      }\n\n      var text = (void 0), rest$1 = (void 0), next = (void 0);\n      if (textEnd > 0) {\n        rest$1 = html.slice(textEnd);\n        while (\n          !endTag.test(rest$1) &&\n          !startTagOpen.test(rest$1) &&\n          !comment.test(rest$1) &&\n          !conditionalComment.test(rest$1)\n        ) {\n          // < in plain text, be forgiving and treat it as text\n          next = rest$1.indexOf('<', 1);\n          if (next < 0) { break }\n          textEnd += next;\n          rest$1 = html.slice(textEnd);\n        }\n        text = html.substring(0, textEnd);\n        advance(textEnd);\n      }\n\n      if (textEnd < 0) {\n        text = html;\n        html = '';\n      }\n\n      if (options.chars && text) {\n        options.chars(text);\n      }\n    } else {\n      var stackedTag = lastTag.toLowerCase();\n      var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n      var endTagLength = 0;\n      var rest = html.replace(reStackedTag, function (all, text, endTag) {\n        endTagLength = endTag.length;\n        if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {\n          text = text\n            .replace(/<!--([\\s\\S]*?)-->/g, '$1')\n            .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n        }\n        if (options.chars) {\n          options.chars(text);\n        }\n        return ''\n      });\n      index += html.length - rest.length;\n      html = rest;\n      parseEndTag('</' + stackedTag + '>', stackedTag, index - endTagLength, index);\n    }\n\n    if (html === last && options.chars) {\n      options.chars(html);\n      break\n    }\n  }\n\n  // Clean up any remaining tags\n  parseEndTag();\n\n  function advance (n) {\n    index += n;\n    html = html.substring(n);\n  }\n\n  function parseStartTag () {\n    var start = html.match(startTagOpen);\n    if (start) {\n      var match = {\n        tagName: start[1],\n        attrs: [],\n        start: index\n      };\n      advance(start[0].length);\n      var end, attr;\n      while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {\n        advance(attr[0].length);\n        match.attrs.push(attr);\n      }\n      if (end) {\n        match.unarySlash = end[1];\n        advance(end[0].length);\n        match.end = index;\n        return match\n      }\n    }\n  }\n\n  function handleStartTag (match) {\n    var tagName = match.tagName;\n    var unarySlash = match.unarySlash;\n\n    if (expectHTML) {\n      if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n        parseEndTag('', lastTag);\n      }\n      if (canBeLeftOpenTag(tagName) && lastTag === tagName) {\n        parseEndTag('', tagName);\n      }\n    }\n\n    var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;\n\n    var l = match.attrs.length;\n    var attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      var args = match.attrs[i];\n      // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778\n      if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('\"\"') === -1) {\n        if (args[3] === '') { delete args[3]; }\n        if (args[4] === '') { delete args[4]; }\n        if (args[5] === '') { delete args[5]; }\n      }\n      var value = args[3] || args[4] || args[5] || '';\n      attrs[i] = {\n        name: args[1],\n        value: decodeAttr(\n          value,\n          options.shouldDecodeNewlines\n        )\n      };\n    }\n\n    if (!unary) {\n      stack.push({ tag: tagName, attrs: attrs });\n      lastTag = tagName;\n      unarySlash = '';\n    }\n\n    if (options.start) {\n      options.start(tagName, attrs, unary, match.start, match.end);\n    }\n  }\n\n  function parseEndTag (tag, tagName, start, end) {\n    var pos;\n    if (start == null) { start = index; }\n    if (end == null) { end = index; }\n\n    // Find the closest opened tag of the same type\n    if (tagName) {\n      var needle = tagName.toLowerCase();\n      for (pos = stack.length - 1; pos >= 0; pos--) {\n        if (stack[pos].tag.toLowerCase() === needle) {\n          break\n        }\n      }\n    } else {\n      // If no tag name is provided, clean shop\n      pos = 0;\n    }\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (var i = stack.length - 1; i >= pos; i--) {\n        if (options.end) {\n          options.end(stack[i].tag, start, end);\n        }\n      }\n\n      // Remove the open elements from the stack\n      stack.length = pos;\n      lastTag = pos && stack[pos - 1].tag;\n    } else if (tagName.toLowerCase() === 'br') {\n      if (options.start) {\n        options.start(tagName, [], true, start, end);\n      }\n    } else if (tagName.toLowerCase() === 'p') {\n      if (options.start) {\n        options.start(tagName, [], false, start, end);\n      }\n      if (options.end) {\n        options.end(tagName, start, end);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction parseFilters (exp) {\n  var inSingle = false;\n  var inDouble = false;\n  var inTemplateString = false;\n  var inRegex = false;\n  var curly = 0;\n  var square = 0;\n  var paren = 0;\n  var lastFilterIndex = 0;\n  var c, prev, i, expression, filters;\n\n  for (i = 0; i < exp.length; i++) {\n    prev = c;\n    c = exp.charCodeAt(i);\n    if (inSingle) {\n      if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n    } else if (inDouble) {\n      if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n    } else if (inTemplateString) {\n      if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n    } else if (inRegex) {\n      if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n    } else if (\n      c === 0x7C && // pipe\n      exp.charCodeAt(i + 1) !== 0x7C &&\n      exp.charCodeAt(i - 1) !== 0x7C &&\n      !curly && !square && !paren\n    ) {\n      if (expression === undefined) {\n        // first filter, end of expression\n        lastFilterIndex = i + 1;\n        expression = exp.slice(0, i).trim();\n      } else {\n        pushFilter();\n      }\n    } else {\n      switch (c) {\n        case 0x22: inDouble = true; break         // \"\n        case 0x27: inSingle = true; break         // '\n        case 0x60: inTemplateString = true; break // `\n        case 0x2f: inRegex = true; break          // /\n        case 0x28: paren++; break                 // (\n        case 0x29: paren--; break                 // )\n        case 0x5B: square++; break                // [\n        case 0x5D: square--; break                // ]\n        case 0x7B: curly++; break                 // {\n        case 0x7D: curly--; break                 // }\n      }\n    }\n  }\n\n  if (expression === undefined) {\n    expression = exp.slice(0, i).trim();\n  } else if (lastFilterIndex !== 0) {\n    pushFilter();\n  }\n\n  function pushFilter () {\n    (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n    lastFilterIndex = i + 1;\n  }\n\n  if (filters) {\n    for (i = 0; i < filters.length; i++) {\n      expression = wrapFilter(expression, filters[i]);\n    }\n  }\n\n  return expression\n}\n\nfunction wrapFilter (exp, filter) {\n  var i = filter.indexOf('(');\n  if (i < 0) {\n    // _f: resolveFilter\n    return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n  } else {\n    var name = filter.slice(0, i);\n    var args = filter.slice(i + 1);\n    return (\"_f(\\\"\" + name + \"\\\")(\" + exp + \",\" + args)\n  }\n}\n\n/*  */\n\nvar defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g;\nvar regexEscapeRE = /[-.*+?^${}()|[\\]/\\\\]/g;\n\nvar buildRegex = cached(function (delimiters) {\n  var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n  var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n  return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n});\n\nfunction parseText (\n  text,\n  delimiters\n) {\n  var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n  if (!tagRE.test(text)) {\n    return\n  }\n  var tokens = [];\n  var lastIndex = tagRE.lastIndex = 0;\n  var match, index;\n  while ((match = tagRE.exec(text))) {\n    index = match.index;\n    // push text token\n    if (index > lastIndex) {\n      tokens.push(JSON.stringify(text.slice(lastIndex, index)));\n    }\n    // tag token\n    var exp = parseFilters(match[1].trim());\n    tokens.push((\"_s(\" + exp + \")\"));\n    lastIndex = index + match[0].length;\n  }\n  if (lastIndex < text.length) {\n    tokens.push(JSON.stringify(text.slice(lastIndex)));\n  }\n  return tokens.join('+')\n}\n\n/*  */\n\nfunction baseWarn (msg) {\n  console.error((\"[Vue parser]: \" + msg));\n}\n\nfunction pluckModuleFunction (\n  modules,\n  key\n) {\n  return modules\n    ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n    : []\n}\n\nfunction addProp (el, name, value) {\n  (el.props || (el.props = [])).push({ name: name, value: value });\n}\n\nfunction addAttr (el, name, value) {\n  (el.attrs || (el.attrs = [])).push({ name: name, value: value });\n}\n\nfunction addDirective (\n  el,\n  name,\n  rawName,\n  value,\n  arg,\n  modifiers\n) {\n  (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });\n}\n\nfunction addHandler (\n  el,\n  name,\n  value,\n  modifiers,\n  important\n) {\n  // check capture modifier\n  if (modifiers && modifiers.capture) {\n    delete modifiers.capture;\n    name = '!' + name; // mark the event as captured\n  }\n  if (modifiers && modifiers.once) {\n    delete modifiers.once;\n    name = '~' + name; // mark the event as once\n  }\n  var events;\n  if (modifiers && modifiers.native) {\n    delete modifiers.native;\n    events = el.nativeEvents || (el.nativeEvents = {});\n  } else {\n    events = el.events || (el.events = {});\n  }\n  var newHandler = { value: value, modifiers: modifiers };\n  var handlers = events[name];\n  /* istanbul ignore if */\n  if (Array.isArray(handlers)) {\n    important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n  } else if (handlers) {\n    events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n  } else {\n    events[name] = newHandler;\n  }\n}\n\nfunction getBindingAttr (\n  el,\n  name,\n  getStatic\n) {\n  var dynamicValue =\n    getAndRemoveAttr(el, ':' + name) ||\n    getAndRemoveAttr(el, 'v-bind:' + name);\n  if (dynamicValue != null) {\n    return parseFilters(dynamicValue)\n  } else if (getStatic !== false) {\n    var staticValue = getAndRemoveAttr(el, name);\n    if (staticValue != null) {\n      return JSON.stringify(staticValue)\n    }\n  }\n}\n\nfunction getAndRemoveAttr (el, name) {\n  var val;\n  if ((val = el.attrsMap[name]) != null) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      if (list[i].name === name) {\n        list.splice(i, 1);\n        break\n      }\n    }\n  }\n  return val\n}\n\nvar len;\nvar str;\nvar chr;\nvar index$1;\nvar expressionPos;\nvar expressionEndPos;\n\n/**\n * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)\n *\n * for loop possible cases:\n *\n * - test\n * - test[idx]\n * - test[test1[idx]]\n * - test[\"a\"][idx]\n * - xxx.test[a[a].test1[idx]]\n * - test.xxx.a[\"asa\"][test1[idx]]\n *\n */\n\nfunction parseModel (val) {\n  str = val;\n  len = str.length;\n  index$1 = expressionPos = expressionEndPos = 0;\n\n  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n    return {\n      exp: val,\n      idx: null\n    }\n  }\n\n  while (!eof()) {\n    chr = next();\n    /* istanbul ignore if */\n    if (isStringStart(chr)) {\n      parseString(chr);\n    } else if (chr === 0x5B) {\n      parseBracket(chr);\n    }\n  }\n\n  return {\n    exp: val.substring(0, expressionPos),\n    idx: val.substring(expressionPos + 1, expressionEndPos)\n  }\n}\n\nfunction next () {\n  return str.charCodeAt(++index$1)\n}\n\nfunction eof () {\n  return index$1 >= len\n}\n\nfunction isStringStart (chr) {\n  return chr === 0x22 || chr === 0x27\n}\n\nfunction parseBracket (chr) {\n  var inBracket = 1;\n  expressionPos = index$1;\n  while (!eof()) {\n    chr = next();\n    if (isStringStart(chr)) {\n      parseString(chr);\n      continue\n    }\n    if (chr === 0x5B) { inBracket++; }\n    if (chr === 0x5D) { inBracket--; }\n    if (inBracket === 0) {\n      expressionEndPos = index$1;\n      break\n    }\n  }\n}\n\nfunction parseString (chr) {\n  var stringQuote = chr;\n  while (!eof()) {\n    chr = next();\n    if (chr === stringQuote) {\n      break\n    }\n  }\n}\n\n/*  */\n\nvar dirRE = /^v-|^@|^:/;\nvar forAliasRE = /(.*?)\\s+(?:in|of)\\s+(.*)/;\nvar forIteratorRE = /\\((\\{[^}]*\\}|[^,]*),([^,]*)(?:,([^,]*))?\\)/;\nvar bindRE = /^:|^v-bind:/;\nvar onRE = /^@|^v-on:/;\nvar argRE = /:(.*)$/;\nvar modifierRE = /\\.[^.]+/g;\n\nvar decodeHTMLCached = cached(decode);\n\n// configurable state\nvar warn$1;\nvar platformGetTagNamespace;\nvar platformMustUseProp;\nvar platformIsPreTag;\nvar preTransforms;\nvar transforms;\nvar postTransforms;\nvar delimiters;\n\n/**\n * Convert HTML string to AST.\n */\nfunction parse (\n  template,\n  options\n) {\n  warn$1 = options.warn || baseWarn;\n  platformGetTagNamespace = options.getTagNamespace || no;\n  platformMustUseProp = options.mustUseProp || no;\n  platformIsPreTag = options.isPreTag || no;\n  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n  transforms = pluckModuleFunction(options.modules, 'transformNode');\n  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n  delimiters = options.delimiters;\n  var stack = [];\n  var preserveWhitespace = options.preserveWhitespace !== false;\n  var root;\n  var currentParent;\n  var inVPre = false;\n  var inPre = false;\n  var warned = false;\n  parseHTML(template, {\n    expectHTML: options.expectHTML,\n    isUnaryTag: options.isUnaryTag,\n    shouldDecodeNewlines: options.shouldDecodeNewlines,\n    start: function start (tag, attrs, unary) {\n      // check namespace.\n      // inherit parent ns if there is one\n      var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n      // handle IE svg bug\n      /* istanbul ignore if */\n      if (isIE && ns === 'svg') {\n        attrs = guardIESVGBug(attrs);\n      }\n\n      var element = {\n        type: 1,\n        tag: tag,\n        attrsList: attrs,\n        attrsMap: makeAttrsMap(attrs),\n        parent: currentParent,\n        children: []\n      };\n      if (ns) {\n        element.ns = ns;\n      }\n\n      if (isForbiddenTag(element) && !isServerRendering()) {\n        element.forbidden = true;\n        \"development\" !== 'production' && warn$1(\n          'Templates should only be responsible for mapping the state to the ' +\n          'UI. Avoid placing tags with side-effects in your templates, such as ' +\n          \"<\" + tag + \">.\"\n        );\n      }\n\n      // apply pre-transforms\n      for (var i = 0; i < preTransforms.length; i++) {\n        preTransforms[i](element, options);\n      }\n\n      if (!inVPre) {\n        processPre(element);\n        if (element.pre) {\n          inVPre = true;\n        }\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = true;\n      }\n      if (inVPre) {\n        processRawAttrs(element);\n      } else {\n        processFor(element);\n        processIf(element);\n        processOnce(element);\n        processKey(element);\n\n        // determine whether this is a plain element after\n        // removing structural attributes\n        element.plain = !element.key && !attrs.length;\n\n        processRef(element);\n        processSlot(element);\n        processComponent(element);\n        for (var i$1 = 0; i$1 < transforms.length; i$1++) {\n          transforms[i$1](element, options);\n        }\n        processAttrs(element);\n      }\n\n      function checkRootConstraints (el) {\n        if (\"development\" !== 'production' && !warned) {\n          if (el.tag === 'slot' || el.tag === 'template') {\n            warned = true;\n            warn$1(\n              \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n              'contain multiple nodes:\\n' + template\n            );\n          }\n          if (el.attrsMap.hasOwnProperty('v-for')) {\n            warned = true;\n            warn$1(\n              'Cannot use v-for on stateful component root element because ' +\n              'it renders multiple elements:\\n' + template\n            );\n          }\n        }\n      }\n\n      // tree management\n      if (!root) {\n        root = element;\n        checkRootConstraints(root);\n      } else if (!stack.length) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          checkRootConstraints(element);\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else if (\"development\" !== 'production' && !warned) {\n          warned = true;\n          warn$1(\n            \"Component template should contain exactly one root element:\" +\n            \"\\n\\n\" + template + \"\\n\\n\" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\"\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else if (element.slotScope) { // scoped slot\n          currentParent.plain = false;\n          var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n        } else {\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n      if (!unary) {\n        currentParent = element;\n        stack.push(element);\n      }\n      // apply post-transforms\n      for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {\n        postTransforms[i$2](element, options);\n      }\n    },\n\n    end: function end () {\n      // remove trailing whitespace\n      var element = stack[stack.length - 1];\n      var lastNode = element.children[element.children.length - 1];\n      if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {\n        element.children.pop();\n      }\n      // pop stack\n      stack.length -= 1;\n      currentParent = stack[stack.length - 1];\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n    },\n\n    chars: function chars (text) {\n      if (!currentParent) {\n        if (\"development\" !== 'production' && !warned && text === template) {\n          warned = true;\n          warn$1(\n            'Component template requires a root element, rather than just text:\\n\\n' + template\n          );\n        }\n        return\n      }\n      // IE textarea placeholder bug\n      /* istanbul ignore if */\n      if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text) {\n        return\n      }\n      text = inPre || text.trim()\n        ? decodeHTMLCached(text)\n        // only preserve whitespace if its not right after a starting tag\n        : preserveWhitespace && currentParent.children.length ? ' ' : '';\n      if (text) {\n        var expression;\n        if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {\n          currentParent.children.push({\n            type: 2,\n            expression: expression,\n            text: text\n          });\n        } else {\n          currentParent.children.push({\n            type: 3,\n            text: text\n          });\n        }\n      }\n    }\n  });\n  return root\n}\n\nfunction processPre (el) {\n  if (getAndRemoveAttr(el, 'v-pre') != null) {\n    el.pre = true;\n  }\n}\n\nfunction processRawAttrs (el) {\n  var l = el.attrsList.length;\n  if (l) {\n    var attrs = el.attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      attrs[i] = {\n        name: el.attrsList[i].name,\n        value: JSON.stringify(el.attrsList[i].value)\n      };\n    }\n  } else if (!el.pre) {\n    // non root node in pre blocks with no attributes\n    el.plain = true;\n  }\n}\n\nfunction processKey (el) {\n  var exp = getBindingAttr(el, 'key');\n  if (exp) {\n    if (\"development\" !== 'production' && el.tag === 'template') {\n      warn$1(\"<template> cannot be keyed. Place the key on real elements instead.\");\n    }\n    el.key = exp;\n  }\n}\n\nfunction processRef (el) {\n  var ref = getBindingAttr(el, 'ref');\n  if (ref) {\n    el.ref = ref;\n    el.refInFor = checkInFor(el);\n  }\n}\n\nfunction processFor (el) {\n  var exp;\n  if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) {\n      \"development\" !== 'production' && warn$1(\n        (\"Invalid v-for expression: \" + exp)\n      );\n      return\n    }\n    el.for = inMatch[2].trim();\n    var alias = inMatch[1].trim();\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      el.alias = iteratorMatch[1].trim();\n      el.iterator1 = iteratorMatch[2].trim();\n      if (iteratorMatch[3]) {\n        el.iterator2 = iteratorMatch[3].trim();\n      }\n    } else {\n      el.alias = alias;\n    }\n  }\n}\n\nfunction processIf (el) {\n  var exp = getAndRemoveAttr(el, 'v-if');\n  if (exp) {\n    el.if = exp;\n    addIfCondition(el, {\n      exp: exp,\n      block: el\n    });\n  } else {\n    if (getAndRemoveAttr(el, 'v-else') != null) {\n      el.else = true;\n    }\n    var elseif = getAndRemoveAttr(el, 'v-else-if');\n    if (elseif) {\n      el.elseif = elseif;\n    }\n  }\n}\n\nfunction processIfConditions (el, parent) {\n  var prev = findPrevElement(parent.children);\n  if (prev && prev.if) {\n    addIfCondition(prev, {\n      exp: el.elseif,\n      block: el\n    });\n  } else {\n    warn$1(\n      \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n      \"used on element <\" + (el.tag) + \"> without corresponding v-if.\"\n    );\n  }\n}\n\nfunction addIfCondition (el, condition) {\n  if (!el.ifConditions) {\n    el.ifConditions = [];\n  }\n  el.ifConditions.push(condition);\n}\n\nfunction processOnce (el) {\n  var once = getAndRemoveAttr(el, 'v-once');\n  if (once != null) {\n    el.once = true;\n  }\n}\n\nfunction processSlot (el) {\n  if (el.tag === 'slot') {\n    el.slotName = getBindingAttr(el, 'name');\n    if (\"development\" !== 'production' && el.key) {\n      warn$1(\n        \"`key` does not work on <slot> because slots are abstract outlets \" +\n        \"and can possibly expand into multiple elements. \" +\n        \"Use the key on a wrapping element instead.\"\n      );\n    }\n  } else {\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n    }\n    if (el.tag === 'template') {\n      el.slotScope = getAndRemoveAttr(el, 'scope');\n    }\n  }\n}\n\nfunction processComponent (el) {\n  var binding;\n  if ((binding = getBindingAttr(el, 'is'))) {\n    el.component = binding;\n  }\n  if (getAndRemoveAttr(el, 'inline-template') != null) {\n    el.inlineTemplate = true;\n  }\n}\n\nfunction processAttrs (el) {\n  var list = el.attrsList;\n  var i, l, name, rawName, value, arg, modifiers, isProp;\n  for (i = 0, l = list.length; i < l; i++) {\n    name = rawName = list[i].name;\n    value = list[i].value;\n    if (dirRE.test(name)) {\n      // mark element as dynamic\n      el.hasBindings = true;\n      // modifiers\n      modifiers = parseModifiers(name);\n      if (modifiers) {\n        name = name.replace(modifierRE, '');\n      }\n      if (bindRE.test(name)) { // v-bind\n        name = name.replace(bindRE, '');\n        value = parseFilters(value);\n        if (modifiers) {\n          if (modifiers.prop) {\n            isProp = true;\n            name = camelize(name);\n            if (name === 'innerHtml') { name = 'innerHTML'; }\n          }\n          if (modifiers.camel) {\n            name = camelize(name);\n          }\n        }\n        if (isProp || platformMustUseProp(el.tag, name)) {\n          addProp(el, name, value);\n        } else {\n          addAttr(el, name, value);\n        }\n      } else if (onRE.test(name)) { // v-on\n        name = name.replace(onRE, '');\n        addHandler(el, name, value, modifiers);\n      } else { // normal directives\n        name = name.replace(dirRE, '');\n        // parse arg\n        var argMatch = name.match(argRE);\n        if (argMatch && (arg = argMatch[1])) {\n          name = name.slice(0, -(arg.length + 1));\n        }\n        addDirective(el, name, rawName, value, arg, modifiers);\n        if (\"development\" !== 'production' && name === 'model') {\n          checkForAliasModel(el, value);\n        }\n      }\n    } else {\n      // literal attribute\n      {\n        var expression = parseText(value, delimiters);\n        if (expression) {\n          warn$1(\n            name + \"=\\\"\" + value + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.'\n          );\n        }\n      }\n      addAttr(el, name, JSON.stringify(value));\n    }\n  }\n}\n\nfunction checkInFor (el) {\n  var parent = el;\n  while (parent) {\n    if (parent.for !== undefined) {\n      return true\n    }\n    parent = parent.parent;\n  }\n  return false\n}\n\nfunction parseModifiers (name) {\n  var match = name.match(modifierRE);\n  if (match) {\n    var ret = {};\n    match.forEach(function (m) { ret[m.slice(1)] = true; });\n    return ret\n  }\n}\n\nfunction makeAttrsMap (attrs) {\n  var map = {};\n  for (var i = 0, l = attrs.length; i < l; i++) {\n    if (\"development\" !== 'production' && map[attrs[i].name] && !isIE) {\n      warn$1('duplicate attribute: ' + attrs[i].name);\n    }\n    map[attrs[i].name] = attrs[i].value;\n  }\n  return map\n}\n\nfunction findPrevElement (children) {\n  var i = children.length;\n  while (i--) {\n    if (children[i].tag) { return children[i] }\n  }\n}\n\nfunction isForbiddenTag (el) {\n  return (\n    el.tag === 'style' ||\n    (el.tag === 'script' && (\n      !el.attrsMap.type ||\n      el.attrsMap.type === 'text/javascript'\n    ))\n  )\n}\n\nvar ieNSBug = /^xmlns:NS\\d+/;\nvar ieNSPrefix = /^NS\\d+:/;\n\n/* istanbul ignore next */\nfunction guardIESVGBug (attrs) {\n  var res = [];\n  for (var i = 0; i < attrs.length; i++) {\n    var attr = attrs[i];\n    if (!ieNSBug.test(attr.name)) {\n      attr.name = attr.name.replace(ieNSPrefix, '');\n      res.push(attr);\n    }\n  }\n  return res\n}\n\nfunction checkForAliasModel (el, value) {\n  var _el = el;\n  while (_el) {\n    if (_el.for && _el.alias === value) {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"You are binding v-model directly to a v-for iteration alias. \" +\n        \"This will not be able to modify the v-for source array because \" +\n        \"writing to the alias is like modifying a function local variable. \" +\n        \"Consider using an array of objects and use v-model on an object property instead.\"\n      );\n    }\n    _el = _el.parent;\n  }\n}\n\n/*  */\n\nvar isStaticKey;\nvar isPlatformReservedTag;\n\nvar genStaticKeysCached = cached(genStaticKeys$1);\n\n/**\n * Goal of the optimizer: walk the generated template AST tree\n * and detect sub-trees that are purely static, i.e. parts of\n * the DOM that never needs to change.\n *\n * Once we detect these sub-trees, we can:\n *\n * 1. Hoist them into constants, so that we no longer need to\n *    create fresh nodes for them on each re-render;\n * 2. Completely skip them in the patching process.\n */\nfunction optimize (root, options) {\n  if (!root) { return }\n  isStaticKey = genStaticKeysCached(options.staticKeys || '');\n  isPlatformReservedTag = options.isReservedTag || no;\n  // first pass: mark all non-static nodes.\n  markStatic(root);\n  // second pass: mark static roots.\n  markStaticRoots(root, false);\n}\n\nfunction genStaticKeys$1 (keys) {\n  return makeMap(\n    'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +\n    (keys ? ',' + keys : '')\n  )\n}\n\nfunction markStatic (node) {\n  node.static = isStatic(node);\n  if (node.type === 1) {\n    // do not make component slot content static. this avoids\n    // 1. components not able to mutate slot nodes\n    // 2. static slot content fails for hot-reloading\n    if (\n      !isPlatformReservedTag(node.tag) &&\n      node.tag !== 'slot' &&\n      node.attrsMap['inline-template'] == null\n    ) {\n      return\n    }\n    for (var i = 0, l = node.children.length; i < l; i++) {\n      var child = node.children[i];\n      markStatic(child);\n      if (!child.static) {\n        node.static = false;\n      }\n    }\n  }\n}\n\nfunction markStaticRoots (node, isInFor) {\n  if (node.type === 1) {\n    if (node.static || node.once) {\n      node.staticInFor = isInFor;\n    }\n    // For a node to qualify as a static root, it should have children that\n    // are not just static text. Otherwise the cost of hoisting out will\n    // outweigh the benefits and it's better off to just always render it fresh.\n    if (node.static && node.children.length && !(\n      node.children.length === 1 &&\n      node.children[0].type === 3\n    )) {\n      node.staticRoot = true;\n      return\n    } else {\n      node.staticRoot = false;\n    }\n    if (node.children) {\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        markStaticRoots(node.children[i], isInFor || !!node.for);\n      }\n    }\n    if (node.ifConditions) {\n      walkThroughConditionsBlocks(node.ifConditions, isInFor);\n    }\n  }\n}\n\nfunction walkThroughConditionsBlocks (conditionBlocks, isInFor) {\n  for (var i = 1, len = conditionBlocks.length; i < len; i++) {\n    markStaticRoots(conditionBlocks[i].block, isInFor);\n  }\n}\n\nfunction isStatic (node) {\n  if (node.type === 2) { // expression\n    return false\n  }\n  if (node.type === 3) { // text\n    return true\n  }\n  return !!(node.pre || (\n    !node.hasBindings && // no dynamic bindings\n    !node.if && !node.for && // not v-if or v-for or v-else\n    !isBuiltInTag(node.tag) && // not a built-in\n    isPlatformReservedTag(node.tag) && // not a component\n    !isDirectChildOfTemplateFor(node) &&\n    Object.keys(node).every(isStaticKey)\n  ))\n}\n\nfunction isDirectChildOfTemplateFor (node) {\n  while (node.parent) {\n    node = node.parent;\n    if (node.tag !== 'template') {\n      return false\n    }\n    if (node.for) {\n      return true\n    }\n  }\n  return false\n}\n\n/*  */\n\nvar fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\nvar simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/;\n\n// keyCode aliases\nvar keyCodes = {\n  esc: 27,\n  tab: 9,\n  enter: 13,\n  space: 32,\n  up: 38,\n  left: 37,\n  right: 39,\n  down: 40,\n  'delete': [8, 46]\n};\n\nvar modifierCode = {\n  stop: '$event.stopPropagation();',\n  prevent: '$event.preventDefault();',\n  self: 'if($event.target !== $event.currentTarget)return;',\n  ctrl: 'if(!$event.ctrlKey)return;',\n  shift: 'if(!$event.shiftKey)return;',\n  alt: 'if(!$event.altKey)return;',\n  meta: 'if(!$event.metaKey)return;'\n};\n\nfunction genHandlers (events, native) {\n  var res = native ? 'nativeOn:{' : 'on:{';\n  for (var name in events) {\n    res += \"\\\"\" + name + \"\\\":\" + (genHandler(name, events[name])) + \",\";\n  }\n  return res.slice(0, -1) + '}'\n}\n\nfunction genHandler (\n  name,\n  handler\n) {\n  if (!handler) {\n    return 'function(){}'\n  } else if (Array.isArray(handler)) {\n    return (\"[\" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + \"]\")\n  } else if (!handler.modifiers) {\n    return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)\n      ? handler.value\n      : (\"function($event){\" + (handler.value) + \"}\")\n  } else {\n    var code = '';\n    var keys = [];\n    for (var key in handler.modifiers) {\n      if (modifierCode[key]) {\n        code += modifierCode[key];\n      } else {\n        keys.push(key);\n      }\n    }\n    if (keys.length) {\n      code = genKeyFilter(keys) + code;\n    }\n    var handlerCode = simplePathRE.test(handler.value)\n      ? handler.value + '($event)'\n      : handler.value;\n    return 'function($event){' + code + handlerCode + '}'\n  }\n}\n\nfunction genKeyFilter (keys) {\n  return (\"if(\" + (keys.map(genFilterCode).join('&&')) + \")return;\")\n}\n\nfunction genFilterCode (key) {\n  var keyVal = parseInt(key, 10);\n  if (keyVal) {\n    return (\"$event.keyCode!==\" + keyVal)\n  }\n  var alias = keyCodes[key];\n  return (\"_k($event.keyCode,\" + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + \")\")\n}\n\n/*  */\n\nfunction bind$2 (el, dir) {\n  el.wrapData = function (code) {\n    return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + \")\")\n  };\n}\n\nvar baseDirectives = {\n  bind: bind$2,\n  cloak: noop\n};\n\n/*  */\n\n// configurable state\nvar warn$2;\nvar transforms$1;\nvar dataGenFns;\nvar platformDirectives$1;\nvar staticRenderFns;\nvar onceCount;\nvar currentOptions;\n\nfunction generate (\n  ast,\n  options\n) {\n  // save previous staticRenderFns so generate calls can be nested\n  var prevStaticRenderFns = staticRenderFns;\n  var currentStaticRenderFns = staticRenderFns = [];\n  var prevOnceCount = onceCount;\n  onceCount = 0;\n  currentOptions = options;\n  warn$2 = options.warn || baseWarn;\n  transforms$1 = pluckModuleFunction(options.modules, 'transformCode');\n  dataGenFns = pluckModuleFunction(options.modules, 'genData');\n  platformDirectives$1 = options.directives || {};\n  var code = ast ? genElement(ast) : '_h(\"div\")';\n  staticRenderFns = prevStaticRenderFns;\n  onceCount = prevOnceCount;\n  return {\n    render: (\"with(this){return \" + code + \"}\"),\n    staticRenderFns: currentStaticRenderFns\n  }\n}\n\nfunction genElement (el) {\n  if (el.staticRoot && !el.staticProcessed) {\n    return genStatic(el)\n  } else if (el.once && !el.onceProcessed) {\n    return genOnce(el)\n  } else if (el.for && !el.forProcessed) {\n    return genFor(el)\n  } else if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.tag === 'template' && !el.slotTarget) {\n    return genChildren(el) || 'void 0'\n  } else if (el.tag === 'slot') {\n    return genSlot(el)\n  } else {\n    // component or element\n    var code;\n    if (el.component) {\n      code = genComponent(el.component, el);\n    } else {\n      var data = el.plain ? undefined : genData(el);\n\n      var children = el.inlineTemplate ? null : genChildren(el);\n      code = \"_h('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n    }\n    // module transforms\n    for (var i = 0; i < transforms$1.length; i++) {\n      code = transforms$1[i](el, code);\n    }\n    return code\n  }\n}\n\n// hoist static sub-trees out\nfunction genStatic (el) {\n  el.staticProcessed = true;\n  staticRenderFns.push((\"with(this){return \" + (genElement(el)) + \"}\"));\n  return (\"_m(\" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n}\n\n// v-once\nfunction genOnce (el) {\n  el.onceProcessed = true;\n  if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.staticInFor) {\n    var key = '';\n    var parent = el.parent;\n    while (parent) {\n      if (parent.for) {\n        key = parent.key;\n        break\n      }\n      parent = parent.parent;\n    }\n    if (!key) {\n      \"development\" !== 'production' && warn$2(\n        \"v-once can only be used inside v-for that is keyed. \"\n      );\n      return genElement(el)\n    }\n    return (\"_o(\" + (genElement(el)) + \",\" + (onceCount++) + (key ? (\",\" + key) : \"\") + \")\")\n  } else {\n    return genStatic(el)\n  }\n}\n\nfunction genIf (el) {\n  el.ifProcessed = true; // avoid recursion\n  return genIfConditions(el.ifConditions.slice())\n}\n\nfunction genIfConditions (conditions) {\n  if (!conditions.length) {\n    return '_e()'\n  }\n\n  var condition = conditions.shift();\n  if (condition.exp) {\n    return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions)))\n  } else {\n    return (\"\" + (genTernaryExp(condition.block)))\n  }\n\n  // v-if with v-once should generate code like (a)?_m(0):_m(1)\n  function genTernaryExp (el) {\n    return el.once ? genOnce(el) : genElement(el)\n  }\n}\n\nfunction genFor (el) {\n  var exp = el.for;\n  var alias = el.alias;\n  var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n  var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n  el.forProcessed = true; // avoid recursion\n  return \"_l((\" + exp + \"),\" +\n    \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n      \"return \" + (genElement(el)) +\n    '})'\n}\n\nfunction genData (el) {\n  var data = '{';\n\n  // directives first.\n  // directives may mutate the el's other properties before they are generated.\n  var dirs = genDirectives(el);\n  if (dirs) { data += dirs + ','; }\n\n  // key\n  if (el.key) {\n    data += \"key:\" + (el.key) + \",\";\n  }\n  // ref\n  if (el.ref) {\n    data += \"ref:\" + (el.ref) + \",\";\n  }\n  if (el.refInFor) {\n    data += \"refInFor:true,\";\n  }\n  // pre\n  if (el.pre) {\n    data += \"pre:true,\";\n  }\n  // record original tag name for components using \"is\" attribute\n  if (el.component) {\n    data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n  }\n  // module data generation functions\n  for (var i = 0; i < dataGenFns.length; i++) {\n    data += dataGenFns[i](el);\n  }\n  // attributes\n  if (el.attrs) {\n    data += \"attrs:{\" + (genProps(el.attrs)) + \"},\";\n  }\n  // DOM props\n  if (el.props) {\n    data += \"domProps:{\" + (genProps(el.props)) + \"},\";\n  }\n  // event handlers\n  if (el.events) {\n    data += (genHandlers(el.events)) + \",\";\n  }\n  if (el.nativeEvents) {\n    data += (genHandlers(el.nativeEvents, true)) + \",\";\n  }\n  // slot target\n  if (el.slotTarget) {\n    data += \"slot:\" + (el.slotTarget) + \",\";\n  }\n  // scoped slots\n  if (el.scopedSlots) {\n    data += (genScopedSlots(el.scopedSlots)) + \",\";\n  }\n  // inline-template\n  if (el.inlineTemplate) {\n    var inlineTemplate = genInlineTemplate(el);\n    if (inlineTemplate) {\n      data += inlineTemplate + \",\";\n    }\n  }\n  data = data.replace(/,$/, '') + '}';\n  // v-bind data wrap\n  if (el.wrapData) {\n    data = el.wrapData(data);\n  }\n  return data\n}\n\nfunction genDirectives (el) {\n  var dirs = el.directives;\n  if (!dirs) { return }\n  var res = 'directives:[';\n  var hasRuntime = false;\n  var i, l, dir, needRuntime;\n  for (i = 0, l = dirs.length; i < l; i++) {\n    dir = dirs[i];\n    needRuntime = true;\n    var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];\n    if (gen) {\n      // compile-time directive that manipulates AST.\n      // returns true if it also needs a runtime counterpart.\n      needRuntime = !!gen(el, dir, warn$2);\n    }\n    if (needRuntime) {\n      hasRuntime = true;\n      res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\\\"\" + (dir.arg) + \"\\\"\") : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n    }\n  }\n  if (hasRuntime) {\n    return res.slice(0, -1) + ']'\n  }\n}\n\nfunction genInlineTemplate (el) {\n  var ast = el.children[0];\n  if (\"development\" !== 'production' && (\n    el.children.length > 1 || ast.type !== 1\n  )) {\n    warn$2('Inline-template components must have exactly one child element.');\n  }\n  if (ast.type === 1) {\n    var inlineRenderFns = generate(ast, currentOptions);\n    return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n  }\n}\n\nfunction genScopedSlots (slots) {\n  return (\"scopedSlots:{\" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + \"}\")\n}\n\nfunction genScopedSlot (key, el) {\n  return key + \":function(\" + (String(el.attrsMap.scope)) + \"){\" +\n    \"return \" + (el.tag === 'template'\n      ? genChildren(el) || 'void 0'\n      : genElement(el)) + \"}\"\n}\n\nfunction genChildren (el) {\n  if (el.children.length) {\n    return '[' + el.children.map(genNode).join(',') + ']'\n  }\n}\n\nfunction genNode (node) {\n  if (node.type === 1) {\n    return genElement(node)\n  } else {\n    return genText(node)\n  }\n}\n\nfunction genText (text) {\n  return text.type === 2\n    ? text.expression // no need for () because already wrapped in _s()\n    : transformSpecialNewlines(JSON.stringify(text.text))\n}\n\nfunction genSlot (el) {\n  var slotName = el.slotName || '\"default\"';\n  var children = genChildren(el);\n  return (\"_t(\" + slotName + (children ? (\",\" + children) : '') + (el.attrs ? ((children ? '' : ',null') + \",{\" + (el.attrs.map(function (a) { return ((camelize(a.name)) + \":\" + (a.value)); }).join(',')) + \"}\") : '') + \")\")\n}\n\n// componentName is el.component, take it as argument to shun flow's pessimistic refinement\nfunction genComponent (componentName, el) {\n  var children = el.inlineTemplate ? null : genChildren(el);\n  return (\"_h(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}\n\nfunction genProps (props) {\n  var res = '';\n  for (var i = 0; i < props.length; i++) {\n    var prop = props[i];\n    res += \"\\\"\" + (prop.name) + \"\\\":\" + (transformSpecialNewlines(prop.value)) + \",\";\n  }\n  return res.slice(0, -1)\n}\n\n// #3895, #4268\nfunction transformSpecialNewlines (text) {\n  return text\n    .replace(/\\u2028/g, '\\\\u2028')\n    .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/*  */\n\n/**\n * Compile a template.\n */\nfunction compile$1 (\n  template,\n  options\n) {\n  var ast = parse(template.trim(), options);\n  optimize(ast, options);\n  var code = generate(ast, options);\n  return {\n    ast: ast,\n    render: code.render,\n    staticRenderFns: code.staticRenderFns\n  }\n}\n\n/*  */\n\n// operators like typeof, instanceof and in are allowed\nvar prohibitedKeywordRE = new RegExp('\\\\b' + (\n  'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n  'super,throw,while,yield,delete,export,import,return,switch,default,' +\n  'extends,finally,continue,debugger,function,arguments'\n).split(',').join('\\\\b|\\\\b') + '\\\\b');\n// check valid identifier for v-for\nvar identRE = /[A-Za-z_$][\\w$]*/;\n// strip strings in expressions\nvar stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n// detect problematic expressions in a template\nfunction detectErrors (ast) {\n  var errors = [];\n  if (ast) {\n    checkNode(ast, errors);\n  }\n  return errors\n}\n\nfunction checkNode (node, errors) {\n  if (node.type === 1) {\n    for (var name in node.attrsMap) {\n      if (dirRE.test(name)) {\n        var value = node.attrsMap[name];\n        if (value) {\n          if (name === 'v-for') {\n            checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), errors);\n          } else {\n            checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), errors);\n          }\n        }\n      }\n    }\n    if (node.children) {\n      for (var i = 0; i < node.children.length; i++) {\n        checkNode(node.children[i], errors);\n      }\n    }\n  } else if (node.type === 2) {\n    checkExpression(node.expression, node.text, errors);\n  }\n}\n\nfunction checkFor (node, text, errors) {\n  checkExpression(node.for || '', text, errors);\n  checkIdentifier(node.alias, 'v-for alias', text, errors);\n  checkIdentifier(node.iterator1, 'v-for iterator', text, errors);\n  checkIdentifier(node.iterator2, 'v-for iterator', text, errors);\n}\n\nfunction checkIdentifier (ident, type, text, errors) {\n  if (typeof ident === 'string' && !identRE.test(ident)) {\n    errors.push((\"- invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + text));\n  }\n}\n\nfunction checkExpression (exp, text, errors) {\n  try {\n    new Function((\"return \" + exp));\n  } catch (e) {\n    var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n    if (keywordMatch) {\n      errors.push(\n        \"- avoid using JavaScript keyword as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + text\n      );\n    } else {\n      errors.push((\"- invalid expression: \" + text));\n    }\n  }\n}\n\n/*  */\n\nfunction transformNode (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticClass = getAndRemoveAttr(el, 'class');\n  if (\"development\" !== 'production' && staticClass) {\n    var expression = parseText(staticClass, options.delimiters);\n    if (expression) {\n      warn(\n        \"class=\\\"\" + staticClass + \"\\\": \" +\n        'Interpolation inside attributes has been removed. ' +\n        'Use v-bind or the colon shorthand instead. For example, ' +\n        'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.'\n      );\n    }\n  }\n  if (staticClass) {\n    el.staticClass = JSON.stringify(staticClass);\n  }\n  var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n  if (classBinding) {\n    el.classBinding = classBinding;\n  }\n}\n\nfunction genData$1 (el) {\n  var data = '';\n  if (el.staticClass) {\n    data += \"staticClass:\" + (el.staticClass) + \",\";\n  }\n  if (el.classBinding) {\n    data += \"class:\" + (el.classBinding) + \",\";\n  }\n  return data\n}\n\nvar klass$1 = {\n  staticKeys: ['staticClass'],\n  transformNode: transformNode,\n  genData: genData$1\n};\n\n/*  */\n\nfunction transformNode$1 (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticStyle = getAndRemoveAttr(el, 'style');\n  if (staticStyle) {\n    /* istanbul ignore if */\n    {\n      var expression = parseText(staticStyle, options.delimiters);\n      if (expression) {\n        warn(\n          \"style=\\\"\" + staticStyle + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.'\n        );\n      }\n    }\n    el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n  }\n\n  var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n  if (styleBinding) {\n    el.styleBinding = styleBinding;\n  }\n}\n\nfunction genData$2 (el) {\n  var data = '';\n  if (el.staticStyle) {\n    data += \"staticStyle:\" + (el.staticStyle) + \",\";\n  }\n  if (el.styleBinding) {\n    data += \"style:(\" + (el.styleBinding) + \"),\";\n  }\n  return data\n}\n\nvar style$1 = {\n  staticKeys: ['staticStyle'],\n  transformNode: transformNode$1,\n  genData: genData$2\n};\n\nvar modules$1 = [\n  klass$1,\n  style$1\n];\n\n/*  */\n\nvar warn$3;\n\nfunction model$1 (\n  el,\n  dir,\n  _warn\n) {\n  warn$3 = _warn;\n  var value = dir.value;\n  var modifiers = dir.modifiers;\n  var tag = el.tag;\n  var type = el.attrsMap.type;\n  {\n    var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n    if (tag === 'input' && dynamicType) {\n      warn$3(\n        \"<input :type=\\\"\" + dynamicType + \"\\\" v-model=\\\"\" + value + \"\\\">:\\n\" +\n        \"v-model does not support dynamic input types. Use v-if branches instead.\"\n      );\n    }\n  }\n  if (tag === 'select') {\n    genSelect(el, value, modifiers);\n  } else if (tag === 'input' && type === 'checkbox') {\n    genCheckboxModel(el, value, modifiers);\n  } else if (tag === 'input' && type === 'radio') {\n    genRadioModel(el, value, modifiers);\n  } else {\n    genDefaultModel(el, value, modifiers);\n  }\n  // ensure runtime directive metadata\n  return true\n}\n\nfunction genCheckboxModel (\n  el,\n  value,\n  modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n  var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n  addProp(el, 'checked',\n    \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" +\n      \":_q(\" + value + \",\" + trueValueBinding + \")\"\n  );\n  addHandler(el, 'change',\n    \"var $$a=\" + value + \",\" +\n        '$$el=$event.target,' +\n        \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n    'if(Array.isArray($$a)){' +\n      \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n          '$$i=_i($$a,$$v);' +\n      \"if($$c){$$i<0&&(\" + value + \"=$$a.concat($$v))}\" +\n      \"else{$$i>-1&&(\" + value + \"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}\" +\n    \"}else{\" + value + \"=$$c}\",\n    null, true\n  );\n}\n\nfunction genRadioModel (\n    el,\n    value,\n    modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n  addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n  addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n}\n\nfunction genDefaultModel (\n  el,\n  value,\n  modifiers\n) {\n  {\n    if (el.tag === 'input' && el.attrsMap.value) {\n      warn$3(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" value=\\\"\" + (el.attrsMap.value) + \"\\\">:\\n\" +\n        'inline value attributes will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n    if (el.tag === 'textarea' && el.children.length) {\n      warn$3(\n        \"<textarea v-model=\\\"\" + value + \"\\\">:\\n\" +\n        'inline content inside <textarea> will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n  }\n\n  var type = el.attrsMap.type;\n  var ref = modifiers || {};\n  var lazy = ref.lazy;\n  var number = ref.number;\n  var trim = ref.trim;\n  var event = lazy || (isIE && type === 'range') ? 'change' : 'input';\n  var needCompositionGuard = !lazy && type !== 'range';\n  var isNative = el.tag === 'input' || el.tag === 'textarea';\n\n  var valueExpression = isNative\n    ? (\"$event.target.value\" + (trim ? '.trim()' : ''))\n    : trim ? \"(typeof $event === 'string' ? $event.trim() : $event)\" : \"$event\";\n  valueExpression = number || type === 'number'\n    ? (\"_n(\" + valueExpression + \")\")\n    : valueExpression;\n  var code = genAssignmentCode(value, valueExpression);\n  if (isNative && needCompositionGuard) {\n    code = \"if($event.target.composing)return;\" + code;\n  }\n  // inputs with type=\"file\" are read only and setting the input's\n  // value will throw an error.\n  if (\"development\" !== 'production' &&\n      type === 'file') {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n      \"File inputs are read only. Use a v-on:change listener instead.\"\n    );\n  }\n  addProp(el, 'value', isNative ? (\"_s(\" + value + \")\") : (\"(\" + value + \")\"));\n  addHandler(el, event, code, null, true);\n}\n\nfunction genSelect (\n    el,\n    value,\n    modifiers\n) {\n  {\n    el.children.some(checkOptionWarning);\n  }\n\n  var number = modifiers && modifiers.number;\n  var assignment = \"Array.prototype.filter\" +\n    \".call($event.target.options,function(o){return o.selected})\" +\n    \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n    \"return \" + (number ? '_n(val)' : 'val') + \"})\" +\n    (el.attrsMap.multiple == null ? '[0]' : '');\n\n  var code = genAssignmentCode(value, assignment);\n  addHandler(el, 'change', code, null, true);\n}\n\nfunction checkOptionWarning (option) {\n  if (option.type === 1 &&\n    option.tag === 'option' &&\n    option.attrsMap.selected != null) {\n    warn$3(\n      \"<select v-model=\\\"\" + (option.parent.attrsMap['v-model']) + \"\\\">:\\n\" +\n      'inline selected attributes on <option> will be ignored when using v-model. ' +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n    return true\n  }\n  return false\n}\n\nfunction genAssignmentCode (value, assignment) {\n  var modelRs = parseModel(value);\n  if (modelRs.idx === null) {\n    return (value + \"=\" + assignment)\n  } else {\n    return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n      \"if (!Array.isArray($$exp)){\" +\n        value + \"=\" + assignment + \"}\" +\n      \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n  }\n}\n\n/*  */\n\nfunction text (el, dir) {\n  if (dir.value) {\n    addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\n/*  */\n\nfunction html (el, dir) {\n  if (dir.value) {\n    addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\nvar directives$1 = {\n  model: model$1,\n  text: text,\n  html: html\n};\n\n/*  */\n\nvar cache = Object.create(null);\n\nvar baseOptions = {\n  expectHTML: true,\n  modules: modules$1,\n  staticKeys: genStaticKeys(modules$1),\n  directives: directives$1,\n  isReservedTag: isReservedTag,\n  isUnaryTag: isUnaryTag,\n  mustUseProp: mustUseProp,\n  getTagNamespace: getTagNamespace,\n  isPreTag: isPreTag\n};\n\nfunction compile$$1 (\n  template,\n  options\n) {\n  options = options\n    ? extend(extend({}, baseOptions), options)\n    : baseOptions;\n  return compile$1(template, options)\n}\n\nfunction compileToFunctions (\n  template,\n  options,\n  vm\n) {\n  var _warn = (options && options.warn) || warn;\n  // detect possible CSP restriction\n  /* istanbul ignore if */\n  {\n    try {\n      new Function('return 1');\n    } catch (e) {\n      if (e.toString().match(/unsafe-eval|CSP/)) {\n        _warn(\n          'It seems you are using the standalone build of Vue.js in an ' +\n          'environment with Content Security Policy that prohibits unsafe-eval. ' +\n          'The template compiler cannot work in this environment. Consider ' +\n          'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n          'templates into render functions.'\n        );\n      }\n    }\n  }\n  var key = options && options.delimiters\n    ? String(options.delimiters) + template\n    : template;\n  if (cache[key]) {\n    return cache[key]\n  }\n  var res = {};\n  var compiled = compile$$1(template, options);\n  res.render = makeFunction(compiled.render);\n  var l = compiled.staticRenderFns.length;\n  res.staticRenderFns = new Array(l);\n  for (var i = 0; i < l; i++) {\n    res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);\n  }\n  {\n    if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {\n      _warn(\n        \"failed to compile template:\\n\\n\" + template + \"\\n\\n\" +\n        detectErrors(compiled.ast).join('\\n') +\n        '\\n\\n',\n        vm\n      );\n    }\n  }\n  return (cache[key] = res)\n}\n\nfunction makeFunction (code) {\n  try {\n    return new Function(code)\n  } catch (e) {\n    return noop\n  }\n}\n\n/*  */\n\nvar idToTemplate = cached(function (id) {\n  var el = query(id);\n  return el && el.innerHTML\n});\n\nvar mount = Vue$3.prototype.$mount;\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && query(el);\n\n  /* istanbul ignore if */\n  if (el === document.body || el === document.documentElement) {\n    \"development\" !== 'production' && warn(\n      \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n    );\n    return this\n  }\n\n  var options = this.$options;\n  // resolve template/el and convert to render function\n  if (!options.render) {\n    var template = options.template;\n    if (template) {\n      if (typeof template === 'string') {\n        if (template.charAt(0) === '#') {\n          template = idToTemplate(template);\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !template) {\n            warn(\n              (\"Template element not found or is empty: \" + (options.template)),\n              this\n            );\n          }\n        }\n      } else if (template.nodeType) {\n        template = template.innerHTML;\n      } else {\n        {\n          warn('invalid template option:' + template, this);\n        }\n        return this\n      }\n    } else if (el) {\n      template = getOuterHTML(el);\n    }\n    if (template) {\n      var ref = compileToFunctions(template, {\n        warn: warn,\n        shouldDecodeNewlines: shouldDecodeNewlines,\n        delimiters: options.delimiters\n      }, this);\n      var render = ref.render;\n      var staticRenderFns = ref.staticRenderFns;\n      options.render = render;\n      options.staticRenderFns = staticRenderFns;\n    }\n  }\n  return mount.call(this, el, hydrating)\n};\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n */\nfunction getOuterHTML (el) {\n  if (el.outerHTML) {\n    return el.outerHTML\n  } else {\n    var container = document.createElement('div');\n    container.appendChild(el.cloneNode(true));\n    return container.innerHTML\n  }\n}\n\nVue$3.compile = compileToFunctions;\n\nreturn Vue$3;\n\n})));"
  },
  {
    "path": "vue/im/lib/vue-router-2.1.1.js",
    "content": "/**\n  * vue-router v2.1.1\n  * (c) 2016 Evan You\n  * @license MIT\n  */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.VueRouter = factory());\n}(this, (function () { 'use strict';\n\nvar View = {\n  name: 'router-view',\n  functional: true,\n  props: {\n    name: {\n      type: String,\n      default: 'default'\n    }\n  },\n  render: function render (h, ref) {\n    var props = ref.props;\n    var children = ref.children;\n    var parent = ref.parent;\n    var data = ref.data;\n\n    data.routerView = true\n\n    var route = parent.$route\n    var cache = parent._routerViewCache || (parent._routerViewCache = {})\n    var depth = 0\n    var inactive = false\n\n    while (parent) {\n      if (parent.$vnode && parent.$vnode.data.routerView) {\n        depth++\n      }\n      if (parent._inactive) {\n        inactive = true\n      }\n      parent = parent.$parent\n    }\n\n    data.routerViewDepth = depth\n    var matched = route.matched[depth]\n    if (!matched) {\n      return h()\n    }\n\n    var name = props.name\n    var component = inactive\n      ? cache[name]\n      : (cache[name] = matched.components[name])\n\n    if (!inactive) {\n      var hooks = data.hook || (data.hook = {})\n      hooks.init = function (vnode) {\n        matched.instances[name] = vnode.child\n      }\n      hooks.prepatch = function (oldVnode, vnode) {\n        matched.instances[name] = vnode.child\n      }\n      hooks.destroy = function (vnode) {\n        if (matched.instances[name] === vnode.child) {\n          matched.instances[name] = undefined\n        }\n      }\n    }\n\n    return h(component, data, children)\n  }\n}\n\n/*  */\n\nfunction assert (condition, message) {\n  if (!condition) {\n    throw new Error((\"[vue-router] \" + message))\n  }\n}\n\nfunction warn (condition, message) {\n  if (!condition) {\n    typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message))\n  }\n}\n\n/*  */\n\nvar encode = encodeURIComponent\nvar decode = decodeURIComponent\n\nfunction resolveQuery (\n  query,\n  extraQuery\n) {\n  if ( extraQuery === void 0 ) extraQuery = {};\n\n  if (query) {\n    var parsedQuery\n    try {\n      parsedQuery = parseQuery(query)\n    } catch (e) {\n      \"development\" !== 'production' && warn(false, e.message)\n      parsedQuery = {}\n    }\n    for (var key in extraQuery) {\n      parsedQuery[key] = extraQuery[key]\n    }\n    return parsedQuery\n  } else {\n    return extraQuery\n  }\n}\n\nfunction parseQuery (query) {\n  var res = {}\n\n  query = query.trim().replace(/^(\\?|#|&)/, '')\n\n  if (!query) {\n    return res\n  }\n\n  query.split('&').forEach(function (param) {\n    var parts = param.replace(/\\+/g, ' ').split('=')\n    var key = decode(parts.shift())\n    var val = parts.length > 0\n      ? decode(parts.join('='))\n      : null\n\n    if (res[key] === undefined) {\n      res[key] = val\n    } else if (Array.isArray(res[key])) {\n      res[key].push(val)\n    } else {\n      res[key] = [res[key], val]\n    }\n  })\n\n  return res\n}\n\nfunction stringifyQuery (obj) {\n  var res = obj ? Object.keys(obj).map(function (key) {\n    var val = obj[key]\n\n    if (val === undefined) {\n      return ''\n    }\n\n    if (val === null) {\n      return encode(key)\n    }\n\n    if (Array.isArray(val)) {\n      var result = []\n      val.slice().forEach(function (val2) {\n        if (val2 === undefined) {\n          return\n        }\n        if (val2 === null) {\n          result.push(encode(key))\n        } else {\n          result.push(encode(key) + '=' + encode(val2))\n        }\n      })\n      return result.join('&')\n    }\n\n    return encode(key) + '=' + encode(val)\n  }).filter(function (x) { return x.length > 0; }).join('&') : null\n  return res ? (\"?\" + res) : ''\n}\n\n/*  */\n\nfunction createRoute (\n  record,\n  location,\n  redirectedFrom\n) {\n  var route = {\n    name: location.name || (record && record.name),\n    meta: (record && record.meta) || {},\n    path: location.path || '/',\n    hash: location.hash || '',\n    query: location.query || {},\n    params: location.params || {},\n    fullPath: getFullPath(location),\n    matched: record ? formatMatch(record) : []\n  }\n  if (redirectedFrom) {\n    route.redirectedFrom = getFullPath(redirectedFrom)\n  }\n  return Object.freeze(route)\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n  path: '/'\n})\n\nfunction formatMatch (record) {\n  var res = []\n  while (record) {\n    res.unshift(record)\n    record = record.parent\n  }\n  return res\n}\n\nfunction getFullPath (ref) {\n  var path = ref.path;\n  var query = ref.query; if ( query === void 0 ) query = {};\n  var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n  return (path || '/') + stringifyQuery(query) + hash\n}\n\nvar trailingSlashRE = /\\/$/\nfunction isSameRoute (a, b) {\n  if (b === START) {\n    return a === b\n  } else if (!b) {\n    return false\n  } else if (a.path && b.path) {\n    return (\n      a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query)\n    )\n  } else if (a.name && b.name) {\n    return (\n      a.name === b.name &&\n      a.hash === b.hash &&\n      isObjectEqual(a.query, b.query) &&\n      isObjectEqual(a.params, b.params)\n    )\n  } else {\n    return false\n  }\n}\n\nfunction isObjectEqual (a, b) {\n  if ( a === void 0 ) a = {};\n  if ( b === void 0 ) b = {};\n\n  var aKeys = Object.keys(a)\n  var bKeys = Object.keys(b)\n  if (aKeys.length !== bKeys.length) {\n    return false\n  }\n  return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })\n}\n\nfunction isIncludedRoute (current, target) {\n  return (\n    current.path.indexOf(target.path.replace(/\\/$/, '')) === 0 &&\n    (!target.hash || current.hash === target.hash) &&\n    queryIncludes(current.query, target.query)\n  )\n}\n\nfunction queryIncludes (current, target) {\n  for (var key in target) {\n    if (!(key in current)) {\n      return false\n    }\n  }\n  return true\n}\n\n/*  */\n\n// work around weird flow bug\nvar toTypes = [String, Object]\n\nvar Link = {\n  name: 'router-link',\n  props: {\n    to: {\n      type: toTypes,\n      required: true\n    },\n    tag: {\n      type: String,\n      default: 'a'\n    },\n    exact: Boolean,\n    append: Boolean,\n    replace: Boolean,\n    activeClass: String,\n    event: {\n      type: [String, Array],\n      default: 'click'\n    }\n  },\n  render: function render (h) {\n    var this$1 = this;\n\n    var router = this.$router\n    var current = this.$route\n    var ref = router.resolve(this.to, current, this.append);\n    var normalizedTo = ref.normalizedTo;\n    var resolved = ref.resolved;\n    var href = ref.href;\n    var classes = {}\n    var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active'\n    var compareTarget = normalizedTo.path ? createRoute(null, normalizedTo) : resolved\n    classes[activeClass] = this.exact\n      ? isSameRoute(current, compareTarget)\n      : isIncludedRoute(current, compareTarget)\n\n    var handler = function (e) {\n      if (guardEvent(e)) {\n        if (this$1.replace) {\n          router.replace(normalizedTo)\n        } else {\n          router.push(normalizedTo)\n        }\n      }\n    }\n\n    var on = { click: guardEvent }\n    if (Array.isArray(this.event)) {\n      this.event.forEach(function (e) { on[e] = handler })\n    } else {\n      on[this.event] = handler\n    }\n\n    var data = {\n      class: classes\n    }\n\n    if (this.tag === 'a') {\n      data.on = on\n      data.attrs = { href: href }\n    } else {\n      // find the first <a> child and apply listener and href\n      var a = findAnchor(this.$slots.default)\n      if (a) {\n        // in case the <a> is a static node\n        a.isStatic = false\n        var extend = _Vue.util.extend\n        var aData = a.data = extend({}, a.data)\n        aData.on = on\n        var aAttrs = a.data.attrs = extend({}, a.data.attrs)\n        aAttrs.href = href\n      } else {\n        // doesn't have <a> child, apply listener to self\n        data.on = on\n      }\n    }\n\n    return h(this.tag, data, this.$slots.default)\n  }\n}\n\nfunction guardEvent (e) {\n  // don't redirect with control keys\n  /* istanbul ignore if */\n  if (e.metaKey || e.ctrlKey || e.shiftKey) { return }\n  // don't redirect when preventDefault called\n  /* istanbul ignore if */\n  if (e.defaultPrevented) { return }\n  // don't redirect on right click\n  /* istanbul ignore if */\n  if (e.button !== 0) { return }\n  // don't redirect if `target=\"_blank\"`\n  /* istanbul ignore if */\n  var target = e.target.getAttribute('target')\n  if (/\\b_blank\\b/i.test(target)) { return }\n\n  e.preventDefault()\n  return true\n}\n\nfunction findAnchor (children) {\n  if (children) {\n    var child\n    for (var i = 0; i < children.length; i++) {\n      child = children[i]\n      if (child.tag === 'a') {\n        return child\n      }\n      if (child.children && (child = findAnchor(child.children))) {\n        return child\n      }\n    }\n  }\n}\n\nvar _Vue\n\nfunction install (Vue) {\n  if (install.installed) { return }\n  install.installed = true\n\n  _Vue = Vue\n\n  Object.defineProperty(Vue.prototype, '$router', {\n    get: function get () { return this.$root._router }\n  })\n\n  Object.defineProperty(Vue.prototype, '$route', {\n    get: function get$1 () { return this.$root._route }\n  })\n\n  Vue.mixin({\n    beforeCreate: function beforeCreate () {\n      if (this.$options.router) {\n        this._router = this.$options.router\n        this._router.init(this)\n        Vue.util.defineReactive(this, '_route', this._router.history.current)\n      }\n    }\n  })\n\n  Vue.component('router-view', View)\n  Vue.component('router-link', Link)\n\n  var strats = Vue.config.optionMergeStrategies\n  // use the same hook merging strategy for route hooks\n  strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created\n}\n\n/*  */\n\nfunction resolvePath (\n  relative,\n  base,\n  append\n) {\n  if (relative.charAt(0) === '/') {\n    return relative\n  }\n\n  if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {\n    return base + relative\n  }\n\n  var stack = base.split('/')\n\n  // remove trailing segment if:\n  // - not appending\n  // - appending to trailing slash (last segment is empty)\n  if (!append || !stack[stack.length - 1]) {\n    stack.pop()\n  }\n\n  // resolve relative path\n  var segments = relative.replace(/^\\//, '').split('/')\n  for (var i = 0; i < segments.length; i++) {\n    var segment = segments[i]\n    if (segment === '.') {\n      continue\n    } else if (segment === '..') {\n      stack.pop()\n    } else {\n      stack.push(segment)\n    }\n  }\n\n  // ensure leading slash\n  if (stack[0] !== '') {\n    stack.unshift('')\n  }\n\n  return stack.join('/')\n}\n\nfunction parsePath (path) {\n  var hash = ''\n  var query = ''\n\n  var hashIndex = path.indexOf('#')\n  if (hashIndex >= 0) {\n    hash = path.slice(hashIndex)\n    path = path.slice(0, hashIndex)\n  }\n\n  var queryIndex = path.indexOf('?')\n  if (queryIndex >= 0) {\n    query = path.slice(queryIndex + 1)\n    path = path.slice(0, queryIndex)\n  }\n\n  return {\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\nfunction cleanPath (path) {\n  return path.replace(/\\/\\//g, '/')\n}\n\n/*  */\n\nfunction createRouteMap (routes) {\n  var pathMap = Object.create(null)\n  var nameMap = Object.create(null)\n\n  routes.forEach(function (route) {\n    addRouteRecord(pathMap, nameMap, route)\n  })\n\n  return {\n    pathMap: pathMap,\n    nameMap: nameMap\n  }\n}\n\nfunction addRouteRecord (\n  pathMap,\n  nameMap,\n  route,\n  parent,\n  matchAs\n) {\n  var path = route.path;\n  var name = route.name;\n  if (\"development\" !== 'production') {\n    assert(path != null, \"\\\"path\\\" is required in a route configuration.\")\n    assert(\n      typeof route.component !== 'string',\n      \"route config \\\"component\\\" for path: \" + (String(path || name)) + \" cannot be a \" +\n      \"string id. Use an actual component instead.\"\n    )\n  }\n\n  var record = {\n    path: normalizePath(path, parent),\n    components: route.components || { default: route.component },\n    instances: {},\n    name: name,\n    parent: parent,\n    matchAs: matchAs,\n    redirect: route.redirect,\n    beforeEnter: route.beforeEnter,\n    meta: route.meta || {}\n  }\n\n  if (route.children) {\n    // Warn if route is named and has a default child route.\n    // If users navigate to this route by name, the default child will\n    // not be rendered (GH Issue #629)\n    if (\"development\" !== 'production') {\n      if (route.name && route.children.some(function (child) { return /^\\/?$/.test(child.path); })) {\n        warn(false, (\"Named Route '\" + (route.name) + \"' has a default child route.\\n          When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), the default child route will not be rendered.\\n          Remove the name from this route and use the name of the default child route for named links instead.\")\n        )\n      }\n    }\n    route.children.forEach(function (child) {\n      addRouteRecord(pathMap, nameMap, child, record)\n    })\n  }\n\n  if (route.alias !== undefined) {\n    if (Array.isArray(route.alias)) {\n      route.alias.forEach(function (alias) {\n        addRouteRecord(pathMap, nameMap, { path: alias }, parent, record.path)\n      })\n    } else {\n      addRouteRecord(pathMap, nameMap, { path: route.alias }, parent, record.path)\n    }\n  }\n\n  if (!pathMap[record.path]) {\n    pathMap[record.path] = record\n  }\n  if (name) {\n    if (!nameMap[name]) {\n      nameMap[name] = record\n    } else if (\"development\" !== 'production') {\n      warn(false, (\"Duplicate named routes definition: { name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"))\n    }\n  }\n}\n\nfunction normalizePath (path, parent) {\n  path = path.replace(/\\/$/, '')\n  if (path[0] === '/') { return path }\n  if (parent == null) { return path }\n  return cleanPath(((parent.path) + \"/\" + path))\n}\n\nvar __moduleExports = Array.isArray || function (arr) {\n  return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\nvar isarray = __moduleExports\n\n/**\n * Expose `pathToRegexp`.\n */\nvar index = pathToRegexp\nvar parse_1 = parse\nvar compile_1 = compile\nvar tokensToFunction_1 = tokensToFunction\nvar tokensToRegExp_1 = tokensToRegExp\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n  // Match escaped characters that would otherwise appear in future matches.\n  // This allows the user to escape special characters that won't transform.\n  '(\\\\\\\\.)',\n  // Match Express-style parameters and un-named parameters with a prefix\n  // and optional suffixes. Matches appear as:\n  //\n  // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n  // \"/route(\\\\d+)\"  => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n  // \"/*\"            => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n  '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param  {string}  str\n * @param  {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n  var tokens = []\n  var key = 0\n  var index = 0\n  var path = ''\n  var defaultDelimiter = options && options.delimiter || '/'\n  var res\n\n  while ((res = PATH_REGEXP.exec(str)) != null) {\n    var m = res[0]\n    var escaped = res[1]\n    var offset = res.index\n    path += str.slice(index, offset)\n    index = offset + m.length\n\n    // Ignore already escaped sequences.\n    if (escaped) {\n      path += escaped[1]\n      continue\n    }\n\n    var next = str[index]\n    var prefix = res[2]\n    var name = res[3]\n    var capture = res[4]\n    var group = res[5]\n    var modifier = res[6]\n    var asterisk = res[7]\n\n    // Push the current path onto the tokens.\n    if (path) {\n      tokens.push(path)\n      path = ''\n    }\n\n    var partial = prefix != null && next != null && next !== prefix\n    var repeat = modifier === '+' || modifier === '*'\n    var optional = modifier === '?' || modifier === '*'\n    var delimiter = res[2] || defaultDelimiter\n    var pattern = capture || group\n\n    tokens.push({\n      name: name || key++,\n      prefix: prefix || '',\n      delimiter: delimiter,\n      optional: optional,\n      repeat: repeat,\n      partial: partial,\n      asterisk: !!asterisk,\n      pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n    })\n  }\n\n  // Match any characters still remaining.\n  if (index < str.length) {\n    path += str.substr(index)\n  }\n\n  // If the path exists, push it onto the end.\n  if (path) {\n    tokens.push(path)\n  }\n\n  return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param  {string}             str\n * @param  {Object=}            options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n  return tokensToFunction(parse(str, options))\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n  return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param  {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n  return encodeURI(str).replace(/[?#]/g, function (c) {\n    return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n  })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens) {\n  // Compile all the tokens into regexps.\n  var matches = new Array(tokens.length)\n\n  // Compile all the patterns before compilation.\n  for (var i = 0; i < tokens.length; i++) {\n    if (typeof tokens[i] === 'object') {\n      matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n    }\n  }\n\n  return function (obj, opts) {\n    var path = ''\n    var data = obj || {}\n    var options = opts || {}\n    var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n    for (var i = 0; i < tokens.length; i++) {\n      var token = tokens[i]\n\n      if (typeof token === 'string') {\n        path += token\n\n        continue\n      }\n\n      var value = data[token.name]\n      var segment\n\n      if (value == null) {\n        if (token.optional) {\n          // Prepend partial segment prefixes.\n          if (token.partial) {\n            path += token.prefix\n          }\n\n          continue\n        } else {\n          throw new TypeError('Expected \"' + token.name + '\" to be defined')\n        }\n      }\n\n      if (isarray(value)) {\n        if (!token.repeat) {\n          throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n        }\n\n        if (value.length === 0) {\n          if (token.optional) {\n            continue\n          } else {\n            throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n          }\n        }\n\n        for (var j = 0; j < value.length; j++) {\n          segment = encode(value[j])\n\n          if (!matches[i].test(segment)) {\n            throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n          }\n\n          path += (j === 0 ? token.prefix : token.delimiter) + segment\n        }\n\n        continue\n      }\n\n      segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n      if (!matches[i].test(segment)) {\n        throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n      }\n\n      path += token.prefix + segment\n    }\n\n    return path\n  }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param  {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n  return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param  {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n  return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param  {!RegExp} re\n * @param  {Array}   keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n  re.keys = keys\n  return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param  {Object} options\n * @return {string}\n */\nfunction flags (options) {\n  return options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param  {!RegExp} path\n * @param  {!Array}  keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n  // Use a negative lookahead to match only capturing groups.\n  var groups = path.source.match(/\\((?!\\?)/g)\n\n  if (groups) {\n    for (var i = 0; i < groups.length; i++) {\n      keys.push({\n        name: i,\n        prefix: null,\n        delimiter: null,\n        optional: false,\n        repeat: false,\n        partial: false,\n        asterisk: false,\n        pattern: null\n      })\n    }\n  }\n\n  return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param  {!Array}  path\n * @param  {Array}   keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n  var parts = []\n\n  for (var i = 0; i < path.length; i++) {\n    parts.push(pathToRegexp(path[i], keys, options).source)\n  }\n\n  var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))\n\n  return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param  {string}  path\n * @param  {!Array}  keys\n * @param  {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n  return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param  {!Array}          tokens\n * @param  {(Array|Object)=} keys\n * @param  {Object=}         options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options)\n    keys = []\n  }\n\n  options = options || {}\n\n  var strict = options.strict\n  var end = options.end !== false\n  var route = ''\n\n  // Iterate over the tokens and create our regexp string.\n  for (var i = 0; i < tokens.length; i++) {\n    var token = tokens[i]\n\n    if (typeof token === 'string') {\n      route += escapeString(token)\n    } else {\n      var prefix = escapeString(token.prefix)\n      var capture = '(?:' + token.pattern + ')'\n\n      keys.push(token)\n\n      if (token.repeat) {\n        capture += '(?:' + prefix + capture + ')*'\n      }\n\n      if (token.optional) {\n        if (!token.partial) {\n          capture = '(?:' + prefix + '(' + capture + '))?'\n        } else {\n          capture = prefix + '(' + capture + ')?'\n        }\n      } else {\n        capture = prefix + '(' + capture + ')'\n      }\n\n      route += capture\n    }\n  }\n\n  var delimiter = escapeString(options.delimiter || '/')\n  var endsWithDelimiter = route.slice(-delimiter.length) === delimiter\n\n  // In non-strict mode we allow a slash at the end of match. If the path to\n  // match already ends with a slash, we remove it for consistency. The slash\n  // is valid at the end of a path match, not in the middle. This is important\n  // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n  if (!strict) {\n    route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'\n  }\n\n  if (end) {\n    route += '$'\n  } else {\n    // In non-ending mode, we need the capturing groups to match as much as\n    // possible by using a positive lookahead to the end or next path segment.\n    route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'\n  }\n\n  return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param  {(string|RegExp|Array)} path\n * @param  {(Array|Object)=}       keys\n * @param  {Object=}               options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n  if (!isarray(keys)) {\n    options = /** @type {!Object} */ (keys || options)\n    keys = []\n  }\n\n  options = options || {}\n\n  if (path instanceof RegExp) {\n    return regexpToRegexp(path, /** @type {!Array} */ (keys))\n  }\n\n  if (isarray(path)) {\n    return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n  }\n\n  return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\n\nindex.parse = parse_1;\nindex.compile = compile_1;\nindex.tokensToFunction = tokensToFunction_1;\nindex.tokensToRegExp = tokensToRegExp_1;\n\n/*  */\n\nvar regexpCache = Object.create(null)\n\nfunction getRouteRegex (path) {\n  var hit = regexpCache[path]\n  var keys, regexp\n\n  if (hit) {\n    keys = hit.keys\n    regexp = hit.regexp\n  } else {\n    keys = []\n    regexp = index(path, keys)\n    regexpCache[path] = { keys: keys, regexp: regexp }\n  }\n\n  return { keys: keys, regexp: regexp }\n}\n\nvar regexpCompileCache = Object.create(null)\n\nfunction fillParams (\n  path,\n  params,\n  routeMsg\n) {\n  try {\n    var filler =\n      regexpCompileCache[path] ||\n      (regexpCompileCache[path] = index.compile(path))\n    return filler(params || {}, { pretty: true })\n  } catch (e) {\n    if (\"development\" !== 'production') {\n      warn(false, (\"missing param for \" + routeMsg + \": \" + (e.message)))\n    }\n    return ''\n  }\n}\n\n/*  */\n\nfunction normalizeLocation (\n  raw,\n  current,\n  append\n) {\n  var next = typeof raw === 'string' ? { path: raw } : raw\n  // named target\n  if (next.name || next._normalized) {\n    return next\n  }\n\n  // relative params\n  if (!next.path && next.params && current) {\n    next = assign({}, next)\n    next._normalized = true\n    var params = assign(assign({}, current.params), next.params)\n    if (current.name) {\n      next.name = current.name\n      next.params = params\n    } else if (current.matched) {\n      var rawPath = current.matched[current.matched.length - 1].path\n      next.path = fillParams(rawPath, params, (\"path \" + (current.path)))\n    } else if (\"development\" !== 'production') {\n      warn(false, \"relative params navigation requires a current route.\")\n    }\n    return next\n  }\n\n  var parsedPath = parsePath(next.path || '')\n  var basePath = (current && current.path) || '/'\n  var path = parsedPath.path\n    ? resolvePath(parsedPath.path, basePath, append || next.append)\n    : (current && current.path) || '/'\n  var query = resolveQuery(parsedPath.query, next.query)\n  var hash = next.hash || parsedPath.hash\n  if (hash && hash.charAt(0) !== '#') {\n    hash = \"#\" + hash\n  }\n\n  return {\n    _normalized: true,\n    path: path,\n    query: query,\n    hash: hash\n  }\n}\n\nfunction assign (a, b) {\n  for (var key in b) {\n    a[key] = b[key]\n  }\n  return a\n}\n\n/*  */\n\nfunction createMatcher (routes) {\n  var ref = createRouteMap(routes);\n  var pathMap = ref.pathMap;\n  var nameMap = ref.nameMap;\n\n  function match (\n    raw,\n    currentRoute,\n    redirectedFrom\n  ) {\n    var location = normalizeLocation(raw, currentRoute)\n    var name = location.name;\n\n    if (name) {\n      var record = nameMap[name]\n      var paramNames = getRouteRegex(record.path).keys\n        .filter(function (key) { return !key.optional; })\n        .map(function (key) { return key.name; })\n\n      if (typeof location.params !== 'object') {\n        location.params = {}\n      }\n\n      if (currentRoute && typeof currentRoute.params === 'object') {\n        for (var key in currentRoute.params) {\n          if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n            location.params[key] = currentRoute.params[key]\n          }\n        }\n      }\n\n      if (record) {\n        location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"))\n        return _createRoute(record, location, redirectedFrom)\n      }\n    } else if (location.path) {\n      location.params = {}\n      for (var path in pathMap) {\n        if (matchRoute(path, location.params, location.path)) {\n          return _createRoute(pathMap[path], location, redirectedFrom)\n        }\n      }\n    }\n    // no match\n    return _createRoute(null, location)\n  }\n\n  function redirect (\n    record,\n    location\n  ) {\n    var originalRedirect = record.redirect\n    var redirect = typeof originalRedirect === 'function'\n        ? originalRedirect(createRoute(record, location))\n        : originalRedirect\n\n    if (typeof redirect === 'string') {\n      redirect = { path: redirect }\n    }\n\n    if (!redirect || typeof redirect !== 'object') {\n      \"development\" !== 'production' && warn(\n        false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n      )\n      return _createRoute(null, location)\n    }\n\n    var re = redirect\n    var name = re.name;\n    var path = re.path;\n    var query = location.query;\n    var hash = location.hash;\n    var params = location.params;\n    query = re.hasOwnProperty('query') ? re.query : query\n    hash = re.hasOwnProperty('hash') ? re.hash : hash\n    params = re.hasOwnProperty('params') ? re.params : params\n\n    if (name) {\n      // resolved named direct\n      var targetRecord = nameMap[name]\n      if (\"development\" !== 'production') {\n        assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"))\n      }\n      return match({\n        _normalized: true,\n        name: name,\n        query: query,\n        hash: hash,\n        params: params\n      }, undefined, location)\n    } else if (path) {\n      // 1. resolve relative redirect\n      var rawPath = resolveRecordPath(path, record)\n      // 2. resolve params\n      var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"))\n      // 3. rematch with existing query and hash\n      return match({\n        _normalized: true,\n        path: resolvedPath,\n        query: query,\n        hash: hash\n      }, undefined, location)\n    } else {\n      warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))))\n      return _createRoute(null, location)\n    }\n  }\n\n  function alias (\n    record,\n    location,\n    matchAs\n  ) {\n    var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"))\n    var aliasedMatch = match({\n      _normalized: true,\n      path: aliasedPath\n    })\n    if (aliasedMatch) {\n      var matched = aliasedMatch.matched\n      var aliasedRecord = matched[matched.length - 1]\n      location.params = aliasedMatch.params\n      return _createRoute(aliasedRecord, location)\n    }\n    return _createRoute(null, location)\n  }\n\n  function _createRoute (\n    record,\n    location,\n    redirectedFrom\n  ) {\n    if (record && record.redirect) {\n      return redirect(record, redirectedFrom || location)\n    }\n    if (record && record.matchAs) {\n      return alias(record, location, record.matchAs)\n    }\n    return createRoute(record, location, redirectedFrom)\n  }\n\n  return match\n}\n\nfunction matchRoute (\n  path,\n  params,\n  pathname\n) {\n  var ref = getRouteRegex(path);\n  var regexp = ref.regexp;\n  var keys = ref.keys;\n  var m = pathname.match(regexp)\n\n  if (!m) {\n    return false\n  } else if (!params) {\n    return true\n  }\n\n  for (var i = 1, len = m.length; i < len; ++i) {\n    var key = keys[i - 1]\n    var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]\n    if (key) { params[key.name] = val }\n  }\n\n  return true\n}\n\nfunction resolveRecordPath (path, record) {\n  return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/*  */\n\nvar inBrowser = typeof window !== 'undefined'\n\nvar supportsHistory = inBrowser && (function () {\n  var ua = window.navigator.userAgent\n\n  if (\n    (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n    ua.indexOf('Mobile Safari') !== -1 &&\n    ua.indexOf('Chrome') === -1 &&\n    ua.indexOf('Windows Phone') === -1\n  ) {\n    return false\n  }\n\n  return window.history && 'pushState' in window.history\n})()\n\n/*  */\n\nfunction runQueue (queue, fn, cb) {\n  var step = function (index) {\n    if (index >= queue.length) {\n      cb()\n    } else {\n      if (queue[index]) {\n        fn(queue[index], function () {\n          step(index + 1)\n        })\n      } else {\n        step(index + 1)\n      }\n    }\n  }\n  step(0)\n}\n\n/*  */\n\n\nvar History = function History (router, base) {\n  this.router = router\n  this.base = normalizeBase(base)\n  // start with a route object that stands for \"nowhere\"\n  this.current = START\n  this.pending = null\n};\n\nHistory.prototype.listen = function listen (cb) {\n  this.cb = cb\n};\n\nHistory.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {\n    var this$1 = this;\n\n  var route = this.router.match(location, this.current)\n  this.confirmTransition(route, function () {\n    this$1.updateRoute(route)\n    onComplete && onComplete(route)\n    this$1.ensureURL()\n  }, onAbort)\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n    var this$1 = this;\n\n  var current = this.current\n  var abort = function () { onAbort && onAbort() }\n  if (isSameRoute(route, current)) {\n    this.ensureURL()\n    return abort()\n  }\n\n  var ref = resolveQueue(this.current.matched, route.matched);\n    var deactivated = ref.deactivated;\n    var activated = ref.activated;\n\n  var queue = [].concat(\n    // in-component leave guards\n    extractLeaveGuards(deactivated),\n    // global before hooks\n    this.router.beforeHooks,\n    // enter guards\n    activated.map(function (m) { return m.beforeEnter; }),\n    // async components\n    resolveAsyncComponents(activated)\n  )\n\n  this.pending = route\n  var iterator = function (hook, next) {\n    if (this$1.pending !== route) {\n      return abort()\n    }\n    hook(route, current, function (to) {\n      if (to === false) {\n        // next(false) -> abort navigation, ensure current URL\n        this$1.ensureURL(true)\n        abort()\n      } else if (typeof to === 'string' || typeof to === 'object') {\n        // next('/') or next({ path: '/' }) -> redirect\n        (typeof to === 'object' && to.replace) ? this$1.replace(to) : this$1.push(to)\n        abort()\n      } else {\n        // confirm transition and pass on the value\n        next(to)\n      }\n    })\n  }\n\n  runQueue(queue, iterator, function () {\n    var postEnterCbs = []\n    var enterGuards = extractEnterGuards(activated, postEnterCbs, function () {\n      return this$1.current === route\n    })\n    // wait until async components are resolved before\n    // extracting in-component enter guards\n    runQueue(enterGuards, iterator, function () {\n      if (this$1.pending !== route) {\n        return abort()\n      }\n      this$1.pending = null\n      onComplete(route)\n      if (this$1.router.app) {\n        this$1.router.app.$nextTick(function () {\n          postEnterCbs.forEach(function (cb) { return cb(); })\n        })\n      }\n    })\n  })\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n  var prev = this.current\n  this.current = route\n  this.cb && this.cb(route)\n  this.router.afterHooks.forEach(function (hook) {\n    hook && hook(route, prev)\n  })\n};\n\nfunction normalizeBase (base) {\n  if (!base) {\n    if (inBrowser) {\n      // respect <base> tag\n      var baseEl = document.querySelector('base')\n      base = baseEl ? baseEl.getAttribute('href') : '/'\n    } else {\n      base = '/'\n    }\n  }\n  // make sure there's the starting slash\n  if (base.charAt(0) !== '/') {\n    base = '/' + base\n  }\n  // remove trailing slash\n  return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n  current,\n  next\n) {\n  var i\n  var max = Math.max(current.length, next.length)\n  for (i = 0; i < max; i++) {\n    if (current[i] !== next[i]) {\n      break\n    }\n  }\n  return {\n    activated: next.slice(i),\n    deactivated: current.slice(i)\n  }\n}\n\nfunction extractGuard (\n  def,\n  key\n) {\n  if (typeof def !== 'function') {\n    // extend now so that global mixins are applied.\n    def = _Vue.extend(def)\n  }\n  return def.options[key]\n}\n\nfunction extractLeaveGuards (matched) {\n  return flatten(flatMapComponents(matched, function (def, instance) {\n    var guard = extractGuard(def, 'beforeRouteLeave')\n    if (guard) {\n      return Array.isArray(guard)\n        ? guard.map(function (guard) { return wrapLeaveGuard(guard, instance); })\n        : wrapLeaveGuard(guard, instance)\n    }\n  }).reverse())\n}\n\nfunction wrapLeaveGuard (\n  guard,\n  instance\n) {\n  return function routeLeaveGuard () {\n    return guard.apply(instance, arguments)\n  }\n}\n\nfunction extractEnterGuards (\n  matched,\n  cbs,\n  isValid\n) {\n  return flatten(flatMapComponents(matched, function (def, _, match, key) {\n    var guard = extractGuard(def, 'beforeRouteEnter')\n    if (guard) {\n      return Array.isArray(guard)\n        ? guard.map(function (guard) { return wrapEnterGuard(guard, cbs, match, key, isValid); })\n        : wrapEnterGuard(guard, cbs, match, key, isValid)\n    }\n  }))\n}\n\nfunction wrapEnterGuard (\n  guard,\n  cbs,\n  match,\n  key,\n  isValid\n) {\n  return function routeEnterGuard (to, from, next) {\n    return guard(to, from, function (cb) {\n      next(cb)\n      if (typeof cb === 'function') {\n        cbs.push(function () {\n          // #750\n          // if a router-view is wrapped with an out-in transition,\n          // the instance may not have been registered at this time.\n          // we will need to poll for registration until current route\n          // is no longer valid.\n          poll(cb, match.instances, key, isValid)\n        })\n      }\n    })\n  }\n}\n\nfunction poll (\n  cb, // somehow flow cannot infer this is a function\n  instances,\n  key,\n  isValid\n) {\n  if (instances[key]) {\n    cb(instances[key])\n  } else if (isValid()) {\n    setTimeout(function () {\n      poll(cb, instances, key, isValid)\n    }, 16)\n  }\n}\n\nfunction resolveAsyncComponents (matched) {\n  return flatMapComponents(matched, function (def, _, match, key) {\n    // if it's a function and doesn't have Vue options attached,\n    // assume it's an async component resolve function.\n    // we are not using Vue's default async resolving mechanism because\n    // we want to halt the navigation until the incoming component has been\n    // resolved.\n    if (typeof def === 'function' && !def.options) {\n      return function (to, from, next) {\n        var resolve = function (resolvedDef) {\n          match.components[key] = resolvedDef\n          next()\n        }\n\n        var reject = function (reason) {\n          warn(false, (\"Failed to resolve async component \" + key + \": \" + reason))\n          next(false)\n        }\n\n        var res = def(resolve, reject)\n        if (res && typeof res.then === 'function') {\n          res.then(resolve, reject)\n        }\n      }\n    }\n  })\n}\n\nfunction flatMapComponents (\n  matched,\n  fn\n) {\n  return flatten(matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) { return fn(\n      m.components[key],\n      m.instances[key],\n      m, key\n    ); })\n  }))\n}\n\nfunction flatten (arr) {\n  return Array.prototype.concat.apply([], arr)\n}\n\n/*  */\n\nvar positionStore = Object.create(null)\n\nfunction saveScrollPosition (key) {\n  if (!key) { return }\n  positionStore[key] = {\n    x: window.pageXOffset,\n    y: window.pageYOffset\n  }\n}\n\nfunction getScrollPosition (key) {\n  if (!key) { return }\n  return positionStore[key]\n}\n\nfunction getElementPosition (el) {\n  var docRect = document.documentElement.getBoundingClientRect()\n  var elRect = el.getBoundingClientRect()\n  return {\n    x: elRect.left - docRect.left,\n    y: elRect.top - docRect.top\n  }\n}\n\nfunction isValidPosition (obj) {\n  return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n  return {\n    x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n    y: isNumber(obj.y) ? obj.y : window.pageYOffset\n  }\n}\n\nfunction isNumber (v) {\n  return typeof v === 'number'\n}\n\n/*  */\n\n\nvar genKey = function () { return String(Date.now()); }\nvar _key = genKey()\n\nvar HTML5History = (function (History) {\n  function HTML5History (router, base) {\n    var this$1 = this;\n\n    History.call(this, router, base)\n\n    var expectScroll = router.options.scrollBehavior\n    window.addEventListener('popstate', function (e) {\n      _key = e.state && e.state.key\n      var current = this$1.current\n      this$1.transitionTo(getLocation(this$1.base), function (next) {\n        if (expectScroll) {\n          this$1.handleScroll(next, current, true)\n        }\n      })\n    })\n\n    if (expectScroll) {\n      window.addEventListener('scroll', function () {\n        saveScrollPosition(_key)\n      })\n    }\n  }\n\n  if ( History ) HTML5History.__proto__ = History;\n  HTML5History.prototype = Object.create( History && History.prototype );\n  HTML5History.prototype.constructor = HTML5History;\n\n  HTML5History.prototype.go = function go (n) {\n    window.history.go(n)\n  };\n\n  HTML5History.prototype.push = function push (location) {\n    var this$1 = this;\n\n    var current = this.current\n    this.transitionTo(location, function (route) {\n      pushState(cleanPath(this$1.base + route.fullPath))\n      this$1.handleScroll(route, current, false)\n    })\n  };\n\n  HTML5History.prototype.replace = function replace (location) {\n    var this$1 = this;\n\n    var current = this.current\n    this.transitionTo(location, function (route) {\n      replaceState(cleanPath(this$1.base + route.fullPath))\n      this$1.handleScroll(route, current, false)\n    })\n  };\n\n  HTML5History.prototype.ensureURL = function ensureURL (push) {\n    if (getLocation(this.base) !== this.current.fullPath) {\n      var current = cleanPath(this.base + this.current.fullPath)\n      push ? pushState(current) : replaceState(current)\n    }\n  };\n\n  HTML5History.prototype.handleScroll = function handleScroll (to, from, isPop) {\n    var router = this.router\n    if (!router.app) {\n      return\n    }\n\n    var behavior = router.options.scrollBehavior\n    if (!behavior) {\n      return\n    }\n    if (\"development\" !== 'production') {\n      assert(typeof behavior === 'function', \"scrollBehavior must be a function\")\n    }\n\n    // wait until re-render finishes before scrolling\n    router.app.$nextTick(function () {\n      var position = getScrollPosition(_key)\n      var shouldScroll = behavior(to, from, isPop ? position : null)\n      if (!shouldScroll) {\n        return\n      }\n      var isObject = typeof shouldScroll === 'object'\n      if (isObject && typeof shouldScroll.selector === 'string') {\n        var el = document.querySelector(shouldScroll.selector)\n        if (el) {\n          position = getElementPosition(el)\n        } else if (isValidPosition(shouldScroll)) {\n          position = normalizePosition(shouldScroll)\n        }\n      } else if (isObject && isValidPosition(shouldScroll)) {\n        position = normalizePosition(shouldScroll)\n      }\n\n      if (position) {\n        window.scrollTo(position.x, position.y)\n      }\n    })\n  };\n\n  return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n  var path = window.location.pathname\n  if (base && path.indexOf(base) === 0) {\n    path = path.slice(base.length)\n  }\n  return (path || '/') + window.location.search + window.location.hash\n}\n\nfunction pushState (url, replace) {\n  // try...catch the pushState call to get around Safari\n  // DOM Exception 18 where it limits to 100 pushState calls\n  var history = window.history\n  try {\n    if (replace) {\n      history.replaceState({ key: _key }, '', url)\n    } else {\n      _key = genKey()\n      history.pushState({ key: _key }, '', url)\n    }\n    saveScrollPosition(_key)\n  } catch (e) {\n    window.location[replace ? 'assign' : 'replace'](url)\n  }\n}\n\nfunction replaceState (url) {\n  pushState(url, true)\n}\n\n/*  */\n\n\nvar HashHistory = (function (History) {\n  function HashHistory (router, base, fallback) {\n    History.call(this, router, base)\n    // check history fallback deeplinking\n    if (fallback && this.checkFallback()) {\n      return\n    }\n    ensureSlash()\n  }\n\n  if ( History ) HashHistory.__proto__ = History;\n  HashHistory.prototype = Object.create( History && History.prototype );\n  HashHistory.prototype.constructor = HashHistory;\n\n  HashHistory.prototype.checkFallback = function checkFallback () {\n    var location = getLocation(this.base)\n    if (!/^\\/#/.test(location)) {\n      window.location.replace(\n        cleanPath(this.base + '/#' + location)\n      )\n      return true\n    }\n  };\n\n  HashHistory.prototype.onHashChange = function onHashChange () {\n    if (!ensureSlash()) {\n      return\n    }\n    this.transitionTo(getHash(), function (route) {\n      replaceHash(route.fullPath)\n    })\n  };\n\n  HashHistory.prototype.push = function push (location) {\n    this.transitionTo(location, function (route) {\n      pushHash(route.fullPath)\n    })\n  };\n\n  HashHistory.prototype.replace = function replace (location) {\n    this.transitionTo(location, function (route) {\n      replaceHash(route.fullPath)\n    })\n  };\n\n  HashHistory.prototype.go = function go (n) {\n    window.history.go(n)\n  };\n\n  HashHistory.prototype.ensureURL = function ensureURL (push) {\n    var current = this.current.fullPath\n    if (getHash() !== current) {\n      push ? pushHash(current) : replaceHash(current)\n    }\n  };\n\n  return HashHistory;\n}(History));\n\nfunction ensureSlash () {\n  var path = getHash()\n  if (path.charAt(0) === '/') {\n    return true\n  }\n  replaceHash('/' + path)\n  return false\n}\n\nfunction getHash () {\n  // We can't use window.location.hash here because it's not\n  // consistent across browsers - Firefox will pre-decode it!\n  var href = window.location.href\n  var index = href.indexOf('#')\n  return index === -1 ? '' : href.slice(index + 1)\n}\n\nfunction pushHash (path) {\n  window.location.hash = path\n}\n\nfunction replaceHash (path) {\n  var i = window.location.href.indexOf('#')\n  window.location.replace(\n    window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path\n  )\n}\n\n/*  */\n\n\nvar AbstractHistory = (function (History) {\n  function AbstractHistory (router) {\n    History.call(this, router)\n    this.stack = []\n    this.index = -1\n  }\n\n  if ( History ) AbstractHistory.__proto__ = History;\n  AbstractHistory.prototype = Object.create( History && History.prototype );\n  AbstractHistory.prototype.constructor = AbstractHistory;\n\n  AbstractHistory.prototype.push = function push (location) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route)\n      this$1.index++\n    })\n  };\n\n  AbstractHistory.prototype.replace = function replace (location) {\n    var this$1 = this;\n\n    this.transitionTo(location, function (route) {\n      this$1.stack = this$1.stack.slice(0, this$1.index).concat(route)\n    })\n  };\n\n  AbstractHistory.prototype.go = function go (n) {\n    var this$1 = this;\n\n    var targetIndex = this.index + n\n    if (targetIndex < 0 || targetIndex >= this.stack.length) {\n      return\n    }\n    var route = this.stack[targetIndex]\n    this.confirmTransition(route, function () {\n      this$1.index = targetIndex\n      this$1.updateRoute(route)\n    })\n  };\n\n  AbstractHistory.prototype.ensureURL = function ensureURL () {\n    // noop\n  };\n\n  return AbstractHistory;\n}(History));\n\n/*  */\n\nvar VueRouter = function VueRouter (options) {\n  if ( options === void 0 ) options = {};\n\n  this.app = null\n  this.options = options\n  this.beforeHooks = []\n  this.afterHooks = []\n  this.match = createMatcher(options.routes || [])\n\n  var mode = options.mode || 'hash'\n  this.fallback = mode === 'history' && !supportsHistory\n  if (this.fallback) {\n    mode = 'hash'\n  }\n  if (!inBrowser) {\n    mode = 'abstract'\n  }\n  this.mode = mode\n\n  switch (mode) {\n    case 'history':\n      this.history = new HTML5History(this, options.base)\n      break\n    case 'hash':\n      this.history = new HashHistory(this, options.base, this.fallback)\n      break\n    case 'abstract':\n      this.history = new AbstractHistory(this)\n      break\n    default:\n      \"development\" !== 'production' && assert(false, (\"invalid mode: \" + mode))\n  }\n};\n\nvar prototypeAccessors = { currentRoute: {} };\n\nprototypeAccessors.currentRoute.get = function () {\n  return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n    var this$1 = this;\n\n  \"development\" !== 'production' && assert(\n    install.installed,\n    \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n    \"before creating root instance.\"\n  )\n\n  this.app = app\n\n  var history = this.history\n\n  if (history instanceof HTML5History) {\n    history.transitionTo(getLocation(history.base))\n  } else if (history instanceof HashHistory) {\n    var setupHashListener = function () {\n      window.addEventListener('hashchange', function () {\n        history.onHashChange()\n      })\n    }\n    history.transitionTo(getHash(), setupHashListener, setupHashListener)\n  }\n\n  history.listen(function (route) {\n    this$1.app._route = route\n  })\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n  this.beforeHooks.push(fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n  this.afterHooks.push(fn)\n};\n\nVueRouter.prototype.push = function push (location) {\n  this.history.push(location)\n};\n\nVueRouter.prototype.replace = function replace (location) {\n  this.history.replace(location)\n};\n\nVueRouter.prototype.go = function go (n) {\n  this.history.go(n)\n};\n\nVueRouter.prototype.back = function back () {\n  this.go(-1)\n};\n\nVueRouter.prototype.forward = function forward () {\n  this.go(1)\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n  var route = to\n    ? this.resolve(to).resolved\n    : this.currentRoute\n  if (!route) {\n    return []\n  }\n  return [].concat.apply([], route.matched.map(function (m) {\n    return Object.keys(m.components).map(function (key) {\n      return m.components[key]\n    })\n  }))\n};\n\nVueRouter.prototype.resolve = function resolve (\n  to,\n  current,\n  append\n) {\n  var normalizedTo = normalizeLocation(to, current || this.history.current, append)\n  var resolved = this.match(normalizedTo, current)\n  var fullPath = resolved.redirectedFrom || resolved.fullPath\n  var base = this.history.base\n  var href = createHref(base, fullPath, this.mode)\n  return {\n    normalizedTo: normalizedTo,\n    resolved: resolved,\n    href: href\n  }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction createHref (base, fullPath, mode) {\n  var path = mode === 'hash' ? '#' + fullPath : fullPath\n  return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install\n\nif (inBrowser && window.Vue) {\n  window.Vue.use(VueRouter)\n}\n\nreturn VueRouter;\n\n})));"
  },
  {
    "path": "vue/im/message-list.js",
    "content": "'use strict';\n(function(RongIM) {\n  var components = RongIM.components;\n\n  var messageList = {\n    name: 'message-list',\n    template: `\n    <div class=\"rong-main\">\n        <div class=\"rong-message-list\">\n            <div v-for=\"message in messageList\" :class=\"['rong-message rong-message-' + message._direction ]\">\n                <div :class=\"['rong-avatar rong-message-' + message._direction + '-avatar']\" :style=\"{'background-image': 'url(' + message._sender.portrait + ')'}\"></div>\n                <div class=\"rong-message-content\">{{message._content}}</div>\n                <div class=\"rong-message-senttime\">\n                    <em>{{message._sentTime}}</em>\n                </div>\n                <div class=\"rong-clearfix\"></div>\n            </div>\n        </div>\n\n        <div class=\"rong-edior-box\">\n          <div class=\"rong-editor-input\">\n            <textarea v-model=\"content\" name=\"editor-input\" class=\"rong-input rong-editor-input-content\" placeholder=\"说点什么...\"  @keyup.enter=\"send\"></textarea>\n          </div>\n        </div>\n    </div>\n    `,\n    data: function() {\n      return {\n        content: '',\n        messageList: []\n      };\n    },\n    created: function() {\n      getHistoryMessages(this);\n    },\n    mounted: function(){\n      mounted(this);\n    },\n    methods: {\n      send: function() {\n        sendMessage(this);\n      }\n    },\n    watch: {\n      $route: function(to, from) {\n        getHistoryMessages(this);\n      }\n    }\n  };\n\n  var getConversation = function(ctx){\n    var params = ctx.$route.params;\n    var type = +params.conversationType;\n    var id = params.targetId;\n    return {\n      type: type,\n      id: id\n    };\n  };\n\n  var isActive = function(message, ctx){\n    var conversation = getConversation(ctx);\n    var type = conversation.type;\n    var id = conversation.id;\n    return (message.conversationType == type && message.targetId == id);\n  };\n  function mounted(ctx){\n    var Message = RongIM.Message;\n    Message.watch(function(message){\n      \n      if (isActive(message, ctx)) {\n        ctx.messageList.push(message);\n      }\n    });\n  };\n\n  function sendMessage(ctx) {\n    var Message = RongIM.Message;\n    var content = ctx.content;\n    var conversation = getConversation(ctx);\n\n    Message.sendTxt({\n      content: content,\n      type: conversation.type,\n      targetId: conversation.id\n    }, function(error, message) {\n      ctx.messageList.push(message);\n      ctx.content = '';\n    });\n  }\n\n  function getHistoryMessages(ctx) {\n    var conversation = getConversation(ctx);\n    RongIM.Message.get({\n      type: conversation.type,\n      targetId: conversation.id\n    }, function(error, messageList) {\n      if (error) {\n        console.error('Conversation.get Error: %s', error);\n        return;\n      }\n      ctx.messageList = messageList;\n    });\n  }\n\n  components.messageList = messageList;\n})(RongIM, {\n  Vue: Vue\n});"
  },
  {
    "path": "vue/im/routes.js",
    "content": "'use strict';\n(function(RongIM) {\n    var components = RongIM.components;\n\n    var conversationList = components.conversationList;\n    var messageList = components.messageList;\n\n    var routes = {\n        linkActiveClass: 'rong-selected',\n        maps: [{\n            path: '/conversation/:conversationType/:targetId',\n            name: 'conversation',\n            components: {\n                list: conversationList,\n                chat: messageList\n            }\n        },{\n            path: '/',\n            components: {\n                list: conversationList\n            }\n        }]\n    };\n    RongIM.routes = routes;\n})(RongIM, {});"
  },
  {
    "path": "vue/normal.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>vue normal</title>\n</head>\n<body>\n\n\n<h1>vue normal</h1>\n\n<div>\n\t<h2>user</h2>\n\t<div id=\"user-info\">\n\t\t<span>id: {{userInfo.userId}}</span>\n\t</div>\n</div>\n\n<script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n<script src=\"./vue-2.1.4.js\"></script>\n<script src=\"../init.js\"></script>\n\t\n<script>\n\"use strict\";\n\nconnectRongCloud(Vue);\n\nfunction connectRongCloud(Vue){\n\tvar params = {\n\t\tappKey : \"8w7jv4qb78a9y\",\n\t\ttoken : \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\"\n\t};\n\n\tvar userId = \"\";\n\n\tvar callbacks = {\n\t\tgetInstance : function(instance){\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\tvar user = new Vue({\n\t\t\t\tel : \"#user-info\",\n\t\t\t\tdata : {\n\t\t\t\t\tuserInfo : userInfo\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t\t//show(message);\n\t\t}\n\t};\n\n\tinit(params,callbacks);\n}\n</script>\n\t\n</body>\n</html>"
  },
  {
    "path": "vue/require.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>vue require</title>\n</head>\n<body>\n\n\n<h1>vue require</h1>\n\n<div>\n\t<h2>user</h2>\n\t<div id=\"user-info\">\n\t\t<span>id: {{userInfo.userId}}</span>\n\t</div>\n</div>\n\n<script src=\"../lib/require.js\"></script>\n<script src=\"../init.js\"></script>\n\t\n<script>\nfunction isSupport(APIName){\n\tvar d = document, w = window;\n\tvar id = \"RongCloudCloud-API-Test\" + new Date().getTime;\n\tvar iframe = d.getElementById(id);\n\tif(!iframe){\n\t\tiframe = d.createElement(\"iframe\");\n\t\tiframe.id = id;\n\t\tiframe.style.display = \"none\";\n\t\td.body.appendChild(iframe);\n\t}\n\tvar nativeAPI = iframe.contentWindow[APIName];\n\tvar API = w[APIName];\n\tif(API && nativeAPI.toString() == API.toString()){\n\t\treturn true;\n\t}\n\treturn false;\n}\t\n</script>\n\n<script>\n\"use strict\";\n\nvar isSupportSocket = isSupport(\"WebSocket\");\n\nrequire.config({\n    paths: {\n    \tprotobuf: '//cdn.ronghub.com/protobuf-2.3.7.min',\n    \tRongIMLib: '//cdn.ronghub.com/RongIMLib-2.5.3',\n    \tVue: 'vue-2.1.4'\n    }\n});\n\nif(isSupportSocket){\n\trequire(['protobuf','RongIMLib','Vue'], function(protobuf, RongIMLib, Vue) {\n\t    connectRongCloud(RongIMLib, Vue, protobuf);\n\t});\n}else{\n\trequire(['RongIMLib','Vue'], function(RongIMLib, Vue) {\n\t    connectRongCloud(RongIMLib, Vue);\n\t});\n}\n\nfunction connectRongCloud(RongIMLib, Vue, protobuf){\n\tvar params = {\n\t\tappKey : \"8w7jv4qb78a9y\",\n\t\ttoken : \"qyN3mb4PjM+ZXDOdW4f8KpltMLEfik9DxpqXaALr0RGROd6gPSiwQtBYfRPwWMBLjb+Q/sj37frDI5cUnfVAKg==\"\n\t};\n\n\tvar userId = \"\";\n\n\tvar callbacks = {\n\t\tgetInstance : function(instance){\n\t\t},\n\t\tgetCurrentUser : function(userInfo){\n\t\t\tvar user = new Vue({\n\t\t\t\tel : \"#user-info\",\n\t\t\t\tdata : {\n\t\t\t\t\tuserInfo : userInfo\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\treceiveNewMessage : function(message){\n\t\t\t//show(message);\n\t\t}\n\t};\n\n\tinit(params,callbacks, {\n\t\tRongIMLib : RongIMLib,\n\t\tprotobuf : protobuf\n\t});\n}\n</script>\n\t\n</body>\n</html>"
  },
  {
    "path": "vue/vue-2.1.4.js",
    "content": "/*!\n * Vue.js v2.1.4\n * (c) 2014-2016 Evan You\n * Released under the MIT License.\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.Vue = factory());\n}(this, (function () { 'use strict';\n\n/*  */\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction _toString (val) {\n  return val == null\n    ? ''\n    : typeof val === 'object'\n      ? JSON.stringify(val, null, 2)\n      : String(val)\n}\n\n/**\n * Convert a input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n  var n = parseFloat(val, 10);\n  return (n || n === 0) ? n : val\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n  str,\n  expectsLowerCase\n) {\n  var map = Object.create(null);\n  var list = str.split(',');\n  for (var i = 0; i < list.length; i++) {\n    map[list[i]] = true;\n  }\n  return expectsLowerCase\n    ? function (val) { return map[val.toLowerCase()]; }\n    : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Remove an item from an array\n */\nfunction remove$1 (arr, item) {\n  if (arr.length) {\n    var index = arr.indexOf(item);\n    if (index > -1) {\n      return arr.splice(index, 1)\n    }\n  }\n}\n\n/**\n * Check whether the object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n  return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Check if value is primitive\n */\nfunction isPrimitive (value) {\n  return typeof value === 'string' || typeof value === 'number'\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n  var cache = Object.create(null);\n  return function cachedFn (str) {\n    var hit = cache[str];\n    return hit || (cache[str] = fn(str))\n  }\n}\n\n/**\n * Camelize a hyphen-delmited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n  return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /([^-])([A-Z])/g;\nvar hyphenate = cached(function (str) {\n  return str\n    .replace(hyphenateRE, '$1-$2')\n    .replace(hyphenateRE, '$1-$2')\n    .toLowerCase()\n});\n\n/**\n * Simple bind, faster than native\n */\nfunction bind$1 (fn, ctx) {\n  function boundFn (a) {\n    var l = arguments.length;\n    return l\n      ? l > 1\n        ? fn.apply(ctx, arguments)\n        : fn.call(ctx, a)\n      : fn.call(ctx)\n  }\n  // record original fn length\n  boundFn._length = fn.length;\n  return boundFn\n}\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n  start = start || 0;\n  var i = list.length - start;\n  var ret = new Array(i);\n  while (i--) {\n    ret[i] = list[i + start];\n  }\n  return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n  for (var key in _from) {\n    to[key] = _from[key];\n  }\n  return to\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n  return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n  return toString.call(obj) === OBJECT_STRING\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n  var res = {};\n  for (var i = 0; i < arr.length; i++) {\n    if (arr[i]) {\n      extend(res, arr[i]);\n    }\n  }\n  return res\n}\n\n/**\n * Perform no operation.\n */\nfunction noop () {}\n\n/**\n * Always return false.\n */\nvar no = function () { return false; };\n\n/**\n * Generate a static keys string from compiler modules.\n */\nfunction genStaticKeys (modules) {\n  return modules.reduce(function (keys, m) {\n    return keys.concat(m.staticKeys || [])\n  }, []).join(',')\n}\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n  /* eslint-disable eqeqeq */\n  return a == b || (\n    isObject(a) && isObject(b)\n      ? JSON.stringify(a) === JSON.stringify(b)\n      : false\n  )\n  /* eslint-enable eqeqeq */\n}\n\nfunction looseIndexOf (arr, val) {\n  for (var i = 0; i < arr.length; i++) {\n    if (looseEqual(arr[i], val)) { return i }\n  }\n  return -1\n}\n\n/*  */\n\nvar config = {\n  /**\n   * Option merge strategies (used in core/util/options)\n   */\n  optionMergeStrategies: Object.create(null),\n\n  /**\n   * Whether to suppress warnings.\n   */\n  silent: false,\n\n  /**\n   * Whether to enable devtools\n   */\n  devtools: \"development\" !== 'production',\n\n  /**\n   * Error handler for watcher errors\n   */\n  errorHandler: null,\n\n  /**\n   * Ignore certain custom elements\n   */\n  ignoredElements: null,\n\n  /**\n   * Custom user key aliases for v-on\n   */\n  keyCodes: Object.create(null),\n\n  /**\n   * Check if a tag is reserved so that it cannot be registered as a\n   * component. This is platform-dependent and may be overwritten.\n   */\n  isReservedTag: no,\n\n  /**\n   * Check if a tag is an unknown element.\n   * Platform-dependent.\n   */\n  isUnknownElement: no,\n\n  /**\n   * Get the namespace of an element\n   */\n  getTagNamespace: noop,\n\n  /**\n   * Check if an attribute must be bound using property, e.g. value\n   * Platform-dependent.\n   */\n  mustUseProp: no,\n\n  /**\n   * List of asset types that a component can own.\n   */\n  _assetTypes: [\n    'component',\n    'directive',\n    'filter'\n  ],\n\n  /**\n   * List of lifecycle hooks.\n   */\n  _lifecycleHooks: [\n    'beforeCreate',\n    'created',\n    'beforeMount',\n    'mounted',\n    'beforeUpdate',\n    'updated',\n    'beforeDestroy',\n    'destroyed',\n    'activated',\n    'deactivated'\n  ],\n\n  /**\n   * Max circular updates allowed in a scheduler flush cycle.\n   */\n  _maxUpdateCount: 100\n};\n\n/*  */\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n  var c = (str + '').charCodeAt(0);\n  return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n  Object.defineProperty(obj, key, {\n    value: val,\n    enumerable: !!enumerable,\n    writable: true,\n    configurable: true\n  });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = /[^\\w.$]/;\nfunction parsePath (path) {\n  if (bailRE.test(path)) {\n    return\n  } else {\n    var segments = path.split('.');\n    return function (obj) {\n      for (var i = 0; i < segments.length; i++) {\n        if (!obj) { return }\n        obj = obj[segments[i]];\n      }\n      return obj\n    }\n  }\n}\n\n/*  */\n/* globals MutationObserver */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = UA && UA.indexOf('android') > 0;\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n  if (_isServer === undefined) {\n    /* istanbul ignore if */\n    if (!inBrowser && typeof global !== 'undefined') {\n      // detect presence of vue-server-renderer and avoid\n      // Webpack shimming the process\n      _isServer = global['process'].env.VUE_ENV === 'server';\n    } else {\n      _isServer = false;\n    }\n  }\n  return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n  return /native code/.test(Ctor.toString())\n}\n\n/**\n * Defer a task to execute it asynchronously.\n */\nvar nextTick = (function () {\n  var callbacks = [];\n  var pending = false;\n  var timerFunc;\n\n  function nextTickHandler () {\n    pending = false;\n    var copies = callbacks.slice(0);\n    callbacks.length = 0;\n    for (var i = 0; i < copies.length; i++) {\n      copies[i]();\n    }\n  }\n\n  // the nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore if */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve();\n    var logError = function (err) { console.error(err); };\n    timerFunc = function () {\n      p.then(nextTickHandler).catch(logError);\n      // in problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) { setTimeout(noop); }\n    };\n  } else if (typeof MutationObserver !== 'undefined' && (\n    isNative(MutationObserver) ||\n    // PhantomJS and iOS 7.x\n    MutationObserver.toString() === '[object MutationObserverConstructor]'\n  )) {\n    // use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS IE11, iOS7, Android 4.4\n    var counter = 1;\n    var observer = new MutationObserver(nextTickHandler);\n    var textNode = document.createTextNode(String(counter));\n    observer.observe(textNode, {\n      characterData: true\n    });\n    timerFunc = function () {\n      counter = (counter + 1) % 2;\n      textNode.data = String(counter);\n    };\n  } else {\n    // fallback to setTimeout\n    /* istanbul ignore next */\n    timerFunc = function () {\n      setTimeout(nextTickHandler, 0);\n    };\n  }\n\n  return function queueNextTick (cb, ctx) {\n    var _resolve;\n    callbacks.push(function () {\n      if (cb) { cb.call(ctx); }\n      if (_resolve) { _resolve(ctx); }\n    });\n    if (!pending) {\n      pending = true;\n      timerFunc();\n    }\n    if (!cb && typeof Promise !== 'undefined') {\n      return new Promise(function (resolve) {\n        _resolve = resolve;\n      })\n    }\n  }\n})();\n\nvar _Set;\n/* istanbul ignore if */\nif (typeof Set !== 'undefined' && isNative(Set)) {\n  // use native Set when available.\n  _Set = Set;\n} else {\n  // a non-standard Set polyfill that only works with primitive keys.\n  _Set = (function () {\n    function Set () {\n      this.set = Object.create(null);\n    }\n    Set.prototype.has = function has (key) {\n      return this.set[key] !== undefined\n    };\n    Set.prototype.add = function add (key) {\n      this.set[key] = 1;\n    };\n    Set.prototype.clear = function clear () {\n      this.set = Object.create(null);\n    };\n\n    return Set;\n  }());\n}\n\nvar warn = noop;\nvar formatComponentName;\n\n{\n  var hasConsole = typeof console !== 'undefined';\n\n  warn = function (msg, vm) {\n    if (hasConsole && (!config.silent)) {\n      console.error(\"[Vue warn]: \" + msg + \" \" + (\n        vm ? formatLocation(formatComponentName(vm)) : ''\n      ));\n    }\n  };\n\n  formatComponentName = function (vm) {\n    if (vm.$root === vm) {\n      return 'root instance'\n    }\n    var name = vm._isVue\n      ? vm.$options.name || vm.$options._componentTag\n      : vm.name;\n    return (\n      (name ? (\"component <\" + name + \">\") : \"anonymous component\") +\n      (vm._isVue && vm.$options.__file ? (\" at \" + (vm.$options.__file)) : '')\n    )\n  };\n\n  var formatLocation = function (str) {\n    if (str === 'anonymous component') {\n      str += \" - use the \\\"name\\\" option for better debugging messages.\";\n    }\n    return (\"\\n(found in \" + str + \")\")\n  };\n}\n\n/*  */\n\n\nvar uid$1 = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n  this.id = uid$1++;\n  this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n  this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n  remove$1(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n  if (Dep.target) {\n    Dep.target.addDep(this);\n  }\n};\n\nDep.prototype.notify = function notify () {\n  // stablize the subscriber list first\n  var subs = this.subs.slice();\n  for (var i = 0, l = subs.length; i < l; i++) {\n    subs[i].update();\n  }\n};\n\n// the current target watcher being evaluated.\n// this is globally unique because there could be only one\n// watcher being evaluated at any time.\nDep.target = null;\nvar targetStack = [];\n\nfunction pushTarget (_target) {\n  if (Dep.target) { targetStack.push(Dep.target); }\n  Dep.target = _target;\n}\n\nfunction popTarget () {\n  Dep.target = targetStack.pop();\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);[\n  'push',\n  'pop',\n  'shift',\n  'unshift',\n  'splice',\n  'sort',\n  'reverse'\n]\n.forEach(function (method) {\n  // cache original method\n  var original = arrayProto[method];\n  def(arrayMethods, method, function mutator () {\n    var arguments$1 = arguments;\n\n    // avoid leaking arguments:\n    // http://jsperf.com/closure-with-arguments\n    var i = arguments.length;\n    var args = new Array(i);\n    while (i--) {\n      args[i] = arguments$1[i];\n    }\n    var result = original.apply(this, args);\n    var ob = this.__ob__;\n    var inserted;\n    switch (method) {\n      case 'push':\n        inserted = args;\n        break\n      case 'unshift':\n        inserted = args;\n        break\n      case 'splice':\n        inserted = args.slice(2);\n        break\n    }\n    if (inserted) { ob.observeArray(inserted); }\n    // notify change\n    ob.dep.notify();\n    return result\n  });\n});\n\n/*  */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * By default, when a reactive property is set, the new value is\n * also converted to become reactive. However when passing down props,\n * we don't want to force conversion because the value may be a nested value\n * under a frozen data structure. Converting it would defeat the optimization.\n */\nvar observerState = {\n  shouldConvert: true,\n  isSettingProps: false\n};\n\n/**\n * Observer class that are attached to each observed\n * object. Once attached, the observer converts target\n * object's property keys into getter/setters that\n * collect dependencies and dispatches updates.\n */\nvar Observer = function Observer (value) {\n  this.value = value;\n  this.dep = new Dep();\n  this.vmCount = 0;\n  def(value, '__ob__', this);\n  if (Array.isArray(value)) {\n    var augment = hasProto\n      ? protoAugment\n      : copyAugment;\n    augment(value, arrayMethods, arrayKeys);\n    this.observeArray(value);\n  } else {\n    this.walk(value);\n  }\n};\n\n/**\n * Walk through each property and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n  var keys = Object.keys(obj);\n  for (var i = 0; i < keys.length; i++) {\n    defineReactive$$1(obj, keys[i], obj[keys[i]]);\n  }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n  for (var i = 0, l = items.length; i < l; i++) {\n    observe(items[i]);\n  }\n};\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src) {\n  /* eslint-disable no-proto */\n  target.__proto__ = src;\n  /* eslint-enable no-proto */\n}\n\n/**\n * Augment an target Object or Array by defining\n * hidden properties.\n *\n * istanbul ignore next\n */\nfunction copyAugment (target, src, keys) {\n  for (var i = 0, l = keys.length; i < l; i++) {\n    var key = keys[i];\n    def(target, key, src[key]);\n  }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value) {\n  if (!isObject(value)) {\n    return\n  }\n  var ob;\n  if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n    ob = value.__ob__;\n  } else if (\n    observerState.shouldConvert &&\n    !isServerRendering() &&\n    (Array.isArray(value) || isPlainObject(value)) &&\n    Object.isExtensible(value) &&\n    !value._isVue\n  ) {\n    ob = new Observer(value);\n  }\n  return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive$$1 (\n  obj,\n  key,\n  val,\n  customSetter\n) {\n  var dep = new Dep();\n\n  var property = Object.getOwnPropertyDescriptor(obj, key);\n  if (property && property.configurable === false) {\n    return\n  }\n\n  // cater for pre-defined getter/setters\n  var getter = property && property.get;\n  var setter = property && property.set;\n\n  var childOb = observe(val);\n  Object.defineProperty(obj, key, {\n    enumerable: true,\n    configurable: true,\n    get: function reactiveGetter () {\n      var value = getter ? getter.call(obj) : val;\n      if (Dep.target) {\n        dep.depend();\n        if (childOb) {\n          childOb.dep.depend();\n        }\n        if (Array.isArray(value)) {\n          dependArray(value);\n        }\n      }\n      return value\n    },\n    set: function reactiveSetter (newVal) {\n      var value = getter ? getter.call(obj) : val;\n      /* eslint-disable no-self-compare */\n      if (newVal === value || (newVal !== newVal && value !== value)) {\n        return\n      }\n      /* eslint-enable no-self-compare */\n      if (\"development\" !== 'production' && customSetter) {\n        customSetter();\n      }\n      if (setter) {\n        setter.call(obj, newVal);\n      } else {\n        val = newVal;\n      }\n      childOb = observe(newVal);\n      dep.notify();\n    }\n  });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set$1 (obj, key, val) {\n  if (Array.isArray(obj)) {\n    obj.length = Math.max(obj.length, key);\n    obj.splice(key, 1, val);\n    return val\n  }\n  if (hasOwn(obj, key)) {\n    obj[key] = val;\n    return\n  }\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid adding reactive properties to a Vue instance or its root $data ' +\n      'at runtime - declare it upfront in the data option.'\n    );\n    return\n  }\n  if (!ob) {\n    obj[key] = val;\n    return\n  }\n  defineReactive$$1(ob.value, key, val);\n  ob.dep.notify();\n  return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (obj, key) {\n  var ob = obj.__ob__;\n  if (obj._isVue || (ob && ob.vmCount)) {\n    \"development\" !== 'production' && warn(\n      'Avoid deleting properties on a Vue instance or its root $data ' +\n      '- just set it to null.'\n    );\n    return\n  }\n  if (!hasOwn(obj, key)) {\n    return\n  }\n  delete obj[key];\n  if (!ob) {\n    return\n  }\n  ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n  for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n    e = value[i];\n    e && e.__ob__ && e.__ob__.dep.depend();\n    if (Array.isArray(e)) {\n      dependArray(e);\n    }\n  }\n}\n\n/*  */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\n{\n  strats.el = strats.propsData = function (parent, child, vm, key) {\n    if (!vm) {\n      warn(\n        \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n        'creation with the `new` keyword.'\n      );\n    }\n    return defaultStrat(parent, child)\n  };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n  if (!from) { return to }\n  var key, toVal, fromVal;\n  var keys = Object.keys(from);\n  for (var i = 0; i < keys.length; i++) {\n    key = keys[i];\n    toVal = to[key];\n    fromVal = from[key];\n    if (!hasOwn(to, key)) {\n      set$1(to, key, fromVal);\n    } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {\n      mergeData(toVal, fromVal);\n    }\n  }\n  return to\n}\n\n/**\n * Data\n */\nstrats.data = function (\n  parentVal,\n  childVal,\n  vm\n) {\n  if (!vm) {\n    // in a Vue.extend merge, both should be functions\n    if (!childVal) {\n      return parentVal\n    }\n    if (typeof childVal !== 'function') {\n      \"development\" !== 'production' && warn(\n        'The \"data\" option should be a function ' +\n        'that returns a per-instance value in component ' +\n        'definitions.',\n        vm\n      );\n      return parentVal\n    }\n    if (!parentVal) {\n      return childVal\n    }\n    // when parentVal & childVal are both present,\n    // we need to return a function that returns the\n    // merged result of both functions... no need to\n    // check if parentVal is a function here because\n    // it has to be a function to pass previous merges.\n    return function mergedDataFn () {\n      return mergeData(\n        childVal.call(this),\n        parentVal.call(this)\n      )\n    }\n  } else if (parentVal || childVal) {\n    return function mergedInstanceDataFn () {\n      // instance merge\n      var instanceData = typeof childVal === 'function'\n        ? childVal.call(vm)\n        : childVal;\n      var defaultData = typeof parentVal === 'function'\n        ? parentVal.call(vm)\n        : undefined;\n      if (instanceData) {\n        return mergeData(instanceData, defaultData)\n      } else {\n        return defaultData\n      }\n    }\n  }\n};\n\n/**\n * Hooks and param attributes are merged as arrays.\n */\nfunction mergeHook (\n  parentVal,\n  childVal\n) {\n  return childVal\n    ? parentVal\n      ? parentVal.concat(childVal)\n      : Array.isArray(childVal)\n        ? childVal\n        : [childVal]\n    : parentVal\n}\n\nconfig._lifecycleHooks.forEach(function (hook) {\n  strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (parentVal, childVal) {\n  var res = Object.create(parentVal || null);\n  return childVal\n    ? extend(res, childVal)\n    : res\n}\n\nconfig._assetTypes.forEach(function (type) {\n  strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (parentVal, childVal) {\n  /* istanbul ignore if */\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = {};\n  extend(ret, parentVal);\n  for (var key in childVal) {\n    var parent = ret[key];\n    var child = childVal[key];\n    if (parent && !Array.isArray(parent)) {\n      parent = [parent];\n    }\n    ret[key] = parent\n      ? parent.concat(child)\n      : [child];\n  }\n  return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.computed = function (parentVal, childVal) {\n  if (!childVal) { return parentVal }\n  if (!parentVal) { return childVal }\n  var ret = Object.create(null);\n  extend(ret, parentVal);\n  extend(ret, childVal);\n  return ret\n};\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n  return childVal === undefined\n    ? parentVal\n    : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n  for (var key in options.components) {\n    var lower = key.toLowerCase();\n    if (isBuiltInTag(lower) || config.isReservedTag(lower)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n        'id: ' + key\n      );\n    }\n  }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options) {\n  var props = options.props;\n  if (!props) { return }\n  var res = {};\n  var i, val, name;\n  if (Array.isArray(props)) {\n    i = props.length;\n    while (i--) {\n      val = props[i];\n      if (typeof val === 'string') {\n        name = camelize(val);\n        res[name] = { type: null };\n      } else {\n        warn('props must be strings when using array syntax.');\n      }\n    }\n  } else if (isPlainObject(props)) {\n    for (var key in props) {\n      val = props[key];\n      name = camelize(key);\n      res[name] = isPlainObject(val)\n        ? val\n        : { type: val };\n    }\n  }\n  options.props = res;\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n  var dirs = options.directives;\n  if (dirs) {\n    for (var key in dirs) {\n      var def = dirs[key];\n      if (typeof def === 'function') {\n        dirs[key] = { bind: def, update: def };\n      }\n    }\n  }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n  parent,\n  child,\n  vm\n) {\n  {\n    checkComponents(child);\n  }\n  normalizeProps(child);\n  normalizeDirectives(child);\n  var extendsFrom = child.extends;\n  if (extendsFrom) {\n    parent = typeof extendsFrom === 'function'\n      ? mergeOptions(parent, extendsFrom.options, vm)\n      : mergeOptions(parent, extendsFrom, vm);\n  }\n  if (child.mixins) {\n    for (var i = 0, l = child.mixins.length; i < l; i++) {\n      var mixin = child.mixins[i];\n      if (mixin.prototype instanceof Vue$3) {\n        mixin = mixin.options;\n      }\n      parent = mergeOptions(parent, mixin, vm);\n    }\n  }\n  var options = {};\n  var key;\n  for (key in parent) {\n    mergeField(key);\n  }\n  for (key in child) {\n    if (!hasOwn(parent, key)) {\n      mergeField(key);\n    }\n  }\n  function mergeField (key) {\n    var strat = strats[key] || defaultStrat;\n    options[key] = strat(parent[key], child[key], vm, key);\n  }\n  return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n  options,\n  type,\n  id,\n  warnMissing\n) {\n  /* istanbul ignore if */\n  if (typeof id !== 'string') {\n    return\n  }\n  var assets = options[type];\n  var res = assets[id] ||\n    // camelCase ID\n    assets[camelize(id)] ||\n    // Pascal Case ID\n    assets[capitalize(camelize(id))];\n  if (\"development\" !== 'production' && warnMissing && !res) {\n    warn(\n      'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n      options\n    );\n  }\n  return res\n}\n\n/*  */\n\nfunction validateProp (\n  key,\n  propOptions,\n  propsData,\n  vm\n) {\n  var prop = propOptions[key];\n  var absent = !hasOwn(propsData, key);\n  var value = propsData[key];\n  // handle boolean props\n  if (isBooleanType(prop.type)) {\n    if (absent && !hasOwn(prop, 'default')) {\n      value = false;\n    } else if (value === '' || value === hyphenate(key)) {\n      value = true;\n    }\n  }\n  // check default value\n  if (value === undefined) {\n    value = getPropDefaultValue(vm, prop, key);\n    // since the default value is a fresh copy,\n    // make sure to observe it.\n    var prevShouldConvert = observerState.shouldConvert;\n    observerState.shouldConvert = true;\n    observe(value);\n    observerState.shouldConvert = prevShouldConvert;\n  }\n  {\n    assertProp(prop, key, value, vm, absent);\n  }\n  return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n  // no default, return undefined\n  if (!hasOwn(prop, 'default')) {\n    return undefined\n  }\n  var def = prop.default;\n  // warn against non-factory defaults for Object & Array\n  if (isObject(def)) {\n    \"development\" !== 'production' && warn(\n      'Invalid default value for prop \"' + key + '\": ' +\n      'Props with type Object/Array must use a factory function ' +\n      'to return the default value.',\n      vm\n    );\n  }\n  // the raw prop value was also undefined from previous render,\n  // return previous default value to avoid unnecessary watcher trigger\n  if (vm && vm.$options.propsData &&\n    vm.$options.propsData[key] === undefined &&\n    vm[key] !== undefined) {\n    return vm[key]\n  }\n  // call factory function for non-Function types\n  return typeof def === 'function' && prop.type !== Function\n    ? def.call(vm)\n    : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n  prop,\n  name,\n  value,\n  vm,\n  absent\n) {\n  if (prop.required && absent) {\n    warn(\n      'Missing required prop: \"' + name + '\"',\n      vm\n    );\n    return\n  }\n  if (value == null && !prop.required) {\n    return\n  }\n  var type = prop.type;\n  var valid = !type || type === true;\n  var expectedTypes = [];\n  if (type) {\n    if (!Array.isArray(type)) {\n      type = [type];\n    }\n    for (var i = 0; i < type.length && !valid; i++) {\n      var assertedType = assertType(value, type[i]);\n      expectedTypes.push(assertedType.expectedType);\n      valid = assertedType.valid;\n    }\n  }\n  if (!valid) {\n    warn(\n      'Invalid prop: type check failed for prop \"' + name + '\".' +\n      ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n      ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n      vm\n    );\n    return\n  }\n  var validator = prop.validator;\n  if (validator) {\n    if (!validator(value)) {\n      warn(\n        'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n        vm\n      );\n    }\n  }\n}\n\n/**\n * Assert the type of a value\n */\nfunction assertType (value, type) {\n  var valid;\n  var expectedType = getType(type);\n  if (expectedType === 'String') {\n    valid = typeof value === (expectedType = 'string');\n  } else if (expectedType === 'Number') {\n    valid = typeof value === (expectedType = 'number');\n  } else if (expectedType === 'Boolean') {\n    valid = typeof value === (expectedType = 'boolean');\n  } else if (expectedType === 'Function') {\n    valid = typeof value === (expectedType = 'function');\n  } else if (expectedType === 'Object') {\n    valid = isPlainObject(value);\n  } else if (expectedType === 'Array') {\n    valid = Array.isArray(value);\n  } else {\n    valid = value instanceof type;\n  }\n  return {\n    valid: valid,\n    expectedType: expectedType\n  }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n  var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n  return match && match[1]\n}\n\nfunction isBooleanType (fn) {\n  if (!Array.isArray(fn)) {\n    return getType(fn) === 'Boolean'\n  }\n  for (var i = 0, len = fn.length; i < len; i++) {\n    if (getType(fn[i]) === 'Boolean') {\n      return true\n    }\n  }\n  /* istanbul ignore next */\n  return false\n}\n\n\n\nvar util = Object.freeze({\n  defineReactive: defineReactive$$1,\n  _toString: _toString,\n  toNumber: toNumber,\n  makeMap: makeMap,\n  isBuiltInTag: isBuiltInTag,\n  remove: remove$1,\n  hasOwn: hasOwn,\n  isPrimitive: isPrimitive,\n  cached: cached,\n  camelize: camelize,\n  capitalize: capitalize,\n  hyphenate: hyphenate,\n  bind: bind$1,\n  toArray: toArray,\n  extend: extend,\n  isObject: isObject,\n  isPlainObject: isPlainObject,\n  toObject: toObject,\n  noop: noop,\n  no: no,\n  genStaticKeys: genStaticKeys,\n  looseEqual: looseEqual,\n  looseIndexOf: looseIndexOf,\n  isReserved: isReserved,\n  def: def,\n  parsePath: parsePath,\n  hasProto: hasProto,\n  inBrowser: inBrowser,\n  UA: UA,\n  isIE: isIE,\n  isIE9: isIE9,\n  isEdge: isEdge,\n  isAndroid: isAndroid,\n  isIOS: isIOS,\n  isServerRendering: isServerRendering,\n  devtools: devtools,\n  nextTick: nextTick,\n  get _Set () { return _Set; },\n  mergeOptions: mergeOptions,\n  resolveAsset: resolveAsset,\n  get warn () { return warn; },\n  get formatComponentName () { return formatComponentName; },\n  validateProp: validateProp\n});\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\n{\n  var allowedGlobals = makeMap(\n    'Infinity,undefined,NaN,isFinite,isNaN,' +\n    'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n    'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n    'require' // for Webpack/Browserify\n  );\n\n  var warnNonPresent = function (target, key) {\n    warn(\n      \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n      \"referenced during render. Make sure to declare reactive data \" +\n      \"properties in the data option.\",\n      target\n    );\n  };\n\n  var hasProxy =\n    typeof Proxy !== 'undefined' &&\n    Proxy.toString().match(/native code/);\n\n  if (hasProxy) {\n    var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');\n    config.keyCodes = new Proxy(config.keyCodes, {\n      set: function set (target, key, value) {\n        if (isBuiltInModifier(key)) {\n          warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n          return false\n        } else {\n          target[key] = value;\n          return true\n        }\n      }\n    });\n  }\n\n  var hasHandler = {\n    has: function has (target, key) {\n      var has = key in target;\n      var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';\n      if (!has && !isAllowed) {\n        warnNonPresent(target, key);\n      }\n      return has || !isAllowed\n    }\n  };\n\n  var getHandler = {\n    get: function get (target, key) {\n      if (typeof key === 'string' && !(key in target)) {\n        warnNonPresent(target, key);\n      }\n      return target[key]\n    }\n  };\n\n  initProxy = function initProxy (vm) {\n    if (hasProxy) {\n      // determine which proxy handler to use\n      var options = vm.$options;\n      var handlers = options.render && options.render._withStripped\n        ? getHandler\n        : hasHandler;\n      vm._renderProxy = new Proxy(vm, handlers);\n    } else {\n      vm._renderProxy = vm;\n    }\n  };\n}\n\n/*  */\n\n\nvar queue = [];\nvar has$1 = {};\nvar circular = {};\nvar waiting = false;\nvar flushing = false;\nvar index = 0;\n\n/**\n * Reset the scheduler's state.\n */\nfunction resetSchedulerState () {\n  queue.length = 0;\n  has$1 = {};\n  {\n    circular = {};\n  }\n  waiting = flushing = false;\n}\n\n/**\n * Flush both queues and run the watchers.\n */\nfunction flushSchedulerQueue () {\n  flushing = true;\n\n  // Sort queue before flush.\n  // This ensures that:\n  // 1. Components are updated from parent to child. (because parent is always\n  //    created before the child)\n  // 2. A component's user watchers are run before its render watcher (because\n  //    user watchers are created before the render watcher)\n  // 3. If a component is destroyed during a parent component's watcher run,\n  //    its watchers can be skipped.\n  queue.sort(function (a, b) { return a.id - b.id; });\n\n  // do not cache length because more watchers might be pushed\n  // as we run existing watchers\n  for (index = 0; index < queue.length; index++) {\n    var watcher = queue[index];\n    var id = watcher.id;\n    has$1[id] = null;\n    watcher.run();\n    // in dev build, check and stop circular updates.\n    if (\"development\" !== 'production' && has$1[id] != null) {\n      circular[id] = (circular[id] || 0) + 1;\n      if (circular[id] > config._maxUpdateCount) {\n        warn(\n          'You may have an infinite update loop ' + (\n            watcher.user\n              ? (\"in watcher with expression \\\"\" + (watcher.expression) + \"\\\"\")\n              : \"in a component render function.\"\n          ),\n          watcher.vm\n        );\n        break\n      }\n    }\n  }\n\n  // devtool hook\n  /* istanbul ignore if */\n  if (devtools && config.devtools) {\n    devtools.emit('flush');\n  }\n\n  resetSchedulerState();\n}\n\n/**\n * Push a watcher into the watcher queue.\n * Jobs with duplicate IDs will be skipped unless it's\n * pushed when the queue is being flushed.\n */\nfunction queueWatcher (watcher) {\n  var id = watcher.id;\n  if (has$1[id] == null) {\n    has$1[id] = true;\n    if (!flushing) {\n      queue.push(watcher);\n    } else {\n      // if already flushing, splice the watcher based on its id\n      // if already past its id, it will be run next immediately.\n      var i = queue.length - 1;\n      while (i >= 0 && queue[i].id > watcher.id) {\n        i--;\n      }\n      queue.splice(Math.max(i, index) + 1, 0, watcher);\n    }\n    // queue the flush\n    if (!waiting) {\n      waiting = true;\n      nextTick(flushSchedulerQueue);\n    }\n  }\n}\n\n/*  */\n\nvar uid$2 = 0;\n\n/**\n * A watcher parses an expression, collects dependencies,\n * and fires callback when the expression value changes.\n * This is used for both the $watch() api and directives.\n */\nvar Watcher = function Watcher (\n  vm,\n  expOrFn,\n  cb,\n  options\n) {\n  if ( options === void 0 ) options = {};\n\n  this.vm = vm;\n  vm._watchers.push(this);\n  // options\n  this.deep = !!options.deep;\n  this.user = !!options.user;\n  this.lazy = !!options.lazy;\n  this.sync = !!options.sync;\n  this.expression = expOrFn.toString();\n  this.cb = cb;\n  this.id = ++uid$2; // uid for batching\n  this.active = true;\n  this.dirty = this.lazy; // for lazy watchers\n  this.deps = [];\n  this.newDeps = [];\n  this.depIds = new _Set();\n  this.newDepIds = new _Set();\n  // parse expression for getter\n  if (typeof expOrFn === 'function') {\n    this.getter = expOrFn;\n  } else {\n    this.getter = parsePath(expOrFn);\n    if (!this.getter) {\n      this.getter = function () {};\n      \"development\" !== 'production' && warn(\n        \"Failed watching path: \\\"\" + expOrFn + \"\\\" \" +\n        'Watcher only accepts simple dot-delimited paths. ' +\n        'For full control, use a function instead.',\n        vm\n      );\n    }\n  }\n  this.value = this.lazy\n    ? undefined\n    : this.get();\n};\n\n/**\n * Evaluate the getter, and re-collect dependencies.\n */\nWatcher.prototype.get = function get () {\n  pushTarget(this);\n  var value = this.getter.call(this.vm, this.vm);\n  // \"touch\" every property so they are all tracked as\n  // dependencies for deep watching\n  if (this.deep) {\n    traverse(value);\n  }\n  popTarget();\n  this.cleanupDeps();\n  return value\n};\n\n/**\n * Add a dependency to this directive.\n */\nWatcher.prototype.addDep = function addDep (dep) {\n  var id = dep.id;\n  if (!this.newDepIds.has(id)) {\n    this.newDepIds.add(id);\n    this.newDeps.push(dep);\n    if (!this.depIds.has(id)) {\n      dep.addSub(this);\n    }\n  }\n};\n\n/**\n * Clean up for dependency collection.\n */\nWatcher.prototype.cleanupDeps = function cleanupDeps () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    var dep = this$1.deps[i];\n    if (!this$1.newDepIds.has(dep.id)) {\n      dep.removeSub(this$1);\n    }\n  }\n  var tmp = this.depIds;\n  this.depIds = this.newDepIds;\n  this.newDepIds = tmp;\n  this.newDepIds.clear();\n  tmp = this.deps;\n  this.deps = this.newDeps;\n  this.newDeps = tmp;\n  this.newDeps.length = 0;\n};\n\n/**\n * Subscriber interface.\n * Will be called when a dependency changes.\n */\nWatcher.prototype.update = function update () {\n  /* istanbul ignore else */\n  if (this.lazy) {\n    this.dirty = true;\n  } else if (this.sync) {\n    this.run();\n  } else {\n    queueWatcher(this);\n  }\n};\n\n/**\n * Scheduler job interface.\n * Will be called by the scheduler.\n */\nWatcher.prototype.run = function run () {\n  if (this.active) {\n    var value = this.get();\n      if (\n        value !== this.value ||\n      // Deep watchers and watchers on Object/Arrays should fire even\n      // when the value is the same, because the value may\n      // have mutated.\n      isObject(value) ||\n      this.deep\n    ) {\n      // set new value\n      var oldValue = this.value;\n      this.value = value;\n      if (this.user) {\n        try {\n          this.cb.call(this.vm, value, oldValue);\n        } catch (e) {\n          /* istanbul ignore else */\n          if (config.errorHandler) {\n            config.errorHandler.call(null, e, this.vm);\n          } else {\n            \"development\" !== 'production' && warn(\n              (\"Error in watcher \\\"\" + (this.expression) + \"\\\"\"),\n              this.vm\n            );\n            throw e\n          }\n        }\n      } else {\n        this.cb.call(this.vm, value, oldValue);\n      }\n    }\n  }\n};\n\n/**\n * Evaluate the value of the watcher.\n * This only gets called for lazy watchers.\n */\nWatcher.prototype.evaluate = function evaluate () {\n  this.value = this.get();\n  this.dirty = false;\n};\n\n/**\n * Depend on all deps collected by this watcher.\n */\nWatcher.prototype.depend = function depend () {\n    var this$1 = this;\n\n  var i = this.deps.length;\n  while (i--) {\n    this$1.deps[i].depend();\n  }\n};\n\n/**\n * Remove self from all dependencies' subscriber list.\n */\nWatcher.prototype.teardown = function teardown () {\n    var this$1 = this;\n\n  if (this.active) {\n    // remove self from vm's watcher list\n    // this is a somewhat expensive operation so we skip it\n    // if the vm is being destroyed or is performing a v-for\n    // re-render (the watcher list is then filtered by v-for).\n    if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {\n      remove$1(this.vm._watchers, this);\n    }\n    var i = this.deps.length;\n    while (i--) {\n      this$1.deps[i].removeSub(this$1);\n    }\n    this.active = false;\n  }\n};\n\n/**\n * Recursively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n */\nvar seenObjects = new _Set();\nfunction traverse (val) {\n  seenObjects.clear();\n  _traverse(val, seenObjects);\n}\n\nfunction _traverse (val, seen) {\n  var i, keys;\n  var isA = Array.isArray(val);\n  if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {\n    return\n  }\n  if (val.__ob__) {\n    var depId = val.__ob__.dep.id;\n    if (seen.has(depId)) {\n      return\n    }\n    seen.add(depId);\n  }\n  if (isA) {\n    i = val.length;\n    while (i--) { _traverse(val[i], seen); }\n  } else {\n    keys = Object.keys(val);\n    i = keys.length;\n    while (i--) { _traverse(val[keys[i]], seen); }\n  }\n}\n\n/*  */\n\nfunction initState (vm) {\n  vm._watchers = [];\n  initProps(vm);\n  initMethods(vm);\n  initData(vm);\n  initComputed(vm);\n  initWatch(vm);\n}\n\nvar isReservedProp = { key: 1, ref: 1, slot: 1 };\n\nfunction initProps (vm) {\n  var props = vm.$options.props;\n  if (props) {\n    var propsData = vm.$options.propsData || {};\n    var keys = vm.$options._propKeys = Object.keys(props);\n    var isRoot = !vm.$parent;\n    // root instance props should be converted\n    observerState.shouldConvert = isRoot;\n    var loop = function ( i ) {\n      var key = keys[i];\n      /* istanbul ignore else */\n      {\n        if (isReservedProp[key]) {\n          warn(\n            (\"\\\"\" + key + \"\\\" is a reserved attribute and cannot be used as component prop.\"),\n            vm\n          );\n        }\n        defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {\n          if (vm.$parent && !observerState.isSettingProps) {\n            warn(\n              \"Avoid mutating a prop directly since the value will be \" +\n              \"overwritten whenever the parent component re-renders. \" +\n              \"Instead, use a data or computed property based on the prop's \" +\n              \"value. Prop being mutated: \\\"\" + key + \"\\\"\",\n              vm\n            );\n          }\n        });\n      }\n    };\n\n    for (var i = 0; i < keys.length; i++) loop( i );\n    observerState.shouldConvert = true;\n  }\n}\n\nfunction initData (vm) {\n  var data = vm.$options.data;\n  data = vm._data = typeof data === 'function'\n    ? data.call(vm)\n    : data || {};\n  if (!isPlainObject(data)) {\n    data = {};\n    \"development\" !== 'production' && warn(\n      'data functions should return an object.',\n      vm\n    );\n  }\n  // proxy data on instance\n  var keys = Object.keys(data);\n  var props = vm.$options.props;\n  var i = keys.length;\n  while (i--) {\n    if (props && hasOwn(props, keys[i])) {\n      \"development\" !== 'production' && warn(\n        \"The data property \\\"\" + (keys[i]) + \"\\\" is already declared as a prop. \" +\n        \"Use prop default value instead.\",\n        vm\n      );\n    } else {\n      proxy(vm, keys[i]);\n    }\n  }\n  // observe data\n  observe(data);\n  data.__ob__ && data.__ob__.vmCount++;\n}\n\nvar computedSharedDefinition = {\n  enumerable: true,\n  configurable: true,\n  get: noop,\n  set: noop\n};\n\nfunction initComputed (vm) {\n  var computed = vm.$options.computed;\n  if (computed) {\n    for (var key in computed) {\n      var userDef = computed[key];\n      if (typeof userDef === 'function') {\n        computedSharedDefinition.get = makeComputedGetter(userDef, vm);\n        computedSharedDefinition.set = noop;\n      } else {\n        computedSharedDefinition.get = userDef.get\n          ? userDef.cache !== false\n            ? makeComputedGetter(userDef.get, vm)\n            : bind$1(userDef.get, vm)\n          : noop;\n        computedSharedDefinition.set = userDef.set\n          ? bind$1(userDef.set, vm)\n          : noop;\n      }\n      Object.defineProperty(vm, key, computedSharedDefinition);\n    }\n  }\n}\n\nfunction makeComputedGetter (getter, owner) {\n  var watcher = new Watcher(owner, getter, noop, {\n    lazy: true\n  });\n  return function computedGetter () {\n    if (watcher.dirty) {\n      watcher.evaluate();\n    }\n    if (Dep.target) {\n      watcher.depend();\n    }\n    return watcher.value\n  }\n}\n\nfunction initMethods (vm) {\n  var methods = vm.$options.methods;\n  if (methods) {\n    for (var key in methods) {\n      vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);\n      if (\"development\" !== 'production' && methods[key] == null) {\n        warn(\n          \"method \\\"\" + key + \"\\\" has an undefined value in the component definition. \" +\n          \"Did you reference the function correctly?\",\n          vm\n        );\n      }\n    }\n  }\n}\n\nfunction initWatch (vm) {\n  var watch = vm.$options.watch;\n  if (watch) {\n    for (var key in watch) {\n      var handler = watch[key];\n      if (Array.isArray(handler)) {\n        for (var i = 0; i < handler.length; i++) {\n          createWatcher(vm, key, handler[i]);\n        }\n      } else {\n        createWatcher(vm, key, handler);\n      }\n    }\n  }\n}\n\nfunction createWatcher (vm, key, handler) {\n  var options;\n  if (isPlainObject(handler)) {\n    options = handler;\n    handler = handler.handler;\n  }\n  if (typeof handler === 'string') {\n    handler = vm[handler];\n  }\n  vm.$watch(key, handler, options);\n}\n\nfunction stateMixin (Vue) {\n  // flow somehow has problems with directly declared definition object\n  // when using Object.defineProperty, so we have to procedurally build up\n  // the object here.\n  var dataDef = {};\n  dataDef.get = function () {\n    return this._data\n  };\n  {\n    dataDef.set = function (newData) {\n      warn(\n        'Avoid replacing instance root $data. ' +\n        'Use nested data properties instead.',\n        this\n      );\n    };\n  }\n  Object.defineProperty(Vue.prototype, '$data', dataDef);\n\n  Vue.prototype.$set = set$1;\n  Vue.prototype.$delete = del;\n\n  Vue.prototype.$watch = function (\n    expOrFn,\n    cb,\n    options\n  ) {\n    var vm = this;\n    options = options || {};\n    options.user = true;\n    var watcher = new Watcher(vm, expOrFn, cb, options);\n    if (options.immediate) {\n      cb.call(vm, watcher.value);\n    }\n    return function unwatchFn () {\n      watcher.teardown();\n    }\n  };\n}\n\nfunction proxy (vm, key) {\n  if (!isReserved(key)) {\n    Object.defineProperty(vm, key, {\n      configurable: true,\n      enumerable: true,\n      get: function proxyGetter () {\n        return vm._data[key]\n      },\n      set: function proxySetter (val) {\n        vm._data[key] = val;\n      }\n    });\n  }\n}\n\n/*  */\n\nvar VNode = function VNode (\n  tag,\n  data,\n  children,\n  text,\n  elm,\n  ns,\n  context,\n  componentOptions\n) {\n  this.tag = tag;\n  this.data = data;\n  this.children = children;\n  this.text = text;\n  this.elm = elm;\n  this.ns = ns;\n  this.context = context;\n  this.functionalContext = undefined;\n  this.key = data && data.key;\n  this.componentOptions = componentOptions;\n  this.child = undefined;\n  this.parent = undefined;\n  this.raw = false;\n  this.isStatic = false;\n  this.isRootInsert = true;\n  this.isComment = false;\n  this.isCloned = false;\n  this.isOnce = false;\n};\n\nvar emptyVNode = function () {\n  var node = new VNode();\n  node.text = '';\n  node.isComment = true;\n  return node\n};\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n  var cloned = new VNode(\n    vnode.tag,\n    vnode.data,\n    vnode.children,\n    vnode.text,\n    vnode.elm,\n    vnode.ns,\n    vnode.context,\n    vnode.componentOptions\n  );\n  cloned.isStatic = vnode.isStatic;\n  cloned.key = vnode.key;\n  cloned.isCloned = true;\n  return cloned\n}\n\nfunction cloneVNodes (vnodes) {\n  var res = new Array(vnodes.length);\n  for (var i = 0; i < vnodes.length; i++) {\n    res[i] = cloneVNode(vnodes[i]);\n  }\n  return res\n}\n\n/*  */\n\nfunction mergeVNodeHook (def, hookKey, hook, key) {\n  key = key + hookKey;\n  var injectedHash = def.__injected || (def.__injected = {});\n  if (!injectedHash[key]) {\n    injectedHash[key] = true;\n    var oldHook = def[hookKey];\n    if (oldHook) {\n      def[hookKey] = function () {\n        oldHook.apply(this, arguments);\n        hook.apply(this, arguments);\n      };\n    } else {\n      def[hookKey] = hook;\n    }\n  }\n}\n\n/*  */\n\nfunction updateListeners (\n  on,\n  oldOn,\n  add,\n  remove$$1,\n  vm\n) {\n  var name, cur, old, fn, event, capture, once;\n  for (name in on) {\n    cur = on[name];\n    old = oldOn[name];\n    if (!cur) {\n      \"development\" !== 'production' && warn(\n        \"Invalid handler for event \\\"\" + name + \"\\\": got \" + String(cur),\n        vm\n      );\n    } else if (!old) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      if (Array.isArray(cur)) {\n        add(event, (cur.invoker = arrInvoker(cur)), once, capture);\n      } else {\n        if (!cur.invoker) {\n          fn = cur;\n          cur = on[name] = {};\n          cur.fn = fn;\n          cur.invoker = fnInvoker(cur);\n        }\n        add(event, cur.invoker, once, capture);\n      }\n    } else if (cur !== old) {\n      if (Array.isArray(old)) {\n        old.length = cur.length;\n        for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }\n        on[name] = old;\n      } else {\n        old.fn = cur;\n        on[name] = old;\n      }\n    }\n  }\n  for (name in oldOn) {\n    if (!on[name]) {\n      once = name.charAt(0) === '~'; // Prefixed last, checked first\n      event = once ? name.slice(1) : name;\n      capture = event.charAt(0) === '!';\n      event = capture ? event.slice(1) : event;\n      remove$$1(event, oldOn[name].invoker, capture);\n    }\n  }\n}\n\nfunction arrInvoker (arr) {\n  return function (ev) {\n    var arguments$1 = arguments;\n\n    var single = arguments.length === 1;\n    for (var i = 0; i < arr.length; i++) {\n      single ? arr[i](ev) : arr[i].apply(null, arguments$1);\n    }\n  }\n}\n\nfunction fnInvoker (o) {\n  return function (ev) {\n    var single = arguments.length === 1;\n    single ? o.fn(ev) : o.fn.apply(null, arguments);\n  }\n}\n\n/*  */\n\nfunction normalizeChildren (\n  children,\n  ns,\n  nestedIndex\n) {\n  if (isPrimitive(children)) {\n    return [createTextVNode(children)]\n  }\n  if (Array.isArray(children)) {\n    var res = [];\n    for (var i = 0, l = children.length; i < l; i++) {\n      var c = children[i];\n      var last = res[res.length - 1];\n      //  nested\n      if (Array.isArray(c)) {\n        res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + \"_\" + i)));\n      } else if (isPrimitive(c)) {\n        if (last && last.text) {\n          last.text += String(c);\n        } else if (c !== '') {\n          // convert primitive to vnode\n          res.push(createTextVNode(c));\n        }\n      } else if (c instanceof VNode) {\n        if (c.text && last && last.text) {\n          if (!last.isCloned) {\n            last.text += c.text;\n          }\n        } else {\n          // inherit parent namespace\n          if (ns) {\n            applyNS(c, ns);\n          }\n          // default key for nested array children (likely generated by v-for)\n          if (c.tag && c.key == null && nestedIndex != null) {\n            c.key = \"__vlist\" + nestedIndex + \"_\" + i + \"__\";\n          }\n          res.push(c);\n        }\n      }\n    }\n    return res\n  }\n}\n\nfunction createTextVNode (val) {\n  return new VNode(undefined, undefined, undefined, String(val))\n}\n\nfunction applyNS (vnode, ns) {\n  if (vnode.tag && !vnode.ns) {\n    vnode.ns = ns;\n    if (vnode.children) {\n      for (var i = 0, l = vnode.children.length; i < l; i++) {\n        applyNS(vnode.children[i], ns);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction getFirstComponentChild (children) {\n  return children && children.filter(function (c) { return c && c.componentOptions; })[0]\n}\n\n/*  */\n\nvar activeInstance = null;\n\nfunction initLifecycle (vm) {\n  var options = vm.$options;\n\n  // locate first non-abstract parent\n  var parent = options.parent;\n  if (parent && !options.abstract) {\n    while (parent.$options.abstract && parent.$parent) {\n      parent = parent.$parent;\n    }\n    parent.$children.push(vm);\n  }\n\n  vm.$parent = parent;\n  vm.$root = parent ? parent.$root : vm;\n\n  vm.$children = [];\n  vm.$refs = {};\n\n  vm._watcher = null;\n  vm._inactive = false;\n  vm._isMounted = false;\n  vm._isDestroyed = false;\n  vm._isBeingDestroyed = false;\n}\n\nfunction lifecycleMixin (Vue) {\n  Vue.prototype._mount = function (\n    el,\n    hydrating\n  ) {\n    var vm = this;\n    vm.$el = el;\n    if (!vm.$options.render) {\n      vm.$options.render = emptyVNode;\n      {\n        /* istanbul ignore if */\n        if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {\n          warn(\n            'You are using the runtime-only build of Vue where the template ' +\n            'option is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n            vm\n          );\n        } else {\n          warn(\n            'Failed to mount component: template or render function not defined.',\n            vm\n          );\n        }\n      }\n    }\n    callHook(vm, 'beforeMount');\n    vm._watcher = new Watcher(vm, function () {\n      vm._update(vm._render(), hydrating);\n    }, noop);\n    hydrating = false;\n    // manually mounted instance, call mounted on self\n    // mounted is called for render-created child components in its inserted hook\n    if (vm.$vnode == null) {\n      vm._isMounted = true;\n      callHook(vm, 'mounted');\n    }\n    return vm\n  };\n\n  Vue.prototype._update = function (vnode, hydrating) {\n    var vm = this;\n    if (vm._isMounted) {\n      callHook(vm, 'beforeUpdate');\n    }\n    var prevEl = vm.$el;\n    var prevVnode = vm._vnode;\n    var prevActiveInstance = activeInstance;\n    activeInstance = vm;\n    vm._vnode = vnode;\n    // Vue.prototype.__patch__ is injected in entry points\n    // based on the rendering backend used.\n    if (!prevVnode) {\n      // initial render\n      vm.$el = vm.__patch__(\n        vm.$el, vnode, hydrating, false /* removeOnly */,\n        vm.$options._parentElm,\n        vm.$options._refElm\n      );\n    } else {\n      // updates\n      vm.$el = vm.__patch__(prevVnode, vnode);\n    }\n    activeInstance = prevActiveInstance;\n    // update __vue__ reference\n    if (prevEl) {\n      prevEl.__vue__ = null;\n    }\n    if (vm.$el) {\n      vm.$el.__vue__ = vm;\n    }\n    // if parent is an HOC, update its $el as well\n    if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n      vm.$parent.$el = vm.$el;\n    }\n    if (vm._isMounted) {\n      callHook(vm, 'updated');\n    }\n  };\n\n  Vue.prototype._updateFromParent = function (\n    propsData,\n    listeners,\n    parentVnode,\n    renderChildren\n  ) {\n    var vm = this;\n    var hasChildren = !!(vm.$options._renderChildren || renderChildren);\n    vm.$options._parentVnode = parentVnode;\n    vm.$vnode = parentVnode; // update vm's placeholder node without re-render\n    if (vm._vnode) { // update child tree's parent\n      vm._vnode.parent = parentVnode;\n    }\n    vm.$options._renderChildren = renderChildren;\n    // update props\n    if (propsData && vm.$options.props) {\n      observerState.shouldConvert = false;\n      {\n        observerState.isSettingProps = true;\n      }\n      var propKeys = vm.$options._propKeys || [];\n      for (var i = 0; i < propKeys.length; i++) {\n        var key = propKeys[i];\n        vm[key] = validateProp(key, vm.$options.props, propsData, vm);\n      }\n      observerState.shouldConvert = true;\n      {\n        observerState.isSettingProps = false;\n      }\n      vm.$options.propsData = propsData;\n    }\n    // update listeners\n    if (listeners) {\n      var oldListeners = vm.$options._parentListeners;\n      vm.$options._parentListeners = listeners;\n      vm._updateListeners(listeners, oldListeners);\n    }\n    // resolve slots + force update if has children\n    if (hasChildren) {\n      vm.$slots = resolveSlots(renderChildren, parentVnode.context);\n      vm.$forceUpdate();\n    }\n  };\n\n  Vue.prototype.$forceUpdate = function () {\n    var vm = this;\n    if (vm._watcher) {\n      vm._watcher.update();\n    }\n  };\n\n  Vue.prototype.$destroy = function () {\n    var vm = this;\n    if (vm._isBeingDestroyed) {\n      return\n    }\n    callHook(vm, 'beforeDestroy');\n    vm._isBeingDestroyed = true;\n    // remove self from parent\n    var parent = vm.$parent;\n    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n      remove$1(parent.$children, vm);\n    }\n    // teardown watchers\n    if (vm._watcher) {\n      vm._watcher.teardown();\n    }\n    var i = vm._watchers.length;\n    while (i--) {\n      vm._watchers[i].teardown();\n    }\n    // remove reference from data ob\n    // frozen object may not have observer.\n    if (vm._data.__ob__) {\n      vm._data.__ob__.vmCount--;\n    }\n    // call the last hook...\n    vm._isDestroyed = true;\n    callHook(vm, 'destroyed');\n    // turn off all instance listeners.\n    vm.$off();\n    // remove __vue__ reference\n    if (vm.$el) {\n      vm.$el.__vue__ = null;\n    }\n    // invoke destroy hooks on current rendered tree\n    vm.__patch__(vm._vnode, null);\n  };\n}\n\nfunction callHook (vm, hook) {\n  var handlers = vm.$options[hook];\n  if (handlers) {\n    for (var i = 0, j = handlers.length; i < j; i++) {\n      handlers[i].call(vm);\n    }\n  }\n  vm.$emit('hook:' + hook);\n}\n\n/*  */\n\nvar hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };\nvar hooksToMerge = Object.keys(hooks);\n\nfunction createComponent (\n  Ctor,\n  data,\n  context,\n  children,\n  tag\n) {\n  if (!Ctor) {\n    return\n  }\n\n  var baseCtor = context.$options._base;\n  if (isObject(Ctor)) {\n    Ctor = baseCtor.extend(Ctor);\n  }\n\n  if (typeof Ctor !== 'function') {\n    {\n      warn((\"Invalid Component definition: \" + (String(Ctor))), context);\n    }\n    return\n  }\n\n  // async component\n  if (!Ctor.cid) {\n    if (Ctor.resolved) {\n      Ctor = Ctor.resolved;\n    } else {\n      Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {\n        // it's ok to queue this on every render because\n        // $forceUpdate is buffered by the scheduler.\n        context.$forceUpdate();\n      });\n      if (!Ctor) {\n        // return nothing if this is indeed an async component\n        // wait for the callback to trigger parent update.\n        return\n      }\n    }\n  }\n\n  // resolve constructor options in case global mixins are applied after\n  // component constructor creation\n  resolveConstructorOptions(Ctor);\n\n  data = data || {};\n\n  // extract props\n  var propsData = extractProps(data, Ctor);\n\n  // functional component\n  if (Ctor.options.functional) {\n    return createFunctionalComponent(Ctor, propsData, data, context, children)\n  }\n\n  // extract listeners, since these needs to be treated as\n  // child component listeners instead of DOM listeners\n  var listeners = data.on;\n  // replace with listeners with .native modifier\n  data.on = data.nativeOn;\n\n  if (Ctor.options.abstract) {\n    // abstract components do not keep anything\n    // other than props & listeners\n    data = {};\n  }\n\n  // merge component management hooks onto the placeholder node\n  mergeHooks(data);\n\n  // return a placeholder vnode\n  var name = Ctor.options.name || tag;\n  var vnode = new VNode(\n    (\"vue-component-\" + (Ctor.cid) + (name ? (\"-\" + name) : '')),\n    data, undefined, undefined, undefined, undefined, context,\n    { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }\n  );\n  return vnode\n}\n\nfunction createFunctionalComponent (\n  Ctor,\n  propsData,\n  data,\n  context,\n  children\n) {\n  var props = {};\n  var propOptions = Ctor.options.props;\n  if (propOptions) {\n    for (var key in propOptions) {\n      props[key] = validateProp(key, propOptions, propsData);\n    }\n  }\n  var vnode = Ctor.options.render.call(\n    null,\n    // ensure the createElement function in functional components\n    // gets a unique context - this is necessary for correct named slot check\n    bind$1(createElement, { _self: Object.create(context) }),\n    {\n      props: props,\n      data: data,\n      parent: context,\n      children: normalizeChildren(children),\n      slots: function () { return resolveSlots(children, context); }\n    }\n  );\n  if (vnode instanceof VNode) {\n    vnode.functionalContext = context;\n    if (data.slot) {\n      (vnode.data || (vnode.data = {})).slot = data.slot;\n    }\n  }\n  return vnode\n}\n\nfunction createComponentInstanceForVnode (\n  vnode, // we know it's MountedComponentVNode but flow doesn't\n  parent, // activeInstance in lifecycle state\n  parentElm,\n  refElm\n) {\n  var vnodeComponentOptions = vnode.componentOptions;\n  var options = {\n    _isComponent: true,\n    parent: parent,\n    propsData: vnodeComponentOptions.propsData,\n    _componentTag: vnodeComponentOptions.tag,\n    _parentVnode: vnode,\n    _parentListeners: vnodeComponentOptions.listeners,\n    _renderChildren: vnodeComponentOptions.children,\n    _parentElm: parentElm || null,\n    _refElm: refElm || null\n  };\n  // check inline-template render functions\n  var inlineTemplate = vnode.data.inlineTemplate;\n  if (inlineTemplate) {\n    options.render = inlineTemplate.render;\n    options.staticRenderFns = inlineTemplate.staticRenderFns;\n  }\n  return new vnodeComponentOptions.Ctor(options)\n}\n\nfunction init (\n  vnode,\n  hydrating,\n  parentElm,\n  refElm\n) {\n  if (!vnode.child || vnode.child._isDestroyed) {\n    var child = vnode.child = createComponentInstanceForVnode(\n      vnode,\n      activeInstance,\n      parentElm,\n      refElm\n    );\n    child.$mount(hydrating ? vnode.elm : undefined, hydrating);\n  } else if (vnode.data.keepAlive) {\n    // kept-alive components, treat as a patch\n    var mountedNode = vnode; // work around flow\n    prepatch(mountedNode, mountedNode);\n  }\n}\n\nfunction prepatch (\n  oldVnode,\n  vnode\n) {\n  var options = vnode.componentOptions;\n  var child = vnode.child = oldVnode.child;\n  child._updateFromParent(\n    options.propsData, // updated props\n    options.listeners, // updated listeners\n    vnode, // new parent vnode\n    options.children // new children\n  );\n}\n\nfunction insert (vnode) {\n  if (!vnode.child._isMounted) {\n    vnode.child._isMounted = true;\n    callHook(vnode.child, 'mounted');\n  }\n  if (vnode.data.keepAlive) {\n    vnode.child._inactive = false;\n    callHook(vnode.child, 'activated');\n  }\n}\n\nfunction destroy$1 (vnode) {\n  if (!vnode.child._isDestroyed) {\n    if (!vnode.data.keepAlive) {\n      vnode.child.$destroy();\n    } else {\n      vnode.child._inactive = true;\n      callHook(vnode.child, 'deactivated');\n    }\n  }\n}\n\nfunction resolveAsyncComponent (\n  factory,\n  baseCtor,\n  cb\n) {\n  if (factory.requested) {\n    // pool callbacks\n    factory.pendingCallbacks.push(cb);\n  } else {\n    factory.requested = true;\n    var cbs = factory.pendingCallbacks = [cb];\n    var sync = true;\n\n    var resolve = function (res) {\n      if (isObject(res)) {\n        res = baseCtor.extend(res);\n      }\n      // cache resolved\n      factory.resolved = res;\n      // invoke callbacks only if this is not a synchronous resolve\n      // (async resolves are shimmed as synchronous during SSR)\n      if (!sync) {\n        for (var i = 0, l = cbs.length; i < l; i++) {\n          cbs[i](res);\n        }\n      }\n    };\n\n    var reject = function (reason) {\n      \"development\" !== 'production' && warn(\n        \"Failed to resolve async component: \" + (String(factory)) +\n        (reason ? (\"\\nReason: \" + reason) : '')\n      );\n    };\n\n    var res = factory(resolve, reject);\n\n    // handle promise\n    if (res && typeof res.then === 'function' && !factory.resolved) {\n      res.then(resolve, reject);\n    }\n\n    sync = false;\n    // return in case resolved synchronously\n    return factory.resolved\n  }\n}\n\nfunction extractProps (data, Ctor) {\n  // we are only extracting raw values here.\n  // validation and default values are handled in the child\n  // component itself.\n  var propOptions = Ctor.options.props;\n  if (!propOptions) {\n    return\n  }\n  var res = {};\n  var attrs = data.attrs;\n  var props = data.props;\n  var domProps = data.domProps;\n  if (attrs || props || domProps) {\n    for (var key in propOptions) {\n      var altKey = hyphenate(key);\n      checkProp(res, props, key, altKey, true) ||\n      checkProp(res, attrs, key, altKey) ||\n      checkProp(res, domProps, key, altKey);\n    }\n  }\n  return res\n}\n\nfunction checkProp (\n  res,\n  hash,\n  key,\n  altKey,\n  preserve\n) {\n  if (hash) {\n    if (hasOwn(hash, key)) {\n      res[key] = hash[key];\n      if (!preserve) {\n        delete hash[key];\n      }\n      return true\n    } else if (hasOwn(hash, altKey)) {\n      res[key] = hash[altKey];\n      if (!preserve) {\n        delete hash[altKey];\n      }\n      return true\n    }\n  }\n  return false\n}\n\nfunction mergeHooks (data) {\n  if (!data.hook) {\n    data.hook = {};\n  }\n  for (var i = 0; i < hooksToMerge.length; i++) {\n    var key = hooksToMerge[i];\n    var fromParent = data.hook[key];\n    var ours = hooks[key];\n    data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;\n  }\n}\n\nfunction mergeHook$1 (one, two) {\n  return function (a, b, c, d) {\n    one(a, b, c, d);\n    two(a, b, c, d);\n  }\n}\n\n/*  */\n\n// wrapper function for providing a more flexible interface\n// without getting yelled at by flow\nfunction createElement (\n  tag,\n  data,\n  children\n) {\n  if (data && (Array.isArray(data) || typeof data !== 'object')) {\n    children = data;\n    data = undefined;\n  }\n  // make sure to use real instance instead of proxy as context\n  return _createElement(this._self, tag, data, children)\n}\n\nfunction _createElement (\n  context,\n  tag,\n  data,\n  children\n) {\n  if (data && data.__ob__) {\n    \"development\" !== 'production' && warn(\n      \"Avoid using observed data object as vnode data: \" + (JSON.stringify(data)) + \"\\n\" +\n      'Always create fresh vnode data objects in each render!',\n      context\n    );\n    return\n  }\n  if (!tag) {\n    // in case of component :is set to falsy value\n    return emptyVNode()\n  }\n  // support single function children as default scoped slot\n  if (Array.isArray(children) &&\n      typeof children[0] === 'function') {\n    data = data || {};\n    data.scopedSlots = { default: children[0] };\n    children.length = 0;\n  }\n  if (typeof tag === 'string') {\n    var Ctor;\n    var ns = config.getTagNamespace(tag);\n    if (config.isReservedTag(tag)) {\n      // platform built-in elements\n      return new VNode(\n        tag, data, normalizeChildren(children, ns),\n        undefined, undefined, ns, context\n      )\n    } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {\n      // component\n      return createComponent(Ctor, data, context, children, tag)\n    } else {\n      // unknown or unlisted namespaced elements\n      // check at runtime because it may get assigned a namespace when its\n      // parent normalizes children\n      var childNs = tag === 'foreignObject' ? 'xhtml' : ns;\n      return new VNode(\n        tag, data, normalizeChildren(children, childNs),\n        undefined, undefined, ns, context\n      )\n    }\n  } else {\n    // direct component options / constructor\n    return createComponent(tag, data, context, children)\n  }\n}\n\n/*  */\n\nfunction initRender (vm) {\n  vm.$vnode = null; // the placeholder node in parent tree\n  vm._vnode = null; // the root of the child tree\n  vm._staticTrees = null;\n  var parentVnode = vm.$options._parentVnode;\n  var renderContext = parentVnode && parentVnode.context;\n  vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);\n  vm.$scopedSlots = {};\n  // bind the public createElement fn to this instance\n  // so that we get proper render context inside it.\n  vm.$createElement = bind$1(createElement, vm);\n  if (vm.$options.el) {\n    vm.$mount(vm.$options.el);\n  }\n}\n\nfunction renderMixin (Vue) {\n  Vue.prototype.$nextTick = function (fn) {\n    return nextTick(fn, this)\n  };\n\n  Vue.prototype._render = function () {\n    var vm = this;\n    var ref = vm.$options;\n    var render = ref.render;\n    var staticRenderFns = ref.staticRenderFns;\n    var _parentVnode = ref._parentVnode;\n\n    if (vm._isMounted) {\n      // clone slot nodes on re-renders\n      for (var key in vm.$slots) {\n        vm.$slots[key] = cloneVNodes(vm.$slots[key]);\n      }\n    }\n\n    if (_parentVnode && _parentVnode.data.scopedSlots) {\n      vm.$scopedSlots = _parentVnode.data.scopedSlots;\n    }\n\n    if (staticRenderFns && !vm._staticTrees) {\n      vm._staticTrees = [];\n    }\n    // set parent vnode. this allows render functions to have access\n    // to the data on the placeholder node.\n    vm.$vnode = _parentVnode;\n    // render self\n    var vnode;\n    try {\n      vnode = render.call(vm._renderProxy, vm.$createElement);\n    } catch (e) {\n      /* istanbul ignore else */\n      if (config.errorHandler) {\n        config.errorHandler.call(null, e, vm);\n      } else {\n        {\n          warn((\"Error when rendering \" + (formatComponentName(vm)) + \":\"));\n        }\n        throw e\n      }\n      // return previous vnode to prevent render error causing blank component\n      vnode = vm._vnode;\n    }\n    // return empty vnode in case the render function errored out\n    if (!(vnode instanceof VNode)) {\n      if (\"development\" !== 'production' && Array.isArray(vnode)) {\n        warn(\n          'Multiple root nodes returned from render function. Render function ' +\n          'should return a single root node.',\n          vm\n        );\n      }\n      vnode = emptyVNode();\n    }\n    // set parent\n    vnode.parent = _parentVnode;\n    return vnode\n  };\n\n  // shorthands used in render functions\n  Vue.prototype._h = createElement;\n  // toString for mustaches\n  Vue.prototype._s = _toString;\n  // number conversion\n  Vue.prototype._n = toNumber;\n  // empty vnode\n  Vue.prototype._e = emptyVNode;\n  // loose equal\n  Vue.prototype._q = looseEqual;\n  // loose indexOf\n  Vue.prototype._i = looseIndexOf;\n\n  // render static tree by index\n  Vue.prototype._m = function renderStatic (\n    index,\n    isInFor\n  ) {\n    var tree = this._staticTrees[index];\n    // if has already-rendered static tree and not inside v-for,\n    // we can reuse the same tree by doing a shallow clone.\n    if (tree && !isInFor) {\n      return Array.isArray(tree)\n        ? cloneVNodes(tree)\n        : cloneVNode(tree)\n    }\n    // otherwise, render a fresh tree.\n    tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);\n    markStatic(tree, (\"__static__\" + index), false);\n    return tree\n  };\n\n  // mark node as static (v-once)\n  Vue.prototype._o = function markOnce (\n    tree,\n    index,\n    key\n  ) {\n    markStatic(tree, (\"__once__\" + index + (key ? (\"_\" + key) : \"\")), true);\n    return tree\n  };\n\n  function markStatic (tree, key, isOnce) {\n    if (Array.isArray(tree)) {\n      for (var i = 0; i < tree.length; i++) {\n        if (tree[i] && typeof tree[i] !== 'string') {\n          markStaticNode(tree[i], (key + \"_\" + i), isOnce);\n        }\n      }\n    } else {\n      markStaticNode(tree, key, isOnce);\n    }\n  }\n\n  function markStaticNode (node, key, isOnce) {\n    node.isStatic = true;\n    node.key = key;\n    node.isOnce = isOnce;\n  }\n\n  // filter resolution helper\n  var identity = function (_) { return _; };\n  Vue.prototype._f = function resolveFilter (id) {\n    return resolveAsset(this.$options, 'filters', id, true) || identity\n  };\n\n  // render v-for\n  Vue.prototype._l = function renderList (\n    val,\n    render\n  ) {\n    var ret, i, l, keys, key;\n    if (Array.isArray(val)) {\n      ret = new Array(val.length);\n      for (i = 0, l = val.length; i < l; i++) {\n        ret[i] = render(val[i], i);\n      }\n    } else if (typeof val === 'number') {\n      ret = new Array(val);\n      for (i = 0; i < val; i++) {\n        ret[i] = render(i + 1, i);\n      }\n    } else if (isObject(val)) {\n      keys = Object.keys(val);\n      ret = new Array(keys.length);\n      for (i = 0, l = keys.length; i < l; i++) {\n        key = keys[i];\n        ret[i] = render(val[key], key, i);\n      }\n    }\n    return ret\n  };\n\n  // renderSlot\n  Vue.prototype._t = function (\n    name,\n    fallback,\n    props\n  ) {\n    var scopedSlotFn = this.$scopedSlots[name];\n    if (scopedSlotFn) { // scoped slot\n      return scopedSlotFn(props || {}) || fallback\n    } else {\n      var slotNodes = this.$slots[name];\n      // warn duplicate slot usage\n      if (slotNodes && \"development\" !== 'production') {\n        slotNodes._rendered && warn(\n          \"Duplicate presence of slot \\\"\" + name + \"\\\" found in the same render tree \" +\n          \"- this will likely cause render errors.\",\n          this\n        );\n        slotNodes._rendered = true;\n      }\n      return slotNodes || fallback\n    }\n  };\n\n  // apply v-bind object\n  Vue.prototype._b = function bindProps (\n    data,\n    tag,\n    value,\n    asProp\n  ) {\n    if (value) {\n      if (!isObject(value)) {\n        \"development\" !== 'production' && warn(\n          'v-bind without argument expects an Object or Array value',\n          this\n        );\n      } else {\n        if (Array.isArray(value)) {\n          value = toObject(value);\n        }\n        for (var key in value) {\n          if (key === 'class' || key === 'style') {\n            data[key] = value[key];\n          } else {\n            var hash = asProp || config.mustUseProp(tag, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {});\n            hash[key] = value[key];\n          }\n        }\n      }\n    }\n    return data\n  };\n\n  // check v-on keyCodes\n  Vue.prototype._k = function checkKeyCodes (\n    eventKeyCode,\n    key,\n    builtInAlias\n  ) {\n    var keyCodes = config.keyCodes[key] || builtInAlias;\n    if (Array.isArray(keyCodes)) {\n      return keyCodes.indexOf(eventKeyCode) === -1\n    } else {\n      return keyCodes !== eventKeyCode\n    }\n  };\n}\n\nfunction resolveSlots (\n  renderChildren,\n  context\n) {\n  var slots = {};\n  if (!renderChildren) {\n    return slots\n  }\n  var children = normalizeChildren(renderChildren) || [];\n  var defaultSlot = [];\n  var name, child;\n  for (var i = 0, l = children.length; i < l; i++) {\n    child = children[i];\n    // named slots should only be respected if the vnode was rendered in the\n    // same context.\n    if ((child.context === context || child.functionalContext === context) &&\n        child.data && (name = child.data.slot)) {\n      var slot = (slots[name] || (slots[name] = []));\n      if (child.tag === 'template') {\n        slot.push.apply(slot, child.children);\n      } else {\n        slot.push(child);\n      }\n    } else {\n      defaultSlot.push(child);\n    }\n  }\n  // ignore single whitespace\n  if (defaultSlot.length && !(\n    defaultSlot.length === 1 &&\n    (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)\n  )) {\n    slots.default = defaultSlot;\n  }\n  return slots\n}\n\n/*  */\n\nfunction initEvents (vm) {\n  vm._events = Object.create(null);\n  // init parent attached events\n  var listeners = vm.$options._parentListeners;\n  var add = function (event, fn, once) {\n    once ? vm.$once(event, fn) : vm.$on(event, fn);\n  };\n  var remove$$1 = bind$1(vm.$off, vm);\n  vm._updateListeners = function (listeners, oldListeners) {\n    updateListeners(listeners, oldListeners || {}, add, remove$$1, vm);\n  };\n  if (listeners) {\n    vm._updateListeners(listeners);\n  }\n}\n\nfunction eventsMixin (Vue) {\n  Vue.prototype.$on = function (event, fn) {\n    var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);\n    return vm\n  };\n\n  Vue.prototype.$once = function (event, fn) {\n    var vm = this;\n    function on () {\n      vm.$off(event, on);\n      fn.apply(vm, arguments);\n    }\n    on.fn = fn;\n    vm.$on(event, on);\n    return vm\n  };\n\n  Vue.prototype.$off = function (event, fn) {\n    var vm = this;\n    // all\n    if (!arguments.length) {\n      vm._events = Object.create(null);\n      return vm\n    }\n    // specific event\n    var cbs = vm._events[event];\n    if (!cbs) {\n      return vm\n    }\n    if (arguments.length === 1) {\n      vm._events[event] = null;\n      return vm\n    }\n    // specific handler\n    var cb;\n    var i = cbs.length;\n    while (i--) {\n      cb = cbs[i];\n      if (cb === fn || cb.fn === fn) {\n        cbs.splice(i, 1);\n        break\n      }\n    }\n    return vm\n  };\n\n  Vue.prototype.$emit = function (event) {\n    var vm = this;\n    var cbs = vm._events[event];\n    if (cbs) {\n      cbs = cbs.length > 1 ? toArray(cbs) : cbs;\n      var args = toArray(arguments, 1);\n      for (var i = 0, l = cbs.length; i < l; i++) {\n        cbs[i].apply(vm, args);\n      }\n    }\n    return vm\n  };\n}\n\n/*  */\n\nvar uid = 0;\n\nfunction initMixin (Vue) {\n  Vue.prototype._init = function (options) {\n    var vm = this;\n    // a uid\n    vm._uid = uid++;\n    // a flag to avoid this being observed\n    vm._isVue = true;\n    // merge options\n    if (options && options._isComponent) {\n      // optimize internal component instantiation\n      // since dynamic options merging is pretty slow, and none of the\n      // internal component options needs special treatment.\n      initInternalComponent(vm, options);\n    } else {\n      vm.$options = mergeOptions(\n        resolveConstructorOptions(vm.constructor),\n        options || {},\n        vm\n      );\n    }\n    /* istanbul ignore else */\n    {\n      initProxy(vm);\n    }\n    // expose real self\n    vm._self = vm;\n    initLifecycle(vm);\n    initEvents(vm);\n    callHook(vm, 'beforeCreate');\n    initState(vm);\n    callHook(vm, 'created');\n    initRender(vm);\n  };\n}\n\nfunction initInternalComponent (vm, options) {\n  var opts = vm.$options = Object.create(vm.constructor.options);\n  // doing this because it's faster than dynamic enumeration.\n  opts.parent = options.parent;\n  opts.propsData = options.propsData;\n  opts._parentVnode = options._parentVnode;\n  opts._parentListeners = options._parentListeners;\n  opts._renderChildren = options._renderChildren;\n  opts._componentTag = options._componentTag;\n  opts._parentElm = options._parentElm;\n  opts._refElm = options._refElm;\n  if (options.render) {\n    opts.render = options.render;\n    opts.staticRenderFns = options.staticRenderFns;\n  }\n}\n\nfunction resolveConstructorOptions (Ctor) {\n  var options = Ctor.options;\n  if (Ctor.super) {\n    var superOptions = Ctor.super.options;\n    var cachedSuperOptions = Ctor.superOptions;\n    var extendOptions = Ctor.extendOptions;\n    if (superOptions !== cachedSuperOptions) {\n      // super option changed\n      Ctor.superOptions = superOptions;\n      extendOptions.render = options.render;\n      extendOptions.staticRenderFns = options.staticRenderFns;\n      extendOptions._scopeId = options._scopeId;\n      options = Ctor.options = mergeOptions(superOptions, extendOptions);\n      if (options.name) {\n        options.components[options.name] = Ctor;\n      }\n    }\n  }\n  return options\n}\n\nfunction Vue$3 (options) {\n  if (\"development\" !== 'production' &&\n    !(this instanceof Vue$3)) {\n    warn('Vue is a constructor and should be called with the `new` keyword');\n  }\n  this._init(options);\n}\n\ninitMixin(Vue$3);\nstateMixin(Vue$3);\neventsMixin(Vue$3);\nlifecycleMixin(Vue$3);\nrenderMixin(Vue$3);\n\n/*  */\n\nfunction initUse (Vue) {\n  Vue.use = function (plugin) {\n    /* istanbul ignore if */\n    if (plugin.installed) {\n      return\n    }\n    // additional parameters\n    var args = toArray(arguments, 1);\n    args.unshift(this);\n    if (typeof plugin.install === 'function') {\n      plugin.install.apply(plugin, args);\n    } else {\n      plugin.apply(null, args);\n    }\n    plugin.installed = true;\n    return this\n  };\n}\n\n/*  */\n\nfunction initMixin$1 (Vue) {\n  Vue.mixin = function (mixin) {\n    this.options = mergeOptions(this.options, mixin);\n  };\n}\n\n/*  */\n\nfunction initExtend (Vue) {\n  /**\n   * Each instance constructor, including Vue, has a unique\n   * cid. This enables us to create wrapped \"child\n   * constructors\" for prototypal inheritance and cache them.\n   */\n  Vue.cid = 0;\n  var cid = 1;\n\n  /**\n   * Class inheritance\n   */\n  Vue.extend = function (extendOptions) {\n    extendOptions = extendOptions || {};\n    var Super = this;\n    var SuperId = Super.cid;\n    var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});\n    if (cachedCtors[SuperId]) {\n      return cachedCtors[SuperId]\n    }\n    var name = extendOptions.name || Super.options.name;\n    {\n      if (!/^[a-zA-Z][\\w-]*$/.test(name)) {\n        warn(\n          'Invalid component name: \"' + name + '\". Component names ' +\n          'can only contain alphanumeric characaters and the hyphen.'\n        );\n      }\n    }\n    var Sub = function VueComponent (options) {\n      this._init(options);\n    };\n    Sub.prototype = Object.create(Super.prototype);\n    Sub.prototype.constructor = Sub;\n    Sub.cid = cid++;\n    Sub.options = mergeOptions(\n      Super.options,\n      extendOptions\n    );\n    Sub['super'] = Super;\n    // allow further extension/mixin/plugin usage\n    Sub.extend = Super.extend;\n    Sub.mixin = Super.mixin;\n    Sub.use = Super.use;\n    // create asset registers, so extended classes\n    // can have their private assets too.\n    config._assetTypes.forEach(function (type) {\n      Sub[type] = Super[type];\n    });\n    // enable recursive self-lookup\n    if (name) {\n      Sub.options.components[name] = Sub;\n    }\n    // keep a reference to the super options at extension time.\n    // later at instantiation we can check if Super's options have\n    // been updated.\n    Sub.superOptions = Super.options;\n    Sub.extendOptions = extendOptions;\n    // cache constructor\n    cachedCtors[SuperId] = Sub;\n    return Sub\n  };\n}\n\n/*  */\n\nfunction initAssetRegisters (Vue) {\n  /**\n   * Create asset registration methods.\n   */\n  config._assetTypes.forEach(function (type) {\n    Vue[type] = function (\n      id,\n      definition\n    ) {\n      if (!definition) {\n        return this.options[type + 's'][id]\n      } else {\n        /* istanbul ignore if */\n        {\n          if (type === 'component' && config.isReservedTag(id)) {\n            warn(\n              'Do not use built-in or reserved HTML elements as component ' +\n              'id: ' + id\n            );\n          }\n        }\n        if (type === 'component' && isPlainObject(definition)) {\n          definition.name = definition.name || id;\n          definition = this.options._base.extend(definition);\n        }\n        if (type === 'directive' && typeof definition === 'function') {\n          definition = { bind: definition, update: definition };\n        }\n        this.options[type + 's'][id] = definition;\n        return definition\n      }\n    };\n  });\n}\n\n/*  */\n\nvar patternTypes = [String, RegExp];\n\nfunction matches (pattern, name) {\n  if (typeof pattern === 'string') {\n    return pattern.split(',').indexOf(name) > -1\n  } else {\n    return pattern.test(name)\n  }\n}\n\nvar KeepAlive = {\n  name: 'keep-alive',\n  abstract: true,\n  props: {\n    include: patternTypes,\n    exclude: patternTypes\n  },\n  created: function created () {\n    this.cache = Object.create(null);\n  },\n  render: function render () {\n    var vnode = getFirstComponentChild(this.$slots.default);\n    if (vnode && vnode.componentOptions) {\n      var opts = vnode.componentOptions;\n      // check pattern\n      var name = opts.Ctor.options.name || opts.tag;\n      if (name && (\n        (this.include && !matches(this.include, name)) ||\n        (this.exclude && matches(this.exclude, name))\n      )) {\n        return vnode\n      }\n      var key = vnode.key == null\n        // same constructor may get registered as different local components\n        // so cid alone is not enough (#3269)\n        ? opts.Ctor.cid + (opts.tag ? (\"::\" + (opts.tag)) : '')\n        : vnode.key;\n      if (this.cache[key]) {\n        vnode.child = this.cache[key].child;\n      } else {\n        this.cache[key] = vnode;\n      }\n      vnode.data.keepAlive = true;\n    }\n    return vnode\n  },\n  destroyed: function destroyed () {\n    var this$1 = this;\n\n    for (var key in this.cache) {\n      var vnode = this$1.cache[key];\n      callHook(vnode.child, 'deactivated');\n      vnode.child.$destroy();\n    }\n  }\n};\n\nvar builtInComponents = {\n  KeepAlive: KeepAlive\n};\n\n/*  */\n\nfunction initGlobalAPI (Vue) {\n  // config\n  var configDef = {};\n  configDef.get = function () { return config; };\n  {\n    configDef.set = function () {\n      warn(\n        'Do not replace the Vue.config object, set individual fields instead.'\n      );\n    };\n  }\n  Object.defineProperty(Vue, 'config', configDef);\n  Vue.util = util;\n  Vue.set = set$1;\n  Vue.delete = del;\n  Vue.nextTick = nextTick;\n\n  Vue.options = Object.create(null);\n  config._assetTypes.forEach(function (type) {\n    Vue.options[type + 's'] = Object.create(null);\n  });\n\n  // this is used to identify the \"base\" constructor to extend all plain-object\n  // components with in Weex's multi-instance scenarios.\n  Vue.options._base = Vue;\n\n  extend(Vue.options.components, builtInComponents);\n\n  initUse(Vue);\n  initMixin$1(Vue);\n  initExtend(Vue);\n  initAssetRegisters(Vue);\n}\n\ninitGlobalAPI(Vue$3);\n\nObject.defineProperty(Vue$3.prototype, '$isServer', {\n  get: isServerRendering\n});\n\nVue$3.version = '2.1.4';\n\n/*  */\n\n// attributes that should be using props for binding\nvar mustUseProp = function (tag, attr) {\n  return (\n    (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||\n    (attr === 'selected' && tag === 'option') ||\n    (attr === 'checked' && tag === 'input') ||\n    (attr === 'muted' && tag === 'video')\n  )\n};\n\nvar isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');\n\nvar isBooleanAttr = makeMap(\n  'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n  'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n  'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n  'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n  'required,reversed,scoped,seamless,selected,sortable,translate,' +\n  'truespeed,typemustmatch,visible'\n);\n\nvar xlinkNS = 'http://www.w3.org/1999/xlink';\n\nvar isXlink = function (name) {\n  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n};\n\nvar getXlinkProp = function (name) {\n  return isXlink(name) ? name.slice(6, name.length) : ''\n};\n\nvar isFalsyAttrValue = function (val) {\n  return val == null || val === false\n};\n\n/*  */\n\nfunction genClassForVnode (vnode) {\n  var data = vnode.data;\n  var parentNode = vnode;\n  var childNode = vnode;\n  while (childNode.child) {\n    childNode = childNode.child._vnode;\n    if (childNode.data) {\n      data = mergeClassData(childNode.data, data);\n    }\n  }\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data) {\n      data = mergeClassData(data, parentNode.data);\n    }\n  }\n  return genClassFromData(data)\n}\n\nfunction mergeClassData (child, parent) {\n  return {\n    staticClass: concat(child.staticClass, parent.staticClass),\n    class: child.class\n      ? [child.class, parent.class]\n      : parent.class\n  }\n}\n\nfunction genClassFromData (data) {\n  var dynamicClass = data.class;\n  var staticClass = data.staticClass;\n  if (staticClass || dynamicClass) {\n    return concat(staticClass, stringifyClass(dynamicClass))\n  }\n  /* istanbul ignore next */\n  return ''\n}\n\nfunction concat (a, b) {\n  return a ? b ? (a + ' ' + b) : a : (b || '')\n}\n\nfunction stringifyClass (value) {\n  var res = '';\n  if (!value) {\n    return res\n  }\n  if (typeof value === 'string') {\n    return value\n  }\n  if (Array.isArray(value)) {\n    var stringified;\n    for (var i = 0, l = value.length; i < l; i++) {\n      if (value[i]) {\n        if ((stringified = stringifyClass(value[i]))) {\n          res += stringified + ' ';\n        }\n      }\n    }\n    return res.slice(0, -1)\n  }\n  if (isObject(value)) {\n    for (var key in value) {\n      if (value[key]) { res += key + ' '; }\n    }\n    return res.slice(0, -1)\n  }\n  /* istanbul ignore next */\n  return res\n}\n\n/*  */\n\nvar namespaceMap = {\n  svg: 'http://www.w3.org/2000/svg',\n  math: 'http://www.w3.org/1998/Math/MathML',\n  xhtml: 'http://www.w3.org/1999/xhtml'\n};\n\nvar isHTMLTag = makeMap(\n  'html,body,base,head,link,meta,style,title,' +\n  'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n  'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +\n  'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n  's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n  'embed,object,param,source,canvas,script,noscript,del,ins,' +\n  'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n  'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n  'output,progress,select,textarea,' +\n  'details,dialog,menu,menuitem,summary,' +\n  'content,element,shadow,template'\n);\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nvar isSVG = makeMap(\n  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +\n  'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n  'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n  true\n);\n\nvar isPreTag = function (tag) { return tag === 'pre'; };\n\nvar isReservedTag = function (tag) {\n  return isHTMLTag(tag) || isSVG(tag)\n};\n\nfunction getTagNamespace (tag) {\n  if (isSVG(tag)) {\n    return 'svg'\n  }\n  // basic support for MathML\n  // note it doesn't support other MathML elements being component roots\n  if (tag === 'math') {\n    return 'math'\n  }\n}\n\nvar unknownElementCache = Object.create(null);\nfunction isUnknownElement (tag) {\n  /* istanbul ignore if */\n  if (!inBrowser) {\n    return true\n  }\n  if (isReservedTag(tag)) {\n    return false\n  }\n  tag = tag.toLowerCase();\n  /* istanbul ignore if */\n  if (unknownElementCache[tag] != null) {\n    return unknownElementCache[tag]\n  }\n  var el = document.createElement(tag);\n  if (tag.indexOf('-') > -1) {\n    // http://stackoverflow.com/a/28210364/1070244\n    return (unknownElementCache[tag] = (\n      el.constructor === window.HTMLUnknownElement ||\n      el.constructor === window.HTMLElement\n    ))\n  } else {\n    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n  }\n}\n\n/*  */\n\n/**\n * Query an element selector if it's not an element already.\n */\nfunction query (el) {\n  if (typeof el === 'string') {\n    var selector = el;\n    el = document.querySelector(el);\n    if (!el) {\n      \"development\" !== 'production' && warn(\n        'Cannot find element: ' + selector\n      );\n      return document.createElement('div')\n    }\n  }\n  return el\n}\n\n/*  */\n\nfunction createElement$1 (tagName, vnode) {\n  var elm = document.createElement(tagName);\n  if (tagName !== 'select') {\n    return elm\n  }\n  if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {\n    elm.setAttribute('multiple', 'multiple');\n  }\n  return elm\n}\n\nfunction createElementNS (namespace, tagName) {\n  return document.createElementNS(namespaceMap[namespace], tagName)\n}\n\nfunction createTextNode (text) {\n  return document.createTextNode(text)\n}\n\nfunction createComment (text) {\n  return document.createComment(text)\n}\n\nfunction insertBefore (parentNode, newNode, referenceNode) {\n  parentNode.insertBefore(newNode, referenceNode);\n}\n\nfunction removeChild (node, child) {\n  node.removeChild(child);\n}\n\nfunction appendChild (node, child) {\n  node.appendChild(child);\n}\n\nfunction parentNode (node) {\n  return node.parentNode\n}\n\nfunction nextSibling (node) {\n  return node.nextSibling\n}\n\nfunction tagName (node) {\n  return node.tagName\n}\n\nfunction setTextContent (node, text) {\n  node.textContent = text;\n}\n\nfunction childNodes (node) {\n  return node.childNodes\n}\n\nfunction setAttribute (node, key, val) {\n  node.setAttribute(key, val);\n}\n\n\nvar nodeOps = Object.freeze({\n  createElement: createElement$1,\n  createElementNS: createElementNS,\n  createTextNode: createTextNode,\n  createComment: createComment,\n  insertBefore: insertBefore,\n  removeChild: removeChild,\n  appendChild: appendChild,\n  parentNode: parentNode,\n  nextSibling: nextSibling,\n  tagName: tagName,\n  setTextContent: setTextContent,\n  childNodes: childNodes,\n  setAttribute: setAttribute\n});\n\n/*  */\n\nvar ref = {\n  create: function create (_, vnode) {\n    registerRef(vnode);\n  },\n  update: function update (oldVnode, vnode) {\n    if (oldVnode.data.ref !== vnode.data.ref) {\n      registerRef(oldVnode, true);\n      registerRef(vnode);\n    }\n  },\n  destroy: function destroy (vnode) {\n    registerRef(vnode, true);\n  }\n};\n\nfunction registerRef (vnode, isRemoval) {\n  var key = vnode.data.ref;\n  if (!key) { return }\n\n  var vm = vnode.context;\n  var ref = vnode.child || vnode.elm;\n  var refs = vm.$refs;\n  if (isRemoval) {\n    if (Array.isArray(refs[key])) {\n      remove$1(refs[key], ref);\n    } else if (refs[key] === ref) {\n      refs[key] = undefined;\n    }\n  } else {\n    if (vnode.data.refInFor) {\n      if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {\n        refs[key].push(ref);\n      } else {\n        refs[key] = [ref];\n      }\n    } else {\n      refs[key] = ref;\n    }\n  }\n}\n\n/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n *\n * modified by Evan You (@yyx990803)\n *\n\n/*\n * Not type-checking this because this file is perf-critical and the cost\n * of making flow understand it is not worth it.\n */\n\nvar emptyNode = new VNode('', {}, []);\n\nvar hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];\n\nfunction isUndef (s) {\n  return s == null\n}\n\nfunction isDef (s) {\n  return s != null\n}\n\nfunction sameVnode (vnode1, vnode2) {\n  return (\n    vnode1.key === vnode2.key &&\n    vnode1.tag === vnode2.tag &&\n    vnode1.isComment === vnode2.isComment &&\n    !vnode1.data === !vnode2.data\n  )\n}\n\nfunction createKeyToOldIdx (children, beginIdx, endIdx) {\n  var i, key;\n  var map = {};\n  for (i = beginIdx; i <= endIdx; ++i) {\n    key = children[i].key;\n    if (isDef(key)) { map[key] = i; }\n  }\n  return map\n}\n\nfunction createPatchFunction (backend) {\n  var i, j;\n  var cbs = {};\n\n  var modules = backend.modules;\n  var nodeOps = backend.nodeOps;\n\n  for (i = 0; i < hooks$1.length; ++i) {\n    cbs[hooks$1[i]] = [];\n    for (j = 0; j < modules.length; ++j) {\n      if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }\n    }\n  }\n\n  function emptyNodeAt (elm) {\n    return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n  }\n\n  function createRmCb (childElm, listeners) {\n    function remove$$1 () {\n      if (--remove$$1.listeners === 0) {\n        removeElement(childElm);\n      }\n    }\n    remove$$1.listeners = listeners;\n    return remove$$1\n  }\n\n  function removeElement (el) {\n    var parent = nodeOps.parentNode(el);\n    // element may have already been removed due to v-html\n    if (parent) {\n      nodeOps.removeChild(parent, el);\n    }\n  }\n\n  var inPre = 0;\n  function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {\n    vnode.isRootInsert = !nested; // for transition enter check\n    if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n      return\n    }\n\n    var data = vnode.data;\n    var children = vnode.children;\n    var tag = vnode.tag;\n    if (isDef(tag)) {\n      {\n        if (data && data.pre) {\n          inPre++;\n        }\n        if (\n          !inPre &&\n          !vnode.ns &&\n          !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&\n          config.isUnknownElement(tag)\n        ) {\n          warn(\n            'Unknown custom element: <' + tag + '> - did you ' +\n            'register the component correctly? For recursive components, ' +\n            'make sure to provide the \"name\" option.',\n            vnode.context\n          );\n        }\n      }\n      vnode.elm = vnode.ns\n        ? nodeOps.createElementNS(vnode.ns, tag)\n        : nodeOps.createElement(tag, vnode);\n      setScope(vnode);\n\n      /* istanbul ignore if */\n      {\n        createChildren(vnode, children, insertedVnodeQueue);\n        if (isDef(data)) {\n          invokeCreateHooks(vnode, insertedVnodeQueue);\n        }\n        insert(parentElm, vnode.elm, refElm);\n      }\n\n      if (\"development\" !== 'production' && data && data.pre) {\n        inPre--;\n      }\n    } else if (vnode.isComment) {\n      vnode.elm = nodeOps.createComment(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    } else {\n      vnode.elm = nodeOps.createTextNode(vnode.text);\n      insert(parentElm, vnode.elm, refElm);\n    }\n  }\n\n  function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i = vnode.data;\n    if (isDef(i)) {\n      var isReactivated = isDef(vnode.child) && i.keepAlive;\n      if (isDef(i = i.hook) && isDef(i = i.init)) {\n        i(vnode, false /* hydrating */, parentElm, refElm);\n      }\n      // after calling the init hook, if the vnode is a child component\n      // it should've created a child instance and mounted it. the child\n      // component also has set the placeholder vnode's elm.\n      // in that case we can just return the element and be done.\n      if (isDef(vnode.child)) {\n        initComponent(vnode, insertedVnodeQueue);\n        if (isReactivated) {\n          reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);\n        }\n        return true\n      }\n    }\n  }\n\n  function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {\n    var i;\n    // hack for #4339: a reactivated component with inner transition\n    // does not trigger because the inner node's created hooks are not called\n    // again. It's not ideal to involve module-specific logic in here but\n    // there doesn't seem to be a better way to do it.\n    var innerNode = vnode;\n    while (innerNode.child) {\n      innerNode = innerNode.child._vnode;\n      if (isDef(i = innerNode.data) && isDef(i = i.transition)) {\n        for (i = 0; i < cbs.activate.length; ++i) {\n          cbs.activate[i](emptyNode, innerNode);\n        }\n        insertedVnodeQueue.push(innerNode);\n        break\n      }\n    }\n    // unlike a newly created component,\n    // a reactivated keep-alive component doesn't insert itself\n    insert(parentElm, vnode.elm, refElm);\n  }\n\n  function insert (parent, elm, ref) {\n    if (parent) {\n      nodeOps.insertBefore(parent, elm, ref);\n    }\n  }\n\n  function createChildren (vnode, children, insertedVnodeQueue) {\n    if (Array.isArray(children)) {\n      for (var i = 0; i < children.length; ++i) {\n        createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);\n      }\n    } else if (isPrimitive(vnode.text)) {\n      nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));\n    }\n  }\n\n  function isPatchable (vnode) {\n    while (vnode.child) {\n      vnode = vnode.child._vnode;\n    }\n    return isDef(vnode.tag)\n  }\n\n  function invokeCreateHooks (vnode, insertedVnodeQueue) {\n    for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {\n      cbs.create[i$1](emptyNode, vnode);\n    }\n    i = vnode.data.hook; // Reuse variable\n    if (isDef(i)) {\n      if (i.create) { i.create(emptyNode, vnode); }\n      if (i.insert) { insertedVnodeQueue.push(vnode); }\n    }\n  }\n\n  function initComponent (vnode, insertedVnodeQueue) {\n    if (vnode.data.pendingInsert) {\n      insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);\n    }\n    vnode.elm = vnode.child.$el;\n    if (isPatchable(vnode)) {\n      invokeCreateHooks(vnode, insertedVnodeQueue);\n      setScope(vnode);\n    } else {\n      // empty component root.\n      // skip all element-related modules except for ref (#3455)\n      registerRef(vnode);\n      // make sure to invoke the insert hook\n      insertedVnodeQueue.push(vnode);\n    }\n  }\n\n  // set scope id attribute for scoped CSS.\n  // this is implemented as a special case to avoid the overhead\n  // of going through the normal attribute patching process.\n  function setScope (vnode) {\n    var i;\n    if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n    if (isDef(i = activeInstance) &&\n        i !== vnode.context &&\n        isDef(i = i.$options._scopeId)) {\n      nodeOps.setAttribute(vnode.elm, i, '');\n    }\n  }\n\n  function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);\n    }\n  }\n\n  function invokeDestroyHook (vnode) {\n    var i, j;\n    var data = vnode.data;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }\n      for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }\n    }\n    if (isDef(i = vnode.children)) {\n      for (j = 0; j < vnode.children.length; ++j) {\n        invokeDestroyHook(vnode.children[j]);\n      }\n    }\n  }\n\n  function removeVnodes (parentElm, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      var ch = vnodes[startIdx];\n      if (isDef(ch)) {\n        if (isDef(ch.tag)) {\n          removeAndInvokeRemoveHook(ch);\n          invokeDestroyHook(ch);\n        } else { // Text node\n          nodeOps.removeChild(parentElm, ch.elm);\n        }\n      }\n    }\n  }\n\n  function removeAndInvokeRemoveHook (vnode, rm) {\n    if (rm || isDef(vnode.data)) {\n      var listeners = cbs.remove.length + 1;\n      if (!rm) {\n        // directly removing\n        rm = createRmCb(vnode.elm, listeners);\n      } else {\n        // we have a recursively passed down rm callback\n        // increase the listeners count\n        rm.listeners += listeners;\n      }\n      // recursively invoke hooks on child component root node\n      if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {\n        removeAndInvokeRemoveHook(i, rm);\n      }\n      for (i = 0; i < cbs.remove.length; ++i) {\n        cbs.remove[i](vnode, rm);\n      }\n      if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {\n        i(vnode, rm);\n      } else {\n        rm();\n      }\n    } else {\n      removeElement(vnode.elm);\n    }\n  }\n\n  function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {\n    var oldStartIdx = 0;\n    var newStartIdx = 0;\n    var oldEndIdx = oldCh.length - 1;\n    var oldStartVnode = oldCh[0];\n    var oldEndVnode = oldCh[oldEndIdx];\n    var newEndIdx = newCh.length - 1;\n    var newStartVnode = newCh[0];\n    var newEndVnode = newCh[newEndIdx];\n    var oldKeyToIdx, idxInOld, elmToMove, refElm;\n\n    // removeOnly is a special flag used only by <transition-group>\n    // to ensure removed elements stay in correct relative positions\n    // during leaving transitions\n    var canMove = !removeOnly;\n\n    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n      if (isUndef(oldStartVnode)) {\n        oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left\n      } else if (isUndef(oldEndVnode)) {\n        oldEndVnode = oldCh[--oldEndIdx];\n      } else if (sameVnode(oldStartVnode, newStartVnode)) {\n        patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);\n        oldStartVnode = oldCh[++oldStartIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else if (sameVnode(oldEndVnode, newEndVnode)) {\n        patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right\n        patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));\n        oldStartVnode = oldCh[++oldStartIdx];\n        newEndVnode = newCh[--newEndIdx];\n      } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left\n        patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);\n        canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n        oldEndVnode = oldCh[--oldEndIdx];\n        newStartVnode = newCh[++newStartIdx];\n      } else {\n        if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }\n        idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;\n        if (isUndef(idxInOld)) { // New element\n          createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n          newStartVnode = newCh[++newStartIdx];\n        } else {\n          elmToMove = oldCh[idxInOld];\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !elmToMove) {\n            warn(\n              'It seems there are duplicate keys that is causing an update error. ' +\n              'Make sure each v-for item has a unique key.'\n            );\n          }\n          if (elmToMove.tag !== newStartVnode.tag) {\n            // same key but different element. treat as new element\n            createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          } else {\n            patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);\n            oldCh[idxInOld] = undefined;\n            canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);\n            newStartVnode = newCh[++newStartIdx];\n          }\n        }\n      }\n    }\n    if (oldStartIdx > oldEndIdx) {\n      refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;\n      addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);\n    } else if (newStartIdx > newEndIdx) {\n      removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n    }\n  }\n\n  function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {\n    if (oldVnode === vnode) {\n      return\n    }\n    // reuse element for static trees.\n    // note we only do this if the vnode is cloned -\n    // if the new node is not cloned it means the render functions have been\n    // reset by the hot-reload-api and we need to do a proper re-render.\n    if (vnode.isStatic &&\n        oldVnode.isStatic &&\n        vnode.key === oldVnode.key &&\n        (vnode.isCloned || vnode.isOnce)) {\n      vnode.elm = oldVnode.elm;\n      vnode.child = oldVnode.child;\n      return\n    }\n    var i;\n    var data = vnode.data;\n    var hasData = isDef(data);\n    if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {\n      i(oldVnode, vnode);\n    }\n    var elm = vnode.elm = oldVnode.elm;\n    var oldCh = oldVnode.children;\n    var ch = vnode.children;\n    if (hasData && isPatchable(vnode)) {\n      for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }\n      if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }\n    }\n    if (isUndef(vnode.text)) {\n      if (isDef(oldCh) && isDef(ch)) {\n        if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }\n      } else if (isDef(ch)) {\n        if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }\n        addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);\n      } else if (isDef(oldCh)) {\n        removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n      } else if (isDef(oldVnode.text)) {\n        nodeOps.setTextContent(elm, '');\n      }\n    } else if (oldVnode.text !== vnode.text) {\n      nodeOps.setTextContent(elm, vnode.text);\n    }\n    if (hasData) {\n      if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }\n    }\n  }\n\n  function invokeInsertHook (vnode, queue, initial) {\n    // delay insert hooks for component root nodes, invoke them after the\n    // element is really inserted\n    if (initial && vnode.parent) {\n      vnode.parent.data.pendingInsert = queue;\n    } else {\n      for (var i = 0; i < queue.length; ++i) {\n        queue[i].data.hook.insert(queue[i]);\n      }\n    }\n  }\n\n  var bailed = false;\n  function hydrate (elm, vnode, insertedVnodeQueue) {\n    {\n      if (!assertNodeMatch(elm, vnode)) {\n        return false\n      }\n    }\n    vnode.elm = elm;\n    var tag = vnode.tag;\n    var data = vnode.data;\n    var children = vnode.children;\n    if (isDef(data)) {\n      if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }\n      if (isDef(i = vnode.child)) {\n        // child component. it should have hydrated its own tree.\n        initComponent(vnode, insertedVnodeQueue);\n        return true\n      }\n    }\n    if (isDef(tag)) {\n      if (isDef(children)) {\n        var childNodes = nodeOps.childNodes(elm);\n        // empty element, allow client to pick up and populate children\n        if (!childNodes.length) {\n          createChildren(vnode, children, insertedVnodeQueue);\n        } else {\n          var childrenMatch = true;\n          if (childNodes.length !== children.length) {\n            childrenMatch = false;\n          } else {\n            for (var i$1 = 0; i$1 < children.length; i$1++) {\n              if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {\n                childrenMatch = false;\n                break\n              }\n            }\n          }\n          if (!childrenMatch) {\n            if (\"development\" !== 'production' &&\n                typeof console !== 'undefined' &&\n                !bailed) {\n              bailed = true;\n              console.warn('Parent: ', elm);\n              console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);\n            }\n            return false\n          }\n        }\n      }\n      if (isDef(data)) {\n        invokeCreateHooks(vnode, insertedVnodeQueue);\n      }\n    }\n    return true\n  }\n\n  function assertNodeMatch (node, vnode) {\n    if (vnode.tag) {\n      return (\n        vnode.tag.indexOf('vue-component') === 0 ||\n        vnode.tag.toLowerCase() === nodeOps.tagName(node).toLowerCase()\n      )\n    } else {\n      return _toString(vnode.text) === node.data\n    }\n  }\n\n  return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {\n    if (!vnode) {\n      if (oldVnode) { invokeDestroyHook(oldVnode); }\n      return\n    }\n\n    var elm, parent;\n    var isInitialPatch = false;\n    var insertedVnodeQueue = [];\n\n    if (!oldVnode) {\n      // empty mount (likely as component), create new root element\n      isInitialPatch = true;\n      createElm(vnode, insertedVnodeQueue, parentElm, refElm);\n    } else {\n      var isRealElement = isDef(oldVnode.nodeType);\n      if (!isRealElement && sameVnode(oldVnode, vnode)) {\n        // patch existing root node\n        patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);\n      } else {\n        if (isRealElement) {\n          // mounting to a real element\n          // check if this is server-rendered content and if we can perform\n          // a successful hydration.\n          if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {\n            oldVnode.removeAttribute('server-rendered');\n            hydrating = true;\n          }\n          if (hydrating) {\n            if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n              invokeInsertHook(vnode, insertedVnodeQueue, true);\n              return oldVnode\n            } else {\n              warn(\n                'The client-side rendered virtual DOM tree is not matching ' +\n                'server-rendered content. This is likely caused by incorrect ' +\n                'HTML markup, for example nesting block-level elements inside ' +\n                '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                'full client-side render.'\n              );\n            }\n          }\n          // either not server-rendered, or hydration failed.\n          // create an empty node and replace it\n          oldVnode = emptyNodeAt(oldVnode);\n        }\n\n        // replacing existing element\n        elm = oldVnode.elm;\n        parent = nodeOps.parentNode(elm);\n        createElm(vnode, insertedVnodeQueue, parent, nodeOps.nextSibling(elm));\n\n        if (vnode.parent) {\n          // component root element replaced.\n          // update parent placeholder node element, recursively\n          var ancestor = vnode.parent;\n          while (ancestor) {\n            ancestor.elm = vnode.elm;\n            ancestor = ancestor.parent;\n          }\n          if (isPatchable(vnode)) {\n            for (var i = 0; i < cbs.create.length; ++i) {\n              cbs.create[i](emptyNode, vnode.parent);\n            }\n          }\n        }\n\n        if (parent !== null) {\n          removeVnodes(parent, [oldVnode], 0, 0);\n        } else if (isDef(oldVnode.tag)) {\n          invokeDestroyHook(oldVnode);\n        }\n      }\n    }\n\n    invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);\n    return vnode.elm\n  }\n}\n\n/*  */\n\nvar directives = {\n  create: updateDirectives,\n  update: updateDirectives,\n  destroy: function unbindDirectives (vnode) {\n    updateDirectives(vnode, emptyNode);\n  }\n};\n\nfunction updateDirectives (\n  oldVnode,\n  vnode\n) {\n  if (!oldVnode.data.directives && !vnode.data.directives) {\n    return\n  }\n  var isCreate = oldVnode === emptyNode;\n  var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);\n  var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);\n\n  var dirsWithInsert = [];\n  var dirsWithPostpatch = [];\n\n  var key, oldDir, dir;\n  for (key in newDirs) {\n    oldDir = oldDirs[key];\n    dir = newDirs[key];\n    if (!oldDir) {\n      // new directive, bind\n      callHook$1(dir, 'bind', vnode, oldVnode);\n      if (dir.def && dir.def.inserted) {\n        dirsWithInsert.push(dir);\n      }\n    } else {\n      // existing directive, update\n      dir.oldValue = oldDir.value;\n      callHook$1(dir, 'update', vnode, oldVnode);\n      if (dir.def && dir.def.componentUpdated) {\n        dirsWithPostpatch.push(dir);\n      }\n    }\n  }\n\n  if (dirsWithInsert.length) {\n    var callInsert = function () {\n      dirsWithInsert.forEach(function (dir) {\n        callHook$1(dir, 'inserted', vnode, oldVnode);\n      });\n    };\n    if (isCreate) {\n      mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');\n    } else {\n      callInsert();\n    }\n  }\n\n  if (dirsWithPostpatch.length) {\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {\n      dirsWithPostpatch.forEach(function (dir) {\n        callHook$1(dir, 'componentUpdated', vnode, oldVnode);\n      });\n    }, 'dir-postpatch');\n  }\n\n  if (!isCreate) {\n    for (key in oldDirs) {\n      if (!newDirs[key]) {\n        // no longer present, unbind\n        callHook$1(oldDirs[key], 'unbind', oldVnode);\n      }\n    }\n  }\n}\n\nvar emptyModifiers = Object.create(null);\n\nfunction normalizeDirectives$1 (\n  dirs,\n  vm\n) {\n  var res = Object.create(null);\n  if (!dirs) {\n    return res\n  }\n  var i, dir;\n  for (i = 0; i < dirs.length; i++) {\n    dir = dirs[i];\n    if (!dir.modifiers) {\n      dir.modifiers = emptyModifiers;\n    }\n    res[getRawDirName(dir)] = dir;\n    dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);\n  }\n  return res\n}\n\nfunction getRawDirName (dir) {\n  return dir.rawName || ((dir.name) + \".\" + (Object.keys(dir.modifiers || {}).join('.')))\n}\n\nfunction callHook$1 (dir, hook, vnode, oldVnode) {\n  var fn = dir.def && dir.def[hook];\n  if (fn) {\n    fn(vnode.elm, dir, vnode, oldVnode);\n  }\n}\n\nvar baseModules = [\n  ref,\n  directives\n];\n\n/*  */\n\nfunction updateAttrs (oldVnode, vnode) {\n  if (!oldVnode.data.attrs && !vnode.data.attrs) {\n    return\n  }\n  var key, cur, old;\n  var elm = vnode.elm;\n  var oldAttrs = oldVnode.data.attrs || {};\n  var attrs = vnode.data.attrs || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (attrs.__ob__) {\n    attrs = vnode.data.attrs = extend({}, attrs);\n  }\n\n  for (key in attrs) {\n    cur = attrs[key];\n    old = oldAttrs[key];\n    if (old !== cur) {\n      setAttr(elm, key, cur);\n    }\n  }\n  for (key in oldAttrs) {\n    if (attrs[key] == null) {\n      if (isXlink(key)) {\n        elm.removeAttributeNS(xlinkNS, getXlinkProp(key));\n      } else if (!isEnumeratedAttr(key)) {\n        elm.removeAttribute(key);\n      }\n    }\n  }\n}\n\nfunction setAttr (el, key, value) {\n  if (isBooleanAttr(key)) {\n    // set attribute for blank value\n    // e.g. <option disabled>Select one</option>\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, key);\n    }\n  } else if (isEnumeratedAttr(key)) {\n    el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');\n  } else if (isXlink(key)) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttributeNS(xlinkNS, getXlinkProp(key));\n    } else {\n      el.setAttributeNS(xlinkNS, key, value);\n    }\n  } else {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key);\n    } else {\n      el.setAttribute(key, value);\n    }\n  }\n}\n\nvar attrs = {\n  create: updateAttrs,\n  update: updateAttrs\n};\n\n/*  */\n\nfunction updateClass (oldVnode, vnode) {\n  var el = vnode.elm;\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n  if (!data.staticClass && !data.class &&\n      (!oldData || (!oldData.staticClass && !oldData.class))) {\n    return\n  }\n\n  var cls = genClassForVnode(vnode);\n\n  // handle transition classes\n  var transitionClass = el._transitionClasses;\n  if (transitionClass) {\n    cls = concat(cls, stringifyClass(transitionClass));\n  }\n\n  // set the class\n  if (cls !== el._prevClass) {\n    el.setAttribute('class', cls);\n    el._prevClass = cls;\n  }\n}\n\nvar klass = {\n  create: updateClass,\n  update: updateClass\n};\n\n// skip type checking this file because we need to attach private properties\n// to elements\n\nfunction updateDOMListeners (oldVnode, vnode) {\n  if (!oldVnode.data.on && !vnode.data.on) {\n    return\n  }\n  var on = vnode.data.on || {};\n  var oldOn = oldVnode.data.on || {};\n  var add = vnode.elm._v_add || (\n    vnode.elm._v_add = function (event, handler, once, capture) {\n      if (once) {\n        var oldHandler = handler;\n        handler = function (ev) {\n          remove(event, handler, capture);\n          arguments.length === 1\n            ? oldHandler(ev)\n            : oldHandler.apply(null, arguments);\n        };\n      }\n      vnode.elm.addEventListener(event, handler, capture);\n    }\n  );\n  var remove = vnode.elm._v_remove || (\n    vnode.elm._v_remove = function (event, handler, capture) {\n      vnode.elm.removeEventListener(event, handler, capture);\n    }\n  );\n  updateListeners(on, oldOn, add, remove, vnode.context);\n}\n\nvar events = {\n  create: updateDOMListeners,\n  update: updateDOMListeners\n};\n\n/*  */\n\nfunction updateDOMProps (oldVnode, vnode) {\n  if (!oldVnode.data.domProps && !vnode.data.domProps) {\n    return\n  }\n  var key, cur;\n  var elm = vnode.elm;\n  var oldProps = oldVnode.data.domProps || {};\n  var props = vnode.data.domProps || {};\n  // clone observed objects, as the user probably wants to mutate it\n  if (props.__ob__) {\n    props = vnode.data.domProps = extend({}, props);\n  }\n\n  for (key in oldProps) {\n    if (props[key] == null) {\n      elm[key] = '';\n    }\n  }\n  for (key in props) {\n    cur = props[key];\n    // ignore children if the node has textContent or innerHTML,\n    // as these will throw away existing DOM nodes and cause removal errors\n    // on subsequent patches (#3360)\n    if (key === 'textContent' || key === 'innerHTML') {\n      if (vnode.children) { vnode.children.length = 0; }\n      if (cur === oldProps[key]) { continue }\n    }\n    if (key === 'value') {\n      // store value as _value as well since\n      // non-string values will be stringified\n      elm._value = cur;\n      // avoid resetting cursor position when value is the same\n      var strCur = cur == null ? '' : String(cur);\n      if (elm.value !== strCur && !elm.composing) {\n        elm.value = strCur;\n      }\n    } else {\n      elm[key] = cur;\n    }\n  }\n}\n\nvar domProps = {\n  create: updateDOMProps,\n  update: updateDOMProps\n};\n\n/*  */\n\nvar parseStyleText = cached(function (cssText) {\n  var res = {};\n  var listDelimiter = /;(?![^(]*\\))/g;\n  var propertyDelimiter = /:(.+)/;\n  cssText.split(listDelimiter).forEach(function (item) {\n    if (item) {\n      var tmp = item.split(propertyDelimiter);\n      tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());\n    }\n  });\n  return res\n});\n\n// merge static and dynamic style data on the same vnode\nfunction normalizeStyleData (data) {\n  var style = normalizeStyleBinding(data.style);\n  // static style is pre-processed into an object during compilation\n  // and is always a fresh object, so it's safe to merge into it\n  return data.staticStyle\n    ? extend(data.staticStyle, style)\n    : style\n}\n\n// normalize possible array / string values into Object\nfunction normalizeStyleBinding (bindingStyle) {\n  if (Array.isArray(bindingStyle)) {\n    return toObject(bindingStyle)\n  }\n  if (typeof bindingStyle === 'string') {\n    return parseStyleText(bindingStyle)\n  }\n  return bindingStyle\n}\n\n/**\n * parent component style should be after child's\n * so that parent component's style could override it\n */\nfunction getStyle (vnode, checkChild) {\n  var res = {};\n  var styleData;\n\n  if (checkChild) {\n    var childNode = vnode;\n    while (childNode.child) {\n      childNode = childNode.child._vnode;\n      if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n        extend(res, styleData);\n      }\n    }\n  }\n\n  if ((styleData = normalizeStyleData(vnode.data))) {\n    extend(res, styleData);\n  }\n\n  var parentNode = vnode;\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n      extend(res, styleData);\n    }\n  }\n  return res\n}\n\n/*  */\n\nvar cssVarRE = /^--/;\nvar importantRE = /\\s*!important$/;\nvar setProp = function (el, name, val) {\n  /* istanbul ignore if */\n  if (cssVarRE.test(name)) {\n    el.style.setProperty(name, val);\n  } else if (importantRE.test(val)) {\n    el.style.setProperty(name, val.replace(importantRE, ''), 'important');\n  } else {\n    el.style[normalize(name)] = val;\n  }\n};\n\nvar prefixes = ['Webkit', 'Moz', 'ms'];\n\nvar testEl;\nvar normalize = cached(function (prop) {\n  testEl = testEl || document.createElement('div');\n  prop = camelize(prop);\n  if (prop !== 'filter' && (prop in testEl.style)) {\n    return prop\n  }\n  var upper = prop.charAt(0).toUpperCase() + prop.slice(1);\n  for (var i = 0; i < prefixes.length; i++) {\n    var prefixed = prefixes[i] + upper;\n    if (prefixed in testEl.style) {\n      return prefixed\n    }\n  }\n});\n\nfunction updateStyle (oldVnode, vnode) {\n  var data = vnode.data;\n  var oldData = oldVnode.data;\n\n  if (!data.staticStyle && !data.style &&\n      !oldData.staticStyle && !oldData.style) {\n    return\n  }\n\n  var cur, name;\n  var el = vnode.elm;\n  var oldStaticStyle = oldVnode.data.staticStyle;\n  var oldStyleBinding = oldVnode.data.style || {};\n\n  // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n  var oldStyle = oldStaticStyle || oldStyleBinding;\n\n  var style = normalizeStyleBinding(vnode.data.style) || {};\n\n  vnode.data.style = style.__ob__ ? extend({}, style) : style;\n\n  var newStyle = getStyle(vnode, true);\n\n  for (name in oldStyle) {\n    if (newStyle[name] == null) {\n      setProp(el, name, '');\n    }\n  }\n  for (name in newStyle) {\n    cur = newStyle[name];\n    if (cur !== oldStyle[name]) {\n      // ie9 setting to null has no effect, must use empty string\n      setProp(el, name, cur == null ? '' : cur);\n    }\n  }\n}\n\nvar style = {\n  create: updateStyle,\n  update: updateStyle\n};\n\n/*  */\n\n/**\n * Add class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction addClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.add(c); });\n    } else {\n      el.classList.add(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    if (cur.indexOf(' ' + cls + ' ') < 0) {\n      el.setAttribute('class', (cur + cls).trim());\n    }\n  }\n}\n\n/**\n * Remove class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nfunction removeClass (el, cls) {\n  /* istanbul ignore if */\n  if (!cls || !cls.trim()) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(function (c) { return el.classList.remove(c); });\n    } else {\n      el.classList.remove(cls);\n    }\n  } else {\n    var cur = ' ' + el.getAttribute('class') + ' ';\n    var tar = ' ' + cls + ' ';\n    while (cur.indexOf(tar) >= 0) {\n      cur = cur.replace(tar, ' ');\n    }\n    el.setAttribute('class', cur.trim());\n  }\n}\n\n/*  */\n\nvar hasTransition = inBrowser && !isIE9;\nvar TRANSITION = 'transition';\nvar ANIMATION = 'animation';\n\n// Transition property/event sniffing\nvar transitionProp = 'transition';\nvar transitionEndEvent = 'transitionend';\nvar animationProp = 'animation';\nvar animationEndEvent = 'animationend';\nif (hasTransition) {\n  /* istanbul ignore if */\n  if (window.ontransitionend === undefined &&\n    window.onwebkittransitionend !== undefined) {\n    transitionProp = 'WebkitTransition';\n    transitionEndEvent = 'webkitTransitionEnd';\n  }\n  if (window.onanimationend === undefined &&\n    window.onwebkitanimationend !== undefined) {\n    animationProp = 'WebkitAnimation';\n    animationEndEvent = 'webkitAnimationEnd';\n  }\n}\n\nvar raf = (inBrowser && window.requestAnimationFrame) || setTimeout;\nfunction nextFrame (fn) {\n  raf(function () {\n    raf(fn);\n  });\n}\n\nfunction addTransitionClass (el, cls) {\n  (el._transitionClasses || (el._transitionClasses = [])).push(cls);\n  addClass(el, cls);\n}\n\nfunction removeTransitionClass (el, cls) {\n  if (el._transitionClasses) {\n    remove$1(el._transitionClasses, cls);\n  }\n  removeClass(el, cls);\n}\n\nfunction whenTransitionEnds (\n  el,\n  expectedType,\n  cb\n) {\n  var ref = getTransitionInfo(el, expectedType);\n  var type = ref.type;\n  var timeout = ref.timeout;\n  var propCount = ref.propCount;\n  if (!type) { return cb() }\n  var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;\n  var ended = 0;\n  var end = function () {\n    el.removeEventListener(event, onEnd);\n    cb();\n  };\n  var onEnd = function (e) {\n    if (e.target === el) {\n      if (++ended >= propCount) {\n        end();\n      }\n    }\n  };\n  setTimeout(function () {\n    if (ended < propCount) {\n      end();\n    }\n  }, timeout + 1);\n  el.addEventListener(event, onEnd);\n}\n\nvar transformRE = /\\b(transform|all)(,|$)/;\n\nfunction getTransitionInfo (el, expectedType) {\n  var styles = window.getComputedStyle(el);\n  var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');\n  var transitionDurations = styles[transitionProp + 'Duration'].split(', ');\n  var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);\n  var animationDelays = styles[animationProp + 'Delay'].split(', ');\n  var animationDurations = styles[animationProp + 'Duration'].split(', ');\n  var animationTimeout = getTimeout(animationDelays, animationDurations);\n\n  var type;\n  var timeout = 0;\n  var propCount = 0;\n  /* istanbul ignore if */\n  if (expectedType === TRANSITION) {\n    if (transitionTimeout > 0) {\n      type = TRANSITION;\n      timeout = transitionTimeout;\n      propCount = transitionDurations.length;\n    }\n  } else if (expectedType === ANIMATION) {\n    if (animationTimeout > 0) {\n      type = ANIMATION;\n      timeout = animationTimeout;\n      propCount = animationDurations.length;\n    }\n  } else {\n    timeout = Math.max(transitionTimeout, animationTimeout);\n    type = timeout > 0\n      ? transitionTimeout > animationTimeout\n        ? TRANSITION\n        : ANIMATION\n      : null;\n    propCount = type\n      ? type === TRANSITION\n        ? transitionDurations.length\n        : animationDurations.length\n      : 0;\n  }\n  var hasTransform =\n    type === TRANSITION &&\n    transformRE.test(styles[transitionProp + 'Property']);\n  return {\n    type: type,\n    timeout: timeout,\n    propCount: propCount,\n    hasTransform: hasTransform\n  }\n}\n\nfunction getTimeout (delays, durations) {\n  /* istanbul ignore next */\n  while (delays.length < durations.length) {\n    delays = delays.concat(delays);\n  }\n\n  return Math.max.apply(null, durations.map(function (d, i) {\n    return toMs(d) + toMs(delays[i])\n  }))\n}\n\nfunction toMs (s) {\n  return Number(s.slice(0, -1)) * 1000\n}\n\n/*  */\n\nfunction enter (vnode) {\n  var el = vnode.elm;\n\n  // call leave callback now\n  if (el._leaveCb) {\n    el._leaveCb.cancelled = true;\n    el._leaveCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return\n  }\n\n  /* istanbul ignore if */\n  if (el._enterCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var enterClass = data.enterClass;\n  var enterActiveClass = data.enterActiveClass;\n  var appearClass = data.appearClass;\n  var appearActiveClass = data.appearActiveClass;\n  var beforeEnter = data.beforeEnter;\n  var enter = data.enter;\n  var afterEnter = data.afterEnter;\n  var enterCancelled = data.enterCancelled;\n  var beforeAppear = data.beforeAppear;\n  var appear = data.appear;\n  var afterAppear = data.afterAppear;\n  var appearCancelled = data.appearCancelled;\n\n  // activeInstance will always be the <transition> component managing this\n  // transition. One edge case to check is when the <transition> is placed\n  // as the root node of a child component. In that case we need to check\n  // <transition>'s parent for appear check.\n  var context = activeInstance;\n  var transitionNode = activeInstance.$vnode;\n  while (transitionNode && transitionNode.parent) {\n    transitionNode = transitionNode.parent;\n    context = transitionNode.context;\n  }\n\n  var isAppear = !context._isMounted || !vnode.isRootInsert;\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  var startClass = isAppear ? appearClass : enterClass;\n  var activeClass = isAppear ? appearActiveClass : enterActiveClass;\n  var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;\n  var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;\n  var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;\n  var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    enterHook &&\n    // enterHook may be a bound method which exposes\n    // the length of original fn as _length\n    (enterHook._length || enterHook.length) > 1;\n\n  var cb = el._enterCb = once(function () {\n    if (expectsCSS) {\n      removeTransitionClass(el, activeClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass);\n      }\n      enterCancelledHook && enterCancelledHook(el);\n    } else {\n      afterEnterHook && afterEnterHook(el);\n    }\n    el._enterCb = null;\n  });\n\n  if (!vnode.data.show) {\n    // remove pending leave element on enter by injecting an insert hook\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {\n      var parent = el.parentNode;\n      var pendingNode = parent && parent._pending && parent._pending[vnode.key];\n      if (pendingNode &&\n          pendingNode.context === vnode.context &&\n          pendingNode.tag === vnode.tag &&\n          pendingNode.elm._leaveCb) {\n        pendingNode.elm._leaveCb();\n      }\n      enterHook && enterHook(el, cb);\n    }, 'transition-insert');\n  }\n\n  // start enter transition\n  beforeEnterHook && beforeEnterHook(el);\n  if (expectsCSS) {\n    addTransitionClass(el, startClass);\n    addTransitionClass(el, activeClass);\n    nextFrame(function () {\n      removeTransitionClass(el, startClass);\n      if (!cb.cancelled && !userWantsControl) {\n        whenTransitionEnds(el, type, cb);\n      }\n    });\n  }\n\n  if (vnode.data.show) {\n    enterHook && enterHook(el, cb);\n  }\n\n  if (!expectsCSS && !userWantsControl) {\n    cb();\n  }\n}\n\nfunction leave (vnode, rm) {\n  var el = vnode.elm;\n\n  // call enter callback now\n  if (el._enterCb) {\n    el._enterCb.cancelled = true;\n    el._enterCb();\n  }\n\n  var data = resolveTransition(vnode.data.transition);\n  if (!data) {\n    return rm()\n  }\n\n  /* istanbul ignore if */\n  if (el._leaveCb || el.nodeType !== 1) {\n    return\n  }\n\n  var css = data.css;\n  var type = data.type;\n  var leaveClass = data.leaveClass;\n  var leaveActiveClass = data.leaveActiveClass;\n  var beforeLeave = data.beforeLeave;\n  var leave = data.leave;\n  var afterLeave = data.afterLeave;\n  var leaveCancelled = data.leaveCancelled;\n  var delayLeave = data.delayLeave;\n\n  var expectsCSS = css !== false && !isIE9;\n  var userWantsControl =\n    leave &&\n    // leave hook may be a bound method which exposes\n    // the length of original fn as _length\n    (leave._length || leave.length) > 1;\n\n  var cb = el._leaveCb = once(function () {\n    if (el.parentNode && el.parentNode._pending) {\n      el.parentNode._pending[vnode.key] = null;\n    }\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveActiveClass);\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass);\n      }\n      leaveCancelled && leaveCancelled(el);\n    } else {\n      rm();\n      afterLeave && afterLeave(el);\n    }\n    el._leaveCb = null;\n  });\n\n  if (delayLeave) {\n    delayLeave(performLeave);\n  } else {\n    performLeave();\n  }\n\n  function performLeave () {\n    // the delayed leave may have already been cancelled\n    if (cb.cancelled) {\n      return\n    }\n    // record leaving element\n    if (!vnode.data.show) {\n      (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;\n    }\n    beforeLeave && beforeLeave(el);\n    if (expectsCSS) {\n      addTransitionClass(el, leaveClass);\n      addTransitionClass(el, leaveActiveClass);\n      nextFrame(function () {\n        removeTransitionClass(el, leaveClass);\n        if (!cb.cancelled && !userWantsControl) {\n          whenTransitionEnds(el, type, cb);\n        }\n      });\n    }\n    leave && leave(el, cb);\n    if (!expectsCSS && !userWantsControl) {\n      cb();\n    }\n  }\n}\n\nfunction resolveTransition (def$$1) {\n  if (!def$$1) {\n    return\n  }\n  /* istanbul ignore else */\n  if (typeof def$$1 === 'object') {\n    var res = {};\n    if (def$$1.css !== false) {\n      extend(res, autoCssTransition(def$$1.name || 'v'));\n    }\n    extend(res, def$$1);\n    return res\n  } else if (typeof def$$1 === 'string') {\n    return autoCssTransition(def$$1)\n  }\n}\n\nvar autoCssTransition = cached(function (name) {\n  return {\n    enterClass: (name + \"-enter\"),\n    leaveClass: (name + \"-leave\"),\n    appearClass: (name + \"-enter\"),\n    enterActiveClass: (name + \"-enter-active\"),\n    leaveActiveClass: (name + \"-leave-active\"),\n    appearActiveClass: (name + \"-enter-active\")\n  }\n});\n\nfunction once (fn) {\n  var called = false;\n  return function () {\n    if (!called) {\n      called = true;\n      fn();\n    }\n  }\n}\n\nfunction _enter (_, vnode) {\n  if (!vnode.data.show) {\n    enter(vnode);\n  }\n}\n\nvar transition = inBrowser ? {\n  create: _enter,\n  activate: _enter,\n  remove: function remove (vnode, rm) {\n    /* istanbul ignore else */\n    if (!vnode.data.show) {\n      leave(vnode, rm);\n    } else {\n      rm();\n    }\n  }\n} : {};\n\nvar platformModules = [\n  attrs,\n  klass,\n  events,\n  domProps,\n  style,\n  transition\n];\n\n/*  */\n\n// the directive module should be applied last, after all\n// built-in modules have been applied.\nvar modules = platformModules.concat(baseModules);\n\nvar patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });\n\n/**\n * Not type checking this file because flow doesn't like attaching\n * properties to Elements.\n */\n\nvar modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;\n\n/* istanbul ignore if */\nif (isIE9) {\n  // http://www.matts411.com/post/internet-explorer-9-oninput/\n  document.addEventListener('selectionchange', function () {\n    var el = document.activeElement;\n    if (el && el.vmodel) {\n      trigger(el, 'input');\n    }\n  });\n}\n\nvar model = {\n  inserted: function inserted (el, binding, vnode) {\n    {\n      if (!modelableTagRE.test(vnode.tag)) {\n        warn(\n          \"v-model is not supported on element type: <\" + (vnode.tag) + \">. \" +\n          'If you are working with contenteditable, it\\'s recommended to ' +\n          'wrap a library dedicated for that purpose inside a custom component.',\n          vnode.context\n        );\n      }\n    }\n    if (vnode.tag === 'select') {\n      var cb = function () {\n        setSelected(el, binding, vnode.context);\n      };\n      cb();\n      /* istanbul ignore if */\n      if (isIE || isEdge) {\n        setTimeout(cb, 0);\n      }\n    } else if (\n      (vnode.tag === 'textarea' || el.type === 'text') &&\n      !binding.modifiers.lazy\n    ) {\n      if (!isAndroid) {\n        el.addEventListener('compositionstart', onCompositionStart);\n        el.addEventListener('compositionend', onCompositionEnd);\n      }\n      /* istanbul ignore if */\n      if (isIE9) {\n        el.vmodel = true;\n      }\n    }\n  },\n  componentUpdated: function componentUpdated (el, binding, vnode) {\n    if (vnode.tag === 'select') {\n      setSelected(el, binding, vnode.context);\n      // in case the options rendered by v-for have changed,\n      // it's possible that the value is out-of-sync with the rendered options.\n      // detect such cases and filter out values that no longer has a matching\n      // option in the DOM.\n      var needReset = el.multiple\n        ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })\n        : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);\n      if (needReset) {\n        trigger(el, 'change');\n      }\n    }\n  }\n};\n\nfunction setSelected (el, binding, vm) {\n  var value = binding.value;\n  var isMultiple = el.multiple;\n  if (isMultiple && !Array.isArray(value)) {\n    \"development\" !== 'production' && warn(\n      \"<select multiple v-model=\\\"\" + (binding.expression) + \"\\\"> \" +\n      \"expects an Array value for its binding, but got \" + (Object.prototype.toString.call(value).slice(8, -1)),\n      vm\n    );\n    return\n  }\n  var selected, option;\n  for (var i = 0, l = el.options.length; i < l; i++) {\n    option = el.options[i];\n    if (isMultiple) {\n      selected = looseIndexOf(value, getValue(option)) > -1;\n      if (option.selected !== selected) {\n        option.selected = selected;\n      }\n    } else {\n      if (looseEqual(getValue(option), value)) {\n        if (el.selectedIndex !== i) {\n          el.selectedIndex = i;\n        }\n        return\n      }\n    }\n  }\n  if (!isMultiple) {\n    el.selectedIndex = -1;\n  }\n}\n\nfunction hasNoMatchingOption (value, options) {\n  for (var i = 0, l = options.length; i < l; i++) {\n    if (looseEqual(getValue(options[i]), value)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction getValue (option) {\n  return '_value' in option\n    ? option._value\n    : option.value\n}\n\nfunction onCompositionStart (e) {\n  e.target.composing = true;\n}\n\nfunction onCompositionEnd (e) {\n  e.target.composing = false;\n  trigger(e.target, 'input');\n}\n\nfunction trigger (el, type) {\n  var e = document.createEvent('HTMLEvents');\n  e.initEvent(type, true, true);\n  el.dispatchEvent(e);\n}\n\n/*  */\n\n// recursively search for possible transition defined inside the component root\nfunction locateNode (vnode) {\n  return vnode.child && (!vnode.data || !vnode.data.transition)\n    ? locateNode(vnode.child._vnode)\n    : vnode\n}\n\nvar show = {\n  bind: function bind (el, ref, vnode) {\n    var value = ref.value;\n\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (value && transition && !isIE9) {\n      enter(vnode);\n    }\n    var originalDisplay = el.style.display === 'none' ? '' : el.style.display;\n    el.style.display = value ? originalDisplay : 'none';\n    el.__vOriginalDisplay = originalDisplay;\n  },\n  update: function update (el, ref, vnode) {\n    var value = ref.value;\n    var oldValue = ref.oldValue;\n\n    /* istanbul ignore if */\n    if (value === oldValue) { return }\n    vnode = locateNode(vnode);\n    var transition = vnode.data && vnode.data.transition;\n    if (transition && !isIE9) {\n      if (value) {\n        enter(vnode);\n        el.style.display = el.__vOriginalDisplay;\n      } else {\n        leave(vnode, function () {\n          el.style.display = 'none';\n        });\n      }\n    } else {\n      el.style.display = value ? el.__vOriginalDisplay : 'none';\n    }\n  }\n};\n\nvar platformDirectives = {\n  model: model,\n  show: show\n};\n\n/*  */\n\n// Provides transition support for a single element/component.\n// supports transition mode (out-in / in-out)\n\nvar transitionProps = {\n  name: String,\n  appear: Boolean,\n  css: Boolean,\n  mode: String,\n  type: String,\n  enterClass: String,\n  leaveClass: String,\n  enterActiveClass: String,\n  leaveActiveClass: String,\n  appearClass: String,\n  appearActiveClass: String\n};\n\n// in case the child is also an abstract component, e.g. <keep-alive>\n// we want to recursively retrieve the real component to be rendered\nfunction getRealChild (vnode) {\n  var compOptions = vnode && vnode.componentOptions;\n  if (compOptions && compOptions.Ctor.options.abstract) {\n    return getRealChild(getFirstComponentChild(compOptions.children))\n  } else {\n    return vnode\n  }\n}\n\nfunction extractTransitionData (comp) {\n  var data = {};\n  var options = comp.$options;\n  // props\n  for (var key in options.propsData) {\n    data[key] = comp[key];\n  }\n  // events.\n  // extract listeners and pass them directly to the transition methods\n  var listeners = options._parentListeners;\n  for (var key$1 in listeners) {\n    data[camelize(key$1)] = listeners[key$1].fn;\n  }\n  return data\n}\n\nfunction placeholder (h, rawChild) {\n  return /\\d-keep-alive$/.test(rawChild.tag)\n    ? h('keep-alive')\n    : null\n}\n\nfunction hasParentTransition (vnode) {\n  while ((vnode = vnode.parent)) {\n    if (vnode.data.transition) {\n      return true\n    }\n  }\n}\n\nvar Transition = {\n  name: 'transition',\n  props: transitionProps,\n  abstract: true,\n  render: function render (h) {\n    var this$1 = this;\n\n    var children = this.$slots.default;\n    if (!children) {\n      return\n    }\n\n    // filter out text nodes (possible whitespaces)\n    children = children.filter(function (c) { return c.tag; });\n    /* istanbul ignore if */\n    if (!children.length) {\n      return\n    }\n\n    // warn multiple elements\n    if (\"development\" !== 'production' && children.length > 1) {\n      warn(\n        '<transition> can only be used on a single element. Use ' +\n        '<transition-group> for lists.',\n        this.$parent\n      );\n    }\n\n    var mode = this.mode;\n\n    // warn invalid mode\n    if (\"development\" !== 'production' &&\n        mode && mode !== 'in-out' && mode !== 'out-in') {\n      warn(\n        'invalid <transition> mode: ' + mode,\n        this.$parent\n      );\n    }\n\n    var rawChild = children[0];\n\n    // if this is a component root node and the component's\n    // parent container node also has transition, skip.\n    if (hasParentTransition(this.$vnode)) {\n      return rawChild\n    }\n\n    // apply transition data to child\n    // use getRealChild() to ignore abstract components e.g. keep-alive\n    var child = getRealChild(rawChild);\n    /* istanbul ignore if */\n    if (!child) {\n      return rawChild\n    }\n\n    if (this._leaving) {\n      return placeholder(h, rawChild)\n    }\n\n    var key = child.key = child.key == null || child.isStatic\n      ? (\"__v\" + (child.tag + this._uid) + \"__\")\n      : child.key;\n    var data = (child.data || (child.data = {})).transition = extractTransitionData(this);\n    var oldRawChild = this._vnode;\n    var oldChild = getRealChild(oldRawChild);\n\n    // mark v-show\n    // so that the transition module can hand over the control to the directive\n    if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {\n      child.data.show = true;\n    }\n\n    if (oldChild && oldChild.data && oldChild.key !== key) {\n      // replace old child transition data with fresh one\n      // important for dynamic transitions!\n      var oldData = oldChild.data.transition = extend({}, data);\n\n      // handle transition mode\n      if (mode === 'out-in') {\n        // return placeholder node and queue update when leave finishes\n        this._leaving = true;\n        mergeVNodeHook(oldData, 'afterLeave', function () {\n          this$1._leaving = false;\n          this$1.$forceUpdate();\n        }, key);\n        return placeholder(h, rawChild)\n      } else if (mode === 'in-out') {\n        var delayedLeave;\n        var performLeave = function () { delayedLeave(); };\n        mergeVNodeHook(data, 'afterEnter', performLeave, key);\n        mergeVNodeHook(data, 'enterCancelled', performLeave, key);\n        mergeVNodeHook(oldData, 'delayLeave', function (leave) {\n          delayedLeave = leave;\n        }, key);\n      }\n    }\n\n    return rawChild\n  }\n};\n\n/*  */\n\n// Provides transition support for list items.\n// supports move transitions using the FLIP technique.\n\n// Because the vdom's children update algorithm is \"unstable\" - i.e.\n// it doesn't guarantee the relative positioning of removed elements,\n// we force transition-group to update its children into two passes:\n// in the first pass, we remove all nodes that need to be removed,\n// triggering their leaving transition; in the second pass, we insert/move\n// into the final disired state. This way in the second pass removed\n// nodes will remain where they should be.\n\nvar props = extend({\n  tag: String,\n  moveClass: String\n}, transitionProps);\n\ndelete props.mode;\n\nvar TransitionGroup = {\n  props: props,\n\n  render: function render (h) {\n    var tag = this.tag || this.$vnode.data.tag || 'span';\n    var map = Object.create(null);\n    var prevChildren = this.prevChildren = this.children;\n    var rawChildren = this.$slots.default || [];\n    var children = this.children = [];\n    var transitionData = extractTransitionData(this);\n\n    for (var i = 0; i < rawChildren.length; i++) {\n      var c = rawChildren[i];\n      if (c.tag) {\n        if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n          children.push(c);\n          map[c.key] = c\n          ;(c.data || (c.data = {})).transition = transitionData;\n        } else {\n          var opts = c.componentOptions;\n          var name = opts\n            ? (opts.Ctor.options.name || opts.tag)\n            : c.tag;\n          warn((\"<transition-group> children must be keyed: <\" + name + \">\"));\n        }\n      }\n    }\n\n    if (prevChildren) {\n      var kept = [];\n      var removed = [];\n      for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {\n        var c$1 = prevChildren[i$1];\n        c$1.data.transition = transitionData;\n        c$1.data.pos = c$1.elm.getBoundingClientRect();\n        if (map[c$1.key]) {\n          kept.push(c$1);\n        } else {\n          removed.push(c$1);\n        }\n      }\n      this.kept = h(tag, null, kept);\n      this.removed = removed;\n    }\n\n    return h(tag, null, children)\n  },\n\n  beforeUpdate: function beforeUpdate () {\n    // force removing pass\n    this.__patch__(\n      this._vnode,\n      this.kept,\n      false, // hydrating\n      true // removeOnly (!important, avoids unnecessary moves)\n    );\n    this._vnode = this.kept;\n  },\n\n  updated: function updated () {\n    var children = this.prevChildren;\n    var moveClass = this.moveClass || ((this.name || 'v') + '-move');\n    if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n      return\n    }\n\n    // we divide the work into three loops to avoid mixing DOM reads and writes\n    // in each iteration - which helps prevent layout thrashing.\n    children.forEach(callPendingCbs);\n    children.forEach(recordPosition);\n    children.forEach(applyTranslation);\n\n    // force reflow to put everything in position\n    var f = document.body.offsetHeight; // eslint-disable-line\n\n    children.forEach(function (c) {\n      if (c.data.moved) {\n        var el = c.elm;\n        var s = el.style;\n        addTransitionClass(el, moveClass);\n        s.transform = s.WebkitTransform = s.transitionDuration = '';\n        el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {\n          if (!e || /transform$/.test(e.propertyName)) {\n            el.removeEventListener(transitionEndEvent, cb);\n            el._moveCb = null;\n            removeTransitionClass(el, moveClass);\n          }\n        });\n      }\n    });\n  },\n\n  methods: {\n    hasMove: function hasMove (el, moveClass) {\n      /* istanbul ignore if */\n      if (!hasTransition) {\n        return false\n      }\n      if (this._hasMove != null) {\n        return this._hasMove\n      }\n      addTransitionClass(el, moveClass);\n      var info = getTransitionInfo(el);\n      removeTransitionClass(el, moveClass);\n      return (this._hasMove = info.hasTransform)\n    }\n  }\n};\n\nfunction callPendingCbs (c) {\n  /* istanbul ignore if */\n  if (c.elm._moveCb) {\n    c.elm._moveCb();\n  }\n  /* istanbul ignore if */\n  if (c.elm._enterCb) {\n    c.elm._enterCb();\n  }\n}\n\nfunction recordPosition (c) {\n  c.data.newPos = c.elm.getBoundingClientRect();\n}\n\nfunction applyTranslation (c) {\n  var oldPos = c.data.pos;\n  var newPos = c.data.newPos;\n  var dx = oldPos.left - newPos.left;\n  var dy = oldPos.top - newPos.top;\n  if (dx || dy) {\n    c.data.moved = true;\n    var s = c.elm.style;\n    s.transform = s.WebkitTransform = \"translate(\" + dx + \"px,\" + dy + \"px)\";\n    s.transitionDuration = '0s';\n  }\n}\n\nvar platformComponents = {\n  Transition: Transition,\n  TransitionGroup: TransitionGroup\n};\n\n/*  */\n\n// install platform specific utils\nVue$3.config.isUnknownElement = isUnknownElement;\nVue$3.config.isReservedTag = isReservedTag;\nVue$3.config.getTagNamespace = getTagNamespace;\nVue$3.config.mustUseProp = mustUseProp;\n\n// install platform runtime directives & components\nextend(Vue$3.options.directives, platformDirectives);\nextend(Vue$3.options.components, platformComponents);\n\n// install platform patch function\nVue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;\n\n// wrap mount\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && inBrowser ? query(el) : undefined;\n  return this._mount(el, hydrating)\n};\n\n// devtools global hook\n/* istanbul ignore next */\nsetTimeout(function () {\n  if (config.devtools) {\n    if (devtools) {\n      devtools.emit('init', Vue$3);\n    } else if (\n      \"development\" !== 'production' &&\n      inBrowser && /Chrome\\/\\d+/.test(window.navigator.userAgent)\n    ) {\n      console.log(\n        'Download the Vue Devtools for a better development experience:\\n' +\n        'https://github.com/vuejs/vue-devtools'\n      );\n    }\n  }\n}, 0);\n\n/*  */\n\n// check whether current browser encodes a char inside attribute values\nfunction shouldDecode (content, encoded) {\n  var div = document.createElement('div');\n  div.innerHTML = \"<div a=\\\"\" + content + \"\\\">\";\n  return div.innerHTML.indexOf(encoded) > 0\n}\n\n// #3663\n// IE encodes newlines inside attribute values while other browsers don't\nvar shouldDecodeNewlines = inBrowser ? shouldDecode('\\n', '&#10;') : false;\n\n/*  */\n\nvar decoder;\n\nfunction decode (html) {\n  decoder = decoder || document.createElement('div');\n  decoder.innerHTML = html;\n  return decoder.textContent\n}\n\n/*  */\n\nvar isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n  'link,meta,param,source,track,wbr',\n  true\n);\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nvar canBeLeftOpenTag = makeMap(\n  'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',\n  true\n);\n\n// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\nvar isNonPhrasingTag = makeMap(\n  'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n  'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n  'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n  'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n  'title,tr,track',\n  true\n);\n\n/**\n * Not type-checking this file because it's mostly vendor code.\n */\n\n/*!\n * HTML Parser By John Resig (ejohn.org)\n * Modified by Juriy \"kangax\" Zaytsev\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n */\n\n// Regular Expressions for parsing tags and attributes\nvar singleAttrIdentifier = /([^\\s\"'<>/=]+)/;\nvar singleAttrAssign = /(?:=)/;\nvar singleAttrValues = [\n  // attr value double quotes\n  /\"([^\"]*)\"+/.source,\n  // attr value, single quotes\n  /'([^']*)'+/.source,\n  // attr value, no quotes\n  /([^\\s\"'=<>`]+)/.source\n];\nvar attribute = new RegExp(\n  '^\\\\s*' + singleAttrIdentifier.source +\n  '(?:\\\\s*(' + singleAttrAssign.source + ')' +\n  '\\\\s*(?:' + singleAttrValues.join('|') + '))?'\n);\n\n// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName\n// but for Vue templates we can enforce a simple charset\nvar ncname = '[a-zA-Z_][\\\\w\\\\-\\\\.]*';\nvar qnameCapture = '((?:' + ncname + '\\\\:)?' + ncname + ')';\nvar startTagOpen = new RegExp('^<' + qnameCapture);\nvar startTagClose = /^\\s*(\\/?)>/;\nvar endTag = new RegExp('^<\\\\/' + qnameCapture + '[^>]*>');\nvar doctype = /^<!DOCTYPE [^>]+>/i;\nvar comment = /^<!--/;\nvar conditionalComment = /^<!\\[/;\n\nvar IS_REGEX_CAPTURING_BROKEN = false;\n'x'.replace(/x(.)?/g, function (m, g) {\n  IS_REGEX_CAPTURING_BROKEN = g === '';\n});\n\n// Special Elements (can contain anything)\nvar isScriptOrStyle = makeMap('script,style', true);\nvar hasLang = function (attr) { return attr.name === 'lang' && attr.value !== 'html'; };\nvar isSpecialTag = function (tag, isSFC, stack) {\n  if (isScriptOrStyle(tag)) {\n    return true\n  }\n  if (isSFC && stack.length === 1) {\n    // top-level template that has no pre-processor\n    if (tag === 'template' && !stack[0].attrs.some(hasLang)) {\n      return false\n    } else {\n      return true\n    }\n  }\n  return false\n};\n\nvar reCache = {};\n\nvar ltRE = /&lt;/g;\nvar gtRE = /&gt;/g;\nvar nlRE = /&#10;/g;\nvar ampRE = /&amp;/g;\nvar quoteRE = /&quot;/g;\n\nfunction decodeAttr (value, shouldDecodeNewlines) {\n  if (shouldDecodeNewlines) {\n    value = value.replace(nlRE, '\\n');\n  }\n  return value\n    .replace(ltRE, '<')\n    .replace(gtRE, '>')\n    .replace(ampRE, '&')\n    .replace(quoteRE, '\"')\n}\n\nfunction parseHTML (html, options) {\n  var stack = [];\n  var expectHTML = options.expectHTML;\n  var isUnaryTag$$1 = options.isUnaryTag || no;\n  var index = 0;\n  var last, lastTag;\n  while (html) {\n    last = html;\n    // Make sure we're not in a script or style element\n    if (!lastTag || !isSpecialTag(lastTag, options.sfc, stack)) {\n      var textEnd = html.indexOf('<');\n      if (textEnd === 0) {\n        // Comment:\n        if (comment.test(html)) {\n          var commentEnd = html.indexOf('-->');\n\n          if (commentEnd >= 0) {\n            advance(commentEnd + 3);\n            continue\n          }\n        }\n\n        // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n        if (conditionalComment.test(html)) {\n          var conditionalEnd = html.indexOf(']>');\n\n          if (conditionalEnd >= 0) {\n            advance(conditionalEnd + 2);\n            continue\n          }\n        }\n\n        // Doctype:\n        var doctypeMatch = html.match(doctype);\n        if (doctypeMatch) {\n          advance(doctypeMatch[0].length);\n          continue\n        }\n\n        // End tag:\n        var endTagMatch = html.match(endTag);\n        if (endTagMatch) {\n          var curIndex = index;\n          advance(endTagMatch[0].length);\n          parseEndTag(endTagMatch[0], endTagMatch[1], curIndex, index);\n          continue\n        }\n\n        // Start tag:\n        var startTagMatch = parseStartTag();\n        if (startTagMatch) {\n          handleStartTag(startTagMatch);\n          continue\n        }\n      }\n\n      var text = (void 0), rest$1 = (void 0), next = (void 0);\n      if (textEnd > 0) {\n        rest$1 = html.slice(textEnd);\n        while (\n          !endTag.test(rest$1) &&\n          !startTagOpen.test(rest$1) &&\n          !comment.test(rest$1) &&\n          !conditionalComment.test(rest$1)\n        ) {\n          // < in plain text, be forgiving and treat it as text\n          next = rest$1.indexOf('<', 1);\n          if (next < 0) { break }\n          textEnd += next;\n          rest$1 = html.slice(textEnd);\n        }\n        text = html.substring(0, textEnd);\n        advance(textEnd);\n      }\n\n      if (textEnd < 0) {\n        text = html;\n        html = '';\n      }\n\n      if (options.chars && text) {\n        options.chars(text);\n      }\n    } else {\n      var stackedTag = lastTag.toLowerCase();\n      var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));\n      var endTagLength = 0;\n      var rest = html.replace(reStackedTag, function (all, text, endTag) {\n        endTagLength = endTag.length;\n        if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {\n          text = text\n            .replace(/<!--([\\s\\S]*?)-->/g, '$1')\n            .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1');\n        }\n        if (options.chars) {\n          options.chars(text);\n        }\n        return ''\n      });\n      index += html.length - rest.length;\n      html = rest;\n      parseEndTag('</' + stackedTag + '>', stackedTag, index - endTagLength, index);\n    }\n\n    if (html === last && options.chars) {\n      options.chars(html);\n      break\n    }\n  }\n\n  // Clean up any remaining tags\n  parseEndTag();\n\n  function advance (n) {\n    index += n;\n    html = html.substring(n);\n  }\n\n  function parseStartTag () {\n    var start = html.match(startTagOpen);\n    if (start) {\n      var match = {\n        tagName: start[1],\n        attrs: [],\n        start: index\n      };\n      advance(start[0].length);\n      var end, attr;\n      while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {\n        advance(attr[0].length);\n        match.attrs.push(attr);\n      }\n      if (end) {\n        match.unarySlash = end[1];\n        advance(end[0].length);\n        match.end = index;\n        return match\n      }\n    }\n  }\n\n  function handleStartTag (match) {\n    var tagName = match.tagName;\n    var unarySlash = match.unarySlash;\n\n    if (expectHTML) {\n      if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n        parseEndTag('', lastTag);\n      }\n      if (canBeLeftOpenTag(tagName) && lastTag === tagName) {\n        parseEndTag('', tagName);\n      }\n    }\n\n    var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;\n\n    var l = match.attrs.length;\n    var attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      var args = match.attrs[i];\n      // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778\n      if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('\"\"') === -1) {\n        if (args[3] === '') { delete args[3]; }\n        if (args[4] === '') { delete args[4]; }\n        if (args[5] === '') { delete args[5]; }\n      }\n      var value = args[3] || args[4] || args[5] || '';\n      attrs[i] = {\n        name: args[1],\n        value: decodeAttr(\n          value,\n          options.shouldDecodeNewlines\n        )\n      };\n    }\n\n    if (!unary) {\n      stack.push({ tag: tagName, attrs: attrs });\n      lastTag = tagName;\n      unarySlash = '';\n    }\n\n    if (options.start) {\n      options.start(tagName, attrs, unary, match.start, match.end);\n    }\n  }\n\n  function parseEndTag (tag, tagName, start, end) {\n    var pos;\n    if (start == null) { start = index; }\n    if (end == null) { end = index; }\n\n    // Find the closest opened tag of the same type\n    if (tagName) {\n      var needle = tagName.toLowerCase();\n      for (pos = stack.length - 1; pos >= 0; pos--) {\n        if (stack[pos].tag.toLowerCase() === needle) {\n          break\n        }\n      }\n    } else {\n      // If no tag name is provided, clean shop\n      pos = 0;\n    }\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (var i = stack.length - 1; i >= pos; i--) {\n        if (options.end) {\n          options.end(stack[i].tag, start, end);\n        }\n      }\n\n      // Remove the open elements from the stack\n      stack.length = pos;\n      lastTag = pos && stack[pos - 1].tag;\n    } else if (tagName.toLowerCase() === 'br') {\n      if (options.start) {\n        options.start(tagName, [], true, start, end);\n      }\n    } else if (tagName.toLowerCase() === 'p') {\n      if (options.start) {\n        options.start(tagName, [], false, start, end);\n      }\n      if (options.end) {\n        options.end(tagName, start, end);\n      }\n    }\n  }\n}\n\n/*  */\n\nfunction parseFilters (exp) {\n  var inSingle = false;\n  var inDouble = false;\n  var inTemplateString = false;\n  var inRegex = false;\n  var curly = 0;\n  var square = 0;\n  var paren = 0;\n  var lastFilterIndex = 0;\n  var c, prev, i, expression, filters;\n\n  for (i = 0; i < exp.length; i++) {\n    prev = c;\n    c = exp.charCodeAt(i);\n    if (inSingle) {\n      if (c === 0x27 && prev !== 0x5C) { inSingle = false; }\n    } else if (inDouble) {\n      if (c === 0x22 && prev !== 0x5C) { inDouble = false; }\n    } else if (inTemplateString) {\n      if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }\n    } else if (inRegex) {\n      if (c === 0x2f && prev !== 0x5C) { inRegex = false; }\n    } else if (\n      c === 0x7C && // pipe\n      exp.charCodeAt(i + 1) !== 0x7C &&\n      exp.charCodeAt(i - 1) !== 0x7C &&\n      !curly && !square && !paren\n    ) {\n      if (expression === undefined) {\n        // first filter, end of expression\n        lastFilterIndex = i + 1;\n        expression = exp.slice(0, i).trim();\n      } else {\n        pushFilter();\n      }\n    } else {\n      switch (c) {\n        case 0x22: inDouble = true; break         // \"\n        case 0x27: inSingle = true; break         // '\n        case 0x60: inTemplateString = true; break // `\n        case 0x2f: inRegex = true; break          // /\n        case 0x28: paren++; break                 // (\n        case 0x29: paren--; break                 // )\n        case 0x5B: square++; break                // [\n        case 0x5D: square--; break                // ]\n        case 0x7B: curly++; break                 // {\n        case 0x7D: curly--; break                 // }\n      }\n    }\n  }\n\n  if (expression === undefined) {\n    expression = exp.slice(0, i).trim();\n  } else if (lastFilterIndex !== 0) {\n    pushFilter();\n  }\n\n  function pushFilter () {\n    (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());\n    lastFilterIndex = i + 1;\n  }\n\n  if (filters) {\n    for (i = 0; i < filters.length; i++) {\n      expression = wrapFilter(expression, filters[i]);\n    }\n  }\n\n  return expression\n}\n\nfunction wrapFilter (exp, filter) {\n  var i = filter.indexOf('(');\n  if (i < 0) {\n    // _f: resolveFilter\n    return (\"_f(\\\"\" + filter + \"\\\")(\" + exp + \")\")\n  } else {\n    var name = filter.slice(0, i);\n    var args = filter.slice(i + 1);\n    return (\"_f(\\\"\" + name + \"\\\")(\" + exp + \",\" + args)\n  }\n}\n\n/*  */\n\nvar defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g;\nvar regexEscapeRE = /[-.*+?^${}()|[\\]/\\\\]/g;\n\nvar buildRegex = cached(function (delimiters) {\n  var open = delimiters[0].replace(regexEscapeRE, '\\\\$&');\n  var close = delimiters[1].replace(regexEscapeRE, '\\\\$&');\n  return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n});\n\nfunction parseText (\n  text,\n  delimiters\n) {\n  var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;\n  if (!tagRE.test(text)) {\n    return\n  }\n  var tokens = [];\n  var lastIndex = tagRE.lastIndex = 0;\n  var match, index;\n  while ((match = tagRE.exec(text))) {\n    index = match.index;\n    // push text token\n    if (index > lastIndex) {\n      tokens.push(JSON.stringify(text.slice(lastIndex, index)));\n    }\n    // tag token\n    var exp = parseFilters(match[1].trim());\n    tokens.push((\"_s(\" + exp + \")\"));\n    lastIndex = index + match[0].length;\n  }\n  if (lastIndex < text.length) {\n    tokens.push(JSON.stringify(text.slice(lastIndex)));\n  }\n  return tokens.join('+')\n}\n\n/*  */\n\nfunction baseWarn (msg) {\n  console.error((\"[Vue parser]: \" + msg));\n}\n\nfunction pluckModuleFunction (\n  modules,\n  key\n) {\n  return modules\n    ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })\n    : []\n}\n\nfunction addProp (el, name, value) {\n  (el.props || (el.props = [])).push({ name: name, value: value });\n}\n\nfunction addAttr (el, name, value) {\n  (el.attrs || (el.attrs = [])).push({ name: name, value: value });\n}\n\nfunction addDirective (\n  el,\n  name,\n  rawName,\n  value,\n  arg,\n  modifiers\n) {\n  (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });\n}\n\nfunction addHandler (\n  el,\n  name,\n  value,\n  modifiers,\n  important\n) {\n  // check capture modifier\n  if (modifiers && modifiers.capture) {\n    delete modifiers.capture;\n    name = '!' + name; // mark the event as captured\n  }\n  if (modifiers && modifiers.once) {\n    delete modifiers.once;\n    name = '~' + name; // mark the event as once\n  }\n  var events;\n  if (modifiers && modifiers.native) {\n    delete modifiers.native;\n    events = el.nativeEvents || (el.nativeEvents = {});\n  } else {\n    events = el.events || (el.events = {});\n  }\n  var newHandler = { value: value, modifiers: modifiers };\n  var handlers = events[name];\n  /* istanbul ignore if */\n  if (Array.isArray(handlers)) {\n    important ? handlers.unshift(newHandler) : handlers.push(newHandler);\n  } else if (handlers) {\n    events[name] = important ? [newHandler, handlers] : [handlers, newHandler];\n  } else {\n    events[name] = newHandler;\n  }\n}\n\nfunction getBindingAttr (\n  el,\n  name,\n  getStatic\n) {\n  var dynamicValue =\n    getAndRemoveAttr(el, ':' + name) ||\n    getAndRemoveAttr(el, 'v-bind:' + name);\n  if (dynamicValue != null) {\n    return parseFilters(dynamicValue)\n  } else if (getStatic !== false) {\n    var staticValue = getAndRemoveAttr(el, name);\n    if (staticValue != null) {\n      return JSON.stringify(staticValue)\n    }\n  }\n}\n\nfunction getAndRemoveAttr (el, name) {\n  var val;\n  if ((val = el.attrsMap[name]) != null) {\n    var list = el.attrsList;\n    for (var i = 0, l = list.length; i < l; i++) {\n      if (list[i].name === name) {\n        list.splice(i, 1);\n        break\n      }\n    }\n  }\n  return val\n}\n\nvar len;\nvar str;\nvar chr;\nvar index$1;\nvar expressionPos;\nvar expressionEndPos;\n\n/**\n * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)\n *\n * for loop possible cases:\n *\n * - test\n * - test[idx]\n * - test[test1[idx]]\n * - test[\"a\"][idx]\n * - xxx.test[a[a].test1[idx]]\n * - test.xxx.a[\"asa\"][test1[idx]]\n *\n */\n\nfunction parseModel (val) {\n  str = val;\n  len = str.length;\n  index$1 = expressionPos = expressionEndPos = 0;\n\n  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n    return {\n      exp: val,\n      idx: null\n    }\n  }\n\n  while (!eof()) {\n    chr = next();\n    /* istanbul ignore if */\n    if (isStringStart(chr)) {\n      parseString(chr);\n    } else if (chr === 0x5B) {\n      parseBracket(chr);\n    }\n  }\n\n  return {\n    exp: val.substring(0, expressionPos),\n    idx: val.substring(expressionPos + 1, expressionEndPos)\n  }\n}\n\nfunction next () {\n  return str.charCodeAt(++index$1)\n}\n\nfunction eof () {\n  return index$1 >= len\n}\n\nfunction isStringStart (chr) {\n  return chr === 0x22 || chr === 0x27\n}\n\nfunction parseBracket (chr) {\n  var inBracket = 1;\n  expressionPos = index$1;\n  while (!eof()) {\n    chr = next();\n    if (isStringStart(chr)) {\n      parseString(chr);\n      continue\n    }\n    if (chr === 0x5B) { inBracket++; }\n    if (chr === 0x5D) { inBracket--; }\n    if (inBracket === 0) {\n      expressionEndPos = index$1;\n      break\n    }\n  }\n}\n\nfunction parseString (chr) {\n  var stringQuote = chr;\n  while (!eof()) {\n    chr = next();\n    if (chr === stringQuote) {\n      break\n    }\n  }\n}\n\n/*  */\n\nvar dirRE = /^v-|^@|^:/;\nvar forAliasRE = /(.*?)\\s+(?:in|of)\\s+(.*)/;\nvar forIteratorRE = /\\((\\{[^}]*\\}|[^,]*),([^,]*)(?:,([^,]*))?\\)/;\nvar bindRE = /^:|^v-bind:/;\nvar onRE = /^@|^v-on:/;\nvar argRE = /:(.*)$/;\nvar modifierRE = /\\.[^.]+/g;\n\nvar decodeHTMLCached = cached(decode);\n\n// configurable state\nvar warn$1;\nvar platformGetTagNamespace;\nvar platformMustUseProp;\nvar platformIsPreTag;\nvar preTransforms;\nvar transforms;\nvar postTransforms;\nvar delimiters;\n\n/**\n * Convert HTML string to AST.\n */\nfunction parse (\n  template,\n  options\n) {\n  warn$1 = options.warn || baseWarn;\n  platformGetTagNamespace = options.getTagNamespace || no;\n  platformMustUseProp = options.mustUseProp || no;\n  platformIsPreTag = options.isPreTag || no;\n  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');\n  transforms = pluckModuleFunction(options.modules, 'transformNode');\n  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');\n  delimiters = options.delimiters;\n  var stack = [];\n  var preserveWhitespace = options.preserveWhitespace !== false;\n  var root;\n  var currentParent;\n  var inVPre = false;\n  var inPre = false;\n  var warned = false;\n  parseHTML(template, {\n    expectHTML: options.expectHTML,\n    isUnaryTag: options.isUnaryTag,\n    shouldDecodeNewlines: options.shouldDecodeNewlines,\n    start: function start (tag, attrs, unary) {\n      // check namespace.\n      // inherit parent ns if there is one\n      var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);\n\n      // handle IE svg bug\n      /* istanbul ignore if */\n      if (isIE && ns === 'svg') {\n        attrs = guardIESVGBug(attrs);\n      }\n\n      var element = {\n        type: 1,\n        tag: tag,\n        attrsList: attrs,\n        attrsMap: makeAttrsMap(attrs),\n        parent: currentParent,\n        children: []\n      };\n      if (ns) {\n        element.ns = ns;\n      }\n\n      if (isForbiddenTag(element) && !isServerRendering()) {\n        element.forbidden = true;\n        \"development\" !== 'production' && warn$1(\n          'Templates should only be responsible for mapping the state to the ' +\n          'UI. Avoid placing tags with side-effects in your templates, such as ' +\n          \"<\" + tag + \">.\"\n        );\n      }\n\n      // apply pre-transforms\n      for (var i = 0; i < preTransforms.length; i++) {\n        preTransforms[i](element, options);\n      }\n\n      if (!inVPre) {\n        processPre(element);\n        if (element.pre) {\n          inVPre = true;\n        }\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = true;\n      }\n      if (inVPre) {\n        processRawAttrs(element);\n      } else {\n        processFor(element);\n        processIf(element);\n        processOnce(element);\n        processKey(element);\n\n        // determine whether this is a plain element after\n        // removing structural attributes\n        element.plain = !element.key && !attrs.length;\n\n        processRef(element);\n        processSlot(element);\n        processComponent(element);\n        for (var i$1 = 0; i$1 < transforms.length; i$1++) {\n          transforms[i$1](element, options);\n        }\n        processAttrs(element);\n      }\n\n      function checkRootConstraints (el) {\n        if (\"development\" !== 'production' && !warned) {\n          if (el.tag === 'slot' || el.tag === 'template') {\n            warned = true;\n            warn$1(\n              \"Cannot use <\" + (el.tag) + \"> as component root element because it may \" +\n              'contain multiple nodes:\\n' + template\n            );\n          }\n          if (el.attrsMap.hasOwnProperty('v-for')) {\n            warned = true;\n            warn$1(\n              'Cannot use v-for on stateful component root element because ' +\n              'it renders multiple elements:\\n' + template\n            );\n          }\n        }\n      }\n\n      // tree management\n      if (!root) {\n        root = element;\n        checkRootConstraints(root);\n      } else if (!stack.length) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          checkRootConstraints(element);\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element\n          });\n        } else if (\"development\" !== 'production' && !warned) {\n          warned = true;\n          warn$1(\n            \"Component template should contain exactly one root element:\" +\n            \"\\n\\n\" + template + \"\\n\\n\" +\n            \"If you are using v-if on multiple elements, \" +\n            \"use v-else-if to chain them instead.\"\n          );\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent);\n        } else if (element.slotScope) { // scoped slot\n          currentParent.plain = false;\n          var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;\n        } else {\n          currentParent.children.push(element);\n          element.parent = currentParent;\n        }\n      }\n      if (!unary) {\n        currentParent = element;\n        stack.push(element);\n      }\n      // apply post-transforms\n      for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {\n        postTransforms[i$2](element, options);\n      }\n    },\n\n    end: function end () {\n      // remove trailing whitespace\n      var element = stack[stack.length - 1];\n      var lastNode = element.children[element.children.length - 1];\n      if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {\n        element.children.pop();\n      }\n      // pop stack\n      stack.length -= 1;\n      currentParent = stack[stack.length - 1];\n      // check pre state\n      if (element.pre) {\n        inVPre = false;\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = false;\n      }\n    },\n\n    chars: function chars (text) {\n      if (!currentParent) {\n        if (\"development\" !== 'production' && !warned && text === template) {\n          warned = true;\n          warn$1(\n            'Component template requires a root element, rather than just text:\\n\\n' + template\n          );\n        }\n        return\n      }\n      // IE textarea placeholder bug\n      /* istanbul ignore if */\n      if (isIE &&\n          currentParent.tag === 'textarea' &&\n          currentParent.attrsMap.placeholder === text) {\n        return\n      }\n      text = inPre || text.trim()\n        ? decodeHTMLCached(text)\n        // only preserve whitespace if its not right after a starting tag\n        : preserveWhitespace && currentParent.children.length ? ' ' : '';\n      if (text) {\n        var expression;\n        if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {\n          currentParent.children.push({\n            type: 2,\n            expression: expression,\n            text: text\n          });\n        } else {\n          currentParent.children.push({\n            type: 3,\n            text: text\n          });\n        }\n      }\n    }\n  });\n  return root\n}\n\nfunction processPre (el) {\n  if (getAndRemoveAttr(el, 'v-pre') != null) {\n    el.pre = true;\n  }\n}\n\nfunction processRawAttrs (el) {\n  var l = el.attrsList.length;\n  if (l) {\n    var attrs = el.attrs = new Array(l);\n    for (var i = 0; i < l; i++) {\n      attrs[i] = {\n        name: el.attrsList[i].name,\n        value: JSON.stringify(el.attrsList[i].value)\n      };\n    }\n  } else if (!el.pre) {\n    // non root node in pre blocks with no attributes\n    el.plain = true;\n  }\n}\n\nfunction processKey (el) {\n  var exp = getBindingAttr(el, 'key');\n  if (exp) {\n    if (\"development\" !== 'production' && el.tag === 'template') {\n      warn$1(\"<template> cannot be keyed. Place the key on real elements instead.\");\n    }\n    el.key = exp;\n  }\n}\n\nfunction processRef (el) {\n  var ref = getBindingAttr(el, 'ref');\n  if (ref) {\n    el.ref = ref;\n    el.refInFor = checkInFor(el);\n  }\n}\n\nfunction processFor (el) {\n  var exp;\n  if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n    var inMatch = exp.match(forAliasRE);\n    if (!inMatch) {\n      \"development\" !== 'production' && warn$1(\n        (\"Invalid v-for expression: \" + exp)\n      );\n      return\n    }\n    el.for = inMatch[2].trim();\n    var alias = inMatch[1].trim();\n    var iteratorMatch = alias.match(forIteratorRE);\n    if (iteratorMatch) {\n      el.alias = iteratorMatch[1].trim();\n      el.iterator1 = iteratorMatch[2].trim();\n      if (iteratorMatch[3]) {\n        el.iterator2 = iteratorMatch[3].trim();\n      }\n    } else {\n      el.alias = alias;\n    }\n  }\n}\n\nfunction processIf (el) {\n  var exp = getAndRemoveAttr(el, 'v-if');\n  if (exp) {\n    el.if = exp;\n    addIfCondition(el, {\n      exp: exp,\n      block: el\n    });\n  } else {\n    if (getAndRemoveAttr(el, 'v-else') != null) {\n      el.else = true;\n    }\n    var elseif = getAndRemoveAttr(el, 'v-else-if');\n    if (elseif) {\n      el.elseif = elseif;\n    }\n  }\n}\n\nfunction processIfConditions (el, parent) {\n  var prev = findPrevElement(parent.children);\n  if (prev && prev.if) {\n    addIfCondition(prev, {\n      exp: el.elseif,\n      block: el\n    });\n  } else {\n    warn$1(\n      \"v-\" + (el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else') + \" \" +\n      \"used on element <\" + (el.tag) + \"> without corresponding v-if.\"\n    );\n  }\n}\n\nfunction addIfCondition (el, condition) {\n  if (!el.ifConditions) {\n    el.ifConditions = [];\n  }\n  el.ifConditions.push(condition);\n}\n\nfunction processOnce (el) {\n  var once = getAndRemoveAttr(el, 'v-once');\n  if (once != null) {\n    el.once = true;\n  }\n}\n\nfunction processSlot (el) {\n  if (el.tag === 'slot') {\n    el.slotName = getBindingAttr(el, 'name');\n    if (\"development\" !== 'production' && el.key) {\n      warn$1(\n        \"`key` does not work on <slot> because slots are abstract outlets \" +\n        \"and can possibly expand into multiple elements. \" +\n        \"Use the key on a wrapping element instead.\"\n      );\n    }\n  } else {\n    var slotTarget = getBindingAttr(el, 'slot');\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget;\n    }\n    if (el.tag === 'template') {\n      el.slotScope = getAndRemoveAttr(el, 'scope');\n    }\n  }\n}\n\nfunction processComponent (el) {\n  var binding;\n  if ((binding = getBindingAttr(el, 'is'))) {\n    el.component = binding;\n  }\n  if (getAndRemoveAttr(el, 'inline-template') != null) {\n    el.inlineTemplate = true;\n  }\n}\n\nfunction processAttrs (el) {\n  var list = el.attrsList;\n  var i, l, name, rawName, value, arg, modifiers, isProp;\n  for (i = 0, l = list.length; i < l; i++) {\n    name = rawName = list[i].name;\n    value = list[i].value;\n    if (dirRE.test(name)) {\n      // mark element as dynamic\n      el.hasBindings = true;\n      // modifiers\n      modifiers = parseModifiers(name);\n      if (modifiers) {\n        name = name.replace(modifierRE, '');\n      }\n      if (bindRE.test(name)) { // v-bind\n        name = name.replace(bindRE, '');\n        value = parseFilters(value);\n        if (modifiers) {\n          if (modifiers.prop) {\n            isProp = true;\n            name = camelize(name);\n            if (name === 'innerHtml') { name = 'innerHTML'; }\n          }\n          if (modifiers.camel) {\n            name = camelize(name);\n          }\n        }\n        if (isProp || platformMustUseProp(el.tag, name)) {\n          addProp(el, name, value);\n        } else {\n          addAttr(el, name, value);\n        }\n      } else if (onRE.test(name)) { // v-on\n        name = name.replace(onRE, '');\n        addHandler(el, name, value, modifiers);\n      } else { // normal directives\n        name = name.replace(dirRE, '');\n        // parse arg\n        var argMatch = name.match(argRE);\n        if (argMatch && (arg = argMatch[1])) {\n          name = name.slice(0, -(arg.length + 1));\n        }\n        addDirective(el, name, rawName, value, arg, modifiers);\n        if (\"development\" !== 'production' && name === 'model') {\n          checkForAliasModel(el, value);\n        }\n      }\n    } else {\n      // literal attribute\n      {\n        var expression = parseText(value, delimiters);\n        if (expression) {\n          warn$1(\n            name + \"=\\\"\" + value + \"\\\": \" +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.'\n          );\n        }\n      }\n      addAttr(el, name, JSON.stringify(value));\n    }\n  }\n}\n\nfunction checkInFor (el) {\n  var parent = el;\n  while (parent) {\n    if (parent.for !== undefined) {\n      return true\n    }\n    parent = parent.parent;\n  }\n  return false\n}\n\nfunction parseModifiers (name) {\n  var match = name.match(modifierRE);\n  if (match) {\n    var ret = {};\n    match.forEach(function (m) { ret[m.slice(1)] = true; });\n    return ret\n  }\n}\n\nfunction makeAttrsMap (attrs) {\n  var map = {};\n  for (var i = 0, l = attrs.length; i < l; i++) {\n    if (\"development\" !== 'production' && map[attrs[i].name] && !isIE) {\n      warn$1('duplicate attribute: ' + attrs[i].name);\n    }\n    map[attrs[i].name] = attrs[i].value;\n  }\n  return map\n}\n\nfunction findPrevElement (children) {\n  var i = children.length;\n  while (i--) {\n    if (children[i].tag) { return children[i] }\n  }\n}\n\nfunction isForbiddenTag (el) {\n  return (\n    el.tag === 'style' ||\n    (el.tag === 'script' && (\n      !el.attrsMap.type ||\n      el.attrsMap.type === 'text/javascript'\n    ))\n  )\n}\n\nvar ieNSBug = /^xmlns:NS\\d+/;\nvar ieNSPrefix = /^NS\\d+:/;\n\n/* istanbul ignore next */\nfunction guardIESVGBug (attrs) {\n  var res = [];\n  for (var i = 0; i < attrs.length; i++) {\n    var attr = attrs[i];\n    if (!ieNSBug.test(attr.name)) {\n      attr.name = attr.name.replace(ieNSPrefix, '');\n      res.push(attr);\n    }\n  }\n  return res\n}\n\nfunction checkForAliasModel (el, value) {\n  var _el = el;\n  while (_el) {\n    if (_el.for && _el.alias === value) {\n      warn$1(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\">: \" +\n        \"You are binding v-model directly to a v-for iteration alias. \" +\n        \"This will not be able to modify the v-for source array because \" +\n        \"writing to the alias is like modifying a function local variable. \" +\n        \"Consider using an array of objects and use v-model on an object property instead.\"\n      );\n    }\n    _el = _el.parent;\n  }\n}\n\n/*  */\n\nvar isStaticKey;\nvar isPlatformReservedTag;\n\nvar genStaticKeysCached = cached(genStaticKeys$1);\n\n/**\n * Goal of the optimizer: walk the generated template AST tree\n * and detect sub-trees that are purely static, i.e. parts of\n * the DOM that never needs to change.\n *\n * Once we detect these sub-trees, we can:\n *\n * 1. Hoist them into constants, so that we no longer need to\n *    create fresh nodes for them on each re-render;\n * 2. Completely skip them in the patching process.\n */\nfunction optimize (root, options) {\n  if (!root) { return }\n  isStaticKey = genStaticKeysCached(options.staticKeys || '');\n  isPlatformReservedTag = options.isReservedTag || no;\n  // first pass: mark all non-static nodes.\n  markStatic(root);\n  // second pass: mark static roots.\n  markStaticRoots(root, false);\n}\n\nfunction genStaticKeys$1 (keys) {\n  return makeMap(\n    'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +\n    (keys ? ',' + keys : '')\n  )\n}\n\nfunction markStatic (node) {\n  node.static = isStatic(node);\n  if (node.type === 1) {\n    // do not make component slot content static. this avoids\n    // 1. components not able to mutate slot nodes\n    // 2. static slot content fails for hot-reloading\n    if (\n      !isPlatformReservedTag(node.tag) &&\n      node.tag !== 'slot' &&\n      node.attrsMap['inline-template'] == null\n    ) {\n      return\n    }\n    for (var i = 0, l = node.children.length; i < l; i++) {\n      var child = node.children[i];\n      markStatic(child);\n      if (!child.static) {\n        node.static = false;\n      }\n    }\n  }\n}\n\nfunction markStaticRoots (node, isInFor) {\n  if (node.type === 1) {\n    if (node.static || node.once) {\n      node.staticInFor = isInFor;\n    }\n    // For a node to qualify as a static root, it should have children that\n    // are not just static text. Otherwise the cost of hoisting out will\n    // outweigh the benefits and it's better off to just always render it fresh.\n    if (node.static && node.children.length && !(\n      node.children.length === 1 &&\n      node.children[0].type === 3\n    )) {\n      node.staticRoot = true;\n      return\n    } else {\n      node.staticRoot = false;\n    }\n    if (node.children) {\n      for (var i = 0, l = node.children.length; i < l; i++) {\n        markStaticRoots(node.children[i], isInFor || !!node.for);\n      }\n    }\n    if (node.ifConditions) {\n      walkThroughConditionsBlocks(node.ifConditions, isInFor);\n    }\n  }\n}\n\nfunction walkThroughConditionsBlocks (conditionBlocks, isInFor) {\n  for (var i = 1, len = conditionBlocks.length; i < len; i++) {\n    markStaticRoots(conditionBlocks[i].block, isInFor);\n  }\n}\n\nfunction isStatic (node) {\n  if (node.type === 2) { // expression\n    return false\n  }\n  if (node.type === 3) { // text\n    return true\n  }\n  return !!(node.pre || (\n    !node.hasBindings && // no dynamic bindings\n    !node.if && !node.for && // not v-if or v-for or v-else\n    !isBuiltInTag(node.tag) && // not a built-in\n    isPlatformReservedTag(node.tag) && // not a component\n    !isDirectChildOfTemplateFor(node) &&\n    Object.keys(node).every(isStaticKey)\n  ))\n}\n\nfunction isDirectChildOfTemplateFor (node) {\n  while (node.parent) {\n    node = node.parent;\n    if (node.tag !== 'template') {\n      return false\n    }\n    if (node.for) {\n      return true\n    }\n  }\n  return false\n}\n\n/*  */\n\nvar fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/;\nvar simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/;\n\n// keyCode aliases\nvar keyCodes = {\n  esc: 27,\n  tab: 9,\n  enter: 13,\n  space: 32,\n  up: 38,\n  left: 37,\n  right: 39,\n  down: 40,\n  'delete': [8, 46]\n};\n\nvar modifierCode = {\n  stop: '$event.stopPropagation();',\n  prevent: '$event.preventDefault();',\n  self: 'if($event.target !== $event.currentTarget)return;',\n  ctrl: 'if(!$event.ctrlKey)return;',\n  shift: 'if(!$event.shiftKey)return;',\n  alt: 'if(!$event.altKey)return;',\n  meta: 'if(!$event.metaKey)return;'\n};\n\nfunction genHandlers (events, native) {\n  var res = native ? 'nativeOn:{' : 'on:{';\n  for (var name in events) {\n    res += \"\\\"\" + name + \"\\\":\" + (genHandler(name, events[name])) + \",\";\n  }\n  return res.slice(0, -1) + '}'\n}\n\nfunction genHandler (\n  name,\n  handler\n) {\n  if (!handler) {\n    return 'function(){}'\n  } else if (Array.isArray(handler)) {\n    return (\"[\" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + \"]\")\n  } else if (!handler.modifiers) {\n    return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)\n      ? handler.value\n      : (\"function($event){\" + (handler.value) + \"}\")\n  } else {\n    var code = '';\n    var keys = [];\n    for (var key in handler.modifiers) {\n      if (modifierCode[key]) {\n        code += modifierCode[key];\n      } else {\n        keys.push(key);\n      }\n    }\n    if (keys.length) {\n      code = genKeyFilter(keys) + code;\n    }\n    var handlerCode = simplePathRE.test(handler.value)\n      ? handler.value + '($event)'\n      : handler.value;\n    return 'function($event){' + code + handlerCode + '}'\n  }\n}\n\nfunction genKeyFilter (keys) {\n  return (\"if(\" + (keys.map(genFilterCode).join('&&')) + \")return;\")\n}\n\nfunction genFilterCode (key) {\n  var keyVal = parseInt(key, 10);\n  if (keyVal) {\n    return (\"$event.keyCode!==\" + keyVal)\n  }\n  var alias = keyCodes[key];\n  return (\"_k($event.keyCode,\" + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + \")\")\n}\n\n/*  */\n\nfunction bind$2 (el, dir) {\n  el.wrapData = function (code) {\n    return (\"_b(\" + code + \",'\" + (el.tag) + \"',\" + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + \")\")\n  };\n}\n\nvar baseDirectives = {\n  bind: bind$2,\n  cloak: noop\n};\n\n/*  */\n\n// configurable state\nvar warn$2;\nvar transforms$1;\nvar dataGenFns;\nvar platformDirectives$1;\nvar staticRenderFns;\nvar onceCount;\nvar currentOptions;\n\nfunction generate (\n  ast,\n  options\n) {\n  // save previous staticRenderFns so generate calls can be nested\n  var prevStaticRenderFns = staticRenderFns;\n  var currentStaticRenderFns = staticRenderFns = [];\n  var prevOnceCount = onceCount;\n  onceCount = 0;\n  currentOptions = options;\n  warn$2 = options.warn || baseWarn;\n  transforms$1 = pluckModuleFunction(options.modules, 'transformCode');\n  dataGenFns = pluckModuleFunction(options.modules, 'genData');\n  platformDirectives$1 = options.directives || {};\n  var code = ast ? genElement(ast) : '_h(\"div\")';\n  staticRenderFns = prevStaticRenderFns;\n  onceCount = prevOnceCount;\n  return {\n    render: (\"with(this){return \" + code + \"}\"),\n    staticRenderFns: currentStaticRenderFns\n  }\n}\n\nfunction genElement (el) {\n  if (el.staticRoot && !el.staticProcessed) {\n    return genStatic(el)\n  } else if (el.once && !el.onceProcessed) {\n    return genOnce(el)\n  } else if (el.for && !el.forProcessed) {\n    return genFor(el)\n  } else if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.tag === 'template' && !el.slotTarget) {\n    return genChildren(el) || 'void 0'\n  } else if (el.tag === 'slot') {\n    return genSlot(el)\n  } else {\n    // component or element\n    var code;\n    if (el.component) {\n      code = genComponent(el.component, el);\n    } else {\n      var data = el.plain ? undefined : genData(el);\n\n      var children = el.inlineTemplate ? null : genChildren(el);\n      code = \"_h('\" + (el.tag) + \"'\" + (data ? (\",\" + data) : '') + (children ? (\",\" + children) : '') + \")\";\n    }\n    // module transforms\n    for (var i = 0; i < transforms$1.length; i++) {\n      code = transforms$1[i](el, code);\n    }\n    return code\n  }\n}\n\n// hoist static sub-trees out\nfunction genStatic (el) {\n  el.staticProcessed = true;\n  staticRenderFns.push((\"with(this){return \" + (genElement(el)) + \"}\"));\n  return (\"_m(\" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + \")\")\n}\n\n// v-once\nfunction genOnce (el) {\n  el.onceProcessed = true;\n  if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.staticInFor) {\n    var key = '';\n    var parent = el.parent;\n    while (parent) {\n      if (parent.for) {\n        key = parent.key;\n        break\n      }\n      parent = parent.parent;\n    }\n    if (!key) {\n      \"development\" !== 'production' && warn$2(\n        \"v-once can only be used inside v-for that is keyed. \"\n      );\n      return genElement(el)\n    }\n    return (\"_o(\" + (genElement(el)) + \",\" + (onceCount++) + (key ? (\",\" + key) : \"\") + \")\")\n  } else {\n    return genStatic(el)\n  }\n}\n\nfunction genIf (el) {\n  el.ifProcessed = true; // avoid recursion\n  return genIfConditions(el.ifConditions.slice())\n}\n\nfunction genIfConditions (conditions) {\n  if (!conditions.length) {\n    return '_e()'\n  }\n\n  var condition = conditions.shift();\n  if (condition.exp) {\n    return (\"(\" + (condition.exp) + \")?\" + (genTernaryExp(condition.block)) + \":\" + (genIfConditions(conditions)))\n  } else {\n    return (\"\" + (genTernaryExp(condition.block)))\n  }\n\n  // v-if with v-once should generate code like (a)?_m(0):_m(1)\n  function genTernaryExp (el) {\n    return el.once ? genOnce(el) : genElement(el)\n  }\n}\n\nfunction genFor (el) {\n  var exp = el.for;\n  var alias = el.alias;\n  var iterator1 = el.iterator1 ? (\",\" + (el.iterator1)) : '';\n  var iterator2 = el.iterator2 ? (\",\" + (el.iterator2)) : '';\n  el.forProcessed = true; // avoid recursion\n  return \"_l((\" + exp + \"),\" +\n    \"function(\" + alias + iterator1 + iterator2 + \"){\" +\n      \"return \" + (genElement(el)) +\n    '})'\n}\n\nfunction genData (el) {\n  var data = '{';\n\n  // directives first.\n  // directives may mutate the el's other properties before they are generated.\n  var dirs = genDirectives(el);\n  if (dirs) { data += dirs + ','; }\n\n  // key\n  if (el.key) {\n    data += \"key:\" + (el.key) + \",\";\n  }\n  // ref\n  if (el.ref) {\n    data += \"ref:\" + (el.ref) + \",\";\n  }\n  if (el.refInFor) {\n    data += \"refInFor:true,\";\n  }\n  // pre\n  if (el.pre) {\n    data += \"pre:true,\";\n  }\n  // record original tag name for components using \"is\" attribute\n  if (el.component) {\n    data += \"tag:\\\"\" + (el.tag) + \"\\\",\";\n  }\n  // module data generation functions\n  for (var i = 0; i < dataGenFns.length; i++) {\n    data += dataGenFns[i](el);\n  }\n  // attributes\n  if (el.attrs) {\n    data += \"attrs:{\" + (genProps(el.attrs)) + \"},\";\n  }\n  // DOM props\n  if (el.props) {\n    data += \"domProps:{\" + (genProps(el.props)) + \"},\";\n  }\n  // event handlers\n  if (el.events) {\n    data += (genHandlers(el.events)) + \",\";\n  }\n  if (el.nativeEvents) {\n    data += (genHandlers(el.nativeEvents, true)) + \",\";\n  }\n  // slot target\n  if (el.slotTarget) {\n    data += \"slot:\" + (el.slotTarget) + \",\";\n  }\n  // scoped slots\n  if (el.scopedSlots) {\n    data += (genScopedSlots(el.scopedSlots)) + \",\";\n  }\n  // inline-template\n  if (el.inlineTemplate) {\n    var inlineTemplate = genInlineTemplate(el);\n    if (inlineTemplate) {\n      data += inlineTemplate + \",\";\n    }\n  }\n  data = data.replace(/,$/, '') + '}';\n  // v-bind data wrap\n  if (el.wrapData) {\n    data = el.wrapData(data);\n  }\n  return data\n}\n\nfunction genDirectives (el) {\n  var dirs = el.directives;\n  if (!dirs) { return }\n  var res = 'directives:[';\n  var hasRuntime = false;\n  var i, l, dir, needRuntime;\n  for (i = 0, l = dirs.length; i < l; i++) {\n    dir = dirs[i];\n    needRuntime = true;\n    var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];\n    if (gen) {\n      // compile-time directive that manipulates AST.\n      // returns true if it also needs a runtime counterpart.\n      needRuntime = !!gen(el, dir, warn$2);\n    }\n    if (needRuntime) {\n      hasRuntime = true;\n      res += \"{name:\\\"\" + (dir.name) + \"\\\",rawName:\\\"\" + (dir.rawName) + \"\\\"\" + (dir.value ? (\",value:(\" + (dir.value) + \"),expression:\" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (\",arg:\\\"\" + (dir.arg) + \"\\\"\") : '') + (dir.modifiers ? (\",modifiers:\" + (JSON.stringify(dir.modifiers))) : '') + \"},\";\n    }\n  }\n  if (hasRuntime) {\n    return res.slice(0, -1) + ']'\n  }\n}\n\nfunction genInlineTemplate (el) {\n  var ast = el.children[0];\n  if (\"development\" !== 'production' && (\n    el.children.length > 1 || ast.type !== 1\n  )) {\n    warn$2('Inline-template components must have exactly one child element.');\n  }\n  if (ast.type === 1) {\n    var inlineRenderFns = generate(ast, currentOptions);\n    return (\"inlineTemplate:{render:function(){\" + (inlineRenderFns.render) + \"},staticRenderFns:[\" + (inlineRenderFns.staticRenderFns.map(function (code) { return (\"function(){\" + code + \"}\"); }).join(',')) + \"]}\")\n  }\n}\n\nfunction genScopedSlots (slots) {\n  return (\"scopedSlots:{\" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + \"}\")\n}\n\nfunction genScopedSlot (key, el) {\n  return key + \":function(\" + (String(el.attrsMap.scope)) + \"){\" +\n    \"return \" + (el.tag === 'template'\n      ? genChildren(el) || 'void 0'\n      : genElement(el)) + \"}\"\n}\n\nfunction genChildren (el) {\n  if (el.children.length) {\n    return '[' + el.children.map(genNode).join(',') + ']'\n  }\n}\n\nfunction genNode (node) {\n  if (node.type === 1) {\n    return genElement(node)\n  } else {\n    return genText(node)\n  }\n}\n\nfunction genText (text) {\n  return text.type === 2\n    ? text.expression // no need for () because already wrapped in _s()\n    : transformSpecialNewlines(JSON.stringify(text.text))\n}\n\nfunction genSlot (el) {\n  var slotName = el.slotName || '\"default\"';\n  var children = genChildren(el);\n  return (\"_t(\" + slotName + (children ? (\",\" + children) : '') + (el.attrs ? ((children ? '' : ',null') + \",{\" + (el.attrs.map(function (a) { return ((camelize(a.name)) + \":\" + (a.value)); }).join(',')) + \"}\") : '') + \")\")\n}\n\n// componentName is el.component, take it as argument to shun flow's pessimistic refinement\nfunction genComponent (componentName, el) {\n  var children = el.inlineTemplate ? null : genChildren(el);\n  return (\"_h(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}\n\nfunction genProps (props) {\n  var res = '';\n  for (var i = 0; i < props.length; i++) {\n    var prop = props[i];\n    res += \"\\\"\" + (prop.name) + \"\\\":\" + (transformSpecialNewlines(prop.value)) + \",\";\n  }\n  return res.slice(0, -1)\n}\n\n// #3895, #4268\nfunction transformSpecialNewlines (text) {\n  return text\n    .replace(/\\u2028/g, '\\\\u2028')\n    .replace(/\\u2029/g, '\\\\u2029')\n}\n\n/*  */\n\n/**\n * Compile a template.\n */\nfunction compile$1 (\n  template,\n  options\n) {\n  var ast = parse(template.trim(), options);\n  optimize(ast, options);\n  var code = generate(ast, options);\n  return {\n    ast: ast,\n    render: code.render,\n    staticRenderFns: code.staticRenderFns\n  }\n}\n\n/*  */\n\n// operators like typeof, instanceof and in are allowed\nvar prohibitedKeywordRE = new RegExp('\\\\b' + (\n  'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n  'super,throw,while,yield,delete,export,import,return,switch,default,' +\n  'extends,finally,continue,debugger,function,arguments'\n).split(',').join('\\\\b|\\\\b') + '\\\\b');\n// check valid identifier for v-for\nvar identRE = /[A-Za-z_$][\\w$]*/;\n// strip strings in expressions\nvar stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\n\n// detect problematic expressions in a template\nfunction detectErrors (ast) {\n  var errors = [];\n  if (ast) {\n    checkNode(ast, errors);\n  }\n  return errors\n}\n\nfunction checkNode (node, errors) {\n  if (node.type === 1) {\n    for (var name in node.attrsMap) {\n      if (dirRE.test(name)) {\n        var value = node.attrsMap[name];\n        if (value) {\n          if (name === 'v-for') {\n            checkFor(node, (\"v-for=\\\"\" + value + \"\\\"\"), errors);\n          } else {\n            checkExpression(value, (name + \"=\\\"\" + value + \"\\\"\"), errors);\n          }\n        }\n      }\n    }\n    if (node.children) {\n      for (var i = 0; i < node.children.length; i++) {\n        checkNode(node.children[i], errors);\n      }\n    }\n  } else if (node.type === 2) {\n    checkExpression(node.expression, node.text, errors);\n  }\n}\n\nfunction checkFor (node, text, errors) {\n  checkExpression(node.for || '', text, errors);\n  checkIdentifier(node.alias, 'v-for alias', text, errors);\n  checkIdentifier(node.iterator1, 'v-for iterator', text, errors);\n  checkIdentifier(node.iterator2, 'v-for iterator', text, errors);\n}\n\nfunction checkIdentifier (ident, type, text, errors) {\n  if (typeof ident === 'string' && !identRE.test(ident)) {\n    errors.push((\"- invalid \" + type + \" \\\"\" + ident + \"\\\" in expression: \" + text));\n  }\n}\n\nfunction checkExpression (exp, text, errors) {\n  try {\n    new Function((\"return \" + exp));\n  } catch (e) {\n    var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);\n    if (keywordMatch) {\n      errors.push(\n        \"- avoid using JavaScript keyword as property name: \" +\n        \"\\\"\" + (keywordMatch[0]) + \"\\\" in expression \" + text\n      );\n    } else {\n      errors.push((\"- invalid expression: \" + text));\n    }\n  }\n}\n\n/*  */\n\nfunction transformNode (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticClass = getAndRemoveAttr(el, 'class');\n  if (\"development\" !== 'production' && staticClass) {\n    var expression = parseText(staticClass, options.delimiters);\n    if (expression) {\n      warn(\n        \"class=\\\"\" + staticClass + \"\\\": \" +\n        'Interpolation inside attributes has been removed. ' +\n        'Use v-bind or the colon shorthand instead. For example, ' +\n        'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.'\n      );\n    }\n  }\n  if (staticClass) {\n    el.staticClass = JSON.stringify(staticClass);\n  }\n  var classBinding = getBindingAttr(el, 'class', false /* getStatic */);\n  if (classBinding) {\n    el.classBinding = classBinding;\n  }\n}\n\nfunction genData$1 (el) {\n  var data = '';\n  if (el.staticClass) {\n    data += \"staticClass:\" + (el.staticClass) + \",\";\n  }\n  if (el.classBinding) {\n    data += \"class:\" + (el.classBinding) + \",\";\n  }\n  return data\n}\n\nvar klass$1 = {\n  staticKeys: ['staticClass'],\n  transformNode: transformNode,\n  genData: genData$1\n};\n\n/*  */\n\nfunction transformNode$1 (el, options) {\n  var warn = options.warn || baseWarn;\n  var staticStyle = getAndRemoveAttr(el, 'style');\n  if (staticStyle) {\n    /* istanbul ignore if */\n    {\n      var expression = parseText(staticStyle, options.delimiters);\n      if (expression) {\n        warn(\n          \"style=\\\"\" + staticStyle + \"\\\": \" +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.'\n        );\n      }\n    }\n    el.staticStyle = JSON.stringify(parseStyleText(staticStyle));\n  }\n\n  var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);\n  if (styleBinding) {\n    el.styleBinding = styleBinding;\n  }\n}\n\nfunction genData$2 (el) {\n  var data = '';\n  if (el.staticStyle) {\n    data += \"staticStyle:\" + (el.staticStyle) + \",\";\n  }\n  if (el.styleBinding) {\n    data += \"style:(\" + (el.styleBinding) + \"),\";\n  }\n  return data\n}\n\nvar style$1 = {\n  staticKeys: ['staticStyle'],\n  transformNode: transformNode$1,\n  genData: genData$2\n};\n\nvar modules$1 = [\n  klass$1,\n  style$1\n];\n\n/*  */\n\nvar warn$3;\n\nfunction model$1 (\n  el,\n  dir,\n  _warn\n) {\n  warn$3 = _warn;\n  var value = dir.value;\n  var modifiers = dir.modifiers;\n  var tag = el.tag;\n  var type = el.attrsMap.type;\n  {\n    var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];\n    if (tag === 'input' && dynamicType) {\n      warn$3(\n        \"<input :type=\\\"\" + dynamicType + \"\\\" v-model=\\\"\" + value + \"\\\">:\\n\" +\n        \"v-model does not support dynamic input types. Use v-if branches instead.\"\n      );\n    }\n  }\n  if (tag === 'select') {\n    genSelect(el, value, modifiers);\n  } else if (tag === 'input' && type === 'checkbox') {\n    genCheckboxModel(el, value, modifiers);\n  } else if (tag === 'input' && type === 'radio') {\n    genRadioModel(el, value, modifiers);\n  } else {\n    genDefaultModel(el, value, modifiers);\n  }\n  // ensure runtime directive metadata\n  return true\n}\n\nfunction genCheckboxModel (\n  el,\n  value,\n  modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';\n  var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';\n  addProp(el, 'checked',\n    \"Array.isArray(\" + value + \")\" +\n      \"?_i(\" + value + \",\" + valueBinding + \")>-1\" +\n      \":_q(\" + value + \",\" + trueValueBinding + \")\"\n  );\n  addHandler(el, 'change',\n    \"var $$a=\" + value + \",\" +\n        '$$el=$event.target,' +\n        \"$$c=$$el.checked?(\" + trueValueBinding + \"):(\" + falseValueBinding + \");\" +\n    'if(Array.isArray($$a)){' +\n      \"var $$v=\" + (number ? '_n(' + valueBinding + ')' : valueBinding) + \",\" +\n          '$$i=_i($$a,$$v);' +\n      \"if($$c){$$i<0&&(\" + value + \"=$$a.concat($$v))}\" +\n      \"else{$$i>-1&&(\" + value + \"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}\" +\n    \"}else{\" + value + \"=$$c}\",\n    null, true\n  );\n}\n\nfunction genRadioModel (\n    el,\n    value,\n    modifiers\n) {\n  if (\"development\" !== 'production' &&\n    el.attrsMap.checked != null) {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" checked>:\\n\" +\n      \"inline checked attributes will be ignored when using v-model. \" +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n  }\n  var number = modifiers && modifiers.number;\n  var valueBinding = getBindingAttr(el, 'value') || 'null';\n  valueBinding = number ? (\"_n(\" + valueBinding + \")\") : valueBinding;\n  addProp(el, 'checked', (\"_q(\" + value + \",\" + valueBinding + \")\"));\n  addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);\n}\n\nfunction genDefaultModel (\n  el,\n  value,\n  modifiers\n) {\n  {\n    if (el.tag === 'input' && el.attrsMap.value) {\n      warn$3(\n        \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" value=\\\"\" + (el.attrsMap.value) + \"\\\">:\\n\" +\n        'inline value attributes will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n    if (el.tag === 'textarea' && el.children.length) {\n      warn$3(\n        \"<textarea v-model=\\\"\" + value + \"\\\">:\\n\" +\n        'inline content inside <textarea> will be ignored when using v-model. ' +\n        'Declare initial values in the component\\'s data option instead.'\n      );\n    }\n  }\n\n  var type = el.attrsMap.type;\n  var ref = modifiers || {};\n  var lazy = ref.lazy;\n  var number = ref.number;\n  var trim = ref.trim;\n  var event = lazy || (isIE && type === 'range') ? 'change' : 'input';\n  var needCompositionGuard = !lazy && type !== 'range';\n  var isNative = el.tag === 'input' || el.tag === 'textarea';\n\n  var valueExpression = isNative\n    ? (\"$event.target.value\" + (trim ? '.trim()' : ''))\n    : trim ? \"(typeof $event === 'string' ? $event.trim() : $event)\" : \"$event\";\n  valueExpression = number || type === 'number'\n    ? (\"_n(\" + valueExpression + \")\")\n    : valueExpression;\n  var code = genAssignmentCode(value, valueExpression);\n  if (isNative && needCompositionGuard) {\n    code = \"if($event.target.composing)return;\" + code;\n  }\n  // inputs with type=\"file\" are read only and setting the input's\n  // value will throw an error.\n  if (\"development\" !== 'production' &&\n      type === 'file') {\n    warn$3(\n      \"<\" + (el.tag) + \" v-model=\\\"\" + value + \"\\\" type=\\\"file\\\">:\\n\" +\n      \"File inputs are read only. Use a v-on:change listener instead.\"\n    );\n  }\n  addProp(el, 'value', isNative ? (\"_s(\" + value + \")\") : (\"(\" + value + \")\"));\n  addHandler(el, event, code, null, true);\n}\n\nfunction genSelect (\n    el,\n    value,\n    modifiers\n) {\n  {\n    el.children.some(checkOptionWarning);\n  }\n\n  var number = modifiers && modifiers.number;\n  var assignment = \"Array.prototype.filter\" +\n    \".call($event.target.options,function(o){return o.selected})\" +\n    \".map(function(o){var val = \\\"_value\\\" in o ? o._value : o.value;\" +\n    \"return \" + (number ? '_n(val)' : 'val') + \"})\" +\n    (el.attrsMap.multiple == null ? '[0]' : '');\n\n  var code = genAssignmentCode(value, assignment);\n  addHandler(el, 'change', code, null, true);\n}\n\nfunction checkOptionWarning (option) {\n  if (option.type === 1 &&\n    option.tag === 'option' &&\n    option.attrsMap.selected != null) {\n    warn$3(\n      \"<select v-model=\\\"\" + (option.parent.attrsMap['v-model']) + \"\\\">:\\n\" +\n      'inline selected attributes on <option> will be ignored when using v-model. ' +\n      'Declare initial values in the component\\'s data option instead.'\n    );\n    return true\n  }\n  return false\n}\n\nfunction genAssignmentCode (value, assignment) {\n  var modelRs = parseModel(value);\n  if (modelRs.idx === null) {\n    return (value + \"=\" + assignment)\n  } else {\n    return \"var $$exp = \" + (modelRs.exp) + \", $$idx = \" + (modelRs.idx) + \";\" +\n      \"if (!Array.isArray($$exp)){\" +\n        value + \"=\" + assignment + \"}\" +\n      \"else{$$exp.splice($$idx, 1, \" + assignment + \")}\"\n  }\n}\n\n/*  */\n\nfunction text (el, dir) {\n  if (dir.value) {\n    addProp(el, 'textContent', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\n/*  */\n\nfunction html (el, dir) {\n  if (dir.value) {\n    addProp(el, 'innerHTML', (\"_s(\" + (dir.value) + \")\"));\n  }\n}\n\nvar directives$1 = {\n  model: model$1,\n  text: text,\n  html: html\n};\n\n/*  */\n\nvar cache = Object.create(null);\n\nvar baseOptions = {\n  expectHTML: true,\n  modules: modules$1,\n  staticKeys: genStaticKeys(modules$1),\n  directives: directives$1,\n  isReservedTag: isReservedTag,\n  isUnaryTag: isUnaryTag,\n  mustUseProp: mustUseProp,\n  getTagNamespace: getTagNamespace,\n  isPreTag: isPreTag\n};\n\nfunction compile$$1 (\n  template,\n  options\n) {\n  options = options\n    ? extend(extend({}, baseOptions), options)\n    : baseOptions;\n  return compile$1(template, options)\n}\n\nfunction compileToFunctions (\n  template,\n  options,\n  vm\n) {\n  var _warn = (options && options.warn) || warn;\n  // detect possible CSP restriction\n  /* istanbul ignore if */\n  {\n    try {\n      new Function('return 1');\n    } catch (e) {\n      if (e.toString().match(/unsafe-eval|CSP/)) {\n        _warn(\n          'It seems you are using the standalone build of Vue.js in an ' +\n          'environment with Content Security Policy that prohibits unsafe-eval. ' +\n          'The template compiler cannot work in this environment. Consider ' +\n          'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n          'templates into render functions.'\n        );\n      }\n    }\n  }\n  var key = options && options.delimiters\n    ? String(options.delimiters) + template\n    : template;\n  if (cache[key]) {\n    return cache[key]\n  }\n  var res = {};\n  var compiled = compile$$1(template, options);\n  res.render = makeFunction(compiled.render);\n  var l = compiled.staticRenderFns.length;\n  res.staticRenderFns = new Array(l);\n  for (var i = 0; i < l; i++) {\n    res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);\n  }\n  {\n    if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {\n      _warn(\n        \"failed to compile template:\\n\\n\" + template + \"\\n\\n\" +\n        detectErrors(compiled.ast).join('\\n') +\n        '\\n\\n',\n        vm\n      );\n    }\n  }\n  return (cache[key] = res)\n}\n\nfunction makeFunction (code) {\n  try {\n    return new Function(code)\n  } catch (e) {\n    return noop\n  }\n}\n\n/*  */\n\nvar idToTemplate = cached(function (id) {\n  var el = query(id);\n  return el && el.innerHTML\n});\n\nvar mount = Vue$3.prototype.$mount;\nVue$3.prototype.$mount = function (\n  el,\n  hydrating\n) {\n  el = el && query(el);\n\n  /* istanbul ignore if */\n  if (el === document.body || el === document.documentElement) {\n    \"development\" !== 'production' && warn(\n      \"Do not mount Vue to <html> or <body> - mount to normal elements instead.\"\n    );\n    return this\n  }\n\n  var options = this.$options;\n  // resolve template/el and convert to render function\n  if (!options.render) {\n    var template = options.template;\n    if (template) {\n      if (typeof template === 'string') {\n        if (template.charAt(0) === '#') {\n          template = idToTemplate(template);\n          /* istanbul ignore if */\n          if (\"development\" !== 'production' && !template) {\n            warn(\n              (\"Template element not found or is empty: \" + (options.template)),\n              this\n            );\n          }\n        }\n      } else if (template.nodeType) {\n        template = template.innerHTML;\n      } else {\n        {\n          warn('invalid template option:' + template, this);\n        }\n        return this\n      }\n    } else if (el) {\n      template = getOuterHTML(el);\n    }\n    if (template) {\n      var ref = compileToFunctions(template, {\n        warn: warn,\n        shouldDecodeNewlines: shouldDecodeNewlines,\n        delimiters: options.delimiters\n      }, this);\n      var render = ref.render;\n      var staticRenderFns = ref.staticRenderFns;\n      options.render = render;\n      options.staticRenderFns = staticRenderFns;\n    }\n  }\n  return mount.call(this, el, hydrating)\n};\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n */\nfunction getOuterHTML (el) {\n  if (el.outerHTML) {\n    return el.outerHTML\n  } else {\n    var container = document.createElement('div');\n    container.appendChild(el.cloneNode(true));\n    return container.innerHTML\n  }\n}\n\nVue$3.compile = compileToFunctions;\n\nreturn Vue$3;\n\n})));"
  },
  {
    "path": "vue-cli/.eslintignore",
    "content": "src/assets/RongIMLib-2.5.0.js\nsrc/assets/RongIMLib-2.5.1.js\nsrc/assets/protobuf-2.3.5.min.js\nsrc/assets/protobuf-2.3.6.min.js"
  },
  {
    "path": "vue-cli/.gitignore",
    "content": ".DS_Store\nnode_modules\n/dist\n\n# local env files\n.env.local\n.env.*.local\n\n# Log files\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Editor directories and files\n.idea\n.vscode\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\npackage-lock.json"
  },
  {
    "path": "vue-cli/README.md",
    "content": "# vue-cli-3.0\n\n## Project setup\n```\nnpm install\n```\n\n### Compiles and hot-reloads for development\n```\nnpm run serve\n```\n\n### Compiles and minifies for production\n```\nnpm run build\n```\n\n### Run your tests\n```\nnpm run test\n```\n\n### Lints and fixes files\n```\nnpm run lint\n```\n\n### Customize configuration\nSee [Configuration Reference](https://cli.vuejs.org/config/).\n\n### 注意事项\n\n1、需关注 public/index.html RongIMLib 文件的引入\n\n2、需关注 src/components/Init.vue 的链接代码"
  },
  {
    "path": "vue-cli/babel.config.js",
    "content": "module.exports = {\n  presets: [\n    '@vue/app'\n  ]\n}\n"
  },
  {
    "path": "vue-cli/package.json",
    "content": "{\n  \"name\": \"vue-cli-3.0\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"serve\": \"vue-cli-service serve\",\n    \"build\": \"vue-cli-service build\",\n    \"lint\": \"vue-cli-service lint\"\n  },\n  \"dependencies\": {\n    \"core-js\": \"^2.6.5\",\n    \"vue\": \"^2.6.10\"\n  },\n  \"devDependencies\": {\n    \"@vue/cli-plugin-babel\": \"^3.11.0\",\n    \"@vue/cli-plugin-eslint\": \"^3.11.0\",\n    \"@vue/cli-service\": \"^3.11.0\",\n    \"babel-eslint\": \"^10.0.1\",\n    \"eslint\": \"^5.16.0\",\n    \"eslint-plugin-vue\": \"^5.0.0\",\n    \"vue-template-compiler\": \"^2.6.10\"\n  },\n  \"eslintConfig\": {\n    \"root\": true,\n    \"env\": {\n      \"node\": true\n    },\n    \"extends\": [\n      \"plugin:vue/essential\",\n      \"eslint:recommended\"\n    ],\n    \"rules\": {},\n    \"parserOptions\": {\n      \"parser\": \"babel-eslint\"\n    }\n  },\n  \"postcss\": {\n    \"plugins\": {\n      \"autoprefixer\": {}\n    }\n  },\n  \"browserslist\": [\n    \"> 1%\",\n    \"last 2 versions\"\n  ]\n}\n"
  },
  {
    "path": "vue-cli/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n    <link rel=\"icon\" href=\"<%= BASE_URL %>favicon.ico\">\n    <script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n    <title>vue-cli-3.0</title>\n  </head>\n  <body>\n    <noscript>\n      <strong>We're sorry but vue-cli-3.0 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>\n    </noscript>\n    <div id=\"app\"></div>\n    <!-- built files will be auto injected -->\n  </body>\n</html>\n"
  },
  {
    "path": "vue-cli/src/App.vue",
    "content": "<template>\n  <div id=\"app\">\n    <Init/>\n  </div>\n</template>\n\n<script>\nimport Init from './components/Init.vue'\n\nexport default {\n  name: 'app',\n  components: {\n    Init\n  }\n}\n</script>\n\n<style>\n#app {\n  font-family: 'Avenir', Helvetica, Arial, sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  text-align: center;\n  color: #2c3e50;\n  margin-top: 60px;\n}\n</style>\n"
  },
  {
    "path": "vue-cli/src/components/Init.vue",
    "content": "<template>\n  <div style=\"text-align: left;\">\n    <h1>Web SDK Vue CLI</h1>\n    <p class=\"rong-input\">\n      <span>appkey:</span>\n      <input type=\"text\" v-model=\"appkey\" size=\"20\">\n    </p>\n    <p class=\"rong-input\">\n      <span>token:</span><input type=\"text\" size=\"110\" v-model=\"token\">\n    </p>\n    <p class=\"rong-input\">\n      <span>navi:</span><input type=\"text\" size=\"50\" v-model=\"navi\"><i>此配置项仅针对私有部署，公有云请置空，格式为 10.10.10.10:8080</i>\n    </p>\n    <p class=\"rong-input\">\n      <span></span>\n      <button @click=\"init\">初始化链接</button>\n    </p>\n    <div class=\"rong-show-box\">\n      <h3>初始化以及消息接收:</h3>\n      <p v-for=\"data in showDatas\" v-bind:key=\"data\">\n        {{data}}\n      </p>\n    </div>\n  </div>\n</template>\n\n<script>\nvar RongIMLib = window.RongIMLib;\nvar RongIMClient = RongIMLib.RongIMClient;\n\nfunction init (params, addPromptInfo) {\n  var appkey = params.appkey\n  var token = params.token\n  RongIMClient.init(appkey, null, params)\n  RongIMClient.setConnectionStatusListener({\n    onChanged: function (status) {\n      switch (status) {\n        case RongIMLib.ConnectionStatus['CONNECTED']:\n        case 0:\n          addPromptInfo('连接成功')\n          break\n\n        case RongIMLib.ConnectionStatus['CONNECTING']:\n        case 1:\n          addPromptInfo('连接中')\n          break\n\n        case RongIMLib.ConnectionStatus['DISCONNECTED']:\n        case 2:\n          addPromptInfo('当前用户主动断开链接')\n          break\n\n        case RongIMLib.ConnectionStatus['NETWORK_UNAVAILABLE']:\n        case 3:\n          addPromptInfo('网络不可用')\n          break\n\n        case RongIMLib.ConnectionStatus['CONNECTION_CLOSED']:\n        case 4:\n          addPromptInfo('未知原因，连接关闭')\n          break\n\n        case RongIMLib.ConnectionStatus['KICKED_OFFLINE_BY_OTHER_CLIENT']:\n        case 6:\n          addPromptInfo('用户账户在其他设备登录，本机会被踢掉线')\n          break\n\n        case RongIMLib.ConnectionStatus['DOMAIN_INCORRECT']:\n        case 12:\n          addPromptInfo('当前运行域名错误，请检查安全域名配置')\n          break\n      }\n    }\n  })\n\n  RongIMClient.setOnReceiveMessageListener({\n    // 接收到的消息\n    onReceived: function (message) {\n      addPromptInfo('新消息 ' + message.targetId + ':' + JSON.stringify(message))\n    }\n  })\n\n  RongIMClient.connect(token, {\n    onSuccess: function (userId) {\n      addPromptInfo('链接成功，用户id：' + userId)\n    },\n    onTokenIncorrect: function () {\n      addPromptInfo('token无效')\n    },\n    onError: function (errorCode) {\n      addPromptInfo(errorCode)\n    }\n  }, null)\n}\n\nexport default {\n  name: 'landing-page',\n  data: function () {\n    return {\n      appkey: '此处填写您的 appkey',\n      token: '此处填写您的 token',\n      navi: '',\n      showDatas: []\n    }\n  },\n  methods: {\n    addPromptInfo: function (prompt) {\n      this.showDatas.push(prompt)\n    },\n    init: function () {\n      var appkey = this.appkey\n      var token = this.token\n      if (!appkey || !token) {\n        alert('appkey 和 token 不能为空')\n      } else {\n        init({\n          appkey: appkey,\n          token: token,\n          navi: this.navi\n        }, this.addPromptInfo)\n      }\n    }\n  }\n}\n</script>\n\n<style>\n.rong-input span {\n  display: inline-block;\n  width: 60px;\n}\n.rong-show-box {\n  border: 1px solid lightgray;\n  padding: 10px;\n}\n.rong-show-box h3, .rong-show-box p {\n  margin: 5px 0;\n}\n\n</style>\n"
  },
  {
    "path": "vue-cli/src/main.js",
    "content": "import Vue from 'vue'\nimport App from './App.vue'\n\nnew Vue({\n  render: h => h(App),\n}).$mount('#app')\n"
  },
  {
    "path": "vue-cli-4/.gitignore",
    "content": ".DS_Store\nnode_modules\n/dist\n\n# local env files\n.env.local\n.env.*.local\n\n# Log files\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Editor directories and files\n.idea\n.vscode\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\npackage-lock.json\n"
  },
  {
    "path": "vue-cli-4/README.md",
    "content": "# vue-cli-4\n\n## Project setup\n```\nnpm install\n```\n\n### Compiles and hot-reloads for development\n```\nnpm run serve\n```\n\n### Compiles and minifies for production\n```\nnpm run build\n```\n\n### Lints and fixes files\n```\nnpm run lint\n```\n\n### Customize configuration\nSee [Configuration Reference](https://cli.vuejs.org/config/).\n\n### 注意事项\n\n1、需关注 public/index.html RongIMLib 文件的引入\n\n2、需关注 src/components/Init.vue 的链接代码"
  },
  {
    "path": "vue-cli-4/babel.config.js",
    "content": "module.exports = {\n  presets: [\n    '@vue/cli-plugin-babel/preset'\n  ]\n}\n"
  },
  {
    "path": "vue-cli-4/package.json",
    "content": "{\n  \"name\": \"vue-cli-4\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"serve\": \"vue-cli-service serve\",\n    \"build\": \"vue-cli-service build\",\n    \"lint\": \"vue-cli-service lint\"\n  },\n  \"dependencies\": {\n    \"core-js\": \"^3.4.3\",\n    \"vue\": \"^2.6.10\"\n  },\n  \"devDependencies\": {\n    \"@vue/cli-plugin-babel\": \"^4.1.0\",\n    \"@vue/cli-plugin-eslint\": \"^4.1.0\",\n    \"@vue/cli-service\": \"^4.1.0\",\n    \"babel-eslint\": \"^10.0.3\",\n    \"eslint\": \"^5.16.0\",\n    \"eslint-plugin-vue\": \"^5.0.0\",\n    \"vue-template-compiler\": \"^2.6.10\"\n  },\n  \"eslintConfig\": {\n    \"root\": true,\n    \"env\": {\n      \"node\": true\n    },\n    \"extends\": [\n      \"plugin:vue/essential\",\n      \"eslint:recommended\"\n    ],\n    \"rules\": {},\n    \"parserOptions\": {\n      \"parser\": \"babel-eslint\"\n    }\n  },\n  \"browserslist\": [\n    \"> 1%\",\n    \"last 2 versions\"\n  ]\n}\n"
  },
  {
    "path": "vue-cli-4/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n    <link rel=\"icon\" href=\"<%= BASE_URL %>favicon.ico\">\n    <script src=\"//cdn.ronghub.com/RongIMLib-2.5.4.js\"></script>\n    <title>vue-cli-4</title>\n  </head>\n  <body>\n    <noscript>\n      <strong>We're sorry but vue-cli-4 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>\n    </noscript>\n    <div id=\"app\"></div>\n    <!-- built files will be auto injected -->\n  </body>\n</html>\n"
  },
  {
    "path": "vue-cli-4/src/App.vue",
    "content": "<template>\n  <div id=\"app\">\n    <Init/>\n  </div>\n</template>\n\n<script>\nimport Init from './components/Init.vue'\n\nexport default {\n  name: 'app',\n  components: {\n    Init\n  }\n}\n</script>\n\n<style>\n#app {\n  font-family: 'Avenir', Helvetica, Arial, sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  text-align: center;\n  color: #2c3e50;\n  margin-top: 60px;\n}\n</style>\n"
  },
  {
    "path": "vue-cli-4/src/components/Init.vue",
    "content": "<template>\n  <div style=\"text-align: left;\">\n    <h1>Web SDK Vue CLI</h1>\n    <p class=\"rong-input\">\n      <span>appkey:</span>\n      <input type=\"text\" v-model=\"appkey\" size=\"20\">\n    </p>\n    <p class=\"rong-input\">\n      <span>token:</span><input type=\"text\" size=\"110\" v-model=\"token\">\n    </p>\n    <p class=\"rong-input\">\n      <span>navi:</span><input type=\"text\" size=\"50\" v-model=\"navi\"><i>此配置项仅针对私有部署，公有云请置空，格式为 10.10.10.10:8080</i>\n    </p>\n    <p class=\"rong-input\">\n      <span></span>\n      <button @click=\"init\">初始化链接</button>\n    </p>\n    <div class=\"rong-show-box\">\n      <h3>初始化以及消息接收:</h3>\n      <p v-for=\"data in showDatas\" v-bind:key=\"data\">\n        {{data}}\n      </p>\n    </div>\n  </div>\n</template>\n\n<script>\n\nvar RongIMLib = window.RongIMLib; // 由 window 赋值\nvar RongIMClient = RongIMLib.RongIMClient;\n\nfunction init (params, addPromptInfo) {\n  var appkey = params.appkey\n  var token = params.token\n  RongIMClient.init(appkey, null, params)\n  RongIMClient.setConnectionStatusListener({\n    onChanged: function (status) {\n      switch (status) {\n        case RongIMLib.ConnectionStatus['CONNECTED']:\n        case 0:\n          addPromptInfo('连接成功')\n          break\n\n        case RongIMLib.ConnectionStatus['CONNECTING']:\n        case 1:\n          addPromptInfo('连接中')\n          break\n\n        case RongIMLib.ConnectionStatus['DISCONNECTED']:\n        case 2:\n          addPromptInfo('当前用户主动断开链接')\n          break\n\n        case RongIMLib.ConnectionStatus['NETWORK_UNAVAILABLE']:\n        case 3:\n          addPromptInfo('网络不可用')\n          break\n\n        case RongIMLib.ConnectionStatus['CONNECTION_CLOSED']:\n        case 4:\n          addPromptInfo('未知原因，连接关闭')\n          break\n\n        case RongIMLib.ConnectionStatus['KICKED_OFFLINE_BY_OTHER_CLIENT']:\n        case 6:\n          addPromptInfo('用户账户在其他设备登录，本机会被踢掉线')\n          break\n\n        case RongIMLib.ConnectionStatus['DOMAIN_INCORRECT']:\n        case 12:\n          addPromptInfo('当前运行域名错误，请检查安全域名配置')\n          break\n      }\n    }\n  })\n\n  RongIMClient.setOnReceiveMessageListener({\n    // 接收到的消息\n    onReceived: function (message) {\n      addPromptInfo('新消息 ' + message.targetId + ':' + JSON.stringify(message))\n    }\n  })\n\n  RongIMClient.connect(token, {\n    onSuccess: function (userId) {\n      addPromptInfo('链接成功，用户id：' + userId)\n    },\n    onTokenIncorrect: function () {\n      addPromptInfo('token无效')\n    },\n    onError: function (errorCode) {\n      addPromptInfo(errorCode)\n    }\n  }, null)\n}\n\nexport default {\n  name: 'landing-page',\n  data: function () {\n    return {\n      appkey: '此处填写您的 appkey',\n      token: '此处填写您的 token',\n      navi: '',\n      showDatas: []\n    }\n  },\n  methods: {\n    addPromptInfo: function (prompt) {\n      this.showDatas.push(prompt)\n    },\n    init: function () {\n      var appkey = this.appkey\n      var token = this.token\n      if (!appkey || !token) {\n        alert('appkey 和 token 不能为空')\n      } else {\n        init({\n          appkey: appkey,\n          token: token,\n          navi: this.navi\n        }, this.addPromptInfo)\n      }\n    }\n  }\n}\n</script>\n\n<style>\n.rong-input span {\n  display: inline-block;\n  width: 60px;\n}\n.rong-show-box {\n  border: 1px solid lightgray;\n  padding: 10px;\n}\n.rong-show-box h3, .rong-show-box p {\n  margin: 5px 0;\n}\n\n</style>\n"
  },
  {
    "path": "vue-cli-4/src/main.js",
    "content": "import Vue from 'vue'\nimport App from './App.vue'\n\nVue.config.productionTip = false\n\nnew Vue({\n  render: h => h(App),\n}).$mount('#app')\n"
  }
]